summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Contents23
-rwxr-xr-xContents.infobin0 -> 582 bytes
-rw-r--r--Filelist657
-rw-r--r--Makefile629
-rwxr-xr-xREADME.txt.infobin0 -> 582 bytes
-rw-r--r--README_ami.txt32
-rwxr-xr-xREADME_ami.txt.infobin0 -> 582 bytes
-rw-r--r--README_amibin.txt12
-rwxr-xr-xREADME_amibin.txt.infobin0 -> 582 bytes
-rw-r--r--README_amisrc.txt11
-rwxr-xr-xREADME_amisrc.txt.infobin0 -> 582 bytes
-rw-r--r--README_bindos.txt19
-rw-r--r--README_dos.txt154
-rw-r--r--README_extra.txt61
-rw-r--r--README_lang.txt5
-rw-r--r--README_mac.txt8
-rw-r--r--README_ole.txt20
-rw-r--r--README_os2.txt58
-rw-r--r--README_os390.txt130
-rw-r--r--README_src.txt10
-rw-r--r--README_srcdos.txt12
-rw-r--r--README_unix.txt10
-rw-r--r--README_vms.txt41
-rw-r--r--README_w32s.txt15
-rwxr-xr-xVim.infobin0 -> 624 bytes
-rwxr-xr-xXxd.infobin0 -> 835 bytes
-rwxr-xr-xconfigure6
-rwxr-xr-xcsdpmi4b.zipbin0 -> 41506 bytes
-rw-r--r--emx.dllbin0 -> 81982 bytes
-rw-r--r--emxlibcs.dllbin0 -> 140867 bytes
-rw-r--r--libs/arp.librarybin0 -> 17100 bytes
-rw-r--r--nsis/README.txt42
-rw-r--r--nsis/gvim.nsi442
-rw-r--r--pixmaps/alert.xpm44
-rw-r--r--pixmaps/error.xpm44
-rw-r--r--pixmaps/gen-inline-pixbufs.sh13
-rw-r--r--pixmaps/generic.xpm44
-rw-r--r--pixmaps/info.xpm44
-rw-r--r--pixmaps/quest.xpm44
-rw-r--r--pixmaps/stock_icons.h1700
-rw-r--r--pixmaps/tb_blank.xpm28
-rw-r--r--pixmaps/tb_close.xpm31
-rw-r--r--pixmaps/tb_copy.xpm28
-rw-r--r--pixmaps/tb_ctags.xpm31
-rw-r--r--pixmaps/tb_cut.xpm27
-rw-r--r--pixmaps/tb_exit.xpm33
-rw-r--r--pixmaps/tb_find.xpm29
-rw-r--r--pixmaps/tb_find_help.xpm29
-rw-r--r--pixmaps/tb_find_next.xpm31
-rw-r--r--pixmaps/tb_find_prev.xpm31
-rw-r--r--pixmaps/tb_help.xpm27
-rw-r--r--pixmaps/tb_jump.xpm30
-rw-r--r--pixmaps/tb_load_session.xpm33
-rw-r--r--pixmaps/tb_macro.xpm28
-rw-r--r--pixmaps/tb_make.xpm28
-rw-r--r--pixmaps/tb_maximize.xpm29
-rw-r--r--pixmaps/tb_maxwidth.xpm29
-rw-r--r--pixmaps/tb_minimize.xpm29
-rw-r--r--pixmaps/tb_minwidth.xpm29
-rw-r--r--pixmaps/tb_new.xpm29
-rw-r--r--pixmaps/tb_new_session.xpm32
-rw-r--r--pixmaps/tb_open.xpm31
-rw-r--r--pixmaps/tb_paste.xpm31
-rw-r--r--pixmaps/tb_print.xpm31
-rw-r--r--pixmaps/tb_redo.xpm28
-rw-r--r--pixmaps/tb_replace.xpm33
-rw-r--r--pixmaps/tb_save.xpm29
-rw-r--r--pixmaps/tb_save_all.xpm29
-rw-r--r--pixmaps/tb_save_session.xpm33
-rw-r--r--pixmaps/tb_shell.xpm30
-rw-r--r--pixmaps/tb_split.xpm29
-rw-r--r--pixmaps/tb_undo.xpm28
-rw-r--r--pixmaps/tb_vsplit.xpm29
-rwxr-xr-xruntime.infobin0 -> 624 bytes
-rw-r--r--runtime/bugreport.vim86
-rw-r--r--runtime/colors/README.txt61
-rw-r--r--runtime/colors/blue.vim77
-rw-r--r--runtime/colors/darkblue.vim62
-rw-r--r--runtime/colors/default.vim23
-rw-r--r--runtime/colors/delek.vim57
-rw-r--r--runtime/colors/desert.vim108
-rw-r--r--runtime/colors/elflord.vim50
-rw-r--r--runtime/colors/evening.vim54
-rw-r--r--runtime/colors/koehler.vim64
-rw-r--r--runtime/colors/morning.vim54
-rw-r--r--runtime/colors/murphy.vim41
-rw-r--r--runtime/colors/pablo.vim26
-rw-r--r--runtime/colors/peachpuff.vim60
-rw-r--r--runtime/colors/ron.vim43
-rw-r--r--runtime/colors/shine.vim60
-rw-r--r--runtime/colors/torte.vim50
-rw-r--r--runtime/colors/zellner.vim54
-rw-r--r--runtime/compiler/README.txt11
-rw-r--r--runtime/compiler/ant.vim38
-rw-r--r--runtime/compiler/bcc.vim19
-rw-r--r--runtime/compiler/bdf.vim30
-rw-r--r--runtime/compiler/checkstyle.vim20
-rw-r--r--runtime/compiler/cs.vim19
-rw-r--r--runtime/compiler/dot.vim15
-rw-r--r--runtime/compiler/fortran_F.vim27
-rw-r--r--runtime/compiler/fortran_cv.vim30
-rw-r--r--runtime/compiler/fortran_elf90.vim33
-rw-r--r--runtime/compiler/fortran_g77.vim48
-rw-r--r--runtime/compiler/fortran_lf95.vim27
-rw-r--r--runtime/compiler/hp_acc.vim28
-rw-r--r--runtime/compiler/icc.vim18
-rw-r--r--runtime/compiler/intel.vim21
-rw-r--r--runtime/compiler/irix5_c.vim21
-rw-r--r--runtime/compiler/irix5_cpp.vim21
-rw-r--r--runtime/compiler/javac.vim18
-rw-r--r--runtime/compiler/jikes.vim18
-rw-r--r--runtime/compiler/mips_c.vim21
-rw-r--r--runtime/compiler/mipspro_c89.vim22
-rw-r--r--runtime/compiler/mipspro_cpp.vim21
-rw-r--r--runtime/compiler/modelsim_vcom.vim20
-rw-r--r--runtime/compiler/msvc.vim17
-rw-r--r--runtime/compiler/neato.vim15
-rw-r--r--runtime/compiler/onsgmls.vim24
-rw-r--r--runtime/compiler/pbx.vim20
-rw-r--r--runtime/compiler/perl.vim39
-rw-r--r--runtime/compiler/pyunit.vim16
-rw-r--r--runtime/compiler/rst.vim33
-rw-r--r--runtime/compiler/ruby.vim62
-rw-r--r--runtime/compiler/se.vim28
-rw-r--r--runtime/compiler/splint.vim70
-rw-r--r--runtime/compiler/tcl.vim18
-rw-r--r--runtime/compiler/tex.vim68
-rw-r--r--runtime/compiler/tidy.vim29
-rw-r--r--runtime/compiler/xmllint.vim29
-rw-r--r--runtime/compiler/xmlwf.vim23
-rw-r--r--runtime/delmenu.vim25
-rwxr-xr-xruntime/doc.infobin0 -> 624 bytes
-rw-r--r--runtime/doc/Makefile363
-rw-r--r--runtime/doc/arabic.txt323
-rw-r--r--runtime/doc/autocmd.txt904
-rw-r--r--runtime/doc/change.txt1425
-rw-r--r--runtime/doc/cmdline.txt992
-rw-r--r--runtime/doc/debugger.txt135
-rw-r--r--runtime/doc/develop.txt384
-rw-r--r--runtime/doc/diff.txt371
-rw-r--r--runtime/doc/digraph.txt322
-rw-r--r--runtime/doc/doctags.c83
-rw-r--r--runtime/doc/editing.txt1432
-rw-r--r--runtime/doc/eval.txt4583
-rw-r--r--runtime/doc/evim.149
-rw-r--r--runtime/doc/farsi.txt269
-rw-r--r--runtime/doc/filetype.txt529
-rw-r--r--runtime/doc/fold.txt581
-rw-r--r--runtime/doc/gui.txt951
-rw-r--r--runtime/doc/gui_w16.txt186
-rw-r--r--runtime/doc/gui_w32.txt472
-rw-r--r--runtime/doc/gui_x11.txt576
-rw-r--r--runtime/doc/hangulin.txt101
-rw-r--r--runtime/doc/hebrew.txt145
-rw-r--r--runtime/doc/help.txt197
-rwxr-xr-xruntime/doc/help.txt.infobin0 -> 582 bytes
-rw-r--r--runtime/doc/howto.txt96
-rw-r--r--runtime/doc/if_cscop.txt474
-rw-r--r--runtime/doc/if_ole.txt162
-rw-r--r--runtime/doc/if_perl.txt258
-rw-r--r--runtime/doc/if_pyth.txt299
-rw-r--r--runtime/doc/if_ruby.txt175
-rw-r--r--runtime/doc/if_sniff.txt95
-rw-r--r--runtime/doc/if_tcl.txt512
-rw-r--r--runtime/doc/indent.txt522
-rw-r--r--runtime/doc/index.txt1423
-rw-r--r--runtime/doc/insert.txt1064
-rw-r--r--runtime/doc/intro.txt890
-rw-r--r--runtime/doc/makehtml.awk780
-rw-r--r--runtime/doc/maketags.awk42
-rw-r--r--runtime/doc/map.txt1094
-rw-r--r--runtime/doc/mbyte.txt1368
-rw-r--r--runtime/doc/message.txt775
-rw-r--r--runtime/doc/mlang.txt205
-rw-r--r--runtime/doc/motion.txt1191
-rw-r--r--runtime/doc/netbeans.txt735
-rw-r--r--runtime/doc/options.txt6826
-rw-r--r--runtime/doc/os_390.txt340
-rw-r--r--runtime/doc/os_amiga.txt139
-rw-r--r--runtime/doc/os_beos.txt348
-rw-r--r--runtime/doc/os_dos.txt295
-rw-r--r--runtime/doc/os_mac.txt98
-rw-r--r--runtime/doc/os_mint.txt39
-rw-r--r--runtime/doc/os_msdos.txt270
-rw-r--r--runtime/doc/os_os2.txt220
-rw-r--r--runtime/doc/os_qnx.txt138
-rw-r--r--runtime/doc/os_risc.txt323
-rw-r--r--runtime/doc/os_unix.txt60
-rw-r--r--runtime/doc/os_vms.txt779
-rw-r--r--runtime/doc/os_win32.txt319
-rw-r--r--runtime/doc/pattern.txt1146
-rw-r--r--runtime/doc/pi_expl.txt215
-rw-r--r--runtime/doc/pi_gzip.txt39
-rw-r--r--runtime/doc/pi_netrw.txt543
-rw-r--r--runtime/doc/pi_spec.txt111
-rw-r--r--runtime/doc/quickfix.txt1010
-rw-r--r--runtime/doc/quickref.txt1325
-rw-r--r--runtime/doc/quotes.txt274
-rw-r--r--runtime/doc/recover.txt165
-rw-r--r--runtime/doc/remote.txt188
-rw-r--r--runtime/doc/repeat.txt529
-rw-r--r--runtime/doc/rileft.txt125
-rw-r--r--runtime/doc/russian.txt83
-rw-r--r--runtime/doc/scroll.txt303
-rw-r--r--runtime/doc/sign.txt191
-rw-r--r--runtime/doc/sponsor.txt229
-rw-r--r--runtime/doc/starting.txt1418
-rw-r--r--runtime/doc/syntax.txt4161
-rw-r--r--runtime/doc/tags6649
-rw-r--r--runtime/doc/tagsrch.txt809
-rw-r--r--runtime/doc/term.txt808
-rw-r--r--runtime/doc/tips.txt445
-rw-r--r--runtime/doc/todo.txt3441
-rw-r--r--runtime/doc/uganda.txt277
-rw-r--r--runtime/doc/undo.txt117
-rw-r--r--runtime/doc/usr_01.txt180
-rw-r--r--runtime/doc/usr_02.txt504
-rw-r--r--runtime/doc/usr_03.txt654
-rw-r--r--runtime/doc/usr_04.txt514
-rw-r--r--runtime/doc/usr_05.txt616
-rw-r--r--runtime/doc/usr_06.txt277
-rw-r--r--runtime/doc/usr_07.txt479
-rw-r--r--runtime/doc/usr_08.txt511
-rw-r--r--runtime/doc/usr_09.txt289
-rw-r--r--runtime/doc/usr_10.txt822
-rw-r--r--runtime/doc/usr_11.txt287
-rw-r--r--runtime/doc/usr_12.txt358
-rw-r--r--runtime/doc/usr_20.txt384
-rw-r--r--runtime/doc/usr_21.txt456
-rw-r--r--runtime/doc/usr_22.txt364
-rw-r--r--runtime/doc/usr_23.txt343
-rw-r--r--runtime/doc/usr_24.txt573
-rw-r--r--runtime/doc/usr_25.txt578
-rw-r--r--runtime/doc/usr_26.txt221
-rw-r--r--runtime/doc/usr_27.txt563
-rw-r--r--runtime/doc/usr_28.txt426
-rw-r--r--runtime/doc/usr_29.txt613
-rw-r--r--runtime/doc/usr_30.txt643
-rw-r--r--runtime/doc/usr_31.txt267
-rw-r--r--runtime/doc/usr_40.txt655
-rw-r--r--runtime/doc/usr_41.txt1724
-rw-r--r--runtime/doc/usr_42.txt365
-rw-r--r--runtime/doc/usr_43.txt172
-rw-r--r--runtime/doc/usr_44.txt719
-rw-r--r--runtime/doc/usr_45.txt419
-rw-r--r--runtime/doc/usr_90.txt498
-rw-r--r--runtime/doc/usr_toc.txt340
-rw-r--r--runtime/doc/various.txt1098
-rw-r--r--runtime/doc/version4.txt355
-rw-r--r--runtime/doc/version5.txt7813
-rw-r--r--runtime/doc/version6.txt13846
-rw-r--r--runtime/doc/version7.txt84
-rw-r--r--runtime/doc/vi_diff.txt884
-rw-r--r--runtime/doc/vim.1541
-rw-r--r--runtime/doc/vim.man420
-rwxr-xr-xruntime/doc/vim.man.infobin0 -> 582 bytes
-rw-r--r--runtime/doc/vim2html.pl229
-rw-r--r--runtime/doc/vimdiff.146
-rw-r--r--runtime/doc/vimdiff.man66
-rw-r--r--runtime/doc/vimtutor.154
-rw-r--r--runtime/doc/vimtutor.man66
-rw-r--r--runtime/doc/visual.txt487
-rw-r--r--runtime/doc/windows.txt1123
-rw-r--r--runtime/doc/workshop.txt98
-rw-r--r--runtime/doc/xxd.1373
-rw-r--r--runtime/doc/xxd.man396
-rw-r--r--runtime/evim.vim66
-rw-r--r--runtime/filetype.vim1737
-rw-r--r--runtime/ftoff.vim11
-rw-r--r--runtime/ftplugin.vim27
-rw-r--r--runtime/ftplugin/README.txt24
-rw-r--r--runtime/ftplugin/aap.vim25
-rw-r--r--runtime/ftplugin/abaqus.vim75
-rw-r--r--runtime/ftplugin/ada.vim226
-rw-r--r--runtime/ftplugin/ant.vim43
-rw-r--r--runtime/ftplugin/art.vim16
-rw-r--r--runtime/ftplugin/aspvbs.vim58
-rw-r--r--runtime/ftplugin/automake.vim11
-rw-r--r--runtime/ftplugin/bib.vim15
-rw-r--r--runtime/ftplugin/c.vim52
-rw-r--r--runtime/ftplugin/ch.vim17
-rw-r--r--runtime/ftplugin/changelog.vim256
-rw-r--r--runtime/ftplugin/config.vim41
-rw-r--r--runtime/ftplugin/cpp.vim12
-rw-r--r--runtime/ftplugin/cs.vim26
-rw-r--r--runtime/ftplugin/csc.vim26
-rw-r--r--runtime/ftplugin/csh.vim47
-rw-r--r--runtime/ftplugin/css.vim20
-rw-r--r--runtime/ftplugin/debchangelog.vim206
-rw-r--r--runtime/ftplugin/dosbatch.vim21
-rw-r--r--runtime/ftplugin/dtd.vim33
-rw-r--r--runtime/ftplugin/fortran.vim114
-rw-r--r--runtime/ftplugin/html.vim40
-rw-r--r--runtime/ftplugin/ishd.vim30
-rw-r--r--runtime/ftplugin/java.vim63
-rw-r--r--runtime/ftplugin/jsp.vim66
-rw-r--r--runtime/ftplugin/kwt.vim20
-rw-r--r--runtime/ftplugin/lisp.vim20
-rw-r--r--runtime/ftplugin/lprolog.vim37
-rw-r--r--runtime/ftplugin/lua.vim36
-rw-r--r--runtime/ftplugin/mail.vim34
-rw-r--r--runtime/ftplugin/make.vim25
-rw-r--r--runtime/ftplugin/man.vim177
-rw-r--r--runtime/ftplugin/mf.vim16
-rw-r--r--runtime/ftplugin/mp.vim7
-rw-r--r--runtime/ftplugin/objc.vim12
-rw-r--r--runtime/ftplugin/ocaml.vim49
-rw-r--r--runtime/ftplugin/occam.vim39
-rw-r--r--runtime/ftplugin/pascal.vim15
-rw-r--r--runtime/ftplugin/perl.vim66
-rw-r--r--runtime/ftplugin/php.vim62
-rw-r--r--runtime/ftplugin/postscr.vim31
-rw-r--r--runtime/ftplugin/pyrex.vim22
-rw-r--r--runtime/ftplugin/python.vim41
-rw-r--r--runtime/ftplugin/rpl.vim22
-rw-r--r--runtime/ftplugin/rst.vim23
-rw-r--r--runtime/ftplugin/ruby.vim14
-rw-r--r--runtime/ftplugin/scheme.vim7
-rw-r--r--runtime/ftplugin/sgml.vim39
-rw-r--r--runtime/ftplugin/sh.vim38
-rw-r--r--runtime/ftplugin/spec.vim168
-rw-r--r--runtime/ftplugin/sql.vim35
-rw-r--r--runtime/ftplugin/svg.vim39
-rw-r--r--runtime/ftplugin/tcsh.vim39
-rw-r--r--runtime/ftplugin/tex.vim112
-rw-r--r--runtime/ftplugin/vb.vim47
-rw-r--r--runtime/ftplugin/verilog.vim45
-rw-r--r--runtime/ftplugin/vim.vim61
-rw-r--r--runtime/ftplugin/xhtml.vim66
-rw-r--r--runtime/ftplugin/xml.vim47
-rw-r--r--runtime/ftplugin/xs.vim12
-rw-r--r--runtime/ftplugin/xsd.vim38
-rw-r--r--runtime/ftplugin/xslt.vim16
-rw-r--r--runtime/ftplugof.vim11
-rw-r--r--runtime/gvimrc_example.vim59
-rw-r--r--runtime/icons.infobin0 -> 624 bytes
-rw-r--r--runtime/indent.vim13
-rw-r--r--runtime/indent/README.txt45
-rw-r--r--runtime/indent/aap.vim7
-rw-r--r--runtime/indent/ada.vim264
-rw-r--r--runtime/indent/ant.vim12
-rw-r--r--runtime/indent/automake.vim11
-rw-r--r--runtime/indent/awk.vim228
-rw-r--r--runtime/indent/c.vim13
-rw-r--r--runtime/indent/cdl.vim129
-rw-r--r--runtime/indent/ch.vim18
-rw-r--r--runtime/indent/config.vim85
-rw-r--r--runtime/indent/cpp.vim13
-rw-r--r--runtime/indent/cs.vim13
-rw-r--r--runtime/indent/css.vim79
-rw-r--r--runtime/indent/docbk.vim13
-rw-r--r--runtime/indent/dylan.vim90
-rw-r--r--runtime/indent/eiffel.vim106
-rw-r--r--runtime/indent/eterm.vim49
-rw-r--r--runtime/indent/fortran.vim161
-rw-r--r--runtime/indent/html.vim219
-rw-r--r--runtime/indent/idlang.vim63
-rw-r--r--runtime/indent/ishd.vim65
-rw-r--r--runtime/indent/java.vim128
-rw-r--r--runtime/indent/lua.vim49
-rw-r--r--runtime/indent/make.vim57
-rw-r--r--runtime/indent/matlab.vim74
-rw-r--r--runtime/indent/mp.vim206
-rw-r--r--runtime/indent/objc.vim79
-rw-r--r--runtime/indent/ocaml.vim311
-rw-r--r--runtime/indent/occam.vim182
-rw-r--r--runtime/indent/perl.vim180
-rw-r--r--runtime/indent/php.vim118
-rw-r--r--runtime/indent/postscr.vim68
-rw-r--r--runtime/indent/pov.vim84
-rw-r--r--runtime/indent/prolog.vim58
-rw-r--r--runtime/indent/pyrex.vim8
-rw-r--r--runtime/indent/python.vim175
-rw-r--r--runtime/indent/readline.vim48
-rw-r--r--runtime/indent/rpl.vim60
-rw-r--r--runtime/indent/rst.vim60
-rw-r--r--runtime/indent/ruby.vim67
-rw-r--r--runtime/indent/sdl.vim89
-rw-r--r--runtime/indent/sh.vim58
-rw-r--r--runtime/indent/tcl.vim123
-rw-r--r--runtime/indent/tcsh.vim51
-rw-r--r--runtime/indent/tilde.vim36
-rw-r--r--runtime/indent/vb.vim72
-rw-r--r--runtime/indent/verilog.vim219
-rw-r--r--runtime/indent/vim.vim65
-rw-r--r--runtime/indent/xf86conf.vim42
-rw-r--r--runtime/indent/xhtml.vim7
-rw-r--r--runtime/indent/xml.vim88
-rw-r--r--runtime/indent/xslt.vim13
-rw-r--r--runtime/indent/yacc.vim44
-rw-r--r--runtime/indent/zsh.vim11
-rw-r--r--runtime/indoff.vim11
-rw-r--r--runtime/keymap/README.txt26
-rw-r--r--runtime/keymap/accents.vim71
-rw-r--r--runtime/keymap/arabic.vim2
-rw-r--r--runtime/keymap/arabic_utf-8.vim86
-rw-r--r--runtime/keymap/czech.vim1
-rw-r--r--runtime/keymap/czech_utf-8.vim78
-rw-r--r--runtime/keymap/esperanto.vim1
-rw-r--r--runtime/keymap/esperanto_utf-8.vim58
-rw-r--r--runtime/keymap/greek.vim7
-rw-r--r--runtime/keymap/greek_cp1253.vim119
-rw-r--r--runtime/keymap/greek_iso-8859-7.vim118
-rw-r--r--runtime/keymap/greek_utf-8.vim600
-rw-r--r--runtime/keymap/hebrew.vim16
-rw-r--r--runtime/keymap/hebrew_cp1255.vim62
-rw-r--r--runtime/keymap/hebrew_iso-8859-8.vim41
-rw-r--r--runtime/keymap/hebrew_utf-8.vim128
-rw-r--r--runtime/keymap/hebrewp.vim16
-rw-r--r--runtime/keymap/hebrewp_cp1255.vim58
-rw-r--r--runtime/keymap/hebrewp_iso-8859-8.vim36
-rw-r--r--runtime/keymap/hebrewp_utf-8.vim122
-rw-r--r--runtime/keymap/lithuanian-baltic.vim31
-rw-r--r--runtime/keymap/magyar_utf-8.vim37
-rw-r--r--runtime/keymap/persian-iranian_utf-8.vim115
-rw-r--r--runtime/keymap/persian.vim8
-rw-r--r--runtime/keymap/pinyin.vim54
-rw-r--r--runtime/keymap/russian-jcuken.vim87
-rw-r--r--runtime/keymap/russian-jcukenwin.vim87
-rw-r--r--runtime/keymap/russian-yawerty.vim79
-rw-r--r--runtime/keymap/serbian-latin.vim1
-rw-r--r--runtime/keymap/serbian-latin_utf-8.vim44
-rw-r--r--runtime/keymap/serbian.vim20
-rw-r--r--runtime/keymap/serbian_cp1250.vim40
-rw-r--r--runtime/keymap/serbian_cp1251.vim90
-rw-r--r--runtime/keymap/serbian_iso-8859-2.vim40
-rw-r--r--runtime/keymap/serbian_iso-8859-5.vim89
-rw-r--r--runtime/keymap/serbian_utf-8.vim93
-rw-r--r--runtime/keymap/slovak.vim16
-rw-r--r--runtime/keymap/slovak_cp1250.vim100
-rw-r--r--runtime/keymap/slovak_iso-8859-2.vim100
-rw-r--r--runtime/keymap/slovak_utf-8.vim100
-rw-r--r--runtime/lang/README.txt64
-rw-r--r--runtime/lang/menu_af.latin1.vim3
-rw-r--r--runtime/lang/menu_af.utf-8.vim3
-rw-r--r--runtime/lang/menu_af_af.latin1.vim152
-rw-r--r--runtime/lang/menu_af_af.utf-8.vim3
-rw-r--r--runtime/lang/menu_ca.latin1.vim3
-rw-r--r--runtime/lang/menu_ca.utf-8.vim7
-rw-r--r--runtime/lang/menu_ca_es.latin1.vim293
-rw-r--r--runtime/lang/menu_ca_es.utf-8.vim7
-rw-r--r--runtime/lang/menu_chinese_gb.936.vim230
-rw-r--r--runtime/lang/menu_chinese_taiwan.950.vim284
-rw-r--r--runtime/lang/menu_cs.cp1250.vim3
-rw-r--r--runtime/lang/menu_cs.latin1.vim3
-rw-r--r--runtime/lang/menu_cs_cz.cp1250.vim3
-rw-r--r--runtime/lang/menu_cs_cz.iso_8859-2.vim245
-rw-r--r--runtime/lang/menu_cs_cz.latin1.vim3
-rw-r--r--runtime/lang/menu_czech_czech_republic.1250.vim245
-rw-r--r--runtime/lang/menu_czech_czech_republic.1252.vim3
-rw-r--r--runtime/lang/menu_czech_czech_republic.ascii.vim245
-rw-r--r--runtime/lang/menu_de.latin1.vim3
-rw-r--r--runtime/lang/menu_de.utf-8.vim3
-rw-r--r--runtime/lang/menu_de_de.latin1.vim279
-rw-r--r--runtime/lang/menu_de_de.utf-8.vim3
-rw-r--r--runtime/lang/menu_en_gb.latin1.vim16
-rw-r--r--runtime/lang/menu_en_gb.utf-8.vim3
-rw-r--r--runtime/lang/menu_english_united_kingdom.1252.vim3
-rw-r--r--runtime/lang/menu_english_united_kingdom.ascii.vim3
-rw-r--r--runtime/lang/menu_es.latin1.vim3
-rw-r--r--runtime/lang/menu_es.utf-8.vim3
-rw-r--r--runtime/lang/menu_es_es.latin1.vim296
-rw-r--r--runtime/lang/menu_es_es.utf-8.vim3
-rw-r--r--runtime/lang/menu_fr.latin1.vim3
-rw-r--r--runtime/lang/menu_fr.utf-8.vim3
-rw-r--r--runtime/lang/menu_fr_fr.latin1.vim444
-rw-r--r--runtime/lang/menu_fr_fr.utf-8.vim3
-rw-r--r--runtime/lang/menu_french_france.1252.vim3
-rw-r--r--runtime/lang/menu_german_germany.1252.vim3
-rw-r--r--runtime/lang/menu_hu.iso_8859-2.vim3
-rw-r--r--runtime/lang/menu_hu.utf-8.vim3
-rw-r--r--runtime/lang/menu_hu_hu.iso_8859-2.vim258
-rw-r--r--runtime/lang/menu_hu_hu.utf-8.vim242
-rw-r--r--runtime/lang/menu_it.latin1.vim3
-rw-r--r--runtime/lang/menu_it.utf-8.vim3
-rw-r--r--runtime/lang/menu_it_it.latin1.vim327
-rw-r--r--runtime/lang/menu_it_it.utf-8.vim3
-rw-r--r--runtime/lang/menu_italian_italy.1252.vim3
-rw-r--r--runtime/lang/menu_ja.cp932.vim5
-rw-r--r--runtime/lang/menu_ja.utf-8.vim4
-rw-r--r--runtime/lang/menu_ja_jp.cp932.vim5
-rw-r--r--runtime/lang/menu_ja_jp.euc-jp.vim315
-rw-r--r--runtime/lang/menu_ja_jp.eucjp.vim6
-rw-r--r--runtime/lang/menu_ja_jp.ujis.vim6
-rw-r--r--runtime/lang/menu_ja_jp.utf-8.vim315
-rw-r--r--runtime/lang/menu_japanese_japan.932.vim315
-rw-r--r--runtime/lang/menu_ko.utf-8.vim3
-rw-r--r--runtime/lang/menu_ko_kr.euckr.vim243
-rw-r--r--runtime/lang/menu_ko_kr.utf-8.vim243
-rw-r--r--runtime/lang/menu_ko_kr.vim5
-rw-r--r--runtime/lang/menu_nl.latin1.vim3
-rw-r--r--runtime/lang/menu_nl.utf-8.vim3
-rw-r--r--runtime/lang/menu_nl_nl.latin1.vim240
-rw-r--r--runtime/lang/menu_nl_nl.utf-8.vim3
-rw-r--r--runtime/lang/menu_no.latin1.vim4
-rw-r--r--runtime/lang/menu_no.utf-8.vim4
-rw-r--r--runtime/lang/menu_no_no.latin1.vim233
-rw-r--r--runtime/lang/menu_no_no.utf-8.vim4
-rw-r--r--runtime/lang/menu_pl.cp1250.vim3
-rw-r--r--runtime/lang/menu_pl_pl.cp1250.vim3
-rw-r--r--runtime/lang/menu_pl_pl.iso_8859-2.vim263
-rw-r--r--runtime/lang/menu_polish_poland.1250.vim259
-rw-r--r--runtime/lang/menu_pt_br.latin1.vim3
-rw-r--r--runtime/lang/menu_pt_br.utf-8.vim3
-rw-r--r--runtime/lang/menu_pt_br.vim265
-rw-r--r--runtime/lang/menu_pt_pt.latin1.vim3
-rw-r--r--runtime/lang/menu_pt_pt.utf-8.vim3
-rw-r--r--runtime/lang/menu_pt_pt.vim264
-rw-r--r--runtime/lang/menu_ru.utf-8.vim3
-rw-r--r--runtime/lang/menu_ru_ru.koi8-r.vim294
-rw-r--r--runtime/lang/menu_ru_ru.utf-8.vim3
-rw-r--r--runtime/lang/menu_ru_ru.vim296
-rw-r--r--runtime/lang/menu_sk.cp1250.vim3
-rw-r--r--runtime/lang/menu_sk_sk.1250.vim6
-rw-r--r--runtime/lang/menu_sk_sk.cp1250.vim3
-rw-r--r--runtime/lang/menu_sk_sk.iso_8859-2.vim232
-rw-r--r--runtime/lang/menu_sk_sk.vim9
-rw-r--r--runtime/lang/menu_slovak_slovak_republic.1250.vim232
-rw-r--r--runtime/lang/menu_spanish_spain.850.vim1
-rw-r--r--runtime/lang/menu_sr.utf-8.vim3
-rw-r--r--runtime/lang/menu_sr_yu.ascii.vim258
-rw-r--r--runtime/lang/menu_sr_yu.iso_8859-2.vim259
-rw-r--r--runtime/lang/menu_sr_yu.iso_8859-5.vim259
-rw-r--r--runtime/lang/menu_sr_yu.utf-8.vim261
-rw-r--r--runtime/lang/menu_sv.latin1.vim3
-rw-r--r--runtime/lang/menu_sv.utf-8.vim3
-rw-r--r--runtime/lang/menu_sv_se.latin1.vim238
-rw-r--r--runtime/lang/menu_sv_se.utf-8.vim3
-rw-r--r--runtime/lang/menu_uk_ua.koi8-u.vim246
-rw-r--r--runtime/lang/menu_zh.big5.vim1
-rw-r--r--runtime/lang/menu_zh.cp936.vim3
-rw-r--r--runtime/lang/menu_zh.cp950.vim3
-rw-r--r--runtime/lang/menu_zh.gb2312.vim3
-rw-r--r--runtime/lang/menu_zh_cn.18030.vim3
-rw-r--r--runtime/lang/menu_zh_cn.cp936.vim3
-rw-r--r--runtime/lang/menu_zh_cn.gb2312.vim230
-rw-r--r--runtime/lang/menu_zh_cn.gbk.vim3
-rw-r--r--runtime/lang/menu_zh_cn.utf-8.vim230
-rw-r--r--runtime/lang/menu_zh_tw.big5.vim1
-rw-r--r--runtime/lang/menu_zh_tw.cp950.vim3
-rw-r--r--runtime/lang/menu_zh_tw.utf-8.vim284
-rwxr-xr-xruntime/macros.infobin0 -> 624 bytes
-rw-r--r--runtime/macros/README.txt22
-rw-r--r--runtime/macros/README.txt.infobin0 -> 734 bytes
-rw-r--r--runtime/macros/dvorak164
-rw-r--r--runtime/macros/hanoi.infobin0 -> 624 bytes
-rw-r--r--runtime/macros/hanoi/click.me14
-rw-r--r--runtime/macros/hanoi/click.me.infobin0 -> 973 bytes
-rw-r--r--runtime/macros/hanoi/hanoi.vim64
-rw-r--r--runtime/macros/hanoi/poster36
-rw-r--r--runtime/macros/hanoi/poster.infobin0 -> 735 bytes
-rw-r--r--runtime/macros/justify.vim316
-rwxr-xr-xruntime/macros/less.sh9
-rw-r--r--runtime/macros/less.vim244
-rw-r--r--runtime/macros/life/click.me9
-rw-r--r--runtime/macros/life/click.me.infobin0 -> 972 bytes
-rw-r--r--runtime/macros/life/life.vim260
-rw-r--r--runtime/macros/matchit.txt402
-rw-r--r--runtime/macros/matchit.vim806
-rw-r--r--runtime/macros/maze.infobin0 -> 624 bytes
-rw-r--r--runtime/macros/maze/Makefile7
-rw-r--r--runtime/macros/maze/README.txt49
-rw-r--r--runtime/macros/maze/README.txt.infobin0 -> 734 bytes
-rw-r--r--runtime/macros/maze/main.aap4
-rw-r--r--runtime/macros/maze/maze.c7
-rw-r--r--runtime/macros/maze/maze_5.7816
-rw-r--r--runtime/macros/maze/maze_5.78.infobin0 -> 972 bytes
-rw-r--r--runtime/macros/maze/maze_mac271
-rw-r--r--runtime/macros/maze/mazeansi.c7
-rw-r--r--runtime/macros/maze/mazeclean.c22
-rw-r--r--runtime/macros/maze/poster37
-rw-r--r--runtime/macros/maze/poster.infobin0 -> 734 bytes
-rw-r--r--runtime/macros/shellmenu.vim94
-rw-r--r--runtime/macros/swapmous.vim22
-rw-r--r--runtime/macros/urm.infobin0 -> 624 bytes
-rw-r--r--runtime/macros/urm/README.txt47
-rw-r--r--runtime/macros/urm/README.txt.infobin0 -> 734 bytes
-rw-r--r--runtime/macros/urm/examples16
-rw-r--r--runtime/macros/urm/urm22
-rw-r--r--runtime/macros/urm/urm.vim5
-rw-r--r--runtime/makemenu.vim468
-rw-r--r--runtime/menu.vim974
-rw-r--r--runtime/mswin.vim115
-rw-r--r--runtime/optwin.vim1193
-rw-r--r--runtime/plugin/README.txt9
-rw-r--r--runtime/plugin/explorer.vim1326
-rw-r--r--runtime/plugin/gzip.vim157
-rw-r--r--runtime/plugin/netrw.vim1160
-rw-r--r--runtime/plugin/rrhelper.vim47
-rw-r--r--runtime/plugin/tohtml.vim27
-rw-r--r--runtime/print/cp1250.ps40
-rw-r--r--runtime/print/cp1251.ps40
-rw-r--r--runtime/print/cp1252.ps40
-rw-r--r--runtime/print/cp1253.ps40
-rw-r--r--runtime/print/cp1254.ps40
-rw-r--r--runtime/print/cp1255.ps40
-rw-r--r--runtime/print/cp1257.ps40
-rw-r--r--runtime/print/dec-mcs.ps40
-rw-r--r--runtime/print/ebcdic-uk.ps40
-rw-r--r--runtime/print/hp-roman8.ps40
-rw-r--r--runtime/print/iso-8859-10.ps40
-rw-r--r--runtime/print/iso-8859-11.ps40
-rw-r--r--runtime/print/iso-8859-13.ps40
-rw-r--r--runtime/print/iso-8859-14.ps40
-rw-r--r--runtime/print/iso-8859-15.ps40
-rw-r--r--runtime/print/iso-8859-2.ps40
-rw-r--r--runtime/print/iso-8859-3.ps40
-rw-r--r--runtime/print/iso-8859-4.ps40
-rw-r--r--runtime/print/iso-8859-5.ps40
-rw-r--r--runtime/print/iso-8859-7.ps40
-rw-r--r--runtime/print/iso-8859-8.ps40
-rw-r--r--runtime/print/iso-8859-9.ps40
-rw-r--r--runtime/print/koi8-r.ps40
-rw-r--r--runtime/print/koi8-u.ps40
-rw-r--r--runtime/print/latin1.ps40
-rw-r--r--runtime/print/mac-roman.ps40
-rw-r--r--runtime/print/prolog.ps40
-rw-r--r--runtime/rgb.txt753
-rw-r--r--runtime/scripts.vim316
-rw-r--r--runtime/synmenu.vim450
-rw-r--r--runtime/syntax/2html.vim411
-rw-r--r--runtime/syntax/README.txt38
-rw-r--r--runtime/syntax/a65.vim166
-rw-r--r--runtime/syntax/aap.vim158
-rw-r--r--runtime/syntax/abaqus.vim48
-rw-r--r--runtime/syntax/abc.vim64
-rw-r--r--runtime/syntax/abel.vim167
-rw-r--r--runtime/syntax/acedb.vim123
-rw-r--r--runtime/syntax/ada.vim287
-rw-r--r--runtime/syntax/aflex.vim100
-rw-r--r--runtime/syntax/ahdl.vim94
-rw-r--r--runtime/syntax/amiga.vim101
-rw-r--r--runtime/syntax/aml.vim157
-rw-r--r--runtime/syntax/ampl.vim150
-rw-r--r--runtime/syntax/ant.vim97
-rw-r--r--runtime/syntax/antlr.vim70
-rw-r--r--runtime/syntax/apache.vim275
-rw-r--r--runtime/syntax/apachestyle.vim65
-rw-r--r--runtime/syntax/arch.vim60
-rw-r--r--runtime/syntax/art.vim44
-rw-r--r--runtime/syntax/asm.vim103
-rw-r--r--runtime/syntax/asm68k.vim391
-rw-r--r--runtime/syntax/asmh8300.vim85
-rw-r--r--runtime/syntax/asn.vim81
-rw-r--r--runtime/syntax/aspperl.vim33
-rw-r--r--runtime/syntax/aspvbs.vim196
-rw-r--r--runtime/syntax/atlas.vim98
-rw-r--r--runtime/syntax/automake.vim79
-rw-r--r--runtime/syntax/ave.vim92
-rw-r--r--runtime/syntax/awk.vim216
-rw-r--r--runtime/syntax/ayacc.vim86
-rw-r--r--runtime/syntax/b.vim142
-rw-r--r--runtime/syntax/baan.vim247
-rw-r--r--runtime/syntax/basic.vim174
-rw-r--r--runtime/syntax/bc.vim78
-rw-r--r--runtime/syntax/bdf.vim86
-rw-r--r--runtime/syntax/bib.vim92
-rw-r--r--runtime/syntax/bindzone.vim98
-rw-r--r--runtime/syntax/blank.vim46
-rw-r--r--runtime/syntax/btm.vim229
-rw-r--r--runtime/syntax/c.vim345
-rw-r--r--runtime/syntax/calendar.vim104
-rw-r--r--runtime/syntax/catalog.vim30
-rw-r--r--runtime/syntax/cdl.vimbin0 -> 3345 bytes
-rw-r--r--runtime/syntax/cf.vim151
-rw-r--r--runtime/syntax/cfg.vim60
-rw-r--r--runtime/syntax/ch.vim53
-rw-r--r--runtime/syntax/change.vim42
-rw-r--r--runtime/syntax/changelog.vim78
-rw-r--r--runtime/syntax/chaskell.vim18
-rw-r--r--runtime/syntax/cheetah.vim60
-rw-r--r--runtime/syntax/chill.vim191
-rw-r--r--runtime/syntax/cl.vim105
-rw-r--r--runtime/syntax/clean.vim94
-rw-r--r--runtime/syntax/clipper.vim143
-rw-r--r--runtime/syntax/cobol.vim177
-rw-r--r--runtime/syntax/colortest.vim65
-rw-r--r--runtime/syntax/conf.vim41
-rw-r--r--runtime/syntax/config.vim57
-rw-r--r--runtime/syntax/cpp.vim62
-rw-r--r--runtime/syntax/crm.vim61
-rw-r--r--runtime/syntax/crontab.vim69
-rw-r--r--runtime/syntax/cs.vim145
-rw-r--r--runtime/syntax/csc.vim199
-rw-r--r--runtime/syntax/csh.vim160
-rw-r--r--runtime/syntax/csp.vim195
-rw-r--r--runtime/syntax/css.vim274
-rw-r--r--runtime/syntax/cterm.vim190
-rw-r--r--runtime/syntax/ctrlh.vim33
-rw-r--r--runtime/syntax/cupl.vim130
-rw-r--r--runtime/syntax/cuplsim.vim80
-rw-r--r--runtime/syntax/cvs.vim43
-rw-r--r--runtime/syntax/cvsrc.vim49
-rw-r--r--runtime/syntax/cweb.vim80
-rw-r--r--runtime/syntax/cynlib.vim91
-rw-r--r--runtime/syntax/cynpp.vim68
-rw-r--r--runtime/syntax/d.vim219
-rw-r--r--runtime/syntax/dcd.vim64
-rw-r--r--runtime/syntax/dcl.vim164
-rw-r--r--runtime/syntax/debchangelog.vim54
-rw-r--r--runtime/syntax/debcontrol.vim70
-rw-r--r--runtime/syntax/def.vim57
-rw-r--r--runtime/syntax/desc.vim100
-rw-r--r--runtime/syntax/desktop.vim119
-rw-r--r--runtime/syntax/diff.vim78
-rw-r--r--runtime/syntax/dircolors.vim106
-rw-r--r--runtime/syntax/diva.vim110
-rw-r--r--runtime/syntax/dns.vim47
-rw-r--r--runtime/syntax/docbk.vim150
-rw-r--r--runtime/syntax/docbksgml.vim7
-rw-r--r--runtime/syntax/docbkxml.vim7
-rw-r--r--runtime/syntax/dosbatch.vim158
-rw-r--r--runtime/syntax/dosini.vim42
-rw-r--r--runtime/syntax/dot.vim110
-rw-r--r--runtime/syntax/dracula.vim85
-rw-r--r--runtime/syntax/dsl.vim38
-rw-r--r--runtime/syntax/dtd.vim181
-rw-r--r--runtime/syntax/dtml.vim225
-rw-r--r--runtime/syntax/dylan.vim109
-rw-r--r--runtime/syntax/dylanintr.vim52
-rw-r--r--runtime/syntax/dylanlid.vim42
-rw-r--r--runtime/syntax/ecd.vim56
-rw-r--r--runtime/syntax/edif.vim64
-rw-r--r--runtime/syntax/eiffel.vim196
-rw-r--r--runtime/syntax/elf.vim95
-rw-r--r--runtime/syntax/elinks.vim207
-rw-r--r--runtime/syntax/elmfilt.vim70
-rw-r--r--runtime/syntax/erlang.vim224
-rw-r--r--runtime/syntax/esqlc.vim75
-rw-r--r--runtime/syntax/eterm.vim200
-rw-r--r--runtime/syntax/exim.vim117
-rw-r--r--runtime/syntax/expect.vim113
-rw-r--r--runtime/syntax/exports.vim70
-rw-r--r--runtime/syntax/fasm.vim145
-rw-r--r--runtime/syntax/fdcc.vim114
-rw-r--r--runtime/syntax/fetchmail.vim88
-rw-r--r--runtime/syntax/fgl.vim147
-rw-r--r--runtime/syntax/focexec.vim101
-rw-r--r--runtime/syntax/form.vim101
-rw-r--r--runtime/syntax/forth.vim235
-rw-r--r--runtime/syntax/fortran.vim526
-rw-r--r--runtime/syntax/foxpro.vim692
-rw-r--r--runtime/syntax/fstab.vim208
-rw-r--r--runtime/syntax/fvwm.vim349
-rw-r--r--runtime/syntax/fvwm2m4.vim43
-rw-r--r--runtime/syntax/gdb.vim111
-rw-r--r--runtime/syntax/gdmo.vim96
-rw-r--r--runtime/syntax/gedcom.vim66
-rw-r--r--runtime/syntax/gkrellmrc.vim91
-rw-r--r--runtime/syntax/gnuplot.vim198
-rw-r--r--runtime/syntax/gp.vim79
-rw-r--r--runtime/syntax/gpg.vim72
-rw-r--r--runtime/syntax/grads.vim86
-rw-r--r--runtime/syntax/groff.vim10
-rw-r--r--runtime/syntax/grub.vim77
-rw-r--r--runtime/syntax/gsp.vim59
-rw-r--r--runtime/syntax/gtkrc.vim142
-rw-r--r--runtime/syntax/haskell.vim193
-rw-r--r--runtime/syntax/hb.vim97
-rw-r--r--runtime/syntax/help.vim187
-rw-r--r--runtime/syntax/hercules.vim133
-rw-r--r--runtime/syntax/hex.vim57
-rw-r--r--runtime/syntax/hitest.vim149
-rw-r--r--runtime/syntax/hog.vim350
-rw-r--r--runtime/syntax/html.vim291
-rw-r--r--runtime/syntax/htmlcheetah.vim32
-rw-r--r--runtime/syntax/htmlm4.vim41
-rw-r--r--runtime/syntax/htmlos.vim166
-rw-r--r--runtime/syntax/ia64.vim312
-rw-r--r--runtime/syntax/icemenu.vim36
-rw-r--r--runtime/syntax/icon.vim212
-rw-r--r--runtime/syntax/idl.vim203
-rw-r--r--runtime/syntax/idlang.vim253
-rw-r--r--runtime/syntax/indent.vim101
-rw-r--r--runtime/syntax/inform.vim408
-rw-r--r--runtime/syntax/inittab.vim75
-rw-r--r--runtime/syntax/ipfilter.vim43
-rw-r--r--runtime/syntax/ishd.vim422
-rw-r--r--runtime/syntax/iss.vim125
-rw-r--r--runtime/syntax/ist.vim70
-rw-r--r--runtime/syntax/jal.vim249
-rw-r--r--runtime/syntax/jam.vim252
-rw-r--r--runtime/syntax/jargon.vim36
-rw-r--r--runtime/syntax/java.vim334
-rw-r--r--runtime/syntax/javacc.vim77
-rw-r--r--runtime/syntax/javascript.vim111
-rw-r--r--runtime/syntax/jess.vim161
-rw-r--r--runtime/syntax/jgraph.vim58
-rw-r--r--runtime/syntax/jproperties.vim148
-rw-r--r--runtime/syntax/jsp.vim84
-rw-r--r--runtime/syntax/kix.vim182
-rw-r--r--runtime/syntax/kscript.vim70
-rw-r--r--runtime/syntax/kwt.vim87
-rw-r--r--runtime/syntax/lace.vim135
-rw-r--r--runtime/syntax/latte.vim98
-rw-r--r--runtime/syntax/ldif.vim43
-rw-r--r--runtime/syntax/lex.vim96
-rw-r--r--runtime/syntax/lftp.vim184
-rw-r--r--runtime/syntax/lhaskell.vim136
-rw-r--r--runtime/syntax/libao.vim46
-rw-r--r--runtime/syntax/lifelines.vim118
-rw-r--r--runtime/syntax/lilo.vim194
-rw-r--r--runtime/syntax/lisp.vim499
-rw-r--r--runtime/syntax/lite.vim181
-rw-r--r--runtime/syntax/logtalk.vim428
-rw-r--r--runtime/syntax/lotos.vim82
-rw-r--r--runtime/syntax/lout.vim139
-rw-r--r--runtime/syntax/lpc.vim455
-rw-r--r--runtime/syntax/lprolog.vim137
-rw-r--r--runtime/syntax/lscript.vim213
-rw-r--r--runtime/syntax/lss.vim133
-rw-r--r--runtime/syntax/lua.vim256
-rw-r--r--runtime/syntax/lynx.vim98
-rw-r--r--runtime/syntax/m4.vim73
-rw-r--r--runtime/syntax/mail.vim92
-rw-r--r--runtime/syntax/mailcap.vim54
-rw-r--r--runtime/syntax/make.vim137
-rw-r--r--runtime/syntax/man.vim67
-rw-r--r--runtime/syntax/manual.vim25
-rw-r--r--runtime/syntax/maple.vim582
-rw-r--r--runtime/syntax/masm.vim144
-rw-r--r--runtime/syntax/mason.vim99
-rw-r--r--runtime/syntax/master.vim50
-rw-r--r--runtime/syntax/matlab.vim109
-rw-r--r--runtime/syntax/mel.vim121
-rw-r--r--runtime/syntax/mf.vim197
-rw-r--r--runtime/syntax/mgp.vim83
-rw-r--r--runtime/syntax/mib.vim77
-rw-r--r--runtime/syntax/mma.vim63
-rw-r--r--runtime/syntax/mmix.vim162
-rw-r--r--runtime/syntax/modconf.vim66
-rw-r--r--runtime/syntax/model.vim59
-rw-r--r--runtime/syntax/modsim3.vim109
-rw-r--r--runtime/syntax/modula2.vim86
-rw-r--r--runtime/syntax/modula3.vim72
-rw-r--r--runtime/syntax/monk.vim228
-rw-r--r--runtime/syntax/moo.vim173
-rw-r--r--runtime/syntax/mp.vim132
-rw-r--r--runtime/syntax/mplayerconf.vim111
-rw-r--r--runtime/syntax/msidl.vim92
-rw-r--r--runtime/syntax/msql.vim100
-rw-r--r--runtime/syntax/mush.vim132
-rw-r--r--runtime/syntax/muttrc.vim248
-rw-r--r--runtime/syntax/mysql.vim296
-rw-r--r--runtime/syntax/named.vim234
-rw-r--r--runtime/syntax/nasm.vim522
-rw-r--r--runtime/syntax/nastran.vim193
-rw-r--r--runtime/syntax/natural.vim205
-rw-r--r--runtime/syntax/ncf.vim258
-rw-r--r--runtime/syntax/nosyntax.vim29
-rw-r--r--runtime/syntax/nqc.vim378
-rw-r--r--runtime/syntax/nroff.vim259
-rw-r--r--runtime/syntax/nsis.vim271
-rw-r--r--runtime/syntax/objc.vim107
-rw-r--r--runtime/syntax/objcpp.vim31
-rw-r--r--runtime/syntax/ocaml.vim317
-rw-r--r--runtime/syntax/occam.vim126
-rw-r--r--runtime/syntax/omnimark.vim123
-rw-r--r--runtime/syntax/openroad.vim266
-rw-r--r--runtime/syntax/opl.vim96
-rw-r--r--runtime/syntax/ora.vim478
-rw-r--r--runtime/syntax/papp.vim92
-rw-r--r--runtime/syntax/pascal.vim357
-rw-r--r--runtime/syntax/pcap.vim65
-rw-r--r--runtime/syntax/pccts.vim106
-rw-r--r--runtime/syntax/perl.vim556
-rw-r--r--runtime/syntax/pf.vim75
-rw-r--r--runtime/syntax/pfmain.vim858
-rw-r--r--runtime/syntax/php.vim513
-rw-r--r--runtime/syntax/phtml.vim244
-rw-r--r--runtime/syntax/pic.vim127
-rw-r--r--runtime/syntax/pike.vim155
-rw-r--r--runtime/syntax/pilrc.vim148
-rw-r--r--runtime/syntax/pine.vim372
-rw-r--r--runtime/syntax/pinfo.vim134
-rw-r--r--runtime/syntax/plm.vim147
-rw-r--r--runtime/syntax/plp.vim45
-rw-r--r--runtime/syntax/plsql.vim277
-rw-r--r--runtime/syntax/po.vim46
-rw-r--r--runtime/syntax/pod.vim81
-rw-r--r--runtime/syntax/postscr.vim783
-rw-r--r--runtime/syntax/pov.vim144
-rw-r--r--runtime/syntax/povini.vim62
-rw-r--r--runtime/syntax/ppd.vim48
-rw-r--r--runtime/syntax/ppwiz.vim97
-rw-r--r--runtime/syntax/procmail.vim67
-rw-r--r--runtime/syntax/progress.vim215
-rw-r--r--runtime/syntax/prolog.vim120
-rw-r--r--runtime/syntax/psf.vim103
-rw-r--r--runtime/syntax/ptcap.vim107
-rw-r--r--runtime/syntax/purifylog.vim119
-rw-r--r--runtime/syntax/pyrex.vim67
-rw-r--r--runtime/syntax/python.vim171
-rw-r--r--runtime/syntax/qf.vim24
-rw-r--r--runtime/syntax/quake.vim162
-rw-r--r--runtime/syntax/r.vim104
-rw-r--r--runtime/syntax/radiance.vim159
-rw-r--r--runtime/syntax/ratpoison.vim249
-rw-r--r--runtime/syntax/rc.vim200
-rw-r--r--runtime/syntax/rcs.vim76
-rw-r--r--runtime/syntax/rcslog.vim38
-rw-r--r--runtime/syntax/readline.vim152
-rw-r--r--runtime/syntax/rebol.vim216
-rw-r--r--runtime/syntax/registry.vim114
-rw-r--r--runtime/syntax/remind.vim64
-rw-r--r--runtime/syntax/resolv.vim85
-rw-r--r--runtime/syntax/rexx.vim113
-rw-r--r--runtime/syntax/rib.vim73
-rw-r--r--runtime/syntax/rnc.vim94
-rw-r--r--runtime/syntax/robots.vim69
-rw-r--r--runtime/syntax/rpcgen.vim63
-rw-r--r--runtime/syntax/rpl.vim491
-rw-r--r--runtime/syntax/rst.vim107
-rw-r--r--runtime/syntax/rtf.vim88
-rw-r--r--runtime/syntax/ruby.vim285
-rw-r--r--runtime/syntax/samba.vim117
-rw-r--r--runtime/syntax/sas.vim236
-rw-r--r--runtime/syntax/sather.vim105
-rw-r--r--runtime/syntax/scheme.vim189
-rw-r--r--runtime/syntax/scilab.vim115
-rw-r--r--runtime/syntax/screen.vim93
-rw-r--r--runtime/syntax/sdl.vim167
-rw-r--r--runtime/syntax/sed.vim122
-rw-r--r--runtime/syntax/sendpr.vim32
-rw-r--r--runtime/syntax/sgml.vim337
-rw-r--r--runtime/syntax/sgmldecl.vim79
-rw-r--r--runtime/syntax/sgmllnx.vim68
-rw-r--r--runtime/syntax/sh.vim538
-rw-r--r--runtime/syntax/sicad.vim413
-rw-r--r--runtime/syntax/simula.vim99
-rw-r--r--runtime/syntax/sinda.vim146
-rw-r--r--runtime/syntax/sindacmp.vim74
-rw-r--r--runtime/syntax/sindaout.vim100
-rw-r--r--runtime/syntax/skill.vim562
-rw-r--r--runtime/syntax/sl.vim120
-rw-r--r--runtime/syntax/slang.vim102
-rw-r--r--runtime/syntax/slice.vim90
-rw-r--r--runtime/syntax/slrnrc.vim194
-rw-r--r--runtime/syntax/slrnsc.vim85
-rw-r--r--runtime/syntax/sm.vim96
-rw-r--r--runtime/syntax/smarty.vim86
-rw-r--r--runtime/syntax/smil.vim154
-rw-r--r--runtime/syntax/smith.vim52
-rw-r--r--runtime/syntax/sml.vim230
-rw-r--r--runtime/syntax/snnsnet.vim77
-rw-r--r--runtime/syntax/snnspat.vim68
-rw-r--r--runtime/syntax/snnsres.vim60
-rw-r--r--runtime/syntax/snobol4.vim93
-rw-r--r--runtime/syntax/spec.vim236
-rw-r--r--runtime/syntax/specman.vim182
-rw-r--r--runtime/syntax/spice.vim87
-rw-r--r--runtime/syntax/splint.vim260
-rw-r--r--runtime/syntax/spup.vim277
-rw-r--r--runtime/syntax/spyce.vim110
-rw-r--r--runtime/syntax/sql.vim89
-rw-r--r--runtime/syntax/sqlforms.vim168
-rw-r--r--runtime/syntax/sqlj.vim100
-rw-r--r--runtime/syntax/sqr.vim295
-rw-r--r--runtime/syntax/squid.vim149
-rw-r--r--runtime/syntax/sshconfig.vim99
-rw-r--r--runtime/syntax/sshdconfig.vim98
-rw-r--r--runtime/syntax/st.vim102
-rw-r--r--runtime/syntax/stp.vim167
-rw-r--r--runtime/syntax/strace.vim66
-rw-r--r--runtime/syntax/svn.vim46
-rw-r--r--runtime/syntax/syncolor.vim85
-rw-r--r--runtime/syntax/synload.vim69
-rw-r--r--runtime/syntax/syntax.vim43
-rw-r--r--runtime/syntax/tads.vim184
-rw-r--r--runtime/syntax/tags.vim47
-rw-r--r--runtime/syntax/tak.vim136
-rw-r--r--runtime/syntax/takcmp.vim82
-rw-r--r--runtime/syntax/takout.vim102
-rw-r--r--runtime/syntax/tasm.vim122
-rw-r--r--runtime/syntax/tcl.vim235
-rw-r--r--runtime/syntax/tcsh.vim188
-rw-r--r--runtime/syntax/terminfo.vim115
-rw-r--r--runtime/syntax/tex.vim480
-rw-r--r--runtime/syntax/texinfo.vim409
-rw-r--r--runtime/syntax/texmf.vim86
-rw-r--r--runtime/syntax/tf.vim209
-rw-r--r--runtime/syntax/tidy.vim153
-rw-r--r--runtime/syntax/tilde.vim41
-rw-r--r--runtime/syntax/tli.vim71
-rw-r--r--runtime/syntax/trasys.vim177
-rw-r--r--runtime/syntax/tsalt.vim214
-rw-r--r--runtime/syntax/tsscl.vim217
-rw-r--r--runtime/syntax/tssgm.vim111
-rw-r--r--runtime/syntax/tssop.vim87
-rw-r--r--runtime/syntax/uc.vim178
-rw-r--r--runtime/syntax/uil.vim85
-rw-r--r--runtime/syntax/valgrind.vim99
-rw-r--r--runtime/syntax/vb.vim273
-rw-r--r--runtime/syntax/verilog.vim134
-rw-r--r--runtime/syntax/vgrindefs.vim61
-rw-r--r--runtime/syntax/vhdl.vim184
-rw-r--r--runtime/syntax/vim.vim642
-rw-r--r--runtime/syntax/viminfo.vim53
-rw-r--r--runtime/syntax/virata.vim219
-rw-r--r--runtime/syntax/vmasm.vim251
-rw-r--r--runtime/syntax/vrml.vim239
-rw-r--r--runtime/syntax/vsejcl.vim49
-rw-r--r--runtime/syntax/wdiff.vim43
-rw-r--r--runtime/syntax/web.vim39
-rw-r--r--runtime/syntax/webmacro.vim82
-rw-r--r--runtime/syntax/wget.vim159
-rw-r--r--runtime/syntax/whitespace.vim13
-rw-r--r--runtime/syntax/winbatch.vim187
-rw-r--r--runtime/syntax/wml.vim172
-rw-r--r--runtime/syntax/wsh.vim45
-rw-r--r--runtime/syntax/wvdial.vim28
-rw-r--r--runtime/syntax/xdefaults.vim145
-rw-r--r--runtime/syntax/xf86conf.vim209
-rw-r--r--runtime/syntax/xhtml.vim11
-rw-r--r--runtime/syntax/xkb.vim91
-rw-r--r--runtime/syntax/xmath.vim235
-rw-r--r--runtime/syntax/xml.vim344
-rw-r--r--runtime/syntax/xmodmap.vim172
-rw-r--r--runtime/syntax/xpm.vim144
-rw-r--r--runtime/syntax/xpm2.vim156
-rw-r--r--runtime/syntax/xs.vim54
-rw-r--r--runtime/syntax/xsd.vim61
-rw-r--r--runtime/syntax/xslt.vim62
-rw-r--r--runtime/syntax/xxd.vim42
-rw-r--r--runtime/syntax/yacc.vim98
-rw-r--r--runtime/syntax/yaml.vim105
-rw-r--r--runtime/syntax/z8a.vim114
-rw-r--r--runtime/syntax/zsh.vim118
-rw-r--r--runtime/termcap135
-rwxr-xr-xruntime/tools.infobin0 -> 624 bytes
-rw-r--r--runtime/tools/README.txt37
-rw-r--r--runtime/tools/blink.c21
-rw-r--r--runtime/tools/ccfilter.193
-rw-r--r--runtime/tools/ccfilter.c326
-rw-r--r--runtime/tools/ccfilter_README.txt91
-rwxr-xr-xruntime/tools/efm_filter.pl39
-rw-r--r--runtime/tools/efm_filter.txt31
-rwxr-xr-xruntime/tools/efm_perl.pl153
-rwxr-xr-xruntime/tools/mve.awk23
-rw-r--r--runtime/tools/mve.txt20
-rwxr-xr-xruntime/tools/pltags.pl300
-rwxr-xr-xruntime/tools/ref11
-rw-r--r--runtime/tools/shtags.161
-rwxr-xr-xruntime/tools/shtags.pl144
-rwxr-xr-xruntime/tools/tcltags159
-rwxr-xr-xruntime/tools/vim13213
-rw-r--r--runtime/tools/vim_vs_net.cmd24
-rwxr-xr-xruntime/tools/vimm6
-rwxr-xr-xruntime/tools/vimspell.sh41
-rw-r--r--runtime/tools/vimspell.txt22
-rw-r--r--runtime/tools/xcmdsrv_client.c584
-rwxr-xr-xruntime/tutor.infobin0 -> 624 bytes
-rw-r--r--runtime/tutor/Makefile15
-rw-r--r--runtime/tutor/README.gr.cp737.txt24
-rw-r--r--runtime/tutor/README.gr.txt24
-rw-r--r--runtime/tutor/README.txt22
-rwxr-xr-xruntime/tutor/README.txt.infobin0 -> 738 bytes
-rw-r--r--runtime/tutor/tutor808
-rw-r--r--runtime/tutor/tutor.ca807
-rw-r--r--runtime/tutor/tutor.de849
-rw-r--r--runtime/tutor/tutor.es769
-rw-r--r--runtime/tutor/tutor.fr809
-rw-r--r--runtime/tutor/tutor.gr815
-rw-r--r--runtime/tutor/tutor.gr.cp737815
-rw-r--r--runtime/tutor/tutor.infobin0 -> 972 bytes
-rw-r--r--runtime/tutor/tutor.it805
-rw-r--r--runtime/tutor/tutor.ja.euc811
-rw-r--r--runtime/tutor/tutor.ja.sjis811
-rw-r--r--runtime/tutor/tutor.ja.utf-8811
-rw-r--r--runtime/tutor/tutor.ko.euc812
-rw-r--r--runtime/tutor/tutor.ko.utf-8812
-rw-r--r--runtime/tutor/tutor.no810
-rw-r--r--runtime/tutor/tutor.pl830
-rw-r--r--runtime/tutor/tutor.pl.cp1250830
-rw-r--r--runtime/tutor/tutor.ru834
-rw-r--r--runtime/tutor/tutor.ru.cp1251834
-rw-r--r--runtime/tutor/tutor.sk821
-rw-r--r--runtime/tutor/tutor.sv830
-rw-r--r--runtime/tutor/tutor.vim119
-rw-r--r--runtime/tutor/tutor.zh.big5852
-rw-r--r--runtime/tutor/tutor.zh.euc851
-rw-r--r--runtime/vim16x16.gifbin0 -> 166 bytes
-rw-r--r--runtime/vim16x16.pngbin0 -> 226 bytes
-rw-r--r--runtime/vim16x16.xpm27
-rw-r--r--runtime/vim32x32.gifbin0 -> 298 bytes
-rw-r--r--runtime/vim32x32.pngbin0 -> 347 bytes
-rw-r--r--runtime/vim32x32.xpm43
-rw-r--r--runtime/vim48x48.gifbin0 -> 504 bytes
-rw-r--r--runtime/vim48x48.pngbin0 -> 474 bytes
-rw-r--r--runtime/vim48x48.xpm59
-rw-r--r--runtime/vimlogo.eps791
-rw-r--r--runtime/vimlogo.gifbin0 -> 1091 bytes
-rw-r--r--runtime/vimlogo.pdfbin0 -> 2254 bytes
-rw-r--r--runtime/vimlogo.xpm75
-rw-r--r--runtime/vimrc_example.vim81
-rwxr-xr-xsrc.infobin0 -> 624 bytes
-rw-r--r--src/INSTALL427
-rw-r--r--src/INSTALLami.txt34
-rw-r--r--src/INSTALLmac.txt164
-rw-r--r--src/INSTALLpc.txt310
-rw-r--r--src/INSTALLvms.txt375
-rw-r--r--src/Make_agui.mak356
-rw-r--r--src/Make_aros.mak29
-rw-r--r--src/Make_bc3.mak173
-rw-r--r--src/Make_bc5.mak1006
-rw-r--r--src/Make_cyg.mak498
-rw-r--r--src/Make_dice.mak209
-rw-r--r--src/Make_djg.mak102
-rw-r--r--src/Make_dvc.mak105
-rw-r--r--src/Make_ivc.mak648
-rw-r--r--src/Make_manx.mak322
-rw-r--r--src/Make_ming.mak555
-rw-r--r--src/Make_mint.mak56
-rw-r--r--src/Make_morph.mak88
-rw-r--r--src/Make_mpw.mak3843
-rw-r--r--src/Make_mvc.mak888
-rw-r--r--src/Make_os2.mak147
-rw-r--r--src/Make_ro.mak168
-rw-r--r--src/Make_sas.mak345
-rw-r--r--src/Make_vms.mms457
-rw-r--r--src/Make_w16.mak196
-rw-r--r--src/README.txt140
-rw-r--r--src/VisVim/Commands.cpp693
-rw-r--r--src/VisVim/Commands.h127
-rw-r--r--src/VisVim/DSAddIn.cpp160
-rw-r--r--src/VisVim/DSAddIn.h53
-rw-r--r--src/VisVim/OleAut.cpp781
-rw-r--r--src/VisVim/OleAut.h73
-rw-r--r--src/VisVim/README_VisVim.txt322
-rw-r--r--src/VisVim/Reg.cpp56
-rw-r--r--src/VisVim/Register.bat1
-rw-r--r--src/VisVim/Resource.h29
-rw-r--r--src/VisVim/StdAfx.cpp6
-rw-r--r--src/VisVim/StdAfx.h73
-rw-r--r--src/VisVim/UnRegist.bat1
-rw-r--r--src/VisVim/VisVim.cpp152
-rw-r--r--src/VisVim/VisVim.def11
-rw-r--r--src/VisVim/VisVim.dllbin0 -> 49664 bytes
-rw-r--r--src/VisVim/VisVim.h33
-rw-r--r--src/VisVim/VisVim.mak205
-rw-r--r--src/VisVim/VisVim.odl61
-rw-r--r--src/VisVim/VisVim.rc199
-rw-r--r--src/VisVim/VsReadMe.txt91
-rw-r--r--src/arabic.c1168
-rw-r--r--src/arabic.h258
-rw-r--r--src/ascii.h201
-rwxr-xr-xsrc/auto/configure8692
-rw-r--r--src/bigvim.bat3
-rw-r--r--src/buffer.c5071
-rw-r--r--src/charset.c1795
-rw-r--r--src/config.aap.in115
-rw-r--r--src/config.h.in361
-rw-r--r--src/config.mk.dist5
-rw-r--r--src/config.mk.in137
-rwxr-xr-xsrc/configure4
-rw-r--r--src/configure.in2660
-rw-r--r--src/dehqx.py40
-rw-r--r--src/diff.c2208
-rw-r--r--src/digraph.c2513
-rw-r--r--src/dimm.idl544
-rw-r--r--src/dlldata.c38
-rw-r--r--src/dosinst.c2461
-rw-r--r--src/dosinst.h645
-rw-r--r--src/edit.c7614
-rw-r--r--src/eval.c10682
-rw-r--r--src/ex_cmds.c6198
-rw-r--r--src/ex_cmds.h961
-rw-r--r--src/ex_cmds2.c5711
-rw-r--r--src/ex_docmd.c9711
-rw-r--r--src/ex_eval.c2004
-rw-r--r--src/ex_getln.c5371
-rw-r--r--src/farsi.c2312
-rw-r--r--src/farsi.h234
-rw-r--r--src/feature.h1184
-rw-r--r--src/fileio.c8750
-rw-r--r--src/fold.c3250
-rw-r--r--src/getchar.c4636
-rw-r--r--src/glbl_ime.cpp261
-rw-r--r--src/glbl_ime.h31
-rw-r--r--src/globals.h1381
-rw-r--r--src/gui.c4740
-rw-r--r--src/gui.h525
-rw-r--r--src/gui_amiga.c1795
-rw-r--r--src/gui_amiga.h52
-rw-r--r--src/gui_at_fs.c2880
-rw-r--r--src/gui_at_sb.c1213
-rw-r--r--src/gui_at_sb.h161
-rw-r--r--src/gui_athena.c2230
-rw-r--r--src/gui_beos.cc3347
-rw-r--r--src/gui_beos.h49
-rw-r--r--src/gui_beval.c1268
-rw-r--r--src/gui_beval.h76
-rw-r--r--src/gui_gtk.c3035
-rw-r--r--src/gui_gtk_f.c942
-rw-r--r--src/gui_gtk_f.h83
-rw-r--r--src/gui_gtk_vms.h734
-rw-r--r--src/gui_gtk_x11.c6589
-rw-r--r--src/gui_mac.c5820
-rw-r--r--src/gui_mac.icnsbin0 -> 38515 bytes
-rw-r--r--src/gui_mac.r33
-rw-r--r--src/gui_motif.c3090
-rw-r--r--src/gui_photon.c3060
-rw-r--r--src/gui_riscos.c3547
-rw-r--r--src/gui_riscos.h32
-rw-r--r--src/gui_w16.c1524
-rw-r--r--src/gui_w32.c4077
-rw-r--r--src/gui_w32_rc.h8
-rw-r--r--src/gui_w48.c3402
-rw-r--r--src/gui_x11.c3748
-rw-r--r--src/guiw16rc.h17
-rw-r--r--src/gvim.exe.mnf22
-rw-r--r--src/hangulin.c1621
-rw-r--r--src/if_cscope.c2270
-rw-r--r--src/if_cscope.h96
-rw-r--r--src/if_ole.cpp778
-rw-r--r--src/if_ole.h289
-rw-r--r--src/if_ole.idl45
-rw-r--r--src/if_perl.xs1150
-rw-r--r--src/if_perlsfio.c66
-rw-r--r--src/if_python.c2807
-rw-r--r--src/if_ruby.c868
-rw-r--r--src/if_sniff.c1210
-rw-r--r--src/if_sniff.h18
-rw-r--r--src/if_tcl.c2118
-rw-r--r--src/if_xcmdsrv.c1441
-rw-r--r--src/iid_ole.c50
-rw-r--r--src/infplist.xml51
-rw-r--r--src/integration.c1198
-rw-r--r--src/integration.h453
-rw-r--r--src/keymap.h484
-rw-r--r--src/link.3907
-rwxr-xr-xsrc/link.sh136
-rw-r--r--src/macros.h245
-rw-r--r--src/main.aap1014
-rw-r--r--src/mark.c1617
-rw-r--r--src/mbyte.c5833
-rw-r--r--src/memfile.c1312
-rw-r--r--src/memline.c4378
-rw-r--r--src/menu.c2385
-rw-r--r--src/message.c3165
-rw-r--r--src/misc1.c8455
-rw-r--r--src/misc2.c5556
-rwxr-xr-xsrc/mkinstalldirs40
-rw-r--r--src/move.c2796
-rw-r--r--src/mysign1
-rw-r--r--src/nbdebug.c182
-rw-r--r--src/nbdebug.h81
-rw-r--r--src/netbeans.c3185
-rw-r--r--src/normal.c8508
-rw-r--r--src/ops.c6114
-rw-r--r--src/option.c9383
-rw-r--r--src/option.h802
-rw-r--r--src/os_amiga.c1619
-rw-r--r--src/os_amiga.h201
-rw-r--r--src/os_beos.c206
-rw-r--r--src/os_beos.h25
-rw-r--r--src/os_beos.rsrcbin0 -> 6956 bytes
-rw-r--r--src/os_dos.h125
-rw-r--r--src/os_mac.build91
-rw-r--r--src/os_mac.c1451
-rw-r--r--src/os_mac.h411
-rw-r--r--src/os_mac.rsr.hqx659
-rw-r--r--src/os_mac.sit.hqx439
-rw-r--r--src/os_macosx.c612
-rw-r--r--src/os_mint.h13
-rw-r--r--src/os_msdos.c3114
-rw-r--r--src/os_msdos.h106
-rw-r--r--src/os_mswin.c3245
-rw-r--r--src/os_os2_cfg.h251
-rw-r--r--src/os_qnx.c162
-rw-r--r--src/os_qnx.h19
-rw-r--r--src/os_riscos.c1288
-rw-r--r--src/os_riscos.h169
-rw-r--r--src/os_unix.c6189
-rw-r--r--src/os_unix.h531
-rw-r--r--src/os_unixx.h130
-rw-r--r--src/os_vms.c657
-rw-r--r--src/os_vms_conf.h185
-rw-r--r--src/os_vms_fix.com276
-rw-r--r--src/os_vms_mms.c76
-rw-r--r--src/os_w32dll.c24
-rw-r--r--src/os_w32exe.c136
-rw-r--r--src/os_win16.c424
-rw-r--r--src/os_win16.h142
-rw-r--r--src/os_win32.c4790
-rw-r--r--src/os_win32.h190
-rwxr-xr-xsrc/osdef.sh99
-rw-r--r--src/osdef1.h.in137
-rw-r--r--src/osdef2.h.in88
-rwxr-xr-xsrc/pathdef.sh11
-rw-r--r--src/po/Make_ming.mak67
-rw-r--r--src/po/Make_mvc.mak62
-rw-r--r--src/po/Makefile135
-rw-r--r--src/po/README.txt104
-rw-r--r--src/po/README_mingw.txt101
-rw-r--r--src/po/README_mvc.txt94
-rw-r--r--src/po/af.po6244
-rw-r--r--src/po/ca.po6341
-rw-r--r--src/po/cleanup.vim7
-rw-r--r--src/po/cs.cp1250.po5954
-rw-r--r--src/po/cs.po5954
-rw-r--r--src/po/de.po6091
-rw-r--r--src/po/en_GB.po48
-rw-r--r--src/po/es.po6780
-rw-r--r--src/po/fr.po6888
-rw-r--r--src/po/it.po6638
-rw-r--r--src/po/ja.po6587
-rw-r--r--src/po/ja.sjis.po6587
-rw-r--r--src/po/ko.po6580
-rw-r--r--src/po/no.po6630
-rw-r--r--src/po/pl.cp1250.po6576
-rw-r--r--src/po/pl.po6576
-rw-r--r--src/po/ru.cp1251.po6658
-rw-r--r--src/po/ru.po6658
-rw-r--r--src/po/sjiscorr.c50
-rw-r--r--src/po/sk.cp1250.po5998
-rw-r--r--src/po/sk.po5998
-rw-r--r--src/po/sv.po6516
-rw-r--r--src/po/uk.po6225
-rw-r--r--src/po/zh_CN.UTF-8.po5937
-rw-r--r--src/po/zh_CN.cp936.po5937
-rw-r--r--src/po/zh_CN.po5937
-rw-r--r--src/po/zh_TW.UTF-8.po6389
-rw-r--r--src/po/zh_TW.po6389
-rw-r--r--src/proto.h251
-rw-r--r--src/proto/buffer.pro66
-rw-r--r--src/proto/charset.pro49
-rw-r--r--src/proto/diff.pro23
-rw-r--r--src/proto/digraph.pro9
-rw-r--r--src/proto/edit.pro36
-rw-r--r--src/proto/eval.pro60
-rw-r--r--src/proto/ex_cmds.pro52
-rw-r--r--src/proto/ex_cmds2.pro76
-rw-r--r--src/proto/ex_docmd.pro41
-rw-r--r--src/proto/ex_eval.pro29
-rw-r--r--src/proto/ex_getln.pro47
-rw-r--r--src/proto/fileio.pro39
-rw-r--r--src/proto/fold.pro40
-rw-r--r--src/proto/getchar.pro61
-rw-r--r--src/proto/gui.pro61
-rw-r--r--src/proto/gui_amiga.pro67
-rw-r--r--src/proto/gui_athena.pro31
-rw-r--r--src/proto/gui_beos.pro14
-rw-r--r--src/proto/gui_beval.pro10
-rw-r--r--src/proto/gui_gtk.pro24
-rw-r--r--src/proto/gui_gtk_x11.pro67
-rw-r--r--src/proto/gui_mac.pro142
-rw-r--r--src/proto/gui_motif.pro39
-rw-r--r--src/proto/gui_photon.pro66
-rw-r--r--src/proto/gui_riscos.pro67
-rw-r--r--src/proto/gui_w16.pro73
-rw-r--r--src/proto/gui_w32.pro89
-rw-r--r--src/proto/gui_x11.pro70
-rw-r--r--src/proto/hangulin.pro9
-rw-r--r--src/proto/if_cscope.pro9
-rw-r--r--src/proto/if_ole.pro5
-rw-r--r--src/proto/if_perl.pro8
-rw-r--r--src/proto/if_perlsfio.pro3
-rw-r--r--src/proto/if_python.pro8
-rw-r--r--src/proto/if_ruby.pro9
-rw-r--r--src/proto/if_tcl.pro10
-rw-r--r--src/proto/if_xcmdsrv.pro11
-rw-r--r--src/proto/main.pro25
-rw-r--r--src/proto/mark.pro26
-rw-r--r--src/proto/mbyte.pro86
-rw-r--r--src/proto/memfile.pro17
-rw-r--r--src/proto/memline.pro31
-rw-r--r--src/proto/menu.pro21
-rw-r--r--src/proto/message.pro57
-rw-r--r--src/proto/misc1.pro87
-rw-r--r--src/proto/misc2.pro91
-rw-r--r--src/proto/move.pro40
-rw-r--r--src/proto/netbeans.pro24
-rw-r--r--src/proto/normal.pro23
-rw-r--r--src/proto/ops.pro53
-rw-r--r--src/proto/option.pro52
-rw-r--r--src/proto/os_amiga.pro46
-rw-r--r--src/proto/os_beos.pro4
-rw-r--r--src/proto/os_mac.pro64
-rw-r--r--src/proto/os_msdos.pro48
-rw-r--r--src/proto/os_mswin.pro60
-rw-r--r--src/proto/os_qnx.pro8
-rw-r--r--src/proto/os_riscos.pro49
-rw-r--r--src/proto/os_unix.pro70
-rw-r--r--src/proto/os_vms.pro14
-rw-r--r--src/proto/os_win16.pro12
-rw-r--r--src/proto/os_win32.pro48
-rw-r--r--src/proto/pty.pro3
-rw-r--r--src/proto/quickfix.pro21
-rw-r--r--src/proto/regexp.pro16
-rw-r--r--src/proto/screen.pro46
-rw-r--r--src/proto/search.pro33
-rw-r--r--src/proto/syntax.pro42
-rw-r--r--src/proto/tag.pro8
-rw-r--r--src/proto/term.pro58
-rw-r--r--src/proto/termlib.pro8
-rw-r--r--src/proto/ui.pro61
-rw-r--r--src/proto/undo.pro18
-rw-r--r--src/proto/version.pro9
-rw-r--r--src/proto/window.pro44
-rw-r--r--src/proto/workshop.pro48
-rw-r--r--src/pty.c425
-rw-r--r--src/quickfix.c2232
-rw-r--r--src/regexp.c6115
-rw-r--r--src/regexp.h80
-rw-r--r--src/screen.c8437
-rw-r--r--src/search.c4487
-rw-r--r--src/structs.h1887
-rw-r--r--src/swis.s143
-rw-r--r--src/syntax.c8456
-rw-r--r--src/tag.c3534
-rw-r--r--src/tearoff.bmpbin0 -> 118 bytes
-rw-r--r--src/tee/Makefile15
-rw-r--r--src/tee/tee.c153
-rw-r--r--src/term.c5381
-rw-r--r--src/term.h156
-rw-r--r--src/termlib.c628
-rw-r--r--src/testdir/Make_amiga.mak97
-rw-r--r--src/testdir/Make_dos.mak64
-rw-r--r--src/testdir/Make_os2.mak52
-rw-r--r--src/testdir/Make_vms.mms124
-rw-r--r--src/testdir/Makefile58
-rw-r--r--src/testdir/amiga.vim4
-rw-r--r--src/testdir/dos.vim7
-rw-r--r--src/testdir/dotest.in3
-rw-r--r--src/testdir/main.aap58
-rw-r--r--src/testdir/os2.vim3
-rw-r--r--src/testdir/test1.in40
-rw-r--r--src/testdir/test1.ok1
-rw-r--r--src/testdir/test10.in57
-rw-r--r--src/testdir/test10.ok23
-rw-r--r--src/testdir/test10a.in73
-rw-r--r--src/testdir/test10a.ok23
-rw-r--r--src/testdir/test11.in77
-rw-r--r--src/testdir/test11.ok61
-rw-r--r--src/testdir/test12.in52
-rw-r--r--src/testdir/test12.ok10
-rw-r--r--src/testdir/test13.in58
-rw-r--r--src/testdir/test13.ok30
-rw-r--r--src/testdir/test14.in65
-rw-r--r--src/testdir/test14.ok17
-rw-r--r--src/testdir/test15.in136
-rw-r--r--src/testdir/test15.ok111
-rw-r--r--src/testdir/test16.in10
-rw-r--r--src/testdir/test16.ok2
-rw-r--r--src/testdir/test17.in27
-rw-r--r--src/testdir/test17.ok3
-rw-r--r--src/testdir/test17a.in3
-rw-r--r--src/testdir/test18.in16
-rw-r--r--src/testdir/test18.ok4
-rw-r--r--src/testdir/test19.in23
-rw-r--r--src/testdir/test19.ok7
-rw-r--r--src/testdir/test2.in29
-rw-r--r--src/testdir/test2.ok4
-rw-r--r--src/testdir/test20.in22
-rw-r--r--src/testdir/test20.ok6
-rw-r--r--src/testdir/test21.in19
-rw-r--r--src/testdir/test21.ok2
-rw-r--r--src/testdir/test22.in13
-rw-r--r--src/testdir/test22.ok4
-rw-r--r--src/testdir/test23.in15
-rw-r--r--src/testdir/test23.ok2
-rw-r--r--src/testdir/test24.in21
-rw-r--r--src/testdir/test24.ok7
-rw-r--r--src/testdir/test25.in31
-rw-r--r--src/testdir/test25.ok1
-rw-r--r--src/testdir/test26.in43
-rw-r--r--src/testdir/test26.ok10
-rw-r--r--src/testdir/test27.in20
-rw-r--r--src/testdir/test27.ok2
-rw-r--r--src/testdir/test28.inbin0 -> 364 bytes
-rw-r--r--src/testdir/test28.ok2
-rw-r--r--src/testdir/test29.in67
-rw-r--r--src/testdir/test29.ok28
-rw-r--r--src/testdir/test3.in1217
-rw-r--r--src/testdir/test3.ok1090
-rw-r--r--src/testdir/test30.in183
-rw-r--r--src/testdir/test30.ok96
-rw-r--r--src/testdir/test31.in68
-rw-r--r--src/testdir/test31.ok11
-rw-r--r--src/testdir/test32.in56
-rw-r--r--src/testdir/test32.ok15
-rw-r--r--src/testdir/test33.in34
-rw-r--r--src/testdir/test33.ok23
-rw-r--r--src/testdir/test34.in31
-rw-r--r--src/testdir/test34.ok1
-rw-r--r--src/testdir/test35.in21
-rw-r--r--src/testdir/test35.ok4
-rw-r--r--src/testdir/test36.in40
-rw-r--r--src/testdir/test36.ok16
-rw-r--r--src/testdir/test37.in116
-rw-r--r--src/testdir/test37.ok33
-rw-r--r--src/testdir/test38.in33
-rw-r--r--src/testdir/test38.ok13
-rw-r--r--src/testdir/test39.in24
-rw-r--r--src/testdir/test39.ok5
-rw-r--r--src/testdir/test4.in31
-rw-r--r--src/testdir/test4.ok17
-rw-r--r--src/testdir/test40.in63
-rw-r--r--src/testdir/test40.ok11
-rw-r--r--src/testdir/test41.in24
-rw-r--r--src/testdir/test41.ok3
-rw-r--r--src/testdir/test42.inbin0 -> 2368 bytes
-rw-r--r--src/testdir/test42.okbin0 -> 407 bytes
-rw-r--r--src/testdir/test43.in27
-rw-r--r--src/testdir/test43.ok8
-rw-r--r--src/testdir/test44.in37
-rw-r--r--src/testdir/test44.ok11
-rw-r--r--src/testdir/test45.in72
-rw-r--r--src/testdir/test45.ok16
-rw-r--r--src/testdir/test46.in27
-rw-r--r--src/testdir/test46.ok13
-rw-r--r--src/testdir/test47.in44
-rw-r--r--src/testdir/test47.ok3
-rw-r--r--src/testdir/test48.in74
-rw-r--r--src/testdir/test48.ok21
-rw-r--r--src/testdir/test49.in13
-rw-r--r--src/testdir/test49.ok92
-rw-r--r--src/testdir/test49.vim9666
-rw-r--r--src/testdir/test5.in29
-rw-r--r--src/testdir/test5.ok9
-rw-r--r--src/testdir/test50.in85
-rw-r--r--src/testdir/test50.ok14
-rw-r--r--src/testdir/test51.in34
-rw-r--r--src/testdir/test51.ok15
-rw-r--r--src/testdir/test52.in65
-rw-r--r--src/testdir/test52.ok18
-rw-r--r--src/testdir/test6.in24
-rw-r--r--src/testdir/test6.ok18
-rw-r--r--src/testdir/test7.in26
-rw-r--r--src/testdir/test7.ok12
-rw-r--r--src/testdir/test8.in24
-rw-r--r--src/testdir/test8.ok6
-rw-r--r--src/testdir/test9.in12
-rw-r--r--src/testdir/test9.ok2
-rw-r--r--src/testdir/todos.vim3
-rw-r--r--src/testdir/unix.vim3
-rw-r--r--src/testdir/vms.vim4
-rw-r--r--src/toolbar.phi1283
-rwxr-xr-xsrc/toolcheck36
-rw-r--r--src/tools.bmpbin0 -> 5158 bytes
-rw-r--r--src/tools16.bmpbin0 -> 3838 bytes
-rw-r--r--src/typemap14
-rw-r--r--src/ui.c3060
-rw-r--r--src/undo.c1380
-rw-r--r--src/uninstal.c438
-rw-r--r--src/version.c1219
-rw-r--r--src/version.h40
-rw-r--r--src/vim.def4
-rw-r--r--src/vim.h1788
-rw-r--r--src/vim.icobin0 -> 1078 bytes
-rw-r--r--src/vim.rc135
-rw-r--r--src/vim.tlbbin0 -> 1792 bytes
-rw-r--r--src/vim16.def5
-rw-r--r--src/vim16.rc81
-rw-r--r--src/vim_alert.icobin0 -> 1078 bytes
-rw-r--r--src/vim_error.icobin0 -> 1078 bytes
-rw-r--r--src/vim_icon.xbm14
-rw-r--r--src/vim_info.icobin0 -> 1078 bytes
-rw-r--r--src/vim_mask.xbm14
-rw-r--r--src/vim_quest.icobin0 -> 1078 bytes
-rw-r--r--src/vimrun.c117
-rwxr-xr-xsrc/vimtbar.dllbin0 -> 35602 bytes
-rw-r--r--src/vimtbar.h185
-rw-r--r--src/vimtbar.libbin0 -> 1024 bytes
-rwxr-xr-xsrc/vimtutor61
-rwxr-xr-xsrc/which.sh12
-rw-r--r--src/window.c4946
-rw-r--r--src/workshop.c1885
-rw-r--r--src/workshop.h28
-rw-r--r--src/wsdebug.c179
-rw-r--r--src/wsdebug.h81
-rw-r--r--src/xpm_w32.c60
-rw-r--r--src/xpm_w32.h7
-rw-r--r--src/xxd/Make_amiga.mak18
-rw-r--r--src/xxd/Make_bc3.mak31
-rw-r--r--src/xxd/Make_bc5.mak18
-rw-r--r--src/xxd/Make_cyg.mak27
-rw-r--r--src/xxd/Make_djg.mak9
-rw-r--r--src/xxd/Make_mvc.mak11
-rw-r--r--src/xxd/Make_os2.mak11
-rw-r--r--src/xxd/Make_vms.mms69
-rw-r--r--src/xxd/Makefile7
-rw-r--r--src/xxd/xxd.c767
-rw-r--r--uninstal.txt80
-rwxr-xr-xvimdir.infobin0 -> 624 bytes
-rw-r--r--vimtutor.bat67
-rwxr-xr-xvimtutor.com104
1588 files changed, 750846 insertions, 0 deletions
diff --git a/Contents b/Contents
new file mode 100644
index 000000000..ebfaa6e61
--- /dev/null
+++ b/Contents
@@ -0,0 +1,23 @@
+Vim Vi IMproved. A clone of the UNIX text editor Vi. Very useful
+ for editing programs and other plain ASCII text. Full Vi
+ compatibility and includes all Ex commands. Extra features
+ above Vi: Multilevel undo, multiple windows, syntax
+ highlighting, command line history, folding, improved command
+ line editing, command typeahead display, command to display
+ yank buffers, possibility to edit binary files, file name
+ stack, support for Manx QuickFix and other compiler's error
+ messages, shows current file name in window title, on-line
+ help, rectangular cut/paste, etc., etc., etc...
+
+ Version 7.0aa. Also runs under UNIX, MSDOS and other systems.
+ vim70aart.tgz contains the documentation and syntax files.
+ vim70aabin.tgz contains the binaries.
+ vim70aasrc.tgz contains the sources.
+ Author: Bram Moolenaar et al.
+
+
+Xxd Hex dumper and reader. Can be used to view files as hex, edit
+ them and write them back. Can also be used to patch files.
+
+ Version 1.8 (1997 May 22)
+ Author: Juergen Weigert
diff --git a/Contents.info b/Contents.info
new file mode 100755
index 000000000..9e855c7e9
--- /dev/null
+++ b/Contents.info
Binary files differ
diff --git a/Filelist b/Filelist
new file mode 100644
index 000000000..6048ee20d
--- /dev/null
+++ b/Filelist
@@ -0,0 +1,657 @@
+# List of distributed Vim files.
+# Used by Makefile and upload.aap.
+
+# source files for all source archives
+SRC_ALL1 = \
+ src/README.txt \
+ src/arabic.c \
+ src/arabic.h \
+ src/ascii.h \
+ src/buffer.c \
+ src/charset.c \
+ src/diff.c \
+ src/digraph.c \
+ src/edit.c \
+ src/eval.c \
+ src/ex_cmds.c \
+ src/ex_cmds.h \
+ src/ex_cmds2.c \
+ src/ex_docmd.c \
+ src/ex_eval.c \
+ src/ex_getln.c \
+ src/farsi.c \
+ src/farsi.h \
+ src/feature.h \
+ src/fileio.c \
+ src/fold.c \
+ src/getchar.c \
+ src/globals.h \
+ src/gui.c \
+ src/gui.h \
+ src/gui_beval.c \
+ src/gui_beval.h \
+ src/keymap.h \
+ src/macros.h \
+ src/main.c \
+ src/mark.c \
+ src/mbyte.c \
+ src/memfile.c \
+ src/memline.c \
+ src/menu.c \
+ src/message.c \
+ src/misc1.c \
+ src/misc2.c \
+ src/move.c \
+ src/mysign \
+ src/nbdebug.c \
+ src/nbdebug.h \
+ src/netbeans.c \
+ src/normal.c \
+ src/ops.c \
+ src/option.c \
+ src/option.h \
+ src/quickfix.c \
+ src/regexp.c \
+ src/regexp.h \
+ src/screen.c \
+ src/search.c \
+ src/structs.h \
+ src/syntax.c \
+ src/tag.c \
+ src/term.c \
+ src/term.h \
+ src/termlib.c \
+ src/ui.c \
+ src/undo.c \
+ src/version.c \
+ src/version.h \
+ src/vim.h \
+ src/window.c \
+ src/xxd/xxd.c \
+
+SRC_ALL2 = \
+ src/main.aap \
+ src/testdir/main.aap \
+ src/testdir/*.in \
+ src/testdir/*.ok \
+ src/testdir/test49.vim \
+ src/proto.h \
+ src/proto/buffer.pro \
+ src/proto/charset.pro \
+ src/proto/diff.pro \
+ src/proto/digraph.pro \
+ src/proto/edit.pro \
+ src/proto/eval.pro \
+ src/proto/ex_cmds.pro \
+ src/proto/ex_cmds2.pro \
+ src/proto/ex_docmd.pro \
+ src/proto/ex_eval.pro \
+ src/proto/ex_getln.pro \
+ src/proto/fileio.pro \
+ src/proto/fold.pro \
+ src/proto/getchar.pro \
+ src/proto/gui.pro \
+ src/proto/gui_beval.pro \
+ src/proto/main.pro \
+ src/proto/mark.pro \
+ src/proto/mbyte.pro \
+ src/proto/memfile.pro \
+ src/proto/memline.pro \
+ src/proto/menu.pro \
+ src/proto/message.pro \
+ src/proto/misc1.pro \
+ src/proto/misc2.pro \
+ src/proto/move.pro \
+ src/proto/netbeans.pro \
+ src/proto/normal.pro \
+ src/proto/ops.pro \
+ src/proto/option.pro \
+ src/proto/quickfix.pro \
+ src/proto/regexp.pro \
+ src/proto/screen.pro \
+ src/proto/search.pro \
+ src/proto/syntax.pro \
+ src/proto/tag.pro \
+ src/proto/term.pro \
+ src/proto/termlib.pro \
+ src/proto/ui.pro \
+ src/proto/undo.pro \
+ src/proto/version.pro \
+ src/proto/window.pro \
+
+
+# source files for Unix only
+SRC_UNIX = \
+ Makefile \
+ Filelist \
+ README_src.txt \
+ configure \
+ pixmaps/*.xpm \
+ pixmaps/gen-inline-pixbufs.sh \
+ pixmaps/stock_icons.h \
+ src/INSTALL \
+ src/Makefile \
+ src/auto/configure \
+ src/config.aap.in \
+ src/config.h.in \
+ src/config.mk.dist \
+ src/config.mk.in \
+ src/configure \
+ src/configure.in \
+ src/gui_at_fs.c \
+ src/gui_at_sb.c \
+ src/gui_at_sb.h \
+ src/gui_athena.c \
+ src/gui_gtk.c \
+ src/gui_gtk_f.c \
+ src/gui_gtk_f.h \
+ src/gui_gtk_x11.c \
+ src/gui_motif.c \
+ src/gui_x11.c \
+ src/hangulin.c \
+ src/if_xcmdsrv.c \
+ src/integration.c \
+ src/integration.h \
+ src/link.sh \
+ src/mkinstalldirs \
+ src/os_unix.c \
+ src/os_unix.h \
+ src/os_unixx.h \
+ src/osdef.sh \
+ src/osdef1.h.in \
+ src/osdef2.h.in \
+ src/pathdef.sh \
+ src/proto/gui_athena.pro \
+ src/proto/gui_gtk.pro \
+ src/proto/gui_gtk_x11.pro \
+ src/proto/gui_motif.pro \
+ src/proto/gui_x11.pro \
+ src/proto/hangulin.pro \
+ src/proto/if_xcmdsrv.pro \
+ src/proto/os_unix.pro \
+ src/proto/pty.pro \
+ src/proto/workshop.pro \
+ src/pty.c \
+ src/testdir/Makefile \
+ src/testdir/unix.vim \
+ src/toolcheck \
+ src/vim_icon.xbm \
+ src/vim_mask.xbm \
+ src/vimtutor \
+ src/which.sh \
+ src/workshop.c \
+ src/workshop.h \
+ src/wsdebug.c \
+ src/wsdebug.h \
+ src/xxd/Makefile \
+
+# source files for both DOS and Unix
+SRC_DOS_UNIX = \
+ src/if_cscope.c \
+ src/if_cscope.h \
+ src/if_perl.xs \
+ src/if_perlsfio.c \
+ src/if_python.c \
+ src/if_ruby.c \
+ src/if_tcl.c \
+ src/proto/if_cscope.pro \
+ src/proto/if_perl.pro \
+ src/proto/if_perlsfio.pro \
+ src/proto/if_python.pro \
+ src/proto/if_ruby.pro \
+ src/proto/if_tcl.pro \
+ src/typemap \
+
+# source files for DOS (also in the extra archive)
+SRC_DOS = \
+ src/GvimExt \
+ README_srcdos.txt \
+ src/INSTALLpc.txt \
+ src/Make_bc3.mak \
+ src/Make_bc5.mak \
+ src/Make_cyg.mak \
+ src/Make_djg.mak \
+ src/Make_ivc.mak \
+ src/Make_dvc.mak \
+ src/Make_ming.mak \
+ src/Make_mvc.mak \
+ src/Make_w16.mak \
+ src/bigvim.bat \
+ src/dimm.idl \
+ src/dlldata.c \
+ src/dosinst.c \
+ src/dosinst.h \
+ src/glbl_ime.cpp \
+ src/glbl_ime.h \
+ src/gui_w16.c \
+ src/gui_w32.c \
+ src/gui_w48.c \
+ src/guiw16rc.h \
+ src/gui_w32_rc.h \
+ src/if_ole.cpp \
+ src/if_ole.h \
+ src/if_ole.idl \
+ src/iid_ole.c \
+ src/os_dos.h \
+ src/os_msdos.c \
+ src/os_msdos.h \
+ src/os_w32dll.c \
+ src/os_w32exe.c \
+ src/os_win16.c \
+ src/os_win32.c \
+ src/os_mswin.c \
+ src/os_win16.h \
+ src/os_win32.h \
+ src/proto/gui_w16.pro \
+ src/proto/gui_w32.pro \
+ src/proto/if_ole.pro \
+ src/proto/os_msdos.pro \
+ src/proto/os_win16.pro \
+ src/proto/os_win32.pro \
+ src/proto/os_mswin.pro \
+ src/testdir/Make_dos.mak \
+ src/testdir/dos.vim \
+ src/uninstal.c \
+ src/vim.def \
+ src/vim.rc \
+ src/gvim.exe.mnf \
+ src/vim16.def \
+ src/vim16.rc \
+ src/vimrun.c \
+ src/vimtbar.h \
+ src/xpm_w32.c \
+ src/xpm_w32.h \
+ src/xxd/Make_bc3.mak \
+ src/xxd/Make_bc5.mak \
+ src/xxd/Make_cyg.mak \
+ src/xxd/Make_djg.mak \
+ src/xxd/Make_mvc.mak \
+ nsis/gvim.nsi \
+ nsis/README.txt \
+ uninstal.txt \
+ src/VisVim/Commands.cpp \
+ src/VisVim/Commands.h \
+ src/VisVim/DSAddIn.cpp \
+ src/VisVim/DSAddIn.h \
+ src/VisVim/OleAut.cpp \
+ src/VisVim/OleAut.h \
+ src/VisVim/README_VisVim.txt \
+ src/VisVim/Reg.cpp \
+ src/VisVim/Register.bat \
+ src/VisVim/Resource.h \
+ src/VisVim/StdAfx.cpp \
+ src/VisVim/StdAfx.h \
+ src/VisVim/UnRegist.bat \
+ src/VisVim/VisVim.cpp \
+ src/VisVim/VisVim.def \
+ src/VisVim/VisVim.mak \
+ src/VisVim/VisVim.h \
+ src/VisVim/VisVim.odl \
+ src/VisVim/VisVim.rc \
+ src/VisVim/VsReadMe.txt \
+
+# source files for DOS without CR/LF translation (also in the extra archive)
+SRC_DOS_BIN = \
+ src/VisVim/Res \
+ src/tearoff.bmp \
+ src/tools.bmp \
+ src/tools16.bmp \
+ src/vim*.ico \
+ src/vim.tlb \
+ src/vimtbar.lib \
+ src/vimtbar.dll \
+ nsis/icons \
+
+# source files for Amiga, DOS, etc. (also in the extra archive)
+SRC_AMI_DOS = \
+
+# source files for Amiga (also in the extra archive)
+SRC_AMI = \
+ README_amisrc.txt \
+ README_amisrc.txt.info \
+ src.info \
+ src/INSTALLami.txt \
+ src/Make_agui.mak \
+ src/Make_aros.mak \
+ src/Make_dice.mak \
+ src/Make_manx.mak \
+ src/Make_morph.mak \
+ src/Make_sas.mak \
+ src/gui_amiga.c \
+ src/gui_amiga.h \
+ src/os_amiga.c \
+ src/os_amiga.h \
+ src/proto/gui_amiga.pro \
+ src/proto/os_amiga.pro \
+ src/testdir/Make_amiga.mak \
+ src/testdir/amiga.vim \
+ src/xxd/Make_amiga.mak \
+
+# source files for the Mac (also in the extra archive)
+SRC_MAC = \
+ src/INSTALLmac.txt \
+ src/Make_mpw.mak \
+ src/dehqx.py \
+ src/gui_mac.c \
+ src/gui_mac.icns \
+ src/gui_mac.r \
+ src/os_mac* \
+ src/proto/gui_mac.pro \
+ src/proto/os_mac.pro \
+
+# source files for VMS (in the extra archive)
+SRC_VMS = \
+ src/INSTALLvms.txt \
+ src/Make_vms.mms \
+ src/gui_gtk_vms.h \
+ src/os_vms.c \
+ src/os_vms_conf.h \
+ src/os_vms_mms.c \
+ src/proto/os_vms.pro \
+ src/testdir/Make_vms.mms \
+ src/testdir/vms.vim \
+ src/xxd/Make_vms.mms \
+ vimtutor.com \
+
+# source files for OS/2 (in the extra archive)
+SRC_OS2 = \
+ src/Make_os2.mak \
+ src/os_os2_cfg.h \
+ src/testdir/Make_os2.mak \
+ src/testdir/todos.vim \
+ src/testdir/os2.vim \
+ src/xxd/Make_os2.mak \
+
+# source files for QNX (in the extra archive)
+SRC_QNX = \
+ src/os_qnx.c \
+ src/os_qnx.h \
+ src/gui_photon.c \
+ src/proto/gui_photon.pro \
+ src/proto/os_qnx.pro \
+
+
+# source files for the extra archive (all sources that are not for Unix)
+SRC_EXTRA = \
+ $(SRC_AMI) \
+ $(SRC_AMI_DOS) \
+ $(SRC_DOS) \
+ $(SRC_DOS_BIN) \
+ $(SRC_MAC) \
+ $(SRC_OS2) \
+ $(SRC_QNX) \
+ $(SRC_VMS) \
+ README_os390.txt \
+ src/Make_mint.mak \
+ src/Make_ro.mak \
+ src/gui_beos.cc \
+ src/gui_beos.h \
+ src/gui_riscos.c \
+ src/gui_riscos.h \
+ src/if_sniff.c \
+ src/if_sniff.h \
+ src/infplist.xml \
+ src/link.390 \
+ src/os_beos.c \
+ src/os_beos.h \
+ src/os_beos.rsrc \
+ src/os_mint.h \
+ src/os_riscos.c \
+ src/os_riscos.h \
+ src/proto/gui_beos.pro \
+ src/proto/gui_riscos.pro \
+ src/proto/os_beos.pro \
+ src/proto/os_riscos.pro \
+ src/os_vms_fix.com \
+ src/toolbar.phi \
+
+# runtime files for all distributions
+RT_ALL = \
+ README.txt \
+ runtime/bugreport.vim \
+ runtime/doc/*.awk \
+ runtime/doc/*.pl \
+ runtime/doc/*.txt \
+ runtime/doc/Makefile \
+ runtime/doc/doctags.c \
+ runtime/doc/vim.1 \
+ runtime/doc/evim.1 \
+ runtime/doc/vimdiff.1 \
+ runtime/doc/vimtutor.1 \
+ runtime/doc/xxd.1 \
+ runtime/ftoff.vim \
+ runtime/gvimrc_example.vim \
+ runtime/macros/README.txt \
+ runtime/macros/dvorak \
+ runtime/macros/hanoi/click.me \
+ runtime/macros/hanoi/hanoi.vim \
+ runtime/macros/hanoi/poster \
+ runtime/macros/justify.vim \
+ runtime/macros/less.sh \
+ runtime/macros/less.vim \
+ runtime/macros/life/click.me \
+ runtime/macros/life/life.vim \
+ runtime/macros/matchit.vim \
+ runtime/macros/matchit.txt \
+ runtime/macros/maze/README.txt \
+ runtime/macros/maze/[mM]akefile \
+ runtime/macros/maze/main.aap \
+ runtime/macros/maze/maze.c \
+ runtime/macros/maze/maze_5.78 \
+ runtime/macros/maze/maze_mac \
+ runtime/macros/maze/mazeansi.c \
+ runtime/macros/maze/mazeclean.c \
+ runtime/macros/maze/poster \
+ runtime/macros/shellmenu.vim \
+ runtime/macros/swapmous.vim \
+ runtime/macros/urm/README.txt \
+ runtime/macros/urm/examples \
+ runtime/macros/urm/urm \
+ runtime/macros/urm/urm.vim \
+ runtime/mswin.vim \
+ runtime/evim.vim \
+ runtime/optwin.vim \
+ runtime/ftplugin.vim \
+ runtime/ftplugof.vim \
+ runtime/indent.vim \
+ runtime/indoff.vim \
+ runtime/termcap \
+ runtime/tools/README.txt \
+ runtime/tools/[a-z]*[a-z0-9] \
+ runtime/tutor/README.txt \
+ runtime/tutor/tutor \
+ runtime/tutor/tutor.vim \
+ runtime/vimrc_example.vim \
+
+# runtime files for all distributions without CR-NL translation
+RT_ALL_BIN = \
+ runtime/doc/tags \
+ runtime/print/*.ps \
+
+# runtime script files
+RT_SCRIPTS = \
+ runtime/filetype.vim \
+ runtime/scripts.vim \
+ runtime/menu.vim \
+ runtime/delmenu.vim \
+ runtime/synmenu.vim \
+ runtime/makemenu.vim \
+ runtime/colors/*.vim \
+ runtime/colors/README.txt \
+ runtime/compiler/*.vim \
+ runtime/compiler/README.txt \
+ runtime/indent/*.vim \
+ runtime/indent/README.txt \
+ runtime/ftplugin/*.vim \
+ runtime/ftplugin/README.txt \
+ runtime/plugin/*.vim \
+ runtime/plugin/README.txt \
+ runtime/syntax/*.vim \
+ runtime/syntax/README.txt \
+
+# Unix runtime
+RT_UNIX = \
+ README_unix.txt \
+ runtime/vim16x16.png \
+ runtime/vim16x16.xpm \
+ runtime/vim32x32.png \
+ runtime/vim32x32.xpm \
+ runtime/vim48x48.png \
+ runtime/vim48x48.xpm \
+
+# Unix and DOS runtime without CR-LF translation
+RT_UNIX_DOS_BIN = \
+ runtime/vim16x16.gif \
+ runtime/vim32x32.gif \
+ runtime/vim48x48.gif \
+
+# runtime not for unix or extra
+RT_NO_UNIX = \
+
+# runtime for Amiga (also in the extra archive)
+RT_AMI_DOS = \
+ runtime/doc/vim.man \
+ runtime/doc/vimdiff.man \
+ runtime/doc/vimtutor.man \
+ runtime/doc/xxd.man \
+
+# DOS runtime (also in the extra archive)
+RT_DOS = \
+ README_dos.txt \
+ runtime/rgb.txt \
+ vimtutor.bat \
+
+# DOS runtime without CR-LF translation (also in the extra archive)
+RT_DOS_BIN = \
+ runtime/vimlogo.cdr \
+ runtime/vimlogo.eps \
+ runtime/vimlogo.gif \
+ runtime/vimlogo.pdf \
+
+# Amiga runtime (also in the extra archive)
+RT_AMI = \
+ README.txt.info \
+ README_ami.txt \
+ README_ami.txt.info \
+ libs/arp.library \
+ runtime/doc.info \
+ runtime/doc/*.info \
+ runtime/icons \
+ runtime/icons.info \
+ runtime/macros.info \
+ runtime/macros/*.info \
+ runtime/macros/hanoi/*.info \
+ runtime/macros/life/*.info \
+ runtime/macros/maze/*.info \
+ runtime/macros/urm/*.info \
+ runtime/tools.info \
+ runtime/tutor.info \
+ runtime/tutor/*.info \
+
+# runtime files in extra archive
+RT_EXTRA = \
+ $(RT_AMI) \
+ $(RT_AMI_DOS) \
+ $(RT_DOS) \
+ $(RT_DOS_BIN) \
+ README_mac.txt \
+
+# included in all Amiga archives
+ROOT_AMI = \
+ Contents \
+ Contents.info \
+ runtime.info \
+ vimdir.info \
+
+# root files for the extra archive
+ROOT_EXTRA = \
+ $(ROOT_AMI) \
+
+# files for Amiga small binary (also in extra archive)
+BIN_AMI = \
+ README_amibin.txt \
+ README_amibin.txt.info \
+ Vim.info \
+ Xxd.info \
+
+# files for DOS binary (also in extra archive)
+BIN_DOS = \
+ README_bindos.txt \
+ uninstal.txt \
+
+# files for Win32 OLE binary (also in extra archive)
+BIN_OLE = \
+ README_ole.txt \
+
+# files for Win32s binary (also in extra archive)
+BIN_W32S = \
+ README_w32s.txt \
+
+# files for VMS binary (also in extra archive)
+BIN_VMS = \
+ README_vms.txt \
+
+# files for OS/2 binary (also in extra archive)
+BIN_OS2 = \
+ README_os2.txt \
+
+# binary files for extra archive
+BIN_EXTRA = \
+ $(BIN_AMI) \
+ $(BIN_DOS) \
+ $(BIN_OLE) \
+ $(BIN_W32S) \
+ $(BIN_VMS) \
+ $(BIN_OS2) \
+
+# all files for extra archive
+EXTRA = \
+ $(BIN_EXTRA) \
+ $(ROOT_EXTRA) \
+ $(RT_EXTRA) \
+ $(SRC_EXTRA) \
+ README_extra.txt \
+ src/VisVim/VisVim.dll \
+ farsi \
+ runtime/vimlogo.xpm \
+ src/swis.s \
+ src/tee/Makefile* \
+ src/tee/tee.c \
+ csdpmi4b.zip \
+ emx.dll \
+ emxlibcs.dll \
+
+# generic language files
+LANG_GEN = \
+ README_lang.txt \
+ runtime/lang/README.txt \
+ runtime/lang/menu_*.vim \
+ runtime/keymap/README.txt \
+ runtime/keymap/*.vim \
+ runtime/tutor/README.*.txt \
+ runtime/tutor/Makefile \
+ runtime/tutor/tutor.?? \
+ runtime/tutor/tutor.gr.* \
+ runtime/tutor/tutor.ja.* \
+ runtime/tutor/tutor.ko.* \
+ runtime/tutor/tutor.pl.* \
+ runtime/tutor/tutor.ru.* \
+ runtime/tutor/tutor.zh.* \
+
+# all files for lang archive
+LANG_SRC = \
+ src/po/README.txt \
+ src/po/README_mingw.txt \
+ src/po/README_mvc.txt \
+ src/po/cleanup.vim \
+ src/po/Makefile \
+ src/po/Make_ming.mak \
+ src/po/Make_mvc.mak \
+ src/po/sjiscorr.c \
+ src/po/*.po \
+
+# the language files for the Win32 lang archive
+LANG_DOS = \
+ src/po/*.mo \
+
+# vim: set ft=make:
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..d734cd954
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,629 @@
+# This Makefile has two purposes:
+# 1. Starting the compilation of Vim for Unix.
+# 2. Creating the various distribution files.
+
+
+# 1. Using this Makefile without an argument will compile Vim for Unix.
+#
+# "make install" is also possible.
+#
+# NOTE: If this doesn't work properly, first change directory to "src" and use
+# the Makefile there:
+# cd src
+# make [arguments]
+# Noticed on AIX systems when using this Makefile: Trying to run "cproto" or
+# something else after Vim has been compiled. Don't know why...
+# Noticed on OS/390 Unix: Restarts configure.
+#
+# The first (default) target is "first". This will result in running
+# "make first", so that the target from "src/auto/config.mk" is picked
+# up properly when config didn't run yet. Doing "make all" before configure
+# has run can result in compiling with $(CC) empty.
+
+first:
+ @echo "Starting make in the src directory."
+ @echo "If there are problems, cd to the src directory and run make there"
+ cd src && $(MAKE) $@
+
+# Some make programs use the last target for the $@ default; put the other
+# targets separately to always let $@ expand to "first" by default.
+all install uninstall tools config configure proto depend lint tags types test testclean clean distclean:
+ @echo "Starting make in the src directory."
+ @echo "If there are problems, cd to the src directory and run make there"
+ cd src && $(MAKE) $@
+
+
+# 2. Create the various distributions:
+#
+# TARGET PRODUCES CONTAINS
+# unixall vim-#.#.tar.bz2 Runtime files and Sources for Unix
+# unixrt vim-#.#-rt[12].tar.gz Runtime files for Unix
+# unixsrc vim-#.#-src[12].tar.gz Sources for Unix
+#
+# extra vim-#.#-extra.tar.gz Extra source and runtime files
+# lang vim-#.#-lang.tar.gz multi-language files
+#
+# html vim##html.zip HTML docs
+#
+# amisrc vim##src.tgz sources for Amiga
+# amirt vim##rt.tgz runtime for Amiga
+# amibin vim##bin.tgz binary for Amiga
+#
+# dossrc vim##src.zip sources for MS-DOS
+# dosrt vim##rt.zip runtime for MS-DOS
+# dosbin vim##d16.zip binary for MS-DOS 16 bits
+# vim##d32.zip binary for MS-DOS 32 bits
+# vim##w32.zip binary for Win32
+# gvim##.zip binary for GUI Win32
+# gvim##ole.zip OLE exe for Win32 GUI
+# gvim##_s.zip exe for Win32s GUI
+# doslang vim##lang.zip language files for Win32
+#
+# os2bin vim##os2.zip binary for OS/2
+# (use RT from dosrt)
+#
+# farsi farsi##.zip Farsi fonts
+#
+# All output files are created in the "dist" directory. Existing files are
+# overwritten!
+# To do all this you need the unixrt, unixsrc, extra and lang archives, and
+# compiled binaries.
+# Before creating an archive first delete all backup files, *.orig, etc.
+
+MAJOR = 6
+MINOR = 3
+
+# Uncomment this line if the Win32s version is to be included.
+#DOSBIN_S = dosbin_s
+
+# CHECKLIST for creating a new version:
+#
+# - Update Vim version number. For a test version in: src/version.h, Contents,
+# MAJOR/MINOR above, VIMRTDIR and VERSION in src/Makefile, README*.txt,
+# runtime/doc/*.txt and nsis/gvim.nsi. For a minor/major version:
+# src/GvimExt/GvimExt.reg, src/vim16.def.
+# - Correct included_patches[] in src/version.c.
+# - Compile Vim with GTK, Perl, Python, TCL, Ruby, Cscope and "huge" features.
+# - With these features: "make proto" (requires cproto and Motif installed;
+# ignore warnings for missing include files, fix problems for syntax errors).
+# - With these features: "make depend" (works best with gcc).
+# - "make lint" and check the output (ignore GTK warnings).
+# - Enable the efence library in "src/Makefile" and run "make test". May
+# require disabling Python to avoid trouble with threads.
+# - Check for missing entries in runtime/makemenu.vim (with checkmenu script).
+# - Check for missing options in runtime/optwin.vim et al. (with check.vim).
+# - Do "make menu" to update the runtime/synmenu.vim file.
+# - Add remarks for changes to runtime/doc/version6.txt.
+# - In runtime/doc run "make" and "make html" to check for errors.
+# - Check if src/Makefile and src/feature.h don't contain any personal
+# preferences or the GTK, Perl, etc. mentioned above.
+# - Check that runtime/doc/help.txt doesn't contain entries in "LOCAL
+# ADDITIONS".
+# - Check file protections to be "644" for text and "755" for executables (run
+# the "check" script).
+# - Check compiling on Amiga, MS-DOS and MS-Windows.
+# - Delete all *~, *.sw?, *.orig, *.rej files
+# - "make unixall", "make extra", "make lang", "make html"
+#
+# Amiga:
+# - "make amisrc", move the archive to the Amiga and compile:
+# "make -f Make_manx.mak" (will use "big" features by default).
+# - Run the tests: "make -f Make_manx.mak test"
+# - Place the executables Vim and Xxd in this directory (set the executable
+# flag).
+# - "make amirt", "make amibin".
+#
+# PC:
+# - "make dossrc" and "make dosrt". Unpack the archives on a PC.
+# 16 bit DOS version:
+# - Set environment for compiling with Borland C++ 3.1.
+# - "bmake -f Make_bc3.mak BOR=E:\borlandc" (compiling xxd might fail, in that
+# case set environment for compiling with Borland C++ 4.0 and do
+# "make -f make_bc3.mak BOR=E:\BC4 xxd/xxd.exe").
+# - "make test" and check the output.
+# - Rename the executables to "vimd16.exe", "xxdd16.exe", "installd16.exe" and
+# "uninstald16.exe".
+# 32 bit DOS version:
+# - Set environment for compiling with DJGPP; "gmake -f Make_djg.mak".
+# - "rm testdir/*.out", "make -f Make_djg.mak test" and check the output.
+# - Rename the executables to "vimd32.exe", "xxdd32.exe", "installd32.exe" and
+# "uninstald32.exe".
+# Win32 console version:
+# - Set environment for Visual C++ 5.0: "vcvars32"
+# - "nmake -f Make_mvc.mak"
+# - "rm testdir/*.out", "nmake -f Make_mvc.mak test" and check the output.
+# - Rename the executables to "vimw32.exe", "xxdw32.exe".
+# - When building the Win32s version later, delete vimrun.exe, install.exe and
+# uninstal.exe. Otherwise rename executables to installw32.exe and
+# uninstalw32.exe.
+# Win32 GUI version:
+# - "nmake -f Make_mvc.mak GUI=yes.
+# - move "gvim.exe" to here (otherwise the OLE version will overwrite it).
+# - Delete vimrun.exe, install.exe and uninstall.exe.
+# - Copy "GvimExt/gvimext.dll" to here.
+# Win32 GUI version with OLE, PERL, TCL, PYTHON and dynamic IME:
+# - Run src/bigvim.bat ("nmake -f Make_mvc.mak GUI=yes OLE=yes IME=yes ...)
+# - Rename "gvim.exe" to "gvim_ole.exe".
+# - Delete install.exe and uninstall.exe.
+# - If building the Win32s version delete vimrun.exe.
+# Win32s GUI version:
+# - Set environment for Visual C++ 4.1 (requires a new console window)
+# - "vcvars32" (use the path for VC 4.1 e:\msdev\bin)
+# - "nmake -f Make_mvc.mak GUI=yes INTL=no clean" (use the path for VC 4.1)
+# - "nmake -f Make_mvc.mak GUI=yes INTL=no" (use the path for VC 4.1)
+# - Rename "gvim.exe" to "gvim_w32s.exe".
+# - Rename "install.exe" to "installw32.exe"
+# - Rename "uninstal.exe" to "uninstalw32.exe"
+# - The produced uninstalw32.exe and vimrun.exe are used.
+# Create the archives:
+# - Copy all the "*.exe" files to where this Makefile is.
+# - "make dosbin".
+# - Run make on Unix to update the ".mo" files.
+# - "make doslang".
+# NSIS self installing exe:
+# - Unpack the doslang archive on the PC.
+# - Make sure gvim_ole.exe, vimd32.exe, vimw32.exe, installw32.exe,
+# uninstalw32.exe and xxdw32.exe have been build as mentioned above.
+# - put gvimext.dll in src/GvimExt and VisVim.dll in src/VisVim (get them
+# from a binary archive or build them)
+# - make sure there is a diff.exe two levels up
+# - go to ../nsis and do "makensis gvim.nsi".
+# - Copy gvim##.exe to the dist directory.
+#
+# OS/2:
+# - Unpack the Unix "src", "extra" and "rt" archives.
+# - "make -f Make_os2.mak".
+# - Rename the executables to vimos2.exe, xxdos2.exe and teeos2.exe and copy
+# them to here.
+# - "make os2bin".
+
+VIMVER = vim-$(MAJOR).$(MINOR)
+VERSION = $(MAJOR)$(MINOR)
+VDOT = $(MAJOR).$(MINOR)
+VIMRTDIR = vim$(VERSION)
+
+# Vim used for conversion from "unix" to "dos"
+VIM = vim
+
+# How to include Filelist depends on the version of "make" you have.
+# If the current choice doesn't work, try the other one.
+
+include Filelist
+#.include "Filelist"
+
+
+# All output is put in the "dist" directory.
+dist:
+ mkdir dist
+
+# Clean up some files to avoid they are included.
+prepare:
+ if test -f runtime/doc/uganda.nsis.txt; then \
+ rm runtime/doc/uganda.nsis.txt; fi
+
+# For the zip files we need to create a file with the comment line
+dist/comment:
+ mkdir dist/comment
+
+COMMENT_RT = comment/$(VERSION)-rt
+COMMENT_RT1 = comment/$(VERSION)-rt1
+COMMENT_RT2 = comment/$(VERSION)-rt2
+COMMENT_D16 = comment/$(VERSION)-bin-d16
+COMMENT_D32 = comment/$(VERSION)-bin-d32
+COMMENT_W32 = comment/$(VERSION)-bin-w32
+COMMENT_GVIM = comment/$(VERSION)-bin-gvim
+COMMENT_OLE = comment/$(VERSION)-bin-ole
+COMMENT_W32S = comment/$(VERSION)-bin-w32s
+COMMENT_SRC = comment/$(VERSION)-src
+COMMENT_OS2 = comment/$(VERSION)-bin-os2
+COMMENT_HTML = comment/$(VERSION)-html
+COMMENT_FARSI = comment/$(VERSION)-farsi
+COMMENT_LANG = comment/$(VERSION)-lang
+
+dist/$(COMMENT_RT): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) runtime files for MS-DOS and MS-Windows" > dist/$(COMMENT_RT)
+
+dist/$(COMMENT_RT1): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) runtime files (PART 1) for MS-DOS and MS-Windows" > dist/$(COMMENT_RT1)
+
+dist/$(COMMENT_RT2): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) runtime files (PART 2) for MS-DOS and MS-Windows" > dist/$(COMMENT_RT2)
+
+dist/$(COMMENT_D16): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-DOS 16 bit real mode" > dist/$(COMMENT_D16)
+
+dist/$(COMMENT_D32): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-DOS 32 bit protected mode" > dist/$(COMMENT_D32)
+
+dist/$(COMMENT_W32): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) binaries for MS-Windows NT/95" > dist/$(COMMENT_W32)
+
+dist/$(COMMENT_GVIM): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) GUI binaries for MS-Windows NT/95" > dist/$(COMMENT_GVIM)
+
+dist/$(COMMENT_OLE): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) MS-Windows GUI binaries with OLE support" > dist/$(COMMENT_OLE)
+
+dist/$(COMMENT_W32S): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) GUI binaries for MS-Windows 3.1/3.11" > dist/$(COMMENT_W32S)
+
+dist/$(COMMENT_SRC): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) sources for MS-DOS and MS-Windows" > dist/$(COMMENT_SRC)
+
+dist/$(COMMENT_OS2): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) binaries + runtime files for OS/2" > dist/$(COMMENT_OS2)
+
+dist/$(COMMENT_HTML): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) documentation in HTML" > dist/$(COMMENT_HTML)
+
+dist/$(COMMENT_FARSI): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) Farsi language files" > dist/$(COMMENT_FARSI)
+
+dist/$(COMMENT_LANG): dist/comment
+ echo "Vim - Vi IMproved - v$(VDOT) MS-Windows language files" > dist/$(COMMENT_LANG)
+
+unixrt: dist prepare
+ -rm -f dist/$(VIMVER)-rt1.tar.gz
+ -rm -f dist/$(VIMVER)-rt2.tar.gz
+# first runtime file
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(RT_ALL) \
+ $(RT_ALL_BIN) \
+ $(RT_UNIX) \
+ $(RT_UNIX_DOS_BIN) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+ cd dist && tar cf $(VIMVER)-rt1.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-rt1.tar
+# second runtime file (script and language files)
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(RT_SCRIPTS) \
+ $(LANG_GEN) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+ cd dist && tar cf $(VIMVER)-rt2.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-rt2.tar
+
+unixsrc: dist prepare
+ -rm -f dist/$(VIMVER)-src1.tar.gz
+ -rm -f dist/$(VIMVER)-src2.tar.gz
+# first source file
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(SRC_ALL1) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+ cd dist && tar cf $(VIMVER)-src1.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-src1.tar
+# second source file
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(SRC_ALL2) \
+ $(SRC_UNIX) \
+ $(SRC_DOS_UNIX) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+# Need to use a "distclean" config.mk file
+ cp -f src/config.mk.dist dist/$(VIMRTDIR)/src/auto/config.mk
+# Create an empty config.h file, make dependencies require it
+ touch dist/$(VIMRTDIR)/src/auto/config.h
+# Make sure configure is newer than config.mk to force it to be generated
+ touch dist/$(VIMRTDIR)/src/configure
+ cd dist && tar cf $(VIMVER)-src2.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-src2.tar
+
+unixall: dist unixsrc unixrt
+ -rm -f dist/$(VIMVER).tar.bz2
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ cd dist && tar xfz $(VIMVER)-src1.tar.gz
+ cd dist && tar xfz $(VIMVER)-src2.tar.gz
+ cd dist && tar xfz $(VIMVER)-rt1.tar.gz
+ cd dist && tar xfz $(VIMVER)-rt2.tar.gz
+# Create an empty config.h file, make dependencies require it
+ touch dist/$(VIMRTDIR)/src/auto/config.h
+# Make sure configure is newer than config.mk to force it to be generated
+ touch dist/$(VIMRTDIR)/src/configure
+ cd dist && tar cf $(VIMVER).tar $(VIMRTDIR)
+ bzip2 dist/$(VIMVER).tar
+
+extra: dist prepare
+ -rm -f dist/$(VIMVER)-extra.tar.gz
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(EXTRA) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+ cd dist && tar cf $(VIMVER)-extra.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-extra.tar
+
+lang: dist prepare
+ -rm -f dist/$(VIMVER)-lang.tar.gz
+ -rm -rf dist/$(VIMRTDIR)
+ mkdir dist/$(VIMRTDIR)
+ tar cf - \
+ $(LANG_SRC) \
+ | (cd dist/$(VIMRTDIR); tar xf -)
+# Make sure ja.sjis.po is newer than ja.po to avoid it being regenerated.
+# Same for cs.cp1250.po, pl.cp1250.po and sk.cp1250.po.
+ touch dist/$(VIMRTDIR)/src/po/ja.sjis.po
+ touch dist/$(VIMRTDIR)/src/po/cs.cp1250.po
+ touch dist/$(VIMRTDIR)/src/po/pl.cp1250.po
+ touch dist/$(VIMRTDIR)/src/po/sk.cp1250.po
+ touch dist/$(VIMRTDIR)/src/po/zh_CN.cp936.po
+ touch dist/$(VIMRTDIR)/src/po/ru.cp1251.po
+ cd dist && tar cf $(VIMVER)-lang.tar $(VIMRTDIR)
+ gzip -9 dist/$(VIMVER)-lang.tar
+
+amirt: dist prepare
+ -rm -f dist/vim$(VERSION)rt.tar.gz
+ -rm -rf dist/Vim
+ mkdir dist/Vim
+ mkdir dist/Vim/$(VIMRTDIR)
+ tar cf - \
+ $(ROOT_AMI) \
+ $(RT_ALL) \
+ $(RT_ALL_BIN) \
+ $(RT_SCRIPTS) \
+ $(RT_AMI) \
+ $(RT_NO_UNIX) \
+ $(RT_AMI_DOS) \
+ | (cd dist/Vim/$(VIMRTDIR); tar xf -)
+ mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
+ mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
+ mv dist/Vim/$(VIMRTDIR)/runtime/* dist/Vim/$(VIMRTDIR)
+ rmdir dist/Vim/$(VIMRTDIR)/runtime
+ cd dist && tar cf vim$(VERSION)rt.tar Vim Vim.info
+ gzip -9 dist/vim$(VERSION)rt.tar
+ mv dist/vim$(VERSION)rt.tar.gz dist/vim$(VERSION)rt.tgz
+
+amibin: dist prepare
+ -rm -f dist/vim$(VERSION)bin.tar.gz
+ -rm -rf dist/Vim
+ mkdir dist/Vim
+ mkdir dist/Vim/$(VIMRTDIR)
+ tar cf - \
+ $(ROOT_AMI) \
+ $(BIN_AMI) \
+ Vim \
+ Xxd \
+ | (cd dist/Vim/$(VIMRTDIR); tar xf -)
+ mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
+ mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
+ cd dist && tar cf vim$(VERSION)bin.tar Vim Vim.info
+ gzip -9 dist/vim$(VERSION)bin.tar
+ mv dist/vim$(VERSION)bin.tar.gz dist/vim$(VERSION)bin.tgz
+
+amisrc: dist prepare
+ -rm -f dist/vim$(VERSION)src.tar.gz
+ -rm -rf dist/Vim
+ mkdir dist/Vim
+ mkdir dist/Vim/$(VIMRTDIR)
+ tar cf - \
+ $(ROOT_AMI) \
+ $(SRC_ALL1) \
+ $(SRC_ALL2) \
+ $(SRC_AMI) \
+ $(SRC_AMI_DOS) \
+ | (cd dist/Vim/$(VIMRTDIR); tar xf -)
+ mv dist/Vim/$(VIMRTDIR)/vimdir.info dist/Vim.info
+ mv dist/Vim/$(VIMRTDIR)/runtime.info dist/Vim/$(VIMRTDIR).info
+ cd dist && tar cf vim$(VERSION)src.tar Vim Vim.info
+ gzip -9 dist/vim$(VERSION)src.tar
+ mv dist/vim$(VERSION)src.tar.gz dist/vim$(VERSION)src.tgz
+
+no_title.vim: Makefile
+ echo "set notitle noicon nocp nomodeline viminfo=" >no_title.vim
+
+dosrt: dist dist/$(COMMENT_RT) dosrt_unix2dos
+ -rm -rf dist/vim$(VERSION)rt.zip
+ cd dist && zip -9 -rD -z vim$(VERSION)rt.zip vim <$(COMMENT_RT)
+
+dosrt_unix2dos: dist prepare no_title.vim
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(RT_ALL) \
+ $(RT_SCRIPTS) \
+ $(RT_DOS) \
+ $(RT_NO_UNIX) \
+ $(RT_AMI_DOS) \
+ $(LANG_GEN) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ tar cf - \
+ $(RT_UNIX_DOS_BIN) \
+ $(RT_ALL_BIN) \
+ $(RT_DOS_BIN) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR)
+ rmdir dist/vim/$(VIMRTDIR)/runtime
+
+
+# Convert runtime files from Unix fileformat to dos fileformat.
+# Used before uploading. Don't delete the AAPDIR/sign files!
+runtime_unix2dos: dosrt_unix2dos
+ -rm -rf `find runtime/dos -type f -print | sed -e /AAPDIR/d`
+ cd dist/vim/$(VIMRTDIR); tar cf - * \
+ | (cd ../../../runtime/dos; tar xf -)
+
+dosbin: prepare dosbin_gvim dosbin_w32 dosbin_d32 dosbin_d16 dosbin_ole $(DOSBIN_S)
+
+# make Win32 gvim
+dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM)
+ -rm -rf dist/gvim$(VERSION).zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp gvim.exe dist/vim/$(VIMRTDIR)/gvim.exe
+ cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp vimrun.exe dist/vim/$(VIMRTDIR)/vimrun.exe
+ cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
+ cd dist && zip -9 -rD -z gvim$(VERSION).zip vim <$(COMMENT_GVIM)
+
+# make Win32 console
+dosbin_w32: dist no_title.vim dist/$(COMMENT_W32)
+ -rm -rf dist/vim$(VERSION)w32.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp vimw32.exe dist/vim/$(VIMRTDIR)/vim.exe
+ cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cd dist && zip -9 -rD -z vim$(VERSION)w32.zip vim <$(COMMENT_W32)
+
+# make 32bit DOS
+dosbin_d32: dist no_title.vim dist/$(COMMENT_D32)
+ -rm -rf dist/vim$(VERSION)d32.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp vimd32.exe dist/vim/$(VIMRTDIR)/vim.exe
+ cp xxdd32.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp installd32.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstald32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cp csdpmi4b.zip dist/vim/$(VIMRTDIR)
+ cd dist && zip -9 -rD -z vim$(VERSION)d32.zip vim <$(COMMENT_D32)
+
+# make 16bit DOS
+dosbin_d16: dist no_title.vim dist/$(COMMENT_D16)
+ -rm -rf dist/vim$(VERSION)d16.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp vimd16.exe dist/vim/$(VIMRTDIR)/vim.exe
+ cp xxdd16.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp installd16.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstald16.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cd dist && zip -9 -rD -z vim$(VERSION)d16.zip vim <$(COMMENT_D16)
+
+# make Win32 gvim with OLE
+dosbin_ole: dist no_title.vim dist/$(COMMENT_OLE)
+ -rm -rf dist/gvim$(VERSION)ole.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp gvim_ole.exe dist/vim/$(VIMRTDIR)/gvim.exe
+ cp xxdw32.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp vimrun.exe dist/vim/$(VIMRTDIR)/vimrun.exe
+ cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
+ cp README_ole.txt dist/vim/$(VIMRTDIR)
+ cp src/VisVim/VisVim.dll dist/vim/$(VIMRTDIR)/VisVim.dll
+ cp src/VisVim/README_VisVim.txt dist/vim/$(VIMRTDIR)
+ cd dist && zip -9 -rD -z gvim$(VERSION)ole.zip vim <$(COMMENT_OLE)
+
+# make Win32s gvim
+dosbin_s: dist no_title.vim dist/$(COMMENT_W32S)
+ -rm -rf dist/gvim$(VERSION)_s.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_DOS) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp gvim_w32s.exe dist/vim/$(VIMRTDIR)/gvim.exe
+ cp xxdd32.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp README_w32s.txt dist/vim/$(VIMRTDIR)
+ cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
+ cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
+ cd dist && zip -9 -rD -z gvim$(VERSION)_s.zip vim <$(COMMENT_W32S)
+
+# make Win32 lang archive
+doslang: dist prepare no_title.vim dist/$(COMMENT_LANG)
+ -rm -rf dist/vim$(VERSION)lang.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ mkdir dist/vim/$(VIMRTDIR)/lang
+ cd src && MAKEMO=yes $(MAKE) languages
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+# Add the message translations. Trick: skip ja.mo and use ja.sjis.mo instead.
+# Same for cs.mo / cs.cp1250.mo, pl.mo / pl.cp1250.mo, sk.mo / sk.cp1250.mo,
+# zh_CN.mo / zh_CN.cp936.mo and ru.mo / ru.cp1251.mo.
+ for i in $(LANG_DOS); do \
+ if test "$$i" != "src/po/ja.mo" -a "$$i" != "src/po/pl.mo" -a "$$i" != "src/po/cs.mo" -a "$$i" != "src/po/sk.mo" -a "$$i" != "src/po/zh_CN.mo" -a "$$i" != "src/po/ru.mo"; then \
+ n=`echo $$i | sed -e "s+src/po/\([-a-zA-Z0-9_]*\(.UTF-8\)*\)\(.sjis\)*\(.cp1250\)*\(.cp1251\)*\(.cp936\)*.mo+\1+"`; \
+ mkdir dist/vim/$(VIMRTDIR)/lang/$$n; \
+ mkdir dist/vim/$(VIMRTDIR)/lang/$$n/LC_MESSAGES; \
+ cp $$i dist/vim/$(VIMRTDIR)/lang/$$n/LC_MESSAGES/vim.mo; \
+ fi \
+ done
+ cp libintl.dll dist/vim/$(VIMRTDIR)/
+ cd dist && zip -9 -rD -z vim$(VERSION)lang.zip vim <$(COMMENT_LANG)
+
+# MS-DOS sources
+dossrc: dist no_title.vim dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt
+ -rm -rf dist/vim$(VERSION)src.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(SRC_ALL1) \
+ $(SRC_ALL2) \
+ $(SRC_DOS) \
+ $(SRC_AMI_DOS) \
+ $(SRC_DOS_UNIX) \
+ runtime/doc/uganda.nsis.txt \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR)
+ rmdir dist/vim/$(VIMRTDIR)/runtime
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ tar cf - \
+ $(SRC_DOS_BIN) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ cd dist && zip -9 -rD -z vim$(VERSION)src.zip vim <$(COMMENT_SRC)
+
+runtime/doc/uganda.nsis.txt: runtime/doc/uganda.txt
+ cd runtime/doc && $(MAKE) uganda.nsis.txt
+
+os2bin: dist no_title.vim dist/$(COMMENT_OS2)
+ -rm -rf dist/vim$(VERSION)os2.zip
+ -rm -rf dist/vim
+ mkdir dist/vim
+ mkdir dist/vim/$(VIMRTDIR)
+ tar cf - \
+ $(BIN_OS2) \
+ | (cd dist/vim/$(VIMRTDIR); tar xf -)
+ find dist/vim/$(VIMRTDIR) -type f -exec $(VIM) -e -u no_title.vim -c ":set tx|wq" {} \;
+ cp vimos2.exe dist/vim/$(VIMRTDIR)/vim.exe
+ cp xxdos2.exe dist/vim/$(VIMRTDIR)/xxd.exe
+ cp teeos2.exe dist/vim/$(VIMRTDIR)/tee.exe
+ cp emx.dll emxlibcs.dll dist/vim/$(VIMRTDIR)
+ cd dist && zip -9 -rD -z vim$(VERSION)os2.zip vim <$(COMMENT_OS2)
+
+html: dist dist/$(COMMENT_HTML)
+ -rm -rf dist/vim$(VERSION)html.zip
+ cd runtime/doc && zip -9 -z ../../dist/vim$(VERSION)html.zip *.html <../../dist/$(COMMENT_HTML)
+
+farsi: dist dist/$(COMMENT_FARSI)
+ -rm -f dist/farsi$(VERSION).zip
+ zip -9 -rD -z dist/farsi$(VERSION).zip farsi < dist/$(COMMENT_FARSI)
diff --git a/README.txt.info b/README.txt.info
new file mode 100755
index 000000000..e7fa11494
--- /dev/null
+++ b/README.txt.info
Binary files differ
diff --git a/README_ami.txt b/README_ami.txt
new file mode 100644
index 000000000..ba54262d4
--- /dev/null
+++ b/README_ami.txt
@@ -0,0 +1,32 @@
+README_ami.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on Amiga systems.
+See README.txt for general information about Vim.
+
+
+Unpack the distributed files in the place where you want to keep them. It is
+wise to have a "vim" directory to keep your vimrc file and any other files you
+change. The distributed files go into a subdirectory. This way you can
+easily upgrade to a new version. For example:
+
+ dh0:editors/vim contains your vimrc and modified files
+ dh0:editors/vim/vim54 contains the Vim version 5.4 distributed files
+ dh0:editors/vim/vim55 contains the Vim version 5.5 distributed files
+
+You would then unpack the archives like this:
+
+ cd dh0:editors
+ tar xf t:vim60bin.tar
+ tar xf t:vim60rt.tar
+
+Set the $VIM environment variable to point to the top directory of your Vim
+files. For the above example:
+
+ set VIM=dh0:editors/vim
+
+Vim version 5.4 will look for your vimrc file in $VIM, and for the runtime
+files in $VIM/vim54. See ":help $VIM" for more information.
+
+Make sure the Vim executable is in your search path. Either copy the Vim
+executable to a directory that is in your search path, or (preferred) modify
+the search path to include the directory where the Vim executable is.
diff --git a/README_ami.txt.info b/README_ami.txt.info
new file mode 100755
index 000000000..912436d6a
--- /dev/null
+++ b/README_ami.txt.info
Binary files differ
diff --git a/README_amibin.txt b/README_amibin.txt
new file mode 100644
index 000000000..9d784a24f
--- /dev/null
+++ b/README_amibin.txt
@@ -0,0 +1,12 @@
+README_amibin.txt for version 7.0aa of Vim: Vi IMproved.
+
+See "README.txt" for general information about Vim.
+See "README_ami.txt" for installation instructions for the Amiga.
+These files are in the runtime archive (vim60rt.tgz).
+
+
+The Amiga "bin" archive contains the Vim executable for the Amiga. It was
+compiled with "big" features.
+
+Postscript printing is not included to avoid requiring floating point
+computations.
diff --git a/README_amibin.txt.info b/README_amibin.txt.info
new file mode 100755
index 000000000..bdc3f028e
--- /dev/null
+++ b/README_amibin.txt.info
Binary files differ
diff --git a/README_amisrc.txt b/README_amisrc.txt
new file mode 100644
index 000000000..c24764e14
--- /dev/null
+++ b/README_amisrc.txt
@@ -0,0 +1,11 @@
+README_amisrc.txt for version 7.0aa of Vim: Vi IMproved.
+
+See "README.txt" for general information about Vim.
+See "README_ami.txt" for installation instructions for the Amiga.
+These files are in the runtime archive (vim60rt.tgz).
+
+
+The Amiga source archive contains the files needed to compile Vim on the
+Amiga.
+
+See "src/INSTALLami.txt" for instructions on how to compile Vim on the Amiga.
diff --git a/README_amisrc.txt.info b/README_amisrc.txt.info
new file mode 100755
index 000000000..476af9ac0
--- /dev/null
+++ b/README_amisrc.txt.info
Binary files differ
diff --git a/README_bindos.txt b/README_bindos.txt
new file mode 100644
index 000000000..441fc3c43
--- /dev/null
+++ b/README_bindos.txt
@@ -0,0 +1,19 @@
+README_bindos.txt for version 7.0aa of Vim: Vi IMproved.
+
+See "README.txt" for general information about Vim.
+See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.
+These files are in the runtime archive (vim60rt.zip).
+
+
+There are several binary distributions of Vim for the PC. You would normally
+pick only one of them, but it's also possible to install several.
+These ones are available (the version number may differ):
+ vim60d16.zip 16 bit DOS version
+ vim60d32.zip 32 bit DOS version
+ vim60w32.zip Windows 95/98/NT/etc. console version
+ gvim60.zip Windows 95/98/NT/etc. GUI version
+ gvim60ole.zip Windows 95/98/NT/etc. GUI version with OLE
+ gvim60_s.zip Windows 3.1 GUI version
+
+You MUST also get the runtime archive (vim60rt.zip).
+The sources are also available (vim60src.zip).
diff --git a/README_dos.txt b/README_dos.txt
new file mode 100644
index 000000000..3cdc532a1
--- /dev/null
+++ b/README_dos.txt
@@ -0,0 +1,154 @@
+README_dos.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on MS-DOS and MS-Windows systems.
+See "README.txt" for general information about Vim.
+
+There are two ways to install Vim:
+A. Use the self-installing .exe file.
+B. Unpack .zip files and run the install.exe program.
+
+
+A. Using the self-installing .exe
+---------------------------------
+
+This is mostly self-explaining. Just follow the prompts and make the
+selections. A few things to watch out for:
+
+- When an existing installation is detected, you are offered to first remove
+ this. The uninstall program is then started while the install program waits
+ for it to complete. Sometimes the windows overlap each other, which can be
+ confusing. Be sure the complete the uninstalling before continuing the
+ installation. Watch the taskbar for uninstall windows.
+
+- When selecting a directory to install Vim, use the same place where other
+ versions are located. This makes it easier to find your _vimrc file. For
+ example "C:\Program Files\vim" or "D:\vim". A name ending in "vim" is
+ preferred.
+
+- After selecting the directory where to install Vim, clicking on "Next" will
+ start the installation.
+
+
+B. Using .zip files
+-------------------
+
+These are the normal steps to install Vim from the .zip archives:
+
+1. Go to the directory where you want to put the Vim files. Examples:
+ cd C:\
+ cd D:\editors
+ If you already have a "vim" directory, go to the directory in which it is
+ located. Check the $VIM setting to see where it points to:
+ set VIM
+ For example, if you have
+ C:\vim\vim54
+ do
+ cd C:\
+ Binary and runtime Vim archives are normally unpacked in the same location,
+ on top of each other.
+
+2. Unpack the zip archives. This will create a new directory "vim\vim60",
+ in which all the distributed Vim files are placed. Since the directory
+ name includes the version number, it is unlikely that you overwrite
+ existing files.
+ Examples:
+ pkunzip -d gvim60.zip
+ unzip vim60w32.zip
+
+ You need to unpack the runtime archive and at least one of the binary
+ archives. When using more than one binary version, be careful not to
+ overwrite one version with the other, the names of the executables
+ "vim.exe" and "gvim.exe" are the same.
+
+ After you unpacked the files, you can still move the whole directory tree
+ to another location. That is where they will stay, the install program
+ won't move or copy the runtime files.
+
+ Only for the 32 bit DOS version on MS-DOS without DPMI support (trying to
+ run install.exe will produce an error message): Unpack the CSDPMI4B.ZIP
+ archive and follow the instructions in the documentation.
+
+3. Change to the new directory:
+ cd vim\vim60
+ Run the "install.exe" program. It will ask you a number of questions about
+ how you would like to have your Vim setup. Among these are:
+ - You can tell it to write a "_vimrc" file with your preferences in the
+ parent directory.
+ - It can also install an "Edit with Vim" entry in the Windows Explorer
+ popup menu.
+ - You can have it create batch files, so that you can run Vim from the
+ console or in a shell. You can select one of the directories in your
+ $PATH. If you skip this, you can add Vim to the search path manually:
+ The simplest is to add a line to your autoexec.bat. Examples:
+ set path=%path%;C:\vim\vim60
+ set path=%path%;D:\editors\vim\vim60
+ - Create entries for Vim on the desktop and in the Start menu.
+
+That's it!
+
+
+Remarks:
+
+- If Vim can't find the runtime files, ":help" won't work and the GUI version
+ won't show a menubar. Then you need to set the $VIM environment variable to
+ point to the top directory of your Vim files. Example:
+ set VIM=C:\editors\vim
+ Vim version 6.0 will look for your vimrc file in $VIM, and for the runtime
+ files in $VIM/vim60. See ":help $VIM" for more information.
+
+- To avoid confusion between distributed files of different versions and your
+ own modified vim scripts, it is recommended to use this directory layout:
+ ("C:\vim" is used here as the root, replace it with the path you use)
+ Your own files:
+ C:\vim\_vimrc Your personal vimrc.
+ C:\vim\_viminfo Dynamic info for 'viminfo'.
+ C:\vim\vimfiles\ftplugin\*.vim Filetype plugins
+ C:\vim\... Other files you made.
+ Distributed files:
+ C:\vim\vim60\vim.exe The Vim version 6.0 executable.
+ C:\vim\vim60\doc\*.txt The version 6.0 documentation files.
+ C:\vim\vim60\bugreport.vim A Vim version 6.0 script.
+ C:\vim\vim60\... Other version 6.0 distributed files.
+ In this case the $VIM environment variable would be set like this:
+ set VIM=C:\vim
+ Then $VIMRUNTIME will automatically be set to "$VIM\vim60". Don't add
+ "vim60" to $VIM, that won't work.
+
+- You can put your Vim executable anywhere else. If the executable is not
+ with the other Vim files, you should set $VIM. The simplest is to add a line
+ to your autoexec.bat. Examples:
+ set VIM=c:\vim
+ set VIM=d:\editors\vim
+
+- If you have told the "install.exe" program to add the "Edit with Vim" menu
+ entry, you can remove it by running the "uninstal.exe". See
+ ":help win32-popup-menu".
+
+- In Windows 95/98/NT you can create a shortcut to Vim. This works for all
+ DOS and Win32 console versions. For the console version this gives you the
+ opportunity to set defaults for the Console where Vim runs in.
+
+ 1. On the desktop, click right to get a menu. Select New/Shortcut.
+ 2. In the dialog, enter Command line: "C:\command.com". Click "Next".
+ 3. Enter any name. Click "Finish".
+ The new shortcut will appear on the desktop.
+ 4. With the mouse pointer on the new shortcut, click right to get a menu.
+ Select Properties.
+ 5. In the Program tab, change the "Cmdline" to add "/c" and the name of the
+ Vim executable. Examples:
+ C:\command.com /c C:\vim\vim60\vim.exe
+ C:\command.com /c D:\editors\vim\vim60\vim.exe
+ 6. Select the font, window size, etc. that you like. If this isn't
+ possible, select "Advanced" in the Program tab, and deselect "MS-DOS
+ mode".
+ 7. Click OK.
+
+ For gvim, you can use a normal shortcut on the desktop, and set the size of
+ the Window in your $VIM/_gvimrc:
+ set lines=30 columns=90
+
+
+For further information, type one of these inside Vim:
+ :help dos
+ :help msdos
+ :help win32
diff --git a/README_extra.txt b/README_extra.txt
new file mode 100644
index 000000000..d9358568f
--- /dev/null
+++ b/README_extra.txt
@@ -0,0 +1,61 @@
+README_extra.txt for version 7.0aa of Vim: Vi IMproved.
+
+The extra archive of Vim is to be used in combination with the source archive
+(vim-6.0-src.tar.gz). The extra archive is useless without it.
+
+For more information, see the "README.txt" file that comes with the runtime
+archive (vim-6.0-rt.tar.gz). To be able to run Vim you MUST get the runtime
+archive too!
+
+The extra archive plus the source and runtime achives make up the complete
+sources of Vim for all systems.
+
+
+The extra archive contains:
+
+Farsi Files for the Farsi (persian) language. If you don't know
+ what Farsi is, this is not for you.
+
+if_sniff Interface to SNiFF. If you don't know what SNiFF is, this is
+ not for you.
+
+gui_amiga
+os_amiga Files for the Amiga port.
+
+gui_riscos
+os_riscos Files for the RISC OS port.
+
+gui_beos
+os_beos Files for the BeOS port.
+
+os_msdos
+os_dos Files for the MS-DOS port.
+
+gui_mac
+os_mac Files for the Mac port.
+
+os_mint Files for the Atari Mint port.
+
+os_os2 Files for the OS/2 port.
+tee Extra program for OS/2.
+
+os_vms Files for the VMS port.
+
+os_w32
+os_win32 Files for the Win32 port.
+
+gui_w32 Files for the Win32 GUI.
+Gvim_vc.mak MS Visual C++ makefile for the Win32 GUI.
+rgb.txt File with color definitions for the Win32 GUI.
+
+if_ole OLE automation interface, for MS Windows 95 and NT.
+
+VisVim Integration of Win32 GUI with MS Visual Developer Studio.
+
+GvimExt DLL for the "Edit with Vim" context menu entry
+
+nsis NSIS script to build the self-installing MS-Windows exe
+
+*.man Preprocessed manual pages.
+
+file_select.vim Vim script to browse directories (Unix only).
diff --git a/README_lang.txt b/README_lang.txt
new file mode 100644
index 000000000..f9ae10fff
--- /dev/null
+++ b/README_lang.txt
@@ -0,0 +1,5 @@
+README_lang.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file contains files for non-English languages:
+- Translated messages.
+- Translated menus.
diff --git a/README_mac.txt b/README_mac.txt
new file mode 100644
index 000000000..83e3c64cc
--- /dev/null
+++ b/README_mac.txt
@@ -0,0 +1,8 @@
+README_mac.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on Macintosh systems.
+See "README.txt" for general information about Vim.
+
+
+Sorry, this text still needs to be written!
+
diff --git a/README_ole.txt b/README_ole.txt
new file mode 100644
index 000000000..90fcfa078
--- /dev/null
+++ b/README_ole.txt
@@ -0,0 +1,20 @@
+README_ole.txt for version 7.0aa of Vim: Vi IMproved.
+
+This archive contains gvim.exe with OLE interface and VisVim.
+This version of gvim.exe can also load a number of interface dynamically (you
+can optionally install the .dll files for each interface).
+It is only for MS-Windows 95/98/ME/NT/2000/XP.
+
+Also see the README_bindos.txt, README_dos.txt and README.txt files.
+
+Be careful not to overwrite the OLE gvim.exe with the non-OLE gvim.exe when
+unpacking another binary archive! Check the output of ":version":
+ Win32s - "MS-Windows 16/32 bit GUI version"
+ Win32 - "MS-Windows 32 bit GUI version"
+Win32 with OLE - "MS-Windows 32 bit GUI version with OLE support"
+
+For further information, type this inside Vim:
+ :help if_ole
+
+Futhermore, this archive contains VISVIM.DLL. It can be used to integrate
+the OLE gvim with Microsoft Visual Developer Studio. See VisVim/README.txt.
diff --git a/README_os2.txt b/README_os2.txt
new file mode 100644
index 000000000..249f24106
--- /dev/null
+++ b/README_os2.txt
@@ -0,0 +1,58 @@
+README_os2.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on OS/2 systems.
+See "README.txt" for general information about Vim.
+
+
+NOTE: You will need two archives:
+ vim62rt.zip contains the runtime files (same as for the PC version)
+ vim62os2.zip contains the OS/2 executables
+
+1. Go to the directory where you want to put the Vim files. Examples:
+ cd C:\
+ cd D:\editors
+
+2. Unpack the zip archives. This will create a new directory "vim/vim62",
+ in which all the distributed Vim files are placed. Since the directory
+ name includes the version number, it is unlikely that you overwrite
+ existing files.
+ Examples:
+ pkunzip -d vim62os2.zip
+ unzip vim62os2.zip
+
+ After you unpacked the files, you can still move the whole directory tree
+ to another location.
+
+3. Add the directory where vim.exe is to your path. The simplest is to add a
+ line to your autoexec.bat. Examples:
+ set path=%path%;C:\vim\vim62
+ set path=%path%;D:\editors\vim\vim62
+
+That's it!
+
+
+Extra remarks:
+
+- To avoid confusion between distributed files of different versions and your
+ own modified vim scripts, it is recommended to use this directory layout:
+ ("C:\vim" is used here as the root, replace with the path you use)
+ Your own files:
+ C:\vim\_vimrc Your personal vimrc.
+ C:\vim\_viminfo Dynamic info for 'viminfo'.
+ C:\vim\... Other files you made.
+ Distributed files:
+ C:\vim\vim62\vim.exe The Vim version 6.2 executable.
+ C:\vim\vim62\doc\*.txt The version 6.2 documentation files.
+ C:\vim\vim62\bugreport.vim A Vim version 6.2 script.
+ C:\vim\vim62\... Other version 6.2 distributed files.
+ In this case the $VIM environment variable would be set like this:
+ set VIM=C:\vim
+
+- You can put your Vim executable anywhere else. If the executable is not
+ with the other distributed Vim files, you should set $VIM. The simplest is
+ to add a line to your autoexec.bat. Examples:
+ set VIM=c:\vim
+ set VIM=d:\editors\vim
+
+For further information, type this inside Vim:
+ :help os2
diff --git a/README_os390.txt b/README_os390.txt
new file mode 100644
index 000000000..213ee36a0
--- /dev/null
+++ b/README_os390.txt
@@ -0,0 +1,130 @@
+README_os_390.txt for version 7.0aa of Vim: Vi IMproved.
+
+Welcome to the OS/390 Unix port of VIM.
+
+ATTENTION: THIS IS AN _ALPHA_ VERSION!!!
+I expect you to know how to handle alpha software!
+
+This port was done by Ralf Schandl <schandl@de.ibm.com>.
+This port is not maintained or supported by IBM!!
+
+
+For the list of changes see runtime/doc/os_390.txt.
+
+
+Compiling:
+----------
+
+Note: After the file configure was created via autoconf, it had been
+ handedited, to make the test for ICEConnectionNumber work.
+ DO NOT run autoconf again!
+
+Without X11:
+
+If you build VIM without X11 support, compiling and building is nearly
+straightforward. The only restriction is, that you can't call make from the
+VIM toplevel directory. Change to the src directory first and call make from
+there. Here is a what to do:
+
+ # Don't use c89!
+ # Make additional symbols visible.
+ # Allow intermixing of compiler options and files.
+
+ $ export CC=cc
+ $ export CFLAGS=-D_ALL_SOURCE
+ $ export _CC_CCMODE=1
+ $./configure --enable-max-features --without-x --enable-gui=no
+ $ cd src
+ $ make
+ $ make test
+
+ Note: Test 28 will be reported as failed. This is because diff can't
+ compare files containing '\0' characters. Test 11 will fail if you
+ don't have gzip.
+
+ $ make install
+
+
+With X11:
+
+There are two ways for building VIM with X11 support. The first way is simple
+and results in a big executable (~13 Mb), the second needs a few additional
+steps and results in a much smaller executable (~4.5 Mb). This examples assume
+you want Motif.
+
+ The easy way:
+ $ export CC=cc
+ $ export CFLAGS="-D_ALL_SOURCE -W c,dll"
+ $ export LDFLAGS="-W l,dll"
+ $ export _CC_CCMODE=1
+ $ ./configure --enable-max-features --enable-gui=motif
+ $ cd src
+ $ make
+
+ With this VIM is linked statically with the X11 libraries.
+
+ The smarter way:
+ Make VIM as described above. Then create a file named 'link.sed' with the
+ following contense:
+
+ s/-lXext *//g
+ s/-lXmu *//g
+ s/-lXm */\/usr\/lib\/Xm.x /g
+ s/-lX11 */\/usr\/lib\/X11.x /g
+ s/-lXt *//g
+ s/-lSM */\/usr\/lib\/SM.x /g
+ s/-lICE */\/usr\/lib\/ICE.x /g
+
+ Then do:
+ $ rm vim
+ $ make
+
+ Now Vim is linked with the X11-DLLs.
+
+ See the Makefile and the file link.sh on how link.sed is used.
+
+
+Hint:
+-----
+Use the online help! (See weaknesses below.)
+
+Example:
+Enter ':help syntax' and then press <TAB> several times, you will switch
+through all help items containing 'syntax'. Press <ENTER> on the one you are
+interested at. Or press <Ctrl-D> and you will get a list of all items printed
+that contain 'syntax'.
+
+The helpfiles contains cross-references. Links are between '|'. Position the
+cursor on them and press <Ctrl-]> to follow this link. Use <Ctrl-T> to jump
+back.
+
+Known weaknesses:
+-----------------
+
+- You can't call make from the toplevel directory, you have to do a 'cd src'
+ first. If you do it, make will call configure again. I don't know why and
+ didn't investigate it, there were more important things to do. If you can
+ make it work drop me a note.
+
+- The documentation was not updated for this alpha release. It contains lot of
+ ASCII dependencies, especially in examples.
+
+- Digraphs are dependent on code page 1047. Digraphs are used to enter
+ characters that normally cannot be entered by an ordinary keyboard.
+ See ":help digraphs".
+
+- Using 'ga' to show the code of the character under the cursor shows the
+ correct dec/hex/oct values, but the other informations might be missing or
+ wrong.
+
+- The sed syntax file doesn't work, it is ASCII dependent.
+
+Bugs:
+-----
+If you find a bug please inform me (schandl@de.ibm.com), don't disturb Bram
+Moolenaar. It's most likely a bug I introduced during porting or some ASCII
+dependency I didn't notice.
+
+Feedback:
+---------
+Feedback welcome! Just drop me a note.
diff --git a/README_src.txt b/README_src.txt
new file mode 100644
index 000000000..99aa11812
--- /dev/null
+++ b/README_src.txt
@@ -0,0 +1,10 @@
+README_src.txt for version 7.0aa of Vim: Vi IMproved.
+
+The source archive contains the files needed to compile Vim on Unix systems.
+It is packed for Unix systems (NL line separator). It is also used for other
+systems in combination with the extra archive (vim-6.0-extra.tar.gz, in the
+"extra" directory of ftp.vim.org).
+
+For more information, see the README.txt file that comes with the runtime
+archive (vim-6.0-rt.tar.gz). To be able to run Vim you MUST get the runtime
+archive too!
diff --git a/README_srcdos.txt b/README_srcdos.txt
new file mode 100644
index 000000000..fea7e0973
--- /dev/null
+++ b/README_srcdos.txt
@@ -0,0 +1,12 @@
+README_srcdos.txt for version 7.0aa of Vim: Vi IMproved.
+
+See "README.txt" for general information about Vim.
+See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.
+These files are in the runtime archive (vim60rt.zip).
+
+
+The DOS source archive contains the files needed to compile Vim on MS-DOS or
+MS-Windows. It is packed for DOS systems, with CR-LF. It also includes the
+VisVim sources.
+
+See "src/INSTALLpc.txt" for instructions on how to compile Vim on the PC.
diff --git a/README_unix.txt b/README_unix.txt
new file mode 100644
index 000000000..720c40372
--- /dev/null
+++ b/README_unix.txt
@@ -0,0 +1,10 @@
+README_unix.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on Unix systems.
+See "README.txt" for general information about Vim.
+
+
+When you use the source distribution, "make install" is used to install Vim.
+See the "INSTALL" file in the "src" directory.
+
+If you use a compiled package, follow the instructions for the package.
diff --git a/README_vms.txt b/README_vms.txt
new file mode 100644
index 000000000..f92cd0381
--- /dev/null
+++ b/README_vms.txt
@@ -0,0 +1,41 @@
+README_vms.txt for version 7.0aa of Vim: Vi IMproved.
+
+This file explains the installation of Vim on VMS systems.
+See "README.txt" in the runtime archive for information about Vim.
+
+
+Most information can be found in the on-line documentation. Use ":help vms"
+inside Vim. Or get the runtime files and read runtime/doc/os_vms.txt to find
+out how to install and configure Vim with runtime files etc.
+
+To compile Vim yourself you need three archives:
+ vim-X.X-rt.tar.gz runtime files
+ vim-X.X-src.tar.gz source files
+ vim-X.X-extra.tar.gz extra source files
+
+Compilation is recommended, in order to make sure that the correct
+libraries are used for your specific system. However, you might not be
+able to compile Vim, read more from src/INSTALLvms.txt.
+
+To use the binary version, you need one of these archives:
+
+ vim-XX-exe-alpha-gui.zip Alpha GUI/Motif executables
+ vim-XX-exe-alpha-gtk.zip Alpha GUI/GTK executables
+ vim-XX-exe-alpha-term.zip Alpha console executables
+ vim-XX-exe-vax-gui.zip VAX GUI executables
+ vim-XX-exe-vax-term.zip VAX console executables
+
+and of course
+ vim-XX-runtime.zip runtime files
+
+The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files,
+but there are also prepared "deploy ready" archives:
+
+vim-XX-alpha.zip GUI and console executables with runtime and
+ help files for Alpha systems
+vim-XX-vax.zip GUI and console executables with runtime and
+ help files for VAX systems
+
+These executables and up to date patches for OpenVMS system are downloadable
+from http://www.polarhome.com/vim/ or ftp://ftp.polarhome.com/pub/vim/
+
diff --git a/README_w32s.txt b/README_w32s.txt
new file mode 100644
index 000000000..41b0cdca8
--- /dev/null
+++ b/README_w32s.txt
@@ -0,0 +1,15 @@
+README_w32s.txt for version 7.0aa of Vim: Vi IMproved.
+
+This archive contains the gvim.exe that was specifically compiled for use in
+the Win32s subsystem in MS-Windows 3.1 and 3.11.
+
+Also see the README_bindos.txt, README_dos.txt and README.txt files.
+
+Be careful not to overwrite the Win32s gvim.exe with the another gvim.exe when
+unpacking another binary archive! Check the output of ":version":
+ Win32s - "MS-Windows 16/32 bit GUI version"
+ Win32 - "MS-Windows 32 bit GUI version"
+Win32 with OLE - "MS-Windows 32 bit GUI version with OLE support"
+
+For further information, type this inside Vim:
+ :help win32s
diff --git a/Vim.info b/Vim.info
new file mode 100755
index 000000000..5c465ffab
--- /dev/null
+++ b/Vim.info
Binary files differ
diff --git a/Xxd.info b/Xxd.info
new file mode 100755
index 000000000..7ae7643b2
--- /dev/null
+++ b/Xxd.info
Binary files differ
diff --git a/configure b/configure
new file mode 100755
index 000000000..24f2b03bf
--- /dev/null
+++ b/configure
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+# This is just a stub for the Unix configure script, to provide support for
+# doing "./configure" in the top Vim directory.
+
+cd src && ./configure "$@"
diff --git a/csdpmi4b.zip b/csdpmi4b.zip
new file mode 100755
index 000000000..211396fae
--- /dev/null
+++ b/csdpmi4b.zip
Binary files differ
diff --git a/emx.dll b/emx.dll
new file mode 100644
index 000000000..e16f07f58
--- /dev/null
+++ b/emx.dll
Binary files differ
diff --git a/emxlibcs.dll b/emxlibcs.dll
new file mode 100644
index 000000000..587f0e7de
--- /dev/null
+++ b/emxlibcs.dll
Binary files differ
diff --git a/libs/arp.library b/libs/arp.library
new file mode 100644
index 000000000..1a99560c0
--- /dev/null
+++ b/libs/arp.library
Binary files differ
diff --git a/nsis/README.txt b/nsis/README.txt
new file mode 100644
index 000000000..ad209e9f6
--- /dev/null
+++ b/nsis/README.txt
@@ -0,0 +1,42 @@
+This builds a one-click install for Vim for Win32 using the Nullsoft
+Installation System (NSIS), available at http://www.nullsoft.com/free/nsis/
+
+To build the installable .exe:
+
+1. Unpack three archives:
+ PC sources
+ PC runtime
+ PC language files
+ You can generate these from the Unix sources and runtime plus the extra
+ archive (see the Makefile in the top directory).
+
+2. Go to the src directory and build:
+ gvim.exe (the OLE version),
+ vimrun.exe,
+ install.exe,
+ uninstal.exe,
+ xxd/xxd.exe,
+
+3. Go to the GvimExt directory and build gvimext.dll (or get it from a binary
+ archive).
+
+4. Go to the VisVim directory and build VisVim.dll (or get it from a binary
+ archive).
+
+5. Go to the OleVim directory and build OpenWithVim.exe and SendToVim.exe (or
+ get them from a binary archive).
+
+6. Get a "diff.exe" program and put it in the "../.." directory (above the
+ "vim61" directory, it's the same for all Vim versions).
+ You can find one in previous Vim versions or in this archive:
+ http://www.mossbayeng.com/~ron/vim/diffutils.tar.gz
+
+7. Do "make uganda.nsis.txt" in runtime/doc. This requires sed, you may have
+ to do this on Unix. Make sure the file is in DOS file format!
+
+Install NSIS if you didn't do that already.
+Also install UPX, if you want a compressed file.
+
+To build then, enter:
+
+ makensis gvim.nsi
diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
new file mode 100644
index 000000000..e184239b2
--- /dev/null
+++ b/nsis/gvim.nsi
@@ -0,0 +1,442 @@
+# NSIS file to create a self-installing exe for Vim.
+# It requires NSIS version 2.0 or later.
+# Last change: 2004 May 02
+
+# WARNING: if you make changes to this script, look out for $0 to be valid,
+# because uninstall deletes most files in $0.
+
+# Location of gvim_ole.exe, vimd32.exe, GvimExt/*, etc.
+!define VIMSRC "..\src"
+
+# Location of runtime files
+!define VIMRT ".."
+
+# Location of extra tools: diff.exe
+!define VIMTOOLS ..\..
+
+# Comment the next line if you don't have UPX.
+# Get it at http://upx.sourceforge.net
+!define HAVE_UPX
+
+# comment the next line if you do not want to add Native Language Support
+!define HAVE_NLS
+
+!define VER_MAJOR 7
+!define VER_MINOR 0aa
+
+# ----------- No configurable settings below this line -----------
+
+!include UpgradeDLL.nsh # for VisVim.dll
+
+Name "Vim ${VER_MAJOR}.${VER_MINOR}"
+OutFile gvim${VER_MAJOR}${VER_MINOR}.exe
+CRCCheck force
+SetCompressor lzma
+SetDatablockOptimize on
+
+ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer."
+DirText "Choose a directory to install Vim (must end in 'vim')"
+Icon icons\vim_16c.ico
+# NSIS2 uses a different strategy with six diferent images in a strip...
+#EnabledBitmap icons\enabled.bmp
+#DisabledBitmap icons\disabled.bmp
+UninstallText "This will uninstall Vim ${VER_MAJOR}.${VER_MINOR} from your system."
+UninstallIcon icons\vim_uninst_16c.ico
+
+# On NSIS 2 using the BGGradient causes trouble on Windows 98, in combination
+# with the BringToFront.
+# BGGradient 004000 008200 FFFFFF
+LicenseText "You should read the following before installing:"
+LicenseData ${VIMRT}\doc\uganda.nsis.txt
+
+!ifdef HAVE_UPX
+ !packhdr temp.dat "upx --best --compress-icons=1 temp.dat"
+!endif
+
+# This adds '\vim' to the user choice automagically. The actual value is
+# obtained below with ReadINIStr.
+InstallDir "$PROGRAMFILES\Vim"
+
+# Types of installs we can perform:
+InstType Typical
+InstType Minimal
+InstType Full
+
+SilentInstall normal
+
+# These are the pages we use
+Page license
+Page components
+Page directory "" "" CheckInstallDir
+Page instfiles
+UninstPage uninstConfirm
+UninstPage instfiles
+
+##########################################################
+# Functions
+
+Function .onInit
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer.$\n Continue?" \
+ IDYES NoAbort
+ Abort ; causes installer to quit.
+ NoAbort:
+
+ # run the install program to check for already installed versions
+ SetOutPath $TEMP
+ File /oname=install.exe ${VIMSRC}\installw32.exe
+ ExecWait "$TEMP\install.exe -uninstall-check"
+ Delete $TEMP\install.exe
+
+ # We may have been put to the background when uninstall did something.
+ BringToFront
+
+ # Install will have created a file for us that contains the directory where
+ # we should install. This is $VIM if it's set. This appears to be the only
+ # way to get the value of $VIM here!?
+ ReadINIStr $INSTDIR $TEMP\vimini.ini vimini dir
+ Delete $TEMP\vimini.ini
+
+ # If ReadINIStr failed or did not find a path: use the default dir.
+ StrCmp $INSTDIR "" 0 IniOK
+ StrCpy $INSTDIR "$PROGRAMFILES\Vim"
+ IniOK:
+
+ # Should check for the value of $VIM and use it. Unfortunately I don't know
+ # how to obtain the value of $VIM
+ # IfFileExists "$VIM" 0 No_Vim
+ # StrCpy $INSTDIR "$VIM"
+ # No_Vim:
+
+ # User variables:
+ # $0 - holds the directory the executables are installed to
+ # $1 - holds the parameters to be passed to install.exe. Starts with OLE
+ # registration (since a non-OLE gvim will not complain, and we want to
+ # always register an OLE gvim).
+ # $2 - holds the names to create batch files for
+ StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
+ StrCpy $1 "-register-OLE"
+ StrCpy $2 "gvim evim gview gvimdiff"
+
+FunctionEnd
+
+Function .onUserAbort
+ MessageBox MB_YESNO|MB_ICONQUESTION "Abort install?" IDYES NoCancelAbort
+ Abort ; causes installer to not quit.
+ NoCancelAbort:
+FunctionEnd
+
+# We only accept the directory if it ends in "vim". Using .onVerifyInstDir has
+# the disadvantage that the browse dialog is difficult to use.
+Function CheckInstallDir
+ StrCpy $0 $INSTDIR 3 -3
+ StrCmp $0 "vim" PathGood
+ MessageBox MB_OK "The path must end in 'vim'."
+ Abort
+ PathGood:
+FunctionEnd
+
+Function .onInstSuccess
+ WriteUninstaller vim${VER_MAJOR}${VER_MINOR}\uninstall-gui.exe
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "The installation process has been successfull. Happy Vimming! \
+ $\n$\n Do you want to see the README file now?" IDNO NoReadme
+ Exec '$0\gvim.exe -R "$0\README.txt"'
+ NoReadme:
+FunctionEnd
+
+Function .onInstFailed
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Installation failed. Better luck next time."
+FunctionEnd
+
+Function un.onUnInstSuccess
+ MessageBox MB_OK|MB_ICONINFORMATION \
+ "Vim ${VER_MAJOR}.${VER_MINOR} has been (partly) removed from your system"
+FunctionEnd
+
+Function un.GetParent
+ Exch $0 ; old $0 is on top of stack
+ Push $1
+ Push $2
+ StrCpy $1 -1
+ loop:
+ StrCpy $2 $0 1 $1
+ StrCmp $2 "" exit
+ StrCmp $2 "\" exit
+ IntOp $1 $1 - 1
+ Goto loop
+ exit:
+ StrCpy $0 $0 $1
+ Pop $2
+ Pop $1
+ Exch $0 ; put $0 on top of stack, restore $0 to original value
+FunctionEnd
+
+##########################################################
+Section "Vim executables and runtime files"
+ SectionIn 1 2 3
+
+ # we need also this here if the user changes the instdir
+ StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
+
+ SetOutPath $0
+ File /oname=gvim.exe ${VIMSRC}\gvim_ole.exe
+ File /oname=install.exe ${VIMSRC}\installw32.exe
+ File /oname=uninstal.exe ${VIMSRC}\uninstalw32.exe
+ File ${VIMSRC}\vimrun.exe
+ File /oname=xxd.exe ${VIMSRC}\xxdw32.exe
+ File ${VIMTOOLS}\diff.exe
+ File ${VIMRT}\vimtutor.bat
+ File ${VIMRT}\README.txt
+ File ..\uninstal.txt
+ File ${VIMRT}\*.vim
+ File ${VIMRT}\rgb.txt
+
+ SetOutPath $0\colors
+ File ${VIMRT}\colors\*.*
+
+ SetOutPath $0\compiler
+ File ${VIMRT}\compiler\*.*
+
+ SetOutPath $0\doc
+ File ${VIMRT}\doc\*.txt
+ File ${VIMRT}\doc\tags
+
+ SetOutPath $0\ftplugin
+ File ${VIMRT}\ftplugin\*.*
+
+ SetOutPath $0\indent
+ File ${VIMRT}\indent\*.*
+
+ SetOutPath $0\macros
+ File ${VIMRT}\macros\*.*
+
+ SetOutPath $0\plugin
+ File ${VIMRT}\plugin\*.*
+
+ SetOutPath $0\syntax
+ File ${VIMRT}\syntax\*.*
+
+ SetOutPath $0\tools
+ File ${VIMRT}\tools\*.*
+
+ SetOutPath $0\tutor
+ File ${VIMRT}\tutor\*.*
+SectionEnd
+
+##########################################################
+Section "Vim console program (vim.exe)"
+ SectionIn 1 3
+
+ SetOutPath $0
+ ReadRegStr $R0 HKLM \
+ "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
+ IfErrors 0 lbl_winnt
+ # Windows 95/98/ME
+ File /oname=vim.exe ${VIMSRC}\vimd32.exe
+ Goto lbl_done
+ lbl_winnt:
+ # Windows NT/2000/XT
+ File /oname=vim.exe ${VIMSRC}\vimw32.exe
+ lbl_done:
+ StrCpy $2 "$2 vim view vimdiff"
+SectionEnd
+
+##########################################################
+Section "Create .bat files for command line use"
+ SectionIn 3
+
+ StrCpy $1 "$1 -create-batfiles $2"
+SectionEnd
+
+##########################################################
+Section "Create icons on the Desktop"
+ SectionIn 1 3
+
+ StrCpy $1 "$1 -install-icons"
+SectionEnd
+
+##########################################################
+Section "Add Vim to the Start Menu"
+ SectionIn 1 3
+
+ StrCpy $1 "$1 -add-start-menu"
+SectionEnd
+
+##########################################################
+Section "Add an Edit-with-Vim context menu entry"
+ SectionIn 1 3
+
+ # Be aware of this sequence of events:
+ # - user uninstalls Vim, gvimext.dll can't be removed (it's in use) and
+ # is scheduled to be removed at next reboot.
+ # - user installs Vim in same directory, gvimext.dll still exists.
+ # If we now skip installing gvimext.dll, it will disappear at the next
+ # reboot. Thus when copying gvimext.dll fails always schedule it to be
+ # installed at the next reboot. Can't use UpgradeDLL!
+ # We don't ask the user to reboot, the old dll will keep on working.
+ SetOutPath $0
+ ClearErrors
+ SetOverwrite try
+ File /oname=gvimext.dll ${VIMSRC}\GvimExt\gvimext.dll
+ IfErrors 0 GvimExtDone
+
+ # Can't copy gvimext.dll, create it under another name and rename it on
+ # next reboot.
+ GetTempFileName $3 $0
+ File /oname=$3 ${VIMSRC}\GvimExt\gvimext.dll
+ Rename /REBOOTOK $3 $0\gvimext.dll
+
+ GvimExtDone:
+ SetOverwrite lastused
+
+ # We don't have a separate entry for the "Open With..." menu, assume
+ # the user wants either both or none.
+ StrCpy $1 "$1 -install-popup -install-openwith"
+SectionEnd
+
+##########################################################
+Section "Create a _vimrc if it doesn't exist"
+ SectionIn 1 3
+
+ StrCpy $1 "$1 -create-vimrc"
+SectionEnd
+
+##########################################################
+Section "Create plugin directories in HOME or VIM"
+ SectionIn 1 3
+
+ StrCpy $1 "$1 -create-directories home"
+SectionEnd
+
+##########################################################
+Section "Create plugin directories in VIM"
+ SectionIn 3
+
+ StrCpy $1 "$1 -create-directories vim"
+SectionEnd
+
+##########################################################
+Section "VisVim Extension for MS Visual Studio"
+ SectionIn 3
+
+ SetOutPath $0
+ !insertmacro UpgradeDLL "${VIMSRC}\VisVim\VisVim.dll" "$0\VisVim.dll" "$0"
+ File ${VIMSRC}\VisVim\README_VisVim.txt
+SectionEnd
+
+##########################################################
+!ifdef HAVE_NLS
+ Section "Native Language Support"
+ SectionIn 1 3
+
+ SetOutPath $0\lang
+ File /r ${VIMRT}\lang\*.*
+ SetOutPath $0\keymap
+ File ${VIMRT}\keymap\README.txt
+ File ${VIMRT}\keymap\*.vim
+ SetOutPath $0
+ File ${VIMRT}\libintl.dll
+ SectionEnd
+!endif
+
+##########################################################
+Section -call_install_exe
+ SetOutPath $0
+ ExecWait "$0\install.exe $1"
+SectionEnd
+
+##########################################################
+Section -post
+ BringToFront
+SectionEnd
+
+##########################################################
+Section Uninstall
+ # Apparently $INSTDIR is set to the directory where the uninstaller is
+ # created. Thus the "vim61" directory is included in it.
+ StrCpy $0 "$INSTDIR"
+
+ # If VisVim was installed, unregister the DLL.
+ IfFileExists "$0\VisVim.dll" Has_VisVim No_VisVim
+ Has_VisVim:
+ ExecWait "regsvr32.exe /u /s $0\VisVim.dll"
+
+ No_VisVim:
+
+ # delete the context menu entry and batch files
+ ExecWait "$0\uninstal.exe -nsis"
+
+ # We may have been put to the background when uninstall did something.
+ BringToFront
+
+ # ask the user if the Vim version dir must be removed
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "Would you like to delete $0?$\n \
+ $\nIt contains the Vim executables and runtime files." IDNO NoRemoveExes
+
+ Delete /REBOOTOK $0\*.dll
+ ClearErrors
+ # Remove everything but *.dll files. Avoids that
+ # a lot remains when gvimext.dll cannot be deleted.
+ RMDir /r $0\colors
+ RMDir /r $0\compiler
+ RMDir /r $0\doc
+ RMDir /r $0\ftplugin
+ RMDir /r $0\indent
+ RMDir /r $0\macros
+ RMDir /r $0\plugin
+ RMDir /r $0\syntax
+ RMDir /r $0\tools
+ RMDir /r $0\tutor
+ RMDir /r $0\VisVim
+ RMDir /r $0\lang
+ RMDir /r $0\keymap
+ Delete $0\*.exe
+ Delete $0\*.bat
+ Delete $0\*.vim
+ Delete $0\*.txt
+
+ IfErrors ErrorMess NoErrorMess
+ ErrorMess:
+ MessageBox MB_OK|MB_ICONEXCLAMATION \
+ "Some files in $0 have not been deleted!$\nYou must do it manually."
+ NoErrorMess:
+
+ # No error message if the "vim62" directory can't be removed, the
+ # gvimext.dll may still be there.
+ RMDir $0
+
+ NoRemoveExes:
+ # get the parent dir of the installation
+ Push $INSTDIR
+ Call un.GetParent
+ Pop $0
+ StrCpy $1 $0
+
+ # if a plugin dir was created at installation ask the user to remove it
+ # first look in the root of the installation then in HOME
+ IfFileExists $1\vimfiles AskRemove 0
+ ReadEnvStr $1 "HOME"
+ StrCmp $1 "" NoRemove 0
+
+ IfFileExists $1\vimfiles 0 NoRemove
+
+ AskRemove:
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "Remove all files in your $1\vimfiles directory? \
+ $\nIf you have created something there that you want to keep, click No" IDNO Fin
+ RMDir /r $1\vimfiles
+ NoRemove:
+
+ # ask the user if the Vim root dir must be removed
+ MessageBox MB_YESNO|MB_ICONQUESTION \
+ "Would you like to remove $0?$\n \
+ $\nIt contains your Vim configuration files!" IDNO NoDelete
+ RMDir /r $0 ; skipped if no
+ NoDelete:
+
+ Fin:
+ Call un.onUnInstSuccess
+
+SectionEnd
diff --git a/pixmaps/alert.xpm b/pixmaps/alert.xpm
new file mode 100644
index 000000000..d5cfae0d0
--- /dev/null
+++ b/pixmaps/alert.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char * alert_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"34 34 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor6 m white c #FFFF00",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ... ",
+" .XXX. ",
+" .XXXXX.o ",
+" .XXXXX.oo ",
+" .XXXXXXX.oo ",
+" .XXXXXXX.oo ",
+" .XXXXXXXXX.oo ",
+" .XXXXXXXXX.oo ",
+" .XXXXXXXXXXX.oo ",
+" .XXXX...XXXX.oo ",
+" .XXXX.....XXXX.oo ",
+" .XXXX.....XXXX.oo ",
+" .XXXXX.....XXXXX.oo ",
+" .XXXXX.....XXXXX.oo ",
+" .XXXXXX.....XXXXXX.oo ",
+" .XXXXXX.....XXXXXX.oo ",
+" .XXXXXXXX...XXXXXXXX.oo ",
+" .XXXXXXXX...XXXXXXXX.oo ",
+" .XXXXXXXXX...XXXXXXXXX.oo ",
+" .XXXXXXXXXX.XXXXXXXXXX.oo ",
+" .XXXXXXXXXXX.XXXXXXXXXXX.oo ",
+" .XXXXXXXXXXXXXXXXXXXXXXX.oo ",
+" .XXXXXXXXXXXX..XXXXXXXXXXX.oo ",
+" .XXXXXXXXXXX....XXXXXXXXXX.oo ",
+" .XXXXXXXXXXXX....XXXXXXXXXXX.oo ",
+" .XXXXXXXXXXXXX..XXXXXXXXXXXX.oo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXX.ooo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXX.ooo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXX.oooo ",
+" .........................ooooo ",
+" ooooooooooooooooooooooooooo ",
+" ooooooooooooooooooooooooo ",
+" "};
diff --git a/pixmaps/error.xpm b/pixmaps/error.xpm
new file mode 100644
index 000000000..b466f6548
--- /dev/null
+++ b/pixmaps/error.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char * error_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"34 34 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor3 m black c #FF0000",
+"X s bottomShadowColor m black c #5D6069",
+"o s iconColor2 m white c #FFFFFF",
+/* pixels */
+" ",
+" ........ ",
+" ............ ",
+" ................ ",
+" .................. ",
+" ....................X ",
+" ......................X ",
+" ........................X ",
+" .......o..........o.......X ",
+" ......ooo........ooo......X ",
+" ......ooooo......ooooo......X ",
+" .......ooooo....ooooo.......X ",
+" .........ooooo..ooooo.........X ",
+" ..........oooooooooo..........X ",
+" ...........oooooooo...........XX ",
+" ............oooooo............XX ",
+" ............oooooo............XX ",
+" ...........oooooooo...........XX ",
+" ..........oooooooooo..........XX ",
+" .........ooooo..ooooo.........XX ",
+" .......ooooo....ooooo.......XX ",
+" ......ooooo......ooooo......XX ",
+" ......ooo........ooo......XXX ",
+" .......o..........o.......XX ",
+" ........................XXX ",
+" ......................XXX ",
+" X....................XXX ",
+" X..................XXX ",
+" X................XXX ",
+" XX............XXXX ",
+" XX........XXXXX ",
+" XXXXXXXXXXX ",
+" XXXXXXX ",
+" "};
diff --git a/pixmaps/gen-inline-pixbufs.sh b/pixmaps/gen-inline-pixbufs.sh
new file mode 100644
index 000000000..8e11a233c
--- /dev/null
+++ b/pixmaps/gen-inline-pixbufs.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+prefix=stock_
+list=
+
+for file in "$@"
+do
+ name=`echo "$file" | sed 's|-|_|g; s|^.*/||; s|\..*$||'`
+ list="$list $prefix$name $file"
+done
+
+gdk-pixbuf-csource --raw --static --build-list $list
+
diff --git a/pixmaps/generic.xpm b/pixmaps/generic.xpm
new file mode 100644
index 000000000..190617353
--- /dev/null
+++ b/pixmaps/generic.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char * generic_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"34 34 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s bottomShadowColor m black c #5D6069",
+"X s iconColor2 m white c #FFFFFF",
+"o s iconColor1 m black c #000000",
+/* pixels */
+" ",
+" ........ ",
+" ...XXXXXXXX... ",
+" ..XXXXXXXXXXXXXX.. ",
+" .XXXXXXXXXXXXXXXXXX. ",
+" .XXXXXXXXXXXXXXXXXXXXo ",
+" .XXXXXXXXXXXXXXXXXXXXXXo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo... ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo... ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXo... ",
+" oXXXXXXXXXXXXXXXXXXXXXXo.... ",
+" oXXXXXXXXXXXXXXXXXXXXo.... ",
+" oXXXXXXXXXXXXXXXXXXo.... ",
+" ooXXXXXXXXXXXXXXoo.... ",
+" .oooXXXXXXXXooo..... ",
+" ...oooXXXXo....... ",
+" ....oXXXo..... ",
+" .oXXXo.. ",
+" oXXo.. ",
+" oXo.. ",
+" oo.. ",
+" ... ",
+" .. ",
+" "};
diff --git a/pixmaps/info.xpm b/pixmaps/info.xpm
new file mode 100644
index 000000000..bbac75bc0
--- /dev/null
+++ b/pixmaps/info.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char * info_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"34 34 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s bottomShadowColor m black c #5D6069",
+"X s iconColor2 m white c #FFFFFF",
+"o s iconColor1 m black c #000000",
+/* pixels */
+" ",
+" ........ ",
+" ...XXXXXXXX... ",
+" ..XXXXXXXXXXXXXX.. ",
+" .XXXXXXXXXXXXXXXXXX. ",
+" .XXXXXXXXooooXXXXXXXXo ",
+" .XXXXXXXXooooooXXXXXXXXo ",
+" .XXXXXXXXXooooooXXXXXXXXXo ",
+" .XXXXXXXXXXXooooXXXXXXXXXXXo ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" .XXXXXXXXXXoooooooXXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXoooooXXXXXXXXXXo... ",
+" .XXXXXXXXXXXoooooXXXXXXXXXXo... ",
+" .XXXXXXXXXXoooooXXXXXXXXXo... ",
+" oXXXXXXXoooooooooXXXXXXo.... ",
+" oXXXXXXXXXXXXXXXXXXXXo.... ",
+" oXXXXXXXXXXXXXXXXXXo.... ",
+" ooXXXXXXXXXXXXXXoo.... ",
+" .oooXXXXXXXXooo..... ",
+" ...oooXXXXo....... ",
+" ....oXXXo..... ",
+" .oXXXo.. ",
+" oXXo.. ",
+" oXo.. ",
+" oo.. ",
+" ... ",
+" .. ",
+" "};
diff --git a/pixmaps/quest.xpm b/pixmaps/quest.xpm
new file mode 100644
index 000000000..3564f4e8b
--- /dev/null
+++ b/pixmaps/quest.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char * quest_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"34 34 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s bottomShadowColor m black c #5D6069",
+"X s iconColor2 m white c #FFFFFF",
+"o s iconColor1 m black c #000000",
+/* pixels */
+" ",
+" ........ ",
+" ...XXXXXXXX... ",
+" ..XXXXXXXXXXXXXX.. ",
+" .XXXXXXXXXXXXXXXXXX. ",
+" .XXXXXXXXoooooXXXXXXXo ",
+" .XXXXXXXXoXXXXooXXXXXXXo ",
+" .XXXXXXXXoooXXXXooXXXXXXXo ",
+" .XXXXXXXXXooooXXXooXXXXXXXXo ",
+" .XXXXXXXXXXooXXXoooXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXXooooXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXXooooXXXXXXXXXXo. ",
+" .XXXXXXXXXXXXXoooooXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooooXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoooXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXooXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXXoXXXXXXXXXXXXXXXo.. ",
+" .XXXXXXXXXXXoXXXXXXXXXXXXXXo... ",
+" .XXXXXXXXXXXXXXXXXXXXXXXXXXo... ",
+" .XXXXXXXXXXooXXXXXXXXXXXXo... ",
+" oXXXXXXXXooooXXXXXXXXXXo.... ",
+" oXXXXXXXXooXXXXXXXXXXo.... ",
+" oXXXXXXXXXXXXXXXXXXo.... ",
+" ooXXXXXXXXXXXXXXoo.... ",
+" .oooXXXXXXXXooo..... ",
+" ...oooXXXXo....... ",
+" ....oXXXo..... ",
+" .oXXXo.. ",
+" oXXo.. ",
+" oXo.. ",
+" oo.. ",
+" ... ",
+" .. ",
+" "};
diff --git a/pixmaps/stock_icons.h b/pixmaps/stock_icons.h
new file mode 100644
index 000000000..3fc287bb5
--- /dev/null
+++ b/pixmaps/stock_icons.h
@@ -0,0 +1,1700 @@
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_build_tags[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\370\0\0\0\366\0\0\0\363"
+ "\0\0\0\361\0\0\0\357\0\0\0\355\0\0\0\353\0\0\0\351\0\0\0\347\0\0\0\345"
+ "\0\0\0\374\0\0\0\374\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\261\261\261\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\272\272"
+ "\272\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\344\344\344\377\0\0\0\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\250\250\250\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\255\255\255\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\271"
+ "\271\271\377\0\0\0\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\253\253\253\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\253\253\253\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270"
+ "\377\0\0\0\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\265"
+ "\265\265\377\250\250\250\377\252\252\252\377\252\252\252\377\250\250"
+ "\250\377\205\205\205\377\250\250\250\377\253\253\253\377\253\253\253"
+ "\377\253\253\253\377\253\253\253\377\202\202\202\377\250\250\250\377"
+ "\253\253\253\377\253\253\253\377\253\253\253\377ppp\377\0\0\0\343\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\253\253\253"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\253\253\253\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\274\274\274\377\0\0\0\341\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\253\253\253\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\253\253\253\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\274\274\274\377\0\0\0\341\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\253\253\253\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\253\253\253\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\274\274\274\377\0\0\0\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\377\272\272\272\377\247\247\247\377\253\253\253\377"
+ "\253\253\253\377\253\253\253\377\205\205\205\377\253\253\253\377\253"
+ "\253\253\377\253\253\253\377\253\253\253\377\253\253\253\377\215\215"
+ "\215\377\255\255\255\377\253\253\253\377\253\253\253\377\253\253\253"
+ "\377sss\377\0\0\0\335\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\253\253\253\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\253\253\253\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\274\274\274\377"
+ "\0\0\0\335\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\253\253\253\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\253\253\253\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\373"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\253\253"
+ "\253\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\253\253\253\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\274\274\274\377\0\0\0\373\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\270\270\270\377\250\250\250"
+ "\377\253\253\253\377\253\253\253\377\254\254\254\377\207\207\207\377"
+ "\250\250\250\377\247\247\247\377\253\253\253\377\253\253\253\377\250"
+ "\250\250\377\205\205\205\377\250\250\250\377\253\253\253\377\253\253"
+ "\253\377\253\253\253\377ttt\377\0\0\0\373\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\253\253\253\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\253\253"
+ "\253\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\373\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\250\250\250\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\251\251\251\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\274"
+ "\274\274\377\0\0\0\373\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\351\351\351\377\303\303\303\377\303\303\303\377\303\303\303\377"
+ "\277\277\277\377uuu\377\274\274\274\377\274\274\274\377\274\274\274\377"
+ "\274\274\274\377\274\274\274\377~~~\377\270\270\270\377\274\274\274\377"
+ "\274\274\274\377\273\273\273\377\243\243\243\377\0\0\0\373\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\376\0\0\0\373\0\0\0\373\0\0\0\373"
+ "\0\0\0\373\0\0\0\373\0\0\0\373\0\0\0\373\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\373\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_find_help[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0g\0\0\0\257\0\0\0\247\0\0\0K\0\0\0\0\205\203\177\25mli"
+ "pEDB\266\35\35\34\344\4\4\4\373\4\4\4\373\33\33\33\345=<:\270][Yucb`"
+ "\32\0\0\0\4\0\0\0\15\0\0\0S\0\0\0[\0\0\0\27\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0S\0\0\0\373\0\0\0\223\0\0\0\243\0\0\0\353MLK\227\4\4\4\373//-\377"
+ "\301\277\273\377\354\352\347\377\365\363\360\377\362\360\354\377\341"
+ "\337\334\377\257\255\252\377''&\377\2\2\2\373\77>>\227\0\0\0\335\0\0"
+ "\0\340\0\0\0\357\0\0\0\347\0\0\0\27\0\0\0\0\0\0\0\0\0\0\0\243\0\0\0\213"
+ "\0\0\0\0\207\205\201+60-\317\30\30\30\377\373\370\365\377\376\374\370"
+ "\377\372\370\365\377\365\364\361\377\362\361\355\377\362\360\354\377"
+ "\361\357\353\377\361\356\353\377\352\351\346\377\332\330\324\377\0\0"
+ "\0\377\20\16\16\346CC\77<\0\0\0\22\0\0\0\303\0\0\0\203\0\0\0\0\0\0\0"
+ "\0\0\0\0s\0\0\0\233\206\202~+\37\20\16\344\257:\36\377\373\253\223\377"
+ "\372\351\343\377\360\357\353\377\354\352\347\377\351\350\345\377\352"
+ "\350\346\377\354\352\350\377\355\353\351\377\355\353\351\377\355\353"
+ "\350\377\352\317\306\377\3254\12\377u\31\4\377\20\10\6\347;;7;\0\0\0"
+ "l\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0'\0\0\0\2274\26\15\314\257<\40\377\374"
+ "\314\276\377\367\277\256\377\346uT\377\337\335\333\377\333\331\326\377"
+ "\330\327\323\377\333\332\326\377\343\342\336\377\352\351\346\377\354"
+ "\353\350\377\355\353\350\377\345W-\377\343:\13\377\3244\12\377i\25\4"
+ "\377\20\5\4\324\0\0\0\225\0\0\0\301\0\0\0\1\0\0\0\0\0\0\0\0X,\"\214\17"
+ "\17\17\377\375\324\310\377\367\277\257\377\350uT\377\325Q+\377\306\202"
+ "p\377\276\275\272\377\245\243\240\377\234\232\225\377\271\267\262\377"
+ "\327\326\322\377\347\345\342\377\347\232\205\377\346F\30\377\344<\13"
+ "\377\342:\13\377\3110\11\377\0\0\0\377\1\0\0\352\0\0\0=\0\0\0\4\0\0\0"
+ "\0\216\177z\27\4\1\0\373\372\261\234\377\372\314\276\377GG\77\377\12"
+ "\12\11\377\12\12\11\377KKC\377\0\0\0\377\0\0\0\377\4\4\4\377\0\0\0\377"
+ "\24\24\22\377\205yt\377\3327\13\377\354|[\377\351[2\377\344<\13\377\336"
+ "8\13\377\235#\6\377\0\0\0\374\4\2\2""1\0\0\0\13\0\0\0\2mljpbba\377\355"
+ "\342\337\37744.\377\235\235\215\377\317\317\271\377\304\304\257\377\215"
+ "\215\177\377**&\377\0\0\0b\0\0\0""8\0\0\0""1\0\0\0U\0\0\0\377b\24\4\377"
+ "\342R+\377\362\246\220\377\347N!\377\342;\13\377\311\221\201\377\2\2"
+ "\2\377\0\0\0\210\0\0\0\24\0\0\0\5ECB\267\345\344\342\377FF\77\377\234"
+ "\234\214\377\342\342\320\377\355\355\347\377\300\300\254\377\262\262"
+ "\237\377\202\202t\377LLD\377\0\0\0\35\0\0\0\25\0\0\0\24\"\40\40&\0\0"
+ "\0\377\236-\22\377\357\215q\377\360\233\203\377\352\335\327\377\333\332"
+ "\326\377''$\377\0\0\0\304\0\0\0\36\0\0\0\11\35\35\34\344\360\356\354"
+ "\377\11\11\10\377\325\325\277\377\373\373\372\377\303\303\256\377\265"
+ "\265\242\377\246\246\225\377\234\234\217\377\10\10\7\377\0\0\0\11\0\0"
+ "\0\4\226\225\224\13\0\0\0\11YYVB\77\15\2\377\360\271\251\377\366\365"
+ "\364\377\350\347\344\377\332\330\325\377XVR\377\0\0\0\351\0\0\0%\0\0"
+ "\0\15\4\4\4\373\365\363\360\377\11\11\11\377\312\312\265\377\335\335"
+ "\320\377\267\267\244\377\252\252\230\377\233\233\213\377\256\256\243"
+ "\377\12\12\11\377\0\0\0\2\0\0\0\0\350\347\345\24\0\0\0\2\31\30\30\12"
+ "\12\12\10\377\366\364\362\377\364\363\361\377\344\343\340\377\323\322"
+ "\316\377cb]\377\0\0\0\374\0\0\0+\0\0\0\20\4\4\4\373\362\360\354\377G"
+ "G@\377\222\222\203\377\272\272\247\377\255\255\233\377\237\237\216\377"
+ "\254\254\241\377\317\317\313\377LLE\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0""0/.\5\12\12\12\377\372\370\366\377\357\355\352\377\335\334\330\377"
+ "\306\304\302\377>>9\377\0\0\0\374\0\0\0-\0\0\0\21\33\33\31\345\341\337"
+ "\334\377\331\327\324\37744/\377\207\207y\377\240\240\220\377\256\256"
+ "\242\377\303\303\276\377\1\1\1\377\1\1\1\377\261\260\257\77\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\211\207\2064kjg\377\374\372\370\377\354\352\350\377\326"
+ "\324\322\377\274\272\267\377\0\0\0\377\0\0\0\352\0\0\0-\0\0\0\21<<:\271"
+ "\257\255\252\377\361\356\353\377\351\350\345\377KKC\377\12\12\11\377"
+ "\12\12\11\377AAA\377srq\377\1\1\1\377\1\1\1\377\244\243\241\315\337\336"
+ "\333\10\316\314\312*(((\377\316\233\217\377\372\372\367\377\346\346\342"
+ "\377\315\314\312\377\260\260\254\377\0\0\0\377\0\0\0\306\0\0\0+\0\0\0"
+ "\20][Yu''&\377\352\351\346\377\355\353\351\377\355\343\337\377\347\204"
+ "h\377\337]:\377c\31\11\377\237\237\235\377\1\1\1\377\1\1\1\377\1\1\1"
+ "\377\241\237\235a)))\377\272\177q\377\367\306\267\377\361\246\221\377"
+ "\334\322\314\377\310\306\303\377~|x\377\0\0\0\377\0\0\0\216\0\0\0%\0"
+ "\0\0\15a`^\33\2\2\2\373\332\330\324\377\350\255\234\377\351a9\377\353"
+ "tR\377\357\216r\377\352\200c\377\236.\23\377\77\30\21\377\0\0\0\377\1"
+ "\1\1\377\1\1\1\377\276\236\224\377\371\323\310\377\363\255\231\377\336"
+ "S+\377\3104\11\377\264\202t\377\0\0\0\377\0\0\0\375\0\0\0D\0\0\0\36\0"
+ "\0\0\11\0\0\0\4""854\236\0\0\0\377\3264\12\377\344=\17\377\350X.\377"
+ "\355yW\377\364\266\244\377\364\260\235\377\360\345\340\377\364\363\357"
+ "\377\1\1\1\377\1\1\1\377\1\1\1\377\354\225|\377\343O%\377\3237\12\377"
+ "\277/\11\377&\10\0\377\0\0\0\377\0\0\0\354\0\0\0-\0\0\0\24\0\0\0\5LK"
+ "J\3\0\0\0\220\31\17\13\332u\31\4\377\3255\12\377\342:\13\377\344=\14"
+ "\377\347L\37\377\357\273\253\377\365\364\363\377\357\355\352\377\365"
+ "\363\361\377\1\1\1\377\1\1\1\377\336C\26\377\3237\12\377\3042\14\377"
+ "Y\22\2\377\0\0\0\377\0\0\0\333\0\0\0\377\0\0\0;\0\0\0\13\0\0\0\2\0\0"
+ "\0\7\0\0\0\260JJG7\16\5\4\347i\25\4\377\3100\11\377\3368\13\377\340S"
+ "+\377\347\346\343\377\347\346\342\377\343\342\336\377\335\334\331\377"
+ "\327\326\323\377\317\316\312\377\274[>\377\256)\7\3774\26\15\377\0\0"
+ "\0\377\0\0\0\352\0\0\0b\0\0\0\374\0\0\0A\0\0\0\4\0\0\0\0\0\0\0\13\0\0"
+ "\0\217\0\0\0\12;;7;\17\7\5\325\0\0\0\377\233\"\5\377\301\250\237\377"
+ "\321\320\314\377\320\316\313\377\307\306\303\377\273\272\267\377\265"
+ "\264\261\377\247\246\242\377rd^\377\0\0\0\377\0\0\0\377\0\0\0\331\0\0"
+ "\0Y\0\0\0l\0\0\0\370\0\0\0\22\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0_\0\0\0\230"
+ "\0\0\0\242\0\0\0\253\13\11\10\230\0\0\0\374\1\1\0\377\"\"!\377QPK\377"
+ "]\\W\377;;7\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\375\0\0\0\323\0\0"
+ "\0E\0\0\0H\0\0\0\310\0\0\0\246\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\37\0\0\0-\0\0\0\12\0\0\0\21\2\2\2""1\0\0\0\215\0\0\0\305\0\0"
+ "\0\351\0\0\0\374\0\0\0\374\0\0\0\353\0\0\0\307\0\0\0\226\0\0\0K\0\0\0"
+ "\307\0\0\0\377\0\0\0\377\0\0\0\311\0\0\0%\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\4\0\0\0\13\0\0\0\24\0\0\0"
+ "\35\0\0\0%\0\0\0+\0\0\0-\0\0\0-\0\0\0+\0\0\0%\0\0\0\36\0\0\0\27\0\0\0"
+ "0\0\0\0\33\0\0\0\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\11\0\0\0\15\0\0"
+ "\0\20\0\0\0\21\0\0\0\21\0\0\0\20\0\0\0\15\0\0\0\11\0\0\0\5\0\0\0\2\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_save_all[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0U\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0Y\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\303\327\364\377\251\315\345\377uuz\377"
+ "\357\305\273\377\361\310\276\377\360\306\274\377\356\274\262\377\356"
+ "\276\265\377\356\301\270\377\355\277\266\377\351\267\255\377\351\270"
+ "\257\377\351\267\255\377\351\270\257\377\351\271\261\377\345\277\272"
+ "\377srw\377\263\315\343\377\241\276\326\377\0\0\0\377\0\0\0\0\0\0\0\4"
+ "\0\0\0\1\0\0\0\377\273\326\350\377\212\252\305\377`_h\377\340\215~\377"
+ "\340\202n\377\340\200n\377\334zh\377\334\201q\377\332xh\377\324\201s"
+ "\377\324}n\377\316re\377\317rd\377\316ug\377\304g[\377\303eX\377bai\377"
+ "\207\243\267\377Vq\207\377\0\0\0\377\0\0\0\0\0\0\0\15\0\0\0\4\0\0\0\377"
+ "\272\325\351\377\210\247\303\377EDJ\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0_\0\0\0\377\266\323\347\377\207\253\301\377"
+ "\0\0\0\377\303\327\364\377\251\315\345\377uuz\377\357\305\273\377\361"
+ "\310\276\377\360\306\274\377\356\274\262\377\356\276\265\377\356\301"
+ "\270\377\355\277\266\377\351\267\255\377\351\270\257\377\351\267\255"
+ "\377\351\270\257\377\351\271\261\377\345\277\272\377srw\377\263\315\343"
+ "\377\241\276\326\377\0\0\0\377\0\0\0\377\271\323\347\377\205\244\277"
+ "\377\0\0\0\377\273\326\350\377\212\252\305\377`_h\377\340\215~\377\340"
+ "\202n\377\340\200n\377\334zh\377\334\201q\377\332xh\377\324\201s\377"
+ "\324}n\377\316re\377\317rd\377\316ug\377\304g[\377\303eX\377bai\377\207"
+ "\243\267\377Vq\207\377\0\0\0\377\0\0\0\377\271\323\346\377\204\243\277"
+ "\377\0\0\0\377\272\325\351\377\210\247\303\377hfp\377\310\201{\377\313"
+ "|t\377\313zs\377\313{s\377\314|r\377\313}s\377\277kd\377\314zp\377\301"
+ "jb\377\314|s\377\302e[\377\303dY\377\272lj\377hfp\377\201\236\266\377"
+ "Tp\206\377\0\0\0\377\0\0\0\377\267\322\347\377\202\240\273\377\0\0\0"
+ "\377\266\323\347\377\207\253\301\377sss\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377sss\377\203\240\270\377R"
+ "l\200\377\0\0\0\377\0\0\0\377\265\312\345\377\177\242\271\377\0\0\0\377"
+ "\271\323\347\377\205\244\277\377sss\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377sss\377\203\240\270\377Oi|\377"
+ "\0\0\0\377\0\0\0\377\256\314\345\377}\240\266\377\0\0\0\377\271\323\346"
+ "\377\204\243\277\377sss\377\316\316\316\377\315\315\315\377\315\315\315"
+ "\377\315\315\315\377\315\315\315\377\315\315\315\377\315\315\315\377"
+ "\315\315\315\377\315\315\315\377\315\315\315\377\315\315\315\377\315"
+ "\315\315\377\277\277\277\377sss\377\210\244\273\377Hbv\377\0\0\0\377"
+ "\0\0\0\377\260\321\344\377\203\241\266\377\0\0\0\377\267\322\347\377"
+ "\202\240\273\377ccc\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377sss\377\210\244\273\377F^p\377\0\0\0\377\0\0"
+ "\0\377\252\316\343\377{\233\262\377\0\0\0\377\265\312\345\377\177\242"
+ "\271\377sss\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377sss\377\207\243\272\377E\\m\377\0\0\0\377\0\0\0\377\251"
+ "\311\342\377t\224\257\377\0\0\0\377\256\314\345\377}\240\266\377sss\377"
+ "\316\316\316\377\315\315\315\377\315\315\315\377\315\315\315\377\315"
+ "\315\315\377\315\315\315\377\315\315\315\377\315\315\315\377\315\315"
+ "\315\377\315\315\315\377\315\315\315\377\315\315\315\377\305\305\305"
+ "\377sss\377\207\243\272\377T`i\377\0\0\0\377\0\0\0\377\253\304\342\377"
+ "r\224\255\377\0\0\0\377\260\321\344\377\203\241\266\377s[[\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377sss\377"
+ "\203\240\270\377Q\\d\377\0\0\0\377\0\0\0\377\252\311\342\377p\221\252"
+ "\377\0\0\0\377\252\316\343\377{\233\262\377z\216\232\377zzz\377sss\377"
+ "sss\377sss\377sss\377sss\377kor\377ooo\377sss\377sss\377sss\377sss\377"
+ "iii\377ow~\377\206\242\271\377:Q]\377\0\0\0\377\0\0\0\377\252\311\341"
+ "\377l\216\246\377\0\0\0\377\251\311\342\377t\224\257\377\201\236\266"
+ "\377\203\240\270\377\206\242\271\377\202\237\267\377\177\235\266\377"
+ "~\234\265\377\202\237\267\377y\230\262\377\206\242\271\377\205\241\270"
+ "\377\205\241\270\377\207\243\272\377\202\237\267\377\214\247\275\377"
+ "\203\240\270\377\212\245\273\3776JY\377\0\0\0\377\0\0\0\377\250\310\341"
+ "\377k\215\246\377\0\0\0\377\253\304\342\377r\224\255\377o\220\254\377"
+ "q\222\256\377AJN\377BJQ\377R[c\377boy\377_lv\377\\iq\377Zfo\377Xck\377"
+ "Wcj\377R[c\377;S`\3779BK\377x\227\263\377\244\271\313\3776HS\377\0\0"
+ "\0\377\0\0\0\377\244\304\336\377i\213\243\377\0\0\0\377\252\311\342\377"
+ "p\221\252\377o\217\247\377JSY\377\227\223\214\377\337\335\332\377\343"
+ "\341\336\377\353\352\350\377\353\352\350\377\352\351\347\377\337\335"
+ "\332\377\317\316\311\377\311\306\300\377\233\226\216\377Vah\377Kez\377"
+ "Ts\214\377\252\306\335\3774FN\377\0\0\0\377\0\0\0\377w\211\231\377n\211"
+ "\236\377\0\0\0\377\252\311\341\377l\216\246\377l\214\244\377@GM\377\332"
+ "\330\323\377\347\346\342\377ge^\377ROG\377ROG\377\331\327\324\377\307"
+ "\305\277\377\300\274\265\377\270\263\253\377\317\316\311\377CLT\377M"
+ "i\177\377Oo\204\377\263\312\334\3771>I\377\0\0\0\377\0\0\0""5\14\15\17"
+ "\377N^j\377\0\0\0\377\250\310\341\377k\215\246\377r\217\244\377@GM\377"
+ "\342\341\335\377\360\357\354\377ge^\377ROG\377ROG\377\315\312\306\377"
+ "\302\277\271\377\300\274\265\377\312\306\300\377\334\332\327\377KU]\377"
+ "Ni\177\377Oo\204\377\272\314\334\3771>I\377\0\0\0\377\0\0\0\4\0\0\0""9"
+ "\0\0\0\377\0\0\0\377\244\304\336\377i\213\243\377p\212\241\3778>C\377"
+ "\340\336\332\377\353\352\350\377QNF\377OLD\377OLD\377\307\304\276\377"
+ "\300\274\265\377\313\310\302\377\341\340\334\377\351\350\346\377GQX\377"
+ "Nhy\377Ml\200\377\243\303\333\3778\77C\377\0\0\0\377\0\0\0\1\0\0\0\4"
+ "\0\0\0\16\0\0\0\377w\211\231\377n\211\236\377e\205\234\37738<\377\327"
+ "\324\320\377\326\324\320\377NJC\377MIB\377MIB\377\300\274\265\377\321"
+ "\316\311\377\346\345\342\377\355\354\352\377\346\345\342\377EOU\377H"
+ "as\377Mfx\377\241\301\332\3777<@\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0""5\14\15\17\377N^j\377[n|\377O[b\377\244\240\231\377\300\274"
+ "\265\377\270\263\253\377\314\311\303\377\314\311\303\377\327\325\321"
+ "\377\344\342\340\377\352\351\347\377\335\333\327\377\270\265\260\377"
+ ">GM\377Jav\377J`p\377\233\303\330\3776<A\377\0\0\0\377\0\0\0\0\0\0\0"
+ "\0\0\0\0\1\0\0\0\10\0\0\0\77\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377(2>\377\0\0\0\377\0"
+ "\0\0^"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_session_load[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\37\0\0\0\306"
+ "\0\0\0\342\0\0\0\356\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0.\0"
+ "\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\310\265\270"
+ "\245\377\344\347\322\377\344\347\322\377\344\347\322\377\344\347\322"
+ "\377\344\347\322\377\207\212v\37734+\377\22\22\22\6\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0./%O\13\13\13\345\342\345\317\377\317\324\257\377\317"
+ "\324\257\377\317\324\257\377\316\323\256\377\316\323\256\377\262\266"
+ "\226\377--%\377\5\5\4A\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\"#\34\241"
+ "\235\237\220\377\342\345\317\377\306\312\246\377\304\311\245\377\306"
+ "\313\247\377\307\314\250\377\311\316\251\377\311\316\251\377UXG\377\31"
+ "\32\25\242**\25\4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\40\40\32\356\324\326\302"
+ "\377\276\302\240\377\263\270\226\377\260\265\225\377\263\267\227\377"
+ "\266\273\231\377\273\300\236\377\274\301\237\377\201\205l\377>\77""2"
+ "\345\0\0\0\302\0\0\0\324\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0Q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0#$\35\373\332"
+ "\335\310\377\257\264\224\377\252\257\217\377\243\247\211\377\246\252"
+ "\213\377\252\257\217\377\251\255\216\377\247\253\215\377\244\250\212"
+ "\377\241\245\210\377\252\255\226\377\263\265\245\377\270\273\252\377"
+ "\272\274\253\377\301\303\262\377\307\312\267\377\312\315\273\377\272"
+ "\275\250\377\0\0\0\377\34\34\34\3\0\0\0\0\0\0\0\0\0\0\0\0\14\14\11\377"
+ "\335\337\313\377\226\233~\377\235\242\206\377\225\230|\377\226\231~\377"
+ "\232\235\201\377\231\235\200\377\226\231~\377\235\241\204\377\245\252"
+ "\213\377\244\251\212\377\243\250\211\377\242\245\210\377\243\247\211"
+ "\377\242\245\207\377\237\243\206\377\233\236\203\377\211\215t\377\0\0"
+ "\0\377//'\14\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\377\330\333\311\377\204\206"
+ "n\377}\201i\377\25\26\22\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\327\0\0\0\301\0\0\0W\0"
+ "\0\0\5\0\0\0\377\327\332\311\377y}g\377=\77""4\377\340\340\331\377\353"
+ "\355\335\377\350\353\331\377\350\353\331\377\350\353\331\377\350\353"
+ "\331\377\350\353\331\377\350\353\331\377\350\353\331\377\350\353\331"
+ "\377\350\353\331\377\350\353\331\377\350\353\331\377\347\352\330\377"
+ "\343\346\324\377\336\341\320\377\332\334\314\377\332\334\321\377+,(\377"
+ ",,#\23\0\0\0\377\327\332\306\377os^\377\15\15\15\377\364\364\354\377"
+ "\317\324\257\377\317\324\257\377\317\324\257\377\317\324\257\377\317"
+ "\324\257\377\317\324\257\377\317\324\257\377\317\324\257\377\317\324"
+ "\257\377\316\323\256\377\1\1\1\377\1\1\1\377\1\1\1\377\306\313\250\377"
+ "\302\306\244\377\273\300\236\377\253\260\221\377#%\36\37722'5\0\0\0\377"
+ "\327\332\306\377IK=\377\334\334\324\377\352\354\335\377\315\322\255\377"
+ "\316\323\256\377\316\323\256\377\315\322\255\377\316\323\256\377\315"
+ "\322\255\377\260\265\225\377\12\12\10\377\12\12\10\377\244\250\212\377"
+ "\5\5\4\377\272\271\266\377\5\5\4\377\233\236\203\377\11\11\10\377\11"
+ "\11\7\377oq]\377\10\10\6\27712(J\0\0\0\377\325\330\304\377\26\26\26\377"
+ "\362\362\352\377\312\317\253\377\312\317\252\377\312\317\253\377\312"
+ "\317\252\377\311\316\252\377\312\317\252\377\311\316\252\377\12\12\10"
+ "\377\207\210\203\377rrp\377\12\12\10\377HFA\377\237\235\226\377HFA\377"
+ "\11\11\7\377\210\207\201\377#$\36\377\4\4\3\377\15\15\12\24123)>\0\0"
+ "\0\377\266\270\247\377ttp\377\354\354\342\377\303\310\245\377\302\307"
+ "\244\377\302\307\244\377\302\306\244\377\300\305\242\377\302\306\244"
+ "\377\277\304\241\377\11\11\10\377\310\307\302\377\266\265\257\377\237"
+ "\235\226\377\237\235\226\377\237\235\226\377\220\216\206\377\227\225"
+ "\216\377\200}t\377HFA\377\0\0\0\376\34\34\26e33&'\0\0\0\377\246\251\230"
+ "\377\334\334\324\377\270\274\233\377\270\274\233\377\265\271\231\377"
+ "\263\267\227\377\263\267\227\377\260\265\225\377\260\265\225\377\257"
+ "\263\224\377\214\217v\377\10\11\7\377\237\235\226\377\237\235\226\377"
+ "YXT\377`^W\377\211\210\203\377\200}t\377vtk\377\3\3\3\376\5\5\4\3073"
+ "3'200&\24\0\0\0\377\236\237\221\377\345\346\332\377\255\261\222\377\251"
+ "\255\217\377\246\252\214\377\245\251\214\377\243\247\212\377\243\247"
+ "\212\377\241\245\210\377\1\1\1\377\1\1\1\377HFA\377\237\235\226\377`"
+ "^W\377CB\77\377('$\377640\377\237\235\226\377mkc\377HFA\377\1\1\1\357"
+ "\0\0\0\356,,!\10\0\0\0\377\343\345\331\377\300\303\257\377\224\230|\377"
+ "\217\223y\377\213\217u\377\212\216t\377\210\214s\377\210\214s\377\205"
+ "\211p\377\1\1\0\377\214\213\211\377\266\265\257\377\237\235\226\377Y"
+ "XT\377!\40\36\377\12\11\10\377\30\30\26\377\346\346\344\377\200}t\377"
+ "ec\\\377`^W\377\0\0\0\354\34\34\34\3""34)[\0\0\0\377\0\0\0\377\0\0\0"
+ "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377HFA\377\237\235\226\377\211\210\203\377640\377\26\26"
+ "\24\377\214\213\211\377\337\336\334\377ec\\\377HFA\377\0\0\0\354\0\0"
+ "\0\352\0\0\0\1""34(J34)T34)Y34(Z45)Z45)Z45)Z45)Z45)Z45)Z45)Z\36\37\30"
+ "{\1\1\0\367\260\257\251\377\200}t\377\266\265\257\377\346\346\344\377"
+ "\325\324\321\377\223\221\213\377ec\\\377\0\0\0\364\12\12\7A\34\34\34"
+ "\3\0\0\0\0""22(%24(834)B23(C34)D34)D34)D34)D34)D34)D34)D\0\0\0\365\266"
+ "\265\257\377\253\251\243\377\237\235\226\377\200}t\377\200}t\377vtk\377"
+ "vtk\377]\\U\377HFA\377\0\0\0\362\0\0\0\1\0\0\0\0""33\36\11""00&\24""1"
+ "1&\31""00$\31""33(\32""33(\32""33(\32""33(\32""33(\32""33(\32""33(\32"
+ "\0\0\0\363\1\1\1\313YXT\377\0\0\0\366HFA\377vtk\377HFA\377\0\0\0\363"
+ "IIC\377\0\0\0\307\0\0\0\362\0\0\0\0\0\0\0\0\0\0\0\1**\0\2\37\37\0\3\37"
+ "\37\0\3""88\34\3""88\34\3""88\34\3""88\34\3""88\34\3""88\34\3""88\34"
+ "\3\4\4\2&\0\0\0\362\0\0\0\362\2\2\1""5\0\0\0\343BA<\377\0\0\0\343\1\1"
+ "\0""5\0\0\0\362\0\0\0\362\0\0\0#\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\351\0\0\0\353\0\0\0\353\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_session_new[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0Y\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\202"
+ "\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\377\323\323\323\377\366\366\366\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\371\371\371\377\332\332"
+ "\332\377XXX\377\0\0\0\301\0\0\0\6\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\366\366\366\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\307\307\307\377\321\321\321\377\326\326\326\377\0\0\0\377\0"
+ "\0\0\10\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\376\376\376\377\377"
+ "\377\377\377\376\376\376\377\375\375\375\377\300\300\300\377\341\341"
+ "\341\377\360\360\360\377\233\233\233\377\0\0\0\377\0\0\0\11\0\0\0\1\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\376"
+ "\376\377\375\375\375\377\374\374\373\377\375\375\375\377\374\374\373"
+ "\377\373\373\373\377\257\257\256\377\351\351\351\377\377\377\377\377"
+ "\337\337\337\377\217\217\217\377\0\0\0\377\0\0\0\11\0\0\0\1\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\376\376\376\377\375\375\375\377\374\374\373\377\373\373"
+ "\373\377\372\372\371\377\373\373\373\377\372\372\371\377\371\371\370"
+ "\377\244\244\243\377\360\360\360\377\377\377\377\377\364\364\364\377"
+ "\317\317\317\377\242\242\242\377\0\0\0\264\0\0\0\10\0\0\0\1\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\376\376\376\377\375\375\375"
+ "\377\374\374\373\377\373\373\373\377\372\372\371\377\371\371\370\377"
+ "\370\370\367\377\371\371\370\377\370\370\367\377\370\367\366\377\236"
+ "\236\236\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
+ "\377\0\0\0\201\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377"
+ "\377\374\374\373\377\373\373\373\377\372\372\371\377\371\371\370\377"
+ "\370\370\367\377\370\367\366\377\367\366\365\377\370\367\366\377\367"
+ "\366\365\377\366\366\364\377\364\363\362\377\336\335\334\377\323\322"
+ "\320\377\267\267\265\377\237\236\235\377poo\377ebZ\377\0\0\0\377\0\0"
+ "\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\372\372\371\377"
+ "\371\371\370\377\370\370\367\377\370\367\366\377\367\366\365\377\366"
+ "\366\364\377\365\364\363\377\366\366\364\377\365\364\363\377\364\363"
+ "\362\377\362\362\360\377\344\344\342\377\332\331\327\377\330\330\326"
+ "\377\315\314\312\377\257\256\254\377\210\204{\377\0\0\0\377\0\0\0\35"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\370\370\367\377\370"
+ "\367\366\377\367\366\365\377\366\366\364\377\365\364\363\377\364\363"
+ "\362\377\363\363\361\377\364\363\362\377\363\363\361\377\362\362\360"
+ "\377\357\357\355\377\356\355\353\377\355\354\352\377\351\350\346\377"
+ "\325\324\323\377\304\303\302\377\217\212\201\377\0\0\0\377\0\0\0\40\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\366\365\364\377\1\1"
+ "\1\377\1\1\1\377\1\1\1\377\363\363\361\377\362\362\360\377\361\361\357"
+ "\377\362\362\360\377\361\361\357\377\361\360\356\377\356\355\353\377"
+ "\354\353\351\377\352\351\347\377\345\344\342\377\344\343\340\377\322"
+ "\321\316\377\215\210~\377\0\0\0\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0#\0"
+ "\0\0\377\15\15\15\377\303\302\301\377\6\6\6\377\335\334\332\377\6\6\6"
+ "\377\277\277\275\377\14\14\14\377\14\14\14\377\317\317\315\377\360\357"
+ "\355\377\357\356\354\377\354\353\351\377\350\347\345\377\345\344\341"
+ "\377\344\343\340\377\342\341\336\377\341\337\334\377\227\222\210\377"
+ "\0\0\0\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0\362\352\352\352\377\262\262"
+ "\260\377\14\14\14\377HFA\377\237\235\226\377HFA\377\14\14\14\377\210"
+ "\207\201\377665\377\14\14\14\377\360\357\355\377\357\356\354\377\354"
+ "\353\351\377\350\347\345\377\345\344\341\377\344\343\340\377\342\341"
+ "\336\377\341\337\334\377\244\236\223\377\0\0\0\377\0\0\0\40\0\0\0\0\0"
+ "\0\0\0\0\0\0\362\235\234\230\377\221\220\212\377\237\235\226\377\237"
+ "\235\226\377\237\235\226\377\220\216\206\377\227\225\216\377\200}t\377"
+ "HFA\377\14\14\13\377\355\354\352\377\354\353\351\377\350\347\344\377"
+ "\347\346\343\377\343\342\337\377\342\340\335\377\341\340\334\377\340"
+ "\337\333\377\241\234\220\377\0\0\0\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0"
+ "3\0\0\0\377\237\235\226\377\237\235\226\377YXT\377`^W\377\211\210\203"
+ "\377\200}t\377vtk\377\13\13\13\377\274\273\271\377\351\350\345\377\351"
+ "\350\345\377\345\344\341\377\346\344\341\377\343\342\336\377\337\336"
+ "\332\377\336\335\331\377\335\334\330\377\241\233\220\377\0\0\0\377\0"
+ "\0\0\40\0\0\0\0\0\0\0\375\0\0\0\375HFA\377\237\235\226\377`^W\377CB\77"
+ "\377('$\377640\377\237\235\226\377mkc\377HFA\377\31\31\31\377\22\22\21"
+ "\377\347\345\342\377\344\343\337\377\343\342\336\377\340\337\333\377"
+ "\336\335\331\377\335\334\330\377\334\333\327\377\241\233\220\377\0\0"
+ "\0\377\0\0\0\40\0\0\0\0\0\0\0\375\356\356\355\377\266\265\257\377\237"
+ "\235\226\377YXT\377!\40\36\377\12\11\10\377\30\30\26\377\346\346\344"
+ "\377\200}t\377ec\\\377`^W\377\21\21\21\377\344\343\337\377\342\341\335"
+ "\377\340\337\333\377\336\335\331\377\334\333\327\377\333\331\325\377"
+ "\331\327\323\377\237\231\215\377\0\0\0\377\0\0\0\40\0\0\0\0\0\0\0\375"
+ "\0\0\0\370HFA\377\237\235\226\377\211\210\203\377640\377\26\26\24\377"
+ "\214\213\211\377\337\336\334\377ec\\\377HFA\377\23\23\23\377\23\23\23"
+ "\377\341\340\334\377\341\340\334\377\336\335\331\377\335\333\327\377"
+ "\334\332\326\377\331\327\323\377\330\326\322\377\236\230\215\377\0\0"
+ "\0\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0""3\0\0\0\377\260\257\251\377\200"
+ "}t\377\266\265\257\377\346\346\344\377\325\324\321\377\223\221\213\377"
+ "ec\\\377\13\13\13\377\263\262\257\377\341\340\334\377\337\336\332\377"
+ "\340\336\332\377\335\333\327\377\334\332\326\377\331\327\323\377\330"
+ "\326\321\377\327\325\321\377\235\227\213\377\0\0\0\377\0\0\0\40\0\0\0"
+ "\0\0\0\0\0\0\0\0\362\266\265\257\377\253\251\243\377\237\235\226\377"
+ "\200}t\377\200}t\377vtk\377vtk\377]\\U\377HFA\377\13\13\13\377\340\336"
+ "\332\377\336\334\330\377\336\334\330\377\334\332\326\377\334\332\326"
+ "\377\330\326\322\377\327\326\321\377\325\323\316\377\233\225\212\377"
+ "\0\0\0\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0\362\0\0\0\377YXT\377\6\6\5"
+ "\377HFA\377vtk\377HFA\377\10\10\7\377IIC\377$#\40\377\10\7\7\377\242"
+ "\234\220\377\241\233\217\377\241\233\220\377\237\231\215\377\237\231"
+ "\215\377\235\227\214\377\235\227\214\377\233\226\212\377gcY\377\0\0\0"
+ "\377\0\0\0\40\0\0\0\0\0\0\0\0\0\0\0#\0\0\0\367\0\0\0\377\0\0\0\377\0"
+ "\0\0\377BA<\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0q\0\0\0\30\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0"
+ "\0\0\17\0\0\0\35\0\0\0\354\0\0\0\356\0\0\0\356\0\0\0\40\0\0\0\40\0\0"
+ "\0\40\0\0\0\40\0\0\0\40\0\0\0\40\0\0\0\40\0\0\0\40\0\0\0\40\0\0\0\40"
+ "\0\0\0\40\0\0\0\40\0\0\0\40\0\0\0\30\0\0\0\10\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_session_save[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\375"
+ "\0\0\0\375\0\0\0\375\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0#\0\0\0\362\0\0\0\362\0\0\0""3\0\0\0\370\272"
+ "\271\266\377\0\0\0\370\0\0\0""3\0\0\0\362\0\0\0\362\0\0\0#\0\0\0\0\0"
+ "\0\0\0\0\0\0U\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
+ "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377mmm\377rrp\377"
+ "\0\0\0\377HFA\377\237\235\226\377HFA\377\0\0\0\377\210\207\201\377\0"
+ "\0\0\331\0\0\0\362\0\0\0\1\0\0\0\0\0\0\0\377\303\327\364\377\251\315"
+ "\345\377uuz\377\357\305\273\377\361\310\276\377\360\306\274\377\356\274"
+ "\262\377\356\276\265\377\356\301\270\377\355\277\266\377\13\11\10\377"
+ "\310\307\302\377\266\265\257\377\237\235\226\377\237\235\226\377\237"
+ "\235\226\377\220\216\206\377\227\225\216\377\200}t\377HFA\377\0\0\0\363"
+ "\0\0\0\4\0\0\0\0\0\0\0\377\273\326\350\377\212\252\305\377`_h\377\340"
+ "\215~\377\340\202n\377\340\200n\377\334zh\377\334\201q\377\332xh\377"
+ "\324\201s\377\251dX\377\12\5\5\377\237\235\226\377\237\235\226\377YX"
+ "T\377`^W\377\211\210\203\377\200}t\377vtk\377\0\0\0\377\0\0\0F\0\0\0"
+ "\11\0\0\0\0\0\0\0\377\272\325\351\377\210\247\303\377hfp\377\310\201"
+ "{\377\313|t\377\313zs\377\313{s\377\314|r\377\313}s\377\1\0\0\377\1\0"
+ "\0\377HFA\377\237\235\226\377`^W\377CB\77\377('$\377640\377\237\235\226"
+ "\377mkc\377HFA\377\0\0\0\346\0\0\0\354\0\0\0\0\0\0\0\377\266\323\347"
+ "\377\207\253\301\377sss\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\2\2\2\377\214\213"
+ "\211\377\266\265\257\377\237\235\226\377YXT\377!\40\36\377\12\11\10\377"
+ "\30\30\26\377\346\346\344\377\200}t\377ec\\\377`^W\377\0\0\0\354\0\0"
+ "\0\0\0\0\0\377\271\323\347\377\205\244\277\377sss\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\2\2\2\377\7\7\7\377HFA\377\237\235\226\377\211\210\203\377"
+ "640\377\26\26\24\377\214\213\211\377\337\336\334\377ec\\\377HFA\377\0"
+ "\0\0\354\0\0\0\352\0\0\0\0\0\0\0\377\271\323\346\377\204\243\277\377"
+ "sss\377\316\316\316\377\315\315\315\377\315\315\315\377\315\315\315\377"
+ "\315\315\315\377\315\315\315\377\315\315\315\377\244\244\244\377\12\12"
+ "\12\377\260\257\251\377\200}t\377\266\265\257\377\346\346\344\377\325"
+ "\324\321\377\223\221\213\377ec\\\377\0\0\0\377\0\0\0K\0\0\0\13\0\0\0"
+ "\0\0\0\0\377\267\322\347\377\202\240\273\377ccc\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\15\15\15\377\266\265\257\377\253\251\243\377"
+ "\237\235\226\377\200}t\377\200}t\377vtk\377vtk\377]\\U\377HFA\377\0\0"
+ "\0\364\0\0\0\13\0\0\0\0\0\0\0\377\265\312\345\377\177\242\271\377sss"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\15\15\15\377:::\377"
+ "YXT\377\12\12\12\377HFA\377vtk\377HFA\377\6\10\11\377IIC\377\0\0\0\377"
+ "\0\0\0\364\0\0\0\13\0\0\0\0\0\0\0\377\256\314\345\377}\240\266\377ss"
+ "s\377\316\316\316\377\315\315\315\377\315\315\315\377\315\315\315\377"
+ "\315\315\315\377\315\315\315\377\315\315\315\377\260\260\260\377\12\12"
+ "\12\377\12\12\12\377\244\244\244\377\26\26\26\377BA<\377\14\14\14\377"
+ "l\202\224\377\4\4\5\377\0\0\0\377\0\0\0=\0\0\0\13\0\0\0\0\0\0\0\377\260"
+ "\321\344\377\203\241\266\377s[[\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\26\26\26\377\24\24\24\377\11\11\11\377\203\240\270\377Q\\d\377\0"
+ "\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0\377\252\316\343\377{\233\262"
+ "\377z\216\232\377zzz\377sss\377sss\377sss\377sss\377sss\377kor\377oo"
+ "o\377sss\377sss\377sss\377sss\377iii\377ow~\377\206\242\271\377:Q]\377"
+ "\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0\377\251\311\342\377t\224\257"
+ "\377\201\236\266\377\203\240\270\377\206\242\271\377\202\237\267\377"
+ "\177\235\266\377~\234\265\377\202\237\267\377y\230\262\377\206\242\271"
+ "\377\205\241\270\377\205\241\270\377\207\243\272\377\202\237\267\377"
+ "\214\247\275\377\203\240\270\377\212\245\273\3776JY\377\0\0\0\377\0\0"
+ "\0\36\0\0\0\13\0\0\0\0\0\0\0\377\253\304\342\377r\224\255\377o\220\254"
+ "\377q\222\256\377AJN\377BJQ\377R[c\377boy\377_lv\377\\iq\377Zfo\377X"
+ "ck\377Wcj\377R[c\377;S`\3779BK\377x\227\263\377\244\271\313\3776HS\377"
+ "\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0\377\252\311\342\377p\221\252"
+ "\377o\217\247\377JSY\377\227\223\214\377\337\335\332\377\343\341\336"
+ "\377\353\352\350\377\353\352\350\377\352\351\347\377\337\335\332\377"
+ "\317\316\311\377\311\306\300\377\233\226\216\377Vah\377Kez\377Ts\214"
+ "\377\252\306\335\3774FN\377\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0"
+ "\377\252\311\341\377l\216\246\377l\214\244\377@GM\377\332\330\323\377"
+ "\347\346\342\377ge^\377ROG\377ROG\377\331\327\324\377\307\305\277\377"
+ "\300\274\265\377\270\263\253\377\317\316\311\377CLT\377Mi\177\377Oo\204"
+ "\377\263\312\334\3771>I\377\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0"
+ "\377\250\310\341\377k\215\246\377r\217\244\377@GM\377\342\341\335\377"
+ "\360\357\354\377ge^\377ROG\377ROG\377\315\312\306\377\302\277\271\377"
+ "\300\274\265\377\312\306\300\377\334\332\327\377KU]\377Ni\177\377Oo\204"
+ "\377\272\314\334\3771>I\377\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0"
+ "\377\244\304\336\377i\213\243\377p\212\241\3778>C\377\340\336\332\377"
+ "\353\352\350\377QNF\377OLD\377OLD\377\307\304\276\377\300\274\265\377"
+ "\313\310\302\377\341\340\334\377\351\350\346\377GQX\377Nhy\377Ml\200"
+ "\377\243\303\333\3778\77C\377\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0"
+ "\0\377w\211\231\377n\211\236\377e\205\234\37738<\377\327\324\320\377"
+ "\326\324\320\377NJC\377MIB\377MIB\377\300\274\265\377\321\316\311\377"
+ "\346\345\342\377\355\354\352\377\346\345\342\377EOU\377Has\377Mfx\377"
+ "\241\301\332\3777<@\377\0\0\0\377\0\0\0\36\0\0\0\13\0\0\0\0\0\0\0""5"
+ "\14\15\17\377N^j\377[n|\377O[b\377\244\240\231\377\300\274\265\377\270"
+ "\263\253\377\314\311\303\377\314\311\303\377\327\325\321\377\344\342"
+ "\340\377\352\351\347\377\335\333\327\377\270\265\260\377>GM\377Jav\377"
+ "J`p\377\233\303\330\3776<A\377\0\0\0\377\0\0\0\35\0\0\0\13\0\0\0\0\0"
+ "\0\0\4\0\0\0""9\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377(2>\377\0\0\0\377\0\0\0]\0\0\0"
+ "\30\0\0\0\11\0\0\0\0\0\0\0\1\0\0\0\4\0\0\0\16\0\0\0\30\0\0\0\35\0\0\0"
+ "\35\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0"
+ "\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\35\0\0\0\30"
+ "\0\0\0\15\0\0\0\4"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_shell[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (9216) */
+ "\0\0$\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (192) */
+ "\0\0\0\300"
+ /* width (48) */
+ "\0\0\0""0"
+ /* height (48) */
+ "\0\0\0""0"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\1\0\0\0\2\0\0\0\4\0\0\0\7\0\0\0\11\0\0\0\12\0\0\0\13\0\0\0"
+ "\13\0\0\0\13\0\0\0\13\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0"
+ "\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14"
+ "\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0"
+ "\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\13\0"
+ "\0\0\13\0\0\0\13\0\0\0\12\0\0\0\11\0\0\0\7\0\0\0\4\0\0\0\2\0\0\0\1\0"
+ "\0\0\0\0\0\0\0\0\0\0\2\0\0\0""7\2\2\2\377\1\1\1\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0K\0\0\0\14\0\0\0\7\0\0\0\2\0\0\0\1\0\0\0\0\0\0\0\4\0"
+ "\0\0\377\340\336\334\332\352\351\346\377\357\356\354\377\360\357\355"
+ "\377\361\360\356\377\362\361\357\377\360\360\355\377\361\360\355\377"
+ "\362\362\357\377\362\362\357\377\362\362\357\377\362\362\357\377\362"
+ "\362\357\377\362\362\357\377\362\362\357\377\361\361\356\377\356\356"
+ "\353\377\355\354\350\377\354\353\350\377\353\352\347\377\352\351\346"
+ "\377\351\350\344\377\350\347\344\377\346\345\341\377\346\344\340\377"
+ "\341\337\333\377\331\327\323\377\326\324\316\377\323\320\313\377\320"
+ "\315\307\377\314\311\304\377\311\306\301\377\306\303\276\377\302\300"
+ "\273\377\277\275\270\377\272\270\261\377\270\265\256\377\266\262\254"
+ "\377\260\254\246\377\215\211\202\340\0\0\0\377\0\0\0\32\0\0\0\16\0\0"
+ "\0\6\0\0\0\2\0\0\0\0\0\0\0\7\0\0\0\377\357\356\355\377\325\322\312\377"
+ "\327\324\314\377\331\326\316\377\332\327\317\377\333\330\321\377\334"
+ "\332\322\377\335\333\323\377\336\333\324\377\336\334\324\377\336\334"
+ "\324\377\336\333\323\377\336\334\324\377\336\334\324\377\336\333\324"
+ "\377\336\333\323\377\335\332\323\377\334\332\322\377\333\330\321\377"
+ "\332\326\316\377\331\325\315\377\327\323\313\377\324\321\311\377\322"
+ "\316\306\377\320\314\304\377\316\312\302\377\312\306\276\377\307\303"
+ "\273\377\303\277\266\377\300\273\263\377\273\267\257\377\267\263\253"
+ "\377\264\257\247\377\260\254\243\377\255\250\240\377\246\243\231\377"
+ "\244\237\227\377\241\234\224\377\236\231\220\377\202~w\377\0\0\0\377"
+ "\0\0\0)\0\0\0\26\0\0\0\12\0\0\0\3\0\0\0\0\0\0\0\11\0\0\0\377\357\356"
+ "\354\377\326\324\313\377\330\326\315\377\332\327\317\377\333\330\320"
+ "\377\335\332\322\377\336\333\323\377\336\334\324\377\337\335\325\377"
+ "\337\335\326\377\337\335\326\377\337\335\326\377\340\335\326\377\337"
+ "\335\325\377\337\333\324\377\336\332\323\377\334\331\322\377\333\330"
+ "\320\377\332\327\320\377\331\326\316\377\327\323\314\377\325\321\311"
+ "\377\323\317\310\377\321\315\305\377\316\313\303\377\315\310\300\377"
+ "\311\305\275\377\305\302\272\377\301\275\265\377\276\271\261\377\272"
+ "\266\255\377\266\262\252\377\262\256\245\377\256\252\241\377\251\245"
+ "\234\377\245\241\230\377\241\234\224\377\236\232\222\377\233\227\216"
+ "\377{xq\377\0\0\0\377\0\0\0""7\0\0\0\37\0\0\0\15\0\0\0\5\0\0\0\0\0\0"
+ "\0\12\0\0\0\377\360\357\355\377\327\324\315\377\331\326\316\377\310\306"
+ "\276\377\270\266\257\377\272\267\260\377\273\270\261\377\274\271\262"
+ "\377\274\271\263\377\274\271\263\377\274\271\262\377\273\270\262\377"
+ "\273\270\261\377\273\267\261\377\271\266\260\377\271\265\256\377\267"
+ "\264\255\377\266\263\254\377\265\262\252\377\263\260\250\377\261\257"
+ "\247\377\257\254\244\377\256\252\243\377\254\250\241\377\251\246\237"
+ "\377\247\243\234\377\244\240\230\377\241\235\225\377\235\231\221\377"
+ "\230\225\216\377\224\221\212\377\221\216\206\377\216\213\202\377\212"
+ "\207\200\377\206\202{\377\206\202{\377\237\232\221\377\233\230\216\377"
+ "\230\224\213\377yvn\377\0\0\0\377\0\0\0A\0\0\0%\0\0\0\20\0\0\0\5\0\0"
+ "\0\0\0\0\0\14\0\0\0\377\360\360\355\377\331\326\316\377\332\327\317\377"
+ "\267\265\255\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\254\250"
+ "\236\377\230\225\213\377\225\221\210\377wtl\377\0\0\0\377\0\0\0G\0\0"
+ "\0(\0\0\0\22\0\0\0\6\0\0\0\0\0\0\0\14\0\0\0\377\361\360\356\377\331\326"
+ "\316\377\332\327\317\377\267\264\255\377\0\0\0\377>C>\377BGB\377EIE\377"
+ "HMH\377JNJ\377LRL\377PTP\377QUQ\377RXR\377RXR\377SYS\377SXS\377SWS\377"
+ "QWQ\377QWQ\377NTN\377MRM\377LQL\377KQK\377JNJ\377HKH\377EIE\377DHD\377"
+ "\77D\77\377<A<\3777;7\377262\377/2/\377(+(\377$($\377\0\0\0\377\264\257"
+ "\245\377\226\221\210\377\222\215\204\377tqi\377\0\0\0\377\0\0\0I\0\0"
+ "\0*\0\0\0\23\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\360\360\355\377\327\324"
+ "\315\377\331\325\316\377\265\262\253\377\0\0\0\377595\377\235\236\235"
+ "\377\236\240\236\377\237\241\237\377\241\243\241\377\242\244\242\377"
+ "\243\245\243\377\241\243\241\377\231\234\231\377\222\225\222\377\213"
+ "\216\213\377\202\204\202\377y}y\377ptp\377ili\377^c^\377TYT\377KOK\377"
+ "AFA\377@D@\377\77C\77\377=A=\377;>;\3776;6\377383\377/2/\377+/+\377$"
+ "($\377!%!\377\35\40\35\377\0\0\0\377\261\254\242\377\222\215\204\377"
+ "\216\212\201\377qng\377\0\0\0\377\0\0\0K\0\0\0+\0\0\0\24\0\0\0\7\0\0"
+ "\0\0\0\0\0\14\0\0\0\377\355\354\351\377\325\321\312\377\327\323\314\377"
+ "\263\260\251\377\0\0\0\377BHB\377\244\246\244\377\246\251\246\377\247"
+ "\252\247\377\252\255\252\377\254\256\254\377\245\250\245\377\240\244"
+ "\240\377\231\235\231\377\223\227\223\377\214\220\214\377\205\212\205"
+ "\377|\201|\377u{u\377lpl\377did\377[_[\377X]X\377U[U\377SZS\377QUQ\377"
+ "QUQ\377LQL\377JPJ\377CHC\377>C>\3777<7\377020\377+/+\377&)&\377\0\0\0"
+ "\377\257\251\240\377\216\211\200\377\212\206~\377okd\377\0\0\0\377\0"
+ "\0\0K\0\0\0+\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\354\353\351"
+ "\377\323\317\307\377\323\321\311\377\261\256\246\377\0\0\0\377;>;\377"
+ "\237\242\237\377\242\244\242\377\243\245\243\377\240\242\240\377\231"
+ "\234\231\377\223\227\223\377\216\220\216\377\207\213\207\377\202\206"
+ "\202\377z}z\377rvr\377ini\377afa\377Y_Y\377RVR\377QUQ\377NRN\377LRL\377"
+ "KPK\377INI\377FKF\377DHD\377AFA\377:>:\3776;6\377040\377*.*\377%'%\377"
+ "\37\"\37\377\0\0\0\377\254\247\234\377\212\205}\377\206\202z\377kha\377"
+ "\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377"
+ "\354\352\350\377\320\314\304\377\321\315\305\377\256\253\244\377\0\0"
+ "\0\377JMJ\377\250\252\250\377\247\252\247\377\242\244\242\377\235\240"
+ "\235\377\232\234\232\377\224\230\224\377\221\226\221\377\216\222\216"
+ "\377\210\215\210\377\203\207\203\377{\200{\377sys\377mrm\377jpj\377i"
+ "ni\377ele\377eje\377chc\377^d^\377\\c\\\377[`[\377W]W\377RYR\377KNK\377"
+ "EKE\377=C=\3779<9\377/4/\377(*(\377\0\0\0\377\251\244\231\377\206\202"
+ "y\377\203\177v\377hd]\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0"
+ "\0\0\0\0\0\0\14\0\0\0\377\352\351\346\377\315\311\300\377\316\312\302"
+ "\377\254\251\241\377\0\0\0\377@D@\377\232\234\232\377\224\227\224\377"
+ "\217\222\217\377\212\215\212\377\206\212\206\377\201\205\201\377~\202"
+ "~\377y~y\377uzu\377nsn\377gmg\377djd\377chc\377`e`\377^d^\377\\b\\\377"
+ "Z_Z\377W]W\377VZV\377RXR\377PVP\377MRM\377GLG\377CGC\377:\77:\3775:5"
+ "\377-2-\377(+(\377!%!\377\0\0\0\377\246\241\226\377\202~u\377\177|s\377"
+ "eb[\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0"
+ "\0\377\350\347\345\377\311\305\275\377\312\307\277\377\251\245\236\377"
+ "\0\0\0\377QTQ\377\226\231\226\377\222\225\222\377\215\222\215\377\213"
+ "\217\213\377\210\215\210\377\206\213\206\377\205\213\205\377\202\211"
+ "\202\377\202\211\202\377\200\206\200\377}\204}\377z\201z\377y\200y\377"
+ "x~x\377v|v\377tzt\377pup\377msm\377jqj\377hmh\377djd\377`f`\377Y_Y\377"
+ "TYT\377INI\377CJC\377:>:\377262\377).)\377\0\0\0\377\243\236\223\377"
+ "~zq\377{xo\377b_W\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0"
+ "\0\0\0\0\14\0\0\0\377\346\344\342\377\304\300\267\377\307\303\273\377"
+ "\245\241\232\377\0\0\0\377EJE\377\201\205\201\377}\200}\377z~z\377uz"
+ "u\377rwr\377pup\377ntn\377ntn\377pvp\377pvp\377qwq\377qwq\377ntn\377"
+ "kqk\377ipi\377ioi\377dkd\377aga\377^c^\377[a[\377X^X\377TYT\377MSM\377"
+ "FJF\377@D@\3777<7\377/4/\377*-*\377\"&\"\377\0\0\0\377\240\232\217\377"
+ "yvm\377xtk\377_\\U\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0"
+ "\0\0\0\0\14\0\0\0\377\336\335\331\377\300\275\264\377\303\277\267\377"
+ "\241\235\225\377\0\0\0\377WZW\377\201\205\201\377|\202|\377|\201|\377"
+ "{\200{\377z\177z\377x~x\377|\203|\377\202\210\202\377\205\213\205\377"
+ "\207\215\207\377\210\216\210\377\206\214\206\377\205\214\205\377\204"
+ "\212\204\377\201\206\201\377|\203|\377y\200y\377w|w\377rxr\377ovo\377"
+ "lql\377djd\377`f`\377W\\W\377NUN\377EIE\377>C>\377474\377+/+\377\0\0"
+ "\0\377\234\226\213\377uri\377spg\377\\YQ\377\0\0\0\377\0\0\0K\0\0\0,"
+ "\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\334\332\326\377\275\272"
+ "\260\377\277\272\261\377\235\231\221\377\0\0\0\377GMG\377jnj\377fif\377"
+ "cgc\377bfb\377bhb\377gmg\377lrl\377rxr\377u{u\377w}w\377x~x\377w~w\377"
+ "w}w\377u|u\377sxs\377qvq\377lrl\377ioi\377eke\377bgb\377^d^\377X]X\377"
+ "SWS\377IPI\377CHC\377:>:\377373\377+-+\377\"&\"\377\0\0\0\377\232\224"
+ "\211\377rne\377plc\377YUN\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0"
+ "\7\0\0\0\0\0\0\0\14\0\0\0\377\330\327\323\377\270\264\253\377\272\266"
+ "\255\377\231\225\215\377\0\0\0\377W\\W\377ioi\377flf\377fmf\377nsn\377"
+ "sys\377z\201z\377\200\206\200\377\204\212\204\377\211\217\211\377\213"
+ "\221\213\377\214\223\214\377\214\222\214\377\213\221\213\377\211\220"
+ "\211\377\207\215\207\377\204\212\204\377\201\207\201\377}\205}\377y\200"
+ "y\377v{v\377qwq\377jqj\377bhb\377[`[\377PTP\377HNH\377;\77;\377272\377"
+ "+/+\377\0\0\0\377\227\221\205\377nja\377mg_\377VRK\377\0\0\0\377\0\0"
+ "\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\326\325\321\377"
+ "\264\260\247\377\265\261\250\377\224\221\211\377\0\0\0\377HMH\377OTO"
+ "\377QWQ\377W\\W\377^d^\377bhb\377ioi\377ouo\377sys\377v}v\377y\177y\377"
+ "{\202{\377{\201{\377z\200z\377y\200y\377w~w\377szs\377qwq\377ntn\377"
+ "jqj\377flf\377`e`\377Z`Z\377SYS\377KQK\377BGB\377;\77;\377161\377*,*"
+ "\377#%#\377\0\0\0\377\223\216\203\377jf]\377ie\\\377SPI\377\0\0\0\377"
+ "\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\323\322\317"
+ "\377\260\253\242\377\261\255\243\377\221\216\205\377\0\0\0\377X^X\377"
+ "[b[\377bfb\377fmf\377lrl\377rxr\377z\200z\377\200\205\200\377\205\213"
+ "\205\377\207\216\207\377\212\221\212\377\214\222\214\377\215\222\215"
+ "\377\213\222\213\377\212\221\212\377\210\217\210\377\207\214\207\377"
+ "\203\212\203\377\200\207\200\377|\204|\377w|w\377qwq\377lpl\377cic\377"
+ "Z_Z\377PUP\377GLG\377=B=\377171\377,/,\377\0\0\0\377\221\213\200\377"
+ "gcZ\377ebY\377PNF\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0"
+ "\0\0\0\0\14\0\0\0\377\321\317\313\377\253\246\235\377\255\250\236\377"
+ "\215\211\201\377\0\0\0\377HMH\377KOK\377\331\333\331\377\241\243\241"
+ "\377bgb\377`f`\377flf\377kqk\377pwp\377tzt\377w}w\377w~w\377y\177y\377"
+ "x~x\377w}w\377u{u\377sys\377pwp\377nsn\377joj\377did\377_e_\377Y_Y\377"
+ "RWR\377HOH\377AEA\3779>9\377373\377)-)\377#'#\377\0\0\0\377\216\211|"
+ "\377d`W\377b^U\377NKD\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0"
+ "\0\0\0\0\0\0\14\0\0\0\377\315\313\307\377\246\241\230\377\250\243\231"
+ "\377\210\205}\377\0\0\0\377TZT\377Y^Y\377\377\377\377\377\377\377\377"
+ "\377\360\361\360\377\277\301\277\377\206\213\206\377z\201z\377~\205~"
+ "\377\203\211\203\377\204\213\204\377\206\215\206\377\207\216\207\377"
+ "\207\215\207\377\205\214\205\377\205\214\205\377\203\211\203\377\201"
+ "\207\201\377}\204}\377x\200x\377szs\377msm\377gog\377_f_\377X]X\377M"
+ "TM\377DJD\377<A<\377272\377+/+\377\0\0\0\377\214\207z\377a]T\377_[R\377"
+ "KHA\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0"
+ "\0\377\312\311\304\377\240\233\222\377\242\236\224\377\204\200x\377\0"
+ "\0\0\377DID\377IOI\377mpm\377\247\252\247\377\327\331\327\377\374\374"
+ "\374\377\373\373\373\377\314\316\314\377\226\233\226\377lrl\377ouo\377"
+ "pup\377pwp\377pwp\377pvp\377ouo\377nsn\377jqj\377fmf\377cic\377_c_\377"
+ "X_X\377TZT\377MSM\377EJE\377=A=\3776;6\377040\377(+(\377\"%\"\377\0\0"
+ "\0\377\212\204x\377^ZQ\377[XO\377HF\77\377\0\0\0\377\0\0\0K\0\0\0,\0"
+ "\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\305\303\276\377\233\226\215"
+ "\377\234\231\216\377\200|s\377\0\0\0\377QWQ\377UZU\377Z^Z\377]d]\377"
+ "bhb\377{\201{\377\312\314\312\377\377\377\377\377\377\377\377\377w}w"
+ "\377y~y\377y\201y\377{\202{\377z\202z\377z\202z\377y\200y\377x}x\377"
+ "szs\377qwq\377mtm\377ipi\377did\377\\b\\\377X\\X\377PUP\377EKE\377\77"
+ "D\77\377:=:\377151\377*.*\377\0\0\0\377\207\202u\377[WN\377YUL\377FC"
+ "<\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0"
+ "\377\274\270\262\377\226\222\210\377\230\224\212\377{xo\377\0\0\0\377"
+ "BFB\377DJD\377dgd\377\223\226\223\377\272\275\272\377\367\367\367\377"
+ "\373\373\373\377\304\306\304\377\177\204\177\377`e`\377aha\377bhb\377"
+ "chc\377bhb\377bhb\377afa\377_d_\377[a[\377Y]Y\377TYT\377RWR\377MQM\377"
+ "HNH\377BHB\377>C>\3777;7\377262\377+/+\377$'$\377\40\"\40\377\0\0\0\377"
+ "\205\177r\377WTK\377URI\377DA:\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0"
+ "\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\267\263\256\377\222\216\204\377\223"
+ "\216\204\377vsj\377\0\0\0\377LSL\377PTP\377\377\377\377\377\377\377\377"
+ "\377\351\351\351\377\244\250\244\377pvp\377eje\377fnf\377hoh\377jqj\377"
+ "jpj\377ipi\377jpj\377hnh\377glg\377flf\377did\377_e_\377]c]\377Y^Y\377"
+ "S[S\377MRM\377HLH\377CJC\377=B=\3777>7\377262\377.0.\377&*&\377\0\0\0"
+ "\377\203}o\377TQH\377ROF\377B>7\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24"
+ "\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\261\256\251\377\215\210\177\377\216"
+ "\211\177\377sof\377\0\0\0\377:@:\377>C>\377\320\321\320\377\200\204\200"
+ "\377KOK\377JOJ\377LQL\377NSN\377PTP\377QVQ\377RWR\377\322\324\322\377"
+ "\365\365\365\377\372\373\372\377\372\372\372\377\372\372\372\377\307"
+ "\311\307\377w{w\377FLF\377BHB\377@D@\377>B>\3779>9\377595\377272\377"
+ "-2-\377).)\377&)&\377\"%\"\377\34\40\34\377\0\0\0\377\201|n\377QMD\377"
+ "OLC\377\77<5\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0"
+ "\0\14\0\0\0\377\253\250\242\377\207\203y\377\211\205z\377okc\377\0\0"
+ "\0\377CIC\377EKE\377JPJ\377JPJ\377LSL\377PUP\377TYT\377T[T\377X]X\377"
+ "X^X\377W]W\377X^X\377X]X\377U\\U\377RXR\377QWQ\377NSN\377MRM\377JPJ\377"
+ "HKH\377BJB\377AEA\377=A=\3779=9\3776<6\377/5/\377.1.\377+.+\377&,&\377"
+ "!$!\377\0\0\0\377\177yl\377MJA\377LI@\377=:3\377\0\0\0\377\0\0\0K\0\0"
+ "\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\251\246\240\377\202~"
+ "u\377\204\177u\377jf^\377\0\0\0\377585\3774:4\3776<6\3778=8\3779>9\377"
+ "=A=\377>C>\377\77C\77\377>B>\377@D@\377@E@\377@C@\377>C>\377<A<\377="
+ "B=\377:\77:\3779=9\3775:5\377393\377373\377030\377,0,\377*-*\377)+)\377"
+ "'+'\377$'$\377\40$\40\377\35\"\35\377\33\36\33\377\30\34\30\377\0\0\0"
+ "\377}xh\377KH\77\377KH>\377<:2\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0"
+ "\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\244\241\232\377}yo\377\177{p\377fc"
+ "Z\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377|wg\377KH>\377KH>\377"
+ "<:2\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0"
+ "\0\377\237\234\226\377ytj\377zuk\377\224\217\203\377\256\251\233\377"
+ "\260\251\234\377\257\253\235\377\261\253\235\377\261\253\235\377\261"
+ "\253\236\377\260\253\235\377\257\251\233\377\256\250\232\377\255\250"
+ "\231\377\253\245\230\377\252\243\225\377\250\242\224\377\247\240\222"
+ "\377\245\236\220\377\242\234\216\377\237\231\212\377\235\227\210\377"
+ "\233\226\206\377\231\223\204\377\230\222\203\377\225\217\200\377\223"
+ "\214}\377\221\211{\377\216\211w\377\215\206u\377\214\206t\377\212\204"
+ "r\377\210\202q\377\207\201o\377\206\200n\377\205\177m\377vqa\377KH>\377"
+ "KH>\377<:2\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0"
+ "\14\0\0\0\377\235\232\224\377tpe\377uqg\377uqg\377uqf\377vrg\377vrh\377"
+ "uqg\377upf\377upf\377tpe\377sod\377rnc\377pla\377mi_\377mh^\377jf\\\377"
+ "hdY\377faW\377c_U\377a]S\377_ZQ\377]ZO\377[XM\377YVK\377XTI\377WSH\377"
+ "URG\377TPE\377RND\377PMC\377PLB\377NKA\377MJ@\377MI\77\377LI\77\377K"
+ "H>\377KH>\377KH>\377<92\377\0\0\0\377\0\0\0K\0\0\0,\0\0\0\24\0\0\0\7"
+ "\0\0\0\0\0\0\0\14\0\0\0\377\225\223\214\377oka\377qmc\377qmc\377qlb\377"
+ "rmc\377rnc\377rmb\377rlb\377qlb\377pka\377ok`\377nj_\377kg\\\377jeZ\377"
+ "idY\377fbW\377c`U\377b^T\377`\\R\377^ZO\377\\XM\377ZWL\377YUJ\377WSI"
+ "\377VSH\377URG\377TPE\377SOD\377QNC\377PLB\377OKA\377]YP\377okc\377n"
+ "kc\377ROF\377KH>\377KH>\377KH>\377=;3\377\0\0\0\377\0\0\0K\0\0\0,\0\0"
+ "\0\24\0\0\0\7\0\0\0\0\0\0\0\14\0\0\0\377\217\214\205\375kg]\377lh^\377"
+ "mi_\377mh^\377mi_\377mi^\377mi^\377ni_\377lh]\377kg\\\377jf[\377ieZ\377"
+ "gcX\377eaV\377d`U\377a]S\377`\\Q\377^ZO\377]YN\377\\XL\377ZVJ\377YUJ"
+ "\377XTI\377VSH\377UQG\377TPE\377SOE\377QNC\377PMC\377OLB\377OK@\377w"
+ "tl\377MI\77\377LI\77\377A>6\377KH>\377KH>\377KH>\377<:2\377\0\0\0\377"
+ "\0\0\0J\0\0\0+\0\0\0\24\0\0\0\7\0\0\0\0\0\0\0\13\0\0\0\377\215\213\202"
+ "\374heZ\377if[\377jf\\\377kf\\\377jf\\\377jf\\\377kf\\\377jf\\\377if"
+ "[\377idZ\377hcZ\377gbX\377eaV\377c_U\377b^T\377`\\Q\377^ZO\377]XN\377"
+ "\\XN\377ZVL\377YUJ\377WTI\377WSH\377URG\377TPF\377SOE\377RND\377PMC\377"
+ "OLB\377OK@\377NJ@\377MI\77\377@<4\377>;3\377KH>\377KH>\377KH>\377KH>"
+ "\377EB:\376\0\0\0\377\0\0\0G\0\0\0)\0\0\0\23\0\0\0\7\0\0\0\0\0\0\0\12"
+ "\0\0\0\377omf\343NLC\377PMF\377QNF\377QNF\377QNF\377QME\377QNF\377QN"
+ "F\377QME\377QME\377PLD\377OLC\377NJB\377LIA\377KI@\377JG>\377HE=\377"
+ "GC<\377GC<\377EA:\377C@8\377B\77""8\377B>7\377A>7\377@=5\377\77<4\377"
+ ">;3\377=:2\377<92\377<91\377;81\377:80\377:70\377:70\377970\377970\377"
+ "970\377:80\377\77<4\364\0\0\0\377\0\0\0A\0\0\0%\0\0\0\21\0\0\0\6\0\0"
+ "\0\0\0\0\0\11\0\0\0Y\0\0\0\377\0\0\0\377\0\0\0\377utr\366srl\377xvp\377"
+ "xwq\377}{v\377\201\177z\377\205\203\177\377\211\207\202\377\213\210\204"
+ "\377\217\216\212\377\221\217\213\377\222\220\214\377\220\216\213\377"
+ "\217\216\211\377\214\212\207\377\213\210\204\377\210\206\202\377\207"
+ "\204\201\377\203\201}\377\201\177z\377\177}x\377}{w\377yws\377wup\377"
+ "srl\377poi\377nlg\377ljf\377lid\377ljd\377lke\377mjd\377nkd\377GD>\372"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\206\0\0\0""7\0\0\0\36\0\0\0\15\0"
+ "\0\0\5\0\0\0\0\0\0\0\6\0\0\0\20\0\0\0!\0\0\0""9\0\0\0\377fec\356LIC\374"
+ "LIB\377OMF\377USL\377YWQ\377^\\V\377db\\\377iga\377nkg\377qok\377qoj"
+ "\377omg\377nke\377jhc\377igb\377ge`\377eb]\377da\\\377`^X\377\\[T\377"
+ "YXQ\377VTM\377RPI\377MKD\377IG@\377FD<\377FC<\377DB:\377CA8\377DA8\377"
+ "D@8\377C@7\377.+%\362\0\0\0\377\0\0\0i\0\0\0U\0\0\0\77\0\0\0(\0\0\0\25"
+ "\0\0\0\11\0\0\0\3\0\0\0\0\0\0\0\4\0\0\0\12\0\0\0\25\0\0\0&\0\0\0n\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\214"
+ "\0\0\0O\0\0\0<\0\0\0)\0\0\0\31\0\0\0\15\0\0\0\5\0\0\0\2\0\0\0\0\0\0\0"
+ "\2\0\0\0\5\0\0\0\14\0\0\0\25\0\0\0#\0\0\0""2\0\0\0B\0\0\0N\0\0\0V\0\0"
+ "\0Z\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0]\0"
+ "\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]\0\0\0]"
+ "\0\0\0]\0\0\0]\0\0\0]\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0\\\0\0\0["
+ "\0\0\0W\0\0\0O\0\0\0C\0\0\0""4\0\0\0$\0\0\0\27\0\0\0\15\0\0\0\6\0\0\0"
+ "\2\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0\2\0\0\0\5\0\0\0\12\0\0\0\22\0\0\0\34"
+ "\0\0\0&\0\0\0/\0\0\0""5\0\0\0""9\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0"
+ "\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:"
+ "\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0:\0\0\0"
+ ":\0\0\0:\0\0\0""9\0\0\0""5\0\0\0""0\0\0\0(\0\0\0\35\0\0\0\23\0\0\0\12"
+ "\0\0\0\5\0\0\0\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0"
+ "\0\4\0\0\0\7\0\0\0\14\0\0\0\22\0\0\0\27\0\0\0\32\0\0\0\34\0\0\0\35\0"
+ "\0\0\35\0\0\0\35\0\0\0\35\0\0\0\35\0\0\0\35\0\0\0\35\0\0\0\36\0\0\0\36"
+ "\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0"
+ "\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\36\0\0\0\35\0\0\0\35\0\0\0\35\0"
+ "\0\0\35\0\0\0\35\0\0\0\35\0\0\0\33\0\0\0\27\0\0\0\22\0\0\0\15\0\0\0\10"
+ "\0\0\0\4\0\0\0\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\1\0\0\0\2\0\0\0\4\0\0\0\7\0\0\0\11\0\0\0\12\0\0\0\13\0\0\0"
+ "\13\0\0\0\13\0\0\0\13\0\0\0\13\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0"
+ "\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14"
+ "\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0\14\0\0\0"
+ "\13\0\0\0\13\0\0\0\13\0\0\0\13\0\0\0\12\0\0\0\11\0\0\0\7\0\0\0\4\0\0"
+ "\0\2\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\2\0\0\0\2\0\0\0\2\0\0"
+ "\0\2\0\0\0\2\0\0\0\2\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3"
+ "\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0"
+ "\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\3\0\0\0\2\0\0\0\2"
+ "\0\0\0\2\0\0\0\2\0\0\0\2\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1"
+ "\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0"
+ "\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_maximize[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\351"
+ "\351\351\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377\377\266Z\377"
+ "\0\0\0\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270"
+ "\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\0\0\0\377\377p8\377\377\302a\377\377\265Y\377"
+ "\0\0\0\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\0\0\0"
+ "\377\377\\.\377\377\275^\377\377\306b\377\377\310c\377\377\277_\377\0"
+ "\0\0\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\0\0\0\377\244@\40\377\244"
+ "@\40\377\377\310c\377\226\\-\377\223W+\377\0\0\0\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377\377\306"
+ "c\377\0\0\0\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\223"
+ "W+\0\377\277_\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270"
+ "\270\270\377\0\0\0\377\0\0\0\0\377\\.\0\244@\40\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\226\\-\0\377\310c\0\377\265Y\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\377p8\0\377\275^\0\244@\40"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\306c\0\377\310c\0\377\306b\0\377\302a"
+ "\0\377\266Z\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377"
+ "\377\302a\0\377\306b\0\377\310c\0\377\306c\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\244@\40\0\377\275^\0\377p8\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\377\265Y\0\377\310c\0\226\\-\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\244@\40\0\377\\.\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
+ "\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\377\277_\0\223W+\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377\377\306"
+ "c\377\0\0\0\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\0\0\0\377\223W+\377\226\\-\377\377\310c\377\244@\40\377"
+ "\244@\40\377\0\0\0\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\0\0\0\377"
+ "\377\277_\377\377\310c\377\377\306b\377\377\275^\377\377\\.\377\0\0\0"
+ "\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\0\0\0\377\377"
+ "\265Y\377\377\302a\377\377p8\377\0\0\0\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0\0\377\377"
+ "\266Z\377\0\0\0\377\354\354\354\377\354\354\354\377\354\354\354\377\270"
+ "\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\344\344\344\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\0\0"
+ "\0\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377"
+ "\205\205\205\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_maximize_width[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\377\306c\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\223W+\0\226"
+ "\\-\0\377\310c\0\244@\40\0\244@\40\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\277_\0\377\310"
+ "c\0\377\306b\0\377\275^\0\377\\.\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\265Y\0"
+ "\377\302a\0\377p8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\266Z\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\344\344\344\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\0\0\0\377\0\0\0"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0"
+ "\0\377\0\0\0\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\0\0\0\377\377\\.\377\244@\40\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\223W+\377\377\277_\377\0\0\0\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\377\377\377\377\0\0\0\377\377p8\377\377\275^\377\244"
+ "@\40\377\0\0\0\377\0\0\0\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\0\0\0\377\0\0\0\377\226\\-\377\377\310c\377"
+ "\377\265Y\377\0\0\0\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\377\0\0\0\377\377\266Z\377\377\302a\377\377\306b\377"
+ "\377\310c\377\377\306c\377\0\0\0\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\0\0\0\377\377\306c\377\377\310c\377"
+ "\377\306b\377\377\302a\377\377\266Z\377\0\0\0\377\0\0\0\377\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\0\0\0\377\377\265Y\377"
+ "\377\310c\377\226\\-\377\0\0\0\377\0\0\0\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\0\0\0\377\0\0\0\377\244@\40"
+ "\377\377\275^\377\377p8\377\0\0\0\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377"
+ "\0\0\0\377\377\277_\377\223W+\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\244@\40\377\377\\.\377\0\0\0\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\0\0\0\377\0\0\0"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\0\0"
+ "\0\377\0\0\0\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\351\351\351\377\270"
+ "\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270"
+ "\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270"
+ "\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\205\205\205\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "p8\0\377\302a\0\377\265Y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\\.\0\377\275^"
+ "\0\377\306b\0\377\310c\0\377\277_\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\244@\40\0\244@\40"
+ "\0\377\310c\0\226\\-\0\223W+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\306"
+ "c\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_minimize[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\377\377\306c\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\223W+\377\226\\-\377\377\310c\377\244@\40\377\244@\40\377\0\0\0"
+ "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\377\377\277_\377\377\310c\377\377\306b\377\377\275^\377\377"
+ "\\.\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\265Y\377\377\302a\377\377p8\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\266Z\377\0\0\0\377\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\344\344\344\377\0\0\0\377"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "\351\351\351\377\270\270\270\377\270\270\270\377\270\270\270\377\270"
+ "\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270"
+ "\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270"
+ "\377\270\270\270\377\270\270\270\377\270\270\270\377\205\205\205\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
+ "\266Z\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377p8\377\377\302"
+ "a\377\377\265Y\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\\.\377\377\275^\377"
+ "\377\306b\377\377\310c\377\377\277_\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\244@\40\377"
+ "\244@\40\377\377\310c\377\226\\-\377\223W+\377\0\0\0\377\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\377\377\306c\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_minimize_width[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\351\351\351\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270"
+ "\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\223W+\377\377"
+ "\277_\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\\.\377\244@\40\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\226\\"
+ "-\377\377\310c\377\377\265Y\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0"
+ "\0\0\377\377p8\377\377\275^\377\244@\40\377\0\0\0\377\0\0\0\377\0\0\0"
+ "\377\377\306c\377\377\310c\377\377\306b\377\377\302a\377\377\266Z\377"
+ "\0\0\0\377\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270"
+ "\270\270\377\0\0\0\377\0\0\0\377\377\266Z\377\377\302a\377\377\306b\377"
+ "\377\310c\377\377\306c\377\0\0\0\377\0\0\0\377\0\0\0\377\244@\40\377"
+ "\377\275^\377\377p8\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377"
+ "\377\265Y\377\377\310c\377\226\\-\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0"
+ "\0\0\244@\40\377\377\\.\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\0\0\0\0\0\0\0\377\377\277_\377\223W+\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\344\344\344\377\270\270\270\377\270\270\270\377\270\270\270\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\205\205\205\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_split[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
+ "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\344\344\344\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\344\344\344\377\0\0\0\377\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
+ "\377\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270"
+ "\377\0\0\0\377\0\0\0\0\344\344\344\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\270\270\270\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377"
+ "\0\0\0\377\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\377\377\377\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\270\270\270\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0"
+ "\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\270\270\270\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0"
+ "\377\351\351\351\377\270\270\270\377\270\270\270\377\270\270\270\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270"
+ "\270\270\377\270\270\270\377\270\270\270\377\205\205\205\377\0\0\0\377"
+ "\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\351\351\351\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\205\205\205\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\344\344\344\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0"
+ "\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\344\344\344\377\0\0\0\377"
+ "\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\377\377\377\0\0\0\0\377\377\377\377\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\377"
+ "\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\377\377\377\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\270"
+ "\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
+ "\377\377\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\270\270\270\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\351\351\351\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\205\205\205"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\377\351\351\351\377\270\270\270\377\270\270\270\377\270\270\270"
+ "\377\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\205\205\205\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 stock_vim_window_split_vertical[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\0\377\377\377"
+ "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
+ "\0\377\377\377\0\351\351\351\0\0\0\0\0\377\377\377\0\377\377\377\0\377"
+ "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\351"
+ "\351\351\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\351\351"
+ "\351\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+ "\377\377\377\351\351\351\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270"
+ "\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377"
+ "\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270"
+ "\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377"
+ "\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
+ "\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0"
+ "\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\270\270"
+ "\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354"
+ "\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0"
+ "\377\377\377\377\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0"
+ "\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377"
+ "\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377"
+ "\377\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\354\354\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354\354"
+ "\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\377\377\377\377\377\354"
+ "\354\354\377\354\354\354\377\354\354\354\377\354\354\354\377\354\354"
+ "\354\377\354\354\354\377\270\270\270\377\0\0\0\377\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\377\344\344\344\377\270\270\270\377\270\270\270\377\270"
+ "\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\205\205"
+ "\205\377\0\0\0\377\0\0\0\0\0\0\0\377\344\344\344\377\270\270\270\377"
+ "\270\270\270\377\270\270\270\377\270\270\270\377\270\270\270\377\270"
+ "\270\270\377\205\205\205\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\344\344\344\0\0\0\0\0\344\344\344\0\270\270\270\0\270"
+ "\270\270\0\270\270\270\0\270\270\270\0\270\270\270\0\270\270\270\0\205"
+ "\205\205\0\0\0\0\0\344\344\344\0\270\270\270\0\270\270\270\0\270\270"
+ "\270\0\270\270\270\0\270\270\270\0\270\270\270\0\205\205\205\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+
diff --git a/pixmaps/tb_blank.xpm b/pixmaps/tb_blank.xpm
new file mode 100644
index 000000000..0e8d6cf39
--- /dev/null
+++ b/pixmaps/tb_blank.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_blank_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s iconColor1 m black c #000000",
+". s none m none c none",
+"X s topShadowColor m none c #DCDEE5",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" .",
+" XXXXXXXXXXXXXXX .",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" X.............. o",
+" o",
+"..oooooooooooooooo"};
diff --git a/pixmaps/tb_close.xpm b/pixmaps/tb_close.xpm
new file mode 100644
index 000000000..376db428d
--- /dev/null
+++ b/pixmaps/tb_close.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_close_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". c #880000 m black",
+"X s iconColor1 m black c #000000",
+"o s iconColor3 m black c #FF0000",
+"O s topShadowColor m none c #DCDEE5",
+"+ s iconColor2 m none c #FFFFFF",
+"@ s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ..XXXXXXXXX. ",
+" .oo.OOOOOOO.o. ",
+" .oo.O+OOO.oo. ",
+" .oo.OOO.oo.@ ",
+" X.oo.O.oo.X@ ",
+" XO.oo.oo.+X@ ",
+" XOO.ooo.O+X@ ",
+" XOO.ooo.O+X@ ",
+" XO.oo.oo.+X@ ",
+" X.oo.O.oo.X@ ",
+" .oo.OOO.oo.@ ",
+" .oo.OOOOO.oo. ",
+" .oo.OOOOOOO.oo. ",
+" ..+++++++++.o. ",
+" XXXXXXXXXXX. ",
+" @@@@@@@@@ ",
+" "};
diff --git a/pixmaps/tb_copy.xpm b/pixmaps/tb_copy.xpm
new file mode 100644
index 000000000..43ab4dbd4
--- /dev/null
+++ b/pixmaps/tb_copy.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_copy_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" .......... ",
+" .XXXXXXXX.o ",
+" .X............. ",
+" .XXXX.XXXXXXXX. ",
+" .X....X......X.o ",
+" .XXXX.XXXXXXXX.o ",
+" .X....X......X.o ",
+" .XXXX.XXXXXXXX.o ",
+" .X..X.X......X.o ",
+" .XXXX.XXXXXXXX.o ",
+" ......X..XXXXX.o ",
+" oooo.XXXXXXXX.o ",
+" ..........o ",
+" ooooooooo ",
+" ",
+" "};
diff --git a/pixmaps/tb_ctags.xpm b/pixmaps/tb_ctags.xpm
new file mode 100644
index 000000000..408d453d3
--- /dev/null
+++ b/pixmaps/tb_ctags.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_ctags_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+"O m black c #888800",
+"+ s topShadowColor m none c #DCDEE5",
+"@ s iconColor6 m none c #FFFF00",
+/* pixels */
+" .. ..... ",
+" .XX.XXXXX. ",
+" .XXXXXXXXX. ",
+" .XX.XXXX..X. ",
+" .. ....o .. ",
+" OO++O+...+O+.+ ",
+" Oo@@@@@...o@@@.o",
+" Oo@@@@@@...o@@@.o",
+"Oo@+o+@@@...o@@@.o",
+"O@@o.o@@@...o@@@.o",
+"o@@+o+@@@...o@@@.o",
+"o.@@@@@@@...o@@@.o",
+" o.@@@@@@...o@@@.o",
+" o.........o....o",
+" oooooo...oooooo",
+" ...o ",
+" ...o ",
+" ooo "};
diff --git a/pixmaps/tb_cut.xpm b/pixmaps/tb_cut.xpm
new file mode 100644
index 000000000..3ccf97705
--- /dev/null
+++ b/pixmaps/tb_cut.xpm
@@ -0,0 +1,27 @@
+/* XPM */
+static char * tb_cut_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 3 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" . .X ",
+" .X .X ",
+" . .X ",
+" .X .X ",
+" . .X ",
+" .X.X ",
+" .X ",
+" ...X ",
+" X.X .X ",
+" ...X ... ",
+" .XX.X .X . ",
+" . .X .X .X ",
+" . .X .X .X ",
+" ..XX ..X ",
+" XX XX ",
+" ",
+" "};
diff --git a/pixmaps/tb_exit.xpm b/pixmaps/tb_exit.xpm
new file mode 100644
index 000000000..23d58a317
--- /dev/null
+++ b/pixmaps/tb_exit.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static char * tb_exit_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 9 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+"O s iconColor3 m black c #FF0000",
+"+ s iconGray3 m none c #adadad",
+"@ s iconGray4 m none c #949494",
+"# s iconGray5 m black c #737373",
+"$ s iconGray6 m black c #636363",
+/* pixels */
+" ",
+" ",
+" ........ ",
+" .XXXXXX.o ",
+" .XXXXXX.o ",
+" ...XXXXXX.o ",
+" .O.XXXXXX.o ",
+" ......OO.XX..X.o ",
+" .OOOOOOOO.X..X.o ",
+" .OOOOOOOO.XXXX.o ",
+" ......OO.XXXXX.o ",
+" .O.XXXXX+.o ",
+" ...XXXX++.o ",
+" .XX++@#.o ",
+" .X+@##$.o ",
+" ........o ",
+" ooooooo ",
+" "};
diff --git a/pixmaps/tb_find.xpm b/pixmaps/tb_find.xpm
new file mode 100644
index 000000000..8294e6bb8
--- /dev/null
+++ b/pixmaps/tb_find.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_find_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"O s iconGray2 m none c #bdbdbd",
+"+ s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ......... ",
+" .XXXXXXX.. ",
+" .XXXXXXX.O. ",
+" .XXXXXXX.... ",
+" .XXXXXXXXXX. ",
+" .XXXXXXX.... ",
+" .XXXXXX.OOOO. ",
+" .XXXXX.OXXOOO. ",
+" .XXXXX.OXOOOO. ",
+" .XXXXX.OOOOOO. ",
+" .XXXXX.OOOXOO. ",
+" .XXXXXX.OOOO.+ ",
+" .XXXXXXX....+.. ",
+" .XXXXXXXXXX.+... ",
+" ............+ .. ",
+" ++++++++++ ",
+" "};
diff --git a/pixmaps/tb_find_help.xpm b/pixmaps/tb_find_help.xpm
new file mode 100644
index 000000000..2271e1d49
--- /dev/null
+++ b/pixmaps/tb_find_help.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_find_help_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s bottomShadowColor m black c #5D6069",
+"o s iconGray2 m none c #bdbdbd",
+"O s iconColor2 m none c #FFFFFF",
+/* pixels */
+" ",
+" ",
+" .....X ",
+" .. X..X ",
+" ..X ... ",
+" ..X .... ",
+" X.. .oOOo. ",
+" .oooOoo. ",
+" .OOOOoO. ",
+" ..oOOooo. ",
+" ...oOOo.X ",
+" ....X.. ",
+" ..X ... ",
+" ..X .. ",
+" ..X ",
+" XX ",
+" ",
+" "};
diff --git a/pixmaps/tb_find_next.xpm b/pixmaps/tb_find_next.xpm
new file mode 100644
index 000000000..ef3598a1a
--- /dev/null
+++ b/pixmaps/tb_find_next.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_find_next_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s iconGray2 m none c #bdbdbd",
+"O m black c #880000",
+"+ s bottomShadowColor m black c #5D6069",
+"@ s iconColor3 m black c #FF0000",
+/* pixels */
+" ",
+" ......... ",
+" .XXXXXXX.. ",
+" .XXXXXXX.o. ",
+" .XOXXXXX.... ",
+" +XOOXXXXXXX. ",
+"OOOOO@OXXX.... ",
+"O@@@@@@OX.oooo. ",
+"O@@@@@@@OoXXooo. ",
+"O@@@@@@O.oXoooo. ",
+"OOOOO@OX.oooooo. ",
+" +XOOXX.oooXoo. ",
+" .XOXXXX.oooo.+ ",
+" .XXXXXXX....+.. ",
+" .XXXXXXXXXX.+...",
+" ............+ ..",
+" ++++++++++ ",
+" "};
diff --git a/pixmaps/tb_find_prev.xpm b/pixmaps/tb_find_prev.xpm
new file mode 100644
index 000000000..63fd523b0
--- /dev/null
+++ b/pixmaps/tb_find_prev.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_find_prev_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s iconGray2 m none c #bdbdbd",
+"O s bottomShadowColor m black c #5D6069",
+"+ m black c #880000",
+"@ s iconColor3 m black c #FF0000",
+/* pixels */
+" ",
+" ......... ",
+" .XXXXXXX.. ",
+" .XXXXXXX.o. ",
+" OX+XXXXX.... ",
+" o++XXXXXXXX. ",
+" +@+++++X.... ",
+" +@@@@@@+.oooo. ",
+"+@@@@@@@.oXXooo. ",
+" +@@@@@@.oXoooo. ",
+" +@++++.oooooo. ",
+" o++XXX.oooXoo. ",
+" OX+XXXX.oooo.O ",
+" .XXXXXXX....O.. ",
+" .XXXXXXXXXX.O...",
+" ............O ..",
+" OOOOOOOOOO ",
+" "};
diff --git a/pixmaps/tb_help.xpm b/pixmaps/tb_help.xpm
new file mode 100644
index 000000000..6776e5edd
--- /dev/null
+++ b/pixmaps/tb_help.xpm
@@ -0,0 +1,27 @@
+/* XPM */
+static char * tb_help_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 3 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" .....X ",
+" .. X..X ",
+" ..X ... ",
+" ..X ... ",
+" X.. X..X ",
+" ..X ",
+" .. ",
+" ..X ",
+" ..X ",
+" ",
+" ..X ",
+" ..X ",
+" ..X ",
+" XX ",
+" ",
+" "};
diff --git a/pixmaps/tb_jump.xpm b/pixmaps/tb_jump.xpm
new file mode 100644
index 000000000..6ece5a5ff
--- /dev/null
+++ b/pixmaps/tb_jump.xpm
@@ -0,0 +1,30 @@
+/* XPM */
+static char * tb_jump_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 6 1 0 0",
+/* colors */
+" s none m none c none",
+". m black c #888800",
+"X s bottomShadowColor m black c #5D6069",
+"o s iconColor6 m none c #FFFF00",
+"O s iconColor1 m black c #000000",
+"+ s topShadowColor m none c #DCDEE5",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+" .............. ",
+" .XooooooooooooOX",
+" .XoooooooooooooOX",
+".Xo+X+ooooooooooOX",
+".ooXOXooooooooooOX",
+"Xoo+X+ooooooooooOX",
+"XOooooooooooooooOX",
+" XOoooooooooooooOX",
+" XOOOOOOOOOOOOOOX",
+" XXXXXXXXXXXXXXX",
+" ",
+" ",
+" ",
+" "};
diff --git a/pixmaps/tb_load_session.xpm b/pixmaps/tb_load_session.xpm
new file mode 100644
index 000000000..4e3e92936
--- /dev/null
+++ b/pixmaps/tb_load_session.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static char * tb_load_session_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 9 1 0 0",
+/* colors */
+" s none m none c none",
+". m black c #880000",
+"X s iconColor3 m black c #FF0000",
+"o s iconColor1 m black c #000000",
+"O s iconColor2 m none c #FFFFFF",
+"+ s iconGray2 m none c #bdbdbd",
+"@ s iconGray5 m black c #737373",
+"# s iconGray4 m none c #949494",
+"$ s bottomShadowColor m black c #5D6069",
+/* pixels */
+" .. ",
+" .XX. ",
+" .XXXX. ",
+" ...XX... ",
+" .XX. ",
+" .XX. ",
+" .XX. ",
+" .... ",
+" ooooooooooooo ",
+" oOOOOOOOOOO++@o ",
+" oOOOOOOOOOOOO#@o ",
+" oO+++++++++XX#@o ",
+" oO+++++++++++#@o ",
+" oOoooooooooo+#@o$",
+" oOOOOOOOOOOO+#@o$",
+" o+###########@o$ ",
+" ooooooooooooo$ ",
+" $$$$$$$$$$$ "};
diff --git a/pixmaps/tb_macro.xpm b/pixmaps/tb_macro.xpm
new file mode 100644
index 000000000..b97d11a9d
--- /dev/null
+++ b/pixmaps/tb_macro.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_macro_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s bottomShadowColor m black c #5D6069",
+"o s iconColor2 m none c #FFFFFF",
+/* pixels */
+" ..X ",
+" .oo.X ",
+" .oooo.X ",
+" .oooo.X ",
+" .oo.XX ",
+" ..XX ",
+" .....o.X ",
+" .ooooooo.X ",
+" .oooooooo.X ",
+" .....ooo.X ",
+" ..ooo.X ",
+" .ooooo.X ",
+" .ooooooo.X ",
+" .ooo...ooo.X ",
+" .ooo.XX..ooo.X ",
+" .oo.XX X.oo.X ",
+" ...X X...X ",
+" XX XXX "};
diff --git a/pixmaps/tb_make.xpm b/pixmaps/tb_make.xpm
new file mode 100644
index 000000000..fe812e64a
--- /dev/null
+++ b/pixmaps/tb_make.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_make_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" .. ..... ",
+" .XX.XXXXX. ",
+" .XXXXXXXXX. ",
+" .Xo.XXXX..X. ",
+" .. ....o .. ",
+" ... . ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ...o ",
+" ooo ",
+" "};
diff --git a/pixmaps/tb_maximize.xpm b/pixmaps/tb_maximize.xpm
new file mode 100644
index 000000000..9d601f725
--- /dev/null
+++ b/pixmaps/tb_maximize.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_maximize_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s topShadowColor m none c #DCDEE5",
+"X s iconColor1 m black c #000000",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" .XXXXXXXXXXX ",
+" .X....X...oX ",
+" .X..oXXX..oXO ",
+" .X.oXXXXX.oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .X..XXXXX.oXO ",
+" .X...XXX..oXO ",
+" .XooooXooooXO ",
+" .XXXXXXXXXXXO ",
+" OOOOOOOOOO ",
+" "};
diff --git a/pixmaps/tb_maxwidth.xpm b/pixmaps/tb_maxwidth.xpm
new file mode 100644
index 000000000..03e891b5a
--- /dev/null
+++ b/pixmaps/tb_maxwidth.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_maxwidth_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s topShadowColor m none c #DCDEE5",
+"X s iconColor1 m black c #000000",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+".XXXXXXXXXXXXXXXX ",
+".X.............oX ",
+".X..X........X.oXO",
+".X.XX........XXoXO",
+".XXXX........XXXXO",
+".X.XX........XXoXO",
+".X..X........X.oXO",
+".XooooooooooooooXO",
+".XXXXXXXXXXXXXXXXO",
+" OOOOOOOOOOOOOOO",
+" ",
+" ",
+" ",
+" "};
diff --git a/pixmaps/tb_minimize.xpm b/pixmaps/tb_minimize.xpm
new file mode 100644
index 000000000..2df90a873
--- /dev/null
+++ b/pixmaps/tb_minimize.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_minimize_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s topShadowColor m none c #DCDEE5",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ..... ",
+" ... ",
+" . ",
+" ",
+" X............. ",
+" X.XXXXXXXXXXo. ",
+" X.XXoXXXXXXXo.O ",
+" X.XXXXXXXXXXo.O ",
+" X.XXXXXXXXXoo.O ",
+" X.ooooooooooo.O ",
+" X.............O ",
+" OOOOOOOOOOOO ",
+" ",
+" . ",
+" ... ",
+" ..... ",
+" "};
diff --git a/pixmaps/tb_minwidth.xpm b/pixmaps/tb_minwidth.xpm
new file mode 100644
index 000000000..bb4492887
--- /dev/null
+++ b/pixmaps/tb_minwidth.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_minwidth_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s topShadowColor m none c #DCDEE5",
+"X s iconColor1 m black c #000000",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" .XXXXXX ",
+" .X...oX ",
+" .X...oX ",
+" .X...oX ",
+" X .X.o.oXO X ",
+" XX .X...oXO XX ",
+" XXX .X...oXO XXX ",
+" XX .X...oXO XX ",
+" X .X...oXO X ",
+" .X...oXO ",
+" .X..ooXO ",
+" .XooooXO ",
+" .XXXXXXO ",
+" OOOOO ",
+" ",
+" "};
diff --git a/pixmaps/tb_new.xpm b/pixmaps/tb_new.xpm
new file mode 100644
index 000000000..2d8b6ffba
--- /dev/null
+++ b/pixmaps/tb_new.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_new_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s bottomShadowColor m black c #5D6069",
+"X s iconColor2 m none c #FFFFFF",
+"o s iconColor1 m black c #000000",
+"O s topShadowColor m none c #DCDEE5",
+/* pixels */
+" . .X. ",
+" X. .X. X.",
+" ooooooo.X.oXoX.X",
+" oOOOOOOOoXXXXo..",
+" oOOOOOOOXXXXXXXX",
+" oOOXOOOOoXoXXo..",
+" oOXXOOO.OXoXoX ",
+" oOOOOO.OOXoX..X ",
+" oOOOOOOOOXoX. .X",
+" oOOOOOOOOXo. .",
+" oOOOOOOOOXo. ",
+" oOOOOOOOOXo. ",
+" oOOOOOOOOXo. ",
+" oOOOOOOOOXo. ",
+" oOOOOOOOOXo. ",
+" oXXXXXXXXXo. ",
+" ooooooooooo. ",
+" .......... "};
diff --git a/pixmaps/tb_new_session.xpm b/pixmaps/tb_new_session.xpm
new file mode 100644
index 000000000..78018ddd5
--- /dev/null
+++ b/pixmaps/tb_new_session.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * tb_new_session_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 8 1 0 0",
+/* colors */
+" s none m none c none",
+". s bottomShadowColor m black c #5D6069",
+"X s iconColor2 m none c #FFFFFF",
+"o s iconColor1 m black c #000000",
+"O s iconGray2 m none c #bdbdbd",
+"+ s iconGray5 m black c #737373",
+"@ s iconGray4 m none c #949494",
+"# s iconColor3 m black c #FF0000",
+/* pixels */
+" . .X. . ",
+" . oXo . ",
+" ..oXXXo.. ",
+" XXXXXXXXX ",
+" ..oXXXo.. ",
+" . oXo . ",
+" . .X. . ",
+" . ",
+" ooooooooooooo ",
+" oXXXXXXXXXXOO+o ",
+" oXXXXXXXXXXXX@+o ",
+" oXOOOOOOOOO##@+o ",
+" oXOOOOOOOOOOO@+o ",
+" oXooooooooooO@+o.",
+" oXXXXXXXXXXXO@+o.",
+" oO@@@@@@@@@@@+o. ",
+" ooooooooooooo. ",
+" ........... "};
diff --git a/pixmaps/tb_open.xpm b/pixmaps/tb_open.xpm
new file mode 100644
index 000000000..c71a6cff5
--- /dev/null
+++ b/pixmaps/tb_open.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_open_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s bottomShadowColor m black c #5D6069",
+"o s iconColor2 m none c #FFFFFF",
+"O s iconGray1 m none c #dedede",
+"+ s iconGray5 m black c #737373",
+"@ s iconGray3 m none c #adadad",
+/* pixels */
+" ",
+" .........X ",
+" .oooooo.o.X ",
+" .oooooo.oo.X ",
+" .oooooo....X ",
+" ...ooooooooo... ",
+" .O.OOOOOOOOo.+. ",
+".............O.+.X",
+".oooooooooooo..+.X",
+" .o@@@@@@@@@@+.+.X",
+" .o@@@@@@@@@@@.+.X",
+" .o@@@@@@@@@@+..X",
+" .o@@@@@@@@@@@..X",
+" .o+++++++++++.X",
+" ..............X",
+" XXXXXXXXXXXXX",
+" ",
+" "};
diff --git a/pixmaps/tb_paste.xpm b/pixmaps/tb_paste.xpm
new file mode 100644
index 000000000..ddea2b93f
--- /dev/null
+++ b/pixmaps/tb_paste.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_paste_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconGray5 m black c #737373",
+"o s iconGray2 m none c #bdbdbd",
+"O s bottomShadowColor m black c #5D6069",
+"+ s iconGray4 m none c #949494",
+"@ s iconColor2 m none c #FFFFFF",
+/* pixels */
+" ",
+" .... ",
+" XXXX ",
+" ...oooo...O ",
+" .o+......++.O ",
+" .o+++++++++.O ",
+" .o+++.......... ",
+" .o+++.@@@@@@@@. ",
+" .o+++.@......@.O ",
+" .o+++.@@@@@@@@.O ",
+" .o+++.@@@@@@@@.O ",
+" .o+++.@......@.O ",
+" .o+++.@@@@@@@@.O ",
+" .....@..@@@@@.O ",
+" OOO.@@@@@@@@.O ",
+" ..........O ",
+" OOOOOOOOO ",
+" "};
diff --git a/pixmaps/tb_print.xpm b/pixmaps/tb_print.xpm
new file mode 100644
index 000000000..a3a4756b1
--- /dev/null
+++ b/pixmaps/tb_print.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+static char * tb_print_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 7 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s iconGray2 m none c #bdbdbd",
+"O s iconGray5 m black c #737373",
+"+ s bottomShadowColor m black c #5D6069",
+"@ c #FF1144",
+/* pixels */
+" ....... ",
+" .XXXXX.. ",
+" .X...X.X. ",
+" .XXXXX.... ",
+" .X...XXXX.O ",
+" .XXXXXXXX.O ",
+" .X.....XX.O ",
+" .XXXXXXXX.O ",
+"................ ",
+".XXXXXXXXXXXXXO. ",
+".X@@ooooooooooO.O ",
+".XooooooooooooO.O ",
+".XooooooooooooO.O ",
+"................O ",
+" .OOOOOOOOOOOO.OO ",
+" ..............O ",
+" OOOOOOOOOOOOO ",
+" "};
diff --git a/pixmaps/tb_redo.xpm b/pixmaps/tb_redo.xpm
new file mode 100644
index 000000000..a0c10b77f
--- /dev/null
+++ b/pixmaps/tb_redo.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_redo_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" ..... .. ",
+" ..XXXXX..X.o ",
+" .XXXXXXXXXX.o ",
+" .XX....XXXX.o ",
+" .XX.ooo.XXXX.o ",
+" .XX.o .XXXXX.o ",
+" .XX.o .......o ",
+" .XX.o ooo.ooo ",
+" .XX.o .X. ",
+" .XX.....XX.o ",
+" .XXXXXXXX.oo ",
+" ..XXXXX.oo ",
+" .....oo ",
+" ooooo ",
+" ",
+" "};
diff --git a/pixmaps/tb_replace.xpm b/pixmaps/tb_replace.xpm
new file mode 100644
index 000000000..489cf8e25
--- /dev/null
+++ b/pixmaps/tb_replace.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static char * tb_replace_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 9 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+"+ s iconGray4 m none c #949494",
+"@ s iconColor3 m black c #FF0000",
+"# s iconGray3 m none c #adadad",
+"$ s iconGray1 m none c #dedede",
+"% s iconGray7 m black c #424242",
+/* pixels */
+" ",
+" ......... ",
+" .XXXXXXX.. ",
+" .X..XXXX.X. ",
+" oX..oXXX.... ",
+" o.X..XXXXXX. ",
+" +....oXXXXX.o ",
+" .XXX..XXXXX.o ",
+" ..oXo...XXXX.o ",
+" +XXXXXXXXXX+o ",
+" .X@@XX@XXX.... ",
+" .Xo@XX@@XX.#$.. ",
+" .XXo@@@@@X.... ",
+" .XXXXX@@XX.#$.. ",
+" .XXXXX@XXX.#$.. ",
+" ......o..%.... ",
+" ooooooooo ",
+" "};
diff --git a/pixmaps/tb_save.xpm b/pixmaps/tb_save.xpm
new file mode 100644
index 000000000..323a841ec
--- /dev/null
+++ b/pixmaps/tb_save.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_save_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconGray2 m none c #bdbdbd",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" .............. ",
+" .X.oooooooo.o. ",
+" .X.oooooooo...O ",
+" .X.oooooooo.X.O ",
+" .X.oooooooo.X.O ",
+" .X.oooooooo.X.O ",
+" .X.oooooooo.X.O ",
+" .XX........XX.O ",
+" .XXXXXXXXXXXX.O ",
+" .XX.........X.O ",
+" .XX......oo.X.O ",
+" .XX......oo.X.O ",
+" .XX......oo.X.O ",
+" .............O ",
+" OOOOOOOOOOOOO ",
+" ",
+" "};
diff --git a/pixmaps/tb_save_all.xpm b/pixmaps/tb_save_all.xpm
new file mode 100644
index 000000000..cbb413073
--- /dev/null
+++ b/pixmaps/tb_save_all.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_save_all_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s iconColor1 m black c #000000",
+". s none m none c none",
+"X s iconGray2 m none c #bdbdbd",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ....",
+" X oooooooo o ....",
+" X oooooooo O...",
+" X .",
+" X X oooooooo o .",
+" X X oooooooo O",
+" X X oooooooo X O",
+" XX X oooooooo X O",
+" XX X oooooooo X O",
+" XX X oooooooo X O",
+" XX XX XX O",
+" XX XXXXXXXXXXXX O",
+" XX XX X O",
+". XX oo X O",
+"..O XX oo X O",
+"... XX oo X O",
+".... O",
+".....OOOOOOOOOOOO."};
diff --git a/pixmaps/tb_save_session.xpm b/pixmaps/tb_save_session.xpm
new file mode 100644
index 000000000..9bacd0a66
--- /dev/null
+++ b/pixmaps/tb_save_session.xpm
@@ -0,0 +1,33 @@
+/* XPM */
+static char * tb_save_session_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 9 1 0 0",
+/* colors */
+" s none m none c none",
+". m black c #880000",
+"X s iconColor3 m black c #FF0000",
+"o s iconColor1 m black c #000000",
+"O s iconColor2 m none c #FFFFFF",
+"+ s iconGray2 m none c #bdbdbd",
+"@ s iconGray5 m black c #737373",
+"# s iconGray4 m none c #949494",
+"$ s bottomShadowColor m black c #5D6069",
+/* pixels */
+" .... ",
+" .XX. ",
+" .XX. ",
+" .XX. ",
+" ...XX... ",
+" .XXXX. ",
+" .XX. ",
+" .. ",
+" ooooooooooooo ",
+" oOOOOOOOOOO++@o ",
+" oOOOOOOOOOOOO#@o ",
+" oO+++++++++XX#@o ",
+" oO+++++++++++#@o ",
+" oOoooooooooo+#@o$",
+" oOOOOOOOOOOO+#@o$",
+" o+###########@o$ ",
+" ooooooooooooo$ ",
+" $$$$$$$$$$$ "};
diff --git a/pixmaps/tb_shell.xpm b/pixmaps/tb_shell.xpm
new file mode 100644
index 000000000..29c6bdeb2
--- /dev/null
+++ b/pixmaps/tb_shell.xpm
@@ -0,0 +1,30 @@
+/* XPM */
+static char * tb_shell_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 6 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconGray6 m black c #636363",
+"o s iconGray2 m none c #bdbdbd",
+"O s iconColor2 m none c #FFFFFF",
+"+ s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ... ... ",
+" .XoXXXoX. ",
+" .oOoX.XoOo. ",
+" .XoOoXoOoX. ",
+" .Xoooo.ooooX. ",
+" .Xo.XOoXoOX.oX. ",
+" .oooXOo.oOXooo. ",
+" .oOo.XOXOX.oOo.+ ",
+" .XoOo.o.o.oOoX.+ ",
+" .XooXoooXoOX.+ ",
+" .XoooOoooX.+ ",
+" .ooOOOoo.+ ",
+" ..XoooX..+ ",
+" .XoooooooX.+ ",
+" ...........+ ",
+" ++++++++++ ",
+" "};
diff --git a/pixmaps/tb_split.xpm b/pixmaps/tb_split.xpm
new file mode 100644
index 000000000..6440dbb24
--- /dev/null
+++ b/pixmaps/tb_split.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_split_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s topShadowColor m none c #DCDEE5",
+"X s iconColor1 m black c #000000",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" .XXXXXXXXXXX ",
+" .X........oX ",
+" .X..o.....oXO ",
+" .X.oo.....oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .XoooooooooXO ",
+" .XXXXXXXXXXXO ",
+" .XOOOOOOOOoXO ",
+" .X..o.....oXO ",
+" .X.oo.....oXO ",
+" .X........oXO ",
+" .X........oXO ",
+" .XoooooooooXO ",
+" .XXXXXXXXXXXO ",
+" OOOOOOOOOO ",
+" "};
diff --git a/pixmaps/tb_undo.xpm b/pixmaps/tb_undo.xpm
new file mode 100644
index 000000000..ab4ecac4a
--- /dev/null
+++ b/pixmaps/tb_undo.xpm
@@ -0,0 +1,28 @@
+/* XPM */
+static char * tb_undo_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 4 1 0 0",
+/* colors */
+" s none m none c none",
+". s iconColor1 m black c #000000",
+"X s iconColor2 m none c #FFFFFF",
+"o s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" ",
+" .. ..... ",
+" .X..XXXXX.. ",
+" .XXXXXXXXXX. ",
+" .XXXX....XX.o ",
+" .XXXX.ooo.XX. ",
+" .XXXXX. .XX.o ",
+" .......o .XX.o ",
+" o.ooooo .XX.o ",
+" .X. .XX.o ",
+" .XX.....XX.oo ",
+" .XXXXXXXX.o ",
+" .XXXXX..oo ",
+" .....ooo ",
+" ooooo ",
+" ",
+" "};
diff --git a/pixmaps/tb_vsplit.xpm b/pixmaps/tb_vsplit.xpm
new file mode 100644
index 000000000..e374afc51
--- /dev/null
+++ b/pixmaps/tb_vsplit.xpm
@@ -0,0 +1,29 @@
+/* XPM */
+static char * tb_vsplit_xpm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"18 18 5 1 0 0",
+/* colors */
+" s none m none c none",
+". s topShadowColor m none c #DCDEE5",
+"X s iconColor1 m black c #000000",
+"o s iconColor2 m none c #FFFFFF",
+"O s bottomShadowColor m black c #5D6069",
+/* pixels */
+" ",
+" .XXXXXXXXXXXXXX ",
+" .X....oXO....oX ",
+" .X..o.oXO..o.oXO ",
+" .X.oo.oXO.oo.oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .X....oXO....oXO ",
+" .XoooooXooooooXO ",
+" .XXXXXXXXXXXXXXO ",
+" OOOOOOOOOOOOO ",
+" "};
diff --git a/runtime.info b/runtime.info
new file mode 100755
index 000000000..6ff0468ea
--- /dev/null
+++ b/runtime.info
Binary files differ
diff --git a/runtime/bugreport.vim b/runtime/bugreport.vim
new file mode 100644
index 000000000..a6c36b979
--- /dev/null
+++ b/runtime/bugreport.vim
@@ -0,0 +1,86 @@
+:" Use this script to create the file "bugreport.txt", which contains
+:" information about the environment of a possible bug in Vim.
+:"
+:" Maintainer: Bram Moolenaar <Bram@vim.org>
+:" Last change: 2001 Feb 02
+:"
+:" To use inside Vim:
+:" :so $VIMRUNTIME/bugreport.vim
+:" Or, from the command line:
+:" vim -s $VIMRUNTIME/bugreport.vim
+:"
+:" The "if 1" lines are to avoid error messages when expression evaluation is
+:" not compiled in.
+:"
+:if 1
+: let more_save = &more
+:endif
+:set nomore
+:if has("unix")
+: !echo "uname -a" >bugreport.txt
+: !uname -a >>bugreport.txt
+:endif
+:redir >>bugreport.txt
+:version
+:if 1
+: func <SID>CheckDir(n)
+: if isdirectory(a:n)
+: echo 'directory "' . a:n . '" exists'
+: else
+: echo 'directory "' . a:n . '" does NOT exist'
+: endif
+: endfun
+: func <SID>CheckFile(n)
+: if filereadable(a:n)
+: echo '"' . a:n . '" is readable'
+: else
+: echo '"' . a:n . '" is NOT readable'
+: endif
+: endfun
+: echo "--- Directories and Files ---"
+: echo '$VIM = "' . $VIM . '"'
+: call <SID>CheckDir($VIM)
+: echo '$VIMRUNTIME = "' . $VIMRUNTIME . '"'
+: call <SID>CheckDir($VIMRUNTIME)
+: call <SID>CheckFile(&helpfile)
+: call <SID>CheckFile(fnamemodify(&helpfile, ":h") . "/tags")
+: call <SID>CheckFile($VIMRUNTIME . "/menu.vim")
+: call <SID>CheckFile($VIMRUNTIME . "/filetype.vim")
+: call <SID>CheckFile($VIMRUNTIME . "/syntax/synload.vim")
+: delfun <SID>CheckDir
+: delfun <SID>CheckFile
+:endif
+:set all
+:set termcap
+:if has("autocmd")
+: au
+:endif
+:if 1
+: echo "--- Normal/Visual mode mappings ---"
+:endif
+:map
+:if 1
+: echo "--- Insert/Command-line mode mappings ---"
+:endif
+:map!
+:if 1
+: echo "--- Abbreviations ---"
+:endif
+:ab
+:if 1
+: echo "--- Highlighting ---"
+:endif
+:highlight
+:if 1
+: echo "--- Variables ---"
+:endif
+:if 1
+: let
+:endif
+:redir END
+:set more&
+:if 1
+: let &more = more_save
+: unlet more_save
+:endif
+:e bugreport.txt
diff --git a/runtime/colors/README.txt b/runtime/colors/README.txt
new file mode 100644
index 000000000..0bd84842d
--- /dev/null
+++ b/runtime/colors/README.txt
@@ -0,0 +1,61 @@
+README.txt for color scheme files
+
+These files are used for the ":colorscheme" command. They appear in the
+Edit/Color Scheme menu in the GUI.
+
+
+Hints for writing a color scheme file:
+
+There are two basic ways to define a color scheme:
+
+1. Define a new Normal color and set the 'background' option accordingly.
+ set background={light or dark}
+ highlight clear
+ highlight Normal ...
+ ...
+
+2. Use the default Normal color and automatically adjust to the value of
+ 'background'.
+ highlight clear Normal
+ set background&
+ highlight clear
+ if &background == "light"
+ highlight Error ...
+ ...
+ else
+ highlight Error ...
+ ...
+ endif
+
+You can use ":highlight clear" to reset everything to the defaults, and then
+change the groups that you want differently. This also will work for groups
+that are added in later versions of Vim.
+Note that ":highlight clear" uses the value of 'background', thus set it
+before this command.
+Some attributes (e.g., bold) might be set in the defaults that you want
+removed in your color scheme. Use something like "gui=NONE" to remove the
+attributes.
+
+To see which highlight group is used where, find the help for
+"highlight-groups" and "group-name".
+
+You can use ":highlight" to find out the current colors. Exception: the
+ctermfg and ctermbg values are numbers, which are only valid for the current
+terminal. Use the color names instead. See ":help cterm-colors".
+
+The default color settings can be found in the source file src/syntax.c.
+Search for "highlight_init".
+
+If you think you have a color scheme that is good enough to be used by others,
+please check the following items:
+
+- Does it work in a color terminal as well as in the GUI?
+- Is 'background' either used or appropriately set to "light" or "dark"?
+- Try setting 'hlsearch' and searching for a pattern, is the match easy to
+ spot?
+- Split a window with ":split" and ":vsplit". Are the status lines and
+ vertical separators clearly visible?
+- In the GUI, is it easy to find the cursor, also in a file with lots of
+ syntax highlighting?
+- Do not use hard coded escape sequences, these will not work in other
+ terminals. Always use color names or #RRGGBB for the GUI.
diff --git a/runtime/colors/blue.vim b/runtime/colors/blue.vim
new file mode 100644
index 000000000..dcfe3d783
--- /dev/null
+++ b/runtime/colors/blue.vim
@@ -0,0 +1,77 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Steven Vertigan <steven@vertigan.wattle.id.au>
+" Last Change: 2003 May 11
+" Revision #4: Support for new "Underline" group. Removed superfluous html
+" formatting.
+
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "blue"
+hi Normal guifg=white guibg=darkBlue
+hi Normal ctermfg=white ctermbg=darkBlue
+hi NonText guifg=magenta ctermfg=lightMagenta
+hi comment guifg=gray gui=bold
+hi comment ctermfg=gray
+hi constant guifg=cyan ctermfg=cyan
+hi identifier guifg=gray ctermfg=gray
+hi statement guifg=yellow gui=none ctermfg=yellow
+hi preproc guifg=green ctermfg=green
+hi type guifg=orange ctermfg=darkYellow
+hi special guifg=magenta ctermfg=lightMagenta
+hi Underlined guifg=cyan ctermfg=cyan
+hi Underlined gui=underline cterm=underline
+
+hi ErrorMsg guifg=orange guibg=darkBlue
+hi ErrorMsg ctermfg=lightRed
+hi WarningMsg guifg=cyan guibg=darkBlue gui=bold
+hi WarningMsg ctermfg=cyan
+hi ModeMsg guifg=yellow gui=NONE
+hi ModeMsg ctermfg=yellow
+hi MoreMsg guifg=yellow gui=NONE
+hi MoreMsg ctermfg=yellow
+hi Error guifg=red guibg=darkBlue gui=underline
+hi Error ctermfg=red
+
+hi Todo guifg=black guibg=orange
+hi Todo ctermfg=black ctermbg=darkYellow
+hi Cursor guifg=black guibg=white
+hi Cursor ctermfg=black ctermbg=white
+hi Search guifg=black guibg=orange
+hi Search ctermfg=black ctermbg=darkYellow
+hi IncSearch guifg=black guibg=yellow
+hi IncSearch ctermfg=black ctermbg=darkYellow
+hi LineNr guifg=pink ctermfg=lightMagenta
+hi title guifg=white gui=bold cterm=bold
+
+hi StatusLineNC gui=NONE guifg=black guibg=blue
+hi StatusLineNC ctermfg=black ctermbg=blue
+hi StatusLine gui=bold guifg=cyan guibg=blue
+hi StatusLine ctermfg=cyan ctermbg=blue
+
+hi label guifg=yellow ctermfg=yellow
+hi operator guifg=orange gui=bold ctermfg=darkYellow
+hi clear Visual
+hi Visual term=reverse
+hi Visual ctermfg=black ctermbg=darkCyan
+hi Visual guifg=black guibg=darkCyan
+
+hi DiffChange guibg=darkGreen guifg=black
+hi DiffChange ctermbg=darkGreen ctermfg=black
+hi DiffText guibg=olivedrab guifg=black
+hi DiffText ctermbg=lightGreen ctermfg=black
+hi DiffAdd guibg=slateblue guifg=black
+hi DiffAdd ctermbg=blue ctermfg=black
+hi DiffDelete guibg=coral guifg=black
+hi DiffDelete ctermbg=cyan ctermfg=black
+
+hi Folded guibg=orange guifg=black
+hi Folded ctermbg=yellow ctermfg=black
+hi FoldColumn guibg=gray30 guifg=black
+hi FoldColumn ctermbg=gray ctermfg=black
+hi cIf0 guifg=gray ctermfg=gray
+
diff --git a/runtime/colors/darkblue.vim b/runtime/colors/darkblue.vim
new file mode 100644
index 000000000..9e004d3f6
--- /dev/null
+++ b/runtime/colors/darkblue.vim
@@ -0,0 +1,62 @@
+" Vim color file
+" Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua>
+" Last Change: 2002 Mar 09
+
+" darkblue -- for those who prefer dark background
+" [note: looks bit uglier with come terminal palettes,
+" but is fine on default linux console palette.]
+
+set bg=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "darkblue"
+
+hi Normal guifg=#c0c0c0 guibg=#000040 ctermfg=gray ctermbg=black
+hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=lightblue
+hi Visual guifg=#8080ff guibg=fg gui=reverse ctermfg=lightblue ctermbg=fg cterm=reverse
+hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline
+hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue
+hi Search guifg=#90fff0 guibg=#2050d0 ctermfg=white ctermbg=darkblue cterm=underline term=underline
+hi IncSearch guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray
+
+hi SpecialKey guifg=cyan ctermfg=darkcyan
+hi Directory guifg=cyan ctermfg=cyan
+hi Title guifg=magenta gui=none ctermfg=magenta cterm=bold
+hi WarningMsg guifg=red ctermfg=red
+hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none
+hi ModeMsg guifg=#22cce2 ctermfg=lightblue
+hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen
+hi Question guifg=green gui=none ctermfg=green cterm=none
+hi NonText guifg=#0030ff ctermfg=darkblue
+
+hi StatusLine guifg=blue guibg=darkgray gui=none ctermfg=blue ctermbg=gray term=none cterm=none
+hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
+
+hi Folded guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+hi FoldColumn guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
+hi LineNr guifg=#90f020 ctermfg=green cterm=none
+
+hi DiffAdd guibg=darkblue ctermbg=darkblue term=none cterm=none
+hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none
+hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
+hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red
+
+hi Cursor guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown
+hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen
+
+
+hi Comment guifg=#80a0ff ctermfg=darkred
+hi Constant ctermfg=magenta guifg=#ffa0a0 cterm=none
+hi Special ctermfg=brown guifg=Orange cterm=none gui=none
+hi Identifier ctermfg=cyan guifg=#40ffff cterm=none
+hi Statement ctermfg=yellow cterm=none guifg=#ffff60 gui=none
+hi PreProc ctermfg=magenta guifg=#ff80ff gui=none cterm=none
+hi type ctermfg=green guifg=#60ff60 gui=none cterm=none
+hi Underlined cterm=underline term=underline
+hi Ignore guifg=bg ctermfg=bg
+
+
diff --git a/runtime/colors/default.vim b/runtime/colors/default.vim
new file mode 100644
index 000000000..70311571d
--- /dev/null
+++ b/runtime/colors/default.vim
@@ -0,0 +1,23 @@
+" Vim color file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jul 23
+
+" This is the default color scheme. It doesn't define the Normal
+" highlighting, it uses whatever the colors used to be.
+
+" Set 'background' back to the default. The value can't always be estimated
+" and is then guessed.
+hi clear Normal
+set bg&
+
+" Remove all existing highlighting and set the defaults.
+hi clear
+
+" Load the syntax highlighting defaults, if it's enabled.
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "default"
+
+" vim: sw=2
diff --git a/runtime/colors/delek.vim b/runtime/colors/delek.vim
new file mode 100644
index 000000000..ac7065095
--- /dev/null
+++ b/runtime/colors/delek.vim
@@ -0,0 +1,57 @@
+" Vim color file
+" Maintainer: David Schweikert <dws@ee.ethz.ch>
+" Last Change: 2004 May 16
+
+" First remove all existing highlighting.
+hi clear
+
+let colors_name = "delek"
+
+hi Normal guifg=Black guibg=white
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi ModeMsg term=bold cterm=bold gui=bold
+hi VertSplit term=reverse cterm=reverse gui=reverse
+hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
+hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
+hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
+hi Cursor guibg=Green guifg=NONE
+hi lCursor guibg=Cyan guifg=NONE
+hi Directory term=bold ctermfg=DarkBlue guifg=Blue
+hi LineNr term=underline ctermfg=Brown guifg=Brown
+hi MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi Search term=reverse ctermbg=Yellow ctermfg=NONE guibg=Yellow guifg=NONE
+hi SpecialKey term=bold ctermfg=DarkBlue guifg=Blue
+hi Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta
+hi WarningMsg term=standout ctermfg=DarkRed guifg=Red
+hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
+hi FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
+hi DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue
+hi DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta
+hi DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan
+
+hi StatusLine cterm=bold ctermbg=blue ctermfg=yellow guibg=gold guifg=blue
+hi StatusLineNC cterm=bold ctermbg=blue ctermfg=black guibg=gold guifg=blue
+hi NonText term=bold ctermfg=Blue gui=bold guifg=gray guibg=white
+hi Cursor guibg=fg guifg=bg
+
+" syntax highlighting
+hi PreProc term=underline cterm=NONE ctermfg=darkmagenta gui=NONE guifg=magenta3
+hi Identifier term=underline cterm=NONE ctermfg=darkcyan gui=NONE guifg=cyan4
+hi Comment term=NONE cterm=NONE ctermfg=darkred gui=NONE guifg=red2
+hi Constant term=underline cterm=NONE ctermfg=darkgreen gui=NONE guifg=green3
+hi Special term=bold cterm=NONE ctermfg=lightred gui=NONE guifg=deeppink
+hi Statement term=bold cterm=bold ctermfg=blue gui=bold guifg=blue
+hi Type term=underline cterm=NONE ctermfg=blue gui=bold guifg=blue
+
+if exists("syntax_on")
+ let syntax_cmd = "enable"
+ runtime syntax/syncolor.vim
+ unlet syntax_cmd
+endif
+
+" vim: sw=2
diff --git a/runtime/colors/desert.vim b/runtime/colors/desert.vim
new file mode 100644
index 000000000..cdde62b1a
--- /dev/null
+++ b/runtime/colors/desert.vim
@@ -0,0 +1,108 @@
+" Vim color file
+" Maintainer: Hans Fugal <hans@fugal.net>
+" Last Change: $Date$
+" Last Change: $Date$
+" URL: http://hans.fugal.net/vim/colors/desert.vim
+" Version: $Id$
+
+" cool help screens
+" :he group-name
+" :he highlight-groups
+" :he cterm-colors
+
+set background=dark
+if version > 580
+ " no guarantees for version 5.8 and below, but this makes it stop
+ " complaining
+ hi clear
+ if exists("syntax_on")
+ syntax reset
+ endif
+endif
+let g:colors_name="desert"
+
+hi Normal guifg=White guibg=grey20
+
+" highlight groups
+hi Cursor guibg=khaki guifg=slategrey
+"hi CursorIM
+"hi Directory
+"hi DiffAdd
+"hi DiffChange
+"hi DiffDelete
+"hi DiffText
+"hi ErrorMsg
+hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none
+hi Folded guibg=grey30 guifg=gold
+hi FoldColumn guibg=grey30 guifg=tan
+hi IncSearch guifg=slategrey guibg=khaki
+"hi LineNr
+hi ModeMsg guifg=goldenrod
+hi MoreMsg guifg=SeaGreen
+hi NonText guifg=LightBlue guibg=grey30
+hi Question guifg=springgreen
+hi Search guibg=peru guifg=wheat
+hi SpecialKey guifg=yellowgreen
+hi StatusLine guibg=#c2bfa5 guifg=black gui=none
+hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none
+hi Title guifg=indianred
+hi Visual gui=none guifg=khaki guibg=olivedrab
+"hi VisualNOS
+hi WarningMsg guifg=salmon
+"hi WildMenu
+"hi Menu
+"hi Scrollbar
+"hi Tooltip
+
+" syntax highlighting groups
+hi Comment guifg=SkyBlue
+hi Constant guifg=#ffa0a0
+hi Identifier guifg=palegreen
+hi Statement guifg=khaki
+hi PreProc guifg=indianred
+hi Type guifg=darkkhaki
+hi Special guifg=navajowhite
+"hi Underlined
+hi Ignore guifg=grey40
+"hi Error
+hi Todo guifg=orangered guibg=yellow2
+
+" color terminal definitions
+hi SpecialKey ctermfg=darkgreen
+hi NonText cterm=bold ctermfg=darkblue
+hi Directory ctermfg=darkcyan
+hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
+hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
+hi Search cterm=NONE ctermfg=grey ctermbg=blue
+hi MoreMsg ctermfg=darkgreen
+hi ModeMsg cterm=NONE ctermfg=brown
+hi LineNr ctermfg=3
+hi Question ctermfg=green
+hi StatusLine cterm=bold,reverse
+hi StatusLineNC cterm=reverse
+hi VertSplit cterm=reverse
+hi Title ctermfg=5
+hi Visual cterm=reverse
+hi VisualNOS cterm=bold,underline
+hi WarningMsg ctermfg=1
+hi WildMenu ctermfg=0 ctermbg=3
+hi Folded ctermfg=darkgrey ctermbg=NONE
+hi FoldColumn ctermfg=darkgrey ctermbg=NONE
+hi DiffAdd ctermbg=4
+hi DiffChange ctermbg=5
+hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
+hi DiffText cterm=bold ctermbg=1
+hi Comment ctermfg=darkcyan
+hi Constant ctermfg=brown
+hi Special ctermfg=5
+hi Identifier ctermfg=6
+hi Statement ctermfg=3
+hi PreProc ctermfg=5
+hi Type ctermfg=2
+hi Underlined cterm=underline ctermfg=5
+hi Ignore cterm=bold ctermfg=7
+hi Ignore ctermfg=darkgrey
+hi Error cterm=bold ctermfg=7 ctermbg=1
+
+
+"vim: sw=4
diff --git a/runtime/colors/elflord.vim b/runtime/colors/elflord.vim
new file mode 100644
index 000000000..f74a82894
--- /dev/null
+++ b/runtime/colors/elflord.vim
@@ -0,0 +1,50 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "elflord"
+hi Normal guifg=cyan guibg=black
+hi Comment term=bold ctermfg=DarkCyan guifg=#80a0ff
+hi Constant term=underline ctermfg=Magenta guifg=Magenta
+hi Special term=bold ctermfg=DarkMagenta guifg=Red
+hi Identifier term=underline cterm=bold ctermfg=Cyan guifg=#40ffff
+hi Statement term=bold ctermfg=Yellow gui=bold guifg=#aa4444
+hi PreProc term=underline ctermfg=LightBlue guifg=#ff80ff
+hi Type term=underline ctermfg=LightGreen guifg=#60ff60 gui=bold
+hi Function term=bold ctermfg=White guifg=White
+hi Repeat term=underline ctermfg=White guifg=white
+hi Operator ctermfg=Red guifg=Red
+hi Ignore ctermfg=black guifg=bg
+hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
+hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
+
+" Common groups that link to default highlighting.
+" You can specify other highlighting easily.
+hi link String Constant
+hi link Character Constant
+hi link Number Constant
+hi link Boolean Constant
+hi link Float Number
+hi link Conditional Repeat
+hi link Label Statement
+hi link Keyword Statement
+hi link Exception Statement
+hi link Include PreProc
+hi link Define PreProc
+hi link Macro PreProc
+hi link PreCondit PreProc
+hi link StorageClass Type
+hi link Structure Type
+hi link Typedef Type
+hi link Tag Special
+hi link SpecialChar Special
+hi link Delimiter Special
+hi link SpecialComment Special
+hi link Debug Special
diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim
new file mode 100644
index 000000000..e72f00d5d
--- /dev/null
+++ b/runtime/colors/evening.vim
@@ -0,0 +1,54 @@
+" Vim color file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 May 21
+
+" This color scheme uses a dark grey background.
+
+" First remove all existing highlighting.
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "evening"
+
+hi Normal ctermbg=DarkGrey ctermfg=White guifg=White guibg=grey20
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi ModeMsg term=bold cterm=bold gui=bold
+hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
+hi StatusLineNC term=reverse cterm=reverse gui=reverse
+hi VertSplit term=reverse cterm=reverse gui=reverse
+hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
+hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
+hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
+hi Cursor guibg=Green guifg=Black
+hi lCursor guibg=Cyan guifg=Black
+hi Directory term=bold ctermfg=LightCyan guifg=Cyan
+hi LineNr term=underline ctermfg=Yellow guifg=Yellow
+hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
+hi NonText term=bold ctermfg=LightBlue gui=bold guifg=LightBlue guibg=grey30
+hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green
+hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
+hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta
+hi WarningMsg term=standout ctermfg=LightRed guifg=Red
+hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
+hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
+hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
+hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta
+hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan
+
+" Groups for syntax highlighting
+hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
+hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
+if &t_Co > 8
+ hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
+endif
+hi Ignore ctermfg=DarkGrey guifg=grey20
+
+" vim: sw=2
diff --git a/runtime/colors/koehler.vim b/runtime/colors/koehler.vim
new file mode 100644
index 000000000..1a8800185
--- /dev/null
+++ b/runtime/colors/koehler.vim
@@ -0,0 +1,64 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+hi clear
+set background=dark
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "koehler"
+hi Normal guifg=white guibg=black
+hi Scrollbar guifg=darkcyan guibg=cyan
+hi Menu guifg=black guibg=cyan
+hi SpecialKey term=bold cterm=bold ctermfg=darkred guifg=Blue
+hi NonText term=bold cterm=bold ctermfg=darkred gui=bold guifg=Blue
+hi Directory term=bold cterm=bold ctermfg=brown guifg=Blue
+hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=blue guifg=White guibg=Red
+hi Search term=reverse ctermfg=white ctermbg=red guifg=white guibg=Red
+hi MoreMsg term=bold cterm=bold ctermfg=darkgreen gui=bold guifg=SeaGreen
+hi ModeMsg term=bold cterm=bold gui=bold guifg=White guibg=Blue
+hi LineNr term=underline cterm=bold ctermfg=darkcyan guifg=Yellow
+hi Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=Green
+hi StatusLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guifg=blue guibg=white
+hi StatusLineNC term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
+hi Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=Magenta
+hi Visual term=reverse cterm=reverse gui=reverse
+hi WarningMsg term=standout cterm=bold ctermfg=darkblue guifg=Red
+hi Cursor guifg=bg guibg=Green
+hi Comment term=bold cterm=bold ctermfg=cyan guifg=#80a0ff
+hi Constant term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0
+hi Special term=bold cterm=bold ctermfg=red guifg=Orange
+hi Identifier term=underline ctermfg=brown guifg=#40ffff
+hi Statement term=bold cterm=bold ctermfg=yellow gui=bold guifg=#ffff60
+hi PreProc term=underline ctermfg=darkblue guifg=#ff80ff
+hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60
+hi Error term=reverse ctermfg=darkcyan ctermbg=black guifg=Red guibg=Black
+hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow
+hi link IncSearch Visual
+hi link String Constant
+hi link Character Constant
+hi link Number Constant
+hi link Boolean Constant
+hi link Float Number
+hi link Function Identifier
+hi link Conditional Statement
+hi link Repeat Statement
+hi link Label Statement
+hi link Operator Statement
+hi link Keyword Statement
+hi link Exception Statement
+hi link Include PreProc
+hi link Define PreProc
+hi link Macro PreProc
+hi link PreCondit PreProc
+hi link StorageClass Type
+hi link Structure Type
+hi link Typedef Type
+hi link Tag Special
+hi link SpecialChar Special
+hi link Delimiter Special
+hi link SpecialComment Special
+hi link Debug Special
diff --git a/runtime/colors/morning.vim b/runtime/colors/morning.vim
new file mode 100644
index 000000000..bcdaa1d17
--- /dev/null
+++ b/runtime/colors/morning.vim
@@ -0,0 +1,54 @@
+" Vim color file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 May 21
+
+" This color scheme uses a light grey background.
+
+" First remove all existing highlighting.
+set background=light
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "morning"
+
+hi Normal ctermfg=Black ctermbg=LightGrey guifg=Black guibg=grey90
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi ModeMsg term=bold cterm=bold gui=bold
+hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
+hi StatusLineNC term=reverse cterm=reverse gui=reverse
+hi VertSplit term=reverse cterm=reverse gui=reverse
+hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
+hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
+hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
+hi Cursor guibg=Green guifg=NONE
+hi lCursor guibg=Cyan guifg=NONE
+hi Directory term=bold ctermfg=DarkBlue guifg=Blue
+hi LineNr term=underline ctermfg=Brown guifg=Brown
+hi MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi NonText term=bold ctermfg=Blue gui=bold guifg=Blue guibg=grey80
+hi Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen
+hi Search term=reverse ctermbg=Yellow ctermfg=NONE guibg=Yellow guifg=NONE
+hi SpecialKey term=bold ctermfg=DarkBlue guifg=Blue
+hi Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta
+hi WarningMsg term=standout ctermfg=DarkRed guifg=Red
+hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
+hi FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
+hi DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue
+hi DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta
+hi DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan
+
+" Colors for syntax highlighting
+hi Constant term=underline ctermfg=DarkRed guifg=Magenta guibg=grey95
+hi Special term=bold ctermfg=DarkMagenta guifg=SlateBlue guibg=grey95
+if &t_Co > 8
+ hi Statement term=bold cterm=bold ctermfg=Brown gui=bold guifg=Brown
+endif
+hi Ignore ctermfg=LightGrey guifg=grey90
+
+" vim: sw=2
diff --git a/runtime/colors/murphy.vim b/runtime/colors/murphy.vim
new file mode 100644
index 000000000..1f439964e
--- /dev/null
+++ b/runtime/colors/murphy.vim
@@ -0,0 +1,41 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+hi clear
+set background=dark
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "murphy"
+
+hi Normal ctermbg=Black ctermfg=lightgreen guibg=Black guifg=lightgreen
+hi Comment term=bold ctermfg=LightRed guifg=Orange
+hi Constant term=underline ctermfg=LightGreen guifg=White gui=NONE
+hi Identifier term=underline ctermfg=LightCyan guifg=#00ffff
+hi Ignore ctermfg=black guifg=bg
+hi PreProc term=underline ctermfg=LightBlue guifg=Wheat
+hi Search term=reverse guifg=white guibg=Blue
+hi Special term=bold ctermfg=LightRed guifg=magenta
+hi Statement term=bold ctermfg=Yellow guifg=#ffff00 gui=NONE
+hi Type ctermfg=LightGreen guifg=grey gui=none
+hi Error term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
+hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
+" From the source:
+hi Cursor guifg=Orchid guibg=fg
+hi Directory term=bold ctermfg=LightCyan guifg=Cyan
+hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi LineNr term=underline ctermfg=Yellow guifg=Yellow
+hi ModeMsg term=bold cterm=bold gui=bold
+hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
+hi NonText term=bold ctermfg=Blue gui=bold guifg=Blue
+hi Question term=standout ctermfg=LightGreen gui=bold guifg=Cyan
+hi SpecialKey term=bold ctermfg=LightBlue guifg=Cyan
+hi StatusLine term=reverse,bold cterm=reverse gui=NONE guifg=White guibg=darkblue
+hi StatusLineNC term=reverse cterm=reverse gui=NONE guifg=white guibg=#333333
+hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Pink
+hi WarningMsg term=standout ctermfg=LightRed guifg=Red
+hi Visual term=reverse cterm=reverse gui=NONE guifg=white guibg=darkgreen
diff --git a/runtime/colors/pablo.vim b/runtime/colors/pablo.vim
new file mode 100644
index 000000000..e6bf73704
--- /dev/null
+++ b/runtime/colors/pablo.vim
@@ -0,0 +1,26 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+hi clear
+set background=dark
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "pablo"
+
+highlight Comment ctermfg=8 guifg=#808080
+highlight Constant ctermfg=14 cterm=none guifg=#00ffff gui=none
+highlight Identifier ctermfg=6 guifg=#00c0c0
+highlight Statement ctermfg=3 cterm=bold guifg=#c0c000 gui=bold
+highlight PreProc ctermfg=10 guifg=#00ff00
+highlight Type ctermfg=2 guifg=#00c000
+highlight Special ctermfg=12 guifg=#0000ff
+highlight Error ctermbg=9 guibg=#ff0000
+highlight Todo ctermfg=4 ctermbg=3 guifg=#000080 guibg=#c0c000
+highlight Directory ctermfg=2 guifg=#00c000
+highlight StatusLine ctermfg=11 ctermbg=12 cterm=none guifg=#ffff00 guibg=#0000ff gui=none
+highlight Normal guifg=#ffffff guibg=#000000
+highlight Search ctermbg=3 guibg=#c0c000
diff --git a/runtime/colors/peachpuff.vim b/runtime/colors/peachpuff.vim
new file mode 100644
index 000000000..3c15305b0
--- /dev/null
+++ b/runtime/colors/peachpuff.vim
@@ -0,0 +1,60 @@
+" Vim color file
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-04-23
+" URL: http://trific.ath.cx/Ftp/vim/colors/peachpuff.vim
+
+" This color scheme uses a peachpuff background (what you've expected when it's
+" called peachpuff?).
+"
+" Note: Only GUI colors differ from default, on terminal it's just `light'.
+
+" First remove all existing highlighting.
+set background=light
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "peachpuff"
+
+hi Normal guibg=PeachPuff guifg=Black
+
+hi SpecialKey term=bold ctermfg=4 guifg=Blue
+hi NonText term=bold cterm=bold ctermfg=4 gui=bold guifg=Blue
+hi Directory term=bold ctermfg=4 guifg=Blue
+hi ErrorMsg term=standout cterm=bold ctermfg=7 ctermbg=1 gui=bold guifg=White guibg=Red
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi Search term=reverse ctermbg=3 guibg=Gold2
+hi MoreMsg term=bold ctermfg=2 gui=bold guifg=SeaGreen
+hi ModeMsg term=bold cterm=bold gui=bold
+hi LineNr term=underline ctermfg=3 guifg=Red3
+hi Question term=standout ctermfg=2 gui=bold guifg=SeaGreen
+hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold guifg=White guibg=Black
+hi StatusLineNC term=reverse cterm=reverse gui=bold guifg=PeachPuff guibg=Gray45
+hi VertSplit term=reverse cterm=reverse gui=bold guifg=White guibg=Gray45
+hi Title term=bold ctermfg=5 gui=bold guifg=DeepPink3
+hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey80 guibg=fg
+hi VisualNOS term=bold,underline cterm=bold,underline gui=bold,underline
+hi WarningMsg term=standout ctermfg=1 gui=bold guifg=Red
+hi WildMenu term=standout ctermfg=0 ctermbg=3 guifg=Black guibg=Yellow
+hi Folded term=standout ctermfg=4 ctermbg=7 guifg=Black guibg=#e3c1a5
+hi FoldColumn term=standout ctermfg=4 ctermbg=7 guifg=DarkBlue guibg=Gray80
+hi DiffAdd term=bold ctermbg=4 guibg=White
+hi DiffChange term=bold ctermbg=5 guibg=#edb5cd
+hi DiffDelete term=bold cterm=bold ctermfg=4 ctermbg=6 gui=bold guifg=LightBlue guibg=#f6e8d0
+hi DiffText term=reverse cterm=bold ctermbg=1 gui=bold guibg=#ff8060
+hi Cursor guifg=bg guibg=fg
+hi lCursor guifg=bg guibg=fg
+
+" Colors for syntax highlighting
+hi Comment term=bold ctermfg=4 guifg=#406090
+hi Constant term=underline ctermfg=1 guifg=#c00058
+hi Special term=bold ctermfg=5 guifg=SlateBlue
+hi Identifier term=underline ctermfg=6 guifg=DarkCyan
+hi Statement term=bold ctermfg=3 gui=bold guifg=Brown
+hi PreProc term=underline ctermfg=5 guifg=Magenta3
+hi Type term=underline ctermfg=2 gui=bold guifg=SeaGreen
+hi Ignore cterm=bold ctermfg=7 guifg=bg
+hi Error term=reverse cterm=bold ctermfg=7 ctermbg=1 gui=bold guifg=White guibg=Red
+hi Todo term=standout ctermfg=0 ctermbg=3 guifg=Blue guibg=Yellow
+
diff --git a/runtime/colors/ron.vim b/runtime/colors/ron.vim
new file mode 100644
index 000000000..45d64455a
--- /dev/null
+++ b/runtime/colors/ron.vim
@@ -0,0 +1,43 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "ron"
+hi Normal guifg=cyan guibg=black
+hi NonText guifg=brown
+hi comment guifg=green
+hi constant guifg=cyan gui=bold
+hi identifier guifg=cyan gui=NONE
+hi statement guifg=lightblue gui=NONE
+hi preproc guifg=Pink2
+hi type guifg=seagreen gui=bold
+hi special guifg=yellow
+hi ErrorMsg guifg=Black guibg=Red
+hi WarningMsg guifg=Black guibg=Green
+hi Error guibg=Red
+hi Todo guifg=Black guibg=orange
+hi Cursor guibg=#60a060 guifg=#00ff00
+hi Search guibg=lightslateblue
+hi IncSearch gui=NONE guibg=steelblue
+hi LineNr guifg=darkgrey
+hi title guifg=darkgrey
+hi StatusLineNC gui=NONE guifg=lightblue guibg=darkblue
+hi StatusLine gui=bold guifg=cyan guibg=blue
+hi label guifg=gold2
+hi operator guifg=orange
+hi clear Visual
+hi Visual term=reverse cterm=reverse gui=reverse
+hi DiffChange guibg=darkgreen
+hi DiffText guibg=olivedrab
+hi DiffAdd guibg=slateblue
+hi DiffDelete guibg=coral
+hi Folded guibg=gray30
+hi FoldColumn guibg=gray30 guifg=white
+hi cIf0 guifg=gray
diff --git a/runtime/colors/shine.vim b/runtime/colors/shine.vim
new file mode 100644
index 000000000..afc72b30f
--- /dev/null
+++ b/runtime/colors/shine.vim
@@ -0,0 +1,60 @@
+" Vim color file
+" Maintainer: Yasuhiro Matsumoto <mattn@mail.goo.ne.jp>
+" Last Change: 2001 May 25
+
+" This look like normal text editor.
+" This color scheme uses a light background.
+
+" First remove all existing highlighting.
+set background=light
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let colors_name = "shine"
+
+hi Normal ctermbg=White ctermfg=Black guifg=Black guibg=White
+
+" Groups used in the 'highlight' and 'guicursor' options default value.
+hi ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White
+hi IncSearch term=reverse cterm=reverse gui=reverse
+hi ModeMsg term=bold cterm=bold gui=bold
+hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold
+hi StatusLineNC term=reverse cterm=reverse gui=reverse
+hi VertSplit term=reverse cterm=reverse gui=reverse
+hi Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg
+hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold
+hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red
+hi Cursor ctermbg=Green guibg=Green guifg=Black
+hi lCursor guibg=Cyan guifg=Black
+hi Directory term=bold ctermfg=LightRed guifg=Red
+hi LineNr term=underline ctermfg=Yellow guifg=Yellow
+hi MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen
+hi NonText term=bold ctermfg=LightBlue gui=bold guifg=LightBlue guibg=grey90
+hi Question term=standout ctermfg=LightGreen gui=bold guifg=Green
+hi Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi SpecialKey term=bold ctermfg=LightBlue guifg=Blue
+hi Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta
+hi WarningMsg term=standout ctermfg=LightRed guifg=Red
+hi WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black
+hi Folded term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue
+hi FoldColumn term=standout ctermbg=LightGrey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue
+hi DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue
+hi DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta
+hi DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan
+
+hi Comment ctermfg=DarkGrey ctermbg=White guifg=DarkGrey gui=bold
+hi SpecialChar ctermfg=DarkGrey ctermbg=White guifg=DarkGrey gui=bold
+hi StorageClass ctermfg=Red ctermbg=White guifg=Red gui=bold
+hi Number ctermfg=LightRed ctermbg=White guifg=LightRed gui=bold
+
+" Groups for syntax highlighting
+hi Constant term=underline ctermfg=Magenta guifg=#a07070 guibg=grey80
+hi Special term=bold ctermfg=LightRed guifg=DarkOrange guibg=grey80
+if &t_Co > 8
+ hi Statement term=bold cterm=bold ctermfg=DarkGreen ctermbg=White guifg=#ffff60 gui=bold
+endif
+hi Ignore ctermfg=LightGrey guifg=grey90
+
+" vim: sw=2
diff --git a/runtime/colors/torte.vim b/runtime/colors/torte.vim
new file mode 100644
index 000000000..65d4b3f89
--- /dev/null
+++ b/runtime/colors/torte.vim
@@ -0,0 +1,50 @@
+" Vim color file
+" Maintainer: Thorsten Maerz <info@netztorte.de>
+" Last Change: 2001 Jul 23
+" grey on black
+" optimized for TFT panels
+
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+"colorscheme default
+let g:colors_name = "torte"
+
+" hardcoded colors :
+" GUI Comment : #80a0ff = Light blue
+
+" GUI
+highlight Normal guifg=Grey80 guibg=Black
+highlight Search guifg=Black guibg=Red gui=bold
+highlight Visual guifg=Grey25 gui=bold
+highlight Cursor guifg=Black guibg=Green gui=bold
+highlight Special guifg=Orange
+highlight Comment guifg=#80a0ff
+highlight StatusLine guifg=blue guibg=white
+highlight Statement guifg=Yellow gui=NONE
+highlight Type gui=NONE
+
+" Console
+highlight Normal ctermfg=LightGrey ctermbg=Black
+highlight Search ctermfg=Black ctermbg=Red cterm=NONE
+highlight Visual cterm=reverse
+highlight Cursor ctermfg=Black ctermbg=Green cterm=bold
+highlight Special ctermfg=Brown
+highlight Comment ctermfg=Blue
+highlight StatusLine ctermfg=blue ctermbg=white
+highlight Statement ctermfg=Yellow cterm=NONE
+highlight Type cterm=NONE
+
+" only for vim 5
+if has("unix")
+ if v:version<600
+ highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE
+ highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold
+ highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold
+ highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE
+ highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE
+ endif
+endif
+
diff --git a/runtime/colors/zellner.vim b/runtime/colors/zellner.vim
new file mode 100644
index 000000000..ab875825c
--- /dev/null
+++ b/runtime/colors/zellner.vim
@@ -0,0 +1,54 @@
+" local syntax file - set colors on a per-machine basis:
+" vim: tw=0 ts=4 sw=4
+" Vim color file
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2003 May 02
+
+set background=light
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+let g:colors_name = "zellner"
+
+hi Comment term=bold ctermfg=Red guifg=Red
+hi Normal guifg=black guibg=white
+hi Constant term=underline ctermfg=Magenta guifg=Magenta
+hi Special term=bold ctermfg=Magenta guifg=Magenta
+hi Identifier term=underline ctermfg=Blue guifg=Blue
+hi Statement term=bold ctermfg=DarkRed gui=NONE guifg=Brown
+hi PreProc term=underline ctermfg=Magenta guifg=Purple
+hi Type term=underline ctermfg=Blue gui=NONE guifg=Blue
+hi Visual term=reverse ctermfg=Yellow ctermbg=Red gui=NONE guifg=Black guibg=Yellow
+hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan
+hi Tag term=bold ctermfg=DarkGreen guifg=DarkGreen
+hi Error term=reverse ctermfg=15 ctermbg=9 guibg=Red guifg=White
+hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow
+hi StatusLine term=bold,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=NONE guifg=Yellow guibg=DarkGray
+hi! link MoreMsg Comment
+hi! link ErrorMsg Visual
+hi! link WarningMsg ErrorMsg
+hi! link Question Comment
+hi link String Constant
+hi link Character Constant
+hi link Number Constant
+hi link Boolean Constant
+hi link Float Number
+hi link Function Identifier
+hi link Conditional Statement
+hi link Repeat Statement
+hi link Label Statement
+hi link Operator Statement
+hi link Keyword Statement
+hi link Exception Statement
+hi link Include PreProc
+hi link Define PreProc
+hi link Macro PreProc
+hi link PreCondit PreProc
+hi link StorageClass Type
+hi link Structure Type
+hi link Typedef Type
+hi link SpecialChar Special
+hi link Delimiter Special
+hi link SpecialComment Special
+hi link Debug Special
diff --git a/runtime/compiler/README.txt b/runtime/compiler/README.txt
new file mode 100644
index 000000000..3f0b97b83
--- /dev/null
+++ b/runtime/compiler/README.txt
@@ -0,0 +1,11 @@
+This directory contains Vim scripts to be used with a specific compiler.
+They are used with the ":compiler" command.
+
+These scripts usually set options, for example 'errorformat'.
+See ":help write-compiler-plugin".
+
+If you want to write your own compiler plugin, have a look at the other files
+for how to do it, the format is simple.
+
+If you think a compiler plugin you have written is useful for others, please
+send it to Bram@vim.org.
diff --git a/runtime/compiler/ant.vim b/runtime/compiler/ant.vim
new file mode 100644
index 000000000..51cd93185
--- /dev/null
+++ b/runtime/compiler/ant.vim
@@ -0,0 +1,38 @@
+" Vim Compiler File
+" Compiler: ant
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 15:01:45 CEST
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "ant"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+CompilerSet makeprg=ant
+
+" first line:
+" ant with jikes +E, which assumes the following
+" two property lines in your 'build.xml':
+"
+" <property name = "build.compiler" value = "jikes"/>
+" <property name = "build.compiler.emacs" value = "true"/>
+"
+" second line:
+" ant with javac
+"
+" note that this will work also for tasks like [wtkbuild]
+"
+setlocal errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
+ \%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
+
+" ,%-C%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/bcc.vim b/runtime/compiler/bcc.vim
new file mode 100644
index 000000000..5bd284a58
--- /dev/null
+++ b/runtime/compiler/bcc.vim
@@ -0,0 +1,19 @@
+" Vim compiler file
+" Compiler: bcc - Borland C
+" Maintainer: Emile van Raaij (eraaij@xs4all.nl)
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "bcc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" A workable errorformat for Borland C
+CompilerSet errorformat=%*[^0-9]%n\ %f\ %l:\ %m
+
+" default make
+CompilerSet makeprg=make
diff --git a/runtime/compiler/bdf.vim b/runtime/compiler/bdf.vim
new file mode 100644
index 000000000..ae2da75e1
--- /dev/null
+++ b/runtime/compiler/bdf.vim
@@ -0,0 +1,30 @@
+" Vim compiler file
+" Compiler: BDF to PCF Conversion
+" Maintainer: Nikolai Weibull <sourc@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/compiler/pcp/bdf/
+" Latest Revision: 2004-05-22
+" arch-tag: 2e2f3a55-199b-468c-aa2e-d6b1a7b87806
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "bdf"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=bdftopcf\ $*
+
+CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
+ \%-Z%p^,
+ \%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/compiler/checkstyle.vim b/runtime/compiler/checkstyle.vim
new file mode 100644
index 000000000..8d696f050
--- /dev/null
+++ b/runtime/compiler/checkstyle.vim
@@ -0,0 +1,20 @@
+" Vim compiler file
+" Compiler: Checkstyle
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/checkstyle.vim
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "checkstyle"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=java\ com.puppycrawl.tools.checkstyle.Main\ -f\ plain
+
+" sample error: WebTable.java:282: '+=' is not preceeded with whitespace.
+" WebTable.java:201:1: '{' should be on the previous line.
+CompilerSet errorformat=%f:%l:\ %m,%f:%l:%v:\ %m,%-G%.%#
diff --git a/runtime/compiler/cs.vim b/runtime/compiler/cs.vim
new file mode 100644
index 000000000..5b75d6d2a
--- /dev/null
+++ b/runtime/compiler/cs.vim
@@ -0,0 +1,19 @@
+" Vim compiler file
+" Compiler: ms C#
+" Maintainer: Joseph H. Yao (hyao@sina.com)
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "cs"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" default errorformat
+CompilerSet errorformat&
+
+" default make
+CompilerSet makeprg=csc\ %
diff --git a/runtime/compiler/dot.vim b/runtime/compiler/dot.vim
new file mode 100644
index 000000000..0327739aa
--- /dev/null
+++ b/runtime/compiler/dot.vim
@@ -0,0 +1,15 @@
+" Vim compiler file
+" Compiler: ATT dot
+" Maintainer: Marcos Macedo <bar4ka@bol.com.br>
+" Last Change: 2004 May 16
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "dot"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=dot\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\"
diff --git a/runtime/compiler/fortran_F.vim b/runtime/compiler/fortran_F.vim
new file mode 100644
index 000000000..d9cb47cc1
--- /dev/null
+++ b/runtime/compiler/fortran_F.vim
@@ -0,0 +1,27 @@
+" Vim compiler file
+" Compiler: Fortran Company/NAGWare F compiler
+" URL: http://www.unb.ca/chem/ajit/compiler/fortran_F.vim
+" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Version: 0.2
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "fortran_F"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cposet=&cpoptions
+set cpoptions-=C
+
+CompilerSet errorformat=%trror:\ %f\\,\ line\ %l:%m,
+ \%tarning:\ %f\\,\ line\ %l:%m,
+ \%tatal\ Error:\ %f\\,\ line\ %l:%m,
+ \%-G%.%#
+CompilerSet makeprg=F
+
+let &cpoptions=s:cposet
+unlet s:cposet
diff --git a/runtime/compiler/fortran_cv.vim b/runtime/compiler/fortran_cv.vim
new file mode 100644
index 000000000..089d3b27c
--- /dev/null
+++ b/runtime/compiler/fortran_cv.vim
@@ -0,0 +1,30 @@
+" Vim compiler file
+" Compiler: Compaq Visual Fortran
+" Maintainer: Joh.-G. Simon (johann-guenter.simon@linde-le.com)
+" Last Change: 11/05/2002
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "fortran_cv"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cposet = &cpoptions
+set cpoptions-=C
+
+" A workable errorformat for Compaq Visual Fortran
+CompilerSet errorformat=
+ \%E%f(%l)\ :\ Error:%m,
+ \%W%f(%l)\ :\ Warning:%m,
+ \%-Z%p%^%.%#,
+ \%-G%.%#,
+" Compiler call
+CompilerSet makeprg=df\ /nologo\ /noobj\ /c\ %
+" Visual fortran defaults to printing output on stderr
+" Adjust option shellpipe accordingly
+
+let &cpoptions = s:cposet
+unlet s:cposet
diff --git a/runtime/compiler/fortran_elf90.vim b/runtime/compiler/fortran_elf90.vim
new file mode 100644
index 000000000..34c33cfaf
--- /dev/null
+++ b/runtime/compiler/fortran_elf90.vim
@@ -0,0 +1,33 @@
+" Vim compiler file
+" Compiler: Essential Lahey Fortran 90
+" Probably also works for Lahey Fortran 90
+" URL: http://www.unb.ca/chem/ajit/compiler/fortran_elf90.vim
+" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Version: 0.2
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "fortran_elf90"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cposet=&cpoptions
+set cpoptions-=C
+
+CompilerSet errorformat=\%ALine\ %l\\,\ file\ %f,
+ \%C%tARNING\ --%m,
+ \%C%tATAL\ --%m,
+ \%C%tBORT\ --%m,
+ \%+C%\\l%.%#\.,
+ \%C%p\|,
+ \%C%.%#,
+ \%Z%$,
+ \%-G%.%#
+CompilerSet makeprg=elf90
+
+let &cpoptions=s:cposet
+unlet s:cposet
diff --git a/runtime/compiler/fortran_g77.vim b/runtime/compiler/fortran_g77.vim
new file mode 100644
index 000000000..94018e7f2
--- /dev/null
+++ b/runtime/compiler/fortran_g77.vim
@@ -0,0 +1,48 @@
+" Vim compiler file
+" Compiler: g77 (GNU Fortran)
+" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+" Last Change: $Date$
+" $Revision$
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "fortran_g77"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" Note: The errorformat assumes GNU make
+
+" sample multiline errors (besides gcc backend one-liners):
+" gev.f:14:
+" parameter UPLO = 'Upper-triangle'
+" ^
+" Unsupported VXT statement at (^)
+" gev.f:6:
+" integer desca( * ), descb( * )
+" 1
+" gev.f:19: (continued):
+" end subroutine
+" 2
+" Invalid declaration of or reference to symbol `desca' at (2) [initially seen at (1)]
+
+CompilerSet errorformat=
+ \%Omake:\ %r,
+ \%f:%l:\ warning:\ %m,
+ \%A%f:%l:\ (continued):,
+ \%W%f:%l:\ warning:,
+ \%A%f:%l:\ ,
+ \%-C\ \ \ %p%*[0123456789^]%.%#,
+ \%-C\ \ \ %.%#,
+ \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
+ \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
+ \%DMaking\ %*\\a\ in\ %f,
+ \%Z%m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/fortran_lf95.vim b/runtime/compiler/fortran_lf95.vim
new file mode 100644
index 000000000..685fee7b4
--- /dev/null
+++ b/runtime/compiler/fortran_lf95.vim
@@ -0,0 +1,27 @@
+" Vim compiler file
+" Compiler: Lahey/Fujitsu Fortran 95
+" URL: http://www.unb.ca/chem/ajit/compiler/fortran_lf95.vim
+" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Version: 0.2
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "fortran_lf95"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cposet=&cpoptions
+set cpoptions-=C
+
+CompilerSet errorformat=\ %#%n-%t:\ \"%f\"\\,\ line\ %l:%m,
+ \Error\ LINK\.%n:%m,
+ \Warning\ LINK\.%n:%m,
+ \%-G%.%#
+CompilerSet makeprg=lf95
+
+let &cpoptions=s:cposet
+unlet s:cposet
diff --git a/runtime/compiler/hp_acc.vim b/runtime/compiler/hp_acc.vim
new file mode 100644
index 000000000..eaf61b2f1
--- /dev/null
+++ b/runtime/compiler/hp_acc.vim
@@ -0,0 +1,28 @@
+" Vim compiler file
+" Compiler: HP aCC
+" Maintainer: Matthias Ulrich <matthias-ulrich@web.de>
+" URL: http://www.subhome.de/vim/hp_acc.vim
+" Last Change: 2004 Mar 27
+"
+" aCC --version says: "HP ANSI C++ B3910B A.03.13"
+" This compiler has been tested on:
+" hp-ux 10.20, hp-ux 11.0 and hp-ux 11.11 (64bit)
+"
+" Tim Brown's aCC is: "HP ANSI C++ B3910B A.03.33"
+" and it also works fine...
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "hp_acc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%A%trror\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m,
+ \%A%tarning\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#,
+ \%Z\ \ \ \ %p^%.%#,
+ \%-C%.%#
+
+" vim:ts=8:sw=4:cindent
diff --git a/runtime/compiler/icc.vim b/runtime/compiler/icc.vim
new file mode 100644
index 000000000..751fba65c
--- /dev/null
+++ b/runtime/compiler/icc.vim
@@ -0,0 +1,18 @@
+" Vim compiler file
+" Compiler: icc - Intel C++
+" Maintainer: Peter Puck <PtrPck@netscape.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "icc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" I think that Intel is calling the compiler icl under Windows
+
+CompilerSet errorformat=%-Z%p^,%f(%l):\ remark\ #%n:%m,%f(%l)\ :\ (col.\ %c)\ remark:\ %m,%E%f(%l):\ error:\ %m,%E%f(%l):\ error:\ #%n:\ %m,%W%f(%l):\ warning\ #%n:\ %m,%W%f(%l):\ warning:\ %m,%-C%.%#
+
diff --git a/runtime/compiler/intel.vim b/runtime/compiler/intel.vim
new file mode 100644
index 000000000..918382646
--- /dev/null
+++ b/runtime/compiler/intel.vim
@@ -0,0 +1,21 @@
+" Vim compiler file
+" Compiler: Intel C++ 7.1
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 May 16
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "intel"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%E%f(%l):\ error:\ %m,
+ \%W%f(%l):\ warning:\ %m,
+ \%I%f(%l):\ remark\ #%n:\ %m,
+ \%+C\ \ %m.,
+ \%-Z\ \ %p^,
+ \%-G\\s%#,
+ \%-G%.%#
diff --git a/runtime/compiler/irix5_c.vim b/runtime/compiler/irix5_c.vim
new file mode 100644
index 000000000..87bb9e11d
--- /dev/null
+++ b/runtime/compiler/irix5_c.vim
@@ -0,0 +1,21 @@
+" Vim compiler file
+" Compiler: SGI IRIX 5.3 cc
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "irix5_c"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=\%Ecfe:\ Error:\ %f\\,\ line\ %l:\ %m,
+ \%Wcfe:\ Warning:\ %n:\ %f\\,\ line\ %l:\ %m,
+ \%Wcfe:\ Warning\ %n:\ %f\\,\ line\ %l:\ %m,
+ \%W(%l)\ \ Warning\ %n:\ %m,
+ \%-Z\ %p^,
+ \-G\\s%#,
+ \%-G%.%#
diff --git a/runtime/compiler/irix5_cpp.vim b/runtime/compiler/irix5_cpp.vim
new file mode 100644
index 000000000..f5057682c
--- /dev/null
+++ b/runtime/compiler/irix5_cpp.vim
@@ -0,0 +1,21 @@
+" Vim compiler file
+" Compiler: SGI IRIX 5.3 CC or NCC
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "irix5_cpp"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%E\"%f\"\\,\ line\ %l:\ error(%n):\ ,
+ \%E\"%f\"\\,\ line\ %l:\ error(%n):\ %m,
+ \%W\"%f\"\\,\ line\ %l:\ warning(%n):\ %m,
+ \%+IC++\ prelinker:\ %m,
+ \%-Z\ \ %p%^,
+ \%+C\ %\\{10}%.%#,
+ \%-G%.%#
diff --git a/runtime/compiler/javac.vim b/runtime/compiler/javac.vim
new file mode 100644
index 000000000..296f766d6
--- /dev/null
+++ b/runtime/compiler/javac.vim
@@ -0,0 +1,18 @@
+" Vim compiler file
+" Compiler: javac
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/javac.vim
+" Last Change: 2004 Apr 15
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "javac"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=javac
+
+CompilerSet errorformat=%E%f:%l:\ %m,%-Z%p^,%-C%.%#,%-G%.%#
diff --git a/runtime/compiler/jikes.vim b/runtime/compiler/jikes.vim
new file mode 100644
index 000000000..8566969ac
--- /dev/null
+++ b/runtime/compiler/jikes.vim
@@ -0,0 +1,18 @@
+" Vim Compiler File
+" Compiler: Jikes
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Change: 2004 Mar 27
+" URL: http://mywebpage.netscape.com/sharppeople/vim/compiler
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "jikes"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" Jikes defaults to printing output on stderr
+CompilerSet makeprg=jikes\ -Xstdout\ +E\ \"%\"
+CompilerSet errorformat=%f:%l:%v:%*\\d:%*\\d:%*\\s%m
diff --git a/runtime/compiler/mips_c.vim b/runtime/compiler/mips_c.vim
new file mode 100644
index 000000000..b57eac023
--- /dev/null
+++ b/runtime/compiler/mips_c.vim
@@ -0,0 +1,21 @@
+" Vim compiler file
+" Compiler: SGI IRIX 6.5 MIPS C (cc)
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "mips_c"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%+C\ \ %m.,
+ \%-Z\ \ %p^,
+ \%-G\\s%#,
+ \%-G%.%#
diff --git a/runtime/compiler/mipspro_c89.vim b/runtime/compiler/mipspro_c89.vim
new file mode 100644
index 000000000..258a80043
--- /dev/null
+++ b/runtime/compiler/mipspro_c89.vim
@@ -0,0 +1,22 @@
+" Vim compiler file
+" Compiler: SGI IRIX 6.5 MIPSPro C (c89)
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "mipspro_c89"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%-Z%p%^,
+ \%+C\ %\\{10}%m%.,
+ \%+C\ \ %m,
+ \%-G\\s%#,
+ \%-G%.%#
diff --git a/runtime/compiler/mipspro_cpp.vim b/runtime/compiler/mipspro_cpp.vim
new file mode 100644
index 000000000..1f6074a10
--- /dev/null
+++ b/runtime/compiler/mipspro_cpp.vim
@@ -0,0 +1,21 @@
+" Vim compiler file
+" Compiler: SGI IRIX 6.5 MIPSPro C++ (CC)
+" Maintainer: David Harrison <david_jr@users.sourceforge.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "mipspro_cpp"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet errorformat=%Ecc\-%n\ %.%#:\ ERROR\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Wcc\-%n\ %.%#:\ WARNING\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%Icc\-%n\ %.%#:\ REMARK\ File\ =\ %f\%\\,\ Line\ =\ %l,
+ \%+C\ \ %m.,
+ \%-Z\ \ %p^,
+ \%-G\\s%#,
+ \%-G%.%#
diff --git a/runtime/compiler/modelsim_vcom.vim b/runtime/compiler/modelsim_vcom.vim
new file mode 100644
index 000000000..6aa1bde0b
--- /dev/null
+++ b/runtime/compiler/modelsim_vcom.vim
@@ -0,0 +1,20 @@
+" Vim Compiler File
+" Compiler: Modelsim Vcom
+" Maintainer: Paul Baleme <pbaleme@mail.com>
+" Last Change: September 8, 2003
+" Thanks to: allanherriman@hotmail.com
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "modelsim_vcom"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+"setlocal errorformat=\*\*\ %tRROR:\ %f(%l):\ %m,%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %f(%l):\ %m,\*\*\ %tRROR:\ %m,%tRROR:\ %m,%tARNING\[%*[0-9]\]:\ %m
+
+"setlocal errorformat=%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %m
+CompilerSet errorformat=\*\*\ %tRROR:\ %f(%l):\ %m,\*\*\ %tRROR:\ %m,\*\*\ %tARNING:\ %m,\*\*\ %tOTE:\ %m,%tRROR:\ %f(%l):\ %m,%tARNING\[%*[0-9]\]:\ %f(%l):\ %m,%tRROR:\ %m,%tARNING\[%*[0-9]\]:\ %m
+
diff --git a/runtime/compiler/msvc.vim b/runtime/compiler/msvc.vim
new file mode 100644
index 000000000..5fb1f24b3
--- /dev/null
+++ b/runtime/compiler/msvc.vim
@@ -0,0 +1,17 @@
+" Vim compiler file
+" Compiler: Miscrosoft Visual C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Mar 19
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "msvc"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" The errorformat for MSVC is the default.
+CompilerSet errorformat&
+CompilerSet makeprg=nmake
diff --git a/runtime/compiler/neato.vim b/runtime/compiler/neato.vim
new file mode 100644
index 000000000..bd184b7f6
--- /dev/null
+++ b/runtime/compiler/neato.vim
@@ -0,0 +1,15 @@
+" Vim compiler file
+" Compiler: ATT neato
+" Maintainer: Marcos Macedo <bar4ka@bol.com.br>
+" Last Change: 2004 May 16
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "neato"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=neato\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\"
diff --git a/runtime/compiler/onsgmls.vim b/runtime/compiler/onsgmls.vim
new file mode 100644
index 000000000..130d3e21b
--- /dev/null
+++ b/runtime/compiler/onsgmls.vim
@@ -0,0 +1,24 @@
+" Vim compiler file
+" Compiler: onsgmls
+" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "onsgmls"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=onsgmls\ -s\ %
+
+CompilerSet errorformat=onsgmls:%f:%l:%c:%t:%m,
+ \onsgmls:%f:%l:%c:%m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/pbx.vim b/runtime/compiler/pbx.vim
new file mode 100644
index 000000000..9e81ea735
--- /dev/null
+++ b/runtime/compiler/pbx.vim
@@ -0,0 +1,20 @@
+" Vim compiler file
+" Compiler: Apple Project Builder
+" Maintainer: Alexander von Below (public@vonBelow.Com)
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "pbx"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" The compiler actually is gcc, so the errorformat is unchanged
+CompilerSet errorformat&
+
+" default make
+CompilerSet makeprg=pbxbuild
+
diff --git a/runtime/compiler/perl.vim b/runtime/compiler/perl.vim
new file mode 100644
index 000000000..1d30472bb
--- /dev/null
+++ b/runtime/compiler/perl.vim
@@ -0,0 +1,39 @@
+" Vim Compiler File
+" Compiler: Perl syntax checks (perl -Wc)
+" Maintainer: Christian J. Robinson <infynity@onewest.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "perl"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:savecpo = &cpo
+set cpo&vim
+
+if getline(1) =~# '-[^ ]*T'
+ CompilerSet makeprg=perl\ -WTc\ %
+else
+ CompilerSet makeprg=perl\ -Wc\ %
+endif
+
+CompilerSet errorformat=
+ \%-G%.%#had\ compilation\ errors.,
+ \%-G%.%#syntax\ OK,
+ \%m\ at\ %f\ line\ %l.,
+ \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
+ \%+C%.%#
+
+" Explanation:
+" %-G%.%#had\ compilation\ errors., - Ignore the obvious.
+" %-G%.%#syntax\ OK, - Don't include the 'a-okay' message.
+" %m\ at\ %f\ line\ %l., - Most errors...
+" %+A%.%#\ at\ %f\ line\ %l\\,%.%#, - As above, including ', near ...'
+" %+C%.%# - ... Which can be multi-line.
+
+let &cpo = s:savecpo
+unlet s:savecpo
diff --git a/runtime/compiler/pyunit.vim b/runtime/compiler/pyunit.vim
new file mode 100644
index 000000000..2a4ea92b6
--- /dev/null
+++ b/runtime/compiler/pyunit.vim
@@ -0,0 +1,16 @@
+" Vim compiler file
+" Compiler: Unit testing tool for Python
+" Maintainer: Max Ischenko <mfi@ukr.net>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "pyunit"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
+
diff --git a/runtime/compiler/rst.vim b/runtime/compiler/rst.vim
new file mode 100644
index 000000000..c9e5be186
--- /dev/null
+++ b/runtime/compiler/rst.vim
@@ -0,0 +1,33 @@
+" Vim compiler file
+" Compiler: reStructuredText Documentation Format
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/compiler/pcp/rst/
+" Latest Revision: 2004-05-22
+" arch-tag: ac64a95a-5d45-493d-a9f9-f96fc8568657
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "rst"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet errorformat=
+ \%f:%l:\ (%tEBUG/0)\ %m,
+ \%f:%l:\ (%tNFO/1)\ %m,
+ \%f:%l:\ (%tARNING/2)\ %m,
+ \%f:%l:\ (%tRROR/3)\ %m,
+ \%f:%l:\ (%tEVERE/3)\ %m,
+ \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
+ \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
+ \%DMaking\ %*\\a\ in\ %f
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/compiler/ruby.vim b/runtime/compiler/ruby.vim
new file mode 100644
index 000000000..f124ed3a3
--- /dev/null
+++ b/runtime/compiler/ruby.vim
@@ -0,0 +1,62 @@
+" Vim compiler file
+" Compiler: Ruby syntax check and/or error reporting
+" Maintainer: Tim Hammerquist <timmy@cpan.org>
+" Last Change: Tue Jul 16 00:38:00 PDT 2002
+"
+" Changelog:
+" 0.2: script saves and restores 'cpoptions' value to prevent problems with
+" line continuations
+" 0.1: initial release
+"
+" Contributors:
+" Hugh Sasse <hgs@dmu.ac.uk>
+" Doug Kearns <djkea2@mugca.its.monash.edu.au>
+"
+" Todo:
+" match error type %m
+"
+" Comments:
+" I know this file isn't perfect. If you have any questions, suggestions,
+" patches, etc., please don't hesitate to let me know.
+"
+" This is my first experience with 'errorformat' and compiler plugins and
+" I welcome any input from more experienced (or clearer-thinking)
+" individuals.
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "ruby"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" default settings runs script normally
+" add '-c' switch to run syntax check only:
+"
+" CompilerSet makeprg=ruby\ -wc\ $*
+"
+" or add '-c' at :make command line:
+"
+" :make -c %<CR>
+"
+CompilerSet makeprg=ruby\ -w\ $*
+
+CompilerSet errorformat=
+ \%+E%f:%l:\ parse\ error,
+ \%W%f:%l:\ warning:\ %m,
+ \%E%f:%l:in\ %*[^:]:\ %m,
+ \%E%f:%l:\ %m,
+ \%-C%\tfrom\ %f:%l:in\ %.%#,
+ \%-Z%\tfrom\ %f:%l,
+ \%-Z%p^,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ft=vim
diff --git a/runtime/compiler/se.vim b/runtime/compiler/se.vim
new file mode 100644
index 000000000..ac0aab805
--- /dev/null
+++ b/runtime/compiler/se.vim
@@ -0,0 +1,28 @@
+" Vim compiler file
+" Compiler: se (SmartEiffel Compiler)
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/se.vim
+" Last Change: 2004 May 16
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "se"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=compile\ %
+
+CompilerSet errorformat=%W******\ Warning:\ %m,
+ \%E******\ Fatal\ Error:\ %m,
+ \%E******\ Error:\ %m,
+ \%CLine\ %l\ column\ %c\ in\ %\\w%\\+\ (%f)\ :,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/splint.vim b/runtime/compiler/splint.vim
new file mode 100644
index 000000000..8ba9c974e
--- /dev/null
+++ b/runtime/compiler/splint.vim
@@ -0,0 +1,70 @@
+" Vim compiler file
+" Compiler: splint/lclint (C source code checker)
+" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+" Splint Home: http://www.splint.org/
+" Last Change: $Date$
+" $Revision$
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "splint"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" adapt this if you want to check more than one file at a time.
+" put command line options in .splintrc or ~/.splintrc
+CompilerSet makeprg=splint\ %
+
+" Note: when using the new array bounds checking flags: Each warning
+" usually has several lines and several references to source code mostly
+" within one or two lines (see sample warning below). The easiest way
+" not to mess up file name detection and not to jump to all positions is
+" to add something like
+" -linelen 500 +boundscompacterrormessages
+" to your .splintrc and 'set cmdheight=4' or more.
+" TODO: reliable way to distinguish file names and constraints.
+"
+" sample warning (generic):
+"
+"foo.c:1006:12: Clauses exit with var referencing local storage in one
+" case, fresh storage in other case
+" foo.c:1003:2: Fresh storage var allocated
+"
+" sample warning (bounds checking):
+"
+"bounds.c: (in function updateEnv)
+"bounds.c:10:5: Possible out-of-bounds store:
+" strcpy(str, tmp)
+" Unable to resolve constraint:
+" requires maxSet(str @ bounds.c:10:13) >= maxRead(getenv("MYENV") @
+" bounds.c:6:9)
+" needed to satisfy precondition:
+" requires maxSet(str @ bounds.c:10:13) >= maxRead(tmp @ bounds.c:10:18)
+" derived from strcpy precondition: requires maxSet(<parameter 1>) >=
+" maxRead(<parameter 2>)
+" A memory write may write to an address beyond the allocated buffer. (Use
+" -boundswrite to inhibit warning)
+
+CompilerSet errorformat=%OLCLint*m,
+ \%OSplint*m,
+ \%*[\ ]%f:%l:%c:\ %m,
+ \%*[\ ]%f:%l:\ %m,
+ \%*[^\"]\"%f\"%*\\D%l:\ %m,
+ \\"%f\"%*\\D%l:\ %m,
+ \%A%f:%l:%c:\ %m,
+ \%A%f:%l:%m,
+ \\"%f\"\\,
+ \\ line\ %l%*\\D%c%*[^\ ]\ %m,
+ \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
+ \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
+ \%DMaking\ %*\\a\ in\ %f,
+ \%C\ \ %m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/tcl.vim b/runtime/compiler/tcl.vim
new file mode 100644
index 000000000..76d3edf12
--- /dev/null
+++ b/runtime/compiler/tcl.vim
@@ -0,0 +1,18 @@
+" Vim compiler file
+" Compiler: tcl
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/tcl.vim
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "tcl"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=tcl
+
+CompilerSet errorformat=%EError:\ %m,%+Z\ %\\{4}(file\ \"%f\"\ line\ %l),%-G%.%#
diff --git a/runtime/compiler/tex.vim b/runtime/compiler/tex.vim
new file mode 100644
index 000000000..5828a91ab
--- /dev/null
+++ b/runtime/compiler/tex.vim
@@ -0,0 +1,68 @@
+" Vim compiler file
+" Compiler: TeX
+" Maintainer: Artem Chuprina <ran@ran.pp.ru>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" If makefile exists and we are not asked to ignore it, we use standard make
+" (do not redefine makeprg)
+if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
+ \(!filereadable('Makefile') && !filereadable('makefile'))
+ " If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
+ " otherwize the same for global variable with same name, else it will be
+ " LaTeX
+ if exists("b:tex_flavor")
+ let current_compiler = b:tex_flavor
+ elseif exists("g:tex_flavor")
+ let current_compiler = g:tex_flavor
+ else
+ let current_compiler = "latex"
+ endif
+ let &l:makeprg=current_compiler.' -interaction=nonstopmode'
+else
+ let current_compiler = 'make'
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
+" addition from Srinath Avadhanula <srinath@fastmail.fm>
+CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
+ \%E!\ %m,
+ \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
+ \%+W%.%#\ at\ lines\ %l--%*\\d,
+ \%WLaTeX\ %.%#Warning:\ %m,
+ \%Cl.%l\ %m,
+ \%+C\ \ %m.,
+ \%+C%.%#-%.%#,
+ \%+C%.%#[]%.%#,
+ \%+C[]%.%#,
+ \%+C%.%#%[{}\\]%.%#,
+ \%+C<%.%#>%.%#,
+ \%C\ \ %m,
+ \%-GSee\ the\ LaTeX%m,
+ \%-GType\ \ H\ <return>%m,
+ \%-G\ ...%.%#,
+ \%-G%.%#\ (C)\ %.%#,
+ \%-G(see\ the\ transcript%.%#),
+ \%-G\\s%#,
+ \%+O(%*[^()])%r,
+ \%+O%*[^()](%*[^()])%r,
+ \%+P(%f%r,
+ \%+P\ %\\=(%f%r,
+ \%+P%*[^()](%f%r,
+ \%+P[%\\d%[^()]%#(%f%r,
+ \%+Q)%r,
+ \%+Q%*[^()])%r,
+ \%+Q[%\\d%*[^()])%r
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/tidy.vim b/runtime/compiler/tidy.vim
new file mode 100644
index 000000000..36416ebfc
--- /dev/null
+++ b/runtime/compiler/tidy.vim
@@ -0,0 +1,29 @@
+" Vim compiler file
+" Compiler: HTML Tidy
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/tidy.vim
+" Last Change: 2004 Mar 27
+
+" NOTE: set 'tidy_compiler_040800' if you are using the 4th August 2000 release
+" of HTML Tidy.
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "tidy"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+" this is needed to work around a bug in the 04/08/00 release of tidy which
+" failed to set the filename if the -quiet option was used
+if exists("tidy_compiler_040800")
+ CompilerSet makeprg=tidy\ -errors\ --gnu-emacs\ yes\ %
+else
+ CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
+endif
+
+" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
+" sample error: foo.html:9:2: Error: <foobar> is not recognized!
+CompilerSet errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
diff --git a/runtime/compiler/xmllint.vim b/runtime/compiler/xmllint.vim
new file mode 100644
index 000000000..b7110c719
--- /dev/null
+++ b/runtime/compiler/xmllint.vim
@@ -0,0 +1,29 @@
+" Vim compiler file
+" Compiler: xmllint
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/compiler/xmllint.vim
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "xmllint"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=xmllint\ --valid\ --noout\
+
+CompilerSet errorformat=%E%f:%l:\ error:\ %m,
+ \%W%f:%l:\ warning:\ %m,
+ \%E%f:%l:\ validity\ error:\ %m,
+ \%W%f:%l:\ validity\ warning:\ %m,
+ \%-Z%p^,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/compiler/xmlwf.vim b/runtime/compiler/xmlwf.vim
new file mode 100644
index 000000000..cd2e2bb6a
--- /dev/null
+++ b/runtime/compiler/xmlwf.vim
@@ -0,0 +1,23 @@
+" Vim Compiler File
+" Compiler: xmlwf
+" Maintainer: Robert Rowsome <rowsome@wam.umd.edu>
+" Last Change: 2004 Mar 27
+
+if exists("current_compiler")
+ finish
+endif
+let current_compiler = "xmlwf"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+CompilerSet makeprg=xmlwf\ %
+
+CompilerSet errorformat=%f:%l%c:%m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/delmenu.vim b/runtime/delmenu.vim
new file mode 100644
index 000000000..81df87d34
--- /dev/null
+++ b/runtime/delmenu.vim
@@ -0,0 +1,25 @@
+" This Vim script deletes all the menus, so that they can be redefined.
+" Warning: This also deletes all menus defined by the user!
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 May 27
+
+aunmenu *
+
+silent! unlet did_install_default_menus
+silent! unlet did_install_syntax_menu
+if exists("did_menu_trans")
+ menutrans clear
+ unlet did_menu_trans
+endif
+
+silent! unlet find_help_dialog
+
+silent! unlet menutrans_help_dialog
+silent! unlet menutrans_path_dialog
+silent! unlet menutrans_tags_dialog
+silent! unlet menutrans_textwidth_dialog
+silent! unlet menutrans_fileformat_dialog
+silent! unlet menutrans_no_file
+
+" vim: set sw=2 :
diff --git a/runtime/doc.info b/runtime/doc.info
new file mode 100755
index 000000000..a836031ee
--- /dev/null
+++ b/runtime/doc.info
Binary files differ
diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile
new file mode 100644
index 000000000..a87565ebe
--- /dev/null
+++ b/runtime/doc/Makefile
@@ -0,0 +1,363 @@
+#
+# Makefile for the Vim documentation on Unix
+#
+# If you get "don't know how to make scratch", first run make in the source
+# directory. Or remove the include below.
+
+AWK = awk
+
+# Set to $(VIMTARGET) when executed from src/Makefile.
+VIMEXE = vim
+
+# include the config.mk from the source directory. It's only needed to set
+# AWK, used for "make html". Comment this out if the include gives problems.
+include ../../src/auto/config.mk
+
+DOCS = \
+ arabic.txt \
+ autocmd.txt \
+ change.txt \
+ cmdline.txt \
+ debugger.txt \
+ develop.txt \
+ diff.txt \
+ digraph.txt \
+ editing.txt \
+ eval.txt \
+ farsi.txt \
+ filetype.txt \
+ fold.txt \
+ gui.txt \
+ gui_w16.txt \
+ gui_w32.txt \
+ gui_x11.txt \
+ hangulin.txt \
+ hebrew.txt \
+ help.txt \
+ howto.txt \
+ if_cscop.txt \
+ if_ole.txt \
+ if_perl.txt \
+ if_pyth.txt \
+ if_ruby.txt \
+ if_sniff.txt \
+ if_tcl.txt \
+ indent.txt \
+ index.txt \
+ insert.txt \
+ intro.txt \
+ map.txt \
+ message.txt \
+ motion.txt \
+ mbyte.txt \
+ mlang.txt \
+ netbeans.txt \
+ options.txt \
+ os_390.txt \
+ os_amiga.txt \
+ os_beos.txt \
+ os_dos.txt \
+ os_mac.txt \
+ os_mint.txt \
+ os_msdos.txt \
+ os_os2.txt \
+ os_qnx.txt \
+ os_risc.txt \
+ os_unix.txt \
+ os_vms.txt \
+ os_win32.txt \
+ pattern.txt \
+ pi_expl.txt \
+ pi_gzip.txt \
+ pi_netrw.txt \
+ pi_spec.txt \
+ quickfix.txt \
+ quickref.txt \
+ quotes.txt \
+ recover.txt \
+ remote.txt \
+ repeat.txt \
+ rileft.txt \
+ russian.txt \
+ scroll.txt \
+ sign.txt \
+ sponsor.txt \
+ starting.txt \
+ syntax.txt \
+ tagsrch.txt \
+ term.txt \
+ tips.txt \
+ todo.txt \
+ uganda.txt \
+ undo.txt \
+ usr_01.txt \
+ usr_02.txt \
+ usr_03.txt \
+ usr_04.txt \
+ usr_05.txt \
+ usr_06.txt \
+ usr_07.txt \
+ usr_08.txt \
+ usr_09.txt \
+ usr_10.txt \
+ usr_11.txt \
+ usr_12.txt \
+ usr_20.txt \
+ usr_21.txt \
+ usr_22.txt \
+ usr_23.txt \
+ usr_24.txt \
+ usr_25.txt \
+ usr_26.txt \
+ usr_27.txt \
+ usr_28.txt \
+ usr_29.txt \
+ usr_30.txt \
+ usr_31.txt \
+ usr_40.txt \
+ usr_41.txt \
+ usr_42.txt \
+ usr_43.txt \
+ usr_44.txt \
+ usr_45.txt \
+ usr_90.txt \
+ usr_toc.txt \
+ various.txt \
+ version4.txt \
+ version5.txt \
+ version6.txt \
+ vi_diff.txt \
+ visual.txt \
+ windows.txt \
+ workshop.txt
+
+HTMLS = \
+ arabic.html \
+ autocmd.html \
+ change.html \
+ cmdline.html \
+ debugger.html \
+ develop.html \
+ diff.html \
+ digraph.html \
+ editing.html \
+ eval.html \
+ farsi.html \
+ filetype.html \
+ fold.html \
+ gui.html \
+ gui_w16.html \
+ gui_w32.html \
+ gui_x11.html \
+ hangulin.html \
+ hebrew.html \
+ help.html \
+ howto.html \
+ if_cscop.html \
+ if_ole.html \
+ if_perl.html \
+ if_pyth.html \
+ if_ruby.html \
+ if_sniff.html \
+ if_tcl.html \
+ indent.html \
+ index.html \
+ insert.html \
+ intro.html \
+ map.html \
+ message.html \
+ motion.html \
+ mbyte.html \
+ mlang.html \
+ netbeans.html \
+ options.html \
+ os_390.html \
+ os_amiga.html \
+ os_beos.html \
+ os_dos.html \
+ os_mac.html \
+ os_mint.html \
+ os_msdos.html \
+ os_os2.html \
+ os_qnx.html \
+ os_risc.html \
+ os_unix.html \
+ os_vms.html \
+ os_win32.html \
+ pattern.html \
+ pi_expl.html \
+ pi_gzip.html \
+ pi_netrw.html \
+ pi_spec.html \
+ quickfix.html \
+ quickref.html \
+ quotes.html \
+ recover.html \
+ remote.html \
+ repeat.html \
+ rileft.html \
+ russian.html \
+ scroll.html \
+ sign.html \
+ sponsor.html \
+ starting.html \
+ syntax.html \
+ tagsrch.html \
+ tags.html \
+ term.html \
+ tips.html \
+ todo.html \
+ uganda.html \
+ undo.html \
+ usr_01.html \
+ usr_02.html \
+ usr_03.html \
+ usr_04.html \
+ usr_05.html \
+ usr_06.html \
+ usr_07.html \
+ usr_08.html \
+ usr_09.html \
+ usr_10.html \
+ usr_11.html \
+ usr_12.html \
+ usr_20.html \
+ usr_21.html \
+ usr_22.html \
+ usr_23.html \
+ usr_24.html \
+ usr_25.html \
+ usr_26.html \
+ usr_27.html \
+ usr_28.html \
+ usr_29.html \
+ usr_30.html \
+ usr_31.html \
+ usr_40.html \
+ usr_41.html \
+ usr_42.html \
+ usr_43.html \
+ usr_44.html \
+ usr_45.html \
+ usr_90.html \
+ usr_toc.html \
+ various.html \
+ version4.html \
+ version5.html \
+ version6.html \
+ vi_diff.html \
+ visual.html \
+ windows.html \
+ workshop.html
+
+.SUFFIXES:
+.SUFFIXES: .c .o .txt .html
+
+all: tags vim.man vimdiff.man vimtutor.man xxd.man
+
+# Use Vim to generate the tags file. Can only be used when Vim has been
+# compiled and installed. Supports multiple languages.
+vimtags: $(DOCS)
+ $(VIMEXE) -u NONE -esX -c "helptags ." -c quit
+
+# Use "doctags" to generate the tags file. Only works for English!
+tags: doctags $(DOCS)
+ ./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
+ uniq -d -2 tags
+
+doctags: doctags.c
+ $(CC) doctags.c -o doctags
+
+vim.man: vim.1
+ nroff -man vim.1 | sed -e s/.//g > vim.man
+
+vimdiff.man: vimdiff.1
+ nroff -man vimdiff.1 | sed -e s/.//g > vimdiff.man
+
+vimtutor.man: vimtutor.1
+ nroff -man vimtutor.1 | sed -e s/.//g > vimtutor.man
+
+xxd.man: xxd.1
+ nroff -man xxd.1 | sed -e s/.//g > xxd.man
+
+uganda.nsis.txt: uganda.txt
+ sed -e 's/[ ]*\*[-a-zA-Z0-9.]*\*//g' -e 's/vim:tw=78://' \
+ uganda.txt | uniq >uganda.nsis.txt
+
+# Awk version of .txt to .html conversion.
+html: noerrors tags tags.ref $(HTMLS)
+ @if test -f errors.log; then more errors.log; fi
+
+noerrors:
+ -rm -f errors.log
+
+.txt.html:
+ $(AWK) -f makehtml.awk $< >$@
+
+tags.ref tags.html: tags
+ $(AWK) -f maketags.awk tags >tags.html
+
+# Perl version of .txt to .html conversion.
+# There can't be two rules to produce a .html from a .txt file.
+# Just run over all .txt files each time one changes. It's fast anyway.
+perlhtml: tags $(DOCS)
+ ./vim2html.pl tags $(DOCS)
+
+clean:
+ -rm doctags *.html tags.ref
+
+# These files are in the extra archive, skip if not present
+
+arabic.txt:
+ touch arabic.txt
+
+farsi.txt:
+ touch farsi.txt
+
+hebrew.txt:
+ touch hebrew.txt
+
+russian.txt:
+ touch russian.txt
+
+gui_w16.txt:
+ touch gui_w16.txt
+
+gui_w32.txt:
+ touch gui_w32.txt
+
+if_ole.txt:
+ touch if_ole.txt
+
+os_390.txt:
+ touch os_390.txt
+
+os_amiga.txt:
+ touch os_amiga.txt
+
+os_beos.txt:
+ touch os_beos.txt
+
+os_dos.txt:
+ touch os_dos.txt
+
+os_mac.txt:
+ touch os_mac.txt
+
+os_mint.txt:
+ touch os_mint.txt
+
+os_msdos.txt:
+ touch os_msdos.txt
+
+os_os2.txt:
+ touch os_os2.txt
+
+os_qnx.txt:
+ touch os_qnx.txt
+
+os_risc.txt:
+ touch os_risc.txt
+
+os_win32.txt:
+ touch os_win32.txt
diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt
new file mode 100644
index 000000000..2d961485a
--- /dev/null
+++ b/runtime/doc/arabic.txt
@@ -0,0 +1,323 @@
+*arabic.txt* For Vim version 7.0aa. Last change: 2004 Jun 09
+
+
+ VIM REFERENCE MANUAL by Nadim Shaikli
+
+
+Arabic Language support (options & mappings) for Vim *Arabic*
+
+{Vi does not have any of these commands}
+
+ *E800*
+In order to use right-to-left and Arabic mapping support, it is
+necessary to compile VIM with the |+arabic| feature.
+
+These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org>
+
+It is best to view this file with these settings within VIM's GUI: >
+
+ :set encoding=utf-8
+ :set arabicshape
+
+
+Introduction
+------------
+Arabic is a rather demanding language in which a number of special
+features are required. Characters are right-to-left oriented and
+ought to appear as such on the screen (ie. from right to left).
+Arabic also requires shaping of its characters, meaning the same
+character has a different visual form based on its relative location
+within a word (initial, medial, final or stand-alone). Arabic also
+requires two different forms of combining and the ability, in
+certain instances, to either superimpose up to two characters on top
+of another (composing) or the actual substitution of two characters
+into one (combining). Lastly, to display Arabic properly one will
+require not only ISO-8859-6 (U+0600-U+06FF) fonts, but will also
+require Presentation Form-B (U+FE70-U+FEFF) fonts both of which are
+subsets within a so-called ISO-10646-1 font.
+
+The commands, prompts and help files are not in Arabic, therefore
+the user interface remains the standard Vi interface.
+
+
+Highlights
+----------
+o Editing left-to-right files as in the original VIM hasn't changed.
+
+o Viewing and editing files in right-to-left windows. File
+ orientation is per window, so it is possible to view the same
+ file in right-to-left and left-to-right modes, simultaneously.
+
+o No special terminal with right-to-left capabilities is required.
+ The right-to-left changes are completely hardware independent.
+ Only Arabic fonts are necessary.
+
+o Compatible with the original VIM. Almost all features work in
+ right-to-left mode (there are liable to be bugs).
+
+o Changing keyboard mapping and reverse insert modes using a single
+ command.
+
+o Toggling complete Arabic support via a single command.
+
+o While in Arabic mode, numbers are entered from left to right. Upon
+ entering a none number character, that character will be inserted
+ just into the left of the last number.
+
+o Arabic keymapping on the command line in reverse insert mode.
+
+o Proper Bidirectional functionality is possible given VIM is
+ started within a Bidi capable terminal emulator.
+
+
+Arabic Fonts *arabicfonts*
+------------
+
+VIM requires monospaced fonts of which there are many out there.
+Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
+(without Form-B, Arabic will _NOT_ be usable). It is highly
+recommended that users search for so-called 'ISO-10646-1' fonts.
+Do an Internet search or check www.arabeyes.org for further
+info on where to attain the necessary Arabic fonts.
+
+
+Font Installation
+-----------------
+
+o Installation of fonts for X Window systems (Unix/Linux)
+
+ Depending on your system, copy your_ARABIC_FONT file into a
+ directory of your choice. Change to the directory containing
+ the Arabic fonts and execute the following commands:
+
+ % mkfontdir
+ % xset +fp path_name_of_arabic_fonts_directory
+
+
+Usage
+-----
+Prior to the actual usage of Arabic within VIM, a number of settings
+need to be accounted for and invoked.
+
+o Setting the Arabic fonts
+
+ + For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
+ by entering the following command in the VIM window.
+>
+ :set guifont=your_ARABIC_FONT
+<
+ NOTE: the string 'your_ARABIC_FONT' is used to denote a complete
+ font name akin to that used in linux/unix system.
+ (eg. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1)
+
+ You can append the 'guifont' set command to your .vimrc file
+ in order to get the same above noted results. In other words,
+ you can include ':set guifont=your_ARABIC_FONT' to your .vimrc
+ file.
+
+ + Under the X Window environment, you can also start VIM with
+ '-fn your_ARABIC_FONT' option.
+
+o Setting the appropriate character Encoding
+ To enable the correct Arabic encoding the following command needs
+ to be appended,
+>
+ :set encoding=utf-8
+<
+ to your .vimrc file (entering the command manually into you VIM
+ window is highly discouraged). In short, include ':set
+ encoding=utf-8' to your .vimrc file.
+
+ Attempts to use Arabic without UTF-8 will result the following
+ warning message,
+
+ *W17* >
+ Arabic requires UTF-8, do ':set encoding=utf-8'
+
+o Enable Arabic settings [short-cut]
+
+ In order to simplify and streamline things, you can either invoke
+ VIM with the command-line option,
+
+ % vim -A my_utf8_arabic_file ...
+
+ or enable 'arabic' via the following command within VIM
+>
+ :set arabic
+<
+ The two above noted possible invocations are the preferred manner
+ in which users are instructed to proceed. Baring an enabled 'termbidi'
+ setting, both command options:
+
+ 1. set the appropriate keymap
+ 2. enable the deletion of a single combined pair character
+ 3. enable rightleft mode
+ 4. enable rightleftcmd mode (affecting the command-line)
+ 5. enable arabicshape mode (do visual character alterations)
+
+ You may also append the command to your .vimrc file and simply
+ include ':set arabic' to it.
+
+ You are also capable of disabling Arabic support via
+>
+ :set noarabic
+<
+ which resets everything that the command had enabled without touching
+ the global settings as they could affect other possible open buffers.
+ In short the 'noarabic' command,
+
+ 1. resets to the alternate keymap
+ 2. disables the deletion of a single combined pair character
+ 3. disables rightleft mode
+
+ NOTE: the 'arabic' command takes into consideration 'termbidi' for
+ possible external bi-directional (bidi) support from the
+ terminal ("mlterm" for instance offers such support).
+ 'termbidi', if available, is superior to rightleft support
+ and its support is preferred due to its level of offerings.
+ 'arabic' when 'termbidi' is enabled only sets the keymap.
+
+ If, on the other hand, you'd like to be verbose and explicit and
+ are opting not to use the 'arabic' short-cut command, here's what
+ is needed (ie. if you use ':set arabic' you can skip this section) -
+
+ + Arabic Keymapping Activation
+
+ To activate the Arabic keymap (ie. to remap your English/Latin
+ keyboard to look-n-feel like a standard Arabic one), set the
+ 'keymap' command to "arabic". This is done by entering
+>
+ :set keymap=arabic
+<
+ in your VIM window. You can also append the 'keymap' set command to
+ your .vimrc file. In other words, you can include ':set keymap=arabic'
+ to your .vimrc file.
+
+ To turn toggle (or switch) your keymapping between Arabic and the
+ default mapping (English), it is advised that users use the 'CTRL-^'
+ key press while in insert (or add/replace) mode. The command-line
+ will display your current mapping by displaying an "Arabic" string
+ next to your insertion mode (eg. -- INSERT Arabic --) indicating
+ your current keymap.
+
+ + Arabic deletion of a combined pair character
+
+ By default VIM has the 'delcombine' option disabled. This option
+ allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
+ and still retain the LAM (ie. it reverts to treating the combined
+ character as its natural two characters form -- this also pertains
+ to harakat and their combined forms). You can enable this option
+ by entering
+>
+ :set delcombine
+<
+ in our VIM window. You can also append the 'delcombine' set command
+ to your .vimrc file. In other words, you can include ':set delcombine'
+ to your .vimrc file.
+
+ + Arabic right-to-left Mode
+
+ By default VIM starts in Left-to-right mode. 'rightleft' is the
+ command that allows one to alter a window's orientation - that can
+ be accomplished via,
+
+ - Toggling between left-to-right and right-to-left modes is
+ accomplished through ':set rightleft' and ':set norightleft'.
+
+ - While in Left-to-right mode, enter ':set rl' in the command line
+ ('rl' is the abbreviation for rightleft).
+
+ - Put the ':set rl' line in your '.vimrc' file to start the VIM in
+ right-to-left mode permanently.
+
+ + Arabic right-to-left command-line Mode
+
+ For certain commands the editing can be done in right-to-left mode.
+ Currently this is only applicable to search commands.
+
+ This is controlled with the 'rightleftcmd' option. The default is
+ "search", which means that windows in which 'rightleft' is set will
+ edit search commands in right-left mode. To disable this behavior,
+>
+ :set rightleftcmd=
+<
+ To enable right-left editing of search commands again,
+>
+ :set rightleftcmd&
+<
+ + Arabic Shaping Mode
+
+ To activate the required visual characters alterations (shaping,
+ composing, combining) which the Arabic language requires, enable
+ the 'arabicshape' command. This is done by entering
+>
+ :set arabicshape
+<
+ in our VIM window. You can also append the 'arabicshape' set
+ command to your .vimrc file. In other words, you can include
+ ':set arabicshape' to your .vimrc file.
+
+
+Keymap/Keyboard *arabickeymap*
+---------------
+
+The character/letter encoding used in VIM is the standard UTF-8.
+It is widely discouraged that any other encoding be used or even
+attempted.
+
+Note: UTF-8 is an all encompassing encoding and as such is
+ the only supported (and encouraged) encoding with
+ regard to Arabic (all other proprietary encodings
+ should be discouraged and frowned upon).
+
+o Keyboard
+
+ + CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
+
+ + Keyboard mapping is based on the Microsoft's Arabic keymap (the
+ defacto standard in the Arab world):
+
+ +---------------------------------------------------------------------+
+ |! |@ |# |$ |% |^ |& |* |( |) |_ |+ || |~ Ù‘ |
+ |1 Ù¡ |2 Ù¢ |3 Ù£ |4 Ù¤ |5 Ù¥ |6 Ù¦ |7 Ù§ |8 Ù¨ |9 Ù© |0 Ù  |- |= |\ |` Ø° |
+ +---------------------------------------------------------------------+
+ |Q َ |W ً |E ٠|R ٌ |T لإ |Y إ |U ` |I ÷ |O x |P ؛ |{ < |} > |
+ |q ض |w ص |e ث |r ق |t ٠|y غ |u ع |i ه |o خ |p ح |[ ج |] د |
+ +-----------------------------------------------------------+
+ |A ٠|S ٠|D [ |F ] |G لأ |H أ |J ـ |K ، |L / |: |" |
+ |a ش |s س |d ي |f ب |g ل |h ا |j ت |k ن |l م |; ك |' ط |
+ +------------------------------------------------------+
+ |Z ~ |X ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ |
+ |z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
+ +-------------------------------------------------+
+
+Restrictions
+------------
+
+o VIM in its GUI form does not currently support Bi-directionality
+ (ie. the ability to see both Arabic and Latin intermixed within
+ the same line).
+
+
+Known Bugs
+----------
+
+There is one known minor bug,
+
+ 1. If you insert a haraka (eg. Fatha (U+064E)) after a LAM (U+0644)
+ and then insert an ALEF (U+0627), the appropriate combining will
+ not happen due to the sandwiched haraka resulting in something
+ that will NOT be displayed correctly.
+
+ WORK-AROUND: Don't include harakats between LAM and ALEF combos.
+ In general, don't anticipate to see correct visual
+ representation with regard to harakats and LAM+ALEF
+ combined characters (even those entered after both
+ characters). The problem noted is strictly a visual
+ one, meaning saving such a file will contain all the
+ appropriate info/encodings - nothing is lost.
+
+No other bugs are known to exist.
+
+ vim:tw=78:ts=8:ft=help:norl:
+
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
new file mode 100644
index 000000000..4cc747211
--- /dev/null
+++ b/runtime/doc/autocmd.txt
@@ -0,0 +1,904 @@
+*autocmd.txt* For Vim version 7.0aa. Last change: 2004 Apr 20
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Automatic commands *autocommand*
+
+For a basic explanation, see section |40.3| in the user manual.
+
+1. Introduction |autocmd-intro|
+2. Defining autocommands |autocmd-define|
+3. Removing autocommands |autocmd-remove|
+4. Listing autocommands |autocmd-list|
+5. Events |autocmd-events|
+6. Patterns |autocmd-patterns|
+7. Groups |autocmd-groups|
+8. Executing autocommands |autocmd-execute|
+9. Using autocommands |autocmd-use|
+
+{Vi does not have any of these commands}
+{only when the |+autocmd| feature has not been disabled at compile time}
+
+==============================================================================
+1. Introduction *autocmd-intro*
+
+You can specify commands to be executed automatically for when reading or
+writing a file, when entering or leaving a buffer or window, and when exiting
+Vim. For example, you can create an autocommand to set the 'cindent' option
+for files matching *.c. You can also use autocommands to implement advanced
+features, such as editing compressed files (see |gzip-example|). The usual
+place to put autocommands is in your .vimrc or .exrc file.
+
+ *E203* *E204* *E143*
+WARNING: Using autocommands is very powerful, and may lead to unexpected side
+effects. Be careful not to destroy your text.
+- It's a good idea to do some testing on an expendable copy of a file first.
+ For example: If you use autocommands to decompress a file when starting to
+ edit it, make sure that the autocommands for compressing when writing work
+ correctly.
+- Be prepared for an error halfway through (e.g., disk full). Vim will mostly
+ be able to undo the changes to the buffer, but you may have to clean up the
+ changes to other files by hand (e.g., compress a file that has been
+ decompressed).
+- If the BufRead* events allow you to edit a compressed file, the FileRead*
+ events should do the same (this makes recovery possible in some rare cases).
+ It's a good idea to use the same autocommands for the File* and Buf* events
+ when possible.
+
+==============================================================================
+2. Defining autocommands *autocmd-define*
+
+Note: The ":autocmd" command cannot be followed by another command, since any
+'|' is considered part of the command.
+
+ *:au* *:autocmd*
+:au[tocmd] [group] {event} {pat} [nested] {cmd}
+ Add {cmd} to the list of commands that Vim will
+ execute automatically on {event} for a file matching
+ {pat}. Vim always adds the {cmd} after existing
+ autocommands, so that the autocommands execute in the
+ order in which they were given. See |autocmd-nested|
+ for [nested].
+
+Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
+arguments are not expanded when the autocommand is defined. These will be
+expanded when the Event is recognized, and the {cmd} is executed. The only
+exception is that "<sfile>" is expanded when the autocmd is defined. Example:
+>
+ :au BufNewFile,BufRead *.html so <sfile>:h/html.vim
+
+Here Vim expands <sfile> to the name of the file containing this line.
+
+When your .vimrc file is sourced twice, the autocommands will appear twice.
+To avoid this, put this command in your .vimrc file, before defining
+autocommands: >
+
+ :autocmd! " Remove ALL autocommands for the current group.
+
+If you don't want to remove all autocommands, you can instead use a variable
+to ensure that Vim includes the autocommands only once: >
+
+ :if !exists("autocommands_loaded")
+ : let autocommands_loaded = 1
+ : au ...
+ :endif
+
+When the [group] argument is not given, Vim uses the current group (as defined
+with ":augroup"); otherwise, Vim uses the group defined with [group]. Note
+that [group] must have been defined before. You cannot define a new group
+with ":au group ..."; use ":augroup" for that.
+
+While testing autocommands, you might find the 'verbose' option to be useful: >
+ :set verbose=9
+This setting makes Vim echo the autocommands as it executes them.
+
+When defining an autocommand in a script, it will be able to call functions
+local to the script and use mappings local to the script. When the event is
+triggered and the command executed, it will run in the context of the script
+it was defined in. This matters if |<SID>| is used in a command.
+
+When executing the commands, the messages from one command overwrites a
+previous message. This is different from when executing the commands
+manually. Mostly the screen will not scroll up, thus there is no hit-enter
+prompt. When one command outputs two messages this can happen anyway.
+
+==============================================================================
+3. Removing autocommands *autocmd-remove*
+
+:au[tocmd]! [group] {event} {pat} [nested] {cmd}
+ Remove all autocommands associated with {event} and
+ {pat}, and add the command {cmd}. See
+ |autocmd-nested| for [nested].
+
+:au[tocmd]! [group] {event} {pat}
+ Remove all autocommands associated with {event} and
+ {pat}.
+
+:au[tocmd]! [group] * {pat}
+ Remove all autocommands associated with {pat} for all
+ events.
+
+:au[tocmd]! [group] {event}
+ Remove ALL autocommands for {event}.
+
+:au[tocmd]! [group] Remove ALL autocommands.
+
+When the [group] argument is not given, Vim uses the current group (as defined
+with ":augroup"); otherwise, Vim uses the group defined with [group].
+
+==============================================================================
+4. Listing autocommands *autocmd-list*
+
+:au[tocmd] [group] {event} {pat}
+ Show the autocommands associated with {event} and
+ {pat}.
+
+:au[tocmd] [group] * {pat}
+ Show the autocommands associated with {pat} for all
+ events.
+
+:au[tocmd] [group] {event}
+ Show all autocommands for {event}.
+
+:au[tocmd] [group] Show all autocommands.
+
+If you provide the [group] argument, Vim lists only the autocommands for
+[group]; otherwise, Vim lists the autocommands for ALL groups. Note that this
+argument behavior differs from that for defining and removing autocommands.
+
+==============================================================================
+5. Events *autocmd-events* *E215* *E216*
+
+ *autocommand-events* *{event}*
+Vim recognizes the following events. Vim ignores the case of event names
+(e.g., you can use "BUFread" or "bufread" instead of "BufRead").
+
+ *BufNewFile*
+BufNewFile When starting to edit a file that doesn't
+ exist. Can be used to read in a skeleton
+ file.
+ *BufReadPre* *E200* *E201*
+BufReadPre When starting to edit a new buffer, before
+ reading the file into the buffer. Not used
+ if the file doesn't exist.
+ *BufRead* *BufReadPost*
+BufRead or BufReadPost When starting to edit a new buffer, after
+ reading the file into the buffer, before
+ executing the modelines. See |BufWinEnter|
+ for when you need to do something after
+ processing the modelines.
+ This does NOT work for ":r file". Not used
+ when the file doesn't exist. Also used after
+ successfully recovering a file.
+ *BufReadCmd*
+BufReadCmd Before starting to edit a new buffer. Should
+ read the file into the buffer. |Cmd-event|
+ *BufFilePre*
+BufFilePre Before changing the name of the current buffer
+ with the ":file" or ":saveas" command.
+ *BufFilePost*
+BufFilePost After changing the name of the current buffer
+ with the ":file" or ":saveas" command.
+ *FileReadPre*
+FileReadPre Before reading a file with a ":read" command.
+ *FileReadPost*
+FileReadPost After reading a file with a ":read" command.
+ Note that Vim sets the '[ and '] marks to the
+ first and last line of the read. This can be
+ used to operate on the lines just read.
+ *FileReadCmd*
+FileReadCmd Before reading a file with a ":read" command.
+ Should do the reading of the file. |Cmd-event|
+ *FilterReadPre* *E135*
+FilterReadPre Before reading a file from a filter command.
+ Vim checks the pattern against the name of
+ the current buffer, not the name of the
+ temporary file that is the output of the
+ filter command.
+ *FilterReadPost*
+FilterReadPost After reading a file from a filter command.
+ Vim checks the pattern against the name of
+ the current buffer as with FilterReadPre.
+ *FileType*
+FileType When the 'filetype' option has been set.
+ <afile> can be used for the name of the file
+ where this option was set, and <amatch> for
+ the new value of 'filetype'.
+ See |filetypes|.
+ *Syntax*
+Syntax When the 'syntax' option has been set.
+ <afile> can be used for the name of the file
+ where this option was set, and <amatch> for
+ the new value of 'syntax'.
+ See |:syn-on|.
+ *StdinReadPre*
+StdinReadPre Before reading from stdin into the buffer.
+ Only used when the "-" argument was used when
+ Vim was started |--|.
+ *StdinReadPost*
+StdinReadPost After reading from the stdin into the buffer,
+ before executing the modelines. Only used
+ when the "-" argument was used when Vim was
+ started |--|.
+ *BufWrite* *BufWritePre*
+BufWrite or BufWritePre Before writing the whole buffer to a file.
+ *BufWritePost*
+BufWritePost After writing the whole buffer to a file
+ (should undo the commands for BufWritePre).
+ *BufWriteCmd*
+BufWriteCmd Before writing the whole buffer to a file.
+ Should do the writing of the file and reset
+ 'modified' if successful. The buffer contents
+ should not be changed. |Cmd-event|
+ *FileWritePre*
+FileWritePre Before writing to a file, when not writing the
+ whole buffer.
+ *FileWritePost*
+FileWritePost After writing to a file, when not writing the
+ whole buffer.
+ *FileWriteCmd*
+FileWriteCmd Before writing to a file, when not writing the
+ whole buffer. Should do the writing to the
+ file. Should not change the buffer.
+ |Cmd-event|
+ *FileAppendPre*
+FileAppendPre Before appending to a file.
+ *FileAppendPost*
+FileAppendPost After appending to a file.
+ *FileAppendCmd*
+FileAppendCmd Before appending to a file. Should do the
+ appending to the file. |Cmd-event|
+ *FilterWritePre*
+FilterWritePre Before writing a file for a filter command or
+ making a diff.
+ Vim checks the pattern against the name of
+ the current buffer, not the name of the
+ temporary file that is the output of the
+ filter command.
+ *FilterWritePost*
+FilterWritePost After writing a file for a filter command or
+ making a diff.
+ Vim checks the pattern against the name of
+ the current buffer as with FilterWritePre.
+ *FileChangedShell*
+FileChangedShell When Vim notices that the modification time of
+ a file has changed since editing started.
+ Also when the file attributes of the file
+ change. |timestamp|
+ Mostly triggered after executing a shell
+ command, but also with a |:checktime| command
+ or when Vim regains input focus.
+ This autocommand is triggered for each changed
+ file. It is not used when 'autoread' is set
+ and the buffer was not changed. If a
+ FileChangedShell autocommand is present the
+ warning message and prompt is not given.
+ This is useful for reloading related buffers
+ which are affected by a single command.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer that was changed "<afile>".
+ NOTE: The commands must not change the current
+ buffer, jump to another buffer or delete a
+ buffer. *E246*
+ NOTE: This event never nests, to avoid an
+ endless loop. This means that while executing
+ commands for the FileChangedShell event no
+ other FileChangedShell event will be
+ triggered.
+ *FileChangedRO*
+FileChangedRO Before making the first change to a read-only
+ file. Can be used to check-out the file from
+ a source control system. Not triggered when
+ the change was caused by an autocommand.
+ WARNING: This event is triggered when making a
+ change, just before the change is applied to
+ the text. If the autocommand moves the cursor
+ the effect of the change is undefined.
+ *FocusGained*
+FocusGained When Vim got input focus. Only for the GUI
+ version and a few console versions where this
+ can be detected.
+ *FocusLost*
+FocusLost When Vim lost input focus. Only for the GUI
+ version and a few console versions where this
+ can be detected.
+ *FuncUndefined*
+FuncUndefined When a user function is used but it isn't
+ defined. Useful for defining a function only
+ when it's used. Both <amatch> and <afile> are
+ set to the name of the function.
+ *CursorHold*
+CursorHold When the user doesn't press a key for the time
+ specified with 'updatetime'. Not re-triggered
+ until the user has pressed a key (i.e. doesn't
+ fire every 'updatetime' ms if you leave Vim to
+ make some coffee. :) See |CursorHold-example|
+ for previewing tags.
+ This event is only triggered in Normal mode.
+ Note: Interactive commands cannot be used for
+ this event. There is no hit-enter prompt,
+ the screen is updated directly (when needed).
+ Note: In the future there will probably be
+ another option to set the time.
+ Hint: to force an update of the status lines
+ use: >
+ :let &ro = &ro
+< {only on Amiga, Unix, Win32, MSDOS and all GUI
+ versions}
+ *BufEnter*
+BufEnter After entering a buffer. Useful for setting
+ options for a file type. Also executed when
+ starting to edit a buffer, after the
+ BufReadPost autocommands.
+ *BufLeave*
+BufLeave Before leaving to another buffer. Also when
+ leaving or closing the current window and the
+ new current window is not for the same buffer.
+ Not used for ":qa" or ":q" when exiting Vim.
+ *BufWinEnter*
+BufWinEnter After a buffer is displayed in a window. This
+ can be when the buffer is loaded (after
+ processing the modelines), when a hidden
+ buffer is displayed in a window (and is no
+ longer hidden) or a buffer already visible in
+ a window is also displayed in another window.
+ *BufWinLeave*
+BufWinLeave Before a buffer is removed from a window.
+ Not when it's still visible in another window.
+ Also triggered when exiting. It's triggered
+ before BufUnload or BufHidden.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being unloaded "<afile>".
+ *BufUnload*
+BufUnload Before unloading a buffer. This is when the
+ text in the buffer is going to be freed. This
+ may be after a BufWritePost and before a
+ BufDelete. Also used for all buffers that are
+ loaded when Vim is going to exit.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being unloaded "<afile>".
+ *BufHidden*
+BufHidden Just after a buffer has become hidden. That
+ is, when there are no longer windows that show
+ the buffer, but the buffer is not unloaded or
+ deleted. Not used for ":qa" or ":q" when
+ exiting Vim.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being unloaded "<afile>".
+ *BufNew*
+BufNew Just after creating a new buffer. Also used
+ just after a buffer has been renamed. When
+ the buffer is added to the buffer list BufAdd
+ will be triggered too.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being created "<afile>".
+ *BufCreate* *BufAdd*
+BufAdd or BufCreate Just after creating a new buffer which is
+ added to the buffer list, or adding a buffer
+ to the buffer list.
+ Also used just after a buffer in the buffer
+ list has been renamed.
+ The BufCreate event is for historic reasons.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being created "<afile>".
+ *BufDelete*
+BufDelete Before deleting a buffer from the buffer list.
+ The BufUnload may be called first (if the
+ buffer was loaded).
+ Also used just before a buffer in the buffer
+ list is renamed.
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being deleted "<afile>".
+ *BufWipeout*
+BufWipeout Before completely deleting a buffer. The
+ BufUnload and BufDelete events may be called
+ first (if the buffer was loaded and was in the
+ buffer list). Also used just before a buffer
+ is renamed (also when it's not in the buffer
+ list).
+ NOTE: When this autocommand is executed, the
+ current buffer "%" may be different from the
+ buffer being deleted "<afile>".
+ *WinEnter*
+WinEnter After entering another window. Not done for
+ the first window, when Vim has just started.
+ Useful for setting the window height.
+ If the window is for another buffer, Vim
+ executes the BufEnter autocommands after the
+ WinEnter autocommands.
+ Note: When using ":split fname" the WinEnter
+ event is triggered after the split but before
+ the file "fname" is loaded.
+ *WinLeave*
+WinLeave Before leaving a window. If the window to be
+ entered next is for a different buffer, Vim
+ executes the BufLeave autocommands before the
+ WinLeave autocommands (but not for ":new").
+ Not used for ":qa" or ":q" when exiting Vim.
+ *CmdwinEnter*
+CmdwinEnter After entering the command-line window.
+ Useful for setting options specifically for
+ this special type of window. This is
+ triggered _instead_ of BufEnter and WinEnter.
+ <afile> is set to a single character,
+ indicating the type of command-line.
+ |cmdwin-char|
+ *CmdwinLeave*
+CmdwinLeave Before leaving the command-line window.
+ Useful to clean up any global setting done
+ with CmdwinEnter. This is triggered _instead_
+ of BufLeave and WinLeave.
+ <afile> is set to a single character,
+ indicating the type of command-line.
+ |cmdwin-char|
+ *GUIEnter*
+GUIEnter After starting the GUI successfully, and after
+ opening the window. It is triggered before
+ VimEnter when using gvim. Can be used to
+ position the window from a .gvimrc file: >
+ :autocmd GUIEnter * winpos 100 50
+< *VimEnter*
+VimEnter After doing all the startup stuff, including
+ loading .vimrc files, executing the "-c cmd"
+ arguments, creating all windows and loading
+ the buffers in them.
+ *VimLeavePre*
+VimLeavePre Before exiting Vim, just before writing the
+ .viminfo file. This is executed only once,
+ if there is a match with the name of what
+ happens to be the current buffer when exiting.
+ Mostly useful with a "*" pattern. >
+ :autocmd VimLeavePre * call CleanupStuff()
+< To detect an abnormal exit use |v:dying|.
+ *VimLeave*
+VimLeave Before exiting Vim, just after writing the
+ .viminfo file. Executed only once, like
+ VimLeavePre.
+ To detect an abnormal exit use |v:dying|.
+ *EncodingChanged*
+EncodingChanged Fires off when the 'encoding' option is
+ changed. Useful to set up fonts, for example.
+ *FileEncoding*
+FileEncoding Obsolete. It still works and is equivalent
+ to |EncodingChanged|.
+ *RemoteReply*
+RemoteReply When a reply from a Vim that functions as
+ server was received |server2client()|.
+ <amatch> is equal to the {serverid} from which
+ the reply was sent, and <afile> is the actual
+ reply string.
+ Note that even if an autocommand is defined,
+ the reply should be read with |remote_read()|
+ to consume it.
+ *TermChanged*
+TermChanged After the value of 'term' has changed. Useful
+ for re-loading the syntax file to update the
+ colors, fonts and other terminal-dependent
+ settings. Executed for all loaded buffers.
+ *TermResponse*
+TermResponse After the response to |t_RV| is received from
+ the terminal. The value of |v:termresponse|
+ can be used to do things depending on the
+ terminal version.
+ *UserGettingBored*
+UserGettingBored When the user hits CTRL-C. Just kidding! :-)
+ *User*
+User Never executed automatically. To be used for
+ autocommands that are only executed with
+ ":doautocmd".
+
+You can specify a comma-separated list of event names. No white space can be
+used in this list. The command applies to all the events in the list.
+
+For READING FILES there are four kinds of events possible:
+ BufNewFile starting to edit a non-existent file
+ BufReadPre BufReadPost starting to edit an existing file
+ FilterReadPre FilterReadPost read the temp file with filter output
+ FileReadPre FileReadPost any other file read
+Vim uses only one of these four kinds when reading a file. The "Pre" and
+"Post" events are both triggered, before and after reading the file.
+
+Note that the autocommands for the *ReadPre events and all the Filter events
+are not allowed to change the current buffer (you will get an error message if
+this happens). This is to prevent the file to be read into the wrong buffer.
+
+Note that the 'modified' flag is reset AFTER executing the BufReadPost
+and BufNewFile autocommands. But when the 'modified' option was set by the
+autocommands, this doesn't happen.
+
+You can use the 'eventignore' option to ignore a number of events or all
+events.
+
+==============================================================================
+6. Patterns *autocmd-patterns* *{pat}*
+
+The file pattern {pat} is tested for a match against the file name in one of
+two ways:
+1. When there is no '/' in the pattern, Vim checks for a match against only
+ the tail part of the file name (without its leading directory path).
+2. When there is a '/' in the pattern, Vim checks for a match against the
+ both short file name (as you typed it) and the full file name (after
+ expanding it to a full path and resolving symbolic links).
+
+Examples: >
+ :autocmd BufRead *.txt set et
+Set the 'et' option for all text files. >
+
+ :autocmd BufRead /vim/src/*.c set cindent
+Set the 'cindent' option for C files in the /vim/src directory. >
+
+ :autocmd BufRead /tmp/*.c set ts=5
+If you have a link from "/tmp/test.c" to "/home/nobody/vim/src/test.c", and
+you start editing "/tmp/test.c", this autocommand will match.
+
+Note: To match part of a path, but not from the root directory, use a '*' as
+the first character. Example: >
+ :autocmd BufRead */doc/*.txt set tw=78
+This autocommand will for example be executed for "/tmp/doc/xx.txt" and
+"/usr/home/piet/doc/yy.txt". The number of directories does not matter here.
+
+
+The file name that the pattern is matched against is after expanding
+wildcards. Thus is you issue this command: >
+ :e $ROOTDIR/main.$EXT
+The argument is first expanded to: >
+ /usr/root/main.py
+Before it's matched with the pattern of the autocommand. Careful with this
+when using events like FileReadCmd, the value of <amatch> may not be what you
+expect.
+
+
+Environment variables can be used in a pattern: >
+ :autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab
+And ~ can be used for the home directory (if $HOME is defined): >
+ :autocmd BufWritePost ~/.vimrc so ~/.vimrc
+ :autocmd BufRead ~archive/* set readonly
+The environment variable is expanded when the autocommand is defined, not when
+the autocommand is executed. This is different from the command!
+
+ *file-pattern*
+The pattern is interpreted like mostly used in file names:
+ * matches any sequence of characters
+ ? matches any single character
+ \? matches a '?'
+ . matches a '.'
+ ~ matches a '~'
+ , separates patterns
+ \, matches a ','
+ { } like \( \) in a |pattern|
+ , inside { }: like \| in a |pattern|
+ \ special meaning like in a |pattern|
+ [ch] matches 'c' or 'h'
+ [^ch] match any character but 'c' and 'h'
+
+Note that for all systems the '/' character is used for path separator (even
+MS-DOS and OS/2). This was done because the backslash is difficult to use
+in a pattern and to make the autocommands portable across different systems.
+
+
+Matching with the pattern is done when an event is triggered. Changing the
+buffer name in one of the autocommands, or even deleting the buffer, does not
+change which autocommands will be executed. Example: >
+
+ au BufEnter *.foo bdel
+ au BufEnter *.foo set modified
+
+This will delete the current buffer and then set 'modified' in what has become
+the current buffer instead. Vim doesn't take into account that "*.foo"
+doesn't match with that buffer name. It matches "*.foo" with the name of the
+buffer at the moment the event was triggered.
+
+==============================================================================
+7. Groups *autocmd-groups*
+
+Autocommands can be put together in a group. This is useful for removing or
+executing a group of autocommands. For example, all the autocommands for
+syntax highlighting are put in the "highlight" group, to be able to execute
+":doautoall highlight BufRead" when the GUI starts.
+
+When no specific group is selected, Vim uses the default group. The default
+group does not have a name. You cannot execute the autocommands from the
+default group separately; you can execute them only by executing autocommands
+for all groups.
+
+Normally, when executing autocommands automatically, Vim uses the autocommands
+for all groups. The group only matters when executing autocommands with
+":doautocmd" or ":doautoall", or when defining or deleting autocommands.
+
+The group name can contain any characters except white space. The group name
+"end" is reserved (also in uppercase).
+
+The group name is case sensitive. Note that this is different from the event
+name!
+
+ *:aug* *:augroup*
+:aug[roup] {name} Define the autocmd group name for the
+ following ":autocmd" commands. The name "end"
+ or "END" selects the default group.
+
+ *:augroup-delete* *E367*
+:aug[roup]! {name} Delete the autocmd group {name}. Don't use
+ this if there is still an autocommand using
+ this group! This is not checked.
+
+To enter autocommands for a specific group, use this method:
+1. Select the group with ":augroup {name}".
+2. Delete any old autocommands with ":au!".
+3. Define the autocommands.
+4. Go back to the default group with "augroup END".
+
+Example: >
+ :augroup uncompress
+ : au!
+ : au BufEnter *.gz %!gunzip
+ :augroup END
+
+This prevents having the autocommands defined twice (e.g., after sourcing the
+.vimrc file again).
+
+==============================================================================
+8. Executing autocommands *autocmd-execute*
+
+Vim can also execute Autocommands non-automatically. This is useful if you
+have changed autocommands, or when Vim has executed the wrong autocommands
+(e.g., the file pattern match was wrong).
+
+Note that the 'eventignore' option applies here too. Events listed in this
+option will not cause any commands to be executed.
+
+ *:do* *:doau* *:doautocmd* *E217*
+:do[autocmd] [group] {event} [fname]
+ Apply the autocommands matching [fname] (default:
+ current file name) for {event} to the current buffer.
+ You can use this when the current file name does not
+ match the right pattern, after changing settings, or
+ to execute autocommands for a certain event.
+ It's possible to use this inside an autocommand too,
+ so you can base the autocommands for one extension on
+ another extension. Example: >
+ :au Bufenter *.cpp so ~/.vimrc_cpp
+ :au Bufenter *.cpp doau BufEnter x.c
+< Be careful to avoid endless loops. See
+ |autocmd-nested|.
+
+ When the [group] argument is not given, Vim executes
+ the autocommands for all groups. When the [group]
+ argument is included, Vim executes only the matching
+ autocommands for that group. Note: if you use an
+ undefined group name, Vim gives you an error message.
+
+ *:doautoa* *:doautoall*
+:doautoa[ll] [group] {event} [fname]
+ Like ":doautocmd", but apply the autocommands to each
+ loaded buffer. Note that {fname} is used to select
+ the autocommands, not the buffers to which they are
+ applied.
+ Careful: Don't use this for autocommands that delete a
+ buffer, change to another buffer or change the
+ contents of a buffer; the result is unpredictable.
+ This command is intended for autocommands that set
+ options, change highlighting, and things like that.
+
+==============================================================================
+9. Using autocommands *autocmd-use*
+
+For WRITING FILES there are four possible sets of events. Vim uses only one
+of these sets for a write command:
+
+BufWriteCmd BufWritePre BufWritePost writing the whole buffer
+ FilterWritePre FilterWritePost writing to filter temp file
+FileAppendCmd FileAppendPre FileAppendPost appending to a file
+FileWriteCmd FileWritePre FileWritePost any other file write
+
+When there is a matching "*Cmd" autocommand, it is assumed it will do the
+writing. No further writing is done and the other events are not triggered.
+|Cmd-event|
+
+Note that the *WritePost commands should undo any changes to the buffer that
+were caused by the *WritePre commands; otherwise, writing the file will have
+the side effect of changing the buffer.
+
+Before executing the autocommands, the buffer from which the lines are to be
+written temporarily becomes the current buffer. Unless the autocommands
+change the current buffer or delete the previously current buffer, the
+previously current buffer is made the current buffer again.
+
+The *WritePre and *AppendPre autocommands must not delete the buffer from
+which the lines are to be written.
+
+The '[ and '] marks have a special position:
+- Before the *ReadPre event the '[ mark is set to the line just above where
+ the new lines will be inserted.
+- Before the *ReadPost event the '[ mark is set to the first line that was
+ just read, the '] mark to the last line.
+- Before executing the *WritePre and *AppendPre autocommands the '[ mark is
+ set to the first line that will be written, the '] mark to the last line.
+Careful: '[ and '] change when using commands that change the buffer.
+
+In commands which expect a file name, you can use "<afile>" for the file name
+that is being read |:<afile>| (you can also use "%" for the current file
+name). "<abuf>" can be used for the buffer number of the currently effective
+buffer. This also works for buffers that doesn't have a name. But it doesn't
+work for files without a buffer (e.g., with ":r file").
+
+ *gzip-example*
+Examples for reading and writing compressed files: >
+ :augroup gzip
+ : autocmd!
+ : autocmd BufReadPre,FileReadPre *.gz set bin
+ : autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
+ : autocmd BufReadPost,FileReadPost *.gz set nobin
+ : autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
+ : autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
+ : autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
+
+ : autocmd FileAppendPre *.gz !gunzip <afile>
+ : autocmd FileAppendPre *.gz !mv <afile>:r <afile>
+ : autocmd FileAppendPost *.gz !mv <afile> <afile>:r
+ : autocmd FileAppendPost *.gz !gzip <afile>:r
+ :augroup END
+
+The "gzip" group is used to be able to delete any existing autocommands with
+":autocmd!", for when the file is sourced twice.
+
+("<afile>:r" is the file name without the extension, see |:_%:|)
+
+The commands executed for the BufNewFile, BufRead/BufReadPost, BufWritePost,
+FileAppendPost and VimLeave events do not set or reset the changed flag of the
+buffer. When you decompress the buffer with the BufReadPost autocommands, you
+can still exit with ":q". When you use ":undo" in BufWritePost to undo the
+changes made by BufWritePre commands, you can still do ":q" (this also makes
+"ZZ" work). If you do want the buffer to be marked as modified, set the
+'modified' option.
+
+To execute Normal mode commands from an autocommand, use the ":normal"
+command. Use with care! If the Normal mode command is not finished, the user
+needs to type characters (e.g., after ":normal m" you need to type a mark
+name).
+
+If you want the buffer to be unmodified after changing it, reset the
+'modified' option. This makes it possible to exit the buffer with ":q"
+instead of ":q!".
+
+ *autocmd-nested* *E218*
+By default, autocommands do not nest. If you use ":e" or ":w" in an
+autocommand, Vim does not execute the BufRead and BufWrite autocommands for
+those commands. If you do want this, use the "nested" flag for those commands
+in which you want nesting. For example: >
+ :autocmd FileChangedShell *.c nested e!
+The nesting is limited to 10 levels to get out of recursive loops.
+
+It's possible to use the ":au" command in an autocommand. This can be a
+self-modifying command! This can be useful for an autocommand that should
+execute only once.
+
+There is currently no way to disable the autocommands. If you want to write a
+file without executing the autocommands for that type of file, write it under
+another name and rename it with a shell command. In some situations you can
+use the 'eventignore' option.
+
+Note: When reading a file (with ":read file" or with a filter command) and the
+last line in the file does not have an <EOL>, Vim remembers this. At the next
+write (with ":write file" or with a filter command), if the same line is
+written again as the last line in a file AND 'binary' is set, Vim does not
+supply an <EOL>. This makes a filter command on the just read lines write the
+same file as was read, and makes a write command on just filtered lines write
+the same file as was read from the filter. For example, another way to write
+a compressed file: >
+
+ :autocmd FileWritePre *.gz set bin|'[,']!gzip
+ :autocmd FileWritePost *.gz undo|set nobin
+<
+ *autocommand-pattern*
+You can specify multiple patterns, separated by commas. Here are some
+examples: >
+
+ :autocmd BufRead * set tw=79 nocin ic infercase fo=2croq
+ :autocmd BufRead .letter set tw=72 fo=2tcrq
+ :autocmd BufEnter .letter set dict=/usr/lib/dict/words
+ :autocmd BufLeave .letter set dict=
+ :autocmd BufRead,BufNewFile *.c,*.h set tw=0 cin noic
+ :autocmd BufEnter *.c,*.h abbr FOR for (i = 0; i < 3; ++i)<CR>{<CR>}<Esc>O
+ :autocmd BufLeave *.c,*.h unabbr FOR
+
+For makefiles (makefile, Makefile, imakefile, makefile.unix, etc.): >
+
+ :autocmd BufEnter ?akefile* set include=^s\=include
+ :autocmd BufLeave ?akefile* set include&
+
+To always start editing C files at the first function: >
+
+ :autocmd BufRead *.c,*.h 1;/^{
+
+Without the "1;" above, the search would start from wherever the file was
+entered, rather than from the start of the file.
+
+ *skeleton* *template*
+To read a skeleton (template) file when opening a new file: >
+
+ :autocmd BufNewFile *.c 0r ~/vim/skeleton.c
+ :autocmd BufNewFile *.h 0r ~/vim/skeleton.h
+ :autocmd BufNewFile *.java 0r ~/vim/skeleton.java
+
+To insert the current date and time in a *.html file when writing it: >
+
+ :autocmd BufWritePre,FileWritePre *.html ks|call LastMod()|'s
+ :fun LastMod()
+ : if line("$") > 20
+ : let l = 20
+ : else
+ : let l = line("$")
+ : endif
+ : exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
+ : \ strftime("%Y %b %d")
+ :endfun
+
+You need to have a line "Last modified: <date time>" in the first 20 lines
+of the file for this to work. Vim replaces <date time> (and anything in the
+same line after it) with the current date and time. Explanation:
+ ks mark current position with mark 's'
+ call LastMod() call the LastMod() function to do the work
+ 's return the cursor to the old position
+The LastMod() function checks if the file is shorter than 20 lines, and then
+uses the ":g" command to find lines that contain "Last modified: ". For those
+lines the ":s" command is executed to replace the existing date with the
+current one. The ":execute" command is used to be able to use an expression
+for the ":g" and ":s" commands. The date is obtained with the strftime()
+function. You can change its argument to get another date string.
+
+When entering :autocmd on the command-line, completion of events and command
+names may be done (with <Tab>, CTRL-D, etc.) where appropriate.
+
+Vim executes all matching autocommands in the order that you specify them.
+It is recommended that your first autocommand be used for all files by using
+"*" as the file pattern. This means that you can define defaults you like
+here for any settings, and if there is another matching autocommand it will
+override these. But if there is no other matching autocommand, then at least
+your default settings are recovered (if entering this file from another for
+which autocommands did match). Note that "*" will also match files starting
+with ".", unlike Unix shells.
+
+ *autocmd-searchpat*
+Autocommands do not change the current search patterns. Vim saves the current
+search patterns before executing autocommands then restores them after the
+autocommands finish. This means that autocommands do not affect the strings
+highlighted with the 'hlsearch' option. Within autocommands, you can still
+use search patterns normally, e.g., with the "n" command.
+If you want an autocommand to set the search pattern, such that it is used
+after the autocommand finishes, use the ":let @/ =" command.
+The search-highlighting cannot be switched off with ":nohlsearch" in an
+autocommand. Use the 'h' flag in the 'viminfo' option to disable search-
+highlighting when starting Vim.
+
+ *Cmd-event*
+When using one of the "*Cmd" events, the matching autocommands are expected to
+do the file reading or writing. This can be used when working with a special
+kind of file, for example on a remote system.
+CAREFUL: If you use these events in a wrong way, it may have the effect of
+making it impossible to read or write the matching files! Make sure you test
+your autocommands properly. Best is to use a pattern that will never match a
+normal file name, for example "ftp://*".
+
+When defining a BufReadCmd it will be difficult for Vim to recover a crashed
+editing session. When recovering from the original file, Vim reads only those
+parts of a file that are not found in the swap file. Since that is not
+possible with a BufReadCmd, use the |:preserve| command to make sure the
+original file isn't needed for recovery. You might want to do this only when
+you expect the file to be modified.
+
+The |v:cmdarg| variable holds the "++enc=" and "++ff=" argument that are
+effective. These should be used for the command that reads/writes the file.
+The |v:cmdbang| variable is one when "!" was used, zero otherwise.
+
+See the $VIMRUNTIME/plugin/netrw.vim for examples.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
new file mode 100644
index 000000000..2e56ccb5c
--- /dev/null
+++ b/runtime/doc/change.txt
@@ -0,0 +1,1425 @@
+*change.txt* For Vim version 7.0aa. Last change: 2004 May 08
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+This file describes commands that delete or change text. In this context,
+changing text means deleting the text and replacing it with other text using
+one command. You can undo all of these commands. You can repeat the non-Ex
+commands with the "." command.
+
+1. Deleting text |deleting|
+2. Delete and insert |delete-insert|
+3. Simple changes |simple-change| *changing*
+4. Complex changes |complex-change|
+5. Copying and moving text |copy-move|
+6. Formatting text |formatting|
+
+For inserting text see |insert.txt|.
+
+==============================================================================
+1. Deleting text *deleting* *E470*
+
+["x]<Del> or *<Del>* *x* *dl*
+["x]x Delete [count] characters under and after the cursor
+ [into register x] (not |linewise|). Does the same as
+ "dl".
+ The <Del> key does not take a [count]. Instead, it
+ deletes the last character of the count.
+ See |:fixdel| if the <Del> key does not do what you
+ want. See |'whichwrap'| for deleting a line break
+ (join lines). {Vi does not support <Del>}
+
+ *X* *dh*
+["x]X Delete [count] characters before the cursor [into
+ register x] (not |linewise|). Does the same as "dh".
+ Also see |'whichwrap'|.
+
+ *d*
+["x]d{motion} Delete text that {motion} moves over [into register
+ x]. See below for exceptions.
+
+ *dd*
+["x]dd Delete [count] lines [into register x] |linewise|.
+
+ *D*
+["x]D Delete the characters under the cursor until the end
+ of the line and [count]-1 more lines [into register
+ x]; synonym for "d$".
+ (not |linewise|)
+
+{Visual}["x]x or *v_x* *v_d* *v_<Del>*
+{Visual}["x]d or
+{Visual}["x]<Del> Delete the highlighted text [into register x] (for
+ {Visual} see |Visual-mode|). {not in Vi}
+
+{Visual}["x]CTRL-H or *v_CTRL-H* *v_<BS>*
+{Visual}["x]<BS> When in Select mode: Delete the highlighted text [into
+ register x].
+
+{Visual}["x]X or *v_X* *v_D* *v_b_D*
+{Visual}["x]D Delete the highlighted lines [into register x] (for
+ {Visual} see |Visual-mode|). In Visual block mode,
+ "D" deletes the highlighted text plus all text until
+ the end of the line. {not in Vi}
+
+ *:d* *:de* *:del* *:delete*
+:[range]d[elete] [x] Delete [range] lines (default: current line) [into
+ register x].
+
+:[range]d[elete] [x] {count}
+ Delete {count} lines, starting with [range]
+ (default: current line |cmdline-ranges|) [into
+ register x].
+
+These commands delete text. You can repeat them with the "." command
+(except ":d") and undo them. Use Visual mode to delete blocks of text. See
+|registers| for an explanation of registers.
+
+An exception for the d{motion} command: If the motion is not linewise, the
+start and end of the motion are not in the same line, and there are only
+blanks before the start and after the end of the motion, the delete becomes
+linewise. This means that the delete also removes the line of blanks that you
+might expect to remain.
+
+Trying to delete an empty region of text (e.g., "d0" in the first column)
+is an error when 'cpoptions' includes the 'E' flag.
+
+ *J*
+J Join [count] lines, with a minimum of two lines.
+ Remove the indent and insert up to two spaces (see
+ below).
+
+ *v_J*
+{Visual}J Join the highlighted lines, with a minimum of two
+ lines. Remove the indent and insert up to two spaces
+ (see below). {not in Vi}
+
+ *gJ*
+gJ Join [count] lines, with a minimum of two lines.
+ Don't insert or remove any spaces. {not in Vi}
+
+ *v_gJ*
+{Visual}gJ Join the highlighted lines, with a minimum of two
+ lines. Don't insert or remove any spaces. {not in
+ Vi}
+
+ *:j* *:join*
+:[range]j[oin][!] Join [range] lines. Same as "J", except with [!]
+ the join does not insert or delete any spaces.
+ If a [range] has equal start and end values, this
+ command does nothing. The default behavior is to
+ join the current line with the line below it.
+ {not in Vi: !}
+
+:[range]j[oin][!] {count}
+ Join {count} lines, starting with [range] (default:
+ current line |cmdline-ranges|). Same as "J", except
+ with [!] the join does not insert or delete any
+ spaces.
+ {not in Vi: !}
+
+These commands delete the <EOL> between lines. This has the effect of joining
+multiple lines into one line. You can repeat these commands (except ":j") and
+undo them.
+
+These commands, except "gJ", insert one space in place of the <EOL> unless
+there is trailing white space or the next line starts with a ')'. These
+commands, except "gJ", delete any leading white space on the next line. If
+the 'joinspaces' option is on, these commands insert two spaces after a '.',
+'!' or '?' (but if 'cpoptions' includes the 'j' flag, they insert two spaces
+only after a '.').
+The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting
+spaces before and after a multi-byte character |fo-table|.
+
+
+==============================================================================
+2. Delete and insert *delete-insert* *replacing*
+
+ *R*
+R Enter Replace mode: Each character you type replaces
+ an existing character, starting with the character
+ under the cursor. Repeat the entered text [count]-1
+ times. See |Replace-mode| for more details.
+
+ *gR*
+gR Enter Virtual Replace mode: Each character you type
+ replaces existing characters in screen space. So a
+ <Tab> may replace several characters at once.
+ Repeat the entered text [count]-1 times. See
+ |Virtual-Replace-mode| for more details.
+ {not available when compiled without the +vreplace
+ feature}
+
+ *c*
+["x]c{motion} Delete {motion} text [into register x] and start
+ insert. When 'cpoptions' includes the 'E' flag and
+ there is no text to delete (e.g., with "cTx" when the
+ cursor is just after an 'x'), an error occurs and
+ insert mode does not start (this is Vi compatible).
+ When 'cpoptions' does not include the 'E' flag, the
+ "c" command always starts insert mode, even if there
+ is no text to delete.
+
+ *cc*
+["x]cc Delete [count] lines [into register x] and start
+ insert |linewise|. If 'autoindent' is on, preserve
+ the indent of the first line.
+
+ *C*
+["x]C Delete from the cursor position to the end of the
+ line and [count]-1 more lines [into register x], and
+ start insert. Synonym for c$ (not |linewise|).
+
+ *s*
+["x]s Delete [count] characters [into register x] and start
+ insert (s stands for Substitute). Synonym for "cl"
+ (not |linewise|).
+
+ *S*
+["x]S Delete [count] lines [into register x] and start
+ insert. Synonym for "cc" |linewise|.
+
+{Visual}["x]c or *v_c* *v_s*
+{Visual}["x]s Delete the highlighted text [into register x] and
+ start insert (for {Visual} see |Visual-mode|). {not
+ in Vi}
+
+ *v_r*
+{Visual}["x]r{char} Replace all selected characters by {char}.
+
+ *v_C*
+{Visual}["x]C Delete the highlighted lines [into register x] and
+ start insert. In Visual block mode it works
+ differently |v_b_C|. {not in Vi}
+ *v_S*
+{Visual}["x]S Delete the highlighted lines [into register x] and
+ start insert (for {Visual} see |Visual-mode|). {not
+ in Vi}
+ *v_R*
+{Visual}["x]R Currently just like {Visual}["x]S. In a next version
+ it might work differently. {not in Vi}
+
+Notes:
+- You can end Insert and Replace mode with <Esc>.
+- See the section "Insert and Replace mode" |mode-ins-repl| for the other
+ special characters in these modes.
+- The effect of [count] takes place after Vim exits Insert or Replace mode.
+- When the 'cpoptions' option contains '$' and the change is within one line,
+ Vim continues to show the text to be deleted and puts a '$' at the last
+ deleted character.
+
+See |registers| for an explanation of registers.
+
+Replace mode is just like Insert mode, except that every character you enter
+deletes one character. If you reach the end of a line, Vim appends any
+further characters (just like Insert mode). In Replace mode, the backspace
+key restores the original text (if there was any). (See section "Insert and
+Replace mode" |mode-ins-repl|).
+
+ *cw* *cW*
+Special case: "cw" and "cW" work the same as "ce" and "cE" if the cursor is
+on a non-blank. This is because Vim interprets "cw" as change-word, and a
+word does not include the following white space. {Vi: "cw" when on a blank
+followed by other blanks changes only the first blank; this is probably a
+bug, because "dw" deletes all the blanks; use the 'w' flag in 'cpoptions' to
+make it work like Vi anyway}
+
+If you prefer "cw" to include the space after a word, use this mapping: >
+ :map cw dwi
+<
+ *:c* *:ch* *:change*
+:{range}c[hange] Replace lines of text with some different text.
+ Type a line containing only "." to stop replacing.
+ Without {range}, this command changes only the current
+ line.
+
+==============================================================================
+3. Simple changes *simple-change*
+
+ *r*
+r{char} Replace the character under the cursor with {char}.
+ If {char} is a <CR> or <NL>, a line break replaces the
+ character. To replace with a real <CR>, use CTRL-V
+ <CR>. CTRL-V <NL> replaces with a <Nul>.
+ {Vi: CTRL-V <CR> still replaces with a line break,
+ cannot replace something with a <CR>}
+ If you give a [count], Vim replaces [count] characters
+ with [count] {char}s. When {char} is a <CR> or <NL>,
+ however, Vim inserts only one <CR>: "5r<CR>" replaces
+ five characters with a single line break.
+ When {char} is a <CR> or <NL>, Vim performs
+ autoindenting. This works just like deleting the
+ characters that are replaced and then doing
+ "i<CR><Esc>".
+ {char} can be entered as a digraph |digraph-arg|.
+ |:lmap| mappings apply to {char}. The CTRL-^ command
+ in Insert mode can be used to switch this on/off
+ |i_CTRL-^|. See |utf-8-char-arg| about using
+ composing characters when 'encoding' is Unicode.
+
+ *gr*
+gr{char} Replace the virtual characters under the cursor with
+ {char}. This replaces in screen space, not file
+ space. See |gR| and |Virtual-Replace-mode| for more
+ details. As with |r| a count may be given.
+ {char} can be entered like with |r|.
+ {not available when compiled without the +vreplace
+ feature}
+
+ *digraph-arg*
+The argument for Normal mode commands like |r| and |t| is a single character.
+When 'cpo' doesn't contain the 'D' flag, this character can also be entered
+like |digraphs|. First type CTRL-K and then the two digraph characters.
+{not available when compiled without the |+digraphs| feature}
+
+ *case*
+The following commands change the case of letters. The currently active
+|locale| is used. See |:language|. The LC_CTYPE value matters here.
+
+ *~*
+~ 'notildeop' option: Switch case of the character
+ under the cursor and move the cursor to the right.
+ If a [count] is given, do that many characters. {Vi:
+ no count}
+
+~{motion} 'tildeop' option: switch case of {motion} text. {Vi:
+ tilde cannot be used as an operator}
+
+ *g~*
+g~{motion} Switch case of {motion} text. {not in Vi}
+
+g~g~ *g~g~* *g~~*
+g~~ Switch case of current line. {not in Vi}.
+
+ *v_~*
+{Visual}~ Switch case of highlighted text (for {Visual} see
+ |Visual-mode|). {not in Vi}
+
+ *v_U*
+{Visual}U Make highlighted text uppercase (for {Visual} see
+ |Visual-mode|). {not in Vi}
+
+ *gU* *uppercase*
+gU{motion} Make {motion} text uppercase. {not in Vi}
+ Example: >
+ :map! <C-F> <Esc>gUiw`]a
+< This works in Insert mode: press CTRL-F to make the
+ word before the cursor uppercase. Handy to type
+ words in lowercase and then make them uppercase.
+
+
+gUgU *gUgU* *gUU*
+gUU Make current line uppercase. {not in Vi}.
+
+ *v_u*
+{Visual}u Make highlighted text lowercase (for {Visual} see
+ |Visual-mode|). {not in Vi}
+
+ *gu* *lowercase*
+gu{motion} Make {motion} text lowercase. {not in Vi}
+
+gugu *gugu* *guu*
+guu Make current line lowercase. {not in Vi}.
+
+ *g?* *rot13*
+g?{motion} Rot13 encode {motion} text. {not in Vi}
+
+ *v_g?*
+{Visual}g? Rot13 encode the highlighted text (for {Visual} see
+ |Visual-mode|). {not in Vi}
+
+g?g? *g?g?* *g??*
+g?? Rot13 encode current line. {not in Vi}.
+
+
+Adding and subtracting ~
+ *CTRL-A*
+CTRL-A Add [count] to the number or alphabetic character at
+ or after the cursor. {not in Vi}
+
+ *CTRL-X*
+CTRL-X Subtract [count] from the number or alphabetic
+ character at or after the cursor. {not in Vi}
+
+The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
+octal and hexadecimal numbers and alphabetic characters. This depends on the
+'nrformats' option.
+- When 'nrformats' includes "alpha", Vim will change the alphabetic character
+ under or after the cursor. This is useful to make lists with an alphabetic
+ index.
+- When 'nrformats' includes "hex", Vim assumes numbers starting with '0x' or
+ '0X' are hexadecimal. The case of the rightmost letter in the number
+ determines the case of the resulting hexadecimal number. If there is no
+ letter in the current number, Vim uses the previously detected case.
+- When 'nrformats' includes "octal", Vim considers numbers starting with a '0'
+ to be octal. Other numbers are decimal and may have a preceding minus sign.
+ If the cursor is on a number, the commands apply to that number; otherwise
+ Vim uses the number to the right of the cursor.
+
+For numbers with leading zeros (including all octal and hexadecimal numbers),
+Vim preserves the number of characters in the number when possible. CTRL-A on
+"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff". Note that
+when 'nrformats' includes "octal", decimal numbers with leading zeros are
+impossible because they are indistinguishable from octal numbers.
+
+The CTRL-A command is very useful in a macro. Example: Use the following
+steps to make a numbered list.
+
+1. Create the first list entry, make sure it starts with a number.
+2. qa - start recording into buffer 'a'
+3. Y - yank the entry
+4. p - put a copy of the entry below the first one
+5. CTRL-A - increment the number
+6. q - stop recording
+7. <count>@a - repeat the yank, put and increment <count> times
+
+
+SHIFTING LINES LEFT OR RIGHT *shift-left-right*
+
+ *<*
+<{motion} Shift {motion} lines one 'shiftwidth' leftwards.
+
+ *<<*
+<< Shift [count] lines one 'shiftwidth' leftwards.
+
+ *v_<*
+{Visual}[count]< Shift the highlighted lines [count] 'shiftwidth'
+ leftwards (for {Visual} see |Visual-mode|). {not in
+ Vi}
+
+ *>*
+ >{motion} Shift {motion} lines one 'shiftwidth' rightwards.
+
+ *>>*
+ >> Shift [count] lines one 'shiftwidth' rightwards.
+
+ *v_>*
+{Visual}[count]> Shift the highlighted lines [count] 'shiftwidth'
+ rightwards (for {Visual} see |Visual-mode|). {not in
+ Vi}
+
+ *:<*
+:[range]< Shift [range] lines one 'shiftwidth' left. Repeat '<'
+ for shifting multiple 'shiftwidth's.
+
+:[range]< {count} Shift {count} lines one 'shiftwidth' left, starting
+ with [range] (default current line |cmdline-ranges|).
+ Repeat '<' for shifting multiple 'shiftwidth's.
+
+:[range]le[ft] [indent] left align lines in [range]. Sets the indent in the
+ lines to [indent] (default 0). {not in Vi}
+
+ *:>*
+:[range]> Shift {count} [range] lines one 'shiftwidth' right.
+ Repeat '>' for shifting multiple 'shiftwidth's.
+
+:[range]> {count} Shift {count} lines one 'shiftwidth' right, starting
+ with [range] (default current line |cmdline-ranges|).
+ Repeat '>' for shifting multiple 'shiftwidth's.
+
+The ">" and "<" commands are handy for changing the indentation within
+programs. Use the 'shiftwidth' option to set the size of the white space
+which these commands insert or delete. Normally the 'shiftwidth' option is 8,
+but you can set it to, say, 3 to make smaller indents. The shift leftwards
+stops when there is no indent. The shift right does not affect empty lines.
+
+If the 'shiftround' option is on, the indent is rounded to a multiple of
+'shiftwidth'.
+
+If the 'smartindent' option is on, or 'cindent' is on and 'cinkeys' contains
+'#', shift right does not affect lines starting with '#' (these are supposed
+to be C preprocessor lines that must stay in column 1).
+
+When the 'expandtab' option is off (this is the default) Vim uses <Tab>s as
+much as possible to make the indent. You can use ">><<" to replace an indent
+made out of spaces with the same indent made out of <Tab>s (and a few spaces
+if necessary). If the 'expandtab' option is on, Vim uses only spaces. Then
+you can use ">><<" to replace <Tab>s in the indent by spaces (or use
+":retab!").
+
+To move a line several 'shiftwidth's, use Visual mode or the ":" commands.
+For example: >
+ Vjj4> move three lines 4 indents to the right
+ :<<< move current line 3 indents to the left
+ :>> 5 move 5 lines 2 indents to the right
+ :5>> move line 5 2 indents to the right
+
+==============================================================================
+4. Complex changes *complex-change*
+
+ *!* *filter*
+!{motion}{filter} Filter {motion} text lines through the external
+ program {filter}.
+
+ *!!*
+!!{filter} Filter [count] lines through the external program
+ {filter}.
+
+ *v_!*
+{Visual}!{filter} Filter the highlighted lines through the external
+ program {filter} (for {Visual} see |Visual-mode|).
+ {not in Vi}
+
+:{range}![!]{filter} [!][arg] *:range!*
+ Filter {range} lines through the external program
+ {filter}. Vim replaces the optional bangs with the
+ latest given command and appends the optional [arg].
+ Vim saves the output of the filter command in a
+ temporary file and then reads the file into the
+ buffer. Vim uses the 'shellredir' option to redirect
+ the filter output to the temporary file.
+ When the 'R' flag is included in 'cpoptions' marks in
+ the filtered lines are deleted, unless the
+ |:keepmarks| command is used. Example: >
+ :keepmarks '<,'>!sort
+< When the number of lines after filtering is less than
+ before, marks in the missing lines are deleted anyway.
+
+ *=*
+={motion} Filter {motion} lines through the external program
+ given with the 'equalprg' option. When the 'equalprg'
+ option is empty (this is the default), use the
+ internal formatting function |C-indenting|. But when
+ 'indentexpr' is not empty, it will be used instead
+ |indent-expression|.
+
+ *==*
+== Filter [count] lines like with ={motion}.
+
+ *v_=*
+{Visual}= Filter the highlighted lines like with ={motion}.
+ {not in Vi}
+
+A filter is a program that accepts text at standard input, changes it in some
+way, and sends it to standard output. You can use the commands above to send
+some text through a filter. Examples of filters are "sort", which sorts lines
+alphabetically, and "indent", which formats C program files (you need a
+version of indent that works like a filter; not all versions do). The 'shell'
+option specifies the shell Vim uses to execute the filter command (See also
+the 'shelltype' option). You can repeat filter commands with ".". Vim does
+not recognize a comment (starting with '"') after the ":!" command.
+
+
+ *:s* *:su* *:substitute*
+:[range]s[ubstitute]/{pattern}/{string}/[&][c][e][g][p][r][i][I] [count]
+ For each line in [range] replace a match of {pattern}
+ with {string}.
+ For the {pattern} see |pattern|.
+ {string} can be a literal string, or something
+ special; see |sub-replace-special|.
+ When [range] and [count] are omitted, replace in the
+ current line only.
+ When [count] is given, replace in [count] lines,
+ starting with the last line in [range]. When [range]
+ is omitted start in the current line.
+ Also see |cmdline-ranges|.
+ See |:s_flags| for the flags.
+
+:[range]s[ubstitute] [c][e][g][p][r][i][I] [count]
+:[range]&[&][c][e][g][p][r][i][I] [count] *:&*
+ Repeat last :substitute with same search pattern and
+ substitute string, but without the same flags. You
+ may add extra flags (see |:s_flags|).
+ Note that after ":substitute" the '&' flag can't be
+ used, it's recognized as a pattern separator.
+ The space between ":substitute" and the 'c', 'g' and
+ 'r' flags isn't required, but in scripts it's a good
+ idea to keep it to avoid confusion.
+
+:[range]~[&][c][e][g][p][r][i][I] [count] *:~*
+ Repeat last substitute with same substitute string
+ but with last used search pattern. This is like
+ ":&r". See |:s_flags| for the flags.
+
+ *&*
+& Synonym for ":s//~/" (repeat last substitute). Note
+ that the flags are not remembered, thus it might
+ actually work differently. You can use ":&&" to keep
+ the flags.
+
+ *g&*
+g& Synonym for ":%s//~/&" (repeat last substitute on all
+ lines with the same flags).
+ Mnemonic: global substitute. {not in Vi}
+
+ *:snomagic* *:sno*
+:[range]sno[magic] ... Same as ":substitute", but always use 'nomagic'.
+ {not in Vi}
+
+ *:smagic* *:sm*
+:[range]sm[agic] ... Same as ":substitute", but always use 'magic'.
+ {not in Vi}
+
+ *:s_flags*
+The flags that you can use for the substitute commands:
+
+[&] Must be the first one: Keep the flags from the previous substitute
+ command. Examples: >
+ :&&
+ :s/this/that/&
+< Note that ":s" and ":&" don't keep the flags.
+ {not in Vi}
+
+[c] Confirm each substitution. Vim highlights the matching string (with
+ |hl-IncSearch|). You can type: *:s_c*
+ 'y' to substitute this match
+ 'l' to substitute this match and then quit ("last")
+ 'n' to skip this match
+ <Esc> to quit substituting
+ 'a' to substitute this and all remaining matches {not in Vi}
+ 'q' to quit substituting {not in Vi}
+ CTRL-E to scroll the screen up {not in Vi, not available when
+ compiled without the +insert_expand feature}
+ CTRL-Y to scroll the screen down {not in Vi, not available when
+ compiled without the +insert_expand feature}
+ If the 'edcompatible' option is on, Vim remembers the [c] flag and
+ toggles it each time you use it, but resets it when you give a new
+ search pattern.
+ {not in Vi: highlighting of the match, other responses than 'y' or 'n'}
+
+[e] When the search pattern fails, do not issue an error message and, in
+ particular, continue in maps as if no error occurred. This is most
+ useful to prevent the "No match" error from breaking a mapping. Vim
+ does not suppress the following error messages, however:
+ Regular expressions can't be delimited by letters
+ \ should be followed by /, ? or &
+ No previous substitute regular expression
+ Trailing characters
+ Interrupted
+ {not in Vi}
+
+[g] Replace all occurrences in the line. Without this argument,
+ replacement occurs only for the first occurrence in each line. If
+ the 'edcompatible' option is on, Vim remembers this flag and toggles
+ it each time you use it, but resets it when you give a new search
+ pattern. If the 'gdefault' option is on, this flag is on by default
+ and the [g] argument switches it off.
+
+[i] Ignore case for the pattern. The 'ignorecase' and 'smartcase' options
+ are not used.
+ {not in Vi}
+
+[I] Don't ignore case for the pattern. The 'ignorecase' and 'smartcase'
+ options are not used.
+ {not in Vi}
+
+[p] Print the line containing the last substitute.
+ {not in Vi}
+
+[r] Only useful in combination with ":&" or ":s" without arguments. ":&r"
+ works the same way as ":~": When the search pattern is empty, use the
+ previously used search pattern instead of the search pattern from the
+ last substitute or ":global". If the last command that did a search
+ was a substitute or ":global", there is no effect. If the last
+ command was a search command such as "/", use the pattern from that
+ command.
+ For ":s" with an argument this already happens: >
+ :s/blue/red/
+ /green
+ :s//red/ or :~ or :&r
+< The last commands will replace "green" with "red". >
+ :s/blue/red/
+ /green
+ :&
+< The last command will replace "blue" with "red".
+ {not in Vi}
+
+Note that there is no flag to change the "magicness" of the pattern. A
+different command is used instead. The reason is that the flags can only be
+found by skipping the pattern, and in order to skip the pattern the
+"magicness" must be known. Catch 22!
+
+If the {pattern} for the substitute command is empty, the command uses the
+pattern from the last substitute or ":global" command. With the [r] flag, the
+command uses the pattern from the last substitute, ":global", or search
+command.
+
+For compatibility with Vi these two exceptions are allowed:
+"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
+"\&{string}&" does the same as "//{string}/".
+ *E146*
+Instead of the '/' which surrounds the pattern and replacement string, you
+can use any other character, but not an alphanumeric character, '\', '"' or
+'|'. This is useful if you want to include a '/' in the search pattern or
+replacement string. Example: >
+ :s+/+//+
+
+For the definition of a pattern, see |pattern|.
+
+ *sub-replace-special* *:s\=*
+When the {string} starts with "\=" it is evaluated as an expression, see
+|sub-replace-expression|. Otherwise these characters in {string} have a
+special meaning:
+
+magic nomagic action ~
+ & \& replaced with the whole matched pattern *s/\&*
+ \& & replaced with &
+ \0 replaced with the whole matched pattern *\0* *s/\0*
+ \1 replaced with the matched pattern in the first
+ pair of () *s/\1*
+ \2 replaced with the matched pattern in the first
+ pair of () *s/\2*
+ .. .. *s/\3*
+ \9 replaced with the matched pattern in the ninth
+ pair of () *s/\9*
+ ~ \~ replaced with the {string} of the previous
+ substitute *s~*
+ \~ ~ replaced with ~ *s/\~*
+ \u next character made uppercase *s/\u*
+ \U following characters made uppercase, until \E *s/\U*
+ \l next character made lowercase *s/\l*
+ \L following characters made lowercase, until \E *s/\L*
+ \e end of \u, \U, \l and \L (NOTE: not <Esc>!) *s/\e*
+ \E end of \u, \U, \l and \L *s/\E*
+ <CR> split line in two at this point
+ (Type the <CR> as CTRL-V <Enter>) *s<CR>*
+ \r idem *s/\r*
+ \<CR> insert a carriage-return (CTRL-M)
+ (Type the <CR> as CTRL-V <Enter>) *s/\<CR>*
+ \n insert a <NL> (<NUL> in the file)
+ (does NOT break the line) *s/\n*
+ \b insert a <BS> *s/\b*
+ \t insert a <Tab> *s/\t*
+ \\ insert a single backslash *s/\\*
+ \x where x is any character not mentioned above:
+ Reserved for future expansion
+
+Examples: >
+ :s/a\|b/xxx\0xxx/g modifies "a b" to "xxxaxxx xxxbxxx"
+ :s/\([abc]\)\([efg]\)/\2\1/g modifies "af fa bg" to "fa fa gb"
+ :s/abcde/abc^Mde/ modifies "abcde" to "abc", "de" (two lines)
+ :s/$/\^M/ modifies "abcde" to "abcde^M"
+
+Note: In previous versions CTRL-V was handled in a special way. Since this is
+not Vi compatible, this was removed. Use a backslash instead.
+
+command text result ~
+:s/aa/a^Ma/ aa a<line-break>a
+:s/aa/a\^Ma/ aa a^Ma
+:s/aa/a\\^Ma/ aa a\<line-break>a
+
+(you need to type CTRL-V <CR> to get a ^M here)
+
+The numbering of "\1", "\2" etc. is done based on which "\(" comes first in
+the pattern (going left to right). When a parentheses group matches several
+times, the last one will be used for "\1", "\2", etc. Example: >
+ :s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x"
+
+When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\),
+either the first or second pattern in parentheses did not match, so either
+\1 or \2 is empty. Example: >
+ :s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x"
+<
+
+Substitute with an expression *sub-replace-expression*
+
+When the substitute string starts with "\=" the remainer is interpreted as an
+expression. This does not work recursively: a substitute() function inside
+the expression cannot use "\=" for the substitute string.
+
+The special meaning for characters as mentioned at |sub-replace-special| does
+not apply except "<CR>", "\<CR>" and "\\". Thus in the result of the
+expression you need to use two backslashes get one, put a backslash before a
+<CR> you want to insert and use a <CR> without a backslash where you want to
+break the line.
+
+For convenience a <NL> character is also used as a line break. Prepend a
+backslash to get a real <NL> character (which will be a NUL in the file).
+
+The whole matched text can be accessed with "submatch(0)". The text matched
+with the first pair of () with "submatch(1)". Likewise for further
+sub-matches in ().
+
+Be careful: The separation character must not appear in the expression!
+Consider using a character like "@" or ":". There is no problem if the result
+of the expression contains the separation character.
+
+Example: >
+ :s@\n@\="\r" . expand("$HOME") . "\r"@
+This replaces an end-of-line with a new line containing the value of $HOME.
+
+
+ *:pro* *:promptfind*
+:promptf[ind] [string]
+ Put up a Search dialog. When [string] is given, it is
+ used as the initial search string.
+ {only for Win32, Motif and GTK GUI}
+
+ *:promptr* *:promptrepl*
+:promptr[epl] [string]
+ Put up a Search/Replace dialog. When [string] is
+ given, it is used as the initial search string.
+ {only for Win32, Motif and GTK GUI}
+
+ *:ret* *:retab*
+:[range]ret[ab][!] [new_tabstop]
+ Replace all sequences of white-space containing a
+ <Tab> with new strings of white-space using the new
+ tabstop value given. If you do not specify a new
+ tabstop size or it is zero, Vim uses the current value
+ of 'tabstop'.
+ The current value of 'tabstop' is always used to
+ compute the width of existing tabs.
+ With !, Vim also replaces strings of only normal
+ spaces with tabs where appropriate.
+ With 'expandtab' on, Vim replaces all tabs with the
+ appropriate number of spaces.
+ This command sets 'tabstop' to the new value given,
+ and if performed on the whole file, which is default,
+ should not make any visible change.
+ Careful: This command modifies any <Tab> characters
+ inside of strings in a C program. Use "\t" to avoid
+ this (that's a good habit anyway).
+ ":retab!" may also change a sequence of spaces by
+ <Tab> characters, which can mess up a printf().
+ {not in Vi}
+ Not available when |+ex_extra| feature was disabled at
+ compile time.
+
+ *retab-example*
+Example for using autocommands and ":retab" to edit a file which is stored
+with tabstops at 8 but edited with tabstops set at 4. Warning: white space
+inside of strings can change! Also see 'softtabstop' option. >
+
+ :auto BufReadPost *.xx retab! 4
+ :auto BufWritePre *.xx retab! 8
+ :auto BufWritePost *.xx retab! 4
+ :auto BufNewFile *.xx set ts=4
+
+==============================================================================
+5. Copying and moving text *copy-move*
+
+ *quote*
+"{a-zA-Z0-9.%#:-"} Use register {a-zA-Z0-9.%#:-"} for next delete, yank
+ or put (use uppercase character to append with
+ delete and yank) ({.%#:} only work with put).
+
+ *:reg* *:registers*
+:reg[isters] Display the contents of all numbered and named
+ registers. {not in Vi}
+
+:reg[isters] {arg} Display the contents of the numbered and named
+ registers that are mentioned in {arg}. For example: >
+ :dis 1a
+< to display registers '1' and 'a'. Spaces are allowed
+ in {arg}. {not in Vi}
+
+ *:di* *:display*
+:di[splay] [arg] Same as :registers. {not in Vi}
+
+ *y* *yank*
+["x]y{motion} Yank {motion} text [into register x]. When no
+ characters are to be yanked (e.g., "y0" in column 1),
+ this is an error when 'cpoptions' includes the 'E'
+ flag.
+
+ *yy*
+["x]yy Yank [count] lines [into register x] |linewise|.
+
+ *Y*
+["x]Y yank [count] lines [into register x] (synonym for
+ yy, |linewise|). If you like "Y" to work from the
+ cursor to the end of line (which is more logical,
+ but not Vi-compatible) use ":map Y y$".
+
+ *v_y*
+{Visual}["x]y Yank the highlighted text [into register x] (for
+ {Visual} see |Visual-mode|). {not in Vi}
+
+ *v_Y*
+{Visual}["x]Y Yank the highlighted lines [into register x] (for
+ {Visual} see |Visual-mode|). {not in Vi}
+
+ *:y* *:yank*
+:[range]y[ank] [x] Yank [range] lines [into register x].
+
+:[range]y[ank] [x] {count}
+ Yank {count} lines, starting with last line number
+ in [range] (default: current line |cmdline-ranges|),
+ [into register x].
+
+ *p* *put* *E353*
+["x]p Put the text [from register x] after the cursor
+ [count] times. {Vi: no count}
+
+ *P*
+["x]P Put the text [from register x] before the cursor
+ [count] times. {Vi: no count}
+
+ *<MiddleMouse>*
+["x]<MiddleMouse> Put the text from a register before the cursor [count]
+ times. Uses the "* register, unless another is
+ specified. Using the mouse only works when 'mouse'
+ contains 'n' or 'a'.
+ {not in Vi}
+ If you have a scrollwheel and often accidentally paste
+ text, you can use these mappings to disable the
+ pasting with the middle mouse button: >
+ :map <MiddleMouse> <Nop>
+ :imap <MiddleMouse> <Nop>
+< You might want to disable the multi-click versions
+ too, see |double-click|.
+
+ *gp*
+["x]gp Just like "p", but leave the cursor just after the new
+ text. {not in Vi}
+
+ *gP*
+["x]gP Just like "P", but leave the cursor just after the new
+ text. {not in Vi}
+
+ *:pu* *:put*
+:[line]pu[t] [x] Put the text [from register x] after [line] (default
+ current line). This always works |linewise|, thus
+ this command can be used to put a yanked block as new
+ lines.
+ The register can also be '=' followed by an optional
+ expression. The expression continues until the end of
+ the command. You need to escape the '|' and '"'
+ characters to prevent them from terminating the
+ command. Example: >
+ :put ='path' . \",/test\"
+< If there is no expression after '=', Vim uses the
+ previous expression. You can see it with ":dis =".
+
+:[line]pu[t]! [x] Put the text [from register x] before [line] (default
+ current line).
+
+["x]]p or *]p* *]<MiddleMouse>*
+["x]]<MiddleMouse> Like "p", but adjust the indent to the current line.
+ Using the mouse only works when 'mouse' contains 'n'
+ or 'a'. {not in Vi}
+
+["x][P or *[P*
+["x]]P or *]P*
+["x][p or *[p* *[<MiddleMouse>*
+["x][<MiddleMouse> Like "P", but adjust the indent to the current line.
+ Using the mouse only works when 'mouse' contains 'n'
+ or 'a'. {not in Vi}
+
+You can use these commands to copy text from one place to another. Do this
+by first getting the text into a register with a yank, delete or change
+command, then inserting the register contents with a put command. You can
+also use these commands to move text from one file to another, because Vim
+preserves all registers when changing buffers (the CTRL-^ command is a quick
+way to toggle between two files).
+
+ *linewise-register* *characterwise-register*
+You can repeat the put commands with "." (except for :put) and undo them. If
+the command that was used to get the text into the register was |linewise|,
+Vim inserts the text below ("p") or above ("P") the line where the cursor is.
+Otherwise Vim inserts the text after ("p") or before ("P") the cursor. With
+the ":put" command, Vim always inserts the text in the next line. You can
+exchange two characters with the command sequence "xp". You can exchange two
+lines with the command sequence "ddp". You can exchange two words with the
+command sequence "deep" (start with the cursor in the blank space before the
+first word). You can use the "']" or "`]" command after the put command to
+move the cursor to the end of the inserted text, or use "'[" or "`[" to move
+the cursor to the start.
+
+ *put-Visual-mode* *v_p* *v_P*
+When using a put command like |p| or |P| in Visual mode, Vim will try to
+replace the selected text with the contents of the register. Whether this
+works well depends on the type of selection and the type of the text in the
+register. With blockwise selection it also depends on the size of the block
+and whether the corners are on an existing character. (implementation detail:
+it actually works by first putting the register after the selection and then
+deleting the selection).
+
+ *blockwise-register*
+If you use a blockwise Visual mode command to get the text into the register,
+the block of text will be inserted before ("P") or after ("p") the cursor
+column in the current and next lines. Vim makes the whole block of text start
+in the same column. Thus the inserted text looks the same as when it was
+yanked or deleted. Vim may replace some <Tab> characters with spaces to make
+this happen. However, if the width of the block is not a multiple of a <Tab>
+width and the text after the inserted block contains <Tab>s, that text may be
+misaligned.
+
+Note that after a characterwise yank command, Vim leaves the cursor on the
+first yanked character that is closest to the start of the buffer. This means
+that "yl" doesn't move the cursor, but "yh" moves the cursor one character
+left.
+Rationale: In Vi the "y" command followed by a backwards motion would
+ sometimes not move the cursor to the first yanked character,
+ because redisplaying was skipped. In Vim it always moves to
+ the first character, as specified by Posix.
+With a linewise yank command the cursor is put in the first line, but the
+column is unmodified, thus it may not be on the first yanked character.
+
+There are nine types of registers: *registers* *E354*
+1. The unnamed register ""
+2. 10 numbered registers "0 to "9
+3. The small delete register "-
+4. 26 named registers "a to "z or "A to "Z
+5. four read-only registers ":, "., "% and "#
+6. the expression register "=
+7. The selection and drop registers "*, "+ and "~
+8. The black hole register "_
+9. Last search pattern register "/
+
+1. Unnamed register "" *quote_quote* *quotequote*
+Vim fills this register with text deleted with the "d", "c", "s", "x" commands
+or copied with the yank "y" command, regardless of whether or not a specific
+register was used (e.g. "xdd). An exception is the '_' register: "_dd does
+not store the deleted text in any register. Vim uses the contents of this
+register for any put command (p or P) which does not specify a register.
+Additionally you can access it with the name '"'. This means you have to type
+two double quotes. Writing to the "" register writes to register "0.
+{Vi: register contents are lost when changing files, no '"'}
+
+2. Numbered registers "0 to "9 *quote_number* *quote0* *quote1*
+ *quote2* *quote3* *quote4* *quote9*
+Vim fills these registers with text from yank and delete commands.
+ Numbered register 0 contains the text from the most recent yank command,
+unless the command specified another register with ["x].
+ Numbered register 1 contains the text deleted by the most recent delete or
+change command, unless the command specified another register or the text is
+less than one line (the small delete register is used then). An exception is
+made for these commands: |%|, |(|, |)|, |`|, |/|, |?|, |n|, |N|, |{| and |}|.
+Register "1 is always used then (this is Vi compatible). The "- register is
+used as well if the delete is within a line.
+ With each successive deletion or change, Vim shifts the previous contents
+of register 1 into register 2, 2 into 3, and so forth, losing the previous
+contents of register 9.
+{Vi: numbered register contents are lost when changing files; register 0 does
+not exist}
+
+3. Small delete register "- *quote_-* *quote-*
+This register contains text from commands that delete less than one line,
+except when the command specifies a register with ["x].
+{not in Vi}
+
+4. Named registers "a to "z or "A to "Z *quote_alpha* *quotea*
+Vim fills these registers only when you say so. Specify them as lowercase
+letters to replace their previous contents or as uppercase letters to append
+to their previous contents.
+
+5. Read-only registers ":, "., "% and "#
+These are '%', '#', ':' and '.'. You can use them only with the "p", "P",
+and ":put" commands and with CTRL-R. {not in Vi}
+ *quote_.* *quote.* *E29*
+ ". Contains the last inserted text (the same as what is inserted
+ with the insert mode commands CTRL-A and CTRL-@). Note: this
+ doesn't work with CTRL-R on the command-line. It works a bit
+ differently, like inserting the text instead of putting it
+ ('textwidth' and other options affect what is inserted).
+ *quote_%* *quote%*
+ "% Contains the name of the current file.
+ *quote_#* *quote#*
+ "# Contains the name of the alternate file.
+ *quote_:* *quote:* *E30*
+ ": Contains the most recent executed command-line. Example: Use
+ "@:" to repeat the previous command-line command.
+ The command-line is only stored in this register when at least
+ one character of it was typed. Thus it remains unchanged if
+ the command was completely from a mapping.
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+
+6. Expression register "= *quote_=* *quote=*
+This is not really a register that stores text, but is a way to use an
+expression in commands which use a register. The expression register is
+read-only; you cannot put text into it. After the '=', the cursor moves to
+the command-line, where you can enter any expression (see |expression|). All
+normal command-line editing commands are available, including a special
+history for expressions. When you end the command-line by typing <CR>, Vim
+computes the result of the expression. If you end it with <Esc>, Vim abandons
+the expression. If you do not enter an expression, Vim uses the previous
+expression (like with the "/" command). If the "= register is used for the
+"p" command, the string is split up at <NL> characters. If the string ends in
+a <NL>, it is regarded as a linewise register. {not in Vi}
+
+7. Selection and drop registers "*, "+ and "~
+Use these register for storing and retrieving the selected text for the GUI.
+See |quotestar| and |quoteplus|. When the clipboard is not available or not
+working, the unnamed register is used instead. {not in Vi}
+
+Note that there is only a distinction between "* and "+ for X11 systems. For
+an explanation of the difference, see |x11-selection|. Under MS-Windows, use
+of "* and "+ is actually synonymous and refers to the |gui-clipboard|.
+
+ *quote_~* *quote~* *<Drop>*
+The read-only "~ register stores the dropped text from the last drag'n'drop
+operation. When something has been dropped onto Vim, the "~ register is
+filled in and the <Drop> pseudo key is sent for notification. You can remap
+this key if you want; the default action (for all modes) is to insert the
+contents of the "~ register at the cursor position. {not in Vi}
+{only available when compiled with the |+dnd| feature, curently only with the
+GTK GUI}
+
+Note: The "~ register is only used when dropping plain text onto Vim.
+Drag'n'drop of URI lists is handled internally.
+
+8. Black hole register "_ *quote_*
+When writing to this register, nothing happens. This can be used to delete
+text without affecting the normal registers. When reading from this register,
+nothing is returned. {not in Vi}
+
+9. Last search pattern register "/ *quote_/* *quote/*
+Contains the most recent search-pattern. This is used for "n" and 'hlsearch'.
+It is writable with ":let", you can change it to have 'hlsearch' highlight
+other matches without actually searching. You can't yank or delete into this
+register. {not in Vi}
+
+ *@/*
+You can write to a register with a ":let" command |:let-@|. Example: >
+ :let @/ = "the"
+
+If you use a put command without specifying a register, Vim uses the register
+that was last filled (this is also the contents of the unnamed register). If
+you are confused, use the ":dis" command to find out what Vim will put (this
+command displays all named and numbered registers; the unnamed register is
+labelled '"').
+
+The next three commands always work on whole lines.
+
+:[range]co[py] {address} *:co* *:copy*
+ Copy the lines given by [range] to below the line
+ given by {address}.
+
+ *:t*
+:t Synonym for copy.
+
+:[range]m[ove] {address} *:m* *:mo* *:move* *E134*
+ Move the lines given by [range] to below the line
+ given by {address}.
+
+==============================================================================
+6. Formatting text *formatting*
+
+:[range]ce[nter] [width] *:ce* *:center*
+ Center lines in [range] between [width] columns
+ (default 'textwidth' or 80 when 'textwidth' is 0).
+ {not in Vi}
+ Not available when |+ex_extra| feature was disabled at
+ compile time.
+
+:[range]ri[ght] [width] *:ri* *:right*
+ Right-align lines in [range] at [width] columns
+ (default 'textwidth' or 80 when 'textwidth' is 0).
+ {not in Vi}
+ Not available when |+ex_extra| feature was disabled at
+ compile time.
+
+ *:le* *:left*
+:[range]le[ft] [indent]
+ Left-align lines in [range]. Sets the indent in the
+ lines to [indent] (default 0). {not in Vi}
+ Not available when |+ex_extra| feature was disabled at
+ compile time.
+
+ *gq*
+gq{motion} Format the lines that {motion} moves over. The
+ 'textwidth' option controls the length of each
+ formatted line (see below). If the 'textwidth' option
+ is 0, the formatted line length is the screen width
+ (with a maximum width of 79). {not in Vi}
+ The 'formatoptions' option controls the type of
+ formatting |fo-table|.
+ NOTE: The "Q" command formerly performed this
+ function. If you still want to use "Q" for
+ formatting, use this mapping: >
+ :nnoremap Q gq
+
+gqgq *gqgq* *gqq*
+gqq Format the current line. {not in Vi}
+
+ *v_gq*
+{Visual}gq Format the highlighted text. (for {Visual} see
+ |Visual-mode|). {not in Vi}
+
+ *gw*
+gw{motion} Format the lines that {motion} moves over. Similar to
+ |gq| but puts the cursor back at the same position in
+ the text. However, 'formatprg' is not used.
+ {not in Vi}
+
+Example: To format the current paragraph use: *gqap* >
+ gqap
+
+The "gq" command leaves the cursor in the line where the motion command takes
+the cursor. This allows you to repeat formatting repeated with ".". This
+works well with "gqj" (format current and next line) and "gq}" (format until
+end of paragraph). Note: When 'formatprg' is set, "gq" leaves the cursor on
+the first formatted line (as with using a filter command).
+
+If you want to format the current paragraph and continue where you were, use: >
+ gwap
+If you always want to keep paragraphs formatted you may want to add the 'a'
+flag to 'formatoptions'. See |auto-format|.
+
+If the 'autoindent' option is on, Vim uses the indent of the first line for
+the following lines.
+
+Formatting does not change empty lines (but it does change lines with only
+white space!).
+
+The 'joinspaces' option is used when lines are joined together.
+
+You can set the 'formatprg' option to the name of an external program for Vim
+to use for text formatting. The 'textwidth' and other options have no effect
+on formatting by an external program.
+
+ *right-justify*
+There is no command in Vim to right justify text. You can do it with
+an external command, like "par" (e.g.: "!}par" to format until the end of the
+paragraph) or set 'formatprg' to "par".
+
+ *format-comments*
+Vim can format comments in a special way. Vim recognizes a comment by a
+specific string at the start of the line (ignoring white space). Three types
+of comments can be used:
+
+- A comment string that repeats at the start of each line. An example is the
+ type of comment used in shell scripts, starting with "#".
+- A comment string that occurs only in the first line, not in the following
+ lines. An example is this list with dashes.
+- Three-piece comments that have a start string, an end string, and optional
+ lines in between. The strings for the start, middle and end are different.
+ An example is the C-style comment:
+ /*
+ * this is a C comment
+ */
+
+The 'comments' option is a comma-separated list of parts. Each part defines a
+type of comment string. A part consists of:
+ {flags}:{string}
+
+{string} is the literal text that must appear.
+
+{flags}:
+ n Nested comment. Nesting with mixed parts is allowed. If 'comments'
+ is "n:),n:>" a line starting with "> ) >" is a comment.
+
+ b Blank (<Space>, <Tab> or <EOL>) required after {string}.
+
+ f Only the first line has the comment string. Do not repeat comment on
+ the next line, but preserve indentation (e.g., a bullet-list).
+
+ s Start of three-piece comment
+
+ m Middle of a three-piece comment
+
+ e End of a three-piece comment
+
+ l Left adjust middle with start or end (default). Only recognized when
+ used together with 's' or 'e'.
+
+ r Right adjust middle with start or end. Only recognized when used
+ together with 's' or 'e'.
+
+ O Don't use this one for the "O" command.
+
+ x Allows three-piece comments to be ended by just typing the last
+ character of the end-comment string as the first character on a new
+ line, when the middle-comment string has already been inserted
+ automatically. See below for more details.
+
+ {digits}
+ When together with 's' or 'e': add extra indent for the middle part.
+ This can be used to left-align the middle part with the start or end
+ and then add an offset.
+
+ -{digits}
+ Like {digits} but reduce the indent. This only works when there is
+ some indent for the start or end part that can be removed.
+
+When a string has none of the 'f', 's', 'm' or 'e' flags, Vim assumes the
+comment string repeats at the start of each line. The flags field may be
+empty.
+
+Any blank space in the text before and after the {string} is part of the
+{string}, so do not include leading or trailing blanks unless the blanks are a
+required part of the comment string.
+
+When one comment leader is part of another, specify the part after the whole.
+For example, to include both "-" and "->", use >
+ :set comments=f:->,f:-
+
+A three-piece comment must always be given as start,middle,end, with no other
+parts in between. An example of a three-piece comment is >
+ sr:/*,mb:*,ex:*/
+for C-comments. To avoid recognizing "*ptr" as a comment, the middle string
+includes the 'b' flag. For three-piece comments, Vim checks the text after
+the start and middle strings for the end string. If Vim finds the end string,
+the comment does not continue on the next line. Three-piece comments must
+have a middle string because otherwise Vim can't recognize the middle lines.
+
+Notice the use of the "x" flag in the above three-piece comment definition.
+When you hit Return in a C-comment, Vim will insert the middle comment leader
+for the new line, e.g. " * ". To close this comment you just have to type "/"
+before typing anything else on the new line. This will replace the
+middle-comment leader with the end-comment leader, leaving just " */". There
+is no need to hit BackSpace first.
+
+Examples: >
+ "b:*" Includes lines starting with "*", but not if the "*" is
+ followed by a non-blank. This avoids a pointer dereference
+ like "*str" to be recognized as a comment.
+ "n:>" Includes a line starting with ">", ">>", ">>>", etc.
+ "fb:-" Format a list that starts with "- ".
+
+By default, "b:#" is included. This means that a line that starts with
+"#include" is not recognized as a comment line. But a line that starts with
+"# define" is recognized. This is a compromise.
+
+Often the alignment can be changed from right alignment to a left alignment
+with an additional space. For example, for Javadoc comments, this can be
+used (insert a backslash before the space when using ":set"): >
+ s1:/*,mb:*,ex:*/
+Note that an offset is included with start, so that the middle part is left
+aligned with the start and then an offset of one character added. This makes
+it possible to left align the start and middle for this construction: >
+ /**
+ * comment
+ */
+
+{not available when compiled without the |+comments| feature}
+
+ *fo-table*
+You can use the 'formatoptions' option to influence how Vim formats text.
+'formatoptions' is a string that can contain any of the letters below. The
+default setting is "tcq". You can separate the option letters with commas for
+readability.
+
+letter meaning when present in 'formatoptions' ~
+
+t Auto-wrap text using textwidth (does not apply to comments)
+c Auto-wrap comments using textwidth, inserting the current comment
+ leader automatically.
+r Automatically insert the current comment leader after hitting
+ <Enter> in Insert mode.
+o Automatically insert the current comment leader after hitting 'o' or
+ 'O' in Normal mode.
+q Allow formatting of comments with "gq".
+ Note that formatting will not change blank lines or lines containing
+ only the comment leader. A new paragraph starts after such a line,
+ or when the comment leader changes.
+w Trailing white space indicates a paragraph continues in the next line.
+ A line that ends in a non-white character ends a paragraph.
+a Automatic formatting of paragraphs. Every time text is inserted or
+ deleted the paragraph will be reformatted. See |auto-format|.
+ When the 'c' flag is present this only happens for recognized
+ comments.
+n When formatting text, recognize numbered lists. The indent of the
+ text after the number is used for the next line. The number may
+ optionally be followed by '.', ':', ')', ']' or '}'. Note that
+ 'autoindent' must be set too. Doesn't work well together with "2".
+ Example: >
+ 1. the first item
+ wraps
+ 2. the second item
+2 When formatting text, use the indent of the second line of a paragraph
+ for the rest of the paragraph, instead of the indent of the first
+ line. This supports paragraphs in which the first line has a
+ different indent than the rest. Note that 'autoindent' must be set
+ too. Example: >
+ first line of a paragraph
+ second line of the same paragraph
+ third line.
+v Vi-compatible auto-wrapping in insert mode: Only break a line at a
+ blank that you have entered during the current insert command. (Note:
+ this is not 100% Vi compatible. Vi has some "unexpected features" or
+ bugs in this area. It uses the screen column instead of the line
+ column.)
+b Like 'v', but only auto-wrap if you enter a blank at or before
+ the wrap margin. If the line was longer than 'textwidth' when you
+ started the insert, or you do not enter a blank in the insert before
+ reaching 'textwidth', Vim does not perform auto-wrapping.
+l Long lines are not broken in insert mode: When a line was longer than
+ 'textwidth' when the insert command started, Vim does not
+ automatically format it.
+m Also break at a multi-byte character above 255. This is useful for
+ Asian text where every character is a word on its own.
+M When joining lines, don't insert a space before or after a multi-byte
+ character. Overrules the 'B' flag.
+B When joining lines, don't insert a space between two multi-byte
+ characters. Overruled by the 'M' flag.
+1 Don't break a line after a one-letter word. It's broken before it
+ instead (if possible).
+
+
+With 't' and 'c' you can specify when Vim performs auto-wrapping:
+value action ~
+"" no automatic formatting (you can use "gq" for manual formatting)
+"t" automatic formatting of text, but not comments
+"c" automatic formatting for comments, but not text (good for C code)
+"tc" automatic formatting for text and comments
+
+Note that when 'textwidth' is 0, Vim does no formatting anyway (but does
+insert comment leaders according to the 'comments' option).
+
+Note that when 'paste' is on, Vim does no formatting at all.
+
+Note that 'textwidth' can be non-zero even if Vim never performs auto-wrapping;
+'textwidth' is still useful for formatting with "gq".
+
+If the 'comments' option includes "/*", "*" and/or "*/", then Vim has some
+built in stuff to treat these types of comments a bit more cleverly.
+Opening a new line before or after "/*" or "*/" (with 'r' or 'o' present in
+'formatoptions') gives the correct start of the line automatically. The same
+happens with formatting and auto-wrapping. Opening a line after a line
+starting with "/*" or "*" and containing "*/", will cause no comment leader to
+be inserted, and the indent of the new line is taken from the line containing
+the start of the comment.
+E.g.:
+ /* ~
+ * Your typical comment. ~
+ */ ~
+ The indent on this line is the same as the start of the above
+ comment.
+
+All of this should be really cool, especially in conjunction with the new
+:autocmd command to prepare different settings for different types of file.
+
+Some examples:
+ for C code (only format comments): >
+ :set fo=croq
+< for Mail/news (format all, don't start comment with "o" command): >
+ :set fo=tcrq
+<
+
+Automatic formatting *auto-format*
+
+When the 'a' flag is present in 'formatoptions' text is formatted
+automatically when inserting text or deleting text. This works nice for
+editing text paragraphs. A few hints on how to use this:
+
+- You need to properly define paragraphs. The simplest is paragraphs that are
+ separated by a blank line. When there is no separating blank line, consider
+ using the 'w' flag and adding a space at the end of each line in the
+ paragraphs except the last one.
+
+- You can set the 'formatoptions' based on the type of file |filetype| or
+ specifically for one file with a |modeline|.
+
+- Set 'formatoptions' to "aw2tq" to make text with indents like this:
+
+ bla bla foobar bla
+ bla foobar bla foobar bla
+ bla bla foobar bla
+ bla foobar bla bla foobar
+
+- Add the 'c' flag to only auto-format comments. Useful in source code.
+
+And a few warnings:
+
+- When part of the text is not properly separated in paragraphs, making
+ changes in this text will cause it to be formatted anyway. Consider doing >
+
+ :set fo-=a
+
+- When using the 'w' flag (trailing space means paragraph continues) and
+ deleting the last line of a paragraph with |dd|, the paragraph will be
+ joined with the next one.
+
+- Changed text is saved for undo. Formatting is also a change. Thus each
+ format action saves text for undo. This may consume quite a lot of memory.
+
+- Formatting a long paragraph and/or with complicated indenting may be slow.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
new file mode 100644
index 000000000..90b35b412
--- /dev/null
+++ b/runtime/doc/cmdline.txt
@@ -0,0 +1,992 @@
+*cmdline.txt* For Vim version 7.0aa. Last change: 2004 Mar 31
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *Cmdline-mode* *Command-line-mode*
+Command-line mode *Cmdline* *Command-line* *mode-cmdline* *:*
+
+Command-line mode is used to enter Ex commands (":"), search patterns
+("/" and "?"), and filter commands ("!").
+
+Basic command line editing is explained in chapter 20 of the user manual
+|usr_20.txt|.
+
+1. Command-line editing |cmdline-editing|
+2. Command-line completion |cmdline-completion|
+3. Ex command-lines |cmdline-lines|
+4. Ex command-line ranges |cmdline-ranges|
+5. Ex special characters |cmdline-special|
+6. Command-line window |cmdline-window|
+
+==============================================================================
+1. Command-line editing *cmdline-editing*
+
+Normally characters are inserted in front of the cursor position. You can
+move around in the command-line with the left and right cursor keys. With the
+<Insert> key, you can toggle between inserting and overstriking characters.
+{Vi: can only alter the last character in the line}
+
+Note that if your keyboard does not have working cursor keys or any of the
+other special keys, you can use ":cnoremap" to define another key for them.
+For example, to define tcsh style editing keys: *tcsh-style* >
+ :cnoremap <C-A> <Home>
+ :cnoremap <C-F> <Right>
+ :cnoremap <C-B> <Left>
+ :cnoremap <Esc>b <S-Left>
+ :cnoremap <Esc>f <S-Right>
+(<> notation |<>|; type all this literally)
+
+ *cmdline-too-long*
+When the command line is getting longer than what fits on the screen, only the
+part that fits will be shown. The cursor can only move in this visible part,
+thus you cannot edit beyond that.
+
+ *cmdline-history* *history*
+The command-lines that you enter are remembered in a history table. You can
+recall them with the up and down cursor keys. There are actually four
+history tables:
+- one for ':' commands
+- one for search strings
+- one for expressions
+- one for input lines, typed for the |input()| function.
+These are completely separate. Each history can only be accessed when
+entering the same type of line.
+Use the 'history' option to set the number of lines that are remembered
+(default: 20).
+Notes:
+- When you enter a command-line that is exactly the same as an older one, the
+ old one is removed (to avoid repeated commands moving older commands out of
+ the history).
+- Only commands that are typed are remembered. Ones that completely come from
+ mappings are not put in the history
+- All searches are put in the search history, including the ones that come
+ from commands like "*" and "#". But for a mapping, only the last search is
+ remembered (to avoid that long mappings trash the history).
+{Vi: no history}
+{not available when compiled without the |+cmdline_hist| feature}
+
+There is an automatic completion of names on the command-line; see
+|cmdline-completion|.
+
+ *c_CTRL-V*
+CTRL-V Insert next non-digit literally. Up to three digits form the
+ decimal value of a single byte. The non-digit and the three
+ digits are not considered for mapping. This works the same
+ way as in Insert mode (see above, |i_CTRL-V|).
+ Note: Under Windows CTRL-V is often mapped to paste text.
+ Use CTRL-Q instead then.
+ *c_CTRL-Q*
+CTRL-Q Same as CTRL-V. But with some terminals it is used for
+ control flow, it doesn't work then.
+
+ *c_<Left>*
+<Left> cursor left
+ *c_<Right>*
+<Right> cursor right
+ *c_<S-Left>*
+<S-Left> or <C-Left> *c_<C-Left>*
+ cursor one WORD left
+ *c_<S-Right>*
+<S-Right> or <C-Right> *c_<C-Right>*
+ cursor one WORD right
+CTRL-B or <Home> *c_CTRL-B* *c_<Home>*
+ cursor to beginning of command-line
+CTRL-E or <End> *c_CTRL-E* *c_<End>*
+ cursor to end of command-line
+
+ *c_<LeftMouse>*
+<LeftMouse> cursor to position of mouse click.
+
+CTRL-H *c_<BS>* *c_CTRL-H*
+<BS> delete the character in front of the cursor (see |:fixdel| if
+ your <BS> key does not do what you want).
+ *c_<Del>*
+<Del> delete the character under the cursor (at end of line:
+ character before the cursor) (see |:fixdel| if your <Del>
+ key does not do what you want).
+ *c_CTRL-W*
+CTRL-W delete the word before the cursor
+ *c_CTRL-U*
+CTRL-U remove all characters between the cursor position and
+ the beginning of the line. Previous versions of vim
+ deleted all characters on the line. If that is the
+ preferred behavior, add the following to your .vimrc: >
+ :cnoremap <C-U> <C-E><C-U>
+<
+ Note: if the command-line becomes empty with one of the
+ delete commands, Command-line mode is quit.
+ *c_<Insert>*
+<Insert> Toggle between insert and overstrike. {not in Vi}
+
+{char1} <BS> {char2} or *c_digraph*
+CTRL-K {char1} {char2} *c_CTRL-K*
+ enter digraph (see |digraphs|). When {char1} is a special
+ key, the code for that key is inserted in <> form. {not in Vi}
+
+CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
+ Insert the contents of a numbered or named register. Between
+ typing CTRL-R and the second character '"' will be displayed
+ to indicate that you are expected to enter the name of a
+ register.
+ The text is inserted as if you typed it, but mappings and
+ abbreviations are not used. Command-line completion through
+ 'wildchar' is not triggered though. And characters that end
+ the command line are inserted literally (<Esc>, <CR>, <NL>,
+ <C-C>). A <BS> or CTRL-W could still end the command line
+ though, and remaining characters will then be interpreted in
+ another mode, which might not be what you intended.
+ Special registers:
+ '"' the unnamed register, containing the text of
+ the last delete or yank
+ '%' the current file name
+ '#' the alternate file name
+ '*' the clipboard contents (X11: primary selection)
+ '+' the clipboard contents
+ '/' the last search pattern
+ ':' the last command-line
+ '-' the last small (less than a line) delete
+ '.' the last inserted text
+ *c_CTRL-R_=*
+ '=' the expression register: you are prompted to
+ enter an expression (see |expression|)
+ See |registers| about registers. {not in Vi}
+
+CTRL-R CTRL-F *c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>*
+CTRL-R CTRL-P *c_CTRL-R_CTRL-P* *c_<C-R>_<C-P>*
+CTRL-R CTRL-W *c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
+CTRL-R CTRL-A *c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
+ Insert the object under the cursor:
+ CTRL-F the Filename under the cursor
+ CTRL-P the Filename under the cursor, expanded with
+ 'path' as in |gf|
+ CTRL-W the Word under the cursor
+ CTRL-A the WORD under the cursor; see |WORD|
+ {not in Vi}
+ CTRL-F and CTRL-P: {only when +file_in_path feature is
+ included}
+
+ *c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
+ *c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
+CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
+CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
+ Insert register or object under the cursor. Works like
+ |c_CTRL-R| but inserts the text literally. For example, if
+ register a contains "xy^Hz" (where ^H is a backspace),
+ "CTRL-R a" will insert "xz" while "CTRL-R CTRL-R a" will
+ insert "xy^Hz".
+
+CTRL-\ e {expr} *c_CTRL-\_e*
+ Evaluate {expr} and replace the whole command line with the
+ result. You will be prompted for the expression, type <Enter>
+ to finish it. It's most useful in mappings though. See
+ |expression|.
+ See |c_CTRL-R_=| for inserting the result of an expression.
+ Useful functions are |getcmdline()| and |getcmdpos()|.
+ The cursor position is unchanged, except when the cursor was
+ at the end of the line, then it stays at the end.
+ |setcmdpos()| can be used to set the cursor position.
+ Example: >
+ :cmap <F7> <C-\>eAppendSome()<CR>
+ :func AppendSome()
+ :let cmd = getcmdline() . " Some()"
+ :" place the cursor on the )
+ :call setcmdpos(strlen(cmd))
+ :return cmd
+ :endfunc
+<
+ *c_CTRL-Y*
+CTRL-Y When there is a modeless selection, copy the selection into
+ the clipboard. |modeless-selection|
+ If there is no selection CTRL-Y is inserted as a character.
+
+CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>*
+<CR> or <NL> start entered command
+ *c_<Esc>*
+<Esc> When typed and 'x' not present in 'cpoptions', quit
+ Command-line mode without executing. In macros or when 'x'
+ present in 'cpoptions', start entered command.
+ *c_CTRL-C*
+CTRL-C quit command-line without executing
+
+ *c_<Up>*
+<Up> recall older command-line from history, whose beginning
+ matches the current command-line (see below).
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+ *c_<Down>*
+<Down> recall more recent command-line from history, whose beginning
+ matches the current command-line (see below).
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+
+ *c_<S-Up>* *c_<PageUp>*
+<S-Up> or <PageUp>
+ recall older command-line from history
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+ *c_<S-Down>* *c_<PageDown>*
+<S-Down> or <PageDown>
+ recall more recent command-line from history
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+
+CTRL-D command-line completion (see |cmdline-completion|)
+'wildchar' option
+ command-line completion (see |cmdline-completion|)
+CTRL-N command-line completion (see |cmdline-completion|)
+CTRL-P command-line completion (see |cmdline-completion|)
+CTRL-A command-line completion (see |cmdline-completion|)
+CTRL-L command-line completion (see |cmdline-completion|)
+
+ *c_CTRL-_*
+CTRL-_ a - switch between Hebrew and English keyboard mode, which is
+ private to the command-line and not related to hkmap.
+ This is useful when Hebrew text entry is required in the
+ command-line, searches, abbreviations, etc. Applies only if
+ Vim is compiled with the |+rightleft| feature and the
+ 'allowrevins' option is set.
+ See |rileft.txt|.
+
+ b - switch between Farsi and English keyboard mode, which is
+ private to the command-line and not related to fkmap. In
+ Farsi keyboard mode the characters are inserted in reverse
+ insert manner. This is useful when Farsi text entry is
+ required in the command-line, searches, abbreviations, etc.
+ Applies only if Vim is compiled with the |+farsi| feature.
+ See |farsi.txt|.
+
+ *c_CTRL-^*
+CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
+ Method.
+ When typing a pattern for a search command and 'imsearch' is
+ not -1, VAL is the value of 'imsearch', otherwise VAL is the
+ value of 'iminsert'.
+ When language mappings are defined:
+ - If VAL is 1 (langmap mappings used) it becomes 0 (no langmap
+ mappings used).
+ - If VAL was not 1 it becomes 1, thus langmap mappings are
+ enabled.
+ When no language mappings are defined:
+ - If VAL is 2 (Input Method is used) it becomes 0 (no input
+ method used)
+ - If VAL has another value it becomes 2, thus the Input Method
+ is enabled.
+ These language mappings are normally used to type characters
+ that are different from what the keyboard produces. The
+ 'keymap' option can be used to install a whole number of them.
+ When entering a command line, langmap mappings are switched
+ off, since you are expected to type a command. After
+ switching it on with CTRL-^, the new state is not used again
+ for the next command or Search pattern.
+ {not in Vi}
+
+For Emacs-style editing on the command-line see |emacs-keys|.
+
+The <Up> and <Down> keys take the current command-line as a search string.
+The beginning of the next/previous command-lines are compared with this
+string. The first line that matches is the new command-line. When typing
+these two keys repeatedly, the same string is used again. For example, this
+can be used to find the previous substitute command: Type ":s" and then <Up>.
+The same could be done by typing <S-Up> a number of times until the desired
+command-line is shown. (Note: the shifted arrow keys do not work on all
+terminals)
+
+ *his* *:history*
+:his[tory] Print the history of last entered commands.
+ {not in Vi}
+ {not available when compiled without the |+cmdline_hist|
+ feature}
+
+:his[tory] [{name}] [{first}][, [{last}]]
+ List the contents of history {name} which can be:
+ c[md] or : command-line history
+ s[earch] or / search string history
+ e[xpr] or = expression register history
+ i[nput] or @ input line history
+ a[ll] all of the above
+ {not in Vi}
+
+ If the numbers {first} and/or {last} are given, the respective
+ range of entries from a history is listed. These numbers can
+ be specified in the following form:
+ *:history-indexing*
+ A positive number represents the absolute index of an entry
+ as it is given in the first column of a :history listing.
+ This number remains fixed even if other entries are deleted.
+
+ A negative number means the relative position of an entry,
+ counted from the newest entry (which has index -1) backwards.
+
+ Examples:
+ List entries 6 to 12 from the search history: >
+ :history / 6,12
+<
+ List the recent five entries from all histories: >
+ :history all -5,
+
+==============================================================================
+2. Command-line completion *cmdline-completion*
+
+When editing the command-line, a few commands can be used to complete the
+word before the cursor. This is available for:
+
+- Command names: At the start of the command-line.
+- Tags: Only after the ":tag" command.
+- File names: Only after a command that accepts a file name or a setting for
+ an option that can be set to a file name. This is called file name
+ completion.
+- Options: Only after the ":set" command.
+- Mappings: Only after a ":map" or similar command.
+- Variable and function names: Only after a ":if", ":call" or similar command.
+
+When Vim was compiled with the |+cmdline_compl| feature disabled, only file
+names, directories and help items can be completed.
+
+These are the commands that can be used:
+
+ *c_CTRL-D*
+CTRL-D List names that match the pattern in front of the cursor.
+ When showing file names, directories are highlighted (see
+ 'highlight' option). Names where 'suffixes' matches are moved
+ to the end.
+ *c_CTRL-I* *c_wildchar* *c_<Tab>*
+'wildchar' option
+ A match is done on the pattern in front of the cursor. The
+ match (if there are several, the first match) is inserted
+ in place of the pattern. (Note: does not work inside a
+ macro, because <Tab> or <Esc> are mostly used as 'wildchar',
+ and these have a special meaning in some macros.) When typed
+ again and there were multiple matches, the next
+ match is inserted. After the last match, the first is used
+ again (wrap around).
+ The behavior can be changed with the 'wildmode' option.
+ *c_CTRL-N*
+CTRL-N After using 'wildchar' which got multiple matches, go to next
+ match. Otherwise recall more recent command-line from history.
+<S-Tab> *c_CTRL-P* *c_<S-Tab>*
+CTRL-P After using 'wildchar' which got multiple matches, go to
+ previous match. Otherwise recall older command-line from
+ history. <S-Tab> only works with the GUI, on the Amiga and
+ with MS-DOS.
+ *c_CTRL-A*
+CTRL-A All names that match the pattern in front of the cursor are
+ inserted.
+ *c_CTRL-L*
+CTRL-L A match is done on the pattern in front of the cursor. If
+ there is one match, it is inserted in place of the pattern.
+ If there are multiple matches the longest common part is
+ inserted in place of the pattern. If the result is shorter
+ than the pattern, no completion is done.
+
+The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
+a previous version <Esc> was used). In the pattern standard wildcards '*' and
+'?' are accepted. '*' matches any string, '?' matches exactly one character.
+
+If you like tcsh's autolist completion, you can use this mapping:
+ :cnoremap X <C-L><C-D>
+(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
+This will find the longest match and then list all matching files.
+
+If you like tcsh's autolist completion, you can use the 'wildmode' option to
+emulate it. For example, this mimics autolist=ambiguous:
+ :set wildmode=longest,list
+This will find the longest match with the first 'wildchar', then list all
+matching files with the next.
+
+ *suffixes*
+For file name completion you can use the 'suffixes' option to set a priority
+between files with almost the same name. If there are multiple matches,
+those files with an extension that is in the 'suffixes' option are ignored.
+The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
+in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
+It is impossible to ignore suffixes with two dots. Examples:
+
+ pattern: files: match: ~
+ test* test.c test.h test.o test.c
+ test* test.h test.o test.h and test.o
+ test* test.i test.h test.c test.i and test.c
+
+If there is more than one matching file (after ignoring the ones matching
+the 'suffixes' option) the first file name is inserted. You can see that
+there is only one match when you type 'wildchar' twice and the completed
+match stays the same. You can get to the other matches by entering
+'wildchar', CTRL-N or CTRL-P. All files are included, also the ones with
+extensions matching the 'suffixes' option.
+
+To completely ignore files with some extension use 'wildignore'.
+
+The old value of an option can be obtained by hitting 'wildchar' just after
+the '='. For example, typing 'wildchar' after ":set dir=" will insert the
+current value of 'dir'. This overrules file name completion for the options
+that take a file name.
+
+If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
+your .cshrc: >
+ xmodmap -e "keysym Tab = Tab Find"
+And this in your .vimrc: >
+ :cmap <Esc>[1~ <C-P>
+
+==============================================================================
+3. Ex command-lines *cmdline-lines*
+
+The Ex commands have a few specialties:
+
+ *:quote*
+'"' at the start of a line causes the whole line to be ignored. '"'
+after a command causes the rest of the line to be ignored. This can be used
+to add comments. Example: >
+ :set ai "set 'autoindent' option
+It is not possible to add a comment to a shell command ":!cmd" or to the
+":map" command and friends, because they see the '"' as part of their
+argument.
+
+ *:bar* *:\bar*
+'|' can be used to separate commands, so you can give multiple commands in one
+line. If you want to use '|' in an argument, precede it with '\'.
+
+These commands see the '|' as their argument, and can therefore not be
+followed by another command:
+ :argdo
+ :autocmd
+ :bufdo
+ :command
+ :cscope
+ :debug
+ :folddoopen
+ :folddoclosed
+ :function
+ :global
+ :help
+ :helpfind
+ :make
+ :normal
+ :perl
+ :perldo
+ :promptfind
+ :promptrepl
+ :pyfile
+ :python
+ :registers
+ :read !
+ :scscope
+ :tcl
+ :tcldo
+ :tclfile
+ :vglobal
+ :windo
+ :write !
+ :[range]!
+ a user defined command without the "-bar" argument |:command|
+
+Note that this is confusing (inherited from Vi): With ":g" the '|' is included
+in the command, with ":s" it is not.
+
+To be able to use another command anyway, use the ":execute" command.
+Example (append the output of "ls" and jump to the first line): >
+ :execute 'r !ls' | '[
+
+There is one exception: When the 'b' flag is present in 'cpoptions', with the
+":map" and ":abbr" commands and friends CTRL-V needs to be used instead of
+'\'. You can also use "<Bar>" instead. See also |map_bar|.
+
+Examples: >
+ :!ls | wc view the output of two commands
+ :r !ls | wc insert the same output in the text
+ :%g/foo/p|> moves all matching lines one shiftwidth
+ :%s/foo/bar/|> moves one line one shiftwidth
+ :map q 10^V| map "q" to "10|"
+ :map q 10\| map \ l map "q" to "10\" and map "\" to "l"
+ (when 'b' is present in 'cpoptions')
+
+You can also use <NL> to separate commands in the same way as with '|'. To
+insert a <NL> use CTRL-V CTRL-J. "^@" will be shown. Using '|' is the
+preferred method. But for external commands a <NL> must be used, because a
+'|' is included in the external command. To avoid the special meaning of <NL>
+it must be preceded with a backslash. Example: >
+ :r !date<NL>-join
+This reads the current date into the file and joins it with the previous line.
+
+Note that when the command before the '|' generates an error, the following
+commands will not be executed.
+
+
+Because of Vi compatibility the following strange commands are supported: >
+ :| print current line (like ":p")
+ :3| print line 3 (like ":3p")
+ :3 goto line 3
+
+A colon is allowed between the range and the command name. It is ignored
+(this is Vi compatible). For example: >
+ :1,$:s/pat/string
+
+When the character '%' or '#' is used where a file name is expected, they are
+expanded to the current and alternate file name (see the chapter "editing
+files" |:_%| |:_#|).
+
+Embedded spaces in file names are allowed on the Amiga if one file name is
+expected as argument. Trailing spaces will be ignored, unless escaped with a
+backslash or CTRL-V. Note that the ":next" command uses spaces to separate
+file names. Escape the spaces to include them in a file name. Example: >
+ :next foo\ bar goes\ to school\
+starts editing the three files "foo bar", "goes to" and "school ".
+
+When you want to use the special characters '"' or '|' in a command, or want
+to use '%' or '#' in a file name, precede them with a backslash. The
+backslash is not required in a range and in the ":substitute" command.
+
+ *:_!*
+The '!' (bang) character after an Ex command makes the command behave in a
+different way. The '!' should be placed immediately after the command, without
+any blanks in between. If you insert blanks the '!' will be seen as an
+argument for the command, which has a different meaning. For example:
+ :w! name write the current buffer to file "name", overwriting
+ any existing file
+ :w !name send the current buffer as standard input to command
+ "name"
+
+==============================================================================
+4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* *E493*
+
+Some Ex commands accept a line range in front of them. This is noted as
+[range]. It consists of one or more line specifiers, separated with ',' or
+';'.
+
+The basics are explained in section |10.3| of the user manual.
+
+ *:,* *:;*
+When separated with ';' the cursor position will be set to that line
+before interpreting the next line specifier. This doesn't happen for ','.
+Examples: >
+ 4,/this line/
+< from line 4 till match with "this line" after the cursor line. >
+ 5;/that line/
+< from line 5 till match with "that line" after line 5.
+
+The default line specifier for most commands is the cursor position, but the
+commands ":write" and ":global" have the whole file (1,$) as default.
+
+If more line specifiers are given than required for the command, the first
+one(s) will be ignored.
+
+Line numbers may be specified with: *:range* *E14* *{address}*
+ {number} an absolute line number
+ . the current line *:.*
+ $ the last line in the file *:$*
+ % equal to 1,$ (the entire file) *:%*
+ 't position of mark t (lowercase) *:'*
+ 'T position of mark T (uppercase); when the mark is in
+ another file it cannot be used in a range
+ /{pattern}[/] the next line where {pattern} matches *:/*
+ ?{pattern}[?] the previous line where {pattern} matches *:?*
+ \/ the next line where the previously used search
+ pattern matches
+ \? the previous line where the previously used search
+ pattern matches
+ \& the next line where the previously used substitute
+ pattern matches
+
+Each may be followed (several times) by '+' or '-' and an optional number.
+This number is added or subtracted from the preceding line number. If the
+number is omitted, 1 is used.
+
+The "/" and "?" after {pattern} are required to separate the pattern from
+anything that follows.
+
+The "/" and "?" may be preceded with another address. The search starts from
+there. The difference from using ';' is that the cursor isn't moved.
+Examples: >
+ /pat1//pat2/ Find line containing "pat2" after line containing
+ "pat1", without moving the cursor.
+ 7;/pat2/ Find line containing "pat2", after line 7, leaving
+ the cursor in line 7.
+
+The {number} must be between 0 and the number of lines in the file. When
+using a 0 (zero) this is interpreted as a 1 by most commands. Commands that
+use it as a count do use it as a zero (|:tag|, |:pop|, etc). Some commands
+interpret the zero as "before the first line" (|:read|, search pattern, etc).
+
+Examples: >
+ .+3 three lines below the cursor
+ /that/+1 the line below the next line containing "that"
+ .,$ from current line until end of file
+ 0;/that the first line containing "that", also matches in the
+ first line.
+ 1;/that the first line after line 1 containing "that"
+
+Some commands allow for a count after the command. This count is used as the
+number of lines to be used, starting with the line given in the last line
+specifier (the default is the cursor line). The commands that accept a count
+are the ones that use a range but do not have a file name argument (because
+a file name can also be a number).
+
+Examples: >
+ :s/x/X/g 5 substitute 'x' by 'X' in the current line and four
+ following lines
+ :23d 4 delete lines 23, 24, 25 and 26
+
+
+Folds and Range
+
+When folds are active the line numbers are rounded off to include the whole
+closed fold. See |fold-behavior|.
+
+
+Reverse Range
+
+A range should have the lower line number first. If this is not the case, Vim
+will ask you if it should swap the line numbers. This is not done within the
+global command ":g".
+
+
+Count and Range *N:*
+
+When giving a count before entering ":", this is translated into:
+ :.,.+(count - 1)
+In words: The 'count' lines at and after the cursor. Example: To delete
+three lines: >
+ 3:d<CR> is translated into: .,.+2d<CR>
+<
+
+Visual Mode and Range *v_:*
+
+{Visual}: Starts a command-line with the Visual selected lines as a
+ range. The code ":'<,'>" is used for this range, which makes
+ it possible to select a similar line from the command-line
+ history for repeating a command on different Visually selected
+ lines.
+
+==============================================================================
+5. Ex special characters *cmdline-special*
+
+In Ex commands, at places where a file name can be used, the following
+characters have a special meaning. These can also be used in the expression
+function expand() |expand()|.
+ % is replaced with the current file name *:_%*
+ # is replaced with the alternate file name *:_#*
+ #n (where n is a number) is replaced with the file name of
+ buffer n. "#0" is the same as "#"
+ ## is replaced with all names in the argument list *:_##*
+ concatenated, separated by spaces. Each space in a name
+ is preceded with a backslash.
+Note that these give the file name as it was typed. If an absolute path is
+needed (when using the file name from a different directory), you need to add
+":p". See |filename-modifiers|.
+Note that backslashes are inserted before spaces, so that the command will
+correctly interpret the file name. But this doesn't happen for shell
+commands. For those you probably have to use quotes: >
+ :!ls "%"
+ :r !spell "%"
+
+To avoid the special meaning of '%' and '#' insert a backslash before it.
+Detail: The special meaning is always escaped when there is a backslash before
+it, no matter how many backslashes.
+ you type: result ~
+ # alternate.file
+ \# #
+ \\# \#
+
+ *:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
+ *:<sfile>* *<sfile>* *:<afile>* *<afile>*
+ *:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
+ *E495* *E496* *E497* *E498* *E499* *E500*
+Note: these are typed literally, they are not special keys!
+ <cword> is replaced with the word under the cursor (like |star|)
+ <cWORD> is replaced with the WORD under the cursor (see |WORD|)
+ <cfile> is replaced with the path name under the cursor (like what
+ |gf| uses)
+ <afile> when executing autocommands, is replaced with the file name
+ for a file read or write
+ <abuf> when executing autocommands, is replaced with the currently
+ effective buffer number (for ":r file" it is the current
+ buffer, the file being read is not in a buffer).
+ <amatch> when executing autocommands, is replaced with the match for
+ which this autocommand was executed. It differs form
+ <afile> only when the file name isn't used to match with
+ (for FileType and Syntax events).
+ <sfile> when executing a ":source" command, is replaced with the
+ file name of the sourced file;
+ when executing a function, is replaced with
+ "function {function-name}"; function call nesting is
+ indicated like this:
+ "function {function-name1}..{function-name2}". Note that
+ filename-modifiers are useless when <sfile> is used inside
+ a function.
+
+ *filename-modifiers*
+ *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs*
+The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
+"<afile>" or "<abuf>". They are also used with the |fnamemodify()| function.
+These are not available when Vim has been compiled without the |+modify_fname|
+feature.
+These modifiers can be given, in this order:
+ :p Make file name a full path. Must be the first modifier. Also
+ changes "~/" (and "~user/" for Unix and VMS) to the path for
+ the home directory. If the name is a directory a path
+ separator is added at the end. For a file name that does not
+ exist and does not have an absolute path the result is
+ unpredictable.
+ :8 Converts the path to 8.3 short format (currently only on
+ win32). Will act on as much of a path that is an existing
+ path.
+ :~ Reduce file name to be relative to the home directory, if
+ possible. File name is unmodified if it is not below the home
+ directory.
+ :. Reduce file name to be relative to current directory, if
+ possible. File name is unmodified if it is not below the
+ current directory.
+ For maximum shortness, use ":~:.".
+ :h Head of the file name (the last component and any separators
+ removed). Cannot be used with :e, :r or :t.
+ Can be repeated to remove several components at the end.
+ When the file name ends in a path separator, only the path
+ separator is removed. Thus ":p:h" on a directory name results
+ on the directory name itself (without trailing slash).
+ When the file name is an absolute path (starts with "/" for
+ Unix; "x:\" for MS-DOS, WIN32, OS/2; "drive:" for Amiga), that
+ part is not removed. When there is no head (path is relative
+ to current directory) the result is empty.
+ :t Tail of the file name (last component of the name). Must
+ precede any :r or :e.
+ :r Root of the file name (the last extension removed). When
+ there is only an extension (file name that starts with '.',
+ e.g., ".vimrc"), it is not removed. Can be repeated to remove
+ several extensions (last one first).
+ :e Extension of the file name. Only makes sense when used alone.
+ When there is no extension the result is empty.
+ When there is only an extension (file name that starts with
+ '.'), the result is empty. Can be repeated to include more
+ extensions. If there are not enough extensions (but at least
+ one) as much as possible are included.
+ :s?pat?sub?
+ Substitute the first occurrence of "pat" with "sub". This
+ works like the |:s| command. "pat" is a regular expression.
+ Any character can be used for '?', but it must not occur in
+ "pat" or "sub".
+ After this, the previous modifiers can be used again. For
+ example ":p", to make a full path after the substitution.
+ :gs?pat?sub?
+ Substitute all occurrences of "path" with "sub". Otherwise
+ this works like ":s".
+
+Examples, when the file name is "src/version.c", current dir
+"/home/mool/vim": >
+ :p /home/mool/vim/src/version.c
+ :p:. src/version.c
+ :p:~ ~/vim/src/version.c
+ :h src
+ :p:h /home/mool/vim/src
+ :p:h:h /home/mool/vim
+ :t version.c
+ :p:t version.c
+ :r src/version
+ :p:r /home/mool/vim/src/version
+ :t:r version
+ :e c
+ :s?version?main? src/main.c
+ :s?version?main?:p /home/mool/vim/src/main.c
+ :p:gs?/?\\? \home\mool\vim\src\version.c
+
+Examples, when the file name is "src/version.c.gz": >
+ :p /home/mool/vim/src/version.c.gz
+ :e gz
+ :e:e c.gz
+ :e:e:e c.gz
+ :e:e:r c
+ :r src/version.c
+ :r:e c
+ :r:r src/version
+ :r:r:r src/version
+<
+ *extension-removal* *:_%<*
+If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file
+name is removed (everything after and including the last '.' in the file
+name). This is included for backwards compatibility with version 3.0, the
+":r" form is preferred. Examples: >
+
+ % current file name
+ %< current file name without extension
+ # alternate file name for current window
+ #< idem, without extension
+ #31 alternate file number 31
+ #31< idem, without extension
+ <cword> word under the cursor
+ <cWORD> WORD under the cursor (see |WORD|)
+ <cfile> path name under the cursor
+ <cfile>< idem, without extension
+
+Note: Where a file name is expected wildcards expansion is done. On Unix the
+shell is used for this, unless it can be done internally (for speed).
+Backticks also work, like in >
+ :n `echo *.c`
+(backtick expansion is not possible in |restricted-mode|)
+But expansion is only done if there are any wildcards before expanding the
+'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
+want to expand the result of <cfile>, add a wildcard character to it.
+Examples: (alternate file name is "?readme?")
+ command expands to ~
+ :e # :e ?readme?
+ :e `ls #` :e {files matching "?readme?"}
+ :e #.* :e {files matching "?readme?.*"}
+ :cd <cfile> :cd {file name under cursor}
+ :cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
+
+When the expanded argument contains a "!" and it is used for a shell command
+(":!cmd", ":r !cmd" or ":w !cmd"), it is escaped with a backslash to avoid it
+being expanded into a previously used command. When the 'shell' option
+contains "sh", this is done twice, to avoid the shell trying to expand the
+"!".
+
+ *filename-backslash*
+For filesystems that use a backslash as directory separator (MS-DOS, Windows,
+OS/2), it's a bit difficult to recognize a backslash that is used to escape
+the special meaning of the next character. The general rule is: If the
+backslash is followed by a normal file name character, it does not have a
+special meaning. Therefore "\file\foo" is a valid file name, you don't have
+to type the backslash twice.
+
+An exception is the '$' sign. It is a valid character in a file name. But
+to avoid a file name like "$home" to be interpreted as an environment variable,
+it needs to be preceded by a backslash. Therefore you need to use "/\$home"
+for the file "$home" in the root directory. A few examples:
+
+ FILE NAME INTERPRETED AS ~
+ $home expanded to value of environment var $home
+ \$home file "$home" in current directory
+ /\$home file "$home" in root directory
+ \\$home file "\\", followed by expanded $home
+
+==============================================================================
+6. Command-line window *cmdline-window* *cmdwin*
+
+In the command-line window the command line can be edited just like editing
+text in any window. It is a special kind of window, because you cannot leave
+it in a normal way.
+{not available when compiled without the |+cmdline_hist| or |+vertsplit|
+feature}
+
+
+OPEN
+
+There are two ways to open the command-line window:
+1. From Command-line mode, use the key specified with the 'cedit' option.
+ The default is CTRL-F when 'compatible' is not set.
+2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?*
+ This starts editing an Ex command-line ("q:") or search string ("q/" or
+ "q?"). Note that this is not possible while recording is in progress (the
+ "q" stops recording then).
+
+When the window opens it is filled with the command-line history. The last
+line contains the command as typed so far. The left column will show a
+character that indicates the type of command-line being edited, see
+|cmdwin-char|.
+
+Vim will be in Normal mode when the editor is opened, except when 'insertmode'
+is set.
+
+The height of the window is specified with 'cmdwinheight' (or smaller if there
+is no room). The window is always full width and is positioned just above the
+command-line.
+
+
+EDIT
+
+You can now use commands to move around and edit the text in the window. Both
+in Normal mode and Insert mode.
+
+It is possible to use ":", "/" and other commands that use the command-line,
+but it's not possible to open another command-line window then. There is no
+nesting.
+ *E11*
+The command-line window is not a normal window. It is not possible to move to
+another window or edit another buffer. All commands that would do this are
+disabled in the command-line window. Of course it _is_ possible to execute
+any command that you entered in the command-line window.
+
+
+CLOSE *E199*
+
+There are several ways to leave the command-line window:
+
+<CR> Execute the command-line under the cursor. Works both in
+ Insert and in Normal mode.
+CTRL-C Continue in Command-line mode. The command-line under the
+ cursor is used as the command-line. Works both in Insert and
+ in Normal mode. ":close" also works. There is no redraw,
+ thus the window will remain visible.
+:quit Discard the command line and go back to Normal mode.
+ ":exit", ":xit" and CTRL-\ CTRL-N also work.
+:qall Quit Vim, unless there are changes in some buffer.
+:qall! Quit Vim, discarding changes to any buffer.
+
+Once the command-line window is closed the old window sizes are restored. The
+executed command applies to the window and buffer where the command-line was
+started from. This works as if the command-line window was not there, except
+that there will be an extra screen redraw.
+The buffer used for the command-line window is deleted. Any changes to lines
+other than the one that is executed with <CR> are lost.
+
+
+VARIOUS
+
+The command-line window cannot be used:
+- when there already is a command-line window (no nesting)
+- for entering a encryption key or when using inputsecret()
+- when Vim was not compiled with the +vertsplit feature
+
+Some options are set when the command-line window is opened:
+'filetype' "vim", when editing an Ex command-line; this starts Vim syntax
+ highlighting if it was enabled
+'rightleft' off
+'modifiable' on
+'buftype' "nofile"
+'swapfile' off
+
+It is allowed to write the buffer contents to a file. This is an easy way to
+save the command-line history and read it back later.
+
+If the 'wildchar' option is set to <Tab>, and the command-line window is used
+for an Ex command, then two mappings will be added to use <Tab> for completion
+in the command-line window, like this: >
+ :imap <buffer> <Tab> <C-X><C-V>
+ :nmap <buffer> <Tab> a<C-X><C-V>
+Note that hitting <Tab> in Normal mode will do completion on the next
+character. That way it works at the end of the line.
+If you don't want these mappings, disable them with: >
+ au CmdwinEnter [:>] iunmap <Tab>
+ au CmdwinEnter [:>] nunmap <Tab>
+You could put these lines in your vimrc file.
+
+While in the command-line window you cannot use the mouse to put the cursor in
+another window, or drag statuslines of other windows. You can drag the
+statusline of the command-line window itself and the statusline above it.
+Thus you can resize the command-line window, but not others.
+
+
+AUTOCOMMANDS
+
+Two autocommand events are used: |CmdwinEnter| and |CmdwinLeave|. Since this
+window is of a special type, the WinEnter, WinLeave, BufEnter and BufLeave
+events are not triggered. You can use the Cmdwin events to do settings
+specifically for the command-line window. Be careful not to cause side
+effects!
+Example: >
+ :au CmdwinEnter : let b:cpt_save = &cpt | set cpt=v
+ :au CmdwinLeave : let &cpt = b:cpt_save
+This sets 'complete' to use command-line completion in Insert mode for CTRL-N.
+Another example: >
+ :au CmdwinEnter [/?] startinsert
+This will make Vim start in Insert mode in the command-line window.
+
+ *cmdwin-char*
+The character used for the pattern indicates the type of command-line:
+ : normal Ex command
+ > debug mode command |debug-mode|
+ / forward search string
+ ? backward search string
+ = expression for "= |expr-register|
+ @ string for |input()|
+ - text for |:insert| or |:append|
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/debugger.txt b/runtime/doc/debugger.txt
new file mode 100644
index 000000000..4b1a188db
--- /dev/null
+++ b/runtime/doc/debugger.txt
@@ -0,0 +1,135 @@
+*debugger.txt* For Vim version 7.0aa. Last change: 2001 Dec 22
+
+
+ VIM REFERENCE MANUAL by Gordon Prieur
+
+
+Debugger Support Features *debugger-support*
+
+1. Debugger Features |debugger-features|
+2. Vim Compile Options |debugger-compilation|
+3. Integrated Debuggers |debugger-integration|
+
+{Vi does not have any of these features}
+
+==============================================================================
+1. Debugger Features *debugger-features*
+
+The following features are available for an integration with a debugger or
+an Integrated Programming Environment (IPE) or Integrated Development
+Environment (IDE):
+
+ Alternate Command Input |alt-input|
+ Debug Signs |debug-signs|
+ Debug Source Highlight |debug-highlight|
+ Message Footer |gui-footer|
+ Balloon Evaluation |balloon-eval|
+
+These features were added specifically for use in the Motif version of gvim.
+However, the |alt-input| and |debug-highlight| were written to be usable in
+both vim and gvim. Some of the other features could be used in the non-GUI
+vim with slight modifications. However, I did not do this nor did I test the
+reliability of building for vim or non Motif GUI versions.
+
+
+1.1 Alternate Command Input *alt-input*
+
+For Vim to work with a debugger there must be at least an input connection
+with a debugger or external tool. In many cases there will also be an output
+connection but this isn't absolutely necessary.
+
+The purpose of the input connection is to let the external debugger send
+commands to Vim. The commands sent by the debugger should give the debugger
+enough control to display the current debug environment and state.
+
+The current implementation is based on the X Toolkit dispatch loop and the
+XtAddInput() function call.
+
+
+1.2 Debug Signs *debug-signs*
+
+Many debuggers mark specific lines by placing a small sign or color highlight
+on the line. The |:sign| command lets the debugger set this graphic mark. Some
+examples where this feature would be used would be a debugger showing an arrow
+representing the Program Counter (PC) of the program being debugged. Another
+example would be a small stop sign for a line with a breakpoint. These visible
+highlights let the user keep track of certain parts of the state of the
+debugger.
+
+This feature can be used with more than debuggers, too. An IPE can use a sign
+to highlight build errors, searched text, or other things. The sign feature
+can also work together with the |debug-highlight| to ensure the mark is
+highly visible.
+
+Debug signs are defined and placed using the |:sign| command.
+
+
+1.3 Debug Source Highlight *debug-highlight*
+
+This feature allows a line to have a predominant highlight. The highlight is
+intended to make a specific line stand out. The highlight could be made to
+work for both vim and gvim, whereas the debug sign is, in most cases, limited
+to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm
+from Sun has a "sign gutter" for showing signs.
+
+
+1.4 Message Footer *gui-footer*
+
+The message footer can be used to display messages from a debugger or IPE. It
+can also be used to display menu and toolbar tips. The footer area is at the
+bottom of the GUI window, below the line used to display colon commands.
+
+The display of the footer is controlled by the 'guioptions' letter 'F'.
+
+
+1.5 Balloon Evaluation *balloon-eval*
+
+This feature allows a debugger, or other external tool, to display dynamic
+information based on where the mouse is pointing. The purpose of this feature
+was to allow Sun's Visual WorkShop debugger to display expression evaluations.
+However, the feature was implemented in as general a manner as possible and
+could be used for displaying other information as well.
+
+The Balloon Evaluation has some settable parameters too. The font list and
+colors can be set via X resources (XmNballoonEvalFontList,
+XmNballoonEvalBackground, and XmNballoonEvalForeground).
+The 'balloondelay' option sets the delay before an attempt is made to show a
+balloon.
+The 'ballooneval' option needs to be set to switch it on.
+
+Balloon evaluation is only available when compiled with the |+balloon_eval|
+and |+sun_workshop| features.
+
+The Balloon evaluation functions are also used to show a tooltip for the
+toolbar. The 'ballooneval' option does not need to be set for this. But the
+other settings apply.
+
+==============================================================================
+2. Vim Compile Options *debugger-compilation*
+
+The debugger features were added explicitly for use with Sun's Visual
+WorkShop Integrated Programming Environment (ipe). However, they were done
+in as generic a manner as possible so that integration with other debuggers
+could also use some or all of the tools used with Sun's ipe.
+
+The following compile time preprocessor variables control the features:
+
+ Alternate Command Input ALT_X_INPUT
+ Debug Glyphs FEAT_SIGNS
+ Debug Highlights FEAT_SIGNS
+ Message Footer FEAT_FOOTER
+ Balloon Evaluation FEAT_BEVAL
+
+The first integration with a full IPE/IDE was with Sun Visual WorkShop. To
+compile a gvim which interfaces with VWS set the following flag, which sets
+all the above flags:
+
+ Sun Visual WorkShop FEAT_SUN_WORKSHOP
+
+==============================================================================
+3. Integrated Debuggers *debugger-integration*
+
+Currently the only fully integrated debugger/IPE/IDE is Sun's Visual WorkShop
+Integrated Programming Environment.
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
new file mode 100644
index 000000000..6e4f4e35a
--- /dev/null
+++ b/runtime/doc/develop.txt
@@ -0,0 +1,384 @@
+*develop.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Development of Vim. *development*
+
+This text is important for those who want to be involved in further developing
+Vim.
+
+1. Design goals |design-goals|
+2. Coding style |coding-style|
+3. Design decisions |design-decisions|
+4. Assumptions |design-assumptions|
+
+See the file README.txt in the "src" directory for an overview of the source
+code.
+
+Vim is open source software. Everybody is encouraged to contribute to help
+improving Vim. For sending patches a context diff "diff -c" is preferred.
+Also see http://www.vim.org/tips/tip.php?tip_id=618.
+
+==============================================================================
+1. Design goals *design-goals*
+
+Most important things come first (roughly).
+
+Note that quite a few items are contradicting. This is intentional. A
+balance must be found between them.
+
+
+VIM IS... VI COMPATIBLE *design-compatible*
+
+First of all, it should be possible to use Vim as a drop-in replacement for
+Vi. When the user wants to, he can use Vim in compatible mode and hardly
+notice any difference with the original Vi.
+
+Exceptions:
+- We don't reproduce obvious Vi bugs in Vim.
+- There are different versions of Vi. I am using Version 3.7 (6/7/85) as a
+ reference. But support for other versions is also included when possible.
+ The Vi part of POSIX is not considered a definitive source.
+- Vim adds new commands, you cannot rely on some command to fail because it
+ didn't exist in Vi.
+- Vim will have a lot of features that Vi doesn't have. Going back from Vim
+ to Vi will be a problem, this cannot be avoided.
+- Some things are hardly ever used (open mode, sending an e-mail when
+ crashing, etc.). Those will only be included when someone has a good reason
+ why it should be included and it's not too much work.
+- For some items it is debatable whether Vi compatibility should be
+ maintained. There will be an option flag for these.
+
+
+VIM IS... IMPROVED *design-improved*
+
+The IMproved bits of Vim should make it a better Vi, without becoming a
+completely different editor. Extensions are done with a "Vi spirit".
+- Use the keyboard as much as feasible. The mouse requires a third hand,
+ which we don't have. Many terminals don't have a mouse.
+- When the mouse is used anyway, avoid the need to switch back to the
+ keyboard. Avoid mixing mouse and keyboard handling.
+- Add commands and options in a consistent way. Otherwise people will have a
+ hard time finding and remembering them. Keep in mind that more commands and
+ options will be added later.
+- A feature that people do not know about is a useless feature. Don't add
+ obscure features, or at least add hints in documentation that they exists.
+- Minimize using CTRL and other modifiers, they are more difficult to type.
+- There are many first-time and inexperienced Vim users. Make it easy for
+ them to start using Vim and learn more over time.
+- There is no limit to the features that can be added. Selecting new features
+ is one based on (1) what users ask for, (2) how much effort it takes to
+ implement and (3) someone actually implementing it.
+
+
+VIM IS... MULTI PLATFORM *design-multi-platform*
+
+Vim tries to help as many users on as many platforms as possible.
+- Support many kinds of terminals. The minimal demands are cursor positioning
+ and clear-screen. Commands should only use key strokes that most keyboards
+ have. Support all the keys on the keyboard for mapping.
+- Support many platforms. A condition is that there is someone willing to do
+ Vim development on that platform, and it doesn't mean messing up the code.
+- Support many compilers and libraries. Not everybody is able or allowed to
+ install another compiler or GUI library.
+- People switch from one platform to another, and from GUI to terminal
+ version. Features should be present in all versions, or at least in as many
+ as possible with a reasonable effort. Try to avoid that users must switch
+ between platforms to accomplish their work efficiently.
+- That a feature is not possible on some platforms, or only possible on one
+ platform, does not mean it cannot be implemented. [This intentionally
+ contradicts the previous item, these two must be balanced.]
+
+
+VIM IS... WELL DOCUMENTED *design-documented*
+
+- A feature that isn't documented is a useless feature. A patch for a new
+ feature must include the documentation.
+- Documentation should be comprehensive and understandable. Using examples is
+ recommended.
+- Don't make the text unnecessarily long. Less documentation means that an
+ item is easier to find.
+
+
+VIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
+
+Using Vim must not be a big attack on system resources. Keep it small and
+fast.
+- Computers are becoming faster and bigger each year. Vim can grow too, but
+ no faster than computers are growing. Keep Vim usable on older systems.
+- Many users start Vim from a shell very often. Startup time must be short.
+- Commands must work efficiently. The time they consume must be as small as
+ possible. Useful commands may take longer.
+- Don't forget that some people use Vim over a slow connection. Minimize the
+ communication overhead.
+- Items that add considerably to the size and are not used by many people
+ should be a feature that can be disabled.
+- Vim is a component among other components. Don't turn it into a massive
+ application, but have it work well together with other programs.
+
+
+VIM IS... MAINTAINABLE *design-maintain*
+
+- The source code should not become a mess. It should be reliable code.
+- Use the same layout in all files to make it easy to read |coding-style|.
+- Use comments in a useful way!
+- Porting to another platform should be made easy, without having to change
+ too much platform-independent code.
+- Use the object-oriented spirit: Put data and code together. Minimize the
+ knowledge spread to other parts of the code.
+
+
+VIM IS... FLEXIBLE *design-flexible*
+
+Vim should make it easy for users to work in their preferred styles rather
+than coercing its users into particular patterns of work. This can be for
+items with a large impact (e.g., the 'compatible' option) or for details. The
+defaults are carefully chosen such that most users will enjoy using Vim as it
+is. Commands and options can be used to adjust Vim to the desire of the user
+and its environment.
+
+
+VIM IS... NOT *design-not*
+
+- Vim is not a shell or an Operating System. You will not be able to run a
+ shell inside Vim or use it to control a debugger. This should work the
+ other way around: Use Vim as a component from a shell or in an IDE.
+ A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
+ everything but the kitchen sink, but some people say that you can clean one
+ with it. ;-)"
+- Vim is not a fancy GUI editor that tries to look nice at the cost of
+ being less consistent over all platforms. But functional GUI features are
+ welcomed.
+
+==============================================================================
+2. Coding style *coding-style*
+
+These are the rules to use when making changes to the Vim source code. Please
+stick to these rules, to keep the sources readable and maintainable.
+
+This list is not complete. Look in the source code for more examples.
+
+
+MAKING CHANGES *style-changes*
+
+The basic steps to make changes to the code:
+1. Adjust the documentation. Doing this first gives you an impression of how
+ your changes affect the user.
+2. Make the source code changes.
+3. Check ../doc/todo.txt if the change affects any listed item.
+4. Make a patch with "diff -c" against the unmodified code and docs.
+5. Make a note about what changed and include it with the patch.
+
+
+USE OF COMMON FUNCTIONS *style-functions*
+
+Some functions that are common to use, have a special Vim version. Always
+consider using the Vim version, because they were introduced with a reason.
+
+NORMAL NAME VIM NAME DIFFERENCE OF VIM VERSION
+free() vim_free() Checks for freeing NULL
+malloc() alloc() Checks for out of memory situation
+malloc() lalloc() Like alloc(), but has long argument
+strcpy() STRCPY() Includes cast to (char *), for char_u * args
+strchr() vim_strchr() Accepts special characters
+strrchr() vim_strrchr() Accepts special characters
+isspace() vim_isspace() Can handle characters > 128
+iswhite() vim_iswhite() Only TRUE for Tab and space
+memcpy() vim_memmove() Handles overlapped copies
+bcopy() vim_memmove() Handles overlapped copies
+memset() vim_memset() Uniform for all systems
+
+
+NAMES *style-names*
+
+Function names can not be more than 31 characters long (because of VMS).
+
+Don't use "delete" as a variable name, C++ doesn't like it.
+
+Because of the requirement that Vim runs on as many systems as possible, we
+need to avoid using names that are already defined by the system. This is a
+list of names that are known to cause trouble. The name is given as a regexp
+pattern.
+
+is.*() POSIX, ctype.h
+to.*() POSIX, ctype.h
+
+d_.* POSIX, dirent.h
+l_.* POSIX, fcntl.h
+gr_.* POSIX, grp.h
+pw_.* POSIX, pwd.h
+sa_.* POSIX, signal.h
+mem.* POSIX, string.h
+str.* POSIX, string.h
+wcs.* POSIX, string.h
+st_.* POSIX, stat.h
+tms_.* POSIX, times.h
+tm_.* POSIX, time.h
+c_.* POSIX, termios.h
+MAX.* POSIX, limits.h
+__.* POSIX, system
+_[A-Z].* POSIX, system
+E[A-Z0-9]* POSIX, errno.h
+
+*_t POSIX, for typedefs. Use *_T instead.
+
+wait don't use as argument to a function, conflicts with types.h
+index shadows global declaration
+time shadows global declaration
+new C++ reserved keyword
+try Borland C++ doesn't like it to be used as a variable.
+
+basename() GNU string function
+dirname() GNU string function
+get_env_value() Linux system function
+
+
+VARIOUS *style-various*
+
+Typedef'ed names should end in "_t": >
+ typedef int some_t;
+Define'ed names should be uppercase: >
+ #define SOME_THING
+Features always start with "FEAT_": >
+ #define FEAT_FOO
+
+Don't use '\"', some compilers can't handle it. '"' works fine.
+
+Don't use:
+ #if HAVE_SOME
+Some compilers can't handle that and complain that "HAVE_SOME" is not defined.
+Use
+ #ifdef HAVE_SOME
+or
+ #if defined(HAVE_SOME)
+
+
+STYLE *style-examples*
+
+General rule: One statement per line.
+
+Wrong: if (cond) a = 1;
+
+OK: if (cond)
+ a = 1;
+
+Wrong: while (cond);
+
+OK: while (cond)
+ ;
+
+Wrong: do a = 1; while (cond);
+
+OK: do
+ a = 1;
+ while (cond);
+
+
+Functions start with:
+
+Wrong: int function_name(int arg1, int arg2)
+
+OK: /*
+ * Explanation of what this function is used for.
+ *
+ * Return value explanation.
+ */
+ int
+ function_name(arg1, arg2)
+ int arg1; /* short comment about arg1 */
+ int arg2; /* short comment about arg2 */
+ {
+ int local; /* comment about local */
+
+ local = arg1 * arg2;
+
+NOTE: Don't use ANSI style function declarations. A few people still have to
+use a compiler that doesn't support it.
+
+
+SPACES AND PUNCTUATION *style-spaces*
+
+No space between a function name and the bracket:
+
+Wrong: func (arg);
+OK: func(arg);
+
+Do use a space after if, while, switch, etc.
+
+Wrong: if(arg) for(;;)
+OK: if (arg) for (;;)
+
+Use a space after a comma and semicolon:
+
+Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
+OK: func(arg1, arg2); for (i = 0; i < 2; ++i)
+
+Use a space before and after '=', '+', '/', etc.
+
+Wrong: var=a*5;
+OK: var = a * 5;
+
+In general: Use empty lines to group lines of code together. Put a comment
+just above the group of lines. This makes it more easy to quickly see what is
+being done.
+
+OK: /* Prepare for building the table. */
+ get_first_item();
+ table_idx = 0;
+
+ /* Build the table */
+ while (has_item())
+ table[table_idx++] = next_item();
+
+ /* Finish up. */
+ cleanup_items();
+ generate_hash(table);
+
+==============================================================================
+3. Design decisions *design-decisions*
+
+Folding
+
+Several forms of folding should be possible for the same buffer. For example,
+have one window that shows the text with function bodies folded, another
+window that shows a function body.
+
+Folding is a way to display the text. It should not change the text itself.
+Therefore the folding has been implemented as a filter between the text stored
+in a buffer (buffer lines) and the text displayed in a window (logical lines).
+
+
+Naming the window
+
+The word "window" is commonly used for several things: A window on the screen,
+the xterm window, a window inside Vim to view a buffer.
+To avoid confusion, other items that are sometimes called window have been
+given another name. Here is an overview of the related items:
+
+screen The whole display. For the GUI it's something like 1024x768
+ pixels. The Vim shell can use the whole screen or part of it.
+shell The Vim application. This can cover the whole screen (e.g.,
+ when running in a console) or part of it (xterm or GUI).
+window View on a buffer. There can be several windows in Vim,
+ together with the command line, menubar, toolbar, etc. they
+ fit in the shell.
+
+
+To be continued...
+
+==============================================================================
+4. Assumptions *design-assumptions*
+
+Size of variables:
+char 8 bit signed
+char_u 8 bit unsigned
+int 16, 32 or 64 bit signed
+unsigned 16, 32 or 64 bit unsigned
+long 32 or 64 bit signed, can hold a pointer
+
+Note that some compilers cannot handle long lines or strings. The C89
+standard specifies a limit of 509 characters.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
new file mode 100644
index 000000000..102072349
--- /dev/null
+++ b/runtime/doc/diff.txt
@@ -0,0 +1,371 @@
+*diff.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *diff* *vimdiff* *gvimdiff* *diff-mode*
+This file describes the +diff feature: Showing differences between two or
+three versions of the same file.
+
+The basics are explained in section |08.7| of the user manual.
+
+1. Starting diff mode |vimdiff|
+2. Viewing diffs |view-diffs|
+3. Jumping to diffs |jumpto-diffs|
+4. Copying diffs |copy-diffs|
+5. Diff options |diff-options|
+
+{not in Vi}
+
+==============================================================================
+1. Starting diff mode
+
+The easiest way to start editing in diff mode is with the "vimdiff" command.
+This starts Vim as usual, and additionally sets up for viewing the differences
+between the arguments. >
+
+ vimdiff file1 file2 [file3 [file4]]
+
+This is equivalent to: >
+
+ vim -d file1 file2 [file3 [file4]]
+
+You may also use "gvimdiff" or "vim -d -g". The GUI is started then.
+You may also use "viewdiff" or "gviewdiff". Vim starts in readonly mode then.
+"r" may be prepended for restricted mode (see |-Z|).
+
+The second and following arguments may also be a directory name. Vim will
+then append the file name of the first argument to the directory name to find
+the file.
+
+This only works when a standard "diff" command is available. See 'diffexpr'.
+
+What happens is that Vim opens a window for each of the files. This is like
+using the |-O| argument. This uses vertical splits. If you prefer horizontal
+splits add the |-o| argument: >
+
+ vimdiff -o file1 file2 [file3]
+
+In each of the edited files these options are set:
+
+ 'diff' on
+ 'scrollbind' on
+ 'scrollopt' includes "hor"
+ 'wrap' off
+ 'foldmethod' "diff"
+ 'foldcolumn' 2
+
+These options are set local to the window. When editing another file they are
+reset to the global value.
+
+The differences shown are actually the differences in the buffer. Thus if you
+make changes after loading a file, these will be included in the displayed
+diffs. You might have to do ":diffupdate" now and then, not all changes are
+immediately taken into account.
+
+In your .vimrc file you could do something special when Vim was started in
+diff mode. You could use a construct like this: >
+
+ if &diff
+ setup for diff mode
+ else
+ setup for non-diff mode
+ endif
+
+While already in Vim you can start diff mode in three ways.
+
+ *E98*
+:diffsplit {filename} *:diffs* *:diffsplit*
+ Open a new window on the file {filename}. The options are set
+ as for "vimdiff" for the current and the newly opened window.
+ Also see 'diffexpr'.
+
+ *:difft* *:diffthis*
+:diffthis Make the current window part of the diff windows. This sets
+ the option like for "vimdiff".
+
+:diffpatch {patchfile} *:diffp* *:diffpatch*
+ Use the current buffer, patch it with the diff found in
+ {patchfile} and open a buffer on the result. The options are
+ set as for "vimdiff".
+ {patchfile} can be in any format that the "patch" program
+ understands or 'patchexpr' can handle.
+ Note that {patchfile} should only contain a diff for one file,
+ the current file. If {patchfile} contains diffs for other
+ files as well, the results are unpredictable. Vim changes
+ directory to /tmp to avoid files in the current directory
+ accidentally being patched. But it may still result in
+ various ".rej" files to be created. And when absolute path
+ names are present these files may get patched anyway.
+
+To make these commands use a vertical split, prepend |:vertical|. Examples: >
+
+ :vert diffsplit main.c~
+ :vert diffpatch /tmp/diff
+<
+ *E96*
+There can be up to four buffers with 'diff' set.
+
+Since the option values are remembered with the buffer, you can edit another
+file for a moment and come back to the same file and be in diff mode again.
+If you don't want diff mode, reset the 'diff' option. And you probably want
+to get rid of the fold column: >
+
+ :set nodiff foldcolumn=0
+
+==============================================================================
+2. Viewing diffs *view-diffs*
+
+The effect is that the diff windows show the same text, with the differences
+highlighted. When scrolling the text, the 'scrollbind' option will make the
+text in other windows to be scrolled as well. With vertical splits the text
+should be aligned properly.
+
+The alignment of text will go wrong when:
+- 'wrap' is on, some lines will be wrapped and occupy two or more screen
+ lines
+- folds are open in one window but not another
+- 'scrollbind' is off
+- changes have been made to the text
+- "filler" is not present in 'diffopt', deleted/inserted lines makes the
+ alignment go wrong
+
+All the buffers edited in a window where the 'diff' option is set will join in
+the diff. This is also possible for hidden buffers. They must have been
+edited in a window first for this to be possible.
+
+Since 'diff' is a window-local option, it's possible to view the same buffer
+in diff mode in one window and "normal" in another window. It is also
+possible to view the changes you have made to a buffer, but since Vim doesn't
+allow having two buffers for the same file, you need to make a copy of the
+original file and diff with that. For example: >
+ :!cp % tempfile
+ :diffsplit tempfile
+
+A buffer that is unloaded cannot be used for the diff. But it does work for
+hidden buffers. You can use ":hide" to close a window without unloading the
+buffer.
+
+
+ *:diffu* *:diffupdate*
+Vim attempts to keep the differences updated when you make changes to the
+text. This mostly takes care of inserted and deleted lines. Changes within a
+line and more complicated changes do not cause the differences to be updated.
+To force the differences to be updated use: >
+
+ :diffupdate
+
+
+Vim will show filler lines for lines that are missing in one window but are
+present in another. These lines were inserted in another file or deleted in
+this file. Removing "filler" from the 'diffopt' option will make Vim not
+display these filler lines.
+
+
+Folds are used to hide the text that wasn't changed. See |folding| for all
+the commands that can be used with folds.
+
+The context of lines above a difference that are not included in the fold can
+be set with the 'diffopt' option. For example, to set the context to three
+lines: >
+
+ :set diffopt=filler,context:3
+
+
+The diffs are highlighted with these groups:
+
+|hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in
+ this buffer but not in another.
+|hl-DiffChange| DiffChange Changed lines.
+|hl-DiffText| DiffText Changed text inside a Changed line. Vim
+ finds the first character that is different,
+ and the last character that is different
+ (searching from the end of the line). The
+ text in between is highlighted. This means
+ that parts in the middle that are still the
+ same are highlighted anyway.
+|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
+ because they don't really exist in this
+ buffer.
+
+==============================================================================
+3. Jumping to diffs *jumpto-diffs*
+
+Two commands can be used to jump to diffs:
+ *[c*
+ [c Jump backwards to the previous start of a change.
+ When a count is used, do it that many times.
+ *]c*
+ ]c Jump forwards to the next start of a change.
+ When a count is used, do it that many times.
+
+It is an error if there is no change for the cursor to move to.
+
+==============================================================================
+4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103*
+
+There are two commands to copy text from one buffer to another. The result is
+that the buffers will be equal within the specified range.
+
+ *:diffg* *:diffget*
+:[range]diffg[et] [bufspec]
+ Modify the current buffer to undo difference with another
+ buffer. If [bufspec] is given, that buffer is used.
+ Otherwise this only works if there is one other buffer in diff
+ mode.
+ See below for [range].
+
+ *:diffpu* *:diffput*
+:[range]diffpu[t] [bufspec]
+ Modify another buffer to undo difference with the current
+ buffer. Just like ":diffget" but the other buffer is modified
+ instead of the current one.
+ See below for [range].
+
+ *do*
+do Same as ":diffget" without argument or range. The "o" stands
+ for "obtain" ("dg" can't be used, it could be the start of
+ "dgg"!).
+
+ *dp*
+dp Same as ":diffput" without argument or range.
+
+When no [range] is given, the diff at the cursor position or just above it is
+affected. When [range] is used, Vim tries to only put or get the specified
+lines. When there are deleted lines, this may not always be possible.
+
+There can be deleted lines below the last line of the buffer. When the cursor
+is on the last line in the buffer and there is no diff above this line, the
+":diffget" and "do" commands will obtain lines from the other buffer.
+
+To be able to get those lines from another buffer in a [range] it's allowed to
+use the last line number plus one. This command gets all diffs from the other
+buffer: >
+
+ :1,$+1diffget
+
+Note that deleted lines are displayed, but not counted as text lines. You
+can't move the cursor into them. To fill the deleted lines with the lines
+from another buffer use ":diffget" on the line below them.
+
+The [bufspec] argument above can be a buffer number, a pattern for a buffer
+name or a part of a buffer name. Examples:
+
+ :diffget Use the other buffer which is in diff mode
+ :diffget 3 Use buffer 3
+ :diffget v2 Use the buffer which matches "v2" and is in
+ diff mode (e.g., "file.c.v2")
+
+==============================================================================
+5. Diff options *diff-options*
+
+Also see |'diffopt'| and the "diff" item of |'fillchars'|.
+
+
+FINDING THE DIFFERENCES *diff-diffexpr*
+
+The 'diffexpr' option can be set to use something else than the standard
+"diff" program to compare two files and find the differences.
+
+When 'diffexpr' is empty, Vim uses this command to find the differences
+between file1 and file2: >
+
+ diff file1 file2 > outfile
+
+The ">" is replaced with the value of 'shellredir'.
+
+The output of "diff" must be a normal "ed" style diff. Do NOT use a context
+diff. This example explains the format that Vim expects: >
+
+ 1a2
+ > bbb
+ 4d4
+ < 111
+ 7c7
+ < GGG
+ ---
+ > ggg
+
+The "1a2" item appends the line "bbb".
+The "4d4" item deletes the line "111".
+The '7c7" item replaces the line "GGG" with "ggg".
+
+When 'diffexpr' is not empty, Vim evaluates to obtain a diff file in the
+format mentioned. These variables are set to the file names used:
+
+ v:fname_in original file
+ v:fname_new new version of the same file
+ v:fname_out resulting diff file
+
+Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the
+'diffopt' option. 'diffexpr' cannot change the value of 'lines' and
+'columns'.
+
+Example (this does almost the same as 'diffexpr' being empty): >
+
+ set diffexpr=MyDiff()
+ function MyDiff()
+ let opt = ""
+ if &diffopt =~ "icase"
+ let opt = opt . "-i "
+ endif
+ if &diffopt =~ "iwhite"
+ let opt = opt . "-b "
+ endif
+ silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
+ \ " > " . v:fname_out
+ endfunction
+
+The "-a" argument is used to force comparing the files as text, comparing as
+binaries isn't useful. The "--binary" argument makes the files read in binary
+mode, so that a CTRL-Z doesn't end the text on DOS.
+
+ *E97*
+Vim will do a test if the diff output looks alright. If it doesn't, you will
+get an error message. Possible causes:
+- The "diff" program cannot be executed.
+- The "diff" program doesn't produce normal "ed" style diffs (see above).
+- The 'shell' and associated options are not set correctly. Try if filtering
+ works with a command like ":!sort".
+- You are using 'diffexpr' and it doesn't work.
+If it's not clear what the problem is set the 'verbose' option to see more
+messages.
+
+
+USING PATCHES *diff-patchexpr*
+
+The 'patchexpr' option can be set to use something else than the standard
+"patch" program.
+
+When 'patchexpr' is empty, Vim will call the "patch" program like this: >
+
+ patch -o outfile origfile < patchfile
+
+This should work fine with most versions of the "patch" program. Note that a
+CR in the middle of a line may cause problems, it is seen as a line break.
+
+If the default doesn't work for you, set the 'patchexpr' to an expression that
+will have the same effect. These variables are set to the file names used:
+
+ v:fname_in original file
+ v:fname_diff patch file
+ v:fname_out resulting patched file
+
+Example (this does the same as 'patchexpr' being empty): >
+
+ let patchexpr=MyPatch
+ function MyPatch
+ :call system("patch -o " . v:fname_out . " " . v:fname_in .
+ \ " < " . v:fname_diff)
+ endfunction
+
+Make sure that using the "patch" program doesn't have unwanted side effects.
+For example, watch out for additionally generated files, which should be
+deleted. It should just patch the file and nothing else.
+ Vim will change directory to "/tmp" or another temp directory before
+evaluating 'patchexpr'. This hopefully avoids that files in the current
+directory are accidentally patched. Vim will also delete files starting with
+v:fname_in and ending in ".rej" and ".orig".
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
new file mode 100644
index 000000000..529b30d2d
--- /dev/null
+++ b/runtime/doc/digraph.txt
@@ -0,0 +1,322 @@
+*digraph.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Digraphs *digraphs* *Digraphs*
+
+Digraphs are used to enter characters that normally cannot be entered by
+an ordinary keyboard. These are mostly accented characters which have the
+eighth bit set. The digraphs are easier to remember than the decimal number
+that can be entered with CTRL-V (see |i_CTRL-V|).
+
+There is a brief introduction on digraphs in the user manual: |24.9|
+An alternative is using the 'keymap' option.
+
+1. Defining digraphs |digraphs-define|
+2. Using digraphs |digraphs-use|
+3. Default digraphs |digraphs-default|
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Defining digraphs *digraphs-define*
+
+ *:dig* *:digraphs*
+:dig[raphs] show currently defined digraphs.
+ *E104* *E39*
+:dig[raphs] {char1}{char2} {number} ...
+ Add digraph {char1}{char2} to the list. {number} is
+ the decimal representation of the character.
+ Example: >
+ :digr e: 235 a: 228
+< Avoid defining a digraph with '_' (underscore) as the
+ first character, it has a special meaning in the
+ future.
+
+Vim is normally compiled with the |+digraphs| feature. If the feature is
+disabled, the ":digraph" command will display an error message.
+
+Example of the output of ":digraphs": >
+ TH Þ 222 ss ß 223 a! à 224 a' á 225 a> â 226 a? ã 227 a: ä 228
+
+The first two characters in each column are the characters you have to type to
+enter the digraph.
+
+In the middle of each column is the resulting character. This may be mangled
+if you look at it on a system that does not support digraphs or if you print
+this file.
+
+The decimal number is the number of the character.
+
+==============================================================================
+2. Using digraphs *digraphs-use*
+
+There are two methods to enter digraphs: *i_digraph*
+ CTRL-K {char1} {char2} or
+ {char1} <BS> {char2}
+The first is always available; the second only when the 'digraph' option is
+set.
+
+If a digraph with {char1}{char2} does not exist, Vim searches for a digraph
+{char2}{char1}. This helps when you don't remember which character comes
+first.
+
+Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim
+enters the code for that special key. This is not a digraph.
+
+Once you have entered the digraph, Vim treats the character like a normal
+character that occupies only one character in the file and on the screen.
+Example: >
+ 'B' <BS> 'B' will enter the broken '|' character (166)
+ 'a' <BS> '>' will enter an 'a' with a circumflex (226)
+ CTRL-K '-' '-' will enter a soft hyphen (173)
+
+The current digraphs are listed with the ":digraphs" command. Some of the
+default ones are listed below |digraph-table|.
+
+For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will enter
+{char} with the highest bit set. You can use this to enter meta-characters.
+
+The <Esc> character cannot be part of a digraph. When hitting <Esc>, Vim
+stops digraph entry and ends Insert mode or Command-line mode, just like
+hitting an <Esc> out of digraph context. Use CTRL-V 155 to enter meta-ESC
+(CSI).
+
+If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
+'e'. But that is a digraph, so you will not get what you want. To correct
+this, you will have to type <BS> e again. To avoid this don't set the
+'digraph' option and use CTRL-K to enter digraphs.
+
+You may have problems using Vim with characters which have an ASCII value
+above 128. For example: You insert ue (u-umlaut) and the editor echoes \334
+in Insert mode. After leaving the Insert mode everything is fine. Note that
+fmt removes all characters with ASCII codes above 128 from the text being
+formatted. On some Unix systems this means you have to define the
+environment-variable LC_CTYPE. If you are using csh, then put the following
+line in your .cshrc: >
+ setenv LC_CTYPE iso_8859_1
+
+==============================================================================
+3. Default digraphs *digraphs-default*
+
+Vim comes with a set of default digraphs. Check the output of ":digraphs" to
+see them.
+
+On most systems Vim uses the same digraphs. They work for the Unicode and
+ISO-8859-1 character sets. These default digraphs are taken from the RFC1345
+mnemonics. To make it easy to remember the mnemonic, the second character has
+a standard meaning:
+
+ char name char meaning ~
+ Exclamation mark ! Grave
+ Apostrophe ' Acute accent
+ Greater-Than sign > Circumflex accent
+ Question Mark ? tilde
+ Hyphen-Minus - Macron
+ Left parenthesis ( Breve
+ Full Stop . Dot Above
+ Colon : Diaeresis
+ Comma , Cedilla
+ Underline _ Underline
+ Solidus / Stroke
+ Quotation mark " Double acute accent
+ Semicolon ; Ogonek
+ Less-Than sign < Caron
+ Zero 0 Ring above
+ Two 2 Hook
+ Nine 9 Horn
+
+ Equals = Cyrillic
+ Asterisk * Greek
+ Percent sign % Greek/Cyrillic special
+ Plus + smalls: Arabic, capitals: Hebrew
+ Three 3 some Latin/Greek/Cyrillic letters
+ Four 4 Bopomofo
+ Five 5 Hiragana
+ Six 6 Katakana
+
+Example: a: is ä and o: is ö
+
+These are the RFC1345 digraphs for the one-byte characters. See the output of
+":digraphs" for the others. The characters above 255 are only available when
+Vim was compiled with the |+multi_byte| feature.
+ *digraph-table*
+char digraph hex dec official name ~
+^@ NU 0x00 0 NULL (NUL)
+^A SH 0x01 1 START OF HEADING (SOH)
+^B SX 0x02 2 START OF TEXT (STX)
+^C EX 0x03 3 END OF TEXT (ETX)
+^D ET 0x04 4 END OF TRANSMISSION (EOT)
+^E EQ 0x05 5 ENQUIRY (ENQ)
+^F AK 0x06 6 ACKNOWLEDGE (ACK)
+^G BL 0x07 7 BELL (BEL)
+^H BS 0x08 8 BACKSPACE (BS)
+^I HT 0x09 9 CHARACTER TABULATION (HT)
+^@ LF 0x0a 10 LINE FEED (LF)
+^K VT 0x0b 11 LINE TABULATION (VT)
+^L FF 0x0c 12 FORM FEED (FF)
+^M CR 0x0d 13 CARRIAGE RETURN (CR)
+^N SO 0x0e 14 SHIFT OUT (SO)
+^O SI 0x0f 15 SHIFT IN (SI)
+^P DL 0x10 16 DATALINK ESCAPE (DLE)
+^Q D1 0x11 17 DEVICE CONTROL ONE (DC1)
+^R D2 0x12 18 DEVICE CONTROL TWO (DC2)
+^S D3 0x13 19 DEVICE CONTROL THREE (DC3)
+^T D4 0x14 20 DEVICE CONTROL FOUR (DC4)
+^U NK 0x15 21 NEGATIVE ACKNOWLEDGE (NAK)
+^V SY 0x16 22 SYNCRONOUS IDLE (SYN)
+^W EB 0x17 23 END OF TRANSMISSION BLOCK (ETB)
+^X CN 0x18 24 CANCEL (CAN)
+^Y EM 0x19 25 END OF MEDIUM (EM)
+^Z SB 0x1a 26 SUBSTITUTE (SUB)
+^[ EC 0x1b 27 ESCAPE (ESC)
+^\ FS 0x1c 28 FILE SEPARATOR (IS4)
+^] GS 0x1d 29 GROUP SEPARATOR (IS3)
+^^ RS 0x1e 30 RECORD SEPARATOR (IS2)
+^_ US 0x1f 31 UNIT SEPARATOR (IS1)
+ SP 0x20 32 SPACE
+# Nb 0x23 35 NUMBER SIGN
+$ DO 0x24 36 DOLLAR SIGN
+@ At 0x40 64 COMMERCIAL AT
+[ <( 0x5b 91 LEFT SQUARE BRACKET
+\ // 0x5c 92 REVERSE SOLIDUS
+] )> 0x5d 93 RIGHT SQUARE BRACKET
+^ '> 0x5e 94 CIRCUMFLEX ACCENT
+` '! 0x60 96 GRAVE ACCENT
+{ (! 0x7b 123 LEFT CURLY BRACKET
+| !! 0x7c 124 VERTICAL LINE
+} !) 0x7d 125 RIGHT CURLY BRACKET
+~ '? 0x7e 126 TILDE
+^? DT 0x7f 127 DELETE (DEL)
+~@ PA 0x80 128 PADDING CHARACTER (PAD)
+~A HO 0x81 129 HIGH OCTET PRESET (HOP)
+~B BH 0x82 130 BREAK PERMITTED HERE (BPH)
+~C NH 0x83 131 NO BREAK HERE (NBH)
+~D IN 0x84 132 INDEX (IND)
+~E NL 0x85 133 NEXT LINE (NEL)
+~F SA 0x86 134 START OF SELECTED AREA (SSA)
+~G ES 0x87 135 END OF SELECTED AREA (ESA)
+~H HS 0x88 136 CHARACTER TABULATION SET (HTS)
+~I HJ 0x89 137 CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
+~J VS 0x8a 138 LINE TABULATION SET (VTS)
+~K PD 0x8b 139 PARTIAL LINE FORWARD (PLD)
+~L PU 0x8c 140 PARTIAL LINE BACKWARD (PLU)
+~M RI 0x8d 141 REVERSE LINE FEED (RI)
+~N S2 0x8e 142 SINGLE-SHIFT TWO (SS2)
+~O S3 0x8f 143 SINGLE-SHIFT THREE (SS3)
+~P DC 0x90 144 DEVICE CONTROL STRING (DCS)
+~Q P1 0x91 145 PRIVATE USE ONE (PU1)
+~R P2 0x92 146 PRIVATE USE TWO (PU2)
+~S TS 0x93 147 SET TRANSMIT STATE (STS)
+~T CC 0x94 148 CANCEL CHARACTER (CCH)
+~U MW 0x95 149 MESSAGE WAITING (MW)
+~V SG 0x96 150 START OF GUARDED AREA (SPA)
+~W EG 0x97 151 END OF GUARDED AREA (EPA)
+~X SS 0x98 152 START OF STRING (SOS)
+~Y GC 0x99 153 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
+~Z SC 0x9a 154 SINGLE CHARACTER INTRODUCER (SCI)
+~[ CI 0x9b 155 CONTROL SEQUENCE INTRODUCER (CSI)
+~\ ST 0x9c 156 STRING TERMINATOR (ST)
+~] OC 0x9d 157 OPERATING SYSTEM COMMAND (OSC)
+~^ PM 0x9e 158 PRIVACY MESSAGE (PM)
+~_ AC 0x9f 159 APPLICATION PROGRAM COMMAND (APC)
+| NS 0xa0 160 NO-BREAK SPACE
+¡ !I 0xa1 161 INVERTED EXCLAMATION MARK
+¢ Ct 0xa2 162 CENT SIGN
+£ Pd 0xa3 163 POUND SIGN
+¤ Cu 0xa4 164 CURRENCY SIGN
+¥ Ye 0xa5 165 YEN SIGN
+¦ BB 0xa6 166 BROKEN BAR
+§ SE 0xa7 167 SECTION SIGN
+¨ ': 0xa8 168 DIAERESIS
+© Co 0xa9 169 COPYRIGHT SIGN
+ª -a 0xaa 170 FEMININE ORDINAL INDICATOR
+« << 0xab 171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+¬ NO 0xac 172 NOT SIGN
+­ -- 0xad 173 SOFT HYPHEN
+® Rg 0xae 174 REGISTERED SIGN
+¯ 'm 0xaf 175 MACRON
+° DG 0xb0 176 DEGREE SIGN
+± +- 0xb1 177 PLUS-MINUS SIGN
+² 2S 0xb2 178 SUPERSCRIPT TWO
+³ 3S 0xb3 179 SUPERSCRIPT THREE
+´ '' 0xb4 180 ACUTE ACCENT
+µ My 0xb5 181 MICRO SIGN
+¶ PI 0xb6 182 PILCROW SIGN
+· .M 0xb7 183 MIDDLE DOT
+¸ ', 0xb8 184 CEDILLA
+¹ 1S 0xb9 185 SUPERSCRIPT ONE
+º -o 0xba 186 MASCULINE ORDINAL INDICATOR
+» >> 0xbb 187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+¼ 14 0xbc 188 VULGAR FRACTION ONE QUARTER
+½ 12 0xbd 189 VULGAR FRACTION ONE HALF
+¾ 34 0xbe 190 VULGAR FRACTION THREE QUARTERS
+¿ ?I 0xbf 191 INVERTED QUESTION MARK
+À A! 0xc0 192 LATIN CAPITAL LETTER A WITH GRAVE
+Á A' 0xc1 193 LATIN CAPITAL LETTER A WITH ACUTE
+Â A> 0xc2 194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+Ã A? 0xc3 195 LATIN CAPITAL LETTER A WITH TILDE
+Ä A: 0xc4 196 LATIN CAPITAL LETTER A WITH DIAERESIS
+Å AA 0xc5 197 LATIN CAPITAL LETTER A WITH RING ABOVE
+Æ AE 0xc6 198 LATIN CAPITAL LETTER AE
+Ç C, 0xc7 199 LATIN CAPITAL LETTER C WITH CEDILLA
+È E! 0xc8 200 LATIN CAPITAL LETTER E WITH GRAVE
+É E' 0xc9 201 LATIN CAPITAL LETTER E WITH ACUTE
+Ê E> 0xca 202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+Ë E: 0xcb 203 LATIN CAPITAL LETTER E WITH DIAERESIS
+Ì I! 0xcc 204 LATIN CAPITAL LETTER I WITH GRAVE
+Í I' 0xcd 205 LATIN CAPITAL LETTER I WITH ACUTE
+Î I> 0xce 206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+Ï I: 0xcf 207 LATIN CAPITAL LETTER I WITH DIAERESIS
+Ð D- 0xd0 208 LATIN CAPITAL LETTER ETH (Icelandic)
+Ñ N? 0xd1 209 LATIN CAPITAL LETTER N WITH TILDE
+Ò O! 0xd2 210 LATIN CAPITAL LETTER O WITH GRAVE
+Ó O' 0xd3 211 LATIN CAPITAL LETTER O WITH ACUTE
+Ô O> 0xd4 212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+Õ O? 0xd5 213 LATIN CAPITAL LETTER O WITH TILDE
+Ö O: 0xd6 214 LATIN CAPITAL LETTER O WITH DIAERESIS
+× *X 0xd7 215 MULTIPLICATION SIGN
+Ø O/ 0xd8 216 LATIN CAPITAL LETTER O WITH STROKE
+Ù U! 0xd9 217 LATIN CAPITAL LETTER U WITH GRAVE
+Ú U' 0xda 218 LATIN CAPITAL LETTER U WITH ACUTE
+Û U> 0xdb 219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+Ü U: 0xdc 220 LATIN CAPITAL LETTER U WITH DIAERESIS
+Ý Y' 0xdd 221 LATIN CAPITAL LETTER Y WITH ACUTE
+Þ TH 0xde 222 LATIN CAPITAL LETTER THORN (Icelandic)
+ß ss 0xdf 223 LATIN SMALL LETTER SHARP S (German)
+à a! 0xe0 224 LATIN SMALL LETTER A WITH GRAVE
+á a' 0xe1 225 LATIN SMALL LETTER A WITH ACUTE
+â a> 0xe2 226 LATIN SMALL LETTER A WITH CIRCUMFLEX
+ã a? 0xe3 227 LATIN SMALL LETTER A WITH TILDE
+ä a: 0xe4 228 LATIN SMALL LETTER A WITH DIAERESIS
+å aa 0xe5 229 LATIN SMALL LETTER A WITH RING ABOVE
+æ ae 0xe6 230 LATIN SMALL LETTER AE
+ç c, 0xe7 231 LATIN SMALL LETTER C WITH CEDILLA
+è e! 0xe8 232 LATIN SMALL LETTER E WITH GRAVE
+é e' 0xe9 233 LATIN SMALL LETTER E WITH ACUTE
+ê e> 0xea 234 LATIN SMALL LETTER E WITH CIRCUMFLEX
+ë e: 0xeb 235 LATIN SMALL LETTER E WITH DIAERESIS
+ì i! 0xec 236 LATIN SMALL LETTER I WITH GRAVE
+í i' 0xed 237 LATIN SMALL LETTER I WITH ACUTE
+î i> 0xee 238 LATIN SMALL LETTER I WITH CIRCUMFLEX
+ï i: 0xef 239 LATIN SMALL LETTER I WITH DIAERESIS
+ð d- 0xf0 240 LATIN SMALL LETTER ETH (Icelandic)
+ñ n? 0xf1 241 LATIN SMALL LETTER N WITH TILDE
+ò o! 0xf2 242 LATIN SMALL LETTER O WITH GRAVE
+ó o' 0xf3 243 LATIN SMALL LETTER O WITH ACUTE
+ô o> 0xf4 244 LATIN SMALL LETTER O WITH CIRCUMFLEX
+õ o? 0xf5 245 LATIN SMALL LETTER O WITH TILDE
+ö o: 0xf6 246 LATIN SMALL LETTER O WITH DIAERESIS
+÷ -: 0xf7 247 DIVISION SIGN
+ø o/ 0xf8 248 LATIN SMALL LETTER O WITH STROKE
+ù u! 0xf9 249 LATIN SMALL LETTER U WITH GRAVE
+ú u' 0xfa 250 LATIN SMALL LETTER U WITH ACUTE
+û u> 0xfb 251 LATIN SMALL LETTER U WITH CIRCUMFLEX
+ü u: 0xfc 252 LATIN SMALL LETTER U WITH DIAERESIS
+ý y' 0xfd 253 LATIN SMALL LETTER Y WITH ACUTE
+þ th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic)
+ÿ y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/doctags.c b/runtime/doc/doctags.c
new file mode 100644
index 000000000..9213dd9c1
--- /dev/null
+++ b/runtime/doc/doctags.c
@@ -0,0 +1,83 @@
+/* vim:set ts=4 sw=4:
+ * this program makes a tags file for vim_ref.txt
+ *
+ * Usage: doctags vim_ref.txt vim_win.txt ... >tags
+ *
+ * A tag in this context is an identifier between stars, e.g. *c_files*
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#define LINELEN 200
+
+ int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ char line[LINELEN];
+ char *p1, *p2;
+ char *p;
+ FILE *fd;
+
+ if (argc <= 1)
+ {
+ fprintf(stderr, "Usage: doctags docfile ... >tags\n");
+ exit(1);
+ }
+ printf("help-tags\ttags\t1\n");
+ while (--argc > 0)
+ {
+ ++argv;
+ fd = fopen(argv[0], "r");
+ if (fd == NULL)
+ {
+ fprintf(stderr, "Unable to open %s for reading\n", argv[0]);
+ continue;
+ }
+ while (fgets(line, LINELEN, fd) != NULL)
+ {
+ p1 = strchr(line, '*'); /* find first '*' */
+ while (p1 != NULL)
+ {
+ p2 = strchr(p1 + 1, '*'); /* find second '*' */
+ if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
+ {
+ for (p = p1 + 1; p < p2; ++p)
+ if (*p == ' ' || *p == '\t' || *p == '|')
+ break;
+ /*
+ * Only accept a *tag* when it consists of valid
+ * characters, there is white space before it and is
+ * followed by a white character or end-of-line.
+ */
+ if (p == p2
+ && (p1 == line || p1[-1] == ' ' || p1[-1] == '\t')
+ && (strchr(" \t\n\r", p[1]) != NULL
+ || p[1] == '\0'))
+ {
+ *p2 = '\0';
+ ++p1;
+ printf("%s\t%s\t/*", p1, argv[0]);
+ while (*p1)
+ {
+ /* insert backslash before '\\' and '/' */
+ if (*p1 == '\\' || *p1 == '/')
+ putchar('\\');
+ putchar(*p1);
+ ++p1;
+ }
+ printf("*\n");
+ p2 = strchr(p2 + 1, '*'); /* find next '*' */
+ }
+ }
+ p1 = p2;
+ }
+ }
+ fclose(fd);
+ }
+ return 0;
+}
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
new file mode 100644
index 000000000..e25c34a6f
--- /dev/null
+++ b/runtime/doc/editing.txt
@@ -0,0 +1,1432 @@
+*editing.txt* For Vim version 7.0aa. Last change: 2004 Apr 28
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Editing files *edit-files*
+
+1. Introduction |edit-intro|
+2. Editing a file |edit-a-file|
+3. Dialogs |edit-dialogs|
+4. The current directory |current-directory|
+5. The argument list |argument-list|
+6. Writing |writing|
+7. Writing and quitting |write-quit|
+8. Editing binary files |edit-binary|
+9. Encryption |encryption|
+10. Timestamps |timestamps|
+
+==============================================================================
+1. Introduction *edit-intro*
+
+Editing a file with Vim means:
+
+1. reading the file into the internal buffer
+2. changing the buffer with editor commands
+3. writing the buffer into a file
+
+ *current-file*
+As long as you don't write the buffer, the original file remains unchanged.
+If you start editing a file (read a file into the buffer), the file name is
+remembered as the "current file name".
+
+ *alternate-file*
+If there already was a current file name, then that one becomes the alternate
+file name. All file names are remembered in the file list. When you enter a
+file name, for editing (e.g., with ":e filename") or writing (e.g., with (:w
+file name"), the file name is added to the list. You can use this list to
+remember which files you edited and to quickly switch from one file to
+another with the CTRL-^ command (e.g., to copy text). First type the number
+of the file and then hit CTRL-^. {Vi: only one alternate file name}
+
+CTRL-G or *CTRL-G* *:f* *:fi* *:file*
+:f[ile] Prints the current file name (as typed), the
+ cursor position (unless the 'ruler' option is set),
+ and the file status (readonly, modified, read errors,
+ new file)). See the 'shortmess' option about how tho
+ make this message shorter. {Vi does not include
+ column number}
+
+{count}CTRL-G Like CTRL-G, but prints the current file name with
+ full path. If the count is higher than 1 the current
+ buffer number is also given. {not in Vi}
+
+ *g_CTRL-G* *word-count* *byte-count*
+g CTRL-G Prints the current position of the cursor in four
+ ways: Column, Line, Word and Byte. If there are
+ characters in the line that take more than one
+ position on the screen (<Tab> or special character),
+ both the "real" column and the screen column are
+ shown, separated with a dash. See also 'ruler'
+ option. {not in Vi}
+
+ *v_g_CTRL-G*
+{Visual}g CTRL-G Similar to "g CTRL-G", but Word, Line, and Byte counts
+ for the visually selected region are displayed. In
+ Blockwise mode, Column count is also shown. (For
+ {Visual} see |Visual-mode|.)
+ {not in VI}
+
+ *:file_f*
+:f[ile] {name} Sets the current file name to {name}.
+
+:buffers
+:files
+:ls List all the currently known file names. See
+ 'windows.txt' |:files| |:buffers| |:ls|. {not in
+ Vi}
+
+Vim will remember the full path name of a file name that you enter. In most
+cases when the file name is displayed only the name you typed is shown, but
+the full path name is being used if you used the ":cd" command |:cd|.
+
+ *home-replace*
+If the environment variable $HOME is set, and the file name starts with that
+string, it is often displayed with HOME replaced with "~". This was done to
+keep file names short. When reading or writing files the full name is still
+used, the "~" is only used when displaying file names. When replacing the
+file name would result in just "~", "~/" is used instead (to avoid confusion
+with 'backupext' set to "~").
+
+When writing the buffer, the default is to use the current file name. Thus
+when you give the "ZZ" or ":wq" command, the original file will be
+overwritten. If you do not want this, the buffer can be written into another
+file by giving a file name argument to the ":write" command. For example: >
+
+ vim testfile
+ [change the buffer with editor commands]
+ :w newfile
+ :q
+
+This will create a file "newfile", that is a modified copy of "testfile".
+The file "testfile" will remain unchanged. Anyway, if the 'backup' option is
+set, Vim renames or copies the original file before it will be overwritten.
+You can use this file if you discover that you need the original file. See
+also the 'patchmode' option. The name of the backup file is normally the same
+as the original file with 'backupext' appended. The default "~" is a bit
+strange to avoid accidentally overwriting existing files. If you prefer ".bak"
+change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS
+machines, when Vim has detected that an MS-DOS-like filesystem is being used
+(e.g., messydos or crossdos) or when the 'shortname' option is on. The
+backup file can be placed in another directory by setting 'backupdir'.
+
+ *auto-shortname*
+Technical: On the Amiga you can use 30 characters for a file name. But on an
+ MS-DOS-compatible filesystem only 8 plus 3 characters are
+ available. Vim tries to detect the type of filesystem when it is
+ creating the .swp file. If an MS-DOS-like filesystem is suspected,
+ a flag is set that has the same effect as setting the 'shortname'
+ option. This flag will be reset as soon as you start editing a
+ new file. The flag will be used when making the file name for the
+ ".swp" and ".~" files for the current file. But when you are
+ editing a file in a normal filesystem and write to an MS-DOS-like
+ filesystem the flag will not have been set. In that case the
+ creation of the ".~" file may fail and you will get an error
+ message. Use the 'shortname' option in this case.
+
+When you started editing without giving a file name, "No File" is displayed in
+messages. If the ":write" command is used with a file name argument, the file
+name for the current file is set to that file name. This only happens when
+the 'F' flag is included in 'cpoptions' (by default it is included). This is
+useful when entering text in an empty buffer and then writing it to a file.
+If 'cpoptions' contains the 'f' flag (by default it is NOT included) the file
+name is set for the ":read file" command. This is useful when starting Vim
+without an argument and then doing ":read file" to start editing a file.
+ *not-edited*
+Because the file name was set without really starting to edit that file, you
+are protected from overwriting that file. This is done by setting the
+"notedited" flag. You can see if this flag is set with the CTRL-G or ":file"
+command. It will include "[Not edited]" when the "notedited" flag is set.
+When writing the buffer to the current file name (with ":w!"), the "notedited"
+flag is reset.
+
+ *abandon*
+Vim remembers whether you have changed the buffer. You are protected from
+losing the changes you made. If you try to quit without writing, or want to
+start editing another file, Vim will refuse this. In order to overrule this
+protection, add a '!' to the command. The changes will then be lost. For
+example: ":q" will not work if the buffer was changed, but ":q!" will. To see
+whether the buffer was changed use the "CTRL-G" command. The message includes
+the string "[Modified]" if the buffer has been changed.
+
+If you want to automatically save the changes without asking, switch on the
+'autowriteall' option. 'autowrite' is the associated Vi-compatible option
+that does not work for all commands.
+
+If you want to keep the changed buffer without saving it, switch on the
+'hidden' option. See |hidden-buffer|.
+
+==============================================================================
+2. Editing a file *edit-a-file*
+
+ *:e* *:edit*
+:e[dit] [++opt] [+cmd] Edit the current file. This is useful to re-edit the
+ current file, when it has been changed outside of Vim.
+ This fails when changes have been made to the current
+ buffer and 'autowriteall' isn't set or the file can't
+ be written.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+ *:edit!*
+:e[dit]! [++opt] [+cmd]
+ Edit the current file always. Discard any changes to
+ the current buffer. This is useful if you want to
+ start all over again.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+ *:edit_f*
+:e[dit] [++opt] [+cmd] {file}
+ Edit {file}.
+ This fails when changes have been made to the current
+ buffer, unless 'hidden' is set or 'autowriteall' is
+ set and the file can be written.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+ *:edit!_f*
+:e[dit]! [++opt] [+cmd] {file}
+ Edit {file} always. Discard any changes to the
+ current buffer.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+:e[dit] [++opt] [+cmd] #[count]
+ Edit the [count]th alternate file name (as shown by
+ :files). This command does the same as
+ [count] CTRL-^. But ":e #" doesn't work if the
+ alternate buffer doesn't have a file name, while
+ CTRL-^ still works then.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+ *:ene* *:enew*
+:ene[w] Edit a new, unnamed buffer. This fails when changes
+ have been made to the current buffer, unless 'hidden'
+ is set or 'autowriteall' is set and the file can be
+ written.
+ If 'fileformats' is not empty, the first format given
+ will be used for the new buffer. If 'fileformats' is
+ empty, the 'fileformat' of the current buffer is used.
+ {not in Vi}
+
+ *:ene!* *:enew!*
+:ene[w]! Edit a new, unnamed buffer. Discard any changes to
+ the current buffer.
+ Set 'fileformat' like |:enew|.
+ {not in Vi}
+
+ *:fin* *:find*
+:fin[d][!] [++opt] [+cmd] {file}
+ Find {file} in 'path' and then |:edit| it.
+ {not in Vi} {not available when the |+file_in_path|
+ feature was disabled at compile time}
+
+:{count}fin[d][!] [++opt] [+cmd] {file}
+ Just like ":find", but use the {count} match in
+ 'path'. Thus ":2find file" will find the second
+ "file" found in 'path'. When there are fewer matches
+ for the file in 'path' than asked for, you get an
+ error message.
+
+ *:ex*
+:ex [++opt] [+cmd] [file]
+ Same as |:edit|.
+
+ *:vi* *:visual*
+:vi[sual][!] [++opt] [+cmd] [file]
+ When entered in Ex mode: Leave |Ex-mode|, go back to
+ Normal mode. Otherwise same as |:edit|.
+
+ *:vie* *:view*
+:vie[w] [++opt] [+cmd] file
+ When entered in Ex mode: Leave Ex mode, go back to
+ Normal mode. Otherwise same as |:edit|, but set
+ 'readonly' option for this buffer. {not in Vi}
+
+ *CTRL-^* *CTRL-6*
+[count]CTRL-^ Edit [count]th alternate file (equivalent to ":e
+ #[count]"). Without count this gets you to the
+ previously edited file. This is a quick way to toggle
+ between two (or more) files.
+ If the 'autowrite' or 'autowriteall' option is on and
+ the buffer was changed, write it.
+ Mostly the ^ character is positioned on the 6 key,
+ pressing CTRL and 6 then gets you what we call CTRL-^.
+ But on some non-US keyboards CTRL-^ is produced in
+ another way.
+
+[count]]f *]f* *[f*
+[count][f Same as "gf". Deprecated.
+
+ *gf* *E446* *E447*
+[count]gf Edit the file whose name is under or after the cursor.
+ Mnemonic: "goto file".
+ Uses the 'isfname' option to find out which characters
+ are supposed to be in a file name. Trailing
+ punctuation characters ".,:;!" are ignored.
+ Uses the 'path' option as a list of directory names
+ to look for the file. Also looks for the file
+ relative to the current file.
+ Uses the 'suffixesadd' option to check for file names
+ with a suffix added.
+ If the file can't be found, 'includeexpr' is used to
+ modify the name and another attempt is done.
+ If a [count] is given, the count'th file that is found
+ in the 'path' is edited.
+ This command fails if Vim refuses to |abandon| the
+ current file.
+ If you do want to edit a new file, use: >
+ :e <cfile>
+< To make gf always work like that: >
+ :map gf :e <cfile><CR>
+< If the name is a hypertext link, that looks like
+ "type://machine/path", you need the |netrw| plugin.
+ For Unix the '~' character is expanded, like in
+ "~user/file". Environment variables are expanded too
+ |expand-env|.
+ {not in Vi}
+ {not available when the |+file_in_path| feature was
+ disabled at compile time}
+
+ *v_gf*
+{Visual}[count]gf Same as "gf", but the highlighted text is used as the
+ name of the file to edit. 'isfname' is ignored.
+ Leading blanks are skipped, otherwise all blanks and
+ special characters are included in the file name.
+ (For {Visual} see |Visual-mode|.)
+ {not in VI}
+
+These commands are used to start editing a single file. This means that the
+file is read into the buffer and the current file name is set. The file that
+is opened depends on the current directory, see |:cd|.
+
+See |read-messages| for an explanation of the message that is given after the
+file has been read.
+
+You can use the ":e!" command if you messed up the buffer and want to start
+all over again. The ":e" command is only useful if you have changed the
+current file name.
+
+ *:filename* *{file}*
+Note for systems other than Unix and MS-DOS: When using a command that
+accepts a single file name (like ":edit file") spaces in the file name are
+allowed, but trailing spaces are ignored. This is useful on systems that
+allow file names with embedded spaces (like the Amiga). Example: The command
+":e Long File Name " will edit the file "Long File Name". When using a
+command that accepts more than one file name (like ":next file1 file2")
+embedded spaces must be escaped with a backslash.
+
+Wildcards in {file} are expanded. Which wildcards are supported depends on
+the system. These are the common ones:
+ * matches anything, including nothing
+ ? matches one character
+ [abc] match 'a', 'b' or 'c'
+To avoid the special meaning of the wildcards prepend a backslash. However,
+on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
+as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
+is to use "path\[[]abc]". Then the file "path[abc]" literally.
+
+ *backtick-expansion* *`-expansion*
+On Unix you can also use backticks in the file name, for example: >
+ :e `find . -name ver\\*.c -print`
+The backslashes before the star are required to prevent "ver*.c" to be
+expanded by the shell before executing the find program.
+This also works for most other systems, with the restriction that the
+backticks must be around the whole item. It is not possible to have text
+directly before the first or just after the last backtick.
+
+You can have the backticks expanded as a Vim expression, instead of
+an external command, by using the syntax `={expr}` e.g. >
+ :let foo='bar'
+ :e `=foo . ".c" `
+edits "bar.c". Note that the expression cannot contain a backtick.
+
+ *++opt* *[++opt]*
+The [++opt] argument can be used to force the value of 'fileformat' or
+'fileencoding' to a value for one command. The form is: >
+ ++{optname}={value}
+
+Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin*
+ ff or fileformat overrides 'fileformat'
+ enc or encoding overrides 'fileencoding'
+ bin or binary sets 'binary'
+ nobin or nobinary resets 'binary'
+
+{value} cannot contain white space. It can be any valid value for these
+options. Examples: >
+ :e ++ff=unix
+This edits the same file again with 'fileformat' set to "unix". >
+
+ :w ++enc=latin1 newfile
+This writes the current buffer to "newfile" in latin1 format.
+
+Note that when reading, the 'fileformat' and 'fileencoding' options will be
+set to the used format. When writing this doesn't happen, thus a next write
+will use the old value of the option. Same for the 'binary' option.
+
+There may be several ++opt arguments, separated by white space. They must all
+appear before any |+cmd| argument.
+
+ *+cmd* *[+cmd]*
+The [+cmd] argument can be used to position the cursor in the newly opened
+file, or execute any other command:
+ + Start at the last line.
+ +{num} Start at line {num}.
+ +/{pat} Start at first line containing {pat}.
+ +{command} Execute {command} after opening the new file.
+ {command} is any Ex command.
+To include a white space in the {pat} or {command}, precede it with a
+backslash. Double the number of backslashes. >
+ :edit +/The\ book file
+ :edit +/dir\ dirname\\ file
+ :edit +set\ dir=c:\\\\temp file
+Note that in the last example the number of backslashes is halved twice: Once
+for the "+cmd" argument and once for the ":set" command.
+
+ *file-formats*
+The 'fileformat' option sets the <EOL> style for a file:
+'fileformat' characters name ~
+ "dos" <CR><NL> or <NL> DOS format *DOS-format*
+ "unix" <NL> Unix format *Unix-format*
+ "mac" <CR> Mac format *Mac-format*
+Previously 'textmode' was used. It is obsolete now.
+
+When reading a file, the mentioned characters are interpreted as the <EOL>.
+In DOS format (default for MS-DOS, OS/2 and Win32), <CR><NL> and <NL> are both
+interpreted as the <EOL>. Note that when writing the file in DOS format,
+<CR> characters will be added for each single <NL>. Also see |file-read|.
+
+When writing a file, the mentioned characters are used for <EOL>. For DOS
+format <CR><NL> is used. Also see |DOS-format-write|.
+
+You can read a file in DOS format and write it in Unix format. This will
+replace all <CR><NL> pairs by <NL> (assuming 'fileformats' includes "dos"): >
+ :e file
+ :set fileformat=unix
+ :w
+If you read a file in Unix format and write with DOS format, all <NL>
+characters will be replaced with <CR><NL> (assuming 'fileformats' includes
+"unix"): >
+ :e file
+ :set fileformat=dos
+ :w
+
+If you start editing a new file and the 'fileformats' option is not empty
+(which is the default), Vim will try to detect whether the lines in the file
+are separated by the specified formats. When set to "unix,dos", Vim will
+check for lines with a single <NL> (as used on Unix and Amiga) or by a <CR>
+<NL> pair (MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set
+to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac",
+and no <NL> characters are found in the file, 'fileformat' is set to "mac".
+
+If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message
+"[dos format]" is shown to remind you that something unusual is happening. On
+MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to
+"unix". On all systems but the Macintosh you get the message "[mac format]"
+if 'fileformat' is set to "mac".
+
+If the 'fileformats' option is empty and DOS format is used, but while reading
+a file some lines did not end in <CR><NL>, "[CR missing]" will be included in
+the file message.
+If the 'fileformats' option is empty and Mac format is used, but while reading
+a file a <NL> was found, "[NL missing]" will be included in the file message.
+
+If the new file does not exist, the 'fileformat' of the current buffer is used
+when 'fileformats' is empty. Otherwise the first format from 'fileformats' is
+used for the new file.
+
+Before editing binary, executable or Vim script files you should set the
+'binary' option. A simple way to do this is by starting Vim with the "-b"
+option. This will avoid the use of 'fileformat'. Without this you risk that
+single <NL> characters are unexpectedly replaced with <CR><NL>.
+
+You can encrypt files that are written by setting the 'key' option. This
+provides some security against others reading your files. |encryption|
+
+
+File Searching *file-searching*
+
+{not available when compiled without the |+path_extra| feature}
+
+The file searching is currently used for the 'path', 'cdpath' and 'tags'
+options. There are three different types of searching:
+
+1) Downward search:
+ Downward search uses the wildcards '*', '**' and possibly others
+ supported by your operating system. '*' and '**' are handled inside Vim, so
+ they work on all operating systems.
+
+ The usage of '*' is quite simple: It matches 0 or more characters.
+
+ '**' is more sophisticated:
+ - It ONLY matches directories.
+ - It matches up to 30 directories deep, so you can use it to search an
+ entire directory tree
+ - The maximum number of levels matched can be given by appending a number
+ to '**'.
+ Thus '/usr/**2' can match: >
+ /usr
+ /usr/include
+ /usr/include/sys
+ /usr/include/g++
+ /usr/lib
+ /usr/lib/X11
+ ....
+< It does NOT match '/usr/include/g++/std' as this would be three
+ levels.
+ The allowed number range is 0 ('**0' is removed) to 255.
+ If the given number is smaller than 0 it defaults to 30, if it's
+ bigger than 255 it defaults to 255.
+ - '**' can only be at the end of the path or be followed by a path
+ separator or by a number and a path separator.
+
+ You can combine '*' and '**' in any order: >
+ /usr/**/sys/*
+ /usr/*/sys/**
+ /usr/**2/sys/*
+
+2) Upward search:
+ Here you can give a directory and then search the directory tree upward for
+ a file. You could give stop-directories to limit the upward search. The
+ stop-directories are appended to the path (for the 'path' option) or to
+ the filename (for the 'tags' option) with a ';'. If you want several
+ stop-directories separate them with ';'. If you want no stop-directory
+ ("search upward till the root directory) just use ';'. >
+ /usr/include/sys;/usr
+< will search in: >
+ /usr/include/sys
+ /usr/include
+ /usr
+<
+ If you use a relative path the upward search is started in Vim's current
+ directory or in the directory of the current file (if the relative path
+ starts with './' and 'd' is not included in 'cpoptions').
+
+ If Vim's current path is /u/user_x/work/release and you do >
+ :set path=include;/u/user_x
+< and then search for a file with |gf| the file is searched in: >
+ /u/user_x/work/release/include
+ /u/user_x/work/include
+ /u/user_x/include
+
+3) Combined up/downward search
+ If Vim's current path is /u/user_x/work/release and you do >
+ set path=**;/u/user_x
+< and then search for a file with |gf| the file is searched in: >
+ /u/user_x/work/release/**
+ /u/user_x/work/**
+ /u/user_x/**
+<
+ BE CAREFUL! This might consume a lot of time, as the search of
+ '/u/user_x/**' includes '/u/user_x/work/**' and
+ '/u/user_x/work/release/**'. So '/u/user_x/work/release/**' is searched
+ three and '/u/user_x/work/**' is searched two times.
+
+ In the above example you might want to set path to: >
+ :set path=**,/u/user_x/**
+< This searches: >
+ /u/user_x/work/release/**
+ /u/user_x/**
+< This searches the same directories, but in a different order.
+
+==============================================================================
+3. Dialogs *edit-dialogs*
+
+ *:confirm* *:conf*
+:conf[irm] {command} Execute {command}, and use a dialog when an
+ operation has to be confirmed. Can be used on the
+ ":q", ":qa" and ":w" commands (the latter to over-ride
+ a read-only setting).
+
+Examples: >
+ :confirm w foo
+< Will ask for confirmation when "foo" already exists. >
+ :confirm q
+< Will ask for confirmation when there are changes. >
+ :confirm qa
+< If any modified, unsaved buffers exist, you will be prompted to save
+ or abandon each one. There are also choices to "save all" or "abandon
+ all".
+
+If you want to always use ":confirm", set the 'confirm' option.
+
+ *:browse* *:bro* *E338* *E614* *E615* *E616* *E578*
+:bro[wse] {command} Open a file selection dialog for an argument to
+ {command}. At present this works for |:e|, |:w|,
+ |:r|, |:saveas|, |:sp|, |:mkexrc|, |:mkvimrc| and
+ |:mksession|.
+ {only in Win32, Athena, Motif, GTK and Mac GUI}
+ When ":browse" is not possible you get an error
+ message. If the |+browse| feature is missing or the
+ {command} doesn't support browsing, the {command} is
+ executed without a dialog.
+ ":browse set" works like |:options|.
+
+The syntax is best shown via some examples: >
+ :browse e $vim/foo
+< Open the browser in the $vim/foo directory, and edit the
+ file chosen. >
+ :browse e
+< Open the browser in the directory specified with 'browsedir',
+ and edit the file chosen. >
+ :browse w
+< Open the browser in the directory of the current buffer,
+ with the current buffer filename as default, and save the
+ buffer under the filename chosen. >
+ :browse w C:/bar
+< Open the browser in the C:/bar directory, with the current
+ buffer filename as default, and save the buffer under the
+ filename chosen.
+Also see the |'browsedir'| option.
+For versions of Vim where browsing is not supported, the command is executed
+unmodified.
+
+ *browsefilter*
+For MS Windows, you can modify the filters that are used in the browse dialog.
+By setting the g:browsefilter or b:browsefilter variables, you can change the
+filters globally or locally to the buffer. The variable is set to a string in
+the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
+text that appears in the "Files of Type" comboBox, and {pattern} is the
+pattern which filters the filenames. Several patterns can be given, separated
+by ';'.
+
+For Motif the same format is used, but only the very first pattern is actually
+used (Motif only offers one pattern, but you can edit it).
+
+For example, to have only Vim files in the dialog, you could use the following
+command: >
+
+ let g:browsefilter="Vim Scripts\t*.vim\nVim Startup Files\t*vimrc\n"
+
+You can override the filter setting on a per-buffer basis by setting the
+b:browsefilter variable. You would most likely set b:browsefilter in a
+filetype plugin, so that the browse dialog would contain entries related to
+the type of file you are currently editing. Disadvantage: This makes it
+difficult to start editing a file of a different type. To overcome this, you
+may want to add "All Files\t*.*\n" as the final filter, so that the user can
+still access any desired file.
+
+==============================================================================
+4. The current directory *current-directory*
+
+You may use the |:cd| and |:lcd| commands to change to another directory, so
+you will not have to type that directory name in front of the file names. It
+also makes a difference for executing external commands, e.g. ":!ls".
+
+ *:cd* *E472*
+:cd On non-Unix systems: Print the current directory
+ name. On Unix systems: Change the current directory
+ to the home directory. Use |:pwd| to print the
+ current directory on all systems.
+
+:cd {path} Change the current directory to {path}.
+ If {path} is relative, it is searched for in the
+ directories listed in |'cdpath'|.
+ Does not change the meaning of an already opened file,
+ because its full path name is remembered. Files from
+ the |arglist| may change though!
+ On MS-DOS this also changes the active drive.
+ To change to the directory of the current file: >
+ :cd %:h
+<
+ *:cd-* *E186*
+:cd - Change to the previous current directory (before the
+ previous ":cd {path}" command). {not in Vi}
+
+ *:chd* *:chdir*
+:chd[ir] [path] Same as |:cd|.
+
+ *:lc* *:lcd*
+:lc[d] {path} Like |:cd|, but only set the current directory for the
+ current window. The current directory for other
+ windows is not changed. {not in Vi}
+
+ *:lch* *:lchdir*
+:lch[dir] Same as |:lcd|. {not in Vi}
+
+ *:pw* *:pwd* *E187*
+:pw[d] Print the current directory name. {Vi: no pwd}
+ Also see |getcwd()|.
+
+So long as no |:lcd| command has been used, all windows share the same current
+directory. Using a command to jump to another window doesn't change anything
+for the current directory.
+When a |:lcd| command has been used for a window, the specified directory
+becomes the current directory for that window. Windows where the |:lcd|
+command has not been used stick to the global current directory. When jumping
+to another window the current directory will become the last specified local
+current directory. If none was specified, the global current directory is
+used.
+When a |:cd| command is used, the current window will lose his local current
+directory and will use the global current directory from now on.
+
+After using |:cd| the full path name will be used for reading and writing
+files. On some networked file systems this may cause problems. The result of
+using the full path name is that the file names currently in use will remain
+referring to the same file. Example: If you have a file a:test and a
+directory a:vim the commands ":e test" ":cd vim" ":w" will overwrite the file
+a:test and not write a:vim/test. But if you do ":w test" the file a:vim/test
+will be written, because you gave a new file name and did not refer to a
+filename before the ":cd".
+
+==============================================================================
+5. The argument list *argument-list* *arglist*
+
+If you give more than one file name when starting Vim, this list is remembered
+as the argument list. You can jump to each file in this list.
+
+Do not confuse this with the buffer list, which you can see with the
+|:buffers| command. The argument list was already present in Vi, the buffer
+list is new in Vim. A file name in the argument list will also be present in
+the buffer list (unless it was deleted with ":bdel").
+
+This subject is introduced in section |07.2| of the user manual.
+
+There is one global argument list, which is used for all windows by default.
+It is possible to create a new argument list local to a window, see
+|:arglocal|.
+
+You can use the argument list with the following commands, and with the
+expression functions |argc()| and |argv()|. These all work on the argument
+list of the current window.
+
+ *:ar* *:args*
+:ar[gs] Print the argument list, with the current file in
+ square brackets.
+
+:ar[gs] [++opt] [+cmd] {arglist} *:args_f*
+ Define {arglist} as the new argument list and edit
+ the first one. This fails when changes have been made
+ and Vim does not want to |abandon| the current buffer.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+:ar[gs]! [++opt] [+cmd] {arglist} *:args_f!*
+ Define {arglist} as the new argument list and edit
+ the first one. Discard any changes to the current
+ buffer.
+ Also see |++opt| and |+cmd|.
+ {Vi: no ++opt}
+
+:[count]arge[dit][!] [++opt] [+cmd] {name} *:arge* *:argedit*
+ Add {name} to the argument list and edit it.
+ When {name} already exists in the argument list, this
+ entry is edited.
+ This is like using |:argadd| and then |:edit|.
+ Note that only one file name is allowed, and spaces
+ inside the file name are allowed, like with |:edit|.
+ [count] is used like with |:argadd|.
+ [!] is required if the current file cannot be
+ |abandon|ed.
+ Also see |++opt| and |+cmd|.
+ {not in Vi}
+
+:[count]arga[dd] {name} .. *:arga* *:argadd* *E479*
+ Add the {name}s to the argument list.
+ If [count] is omitted, the {name}s are added just
+ after the current entry in the argument list.
+ Otherwise they are added after the [count]'th file.
+ If the argument list is "a b c", and "b" is the
+ current argument, then these commands result in:
+ command new argument list ~
+ :argadd x a b x c
+ :0argadd x x a b c
+ :1argadd x a x b c
+ :99argadd x a b c x
+ There is no check for duplicates, it is possible to
+ add a file to the argument list twice.
+ The currently edited file is not changed.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+ Note: you can also use this method: >
+ :args ## x
+< This will add the "x" item and sort the new list.
+
+:argd[elete] {pattern} .. *:argd* *:argdelete* *E480*
+ Delete files from the argument list that match the
+ {pattern}s. {pattern} is used like a file pattern,
+ see |file-pattern|. "%" can be used to delete the
+ current entry.
+ This command keeps the currently edited file, also
+ when it's deleted from the argument list.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+
+:{range}argd[elete] Delete the {range} files from the argument list.
+ When the last number in the range is too high, up to
+ the last argument is deleted. Example: >
+ :10,1000argdel
+< Deletes arguments 10 and further, keeping 1-9.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+
+ *:argu* *:argument*
+:[count]argu[ment] [count] [++opt] [+cmd]
+ Edit file [count] in the argument list. When [count]
+ is omitted the current entry is used. This fails
+ when changes have been made and Vim does not want to
+ |abandon| the current buffer.
+ Also see |++opt| and |+cmd|.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+
+:[count]argu[ment]! [count] [++opt] [+cmd]
+ Edit file [count] in the argument list, discard any
+ changes to the current buffer. When [count] is
+ omitted the current entry is used.
+ Also see |++opt| and |+cmd|.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+
+:[count]n[ext] [++opt] [+cmd] *:n* *:ne* *:next* *E165* *E163*
+ Edit [count] next file. This fails when changes have
+ been made and Vim does not want to |abandon| the
+ current buffer. Also see |++opt| and |+cmd|. {Vi: no
+ count or ++opt}.
+
+:[count]n[ext]! [++opt] [+cmd]
+ Edit [count] next file, discard any changes to the
+ buffer. Also see |++opt| and |+cmd|. {Vi: no count
+ or ++opt}.
+
+:n[ext] [++opt] [+cmd] {arglist} *:next_f*
+ Same as |:args_f|.
+
+:n[ext]! [++opt] [+cmd] {arglist}
+ Same as |:args_f!|.
+
+:[count]N[ext] [count] [++opt] [+cmd] *:Next* *:N* *E164*
+ Edit [count] previous file in argument list. This
+ fails when changes have been made and Vim does not
+ want to |abandon| the current buffer.
+ Also see |++opt| and |+cmd|. {Vi: no count or ++opt}.
+
+:[count]N[ext]! [count] [++opt] [+cmd]
+ Edit [count] previous file in argument list. Discard
+ any changes to the buffer. Also see |++opt| and
+ |+cmd|. {Vi: no count or ++opt}.
+
+:[count]prev[ious] [count] [++opt] [+cmd] *:prev* *:previous*
+ Same as :Next. Also see |++opt| and |+cmd|. {Vi:
+ only in some versions}
+
+ *:rew* *:rewind*
+:rew[ind] [++opt] [+cmd]
+ Start editing the first file in the argument list.
+ This fails when changes have been made and Vim does
+ not want to |abandon| the current buffer.
+ Also see |++opt| and |+cmd|. {Vi: no ++opt}
+
+:rew[ind]! [++opt] [+cmd]
+ Start editing the first file in the argument list.
+ Discard any changes to the buffer. Also see |++opt|
+ and |+cmd|. {Vi: no ++opt}
+
+ *:fir* *:first*
+:fir[st][!] [++opt] [+cmd]
+ Other name for ":rewind". {not in Vi}
+
+ *:la* *:last*
+:la[st] [++opt] [+cmd]
+ Start editing the last file in the argument list.
+ This fails when changes have been made and Vim does
+ not want to |abandon| the current buffer.
+ Also see |++opt| and |+cmd|. {not in Vi}
+
+:la[st]! [++opt] [+cmd]
+ Start editing the last file in the argument list.
+ Discard any changes to the buffer. Also see |++opt|
+ and |+cmd|. {not in Vi}
+
+ *:wn* *:wnext*
+:[count]wn[ext] [++opt] [+cmd]
+ Write current file and start editing the [count]
+ next file. Also see |++opt| and |+cmd|. {not in Vi}
+
+:[count]wn[ext] [++opt] [+cmd] {file}
+ Write current file to {file} and start editing the
+ [count] next file, unless {file} already exists and
+ the 'writeany' option is off. Also see |++opt| and
+ |+cmd|. {not in Vi}
+
+:[count]wn[ext]! [++opt] [+cmd] {file}
+ Write current file to {file} and start editing the
+ [count] next file. Also see |++opt| and |+cmd|. {not
+ in Vi}
+
+:[count]wN[ext][!] [++opt] [+cmd] [file] *:wN* *:wNext*
+:[count]wp[revous][!] [++opt] [+cmd] [file] *:wp* *:wprevious*
+ Same as :wnext, but go to previous file instead of
+ next. {not in Vi}
+
+The [count] in the commands above defaults to one. For some commands it is
+possible to use two counts. The last one (rightmost one) is used.
+
+If no [+cmd] argument is present, the cursor is positioned at the last known
+cursor position for the file. If 'startofline' is set, the cursor will be
+positioned at the first non-blank in the line, otherwise the last know column
+is used. If there is no last known cursor position the cursor will be in the
+first line (the last line in Ex mode).
+
+The wildcards in the argument list are expanded and the file names are sorted.
+Thus you can use the command "vim *.c" to edit all the C files. From within
+Vim the command ":n *.c" does the same. On Unix you can also use backticks,
+for example: >
+ :n `find . -name \\*.c -print`
+The backslashes before the star are required to prevent "*.c" to be expanded
+by the shell before executing the find program.
+
+ *arglist-position*
+When there is an argument list you can see which file you are editing in the
+title of the window (if there is one and 'title' is on) and with the file
+message you get with the "CTRL-G" command. You will see something like
+ (file 4 of 11)
+If 'shortmess' contains 'f' it will be
+ (4 of 11)
+If you are not really editing the file at the current position in the argument
+list it will be
+ (file (4) of 11)
+This means that you are position 4 in the argument list, but not editing the
+fourth file in the argument list. This happens when you do ":e file".
+
+
+LOCAL ARGUMENT LIST
+
+{not in Vi}
+{not available when compiled without the |+windows| or |+listcmds| feature}
+
+ *:arglocal*
+:argl[ocal] Make a local copy of the global argument list.
+ Doesn't start editing another file.
+
+:argl[ocal][!] [++opt] [+cmd] {arglist}
+ Define a new argument list, which is local to the
+ current window. Works like |:args_f| otherwise.
+
+ *:argglobal*
+:argg[lobal] Use the global argument list for the current window.
+ Doesn't start editing another file.
+
+:argg[lobal][!] [++opt] [+cmd] {arglist}
+ Use the global argument list for the current window.
+ Define a new global argument list like |:args_f|.
+ All windows using the global argument list will see
+ this new list.
+
+There can be several argument lists. They can be shared between windows.
+When they are shared, changing the argument list in one window will also
+change it in the other window.
+
+When a window is split the new window inherits the argument list from the
+current window. The two windows then share this list, until one of them uses
+|:arglocal| or |:argglobal| to use another argument list.
+
+
+USING THE ARGUMENT LIST
+
+ *:argdo*
+:argdo[!] {cmd} Execute {cmd} for each file in the argument list.
+ It works like doing this: >
+ :rewind
+ :{cmd}
+ :next
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one file, further files
+ in the argument list will not be visited.
+ The last file in the argument list (or where an error
+ occurred) becomes the current file.
+ {cmd} can contain '|' to concatenate several commands.
+ {cmd} must not change the argument list.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each file.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+ Also see |:windo| and |:bufdo|.
+
+Example: >
+ :args *.c
+ :argdo set ff=unix | update
+This sets the 'fileformat' option to "unix" and writes the file if is now
+changed. This is done for all *.c files.
+
+Example: >
+ :args *.[ch]
+ :argdo %s/\<my_foo\>/My_Foo/ge | update
+This changes the word "my_foo" to "My_Foo" in all *.c and *.h files. The "e"
+flag is used for the ":substitute" command to avoid an error for files where
+"my_foo" isn't used. ":update" writes the file only if changes were made.
+
+==============================================================================
+6. Writing *writing* *save-file*
+
+Note: When the 'write' option is off, you are not able to write any file.
+
+ *:w* *:write*
+ *E502* *E503* *E504* *E505*
+ *E512* *E514* *E667*
+:w[rite] Write the whole buffer to the current file. This is
+ the normal way to save changes to a file. It fails
+ when the 'readonly' option is set or when there is
+ another reason why the file can't be written.
+
+:w[rite]! Like ":write", but forcefully write when 'readonly' is
+ set or there is another reason why writing was
+ refused.
+ Note: This may change the permission and ownership of
+ the file and break (symbolic) links. Add the 'W' flag
+ to 'cpoptions' to avoid this.
+
+:[range]w[rite][!] Write the specified lines to the current file. This
+ is unusual, because the file will not contain all
+ lines in the buffer.
+
+ *:w_f* *:write_f*
+:[range]w[rite] {file} Write the specified lines to {file}, unless it
+ already exists and the 'writeany' option is off.
+
+ *:w!*
+:[range]w[rite]! {file} Write the specified lines to {file}. Overwrite an
+ existing file.
+
+ *:w_a* *:write_a* *E494*
+:[range]w[rite][!] >> Append the specified lines to the current file.
+
+:[range]w[rite][!] >> {file}
+ Append the specified lines to {file}. '!' forces the
+ write even if file does not exist.
+
+ *:w_c* *:write_c*
+:[range]w[rite] !{cmd} Execute {cmd} with [range] lines as standard input
+ (note the space in front of the '!'). {cmd} is
+ executed like with ":!{cmd}", any '!' is replaced with
+ the previous command |:!|.
+
+The default [range] for the ":w" command is the whole buffer (1,$).
+If a file name is given with ":w" it becomes the alternate file. This can be
+used, for example, when the write fails and you want to try again later with
+":w #". This can be switched off by removing the 'A' flag from the
+'cpoptions' option.
+
+ *:sav* *:saveas*
+:sav[eas][!] {file} Save the current buffer under the name {file} and set
+ the filename of the current buffer to {file}. The
+ previous name is used for the alternate file name.
+ The [!] is needed to overwrite an existing file.
+ {not in Vi}
+
+ *:up* *:update*
+:[range]up[date][!] [>>] [file]
+ Like ":write", but only write when the buffer has been
+ modified. {not in Vi}
+
+
+WRITING WITH MULTIPLE BUFFERS *buffer-write*
+
+ *:wa* *:wall*
+:wa[ll] Write all changed buffers. Buffers without a file
+ name or which are readonly are not written. {not in
+ Vi}
+
+:wa[ll]! Write all changed buffers, even the ones that are
+ readonly. Buffers without a file name are not
+ written. {not in Vi}
+
+
+Vim will warn you if you try to overwrite a file that has been changed
+elsewhere. See |timestamp|.
+
+ *backup* *E207* *E506* *E507* *E508* *E509* *E510*
+If you write to an existing file (but do not append) while the 'backup',
+'writebackup' or 'patchmode' option is on, a backup of the original file is
+made. The file is either copied or renamed (see 'backupcopy'). After the
+file has been successfully written and when the 'writebackup' option is on and
+the 'backup' option is off, the backup file is deleted. When the 'patchmode'
+option is on the backup file may be renamed.
+
+ *backup-table*
+'backup' 'writebackup' action ~
+ off off no backup made
+ off on backup current file, deleted afterwards (default)
+ on off delete old backup, backup current file
+ on on delete old backup, backup current file
+
+When the 'backupskip' pattern matches with the name of the file which is
+written, no backup file is made. The values of 'backup' and 'writebackup' are
+ignored then.
+
+When the 'backup' option is on, an old backup file (with the same name as the
+new backup file) will be deleted. If 'backup' is not set, but 'writebackup'
+is set, an existing backup file will not be deleted. The backup file that is
+made while the file is being written will have a different name.
+
+On some filesystems it's possible that in a crash you lose both the backup and
+the newly written file (it might be there but contain bogus data). In that
+case try recovery, because the swap file is synced to disk and might still be
+there. |:recover|
+
+The directories given with the 'backupdir' option is used to put the backup
+file in. (default: same directory as the written file).
+
+Whether the backup is a new file, which is a copy of the original file, or the
+original file renamed depends on the 'backupcopy' option. See there for an
+explanation of when the copy is made and when the file is renamed.
+
+If the creation of a backup file fails, the write is not done. If you want
+to write anyway add a '!' to the command.
+
+ *write-readonly*
+When the 'cpoptions' option contains 'W', Vim will refuse to overwrite a
+readonly file. When 'W' is not present, ":w!" will overwrite a readonly file,
+if the system allows it (the directory must be writable).
+
+ *write-fail*
+If the writing of the new file fails, you have to be careful not to lose
+your changes AND the original file. If there is no backup file and writing
+the new file failed, you have already lost the original file! DON'T EXIT VIM
+UNTIL YOU WRITE OUT THE FILE! If a backup was made, it is put back in place
+of the original file (if possible). If you exit Vim, and lose the changes
+you made, the original file will mostly still be there. If putting back the
+original file fails, there will be an error message telling you that you
+lost the original file.
+
+ *DOS-format-write*
+If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default
+for MS-DOS, Win32 and OS/2. On other systems the message "[dos format]" is
+shown to remind you that an unusual <EOL> was used.
+ *Unix-format-write*
+If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS, Win32 and
+OS/2 the message "[unix format]" is shown.
+ *Mac-format-write*
+If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the
+message "[mac format]" is shown.
+
+See also |file-formats| and the 'fileformat' and 'fileformats' options.
+
+ *ACL*
+ACL stands for Access Control List. It is an advanced way to control access
+rights for a file. It is used on new MS-Windows and Unix systems, but only
+when the filesystem supports it.
+ Vim attempts to preserve the ACL info when writing a file. The backup file
+will get the ACL info of the original file.
+ The ACL info is also used to check if a file is read-only (when opening the
+file).
+
+ *read-only-share*
+When MS-Windows shares a drive on the network it can be marked as read-only.
+This means that even if the file read-only attribute is absent, and the ACL
+settings on NT network shared drives allow writing to the file, you can still
+not write to the file. Vim on Win32 platforms will detect read-only network
+drives and will mark the file as read-only. You will not be able to override
+it with |:write|.
+
+ *write-device*
+When the file name is actually a device name, Vim will not make a backup (that
+would be impossible). You need to use "!", since the device already exists.
+Example for Unix: >
+ :w! /dev/lpt0
+and for MS-DOS or MS-Windows: >
+ :w! lpt0
+For Unix a device is detected when the name doesn't refer to a normal file or
+a directory. A fifo or named pipe also looks like a device to Vim.
+For MS-DOS and MS-Windows the device is detected by its name:
+ AUX
+ CON
+ CLOCK$
+ NUL
+ PRN
+ COMn n=1,2,3... etc
+ LPTn n=1,2,3... etc
+The names can be in upper- or lowercase.
+
+==============================================================================
+7. Writing and quitting *write-quit*
+
+ *:q* *:quit*
+:q[uit] Quit the current window. Quit Vim if this is the last
+ window. This fails when changes have been made and
+ Vim refuses to |abandon| the current buffer, and when
+ the last file in the argument list has not been
+ edited.
+
+:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
+ the last file in the argument list has not been
+ edited. See |:confirm| and 'confirm'. {not in Vi}
+
+:q[uit]! Quit without writing, also when visible buffers have
+ changes. Does not exit when there are changed hidden
+ buffers. Use ":qall!" to exit always.
+
+:cq[uit] Quit always, without writing, and return an error
+ code. See |:cq|. Used for Manx's QuickFix mode (see
+ |quickfix|). {not in Vi}
+
+ *:wq*
+:wq Write the current file and quit. Writing fails when
+ the file is read-only or the buffer does not have a
+ name. Quitting fails when the last file in the
+ argument list has not been edited.
+
+:wq! Write the current file and quit. Writing fails when
+ the current buffer does not have a name.
+
+:wq {file} Write to {file} and quit. Quitting fails when the
+ last file in the argument list has not been edited.
+
+:wq! {file} Write to {file} and quit.
+
+:[range]wq[!] [file] Same as above, but only write the lines in [range].
+
+ *:x* *:xit*
+:[range]x[it][!] [file]
+ Like ":wq", but write only when changes have been
+ made.
+ When 'hidden' is set and there are more windows, the
+ current buffer becomes hidden, after writing the file.
+
+ *:exi* *:exit*
+:[range]exi[t][!] [file]
+ Same as :xit.
+
+ *ZZ*
+ZZ Write current file, if modified, and quit (same as
+ ":x"). (Note: If there are several windows for the
+ current file, the file is written if it was modified
+ and the window is closed).
+
+ *ZQ*
+ZQ Quit without checking for changes (same as ":q!").
+ {not in Vi}
+
+MULTIPLE WINDOWS AND BUFFERS *window-exit*
+
+ *:qa* *:qall*
+:qa[ll] Exit Vim, unless there are some buffers which have been
+ changed. (Use ":bmod" to go to the next modified buffer).
+ When 'autowriteall' is set all changed buffers will be
+ written, like |:wqall|. {not in Vi}
+
+:conf[irm] qa[ll]
+ Exit Vim. Bring up a prompt when some buffers have been
+ changed. See |:confirm|. {not in Vi}
+
+:qa[ll]! Exit Vim. Any changes to buffers are lost. {not in Vi}
+
+ *:quita* *:quitall*
+:quita[ll][!] Same as ":qall". {not in Vi}
+
+:wqa[ll] *:wqa* *:wqall* *:xa* *:xall*
+:xa[ll] Write all changed buffers and exit Vim. If there are buffers
+ without a file name, which are readonly or which cannot be
+ written for another reason, Vim will not quit. {not in Vi}
+
+:conf[irm] wqa[ll]
+:conf[irm] xa[ll]
+ Write all changed buffers and exit Vim. Bring up a prompt
+ when some buffers are readonly or cannot be written for
+ another reason. See |:confirm|. {not in Vi}
+
+:wqa[ll]!
+:xa[ll]! Write all changed buffers, even the ones that are readonly,
+ and exit Vim. If there are buffers without a file name or
+ which cannot be written for another reason, Vim will not quit.
+ {not in Vi}
+
+==============================================================================
+8. Editing binary files *edit-binary*
+
+Although Vim was made to edit text files, it is possible to edit binary
+files. The |-b| Vim argument (b for binary) makes Vim do file I/O in binary
+mode, and sets some options for editing binary files ('binary' on, 'textwidth'
+to 0, 'modeline' off, 'expandtab' off). Setting the 'binary' option has the
+same effect. Don't forget to do this before reading the file.
+
+There are a few things to remember when editing binary files:
+- When editing executable files the number of characters must not change.
+ Use only the "R" or "r" command to change text. Do not delete characters
+ with "x" or by backspacing.
+- Set the 'textwidth' option to 0. Otherwise lines will unexpectedly be
+ split in two.
+- When there are not many <EOL>s, the lines will become very long. If you
+ want to edit a line that does not fit on the screen reset the 'wrap' option.
+ Horizontal scrolling is used then. If a line becomes too long (more than
+ about 32767 characters on the Amiga, much more on 32-bit systems, see
+ |limits|) you cannot edit that line. The line will be split when reading
+ the file. It is also possible that you get an "out of memory" error when
+ reading the file.
+- Make sure the 'binary' option is set BEFORE loading the
+ file. Otherwise both <CR> <NL> and <NL> are considered to end a line
+ and when the file is written the <NL> will be replaced with <CR> <NL>.
+- <Nul> characters are shown on the screen as ^@. You can enter them with
+ "CTRL-V CTRL-@" or "CTRL-V 000" {Vi cannot handle <Nul> characters in the
+ file}
+- To insert a <NL> character in the file split up a line. When writing the
+ buffer to a file a <NL> will be written for the <EOL>.
+- Vim normally appends an <EOL> at the end of the file if there is none.
+ Setting the 'binary' option prevents this. If you want to add the final
+ <EOL>, set the 'endofline' option. You can also read the value of this
+ option to see if there was an <EOL> for the last line (you cannot see this
+ in the text).
+
+==============================================================================
+9. Encryption *encryption*
+
+Vim is able to write files encrypted, and read them back. The encrypted text
+cannot be read without the right key.
+
+Note: The swapfile and text in memory is not encrypted. A system
+administrator will be able to see your text while you are editing it.
+When filtering text with ":!filter" or using ":w !command" the text is not
+encrypted, this may reveal it to others.
+
+WARNING: If you make a typo when entering the key and then write the file and
+exit, the text will be lost!
+
+The normal way to work with encryption, is to use the ":X" command, which will
+ask you to enter a key. A following write command will use that key to
+encrypt the file. If you later edit the same file, Vim will ask you to enter
+a key. If you type the same key as that was used for writing, the text will
+be readable again. If you use a wrong key, it will be a mess.
+
+ *:X*
+:X Prompt for an encryption key. The typing is done without showing the
+ actual text, so that someone looking at the display won't see it.
+ The typed key is stored in the 'key' option, which is used to encrypt
+ the file when it is written. The file will remain unchanged until you
+ write it. See also |-x|.
+
+The value of the 'key' options is used when text is written. When the option
+is not empty, the written file will be encrypted, using the value as the
+encryption key. A magic number is prepended, so that Vim can recognize that
+the file is encrypted.
+
+To disable the encryption, reset the 'key' option to an empty value: >
+ :set key=
+
+When reading a file that has been encrypted and this option is not empty, it
+will be used for decryption. If the value is empty, you will be prompted to
+enter the key. If you don't enter a key, the file is edited without being
+decrypted.
+
+If want to start reading a file that uses a different key, set the 'key'
+option to an empty string, so that Vim will prompt for a new one. Don't use
+the ":set" command to enter the value, other people can read the command over
+your shoulder.
+
+Since the value of the 'key' option is supposed to be a secret, its value can
+never be viewed. You should not set this option in a vimrc file.
+
+An encrypted file can be recognized by the "file" command, if you add this
+line to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
+"magic" file: >
+ 0 string VimCrypt~ Vim encrypted file
+
+Notes:
+- Encryption is not possible when doing conversion with 'charconvert'.
+- Text you copy or delete goes to the numbered registers. The registers can
+ be saved in the .viminfo file, where they could be read. Change your
+ 'viminfo' option to be safe.
+- Someone can type commands in Vim when you walk away for a moment, he should
+ not be able to get the key.
+- If you make a typing mistake when entering the key, you might not be able to
+ get your text back!
+- If you type the key with a ":set key=value" command, it can be kept in the
+ history, showing the 'key' value in a viminfo file.
+- There is never 100% safety. The encryption in Vim has not been tested for
+ robustness.
+- The algorithm used is breakable. A 4 character key in about one hour, a 6
+ character key in one day (on a Pentium 133 PC). This requires that you know
+ some text that must appear in the file. An expert can break it for any key.
+ When the text has been decrypted, this also means that the key can be
+ revealed, and other files encrypted with the same key can be decrypted.
+- Pkzip uses the same encryption, and US Govt has no objection to its export.
+ Pkzip's public file APPNOTE.TXT describes this algorithm in detail.
+- Vim originates from the Netherlands. That is where the sources come from.
+ Thus the encryption code is not exported from the USA.
+
+==============================================================================
+10. Timestamps *timestamp* *timestamps*
+
+Vim remembers the modification timestamp of a file when you begin editing it.
+This is used to avoid that you have two different versions of the same file
+(without you knowing this).
+
+After a shell command is run (|:!cmd| |suspend| |:read!| |K|) timestamps are
+compared for all buffers in a window. Vim will run any associated
+|FileChangedShell| autocommands or display a warning for any files that have
+changed. In the GUI this happens when Vim regains input focus.
+
+ *E321* *E462*
+If you want to automatically reload a file when it has been changed outside of
+Vim, set the 'autoread' option. This doesn't work at the moment you write the
+file though, only when the file wasn't changed inside of Vim.
+
+Note that if a FileChangedShell autocommand is defined you will not get a
+warning message or prompt. The autocommand is expected to handle this.
+
+There is no warning for a directory (e.g., in the |file-explorer|). But you
+do get warned if you started editing a new file and it was created as a
+directory later.
+
+When Vim notices the timestamp of a file has changed, and the file is being
+edited in a buffer but has not changed, Vim checks if the contents of the file
+is equal. This is done by reading the file again (into a hidden buffer, which
+is immediately deleted again) and comparing the text. If the text is equal,
+you will get no warning.
+
+If you don't get warned often enough you can use the following command.
+
+ *:checkt* *:checktime*
+:checkt[ime] Check if any buffers were changed outside of Vim.
+ This checks and warns you if you would end up with two
+ versions of a file.
+ If this is called from an autocommand, a ":global"
+ command or is not typed the actual check is postponed
+ until a moment the side effects (reloading the file)
+ would be harmless.
+ Each loaded buffer is checked for its associated file
+ being changed. If the file was changed Vim will take
+ action. If there are no changes in the buffer and
+ 'autoread' is set, the buffer is reloaded. Otherwise,
+ you are offered the choice of reloading the file. If
+ the file was deleted you get an error message.
+ If the file previously didn't exist you get a warning
+ if it exists now.
+ Once a file has been checked the timestamp is reset,
+ you will not be warned again.
+
+:[N]checkt[ime] {filename}
+:[N]checkt[ime] [N]
+ Check the timestamp of a specific buffer. The buffer
+ may be specified by name, number or with a pattern.
+
+
+Before writing a file the timestamp is checked. If it has changed, Vim will
+ask if you really want to overwrite the file:
+
+ WARNING: The file has been changed since reading it!!!
+ Do you really want to write to it (y/n)?
+
+If you hit 'y' Vim will continue writing the file. If you hit 'n' the write is
+aborted. If you used ":wq" or "ZZ" Vim will not exit, you will get another
+chance to write the file.
+
+The message would normally mean that somebody has written to the file after
+the edit session started. This could be another person, in which case you
+probably want to check if your changes to the file and the changes from the
+other person should be merged. Write the file under another name and check for
+differences (the "diff" program can be used for this).
+
+It is also possible that you modified the file yourself, from another edit
+session or with another command (e.g., a filter command). Then you will know
+which version of the file you want to keep.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
new file mode 100644
index 000000000..4685ff5e6
--- /dev/null
+++ b/runtime/doc/eval.txt
@@ -0,0 +1,4583 @@
+*eval.txt* For Vim version 7.0aa. Last change: 2004 May 18
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Expression evaluation *expression* *expr* *E15* *eval*
+
+Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|.
+
+Note: Expression evaluation can be disabled at compile time. If this has been
+done, the features in this document are not available. See |+eval| and the
+last chapter below.
+
+1. Variables |variables|
+2. Expression syntax |expression-syntax|
+3. Internal variable |internal-variables|
+4. Builtin Functions |functions|
+5. Defining functions |user-functions|
+6. Curly braces names |curly-braces-names|
+7. Commands |expression-commands|
+8. Exception handling |exception-handling|
+9. Examples |eval-examples|
+10. No +eval feature |no-eval-feature|
+11. The sandbox |eval-sandbox|
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Variables *variables*
+
+There are two types of variables:
+
+Number a 32 bit signed number.
+String a NUL terminated string of 8-bit unsigned characters.
+
+These are converted automatically, depending on how they are used.
+
+Conversion from a Number to a String is by making the ASCII representation of
+the Number. Examples: >
+ Number 123 --> String "123"
+ Number 0 --> String "0"
+ Number -1 --> String "-1"
+
+Conversion from a String to a Number is done by converting the first digits
+to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If
+the String doesn't start with digits, the result is zero. Examples: >
+ String "456" --> Number 456
+ String "6bar" --> Number 6
+ String "foo" --> Number 0
+ String "0xf1" --> Number 241
+ String "0100" --> Number 64
+ String "-8" --> Number -8
+ String "+8" --> Number 0
+
+To force conversion from String to Number, add zero to it: >
+ :echo "0100" + 0
+
+For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE.
+
+Note that in the command >
+ :if "foo"
+"foo" is converted to 0, which means FALSE. To test for a non-empty string,
+use strlen(): >
+ :if strlen("foo")
+
+If you need to know the type of a variable or expression, use the |type()|
+function.
+
+When the '!' flag is included in the 'viminfo' option, global variables that
+start with an uppercase letter, and don't contain a lowercase letter, are
+stored in the viminfo file |viminfo-file|.
+
+When the 'sessionoptions' option contains "global", global variables that
+start with an uppercase letter and contain at least one lowercase letter are
+stored in the session file |session-file|.
+
+variable name can be stored where ~
+my_var_6 not
+My_Var_6 session file
+MY_VAR_6 viminfo file
+
+
+It's possible to form a variable name with curly braces, see
+|curly-braces-names|.
+
+==============================================================================
+2. Expression syntax *expression-syntax*
+
+Expression syntax summary, from least to most significant:
+
+|expr1| expr2 ? expr1 : expr1 if-then-else
+
+|expr2| expr3 || expr3 .. logical OR
+
+|expr3| expr4 && expr4 .. logical AND
+
+|expr4| expr5 == expr5 equal
+ expr5 != expr5 not equal
+ expr5 > expr5 greater than
+ expr5 >= expr5 greater than or equal
+ expr5 < expr5 smaller than
+ expr5 <= expr5 smaller than or equal
+ expr5 =~ expr5 regexp matches
+ expr5 !~ expr5 regexp doesn't match
+
+ expr5 ==? expr5 equal, ignoring case
+ expr5 ==# expr5 equal, match case
+ etc. As above, append ? for ignoring case, # for
+ matching case
+
+|expr5| expr6 + expr6 .. number addition
+ expr6 - expr6 .. number subtraction
+ expr6 . expr6 .. string concatenation
+
+|expr6| expr7 * expr7 .. number multiplication
+ expr7 / expr7 .. number division
+ expr7 % expr7 .. number modulo
+
+|expr7| ! expr7 logical NOT
+ - expr7 unary minus
+ + expr7 unary plus
+ expr8
+
+|expr8| expr9[expr1] index in String
+
+|expr9| number number constant
+ "string" string constant
+ 'string' literal string constant
+ &option option value
+ (expr1) nested expression
+ variable internal variable
+ va{ria}ble internal variable with curly braces
+ $VAR environment variable
+ @r contents of register 'r'
+ function(expr1, ...) function call
+ func{ti}on(expr1, ...) function call with curly braces
+
+
+".." indicates that the operations in this level can be concatenated.
+Example: >
+ &nu || &list && &shell == "csh"
+
+All expressions within one level are parsed from left to right.
+
+
+expr1 *expr1* *E109*
+-----
+
+expr2 ? expr1 : expr1
+
+The expression before the '?' is evaluated to a number. If it evaluates to
+non-zero, the result is the value of the expression between the '?' and ':',
+otherwise the result is the value of the expression after the ':'.
+Example: >
+ :echo lnum == 1 ? "top" : lnum
+
+Since the first expression is an "expr2", it cannot contain another ?:. The
+other two expressions can, thus allow for recursive use of ?:.
+Example: >
+ :echo lnum == 1 ? "top" : lnum == 1000 ? "last" : lnum
+
+To keep this readable, using |line-continuation| is suggested: >
+ :echo lnum == 1
+ :\ ? "top"
+ :\ : lnum == 1000
+ :\ ? "last"
+ :\ : lnum
+
+
+expr2 and expr3 *expr2* *expr3*
+---------------
+
+ *expr-barbar* *expr-&&*
+The "||" and "&&" operators take one argument on each side. The arguments
+are (converted to) Numbers. The result is:
+
+ input output ~
+n1 n2 n1 || n2 n1 && n2 ~
+zero zero zero zero
+zero non-zero non-zero zero
+non-zero zero non-zero zero
+non-zero non-zero non-zero non-zero
+
+The operators can be concatenated, for example: >
+
+ &nu || &list && &shell == "csh"
+
+Note that "&&" takes precedence over "||", so this has the meaning of: >
+
+ &nu || (&list && &shell == "csh")
+
+Once the result is known, the expression "short-circuits", that is, further
+arguments are not evaluated. This is like what happens in C. For example: >
+
+ let a = 1
+ echo a || b
+
+This is valid even if there is no variable called "b" because "a" is non-zero,
+so the result must be non-zero. Similarly below: >
+
+ echo exists("b") && b == "yes"
+
+This is valid whether "b" has been defined or not. The second clause will
+only be evaluated if "b" has been defined.
+
+
+expr4 *expr4*
+-----
+
+expr5 {cmp} expr5
+
+Compare two expr5 expressions, resulting in a 0 if it evaluates to false, or 1
+if it evaluates to true.
+
+ *expr-==* *expr-!=* *expr->* *expr->=*
+ *expr-<* *expr-<=* *expr-=~* *expr-!~*
+ *expr-==#* *expr-!=#* *expr->#* *expr->=#*
+ *expr-<#* *expr-<=#* *expr-=~#* *expr-!~#*
+ *expr-==?* *expr-!=?* *expr->?* *expr->=?*
+ *expr-<?* *expr-<=?* *expr-=~?* *expr-!~?*
+ use 'ignorecase' match case ignore case ~
+equal == ==# ==?
+not equal != !=# !=?
+greater than > ># >?
+greater than or equal >= >=# >=?
+smaller than < <# <?
+smaller than or equal <= <=# <=?
+regexp matches =~ =~# =~?
+regexp doesn't match !~ !~# !~?
+
+Examples:
+"abc" ==# "Abc" evaluates to 0
+"abc" ==? "Abc" evaluates to 1
+"abc" == "Abc" evaluates to 1 if 'ignorecase' is set, 0 otherwise
+
+When comparing a String with a Number, the String is converted to a Number,
+and the comparison is done on Numbers. This means that "0 == 'x'" is TRUE,
+because 'x' converted to a Number is zero.
+
+When comparing two Strings, this is done with strcmp() or stricmp(). This
+results in the mathematical difference (comparing byte values), not
+necessarily the alphabetical difference in the local language.
+
+When using the operators with a trailing '#", or the short version and
+'ignorecase' is off, the comparing is done with strcmp().
+
+When using the operators with a trailing '?', or the short version and
+'ignorecase' is set, the comparing is done with stricmp().
+
+The "=~" and "!~" operators match the lefthand argument with the righthand
+argument, which is used as a pattern. See |pattern| for what a pattern is.
+This matching is always done like 'magic' was set and 'cpoptions' is empty, no
+matter what the actual value of 'magic' or 'cpoptions' is. This makes scripts
+portable. To avoid backslashes in the regexp pattern to be doubled, use a
+single-quote string, see |literal-string|.
+Since a string is considered to be a single line, a multi-line pattern
+(containing \n, backslash-n) will not match. However, a literal NL character
+can be matched like an ordinary character. Examples:
+ "foo\nbar" =~ "\n" evaluates to 1
+ "foo\nbar" =~ "\\n" evaluates to 0
+
+
+expr5 and expr6 *expr5* *expr6*
+---------------
+expr6 + expr6 .. number addition *expr-+*
+expr6 - expr6 .. number subtraction *expr--*
+expr6 . expr6 .. string concatenation *expr-.*
+
+expr7 * expr7 .. number multiplication *expr-star*
+expr7 / expr7 .. number division *expr-/*
+expr7 % expr7 .. number modulo *expr-%*
+
+For all, except ".", Strings are converted to Numbers.
+
+Note the difference between "+" and ".":
+ "123" + "456" = 579
+ "123" . "456" = "123456"
+
+When the righthand side of '/' is zero, the result is 0x7fffffff.
+When the righthand side of '%' is zero, the result is 0.
+
+
+expr7 *expr7*
+-----
+! expr7 logical NOT *expr-!*
+- expr7 unary minus *expr-unary--*
++ expr7 unary plus *expr-unary-+*
+
+For '!' non-zero becomes zero, zero becomes one.
+For '-' the sign of the number is changed.
+For '+' the number is unchanged.
+
+A String will be converted to a Number first.
+
+These three can be repeated and mixed. Examples:
+ !-1 == 0
+ !!8 == 1
+ --9 == 9
+
+
+expr8 *expr8*
+-----
+expr9[expr1] index in String *expr-[]* *E111*
+
+This results in a String that contains the expr1'th single byte from expr9.
+expr9 is used as a String, expr1 as a Number. Note that this doesn't work for
+multi-byte encodings.
+
+Note that index zero gives the first character. This is like it works in C.
+Careful: text column numbers start with one! Example, to get the character
+under the cursor: >
+ :let c = getline(line("."))[col(".") - 1]
+
+If the length of the String is less than the index, the result is an empty
+String.
+
+ *expr9*
+number
+------
+number number constant *expr-number*
+
+Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).
+
+
+string *expr-string* *E114*
+------
+"string" string constant *expr-quote*
+
+Note that double quotes are used.
+
+A string constant accepts these special characters:
+\... three-digit octal number (e.g., "\316")
+\.. two-digit octal number (must be followed by non-digit)
+\. one-digit octal number (must be followed by non-digit)
+\x.. byte specified with two hex numbers (e.g., "\x1f")
+\x. byte specified with one hex number (must be followed by non-hex char)
+\X.. same as \x..
+\X. same as \x.
+\u.... character specified with up to 4 hex numbers, stored according to the
+ current value of 'encoding' (e.g., "\u02a4")
+\U.... same as \u....
+\b backspace <BS>
+\e escape <Esc>
+\f formfeed <FF>
+\n newline <NL>
+\r return <CR>
+\t tab <Tab>
+\\ backslash
+\" double quote
+\<xxx> Special key named "xxx". e.g. "\<C-W>" for CTRL-W.
+
+Note that "\000" and "\x00" force the end of the string.
+
+
+literal-string *literal-string* *E115*
+---------------
+'string' literal string constant *expr-'*
+
+Note that single quotes are used.
+
+This string is taken literally. No backslashes are removed or have a special
+meaning. A literal-string cannot contain a single quote. Use a normal string
+for that.
+
+
+option *expr-option* *E112* *E113*
+------
+&option option value, local value if possible
+&g:option global option value
+&l:option local option value
+
+Examples: >
+ echo "tabstop is " . &tabstop
+ if &insertmode
+
+Any option name can be used here. See |options|. When using the local value
+and there is no buffer-local or window-local value, the global value is used
+anyway.
+
+
+register *expr-register*
+--------
+@r contents of register 'r'
+
+The result is the contents of the named register, as a single string.
+Newlines are inserted where required. To get the contents of the unnamed
+register use @" or @@. The '=' register can not be used here. See
+|registers| for an explanation of the available registers.
+
+
+nesting *expr-nesting* *E110*
+-------
+(expr1) nested expression
+
+
+environment variable *expr-env*
+--------------------
+$VAR environment variable
+
+The String value of any environment variable. When it is not defined, the
+result is an empty string.
+ *expr-env-expand*
+Note that there is a difference between using $VAR directly and using
+expand("$VAR"). Using it directly will only expand environment variables that
+are known inside the current Vim session. Using expand() will first try using
+the environment variables known inside the current Vim session. If that
+fails, a shell will be used to expand the variable. This can be slow, but it
+does expand all variables that the shell knows about. Example: >
+ :echo $version
+ :echo expand("$version")
+The first one probably doesn't echo anything, the second echoes the $version
+variable (if your shell supports it).
+
+
+internal variable *expr-variable*
+-----------------
+variable internal variable
+See below |internal-variables|.
+
+
+function call *expr-function* *E116* *E117* *E118* *E119* *E120*
+-------------
+function(expr1, ...) function call
+See below |functions|.
+
+
+==============================================================================
+3. Internal variable *internal-variables* *E121*
+ *E461*
+An internal variable name can be made up of letters, digits and '_'. But it
+cannot start with a digit. It's also possible to use curly braces, see
+|curly-braces-names|.
+
+An internal variable is created with the ":let" command |:let|.
+An internal variable is destroyed with the ":unlet" command |:unlet|.
+Using a name that isn't an internal variable, or an internal variable that has
+been destroyed, results in an error.
+
+There are several name spaces for variables. Which one is to be used is
+specified by what is prepended:
+
+ (nothing) In a function: local to a function; otherwise: global
+|buffer-variable| b: Local to the current buffer.
+|window-variable| w: Local to the current window.
+|global-variable| g: Global.
+|local-variable| l: Local to a function.
+|script-variable| s: Local to a |:source|'ed Vim script.
+|function-argument| a: Function argument (only inside a function).
+|vim-variable| v: Global, predefined by Vim.
+
+ *buffer-variable* *b:var*
+A variable name that is preceded with "b:" is local to the current buffer.
+Thus you can have several "b:foo" variables, one for each buffer.
+This kind of variable is deleted when the buffer is wiped out or deleted with
+|:bdelete|.
+
+One local buffer variable is predefined:
+ *b:changedtick-variable* *changetick*
+b:changedtick The total number of changes to the current buffer. It is
+ incremented for each change. An undo command is also a change
+ in this case. This can be used to perform an action only when
+ the buffer has changed. Example: >
+ :if my_changedtick != b:changedtick
+ : let my_changedtick = b:changedtick
+ : call My_Update()
+ :endif
+<
+ *window-variable* *w:var*
+A variable name that is preceded with "w:" is local to the current window. It
+is deleted when the window is closed.
+
+ *global-variable* *g:var*
+Inside functions global variables are accessed with "g:". Omitting this will
+access a variable local to a function. But "g:" can also be used in any other
+place if you like.
+
+ *local-variable* *l:var*
+Inside functions local variables are accessed without prepending anything.
+But you can also prepend "l:" if you like.
+
+ *script-variable* *s:var*
+In a Vim script variables starting with "s:" can be used. They cannot be
+accessed from outside of the scripts, thus are local to the script.
+
+They can be used in:
+- commands executed while the script is sourced
+- functions defined in the script
+- autocommands defined in the script
+- functions and autocommands defined in functions and autocommands which were
+ defined in the script (recursively)
+- user defined commands defined in the script
+Thus not in:
+- other scripts sourced from this one
+- mappings
+- etc.
+
+script variables can be used to avoid conflicts with global variable names.
+Take this example:
+
+ let s:counter = 0
+ function MyCounter()
+ let s:counter = s:counter + 1
+ echo s:counter
+ endfunction
+ command Tick call MyCounter()
+
+You can now invoke "Tick" from any script, and the "s:counter" variable in
+that script will not be changed, only the "s:counter" in the script where
+"Tick" was defined is used.
+
+Another example that does the same: >
+
+ let s:counter = 0
+ command Tick let s:counter = s:counter + 1 | echo s:counter
+
+When calling a function and invoking a user-defined command, the context for
+script varialbes is set to the script where the function or command was
+defined.
+
+The script variables are also available when a function is defined inside a
+function that is defined in a script. Example: >
+
+ let s:counter = 0
+ function StartCounting(incr)
+ if a:incr
+ function MyCounter()
+ let s:counter = s:counter + 1
+ endfunction
+ else
+ function MyCounter()
+ let s:counter = s:counter - 1
+ endfunction
+ endif
+ endfunction
+
+This defines the MyCounter() function either for counting up or counting down
+when calling StartCounting(). It doesn't matter from where StartCounting() is
+called, the s:counter variable will be accessible in MyCounter().
+
+When the same script is sourced again it will use the same script variables.
+They will remain valid as long as Vim is running. This can be used to
+maintain a counter: >
+
+ if !exists("s:counter")
+ let s:counter = 1
+ echo "script executed for the first time"
+ else
+ let s:counter = s:counter + 1
+ echo "script executed " . s:counter . " times now"
+ endif
+
+Note that this means that filetype plugins don't get a different set of script
+variables for each buffer. Use local buffer variables instead |b:var|.
+
+
+Predefined Vim variables: *vim-variable* *v:var*
+
+ *v:charconvert_from* *charconvert_from-variable*
+v:charconvert_from
+ The name of the character encoding of a file to be converted.
+ Only valid while evaluating the 'charconvert' option.
+
+ *v:charconvert_to* *charconvert_to-variable*
+v:charconvert_to
+ The name of the character encoding of a file after conversion.
+ Only valid while evaluating the 'charconvert' option.
+
+ *v:cmdarg* *cmdarg-variable*
+v:cmdarg This variable is used for two purposes:
+ 1. The extra arguments given to a file read/write command.
+ Currently these are "++enc=" and "++ff=". This variable is
+ set before an autocommand event for a file read/write
+ command is triggered. There is a leading space to make it
+ possible to append this variable directly after the
+ read/write command. Note: The "+cmd" argument isn't
+ included here, because it will be executed anyway.
+ 2. When printing a PostScript file with ":hardcopy" this is
+ the argument for the ":hardcopy" command. This can be used
+ in 'printexpr'.
+
+ *v:cmdbang* *cmdbang-variable*
+v:cmdbang Set like v:cmdarg for a file read/write command. When a "!"
+ was used the value is 1, otherwise it is 0. Note that this
+ can only be used in autocommands. For user commands |<bang>|
+ can be used.
+
+ *v:count* *count-variable*
+v:count The count given for the last Normal mode command. Can be used
+ to get the count before a mapping. Read-only. Example: >
+ :map _x :<C-U>echo "the count is " . v:count<CR>
+< Note: The <C-U> is required to remove the line range that you
+ get when typing ':' after a count.
+ "count" also works, for backwards compatibility.
+
+ *v:count1* *count1-variable*
+v:count1 Just like "v:count", but defaults to one when no count is
+ used.
+
+ *v:ctype* *ctype-variable*
+v:ctype The current locale setting for characters of the runtime
+ environment. This allows Vim scripts to be aware of the
+ current locale encoding. Technical: it's the value of
+ LC_CTYPE. When not using a locale the value is "C".
+ This variable can not be set directly, use the |:language|
+ command.
+ See |multi-lang|.
+
+ *v:dying* *dying-variable*
+v:dying Normally zero. When a deadly signal is caught it's set to
+ one. When multiple signals are caught the number increases.
+ Can be used in an autocommand to check if Vim didn't
+ terminate normally. {only works on Unix}
+ Example: >
+ :au VimLeave * if v:dying | echo "\nAAAAaaaarrrggghhhh!!!\n" | endif
+<
+ *v:errmsg* *errmsg-variable*
+v:errmsg Last given error message. It's allowed to set this variable.
+ Example: >
+ :let v:errmsg = ""
+ :silent! next
+ :if v:errmsg != ""
+ : ... handle error
+< "errmsg" also works, for backwards compatibility.
+
+ *v:exception* *exception-variable*
+v:exception The value of the exception most recently caught and not
+ finished. See also |v:throwpoint| and |throw-variables|.
+ Example: >
+ :try
+ : throw "oops"
+ :catch /.*/
+ : echo "caught" v:exception
+ :endtry
+< Output: "caught oops".
+
+ *v:fname_in* *fname_in-variable*
+v:fname_in The name of the input file. Only valid while evaluating:
+ option used for ~
+ 'charconvert' file to be converted
+ 'diffexpr' original file
+ 'patchexpr' original file
+ 'printexpr' file to be printed
+
+ *v:fname_out* *fname_out-variable*
+v:fname_out The name of the output file. Only valid while
+ evaluating:
+ option used for ~
+ 'charconvert' resulting converted file (*)
+ 'diffexpr' output of diff
+ 'patchexpr' resulting patched file
+ (*) When doing conversion for a write command (e.g., ":w
+ file") it will be equal to v:fname_in. When doing conversion
+ for a read command (e.g., ":e file") it will be a temporary
+ file and different from v:fname_in.
+
+ *v:fname_new* *fname_new-variable*
+v:fname_new The name of the new version of the file. Only valid while
+ evaluating 'diffexpr'.
+
+ *v:fname_diff* *fname_diff-variable*
+v:fname_diff The name of the diff (patch) file. Only valid while
+ evaluating 'patchexpr'.
+
+ *v:folddashes* *folddashes-variable*
+v:folddashes Used for 'foldtext': dashes representing foldlevel of a closed
+ fold.
+ Read-only. |fold-foldtext|
+
+ *v:foldlevel* *foldlevel-variable*
+v:foldlevel Used for 'foldtext': foldlevel of closed fold.
+ Read-only. |fold-foldtext|
+
+ *v:foldend* *foldend-variable*
+v:foldend Used for 'foldtext': last line of closed fold.
+ Read-only. |fold-foldtext|
+
+ *v:foldstart* *foldstart-variable*
+v:foldstart Used for 'foldtext': first line of closed fold.
+ Read-only. |fold-foldtext|
+
+ *v:lang* *lang-variable*
+v:lang The current locale setting for messages of the runtime
+ environment. This allows Vim scripts to be aware of the
+ current language. Technical: it's the value of LC_MESSAGES.
+ The value is system dependent.
+ This variable can not be set directly, use the |:language|
+ command.
+ It can be different from |v:ctype| when messages are desired
+ in a different language than what is used for character
+ encoding. See |multi-lang|.
+
+ *v:lc_time* *lc_time-variable*
+v:lc_time The current locale setting for time messages of the runtime
+ environment. This allows Vim scripts to be aware of the
+ current language. Technical: it's the value of LC_TIME.
+ This variable can not be set directly, use the |:language|
+ command. See |multi-lang|.
+
+ *v:lnum* *lnum-variable*
+v:lnum Line number for the 'foldexpr' and 'indentexpr' expressions.
+ Only valid while one of these expressions is being evaluated.
+ Read-only. |fold-expr| 'indentexpr'
+
+ *v:prevcount* *prevcount-variable*
+v:prevcount The count given for the last but one Normal mode command.
+ This is the v:count value of the previous command. Useful if
+ you want to cancel Visual mode and then use the count. >
+ :vmap % <Esc>:call MyFilter(v:prevcount)<CR>
+< Read-only.
+
+ *v:progname* *progname-variable*
+v:progname Contains the name (with path removed) with which Vim was
+ invoked. Allows you to do special initialisations for "view",
+ "evim" etc., or any other name you might symlink to Vim.
+ Read-only.
+
+ *v:register* *register-variable*
+v:register The name of the register supplied to the last normal mode
+ command. Empty if none were supplied. |getreg()| |setreg()|
+
+ *v:servername* *servername-variable*
+v:servername The resulting registered |x11-clientserver| name if any.
+ Read-only.
+
+ *v:shell_error* *shell_error-variable*
+v:shell_error Result of the last shell command. When non-zero, the last
+ shell command had an error. When zero, there was no problem.
+ This only works when the shell returns the error code to Vim.
+ The value -1 is often used when the command could not be
+ executed. Read-only.
+ Example: >
+ :!mv foo bar
+ :if v:shell_error
+ : echo 'could not rename "foo" to "bar"!'
+ :endif
+< "shell_error" also works, for backwards compatibility.
+
+ *v:statusmsg* *statusmsg-variable*
+v:statusmsg Last given status message. It's allowed to set this variable.
+
+ *v:termresponse* *termresponse-variable*
+v:termresponse The escape sequence returned by the terminal for the |t_RV|
+ termcap entry. It is set when Vim receives an escape sequence
+ that starts with ESC [ or CSI and ends in a 'c', with only
+ digits, ';' and '.' in between.
+ When this option is set, the TermResponse autocommand event is
+ fired, so that you can react to the response from the
+ terminal.
+ The response from a new xterm is: "<Esc>[ Pp ; Pv ; Pc c". Pp
+ is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
+ patch level (since this was introduced in patch 95, it's
+ always 95 or bigger). Pc is always zero.
+ {only when compiled with |+termresponse| feature}
+
+ *v:this_session* *this_session-variable*
+v:this_session Full filename of the last loaded or saved session file. See
+ |:mksession|. It is allowed to set this variable. When no
+ session file has been saved, this variable is empty.
+ "this_session" also works, for backwards compatibility.
+
+ *v:throwpoint* *throwpoint-variable*
+v:throwpoint The point where the exception most recently caught and not
+ finished was thrown. Not set when commands are typed. See
+ also |v:exception| and |throw-variables|.
+ Example: >
+ :try
+ : throw "oops"
+ :catch /.*/
+ : echo "Exception from" v:throwpoint
+ :endtry
+< Output: "Exception from test.vim, line 2"
+
+ *v:version* *version-variable*
+v:version Version number of Vim: Major version number times 100 plus
+ minor version number. Version 5.0 is 500. Version 5.1 (5.01)
+ is 501. Read-only. "version" also works, for backwards
+ compatibility.
+ Use |has()| to check if a certain patch was included, e.g.: >
+ if has("patch123")
+< Note that patch numbers are specific to the version, thus both
+ version 5.0 and 5.1 may have a patch 123, but these are
+ completely different.
+
+ *v:warningmsg* *warningmsg-variable*
+v:warningmsg Last given warning message. It's allowed to set this variable.
+
+==============================================================================
+4. Builtin Functions *functions*
+
+See |function-list| for a list grouped by what the function is used for.
+
+(Use CTRL-] on the function name to jump to the full explanation)
+
+USAGE RESULT DESCRIPTION ~
+
+append( {lnum}, {string}) Number append {string} below line {lnum}
+argc() Number number of files in the argument list
+argidx() Number current index in the argument list
+argv( {nr}) String {nr} entry of the argument list
+browse( {save}, {title}, {initdir}, {default})
+ String put up a file requester
+bufexists( {expr}) Number TRUE if buffer {expr} exists
+buflisted( {expr}) Number TRUE if buffer {expr} is listed
+bufloaded( {expr}) Number TRUE if buffer {expr} is loaded
+bufname( {expr}) String Name of the buffer {expr}
+bufnr( {expr}) Number Number of the buffer {expr}
+bufwinnr( {expr}) Number window number of buffer {expr}
+byte2line( {byte}) Number line number at byte count {byte}
+char2nr( {expr}) Number ASCII value of first char in {expr}
+cindent( {lnum}) Number C indent for line {lnum}
+col( {expr}) Number column nr of cursor or mark
+confirm( {msg} [, {choices} [, {default} [, {type}]]])
+ Number number of choice picked by user
+cscope_connection( [{num} , {dbpath} [, {prepend}]])
+ Number checks existence of cscope connection
+cursor( {lnum}, {col}) Number position cursor at {lnum}, {col}
+delete( {fname}) Number delete file {fname}
+did_filetype() Number TRUE if FileType autocommand event used
+escape( {string}, {chars}) String escape {chars} in {string} with '\'
+eventhandler( ) Number TRUE if inside an event handler
+executable( {expr}) Number 1 if executable {expr} exists
+exists( {expr}) Number TRUE if {expr} exists
+expand( {expr}) String expand special keywords in {expr}
+filereadable( {file}) Number TRUE if {file} is a readable file
+filewritable( {file}) Number TRUE if {file} is a writable file
+fnamemodify( {fname}, {mods}) String modify file name
+foldclosed( {lnum}) Number first line of fold at {lnum} if closed
+foldclosedend( {lnum}) Number last line of fold at {lnum} if closed
+foldlevel( {lnum}) Number fold level at {lnum}
+foldtext( ) String line displayed for closed fold
+foreground( ) Number bring the Vim window to the foreground
+getchar( [expr]) Number get one character from the user
+getcharmod( ) Number modifiers for the last typed character
+getbufvar( {expr}, {varname}) variable {varname} in buffer {expr}
+getcmdline() String return the current command-line
+getcmdpos() Number return cursor position in command-line
+getcwd() String the current working directory
+getfsize( {fname}) Number size in bytes of file
+getftime( {fname}) Number last modification time of file
+getline( {lnum}) String line {lnum} from current buffer
+getreg( [{regname}]) String contents of register
+getregtype( [{regname}]) String type of register
+getwinposx() Number X coord in pixels of GUI Vim window
+getwinposy() Number Y coord in pixels of GUI Vim window
+getwinvar( {nr}, {varname}) variable {varname} in window {nr}
+glob( {expr}) String expand file wildcards in {expr}
+globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path}
+has( {feature}) Number TRUE if feature {feature} supported
+hasmapto( {what} [, {mode}]) Number TRUE if mapping to {what} exists
+histadd( {history},{item}) String add an item to a history
+histdel( {history} [, {item}]) String remove an item from a history
+histget( {history} [, {index}]) String get the item {index} from a history
+histnr( {history}) Number highest index of a history
+hlexists( {name}) Number TRUE if highlight group {name} exists
+hlID( {name}) Number syntax ID of highlight group {name}
+hostname() String name of the machine Vim is running on
+iconv( {expr}, {from}, {to}) String convert encoding of {expr}
+indent( {lnum}) Number indent of line {lnum}
+input( {prompt} [, {text}]) String get input from the user
+inputdialog( {p} [, {t} [, {c}]]) String like input() but in a GUI dialog
+inputrestore() Number restore typeahead
+inputsave() Number save and clear typeahead
+inputsecret( {prompt} [, {text}]) String like input() but hiding the text
+isdirectory( {directory}) Number TRUE if {directory} is a directory
+libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
+libcallnr( {lib}, {func}, {arg}) Number idem, but return a Number
+line( {expr}) Number line nr of cursor, last line or mark
+line2byte( {lnum}) Number byte count of line {lnum}
+lispindent( {lnum}) Number Lisp indent for line {lnum}
+localtime() Number current time
+maparg( {name}[, {mode}]) String rhs of mapping {name} in mode {mode}
+mapcheck( {name}[, {mode}]) String check for mappings matching {name}
+match( {expr}, {pat}[, {start}])
+ Number position where {pat} matches in {expr}
+matchend( {expr}, {pat}[, {start}])
+ Number position where {pat} ends in {expr}
+matchstr( {expr}, {pat}[, {start}])
+ String match of {pat} in {expr}
+mode() String current editing mode
+nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
+nr2char( {expr}) String single char with ASCII value {expr}
+prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
+remote_expr( {server}, {string} [, {idvar}])
+ String send expression
+remote_foreground( {server}) Number bring Vim server to the foreground
+remote_peek( {serverid} [, {retvar}])
+ Number check for reply string
+remote_read( {serverid}) String read reply string
+remote_send( {server}, {string} [, {idvar}])
+ String send key sequence
+rename( {from}, {to}) Number rename (move) file from {from} to {to}
+resolve( {filename}) String get filename a shortcut points to
+search( {pattern} [, {flags}]) Number search for {pattern}
+searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]])
+ Number search for other end of start/end pair
+server2client( {clientid}, {string})
+ Number send reply string
+serverlist() String get a list of available servers
+setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
+setcmdpos( {pos}) Number set cursor position in command-line
+setline( {lnum}, {line}) Number set line {lnum} to {line}
+setreg( {n}, {v}[, {opt}]) Number set register to value and type
+setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
+simplify( {filename}) String simplify filename as much as possible
+strftime( {format}[, {time}]) String time in specified format
+stridx( {haystack}, {needle}) Number first index of {needle} in {haystack}
+strlen( {expr}) Number length of the String {expr}
+strpart( {src}, {start}[, {len}])
+ String {len} characters of {src} at {start}
+strridx( {haystack}, {needle}) Number last index of {needle} in {haystack}
+strtrans( {expr}) String translate string to make it printable
+submatch( {nr}) String specific match in ":substitute"
+substitute( {expr}, {pat}, {sub}, {flags})
+ String all {pat} in {expr} replaced with {sub}
+synID( {line}, {col}, {trans}) Number syntax ID at {line} and {col}
+synIDattr( {synID}, {what} [, {mode}])
+ String attribute {what} of syntax ID {synID}
+synIDtrans( {synID}) Number translated syntax ID of {synID}
+system( {expr}) String output of shell command {expr}
+tempname() String name for a temporary file
+tolower( {expr}) String the String {expr} switched to lowercase
+toupper( {expr}) String the String {expr} switched to uppercase
+type( {name}) Number type of variable {name}
+virtcol( {expr}) Number screen column of cursor or mark
+visualmode( [expr]) String last visual mode used
+winbufnr( {nr}) Number buffer number of window {nr}
+wincol() Number window column of the cursor
+winheight( {nr}) Number height of window {nr}
+winline() Number window line of the cursor
+winnr() Number number of current window
+winrestcmd() String returns command to restore window sizes
+winwidth( {nr}) Number width of window {nr}
+
+append({lnum}, {string}) *append()*
+ Append the text {string} after line {lnum} in the current
+ buffer. {lnum} can be zero, to insert a line before the first
+ one. Returns 1 for failure ({lnum} out of range) or 0 for
+ success.
+
+ *argc()*
+argc() The result is the number of files in the argument list of the
+ current window. See |arglist|.
+
+ *argidx()*
+argidx() The result is the current index in the argument list. 0 is
+ the first file. argc() - 1 is the last one. See |arglist|.
+
+ *argv()*
+argv({nr}) The result is the {nr}th file in the argument list of the
+ current window. See |arglist|. "argv(0)" is the first one.
+ Example: >
+ :let i = 0
+ :while i < argc()
+ : let f = escape(argv(i), '. ')
+ : exe 'amenu Arg.' . f . ' :e ' . f . '<CR>'
+ : let i = i + 1
+ :endwhile
+<
+ *browse()*
+browse({save}, {title}, {initdir}, {default})
+ Put up a file requester. This only works when "has("browse")"
+ returns non-zero (only in some GUI versions).
+ The input fields are:
+ {save} when non-zero, select file to write
+ {title} title for the requester
+ {initdir} directory to start browsing in
+ {default} default file name
+ When the "Cancel" button is hit, something went wrong, or
+ browsing is not possible, an empty string is returned.
+
+bufexists({expr}) *bufexists()*
+ The result is a Number, which is non-zero if a buffer called
+ {expr} exists.
+ If the {expr} argument is a string it must match a buffer name
+ exactly.
+ If the {expr} argument is a number buffer numbers are used.
+ Unlisted buffers will be found.
+ Note that help files are listed by their short name in the
+ output of |:buffers|, but bufexists() requires using their
+ long name to be able to find them.
+ Use "bufexists(0)" to test for the existence of an alternate
+ file name.
+ *buffer_exists()*
+ Obsolete name: buffer_exists().
+
+buflisted({expr}) *buflisted()*
+ The result is a Number, which is non-zero if a buffer called
+ {expr} exists and is listed (has the 'buflisted' option set).
+ The {expr} argument is used like with bufexists().
+
+bufloaded({expr}) *bufloaded()*
+ The result is a Number, which is non-zero if a buffer called
+ {expr} exists and is loaded (shown in a window or hidden).
+ The {expr} argument is used like with bufexists().
+
+bufname({expr}) *bufname()*
+ The result is the name of a buffer, as it is displayed by the
+ ":ls" command.
+ If {expr} is a Number, that buffer number's name is given.
+ Number zero is the alternate buffer for the current window.
+ If {expr} is a String, it is used as a |file-pattern| to match
+ with the buffer names. This is always done like 'magic' is
+ set and 'cpoptions' is empty. When there is more than one
+ match an empty string is returned.
+ "" or "%" can be used for the current buffer, "#" for the
+ alternate buffer.
+ A full match is preferred, otherwise a match at the start, end
+ or middle of the buffer name is accepted.
+ Listed buffers are found first. If there is a single match
+ with a listed buffer, that one is returned. Next unlisted
+ buffers are searched for.
+ If the {expr} is a String, but you want to use it as a buffer
+ number, force it to be a Number by adding zero to it: >
+ :echo bufname("3" + 0)
+< If the buffer doesn't exist, or doesn't have a name, an empty
+ string is returned. >
+ bufname("#") alternate buffer name
+ bufname(3) name of buffer 3
+ bufname("%") name of current buffer
+ bufname("file2") name of buffer where "file2" matches.
+< *buffer_name()*
+ Obsolete name: buffer_name().
+
+ *bufnr()*
+bufnr({expr}) The result is the number of a buffer, as it is displayed by
+ the ":ls" command. For the use of {expr}, see |bufname()|
+ above. If the buffer doesn't exist, -1 is returned.
+ bufnr("$") is the last buffer: >
+ :let last_buffer = bufnr("$")
+< The result is a Number, which is the highest buffer number
+ of existing buffers. Note that not all buffers with a smaller
+ number necessarily exist, because ":bwipeout" may have removed
+ them. Use bufexists() to test for the existence of a buffer.
+ *buffer_number()*
+ Obsolete name: buffer_number().
+ *last_buffer_nr()*
+ Obsolete name for bufnr("$"): last_buffer_nr().
+
+bufwinnr({expr}) *bufwinnr()*
+ The result is a Number, which is the number of the first
+ window associated with buffer {expr}. For the use of {expr},
+ see |bufname()| above. If buffer {expr} doesn't exist or
+ there is no such window, -1 is returned. Example: >
+
+ echo "A window containing buffer 1 is " . (bufwinnr(1))
+
+< The number can be used with |CTRL-W_w| and ":wincmd w"
+ |:wincmd|.
+
+
+byte2line({byte}) *byte2line()*
+ Return the line number that contains the character at byte
+ count {byte} in the current buffer. This includes the
+ end-of-line character, depending on the 'fileformat' option
+ for the current buffer. The first character has byte count
+ one.
+ Also see |line2byte()|, |go| and |:goto|.
+ {not available when compiled without the |+byte_offset|
+ feature}
+
+char2nr({expr}) *char2nr()*
+ Return number value of the first char in {expr}. Examples: >
+ char2nr(" ") returns 32
+ char2nr("ABC") returns 65
+< The current 'encoding' is used. Example for "utf-8": >
+ char2nr("á") returns 225
+ char2nr("á"[0]) returns 195
+
+cindent({lnum}) *cindent()*
+ Get the amount of indent for line {lnum} according the C
+ indenting rules, as with 'cindent'.
+ The indent is counted in spaces, the value of 'tabstop' is
+ relevant. {lnum} is used just like in |getline()|.
+ When {lnum} is invalid or Vim was not compiled the |+cindent|
+ feature, -1 is returned.
+
+ *col()*
+col({expr}) The result is a Number, which is the column of the file
+ position given with {expr}. The accepted positions are:
+ . the cursor position
+ $ the end of the cursor line (the result is the
+ number of characters in the cursor line plus one)
+ 'x position of mark x (if the mark is not set, 0 is
+ returned)
+ For the screen column position use |virtcol()|.
+ Note that only marks in the current file can be used.
+ Examples: >
+ col(".") column of cursor
+ col("$") length of cursor line plus one
+ col("'t") column of mark t
+ col("'" . markname) column of mark markname
+< The first column is 1. 0 is returned for an error.
+ For the cursor position, when 'virtualedit' is active, the
+ column is one higher if the cursor is after the end of the
+ line. This can be used to obtain the column in Insert mode: >
+ :imap <F2> <C-O>:let save_ve = &ve<CR>
+ \<C-O>:set ve=all<CR>
+ \<C-O>:echo col(".") . "\n" <Bar>
+ \let &ve = save_ve<CR>
+<
+ *confirm()*
+confirm({msg} [, {choices} [, {default} [, {type}]]])
+ Confirm() offers the user a dialog, from which a choice can be
+ made. It returns the number of the choice. For the first
+ choice this is 1.
+ Note: confirm() is only supported when compiled with dialog
+ support, see |+dialog_con| and |+dialog_gui|.
+ {msg} is displayed in a |dialog| with {choices} as the
+ alternatives. When {choices} is missing or empty, "&OK" is
+ used (and translated).
+ {msg} is a String, use '\n' to include a newline. Only on
+ some systems the string is wrapped when it doesn't fit.
+ {choices} is a String, with the individual choices separated
+ by '\n', e.g. >
+ confirm("Save changes?", "&Yes\n&No\n&Cancel")
+< The letter after the '&' is the shortcut key for that choice.
+ Thus you can type 'c' to select "Cancel". The shortcut does
+ not need to be the first letter: >
+ confirm("file has been modified", "&Save\nSave &All")
+< For the console, the first letter of each choice is used as
+ the default shortcut key.
+ The optional {default} argument is the number of the choice
+ that is made if the user hits <CR>. Use 1 to make the first
+ choice the default one. Use 0 to not set a default. If
+ {default} is omitted, 1 is used.
+ The optional {type} argument gives the type of dialog. This
+ is only used for the icon of the Win32 GUI. It can be one of
+ these values: "Error", "Question", "Info", "Warning" or
+ "Generic". Only the first character is relevant. When {type}
+ is omitted, "Generic" is used.
+ If the user aborts the dialog by pressing <Esc>, CTRL-C,
+ or another valid interrupt key, confirm() returns 0.
+
+ An example: >
+ :let choice = confirm("What do you want?", "&Apples\n&Oranges\n&Bananas", 2)
+ :if choice == 0
+ : echo "make up your mind!"
+ :elseif choice == 3
+ : echo "tasteful"
+ :else
+ : echo "I prefer bananas myself."
+ :endif
+< In a GUI dialog, buttons are used. The layout of the buttons
+ depends on the 'v' flag in 'guioptions'. If it is included,
+ the buttons are always put vertically. Otherwise, confirm()
+ tries to put the buttons in one horizontal line. If they
+ don't fit, a vertical layout is used anyway. For some systems
+ the horizontal layout is always used.
+
+ *cscope_connection()*
+cscope_connection([{num} , {dbpath} [, {prepend}]])
+ Checks for the existence of a |cscope| connection. If no
+ parameters are specified, then the function returns:
+ 0, if cscope was not available (not compiled in), or
+ if there are no cscope connections;
+ 1, if there is at least one cscope connection.
+
+ If parameters are specified, then the value of {num}
+ determines how existence of a cscope connection is checked:
+
+ {num} Description of existence check
+ ----- ------------------------------
+ 0 Same as no parameters (e.g., "cscope_connection()").
+ 1 Ignore {prepend}, and use partial string matches for
+ {dbpath}.
+ 2 Ignore {prepend}, and use exact string matches for
+ {dbpath}.
+ 3 Use {prepend}, use partial string matches for both
+ {dbpath} and {prepend}.
+ 4 Use {prepend}, use exact string matches for both
+ {dbpath} and {prepend}.
+
+ Note: All string comparisons are case sensitive!
+
+ Examples. Suppose we had the following (from ":cs show"): >
+
+ # pid database name prepend path
+ 0 27664 cscope.out /usr/local
+<
+ Invocation Return Val ~
+ ---------- ---------- >
+ cscope_connection() 1
+ cscope_connection(1, "out") 1
+ cscope_connection(2, "out") 0
+ cscope_connection(3, "out") 0
+ cscope_connection(3, "out", "local") 1
+ cscope_connection(4, "out") 0
+ cscope_connection(4, "out", "local") 0
+ cscope_connection(4, "cscope.out", "/usr/local") 1
+<
+cursor({lnum}, {col}) *cursor()*
+ Positions the cursor at the column {col} in the line {lnum}.
+ Does not change the jumplist.
+ If {lnum} is greater than the number of lines in the buffer,
+ the cursor will be positioned at the last line in the buffer.
+ If {lnum} is zero, the cursor will stay in the current line.
+ If {col} is greater than the number of characters in the line,
+ the cursor will be positioned at the last character in the
+ line.
+ If {col} is zero, the cursor will stay in the current column.
+
+ *delete()*
+delete({fname}) Deletes the file by the name {fname}. The result is a Number,
+ which is 0 if the file was deleted successfully, and non-zero
+ when the deletion failed.
+
+ *did_filetype()*
+did_filetype() Returns non-zero when autocommands are being executed and the
+ FileType event has been triggered at least once. Can be used
+ to avoid triggering the FileType event again in the scripts
+ that detect the file type. |FileType|
+ When editing another file, the counter is reset, thus this
+ really checks if the FileType event has been triggered for the
+ current buffer. This allows an autocommand that starts
+ editing another buffer to set 'filetype' and load a syntax
+ file.
+
+escape({string}, {chars}) *escape()*
+ Escape the characters in {chars} that occur in {string} with a
+ backslash. Example: >
+ :echo escape('c:\program files\vim', ' \')
+< results in: >
+ c:\\program\ files\\vim
+<
+eventhandler() *eventhandler()*
+ Returns 1 when inside an event handler. That is that Vim got
+ interrupted while waiting for the user to type a character,
+ e.g., when dropping a file on Vim. This means interactive
+ commands cannot be used. Otherwise zero is returned.
+
+executable({expr}) *executable()*
+ This function checks if an executable with the name {expr}
+ exists. {expr} must be the name of the program without any
+ arguments. executable() uses the normal $PATH.
+ The result is a Number:
+ 1 exists
+ 0 does not exist
+ -1 not implemented on this system
+
+ *exists()*
+exists({expr}) The result is a Number, which is non-zero if {expr} is
+ defined, zero otherwise. The {expr} argument is a string,
+ which contains one of these:
+ &option-name Vim option (only checks if it exists,
+ not if it really works)
+ +option-name Vim option that works.
+ $ENVNAME environment variable (could also be
+ done by comparing with an empty
+ string)
+ *funcname built-in function (see |functions|)
+ or user defined function (see
+ |user-functions|).
+ varname internal variable (see
+ |internal-variables|). Does not work
+ for |curly-braces-names|.
+ :cmdname Ex command: built-in command, user
+ command or command modifier |:command|.
+ Returns:
+ 1 for match with start of a command
+ 2 full match with a command
+ 3 matches several user commands
+ To check for a supported command
+ always check the return value to be 2.
+ #event autocommand defined for this event
+ #event#pattern autocommand defined for this event and
+ pattern (the pattern is taken
+ literally and compared to the
+ autocommand patterns character by
+ character)
+ For checking for a supported feature use |has()|.
+
+ Examples: >
+ exists("&shortname")
+ exists("$HOSTNAME")
+ exists("*strftime")
+ exists("*s:MyFunc")
+ exists("bufcount")
+ exists(":Make")
+ exists("#CursorHold");
+ exists("#BufReadPre#*.gz")
+< There must be no space between the symbol (&/$/*/#) and the
+ name.
+ Note that the argument must be a string, not the name of the
+ variable itself! For example: >
+ exists(bufcount)
+< This doesn't check for existence of the "bufcount" variable,
+ but gets the contents of "bufcount", and checks if that
+ exists.
+
+expand({expr} [, {flag}]) *expand()*
+ Expand wildcards and the following special keywords in {expr}.
+ The result is a String.
+
+ When there are several matches, they are separated by <NL>
+ characters. [Note: in version 5.0 a space was used, which
+ caused problems when a file name contains a space]
+
+ If the expansion fails, the result is an empty string. A name
+ for a non-existing file is not included.
+
+ When {expr} starts with '%', '#' or '<', the expansion is done
+ like for the |cmdline-special| variables with their associated
+ modifiers. Here is a short overview:
+
+ % current file name
+ # alternate file name
+ #n alternate file name n
+ <cfile> file name under the cursor
+ <afile> autocmd file name
+ <abuf> autocmd buffer number (as a String!)
+ <amatch> autocmd matched name
+ <sfile> sourced script file name
+ <cword> word under the cursor
+ <cWORD> WORD under the cursor
+ <client> the {clientid} of the last received
+ message |server2client()|
+ Modifiers:
+ :p expand to full path
+ :h head (last path component removed)
+ :t tail (last path component only)
+ :r root (one extension removed)
+ :e extension only
+
+ Example: >
+ :let &tags = expand("%:p:h") . "/tags"
+< Note that when expanding a string that starts with '%', '#' or
+ '<', any following text is ignored. This does NOT work: >
+ :let doesntwork = expand("%:h.bak")
+< Use this: >
+ :let doeswork = expand("%:h") . ".bak"
+< Also note that expanding "<cfile>" and others only returns the
+ referenced file name without further expansion. If "<cfile>"
+ is "~/.cshrc", you need to do another expand() to have the
+ "~/" expanded into the path of the home directory: >
+ :echo expand(expand("<cfile>"))
+<
+ There cannot be white space between the variables and the
+ following modifier. The |fnamemodify()| function can be used
+ to modify normal file names.
+
+ When using '%' or '#', and the current or alternate file name
+ is not defined, an empty string is used. Using "%:p" in a
+ buffer with no name, results in the current directory, with a
+ '/' added.
+
+ When {expr} does not start with '%', '#' or '<', it is
+ expanded like a file name is expanded on the command line.
+ 'suffixes' and 'wildignore' are used, unless the optional
+ {flag} argument is given and it is non-zero. Names for
+ non-existing files are included.
+
+ Expand() can also be used to expand variables and environment
+ variables that are only known in a shell. But this can be
+ slow, because a shell must be started. See |expr-env-expand|.
+ The expanded variable is still handled like a list of file
+ names. When an environment variable cannot be expanded, it is
+ left unchanged. Thus ":echo expand('$FOOBAR')" results in
+ "$FOOBAR".
+
+ See |glob()| for finding existing files. See |system()| for
+ getting the raw output of an external command.
+
+filereadable({file}) *filereadable()*
+ The result is a Number, which is TRUE when a file with the
+ name {file} exists, and can be read. If {file} doesn't exist,
+ or is a directory, the result is FALSE. {file} is any
+ expression, which is used as a String.
+ *file_readable()*
+ Obsolete name: file_readable().
+
+filewritable({file}) *filewritable()*
+ The result is a Number, which is 1 when a file with the
+ name {file} exists, and can be written. If {file} doesn't
+ exist, or is not writable, the result is 0. If (file) is a
+ directory, and we can write to it, the result is 2.
+
+fnamemodify({fname}, {mods}) *fnamemodify()*
+ Modify file name {fname} according to {mods}. {mods} is a
+ string of characters like it is used for file names on the
+ command line. See |filename-modifiers|.
+ Example: >
+ :echo fnamemodify("main.c", ":p:h")
+< results in: >
+ /home/mool/vim/vim/src
+< Note: Environment variables and "~" don't work in {fname}, use
+ |expand()| first then.
+
+foldclosed({lnum}) *foldclosed()*
+ The result is a Number. If the line {lnum} is in a closed
+ fold, the result is the number of the first line in that fold.
+ If the line {lnum} is not in a closed fold, -1 is returned.
+
+foldclosedend({lnum}) *foldclosedend()*
+ The result is a Number. If the line {lnum} is in a closed
+ fold, the result is the number of the last line in that fold.
+ If the line {lnum} is not in a closed fold, -1 is returned.
+
+foldlevel({lnum}) *foldlevel()*
+ The result is a Number, which is the foldlevel of line {lnum}
+ in the current buffer. For nested folds the deepest level is
+ returned. If there is no fold at line {lnum}, zero is
+ returned. It doesn't matter if the folds are open or closed.
+ When used while updating folds (from 'foldexpr') -1 is
+ returned for lines where folds are still to be updated and the
+ foldlevel is unknown. As a special case the level of the
+ previous line is usually available.
+
+ *foldtext()*
+foldtext() Returns a String, to be displayed for a closed fold. This is
+ the default function used for the 'foldtext' option and should
+ only be called from evaluating 'foldtext'. It uses the
+ |v:foldstart|, |v:foldend| and |v:folddashes| variables.
+ The returned string looks like this: >
+ +-- 45 lines: abcdef
+< The number of dashes depends on the foldlevel. The "45" is
+ the number of lines in the fold. "abcdef" is the text in the
+ first non-blank line of the fold. Leading white space, "//"
+ or "/*" and the text from the 'foldmarker' and 'commentstring'
+ options is removed.
+ {not available when compiled without the |+folding| feature}
+
+ *foreground()*
+foreground() Move the Vim window to the foreground. Useful when sent from
+ a client to a Vim server. |remote_send()|
+ On Win32 systems this might not work, the OS does not always
+ allow a window to bring itself to the foreground. Use
+ |remote_foreground()| instead.
+ {only in the Win32, Athena, Motif and GTK GUI versions and the
+ Win32 console version}
+
+getchar([expr]) *getchar()*
+ Get a single character from the user. If it is an 8-bit
+ character, the result is a number. Otherwise a String is
+ returned with the encoded character. For a special key it's a
+ sequence of bytes starting with 0x80 (decimal: 128).
+ If [expr] is omitted, wait until a character is available.
+ If [expr] is 0, only get a character when one is available.
+ If [expr] is 1, only check if a character is available, it is
+ not consumed. If a normal character is
+ available, it is returned, otherwise a
+ non-zero value is returned.
+ If a normal character available, it is returned as a Number.
+ Use nr2char() to convert it to a String.
+ The returned value is zero if no character is available.
+ The returned value is a string of characters for special keys
+ and when a modifier (shift, control, alt) was used.
+ There is no prompt, you will somehow have to make clear to the
+ user that a character has to be typed.
+ There is no mapping for the character.
+ Key codes are replaced, thus when the user presses the <Del>
+ key you get the code for the <Del> key, not the raw character
+ sequence. Examples: >
+ getchar() == "\<Del>"
+ getchar() == "\<S-Left>"
+< This example redefines "f" to ignore case: >
+ :nmap f :call FindChar()<CR>
+ :function FindChar()
+ : let c = nr2char(getchar())
+ : while col('.') < col('$') - 1
+ : normal l
+ : if getline('.')[col('.') - 1] ==? c
+ : break
+ : endif
+ : endwhile
+ :endfunction
+
+getcharmod() *getcharmod()*
+ The result is a Number which is the state of the modifiers for
+ the last obtained character with getchar() or in another way.
+ These values are added together:
+ 2 shift
+ 4 control
+ 8 alt (meta)
+ 16 mouse double click
+ 32 mouse triple click
+ 64 mouse quadruple click
+ 128 Macintosh only: command
+ Only the modifiers that have not been included in the
+ character itself are obtained. Thus Shift-a results in "A"
+ with no modifier.
+
+getbufvar({expr}, {varname}) *getbufvar()*
+ The result is the value of option or local buffer variable
+ {varname} in buffer {expr}. Note that the name without "b:"
+ must be used.
+ This also works for a global or local window option, but it
+ doesn't work for a global or local window variable.
+ For the use of {expr}, see |bufname()| above.
+ When the buffer or variable doesn't exist an empty string is
+ returned, there is no error message.
+ Examples: >
+ :let bufmodified = getbufvar(1, "&mod")
+ :echo "todo myvar = " . getbufvar("todo", "myvar")
+<
+getcmdline() *getcmdline()*
+ Return the current command-line. Only works when the command
+ line is being edited, thus requires use of |c_CTRL-\_e| or
+ |c_CTRL-R_=|.
+ Example: >
+ :cmap <F7> <C-\>eescape(getcmdline(), ' \')<CR>
+< Also see |getcmdpos()| and |setcmdpos()|.
+
+getcmdpos({pos}) *getcmdpos()*
+ Return the position of the cursor in the command line as a
+ byte count. The first column is 1.
+ Only works when editing the command line, thus requires use of
+ |c_CTRL-\_e| or |c_CTRL-R_=|. Returns 0 otherwise.
+ Also see |setcmdpos()| and |getcmdline()|.
+
+ *getcwd()*
+getcwd() The result is a String, which is the name of the current
+ working directory.
+
+getfsize({fname}) *getfsize()*
+ The result is a Number, which is the size in bytes of the
+ given file {fname}.
+ If {fname} is a directory, 0 is returned.
+ If the file {fname} can't be found, -1 is returned.
+
+getftime({fname}) *getftime()*
+ The result is a Number, which is the last modification time of
+ the given file {fname}. The value is measured as seconds
+ since 1st Jan 1970, and may be passed to strftime(). See also
+ |localtime()| and |strftime()|.
+ If the file {fname} can't be found -1 is returned.
+
+ *getline()*
+getline({lnum}) The result is a String, which is line {lnum} from the current
+ buffer. Example: >
+ getline(1)
+< When {lnum} is a String that doesn't start with a
+ digit, line() is called to translate the String into a Number.
+ To get the line under the cursor: >
+ getline(".")
+< When {lnum} is smaller than 1 or bigger than the number of
+ lines in the buffer, an empty string is returned.
+
+getreg([{regname}]) *getreg()*
+ The result is a String, which is the contents of register
+ {regname}. Example: >
+ :let cliptext = getreg('*')
+< getreg('=') returns the last evaluated value of the expression
+ register. (For use in maps).
+ If {regname} is not specified, |v:register| is used.
+
+getregtype([{regname}]) *getregtype()*
+ The result is a String, which is type of register {regname}.
+ The value will be one of:
+ "v" for |characterwise| text
+ "V" for |linewise| text
+ "<CTRL-V>{width}" for |blockwise-visual| text
+ 0 for an empty or unknown register
+ <CTRL-V> is one character with value 0x16.
+ If {regname} is not specified, |v:register| is used.
+
+ *getwinposx()*
+getwinposx() The result is a Number, which is the X coordinate in pixels of
+ the left hand side of the GUI Vim window. The result will be
+ -1 if the information is not available.
+
+ *getwinposy()*
+getwinposy() The result is a Number, which is the Y coordinate in pixels of
+ the top of the GUI Vim window. The result will be -1 if the
+ information is not available.
+
+getwinvar({nr}, {varname}) *getwinvar()*
+ The result is the value of option or local window variable
+ {varname} in window {nr}.
+ This also works for a global or local buffer option, but it
+ doesn't work for a global or local buffer variable.
+ Note that the name without "w:" must be used.
+ Examples: >
+ :let list_is_on = getwinvar(2, '&list')
+ :echo "myvar = " . getwinvar(1, 'myvar')
+<
+ *glob()*
+glob({expr}) Expand the file wildcards in {expr}. The result is a String.
+ When there are several matches, they are separated by <NL>
+ characters.
+ If the expansion fails, the result is an empty string.
+ A name for a non-existing file is not included.
+
+ For most systems backticks can be used to get files names from
+ any external command. Example: >
+ :let tagfiles = glob("`find . -name tags -print`")
+ :let &tags = substitute(tagfiles, "\n", ",", "g")
+< The result of the program inside the backticks should be one
+ item per line. Spaces inside an item are allowed.
+
+ See |expand()| for expanding special Vim variables. See
+ |system()| for getting the raw output of an external command.
+
+globpath({path}, {expr}) *globpath()*
+ Perform glob() on all directories in {path} and concatenate
+ the results. Example: >
+ :echo globpath(&rtp, "syntax/c.vim")
+< {path} is a comma-separated list of directory names. Each
+ directory name is prepended to {expr} and expanded like with
+ glob(). A path separator is inserted when needed.
+ To add a comma inside a directory name escape it with a
+ backslash. Note that on MS-Windows a directory may have a
+ trailing backslash, remove it if you put a comma after it.
+ If the expansion fails for one of the directories, there is no
+ error message.
+ The 'wildignore' option applies: Names matching one of the
+ patterns in 'wildignore' will be skipped.
+
+ *has()*
+has({feature}) The result is a Number, which is 1 if the feature {feature} is
+ supported, zero otherwise. The {feature} argument is a
+ string. See |feature-list| below.
+ Also see |exists()|.
+
+hasmapto({what} [, {mode}]) *hasmapto()*
+ The result is a Number, which is 1 if there is a mapping that
+ contains {what} in somewhere in the rhs (what it is mapped to)
+ and this mapping exists in one of the modes indicated by
+ {mode}.
+ Both the global mappings and the mappings local to the current
+ buffer are checked for a match.
+ If no matching mapping is found 0 is returned.
+ The following characters are recognized in {mode}:
+ n Normal mode
+ v Visual mode
+ o Operator-pending mode
+ i Insert mode
+ l Language-Argument ("r", "f", "t", etc.)
+ c Command-line mode
+ When {mode} is omitted, "nvo" is used.
+
+ This function is useful to check if a mapping already exists
+ to a function in a Vim script. Example: >
+ :if !hasmapto('\ABCdoit')
+ : map <Leader>d \ABCdoit
+ :endif
+< This installs the mapping to "\ABCdoit" only if there isn't
+ already a mapping to "\ABCdoit".
+
+histadd({history}, {item}) *histadd()*
+ Add the String {item} to the history {history} which can be
+ one of: *hist-names*
+ "cmd" or ":" command line history
+ "search" or "/" search pattern history
+ "expr" or "=" typed expression history
+ "input" or "@" input line history
+ If {item} does already exist in the history, it will be
+ shifted to become the newest entry.
+ The result is a Number: 1 if the operation was successful,
+ otherwise 0 is returned.
+
+ Example: >
+ :call histadd("input", strftime("%Y %b %d"))
+ :let date=input("Enter date: ")
+< This function is not available in the |sandbox|.
+
+histdel({history} [, {item}]) *histdel()*
+ Clear {history}, ie. delete all its entries. See |hist-names|
+ for the possible values of {history}.
+
+ If the parameter {item} is given as String, this is seen
+ as regular expression. All entries matching that expression
+ will be removed from the history (if there are any).
+ Upper/lowercase must match, unless "\c" is used |/\c|.
+ If {item} is a Number, it will be interpreted as index, see
+ |:history-indexing|. The respective entry will be removed
+ if it exists.
+
+ The result is a Number: 1 for a successful operation,
+ otherwise 0 is returned.
+
+ Examples:
+ Clear expression register history: >
+ :call histdel("expr")
+<
+ Remove all entries starting with "*" from the search history: >
+ :call histdel("/", '^\*')
+<
+ The following three are equivalent: >
+ :call histdel("search", histnr("search"))
+ :call histdel("search", -1)
+ :call histdel("search", '^'.histget("search", -1).'$')
+<
+ To delete the last search pattern and use the last-but-one for
+ the "n" command and 'hlsearch': >
+ :call histdel("search", -1)
+ :let @/ = histget("search", -1)
+
+histget({history} [, {index}]) *histget()*
+ The result is a String, the entry with Number {index} from
+ {history}. See |hist-names| for the possible values of
+ {history}, and |:history-indexing| for {index}. If there is
+ no such entry, an empty String is returned. When {index} is
+ omitted, the most recent item from the history is used.
+
+ Examples:
+ Redo the second last search from history. >
+ :execute '/' . histget("search", -2)
+
+< Define an Ex command ":H {num}" that supports re-execution of
+ the {num}th entry from the output of |:history|. >
+ :command -nargs=1 H execute histget("cmd", 0+<args>)
+<
+histnr({history}) *histnr()*
+ The result is the Number of the current entry in {history}.
+ See |hist-names| for the possible values of {history}.
+ If an error occurred, -1 is returned.
+
+ Example: >
+ :let inp_index = histnr("expr")
+<
+hlexists({name}) *hlexists()*
+ The result is a Number, which is non-zero if a highlight group
+ called {name} exists. This is when the group has been
+ defined in some way. Not necessarily when highlighting has
+ been defined for it, it may also have been used for a syntax
+ item.
+ *highlight_exists()*
+ Obsolete name: highlight_exists().
+
+ *hlID()*
+hlID({name}) The result is a Number, which is the ID of the highlight group
+ with name {name}. When the highlight group doesn't exist,
+ zero is returned.
+ This can be used to retrieve information about the highlight
+ group. For example, to get the background color of the
+ "Comment" group: >
+ :echo synIDattr(synIDtrans(hlID("Comment")), "bg")
+< *highlightID()*
+ Obsolete name: highlightID().
+
+hostname() *hostname()*
+ The result is a String, which is the name of the machine on
+ which Vim is currently running. Machine names greater than
+ 256 characters long are truncated.
+
+iconv({expr}, {from}, {to}) *iconv()*
+ The result is a String, which is the text {expr} converted
+ from encoding {from} to encoding {to}.
+ When the conversion fails an empty string is returned.
+ The encoding names are whatever the iconv() library function
+ can accept, see ":!man 3 iconv".
+ Most conversions require Vim to be compiled with the |+iconv|
+ feature. Otherwise only UTF-8 to latin1 conversion and back
+ can be done.
+ This can be used to display messages with special characters,
+ no matter what 'encoding' is set to. Write the message in
+ UTF-8 and use: >
+ echo iconv(utf8_str, "utf-8", &enc)
+< Note that Vim uses UTF-8 for all Unicode encodings, conversion
+ from/to UCS-2 is automatically changed to use UTF-8. You
+ cannot use UCS-2 in a string anyway, because of the NUL bytes.
+ {only available when compiled with the +multi_byte feature}
+
+ *indent()*
+indent({lnum}) The result is a Number, which is indent of line {lnum} in the
+ current buffer. The indent is counted in spaces, the value
+ of 'tabstop' is relevant. {lnum} is used just like in
+ |getline()|.
+ When {lnum} is invalid -1 is returned.
+
+input({prompt} [, {text}]) *input()*
+ The result is a String, which is whatever the user typed on
+ the command-line. The parameter is either a prompt string, or
+ a blank string (for no prompt). A '\n' can be used in the
+ prompt to start a new line. The highlighting set with
+ |:echohl| is used for the prompt. The input is entered just
+ like a command-line, with the same editing commands and
+ mappings. There is a separate history for lines typed for
+ input().
+ If the optional {text} is present, this is used for the
+ default reply, as if the user typed this.
+ NOTE: This must not be used in a startup file, for the
+ versions that only run in GUI mode (e.g., the Win32 GUI).
+ Note: When input() is called from within a mapping it will
+ consume remaining characters from that mapping, because a
+ mapping is handled like the characters were typed.
+ Use |inputsave()| before input() and |inputrestore()|
+ after input() to avoid that. Another solution is to avoid
+ that further characters follow in the mapping, e.g., by using
+ |:execute| or |:normal|.
+
+ Example: >
+ :if input("Coffee or beer? ") == "beer"
+ : echo "Cheers!"
+ :endif
+< Example with default text: >
+ :let color = input("Color? ", "white")
+< Example with a mapping: >
+ :nmap \x :call GetFoo()<CR>:exe "/" . Foo<CR>
+ :function GetFoo()
+ : call inputsave()
+ : let g:Foo = input("enter search pattern: ")
+ : call inputrestore()
+ :endfunction
+
+inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
+ Like input(), but when the GUI is running and text dialogs are
+ supported, a dialog window pops up to input the text.
+ Example: >
+ :let n = inputdialog("value for shiftwidth", &sw)
+ :if n != ""
+ : let &sw = n
+ :endif
+< When the dialog is cancelled {cancelreturn} is returned. When
+ omitted an empty string is returned.
+ Hitting <Enter> works like pressing the OK button. Hitting
+ <Esc> works like pressing the Cancel button.
+
+inputrestore() *inputrestore()*
+ Restore typeahead that was saved with a previous inputsave().
+ Should be called the same number of times inputsave() is
+ called. Calling it more often is harmless though.
+ Returns 1 when there is nothing to restore, 0 otherwise.
+
+inputsave() *inputsave()*
+ Preserve typeahead (also from mappings) and clear it, so that
+ a following prompt gets input from the user. Should be
+ followed by a matching inputrestore() after the prompt. Can
+ be used several times, in which case there must be just as
+ many inputrestore() calls.
+ Returns 1 when out of memory, 0 otherwise.
+
+inputsecret({prompt} [, {text}]) *inputsecret()*
+ This function acts much like the |input()| function with but
+ two exceptions:
+ a) the user's response will be displayed as a sequence of
+ asterisks ("*") thereby keeping the entry secret, and
+ b) the user's response will not be recorded on the input
+ |history| stack.
+ The result is a String, which is whatever the user actually
+ typed on the command-line in response to the issued prompt.
+
+isdirectory({directory}) *isdirectory()*
+ The result is a Number, which is non-zero when a directory
+ with the name {directory} exists. If {directory} doesn't
+ exist, or isn't a directory, the result is FALSE. {directory}
+ is any expression, which is used as a String.
+
+ *libcall()* *E364* *E368*
+libcall({libname}, {funcname}, {argument})
+ Call function {funcname} in the run-time library {libname}
+ with single argument {argument}.
+ This is useful to call functions in a library that you
+ especially made to be used with Vim. Since only one argument
+ is possible, calling standard library functions is rather
+ limited.
+ The result is the String returned by the function. If the
+ function returns NULL, this will appear as an empty string ""
+ to Vim.
+ If the function returns a number, use libcallnr()!
+ If {argument} is a number, it is passed to the function as an
+ int; if {argument} is a string, it is passed as a
+ null-terminated string.
+ This function will fail in |restricted-mode|.
+
+ libcall() allows you to write your own 'plug-in' extensions to
+ Vim without having to recompile the program. It is NOT a
+ means to call system functions! If you try to do so Vim will
+ very probably crash.
+
+ For Win32, the functions you write must be placed in a DLL
+ and use the normal C calling convention (NOT Pascal which is
+ used in Windows System DLLs). The function must take exactly
+ one parameter, either a character pointer or a long integer,
+ and must return a character pointer or NULL. The character
+ pointer returned must point to memory that will remain valid
+ after the function has returned (e.g. in static data in the
+ DLL). If it points to allocated memory, that memory will
+ leak away. Using a static buffer in the function should work,
+ it's then freed when the DLL is unloaded.
+
+ WARNING: If the function returns a non-valid pointer, Vim may
+ crash! This also happens if the function returns a number,
+ because Vim thinks it's a pointer.
+ For Win32 systems, {libname} should be the filename of the DLL
+ without the ".DLL" suffix. A full path is only required if
+ the DLL is not in the usual places.
+ For Unix: When compiling your own plugins, remember that the
+ object code must be compiled as position-independent ('PIC').
+ {only in Win32 on some Unix versions, when the |+libcall|
+ feature is present}
+ Examples: >
+ :echo libcall("libc.so", "getenv", "HOME")
+ :echo libcallnr("/usr/lib/libc.so", "getpid", "")
+<
+ *libcallnr()*
+libcallnr({libname}, {funcname}, {argument})
+ Just like libcall(), but used for a function that returns an
+ int instead of a string.
+ {only in Win32 on some Unix versions, when the |+libcall|
+ feature is present}
+ Example (not very useful...): >
+ :call libcallnr("libc.so", "printf", "Hello World!\n")
+ :call libcallnr("libc.so", "sleep", 10)
+<
+ *line()*
+line({expr}) The result is a Number, which is the line number of the file
+ position given with {expr}. The accepted positions are:
+ . the cursor position
+ $ the last line in the current buffer
+ 'x position of mark x (if the mark is not set, 0 is
+ returned)
+ Note that only marks in the current file can be used.
+ Examples: >
+ line(".") line number of the cursor
+ line("'t") line number of mark t
+ line("'" . marker) line number of mark marker
+< *last-position-jump*
+ This autocommand jumps to the last known position in a file
+ just after opening it, if the '" mark is set: >
+ :au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
+<
+line2byte({lnum}) *line2byte()*
+ Return the byte count from the start of the buffer for line
+ {lnum}. This includes the end-of-line character, depending on
+ the 'fileformat' option for the current buffer. The first
+ line returns 1.
+ This can also be used to get the byte count for the line just
+ below the last line: >
+ line2byte(line("$") + 1)
+< This is the file size plus one.
+ When {lnum} is invalid, or the |+byte_offset| feature has been
+ disabled at compile time, -1 is returned.
+ Also see |byte2line()|, |go| and |:goto|.
+
+lispindent({lnum}) *lispindent()*
+ Get the amount of indent for line {lnum} according the lisp
+ indenting rules, as with 'lisp'.
+ The indent is counted in spaces, the value of 'tabstop' is
+ relevant. {lnum} is used just like in |getline()|.
+ When {lnum} is invalid or Vim was not compiled the
+ |+lispindent| feature, -1 is returned.
+
+localtime() *localtime()*
+ Return the current time, measured as seconds since 1st Jan
+ 1970. See also |strftime()| and |getftime()|.
+
+maparg({name}[, {mode}]) *maparg()*
+ Return the rhs of mapping {name} in mode {mode}. When there
+ is no mapping for {name}, an empty String is returned.
+ These characters can be used for {mode}:
+ "n" Normal
+ "v" Visual
+ "o" Operator-pending
+ "i" Insert
+ "c" Cmd-line
+ "l" langmap |language-mapping|
+ "" Normal, Visual and Operator-pending
+ When {mode} is omitted, the modes from "" are used.
+ The {name} can have special key names, like in the ":map"
+ command. The returned String has special characters
+ translated like in the output of the ":map" command listing.
+ The mappings local to the current buffer are checked first,
+ then the global mappings.
+
+mapcheck({name}[, {mode}]) *mapcheck()*
+ Check if there is a mapping that matches with {name} in mode
+ {mode}. See |maparg()| for {mode} and special names in
+ {name}.
+ A match happens with a mapping that starts with {name} and
+ with a mapping which is equal to the start of {name}.
+
+ matches mapping "a" "ab" "abc" ~
+ mapcheck("a") yes yes yes
+ mapcheck("abc") yes yes yes
+ mapcheck("ax") yes no no
+ mapcheck("b") no no no
+
+ The difference with maparg() is that mapcheck() finds a
+ mapping that matches with {name}, while maparg() only finds a
+ mapping for {name} exactly.
+ When there is no mapping that starts with {name}, an empty
+ String is returned. If there is one, the rhs of that mapping
+ is returned. If there are several mappings that start with
+ {name}, the rhs of one of them is returned.
+ The mappings local to the current buffer are checked first,
+ then the global mappings.
+ This function can be used to check if a mapping can be added
+ without being ambiguous. Example: >
+ :if mapcheck("_vv") == ""
+ : map _vv :set guifont=7x13<CR>
+ :endif
+< This avoids adding the "_vv" mapping when there already is a
+ mapping for "_v" or for "_vvv".
+
+match({expr}, {pat}[, {start}]) *match()*
+ The result is a Number, which gives the index (byte offset) in
+ {expr} where {pat} matches. A match at the first character
+ returns zero. If there is no match -1 is returned. Example: >
+ :echo match("testing", "ing")
+< results in "4".
+ See |string-match| for how {pat} is used.
+ If {start} is given, the search starts from index {start}.
+ The result, however, is still the index counted from the
+ first character. Example: >
+ :echo match("testing", "ing", 2)
+< result is again "4". >
+ :echo match("testing", "ing", 4)
+< result is again "4". >
+ :echo match("testing", "t", 2)
+< result is "3".
+ If {start} < 0, it will be set to 0.
+ If {start} > strlen({expr}) -1 is returned.
+ See |pattern| for the patterns that are accepted.
+ The 'ignorecase' option is used to set the ignore-caseness of
+ the pattern. 'smartcase' is NOT used. The matching is always
+ done like 'magic' is set and 'cpoptions' is empty.
+
+matchend({expr}, {pat}[, {start}]) *matchend()*
+ Same as match(), but return the index of first character after
+ the match. Example: >
+ :echo matchend("testing", "ing")
+< results in "7".
+ The {start}, if given, has the same meaning as for match(). >
+ :echo matchend("testing", "ing", 2)
+< results in "7". >
+ :echo matchend("testing", "ing", 5)
+< result is "-1".
+
+matchstr({expr}, {pat}[, {start}]) *matchstr()*
+ Same as match(), but return the matched string. Example: >
+ :echo matchstr("testing", "ing")
+< results in "ing".
+ When there is no match "" is returned.
+ The {start}, if given, has the same meaning as for match(). >
+ :echo matchstr("testing", "ing", 2)
+< results in "ing". >
+ :echo matchstr("testing", "ing", 5)
+< result is "".
+
+ *mode()*
+mode() Return a string that indicates the current mode:
+ n Normal
+ v Visual by character
+ V Visual by line
+ CTRL-V Visual blockwise
+ s Select by character
+ S Select by line
+ CTRL-S Select blockwise
+ i Insert
+ R Replace
+ c Command-line
+ r Hit-enter prompt
+ This is useful in the 'statusline' option. In most other
+ places it always returns "c" or "n".
+
+nextnonblank({lnum}) *nextnonblank()*
+ Return the line number of the first line at or below {lnum}
+ that is not blank. Example: >
+ if getline(nextnonblank(1)) =~ "Java"
+< When {lnum} is invalid or there is no non-blank line at or
+ below it, zero is returned.
+ See also |prevnonblank()|.
+
+nr2char({expr}) *nr2char()*
+ Return a string with a single character, which has the number
+ value {expr}. Examples: >
+ nr2char(64) returns "@"
+ nr2char(32) returns " "
+< The current 'encoding' is used. Example for "utf-8": >
+ nr2char(300) returns I with bow character
+< Note that a NUL character in the file is specified with
+ nr2char(10), because NULs are represented with newline
+ characters. nr2char(0) is a real NUL and terminates the
+ string, thus isn't very useful.
+
+prevnonblank({lnum}) *prevnonblank()*
+ Return the line number of the first line at or above {lnum}
+ that is not blank. Example: >
+ let ind = indent(prevnonblank(v:lnum - 1))
+< When {lnum} is invalid or there is no non-blank line at or
+ above it, zero is returned.
+ Also see |nextnonblank()|.
+
+ *remote_expr()* *E449*
+remote_expr({server}, {string} [, {idvar}])
+ Send the {string} to {server}. The string is sent as an
+ expression and the result is returned after evaluation.
+ If {idvar} is present, it is taken as the name of a
+ variable and a {serverid} for later use with
+ remote_read() is stored there.
+ See also |clientserver| |RemoteReply|.
+ This function is not available in the |sandbox|.
+ {only available when compiled with the |+clientserver| feature}
+ Note: Any errors will cause a local error message to be issued
+ and the result will be the empty string.
+ Examples: >
+ :echo remote_expr("gvim", "2+2")
+ :echo remote_expr("gvim1", "b:current_syntax")
+<
+
+remote_foreground({server}) *remote_foreground()*
+ Move the Vim server with the name {server} to the foreground.
+ This works like: >
+ remote_expr({server}, "foreground()")
+< Except that on Win32 systems the client does the work, to work
+ around the problem that the OS doesn't always allow the server
+ to bring itself to the foreground.
+ This function is not available in the |sandbox|.
+ {only in the Win32, Athena, Motif and GTK GUI versions and the
+ Win32 console version}
+
+
+remote_peek({serverid} [, {retvar}]) *remote_peek()*
+ Returns a positive number if there are available strings
+ from {serverid}. Copies any reply string into the variable
+ {retvar} if specified. {retvar} must be a string with the
+ name of a variable.
+ Returns zero if none are available.
+ Returns -1 if something is wrong.
+ See also |clientserver|.
+ This function is not available in the |sandbox|.
+ {only available when compiled with the |+clientserver| feature}
+ Examples: >
+ :let repl = ""
+ :echo "PEEK: ".remote_peek(id, "repl").": ".repl
+
+remote_read({serverid}) *remote_read()*
+ Return the oldest available reply from {serverid} and consume
+ it. It blocks until a reply is available.
+ See also |clientserver|.
+ This function is not available in the |sandbox|.
+ {only available when compiled with the |+clientserver| feature}
+ Example: >
+ :echo remote_read(id)
+<
+ *remote_send()* *E241*
+remote_send({server}, {string} [, {idvar}])
+ Send the {string} to {server}. The string is sent as
+ input keys and the function returns immediately.
+ If {idvar} is present, it is taken as the name of a
+ variable and a {serverid} for later use with
+ remote_read() is stored there.
+ See also |clientserver| |RemoteReply|.
+ This function is not available in the |sandbox|.
+ {only available when compiled with the |+clientserver| feature}
+ Note: Any errors will be reported in the server and may mess
+ up the display.
+ Examples: >
+ :echo remote_send("gvim", ":DropAndReply ".file, "serverid").
+ \ remote_read(serverid)
+
+ :autocmd NONE RemoteReply *
+ \ echo remote_read(expand("<amatch>"))
+ :echo remote_send("gvim", ":sleep 10 | echo ".
+ \ 'server2client(expand("<client>"), "HELLO")<CR>')
+
+
+rename({from}, {to}) *rename()*
+ Rename the file by the name {from} to the name {to}. This
+ should also work to move files across file systems. The
+ result is a Number, which is 0 if the file was renamed
+ successfully, and non-zero when the renaming failed.
+ This function is not available in the |sandbox|.
+
+resolve({filename}) *resolve()* *E655*
+ On MS-Windows, when {filename} is a shortcut (a .lnk file),
+ returns the path the shortcut points to in a simplified form.
+ On Unix, repeat resolving symbolic links in all path
+ components of {filename} and return the simplified result.
+ To cope with link cycles, resolving of symbolic links is
+ stopped after 100 iterations.
+ On other systems, return the simplified {filename}.
+ The simplification step is done as by |simplify()|.
+ resolve() keeps a leading path component specifying the
+ current directory (provided the result is still a relative
+ path name) and also keeps a trailing path separator.
+
+search({pattern} [, {flags}]) *search()*
+ Search for regexp pattern {pattern}. The search starts at the
+ cursor position.
+ {flags} is a String, which can contain these character flags:
+ 'b' search backward instead of forward
+ 'w' wrap around the end of the file
+ 'W' don't wrap around the end of the file
+ If neither 'w' or 'W' is given, the 'wrapscan' option applies.
+
+ When a match has been found its line number is returned, and
+ the cursor will be positioned at the match. If there is no
+ match a 0 is returned and the cursor doesn't move. No error
+ message is given.
+
+ Example (goes over all files in the argument list): >
+ :let n = 1
+ :while n <= argc() " loop over all files in arglist
+ : exe "argument " . n
+ : " start at the last char in the file and wrap for the
+ : " first search to find match at start of file
+ : normal G$
+ : let flags = "w"
+ : while search("foo", flags) > 0
+ : s/foo/bar/g
+ : let flags = "W"
+ : endwhile
+ : update " write the file if modified
+ : let n = n + 1
+ :endwhile
+<
+ *searchpair()*
+searchpair({start}, {middle}, {end} [, {flags} [, {skip}]])
+ Search for the match of a nested start-end pair. This can be
+ used to find the "endif" that matches an "if", while other
+ if/endif pairs in between are ignored.
+ The search starts at the cursor. If a match is found, the
+ cursor is positioned at it and the line number is returned.
+ If no match is found 0 or -1 is returned and the cursor
+ doesn't move. No error message is given.
+
+ {start}, {middle} and {end} are patterns, see |pattern|. They
+ must not contain \( \) pairs. Use of \%( \) is allowed. When
+ {middle} is not empty, it is found when searching from either
+ direction, but only when not in a nested start-end pair. A
+ typical use is: >
+ searchpair('\<if\>', '\<else\>', '\<endif\>')
+< By leaving {middle} empty the "else" is skipped.
+
+ {flags} are used like with |search()|. Additionally:
+ 'n' do Not move the cursor
+ 'r' Repeat until no more matches found; will find the
+ outer pair
+ 'm' return number of Matches instead of line number with
+ the match; will only be > 1 when 'r' is used.
+
+ When a match for {start}, {middle} or {end} is found, the
+ {skip} expression is evaluated with the cursor positioned on
+ the start of the match. It should return non-zero if this
+ match is to be skipped. E.g., because it is inside a comment
+ or a string.
+ When {skip} is omitted or empty, every match is accepted.
+ When evaluating {skip} causes an error the search is aborted
+ and -1 returned.
+
+ The value of 'ignorecase' is used. 'magic' is ignored, the
+ patterns are used like it's on.
+
+ The search starts exactly at the cursor. A match with
+ {start}, {middle} or {end} at the next character, in the
+ direction of searching, is the first one found. Example: >
+ if 1
+ if 2
+ endif 2
+ endif 1
+< When starting at the "if 2", with the cursor on the "i", and
+ searching forwards, the "endif 2" is found. When starting on
+ the character just before the "if 2", the "endif 1" will be
+ found. That's because the "if 2" will be found first, and
+ then this is considered to be a nested if/endif from "if 2" to
+ "endif 2".
+ When searching backwards and {end} is more than one character,
+ it may be useful to put "\zs" at the end of the pattern, so
+ that when the cursor is inside a match with the end it finds
+ the matching start.
+
+ Example, to find the "endif" command in a Vim script: >
+
+ :echo searchpair('\<if\>', '\<el\%[seif]\>', '\<en\%[dif]\>', 'W',
+ \ 'getline(".") =~ "^\\s*\""')
+
+< The cursor must be at or after the "if" for which a match is
+ to be found. Note that single-quote strings are used to avoid
+ having to double the backslashes. The skip expression only
+ catches comments at the start of a line, not after a command.
+ Also, a word "en" or "if" halfway a line is considered a
+ match.
+ Another example, to search for the matching "{" of a "}": >
+
+ :echo searchpair('{', '', '}', 'bW')
+
+< This works when the cursor is at or before the "}" for which a
+ match is to be found. To reject matches that syntax
+ highlighting recognized as strings: >
+
+ :echo searchpair('{', '', '}', 'bW',
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"')
+<
+server2client( {clientid}, {string}) *server2client()*
+ Send a reply string to {clientid}. The most recent {clientid}
+ that sent a string can be retrieved with expand("<client>").
+ {only available when compiled with the |+clientserver| feature}
+ Note:
+ This id has to be stored before the next command can be
+ received. Ie. before returning from the received command and
+ before calling any commands that waits for input.
+ See also |clientserver|.
+ Example: >
+ :echo server2client(expand("<client>"), "HELLO")
+<
+serverlist() *serverlist()*
+ Return a list of available server names, one per line.
+ When there are no servers or the information is not available
+ an empty string is returned. See also |clientserver|.
+ {only available when compiled with the |+clientserver| feature}
+ Example: >
+ :echo serverlist()
+<
+setbufvar({expr}, {varname}, {val}) *setbufvar()*
+ Set option or local variable {varname} in buffer {expr} to
+ {val}.
+ This also works for a global or local window option, but it
+ doesn't work for a global or local window variable.
+ For a local window option the global value is unchanged.
+ For the use of {expr}, see |bufname()| above.
+ Note that the variable name without "b:" must be used.
+ Examples: >
+ :call setbufvar(1, "&mod", 1)
+ :call setbufvar("todo", "myvar", "foobar")
+< This function is not available in the |sandbox|.
+
+setcmdpos({pos}) *setcmdpos()*
+ Set the cursor position in the command line to byte position
+ {pos}. The first position is 1.
+ Use |getcmdpos()| to obtain the current position.
+ Only works while editing the command line, thus you must use
+ |c_CTRL-\_e| or |c_CTRL-R_=|. The position is set after the
+ command line is set to the expression.
+ When the number is too big the cursor is put at the end of the
+ line. A number smaller than one has undefined results.
+ Returns 0 when successful, 1 when not editing the command
+ line.
+
+setline({lnum}, {line}) *setline()*
+ Set line {lnum} of the current buffer to {line}. If this
+ succeeds, 0 is returned. If this fails (most likely because
+ {lnum} is invalid) 1 is returned. Example: >
+ :call setline(5, strftime("%c"))
+< Note: The '[ and '] marks are not set.
+
+ *setreg()*
+setreg({regname}, {value} [,{options}])
+ Set the register {regname} to {value}.
+ If {options} contains "a" or {regname} is upper case,
+ then the value is appended.
+ {options} can also contains a register type specification:
+ "c" or "v" |characterwise| mode
+ "l" or "V" |linewise| mode
+ "b" or "<CTRL-V>" |blockwise-visual| mode
+ If a number immediately follows "b" or "<CTRL-V>" then this is
+ used as the width of the selection - if it is not specified
+ then the width of the block is set to the number of characters
+ in the longest line (counting a <TAB> as 1 character).
+
+ If {options} contains no register settings, then the default
+ is to use character mode unless {value} ends in a <NL>.
+ Setting the '=' register is not possible.
+ Returns zero for success, non-zero for failure.
+
+ Examples: >
+ :call setreg(v:register, @*)
+ :call setreg('*', @%, 'ac')
+ :call setreg('a', "1\n2\n3", 'b5')
+
+< This example shows using the functions to save and restore a
+ register. >
+ :let var_a = getreg('a')
+ :let var_amode = getregtype('a')
+ ....
+ :call setreg('a', var_a, var_amode)
+
+< You can also change the type of a register by appending
+ nothing: >
+ :call setreg('a', '', 'al')
+
+setwinvar({nr}, {varname}, {val}) *setwinvar()*
+ Set option or local variable {varname} in window {nr} to
+ {val}.
+ This also works for a global or local buffer option, but it
+ doesn't work for a global or local buffer variable.
+ For a local buffer option the global value is unchanged.
+ Note that the variable name without "w:" must be used.
+ Examples: >
+ :call setwinvar(1, "&list", 0)
+ :call setwinvar(2, "myvar", "foobar")
+< This function is not available in the |sandbox|.
+
+simplify({filename}) *simplify()*
+ Simplify the file name as much as possible without changing
+ the meaning. Shortcuts (on MS-Windows) or symbolic links (on
+ Unix) are not resolved. If the first path component in
+ {filename} designates the current directory, this will be
+ valid for the result as well. A trailing path separator is
+ not removed either.
+ Example: >
+ simplify("./dir/.././/file/") == "./file/"
+< Note: The combination "dir/.." is only removed if "dir" is
+ a searchable directory or does not exist. On Unix, it is also
+ removed when "dir" is a symbolic link within the same
+ directory. In order to resolve all the involved symbolic
+ links before simplifying the path name, use |resolve()|.
+
+strftime({format} [, {time}]) *strftime()*
+ The result is a String, which is a formatted date and time, as
+ specified by the {format} string. The given {time} is used,
+ or the current time if no time is given. The accepted
+ {format} depends on your system, thus this is not portable!
+ See the manual page of the C function strftime() for the
+ format. The maximum length of the result is 80 characters.
+ See also |localtime()| and |getftime()|.
+ The language can be changed with the |:language| command.
+ Examples: >
+ :echo strftime("%c") Sun Apr 27 11:49:23 1997
+ :echo strftime("%Y %b %d %X") 1997 Apr 27 11:53:25
+ :echo strftime("%y%m%d %T") 970427 11:53:55
+ :echo strftime("%H:%M") 11:55
+ :echo strftime("%c", getftime("file.c"))
+ Show mod time of file.c.
+<
+stridx({haystack}, {needle}) *stridx()*
+ The result is a Number, which gives the index in {haystack} of
+ the first occurrence of the String {needle} in the String
+ {haystack}. The search is done case-sensitive. For advanced
+ searches use |match()|.
+ If the {needle} does not occur in {haystack} it returns -1.
+ See also |strridx()|. Examples: >
+ :echo stridx("An Example", "Example") 3
+ :echo stridx("Starting point", "Start") 0
+ :echo stridx("Starting point", "start") -1
+<
+ *strlen()*
+strlen({expr}) The result is a Number, which is the length of the String
+ {expr} in bytes. If you want to count the number of
+ multi-byte characters use something like this: >
+
+ :let len = strlen(substitute(str, ".", "x", "g"))
+
+< Composing characters are not counted.
+
+strpart({src}, {start}[, {len}]) *strpart()*
+ The result is a String, which is part of {src}, starting from
+ byte {start}, with the length {len}.
+ When non-existing bytes are included, this doesn't result in
+ an error, the bytes are simply omitted.
+ If {len} is missing, the copy continues from {start} till the
+ end of the {src}. >
+ strpart("abcdefg", 3, 2) == "de"
+ strpart("abcdefg", -2, 4) == "ab"
+ strpart("abcdefg", 5, 4) == "fg"
+ strpart("abcdefg", 3) == "defg"
+< Note: To get the first character, {start} must be 0. For
+ example, to get three bytes under and after the cursor: >
+ strpart(getline(line(".")), col(".") - 1, 3)
+<
+strridx({haystack}, {needle}) *strridx()*
+ The result is a Number, which gives the index in {haystack} of
+ the last occurrence of the String {needle} in the String
+ {haystack}. The search is done case-sensitive. For advanced
+ searches use |match()|.
+ If the {needle} does not occur in {haystack} it returns -1.
+ See also |stridx()|. Examples: >
+ :echo strridx("an angry armadillo", "an") 3
+<
+strtrans({expr}) *strtrans()*
+ The result is a String, which is {expr} with all unprintable
+ characters translated into printable characters |'isprint'|.
+ Like they are shown in a window. Example: >
+ echo strtrans(@a)
+< This displays a newline in register a as "^@" instead of
+ starting a new line.
+
+submatch({nr}) *submatch()*
+ Only for an expression in a |:substitute| command. Returns
+ the {nr}'th submatch of the matched text. When {nr} is 0
+ the whole matched text is returned.
+ Example: >
+ :s/\d\+/\=submatch(0) + 1/
+< This finds the first number in the line and adds one to it.
+ A line break is included as a newline character.
+
+substitute({expr}, {pat}, {sub}, {flags}) *substitute()*
+ The result is a String, which is a copy of {expr}, in which
+ the first match of {pat} is replaced with {sub}. This works
+ like the ":substitute" command (without any flags). But the
+ matching with {pat} is always done like the 'magic' option is
+ set and 'cpoptions' is empty (to make scripts portable).
+ See |string-match| for how {pat} is used.
+ And a "~" in {sub} is not replaced with the previous {sub}.
+ Note that some codes in {sub} have a special meaning
+ |sub-replace-special|. For example, to replace something with
+ "\n" (two characters), use "\\\\n" or '\\n'.
+ When {pat} does not match in {expr}, {expr} is returned
+ unmodified.
+ When {flags} is "g", all matches of {pat} in {expr} are
+ replaced. Otherwise {flags} should be "".
+ Example: >
+ :let &path = substitute(&path, ",\\=[^,]*$", "", "")
+< This removes the last component of the 'path' option. >
+ :echo substitute("testing", ".*", "\\U\\0", "")
+< results in "TESTING".
+
+synID({line}, {col}, {trans}) *synID()*
+ The result is a Number, which is the syntax ID at the position
+ {line} and {col} in the current window.
+ The syntax ID can be used with |synIDattr()| and
+ |synIDtrans()| to obtain syntax information about text.
+ {col} is 1 for the leftmost column, {line} is 1 for the first
+ line.
+ When {trans} is non-zero, transparent items are reduced to the
+ item that they reveal. This is useful when wanting to know
+ the effective color. When {trans} is zero, the transparent
+ item is returned. This is useful when wanting to know which
+ syntax item is effective (e.g. inside parens).
+ Warning: This function can be very slow. Best speed is
+ obtained by going through the file in forward direction.
+
+ Example (echoes the name of the syntax item under the cursor): >
+ :echo synIDattr(synID(line("."), col("."), 1), "name")
+<
+synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
+ The result is a String, which is the {what} attribute of
+ syntax ID {synID}. This can be used to obtain information
+ about a syntax item.
+ {mode} can be "gui", "cterm" or "term", to get the attributes
+ for that mode. When {mode} is omitted, or an invalid value is
+ used, the attributes for the currently active highlighting are
+ used (GUI, cterm or term).
+ Use synIDtrans() to follow linked highlight groups.
+ {what} result
+ "name" the name of the syntax item
+ "fg" foreground color (GUI: color name used to set
+ the color, cterm: color number as a string,
+ term: empty string)
+ "bg" background color (like "fg")
+ "fg#" like "fg", but for the GUI and the GUI is
+ running the name in "#RRGGBB" form
+ "bg#" like "fg#" for "bg"
+ "bold" "1" if bold
+ "italic" "1" if italic
+ "reverse" "1" if reverse
+ "inverse" "1" if inverse (= reverse)
+ "underline" "1" if underlined
+
+ Example (echoes the color of the syntax item under the
+ cursor): >
+ :echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg")
+<
+synIDtrans({synID}) *synIDtrans()*
+ The result is a Number, which is the translated syntax ID of
+ {synID}. This is the syntax group ID of what is being used to
+ highlight the character. Highlight links given with
+ ":highlight link" are followed.
+
+ *system()*
+system({expr}) Get the output of the shell command {expr}. Note: newlines
+ in {expr} may cause the command to fail. The characters in
+ 'shellquote' and 'shellxquote' may also cause trouble.
+ This is not to be used for interactive commands.
+ The result is a String. Example: >
+
+ :let files = system("ls")
+
+< To make the result more system-independent, the shell output
+ is filtered to replace <CR> with <NL> for Macintosh, and
+ <CR><NL> with <NL> for DOS-like systems.
+ The command executed is constructed using several options:
+ 'shell' 'shellcmdflag' 'shellxquote' {expr} 'shellredir' {tmp} 'shellxquote'
+ ({tmp} is an automatically generated file name).
+ For Unix and OS/2 braces are put around {expr} to allow for
+ concatenated commands.
+
+ The resulting error code can be found in |v:shell_error|.
+ This function will fail in |restricted-mode|.
+ Unlike ":!cmd" there is no automatic check for changed files.
+ Use |:checktime| to force a check.
+
+tempname() *tempname()* *temp-file-name*
+ The result is a String, which is the name of a file that
+ doesn't exist. It can be used for a temporary file. The name
+ is different for at least 26 consecutive calls. Example: >
+ :let tmpfile = tempname()
+ :exe "redir > " . tmpfile
+< For Unix, the file will be in a private directory (only
+ accessible by the current user) to avoid security problems
+ (e.g., a symlink attack or other people reading your file).
+ When Vim exits the directory and all files in it are deleted.
+ For MS-Windows forward slashes are used when the 'shellslash'
+ option is set or when 'shellcmdflag' starts with '-'.
+
+tolower({expr}) *tolower()*
+ The result is a copy of the String given, with all uppercase
+ characters turned into lowercase (just like applying |gu| to
+ the string).
+
+toupper({expr}) *toupper()*
+ The result is a copy of the String given, with all lowercase
+ characters turned into uppercase (just like applying |gU| to
+ the string).
+
+type({expr}) *type()*
+ The result is a Number:
+ 0 if {expr} has the type Number
+ 1 if {expr} has the type String
+
+virtcol({expr}) *virtcol()*
+ The result is a Number, which is the screen column of the file
+ position given with {expr}. That is, the last screen position
+ occupied by the character at that position, when the screen
+ would be of unlimited width. When there is a <Tab> at the
+ position, the returned Number will be the column at the end of
+ the <Tab>. For example, for a <Tab> in column 1, with 'ts'
+ set to 8, it returns 8.
+ For the byte position use |col()|.
+ When Virtual editing is active in the current mode, a position
+ beyond the end of the line can be returned. |'virtualedit'|
+ The accepted positions are:
+ . the cursor position
+ $ the end of the cursor line (the result is the
+ number of displayed characters in the cursor line
+ plus one)
+ 'x position of mark x (if the mark is not set, 0 is
+ returned)
+ Note that only marks in the current file can be used.
+ Examples: >
+ virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
+ virtcol("$") with text "foo^Lbar", returns 9
+ virtcol("'t") with text " there", with 't at 'h', returns 6
+< The first column is 1. 0 is returned for an error.
+
+visualmode([expr]) *visualmode()*
+ The result is a String, which describes the last Visual mode
+ used. Initially it returns an empty string, but once Visual
+ mode has been used, it returns "v", "V", or "<CTRL-V>" (a
+ single CTRL-V character) for character-wise, line-wise, or
+ block-wise Visual mode respectively.
+ Example: >
+ :exe "normal " . visualmode()
+< This enters the same Visual mode as before. It is also useful
+ in scripts if you wish to act differently depending on the
+ Visual mode that was used.
+
+ If an expression is supplied that results in a non-zero number
+ or a non-empty string, then the Visual mode will be cleared
+ and the old value is returned. Note that " " and "0" are also
+ non-empty strings, thus cause the mode to be cleared.
+
+ *winbufnr()*
+winbufnr({nr}) The result is a Number, which is the number of the buffer
+ associated with window {nr}. When {nr} is zero, the number of
+ the buffer in the current window is returned. When window
+ {nr} doesn't exist, -1 is returned.
+ Example: >
+ :echo "The file in the current window is " . bufname(winbufnr(0))
+<
+ *wincol()*
+wincol() The result is a Number, which is the virtual column of the
+ cursor in the window. This is counting screen cells from the
+ left side of the window. The leftmost column is one.
+
+winheight({nr}) *winheight()*
+ The result is a Number, which is the height of window {nr}.
+ When {nr} is zero, the height of the current window is
+ returned. When window {nr} doesn't exist, -1 is returned.
+ An existing window always has a height of zero or more.
+ Examples: >
+ :echo "The current window has " . winheight(0) . " lines."
+<
+ *winline()*
+winline() The result is a Number, which is the screen line of the cursor
+ in the window. This is counting screen lines from the top of
+ the window. The first line is one.
+
+ *winnr()*
+winnr() The result is a Number, which is the number of the current
+ window. The top window has number 1. The number can be used
+ with |CTRL-W_w| and ":wincmd w" |:wincmd|.
+
+ *winrestcmd()*
+winrestcmd() Returns a sequence of |:resize| commands that should restore
+ the current window sizes. Only works properly when no windows
+ are opened or closed and the current window is unchanged.
+ Example: >
+ :let cmd = winrestcmd()
+ :call MessWithWindowSizes()
+ :exe cmd
+
+winwidth({nr}) *winwidth()*
+ The result is a Number, which is the width of window {nr}.
+ When {nr} is zero, the width of the current window is
+ returned. When window {nr} doesn't exist, -1 is returned.
+ An existing window always has a width of zero or more.
+ Examples: >
+ :echo "The current window has " . winwidth(0) . " columns."
+ :if winwidth(0) <= 50
+ : exe "normal 50\<C-W>|"
+ :endif
+<
+
+ *feature-list*
+There are three types of features:
+1. Features that are only supported when they have been enabled when Vim
+ was compiled |+feature-list|. Example: >
+ :if has("cindent")
+2. Features that are only supported when certain conditions have been met.
+ Example: >
+ :if has("gui_running")
+< *has-patch*
+3. Included patches. First check |v:version| for the version of Vim.
+ Then the "patch123" feature means that patch 123 has been included for
+ this version. Example (checking version 6.2.148 or later): >
+ :if v:version > 602 || v:version == 602 && has("patch148")
+
+all_builtin_terms Compiled with all builtin terminals enabled.
+amiga Amiga version of Vim.
+arabic Compiled with Arabic support |Arabic|.
+arp Compiled with ARP support (Amiga).
+autocmd Compiled with autocommands support.
+balloon_eval Compiled with |balloon-eval| support.
+beos BeOS version of Vim.
+browse Compiled with |:browse| support, and browse() will
+ work.
+builtin_terms Compiled with some builtin terminals.
+byte_offset Compiled with support for 'o' in 'statusline'
+cindent Compiled with 'cindent' support.
+clientserver Compiled with remote invocation support |clientserver|.
+clipboard Compiled with 'clipboard' support.
+cmdline_compl Compiled with |cmdline-completion| support.
+cmdline_hist Compiled with |cmdline-history| support.
+cmdline_info Compiled with 'showcmd' and 'ruler' support.
+comments Compiled with |'comments'| support.
+cryptv Compiled with encryption support |encryption|.
+cscope Compiled with |cscope| support.
+compatible Compiled to be very Vi compatible.
+debug Compiled with "DEBUG" defined.
+dialog_con Compiled with console dialog support.
+dialog_gui Compiled with GUI dialog support.
+diff Compiled with |vimdiff| and 'diff' support.
+digraphs Compiled with support for digraphs.
+dnd Compiled with support for the "~ register |quote_~|.
+dos32 32 bits DOS (DJGPP) version of Vim.
+dos16 16 bits DOS version of Vim.
+ebcdic Compiled on a machine with ebcdic character set.
+emacs_tags Compiled with support for Emacs tags.
+eval Compiled with expression evaluation support. Always
+ true, of course!
+ex_extra Compiled with extra Ex commands |+ex_extra|.
+extra_search Compiled with support for |'incsearch'| and
+ |'hlsearch'|
+farsi Compiled with Farsi support |farsi|.
+file_in_path Compiled with support for |gf| and |<cfile>|
+find_in_path Compiled with support for include file searches
+ |+find_in_path|.
+fname_case Case in file names matters (for Amiga, MS-DOS, and
+ Windows this is not present).
+folding Compiled with |folding| support.
+footer Compiled with GUI footer support. |gui-footer|
+fork Compiled to use fork()/exec() instead of system().
+gettext Compiled with message translation |multi-lang|
+gui Compiled with GUI enabled.
+gui_athena Compiled with Athena GUI.
+gui_beos Compiled with BeOs GUI.
+gui_gtk Compiled with GTK+ GUI (any version).
+gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
+gui_mac Compiled with Macintosh GUI.
+gui_motif Compiled with Motif GUI.
+gui_photon Compiled with Photon GUI.
+gui_win32 Compiled with MS Windows Win32 GUI.
+gui_win32s idem, and Win32s system being used (Windows 3.1)
+gui_running Vim is running in the GUI, or it will start soon.
+hangul_input Compiled with Hangul input support. |hangul|
+iconv Can use iconv() for conversion.
+insert_expand Compiled with support for CTRL-X expansion commands in
+ Insert mode.
+jumplist Compiled with |jumplist| support.
+keymap Compiled with 'keymap' support.
+langmap Compiled with 'langmap' support.
+libcall Compiled with |libcall()| support.
+linebreak Compiled with 'linebreak', 'breakat' and 'showbreak'
+ support.
+lispindent Compiled with support for lisp indenting.
+listcmds Compiled with commands for the buffer list |:files|
+ and the argument list |arglist|.
+localmap Compiled with local mappings and abbr. |:map-local|
+mac Macintosh version of Vim.
+macunix Macintosh version of Vim, using Unix files (OS-X).
+menu Compiled with support for |:menu|.
+mksession Compiled with support for |:mksession|.
+modify_fname Compiled with file name modifiers. |filename-modifiers|
+mouse Compiled with support mouse.
+mouseshape Compiled with support for 'mouseshape'.
+mouse_dec Compiled with support for Dec terminal mouse.
+mouse_gpm Compiled with support for gpm (Linux console mouse)
+mouse_netterm Compiled with support for netterm mouse.
+mouse_pterm Compiled with support for qnx pterm mouse.
+mouse_xterm Compiled with support for xterm mouse.
+multi_byte Compiled with support for editing Korean et al.
+multi_byte_ime Compiled with support for IME input method.
+multi_lang Compiled with support for multiple languages.
+netbeans_intg Compiled with support for |netbeans|.
+ole Compiled with OLE automation support for Win32.
+os2 OS/2 version of Vim.
+osfiletype Compiled with support for osfiletypes |+osfiletype|
+path_extra Compiled with up/downwards search in 'path' and 'tags'
+perl Compiled with Perl interface.
+postscript Compiled with PostScript file printing.
+printer Compiled with |:hardcopy| support.
+python Compiled with Python interface.
+qnx QNX version of Vim.
+quickfix Compiled with |quickfix| support.
+rightleft Compiled with 'rightleft' support.
+ruby Compiled with Ruby interface |ruby|.
+scrollbind Compiled with 'scrollbind' support.
+showcmd Compiled with 'showcmd' support.
+signs Compiled with |:sign| support.
+smartindent Compiled with 'smartindent' support.
+sniff Compiled with SniFF interface support.
+statusline Compiled with support for 'statusline', 'rulerformat'
+ and special formats of 'titlestring' and 'iconstring'.
+sun_workshop Compiled with support for Sun |workshop|.
+syntax Compiled with syntax highlighting support.
+syntax_items There are active syntax highlighting items for the
+ current buffer.
+system Compiled to use system() instead of fork()/exec().
+tag_binary Compiled with binary searching in tags files
+ |tag-binary-search|.
+tag_old_static Compiled with support for old static tags
+ |tag-old-static|.
+tag_any_white Compiled with support for any white characters in tags
+ files |tag-any-white|.
+tcl Compiled with Tcl interface.
+terminfo Compiled with terminfo instead of termcap.
+termresponse Compiled with support for |t_RV| and |v:termresponse|.
+textobjects Compiled with support for |text-objects|.
+tgetent Compiled with tgetent support, able to use a termcap
+ or terminfo file.
+title Compiled with window title support |'title'|.
+toolbar Compiled with support for |gui-toolbar|.
+unix Unix version of Vim.
+user_commands User-defined commands.
+viminfo Compiled with viminfo support.
+vim_starting True while initial source'ing takes place.
+vertsplit Compiled with vertically split windows |:vsplit|.
+virtualedit Compiled with 'virtualedit' option.
+visual Compiled with Visual mode.
+visualextra Compiled with extra Visual mode commands.
+ |blockwise-operators|.
+vms VMS version of Vim.
+vreplace Compiled with |gR| and |gr| commands.
+wildignore Compiled with 'wildignore' option.
+wildmenu Compiled with 'wildmenu' option.
+windows Compiled with support for more than one window.
+winaltkeys Compiled with 'winaltkeys' option.
+win16 Win16 version of Vim (MS-Windows 3.1).
+win32 Win32 version of Vim (MS-Windows 95/98/ME/NT/2000/XP).
+win64 Win64 version of Vim (MS-Windows 64 bit).
+win32unix Win32 version of Vim, using Unix files (Cygwin)
+win95 Win32 version for MS-Windows 95/98/ME.
+writebackup Compiled with 'writebackup' default on.
+xfontset Compiled with X fontset support |xfontset|.
+xim Compiled with X input method support |xim|.
+xsmp Compiled with X session management support.
+xsmp_interact Compiled with interactive X session management support.
+xterm_clipboard Compiled with support for xterm clipboard.
+xterm_save Compiled with support for saving and restoring the
+ xterm screen.
+x11 Compiled with X11 support.
+
+ *string-match*
+Matching a pattern in a String
+
+A regexp pattern as explained at |pattern| is normally used to find a match in
+the buffer lines. When a pattern is used to find a match in a String, almost
+everything works in the same way. The difference is that a String is handled
+like it is one line. When it contains a "\n" character, this is not seen as a
+line break for the pattern. It can be matched with a "\n" in the pattern, or
+with ".". Example: >
+ :let a = "aaaa\nxxxx"
+ :echo matchstr(a, "..\n..")
+ aa
+ xx
+ :echo matchstr(a, "a.x")
+ a
+ x
+
+Don't forget that "^" will only match at the first character of the String and
+"$" at the last character of the string. They don't match after or before a
+"\n".
+
+==============================================================================
+5. Defining functions *user-functions*
+
+New functions can be defined. These can be called just like builtin
+functions. The function executes a sequence of Ex commands. Normal mode
+commands can be executed with the |:normal| command.
+
+The function name must start with an uppercase letter, to avoid confusion with
+builtin functions. To prevent from using the same name in different scripts
+avoid obvious, short names. A good habit is to start the function name with
+the name of the script, e.g., "HTMLcolor()".
+
+It's also possible to use curly braces, see |curly-braces-names|.
+
+ *local-function*
+A function local to a script must start with "s:". A local script function
+can only be called from within the script and from functions, user commands
+and autocommands defined in the script. It is also possible to call the
+function from a mappings defined in the script, but then |<SID>| must be used
+instead of "s:" when the mapping is expanded outside of the script.
+
+ *:fu* *:function* *E128* *E129* *E123*
+:fu[nction] List all functions and their arguments.
+
+:fu[nction] {name} List function {name}.
+ *E124* *E125*
+:fu[nction][!] {name}([arguments]) [range] [abort]
+ Define a new function by the name {name}. The name
+ must be made of alphanumeric characters and '_', and
+ must start with a capital or "s:" (see above).
+ *function-argument* *a:var*
+ An argument can be defined by giving its name. In the
+ function this can then be used as "a:name" ("a:" for
+ argument).
+ Up to 20 arguments can be given, separated by commas.
+ Finally, an argument "..." can be specified, which
+ means that more arguments may be following. In the
+ function they can be used as "a:1", "a:2", etc. "a:0"
+ is set to the number of extra arguments (which can be
+ 0).
+ When not using "...", the number of arguments in a
+ function call must be equal to the number of named
+ arguments. When using "...", the number of arguments
+ may be larger.
+ It is also possible to define a function without any
+ arguments. You must still supply the () then.
+ The body of the function follows in the next lines,
+ until the matching |:endfunction|. It is allowed to
+ define another function inside a function body.
+ *E127* *E122*
+ When a function by this name already exists and [!] is
+ not used an error message is given. When [!] is used,
+ an existing function is silently replaced. Unless it
+ is currently being executed, that is an error.
+ *a:firstline* *a:lastline*
+ When the [range] argument is added, the function is
+ expected to take care of a range itself. The range is
+ passed as "a:firstline" and "a:lastline". If [range]
+ is excluded, ":{range}call" will call the function for
+ each line in the range, with the cursor on the start
+ of each line. See |function-range-example|.
+ When the [abort] argument is added, the function will
+ abort as soon as an error is detected.
+ The last used search pattern and the redo command "."
+ will not be changed by the function.
+
+ *:endf* *:endfunction* *E126* *E193*
+:endf[unction] The end of a function definition. Must be on a line
+ by its own, without other commands.
+
+ *:delf* *:delfunction* *E130* *E131*
+:delf[unction] {name} Delete function {name}.
+
+ *:retu* *:return* *E133*
+:retu[rn] [expr] Return from a function. When "[expr]" is given, it is
+ evaluated and returned as the result of the function.
+ If "[expr]" is not given, the number 0 is returned.
+ When a function ends without an explicit ":return",
+ the number 0 is returned.
+ Note that there is no check for unreachable lines,
+ thus there is no warning if commands follow ":return".
+
+ If the ":return" is used after a |:try| but before the
+ matching |:finally| (if present), the commands
+ following the ":finally" up to the matching |:endtry|
+ are executed first. This process applies to all
+ nested ":try"s inside the function. The function
+ returns at the outermost ":endtry".
+
+
+Inside a function variables can be used. These are local variables, which
+will disappear when the function returns. Global variables need to be
+accessed with "g:".
+
+Example: >
+ :function Table(title, ...)
+ : echohl Title
+ : echo a:title
+ : echohl None
+ : let idx = 1
+ : while idx <= a:0
+ : echo a:{idx} . ' '
+ : let idx = idx + 1
+ : endwhile
+ : return idx
+ :endfunction
+
+This function can then be called with: >
+ let lines = Table("Table", "line1", "line2")
+ let lines = Table("Empty Table")
+
+To return more than one value, pass the name of a global variable: >
+ :function Compute(n1, n2, divname)
+ : if a:n2 == 0
+ : return "fail"
+ : endif
+ : let g:{a:divname} = a:n1 / a:n2
+ : return "ok"
+ :endfunction
+
+This function can then be called with: >
+ :let success = Compute(13, 1324, "div")
+ :if success == "ok"
+ : echo div
+ :endif
+
+An alternative is to return a command that can be executed. This also works
+with local variables in a calling function. Example: >
+ :function Foo()
+ : execute Bar()
+ : echo "line " . lnum . " column " . col
+ :endfunction
+
+ :function Bar()
+ : return "let lnum = " . line(".") . " | let col = " . col(".")
+ :endfunction
+
+The names "lnum" and "col" could also be passed as argument to Bar(), to allow
+the caller to set the names.
+
+ *:cal* *:call* *E107*
+:[range]cal[l] {name}([arguments])
+ Call a function. The name of the function and its arguments
+ are as specified with |:function|. Up to 20 arguments can be
+ used.
+ Without a range and for functions that accept a range, the
+ function is called once. When a range is given the cursor is
+ positioned at the start of the first line before executing the
+ function.
+ When a range is given and the function doesn't handle it
+ itself, the function is executed for each line in the range,
+ with the cursor in the first column of that line. The cursor
+ is left at the last line (possibly moved by the last function
+ call). The arguments are re-evaluated for each line. Thus
+ this works:
+ *function-range-example* >
+ :function Mynumber(arg)
+ : echo line(".") . " " . a:arg
+ :endfunction
+ :1,5call Mynumber(getline("."))
+<
+ The "a:firstline" and "a:lastline" are defined anyway, they
+ can be used to do something different at the start or end of
+ the range.
+
+ Example of a function that handles the range itself: >
+
+ :function Cont() range
+ : execute (a:firstline + 1) . "," . a:lastline . 's/^/\t\\ '
+ :endfunction
+ :4,8call Cont()
+<
+ This function inserts the continuation character "\" in front
+ of all the lines in the range, except the first one.
+
+ *E132*
+The recursiveness of user functions is restricted with the |'maxfuncdepth'|
+option.
+
+ *autoload-functions*
+When using many or large functions, it's possible to automatically define them
+only when they are used. Use the FuncUndefined autocommand event with a
+pattern that matches the function(s) to be defined. Example: >
+
+ :au FuncUndefined BufNet* source ~/vim/bufnetfuncs.vim
+
+The file "~/vim/bufnetfuncs.vim" should then define functions that start with
+"BufNet". Also see |FuncUndefined|.
+
+==============================================================================
+6. Curly braces names *curly-braces-names*
+
+Wherever you can use a variable, you can use a "curly braces name" variable.
+This is a regular variable name with one or more expressions wrapped in braces
+{} like this: >
+ my_{adjective}_variable
+
+When Vim encounters this, it evaluates the expression inside the braces, puts
+that in place of the expression, and re-interprets the whole as a variable
+name. So in the above example, if the variable "adjective" was set to
+"noisy", then the reference would be to "my_noisy_variable", whereas if
+"adjective" was set to "quiet", then it would be to "my_quiet_variable".
+
+One application for this is to create a set of variables governed by an option
+value. For example, the statement >
+ echo my_{&background}_message
+
+would output the contents of "my_dark_message" or "my_light_message" depending
+on the current value of 'background'.
+
+You can use multiple brace pairs: >
+ echo my_{adverb}_{adjective}_message
+..or even nest them: >
+ echo my_{ad{end_of_word}}_message
+where "end_of_word" is either "verb" or "jective".
+
+However, the expression inside the braces must evaluate to a valid single
+variable name. e.g. this is invalid: >
+ :let foo='a + b'
+ :echo c{foo}d
+.. since the result of expansion is "ca + bd", which is not a variable name.
+
+ *curly-braces-function-names*
+You can call and define functions by an evaluated name in a similar way.
+Example: >
+ :let func_end='whizz'
+ :call my_func_{func_end}(parameter)
+
+This would call the function "my_func_whizz(parameter)".
+
+==============================================================================
+7. Commands *expression-commands*
+
+:let {var-name} = {expr1} *:let* *E18*
+ Set internal variable {var-name} to the result of the
+ expression {expr1}. The variable will get the type
+ from the {expr}. If {var-name} didn't exist yet, it
+ is created.
+
+:let ${env-name} = {expr1} *:let-environment* *:let-$*
+ Set environment variable {env-name} to the result of
+ the expression {expr1}. The type is always String.
+
+:let @{reg-name} = {expr1} *:let-register* *:let-@*
+ Write the result of the expression {expr1} in register
+ {reg-name}. {reg-name} must be a single letter, and
+ must be the name of a writable register (see
+ |registers|). "@@" can be used for the unnamed
+ register, "@/" for the search pattern.
+ If the result of {expr1} ends in a <CR> or <NL>, the
+ register will be linewise, otherwise it will be set to
+ characterwise.
+ This can be used to clear the last search pattern: >
+ :let @/ = ""
+< This is different from searching for an empty string,
+ that would match everywhere.
+
+:let &{option-name} = {expr1} *:let-option* *:let-star*
+ Set option {option-name} to the result of the
+ expression {expr1}. The value is always converted to
+ the type of the option.
+ For an option local to a window or buffer the effect
+ is just like using the |:set| command: both the local
+ value and the global value is changed.
+
+:let &l:{option-name} = {expr1}
+ Like above, but only set the local value of an option
+ (if there is one). Works like |:setlocal|.
+
+:let &g:{option-name} = {expr1}
+ Like above, but only set the global value of an option
+ (if there is one). Works like |:setglobal|.
+
+ *E106*
+:let {var-name} .. List the value of variable {var-name}. Several
+ variable names may be given.
+
+:let List the values of all variables.
+
+ *:unlet* *:unl* *E108*
+:unl[et][!] {var-name} ...
+ Remove the internal variable {var-name}. Several
+ variable names can be given, they are all removed.
+ With [!] no error message is given for non-existing
+ variables.
+
+:if {expr1} *:if* *:endif* *:en* *E171* *E579* *E580*
+:en[dif] Execute the commands until the next matching ":else"
+ or ":endif" if {expr1} evaluates to non-zero.
+
+ From Vim version 4.5 until 5.0, every Ex command in
+ between the ":if" and ":endif" is ignored. These two
+ commands were just to allow for future expansions in a
+ backwards compatible way. Nesting was allowed. Note
+ that any ":else" or ":elseif" was ignored, the "else"
+ part was not executed either.
+
+ You can use this to remain compatible with older
+ versions: >
+ :if version >= 500
+ : version-5-specific-commands
+ :endif
+< The commands still need to be parsed to find the
+ "endif". Sometimes an older Vim has a problem with a
+ new command. For example, ":silent" is recognized as
+ a ":substitute" command. In that case ":execute" can
+ avoid problems: >
+ :if version >= 600
+ : execute "silent 1,$delete"
+ :endif
+<
+ NOTE: The ":append" and ":insert" commands don't work
+ properly in between ":if" and ":endif".
+
+ *:else* *:el* *E581* *E583*
+:el[se] Execute the commands until the next matching ":else"
+ or ":endif" if they previously were not being
+ executed.
+
+ *:elseif* *:elsei* *E582* *E584*
+:elsei[f] {expr1} Short for ":else" ":if", with the addition that there
+ is no extra ":endif".
+
+:wh[ile] {expr1} *:while* *:endwhile* *:wh* *:endw*
+ *E170* *E585* *E588*
+:endw[hile] Repeat the commands between ":while" and ":endwhile",
+ as long as {expr1} evaluates to non-zero.
+ When an error is detected from a command inside the
+ loop, execution continues after the "endwhile".
+
+ NOTE: The ":append" and ":insert" commands don't work
+ properly inside a ":while" loop.
+
+ *:continue* *:con* *E586*
+:con[tinue] When used inside a ":while", jumps back to the
+ ":while". If it is used after a |:try| inside the
+ ":while" but before the matching |:finally| (if
+ present), the commands following the ":finally" up to
+ the matching |:endtry| are executed first. This
+ process applies to all nested ":try"s inside the
+ ":while". The outermost ":endtry" then jumps back to
+ the ":while".
+
+ *:break* *:brea* *E587*
+:brea[k] When used inside a ":while", skips to the command
+ after the matching ":endwhile". If it is used after
+ a |:try| inside the ":while" but before the matching
+ |:finally| (if present), the commands following the
+ ":finally" up to the matching |:endtry| are executed
+ first. This process applies to all nested ":try"s
+ inside the ":while". The outermost ":endtry" then
+ jumps to the command after the ":endwhile".
+
+:try *:try* *:endt* *:endtry* *E600* *E601* *E602*
+:endt[ry] Change the error handling for the commands between
+ ":try" and ":endtry" including everything being
+ executed across ":source" commands, function calls,
+ or autocommand invocations.
+
+ When an error or interrupt is detected and there is
+ a |:finally| command following, execution continues
+ after the ":finally". Otherwise, or when the
+ ":endtry" is reached thereafter, the next
+ (dynamically) surrounding ":try" is checked for
+ a corresponding ":finally" etc. Then the script
+ processing is terminated. (Whether a function
+ definition has an "abort" argument does not matter.)
+ Example: >
+ :try | edit too much | finally | echo "cleanup" | endtry
+ :echo "impossible" " not reached, script terminated above
+<
+ Moreover, an error or interrupt (dynamically) inside
+ ":try" and ":endtry" is converted to an exception. It
+ can be caught as if it were thrown by a |:throw|
+ command (see |:catch|). In this case, the script
+ processing is not terminated.
+
+ The value "Vim:Interrupt" is used for an interrupt
+ exception. An error in a Vim command is converted
+ to a value of the form "Vim({command}):{errmsg}",
+ other errors are converted to a value of the form
+ "Vim:{errmsg}". {command} is the full command name,
+ and {errmsg} is the message that is displayed if the
+ error exception is not caught, always beginning with
+ the error number.
+ Examples: >
+ :try | sleep 100 | catch /^Vim:Interrupt$/ | endtry
+ :try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry
+<
+ *:cat* *:catch* *E603* *E604* *E605*
+:cat[ch] /{pattern}/ The following commands until the next ":catch",
+ |:finally|, or |:endtry| that belongs to the same
+ |:try| as the ":catch" are executed when an exception
+ matching {pattern} is being thrown and has not yet
+ been caught by a previous ":catch". Otherwise, these
+ commands are skipped.
+ When {pattern} is omitted all errors are caught.
+ Examples: >
+ :catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
+ :catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
+ :catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
+ :catch /^Vim(write):/ " catch all errors in :write
+ :catch /^Vim\%((\a\+)\)\=:E123/ " catch error E123
+ :catch /my-exception/ " catch user exception
+ :catch /.*/ " catch everything
+ :catch " same as /.*/
+<
+ Another character can be used instead of / around the
+ {pattern}, so long as it does not have a special
+ meaning (e.g., '|' or '"') and doesn't occur inside
+ {pattern}.
+ NOTE: It is not reliable to ":catch" the TEXT of
+ an error message because it may vary in different
+ locales.
+
+ *:fina* *:finally* *E606* *E607*
+:fina[lly] The following commands until the matching |:endtry|
+ are executed whenever the part between the matching
+ |:try| and the ":finally" is left: either by falling
+ through to the ":finally" or by a |:continue|,
+ |:break|, |:finish|, or |:return|, or by an error or
+ interrupt or exception (see |:throw|).
+
+ *:th* *:throw* *E608*
+:th[row] {expr1} The {expr1} is evaluated and thrown as an exception.
+ If the ":throw" is used after a |:try| but before the
+ first corresponding |:catch|, commands are skipped
+ until the first ":catch" matching {expr1} is reached.
+ If there is no such ":catch" or if the ":throw" is
+ used after a ":catch" but before the |:finally|, the
+ commands following the ":finally" (if present) up to
+ the matching |:endtry| are executed. If the ":throw"
+ is after the ":finally", commands up to the ":endtry"
+ are skipped. At the ":endtry", this process applies
+ again for the next dynamically surrounding ":try"
+ (which may be found in a calling function or sourcing
+ script), until a matching ":catch" has been found.
+ If the exception is not caught, the command processing
+ is terminated.
+ Example: >
+ :try | throw "oops" | catch /^oo/ | echo "caught" | endtry
+<
+
+ *:ec* *:echo*
+:ec[ho] {expr1} .. Echoes each {expr1}, with a space in between. The
+ first {expr1} starts on a new line.
+ Also see |:comment|.
+ Use "\n" to start a new line. Use "\r" to move the
+ cursor to the first column.
+ Uses the highlighting set by the |:echohl| command.
+ Cannot be followed by a comment.
+ Example: >
+ :echo "the value of 'shell' is" &shell
+< A later redraw may make the message disappear again.
+ To avoid that a command from before the ":echo" causes
+ a redraw afterwards (redraws are often postponed until
+ you type something), force a redraw with the |:redraw|
+ command. Example: >
+ :new | redraw | echo "there is a new window"
+<
+ *:echon*
+:echon {expr1} .. Echoes each {expr1}, without anything added. Also see
+ |:comment|.
+ Uses the highlighting set by the |:echohl| command.
+ Cannot be followed by a comment.
+ Example: >
+ :echon "the value of 'shell' is " &shell
+<
+ Note the difference between using ":echo", which is a
+ Vim command, and ":!echo", which is an external shell
+ command: >
+ :!echo % --> filename
+< The arguments of ":!" are expanded, see |:_%|. >
+ :!echo "%" --> filename or "filename"
+< Like the previous example. Whether you see the double
+ quotes or not depends on your 'shell'. >
+ :echo % --> nothing
+< The '%' is an illegal character in an expression. >
+ :echo "%" --> %
+< This just echoes the '%' character. >
+ :echo expand("%") --> filename
+< This calls the expand() function to expand the '%'.
+
+ *:echoh* *:echohl*
+:echoh[l] {name} Use the highlight group {name} for the following
+ |:echo|, |:echon| and |:echomsg| commands. Also used
+ for the |input()| prompt. Example: >
+ :echohl WarningMsg | echo "Don't panic!" | echohl None
+< Don't forget to set the group back to "None",
+ otherwise all following echo's will be highlighted.
+
+ *:echom* *:echomsg*
+:echom[sg] {expr1} .. Echo the expression(s) as a true message, saving the
+ message in the |message-history|.
+ Spaces are placed between the arguments as with the
+ |:echo| command. But unprintable characters are
+ displayed, not interpreted.
+ Uses the highlighting set by the |:echohl| command.
+ Example: >
+ :echomsg "It's a Zizzer Zazzer Zuzz, as you can plainly see."
+<
+ *:echoe* *:echoerr*
+:echoe[rr] {expr1} .. Echo the expression(s) as an error message, saving the
+ message in the |message-history|. When used in a
+ script or function the line number will be added.
+ Spaces are placed between the arguments as with the
+ :echo command. When used inside a try conditional,
+ the message is raised as an error exception instead
+ (see |try-echoerr|).
+ Example: >
+ :echoerr "This script just failed!"
+< If you just want a highlighted message use |:echohl|.
+ And to get a beep: >
+ :exe "normal \<Esc>"
+<
+ *:exe* *:execute*
+:exe[cute] {expr1} .. Executes the string that results from the evaluation
+ of {expr1} as an Ex command. Multiple arguments are
+ concatenated, with a space in between. {expr1} is
+ used as the processed command, command line editing
+ keys are not recognized.
+ Cannot be followed by a comment.
+ Examples: >
+ :execute "buffer " nextbuf
+ :execute "normal " count . "w"
+<
+ ":execute" can be used to append a command to commands
+ that don't accept a '|'. Example: >
+ :execute '!ls' | echo "theend"
+
+< ":execute" is also a nice way to avoid having to type
+ control characters in a Vim script for a ":normal"
+ command: >
+ :execute "normal ixxx\<Esc>"
+< This has an <Esc> character, see |expr-string|.
+
+ Note: The executed string may be any command-line, but
+ you cannot start or end a "while" or "if" command.
+ Thus this is illegal: >
+ :execute 'while i > 5'
+ :execute 'echo "test" | break'
+<
+ It is allowed to have a "while" or "if" command
+ completely in the executed string: >
+ :execute 'while i < 5 | echo i | let i = i + 1 | endwhile'
+<
+
+ *:comment*
+ ":execute", ":echo" and ":echon" cannot be followed by
+ a comment directly, because they see the '"' as the
+ start of a string. But, you can use '|' followed by a
+ comment. Example: >
+ :echo "foo" | "this is a comment
+
+==============================================================================
+8. Exception handling *exception-handling*
+
+The Vim script language comprises an exception handling feature. This section
+explains how it can be used in a Vim script.
+
+Exceptions may be raised by Vim on an error or on interrupt, see
+|catch-errors| and |catch-interrupt|. You can also explicitly throw an
+exception by using the ":throw" command, see |throw-catch|.
+
+
+TRY CONDITIONALS *try-conditionals*
+
+Exceptions can be caught or can cause cleanup code to be executed. You can
+use a try conditional to specify catch clauses (that catch exceptions) and/or
+a finally clause (to be executed for cleanup).
+ A try conditional begins with a |:try| command and ends at the matching
+|:endtry| command. In between, you can use a |:catch| command to start
+a catch clause, or a |:finally| command to start a finally clause. There may
+be none or multiple catch clauses, but there is at most one finally clause,
+which must not be followed by any catch clauses. The lines before the catch
+clauses and the finally clause is called a try block. >
+
+ :try
+ : ...
+ : ... TRY BLOCK
+ : ...
+ :catch /{pattern}/
+ : ...
+ : ... CATCH CLAUSE
+ : ...
+ :catch /{pattern}/
+ : ...
+ : ... CATCH CLAUSE
+ : ...
+ :finally
+ : ...
+ : ... FINALLY CLAUSE
+ : ...
+ :endtry
+
+The try conditional allows to watch code for exceptions and to take the
+appropriate actions. Exceptions from the try block may be caught. Exceptions
+from the try block and also the catch clauses may cause cleanup actions.
+ When no exception is thrown during execution of the try block, the control
+is transferred to the finally clause, if present. After its execution, the
+script continues with the line following the ":endtry".
+ When an exception occurs during execution of the try block, the remaining
+lines in the try block are skipped. The exception is matched against the
+patterns specified as arguments to the ":catch" commands. The catch clause
+after the first matching ":catch" is taken, other catch clauses are not
+executed. The catch clause ends when the next ":catch", ":finally", or
+":endtry" command is reached - whatever is first. Then, the finally clause
+(if present) is executed. When the ":endtry" is reached, the script execution
+continues in the following line as usual.
+ When an exception that does not match any of the patterns specified by the
+":catch" commands is thrown in the try block, the exception is not caught by
+that try conditional and none of the catch clauses is executed. Only the
+finally clause, if present, is taken. The exception pends during execution of
+the finally clause. It is resumed at the ":endtry", so that commands after
+the ":endtry" are not executed and the exception might be caught elsewhere,
+see |try-nesting|.
+ When during execution of a catch clause another exception is thrown, the
+remaining lines in that catch clause are not executed. The new exception is
+not matched against the patterns in any of the ":catch" commands of the same
+try conditional and none of its catch clauses is taken. If there is, however,
+a finally clause, it is executed, and the exception pends during its
+execution. The commands following the ":endtry" are not executed. The new
+exception might, however, be caught elsewhere, see |try-nesting|.
+ When during execution of the finally clause (if present) an exception is
+thrown, the remaining lines in the finally clause are skipped. If the finally
+clause has been taken because of an exception from the try block or one of the
+catch clauses, the original (pending) exception is discarded. The commands
+following the ":endtry" are not executed, and the exception from the finally
+clause is propagated and can be caught elsewhere, see |try-nesting|.
+
+The finally clause is also executed, when a ":break" or ":continue" for
+a ":while" loop enclosing the complete try conditional is executed from the
+try block or a catch clause. Or when a ":return" or ":finish" is executed
+from the try block or a catch clause of a try conditional in a function or
+sourced script, respectively. The ":break", ":continue", ":return", or
+":finish" pends during execution of the finally clause and is resumed when the
+":endtry" is reached. It is, however, discarded when an exception is thrown
+from the finally clause.
+ When a ":break" or ":continue" for a ":while" loop enclosing the complete
+try conditional or when a ":return" or ":finish" is encountered in the finally
+clause, the rest of the finally clause is skipped, and the ":break",
+":continue", ":return" or ":finish" is executed as usual. If the finally
+clause has been taken because of an exception or an earlier ":break",
+":continue", ":return", or ":finish" from the try block or a catch clause,
+this pending exception or command is discarded.
+
+For examples see |throw-catch| and |try-finally|.
+
+
+NESTING OF TRY CONDITIONALS *try-nesting*
+
+Try conditionals can be nested arbitrarily. That is, a complete try
+conditional can be put into the try block, a catch clause, or the finally
+clause of another try conditional. If the inner try conditional does not
+catch an exception thrown in its try block or throws a new exception from one
+of its catch clauses or its finally clause, the outer try conditional is
+checked according to the rules above. If the inner try conditional is in the
+try block of the outer try conditional, its catch clauses are checked, but
+otherwise only the finally clause is executed. It does not matter for
+nesting, whether the inner try conditional is directly contained in the outer
+one, or whether the outer one sources a script or calls a function containing
+the inner try conditional.
+
+When none of the active try conditionals catches an exception, just their
+finally clauses are executed. Thereafter, the script processing terminates.
+An error message is displayed in case of an uncaught exception explicitly
+thrown by a ":throw" command. For uncaught error and interrupt exceptions
+implicitly raised by Vim, the error message(s) or interrupt message are shown
+as usual.
+
+For examples see |throw-catch|.
+
+
+EXAMINING EXCEPTION HANDLING CODE *except-examine*
+
+Exception handling code can get tricky. If you are in doubt what happens, set
+'verbose' to 13 or use the ":13verbose" command modifier when sourcing your
+script file. Then you see when an exception is thrown, discarded, caught, or
+finished. When using a verbosity level of at least 14, things pending in
+a finally clause are also shown. This information is also given in debug mode
+(see |debug-scripts|).
+
+
+THROWING AND CATCHING EXCEPTIONS *throw-catch*
+
+You can throw any number or string as an exception. Use the |:throw| command
+and pass the value to be thrown as argument: >
+ :throw 4711
+ :throw "string"
+< *throw-expression*
+You can also specify an expression argument. The expression is then evaluated
+first, and the result is thrown: >
+ :throw 4705 + strlen("string")
+ :throw strpart("strings", 0, 6)
+
+An exception might be thrown during evaluation of the argument of the ":throw"
+command. Unless it is caught there, the expression evaluation is abandoned.
+The ":throw" command then does not throw a new exception.
+ Example: >
+
+ :function! Foo(arg)
+ : try
+ : throw a:arg
+ : catch /foo/
+ : endtry
+ : return 1
+ :endfunction
+ :
+ :function! Bar()
+ : echo "in Bar"
+ : return 4710
+ :endfunction
+ :
+ :throw Foo("arrgh") + Bar()
+
+This throws "arrgh", and "in Bar" is not displayed since Bar() is not
+executed. >
+ :throw Foo("foo") + Bar()
+however displays "in Bar" and throws 4711.
+
+Any other command that takes an expression as argument might also be
+abandoned by an (uncaught) exception during the expression evaluation. The
+exception is then propagated to the caller of the command.
+ Example: >
+
+ :if Foo("arrgh")
+ : echo "then"
+ :else
+ : echo "else"
+ :endif
+
+Here neither of "then" or "else" is displayed.
+
+ *catch-order*
+Exceptions can be caught by a try conditional with one or more |:catch|
+commands, see |try-conditionals|. The values to be caught by each ":catch"
+command can be specified as a pattern argument. The subsequent catch clause
+gets executed when a matching exception is caught.
+ Example: >
+
+ :function! Foo(value)
+ : try
+ : throw a:value
+ : catch /^\d\+$/
+ : echo "Number thrown"
+ : catch /.*/
+ : echo "String thrown"
+ : endtry
+ :endfunction
+ :
+ :call Foo(0x1267)
+ :call Foo('string')
+
+The first call to Foo() displays "Number thrown", the second "String thrown".
+An exception is matched against the ":catch" commands in the order they are
+specified. Only the first match counts. So you should place the more
+specific ":catch" first. The following order does not make sense: >
+
+ : catch /.*/
+ : echo "String thrown"
+ : catch /^\d\+$/
+ : echo "Number thrown"
+
+The first ":catch" here matches always, so that the second catch clause is
+never taken.
+
+ *throw-variables*
+If you catch an exception by a general pattern, you may access the exact value
+in the variable |v:exception|: >
+
+ : catch /^\d\+$/
+ : echo "Number thrown. Value is" v:exception
+
+You may also be interested where an exception was thrown. This is stored in
+|v:throwpoint|. Note that "v:exception" and "v:throwpoint" are valid for the
+exception most recently caught as long it is not finished.
+ Example: >
+
+ :function! Caught()
+ : if v:exception != ""
+ : echo 'Caught "' . v:exception . '" in ' . v:throwpoint
+ : else
+ : echo 'Nothing caught'
+ : endif
+ :endfunction
+ :
+ :function! Foo()
+ : try
+ : try
+ : try
+ : throw 4711
+ : finally
+ : call Caught()
+ : endtry
+ : catch /.*/
+ : call Caught()
+ : throw "oops"
+ : endtry
+ : catch /.*/
+ : call Caught()
+ : finally
+ : call Caught()
+ : endtry
+ :endfunction
+ :
+ :call Foo()
+
+This displays >
+
+ Nothing caught
+ Caught "4711" in function Foo, line 4
+ Caught "oops" in function Foo, line 10
+ Nothing caught
+
+A practical example: The following command ":LineNumber" displays the line
+number in the script or function where it has been used: >
+
+ :function! LineNumber()
+ : return substitute(v:throwpoint, '.*\D\(\d\+\).*', '\1', "")
+ :endfunction
+ :command! LineNumber try | throw "" | catch | echo LineNumber() | endtry
+<
+ *try-nested*
+An exception that is not caught by a try conditional can be caught by
+a surrounding try conditional: >
+
+ :try
+ : try
+ : throw "foo"
+ : catch /foobar/
+ : echo "foobar"
+ : finally
+ : echo "inner finally"
+ : endtry
+ :catch /foo/
+ : echo "foo"
+ :endtry
+
+The inner try conditional does not catch the exception, just its finally
+clause is executed. The exception is then caught by the outer try
+conditional. The example displays "inner finally" and then "foo".
+
+ *throw-from-catch*
+You can catch an exception and throw a new one to be caught elsewhere from the
+catch clause: >
+
+ :function! Foo()
+ : throw "foo"
+ :endfunction
+ :
+ :function! Bar()
+ : try
+ : call Foo()
+ : catch /foo/
+ : echo "Caught foo, throw bar"
+ : throw "bar"
+ : endtry
+ :endfunction
+ :
+ :try
+ : call Bar()
+ :catch /.*/
+ : echo "Caught" v:exception
+ :endtry
+
+This displays "Caught foo, throw bar" and then "Caught bar".
+
+ *rethrow*
+There is no real rethrow in the Vim script language, but you may throw
+"v:exception" instead: >
+
+ :function! Bar()
+ : try
+ : call Foo()
+ : catch /.*/
+ : echo "Rethrow" v:exception
+ : throw v:exception
+ : endtry
+ :endfunction
+< *try-echoerr*
+Note that this method cannot be used to "rethrow" Vim error or interrupt
+exceptions, because it is not possible to fake Vim internal exceptions.
+Trying so causes an error exception. You should throw your own exception
+denoting the situation. If you want to cause a Vim error exception containing
+the original error exception value, you can use the |:echoerr| command: >
+
+ :try
+ : try
+ : asdf
+ : catch /.*/
+ : echoerr v:exception
+ : endtry
+ :catch /.*/
+ : echo v:exception
+ :endtry
+
+This code displays
+
+ Vim(echoerr):Vim:E492: Not an editor command: asdf ~
+
+
+CLEANUP CODE *try-finally*
+
+Scripts often change global settings and restore them at their end. If the
+user however interrupts the script by pressing CTRL-C, the settings remain in
+an inconsistent state. The same may happen to you in the development phase of
+a script when an error occurs or you explicitly throw an exception without
+catching it. You can solve these problems by using a try conditional with
+a finally clause for restoring the settings. Its execution is guaranteed on
+normal control flow, on error, on an explicit ":throw", and on interrupt.
+(Note that errors and interrupts from inside the try conditional are converted
+to exceptions. When not caught, they terminate the script after the finally
+clause has been executed.)
+Example: >
+
+ :try
+ : let s:saved_ts = &ts
+ : set ts=17
+ :
+ : " Do the hard work here.
+ :
+ :finally
+ : let &ts = s:saved_ts
+ : unlet s:saved_ts
+ :endtry
+
+This method should be used locally whenever a function or part of a script
+changes global settings which need to be restored on failure or normal exit of
+that function or script part.
+
+ *break-finally*
+Cleanup code works also when the try block or a catch clause is left by
+a ":continue", ":break", ":return", or ":finish".
+ Example: >
+
+ :let first = 1
+ :while 1
+ : try
+ : if first
+ : echo "first"
+ : let first = 0
+ : continue
+ : else
+ : throw "second"
+ : endif
+ : catch /.*/
+ : echo v:exception
+ : break
+ : finally
+ : echo "cleanup"
+ : endtry
+ : echo "still in while"
+ :endwhile
+ :echo "end"
+
+This displays "first", "cleanup", "second", "cleanup", and "end". >
+
+ :function! Foo()
+ : try
+ : return 4711
+ : finally
+ : echo "cleanup\n"
+ : endtry
+ : echo "Foo still active"
+ :endfunction
+ :
+ :echo Foo() "returned by Foo"
+
+This displays "cleanup" and "4711 returned by Foo". You don't need to add an
+extra ":return" in the finally clause. (Above all, this would override the
+return value.)
+
+ *except-from-finally*
+Using either of ":continue", ":break", ":return", ":finish", or ":throw" in
+a finally clause is possible, but not recommended since it abandons the
+cleanup actions for the try conditional. But, of course, interrupt and error
+exceptions might get raised from a finally clause.
+ Example where an error in the finally clause stops an interrupt from
+working correctly: >
+
+ :try
+ : try
+ : echo "Press CTRL-C for interrupt"
+ : while 1
+ : endwhile
+ : finally
+ : unlet novar
+ : endtry
+ :catch /novar/
+ :endtry
+ :echo "Script still running"
+ :sleep 1
+
+If you need to put commands that could fail into a finally clause, you should
+think about catching or ignoring the errors in these commands, see
+|catch-errors| and |ignore-errors|.
+
+
+CATCHING ERRORS *catch-errors*
+
+If you want to catch specific errors, you just have to put the code to be
+watched in a try block and add a catch clause for the error message. The
+presence of the try conditional causes all errors to be converted to an
+exception. No message is displayed and |v:errmsg| is not set then. To find
+the right pattern for the ":catch" command, you have to know how the format of
+the error exception is.
+ Error exceptions have the following format: >
+
+ Vim({cmdname}):{errmsg}
+or >
+ Vim:{errmsg}
+
+{cmdname} is the name of the command that failed; the second form is used when
+the command name is not known. {errmsg} is the error message usually produced
+when the error occurs outside try conditionals. It always begins with
+a capital "E", followed by a two or three-digit error number, a colon, and
+a space.
+
+Examples:
+
+The command >
+ :unlet novar
+normally produces the error message >
+ E108: No such variable: "novar"
+which is converted inside try conditionals to an exception >
+ Vim(unlet):E108: No such variable: "novar"
+
+The command >
+ :dwim
+normally produces the error message >
+ E492: Not an editor command: dwim
+which is converted inside try conditionals to an exception >
+ Vim:E492: Not an editor command: dwim
+
+You can catch all ":unlet" errors by a >
+ :catch /^Vim(unlet):/
+or all errors for misspelled command names by a >
+ :catch /^Vim:E492:/
+
+Some error messages may be produced by different commands: >
+ :function nofunc
+and >
+ :delfunction nofunc
+both produce the error message >
+ E128: Function name must start with a capital: nofunc
+which is converted inside try conditionals to an exception >
+ Vim(function):E128: Function name must start with a capital: nofunc
+or >
+ Vim(delfunction):E128: Function name must start with a capital: nofunc
+respectively. You can catch the error by its number independently on the
+command that caused it if you use the following pattern: >
+ :catch /^Vim(\a\+):E128:/
+
+Some commands like >
+ :let x = novar
+produce multiple error messages, here: >
+ E121: Undefined variable: novar
+ E15: Invalid expression: novar
+Only the first is used for the exception value, since it is the most specific
+one (see |except-several-errors|). So you can catch it by >
+ :catch /^Vim(\a\+):E121:/
+
+You can catch all errors related to the name "nofunc" by >
+ :catch /\<nofunc\>/
+
+You can catch all Vim errors in the ":write" and ":read" commands by >
+ :catch /^Vim(\(write\|read\)):E\d\+:/
+
+You can catch all Vim errors by the pattern >
+ :catch /^Vim\((\a\+)\)\=:E\d\+:/
+<
+ *catch-text*
+NOTE: You should never catch the error message text itself: >
+ :catch /No such variable/
+only works in the english locale, but not when the user has selected
+a different language by the |:language| command. It is however helpful to
+cite the message text in a comment: >
+ :catch /^Vim(\a\+):E108:/ " No such variable
+
+
+IGNORING ERRORS *ignore-errors*
+
+You can ignore errors in a specific Vim command by catching them locally: >
+
+ :try
+ : write
+ :catch
+ :endtry
+
+But you are strongly recommended NOT to use this simple form, since it could
+catch more than you want. With the ":write" command, some autocommands could
+be executed and cause errors not related to writing, for instance: >
+
+ :au BufWritePre * unlet novar
+
+There could even be such errors you are not responsible for as a script
+writer: a user of your script might have defined such autocommands. You would
+then hide the error from the user.
+ It is much better to use >
+
+ :try
+ : write
+ :catch /^Vim(write):/
+ :endtry
+
+which only catches real write errors. So catch only what you'd like to ignore
+intentionally.
+
+For a single command that does not cause execution of autocommands, you could
+even suppress the conversion of errors to exceptions by the ":silent!"
+command: >
+ :silent! nunmap k
+This works also when a try conditional is active.
+
+
+CATCHING INTERRUPTS *catch-interrupt*
+
+When there are active try conditionals, an interrupt (CTRL-C) is converted to
+the exception "Vim:Interrupt". You can catch it like every exception. The
+script is not terminated, then.
+ Example: >
+
+ :function! TASK1()
+ : sleep 10
+ :endfunction
+
+ :function! TASK2()
+ : sleep 20
+ :endfunction
+
+ :while 1
+ : let command = input("Type a command: ")
+ : try
+ : if command == ""
+ : continue
+ : elseif command == "END"
+ : break
+ : elseif command == "TASK1"
+ : call TASK1()
+ : elseif command == "TASK2"
+ : call TASK2()
+ : else
+ : echo "\nIllegal command:" command
+ : continue
+ : endif
+ : catch /^Vim:Interrupt$/
+ : echo "\nCommand interrupted"
+ : " Caught the interrupt. Continue with next prompt.
+ : endtry
+ :endwhile
+
+You can interrupt a task here by pressing CTRL-C; the script then asks for
+a new command. If you press CTRL-C at the prompt, the script is terminated.
+
+For testing what happens when CTRL-C would be pressed on a specific line in
+your script, use the debug mode and execute the |>quit| or |>interrupt|
+command on that line. See |debug-scripts|.
+
+
+CATCHING ALL *catch-all*
+
+The commands >
+
+ :catch /.*/
+ :catch //
+ :catch
+
+catch everything, error exceptions, interrupt exceptions and exceptions
+explicitly thrown by the |:throw| command. This is useful at the top level of
+a script in order to catch unexpected things.
+ Example: >
+
+ :try
+ :
+ : " do the hard work here
+ :
+ :catch /MyException/
+ :
+ : " handle known problem
+ :
+ :catch /^Vim:Interrupt$/
+ : echo "Script interrupted"
+ :catch /.*/
+ : echo "Internal error (" . v:exception . ")"
+ : echo " - occurred at " . v:throwpoint
+ :endtry
+ :" end of script
+
+Note: Catching all might catch more things than you want. Thus, you are
+strongly encouraged to catch only for problems that you can really handle by
+specifying a pattern argument to the ":catch".
+ Example: Catching all could make it nearly impossible to interrupt a script
+by pressing CTRL-C: >
+
+ :while 1
+ : try
+ : sleep 1
+ : catch
+ : endtry
+ :endwhile
+
+
+EXCEPTIONS AND AUTOCOMMANDS *except-autocmd*
+
+Exceptions may be used during execution of autocommands. Example: >
+
+ :autocmd User x try
+ :autocmd User x throw "Oops!"
+ :autocmd User x catch
+ :autocmd User x echo v:exception
+ :autocmd User x endtry
+ :autocmd User x throw "Arrgh!"
+ :autocmd User x echo "Should not be displayed"
+ :
+ :try
+ : doautocmd User x
+ :catch
+ : echo v:exception
+ :endtry
+
+This displays "Oops!" and "Arrgh!".
+
+ *except-autocmd-Pre*
+For some commands, autocommands get executed before the main action of the
+command takes place. If an exception is thrown and not caught in the sequence
+of autocommands, the sequence and the command that caused its execution are
+abandoned and the exception is propagated to the caller of the command.
+ Example: >
+
+ :autocmd BufWritePre * throw "FAIL"
+ :autocmd BufWritePre * echo "Should not be displayed"
+ :
+ :try
+ : write
+ :catch
+ : echo "Caught:" v:exception "from" v:throwpoint
+ :endtry
+
+Here, the ":write" command does not write the file currently being edited (as
+you can see by checking 'modified'), since the exception from the BufWritePre
+autocommand abandons the ":write". The exception is then caught and the
+script displays: >
+
+ Caught: FAIL from BufWrite Auto commands for "*"
+<
+ *except-autocmd-Post*
+For some commands, autocommands get executed after the main action of the
+command has taken place. If this main action fails and the command is inside
+an active try conditional, the autocommands are skipped and an error exception
+is thrown that can be caught by the caller of the command.
+ Example: >
+
+ :autocmd BufWritePost * echo "File successfully written!"
+ :
+ :try
+ : write /i/m/p/o/s/s/i/b/l/e
+ :catch
+ : echo v:exception
+ :endtry
+
+This just displays: >
+
+ Vim(write):E212: Can't open file for writing (/i/m/p/o/s/s/i/b/l/e)
+
+If you really need to execute the autocommands even when the main action
+fails, trigger the event from the catch clause.
+ Example: >
+
+ :autocmd BufWritePre * set noreadonly
+ :autocmd BufWritePost * set readonly
+ :
+ :try
+ : write /i/m/p/o/s/s/i/b/l/e
+ :catch
+ : doautocmd BufWritePost /i/m/p/o/s/s/i/b/l/e
+ :endtry
+<
+You can also use ":silent!": >
+
+ :let x = "ok"
+ :let v:errmsg = ""
+ :autocmd BufWritePost * if v:errmsg != ""
+ :autocmd BufWritePost * let x = "after fail"
+ :autocmd BufWritePost * endif
+ :try
+ : silent! write /i/m/p/o/s/s/i/b/l/e
+ :catch
+ :endtry
+ :echo x
+
+This displays "after fail".
+
+If the main action of the command does not fail, exceptions from the
+autocommands will be catchable by the caller of the command: >
+
+ :autocmd BufWritePost * throw ":-("
+ :autocmd BufWritePost * echo "Should not be displayed"
+ :
+ :try
+ : write
+ :catch
+ : echo v:exception
+ :endtry
+<
+ *except-autocmd-Cmd*
+For some commands, the normal action can be replaced by a sequence of
+autocommands. Exceptions from that sequence will be catchable by the caller
+of the command.
+ Example: For the ":write" command, the caller cannot know whether the file
+had actually been written when the exception occurred. You need to tell it in
+some way. >
+
+ :if !exists("cnt")
+ : let cnt = 0
+ :
+ : autocmd BufWriteCmd * if &modified
+ : autocmd BufWriteCmd * let cnt = cnt + 1
+ : autocmd BufWriteCmd * if cnt % 3 == 2
+ : autocmd BufWriteCmd * throw "BufWriteCmdError"
+ : autocmd BufWriteCmd * endif
+ : autocmd BufWriteCmd * write | set nomodified
+ : autocmd BufWriteCmd * if cnt % 3 == 0
+ : autocmd BufWriteCmd * throw "BufWriteCmdError"
+ : autocmd BufWriteCmd * endif
+ : autocmd BufWriteCmd * echo "File successfully written!"
+ : autocmd BufWriteCmd * endif
+ :endif
+ :
+ :try
+ : write
+ :catch /^BufWriteCmdError$/
+ : if &modified
+ : echo "Error on writing (file contents not changed)"
+ : else
+ : echo "Error after writing"
+ : endif
+ :catch /^Vim(write):/
+ : echo "Error on writing"
+ :endtry
+
+When this script is sourced several times after making changes, it displays
+first >
+ File successfully written!
+then >
+ Error on writing (file contents not changed)
+then >
+ Error after writing
+etc.
+
+ *except-autocmd-ill*
+You cannot spread a try conditional over autocommands for different events.
+The following code is ill-formed: >
+
+ :autocmd BufWritePre * try
+ :
+ :autocmd BufWritePost * catch
+ :autocmd BufWritePost * echo v:exception
+ :autocmd BufWritePost * endtry
+ :
+ :write
+
+
+EXCEPTION HIERARCHIES AND PARAMETERIZED EXCEPTIONS *except-hier-param*
+
+Some programming languages allow to use hierarchies of exception classes or to
+pass additional information with the object of an exception class. You can do
+similar things in Vim.
+ In order to throw an exception from a hierarchy, just throw the complete
+class name with the components separated by a colon, for instance throw the
+string "EXCEPT:MATHERR:OVERFLOW" for an overflow in a mathematical library.
+ When you want to pass additional information with your exception class, add
+it in parentheses, for instance throw the string "EXCEPT:IO:WRITEERR(myfile)"
+for an error when writing "myfile".
+ With the appropriate patterns in the ":catch" command, you can catch for
+base classes or derived classes of your hierarchy. Additional information in
+parentheses can be cut out from |v:exception| with the ":substitute" command.
+ Example: >
+
+ :function! CheckRange(a, func)
+ : if a:a < 0
+ : throw "EXCEPT:MATHERR:RANGE(" . a:func . ")"
+ : endif
+ :endfunction
+ :
+ :function! Add(a, b)
+ : call CheckRange(a:a, "Add")
+ : call CheckRange(a:b, "Add")
+ : let c = a:a + a:b
+ : if c < 0
+ : throw "EXCEPT:MATHERR:OVERFLOW"
+ : endif
+ : return c
+ :endfunction
+ :
+ :function! Div(a, b)
+ : call CheckRange(a:a, "Div")
+ : call CheckRange(a:b, "Div")
+ : if (a:b == 0)
+ : throw "EXCEPT:MATHERR:ZERODIV"
+ : endif
+ : return a:a / a:b
+ :endfunction
+ :
+ :function! Write(file)
+ : try
+ : execute "write" a:file
+ : catch /^Vim(write):/
+ : throw "EXCEPT:IO(" . getcwd() . ", " . a:file . "):WRITEERR"
+ : endtry
+ :endfunction
+ :
+ :try
+ :
+ : " something with arithmetics and I/O
+ :
+ :catch /^EXCEPT:MATHERR:RANGE/
+ : let function = substitute(v:exception, '.*(\(\a\+\)).*', '\1', "")
+ : echo "Range error in" function
+ :
+ :catch /^EXCEPT:MATHERR/ " catches OVERFLOW and ZERODIV
+ : echo "Math error"
+ :
+ :catch /^EXCEPT:IO/
+ : let dir = substitute(v:exception, '.*(\(.\+\),\s*.\+).*', '\1', "")
+ : let file = substitute(v:exception, '.*(.\+,\s*\(.\+\)).*', '\1', "")
+ : if file !~ '^/'
+ : let file = dir . "/" . file
+ : endif
+ : echo 'I/O error for "' . file . '"'
+ :
+ :catch /^EXCEPT/
+ : echo "Unspecified error"
+ :
+ :endtry
+
+The exceptions raised by Vim itself (on error or when pressing CTRL-C) use
+a flat hierarchy: they are all in the "Vim" class. You cannot throw yourself
+exceptions with the "Vim" prefix; they are reserved for Vim.
+ Vim error exceptions are parameterized with the name of the command that
+failed, if known. See |catch-errors|.
+
+
+PECULIARITIES
+ *except-compat*
+The exception handling concept requires that the command sequence causing the
+exception is aborted immediately and control is transferred to finally clauses
+and/or a catch clause.
+
+In the Vim script language there are cases where scripts and functions
+continue after an error: in functions without the "abort" flag or in a command
+after ":silent!", control flow goes to the following line, and outside
+functions, control flow goes to the line following the outermost ":endwhile"
+or ":endif". On the other hand, errors should be catchable as exceptions
+(thus, requiring the immediate abortion).
+
+This problem has been solved by converting errors to exceptions and using
+immediate abortion (if not suppressed by ":silent!") only when a try
+conditional is active. This is no restriction since an (error) exception can
+be caught only from an active try conditional. If you want an immediate
+termination without catching the error, just use a try conditional without
+catch clause. (You can cause cleanup code being executed before termination
+by specifying a finally clause.)
+
+When no try conditional is active, the usual abortion and continuation
+behavior is used instead of immediate abortion. This ensures compatibility of
+scripts written for Vim 6.1 and earlier.
+
+However, when sourcing an existing script that does not use exception handling
+commands (or when calling one of its functions) from inside an active try
+conditional of a new script, you might change the control flow of the existing
+script on error. You get the immediate abortion on error and can catch the
+error in the new script. If however the sourced script suppresses error
+messages by using the ":silent!" command (checking for errors by testing
+|v:errmsg| if appropriate), its execution path is not changed. The error is
+not converted to an exception. (See |:silent|.) So the only remaining cause
+where this happens is for scripts that don't care about errors and produce
+error messages. You probably won't want to use such code from your new
+scripts.
+
+ *except-syntax-err*
+Syntax errors in the exception handling commands are never caught by any of
+the ":catch" commands of the try conditional they belong to. Its finally
+clauses, however, is executed.
+ Example: >
+
+ :try
+ : try
+ : throw 4711
+ : catch /\(/
+ : echo "in catch with syntax error"
+ : catch
+ : echo "inner catch-all"
+ : finally
+ : echo "inner finally"
+ : endtry
+ :catch
+ : echo 'outer catch-all caught "' . v:exception . '"'
+ : finally
+ : echo "outer finally"
+ :endtry
+
+This displays: >
+ inner finally
+ outer catch-all caught "Vim(catch):E54: Unmatched \("
+ outer finally
+The original exception is discarded and an error exception is raised, instead.
+
+ *except-single-line*
+The ":try", ":catch", ":finally", and ":endtry" commands can be put on
+a single line, but then syntax errors may make it difficult to recognize the
+"catch" line, thus you better avoid this.
+ Example: >
+ :try | unlet! foo # | catch | endtry
+raises an error exception for the trailing characters after the ":unlet!"
+argument, but does not see the ":catch" and ":endtry" commands, so that the
+error exception is discarded and the "E488: Trailing characters" message gets
+displayed.
+
+ *except-several-errors*
+When several errors appear in a single command, the first error message is
+usually the most specific one and therefor converted to the error exception.
+ Example: >
+ echo novar
+causes >
+ E121: Undefined variable: novar
+ E15: Invalid expression: novar
+The value of the error exception inside try conditionals is: >
+ Vim(echo):E121: Undefined variable: novar
+< *except-syntax-error*
+But when a syntax error is detected after a normal error in the same command,
+the syntax error is used for the exception being thrown.
+ Example: >
+ unlet novar #
+causes >
+ E108: No such variable: "novar"
+ E488: Trailing characters
+The value of the error exception inside try conditionals is: >
+ Vim(unlet):E488: Trailing characters
+This is done because the syntax error might change the execution path in a way
+not intended by the user. Example: >
+ try
+ try | unlet novar # | catch | echo v:exception | endtry
+ catch /.*/
+ echo "outer catch:" v:exception
+ endtry
+This displays "outer catch: Vim(unlet):E488: Trailing characters", and then
+a "E600: Missing :endtry" error message is given, see |except-single-line|.
+
+==============================================================================
+9. Examples *eval-examples*
+
+Printing in Hex ~
+>
+ :" The function Nr2Hex() returns the Hex string of a number.
+ :func Nr2Hex(nr)
+ : let n = a:nr
+ : let r = ""
+ : while n
+ : let r = '0123456789ABCDEF'[n % 16] . r
+ : let n = n / 16
+ : endwhile
+ : return r
+ :endfunc
+
+ :" The function String2Hex() converts each character in a string to a two
+ :" character Hex string.
+ :func String2Hex(str)
+ : let out = ''
+ : let ix = 0
+ : while ix < strlen(a:str)
+ : let out = out . Nr2Hex(char2nr(a:str[ix]))
+ : let ix = ix + 1
+ : endwhile
+ : return out
+ :endfunc
+
+Example of its use: >
+ :echo Nr2Hex(32)
+result: "20" >
+ :echo String2Hex("32")
+result: "3332"
+
+
+Sorting lines (by Robert Webb) ~
+
+Here is a Vim script to sort lines. Highlight the lines in Vim and type
+":Sort". This doesn't call any external programs so it'll work on any
+platform. The function Sort() actually takes the name of a comparison
+function as its argument, like qsort() does in C. So you could supply it
+with different comparison functions in order to sort according to date etc.
+>
+ :" Function for use with Sort(), to compare two strings.
+ :func! Strcmp(str1, str2)
+ : if (a:str1 < a:str2)
+ : return -1
+ : elseif (a:str1 > a:str2)
+ : return 1
+ : else
+ : return 0
+ : endif
+ :endfunction
+
+ :" Sort lines. SortR() is called recursively.
+ :func! SortR(start, end, cmp)
+ : if (a:start >= a:end)
+ : return
+ : endif
+ : let partition = a:start - 1
+ : let middle = partition
+ : let partStr = getline((a:start + a:end) / 2)
+ : let i = a:start
+ : while (i <= a:end)
+ : let str = getline(i)
+ : exec "let result = " . a:cmp . "(str, partStr)"
+ : if (result <= 0)
+ : " Need to put it before the partition. Swap lines i and partition.
+ : let partition = partition + 1
+ : if (result == 0)
+ : let middle = partition
+ : endif
+ : if (i != partition)
+ : let str2 = getline(partition)
+ : call setline(i, str2)
+ : call setline(partition, str)
+ : endif
+ : endif
+ : let i = i + 1
+ : endwhile
+
+ : " Now we have a pointer to the "middle" element, as far as partitioning
+ : " goes, which could be anywhere before the partition. Make sure it is at
+ : " the end of the partition.
+ : if (middle != partition)
+ : let str = getline(middle)
+ : let str2 = getline(partition)
+ : call setline(middle, str2)
+ : call setline(partition, str)
+ : endif
+ : call SortR(a:start, partition - 1, a:cmp)
+ : call SortR(partition + 1, a:end, a:cmp)
+ :endfunc
+
+ :" To Sort a range of lines, pass the range to Sort() along with the name of a
+ :" function that will compare two lines.
+ :func! Sort(cmp) range
+ : call SortR(a:firstline, a:lastline, a:cmp)
+ :endfunc
+
+ :" :Sort takes a range of lines and sorts them.
+ :command! -nargs=0 -range Sort <line1>,<line2>call Sort("Strcmp")
+<
+ *sscanf*
+There is no sscanf() function in Vim. If you need to extract parts from a
+line, you can use matchstr() and substitute() to do it. This example shows
+how to get the file name, line number and column number out of a line like
+"foobar.txt, 123, 45". >
+ :" Set up the match bit
+ :let mx='\(\f\+\),\s*\(\d\+\),\s*\(\d\+\)'
+ :"get the part matching the whole expression
+ :let l = matchstr(line, mx)
+ :"get each item out of the match
+ :let file = substitute(l, mx, '\1', '')
+ :let lnum = substitute(l, mx, '\2', '')
+ :let col = substitute(l, mx, '\3', '')
+
+The input is in the variable "line", the results in the variables "file",
+"lnum" and "col". (idea from Michael Geddes)
+
+==============================================================================
+10. No +eval feature *no-eval-feature*
+
+When the |+eval| feature was disabled at compile time, none of the expression
+evaluation commands are available. To prevent this from causing Vim scripts
+to generate all kinds of errors, the ":if" and ":endif" commands are still
+recognized, though the argument of the ":if" and everything between the ":if"
+and the matching ":endif" is ignored. Nesting of ":if" blocks is allowed, but
+only if the commands are at the start of the line. The ":else" command is not
+recognized.
+
+Example of how to avoid executing commands when the |+eval| feature is
+missing: >
+
+ :if 1
+ : echo "Expression evaluation is compiled in"
+ :else
+ : echo "You will _never_ see this message"
+ :endif
+
+==============================================================================
+11. The sandbox *eval-sandbox* *sandbox* *E48*
+
+The 'foldexpr', 'includeexpr', 'indentexpr', 'statusline' and 'foldtext'
+options are evaluated in a sandbox. This means that you are protected from
+these expressions having nasty side effects. This gives some safety for when
+these options are set from a modeline. It is also used when the command from
+a tags file is executed.
+This is not guaranteed 100% secure, but it should block most attacks.
+
+These items are not allowed in the sandbox:
+ - changing the buffer text
+ - defining or changing mapping, autocommands, functions, user commands
+ - setting certain options (see |option-summary|)
+ - executing a shell command
+ - reading or writing a file
+ - jumping to another buffer or editing a file
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/evim.1 b/runtime/doc/evim.1
new file mode 100644
index 000000000..bd25ed6eb
--- /dev/null
+++ b/runtime/doc/evim.1
@@ -0,0 +1,49 @@
+.TH EVIM 1 "2002 February 16"
+.SH NAME
+evim \- easy Vim, edit a file with Vim and setup for modeless editing
+.SH SYNOPSIS
+.br
+.B evim
+[options] [file ..]
+.br
+.B eview
+.SH DESCRIPTION
+.B eVim
+starts
+.B Vim
+and sets options to make it behave like a modeless editor.
+This is still Vim but used as a point-and-click editor.
+This feels a lot like using Notepad on MS-Windows.
+.B eVim
+will always run in the GUI, to enable the use of menus and toolbar.
+.PP
+Only to be used for people who really can't work with Vim in the normal way.
+Editing will be much less efficient.
+.PP
+.B eview
+is the same, but starts in read-only mode. It works just like evim -R.
+.PP
+See vim(1) for details about Vim, options, etc.
+.PP
+The 'insertmode' option is set to be able to type text directly.
+.br
+Mappings are setup to make Copy and Paste work with the MS-Windows keys.
+CTRL-X cuts text, CTRL-C copies text and CTRL-V pastes text.
+Use CTRL-Q to obtain the original meaning of CTRL-V.
+.SH OPTIONS
+See vim(1).
+.SH FILES
+.TP 15
+/usr/local/lib/vim/evim.vim
+The script loaded to initialize eVim.
+.SH AKA
+Also Known As "Vim for gumbies".
+When using evim you are expected to take a handkerchief,
+make a knot in each corner and wear it on your head.
+.SH SEE ALSO
+vim(1)
+.SH AUTHOR
+Most of
+.B Vim
+was made by Bram Moolenaar, with a lot of help from others.
+See the Help/Credits menu.
diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt
new file mode 100644
index 000000000..9902709da
--- /dev/null
+++ b/runtime/doc/farsi.txt
@@ -0,0 +1,269 @@
+*farsi.txt* For Vim version 7.0aa. Last change: 2002 Oct 29
+
+
+ VIM REFERENCE MANUAL by Mortaza Ghassab Shiran
+
+
+Right to Left and Farsi Mapping for Vim *farsi* *Farsi*
+
+{Vi does not have any of these commands}
+
+ *E27*
+In order to use right-to-left and Farsi mapping support, it is necessary to
+compile Vim with the |+farsi| feature.
+
+These functions have been made by Mortaza G. Shiran <shiran@jps.net>
+
+
+Introduction
+------------
+In right-to-left oriented files the characters appear on the screen from right
+to left. This kind of file is most useful when writing Farsi documents,
+composing faxes or writing Farsi memos.
+
+The commands, prompts and help files are not in Farsi, therefore the user
+interface remains the standard Vi interface.
+
+
+Highlights
+----------
+o Editing left-to-right files as in the original Vim, no change.
+
+o Viewing and editing files in right-to-left windows. File orientation is
+ per window, so it is possible to view the same file in right-to-left and
+ left-to-right modes, simultaneously.
+
+o Compatibility to the original Vim. Almost all features work in
+ right-to-left mode (see bugs below).
+
+o Changing keyboard mapping and reverse insert modes using a single
+ command.
+
+o Backing from reverse insert mode to the correct place in the file
+ (if possible).
+
+o While in Farsi mode, numbers are entered from left to right. Upon entering
+ a none number character, that character will be inserted just into the
+ left of the last number.
+
+o No special terminal with right-to-left capabilities is required. The
+ right-to-left changes are completely hardware independent. Only
+ Farsi font is necessary.
+
+o Farsi keymapping on the command line in reverse insert mode.
+
+o Toggling between left-to-right and right-to-left via F8 function key.
+
+o Toggling between Farsi ISIR-3342 standard encoding and VIM Farsi via F9
+ function key. Since this makes sense only for the text written in
+ right-to-left mode, this function is also supported only in right-to-left
+ mode.
+
+Farsi Fonts *farsi fonts*
+-----------
+
+If the "extra" archive has been unpacked, the following files are found in the
+subdirectories of the '$VIM/farsi' directory:
+
+ + far-a01.pcf X Windows fonts for Unix including Linux systems
+ + far-a01.bf X Windows fonts for SunOs
+ + far-a01.f16 a screen fonts for Unix including Linux systems
+ + far-a01.fon a monospaced fonts for Windows NT/95/98
+ + far-a01.com a screen fonts for DOS
+
+
+Font Installation
+-----------------
+
+o Installation of fonts for MS Window systems (NT/95/98)
+
+ From 'Control Panel' folder, start the 'Fonts' program. Then from 'file'
+ menu item select 'Install New Fonts ...'. Browse and select the
+ 'far-a01.fon', then follow the installation guide.
+ NOTE: several people have reported that this does not work. The solution
+ is unknown.
+
+o Installation of fonts for X Window systems (Unix/Linux)
+
+ Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a
+ directory of your choice. Change to the directory containing the Farsi
+ fonts and execute the following commands:
+
+ > mkfontdir
+ > xset +fp path_name_of_farsi_fonts_directory
+
+o Installation of fonts for X Window systems (SunOs)
+
+ Copy far-a01.bf font into a directory of your choice.
+ Change to the directory containing the far-a01.fb fonts and
+ execute the following commands:
+
+ > fldfamily
+ > xset +fp path_name_of_fonts_directory
+
+o Installation of ASCII screen fonts (Unix/Linux)
+
+ For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts
+ directory and execute the setfont program as "setfont far-a01.f16". For
+ other systems (e.g. SCO Unix), please refer to the fonts installation
+ section of your system administration manuals.
+
+o Installation of ASCII screen fonts (DOS)
+
+ After system power on, prior to the first use of VIM, upload the Farsi
+ fonts by executing the far-a01.com font uploading program.
+
+
+Usage
+-----
+Prior to starting VIM, the environment in which VIM can run in Farsi mode,
+must be set. In addition to installation of Farsi fonts, following points
+refer to some of the system environments, which you may need to set:
+Key code mapping, loading graphic card in ASCII screen mode, setting the IO
+driver in 8 bit clean mode ... .
+
+o Setting the Farsi fonts
+
+ + For VIM GUI set the 'guifont' to far-a01. This is done by entering
+ ':set guifont=far-a01' in the VIM window.
+
+ You can have 'guifont' set to far-a01 by VIM during the VIM startup
+ by appending the ':set guifont=far-a01' into your .vimrc file
+ (in case of NT/95/98 platforms _vimrc).
+
+ Under the X Window environment, you can also start the VIM with
+ '-fn far-a01' option.
+
+ + For the VIM within a xterm, start a xterm with the Farsi fonts (e.g.
+ kterm -fn far-a01). Then start the VIM inside the kterm.
+
+ + For VIM under DOS, prior to the first usage of VIM, upload the Farsi
+ fonts by executing the far-a01.com fonts uploading program.
+
+o Farsi Keymapping Activation
+
+ To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'.
+ This is done by entering ':set akm' or ':set fk' in the VIM window.
+ You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm'
+ or ':set fk' in your .vimrc file or _vimrc in case of NT/95/98 platforms.
+
+ To turn off the Farsi keymapping as a default second language keymapping,
+ reset the 'altkeymap' by entering ':set noakm'.
+
+o right-to-left Farsi Mode
+
+ By default VIM starts in Left-to-right mode. Following are ways to change
+ the window orientation:
+
+ + Start the VIM with -F option (e.g. vim -F ... ).
+
+ + Use F8 function key to toggle between left-to-right and right-to-left.
+
+ + While in Left-to-right mode, enter 'set rl' in the command line ('rl' is
+ the abbreviation for rightleft).
+
+ + Put the 'set rl' line in your '.vimrc' file to start the VIM in
+ right-to-left mode permanently.
+
+Encoding
+--------
+
+The letter encoding used is the VIM extended ISIR-3342 standard with a built
+in function to convert between VIM extended ISIR-3342 and ISIR-3342 standard.
+
+For document portability reasons, the letter encoding is kept the same across
+different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
+
+
+o Keyboard
+
+ + CTRL-_ in insert/replace modes toggles between Farsi(akm)/Latin
+ mode as follows:
+
+ + CTRL-_ moves the cursor to the end of the typed text in edit mode.
+
+ + CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/
+ Latin. The Farsi text is then entered in reverse insert mode.
+
+ + F8 - Toggles between left-to-right and right-to-left.
+
+ + F9 - Toggles the encoding between ISIR-3342 standard and VIM extended
+ ISIR-3342 (supported only in right-to-left mode).
+
+ + Keyboard mapping is based on the Iranian ISIRI-2901 standard.
+ Following table shows the keyboard mapping while Farsi(akm) mode set:
+
+ -------------------------------------
+ ` 1 2 3 4 5 6 7 8 9 0 - =
+ ¢ ± ² ³ ´ µ ¶ · ¸ ¹ ° ­ ½
+ -------------------------------------
+ ~ ! @ # $ % ^ & * ( ) _ +
+ ~ £ § ® ¤ ¥ ª ¬ è ¨ © é «
+ -------------------------------------
+ q w e r t z u i o p [ ]
+ Ó Ò Æ Ù Ø Õ Ö à Ê É Ç ˆ
+ -------------------------------------
+ Q W E R T Z U I O P { }
+ ÷ õ ô ó ò ý ð ö [ ] { }
+ -------------------------------------
+ a s d f g h j k l ; ' \
+ Ñ Ð á Ã Ü Á Å Þ Ý Ú Û ë
+ -------------------------------------
+ A S D F G H J K L : " |
+ ù û  þ ú ø À ü æ ç º » ê
+ -------------------------------------
+ < y x c v b n m , . /
+ ¾ × Ô Î Í Ì Ë Ä ß ¦ ¯
+ -------------------------------------
+ > Y X C V B N M < > ?
+ ¼ ñ Ô Ï Í ¡ Ë Â ¾ ¼ ¿
+ -------------------------------------
+
+Note:
+ ¡ stands for Farsi PSP (break without space)
+
+ ¢ stands for Farsi PCN (for HAMZE attribute )
+
+Restrictions
+------------
+
+o In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not
+ supported.
+
+o If you change the character mapping between Latin/Farsi, the redo buffer
+ will be reset (emptied). That is, redo is valid and will function (using
+ '.') only within the mode you are in.
+
+o While numbers are entered in Farsi mode, the redo buffer will be reset
+ (emptied). That is, you can not redo the last changes (using '.') after
+ entering numbers.
+
+o While in left-to-right and Farsi mode set, CTRL-R is not supported.
+
+o While in right-to-left mode, the search on 'Latin' pattern does not work,
+ except if you enter the Latin search pattern in reverse.
+
+o In the command mode, there is no support for entering the numbers from left
+ to right and also for the sake of the flexibility the keymapping logic is
+ restricted.
+
+o Under X Window environment, if you want to run the VIM within a xterm
+ terminal emulator and Farsi mode set, you need to have an ANSI compatible
+ xterm terminal emulator. This is because the letter codes above 128 decimal
+ have certain meanings in the standard xterm terminal emulator.
+
+ Note: Under X Window environment, VIM GUI works fine in Farsi mode.
+ This eliminates the need of any xterm terminal emulator.
+
+
+Bugs
+----
+While in insert/replace and Farsi mode set, if you repeatedly change the
+cursor position (via cursor movement) and enter new text and then try to undo
+the last change, the undo will lag one change behind. But as you continue to
+undo, you will reach the original line of text. You can also use U to undo all
+changes made in the current line.
+
+For more information about the bugs refer to rileft.txt.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
new file mode 100644
index 000000000..a855d4661
--- /dev/null
+++ b/runtime/doc/filetype.txt
@@ -0,0 +1,529 @@
+*filetype.txt* For Vim version 7.0aa. Last change: 2004 May 05
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Filetypes *filetype* *file-type*
+
+1. Filetypes |filetypes|
+2. Filetype plugin |filetype-plugins|
+3. Docs for the default filetype plugins. |ftplugin-docs|
+
+Also see |autocmd.txt|.
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Filetypes *filetypes* *file-types*
+
+Vim can detect the type of file that is edited. This is done by checking the
+file name and sometimes by inspecting the contents of the file for specific
+text.
+
+ *:filetype* *:filet*
+To enable file type detection, use this command in your vimrc: >
+ :filetype on
+Each time a new or existing file is edited, Vim will try to recognize the type
+of the file and set the 'filetype' option. This will trigger the FileType
+event, which can be used to set the syntax highlighting, set options, etc.
+
+NOTE: Filetypes and 'compatible' don't work together well, since being Vi
+compatible means options are global. Resetting 'compatible' is recommended,
+if you didn't do that already.
+
+Detail: The ":filetype on" command will load one of these files:
+ Amiga $VIMRUNTIME/filetype.vim
+ Mac $VIMRUNTIME:filetype.vim
+ MS-DOS $VIMRUNTIME\filetype.vim
+ RiscOS Vim:Filetype
+ Unix $VIMRUNTIME/filetype.vim
+ VMS $VIMRUNTIME/filetype.vim
+ This file is a Vim script that defines autocommands for the
+ BufNewFile and BufRead events. If the file type is not found by the
+ name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
+ contents of the file.
+
+To add your own file types, see |new-filetype| below.
+
+If the file type is not detected automatically, or it finds the wrong type,
+you can either set the 'filetype' option manually, or add a modeline to your
+file. Example, for in an IDL file use the command: >
+ :set filetype=idl
+or add this |modeline| to the file: >
+ /* vim: set filetype=idl : */
+<
+ *:filetype-plugin-on*
+You can enable loading the plugin files for specific file types with: >
+ :filetype plugin on
+If filetype detection was not switched on yet, it will be as well.
+This actually loads the file "ftplugin.vim" in 'runtimepath'.
+The result is that when a file is edited its plugin file is loaded (if there
+is one for the detected filetype). |filetype-plugin|
+
+ *:filetype-plugin-off*
+You can disable it again with: >
+ :filetype plugin off
+The filetype detection is not switched off then. But if you do switch off
+filetype detection, the plugins will not be loaded either.
+This actually loads the file "ftplugof.vim" in 'runtimepath'.
+
+ *:filetype-indent-on*
+You can enable loading the indent file for specific file types with: >
+ :filetype indent on
+If filetype detection was not switched on yet, it will be as well.
+This actually loads the file "indent.vim" in 'runtimepath'.
+The result is that when a file is edited its indent file is loaded (if there
+is one for the detected filetype). |indent-expression|
+
+ *:filetype-indent-off*
+You can disable it again with: >
+ :filetype indent off
+The filetype detection is not switched off then. But if you do switch off
+filetype detection, the indent files will not be loaded either.
+This actually loads the file "indoff.vim" in 'runtimepath'.
+
+ *:filetype-off*
+To disable file type detection, use this command: >
+ :filetype off
+This will keep the flags for "plugin" and "indent", but since no file types
+are being detected, they won't work until the next ":filetype on".
+
+
+Overview: *:filetype-overview*
+
+command detection plugin indent ~
+:filetype on on unchanged unchanged
+:filetype off off unchanged unchanged
+:filetype plugin on on on unchanged
+:filetype plugin off unchanged off unchanged
+:filetype indent on on unchanged on
+:filetype indent off unchanged unchanged off
+:filetype plugin indent on on on on
+:filetype plugin indent off unchanged off off
+
+To see the current status, type: >
+ :filetype
+The output looks something like this: >
+ filetype detection:ON plugin:ON indent:OFF
+
+The file types are also used for syntax highlighting. If the ":syntax on"
+command is used, the file type detection is installed too. There is no need
+to do ":filetype on" after ":syntax on".
+
+To disable one of the file types, add a line in the your filetype file, see
+|remove-filetype|.
+
+ *filetype-detect*
+To detect the file type again: >
+ :filetype detect
+Use this if you started with an empty file and typed text that makes it
+possible to detect the file type. For example, when you entered this in a
+shell script: "#!/bin/csh".
+ When filetype detection was off, it will be enabled first, like the "on"
+argument was used.
+
+ *filetype-overrule*
+When the same extension is used for two filetypes, Vim tries to guess what
+kind of file it is. This doesn't always work. A number of global variables
+can be used to overrule the filetype used for certain extensions:
+
+ file name variable ~
+ *.asa g:filetype_asa |aspvbs-syntax| |aspperl-syntax|
+ *.asp g:filetype_asp |aspvbs-syntax| |aspperl-syntax|
+ *.asm g:asmsyntax |asm-syntax|
+ *.prg g:filetype_prg
+ *.pl g:filetype_pl
+ *.inc g:filetype_inc
+ *.w g:filetype_w |cweb-syntax|
+ *.i g:filetype_i |progress-syntax|
+ *.p g:filetype_p |pascal-syntax|
+ *.sh g:bash_is_sh |sh-syntax|
+
+ *filetype-ignore*
+To avoid that certain files are being inspected, the g:ft_ignore_pat variable
+is used. The default value is set like this: >
+ :let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
+This means that the contents of compressed files are not inspected.
+
+ *new-filetype*
+If a file type that you want to use is not detected yet, there are three ways
+to add it. In any way, it's better not modify the $VIMRUNTIME/filetype.vim
+file. It will be overwritten when installing a new version of Vim.
+
+A. If you want to overrule all default file type checks.
+ This works by writing one file for each filetype. The disadvantage is that
+ means there can be many files. The advantage is that you can simply drop
+ this file in the right directory to make it work.
+
+ 1. Create your user runtime directory. You would normally use the first
+ item of the 'runtimepath' option. Then create the directory "ftdetect"
+ inside it. Example for Unix: >
+ :!mkdir ~/.vim
+ :!mkdir ~/.vim/ftdetect
+<
+ 2. Create a file that contains an autocommand to detect the file type.
+ Example: >
+ au BufRead,BufNewFile *.mine set filetype=mine
+< Note that there is no "augroup" command, this has already been done
+ when sourcing your file. You could also use the pattern "*" and then
+ check the contents of the file to recognize it.
+ Write this file as "mine.vim" in the "ftdetect" directory in your user
+ runtime directory. For example, for Unix: >
+ :w ~/.vim/ftdetect/mine.vim
+
+< 3. To use the new filetype detection you must restart Vim.
+
+ The files in the "ftdetect" directory are used after all the default
+ checks, thus they can overrule a previously detected file type.
+
+B. If you want to detect your file after the default file type checks.
+
+ This works like A above, but instead of setting 'filetype' unconditionally
+ use ":setfiletype". This will only set 'filetype' if no file type was
+ detected yet. Example: >
+ au BufRead,BufNewFile *.txt setfiletype text
+<
+ You can also use the already detected file type in your command. For
+ example, to use the file type "mypascal" when "pascal" has been detected: >
+ au BufRead,BufNewFile * if &ft == 'pascal' | set ft=mypascal
+ | endif
+
+C. If your file type can be detected by the file name.
+ 1. Create your user runtime directory. You would normally use the first
+ item of the 'runtimepath' option. Example for Unix: >
+ :!mkdir ~/.vim
+<
+ 2. Create a file that contains autocommands to detect the file type.
+ Example: >
+ " my filetype file
+ if exists("did_load_filetypes")
+ finish
+ endif
+ augroup filetypedetect
+ au! BufRead,BufNewFile *.mine setfiletype mine
+ au! BufRead,BufNewFile *.xyz setfiletype drawing
+ augroup END
+< Write this file as "filetype.vim" in your user runtime directory. For
+ example, for Unix: >
+ :w ~/.vim/filetype.vim
+
+< 3. To use the new filetype detection you must restart Vim.
+
+ Your filetype.vim will be sourced before the default FileType autocommands
+ have been installed. Your autocommands will match first, and the
+ ":setfiletype" command will make sure that no other autocommands will set
+ 'filetype' after this.
+ *new-filetype-scripts*
+D. If your filetype can only be detected by inspecting the contents of the
+ file.
+
+ 1. Create your user runtime directory. You would normally use the first
+ item of the 'runtimepath' option. Example for Unix: >
+ :!mkdir ~/.vim
+<
+ 2. Create a vim script file for doing this. Example: >
+ if did_filetype() " filetype already set..
+ finish " ..don't do these checks
+ endif
+ if getline(1) =~ '^#!.*\<mine\>'
+ setfiletype mine
+ elseif getline(1) =~? '\<drawing\>'
+ setfiletype drawing
+ endif
+< See $VIMRUNTIME/scripts.vim for more examples.
+ Write this file as "scripts.vim" in your user runtime directory. For
+ example, for Unix: >
+ :w ~/.vim/scripts.vim
+<
+ 3. The detection will work right away, no need to restart Vim.
+
+ Your scripts.vim is loaded before the default checks for file types, which
+ means that your rules override the default rules in
+ $VIMRUNTIME/scripts.vim.
+
+ *remove-filetype*
+If a file type is detected that is wrong for you, install a filetype.vim or
+scripts.vim to catch it (see above). You can set 'filetype' to a non-existing
+name to avoid that it will be set later anyway: >
+ :set filetype=ignored
+
+If you are setting up a system with many users, and you don't want each user
+to add/remove the same filetypes, consider writing the filetype.vim and
+scripts.vim files in a runtime directory that is used for everybody. Check
+the 'runtimepath' for a directory to use. If there isn't one, set
+'runtimepath' in the |system-vimrc|. Be careful to keep the default
+directories!
+
+
+ *autocmd-osfiletypes*
+On operating systems which support storing a file type with the file, you can
+specify that an autocommand should only be executed if the file is of a
+certain type.
+
+The actual type checking depends on which platform you are running Vim
+on; see your system's documentation for details.
+
+To use osfiletype checking in an autocommand you should put a list of types to
+match in angle brackets in place of a pattern, like this: >
+
+ :au BufRead *.html,<&faf;HTML> runtime! syntax/html.vim
+
+This will match:
+
+- Any file whose name ends in `.html'
+- Any file whose type is `&faf' or 'HTML', where the meaning of these types
+ depends on which version of Vim you are using.
+ Unknown types are considered NOT to match.
+
+You can also specify a type and a pattern at the same time (in which case they
+must both match): >
+
+ :au BufRead <&fff>diff*
+
+This will match files of type `&fff' whose names start with `diff'.
+
+Note that osfiletype checking is skipped if Vim is compiled without the
+|+osfiletype| feature.
+
+ *plugin-details*
+The "plugin" directory can be in any of the directories in the 'runtimepath'
+option. All of these directories will be searched for plugins and they are
+all loaded. For example, if this command: >
+
+ set runtimepath
+
+produces this output: >
+
+ runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60
+
+then Vim will load all plugins in these directories: >
+
+ /etc/vim/plugin/
+ ~/.vim/plugin/
+ /usr/local/share/vim/vim60/plugin/
+
+Note that the last one is the value of $VIMRUNTIME which has been expanded.
+
+What if it looks like your plugin is not being loaded? You can find out what
+happens when Vim starts up by using the |-V| argument: >
+ vim -V1
+You will see a lot of messages, in between them is a remark about loading the
+plugins. It starts with: >
+ Searching for "plugin/*.vim" in
+There you can see where Vim looks for your plugin scripts.
+
+==============================================================================
+2. Filetype plugin *filetype-plugins*
+
+When loading filetype plugins has been enabled |:filetype-plugin-on|, options
+will be set and mappings defined. These are all local to the buffer, they
+will not be used for other files.
+
+Defining mappings for a filetype may get in the way of the mappings you
+define yourself. There are a few ways to avoid this:
+1. Set the "maplocalleader" variable to the key sequence you want the mappings
+ to start with. Example: >
+ :let maplocalleader = ","
+< All mappings will then start with a comma instead of the default, which
+ is a backslash. Also see |<LocalLeader>|.
+
+2. Define your own mapping. Example: >
+ :map ,p <Plug>MailQuote
+< You need to check the description of the plugin file below for the
+ functionality it offers and the string to map to.
+ You need to define your own mapping before the plugin is loaded (before
+ editing a file of that type). The plugin will then skip installing the
+ default mapping.
+
+3. Disable defining mappings for a specific filetype by setting a variable,
+ which contains the name of the filetype. For the "mail" filetype this
+ would be: >
+ :let no_mail_maps = 1
+
+4. Disable defining mappings for all filetypes by setting a variable: >
+ :let no_plugin_maps = 1
+<
+
+ *ftplugin-overrule*
+If a global filetype plugin does not do exactly what you want, there are three
+ways to change this:
+
+1. Add a few settings.
+ You must create a new filetype plugin in a directory early in
+ 'runtimepath'. For Unix, for example you could use this file: >
+ vim ~/.vim/ftplugin/fortran.vim
+< You can set those settings and mappings that you would like to add. Note
+ that the global plugin will be loaded after this, it may overrule the
+ settings that you do here. If this is the case, you need to use one of the
+ following two methods.
+
+2. Make a copy of the plugin and change it.
+ You must put the copy in a directory early in 'runtimepath'. For Unix, for
+ example, you could do this: >
+ cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
+< Then you can edit the copied file to your liking. Since the b:did_ftplugin
+ variable will be set, the global plugin will not be loaded.
+ A disadvantage of this method is that when the distributed plugin gets
+ improved, you will have to copy and modify it again.
+
+3. Overrule the settings after loading the global plugin.
+ You must create a new filetype plugin in a directory from the end of
+ 'runtimepath'. For Unix, for example, you could use this file: >
+ vim ~/.vim/after/ftplugin/fortran.vim
+< In this file you can change just those settings that you want to change.
+
+==============================================================================
+3. Docs for the default filetype plugins. *ftplugin-docs*
+
+
+CHANGELOG *changelog-plugin*
+
+Allows for easy entrance of Changelog entries in Changelog files. There are
+some commands, mappings, and variables worth exploring:
+
+Options:
+'comments' is made empty to not mess up formatting.
+'textwidth' is set to 78, which is standard.
+'formatoptions' the 't' flag is added to wrap when inserting text.
+
+Commands:
+NewChangelogEntry Adds a new Changelog entry in an intelligent fashion
+ (see below).
+
+Local mappings:
+<Leader>o Starts a new Changelog entry in an equally intelligent
+ fashion (see below).
+
+Global mappings:
+ NOTE: The global mappings are accessed by sourcing the
+ ftplugin/changelog.vim file first, e.g. with >
+ runtime ftplugin/man.vim
+< in your |.vimrc|.
+<Leader>o Switches to the ChangeLog buffer opened for the
+ current directory, or opens it in a new buffer if it
+ exists in the current directory. Then it does the
+ same as the local <Leader>o described above.
+
+Variables:
+g:changelog_timeformat The date (and time) format used in ChangeLog entries.
+ The format accepted is the same as for the
+ |strftime()| function.
+ The default is "%Y-%m-%d" which is the standard format
+ for many ChangeLog layouts.
+g:changelog_username The name and email address of the user.
+ The default is deduced from environment variables and
+ system files. It searches /etc/passwd for the comment
+ part of the current user, which informally contains
+ the real name of the user up to the first separating
+ comma. then it checks the $NAME environment variable
+ and finally runs `whoami` and `hostname` to build an
+ email address. The final form is >
+ Full Name <user@host>
+<
+g:changelog_new_date_format
+ The format to use when creating a new date-entry.
+ The following table describes special tokens in the
+ string:
+ %% insert a single '%' character
+ %d insert the date from above
+ %u insert the user from above
+ %c where to position cursor when done
+ The default is "%d %u\n\n\t* %c\n\n", which produces
+ something like (| is where cursor will be, unless at
+ the start of the line where it denotes the beginning
+ of the line) >
+ |2003-01-14 Full Name <user@host>
+ |
+ | * |
+<
+g:changelog_new_entry_format
+ The format used when creating a new entry.
+ The following table describes special tokens in the
+ string:
+ %c where to position cursor when done
+ The default is "\t*%c", which produces something
+ similar to >
+ | * |
+<
+g:changelog_date_entry_search
+ The search pattern to use when searching for a
+ date-entry.
+ The same tokens that can be used for
+ g:changelog_new_date_format can be used here as well.
+ The default is '^\s*%d\_s*%u' which finds lines
+ matching the form >
+ |2003-01-14 Full Name <user@host>
+< and some similar formats.
+
+The Changelog entries are inserted where they add the least amount of text.
+After figuring out the current date and user, the file is searched for an
+entry beginning with the current date and user and if found adds another item
+under it. If not found, a new entry and item is prepended to the beginning of
+the Changelog.
+
+
+FORTRAN *fortran-plugin*
+
+Options:
+'expandtab' is switched on to avoid tabs as required by the Fortran
+ standards unless the user has set fortran_have_tabs in .vimrc.
+'textwidth' is set to 72 for fixed source format as required by the
+ Fortran standards and to 80 for free source format.
+'formatoptions' is set to break code and comment lines and to preserve long
+ lines. You can format comments with |gq|.
+For further discussion of fortran_have_tabs and the method used for the
+detection of source format see |fortran-syntax|.
+
+
+MAIL *mail-plugin*
+
+Options:
+'modeline' is switched off to avoid the danger of trojan horses, and to
+ avoid that a Subject line with "Vim:" in it will cause an
+ error message.
+'textwidth' is set to 72. This is often recommended for e-mail.
+'formatoptions' is set to break text lines and to repeat the comment leader
+ in new lines, so that a leading ">" for quotes is repeated.
+ You can also format quoted text with |gq|.
+
+Local mappings:
+<LocalLeader>q or \\MailQuote
+ Quotes the text selected in Visual mode, or from the cursor position
+ to the end of the file in Normal mode. This means "> " is inserted in
+ each line.
+
+MAN *man-plugin* *:Man*
+
+Displays a manual page in a nice way. Also see the user manual
+|find-manpage|.
+
+To start using the ":Man" command before any manual page was loaded, source
+this script from your startup vimrc file: >
+
+ runtime ftplugin/man.vim
+
+Options:
+'iskeyword' the '.' character is added to be able to use CTRL-] on the
+ manual page name.
+
+Commands:
+Man {name} Display the manual page for {name} in a window.
+Man {number} {name}
+ Display the manual page for {name} in a section {number}.
+
+Global mapping:
+<Leader>K Displays the manual page for the word under the cursor.
+
+Local mappings:
+CTRL-] Jump to the manual page for the word under the cursor.
+CTRL-T Jump back to the previous manual page.
+
+
+RPM SPEC *spec-plugin*
+
+Since the text for this plugin is rather long it has been put in a separate
+file: |pi_spec.txt|.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
new file mode 100644
index 000000000..cbe1237ea
--- /dev/null
+++ b/runtime/doc/fold.txt
@@ -0,0 +1,581 @@
+*fold.txt* For Vim version 7.0aa. Last change: 2004 May 20
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Folding *Folding* *folding*
+
+You can find an introduction on folding in chapter 28 of the user manual.
+|usr_28.txt|
+
+1. Fold methods |fold-methods|
+2. Fold commands |fold-commands|
+3. Fold options |fold-options|
+4. Behavior of folds |fold-behavior|
+
+{Vi has no Folding}
+{not available when compiled without the +folding feature}
+
+==============================================================================
+1. Fold methods *fold-methods*
+
+The folding method can be set with the 'foldmethod' option.
+
+When setting 'foldmethod' to a value other than "manual", all folds are
+deleted and new ones created. Switching to the "manual" method doesn't remove
+the existing folds. This can be used to first define the folds automatically
+and then change them manually.
+
+There are six methods to select folds:
+ manual manually define folds
+ indent more indent means a higher fold level
+ expr specify an expression to define folds
+ syntax folds defined by syntax highlighting
+ diff folds for unchanged text
+ marker folds defined by markers in the text
+
+
+MANUAL *fold-manual*
+
+Use commands to manually define the fold regions. This can also be used by a
+script that parses text to find folds.
+
+The level of a fold is only defined by its nesting. To increase the fold
+level of a fold for a range of lines, define a fold inside it that has the
+same lines.
+
+The manual folds are lost when you abandon the file. To save the folds use
+the |:mkview| command. The view can be restored later with |:loadview|.
+
+
+INDENT *fold-indent*
+
+The folds are automatically defined by the indent of the lines.
+
+The foldlevel is computed from the indent of the line, divided by the
+'shiftwidth' (rounded down). A sequence of lines with the same or higher fold
+level form a fold, with the lines with a higher level forming a nested fold.
+
+The nesting of folds is limited with 'foldnestmax'.
+
+Some lines are ignored and get the fold level of the line above or below it,
+whatever is the lowest. These are empty or white lines and lines starting
+with a character in 'foldignore'. White space is skipped before checking for
+characters in 'foldignore'. For C use "#" to ignore preprocessor lines.
+
+When you want to ignore lines in another way, use the 'expr' method. The
+|indent()| function can be used in 'foldexpr' to get the indent of a line.
+
+
+EXPR *fold-expr*
+
+The folds are automatically defined by their foldlevel, like with the "indent"
+method. The value of the 'foldexpr' option is evaluated to get the foldlevel
+of a line. Examples:
+This will create a fold for all consecutive lines that start with a Tab: >
+ :set foldexpr=getline(v:lnum)[0]==\"\\t\"
+This will call a function to compute the fold level: >
+ :set foldexpr=MyFoldLevel(v:lnum)
+This will make a fold out of paragraphs separated by blank lines: >
+ :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
+this does the same: >
+ :set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
+
+Note that backslashes must be used to escape characters that ":set" handles
+differently (space, backslash, double quote, etc., see |option-backslash|).
+
+These are the conditions with which the expression is evaluated:
+- The current buffer and window are set for the line.
+- The variable "v:lnum" is set to the line number.
+- The result is used for the fold level in this way:
+ value meaning ~
+ 0 the line is not in a fold
+ 1, 2, .. the line is in a fold with this level
+ -1 the fold level is undefined, use the fold level of a
+ line before or after this line, whichever is the
+ lowest.
+ "=" use fold level from the previous line
+ "a1", "a2", .. add one, two, .. to the fold level of the previous
+ line
+ "s1", "s2", .. subtract one, two, .. from the fold level of the
+ previous line
+ "<1", "<2", .. a fold with this level ends at this line
+ ">1", ">2", .. a fold with this level starts at this line
+
+It is not required to mark the start (end) of a fold with ">1" ("<1"), a fold
+will also start (end) when the fold level is higher (lower) than the fold
+level of the previous line.
+
+There must be no side effects from the expression. The text in the buffer,
+cursor position, the search patterns, options etc. must not be changed.
+
+If there is some error in the expression, or the resulting value isn't
+recognized, there is no error message and the fold level will be zero.
+For debugging the 'debug' option can be set to "msg", the error messages will
+be visible then.
+
+Note: Since the expression has to be evaluated for every line, this fold
+method can be very slow!
+
+Try to avoid the "=", "a" and "s" return values, since Vim often has to search
+backwards for a line for which the fold level is defined. This can be slow.
+
+|foldlevel()| can be useful to compute a fold level relative to a previous
+fold level. But note that foldlevel() may return -1 if the level is not known
+yet. And it returns the level at the start of the line, while a fold might
+end in that line.
+
+
+SYNTAX *fold-syntax*
+
+A fold is defined by syntax items that have the "fold" argument. |:syn-fold|
+
+The fold level is defined by nesting folds. The nesting of folds is limited
+with 'foldnestmax'.
+
+Be careful to specify proper syntax syncing. If this is not done right, folds
+may differ from the displayed highlighting. This is especially relevant when
+using patterns that match more than one line. In case of doubt, try using
+brute-force syncing: >
+ :syn sync fromstart
+
+
+DIFF *fold-diff*
+
+The folds are automatically defined for text that is not part of a change or
+close to a change.
+
+This method only works properly when the 'diff' option is set for the current
+window and changes are being displayed. Otherwise the whole buffer will be
+one big fold.
+
+The 'diffopt' option can be used to specify the context. That is, the number
+of lines between the fold and a change that are not included in the fold. For
+example, to use a context of 8 lines: >
+ :set diffopt=filler,context:8
+The default context is six lines.
+
+When 'scrollbind' is also set, Vim will attempt to keep the same folds open in
+other diff windows, so that the same text is visible.
+
+
+MARKER *fold-marker*
+
+Markers in the text tell where folds start and end. This allows you to
+precisely specify the folds. This will allow deleting and putting a fold,
+without the risk of including the wrong lines. The 'foldtext' option is
+normally set such that the text before the marker shows up in the folded line.
+This makes it possible to give a name to the fold.
+
+Markers can have a level included, or can use matching pairs. Including a
+level is easier, you don't have to add end markers and avoid problems with
+non-matching marker pairs. Example: >
+ /* global variables {{{1 */
+ int varA, varB;
+
+ /* functions {{{1 */
+ /* funcA() {{{2 */
+ void funcA() {}
+
+ /* funcB() {{{2 */
+ void funcB() {}
+
+A fold starts at a "{{{" marker. The following number specifies the fold
+level. What happens depends on the difference between the current fold level
+and the level given by the marker:
+1. If a marker with the same fold level is encountered, the previous fold
+ ends and another fold with the same level starts.
+2. If a marker with a higher fold level is found, a nested fold is started.
+3. if a marker with a lower fold level is found, all folds up to and including
+ this level end and a fold with the specified level starts.
+
+The number indicates the fold level. A zero cannot be used.
+You can use "}}}" with a digit to indicate the level of the fold that
+ends. The fold level of the following line will be one less than the
+indicated level. Note that Vim doesn't look back to the level of the matching
+marker (that would take too much time). Example: >
+
+ {{{1
+ fold level here is 1
+ {{{3
+ fold level here is 3
+ }}}3
+ fold level here is 2
+
+You can also use matching pairs of "{{{" and "}}}" markers to define folds.
+Each "{{{" increases the fold level by one, each "}}}" decreases the fold
+level by one. Be careful to keep the markers matching! Example: >
+
+ {{{
+ fold level here is 1
+ {{{
+ fold level here is 2
+ }}}
+ fold level here is 1
+
+You can mix using markers with a number and without a number. A useful way of
+doing this is to use numbered markers for large folds, and unnumbered markers
+locally in a function. For example use level one folds for the sections of
+your file like "structure definitions", "local variables" and "functions".
+Use level 2 markers for each definition and function, Use unnumbered markers
+inside functions. When you make changes in a function to split up folds, you
+don't have to renumber the markers.
+
+The markers can be set with the 'foldmarker' option. It is recommended to
+keep this at the default value of "{{{,}}}", so that files can be exchanged
+between Vim users. Only change it when it is required for the file (e.g., it
+contains markers from another folding editor, or the default markers cause
+trouble for the language of the file).
+
+ *fold-create-marker*
+"zf" can be used to create a fold defined by markers. Vim will insert the
+markers for you. Vim will append the start and end marker, as specified with
+'foldmarker'. The markers are appended to the end of the line.
+'commentstring' is used if it isn't empty.
+This does not work properly when:
+- The line already contains a marker with a level number. Vim then doesn't
+ know what to do.
+- Folds nearby use a level number in their marker which gets in the way.
+- The line is inside a comment, 'commentstring' isn't empty and nested
+ comments don't work. For example with C: adding /* {{{ */ inside a comment
+ will truncate the existing comment. Either put the marker before or after
+ the comment, or add the marker manually.
+Generally it's not a good idea to let Vim create markers when you already have
+markers with a level number.
+
+ *fold-delete-marker*
+"zd" can be used to delete a fold defined by markers. Vim will delete the
+markers for you. Vim will search for the start and end markers, as specified
+with 'foldmarker', at the start and end of the fold. When the text around the
+marker matches with 'commentstring', that text is deleted as well.
+This does not work properly when:
+- A line contains more than one marker and one of them specifies a level.
+ Only the first one is removed, without checking if this will have the
+ desired effect of deleting the fold.
+- The marker contains a level number and is used to start or end several folds
+ at the same time.
+
+==============================================================================
+2. Fold commands *fold-commands* *E490*
+
+All folding commands start with "z". Hint: the "z" looks like a folded piece
+of paper, if you look at it from the side.
+
+
+CREATING AND DELETING FOLDS ~
+ *zf* *E350*
+zf{motion} or
+{Visual}zf Operator to create a fold.
+ This only works when 'foldmethod' is "manual" or "marker".
+ The new fold will be closed for the "manual" method.
+ 'foldenable' will be set.
+ Also see |fold-create-marker|.
+
+ *zF*
+zF Create a fold for N lines. Works like "zf".
+
+:{range}fo[ld] *:fold* *:fo*
+ Create a fold for the lines in {range}. Works like "zf".
+
+ *zd* *E351*
+zd Delete one fold at the cursor. When the cursor is on folded
+ line, that fold is deleted. Nested folds are moved one level
+ up. In Visual mode all folds (partially) in the selected area
+ are deleted. Careful: This easily deletes more folds than you
+ expect and there is no undo.
+ This only works when 'foldmethod' is "manual" or "marker".
+ Also see |fold-delete-marker|.
+
+ *zD*
+zD Delete folds recursively at the cursor. In Visual mode all
+ folds (partially) in the selected area and all nested folds in
+ them are deleted.
+ This only works when 'foldmethod' is "manual" or "marker".
+ Also see |fold-delete-marker|.
+
+ *zE* *E352*
+zE Eliminate all folds in the window.
+ This only works when 'foldmethod' is "manual" or "marker".
+ Also see |fold-delete-marker|.
+
+
+OPENING AND CLOSING FOLDS ~
+
+A fold smaller than 'foldminlines' will always be displayed like it was open.
+Therefore the commands below may work differently on small folds.
+
+ *zo*
+zo Open one fold under the cursor. When a count is given, that
+ many folds deep will be opened. In Visual mode one level of
+ folds is opened for all lines in the selected area.
+
+ *zO*
+zO Open all folds under the cursor recursively. Folds that don't
+ contain the cursor line are unchanged.
+ In Visual mode it opens all folds that are in the selected
+ area, also those that are only partly selected.
+
+ *zc*
+zc Close one fold under the cursor. When a count is given, that
+ many folds deep are closed. In Visual mode one level of folds
+ is closed for all lines in the selected area.
+ 'foldenable' will be set.
+
+ *zC*
+zC Close all folds under the cursor recursively. Folds that
+ don't contain the cursor line are unchanged.
+ In Visual mode it closes all folds that are in the selected
+ area, also those that are only partly selected.
+ 'foldenable' will be set.
+
+ *za*
+za When on a closed fold: open it. When folds are nested, you
+ may have to use "za" several times. When a count is given,
+ that many closed folds are opened.
+ When on an open fold: close it and set 'foldenable'. This
+ will only close one level, since using "za" again will open
+ the fold. When a count is given that many folds will be
+ closed (that's not the same as repeating "za" that many
+ times).
+
+ *zA*
+zA When on a closed fold: open it recursively.
+ When on an open fold: close it recursively and set
+ 'foldenable'.
+
+ *zv*
+zv View cursor line: Open just enough folds to make the line in
+ which the cursor is located not folded.
+
+ *zx*
+zx Update folds: Undo manually opened and closed folds: re-apply
+ 'foldlevel', then do "zv": View cursor line.
+
+ *zX*
+zX Undo manually opened and closed folds: re-apply 'foldlevel'.
+
+ *zm*
+zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was
+ already zero nothing happens.
+ 'foldenable' will be set.
+
+ *zM*
+zM Close all folds: set 'foldlevel' to 0.
+ 'foldenable' will be set.
+
+ *zr*
+zr Reduce folding: Add one to 'foldlevel'.
+
+ *zR*
+zR Open all folds. This sets 'foldlevel' to highest fold level.
+
+ *:foldo* *:foldopen*
+:{range}foldo[pen][!]
+ Open folds in {range}. When [!] is added all folds are
+ opened. Useful to see all the text in {range}. Without [!]
+ one level of folds is opened.
+
+ *:foldc* *:foldclose*
+:{range}foldc[lose][!]
+ Close folds in {range}. When [!] is added all folds are
+ closed. Useful to hide all the text in {range}. Without [!]
+ one level of folds is closed.
+
+ *zn*
+zn Fold none: reset 'foldenable'. All folds will be open.
+
+ *zN*
+zN Fold normal: set 'foldenable'. All folds will be as they
+ were before.
+
+ *zi*
+zi Invert 'foldenable'.
+
+
+MOVING OVER FOLDS ~
+ *[z*
+[z Move to the start of the current open fold. If already at the
+ start, move to the start of the fold that contains it. If
+ there is no containing fold, the command fails.
+ When a count is used, repeats the command N times.
+
+ *]z*
+]z Move to the end of the current open fold. If already at the
+ end, move to the end of the fold that contains it. If there
+ is no containing fold, the command fails.
+ When a count is used, repeats the command N times.
+
+ *zj*
+zj Move downwards to the start of the next fold. A closed fold
+ is counted as one fold.
+ When a count is used, repeats the command N times.
+ This command can be used after an |operator|.
+
+ *zk*
+zk Move upwards to the end of the previous fold. A closed fold
+ is counted as one fold.
+ When a count is used, repeats the command N times.
+ This command can be used after an |operator|.
+
+
+EXECUTING COMMANDS ON FOLDS ~
+
+:[range]foldd[oopen] {cmd} *:foldd* *:folddoopen*
+ Execute {cmd} on all lines that are not in a closed fold.
+ When [range] is given, only these lines are used.
+ Each time {cmd} is executed the cursor is positioned on the
+ line it is executed for.
+ This works like the ":global" command: First all lines that
+ are not in a closed fold are marked. Then the {cmd} is
+ executed for all marked lines. Thus when {cmd} changes the
+ folds, this has no influence on where it is executed (except
+ when lines are deleted, of course).
+ Example: >
+ :folddoopen s/end/loop_end/ge
+< Note the use of the "e" flag to avoid getting an error message
+ where "end" doesn't match.
+
+:[range]folddoc[losed] {cmd} *:folddoc* *:folddoclosed*
+ Execute {cmd} on all lines that are in a closed fold.
+ Otherwise like ":folddoopen".
+
+==============================================================================
+3. Fold options *fold-options*
+
+COLORS *fold-colors*
+
+The colors of a closed fold are set with the Folded group |hl-Folded|. The
+colors of the fold column are set with the FoldColumn group |hl-FoldColumn|.
+Example to set the colors: >
+
+ :highlight Folded guibg=grey guifg=blue
+ :highlight FoldColumn guibg=darkgrey guifg=white
+
+
+FOLDLEVEL *fold-foldlevel*
+
+'foldlevel' is a number option: The higher the more folded regions are open.
+When 'foldlevel' is 0, all folds are closed.
+When 'foldlevel' is positive, some folds closed.
+When 'foldlevel' is very high, all folds are open.
+'foldlevel' is applied when it is changed. After that manually folds can be
+opened and closed.
+When increased, folds above the new level are opened. No manually opened
+folds will be closed.
+When decreased, folds above the new level are closed. No manually closed
+folds will be opened.
+
+
+FOLDTEXT *fold-foldtext*
+
+'foldtext' is a string option that specifies an expression. This expression
+is evaluated to obtain the text displayed for a closed fold. Example: >
+
+ :set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g')
+
+This shows the first line of the fold, with "/*", "*/" and "{{{" removed.
+Note the use of backslashes to avoid some characters to be interpreted by the
+":set" command. It's simpler to define a function and call that: >
+
+ :set foldtext=MyFoldText()
+ :function MyFoldText()
+ : let line = getline(v:foldstart)
+ : let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
+ : return v:folddashes . sub
+ :endfunction
+
+Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
+the window that displays the line. Errors are ignored.
+
+The default value is |foldtext()|. This returns a reasonable text for most
+types of folding. If you don't like it, you can specify your own 'foldtext'
+expression. It can use these special Vim variables:
+ v:foldstart line number of first line in the fold
+ v:foldend line number of last line in the fold
+ v:folddashes a string that contains dashes to represent the
+ foldlevel.
+ v:foldlevel the foldlevel of the fold
+
+In the result a TAB is replaced with a space and unprintable characters are
+made into printable characters.
+
+The resulting line is truncated to fit in the window, it never wraps.
+When there is room after the text, it is filled with the character specified
+by 'fillchars'.
+
+Note that backslashes need to be used for characters that the ":set" command
+handles differently: Space, backslash and double-quote. |option-backslash|
+
+
+FOLDCOLUMN *fold-foldcolumn*
+
+'foldcolumn' is a number, which sets the width for a column on the side of the
+window to indicate folds. When it is zero, there is no foldcolumn. A normal
+value is 4 or 5. The minimal useful value is 2. The maximum is 12.
+
+An open fold is indicated with a column that has a '-' at the top and '|'
+characters below it. This column stops where the open fold stops. When folds
+nest, the nested fold is one character right of the fold it's contained in.
+
+A closed fold is indicated with a '+'.
+
+Where the fold column is too narrow to display all nested folds, digits are
+shown to indicate the nesting level.
+
+The mouse can also be used to open and close folds by clicking in the
+fold column:
+- Click on a '+' to open the closed fold at this row.
+- Click on any other non-blank character to close the open fold at this row.
+
+
+OTHER OPTIONS
+
+'foldenable' 'fen': Open all folds while not set.
+'foldexpr' 'fde': Expression used for "expr" folding.
+'foldignore' 'fdi': Characters used for "indent" folding.
+'foldmarker' 'fmr': Defined markers used for "marker" folding.
+'foldmethod' 'fdm': Name of the current folding method.
+'foldminlines' 'fml': Minimum number of screen lines for a fold to be
+ displayed closed.
+'foldnestmax' 'fdn': Maximum nesting for "indent" and "syntax" folding.
+'foldopen' 'fdo': Which kinds of commands open closed folds.
+'foldclose' 'fcl': When the folds not under the cursor are closed.
+
+==============================================================================
+4. Behavior of folds *fold-behavior*
+
+When moving the cursor upwards or downwards and when scrolling, the cursor
+will move to the first line of a sequence of folded lines. When the cursor is
+already on a folded line, it moves to the next unfolded line or the next
+closed fold.
+
+While the cursor is on folded lines, the cursor is always displayed in the
+first column. The ruler does show the actual cursor position, but since the
+line is folded, it cannot be displayed there.
+
+Many movement commands handle a sequence of folded lines like an empty line.
+For example, the "w" command stops once in the first column.
+
+When in Insert mode, the cursor line is never folded. That allows you to see
+what you type!
+
+When using an operator, a closed fold is included as a whole. Thus "dl"
+deletes the whole closed fold under the cursor.
+
+For Ex commands the range is adjusted to always start at the first line of a
+fold and end at the last line of a fold. Thus this command: >
+ :s/foo/bar/g
+when used with the cursor on a closed fold, will replace "foo" with "bar" in
+all lines of the fold.
+This does not happen for |:folddoopen| and |:folddoclosed|.
+
+When editing a buffer that has been edited before, the last used folding
+settings are used again. For manual folding the defined folds are restored.
+For all folding methods the manually opened and closed folds are restored.
+If this buffer has been edited in this window, the values from back then are
+used. Otherwise the values from the window where the buffer was edited last
+are used.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
new file mode 100644
index 000000000..430a3eb5c
--- /dev/null
+++ b/runtime/doc/gui.txt
@@ -0,0 +1,951 @@
+*gui.txt* For Vim version 7.0aa. Last change: 2004 Jun 02
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Vim's Graphical User Interface *gui* *GUI*
+
+1. Starting the GUI |gui-start|
+2. Scrollbars |gui-scrollbars|
+3. Mouse Control |gui-mouse|
+4. Making GUI Selections |gui-selections|
+5. Menus |menus|
+6. Extras |gui-extras|
+7. Shell Commands |gui-shell|
+
+Other GUI documentation:
+|gui_x11.txt| For specific items of the X11 GUI.
+|gui_w32.txt| For specific items of the Win32 GUI.
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Starting the GUI *gui-start* *E229* *E233*
+
+First you must make sure you actually have a version of Vim with the GUI code
+included. You can check this with the ":version" command, it should include
+"+GUI_Athena", "+GUI_BeOS", "+GUI_GTK", "+GUI_Motif" or "MS-Windows ... bit
+GUI version".
+
+How to start the GUI depends on the system used. Mostly you can run the
+GUI version of Vim with:
+ gvim [options] [files...]
+
+The X11 version of Vim can run both in GUI and in non-GUI mode. See
+|gui-x11-start|.
+
+ *gui-init* *gvimrc* *.gvimrc* *_gvimrc*
+When the GUI starts up initializations are carried out, in this order:
+- The termcap options are reset to their default value for the GUI.
+- If the system menu file exists, it is sourced. The name of this file is
+ normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also
+ see |$VIMRUNTIME|. To skip loading the system menu include 'M' in
+ 'guioptions'. *buffers-menu* *no_buffers_menu*
+ The system menu file includes a "Buffers" menu. If you don't want this, set
+ the "no_buffers_menu" variable in your .vimrc (not .gvimrc!): >
+ :let no_buffers_menu = 1
+< NOTE: Switching on syntax highlighting also loads the menu file, thus
+ disabling the Buffers menu must be done before ":syntax on".
+ The path names are truncated to 35 characters. You can truncate them at a
+ different length, for example 50, like this: >
+ :let bmenu_max_pathlen = 50
+- If the "-U {gvimrc}" command-line option has been used when starting Vim,
+ the {gvimrc} file will be read for initializations. The following
+ initializations are skipped.
+- For Unix and MS-Windows, if the system gvimrc exists, it is sourced. The
+ name of this file is normally "$VIM/gvimrc". You can check this with
+ ":version". Also see |$VIM|.
+- The following are tried, and only the first one that exists is used:
+ - If the GVIMINIT environment variable exists and is not empty, it is
+ executed as an Ex command.
+ - If the user gvimrc file exists, it is sourced. The name of this file is
+ normally "$HOME/.gvimrc". You can check this with ":version".
+ - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
+ - When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
+ versa.
+- If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc
+ is sourced, if it exists and isn't the same file as the system or user
+ gvimrc file. If this file is not owned by you, some security restrictions
+ apply. When ".gvimrc" is not found, "_gvimrc" is tried too. For Macintosh
+ and DOS/Win32 "_gvimrc" is tried first.
+
+NOTE: All but the first one are not carried out if Vim was started with
+"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
+
+All this happens AFTER the normal Vim initializations, like reading your
+.vimrc file. See |initialization|.
+But the GUI window is only opened after all the initializations have been
+carried out. If you want some commands to be executed just after opening the
+GUI window, use the |GUIEnter| autocommand event. Example: >
+ :autocommand GUIEnter * winpos 100 50
+
+You can use the gvimrc files to set up your own customized menus (see |:menu|)
+and initialize other things that you may want to set up differently from the
+terminal version.
+
+Recommended place for your personal GUI initializations:
+ Unix $HOME/.gvimrc
+ OS/2 $HOME/.gvimrc or $VIM/.gvimrc
+ MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc
+ Amiga s:.gvimrc or $VIM/.gvimrc
+
+There are a number of options which only have meaning in the GUI version of
+Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are
+documented in |options.txt| with all the other options.
+
+If using the Motif or Athena version of the GUI (but not for the GTK+ or Win32
+version), a number of X resources are available. See |gui-resources|.
+
+Another way to set the colors for different occasions is with highlight
+groups. The "Normal" group is used to set the background and foreground
+colors. Example (which looks nice): >
+
+ :highlight Normal guibg=grey90
+
+The "guibg" and "guifg" settings override the normal background and
+foreground settings. The other settings for the Normal highlight group are
+not used. Use the 'guifont' option to set the font.
+
+Also check out the 'guicursor' option, to set the colors for the cursor in
+various modes.
+
+Vim tries to make the window fit on the screen when it starts up. This avoids
+that you can't see part of it. On the X Window System this requires a bit of
+guesswork. You can change the height that is used for the window title and a
+task bar with the 'guiheadroom' option.
+
+ *:winp* *:winpos* *E188*
+:winp[os]
+ Display current position of the top left corner of the GUI vim
+ window in pixels. Does not work in all versions.
+
+:winp[os] {X} {Y} *E466*
+ Put the GUI vim window at the given {X} and {Y} coordinates.
+ The coordinates should specify the position in pixels of the
+ top left corner of the window. Does not work in all versions.
+ Does work in an (new) xterm |xterm-color|.
+ When the GUI window has not been opened yet, the values are
+ remembered until the window is opened. The position is
+ adjusted to make the window fit on the screen (if possible).
+
+ *:win* *:winsize* *E465*
+:win[size] {width} {height}
+ Set the window height to {width} by {height} characters.
+ Obsolete, use ":set lines=11 columns=22".
+ If you get less lines than expected, check the 'guiheadroom'
+ option.
+
+If you are running the X Window System, you can get information about the
+window Vim is running in with this command: >
+ :!xwininfo -id $WINDOWID
+
+==============================================================================
+2. Scrollbars *gui-scrollbars*
+
+There are vertical scrollbars and a horizontal scrollbars. You may
+configure which ones appear with the 'guioptions' option.
+
+The interface looks like this (with ":set guioptions=mlrb"):
+
+ +------------------------------+
+ | File Edit Help | <- Menu bar (m)
+ +-+--------------------------+-+
+ |^| |^|
+ |#| Text area. |#|
+ | | | |
+ |v|__________________________|v|
+ Normal status line -> |-+ File.c 5,2 +-|
+ between Vim windows |^|""""""""""""""""""""""""""|^|
+ | | | |
+ | | Another file buffer. | |
+ | | | |
+ |#| |#|
+ Left scrollbar (l) -> |#| |#| <- Right
+ |#| |#| scrollbar (r)
+ | | | |
+ |v| |v|
+ +-+--------------------------+-+
+ | |< #### >| | <- Bottom
+ +-+--------------------------+-+ scrollbar (b)
+
+Any of the scrollbar or menu components may be turned off by not putting the
+appropriate letter in the 'guioptions' string. The bottom scrollbar is
+only useful when 'nowrap' is set.
+
+
+VERTICAL SCROLLBARS *gui-vert-scroll*
+
+Each Vim window has a scrollbar next to it which may be scrolled up and down
+to move through the text in that buffer. The size of the scrollbar-thumb
+indicates the fraction of the buffer which can be seen in the window.
+When the scrollbar is dragged all the way down, the last line of the file
+will appear in the top of the window.
+
+If a window is shrunk to zero height (by the growth of another window) its
+scrollbar disappears. It reappears when the window is restored.
+
+If a window is vertically split, it will get a scrollbar when it is the
+current window and when, taking the middle of the current window and drawing a
+vertical line, this line goes through the window.
+When there are scrollbars on both sides, and the middle of the current window
+is on the left half, the right scrollbar column will contain scrollbars for
+the rightmost windows. The same happens on the other side.
+
+
+HORIZONTAL SCROLLBARS *gui-horiz-scroll*
+
+The horizontal scrollbar (at the bottom of the Vim GUI) may be used to
+scroll text sideways when the 'wrap' option is turned off. The
+scrollbar-thumb size is such that the text of the longest visible line may be
+scrolled as far as possible left and right. The cursor is moved when
+necessary, it must remain on a visible character (unless 'virtualedit' is
+set).
+
+Computing the length of the longest visible takes quite a bit of computation,
+and it has to be done every time something changes. If this takes too much
+time or you don't like the cursor jumping to another line, include the 'h'
+flag in 'guioptions'. Then the scrolling is limited by the text of the
+current cursor line.
+
+ *athena-intellimouse*
+If you have an Intellimouse and an X server that supports using the wheel,
+then you can use the wheel to scroll the text up and down in gvim. This works
+with XFree86 4.0 and later, and with some older versions when you add patches.
+See |scroll-mouse-wheel|.
+
+For older versions of XFree86 you must patch your X server. The following
+page has a bit of information about using the Intellimouse on Linux as well as
+links to the patches and X server binaries (may not have the one you need
+though):
+ http://www.inria.fr/koala/colas/mouse-wheel-scroll/
+
+==============================================================================
+3. Mouse Control *gui-mouse*
+
+The mouse only works if the appropriate flag in the 'mouse' option is set.
+When the GUI is switched on, and 'mouse' wasn't set yet, the 'mouse' option is
+automatically set to "a", enabling it for all modes except for the
+|hit-enter| prompt. If you don't want this, a good place to change the
+'mouse' option is the "gvimrc" file.
+
+Other options that are relevant:
+'mousefocus' window focus follows mouse pointer |gui-mouse-focus|
+'mousemodel' what mouse button does which action
+'mousehide' hide mouse pointer while typing text
+'selectmode' whether to start Select mode or Visual mode
+
+A quick way to set these is with the ":behave" command.
+ *:behave* *:be*
+:be[have] {model} Set behavior for mouse and selection. Valid
+ arguments are:
+ mswin MS-Windows behavior
+ xterm Xterm behavior
+
+ Using ":behave" changes these options:
+ option mswin xterm ~
+ 'selectmode' "mouse,key" ""
+ 'mousemodel' "popup" "extend"
+ 'keymodel' "startsel,stopsel" ""
+ 'selection' "exclusive" "inclusive"
+
+In the $VIMRUNTIME directory, there is a script called |mswin.vim|, which will
+also map a few keys to the MS-Windows cut/copy/paste commands. This is NOT
+compatible, since it uses the CTRL-V, CTRL-X and CTRL-C keys. If you don't
+mind, use this command: >
+ :so $VIMRUNTIME/mswin.vim
+
+For scrolling with a wheel on a mouse, see |scroll-mouse-wheel|.
+
+
+3.1 Moving Cursor with Mouse *gui-mouse-move*
+
+Click the left mouse button somewhere in a text buffer where you want the
+cursor to go, and it does!
+This works in when 'mouse' contains ~
+Normal mode 'n' or 'a'
+Visual mode 'v' or 'a'
+Insert mode 'i' or 'a'
+
+Select mode is handled like Visual mode.
+
+You may use this with an operator such as 'd' to delete text from the current
+cursor position to the position you point to with the mouse. That is, you hit
+'d' and then click the mouse somewhere.
+
+ *gui-mouse-focus*
+The 'mousefocus' option can be set to make the keyboard focus follow the
+mouse pointer. This means that the window where the mouse pointer is, is the
+active window. Warning: this doesn't work very well when using a menu,
+because the menu command will always be applied to the top window.
+
+If you are on the ':' line (or '/' or '?'), then clicking the left or right
+mouse button will position the cursor on the ':' line (if 'mouse' contains
+'c', 'a' or 'A').
+
+In any situation the middle mouse button may be clicked to paste the current
+selection.
+
+
+3.2 Selection with Mouse *gui-mouse-select*
+
+The mouse can be used to start a selection. How depends on the 'mousemodel'
+option:
+'mousemodel' is "extend": use the right mouse button
+'mousemodel' is "popup": use the left mouse button, while keeping the Shift
+key pressed.
+
+If there was no selection yet, this starts a selection from the old cursor
+position to the position pointed to with the mouse. If there already is a
+selection then the closest end will be extended.
+
+If 'selectmode' contains "mouse", then the selection will be in Select mode.
+This means that typing normal text will replace the selection. See
+|Select-mode|. Otherwise, the selection will be in Visual mode.
+
+Double clicking may be done to make the selection word-wise, triple clicking
+makes it line-wise, and quadruple clicking makes it rectangular block-wise.
+
+See |gui-selections| on how the selection is used.
+
+
+3.3 Other Text Selection with Mouse *gui-mouse-modeless*
+ *modeless-selection*
+A different kind of selection is used when:
+- in Command-line mode
+- in the Command-line window and pointing in another window
+- at the |hit-enter| prompt
+- whenever the current mode is not in the 'mouse' option
+- when holding the CTRL and SHIFT keys in the GUI
+Since Vim continues like the selection isn't there, and there is no mode
+associated with the selection, this is called modeless selection. Any text in
+the Vim window can be selected. Select the text by pressing the left mouse
+button at the start, drag to the end and release. To extend the selection,
+use the right mouse button when 'mousemodel' is "extend", or the left mouse
+button with the shift key pressed when 'mousemodel' is "popup".
+The middle mouse button pastes the text.
+The selection is removed when the selected text is scrolled or changed.
+On the command line CTRL-Y can be used to copy the selection into the
+clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y <CR>.
+
+
+3.4 Using Mouse on Status Lines *gui-mouse-status*
+
+Clicking the left or right mouse button on the status line below a Vim
+window makes that window the current window. This actually happens on button
+release (to be able to distinguish a click from a drag action).
+
+With the left mouse button a status line can be dragged up and down, thus
+resizing the windows above and below it. This does not change window focus.
+
+The same can be used on the vertical separator: click to give the window left
+of it focus, drag left and right to make windows wider and narrower.
+
+
+3.5 Various Mouse Clicks *gui-mouse-various*
+
+ <S-LeftMouse> Search forward for the word under the mouse click.
+ When 'mousemodel' is "popup" this starts or extends a
+ selection.
+ <S-RightMouse> Search backward for the word under the mouse click.
+ <C-LeftMouse> Jump to the tag name under the mouse click.
+ <C-RightMouse> Jump back to position before the previous tag jump
+ (same as "CTRL-T")
+
+
+3.6 Mouse Mappings *gui-mouse-mapping*
+
+The mouse events, complete with modifiers, may be mapped. Eg: >
+ :map <S-LeftMouse> <RightMouse>
+ :map <S-LeftDrag> <RightDrag>
+ :map <S-LeftRelease> <RightRelease>
+ :map <2-S-LeftMouse> <2-RightMouse>
+ :map <2-S-LeftDrag> <2-RightDrag>
+ :map <2-S-LeftRelease> <2-RightRelease>
+ :map <3-S-LeftMouse> <3-RightMouse>
+ :map <3-S-LeftDrag> <3-RightDrag>
+ :map <3-S-LeftRelease> <3-RightRelease>
+ :map <4-S-LeftMouse> <4-RightMouse>
+ :map <4-S-LeftDrag> <4-RightDrag>
+ :map <4-S-LeftRelease> <4-RightRelease>
+These mappings make selection work the way it probably should in a Motif
+application, with shift-left mouse allowing for extending the visual area
+rather than the right mouse button.
+
+Mouse mapping with modifiers does not work for modeless selection.
+
+
+3.7 Drag and drop *drag-n-drop*
+
+You can drag and drop one or more files into the Vim window, where they will
+be opened as if a |:drop| command was used.
+
+If you hold down Shift while doing this, Vim changes to the first dropped
+file's directory. If you hold Ctrl Vim will always split a new window for the
+file. Otherwise it's only done if the current buffer has been changed.
+
+You can also drop a directory on Vim. This starts the explorer plugin for
+that directory (assuming it was enabled, otherwise you'll get an error
+message). Keep Shift pressed to change to the directory instead.
+
+If Vim happens to be editing a command line, the names of the dropped files
+and directories will be inserted at the cursor. This allows you to use these
+names with any Ex command. Special characters (space, tab, double quote and
+'|'; backslash on non-MS-Windows systems) will be escaped.
+
+==============================================================================
+4. Making GUI Selections *gui-selections*
+
+ *quotestar*
+You may make selections with the mouse (see |gui-mouse-select|), or by using
+Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then
+whenever a selection is started (Visual or Select mode), or when the selection
+is changed, Vim becomes the owner of the windowing system's primary selection
+(on MS-Windows the |gui-clipboard| is used; under X11, the |x11-selection| is
+used - you should read whichever of these is appropriate now).
+
+ *clipboard*
+There is a special register for storing this selection, it is the "*
+register. Nothing is put in here unless the information about what text is
+selected is about to change (eg with a left mouse click somewhere), or when
+another application wants to paste the selected text. Then the text is put
+in the "* register. For example, to cut a line and make it the current
+selection/put it on the clipboard: >
+
+ "*dd
+
+Similarly, when you want to paste a selection from another application, e.g.,
+by clicking the middle mouse button, the selection is put in the "* register
+first, and then 'put' like any other register. For example, to put the
+selection (contents of the clipboard): >
+
+ "*p
+
+When using this register under X11, also see |x11-selection|. This also
+explains the related "+ register.
+
+Note that when pasting text from one Vim into another separate Vim, the type
+of selection (character, line, or block) will also be copied. For other
+applications the type is always character. However, if the text gets
+transferred via the |x11-cut-buffer|, the selection type is ALWAYS lost.
+
+When the "unnamed" string is included in the 'clipboard' option, the unnamed
+register is the same as the "* register. Thus you can yank to and paste the
+selection without prepending "* to commands.
+
+==============================================================================
+5. Menus *menus*
+
+For an introduction see |usr_42.txt| in the user manual.
+
+
+5.1 Using Menus *using-menus*
+
+Basically, menus can be used just like mappings. You can define your own
+menus, as many as you like.
+Long-time Vim users won't use menus much. But the power is in adding your own
+menus and menu items. They are most useful for things that you can't remember
+what the key sequence was.
+
+For creating menus in a different language, see |:menutrans|.
+
+ *menu.vim*
+The default menus are read from the file "$VIMRUNTIME/menu.vim". See
+|$VIMRUNTIME| for where the path comes from. You can set up your own menus.
+Starting off with the default set is a good idea. You can add more items, or,
+if you don't like the defaults at all, start with removing all menus
+|:unmenu-all|. You can also avoid the default menus being loaded by adding
+this line to your .vimrc file (NOT your .gvimrc file!): >
+ :let did_install_default_menus = 1
+If you also want to avoid the Syntax menu: >
+ :let did_install_syntax_menu = 1
+If you do want the Syntax menu but not all the entries for each available
+syntax file (which take quite a bit of time to load): >
+ :let skip_syntax_sel_menu = 1
+<
+ *console-menus*
+Although this documentation is in the GUI section, you can actually use menus
+in console mode too. You will have to load |menu.vim| explicitly then, it is
+not done by default. You can use the |:emenu| command and command-line
+completion with 'wildmenu' to access the menu entries almost like a real menu
+system. To do this, put these commands in your .vimrc file: >
+ :source $VIMRUNTIME/menu.vim
+ :set wildmenu
+ :set cpo-=<
+ :set wcm=<C-Z>
+ :map <F4> :emenu <C-Z>
+Pressing <F4> will start the menu. You can now use the cursor keys to select
+a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel.
+This does require the |+menu| feature enabled at compile time.
+
+ *tear-off-menus*
+GTK+ and Motif support Tear-off menus. These are sort of sticky menus or
+pop-up menus that are present all the time. If the resizing does not work
+correctly, this may be caused by using something like "Vim*geometry" in the
+defaults. Use "Vim.geometry" instead.
+
+The Win32 GUI version emulates Motif's tear-off menus. Actually, a Motif user
+will spot the differences easily, but hopefully they're just as useful. You
+can also use the |:tearoff| command together with |hidden-menus| to create
+floating menus that do not appear on the main menu bar.
+
+
+5.2 Creating New Menus *creating-menus*
+
+ *:me* *:menu* *:noreme* *:noremenu*
+ *:am* *:amenu* *:an* *:anoremenu*
+ *:nme* *:nmenu* *:nnoreme* *:nnoremenu*
+ *:ome* *:omenu* *:onoreme* *:onoremenu*
+ *:vme* *:vmenu* *:vnoreme* *:vnoremenu*
+ *:ime* *:imenu* *:inoreme* *:inoremenu*
+ *:cme* *:cmenu* *:cnoreme* *:cnoremenu*
+ *E330* *E327* *E331* *E336* *E333*
+ *E328* *E329* *E337*
+To create a new menu item, use the ":menu" commands. They are mostly like
+the ":map" set of commands but the first argument is a menu item name, given
+as a path of menus and submenus with a '.' between them. eg: >
+
+ :menu File.Save :w<CR>
+ :inoremenu File.Save <C-O>:w<CR>
+ :menu Edit.Big\ Changes.Delete\ All\ Spaces :%s/[ ^I]//g<CR>
+
+This last one will create a new item in the menu bar called "Edit", holding
+the mouse button down on this will pop up a menu containing the item
+"Big Changes", which is a sub-menu containing the item "Delete All Spaces",
+which when selected, performs the operation.
+
+Special characters in a menu name:
+
+ & The next character is the shortcut key. Make sure each
+ shortcut key is only used once in a (sub)menu. If you want to
+ insert a literal "&" in the menu name use "&&".
+ <Tab> Separates the menu name from right-aligned text. This can be
+ used to show the equivalent typed command. The text "<Tab>"
+ can be used here for convenience. If you are using a real
+ Tab, don't forget to put a backslash before it!
+Example: >
+
+ :amenu &File.&Open<Tab>:e :browse e<CR>
+
+[typed literally]
+With the shortcut "F" (while keeping the <Alt> key pressed), and then "O",
+this menu can be used. The second part is shown as "Open :e". The ":e"
+is right aligned, and the "O" is underlined, to indicate it is the shortcut.
+
+The ":amenu" command can be used to define menu entries for all modes at once.
+To make the command work correctly, a character is automatically inserted for
+some modes:
+ mode inserted appended ~
+ Normal nothing nothing
+ Visual <C-C> <C-\><C-G>
+ Insert <C-O>
+ Cmdline <C-C> <C-\><C-G>
+ Op-pending <C-C> <C-\><C-G>
+
+Appending CTRL-\ CTRL-G is for going back to insert mode when 'insertmode' is
+set. |CTRL-\_CTRL-G|
+
+Example: >
+
+ :amenu File.Next :next^M
+
+is equal to: >
+
+ :nmenu File.Next :next^M
+ :vmenu File.Next ^C:next^M^\^G
+ :imenu File.Next ^O:next^M
+ :cmenu File.Next ^C:next^M^\^G
+ :omenu File.Next ^C:next^M^\^G
+
+Careful: In Insert mode this only works for a SINGLE Normal mode command,
+because of the CTRL-O. If you have two or more commands, you will need to use
+the ":imenu" command. For inserting text in any mode, you can use the
+expression register: >
+
+ :amenu Insert.foobar "='foobar'<CR>P
+
+Note that the '<' and 'k' flags in 'cpoptions' also apply here (when
+included they make the <> form and raw key codes not being recognized).
+
+Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
+is Vi compatible. Use CTRL-C to quit Cmdline mode.
+
+ *:menu-<silent>* *:menu-silent*
+To define a menu which will not be echoed on the command line, add
+"<silent>" as the first argument. Example: >
+ :menu <silent> Settings.Ignore\ case :set ic<CR>
+The ":set ic" will not be echoed when using this menu. Messages from the
+executed command are still given though. To shut them up too, add a ":silent"
+in the executed command: >
+ :menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
+<
+ *:menu-<script>* *:menu-script*
+The "to" part of the menu will be inspected for mappings. If you don't want
+this, use the ":noremenu" command (or the similar one for a specific mode).
+If you do want to use script-local mappings, add "<script>" as the very first
+argument to the ":menu" command or after "<silent>".
+
+ *menu-priority*
+You can give a priority to a menu. Menus with a higher priority go more to
+the right. The priority is given as a number before the ":menu" command.
+Example: >
+ :80menu Buffer.next :bn<CR>
+
+The default menus have these priorities:
+ File 10
+ Edit 20
+ Tools 40
+ Syntax 50
+ Buffers 60
+ Window 70
+ Help 9999
+
+When no or zero priority is given, 500 is used.
+The priority for the PopUp menu is not used.
+
+The Help menu will be placed on the far right side of the menu bar on systems
+which support this (Motif and GTK+). For GTK+ 2, this is not done anymore
+because right-aligning the Help menu is now discouraged UI design.
+
+You can use a priority higher than 9999, to make it go after the Help menu,
+but that is non-standard and is discouraged. The highest possible priority is
+about 32000. The lowest is 1.
+
+ *sub-menu-priority*
+The same mechanism can be used to position a sub-menu. The priority is then
+given as a dot-separated list of priorities, before the menu name: >
+ :menu 80.500 Buffer.next :bn<CR>
+Giving the sub-menu priority is only needed when the item is not to be put
+in a normal position. For example, to put a sub-menu before the other items: >
+ :menu 80.100 Buffer.first :brew<CR>
+Or to put a sub-menu after the other items, and further items with default
+priority will be put before it: >
+ :menu 80.900 Buffer.last :blast<CR>
+When a number is missing, the default value 500 will be used: >
+ :menu .900 myMenu.test :echo "text"<CR>
+The menu priority is only used when creating a new menu. When it already
+existed, e.g., in another mode, the priority will not change. Thus, the
+priority only needs to be given the first time a menu is used.
+An exception is the PopUp menu. There is a separate menu for each mode
+(Normal, Op-pending, Visual, Insert, Cmdline). The order in each of these
+menus can be different. This is different from menu-bar menus, which have
+the same order for all modes.
+NOTE: sub-menu priorities currently don't work for all versions of the GUI.
+
+ *menu-separator* *E332*
+Menu items can be separated by a special item that inserts some space between
+items. Depending on the system this is displayed as a line or a dotted line.
+These items must start with a '-' and end in a '-'. The part in between is
+used to give it a unique name. Priorities can be used as with normal items.
+Example: >
+ :menu Example.item1 :do something
+ :menu Example.-Sep- :
+ :menu Example.item2 :do something different
+Note that the separator also requires a rhs. It doesn't matter what it is,
+because the item will never be selected. Use a single colon to keep it
+simple.
+
+ *gui-toolbar*
+The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11) and
+Photon GUI. It should turn up in other GUIs in due course. The default
+toolbar is setup in menu.vim.
+The display of the toolbar is controlled by the 'guioptions' letter 'T'. You
+can thus have menu & toolbar together, or either on its own, or neither.
+The appearance is controlled by the 'toolbar' option. You can chose between
+an image, text or both.
+
+ *toolbar-icon*
+The toolbar is defined as a special menu called ToolBar, which only has one
+level. Vim interprets the items in this menu as follows:
+1) If an "icon=" argument was specified, the file with this name is used.
+ The file can either be specified with the full path or with the base name.
+ In the last case it is searched for in the "bitmaps" directory in
+ 'runtimepath', like in point 3). Examples: >
+ :amenu icon=/usr/local/pixmaps/foo_icon.xpm ToolBar.Foo :echo "Foo"<CR>
+ :amenu icon=FooIcon ToolBar.Foo :echo "Foo"<CR>
+< Note that in the first case the extension is included, while in the second
+ case it is omitted.
+ If the file cannot be opened the next points are tried.
+ A space in the file name must be escaped with a backslash.
+ A menu priority must come _after_ the icon argument: >
+ :amenu icon=foo 1.42 ToolBar.Foo :echo "42!"<CR>
+2) An item called 'BuiltIn##', where ## is a number, is taken as number ## of
+ the built-in bitmaps available in Vim. Currently there are 31 numbered
+ from 0 to 30 which cover most common editing operations |builtin-tools|. >
+ :amenu ToolBar.BuiltIn22 :call SearchNext("back")<CR>
+3) An item with another name is first searched for in the directory
+ "bitmaps" in 'runtimepath'. If found, the bitmap file is used as the
+ toolbar button image. Note that the exact filename is OS-specific: For
+ example, under Win32 the command >
+ :amenu ToolBar.Hello :echo "hello"<CR>
+< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With
+ GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for
+ existence, and the first one found would be used.
+ For MS-Windows and GTK+ 2 the bitmap is scaled to fit the button. For
+ MS-Windows a size of 18 by 18 pixels works best.
+ For MS-Windows the bitmap should have 16 colors with the standard palette.
+ The light grey pixels will be changed to the Window frame color and the
+ dark grey pixels to the window shadow color. More colors might also work,
+ depending on your system.
+4) If the bitmap is still not found, Vim checks for a match against its list
+ of built-in names. Each built-in button image has a name.
+ So the command >
+ :amenu ToolBar.Open :e
+< will show the built-in "open a file" button image if no open.bmp exists.
+ All the built-in names can be seen used in menu.vim.
+5) If all else fails, a blank, but functioning, button is displayed.
+
+ *builtin-tools*
+nr Name Normal action ~
+00 New open new window
+01 Open browse for file to open in current window
+02 Save write buffer to file
+03 Undo undo last change
+04 Redo redo last undone change
+05 Cut delete selected text to clipboard
+06 Copy copy selected text to clipboard
+07 Paste paste text from clipboard
+08 Print print current buffer
+09 Help open a buffer on Vim's builtin help
+10 Find start a search command
+11 SaveAll write all modified buffers to file
+12 SaveSesn write session file for current situation
+13 NewSesn write new session file
+14 LoadSesn load session file
+15 RunScript browse for file to run as a Vim script
+16 Replace prompt for substitute command
+17 WinClose close current window
+18 WinMax make current window use many lines
+19 WinMin make current window use few lines
+20 WinSplit split current window
+21 Shell start a shell
+22 FindPrev search again, backward
+23 FindNext search again, forward
+24 FindHelp prompt for word to search help for
+25 Make run make and jump to first error
+26 TagJump jump to tag under the cursor
+27 RunCtags build tags for files in current directory
+28 WinVSplit split current window vertically
+29 WinMaxWidth make current window use many columns
+30 WinMinWidth make current window use few columns
+
+ *hidden-menus* *win32-hidden-menus*
+In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
+from the main menu bar. You must then use the |:popup| or |:tearoff| command
+to display it.
+
+ *popup-menu*
+In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the special
+menu "PopUp". This is the menu that is displayed when the right mouse button
+is pressed, if 'mousemodel' is set to popup or popup_setpos.
+
+
+5.3 Showing What Menus Are Mapped To *showing-menus*
+
+To see what an existing menu is mapped to, use just one argument after the
+menu commands (just like you would with the ":map" commands). If the menu
+specified is a submenu, then all menus under that hierarchy will be shown.
+If no argument is given after :menu at all, then ALL menu items are shown
+for the appropriate mode (eg, Command-line mode for :cmenu).
+
+Special characters in the list, just before the rhs:
+* The menu was defined with "nore" to disallow remapping.
+& The menu was defined with "<script>" to allow remapping script-local
+ mappings only.
+- The menu was disabled.
+
+Note that hitting <Tab> while entering a menu name after a menu command may
+be used to complete the name of the menu item.
+
+
+5.4 Executing Menus *execute-menus*
+
+ *:em* *:emenu* *E334* *E335*
+:[range]em[enu] {menu} Execute {menu} from the command line.
+ The default is to execute the Normal mode
+ menu. If a range is specified, it executes
+ the Visual mode menu.
+ If used from <c-o>, it executes the
+ insert-mode menu Eg: >
+ :emenu File.Exit
+
+If the console-mode vim has been compiled with WANT_MENU defined, you can
+use :emenu to access useful menu items you may have got used to from GUI
+mode. See 'wildmenu' for an option that works well with this. See
+|console-menus| for an example.
+
+When using a range, if the lines match with '<,'>, then the menu is executed
+using the last visual selection.
+
+
+5.5 Deleting Menus *delete-menus*
+
+ *:unme* *:unmenu*
+ *:aun* *:aunmenu*
+ *:nunme* *:nunmenu*
+ *:ounme* *:ounmenu*
+ *:vunme* *:vunmenu*
+ *:iunme* *:iunmenu*
+ *:cunme* *:cunmenu*
+To delete a menu item or a whole submenu, use the unmenu commands, which are
+analogous to the unmap commands. Eg: >
+ :unmenu! Edit.Paste
+
+This will remove the Paste item from the Edit menu for Insert and
+Command-line modes.
+
+Note that hitting <Tab> while entering a menu name after an umenu command
+may be used to complete the name of the menu item for the appropriate mode.
+
+To remove all menus use: *:unmenu-all* >
+ :unmenu * " remove all menus in Normal and visual mode
+ :unmenu! * " remove all menus in Insert and Command-line mode
+ :aunmenu * " remove all menus in all modes
+
+If you want to get rid of the menu bar: >
+ :set guioptions-=m
+
+
+5.6 Disabling Menus *disable-menus*
+
+ *:menu-disable* *:menu-enable*
+If you do not want to remove a menu, but disable it for a moment, this can be
+done by adding the "enable" or "disable" keyword to a ":menu" command.
+Examples: >
+ :menu disable &File.&Open\.\.\.
+ :amenu enable *
+ :amenu disable &Tools.*
+
+The command applies to the modes as used with all menu commands. Note that
+characters like "&" need to be included for translated names to be found.
+When the argument is "*", all menus are affected. Otherwise the given menu
+name and all existing submenus below it are affected.
+
+
+5.7 Examples for Menus *menu-examples*
+
+Here is an example on how to add menu items with menu's! You can add a menu
+item for the keyword under the cursor. The register "z" is used. >
+
+ :nmenu Words.Add\ Var wb"zye:menu! Words.<C-R>z <C-R>z<CR>
+ :nmenu Words.Remove\ Var wb"zye:unmenu! Words.<C-R>z<CR>
+ :vmenu Words.Add\ Var "zy:menu! Words.<C-R>z <C-R>z <CR>
+ :vmenu Words.Remove\ Var "zy:unmenu! Words.<C-R>z<CR>
+ :imenu Words.Add\ Var <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a
+ :imenu Words.Remove\ Var <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a
+
+(the rhs is in <> notation, you can copy/paste this text to try out the
+mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
+the <CR> key. |<>|)
+
+
+5.8 Tooltips & Menu tips
+
+See section |42.4| in the user manual.
+
+ *:tmenu* *:tm*
+:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in
+ X11 and Win32 GUI}
+
+:tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI}
+
+ *:tunmenu* *:tu*
+:tu[nmenu] {menupath} Remove a tip for a menu or tool.
+ {only in X11 and Win32 GUI}
+
+When a tip is defined for a menu item, it appears in the command-line area
+when the mouse is over that item, much like a standard Windows menu hint in
+the status bar. (Except when Vim is in Command-line mode, when of course
+nothing is displayed.)
+When a tip is defined for a ToolBar item, it appears as a tooltip when the
+mouse pauses over that button, in the usual fashion. Use the |hl-Tooltip|
+highlight group to change its colors.
+
+A "tip" can be defined for each menu item. For example, when defining a menu
+item like this: >
+ :amenu MyMenu.Hello :echo "Hello"<CR>
+The tip is defined like this: >
+ :tmenu MyMenu.Hello Displays a greeting.
+And delete it with: >
+ :tunmenu MyMenu.Hello
+
+Tooltips are currently only supported for the X11 and Win32 GUI. However, they
+should appear for the other gui platforms in the not too distant future.
+
+The ":tmenu" command works just like other menu commands, it uses the same
+arguments. ":tunmenu" deletes an existing menu tip, in the same way as the
+other unmenu commands.
+
+If a menu item becomes invalid (i.e. its actions in all modes are deleted) Vim
+deletes the menu tip (and the item) for you. This means that :aunmenu deletes
+a menu item - you don't need to do a :tunmenu as well.
+
+
+5.9 Popup Menus
+
+In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor.
+This behaves similarly to the PopUp menus except that any menu tree can
+be popped up.
+
+This command is for backwards compatibility, using it is discouraged, because
+it behaves in a strange way.
+
+ *:popup* *:popu*
+:popu[p] {name} Popup the menu {name}. The menu named must
+ have at least one subentry, but need not
+ appear on the menu-bar (see |hidden-menus|).
+ {only available for Win32 and GTK GUI}
+
+Example: >
+ :popup File
+will make the "File" menu (if there is one) appear at the text cursor. >
+
+ :amenu ]Toolbar.Make :make<CR>
+ :popup ]Toolbar
+This creates a popup menu that doesn't exist on the main menu-bar.
+
+Note that a menu that starts with ']' will not be displayed.
+
+==============================================================================
+6. Extras *gui-extras*
+
+This section describes other features which are related to the GUI.
+
+- With the GUI, there is no wait for one second after hitting escape, because
+ the key codes don't start with <Esc>.
+
+- Typing ^V followed by a special key in the GUI will insert "<Key>", since
+ the internal string used is meaningless. Modifiers may also be held down to
+ get "<Modifiers-Key>".
+
+- In the GUI, the modifiers SHIFT, CTRL, and ALT (or META) may be used within
+ mappings of special keys and mouse events. eg: :map <M-LeftDrag> <LeftDrag>
+
+- In the GUI, several normal keys may have modifiers in mappings etc, these
+ are <Space>, <Tab>, <NL>, <CR>, <Esc>.
+
+- To check in a Vim script if the GUI is being used, you can use something
+ like this: >
+
+ if has("gui_running")
+ echo "yes, we have a GUI"
+ else
+ echo "Boring old console"
+ endif
+
+==============================================================================
+7. Shell Commands *gui-shell*
+
+For the X11 GUI the external commands are executed inside the gvim window.
+See |gui-pty|.
+
+WARNING: Executing an external command from the X11 GUI will not always
+work. "normal" commands like "ls", "grep" and "make" mostly work fine.
+Commands that require an intelligent terminal like "less" and "ispell" won't
+work. Some may even hang and need to be killed from another terminal. So be
+careful!
+
+For the Win32 GUI the external commands are executed in a separate window.
+See |gui-shell-win32|.
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/gui_w16.txt b/runtime/doc/gui_w16.txt
new file mode 100644
index 000000000..5055afec6
--- /dev/null
+++ b/runtime/doc/gui_w16.txt
@@ -0,0 +1,186 @@
+*gui_w16.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Vim's Graphical User Interface *gui-w16* *win16-gui*
+
+1. Starting the GUI |win16-start|
+2. Vim as default editor |win16-default-editor|
+3. Using the clipboard |win16-clipboard|
+4. Shell Commands |win16-shell|
+5. Special colors |win16-colors|
+6. Windows dialogs & browsers |win16-dialogs|
+7. Various |win16-various|
+
+Other relevant documentation:
+|gui.txt| For generic items of the GUI.
+|os_msdos.txt| For items common to DOS and Windows.
+|gui_w32.txt| Some items here are also applicable to the Win16 version.
+
+{Vi does not have a Windows GUI}
+
+The Win16 version of Vim will run on Windows 3.1 or later. It has not been
+tested on 3.0, it probably won't work without being recompiled and
+modified. (but you really should upgrade to 3.11 anyway. :)
+
+In most respects it behaves identically to the Win32 GUI version, including
+having a flat-style toolbar(!). The chief differences:
+
+1) Bold/Italic text is not available, to speed up repaint/reduce resource
+ usage. (You can re-instate this by undefining MSWIN16_FASTTEXT.)
+2) No tearoff menu emulation.
+3) No OLE interface.
+4) No long filename support (of course)
+5) No tooltips on toolbar buttons - instead they produce command-line tips
+ like menu items do.
+6) Line length limited to 32767 characters (like 16-bit DOS version)
+
+
+==============================================================================
+1. Starting the GUI *win16-start*
+
+The Win16 GUI version of Vim will always start the GUI, no matter how you
+start it or what it's called. There is no 'console' version as such, but you
+can use one of the DOS versions in a DOS box.
+
+The Win16 GUI has an extra menu item: "Window/Select Font". It brings up the
+standard Windows font selector. Note that bold and italic fonts are not
+supported in an attempt to maximize GDI drawing speed.
+
+Setting the menu height doesn't work for the Win16 GUI.
+
+ *win16-maximized*
+If you want Vim to start with a maximized window, add this command to your
+vimrc or gvimrc file: >
+ au GUIEnter * simalt ~x
+<
+
+There is a specific version of gvim.exe that runs under the Win32s subsystem
+of Windows 3.1 or 3.11. See |win32s|.
+
+==============================================================================
+2. Vim as default editor *win16-default-editor*
+
+To set Vim as the default editor for a file type you can use File Manager's
+"Associate" feature.
+
+When you open a file in Vim by double clicking it, Vim changes to that
+file's directory.
+
+See also |notepad|.
+
+==============================================================================
+3. Using the clipboard *win16-clipboard*
+
+Windows has a clipboard, where you can copy text to, and paste text from. Vim
+supports this in several ways.
+The clipboard works in the same way as the Win32 version: see |gui-clipboard|.
+
+==============================================================================
+4. Shell Commands *win16-shell*
+
+Vim spawns a DOS window for external commands, to make it possible to run any
+DOS command. The window uses the _default.pif settings.
+
+ *win16-!start*
+Normally, Vim waits for a command to complete before continuing (this makes
+sense for most shell commands which produce output for Vim to use). If you
+want Vim to start a program and return immediately, you can use the following
+syntax:
+ :!start {command}
+This may only work for a Windows program though.
+Don't forget that you must tell Windows 3.1x to keep executing a DOS command
+in the background while you switch back to Vim.
+
+==============================================================================
+5. Special colors *win16-colors*
+
+On Win16, the normal DOS colors can be used. See |dos-colors|.
+
+Additionally the system configured colors can also be used. These are known
+by the names Sys_XXX, where XXX is the appropriate system color name, from the
+following list (see the Win32 documentation for full descriptions). Case is
+ignored.
+
+Sys_BTNFace Sys_BTNShadow Sys_ActiveBorder
+Sys_ActiveCaption Sys_AppWorkspace Sys_Background
+Sys_BTNText Sys_CaptionText Sys_GrayText
+Sys_Highlight Sys_HighlightText Sys_InactiveBorder
+Sys_InactiveCaption Sys_InactiveCaptionText Sys_Menu
+Sys_MenuText Sys_ScrollBar Sys_Window
+Sys_WindowFrame Sys_WindowText
+
+Probably the most useful values are
+ Sys_Window Normal window background
+ Sys_WindowText Normal window text
+ Sys_Highlight Highlighted background
+ Sys_HighlightText Highlighted text
+
+These extra colors are also available:
+Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
+
+
+See also |rgb.txt|.
+
+==============================================================================
+ *win16-dialogs*
+6. Windows dialogs & browsers
+
+The Win16 GUI can use familiar Windows components for some operations, as well
+as the traditional interface shared with the console version.
+
+
+6.1 Dialogs
+
+The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
+|:confirm| command and |confirm()| function are GUI-based rather than the
+console-based ones used by other versions. There is no option to change this.
+
+
+6.2 File Browsers
+
+When prepending ":browse" before file editing commands, a file requester is
+used to allow you to select an existing file. See |:browse|.
+
+
+==============================================================================
+7. Various *win16-various*
+
+ *win16-printing*
+The "File/Print" menu uses Notepad to print the current buffer. This is a bit
+clumsy, but it's portable. If you want something else, you can define your
+own print command. For example, you could look for the 16-bit version of
+PrintFile. See $VIMRUNTIME/menu.vim for how it works by default.
+
+Using this should also work: >
+ :w >>prn
+
+Vim supports a number of standard MS Windows features. Some of these are
+detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
+Also see |:simalt|
+
+ *win16-drag-n-drop*
+You can drag and drop one or more files into the vim window, where they will
+be opened as normal. If you hold down Shift while doing this, Vim changes to
+the (first) dropped file's directory. If you hold Ctrl, Vim will always split
+a new window for the file. Otherwise it's only done if the current buffer has
+been changed.
+You can also drop a directory's icon, but rather than open all files in the
+directory (which wouldn't usually be what you want) Vim instead changes to
+that directory and begins a new file.
+If Vim happens to be editing a command line, the names of the dropped files
+and directories will be inserted at the cursor. This allows you to use these
+names with any Ex command.
+
+ *win16-truetype*
+It is recommended that you use a raster font and not a TrueType
+fixed-pitch font. e.g. Use Courier, not Courier New. This is not just
+to use less resources but because there are subtle bugs in the
+handling of fixed-pitch TrueType in Win3.1x. In particular, when you move
+a block cursor over a pipe character '|', the cursor is drawn in the wrong
+size and bits get left behind. This is a bug in the Win3.1x GDI, it doesn't
+happen if you run the exe under 95/NT.
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
new file mode 100644
index 000000000..574aa35b0
--- /dev/null
+++ b/runtime/doc/gui_w32.txt
@@ -0,0 +1,472 @@
+*gui_w32.txt* For Vim version 7.0aa. Last change: 2004 May 03
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
+
+1. Starting the GUI |gui-w32-start|
+2. Vim as default editor |vim-default-editor|
+3. Using the clipboard |gui-clipboard|
+4. Shell Commands |gui-shell-win32|
+5. Special colors |win32-colors|
+6. Windows dialogs & browsers |gui-w32-dialogs|
+7. Command line arguments |gui-w32-cmdargs|
+8. Various |gui-w32-various|
+
+Other relevant documentation:
+|gui.txt| For generic items of the GUI.
+|os_win32.txt| For Win32 specific items.
+
+{Vi does not have a Windows GUI}
+
+==============================================================================
+1. Starting the GUI *gui-w32-start*
+
+The Win32 GUI version of Vim will always start the GUI, no matter how you
+start it or what it's called.
+
+The GUI will always run in the Windows subsystem. Mostly shells automatically
+return with a command prompt after starting gvim. If not, you should use the
+"start" command: >
+ start gvim [options] file ..
+
+Note: All fonts (bold, italic) must be of the same size!!! If you don't do
+this, text will disappear or mess up the display. Vim does not check the font
+sizes. It's the size in screen pixels that must be the same. Note that some
+fonts that have the same point size don't have the same pixel size!
+Additionally, the positioning of the fonts must be the same (ascent and
+descent).
+
+The Win32 GUI has an extra menu item: "Edit/Select Font". It brings up the
+standard Windows font selector.
+
+Setting the menu height doesn't work for the Win32 GUI.
+
+ *gui-win32-maximized*
+If you want Vim to start with a maximized window, add this command to your
+vimrc or gvimrc file: >
+ au GUIEnter * simalt ~x
+<
+ *gui-w32s*
+There is a specific version of gvim.exe that runs under the Win32s subsystem
+of Windows 3.1 or 3.11. See |win32s|.
+
+==============================================================================
+2. Vim as default editor *vim-default-editor*
+
+To set Vim as the default editor for a file type:
+1. Start a Windows Explorer
+2. Chose View/Options -> File Types
+3. Select the path to gvim for every file type that you want to use it for.
+ (you can also use three spaces in the file type field, for files without an
+ extension).
+ In the "open" action, use: >
+ gvim "%1"
+< The quotes are required for using file names with embedded spaces.
+ You can also use this: >
+ gvim "%L"
+< This should avoid short (8.3 character) file names in some situations. But
+ I'm not sure if this works everywhere.
+
+When you open a file in Vim by double clicking it, Vim changes to that
+file's directory.
+
+If you want Vim to start full-screen, use this for the Open action: >
+ gvim -c "simalt ~x" "%1"
+
+Another method, which also works when you put Vim in another directory (e.g.,
+when you have got a new version):
+1. select a file you want to use Vim with
+2. <Shift-F10>
+3. select "Open With..." menu entry
+4. click "Other..."
+5. browse to the (new) location of Vim and click "Open"
+6. make "Always Use this program..." checked
+7. <OK>
+
+ *send-to-menu* *sendto*
+You can also install Vim in the "Send To" menu:
+1. Start a Windows Explorer
+2. Navigate to your sendto directory:
+ Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
+ Windows NT: %windir%\profiles\%user%\sendto (e.g.
+ "c:\winnt\profiles\mattha\sendto").
+3. Right-click in the file pane and select New->Shortcut
+4. Follow the shortcut wizard, using the full path to VIM/GVIM.
+
+When you 'send a file to Vim', Vim changes to that file's directory. Note,
+however, that any long directory names will appear in their short (MS-DOS)
+form. This is a limitation of the Windows "Send To" mechanism.
+
+ *notepad*
+You could replace notepad.exe with gvim.exe, but that has a few side effects.
+Some programs rely on notepad arguments, which are not recognized by Vim. For
+example "notepad -p" is used by some applications to print a file. It's
+better to leave notepad where it is and use another way to start Vim.
+
+ *win32-popup-menu*
+A more drastic approach is to install an "Edit with Vim" entry in the popup
+menu for the right mouse button. With this you can edit any file with Vim.
+
+This can co-exist with the file associations mentioned above. The difference
+is that the file associations will make starting Vim the default action. With
+the "Edit with Vim" menu entry you can keep the existing file association for
+double clicking on the file, and edit the file with Vim when you want. For
+example, you can associate "*.mak" with your make program. You can execute
+the makefile by double clicking it and use the "Edit with Vim" entry to edit
+the makefile.
+
+You can select any files and right-click to see a menu option called "Edit
+with gvim". Chosing this menu option will invoke gvim with the file you have
+selected. If you select multiple files, you will find two gvim-related menu
+options:
+"Edit with multiple gvims" -- one gvim for each file in the selection
+"Edit with single gvim" -- one gvim for all the files in the selection
+And if there already is a gvim running:
+"Edit with existing gvim" -- edit the file with the running gvim
+
+ *install-registry*
+You can add the "Edit with Vim" menu entry in an easy way by using the
+"install.exe" program. It will add several registry entries for you.
+
+You can also do this by hand. This is complicated! Use the install.exe if
+you can.
+
+1. Start the registry editor with "regedit".
+2. Add these keys:
+ key value name value ~
+ HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
+ {default} Vim Shell Extension
+ HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
+ {default} {path}\gvimext.dll
+ ThreadingModel Apartment
+ HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
+ {default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
+ HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
+ {51EEE242-AD87-11d3-9C1E-0090278BBD99}
+ Vim Shell Extension
+ HKEY_LOCAL_MACHINE\Software\Vim\Gvim
+ path {path}\gvim.exe
+ HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 5.6
+ DisplayName Vim 5.6: Edit with Vim popup menu entry
+ UninstallString {path}\uninstal.exe
+
+ Replace {path} with the path that leads to the executable.
+ Don't type {default}, this is the value for the key itself.
+
+To remove "Edit with Vim" from the popup menu, just remove the registry
+entries mentioned above. The "uninstal.exe" program can do this for you. You
+can also use the entry in the Windows standard "Add/Remove Programs" list.
+
+If you notice that this entry overrules other file type associations, set
+those associations again by hand (using Windows Explorer, see above). This
+only seems to happen on some Windows NT versions (Windows bug?). Procedure:
+1. Find the name of the file type. This can be done by starting the registry
+ editor, and searching for the extension in \\HKEY_CLASSES_ROOT
+2. In a Windows Explorer, use View/Options/File Types. Search for the file
+ type in the list and click "Edit". In the actions list, you can select on
+ to be used as the default (normally the "open" action) and click on the
+ "Set Default" button.
+
+
+Vim in the "Open With..." context menu *win32-open-with-menu*
+
+If you use the Vim install program you have the choice to add Vim to the "Open
+With..." menu. This means you can use Vim to edit many files. Not every file
+(for unclear reasons...), thus the "Edit with Vim" menu entry is still useful.
+
+One reason to add this is to be able to edit HTML files directly from Internet
+Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
+In the dialog select the "Programs" tab and select Vim in the "HTML editor"
+choice. If it's not there than installing didn't work properly.
+
+Doing this manually can be done with this script:
+
+----------------------------------------------------------
+REGEDIT4
+
+[HKEY_CLASSES_ROOT\Applications\gvim.exe]
+
+[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell]
+
+[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit]
+
+[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit\command]
+@="c:\\vim\\vim62\\gvim.exe \"%1\""
+
+[HKEY_CLASSES_ROOT\.htm\OpenWithList\gvim.exe]
+
+[HKEY_CLASSES_ROOT\*\OpenWithList\gvim.exe]
+
+----------------------------------------------------------
+
+Change the "c:\\vim\\vim62" bit to where gvim.exe is actually located.
+
+To uninstall this run the Vim uninstall program or manually delete the
+registry entries with "regedit".
+
+==============================================================================
+3. Using the clipboard *gui-clipboard*
+
+Windows has a clipboard, where you can copy text to, and paste text from. Vim
+supports this in several ways. For other systems see |gui-selections|.
+
+The "* register reflects the contents of the clipboard. |quotestar|
+
+When the "unnamed" string is included in the 'clipboard' option, the unnamed
+register is the same. Thus you can yank to and paste from the clipboard
+without prepending "* to commands.
+
+The 'a' flag in 'guioptions' is not included by default. This means that text
+is only put on the clipboard when an operation is performed on it. Just
+Visually selecting text doesn't put it on the clipboard. When the 'a' flag is
+included, the text is copied to the clipboard even when it is not operated
+upon.
+
+ *mswin.vim*
+To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
+$VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
+ source $VIMRUNTIME/mswin.vim
+
+Since CTRL-C is used to copy the text to the clipboard, it can't be used to
+cancel an operation. Use CTRL-Break for that.
+
+ *CTRL-V-alternative*
+Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
+selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
+mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
+doesn't work for terminals when it's used for control flow.
+
+NOTE: The clipboard support still has a number of bugs. See |todo|.
+
+==============================================================================
+4. Shell Commands *gui-shell-win32*
+
+Vim uses another window for external commands, to make it possible to run any
+command. The external command gets its own environment for running, just like
+it was started from a DOS prompt.
+
+ *win32-vimrun*
+Executing an external command is done indirectly by the "vimrun" command. The
+"vimrun.exe" must be in the path for this to work. Or it must be in the same
+directory as the Vim executable. If "vimrun" cannot be found, the command is
+executed directly, but then the DOS window closes immediately after the
+external command has finished.
+WARNING: If you close this window with the "X" button, and confirm the
+question if you really want to kill the application, Vim may be killed too!
+(This does not apply to commands run asynchronously with ":!start".)
+
+In Windows 95, the window in which the commands are executed is always 25x80
+characters, to be as DOS compatible as possible (this matters!). The default
+system font is used. On NT, the window will be the default you have set up for
+"Console" in Control Panel. On Win32s, the properties of the DOS box are
+determined by _default.pif in the windows directory.
+
+ *msdos-mode*
+If you get a dialog that says "This program is set to run in MS-DOS mode..."
+when you run an external program, you can solve this by changing the
+properties of the associated shortcut:
+- Use a Windows Explorer to find the command.com that is used. It can be
+ c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
+- With the right mouse button, select properties of this command.com.
+- In the Program tab select "Advanced".
+- Unselect "MS-DOS mode".
+- Click "OK" twice.
+
+ *win32-!start*
+Normally, Vim waits for a command to complete before continuing (this makes
+sense for most shell commands which produce output for Vim to use). If you
+want Vim to start a program and return immediately, you can use the following
+syntax on W95 & NT: >
+ :!start {command}
+On Win32s, you will have to go to another window instead. Don't forget that
+you must tell Windows 3.1x to keep executing a DOS command in the background
+while you switch back to Vim.
+
+==============================================================================
+5. Special colors *win32-colors*
+
+On Win32, the normal DOS colors can be used. See |dos-colors|.
+
+Additionally the system configured colors can also be used. These are known
+by the names Sys_XXX, where XXX is the appropriate system color name, from the
+following list (see the Win32 documentation for full descriptions). Case is
+ignored. note: On Win32s not all of these colors are supported.
+
+Sys_3DDKShadow Sys_3DFace Sys_BTNFace
+Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
+Sys_BTNHighlight Sys_3DLight Sys_3DShadow
+Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
+Sys_AppWorkspace Sys_Background Sys_Desktop
+Sys_BTNText Sys_CaptionText Sys_GrayText
+Sys_Highlight Sys_HighlightText Sys_InactiveBorder
+Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
+Sys_InfoText Sys_Menu Sys_MenuText
+Sys_ScrollBar Sys_Window Sys_WindowFrame
+Sys_WindowText
+
+Probably the most useful values are
+ Sys_Window Normal window background
+ Sys_WindowText Normal window text
+ Sys_Highlight Highlighted background
+ Sys_HighlightText Highlighted text
+
+These extra colors are also available:
+Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
+
+ *rgb.txt*
+Additionally, colors defined by a "rgb.txt" file can be used. This file is
+well known from X11. A few lines from it: >
+
+ 255 218 185 peach puff
+ 205 133 63 peru
+ 255 181 197 pink
+
+This shows the layout of the file: First the R, G and B value as a decimal
+number, followed by the name of the color. The four fields are separated by
+spaces.
+
+You can get an rgb.txt file from any X11 distribution. It is located in a
+directory like "/usr/X11R6/lib/X11/". For Vim it must be located in the
+$VIMRUNTIME directory. Thus the file can be found with "$VIMRUNTIME/rgb.txt".
+
+==============================================================================
+ *gui-w32-dialogs* *dialog*
+6. Windows dialogs & browsers
+
+The Win32 GUI can use familiar Windows components for some operations, as well
+as the traditional interface shared with the console version.
+
+
+6.1 Dialogs
+
+The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
+|:confirm| command and |confirm()| function) are GUI-based rather than the
+console-based ones used by other versions. The 'c' flag in 'guioptions'
+changes this.
+
+
+6.2 File Browsers
+
+When prepending ":browse" before file editing commands, a file requester is
+used to allow you to select an existing file. See |:browse|.
+
+
+6.3 Tearoff Menus
+
+The Win32 GUI emulates Motif's tear-off menus. At the top of each menu you
+will see a small graphic "rip here" sign. Selecting it will cause a floating
+window to be created with the same menu entries on it. The floating menu can
+then be accessed just as if it was the original (including sub-menus), but
+without having to go to the menu bar each time.
+This is most useful if you find yourself using a command buried in a sub-menu
+over and over again.
+The tearoff menus can be positioned where you like, and always stay just above
+the Main Vim window. You can get rid of them by closing them as usual; they
+also of course close when you exit Vim.
+
+ *:tearoff* *:te*
+:te[aroff] {name} Tear-off the menu {name}. The menu named must have at
+ least one subentry, but need not appear on the
+ menu-bar (see |win32-hidden-menus|).
+
+Example: >
+ :tearoff File
+will make the "File" menu (if there is one) appear as a tearoff menu. >
+
+ :amenu ]Toolbar.Make :make<CR>
+ :tearoff ]Toolbar
+This creates a floating menu that doesn't exist on the main menu-bar.
+
+Note that a menu that starts with ']' will not be displayed.
+
+==============================================================================
+7. Command line arguments *gui-w32-cmdargs*
+
+Analysis of a command line into parameters is not standardised in MS Windows.
+Gvim has to provide logic to analyse a command line. This logic is likely to
+be different from the default logic provided by a compilation system used to
+build vim. The differences relate to unusual double quote (") usage.
+The arguments "C:\My Music\freude.txt" and "+/Sch\"iller" are handled in the
+same way. The argument "+/Sch""iller" may be handled different by gvim and
+vim, depending what it was compiled with.
+
+The rules are:
+ a) A parameter is a sequence of graphic characters.
+ b) Parameters are separated by white space.
+ c) A parameter can be enclosed in double quotes to include white space.
+ d) A sequence of zero or more backslashes (\) and a double quote (")
+ is special. The effective number of backslashes is halved, rounded
+ down. An even number of backslashes reverses the acceptability of
+ spaces and tabs, an odd number of backslashes produces a literal
+ double quote.
+
+So:
+ " is a special double quote
+ \" is a literal double quote
+ \\" is a literal backslash and a special double quote
+ \\\" is a literal backslash and a literal double quote
+ \\\\" is 2 literal backslashes and a special double quote
+ \\\\\" is 2 literal backslashes and a literal double quote
+ etc.
+
+Example: >
+ gvim "C:\My Music\freude" +"set ignorecase" +/"\"foo\\" +\"bar\\\"
+
+opens "C:\My Music\freude" and executes the line mode commands: >
+ set ignorecase; /"foo\ and /bar\"
+
+==============================================================================
+8. Various *gui-w32-various*
+
+ *gui-w32-printing*
+The "File/Print" menu prints the text with syntax highlighting, see
+|:hardcopy|. If you just want to print the raw text and have a default
+printer installed this should also work: >
+ :w >>prn
+
+Vim supports a number of standard MS Windows features. Some of these are
+detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
+
+ *drag-n-drop-win32*
+You can drag and drop one or more files into the Vim window, where they will
+be opened as normal. See |drag-n-drop|.
+
+ *:simalt* *:si*
+:sim[alt] {key} simulate pressing {key} while holding Alt pressed.
+ {not in Vi} {only for Win32 versions}
+
+Normally, Vim takes control of all Alt-<Key> combinations, to increase the
+number of possible mappings. This clashes with the standard use of Alt as the
+key for accessing menus.
+The quick way of getting standard behavior is to set the 'winaltkeys' option
+to "yes". This however prevents you from mapping Alt keys at all.
+Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
+handled by windows, other ALT keys can be mapped. This doesn't allow a
+dependency on the current state though.
+To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
+"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
+combinations (or anything else for that matter) to produce standard Windows
+actions. Here are some examples: >
+
+ :map <M-f> :simalt f<CR>
+This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
+simulating the keystrokes Alt, F. >
+ :map <M-Space> :simalt ~<CR>
+This maps Alt-Space to pop down the system menu for the Vim window. Note that
+~ is used by simalt to represent the <Space> character. >
+ :map <C-n> :simalt ~n<CR>
+Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
+Vim window via the system menu.
+
+ *intellimouse-wheel-problems*
+When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
+to:
+ ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
+
+And add gvim to the list of applications. This problem only appears to happen
+with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt
new file mode 100644
index 000000000..d54730229
--- /dev/null
+++ b/runtime/doc/gui_x11.txt
@@ -0,0 +1,576 @@
+*gui_x11.txt* For Vim version 7.0aa. Last change: 2004 Mar 16
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Vim's Graphical User Interface *gui-x11* *GUI-X11*
+ *Athena* *Motif*
+1. Starting the X11 GUI |gui-x11-start|
+2. GUI Resources |gui-resources|
+3. Shell Commands |gui-pty|
+4. Various |gui-x11-various|
+5. GTK version |gui-gtk|
+6. GNOME version |gui-gnome|
+7. Compiling |gui-x11-compiling|
+8. X11 selection mechanism |x11-selection|
+
+Other relevant documentation:
+|gui.txt| For generic items of the GUI.
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Starting the X11 GUI *gui-x11-start* *E665*
+
+Then you can run the GUI version of Vim in either of these ways:
+ gvim [options] [files...]
+ vim -g [options] [files...]
+
+So if you call the executable "gvim", or make "gvim" a link to the executable,
+then the GUI version will automatically be used. Additional characters may be
+added after "gvim", for example "gvim-5".
+
+You may also start up the GUI from within the terminal version by using one of
+these commands:
+ :gui [++opt] [+cmd] [-f|-b] [files...] *:gu* *:gui*
+ :gvim [++opt] [+cmd] [-f|-b] [files...] *:gv* *:gvim*
+The "-f" option runs Vim in the foreground.
+The "-b" option runs Vim in the background (this is the default).
+Also see |++opt| and |+cmd|.
+
+ *gui-fork*
+When the GUI is started, it does a fork() and exits the current process.
+When gvim was started from a shell this makes the shell accept further
+commands. If you don't want this (e.g. when using gvim for a mail program
+that waits for gvim to exit), start gvim with "gvim -f", "vim -gf" or use
+":gui -f". Don't use "vim -fg", because "-fg" specifies the foreground
+color.
+
+When using "gvim -f" and then ":gui", Vim will run in the foreground. The
+"-f" argument will be remembered. To force running Vim in the background use
+":gui -b".
+
+"gvim --nofork" does the same as "gvim -f".
+
+If you want the GUI to run in the foreground always, include the 'f'
+flag in 'guioptions'. |-f|.
+
+==============================================================================
+2. GUI Resources *gui-resources* *.Xdefaults*
+
+If using the Motif or Athena version of the GUI (not for the GTK+ or Win32
+version), a number of X resources are available. You should use Vim's class
+"Vim" when setting these. They are as follows:
+
+ Resource name Meaning ~
+
+ reverseVideo Boolean: should reverse video be used?
+ background Color of background.
+ foreground Color of normal text.
+ scrollBackground Color of trough portion of scrollbars.
+ scrollForeground Color of slider and arrow portions of scrollbars.
+ menuBackground Color of menu backgrounds.
+ menuForeground Color of menu foregrounds.
+ tooltipForeground Color of tooltip and balloon foreground.
+ tooltipBackground Color of tooltip and balloon background.
+
+ font Name of font used for normal text.
+ boldFont Name of font used for bold text.
+ italicFont Name of font used for italic text.
+ boldItalicFont Name of font used for bold, italic text.
+ menuFont Name of font used for the menus, used when compiled
+ without the |+xfontset| feature
+ menuFontSet Name of fontset used for the menus, used when compiled
+ with the |+xfontset| feature
+ tooltipFont Name of the font used for the tooltip and balloons.
+ When compiled with the |+xfontset| feature this is a
+ fontset name.
+
+ geometry Initial geometry to use for gvim's window (default
+ is same size as terminal that started it).
+ scrollbarWidth Thickness of scrollbars.
+ borderWidth Thickness of border around text area.
+ menuHeight Height of the menu bar (only for Athena).
+
+A special font for italic, bold, and italic-bold text will only be used if
+the user has specified one via a resource. No attempt is made to guess what
+fonts should be used for these based on the normal text font.
+
+Note that the colors can also be set with the ":highlight" command, using the
+"Normal", "Menu", "Tooltip", and "Scrollbar" groups. Example: >
+ :highlight Menu guibg=lightblue
+ :highlight Tooltip guibg=yellow
+ :highlight Scrollbar guibg=lightblue guifg=blue
+ :highlight Normal guibg=grey90
+<
+ *font-sizes*
+Note: All fonts (except for the menu and tooltip) must be of the same size!!!
+If you don't do this, text will disappear or mess up the display. Vim does
+not check the font sizes. It's the size in screen pixels that must be the
+same. Note that some fonts that have the same point size don't have the same
+pixel size! Additionally, the positioning of the fonts must be the same
+(ascent and descent). You can check this with "xlsfonts -l {fontname}".
+
+If any of these things are also set with Vim commands, eg with
+":set guifont=Screen15", then this will override the X resources (currently
+'guifont' is the only option that is supported).
+
+Here is an example of what you might put in your ~/.Xdefaults file: >
+
+ Vim*useSchemes: all
+ Vim*sgiMode: true
+ Vim*useEnhancedFSB: true
+ Vim.foreground: Black
+ Vim.background: Wheat
+ Vim*fontList: 7x13
+
+The first three of these are standard resources on Silicon Graphics machines
+which make Motif applications look even better, highly recommended!
+
+The "Vim*fontList" is to set the menu font for Motif. Example: >
+ Vim*menuBar*fontList: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
+With Athena: >
+ Vim*menuBar*SmeBSB*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
+ Vim*menuBar*MenuButton*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
+
+NOTE: A more portable, and indeed more correct, way to specify the menu font
+in either Motif or Athena is through the resource: >
+ Vim.menuFont: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
+Or, when compiled with the |+xfontset| feature: >
+ Vim.menuFontSet: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
+
+Don't use "Vim*geometry" in the defaults. This will break the menus. Use
+"Vim.geometry" instead.
+
+If you get an error message "Cannot allocate colormap entry for "gray60",
+try adding this to your Vim resources (change the colors to your liking): >
+
+ Vim*scrollBackground: Black
+ Vim*scrollForeground: Blue
+
+The resources can also be set with arguments to Vim:
+
+ argument meaning ~
+ *-gui*
+ -display {display} Run vim on {display} *-display*
+ -iconic Start vim iconified *-iconic*
+ -background {color} Use {color} for the background *-background*
+ -bg {color} idem *-bg*
+ -foreground {color} Use {color} for normal text *-foreground*
+ -fg {color} idem *-fg*
+ -ul {color} idem *-ul*
+ -font {font} Use {font} for normal text *-font*
+ -fn {font} idem *-fn*
+ -boldfont {font} Use {font} for bold text *-boldfont*
+ -italicfont {font} Use {font} for italic text *-italicfont*
+ -menufont {font} Use {font} for menu items *-menufont*
+ -menufontset {fontset} Use {fontset} for menu items *-menufontset*
+ -mf {font} idem *-mf*
+ -geometry {geom} Use {geom} for initial geometry *-geometry*
+ -geom {geom} idem, see |-geometry-example| *-geom*
+ -borderwidth {width} Use a border width of {width} *-borderwidth*
+ -bw {width} idem *-bw*
+ *-scrollbarwidth*
+ -scrollbarwidth {width} Use a scrollbar width of {width}
+ -sw {width} idem *-sw*
+ -menuheight {height} Use a menu bar height of {height} *-menuheight*
+ -mh {height} idem *-mh*
+ NOTE: On Motif the value is ignored, the menu height
+ is computed to fit the menus.
+ -reverse Use reverse video *-reverse*
+ -rv idem *-rv*
+ +reverse Don't use reverse video *-+reverse*
+ +rv idem *-+rv*
+ -xrm {resource} Set the specified resource *-xrm*
+
+Note about reverse video: Vim checks that the result is actually a light text
+on a dark background. The reason is that some X11 versions swap the colors,
+and some don't. These two examples will both give yellow text on a blue
+background:
+ gvim -fg Yellow -bg Blue -reverse
+ gvim -bg Yellow -fg Blue -reverse
+
+ *-geometry-example*
+An example for the geometry argument: >
+ gvim -geometry 80x63+8+100
+This creates a window with 80 columns and 63 lines at position 8 pixels from
+the left and 100 pixels from the top of the screen.
+
+==============================================================================
+3. Shell Commands *gui-pty*
+
+WARNING: Executing an external command from the GUI will not always work.
+"normal" commands like "ls", "grep" and "make" mostly work fine. Commands
+that require an intelligent terminal like "less" and "ispell" won't work.
+Some may even hang and need to be killed from another terminal. So be
+careful!
+
+There are two ways to do the I/O with a shell command: Pipes and a pseudo-tty.
+The default is to use a pseudo-tty. This should work best on most systems.
+
+Unfortunately, the implementation of the pseudo-tty is different on every Unix
+system. And some systems require root permission. To avoid running into
+problems with a pseudo-tty when you least expect it, test it when not editing
+a file. Be prepared to "kill" the started command or Vim. Commands like
+":r !cat" may hang!
+
+If using a pseudo-tty does not work for you, reset the 'guipty' option: >
+
+ :set noguipty
+
+Using a pipe should work on any Unix system, but there are disadvantages:
+- Some shell commands will notice that a pipe is being used and behave
+ differently. E.g., ":!ls" will list the files in one column.
+- The ":sh" command won't show a prompt, although it will sort of work.
+- When using ":make" it's not possible to interrupt with a CTRL-C.
+
+Typeahead while the external command is running is often lost. This happens
+both with a pipe and a pseudo-tty. This is a known problem, but it seems it
+can't be fixed (or at least, it's very difficult).
+
+ *gui-pty-erase*
+When your erase character is wrong for an external command, you should fix
+this in your "~/.cshrc" file, or whatever file your shell uses for
+initializations. For example, when you want to use backspace to delete
+characters, but hitting backspaces produces "^H" instead, try adding this to
+your "~/.cshrc": >
+ stty erase ^H
+The ^H is a real CTRL-H, type it as CTRL-V CTRL-H.
+
+==============================================================================
+4. Various *gui-x11-various*
+
+ *gui-x11-printing*
+The "File/Print" menu simply sends the current buffer to "lpr". No options or
+whatever. If you want something else, you can define your own print command.
+For example: >
+
+ :10amenu File.Print :w !lpr -Php3
+ :10vmenu File.Print :w !lpr -Php3
+<
+ *X11-icon*
+Vim uses a black&white icon by default when compiled with Motif or Athena. A
+colored Vim icon is included as $VIMRUNTIME/vim32x32.xpm. For GTK+, this is
+the builtin icon used. Unfortunately, how you should install it depends on
+your window manager. When you use this, remove the 'i' flag from
+'guioptions', to remove the black&white icon: >
+ :set guioptions-=i
+
+If you use one of the fvwm* family of window managers simply add this line to
+your .fvwm2rc configuration file: >
+
+ Style "vim" Icon vim32x32.xpm
+
+Make sure the icon file's location is consistent with the window manager's
+ImagePath statement. Either modify the ImagePath from within your .fvwm2rc or
+drop the icon into one the pre-defined directories: >
+
+ ImagePath /usr/X11R6/include/X11/pixmaps:/usr/X11R6/include/X11/bitmaps
+
+Note: older versions of fvwm use "IconPath" instead of "ImagePath".
+
+For CDE "dtwm" (a derivative of Motif) add this line in the .Xdefaults: >
+ Dtwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm
+
+For "mwm" (Motif window manager) the line would be: >
+ Mwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm
+
+Mouse Pointers Available in X11 *X11_mouse_shapes*
+
+By using the |'mouseshape'| option, the mouse pointer can be automatically
+changed whenever Vim enters one of its various modes (e.g., Insert or
+Command). Currently, the available pointers are:
+
+ arrow an arrow pointing northwest
+ beam a I-like vertical bar
+ size an arrow pointing up and down
+ busy a wristwatch
+ blank an invisible pointer
+ crosshair a thin "+" sign
+ hand1 a dark hand pointing northeast
+ hand2 a light hand pointing northwest
+ pencil a pencil pointing southeast
+ question question_arrow
+ right_arrow an arrow pointing northeast
+ up_arrow an arrow pointing upwards
+
+Additionally, any of the mouse pointers that are built into X11 may be
+used by specifying an integer from the X11/cursorfont.h include file.
+
+If a name is used that exists on other systems, but not in X11, the default
+"arrow" pointer is used.
+
+==============================================================================
+5. GTK version *gui-gtk* *GTK+* *GTK*
+
+The GTK version of the GUI works a little bit different.
+
+GTK does _not_ use the traditional X resource settings. Thus items in your
+~/.Xdefaults or app-defaults files are not used.
+Many of the traditional X command line arguments are not supported. (e.g.,
+stuff like -bg, -fg, etc). The ones that are supported are:
+
+ command line argument resource name meaning ~
+ -fn or -font .font font name for the text
+ -geom or -geometry .geometry size of the gvim window
+ -rv or -reverse *reverseVideo white text on black background
+ -display display to be used
+ -fg -foreground {color} foreground color
+ -bg -background {color} background color
+
+To set the font, see |'guifont'|. For GTK, there's also a menu option that
+does this.
+
+Additionally, there are these command line arguments, which are handled by GTK
+internally. Look in the GTK documentation for how they are used:
+ --sync
+ --gdk-debug
+ --gdk-no-debug
+ --no-xshm (not in GTK+ 2)
+ --xim-preedit (not in GTK+ 2)
+ --xim-status (not in GTK+ 2)
+ --gtk-debug
+ --gtk-no-debug
+ --g-fatal-warnings
+ --gtk-module
+ --display (GTK+ counterpart of -display; works the same way.)
+ --screen (The screen number; for GTK+ 2.2 multihead support.)
+
+These arguments are ignored when the |+netbeans_intg| feature is used:
+ -xrm
+ -mf
+
+As for colors, Vim's color settings (for syntax highlighting) is still
+done the traditional Vim way. See |:highlight| for more help.
+
+If you want to set the colors of remaining gui components (e.g., the
+menubar, scrollbar, whatever), those are GTK specific settings and you
+need to set those up in some sort of gtkrc file. You'll have to refer
+to the GTK documentation, however little there is, on how to do this.
+See http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
+for more information.
+
+ *gtk-tooltip-colors*
+Example, which sets the tooltip colors to black on light-yellow: >
+
+ style "tooltips"
+ {
+ bg[NORMAL] = "#ffffcc"
+ fg[NORMAL] = "#000000"
+ }
+
+ widget "gtk-tooltips*" style "tooltips"
+
+Write this in the file ~/.gtkrc and it will be used by GTK+. For GTK+ 2
+you might have to use the file ~/.gtkrc-2.0 instead, depending on your
+distribution.
+
+Using Vim as a GTK+ plugin *gui-gtk-socketid*
+
+When the GTK+ version of Vim starts up normally, it creates its own top level
+window (technically, a 'GtkWindow'). GTK+ provides an embedding facility with
+its GtkSocket and GtkPlug widgets. If one GTK+ application creates a
+GtkSocket widget in one of its windows, an entirely different GTK+ application
+may embed itself into the first application by creating a top-level GtkPlug
+widget using the socket's ID.
+
+If you pass Vim the command-line option '--socketid' with a decimal or
+hexadecimal value, Vim will create a GtkPlug widget using that value instead
+of the normal GtkWindow. This enables Vim to act as a GTK+ plugin.
+
+This really is a programmer's interface, and is of no use without a supporting
+application to spawn the Vim correctly. For more details on GTK+ sockets, see
+http://www.gtk.org/api/
+
+Note that this feature requires the latest GTK version. GTK 1.2.10 still has
+a small problem. The socket feature has not yet been tested with GTK+ 2 --
+feel free to volunteer.
+
+==============================================================================
+6. GNOME version *gui-gnome* *Gnome* *GNOME*
+
+The GNOME GUI works just like the GTK+ version. See |GTK+| above for how it
+works. It looks a bit different though, and implements one important feature
+that's not available in the plain GTK+ GUI: Interaction with the session
+manager. |gui-gnome-session|
+
+These are the different looks:
+- Uses GNOME dialogs (GNOME 1 only). The GNOME 2 GUI uses the same nice
+ dialogs as the GTK+ 2 version.
+- Uses the GNOME dock, so that the toolbar and menubar can be moved to
+ different locations other than the top (e.g., the toolbar can be placed on
+ the left, right, top, or bottom). The placement of the menubar and
+ toolbar is only saved in the GNOME 2 version.
+- That means the menubar and toolbar handles are back! Yeah! And the
+ resizing grid still works too.
+
+GNOME is automatically compiled with if it was found by configure.
+(FIXME: Is this still true? Use --enable-gnome-check to force it to.)
+
+GNOME session support *gui-gnome-session* *gnome-session*
+
+On logout, Vim shows the well-known exit confirmation dialog if any buffers
+are modified. Clicking [Cancel] will stop the logout process. Otherwise the
+current session is stored to disk by using the |:mksession| command, and
+restored the next time you log in.
+
+The GNOME session support should also work with the KDE session manager.
+If you are experiencing any problems please report them as bugs.
+
+Note: The automatic session save works entirely transparent, in order to
+avoid conflicts with your own session files, scripts and autocommands. That
+means in detail:
+- The session file is stored to a separate directory (usually $HOME/.gnome2).
+- 'sessionoptions' is ignored, and a hardcoded set of appropriate flags is
+ used instead: >
+ blank,curdir,folds,globals,help,options,winsize
+- The internal variable |v:this_session| is not changed when storing the
+ session. Also, it is restored to its old value when logging in again.
+
+The position and size of the GUI window is not saved by Vim since doing so
+is the window manager's job. But if compiled with GTK+ 2 support, Vim helps
+the WM to identify the window by restoring the window role (using the |--role|
+command line argument).
+
+==============================================================================
+7. Compiling *gui-x11-compiling*
+
+If using X11, Vim's Makefile will by default first try to find the necessary
+GTK+ files on your system. If the GTK+ files cannot be found, then the Motif
+files will be searched for. Finally, if this fails, the Athena files will be
+searched for. If all three fail, the GUI will be disabled.
+
+For GTK+, Vim's configuration process requires that GTK+ be properly
+installed. That is, the shell script 'gtk-config' must be in your PATH, and
+you can already successful compile, build, and execute a GTK+ program. The
+reason for this is because the compiler flags (CFLAGS) and link flags
+(LDFLAGS) are obtained through the 'gtk-config' shell script.
+
+If you want to build with GTK+ 2 support pass the --enable-gtk2-check argument
+to ./configure. Optionally, support for GNOME 2 will be compiled if the
+--enable-gnome-check option is also given. Note that the support for GTK+ 2
+is still experimental. However, many people have reported that it works just
+fine for them.
+
+Otherwise, if you are using Motif or Athena, when you have the Motif or Athena
+files in a directory where configure doesn't look, edit the Makefile to enter
+the names of the directories. Search for "GUI_INC_LOC" for an example to set
+the Motif directories, "CONF_OPT_X" for Athena.
+
+ *gui-x11-gtk*
+At the time of this writing, you may use either GTK+ version 1.0.6 or 1.2. It
+is suggested that you use v1.2 since not all of Vim's GUI features are present
+if using v1.0.6. For instance, there are no tearoff menus present in v1.0.6.
+Using a version from GTK+'s CVS tree may or may not work, and is therefore not
+supported and not recommended.
+
+For the experimental GTK+ 2 GUI, using the latest release of the GTK+ 2.0 or
+GTK+ 2.2 series is recommended. CVS HEAD seems to work fine most of time as
+well.
+
+Lastly, although GTK+ has supposedly been ported to the Win32 platform, this
+has not been tested with Vim and is also unsupported. Also, it's unlikely to
+even compile since GTK+ GUI uses parts of the generic X11 code. This might
+change in distant future; particularly because getting rid of the X11 centric
+code parts is also required for GTK+ framebuffer support.
+
+ *gui-x11-motif*
+For Motif, you need at least Motif version 1.2 and/or X11R5. Motif 2.0 and
+X11R6 are OK. Motif 1.1 and X11R4 might work, no guarantee (there may be a
+few problems, but you might make it compile and run with a bit of work, please
+send me the patches if you do). The newest releases of LessTif have been
+reported to work fine too.
+
+ *gui-x11-athena*
+The Athena version uses the Xaw widget set by default. If you have the 3D
+version, you might want to link with Xaw3d instead. This will make the
+menus look a bit better. Edit the Makefile and look for "XAW_LIB". The
+scrollbars will remain the same, because Vim has its own, which are already
+3D (in fact, they look more like Motif).
+
+ *gui-x11-neXtaw*
+The neXtaw version is mostly like Athena, but uses different widgets.
+
+ *gui-x11-misc*
+In general, do not try to mix files from different GTK+, Motif, Athena and X11
+versions. This will cause problems. For example, using header files for
+X11R5 with a library for X11R6 probably doesn't work (although the linking
+won't give an error message, Vim will crash later).
+
+==============================================================================
+8. X11 selection mechanism *x11-selection*
+
+If using X11, in either the GUI or an xterm with an X11-aware Vim, then Vim
+provides varied access to the X11 selection and clipboard. These are accessed
+by using the two selection registers "* and "+.
+
+X11 provides two basic types of global store, selections and cut-buffers,
+which differ in one important aspect: selections are "owned" by an
+application, and disappear when that application (e.g., Vim) exits, thus
+losing the data, whereas cut-buffers, are stored within the X-server itself
+and remain until written over or the X-server exits (e.g., upon logging out).
+
+The contents of selections are held by the originating application (e.g., upon
+a copy), and only passed on to another application when that other application
+asks for them (e.g., upon a paste).
+
+The contents of cut-buffers are immediately written to, and are then
+accessible directly from the X-server, without contacting the originating
+application.
+
+ *quoteplus* *quote+*
+There are three documented X selections: PRIMARY (which is expected to
+represent the current visual selection - as in Vim's Visual mode), SECONDARY
+(which is ill-defined) and CLIPBOARD (which is expected to be used for
+cut, copy and paste operations).
+
+Of these three, Vim uses PRIMARY when reading and writing the "* register
+(hence when the X11 selections are available, Vim sets a default value for
+|'clipboard'| of "autoselect"), and CLIPBOARD when reading and writing the "+
+register. Vim does not access the SECONDARY selection.
+
+Examples: (assuming the default option values)
+- Select an URL in Visual mode in Vim. Go to a text field in Netscape and
+ click the middle mouse button. The selected text will be inserted
+ (hopefully!).
+- Select some text in Netscape by dragging with the mouse. Go to Vim and
+ press the middle mouse button: The selected text is inserted.
+- Select some text in Vim and do "+y. Go to Netscape, select some text in a
+ textfield by dragging with the mouse. Now use the right mouse button and
+ select "Paste" from the popup menu. The selected text is overwritten by the
+ text from Vim.
+Note that the text in the "+ register remains available when making a Visual
+selection, which makes other text available in the "* register. That allows
+overwriting selected text.
+ *x11-cut-buffer*
+There are, by default, 8 cut-buffers: CUT_BUFFER0 to CUT_BUFFER7. Vim only
+uses CUT_BUFFER0, which is the one that xterm uses by default.
+
+Whenever Vim is about to become unavailable (either via exiting or becoming
+suspended), and thus unable to respond to another application's selection
+request, it writes the contents of any owned selection to CUT_BUFFER0. If the
+"+ CLIPBOARD selection is owned by Vim, then this is written in preference,
+otherwise if the "* PRIMARY selection is owned by Vim, then that is written.
+
+Similarly, when Vim tries to paste from "* or "+ (either explicitly, or, in
+the case of the "* register, when the middle mouse button is clicked), if the
+requested X selection is empty or unavailable, Vim reverts to reading the
+current value of the CUT_BUFFER0.
+
+Note that when text is copied to CUT_BUFFER0 in this way, the type of
+selection (character, line or block) is always lost, even if it is a Vim which
+later pastes it.
+
+Xterm, by default, always writes visible selections to both PRIMARY and
+CUT_BUFFER0. When it pastes, it uses PRIMARY if this is available, or else
+falls back upon CUT_BUFFER0. For this reason, when cutting and pasting
+between Vim and an xterm, you should use the "* register. Xterm doesn't use
+CLIPBOARD, thus the "+ doesn't work with xterm.
+
+Most newer applications will provide their current selection via PRIMARY ("*)
+and use CLIPBOARD ("+) for cut/copy/paste operations. You thus have access to
+both by choosing to use either of the "* or "+ registers.
+
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/hangulin.txt b/runtime/doc/hangulin.txt
new file mode 100644
index 000000000..c1133cb97
--- /dev/null
+++ b/runtime/doc/hangulin.txt
@@ -0,0 +1,101 @@
+*hangulin.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
+
+Introduction *hangul*
+------------
+It is to input hangul, the Korean language, with VIM GUI version.
+If you have a XIM program, you can use another |+xim| feature.
+Basically, it is for whom has no XIM program.
+
+Compile
+-------
+Next is a basic option. You can add any other configure option. >
+
+ ./configure --with-x --enable-multibyte --enable-fontset --enable-hangulinput
+
+And you should check the feature.h. If |+hangul_input| feature is enabled
+by configure, you can select more options such as keyboard type, 2 bulsik
+or 3 bulsik. You can find keywords like next in there. >
+
+ #define HANGUL_DEFAULT_KEYBOARD 2
+ #define ESC_CHG_TO_ENG_MODE
+ /* #define X_LOCALE */
+ /* #define SLOW_XSERVER */
+
+Environment variables
+---------------------
+You should set LANG variable to Korean locale such as ko or ko_KR.euc.
+If you set LC_ALL variable, it should be set to Korean locale also.
+
+VIM resource
+------------
+You should add nexts to your global vimrc ($HOME/.vimrc). >
+
+ :set fileencoding=korea
+
+Keyboard
+--------
+You can change keyboard type (2 bulsik or 3 bulsik) using VIM_KEYBOARD
+or HANGUL_KEYBOARD_TYPE environment variables. For sh, just do (2 bulsik): >
+
+ export VIM_KEYBOARD="2"
+or >
+ export HANGUL_KEYBOARD_TYPE="2"
+
+If both are set, VIM_KEYBOARD has higher priority.
+
+Hangul Fonts
+------------
+You can set text font using $HOME/.Xdefaults or $HOME/.gvimrc.
+But to use Hangul, you should set 'guifontset' in your vimrc.
+
+$HOME/.Xdefaults: >
+ Vim.font: english_font
+
+ ! Nexts are for hangul menu with Athena
+ *international: True
+ Vim*fontSet: english_font,hangul_font
+
+ ! Nexts are for hangul menu with Motif
+ *international: True
+ Vim*fontList: english_font;hangul_font:
+
+$HOME/.gvimrc: >
+ set guifontset=english_font,hangul_font
+
+attention! the , (comma) or ; (semicolon)
+
+And there should be no ':set guifont'. If it exists, then Gvim ignores
+':set guifontset'. It means VIM runs without fontset supporting.
+So, you can see only English. Hangul does not be correctly displayed.
+
+After 'fontset' feature is enabled, VIM does not allow using 'font'.
+For example, if you use >
+ :set guifontset=eng_font,your_font
+in your .gvimrc, then you should do for syntax >
+ :hi Comment guifg=Cyan font=another_eng_font,another_your_font
+If you just do >
+ :hi Comment font=another_eng_font
+then you can see a GOOD error message. Be careful!
+
+hangul_font width should be twice than english_font width.
+
+Unsupported Feature
+-------------------
+Johab font not yet supported. And I don't have any plan.
+If you really want to use johab font, you can use the
+hanguldraw.c in gau package.
+
+Hanja input not yet supported. And I don't have any plan.
+If you really want to input hanja, just use VIM with hanterm.
+
+Bug or Comment
+--------------
+Send comments, patches and suggestions to:
+
+ Chi-Deok Hwang <hwang@mizi.co.kr>
+ Nam SungHyun <namsh@lge.com>
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt
new file mode 100644
index 000000000..f595e29e8
--- /dev/null
+++ b/runtime/doc/hebrew.txt
@@ -0,0 +1,145 @@
+*hebrew.txt* For Vim version 7.0aa. Last change: 2003 May 11
+
+
+ VIM REFERENCE MANUAL by Ron Aaron (and Avner Lottem)
+
+
+Hebrew Language support (options & mapping) for Vim *hebrew*
+
+The supporting 'rightleft' functionality was originally created by Avner
+Lottem:
+ E-mail: alottem@iil.intel.com
+ Phone: +972-4-8307322
+
+Ron Aaron <ron@ronware.org> is currently helping support these features.
+
+{Vi does not have any of these commands}
+
+All this is only available when the |+rightleft| feature was enabled at
+compile time.
+
+
+Introduction
+------------
+Hebrew-specific options are 'hkmap', 'hkmapp' 'keymap'=hebrew and 'aleph'.
+Hebrew-useful options are 'delcombine', 'allowrevins', 'revins', 'rightleft'
+and 'rightleftcmd'.
+
+The 'rightleft' mode reverses the display order, so characters are displayed
+from right to left instead of the usual left to right. This is useful
+primarily when editing Hebrew or other Middle-Eastern languages.
+See |rileft.txt| for further details.
+
+Details
+--------------
++ Options:
+ + 'rightleft' ('rl') sets window orientation to right-to-left. This means
+ that the logical text 'ABC' will be displayed as 'CBA', and will start
+ drawing at the right edge of the window, not the left edge.
+ + 'hkmap' ('hk') sets keyboard mapping to Hebrew, in insert/replace modes.
+ + 'aleph' ('al'), numeric, holds the decimal code of Aleph, for keyboard
+ mapping.
+ + 'hkmapp' ('hkp') sets keyboard mapping to 'phonetic hebrew'
+
+ NOTE: these three ('hkmap', 'hkmapp' and 'aleph') are obsolete. You should
+ use ":set keymap=hebrewp" instead.
+
+ + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded Hebrew, allows
+ one to remove the niqud or te`amim by pressing 'x' on a character (with
+ associated niqud).
+
+ + 'rightleftcmd' ('rlc') makes the command-prompt for searches show up on
+ the right side. It only takes effect if the window is 'rightleft'.
+
++ Encoding:
+ + Under Unix, ISO 8859-8 encoding (Hebrew letters codes: 224-250).
+ + Under MS DOS, PC encoding (Hebrew letters codes: 128-154).
+ These are defaults, that can be overridden using the 'aleph' option.
+ + You should prefer using UTF8, as it supports the combining-characters
+ ('deco' does nothing if UTF8 encoding is not active).
+
++ Vim arguments:
+ + 'vim -H file' starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap'
+ are set.
+
++ Keyboard:
+ + The 'allowrevins' option enables the CTRL-_ command in Insert mode and
+ in Command-line mode.
+
+ + CTRL-_ in insert/replace modes toggles 'revins' and 'hkmap' as follows:
+
+ When in rightleft window, 'revins' and 'nohkmap' are toggled, since
+ English will likely be inserted in this case.
+
+ When in norightleft window, 'revins' 'hkmap' are toggled, since Hebrew
+ will likely be inserted in this case.
+
+ CTRL-_ moves the cursor to the end of the typed text.
+
+ + CTRL-_ in command mode only toggles keyboard mapping (see Bugs below).
+ This setting is independent of 'hkmap' option, which only applies to
+ insert/replace mode.
+
+ Note: On some keyboards, CTRL-_ is mapped to CTRL-?.
+
+ + Keyboard mapping while 'hkmap' is set (standard Israeli keyboard):
+
+ q w e r t y u i o p
+ / ' ק ר × ×˜ ו ן × ×¤
+
+ a s d f g h j k l ; '
+ ש ד ג כ ע י ח ל ך ף ,
+
+ z x c v b n m , . /
+ ז ס ב ה נ מ צ ת ץ .
+
+ This is also the keymap when 'keymap=hebrew' is set. The advantage of
+ 'keymap' is that it works properly when using UTF8, e.g. it inserts the
+ correct characters; 'hkmap' does not. The 'keymap' keyboard can also
+ insert niqud and te`amim. To see what those mappings are,look at the
+ keymap file 'hebrew.vim' etc.
+
+
+Typing backwards
+
+If the 'revins' (reverse insert) option is set, inserting happens backwards.
+This can be used to type Hebrew. When inserting characters the cursor is not
+moved and the text moves rightwards. A <BS> deletes the character under the
+cursor. CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
+and CTRL-U do not stop at the start of insert or end of line, no matter how
+the 'backspace' option is set.
+
+There is no reverse replace mode (yet).
+
+If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the
+status line when reverse Insert mode is active.
+
+When the 'allowrevins' option is set, reverse Insert mode can be also entered
+via CTRL-_, which has some extra functionality: First, keyboard mapping is
+changed according to the window orientation -- if in a left-to-right window,
+'revins' is used to enter Hebrew text, so the keyboard changes to Hebrew
+('hkmap' is set); if in a right-to-left window, 'revins' is used to enter
+English text, so the keyboard changes to English ('hkmap' is reset). Second,
+when exiting 'revins' via CTRL-_, the cursor moves to the end of the typed
+text (if possible).
+
+
+Pasting when in a rightleft window
+----------------------------------
+When cutting text with the mouse and pasting it in a rightleft window
+the text will be reversed, because the characters come from the cut buffer
+from the left to the right, while inserted in the file from the right to
+the left. In order to avoid it, toggle 'revins' (by typing CTRL-? or CTRL-_)
+before pasting.
+
+
+Hebrew characters and the 'isprint' variable
+--------------------------------------------
+Sometimes Hebrew character codes are in the non-printable range defined by
+the 'isprint' variable. For example in the Linux console, the Hebrew font
+encoding starts from 128, while the default 'isprint' variable is @,161-255.
+The result is that all Hebrew characters are displayed as ~x. To solve this
+problem, set isprint=@,128-255.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
new file mode 100644
index 000000000..3614e4cdb
--- /dev/null
+++ b/runtime/doc/help.txt
@@ -0,0 +1,197 @@
+*help.txt* For Vim version 7.0aa. Last change: 2004 May 04
+
+ VIM - main help file
+ k
+ Move around: Use the cursor keys, or "h" to go left, h l
+ "j" to go down, "k" to go up, "l" to go right. j
+Close this window: Use ":q<Enter>".
+ Get out of Vim: Use ":qa!<Enter>" (careful, all changes are lost!).
+
+Jump to a subject: Position the cursor on a tag between |bars| and hit CTRL-].
+ With the mouse: ":set mouse=a" to enable the mouse (in xterm or GUI).
+ Double-click the left mouse button on a tag between |bars|.
+ Jump back: Type CTRL-T or CTRL-O (repeat to go further back).
+
+Get specific help: It is possible to go directly to whatever you want help
+ on, by giving an argument to the ":help" command |:help|.
+ It is possible to further specify the context:
+ *help-context*
+ WHAT PREPEND EXAMPLE ~
+ Normal mode commands (nothing) :help x
+ Visual mode commands v_ :help v_u
+ Insert mode commands i_ :help i_<Esc>
+ Command-line commands : :help :quit
+ Command-line editing c_ :help c_<Del>
+ Vim command arguments - :help -r
+ Options ' :help 'textwidth'
+ Search for help: Type ":help word", then hit CTRL-D to see matching
+ help entries for "word".
+
+VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
+through the help of many others. See |credits|.
+------------------------------------------------------------------------------
+ *doc-file-list* *Q_ct*
+BASIC:
+|quickref| Overview of the most common commands you will use
+|tutor| 30 minutes training course for beginners
+|copying| About copyrights
+|iccf| Helping poor children in Uganda
+|sponsor| Sponsor Vim development, become a registered Vim user
+|www| Vim on the World Wide Web
+|bugs| Where to send bug reports
+
+USER MANUAL: These files explain how to accomplish an editing task.
+
+|usr_toc.txt| Table Of Contents
+
+Getting Started ~
+|usr_01.txt| About the manuals
+|usr_02.txt| The first steps in Vim
+|usr_03.txt| Moving around
+|usr_04.txt| Making small changes
+|usr_05.txt| Set your settings
+|usr_06.txt| Using syntax highlighting
+|usr_07.txt| Editing more than one file
+|usr_08.txt| Splitting windows
+|usr_09.txt| Using the GUI
+|usr_10.txt| Making big changes
+|usr_11.txt| Recovering from a crash
+|usr_12.txt| Clever tricks
+
+Editing Effectively ~
+|usr_20.txt| Typing command-line commands quickly
+|usr_21.txt| Go away and come back
+|usr_22.txt| Finding the file to edit
+|usr_23.txt| Editing other files
+|usr_24.txt| Inserting quickly
+|usr_25.txt| Editing formatted text
+|usr_26.txt| Repeating
+|usr_27.txt| Search commands and patterns
+|usr_28.txt| Folding
+|usr_29.txt| Moving through programs
+|usr_30.txt| Editing programs
+|usr_31.txt| Exploiting the GUI
+
+Tuning Vim ~
+|usr_40.txt| Make new commands
+|usr_41.txt| Write a Vim script
+|usr_42.txt| Add new menus
+|usr_43.txt| Using filetypes
+|usr_44.txt| Your own syntax highlighted
+|usr_45.txt| Select your language
+
+Making Vim Run ~
+|usr_90.txt| Installing Vim
+
+
+REFERENCE MANUAL: These files explain every detail of Vim.
+
+General subjects ~
+|intro.txt| general introduction to Vim; notation used in help files
+|help.txt| overview and quick reference (this file)
+|index.txt| alphabetical index of all commands
+|help-tags| all the tags you can jump to (index of tags)
+|howto.txt| how to do the most common editing tasks
+|tips.txt| various tips on using Vim
+|message.txt| (error) messages and explanations
+|quotes.txt| remarks from users of Vim
+|todo.txt| known problems and desired extensions
+|develop.txt| development of Vim
+|uganda.txt| Vim distribution conditions and what to do with your money
+
+Basic editing ~
+|starting.txt| starting Vim, Vim command arguments, initialisation
+|editing.txt| editing and writing files
+|motion.txt| commands for moving around
+|scroll.txt| scrolling the text in the window
+|insert.txt| Insert and Replace mode
+|change.txt| deleting and replacing text
+|indent.txt| automatic indenting for C and other languages
+|undo.txt| Undo and Redo
+|repeat.txt| repeating commands, Vim scripts and debugging
+|visual.txt| using the Visual mode (selecting a text area)
+|various.txt| various remaining commands
+|recover.txt| recovering from a crash
+
+Advanced editing ~
+|cmdline.txt| Command-line editing
+|options.txt| description of all options
+|pattern.txt| regexp patterns and search commands
+|map.txt| key mapping and abbreviations
+|tagsrch.txt| tags and special searches
+|quickfix.txt| commands for a quick edit-compile-fix cycle
+|windows.txt| commands for using multiple windows and buffers
+|syntax.txt| syntax highlighting
+|diff.txt| working with two or three versions of the same file
+|autocmd.txt| automatically executing commands on an event
+|filetype.txt| settings done specifically for a type of file
+|eval.txt| expression evaluation, conditional commands
+|fold.txt| hide (fold) ranges of lines
+
+Special issues ~
+|remote.txt| using Vim as a server or client
+|term.txt| using different terminals and mice
+|digraph.txt| list of available digraphs
+|mbyte.txt| multi-byte text support
+|mlang.txt| non-English language support
+|arabic.txt| Arabic language support and editing
+|farsi.txt| Farsi (Persian) editing
+|hebrew.txt| Hebrew language support and editing
+|russian.txt| Russian language support and editing
+|hangulin.txt| Hangul (Korean) input mode
+|rileft.txt| right-to-left editing mode
+
+GUI ~
+|gui.txt| Graphical User Interface (GUI)
+|gui_w16.txt| Windows 3.1 GUI
+|gui_w32.txt| Win32 GUI
+|gui_x11.txt| X11 GUI
+
+Interfaces ~
+|if_cscop.txt| using cscope with Vim
+|if_perl.txt| Perl interface
+|if_pyth.txt| Python interface
+|if_sniff.txt| SNiFF+ interface
+|if_tcl.txt| Tcl interface
+|if_ole.txt| OLE automation interface for Win32
+|if_ruby.txt| Ruby interface
+|debugger.txt| Interface with a debugger
+|workshop.txt| Sun Visual Workshop interface
+|netbeans.txt| NetBeans External Editor interface
+|sign.txt| debugging signs
+
+Versions ~
+|vi_diff.txt| Main differences between Vim and Vi
+|version4.txt| Differences between Vim version 3.0 and 4.x
+|version5.txt| Differences between Vim version 4.6 and 5.x
+|version6.txt| Differences between Vim version 5.7 and 6.x
+ *sys-file-list*
+Remarks about specific systems ~
+|os_390.txt| OS/390 Unix
+|os_amiga.txt| Amiga
+|os_beos.txt| BeOS and BeBox
+|os_dos.txt| MS-DOS and MS-Windows NT/95 common items
+|os_mac.txt| Macintosh
+|os_mint.txt| Atari MiNT
+|os_msdos.txt| MS-DOS (plain DOS and DOS box under Windows)
+|os_os2.txt| OS/2
+|os_qnx.txt| QNX
+|os_risc.txt| RISC-OS
+|os_unix.txt| Unix
+|os_vms.txt| VMS
+|os_win32.txt| MS-Windows 95/98/NT
+ *standard-plugin-list*
+Standard plugins ~
+|pi_netrw.txt| Reading and writing files over a network
+|pi_gzip.txt| Reading and writing compressed files
+|pi_expl.txt| File explorer
+
+LOCAL ADDITIONS: *local-additions*
+
+------------------------------------------------------------------------------
+*bars* Bars example
+
+Now that you've jumped here with CTRL-] or a double mouse click, you can use
+CTRL-T, CTRL-O, g<RightMouse>, or <C-RightMouse> to go back to where you were.
+------------------------------------------------------------------------------
+ vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
diff --git a/runtime/doc/help.txt.info b/runtime/doc/help.txt.info
new file mode 100755
index 000000000..0f8df8182
--- /dev/null
+++ b/runtime/doc/help.txt.info
Binary files differ
diff --git a/runtime/doc/howto.txt b/runtime/doc/howto.txt
new file mode 100644
index 000000000..aa99190bd
--- /dev/null
+++ b/runtime/doc/howto.txt
@@ -0,0 +1,96 @@
+*howto.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+How to ... *howdoi* *how-do-i* *howto* *how-to*
+
+|tutor| get started
+|:quit| exit? I'm trapped, help me!
+|initialization| initialize Vim
+|vimrc-intro| write a Vim script file (vimrc)
+|suspend| suspend Vim
+|usr_11.txt| recover after a crash
+|07.4| keep a backup of my file when writing over it
+
+|usr_07.txt| edit files
+|23.4| edit binary files
+|usr_24.txt| insert text
+|deleting| delete text
+|usr_04.txt| change text
+|04.5| copy and move text
+|usr_25.txt| format text
+|30.6| format comments
+|30.2| indent C programs
+|25.3| automatically set indent
+
+|usr_26.txt| repeat commands
+|02.5| undo and redo
+
+|usr_03.txt| move around
+|word-motions| word motions
+|left-right-motions| left-right motions
+|up-down-motions| up-down motions
+|object-motions| text-object motions
+|various-motions| various motions
+|object-select| text-object selection
+|'whichwrap'| move over line breaks
+|'virtualedit'| move to where there is no text
+|usr_27.txt| specify pattern for searches
+|tags-and-searches| do tags and special searches
+|29.4| search in include'd files used to find
+ variables, functions, or macros
+|K| look up manual for the keyword under cursor
+
+|03.7| scroll
+|'sidescroll'| scroll horizontally/sideways
+|'scrolloff'| set visible context lines
+
+|mode-switching| change modes
+|04.4| use Visual mode
+|'insertmode'| start Vim in Insert mode
+
+|40.1| map keys
+|24.7| create abbreviations
+
+|ins-expandtab| expand a tab to spaces in Insert mode
+|i_CTRL-R| insert contents of a register in Insert mode
+|24.3| complete words in Insert mode
+|25.1| break a line before it gets too long
+
+|20.1| do command-line editing
+|20.3| do command-line completion
+|'cmdheight'| increase the height of command-line
+|10.3| specify command-line ranges
+|40.3| specify commands to be executed automatically
+ before/after reading/writing entering/leaving a
+ buffer/window
+
+|'autowrite'| write automatically
+|30.1| speedup edit-compile-edit cycle or compile and fix
+ errors within Vim
+
+|options| set options
+|auto-setting| set options automatically
+|term-dependent-settings| set options depending on terminal name
+|save-settings| save settings
+|:quote| comment my exrc/vimrc/gvimrc files
+|'helpheight'| change the default help height
+|'highlight'| set various highlighting modes
+|'title'| set the window title
+|'icon'| set window icon title
+|'report'| avoid seeing the change messages on every line
+|'shortmess'| avoid |hit-enter| prompts
+
+|mouse-using| use mouse with Vim
+|usr_08.txt| manage multiple windows and buffers
+|gui.txt| use the gui
+
+|You can't! (yet)| do dishes using Vim
+
+|usr_06.txt| switch on syntax highlighting
+|2html.vim| convert a colored file to HTML
+|less| use Vim like less or more with syntax highlighting
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt
new file mode 100644
index 000000000..44ff66c1d
--- /dev/null
+++ b/runtime/doc/if_cscop.txt
@@ -0,0 +1,474 @@
+*if_cscop.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+
+ VIM REFERENCE MANUAL by Andy Kahn
+
+ *cscope* *Cscope*
+This document explains how to use Vim's cscope interface.
+
+Cscope is a tool like ctags, but think of it as ctags on steroids since it
+does a lot more than what ctags provides. In Vim, jumping to a result from
+a cscope query is just like jumping to any tag; it is saved on the tag stack
+so that with the right keyboard mappings, you can jump back and forth between
+functions as you normally would with |tags|.
+
+1. Cscope introduction |cscope-intro|
+2. Cscope related commands |cscope-commands|
+3. Cscope options |cscope-options|
+4. How to use cscope in Vim |cscope-howtouse|
+5. Limitations |cscope-limitations|
+6. Suggested usage |cscope-suggestions|
+7. Availability & Information |cscope-info|
+
+This is currently for Unix and Win32 only.
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Cscope introduction *cscope-intro*
+
+The following text is taken from a version of the cscope man page:
+
+ -----
+
+ Cscope is an interactive screen-oriented tool that helps you:
+
+ Learn how a C program works without endless flipping through a thick
+ listing.
+
+ Locate the section of code to change to fix a bug without having to
+ learn the entire program.
+
+ Examine the effect of a proposed change such as adding a value to an
+ enum variable.
+
+ Verify that a change has been made in all source files such as adding
+ an argument to an existing function.
+
+ Rename a global variable in all source files.
+
+ Change a constant to a preprocessor symbol in selected lines of files.
+
+ It is designed to answer questions like:
+ Where is this symbol used?
+ Where is it defined?
+ Where did this variable get its value?
+ What is this global symbol's definition?
+ Where is this function in the source files?
+ What functions call this function?
+ What functions are called by this function?
+ Where does the message "out of space" come from?
+ Where is this source file in the directory structure?
+ What files include this header file?
+
+ Cscope answers these questions from a symbol database that it builds the
+ first time it is used on the source files. On a subsequent call, cscope
+ rebuilds the database only if a source file has changed or the list of
+ source files is different. When the database is rebuilt the data for the
+ unchanged files is copied from the old database, which makes rebuilding
+ much faster than the initial build.
+
+ -----
+
+When cscope is normally invoked, you will get a full-screen selection
+screen allowing you to make a query for one of the above questions.
+However, once a match is found to your query and you have entered your
+text editor to edit the source file containing match, you cannot simply
+jump from tag to tag as you normally would with vi's Ctrl-] or :tag
+command.
+
+Vim's cscope interface is done by invoking cscope with its line-oriented
+interface, and then parsing the output returned from a query. The end
+result is that cscope query results become just like regular tags, so
+you can jump to them just like you do with normal tags (Ctrl-] or :tag)
+and then go back by popping off the tagstack with Ctrl-T. (Please note
+however, that you don't actually jump to a cscope tag simply by doing
+Ctrl-] or :tag without remapping these commands or setting an option.
+See the remaining sections on how the cscope interface works and for
+suggested use.)
+
+
+==============================================================================
+2. Cscope related commands *cscope-commands*
+
+ *:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E561* *E560*
+All cscope commands are accessed through suboptions to the main cscope
+command ":cscope". The shortest abbreviation is ":cs". The ":scscope"
+command does the same and also splits the window (short: "scs").
+
+The available subcommands are:
+
+ *E563* *E564* *E566* *E568* *E569* *E622* *E623*
+ *E625* *E626* *E609*
+ add : Add a new cscope database/connection.
+
+ USAGE :cs add {file|dir} [pre-path] [flags]
+
+ [pre-path] is the pathname used with the -P command to cscope.
+
+ [flags] are any additional flags you want to pass to cscope.
+
+ EXAMPLES >
+ :cscope add /usr/local/cdb/cscope.out
+ :cscope add /projects/vim/cscope.out /usr/local/vim
+ :cscope add cscope.out /usr/local/vim -C
+<
+ *cscope-find* *cs-find*
+ *E565* *E567*
+ find : Query cscope. All cscope query options are available
+ except option #5 ("Change this grep pattern").
+
+ USAGE :cs find {querytype} {name}
+
+ {querytype} corresponds to the actual cscope line
+ interface numbers as well as default nvi commands:
+
+ 0 or s: Find this C symbol
+ 1 or g: Find this definition
+ 2 or d: Find functions called by this function
+ 3 or c: Find functions calling this function
+ 4 or t: Find this text string
+ 6 or e: Find this egrep pattern
+ 7 or f: Find this file
+ 8 or i: Find files #including this file
+
+ EXAMPLES >
+ :cscope find c vim_free
+ :cscope find 3 vim_free
+<
+ These two examples perform the same query. >
+
+ :cscope find 0 DEFAULT_TERM
+<
+ Executing this example on the source code for Vim 5.1 produces the
+ following output:
+
+ Cscope tag: DEFAULT_TERM
+ # line filename / context / line
+ 1 1009 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"amiga"
+ 2 1013 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"win32"
+ 3 1017 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"pcterm"
+ 4 1021 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"ansi"
+ 5 1025 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"vt52"
+ 6 1029 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"os2ansi"
+ 7 1033 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"ansi"
+ 8 1037 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ # undef DEFAULT_TERM
+ 9 1038 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"beos-ansi"
+ 10 1042 vim-5.1-gtk/src/term.c <<GLOBAL>>
+ #define DEFAULT_TERM (char_u *)"mac-ansi"
+ 11 1335 vim-5.1-gtk/src/term.c <<set_termname>>
+ term = DEFAULT_TERM;
+ 12 1459 vim-5.1-gtk/src/term.c <<set_termname>>
+ if (STRCMP(term, DEFAULT_TERM))
+ 13 1826 vim-5.1-gtk/src/term.c <<termcapinit>>
+ term = DEFAULT_TERM;
+ 14 1833 vim-5.1-gtk/src/term.c <<termcapinit>>
+ term = DEFAULT_TERM;
+ 15 3635 vim-5.1-gtk/src/term.c <<update_tcap>>
+ p = find_builtin_term(DEFAULT_TERM);
+ Enter nr of choice (<CR> to abort):
+
+ The output shows several pieces of information:
+ 1. The tag number (there are 15 in this example).
+ 2. The line number where the tag occurs.
+ 3. The filename where the tag occurs.
+ 4. The context of the tag (e.g., global, or the function name).
+ 5. The line from the file itself.
+
+ help : Show a brief synopsis.
+
+ USAGE :cs help
+
+ *E260* *E261*
+ kill : Kill a cscope connection (or kill all cscope connections).
+
+ USAGE :cs kill {num|partial_name}
+
+ To kill a cscope connection, the connection number or a partial
+ name must be specified. The partial name is simply any part of
+ the pathname of the cscope database. Kill a cscope connection
+ using the partial name with caution!
+
+ If the specified connection number is -1, then _ALL_ cscope
+ connections will be killed.
+
+ reset : Reinit all cscope connections.
+
+ USAGE :cs reset
+
+ show : Show cscope connections.
+
+ USAGE :cs show
+
+ *:cstag* *E257* *E562*
+If you use cscope as well as ctags, |:cstag| allows you to search one or
+the other before making a jump. For example, you can choose to first
+search your cscope database(s) for a match, and if one is not found, then
+your tags file(s) will be searched. The order in which this happens
+is determined by the value of |csto|. See |cscope-options| for more
+details.
+
+|:cstag| performs the equivalent of ":cs find g" on the identifier when
+searching through the cscope database(s).
+
+|:cstag| performs the equivalent of |:tjump| on the identifier when searching
+through your tags file(s).
+
+
+==============================================================================
+3. Cscope options *cscope-options*
+
+Use the |:set| command to set all cscope options. Ideally, you would do
+this in one of your startup files (e.g., .vimrc). Some cscope related
+variables are only valid within |.vimrc|. Setting them after vim has
+started will have no effect!
+
+ *cscopeprg* *csprg*
+'cscopeprg' specifies the command to execute cscope. The default is
+"cscope". For example: >
+ :set csprg=/usr/local/bin/cscope
+<
+ *cscopequickfix* *csqf* *E469*
+{not available when compiled without the |+quickfix| feature}
+'cscopequickfix' specifies whether to use quickfix window to show cscope
+results. This is a list of comma-separated values. Each item consists of
+|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
+'+' indicates that results must be appended to quickfix window,
+'-' implies previous results clearance, '0' or command absence - don't use
+quickfix. Search is performed from start until first command occurrence.
+The default value is "" (don't use quickfix anyway). The following value
+seems to be useful: "s-,c-,d-,i-,t-,e-".
+
+ *cscopetag* *cst*
+If 'cscopetag' set, the commands ":tag" and CTRL-] as well as "vim -t" will
+always use |:cstag| instead of the default :tag behavior. Effectively, by
+setting 'cst', you will always search your cscope databases as well as your
+tag files. The default is off. Examples: >
+ :set cst
+ :set nocst
+<
+ *cscopetagorder* *csto*
+The value of 'csto' determines the order in which |:cstag| performs a search.
+If 'csto' is set to zero, cscope database(s) are searched first, followed
+by tag file(s) if cscope did not return any matches. If 'csto' is set to
+one, tag file(s) are searched before cscope database(s). The default is zero.
+Examples: >
+ :set csto=0
+ :set csto=1
+<
+ *cscopeverbose* *csverb*
+If 'cscopeverbose' is not set (the default), messages will not be printed
+indicating success or failure when adding a cscope database. Ideally, you
+should reset this option in your |.vimrc| before adding any cscope databases,
+and after adding them, set it. From then on, when you add more databases
+within Vim, you will get a (hopefully) useful message should the database fail
+to be added. Examples: >
+ :set csverb
+ :set nocsverb
+<
+ *cscopepathcomp* *cspc*
+The value of 'cspc' determines how many components of a file's path to
+display. With the default value of zero the entire path will be displayed.
+The value one will display only the filename with no path. Other values
+display that many components. For example: >
+ :set cspc=3
+will display the last 3 components of the file's path, including the file
+name itself.
+
+==============================================================================
+4. How to use cscope in Vim *cscope-howtouse*
+
+The first thing you need to do is to build a cscope database for your
+source files. For the most basic case, simply do "cscope -b". Please
+refer to the cscope man page for more details.
+
+Assuming you have a cscope database, you need to "add" the database to Vim.
+This establishes a cscope "connection" and makes it available for Vim to use.
+You can do this in your .vimrc file, or you can do it manually after starting
+vim. For example, to add the cscope database "cscope.out", you would do:
+
+ :cs add cscope.out
+
+You can double-check the result of this by executing ":cs show". This will
+produce output which looks like this:
+
+ # pid database name prepend path
+ 0 28806 cscope.out <none>
+
+Note:
+Because of the Microsoft RTL limitations, Win32 version shows 0 instead
+of the real pid.
+
+Once a cscope connection is established, you can make queries to cscope and
+the results will be printed to you. Queries are made using the command
+":cs find". For example:
+
+ :cs find g ALIGN_SIZE
+
+This can get a little cumbersome since one ends up doing a significant
+amount of typing. Fortunately, there are ways around this by mapping
+shortcut keys. See |cscope-suggestions| for suggested usage.
+
+If the results return only one match, you will automatically be taken to it.
+If there is more than one match, you will be given a selection screen to pick
+the match you want to go to. After you have jumped to the new location,
+simply hit Ctrl-T to get back to the previous one.
+
+
+==============================================================================
+5. Limitations *cscope-limitations*
+
+Cscope support for Vim is only available on systems that support these four
+system calls: fork(), pipe(), execl(), waitpid(). This means it is mostly
+limited to Unix systems.
+
+Additionally Cscope support works for Win32. For more information and a
+cscope version for Win32 see:
+
+ http://iamphet.nm.ru/cscope/index.html
+
+There are a couple of hard-coded limitations:
+
+ 1. The maximum number of cscope connections allowed is 8. Do you
+ really need more?
+
+ 2. Doing a |:tjump| when |:cstag| searches the tag files is not
+ configurable (e.g., you can't do a tselect instead).
+
+==============================================================================
+6. Suggested usage *cscope-suggestions*
+
+Put these entries in your .vimrc (adjust the pathname accordingly to your
+setup): >
+
+ if has("cscope")
+ set csprg=/usr/local/bin/cscope
+ set csto=0
+ set cst
+ set nocsverb
+ " add any database in current directory
+ if filereadable("cscope.out")
+ cs add cscope.out
+ " else add database pointed to by environment
+ elseif $CSCOPE_DB != ""
+ cs add $CSCOPE_DB
+ endif
+ set csverb
+ endif
+
+By setting 'cscopetag', we have effectively replaced all instances of the :tag
+command with :cstag. This includes :tag, Ctrl-], and "vim -t". In doing
+this, the regular tag command not only searches your ctags generated tag
+files, but your cscope databases as well.
+
+Some users may want to keep the regular tag behavior and have a different
+shortcut to access :cstag. For example, one could map Ctrl-_ (underscore)
+to :cstag with the following command: >
+
+ map <C-_> :cstag <C-R>=expand("<cword>")<CR><CR>
+
+A couple of very commonly used cscope queries (using ":cs find") is to
+find all functions calling a certain function and to find all occurrences
+of a particular C symbol. To do this, you can use these mappings as an
+example: >
+
+ map g<C-]> :cs find 3 <C-R>=expand("<cword>")<CR><CR>
+ map g<C-\> :cs find 0 <C-R>=expand("<cword>")<CR><CR>
+
+These mappings for Ctrl-] (right bracket) and Ctrl-\ (backslash) allow you to
+place your cursor over the function name or C symbol and quickly query cscope
+for any matches.
+
+Or you may use the following scheme, inspired by Vim/Cscope tutorial from
+Cscope Home Page (http://cscope.sourceforge.net/): >
+
+ nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
+
+ " Using 'CTRL-spacebar' then a search type makes the vim window
+ " split horizontally, with search result displayed in
+ " the new window.
+
+ nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
+
+ " Hitting CTRL-space *twice* before the search type does a vertical
+ " split instead of a horizontal one
+
+ nmap <C-Space><C-Space>s
+ \:vert scs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space><C-Space>g
+ \:vert scs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space><C-Space>c
+ \:vert scs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space><C-Space>t
+ \:vert scs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space><C-Space>e
+ \:vert scs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-Space><C-Space>i
+ \:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-Space><C-Space>d
+ \:vert scs find d <C-R>=expand("<cword>")<CR><CR>
+
+==============================================================================
+7. Cscope availability and information *cscope-info*
+
+If you do not already have cscope (it did not come with your compiler
+license or OS distribution), then you can download it for free from:
+ http://cscope.sourceforge.net/
+This is released by SCO under the BSD license.
+
+If you want a newer version of cscope, you will probably have to buy it.
+According to the (old) nvi documentation:
+
+ You can buy version 13.3 source with an unrestricted license
+ for $400 from AT&T Software Solutions by calling +1-800-462-8146.
+
+Also you can download cscope 13.x and mlcscope 14.x (multi-lingual cscope
+which supports C, C++, Java, lex, yacc, breakpoint listing, Ingres, and SDL)
+from World-Wide Exptools Open Source packages page:
+ http://www.bell-labs.com/project/wwexptools/packages.html
+
+In Solaris 2.x, if you have the C compiler license, you will also have
+cscope. Both are usually located under /opt/SUNWspro/bin
+
+SGI developers can also get it. Search for Cscope on this page:
+ http://freeware.sgi.com/index-by-alpha.html
+ https://toolbox.sgi.com/toolbox/utilities/cscope/
+The second one is for those who have a password for the SGI toolbox.
+
+There is source to an older version of a cscope clone (called "cs") available
+on the net. Due to various reasons, this is not supported with Vim.
+
+The cscope interface/support for Vim was originally written by
+Andy Kahn <ackahn@netapp.com>. The original structure (as well as a tiny
+bit of code) was adapted from the cscope interface in nvi. Please report
+any problems, suggestions, patches, et al., you have for the usage of
+cscope within Vim to him.
+ *cscope-win32*
+For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
+
+Win32 support was added by Sergey Khorev <khorev@softlab.ru>. Contact him
+if you have Win32-specific issues.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt
new file mode 100644
index 000000000..9ced34eca
--- /dev/null
+++ b/runtime/doc/if_ole.txt
@@ -0,0 +1,162 @@
+*if_ole.txt* For Vim version 7.0aa. Last change: 2003 Jun 19
+
+
+ VIM REFERENCE MANUAL by Paul Moore
+
+
+The OLE Interface to Vim *ole-interface*
+
+1. Activation |ole-activation|
+2. Methods |ole-methods|
+3. The "normal" command |ole-normal|
+4. Registration |ole-registration|
+5. MS Visual Studio integration |MSVisualStudio|
+
+{Vi does not have any of these commands}
+
+OLE is only available when compiled with the |+ole| feature. See
+src/if_ole.INSTALL.
+An alternative is using the client-server communication |clientserver|.
+
+==============================================================================
+1. Activation *ole-activation*
+
+Vim acts as an OLE automation server, accessible from any automation client,
+for example, Visual Basic, Python, or Perl. The Vim application "name" (its
+"ProgID", in OLE terminology) is "Vim.Application".
+
+Hence, in order to start a Vim instance (or connect to an already running
+instance), code similar to the following should be used:
+
+[Visual Basic] >
+ Dim Vim As Object
+ Set Vim = CreateObject("Vim.Application")
+
+[Python] >
+ from win32com.client.dynamic import Dispatch
+ vim = Dispatch('Vim.Application')
+
+[Perl] >
+ use Win32::OLE;
+ $vim = new Win32::OLE 'Vim.Application';
+
+Vim does not support acting as a "hidden" OLE server, like some other OLE
+Automation servers. When a client starts up an instance of Vim, that instance
+is immediately visible. Simply closing the OLE connection to the Vim instance
+is not enough to shut down the Vim instance - it is necessary to explicitly
+execute a quit command (for example, :qa!, :wqa).
+
+==============================================================================
+2. Methods *ole-methods*
+
+Vim exposes four methods for use by clients.
+
+ *ole-sendkeys*
+SendKeys(keys) Execute a series of keys.
+
+This method takes a single parameter, which is a string of keystrokes. These
+keystrokes are executed exactly as if they had been types in at the keyboard.
+Special keys can be given using their <..> names, as for the right hand side
+of a mapping. Note: Execution of the Ex "normal" command is not supported -
+see below |ole-normal|.
+
+Examples (Visual Basic syntax) >
+ Vim.SendKeys "ihello<Esc>"
+ Vim.SendKeys "ma1GV4jy`a"
+
+These examples assume that Vim starts in Normal mode. To force Normal mode,
+start the key sequence with CTRL-\ CTRL-N as in >
+
+ Vim.SendKeys "<C-\><C-N>ihello<Esc>"
+
+CTRL-\ CTRL-N returns Vim to Normal mode, when in Insert or Command-line mode.
+Note that this doesn't work halfway a Vim command
+
+ *ole-eval*
+Eval(expr) Evaluate an expression.
+
+This method takes a single parameter, which is an expression in Vim's normal
+format (see |expression|). It returns a string, which is the result of
+evaluating the expression.
+
+Examples (Visual Basic syntax) >
+ Line20 = Vim.Eval("getline(20)")
+ Twelve = Vim.Eval("6 + 6") ' Note this is a STRING
+ Font = Vim.Eval("&guifont")
+<
+ *ole-setforeground*
+SetForeground() Make the Vim window come to the foreground
+
+This method takes no arguments. No value is returned.
+
+Example (Visual Basic syntax) >
+ Vim.SetForeground
+<
+
+ *ole-gethwnd*
+GetHwnd() Return the handle of the Vim window.
+
+This method takes no arguments. It returns the hwnd of the main Vimwindow.
+You can use this if you are writing something which needs to manipulate the
+Vim window, or to track it in the z-order, etc.
+
+Example (Visual Basic syntax) >
+ Vim_Hwnd = Vim.GetHwnd
+<
+
+==============================================================================
+3. The "normal" command *ole-normal*
+
+Due to the way Vim processes OLE Automation commands, combined with the method
+of implementation of the ex command :normal, it is not possible to execute the
+:normal command via OLE automation. Any attempt to do so will fail, probably
+harmlessly, although possibly in unpredictable ways.
+
+There is currently no practical way to trap this situation, and users must
+simply be aware of the limitation.
+==============================================================================
+4. Registration *ole-registration* *E243*
+
+Before Vim will act as an OLE server, it must be registered in the system
+registry. In order to do this, Vim should be run with a single parameter of
+"-register".
+ *-register* >
+ gvim -register
+
+If gvim with OLE support is run and notices that no Vim OLE server has been
+registered, it will present a dialog and offers you the choice to register by
+clicking "Yes".
+
+In some situations registering is not possible. This happens when the
+registry is not writable. If you run into this problem you need to run gvim
+as "Administrator".
+
+Once vim is registered, the application path is stored in the registry. Before
+moving, deleting, or upgrading Vim, the registry entries should be removed
+using the "-unregister" switch.
+ *-unregister* >
+ gvim -unregister
+
+The OLE mechanism will use the first registered Vim it finds. If a Vim is
+already running, this one will be used. If you want to have (several) Vim
+sessions open that should not react to OLE commands, use the non-OLE version,
+and put it in a different directory. The OLE version should then be put in a
+directory that is not in your normal path, so that typing "gvim" will start
+the non-OLE version.
+
+ *-silent*
+To avoid the message box that pops up to report the result, prepend "-silent":
+>
+ gvim -silent -register
+ gvim -silent -unregister
+
+==============================================================================
+5. MS Visual Studio integration *MSVisualStudio* *VisVim*
+
+The OLE version can be used to run Vim as the editor in Microsoft Visual
+Studio. This is called "VisVim". It is included in the archive that contains
+the OLE version. The documentation can be found in the runtime directory, the
+README_VisVim.txt file.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_perl.txt b/runtime/doc/if_perl.txt
new file mode 100644
index 000000000..882cd6a85
--- /dev/null
+++ b/runtime/doc/if_perl.txt
@@ -0,0 +1,258 @@
+*if_perl.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Sven Verdoolaege
+ and Matt Gerassimof
+
+Perl and Vim *perl* *Perl*
+
+1. Editing Perl files |perl-editing|
+2. Compiling VIM with Perl interface |perl-compiling|
+3. Using the Perl interface |perl-using|
+
+{Vi does not have any of these commands}
+
+The Perl interface only works when Vim was compiled with the |+perl| feature.
+
+==============================================================================
+1. Editing Perl files *perl-editing*
+
+Vim syntax highlighting supports Perl and POD files. Vim assumes a file is
+Perl code if the filename has a .pl or .pm suffix. Vim also examines the first
+line of a file, regardless of the filename suffix, to check if a file is a
+Perl script (see scripts.vim in Vim's syntax directory). Vim assumes a file
+is POD text if the filename has a .POD suffix.
+
+To use tags with Perl, you need a recent version of Exuberant ctags. Look
+here:
+ http://ctags.sourceforge.net
+
+Alternatively, you can use the Perl script pltags.pl, which is shipped with
+Vim in the $VIMRUNTIME/tools directory. This script has currently more
+features than Exuberant ctags' Perl support.
+
+==============================================================================
+2. Compiling VIM with Perl interface *perl-compiling*
+
+To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must
+be installed before you compile Vim. Vim's Perl interface does NOT work with
+the 5.003 version that has been officially released! It will probably work
+with Perl 5.003_05 and later.
+
+The Perl patches for Vim were made by:
+ Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
+ Matt Gerassimof
+
+Perl for MS-Windows can be found at:
+http://www.perl.com/CPAN/ports/nt/Standard/x86/
+
+==============================================================================
+3. Using the Perl interface *perl-using*
+
+ *:perl* *:pe*
+:pe[rl] {cmd} Execute Perl command {cmd}. The current package
+ is "main".
+
+:pe[rl] << {endpattern}
+{script}
+{endpattern}
+ Execute Perl script {script}.
+ {endpattern} must NOT be preceded by any white space.
+ If {endpattern} is omitted, it defaults to a dot '.'
+ like for the |:append| and |:insert| commands. Using
+ '.' helps when inside a function, because "$i;" looks
+ like the start of an |:insert| command to Vim.
+ This form of the |:perl| command is mainly useful for
+ including perl code in vim scripts.
+ Note: This command doesn't work when the Perl feature
+ wasn't compiled in. To avoid errors, see
+ |script-here|.
+
+
+Example vim script: >
+
+ function! WhitePearl()
+ perl << EOF
+ VIM::Msg("pearls are nice for necklaces");
+ VIM::Msg("rubys for rings");
+ VIM::Msg("pythons for bags");
+ VIM::Msg("tcls????");
+ EOF
+ endfunction
+<
+
+ *:perldo* *:perld*
+:[range]perld[o] {cmd} Execute Perl command {cmd} for each line in the
+ [range], with $_ being set to the text of each line in
+ turn, without a trailing <EOL>. Setting $_ will change
+ the text, but note that it is not possible to add or
+ delete lines using this command.
+ The default for [range] is the whole file: "1,$".
+
+Here are some things you can try: >
+
+ :perl $a=1
+ :perldo $_ = reverse($_);1
+ :perl VIM::Msg("hello")
+ :perl $line = $curbuf->Get(42)
+<
+ *E299*
+Executing Perl commands in the |sandbox| is limited. ":perldo" will not be
+possible at all. ":perl" will be evaluated in the Safe environment, if
+possible.
+
+
+ *perl-overview*
+Here is an overview of the functions that are available to Perl: >
+
+ :perl VIM::Msg("Text") # displays a message
+ :perl VIM::Msg("Error", "ErrorMsg") # displays an error message
+ :perl VIM::Msg("remark", "Comment") # displays a highlighted message
+ :perl VIM::SetOption("ai") # sets a vim option
+ :perl $nbuf = VIM::Buffers() # returns the number of buffers
+ :perl @buflist = VIM::Buffers() # returns array of all buffers
+ :perl $mybuf = (VIM::Buffers('qq.c'))[0] # returns buffer object for 'qq.c'
+ :perl @winlist = VIM::Windows() # returns array of all windows
+ :perl $nwin = VIM::Windows() # returns the number of windows
+ :perl ($success, $v) = VIM::Eval('&path') # $v: option 'path', $success: 1
+ :perl ($success, $v) = VIM::Eval('&xyz') # $v: '' and $success: 0
+ :perl $v = VIM::Eval('expand("<cfile>")') # expands <cfile>
+ :perl $curwin->SetHeight(10) # sets the window height
+ :perl @pos = $curwin->Cursor() # returns (row, col) array
+ :perl @pos = (10, 10)
+ :perl $curwin->Cursor(@pos) # sets cursor to @pos
+ :perl $curwin->Cursor(10,10) # sets cursor to row 10 col 10
+ :perl $mybuf = $curwin->Buffer() # returns the buffer object for window
+ :perl $curbuf->Name() # returns buffer name
+ :perl $curbuf->Number() # returns buffer number
+ :perl $curbuf->Count() # returns the number of lines
+ :perl $l = $curbuf->Get(10) # returns line 10
+ :perl @l = $curbuf->Get(1 .. 5) # returns lines 1 through 5
+ :perl $curbuf->Delete(10) # deletes line 10
+ :perl $curbuf->Delete(10, 20) # delete lines 10 through 20
+ :perl $curbuf->Append(10, "Line") # appends a line
+ :perl $curbuf->Append(10, "Line1", "Line2", "Line3") # appends 3 lines
+ :perl @l = ("L1", "L2", "L3")
+ :perl $curbuf->Append(10, @l) # appends L1, L2 and L3
+ :perl $curbuf->Set(10, "Line") # replaces line 10
+ :perl $curbuf->Set(10, "Line1", "Line2") # replaces lines 10 and 11
+ :perl $curbuf->Set(10, @l) # replaces 3 lines
+<
+ *perl-Msg*
+VIM::Msg({msg}, {group}?)
+ Displays the message {msg}. The optional {group}
+ argument specifies a highlight group for Vim to use
+ for the message.
+
+ *perl-SetOption*
+VIM::SetOption({arg}) Sets a vim option. {arg} can be any argument that the
+ ":set" command accepts. Note that this means that no
+ spaces are allowed in the argument! See |:set|.
+
+ *perl-Buffers*
+VIM::Buffers([{bn}...]) With no arguments, returns a list of all the buffers
+ in an array context or returns the number of buffers
+ in a scalar context. For a list of buffer names or
+ numbers {bn}, returns a list of the buffers matching
+ {bn}, using the same rules as Vim's internal
+ |bufname()| function.
+
+ *perl-Windows*
+VIM::Windows([{wn}...]) With no arguments, returns a list of all the windows
+ in an array context or returns the number of windows
+ in a scalar context. For a list of window numbers
+ {wn}, returns a list of the windows with those
+ numbers.
+
+ *perl-DoCommand*
+VIM::DoCommand({cmd}) Executes Ex command {cmd}.
+
+ *perl-Eval*
+VIM::Eval({expr}) Evaluates {expr} and returns (success, val).
+ success=1 indicates that val contains the value of
+ {expr}; success=0 indicates a failure to evaluate
+ the expression. '@x' returns the contents of register
+ x, '&x' returns the value of option x, 'x' returns the
+ value of internal |variables| x, and '$x' is equivalent
+ to perl's $ENV{x}. All |functions| accessible from
+ the command-line are valid for {expr}.
+
+ *perl-SetHeight*
+Window->SetHeight({height})
+ Sets the Window height to {height}, within screen
+ limits.
+
+ *perl-GetCursor*
+Window->Cursor({row}?, {col}?)
+ With no arguments, returns a (row, col) array for the
+ current cursor position in the Window. With {row} and
+ {col} arguments, sets the Window's cursor position to
+ {row} and {col}. Note that {col} is numbered from 0,
+ Perl-fashion, and thus is one less than the value in
+ Vim's ruler.
+
+Window->Buffer() *perl-Buffer*
+ Returns the Buffer object corresponding to the given
+ Window.
+
+ *perl-Name*
+Buffer->Name() Returns the filename for the Buffer.
+
+ *perl-Number*
+Buffer->Number() Returns the number of the Buffer.
+
+ *perl-Count*
+Buffer->Count() Returns the number of lines in the Buffer.
+
+ *perl-Get*
+Buffer->Get({lnum}, {lnum}?, ...)
+ Returns a text string of line {lnum} in the Buffer
+ for each {lnum} specified. An array can be passed
+ with a list of {lnum}'s specified.
+
+ *perl-Delete*
+Buffer->Delete({lnum}, {lnum}?)
+ Deletes line {lnum} in the Buffer. With the second
+ {lnum}, deletes the range of lines from the first
+ {lnum} to the second {lnum}.
+
+ *perl-Append*
+Buffer->Append({lnum}, {line}, {line}?, ...)
+ Appends each {line} string after Buffer line {lnum}.
+ The list of {line}s can be an array.
+
+ *perl-Set*
+Buffer->Set({lnum}, {line}, {line}?, ...)
+ Replaces one or more Buffer lines with specified
+ {lines}s, starting at Buffer line {lnum}. The list of
+ {line}s can be an array. If the arguments are
+ invalid, replacement does not occur.
+
+$main::curwin
+ The current window object.
+
+$main::curbuf
+ The current buffer object.
+
+
+ *script-here*
+When using a script language in-line, you might want to skip this when the
+language isn't supported. But this mechanism doesn't work: >
+ if has('perl')
+ perl << EOF
+ this will NOT work!
+ EOF
+ endif
+Instead, put the Perl/Python/Ruby/etc. command in a function and call that
+function: >
+ if has('perl')
+ function DefPerl()
+ perl << EOF
+ this works
+ EOF
+ endfunction
+ call DefPerl()
+ endif
+Note that "EOF" must be at the start of the line.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt
new file mode 100644
index 000000000..df75fcf56
--- /dev/null
+++ b/runtime/doc/if_pyth.txt
@@ -0,0 +1,299 @@
+*if_pyth.txt* For Vim version 7.0aa. Last change: 2004 Feb 28
+
+
+ VIM REFERENCE MANUAL by Paul Moore
+
+
+The Python Interface to Vim *python* *Python*
+
+1. Commands |python-commands|
+2. The vim module |python-vim|
+3. Buffer objects |python-buffer|
+4. Range objects |python-range|
+5. Window objects |python-window|
+
+{Vi does not have any of these commands}
+
+The Python interface is available only when Vim was compiled with the
+|+python| feature.
+
+==============================================================================
+1. Commands *python-commands*
+
+ *:python* *:py* *E205* *E263* *E264*
+:[range]py[thon] {stmt}
+ Execute Python statement {stmt}.
+
+:[range]py[thon] << {endmarker}
+{script}
+{endmarker}
+ Execute Python script {script}.
+ Note: This command doesn't work when the Python
+ feature wasn't compiled in. To avoid errors, see
+ |script-here|.
+
+{endmarker} must NOT be preceded by any white space. If {endmarker} is
+omitted from after the "<<", a dot '.' must be used after {script}, like
+for the |:append| and |:insert| commands.
+This form of the |:python| command is mainly useful for including python code
+in Vim scripts.
+
+Example: >
+ function! IcecreamInitialize()
+ python << EOF
+ class StrawberryIcecream:
+ def __call__(self):
+ print 'EAT ME'
+ EOF
+ endfunction
+<
+Note: Python is very sensitive to the indenting. Also make sure the "class"
+line and "EOF" do not have any indent.
+
+ *:pyfile* *:pyf*
+:[range]pyf[ile] {file}
+ Execute the Python script in {file}. The whole
+ argument is used as a single file name. {not in Vi}
+
+Both of these commands do essentially the same thing - they execute a piece of
+Python code, with the "current range" |python-range| set to the given line
+range.
+
+In the case of :python, the code to execute is in the command-line.
+In the case of :pyfile, the code to execute is the contents of the given file.
+
+Python commands cannot be used in the |sandbox|.
+
+To pass arguments you need to set sys.argv[] explicitly. Example: >
+
+ :python import sys
+ :python sys.argv = ["foo", "bar"]
+ :pyfile myscript.py
+
+Here are some examples *python-examples* >
+
+ :python from vim import *
+ :python from string import upper
+ :python current.line = upper(current.line)
+ :python print "Hello"
+ :python str = current.buffer[42]
+
+(Note that changes - like the imports - persist from one command to the next,
+just like in the Python interpreter.)
+
+==============================================================================
+2. The vim module *python-vim*
+
+Python code gets all of its access to vim (with one exception - see
+|python-output| below) via the "vim" module. The vim module implements two
+methods, three constants, and one error object. You need to import the vim
+module before using it: >
+ :python import vim
+
+Overview >
+ print "Hello" # displays a message
+ vim.command(cmd) # execute an ex command
+ w = vim.windows[n] # gets window "n"
+ cw = vim.current.window # gets the current window
+ b = vim.buffers[n] # gets buffer "n"
+ cb = vim.current.buffer # gets the current buffer
+ w.height = lines # sets the window height
+ w.cursor = (row, col) # sets the window cursor position
+ pos = w.cursor # gets a tuple (row, col)
+ name = b.name # gets the buffer file name
+ line = b[n] # gets a line from the buffer
+ lines = b[n:m] # gets a list of lines
+ num = len(b) # gets the number of lines
+ b[n] = str # sets a line in the buffer
+ b[n:m] = [str1, str2, str3] # sets a number of lines at once
+ del b[n] # deletes a line
+ del b[n:m] # deletes a number of lines
+
+
+Methods of the "vim" module
+
+vim.command(str) *python-command*
+ Executes the vim (ex-mode) command str. Returns None.
+ Examples: >
+ vim.command("set tw=72")
+ vim.command("%s/aaa/bbb/g")
+< The following definition executes Normal mode commands: >
+ def normal(str):
+ vim.command("normal "+str)
+ # Note the use of single quotes to delimit a string containing
+ # double quotes
+ normal('"a2dd"aP')
+< *E659*
+ The ":python" command cannot be used recursively with Python 2.2 and
+ older. This only works with Python 2.3 and later: >
+ :python vim.command("python print 'Hello again Python'")
+
+vim.eval(str) *python-eval*
+ Evaluates the expression str using the vim internal expression
+ evaluator (see |expression|). Returns the expression result as a
+ string.
+ Examples: >
+ text_width = vim.eval("&tw")
+ str = vim.eval("12+12") # NB result is a string! Use
+ # string.atoi() to convert to
+ # a number.
+
+Error object of the "vim" module
+
+vim.error *python-error*
+ Upon encountering a Vim error, Python raises an exception of type
+ vim.error.
+ Example: >
+ try:
+ vim.command("put a")
+ except vim.error:
+ # nothing in register a
+
+Constants of the "vim" module
+
+ Note that these are not actually constants - you could reassign them.
+ But this is silly, as you would then lose access to the vim objects
+ to which the variables referred.
+
+vim.buffers *python-buffers*
+ A sequence object providing access to the list of vim buffers. The
+ object supports the following operations: >
+ b = vim.buffers[i] # Indexing (read-only)
+ b in vim.buffers # Membership test
+ n = len(vim.buffers) # Number of elements
+ for b in vim.buffers: # Sequential access
+<
+vim.windows *python-windows*
+ A sequence object providing access to the list of vim windows. The
+ object supports the following operations: >
+ w = vim.windows[i] # Indexing (read-only)
+ w in vim.windows # Membership test
+ n = len(vim.windows) # Number of elements
+ for w in vim.windows: # Sequential access
+<
+vim.current *python-current*
+ An object providing access (via specific attributes) to various
+ "current" objects available in vim:
+ vim.current.line The current line (RW) String
+ vim.current.buffer The current buffer (RO) Buffer
+ vim.current.window The current window (RO) Window
+ vim.current.range The current line range (RO) Range
+
+ The last case deserves a little explanation. When the :python or
+ :pyfile command specifies a range, this range of lines becomes the
+ "current range". A range is a bit like a buffer, but with all access
+ restricted to a subset of lines. See |python-range| for more details.
+
+
+Output from Python *python-output*
+ Vim displays all Python code output in the Vim message area. Normal
+ output appears as information messages, and error output appears as
+ error messages.
+
+ In implementation terms, this means that all output to sys.stdout
+ (including the output from print statements) appears as information
+ messages, and all output to sys.stderr (including error tracebacks)
+ appears as error messages.
+
+ *python-input*
+ Input (via sys.stdin, including input() and raw_input()) is not
+ supported, and may cause the program to crash. This should probably be
+ fixed.
+
+==============================================================================
+3. Buffer objects *python-buffer*
+
+Buffer objects represent vim buffers. You can obtain them in a number of ways:
+ - via vim.current.buffer (|python-current|)
+ - from indexing vim.buffers (|python-buffers|)
+ - from the "buffer" attribute of a window (|python-window|)
+
+Buffer objects have one read-only attribute - name - the full file name for
+the buffer. They also have three methods (append, mark, and range; see below).
+
+You can also treat buffer objects as sequence objects. In this context, they
+act as if they were lists (yes, they are mutable) of strings, with each
+element being a line of the buffer. All of the usual sequence operations,
+including indexing, index assignment, slicing and slice assignment, work as
+you would expect. Note that the result of indexing (slicing) a buffer is a
+string (list of strings). This has one unusual consequence - b[:] is different
+from b. In particular, "b[:] = None" deletes the whole of the buffer, whereas
+"b = None" merely updates the variable b, with no effect on the buffer.
+
+Buffer indexes start at zero, as is normal in Python. This differs from vim
+line numbers, which start from 1. This is particularly relevant when dealing
+with marks (see below) which use vim line numbers.
+
+The buffer object methods are:
+ b.append(str) Append a line to the buffer
+ b.append(list) Append a list of lines to the buffer
+ Note that the option of supplying a list of strings to
+ the append method differs from the equivalent method
+ for Python's built-in list objects.
+ b.mark(name) Return a tuple (row,col) representing the position
+ of the named mark (can also get the []"<> marks)
+ b.range(s,e) Return a range object (see |python-range|) which
+ represents the part of the given buffer between line
+ numbers s and e |inclusive|.
+
+Examples (assume b is the current buffer) >
+ print b.name # write the buffer file name
+ b[0] = "hello!!!" # replace the top line
+ b[:] = None # delete the whole buffer
+ del b[:] # delete the whole buffer (same as above)
+ b[0:0] = [ "a line" ] # add a line at the top
+ del b[2] # delete a line (the third)
+ b.append("bottom") # add a line at the bottom
+ n = len(b) # number of lines
+ (row,col) = b.mark('a') # named mark
+ r = b.range(1,5) # a sub-range of the buffer
+
+==============================================================================
+4. Range objects *python-range*
+
+Range objects represent a part of a vim buffer. You can obtain them in a
+number of ways:
+ - via vim.current.range (|python-current|)
+ - from a buffer's range() method (|python-buffer|)
+
+A range object is almost identical in operation to a buffer object. However,
+all operations are restricted to the lines within the range (this line range
+can, of course, change as a result of slice assignments, line deletions, or
+the range.append() method).
+
+The range object attributes are:
+ r.start Index of first line into the buffer
+ r.end Index of last line into the buffer
+
+The range object methods are:
+ r.append(str) Append a line to the range
+ r.append(list) Append a list of lines to the range
+ Note that the option of supplying a list of strings to
+ the append method differs from the equivalent method
+ for Python's built-in list objects.
+
+Example (assume r is the current range):
+ # Send all lines in a range to the default printer
+ vim.command("%d,%dhardcopy!" % (r.start+1,r.end+1))
+
+==============================================================================
+5. Window objects *python-window*
+
+Window objects represent vim windows. You can obtain them in a number of ways:
+ - via vim.current.window (|python-current|)
+ - from indexing vim.windows (|python-windows|)
+
+You can manipulate window objects only through their attributes. They have no
+methods, and no sequence or other interface.
+
+Window attributes are:
+ buffer (read-only) The buffer displayed in this window
+ cursor (read-write) The current cursor position in the window
+ This is a tuple, (row,col).
+ height (read-write) The window height, in rows
+ width (read-write) The window width, in columns
+The height attribute is writable only if the screen is split horizontally.
+The width attribute is writable only if the screen is split vertically.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
new file mode 100644
index 000000000..e8d09f62c
--- /dev/null
+++ b/runtime/doc/if_ruby.txt
@@ -0,0 +1,175 @@
+*if_ruby.txt* For Vim version 7.0aa. Last change: 2004 Mar 14
+
+
+ VIM REFERENCE MANUAL by Shugo Maeda
+
+The Ruby Interface to Vim *ruby* *Ruby*
+
+
+1. Commands |ruby-commands|
+2. The VIM module |ruby-vim|
+3. VIM::Buffer objects |ruby-buffer|
+4. VIM::Window objects |ruby-window|
+5. Global variables |ruby-globals|
+
+{Vi does not have any of these commands}
+ *E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
+
+The Ruby interface only works when Vim was compiled with the |+ruby| feature.
+
+The home page for ruby is http://www.ruby-lang.org/. You can find links for
+downloading Ruby there.
+
+==============================================================================
+1. Commands *ruby-commands*
+
+ *:ruby* *:rub*
+:rub[y] {cmd} Execute Ruby command {cmd}.
+
+:rub[y] << {endpattern}
+{script}
+{endpattern}
+ Execute Ruby script {script}.
+ {endpattern} must NOT be preceded by any white space.
+ If {endpattern} is omitted, it defaults to a dot '.'
+ like for the |:append| and |:insert| commands. This
+ form of the |:ruby| command is mainly useful for
+ including ruby code in vim scripts.
+ Note: This command doesn't work when the Ruby feature
+ wasn't compiled in. To avoid errors, see
+ |script-here|.
+
+Example Vim script: >
+
+ function! RedGem()
+ ruby << EOF
+ class Garnet
+ def initialize(s)
+ @buffer = VIM::Buffer.current
+ vimputs(s)
+ end
+ def vimputs(s)
+ @buffer.append(@buffer.count,s)
+ end
+ end
+ gem = Garnet.new("pretty")
+ EOF
+ endfunction
+<
+
+ *:rubydo* *:rubyd* *E265*
+:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
+ [range], with $_ being set to the text of each line in
+ turn, without a trailing <EOL>. Setting $_ will change
+ the text, but note that it is not possible to add or
+ delete lines using this command.
+ The default for [range] is the whole file: "1,$".
+
+ *:rubyfile* *:rubyf*
+:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
+ ":ruby load 'file'", but allows file name completion.
+
+Executing Ruby commands is not possible in the |sandbox|.
+
+==============================================================================
+2. The VIM module *ruby-vim*
+
+Ruby code gets all of its access to vim via the "VIM" module.
+
+Overview >
+ print "Hello" # displays a message
+ VIM.command(cmd) # execute an ex command
+ num = VIM::Window.count # gets the number of windows
+ w = VIM::Window[n] # gets window "n"
+ cw = VIM::Window.current # gets the current window
+ num = VIM::Buffer.count # gets the number of buffers
+ b = VIM::Buffer[n] # gets buffer "n"
+ cb = VIM::Buffer.current # gets the current buffer
+ w.height = lines # sets the window height
+ w.cursor = [row, col] # sets the window cursor position
+ pos = w.cursor # gets an array [row, col]
+ name = b.name # gets the buffer file name
+ line = b[n] # gets a line from the buffer
+ num = b.count # gets the number of lines
+ b[n] = str # sets a line in the buffer
+ b.delete(n) # deletes a line
+ b.append(n, str) # appends a line after n
+<
+
+Module Functions:
+
+ *ruby-message*
+VIM::message({msg})
+ Displays the message {msg}.
+
+ *ruby-set_option*
+VIM::set_option({arg})
+ Sets a vim option. {arg} can be any argument that the ":set" command
+ accepts. Note that this means that no spaces are allowed in the
+ argument! See |:set|.
+
+ *ruby-command*
+VIM::command({cmd})
+ Executes Ex command {cmd}.
+
+ *ruby-evaluate*
+VIM::evaluate({expr})
+ Evaluates {expr} using the vim internal expression evaluator (see
+ |expression|). Returns the expression result as a string.
+
+==============================================================================
+3. VIM::Buffer objects *ruby-buffer*
+
+VIM::Buffer objects represent vim buffers.
+
+Class Methods:
+
+current Returns the current buffer object.
+count Returns the number of buffers.
+self[{n}] Returns the buffer object for the number {n}. The first number
+ is 0.
+
+Methods:
+
+name Returns the name of the buffer.
+number Returns the number of the buffer.
+count Returns the number of lines.
+length Returns the number of lines.
+self[{n}] Returns a line from the buffer. {n} is the line number.
+self[{n}] = {str}
+ Sets a line in the buffer. {n} is the line number.
+delete({n}) Deletes a line from the buffer. {n} is the line number.
+append({n}, {str})
+ Appends a line after the line {n}.
+
+==============================================================================
+4. VIM::Window objects *ruby-window*
+
+VIM::Window objects represent vim windows.
+
+Class Methods:
+
+current Returns the current window object.
+count Returns the number of windows.
+self[{n}] Returns the window object for the number {n}. The first number
+ is 0.
+
+Methods:
+
+buffer Returns the buffer displayed in the window.
+height Returns the height of the window.
+height = {n} Sets the window height to {n}.
+cursor Returns a [row, col] array for the cursor position.
+cursor = [{row}, {col}]
+ Sets the cursor position to {row} and {col}.
+
+==============================================================================
+4. Global variables *ruby-globals*
+
+There are two global variables.
+
+$curwin The current window object.
+$curbuf The current buffer object.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt
new file mode 100644
index 000000000..12b34c481
--- /dev/null
+++ b/runtime/doc/if_sniff.txt
@@ -0,0 +1,95 @@
+*if_sniff.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL
+ by Anton Leherbauer (toni@takefive.co.at)
+
+
+SNiFF+ and Vim *sniff*
+
+1. Introduction |sniff-intro|
+2. Commands |sniff-commands|
+3. Compiling Vim with SNiFF+ interface |sniff-compiling|
+
+{Vi does not have any of these commands} *E275* *E274* *E276* *E278* *E279*
+
+The SNiFF+ interface only works, when Vim was compiled with the |+sniff|
+feature.
+
+==============================================================================
+1. Introduction *sniff-intro*
+
+The following features for the use with SNiFF+ are available:
+
+ * Vim can be used for all editing requests
+ * SNiFF+ recognizes and updates all browsers when a file is saved in Vim
+ * SNiFF+ commands can be issued directly from Vim
+
+How to use Vim with SNiFF+
+ 1. Make sure SNiFF+ is running.
+ 2. In the Editor view of the Preferences dialog set the Field named
+ 'External Editor' to 'Emacs/Vim'.
+ 4. Start Vim
+ 5. Connect to SNiFF+ (:sniff connect)
+
+Once a connection is established, SNiFF+ uses Vim for all requests to show or
+edit source code. On the other hand, you can send queries to SNiFF+ with the
+:sniff command.
+
+==============================================================================
+2. Commands *sniff-commands*
+
+ *:sniff* *:sni*
+:sni[ff] request [symbol] Send request to sniff with optional symbol.
+ {not in Vi}
+:sni[ff] Display all possible requests and the connection
+ status
+
+Most requests require a symbol (identifier) as parameter. If it is omitted,
+Vim will use the current word under the cursor.
+The available requests are listed below:
+
+request mapping description
+-------------------------------------------------------------------------------
+connect sc Establish connection with SNiFF+.
+ Make sure SNiFF+ is prepared for this in the
+ Preferences
+disconnect sq Disconnect from SNiFF+. You can reconnect any
+ time with :sniff connect (or 'sc')
+toggle st Toggle between implementation
+ and definition file
+find-symbol sf Load the symbol into a Symbol Browser
+browse-class sb Loads the class into a Class Browser
+superclass ss Edit superclass of symbol
+overridden so Edit overridden method of symbol
+retrieve-file srf Retrieve symbol in current file
+retrieve-project srp Retrieve symbol in current project
+retrieve-all-projects srP Retrieve symbol in all projects
+retrieve-next sR Retrieve symbol using current Retriever
+ settings
+goto-symbol sg Goto definition or implementation of symbol
+hierarchy sh Load symbol into the Hierarchy Browser
+restr-hier sH same as above but show only related classes
+xref-to sxt Start a refers-to query on symbol and
+ load the results into the Cross Referencer
+xref-by sxb Start a referred-by query on symbol
+xref-has sxh Start a refers-to components query on symbol
+xref-used-by sxu Start a referred-by as component query on
+ symbol
+show-docu sd Show documentation of symbol
+gen-docu sD Generate documentation of symbol
+
+The mappings are defined in a file 'sniff.vim', which is part of every SNiFF+
+product ($SNIFF_DIR/config/sniff.vim). This file is sourced whenever Vim
+connects to SNiFF+.
+
+==============================================================================
+3. Compiling Vim with SNiFF+ interface *sniff-compiling*
+
+To compile Vim with SNiFF+ support, you need two source files of the extra
+archive: if_sniff.c and if_sniff.h.
+On Unix: Edit the Makefile and uncomment the line "--enable-sniff". Or run
+configure manually with this argument.
+On NT: Specify SNIFF=yes with your make command.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt
new file mode 100644
index 000000000..b386bed15
--- /dev/null
+++ b/runtime/doc/if_tcl.txt
@@ -0,0 +1,512 @@
+*if_tcl.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+
+ VIM REFERENCE MANUAL by Ingo Wilken
+
+
+The Tcl Interface to Vim *tcl* *Tcl* *TCL*
+
+1. Commands |tcl-ex-commands|
+2. Tcl commands |tcl-commands|
+3. Tcl variables |tcl-variables|
+4. Tcl window commands |tcl-window-cmds|
+5. Tcl buffer commands |tcl-buffer-cmds|
+6. Miscellaneous; Output from Tcl |tcl-misc| |tcl-output|
+7. Known bugs & problems |tcl-bugs|
+8. Examples |tcl-examples|
+
+{Vi does not have any of these commands} *E280* *E281*
+
+The Tcl interface only works when Vim was compiled with the |+tcl| feature.
+
+WARNING: There are probably still some bugs. Please send bug reports,
+comments, ideas etc to <Ingo.Wilken@informatik.uni-oldenburg.de>
+
+==============================================================================
+1. Commands *tcl-ex-commands* *E571* *E572*
+
+ *:tcl* *:tc*
+:tc[l] {cmd} Execute Tcl command {cmd}.
+
+:[range]tc[l] << {endmarker}
+{script}
+{endmarker}
+ Execute Tcl script {script}.
+ Note: This command doesn't work when the Tcl feature
+ wasn't compiled in. To avoid errors, see
+ |script-here|.
+
+{endmarker} must NOT be preceded by any white space. If {endmarker} is
+omitted from after the "<<", a dot '.' must be used after {script}, like for
+the |:append| and |:insert| commands.
+This form of the |:tcl| command is mainly useful for including tcl code in Vim
+scripts.
+
+Example: >
+ function! DefineDate()
+ tcl << EOF
+ proc date {} {
+ return [clock format [clock seconds]]
+ }
+ EOF
+ endfunction
+<
+
+ *:tcldo* *:tcld*
+:[range]tcld[o] {cmd} Execute Tcl command {cmd} for each line in [range]
+ with the variable "line" being set to the text of each
+ line in turn, and "lnum" to the line number. Setting
+ "line" will change the text, but note that it is not
+ possible to add or delete lines using this command.
+ If {cmd} returns an error, the command is interrupted.
+ The default for [range] is the whole file: "1,$".
+ See |tcl-var-line| and |tcl-var-lnum|. {not in Vi}
+
+ *:tclfile* *:tclf*
+:tclf[ile] {file} Execute the Tcl script in {file}. This is the same as
+ ":tcl source {file}", but allows file name completion.
+ {not in Vi}
+
+
+Note that Tcl objects (like variables) persist from one command to the next,
+just as in the Tcl shell.
+
+Executing Tcl commands is not possible in the |sandbox|.
+
+==============================================================================
+2. Tcl commands *tcl-commands*
+
+Tcl code gets all of its access to vim via commands in the "::vim" namespace.
+The following commands are implemented: >
+
+ ::vim::beep # Guess.
+ ::vim::buffer {n} # Create Tcl command for one buffer.
+ ::vim::buffer list # Create Tcl commands for all buffers.
+ ::vim::command [-quiet] {cmd} # Execute an ex command.
+ ::vim::expr {expr} # Use Vim's expression evaluator.
+ ::vim::option {opt} # Get vim option.
+ ::vim::option {opt} {val} # Set vim option.
+ ::vim::window list # Create Tcl commands for all windows.
+
+Commands:
+ ::vim::beep *tcl-beep*
+ Honk. Does not return a result.
+
+ ::vim::buffer {n} *tcl-buffer*
+ ::vim::buffer exists {n}
+ ::vim::buffer list
+ Provides access to vim buffers. With an integer argument, creates a
+ buffer command (see |tcl-buffer-cmds|) for the buffer with that
+ number, and returns its name as the result. Invalid buffer numbers
+ result in a standard Tcl error. To test for valid buffer numbers,
+ vim's internal functions can be used: >
+ set nbufs [::vim::expr bufnr("$")]
+ set isvalid [::vim::expr "bufexists($n)"]
+< The "list" option creates a buffer command for each valid buffer, and
+ returns a list of the command names as the result.
+ Example: >
+ set bufs [::vim::buffer list]
+ foreach b $bufs { $b append end "The End!" }
+< The "exists" option checks if a buffer with the given number exists.
+ Example: >
+ if { [::vim::buffer exists $n] } { ::vim::command ":e #$n" }
+< This command might be replaced by a variable in future versions.
+ See also |tcl-var-current| for the current buffer.
+
+ ::vim::command {cmd} *tcl-command*
+ ::vim::command -quiet {cmd}
+ Execute the vim (ex-mode) command {cmd}. Any ex command that affects
+ a buffer or window uses the current buffer/current window. Does not
+ return a result other than a standard Tcl error code. After this
+ command is completed, the "::vim::current" variable is updated.
+ The "-quiet" flag suppresses any error messages from vim.
+ Examples: >
+ ::vim::command "set ts=8"
+ ::vim::command "%s/foo/bar/g"
+< To execute normal-mode commands, use "normal" (see |:normal|): >
+ set cmd "jj"
+ ::vim::command "normal $cmd"
+< See also |tcl-window-command| and |tcl-buffer-command|.
+
+ ::vim::expr {expr} *tcl-expr*
+ Evaluates the expression {expr} using vim's internal expression
+ evaluator (see |expression|). Any expression that queries a buffer
+ or window property uses the current buffer/current window. Returns
+ the result as a string.
+ Examples: >
+ set perl_available [::vim::expr has("perl")]
+< See also |tcl-window-expr| and |tcl-buffer-expr|.
+
+ ::vim::option {opt} *tcl-option*
+ ::vim::option {opt} {value}
+ Without second argument, queries the value of a vim option. With this
+ argument, sets the vim option to {value}, and returns the previous
+ value as the result. Any options that are marked as 'local to buffer'
+ or 'local to window' affect the current buffer/current window. The
+ global value is not changed, use the ":set" command for that. For
+ boolean options, {value} should be "0" or "1", or any of the keywords
+ "on", "off" or "toggle". See |option-summary| for a list of options.
+ Example: >
+ ::vim::option ts 8
+< See also |tcl-window-option| and |tcl-buffer-option|.
+
+ ::vim::window {option} *tcl-window*
+ Provides access to vim windows. Currently only the "list" option is
+ implemented. This creates a window command (see |tcl-window-cmds|) for
+ each window, and returns a list of the command names as the result.
+ Example: >
+ set wins [::vim::window list]
+ foreach w $wins { $w height 4 }
+< This command might be replaced by a variable in future versions.
+ See also |tcl-var-current| for the current window.
+
+==============================================================================
+3. Tcl variables *tcl-variables*
+
+The ::vim namespace contains a few variables. These are created when the Tcl
+interpreter is called from vim and set to current values. >
+
+ ::vim::current # array containing "current" objects
+ ::vim::lbase # number of first line
+ ::vim::range # array containing current range numbers
+ line # current line as a string (:tcldo only)
+ lnum # current line number (:tcldo only)
+
+Variables:
+ ::vim::current *tcl-var-current*
+ This is an array providing access to various "current" objects
+ available in vim. The contents of this array are updated after
+ "::vim::command" is called, as this might change vim's current
+ settings (e.g., by deleting the current buffer).
+ The "buffer" element contains the name of the buffer command for the
+ current buffer. This can be used directly to invoke buffer commands
+ (see |tcl-buffer-cmds|). This element is read-only.
+ Example: >
+ $::vim::current(buffer) insert begin "Hello world"
+< The "window" element contains the name of the window command for the
+ current window. This can be used directly to invoke window commands
+ (see |tcl-window-cmds|). This element is read-only.
+ Example: >
+ $::vim::current(window) height 10
+<
+ ::vim::lbase *tcl-var-lbase*
+ This variable controls how Tcl treats line numbers. If it is set to
+ '1', then lines and columns start at 1. This way, line numbers from
+ Tcl commands and vim expressions are compatible. If this variable is
+ set to '0', then line numbers and columns start at 0 in Tcl. This is
+ useful if you want to treat a buffer as a Tcl list or a line as a Tcl
+ string and use standard Tcl commands that return an index ("lsort" or
+ "string first", for example). The default value is '1'. Currently,
+ any non-zero values is treated as '1', but your scripts should not
+ rely on this. See also |tcl-linenumbers|.
+
+ ::vim::range *tcl-var-range*
+ This is an array with three elements, "start", "begin" and "end". It
+ contains the line numbers of the start and end row of the current
+ range. "begin" is the same as "start". This variable is read-only.
+ See |tcl-examples|.
+
+ line *tcl-var-line*
+ lnum *tcl-var-lnum*
+ These global variables are only available if the ":tcldo" ex command
+ is being executed. They contain the text and line number of the
+ current line. When the Tcl command invoked by ":tcldo" is completed,
+ the current line is set to the contents of the "line" variable, unless
+ the variable was unset by the Tcl command. The "lnum" variable is
+ read-only. These variables are not in the "::vim" namespace so they
+ can be used in ":tcldo" without much typing (this might be changed in
+ future versions). See also |tcl-linenumbers|.
+
+==============================================================================
+4. Tcl window commands *tcl-window-cmds*
+
+Window commands represent vim windows. They are created by several commands:
+ ::vim::window list |tcl-window|
+ "windows" option of a buffer command |tcl-buffer-windows|
+The ::vim::current(window) variable contains the name of the window command
+for the current window. A window command is automatically deleted when the
+corresponding vim window is closed.
+
+Lets assume the name of the window command is stored in the Tcl variable "win",
+i.e. "$win" calls the command. The following options are available: >
+
+ $win buffer # Create Tcl command for window's buffer.
+ $win command {cmd} # Execute ex command in windows context.
+ $win cursor # Get current cursor position.
+ $win cursor {var} # Set cursor position from array variable.
+ $win cursor {row} {col} # Set cursor position.
+ $win delcmd {cmd} # Call Tcl command when window is closed.
+ $win expr {expr} # Evaluate vim expression in windows context.
+ $win height # Report the window's height.
+ $win height {n} # Set the window's height.
+ $win option {opt} [val] # Get/Set vim option in windows context.
+
+Options:
+ $win buffer *tcl-window-buffer*
+ Creates a Tcl command for the window's buffer, and returns its name as
+ the result. The name should be stored in a variable: >
+ set buf [$win buffer]
+< $buf is now a valid Tcl command. See |tcl-buffer-cmds| for the
+ available options.
+
+ $win cursor *tcl-window-cursor*
+ $win cursor {var}
+ $win cursor {row} {col}
+ Without argument, reports the current cursor position as a string.
+ This can be converted to a Tcl array variable: >
+ array set here [$win cursor]
+< "here(row)" and "here(column)" now contain the cursor position.
+ With a single argument, the argument is interpreted as the name of a
+ Tcl array variable, which must contain two elements "row" and "column".
+ These are used to set the cursor to the new position: >
+ $win cursor here ;# not $here !
+< With two arguments, sets the cursor to the specified row and column: >
+ $win cursor $here(row) $here(column)
+< Invalid positions result in a standard Tcl error, which can be caught
+ with "catch". The row and column values depend on the "::vim::lbase"
+ variable. See |tcl-var-lbase|.
+
+ $win delcmd {cmd} *tcl-window-delcmd*
+ Registers the Tcl command {cmd} as a deletion callback for the window.
+ This command is executed (in the global scope) just before the window
+ is closed. Complex commands should be build with "list": >
+ $win delcmd [list puts vimerr "window deleted"]
+< See also |tcl-buffer-delcmd|.
+
+ $win height *tcl-window-height*
+ $win height {n}
+ Without argument, reports the window's current height. With an
+ argument, tries to set the window's height to {n}, then reports the
+ new height (which might be different from {n}).
+
+ $win command [-quiet] {cmd} *tcl-window-command*
+ $win expr {expr} *tcl-window-expr*
+ $win option {opt} [val] *tcl-window-option*
+ These are similar to "::vim::command" etc., except that everything is
+ done in the context of the window represented by $win, instead of the
+ current window. For example, setting an option that is marked 'local
+ to window' affects the window $win. Anything that affects or queries
+ a buffer uses the buffer displayed in this window (i.e. the buffer
+ that is represented by "$win buffer"). See |tcl-command|, |tcl-expr|
+ and |tcl-option| for more information.
+ Example: >
+ $win option number on
+
+==============================================================================
+5. Tcl buffer commands *tcl-buffer-cmds*
+
+Buffer commands represent vim buffers. They are created by several commands:
+ ::vim::buffer {N} |tcl-buffer|
+ ::vim::buffer list |tcl-buffer|
+ "buffer" option of a window command |tcl-window-buffer|
+The ::vim::current(buffer) variable contains the name of the buffer command
+for the current buffer. A buffer command is automatically deleted when the
+corresponding vim buffer is destroyed. Whenever the buffer's contents are
+changed, all marks in the buffer are automatically adjusted. Any changes to
+the buffer's contents made by Tcl commands can be undone with the "undo" vim
+command (see |undo|).
+
+Lets assume the name of the buffer command is stored in the Tcl variable "buf",
+i.e. "$buf" calls the command. The following options are available: >
+
+ $buf append {n} {str} # Append a line to buffer, after line {n}.
+ $buf command {cmd} # Execute ex command in buffers context.
+ $buf count # Report number of lines in buffer.
+ $buf delcmd {cmd} # Call Tcl command when buffer is deleted.
+ $buf delete {n} # Delete a single line.
+ $buf delete {n} {m} # Delete several lines.
+ $buf expr {expr} # Evaluate vim expression in buffers context.
+ $buf get {n} # Get a single line as a string.
+ $buf get {n} {m} # Get several lines as a list.
+ $buf insert {n} {str} # Insert a line in buffer, as line {n}.
+ $buf last # Report line number of last line in buffer.
+ $buf mark {mark} # Report position of buffer mark.
+ $buf name # Report name of file in buffer.
+ $buf number # Report number of this buffer.
+ $buf option {opt} [val] # Get/Set vim option in buffers context.
+ $buf set {n} {text} # Replace a single line.
+ $buf set {n} {m} {list} # Replace several lines.
+ $buf windows # Create Tcl commands for buffer's windows.
+<
+ *tcl-linenumbers*
+Most buffer commands take line numbers as arguments. How Tcl treats these
+numbers depends on the "::vim::lbase" variable (see |tcl-var-lbase|). Instead
+of line numbers, several keywords can be also used: "top", "start", "begin",
+"first", "bottom", "end" and "last".
+
+Options:
+ $buf append {n} {str} *tcl-buffer-append*
+ $buf insert {n} {str} *tcl-buffer-insert*
+ Add a line to the buffer. With the "insert" option, the string
+ becomes the new line {n}, with "append" it is inserted after line {n}.
+ Example: >
+ $buf insert top "This is the beginning."
+ $buf append end "This is the end."
+< To add a list of lines to the buffer, use a loop: >
+ foreach line $list { $buf append $num $line ; incr num }
+<
+ $buf count *tcl-buffer-count*
+ Reports the total number of lines in the buffer.
+
+ $buf delcmd {cmd} *tcl-buffer-delcmd*
+ Registers the Tcl command {cmd} as a deletion callback for the buffer.
+ This command is executed (in the global scope) just before the buffer
+ is deleted. Complex commands should be build with "list": >
+ $buf delcmd [list puts vimerr "buffer [$buf number] gone"]
+< See also |tcl-window-delcmd|.
+
+ $buf delete {n} *tcl-buffer-delete*
+ $buf delete {n} {m}
+ Deletes line {n} or lines {n} through {m} from the buffer.
+ This example deletes everything except the last line: >
+ $buf delete first [expr [$buf last] - 1]
+<
+ $buf get {n} *tcl-buffer-get*
+ $buf get {n} {m}
+ Gets one or more lines from the buffer. For a single line, the result
+ is a string; for several lines, a list of strings.
+ Example: >
+ set topline [$buf get top]
+<
+ $buf last *tcl-buffer-last*
+ Reports the line number of the last line. This value depends on the
+ "::vim::lbase" variable. See |tcl-var-lbase|.
+
+ $buf mark {mark} *tcl-buffer-mark*
+ Reports the position of the named mark as a string, similar to the
+ cursor position of the "cursor" option of a window command (see
+ |tcl-window-cursor|). This can be converted to a Tcl array variable: >
+ array set mpos [$buf mark "a"]
+< "mpos(column)" and "mpos(row)" now contain the position of the mark.
+ If the mark is not set, a standard Tcl error results.
+
+ $buf name
+ Reports the name of the file in the buffer. For a buffer without a
+ file, this is an empty string.
+
+ $buf number
+ Reports the number of this buffer. See |:buffers|.
+ This example deletes a buffer from vim: >
+ ::vim::command "bdelete [$buf number]"
+<
+ $buf set {n} {string} *tcl-buffer-set*
+ $buf set {n} {m} {list}
+ Replace one or several lines in the buffer. If the list contains more
+ elements than there are lines to replace, they are inserted into the
+ buffer. If the list contains fewer elements, any unreplaced line is
+ deleted from the buffer.
+
+ $buf windows *tcl-buffer-windows*
+ Creates a window command for each window that displays this buffer, and
+ returns a list of the command names as the result.
+ Example: >
+ set winlist [$buf windows]
+ foreach win $winlist { $win height 4 }
+< See |tcl-window-cmds| for the available options.
+
+ $buf command [-quiet] {cmd} *tcl-buffer-command*
+ $buf expr {exr} *tcl-buffer-expr*
+ $buf option {opt} [val] *tcl-buffer-option*
+ These are similar to "::vim::command" etc., except that everything is
+ done in the context of the buffer represented by $buf, instead of the
+ current buffer. For example, setting an option that is marked 'local
+ to buffer' affects the buffer $buf. Anything that affects or queries
+ a window uses the first window in vim's window list that displays this
+ buffer (i.e. the first entry in the list returned by "$buf windows").
+ See |tcl-command|, |tcl-expr| and |tcl-option| for more information.
+ Example: >
+ if { [$buf option modified] } { $buf command "w" }
+
+==============================================================================
+6. Miscellaneous; Output from Tcl *tcl-misc* *tcl-output*
+
+The standard Tcl commands "exit" and "catch" are replaced by custom versions.
+"exit" terminates the current Tcl script and returns to vim, which deletes the
+Tcl interpreter. Another call to ":tcl" then creates a new Tcl interpreter.
+"exit" does NOT terminate vim! "catch" works as before, except that it does
+not prevent script termination from "exit". An exit code != 0 causes the ex
+command that invoked the Tcl script to return an error.
+
+Two new I/O streams are available in Tcl, "vimout" and "vimerr". All output
+directed to them is displayed in the vim message area, as information messages
+and error messages, respectively. The standard Tcl output streams stdout and
+stderr are mapped to vimout and vimerr, so that a normal "puts" command can be
+used to display messages in vim.
+
+==============================================================================
+7. Known bugs & problems *tcl-bugs*
+
+Calling one of the Tcl ex commands from inside Tcl (via "::vim::command") may
+have unexpected side effects. The command creates a new interpreter, which
+has the same abilities as the standard interpreter - making "::vim::command"
+available in a safe child interpreter therefore makes the child unsafe. (It
+would be trivial to block nested :tcl* calls or ensure that such calls from a
+safe interpreter create only new safe interpreters, but quite pointless -
+depending on vim's configuration, "::vim::command" may execute arbitrary code
+in any number of other scripting languages.) A call to "exit" within this new
+interpreter does not affect the old interpreter; it only terminates the new
+interpreter, then script processing continues normally in the old interpreter.
+
+Input from stdin is currently not supported.
+
+==============================================================================
+8. Examples: *tcl-examples*
+
+Here are a few small (and maybe useful) Tcl scripts.
+
+This script sorts the lines of the entire buffer (assume it contains a list
+of names or something similar):
+ set buf $::vim::current(buffer)
+ set lines [$buf get top bottom]
+ set lines [lsort -dictionary $lines]
+ $buf set top bottom $lines
+
+This script reverses the lines in the buffer. Note the use of "::vim::lbase"
+and "$buf last" to work with any line number setting.
+ set buf $::vim::current(buffer)
+ set t $::vim::lbase
+ set b [$buf last]
+ while { $t < $b } {
+ set tl [$buf get $t]
+ set bl [$buf get $b]
+ $buf set $t $bl
+ $buf set $b $tl
+ incr t
+ incr b -1
+ }
+
+This script adds a consecutive number to each line in the current range:
+ set buf $::vim::current(buffer)
+ set i $::vim::range(start)
+ set n 1
+ while { $i <= $::vim::range(end) } {
+ set line [$buf get $i]
+ $buf set $i "$n\t$line"
+ incr i ; incr n
+ }
+
+The same can also be done quickly with two ex commands, using ":tcldo":
+ :tcl set n 1
+ :[range]tcldo set line "$n\t$line" ; incr n
+
+This procedure runs an ex command on each buffer (idea stolen from Ron Aaron):
+ proc eachbuf { cmd } {
+ foreach b [::vim::buffer list] {
+ $b command $cmd
+ }
+ }
+Use it like this:
+ :tcl eachbuf %s/foo/bar/g
+Be careful with Tcl's string and backslash substitution, tough. If in doubt,
+surround the ex command with curly braces.
+
+
+If you want to add some Tcl procedures permanently to vim, just place them in
+a file (e.g. "~/.vimrc.tcl" on Unix machines), and add these lines to your
+startup file (usually "~/.vimrc" on Unix):
+ if has("tcl")
+ tclfile ~/.vimrc.tcl
+ endif
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
new file mode 100644
index 000000000..a35ce54ce
--- /dev/null
+++ b/runtime/doc/indent.txt
@@ -0,0 +1,522 @@
+*indent.txt* For Vim version 7.0aa. Last change: 2004 Apr 25
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+This file is about indenting C programs and other files.
+
+1. Indenting C programs |C-indenting|
+2. Indenting by expression |indent-expression|
+
+==============================================================================
+1. Indenting C programs *C-indenting*
+
+The basics for C indenting are explained in section |30.2| of the user manual.
+
+Vim has options for automatically indenting C program files. These options
+affect only the indent and do not perform other formatting. For comment
+formatting, see |format-comments|.
+
+Note that this will not work when the |+smartindent| or |+cindent| features
+have been disabled at compile time.
+
+There are in fact four methods available for indentation:
+'autoindent' uses the indent from the previous line.
+'smartindent' is like 'autoindent' but also recognizes some C syntax to
+ increase/reduce the indent where appropriate.
+'cindent' Works more cleverly than the other two and is configurable to
+ different indenting styles.
+'indentexpr' The most flexible of all: Evaluates an expression to compute
+ the indent of a line. When non-empty this method overrides
+ the other ones. See |indent-expression|.
+The rest of this section describes the 'cindent' option.
+
+Note that 'cindent' indenting does not work for every code scenario. Vim
+is not a C compiler: it does not recognize all syntax.
+
+These four options control C program indenting:
+'cindent' Enables Vim to perform C program indenting automatically.
+'cinkeys' Specifies which keys trigger reindenting in insert mode.
+'cinoptions' Sets your preferred indent style.
+'cinwords' Defines keywords that start an extra indent in the next line.
+
+If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
+Vim's built-in algorithm rather than calling an external program.
+
+See |autocommand| for how to set the 'cindent' option automatically for C code
+files and reset it for others.
+
+ *cinkeys-format* *indentkeys-format*
+The 'cinkeys' option is a string that controls Vim's indenting in response to
+typing certain characters or commands in certain contexts. Note that this not
+only triggers C-indenting. When 'indentexpr' is not empty 'indentkeys' is
+used instead. The format of 'cinkeys' and 'indentkeys' is equal.
+
+The default is "0{,0},0),:,0#,!^F,o,O,e" which specifies that indenting occurs
+as follows:
+
+ "0{" if you type '{' as the first character in a line
+ "0}" if you type '}' as the first character in a line
+ "0)" if you type ')' as the first character in a line
+ ":" if you type ':' after a label or case statement
+ "0#" if you type '#' as the first character in a line
+ "!^F" if you type CTRL-F (which is not inserted)
+ "o" if you type a <CR> anywhere or use the "o" command (not in
+ insert mode!)
+ "O" if you use the "O" command (not in insert mode!)
+ "e" if you type the second 'e' for an "else" at the start of a
+ line
+
+Characters that can precede each key:
+! When a '!' precedes the key, Vim will not insert the key but will
+ instead reindent the current line. This allows you to define a
+ command key for reindenting the current line. CTRL-F is the default
+ key for this. Be careful if you define CTRL-I for this because CTRL-I
+ is the ASCII code for <Tab>.
+* When a '*' precedes the key, Vim will reindent the line before
+ inserting the key. If 'cinkeys' contains "*<Return>", Vim reindents
+ the current line before opening a new line.
+0 When a zero precedes the key (but appears after '!' or '*') Vim will
+ reindent the line only if the key is the first character you type in
+ the line. When used before "=" Vim will only reindent the line if
+ there is only white space before the word.
+
+When neither '!' nor '*' precedes the key, Vim reindents the line after you
+type the key. So ';' sets the indentation of a line which includes the ';'.
+
+Special key names:
+<> Angle brackets mean spelled-out names of keys. For example: "<Up>",
+ "<Ins>" (see |key-notation|).
+^ Letters preceded by a caret (^) are control characters. For example:
+ "^F" is CTRL-F.
+o Reindent a line when you use the "o" command or when Vim opens a new
+ line below the current one (e.g., when you type <Enter> in insert
+ mode).
+O Reindent a line when you use the "O" command.
+e Reindent a line that starts with "else" when you type the second 'e'.
+: Reindent a line when a ':' is typed which is after a label or case
+ statement. Don't reindent for a ":" in "class::method" for C++. To
+ Reindent for any ":", use "<:>".
+=word Reindent when typing the last character of "word". "word" may
+ actually be part of another word. Thus "=end" would cause reindenting
+ when typing the "d" in "endif" or "endwhile". But not when typing
+ "bend". Also reindent when completion produces a word that starts
+ with "word". "0=word" reindents when there is only white space before
+ the word.
+=~word Like =word, but ignore case.
+
+If you really want to reindent when you type 'o', 'O', 'e', '0', '<', '>',
+'*', ':' or '!', use "<o>", "<O>", "<e>", "<0>", "<<>", "<>>", "<*>", "<:>" or
+"<!>", respectively, for those keys.
+
+For an emacs-style indent mode where lines aren't indented every time you
+press Enter but only if you press Tab, I suggest:
+ :set cinkeys=0{,0},:,0#,!<Tab>,!^F
+You might also want to switch off 'autoindent' then.
+
+Note: If you change the current line's indentation manually, Vim ignores the
+cindent settings for that line. This prevents vim from reindenting after you
+have changed the indent by typing <BS>, <Tab>, or <Space> in the indent or
+used CTRL-T or CTRL-D.
+
+ *cinoptions-values*
+The 'cinoptions' option sets how Vim performs indentation. In the list below,
+"N" represents a number of your choice (the number can be negative). When
+there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
+"1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc. You can use a
+decimal point, too: "-0.5s" is minus half a 'shiftwidth'. The examples below
+assume a 'shiftwidth' of 4.
+
+ >N Amount added for "normal" indent. Used after a line that should
+ increase the indent (lines starting with "if", an opening brace,
+ etc.). (default 'shiftwidth').
+
+ cino= cino=>2 cino=>2s >
+ if (cond) if (cond) if (cond)
+ { { {
+ foo; foo; foo;
+ } } }
+<
+ eN Add N to the prevailing indent inside a set of braces if the
+ opening brace at the End of the line (more precise: is not the
+ first character in a line). This is useful if you want a
+ different indent when the '{' is at the start of the line from
+ when '{' is at the end of the line. (default 0).
+
+ cino= cino=e2 cino=e-2 >
+ if (cond) { if (cond) { if (cond) {
+ foo; foo; foo;
+ } } }
+ else else else
+ { { {
+ bar; bar; bar;
+ } } }
+<
+ nN Add N to the prevailing indent for a statement after an "if",
+ "while", etc., if it is NOT inside a set of braces. This is
+ useful if you want a different indent when there is no '{'
+ before the statement from when there is a '{' before it.
+ (default 0).
+
+ cino= cino=n2 cino=n-2 >
+ if (cond) if (cond) if (cond)
+ foo; foo; foo;
+ else else else
+ { { {
+ bar; bar; bar;
+ } } }
+<
+ fN Place the first opening brace of a function or other block in
+ column N. This applies only for an opening brace that is not
+ inside other braces and is at the start of the line. What comes
+ after the brace is put relative to this brace. (default 0).
+
+ cino= cino=f.5s cino=f1s >
+ func() func() func()
+ { { {
+ int foo; int foo; int foo;
+<
+ {N Place opening braces N characters from the prevailing indent.
+ This applies only for opening braces that are inside other
+ braces. (default 0).
+
+ cino= cino={.5s cino={1s >
+ if (cond) if (cond) if (cond)
+ { { {
+ foo; foo; foo;
+<
+ }N Place closing braces N characters from the matching opening
+ brace. (default 0).
+
+ cino= cino={2,}-0.5s cino=}2 >
+ if (cond) if (cond) if (cond)
+ { { {
+ foo; foo; foo;
+ } } }
+<
+ ^N Add N to the prevailing indent inside a set of braces if the
+ opening brace is in column 0. This can specify a different
+ indent for whole of a function (some may like to set it to a
+ negative number). (default 0).
+
+ cino= cino=^-2 cino=^-s >
+ func() func() func()
+ { { {
+ if (cond) if (cond) if (cond)
+ { { {
+ a = b; a = b; a = b;
+ } } }
+ } } }
+<
+ :N Place case labels N characters from the indent of the switch().
+ (default 'shiftwidth').
+
+ cino= cino=:0 >
+ switch (x) switch(x)
+ { {
+ case 1: case 1:
+ a = b; a = b;
+ default: default:
+ } }
+<
+ =N Place statements occurring after a case label N characters from
+ the indent of the label. (default 'shiftwidth').
+
+ cino= cino==10 >
+ case 11: case 11: a = a + 1;
+ a = a + 1; b = b + 1;
+<
+ lN If N != 0 Vim will align with a case label instead of the
+ statement after it in the same line.
+
+ cino= cino=l1 >
+ switch (a) { switch (a) {
+ case 1: { case 1: {
+ break; break;
+ } }
+<
+ bN If N != 0 Vim will align a final "break" with the case label,
+ so that case..break looks like a sort of block. (default: 0).
+
+ cino= cino=b1 >
+ switch (x) switch(x)
+ { {
+ case 1: case 1:
+ a = b; a = b;
+ break; break;
+
+ default: default:
+ a = 0; a = 0;
+ break; break;
+ } }
+<
+ gN Place C++ scope declarations N characters from the indent of the
+ block they are in. (default 'shiftwidth'). A scope declaration
+ can be "public:", "protected:" or "private:".
+
+ cino= cino=g0 >
+ { {
+ public: public:
+ a = b; a = b;
+ private: private:
+ } }
+<
+ hN Place statements occurring after a C++ scope declaration N
+ characters from the indent of the label. (default
+ 'shiftwidth').
+
+ cino= cino=h10 >
+ public: public: a = a + 1;
+ a = a + 1; b = b + 1;
+<
+ pN Parameter declarations for K&R-style function declarations will
+ be indented N characters from the margin. (default
+ 'shiftwidth').
+
+ cino= cino=p0 cino=p2s >
+ func(a, b) func(a, b) func(a, b)
+ int a; int a; int a;
+ char b; char b; char b;
+<
+ tN Indent a function return type declaration N characters from the
+ margin. (default 'shiftwidth').
+
+ cino= cino=t0 cino=t7 >
+ int int int
+ func() func() func()
+<
+ iN Indent C++ base class declarations and contructor
+ initializations, if they start in a new line (otherwise they
+ are aligned at the right side of the ':').
+ (default 'shiftwidth').
+
+ cino= cino=i0 >
+ class MyClass : class MyClass :
+ public BaseClass public BaseClass
+ {} {}
+ MyClass::MyClass() : MyClass::MyClass() :
+ BaseClass(3) BaseClass(3)
+ {} {}
+<
+ +N Indent a continuation line (a line that spills onto the next) N
+ additional characters. (default 'shiftwidth').
+
+ cino= cino=+10 >
+ a = b + 9 * a = b + 9 *
+ c; c;
+<
+ cN Indent comment lines after the comment opener, when there is no
+ other text with which to align, N characters from the comment
+ opener. (default 3). See also |format-comments|.
+
+ cino= cino=c5 >
+ /* /*
+ text. text.
+ */ */
+<
+ CN When N is non-zero, indent comment lines by the amount specified
+ with the c flag above even if there is other text behind the
+ comment opener. (default 0).
+
+ cino=c0 cino=c0,C1 >
+ /******** /********
+ text. text.
+ ********/ ********/
+< (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
+
+ /N Indent comment lines N characters extra. (default 0).
+ cino= cino=/4 >
+ a = b; a = b;
+ /* comment */ /* comment */
+ c = d; c = d;
+<
+ (N When in unclosed parentheses, indent N characters from the line
+ with the unclosed parentheses. Add a 'shiftwidth' for every
+ unclosed parentheses. When N is 0 or the unclosed parentheses
+ is the first non-white character in its line, line up with the
+ next non-white character after the unclosed parentheses.
+ (default 'shiftwidth' * 2).
+
+ cino= cino=(0 >
+ if (c1 && (c2 || if (c1 && (c2 ||
+ c3)) c3))
+ foo; foo;
+ if (c1 && if (c1 &&
+ (c2 || c3)) (c2 || c3))
+ { {
+<
+ uN Same as (N, but for one level deeper. (default 'shiftwidth').
+
+ cino= cino=u2 >
+ if (c123456789 if (c123456789
+ && (c22345 && (c22345
+ || c3)) || c3))
+<
+ UN When N is non-zero, do not ignore the indenting specified by
+ ( or u in case that the unclosed parentheses is the first
+ non-white character in its line. (default 0).
+
+ cino= or cino=(s cino=(s,U1 >
+ c = c1 && c = c1 &&
+ ( (
+ c2 || c2 ||
+ c3 c3
+ ) && c4; ) && c4;
+<
+ wN When in unclosed parentheses and N is non-zero and either
+ using "(0" or "u0", respectively, or using "U0" and the unclosed
+ parentheses is the first non-white character in its line, line
+ up with the character immediately after the unclosed parentheses
+ rather than the first non-white character. (default 0).
+
+ cino=(0 cino=(0,w1 >
+ if ( c1 if ( c1
+ && ( c2 && ( c2
+ || c3)) || c3))
+ foo; foo;
+<
+ WN When in unclosed parentheses and N is non-zero and either
+ using "(0" or "u0", respectively and the unclosed parentheses is
+ the last non-white character in its line and it is not the
+ closing parentheses, indent the following line N characters
+ relative to the outer context (i.e. start of the line or the
+ next unclosed parentheses). (default: 0).
+
+ cino=(0 cino=(0,W4 >
+ a_long_line( a_long_line(
+ argument, argument,
+ argument); argument);
+ a_short_line(argument, a_short_line(argument,
+ argument); argument);
+<
+ mN When N is non-zero, line up a line starting with a closing
+ parentheses with the first character of the line with the
+ matching opening parentheses. (default 0).
+
+ cino=(s cino=(s,m1 >
+ c = c1 && ( c = c1 && (
+ c2 || c2 ||
+ c3 c3
+ ) && c4; ) && c4;
+ if ( if (
+ c1 && c2 c1 && c2
+ ) )
+ foo; foo;
+<
+ *java-cinoptions* *java-indenting*
+ jN Indent java anonymous classes correctly. The value 'N' is
+ currently unused but must be non-zero (e.g. 'j1'). 'j1' will
+ indent for example the following code snippet correctly: >
+
+ object.add(new ChangeListener() {
+ public void stateChanged(ChangeEvent e) {
+ do_something();
+ }
+ });
+<
+ )N Vim searches for unclosed parentheses at most N lines away.
+ This limits the time needed to search for parentheses. (default
+ 20 lines).
+
+ *N Vim searches for unclosed comments at most N lines away. This
+ limits the time needed to search for the start of a comment.
+ (default 30 lines).
+
+
+The defaults, spelled out in full, are:
+ cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
+ \U0,w0,m0,j0,)20,*30
+
+Vim puts a line in column 1 if:
+- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
+- It starts with a label (a keyword followed by ':', other than "case" and
+ "default").
+- Any combination of indentations causes the line to have less than 0
+ indentation.
+
+==============================================================================
+2. Indenting by expression *indent-expression*
+
+The basics for using flexible indenting are explained in section |30.3| of the
+user manual.
+
+If you want to write your own indent file, it must set the 'indentexpr'
+option. Setting the 'indentkeys' option is often useful. See the
+$VIMRUNTIME/indent directory for examples.
+
+
+REMARKS ABOUT SPECIFIC INDENT FILES ~
+
+
+FORTRAN *fortran-indent*
+
+Block if, select case, and where constructs are indented. Comments, labelled
+statements and continuation lines are indented if the Fortran is in free
+source form, whereas they are not indented if the Fortran is in fixed source
+form because of the left margin requirements. Hence manual indent corrections
+will be necessary for labelled statements and continuation lines when fixed
+source form is being used. For further discussion of the method used for the
+detection of source format see |fortran-syntax|.
+
+Do loops ~
+All do loops are left unindented by default. Do loops can be unstructured in
+Fortran with (possibly multiple) loops ending on a labelled executable
+statement of almost arbitrary type. Correct indentation requires
+compiler-quality parsing. Old code with do loops ending on labelled statements
+of arbitrary type can be indented with elaborate programs such as Tidy
+(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
+also left unindented because continue statements are also used for purposes
+other than ending a do loop. Programs such as Tidy can convert structured
+do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
+be indented. If you use only structured loops of the do/enddo form, you should
+declare this by setting the fortran_do_enddo variable in your .vimrc as
+follows >
+
+ let fortran_do_enddo=1
+
+in which case do loops will be indented. If all your loops are of do/enddo
+type only in, say, .f90 files, then you should set a buffer flag with an
+autocommand such as >
+
+ au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
+
+to get do loops indented in .f90 files and left alone in Fortran files with
+other extensions such as .for.
+
+
+VERILOG *verilog-indent*
+
+General block statements such as if, for, case, always, initial, function,
+specify and begin, etc., are indented. The module block statements (first
+level blocks) are not indented by default. you can turn on the indent with
+setting a variable in the .vimrc as follows: >
+
+ let b:verilog_indent_modules = 1
+
+then the module blocks will be indented. To stop this, remove the variable: >
+
+ :unlet b:verilog_indent_modules
+
+To set the variable only for Verilog file. The following statements can be
+used: >
+
+ au BufReadPost * if exists("b:current_syntax")
+ au BufReadPost * if b:current_syntax == "verilog"
+ au BufReadPost * let b:verilog_indent_modules = 1
+ au BufReadPost * endif
+ au BufReadPost * endif
+
+Furthermore, setting the variable b:verilog_indent_width to change the
+indenting width (default is 'shiftwidth'): >
+
+ let b:verilog_indent_width = 4
+ let b:verilog_indent_width = &sw * 2
+
+In addition, you can turn the verbose mode for debug issue: >
+
+ let b:verilog_indent_verbose = 1
+
+Make sure to do ":set cmdheight=2" first to allow the display of the message.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
new file mode 100644
index 000000000..791e5ba36
--- /dev/null
+++ b/runtime/doc/index.txt
@@ -0,0 +1,1423 @@
+*index.txt* For Vim version 7.0aa. Last change: 2004 May 24
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+ *index*
+This file contains a list of all commands for each mode, with a tag and a
+short description. The lists are sorted on ASCII value.
+
+Tip: When looking for certain functionality, use a search command. E.g.,
+to look for deleting something, use: "/delete".
+
+1. Insert mode |insert-index|
+2. Normal mode |normal-index|
+ 2.1. Text objects |objects|
+ 2.2. Window commands |CTRL-W|
+ 2.3. Square bracket commands |[|
+ 2.4. Commands starting with 'g' |g|
+ 2.5. Commands starting with 'z' |z|
+3. Visual mode |visual-index|
+4. Command-line editing |ex-edit-index|
+5. EX commands |ex-cmd-index|
+
+For an overview of options see help.txt |option-list|.
+For an overview of built-in functions see |functions|.
+For a list of Vim variables see |vim-variable|.
+For a complete listing of all help items see |help-tags|.
+
+==============================================================================
+1. Insert mode *insert-index*
+
+tag char action ~
+-----------------------------------------------------------------------
+|i_CTRL-@| CTRL-@ insert previously inserted text and stop
+ insert
+|i_CTRL-A| CTRL-A insert previously inserted text
+ CTRL-B not used |i_CTRL-B-gone|
+|i_CTRL-C| CTRL-C quit insert mode, without checking for
+ abbreviation, unless 'insertmode' set.
+|i_CTRL-D| CTRL-D delete one shiftwidth of indent in the current
+ line
+|i_CTRL-E| CTRL-E insert the character which is below the cursor
+ CTRL-F not used (but by default it's in 'cinkeys' to
+ re-indent the current line)
+|i_CTRL-G_j| CTRL-G CTRL-J line down, to column where inserting started
+|i_CTRL-G_j| CTRL-G j line down, to column where inserting started
+|i_CTRL-G_j| CTRL-G <Down> line down, to column where inserting started
+|i_CTRL-G_k| CTRL-G CTRL-K line up, to column where inserting started
+|i_CTRL-G_k| CTRL-G k line up, to column where inserting started
+|i_CTRL-G_k| CTRL-G <Up> line up, to column where inserting started
+|i_CTRL-G_u| CTRL-G u start new undoable edit
+|i_<BS>| <BS> delete character before the cursor
+|i_digraph| {char1}<BS>{char2}
+ enter digraph (only when 'digraph' option set)
+|i_CTRL-H| CTRL-H same as <BS>
+|i_<Tab>| <Tab> insert a <Tab> character
+|i_CTRL-I| CTRL-I same as <Tab>
+|i_<NL>| <NL> same as <CR>
+|i_CTRL-J| CTRL-J same as <CR>
+|i_CTRL-K| CTRL-K {char1} {char2}
+ enter digraph
+|i_CTRL-L| CTRL-L when 'insertmode' set: Leave Insert mode
+|i_<CR>| <CR> begin new line
+|i_CTRL-M| CTRL-M same as <CR>
+|i_CTRL-N| CTRL-N find next match for keyword in front of the
+ cursor
+|i_CTRL-O| CTRL-O execute a single command and return to insert
+ mode
+|i_CTRL-P| CTRL-P find previous match for keyword in front of
+ the cursor
+|i_CTRL-Q| CTRL-Q same as CTRL-V, unless used for terminal
+ control flow
+|i_CTRL-R| CTRL-R {0-9a-z"%#*:=}
+ insert the contents of a register
+|i_CTRL-R_CTRL-R| CTRL-R CTRL-R {0-9a-z"%#*:=}
+ insert the contents of a register literally
+|i_CTRL-R_CTRL-O| CTRL-R CTRL-O {0-9a-z"%#*:=}
+ insert the contents of a register literally
+ and don't auto-indent
+|i_CTRL-R_CTRL-P| CTRL-R CTRL-P {0-9a-z"%#*:=}
+ insert the contents of a register literally
+ and fix indent.
+ CTRL-S (used for terminal control flow)
+|i_CTRL-T| CTRL-T insert one shiftwidth of indent in current
+ line
+|i_CTRL-U| CTRL-U delete all entered characters in the current
+ line
+|i_CTRL-V| CTRL-V {char} insert next non-digit literally
+|i_CTRL-V_digit| CTRL-V {number} insert three digit decimal number as a single
+ byte.
+|i_CTRL-W| CTRL-W delete word before the cursor
+|i_CTRL-X| CTRL-X {mode} enter CTRL-X sub mode, see below
+|i_CTRL-Y| CTRL-Y insert the character which is above the cursor
+|i_CTRL-Z| CTRL-Z when 'insertmode' set: suspend Vim
+|i_<Esc>| <Esc> end insert mode (unless 'insertmode' set)
+|i_CTRL-[| CTRL-[ same as <Esc>
+|i_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode
+|i_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
+ CTRL-\ a - z reserved for extensions
+ CTRL-\ others not used
+|i_CTRL-]| CTRL-] trigger abbreviation
+|i_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
+|i_CTRL-_| CTRL-_ When 'allowrevins' set: change language
+ (Hebrew, Farsi) {only when compiled with
+ +rightleft feature}
+
+ <Space> to '~' not used, except '0' and '^' followed by
+ CTRL-D
+
+|i_0_CTRL-D| 0 CTRL-D delete all indent in the current line
+|i_^_CTRL-D| ^ CTRL-D delete all indent in the current line, restore
+ it in the next line
+
+|i_<Del>| <Del> delete character under the cursor
+
+ Meta characters (0x80 to 0xff, 128 to 255)
+ not used
+
+|i_<Left>| <Left> cursor one character left
+|i_<S-Left>| <S-Left> cursor one word left
+|i_<C-Left>| <C-Left> cursor one word left
+|i_<Right>| <Right> cursor one character right
+|i_<S-Right>| <S-Right> cursor one word right
+|i_<C-Right>| <C-Right> cursor one word right
+|i_<Up>| <Up> cursor one line up
+|i_<S-Up>| <S-Up> same as <PageUp>
+|i_<Down>| <Down> cursor one line down
+|i_<S-Down>| <S-Down> same as <PageDown>
+|i_<Home>| <Home> cursor to start of line
+|i_<C-Home>| <C-Home> cursor to start of file
+|i_<End>| <End> cursor past end of line
+|i_<C-End>| <C-End> cursor past end of file
+|i_<PageUp>| <PageUp> one screenfull backward
+|i_<PageDown>| <PageDown> one screenfull forward
+|i_<F1>| <F1> same as <Help>
+|i_<Help>| <Help> stop insert mode and display help window
+|i_<Insert>| <Insert> toggle Insert/Replace mode
+|i_<LeftMouse>| <LeftMouse> cursor at mouse click
+|i_<MouseDown>| <MouseDown> scroll three lines downwards
+|i_<S-MouseDown>| <S-MouseDown> scroll a full page downwards
+|i_<MouseUp>| <MouseUp> scroll three lines upwards
+|i_<S-MouseUp>| <S-MouseUp> scroll a full page upwards
+
+commands in CTRL-X submode
+
+|i_CTRL-X_CTRL-D| CTRL-X CTRL-D complete defined identifiers
+|i_CTRL-X_CTRL-E| CTRL-X CTRL-E scroll up
+|i_CTRL-X_CTRL-F| CTRL-X CTRL-F complete file names
+|i_CTRL-X_CTRL-I| CTRL-X CTRL-I complete identifiers
+|i_CTRL-X_CTRL-K| CTRL-X CTRL-K complete identifiers from dictionary
+|i_CTRL-X_CTRL-L| CTRL-X CTRL-L complete whole lines
+|i_CTRL-X_CTRL-N| CTRL-X CTRL-N next completion
+|i_CTRL-X_CTRL-P| CTRL-X CTRL-P previous completion
+|i_CTRL-X_CTRL-T| CTRL-X CTRL-T complete identifiers from thesaurus
+|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
+|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
+{not available when compiled without the +insert_expand feature}
+
+==============================================================================
+2. Normal mode *normal-index*
+
+CHAR any non-blank character
+WORD a sequence of non-blank characters
+N a number entered before the command
+{motion} a cursor movement command
+Nmove the text that is moved over with a {motion}
+SECTION a section that possibly starts with '}' instead of '{'
+
+note: 1 = cursor movement command; 2 = can be undone/redone
+
+tag char note action in Normal mode ~
+------------------------------------------------------------------------------
+ CTRL-@ not used
+|CTRL-A| CTRL-A 2 add N to number at/after cursor
+|CTRL-B| CTRL-B 1 scroll N screens Backwards
+|CTRL-C| CTRL-C interrupt current (search) command
+|CTRL-D| CTRL-D scroll Down N lines (default: half a screen)
+|CTRL-E| CTRL-E scroll N lines upwards (N lines Extra)
+|CTRL-F| CTRL-F 1 scroll N screens Forward
+|CTRL-G| CTRL-G display current file name and position
+|<BS>| <BS> 1 same as "h"
+|CTRL-H| CTRL-H 1 same as "h"
+|<Tab>| <Tab> 1 go to N newer entry in jump list
+|CTRL-I| CTRL-I 1 same as <Tab>
+|<NL>| <NL> 1 same as "j"
+|CTRL-J| CTRL-J 1 same as "j"
+ CTRL-K not used
+|CTRL-L| CTRL-L redraw screen
+|<CR>| <CR> 1 cursor to the first CHAR N lines lower
+|CTRL-M| CTRL-M 1 same as <CR>
+|CTRL-N| CTRL-N 1 same as "j"
+|CTRL-O| CTRL-O 1 go to N older entry in jump list
+|CTRL-P| CTRL-P 1 same as "k"
+ CTRL-Q (used for terminal control flow)
+|CTRL-R| CTRL-R 2 redo changes which were undone with 'u'
+ CTRL-S (used for terminal control flow)
+|CTRL-T| CTRL-T jump to N older Tag in tag list
+|CTRL-U| CTRL-U scroll N lines Upwards (default: half a
+ screen)
+|CTRL-V| CTRL-V start blockwise Visual mode
+|CTRL-W| CTRL-W {char} window commands, see |CTRL-W|
+|CTRL-X| CTRL-X 2 subtract N from number at/after cursor
+|CTRL-Y| CTRL-Y scroll N lines downwards
+|CTRL-Z| CTRL-Z suspend program (or start new shell)
+ CTRL-[ <Esc> not used
+|CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode (no-op)
+|CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
+ CTRL-\ a - z reserved for extensions
+ CTRL-\ others not used
+|CTRL-]| CTRL-] :ta to ident under cursor
+|CTRL-^| CTRL-^ edit Nth alternate file (equivalent to
+ ":e #N")
+ CTRL-_ not used
+
+|<Space>| <Space> 1 same as "l"
+|!| !{motion}{filter}
+ 2 filter Nmove text through the {filter}
+ command
+|!!| !!{filter} 2 filter N lines through the {filter} command
+|quote| "{a-zA-Z0-9.%#:-"} use register {a-zA-Z0-9.%#:-"} for next
+ delete, yank or put (uppercase to append)
+ ({.%#:} only work with put)
+|#| # 1 search backward for the Nth occurrence of
+ the ident under the cursor
+|$| $ 1 cursor to the end of Nth next line
+|%| % 1 find the next (curly/square) bracket on
+ this line and go to its match, or go to
+ matching comment bracket, or go to matching
+ preprocessor directive.
+|N%| {count}% 1 go to N percentage in the file
+|&| & 2 repeat last :s
+|'| '{a-zA-Z0-9} 1 cursor to the first CHAR on the line with
+ mark {a-zA-Z0-9}
+|''| '' 1 cursor to the first CHAR of the line where
+ the cursor was before the latest jump.
+|'(| '( 1 cursor to the first CHAR on the line of the
+ start of the current sentence
+|')| ') 1 cursor to the first CHAR on the line of the
+ end of the current sentence
+|'<| '< 1 cursor to the first CHAR of the line where
+ highlighted area starts/started in the
+ current buffer.
+|'>| '> 1 cursor to the first CHAR of the line where
+ highlighted area ends/ended in the current
+ buffer.
+|'[| '[ 1 cursor to the first CHAR on the line of the
+ start of last operated text or start of put
+ text
+|']| '] 1 cursor to the first CHAR on the line of the
+ end of last operated text or end of put
+ text
+|'{| '{ 1 cursor to the first CHAR on the line of the
+ start of the current paragraph
+|'}| '} 1 cursor to the first CHAR on the line of the
+ end of the current paragraph
+|(| ( 1 cursor N sentences backward
+|)| ) 1 cursor N sentences forward
+|star| * 1 search forward for the Nth occurrence of
+ the ident under the cursor
+|+| + 1 same as <CR>
+|,| , 1 repeat latest f, t, F or T in opposite
+ direction N times
+|-| - 1 cursor to the first CHAR N lines higher
+|.| . 2 repeat last change with count replaced with
+ N
+|/| /{pattern}<CR> 1 search forward for the Nth occurrence of
+ {pattern}
+|/<CR>| /<CR> 1 search forward for {pattern} of last search
+|count| 0 1 cursor to the first char of the line
+|count| 1 prepend to command to give a count
+|count| 2 "
+|count| 3 "
+|count| 4 "
+|count| 5 "
+|count| 6 "
+|count| 7 "
+|count| 8 "
+|count| 9 "
+|:| : 1 start entering an Ex command
+|N:| {count}: start entering an Ex command with range
+ from current line to N-1 lines down
+|;| ; 1 repeat latest f, t, F or T N times
+|<| <{motion} 2 shift Nmove lines one 'shiftwidth'
+ leftwards
+|<<| << 2 shift N lines one 'shiftwidth' leftwards
+|=| ={motion} 2 filter Nmove lines through "indent"
+|==| == 2 filter N lines through "indent"
+|>| >{motion} 2 shift Nmove lines one 'shiftwidth'
+ rightwards
+|>>| >> 2 shift N lines one 'shiftwidth' rightwards
+|?| ?{pattern}<CR> 1 search backward for the Nth previous
+ occurrence of {pattern}
+|?<CR>| ?<CR> 1 search backward for {pattern} of last search
+|@| @{a-z} 2 execute the contents of register {a-z}
+ N times
+|@:| @: repeat the previous ":" command N times
+|@@| @@ 2 repeat the previous @{a-z} N times
+|A| A 2 append text after the end of the line N times
+|B| B 1 cursor N WORDS backward
+|C| ["x]C 2 change from the cursor position to the end
+ of the line, and N-1 more lines [into
+ buffer x]; synonym for "c$"
+|D| ["x]D 2 delete the characters under the cursor
+ until the end of the line and N-1 more
+ lines [into buffer x]; synonym for "d$"
+|E| E 1 cursor forward to the end of WORD N
+|F| F{char} 1 cursor to the Nth occurrence of {char} to
+ the left
+|G| G 1 cursor to line N, default last line
+|H| H 1 cursor to line N from top of screen
+|I| I 2 insert text before the first CHAR on the
+ line N times
+|J| J 2 Join N lines; default is 2
+|K| K lookup Keyword under the cursor with
+ 'keywordprg'
+|L| L 1 cursor to line N from bottom of screen
+|M| M 1 cursor to middle line of screen
+|N| N 1 repeat the latest '/' or '?' N times in
+ opposite direction
+|O| O 2 begin a new line above the cursor and
+ insert text, repeat N times
+|P| ["x]P 2 put the text [from buffer x] before the
+ cursor N times
+|Q| Q switch to "Ex" mode
+|R| R 2 enter replace mode: overtype existing
+ characters, repeat the entered text N-1
+ times
+|S| ["x]S 2 delete N lines [into buffer x] and start
+ insert; synonym for "^cc" or "0cc",
+ depending on autoindent
+|T| T{char} 1 cursor till after Nth occurrence of {char}
+ to the left
+|U| U 2 undo all latest changes on one line
+|V| V start linewise Visual mode
+|W| W 1 cursor N WORDS forward
+|X| ["x]X 2 delete N characters before the cursor [into
+ buffer x]
+|Y| ["x]Y yank N lines [into buffer x]; synonym for
+ "yy"
+|ZZ| ZZ store current file if modified, and exit
+|ZQ| ZQ exit current file always
+|[| [{char} square bracket command (see below)
+ \ not used
+|]| ]{char} square bracket command (see below)
+|^| ^ 1 cursor to the first CHAR of the line
+|_| _ 1 cursor to the first CHAR N - 1 lines lower
+|`| `{a-zA-Z0-9} 1 cursor to the mark {a-zA-Z0-9}
+|`(| `( 1 cursor to the start of the current sentence
+|`)| `) 1 cursor to the end of the current sentence
+|`<| `< 1 cursor to the start of the highlighted area
+|`>| `> 1 cursor to the end of the highlighted area
+|`[| `[ 1 cursor to the start of last operated text
+ or start of putted text
+|`]| `] 1 cursor to the end of last operated text or
+ end of putted text
+|``| `` 1 cursor to the position before latest jump
+|`{| `{ 1 cursor to the start of the current paragraph
+|`}| `} 1 cursor to the end of the current paragraph
+|a| a 2 append text after the cursor N times
+|b| b 1 cursor N words backward
+|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
+ insert
+|cc| ["x]cc 2 delete N lines [into buffer x] and start
+ insert
+|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
+|dd| ["x]dd 2 delete N lines [into buffer x]
+|do| do 2 same as ":diffget"
+|dp| dp 2 same as ":diffput"
+|e| e 1 cursor forward to the end of word N
+|f| f{char} 1 cursor to Nth occurrence of {char} to the
+ right
+|g| g{char} extended commands, see below
+|h| h 1 cursor N chars to the left
+|i| i 2 insert text before the cursor N times
+|j| j 1 cursor N lines downward
+|k| k 1 cursor N lines upward
+|l| l 1 cursor N chars to the right
+|m| m{A-Za-z} set mark {A-Za-z} at cursor position
+|n| n 1 repeat the latest '/' or '?' N times
+|o| o 2 begin a new line below the cursor and
+ insert text, repeat N times
+|p| ["x]p 2 put the text [from register x] after the
+ cursor N times
+|q| q{0-9a-zA-Z"} record typed characters into named register
+ {0-9a-zA-Z"} (uppercase to append)
+|q| q (while recording) stops recording
+|q:| q: edit : command-line in command-line window
+|q/| q/ edit / command-line in command-line window
+|q?| q? edit ? command-line in command-line window
+|r| r{char} 2 replace N chars with {char}
+|s| ["x]s 2 (substitute) delete N characters [into
+ buffer x] and start insert
+|t| t{char} 1 cursor till before Nth occurrence of {char}
+ to the right
+|u| u 2 undo changes
+|v| v start characterwise Visual mode
+|w| w 1 cursor N words forward
+|x| ["x]x 2 delete N characters under and after the
+ cursor [into buffer x]
+|y| ["x]y{motion} yank Nmove text [into buffer x]
+|yy| ["x]yy yank N lines [into buffer x]
+|z| z{char} commands starting with 'z', see below
+|{| { 1 cursor N paragraphs backward
+|bar| | 1 cursor to column N
+|}| } 1 cursor N paragraphs forward
+|~| ~ 2 'tildeop' off: switch case of N characters
+ under cursor and move the cursor N
+ characters to the right
+|~| ~{motion} 'tildeop' on: switch case of Nmove text
+|<C-End>| <C-End> 1 same as "G"
+|<C-Home>| <C-Home> 1 same as "gg"
+|<C-Left>| <C-Left> 1 same as "b"
+|<C-LeftMouse>| <C-LeftMouse> ":ta" to the keyword at the mouse click
+|<C-Right>| <C-Right> 1 same as "w"
+|<C-RightMouse>| <C-RightMouse> same as "CTRL-T"
+|<Del>| ["x]<Del> 2 same as "x"
+|N<Del>| {count}<Del> remove the last digit from {count}
+|<Down>| <Down> 1 same as "j"
+|<End>| <End> 1 same as "$"
+|<F1>| <F1> same as <Help>
+|<Help>| <Help> open a help window
+|<Home>| <Home> 1 same as "0"
+|<Insert>| <Insert> 2 same as "i"
+|<Left>| <Left> 1 same as "h"
+|<LeftMouse>| <LeftMouse> 1 move cursor to the mouse click position
+|<MiddleMouse>| <MiddleMouse> 2 same as "P" at the mouse click position
+|<PageDown>| <PageDown> same as CTRL-F
+|<PageUp>| <PageUp> same as CTRL-B
+|<Right>| <Right> 1 same as "l"
+|<RightMouse>| <RightMouse> start Visual mode, move cursor to the mouse
+ click position
+|<S-Down>| <S-Down> 1 same as CTRL-F
+|<S-Left>| <S-Left> 1 same as "b"
+|<S-LeftMouse>| <S-LeftMouse> same as "*" at the mouse click position
+|<S-Right>| <S-Right> 1 same as "w"
+|<S-RightMouse>| <S-RightMouse> same as "#" at the mouse click position
+|<S-Up>| <S-Up> 1 same as CTRL-B
+|<Undo>| <Undo> 2 same as "u"
+|<Up>| <Up> 1 same as "k"
+|<MouseDown>| <MouseDown> scroll three lines downwards
+|<S-MouseDown>| <S-MouseDown> scroll a full page downwards
+|<MouseUp>| <MouseUp> scroll three lines upwards
+|<S-MouseUp>| <S-MouseUp> scroll a full page upwards
+
+==============================================================================
+2.1 Text objects *objects*
+
+These can be used after an operator or in Visual mode to select an object.
+
+tag command action in Normal mode ~
+------------------------------------------------------------------------------
+|v_a(| a( same as ab
+|v_a)| a) same as ab
+|v_a<| a< "a <>" from '<' to the matching '>'
+|v_a>| a> same as a<
+|v_aB| aB "a Block" from "[{" to "]}" (with brackets)
+|v_aW| aW "a WORD" (with white space)
+|v_a[| a[ "a []" from '[' to the matching ']'
+|v_a]| a] same as a[
+|v_ab| ab "a block" from "[(" to "])" (with braces)
+|v_ap| ap "a paragraph" (with white space)
+|v_as| as "a sentence" (with white space)
+|v_aw| aw "a word" (with white space)
+|v_a{| a{ same as aB
+|v_a}| a} same as aB
+|v_i(| i( same as ib
+|v_i)| i) same as ib
+|v_i<| i< "inner <>" from '<' to the matching '>'
+|v_i>| i> same as i<
+|v_iB| iB "inner Block" from "[{" and "]}"
+|v_iW| iW "inner WORD"
+|v_i[| i[ "inner []" from '[' to the matching ']'
+|v_i]| i] same as i[
+|v_ib| ib "inner block" from "[(" to "])"
+|v_ip| ip "inner paragraph"
+|v_is| is "inner sentence"
+|v_iw| iw "inner word"
+|v_i{| i{ same as iB
+|v_i}| i} same as iB
+
+==============================================================================
+2.2 Window commands *CTRL-W*
+
+tag command action in Normal mode ~
+------------------------------------------------------------------------------
+|CTRL-W_CTRL-B| CTRL-W CTRL-B same as "CTRL-W b"
+|CTRL-W_CTRL-C| CTRL-W CTRL-C same as "CTRL-W c"
+|CTRL-W_CTRL-D| CTRL-W CTRL-D same as "CTRL-W d"
+|CTRL-W_CTRL-F| CTRL-W CTRL-F same as "CTRL-W f"
+ CTRL-W CTRL-G same as "CTRL-W g .."
+|CTRL-W_CTRL-H| CTRL-W CTRL-H same as "CTRL-W h"
+|CTRL-W_CTRL-I| CTRL-W CTRL-I same as "CTRL-W i"
+|CTRL-W_CTRL-J| CTRL-W CTRL-J same as "CTRL-W j"
+|CTRL-W_CTRL-K| CTRL-W CTRL-K same as "CTRL-W k"
+|CTRL-W_CTRL-L| CTRL-W CTRL-L same as "CTRL-W l"
+|CTRL-W_CTRL-N| CTRL-W CTRL-N same as "CTRL-W n"
+|CTRL-W_CTRL-O| CTRL-W CTRL-O same as "CTRL-W o"
+|CTRL-W_CTRL-P| CTRL-W CTRL-P same as "CTRL-W p"
+|CTRL-W_CTRL-Q| CTRL-W CTRL-Q same as "CTRL-W q"
+|CTRL-W_CTRL-R| CTRL-W CTRL-R same as "CTRL-W r"
+|CTRL-W_CTRL-S| CTRL-W CTRL-S same as "CTRL-W s"
+|CTRL-W_CTRL-T| CTRL-W CTRL-T same as "CTRL-W t"
+|CTRL-W_CTRL-V| CTRL-W CTRL-V same as "CTRL-W v"
+|CTRL-W_CTRL-W| CTRL-W CTRL-W same as "CTRL-W w"
+|CTRL-W_CTRL-X| CTRL-W CTRL-X same as "CTRL-W x"
+|CTRL-W_CTRL-Z| CTRL-W CTRL-Z same as "CTRL-W z"
+|CTRL-W_CTRL-]| CTRL-W CTRL-] same as "CTRL-W ]"
+|CTRL-W_CTRL-^| CTRL-W CTRL-^ same as "CTRL-W ^"
+|CTRL-W_CTRL-_| CTRL-W CTRL-_ same as "CTRL-W _"
+|CTRL-W_+| CTRL-W + increase current window height N lines
+|CTRL-W_-| CTRL-W - decrease current window height N lines
+|CTRL-W_<| CTRL-W < decrease current window width N columns
+|CTRL-W_=| CTRL-W = make all windows the same height
+|CTRL-W_>| CTRL-W > increase current window width N columns
+|CTRL-W_H| CTRL-W H move current window to the far left
+|CTRL-W_J| CTRL-W J move current window to the very bottom
+|CTRL-W_K| CTRL-W K move current window to the very top
+|CTRL-W_L| CTRL-W L move current window to the far right
+|CTRL-W_P| CTRL-W P go to preview window
+|CTRL-W_R| CTRL-W R rotate windows upwards N times
+|CTRL-W_S| CTRL-W S same as "CTRL-W s"
+|CTRL-W_W| CTRL-W W go to N previous window (wrap around)
+|CTRL-W_]| CTRL-W ] split window and jump to tag under cursor
+|CTRL-W_^| CTRL-W ^ split current window and edit alternate
+ file N
+|CTRL-W__| CTRL-W _ set current window height to N (default:
+ very high)
+|CTRL-W_b| CTRL-W b go to bottom window
+|CTRL-W_c| CTRL-W c close current window (like |:close|)
+|CTRL-W_d| CTRL-W d split window and jump to definition under
+ the cursor
+|CTRL-W_f| CTRL-W f split window and edit file name under the
+ cursor
+|CTRL-W_g_CTRL-]| CTRL-W g CTRL-] split window and do |:tjump| to tag under
+ cursor
+|CTRL-W_g]| CTRL-W g ] split window and do |:tselect| for tag
+ under cursor
+|CTRL-W_g}| CTRL-W g } do a |:ptjump| to the tag under the cursor
+|CTRL-W_h| CTRL-W h go to Nth left window (stop at first window)
+|CTRL-W_i| CTRL-W i split window and jump to declaration of
+ identifier under the cursor
+|CTRL-W_j| CTRL-W j go N windows down (stop at last window)
+|CTRL-W_k| CTRL-W k go N windows up (stop at first window)
+|CTRL-W_l| CTRL-W l go to Nth right window (stop at last window)
+|CTRL-W_n| CTRL-W n open new window, N lines high
+|CTRL-W_o| CTRL-W o close all but current window (like |:only|)
+|CTRL-W_p| CTRL-W p go to previous (last accessed) window
+|CTRL-W_q| CTRL-W q quit current window (like |:quit|)
+|CTRL-W_r| CTRL-W r rotate windows downwards N times
+|CTRL-W_s| CTRL-W s split current window in two parts, new
+ window N lines high
+|CTRL-W_t| CTRL-W t go to top window
+|CTRL-W_v| CTRL-W v split current window vertically, new window
+ N lines wide
+|CTRL-W_w| CTRL-W w go to N next window (wrap around)
+|CTRL-W_x| CTRL-W x exchange current window with window N
+ (default: next window)
+|CTRL-W_z| CTRL-W z close preview window
+|CTRL-W_bar| CTRL-W | set window width to N columns
+|CTRL-W_}| CTRL-W } show tag under cursor in preview window
+|CTRL-W_<Down>| CTRL-W <Down> same as "CTRL-W j"
+|CTRL-W_<Up>| CTRL-W <Up> same as "CTRL-W k"
+|CTRL-W_<Left>| CTRL-W <Left> same as "CTRL-W h"
+|CTRL-W_<Right>| CTRL-W <Right> same as "CTRL-W l"
+
+==============================================================================
+2.3 Square bracket commands *[* *]*
+
+tag char note action in Normal mode ~
+------------------------------------------------------------------------------
+|[_CTRL-D| [ CTRL-D jump to first #define found in current and
+ included files matching the word under the
+ cursor, start searching at beginning of
+ current file
+|[_CTRL-I| [ CTRL-I jump to first line in current and included
+ files that contains the word under the
+ cursor, start searching at beginning of
+ current file
+|[#| [# 1 cursor to N previous unmatched #if, #else
+ or #ifdef
+|['| [' 1 cursor to previous lowercase mark, on first
+ non-blank
+|[(| [( 1 cursor N times back to unmatched '('
+|[star| [* 1 same as "[/"
+|[`| [` 1 cursor to previous lowercase mark
+|[/| [/ 1 cursor to N previous start of a C comment
+|[D| [D list all defines found in current and
+ included files matching the word under the
+ cursor, start searching at beginning of
+ current file
+|[I| [I list all lines found in current and
+ included files that contain the word under
+ the cursor, start searching at beginning of
+ current file
+|[P| [P 2 same as "[p"
+|[[| [[ 1 cursor N sections backward
+|[]| [] 1 cursor N SECTIONS backward
+|[c| [c 1 cursor N times backwards to start of change
+|[d| [d show first #define found in current and
+ included files matching the word under the
+ cursor, start searching at beginning of
+ current file
+|[f| [f same as "gf"
+|[i| [i show first line found in current and
+ included files that contains the word under
+ the cursor, start searching at beginning of
+ current file
+|[p| [p 2 like "P", but adjust indent to current line
+|[m| [m 1 cursor N times back to start of member
+ function
+|[z| [z 1 move to start of open fold
+|[{| [{ 1 cursor N times back to unmatched '{'
+|[<MiddleMouse> [<MiddleMouse> 2 same as "[p"
+
+|]_CTRL-D| ] CTRL-D jump to first #define found in current and
+ included files matching the word under the
+ cursor, start searching at cursor position
+|]_CTRL-I| ] CTRL-I jump to first line in current and included
+ files that contains the word under the
+ cursor, start searching at cursor position
+|]#| ]# 1 cursor to N next unmatched #endif or #else
+|]'| ]' 1 cursor to next lowercase mark, on first
+ non-blank
+|])| ]) 1 cursor N times forward to unmatched ')'
+|]star| ]* 1 same as "]/"
+|]`| ]` 1 cursor to next lowercase mark
+|]/| ]/ 1 cursor to N next end of a C comment
+|]D| ]D list all #defines found in current and
+ included files matching the word under the
+ cursor, start searching at cursor position
+|]I| ]I list all lines found in current and
+ included files that contain the word under
+ the cursor, start searching at cursor
+ position
+|]P| ]P 2 same as "[p"
+|][| ][ 1 cursor N SECTIONS forward
+|]]| ]] 1 cursor N sections forward
+|]c| ]c 1 cursor N times forward to start of change
+|]d| ]d show first #define found in current and
+ included files matching the word under the
+ cursor, start searching at cursor position
+|]f| ]f same as "gf"
+|]i| ]i show first line found in current and
+ included files that contains the word under
+ the cursor, start searching at cursor
+ position
+|]p| ]p 2 like "p", but adjust indent to current line
+|]m| ]m 1 cursor N times forward to end of member
+ function
+|]z| ]z 1 move to end of open fold
+|]}| ]} 1 cursor N times forward to unmatched '}'
+|]<MiddleMouse> ]<MiddleMouse> 2 same as "]p"
+
+==============================================================================
+2.4 Commands starting with 'g' *g*
+
+tag char note action in Normal mode ~
+------------------------------------------------------------------------------
+|g_CTRL-A| g CTRL-A only when compiled with MEM_PROFILE
+ defined: dump a memory profile
+|g_CTRL-G| g CTRL-G show information about current cursor
+ position
+|g_CTRL-H| g CTRL-H start Select block mode
+|g_CTRL-]| g CTRL-] |:tjump| to the tag under the cursor
+|g#| g# 1 like "#", but without using "\<" and "\>"
+|g$| g$ 1 when 'wrap' off go to rightmost character of
+ the current line that is on the screen;
+ when 'wrap' on go to the rightmost character
+ of the current screen line
+|g&| g& 2 repeat last ":s" on all lines
+|g'| g'{mark} 1 like |'| but without changing the jumplist
+|g`| g`{mark} 1 like |`| but without changing the jumplist
+|gstar| g* 1 like "*", but without using "\<" and "\>"
+|g0| g0 1 when 'wrap' off go to leftmost character of
+ the current line that is on the screen;
+ when 'wrap' on go to the leftmost character
+ of the current screen line
+|g8| g8 print hex value of bytes used in UTF-8
+ character under the cursor
+|g?| g? 2 Rot13 encoding operator
+|g?g?| g?? 2 Rot13 encode current line
+|g?g?| g?g? 2 Rot13 encode current line
+|gD| gD 1 go to definition of word under the cursor
+ in current file
+|gE| gE 1 go backwards to the end of the previous
+ WORD
+|gH| gH start Select line mode
+|gI| gI 2 like "I", but always start in column 1
+|gJ| gJ 2 join lines without inserting space
+|gP| ["x]gP 2 put the text [from register x] before the
+ cursor N times, leave the cursor after it
+|gR| gR 2 enter Virtual Replace mode
+|gU| gU{motion} 2 make Nmove text uppercase
+|gV| gV don't reselect the previous Visual area
+ when executing a mapping or menu in Select
+ mode
+|g]| g] :tselect on the tag under the cursor
+|g^| g^ 1 when 'wrap' off go to leftmost non-white
+ character of the current line that is on
+ the screen; when 'wrap' on go to the
+ leftmost non-white character of the current
+ screen line
+|ga| ga print ascii value of character under the
+ cursor
+|gd| gd 1 go to definition of word under the cursor
+ in current function
+|ge| ge 1 go backwards to the end of the previous
+ word
+|gf| gf start editing the file whose name is under
+ the cursor
+|gg| gg 1 cursor to line N, default first line
+|gh| gh start Select mode
+|gi| gi 2 like "i", but first move to the |'^| mark
+|gj| gj 1 like "j", but when 'wrap' on go N screen
+ lines down
+|gk| gk 1 like "k", but when 'wrap' on go N screen
+ lines up
+|gm| gm 1 go to character at middle of the screenline
+|go| go 1 cursor to byte N in the buffer
+|gp| ["x]gp 2 put the text [from register x] after the
+ cursor N times, leave the cursor after it
+|gq| gq{motion} 2 format Nmove text
+|gr| gr{char} 2 virtual replace N chars with {char}
+|gs| gs go to sleep for N seconds (default 1)
+|gu| gu{motion} 2 make Nmove text lowercase
+|gv| gv reselect the previous Visual area
+|gw| gw{motion} 2 format Nmove text and keep cursor
+|g~| g~{motion} 2 swap case for Nmove text
+|g<Down>| g<Down> 1 same as "gj"
+|g<End>| g<End> 1 same as "g$"
+|g<Home>| g<Home> 1 same as "g0"
+|g<LeftMouse>| g<LeftMouse> same as <C-LeftMouse>
+ g<MiddleMouse> same as <C-MiddleMouse>
+|g<RightMouse>| g<RightMouse> same as <C-RightMouse>
+|g<Up>| g<Up> 1 same as "gk"
+
+==============================================================================
+2.5 Commands starting with 'z' *z*
+
+tag char note action in Normal mode ~
+------------------------------------------------------------------------------
+|z<CR>| z<CR> redraw, cursor line to top of window,
+ cursor on first non-blank
+|zN<CR>| z{height}<CR> redraw, make window {height} lines high
+|z+| z+ cursor on line N (default line below
+ window), otherwise like "z<CR>"
+|z-| z- redraw, cursor line at bottom of window,
+ cursor on first non-blank
+|z.| z. redraw, cursor line to center of window,
+ cursor on first non-blank
+|zA| zA open a closed fold or close an open fold
+ recursively
+|zC| zC close folds recursively
+|zD| zD delete folds recursively
+|zE| zE eliminate all folds
+|zF| zF create a fold for N lines
+|zM| zM set 'foldlevel' to zero
+|zN| zN set 'foldenable'
+|zO| zO open folds recursively
+|zR| zR set 'foldlevel' to the deepest fold
+|zX| zX re-apply 'foldlevel'
+|z^| z^ cursor on line N (default line above
+ window), otherwise like "z-"
+|za| za open a closed fold, close an open fold
+|zb| zb redraw, cursor line at bottom of window
+|zc| zc close a fold
+|zd| zd delete a fold
+|ze| ze when 'wrap' off scroll horizontally to
+ position the cursor at the end (right side)
+ of the screen
+|zf| zf{motion} create a fold for Nmove text
+|zh| zh when 'wrap' off scroll screen N characters
+ to the right
+|zi| zi toggle 'foldenable'
+|zj| zj 1 move to the start of the next fold
+|zk| zk 1 move to the end of the previous fold
+|zl| zl when 'wrap' off scroll screen N characters
+ to the left
+|zm| zm subtract one from 'foldlevel'
+|zn| zn reset 'foldenable'
+|zo| zo open fold
+|zr| zr add one to 'foldlevel'
+|zs| zs when 'wrap' off scroll horizontally to
+ position the cursor at the start (left
+ side) of the screen
+|zt| zt redraw, cursor line at top of window
+|zv| zv open enough folds to view the cursor line
+|zx| zx re-apply 'foldlevel' and do "zv"
+|zz| zz redraw, cursor line at center of window
+|z<Left>| z<Left> same as "zh"
+|z<Right>| z<Right> same as "zl"
+
+==============================================================================
+3. Visual mode *visual-index*
+
+Most commands in Visual mode are the same as in Normal mode. The ones listed
+here are those that are different.
+
+tag command note action in Visual mode ~
+------------------------------------------------------------------------------
+|v_CTRL-\_CTRL-N| CTRL-\ CTRL-N stop Visual mode
+|v_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode'
+|v_CTRL-G| CTRL-G toggle between Visual mode and Select mode
+|v_<BS>| <BS> 2 Select mode: delete highlighted area
+|v_CTRL-H| CTRL-H 2 same as <BS>
+|v_CTRL-O| CTRL-O switch from Select to Visual mode for one
+ command
+|v_CTRL-V| CTRL-V make Visual mode blockwise or stop Visual
+ mode
+|v_CTRL-]| CTRL-] jump to highlighted tag
+|v_!| !{filter} 2 filter the highlighted lines through the
+ external command {filter}
+|v_:| : start a command-line with the highlighted
+ lines as a range
+|v_<| < 2 shift the highlighted lines one
+ 'shiftwidth' left
+|v_=| = 2 filter the highlighted lines through the
+ external program given with the 'equalprg'
+ option
+|v_>| > 2 shift the highlighted lines one
+ 'shiftwidth' right
+|v_b_A| A 2 block mode: append same text in all lines,
+ after the highlighted area
+|v_C| C 2 delete the highlighted lines and start
+ insert
+|v_D| D 2 delete the highlighted lines
+|v_b_I| I 2 block mode: insert same text in all lines,
+ before the highlighted area
+|v_J| J 2 join the highlighted lines
+|v_K| K run 'keywordprg' on the highlighted area
+|v_O| O Move horizontally to other corner of area.
+ Q does not start Ex mode
+|v_R| R 2 delete the highlighted lines and start
+ insert
+|v_S| S 2 delete the highlighted lines and start
+ insert
+|v_U| U 2 make highlighted area uppercase
+|v_V| V make Visual mode linewise or stop Visual
+ mode
+|v_X| X 2 delete the highlighted lines
+|v_Y| Y yank the highlighted lines
+|v_a(| a( same as ab
+|v_a)| a) same as ab
+|v_a<| a< extend highlighted area with a <> block
+|v_a>| a> same as a<
+|v_aB| aB extend highlighted area with a {} block
+|v_aW| aW extend highlighted area with "a WORD"
+|v_a[| a[ extend highlighted area with a [] block
+|v_a]| a] same as a[
+|v_ab| ab extend highlighted area with a () block
+|v_ap| ap extend highlighted area with a paragraph
+|v_as| as extend highlighted area with a sentence
+|v_aw| aw extend highlighted area with "a word"
+|v_a{| a{ same as aB
+|v_a}| a} same as aB
+|v_c| c 2 delete highlighted area and start insert
+|v_d| d 2 delete highlighted area
+|v_gJ| gJ 2 join the highlighted lines without
+ inserting spaces
+|v_gq| gq 2 format the highlighted lines
+|v_gv| gv exchange current and previous highlighted
+ area
+|v_i(| i( same as ib
+|v_i)| i) same as ib
+|v_i<| i< extend highlighted area with inner <> block
+|v_i>| i> same as i<
+|v_iB| iB extend highlighted area with inner {} block
+|v_iW| iW extend highlighted area with "inner WORD"
+|v_i[| i[ extend highlighted area with inner [] block
+|v_i]| i] same as i[
+|v_ib| ib extend highlighted area with inner () block
+|v_ip| ip extend highlighted area with inner paragraph
+|v_is| is extend highlighted area with inner sentence
+|v_iw| iw extend highlighted area with "inner word"
+|v_i{| i{ same as iB
+|v_i}| i} same as iB
+|v_o| o move cursor to other corner of area
+|v_r| r 2 delete highlighted area and start insert
+|v_s| s 2 delete highlighted area and start insert
+|v_u| u 2 make highlighted area lowercase
+|v_v| v make Visual mode characterwise or stop
+ Visual mode
+|v_x| x 2 delete the highlighted area
+|v_y| y yank the highlighted area
+|v_~| ~ 2 swap case for the highlighted area
+
+==============================================================================
+4. Command-line editing *ex-edit-index*
+
+Get to the command-line with the ':', '!', '/' or '?' commands.
+Normal characters are inserted at the current cursor position.
+"Completion" below refers to context-sensitive completion. It will complete
+file names, tags, commands etc. as appropriate.
+
+ CTRL-@ not used
+|c_CTRL-A| CTRL-A do completion on the pattern in front of the
+ cursor and insert all matches
+|c_CTRL-B| CTRL-B cursor to begin of command-line
+|c_CTRL-C| CTRL-C same as <ESC>
+|c_CTRL-D| CTRL-D list completions that match the pattern in
+ front of the cursor
+|c_CTRL-E| CTRL-E cursor to end of command-line
+|'cedit'| CTRL-F default value for 'cedit': opens the
+ command-line window; otherwise not used
+ CTRL-G not used
+|c_<BS>| <BS> delete the character in front of the cursor
+|c_digraph| {char1} <BS> {char2}
+ enter digraph when 'digraph' is on
+|c_CTRL-H| CTRL-H same as <BS>
+|c_<Tab>| <Tab> if 'wildchar' is <Tab>: Do completion on
+ the pattern in front of the cursor
+|c_<S-Tab>| <S-Tab> same as CTRL-P
+|c_wildchar| 'wildchar' Do completion on the pattern in front of the
+ cursor (default: <Tab>)
+|c_CTRL-I| CTRL-I same as <Tab>
+|c_<NL>| <NL> same as <CR>
+|c_CTRL-J| CTRL-J same as <CR>
+|c_CTRL-K| CTRL-K {char1} {char2}
+ enter digraph
+|c_CTRL-L| CTRL-L do completion on the pattern in front of the
+ cursor and insert the longest common part
+|c_<CR>| <CR> execute entered command
+|c_<CR>| CTRL-M same as <CR>
+|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
+ go to next match, otherwise: same as <Down>
+ CTRL-O not used
+|c_CTRL-P| CTRL-P after using 'wildchar' with multiple matches:
+ go to previous match, otherwise: same as <Up>
+|c_CTRL-Q| CTRL-Q same as CTRL-V, unless it's used for terminal
+ control flow
+|c_CTRL-R| CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
+ insert the contents of a register or object
+ under the cursor as if typed
+|c_CTRL-R_CTRL-R| CTRL-R CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
+ insert the contents of a register or object
+ under the cursor literally
+ CTRL-S (used for terminal control flow)
+ CTRL-T not used
+|c_CTRL-U| CTRL-U remove all characters
+|c_CTRL-V| CTRL-V insert next non-digit literally, insert three
+ digit decimal number as a single byte.
+|c_CTRL-W| CTRL-W delete the word in front of the cursor
+ CTRL-X not used (reserved for completion)
+ CTRL-Y copy (yank) modeless selection
+ CTRL-Z not used (reserved for suspend)
+|c_<Esc>| <Esc> abandon command-line without executing it
+|c_<Esc>| CTRL-[ same as <Esc>
+|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
+|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
+ abandon command-line
+ CTRL-\ a - d reserved for extensions
+|c_CTRL-\_e| CTRL-\ e {expr} replace the command line with the result of
+ {expr}
+ CTRL-\ f - z reserved for extensions
+ CTRL-\ others not used
+ CTRL-] not used
+|c_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
+|c_CTRL-_| CTRL-_ when 'allowrevins' set: change language
+ (Hebrew, Farsi)
+|c_<Del>| <Del> delete the character under the cursor
+
+|c_<Left>| <Left> cursor left
+|c_<S-Left>| <S-Left> cursor one word left
+|c_<C-Left>| <C-Left> cursor one word left
+|c_<Right>| <Right> cursor right
+|c_<S-Right>| <S-Right> cursor one word right
+|c_<C-Right>| <C-Right> cursor one word right
+|c_<Up>| <Up> recall previous command-line from history that
+ matches pattern in front of the cursor
+|c_<S-Up>| <S-Up> recall previous command-line from history
+|c_<Down>| <Down> recall next command-line from history that
+ matches pattern in front of the cursor
+|c_<S-Down>| <S-Down> recall next command-line from history
+|c_<Home>| <Home> cursor to start of command-line
+|c_<End>| <End> cursor to end of command-line
+|c_<PageDown>| <PageDown> same as <S-Down>
+|c_<PageUp>| <PageUp> same as <S-Up>
+|c_<Insert>| <Insert> toggle insert/overstrike mode
+|c_<LeftMouse>| <LeftMouse> cursor at mouse click
+
+You found it, Arthur! *holy-grail*
+
+==============================================================================
+5. EX commands *ex-cmd-index* *:index*
+
+This is a brief but complete listing of all the ":" commands, without
+mentioning any arguments. The optional part of the command name is inside [].
+The commands are sorted on the non-optional part of their name.
+
+|:!| :! filter lines or execute an external command
+|:!!| :!! repeat last ":!" command
+|:#| :# same as ":number"
+|:&| :& repeat last ":substitute"
+|:star| :* execute contents of a register
+|:<| :< shift lines one 'shiftwidth' left
+|:=| := print the cursor line number
+|:>| :> shift lines one 'shiftwidth' right
+|:@| :@ execute contents of a register
+|:@@| :@@ repeat the previous ":@"
+|:Next| :N[ext] go to previous file in the argument list
+|:Print| :P[rint] print lines
+|:X| :X ask for encryption key
+|:append| :a[ppend] append text
+|:abbreviate| :ab[breviate] enter abbreviation
+|:abclear| :abc[lear] remove all abbreviations
+|:aboveleft| :abo[veleft] make split window appear left or above
+|:all| :al[l] open a window for each file in the argument
+ list
+|:amenu| :am[enu] enter new menu item for all modes
+|:anoremenu| :an[oremenu] enter a new menu for all modes that will not
+ be remapped
+|:args| :ar[gs] print the argument list
+|:argadd| :arga[dd] add items to the argument list
+|:argdelete| :argd[elete] delete items from the argument list
+|:argedit| :arge[dit] add item to the argument list and edit it
+|:argdo| :argdo do a command on all items in the argument list
+|:argglobal| :argg[lobal] define the global argument list
+|:arglocal| :argl[ocal] define a local argument list
+|:argument| :argu[ment] go to specific file in the argument list
+|:ascii| :as[cii] print ascii value of character under the cursor
+|:autocmd| :au[tocmd] enter or show autocommands
+|:augroup| :aug[roup] select the autocommand group to use
+|:aunmenu| :aun[menu] remove menu for all modes
+|:buffer| :b[uffer] go to specific buffer in the buffer list
+|:bNext| :bN[ext] go to previous buffer in the buffer list
+|:ball| :ba[ll] open a window for each buffer in the buffer list
+|:badd| :bad[d] add buffer to the buffer list
+|:bdelete| :bd[elete] remove a buffer from the buffer list
+|:behave| :be[have] set mouse and selection behavior
+|:belowright| :bel[owright] make split window appear right or below
+|:bfirst| :bf[irst] go to first buffer in the buffer list
+|:blast| :bl[ast] go to last buffer in the buffer list
+|:bmodified| :bm[odified] go to next buffer in the buffer list that has
+ been modified
+|:bnext| :bn[ext] go to next buffer in the buffer list
+|:botright| :bo[tright] make split window appear at bottom or far right
+|:bprevious| :bp[revious] go to previous buffer in the buffer list
+|:brewind| :br[ewind] go to first buffer in the buffer list
+|:break| :brea[k] break out of while loop
+|:breakadd| :breaka[dd] add a debugger breakpoint
+|:breakdel| :breakd[el] delete a debugger breakpoint
+|:breaklist| :breakl[ist] list debugger breakpoints
+|:browse| :bro[wse] use file selection dialog
+|:bufdo| :bufdo execute command in each listed buffer
+|:buffers| :buffers list all files in the buffer list
+|:bunload| :bun[load] unload a specific buffer
+|:bwipeout| :bw[ipeout] really delete a buffer
+|:change| :c[hange] replace a line or series of lines
+|:cNext| :cN[ext] go to previous error
+|:cNfile| :cNf[ile] go to last error in previous file
+|:cabbrev| :ca[bbrev] like ":abbreviate" but for Command-line mode
+|:cabclear| :cabc[lear] clear all abbreviations for Command-line mode
+|:call| :cal[l] call a function
+|:catch| :cat[ch] part of a :try command
+|:cc| :cc go to specific error
+|:cclose| :ccl[ose] close quickfix window
+|:cd| :cd change directory
+|:center| :ce[nter] format lines at the center
+|:cfile| :cf[ile] read file with error messages and jump to first
+|:cfirst| :cfir[st] go to the specified error, default first one
+|:cgetfile| :cg[etfile] read file with error messages
+|:changes| :cha[nges] print the change list
+|:chdir| :chd[ir] change directory
+|:checkpath| :che[ckpath] list included files
+|:checktime| :checkt[ime] check timestamp of loaded buffers
+|:clist| :cl[ist] list all errors
+|:clast| :cla[st] go to the specified error, default last one
+|:close| :clo[se] close current window
+|:cmap| :cm[ap] like ":map" but for Command-line mode
+|:cmapclear| :cmapc[lear] clear all mappings for Command-line mode
+|:cmenu| :cme[nu] add menu for Command-line mode
+|:cnext| :cn[ext] go to next error
+|:cnewer| :cnew[er] go to newer error list
+|:cnfile| :cnf[ile] go to first error in next file
+|:cnoremap| :cno[remap] like ":noremap" but for Command-line mode
+|:cnoreabbrev| :cnorea[bbrev] like ":noreabbrev" but for Command-line mode
+|:cnoremenu| :cnoreme[nu] like ":noremenu" but for Command-line mode
+|:copy| :co[py] copy lines
+|:colder| :col[der] go to older error list
+|:colorscheme| :colo[rscheme] load a specific color scheme
+|:command| :com[mand] create user-defined command
+|:comclear| :comc[lear] clear all user-defined commands
+|:compiler| :comp[iler] do settings for a specific compiler
+|:continue| :con[tinue] go back to :while
+|:confirm| :conf[irm] prompt user when confirmation required
+|:copen| :cope[n] open quickfix window
+|:cprevious| :cp[revious] go to previous error
+|:cpfile| :cpf[ile] go to last error in previous file
+|:cquit| :cq[uit] quit Vim with an error code
+|:crewind| :cr[ewind] go to the specified error, default first one
+|:cscope| :cs[cope] execute cscope command
+|:cstag| :cst[ag] use cscope to jump to a tag
+|:cunmap| :cu[nmap] like ":unmap" but for Command-line mode
+|:cunabbrev| :cuna[bbrev] like ":unabbrev" but for Command-line mode
+|:cunmenu| :cunme[nu] remove menu for Command-line mode
+|:cwindow| :cw[indow] open or close quickfix window
+|:delete| :d[elete] delete lines
+|:debug| :deb[ug] run a command in debugging mode
+|:debuggreedy| :debugg[reedy] read debug mode commands from normal input
+|:delcommand| :delc[ommand] delete user-defined command
+|:delfunction| :delf[unction] delete a user function
+|:diffupdate| :dif[fupdate] update 'diff' buffers
+|:diffget| :diffg[et] remove differences in current buffer
+|:diffpatch| :diffp[atch] apply a patch and show differences
+|:diffput| :diffpu[t] remove differences in other buffer
+|:diffsplit| :diffs[plit] show differences with another file
+|:diffthis| :diffthis make current window a diff window
+|:digraphs| :dig[raphs] show or enter digraphs
+|:display| :di[splay] display registers
+|:djump| :dj[ump] jump to #define
+|:dlist| :dl[ist] list #defines
+|:doautocmd| :do[autocmd] apply autocommands to current buffer
+|:doautoall| :doautoa[ll] apply autocommands for all loaded buffers
+|:drop| :dr[op] jump to window editing file or edit file in
+ current window
+|:dsearch| :ds[earch] list one #define
+|:dsplit| :dsp[lit] split window and jump to #define
+|:edit| :e[dit] edit a file
+|:echo| :ec[ho] echoes the result of expressions
+|:echoerr| :echoe[rr] like :echo, show like an error and use history
+|:echohl| :echoh[l] set highlighting for echo commands
+|:echomsg| :echom[sg] same as :echo, put message in history
+|:echon| :echon same as :echo, but without <EOL>
+|:else| :el[se] part of an :if command
+|:elseif| :elsei[f] part of an :if command
+|:emenu| :em[enu] execute a menu by name
+|:endif| :en[dif] end previous :if
+|:endfunction| :endf[unction] end of a user function
+|:endtry| :endt[ry] end previous :try
+|:endwhile| :endw[hile] end previous :while
+|:enew| :ene[w] edit a new, unnamed buffer
+|:ex| :ex same as ":edit"
+|:execute| :exe[cute] execute result of expressions
+|:exit| :exi[t] same as ":xit"
+|:file| :f[ile] show or set the current file name
+|:files| :files list all files in the buffer list
+|:filetype| :filet[ype] switch file type detection on/off
+|:find| :fin[d] find file in 'path' and edit it
+|:finally| :fina[lly] part of a :try command
+|:finish| :fini[sh] quit sourcing a Vim script
+|:first| :fir[st] go to the first file in the argument list
+|:fixdel| :fix[del] set key code of <Del>
+|:fold| :fo[ld] create a fold
+|:foldclose| :foldc[lose] close folds
+|:folddoopen| :foldd[oopen] execute command on lines not in a closed fold
+|:folddoclosed| :folddoc[losed] execute command on lines in a closed fold
+|:foldopen| :foldo[pen] open folds
+|:function| :fu[nction] define a user function
+|:global| :g[lobal] execute commands for matching lines
+|:goto| :go[to] go to byte in the buffer
+|:grep| :gr[ep] run 'grepprg' and jump to first match
+|:grepadd| :grepa[dd] like grep, but append to current list
+|:gui| :gu[i] start the GUI
+|:gvim| :gv[im] start the GUI
+|:hardcopy| :ha[rdcopy] send text to the printer
+|:help| :h[elp] open a help window
+|:helpfind| :helpf[ind] dialog to open a help window
+|:helpgrep| :helpg[rep] like ":grep" but searches help files
+|:helptags| :helpt[ags] generate help tags for a directory
+|:highlight| :hi[ghlight] specify highlighting methods
+|:hide| :hid[e] hide current buffer for a command
+|:history| :his[tory] print a history list
+|:insert| :i[nsert] insert text
+|:iabbrev| :ia[bbrev] like ":abbrev" but for Insert mode
+|:iabclear| :iabc[lear] like ":abclear" but for Insert mode
+|:if| :if execute commands when condition met
+|:ijump| :ij[ump] jump to definition of identifier
+|:ilist| :il[ist] list lines where identifier matches
+|:imap| :im[ap] like ":map" but for Insert mode
+|:imapclear| :imapc[lear] like ":mapclear" but for Insert mode
+|:imenu| :ime[nu] add menu for Insert mode
+|:inoremap| :ino[remap] like ":noremap" but for Insert mode
+|:inoreabbrev| :inorea[bbrev] like ":noreabbrev" but for Insert mode
+|:inoremenu| :inoreme[nu] like ":noremenu" but for Insert mode
+|:intro| :int[ro] print the introductory message
+|:isearch| :is[earch] list one line where identifier matches
+|:isplit| :isp[lit] split window and jump to definition of
+ identifier
+|:iunmap| :iu[nmap] like ":unmap" but for Insert mode
+|:iunabbrev| :iuna[bbrev] like ":unabbrev" but for Insert mode
+|:iunmenu| :iunme[nu] remove menu for Insert mode
+|:join| :j[oin] join lines
+|:jumps| :ju[mps] print the jump list
+|:k| :k set a mark
+|:keepmarks| :kee[pmarks] following command keeps marks where they are
+|:keepjumps| :keepj[jumps] following command keeps jumplist and marks
+|:list| :l[ist] print lines
+|:last| :la[st] go to the last file in the argument list
+|:language| :lan[guage] set the language (locale)
+|:lcd| :lc[d] change directory locally
+|:lchdir| :lch[dir] change directory locally
+|:left| :le[ft] left align lines
+|:leftabove| :lefta[bove] make split window appear left or above
+|:let| :let assign a value to a variable or option
+|:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode
+|:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode
+|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
+|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
+|:loadview| :lo[adview] load view for current window from a file
+|:lockmarks| :loc[kmarks] following command keeps marks where they are
+|:ls| :ls list all buffers
+|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
+|:move| :m[ove] move lines
+|:mark| :ma[rk] set a mark
+|:make| :mak[e] execute external command 'makeprg' and parse
+ error messages
+|:map| :map show or enter a mapping
+|:mapclear| :mapc[lear] clear all mappings for Normal and Visual mode
+|:marks| :marks list all marks
+|:match| :mat[ch] define a match to highlight
+|:menu| :me[nu] enter a new menu item
+|:menutranslate| :menut[ranslate] add a menu translation item
+|:messages| :mes[sages] view previously displayed messages
+|:mkexrc| :mk[exrc] write current mappings and settings to a file
+|:mksession| :mks[ession] write session info to a file
+|:mkvimrc| :mkv[imrc] write current mappings and settings to a file
+|:mkview| :mkvie[w] write view of current window to a file
+|:mode| :mod[e] show or change the screen mode
+|:next| :n[ext] go to next file in the argument list
+|:new| :new create a new empty window
+|:nmap| :nm[ap] like ":map" but for Normal mode
+|:nmapclear| :nmapc[lear] clear all mappings for Normal mode
+|:nmenu| :nme[nu] add menu for Normal mode
+|:nnoremap| :nn[oremap] like ":noremap" but for Normal mode
+|:nnoremenu| :nnoreme[nu] like ":noremenu" but for Normal mode
+|:noremap| :no[remap] enter a mapping that will not be remapped
+|:nohlsearch| :noh[lsearch] suspend 'hlsearch' highlighting
+|:noreabbrev| :norea[bbrev] enter an abbreviation that will not be
+ remapped
+|:noremenu| :noreme[nu] enter a menu that will not be remapped
+|:normal| :norm[al] execute Normal mode commands
+|:number| :nu[mber] print lines with line number
+|:nunmap| :nun[map] like ":unmap" but for Normal mode
+|:nunmenu| :nunme[nu] remove menu for Normal mode
+|:open| :o[pen] start open mode (not implemented)
+|:omap| :om[ap] like ":map" but for Operator-pending mode
+|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
+|:omenu| :ome[nu] add menu for Operator-pending mode
+|:only| :on[ly] close all windows except current one
+|:onoremap| :ono[remap] like ":noremap" but for Operator-pending mode
+|:onoremenu| :onoreme[nu] like ":noremenu" but for Operator-pending mode
+|:options| :opt[ions] open the options-window
+|:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode
+|:ounmenu| :ounme[nu] remove menu for Operator-pending mode
+|:print| :p[rint] print lines
+|:pclose| :pc[lose] close preview window
+|:pedit| :ped[it] edit file in the preview window
+|:perl| :pe[rl] execute Perl command
+|:perldo| :perld[o] execute Perl command for each line
+|:pop| :po[p] jump to older entry in tag stack
+|:popup| :pop[up] popup a menu by name
+|:ppop| :pp[op] ":pop" in preview window
+|:preserve| :pre[serve] write all text to swap file
+|:previous| :prev[ious] go to previous file in argument list
+|:promptfind| :pro[mptfind] Search dialog
+|:promptrepl| :promptr[epl] Search/Replace dialog
+|:psearch| :ps[earch] like ":ijump" but shows match in preview window
+|:ptag| :pt[ag] show tag in preview window
+|:ptNext| :ptN[ext] |:tNext| in preview window
+|:ptfirst| :ptf[irst] |:trewind| in preview window
+|:ptjump| :ptj[ump] |:tjump| and show tag in preview window
+|:ptlast| :ptl[ast] |:tlast| in preview window
+|:ptnext| :ptn[ext] |:tnext| in preview window
+|:ptprevious| :ptp[revious] |:tprevious| in preview window
+|:ptrewind| :ptr[ewind] |:trewind| in preview window
+|:ptselect| :pts[elect] |:tselect| and show tag in preview window
+|:put| :pu[t] insert contents of register in the text
+|:pwd| :pw[d] print current directory
+|:python| :py[thon] execute Python command
+|:pyfile| :pyf[ile] execute Python script file
+|:quit| :q[uit] quit current window (when one window quit Vim)
+|:quitall| :quita[ll] quit Vim
+|:qall| :qa[ll] quit Vim
+|:read| :r[ead] read file into the text
+|:recover| :rec[over] recover a file from a swap file
+|:redo| :red[o] redo one undone change
+|:redir| :redi[r] redirect messages to a file or register
+|:redraw| :redr[aw] force a redraw of the display
+|:redrawstatus| :redraws[tatus] force a redraw of the status line(s)
+|:registers| :reg[isters] display the contents of registers
+|:resize| :res[ize] change current window height
+|:retab| :ret[ab] change tab size
+|:return| :retu[rn] return from a user function
+|:rewind| :rew[ind] go to the first file in the argument list
+|:right| :ri[ght] right align text
+|:rightbelow| :rightb[elow] make split window appear right or below
+|:ruby| :rub[y] execute Ruby command
+|:rubydo| :rubyd[o] execute Ruby command for each line
+|:rubyfile| :rubyf[ile] execute Ruby script file
+|:runtime| :ru[ntime] source vim scripts in 'runtimepath'
+|:rviminfo| :rv[iminfo] read from viminfo file
+|:substitute| :s[ubstitute] find and replace text
+|:sNext| :sN[ext] split window and go to previous file in
+ argument list
+|:sargument| :sa[rgument] split window and go to specific file in
+ argument list
+|:sall| :sal[l] open a window for each file in argument list
+|:saveas| :sav[eas] save file under another name.
+|:sbuffer| :sb[uffer] split window and go to specific file in the
+ buffer list
+|:sbNext| :sbN[ext] split window and go to previous file in the
+ buffer list
+|:sball| :sba[ll] open a window for each file in the buffer list
+|:sbfirst| :sbf[irst] split window and go to first file in the
+ buffer list
+|:sblast| :sbl[ast] split window and go to last file in buffer
+ list
+|:sbmodified| :sbm[odified] split window and go to modified file in the
+ buffer list
+|:sbnext| :sbn[ext] split window and go to next file in the buffer
+ list
+|:sbprevious| :sbp[revious] split window and go to previous file in the
+ buffer list
+|:sbrewind| :sbr[ewind] split window and go to first file in the
+ buffer list
+|:scriptnames| :scrip[tnames] list names of all sourced Vim scripts
+|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script
+|:scscope| :scs[cope] split window and execute cscope command
+|:set| :se[t] show or set options
+|:setfiletype| :setf[iletype] set 'filetype', unless it was set already
+|:setglobal| :setg[lobal] show global values of options
+|:setlocal| :setl[ocal] show or set options locally
+|:sfind| :sf[ind] split current window and edit file in 'path'
+|:sfirst| :sfir[st] split window and go to first file in the
+ argument list
+|:shell| :sh[ell] escape to a shell
+|:simalt| :sim[alt] Win32 GUI: simulate Windows ALT key
+|:sign| :sig[n] manipulate signs
+|:silent| :sil[ent] Run a command silently
+|:sleep| :sl[eep] do nothing for a few seconds
+|:slast| :sla[st] split window and go to last file in the
+ argument list
+|:smagic| :sm[agic] :substitute with 'magic'
+|:snext| :sn[ext] split window and go to next file in the
+ argument list
+|:sniff| :sni[ff] send request to sniff
+|:snomagic| :sno[magic] :substitute with 'nomagic'
+|:source| :so[urce] read Vim or Ex commands from a file
+|:split| :sp[lit] split current window
+|:sprevious| :spr[evious] split window and go to previous file in the
+ argument list
+|:srewind| :sre[wind] split window and go to first file in the
+ argument list
+|:stop| :st[op] suspend the editor or escape to a shell
+|:stag| :sta[g] split window and jump to a tag
+|:startinsert| :star[tinsert] start Insert mode
+|:stopinsert|| :stopi[nsert] stop Insert mode
+|:stjump| :stj[ump] do ":tjump" and split window
+|:stselect| :sts[elect] do ":tselect" and split window
+|:sunhide| :sun[hide] same as ":unhide"
+|:suspend| :sus[pend] same as ":stop"
+|:sview| :sv[iew] split window and edit file read-only
+|:swapname| :sw[apname] show the name of the current swap file
+|:syntax| :sy[ntax] syntax highlighting
+|:syncbind| :sync[bind] sync scroll binding
+|:t| :t same as ":copy"
+|:tNext| :tN[ext] jump to previous matching tag
+|:tag| :ta[g] jump to tag
+|:tags| :tags show the contents of the tag stack
+|:tcl| :tc[l] execute Tcl command
+|:tcldo| :tcld[o] execute Tcl command for each line
+|:tclfile| :tclf[ile] execute Tcl script file
+|:tearoff| :te[aroff] tear-off a menu
+|:tfirst| :tf[irst] jump to first matching tag
+|:throw| :th[row] throw an exception
+|:tjump| :tj[ump] like ":tselect", but jump directly when there
+ is only one match
+|:tlast| :tl[ast] jump to last matching tag
+|:tmenu| :tm[enu] define menu tooltip
+|:tnext| :tn[ext] jump to next matching tag
+|:topleft| :to[pleft] make split window appear at top or far left
+|:tprevious| :tp[revious] jump to previous matching tag
+|:trewind| :tr[ewind] jump to first matching tag
+|:try| :try execute commands, abort on error or exception
+|:tselect| :ts[elect] list matching tags and select one
+|:tunmenu| :tu[nmenu] remove menu tooltip
+|:undo| :u[ndo] undo last change(s)
+|:unabbreviate| :una[bbreviate] remove abbreviation
+|:unhide| :unh[ide] open a window for each loaded file in the
+ buffer list
+|:unlet| :unl[et] delete variable
+|:unmap| :unm[ap] remove mapping
+|:unmenu| :unme[nu] remove menu
+|:update| :up[date] write buffer if modified
+|:vglobal| :v[global] execute commands for not matching lines
+|:version| :ve[rsion] print version number and other info
+|:verbose| :verb[ose] execute command with 'verbose' set
+|:vertical| :vert[ical] make following command split vertically
+|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
+|:view| :vie[w] edit a file read-only
+|:vmap| :vm[ap] like ":map" but for Visual mode
+|:vmapclear| :vmapc[lear] remove all mappings for Visual mode
+|:vmenu| :vme[nu] add menu for Visual mode
+|:vnoremap| :vn[oremap] like ":noremap" but for Visual mode
+|:vnew| :vne[w] create a new empty window, vertically split
+|:vnoremenu| :vnoreme[nu] like ":noremenu" but for Visual mode
+|:vsplit| :vs[plit] split current window vertically
+|:vunmap| :vu[nmap] like ":unmap" but for Visual mode
+|:vunmenu| :vunme[nu] remove menu for Visual mode
+|:windo| :windo execute command in each window
+|:write| :w[rite] write to a file
+|:wNext| :wN[ext] write to a file and go to previous file in
+ argument list
+|:wall| :wa[ll] write all (changed) buffers
+|:while| :wh[ile] execute loop for as long as condition met
+|:winsize| :wi[nsize] get or set window size (obsolete)
+|:wincmd| :winc[md] execute a Window (CTRL-W) command
+|:winpos| :winp[os] get or set window position
+|:wnext| :wn[ext] write to a file and go to next file in
+ argument list
+|:wprevious| :wp[revious] write to a file and go to previous file in
+ argument list
+|:wq| :wq write to a file and quit window or Vim
+|:wqall| :wqa[ll] write all changed buffers and quit Vim
+|:wsverb| :ws[verb] pass the verb to workshop over IPC
+|:wviminfo| :wv[iminfo] write to viminfo file
+|:xit| :x[it] write if buffer changed and quit window or Vim
+|:xall| :xa[ll] same as ":wqall"
+|:yank| :y[ank] yank lines into a register
+|:z| :z print some lines
+|:~| :~ repeat last ":substitute"
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
new file mode 100644
index 000000000..1439dbeaf
--- /dev/null
+++ b/runtime/doc/insert.txt
@@ -0,0 +1,1064 @@
+*insert.txt* For Vim version 7.0aa. Last change: 2004 Apr 09
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *Insert* *Insert-mode*
+Inserting and replacing text *mode-ins-repl*
+
+Most of this file is about Insert and Replace mode. At the end are a few
+commands for inserting text in other ways.
+
+An overview of the most often used commands can be found in chapter 24 of the
+user manual |usr_24.txt|.
+
+1. Special keys |ins-special-keys|
+2. Special special keys |ins-special-special|
+3. 'textwidth' and 'wrapmargin' options |ins-textwidth|
+4. 'expandtab', 'smarttab' and 'softtabstop' options |ins-expandtab|
+5. Replace mode |Replace-mode|
+6. Virtual Replace mode |Virtual-Replace-mode|
+7. Insert mode completion |ins-completion|
+8. Insert mode commands |inserting|
+9. Ex insert commands |inserting-ex|
+10. Inserting a file |inserting-file|
+
+Also see 'virtualedit', for moving the cursor to positions where there is no
+character. Useful for editing a table.
+
+==============================================================================
+1. Special keys *ins-special-keys*
+
+In Insert and Replace mode, the following characters have a special meaning;
+other characters are inserted directly. To insert one of these special
+characters into the buffer, precede it with CTRL-V. To insert a <Nul>
+character use "CTRL-V CTRL-@" or "CTRL-V 000". On some systems, you have to
+use "CTRL-V 003" to insert a CTRL-C. Note: When CTRL-V is mapped you can
+often use CTRL-Q instead |i_CTRL-Q|.
+
+If you are working in a special language mode when inserting text, see the
+'langmap' option, |'langmap'|, on how to avoid switching this mode on and off
+all the time.
+
+If you have 'insertmode' set, <Esc> and a few other keys get another meaning.
+See |'insertmode'|.
+
+char action ~
+-----------------------------------------------------------------------
+ *i_CTRL-[* *i_<Esc>*
+<Esc> or CTRL-[ End insert or Replace mode, go back to Normal mode. Finish
+ abbreviation.
+ Note: If your <Esc> key is hard to hit on your keyboard, train
+ yourself to use CTRL-[.
+ *i_CTRL-C*
+CTRL-C Quit insert mode, go back to Normal mode. Do not check for
+ abbreviations.
+
+ *i_CTRL-@*
+CTRL-@ Insert previously inserted text and stop insert. {Vi: only
+ when typed as first char, only up to 128 chars}
+ *i_CTRL-A*
+CTRL-A Insert previously inserted text. {not in Vi}
+
+ *i_CTRL-H* *i_<BS>* *i_BS*
+<BS> or CTRL-H Delete the character before the cursor (see |i_backspacing|
+ about joining lines).
+ See |:fixdel| if your <BS> key does not do what you want.
+ {Vi: does not delete autoindents}
+ *i_<Del>* *i_DEL*
+<Del> Delete the character under the cursor. If the cursor is at
+ the end of the line, and the 'backspace' option includes
+ "eol", delete the <EOL>; the next line is appended after the
+ current one.
+ See |:fixdel| if your <Del> key does not do what you want.
+ {not in Vi}
+ *i_CTRL-W*
+CTRL-W Delete the word before the cursor (see |i_backspacing| about
+ joining lines). See the section "word motions",
+ |word-motions|, for the definition of a word.
+ *i_CTRL-U*
+CTRL-U Delete all entered characters in the current line (see
+ |i_backspacing| about joining lines).
+
+ *i_CTRL-I* *i_<Tab>* *i_Tab*
+<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
+ equivalent number of spaces is inserted (use CTRL-V <Tab> to
+ avoid the expansion; use CTRL-Q <Tab> if CTRL-V is mapped
+ |i_CTRL-Q|). See also the 'smarttab' option and
+ |ins-expandtab|.
+ *i_CTRL-J* *i_<NL>*
+<NL> or CTRL-J Begin new line.
+ *i_CTRL-M* *i_<CR>*
+<CR> or CTRL-M Begin new line.
+ *i_CTRL-K*
+CTRL-K {char1} [char2]
+ Enter digraph (see |digraphs|). When {char1} is a special
+ key, the code for that key is inserted in <> form. For
+ example, the string "<S-Space>" can be entered by typing
+ <C-K><S-Space> (two keys). Neither char is considered for
+ mapping. {not in Vi}
+
+CTRL-N Find next keyword (see |i_CTRL-N|). {not in Vi}
+CTRL-P Find previous keyword (see |i_CTRL-P|). {not in Vi}
+
+CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
+ Insert the contents of a register. Between typing CTRL-R and
+ the second character, '"' will be displayed to indicate that
+ you are expected to enter the name of a register.
+ The text is inserted as if you typed it, but mappings and
+ abbreviations are not used. If you have options like
+ 'textwidth', 'formatoptions', or 'autoindent' set, this will
+ influence what will be inserted. This is different from what
+ happens with the "p" command and pasting with the mouse.
+ Special registers:
+ '"' the unnamed register, containing the text of
+ the last delete or yank
+ '%' the current file name
+ '#' the alternate file name
+ '*' the clipboard contents (X11: primary selection)
+ '+' the clipboard contents
+ '/' the last search pattern
+ ':' the last command-line
+ '.' the last inserted text
+ '-' the last small (less than a line) delete
+ '=' the expression register: you are prompted to
+ enter an expression (see |expression|)
+ See |registers| about registers. {not in Vi}
+
+CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
+ Insert the contents of a register. Works like using a single
+ CTRL-R, but the text is inserted literally, not as if typed.
+ This differs when the register contains characters like <BS>.
+ Example, where register a contains "ab^Hc": >
+ CTRL-R a results in "ac".
+ CTRL-R CTRL-R a results in "ab^Hc".
+< Options 'textwidth', 'formatoptions', etc. still apply. If
+ you also want to avoid these, use "<C-R><C-O>r", see below.
+ The '.' register (last inserted text) is still inserted as
+ typed. {not in Vi}
+
+CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
+ Insert the contents of a register literally and don't
+ auto-indent. Does the same as pasting with the mouse
+ |<MiddleMouse>|.
+ Does not replace characters!
+ The '.' register (last inserted text) is still inserted as
+ typed. {not in Vi}
+
+CTRL-R CTRL-P {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-P*
+ Insert the contents of a register literally and fix the
+ indent, like |[<MiddleMouse>|.
+ Does not replace characters!
+ The '.' register (last inserted text) is still inserted as
+ typed. {not in Vi}
+
+ *i_CTRL-T*
+CTRL-T Insert one shiftwidth of indent at the start of the current
+ line. The indent is always rounded to a 'shiftwidth' (this is
+ vi compatible). {Vi: only when in indent}
+ *i_CTRL-D*
+CTRL-D Delete one shiftwidth of indent at the start of the current
+ line. The indent is always rounded to a 'shiftwidth' (this is
+ vi compatible). {Vi: CTRL-D works only when used after
+ autoindent}
+ *i_0_CTRL-D*
+0 CTRL-D Delete all indent in the current line. {Vi: CTRL-D works
+ only when used after autoindent}
+ *i_^_CTRL-D*
+^ CTRL-D Delete all indent in the current line. The indent is
+ restored in the next line. This is useful when inserting a
+ label. {Vi: CTRL-D works only when used after autoindent}
+
+ *i_CTRL-V*
+CTRL-V Insert next non-digit literally. For special keys, the
+ terminal code is inserted. It's also possible to enter the
+ decimal, octal or hexadecimal value of a character
+ |i_CTRL-V_digit|.
+ The characters typed right after CTRL-V are not considered for
+ mapping. {Vi: no decimal byte entry}
+ Note: When CTRL-V is mapped (e.g., to paste text) you can
+ often use CTRL-Q instead |i_CTRL-Q|.
+
+ *i_CTRL-Q*
+CTRL-Q Same as CTRL-V.
+ Note: Some terminal connections may eat CTRL-Q, it doesn't
+ work then. It does work in the GUI.
+
+CTRL-X Enter CTRL-X mode. This is a sub-mode where commands can
+ be given to complete words or scroll the window. See
+ |i_CTRL-X| and |ins-completion|. {not in Vi}
+
+ *i_CTRL-E*
+CTRL-E Insert the character which is below the cursor. {not in Vi}
+ *i_CTRL-Y*
+CTRL-Y Insert the character which is above the cursor. {not in Vi}
+ Note that for CTRL-E and CTRL-Y 'textwidth' is not used, to be
+ able to copy characters from a long line.
+
+ *i_CTRL-_*
+CTRL-_ Switch between languages, as follows:
+ - When in a rightleft window, revins and nohkmap are toggled,
+ since English will likely be inserted in this case.
+ - When in a norightleft window, revins and hkmap are toggled,
+ since Hebrew will likely be inserted in this case.
+
+ CTRL-_ moves the cursor to the end of the typed text.
+
+ This command is only available when the 'allowrevins' option
+ is set.
+ Please refer to |rileft.txt| for more information about
+ right-to-left mode.
+ {not in Vi}
+ Only if compiled with the |+rightleft| feature (which is not
+ the default).
+ *i_CTRL-^*
+CTRL-^ Toggle the use of typing language characters.
+ When language |:lmap| mappings are defined:
+ - If 'iminsert' is 1 (langmap mappings used) it becomes 0 (no
+ langmap mappings used).
+ - If 'iminsert' has another value it becomes 1, thus langmap
+ mappings are enabled.
+ When no language mappings are defined:
+ - If 'iminsert' is 2 (Input Method used) it becomes 0 (no
+ Input Method used).
+ - If 'iminsert' has another value it becomes 2, thus the Input
+ Method is enabled.
+ When set to 1, the value of the "b:keymap_name" variable, the
+ 'keymap' option or "<lang>" appears in the status line.
+ The language mappings are normally used to type characters
+ that are different from what the keyboard produces. The
+ 'keymap' option can be used to install a whole number of them.
+ {not in Vi}
+
+ *i_CTRL-]*
+CTRL-] Trigger abbreviation, without inserting a character. {not in
+ Vi}
+
+ *i_<Insert>*
+<Insert> Toggle between Insert and Replace mode. {not in Vi}
+-----------------------------------------------------------------------
+
+ *i_backspacing*
+The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option
+(unless 'revins' is set). This is a comma separated list of items:
+
+item action ~
+indent allow backspacing over autoindent
+eol allow backspacing over end-of-line (join lines)
+start allow backspacing over the start position of insert; CTRL-W and
+ CTRL-U stop once at the start position
+
+When 'backspace' is empty, Vi compatible backspacing is used. You cannot
+backspace over autoindent, before column 1 or before where insert started.
+
+For backwards compatibility the values "0", "1" and "2" are also allowed, see
+|'backspace'|.
+
+If the 'backspace' option does contain "eol" and the cursor is in column 1
+when one of the three keys is used, the current line is joined with the
+previous line. This effectively deletes the <EOL> in front of the cursor.
+{Vi: does not cross lines, does not delete past start position of insert}
+
+ *i_CTRL-V_digit*
+With CTRL-V the decimal, octal or hexadecimal value of a character can be
+entered directly. This way you can enter any character, except a line break
+(<NL>, value 10). There are five ways to enter the character value:
+
+first char mode max nr of chars max value ~
+(none) decimal 3 255
+o or O octal 3 255
+x or X hexadecimal 2 ff (255)
+u hexadecimal 4 ffff (65535)
+U hexadecimal 8 7fffffff (2147483647)
+
+Normally you would type the maximum number of characters. Thus to enter a
+space (value 32) you would type <C-V>032. You can omit the leading zero, in
+which case the character typed after the number must be a non-digit. This
+happens for the other modes as well: As soon as you type a character that is
+invalid for the mode, the value before it will be used and the "invalid"
+character is dealt with in the normal way.
+
+If you enter a value of 10, it will end up in the file as a 0. The 10 is a
+<NL>, which is used internally to represent the <Nul> character. When writing
+the buffer to a file, the <NL> character is translated into <Nul>. The <NL>
+character is written at the end of each line. Thus if you want to insert a
+<NL> character in a file you will have to make a line break.
+
+ *i_CTRL-X* *insert_expand*
+CTRL-X enters a sub-mode where several commands can be used. Most of these
+commands do keyword completion; see |ins-completion|. These are not available
+when Vim was compiled without the |+insert_expand| feature.
+
+Two commands can be used to scroll the window up or down, without exiting
+insert mode:
+
+ *i_CTRL-X_CTRL-E*
+CTRL-X CTRL-E scroll window one line up.
+
+ *i_CTRL-X_CTRL-Y*
+CTRL-X CTRL-Y scroll window one line down.
+
+After CTRL-X is pressed, each CTRL-E (CTRL-Y) scrolls the window up (down) by
+one line unless that would cause the cursor to move from its current position
+in the file. As soon as another key is pressed, CTRL-X mode is exited and
+that key is interpreted as in Insert mode.
+
+
+==============================================================================
+2. Special special keys *ins-special-special*
+
+The following keys are special. They stop the current insert, do something,
+and then restart insertion. This means you can do something without getting
+out of Insert mode. This is very handy if you prefer to use the Insert mode
+all the time, just like editors that don't have a separate Normal mode. You
+may also want to set the 'backspace' option to "indent,eol,start" and set the
+'insertmode' option. You can use CTRL-O if you want to map a function key to
+a command.
+
+The changes (inserted or deleted characters) before and after these keys can
+be undone separately. Only the last change can be redone and always behaves
+like an "i" command.
+
+char action ~
+-----------------------------------------------------------------------
+<Up> cursor one line up *i_<Up>*
+<Down> cursor one line down *i_<Down>*
+CTRL-G <Up> cursor one line up, insert start column *i_CTRL-G_<Up>*
+CTRL-G k cursor one line up, insert start column *i_CTRL-G_k*
+CTRL-G CTRL-K cursor one line up, insert start column *i_CTRL-G_CTRL-K*
+CTRL-G <Down> cursor one line down, insert start column *i_CTRL-G_<Down>*
+CTRL-G j cursor one line down, insert start column *i_CTRL-G_j*
+CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
+<Left> cursor one character left *i_<Left>*
+<Right> cursor one character right *i_<Right>*
+<S-Left> cursor one word back (like "b" command) *i_<S-Left>*
+<C-Left> cursor one word back (like "b" command) *i_<C-Left>*
+<S-Right> cursor one word forward (like "w" command) *i_<S-Right>*
+<C-Right> cursor one word forward (like "w" command) *i_<C-Right>*
+<Home> cursor to first char in the line *i_<Home>*
+<End> cursor to after last char in the line *i_<End>*
+<C-Home> cursor to first char in the file *i_<C-Home>*
+<C-End> cursor to after last char in the file *i_<C-End>*
+<LeftMouse> cursor to position of mouse click *i_<LeftMouse>*
+<S-Up> move window one page up *i_<S-Up>*
+<PageUp> move window one page up *i_<PageUp>*
+<S-Down> move window one page down *i_<S-Down>*
+<PageDown> move window one page down *i_<PageDown>*
+<MouseDown> scroll three lines down *i_<MouseDown>*
+<S-MouseDown> scroll a full page down *i_<S-MouseDown>*
+<MouseUp> scroll three lines up *i_<MouseUp>*
+<S-MouseUp> scroll a full page up *i_<S-MouseUp>*
+CTRL-O execute one command, return to Insert mode *i_CTRL-O*
+CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
+-----------------------------------------------------------------------
+
+Note: If the cursor keys take you out of Insert mode, check the 'noesckeys'
+option.
+
+The CTRL-O command sometimes has a side effect: If the cursor was beyond the
+end of the line, it will be put on the last character in the line. In
+mappings it's often better to use <Esc> (first put an "x" in the text, <Esc>
+will then always put the cursor on it).
+
+The shifted cursor keys are not available on all terminals.
+
+Another side effect is that a count specified before the "i" or "a" command is
+ignored. That is because repeating the effect of the command after CTRL-O is
+too complicated.
+
+An example for using CTRL-G u: >
+
+ :inoremap <C-H> <C-G>u<C-H>
+
+This redefines the backspace key to start a new undo sequence. You can now
+undo the effect of the backspace key, without changing what you typed before
+that, with CTRL-O u.
+
+When the 'whichwrap' option is set appropriately, the <Left> and <Right>
+keys on the first/last character in the line make the cursor wrap to the
+previous/next line.
+
+The CTRL-G j and CTRL-G k commands can be used to insert text in front of a
+column. Example: >
+ int i;
+ int j;
+Position the cursor on the first "int", type "istatic<C-G>j ". The
+result is: >
+ static int i;
+ int j;
+When inserting the same text in front of the column in every line, use the
+Visual blockwise command "I" |v_b_I|.
+
+==============================================================================
+3. 'textwidth' and 'wrapmargin' options *ins-textwidth*
+
+The 'textwidth' option can be used to automatically break a line before it
+gets too long. Set the 'textwidth' option to the desired maximum line
+length. If you then type more characters (not spaces or tabs), the
+last word will be put on a new line (unless it is the only word on the
+line). If you set 'textwidth' to 0, this feature is disabled.
+
+The 'wrapmargin' option does almost the same. The difference is that
+'textwidth' has a fixed width while 'wrapmargin' depends on the width of the
+screen. When using 'wrapmargin' this is equal to using 'textwidth' with a
+value equal to (columns - 'wrapmargin'), where columns is the width of the
+screen.
+
+When 'textwidth' and 'wrapmargin' are both set, 'textwidth' is used.
+
+If you don't really want to break the line, but view the line wrapped at a
+convenient place, see the 'linebreak' option.
+
+The line is only broken automatically when using insert mode, or when
+appending to a line. When in replace mode and the line length is not
+changed, the line will not be broken.
+
+Long lines are broken if you enter a non-white character after the margin.
+The situations where a line will be broken can be restricted by adding
+characters to the 'formatoptions' option:
+"l" Only break a line if it was not longer than 'textwidth' when the insert
+ started.
+"v" Only break at a white character that has been entered during the
+ current insert command. This is mostly Vi-compatible.
+"lv" Only break if the line was not longer than 'textwidth' when the insert
+ started and only at a white character that has been entered during the
+ current insert command. Only differs from "l" when entering non-white
+ characters while crossing the 'textwidth' boundary.
+
+If you want to format a block of text, you can use the "gq" operator. Type
+"gq" and a movement command to move the cursor to the end of the block. In
+many cases, the command "gq}" will do what you want (format until the end of
+paragraph). Alternatively, you can use "gqap", which will format the whole
+paragraph, no matter where the cursor currently is. Or you can use Visual
+mode: hit "v", move to the end of the block, and type "gq". See also |gq|.
+
+==============================================================================
+4. 'expandtab', 'smarttab' and 'softtabstop' options *ins-expandtab*
+
+If the 'expandtab' option is on, spaces will be used to fill the amount of
+whitespace of the tab. If you want to enter a real <Tab>, type CTRL-V first
+(use CTRL-Q when CTRL-V is mapped |i_CTRL-Q|).
+The 'expandtab' option is off by default. Note that in Replace mode, a single
+character is replaced with several spaces. The result of this is that the
+number of characters in the line increases. Backspacing will delete one
+space at a time. The original character will be put back for only one space
+that you backspace over (the last one). {Vi does not have the 'expandtab'
+option}
+
+ *ins-smarttab*
+When the 'smarttab' option is on, a <Tab> inserts 'shiftwidth' positions at
+the beginning of a line and 'tabstop' positions in other places. This means
+that often spaces instead of a <Tab> character are inserted. When 'smarttab
+is off, a <Tab> always inserts 'tabstop' positions, and 'shiftwidth' is only
+used for ">>" and the like. {not in Vi}
+
+ *ins-softtabstop*
+When the 'softtabstop' option is non-zero, a <Tab> inserts 'softtabstop'
+positions, and a <BS> used to delete white space, will delete 'softtabstop'
+positions. This feels like 'tabstop' was set to 'softtabstop', but a real
+<Tab> character still takes 'tabstop' positions, so your file will still look
+correct when used by other applications.
+
+If 'softtabstop' is non-zero, a <BS> will try to delete as much white space to
+move to the previous 'softtabstop' position, except when the previously
+inserted character is a space, then it will only delete the character before
+the cursor. Otherwise you cannot always delete a single character before the
+cursor. You will have to delete 'softtabstop' characters first, and then type
+extra spaces to get where you want to be.
+
+==============================================================================
+5. Replace mode *Replace* *Replace-mode* *mode-replace*
+
+Enter Replace mode with the "R" command in normal mode.
+
+In Replace mode, one character in the line is deleted for every character you
+type. If there is no character to delete (at the end of the line), the
+typed character is appended (as in Insert mode). Thus the number of
+characters in a line stays the same until you get to the end of the line.
+If a <NL> is typed, a line break is inserted and no character is deleted.
+
+Be careful with <Tab> characters. If you type a normal printing character in
+its place, the number of characters is still the same, but the number of
+columns will become smaller.
+
+If you delete characters in Replace mode (with <BS>, CTRL-W, or CTRL-U), what
+happens is that you delete the changes. The characters that were replaced
+are restored. If you had typed past the existing text, the characters you
+added are deleted. This is effectively a character-at-a-time undo.
+
+If the 'expandtab' option is on, a <Tab> will replace one character with
+several spaces. The result of this is that the number of characters in the
+line increases. Backspacing will delete one space at a time. The original
+character will be put back for only one space that you backspace over (the
+last one). {Vi does not have the 'expandtab' option}
+
+==============================================================================
+6. Virtual Replace mode *vreplace-mode* *Virtual-Replace-mode*
+
+Enter Virtual Replace mode with the "gR" command in normal mode.
+{not available when compiled without the +vreplace feature}
+{Vi does not have Virtual Replace mode}
+
+Virtual Replace mode is similar to Replace mode, but instead of replacing
+actual characters in the file, you are replacing screen real estate, so that
+characters further on in the file never appear to move.
+
+So if you type a <Tab> it may replace several normal characters, and if you
+type a letter on top of a <Tab> it may not replace anything at all, since the
+<Tab> will still line up to the same place as before.
+
+Typing a <NL> still doesn't cause characters later in the file to appear to
+move. The rest of the current line will be replaced by the <NL> (that is,
+they are deleted), and replacing continues on the next line. A new line is
+NOT inserted unless you go past the end of the file.
+
+Interesting effects are seen when using CTRL-T and CTRL-D. The characters
+before the cursor are shifted sideways as normal, but characters later in the
+line still remain still. CTRL-T will hide some of the old line under the
+shifted characters, but CTRL-D will reveal them again.
+
+As with Replace mode, using <BS> etc will bring back the characters that were
+replaced. This still works in conjunction with 'smartindent', CTRL-T and
+CTRL-D, 'expandtab', 'smarttab', 'softtabstop', etc.
+
+In 'list' mode, Virtual Replace mode acts as if it was not in 'list' mode,
+unless "L" is in 'cpoptions'.
+
+Note that the only times characters beyond the cursor should appear to move
+are in 'list' mode, and occasionally when 'wrap' is set (and the line changes
+length to become shorter or wider than the width of the screen), or
+momentarily when typing over a CTRL character. A CTRL character takes up two
+screen spaces. When replacing it with two normal characters, the first will
+be inserted and the second will replace the CTRL character.
+
+This mode is very useful for editing <Tab> separated columns in tables, for
+entering new data while keeping all the columns aligned.
+
+==============================================================================
+7. Insert mode completion *ins-completion*
+
+In Insert and Replace modes, there are several commands to complete part of a
+keyword or line that has been typed. This is useful if you are using
+complicated keywords (e.g., function names with capitals and underscores).
+
+These commands are not available when the |+insert_expand| feature was
+disabled at compile time.
+
+Completion can be done for:
+
+1. Whole lines |i_CTRL-X_CTRL-L|
+2. keywords in the current file |i_CTRL-X_CTRL-N|
+3. keywords in 'dictionary' |i_CTRL-X_CTRL-K|
+4. keywords in 'thesaurus', thesaurus-style |i_CTRL-X_CTRL-T|
+5. keywords in the current and included files |i_CTRL-X_CTRL-I|
+6. tags |i_CTRL-X_CTRL-]|
+7. file names |i_CTRL-X_CTRL-F|
+8. definitions or macros |i_CTRL-X_CTRL-D|
+9. Vim command-line |i_CTRL-X_CTRL-V|
+10. keywords in 'complete' |i_CTRL-N|
+
+All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
+and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
+CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid
+CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next),
+and CTRL-P (previous).
+
+Also see the 'infercase' option if you want to adjust the case of the match.
+
+Note: The keys that are valid in CTRL-X mode are not mapped. This allows for
+":map ^F ^X^F" to work (where ^F is CTRL-F and ^X is CTRL-X). The key that
+ends CTRL-X mode (any key that is not a valid CTRL-X mode command) is mapped.
+Also, when doing completion with 'complete' mappings apply as usual.
+
+The following mappings are suggested to make typing the completion commands
+a bit easier (although they will hide other commands): >
+ :inoremap ^] ^X^]
+ :inoremap ^F ^X^F
+ :inoremap ^D ^X^D
+ :inoremap ^L ^X^L
+
+As a special case, typing CTRL-R to perform register insertion (see
+|i_CTRL-R|) will not exit CTRL-X mode. This is primarily to allow the use of
+the '=' register to call some function to determine the next operation. If
+the contents of the register (or result of the '=' register evaluation) are
+not valid CTRL-X mode keys, then CTRL-X mode will be exited as if those keys
+had been typed.
+
+For example, the following will map <Tab> to either actually insert a <Tab> if
+the current line is currently only whitespace, or start/continue a CTRL-N
+completion operation: >
+
+ function! CleverTab()
+ if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
+ return "\<Tab>"
+ else
+ return "\<C-N>"
+ endfunction
+ inoremap <Tab> <C-R>=CleverTab()<CR>
+
+
+
+Completing whole lines *compl-whole-line*
+
+ *i_CTRL-X_CTRL-L*
+CTRL-X CTRL-L Search backwards for a line that starts with the
+ same characters as in the current line before the
+ cursor. Indent is ignored. The found line is
+ inserted in front of the cursor.
+ The 'complete' option is used to decide in which
+ buffers a match is searched for. But only loaded
+ buffers are used.
+ CTRL-L or
+ CTRL-P Search backwards for next matching line. This line
+ replaces the previous matching line.
+
+ CTRL-N Search forward for next matching line. This line
+ replaces the previous matching line.
+
+ CTRL-X CTRL-L After expanding a line you can additionally get the
+ line next to it by typing CTRL-X CTRL-L again, unless
+ a double CTRL-X is used.
+
+Completing keywords in current file *compl-current*
+
+ *i_CTRL-X_CTRL-P*
+ *i_CTRL-X_CTRL-N*
+CTRL-X CTRL-N Search forwards for words that start with the keyword
+ in front of the cursor. The found keyword is inserted
+ in front of the cursor.
+
+CTRL-X CTRL-P Search backwards for words that start with the keyword
+ in front of the cursor. The found keyword is inserted
+ in front of the cursor.
+
+ CTRL-N Search forward for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-P Search backwards for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-X CTRL-N or
+ CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
+ copy the words following the previous expansion in
+ other contexts unless a double CTRL-X is used.
+
+If there is a keyword in front of the cursor (a name made out of alphabetic
+characters and characters in 'iskeyword'), it is used as the search pattern,
+with "\<" prepended (meaning: start of a word). Otherwise "\<\k\k" is used
+as search pattern (start of any keyword of at least two characters).
+
+In Replace mode, the number of characters that are replaced depends on the
+length of the matched string. This works like typing the characters of the
+matched string in Replace mode.
+
+If there is not a valid keyword character before the cursor, any keyword of
+at least two characters is matched.
+ e.g., to get:
+ printf("(%g, %g, %g)", vector[0], vector[1], vector[2]);
+ just type:
+ printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
+
+Multiple repeats of the same completion are skipped; thus a different match
+will be inserted at each CTRL-N and CTRL-P (unless there is only one
+matching keyword).
+
+Single character matches are never included, as they usually just get in
+the way of what you were really after.
+ e.g., to get:
+ printf("name = %s\n", name);
+ just type:
+ printf("name = %s\n", n^P);
+ or even:
+ printf("name = %s\n", ^P);
+The 'n' in '\n' is skipped.
+
+After expanding a word, you can use CTRL-X CTRL-P or CTRL-X CTRL-N to get the
+word following the expansion in other contexts. These sequences search for
+the text just expanded and further expand by getting an extra word. This is
+useful if you need to repeat a sequence of complicated words. Although CTRL-P
+and CTRL-N look just for strings of at least two characters, CTRL-X CTRL-P and
+CTRL-X CTRL-N can be used to expand words of just one character.
+ e.g., to get:
+ M&eacute;xico
+ you can type:
+ M^N^P^X^P^X^P
+CTRL-N starts the expansion and then CTRL-P takes back the single character
+"M", the next two CTRL-X CTRL-P's get the words "&eacute" and ";xico".
+
+If the previous expansion was split, because it got longer than 'textwidth',
+then just the text in the current line will be used.
+
+If the match found is at the end of a line, then the first word in the next
+line will be inserted and the message "word from next line" displayed, if
+this word is accepted the next CTRL-X CTRL-P or CTRL-X CTRL-N will search
+for those lines starting with this word.
+
+
+Completing keywords in 'dictionary' *compl-dictionary*
+
+ *i_CTRL-X_CTRL-K*
+CTRL-X CTRL-K Search the files given with the 'dictionary' option
+ for words that start with the keyword in front of the
+ cursor. This is like CTRL-N, but only the dictionary
+ files are searched, not the current file. The found
+ keyword is inserted in front of the cursor. This
+ could potentially be pretty slow, since all matches
+ are found before the first match is used. By default,
+ the 'dictionary' option is empty.
+ For suggestions where to find a list of words, see the
+ 'dictionary' option.
+
+ CTRL-K or
+ CTRL-N Search forward for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-P Search backwards for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ *i_CTRL-X_CTRL-T*
+CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
+ the 'thesaurus' option instead of 'dictionary'. If a
+ match is found in the thesaurus file, all the
+ remaining words on the same line are included as
+ matches, even though they don't complete the word.
+ Thus a word can be completely replaced.
+
+ For an example, imagine the 'thesaurus' file has a
+ line like this: >
+ angry furious mad enraged
+< Placing the cursor after the letters "ang" and typing
+ CTRL-X CTRL-T would complete the word "angry";
+ subsequent presses would change the word to "furious",
+ "mad" etc.
+ Other uses include translation between two languages,
+ or grouping API functions by keyword.
+
+ CTRL-T or
+ CTRL-N Search forward for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-P Search backwards for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+
+Completing keywords in the current and included files *compl-keyword*
+
+The 'include' option is used to specify a line that contains an include file
+name. The 'path' option is used to search for include files.
+
+ *i_CTRL-X_CTRL-I*
+CTRL-X CTRL-I Search for the first keyword in the current and
+ included files that starts with the same characters
+ as those before the cursor. The matched keyword is
+ inserted in front of the cursor.
+
+ CTRL-N Search forwards for next matching keyword. This
+ keyword replaces the previous matching keyword.
+ Note: CTRL-I is the same as <Tab>, which is likely to
+ be typed after a successful completion, therefore
+ CTRL-I is not used for searching for the next match.
+
+ CTRL-P Search backward for previous matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-X CTRL-I Further use of CTRL-X CTRL-I will copy the words
+ following the previous expansion in other contexts
+ unless a double CTRL-X is used.
+
+Completing tags *compl-tag*
+ *i_CTRL-X_CTRL-]*
+CTRL-X CTRL-] Search for the first tag that starts with the same
+ characters as before the cursor. The matching tag is
+ inserted in front of the cursor. Alphabetic
+ characters and characters in 'iskeyword' are used
+ to decide which characters are included in the tag
+ name (same as for a keyword). See also |CTRL-]|.
+ The 'showfulltag' option can be used to add context
+ from around the tag definition.
+ CTRL-] or
+ CTRL-N Search forwards for next matching tag. This tag
+ replaces the previous matching tag.
+
+ CTRL-P Search backward for previous matching tag. This tag
+ replaces the previous matching tag.
+
+
+Completing file names *compl-filename*
+ *i_CTRL-X_CTRL-F*
+CTRL-X CTRL-F Search for the first file name that starts with the
+ same characters as before the cursor. The matching
+ file name is inserted in front of the cursor.
+ Alphabetic characters and characters in 'isfname'
+ are used to decide which characters are included in
+ the file name. Note: the 'path' option is not used
+ here (yet).
+ CTRL-F or
+ CTRL-N Search forwards for next matching file name. This
+ file name replaces the previous matching file name.
+
+ CTRL-P Search backward for previous matching file name.
+ This file name replaces the previous matching file
+ name.
+
+
+Completing definitions or macros *compl-define*
+
+The 'define' option is used to specify a line that contains a definition.
+The 'include' option is used to specify a line that contains an include file
+name. The 'path' option is used to search for include files.
+
+ *i_CTRL-X_CTRL-D*
+CTRL-X CTRL-D Search in the current and included files for the
+ first definition (or macro) name that starts with
+ the same characters as before the cursor. The found
+ definition name is inserted in front of the cursor.
+ CTRL-D or
+ CTRL-N Search forwards for next matching macro name. This
+ macro name replaces the previous matching macro
+ name.
+
+ CTRL-P Search backward for previous matching macro name.
+ This macro name replaces the previous matching macro
+ name.
+
+ CTRL-X CTRL-D Further use of CTRL-X CTRL-D will copy the words
+ following the previous expansion in other contexts
+ unless a double CTRL-X is used.
+
+
+Completing Vim commands *compl-vim*
+
+Completion is context-sensitive. It works like on the Command-line. It
+completes an Ex command as well as its arguments.
+
+ *i_CTRL-X_CTRL-V*
+CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
+ find the first match for it.
+ Note: When CTRL-V is mapped you can often use CTRL-Q
+ instead |i_CTRL-Q|.
+ CTRL-V or
+ CTRL-N Search forwards for next match. This match replaces
+ the previous one.
+
+ CTRL-P Search backward for previous match. This match
+ replaces the previous one.
+
+ CTRL-X CTRL-V Further use of CTRL-X CTRL-V will do the same as
+ CTRL-V. This allows mapping a key to do Vim command
+ completion, for example: >
+ :imap <Tab> <C-X><C-V>
+
+Completing keywords from different sources *compl-generic*
+
+ *i_CTRL-N*
+CTRL-N Find next match for words that start with the
+ keyword in front of the cursor, looking in places
+ specified with the 'complete' option. The found
+ keyword is inserted in front of the cursor.
+
+ *i_CTRL-P*
+CTRL-P Find previous match for words that start with the
+ keyword in front of the cursor, looking in places
+ specified with the 'complete' option. The found
+ keyword is inserted in front of the cursor.
+
+ CTRL-N Search forward for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-P Search backwards for next matching keyword. This
+ keyword replaces the previous matching keyword.
+
+ CTRL-X CTRL-N or
+ CTRL-X CTRL-P Further use of CTRL-X CTRL-N or CTRL-X CTRL-P will
+ copy the words following the previous expansion in
+ other contexts unless a double CTRL-X is used.
+
+==============================================================================
+8. Insert mode commands *inserting*
+
+The following commands can be used to insert new text into the buffer. They
+can all be undone and repeated with the "." command.
+
+ *a*
+a Append text after the cursor [count] times. If the
+ cursor is in the first column of an empty line Insert
+ starts there. But not when 'virtualedit' is set!
+
+ *A*
+A Append text at the end of the line [count] times.
+
+<insert> or *i* *insert* *<Insert>*
+i Insert text before the cursor [count] times.
+ When using CTRL-O in Insert mode |i_CTRL-O| the count
+ is not supported.
+
+ *I*
+I Insert text before the first non-blank in the line
+ [count] times.
+
+ *gI*
+gI Insert text in column 1 [count] times. {not in Vi}
+
+ *gi*
+gi Insert text in the same position as where Insert mode
+ was stopped last time in the current buffer.
+ This uses the |'^| mark. It's different from "`^i"
+ when the mark is past the end of the line.
+ The position is corrected for inserted/deleted lines,
+ but NOT for inserted/deleted characters.
+ When the |:keepjumps| command modifier is used the |'^|
+ mark wont be changed.
+ {not in Vi}
+
+ *o*
+o Begin a new line below the cursor and insert text,
+ repeat [count] times. {Vi: blank [count] screen
+ lines}
+
+ *O*
+O Begin a new line above the cursor and insert text,
+ repeat [count] times. {Vi: blank [count] screen
+ lines}
+
+These commands are used to start inserting text. You can end insert mode with
+<Esc>. See |mode-ins-repl| for the other special characters in Insert mode.
+The effect of [count] takes place after Insert mode is exited.
+
+When 'autoindent' is on, the indent for a new line is obtained from the
+previous line. When 'smartindent' or 'cindent' is on, the indent for a line
+is automatically adjusted for C programs.
+
+'textwidth' can be set to the maximum width for a line. When a line becomes
+too long when appending characters a line break is automatically inserted.
+
+
+==============================================================================
+9. Ex insert commands *inserting-ex*
+
+ *:a* *:append*
+:{range}a[ppend] Insert several lines of text below the specified
+ line. If the {range} is missing, the text will be
+ inserted after the current line.
+
+ *:i* *:in* *:insert*
+:{range}i[nsert] Insert several lines of text above the specified
+ line. If the {range} is missing, the text will be
+ inserted before the current line.
+
+These two commands will keep on asking for lines, until you type a line
+containing only a ".". Watch out for lines starting with a backslash, see
+|line-continuation|.
+NOTE: ":append" and ":insert" don't work properly in between ":if" and
+":endif".
+
+ *:start* *:startinsert*
+:star[tinsert][!] Start Insert mode just after executing this command.
+ Works like typing "i" in Normal mode. When the ! is
+ included it works like "A", append to the line.
+ Otherwise insertion starts at the cursor position.
+ Note that when using this command in a function or
+ script, the insertion only starts after the function
+ or script is finished.
+ {not in Vi}
+ {not available when compiled without the +ex_extra
+ feature}
+
+ *:stopi* *:stopinsert*
+:stopi[nsert] Stop Insert mode as soon as possible. Works like
+ typing <Esc> in Insert mode.
+ Can be used in an autocommand, example: >
+ :au BufEnter scratch stopinsert
+
+==============================================================================
+10. Inserting a file *inserting-file*
+
+ *:r* *:re* *:read*
+:r[ead] [name] Insert the file [name] (default: current file) below
+ the cursor.
+
+:{range}r[ead] [name] Insert the file [name] (default: current file) below
+ the specified line.
+
+ *:r!* *:read!*
+:r[ead] !{cmd} Execute {cmd} and insert its standard output below
+ the cursor. A temporary file is used to store the
+ output of the command which is then read into the
+ buffer. 'shellredir' is used to save the output of
+ the command, which can be set to include stderr or
+ not. {cmd} is executed like with ":!{cmd}", any '!'
+ is replaced with the previous command |:!|.
+
+These commands insert the contents of a file, or the output of a command,
+into the buffer. They can be undone. They cannot be repeated with the "."
+command. They work on a line basis, insertion starts below the line in which
+the cursor is, or below the specified line. To insert text above the first
+line use the command ":0r {name}".
+
+After the ":read" command, the cursor is left on the first non-blank in the
+first new line. Unless in Ex mode, then the cursor is left on the last new
+line (sorry, this is Vi compatible).
+
+If a file name is given with ":r", it becomes the alternate file. This can be
+used, for example, when you want to edit that file instead: ":e! #". This can
+be switched off by removing the 'a' flag from the 'cpoptions' option.
+
+ *file-read*
+The 'fileformat' option sets the <EOL> style for a file:
+'fileformat' characters name ~
+ "dos" <CR><NL> or <NL> DOS format
+ "unix" <NL> Unix format
+ "mac" <CR> Mac format
+Previously 'textmode' was used. It is obsolete now.
+
+If 'fileformat' is "dos", a <CR> in front of an <NL> is ignored and a CTRL-Z
+at the end of the file is ignored.
+
+If 'fileformat' is "mac", a <NL> in the file is internally represented by a
+<CR>. This is to avoid confusion with a <NL> which is used to represent a
+<NUL>. See |CR-used-for-NL|.
+
+If the 'fileformats' option is not empty Vim tries to recognize the type of
+<EOL> (see |file-formats|). However, the 'fileformat' option will not be
+changed, the detected format is only used while reading the file.
+A similar thing happens with 'fileencodings'.
+
+On non-MS-DOS, Win32, and OS/2 systems the message "[dos format]" is shown if
+a file is read in DOS format, to remind you that something unusual is done.
+On Macintosh, MS-DOS, Win32, and OS/2 the message "[unix format]" is shown if
+a file is read in Unix format.
+On non-Macintosh systems, the message "[Mac format]" is shown if a file is
+read in Mac format.
+
+An example on how to use ":r !": >
+ :r !uuencode binfile binfile
+This command reads "binfile", uuencodes it and reads it into the current
+buffer. Useful when you are editing e-mail and want to include a binary
+file.
+
+ *read-messages*
+When reading a file Vim will display a message with information about the read
+file. In the table is an explanation for some of the items. The others are
+self explanatory. Using the long or the short version depends on the
+'shortmess' option.
+
+ long short meaning ~
+ [readonly] {RO} the file is write protected
+ [fifo/socket] using a stream
+ [fifo] using a fifo stream
+ [socket] using a socket stream
+ [CR missing] reading with "dos" 'fileformat' and a
+ NL without a preceding CR was found.
+ [NL found] reading with "mac" 'fileformat' and a
+ NL was found (could be "unix" format)
+ [long lines split] at least one line was split in two
+ [NOT converted] conversion from 'fileencoding' to
+ 'encoding' was desired but not
+ possible
+ [converted] conversion from 'fileencoding' to
+ 'encoding' done
+ [crypted] file was decrypted
+ [READ ERRORS] not all of the file could be read
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
new file mode 100644
index 000000000..8d3ac6ead
--- /dev/null
+++ b/runtime/doc/intro.txt
@@ -0,0 +1,890 @@
+*intro.txt* For Vim version 7.0aa. Last change: 2004 Jun 12
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Introduction to Vim *ref* *reference*
+
+1. Introduction |intro|
+2. Vim on the internet |internet|
+3. Credits |credits|
+4. Notation |notation|
+5. Modes, introduction |vim-modes-intro|
+6. Switching from mode to mode |mode-switching|
+7. The window contents |window-contents|
+8. Definitions |definitions|
+
+==============================================================================
+1. Introduction *intro*
+
+Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many
+improvements that a name change was appropriate. Vim is a text editor which
+includes almost all the commands from the Unix program "Vi" and a lot of new
+ones. It is very useful for editing programs and other plain text.
+ All commands are given with the keyboard. This has the advantage that you
+can keep your fingers on the keyboard and your eyes on the screen. For those
+who want it, there is mouse support and a GUI version with scrollbars and
+menus (see |gui.txt|).
+
+An overview of this manual can be found in the file "help.txt", |help.txt|.
+It can be accessed from within Vim with the <Help> or <F1> key and with the
+|:help| command (just type ":help", without the bars or quotes).
+ The 'helpfile' option can be set to the name of the help file, in case it
+is not located in the default place. You can jump to subjects like with tags:
+Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back.
+
+Throughout this manual the differences between Vi and Vim are mentioned in
+curly braces, like this: {Vi does not have on-line help}. See |vi_diff.txt|
+for a summary of the differences between Vim and Vi.
+
+This manual refers to Vim on various machines. There may be small differences
+between different computers and terminals. Besides the remarks given in this
+document, there is a separate document for each supported system, see
+|sys-file-list|.
+
+This manual is a reference for all the Vim commands and options. This is not
+an introduction to the use of Vi or Vim, it gets a bit complicated here and
+there. For beginners, there is a hands-on |tutor|. To learn using Vim, read
+the user manual |usr_toc.txt|.
+
+ *book*
+There are many books on Vi that contain a section for beginners. There are
+two books I can recommend:
+
+ "Vim - Vi Improved" by Steve Oualline
+
+This is the very first book completely dedicated to Vim. It is very good for
+beginners. The most often used commands are explained with pictures and
+examples. The less often used commands are also explained, the more advanced
+features are summarized. There is a comprehensive index and a quick
+reference. Parts of this book have been included in the user manual
+|frombook|.
+Published by New Riders Publishing. ISBN: 0735710015
+For more information try one of these:
+ http://iccf-holland.org/click5.html
+ http://www.vim.org/iccf/click5.html
+
+ "Learning the Vi editor" by Linda Lamb and Arnold Robbins
+
+This is a book about Vi that includes a chapter on Vim (in the sixth edition).
+The first steps in Vi are explained very well. The commands that Vim adds are
+only briefly mentioned. There is also a German translation.
+Published by O'Reilly. ISBN: 1-56592-426-6.
+
+==============================================================================
+2. Vim on the internet *internet*
+
+ *www* *faq* *FAQ* *distribution* *download*
+The Vim pages contain the most recent information about Vim. They also
+contain links to the most recent version of Vim. The FAQ is a list of
+Frequently Asked Questions. Read this if you have problems.
+
+ VIM home page: http://www.vim.org/
+ VIM FAQ: http://vimdoc.sf.net/
+ Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
+
+
+Usenet News group where Vim is discussed: *news* *usenet*
+ comp.editors
+This group is also for other editors. If you write about Vim, don't forget to
+mention that.
+
+ *mail-list* *maillist*
+There are several mailing lists for Vim:
+<vim@vim.org>
+ For discussions about using existing versions of Vim: Useful mappings,
+ questions, answers, where to get a specific version, etc.
+<vim-dev@vim.org> *vim-dev* *vimdev*
+ For discussions about changing Vim: New features, porting, patches,
+ beta-test versions, etc.
+<vim-announce@vim.org> *vim-announce*
+ Announcements about new versions of Vim; also for beta-test versions
+ and ports to different systems.
+<vim-multibyte@vim.org> *vim-multibyte*
+ For discussions about using and improving the multi-byte aspects of
+ Vim.
+<vim-mac@vim.org> *vim-mac*
+ For discussions about using and improving the Macintosh version of
+ Vim.
+
+See http://www.vim.org/maillist.php for the latest information.
+
+NOTE:
+- You can only send messages to these lists if you have subscribed!
+- You need to send the messages from the same location as where you subscribed
+ from (to avoid spam mail).
+- Maximum message size is 40000 characters.
+
+ *subscribe-maillist*
+If you want to join, send a message to
+ <vim-help@vim.org>
+Make sure that your "From:" address is correct. Then the list server will
+give you help on how to subscribe.
+
+You can retrieve old messages from the maillist software, and an index of
+messages. Ask vim-help for instructions.
+
+Archives are kept at: *maillist-archive*
+http://groups.yahoo.com/group/vim
+http://groups.yahoo.com/group/vimdev
+http://groups.yahoo.com/group/vimannounce
+http://groups.yahoo.com/group/vim-multibyte
+http://groups.yahoo.com/group/vim-mac
+
+
+Additional maillists:
+
+<vim-fr@club.voila.fr> *french-maillist*
+ Vim list in the French language. Subscribe by sending a message to
+ <vim-fr-subscribe@club.voila.fr>
+ Or go to http://groups.yahoo.com/group/vim-fr.
+
+
+Bug reports: *bugs* *bug-reports* *bugreport.vim*
+
+Send bug reports to: Vim bugs <bugs@vim.org>
+This is not a maillist but the message is redirected to the Vim maintainer.
+Please be brief; all the time that is spent on answering mail is subtracted
+from the time that is spent on improving Vim! Always give a reproducible
+example and try to find out which settings or other things influence the
+appearance of the bug. Try different machines, if possible. Send me patches
+if you can!
+
+In case of doubt, use: >
+ :so $VIMRUNTIME/bugreport.vim
+This will create a file "bugreport.txt" in the current directory, with a lot
+of information of your environment. Before sending this out, check if it
+doesn't contain any confidential information!
+
+ *debug-vim*
+When Vim crashes in one of the test files, and you are using gcc for
+compilation, here is what you can do to find out exactly where Vim crashes:
+
+1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
+ which you can uncomment).
+
+2. Execute these commands (replace "11" with the test that fails): >
+ cd testdir
+ gdb ../vim
+ run -u unix.vim -U NONE -s dotest.in test11.in
+
+3. Check where Vim crashes, gdb should give a message for this.
+
+4. Get a stack trace from gdb with this command: >
+ where
+< You can check out different places in the stack trace with: >
+ frame 3
+< Replace "3" with one of the numbers in the stack trace.
+
+ *year-2000* *Y2K*
+Since Vim internally doesn't use dates for editing, there is no year 2000
+problem to worry about. Vim does use the time in the form of seconds since
+January 1st 1970. It is used for a time-stamp check of the edited file and
+the swap file, which is not critical and should only cause warning messages.
+
+There might be a year 2038 problem, when the seconds don't fit in a 32 bit int
+anymore. This depends on the compiler, libraries and operating system.
+Specifically, time_t and the ctime() function are used. And the time_t is
+stored in four bytes in the swap file. But that's only used for printing a
+file date/time for recovery, it will never affect normal editing.
+
+The Vim strftime() function directly uses the strftime() system function.
+localtime() uses the time() system function. getftime() uses the time
+returned by the stat() system function. If your system libraries are year
+2000 compliant, Vim is too.
+
+The user may create scripts for Vim that use external commands. These might
+introduce Y2K problems, but those are not really part of Vim itself.
+
+==============================================================================
+3. Credits *credits* *author*
+
+Most of Vim was written by Bram Moolenaar <Bram@vim.org>.
+
+Parts of the documentation come from several Vi manuals, written by:
+ W.N. Joy
+ Alan P.W. Hewett
+ Mark Horton
+
+The Vim editor is based on Stevie and includes (ideas from) other software,
+worked on by the people mentioned here. Other people helped by sending me
+patches, suggestions and giving feedback about what is good and bad in Vim.
+
+Vim would never have become what it is now, without the help of these people!
+
+ Ron Aaron Win32 GUI changes
+ Zoltan Arpadffy work on VMS port
+ Tony Andrews Stevie
+ Gert van Antwerpen changes for DJGPP on MS-DOS
+ Berkeley DB(3) ideas for swap file implementation
+ Keith Bostic Nvi
+ Walter Briscoe Makefile updates, various patches
+ Ralf Brown SPAWNO library for MS-DOS
+ Robert Colon many useful remarks
+ Marcin Dalecki GTK+ GUI port, toolbar icons, gettext()
+ Kayhan Demirel sent me news in Uganda
+ Chris & John Downey xvi (ideas for multi-windows version)
+ Henk Elbers first VMS port
+ Eric Fischer Mac port, 'cindent', and other improvements
+ Benji Fisher Answering lots of user questions
+ Bill Foster Athena GUI port
+ Loic Grenie xvim (ideas for multi windows version)
+ Sven Guckes Vim promotor and previous WWW page maintainer
+ Darren Hiebert Exuberant ctags
+ Bruce Hunsaker improvements for VMS port
+ Andy Kahn Cscope support, GTK+ GUI port
+ Oezguer Kesim Maintainer of Vim Mailing Lists
+ Axel Kielhorn work on the Macintosh port
+ Steve Kirkendall Elvis
+ Roger Knobbe original port to Windows NT
+ Sergey Laskavy Vim's help from Moscow
+ Felix von Leitner Maintainer of Vim Mailing Lists
+ David Leonard Port of Python extensions to Unix
+ Avner Lottem Edit in right-to-left windows
+ Flemming Madsen X11 client-server, various features and patches
+ MicroSoft Gave me a copy of DevStudio to compile Vim with
+ Paul Moore Python interface extensions, many patches
+ Katsuhito Nagano Work on multi-byte versions
+ Sung-Hyun Nam Work on multi-byte versions
+ Vince Negri Win32 GUI and generic console enhancements
+ Steve Oualline Author of the first Vim book |frombook|
+ George V. Reilly Win32 port, Win32 GUI start-off
+ Stephen Riehm bug collector
+ Stefan Roemer various patches and help to users
+ Ralf Schandl IBM OS/390 port
+ Olaf Seibert DICE and BeBox version, regexp improvements
+ Mortaza Shiran Farsi patches
+ Peter da Silva termlib
+ Paul Slootman OS/2 port
+ Henry Spencer regular expressions
+ Dany St-Amant Macintosh port
+ Tim Thompson Stevie
+ G. R. (Fred) Walter Stevie
+ Sven Verdoolaege Perl interface
+ Robert Webb Command-line completion, GUI versions, and
+ lots of patches
+ Ingo Wilken Tcl interface
+ Mike Williams PostScript printing
+ Juergen Weigert Lattice version, AUX improvements, UNIX and
+ MS-DOS ports, autoconf
+ Stefan 'Sec' Zehl Maintainer of vim.org
+
+I wish to thank all the people that sent me bug reports and suggestions. The
+list is too long to mention them all here. Vim would not be the same without
+the ideas from all these people: They keep Vim alive!
+
+
+In this documentation there are several references to other versions of Vi:
+ *Vi*
+Vi "the original". Without further remarks this is the version
+ of Vi that appeared in Sun OS 4.x. ":version" returns
+ "Version 3.7, 6/7/85". Sometimes other versions are referred
+ to. Only runs under Unix. Source code only available with a
+ license. More information on Vi can be found through:
+ http://vi-editor.org [doesn't currently work...]
+ *Posix*
+Posix From the IEEE standard 1003.2, Part 2: Shell and utilities.
+ Generally known as "Posix". This is a textual description of
+ how Vi is supposed to work.
+ The version used is a draft from beginning 1996, so all remarks are
+ "expected to comply to" this. Anything can change though...
+ *Nvi*
+Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
+ Very good compatibility with the original Vi, with a few extensions.
+ The version used is 1.79. ":version" returns "Version 1.79
+ (10/23/96)". There has been no release the last few years, although
+ there is a development version 1.81.
+ Source code is freely available.
+ *Elvis*
+Elvis Another Vi clone, made by Steve Kirkendall. Very compact but isn't
+ as flexible as Vim.
+ The version used is 2.1. It is still being developed. Source code is
+ freely available.
+
+==============================================================================
+4. Notation *notation*
+
+When syntax highlighting is used to read this, text that is not typed
+literally is often highlighted with the Special group. These are items in [],
+{} and <>, and CTRL-X.
+
+Note that Vim uses all possible characters in commands. Sometimes the [], {}
+and <> are part of what you type, the context should make this clear.
+
+
+[] Characters in square brackets are optional.
+
+ *count* *[count]* *E489*
+[count] An optional number that may precede the command to multiply
+ or iterate the command. If no number is given, a count of one
+ is used, unless otherwise noted. Note that in this manual the
+ [count] is not mentioned in the description of the command,
+ but only in the explanation. This was done to make the
+ commands easier to look up. If the 'showcmd' option is on,
+ the (partially) entered count is shown at the bottom of the
+ window. You can use <Del> to erase the last digit (|N<Del>|).
+
+ *[quotex]*
+["x] An optional register designation where text can be stored.
+ See |registers|. The x is a single character between 'a' and
+ 'z' or 'A' and 'Z' or '"', and in some cases (with the put
+ command) between '0' and '9', '%', '#', or others. The
+ uppercase and lowercase letter designate the same register,
+ but the lowercase letter is used to overwrite the previous
+ register contents, while the uppercase letter is used to
+ append to the previous register contents. Without the ""x" or
+ with """" the stored text is put into the unnamed register.
+
+ *{}*
+{} Curly braces denote parts of the command which must appear,
+ but which can take a number of different values. The
+ differences between Vim and Vi are also given in curly braces
+ (this will be clear from the context).
+
+ *{char1-char2}*
+{char1-char2} A single character from the range char1 to char2. For
+ example: {a-z} is a lowercase letter. Multiple ranges may be
+ concatenated. For example, {a-zA-Z0-9} is any alphanumeric
+ character.
+
+ *{motion}*
+{motion} A command that moves the cursor. These are explained in
+ |motion.txt|. Examples:
+ w to start of next word
+ b to begin of current word
+ 4j four lines down
+ /The<CR> to next occurrence of "The"
+ This is used after an |operator| command to move over the text
+ that is to be operated upon.
+ - If the motion includes a count and the operator also has a
+ count, the two counts are multiplied. For example: "2d3w"
+ deletes six words.
+ - The motion can be backwards, e.g. "db" to delete to the
+ start of the word.
+ - The motion can also be a mouse click. The mouse is not
+ supported in every terminal though.
+ - The ":omap" command can be used to map characters while an
+ operator is pending.
+ - Ex commands can be used to move the cursor. This can be
+ used to call a function that does some complicated motion.
+ The motion is always characterwise exclusive, no matter
+ what ":" command is used. This means it's impossible to
+ include the last character of a line without the line break
+ (unless 'virtualedit' is set).
+ If the Ex command changes the text before where the operator
+ starts or jumps to another buffer the result is
+ unpredictable. It is possible to change the text further
+ down. Jumping to another buffer is possible if the current
+ buffer is not unloaded.
+
+ *{Visual}*
+{Visual} A selected text area. It is started with the "v", "V", or
+ CTRL-V command, then any cursor movement command can be used
+ to change the end of the selected text.
+ This is used before an |operator| command to highlight the
+ text that is to be operated upon.
+ See |Visual-mode|.
+
+ *<character>*
+<character> A special character from the table below, optionally with
+ modifiers, or a single ASCII character with modifiers.
+
+ *'character'*
+'c' A single ASCII character.
+
+ *CTRL-{char}*
+CTRL-{char} {char} typed as a control character; that is, typing {char}
+ while holding the CTRL key down. The case of {char} does not
+ matter; thus CTRL-A and CTRL-a are equivalent. But on some
+ terminals, using the SHIFT key will produce another code,
+ don't use it then.
+
+ *'option'*
+'option' An option, or parameter, that can be set to a value, is
+ enclosed in single quotes. See |options|.
+
+ *quotecommandquote*
+"command" A reference to a command that you can type is enclosed in
+ double quotes.
+
+ *key-notation* *key-codes* *keycodes*
+These names for keys are used in the documentation. They can also be used
+with the ":map" command (insert the key name by pressing CTRL-K and then the
+key you want the name for).
+
+notation meaning equivalent decimal value(s) ~
+-----------------------------------------------------------------------
+<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
+<BS> backspace CTRL-H 8 *backspace*
+<Tab> tab CTRL-I 9 *tab* *Tab*
+ *linefeed*
+<NL> linefeed CTRL-J 10 (used for <Nul>)
+<FF> formfeed CTRL-L 12 *formfeed*
+<CR> carriage return CTRL-M 13 *carriage-return*
+<Return> same as <CR> *<Return>*
+<Enter> same as <CR> *<Enter>*
+<Esc> escape CTRL-[ 27 *escape* *<Esc>*
+<Space> space 32 *space*
+<lt> less-than < 60 *<lt>*
+<Bslash> backslash \ 92 *backslash* *<Bslash>*
+<Bar> vertical bar | 124 *<Bar>*
+<Del> delete 127
+<CSI> command sequence intro ALT-Esc 155 *<CSI>*
+<xCSI> CSI when typed in the GUI *<xCSI>*
+
+<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>,
+ depends on system and 'fileformat') *<EOL>*
+
+<Up> cursor-up *cursor-up* *cursor_up*
+<Down> cursor-down *cursor-down* *cursor_down*
+<Left> cursor-left *cursor-left* *cursor_left*
+<Right> cursor-right *cursor-right* *cursor_right*
+<S-Up> shift-cursor-up
+<S-Down> shift-cursor-down
+<S-Left> shift-cursor-left
+<S-Right> shift-cursor-right
+<C-Left> control-cursor-left
+<C-Right> control-cursor-right
+<F1> - <F12> function keys 1 to 12 *function_key* *function-key*
+<S-F1> - <S-F12> shift-function keys 1 to 12 *<S-F1>*
+<Help> help key
+<Undo> undo key
+<Insert> insert key
+<Home> home *home*
+<End> end *end*
+<PageUp> page-up *page_up* *page-up*
+<PageDown> page-down *page_down* *page-down*
+<kHome> keypad home (upper left) *keypad-home*
+<kEnd> keypad end (lower left) *keypad-end*
+<kPageUp> keypad page-up (upper right) *keypad-page-up*
+<kPageDown> keypad page-down (lower right) *keypad-page-down*
+<kPlus> keypad + *keypad-plus*
+<kMinus> keypad - *keypad-minus*
+<kMultiply> keypad * *keypad-multiply*
+<kDivide> keypad / *keypad-divide*
+<kEnter> keypad Enter *keypad-enter*
+<kPoint> keypad Decimal point *keypad-point*
+<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
+<S-...> shift-key *shift* *<S-*
+<C-...> control-key *control* *ctrl* *<C-*
+<M-...> alt-key or meta-key *meta* *alt* *<M-*
+<A-...> same as <M-...> *<A-*
+<D-...> command-key (Macintosh only) *<D-*
+<t_xx> key with "xx" entry in termcap
+-----------------------------------------------------------------------
+
+Note: The shifted cursor keys, the help key, and the undo key are only
+available on a few terminals. On the Amiga, shifted function key 10 produces
+a code (CSI) that is also used by key sequences. It will be recognized only
+after typing another key.
+
+Note: There are two codes for the delete key. 127 is the decimal ASCII value
+for the delete key, which is always recognized. Some delete keys send another
+value, in which case this value is obtained from the termcap entry "kD". Both
+values have the same effect. Also see |:fixdel|.
+
+Note: The keypad keys are used in the same way as the corresponding "normal"
+keys. For example, <kHome> has the same effect as <Home>. If a keypad key
+sends the same raw key code as its non-keypad equivalent, it will be
+recognized as the non-keypad code. For example, when <kHome> sends the same
+code as <Home>, when pressing <kHome> Vim will think <Home> was pressed.
+Mapping <kHome> will not work then.
+
+ *<>*
+Examples are often given in the <> notation. Sometimes this is just to make
+clear what you need to type, but often it can be typed literally, e.g., with
+the ":map" command. The rules are:
+ 1. Any printable characters are typed directly, except backslash and '<'
+ 2. A backslash is represented with "\\", double backslash, or "<Bslash>".
+ 3. A real '<' is represented with "\<" or "<lt>". When there is no
+ confusion possible, a '<' can be used directly.
+ 4. "<key>" means the special key typed. This is the notation explained in
+ the table above. A few examples:
+ <Esc> Escape key
+ <C-G> CTRL-G
+ <Up> cursor up key
+ <C-LeftMouse> Control- left mouse click
+ <S-F11> Shifted function key 11
+ <M-a> Meta- a ('a' with bit 8 set)
+ <M-A> Meta- A ('A' with bit 8 set)
+ <t_kd> "kd" termcap entry (cursor down key)
+
+If you want to use the full <> notation in Vim, you have to make sure the '<'
+flag is excluded from 'cpoptions' (when 'compatible' is not set, it already is
+by default). >
+ :set cpo-=<
+The <> notation uses <lt> to escape the special meaning of key names. Using a
+backslash also works, but only when 'cpoptions' does not include the 'B' flag.
+
+Examples for mapping CTRL-H to the six characters "<Home>": >
+ :imap <C-H> \<Home>
+ :imap <C-H> <lt>Home>
+The first one only works when the 'B' flag is not in 'cpoptions'. The second
+one always works.
+To get a literal "<lt>" in a mapping: >
+ :map <C-L> <lt>lt>
+
+For mapping, abbreviation and menu commands you can then copy-paste the
+examples and use them directly. Or type them literally, including the '<' and
+'>' characters. This does NOT work for other commands, like ":set" and
+":autocmd"!
+
+==============================================================================
+5. Modes, introduction *vim-modes-intro* *vim-modes*
+
+Vim has six BASIC modes:
+
+ *Normal* *Normal-mode* *command-mode*
+Normal mode In Normal mode you can enter all the normal editor
+ commands. If you start the editor you are in this
+ mode (unless you have set the 'insertmode' option,
+ see below). This is also known as command mode.
+
+Visual mode This is like Normal mode, but the movement commands
+ extend a highlighted area. When a non-movement
+ command is used, it is executed for the highlighted
+ area. See |Visual-mode|.
+ If the 'showmode' option is on "-- VISUAL --" is shown
+ at the bottom of the window.
+
+Select mode This looks most like the MS-Windows selection mode.
+ Typing a printable character deletes the selection
+ and starts Insert mode. See |Select-mode|.
+ If the 'showmode' option is on "-- SELECT --" is shown
+ at the bottom of the window.
+
+Insert mode In Insert mode the text you type is inserted into the
+ buffer. See |Insert-mode|.
+ If the 'showmode' option is on "-- INSERT --" is shown
+ at the bottom of the window.
+
+Command-line mode In Command-line mode (also called Cmdline mode) you
+Cmdline mode can enter one line of text at the bottom of the
+ window. This is for the Ex commands, ":", the pattern
+ search commands, "?" and "/", and the filter command,
+ "!". |Cmdline-mode|
+
+Ex mode Like Command-line mode, but after entering a command
+ you remain in Ex mode. Very limited editing of the
+ command line. |Ex-mode|
+
+There are five ADDITIONAL modes. These are variants of the BASIC modes:
+
+ *Operator-pending* *Operator-pending-mode*
+Operator-pending mode This is like Normal mode, but after an operator
+ command has started, and Vim is waiting for a {motion}
+ to specify the text that the operator will work on.
+
+Replace mode Replace mode is a special case of Insert mode. You
+ can do the same things as in Insert mode, but for
+ each character you enter, one character of the existing
+ text is deleted. See |Replace-mode|.
+ If the 'showmode' option is on "-- REPLACE --" is
+ shown at the bottom of the window.
+
+Insert Normal mode Entered when CTRL-O given in Insert mode. This is
+ like Normal mode, but after executing one command Vim
+ returns to Insert mode.
+ If the 'showmode' option is on "-- (insert) --" is
+ shown at the bottom of the window.
+
+Insert Visual mode Entered when starting a Visual selection from Insert
+ mode, e.g., by using CTRL-O and then "v", "V" or
+ CTRL-V. When the Visual selection ends, Vim returns
+ to Insert mode.
+ If the 'showmode' option is on "-- (insert) VISUAL --"
+ is shown at the bottom of the window.
+
+Insert Select mode Entered when starting Select mode from Insert mode.
+ E.g., by dragging the mouse or <S-Right>.
+ When the Select mode ends, Vim returns to Insert mode.
+ If the 'showmode' option is on "-- (insert) SELECT --"
+ is shown at the bottom of the window.
+
+==============================================================================
+6. Switching from mode to mode *mode-switching*
+
+If for any reason you do not know which mode you are in, you can always get
+back to Normal mode by typing <Esc> twice. This doesn't work for Ex mode
+though, use ":visual".
+You will know you are back in Normal mode when you see the screen flash or
+hear the bell after you type <Esc>. However, when pressing <Esc> after using
+CTRL-O in Insert mode you get a beep but you are still in Insert mode, type
+<Esc> again.
+
+ *i_esc*
+ TO mode ~
+ Normal Visual Select Insert Replace Cmd-line Ex ~
+FROM mode ~
+Normal v V ^V *4 *1 R : / ? ! Q
+Visual *2 ^G c C -- : --
+Select *5 ^O ^G *6 -- -- --
+Insert <Esc> -- -- <Insert> -- --
+Replace <Esc> -- -- <Insert> -- --
+Command-line *3 -- -- :start -- --
+Ex :vi -- -- -- -- --
+
+- NA
+-- not possible
+
+*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
+ "A", "o", "O", "c", "C", "s" or S".
+*2 Go from Visual mode to Normal mode by giving a non-movement command, which
+ causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
+ (see |v_v|), which just stops Visual mode without side effects.
+*3 Go from Command-line mode to Normal mode by:
+ - Hitting <CR> or <NL>, which causes the entered command to be executed.
+ - Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
+ - Hitting CTRL-C or <Esc>, which quits the command-line without executing
+ the command.
+ In the last case <Esc> may be the character defined with the 'wildchar'
+ option, in which case it will start command-line completion. You can
+ ignore that and type <Esc> again. {Vi: when hitting <Esc> the command-line
+ is executed. This is unexpected for most people; therefore it was changed
+ in Vim. But when the <Esc> is part of a mapping, the command-line is
+ executed. If you want the Vi behaviour also when typing <Esc>, use ":cmap
+ ^V<Esc> ^V^M"}
+*4 Go from Normal to Select mode by:
+ - use the mouse to select text while 'selectmode' contains "mouse"
+ - use a non-printable command to move the cursor while keeping the Shift
+ key pressed, and the 'selectmode' option contains "key"
+ - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
+ - use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
+*5 Go from Select mode to Normal mode by using a non-printable command to move
+ the cursor, without keeping the Shift key pressed.
+*6 Go from Select mode to Insert mode by typing a printable character. The
+ selection is deleted and the character is inserted.
+
+If the 'insertmode' option is on, editing a file will start in Insert mode.
+
+ *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N*
+Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to
+Normal mode from any other mode. This can be used to make sure Vim is in
+Normal mode, without causing a beep like <Esc> would. However, this does not
+work in Ex mode. When used after a command that takes an argument, such as
+|f| or |m|, the timeout set with 'ttimeoutlen' applies.
+
+ *CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G*
+The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when
+'insertmode' is set. Otherwise it goes to Normal mode. This can be used to
+make sure Vim is in the mode indicated by 'insertmode', without knowing in
+what mode Vim currently is.
+
+ *Q* *mode-Ex* *Ex-mode* *Ex* *EX* *E501*
+Q Switch to "Ex" mode. This is a bit like typing ":"
+ commands one after another, except:
+ - You don't have to keep pressing ":".
+ - The screen doesn't get updated after each command.
+ - There is no normal command-line editing.
+ - Mappings and abbreviations are not used.
+ In fact, you are editing the lines with the "standard"
+ line-input editing commands (<Del> or <BS> to erase,
+ CTRL-U to kill the whole line).
+ Vim will enter this mode by default if it's invoked as
+ "ex" on the command-line.
+ Use the ":vi" command |:visual| to exit "Ex" mode.
+ Note: In older versions of Vim "Q" formatted text,
+ that is now done with |gq|. But if you use the
+ |vimrc_example.vim| script "Q" works like "gq".
+
+ *gQ*
+gQ Switch to "Ex" mode, but really behave like typing ":"
+ commands after another. All command line editing,
+ completion etc. is available.
+ Use the ":vi" command |:visual| to exit "Ex" mode.
+ {not in Vi}
+
+==============================================================================
+7. The window contents *window-contents*
+
+In Normal mode and Insert/Replace mode the screen window will show the current
+contents of the buffer: What You See Is What You Get. There are two
+exceptions:
+- When the 'cpoptions' option contains '$', and the change is within one line,
+ the text is not directly deleted, but a '$' is put at the last deleted
+ character.
+- When inserting text in one window, other windows on the same text are not
+ updated until the insert is finished.
+{Vi: The screen is not always updated on slow terminals}
+
+Lines longer than the window width will wrap, unless the 'wrap' option is off
+(see below). The 'linebreak' option can be set to wrap at a blank character.
+
+If the window has room after the last line of the buffer, Vim will show '~' in
+the first column of the last lines in the window, like this: >
+
+ +-----------------------+
+ |some line |
+ |last line |
+ |~ |
+ |~ |
+ +-----------------------+
+
+Thus the '~' lines indicate that the end of the buffer was reached.
+
+If the last line in a window doesn't fit, Vim will indicate this with a '@' in
+the first column of the last lines in the window, like this: >
+
+ +-----------------------+
+ |first line |
+ |second line |
+ |@ |
+ |@ |
+ +-----------------------+
+
+Thus the '@' lines indicate that there is a line that doesn't fit in the
+window.
+
+When the "lastline" flag is present in the 'display' option, you will not see
+'@' characters at the left side of window. If the last line doesn't fit
+completely, only the part that fits is shown, and the last three characters of
+the last line are replaced with "@@@", like this: >
+
+ +-----------------------+
+ |first line |
+ |second line |
+ |a very long line that d|
+ |oesn't fit in the wi@@@|
+ +-----------------------+
+
+If there is a single line that is too long to fit in the window, this is a
+special situation. Vim will show only part of the line, around where the
+cursor is. There are no special characters shown, so that you can edit all
+parts of this line.
+{Vi: gives an "internal error" on lines that do not fit in the window}
+
+The '@' occasion in the 'highlight' option can be used to set special
+highlighting for the '@' and '~' characters. This makes it possible to
+distinguish them from real characters in the buffer.
+
+The 'showbreak' option contains the string to put in front of wrapped lines.
+
+ *wrap-off*
+If the 'wrap' option is off, long lines will not wrap. Only the part that
+fits on the screen is shown. If the cursor is moved to a part of the line
+that is not shown, the screen is scrolled horizontally. The advantage of
+this method is that columns are shown as they are and lines that cannot fit
+on the screen can be edited. The disadvantage is that you cannot see all the
+characters of a line at once. The 'sidescroll' option can be set to the
+minimal number of columns to scroll. {Vi: has no 'wrap' option}
+
+All normal ASCII characters are displayed directly on the screen. The <Tab>
+is replaced with the number of spaces that it represents. Other non-printing
+characters are replaced with "^{char}", where {char} is the non-printing
+character with 64 added. Thus character 7 (bell) will be shown as "^G".
+Characters between 127 and 160 are replaced with "~{char}", where {char} is
+the character with 64 subtracted. These characters occupy more than one
+position on the screen. The cursor can only be positioned on the first one.
+
+If you set the 'number' option, all lines will be preceded with their
+number. Tip: If you don't like wrapping lines to mix with the line numbers,
+set the 'showbreak' option to eight spaces:
+ ":set showbreak=\ \ \ \ \ \ \ \ "
+
+If you set the 'list' option, <Tab> characters will not be shown as several
+spaces, but as "^I". A '$' will be placed at the end of the line, so you can
+find trailing blanks.
+
+In Command-line mode only the command-line itself is shown correctly. The
+display of the buffer contents is updated as soon as you go back to Command
+mode.
+
+The last line of the window is used for status and other messages. The
+status messages will only be used if an option is on:
+
+status message option default Unix default ~
+current mode 'showmode' on on
+command characters 'showcmd' on off
+cursor position 'ruler' off off
+
+The current mode is "-- INSERT --" or "-- REPLACE --", see |'showmode'|. The
+command characters are those that you typed but were not used yet. {Vi: does
+not show the characters you typed or the cursor position}
+
+If you have a slow terminal you can switch off the status messages to speed
+up editing:
+ :set nosc noru nosm
+
+If there is an error, an error message will be shown for at least one second
+(in reverse video). {Vi: error messages may be overwritten with other
+messages before you have a chance to read them}
+
+Some commands show how many lines were affected. Above which threshold this
+happens can be controlled with the 'report' option (default 2).
+
+On the Amiga Vim will run in a CLI window. The name Vim and the full name of
+the current file name will be shown in the title bar. When the window is
+resized, Vim will automatically redraw the window. You may make the window as
+small as you like, but if it gets too small not a single line will fit in it.
+Make it at least 40 characters wide to be able to read most messages on the
+last line.
+
+On most Unix systems, resizing the window is recognized and handled correctly
+by Vim. {Vi: not ok}
+
+==============================================================================
+8. Definitions *definitions*
+
+ screen The whole area that Vim uses to work in. This can be
+ a terminal emulator window. Also called "the Vim
+ window".
+ window A view on a buffer.
+
+A screen contains one or more windows, separated by status lines and with the
+command line at the bottom.
+
+ +-------------------------------+
+screen | window 1 | window 2 |
+ | | |
+ | | |
+ |= status line =|= status line =|
+ | window 3 |
+ | |
+ | |
+ |==== status line ==============|
+ |command line |
+ +-------------------------------+
+
+The command line is also used for messages. It scrolls up the screen when
+there is not enough room in the command line.
+
+A difference is made between four types of lines:
+
+ buffer lines The lines in the buffer. This is the same as the
+ lines as they are read from/written to a file. They
+ can be thousands of characters long.
+ logical lines The buffer lines with folding applied. Buffer lines
+ in a closed fold are changed to a single logical line:
+ "+-- 99 lines folded". They can be thousands of
+ characters long.
+ window lines The lines displayed in a window: A range of logical
+ lines with wrapping, line breaks, etc. applied. They
+ can only be as long as the width of the window allows,
+ longer lines are wrapped or truncated.
+ screen lines The lines of the screen that Vim uses. Consists of
+ the window lines of all windows, with status lines
+ and the command line added. They can only be as long
+ as the width of the screen allows. When the command
+ line gets longer it wraps and lines are scrolled to
+ make room.
+
+buffer lines logical lines window lines screen lines ~
+
+1. one 1. one 1. +-- folded 1. +-- folded
+2. two 2. +-- folded 2. five 2. five
+3. three 3. five 3. six 3. six
+4. four 4. six 4. seven 4. seven
+5. five 5. seven 5. === status line ===
+6. six 6. aaa
+7. seven 7. bbb
+ 8. ccc ccc c
+1. aaa 1. aaa 1. aaa 9. cc
+2. bbb 2. bbb 2. bbb 10. ddd
+3. ccc ccc ccc 3. ccc ccc ccc 3. ccc ccc c 11. ~
+4. ddd 4. ddd 4. cc 12. === status line ===
+ 5. ddd 13. (command line)
+ 6. ~
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/makehtml.awk b/runtime/doc/makehtml.awk
new file mode 100644
index 000000000..8ae067e81
--- /dev/null
+++ b/runtime/doc/makehtml.awk
@@ -0,0 +1,780 @@
+BEGIN {
+ # some initialization variables
+ asciiart="no";
+ wasset="no";
+ lineset=0;
+ sample="no";
+ while ( getline ti <"tags.ref" > 0 ) {
+ nf=split(ti,tag," ");
+ tagkey[tag[1]]="yes";tagref[tag[1]]=tag[2];
+ }
+ skip_word["and"]="yes";
+ skip_word["backspace"]="yes";
+ skip_word["beep"]="yes";
+ skip_word["bugs"]="yes";
+ skip_word["da"]="yes";
+ skip_word["end"]="yes";
+ skip_word["ftp"]="yes";
+ skip_word["go"]="yes";
+ skip_word["help"]="yes";
+ skip_word["home"]="yes";
+ skip_word["news"]="yes";
+ skip_word["index"]="yes";
+ skip_word["insert"]="yes";
+ skip_word["into"]="yes";
+ skip_word["put"]="yes";
+ skip_word["reference"]="yes";
+ skip_word["section"]="yes";
+ skip_word["space"]="yes";
+ skip_word["starting"]="yes";
+ skip_word["toggle"]="yes";
+ skip_word["various"]="yes";
+ skip_word["version"]="yes";
+ skip_word["is"]="yes";
+}
+#
+# protect special chars
+#
+/[><&á]/ {gsub(/&/,"\\&amp;");gsub(/>/,"\\&gt;");gsub(/</,"\\&lt;");gsub("á","\\&aacute;");}
+#
+# end of sample lines by non-blank in first column
+#
+sample == "yes" && substr($0,1,4) == "&lt;" { sample = "no"; gsub(/^&lt;/, " "); }
+sample == "yes" && substr($0,1,1) != " " && substr($0,1,1) != " " && length($0) > 0 { sample = "no" }
+#
+# sample lines printed bold unless empty...
+#
+sample == "yes" && $0 =="" { print ""; next; }
+sample == "yes" && $0 !="" { print "<B>" $0 "</B>"; next; }
+#
+# start of sample lines in next line
+#
+$0 == "&gt;" { sample = "yes"; print ""; next; }
+substr($0,length($0)-4,5) == " &gt;" { sample = "yes"; gsub(/ &gt;$/, ""); }
+#
+# header lines printed bold, colored
+#
+substr($0,length($0),1) == "~" { print "<B><FONT COLOR=\"PURPLE\">" substr($0,1,length($0)-1) "</FONT></B>"; next; }
+#
+#ad hoc code
+#
+/^"\|\& / {gsub(/\|/,"\\&#124;"); }
+/ = b / {gsub(/ b /," \\&#98; "); }
+#
+# one letter tag
+#
+/[ ]\*.\*[ ]/ {gsub(/\*/,"ZWWZ"); }
+#
+# isolated "*"
+#
+/[ ]\*[ ]/ {gsub(/ \* /," \\&#42; ");
+ gsub(/ \* /," \\&#42; ");
+ gsub(/ \* /," \\&#42; ");
+ gsub(/ \* /," \\&#42; "); }
+#
+# tag start
+#
+/[ ]\*[^ ]/ {gsub(/ \*/," ZWWZ");gsub(/ \*/," ZWWZ");}
+/^\*[^ ]/ {gsub(/^\*/,"ZWWZ");}
+#
+# tag end
+#
+/[^ ]\*$/ {gsub(/\*$/,"ZWWZ");}
+/[^ \/ ]\*[ ]/ {gsub(/\*/,"ZWWZ");}
+#
+# isolated "|"
+#
+/[ ]\|[ ]/ {gsub(/ \| /," \\&#124; ");
+ gsub(/ \| /," \\&#124; ");
+ gsub(/ \| /," \\&#124; ");
+ gsub(/ \| /," \\&#124; "); }
+/'\|'/ { gsub(/'\|'/,"'\\&#124;'"); }
+/\^V\|/ {gsub(/\^V\|/,"^V\\&#124;");}
+/ \\\| / {gsub(/\|/,"\\&#124;");}
+#
+# one letter pipes and "||" false pipe (digraphs)
+#
+/[ ]\|.\|[ ]/ && asciiart == "no" {gsub(/\|/,"YXXY"); }
+/^\|.\|[ ]/ {gsub(/\|/,"YXXY"); }
+/\|\|/ {gsub(/\|\|/,"\\&#124;\\&#124;"); }
+/^shellpipe/ {gsub(/\|/,"\\&#124;"); }
+#
+# pipe start
+#
+/[ ]\|[^ ]/ && asciiart == "no" {gsub(/ \|/," YXXY");
+ gsub(/ \|/," YXXY");}
+/^\|[^ ]/ {gsub(/^\|/,"YXXY");}
+#
+# pipe end
+#
+/[^ ]\|$/ && asciiart == "no" {gsub(/\|$/,"YXXY");}
+/[^ ]\|[s ,.); ]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
+/[^ ]\|]/ && asciiart == "no" {gsub(/\|/,"YXXY");}
+#
+# various
+#
+/'"/ {gsub(/'"/,"\\&#39;\\&#34;'");}
+/"/ {gsub(/"/,"\\&quot;");}
+/%/ {gsub(/%/,"\\&#37;");}
+
+NR == 1 { nf=split(FILENAME,f,".")
+ print "<HTML>";
+
+ print "<HEAD>"
+ if ( FILENAME == "mbyte.txt" ) {
+ # needs utf-8 as uses many languages
+ print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=UTF-8\">";
+ } else {
+ # common case - Latin1
+ print "<META HTTP-EQUIV=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">";
+ }
+ print "<TITLE>Vim documentation: " f[1] "</TITLE>";
+ print "</HEAD>";
+
+ print "<BODY BGCOLOR=\"#ffffff\">";
+ print "<H1>Vim documentation: " f[1] "</H1>";
+ print "<A NAME=\"top\"></A>";
+ if ( FILENAME != "help.txt" ) {
+ print "<A HREF=\"help.html\">main help file</A>\n";
+ }
+ print "<HR>";
+ print "<PRE>";
+ filename=f[1]".html";
+}
+
+# set to a low value to test for few lines of text
+# NR == 99999 { exit; }
+
+# ignore underlines and tags
+substr($0,1,5) == " vim:" { next; }
+substr($0,1,4) == "vim:" { next; }
+# keep just whole lines of "-", "="
+substr($0,1,3) == "===" && substr($0,75,1) != "=" { next; }
+substr($0,1,3) == "---" && substr($0,75,1) != "-" { next; }
+
+{
+ nstar = split($0,s,"ZWWZ");
+ for ( i=2 ; i <= nstar ; i=i+2 ) {
+ nbla=split(s[i],blata,"[ ]");
+ if ( nbla > 1 ) {
+ gsub("ZWWZ","*");
+ nstar = split($0,s,"ZWWZ");
+ }
+ }
+ npipe = split($0,p,"YXXY");
+ for ( i=2 ; i <= npipe ; i=i+2 ) {
+ nbla=split(p[i],blata,"[ ]");
+ if ( nbla > 1 ) {
+ gsub("YXXY","|");
+ ntabs = split($0,p,"YXXY");
+ }
+ }
+}
+
+
+FILENAME == "gui.txt" && asciiart == "no" \
+ && $0 ~ /\+----/ && $0 ~ /----\+/ {
+ asciiart= "yes";
+ asciicnt=0;
+ }
+
+FILENAME == "quotes.txt" && asciiart == "no" \
+ && $0 ~ /In summary:/ {
+ asciiart= "yes";
+ asciicnt=0;
+ }
+
+FILENAME == "usr_20.txt" && asciiart == "no" \
+ && $0 ~ /an empty line at the end:/ {
+ asciiart= "yes";
+ asciicnt=0;
+ }
+
+asciiart == "yes" && $0=="" { asciicnt++; }
+
+asciiart == "yes" && asciicnt == 2 { asciiart = "no"; }
+
+asciiart == "yes" { npipe = 1; }
+# { print NR " <=> " asciiart; }
+
+#
+# line contains "*"
+#
+nstar > 2 && npipe < 3 {
+ printf("\n");
+ for ( i=1; i <= nstar ; i=i+2 ) {
+ this=s[i];
+ put_this();
+ ii=i+1;
+ nbla = split(s[ii],blata," ");
+ if ( ii <= nstar ) {
+ if ( nbla == 1 && substr(s[ii],length(s[ii]),1) != " " ) {
+ printf("*<A NAME=\"%s\"></A>",s[ii]);
+ printf("<B>%s</B>*",s[ii]);
+ } else {
+ printf("*%s*",s[ii]);
+ }
+ }
+ }
+ printf("\n");
+ next;
+ }
+#
+# line contains "|"
+#
+npipe > 2 && nstar < 3 {
+ if ( npipe%2 == 0 ) {
+ for ( i=1; i < npipe ; i++ ) {
+ gsub("ZWWZ","*",p[i]);
+ printf("%s|",p[i]);
+ }
+ printf("%s\n",p[npipe]);
+ next;
+ }
+ for ( i=1; i <= npipe ; i++ )
+ {
+ if ( i % 2 == 1 ) {
+ gsub("ZWWZ","*",p[i]);
+ this=p[i];
+ put_this();
+ }
+ else {
+ nfn=split(p[i],f,".");
+ if ( nfn == 1 || f[2] == "" || f[1] == "" || length(f[2]) < 3 ) {
+ find_tag1();
+ }
+ else {
+ printf "|<A HREF=\"" f[1] ".html\">" p[i] "</A>|";
+ }
+ }
+ }
+ printf("\n");
+ next;
+ }
+#
+# line contains both "|" and "*"
+#
+npipe > 2 && nstar > 2 {
+ printf("\n");
+ for ( j=1; j <= nstar ; j=j+2 ) {
+ npipe = split(s[j],p,"YXXY");
+ if ( npipe > 1 ) {
+ for ( np=1; np<=npipe; np=np+2 ) {
+ this=p[np];
+ put_this();
+ i=np+1;find_tag1();
+ }
+ } else {
+ this=s[j];
+ put_this();
+ }
+ jj=j+1;
+ nbla = split(s[jj],blata," ");
+ if ( jj <= nstar && nbla == 1 && s[jj] != "" ) {
+ printf("*<A NAME=\"%s\"></A>",s[jj]);
+ printf("<B>%s</B>*",s[jj]);
+ } else {
+ if ( s[jj] != "" ) {
+ printf("*%s*",s[jj]);
+ }
+ }
+ }
+ printf("\n");
+ next;
+ }
+#
+# line contains e-mail address john.doe@some.place.edu
+#
+$0 ~ /@/ && $0 ~ /[a-zA-Z0-9]@[a-z]/ \
+ {
+ nemail=split($0,em," ");
+ if ( substr($0,1,1) == " " ) { printf(" "); }
+ for ( i=1; i <= nemail; i++ ) {
+ if ( em[i] ~ /@/ ) {
+ if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-2,3) == "gt;" ) {
+ mailaddr=substr(em[i],5,length(em[i])-8);
+ printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A> ",mailaddr,mailaddr);
+ } else {
+ if ( substr(em[i],2,3) == "lt;" && substr(em[i],length(em[i])-3,3) == "gt;" ) {
+ mailaddr=substr(em[i],5,length(em[i])-9);
+ printf("<A HREF=\"mailto:%s\">&lt;%s&gt;</A>%s ",mailaddr,mailaddr,substr(em[i],length(em[i]),1));
+ } else {
+ printf("<A HREF=\"mailto:%s\">%s</A> ",em[i],em[i]);
+ }
+ }
+ } else {
+ printf("%s ",em[i]);
+ }
+ }
+ #print "*** " NR " " FILENAME " - possible mail ref";
+ printf("\n");
+ next;
+ }
+#
+# line contains http / ftp reference
+#
+$0 ~ /http:\/\// || $0 ~ /ftp:\/\// {
+ gsub("URL:","");
+ gsub("&lt;","");
+ gsub("&gt;","");
+ gsub("\\(","");
+ gsub("\\)","");
+ nemail=split($0,em," ");
+ for ( i=1; i <= nemail; i++ ) {
+ if ( substr(em[i],1,5) == "http:" ||
+ substr(em[i],1,4) == "ftp:" ) {
+ if ( substr(em[i],length(em[i]),1) != "." ) {
+ printf(" <A HREF=\"%s\">%s</A>",em[i],em[i]);
+ } else {
+ em[i]=substr(em[i],1,length(em[i])-1);
+ printf(" <A HREF=\"%s\">%s</A>.",em[i],em[i]);
+ }
+ } else {
+ printf(" %s",em[i]);
+ }
+ }
+ #print "*** " NR " " FILENAME " - possible http ref";
+ printf("\n");
+ next;
+ }
+#
+# some lines contains just one "almost regular" "*"...
+#
+nstar == 2 {
+ this=s[1];
+ put_this();
+ printf("*");
+ this=s[2];
+ put_this();
+ printf("\n");
+ next;
+ }
+#
+# regular line
+#
+ { ntabs = split($0,tb," ");
+ for ( i=1; i < ntabs ; i++) {
+ this=tb[i];
+ put_this();
+ printf(" ");
+ }
+ this=tb[ntabs];
+ put_this();
+ printf("\n");
+ }
+
+
+asciiart == "yes" && $0 ~ /\+-\+--/ \
+ && $0 ~ "scrollbar" { asciiart = "no"; }
+
+END {
+ topback();
+ print "</PRE>\n</BODY>\n\n\n</HTML>"; }
+
+#
+# as main we keep index.txt (by default)
+# other candidate, help.txt
+#
+function topback () {
+ if ( FILENAME != "tags" ) {
+ if ( FILENAME != "help.txt" ) {
+ printf("<A HREF=\"#top\">top</A> - ");
+ printf("<A HREF=\"help.html\">main help file</A>\n");
+ } else {
+ printf("<A HREF=\"#top\">top</A>\n");
+ }
+ }
+}
+
+function find_tag1() {
+ if ( p[i] == "" ) { return; }
+ if ( tagkey[p[i]] == "yes" ) {
+ which=tagref[p[i]];
+ put_href();
+ return;
+ }
+ # if not found, then we have a problem
+ print "============================================" >>"errors.log";
+ print FILENAME ", line " NR ", pointer: >>" p[i] "<<" >>"errors.log";
+ print $0 >>"errors.log";
+ which="intro.html";
+ put_href();
+}
+
+function see_tag() {
+# ad-hoc code:
+if ( atag == "\"--" || atag == "--\"" ) { return; }
+if_already();
+if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+allow_one_char="no";
+find_tag2();
+if ( done == "yes" ) { return; }
+rightchar=substr(atag,length(atag),1);
+if ( rightchar == "." \
+ || rightchar == "," \
+ || rightchar == ":" \
+ || rightchar == ";" \
+ || rightchar == "!" \
+ || rightchar == "?" \
+ || rightchar == ")" ) {
+ atag=substr(atag,1,length(atag)-1);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ find_tag2();
+ if ( done == "yes" ) { printf("%s",rightchar);return; }
+ leftchar=substr(atag,1,1);
+ lastbut1=substr(atag,length(atag),1);
+ if ( leftchar == "'" && lastbut1 == "'" ) {
+ allow_one_char="yes";
+ atag=substr(atag,2,length(atag)-2);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",leftchar);
+ aword=substr(atag,1,length(atag))""lastbut1""rightchar;
+ find_tag2();
+ if ( done == "yes" ) { printf("%s%s",lastbut1,rightchar);return; }
+ }
+ }
+atag=aword;
+leftchar=substr(atag,1,1);
+if ( leftchar == "'" && rightchar == "'" ) {
+ allow_one_char="yes";
+ atag=substr(atag,2,length(atag)-2);
+ if ( atag == "<" ) { printf(" |%s|%s| ",atag,p[2]); }
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",leftchar);
+ find_tag2();
+ if ( done == "yes" ) { printf("%s",rightchar);return; }
+ printf("%s%s",atag,rightchar);
+ return;
+ }
+last2=substr(atag,length(atag)-1,2);
+first2=substr(atag,1,2);
+if ( first2 == "('" && last2 == "')" ) {
+ allow_one_char="yes";
+ atag=substr(atag,3,length(atag)-4);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",first2);
+ find_tag2();
+ if ( done == "yes" ) { printf("%s",last2);return; }
+ printf("%s%s",atag,last2);
+ return;
+ }
+if ( last2 == ".)" ) {
+ atag=substr(atag,1,length(atag)-2);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ find_tag2();
+ if ( done == "yes" ) { printf("%s",last2);return; }
+ printf("%s%s",atag,last2);
+ return;
+ }
+if ( last2 == ")." ) {
+ atag=substr(atag,1,length(atag)-2);
+ find_tag2();
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ if ( done == "yes" ) { printf("%s",last2);return; }
+ printf("%s%s",atag,last2);
+ return;
+ }
+first6=substr(atag,1,6);
+last6=substr(atag,length(atag)-5,6);
+if ( last6 == atag ) {
+ printf("%s",aword);
+ return;
+ }
+last6of7=substr(atag,length(atag)-6,6);
+if ( first6 == "&quot;" && last6of7 == "&quot;" && length(atag) > 12 ) {
+ allow_one_char="yes";
+ atag=substr(atag,7,length(atag)-13);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",first6);
+ find_tag2();
+ if ( done == "yes" ) { printf("&quot;%s",rightchar); return; }
+ printf("%s&quot;%s",atag,rightchar);
+ return;
+ }
+if ( first6 == "&quot;" && last6 != "&quot;" ) {
+ allow_one_char="yes";
+ atag=substr(atag,7,length(atag)-6);
+ if ( atag == "[" ) { printf("&quot;%s",atag); return; }
+ if ( atag == "." ) { printf("&quot;%s",atag); return; }
+ if ( atag == ":" ) { printf("&quot;%s",atag); return; }
+ if ( atag == "a" ) { printf("&quot;%s",atag); return; }
+ if ( atag == "A" ) { printf("&quot;%s",atag); return; }
+ if ( atag == "g" ) { printf("&quot;%s",atag); return; }
+ if_already();
+ if ( already == "yes" ) {
+ printf("&quot;%s",atag);
+ return;
+ }
+ printf("%s",first6);
+ find_tag2();
+ if ( done == "yes" ) { return; }
+ printf("%s",atag);
+ return;
+ }
+if ( last6 == "&quot;" && first6 == "&quot;" ) {
+ allow_one_char="yes";
+ atag=substr(atag,7,length(atag)-12);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",first6);
+ find_tag2();
+ if ( done == "yes" ) { printf("%s",last6);return; }
+ printf("%s%s",atag,last6);
+ return;
+ }
+last6of7=substr(atag,length(atag)-6,6);
+if ( last6of7 == "&quot;" && first6 == "&quot;" ) {
+ allow_one_char="yes";
+ atag=substr(atag,7,length(atag)-13);
+ #printf("\natag=%s,aword=%s\n",atag,aword);
+ if_already();
+ if ( already == "yes" ) {
+ printf("%s",aword);
+ return;
+ }
+ printf("%s",first6);
+ find_tag2();
+ if ( done == "yes" ) { printf("%s%s",last6of7,rightchar);return; }
+ printf("%s%s%s",atag,last6of7,rightchar);
+ return;
+ }
+printf("%s",aword);
+}
+
+function find_tag2() {
+ done="no";
+ # no blanks present in a tag...
+ ntags=split(atag,blata,"[ ]");
+ if ( ntags > 1 ) { return; }
+ if ( ( allow_one_char == "no" ) && \
+ ( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) {
+ return;
+ }
+ if ( skip_word[atag] == "yes" ) { return; }
+ if ( wasset == "yes" && lineset == NR ) {
+ wasset="no";
+ see_opt();
+ if ( done_opt == "yes" ) {return;}
+ }
+ if ( wasset == "yes" && lineset != NR ) {
+ wasset="no";
+ }
+ if ( atag == ":set" ) {
+ wasset="yes";
+ lineset=NR;
+ }
+ if ( tagkey[atag] == "yes" ) {
+ which=tagref[atag];
+ put_href2();
+ done="yes";
+ }
+}
+
+function find_tag3() {
+ done="no";
+ # no blanks present in a tag...
+ ntags=split(btag,blata,"[ ]");
+ if ( ntags > 1 ) { return; }
+ if ( ( allow_one_char == "no" ) && \
+ ( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) {
+ return;
+ }
+ if ( skip_word[btag] == "yes" ) { return; }
+ if ( tagkey[btag] == "yes" ) {
+ which=tagref[btag];
+ put_href3();
+ done="yes";
+ }
+}
+
+function put_href() {
+ if ( p[i] == "" ) { return; }
+ if ( which == FILENAME ) {
+ printf("|<A HREF=\"#%s\">%s</A>|",p[i],p[i]);
+ }
+ else {
+ nz=split(which,zz,".");
+ if ( zz[2] == "txt" || zz[1] == "tags" ) {
+ printf("|<A HREF=\"%s.html#%s\">%s</A>|",zz[1],p[i],p[i]);
+ }
+ else {
+ printf("|<A HREF=\"intro.html#%s\">%s</A>|",p[i],p[i]);
+ }
+ }
+}
+
+function put_href2() {
+ if ( atag == "" ) { return; }
+ if ( which == FILENAME ) {
+ printf("<A HREF=\"#%s\">%s</A>",atag,atag);
+ }
+ else {
+ nz=split(which,zz,".");
+ if ( zz[2] == "txt" || zz[1] == "tags" ) {
+ printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],atag,atag);
+ }
+ else {
+ printf("<A HREF=\"intro.html#%s\">%s</A>",atag,atag);
+ }
+ }
+}
+
+function put_href3() {
+ if ( btag == "" ) { return; }
+ if ( which == FILENAME ) {
+ printf("<A HREF=\"#%s\">%s</A>",btag,btag2);
+ }
+ else {
+ nz=split(which,zz,".");
+ if ( zz[2] == "txt" || zz[1] == "tags" ) {
+ printf("<A HREF=\"%s.html#%s\">%s</A>",zz[1],btag,btag2);
+ }
+ else {
+ printf("<A HREF=\"intro.html#%s\">%s</A>",btag,btag2);
+ }
+ }
+}
+
+function put_this() {
+ ntab=split(this,ta," ");
+ for ( nta=1 ; nta <= ntab ; nta++ ) {
+ ata=ta[nta];
+ lata=length(ata);
+ aword="";
+ for ( iata=1 ; iata <=lata ; iata++ ) {
+ achar=substr(ata,iata,1);
+ if ( achar != " " ) { aword=aword""achar; }
+ else {
+ if ( aword != "" ) { atag=aword;
+ see_tag();
+ aword="";
+ printf(" "); }
+ else {
+ printf(" ");
+ }
+ }
+ }
+ if ( aword != "" ) { atag=aword;
+ see_tag();
+ }
+ if ( nta != ntab ) { printf(" "); }
+ }
+}
+
+function if_already() {
+ already="no";
+ if ( npipe < 2 ) { return; }
+ if ( atag == ":au" && p[2] == ":autocmd" ) { already="yes";return; }
+ for ( npp=2 ; npp <= npipe ; npp=npp+2 ) {
+ if ( ( (index(p[npp],atag)) != 0 \
+ && length(p[npp]) > length(atag) \
+ && length(atag) >= 1 \
+ ) \
+ || (p[npp] == atag) \
+ ) {
+ # printf("p=|%s|,tag=|%s| ",p[npp],atag);
+ already="yes"; return; }
+ }
+}
+
+function see_opt() {
+ done_opt="no";
+ stag=atag;
+ nfields = split(atag,tae,"=");
+ if ( nfields > 1 ) {
+ btag="'"tae[1]"'";
+ btag2=tae[1];
+ find_tag3();
+ if (done == "yes") {
+ for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
+ printf("=%s",tae[ntae]);
+ }
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ btag=tae[1];
+ btag2=tae[1];
+ find_tag3();
+ if ( done=="yes" ) {
+ for ( ntae=2 ; ntae <= nfields ; ntae++ ) {
+ printf("=%s",tae[ntae]);
+ }
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ }
+ nfields = split(atag,tae,"&quot;");
+ if ( nfields > 1 ) {
+ btag="'"tae[1]"'";
+ btag2=tae[1];
+ find_tag3();
+ if (done == "yes") {
+ printf("&quot;");
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ btag=tae[1];
+ btag2=tae[1];
+ find_tag3();
+ if (done == "yes") {
+ printf("&quot;");
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ }
+ btag="'"tae[1]"'";
+ btag2=tae[1];
+ find_tag3();
+ if (done == "yes") {
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ btag=tae[1];
+ btag2=tae[1];
+ find_tag3();
+ if (done == "yes") {
+ atag=stag;
+ done_opt="yes";
+ return;
+ }
+ atag=stag;
+}
diff --git a/runtime/doc/maketags.awk b/runtime/doc/maketags.awk
new file mode 100644
index 000000000..c6b2cd91f
--- /dev/null
+++ b/runtime/doc/maketags.awk
@@ -0,0 +1,42 @@
+BEGIN { FS=" "; }
+
+NR == 1 { nf=split(FILENAME,f,".")
+ print "<HTML>";
+ print "<HEAD><TITLE>" f[1] "</TITLE></HEAD>";
+ print "<BODY BGCOLOR=\"#ffffff\">";
+ print "<H1>Vim Documentation: " f[1] "</H1>";
+ print "<A NAME=\"top\"></A>";
+ print "<HR>";
+ print "<PRE>";
+}
+
+{
+ #
+ # protect special chars
+ #
+ gsub(/&/,"\\&amp;");
+ gsub(/>/,"\\&gt;");
+ gsub(/</,"\\&lt;");
+ gsub(/"/,"\\&quot;");
+ gsub(/%/,"\\&#37;");
+
+ nf=split($0,tag," ");
+ tagkey[t]=tag[1];tagref[t]=tag[2];tagnum[t]=NR;
+ print $1 " " $2 " line " NR >"tags.ref"
+ n=split($2,w,".");
+ printf ("|<A HREF=\"%s.html#%s\">%s</A>| %s\n",w[1],$1,$1,$2);
+}
+
+END {
+ topback();
+ print "</PRE>\n</BODY>\n\n\n</HTML>";
+ }
+
+#
+# as main we keep index.txt (by default)
+# other candidate, help.txt
+#
+function topback () {
+ printf("<A HREF=\"#top\">top</A> - ");
+ printf("<A HREF=\"help.html\">back to help</A>\n");
+}
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
new file mode 100644
index 000000000..8c05ddc76
--- /dev/null
+++ b/runtime/doc/map.txt
@@ -0,0 +1,1094 @@
+*map.txt* For Vim version 7.0aa. Last change: 2004 May 21
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Key mapping, abbreviations and user-defined commands.
+
+This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
+manual.
+
+1. Key mapping |key-mapping|
+2. Abbreviations |abbreviations|
+3. Local mappings and functions |script-local|
+4. User-defined commands |user-commands|
+
+==============================================================================
+1. Key mapping *key-mapping* *mapping* *macro*
+
+Key mapping is used to change the meaning of typed keys. The most common use
+is to define a sequence commands for a function key. Example: >
+
+ :map <F2> a<C-R>=strftime("%c")<CR><Esc>
+
+This appends the current date and time after the cursor. (in <> notation |<>|)
+
+There are commands to enter new mappings, remove mappings and list mappings.
+See |map-overview| for the various forms of "map" and their relationships with
+modes.
+
+{lhs} means left-hand-side *{lhs}*
+{rhs} means right-hand-side *{rhs}*
+
+:map {lhs} {rhs} *:map*
+:nm[ap] {lhs} {rhs} *:nm* *:nmap*
+:vm[ap] {lhs} {rhs} *:vm* *:vmap*
+:om[ap] {lhs} {rhs} *:om* *:omap*
+:map! {lhs} {rhs} *:map!*
+:im[ap] {lhs} {rhs} *:im* *:imap*
+:lm[ap] {lhs} {rhs} *:lm* *:lmap*
+:cm[ap] {lhs} {rhs} *:cm* *:cmap*
+ Map the key sequence {lhs} to {rhs} for the modes
+ where the map command applies. The result, including
+ {rhs}, is then further scanned for mappings. This
+ allows for nested and recursive use of mappings.
+
+
+:no[remap] {lhs} {rhs} *:no* *:noremap*
+:nn[oremap] {lhs} {rhs} *:nn* *:nnoremap*
+:vn[oremap] {lhs} {rhs} *:vn* *:vnoremap*
+:ono[remap] {lhs} {rhs} *:ono* *:onoremap*
+:no[remap]! {lhs} {rhs} *:no!* *:noremap!*
+:ino[remap] {lhs} {rhs} *:ino* *:inoremap*
+:ln[oremap] {lhs} {rhs} *:ln* *:lnoremap*
+:cno[remap] {lhs} {rhs} *:cno* *:cnoremap*
+ Map the key sequence {lhs} to {rhs} for the modes
+ where the map command applies. Disallow mapping of
+ {rhs}, to avoid nested and recursive mappings. Often
+ used to redefine a command. {not in Vi}
+
+
+:unm[ap] {lhs} *:unm* *:unmap*
+:nun[map] {lhs} *:nun* *:nunmap*
+:vu[nmap] {lhs} *:vu* *:vunmap*
+:ou[nmap] {lhs} *:ou* *:ounmap*
+:unm[ap]! {lhs} *:unm!* *:unmap!*
+:iu[nmap] {lhs} *:iu* *:iunmap*
+:lu[nmap] {lhs} *:lu* *:lunmap*
+:cu[nmap] {lhs} *:cu* *:cunmap*
+ Remove the mapping of {lhs} for the modes where the
+ map command applies. The mapping may remain defined
+ for other modes where it applies.
+ Note: Trailing spaces are included in the {lhs}. This
+ unmap does NOT work: >
+ :map @@ foo
+ :unmap @@ | print
+
+:mapc[lear] *:mapc* *:mapclear*
+:nmapc[lear] *:nmapc* *:nmapclear*
+:vmapc[lear] *:vmapc* *:vmapclear*
+:omapc[lear] *:omapc* *:omapclear*
+:mapc[lear]! *:mapc!* *:mapclear!*
+:imapc[lear] *:imapc* *:imapclear*
+:lmapc[lear] *:lmapc* *:lmapclear*
+:cmapc[lear] *:cmapc* *:cmapclear*
+ Remove ALL mappings for the modes where the map
+ command applies. {not in Vi}
+ Warning: This also removes the default mappings.
+
+:map
+:nm[ap]
+:vm[ap]
+:om[ap]
+:map!
+:im[ap]
+:lm[ap]
+:cm[ap]
+ List all key mappings for the modes where the map
+ command applies. Note that ":map" and ":map!" are
+ used most often, because they include the other modes.
+
+:map {lhs} *:map_l*
+:nm[ap] {lhs} *:nmap_l*
+:vm[ap] {lhs} *:vmap_l*
+:om[ap] {lhs} *:omap_l*
+:map! {lhs} *:map_l!*
+:im[ap] {lhs} *:imap_l*
+:lm[ap] {lhs} *:lmap_l*
+:cm[ap] {lhs} *:cmap_l*
+ List the key mappings for the key sequences starting
+ with {lhs} in the modes where the map command applies.
+ {not in Vi}
+
+These commands are used to map a key or key sequence to a string of
+characters. You can use this to put command sequences under function keys,
+translate one key into another, etc. See |:mkexrc| for how to save and
+restore the current mappings.
+
+ *:map-local* *:map-<buffer>* *E224* *E225*
+If the first argument to one of these commands is "<buffer>" it will apply to
+mappings locally to the current buffer only. Example: >
+ :map <buffer> ,w /[.,;]<CR>
+Then you can map ",w" to something else in another buffer: >
+ :map <buffer> ,w /[#&!]<CR>
+The local buffer mappings are used before the global ones.
+The "<buffer>" argument can also be used to clear mappings: >
+ :unmap <buffer> ,w
+ :mapclear <buffer>
+Local mappings are also cleared when a buffer is deleted, but not when it is
+unloaded. Just like local option values.
+
+ *:map-<silent>* *:map-silent*
+To define a mapping which will not be echoed on the command line, add
+"<silent>" as the first argument. Example: >
+ :map <silent> ,h /Header<CR>
+The search string will not be echoed when using this mapping. Messages from
+the executed command are still given though. To shut them up too, add a
+":silent" in the executed command: >
+ :map <silent> ,h :exe ":silent normal /Header\r"<CR>
+Prompts will still be given, e.g., for inputdialog().
+Using "<silent>" for an abbreviation is possible, but will cause redrawing of
+the command line to fail.
+
+ *:map-<script>* *:map-script*
+If the first argument to one of these commands is "<script>" and it is used to
+define a new mapping or abbreviation, the mapping will only remap characters
+in the {rhs} using mappings that were defined local to a script, starting with
+"<SID>". This can be used to avoid that mappings from outside a script
+interfere (e.g., when CTRL-V is remapped in mswin.vim), but do use other
+mappings defined in the script.
+Note: ":map <script>" and ":noremap <script>" do the same thing. The
+"<script>" overrules the command name. Using ":noremap <script>" is
+preferred, because it's clearer that remapping is (mostly) disabled.
+
+ *:map-<unique>* *E226* *E227*
+If the first argument to one of these commands is "<unique>" and it is used to
+define a new mapping or abbreviation, the command will fail if the mapping or
+abbreviation already exists. Example: >
+ :map <unique> ,w /[#&!]<CR>
+When defining a local mapping, there will also be a check if a global map
+already exists which is equal.
+Example of what will fail: >
+ :map ,w /[#&!]<CR>
+ :map <buffer> <unique> ,w /[.,;]<CR>
+
+"<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order.
+They must appear right after the command, before any other arguments.
+
+
+MAPPING AND MODES
+
+There are five sets of mappings
+- For Normal mode: When typing commands.
+- For Visual mode: When typing commands while the Visual area is highlighted.
+- For Operator-pending mode: When an operator is pending (after "d", "y", "c",
+ etc.). Example: ":omap { w" makes "y{" work like "yw" and "d{" like "dw".
+- For Insert mode. These are also used in Replace mode.
+- For Command-line mode: When entering a ":" or "/" command.
+
+There are no separate mappings for Select mode. The same as for Visual mode
+are used |Select-mode-mapping|.
+
+Special case: While typing a count for a command in Normal mode, mapping zero
+is disabled. This makes it possible to map zero without making it impossible
+to type a count with a zero.
+
+ *map-overview* *map-modes*
+Overview of which map command works in which mode:
+
+ commands: modes: ~
+ Normal Visual Operator-pending ~
+:map :noremap :unmap :mapclear yes yes yes
+:nmap :nnoremap :nunmap :nmapclear yes - -
+:vmap :vnoremap :vunmap :vmapclear - yes -
+:omap :onoremap :ounmap :omapclear - - yes
+
+ Insert Command-line Lang-Arg ~
+:map! :noremap! :unmap! :mapclear! yes yes -
+:imap :inoremap :iunmap :imapclear yes - -
+:cmap :cnoremap :cunmap :cmapclear - yes -
+:lmap :lnoremap :lunmap :lmapclear yes* yes* yes*
+
+The original Vi did not have separate mappings for
+Normal/Visual/Operator-pending mode and for Insert/Command-line mode.
+Therefore the ":map" and ":map!" commands enter and display mappings for
+several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
+":imap" commands to enter mappings for each mode separately.
+
+To enter a mapping for Normal and Visual mode, but not Operator-pending mode,
+first define it for all three modes, then unmap it for Operator-pending mode:
+ :map xx something-difficult
+ :ounmap xx
+Likewise for a mapping for Visual and Operator-pending mode or Normal and
+Operator-pending mode.
+
+ *language-mapping*
+":lmap" defines a mapping that applies to:
+- Insert mode
+- Command-line mode
+- when entering a search pattern
+- the argument of the commands that accept a text character, such as "r" and
+ "f"
+- for the input() line
+Generally: Whenever a character is to be typed that is part of the text in the
+buffer, not a Vim command character. "Lang-Arg" isn't really another mode,
+it's just used here for this situation.
+ The simplest way to load a set of related language mappings is by using the
+'keymap' option. See |45.5|.
+ In Insert mode and in Command-line mode the mappings can be disabled with
+the CTRL-^ command |i_CTRL-^| |c_CTRL-^|. When starting to enter a normal
+command line (not a search pattern) the mappings are disabled until a CTRL-^
+is typed. The state last used is remembered for Insert mode and Search
+patterns separately. The state for Insert mode is also used when typing a
+character as an argument to command like "f" or "t".
+ When adding a ":lmap" mapping the use of these mappings in Insert mode and
+for Search patterns will be switched on.
+ Language mappings will never be applied to already mapped characters. They
+are only used for typed characters. This assumes that the language mapping
+was already done when typing the mapping.
+
+ *map-multibyte*
+It is possible to map multibyte characters, but only the whole character. You
+cannot map the first byte only. This was done to prevent problems in this
+scenario: >
+ :set encoding=latin1
+ :imap <M-C> foo
+ :set encoding=utf-8
+The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
+byte. If you type the character á (0xea <M-a>) in UTF-8 encoding this is the
+two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
+otherwise it would be impossible to type the á character.
+
+ *map-listing*
+When listing mappings the characters in the first two columns are:
+
+ CHAR MODE ~
+ <Space> Normal, Visual and Operator-pending
+ n Normal
+ v Visual
+ o Operator-pending
+ ! Insert and Command-line
+ i Insert
+ l ":lmap" mappings for Insert, Command-line and Lang-Arg
+ c Command-line
+
+Just before the {rhs} a special character can appear:
+ * indicates that it is not remappable
+ & indicates that only script-local mappings are remappable
+ @ indicates a buffer-local mapping
+
+Everything from the first non-blank after {lhs} up to the end of the line
+(or '|') is considered to be part of {rhs}. This allows the {rhs} to end
+with a space.
+
+Note: When using mappings for Visual mode, you can use the "'<" mark, which
+is the start of the last selected Visual area in the current buffer |'<|.
+
+ *map_backslash*
+Note that only CTRL-V is mentioned here as a special character for mappings
+and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
+also be used like CTRL-V. The <> notation can be fully used then |<>|. But
+you cannot use "<C-V>" like CTRL-V to escape the special meaning of what
+follows.
+
+To map a backslash, or use a backslash literally in the {rhs}, the special
+sequence "<Bslash>" can be used. This avoids the need to double backslashes
+when using nested mappings.
+
+ *map-ambiguous*
+When two mappings start with the same sequence of characters, they are
+ambiguous. Example: >
+ :imap aa foo
+ :imap aaa bar
+When Vim has read "aa", it will need to get another character to be able to
+decide if "aa" or "aaa" should be mapped. This means that after typing "aa"
+that mapping won't get expanded yet, Vim is waiting for another character.
+If you type a space, then "foo" will get inserted, plus the space. If you
+type "a", then "bar" will get inserted.
+{Vi does not allow ambiguous mappings}
+
+ *map_CTRL_C*
+It's not possible to use a CTRL-C in the {lhs}. You just can't map CTRL-C.
+The reason is that CTRL-C must always be available to break a running command.
+Exception: When using the GUI version on MS-Windows CTRL-C can be mapped to
+allow a Copy command to the clipboard. Use CTRL-Break to interrupt Vim.
+
+ *map_space_in_lhs*
+To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
+each space).
+ *map_space_in_rhs*
+If you want a {rhs} that starts with a space, use "<Space>". To be fully Vi
+compatible (but unreadable) don't use the |<>| notation, precede {rhs} with a
+single CTRL-V (you have to type CTRL-V two times).
+ *map_empty_rhs*
+You can create an empty {rhs} by typing nothing after a single CTRL-V (you
+have to type CTRL-V two times). Unfortunately, you cannot do this in a vimrc
+file.
+ *<Nop>*
+A easier way to get a mapping that doesn't produce anything, is to use "<Nop>"
+for the {rhs}. This only works when the |<>| notation is enabled. For
+example, to make sure that function key 8 does nothing at all: >
+ :map <F8> <Nop>
+ :map! <F8> <Nop>
+<
+ *<Leader>* *mapleader*
+To define a mapping which uses the "mapleader" variable, the special string
+"<Leader>" can be used. It is replaced with the string value of "mapleader".
+If "mapleader" is not set or empty, a backslash is used instead. Example: >
+ :map <Leader>A oanother line<Esc>
+Works like: >
+ :map \A oanother line<Esc>
+But after: >
+ :let mapleader = ","
+It works like: >
+ :map ,A oanother line<Esc>
+
+Note that the value of "mapleader" is used at the moment the mapping is
+defined. Changing "mapleader" after that has no effect for already defined
+mappings.
+
+ *<LocalLeader>* *maplocalleader*
+Just like <Leader>, except that it uses "maplocalleader" instead of
+"mapleader". <LocalLeader> is to be used for mappings which are local to a
+buffer. Example: >
+ :map <LocalLeader>q \DoItNow
+<
+In a global plugin <Leader> should be used and in a filetype plugin
+<LocalLeader>. "mapleader" and "maplocalleader" can be equal. Although, if
+you make them different, there is a smaller chance of mappings from global
+plugins to clash with mappings for filetype plugins. For example, you could
+keep "mapleader" at the default backslash, and set "maplocalleader" to an
+underscore.
+
+ *map-<SID>*
+In a script the special key name "<SID>" can be used to define a mapping
+that's local to the script. See |<SID>| for details.
+
+ *<Plug>*
+The special key name "<Plug>" can be used for an internal mapping, which is
+not to be matched with any key sequence. This is useful in plugins
+|using-<Plug>|.
+
+ *<Char>* *<Char->*
+To map a character by its decimal, octal or hexadecimal number the <Char>
+construct can be used:
+ <Char-123> character 123
+ <Char-033> character 27
+ <Char-0x7f> character 127
+This is useful to specify a (multi-byte) character in a 'keymap' file.
+Upper and lowercase differences are ignored.
+
+ *map-comments*
+It is not possible to put a comment after these commands, because the '"'
+character is considered to be part of the {lhs} or {rhs}.
+
+ *map_bar*
+Since the '|' character is used to separate a map command from the next
+command, you will have to do something special to include a '|' in {rhs}.
+There are three methods:
+ use works when example ~
+ <Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M
+ \| 'b' is not in 'cpoptions' :map _l :!ls \| more^M
+ ^V| always, in Vim and Vi :map _l :!ls ^V| more^M
+
+(here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you
+cannot use the <> notation "<C-V>" here).
+
+All three work when you use the default setting for 'cpoptions'.
+
+When 'b' is present in 'cpoptions', "\|" will be recognized as a mapping
+ending in a '\' and then another command. This is Vi compatible, but
+illogical when compared to other commands.
+
+ *map_return*
+When you have a mapping that contains an Ex command, you need to put a line
+terminator after it to have it executed. The use of <CR> is recommended for
+this (see |<>|). Example: >
+ :map _ls :!ls -l %<CR>:echo "the end"<CR>
+
+To avoid mapping of the characters you type in insert or Command-line mode,
+type a CTRL-V first. The mapping in Insert mode is disabled if the 'paste'
+option is on.
+
+Note that when an error is encountered (that causes an error message or beep)
+the rest of the mapping is not executed. This is Vi-compatible.
+
+Note that the second character (argument) of the commands @zZtTfF[]rm'`"v
+and CTRL-X is not mapped. This was done to be able to use all the named
+registers and marks, even when the command with the same name has been
+mapped.
+
+ *map-which-keys*
+If you are going to map something, you will need to choose which key(s) to use
+for the {lhs}. You will have to avoid keys that are used for Vim commands,
+otherwise you would not be able to use those commands anymore. Here are a few
+suggestions:
+- Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>,
+ <S-F2>, etc. Note that <F1> is already used for the help command.
+- Meta-keys (with the ALT key pressed).
+- Use the '_' or ',' character and then any other character. The "_" and ","
+ commands do exist in Vim (see |_| and |,|), but you probably never use them.
+- Use a key that is a synonym for another command. For example: CTRL-P and
+ CTRL-N. Use an extra character to allow more mappings.
+
+See the file "index" for keys that are not used and thus can be mapped without
+losing any builtin function. You can also use ":help {key}^D" to find out if
+a key is used for some command. ({key} is the specific key you want to find
+out about, ^D is CTRL-D).
+
+ *map-examples*
+A few examples (given as you type them, for "<CR>" you type four characters;
+the '<' flag must not be present in 'cpoptions' for this to work). >
+
+ :map <F3> o#include
+ :map <M-g> /foo<CR>cwbar<Esc>
+ :map _x d/END/e<CR>
+ :map! qq quadrillion questions
+<
+ *map-typing*
+Vim will compare what you type with the start of a mapped sequence. If there
+is an incomplete match, it will get more characters until there either is a
+complete match or until there is no match at all. Example: If you map! "qq",
+the first 'q' will not appear on the screen until you type another
+character. This is because Vim cannot know if the next character will be a
+'q' or not. If the 'timeout' option is on (which is the default) Vim will
+only wait for one second (or as long as specified with the 'timeoutlen'
+option). After that it assumes that the 'q' is to be interpreted as such. If
+you type slowly, or your system is slow, reset the 'timeout' option. Then you
+might want to set the 'ttimeout' option.
+
+ *map-keys-fails*
+There is one situation where key codes might not be recognized:
+- Vim can only read part of the key code. Mostly this is only the first
+ character. This happens on some Unix versions in an xterm.
+- The key code is after character(s) that are mapped. E.g., "<F1><F1>" or
+ "g<F1>".
+The result is that the key code is not recognized in this situation, and the
+mapping fails.
+There are two actions needed to avoid this problem:
+- Remove the 'K' flag from 'cpoptions'. This will make Vim wait for the rest
+ of the characters of the function key.
+- When using <F1> to <F4> the actual key code generated may correspond to
+ <xF1> to <xF4>. There are mappings from <xF1> to <F1>, <xF2> to <F2>, etc.,
+ but these are not recognized after another half a mapping. Make sure the
+ key codes for <F1> to <F4> are correct: >
+ :set <F1>=<type CTRL-V><type F1>
+< Type the <F1> as four characters. The part after the "=" must be done with
+ the actual keys, not the literal text.
+Another solution is to use the actual key code in the mapping for the second
+special key: >
+ :map <F1><Esc>OP :echo "yes"<CR>
+Don't type a real <Esc>, Vim will recognize the key code and replace it with
+<F1> anyway.
+
+ *recursive_mapping*
+If you include the {lhs} in the {rhs} you have a recursive mapping. When
+{lhs} is typed, it will be replaced with {rhs}. When the {lhs} which is
+included in {rhs} is encountered it will be replaced with {rhs}, and so on.
+This makes it possible to repeat a command an infinite number of times. The
+only problem is that the only way to stop this is by causing an error. The
+macros to solve a maze uses this, look there for an example. There is one
+exception: If the {rhs} starts with {lhs}, the first character is not mapped
+again (this is Vi compatible).
+For example: >
+ :map ab abcd
+will execute the "a" command and insert "bcd" in the text. The "ab" in the
+{rhs} will not be mapped again.
+
+If you want to exchange the meaning of two keys you should use the :noremap
+command. For example: >
+ :noremap k j
+ :noremap j k
+This will exchange the cursor up and down commands.
+
+With the normal :map command, when the 'remap' option is on, mapping takes
+place until the text is found not to be a part of a {lhs}. For example, if
+you use: >
+ :map x y
+ :map y x
+Vim will replace x with y, and then y with x, etc. When this has happened
+'maxmapdepth' times (default 1000), Vim will give the error message
+"recursive mapping".
+
+ *:map-undo*
+If you include an undo command inside a mapped sequence, this will bring the
+text back in the state before executing the macro. This is compatible with
+the original Vi, as long as there is only one undo command in the mapped
+sequence (having two undo commands in a mapped sequence did not make sense
+in the original Vi, you would get back the text before the first undo).
+
+ *:map-special-keys*
+There are three ways to map a special key:
+1. The Vi-compatible method: Map the key code. Often this is a sequence that
+ starts with <Esc>. To enter a mapping like this you type ":map " and then
+ you have to type CTRL-V before hitting the function key. Note that when
+ the key code for the key is in the termcap (the t_ options), it will
+ automatically be translated into the internal code and become the second
+ way of mapping (unless the 'k' flag is included in 'cpoptions').
+2. The second method is to use the internal code for the function key. To
+ enter such a mapping type CTRL-K and then hit the function key, or use
+ the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
+ (see table of keys |key-notation|, all keys from <Up> can be used). The
+ first ten function keys can be defined in two ways: Just the number, like
+ "#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
+ refers to function key 10, defined with option 't_f10', which may be
+ function key zero on some keyboards. The <> form cannot be used when
+ 'cpoptions' includes the '<' flag.
+3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
+ termcap entry. Any string entry can be used. For example: >
+ :map <t_F3> G
+< Maps function key 13 to "G". This does not work if 'cpoptions' includes
+ the '<' flag.
+
+The advantage of the second and third method is that the mapping will work on
+different terminals without modification (the function key will be
+translated into the same internal code or the actual key code, no matter what
+terminal you are using. The termcap must be correct for this to work, and you
+must use the same mappings).
+
+DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
+isn't the terminal key codes are tried (see |terminal-options|). If a
+terminal code is found it is replaced with the internal code. Then the check
+for a mapping is done again (so you can map an internal code to something
+else). What is written into the script file depends on what is recognized.
+If the terminal key code was recognized as a mapping the key code itself is
+written to the script file. If it was recognized as a terminal code the
+internal code is written to the script file.
+
+==============================================================================
+2. Abbreviations *abbreviations* *Abbreviations*
+
+Abbreviations are used in Insert mode, Replace mode and Command-line mode.
+If you enter a word that is an abbreviation, it is replaced with the word it
+stands for. This can be used to save typing for often used long words. And
+you can use it to automatically correct obvious spelling errors.
+Examples:
+
+ :iab ms MicroSoft
+ :iab tihs this
+
+There are three types of abbreviations:
+
+full-id The "full-id" type consists entirely of keyword characters (letters
+ and characters from 'iskeyword' option). This is the most common
+ abbreviation.
+
+ Examples: "foo", "g3", "-1"
+
+end-id The "end-id" type ends in a keyword character, but all the other
+ characters are not keyword characters.
+
+ Examples: "#i", "..f", "$/7"
+
+non-id The "non-id" type ends in a non-keyword character, the other
+ characters may be of any type, excluding space and Tab. {this type
+ is not supported by Vi}
+
+ Examples: "def#", "4/7$"
+
+Examples of strings that cannot be abbreviations: "a.b", "#def", "a b", "_$r"
+
+An abbreviation is only recognized when you type a non-keyword character.
+This can also be the <Esc> that ends insert mode or the <CR> that ends a
+command. The non-keyword character which ends the abbreviation is inserted
+after the expanded abbreviation. An exception to this is the character <C-]>,
+which is used to expand an abbreviation without inserting any extra
+characters.
+
+Example: >
+ :ab hh hello
+< "hh<Space>" is expanded to "hello<Space>"
+ "hh<C-]>" is expanded to "hello"
+
+The characters before the cursor must match the abbreviation. Each type has
+an additional rule:
+
+full-id In front of the match is a non-keyword character, or this is where
+ the line or insertion starts. Exception: When the abbreviation is
+ only one character, it is not recognized if there is a non-keyword
+ character in front of it, other than a space or a <Tab>.
+
+end-id In front of the match is a keyword character, or a space or a <Tab>,
+ or this is where the line or insertion starts.
+
+non-id In front of the match is a space, <Tab> or the start of the line or
+ the insertion.
+
+Examples: ({CURSOR} is where you type a non-keyword character) >
+ :ab foo four old otters
+< " foo{CURSOR}" is expanded to " four old otters"
+ " foobar{CURSOR}" is not expanded
+ "barfoo{CURSOR}" is not expanded
+>
+ :ab #i #include
+< "#i{CURSOR}" is expanded to "#include"
+ ">#i{CURSOR}" is not expanded
+>
+ :ab ;; <endofline>"
+< "test;;" is not expanded
+ "test ;;" is expanded to "test <endofline>"
+
+To avoid the abbreviation in insert mode: Type part of the abbreviation, exit
+insert mode with <Esc>, re-enter insert mode with "a" and type the rest. Or
+type CTRL-V before the character after the abbreviation.
+To avoid the abbreviation in Command-line mode: Type CTRL-V twice somewhere in
+the abbreviation to avoid it to be replaced. A CTRL-V in front of a normal
+character is mostly ignored otherwise.
+
+It is possible to move the cursor after an abbreviation: >
+ :iab if if ()<Left>
+This does not work if 'cpoptions' includes the '<' flag. |<>|
+
+You can even do more complicated things. For example, to consume the space
+typed after an abbreviation: >
+ func Eatchar(pat)
+ let c = nr2char(getchar())
+ return (c =~ a:pat) ? '' : c
+ endfunc
+ iabbr <silent> if if ()<Left><C-R>=Eatchar('\s')<CR>
+
+There are no default abbreviations.
+
+Abbreviations are never recursive. You can use ":ab f f-o-o" without any
+problem. But abbreviations can be mapped. {some versions of Vi support
+recursive abbreviations, for no apparent reason}
+
+Abbreviations are disabled if the 'paste' option is on.
+
+ *:abbreviate-local* *:abbreviate-<buffer>*
+Just like mappings, abbreviations can be local to a buffer. This is mostly
+used in a |filetype-plugin| file. Example for a C plugin file: >
+ :abb <buffer> FF for (i = 0; i < ; ++i)
+<
+ *:ab* *:abbreviate*
+:ab[breviate] list all abbreviations. The character in the first
+ column indicates the mode where the abbreviation is
+ used: 'i' for insert mode, 'c' for Command-line
+ mode, '!' for both. These are the same as for
+ mappings, see |map-listing|.
+
+:ab[breviate] {lhs} list the abbreviations that start with {lhs}
+ You may need to insert a CTRL-V (type it twice) to
+ avoid that a typed {lhs} is expanded, since
+ command-line abbreviations apply here.
+
+:ab[breviate] {lhs} {rhs}
+ add abbreviation for {lhs} to {rhs}. If {lhs} already
+ existed it is replaced with the new {rhs}. {rhs} may
+ contain spaces.
+
+ *:una* *:unabbreviate*
+:una[bbreviate] {lhs} Remove abbreviation for {lhs} from the list. If none
+ is found, remove abbreviations in which {lhs} matches
+ with the {rhs}. This is done so that you can even
+ remove abbreviations after expansion. To avoid
+ expansion insert a CTRL-V (type it twice).
+
+ *:norea* *:noreabbrev*
+:norea[bbrev] [lhs] [rhs]
+ same as ":ab", but no remapping for this {rhs} {not
+ in Vi}
+
+ *:ca* *:cabbrev*
+:ca[bbrev] [lhs] [rhs] same as ":ab", but for Command-line mode only. {not
+ in Vi}
+
+ *:cuna* *:cunabbrev*
+:cuna[bbrev] {lhs} same as ":una", but for Command-line mode only. {not
+ in Vi}
+
+ *:cnorea* *:cnoreabbrev*
+:cnorea[bbrev] [lhs] [rhs]
+ same as ":ab", but for Command-line mode only and no
+ remapping for this {rhs} {not in Vi}
+
+ *:ia* *:iabbrev*
+:ia[bbrev] [lhs] [rhs] same as ":ab", but for Insert mode only. {not in Vi}
+
+ *:iuna* *:iunabbrev*
+:iuna[bbrev] {lhs} same as ":una", but for insert mode only. {not in
+ Vi}
+
+ *:inorea* *:inoreabbrev*
+:inorea[bbrev] [lhs] [rhs]
+ same as ":ab", but for Insert mode only and no
+ remapping for this {rhs} {not in Vi}
+
+ *:abc* *:abclear*
+:abc[lear] Remove all abbreviations. {not in Vi}
+
+ *:iabc* *:iabclear*
+:iabc[lear] Remove all abbreviations for Insert mode. {not in Vi}
+
+ *:cabc* *:cabclear*
+:cabc[lear] Remove all abbreviations for Command-line mode. {not
+ in Vi}
+
+ *using_CTRL-V*
+It is possible to use special characters in the rhs of an abbreviation.
+CTRL-V has to be used to avoid the special meaning of most non printable
+characters. How many CTRL-Vs need to be typed depends on how you enter the
+abbreviation. This also applies to mappings. Let's use an example here.
+
+Suppose you want to abbreviate "esc" to enter an <Esc> character. When you
+type the ":ab" command in Vim, you have to enter this: (here ^V is a CTRL-V
+and ^[ is <Esc>)
+
+You type: ab esc ^V^V^V^V^V^[
+
+ All keyboard input is subjected to ^V quote interpretation, so
+ the first, third, and fifth ^V characters simply allow the second,
+ and fourth ^Vs, and the ^[, to be entered into the command-line.
+
+You see: ab esc ^V^V^[
+
+ The command-line contains two actual ^Vs before the ^[. This is
+ how it should appear in your .exrc file, if you choose to go that
+ route. The first ^V is there to quote the second ^V; the :ab
+ command uses ^V as its own quote character, so you can include quoted
+ whitespace or the | character in the abbreviation. The :ab command
+ doesn't do anything special with the ^[ character, so it doesn't need
+ to be quoted. (Although quoting isn't harmful; that's why typing 7
+ [but not 8!] ^Vs works.)
+
+Stored as: esc ^V^[
+
+ After parsing, the abbreviation's short form ("esc") and long form
+ (the two characters "^V^[") are stored in the abbreviation table.
+ If you give the :ab command with no arguments, this is how the
+ abbreviation will be displayed.
+
+ Later, when the abbreviation is expanded because the user typed in
+ the word "esc", the long form is subjected to the same type of
+ ^V interpretation as keyboard input. So the ^V protects the ^[
+ character from being interpreted as the "exit input-mode" character.
+ Instead, the ^[ is inserted into the text.
+
+Expands to: ^[
+
+[example given by Steve Kirkendall]
+
+==============================================================================
+3. Local mappings and functions *script-local*
+
+When using several Vim script files, there is the danger that mappings and
+functions used in one script use the same name as in other scripts. To avoid
+this, they can be made local to the script.
+
+ *<SID>* *<SNR>* *E81*
+The string "<SID>" can be used in a mapping or menu. This requires that the
+'<' flag is not present in 'cpoptions'.
+ When executing the map command, Vim will replace "<SID>" with the special
+key code <SNR>, followed by a number that's unique for the script, and an
+underscore. Example: >
+ :map <SID>Add
+could define a mapping "<SNR>23_Add".
+
+When defining a function in a script, "s:" can be prepended to the name to
+make it local to the script. But when a mapping is executed from outside of
+the script, it doesn't know in which script the function was defined. To
+avoid this problem, use "<SID>" instead of "s:". The same translation is done
+as for mappings. This makes it possible to define a call to the function in
+mapping.
+
+When a local function is executed, it runs in the context of the script it was
+defined in. This means that new functions and mappings it defines can also
+use "s:" or "<SID>" and it will use the same unique number as when the
+function itself was defined. Also, the "s:var" local script variables can be
+used.
+
+When executing an autocommand or a user command, it will run in the context of
+the script it was defined in. This makes it possible that the command calls a
+local function or uses a local mapping.
+
+Otherwise, using "<SID>" outside of a script context is an error.
+
+If you need to get the script number to use in a complicated script, you can
+use this trick: >
+ :map <SID>xx <SID>xx
+ :let s:sid = maparg("<SID>xx")
+ :unmap <SID>xx
+And remove the trailing "xx".
+
+The "<SNR>" will be shown when listing functions and mappings. This is useful
+to find out what they are defined to.
+
+The |:scriptnames| command can be used to see which scripts have been sourced
+and what their <SNR> number is.
+
+This is all {not in Vi} and {not available when compiled without the +eval
+feature}.
+
+==============================================================================
+4. User-defined commands *user-commands*
+
+It is possible to define your own Ex commands. A user-defined command can act
+just like a built-in command (it can have a range or arguments, arguments can
+be completed as filenames or buffer names, etc), except that when the command
+is executed, it is transformed into a normal ex command and then executed.
+
+For starters: See section |40.2| in the user manual.
+
+ *E183* *user-cmd-ambiguous*
+All user defined commands must start with an uppercase letter, to avoid
+confusion with builtin commands. (There are a few builtin commands, notably
+:Next, :Print and :X, which do start with an uppercase letter. The builtin
+will always take precedence in these cases). The other characters of the user
+command can be uppercase letters, lowercase letters or digits. When using
+digits, note that other commands that take a numeric argument may become
+ambiguous. For example, the command ":Cc2" could be the user command ":Cc2"
+without an argument, or the command ":Cc" with argument "2". It is advised to
+put a space between the command name and the argument to avoid these problems.
+
+When using a user-defined command, the command can be abbreviated. However, if
+an abbreviation is not unique, an error will be issued. Furthermore, a
+built-in command will always take precedence.
+
+Example: >
+ :command Rename ...
+ :command Renumber ...
+ :Rena " Means "Rename"
+ :Renu " Means "Renumber"
+ :Ren " Error - ambiguous
+ :command Paste ...
+ :P " The built-in :Print
+
+It is recommended that full names for user-defined commands are used in
+scripts.
+
+:com[mand] *:com* *:command*
+ List all user-defined commands. When listing commands,
+ the characters in the first two columns are
+ ! Command has the -bang attribute
+ " Command has the -register attribute
+ b Command is local to current buffer
+ (see below for details on attributes)
+
+:com[mand] {cmd} List the user-defined commands that start with {cmd}
+
+ *E174* *E182*
+:com[mand][!] [{attr}...] {cmd} {rep}
+ Define a user command. The name of the command is
+ {cmd} and its replacement text is {rep}. The command's
+ attributes (see below) are {attr}. If the command
+ already exists, an error is reported, unless a ! is
+ specified, in which case the command is redefined.
+
+:delc[ommand] {cmd} *:delc* *:delcommand* *E184*
+ Delete the user-defined command {cmd}.
+
+:comc[lear] *:comc* *:comclear*
+ Delete all user-defined commands.
+
+Command attributes
+
+User-defined commands are treated by Vim just like any other ex commands. They
+can have arguments, or have a range specified. Arguments are subject to
+completion as filenames, buffers, etc. Exactly how this works depends upon the
+command's attributes, which are specified when the command is defined.
+
+There are a number of attributes, split into four categories: argument
+handling, completion behavior, range handling, and special cases. The
+attributes are described below, by category.
+
+Argument handling *E175* *E176*
+
+By default, a user defined command will take no arguments (and an error is
+reported if any are supplied). However, it is possible to specify that the
+command can take arguments, using the -nargs attribute. Valid cases are:
+
+ -nargs=0 No arguments are allowed (the default)
+ -nargs=1 Exactly one argument is required
+ -nargs=* Any number of arguments are allowed (0, 1, or many)
+ -nargs=? 0 or 1 arguments are allowed
+ -nargs=+ Arguments must be supplied, but any number are allowed
+
+Arguments are considered to be separated by (unescaped) spaces or Tabs in this
+context.
+
+Note that arguments are used as text, not as expressions. Specifically,
+"s:var" will use the script-local variable in the script where the command was
+defined, not where it is invoked! Example:
+ script1.vim: >
+ :let s:error = "None"
+ :command -nargs=1 Error echoerr <args>
+< script2.vim: >
+ :source script1.vim
+ :let s:error = "Wrong!"
+ :Error s:error
+Executing script2.vim will result in "None" to be echoed. Not what you
+intended! Calling a function may be an alternative.
+
+Completion behavior *:command-completion*
+ *E179* *E180* *E181*
+By default, the arguments of user defined commands do not undergo completion.
+However, by specifying one or the other of the following attributes, argument
+completion can be enabled:
+
+ -complete=augroup autocmd groups
+ -complete=buffer buffer names
+ -complete=command Ex command (and arguments)
+ -complete=dir directory names
+ -complete=environment environment variable names
+ -complete=event autocommand events
+ -complete=expression Vim expression
+ -complete=file file and directory names
+ -complete=function function name
+ -complete=help help subjects
+ -complete=highlight highlight groups
+ -complete=mapping mapping name
+ -complete=menu menus
+ -complete=option options
+ -complete=tag tags
+ -complete=tag_listfiles tags, file names are shown when CTRL-D is hit
+ -complete=var user variables
+ -complete=custom,{func} custom completion, defined via {func}
+
+Custom completion *:command-completion-custom*
+ *E467* *E468*
+It is possible to define customized completion schemes via the "custom,{func}"
+completion argument. The {func} part should be a function with the following
+prototype >
+
+ :function {func}(ArgLead, CmdLine, CursorPos)
+
+The function need not use all these arguments, but it should provide the
+completion candidates as the return value, one per line in a newline separated
+string. The function arguments are:
+ ArgLead the leading portion of the argument currently being
+ completed on
+ CmdLine the entire command line
+ CursorPos the cursor position in it
+The function may use these for determining context. It is not necessary to
+filter candidates against the (implicit pattern in) ArgLead. Vim will do
+filter the candidates with its regexp engine after function return, and this
+is probably more efficient in most cases.
+
+The following example lists user names to a Finger command >
+ :com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
+ :fun ListUsers(A,L,P)
+ : return system("cut -d: -f1 /etc/passwd")
+ :endfun
+
+Range handling *E177* *E178*
+
+By default, user-defined commands do not accept a line number range. However,
+it is possible to specify that the command does take a range (the -range
+attribute), or that it takes an arbitrary count value, either in the line
+number position (-range=N, like the |:split| command) or as a "count"
+argument (-count=N, like the |:Next| command). Possible attributes are:
+
+ -range Range allowed, default is current line
+ -range=% Range allowed, default is whole file (1,$)
+ -range=N A count (default N) which is specified in the line
+ number position (like |:split|)
+ -count=N A count (default N) which is specified either in the line
+ number position, or as an initial argument (like |:Next|)
+ Specifying -count (without a default) acts like -count=0
+
+Note that -range=N and -count=N are mutually exclusive - only one should be
+specified.
+
+Special cases
+
+There are some special cases as well:
+
+ -bang The command can take a ! modifier (like :q or :w)
+ -bar The command can be followed by a "|" and another command.
+ A "|" inside the command argument is not allowed then.
+ Also checks for a " to start a comment.
+ -register The first argument to the command can be an optional
+ register name (like :del, :put, :yank).
+ -buffer The command will only be available in the current buffer.
+
+In the cases of the -count and -register attributes, if the optional argument
+is supplied, it is removed from the argument list and is available to the
+replacement text separately.
+
+Replacement text
+
+The replacement text for a user defined command is scanned for special escape
+sequences, using <...> notation. Escape sequences are replaced with values
+from the entered command line, and all other text is copied unchanged. The
+resulting string is executed as an Ex command. If the initial < of an escape
+sequence is preceded by a backslash, the sequence is copied unchanged.
+
+The valid escape sequences are
+
+ *<line1>*
+ <line1> The starting line of the command range.
+ *<line2>*
+ <line2> The final line of the command range.
+ *<count>*
+ <count> Any count supplied (as described for the '-range'
+ and '-count' attributes).
+ *<bang>*
+ <bang> (See the '-bang' attribute) Expands to a ! if the
+ command was executed with a ! modifier, otherwise
+ expands to nothing.
+ *<reg>* *<register>*
+ <reg> (See the '-register' attribute) The optional register,
+ if specified. Otherwise, expands to nothing. <register>
+ is a synonym for this.
+ *<args>*
+ <args> The command arguments, exactly as supplied (but as
+ noted above, any count or register can consume some
+ of the arguments, which are then not part of <args>).
+ <lt> A single '<' (Less-Than) character. This is needed if you
+ want to get a literal copy of one of these escape sequences
+ into the expansion - for example, to get <bang>, use
+ <lt>bang>.
+
+ *<q-args>*
+If the first two characters of an escape sequence are "q-" (for example,
+<q-args>) then the value is quoted in such a way as to make it a valid value
+for use in an expression. This uses the argument as one single value.
+
+To allow commands to pass their arguments on to a user-defined function, there
+is a special form <f-args> ("function args"). This splits the command
+arguments at spaces and Tabs, quotes each argument individually, and the
+<f-args> sequence is replaced by the comma-separated list of quoted arguments.
+See the Mycmd example below. When there is no argument, <f-args> also has no
+argument.
+
+Examples >
+
+ " Delete everything after here to the end
+ :com Ddel +,$d
+
+ " Rename the current buffer
+ :com -nargs=1 -bang -complete=file Ren f <args>|w<bang>
+
+ " Replace a range with the contents of a file
+ " (Enter this all as one line)
+ :com -range -nargs=1 -complete=file
+ Replace <line1>-pu_|<line1>,<line2>d|r <args>|<line1>d
+
+ " Count the number of lines in the range
+ :com! -range -nargs=0 Lines :echo <line2> - <line1> + 1 "lines"
+
+ " Call a user function (example of <f-args>)
+ :com -nargs=* Mycmd call Myfunc(<f-args>)
+
+When executed as: >
+ :Mycmd arg1 arg2
+This will invoke: >
+ :call Myfunc("arg1","arg2")
+
+ :" A more substantial example
+ :function Allargs(command)
+ : let i = 0
+ : while i < argc()
+ : if filereadable(argv(i))
+ : execute "e " . argv(i)
+ : execute a:command
+ : endif
+ : let i = i + 1
+ : endwhile
+ :endfunction
+ :command -nargs=+ -complete=command Allargs call Allargs(<q-args>)
+
+The command Allargs takes any Vim command(s) as argument and executes it on all
+files in the argument list. Usage example (note use of the "e" flag to ignore
+errors and the "update" command to write modified buffers): >
+ :Allargs %s/foo/bar/ge|update
+This will invoke: >
+ :call Allargs("%s/foo/bar/ge|update")
+<
+When defining an user command in a script, it will be able to call functions
+local to the script and use mappings local to the script. When the user
+invokes the user command, it will run in the context of the script it was
+defined in. This matters if |<SID>| is used in a command.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
new file mode 100644
index 000000000..52c3b2406
--- /dev/null
+++ b/runtime/doc/mbyte.txt
@@ -0,0 +1,1368 @@
+*mbyte.txt* For Vim version 7.0aa. Last change: 2004 Jun 07
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar et al.
+
+
+Multi-byte support *multibyte* *multi-byte*
+ *Chinese* *Japanese* *Korean*
+This is about editing text in languages which have many characters that can
+not be represented using one byte (one octet). Examples are Chinese, Japanese
+and Korean. Unicode is also covered here.
+
+For an introduction to the most common features, see |usr_45.txt| in the user
+manual.
+For changing the language of messages and menus see |mlang.txt|.
+
+{not available when compiled without the +multi_byte feature}
+
+
+1. Getting started |mbyte-first|
+2. Locale |mbyte-locale|
+3. Encoding |mbyte-encoding|
+4. Using a terminal |mbyte-terminal|
+5. Fonts on X11 |mbyte-fonts-X11|
+6. Fonts on MS-Windows |mbyte-fonts-MSwin|
+7. Input on X11 |mbyte-XIM|
+8. Input on MS-Windows |mbyte-IME|
+9. Input with a keymap |mbyte-keymap|
+10. Using UTF-8 |mbyte-utf8|
+11. Overview of options |mbyte-options|
+
+NOTE: This file contains UTF-8 characters. These may show up as strange
+characters or boxes when using another encoding.
+
+==============================================================================
+1. Getting started *mbyte-first*
+
+This is a summary of the multibyte features in Vim. If you are lucky it works
+as described and you can start using Vim without much trouble. If something
+doesn't work you will have to read the rest. Don't be surprised if it takes
+quite a bit of work and experimenting to make Vim use all the multi-byte
+features. Unfortunately, every system has its own way to deal with multibyte
+languages and it is quite complicated.
+
+
+COMPILING
+
+If you already have a compiled Vim program, check if the |+multi_byte| feature
+is included. The |:version| command can be used for this.
+
+If +multi_byte is not included, you should compile Vim with "big" features.
+You can further tune what features are included. See the INSTALL files in the
+source directory.
+
+
+LOCALE
+
+First of all, you must make sure your current locale is set correctly. If
+your system has been installed to use the language, it probably works right
+away. If not, you can often make it work by setting the $LANG environment
+variable in your shell: >
+
+ setenv LANG ja_JP.EUC
+
+Unfortunately, the name of the locale depends on your system. Japanese might
+also be called "ja_JP.EUCjp" or just "ja". To see what is currently used: >
+
+ :language
+
+To change the locale inside Vim use: >
+
+ :language ja_JP.EUC
+
+Vim will give an error message if this doesn't work. This is a good way to
+experiment and find the locale name you want to use. But it's always better
+to set the locale in the shell, so that it is used right from the start.
+
+See |mbyte-locale| for details.
+
+
+ENCODING
+
+If your locale works properly, Vim will try to set the 'encoding' option
+accordingly. If this doesn't work you can overrule its value: >
+
+ :set encoding=utf-8
+
+See |encoding-values| for a list of acceptable values.
+
+The result is that all the text that is used inside Vim will be in this
+encoding. Not only the text in the buffers, but also in registers, variables,
+etc. This also means that changing the value of 'encoding' makes the existing
+text invalid! The text doesn't change, but it will be displayed wrong.
+
+You can edit files in another encoding than what 'encoding' is set to. Vim
+will convert the file when you read it and convert it back when you write it.
+See 'fileencoding', 'fileencodings' and |++enc|.
+
+
+DISPLAY AND FONTS
+
+If you are working in a terminal (emulator) you must make sure it accepts the
+same encoding as which Vim is working with. If this is not the case, you can
+use the 'termencoding' option to make Vim convert text automatically.
+
+For the GUI you must select fonts that work with the current 'encoding'. This
+is the difficult part. It depends on the system you are using, the locale and
+a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
+X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
+
+For GTK+ 2, you can skip most of this section. The option 'guifontset' does
+no longer exist. You only need to set 'guifont' and everything should "just
+work". If your system comes with Xft2 and fontconfig and the current font
+does not contain a certain glyph, a different font will be used automatically
+if available. The 'guifontwide' option is still supported but usually you do
+not need to set it. It is only necessary if the automatic font selection does
+not suit your needs.
+
+For X11 you can set the 'guifontset' option to a list of fonts that together
+cover the characters that are used. Example for Korean: >
+
+ :set guifontset=k12,r12
+
+Alternatively, you can set 'guifont' and 'guifontwide'. 'guifont' is used for
+the single-width characters, 'guifontwide' for the double-width characters.
+Thus the 'guifontwide' font must be exactly twice as wide as 'guifont'.
+Example for UTF-8: >
+
+ :set guifont=-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
+ :set guifontwide=-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
+
+You can also set 'guifont' alone, Vim will try to find a matching
+'guifontwide' for you.
+
+
+INPUT
+
+There are several ways to enter multi-byte characters:
+- For X11 XIM can be used. See |XIM|.
+- For MS-Windows IME can be used. See |IME|.
+- For all systems keymaps can be used. See |mbyte-keymap|.
+
+The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
+the different input medhods or disable them temporarily.
+
+==============================================================================
+2. Locale *mbyte-locale*
+
+The easiest setup is when your whole system uses the locale you want to work
+in. But it's also possible to set the locale for one shell you are working
+in, or just use a certain locale inside Vim.
+
+
+WHAT IS A LOCALE? *locale*
+
+There are many of languages in the world. And there are different cultures
+and environments at least as much as the number of languages. A linguistic
+environment corresponding to an area is called "locale". This includes
+information about the used language, the charset, collating order for sorting,
+date format, currency format and so on. For Vim only the language and charset
+really matter.
+
+You can only use a locale if your system has support for it. Some systems
+have only a few locales, especially in the USA. The language which you want
+to use may not be on your system. In that case you might be able to install
+it as an extra package. Check your system documentation for how to do that.
+
+The location in which the locales are installed varies from system to system.
+For example, "/usr/share/locale" or "/usr/lib/locale". See your system's
+setlocale() man page.
+
+Looking in these directories will show you the exact name of each locale.
+Mostly upper/lowercase matters, thus "ja_JP.EUC" and "ja_jp.euc" are
+different. Some systems have a locale.alias file, which allows translation
+from a short name like "nl" to the full name "nl_NL.ISO_8859-1".
+
+Note that X-windows has its own locale stuff. And unfortunately uses locale
+names different from what is used elsewhere. This is confusing! For Vim it
+matters what the setlocale() function uses, which is generally NOT the
+X-windows stuff. You might have to do some experiments to find out what
+really works.
+
+ *locale-name*
+The (simplified) format of |locale| name is:
+
+ language
+or language_territory
+or language_territory.codeset
+
+Territory means the country (or part of it), codeset means the |charset|. For
+example, the locale name "ja_JP.eucJP" means:
+ ja the language is Japanese
+ JP the country is Japan
+ eucJP the codeset is EUC-JP
+But it also could be "ja", "ja_JP.EUC", "ja_JP.ujis", etc. And unfortunately,
+the locale name for a specific language, territory and codeset is not unified
+and depends on your system.
+
+Examples of locale name:
+ charset language locale name ~
+ GB2312 Chinese (simplified) zh_CN.EUC, zh_CN.GB2312
+ Big5 Chinese (traditional) zh_TW.BIG5, zh_TW.Big5
+ CNS-11643 Chinese (traditional) zh_TW
+ EUC-JP Japanese ja, ja_JP.EUC, ja_JP.ujis, ja_JP.eucJP
+ Shift_JIS Japanese ja_JP.SJIS, ja_JP.Shift_JIS
+ EUC-KR Korean ko, ko_KR.EUC
+
+
+USING A LOCALE
+
+To start using a locale for the whole system, see the documentation of your
+system. Mostly you need to set it in a configuration file in "/etc".
+
+To use a locale in a shell, set the $LANG environment value. When you want to
+use Korean and the |locale| name is "ko", do this:
+
+ sh: export LANG=ko
+ csh: setenv LANG ko
+
+You can put this in your ~/.profile or ~/.cshrc file to always use it.
+
+To use a locale in Vim only, use the |:language| command: >
+
+ :language ko
+
+Put this in your ~/.vimrc file to use it always.
+
+Or specify $LANG when starting Vim:
+
+ sh: LANG=ko vim {vim-arguments}
+ csh: env LANG=ko vim {vim-arguments}
+
+You could make a small shell script for this.
+
+==============================================================================
+3. Encoding *mbyte-encoding*
+
+Vim uses the 'encoding' option to specify how characters identified and
+encoded when they are used inside Vim. This applies to all the places where
+text is used, including buffers (files loaded into memory), registers and
+variables.
+
+ *charset* *codeset*
+Charset is another name for encoding. There are subtle differences, but these
+don't matter when using Vim. "codeset" is another similar name.
+
+Each character is encoded as one or more bytes. When all characters are
+encoded with one byte, we call this a single-byte encoding. The most often
+used one is called "latin1". This limits the number of characters to 256.
+Some of these are control characters, thus even fewer can be used for text.
+
+When some characters use two or more bytes, we call this a multi-byte
+encoding. This allows using much more than 256 characters, which is required
+for most East Asian languages.
+
+Most multi-byte encodings use one byte for the first 127 characters. These
+are equal to ASCII, which makes it easy to exchange plain-ASCII text, no
+matter what language is used. Thus you might see the right text even when the
+encoding was set wrong.
+
+ *encoding-names*
+Vim can use many different character encodings. There are three major groups:
+
+1 8bit Single-byte encodings, 256 different characters. Mostly used
+ in USA and Europe. Example: ISO-8859-1 (Latin1). All
+ characters occupy one screen cell only.
+
+2 2byte Double-byte encodings, over 10000 different characters.
+ Mostly used in Asian countries. Example: euc-kr (Korean)
+ The number of screen cells is equal to the number of bytes
+ (except for euc-jp when the first byte is 0x8e).
+
+u Unicode Universal encoding, can replace all others. ISO 10646.
+ Millions of different characters. Example: UTF-8. The
+ relation between bytes and screen cells is complex.
+
+Other encodings cannot be used by Vim internally. But files in other
+encodings can be edited by using conversion, see 'fileencoding'.
+Note that all encodings must use ASCII for the characters up to 128 (except
+when compiled for EBCDIC).
+
+Supported 'encoding' values are: *encoding-values*
+1 latin1 8-bit characters (ISO 8859-1)
+1 iso-8859-n ISO_8859 variant (n = 2 to 15)
+1 koi8-r Russian
+1 koi8-u Ukrainian
+1 macroman MacRoman (Macintosh encoding)
+1 8bit-{name} any 8-bit encoding (Vim specific name)
+1 cp{number} MS-Windows: any installed single-byte codepage
+2 cp932 Japanese (Windows only)
+2 euc-jp Japanese (Unix only)
+2 sjis Japanese (Unix only)
+2 cp949 Korean (Unix and Windows)
+2 euc-kr Korean (Unix only)
+2 cp936 simplified Chinese (Windows only)
+2 euc-cn simplified Chinese (Unix only)
+2 cp950 traditional Chinese (on Unix alias for big5)
+2 big5 traditional Chinese (on Windows alias for cp950)
+2 euc-tw traditional Chinese (Unix only)
+2 2byte-{name} Unix: any double-byte encoding (Vim specific name)
+2 cp{number} MS-Windows: any installed double-byte codepage
+u utf-8 32 bit UTF-8 encoded Unicode (ISO/IEC 10646-1)
+u ucs-2 16 bit UCS-2 encoded Unicode (ISO/IEC 10646-1)
+u ucs-2le like ucs-2, little endian
+u utf-16 ucs-2 extended with double-words for more characters
+u utf-16le like utf-16, little endian
+u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
+u ucs-4le like ucs-4, little endian
+
+The {name} can be any encoding name that your system supports. It is passed
+to iconv() to convert between the encoding of the file and the current locale.
+For MS-Windows "cp{number}" means using codepage {number}.
+Examples: >
+ :set encoding=8bit-cp1252
+ :set encoding=2byte-cp932
+<
+Several aliases can be used, they are translated to one of the names above.
+An incomplete list:
+
+1 ansi same as latin1 (obsolete, for backward compatibility)
+2 japan Japanese: on Unix "euc-jp", on MS-Windows cp932
+2 korea Korean: on Unix "euc-kr", on MS-Windows cp949
+2 prc simplified Chinese: on Unix "euc-cn", on MS-Windows cp936
+2 chinese same as "prc"
+2 taiwan traditional Chinese: on Unix "euc-tw", on MS-Windows cp950
+u utf8 same as utf-8
+u unicode same as ucs-2
+u ucs2be same as ucs-2 (big endian)
+u ucs-2be same as ucs-2 (big endian)
+u ucs-4be same as ucs-4 (big endian)
+
+For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
+you can. The default is to use big-endian (most significant byte comes
+first):
+ name bytes char ~
+ ucs-2 11 22 1122
+ ucs-2le 22 11 1122
+ ucs-4 11 22 33 44 11223344
+ ucs-4le 44 33 22 11 11223344
+
+On MS-Windows systems you often want to use "ucs-2le", because it uses little
+endian UCS-2.
+
+There are a few encodings which are similar, but not exactly the same. Vim
+treats them as if they were different encodings, so that conversion will be
+done when needed. You might want to use the similar name to avoid conversion
+or when conversion is not possible:
+
+ cp932, shift-jis, sjis
+ cp936, euc-cn
+
+ *encoding-table*
+Normally 'encoding' is equal to your current locale and 'termencoding' is
+empty. This means that your keyboard and display work with characters encoded
+in your current locale, and Vim uses the same characters internally.
+
+You can make Vim use characters in a different encoding by setting the
+'encoding' option to a different value. Since the keyboard and display still
+use the current locale, conversion needs to be done. The 'termencoding' then
+takes over the value of the current locale, so Vim converts between 'encoding'
+and 'termencoding'. Example: >
+ :let &termencoding = &encoding
+ :set encoding=utf-8
+
+However, not all combinations of values are possible. The table below tells
+you how each of the nine combinations works. This is further restricted by
+not all conversions being possible, iconv() being present, etc. Since this
+depends on the system used, no detailed list can be given.
+
+('tenc' is the short name for 'termencoding' and 'enc' short for 'encoding')
+
+'tenc' 'enc' remark ~
+
+ 8bit 8bit Works. When 'termencoding' is different from
+ 'encoding' typing and displaying may be wrong for some
+ characters, Vim does NOT perform conversion (set
+ 'encoding' to "utf-8" to get this).
+ 8bit 2byte MS-Windows: works for all codepages installed on your
+ system; you can only type 8bit characters;
+ Other systems: does NOT work.
+ 8bit Unicode Works, but you can only type 8bit characters; in a
+ terminal you can only see 8bit characters; the GUI can
+ show all characters that the 'guifont' supports.
+
+ 2byte 8bit Works, but typing non-ASCII characters might
+ be a problem.
+ 2byte 2byte MS-Windows: works for all codepages installed on your
+ system; typing characters might be a problem when
+ locale is different from 'encoding'.
+ Other systems: Only works when 'termencoding' is equal
+ to 'encoding', you might as well leave it empty.
+ 2byte Unicode works, Vim will translate typed characters.
+
+ Unicode 8bit works (unusual)
+ Unicode 2byte does NOT work
+ Unicode Unicode works very well (leaving 'termencoding' empty works
+ the same way, because all Unicode is handled
+ internally as UTF-8)
+
+CONVERSION *charset-conversion*
+
+Vim will automatically convert from one to another encoding in several places:
+- When reading a file and 'fileencoding' is different from 'encoding'
+- When writing a file and 'fileencoding' is different from 'encoding'
+- When displaying characters and 'termencoding' is different from 'encoding'
+- When reading input and 'termencoding' is different from 'encoding'
+- When displaying messages and the encoding used for LC_MESSAGES differs from
+ 'encoding' (requires a gettext version that supports this).
+- When reading a Vim script where |:scriptencoding| is different from
+ 'encoding'.
+- When reading or writing a |viminfo| file.
+Most of these require the |+iconv| feature. Conversion for reading and
+writing files may also be specified with the 'charconvert' option.
+
+Useful utilities for converting the charset:
+ All: iconv
+ GNU iconv can convert most encodings. Unicode is used as the
+ intermediate encoding, which allows conversion from and to all other
+ encodings. See http://www.gnu.org/directory/libiconv.html.
+
+ Japanese: nkf
+ Nkf is "Network Kanji code conversion Filter". One of the most unique
+ facility of nkf is the guess of the input Kanji code. So, you don't
+ need to know what the inputting file's |charset| is. When convert to
+ EUC-JP from ISO-2022-JP or Shift_JIS, simply do the following command
+ in Vim:
+ :%!nkf -e
+ Nkf can be found at:
+ http://www.sfc.wide.ad.jp/~max/FreeBSD/ports/distfiles/nkf-1.62.tar.gz
+
+ Chinese: hc
+ Hc is "Hanzi Converter". Hc convert a GB file to a Big5 file, or Big5
+ file to GB file. Hc can be found at:
+ ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
+
+ Korean: hmconv
+ Hmconv is Korean code conversion utility especially for E-mail. It can
+ convert between EUC-KR and ISO-2022-KR. Hmconv can be found at:
+ ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
+
+ Multilingual: lv
+ Lv is a Powerful Multilingual File Viewer. And it can be worked as
+ |charset| converter. Supported |charset|: ISO-2022-CN, ISO-2022-JP,
+ ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
+ series, Shift_JIS, Big5 and HZ. Lv can be found at:
+ http://www.ff.iij4u.or.jp/~nrt/freeware/lv4495.tar.gz
+
+
+ *mbyte-conversion*
+When reading and writing files in an encoding different from 'encoding',
+conversion needs to be done. These conversions are supported:
+- All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
+ handled internally.
+- For MS-Windows, when 'encoding' is a Unicode encoding, conversion from and
+ to any codepage should work.
+- Conversion specified with 'charconvert'
+- Conversion with the iconv library, if it is available.
+ Old versions of GNU iconv() may cause the conversion to fail (they
+ request a very large buffer, more than Vim is willing to provide).
+ Try getting another iconv() implementation.
+
+==============================================================================
+4. Using a terminal *mbyte-terminal*
+
+The GUI fully supports multi-byte characters. It is also possible in a
+terminal, if the terminal supports the same encoding that Vim uses. Thus this
+is less flexible.
+
+For example, you can run Vim in a xterm with added multi-byte support and/or
+|XIM|. Examples are kterm (Kanji term) and hanterm (for Korean), Eterm
+(Enlightened terminal) and rxvt.
+
+If your terminal does not support the right encoding, you can set the
+'termencoding' option. Vim will then convert the typed characters from
+'termencoding' to 'encoding'. And displayed text will be converted from
+'encoding' to 'termencoding'. If the encoding supported by the terminal
+doesn't include all the characters that Vim uses, this leads to lost
+characters. This may mess up the display. If you use a terminal that
+supports Unicode, such as the xterm mentioned below, it should work just fine,
+since nearly every character set can be converted to Unicode without loss of
+information.
+
+
+UTF-8 IN XFREE86 XTERM *UTF8-xterm*
+
+This is a short explanation of how to use UTF-8 character encoding in the
+xterm that comes with XFree86 by Thomas Dickey (text by Markus Kuhn).
+
+Get the latest xterm version which has now UTF-8 support:
+
+ http://invisible-island.net/xterm/xterm.html
+
+Compile it with "./configure --enable-wide-chars ; make"
+
+Also get the ISO 10646-1 version of various fonts, which is available on
+
+ http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz
+
+and install the font as described in the README file.
+
+Now start xterm with >
+
+ xterm -u8 -fn -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
+or, for bigger character: >
+ xterm -u8 -fn -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
+
+and you will have a working UTF-8 terminal emulator. Try both >
+
+ cat utf-8-demo.txt
+ vim utf-8-demo.txt
+
+with the demo text that comes with ucs-fonts.tar.gz in order to see
+whether there are any problems with UTF-8 in your xterm.
+
+For Vim you may need to set 'encoding' to "utf-8".
+
+==============================================================================
+5. Fonts on X11 *mbyte-fonts-X11*
+
+Unfortunately, using fonts in X11 is complicated. The name of a single-byte
+font is a long string. For multi-byte fonts we need several of these...
+
+Note: Most of this is no longer relevant for GTK+ 2. Selecting a font via
+its XLFD is not supported anymore; see 'guifont' for an example of how to
+set the font. Do yourself a favor and ignore the |XLFD| and |xfontset|
+sections below.
+
+First of all, Vim only accepts fixed-width fonts for displaying text. You
+cannot use proportionally spaced fonts. This excludes many of the available
+(and nicer looking) fonts. However, for menus and tooltips any font can be
+used.
+
+Note that Display and Input are independent. It is possible to see your
+language even though you have no input method for it.
+
+You should get a default font for menus and tooltips that works, but it might
+be ugly. Read the following to find out how to select a better font.
+
+
+X LOGICAL FONT DESCRIPTION (XLFD)
+ *XLFD*
+XLFD is the X font name and contains the information about the font size,
+charset, etc. The name is in this format:
+
+FOUNDRY-FAMILY-WEIGHT-SLANT-WIDTH-STYLE-PIXEL-POINT-X-Y-SPACE-AVE-CR-CE
+
+Each field means:
+
+- FOUNDRY: FOUNDRY field. The company that created the font.
+- FAMILY: FAMILY_NAME field. Basic font family name. (helvetica, gothic,
+ times, etc)
+- WEIGHT: WEIGHT_NAME field. How thick the letters are. (light, medium,
+ bold, etc)
+- SLANT: SLANT field.
+ r: Roman (no slant)
+ i: Italic
+ o: Oblique
+ ri: Reverse Italic
+ ro: Reverse Oblique
+ ot: Other
+ number: Scaled font
+- WIDTH: SETWIDTH_NAME field. Width of characters. (normal, condensed,
+ narrow, double wide)
+- STYLE: ADD_STYLE_NAME field. Extra info to describe font. (Serif, Sans
+ Serif, Informal, Decorated, etc)
+- PIXEL: PIXEL_SIZE field. Height, in pixels, of characters.
+- POINT: POINT_SIZE field. Ten times height of characters in points.
+- X: RESOLUTION_X field. X resolution (dots per inch).
+- Y: RESOLUTION_Y field. Y resolution (dots per inch).
+- SPACE: SPACING field.
+ p: Proportional
+ m: Monospaced
+ c: CharCell
+- AVE: AVERAGE_WIDTH field. Ten times average width in pixels.
+- CR: CHARSET_REGISTRY field. The name of the charset group.
+- CE: CHARSET_ENCODING field. The rest of the charset name. For some
+ charsets, such as JIS X 0208, if this field is 0, code points has
+ the same value as GL, and GR if 1.
+
+For example, in case of a 14 dots font corresponding to JIS X 0208, it is
+written like:
+ -misc-fixed-medium-r-normal--16-110-100-100-c-160-jisx0208.1990-0
+
+
+X FONTSET
+ *fontset* *xfontset*
+A single-byte charset is typically associated with one font. For multi-byte
+charsets a combination of fonts is often used. This means that one group of
+characters are used from one font and another group from another font (which
+might be double wide). This collection of fonts is called a fontset.
+
+Which fonts are required in a fontset depends on the current locale. X
+windows maintains a table of which groups of characters are required for a
+locale. You have to specify all the fonts that a locale requires in the
+'guifontset' option.
+
+NOTE: The fontset always uses the current locale, even though 'encoding' may
+be set to use a different charset. In that situation you might want to use
+'guifont' and 'guifontwide' instead of 'guifontset'.
+
+Example:
+ |charset| language "groups of characters" ~
+ GB2312 Chinese (simplified) ISO-8859-1 and GB 2312
+ Big5 Chinese (traditional) ISO-8859-1 and Big5
+ CNS-11643 Chinese (traditional) ISO-8859-1, CNS 11643-1 and CNS 11643-2
+ EUC-JP Japanese JIS X 0201 and JIS X 0208
+ EUC-KR Korean ISO-8859-1 and KS C 5601 (KS X 1001)
+
+You can search for fonts using the xlsfonts command. For example, when you're
+searching for a font for KS C 5601: >
+ xlsfonts | grep ksc5601
+
+This is complicated and confusing. You might want to consult the X-Windows
+documentation if there is something you don't understand.
+
+ *base_font_name_list*
+When you have found the names of the fonts you want to use, you need to set
+the 'guifontset' option. You specify the list by concatenating the font names
+and putting a comma in between them.
+
+For example, when you use the ja_JP.eucJP locale, this requires JIS X 0201
+and JIS X 0208. You could supply a list of fonts that explicitly specifies
+the charsets, like: >
+
+ :set guifontset=-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0,
+ \-misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
+
+Alternatively, you can supply a base font name list that omits the charset
+name, letting X-Windows select font characters required for the locale. For
+example: >
+
+ :set guifontset=-misc-fixed-medium-r-normal--14-130-75-75-c-140,
+ \-misc-fixed-medium-r-normal--14-130-75-75-c-70
+
+Alternatively, you can supply a single base font name that allows X-Windows to
+select from all available fonts. For example: >
+
+ :set guifontset=-misc-fixed-medium-r-normal--14-*
+
+Alternatively, you can specify alias names. See the fonts.alias file in the
+fonts directory (e.g., /usr/X11R6/lib/X11/fonts/). For example: >
+
+ :set guifontset=k14,r14
+<
+ *E253*
+Note that in East Asian fonts, the standard character cell is square. When
+mixing a Latin font and an East Asian font, the East Asian font width should
+be twice the Latin font width.
+
+If 'guifontset' is not empty, the "font" argument of the |:highlight| command
+is also interpreted as a fontset. For example, you should use for
+highlighting: >
+ :hi Comment font=english_font,your_font
+If you use a wrong "font" argument you will get an error message.
+Also make sure that you set 'guifontset' before setting fonts for highlight
+groups.
+
+
+USING RESOURCE FILES
+
+Instead of specifying 'guifontset', you can set X11 resources and Vim will
+pick them up. This is only for people who know how X resource files work.
+
+For Motif and Athena insert these three lines in your $HOME/.Xdefaults file:
+
+ Vim.font: |base_font_name_list|
+ Vim*fontSet: |base_font_name_list|
+ Vim*fontList: your_language_font
+
+Note: Vim.font is for text area.
+ Vim*fontSet is for menu.
+ Vim*fontList is for menu (for Motif GUI)
+
+For example, when you are using Japanese and a 14 dots font, >
+
+ Vim.font: -misc-fixed-medium-r-normal--14-*
+ Vim*fontSet: -misc-fixed-medium-r-normal--14-*
+ Vim*fontList: -misc-fixed-medium-r-normal--14-*
+<
+or: >
+
+ Vim*font: k14,r14
+ Vim*fontSet: k14,r14
+ Vim*fontList: k14,r14
+<
+To have them take effect immediately you will have to do >
+
+ xrdb -merge ~/.Xdefaults
+
+Otherwise you will have to stop and restart the X server before the changes
+take effect.
+
+
+The GTK+ version of GUI Vim does not use .Xdefaults, use ~/.gtkrc instead.
+The default mostly works OK. But for the menus you might have to change
+it. Example: >
+
+ style "default"
+ {
+ fontset="-*-*-medium-r-normal--14-*-*-*-c-*-*-*"
+ }
+ widget_class "*" style "default"
+
+==============================================================================
+6. Fonts on MS-Windows *mbyte-fonts-MSwin*
+
+The simplest is to use the font dialog to select fonts and try them out. You
+can find this at the "Edit/Select Font..." menu. Once you find a font name
+that works well you can use this command to see its name: >
+
+ :set guifont
+
+Then add a command to your |gvimrc| file to set 'guifont': >
+
+ :set guifont=courier_new:h12
+
+==============================================================================
+7. Input on X11 *mbyte-XIM*
+
+X INPUT METHOD (XIM) BACKGROUND *XIM* *xim* *x-input-method*
+
+XIM is an international input module for X. There are two kind of structures,
+Xlib unit type and |IM-server| (Input-Method server) type. |IM-server| type
+is suitable for complex input, such as CJK.
+
+- IM-server
+ *IM-server*
+ In |IM-server| type input structures, the input event is handled by either
+ of the two ways: FrontEnd system and BackEnd system. In the FrontEnd
+ system, input events are snatched by the |IM-server| first, then |IM-server|
+ give the application the result of input. On the other hand, the BackEnd
+ system works reverse order. MS Windows adopt BackEnd system. In X, most of
+ |IM-server|s adopt FrontEnd system. The demerit of BackEnd system is the
+ large overhead in communication, but it provides safe synchronization with
+ no restrictions on applications.
+
+ For example, there are xwnmo and kinput2 Japanese |IM-server|, both are
+ FrontEnd system. Xwnmo is distributed with Wnn (see below), kinput2 can be
+ found at: ftp://ftp.sra.co.jp/pub/x11/kinput2/
+
+ For Chinese, there's a great XIM server named "xcin", you can input both
+ Traditional and Simplified Chinese characters. And it can accept other
+ locale if you make a correct input table. Xcin can be found at:
+ http://xcin.linux.org.tw/
+
+- Conversion Server
+ *conversion-server*
+ Some system needs additional server: conversion server. Most of Japanese
+ |IM-server|s need it, Kana-Kanji conversion server. For Chinese inputting,
+ it depends on the method of inputting, in some methods, PinYin or ZhuYin to
+ HanZi conversion server is needed. For Korean inputting, if you want to
+ input Hanja, Hangul-Hanja conversion server is needed.
+
+ For example, the Japanese inputting process is divided into 2 steps. First
+ we pre-input Hira-gana, second Kana-Kanji conversion. There are so many
+ Kanji characters (6349 Kanji characters are defined in JIS X 0208) and the
+ number of Hira-gana characters are 76. So, first, we pre-input text as
+ pronounced in Hira-gana, second, we convert Hira-gana to Kanji or Kata-Kana,
+ if needed. There are some Kana-Kanji conversion server: jserver
+ (distributed with Wnn, see below) and canna. Canna could be found at:
+ ftp://ftp.nec.co.jp/pub/Canna/ (no longer works).
+
+There is a good input system: Wnn4.2. Wnn 4.2 contains,
+ xwnmo (|IM-server|)
+ jserver (Japanese Kana-Kanji conversion server)
+ cserver (Chinese PinYin or ZhuYin to simplified HanZi conversion server)
+ tserver (Chinese PinYin or ZhuYin to traditional HanZi conversion server)
+ kserver (Hangul-Hanja conversion server)
+Wnn 4.2 for several systems can be found at various places on the internet.
+Use the RPM or port for your system.
+
+
+- Input Style
+ *xim-input-style*
+ When inputting CJK, there are four areas:
+ 1. The area to display of the input while it is being composed
+ 2. The area to display the currently active input mode.
+ 3. The area to display the next candidate for the selection.
+ 4. The area to display other tools.
+
+ The third area is needed when converting. For example, in Japanese
+ inputting, multiple Kanji characters could have the same pronunciation, so
+ a sequence of Hira-gana characters could map to a distinct sequence of Kanji
+ characters.
+
+ The first and second areas are defined in international input of X with the
+ names of "Preedit Area", "Status Area" respectively. The third and fourth
+ areas are not defined and are left to be managed by the |IM-server|. In the
+ international input, four input styles have been defined using combinations
+ of Preedit Area and Status Area: |OnTheSpot|, |OffTheSpot|, |OverTheSpot|
+ and |Root|.
+
+ Currently, GUI Vim support three style, |OverTheSpot|, |OffTheSpot| and
+ |Root|.
+
+*. on-the-spot *OnTheSpot*
+ Preedit Area and Status Area are performed by the client application in
+ the area of application. The client application is directed by the
+ |IM-server| to display all pre-edit data at the location of text
+ insertion. The client registers callbacks invoked by the input method
+ during pre-editing.
+*. over-the-spot *OverTheSpot*
+ Status Area is created in a fixed position within the area of application,
+ in case of Vim, the position is the additional status line. Preedit Area
+ is made at present input position of application. The input method
+ displays pre-edit data in a window which it brings up directly over the
+ text insertion position.
+*. off-the-spot *OffTheSpot*
+ Preedit Area and Status Area are performed in the area of application, in
+ case of Vim, the area is additional status line. The client application
+ provides display windows for the pre-edit data to the input method which
+ displays into them directly.
+*. root-window *Root*
+ Preedit Area and Status Area are outside of the application. The input
+ method displays all pre-edit data in a separate area of the screen in a
+ window specific to the input method.
+
+
+USING XIM *multibyte-input* *E284* *E286* *E287* *E288*
+ *E285* *E291* *E292* *E290* *E289*
+
+Note that Display and Input are independent. It is possible to see your
+language even though you have no input method for it. But when your Display
+method doesn't match your Input method, the text will be displayed wrong.
+
+ Note: You can not use IM unless you specify 'guifontset'.
+ Therefore, Latin users, you have to also use 'guifontset'
+ if you use IM.
+
+To input your language you should run the |IM-server| which supports your
+language and |conversion-server| if needed.
+
+The next 3 lines should be put in your ~/.Xdefaults file. They are common for
+all X applications which uses |XIM|. If you already use |XIM|, you can skip
+this. >
+
+ *international: True
+ *.inputMethod: your_input_server_name
+ *.preeditType: your_input_style
+<
+input_server_name is your |IM-server| name (check your |IM-server|
+ manual).
+your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See
+ also |xim-input-style|.
+
+*international may not necessary if you use X11R6.
+*.inputMethod and *.preeditType are optional if you use X11R6.
+
+For example, when you are using kinput2 as |IM-server|, >
+
+ *international: True
+ *.inputMethod: kinput2
+ *.preeditType: OverTheSpot
+<
+When using |OverTheSpot|, GUI Vim always connects to the IM Server even in
+Normal mode, so you can input your language with commands like "f" and "r".
+But when using one of the other two methods, GUI Vim connects to the IM Server
+only if it is not in Normal mode.
+
+If your IM Server does not support |OverTheSpot|, and if you want to use your
+language with some Normal mode command like "f" or "r", then you should use a
+localized xterm or an xterm which supports |XIM|
+
+If needed, you can set the XMODIFIERS environment variable:
+
+ sh: export XMODIFIERS="@im=input_server_name"
+ csh: setenv XMODIFIERS "@im=input_server_name"
+
+For example, when you are using kinput2 as |IM-server| and sh, >
+
+ export XMODIFIERS="@im=kinput2"
+<
+
+FULLY CONTROLLED XIM
+
+You can fully control XIM, like with IME of MS-Windows (see |multibyte-ime|).
+This is currently only available for the GTK GUI.
+
+Before using fully controlled XIM, one setting is required. Set the
+'imactivatekey' option to the key that is used for the activation of the input
+method. For example, when you are using kinput2 + canna as IM Server, the
+activation key is probably Shift+Space: >
+
+ :set imactivatekey=S-space
+
+See 'imactivatekey' for the format.
+
+==============================================================================
+8. Input on MS-Windows *mbyte-IME*
+
+(Windows IME support) *multibyte-ime* *IME*
+
+{only works Windows GUI and compiled with the |+multi_byte_ime| feature}
+
+To input multibyte characters on Windows, you have to use Input Method Editor
+(IME). In process of your editing text, you must switch status (on/off) of
+IME many many many times. Because IME with status on is hooking all of your
+key inputs, you cannot input 'j', 'k', or almost all of keys to Vim directly.
+
+This |+multi_byte_ime| feature help this. It reduce times of switch status of
+IME manually. In normal mode, there are almost no need working IME, even
+editing multibyte text. So exiting insert mode with ESC, Vim memorize last
+status of IME and force turn off IME. When re-enter insert mode, Vim revert
+IME status to that memorized automatically.
+
+This works on not only insert-normal mode, but also search-command input and
+replace mode.
+The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose
+the different input medhods or disable them temporarily.
+
+WHAT IS IME
+ IME is a part of East asian version Windows. That helps you to input
+ multibyte character. English and other language version Windows does not
+ have any IME. (Also there are no need usually.) But there is one that
+ called Microsoft Global IME. Global IME is a part of Internet Explorer
+ 4.0 or above. You can get more information about Global IME, at below
+ URL.
+
+WHAT IS GLOBAL IME *global-ime*
+ Global IME makes capability to input Chinese, Japanese, and Korean text
+ into Vim buffer on any language version of Windows 98, Windows 95, and
+ Windows NT 4.0.
+ On Windows 2000 and XP it should work as well (without downloading). On
+ Windows 2000 Professional, Global IME is built in, and the Input Locales
+ can be added through Control Panel/Regional Options/Input Locales.
+ Please see below URL for detail of Global IME. You can also find various
+ language version of Global IME at same place.
+
+ - Global IME detailed information.
+ http://www.microsoft.com/windows/ie/features/ime.asp
+
+ - Active Input Method Manager (Global IME)
+ http://msdn.microsoft.com/workshop/misc/AIMM/aimm.asp
+
+ Support Global IME is a experimental feature.
+
+NOTE: For IME to work you must make sure the input locales of your language
+are added to your system. The exact location of this depends on the version
+of Windows you use. For example, on my W2P box:
+1. Control Panel
+2. Regional Options
+3. Input Locales Tab
+4. Add Installed input locales -> Chinese(PRC)
+ The default is still English (United Stated)
+
+
+Cursor color when IME or XIM is on *CursorIM*
+ There is a little cute feature for IME. Cursor can indicate status of IME
+ by changing its color. Usually status of IME was indicated by little icon
+ at a corner of desktop (or taskbar). It is not easy to verify status of
+ IME. But this feature help this.
+ This works in the same way when using XIM.
+
+ You can select cursor color when status is on by using highlight group
+ CursorIM. For example, add these lines to your _gvimrc: >
+
+ if has('multi_byte_ime')
+ highlight Cursor guifg=NONE guibg=Green
+ highlight CursorIM guifg=NONE guibg=Purple
+ endif
+<
+ Cursor color with off IME is green. And purple cursor indicates that
+ status is on.
+
+==============================================================================
+9. Input with a keymap *mbyte-keymap*
+
+When the keyboard doesn't produce the characters you want to enter in your
+text, you can use the 'keymap' option. This will translate one or more
+(English) characters to another (non-English) character. This only happens
+when typing text, not when typing Vim commands. This avoids having to switch
+between two keyboard settings.
+
+The value of the 'keymap' option specifies a keymap file to use. The name of
+this file is one of these two:
+
+ keymap/{keymap}_{encoding}.vim
+ keymap/{keymap}.vim
+
+Here {keymap} is the value of the 'keymap' option and {encoding} of the
+'encoding' option. The file name with the {encoding} included is tried first.
+
+'runtimepath' is used to find these files. To see an overview of all
+available keymap files, use this: >
+ :echo globpath(&rtp, "keymap/*.vim")
+
+In Insert and Command-line mode you can use CTRL-^ to toggle between using the
+keyboard map or not. |i_CTRL-^| |c_CTRL-^|
+This flag is remembered for Insert mode with the 'iminsert' option. When
+leaving and entering Insert mode the previous value is used. The same value
+is also used for commands that take a single character argument, like |f| and
+|r|.
+For Command-line mode the flag is NOT remembered. You are expected to type an
+Ex command first, which is ASCII.
+For typing search patterns the 'imsearch' option is used. It can be set to
+use the same value as for 'iminsert'.
+
+It is possible to give the GUI cursor another color when the language mappings
+are being used. This is disabled by default, to avoid that the cursor becomes
+invisible when you use a non-standard background color. Here is an example to
+use a brightly colored cursor: >
+ :highlight Cursor guifg=NONE guibg=Green
+ :highlight lCursor guifg=NONE guibg=Cyan
+<
+ *keymap-file-format* *:loadk* *:loadkeymap* *E105*
+The keymap file looks something like this: >
+
+ " Maintainer: name <email@address>
+ " Last Changed: 2001 Jan 1
+
+ let b:keymap_name = "short"
+
+ loadkeymap
+ a A
+ b B comment
+
+The lines starting with a " are comments and will be ignored. Blank lines are
+also ignored. The lines with the mappings may have a comment after the useful
+text.
+
+The "b:keymap_name" can be set to a short name, which will be shown in the
+status line. The idea is that this takes less room than the value of
+'keymap', which might be long to distinguish between different languages,
+keyboards and encodings.
+
+The actual mappings are in the lines below "loadkeymap". In the example "a"
+is mapped to "A" and "b" to "B". Thus the first item is mapped to the second
+item. This is done for each line, until the end of the file.
+These items are exactly the same as what can be used in a |:lnoremap| command,
+using "<buffer>" to make the mappings local to the buffer..
+You can check the result with this command: >
+ :lmap
+The two items must be separated by white space. You cannot include white
+space inside an item, use the special names "<Tab>" and "<Space>" instead.
+The length of the two items together must not exceed 200 bytes.
+
+It's possible to have more than one character in the first column. This works
+like a dead key. Example: >
+ 'a á
+Since Vim doesn't know if the next character after a quote is really an "a",
+it will wait for the next character. To be able to insert a single quote,
+also add this line: >
+ '' '
+Since the mapping is defined with |:lnoremap| the resulting quote will not be
+used for the start of another character.
+
+Although it's possible to have more than one character in the second column,
+this is unusual. But you can use various ways to specify the character: >
+ A a literal character
+ A <char-97> decimal value
+ A <char-0x61> hexadecimal value
+ A <char-0141> octal value
+ x <Space> special key name
+
+The characters are assumed to be encoded for the current value of 'encoding'.
+It's possible to use ":scriptencoding" when all characters are given
+literally. That doesn't work when using the <char-> construct, because the
+conversion is done on the keymap file, not on the resulting character.
+
+The lines after "loadkeymap" are interpreted with 'cpoptions' set to "C".
+This means that continuation lines are not used and a backslash has a special
+meaning in the mappings. Examples: >
+
+ " a comment line
+ \" x maps " to x
+ \\ y maps \ to y
+
+If you write a keymap file that will be useful for others, consider submitting
+it to the Vim maintainer for inclusion in the distribution:
+<maintainer@vim.org>
+
+
+HEBREW KEYMAP *keymap-hebrew*
+
+This file explains what characters are available in UTF-8 and CP1255 encodings,
+and what the keymaps are to get those characters:
+
+glyph encoding keymap ~
+Char utf-8 cp1255 hebrew hebrewp name ~
+× 0x5d0 0xe0 t a 'alef
+ב 0x5d1 0xe1 c b bet
+×’ 0x5d2 0xe2 d g gimel
+ד 0x5d3 0xe3 s d dalet
+×” 0x5d4 0xe4 v h he
+ו 0x5d5 0xe5 u v vav
+×– 0x5d6 0xe6 z z zayin
+×— 0x5d7 0xe7 j j het
+ט 0x5d8 0xe8 y T tet
+×™ 0x5d9 0xe9 h y yod
+ך 0x5da 0xea l K kaf sofit
+×› 0x5db 0xeb f k kaf
+ל 0x5dc 0xec k l lamed
+× 0x5dd 0xed o M mem sofit
+מ 0x5de 0xee n m mem
+ן 0x5df 0xef i N nun sofit
+×  0x5e0 0xf0 b n nun
+ס 0x5e1 0xf1 x s samech
+×¢ 0x5e2 0xf2 g u `ayin
+×£ 0x5e3 0xf3 ; P pe sofit
+פ 0x5e4 0xf4 p p pe
+×¥ 0x5e5 0xf5 . X tsadi sofit
+צ 0x5e6 0xf6 m x tsadi
+ק 0x5e7 0xf7 e q qof
+ר 0x5e8 0xf8 r r resh
+ש 0x5e9 0xf9 a w shin
+ת 0x5ea 0xfa , t tav
+
+Vowel marks and special punctuation:
+×”Ö° 0x5b0 0xc0 A: A: sheva
+×”Ö± 0x5b1 0xc1 HE HE hataf segol
+×”Ö² 0x5b2 0xc2 HA HA hataf patah
+×”Ö³ 0x5b3 0xc3 HO HO hataf qamats
+×”Ö´ 0x5b4 0xc4 I I hiriq
+×”Öµ 0x5b5 0xc5 AY AY tsere
+×”Ö¶ 0x5b6 0xc6 E E segol
+×”Ö· 0x5b7 0xc7 AA AA patah
+×”Ö¸ 0x5b8 0xc8 AO AO qamats
+×”Ö¹ 0x5b9 0xc9 O O holam
+×”Ö» 0x5bb 0xcb U U qubuts
+×›Ö¼ 0x5bc 0xcc D D dagesh
+×”Ö½ 0x5bd 0xcd ]T ]T meteg
+×”Ö¾ 0x5be 0xce ]Q ]Q maqaf
+בֿ 0x5bf 0xcf ]R ]R rafe
+ב׀ 0x5c0 0xd0 ]p ]p paseq
+×©× 0x5c1 0xd1 SR SR shin-dot
+שׂ 0x5c2 0xd2 SL SL sin-dot
+׃ 0x5c3 0xd3 ]P ]P sof-pasuq
+×° 0x5f0 0xd4 VV VV double-vav
+×± 0x5f1 0xd5 VY VY vav-yod
+ײ 0x5f2 0xd6 YY YY yod-yod
+
+The following are only available in utf-8
+
+Cantillation marks:
+glyph
+Char utf-8 hebrew name
+ב֑ 0x591 C: etnahta
+ב֒ 0x592 Cs segol
+ב֓ 0x593 CS shalshelet
+ב֔ 0x594 Cz zaqef qatan
+ב֕ 0x595 CZ zaqef gadol
+ב֖ 0x596 Ct tipeha
+ב֗ 0x597 Cr revia
+ב֘ 0x598 Cq zarqa
+ב֙ 0x599 Cp pashta
+ב֚ 0x59a C! yetiv
+ב֛ 0x59b Cv tevir
+ב֜ 0x59c Cg geresh
+×‘Ö 0x59d C* geresh qadim
+ב֞ 0x59e CG gershayim
+ב֟ 0x59f CP qarnei-parah
+ב֪ 0x5aa Cy yerach-ben-yomo
+ב֫ 0x5ab Co ole
+ב֬ 0x5ac Ci iluy
+ב֭ 0x5ad Cd dehi
+ב֮ 0x5ae Cn zinor
+ב֯ 0x5af CC masora circle
+
+Combining forms:
+ﬠ 0xfb20 X` Alternative `ayin
+ﬡ 0xfb21 X' Alternative 'alef
+ﬢ 0xfb22 X-d Alternative dalet
+ﬣ 0xfb23 X-h Alternative he
+ﬤ 0xfb24 X-k Alternative kaf
+ﬥ 0xfb25 X-l Alternative lamed
+ﬦ 0xfb26 X-m Alternative mem-sofit
+ﬧ 0xfb27 X-r Alternative resh
+ﬨ 0xfb28 X-t Alternative tav
+﬩ 0xfb29 X-+ Alternative plus
+שׁ 0xfb2a XW shin+shin-dot
+שׂ 0xfb2b Xw shin+sin-dot
+שּׁ 0xfb2c X..W shin+shin-dot+dagesh
+שּׂ 0xfb2d X..w shin+sin-dot+dagesh
+אַ 0xfb2e XA alef+patah
+אָ 0xfb2f XO alef+qamats
+אּ 0xfb30 XI alef+hiriq (mapiq)
+בּ 0xfb31 X.b bet+dagesh
+גּ 0xfb32 X.g gimel+dagesh
+דּ 0xfb33 X.d dalet+dagesh
+הּ 0xfb34 X.h he+dagesh
+וּ 0xfb35 Xu vav+dagesh
+זּ 0xfb36 X.z zayin+dagesh
+טּ 0xfb38 X.T tet+dagesh
+יּ 0xfb39 X.y yud+dagesh
+ךּ 0xfb3a X.K kaf sofit+dagesh
+כּ 0xfb3b X.k kaf+dagesh
+לּ 0xfb3c X.l lamed+dagesh
+מּ 0xfb3e X.m mem+dagesh
+ï­€ 0xfb40 X.n nun+dagesh
+ï­ 0xfb41 X.s samech+dagesh
+ï­ƒ 0xfb43 X.P pe sofit+dagesh
+ï­„ 0xfb44 X.p pe+dagesh
+ï­† 0xfb46 X.x tsadi+dagesh
+ï­‡ 0xfb47 X.q qof+dagesh
+ï­ˆ 0xfb48 X.r resh+dagesh
+ï­‰ 0xfb49 X.w shin+dagesh
+ï­Š 0xfb4a X.t tav+dagesh
+ï­‹ 0xfb4b Xo vav+holam
+בֿ 0xfb4c XRb bet+rafe
+ï­ 0xfb4d XRk kaf+rafe
+ï­Ž 0xfb4e XRp pe+rafe
+ï­ 0xfb4f Xal alef-lamed
+
+==============================================================================
+10. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
+ *Unicode* *unicode*
+The Unicode character set was designed to include all characters from other
+character sets. Therefore it is possible to write text in any language using
+Unicode (with a few rarely used languages excluded). And it's mostly possible
+to mix these languages in one file, which is impossible with other encodings.
+
+Unicode can be encoded in several ways. The two most popular ones are UCS-2,
+which uses 16-bit words and UTF-8, which uses one or more bytes for each
+character. Vim can support all of these encodings, but always uses UTF-8
+internally.
+
+Vim has comprehensive UTF-8 support. It appears to work in:
+- xterm with utf-8 support enabled
+- Athena, Motif and GTK GUI
+- MS-Windows GUI
+
+Double-width characters are supported. This works best with 'guifontwide' or
+'guifontset'. When using only 'guifont' the wide characters are drawn in the
+normal width and a space to fill the gap. Note that the 'guifontset' option
+is no longer relevant in the GTK+ 2 GUI.
+
+Up to two combining characters can be used. The combining character is drawn
+on top of the preceding character. When editing text a composing character is
+mostly considered part of the preceding character. For example "x" will
+delete a character and its following composing characters by default. If the
+'delcombine' option is on, then pressing 'x' will delete the combining
+characters, one at a time, then the base character. But when inserting, you
+type the first character and the following composing characters separately,
+after which they will be joined. The "r" command will not allow you to type a
+combining character, because it doesn't know one is coming. Use "R" instead.
+
+Bytes which are not part of a valid UTF-8 byte sequence are handled like a
+single character and displayed as <xx>, where "xx" is the hex value of the
+byte.
+
+Overlong sequences are not handled specially and displayed like a valid
+character. However, search patterns may not match on an overlong sequence.
+(an overlong sequence is where more bytes are used than required for the
+character.) An exception is NUL (zero) which is displayed as "<00>".
+
+In the file and buffer the full range of Unicode characters can be used (31
+bits). However, displaying only works for 16 bit characters, and only for the
+characters present in the selected font.
+
+Useful commands:
+- "ga" shows the decimal, hexadecimal and octal value of the character under
+ the cursor. If there are composing characters these are shown too. (if the
+ message is truncated, use ":messages").
+- "g8" shows the bytes used in a UTF-8 character, also the composing
+ characters, as hex numbers.
+- ":set encoding=utf-8 fileencodings=" forces using UTF-8 for all files. The
+ default is to use the current locale for 'encoding' and set 'fileencodings'
+ to automatically the encoding of a file.
+
+
+STARTING VIM
+
+If your current locale is in an utf-8 encoding, Vim will automatically start
+in utf-8 mode.
+
+If you are using another locale: >
+
+ set encoding=utf-8
+
+You might also want to select the font used for the menus. Unfortunately this
+doesn't always work. See the system specific remarks below, and 'langmenu'.
+
+
+USING UTF-8 IN X-Windows *utf-8-in-xwindows*
+
+Note: This section does not apply to the GTK+ 2 GUI.
+
+You need to specify a font to be used. For double-wide characters another
+font is required, which is exactly twice as wide. There are three ways to do
+this:
+
+1. Set 'guifont' and let Vim find a matching 'guifontwide'
+2. Set 'guifont' and 'guifontwide'
+3. Set 'guifontset'
+
+See the documentation for each option for details. Example: >
+
+ :set guifont=-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
+
+You might also want to set the font used for the menus. This only works for
+Motif. Use the ":hi Menu font={fontname}" command for this. |:highlight|
+
+
+TYPING UTF-8 *utf-8-typing*
+
+If you are using X-Windows, you should find an input method that supports
+utf-8.
+
+If your system does not provide support for typing utf-8, you can use the
+'keymap' feature. This allows writing a keymap file, which defines a utf-8
+character as a sequence of ASCII characters. See |mbyte-keymap|.
+
+Another method is to set the current locale to the language you want to use
+and for which you have a XIM available. Then set 'termencoding' to that
+language and Vim will convert the typed characters to 'encoding' for you.
+
+If everything else fails, you can type any character as four hex bytes: >
+
+ CTRL-V u 1234
+
+"1234" is interpreted as a hex number. You must type four characters, prepend
+a zero if necessary.
+
+
+COMMAND ARGUMENTS *utf-8-char-arg*
+
+Commands like |f|, |F|, |t| and |r| take an argument of one character. For
+UTF-8 this argument may include one or two composing characters. These needs
+to be produced together with the base character, Vim doesn't wait for the next
+character to be typed to find out if it is a composing character or not.
+Using 'keymap' or |:lmap| is a nice way to type these characters.
+
+The commands that search for a character in a line handle composing characters
+as follows. When searching for a character without a composing character,
+this will find matches in the text with or without composing characters. When
+searching for a character with a composing character, this will only find
+matches with that composing character. It was implemented this way, because
+not everybody is able to type a composing character.
+
+
+==============================================================================
+11. Overview of options *mbyte-options*
+
+These options are relevant for editing multi-byte files. Check the help in
+options.txt for detailed information.
+
+'encoding' Encoding used for the keyboard and display. It is also the
+ default encoding for files.
+
+'fileencoding' Encoding of a file. When it's different from 'encoding'
+ conversion is done when reading or writing the file.
+
+'fileencodings' List of possible encodings of a file. When opening a file
+ these will be tried and the first one that doesn't cause an
+ error is used for 'fileencoding'.
+
+'charconvert' Expression used to convert files from one encoding to another.
+
+'formatoptions' The 'm' flag can be included to have formatting break a line
+ at a multibyte character of 256 or higher. Thus is useful for
+ languages where a sequence of characters can be broken
+ anywhere.
+
+'guifontset' The list of font names used for a multi-byte encoding. When
+ this option is not empty, it replaces 'guifont'.
+
+'keymap' Specify the name of a keyboard mapping.
+
+==============================================================================
+
+Contributions specifically for the multi-byte features by:
+ Chi-Deok Hwang <hwang@mizi.co.kr>
+ Nam SungHyun <namsh@lge.com>
+ K.Nagano <nagano@atese.advantest.co.jp>
+ Taro Muraoka <koron@tka.att.ne.jp>
+ Yasuhiro Matsumoto <mattn@mail.goo.ne.jp>
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
new file mode 100644
index 000000000..b5973b031
--- /dev/null
+++ b/runtime/doc/message.txt
@@ -0,0 +1,775 @@
+*message.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+This file contains an alphabetical list of messages and error messages that
+Vim produces. You can use this if you don't understand what the message
+means. It is not complete though.
+
+1. Old messages |:messages|
+2. Error messages |error-messages|
+3. Messages |messages|
+
+==============================================================================
+1. Old messages *:messages* *:mes* *message-history*
+
+The ":messages" command can be used to view previously given messages. This
+is especially useful when messages have been overwritten or truncated. This
+depends on the 'shortmess' option.
+
+The number of remembered messages is fixed at 20.
+
+If you are using translated messages, the first printed line tells who
+maintains the messages or the translations. You can use this to contact the
+maintainer when you spot a mistake.
+
+If you want to find help on a specific (error) message, use the ID at the
+start of the message. For example, to get help on the message: >
+
+ E72: Close error on swap file
+
+or (translated): >
+
+ E72: Errore durante chiusura swap file
+
+Use: >
+
+ :help E72
+
+If you are lazy, it also works without the shift key: >
+
+ :help e72
+
+==============================================================================
+2. Error messages *error-messages*
+
+When an error message is displayed, but it is removed before you could read
+it, you can see it again with: >
+ :echo errmsg
+or view a list of recent messages with: >
+ :messages
+
+
+LIST OF MESSAGES
+ *E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
+ *E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
+ *E323* *E341* *E473* *E570* >
+ Add to read buffer
+ makemap: Illegal mode
+ Cannot create BalloonEval with both message and callback
+ Hangul automata ERROR
+ block was not locked
+ Didn't get block nr {N}?
+ ml_timestamp: Didn't get block 0??
+ pointer block id wrong {N}
+ Updated too many blocks?
+ get_varp ERROR
+ u_undo: line numbers wrong
+ undo list corrupt
+ undo line missing
+ ml_get: cannot find line {N}
+ cannot find line {N}
+ line number out of range: {N} past the end
+ line count wrong in block {N}
+ Internal error
+ fatal error in cs_manage_matches
+
+This is an internal error. If you can reproduce it, please send in a bug
+report. |bugs|
+
+>
+ ATTENTION
+ Found a swap file by the name ...
+
+See |ATTENTION|.
+
+ *E92* >
+ Buffer {N} not found
+
+The buffer you requested does not exist. This can also happen when you have
+wiped out a buffer which contains a mark or is referenced in another way.
+|:bwipeout|
+
+ *E95* >
+ Buffer with this name already exists
+
+You cannot have two buffers with the same name.
+
+ *E72* >
+ Close error on swap file
+
+The |swap-file|, that is used to keep a copy of the edited text, could not be
+closed properly. Mostly harmless.
+
+ *E169* >
+ Command too recursive
+
+This happens when an Ex command executes an Ex command that executes an Ex
+command, etc. This is only allowed 200 times. When it's more there probably
+is an endless loop. Probably a |:execute| or |:source| command is involved.
+
+ *E254* >
+ Cannot allocate color {name}
+
+The color name {name} is unknown. See |gui-colors| for a list of colors that
+are available on most systems.
+
+ *E458* >
+ Cannot allocate colormap entry for "xxxx"
+ Cannot allocate colormap entry, some colors may be incorrect
+
+This means that there are not enough colors available for Vim. It will still
+run, but some of the colors will not appear in the specified color. Try
+stopping other applications that use many colors, or start them after starting
+gvim.
+Netscape is known to consume a lot of colors. You can avoid this by telling
+it to use its own colormap: >
+ netscape -install
+Or tell it to limit to a certain number of colors (64 should work well): >
+ netscape -ncols 64
+This can also be done with a line in your Xdefaults file: >
+ Netscape*installColormap: Yes
+or >
+ Netscape*maxImageColors: 64
+<
+ *E79* >
+ Cannot expand wildcards
+
+A filename contains a strange combination of characters, which causes Vim to
+attempt expanding wildcards but this fails. This does NOT mean that no
+matching file names could be found, but that the pattern was illegal.
+
+ *E459* >
+ Cannot go back to previous directory
+
+While expanding a file name, Vim failed to go back to the previously used
+directory. All file names being used may be invalid now! You need to have
+execute permission on the current directory.
+
+ *E190* *E212* >
+ Cannot open "{filename}" for writing
+ Can't open file for writing
+
+For some reason the file you are writing to cannot be created or overwritten.
+The reason could be that you do not have permission to write in the directory
+or the file name is not valid.
+
+ *E166* >
+ Can't open linked file for writing
+
+You are trying to write to a file which can't be overwritten, and the file is
+a link (either a hard link or a symbolic link). Writing might still be
+possible if the directory that contains the link or the file is writable, but
+Vim now doesn't know if you want to delete the link and write the file in its
+place, or if you want to delete the file itself and write the new file in its
+place. If you really want to write the file under this name, you have to
+manually delete the link or the file, or change the permissions so that Vim
+can overwrite.
+
+ *E46* >
+ Cannot set read-only variable "{name}"
+
+You are trying to assign a value to an argument of a function |a:var| or a Vim
+internal variable |v:var| which is read-only.
+
+ *E90* >
+ Cannot unload last buffer
+
+Vim always requires one buffer to be loaded, otherwise there would be nothing
+to display in the window.
+
+ *E40* >
+ Can't open errorfile <filename>
+
+When using the ":make" or ":grep" commands: The file used to save the error
+messages or grep output cannot be opened. This can have several causes:
+- 'shellredir' has a wrong value.
+- The shell changes directory, causing the error file to be written in another
+ directory. This could be fixed by changing 'makeef', but then the make
+ command is still executed in the wrong directory.
+- 'makeef' has a wrong value.
+- The 'grepprg' or 'makeprg' could not be executed. This cannot always be
+ detected (especially on MS-Windows). Check your $PATH.
+
+ >
+ Can't open file C:\TEMP\VIoD243.TMP
+
+On MS-Windows, this message appears when the output of an external command was
+to be read, but the command didn't run successfully. This can be caused by
+many things. Check the 'shell', 'shellquote', 'shellxquote', 'shellslash' and
+related options. It might also be that the external command was not found,
+there is no different error message for that.
+
+ *E12* >
+ Command not allowed from exrc/vimrc in current dir or tag search
+
+Some commands are not allowed for security reasons. These commands mostly
+come from a .exrc or .vimrc file in the current directory, or from a tags
+file. Also see 'secure'.
+
+ *E74* >
+ Command too complex
+
+A mapping resulted in a very long command string. Could be caused by a
+mapping that indirectly calls itself.
+
+>
+ CONVERSION ERROR
+
+When writing a file and the text "CONVERSION ERROR" appears, this means that
+some bits were lost when converting text from the internally used UTF-8 to the
+format of the file. The file will not be marked unmodified. If you care
+about the loss of information, set the 'fileencoding' option to another value
+that can handle the characters in the buffer and write again. If you don't
+care, you can abandon the buffer or reset the 'modified' option.
+
+ *E302* >
+ Could not rename swap file
+
+When the file name changes, Vim tries to rename the |swap-file| as well.
+This failed and the old swap file is now still used. Mostly harmless.
+
+ *E43* *E44* >
+ Damaged match string
+ Corrupted regexp program
+
+Something inside Vim went wrong and resulted in a corrupted regexp. If you
+know how to reproduce this problem, please report it. |bugs|
+
+ *E208* *E209* *E210* >
+ Error writing to "{filename}"
+ Error closing "{filename}"
+ Error reading "{filename}"
+
+This occurs when Vim is trying to rename a file, but a simple change of file
+name doesn't work. Then the file will be copied, but somehow this failed.
+The result may be that both the original file and the destination file exist
+and the destination file may be incomplete.
+
+>
+ Vim: Error reading input, exiting...
+
+This occurs when Vim cannot read typed characters while input is required.
+Vim got stuck, the only thing it can do is exit. This can happen when both
+stdin and stderr are redirected and executing a script that doesn't exit Vim.
+
+ *E47* >
+ Error while reading errorfile
+
+Reading the error file was not possible. This is NOT caused by an error
+message that was not recognized.
+
+ *E80* >
+ Error while writing
+
+Writing a file was not completed successfully. The file is probably
+incomplete.
+
+ *E13* *E189* >
+ File exists (use ! to override)
+ "{filename}" exists (use ! to override)
+
+You are protected from accidentally overwriting a file. When you want to
+write anyway, use the same command, but add a "!" just after the command.
+Example: >
+ :w /tmp/test
+changes to: >
+ :w! /tmp/test
+<
+ *E139* >
+ File is loaded in another buffer
+
+You are trying to write a file under a name which is also used in another
+buffer. This would result in two versions of the same file.
+
+ *E142* >
+ File not written: Writing is disabled by 'write' option
+
+The 'write' option is off. This makes all commands that try to write a file
+generate this message. This could be caused by a |-m| commandline argument.
+You can switch the 'write' option on with ":set write".
+
+ *E25* >
+ GUI cannot be used: Not enabled at compile time
+
+You are running a version of Vim that doesn't include the GUI code. Therefore
+"gvim" and ":gui" don't work.
+
+ *E49* >
+ Invalid scroll size
+
+This is caused by setting an invalid value for the 'scroll', 'scrolljump' or
+'scrolloff' options.
+
+ *E17* >
+ "{filename}" is a directory
+
+You tried to write a file with the name of a directory. This is not possible.
+You probably need to append a file name.
+
+ *E19* >
+ Mark has invalid line number
+
+You are using a mark that has a line number that doesn't exist. This can
+happen when you have a mark in another file, and some other program has
+deleted lines from it.
+
+ *E219* *E220* >
+ Missing {.
+ Missing }.
+
+Using a {} construct in a file name, but there is a { without a matching } or
+the other way around. It should be used like this: {foo,bar}. This matches
+"foo" and "bar".
+
+ *E315* >
+ ml_get: invalid lnum:
+
+This is an internal Vim error. Please try to find out how it can be
+reproduced, and submit a bug report |bugreport.vim|.
+
+ *E173* >
+ {number} more files to edit
+
+You are trying to exit, while the last item in the argument list has not been
+edited. This protects you from accidentally exiting when you still have more
+files to work on. See |argument-list|. If you do want to exit, just do it
+again and it will work.
+
+ *E23* *E194* >
+ No alternate file
+ No alternate file name to substitute for '#'
+
+The alternate file is not defined yet. See |alternate-file|.
+
+ *E32* >
+ No file name
+
+The current buffer has no name. To write it, use ":w fname". Or give the
+buffer a name with ":file fname".
+
+ *E141* >
+ No file name for buffer {number}
+
+One of the buffers that was changed does not have a file name. Therefore it
+cannot be written. You need to give the buffer a file name: >
+ :buffer {number}
+ :file {filename}
+<
+ *E33* >
+ No previous substitute regular expression
+
+When using the '~' character in a pattern, it is replaced with the previously
+used pattern in a ":substitute" command. This fails when no such command has
+been used yet. See |/~|.
+
+ *E35* >
+ No previous regular expression
+
+When using an empty search pattern, the previous search pattern is used. But
+that is not possible if there was no previous search.
+
+ *E24* >
+ No such abbreviation
+
+You have used an ":unabbreviate" command with an argument which is not an
+existing abbreviation. All variations of this command give the same message:
+":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
+
+>
+ /dev/dsp: No such file or directory
+
+Only given for GTK GUI with Gnome support. Gnome tries to use the audio
+device and it isn't present. You can ignore this error.
+
+ *E31* >
+ No such mapping
+
+You have used an ":unmap" command with an argument which is not an existing
+mapping. All variations of this command give the same message: ":cunmap",
+":unmap!", etc. Check for trailing white space.
+
+ *E37* *E89* >
+ No write since last change (use ! to override)
+ No write since last change for buffer {N} (use ! to override)
+
+You are trying to |abandon| a file that has changes. Vim protects you from
+losing your work. You can either write the changed file with ":w", or, if you
+are sure, |abandon| it anyway, and lose all the changes. This can be done by
+adding a '!' character just after the command you used. Example: >
+ :e other_file
+changes to: >
+ :e! other_file
+<
+ *E162* >
+ No write since last change for buffer "{name}"
+
+This appears when you try to exit Vim while some buffers are changed. You
+will either have to write the changed buffer (with |:w|), or use a command to
+abandon the buffer forcefully, e.g., with ":qa!". Careful, make sure you
+don't throw away changes you really want to keep. You might have forgotten
+about a buffer, especially when 'hidden' is set.
+
+ *E38* >
+ Null argument
+
+Something inside Vim went wrong and resulted in a NULL pointer. If you know
+how to reproduce this problem, please report it. |bugs|
+
+ *E172* >
+ Only one file name allowed
+
+The ":edit" command only accepts one file name. When you want to specify
+several files for editing use ":next" |:next|.
+
+ *E41* *E82* *E83* *E342* >
+ Out of memory!
+ Out of memory! (allocating {number} bytes)
+ Cannot allocate any buffer, exiting...
+ Cannot allocate buffer, using other one...
+
+Oh, oh. You must have been doing something complicated, or some other program
+is consuming your memory. Be careful! Vim is not completely prepared for an
+out-of-memory situation. First make sure that any changes are saved. Then
+try to solve the memory shortage. To stay on the safe side, exit Vim and
+start again. Also see |msdos-limitations|.
+
+ *E339* >
+ Pattern too long
+
+This only happens on systems with 16 bit ints: The compiled regexp pattern is
+longer than about 65000 characters. Try using a shorter pattern.
+
+ *E45* >
+ 'readonly' option is set (use ! to override)
+
+You are trying to write a file that was marked as read-only. To write the
+file anyway, either reset the 'readonly' option, or add a '!' character just
+after the command you used. Example: >
+ :w
+changes to: >
+ :w!
+<
+ *E294* *E295* *E301* >
+ Read error in swap file
+ Seek error in swap file read
+ Oops, lost the swap file!!!
+
+Vim tried to read text from the |swap-file|, but something went wrong. The
+text in the related buffer may now be corrupted! Check carefully before you
+write a buffer. You may want to write it in another file and check for
+differences.
+
+ *E192* >
+ Recursive use of :normal too deep
+
+You are using a ":normal" command, whose argument again uses a ":normal"
+command in a recursive way. This is restricted to 'maxmapdepth' levels. This
+example illustrates how to get this message: >
+ :map gq :normal gq<CR>
+If you type "gq", it will execute this mapping, which will call "gq" again.
+
+ *E22* >
+ Scripts nested too deep
+
+Scripts can be read with the "-s" command-line argument and with the ":source"
+command. The script can then again read another script. This can continue
+for about 14 levels. When more nesting is done, Vim assumes that there is a
+recursive loop somewhere and stops with this error message.
+
+ *E319* >
+ Sorry, the command is not available in this version
+
+You have used a command that is not present in the version of Vim you are
+using. When compiling Vim, many different features can be enabled or
+disabled. This depends on how big Vim has chosen to be and the operating
+system. See |+feature-list| for when which feature is available. The
+|:version| command shows which feature Vim was compiled with.
+
+ *E300* >
+ Swap file already exists (symlink attack?)
+
+This message appears when Vim is trying to open a swap file and finds it
+already exists or finds a symbolic link in its place. This shouldn't happen,
+because Vim already checked that the file doesn't exist. Either someone else
+opened the same file at exactly the same moment (very unlikely) or someone is
+attempting a symlink attack (could happen when editing a file in /tmp or when
+'directory' starts with "/tmp", which is a bad choice).
+
+ *E432* >
+ Tags file not sorted: {file name}
+
+Vim (and Vi) expect tags files to be sorted in ASCII order. Binary searching
+can then be used, which is a lot faster than a linear search. If your tags
+files are not properly sorted, reset the |'tagbsearch'| option.
+This message is only given when Vim detects a problem when searching for a
+tag. Sometimes this message is not given, even thought the tags file is not
+properly sorted.
+
+ *E460* >
+ The resource fork would be lost (add ! to override)
+
+On the Macintosh (classic), when writing a file, Vim attempts to preserve all
+info about a file, including its resource fork. If this is not possible you
+get this error message. Append "!" to the command name to write anyway (and
+lose the info).
+
+ *E424* >
+ Too many different highlighting attributes in use
+
+Vim can only handle about 223 different kinds of highlighting. If you run
+into this limit, you have used too many |:highlight| commands with different
+arguments. A ":highlight link" is not counted.
+
+ *E77* >
+ Too many file names
+
+When expanding file names, more than one match was found. Only one match is
+allowed for the command that was used.
+
+ *E303* >
+ Unable to open swap file for "{filename}", recovery impossible
+
+Vim was not able to create a swap file. You can still edit the file, but if
+Vim unexpected exits the changes will be lost. And Vim may consume a lot of
+memory when editing a big file. You may want to change the 'directory' option
+to avoid this error. See |swap-file|.
+
+ *E140* >
+ Use ! to write partial buffer
+
+When using a range to write part of a buffer, it is unusual to overwrite the
+original file. It is probably a mistake (e.g., when Visual mode was active
+when using ":w"), therefore Vim requires using a ! after the command, e.g.:
+":3,10w!".
+>
+
+ Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to type
+ VirtualBinding
+
+Messages like this appear when starting up. This is not a Vim problem, your
+X11 configuration is wrong. You can find a hint on how to solve this here:
+http://groups.yahoo.com/group/solarisonintel/message/12179.
+
+ *W10* >
+ Warning: Changing a readonly file
+
+The file is read-only and you are making a change to it anyway. You can use
+the |FileChangedRO| autocommand event to avoid this message (the autocommand
+must reset the 'readonly' option). See 'modifiable' to completely disallow
+making changes to a file.
+
+ *W13* >
+ Warning: File "{filename}" has been created after editing started
+
+You are editing a file in Vim when it didn't exist, but it does exist now.
+You will have to decide if you want to keep the version in Vim or the newly
+created file. This message is not given when 'buftype' is not empty.
+
+ *W11* >
+ Warning: File "{filename}" has changed since editing started
+
+The file which you have started editing has got another timestamp and the
+contents changed (more precisely: When reading the file again with the current
+option settings and autocommands you would end up with different text). This
+probably means that some other program changed the file. You will have to
+find out what happened, and decide which version of the file you want to keep.
+Set the 'autoread' option if you want to do this automatically.
+This message is not given when 'buftype' is not empty.
+
+There is one situation where you get this message even though there is nothing
+wrong: If you save a file in Windows on the day the daylight saving time
+starts. It can be fixed in one of these ways:
+- Add this line in your autoexec.bat: >
+ SET TZ=-1
+< Adjust the "-1" for your time zone.
+- Disable "automatically adjust clock for daylight saving changes".
+- Just write the file again the next day. Or set your clock to the next day,
+ write the file twice and set the clock back.
+
+ *W12* >
+ Warning: File "{filename}" has changed and the buffer was changed in Vim as well
+
+Like the above, and the buffer for the file was changed in this Vim as well.
+You will have to decide if you want to keep the version in this Vim or the one
+on disk. This message is not given when 'buftype' is not empty.
+
+ *W16* >
+ Warning: Mode of file "{filename}" has changed since editing started
+
+When the timestamp for a buffer was changed and the contents are still the
+same but the mode (permissions) have changed. This usually occurs when
+checking out a file from a version control system, which causes the read-only
+bit to be reset. It should be safe to reload the file. Set 'autoread' to
+automatically reload the file.
+
+ *E211* >
+ Warning: File "{filename}" no longer available
+
+The file which you have started editing has disappeared, or is no longer
+accessible. Make sure you write the buffer somewhere to avoid losing
+changes. This message is not given when 'buftype' is not empty.
+
+ *W14* >
+ Warning: List of file names overflow
+
+You must be using an awful lot of buffers. It's now possible that two buffers
+have the same number, which causes various problems. You might want to exit
+Vim and restart it.
+
+ *E296* *E297* >
+ Seek error in swap file write
+ Write error in swap file
+
+This mostly happens when the disk is full. Vim could not write text into the
+|swap-file|. It's not directly harmful, but when Vim unexpectedly exits some
+text may be lost without recovery being possible. Vim might run out of memory
+when this problem persists.
+
+ *connection-refused* >
+ Xlib: connection to "<machine-name:0.0" refused by server
+
+This happens when Vim tries to connect to the X server, but the X server does
+not allow a connection. The connection to the X server is needed to be able
+to restore the title and for the xterm clipboard support. Unfortunately this
+error message cannot be avoided, except by disabling the |+xterm_clipboard|
+and |+X11| features.
+
+ *E10* >
+ \\ should be followed by /, ? or &
+
+A command line started with a backslash or the range of a command contained a
+backslash in a wrong place. This is often caused by command-line continuation
+being disabled. Remove the 'C' flag from the 'cpoptions' option to enable it.
+
+ *E471* >
+ Argument required
+
+This happens when an Ex command with mandatory argument(s) was executed, but
+no argument has been specified.
+
+ *E474* *E475* >
+ Invalid argument
+
+An Ex command has been executed, but an invalid argument has been specified.
+
+ *E488* >
+ Trailing characters
+
+An argument has been added to an Ex command that does not permit one.
+
+ *E477* *E478* >
+ No ! allowed
+ Don't panic!
+
+You have added a "!" after an Ex command that doesn't permit one.
+
+ *E481* >
+ No range allowed
+
+A range was specified for an Ex command that doesn't permit one. See
+|cmdline-ranges|.
+
+ *E482* *E483* >
+ Can't create file {filename}
+ Can't get temp file name
+
+Vim cannot create a temporary file.
+
+ *E484* *E485* >
+ Can't open file %s"
+ Can't read file %s"
+
+Vim cannot read a temporary file.
+
+ *E464* >
+ Ambiguous use of user-defined command
+
+There are two user-defined commands with a common name prefix, and you used
+Command-line completion to execute one of them. |user-cmd-ambiguous|
+Example: >
+ :command MyCommand1 echo "one"
+ :command MyCommand2 echo "two"
+ :MyCommand
+<
+ *E492* >
+ Not an editor command
+
+You tried to execute a command that is neither an Ex command nor
+a user-defined command.
+
+==============================================================================
+3. Messages *messages*
+
+This is an (incomplete) overview of various messages that Vim gives:
+
+ *hit-enter* *press-enter* *hit-return* *press-return* >
+
+ Hit ENTER or type command to continue
+
+This message is given when there is something on the screen for you to read,
+and the screen is about to be redrawn:
+- After executing an external command (e.g., ":!ls" and "=").
+- Something is displayed on the status line that is longer than the width of
+ the window, or runs into the 'showcmd' or 'ruler' output.
+
+-> Hit <Enter> or <Space> to redraw the screen and continue, without that key
+ being used otherwise.
+-> Hit ":" or any other Normal mode command character to start that command.
+-> Hit <C-Y> to copy (yank) a modeless selection to the clipboard register.
+-> Use a menu. The characters defined for Cmdline-mode are used.
+-> When 'mouse' contains the 'r' flag, clicking the left mouse button works
+ like pressing <Space>. This makes it impossible to select text though.
+-> For the GUI clicking the left mouse button in the last line works like
+ pressing <Space>.
+{Vi: only ":" commands are interpreted}
+
+To reduce the number of hit-enter prompts:
+- Set 'cmdheight' to 2 or higher.
+- Add flags to 'shortmess'.
+- Reset 'showcmd' and/or 'ruler'.
+
+Also see 'mouse'. The hit-enter message is highlighted with the |hl-Question|
+group.
+
+
+ *more-prompt* *pager* >
+ -- More --
+ -- More -- (RET: line, SPACE: page, d: half page, q: quit)
+ -- More -- (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)
+
+This message is given when the screen is filled with messages. It is only
+given when the 'more' option is on. It is highlighted with the |hl-MoreMsg|
+group.
+
+Type effect ~
+ <CR> or <NL> or j or <Down> one more line
+ <BS> or k or <Up> one line back (*)
+ <Space> or <PageDown> next page
+ b or <PageUp> previous page (*)
+ d down half a page
+ u up half a page (*)
+ q, <Esc> or CTRL-C stop the listing
+ : stop the listing and enter a
+ command-line
+ <C-Y> yank (copy) a modeless selection to
+ the clipboard ("* and "+ registers)
+ {menu-entry} what the menu is defined to in
+ Cmdline-mode.
+ <LeftMouse> (**) next page
+
+Any other key causes the meaning of the keys to be displayed.
+
+(*) backwards scrolling is only supported for these commands: >
+ :clist
+(**) Clicking the left mouse button only works:
+ - For the GUI: in the last line of the screen.
+ - When 'r' is included in 'mouse' (but then selecting text won't work).
+
+
+Note: The typed key is directly obtained from the terminal, it is not mapped
+and typeahead is ignored.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/mlang.txt b/runtime/doc/mlang.txt
new file mode 100644
index 000000000..3045b46a1
--- /dev/null
+++ b/runtime/doc/mlang.txt
@@ -0,0 +1,205 @@
+*mlang.txt* For Vim version 7.0aa. Last change: 2004 Feb 24
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Multi-language features *multilang* *multi-lang*
+
+This is about using messages and menus in various languages. For editing
+multi-byte text see |multibyte|.
+
+The basics are explained in the user manual: |usr_45.txt|.
+
+1. Messages |multilang-messages|
+2. Menus |multilang-menus|
+3. Scripts |multilang-scripts|
+
+Also see |help-translated| for multi-language help.
+
+{Vi does not have any of these features}
+{not available when compiled without the |+multi_lang| feature}
+
+==============================================================================
+1. Messages *multilang-messages*
+
+Vim picks up the locale from the environment. In most cases this means Vim
+will use the language that you prefer, unless it's not available.
+
+To see a list of supported locale names on your system, look in one of these
+directories (for Unix):
+ /usr/lib/locale ~
+ /usr/share/locale ~
+Unfortunately, upper/lowercase differences matter. Also watch out for the
+use of "-" and "_".
+
+ *:lan* *:lang* *:language* *E197*
+:lan[guage]
+:lan[guage] mes[sages]
+:lan[guage] cty[pe]
+:lan[guage] tim[e]
+ Print the current language (aka locale).
+ With the "messages" argument the language used for
+ messages is printed. Technical: LC_MESSAGES.
+ With the "ctype" argument the language used for
+ character encoding is printed. Technical: LC_CTYPE.
+ With the "time" argument the language used for
+ strftime() is printed. Technical: LC_TIME.
+ Without argument all parts of the locale are printed
+ (this is system dependent).
+ The current language can also be obtained with the
+ |v:lang|, |v:ctype| and |v:lc_time| variables.
+
+:lan[guage] {name}
+:lan[guage] mes[sages] {name}
+:lan[guage] cty[pe] {name}
+:lan[guage] tim[e] {name}
+ Set the current language (aka locale) to {name}.
+ The locale {name} must be a valid locale on your
+ system. Some systems accept aliases like "en" or
+ "en_US", but some only accept the full specification
+ like "en_US.ISO_8859-1".
+ With the "messages" argument the language used for
+ messages is set. This can be different when you want,
+ for example, English messages while editing Japanese
+ text. This sets $LC_MESSAGES.
+ With the "ctype" argument the language used for
+ character encoding is set. This affects the libraries
+ that Vim was linked with. It's unusual to set this to
+ a different value from 'encoding'. This sets
+ $LC_CTYPE.
+ With the "time" argument the language used for time
+ and date messages is set. This affects strftime().
+ This sets $LC_TIME.
+ Without an argument both are set, and additionally
+ $LANG is set.
+ This will make a difference for items that depend on
+ the language (some messages, time and date format).
+ Not fully supported on all systems
+ If this fails there will be an error message. If it
+ succeeds there is no message. Example: >
+ :language
+ Current language: C
+ :language de_DE.ISO_8859-1
+ :language mes
+ Current messages language: de_DE.ISO_8859-1
+ :lang mes en
+<
+
+MS-WINDOWS MESSAGE TRANSLATIONS *win32-gettext*
+
+If you used the self-installing .exe file, message translations should work
+already. Otherwise get the libintl.dll file if you don't have it yet:
+
+ http://sourceforge.net/projects/gettext
+
+This also contains tools xgettext, msgformat and others.
+
+libintl.dll should be placed in same directory with (g)vim.exe, or some
+place where PATH environment value describe. Message files (vim.mo)
+have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES", where "xx" is the
+abbreviation of the language (mostly two letters).
+
+If you write your own translations you need to generate the .po file and
+convert it to a .mo file. You need to get the source distribution and read
+the file "src/po/README.txt".
+
+To overrule the automatic choice of the language, set the $LANG variable to
+the language of your choice. use "en" to disable translations. >
+
+ :let $LANG = 'ja'
+
+(text for Windows by Muraoka Taro)
+
+==============================================================================
+2. Menus *multilang-menus*
+
+See |45.2| for the basics.
+
+Note that if changes have been made to the menus after the translation was
+done, some of the menus may be shown in English. Please try contacting the
+maintainer of the translation and ask him to update it. You can find the
+name and e-mail address of the translator in
+"$VIMRUNTIME/lang/menu_<lang>.vim".
+
+To set the font (or fontset) to use for the menus, use the |:highlight|
+command. Example: >
+
+ :highlight Menu font=k12,r12
+
+
+ALIAS LOCALE NAMES
+
+Unfortunately, the locale names are different on various systems, even though
+they are for the same language and encoding. If you do not get the menu
+translations you expected, check the output of this command: >
+
+ echo v:lang
+
+Now check the "$VIMRUNTIME/lang" directory for menu translation files that use
+a similar language. A difference in a "-" being a "_" already causes a file
+not to be found! Another common difference to watch out for is "iso8859-1"
+versus "iso_8859-1". Fortunately Vim makes all names lowercase, thus you
+don't have to worry about case differences. Spaces are changed to
+underscores, to avoid having to escape them.
+
+If you find a menu translation file for your language with a different name,
+create a file in your own runtime directory to load that one. The name of
+that file could be: >
+
+ ~/.vim/lang/menu_<v:lang>.vim
+
+Check the 'runtimepath' option for directories which are searched. In that
+file put a command to load the menu file with the other name: >
+
+ runtime lang/menu_<other_lang>.vim
+
+
+TRANSLATING MENUS
+
+If you want to do your own translations, you can use the |:menutrans| command,
+explained below. It is recommended to put the translations for one language
+in a Vim script. For a language that has no translation yet, please consider
+becoming the maintainer and make your translations available to all Vim users.
+Send an e-mail to the Vim maintainer <maintainer@vim.org>.
+
+ *:menut* *:menutrans* *:menutranslate*
+:menut[ranslate] clear
+ Clear all menu translations.
+
+:menut[ranslate] {english} {mylang}
+ Translate menu name {english} to {mylang}. All
+ special characters like "&" and "<Tab>" need to be
+ included. Spaces and dots need to be escaped with a
+ backslash, just like in other |:menu| commands.
+
+See the $VIMRUNTIME/lang directory for examples.
+
+To try out your translations you first have to remove all menus. This is how
+you can do it without restarting Vim: >
+ :source $VIMRUNTIME/delmenu.vim
+ :source <your-new-menu-file>
+ :source $VIMRUNTIME/menu.vim
+
+Each part of a menu path is translated separately. The result is that when
+"Help" is translated to "Hilfe" and "Overview" to "Überblick" then
+"Help.Overview" will be translated to "Hilfe.Überblick".
+
+==============================================================================
+3. Scripts *multilang-scripts*
+
+In Vim scripts you can use the |v:lang| variable to get the current language
+(locale). The default value is "C" or comes from the $LANG environment
+variable.
+
+The following example shows how this variable is used in a simple way, to make
+a message adapt to language preferences of the user, >
+
+ :if v:lang =~ "de_DE"
+ : echo "Guten Morgen"
+ :else
+ : echo "Good morning"
+ :endif
+<
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
new file mode 100644
index 000000000..b22413a84
--- /dev/null
+++ b/runtime/doc/motion.txt
@@ -0,0 +1,1191 @@
+*motion.txt* For Vim version 7.0aa. Last change: 2004 May 13
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Cursor motions *cursor-motions* *navigation*
+
+These commands move the cursor position. If the new position is off of the
+screen, the screen is scrolled to show the cursor (see also 'scrolljump' and
+'scrolloff' options).
+
+1. Motions and operators |operator|
+2. Left-right motions |left-right-motions|
+3. Up-down motions |up-down-motions|
+4. Word motions |word-motions|
+5. Text object motions |object-motions|
+6. Text object selection |object-select|
+7. Marks |mark-motions|
+8. Jumps |jump-motions|
+9. Various motions |various-motions|
+
+General remarks:
+
+If you want to know where you are in the file use the "CTRL-G" command
+|CTRL-G| or the "g CTRL-G" command |g_CTRL-G|. If you set the 'ruler' option,
+the cursor position is continuously shown in the status line (which slows down
+Vim a little).
+
+Experienced users prefer the hjkl keys because they are always right under
+their fingers. Beginners often prefer the arrow keys, because they do not
+know what the hjkl keys do. The mnemonic value of hjkl is clear from looking
+at the keyboard. Think of j as an arrow pointing downwards.
+
+The 'virtualedit' option can be set to make it possible to move the cursor to
+positions where there is no character or halfway a character.
+
+==============================================================================
+1. Motions and operators *operator*
+
+The motion commands can be used after an operator command, to have the command
+operate on the text that was moved over. That is the text between the cursor
+position before and after the motion. Operators are generally used to delete
+or change text. The following operators are available:
+
+ |c| c change
+ |d| d delete
+ |y| y yank into register (does not change the text)
+ |~| ~ swap case (only if 'tildeop' is set)
+ |g~| g~ swap case
+ |gu| gu make lowercase
+ |gU| gU make uppercase
+ |!| ! filter through an external program
+ |=| = filter through 'equalprg' or C-indenting if empty
+ |gq| gq text formatting
+ |g?| g? ROT13 encoding
+ |>| > shift right
+ |<| < shift left
+ |zf| zf define a fold
+
+If the motion includes a count and the operator also had a count before it,
+the two counts are multiplied. For example: "2d3w" deletes six words.
+
+After applying the operator the cursor is mostly left at the start of the text
+that was operated upon. For example, "yfe" doesn't move the cursor, but "yFe"
+moves the cursor leftwards to the "e" where the yank started.
+
+ *linewise* *characterwise*
+The operator either affects whole lines, or the characters between the start
+and end position. Generally, motions that move between lines affect lines
+(are linewise), and motions that move within a line affect characters (are
+characterwise). However, there are some exceptions.
+
+ *exclusive* *inclusive*
+A character motion is either inclusive or exclusive. When inclusive, the start
+and end position of the motion are included in the operation. When exclusive,
+the last character towards the end of the buffer is not included. Linewise
+motions always include the start and end position.
+
+Which motions are linewise, inclusive or exclusive is mentioned below. There
+are however, two general exceptions:
+1. If the motion is exclusive and the end of the motion is in column 1, the
+ end of the motion is moved to the end of the previous line and the motion
+ becomes inclusive. Example: "}" moves to the first line after a paragraph,
+ but "d}" will not include that line.
+2. If the motion is exclusive, the end of the motion is in column 1 and the
+ start of the motion was at or before the first non-blank in the line, the
+ motion becomes linewise. Example: If a paragraph begins with some blanks
+ and you do "d}" while standing on the first non-blank, all the lines of
+ the paragraph are deleted, including the blanks. If you do a put now, the
+ deleted lines will be inserted below the cursor position.
+
+Note that when the operator is pending (the operator command is typed, but the
+motion isn't yet), a special set of mappings can be used. See |:omap|.
+
+Instead of first giving the operator and then a motion you can use Visual
+mode: mark the start of the text with "v", move the cursor to the end of the
+text that is to be affected and then hit the operator. The text between the
+start and the cursor position is highlighted, so you can see what text will
+be operated upon. This allows much more freedom, but requires more key
+strokes and has limited redo functionality. See the chapter on Visual mode
+|Visual-mode|.
+
+You can use a ":" command for a motion. For example "d:call FindEnd()".
+But this can't be redone with "." if the command is more than one line.
+This can be repeated: >
+ d:call search("f")<CR>
+This cannot be repeated: >
+ d:if 1<CR>
+ call search("f")<CR>
+ endif<CR>
+
+
+FORCING A MOTION TO BE LINEWISE, CHARACTERWISE OR BLOCKWISE
+
+When a motion is not of the type you would like to use, you can force another
+type by using "v", "V" or CTRL-V just after the operator.
+Example: >
+ dj
+deletes two lines >
+ dvj
+deletes from the cursor position until the character below the cursor >
+ d<C-V>j
+deletes the character under the cursor and the character below the cursor. >
+
+Be careful with forcing a linewise movement to be used characterwise or
+blockwise, the column may not always be defined.
+
+ *o_v*
+v When used after an operator, before the motion command: Force
+ the operator to work characterwise, also when the motion is
+ linewise. If the motion was linewise, it will become
+ |exclusive|.
+ If the motion already was characterwise, toggle
+ inclusive/exclusive. This can be used to make an exclusive
+ motion inclusive and an inclusive motion exclusive.
+
+ *o_V*
+V When used after an operator, before the motion command: Force
+ the operator to work linewise, also when the motion is
+ characterwise.
+
+ *o_CTRL-V*
+CTRL-V When used after an operator, before the motion command: Force
+ the operator to work blockwise. This works like Visual block
+ mode selection, with the corners defined by the cursor
+ position before and after the motion.
+
+==============================================================================
+2. Left-right motions *left-right-motions*
+
+h or *h*
+<Left> or *<Left>*
+CTRL-H or *CTRL-H* *<BS>*
+<BS> [count] characters to the left. |exclusive| motion.
+ Note: If you prefer <BS> to delete a character, use
+ the mapping:
+ :map CTRL-V<BS> X
+ (to enter "CTRL-V<BS>" type the CTRL-V key, followed
+ by the <BS> key)
+ See |:fixdel| if the <BS> key does not do what you
+ want.
+
+l or *l*
+<Right> or *<Right>* *<Space>*
+<Space> [count] characters to the right. |exclusive| motion.
+
+ *0*
+0 To the first character of the line. |exclusive|
+ motion. When moving up or down, stay in same screen
+ column (if possible).
+
+ *<Home>* *<kHome>*
+<Home> To the first character of the line. |exclusive|
+ motion. When moving up or down, stay in same text
+ column (if possible). Works like "1|", which differs
+ from "0" when the line starts with a <Tab>. {not in
+ Vi}
+
+ *^*
+^ To the first non-blank character of the line.
+ |exclusive| motion.
+
+ *$* *<End>* *<kEnd>*
+$ or <End> To the end of the line. When a count is given also go
+ [count - 1] lines downward |inclusive|.
+ In Visual mode the cursor goes to just after the last
+ character in the line.
+ When 'virtualedit' is active, "$" may move the cursor
+ back from past the end of the line to the last
+ character in the line.
+
+ *g_*
+g_ To the last non-blank character of the line and
+ [count - 1] lines downward |inclusive|. {not in Vi}
+
+ *g0* *g<Home>*
+g0 or g<Home> When lines wrap ('wrap' on): To the first character of
+ the screen line. |exclusive| motion. Differs from
+ "0" when a line is wider than the screen.
+ When lines don't wrap ('wrap' off): To the leftmost
+ character of the current line that is on the screen.
+ Differs from "0" when the first character of the line
+ is not on the screen. {not in Vi}
+
+ *g^*
+g^ When lines wrap ('wrap' on): To the first non-blank
+ character of the screen line. |exclusive| motion.
+ Differs from "^" when a line is wider than the screen.
+ When lines don't wrap ('wrap' off): To the leftmost
+ non-blank character of the current line that is on the
+ screen. Differs from "^" when the first non-blank
+ character of the line is not on the screen. {not in
+ Vi}
+
+ *gm*
+gm Like "g0", but half a screenwidth to the right (or as
+ much as possible). {not in Vi}
+
+ *g$* *g<End>*
+g$ or g<End> When lines wrap ('wrap' on): To the last character of
+ the screen line and [count - 1] screen lines downward
+ |inclusive|. Differs from "$" when a line is wider
+ than the screen.
+ When lines don't wrap ('wrap' off): To the rightmost
+ character of the current line that is visible on the
+ screen. Differs from "$" when the last character of
+ the line is not on the screen or when a count is used.
+ Additionally, vertical movements keep the column,
+ instead of going to the end of the line.
+ {not in Vi}
+
+ *bar*
+| To screen column [count] in the current line.
+ |exclusive| motion.
+
+ *f*
+f{char} To [count]'th occurrence of {char} to the right. The
+ cursor is placed on {char} |inclusive|.
+ {char} can be entered as a digraph |digraph-arg|.
+ When 'encoding' is set to Unicode, composing
+ characters may be used, see |utf-8-char-arg|.
+ |:lmap| mappings apply to {char}. The CTRL-^ command
+ in Insert mode can be used to switch this on/off
+ |i_CTRL-^|.
+
+ *F*
+F{char} To the [count]'th occurrence of {char} to the left.
+ The cursor is placed on {char} |inclusive|.
+ {char} can be entered like with the |f| command.
+
+ *t*
+t{char} Till before [count]'th occurrence of {char} to the
+ right. The cursor is placed on the character left of
+ {char} |inclusive|.
+ {char} can be entered like with the |f| command.
+
+ *T*
+T{char} Till after [count]'th occurrence of {char} to the
+ left. The cursor is placed on the character right of
+ {char} |inclusive|.
+ {char} can be entered like with the |f| command.
+
+ *;*
+; Repeat latest f, t, F or T [count] times.
+
+ *,*
+, Repeat latest f, t, F or T in opposite direction
+ [count] times.
+
+These commands move the cursor to the specified column in the current line.
+They stop at the first column and at the end of the line, except "$", which
+may move to one of the next lines. See 'whichwrap' option to make some of the
+commands move across line boundaries.
+
+==============================================================================
+3. Up-down motions *up-down-motions*
+
+k or *k*
+<Up> or *<Up>* *CTRL-P*
+CTRL-P [count] lines upward |linewise|.
+
+j or *j*
+<Down> or *<Down>*
+CTRL-J or *CTRL-J*
+<NL> or *<NL>* *CTRL-N*
+CTRL-N [count] lines downward |linewise|.
+
+gk or *gk* *g<Up>*
+g<Up> [count] display lines upward. |exclusive| motion.
+ Differs from 'k' when lines wrap, and when used with
+ an operator, because it's not linewise. {not in Vi}
+
+gj or *gj* *g<Down>*
+g<Down> [count] display lines downward. |exclusive| motion.
+ Differs from 'j' when lines wrap, and when used with
+ an operator, because it's not linewise. {not in Vi}
+
+ *-*
+- <minus> [count] lines upward, on the first non-blank
+ character |linewise|.
+
++ or *+*
+CTRL-M or *CTRL-M* *<CR>*
+<CR> [count] lines downward, on the first non-blank
+ character |linewise|.
+
+ *_*
+_ <underscore> [count] - 1 lines downward, on the first non-blank
+ character |linewise|.
+
+ *G*
+G Goto line [count], default last line, on the first
+ non-blank character |linewise|. If 'startofline' not
+ set, keep the same column.
+
+ *<C-End>*
+<C-End> Goto line [count], default last line, on the last
+ character |inclusive|. {not in Vi}
+
+<C-Home> or *gg* *<C-Home>*
+gg Goto line [count], default first line, on the first
+ non-blank character |linewise|. If 'startofline' not
+ set, keep the same column.
+
+:[range] Set the cursor on the specified line number. If
+ there are several numbers, the last one is used.
+
+ *N%*
+{count}% Go to {count} percentage in the file, on the first
+ non-blank in the line |linewise|. To compute the new
+ line number this formula is used:
+ ({count} * number-of-lines + 99) / 100
+ See also 'startofline' option. {not in Vi}
+
+:[range]go[to] [count] *:go* *:goto* *go*
+[count]go Go to {count} byte in the buffer. Default [count] is
+ one, start of the file. When giving [range], the
+ last number in it used as the byte count. End-of-line
+ characters are counted depending on the current
+ 'fileformat' setting.
+ {not in Vi}
+ {not available when compiled without the
+ |+byte_offset| feature}
+
+These commands move to the specified line. They stop when reaching the first
+or the last line. The first two commands put the cursor in the same column
+(if possible) as it was after the last command that changed the column,
+except after the "$" command, then the cursor will be put on the last
+character of the line.
+
+==============================================================================
+4. Word motions *word-motions*
+
+<S-Right> or *<S-Right>* *w*
+w [count] words forward. |exclusive| motion.
+
+<C-Right> or *<C-Right>* *W*
+W [count] WORDS forward. |exclusive| motion.
+
+ *e*
+e Forward to the end of word [count] |inclusive|.
+
+ *E*
+E Forward to the end of WORD [count] |inclusive|.
+
+<S-Left> or *<S-Left>* *b*
+b [count] words backward. |exclusive| motion.
+
+<C-Left> or *<C-Left>* *B*
+B [count] WORDS backward. |exclusive| motion.
+
+ *ge*
+ge Backward to the end of word [count] |inclusive|.
+
+ *gE*
+gE Backward to the end of WORD [count] |inclusive|.
+
+These commands move over words or WORDS.
+ *word*
+A word consists of a sequence of letters, digits and underscores, or a
+sequence of other non-blank characters, separated with white space (spaces,
+tabs, <EOL>). This can be changed with the 'iskeyword' option.
+ *WORD*
+A WORD consists of a sequence of non-blank characters, separated with white
+space. An empty line is also considered to be a word and a WORD.
+
+A sequence of folded lines is counted for one word of a single character.
+"w" and "W", "e" and "E" move to the start/end of the first word or WORD after
+a range of folded lines. "b" and "B" move to the start of the first word or
+WORD before the fold.
+
+Special case: "cw" and "cW" are treated like "ce" and "cE" if the cursor is
+on a non-blank. This is because "cw" is interpreted as change-word, and a
+word does not include the following white space. {Vi: "cw" when on a blank
+followed by other blanks changes only the first blank; this is probably a
+bug, because "dw" deletes all the blanks}
+
+Another special case: When using the "w" motion in combination with an
+operator and the last word moved over is at the end of a line, the end of
+that word becomes the end of the operated text, not the first word in the
+next line.
+
+The original Vi implementation of "e" is buggy. For example, the "e" command
+will stop on the first character of a line if the previous line was empty.
+But when you use "2e" this does not happen. In Vim "ee" and "2e" are the
+same, which is more logical. However, this causes a small incompatibility
+between Vi and Vim.
+
+==============================================================================
+5. Text object motions *object-motions*
+
+ *(*
+( [count] sentences backward. |exclusive| motion.
+
+ *)*
+) [count] sentences forward. |exclusive| motion.
+
+ *{*
+{ [count] paragraphs backward. |exclusive| motion.
+
+ *}*
+} [count] paragraphs forward. |exclusive| motion.
+
+ *]]*
+]] [count] sections forward or to the next '{' in the
+ first column. When used after an operator, then the
+ '}' in the first column. |linewise|
+
+ *][*
+][ [count] sections forward or to the next '}' in the
+ first column. |linewise|
+
+ *[[*
+[[ [count] sections backward or to the previous '{' in
+ the first column. |linewise|
+
+ *[]*
+[] [count] sections backward or to the previous '}' in
+ the first column. |linewise|
+
+These commands move over three kinds of text objects.
+
+ *sentence*
+A sentence is defined as ending at a '.', '!' or '?' followed by either the
+end of a line, or by a space or tab. Any number of closing ')', ']', '"'
+and ''' characters may appear after the '.', '!' or '?' before the spaces,
+tabs or end of line. A paragraph and section boundary is also a sentence
+boundary.
+If the 'J' flag is present in 'cpoptions', at least two spaces have to
+follow the punctuation mark; <Tab>s are not recognized as white space.
+The definition of a sentence cannot be changed.
+
+ *paragraph*
+A paragraph begins after each empty line, and also at each of a set of
+paragraph macros, specified by the pairs of characters in the 'paragraphs'
+option. The default is "IPLPPPQPP LIpplpipbp", which corresponds to the
+macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in the
+first column). A section boundary is also a paragraph boundary. Note that
+this does not include a '{' or '}' in the first column. Also note that a
+blank line (only containing white space) is NOT a paragraph boundary.
+
+ *section*
+A section begins after a form-feed (<C-L>) in the first column and at each of
+a set of section macros, specified by the pairs of characters in the
+'sections' option. The default is "SHNHH HUnhsh", which defines a section to
+start at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
+
+The "]" and "[" commands stop at the '{' or '}' in the first column. This is
+useful to find the start or end of a function in a C program. Note that the
+first character of the command determines the search direction and the
+second character the type of brace found.
+
+If your '{' or '}' are not in the first column, and you would like to use "[["
+and "]]" anyway, try these mappings: >
+ :map [[ ?{<CR>w99[{
+ :map ][ /}<CR>b99]}
+ :map ]] j0[[%/{<CR>
+ :map [] k$][%?}<CR>
+[type these literally, see |<>|]
+
+==============================================================================
+6. Text object selection *object-select* *text-objects*
+ *v_a* *v_i*
+
+This is a series of commands that can only be used while in Visual mode or
+after an operator. The commands that start with "a" select "a"n object
+including white space, the commands starting with "i" select an "inner" object
+without white space, or just the white space. Thus the "inner" commands
+always select less text than the "a" commands.
+
+These commands are {not in Vi}.
+These commands are not available when the |+textobjects| feature has been
+disabled at compile time.
+ *v_aw* *aw*
+aw "a word", select [count] words (see |word|).
+ Leading or trailing white space is included, but not
+ counted.
+ When used in Visual linewise mode "aw" switches to
+ Visual characterwise mode.
+
+ *v_iw* *iw*
+iw "inner word", select [count] words (see |word|).
+ White space between words is counted too.
+ When used in Visual linewise mode "iw" switches to
+ Visual characterwise mode.
+
+ *v_aW* *aW*
+aW "a WORD", select [count] WORDs (see |WORD|).
+ Leading or trailing white space is included, but not
+ counted.
+ When used in Visual linewise mode "aW" switches to
+ Visual characterwise mode.
+
+ *v_iW* *iW*
+iW "inner WORD", select [count] WORDs (see |WORD|).
+ White space between words is counted too.
+ When used in Visual linewise mode "iW" switches to
+ Visual characterwise mode.
+
+ *v_as* *as*
+as "a sentence", select [count] sentences (see
+ |sentence|).
+ When used in Visual mode it is made characterwise.
+
+ *v_is* *is*
+is "inner sentence", select [count] sentences (see
+ |sentence|).
+ When used in Visual mode it is made characterwise.
+
+ *v_ap* *ap*
+ap "a paragraph", select [count] paragraphs (see
+ |paragraph|).
+ Exception: a blank line (only containing white space)
+ is also a paragraph boundary.
+ When used in Visual mode it is made linewise.
+
+ *v_ip* *ip*
+ip "inner paragraph", select [count] paragraphs (see
+ |paragraph|).
+ Exception: a blank line (only containing white space)
+ is also a paragraph boundary.
+ When used in Visual mode it is made linewise.
+
+a] *v_a]* *v_a[* *a]* *a[*
+a[ "a [] block", select [count] '[' ']' blocks. This
+ goes backwards to the [count] unclosed '[', and finds
+ the matching ']'. The enclosed text is selected,
+ including the '[' and ']'.
+ When used in Visual mode it is made characterwise.
+
+i] *v_i]* *v_i[* *i]* *i[*
+i[ "inner [] block", select [count] '[' ']' blocks. This
+ goes backwards to the [count] unclosed '[', and finds
+ the matching ']'. The enclosed text is selected,
+ excluding the '[' and ']'.
+ When used in Visual mode it is made characterwise.
+
+a) *v_a)* *a)* *a(*
+a( *v_ab* *v_a(* *ab*
+ab "a block", select [count] blocks, from "[count] [(" to
+ the matching ')', including the '(' and ')' (see
+ |[(|). Does not include white space outside of the
+ parenthesis.
+ When used in Visual mode it is made characterwise.
+
+i) *v_i)* *i)* *i(*
+i( *v_ib* *v_i(* *ib*
+ib "inner block", select [count] blocks, from "[count] [("
+ to the matching ')', excluding the '(' and ')' (see
+ |[(|).
+ When used in Visual mode it is made characterwise.
+
+a> *v_a>* *v_a<* *a>* *a<*
+a< "a <> block", select [count] <> blocks, from the
+ [count]'th unmatched '<' backwards to the matching
+ '>', including the '<' and '>'.
+ When used in Visual mode it is made characterwise.
+
+i> *v_i>* *v_i<* *i>* *i<*
+i< "inner <> block", select [count] <> blocks, from
+ the [count]'th unmatched '<' backwards to the matching
+ '>', excluding the '<' and '>'.
+ When used in Visual mode it is made characterwise.
+
+a} *v_a}* *a}* *a{*
+a{ *v_aB* *v_a{* *aB*
+aB "a Block", select [count] Blocks, from "[count] [{" to
+ the matching '}', including the '{' and '}' (see
+ |[{|).
+ When used in Visual mode it is made characterwise.
+
+i} *v_i}* *i}* *i{*
+i{ *v_iB* *v_i{* *iB*
+iB "inner Block", select [count] Blocks, from "[count] [{"
+ to the matching '}', excluding the '{' and '}' (see
+ |[{|).
+ When used in Visual mode it is made characterwise.
+
+When used after an operator:
+For non-block objects:
+ For the "a" commands: The operator applies to the object and the white
+ space after the object. If there is no white space after the object
+ or when the cursor was in the white space before the object, the white
+ space before the object is included.
+ For the "inner" commands: If the cursor was on the object, the
+ operator applies to the object. If the cursor was on white space, the
+ operator applies to the white space.
+For a block object:
+ The operator applies to the block where the cursor is in, or the block
+ on which the cursor is on one of the braces. For the "inner" commands
+ the surrounding braces are excluded. For the "a" commands, the braces
+ are included.
+
+When used in Visual mode:
+When start and end of the Visual area are the same (just after typing "v"):
+ One object is selected, the same as for using an operator.
+When start and end of the Visual area are not the same:
+ For non-block objects the area is extended by one object or the white
+ space up to the next object, or both for the "a" objects. The
+ direction in which this happens depends on which side of the Visual
+ area the cursor is. For the block objects the block is extended one
+ level outwards.
+
+For illustration, here is a list of delete commands, grouped from small to big
+objects. Note that for a single character and a whole line the existing vi
+movement commands are used.
+ "dl" delete character (alias: "x") |dl|
+ "diw" delete inner word *diw*
+ "daw" delete a word *daw*
+ "diW" delete inner WORD (see |WORD|) *diW*
+ "daW" delete a WORD (see |WORD|) *daW*
+ "dd" delete one line |dd|
+ "dis" delete inner sentence *dis*
+ "das" delete a sentence *das*
+ "dib" delete inner '(' ')' block *dib*
+ "dab" delete a '(' ')' block *dab*
+ "dip" delete inner paragraph *dip*
+ "dap" delete a paragraph *dap*
+ "diB" delete inner '{' '}' block *diB*
+ "daB" delete a '{' '}' block *daB*
+
+Note the difference between using a movement command and an object. The
+movement command operates from here (cursor position) to where the movement
+takes us. When using an object the whole object is operated upon, no matter
+where on the object the cursor is. For example, compare "dw" and "daw": "dw"
+deletes from the cursor position to the start of the next word, "daw" deletes
+the word under the cursor and the space after or before it.
+
+==============================================================================
+7. Marks *mark-motions* *E20* *E78*
+
+Jumping to a mark can be done in two ways:
+1. With ` (backtick): The cursor is positioned at the specified location
+ and the motion is |exclusive|.
+2. With ' (single quote): The cursor is positioned on the first non-blank
+ character in the line of the specified location and
+ the motion is linewise.
+
+ *m* *mark* *Mark*
+m{a-zA-Z} Set mark {a-zA-Z} at cursor position (does not move
+ the cursor, this is not a motion command).
+
+ *m'* *m`*
+m' or m` Set the previous context mark. This can be jumped to
+ with the "''" or "``" command (does not move the
+ cursor, this is not a motion command).
+
+ *m[* *m]*
+m[ or m] Set the |'[| or |']| mark. Useful when an operator is
+ to be simulated by multiple commands. (does not move
+ the cursor, this is not a motion command).
+
+ *:ma* *:mark* *E191*
+:[range]ma[rk] {a-zA-Z} Set mark {a-zA-Z} at last line number in [range],
+ column 0. Default is cursor line.
+
+ *:k*
+:[range]k{a-zA-Z} Same as :mark, but the space before the mark name can
+ be omitted.
+
+ *'* *'a* *`* *`a*
+'{a-z} `{a-z} Jump to the mark {a-z}.
+
+ *'A* *'0* *`A* *`0*
+'{A-Z0-9} `{A-Z0-9} To the mark {A-Z0-9} in the correct file (not a motion
+ command when in another file). {not in Vi}
+
+ *g'* *g'a* *g`* *g`a*
+g'{mark} g`{mark}
+ Jump to the {mark}, but don't change the jumplist when
+ jumping within the current buffer. Example: >
+ g`"
+< jumps to the last known position in a file. See
+ $VIMRUNTIME/vimrc_example.vim. {not in Vi}
+
+ *:marks*
+:marks List all the current marks (not a motion command).
+ The |'(|, |')|, |'{| and |'}| marks are not listed.
+ {not in Vi}
+ *E283*
+:marks {arg} List the marks that are mentioned in {arg} (not a
+ motion command). For example: >
+ :marks aB
+< to list marks 'a' and 'B'. {not in Vi}
+
+A mark is not visible in any way. It is just a position in the file that is
+remembered. Do not confuse marks with named registers, they are totally
+unrelated.
+
+'a - 'z lowercase marks, valid within one file
+'A - 'Z uppercase marks, also called file marks, valid between files
+'0 - '9 numbered marks, set from .viminfo file
+
+Lowercase marks 'a to 'z are remembered as long as the file remains in the
+buffer list. If you remove the file from the buffer list, all its marks are
+lost. If you delete a line that contains a mark, that mark is erased.
+
+To delete a mark: Create a new line, position the mark there, delete the line.
+E.g.: "o<Esc>mxdd". This does change the file though. Using "u" won't work,
+it also restores marks.
+
+Lowercase marks can be used in combination with operators. For example: "d't"
+deletes the lines from the cursor position to mark 't'. Hint: Use mark 't' for
+Top, 'b' for Bottom, etc.. Lowercase marks are restored when using undo and
+redo.
+
+Uppercase marks 'A to 'Z include the file name. {Vi: no uppercase marks} You
+can use them to jump from file to file. You can only use an uppercase mark
+with an operator if the mark is in the current file. The line number of the
+mark remains correct, even if you insert/delete lines or edit another file for
+a moment. When the 'viminfo' option is not empty, uppercase marks are kept in
+the .viminfo file. See |viminfo-file-marks|.
+
+Numbered marks '0 to '9 are quite different. They can not be set directly.
+They are only present when using a viminfo file |viminfo-file|. Basically '0
+is the location of the cursor when you last exited Vim, '1 the last but one
+time, etc. Use the "r" flag in 'viminfo' to specify files for which no
+Numbered mark should be stored. See |viminfo-file-marks|.
+
+
+ *'[* *`[*
+'[ `[ To the first character of the previously changed
+ or yanked text. {not in Vi}
+
+ *']* *`]*
+'] `] To the last character of the previously changed or
+ yanked text. {not in Vi}
+
+After executing an operator the Cursor is put at the beginning of the text
+that was operated upon. After a put command ("p" or "P") the cursor is
+sometimes placed at the first inserted line and sometimes on the last inserted
+character. The four commands above put the cursor at either end. Example:
+After yanking 10 lines you want to go to the last one of them: "10Y']". After
+inserting several lines with the "p" command you want to jump to the lowest
+inserted line: "p']". This also works for text that has been inserted.
+
+Note: After deleting text, the start and end positions are the same, except
+when using blockwise Visual mode. These commands do not work when no change
+was made yet in the current file.
+
+ *'<* *`<*
+'< `< To the first character of the last selected Visual
+ area in the current buffer. {not in Vi}.
+
+ *'>* *`>*
+'> `> To the last character of the last selected Visual
+ area in the current buffer. {not in Vi}.
+
+ *''* *``*
+'' `` To the position before latest jump, or where the last
+ "m'" or "m`" command was given. Not set when the
+ |:keepjumps| command modifier was used.
+ Also see |restore-position|.
+
+ *'quote* *`quote*
+'" `" To the cursor position when last exiting the current
+ buffer. Defaults to the first character of the first
+ line. See |last-position-jump| for how to use this
+ for each opened file.
+ Only one position is remembered per buffer, not one
+ for each window. As long as the buffer is visible in
+ a window the position won't be changed.
+ {not in Vi}.
+
+ *'^* *`^*
+'^ `^ To the position where the cursor was the last time
+ when Insert mode was stopped This is used by the |gi|
+ command. Not set when the |:keepjumps| command
+ modifier was used. {not in Vi}
+
+ *'.* *`.*
+'. `. To the position where the last change was made. The
+ position is at or near where the change started.
+ Sometimes a command is executed as several changes,
+ then the position can be near the end of what the
+ command changed. For example when inserting a word,
+ the position will be on the last character.
+ {not in Vi}
+
+ *'(* *`(*
+'( `( To the start of the current sentence, like the |(|
+ command. {not in Vi}
+
+ *')* *`)*
+') `) To the end of the current sentence, like the |)|
+ command. {not in Vi}
+
+ *'{* *`{*
+'{ `{ To the start of the current paragraph, like the |{|
+ command. {not in Vi}
+
+ *'}* *`}*
+'} `} To the end of the current paragraph, like the |}|
+ command. {not in Vi}
+
+These commands are not marks themselves, but jump to a mark:
+
+ *]'*
+]' [count] times to next line with a lowercase mark below
+ the cursor, on the first non-blank character in the
+ line. {not in Vi}
+
+ *]`*
+]` [count] times to lowercase mark after the cursor. {not
+ in Vi}
+
+ *['*
+[' [count] times to previous line with a lowercase mark
+ before the cursor, on the first non-blank character in
+ the line. {not in Vi}
+
+ *[`*
+[` [count] times to lowercase mark before the cursor.
+ {not in Vi}
+
+
+:loc[kmarks] {command} *:loc* *:lockmarks*
+ Execute {command} without adjusting marks. This is
+ useful when changing text in a way that the line count
+ will be the same when the change has completed.
+ WARNING: When the line count does change, marks below
+ the change will keep their line number, thus move to
+ another text line.
+ These items will not be adjusted for deleted/inserted
+ lines:
+ - lower case letter marks 'a - 'z
+ - upper case letter marks 'A - 'Z
+ - numbered marks '0 - '9
+ - last insert position '^
+ - last change position '.
+ - the Visual area '< and '>
+ - line numbers in placed signs
+ - line numbers in quickfix positions
+ - positions in the |jumplist|
+ - positions in the |tagstack|
+ These items will still be adjusted:
+ - previous context mark ''
+ - the cursor position
+ - the view of a window on a buffer
+ - folds
+ - diffs
+
+:kee[pmarks] {command} *:kee* *:keepmarks*
+ Currently only has effect for the filter command
+ |:range!|:
+ - When the number of lines after filtering is equal to
+ or larger than before, all marks are kept at the
+ same line number.
+ - When the number of lines decreases, the marks in the
+ ilnes that disappeared are deleted.
+ In any case the marks below the filtered text have
+ their line numbers adjusted, thus stick to the text,
+ as usual.
+ When the 'R' flag is missing from 'cpoptions' this has
+ the same effect as using ":keepmarks".
+
+ *:keepj* *:keepjumps*
+:keepj[umps] {command}
+ Do not change the |''|, |'.| and |'^| marks, the
+ |jumplist| or the |changelist|. Useful when making a
+ change or inserting text automatically and the user
+ doesn't want to go to this position. E.g., when
+ updating a "Last change" timestamp: >
+ autocmd BufWritePre,FileWritePre *.abc keepjumps call SetLastChange()
+
+==============================================================================
+8. Jumps *jump-motions*
+
+A "jump" is one of the following commands: "'", "`", "G", "/", "?", "n",
+"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and
+the commands that start editing a new file. If you make the cursor "jump"
+with one of these commands, the position of the cursor before the jump is
+remembered. You can return to that position with the "''" and "``" command,
+unless the line containing that position was changed or deleted.
+
+ *CTRL-O*
+CTRL-O Go to [count] Older cursor position in jump list
+ (not a motion command). {not in Vi}
+ {not available without the +jumplist feature}
+
+<Tab> or *CTRL-I* *<Tab>*
+CTRL-I Go to [count] newer cursor position in jump list
+ (not a motion command).
+ In a |quickfix-window| it takes you to the position of
+ the error under the cursor.
+ {not in Vi}
+ {not available without the +jumplist feature}
+
+ *:ju* *:jumps*
+:ju[mps] Print the jump list (not a motion command). {not in
+ Vi} {not available without the +jumplist feature}
+
+ *jumplist*
+Jumps are remembered in a jump list. With the CTRL-O and CTRL-I command you
+can go to cursor positions before older jumps, and back again. Thus you can
+move up and down the list. There is a separate jump list for each window.
+The maximum number of entries is fixed at 100.
+{not available without the +jumplist feature}
+
+For example, after three jump commands you have this jump list:
+
+ jump line col file/line ~
+ 3 1 0 some text ~
+ 2 70 0 another line ~
+ 1 1154 23 end. ~
+ > ~
+
+The "file/line" column shows the file name, or the text at the jump if it is
+in the current file (an indent is removed and a long line is truncated to fit
+in the window).
+
+You are currently in line 1167. If you then use the CTRL-O command, the
+cursor is put in line 1154. This results in:
+
+ jump line col file/line ~
+ 2 1 0 some text ~
+ 1 70 0 another line ~
+ > 0 1154 23 end. ~
+ 1 1167 0 foo bar ~
+
+The pointer will be set at the last used jump position. The next CTRL-O
+command will use the entry above it, the next CTRL-I command will use the
+entry below it. If the pointer is below the last entry, this indicates that
+you did not use a CTRL-I or CTRL-O before. In this case the CTRL-O command
+will cause the cursor position to be added to the jump list, so you can get
+back to the position before the CTRL-O. In this case this is line 1167.
+
+With more CTRL-O commands you will go to lines 70 and 1. If you use CTRL-I
+you can go back to 1154 and 1167 again. Note that the number in the "jump"
+column indicates the count for the CTRL-O or CTRL-I command that takes you to
+this position.
+
+If you use a jump command, the current line number is inserted at the end of
+the jump list. If the same line was already in the jump list, it is removed.
+The result is that when repeating CTRL-O you will get back to old positions
+only once.
+
+When the |:keepjumps| command modifier is used, jumps are not stored in the
+jumplist.
+
+After the CTRL-O command that got you into line 1154 you could give another
+jump command (e.g., "G"). The jump list would then become:
+
+ jump line col file/line ~
+ 4 1 0 some text ~
+ 3 70 0 another line ~
+ 2 1167 0 foo bar ~
+ 1 1154 23 end. ~
+ > ~
+
+The line numbers will be adjusted for deleted and inserted lines. This fails
+if you stop editing a file without writing, like with ":n!".
+
+When you split a window, the jumplist will be copied to the new window.
+
+If you have included the ' item in the 'viminfo' option the jumplist will be
+stored in the viminfo file and restored when starting Vim.
+
+
+CHANGE LIST JUMPS *changelist* *change-list-jumps* *E664*
+
+When making a change the cursor position is remembered. One position is
+remembered for every change that can be undone, unless it is close to a
+previous change. Two commands can be used to jump to positions of changes,
+also those that have been undone:
+
+ *g;* *E662*
+g; Go to [count] older position in change list.
+ If [count] is larger than the number of older change
+ positions go to the oldest change.
+ If there is no older change an error message is given.
+ (not a motion command)
+ {not in Vi}
+ {not available without the +jumplist feature}
+
+ *g,* *E663*
+g, Go to [count] newer cursor position in change list.
+ Just like "g;| but in the opposite direction.
+ (not a motion command)
+ {not in Vi}
+ {not available without the +jumplist feature}
+
+When using a count you jump as far back or forward as possible. Thus you can
+use "999g;" to go to the first change for which the position is still
+remembered. The number of entries in the change list is fixed and is the same
+as for the |jumplist|.
+
+When two undo-able changes are in the same line and at a column position less
+than 'textwidth' apart only the last one is remembered. This avoids that a
+sequence of small changes in a line, for example "xxxxx", adds many positions
+to the change list. When 'textwidth' is zero 'wrapmargin' is used. When that
+also isn't set a fixed number of 79 is used. Detail: For the computations
+bytes are used, not characters, to avoid a speed penalty (this only matters
+for multi-byte encodings).
+
+Note that when text has been inserted or deleted the cursor position might be
+a bit different from the position of the change. Especially when lines have
+been deleted.
+
+When the |:keepjumps| command modifier is used the position of a change is not
+remembered.
+
+ *:changes*
+:changes Print the change list. A ">" character indicates the
+ current position. Just after a change it is below the
+ newest entry, indicating that "g;" takes you to the
+ newest entry position. The first column indicates the
+ count needed to take you to this position. Example:
+
+ change line col text ~
+ 3 9 8 bla bla bla
+ 2 11 57 foo is a bar
+ 1 14 54 the latest changed line
+ >
+
+ The "3g;" command takes you to line 9. Then the
+ output of ":changes is:
+
+ change line col text ~
+ > 0 9 8 bla bla bla
+ 1 11 57 foo is a bar
+ 2 14 54 the latest changed line
+
+ Now you can use "g," to go to line 11 and "2g," to go
+ to line 14.
+
+==============================================================================
+9. Various motions *various-motions*
+
+ *%*
+% Find the next item in this line after or under the
+ cursor and jump to its match. |inclusive| motion.
+ Items can be:
+ ([{}]) parenthesis or (curly/square) brackets
+ (this can be changed with the
+ 'matchpairs' option)
+ /* */ start or end of C-style comment
+ #if, #ifdef, #else, #elif, #endif
+ C preprocessor conditionals (when the
+ cursor is on the # or no ([{
+ following)
+ For other items the matchit plugin can be used, see
+ |matchit-install|.
+
+ When 'cpoptions' contains "M" |cpo-M| backslashes
+ before parens and braces are ignored. Without "M" the
+ number of backslashes matters: an even number doesn't
+ match with an odd number. Thus in "( \) )" and "\( (
+ \)" the first and last parenthesis match.
+ When the '%' character is not present in 'cpoptions'
+ |cpo-%|, parens and braces inside double quotes are
+ ignored, unless the number of parens/braces in a line
+ is uneven and this line and the previous one does not
+ end in a backslash. '(', '{', '[', ']', '}' and ')'
+ are also ignored (parens and braces inside single
+ quotes). Note that this works fine for C, but not for
+ Perl, where single quotes are used for strings.
+ No count is allowed ({count}% jumps to a line {count}
+ percentage down the file |N%|). Using '%' on
+ #if/#else/#endif makes the movement linewise.
+
+ *[(*
+[( go to [count] previous unmatched '('.
+ |exclusive| motion. {not in Vi}
+
+ *[{*
+[{ go to [count] previous unmatched '{'.
+ |exclusive| motion. {not in Vi}
+
+ *])*
+]) go to [count] next unmatched ')'.
+ |exclusive| motion. {not in Vi}
+
+ *]}*
+]} go to [count] next unmatched '}'.
+ |exclusive| motion. {not in Vi}
+
+The above four commands can be used to go to the start or end of the current
+code block. It is like doing "%" on the '(', ')', '{' or '}' at the other
+end of the code block, but you can do this from anywhere in the code block.
+Very useful for C programs. Example: When standing on "case x:", "[{" will
+bring you back to the switch statement.
+
+ *]m*
+]m Go to [count] next start of a method (for Java or
+ similar structured language). When not before the
+ start of a method, jump to the start or end of the
+ class. When no '{' is found after the cursor, this is
+ an error. |exclusive| motion. {not in Vi}
+ *]M*
+]M Go to [count] next end of a method (for Java or
+ similar structured language). When not before the end
+ of a method, jump to the start or end of the class.
+ When no '}' is found after the cursor, this is an
+ error. |exclusive| motion. {not in Vi}
+ *[m*
+[m Go to [count] previous start of a method (for Java or
+ similar structured language). When not after the
+ start of a method, jump to the start or end of the
+ class. When no '{' is found before the cursor this is
+ an error. |exclusive| motion. {not in Vi}
+ *[M*
+[M Go to [count] previous end of a method (for Java or
+ similar structured language). When not after the
+ end of a method, jump to the start or end of the
+ class. When no '}' is found before the cursor this is
+ an error. |exclusive| motion. {not in Vi}
+
+The above two commands assume that the file contains a class with methods.
+The class definition is surrounded in '{' and '}'. Each method in the class
+is also surrounded with '{' and '}'. This applies to the Java language. The
+file looks like this: >
+
+ // comment
+ class foo {
+ int method_one() {
+ body_one();
+ }
+ int method_two() {
+ body_two();
+ }
+ }
+Starting with the cursor on "body_two()", using "[m" will jump to the '{' at
+the start of "method_two()" (obviously this is much more useful when the
+method is long!). Using "2[m" will jump to the start of "method_one()".
+Using "3[m" will jump to the start of the class.
+
+ *[#*
+[# go to [count] previous unmatched "#if" or "#else".
+ |exclusive| motion. {not in Vi}
+
+ *]#*
+]# go to [count] next unmatched "#else" or "#endif".
+ |exclusive| motion. {not in Vi}
+
+These two commands work in C programs that contain #if/#else/#endif
+constructs. It brings you to the start or end of the #if/#else/#endif where
+the current line is included. You can then use "%" to go to the matching line.
+
+ *[star* *[/*
+[* or [/ go to [count] previous start of a C comment "/*".
+ |exclusive| motion. {not in Vi}
+
+ *]star* *]/*
+]* or ]/ go to [count] next end of a C comment "*/".
+ |exclusive| motion. {not in Vi}
+
+
+ *H*
+H To line [count] from top (Home) of window (default:
+ first line on the window) on the first non-blank
+ character |linewise|. See also 'startofline' option.
+ Cursor is adjusted for 'scrolloff' option.
+
+ *M*
+M To Middle line of window, on the first non-blank
+ character |linewise|. See also 'startofline' option.
+
+ *L*
+L To line [count] from bottom of window (default: Last
+ line on the window) on the first non-blank character
+ |linewise|. See also 'startofline' option.
+ Cursor is adjusted for 'scrolloff' option.
+
+<LeftMouse> Moves to the position on the screen where the mouse
+ click is |inclusive|. See also |<LeftMouse>|. If the
+ position is in a status line, that window is made the
+ active window and the cursor is not moved. {not in Vi}
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
new file mode 100644
index 000000000..55725e15e
--- /dev/null
+++ b/runtime/doc/netbeans.txt
@@ -0,0 +1,735 @@
+*netbeans.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Gordon Prieur
+
+
+NetBeans ExternalEditor Integration Features *netbeans*
+ *netbeans-support*
+1. Introduction |netbeans-intro|
+2. NetBeans Key Bindings |netbeans-keybindings|
+3. Configuring Vim for NetBeans |netbeans-configure|
+4. Downloading NetBeans |netbeans-download|
+5. Preparing NetBeans for Vim |netbeans-preparation|
+6. Obtaining the External Editor Module |obtaining-exted|
+7. Setting up NetBeans to run with Vim |netbeans-setup|
+8. Messages |netbeans-messages|
+9. Running Vim from NetBeans |netbeans-run|
+10. NetBeans protocol |netbeans-protocol|
+11. Known problems |netbeans-problems|
+
+{Vi does not have any of these features}
+{only available when compiled with the |+netbeans_intg| feature}
+
+==============================================================================
+1. Introduction *netbeans-intro*
+
+NetBeans is an open source Integrated Development Environment developed
+jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
+Initially just a Java IDE, NetBeans has had C, C++, and Fortran support added
+in recent releases.
+
+For more information visit the main NetBeans web site http://www.netbeans.org
+or the NetBeans External Editor site at http://externaleditor.netbeans.org.
+
+Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
+Visit http://www.sun.com for more information regarding the Sun ONE Studio
+product line.
+
+Current releases of NetBeans provide full support for Java and limited support
+for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
+support for Java, C, C++, and Fortran.
+
+The interface to NetBeans is also supported by Agide, the A-A-P GUI IDE.
+Agide is very different from NetBeans:
+- Based on Python instead of Java, much smaller footprint and fast startup.
+- Agide is a framework in which many different tools can work together.
+See the A-A-P website for information: http://www.A-A-P.org.
+
+==============================================================================
+2. NetBeans Key Bindings *netbeans-keybindings*
+
+Vim understands a number of key bindings that execute NetBeans commands. These
+are typically all the Function key combinations. To execute a NetBeans command,
+the user must press the Pause key followed by a NetBeans key binding. For
+example, in order to compile a Java file, the NetBeans key binding is "F9". So,
+while in vim, press "Pause F9" to compile a java file. To toggle a breakpoint
+at the current line, press "Pause Shift F8".
+
+The Pause key is Function key 21. If you don't have a working Pause key and
+want to use F8 instead, use: >
+
+ :map <F8> <F21>
+
+The External Editor module dynamically reads the NetBeans key bindings so vim
+should always have the latest key bindings, even when NetBeans changes them.
+
+==============================================================================
+3. Configuring Vim for NetBeans *netbeans-configure*
+
+For more help installing vim, please read |usr_90.txt| in the Vim User Manual.
+
+
+On Unix
+
+When running configure without arguments the NetBeans interface should be
+included. That is, if the configure check to find out if your system supports
+the required features succeeds.
+
+In case you do not want the NetBeans interface you can disable it by
+uncommenting a line with "--disable-netbeans" in the Makefile.
+
+Currently, only gvim is supported in this integration as NetBeans does not
+have means to supply a terminal emulator for the vim command. Furthermore,
+there is only GUI support for GTK, GNOME, and Motif.
+
+If Motif support is required the user must supply XPM libraries. See
+|workshop-xpm| for details on obtaining the latest version of XPM.
+
+
+On MS-Windows
+
+The Win32 support is now in beta stage.
+
+To use XPM signs on Win32 (e.g. when using with NetBeans) you can compile
+XPM by yourself or use precompiled libraries from http://iamphet.nm.ru/misc/
+(for MS Visual C++) or http://gnuwin32.sourceforge.net (for MinGW).
+
+==============================================================================
+4. Downloading NetBeans *netbeans-download*
+
+The NetBeans IDE is available for download from netbeans.org. You can download
+a released version, download sources, or use CVS to download the current
+source tree. If you choose to download sources, follow directions from
+netbeans.org on building NetBeans.
+
+Depending on the version of NetBeans you download, you may need to do further
+work to get the required External Editor module. This is the module which lets
+NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
+for details on downloading this module if your NetBeans release does not have
+it.
+
+For C, C++, and Fortran support you will also need the cpp module. See
+http://cpp.netbeans.org for information regarding this module.
+
+You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
+free trial. See http://www.sun.com for further details.
+
+==============================================================================
+5. Preparing NetBeans for Vim *netbeans-preparation*
+
+In order for NetBeans to work with vim, the NetBeans External Editor module
+must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
+then this module should be loaded and enabled. If you have a NetBeans release
+you may need to find another way of obtaining this open source module.
+
+You can check if you have this module by opening the Tools->Options dialog
+and drilling down to the "Modules" list (IDE Configuration->System->Modules).
+If your Modules list has an entry for "External Editor" you must make sure
+it is enabled (the "Enabled" property should have the value "True"). If your
+Modules list has no External Editor see the next section on |obtaining-exted|.
+
+==============================================================================
+6. Obtaining the External Editor Module *obtaining-exted*
+
+There are 2 ways of obtaining the External Editor module. The easiest way
+is to use the NetBeans Update Center to download and install the module.
+Unfortunately, some versions do not have this module in their update
+center. If you cannot download via the update center you will need to
+download sources and build the module. I will try and get the module
+available from the NetBeans Update Center so building will be unnecessary.
+Also check http://externaleditor.netbeans.org for other availability options.
+
+To download the External Editor sources via CVS and build your own module,
+see http://externaleditor.netbeans.org and http://www.netbeans.org.
+Unfortunately, this is not a trivial procedure.
+
+==============================================================================
+7. Setting up NetBeans to run with Vim *netbeans-setup*
+
+Assuming you have loaded and enabled the NetBeans External Editor module
+as described in |netbeans-preparation| all you need to do is verify that
+the gvim command line is properly configured for your environment.
+
+Open the Tools->Options dialog and open the Editing category. Select the
+External Editor. The right hand pane should contain a Properties tab and
+an Expert tab. In the Properties tab make sure the "Editor Type" is set
+to "Vim". In the Expert tab make sure the "Vim Command" is correct.
+
+You should be careful if you change the "Vim Command". There are command
+line options there which must be there for the connection to be properly
+set up. You can change the command name but thats about it. If your gvim
+can be found by your $PATH then the VIM Command can start with "gvim". If
+you don't want gvim searched from your $PATH then hard code in the full
+Unix path name. At this point you should get a gvim for any source file
+you open in NetBeans.
+
+If some files come up in gvim and others (with different file suffixes) come
+up in the default NetBeans editor you should verify the MIME type in the
+Expert tab MIME Type property. NetBeans is MIME oriented and the External
+Editor will only open MIME types specified in this property.
+
+==============================================================================
+8. Messages *netbeans-messages*
+
+These messages are specific for NetBeans:
+
+ *E463*
+Region is guarded, cannot modify
+ NetBeans defines guarded areas in the text, which you cannot
+ change.
+
+ *E656*
+NetBeans dissallows writes of unmodified buffers
+ NetBeans does not support writes of unmodified buffers that
+ were opened from NetBeans.
+
+ *E657*
+Partial writes disallowed for NetBeans buffers
+ NetBeans does not support partial writes for buffers that were
+ opened from NetBeans.
+
+ *E658*
+NetBeans connection lost for this buffer
+ NetBeans has become confused about the state of this file.
+ Rather than risc data corruption, NetBeans has severed the
+ connection for this file. Vim will take over responsibility
+ for saving changes to this file and NetBeans will no longer
+ know of these changes.
+
+==============================================================================
+9. Running Vim from NetBeans *netbeans-run*
+
+NetBeans starts Vim with the |-nb| argument. Three forms can be used, that
+differ in the way the information for the connection is specified:
+
+ -nb={fname} from a file
+ -nb:{hostname}:{addr}:{password} directly
+ -nb from a file or environment
+
+ *E660* *E668*
+For security reasons, the best method is to write the information in a file
+readable only by the user. The name of the file can be passed with the
+"-nb={fname}" argument or, when "-nb" is used without a parameter, the
+environment variable "__NETBEANS_CONINFO". The file must contain these three
+lines, in any order:
+
+ host={hostname}
+ port={addr}
+ auth={password}
+
+Other lines are ignored. The caller of Vim is responsible for deleting the
+file afterwards.
+
+{hostname} is the name of the machine where NetBeans is running. When omitted
+the environment variable "__NETBEANS_HOST" is used or the default "localhost".
+
+{addr} is the port number for NetBeans. When omitted the environment variable
+"__NETBEANS_SOCKET" is used or the default 3219.
+
+{password} is the password for connecting to NetBeans. When omitted the
+environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
+
+==============================================================================
+10. NetBeans protocol *netbeans-protocol*
+
+The communication between NetBeans and Vim uses plain text messages. This
+protocol was first designed to work with the external editor module of
+NetBeans (see http://externaleditor.netbeans.org). Later it was extended to
+work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org). The extensions are
+marked with "version 2.1".
+
+Version 2.2 of the protocol has several minor changes which should only
+affect NetBeans users (ie, not Agide users). However, a bug was fixed which
+could cause confusion. The netbeans_saved() function sent a "save" protocol
+command. In protocol version 2.1 and earlier this was incorrectly interpreted
+as a notification that a write had taken place. In reality, it told NetBeans
+to save the file so multiple writes were being done. This caused various
+problems and has been fixed in 2.2. To decrease the likelyhood of this
+confusion happening again, netbeans_saved() has been renamed to
+netbeans_save_buffer().
+
+The messages are currently sent over a socket. Since the messages are in
+plain UTF-8 text this protocol could also be used with any other communication
+mechanism.
+
+10.1 Kinds of messages |nb-messages|
+10.2 Terms |nb-terms|
+10.3 Commands |nb-commands|
+10.4 Functions and Replies |nb-functions|
+10.5 Events |nb-events|
+10.6 Special messages |nb-special|
+
+*E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636*
+*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
+*E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654*
+These errors occur when a message violates the protocol.
+
+
+10.1 Kinds of messages *nb-messages*
+
+There are four kinds of messages:
+
+kind direction comment ~
+Command IDE -> editor no reply necessary
+Function IDE -> editor editor must send back a reply
+Reply editor -> IDE only in response to a Function
+Event editor -> IDE no reply necessary
+
+The messages are sent as a single line with a terminating newline character.
+Arguments are separated by a single space. The first item of the message
+depends on the kind of message:
+
+kind first item example ~
+Command bufID:name!seqno 11:showBalloon!123 "text"
+Function bufID:name/seqno 11:getLength/123
+Reply seqno 123 5000
+Event bufID:name=123 11:keyCommand=123 "S-F2"
+
+
+10.2 Terms *nb-terms*
+
+bufID Buffer number. A message may be either for a specific buffer
+ or generic. Generic messages use a bufID of zero. NOTE: this
+ buffer ID is assigned by the IDE, it is not Vim's buffer
+ number. The bufID must be a sequentially rising number,
+ starting at one.
+
+seqno The IDE uses a sequence number for Commands and Functions. A
+ Reply must use the sequence number of the Function that it is
+ associated with. A zero sequence number can be used for
+ Events (the seqno of the last received Command or Function can
+ also be used).
+
+string Argument in double quotes. Text is in UTF-8 encoding. This
+ means ASCII is passed as-is. Special characters are
+ represented with a backslash:
+ \" double quote
+ \n newline
+ \r carriage-return
+ \t tab (optional, also works literally)
+ \\ backslash
+ NUL bytes are not allowed!
+
+boolean Argument with two possible values:
+ T true
+ F false
+
+number Argument with a decimal number.
+
+optnum Argument with either a decimal number or "none" (without the
+ quotes).
+
+offset A number argument that indicates a byte position in a buffer.
+ The first byte has offset zero. Line breaks are counted for
+ how they appear in the file (CR/LF counts for two bytes).
+ Note that a multi-byte character is counted for the number of
+ bytes it takes.
+
+lnum/col Argument with a line number and column number position. The
+ line number starts with one, the column is the byte position,
+ starting with zero. Note that a multi-byte character counts
+ for several columns.
+
+pathname String argument: file name with full path.
+
+
+10.3 Commands *nb-commands*
+
+actionMenuItem Not implemented.
+
+actionSensitivity
+ Not implemented.
+
+addAnno serNum typeNum off len
+ Place an annotation in this buffer.
+ Arguments:
+ serNum number serial number of this placed
+ annotation, used to be able to remove
+ it
+ typeNum number sequence number of the annotation
+ defined with defineAnnoType for this
+ buffer
+ off number offset where annotation is to be placed
+ len number not used
+ In version 2.1 "lnum/col" can be used instead of "off".
+
+balloonResult text
+ Not implemented.
+
+close Close the buffer. This leaves us without current buffer, very
+ dangerous to use!
+
+create Creates a buffer without a name. Replaces the current buffer
+ (it's hidden when it was changed).
+ NetBeans uses this as the first command for a file that is
+ being opened. The sequence of commands could be:
+ create
+ setCaretListener (ignored)
+ setModified (no effect)
+ setContentType (ignored)
+ startDocumentListen
+ setTitle
+ setFullName
+
+defineAnnoType typeNum typeName tooltip glyphFile fg bg
+ Define a type of annotation for this buffer.
+ Arguments:
+ typeNum number sequence number (not really used)
+ typeName string name that identifies this annotation
+ tooltip string not used
+ glyphFile string name of icon file
+ fg optnum foreground color for line highlighting
+ bg optnum background color for line highlighting
+ Vim will define a sign for the annotation.
+ When both "fg" and "bg" are "none" no line highlighting is
+ used (new in version 2.1).
+ When "glyphFile" is empty, no text sign is used (new in
+ version 2.1).
+ When "glyphFile" is one or two characters long, a text sign is
+ defined (new in version 2.1).
+ Note: the annotations will be defined in sequence, and the
+ sequence number is later used with addAnno.
+
+editFile pathname
+ Set the name for the buffer and edit the file "pathname", a
+ string argument.
+ Normal way for the IDE to tell the editor to edit a file. If
+ the IDE is going to pass the file text to the editor use these
+ commands instead:
+ setFullName
+ insert
+ initDone
+ New in version 2.1.
+
+enableBalloonEval
+ Not implemented.
+
+endAtomic End an atomic operation. The changes between "startAtomic"
+ and "endAtomic" can be undone as one operation. But it's not
+ implemented yet. Redraw when necessary.
+
+guard off len
+ Mark an area in the buffer as guarded. This means it cannot
+ be edited. "off" and "len" are numbers and specify the text
+ to be guarded.
+
+initDone Mark the buffer as ready for use. Implicitly makes the buffer
+ the current buffer. Fires the BufReadPost autocommand event.
+
+moveAnnoToFront serNum
+ Not implemented.
+
+netbeansBuffer isNetbeansBuffer
+ If "isNetbeansBuffer" is "T" then this buffer is ``owned'' by
+ NetBeans.
+ New in version 2.2.
+
+putBufferNumber pathname
+ Associate a buffer number with the Vim buffer by the name
+ "pathname", a string argument. To be used when the editor
+ reported editing another file to the IDE and the IDE needs to
+ tell the editor what buffer number it will use for this file.
+ Also marks the buffer as initialized.
+ New in version 2.1.
+
+raise Bring the editor to the foreground.
+ New in version 2.1.
+
+removeAnno serNum
+ Remove a previously place annotation for this buffer.
+ "serNum" is the same number used in addAnno.
+
+save Save the buffer when it was modified. The other side of the
+ interface is expected to write the buffer and invoke
+ "setModified" to reset the "changed" flag of the buffer.
+ The writing is skipped when one of these conditions is true:
+ - 'write' is not set
+ - the buffer is read-only
+ - the buffer does not have a file name
+ - 'buftype' disallows writing
+ New in version 2.2.
+
+setAsUser Not implemented.
+
+setBufferNumber pathname
+ Associate a buffer number with Vim buffer by the name
+ "pathname". To be used when the editor reported editing
+ another file to the IDE and the IDE needs to tell the editor
+ what buffer number it will use for this file.
+ Has the side effect of making the buffer the current buffer.
+ See "putBufferNumber" for a more useful command.
+
+setContentType
+ Not implemented.
+
+setDot off Make the buffer the current buffer and set the cursor at the
+ specified position. If there are folds they are opened to
+ make the cursor line visible.
+ In version 2.1 "lnum/col" can be used instead of "off".
+
+setExitDelay seconds
+ Set the delay for exiting to "seconds", a number.
+ This delay is used to give the IDE a chance to handle things
+ before really exiting. The default delay is two seconds.
+ New in version 2.1.
+
+setFullName pathname
+ Set the file name to be used for a buffer to "pathname", a
+ string argument.
+ Used when the IDE wants to edit a file under control of the
+ IDE. This makes the buffer the current buffer, but does not
+ read the file. "insert" commands will be used next to set the
+ contents.
+
+setLocAndSize Not implemented.
+
+setMark Not implemented.
+
+setModified modified
+ When the boolean argument "modified" is "T" mark the buffer as
+ modified, when it is "F" mark it as unmodified.
+
+setReadOnly Not implemented.
+
+setStyle Not implemented.
+
+setTitle name
+ Set the title for the buffer to "name", a string argument.
+ The title is only used for NetBeans functions, not by Vim.
+
+setVisible visible
+ When the boolean argument "visible" is "T", goto the buffer.
+ The "F" argument does nothing.
+
+showBalloon text
+ Show a balloon (popup window) at the mouse pointer position,
+ containing "text", a string argument. The balloon should
+ disappear when the mouse is moved more than a few pixels.
+ New in version 2.1.
+
+specialKeys Not implemented.
+
+startAtomic Begin an atomic operation. The screen will not be updated
+ until "endAtomic" is given.
+
+startCaretListen
+ Not implemented.
+
+startDocumentListen
+ Mark the buffer to report changes to the IDE with the
+ "insert" and "remove" events. The default is to report
+ changes.
+
+stopCaretListen
+ Not implemented.
+
+stopDocumentListen
+ Mark the buffer to stop reporting changes to the IDE.
+ Opposite of startDocumentListen.
+
+unguard off len
+ Opposite of "guard", remove guarding for a text area.
+
+version Not implemented.
+
+
+10.4 Functions and Replies *nb-functions*
+
+getDot Not implemented.
+
+getCursor Return the current buffer and cursor position.
+ The reply is:
+ seqno bufID lnum col off
+ seqno = sequence number of the function
+ bufID = buffer ID of the current buffer (if this is unknown -1
+ is used)
+ lnum = line number of the cursor (first line is one)
+ col = column number of the cursor (in bytes, zero based)
+ off = offset of the cursor in the buffer (in bytes)
+ New in version 2.1.
+
+getLength Return the length of the buffer in bytes.
+ Reply example for a buffer with 5000 bytes:
+ 123 5000
+ TODO: explain use of partial line.
+
+getMark Not implemented.
+
+getModified When a buffer is specified: Return zero if the buffer does not
+ have changes, one if it does have changes.
+ When no buffer is specified (buffer number zero): Return the
+ number of buffers with changes. When the result is zero it's
+ safe to tell Vim to exit.
+ New in version 2.1.
+
+getText Return the contents of the buffer as a string.
+ Reply example for a buffer with two lines
+ 123 "first line\nsecond line\n"
+ NOTE: docs indicate an offset and length argument, but this is
+ not implemented.
+
+insert off text
+ Insert "text" before position "off". "text" is a string
+ argument, "off" a number.
+ Possible replies:
+ 123 no problem
+ 123 !message failed
+ Note that the message in the reply is not quoted.
+
+remove off length
+ Delete "length" bytes of text at position "off". Both
+ arguments are numbers.
+ Possible replies:
+ 123 no problem
+ 123 !message failed
+ Note that the message in the reply is not quoted.
+
+saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
+ If there are no changed files or the user does not cancel the
+ operation Vim exits and no result is sent back. The IDE can
+ consider closing the connection as a successful result.
+ If the user cancels the operation the number of modified
+ buffers that remains is returned and Vim does not exit.
+ New in version 2.1.
+
+
+10.5 Events *nb-events*
+
+balloonEval off len type
+ The mouse pointer rests on text for a short while. When "len"
+ is zero, there is no selection and the pointer is at position
+ "off". When "len" is non-zero the text from position "off" to
+ "off" + "len" is selected.
+ Only sent after "enableBalloonEval" was used for this buffer.
+ "type" is not yet defined.
+ Not implemented yet.
+
+balloonText text
+ Used when 'ballooneval' is set and the mouse pointer rests on
+ some text for a moment. "text" is a string, the text under
+ the mouse pointer.
+ New in version 2.1.
+
+buttonRelease button lnum col
+ Report which button was pressed and the location of the cursor
+ at the time of the release. Only for buffers that are owned
+ by NetBeans. This event is not sent if the button was
+ released while the mouse was in the status line or in a
+ separator line. If col is less than 1 the button release was
+ in the sign area.
+ New in version 2.2.
+
+fileClosed Not implemented.
+
+fileModified Not implemented.
+
+fileOpened pathname open modified
+ A file was opened by the user.
+ Arguments:
+ pathname string name of the file
+ open boolean always "T"
+ modified boolean always "F"
+
+geometry cols rows x y
+ Report the size and position of the editor window.
+ Arguments:
+ cols number number of text columns
+ rows number number of text rows
+ x number pixel position on screen
+ y number pixel position on screen
+ Only works for Motif.
+
+insert off text
+ Text "text" has been inserted in Vim at position "off".
+ Only fired when enabled, see "startDocumentListen".
+
+invokeAction Not implemented.
+
+keyCommand keyName
+ Reports a special key being pressed with name "keyName", which
+ is a string.
+ Supported key names:
+ F1 function key 1
+ F2 function key 2
+ ...
+ F12 function key 12
+
+ ' ' space (without the quotes)
+ ! exclamation mark
+ ... any other ASCII printable character
+ ~ tilde
+
+ X any unrecognized key
+
+ The key may be prepended by "C", "S" and/or "M" for Control,
+ Shift and Meta (Alt) modifiers. If there is a modifier a dash
+ is used to separate it from the key name. For example:
+ "C-F2".
+ ASCII characters are new in version 2.1.
+
+keyAtPos keyName lnum/col
+ Like "keyCommand" and also report the line number and column
+ of the cursor.
+ New in version 2.1.
+
+killed A file was closed by the user. Only for files that have been
+ assigned a number by the IDE.
+
+newDotAndMark off off
+ Reports the position of the cursor being at "off" bytes into
+ the buffer. Only sent just before a "keyCommand" event.
+
+quit Not implemented.
+
+remove off len
+ Text was deleted in Vim at position "off" with byte length
+ "len".
+ Only fired when enabled, see "startDocumentListen".
+
+revert Not implemented.
+
+save The buffer has been saved and is now unmodified.
+ Only fired when enabled, see "startDocumentListen".
+
+startupDone The editor has finished its startup work and is ready for
+ editing files.
+ New in version 2.1.
+
+unmodified The buffer is now unmodified.
+ Only fired when enabled, see "startDocumentListen".
+
+version vers Report the version of the interface implementation. Vim
+ reports "2.2" (including the quotes).
+
+
+10.6 Special messages *nb-special*
+
+These messages do not follow the style of the messages above. They are
+terminated by a newline character.
+
+ACCEPT Not used.
+
+AUTH password editor -> IDE: First message that the editor sends to the IDE.
+ Must contain the password for the socket server, as specified
+ with the |-nb| argument. No quotes are used!
+
+DISCONNECT IDE -> editor: break the connection. The editor will exit.
+ The IDE must only send this message when there are no unsaved
+ changes!
+
+DETACH IDE -> editor: break the connection without exiting the
+ editor. Used when the IDE exits without bringing down the
+ editor as well.
+ New in version 2.1.
+
+REJECT Not used.
+
+==============================================================================
+11. Known problems *netbeans-problems*
+
+NUL bytes are not possible. For editor -> IDE they will appear as NL
+characters. For IDE -> editor they cannot be inserted.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
new file mode 100644
index 000000000..5dfb582e8
--- /dev/null
+++ b/runtime/doc/options.txt
@@ -0,0 +1,6826 @@
+*options.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Options *options*
+
+1. Setting options |set-option|
+2. Automatically setting options |auto-setting|
+3. Options summary |option-summary|
+
+For an overview of options see help.txt |option-list|.
+
+Vim has a number of internal variables and switches which can be set to
+achieve special effects. These options come in three forms:
+ boolean can only be on or off *boolean* *toggle*
+ number has a numeric value
+ string has a string value
+
+==============================================================================
+1. Setting options *set-option*
+
+ *:se* *:set*
+:se[t] Show all options that differ from their default value.
+
+:se[t] all Show all but terminal options.
+
+:se[t] termcap Show all terminal options. Note that in the GUI the
+ key codes are not shown, because they are generated
+ internally and can't be changed. Changing the terminal
+ codes in the GUI is not useful either...
+
+ *E518* *E519*
+:se[t] {option}? Show value of {option}.
+
+:se[t] {option} Toggle option: set, switch it on.
+ Number option: show value.
+ String option: show value.
+
+:se[t] no{option} Toggle option: Reset, switch it off.
+
+:se[t] {option}! or
+:se[t] inv{option} Toggle option: Invert value. {not in Vi}
+
+ *:set-default* *:set-&* *:set-&vi* *:set-&vim*
+:se[t] {option}& Reset option to its default value. May depend on the
+ current value of 'compatible'. {not in Vi}
+:se[t] {option}&vi Reset option to its Vi default value. {not in Vi}
+:se[t] {option}&vim Reset option to its Vim default value. {not in Vi}
+
+:se[t] all& Set all options, except terminal options, to their
+ default value. The values of 'term', 'lines' and
+ 'columns' are not changed. {not in Vi}
+
+ *:set-args* *E487* *E521*
+:se[t] {option}={value} or
+:se[t] {option}:{value}
+ Set string or number option to {value}.
+ For numeric options the value can be given in decimal,
+ hex (preceded with 0x) or octal (preceded with '0')
+ (hex and octal are only available for machines which
+ have the strtol() function).
+ The old value can be inserted by typing 'wildchar' (by
+ default this is a <Tab> or CTRL-E if 'compatible' is
+ set). See |cmdline-completion|.
+ White space between {option} and '=' is allowed and
+ will be ignored. White space between '=' and {value}
+ is not allowed.
+ See |option-backslash| for using white space and
+ backslashes in {value}.
+
+:se[t] {option}+={value} *:set+=*
+ Add the {value} to a number option, or append the
+ {value} to a string option. When the option is a
+ comma separated list, a comma is added, unless the
+ value was empty.
+ If the option is a list of flags, superfluous flags
+ are removed. Otherwise there is no check for doubled
+ values. You can avoid this by removing a value first.
+ Example: >
+ :set guioptions-=T guioptions+=T
+< Also see |:set-args| above.
+ {not in Vi}
+
+:se[t] {option}^={value} *:set^=*
+ Multiply the {value} to a number option, or prepend
+ the {value} to a string option. When the option is a
+ comma separated list, a comma is added, unless the
+ value was empty.
+ Also see |:set-args| above.
+ {not in Vi}
+
+:se[t] {option}-={value} *:set-=*
+ Subtract the {value} from a number option, or remove
+ the {value} from a string option, if it is there.
+ If the {value} is not found in a string option, there
+ is no error or warning. When the option is a comma
+ separated list, a comma is deleted, unless the option
+ becomes empty.
+ When the option is a list of flags, {value} must be
+ exactly as they appear in the option. Remove flags
+ one by one to avoid problems.
+ Also see |:set-args| above.
+ {not in Vi}
+
+The {option} arguments to ":set" may be repeated. For example: >
+ :set ai nosi sw=3 ts=3
+If you make an error in one of the arguments, an error message will be given
+and the following arguments will be ignored.
+
+ *:set-verbose*
+When 'verbose' is non-zero, displaying an option value will also tell where it
+was last set. Example: >
+ :verbose set shiftwidth cindent?
+ shiftwidth=4
+ Last set from modeline
+ cindent
+ Last set from /usr/local/share/vim/vim60/ftplugin/c.vim
+This is only done when specific option values are requested, not for ":set
+all" or ":set" without an argument.
+When the option was set by hand there is no "Last set" message. There is only
+one value for all local options with the same name. Thus the message applies
+to the option name, not necessarily its value.
+When the option was set while executing a function, user command or
+autocommand, the script in which it was defined is reported.
+Note that an option may also have been set as a side effect of setting
+'compatible'.
+{not available when compiled without the +eval feature}
+
+ *:set-termcap* *E522*
+For {option} the form "t_xx" may be used to set a termcap option. This will
+override the value from the termcap. You can then use it in a mapping. If
+the "xx" part contains special characters, use the <t_xx> form: >
+ :set <t_#4>=^[Ot
+This can also be used to translate a special code for a normal key. For
+example, if Alt-b produces <Esc>b, use this: >
+ :set <M-b>=^[b
+(the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it)
+The advantage over a mapping is that it works in all situations.
+
+The listing from ":set" looks different from Vi. Long string options are put
+at the end of the list. The number of options is quite large. The output of
+"set all" probably does not fit on the screen, causing Vim to give the
+|more-prompt|.
+
+ *option-backslash*
+To include white space in a string option value it has to be preceded with a
+backslash. To include a backslash you have to use two. Effectively this
+means that the number of backslashes in an option value is halved (rounded
+down).
+A few examples: >
+ :set tags=tags\ /usr/tags results in "tags /usr/tags"
+ :set tags=tags\\,file results in "tags\,file"
+ :set tags=tags\\\ file results in "tags\ file"
+
+The "|" character separates a ":set" command from a following command. To
+include the "|" in the option value, use "\|" instead. This example sets the
+'titlestring' option to "hi|there": >
+ :set titlestring=hi\|there
+This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
+ :set titlestring=hi|set iconstring=there
+
+For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
+precise: For options that expect a file name (those where environment
+variables are expanded) a backslash before a normal file name character is not
+removed. But a backslash before a special character (space, backslash, comma,
+etc.) is used like explained above.
+There is one special situation, when the value starts with "\\": >
+ :set dir=\\machine\path results in "\\machine\path"
+ :set dir=\\\\machine\\path results in "\\machine\path"
+ :set dir=\\path\\file results in "\\path\file" (wrong!)
+For the first one the start is kept, but for the second one the backslashes
+are halved. This makes sure it works both when you expect backslashes to be
+halved and when you expect the backslashes to be kept. The third gives a
+result which is probably not what you want. Avoid it.
+
+ *add-option-flags* *remove-option-flags*
+ *E539* *E550* *E551* *E552*
+Some options are a list of flags. When you want to add a flag to such an
+option, without changing the existing ones, you can do it like this: >
+ :set guioptions+=a
+Remove a flag from an option like this: >
+ :set guioptions-=a
+This removes the 'a' flag from 'guioptions'.
+Note that you should add or remove one flag at a time. If 'guioptions' has
+the value "ab", using "set guioptions-=ba" won't work, because the string "ba"
+doesn't appear.
+
+ *:set_env* *expand-env* *expand-environment-var*
+Environment variables in most string options will be expanded. If the
+environment variable exists the '$' and the following environment variable
+name is replaced with its value. If it does not exist the '$' and the name
+are not modified. Any non-id character (not a letter, digit or '_') may
+follow the environment variable name. That character and what follows is
+appended to the value of the environment variable. Examples: >
+ :set term=$TERM.new
+ :set path=/usr/$INCLUDE,$HOME/include,.
+When adding or removing a string from an option with ":set opt-=val" or ":set
+opt+=val" the expansion is done before the adding or removing.
+
+
+Handling of local options *local-options*
+
+Some of the options only apply to a window or buffer. Each window or buffer
+has its own copy of this option, thus can each have their own value. This
+allows you to set 'list' in one window but not in another. And set
+'shiftwidth' to 3 in one buffer and 4 in another.
+
+The following explains what happens to these local options in specific
+situations. You don't really need to know all of this, since Vim mostly uses
+the option values you would expect. Unfortunately, doing what the user
+expects is a bit complicated...
+
+When splitting a window, the local options are copied to the new window. Thus
+right after the split the contents of the two windows look the same.
+
+When editing a new buffer, its local option values must be initialized. Since
+the local options of the current buffer might be specifically for that buffer,
+these are not used. Instead, for each buffer-local option there also is a
+global value, which is used for new buffers. With ":set" both the local and
+global value is changed. With "setlocal" only the local value is changed,
+thus this value is not used when editing a new buffer.
+
+When editing a buffer that has been edited before, the last used window
+options are used again. If this buffer has been edited in this window, the
+values from back then are used. Otherwise the values from the window where
+the buffer was edited last are used.
+
+It's possible to set a local window option specifically for a type of buffer.
+When you edit another buffer in the same window, you don't want to keep
+using these local window options. Therefore Vim keeps a global value of the
+local window options, which is used when editing another buffer. Each window
+has its own copy of these values. Thus these are local to the window, but
+global to all buffers in the window. With this you can do: >
+ :e one
+ :set list
+ :e two
+Now the 'list' option will also be set in "two", since with the ":set list"
+command you have also set the global value. >
+ :set nolist
+ :e one
+ :setlocal list
+ :e two
+Now the 'list' option is not set, because ":set nolist" resets the global
+value, ":setlocal list" only changes the local value and ":e two" gets the
+global value. Note that if you do this next: >
+ :e one
+You will not get back the 'list' value as it was the last time you edited
+"one". The options local to a window are not remembered for each buffer.
+
+ *:setl* *:setlocal*
+:setl[ocal] ... Like ":set" but set only the value local to the
+ current buffer or window. Not all options have a
+ local value. If the option does not have a local
+ value the global value is set.
+ With the "all" argument: display all local option's
+ local values.
+ Without argument: Display all local option's local
+ values which are different from the default.
+ When displaying a specific local option, show the
+ local value. For a global option the global value is
+ shown (but that might change in the future).
+ {not in Vi}
+
+:setl[ocal] {option}< Set the local value of {option} to its global value.
+ {not in Vi}
+
+ *:setg* *:setglobal*
+:setg[lobal] ... Like ":set" but set only the global value for a local
+ option without changing the local value.
+ When displaying an option, the global value is shown.
+ With the "all" argument: display all local option's
+ global values.
+ Without argument: display all local option's global
+ values which are different from the default.
+ {not in Vi}
+
+For buffer-local and window-local options:
+ Command global value local value ~
+ :set option=value set set
+ :setlocal option=value - set
+:setglobal option=value set -
+ :set option? - display
+ :setlocal option? - display
+:setglobal option? display -
+
+
+Global options with a local value *global-local*
+
+Options are global when you mostly use one value for all buffers. For some
+global options it's useful to sometimes have a different local value. You can
+set the local value with ":setlocal". That buffer will then use the local
+value, while other buffers continue using the global value.
+
+For example, you have two windows, both on C source code. They use the global
+'makeprg' option. If you do this in one of the two windows: >
+ :set makeprg=gmake
+then the other window will switch to the same value. There is no need to set
+the 'makeprg' option in the other C source window too.
+However, if you start editing a Perl file in a new window, you want to use
+another 'makeprog' for it, without changing the value used for the C source
+files. You use this command: >
+ :setlocal makeprg=perlmake
+You can switch back to using the global value by making the local value empty: >
+ :setlocal makeprg=
+This only works for a string option. For a boolean option you need to use the
+"<" flag, like this: >
+ :setlocal autoread<
+Note that for non-boolean options using "<" copies the global value to the
+local value, it doesn't switch back to using the global value (that matters
+when changing the global value later).
+Note: In the future more global options can be made global-local. Using
+":setlocal" on a global option might work differently then.
+
+
+Setting the filetype
+
+:setf[iletype] {filetype} *:setf* *:setfiletype*
+ Set the 'filetype' option to {filetype}, but only if
+ not done yet in a sequence of (nested) autocommands.
+ This is short for: >
+ :if !did_filetype()
+ : setlocal filetype={filetype}
+ :endif
+< This command is used in a filetype.vim file to avoid
+ setting the 'filetype' option twice, causing different
+ settings and syntax files to be loaded.
+ {not in Vi}
+
+:bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options*
+:opt[ions] Open a window for viewing and setting all options.
+ Options are grouped by function.
+ Offers short help for each option. Hit <CR> on the
+ short help to open a help window with more help for
+ the option.
+ Modify the value of the option and hit <CR> on the
+ "set" line to set the new value. For window and
+ buffer specific options, the last accessed window is
+ used to set the option value in, unless this is a help
+ window, in which case the window below help window is
+ used (skipping the option-window).
+ {not available when compiled without the |+eval| or
+ |+autocmd| features}
+
+ *$HOME*
+Using "~" is like using "$HOME", but it is only recognized at the start of an
+option and after a space or comma.
+
+On Unix systems "~user" can be used too. It is replaced by the home directory
+of user "user". Example: >
+ :set path=~mool/include,/usr/include,.
+
+On Unix systems the form "${HOME}" can be used too. The name between {} can
+contain non-id characters then. Note that if you want to use this for the
+"gf" command, you need to add the '{' and '}' characters to 'isfname'.
+
+NOTE: expanding environment variables and "~/" is only done with the ":set"
+command, not when assigning a value to an option with ":let".
+
+
+Note the maximum length of an expanded option is limited. How much depends on
+the system, mostly it is something like 256 or 1024 characters.
+
+ *:fix* *:fixdel*
+:fix[del] Set the value of 't_kD':
+ 't_kb' is 't_kD' becomes ~
+ CTRL-? CTRL-H
+ not CTRL-? CTRL-?
+
+ (CTRL-? is 0177 octal, 0x7f hex) {not in Vi}
+
+ If your delete key terminal code is wrong, but the
+ code for backspace is alright, you can put this in
+ your .vimrc: >
+ :fixdel
+< This works no matter what the actual code for
+ backspace is.
+
+ If the backspace key terminal code is wrong you can
+ use this: >
+ :if &term == "termname"
+ : set t_kb=^V<BS>
+ : fixdel
+ :endif
+< Where "^V" is CTRL-V and "<BS>" is the backspace key
+ (don't type four characters!). Replace "termname"
+ with your terminal name.
+
+ If your <Delete> key sends a strange key sequence (not
+ CTRL-? or CTRL-H) you cannot use ":fixdel". Then use: >
+ :if &term == "termname"
+ : set t_kD=^V<Delete>
+ :endif
+< Where "^V" is CTRL-V and "<Delete>" is the delete key
+ (don't type eight characters!). Replace "termname"
+ with your terminal name.
+
+ *Linux-backspace*
+ Note about Linux: By default the backspace key
+ produces CTRL-?, which is wrong. You can fix it by
+ putting this line in your rc.local: >
+ echo "keycode 14 = BackSpace" | loadkeys
+<
+ *NetBSD-backspace*
+ Note about NetBSD: If your backspace doesn't produce
+ the right code, try this: >
+ xmodmap -e "keycode 22 = BackSpace"
+< If this works, add this in your .Xmodmap file: >
+ keysym 22 = BackSpace
+< You need to restart for this to take effect.
+
+==============================================================================
+2. Automatically setting options *auto-setting*
+
+Besides changing options with the ":set" command, there are three alternatives
+to set options automatically for one or more files:
+
+1. When starting Vim initializations are read from various places. See
+ |initialization|. Most of them are performed for all editing sessions,
+ and some of them depend on the directory where Vim is started.
+ You can create an initialization file with |:mkvimrc|, |:mkview| and
+ |:mksession|.
+2. If you start editing a new file, the automatic commands are executed.
+ This can be used to set options for files matching a particular pattern and
+ many other things. See |autocommand|.
+3. If you start editing a new file, and the 'modeline' option is on, a
+ number of lines at the beginning and end of the file are checked for
+ modelines. This is explained here.
+
+ *modeline* *vim:* *vi:* *ex:* *E520*
+There are two forms of modelines. The first form:
+ [text]{white}{vi:|vim:|ex:}[white]{options}
+
+[text] any text or empty
+{white} at least one blank character (<Space> or <Tab>)
+{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
+[white] optional white space
+{options} a list of option settings, separated with white space or ':',
+ where each part between ':' is the argument for a ":set"
+ command
+
+Example: >
+ vi:noai:sw=3 ts=6
+
+The second form (this is compatible with some versions of Vi):
+
+ [text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text]
+
+[text] any text or empty
+{white} at least one blank character (<Space> or <Tab>)
+{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
+[white] optional white space
+se[t] the string "set " or "se " (note the space)
+{options} a list of options, separated with white space, which is the
+ argument for a ":set" command
+: a colon
+[text] any text or empty
+
+Example: >
+ /* vim: set ai tw=75: */
+
+The white space before {vi:|vim:|ex:} is required. This minimizes the chance
+that a normal word like "lex:" is caught. There is one exception: "vi:" and
+"vim:" can also be at the start of the line (for compatibility with version
+3.0). Using "ex:" at the start of the line will be ignored (this could be
+short for "example:").
+
+ *modeline-local*
+The options are set like with ":setlocal": The new value only applies to the
+buffer that contains the window. Although it's possible to set global options
+from a modeline, this is unusual. If you have two windows open and the files
+in it set the same global option to a different value, the result depends on
+which one was opened last.
+
+ *modeline-version*
+If the modeline is only to be used for some versions of Vim, the version
+number can be specified where "vim:" is used:
+ vim{vers}: version {vers} or later
+ vim<{vers}: version before {vers}
+ vim={vers}: version {vers}
+ vim>{vers}: version after {vers}
+{vers} is 600 for Vim 6.0 (hundred times the major version plus minor).
+For example, to use a modeline only for Vim 6.0 and later: >
+ /* vim600: set foldmethod=marker: */
+To use a modeline for Vim before version 5.7: >
+ /* vim<570: set sw=4: */
+There can be no blanks between "vim" and the ":".
+
+
+The number of lines that are checked can be set with the 'modelines' option.
+If 'modeline' is off or 'modelines' is 0 no lines are checked.
+
+Note that for the first form all of the rest of the line is used, thus a line
+like: >
+ /* vi:ts=4: */
+will give an error message for the trailing "*/". This line is OK: >
+ /* vi:set ts=4: */
+
+If an error is detected the rest of the line is skipped.
+
+If you want to include a ':' in a set command precede it with a '\'. The
+backslash in front of the ':' will be removed. Example: >
+ /* vi:set dir=c\:\tmp: */
+This sets the 'dir' option to "c:\tmp". Only a single backslash before the
+':' is removed. Thus to include "\:" you have to specify "\\:".
+
+No other commands than "set" are supported, for security reasons (somebody
+might create a Trojan horse text file with modelines).
+
+Hint: If you would like to do something else than setting an option, you could
+define an autocommand that checks the file for a specific string. For
+example: >
+ au BufReadPost * if getline(1) =~ "VAR" | call SetVar() | endif
+And define a function SetVar() that does something with the line containing
+"VAR".
+
+==============================================================================
+3. Options summary *option-summary*
+
+In the list below all the options are mentioned with their full name and with
+an abbreviation if there is one. Both forms may be used.
+
+In this document when a boolean option is "set" that means that ":set option"
+is entered. When an option is "reset", ":set nooption" is used.
+
+For some options there are two default values: The "Vim default", which is
+used when 'compatible' is not set, and the "Vi default", which is used when
+'compatible' is set.
+
+Most options are the same in all windows and buffers. There are a few that
+are specific to how the text is presented in a window. These can be set to a
+different value in each window. For example the 'list' option can be set in
+one window and reset in another for the same text, giving both types of view
+at the same time. There are a few options that are specific to a certain
+file. These can have a different value for each file or buffer. For example
+the 'textwidth' option can be 78 for a normal text file and 0 for a C
+program.
+
+ global one option for all buffers and windows
+ local to window each window has its own copy of this option
+ local to buffer each buffer has its own copy of this option
+
+When creating a new window the option values from the currently active window
+are used as a default value for the window-specific options. For the
+buffer-specific options this depends on the 's' and 'S' flags in the
+'cpoptions' option. If 's' is included (which is the default) the values for
+buffer options are copied from the currently active buffer when a buffer is
+first entered. If 'S' is present the options are copied each time the buffer
+is entered, this is almost like having global options. If 's' and 'S' are not
+present, the options are copied from the currently active buffer when the
+buffer is created.
+
+Not all options are supported in all versions. To test if option "foo" can be
+used with ":set" use "exists('&foo')". This doesn't mean the value is
+actually remembered and works. Some options are hidden, which means that you
+can set them but the value is not remembered. To test if option "foo" is
+really supported use "exists('+foo')".
+
+ *E355*
+A jump table for the options with a short description can be found at |Q_op|.
+
+ *'aleph'* *'al'* *aleph* *Aleph*
+'aleph' 'al' number (default 128 for MS-DOS, 224 otherwise)
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ The ASCII code for the first letter of the Hebrew alphabet. The
+ routine that maps the keyboard in Hebrew mode, both in Insert mode
+ (when hkmap is set) and on the command-line (when hitting CTRL-_)
+ outputs the Hebrew characters in the range [aleph..aleph+26].
+ aleph=128 applies to PC code, and aleph=224 applies to ISO 8859-8.
+ See |rileft.txt|.
+
+ *'allowrevins'* *'ari'* *'noallowrevins'* *'noari'*
+'allowrevins' 'ari' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ Allow CTRL-_ in Insert and Command-line mode. This is default off, to
+ avoid that users that accidentally type CTRL-_ instead of SHIFT-_ get
+ into reverse Insert mode, and don't know how to get out. See
+ 'revins'.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'*
+'altkeymap' 'akm' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+farsi|
+ feature}
+ When on, the second language is Farsi. In editing mode CTRL-_ toggles
+ the keyboard map between Farsi and English, when 'allowrevins' set.
+
+ When off, the keyboard map toggles between Hebrew and English. This
+ is useful to start the Vim in native mode i.e. English (left-to-right
+ mode) and have default second language Farsi or Hebrew (right-to-left
+ mode). See |farsi.txt|.
+
+ *'ambiwidth'* *'ambw'*
+'ambiwidth' 'ambw' string (default: "single")
+ global
+ {not in Vi}
+ {only available when compiled with the |+multi_byte|
+ feature}
+ Only effective when 'encoding' is "utf-8" or another Unicode encoding.
+ Tells Vim what to do with characters with East Asian Width Class
+ Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
+ letters, Cyrillic letters).
+
+ There are currently two possible values:
+ "single": Use the same width as characters in US-ASCII. This is
+ expected by most users.
+ "double": Use twice the width of ASCII characters.
+
+ There are a number of CJK fonts for which the width of glyphs for
+ those characters are solely based on how many octets they take in
+ legacy/traditional CJK encodings. In those encodings, Euro,
+ Registered sign, Greek/Cyrillic letters are represented by two octets,
+ therefore those fonts have "wide" glyphs for them. This is also
+ true of some line drawing characters used to make tables in text
+ file. Therefore, when a CJK font is used for GUI Vim or
+ Vim is running inside a terminal (emulators) that uses a CJK font
+ (or Vim is run inside an xterm invoked with "-cjkwidth" option.),
+ this option should be set to "double" to match the width perceived
+ by Vim with the width of glyphs in the font. Perhaps it also has
+ to be set to "double" under CJK Windows 9x/ME or Windows 2k/XP
+ when the system locale is set to one of CJK locales. See Unicode
+ Standard Annex #11 (http://www.unicode.org/reports/tr11).
+
+ *'antialias'* *'anti'* *'noantialias'* *'noanti'*
+'antialias' 'anti' boolean (default: off)
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled
+ on Mac OS X}
+ This option only has an effect in the GUI version of Vim on Mac OS X
+ v10.2 or later. When on, Vim will use smooth ("antialiased") fonts,
+ which can be easier to read at certain sizes on certain displays.
+ Setting this option can sometimes cause problems if 'guifont' is set
+ to its default (empty string).
+
+ *'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
+'autochdir' 'acd' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the
+ |+netbeans_intg| or |+sun_workshop| feature}
+ When on, Vim will change its value for the current working directory
+ whenever you open a file, switch buffers, delete a buffer or
+ open/close a window. It will change to the directory containing the
+ file which was opened or selected. This option is provided for
+ backward compatibility with the Vim released with Sun ONE Studio 4
+ Enterprise Edition.
+
+ *'arabic'* *'arab'* *'noarabic'* *'noarab'*
+'arabic' 'arab' boolean (default off)
+ local to window
+ {not in Vi}
+ {only available when compiled with the |+arabic|
+ feature}
+ This option can be set to start editing Arabic text.
+ Setting this option will:
+ - Set the 'rightleft' option, unless 'termbidi' is set.
+ - Set the 'arabicshape' option, unless 'termbidi' is set.
+ - Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
+ between typing English and Arabic key mapping.
+ - Set the 'delcombine' option
+ Note that 'encoding' must be "utf-8" for working with Arabic text.
+
+ Resetting this option will:
+ - Reset the 'rightleft' option.
+ - Disable the use of 'keymap' (without changing its value).
+ Note that 'arabicshape' and 'delcombine' are not reset (it is a global
+ option.
+ Also see |arabic.txt|.
+
+ *'arabicshape'* *'arshape'*
+ *'noarabicshape'* *'noarshape'*
+'arabicshape' 'arshape' boolean (default on)
+ global
+ {not in Vi}
+ {only available when compiled with the |+arabic|
+ feature}
+ When on and 'termbidi' is off, the required visual character
+ corrections that need to take place for displaying the Arabic language
+ take affect. Shaping, in essence, gets enabled; the term is a broad
+ one which encompasses:
+ a) the changing/morphing of characters based on their location
+ within a word (initial, medial, final and stand-alone).
+ b) the enabling of the ability to compose characters
+ c) the enabling of the required combining of some characters
+ When disabled the character display reverts back to each character's
+ true stand-alone form.
+ Arabic is a complex language which requires other settings, for
+ further details see |arabic.txt|.
+
+ *'autoindent'* *'ai'* *'noautoindent'* *'noai'*
+'autoindent' 'ai' boolean (default off)
+ local to buffer
+ Copy indent from current line when starting a new line (typing <CR>
+ in Insert mode or when using the "o" or "O" command). If you do not
+ type anything on the new line except <BS> or CTRL-D and then type
+ <Esc> or <CR>, the indent is deleted again. When autoindent is on,
+ formatting (with the "gq" command or when you reach 'textwidth' in
+ Insert mode) uses the indentation of the first line.
+ When 'smartindent' or 'cindent' is on the indent is changed in
+ a different way.
+ The 'autoindent' option is reset when the 'paste' option is set.
+ {small difference from Vi: After the indent is deleted when typing
+ <Esc> or <CR>, the cursor position when moving up or down is after the
+ deleted indent; Vi puts the cursor somewhere in the deleted indent}.
+
+ *'autoread'* *'ar'* *'noautoread'* *'noar'*
+'autoread' 'ar' boolean (default off)
+ global or local to buffer |global-local|
+ {not in Vi}
+ When a file has been detected to have been changed outside of Vim and
+ it has not been changed inside of Vim, automatically read it again.
+ When the file has been deleted this is not done. |timestamp|
+ If this option has a local value, use this command to switch back to
+ using the global value: >
+ :set autoread<
+<
+ *'autowrite'* *'aw'* *'noautowrite'* *'noaw'*
+'autowrite' 'aw' boolean (default off)
+ global
+ Write the contents of the file, if it has been modified, on each
+ :next, :rewind, :last, :first, :previous, :stop, :suspend, :tag, :!,
+ :make, CTRL-] and CTRL-^ command; and when a CTRL-O, CTRL-I,
+ '{A-Z0-9}, or `{A-Z0-9} command takes one to another file.
+ Note that for some commands the 'autowrite' option is not used, see
+ 'autowriteall' for that.
+
+ *'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'*
+'autowriteall' 'awa' boolean (default off)
+ global
+ {not in Vi}
+ Like 'autowrite', but also used for commands ":edit", ":enew", ":quit",
+ ":qall", ":exit", ":xit", ":recover" and closing the Vim window.
+ Setting this option also implies that Vim behaves like 'autowrite' has
+ been set.
+
+ *'background'* *'bg'*
+'background' 'bg' string (default "dark" or "light")
+ global
+ {not in Vi}
+ When set to "dark", Vim will try to use colors that look good on a
+ dark background. When set to "light", Vim will try to use colors that
+ look good on a light background. Any other value is illegal.
+ Vim tries to set the default value according to the terminal used.
+ This will not always be correct.
+ Setting this option does not change the background color, it tells Vim
+ what the background color looks like. For changing the background
+ color, see |:hi-normal|.
+
+ When 'background' is set Vim will adjust the default color groups for
+ the new value. But the colors used for syntax highlighting will not
+ change.
+ When a color scheme is loaded (the "colors_name" variable is set)
+ setting 'background' will cause the color scheme to be reloaded. If
+ the color scheme adjusts to the value of 'background' this will work.
+ However, if the color scheme sets 'background' itself the effect may
+ be undone. First delete the "colors_name" variable when needed.
+
+ When setting 'background' to the default value with: >
+ :set background&
+< Vim will guess the value. In the GUI this should work correctly,
+ in other cases Vim might not be able to guess the right value.
+
+ When starting the GUI, the default value for 'background' will be
+ "light". When the value is not set in the .gvimrc, and Vim detects
+ that the background is actually quite dark, 'background' is set to
+ "dark". But this happens only AFTER the .gvimrc file has been read
+ (because the window needs to be opened to find the actual background
+ color). To get around this, force the GUI window to be opened by
+ putting a ":gui" command in the .gvimrc file, before where the value
+ of 'background' is used (e.g., before ":syntax on").
+ Normally this option would be set in the .vimrc file. Possibly
+ depending on the terminal name. Example: >
+ :if &term == "pcterm"
+ : set background=dark
+ :endif
+< When this option is set, the default settings for the highlight groups
+ will change. To use other settings, place ":highlight" commands AFTER
+ the setting of the 'background' option.
+ This option is also used in the "$VIMRUNTIME/syntax/syntax.vim" file
+ to select the colors for syntax highlighting. After changing this
+ option, you must load syntax.vim again to see the result. This can be
+ done with ":syntax on".
+
+ *'backspace'* *'bs'*
+'backspace' 'bs' string (default "")
+ global
+ {not in Vi}
+ Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
+ mode. This is a list of items, separated by commas. Each item allows
+ a way to backspace over something:
+ value effect ~
+ indent allow backspacing over autoindent
+ eol allow backspacing over line breaks (join lines)
+ start allow backspacing over the start of insert; CTRL-W and CTRL-U
+ stop once at the start of insert.
+
+ When the value is empty, Vi compatible backspacing is used.
+
+ For backwards compatibility with version 5.4 and earlier:
+ value effect ~
+ 0 same as ":set backspace=" (Vi compatible)
+ 1 same as ":set backspace=indent,eol"
+ 2 same as ":set backspace=indent,eol,start"
+
+ See |:fixdel| if your <BS> or <Del> key does not do what you want.
+ NOTE: This option is set to "" when 'compatible' is set.
+
+ *'backup'* *'bk'* *'nobackup'* *'nobk'*
+'backup' 'bk' boolean (default off)
+ global
+ {not in Vi}
+ Make a backup before overwriting a file. Leave it around after the
+ file has been successfully written. If you do not want to keep the
+ backup file, but you do want a backup while the file is being
+ written, reset this option and set the 'writebackup' option (this is
+ the default). If you do not want a backup file at all reset both
+ options (use this if your file system is almost full). See the
+ |backup-table| for more explanations.
+ When the 'backupskip' pattern matches, a backup is not made anyway.
+ When 'patchmode' is set, the backup may be renamed to become the
+ oldest version of a file.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'backupcopy'* *'bkc'*
+'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto")
+ global
+ {not in Vi}
+ When writing a file and a backup is made, this option tells how it's
+ done. This is a comma separated list of words.
+
+ The main values are:
+ "yes" make a copy of the file and overwrite the original one
+ "no" rename the file and write a new one
+ "auto" one of the previous, what works best
+
+ Extra values that can be combined with the ones above are:
+ "breaksymlink" always break symlinks when writing
+ "breakhardlink" always break hardlinks when writing
+
+ Making a copy and overwriting the original file:
+ - Takes extra time to copy the file.
+ + When the file has special attributes, is a (hard/symbolic) link or
+ has a resource fork, all this is preserved.
+ - When the file is a link the backup will have the name of the link,
+ not of the real file.
+
+ Renaming the file and writing a new one:
+ + It's fast.
+ - Sometimes not all attributes of the file can be copied to the new
+ file.
+ - When the file is a link the new file will not be a link.
+
+ The "auto" value is the middle way: When Vim sees that renaming file
+ is possible without side effects (the attributes can be passed on and
+ and the file is not a link) that is used. When problems are expected,
+ a copy will be made.
+
+ The "breaksymlink" and "breakhardlink" values can be used in
+ combination with any of "yes", "no" and "auto". When included, they
+ force Vim to always break either symbolic or hard links by doing
+ exactly what the "no" option does, renaming the original file to
+ become the backup and writing a new file in its place. This can be
+ useful for example in source trees where all the files are symbolic or
+ hard links and any changes should stay in the local source tree, not
+ be propagated back to the original source.
+ *crontab*
+ One situation where "no" and "auto" will cause problems: A program
+ that opens a file, invokes Vim to edit that file, and then tests if
+ the open file was changed (through the file descriptor) will check the
+ backup file instead of the newly created file. "crontab -e" is an
+ example.
+
+ When a copy is made, the original file is truncated and then filled
+ with the new text. This means that protection bits, owner and
+ symbolic links of the original file are unmodified. The backup file
+ however, is a new file, owned by the user who edited the file. The
+ group of the backup is set to the group of the original file. If this
+ fails, the protection bits for the group are made the same as for
+ others.
+
+ When the file is renamed this is the other way around: The backup has
+ the same attributes of the original file, and the newly written file
+ is owned by the current user. When the file was a (hard/symbolic)
+ link, the new file will not! That's why the "auto" value doesn't
+ rename when the file is a link. The owner and group of the newly
+ written file will be set to the same ones as the original file, but
+ the system may refuse to do this. In that case the "auto" value will
+ again not rename the file.
+
+ *'backupdir'* *'bdir'*
+'backupdir' 'bdir' string (default for Amiga: ".,t:",
+ for MS-DOS and Win32: ".,c:/tmp,c:/temp"
+ for Unix: ".,~/tmp,~/")
+ global
+ {not in Vi}
+ List of directories for the backup file, separated with commas.
+ - The backup file will be created in the first directory in the list
+ where this is possible.
+ - Empty means that no backup file will be created ('patchmode' is
+ impossible!). Writing may fail because of this.
+ - A directory "." means to put the backup file in the same directory
+ as the edited file.
+ - A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
+ put the backup file relative to where the edited file is. The
+ leading "." is replaced with the path name of the edited file.
+ ("." inside a directory name has no special meaning).
+ - Spaces after the comma are ignored, other spaces are considered part
+ of the directory name. To have a space at the start of a directory
+ name, precede it with a backslash.
+ - To include a comma in a directory name precede it with a backslash.
+ - A directory name may end in an '/'.
+ - Environment variables are expanded |:set_env|.
+ - Careful with '\' characters, type one before a space, type two to
+ get one in the option (see |option-backslash|), for example: >
+ :set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
+< - For backwards compatibility with Vim version 3.0 a '>' at the start
+ of the option is removed.
+ See also 'backup' and 'writebackup' options.
+ If you want to hide your backup files on Unix, consider this value: >
+ :set backupdir=./.backup,~/.backup,.,/tmp
+< You must create a ".backup" directory in each directory and in your
+ home directory for this to work properly.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ directories from the list. This avoids problems when a future version
+ uses another default.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'backupext'* *'bex'* *E589*
+'backupext' 'bex' string (default "~", for VMS: "_")
+ global
+ {not in Vi}
+ String which is appended to a file name to make the name of the
+ backup file. The default is quite unusual, because this avoids
+ accidentally overwriting existing files with a backup file. You might
+ prefer using ".bak", but make sure that you don't have files with
+ ".bak" that you want to keep.
+
+ *'backupskip'* *'bsk'*
+'backupskip' 'bsk' string (default: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
+ global
+ {not in Vi}
+ {not available when compiled without the |+wildignore|
+ feature}
+ A list of file patterns. When one of the patterns matches with the
+ name of the file which is written, no backup file is created. Both
+ the specified file name and the full path name of the file are used.
+ The pattern is used like with |:autocmd|, see |autocmd-patterns|.
+ Watch out for special characters, see |option-backslash|.
+ When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the
+ default value. "/tmp/*" is only used for Unix.
+
+ *'balloondelay'* *'bdlay'*
+'balloondelay' 'bdlay' number (default: 600)
+ global
+ {not in Vi}
+ {only available when compiled with the |+balloon_eval|
+ feature}
+ Delay in milliseconds before a balloon may pop up. See |balloon-eval|.
+
+ *'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
+'ballooneval' 'beval' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+balloon_eval|
+ and |+sun_workshop| or |+netbeans_intg| features}
+ Switch on the |balloon-eval| functionality.
+
+ *'binary'* *'bin'* *'nobinary'* *'nobin'*
+'binary' 'bin' boolean (default off)
+ local to buffer
+ {not in Vi}
+ This option should be set before editing a binary file. You can also
+ use the |-b| Vim argument. When this option is switched on a few
+ options will be changed (also when it already was on):
+ 'textwidth' will be set to 0
+ 'wrapmargin' will be set to 0
+ 'modeline' will be off
+ 'expandtab' will be off
+ Also, 'fileformat' and 'fileformats' options will not be used, the
+ file is read and written like 'fileformat' was "unix" (a single <NL>
+ separates lines).
+ The 'fileencoding' and 'fileencodings' options will not be used, the
+ file is read without conversion.
+ NOTE: When you start editing a(nother) file while the 'bin' option is
+ on, settings from autocommands may change the settings again (e.g.,
+ 'textwidth'), causing trouble when editing. You might want to set
+ 'bin' again when the file has been loaded.
+ The previous values of these options are remembered and restored when
+ 'bin' is switched from on to off. Each buffer has its own set of
+ saved option values.
+ To edit a file with 'binary' set you can use the |++bin| argument.
+ This avoids you have to do ":set bin", which would have effect for all
+ files you edit.
+ When writing a file the <EOL> for the last line is only written if
+ there was one in the original file (normally Vim appends an <EOL> to
+ the last line if there is none; this would make the file longer). See
+ the 'endofline' option.
+
+ *'bioskey'* *'biosk'* *'nobioskey'* *'nobiosk'*
+'bioskey' 'biosk' boolean (default on)
+ global
+ {not in Vi} {only for MS-DOS}
+ When on the bios is called to obtain a keyboard character. This works
+ better to detect CTRL-C, but only works for the console. When using a
+ terminal over a serial port reset this option.
+ Also see |'conskey'|.
+
+ *'bomb'* *'nobomb'*
+'bomb' boolean (default off)
+ local to buffer
+ {not in Vi}
+ {only available when compiled with the |+multi_byte|
+ feature}
+ When writing a file and the following conditions are met, a BOM (Byte
+ Order Mark) is prepended to the file:
+ - this option is on
+ - the 'binary' option is off
+ - 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big
+ endian variants.
+ Some applications use the BOM to recognize the encoding of the file.
+ Often used for UCS-2 files on MS-Windows. For other applications it
+ causes trouble, for example: "cat file1 file2" makes the BOM of file2
+ appear halfway the resulting file.
+ When Vim reads a file and 'fileencodings' starts with "ucs-bom", a
+ check for the presence of the BOM is done and 'bomb' set accordingly.
+ Unless 'binary' is set, it is removed from the first line, so that you
+ don't see it when editing. When you don't change the options, the BOM
+ will be restored when writing the file.
+
+ *'breakat'* *'brk'*
+'breakat' 'brk' string (default " ^I!@*-+;:,./?")
+ global
+ {not in Vi}
+ {not available when compiled without the |+linebreak|
+ feature}
+ This option lets you choose which characters might cause a line
+ break if 'linebreak' is on.
+
+ *'browsedir'* *'bsdir'*
+'browsedir' 'bsdir' string (default for "last")
+ global
+ {not in Vi} {only for Motif and Win32 GUI}
+ Which directory to use for the file browser:
+ last Use same directory as with last file browser.
+ buffer Use the directory of the related buffer.
+ current Use the current directory.
+ {path} Use the specified directory
+
+ *'bufhidden'* *'bh'*
+'bufhidden' 'bh' string (default: "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ This option specifies what happens when a buffer is no longer
+ displayed in a window:
+ <empty> follow the global 'hidden' option
+ hide hide the buffer (don't unload it), also when 'hidden'
+ is not set
+ unload unload the buffer, also when 'hidden' is set or using
+ |:hide|
+ delete delete the buffer from the buffer list, also when
+ 'hidden' is set or using |:hide|, like using
+ |:bdelete|
+ wipe wipe out the buffer from the buffer list, also when
+ 'hidden' is set or using |:hide|, like using
+ |:bwipeout|
+
+ This option is used together with 'buftype' and 'swapfile' to specify
+ special kinds of buffers. See |special-buffers|.
+
+ *'buflisted'* *'bl'* *'nobuflisted'* *'nobl'* *E85*
+'buflisted' 'bl' boolean (default: on)
+ local to buffer
+ {not in Vi}
+ When this option is set, the buffer shows up in the buffer list. If
+ it is reset it is not used for ":bnext", "ls", the Buffers menu, etc.
+ This option is reset by Vim for buffers that are only used to remember
+ a file name or marks. Vim sets it when starting to edit a buffer.
+ But not when moving to a buffer with ":buffer".
+
+ *'buftype'* *'bt'* *E382*
+'buftype' 'bt' string (default: "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ The value of this option specifies the type of a buffer:
+ <empty> normal buffer
+ nofile buffer which is not related to a file and will not be
+ written
+ nowrite buffer which will not be written
+ quickfix quickfix buffer, contains list of errors |:cwindow|
+ help help buffer (you are not supposed to set this
+ manually)
+
+ This option is used together with 'bufhidden' and 'swapfile' to
+ specify special kinds of buffers. See |special-buffers|.
+
+ Be careful with changing this option, it can have many side effects!
+
+ A "quickfix" buffer is only used for the error list. This value is
+ set by the |:cwindow| command and you are not supposed to change it.
+
+ "nofile" and "nowrite" buffers are similar:
+ both: The buffer is not to be written to disk, ":w" doesn't
+ work (":w filename" does work though).
+ both: The buffer is never considered to be |'modified'|.
+ There is no warning when the changes will be lost, for
+ example when you quit Vim.
+ both: A swap file is only created when using too much memory
+ (when 'swapfile' has been reset there is never a swap
+ file).
+ nofile only: The buffer name is fixed, it is not handled like a
+ file name. It is not modified in response to a |:cd|
+ command.
+
+ *'casemap'* *'cmp'*
+'casemap' 'cmp' string (default: "internal,keepascii")
+ global
+ {not in Vi}
+ Specifies details about changing the case of letters. It may contain
+ these words, separated by a comma:
+ internal Use internal case mapping functions, the current
+ locale does not change the case mapping. This only
+ matters when 'encoding' is a Unicode encoding. When
+ "internal" is omitted, the towupper() and towlower()
+ system library functions are used when available.
+ keepascii For the ASCII characters (0x00 to 0x7f) use the US
+ case mapping, the current locale is not effective.
+ This probably only matters for Turkish.
+
+ *'cdpath'* *'cd'* *E344* *E346*
+'cdpath' 'cd' string (default: equivalent to $CDPATH or ",,")
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+file_in_path| feature}
+ This is a list of directories which will be searched when using the
+ |:cd| and |:lcd| commands, provided that the directory being searched
+ for has a relative path (not starting with "/", "./" or "../").
+ The 'cdpath' option's value has the same form and semantics as
+ |'path'|. Also see |file-searching|.
+ The default value is taken from $CDPATH, with a "," prepended to look
+ in the current directory first.
+ If the default value taken from $CDPATH is not what you want, include
+ a modified version of the following command in your vimrc file to
+ override it: >
+ :let &cdpath = ',' . substitute(substitute($CDPATH, '[, ]', '\\\0', 'g'), ':', ',', 'g')
+< This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+ (parts of 'cdpath' can be passed to the shell to expand file names).
+
+ *'cedit'*
+'cedit' string (Vi default: "", Vim default: CTRL-F)
+ global
+ {not in Vi}
+ {not available when compiled without the |+vertsplit|
+ feature}
+ The key used in Command-line Mode to open the command-line window.
+ The default is CTRL-F when 'compatible' is off.
+ Only non-printable keys are allowed.
+ The key can be specified as a single character, but it is difficult to
+ type. The preferred way is to use the <> notation. Examples: >
+ :set cedit=<C-Y>
+ :set cedit=<Esc>
+< |Nvi| also has this option, but it only uses the first character.
+ See |cmdwin|.
+
+ *'charconvert'* *'ccv'* *E202* *E214* *E513*
+'charconvert' 'ccv' string (default "")
+ global
+ {only available when compiled with the |+multi_byte|
+ feature and the |+eval| feature}
+ {not in Vi}
+ An expression that is used for character encoding conversion. It is
+ evaluated when a file that is to be read or has been written has a
+ different encoding from what is desired.
+ 'charconvert' is not used when the internal iconv() function is
+ supported and is able to do the conversion. Using iconv() is
+ preferred, because it is much faster.
+ 'charconvert' is not used when reading stdin |--|, because there is no
+ file to convert from. You will have to save the text in a file first.
+ The expression must return zero or an empty string for success,
+ non-zero for failure.
+ The possible encoding names encountered are in 'encoding'.
+ Additionally, names given in 'fileencodings' and 'fileencoding' are
+ used.
+ Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8"
+ is done internally by Vim, 'charconvert' is not used for this.
+ 'charconvert' is also used to convert the viminfo file, if the 'c'
+ flag is present in 'viminfo'. Also used for Unicode conversion.
+ Example: >
+ set charconvert=CharConvert()
+ fun CharConvert()
+ system("recode "
+ \ . v:charconvert_from . ".." . v:charconvert_to
+ \ . " <" . v:fname_in . " >" v:fname_out)
+ return v:shell_error
+ endfun
+< The related Vim variables are:
+ v:charconvert_from name of the current encoding
+ v:charconvert_to name of the desired encoding
+ v:fname_in name of the input file
+ v:fname_out name of the output file
+ Note that v:fname_in and v:fname_out will never be the same.
+ Note that v:charconvert_from and v:charconvert_to may be different
+ from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
+ Encryption is not done by Vim when using 'charconvert'. If you want
+ to encrypt the file after conversion, 'charconvert' should take care
+ of this.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'cindent'* *'cin'* *'nocindent'* *'nocin'*
+'cindent' 'cin' boolean (default off)
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+cindent|
+ feature}
+ Enables automatic C program indenting See 'cinkeys' to set the keys
+ that trigger reindenting in insert mode and 'cinoptions' to set your
+ preferred indent style.
+ If 'indentexpr' is not empty, it overrules 'cindent'.
+ If 'lisp' is not on and both 'indentexpr' and 'equalprg' are empty,
+ the "=" operator indents using this algorithm rather than calling an
+ external program.
+ See |C-indenting|.
+ When you don't like the way 'cindent' works, try the 'smartindent'
+ option or 'indentexpr'.
+ This option is not used when 'paste' is set.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'cinkeys'* *'cink'*
+'cinkeys' 'cink' string (default "0{,0},0),:,0#,!^F,o,O,e")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+cindent|
+ feature}
+ A list of keys that, when typed in Insert mode, cause reindenting of
+ the current line. Only used if 'cindent' is on and 'indentexpr' is
+ empty.
+ For the format of this option see |cinkeys-format|.
+ See |C-indenting|.
+
+ *'cinoptions'* *'cino'*
+'cinoptions' 'cino' string (default "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+cindent|
+ feature}
+ The 'cinoptions' affect the way 'cindent' reindents lines in a C
+ program. See |cinoptions-values| for the values of this option, and
+ |C-indenting| for info on C indenting in general.
+
+
+ *'cinwords'* *'cinw'*
+'cinwords' 'cinw' string (default "if,else,while,do,for,switch")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without both the
+ |+cindent| and the |+smartindent| features}
+ These keywords start an extra indent in the next line when
+ 'smartindent' or 'cindent' is set. For 'cindent' this is only done at
+ an appropriate place (inside {}).
+ Note that 'ignorecase' isn't used for 'cinwords'. If case doesn't
+ matter, include the keyword both the uppercase and lowercase:
+ "if,If,IF".
+
+ *'clipboard'* *'cb'*
+'clipboard' 'cb' string (default "autoselect,exclude:cons\|linux"
+ for X-windows, "" otherwise)
+ global
+ {not in Vi}
+ {only in GUI versions or when the |+xterm_clipboard|
+ feature is included}
+ This option is a list of comma separated names.
+ These names are recognized:
+
+ unnamed When included, Vim will use the clipboard register '*'
+ for all yank, delete, change and put operations which
+ would normally go to the unnamed register. When a
+ register is explicitly specified, it will always be
+ used regardless of whether "unnamed" is in 'clipboard'
+ or not. The clipboard register can always be
+ explicitly accessed using the "* notation. Also see
+ |gui-clipboard|.
+
+ autoselect Works like the 'a' flag in 'guioptions': If present,
+ then whenever Visual mode is started, or the Visual
+ area extended, Vim tries to become the owner of the
+ windowing system's global selection or put the
+ selected text on the clipboard used by the selection
+ register "*. See |guioptions_a| and |quotestar| for
+ details. When the GUI is active, the 'a' flag in
+ 'guioptions' is used, when the GUI is not active, this
+ "autoselect" flag is used.
+ Also applies to the modeless selection.
+
+ autoselectml Like "autoselect", but for the modeless selection
+ only. Compare to the 'A' flag in 'guioptions'.
+
+ exclude:{pattern}
+ Defines a pattern that is matched against the name of
+ the terminal 'term'. If there is a match, no
+ connection will be made to the X server. This is
+ useful in this situation:
+ - Running Vim in a console.
+ - $DISPLAY is set to start applications on another
+ display.
+ - You do not want to connect to the X server in the
+ console, but do want this in a terminal emulator.
+ To never connect to the X server use: >
+ exclude:.*
+< This has the same effect as using the |-X| argument.
+ Note that when there is no connection to the X server
+ the window title won't be restored and the clipboard
+ cannot be accessed.
+ The value of 'magic' is ignored, {pattern} is
+ interpreted as if 'magic' was on.
+ The rest of the option value will be used for
+ {pattern}, this must be the last entry.
+
+ *'cmdheight'* *'ch'*
+'cmdheight' 'ch' number (default 1)
+ global
+ {not in Vi}
+ Number of screen lines to use for the command-line. Helps avoiding
+ |hit-enter| prompts.
+
+ *'cmdwinheight'* *'cwh'*
+'cmdwinheight' 'cwh' number (default 7)
+ global
+ {not in Vi}
+ {not available when compiled without the |+vertsplit|
+ feature}
+ Number of screen lines to use for the command-line window. |cmdwin|
+
+ *'columns'* *'co'* *E594*
+'columns' 'co' number (default 80 or terminal width)
+ global
+ {not in Vi}
+ Number of columns of the screen. Normally this is set by the terminal
+ initialization and does not have to be set by hand.
+ When Vim is running in the GUI or in a resizable window, setting this
+ option will cause the window size to be changed. When you only want
+ to use the size for the GUI, put the command in your |gvimrc| file.
+ When you set this option and Vim is unable to change the physical
+ number of columns of the display, the display may be messed up.
+
+ *'comments'* *'com'* *E524* *E525*
+'comments' 'com' string (default
+ "s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+comments|
+ feature}
+ A comma separated list of strings that can start a comment line. See
+ |format-comments|. See |option-backslash| about using backslashes to
+ insert a space.
+
+ *'commentstring'* *'cms'* *E537*
+'commentstring' 'cms' string (default "/*%s*/")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ A template for a comment. The "%s" in the value is replaced with the
+ comment text. Currently only used to add markers for folding, see
+ |fold-marker|.
+
+ *'compatible'* *'cp'* *'nocompatible'* *'nocp'*
+'compatible' 'cp' boolean (default on, off when a .vimrc file is found)
+ global
+ {not in Vi}
+ This option has the effect of making Vim either more Vi-compatible, or
+ make Vim behave in a more useful way.
+ This is a special kind of option, because when it's set or reset,
+ other options are also changed as a side effect. CAREFUL: Setting or
+ resetting this option can have a lot of unexpected effects: Mappings
+ are interpreted in another way, undo behaves differently, etc. If you
+ set this option in your vimrc file, you should probably put it at the
+ very start.
+ By default this option is on and the Vi defaults are used for the
+ options. This default was chosen for those people who want to use Vim
+ just like Vi, and don't even (want to) know about the 'compatible'
+ option.
+ When a ".vimrc" file is found while Vim is starting up, this option is
+ switched off, and all options that have not been modified will be set
+ to the Vim defaults. Effectively, this means that when a ".vimrc"
+ file exists, Vim will use the Vim defaults, otherwise it will use the
+ Vi defaults. (Note: This doesn't happen for the system-wide vimrc
+ file). Also see |compatible-default|.
+ You can also set this option with the "-C" argument, and reset it with
+ "-N". See |-C| and |-N|.
+ Switching this option off makes the Vim defaults be used for options
+ that have a different Vi and Vim default value. See the options
+ marked with a '+' below. Other options are not modified.
+ At the moment this option is set, several other options will be set
+ or reset to make Vim as Vi-compatible as possible. See the table
+ below. This can be used if you want to revert to Vi compatible
+ editing.
+ See also 'cpoptions'.
+
+ option + set value effect ~
+
+ 'allowrevins' off no CTRL-_ command
+ 'backupcopy' Unix: "yes" backup file is a copy
+ others: "auto" copy or rename backup file
+ 'backspace' "" normal backspace
+ 'backup' off no backup file
+ 'cindent' off no C code indentation
+ 'cedit' + "" no key to open the |cmdwin|
+ 'cpoptions' + (all flags) Vi-compatible flags
+ 'cscopetag' off don't use cscope for ":tag"
+ 'cscopetagorder' 0 see |cscopetagorder|
+ 'cscopeverbose' off see |cscopeverbose|
+ 'digraph' off no digraphs
+ 'esckeys' + off no <Esc>-keys in Insert mode
+ 'expandtab' off tabs not expanded to spaces
+ 'fileformats' + "" no automatic file format detection,
+ "dos,unix" except for DOS, Windows and OS/2
+ 'formatoptions' + "vt" Vi compatible formatting
+ 'gdefault' off no default 'g' flag for ":s"
+ 'history' + 0 no commandline history
+ 'hkmap' off no Hebrew keyboard mapping
+ 'hkmapp' off no phonetic Hebrew keyboard mapping
+ 'hlsearch' off no highlighting of search matches
+ 'incsearch' off no incremental searching
+ 'indentexpr' "" no indenting by expression
+ 'insertmode' off do not start in Insert mode
+ 'iskeyword' + "@,48-57,_" keywords contain alphanumeric
+ characters and '_'
+ 'joinspaces' on insert 2 spaces after period
+ 'modeline' + off no modelines
+ 'more' + off no pauses in listings
+ 'revins' off no reverse insert
+ 'ruler' off no ruler
+ 'scrolljump' 1 no jump scroll
+ 'scrolloff' 0 no scroll offset
+ 'shiftround' off indent not rounded to shiftwidth
+ 'shortmess' + "" no shortening of messages
+ 'showcmd' + off command characters not shown
+ 'showmode' + off current mode not shown
+ 'smartcase' off no automatic ignore case switch
+ 'smartindent' off no smart indentation
+ 'smarttab' off no smart tab size
+ 'softtabstop' 0 tabs are always 'tabstop' positions
+ 'startofline' on goto startofline with some commands
+ 'tagrelative' + off tag file names are not relative
+ 'textauto' + off no automatic textmode detection
+ 'textwidth' 0 no automatic line wrap
+ 'tildeop' off tilde is not an operator
+ 'ttimeout' off no terminal timeout
+ 'whichwrap' + "" left-right movements don't wrap
+ 'wildchar' + CTRL-E only when the current value is <Tab>
+ use CTRL-E for cmdline completion
+ 'writebackup' on or off depends on +writebackup feature
+
+ *'complete'* *'cpt'* *E535*
+'complete' 'cpt' string (default: ".,w,b,u,t,i")
+ local to buffer
+ {not in Vi}
+ This option specifies how keyword completion |ins-completion| works
+ when CTRL-P or CTRL-N are used. It is also used for whole-line
+ completion |i_CTRL-X_CTRL-L|. It indicates the type of completion
+ and the places to scan. It is a comma separated list of flags:
+ . scan the current buffer ('wrapscan' is ignored)
+ w scan buffers from other windows
+ b scan other loaded buffers that are in the buffer list
+ u scan the unloaded buffers that are in the buffer list
+ U scan the buffers that are not in the buffer list
+ k scan the files given with the 'dictionary' option
+ k{dict} scan the file {dict}. Several "k" flags can be given,
+ patterns are valid too. For example: >
+ :set cpt=k/usr/dict/*,k~/spanish
+< s scan the files given with the 'thesaurus' option
+ s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns
+ are valid too.
+ i scan current and included files
+ d scan current and included files for defined name or macro
+ |i_CTRL-X_CTRL-D|
+ ] tag completion
+ t same as "]"
+
+ Unloaded buffers are not loaded, thus their autocmds |:autocmd| are
+ not executed, this may lead to unexpected completions from some files
+ (gzipped files for example). Unloaded buffers are not scanned for
+ whole-line completion.
+
+ The default is ".,w,b,u,t,i", which means to scan:
+ 1. the current buffer
+ 2. buffers in other windows
+ 3. other loaded buffers
+ 4. unloaded buffers
+ 5. tags
+ 6. included files
+
+ As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'-
+ based expansion (eg dictionary |i_CTRL-X_CTRL-K|, included patterns
+ |i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions)
+
+ *'confirm'* *'cf'* *'noconfirm'* *'nocf'*
+'confirm' 'cf' boolean (default off)
+ global
+ {not in Vi}
+ When 'confirm' is on, certain operations that would normally
+ fail because of unsaved changes to a buffer, e.g. ":q" and ":e",
+ instead raise a |dialog| asking if you wish to save the current
+ file(s). You can still use a ! to unconditionally |abandon| a buffer.
+ If 'confirm' is off you can still activate confirmation for one
+ command only (this is most useful in mappings) with the |:confirm|
+ command.
+ Also see the |confirm()| function and the 'v' flag in 'guioptions'.
+
+ *'conskey'* *'consk'* *'noconskey'* *'noconsk'*
+'conskey' 'consk' boolean (default off)
+ global
+ {not in Vi} {only for MS-DOS}
+ When on direct console I/O is used to obtain a keyboard character.
+ This should work in most cases. Also see |'bioskey'|. Together,
+ three methods of console input are available:
+ 'conskey' 'bioskey' action ~
+ on on or off direct console input
+ off on BIOS
+ off off STDIN
+
+ *'copyindent'* *'ci'* *'nocopyindent'* *'noci'*
+'copyindent' 'ci' boolean (default off)
+ local to buffer
+ {not in Vi}
+ Copy the structure of the existing lines indent when autoindenting a
+ new line. Normally the new indent is reconstructed by a series of
+ tabs followed by spaces as required (unless |'expandtab'| is enabled,
+ in which case only spaces are used). Enabling this option makes the
+ new line copy whatever characters were used for indenting on the
+ existing line. If the new indent is greater than on the existing
+ line, the remaining space is filled in the normal manner.
+ NOTE: 'copyindent' is reset when 'compatible' is set.
+ Also see 'preserveindent'.
+
+ *'cpoptions'* *'cpo'*
+'cpoptions' 'cpo' string (Vim default: "aABceFs",
+ Vi default: all flags)
+ global
+ {not in Vi}
+ A sequence of single character flags. When a character is present
+ this indicates vi-compatible behavior. This is used for things where
+ not being vi-compatible is mostly or sometimes preferred.
+ 'cpoptions' stands for "compatible-options".
+ Commas can be added for readability.
+ To avoid problems with flags that are added in the future, use the
+ "+=" and "-=" feature of ":set" |add-option-flags|.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ contains behavior ~
+ *cpo-a*
+ a When included, a ":read" command with a file name
+ argument will set the alternate file name for the
+ current window.
+ *cpo-A*
+ A When included, a ":write" command with a file name
+ argument will set the alternate file name for the
+ current window.
+ *cpo-b*
+ b "\|" in a ":map" command is recognized as the end of
+ the map command. The '\' is included in the mapping,
+ the text after the '|' is interpreted as the next
+ command. Use a CTRL-V instead of a backslash to
+ include the '|' in the mapping. Applies to all
+ mapping, abbreviation, menu and autocmd commands.
+ See also |map_bar|.
+ *cpo-B*
+ B A backslash has no special meaning in mappings,
+ abbreviations and the "to" part of the menu commands.
+ Remove this flag to be able to use a backslash like a
+ CTRL-V. For example, the command ":map X \<Esc>"
+ results in X being mapped to:
+ 'B' included: "\^[" (^[ is a real <Esc>)
+ 'B' excluded: "<Esc>" (5 characters)
+ ('<' excluded in both cases)
+ *cpo-c*
+ c Searching continues at the end of any match at the
+ cursor position, but not further than the start of the
+ next line. When not present searching continues
+ one character from the cursor position. With 'c'
+ "abababababab" only gets three matches when repeating
+ "/abab", without 'c' there are five matches.
+ *cpo-C*
+ C Do not concatenate sourced lines that start with a
+ backslash. See |line-continuation|.
+ *cpo-d*
+ d Using "./" in the 'tags' option doesn't mean to use
+ the tags file relative to the current file, but the
+ tags file in the current directory.
+ *cpo-D*
+ D Can't use CTRL-K to enter a digraph after Normal mode
+ commands with a character argument, like |r|, |f| and
+ |t|.
+ *cpo-e*
+ e When executing a register with ":@r", always add a
+ <CR> to the last line, also when the register is not
+ linewise. If this flag is not present, the register
+ is not linewise and the last line does not end in a
+ <CR>, then the last line is put on the command-line
+ and can be edited before hitting <CR>.
+ *cpo-E*
+ E It is an error when using "y", "d", "c", "g~", "gu" or
+ "gU" on an Empty region. The operators only work when
+ at least one character is to be operate on. Example:
+ This makes "y0" fail in the first column.
+ *cpo-f*
+ f When included, a ":read" command with a file name
+ argument will set the file name for the current buffer,
+ if the current buffer doesn't have a file name yet.
+ *cpo-F*
+ F When included, a ":write" command with a file name
+ argument will set the file name for the current
+ buffer, if the current buffer doesn't have a file name
+ yet.
+ *cpo-g*
+ g Goto line 1 when using ":edit" without argument.
+ *cpo-i*
+ i When included, interrupting the reading of a file will
+ leave it modified.
+ *cpo-j*
+ j When joining lines, only add two spaces after a '.',
+ not after '!' or '?'. Also see 'joinspaces'.
+ *cpo-J*
+ J A |sentence| has to be followed by two spaces after
+ the '.', '!' or '?'. A <Tab> is not recognized as
+ white space.
+ *cpo-k*
+ k Disable the recognition of raw key codes in
+ mappings, abbreviations, and the "to" part of menu
+ commands. For example, if <Key> sends ^[OA (where ^[
+ is <Esc>), the command ":map X ^[OA" results in X
+ being mapped to:
+ 'k' included: "^[OA" (3 characters)
+ 'k' excluded: "<Key>" (one key code)
+ Also see the '<' flag below.
+ *cpo-K*
+ K Don't wait for a key code to complete when it is
+ halfway a mapping. This breaks mapping <F1><F1> when
+ only part of the second <F1> has been read. It
+ enables cancelling the mapping by typing <F1><Esc>.
+ *cpo-l*
+ l Backslash in a [] range in a search pattern is taken
+ literally, only "\]" is special See |/[]|
+ 'l' included: "/[ \t]" finds <Space>, '\' and 't'
+ 'l' excluded: "/[ \t]" finds <Space> and <Tab>
+ *cpo-L*
+ L When the 'list' option is set, 'wrapmargin',
+ 'textwidth', 'softtabstop' and Virtual Replace mode
+ (see |gR|) count a <Tab> as two characters, instead of
+ the normal behavior of a <Tab>.
+ *cpo-m*
+ m When included, a showmatch will always wait half a
+ second. When not included, a showmatch will wait half
+ a second or until a character is typed. |'showmatch'|
+ *cpo-M*
+ M When excluded, "%" matching will take backslashes into
+ account. Thus in "( \( )" and "\( ( \)" the outer
+ parenthesis match. When included "%" ignores
+ backslashes, which is Vi compatible.
+ *cpo-n*
+ n When included, the column used for 'number' will also
+ be used for text of wrapped lines.
+ *cpo-o*
+ o Line offset to search command is not remembered for
+ next search.
+ *cpo-O*
+ O Don't complain if a file is being overwritten, even
+ when it didn't exist when editing it. This is a
+ protection against a file unexpectedly created by
+ someone else. Vi didn't complain about this.
+ *cpo-p*
+ p Vi compatible Lisp indenting. When not present, a
+ slightly better algorithm is used.
+ *cpo-r*
+ r Redo ("." command) uses "/" to repeat a search
+ command, instead of the actually used search string.
+ *cpo-R*
+ R Remove marks from filtered lines. Without this flag
+ marks are kept like |:keepmarks| was used.
+ *cpo-s*
+ s Set buffer options when entering the buffer for the
+ first time. This is like it is in Vim version 3.0.
+ And it is the default. If not present the options are
+ set when the buffer is created.
+ *cpo-S*
+ S Set buffer options always when entering a buffer
+ (except 'readonly', 'fileformat', 'filetype' and
+ 'syntax'). This is the (most) Vi compatible setting.
+ The options are set to the values in the current
+ buffer. When you change an option and go to another
+ buffer, the value is copied. Effectively makes the
+ buffer options global to all buffers.
+
+ 's' 'S' copy buffer options
+ no no when buffer created
+ yes no when buffer first entered (default)
+ X yes each time when buffer entered (vi comp.)
+ *cpo-t*
+ t Search pattern for the tag command is remembered for
+ "n" command. Otherwise Vim only puts the pattern in
+ the history for search pattern, but doesn't change the
+ last used search pattern.
+ *cpo-u*
+ u Undo is Vi compatible. See |undo-two-ways|.
+ *cpo-v*
+ v Backspaced characters remain visible on the screen in
+ Insert mode. Without this flag the characters are
+ erased from the screen right away. With this flag the
+ screen newly typed text overwrites backspaced
+ characters.
+ *cpo-w*
+ w When using "cw" on a blank character, only change one
+ character and not all blanks until the start of the
+ next word.
+ *cpo-W*
+ W Don't overwrite a readonly file. When omitted, ":w!"
+ overwrites a readonly file, if possible.
+ *cpo-x*
+ x <Esc> on the command-line executes the command-line.
+ The default in Vim is to abandon the command-line,
+ because <Esc> normally aborts a command. |c_<Esc>|
+ *cpo-y*
+ y A yank command can be redone with ".".
+ *cpo-!*
+ ! When redoing a filter command, use the last used
+ external command, whatever it was. Otherwise the last
+ used -filter- command is used.
+ *cpo-$*
+ $ When making a change to one line, don't redisplay the
+ line, but put a '$' at the end of the changed text.
+ The changed text will be overwritten when you type the
+ new text. The line is redisplayed if you type any
+ command that moves the cursor from the insertion
+ point.
+ *cpo-%*
+ % Vi-compatible matching is done for the "%" command.
+ Does not recognize "#if", "#endif", etc.
+ Does not recognize "/*" and "*/".
+ Parens inside single and double quotes are also
+ counted, causing a string that contains a paren to
+ disturb the matching. For example, in a line like
+ "if (strcmp("foo(", s))" the first paren does not
+ match the last one. When this flag is not included,
+ parens inside single and double quotes are treated
+ specially. When matching a paren outside of quotes,
+ everything inside quotes is ignored. When matching a
+ paren inside quotes, it will find the matching one (if
+ there is one). This works very well for C programs.
+ *cpo-star*
+ * Use ":*" in the same way as ":@". When not included,
+ ":*" is an alias for ":'<,'>", select the Visual area.
+ *cpo-<*
+ < Disable the recognition of special key codes in |<>|
+ form in mappings, abbreviations, and the "to" part of
+ menu commands. For example, the command
+ ":map X <Tab>" results in X being mapped to:
+ '<' included: "<Tab>" (5 characters)
+ '<' excluded: "^I" (^I is a real <Tab>)
+ Also see the 'k' flag above.
+
+ *'cscopepathcomp'* *'cspc'*
+'cscopepathcomp' 'cspc' number (default 0)
+ global
+ {not available when compiled without the |+cscope|
+ feature}
+ {not in Vi}
+ Determines how many components of the path to show in a list of tags.
+ See |cscopepathcomp|.
+
+ *'cscopeprg'* *'csprg'*
+'cscopeprg' 'csprg' string (default "cscope")
+ global
+ {not available when compiled without the |+cscope|
+ feature}
+ {not in Vi}
+ Specifies the command to execute cscope. See |cscopeprg|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'cscopequickfix'* *'csqf'*
+'cscopequickfix' 'csqf' string (default "")
+ global
+ {not available when compiled without the |+cscope|
+ or |+quickfix| features}
+ {not in Vi}
+ Specifies whether to use quickfix window to show cscope results.
+ See |cscopequickfix|.
+
+ *'cscopetag'* *'cst'* *'nocscopetag'* *'nocst'*
+'cscopetag' 'cst' boolean (default off)
+ global
+ {not available when compiled without the |+cscope|
+ feature}
+ {not in Vi}
+ Use cscope for tag commands. See |cscope-options|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'cscopetagorder'* *'csto'*
+'cscopetagorder' 'csto' number (default 0)
+ global
+ {not available when compiled without the |+cscope|
+ feature}
+ {not in Vi}
+ Determines the order in which ":cstag" performs a search. See
+ |cscopetagorder|.
+ NOTE: This option is set to 0 when 'compatible' is set.
+
+ *'cscopeverbose'* *'csverb'*
+ *'nocscopeverbose'* *'nocsverb'*
+'cscopeverbose' 'csverb' boolean (default off)
+ global
+ {not available when compiled without the |+cscope|
+ feature}
+ {not in Vi}
+ Give messages when adding a cscope database. See |cscopeverbose|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'debug'*
+'debug' string (default "")
+ global
+ {not in Vi}
+ When set to "msg", error messages that would otherwise be omitted will
+ be given anyway. This is useful when debugging 'foldexpr' or
+ 'indentexpr'.
+
+ *'define'* *'def'*
+'define' 'def' string (default "^\s*#\s*define")
+ global or local to buffer |global-local|
+ {not in Vi}
+ Pattern to be used to find a macro definition. It is a search
+ pattern, just like for the "/" command. This option is used for the
+ commands like "[i" and "[d" |include-search|. The 'isident' option is
+ used to recognize the defined name after the match:
+ {match with 'define'}{non-ID chars}{defined name}{non-ID char}
+ See |option-backslash| about inserting backslashes to include a space
+ or backslash.
+ The default value is for C programs. For C++ this value would be
+ useful, to include const type declarations: >
+ ^\(#\s*define\|[a-z]*\s*const\s*[a-z]*\)
+< When using the ":set" command, you need to double the backslashes!
+
+ *'delcombine'* *'deco'* *'nodelcombine'* *'nodeco'*
+'delcombine' 'deco' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+multi_byte|
+ feature}
+ If editing Unicode and this option is set, backspace and Normal mode
+ "x" delete each combining character on its own. When it is off (the
+ default) the character along with its combining characters are
+ deleted.
+ Note: When 'delcombine' is set "xx" may work different from "2x"!
+
+ This is useful for Arabic, Hebrew and many other languages where one
+ may have combining characters overtop of base characters, and want
+ to remove only the combining ones.
+
+ *'dictionary'* *'dict'*
+'dictionary' 'dict' string (default "")
+ global or local to buffer |global-local|
+ {not in Vi}
+ List of file names, separated by commas, that are used to lookup words
+ for keyword completion commands |i_CTRL-X_CTRL-K|. Each file should
+ contain a list of words. This can be one word per line, or several
+ words per line, separated by non-keyword characters (white space is
+ preferred). Maximum line length is 510 bytes.
+ To include a comma in a file name precede it with a backslash. Spaces
+ after a comma are ignored, otherwise spaces are included in the file
+ name. See |option-backslash| about using backslashes.
+ Where to find a list of words?
+ - On FreeBSD, there is the file "/usr/share/dict/words".
+ - In the Simtel archive, look in the "msdos/linguist" directory.
+ - In "miscfiles" of the GNU collection.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ directories from the list. This avoids problems when a future version
+ uses another default.
+ Backticks cannot be used in this option for security reasons.
+
+ *'diff'* *'nodiff'*
+'diff' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+diff|
+ feature}
+ Join the current window in the group of windows that shows differences
+ between files. See |vimdiff|.
+
+ *'dex'* *'diffexpr'*
+'diffexpr' 'dex' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+diff|
+ feature}
+ Expression which is evaluated to obtain an ed-style diff file from two
+ versions of a file. See |diff-diffexpr|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'dip'* *'diffopt'*
+'diffopt' 'dip' string (default "filler")
+ global
+ {not in Vi}
+ {not available when compiled without the |+diff|
+ feature}
+ Option settings for diff mode. It can consist of the following items.
+ All are optional. Items must be separated by a comma.
+
+ filler Show filler lines, to keep the text
+ synchronized with a window that has inserted
+ lines at the same position. Mostly useful
+ when windows are side-by-side and 'scrollbind'
+ is set.
+
+ context:{n} Use a context of {n} lines between a change
+ and a fold that contains unchanged lines.
+ When omitted a context of six lines is used.
+ See |fold-diff|.
+
+ icase Ignore changes in case of text. "a" and "A"
+ are considered the same. Adds the "-i" flag
+ to the "diff" command if 'diffexpr' is empty.
+
+ iwhite Ignore changes in amount of white space. Adds
+ the "-b" flag to the "diff" command if
+ 'diffexpr' is empty. Check the documentation
+ of the "diff" command for what this does
+ exactly. It should ignore adding trailing
+ white space, but not leading white space.
+
+ Examples: >
+
+ :set diffopt=filler,context:4
+ :set diffopt=
+ :set diffopt=filler
+<
+ *'digraph'* *'dg'* *'nodigraph'* *'nodg'*
+'digraph' 'dg' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the |+digraphs|
+ feature}
+ Enable the entering of digraphs in Insert mode with {char1} <BS>
+ {char2}. See |digraphs|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'directory'* *'dir'*
+'directory' 'dir' string (default for Amiga: ".,t:",
+ for MS-DOS and Win32: ".,c:\tmp,c:\temp"
+ for Unix: ".,~/tmp,/var/tmp,/tmp")
+ global
+ List of directory names for the swap file, separated with commas.
+ - The swap file will be created in the first directory where this is
+ possible.
+ - Empty means that no swap file will be used (recovery is
+ impossible!).
+ - A directory "." means to put the swap file in the same directory as
+ the edited file. On Unix, a dot is prepended to the file name, so
+ it doesn't show in a directory listing. On MS-Windows the "hidden"
+ attribute is set and a dot prepended if possible.
+ - A directory starting with "./" (or ".\" for MS-DOS et.al.) means to
+ put the swap file relative to where the edited file is. The leading
+ "." is replaced with the path name of the edited file.
+ - For Unix and Win32, if a directory ends in two path separators, the
+ swap file name will be built from the complete path to the file
+ with all path separators substituted to percent '%' signs. This will
+ ensure file name uniqueness in the preserve directory.
+ - Spaces after the comma are ignored, other spaces are considered part
+ of the directory name. To have a space at the start of a directory
+ name, precede it with a backslash.
+ - To include a comma in a directory name precede it with a backslash.
+ - A directory name may end in an ':' or '/'.
+ - Environment variables are expanded |:set_env|.
+ - Careful with '\' characters, type one before a space, type two to
+ get one in the option (see |option-backslash|), for example: >
+ :set dir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
+< - For backwards compatibility with Vim version 3.0 a '>' at the start
+ of the option is removed.
+ Using "." first in the list is recommended. This means that editing
+ the same file twice will result in a warning. Using "/tmp" on Unix is
+ discouraged: When the system crashes you lose the swap file.
+ "/var/tmp" is often not cleared when rebooting, thus is a better
+ choice than "/tmp". But it can contain a lot of files, your swap
+ files get lost in the crowd. That is why a "tmp" directory in your
+ home directory is tried first.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ directories from the list. This avoids problems when a future version
+ uses another default.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+ {Vi: directory to put temp file in, defaults to "/tmp"}
+
+ *'display'* *'dy'*
+'display' 'dy' string (default "")
+ global
+ {not in Vi}
+ Change the way text is displayed. This is comma separated list of
+ flags:
+ lastline When included, as much as possible of the last line
+ in a window will be displayed. When not included, a
+ last line that doesn't fit is replaced with "@" lines.
+ uhex Show unprintable characters hexadecimal as <xx>
+ instead of using ^C and ~C.
+
+ *'eadirection'* *'ead'*
+'eadirection' 'ead' string (default "both")
+ global
+ {not in Vi}
+ {not available when compiled without the +vertsplit
+ feature}
+ Tells when the 'equalalways' option applies:
+ ver vertically, width of windows is not affected
+ hor horizontally, height of windows is not affected
+ both width and height of windows is affected
+
+ *'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
+'edcompatible' 'ed' boolean (default off)
+ global
+ Makes the 'g' and 'c' flags of the ":substitute" command to be
+ toggled each time the flag is given. See |complex-change|. See
+ also 'gdefault' option.
+ Switching this option on is discouraged!
+
+ *'encoding'* *'enc'* *E543*
+'encoding' 'enc' string (default: "latin1" or value from $LANG)
+ global
+ {only available when compiled with the |+multi_byte|
+ feature}
+ {not in Vi}
+ Sets the character encoding used inside Vim. It applies to text in
+ the buffers, registers, Strings in expressions, text stored in the
+ viminfo file, etc. It sets the kind of characters which Vim can work
+ with. See |encoding-names| for the possible values.
+
+ NOTE: Changing this option will not change the encoding of the
+ existing text in Vim. It may cause multi-byte text to become invalid.
+ It should normally be kept at its default value, or set when Vim
+ starts up. See |multibyte|.
+
+ NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
+ "utf-8". Although care has been taken to allow different values of
+ 'encoding', "utf-8" is the natural choice for the environment and
+ avoids unnecessary conversion overhead. "utf-8" has not been made
+ the default to prevent different behaviour of the GUI and terminal
+ versions, and to avoid changing the encoding of newly created files
+ without your knowledge (in case 'fileencodings' is empty).
+
+ The character encoding of files can be different from 'encoding'.
+ This is specified with 'fileencoding'. The conversion is done with
+ iconv() or as specified with 'charconvert'.
+
+ Normally 'encoding' will be equal to your current locale. This will
+ be the default if Vim recognizes your environment settings. If
+ 'encoding' is not set to the current locale, 'termencoding' must be
+ set to convert typed and displayed text. See |encoding-table|.
+
+ When you set this option, it fires the |EncodingChanged| autocommand
+ event so that you can set up fonts if necessary.
+
+ When the option is set, the value is converted to lowercase. Thus
+ you can set it with uppercase values too. Underscores are translated
+ to '-' signs.
+ When the encoding is recognized, it is changed to the standard name.
+ For example "Latin-1" becomes "latin1", "ISO_88592" becomes
+ "iso-8859-2" and "utf8" becomes "utf-8".
+
+ Note: "latin1" is also used when the encoding could not be detected.
+ This only works when editing files in the same encoding! When the
+ actual character set is not latin1, make sure 'fileencoding' and
+ 'fileencodings' are empty. When conversion is needed, switch to using
+ utf-8.
+
+ When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8.
+ You don't notice this while editing, but it does matter for the
+ |viminfo-file|. And Vim expects the terminal to use utf-8 too. Thus
+ setting 'encoding' to one of these values instead of utf-8 only has
+ effect for encoding used for files when 'fileencoding' is empty.
+
+ When 'encoding' is set to a Unicode encoding, and 'fileencodings' was
+ not set yet, the default for 'fileencodings' is changed.
+
+ *'endofline'* *'eol'* *'noendofline'* *'noeol'*
+'endofline' 'eol' boolean (default on)
+ local to buffer
+ {not in Vi}
+ When writing a file and this option is off and the 'binary' option
+ is on, no <EOL> will be written for the last line in the file. This
+ option is automatically set when starting to edit a new file, unless
+ the file does not have an <EOL> for the last line in the file, in
+ which case it is reset. Normally you don't have to set or reset this
+ option. When 'binary' is off the value is not used when writing the
+ file. When 'binary' is on it is used to remember the presence of a
+ <EOL> for the last line in the file, so that when you write the file
+ the situation from the original file can be kept. But you can change
+ it if you want to.
+
+ *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
+'equalalways' 'ea' boolean (default on)
+ global
+ {not in Vi}
+ When on, all the windows are automatically made the same size after
+ splitting or closing a window. When off, splitting a window will
+ reduce the size of the current window and leave the other windows the
+ same. When closing a window the extra lines are given to the window
+ next to it (depending on 'splitbelow' and 'splitright').
+ When mixing vertically and horizontally split windows, a minimal size
+ is computed and some windows may be larger if there is room. The
+ 'eadirection' option tells in which direction the size is affected.
+ Changing the height of a window can be avoided by setting
+ 'winfixheight'.
+
+ *'equalprg'* *'ep'*
+'equalprg' 'ep' string (default "")
+ global or local to buffer |global-local|
+ {not in Vi}
+ External program to use for "=" command. When this option is empty
+ the internal formatting functions are used ('lisp', 'cindent' or
+ 'indentexpr').
+ Environment variables are expanded |:set_env|. See |option-backslash|
+ about including spaces and backslashes.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'errorbells'* *'eb'* *'noerrorbells'* *'noeb'*
+'errorbells' 'eb' boolean (default off)
+ global
+ Ring the bell (beep or screen flash) for error messages. This only
+ makes a difference for error messages, the bell will be used always
+ for a lot of errors without a message (e.g., hitting <Esc> in Normal
+ mode). See 'visualbell' on how to make the bell behave like a beep,
+ screen flash or do nothing.
+
+ *'errorfile'* *'ef'*
+'errorfile' 'ef' string (Amiga default: "AztecC.Err",
+ others: "errors.err")
+ global
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ Name of the errorfile for the QuickFix mode (see |:cf|).
+ When the "-q" command-line argument is used, 'errorfile' is set to the
+ following argument. See |-q|.
+ NOT used for the ":make" command. See 'makeef' for that.
+ Environment variables are expanded |:set_env|.
+ See |option-backslash| about including spaces and backslashes.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'errorformat'* *'efm'*
+'errorformat' 'efm' string (default is very long)
+ global or local to buffer |global-local|
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ Scanf-like description of the format for the lines in the error file
+ (see |errorformat|).
+
+ *'esckeys'* *'ek'* *'noesckeys'* *'noek'*
+'esckeys' 'ek' boolean (Vim default: on, Vi default: off)
+ global
+ {not in Vi}
+ Function keys that start with an <Esc> are recognized in Insert
+ mode. When this option is off, the cursor and function keys cannot be
+ used in Insert mode if they start with an <Esc>. The advantage of
+ this is that the single <Esc> is recognized immediately, instead of
+ after one second. Instead of resetting this option, you might want to
+ try changing the values for 'timeoutlen' and 'ttimeoutlen'. Note that
+ when 'esckeys' is off, you can still map anything, but the cursor keys
+ won't work by default.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'eventignore'* *'ei'*
+'eventignore' 'ei' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+autocmd|
+ feature}
+ A list of autocommand event names, which are to be ignored.
+ When set to "all", all autocommand events are ignored, autocommands
+ will not be executed.
+ Otherwise this is a comma separated list of event names. Example: >
+ :set ei=WinEnter,WinLeave
+<
+ *'expandtab'* *'et'* *'noexpandtab'* *'noet'*
+'expandtab' 'et' boolean (default off)
+ local to buffer
+ {not in Vi}
+ In Insert mode: Use the appropriate number of spaces to insert a
+ <Tab>. Spaces are used in indents with the '>' and '<' commands and
+ when 'autoindent' is on. To insert a real tab when 'expandtab' is
+ on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'exrc'* *'ex'* *'noexrc'* *'noex'*
+'exrc' 'ex' boolean (default off)
+ global
+ {not in Vi}
+ Enables the reading of .vimrc, .exrc and .gvimrc in the current
+ directory. If you switch this option on you should also consider
+ setting the 'secure' option (see |initialization|). Using a local
+ .exrc, .vimrc or .gvimrc is a potential security leak, use with care!
+ also see |.vimrc| and |gui-init|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'fileencoding'* *'fenc'* *E213*
+'fileencoding' 'fenc' string (default: "")
+ local to buffer
+ {only available when compiled with the |+multi_byte|
+ feature}
+ {not in Vi}
+ Sets the character encoding for the file of this buffer.
+ When 'fileencoding' is different from 'encoding', conversion will be
+ done when reading and writing the file.
+ When 'fileencoding' is empty, the same value as 'encoding' will be
+ used (no conversion when reading or writing a file).
+ WARNING: Conversion can cause loss of information! When
+ 'encoding' is "utf-8" conversion is most likely done in a way
+ that the reverse conversion results in the same text. When
+ 'encoding' is not "utf-8" some characters may be lost!
+ See 'encoding' for the possible values. Additionally, values may be
+ specified that can be handled by the converter, see
+ |mbyte-conversion|.
+ When reading a file 'fileencoding' will be set from 'fileencodings'.
+ To read a file in a certain encoding it won't work by setting
+ 'fileencoding', use the |++enc| argument.
+ Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
+ When the option is set, the value is converted to lowercase. Thus
+ you can set it with uppercase values too. '_' characters are
+ replaced with '-'. If a name is recognized from the list for
+ 'encoding', it is replaced by the standard name. For example
+ "ISO8859-2" becomes "iso-8859-2".
+ When this option is set, after starting to edit a file, the 'modified'
+ option is set, because the file would be different when written.
+ If you do this in a modeline, you might want to set 'nomodified' to
+ avoid this.
+ This option can not be changed when 'modifiable' is off.
+
+ *'fe'*
+ NOTE: Before version 6.0 this option specified the encoding for the
+ whole of Vim, this was a mistake. Now use 'encoding' instead. The
+ old short name was 'fe', which is no longer used.
+
+ *'fileencodings'* *'fencs'*
+'fileencodings' 'fencs' string (default: "ucs-bom", "ucs-bom,utf-8,latin1"
+ when 'encoding' is set to a Unicode value)
+ global
+ {only available when compiled with the |+multi_byte|
+ feature}
+ {not in Vi}
+ This is a list of character encodings considered when starting to edit
+ an existing file. When a file is read, Vim tries to use the first
+ mentioned character encoding. If an error is detected, the next one
+ in the list is tried. When an encoding is found that works,
+ 'fileencoding' is set to it. If all fail, 'fileencoding' is set to
+ an empty string, which means the value of 'encoding' is used.
+ WARNING: Conversion can cause loss of information! When
+ 'encoding' is "utf-8" (or one of the other Unicode variants)
+ conversion is most likely done in a way that the reverse
+ conversion results in the same text. When 'encoding' is not
+ "utf-8" special characters may be lost!
+ For an empty file or a file with only ASCII characters most encodings
+ will work and the first entry of 'fileencodings' will be used (except
+ "ucs-bom", which requires the BOM to be present). If you prefer
+ another encoding use an BufReadPost autocommand event to test if your
+ preferred encoding is to be used. Example: >
+ au BufReadPost * if search('\S', 'w') == 0 |
+ \ set fenc=iso-2022-jp | endif
+< This sets 'fileencoding' to "iso-2022-jp" if the file does not contain
+ non-blank characters.
+ Note that 'fileencodings' is not used for an new file, 'fileencoding'
+ is always empty then. This means that a non-existing file may get a
+ different encoding than an empty file.
+ The special value "ucs-bom" can be used to check for a Unicode BOM
+ (Byte Order Mark) at the start of the file. It must not be preceded
+ by "utf-8" or another Unicode encoding for this to work properly.
+ An entry for an 8-bit encoding (e.g., "latin1") should be the last,
+ because Vim cannot detect an error, thus the encoding is always
+ accepted.
+ WRONG VALUES: WHAT'S WRONG:
+ latin1,utf-8 "latin1" will always be used
+ utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8
+ file
+ cp1250,latin1 "cp1250" will always be used
+ If 'fileencodings' is empty, 'fileencoding' is not modified.
+ See 'fileencoding' for the possible values.
+ Setting this option does not have an effect until the next time a file
+ is read.
+
+ *'fileformat'* *'ff'*
+'fileformat' 'ff' string (MS-DOS, MS-Windows, OS/2 default: "dos",
+ Unix default: "unix",
+ Macintosh default: "mac")
+ local to buffer
+ {not in Vi}
+ This gives the <EOL> of the current buffer, which is used for
+ reading/writing the buffer from/to a file:
+ dos <CR> <NL>
+ unix <NL>
+ mac <CR>
+ When "dos" is used, CTRL-Z at the end of a file is ignored.
+ See |file-formats| and |file-read|.
+ For the character encoding of the file see 'fileencoding'.
+ When 'binary' is set, the value of 'fileformat' is ignored, file I/O
+ works like it was set to "unix'.
+ This option is set automatically when starting to edit a file and
+ 'fileformats' is not empty and 'binary' is off.
+ When this option is set, after starting to edit a file, the 'modified'
+ option is set, because the file would be different when written.
+ This option can not be changed when 'modifiable' is off.
+ For backwards compatibility: When this option is set to "dos",
+ 'textmode' is set, otherwise 'textmode' is reset.
+
+ *'fileformats'* *'ffs'*
+'fileformats' 'ffs' string (default:
+ Vim+Vi MS-DOS, MS-Windows OS/2: "dos,unix",
+ Vim Unix: "unix,dos",
+ Vim Mac: "mac,unix,dos",
+ Vi Cygwin: "unix,dos",
+ Vi others: "")
+ global
+ {not in Vi}
+ This gives the end-of-line (<EOL>) formats that will be tried when
+ starting to edit a new buffer and when reading a file into an existing
+ buffer:
+ - When empty, the format defined with 'fileformat' will be used
+ always. It is not set automatically.
+ - When set to one name, that format will be used whenever a new buffer
+ is opened. 'fileformat' is set accordingly for that buffer. The
+ 'fileformats' name will be used when a file is read into an existing
+ buffer, no matter what 'fileformat' for that buffer is set to.
+ - When more than one name is present, separated by commas, automatic
+ <EOL> detection will be done when reading a file. When starting to
+ edit a file, a check is done for the <EOL>:
+ 1. If all lines end in <CR><NL>, and 'fileformats' includes "dos",
+ 'fileformat' is set to "dos".
+ 2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat'
+ is set to "unix". Note that when a <NL> is found without a
+ preceding <CR>, "unix" is preferred over "dos".
+ 3. If 'fileformats' includes "mac", 'fileformat' is set to "mac".
+ This means that "mac" is only chosen when "unix" is not present,
+ or when no <NL> is found in the file, and when "dos" is not
+ present, or no <CR><NL> is present in the file.
+ Also if "unix" was first chosen, but the first <CR> is before
+ the first <NL> and there appears to be more <CR>'s than <NL>'s in
+ the file, then 'fileformat' is set to "mac".
+ 4. If 'fileformat' is still not set, the first name from
+ 'fileformats' is used.
+ When reading a file into an existing buffer, the same is done, but
+ this happens like 'fileformat' has been set appropriately for that
+ file only, the option is not changed.
+ When 'binary' is set, the value of 'fileformats' is not used.
+
+ For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
+ are ":source"ed and for vimrc files, automatic <EOL> detection may be
+ done:
+ - When 'fileformats' is empty, there is no automatic detection. Dos
+ format will be used.
+ - When 'fileformats' is set to one or more names, automatic detection
+ is done. This is based on the first <NL> in the file: If there is a
+ <CR> in front of it, Dos format is used, otherwise Unix format is
+ used.
+ Also see |file-formats|.
+ For backwards compatibility: When this option is set to an empty
+ string or one format (no comma is included), 'textauto' is reset,
+ otherwise 'textauto' is set.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'filetype'* *'ft'*
+'filetype' 'ft' string (default: "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+autocmd|
+ feature}
+ When this option is set, the FileType autocommand event is triggered.
+ All autocommands that match with the value of this option will be
+ executed. Thus the value of 'filetype' is used in place of the file
+ name.
+ Otherwise this option does not always reflect the current file type.
+ This option is normally set when the file type is detected. To enable
+ this use the ":filetype on" command. |:filetype|
+ Setting this option to a different value is most useful in a modeline,
+ for a file for which the file type is not automatically recognized.
+ Example, for in an IDL file: >
+ /* vim: set filetype=idl : */
+< |FileType| |filetypes|
+ Do not confuse this option with 'osfiletype', which is for the file
+ type that is actually stored with the file.
+ This option is not copied to another buffer, independent of the 's' or
+ 'S' flag in 'cpoptions'.
+
+ *'fillchars'* *'fcs'*
+'fillchars' 'fcs' string (default "vert:|,fold:-")
+ global
+ {not in Vi}
+ {not available when compiled without the |+windows|
+ and |+folding| features}
+ Characters to fill the statuslines and vertical separators.
+ It is a comma separated list of items:
+
+ item default Used for ~
+ stl:c ' ' or '^' statusline of the current window
+ stlnc:c ' ' or '-' statusline of the non-current windows
+ vert:c '|' vertical separators |:vsplit|
+ fold:c '-' filling 'foldtext'
+ diff:c '-' deleted lines of the 'diff' option
+
+ Any one that is omitted will fall back to the default. For "stl" and
+ "stlnc" the space will be used when there is highlighting, '^' or '-'
+ otherwise.
+
+ Example: >
+ :set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:-
+< This is similar to the default, except that these characters will also
+ be used when there is highlighting.
+
+ The highlighting used for these items:
+ item highlight group ~
+ stl:c StatusLine |hl-StatusLine|
+ stlnc:c StatusLineNC |hl-StatusLineNC|
+ vert:c VertSplit |hl-VertSplit|
+ fold:c Folded |hl-Folded|
+ diff:c DiffDelete |hl-DiffDelete|
+
+ *'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
+'fkmap' 'fk' boolean (default off) *E198*
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ When on, the keyboard is mapped for the Farsi character set.
+ Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
+ toggle this option |i_CTRL-_|. See |farsi.txt|.
+
+ *'foldclose'* *'fcl'*
+'foldclose' 'fcl' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ When set to "all", a fold is closed when the cursor isn't in it and
+ its level is higher than 'foldlevel'. Useful if you want folds to
+ automatically close when moving out of them.
+
+ *'foldcolumn'* *'fdc'*
+'foldcolumn' 'fdc' number (default 0)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ When non-zero, a column with the specified width is shown at the side
+ of the window which indicates open and closed folds. The maximum
+ value is 12.
+ See |folding|.
+
+ *'foldenable'* *'fen'* *'nofoldenable'* *'nofen'*
+'foldenable' 'fen' boolean (default on)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ When off, all folds are open. This option can be used to quickly
+ switch between showing all text unfolded and viewing the text with
+ folds (including manually opened or closed folds). It can be toggled
+ with the |zi| command. The 'foldcolumn' will remain blank when
+ 'foldenable' is off.
+ This option is set by commands that create a new fold or close a fold.
+ See |folding|.
+
+ *'foldexpr'* *'fde'*
+'foldexpr' 'fde' string (default: "0")
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ or |+eval| feature}
+ The expression used for when 'foldmethod' is "expr". It is evaluated
+ for each line to obtain its fold level. See |fold-expr|. Also see
+ |eval-sandbox|.
+
+ *'foldignore'* *'fdi'*
+'foldignore' 'fdi' string (default: "#")
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Used only when 'foldmethod' is "indent". Lines starting with
+ characters in 'foldignore' will get their fold level from surrounding
+ lines. White space is skipped before checking for this character.
+ The default "#" works well for C programs. See |fold-indent|.
+
+ *'foldlevel'* *'fdl'*
+'foldlevel' 'fdl' number (default: 0)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Sets the fold level: Folds with a higher level will be closed.
+ Setting this option to zero will close all folds. Higher numbers will
+ close fewer folds.
+ This option is set by commands like |zm|, |zM| and |zR|.
+ See |fold-foldlevel|.
+
+ *'foldlevelstart'* *'fdls'*
+'foldlevelstart' 'fdls' number (default: -1)
+ global
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Sets 'foldlevel' when starting to edit another buffer in a window.
+ Useful to always start editing with all folds closed (value zero),
+ some folds closed (one) or no folds closed (99).
+ This is done before reading any modeline, thus a setting in a modeline
+ overrules this option. Starting to edit a file for |diff-mode| also
+ ignores this option and closes all folds.
+ It is also done before BufReadPre autocommands, to allow an autocmd to
+ overrule the 'foldlevel' value for specific files.
+ When the value is negative, it is not used.
+
+ *'foldmarker'* *'fmr'* *E536*
+'foldmarker' 'fmr' string (default: "{{{,}}}")
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ The start and end marker used when 'foldmethod' is "marker". There
+ must be one comma, which separates the start and end marker. The
+ marker is a literal string (a regular expression would be too slow).
+ See |fold-marker|.
+
+ *'foldmethod'* *'fdm'*
+'foldmethod' 'fdm' string (default: "manual")
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ The kind of folding used for the current window. Possible values:
+ |fold-manual| manual Folds are created manually.
+ |fold-indent| indent Lines with equal indent form a fold.
+ |fold-expr| expr 'foldexpr' gives the fold level of a line.
+ |fold-marker| marker Markers are used to specify folds.
+ |fold-syntax| syntax Syntax highlighting items specify folds.
+ |fold-diff| diff Fold text that is not changed.
+
+ *'foldminlines'* *'fml'*
+'foldminlines' 'fml' number (default: 1)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Sets the minimum number of screen lines for a fold to be displayed
+ closed. Also for manually closed folds.
+ Note that this only has an effect of what is displayed. After using
+ "zc" to close a fold, which is displayed open because it's smaller
+ than 'foldminlines', a following "zc" may close a containing fold.
+
+ *'foldnestmax'* *'fdn'*
+'foldnestmax' 'fdn' number (default: 20)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Sets the maximum nesting of folds for the "indent" and "syntax"
+ methods. This avoids that too many folds will be created. Using more
+ than 20 doesn't work, because the internal limit is 20.
+
+ *'foldopen'* *'fdo'*
+'foldopen' 'fdo' string (default: "block,hor,mark,percent,quickfix,
+ search,tag,undo")
+ global
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ Specifies for which type of commands folds will be opened, if the
+ command moves the cursor into a closed fold. It is a comma separated
+ list of items.
+ item commands ~
+ all any
+ block "(", "{", "[[", "[{", etc.
+ hor horizontal movements: "l", "w", "fx", etc.
+ insert any command in Insert mode
+ jump far jumps: "G", "gg", etc.
+ mark jumping to a mark: "'m", CTRL-O, etc.
+ percent "%"
+ quickfix ":cn", ":crew", ":make", etc.
+ search search for a pattern: "/", "n", "*", "gd", etc.
+ (not for a search pattern in a ":" command)
+ tag jumping to a tag: ":ta", CTRL-T, etc.
+ undo undo or redo: "u" and CTRL-R
+ When the command is part of a mapping this option is not used. Add
+ the |zv| command to the mapping to get the same effect.
+ When a movement command is used for an operator (e.g., "dl" or "y%")
+ this option is not used. This means the operator will include the
+ whole closed fold.
+ Note that vertical movements are not here, because it would make it
+ very difficult to move onto a closed fold.
+ In insert mode the folds containing the cursor will always be open
+ when text is inserted.
+ To close folds you can re-apply 'foldlevel' with the |zx| command or
+ set the 'foldclose' option to "all".
+
+ *'foldtext'* *'fdt'*
+'foldtext' 'fdt' string (default: "foldtext()")
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+folding|
+ feature}
+ An expression which is used to specify the text displayed for a closed
+ fold. See |fold-foldtext|.
+
+ *'formatoptions'* *'fo'*
+'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
+ local to buffer
+ {not in Vi}
+ This is a sequence of letters which describes how automatic
+ formatting is to be done. See |fo-table|. When the 'paste' option is
+ on, no formatting is done (like 'formatoptions' is empty). Commas can
+ be inserted for readability.
+ To avoid problems with flags that are added in the future, use the
+ "+=" and "-=" feature of ":set" |add-option-flags|.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'formatprg'* *'fp'*
+'formatprg' 'fp' string (default "")
+ global
+ {not in Vi}
+ The name of an external program that will be used to format the lines
+ selected with the "gq" command. The program must take the input on
+ stdin and produce the output on stdout. The Unix program "fmt" is
+ such a program. If this option is an empty string, the internal
+ format function will be used |C-indenting|. Environment variables are
+ expanded |:set_env|. See |option-backslash| about including spaces
+ and backslashes.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
+'gdefault' 'gd' boolean (default off)
+ global
+ {not in Vi}
+ When on, the ":substitute" flag 'g' is default on. This means that
+ all matches in a line are substituted instead of one. When a 'g' flag
+ is given to a ":substitute" command, this will toggle the substitution
+ of all or one match. See |complex-change|.
+
+ command 'gdefault' on 'gdefault' off ~
+ :s/// subst. all subst. one
+ :s///g subst. one subst. all
+ :s///gg subst. all subst. one
+
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'grepformat'* *'gfm'*
+'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m")
+ global
+ {not in Vi}
+ Format to recognize for the ":grep" command output.
+ This is a scanf-like string that uses the same format as the
+ 'errorformat' option: see |errorformat|.
+
+ *'grepprg'* *'gp'*
+'grepprg' 'gp' string (default "grep -n ",
+ Unix: "grep -n $* /dev/null",
+ Win32: "findstr /n" or "grep -n",
+ VMS: "SEARCH/NUMBERS ")
+ global or local to buffer |global-local|
+ {not in Vi}
+ Program to use for the ":grep" command. This option may contain '%'
+ and '#' characters, which are expanded like when used in a command-
+ line. The placeholder "$*" is allowed to specify where the arguments
+ will be included. Environment variables are expanded |:set_env|. See
+ |option-backslash| about including spaces and backslashes.
+ When your "grep" accepts the "-H" argument, use this to make ":grep"
+ also work well with a single file: >
+ :set grepprg=grep\ -nH
+< See also the section |:make_makeprg|, since most of the comments there
+ apply equally to 'grepprg'.
+ For Win32, the default is "findstr /n" if "findstr.exe" can be found,
+ otherwise it's "grep -n".
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
+'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor,
+ ve:ver35-Cursor,
+ o:hor50-Cursor,
+ i-ci:ver25-Cursor/lCursor,
+ r-cr:hor20-Cursor/lCursor,
+ sm:block-Cursor
+ -blinkwait175-blinkoff150-blinkon175",
+ for MS-DOS and Win32 console:
+ "n-v-c:block,o:hor50,i-ci:hor15,
+ r-cr:hor30,sm:block")
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled, and
+ for MS-DOS and Win32 console}
+ This option tells Vim what the cursor should look like in different
+ modes. It fully works in the GUI. In an MSDOS or Win32 console, only
+ the height of the cursor can be changed. This can be done by
+ specifying a block cursor, or a percentage for a vertical or
+ horizontal cursor.
+
+ The option is a comma separated list of parts. Each part consist of a
+ mode-list and an argument-list:
+ mode-list:argument-list,mode-list:argument-list,..
+ The mode-list is a dash separated list of these modes:
+ n Normal mode
+ v Visual mode
+ ve Visual mode with 'selection' "exclusive" (same as 'v',
+ if not specified)
+ o Operator-pending mode
+ i Insert mode
+ r Replace mode
+ c Command-line Normal (append) mode
+ ci Command-line Insert mode
+ cr Command-line Replace mode
+ sm showmatch in Insert mode
+ a all modes
+ The argument-list is a dash separated list of these arguments:
+ hor{N} horizontal bar, {N} percent of the character height
+ ver{N} vertical bar, {N} percent of the character width
+ block block cursor, fills the whole character
+ [only one of the above three should be present]
+ blinkwait{N} *cursor-blinking*
+ blinkon{N}
+ blinkoff{N}
+ blink times for cursor: blinkwait is the delay before
+ the cursor starts blinking, blinkon is the time that
+ the cursor is shown and blinkoff is the time that the
+ cursor is not shown. The times are in msec. When one
+ of the numbers is zero, there is no blinking. The
+ default is: "blinkwait700-blinkon400-blinkoff250".
+ These numbers are used for a missing entry. This
+ means that blinking is enabled by default. To switch
+ blinking off you can use "blinkon0". The cursor only
+ blinks when Vim is waiting for input, not while
+ executing a command.
+ To make the cursor blink in an xterm, see
+ |xterm-blink|.
+ {group-name}
+ a highlight group name, that sets the color and font
+ for the cursor
+ {group-name}/{group-name}
+ Two highlight group names, the first is used when
+ no language mappings are used, the other when they
+ are. |language-mapping|
+
+ Examples of parts:
+ n-c-v:block-nCursor in Normal, Command-line and Visual mode, use a
+ block cursor with colors from the "nCursor"
+ highlight group
+ i-ci:ver30-iCursor-blinkwait300-blinkon200-blinkoff150
+ In Insert and Command-line Insert mode, use a
+ 30% vertical bar cursor with colors from the
+ "iCursor" highlight group. Blink a bit
+ faster.
+
+ The 'a' mode is different. It will set the given argument-list for
+ all modes. It does not reset anything to defaults. This can be used
+ to do a common setting for all modes. For example, to switch off
+ blinking: "a:blinkon0"
+
+ Examples of cursor highlighting: >
+ :highlight Cursor gui=reverse guifg=NONE guibg=NONE
+ :highlight Cursor gui=NONE guifg=bg guibg=fg
+<
+ *'guifont'* *'gfn'*
+ *E235* *E596* *E610* *E611*
+'guifont' 'gfn' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled}
+ This is a list of fonts which will be used for the GUI version of Vim.
+ In its simplest form the value is just one font name. When
+ the font cannot be found you will get an error message. To try other
+ font names a list can be specified, font names separated with commas.
+ The first valid font is used.
+ When 'guifontset' is not empty, 'guifont' is not used.
+ Spaces after a comma are ignored. To include a comma in a font name
+ precede it with a backslash. Setting an option requires an extra
+ backslash before a space and a backslash. See also
+ |option-backslash|. For example: >
+ :set guifont=Screen15,\ 7x13,font\\,with\\,commas
+< will make vim try to use the font "Screen15" first, and if it fails it
+ will try to use "7x13" and then "font,with,commas" instead.
+ For the GTK+ 2 GUI the font name looks like this: >
+ :set guifont=Andale\ Mono\ 11
+< That's all. XLFDs are no longer accepted.
+ *E236*
+ Note that the fonts must be mono-spaced (all characters have the same
+ width).
+ To preview a font on X11, you might be able to use the "xfontsel"
+ program. The "xlsfonts" program gives a list of all available fonts.
+ For Win32, GTK and Photon only: >
+ :set guifont=*
+< will bring up a font requester, where you can pick the font you want.
+ If none of the fonts can be loaded, vim will keep the current setting.
+ If an empty font list is given, vim will try using other resource
+ settings (for X, it will use the Vim.font resource), and finally it
+ will try some builtin default which should always be there ("7x13" in
+ the case of X). The font names given should be "normal" fonts. Vim
+ will try to find the related bold and italic fonts.
+ For the Win32 GUI *E244* *E245*
+ - takes these options in the font name:
+ hXX - height is XX (points, can be floating-point)
+ wXX - width is XX (points, can be floating-point)
+ b - bold
+ i - italic
+ u - underline
+ s - strikeout
+ cXX - character set XX. valid charsets are: ANSI, ARABIC,
+ BALTIC, CHINESEBIG5, DEFAULT, EASTEUROPE, GB2312, GREEK,
+ HANGEUL, HEBREW, JOHAB, MAC, OEM, RUSSIAN, SHIFTJIS,
+ SYMBOL, THAI, TURKISH, VIETNAMESE ANSI and BALTIC.
+
+ Use a ':' to separate the options.
+ - A '_' can be used in the place of a space, so you don't need to use
+ backslashes to escape the spaces.
+ - Examples: >
+ :set guifont=courier_new:h12:w5:b:cRUSSIAN
+ :set guifont=Andale_Mono:h7.5:w4.5
+< See also |font-sizes|.
+
+ *'guifontset'* *'gfs'*
+ *E250* *E252* *E234* *E597* *E598*
+'guifontset' 'gfs' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled and
+ with the |+xfontset| feature}
+ {not available in the GTK+ 2 GUI}
+ When not empty, specifies two (or more) fonts to be used. The first
+ one for normal English, the second one for your special language. See
+ |xfontset|.
+ Setting this option also means that all font names will be handled as
+ a fontset name. Also the ones used for the "font" argument of the
+ |:highlight| command.
+ The fonts must match with the current locale. If fonts for the
+ character sets that the current locale uses are not included, setting
+ 'guifontset' will fail.
+ Note the difference between 'guifont' and 'guifontset': In 'guifont'
+ the comma-separated names are alternative names, one of which will be
+ used. In 'guifontset' the whole string is one fontset name,
+ including the commas. It is not possible to specify alternative
+ fontset names.
+ This example works on many X11 systems: >
+ :set guifontset=-*-*-medium-r-normal--16-*-*-*-c-*-*-*
+<
+ *'guifontwide'* *'gfw'* *E231* *E533* *E534*
+'guifontwide' 'gfw' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled}
+ When not empty, specifies a comma-separated list of fonts to be used
+ for double-width characters. The first font that can be loaded is
+ used.
+ Note: The size of these fonts must be exactly twice as wide as the one
+ specified with 'guifont' and the same height.
+
+ All GUI versions but GTK+ 2:
+
+ 'guifontwide' is only used when 'encoding' is set to "utf-8" and
+ 'guifontset' is empty or invalid.
+ When 'guifont' is set and a valid font is found in it and
+ 'guifontwide' is empty Vim will attempt to find a matching
+ double-width font and set 'guifontwide' to it.
+
+ GTK+ 2 GUI only: *guifontwide_gtk2*
+
+ If set and valid, 'guifontwide' is always used for double width
+ characters, even if 'encoding' is not set to "utf-8".
+ Vim does not attempt to find an appropriate value for 'guifontwide'
+ automatically. If 'guifontwide' is empty Pango/Xft will choose the
+ font for characters not available in 'guifont'. Thus you do not need
+ to set 'guifontwide' at all unless you want to override the choice
+ made by Pango/Xft.
+
+ *'guiheadroom'* *'ghr'*
+'guiheadroom' 'ghr' number (default 50)
+ global
+ {not in Vi} {only for GTK and X11 GUI}
+ The number of pixels subtracted from the screen height when fitting
+ the GUI window on the screen. Set this before the GUI is started,
+ e.g., in your |gvimrc| file. When zero, the whole screen height will
+ be used by the window. When positive, the specified number of pixel
+ lines will be left for window decorations and other items on the
+ screen. Set it to a negative value to allow windows taller than the
+ screen.
+
+ *'guioptions'* *'go'*
+'guioptions' 'go' string (default "gmrLtT" (MS-Windows),
+ "agimrLtT" (GTK, Motif and Athena)
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled}
+ This option only has an effect in the GUI version of vim. It is a
+ sequence of letters which describes what components and options of the
+ GUI should be used.
+ To avoid problems with flags that are added in the future, use the
+ "+=" and "-=" feature of ":set" |add-option-flags|.
+
+ Valid letters are as follows:
+ *guioptions_a*
+ 'a' Autoselect: If present, then whenever VISUAL mode is started,
+ or the Visual area extended, Vim tries to become the owner of
+ the windowing system's global selection. This means that the
+ Visually highlighted text is available for pasting into other
+ applications as well as into Vim itself. When the Visual mode
+ ends, possibly due to an operation on the text, or when an
+ application wants to paste the selection, the highlighted text
+ is automatically yanked into the "* selection register.
+ Thus the selection is still available for pasting into other
+ applications after the VISUAL mode has ended.
+ If not present, then Vim won't become the owner of the
+ windowing system's global selection unless explicitly told to
+ by a yank or delete operation for the "* register.
+ The same applies to the modeless selection.
+
+ 'A' Autoselect for the modeless selection. Like 'a', but only
+ applies to the modeless selection.
+
+ 'guioptions' autoselect Visual autoselect modeless ~
+ "" - -
+ "a" yes yes
+ "A" - yes
+ "aA" yes yes
+
+ 'c' Use console dialogs instead of popup dialogs for simple
+ choices.
+
+ 'f' Foreground: Don't use fork() to detach the GUI from the shell
+ where it was started. Use this for programs that wait for the
+ editor to finish (e.g., an e-mail program). Alternatively you
+ can use "gvim -f" or ":gui -f" to start the GUI in the
+ foreground. |gui-fork|
+ Note: Set this option in the vimrc file. The forking may have
+ happened already when the gvimrc file is read.
+
+ 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
+ corner of the window. It's black&white on non-GTK, because of
+ limitations of X11. For a color icon, see |X11-icon|.
+
+ 'm' Menu bar is present.
+ 'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note
+ that this flag must be added in the .vimrc file, before
+ switching on syntax or filetype recognition (when the .gvimrc
+ file is sourced the system menu has already been loaded; the
+ ":syntax on" and ":filetype on" commands load the menu too).
+ 'g' Grey menu items: Make menu items that are not active grey. If
+ 'g' is not included inactive menu items are not shown at all.
+ Exception: Athena will always use grey menu items.
+
+ 't' Include tearoff menu items. Currently only works for Win32,
+ GTK+, and Motif 1.2 GUI.
+ 'T' Include Toolbar. Currently only in Win32, GTK+, Motif, and
+ Athena GUIs.
+
+ 'r' Right-hand scrollbar is always present.
+ 'R' Right-hand scrollbar is present when there is a vertically
+ split window.
+ 'l' Left-hand scrollbar is always present.
+ 'L' Left-hand scrollbar is present when there is a vertically
+ split window.
+ 'b' Bottom (horizontal) scrollbar is present. Its size depends on
+ the longest visible line, or on the cursor line if the 'h'
+ flag is included. |gui-horiz-scroll|
+ 'h' Limit horizontal scrollbar size to the length of the cursor
+ line. Reduces computations. |gui-horiz-scroll|
+
+ And yes, you may even have scrollbars on the left AND the right if
+ you really want to :-). See |gui-scrollbars| for more information.
+
+ 'v' Use a vertical button layout for dialogs. When not included,
+ a horizontal layout is preferred, but when it doesn't fit a
+ vertical layout is used anyway.
+ 'p' Use Pointer callbacks for X11 GUI. This is required for some
+ window managers. If the cursor is not blinking or hollow at
+ the right moment, try adding this flag. This must be done
+ before starting the GUI. Set it in your gvimrc. Adding or
+ removing it after the GUI has started has no effect.
+ 'F' Add a footer. Only for Motif. See |gui-footer|.
+
+ *'guipty'* *'noguipty'*
+'guipty' boolean (default on)
+ global
+ {not in Vi}
+ {only available when compiled with GUI enabled}
+ Only in the GUI: If on, an attempt is made to open a pseudo-tty for
+ I/O to/from shell commands. See |gui-pty|.
+
+ *'helpfile'* *'hf'*
+'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt"
+ (others) "$VIMRUNTIME/doc/help.txt")
+ global
+ {not in Vi}
+ Name of the main help file. All distributed help files should be
+ placed together in one directory. Additionally, all "doc" directories
+ in 'runtimepath' will be used.
+ Environment variables are expanded |:set_env|. For example:
+ "$VIMRUNTIME/doc/help.txt". If $VIMRUNTIME is not set, $VIM is also
+ tried. Also see |$VIMRUNTIME| and |option-backslash| about including
+ spaces and backslashes.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'helpheight'* *'hh'*
+'helpheight' 'hh' number (default 20)
+ global
+ {not in Vi}
+ {not available when compiled without the +windows
+ feature}
+ Minimal initial height of the help window when it is opened with the
+ ":help" command. The initial height of the help window is half of the
+ current window, or (when the 'ea' option is on) the same as other
+ windows. When the height is less than 'helpheight', the height is
+ set to 'helpheight'. Set to zero to disable.
+
+ *'helplang'* *'hlg'*
+'helplang' 'hlg' string (default: messages language or empty)
+ global
+ {only available when compiled with the |+multi_lang|
+ feature}
+ {not in Vi}
+ Comma separated list of languages. Vim will use the first language
+ for which the desired help can be found. The English help will always
+ be used as a last resort. You can add "en" to prefer English over
+ another language, but that will only find tags that exist in that
+ language and not in the English help.
+ Example: >
+ :set helplang=de,it
+< This will first search German, then Italian and finally English help
+ files.
+ When using |CTRL-]| and ":help!" in a non-English help file Vim will
+ try to find the tag in the current language before using this option.
+ See |help-translated|.
+
+ *'hidden'* *'hid'* *'nohidden'* *'nohid'*
+'hidden' 'hid' boolean (default off)
+ global
+ {not in Vi}
+ When off a buffer is unloaded when it is |abandon|ed. When on a
+ buffer becomes hidden when it is |abandon|ed. If the buffer is still
+ displayed in another window, it does not become hidden, of course.
+ The commands that move through the buffer list sometimes make a buffer
+ hidden although the 'hidden' option is off: When the buffer is
+ modified, 'autowrite' is off or writing is not possible, and the '!'
+ flag was used. See also |windows.txt|.
+ This option is set for one command with ":hide {command}" |:hide|.
+ WARNING: It's easy to forget that you have changes in hidden buffers.
+ Think twice when using ":q!" or ":qa!".
+
+ *'highlight'* *'hl'*
+'highlight' 'hl' string (default (as a single string):
+ "8:SpecialKey,@:NonText,d:Directory,
+ e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,
+ M:ModeMsg,n:LineNr,r:Question,
+ s:StatusLine,S:StatusLineNC,c:VertSplit
+ t:Title,v:Visual,w:WarningMsg,W:WildMenu,
+ f:Folded,F:FoldColumn,A:DiffAdd,
+ C:DiffChange,D:DiffDelete,T:DiffText,
+ >:SignColumn")
+ global
+ {not in Vi}
+ This option can be used to set highlighting mode for various
+ occasions. It is a comma separated list of character pairs. The
+ first character in a pair gives the occasion, the second the mode to
+ use for that occasion. The occasions are:
+ |hl-SpecialKey| 8 Meta and special keys listed with ":map"
+ |hl-NonText| @ '~' and '@' at the end of the window and
+ characters from 'showbreak'
+ |hl-Directory| d directories in CTRL-D listing and other special
+ things in listings
+ |hl-ErrorMsg| e error messages
+ h (obsolete, ignored)
+ |hl-IncSearch| i 'incsearch' highlighting
+ |hl-Search| l last search pattern highlighting (see 'hlsearch')
+ |hl-MoreMsg| m |more-prompt|
+ |hl-ModeMsg| M Mode (e.g., "-- INSERT --")
+ |hl-LineNr| n line number for ":number" and ":#" commands
+ |hl-Question| r |hit-enter| prompt and yes/no questions
+ |hl-StatusLine| s status line of current window |status-line|
+ |hl-StatusLineNC| S status lines of not-current windows
+ |hl-Title| t Titles for output from ":set all", ":autocmd" etc.
+ |hl-VertSplit| c column used to separate vertically split windows
+ |hl-Visual| v Visual mode
+ |hl-VisualNOS| V Visual mode when Vim does is "Not Owning the
+ Selection" Only X11 Gui's |gui-x11| and
+ |xterm-clipboard|.
+ |hl-WarningMsg| w warning messages
+ |hl-WildMenu| W wildcard matches displayed for 'wildmenu'
+ |hl-Folded| f line used for closed folds
+ |hl-FoldColumn| F 'foldcolumn'
+ |hl-SignColumn| > column used for |signs|
+
+ The display modes are:
+ r reverse (termcap entry "mr" and "me")
+ i italic (termcap entry "ZH" and "ZR")
+ b bold (termcap entry "md" and "me")
+ s standout (termcap entry "so" and "se")
+ u underline (termcap entry "us" and "ue")
+ n no highlighting
+ - no highlighting
+ : use a highlight group
+ The default is used for occasions that are not included.
+ If you want to change what the display modes do, see |dos-colors|
+ for an example.
+ When using the ':' display mode, this must be followed by the name of
+ a highlight group. A highlight group can be used to define any type
+ of highlighting, including using color. See |:highlight| on how to
+ define one. The default uses a different group for each occasion.
+ See |highlight-default| for the default highlight groups.
+
+ *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
+'hlsearch' 'hls' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+extra_search| feature}
+ When there is a previous search pattern, highlight all its matches.
+ The type of highlighting used can be set with the 'l' occasion in the
+ 'highlight' option. This uses the "Search" highlight group by
+ default. Note that only the matching text is highlighted, any offsets
+ are not applied.
+ See also: 'incsearch' and |:match|.
+ When you get bored looking at the highlighted matches, you can turn it
+ off with |:nohlsearch|. As soon as you use a search command, the
+ highlighting comes back.
+ When the search pattern can match an end-of-line, Vim will try to
+ highlight all of the matched text. However, this depends on where the
+ search starts. This will be the first line in the window or the first
+ line below a closed fold. A match in a previous line which is not
+ drawn may not continue in an newly drawn line.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'history'* *'hi'*
+'history' 'hi' number (Vim default: 20, Vi default: 0)
+ global
+ {not in Vi}
+ A history of ":" commands, and a history of previous search patterns
+ are remembered. This option decides how many entries may be stored in
+ each of these histories (see |cmdline-editing|).
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'hkmap'* *'hk'* *'nohkmap'* *'nohk'*
+'hkmap' 'hk' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ When on, the keyboard is mapped for the Hebrew character set.
+ Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
+ toggle this option. See |rileft.txt|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'hkmapp'* *'hkp'* *'nohkmapp'* *'nohkp'*
+'hkmapp' 'hkp' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ When on, phonetic keyboard mapping is used. 'hkmap' must also be on.
+ This is useful if you have a non-Hebrew keyboard.
+ See |rileft.txt|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'icon'* *'noicon'*
+'icon' boolean (default off, on when title can be restored)
+ global
+ {not in Vi}
+ {not available when compiled without the |+title|
+ feature}
+ When on, the icon text of the window will be set to the value of
+ 'iconstring' (if it is not empty), or to the name of the file
+ currently being edited. Only the last part of the name is used.
+ Overridden by the 'iconstring' option.
+ Only works if the terminal supports setting window icons (currently
+ only X11 GUI and terminals with a non-empty 't_IS' option - these are
+ Unix xterm and iris-ansi by default, where 't_IS' is taken from the
+ builtin termcap).
+ When Vim was compiled with HAVE_X11 defined, the original icon will be
+ restored if possible |X11|. See |X11-icon| for changing the icon on
+ X11.
+
+ *'iconstring'*
+'iconstring' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+title|
+ feature}
+ When this option is not empty, it will be used for the icon text of
+ the window. This happens only when the 'icon' option is on.
+ Only works if the terminal supports setting window icon text
+ (currently only X11 GUI and terminals with a non-empty 't_IS' option).
+ Does not work for MS Windows.
+ When Vim was compiled with HAVE_X11 defined, the original icon will be
+ restored if possible |X11|.
+ When this option contains printf-style '%' items, they will be
+ expanded according to the rules used for 'statusline'. See
+ 'titlestring' for example settings.
+ {not available when compiled without the |+statusline| feature}
+
+ *'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
+'ignorecase' 'ic' boolean (default off)
+ global
+ Ignore case in search patterns. Also used when searching in the tags
+ file.
+ Also see 'smartcase'.
+ Can be overruled by using "\c" or "\C" in the pattern, see
+ |/ignorecase|.
+
+ *'imactivatekey'* *'imak'*
+'imactivatekey' 'imak' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with |+xim| and
+ |+GUI_GTK|}
+ Specifies the key that your Input Method in X-Windows uses for
+ activation. When this is specified correctly, vim can fully control
+ IM with 'imcmdline', 'iminsert' and 'imsearch'.
+ You can't use this option to change the activation key, the option
+ tells Vim what the key is.
+ Format:
+ [MODIFIER_FLAG-]KEY_STRING
+
+ These characters can be used for MODIFIER_FLAG (case is ignored):
+ S Shift key
+ L Lock key
+ C Control key
+ 1 Mod1 key
+ 2 Mod2 key
+ 3 Mod3 key
+ 4 Mod4 key
+ 5 Mod5 key
+ Combinations are allowed, for example "S-C-space" or "SC-space" are
+ both shift+ctrl+space.
+ See <X11/keysymdef.h> and XStringToKeysym for KEY_STRING.
+
+ Example: >
+ :set imactivatekey=S-space
+< "S-space" means shift+space. This is the activation key for kinput2 +
+ canna (Japanese), and ami (Korean).
+
+ *'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
+'imcmdline' 'imc' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+xim|
+ |+multi_byte_ime| or |global-ime| feature}
+ When set the Input Method is always on when starting to edit a command
+ line, unless entering a search pattern (see 'imsearch' for that).
+ Setting this option is useful when your input method allows entering
+ English characters directly, e.g., when it's used to type accented
+ characters with dead keys.
+
+ *'imdisable'* *'imd'* *'nodisable'* *'noimd'*
+'imdisable' 'imd' boolean (default off, on for some systems (SGI))
+ global
+ {not in Vi}
+ {only available when compiled with the |+xim|
+ |+multi_byte_ime| or |global-ime| feature}
+ When set the Input Method is never used. This is useful to disable
+ the IM when it doesn't work properly.
+ Currently this option is on by default for SGI/IRIX machines. This
+ may change in later releases.
+
+ *'iminsert'* *'imi'*
+'iminsert' 'imi' number (default 0, 2 when an input method is supported)
+ local to buffer
+ {not in Vi}
+ Specifies whether :lmap or an Input Method (IM) is to be used in
+ Insert mode. Valid values:
+ 0 :lmap is off and IM is off
+ 1 :lmap is ON and IM is off
+ 2 :lmap is off and IM is ON
+ 2 is available only when compiled with the |+multi_byte_ime|, |+xim|
+ or |global-ime|.
+ To always reset the option to zero when leaving Insert mode with <Esc>
+ this can be used: >
+ :inoremap <ESC> <ESC>:set iminsert=0<CR>
+< This makes :lmap and IM turn off automatically when leaving Insert
+ mode.
+ Note that this option changes when using CTRL-^ in Insert mode
+ |i_CTRL-^|.
+ The value is set to 1 when setting 'keymap' to a valid keymap name.
+ It is also used for the argument of commands like "r" and "f".
+ The value 0 may not work correctly with Athena and Motif with some XIM
+ methods. Use 'imdisable' to disable XIM then.
+
+ *'imsearch'* *'ims'*
+'imsearch' 'ims' number (default 0, 2 when an input method is supported)
+ local to buffer
+ {not in Vi}
+ Specifies whether :lmap or an Input Method (IM) is to be used when
+ entering a search pattern. Valid values:
+ -1 the value of 'iminsert' is used, makes it look like
+ 'iminsert' is also used when typing a search pattern
+ 0 :lmap is off and IM is off
+ 1 :lmap is ON and IM is off
+ 2 :lmap is off and IM is ON
+ Note that this option changes when using CTRL-^ in Command-line mode
+ |c_CTRL-^|.
+ The value is set to 1 when it is not -1 and setting the 'keymap'
+ option to a valid keymap name.
+ The value 0 may not work correctly with Athena and Motif with some XIM
+ methods. Use 'imdisable' to disable XIM then.
+
+ *'include'* *'inc'*
+'include' 'inc' string (default "^\s*#\s*include")
+ global or local to buffer |global-local|
+ {not in Vi}
+ {not available when compiled without the
+ |+find_in_path| feature}
+ Pattern to be used to find an include command. It is a search
+ pattern, just like for the "/" command (See |pattern|). The default
+ value is for C programs. This option is used for the commands "[i",
+ "]I", "[d", etc.. The 'isfname' option is used to recognize the file
+ name that comes after the matched pattern. See |option-backslash|
+ about including spaces and backslashes.
+
+ *'includeexpr'* *'inex'*
+'includeexpr' 'inex' string (default "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the
+ |+find_in_path| or |+eval| feature}
+ Expression to be used to transform the string found with the 'include'
+ option to a file name. Mostly useful to change "." to "/" for Java: >
+ :set includeexpr=substitute(v:fname,'\\.','/','g')
+< The "v:fname" variable will be set to the file name that was detected.
+ Evaluated in the |sandbox|.
+ Also used for the |gf| command if an unmodified file name can't be
+ found. Allows doing "gf" on the name after an 'include' statement.
+ Also used for |<cfile>|.
+
+ *'incsearch'* *'is'* *'noincsearch'* *'nois'*
+'incsearch' 'is' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+extra_search| feature}
+ While typing a search command, show immediately where the so far
+ typed pattern matches. The matched string is highlighted. If the
+ pattern is invalid or not found, nothing is shown. The screen will
+ be updated often, this is only useful on fast terminals. Note that
+ the match will be shown, but the cursor is not actually positioned
+ there. You still need to finish the search command with <CR> to move
+ the cursor. The highlighting can be set with the 'i' flag in
+ 'highlight'. See also: 'hlsearch'.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'indentexpr'* *'inde'*
+'indentexpr' 'inde' string (default "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+cindent|
+ or |+eval| features}
+ Expression which is evaluated to obtain the proper indent for a line.
+ It is used when a new line is created, for the |=| operator and
+ in Insert mode as specified with the 'indentkeys' option.
+ When this option is not empty, it overrules the 'cindent' and
+ 'smartindent' indenting.
+ When 'paste' is set this option is not used for indenting.
+ The expression is evaluated with |v:lnum| set to the line number for
+ which the indent is to be computed. The cursor is also as this line
+ when the expression is evaluated (but it may be moved around).
+ The expression must return the number of spaces worth of indent. It
+ can return "-1" to keep the current indent (this means 'autoindent' is
+ used for the indent).
+ Functions useful for computing the indent are |indent()|, |cindent()|
+ and |lispindent()|.
+ The evaluation of the expression must not have side effects! It must
+ not change the text, jump to another window, etc. Afterwards the
+ cursor position is always restored, thus the cursor may be moved.
+ Normally this option would be set to call a function: >
+ :set indentexpr=GetMyIndent()
+< Error messages will be suppressed, unless the 'debug' option contains
+ "msg".
+ See |indent-expression|. Also see |eval-sandbox|.
+ NOTE: This option is made empty when 'compatible' is set.
+
+ *'indentkeys'* *'indk'*
+'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+cindent|
+ feature}
+ A list of keys that, when typed in Insert mode, cause reindenting of
+ the current line. Only happens if 'indentexpr' isn't empty.
+ The format is identical to 'cinkeys', see |indentkeys-format|.
+ See |C-indenting| and |indent-expression|.
+
+ *'infercase'* *'inf'* *'noinfercase'* *'noinf'*
+'infercase' 'inf' boolean (default off)
+ local to buffer
+ {not in Vi}
+ When doing keyword completion in insert mode |ins-completion|, and
+ 'ignorecase' is also on, the case of the match is adjusted. If the
+ typed text contains a lowercase letter where the match has an upper
+ case letter, the completed part is made lowercase. If the typed text
+ has no lowercase letters and the match has a lowercase letter where
+ the typed text has an uppercase letter, and there is a letter before
+ it, the completed part is made uppercase.
+
+ *'insertmode'* *'im'* *'noinsertmode'* *'noim'*
+'insertmode' 'im' boolean (default off)
+ global
+ {not in Vi}
+ Makes Vim work in a way that Insert mode is the default mode. Useful
+ if you want to use Vim as a modeless editor. Used for |evim|.
+ These Insert mode commands will be useful:
+ - Use the cursor keys to move around.
+ - Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When
+ this is a mapping, it is executed as if 'insertmode' was off.
+ Normal mode remains active until the mapping is finished.
+ *i_CTRL-L*
+ - Use CTRL-L to execute a number of Normal mode commands, then use
+ <Esc> to get back to Insert mode.
+
+ These items change when 'insertmode' is set:
+ - when starting to edit of a file, Vim goes to Insert mode.
+ - <Esc> in Insert mode is a no-op and beeps.
+ - <Esc> in Normal mode makes Vim go to Insert mode.
+ - CTRL-L in Insert mode is a command, it is not inserted.
+ - CTRL-Z in Insert mode suspends Vim, see |CTRL-Z|. *i_CTRL-Z*
+ However, when <Esc> is used inside a mapping, it behaves like
+ 'insertmode' was not set. This was done to be able to use the same
+ mappings with 'insertmode' set or not set.
+ When executing commands with |:normal| 'insertmode' is not used.
+
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'isfname'* *'isf'*
+'isfname' 'isf' string (default for MS-DOS, Win32 and OS/2:
+ "@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
+ for AMIGA: "@,48-57,/,.,-,_,+,,,$,:"
+ for VMS: "@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~"
+ for OS/390: "@,240-249,/,.,-,_,+,,,#,$,%,~,="
+ otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=")
+ global
+ {not in Vi}
+ The characters specified by this option are included in file names and
+ path names. Filenames are used for commands like "gf", "[i" and in
+ the tags file. It is also used for "\f" in a |pattern|.
+ Multi-byte characters 256 and above are always included, only the
+ characters up to 255 are specified with this option.
+ For UTF-8 the characters 0xa0 to 0xff are included as well.
+
+ Note that on systems using a backslash as path separator, Vim tries to
+ do its best to make it work as you would expect. That is a bit
+ tricky, since Vi originally used the backslash to escape special
+ characters. Vim will not remove a backslash in front of a normal file
+ name character on these systems, but it will on Unix and alikes. The
+ '&' and '^' are not included by default, because these are special for
+ cmd.exe.
+
+ The format of this option is a list of parts, separated with commas.
+ Each part can be a single character number or a range. A range is two
+ character numbers with '-' in between. A character number can be a
+ decimal number between 0 and 255 or the ASCII character itself (does
+ not work for digits). Example:
+ "_,-,128-140,#-43" (include '_' and '-' and the range
+ 128 to 140 and '#' to 43)
+ If a part starts with '^', the following character number or range
+ will be excluded from the option. The option is interpreted from left
+ to right. Put the excluded character after the range where it is
+ included. To include '^' itself use it as the last character of the
+ option or the end of a range. Example:
+ "^a-z,#,^" (exclude 'a' to 'z', include '#' and '^')
+ If the character is '@', all characters where isalpha() returns TRUE
+ are included. Normally these are the characters a to z and A to Z,
+ plus accented characters. To include '@' itself use "@-@". Examples:
+ "@,^a-z" All alphabetic characters, excluding lower
+ case letters.
+ "a-z,A-Z,@-@" All letters plus the '@' character.
+ A comma can be included by using it where a character number is
+ expected. Example:
+ "48-57,,,_" Digits, comma and underscore.
+ A comma can be excluded by prepending a '^'. Example:
+ " -~,^,,9" All characters from space to '~', excluding
+ comma, plus <Tab>.
+ See |option-backslash| about including spaces and backslashes.
+
+ *'isident'* *'isi'*
+'isident' 'isi' string (default for MS-DOS, Win32 and OS/2:
+ "@,48-57,_,128-167,224-235"
+ otherwise: "@,48-57,_,192-255")
+ global
+ {not in Vi}
+ The characters given by this option are included in identifiers.
+ Identifiers are used in recognizing environment variables and after a
+ match of the 'define' option. It is also used for "\i" in a
+ |pattern|. See 'isfname' for a description of the format of this
+ option.
+ Careful: If you change this option, it might break expanding
+ environment variables. E.g., when '/' is included and Vim tries to
+ expand "$HOME/.viminfo". Maybe you should change 'iskeyword' instead.
+
+ *'iskeyword'* *'isk'*
+'iskeyword' 'isk' string (Vim default for MS-DOS and Win32:
+ "@,48-57,_,128-167,224-235"
+ otherwise: "@,48-57,_,192-255"
+ Vi default: "@,48-57,_")
+ local to buffer
+ {not in Vi}
+ Keywords are used in searching and recognizing with many commands:
+ "w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
+ 'isfname' for a description of the format of this option. For C
+ programs you could use "a-z,A-Z,48-57,_,.,-,>".
+ For a help file it is set to all non-blank printable characters except
+ '*', '"' and '|' (so that CTRL-] on a command finds the help for that
+ command).
+ When the 'lisp' option is on the '-' character is always included.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'isprint'* *'isp'*
+'isprint' 'isp' string (default for MS-DOS, Win32, OS/2 and Macintosh:
+ "@,~-255"; otherwise: "@,161-255")
+ global
+ {not in Vi}
+ The characters given by this option are displayed directly on the
+ screen. It is also used for "\p" in a |pattern|. The characters from
+ space (ASCII 32) to '~' (ASCII 126) are always displayed directly,
+ even when they are not included in 'isprint' or excluded. See
+ 'isfname' for a description of the format of this option.
+
+ Non-printable characters are displayed with two characters:
+ 0 - 31 "^@" - "^_"
+ 32 - 126 always single characters
+ 127 "^?"
+ 128 - 159 "~@" - "~_"
+ 160 - 254 "| " - "|~"
+ 255 "~?"
+ When 'encoding' is a Unicode one, illegal bytes from 128 to 255 are
+ displayed as <xx>, with the hexadecimal value of the byte.
+ When 'display' contains "uhex" all unprintable characters are
+ displayed as <xx>.
+ The NonText highlighting will be used for unprintable characters.
+ |hl-NonText|
+
+ Multi-byte characters 256 and above are always included, only the
+ characters up to 255 are specified with this option. When a character
+ is printable but it is not available in the current font, a
+ replacement character will be shown.
+ Unprintable and zero-width Unicode characters are displayed as <xxxx>.
+ There is no option to specify these characters.
+
+ *'joinspaces'* *'js'* *'nojoinspaces'* *'nojs'*
+'joinspaces' 'js' boolean (default on)
+ global
+ {not in Vi}
+ Insert two spaces after a '.', '?' and '!' with a join command.
+ When 'cpoptions' includes the 'j' flag, only do this after a '.'.
+ Otherwise only one space is inserted.
+ NOTE: This option is set when 'compatible' is set.
+
+ *'key'*
+'key' string (default "")
+ local to buffer
+ {not in Vi}
+ The key that is used for encrypting and decrypting the current buffer.
+ See |encryption|.
+ Careful: Do not set the key value by hand, someone might see the typed
+ key. Use the |:X| command. But you can make 'key' empty: >
+ :set key=
+< It is not possible to get the value of this option with ":set key" or
+ "echo &key". This is to avoid showing it to someone who shouldn't
+ know. It also means you cannot see it yourself once you have set it,
+ be careful not to make a typing error!
+
+ *'keymap'* *'kmp'* *E544*
+'keymap' 'kmp' string (default "")
+ local to buffer
+ {not in Vi}
+ {only available when compiled with the |+keymap|
+ feature}
+ Name of a keyboard mapping. See |mbyte-keymap|.
+ Setting this option to a valid keymap name has the side effect of
+ setting 'iminsert' to one, so that the keymap becomes effective.
+ 'imsearch' is also set to one, unless it was -1
+
+ *'keymodel'* *'km'*
+'keymodel' 'km' string (default "")
+ global
+ {not in Vi}
+ List of comma separated words, which enable special things that keys
+ can do. These values can be used:
+ startsel Using a shifted special key starts selection (either
+ Select mode or Visual mode, depending on "key" being
+ present in 'selectmode').
+ stopsel Using a not-shifted special key stops selection.
+ Special keys in this context are the cursor keys, <End>, <Home>,
+ <PageUp> and <PageDown>.
+ The 'keymodel' option is set by the |:behave| command.
+
+ *'keywordprg'* *'kp'*
+'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
+ OS/2: "view /", VMS: "help")
+ global or local to buffer |global-local|
+ {not in Vi}
+ Program to use for the |K| command. Environment variables are
+ expanded |:set_env|. ":help" may be used to access the Vim internal
+ help. (Note that previously setting the global option to the empty
+ value did this, which is now deprecated.)
+ When "man" is used, Vim will automatically translate a count for the
+ "K" command to a section number. Also for "man -s", in which case the
+ "-s" is removed when there is no count.
+ See |option-backslash| about including spaces and backslashes.
+ Example: >
+ :set keywordprg=man\ -s
+< This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'langmap'* *'lmap'* *E357* *E358*
+'langmap' 'lmap' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with the |+langmap|
+ feature}
+ This option allows switching your keyboard into a special language
+ mode. When you are typing text in Insert mode the characters are
+ inserted directly. When in command mode the 'langmap' option takes
+ care of translating these special characters to the original meaning
+ of the key. This means you don't have to change the keyboard mode to
+ be able to execute Normal mode commands.
+ This is the opposite of the 'keymap' option, where characters are
+ mapped in Insert mode.
+ This only works for 8-bit characters. The value of 'langmap' may be
+ specified with multi-byte characters (e.g., UTF-8), but only the lower
+ 8 bits of each character will be used.
+
+ Example (for Greek): *greek* >
+ :set langmap=ÁA,ÂB,ØC,ÄD,ÅE,ÖF,ÃG,ÇH,ÉI,ÎJ,ÊK,ËL,ÌM,ÍN,ÏO,ÐP,QQ,ÑR,ÓS,ÔT,ÈU,ÙV,WW,×X,ÕY,ÆZ,áa,âb,øc,äd,åe,öf,ãg,çh,éi,îj,êk,ël,ìm,ín,ïo,ðp,qq,ñr,ós,ôt,èu,ùv,òw,÷x,õy,æz
+< Example (exchanges meaning of z and y for commands): >
+ :set langmap=zy,yz,ZY,YZ
+<
+ The 'langmap' option is a list of parts, separated with commas. Each
+ part can be in one of two forms:
+ 1. A list of pairs. Each pair is a "from" character immediately
+ followed by the "to" character. Examples: "aA", "aAbBcC".
+ 2. A list of "from" characters, a semi-colon and a list of "to"
+ characters. Example: "abc;ABC"
+ Example: "aA,fgh;FGH,cCdDeE"
+ Special characters need to be preceded with a backslash. These are
+ ";", ',' and backslash itself.
+
+ This will allow you to activate vim actions without having to switch
+ back and forth between the languages. Your language characters will
+ be understood as normal vim English characters (according to the
+ langmap mappings) in the following cases:
+ o Normal/Visual mode (commands, buffer/register names, user mappings)
+ o Insert/Replace Mode: Register names after CTRL-R
+ o Insert/Replace Mode: Mappings
+ Characters entered in Command-line mode will NOT be affected by
+ this option. Note that this option can be changed at any time
+ allowing to switch between mappings for different languages/encodings.
+ Use a mapping to avoid having to type it each time!
+
+ *'langmenu'* *'lm'*
+'langmenu' 'lm' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with the |+menu| and
+ |+multi_lang| features}
+ Language to use for menu translation. Tells which file is loaded
+ from the "lang" directory in 'runtimepath': >
+ "lang/menu_" . &langmenu . ".vim"
+< (without the spaces). For example, to always use the Dutch menus, no
+ matter what $LANG is set to: >
+ :set langmenu=nl_NL.ISO_8859-1
+< When 'langmenu' is empty, |v:lang| is used.
+ If your $LANG is set to a non-English language but you do want to use
+ the English menus: >
+ :set langmenu=none
+< This option must be set before loading menus, switching on filetype
+ detection or syntax highlighting. Once the menus are defined setting
+ this option has no effect. But you could do this: >
+ :source $VIMRUNTIME/delmenu.vim
+ :set langmenu=de_DE.ISO_8859-1
+ :source $VIMRUNTIME/menu.vim
+< Warning: This deletes all menus that you defined yourself!
+
+ *'laststatus'* *'ls'*
+'laststatus' 'ls' number (default 1)
+ global
+ {not in Vi}
+ The value of this option influences when the last window will have a
+ status line:
+ 0: never
+ 1: only if there are at least two windows
+ 2: always
+ The screen looks nicer with a status line if you have several
+ windows, but it takes another screen line. |status-line|
+
+ *'lazyredraw'* *'lz'* *'nolazyredraw'* *'nolz'*
+'lazyredraw' 'lz' boolean (default off)
+ global
+ {not in Vi}
+ When this option is set, the screen will not be redrawn while
+ executing macros, registers and other commands that have not been
+ typed. Also, updating the window title is postponed. To force an
+ update use |:redraw|.
+
+ *'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'*
+'linebreak' 'lbr' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+linebreak|
+ feature}
+ If on Vim will wrap long lines at a character in 'breakat' rather
+ than at the last character that fits on the screen. Unlike
+ 'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file,
+ it only affects the way the file is displayed, not its contents. The
+ value of 'showbreak' is used to put in front of wrapped lines.
+ This option is not used when the 'wrap' option is off or 'list' is on.
+ Note that <Tab> characters after an <EOL> are mostly not displayed
+ with the right amount of white space.
+
+ *'lines'* *E593*
+'lines' number (default 24 or terminal height)
+ global
+ Number of lines of the Vim window.
+ Normally you don't need to set this. It is done automatically by the
+ terminal initialization code.
+ When Vim is running in the GUI or in a resizable window, setting this
+ option will cause the window size to be changed. When you only want
+ to use the size for the GUI, put the command in your |gvimrc| file.
+ Vim limits the number of lines to what fits on the screen. You can
+ use this command to get the tallest window possible: >
+ :set lines=999
+< If you get less lines than expected, check the 'guiheadroom' option.
+ When you set this option and Vim is unable to change the physical
+ number of lines of the display, the display may be messed up.
+
+ *'linespace'* *'lsp'*
+'linespace' 'lsp' number (default 0, 1 for Win32 GUI)
+ global
+ {not in Vi}
+ {only in the GUI}
+ Number of pixel lines inserted between characters. Useful if the font
+ uses the full character cell height, making lines touch each other.
+ When non-zero there is room for underlining.
+
+ *'lisp'* *'nolisp'*
+'lisp' boolean (default off)
+ local to buffer
+ {not available when compiled without the |+lispindent|
+ feature}
+ Lisp mode: When <Enter> is typed in insert mode set the indent for
+ the next line to Lisp standards (well, sort of). Also happens with
+ "cc" or "S". 'autoindent' must also be on for this to work. The 'p'
+ flag in 'cpoptions' changes the method of indenting: Vi compatible or
+ better. Also see 'lispwords'.
+ The '-' character is included in keyword characters. Redefines the
+ "=" operator to use this same indentation algorithm rather than
+ calling an external program if 'equalprg' is empty.
+ This option is not used when 'paste' is set.
+ {Vi: Does it a little bit differently}
+
+ *'lispwords'* *'lw'*
+'lispwords' 'lw' string (default is very long)
+ global
+ {not in Vi}
+ {not available when compiled without the |+lispindent|
+ feature}
+ Comma separated list of words that influence the Lisp indenting.
+ |'lisp'|
+
+ *'list'* *'nolist'*
+'list' boolean (default off)
+ local to window
+ List mode: Show tabs as CTRL-I, show end of line with $. Useful to
+ see the difference between tabs and spaces and for trailing blanks.
+ Note that this will also affect formatting (set with 'textwidth' or
+ 'wrapmargin') when 'cpoptions' includes 'L'. See 'listchars' for
+ changing the way tabs are displayed.
+
+ *'listchars'* *'lcs'*
+'listchars' 'lcs' string (default "eol:$")
+ global
+ {not in Vi}
+ Strings to use in 'list' mode. It is a comma separated list of string
+ settings.
+ eol:c Character to show at the end of each line. When
+ omitted, there is no extra character at the end of the
+ line.
+ tab:xy Two characters to be used to show a Tab. The first
+ char is used once. The second char is repeated to
+ fill the space that the Tab normally occupies.
+ "tab:>-" will show a Tab that takes four spaces as
+ ">---". When omitted, a Tab is show as ^I.
+ trail:c Character to show for trailing spaces. When omitted,
+ trailing spaces are blank.
+ extends:c Character to show in the last column, when 'wrap' is
+ off and the line continues beyond the right of the
+ screen.
+ precedes:c Character to show in the first column, when 'wrap'
+ is off and there is text preceding the character
+ visible in the first column.
+
+ The characters ':' and ',' should not be used. UTF-8 characters can
+ be used when 'encoding' is "utf-8", otherwise only printable
+ characters are allowed.
+
+ Examples: >
+ :set lcs=tab:>-,trail:-
+ :set lcs=tab:>-,eol:<
+ :set lcs=extends:>,precedes:<
+< The "NonText" highlighting will be used for "eol", "extends" and
+ "precedes". "SpecialKey" for "tab" and "trail".
+
+ *'lpl'* *'nolpl'* *'loadplugins'* *'noloadplugins'*
+'loadplugins' 'lpl' boolean (default on)
+ global
+ {not in Vi}
+ When on the plugin scripts are loaded when starting up |load-plugins|.
+ This option can be reset in your |vimrc| file to disable the loading
+ of plugins.
+ Note that using the "-u NONE" and "--noplugin" command line arguments
+ reset this option. |-u| |--noplugin|
+
+ *'magic'* *'nomagic'*
+'magic' boolean (default on)
+ global
+ Changes the special characters that can be used in search patterns.
+ See |pattern|.
+ NOTE: To avoid portability problems with using patterns, always keep
+ this option at the default "on". Only switch it off when working with
+ old Vi scripts. In any other situation write patterns that work when
+ 'magic' is on.
+
+ *'makeef'* *'mef'*
+'makeef' 'mef' string (default: "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ Name of the errorfile for the |:make| command (see |:make_makeprg|)
+ and the |:grep| command.
+ When it is empty, an internally generated temp file will be used.
+ When "##" is included, it is replaced by a number to make the name
+ unique. This makes sure that the ":make" command doesn't overwrite an
+ existing file.
+ NOT used for the ":cf" command. See 'errorfile' for that.
+ Environment variables are expanded |:set_env|.
+ See |option-backslash| about including spaces and backslashes.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'makeprg'* *'mp'*
+'makeprg' 'mp' string (default "make", VMS: "MMS")
+ global or local to buffer |global-local|
+ {not in Vi}
+ Program to use for the ":make" command. See |:make_makeprg|. This
+ option may contain '%' and '#' characters, which are expanded like
+ when used in a command-line. Environment variables are expanded
+ |:set_env|. See |option-backslash| about including spaces and
+ backslashes. Note that a '|' must be escaped twice: once for ":set"
+ and once for the interpretation of a command. When you use a filter
+ called "myfilter" do it like this: >
+ :set makeprg=gmake\ \\\|\ myfilter
+< The placeholder "$*" can be given (even multiple times) to specify
+ where the arguments will be included, for example: >
+ :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
+< This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'matchpairs'* *'mps'*
+'matchpairs' 'mps' string (default "(:),{:},[:]")
+ local to buffer
+ {not in Vi}
+ Characters that form pairs. The |%| command jumps from one to the
+ other. Currently only single character pairs are allowed, and they
+ must be different. The characters must be separated by a colon. The
+ pairs must be separated by a comma. Example for including '<' and '>'
+ (HTML): >
+ :set mps+=<:>
+
+< A more exotic example, to jump between the '=' and ';' in an
+ assignment, useful for languages like C and Java: >
+ :au FileType c,cpp,java set mps+==:;
+
+< For a more advanced way of using "%", see the matchit.vim plugin in
+ the $VIMRUNTIME/macros directory. |add-local-help|
+
+ *'matchtime'* *'mat'*
+'matchtime' 'mat' number (default 5)
+ global
+ {not in Vi}{in Nvi}
+ Tenths of a second to show the matching paren, when 'showmatch' is
+ set. Note that this is not in milliseconds, like other options that
+ set a time. This is to be compatible with Nvi.
+
+ *'maxfuncdepth'* *'mfd'*
+'maxfuncdepth' 'mfd' number (default 100)
+ global
+ {not in Vi}
+ Maximum depth of function calls for user functions. This normally
+ catches endless recursion. When using a recursive function with
+ more depth, set 'maxfuncdepth' to a bigger number. But this will use
+ more memory, there is the danger of failing when memory is exhausted.
+ See also |:function|.
+
+ *'maxmapdepth'* *'mmd'* *E223*
+'maxmapdepth' 'mmd' number (default 1000)
+ global
+ {not in Vi}
+ Maximum number of times a mapping is done without resulting in a
+ character to be used. This normally catches endless mappings, like
+ ":map x y" with ":map y x". It still does not catch ":map g wg",
+ because the 'w' is used before the next mapping is done. See also
+ |key-mapping|.
+
+ *'maxmem'* *'mm'*
+'maxmem' 'mm' number (default between 256 to 5120 (system
+ dependent) or half the amount of memory
+ available)
+ global
+ {not in Vi}
+ Maximum amount of memory (in Kbyte) to use for one buffer. When this
+ limit is reached allocating extra memory for a buffer will cause
+ other memory to be freed. Maximum value 2000000. Use this to work
+ without a limit. Also see 'maxmemtot'.
+
+ *'maxmemtot'* *'mmt'*
+'maxmemtot' 'mmt' number (default between 2048 and 10240 (system
+ dependent) or half the amount of memory
+ available)
+ global
+ {not in Vi}
+ Maximum amount of memory (in Kbyte) to use for all buffers together.
+ Maximum value 2000000. Use this to work without a limit. Also see
+ 'maxmem'.
+
+ *'menuitems'* *'mis'*
+'menuitems' 'mis' number (default 25)
+ global
+ {not in Vi}
+ {not available when compiled without the |+menu|
+ feature}
+ Maximum number of items to use in a menu. Used for menus that are
+ generated from a list of items, e.g., the Buffers menu. Changing this
+ option has no direct effect, the menu must be refreshed first.
+
+ *'modeline'* *'ml'* *'nomodeline'* *'noml'*
+'modeline' 'ml' boolean (Vim default: on, Vi default: off)
+ local to buffer
+ *'modelines'* *'mls'*
+'modelines' 'mls' number (default 5)
+ global
+ {not in Vi}
+ If 'modeline' is on 'modelines' gives the number of lines that is
+ checked for set commands. If 'modeline' is off or 'modelines' is zero
+ no lines are checked. See |modeline|.
+ NOTE: 'modeline' is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'modifiable'* *'ma'* *'nomodifiable'* *'noma'*
+'modifiable' 'ma' boolean (default on)
+ local to buffer
+ {not in Vi} *E21*
+ When off the buffer contents cannot be changed. The 'fileformat' and
+ 'fileencoding' options also can't be changed.
+ Can be reset with the |-M| command line argument.
+
+ *'modified'* *'mod'* *'nomodified'* *'nomod'*
+'modified' 'mod' boolean (default off)
+ local to buffer
+ {not in Vi}
+ When on, the buffer is considered to be modified. This option is set
+ when:
+ 1. A change was made to the text since it was last written. Using the
+ |undo| command to go back to the original text will reset the
+ option. But undoing changes that were made before writing the
+ buffer will set the option again, since the text is different from
+ when it was written.
+ 2. 'fileformat' or 'fileencoding' is different from its original
+ value. The original value is set when the buffer is read or
+ written. A ":set nomodified" command also resets the original
+ values to the current values and the 'modified' option will be
+ reset.
+ When 'buftype' is "nowrite" or "nofile" this option may be set, but
+ will be ignored.
+
+ *'more'* *'nomore'*
+'more' boolean (Vim default: on, Vi default: off)
+ global
+ {not in Vi}
+ When on, listings pause when the whole screen is filled. You will get
+ the |more-prompt|. When this option is off there are no pauses, the
+ listing continues until finished.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'mouse'* *E538*
+'mouse' string (default "", "a" for GUI, MS-DOS and Win32)
+ global
+ {not in Vi}
+ Enable the use of the mouse. Only works for certain terminals
+ (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, and Linux console
+ with gpm). For using the mouse in the GUI, see |gui-mouse|.
+ The mouse can be enabled for different modes:
+ n Normal mode
+ v Visual mode
+ i Insert mode
+ c Command-line mode
+ h all previous modes when editing a help file
+ a all previous modes
+ r for |hit-enter| and |more-prompt| prompt
+ A auto-select in Visual mode
+ Normally you would enable the mouse in all four modes with: >
+ :set mouse=a
+< When the mouse is not enabled, the GUI will still use the mouse for
+ modeless selection. This doesn't move the text cursor.
+
+ See |mouse-using|. Also see |'clipboard'|.
+
+ Note: When enabling the mouse in a terminal, copy/paste will use the
+ "* register if there is access to an X-server. The xterm handling of
+ the mouse buttons can still be used by keeping the shift key pressed.
+ Also see the 'clipboard' option.
+
+ *'mousefocus'* *'mousef'* *'nomousefocus'* *'nomousef'*
+'mousefocus' 'mousef' boolean (default off)
+ global
+ {not in Vi}
+ {only works in the GUI}
+ The window that the mouse pointer is on is automatically activated.
+ When changing the window layout or window focus in another way, the
+ mouse pointer is moved to the window with keyboard focus. Off is the
+ default because it makes using the pull down menus a little goofy, as
+ a pointer transit may activate a window unintentionally.
+
+ *'mousehide'* *'mh'* *'nomousehide'* *'nomh'*
+'mousehide' 'mh' boolean (default on)
+ global
+ {not in Vi}
+ {only works in the GUI}
+ When on, the mouse pointer is hidden when characters are typed.
+ The mouse pointer is restored when the mouse is moved.
+
+ *'mousemodel'* *'mousem'*
+'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32)
+ global
+ {not in Vi}
+ Sets the model to use for the mouse. The name mostly specifies what
+ the right mouse button is used for:
+ extend Right mouse button extends a selection. This works
+ like in an xterm.
+ popup Right mouse button pops up a menu. The shifted left
+ mouse button extends a selection. This works like
+ with Microsoft Windows
+ popup_setpos Like "popup", but the cursor will be moved to the
+ position where the mouse was clicked, and thus the
+ selected operation will act upon the clicked object.
+ If clicking inside a selection, that selection will
+ be acted upon, ie. no cursor move. This implies of
+ course, that right clicking outside a selection will
+ end Visual mode.
+ Overview of what button does what for each model:
+ mouse extend popup(_setpos) ~
+ left click place cursor place cursor
+ left drag start selection start selection
+ shift-left search word extend selection
+ right click extend selection popup menu (place cursor)
+ right drag extend selection -
+ middle click paste paste
+
+ In the "popup" model the right mouse button produces a pop-up menu.
+ You need to define this first, see |popup-menu|.
+
+ Note that you can further refine the meaning of buttons with mappings.
+ See |gui-mouse-mapping|. But mappings are NOT used for modeless
+ selection (because that's handled in the GUI code directly).
+
+ The 'mousemodel' option is set by the |:behave| command.
+
+ *'mouseshape'* *'mouses'* *E547*
+'mouseshape' 'mouses' string (default "i:beam,r:beam,s:updown,sd:cross,
+ m:no,ml:up-arrow,v:rightup-arrow"
+ global
+ {not in Vi}
+ {only available when compiled with the |+mouseshape|
+ feature}
+ This option tells Vim what the mouse pointer should look like in
+ different modes. The option is a comma separated list of parts, much
+ like used for 'guicursor'. Each part consist of a mode/location-list
+ and an argument-list:
+ mode-list:shape,mode-list:shape,..
+ The mode-list is a dash separated list of these modes/locations:
+ In a normal window: ~
+ n Normal mode
+ v Visual mode
+ ve Visual mode with 'selection' "exclusive" (same as 'v',
+ if not specified)
+ o Operator-pending mode
+ i Insert mode
+ r Replace mode
+
+ Others: ~
+ c appending to the command-line
+ ci inserting in the command-line
+ cr replacing in the command-line
+ m at the 'Hit ENTER' or 'More' prompts
+ ml idem, but cursor in the last line
+ e any mode, pointer below last window
+ s any mode, pointer on a status line
+ sd any mode, while dragging a status line
+ vs any mode, pointer on a vertical separator line
+ vd any mode, while dragging a vertical separator line
+ a everywhere
+
+ The shape is one of the following:
+ avail name looks like ~
+ w x arrow Normal mouse pointer
+ w x blank no pointer at all (use with care!)
+ w x beam I-beam
+ w x updown up-down sizing arrows
+ w x leftright left-right sizing arrows
+ w x busy The system's usual busy pointer
+ w x no The system's usual 'no input' pointer
+ x udsizing indicates up-down resizing
+ x lrsizing indicates left-right resizing
+ x crosshair like a big thin +
+ x hand1 black hand
+ x hand2 white hand
+ x pencil what you write with
+ x question big ?
+ x rightup-arrow arrow pointing right-up
+ w x up-arrow arrow pointing up
+ x <number> any X11 pointer number (see X11/cursorfont.h)
+
+ The "avail" column contains a 'w' if the shape is available for Win32,
+ x for X11.
+ Any modes not specified or shapes not available use the normal mouse
+ pointer.
+
+ Example: >
+ :set mouseshape=s:udsizing,m:no
+< will make the mouse turn to a sizing arrow over the status lines and
+ indicate no input when the hit-enter prompt is displayed (since
+ clicking the mouse has no effect in this state.)
+
+ *'mousetime'* *'mouset'*
+'mousetime' 'mouset' number (default 500)
+ global
+ {not in Vi}
+ Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum
+ time in msec between two mouse clicks for the second click to be
+ recognized as a multi click.
+
+ *'nrformats'* *'nf'*
+'nrformats' 'nf' string (default "octal,hex")
+ local to buffer
+ {not in Vi}
+ This defines what bases Vim will consider for numbers when using the
+ CTRL-A and CTRL-X commands for adding to and subtracting from a number
+ respectively; see |CTRL-A| for more info on these commands.
+ alpha if included, single alphabetical characters will be
+ incremented or decremented. This is useful for a list with a
+ letter index a), b), etc.
+ octal if included, numbers that start with a zero will be considered
+ to be octal. Example: Using CTRL-A on "007" results in "010".
+ hex if included, numbers starting with "0x" or "0X" will be
+ considered to be hexadecimal. Example: Using CTRL-X on
+ "0x100" results in "0x0ff".
+ Numbers which simply begin with a digit in the range 1-9 are always
+ considered decimal. This also happens for numbers that are not
+ recognized as octal or hex.
+
+ *'number'* *'nu'* *'nonumber'* *'nonu'*
+'number' 'nu' boolean (default off)
+ local to window
+ Print the line number in front of each line. When the 'n' option is
+ excluded from 'cpoptions' a wrapped line will not use the column of
+ line numbers (this is the default when 'compatible' isn't set).
+ When a long, wrapped line doesn't start with the first character, '-'
+ characters are put before the number.
+ See |hl-LineNr| for the highlighting used for the number.
+
+ *'osfiletype'* *'oft'* *E366*
+'osfiletype' 'oft' string (RISC-OS default: "Text",
+ others default: "")
+ local to buffer
+ {not in Vi}
+ {only available when compiled with the |+osfiletype|
+ feature}
+ Some operating systems store extra information about files besides
+ name, datestamp and permissions. This option contains the extra
+ information, the nature of which will vary between systems.
+ The value of this option is usually set when the file is loaded, and
+ use to set the file type when file is written.
+ It can affect the pattern matching of the automatic commands.
+ |autocmd-osfiletypes|
+
+ *'paragraphs'* *'para'*
+'paragraphs' 'para' string (default "IPLPPPQPP LIpplpipbp")
+ global
+ Specifies the nroff macros that separate paragraphs. These are pairs
+ of two letters (see |object-motions|).
+
+ *'paste'* *'nopaste'*
+'paste' boolean (default off)
+ global
+ {not in Vi}
+ Put Vim in Paste mode. This is useful if you want to cut or copy
+ some text from one window and paste it in Vim. This will avoid
+ unexpected effects.
+ Setting this option is useful when using Vim in a terminal, where Vim
+ cannot distinguish between typed text and pasted text. In the GUI, Vim
+ knows about pasting and will mostly do the right thing without 'paste'
+ being set. The same is true for a terminal where Vim handles the
+ mouse clicks itself.
+ When the 'paste' option is switched on (also when it was already on):
+ - mapping in Insert mode and Command-line mode is disabled
+ - abbreviations are disabled
+ - 'textwidth' is set to 0
+ - 'wrapmargin' is set to 0
+ - 'autoindent' is reset
+ - 'smartindent' is reset
+ - 'softtabstop' is set to 0
+ - 'revins' is reset
+ - 'ruler' is reset
+ - 'showmatch' is reset
+ - 'formatoptions' is used like it is empty
+ These options keep their value, but their effect is disabled:
+ - 'lisp'
+ - 'indentexpr'
+ - 'cindent'
+ NOTE: When you start editing another file while the 'paste' option is
+ on, settings from the modelines or autocommands may change the
+ settings again, causing trouble when pasting text. You might want to
+ set the 'paste' option again.
+ When the 'paste' option is reset the mentioned options are restored to
+ the value before the moment 'paste' was switched from off to on.
+ Resetting 'paste' before ever setting it does not have any effect.
+ Since mapping doesn't work while 'paste' is active, you need to use
+ the 'pastetoggle' option to toggle the 'paste' option with some key.
+
+ *'pastetoggle'* *'pt'*
+'pastetoggle' 'pt' string (default "")
+ global
+ {not in Vi}
+ When non-empty, specifies the key sequence that toggles the 'paste'
+ option. This is like specifying a mapping: >
+ :map {keys} :set invpaste<CR>
+< Where {keys} is the value of 'pastetoggle'.
+ The difference is that it will work even when 'paste' is set.
+ 'pastetoggle' works in Insert mode and Normal mode, but not in
+ Command-line mode.
+ Mappings are checked first, thus overrule 'pastetoggle'. However,
+ when 'paste' is on mappings are ignored in Insert mode, thus you can do
+ this: >
+ :map <F10> :set paste<CR>
+ :map <F11> :set nopaste<CR>
+ :imap <F10> <C-O>:set paste<CR>
+ :imap <F11> <nop>
+ :set pastetoggle=<F11>
+< This will make <F10> start paste mode and <F11> stop paste mode.
+ Note that typing <F10> in paste mode inserts "<F10>", since in paste
+ mode everything is inserted literally, except the 'pastetoggle' key
+ sequence.
+
+ *'pex'* *'patchexpr'*
+'patchexpr' 'pex' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+diff|
+ feature}
+ Expression which is evaluated to apply a patch to a file and generate
+ the resulting new version of the file. See |diff-patchexpr|.
+
+ *'patchmode'* *'pm'* *E206*
+'patchmode' 'pm' string (default "")
+ global
+ {not in Vi}
+ When non-empty the oldest version of a file is kept. This can be used
+ to keep the original version of a file if you are changing files in a
+ source distribution. Only the first time that a file is written a
+ copy of the original file will be kept. The name of the copy is the
+ name of the original file with the string in the 'patchmode' option
+ appended. This option should start with a dot. Use a string like
+ ".org". 'backupdir' must not be empty for this to work (Detail: The
+ backup file is renamed to the patchmode file after the new file has
+ been successfully written, that's why it must be possible to write a
+ backup file). If there was no file to be backed up, an empty file is
+ created.
+ When the 'backupskip' pattern matches, a patchmode file is not made.
+ Using 'patchmode' for compressed files appends the extension at the
+ end (e.g., "file.gz.orig"), thus the resulting name isn't always
+ recognized as a compressed file.
+
+ *'path'* *'pa'* *E343* *E345* *E347*
+'path' 'pa' string (default on Unix: ".,/usr/include,,"
+ on OS/2: ".,/emx/include,,"
+ other systems: ".,,")
+ global or local to buffer |global-local|
+ {not in Vi}
+ This is a list of directories which will be searched when using the
+ |gf|, [f, ]f, ^Wf, |:find| and other commands, provided that the file
+ being searched for has a relative path (not starting with '/'). The
+ directories in the 'path' option may be relative or absolute.
+ - Use commas to separate directory names: >
+ :set path=.,/usr/local/include,/usr/include
+< - Spaces can also be used to separate directory names (for backwards
+ compatibility with version 3.0). To have a space in a directory
+ name, precede it with an extra backslash, and escape the space: >
+ :set path=.,/dir/with\\\ space
+< - To include a comma in a directory name precede it with an extra
+ backslash: >
+ :set path=.,/dir/with\\,comma
+< - To search relative to the directory of the current file, use: >
+ :set path=.
+< - To search in the current directory use an empty string between two
+ commas: >
+ :set path=,,
+< - A directory name may end in a ':' or '/'.
+ - Environment variables are expanded |:set_env|.
+ - When using |netrw.vim| URLs can be used. For example, adding
+ "http://www.vim.org" will make ":find index.html" work.
+ - Search upwards and downwards in a directory tree:
+ 1) "*" matches a sequence of characters, e.g.: >
+ :set path=/usr/include/*
+< means all subdirectories in /usr/include (but not /usr/include
+ itself). >
+ :set path=/usr/*c
+< matches /usr/doc and /usr/src.
+ 2) "**" matches a subtree, up to 100 directories deep. Example: >
+ :set path=/home/user_x/src/**
+< means search in the whole subtree under "/home/usr_x/src".
+ 3) If the path ends with a ';', this path is the startpoint
+ for upward search.
+ See |file-searching| for more info and exact syntax.
+ {not available when compiled without the |+path_extra| feature}
+ - Careful with '\' characters, type two to get one in the option: >
+ :set path=.,c:\\include
+< Or just use '/' instead: >
+ :set path=.,c:/include
+< Don't forget "." or files won't even be found in the same directory as
+ the file!
+ The maximum length is limited. How much depends on the system, mostly
+ it is something like 256 or 1024 characters.
+ You can check if all the include files are found, using the value of
+ 'path', see |:checkpath|.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ directories from the list. This avoids problems when a future version
+ uses another default. To remove the current directory use: >
+ :set path-=
+< To add the current directory use: >
+ :set path+=
+< To use an environment variable, you probably need to replace the
+ separator. Here is an example to append $INCL, in which directory
+ names are separated with a semi-colon: >
+ :let &path = &path . "," . substitute($INCL, ';', ',', 'g')
+< Replace the ';' with a ':' or whatever separator is used. Note that
+ this doesn't work when $INCL contains a comma or white space.
+
+ *'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
+'preserveindent' 'pi' boolean (default off)
+ local to buffer
+ {not in Vi}
+ When changing the indent of the current line, preserve as much of the
+ indent structure as possible. Normally the indent is replaced by a
+ series of tabs followed by spaces as required (unless |'expandtab'| is
+ enabled, in which case only spaces are used). Enabling this option
+ means the indent will preserve as many existing characters as possible
+ for indenting, and only add additional tabs or spaces as required.
+ NOTE: When using ">>" multiple times the resulting indent is a mix of
+ tabs and spaces. You might not like this.
+ NOTE: 'preserveindent' is reset when 'compatible' is set.
+ Also see 'copyindent'.
+ Use |:retab| to clean up white space.
+
+ *'previewheight'* *'pvh'*
+'previewheight' 'pvh' number (default 12)
+ global
+ {not in Vi}
+ {not available when compiled without the |+windows| or
+ |+quickfix| feature}
+ Default height for a preview window. Used for |:ptag| and associated
+ commands. Used for |CTRL-W_}| when no count is given.
+
+ *'previewwindow'* *'nopreviewwindow'*
+ *'pvw'* *'nopvw'* *E590*
+'previewwindow' 'pvw' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+windows| or
+ |+quickfix| feature}
+ Identifies the preview window. Only one window can have this option
+ set. It's normally not set directly, but by using one of the commands
+ |:ptag|, |:pedit|, etc.
+
+ *'printdevice'* *'pdev'*
+'printdevice' 'pdev' string (default empty)
+ global
+ {not in Vi}
+ {only available when compiled with the |+printer|
+ feature}
+ This defines the name of the printer to be used when the |:hardcopy|
+ command is issued with a bang (!) to skip the printer selection
+ dialog. On Win32, it should be the printer name exactly as it appears
+ in the standard printer dialog.
+ If the option is empty, then vim will use the system default printer
+ for ":hardcopy!"
+
+ *'printencoding'* *'penc'* *E620*
+'printencoding' 'penc' String (default empty, except for:
+ Windows, OS/2: cp1252,
+ Macintosh: mac-roman,
+ VMS: dec-mcs,
+ HPUX: hp-roman8,
+ EBCDIC: ebcdic-uk)
+ global
+ {not in Vi}
+ {only available when compiled with the |+printer|
+ and |+postscript| features}
+ Sets the character encoding used when printing. This option tells VIM
+ which print character encoding file from the "print" directory in
+ 'runtimepath' to use.
+
+ This option will accept any value from |encoding-names|. Any
+ recognized names are converted to VIM standard names - see 'encoding'
+ for more details. Names not recognized by VIM will just be converted
+ to lower case and underscores replaced with '-' signs.
+
+ If 'printencoding' is empty or VIM cannot find the file then it will
+ use 'encoding' (if VIM is compiled with |+multi_byte| and it is set an
+ 8-bit encoding) to find the print character encoding file. If VIM is
+ unable to find a character encoding file then it will use the "latin1"
+ print character encoding file.
+
+ When 'encoding' is set to a multi-byte encoding, VIM will try to
+ convert characters to the printing encoding for printing (if
+ 'printencoding' is empty then the conversion will be to latin1).
+ Conversion to a printing encoding other than latin1 will require VIM
+ to be compiled with the |+iconv| feature. If no conversion is
+ possible then printing will fail. Any characters that cannot be
+ converted will be replaced with upside down question marks.
+
+ Four print character encoding files are provided to support default
+ Mac, VMS, HPUX, and EBCDIC character encodings and are used by default
+ on these platforms. Code page 1252 print character encoding is used
+ by default on Windows and OS/2 platforms.
+
+
+ *'printexpr'* *'pexpr'*
+'printexpr' 'pexpr' String (default: see below)
+ global
+ {not in Vi}
+ {only available when compiled with the |+printer|
+ and |+postscript| features}
+ Expression that is evaluated to print the PostScript produced with
+ ":hardcopy".
+ The file name to be printed is in |v:fname_in|.
+ The arguments to the ":hardcopy" command are in |v:cmdarg|.
+ The expression must take care of deleting the file after printing it.
+ When there is an error, the expression must return a non-zero number.
+ If there is no error, return zero or an empty string.
+ The default for non MS-Windows or VMS systems is to simply use "lpr"
+ to print the file: >
+
+ system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)
+ . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
+<
+ On MS-Windows machines the default is to copy the file to the
+ currently specified printdevice: >
+
+ system('copy' . ' ' . v:fname_in . ' "' . &printdevice . '"')
+ . delete(v:fname_in)
+<
+ On VMS machines the default is to send the file to either the default
+ or currently specified printdevice: >
+
+ system('print' . (&printdevice == '' ? '' : ' /queue=' .
+ &printdevice) . ' ' . v:fname_in) . delete(v:fname_in)
+<
+ If you change this option, using a function is an easy way to avoid
+ having to escape all the spaces. Example: >
+
+ :set printexpr=PrintFile(v:fname_in)
+ :function PrintFile(fname)
+ : call system("ghostview " . a:fname)
+ : call delete(a:fname)
+ : return v:shell_error
+ :endfunc
+
+< Be aware that some print programs return control before they have read
+ the file. If you delete the file too soon it will not be printed.
+ These programs usually offer an option to have them remove the file
+ when printing is done.
+ *E365*
+ If evaluating the expression fails or it results in a non-zero number,
+ you get an error message. In that case Vim will delete the
+ file. In the default value for non-MS-Windows a trick is used: Adding
+ "v:shell_error" will result in a non-zero number when the system()
+ call fails.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'printfont'* *'pfn'* *E613*
+'printfont' 'pfn' string (default "courier")
+ global
+ {not in Vi}
+ {only available when compiled with the |+printer|
+ feature}
+ This is the name of the font that will be used for the |:hardcopy|
+ command's output. It has the same format as the 'guifont' option,
+ except that only one font may be named, and the special "guifont=*"
+ syntax is not available.
+ In the Win32 GUI version this specifies a font name with its extra
+ attributes, as with the 'guifont' option.
+ For other systems, only ":h11" is recognized, where "11" is the point
+ size of the font. When omitted, the point size is 10.
+
+ *'printheader'* *'pheader'*
+'printheader' 'pheader' string (default "%<%f%h%m%=Page %N")
+ global
+ {not in Vi}
+ {only available when compiled with the |+printer|
+ feature}
+ This defines the format of the header produced in |:hardcopy| output.
+ The option is defined in the same way as the 'statusline' option.
+ If Vim has not been compiled with the |+statusline| feature, this
+ option has no effect and a simple default header is used, which shows
+ the page number.
+
+ *'printoptions'* *'popt'*
+'printoptions' 'popt' string (default "")
+ global
+ {not in Vi}
+ {only available when compiled with |+printer| feature}
+ This is a comma-separated list of items that control the format of
+ the output of |:hardcopy|:
+
+ left:{spec} left margin (default: 10pc)
+ right:{spec} right margin (default: 5pc)
+ top:{spec} top margin (default: 5pc)
+ bottom:{spec} bottom margin (default: 5pc)
+ {spec} is a number followed by "in" for
+ inches, "pt" for points (1 point is 1/72 of an
+ inch), "mm" for millimeters or "pc" for a
+ percentage of the media size.
+ Weird example:
+ left:2in,top:30pt,right:16mm,bottom:3pc
+ If the unit is not recognized there is no
+ error and the default value is used.
+
+ header:{nr} Number of lines to reserve for the header.
+ Only the first line is actually filled, thus
+ when {nr} is 2 there is one empty line. The
+ header is formatted according to
+ 'printheader'.
+ header:0 Do not print a header.
+ header:2 (default) Use two lines for the header
+
+ syntax:n Do not use syntax highlighting. This is
+ faster and thus useful when printing large
+ files.
+ syntax:y Do syntax highlighting.
+ syntax:a (default) Use syntax highlighting if the printer appears
+ to be able to print color or grey.
+
+ number:y Include line numbers in the printed output.
+ number:n (default) No line numbers.
+
+ wrap:y (default) Wrap long lines.
+ wrap:n Truncate long lines.
+
+ duplex:off Print on one side.
+ duplex:long (default) Print on both sides (when possible), bind on
+ long side.
+ duplex:short Print on both sides (when possible), bind on
+ short side.
+
+ collate:y (default) Collating: 1 2 3, 1 2 3, 1 2 3
+ collate:n No collating: 1 1 1, 2 2 2, 3 3 3
+
+ jobsplit:n (default) Do all copies in one print job
+ jobsplit:y Do each copy as a separate print job. Useful
+ when doing N-up postprocessing.
+
+ portrait:y (default) Orientation is portrait.
+ portrait:n Orientation is landscape.
+ *a4* *letter*
+ paper:A4 (default) Paper size: A4
+ paper:{name} Paper size from this table:
+ {name} size in cm size in inch ~
+ 10x14 25.4 x 35.57 10 x 14
+ A3 29.7 x 42 11.69 x 16.54
+ A4 21 x 29.7 8.27 x 11.69
+ A5 14.8 x 21 5.83 x 8.27
+ B4 25 x 35.3 10.12 x 14.33
+ B5 17.6 x 25 7.17 x 10.12
+ executive 18.42 x 26.67 7.25 x 10.5
+ folio 21 x 33 8.27 x 13
+ ledger 43.13 x 27.96 17 x 11
+ legal 21.59 x 35.57 8.5 x 14
+ letter 21.59 x 27.96 8.5 x 11
+ quarto 21.59 x 27.5 8.5 x 10.83
+ statement 13.97 x 21.59 5.5 x 8.5
+ tabloid 27.96 x 43.13 11 x 17
+
+ formfeed:n (default) Treat form feed characters (0x0c) as a normal
+ print character.
+ formfeed:y When a form feed character is encountered,
+ continue printing of the current line at the
+ beginning of the first line on a new page.
+
+ The item indicated with (default) is used when the item is not
+ present. The values are not always used, especially when using a
+ dialog to select the printer and options.
+ Example: >
+ :set printoptions=paper:letter,duplex:off
+<
+ *'readonly'* *'ro'* *'noreadonly'* *'noro'*
+'readonly' 'ro' boolean (default off)
+ local to buffer
+ If on, writes fail unless you use a '!'. Protects you from
+ accidentally overwriting a file. Default on when Vim is started
+ in read-only mode ("vim -R") or when the executable is called "view".
+ {not in Vi:} When using the ":view" command the 'readonly' option is
+ set for the newly edited buffer. When using ":w!" the 'readonly'
+ option is reset for the current buffer.
+
+ *'remap'* *'noremap'*
+'remap' boolean (default on)
+ global
+ Allows for mappings to work recursively. If you do not want this for
+ a single entry, use the :noremap[!] command.
+
+ *'report'*
+'report' number (default 2)
+ global
+ Threshold for reporting number of lines changed. When the number of
+ changed lines is more than 'report' a message will be given for most
+ ":" commands. If you want it always, set 'report' to 0.
+ For the ":substitute" command the number of substitutions is used
+ instead of the number of lines.
+
+ *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
+'restorescreen' 'rs' boolean (default on)
+ global
+ {not in Vi} {only in Windows 95/NT console version}
+ When set, the screen contents is restored when exiting Vim. This also
+ happens when executing external commands.
+
+ For non-Windows Vim: You can set or reset the 't_ti' and 't_te'
+ options in your .vimrc. To disable restoring:
+ set t_ti= t_te=
+ To enable restoring (for an xterm):
+ set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
+ (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)
+
+ *'revins'* *'ri'* *'norevins'* *'nori'*
+'revins' 'ri' boolean (default off)
+ global
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ Inserting characters in Insert mode will work backwards. See "typing
+ backwards" |ins-reverse|. This option can be toggled with the CTRL-_
+ command in Insert mode, when 'allowrevins' is set.
+ NOTE: This option is reset when 'compatible' or 'paste' is set.
+
+ *'rightleft'* *'rl'* *'norightleft'* *'norl'*
+'rightleft' 'rl' boolean (default off)
+ local to window
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ When on, display orientation becomes right-to-left, i.e., characters
+ that are stored in the file appear from the right to the left.
+ Using this option, it is possible to edit files for languages that
+ are written from the right to the left such as Hebrew and Arabic.
+ This option is per window, so it is possible to edit mixed files
+ simultaneously, or to view the same file in both ways (this is
+ useful whenever you have a mixed text file with both right-to-left
+ and left-to-right strings so that both sets are displayed properly
+ in different windows). Also see |rileft.txt|.
+
+ *'rightleftcmd'* *'rlc'* *'norightleftcmd'* *'norlc'*
+'rightleftcmd' 'rlc' string (default "search")
+ local to window
+ {not in Vi}
+ {only available when compiled with the |+rightleft|
+ feature}
+ Each word in this option enables the command line editing to work in
+ right-to-left mode for a group of commands:
+
+ search "/" and "?" commands
+
+ This is useful for languages such as Hebrew, Arabic and Farsi.
+ The 'rightleft' option must be set for 'rightleftcmd' to take effect.
+
+ *'ruler'* *'ru'* *'noruler'* *'noru'*
+'ruler' 'ru' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+cmdline_info| feature}
+ Show the line and column number of the cursor position, separated by a
+ comma. When there is room, the relative position of the displayed
+ text in the file is shown on the far right:
+ Top first line is visible
+ Bot last line is visible
+ All first and last line are visible
+ 45% relative position in the file
+ If 'rulerformat' is set, it will determine the contents of the ruler.
+ Each window has its own ruler. If a window has a status line, the
+ ruler is shown there. Otherwise it is shown in the last line of the
+ screen. If the statusline is given by 'statusline' (ie. not empty),
+ this option takes precedence over 'ruler' and 'rulerformat'
+ If the number of characters displayed is different from the number of
+ bytes in the text (e.g., for a TAB or a multi-byte character), both
+ the text column (byte number) and the screen column are shown,
+ separated with a dash.
+ For an empty line "0-1" is shown.
+ For an empty buffer the line number will also be zero: "0,0-1".
+ This option is reset when the 'paste' option is set.
+ If you don't want to see the ruler all the time but want to know where
+ you are, use "g CTRL-G" |g_CTRL-G|.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'rulerformat'* *'ruf'*
+'rulerformat' 'ruf' string (default empty)
+ global
+ {not in Vi}
+ {not available when compiled without the |+statusline|
+ feature}
+ When this option is not empty, it determines the content of the ruler
+ string, as displayed for the 'ruler' option.
+ The format of this option, is like that of 'statusline'.
+ The default ruler width is 17 characters. To make the ruler 15
+ characters wide, put "%15(" at the start and "%)" at the end.
+ Example: >
+ :set rulerformat=%15(%c%V\ %p%%%)
+<
+ *'runtimepath'* *'rtp'* *vimfiles*
+'runtimepath' 'rtp' string (default:
+ Unix: "$HOME/.vim,
+ $VIM/vimfiles,
+ $VIMRUNTIME,
+ $VIM/vimfiles/after,
+ $HOME/.vim/after"
+ Amiga: "home:vimfiles,
+ $VIM/vimfiles,
+ $VIMRUNTIME,
+ $VIM/vimfiles/after,
+ home:vimfiles/after"
+ PC, OS/2: "$HOME/vimfiles,
+ $VIM/vimfiles,
+ $VIMRUNTIME,
+ $VIM/vimfiles/after,
+ $HOME/vimfiles/after"
+ Macintosh: "$VIM:vimfiles,
+ $VIMRUNTIME,
+ $VIM:vimfiles:after"
+ RISC-OS: "Choices:vimfiles,
+ $VIMRUNTIME,
+ Choices:vimfiles/after"
+ VMS: "sys$login:vimfiles,
+ $VIM/vimfiles,
+ $VIMRUNTIME,
+ $VIM/vimfiles/after,
+ sys$login:vimfiles/after"
+ global
+ {not in Vi}
+ This is a list of directories which will be searched for runtime
+ files:
+ filetype.vim filetypes by file name |new-filetype|
+ scripts.vim filetypes by file contents |new-filetype-scripts|
+ colors/ color scheme files |:colorscheme|
+ compiler/ compiler files |:compiler|
+ doc/ documentation |write-local-help|
+ ftplugin/ filetype plugins |write-filetype-plugin|
+ indent/ indent scripts |indent-expression|
+ keymap/ key mapping files |mbyte-keymap|
+ lang/ menu translations |:menutrans|
+ menu.vim GUI menus |menu.vim|
+ plugin/ plugin scripts |write-plugin|
+ print/ files for printing |postscript-print-encoding|
+ syntax/ syntax files |mysyntaxfile|
+ tutor/ files for vimtutor |tutor|
+
+ And any other file searched for with the |:runtime| command.
+
+ The defaults for most systems are setup to search five locations:
+ 1. In your home directory, for your personal preferences.
+ 2. In a system-wide Vim directory, for preferences from the system
+ administrator.
+ 3. In $VIMRUNTIME, for files distributed with Vim.
+ *after-directory*
+ 4. In the "after" directory in the system-wide Vim directory. This is
+ for the system administrator to overrule or add to the distributed
+ defaults (rarely needed)
+ 5. In the "after" directory in your home directory. This is for
+ personal preferences to overrule or add to the distributed defaults
+ or system-wide settings (rarely needed).
+
+ Note that, unlike 'path', no wildcards like "**" are allowed. Normal
+ wildcards are allowed, but can significantly slow down searching for
+ runtime files. For speed, use as few items as possible and avoid
+ wildcards.
+ See |:runtime|.
+ Example: >
+ :set runtimepath=~/vimruntime,/mygroup/vim,$VIMRUNTIME
+< This will use the directory "~/vimruntime" first (containing your
+ personal Vim runtime files), then "/mygroup/vim" (shared between a
+ group of people) and finally "$VIMRUNTIME" (the distributed runtime
+ files).
+ You probably should always include $VIMRUNTIME somewhere, to use the
+ distributed runtime files. You can put a directory before $VIMRUNTIME
+ to find files which replace a distributed runtime files. You can put
+ a directory after $VIMRUNTIME to find files which add to distributed
+ runtime files.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'scroll'* *'scr'*
+'scroll' 'scr' number (default: half the window height)
+ local to window
+ Number of lines to scroll with CTRL-U and CTRL-D commands. Will be
+ set to half the number of lines in the window when the window size
+ changes. If you give a count to the CTRL-U or CTRL-D command it will
+ be used as the new value for 'scroll'. Reset to half the window
+ height with ":set scroll=0". {Vi is a bit different: 'scroll' gives
+ the number of screen lines instead of file lines, makes a difference
+ when lines wrap}
+
+ *'scrollbind'* *'scb'* *'noscrollbind'* *'noscb'*
+'scrollbind' 'scb' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+scrollbind|
+ feature}
+ See also |scroll-binding|. When this option is set, the current
+ window scrolls as other scrollbind windows (windows that also have
+ this option set) scroll. This option is useful for viewing the
+ differences between two versions of a file, see 'diff'.
+ See |'scrollopt'| for options that determine how this option should be
+ interpreted.
+ This option is mostly reset when splitting a window to edit another
+ file. This means that ":split | edit file" results in two windows
+ with scroll-binding, but ":split file" does not.
+
+ *'scrolljump'* *'sj'*
+'scrolljump' 'sj' number (default 1)
+ global
+ {not in Vi}
+ Minimal number of lines to scroll when the cursor gets off the
+ screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E,
+ CTRL-D). Useful if your terminal scrolls very slowly.
+ NOTE: This option is set to 1 when 'compatible' is set.
+
+ *'scrolloff'* *'so'*
+'scrolloff' 'so' number (default 0)
+ global
+ {not in Vi}
+ Minimal number of screen lines to keep above and below the cursor.
+ This will make some context visible around where you are working. If
+ you set it to a very large value (999) the cursor line will always be
+ in the middle of the window (except at the start or end of the file or
+ when long lines wrap).
+ For scrolling horizontally see 'sidescrolloff'.
+ NOTE: This option is set to 0 when 'compatible' is set.
+
+ *'scrollopt'* *'sbo'*
+'scrollopt' 'sbo' string (default "ver,jump")
+ global
+ {not available when compiled without the |+scrollbind|
+ feature}
+ {not in Vi}
+ This is a comma-separated list of words that specifies how
+ 'scrollbind' windows should behave.
+ The following words are available:
+ ver Bind vertical scrolling for 'scrollbind' windows
+ hor Bind horizontal scrolling for 'scrollbind' windows
+ jump Applies to the offset between two windows for vertical
+ scrolling. This offset is the difference in the first
+ displayed line of the bound windows. When moving
+ around in a window, another 'scrollbind' window may
+ reach a position before the start or after the end of
+ the buffer. The offset is not changed though, when
+ moving back the 'scrollbind' window will try to scroll
+ to the desired position when possible.
+ When now making that window the current one, two
+ things can be done with the relative offset:
+ 1. When "jump" is not included, the relative offset is
+ adjusted for the scroll position in the new current
+ window. When going back to the other window, the
+ the new relative offset will be used.
+ 2. When "jump" is included, the other windows are
+ scrolled to keep the same relative offset. When
+ going back to the other window, it still uses the
+ same relative offset.
+ Also see |scroll-binding|.
+
+ *'sections'* *'sect'*
+'sections' 'sect' string (default "SHNHH HUnhsh")
+ global
+ Specifies the nroff macros that separate sections. These are pairs of
+ two letters (See |object-motions|). The default makes a section start
+ at the nroff macros ".SH", ".NH", ".H", ".HU", ".nh" and ".sh".
+
+ *'secure'* *'nosecure'* *E523*
+'secure' boolean (default off)
+ global
+ {not in Vi}
+ When on, ":autocmd", shell and write commands are not allowed in
+ ".vimrc" and ".exrc" in the current directory and map commands are
+ displayed. Switch it off only if you know that you will not run into
+ problems, or when the 'exrc' option is off. On Unix this option is
+ only used if the ".vimrc" or ".exrc" is not owned by you. This can be
+ dangerous if the systems allows users to do a "chown". You better set
+ 'secure' at the end of your ~/.vimrc then.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'selection'* *'sel'*
+'selection' 'sel' string (default "inclusive")
+ global
+ {not in Vi}
+ This option defines the behavior of the selection. It is only used
+ in Visual and Select mode.
+ Possible values:
+ value past line inclusive ~
+ old no yes
+ inclusive yes yes
+ exclusive yes no
+ "past line" means that the cursor is allowed to be positioned one
+ character past the line.
+ "inclusive" means that the last character of the selection is included
+ in an operation. For example, when "x" is used to delete the
+ selection.
+ Note that when "exclusive" is used and selecting from the end
+ backwards, you cannot include the last character of a line, when
+ starting in Normal mode and 'virtualedit' empty.
+
+ The 'selection' option is set by the |:behave| command.
+
+ *'selectmode'* *'slm'*
+'selectmode' 'slm' string (default "")
+ global
+ {not in Vi}
+ This is a comma separated list of words, which specifies when to start
+ Select mode instead of Visual mode, when a selection is started.
+ Possible values:
+ mouse when using the mouse
+ key when using shifted special keys
+ cmd when using "v", "V" or CTRL-V
+ See |Select-mode|.
+ The 'selectmode' option is set by the |:behave| command.
+
+ *'sessionoptions'* *'ssop'*
+'sessionoptions' 'ssop' string (default: "blank,buffers,curdir,folds,
+ help,options,winsize")
+ global
+ {not in Vi}
+ {not available when compiled without the +mksession
+ feature}
+ Changes the effect of the |:mksession| command. It is a comma
+ separated list of words. Each word enables saving and restoring
+ something:
+ word save and restore ~
+ blank empty windows
+ buffers hidden and unloaded buffers, not just those in windows
+ curdir the current directory
+ folds manually created folds, opened/closed folds and local
+ fold options
+ globals global variables that start with an uppercase letter
+ and contain at least one lowercase letter.
+ help the help window
+ localoptions options and mappings local to a window or buffer (not
+ global values for local options)
+ options all options and mappings (also global values for local
+ options)
+ resize size of the Vim window: 'lines' and 'columns'
+ sesdir the directory in which the session file is located
+ will become the current directory (useful with
+ projects accessed over a network from different
+ systems)
+ slash backslashes in file names replaced with forward
+ slashes
+ unix with Unix end-of-line format (single <NL>), even when
+ on Windows or DOS
+ winpos position of the whole Vim window
+ winsize window sizes
+
+ Don't include both "curdir" and "sesdir".
+ When "curdir" nor "sesdir" is included, file names are stored with
+ absolute paths.
+ "slash" and "unix" are useful on Windows when sharing session files
+ with Unix. The Unix version of Vim cannot source dos format scripts,
+ but the Windows version of Vim can source unix format scripts.
+
+ *'shell'* *'sh'* *E91*
+'shell' 'sh' string (default $SHELL or "sh",
+ MS-DOS and Win32: "command.com" or
+ "cmd.exe", OS/2: "cmd")
+ global
+ Name of the shell to use for ! and :! commands. When changing the
+ value also check these options: 'shelltype', 'shellpipe', 'shellslash'
+ 'shellredir', 'shellquote', 'shellxquote' and 'shellcmdflag'.
+ It is allowed to give an argument to the command, e.g. "csh -f".
+ See |option-backslash| about including spaces and backslashes.
+ Environment variables are expanded |:set_env|.
+ If the name of the shell contains a space, you might need to enclose
+ it in quotes. Example: >
+ :set shell=\"c:\program\ files\unix\sh.exe\"\ -f
+< Note the backslash before each quote (to avoid starting a comment) and
+ each space (to avoid ending the option value). Also note that the
+ "-f" is not inside the quotes, because it is not part of the command
+ name. And Vim automagically recognizes the backslashes that are path
+ separators.
+ For Dos 32 bits (DJGPP), you can set the $DJSYSFLAGS environment
+ variable to change the way external commands are executed. See the
+ libc.inf file of DJGPP.
+ Under MS-Windows, when the executable ends in ".com" it must be
+ included. Thus setting the shell to "command.com" or "4dos.com"
+ works, but "command" and "4dos" do not work for all commands (e.g.,
+ filtering).
+ For unknown reasons, when using "4dos.com" the current directory is
+ changed to "C:\". To avoid this set 'shell' like this: >
+ :set shell=command.com\ /c\ 4dos
+< This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shellcmdflag'* *'shcf'*
+'shellcmdflag' 'shcf' string (default: "-c", MS-DOS and Win32, when 'shell'
+ does not contain "sh" somewhere: "/c")
+ global
+ {not in Vi}
+ Flag passed to the shell to execute "!" and ":!" commands; e.g.,
+ "bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
+ systems, the default is set according to the value of 'shell', to
+ reduce the need to set this option by the user. It's not used for
+ OS/2 (EMX figures this out itself). See |option-backslash| about
+ including spaces and backslashes. See |dos-shell|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shellpipe'* *'sp'*
+'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee")
+ global
+ {not in Vi}
+ {not available when compiled without the |+quickfix|
+ feature}
+ String to be used to put the output of the ":make" command in the
+ error file. See also |:make_makeprg|. See |option-backslash| about
+ including spaces and backslashes.
+ The name of the temporary file can be represented by "%s" if necessary
+ (the file name is appended automatically if no %s appears in the value
+ of this option).
+ For the Amiga and MS-DOS the default is ">". The output is directly
+ saved in a file and not echoed to the screen.
+ For Unix the default it "| tee". The stdout of the compiler is saved
+ in a file and echoed to the screen. If the 'shell' option is "csh" or
+ "tcsh" after initializations, the default becomes "|& tee". If the
+ 'shell' option is "sh", "ksh", "zsh" or "bash" the default becomes
+ "2>&1| tee". This means that stderr is also included.
+ The initialization of this option is done after reading the ".vimrc"
+ and the other initializations, so that when the 'shell' option is set
+ there, the 'shellpipe' option changes automatically, unless it was
+ explicitly set before.
+ When 'shellpipe' is set to an empty string, no redirection of the
+ ":make" output will be done. This is useful if you use a 'makeprg'
+ that writes to 'makeef' by itself. If you want no piping, but do
+ want to include the 'makeef', set 'shellpipe' to a single space.
+ Don't forget to precede the space with a backslash: ":set sp=\ ".
+ In the future pipes may be used for filtering and this option will
+ become obsolete (at least for Unix).
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shellquote'* *'shq'*
+'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell'
+ contains "sh" somewhere: "\"")
+ global
+ {not in Vi}
+ Quoting character(s), put around the command passed to the shell, for
+ the "!" and ":!" commands. The redirection is kept outside of the
+ quoting. See 'shellxquote' to include the redirection. It's
+ probably not useful to set both options.
+ This is an empty string by default. Only known to be useful for
+ third-party shells on MS-DOS-like systems, such as the MKS Korn Shell
+ or bash, where it should be "\"". The default is adjusted according
+ the value of 'shell', to reduce the need to set this option by the
+ user. See |dos-shell|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shellredir'* *'srr'*
+'shellredir' 'srr' string (default ">", ">&" or ">%s 2>&1")
+ global
+ {not in Vi}
+ String to be used to put the output of a filter command in a temporary
+ file. See also |:!|. See |option-backslash| about including spaces
+ and backslashes.
+ The name of the temporary file can be represented by "%s" if necessary
+ (the file name is appended automatically if no %s appears in the value
+ of this option).
+ The default is ">". For Unix, if the 'shell' option is "csh", "tcsh"
+ or "zsh" during initializations, the default becomes ">&". If the
+ 'shell' option is "sh", "ksh" or "bash" the default becomes
+ ">%s 2>&1". This means that stderr is also included.
+ For Win32, the Unix checks are done and additionally "cmd" is checked
+ for, which makes the default ">%s 2>&1". Also, the same names with
+ ".exe" appended are checked for.
+ The initialization of this option is done after reading the ".vimrc"
+ and the other initializations, so that when the 'shell' option is set
+ there, the 'shellredir' option changes automatically unless it was
+ explicitly set before.
+ In the future pipes may be used for filtering and this option will
+ become obsolete (at least for Unix).
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
+'shellslash' 'ssl' boolean (default off)
+ global
+ {not in Vi} {only for MSDOS, MS-Windows and OS/2}
+ When set, a forward slash is used when expanding file names. This is
+ useful when a Unix-like shell is used instead of command.com or
+ cmd.exe. Backward slashes can still be typed, but they are changed to
+ forward slashes by Vim.
+ Note that setting or resetting this option has no effect for some
+ existing file names, thus this option needs to be set before opening
+ any file for best results. This might change in the future.
+ 'shellslash' only works when a backslash can be used as a path
+ separator. To test if this is so use: >
+ if exists('+shellslash')
+<
+ *'shelltype'* *'st'*
+'shelltype' 'st' number (default 0)
+ global
+ {not in Vi} {only for the Amiga}
+ On the Amiga this option influences the way how the commands work
+ which use a shell.
+ 0 and 1: always use the shell
+ 2 and 3: use the shell only to filter lines
+ 4 and 5: use shell only for ':sh' command
+ When not using the shell, the command is executed directly.
+
+ 0 and 2: use "shell 'shellcmdflag' cmd" to start external commands
+ 1 and 3: use "shell cmd" to start external commands
+
+ *'shellxquote'* *'sxq'*
+'shellxquote' 'sxq' string (default: "";
+ for Win32, when 'shell' contains "sh"
+ somewhere: "\""
+ for Unix, when using system(): "\"")
+ global
+ {not in Vi}
+ Quoting character(s), put around the command passed to the shell, for
+ the "!" and ":!" commands. Includes the redirection. See
+ 'shellquote' to exclude the redirection. It's probably not useful
+ to set both options.
+ This is an empty string by default. Known to be useful for
+ third-party shells when using the Win32 version, such as the MKS Korn
+ Shell or bash, where it should be "\"". The default is adjusted
+ according the value of 'shell', to reduce the need to set this option
+ by the user. See |dos-shell|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
+'shiftround' 'sr' boolean (default off)
+ global
+ {not in Vi}
+ Round indent to multiple of 'shiftwidth'. Applies to > and <
+ commands. CTRL-T and CTRL-D in Insert mode always round the indent to
+ a multiple of 'shiftwidth' (this is Vi compatible).
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'shiftwidth'* *'sw'*
+'shiftwidth' 'sw' number (default 8)
+ local to buffer
+ Number of spaces to use for each step of (auto)indent. Used for
+ |'cindent'|, |>>|, |<<|, etc.
+
+ *'shortmess'* *'shm'*
+'shortmess' 'shm' string (Vim default "filnxtToO", Vi default: "")
+ global
+ {not in Vi}
+ This option helps to avoid all the |hit-enter| prompts caused by file
+ messages, for example with CTRL-G, and to avoid some other messages.
+ It is a list of flags:
+ flag meaning when present ~
+ f use "(3 of 5)" instead of "(file 3 of 5)"
+ i use "[noeol]" instead of "[Incomplete last line]"
+ l use "999L, 888C" instead of "999 lines, 888 characters"
+ m use "[+]" instead of "[Modified]"
+ n use "[New]" instead of "[New File]"
+ r use "[RO]" instead of "[readonly]"
+ w use "[w]" instead of "written" for file write message
+ and "[a]" instead of "appended" for ':w >> file' command
+ x use "[dos]" instead of "[dos format]", "[unix]" instead of
+ "[unix format]" and "[mac]" instead of "[mac format]".
+ a all of the above abbreviations
+
+ o overwrite message for writing a file with subsequent message
+ for reading a file (useful for ":wn" or when 'autowrite' on)
+ O message for reading a file overwrites any previous message.
+ Also for quickfix message (e.g., ":cn").
+ s don't give "search hit BOTTOM, continuing at TOP" or "search
+ hit TOP, continuing at BOTTOM" messages
+ t truncate file message at the start if it is too long to fit
+ on the command-line, "<" will appear in the left most column.
+ Ignored in Ex mode.
+ T truncate other messages in the middle if they are too long to
+ fit on the command line. "..." will appear in the middle.
+ Ignored in Ex mode.
+ W don't give "written" or "[w]" when writing a file
+ A don't give the "ATTENTION" message when an existing swap file
+ is found.
+ I don't give the intro message when starting Vim |:intro|.
+
+ This gives you the opportunity to avoid that a change between buffers
+ requires you to hit <Enter>, but still gives as useful a message as
+ possible for the space available. To get the whole message that you
+ would have got with 'shm' empty, use ":file!"
+ Useful values:
+ shm= No abbreviation of message.
+ shm=a Abbreviation, but no loss of information.
+ shm=at Abbreviation, and truncate message when necessary.
+
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'shortname'* *'sn'* *'noshortname'* *'nosn'*
+'shortname' 'sn' boolean (default off)
+ local to buffer
+ {not in Vi, not in MS-DOS versions}
+ Filenames are assumed to be 8 characters plus one extension of 3
+ characters. Multiple dots in file names are not allowed. When this
+ option is on, dots in file names are replaced with underscores when
+ adding an extension (".~" or ".swp"). This option is not available
+ for MS-DOS, because then it would always be on. This option is useful
+ when editing files on an MS-DOS compatible filesystem, e.g., messydos
+ or crossdos. When running the Win32 GUI version under Win32s, this
+ option is always on by default.
+
+ *'showbreak'* *'sbr'* *E595*
+'showbreak' 'sbr' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+linebreak|
+ feature}
+ String to put at the start of lines that have been wrapped. Useful
+ values are "> " or "+++ ".
+ Only printable single-cell characters are allowed, excluding <Tab> and
+ comma (in a future version the comma might be used to separate the
+ part that is shown at the end and at the start of a line).
+ The characters are highlighted according to the '@' flag in
+ 'highlight'.
+ Note that tabs after the showbreak will be displayed differently.
+ If you want the 'showbreak' to appear in between line numbers, add the
+ "n" flag to 'cpoptions'.
+
+ *'showcmd'* *'sc'* *'noshowcmd'* *'nosc'*
+'showcmd' 'sc' boolean (Vim default: on, off for Unix, Vi default:
+ off)
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+cmdline_info| feature}
+ Show (partial) command in status line. Set this option off if your
+ terminal is slow.
+ In Visual mode the size of the selected area is shown:
+ - When selecting characters within a line, the number of characters.
+ - When selecting more than one line, the number of lines.
+ - When selecting a block, the size in screen characters: linesxcolumns.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'showfulltag'* *'sft'* *'noshowfulltag'* *'nosft'*
+'showfulltag' 'sft' boolean (default off)
+ global
+ {not in Vi}
+ When completing a word in insert mode (see |ins-completion|) from the
+ tags file, show both the tag name and a tidied-up form of the search
+ pattern (if there is one) as possible matches. Thus, if you have
+ matched a C function, you can see a template for what arguments are
+ required (coding style permitting).
+
+ *'showmatch'* *'sm'* *'noshowmatch'* *'nosm'*
+'showmatch' 'sm' boolean (default off)
+ global
+ When a bracket is inserted, briefly jump to the matching one. The
+ jump is only done if the match can be seen on the screen. The time to
+ show the match can be set with 'matchtime'.
+ A Beep is given if there is no match (no matter if the match can be
+ seen or not). This option is reset when the 'paste' option is set.
+ When the 'm' flag is not included in 'cpoptions', typing a character
+ will immediately move the cursor back to where it belongs.
+ See the "sm" field in 'guicursor' for setting the cursor shape and
+ blinking when showing the match.
+ The 'matchpairs' option can be used to specify the characters to show
+ matches for. 'rightleft' and 'revins' are used to look for opposite
+ matches.
+ Note: For the use of the short form parental guidance is advised.
+
+ *'showmode'* *'smd'* *'noshowmode'* *'nosmd'*
+'showmode' 'smd' boolean (Vim default: on, Vi default: off)
+ global
+ If in Insert, Replace or Visual mode put a message on the last line.
+ Use the 'M' flag in 'highlight' to set the type of highlighting for
+ this message.
+ When |XIM| may be used the message will include "XIM". But this
+ doesn't mean XIM is really active, especially when 'imactivatekey' is
+ not set.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'sidescroll'* *'ss'*
+'sidescroll' 'ss' number (default 0)
+ global
+ {not in Vi}
+ The minimal number of columns to scroll horizontally. Used only when
+ the 'wrap' option is off and the cursor is moved off of the screen.
+ When it is zero the cursor will be put in the middle of the screen.
+ When using a slow terminal set it to a large number or 0. When using
+ a fast terminal use a small number or 1. Not used for "zh" and "zl"
+ commands.
+
+ *'sidescrolloff'* *'siso'*
+'sidescrolloff' 'siso' number (default 0)
+ global
+ {not in Vi}
+ The minimal number of screen columns to keep to the left and to the
+ right of the cursor if 'nowrap' is set. Setting this option to a value
+ greater than 0 while having |'sidescroll'| also at a non-zero value
+ makes some context visible in the line you are scrolling in
+ horizontally (except at the end and beginning of the line). Setting
+ this option to a large value (like 999) has the effect of keeping the
+ cursor horizontally centered in the window, as long as one does not
+ come too close to the beginning or end of the line.
+ NOTE: This option is set to 0 when 'compatible' is set.
+
+ Example: Try this together with 'sidescroll' and 'listchars' as
+ in the following example to never allow the cursor to move
+ onto the "extends" character:
+
+ :set nowrap sidescroll=1 listchars=extends:>,precedes:<
+ :set sidescrolloff=1
+
+
+ *'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
+'smartcase' 'scs' boolean (default off)
+ global
+ {not in Vi}
+ Override the 'ignorecase' option if the search pattern contains upper
+ case characters. Only used when the search pattern is typed and
+ 'ignorecase' option is on. Used for the commands "/", "?", "n", "N",
+ ":g" and ":s". Not used for "*", "#", "gd", tag search, etc.. After
+ "*" and "#" you can make 'smartcase' used by doing a "/" command,
+ recalling the search pattern from history and hitting <Enter>.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'smartindent'* *'si'* *'nosmartindent'* *'nosi'*
+'smartindent' 'si' boolean (default off)
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the
+ |+smartindent| feature}
+ Do smart autoindenting when starting a new line. Works for C-like
+ programs, but can also be used for other languages. 'cindent' does
+ something like this, works better in most cases, but is more strict,
+ see |C-indenting|. When 'cindent' is on, setting 'si' has no effect.
+ 'indentexpr' is a more advanced alternative.
+ Normally 'autoindent' should also be on when using 'smartindent'.
+ An indent is automatically inserted:
+ - After a line ending in '{'.
+ - After a line starting with a keyword from 'cinwords'.
+ - Before a line starting with '}' (only with the "O" command).
+ When typing '}' as the first character in a new line, that line is
+ given the same indent as the matching '{'.
+ When typing '#' as the first character in a new line, the indent for
+ that line is removed, the '#' is put in the first column. The indent
+ is restored for the next line. If you don't want this, use this
+ mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
+ When using the ">>" command, lines starting with '#' are not shifted
+ right.
+ NOTE: 'smartindent' is reset when 'compatible' is set. When 'paste'
+ is set smart indenting is disabled.
+
+ *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
+'smarttab' 'sta' boolean (default off)
+ global
+ {not in Vi}
+ When on, a <Tab> in front of a line inserts blanks according to
+ 'shiftwidth'. 'tabstop' is used in other places. A <BS> will delete
+ a 'shiftwidth' worth of space at the start of the line.
+ When off a <Tab> always inserts blanks according to 'tabstop'.
+ 'shiftwidth' is only used for shifting text left or right
+ |shift-left-right|.
+ What gets inserted (a Tab or spaces) depends on the 'expandtab'
+ option. Also see |ins-expandtab|. When 'expandtab' is not set, the
+ number of spaces minimized by using <Tab>s.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'softtabstop'* *'sts'*
+'softtabstop' 'sts' number (default 0)
+ local to buffer
+ {not in Vi}
+ Number of spaces that a <Tab> counts for while performing editing
+ operations, like inserting a <Tab> or using <BS>. It "feels" like
+ <Tab>s are being inserted, while in fact a mix of spaces and <Tab>s is
+ used. This is useful to keep the 'ts' setting at its standard value
+ of 8, while being able to edit like it is set to 'sts'. However,
+ commands like "x" still work on the actual characters.
+ When 'sts' is zero, this feature is off.
+ 'softtabstop' is set to 0 when the 'paste' option is set.
+ See also |ins-expandtab|. When 'expandtab' is not set, the number of
+ spaces is minimized by using <Tab>s.
+ The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
+ set.
+ NOTE: This option is set to 0 when 'compatible' is set.
+
+ *'splitbelow'* *'sb'* *'nosplitbelow'* *'nosb'*
+'splitbelow' 'sb' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the +windows
+ feature}
+ When on, splitting a window will put the new window below the current
+ one. |:split|
+
+ *'splitright'* *'spr'* *'nosplitright'* *'nospr'*
+'splitright' 'spr' boolean (default off)
+ global
+ {not in Vi}
+ {not available when compiled without the +vertsplit
+ feature}
+ When on, splitting a window will put the new window right of the
+ current one. |:vsplit|
+
+ *'startofline'* *'sol'* *'nostartofline'* *'nosol'*
+'startofline' 'sol' boolean (default on)
+ global
+ {not in Vi}
+ When "on" the commands listed below move the cursor to the first
+ blank of the line. When off the cursor is kept in the same column
+ (if possible). This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
+ CTRL-F, "G", "H", "M", "L", , and to the commands "d", "<<" and ">>"
+ with a linewise operator, with "%" with a count and to buffer changing
+ commands (CTRL-^, :bnext, :bNext, etc.). Also for an Ex command that
+ only has a line number, e.g., ":25" or ":+".
+ In case of buffer changing commands the cursor is placed at the column
+ where it was the last time the buffer was edited.
+ NOTE: This option is set when 'compatible' is set.
+
+ *'statusline'* *'stl'* *E540* *E541* *E542*
+'statusline' 'stl' string (default empty)
+ global
+ {not in Vi}
+ {not available when compiled without the |+statusline|
+ feature}
+ When nonempty, this option determines the content of the status line.
+ Also see |status-line|.
+
+ The option consists of printf style '%' items interspersed with
+ normal text. Each status line item is of the form:
+ %-0{minwid}.{maxwid}{item}
+ All fields except the {item} is optional. A single percent sign can
+ be given as "%%". Up to 80 items can be specified.
+
+ Note that the only effect of 'ruler' when this option is set (and
+ 'laststatus' is 2) is controlling the output of |CTRL-G|.
+
+ field meaning ~
+ - Left justify the item. The default is right justified
+ when minwid is larger than the length of the item.
+ 0 Leading zeroes in numeric items. Overridden by '-'.
+ minwid Minimum width of the item, padding as set by '-' & '0'.
+ Value must be 50 or less.
+ maxwid Maximum width of the item. Truncation occurs with a '<'
+ on the left for text items. Numeric items will be
+ shifted down to maxwid-2 digits followed by '>'number
+ where number is the amount of missing digits, much like
+ an exponential notation.
+ item A one letter code as described below.
+
+ Following is a description of the possible statusline items. The
+ second character in "item" is the type:
+ N for number
+ S for string
+ F for flags as described below
+ - not applicable
+
+ item meaning ~
+ f S Path to the file in the buffer, relative to current directory.
+ F S Full path to the file in the buffer.
+ t S File name (tail) of file in the buffer.
+ m F Modified flag, text is " [+]"; " [-]" if 'modifiable' is off.
+ M F Modified flag, text is ",+" or ",-".
+ r F Readonly flag, text is " [RO]".
+ R F Readonly flag, text is ",RO".
+ h F Help buffer flag, text is " [help]".
+ H F Help buffer flag, text is ",HLP".
+ w F Preview window flag, text is " [Preview]".
+ W F Preview window flag, text is ",PRV".
+ y F Type of file in the buffer, e.g., " [vim]". See 'filetype'.
+ Y F Type of file in the buffer, e.g., ",VIM". See 'filetype'.
+ {not available when compiled without |+autocmd| feature}
+ k S Value of "b:keymap_name" or 'keymap' when |:lmap| mappings are
+ being used: "<keymap>"
+ n N Buffer number.
+ b N Value of byte under cursor.
+ B N As above, in hexadecimal.
+ o N Byte number in file of byte under cursor, first byte is 1.
+ Mnemonic: Offset from start of file (with one added)
+ {not available when compiled without |+byte_offset| feature}
+ O N As above, in hexadecimal.
+ N N Printer page number. (Only works in the 'printheader' option.)
+ l N Line number.
+ L N Number of lines in buffer.
+ c N Column number.
+ v N Virtual column number.
+ V N Virtual column number as -{num}. Not displayed if equal to 'c'.
+ p N Percentage through file in lines as in |CTRL-G|.
+ P S Percentage through file of displayed window. This is like the
+ percentage described for 'ruler'. Always 3 in length.
+ a S Argument list status as in default title. ({current} of {max})
+ Empty if the argument file count is zero or one.
+ { NF Evaluate expression between '{' and '}' and substitute result.
+ ( - Start of item group. Can be used for setting the width and
+ alignment of a section. Must be followed by %) somewhere.
+ ) - End of item group. No width fields allowed.
+ < - Where to truncate line if too long. Default is at the start.
+ No width fields allowed.
+ = - Separation point between left and right aligned items.
+ No width fields allowed.
+ * - Set highlight group to User{N}, where {N} is taken from the
+ minwid field. eg. %1*. Restore normal highlight with %* or %0*.
+ The difference between User{N} and StatusLine will be applied
+ to StatusLineNC for the statusline of non-current windows.
+ The number N must be between 1 and 9. See |hl-User1..9|
+
+ Display of flags are controlled by the following heuristic:
+ If a flag text starts with comma it is assumed that it wants to
+ separate itself from anything but preceding plaintext. If it starts
+ with a space it is assumed that it wants to separate itself from
+ anything but other flags. That is: A leading comma is removed if the
+ preceding character stems from plaintext. A leading space is removed
+ if the preceding character stems from another active flag. This will
+ make a nice display when flags are used like in the examples below.
+
+ When all items in a group becomes an empty string (ie. flags that are
+ not set) and a minwid is not set for the group, the whole group will
+ become empty. This will make a group like the following disappear
+ completely from the statusline when none of the flags are set. >
+ :set statusline=...%(\ [%M%R%H]%)...
+<
+ Beware that an expression is evaluated each and every time the status
+ line is displayed. The current buffer and current window will be set
+ temporarily to that of the window (and buffer) whose statusline is
+ currently being drawn. The expression will evaluate in this context.
+ The variable "actual_curbuf" is set to the 'bufnr()' number of the
+ real current buffer. The expression is evaluated in the |sandbox|.
+
+ If the statusline is not updated when you want it (e.g., after setting
+ a variable that's used in an expression), you can force an update by
+ setting an option without changing its value. Example: >
+ :let &ro = &ro
+
+< A result of all digits is regarded a number for display purposes.
+ Otherwise the result is taken as flag text and applied to the rules
+ described above.
+
+ Watch out for errors in expressions. They may render Vim unusable !
+ If you are stuck, hold down ':' or 'Q' to get a prompt, then quit and
+ edit your .vimrc or whatever with "vim -u NONE" to get it right.
+
+ Examples:
+ Emulate standard status line with 'ruler' set >
+ :set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
+< Similar, but add ASCII value of char under the cursor (like "ga") >
+ :set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
+< Display byte count and byte value, modified flag in red. >
+ :set statusline=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b'
+ :hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red
+< Display a ,GZ flag if a compressed file is loaded >
+ :set statusline=...%r%{VarExists('b:gzflag','\ [GZ]')}%h...
+< In the |:autocmd|'s: >
+ :let b:gzflag = 1
+< And: >
+ :unlet b:gzflag
+< And define this function: >
+ :function VarExists(var, val)
+ : if exists(a:var) | return a:val | else | return '' | endif
+ :endfunction
+<
+ *'suffixes'* *'su'*
+'suffixes' 'su' string (default ".bak,~,.o,.h,.info,.swp,.obj")
+ global
+ {not in Vi}
+ Files with these suffixes get a lower priority when multiple files
+ match a wildcard. See |suffixes|. Commas can be used to separate the
+ suffixes. Spaces after the comma are ignored. A dot is also seen as
+ the start of a suffix. To avoid a dot or comma being recognized as a
+ separator, precede it with a backslash (see |option-backslash| about
+ including spaces and backslashes).
+ See 'wildignore' for completely ignoring files.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ suffixes from the list. This avoids problems when a future version
+ uses another default.
+
+ *'suffixesadd'* *'sua'*
+'suffixesadd' 'sua' string (default "")
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the
+ |+file_in_path| feature}
+ Comma separated list of suffixes, which are used when searching for a
+ file for the "gf", "[I", etc. commands. Example: >
+ :set suffixesadd=.java
+<
+ *'swapfile'* *'swf'* *'noswapfile'* *'noswf'*
+'swapfile' 'swf' boolean (default on)
+ local to buffer
+ {not in Vi}
+ Use a swapfile for the buffer. This option can be reset when a
+ swapfile is not wanted for a specific buffer. For example, with
+ confidential information that even root must not be able to access.
+ Careful: All text will be in memory:
+ - Don't use this for big files.
+ - Recovery will be impossible!
+ A swapfile will only be present when |'updatecount'| is non-zero and
+ 'swapfile' is set.
+ When 'swapfile' is reset, the swap file for the current buffer is
+ immediately deleted. When 'swapfile' is set, and 'updatecount' is
+ non-zero, a swap file is immediately created.
+ Also see |swap-file| and |'swapsync'|.
+
+ This option is used together with 'bufhidden' and 'buftype' to
+ specify special kinds of buffers. See |special-buffers|.
+
+ *'swapsync'* *'sws'*
+'swapsync' 'sws' string (default "fsync")
+ global
+ {not in Vi}
+ When this option is not empty a swap file is synced to disk after
+ writing to it. This takes some time, especially on busy unix systems.
+ When this option is empty parts of the swap file may be in memory and
+ not written to disk. When the system crashes you may lose more work.
+ On Unix the system does a sync now and then without Vim asking for it,
+ so the disadvantage of setting this option off is small. On some
+ systems the swap file will not be written at all. For a unix system
+ setting it to "sync" will use the sync() call instead of the default
+ fsync(), which may work better on some systems.
+
+ *'switchbuf'* *'swb'*
+'switchbuf' 'swb' string (default "")
+ global
+ {not in Vi}
+ This option controls the behavior when switching between buffers.
+ Possible values (comma separated list):
+ useopen If included, jump to the first open window that
+ contains the specified buffer (if there is one).
+ Otherwise: Do not examine other windows.
+ This setting is checked with |quickfix| commands, when
+ jumping to errors (":cc", ":cn", "cp", etc.). It is
+ also used in all buffer related split commands, for
+ example ":sbuffer", ":sbnext", or ":sbrewind".
+ split If included, split the current window before loading
+ a buffer. Otherwise: do not split, use current window.
+ Supported in |quickfix| commands that display errors.
+
+ *'syntax'* *'syn'*
+'syntax' 'syn' string (default empty)
+ local to buffer
+ {not in Vi}
+ {not available when compiled without the |+syntax|
+ feature}
+ When this option is set, the syntax with this name is loaded, unless
+ syntax highlighting has been switched off with ":syntax off".
+ Otherwise this option does not always reflect the current syntax (the
+ b:current_syntax variable does).
+ This option is most useful in a modeline, for a file which syntax is
+ not automatically recognized. Example, for in an IDL file: >
+ /* vim: set syntax=idl : */
+< To switch off syntax highlighting for the current file, use: >
+ :set syntax=OFF
+< To switch syntax highlighting on according to the current value of the
+ 'filetype' option: >
+ :set syntax=ON
+< What actually happens when setting the 'syntax' option is that the
+ Syntax autocommand event is triggered with the value as argument.
+ This option is not copied to another buffer, independent of the 's' or
+ 'S' flag in 'cpoptions'.
+
+ *'tabstop'* *'ts'*
+'tabstop' 'ts' number (default 8)
+ local to buffer
+ Number of spaces that a <Tab> in the file counts for. Also see
+ |:retab| command, and 'softtabstop' option.
+
+ Note: Setting 'tabstop' to any other value than 8 can make your file
+ appear wrong in many places (e.g., when printing it).
+
+ There are four main ways to use tabs in Vim:
+ 1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
+ (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim
+ will use a mix of tabs and spaces, but typing Tab and BS will
+ behave like a tab appears every 4 (or 3) characters.
+ 2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
+ 'expandtab'. This way you will always insert spaces. The
+ formatting will never be messed up when 'tabstop' is changed.
+ 3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
+ |modeline| to set these values when editing the file again. Only
+ works when using Vim to edit the file.
+ 4. Always set 'tabstop' and 'shiftwidth' to the same value, and
+ 'noexpandtab'. This should then work (for initial indents only)
+ for any tabstop setting that people use. It might be nice to have
+ tabs after the first non-blank inserted as spaces if you do this
+ though. Otherwise aligned comments will be wrong when 'tabstop' is
+ changed.
+
+ *'tagbsearch'* *'tbs'* *'notagbsearch'* *'notbs'*
+'tagbsearch' 'tbs' boolean (default on)
+ global
+ {not in Vi}
+ When searching for a tag (e.g., for the |:ta| command), Vim can either
+ use a binary search or a linear search in a tags file. Binary
+ searching makes searching for a tag a LOT faster, but a linear search
+ will find more tags if the tags file wasn't properly sorted.
+ Vim normally assumes that your tags files are sorted, or indicate that
+ they are not sorted. Only when this is not the case does the
+ 'tagbsearch' option need to be switched off.
+
+ When 'tagbsearch' is on, binary searching is first used in the tags
+ files. In certain situations, Vim will do a linear search instead for
+ certain files, or retry all files with a linear search. When
+ 'tagbsearch' is off, only a linear search is done.
+
+ Linear searching is done anyway, for one file, when Vim finds a line
+ at the start of the file indicating that it's not sorted: >
+ !_TAG_FILE_SORTED 0 /some command/
+< [The whitespace before and after the '0' must be a single <Tab>]
+
+ When a binary search was done and no match was found in any of the
+ files listed in 'tags', and 'ignorecase' is set or a pattern is used
+ instead of a normal tag name, a retry is done with a linear search.
+ Tags in unsorted tags files, and matches with different case will only
+ be found in the retry.
+
+ If a tag file indicates that is is case-fold sorted, the second,
+ linear search can be avoided for the 'ignorecase' case. Use a value
+ of '2' in the "!_TAG_FILE_SORTED" line for this. A tag file can be
+ case-fold sorted with the -f switch to "sort" in most unices, as in
+ the command: "sort -f -o tags tags". For "Exuberant ctags" version
+ 5.3 or higher the -f or --fold-case-sort switch can be used for this
+ as well. Note that case must be folded to uppercase for this to work.
+
+ When 'tagbsearch' is off, tags searching is slower when a full match
+ exists, but faster when no full match exists. Tags in unsorted tags
+ files may only be found with 'tagbsearch' off.
+ When the tags file is not sorted, or sorted in a wrong way (not on
+ ASCII byte value), 'tagbsearch' should be off, or the line given above
+ must be included in the tags file.
+ This option doesn't affect commands that find all matching tags (e.g.,
+ command-line completion and ":help").
+ {Vi: always uses binary search in some versions}
+
+ *'taglength'* *'tl'*
+'taglength' 'tl' number (default 0)
+ global
+ If non-zero, tags are significant up to this number of characters.
+
+ *'tagrelative'* *'tr'* *'notagrelative'* *'notr'*
+'tagrelative' 'tr' boolean (Vim default: on, Vi default: off)
+ global
+ {not in Vi}
+ If on and using a tag file in another directory, file names in that
+ tag file are relative to the directory where the tag file is.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'tags'* *'tag'* *E433*
+'tags' 'tag' string (default "./tags,tags", when compiled with
+ |+emacs_tags|: "./tags,./TAGS,tags,TAGS")
+ global or local to buffer |global-local|
+ Filenames for the tag command, separated by spaces or commas. To
+ include a space or comma in a file name, precede it with a backslash
+ (see |option-backslash| about including spaces and backslashes).
+ When a file name starts with "./", the '.' is replaced with the path
+ of the current file. But only when the 'd' flag is not included in
+ 'cpoptions'. Environment variables are expanded |:set_env|. Also see
+ |tags-option|.
+ "*", "**" and other wildcards can be used to search for tags files in
+ a directory tree. See |file-searching|. {not available when compiled
+ without the |+path_extra| feature}
+ If Vim was compiled with the |+emacs_tags| feature, Emacs-style tag
+ files are also supported. They are automatically recognized. The
+ default value becomes "./tags,./TAGS,tags,TAGS", unless case
+ differences are ignored (MS-Windows). |emacs-tags|
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ file names from the list. This avoids problems when a future version
+ uses another default.
+ {Vi: default is "tags /usr/lib/tags"}
+
+ *'tagstack'* *'tgst'* *'notagstack'* *'notgst'*
+'tagstack' 'tgst' boolean (default on)
+ global
+ {not in all versions of Vi}
+ When on, the |tagstack| is used normally. When off, a ":tag" or
+ ":tselect" command with an argument will not push the tag onto the
+ tagstack. A following ":tag" without an argument, a ":pop" command or
+ any other command that uses the tagstack will use the unmodified
+ tagstack, but does change the pointer to the active entry.
+ Resetting this option is useful when using a ":tag" command in a
+ mapping which should not change the tagstack.
+
+ *'term'* *E529* *E530* *E531*
+'term' string (default is $TERM, if that fails:
+ in the GUI: "builtin_gui"
+ on Amiga: "amiga"
+ on BeOS: "beos-ansi"
+ on Mac: "mac-ansi"
+ on MiNT: "vt52"
+ on MS-DOS: "pcterm"
+ on OS/2: "os2ansi"
+ on Unix: "ansi"
+ on VMS: "ansi"
+ on Win 32: "win32")
+ global
+ Name of the terminal. Used for choosing the terminal control
+ characters. Environment variables are expanded |:set_env|.
+ For example: >
+ :set term=$TERM
+< See |termcap|.
+
+ *'termbidi'* *'tbidi'*
+ *'notermbidi'* *'notbidi'*
+'termbidi' 'tbidi' boolean (default off, on for "mlterm")
+ global
+ {not in Vi}
+ {only available when compiled with the |+arabic|
+ feature}
+ The terminal is in charge of Bi-directionality of text (as specified
+ by Unicode). The terminal is also expected to do the required shaping
+ that some languages (such as Arabic) require.
+ Setting this option implies that 'rightleft' will not be set when
+ 'arabic' is set and the value of 'arabicshape' will be ignored.
+ Note that setting 'termbidi' has the immediate effect that
+ 'arabicshape' is ignored, but 'rightleft' isn't changed automatically.
+ This option is reset when the GUI is started.
+ For further details see |arabic.txt|.
+
+ *'termencoding'* *'tenc'*
+'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with
+ Macintosh GUI: "macroman")
+ global
+ {only available when compiled with the |+multi_byte|
+ feature}
+ {not in Vi}
+ Encoding used for the terminal. This specifies what character
+ encoding the keyboard produces and the display will understand. For
+ the GUI it only applies to the keyboard ('encoding' is used for the
+ display).
+ In the Win32 console version the default value is the console codepage
+ when it differs from the ANSI codepage.
+ *E617*
+ Note: This does not apply to the GTK+ 2 GUI. After the GUI has been
+ successfully initialized, 'termencoding' is forcibly set to "utf-8".
+ Any attempts to set a different value will be rejected, and an error
+ message is shown.
+ For the Win32 GUI 'termencoding' is not used for typed characters,
+ because the Win32 system always passes Unicode characters.
+ When empty, the same encoding is used as for the 'encoding' option.
+ This is the normal value.
+ Not all combinations for 'termencoding' and 'encoding' are valid. See
+ |encoding-table|.
+ The value for this option must be supported by internal conversions or
+ iconv(). When this is not possible no conversion will be done and you
+ will probably experience problems with non-ASCII characters.
+ Example: You are working with the locale set to euc-jp (Japanese) and
+ want to edit a UTF-8 file: >
+ :let &termencoding = &encoding
+ :set encoding=utf-8
+< You need to do this when your system has no locale support for UTF-8.
+
+ *'terse'* *'noterse'*
+'terse' boolean (default off)
+ global
+ When set: Add 's' flag to 'shortmess' option (this makes the message
+ for a search that hits the start or end of the file not being
+ displayed). When reset: Remove 's' flag from 'shortmess' option. {Vi
+ shortens a lot of messages}
+
+ *'textauto'* *'ta'* *'notextauto'* *'nota'*
+'textauto' 'ta' boolean (Vim default: on, Vi default: off)
+ global
+ {not in Vi}
+ This option is obsolete. Use 'fileformats'.
+ For backwards compatibility, when 'textauto' is set, 'fileformats' is
+ set to the default value for the current system. When 'textauto' is
+ reset, 'fileformats' is made empty.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'textmode'* *'tx'* *'notextmode'* *'notx'*
+'textmode' 'tx' boolean (MS-DOS, Win32 and OS/2: default on,
+ others: default off)
+ local to buffer
+ {not in Vi}
+ This option is obsolete. Use 'fileformat'.
+ For backwards compatibility, when 'textmode' is set, 'fileformat' is
+ set to "dos". When 'textmode' is reset, 'fileformat' is set to
+ "unix".
+
+ *'textwidth'* *'tw'*
+'textwidth' 'tw' number (default 0)
+ local to buffer
+ {not in Vi}
+ Maximum width of text that is being inserted. A longer line will be
+ broken after white space to get this width. A zero value disables
+ this. 'textwidth' is set to 0 when the 'paste' option is set. When
+ 'textwidth' is zero, 'wrapmargin' may be used. See also
+ 'formatoptions' and |ins-textwidth|.
+ NOTE: This option is set to 0 when 'compatible' is set.
+
+ *'thesaurus'* *'tsr'*
+'thesaurus' 'tsr' string (default "")
+ global or local to buffer |global-local|
+ {not in Vi}
+ List of file names, separated by commas, that are used to lookup words
+ for thesaurus completion commands |i_CTRL-X_CTRL-T|. Each line in
+ the file should contain words with similar meaning, separated by
+ non-keyword characters (white space is preferred). Maximum line
+ length is 510 bytes.
+ To obtain a file to be used here, check out the wordlist FAQ at
+ http://www.hyphenologist.co.uk .
+ To include a comma in a file name precede it with a backslash. Spaces
+ after a comma are ignored, otherwise spaces are included in the file
+ name. See |option-backslash| about using backslashes.
+ The use of |:set+=| and |:set-=| is preferred when adding or removing
+ directories from the list. This avoids problems when a future version
+ uses another default.
+ Backticks cannot be used in this option for security reasons.
+
+ *'tildeop'* *'top'* *'notildeop'* *'notop'*
+'tildeop' 'top' boolean (default off)
+ global
+ {not in Vi}
+ When on: The tilde command "~" behaves like an operator.
+ NOTE: This option is reset when 'compatible' is set.
+
+ *'timeout'* *'to'* *'notimeout'* *'noto'*
+'timeout' 'to' boolean (default on)
+ global
+ *'ttimeout'* *'nottimeout'*
+'ttimeout' boolean (default off)
+ global
+ {not in Vi}
+ These two options together determine the behavior when part of a
+ mapped key sequence or keyboard code has been received:
+
+ 'timeout' 'ttimeout' action ~
+ off off do not time out
+ on on or off time out on :mappings and key codes
+ off on time out on key codes
+
+ If both options are off, Vim will wait until either the complete
+ mapping or key sequence has been received, or it is clear that there
+ is no mapping or key sequence for the received characters. For
+ example: if you have mapped "vl" and Vim has received 'v', the next
+ character is needed to see if the 'v' is followed by an 'l'.
+ When one of the options is on, Vim will wait for about 1 second for
+ the next character to arrive. After that the already received
+ characters are interpreted as single characters. The waiting time can
+ be changed with the 'timeoutlen' option.
+ On slow terminals or very busy systems timing out may cause
+ malfunctioning cursor keys. If both options are off, Vim waits
+ forever after an entered <Esc> if there are key codes that start
+ with <Esc>. You will have to type <Esc> twice. If you do not have
+ problems with key codes, but would like to have :mapped key
+ sequences not timing out in 1 second, set the 'ttimeout' option and
+ reset the 'timeout' option.
+
+ NOTE: 'ttimeout' is reset when 'compatible' is set.
+
+ *'timeoutlen'* *'tm'*
+'timeoutlen' 'tm' number (default 1000)
+ global
+ {not in all versions of Vi}
+ *'ttimeoutlen'* *'ttm'*
+'ttimeoutlen' 'ttm' number (default -1)
+ global
+ {not in Vi}
+ The time in milliseconds that is waited for a key code or mapped key
+ sequence to complete. Also used for CTRL-\ CTRL-N and CTRL-\ CTRL-G
+ when part of a command has been typed.
+ Normally only 'timeoutlen' is used and 'ttimeoutlen' is -1. When a
+ different timeout value for key codes is desired set 'ttimeoutlen' to
+ a non-negative number.
+
+ ttimeoutlen mapping delay key code delay ~
+ < 0 'timeoutlen' 'timeoutlen'
+ >= 0 'timeoutlen' 'ttimeoutlen'
+
+ The timeout only happens when the 'timeout' and 'ttimeout' options
+ tell so. A useful setting would be >
+ :set timeout timeoutlen=3000 ttimeoutlen=100
+< (time out on mapping after three seconds, time out on key codes after
+ a tenth of a second).
+
+ *'title'* *'notitle'*
+'title' boolean (default off, on when title can be restored)
+ global
+ {not in Vi}
+ {not available when compiled without the |+title|
+ feature}
+ When on, the title of the window will be set to the value of
+ 'titlestring' (if it is not empty), or to:
+ filename [+=-] (path) - VIM
+ Where:
+ filename the name of the file being edited
+ - indicates the file cannot be modified, 'ma' off
+ + indicates the file was modified
+ = indicates the file is read-only
+ =+ indicates the file is read-only and modified
+ (path) is the path of the file being edited
+ - VIM the server name |v:servername| or "VIM"
+ Only works if the terminal supports setting window titles
+ (currently Amiga console, Win32 console, all GUI versions and
+ terminals with a non- empty 't_ts' option - these are Unix xterm and
+ iris-ansi by default, where 't_ts' is taken from the builtin termcap).
+ *X11*
+ When Vim was compiled with HAVE_X11 defined, the original title will
+ be restored if possible. The output of ":version" will include "+X11"
+ when HAVE_X11 was defined, otherwise it will be "-X11". This also
+ works for the icon name |'icon'|.
+ But: When Vim was started with the |-X| argument, restoring the title
+ will not work (except in the GUI).
+ If the title cannot be restored, it is set to the value of 'titleold'.
+ You might want to restore the title outside of Vim then.
+ When using an xterm from a remote machine you can use this command:
+ rsh machine_name xterm -display $DISPLAY &
+ then the WINDOWID environment variable should be inherited and the
+ title of the window should change back to what it should be after
+ exiting Vim.
+
+ *'titlelen'*
+'titlelen' number (default 85)
+ global
+ {not in Vi}
+ {not available when compiled without the |+title|
+ feature}
+ Gives the percentage of 'columns' to use for the length of the window
+ title. When the title is longer, only the end of the path name is
+ shown. A '<' character before the path name is used to indicate this.
+ Using a percentage makes this adapt to the width of the window. But
+ it won't work perfectly, because the actual number of characters
+ available also depends on the font used and other things in the title
+ bar. When 'titlelen' is zero the full path is used. Otherwise,
+ values from 1 to 30000 percent can be used.
+ 'titlelen' is also used for the 'titlestring' option.
+
+ *'titleold'*
+'titleold' string (default "Thanks for flying Vim")
+ global
+ {not in Vi}
+ {only available when compiled with the |+title|
+ feature}
+ This option will be used for the window title when exiting Vim if the
+ original title cannot be restored. Only happens if 'title' is on or
+ 'titlestring' is not empty.
+ *'titlestring'*
+'titlestring' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+title|
+ feature}
+ When this option is not empty, it will be used for the title of the
+ window. This happens only when the 'title' option is on.
+ Only works if the terminal supports setting window titles (currently
+ Amiga console, Win32 console, all GUI versions and terminals with a
+ non-empty 't_ts' option).
+ When Vim was compiled with HAVE_X11 defined, the original title will
+ be restored if possible |X11|.
+ When this option contains printf-style '%' items, they will be
+ expanded according to the rules used for 'statusline'.
+ Example: >
+ :auto BufEnter * let &titlestring = hostname() . "/" . expand("%:p")
+ :set title titlestring=%<%F%=%l/%L-%P titlelen=70
+< The value of 'titlelen' is used to align items in the middle or right
+ of the available space.
+ Some people prefer to have the file name first: >
+ :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
+< Note the use of "%{ }" and an expression to get the path of the file,
+ without the file name. The "%( %)" constructs are used to add a
+ separating space only when needed.
+ NOTE: Use of special characters in 'titlestring' may cause the display
+ to be garbled (e.g., when it contains a CR or NL character).
+ {not available when compiled without the |+statusline| feature}
+
+ *'toolbar'* *'tb'*
+'toolbar' 'tb' string (default "icons,tooltips")
+ global
+ {only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif| and
+ |+GUI_Photon|}
+ The contents of this option controls various toolbar settings. The
+ possible values are:
+ icons Toolbar buttons are shown with icons.
+ text Toolbar buttons shown with text.
+ horiz Icon and text of a toolbar button are
+ horizontally arranged. {only in GTK+ 2 GUI}
+ tooltips Tooltips are active for toolbar buttons.
+ Tooltips refer to the popup help text which appears after the mouse
+ cursor is placed over a toolbar button for a brief moment.
+
+ If you want the toolbar to be shown with icons as well as text, do the
+ following: >
+ :set tb=icons,text
+< Motif and Athena cannot display icons and text at the same time. They
+ will show icons if both are requested.
+
+ If none of the strings specified in 'toolbar' are valid or if
+ 'toolbar' is empty, this option is ignored. If you want to disable
+ the toolbar, you need to set the 'guioptions' option. For example: >
+ :set guioptions-=T
+< Also see |gui-toolbar|.
+
+ *'toolbariconsize'* *'tbis'*
+'toolbariconsize' 'tbis' string (default "small")
+ global
+ {not in Vi}
+ {only in the GTK+ 2 GUI}
+ Controls the size of toolbar icons. The possible values are:
+ tiny Use tiny toolbar icons.
+ small Use small toolbar icons (default).
+ medium Use medium-sized toolbar icons.
+ large Use large toolbar icons.
+ The exact dimensions in pixels of the various icon sizes depend on
+ the current theme. Common dimensions are large=32x32, medium=24x24,
+ small=20x20 and tiny=16x16.
+
+ If 'toolbariconsize' is empty, the global default size as determined
+ by user preferences or the current theme is used.
+
+ *'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
+'ttybuiltin' 'tbi' boolean (default on)
+ global
+ {not in Vi}
+ When on, the builtin termcaps are searched before the external ones.
+ When off the builtin termcaps are searched after the external ones.
+ When this option is changed, you should set the 'term' option next for
+ the change to take effect, for example: >
+ :set notbi term=$TERM
+< See also |termcap|.
+ Rationale: The default for this option is "on", because the builtin
+ termcap entries are generally better (many systems contain faulty
+ xterm entries...).
+
+ *'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
+'ttyfast' 'tf' boolean (default off, on when 'term' is xterm, hpterm,
+ sun-cmd, screen, rxvt, dtterm or
+ iris-ansi; also on when running Vim in
+ a DOS console)
+ global
+ {not in Vi}
+ Indicates a fast terminal connection. More characters will be sent to
+ the screen for redrawing, instead of using insert/delete line
+ commands. Improves smoothness of redrawing when there are multiple
+ windows and the terminal does not support a scrolling region.
+ Also enables the extra writing of characters at the end of each screen
+ line for lines that wrap. This helps when using copy/paste with the
+ mouse in an xterm and other terminals.
+
+ *'ttymouse'* *'ttym'*
+'ttymouse' 'ttym' string (default depends on 'term')
+ global
+ {not in Vi}
+ {only in Unix and VMS, doesn't work in the GUI; not
+ available when compiled without |+mouse|}
+ Name of the terminal type for which mouse codes are to be recognized.
+ Currently these three strings are valid:
+ *xterm-mouse*
+ xterm xterm-like mouse handling. The mouse generates
+ "<Esc>[Mscr", where "scr" is three bytes:
+ "s" = button state
+ "c" = column plus 33
+ "r" = row plus 33
+ xterm2 Works like "xterm", but with the xterm reporting the
+ mouse position while the mouse is dragged. This works
+ much faster and more precise. Your xterm must at
+ least at patchlevel 88 / XFree 3.3.3 for this to
+ work. See below for how Vim detects this
+ automatically.
+ *netterm-mouse*
+ netterm NetTerm mouse handling. The mouse generates
+ "<Esc>}r,c<CR>", where "r,c" are two decimal numbers
+ for the row and column.
+ *dec-mouse*
+ dec DEC terminal mouse handling. The mouse generates a
+ rather complex sequence, starting with "<Esc>[".
+ *jsbterm-mouse*
+ jsbterm JSB term mouse handling.
+ *pterm-mouse*
+ pterm QNX pterm mouse handling.
+
+ The mouse handling must be enabled at compile time |+mouse_xterm|
+ |+mouse_dec| |+mouse_netterm|.
+ Only "xterm"(2) is really recognized. NetTerm mouse codes are always
+ recognized, if enabled at compile time. DEC terminal mouse codes
+ are recognized if enabled at compile time, and 'ttymouse' is not
+ "xterm" (because the xterm and dec mouse codes conflict).
+ This option is automatically set to "xterm", when the 'term' option is
+ set to a name that starts with "xterm", and 'ttymouse' is not "xterm"
+ or "xterm2" already. The main use of this option is to set it to
+ "xterm", when the terminal name doesn't start with "xterm", but it can
+ handle xterm mouse codes.
+ The "xterm2" value will be set if the xterm version is reported to be
+ 95 of higher. This only works when compiled with the |+termresponse|
+ feature and if |t_RV| is set to the escape sequence to request the
+ xterm version number. Otherwise "xterm2" must be set explicitly.
+ If you do not want 'ttymouse' to be set to "xterm2" automatically, set
+ t_RV to an empty string: >
+ :set t_RV=
+<
+ *'ttyscroll'* *'tsl'*
+'ttyscroll' 'tsl' number (default 999)
+ global
+ Maximum number of lines to scroll the screen. If there are more lines
+ to scroll the window is redrawn. For terminals where scrolling is
+ very slow and redrawing is not slow this can be set to a small number,
+ e.g., 3, to speed up displaying.
+
+ *'ttytype'* *'tty'*
+'ttytype' 'tty' string (default from $TERM)
+ global
+ Alias for 'term', see above.
+
+ *'undolevels'* *'ul'*
+'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
+ Win32 and OS/2)
+ global
+ {not in Vi}
+ Maximum number of changes that can be undone. Since undo information
+ is kept in memory, higher numbers will cause more memory to be used
+ (nevertheless, a single change can use an unlimited amount of memory).
+ Set to 0 for Vi compatibility: One level of undo and "u" undoes
+ itself: >
+ set ul=0
+< But you can also get Vi compatibility by including the 'u' flag in
+ 'cpoptions', and still be able to use CTRL-R to repeat undo.
+ Set to a negative number for no undo at all: >
+ set ul=-1
+< This helps when you run out of memory for a single change.
+ Also see |undo-two-ways|.
+
+ *'updatecount'* *'uc'*
+'updatecount' 'uc' number (default: 200)
+ global
+ {not in Vi}
+ After typing this many characters the swap file will be written to
+ disk. When zero, no swap file will be created at all (see chapter on
+ recovery |crash-recovery|). 'updatecount' is set to zero by starting
+ Vim with the "-n" option, see |startup|. When editing in readonly
+ mode this option will be initialized to 10000.
+ The swapfile can be disabled per buffer with |'swapfile'|.
+ When 'updatecount' is set from zero to non-zero, swap files are
+ created for all buffers that have 'swapfile' set. When 'updatecount'
+ is set to zero, existing swap files are not deleted.
+ Also see |'swapsync'|.
+ This option has no meaning in buffers where |'buftype'| is "nofile"
+ or "nowrite".
+
+ *'updatetime'* *'ut'*
+'updatetime' 'ut' number (default 4000)
+ global
+ {not in Vi}
+ If this many milliseconds nothing is typed the swap file will be
+ written to disk (see |crash-recovery|). Also used for the
+ |CursorHold| autocommand event.
+
+ *'verbose'* *'vbs'*
+'verbose' 'vbs' number (default 0)
+ global
+ {not in Vi, although some versions have a boolean
+ verbose option}
+ When bigger than zero, Vim will give messages about what it is doing.
+ Currently, these messages are given:
+ >= 1 When the viminfo file is read or written.
+ >= 2 When a file is ":source"'ed.
+ >= 5 Every searched tags file.
+ >= 8 Files for which a group of autocommands is executed.
+ >= 9 Every executed autocommand.
+ >= 12 Every executed function.
+ >= 13 When an exception is thrown, caught, finished, or discarded.
+ >= 14 Anything pending in a ":finally" clause.
+ >= 15 Every executed Ex command (truncated at 200 characters).
+
+ This option can also be set with the "-V" argument. See |-V|.
+ This option is also set by the |:verbose| command.
+
+ *'viewdir'* *'vdir'*
+'viewdir' 'vdir' string (default for Amiga, MS-DOS, OS/2 and Win32:
+ "$VIM/vimfiles/view",
+ for Unix: "~/.vim/view",
+ for Macintosh: "$VIM:vimfiles:view"
+ for VMS: "sys$login:vimfiles/view"
+ for RiscOS: "Choices:vimfiles/view")
+ global
+ {not in Vi}
+ {not available when compiled without the +mksession
+ feature}
+ Name of the directory where to store files for |:mkview|.
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'viewoptions'* *'vop'*
+'viewoptions' 'vop' string (default: "folds,options,cursor")
+ global
+ {not in Vi}
+ {not available when compiled without the +mksession
+ feature}
+ Changes the effect of the |:mkview| command. It is a comma separated
+ list of words. Each word enables saving and restoring something:
+ word save and restore ~
+ cursor cursor position in file and in window
+ folds manually created folds, opened/closed folds and local
+ fold options
+ options options and mappings local to a window or buffer (not
+ global values for local options)
+ slash backslashes in file names replaced with forward
+ slashes
+ unix with Unix end-of-line format (single <NL>), even when
+ on Windows or DOS
+
+ "slash" and "unix" are useful on Windows when sharing view files
+ with Unix. The Unix version of Vim cannot source dos format scripts,
+ but the Windows version of Vim can source unix format scripts.
+
+ *'viminfo'* *'vi'* *E526* *E527* *E528*
+'viminfo' 'vi' string (Vi default: "", Vim default for MS-DOS,
+ Windows and OS/2: '20,<50,s10,h,rA:,rB:,
+ for Amiga: '20,<50,s10,h,rdf0:,rdf1:,rdf2:
+ for others: '20,<50,s10,h)
+ global
+ {not in Vi}
+ {not available when compiled without the |+viminfo|
+ feature}
+ When non-empty, the viminfo file is read upon startup and written
+ when exiting Vim (see |viminfo-file|). The string should be a comma
+ separated list of parameters, each consisting of a single character
+ identifying the particular parameter, followed by a number or string
+ which specifies the value of that parameter. If a particular
+ character is left out, then the default value is used for that
+ parameter. The following is a list of the identifying characters and
+ the effect of their value.
+ CHAR VALUE ~
+ ! When included, save and restore global variables that start
+ with an uppercase letter, and don't contain a lowercase
+ letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis"
+ and "_K_L_M" are not.
+ " Maximum number of lines saved for each register. Old name of
+ the '<' item, with the disadvantage that you need to put a
+ backslash before the ", otherwise it will be recognized as the
+ start of a comment!
+ % When included, save and restore the buffer list. If Vim is
+ started with a file name argument, the buffer list is not
+ restored. If Vim is started without a file name argument, the
+ buffer list is restored from the viminfo file. Buffers
+ without a file name and buffers for help files are not written
+ to the viminfo file.
+ ' Maximum number of previously edited files for which the marks
+ are remembered. This parameter must always be included when
+ 'viminfo' is non-empty.
+ Including this item also means that the |jumplist| and the
+ |changelist| are stored in the viminfo file.
+ / Maximum number of items in the search pattern history to be
+ saved. If non-zero, then the previous search and substitute
+ patterns are also saved. When not included, the value of
+ 'history' is used.
+ : Maximum number of items in the command-line history to be
+ saved. When not included, the value of 'history' is used.
+ < Maximum number of lines saved for each register. If zero then
+ registers are not saved. When not included, all lines are
+ saved. '"' is the old name for this item.
+ Also see the 's' item below: limit specified in Kbyte.
+ @ Maximum number of items in the input-line history to be
+ saved. When not included, the value of 'history' is used.
+ c When included, convert the text in the viminfo file from the
+ 'encoding' used when writing the file to the current
+ 'encoding'. See |viminfo-encoding|.
+ f Whether file marks need to be stored. If zero, file marks ('0
+ to '9, 'A to 'Z) are not stored. When not present or when
+ non-zero, they are all stored. '0 is used for the current
+ cursor position (when exiting or when doing ":wviminfo").
+ h Disable the effect of 'hlsearch' when loading the viminfo
+ file. When not included, it depends on whether ":nohlsearch"
+ has been used since the last search command.
+ n Name of the viminfo file. The name must immediately follow
+ the 'n'. Must be the last one! If the "-i" argument was
+ given when starting Vim, that file name overrides the one
+ given here with 'viminfo'. Environment variables are expanded
+ when opening the file, not when setting the option.
+ r Removable media. The argument is a string (up to the next
+ ','). This parameter can be given several times. Each
+ specifies the start of a path for which no marks will be
+ stored. This is to avoid removable media. For MS-DOS you
+ could use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:". You can
+ also use it for temp files, e.g., for Unix: "r/tmp". Case is
+ ignored. Maximum length of each 'r' argument is 50
+ characters.
+ s Maximum size of an item in Kbyte. If zero then registers are
+ not saved. Currently only applies to registers. The default
+ "s10" will exclude registers with more than 10 Kbyte of text.
+ Also see the '<' item above: line count limit.
+
+ Example: >
+ :set viminfo='50,<1000,s100,:0,n~/vim/viminfo
+<
+ '50 Marks will be remembered for the last 50 files you
+ edited.
+ <1000 Contents of registers (up to 1000 lines each) will be
+ remembered.
+ s100 Registers with more than 100 Kbyte text are skipped.
+ :0 Command-line history will not be saved.
+ n~/vim/viminfo The name of the file to use is "~/vim/viminfo".
+ no / Since '/' is not specified, the default will be used,
+ that is, save all of the search history, and also the
+ previous search and substitute patterns.
+ no % The buffer list will not be saved nor read back.
+ no h 'hlsearch' highlighting will be restored.
+
+ When setting 'viminfo' from an empty value you can use |:rviminfo| to
+ load the contents of the file, this is not done automatically.
+
+ This option cannot be set from a |modeline| or in the |sandbox|, for
+ security reasons.
+
+ *'virtualedit'* *'ve'*
+'virtualedit' 've' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the
+ |+virtualedit| feature}
+ A comma separated list of these words:
+ block Allow virtual editing in Visual block mode.
+ insert Allow virtual editing in Insert mode.
+ all Allow virtual editing in all modes.
+ Virtual editing means that the cursor can be positioned where there is
+ no actual character. This can be halfway into a Tab or beyond the end
+ of the line. Useful for selecting a rectangle in Visual mode and
+ editing a table.
+
+ *'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
+'visualbell' 'vb' boolean (default off)
+ global
+ {not in Vi}
+ Use visual bell instead of beeping. The terminal code to display the
+ visual bell is given with 't_vb'. When no beep or flash is wanted,
+ use ":set vb t_vb=".
+ Note: When the GUI starts, 't_vb' is reset to its default value. You
+ might want to set it again in your |gvimrc|.
+ In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display
+ for 20 msec. If you want to use a different time, use "<Esc>|40f",
+ where 40 is the time in msec.
+ Does not work on the Amiga, you always get a screen flash.
+ Also see 'errorbells'.
+
+ *'warn'* *'nowarn'*
+'warn' boolean (default on)
+ global
+ Give a warning message when a shell command is used while the buffer
+ has been changed.
+
+ *'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'*
+'weirdinvert' 'wiv' boolean (default off)
+ global
+ {not in Vi}
+ This option has the same effect as the 't_xs' termcap option.
+ It is provided for backwards compatibility with version 4.x.
+ Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and
+ vice versa. Has no effect when the GUI is running.
+
+ *'whichwrap'* *'ww'*
+'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
+ global
+ {not in Vi}
+ Allow specified keys that move the cursor left/right to move to the
+ previous/next line when the cursor is on the first/last character in
+ the line. Concatenate characters to allow this for these keys:
+ char key mode ~
+ b <BS> Normal and Visual
+ s <Space> Normal and Visual
+ h "h" Normal and Visual
+ l "l" Normal and Visual
+ < <Left> Normal and Visual
+ > <Right> Normal and Visual
+ ~ "~" Normal
+ [ <Left> Insert and Replace
+ ] <Right> Insert and Replace
+ For example: >
+ :set ww=<,>,[,]
+< allows wrap only when cursor keys are used.
+ When the movement keys are used in combination with a delete or change
+ operator, the <EOL> also counts for a character. This makes "3h"
+ different from "3dh" when the cursor crosses the end of a line. This
+ is also true for "x" and "X", because they do the same as "dl" and
+ "dh". If you use this, you may also want to use the mapping
+ ":map <BS> X" to make backspace delete the character in front of the
+ cursor.
+ When 'l' is included, you get a side effect: "yl" on an empty line
+ will include the <EOL>, so that "p" will insert a new line.
+ NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'wildchar'* *'wc'*
+'wildchar' 'wc' number (Vim default: <Tab>, Vi default: CTRL-E)
+ global
+ {not in Vi}
+ Character you have to type to start wildcard expansion in the
+ command-line, as specified with 'wildmode'.
+ The character is not recognized when used inside a macro. See
+ 'wildcharm' for that.
+ Although 'wc' is a number option, you can set it to a special key: >
+ :set wc=<Esc>
+< NOTE: This option is set to the Vi default value when 'compatible' is
+ set and to the Vim default value when 'compatible' is reset.
+
+ *'wildcharm'* *'wcm'*
+'wildcharm' 'wcm' number (default: none (0))
+ global
+ {not in Vi}
+ 'wildcharm' works exactly like 'wildchar', except that it is
+ recognized when used inside a macro. You can find "spare" command-line
+ keys suitable for this option by looking at |ex-edit-index|. Normally
+ you'll never actually type 'wildcharm', just use it in mappings that
+ automatically invoke completion mode, e.g.: >
+ :set wcm=<C-Z>
+ :cmap ss so $vim/sessions/*.vim<C-Z>
+< Then after typing :ss you can use CTRL-P & CTRL-N.
+
+ *'wildignore'* *'wig'*
+'wildignore' 'wig' string (default "")
+ global
+ {not in Vi}
+ {not available when compiled without the |+wildignore|
+ feature}
+ A list of file patterns. A file that matches with one of these
+ patterns is ignored when completing file or directory names.
+ The pattern is used like with |:autocmd|, see |autocmd-patterns|.
+ Also see 'suffixes'.
+ Example: >
+ :set wildignore=*.o,*.obj
+< The use of |:set+=| and |:set-=| is preferred when adding or removing
+ a pattern from the list. This avoids problems when a future version
+ uses another default.
+
+ *'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'*
+'wildmenu' 'wmnu' boolean (default off)
+ global
+ {not in Vi}
+ {not available if compiled without the |+wildmenu|
+ feature}
+ When 'wildmenu' is on, command-line completion operates in an enhanced
+ mode. On pressing 'wildchar' (usually <Tab>) to invoke completion,
+ the possible matches are shown just above the command line, with the
+ first match highlighted (overwriting the status line, if there is
+ one). Keys that show the previous/next match, such as <Tab> or
+ CTRL-P/CTRL-N, cause the highlight to move to the appropriate match.
+ When 'wildmode' is used, "wildmenu" mode is used where "full" is
+ specified. "longest" and "list" do not start "wildmenu" mode.
+ If there are more matches than can fit in the line, a ">" is shown on
+ the right and/or a "<" is shown on the left. The status line scrolls
+ as needed.
+ The "wildmenu" mode is abandoned when a key is hit that is not used
+ for selecting a completion.
+ While the "wildmenu" is active the following keys have special
+ meanings:
+
+ <Left> <Right> - select previous/next match (like CTRL-P/CTRL-N)
+ <Down> - in filename/menu name completion: move into a
+ subdirectory or submenu.
+ <CR> - in menu completion, when the cursor is just after a
+ dot: move into a submenu.
+ <Up> - in filename/menu name completion: move up into
+ parent directory or parent menu.
+
+ This makes the menus accessible from the console |console-menus|.
+
+ If you prefer the <Left> and <Right> keys to move the cursor instead
+ of selecting a different match, use this: >
+ :cnoremap <Left> <Space><BS><Left>
+ :cnoremap <Right> <Space><BS><Right>
+<
+ The "WildMenu" highlighting is used for displaying the current match
+ |hl-WildMenu|.
+
+ *'wildmode'* *'wim'*
+'wildmode' 'wim' string (Vim default: "full")
+ global
+ {not in Vi}
+ Completion mode that is used for the character specified with
+ 'wildchar'. It is a comma separated list of up to four parts. Each
+ part specifies what to do for each consecutive use of 'wildchar. The
+ first part specifies the behavior for the first use of 'wildchar',
+ The second part for the second use, etc.
+ These are the possible values for each part:
+ "" Complete only the first match.
+ "full" Complete the next full match. After the last match,
+ the original string is used and then the first match
+ again.
+ "longest" Complete till longest common string. If this doesn't
+ result in a longer string, use the next part.
+ "longest:full" Like "longest", but also start 'wildmenu' if it is
+ enabled.
+ "list" When more than one match, list all matches.
+ "list:full" When more than one match, list all matches and
+ complete first match.
+ "list:longest" When more than one match, list all matches and
+ complete till longest common string.
+ When there is only a single match, it is fully completed in all cases.
+
+ Examples: >
+ :set wildmode=full
+< Complete first full match, next match, etc. (the default) >
+ :set wildmode=longest,full
+< Complete longest common string, then each full match >
+ :set wildmode=list:full
+< List all matches and complete each full match >
+ :set wildmode=list,full
+< List all matches without completing, then each full match >
+ :set wildmode=longest,list
+< Complete longest common string, then list alternatives.
+
+ *'winaltkeys'* *'wak'*
+'winaltkeys' 'wak' string (default "menu")
+ global
+ {not in Vi}
+ {only used in Win32, Motif, GTK and Photon GUI}
+ Some GUI versions allow the access to menu entries by using the ALT
+ key in combination with a character that appears underlined in the
+ menu. This conflicts with the use of the ALT key for mappings and
+ entering special characters. This option tells what to do:
+ no Don't use ALT keys for menus. ALT key combinations can be
+ mapped, but there is no automatic handling. This can then be
+ done with the |:simalt| command.
+ yes ALT key handling is done by the windowing system. ALT key
+ combinations cannot be mapped.
+ menu Using ALT in combination with a character that is a menu
+ shortcut key, will be handled by the windowing system. Other
+ keys can be mapped.
+ If the menu is disabled by excluding 'm' from 'guioptions', the ALT
+ key is never used for the menu.
+ In the Win32 version, the <F10> key is handled like this too, since
+ Windows uses it to select a menu.
+
+ *'winheight'* *'wh'* *E591*
+'winheight' 'wh' number (default 1)
+ global
+ {not in Vi}
+ {not available when compiled without the +windows
+ feature}
+ Minimal number of lines for the current window. This is not a hard
+ minimum, Vim will use fewer lines if there is not enough room. If the
+ current window is smaller, its size is increased, at the cost of the
+ height of other windows. Set it to 999 to make the current window
+ always fill the screen (although this has the drawback that ":all"
+ will create only two windows). Set it to a small number for normal
+ editing.
+ Minimum value is 1.
+ The height is not adjusted after one of the commands to change the
+ height of the current window.
+ 'winheight' applies to the current window. Use 'winminheight' to set
+ the minimal height for other windows.
+
+ *'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
+'winfixheight' 'wfh' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the +windows
+ feature}
+ Keep the window height when windows are opened or closed and
+ 'equalalways' is set. Set by default for the |preview-window| and
+ |quickfix-window|.
+ The height may be changed anyway when running out of room.
+
+ *'winminheight'* *'wmh'*
+'winminheight' 'wmh' number (default 1)
+ global
+ {not in Vi}
+ {not available when compiled without the +windows
+ feature}
+ The minimal height of a window, when it's not the current window.
+ This is a hard minimum, windows will never become smaller.
+ When set to zero, windows may be "squashed" to zero lines (i.e. just a
+ status bar) if necessary. They will return to at least one line when
+ they become active (since the cursor has to have somewhere to go.)
+ Use 'winheight' to set the minimal height of the current window.
+ This option is only checked when making a window smaller. Don't use a
+ large number, it will cause errors when opening more than a few
+ windows. A value of 0 to 3 is reasonable.
+
+ *'winminwidth'* *'wmw'*
+'winminwidth' 'wmw' number (default 1)
+ global
+ {not in Vi}
+ {not available when compiled without the +vertsplit
+ feature}
+ The minimal width of a window, when it's not the current window.
+ This is a hard minimum, windows will never become smaller.
+ When set to zero, windows may be "squashed" to zero columns (i.e. just
+ a vertical separator) if necessary. They will return to at least one
+ line when they become active (since the cursor has to have somewhere
+ to go.)
+ Use 'winwidth' to set the minimal width of the current window.
+ This option is only checked when making a window smaller. Don't use a
+ large number, it will cause errors when opening more than a few
+ windows. A value of 0 to 12 is reasonable.
+
+ *'winwidth'* *'wiw'* *E592*
+'winwidth' 'wiw' number (default 20)
+ global
+ {not in Vi}
+ {not available when compiled without the +vertsplit
+ feature}
+ Minimal number of columns for the current window. This is not a hard
+ minimum, Vim will use fewer columns if there is not enough room. If
+ the current window is smaller, its size is increased, at the cost of
+ the width of other windows. Set it to 999 to make the current window
+ always fill the screen. Set it to a small number for normal editing.
+ The width is not adjusted after one of the commands to change the
+ width of the current window.
+ 'winwidth' applies to the current window. Use 'winminwidth' to set
+ the minimal width for other windows.
+
+ *'wrap'* *'nowrap'*
+'wrap' boolean (default on)
+ local to window
+ {not in Vi}
+ This option changes how text is displayed. It doesn't change the text
+ in the buffer, see 'textwidth' for that.
+ When on, lines longer than the width of the window will wrap and
+ displaying continues on the next line. When off lines will not wrap
+ and only part of long lines will be displayed. When the cursor is
+ moved to a part that is not shown, the screen will scroll
+ horizontally.
+ The line will be broken in the middle of a word if necessary. See
+ 'linebreak' to get the break at a word boundary.
+ To make scrolling horizontally a bit more useful, try this: >
+ :set sidescroll=5
+ :set listchars+=precedes:<,extends:>
+< See 'sidescroll', 'listchars' and |wrap-off|.
+
+ *'wrapmargin'* *'wm'*
+'wrapmargin' 'wm' number (default 0)
+ local to buffer
+ Number of characters from the right window border where wrapping
+ starts. When typing text beyond this limit, an <EOL> will be inserted
+ and inserting continues on the next line.
+ Options that add a margin, such as 'number' and 'foldcolumn', cause
+ the text width to be further reduced. This is Vi compatible.
+ When 'textwidth' is non-zero, this option is not used.
+ See also 'formatoptions' and |ins-textwidth|. {Vi: works differently
+ and less usefully}
+
+ *'wrapscan'* *'ws'* *'nowrapscan'* *'nows'*
+'wrapscan' 'ws' boolean (default on) *E384* *E385*
+ global
+ Searches wrap around the end of the file.
+
+ *'write'* *'nowrite'*
+'write' boolean (default on)
+ global
+ {not in Vi}
+ Allows writing files. When not set, writing a file is not allowed.
+ Can be used for a view-only mode, where modifications to the text are
+ still allowed. Can be reset with the |-m| or |-M| command line
+ argument. Filtering text is still possible, even though this requires
+ writing a temporary file.
+
+ *'writeany'* *'wa'* *'nowriteany'* *'nowa'*
+'writeany' 'wa' boolean (default off)
+ global
+ Allows writing to any file with no need for "!" override.
+
+ *'writebackup'* *'wb'* *'nowritebackup'* *'nowb'*
+'writebackup' 'wb' boolean (default on with |+writebackup| feature, off
+ otherwise)
+ global
+ {not in Vi}
+ Make a backup before overwriting a file. The backup is removed after
+ the file was successfully written, unless the 'backup' option is
+ also on. Reset this option if your file system is almost full. See
+ |backup-table| for another explanation.
+ When the 'backupskip' pattern matches, a backup is not made anyway.
+ NOTE: This option is set to the default value when 'compatible' is
+ set.
+
+ *'writedelay'* *'wd'*
+'writedelay' 'wd' number (default 0)
+ global
+ {not in Vi}
+ The number of microseconds to wait for each character sent to the
+ screen. When non-zero, characters are sent to the terminal one by
+ one. For MS-DOS pcterm this does not work. For debugging purposes.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt
new file mode 100644
index 000000000..420260692
--- /dev/null
+++ b/runtime/doc/os_390.txt
@@ -0,0 +1,340 @@
+*os_390.txt* For Vim version 7.0aa. Last change: 2003 Jun 03
+
+
+ VIM REFERENCE MANUAL by Ralf Schandl
+
+ *zOS* *z/OS* *OS390* *os390* *MVS*
+This file contains the particulars for the z/OS UNIX version of Vim.
+
+1. Open source on z/OS UNIX |zOS-open-source|
+2. Your feedback is needed |zOS-feedback|
+3. Building VIM for z/OS UNIX |zOS-building|
+4. ASCII/EBCDIC dependent scripts |zOS-has-ebcdic|
+5. XTerm Problems |zOS-xterm|
+6. Motif Problems |zOS-Motif|
+7 Bugs |zOS-Bugs|
+8. Known weaknesses |zOS-weaknesses|
+9. Changes |zOS-changes|
+
+DISCLAIMER: ~
+We are IBM employees, but IBM is not responsible for this port. This is our
+private fun, and is provided in the hopes that it may be useful to others.
+
+Please note that this software has NOT been submitted to any formal IBM
+testing and is published AS IS. Please do not contact IBM for support for this
+software, as it is not an official component of any IBM product. IT IS NOT
+SUPPORTED, GUARANTEED, OR RELATED WHATSOEVER TO IBM.
+
+Contributors: ~
+The port to z/OS UNIX was done by Ralf Schandl for the Redbook mentioned
+below.
+
+Changes, bug-reports, or both by:
+
+ David Moore
+ Anthony Giorgio <agiorgio@fastmail.fm>
+ and others
+
+This document was written by Ralf Schandl and revised by Anthony Giorgio.
+
+==============================================================================
+1. Open source on z/OS UNIX *OS390-open-source* *zOS-open-source*
+
+If you are interested in other Open Source Software on z/OS UNIX, have a
+look at the following Redbook:
+
+ Mike MacIsaac et al
+ "Open Source Software for z/OS and OS/390 UNIX"
+ IBM Form Number: SG24-5944-01
+ ISBN: 0738424633
+
+You can find out more information, order a hard copy, or download a PDF
+version of these Redbooks at:
+
+ http://www.redbooks.ibm.com
+
+==============================================================================
+2. Your feedback is needed *OS390-feedback* *zOS-feedback*
+
+Vim should compile, link, and run right out of the box on a standard IBM z/OS
+UNIX mainframe. I've personally run it on z/OS V1R2 and V1R3 machines without
+problems.
+
+Many changes had to be done to the code to port Vim to z/OS UNIX. As like
+most UNIX programs, Vim contained heavy ASCII dependencies. I might have
+missed an ASCII dependency, or it is possible that a new one has been added
+with a feature or bug fix. Most programmers are simply not aware of possible
+ASCII/EBCDIC conversion issues. If you hit a problem that seems related to
+this, feel free to contact us at the email addresses above.
+
+One indication of ASCII/EBCDIC conversion problems is screen corruption with
+"unprintable" characters. For example, at one point the errorbell was broken
+in Vim. Any time Vim tried to ring the terminal bell an ASCII character 0x07
+would be printed. This works fine on most terminals, but is broken on an
+EBCDIC one. The correct solution was to define a different value for the bell
+character on EBCDIC systems.
+
+Remember, it's only possible to fix a bug if the community knows about it.
+Don't rely on someone else to report it! See the section |bug-reports|.
+
+==============================================================================
+3. Building VIM for z/OS UNIX *OS390-building* *zOS-building*
+
+A word on debugging code first: ~
+
+The normal run of configure adds the flag '-g' to the compiler options,
+to include debugging information into the executable. This information
+are normally removed from the executable with the strip command during
+installation. On z/OS UNIX, it is not possible to remove this from
+the executable. The strip command exists on z/OS UNIX and is called
+during the installation, but it does nothing. It is equivalent to the
+'touch' command. This is due to the way debug symbols are stored in the
+objects generated by the compiler.
+
+If you want to build Vim without debugging code, export the environment
+variable CFLAGS set to an empty string before you call the configure script.
+>
+ export CFLAGS=""
+
+
+Building without X11: ~
+
+Note: Use cc to build Vim. The c89 compiler has stricter syntax checking
+and will not compile Vim cleanly.
+
+If you build VIM without X11 support, compiling and building is
+straightforward. Don't forget to export _CC_CCMODE=1 before calling
+configure and make.
+>
+ $ export _CC_CCMODE=1
+ $./configure --with-features=big --without-x --enable-gui=no
+ $ make
+ $ make test
+<
+ Test notes:
+ Test 11 will fail if you do not have gzip installed.
+ Test 42 will fail, as VIM on z/OS UNIX doesn't support the multibyte
+ feature. (David Moore: "Doesn't work _yet_! :-) I'll see what I
+ can do.")
+>
+
+ $ make install
+
+
+Building with X11: ~
+
+There are two ways for building Vim with X11 support. You can link it
+statically with the X11 libraries or can bind it with the X11 DLLs. The
+statically linked version results in a huge executable (~13MB), while the
+dynamically linked executable is much smaller (~4.5MB).
+
+Here is what you do, if you want Motif:
+
+ a) Static link >
+ $ configure --with-features=big --enable-gui=motif
+ $ make
+<
+ VIM is now linked statically with the X11 libraries.
+
+ b) Dynamic link:
+ Make VIM as described for the static link. Then change the contents of
+ the 'auto/link.sed' file by appending: >
+ s%-lXm *%/usr/lib/Xm.x %g
+ s%-lX11 *%/usr/lib/X11.x %g
+ s%-lSM *%/usr/lib/SM.x %g
+ s%-lICE *%/usr/lib/ICE.x %g
+<
+ Then do: >
+ $ rm vim
+ $ make
+<
+ Now Vim is linked with the X11-DLLs.
+
+See the Makefile and the file link.sh on how link.sed is used.
+
+==============================================================================
+4. ASCII/EBCDIC dependent scripts *OS390-has-ebcdic* *zOS-has-ebcdic*
+
+For the internal script language the feature "ebcdic" was added. With this
+you can fix ASCII dependent scripts like this:
+>
+ if has("ebcdic")
+ let space = 64
+ else
+ let space = 32
+ endif
+<
+==============================================================================
+5. XTerm problems *OS390-xterm* *zOS-xterm*
+
+Note: This problem was resolved in version 6.1b. ~
+
+I saw one problem with XTerm on z/OS UNIX. The terminal code for moving the
+cursor to the left is wrong in the termlib database. Perhaps not wrong, but
+it didn't work with VIM syntax highlighting and command line cursor movement.
+
+If the highlighting is messed up while you type, but is okay after you refreshed
+the screen with <C-L> or if you can't move to the left with the cursor key on
+the command line, try adding >
+ :set t_le=^H
+<
+to your .vimrc. Note: '^H' is one character, hit <C-V><C-H> to get it.
+
+==============================================================================
+6. Motif Problems *OS390-Motif* *zOS-Motif*
+
+It seems that in porting the Motif library to z/OS, a translation from EBCDIC
+to ASCII for the accelerator characters of the pull-down menus was forgotten.
+Even after I tried to hand convert the menus, the accelerator keys continued
+to only work for the opening of menus (like <Alt-F> to open the file menu).
+They still do not work for the menu items themselves (like <Alt-F>O to open
+the file browser).
+
+There is no solution for this as of yet.
+
+==============================================================================
+7. Bugs *OS390-bugs* *zOS-Bugs*
+
+- Vim will consistently hang when a large amount of text is selected in
+ visual block mode. This may be due to a memory corruption issue. Note that
+ this occurs in both the terminal and gui versions.
+
+==============================================================================
+8. Known weaknesses *OS390-weaknesses* *zOS-weaknesses*
+
+- No binary search in tag files.
+ The program /bin/sort sorts by ASCII value by default. This program is
+ normally used by ctags to sort the tags. There might be a version of
+ ctags out there, that does it right, but we can't be sure. So this seems to
+ be a permanent restriction.
+
+- Multibyte support (utf-8) doesn't work, it's disabled at compile time.
+ (|multibyte|)
+
+- The cscope interface (|cscope|) doesn't work for the version of cscope
+ that we use on our mainframe. We have a copy of version 15.0b12, and it
+ causes Vim to hang when using the "cscope add" command. I'm guessing that
+ the binary format of the cscope database isn't quite what Vim is expecting.
+ I've tried to port the current version of cscope (15.3) to z/OS, without
+ much success. If anyone is interested in trying, drop me a line if you
+ make any progress.
+
+- No glib/gtk support. I have not been able to successfully compile glib on
+ z/OS UNIX. This means you'll have to live without the pretty gtk toolbar.
+
+Never tested:
+ - Perl interface (|perl|)
+ - Hangul input (|hangul|)
+ - Encryption support (|encryption|)
+ - Langmap (|'langmap'|)
+ - Python support (|Python|)
+ - Right-to-left mode (|'rightleft'|)
+ - SNiFF+ interface (|sniff|)
+ - TCL interface (|tcl|)
+ ...
+
+If you try any of these features and they work, drop us a note!
+
+==============================================================================
+9. Changes *OS390-changes* *zOS-changes*
+
+This is a small reference of the changes made to the z/OS port of Vim. It is
+not an exhaustive summary of all the modifications made to the code base.
+
+6.1b (beta):
+ Changed KS_LE in term.c to be "\b" instead of "\010" This fixed the
+ screen corruption problems in gVim reported by Anthony Giorgio.
+
+ Anthony Giorgio updated this document:
+ - Changed OS/390 to z/OS where appropriate. IBM decided to rename
+ all of its servers and operating systems. z/OS and OS/390
+ are the same product, but the version numbering system was
+ reset for the name change. (e.g. OS/390 V2R11 == z/OS V1R1)
+ - Added information about second edition of the Open Source Redbook.
+ - Moved Redbook information to a separate section.
+ - Various tweaks and changes.
+ - Updated testing section.
+
+6.0au:
+ Changed configure.in
+ Changed documentation.
+ Anthony Giorgio fixed the errorbell.
+
+ David Moore found some problems, which were fixed by Bram and/or David for
+ 6.0au.
+
+6.0q (alpha):
+ Minor changes for nrformats=alpha (see |'nrformats'|).
+ Problem with hard-coded keycode for the English pound sign. Added a define in
+ ascii.h
+ Disabled multibyte for EBCDIC in feature.h
+
+6.0f (alpha):
+ First compile of Vim 6 on z/OS UNIX. Some minor changes were needed.
+
+ Finally found the reason why make from the top level didn't work (I must have
+ been blind before!). The Makefile contained a list of targets in one target
+ line. On all other UNIX's the macro $@ evaluates to the first target in this
+ list, only on z/OS UNIX it evaluates to the last one :-(.
+
+5.6-390d:
+ Cleaned up some hacks.
+
+5.6-390c:
+ I grepped through the source and examined every spot with a character
+ involved in a operation (+-). I hope I now found all EBCDIC/ASCII
+ stuff, but ....
+
+ Fixed:
+ - fixed warning message in do_fixdel()
+ - fixed translation from Ctrl-Char to symbolic name (like ^h to CTRL-H)
+ for :help
+ - fixed yank/delete/... into register
+ - fixed :register command
+ - fixed viminfo register storing
+ - fixed quick-access table in findoptions()
+ - fixed 'g^H' select mode
+ - fixed tgetstr() 'get terminal capability string', ESC and
+ Ctrl chars where wrong. (Not used on OS/390 UNIX)
+
+
+ ctags:
+ - added trigraphs support (used in prolog of system header files)
+ (get.c)
+ - fixed sorting order with LC_COLLATE=S390 to force EBCDIC sorting.
+ (sort.c)
+
+5.6-390b:
+ Changed:
+ - configure.in:
+ - added test for OS/390 UNIX
+ - added special compiler and linker options if building with X11
+ - configure:
+ - after created via autoconf hand-edited it to make the test for
+ ICEConnectionNumber work. This is a autoconf problem. OS/390 UNIX
+ needs -lX11 for this.
+ - Makefile
+ - Don't include the lib directories ('-L...') into the variable
+ ALL_LIBS. Use own variable ALL_LIB_DIRS instead. A fully POSIX
+ compliant compiler must not accept objects/libraries and options
+ mixed. Now we can call the linker like this:
+
+ $(CC) $(LDFLAGS) $(ALL_LIB_DIRS) $(OBJ) $(ALL_LIBS)
+
+ Fixed:
+ - Double quote couldn't be entered
+ Missed ASCII dependencies while setting up terminal
+ In ASCII 127 is the delete char, in EBCDIC codepage 1047 the value 127
+ is the double quote.
+ - fixed ':fixdel'
+
+5.6-390a:
+ first alpha release for OS/390 UNIX.
+
+ Addition:
+ - For the internal script language I added the feature "ebcdic".
+ This can be queried with the has()-function of the internal
+ script language.
+
+------------------------------------------------------------------------------
+ vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_amiga.txt b/runtime/doc/os_amiga.txt
new file mode 100644
index 000000000..fd215834f
--- /dev/null
+++ b/runtime/doc/os_amiga.txt
@@ -0,0 +1,139 @@
+*os_amiga.txt* For Vim version 7.0aa. Last change: 2004 Apr 25
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *Amiga*
+This file contains the particularities for the Amiga version of Vim.
+There is also a section specifically for |MorphOS| below.
+
+Installation on the Amiga:
+- Assign "VIM:" to the directory where the Vim "doc" directory is. Vim will
+ look for the file "VIM:doc/help.txt" (for the help command).
+ Setting the environment variable $VIM also works. And the other way around:
+ when $VIM used and it is not defined, "VIM:" is used.
+- With DOS 1.3 or earlier: Put "arp.library" in "libs:". Vim must have been
+ compiled with the |+ARP| feature enabled. Make sure that newcli and run are
+ in "C:" (for executing external commands).
+- Put a shell that accepts a command with "-c" (e.g. "Csh" from Fish disk
+ 624) in "c:" or in any other directory that is in your search path (for
+ executing external commands).
+
+If you have sufficient memory you can avoid startup delays by making Vim and
+csh resident with the command "rez csh vim". You will have to put
+"rezlib.library" in your "libs:" directory. Under 2.0 you will need rez
+version 0.5.
+
+If you do not use digraphs, you can save some memory by recompiling without
+the |+digraphs| feature. If you want to use Vim with other terminals you can
+recompile with the TERMCAP option. Vim compiles with Manx 5.x and SAS 6.x.
+See the makefiles and feature.h.
+
+If you want to use different colors set the termcap codes:
+ t_mr (for inverted text)
+ t_md (for bold text)
+ t_me (for normal text after t_mr and t_md)
+ t_so (for standout mode)
+ t_se (for normal text after t_so)
+ t_us (for underlined text)
+ t_ue (for normal text after t_us)
+ t_ZH (for italic text)
+ t_ZR (for normal text after t_ZH)
+
+Standard ANSI escape sequences are used. The codes are:
+30 grey char 40 grey cell >0 grey background 0 all attributes off
+31 black char 41 black cell >1 black background 1 boldface
+32 white char 42 white cell >2 white background 2 faint
+33 blue char 43 blue cell >3 blue background 3 italic
+34 grey char 44 grey cell >4 grey background 4 underscore
+35 black char 45 black cell >5 black background 7 reverse video
+36 white char 46 white cell >6 white background 8 invisible
+37 blue char 47 blue cell >7 blue background
+
+The codes with '>' must be the last. The cell and background color should be
+the same. The codes can be combined by separating them with a semicolon. For
+example to get white text on a blue background: >
+ :set t_me=^V<Esc>[0;32;43;>3m
+ :set t_se=^V<Esc>[0;32;43;>3m
+ :set t_ue=^V<Esc>[0;32;43;>3m
+ :set t_ZR=^V<Esc>[0;32;43;>3m
+ :set t_md=^V<Esc>[1;32;43;>3m
+ :set t_mr=^V<Esc>[7;32;43;>3m
+ :set t_so=^V<Esc>[0;31;43;>3m
+ :set t_us=^V<Esc>[4;32;43;>3m
+ :set t_ZH=^V<Esc>[3;32;43;>3m
+
+When using multiple commands with a filter command, e.g. >
+ :r! echo this; echo that
+Only the output of the last command is used. To fix this you have to group the
+commands. This depends on the shell you use (that is why it is not done
+automatically in Vim). Examples: >
+ :r! (echo this; echo that)
+ :r! {echo this; echo that}
+
+Commands that accept a single file name allow for embedded spaces in the file
+name. However, when using commands that accept several file names, embedded
+spaces need to be escaped with a backslash.
+
+------------------------------------------------------------------------------
+Vim for MorphOS *MorphOS*
+
+[this section mostly by Ali Akcaagac]
+
+For the latest info about the MorphOS version:
+ http://www.akcaagac.com/index_vim.html
+
+
+Problems ~
+
+There are a couple of problems which are not MorphOS related but more Vim and
+UN*X related. When starting up Vim in ram: it complains with a nag requester
+from MorphOS please simply ignore it. Another problem is when running Vim as
+is some plugins will cause a few problems which you can ignore as well.
+Hopefully someone will be fixing it over the time.
+
+To pass all these problems for now you can either run:
+
+ vim <file to be edited>
+
+or if you want to run Vim plain and enjoy the motion of Helpfiles etc. it then
+would be better to enter:
+
+ vim --noplugins <of course you can add a file>
+
+
+Installation ~
+
+1) Please copy the binary 'VIM' file to c:
+2) Get the Vim runtime package from:
+
+ ftp://ftp.vim.org/pub/vim/amiga/vim62rt.tgz
+
+ and unpack it in your 'Apps' directory of the MorphOS installation. For me
+ this would create following directory hierarchy:
+
+ MorphOS:Apps/Vim/Vim62/...
+
+3) Add the following lines to your s:shell-startup (Important!).
+
+ ;Begin VIM
+ Set VIM=MorphOS:Apps/Vim/Vim62
+ Assign HOME: ""
+ ;End VIM
+
+4) Copy the '.vimrc' file to s:
+
+5) There is also a file named 'color-sequence' included in this archive. This
+ will set the MorphOS Shell to show ANSI colors. Please copy the file to s:
+ and change the s:shell-startup to:
+
+ ;Begin VIM
+ Set VIM=MorphOS:Apps/Vim/Vim62
+ Assign HOME: ""
+ Execute S:Color-Sequence
+ Cls
+ ;End VIM
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_beos.txt b/runtime/doc/os_beos.txt
new file mode 100644
index 000000000..d58966f49
--- /dev/null
+++ b/runtime/doc/os_beos.txt
@@ -0,0 +1,348 @@
+*os_beos.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *BeOS* *BeBox*
+This is a port of Vim 5.1 to the BeOS Preview Release 2 (also known as PR2)
+or later.
+
+This file contains the particularities for the BeBox/BeOS version of Vim. For
+matters not discussed in this file, Vim behaves very much like the Unix
+|os_unix.txt| version.
+
+ 1. General |beos-general|
+ 2. Compiling Vim |beos-compiling|
+ 3. Timeout in the Terminal |beos-timeout|
+ 4. Unicode vs. Latin1 |beos-unicode|
+ 5. The BeOS GUI |beos-gui|
+ 6. The $VIM directory |beos-vimdir|
+ 7. Drag & Drop |beos-dragndrop|
+ 8. Single Launch vs. Multiple
+ Launch |beos-launch|
+ 9. Fonts |beos-fonts|
+10. The meta key modifier |beos-meta|
+11. Mouse key mappings |beos-mouse|
+12. Color names |beos-colors|
+13. Compiling with Perl |beos-perl|
+
+
+1. General *beos-general*
+
+The default syntax highlighting mostly works with different foreground colors
+to highlight items. This works best if you set your Terminal window to a
+darkish background and light letters. Some middle-grey background (for
+instance (r,g,b)=(168,168,168)) with black letters also works nicely. If you
+use the default light background and dark letters, it may look better to
+simply reverse the notion of foreground and background color settings. To do
+this, add this to your .vimrc file (where <Esc> may need to be replaced with
+the escape character): >
+
+ :if &term == "beos-ansi"
+ : set t_AB=<Esc>[3%dm
+ : set t_AF=<Esc>[4%dm
+ :endif
+
+
+2. Compiling Vim *beos-compiling*
+
+From the Advanced Access Preview Release (AAPR) on, Vim can be configured with
+the standard configure script. To get the compiler and its flags right, use
+the following command-line in the shell (you can cut and paste it in one go):
+
+CC=$BE_C_COMPILER CFLAGS="$BE_DEFAULT_C_FLAGS -O7" \
+ ./configure --prefix=/boot/home/config
+
+$BE_C_COMPILER is usually "mwcc", $BE_DEFAULT_C_FLAGS is usually "-I- -I."
+
+When configure has run, and you wish to enable GUI support, you must edit the
+config.mk file so that the lines with GUI_xxx refer to $(BEOSGUI_xxx) instead
+of $(NONE_xxx).
+Alternatively you can make this change in the Makefile; it will have a
+more permanent effect. Search for "NONE_".
+
+After compilation you need to add the resources to the binary. Add the
+following few lines near the end (before the line with "exit $exit_value") of
+the link.sh script to do this automatically.
+
+ rmattr BEOS:TYPE vim
+ copyres os_beos.rsrc vim
+ mimeset vim
+
+Also, create a dummy file "strip":
+
+ #!/bin/sh
+ mimeset $1
+ exit 0
+
+You will need it when using "make install" to install Vim.
+
+Now type "make" to compile Vim, then "make install" to install it.
+
+If you want to install Vim by hand, you must copy Vim to $HOME/config/bin, and
+create a bunch of symlinks to it ({g,r,rg}{vim,ex,view}). Furthermore you must
+copy Vims configuration files to $HOME/config/share/vim:
+vim-5.0s/{*.vim,doc,syntax}. For completeness, you should also copy the nroff
+manual pages to $HOME/config/man/man1. Don't forget ctags/ctags and xxd/xxd!
+
+Obviously, you need the unlimited linker to actually link Vim. See
+http://www.metrowerks.com for purchasing the CodeWarrior compiler for BeOS.
+There are currently no other linkers that can do the job.
+
+This won't be able to include the Perl or Python interfaces even if
+you have the appropriate files installed. |beos-perl|
+
+
+3. Timeout in the Terminal *beos-timeout*
+
+Because some POSIX/UNIX features are still missing[1], there is no direct OS
+support for read-with-timeout in the Terminal. This would meat that you cannot
+use :mappings of more than one character, unless you also :set notimeout.
+|'timeout'|
+
+To circumvent this problem, I added a workaround to provide the necessary
+input with timeout by using an extra thread which reads ahead one character.
+As a side effect, it also makes Vim recognize when the Terminal window
+resizes.
+
+Function keys are not supported in the Terminal since they produce very
+indistinctive character sequences.
+
+These problems do not exist in the GUI.
+
+[1]: there is no select() on file descriptors; also the termios VMIN and VTIME
+settings do not seem to work properly. This has been the case since DR7 at
+least and still has not been fixed as of PR2.
+
+ *beos-unicode*
+4. Unicode vs. Latin1 *beos-utf8*
+
+BeOS uses Unicode and UTF-8 for text strings (16-bit characters encoded to
+8-bit characters). Vim assumes ISO-Latin1 or other 8-bit character codes.
+This does not produce the desired results for non-ASCII characters. Try the
+command :digraphs to see. If they look messed up, use :set isprint=@ to
+(slightly) improve the display of ISO-Latin1 characters 128-255. This works
+better in the GUI, depending on which font you use (below).
+
+You may also use the /boot/bin/xtou command to convert UTF-8 files from (xtou
+-f iso1 filename) or to (xtou -t iso1 filename) ISO-Latin1 characters.
+
+
+5. The BeOS GUI *beos-gui*
+
+Normally Vim starts with the GUI if you start it as gvim or vim -g. The BeOS
+version tries to determine if it was started from the Tracker instead of the
+Terminal, and if so, use the GUI anyway. However, the current detection scheme
+is fooled if you use the command "vim - </dev/null" or "vim filename &". The
+latter can be called a feature but probably only works because there is no
+BSD-style job control.
+
+Stuff that does not work yet:
+
+- Running external commands from the GUI does not work 100% (again due to lack
+ of support for select()). There was a choice between seeing the command's
+ output, or being able to interrupt it. I chose for seeing the output. Even
+ now the command sometimes crashes mysteriously, apparently in Be's
+ malloc_internal() called from the putenv() function, after fork()ing. (data
+ access exception occurred, ec01b0ec: 90e80000 *stw r7, 0x0000 (r8))(:!ls
+ works usually, :r !ls usually doesn't). This has been reported as bug
+ # 971215-083826.
+- The window title.
+- Starting the GUI from the Terminal version with :gui always acts as if
+ :gui -f were used. There is no way to fix this that I can see.
+- There are some small display glitches here and there that I hope to clean up
+ later. Most of them occur when the window is partially obscured. Some of
+ them seem to be bugs in BeOS, because the Terminal has similar glitches.
+- Mouse up events are not generated when outside the window. This is a bug in
+ BeOS. You can notice this when selecting text and moving the cursor outside
+ the window, then letting go of the mouse button. Another way is when you
+ drag the scrollbar and do the same thing. Because Vim still thinks you are
+ still playing with the scrollbar it won't change it itself. I provided a
+ workaround which kicks in when the window is activated or deactivated (so it
+ works best with focus- follows-mouse (/boot/bin/ffm) turned on).
+- The cursor does not flash (very low priority; I'm not sure I even like it
+ when it flashes)
+
+
+The $VIM directory *beos-vimdir*
+
+$VIM is the symbolic name for the place where Vims support files are stored.
+The default value for $VIM is set at compile time and can be determined with >
+
+ :version
+
+The normal value is /boot/home/config/share/vim. If you don't like it you can
+set the VIM environment variable to override this, or set 'helpfile' in your
+.vimrc: >
+
+ :if version >= 500
+ : set helpfile=~/vim/vim54/doc/help.txt
+ : syntax on
+ :endif
+
+
+7. Drag & Drop *beos-dragndrop*
+
+You can drop files and directories on either the Vim icon (starts a new Vim
+session, unless you use the File Types application to set Vim to be "Single
+Launch") or on the Vim window (starts editing the files). Dropping a folder
+sets Vim's current working directory. |:cd| |:pwd| If you drop files or
+folders with either SHIFT key pressed, Vim changes directory to the folder
+that contains the first item dropped. When starting Vim, there is no need to
+press shift: Vim behaves as if you do.
+
+Files dropped set the current argument list. |argument-list|
+
+
+8. Single Launch vs. Multiple Launch *beos-launch*
+
+As distributed Vim's Application Flags (as seen in the FileTypes preference)
+are set to Multiple Launch. If you prefer, you can set them to Single Launch
+instead. Attempts to start a second copy of Vim will cause the first Vim to
+open the files instead. This works from the Tracker but also from the command
+line. In the latter case, non-file (option) arguments are not supported.
+
+NB: Only the GUI version has a BApplication (and hence Application Flags).
+This section does not apply to the GUI-less version, should you compile one.
+
+
+9. Fonts *beos-fonts*
+
+Set fonts with >
+
+ :set guifont=Courier10_BT/Roman/10
+
+where the first part is the font family, the second part the style, and the
+third part the size. You can use underscores instead of spaces in family and
+style.
+
+Best results are obtained with monospaced fonts (such as Courier). Vim
+attempts to use all fonts in B_FIXED_SPACING mode but apparently this does not
+work for proportional fonts (despite what the BeBook says).
+
+Vim also tries to use the B_ISO8859_1 encoding, also known as ISO Latin 1.
+This also does not work for all fonts. It does work for Courier, but not for
+ProFontISOLatin1/Regular (strangely enough). You can verify this by giving the >
+
+ :digraphs
+
+command, which lists a bunch of characters with their ISO Latin 1 encoding.
+If, for instance, there are "box" characters among them, or the last character
+isn't a dotted-y, then for this font the encoding does not work.
+
+If the font you specify is unavailable, you get the system fixed font.
+
+Standard fixed-width system fonts are:
+
+ ProFontISOLatin1/Regular
+ Courier10_BT/Roman
+ Courier10_BT/Italic
+ Courier10_BT/Bold
+ Courier10_BT/Bold_Italic
+
+Standard proportional system fonts are:
+
+ Swis721_BT/Roman
+ Swis721_BT/Italic
+ Swis721_BT/Bold
+ Swis721_BT/Bold_Italic
+ Dutch801_Rm_BT/Roman
+ Dutch801_Rm_BT/Italic
+ Dutch801_Rm_BT/Bold
+ Dutch801_Rm_BT/Bold_Italic
+ Baskerville/Roman
+ Baskerville/Italic
+ Baskerville/Bold
+ Baskerville/Bold_Italic
+ SymbolProp_BT/Regular
+
+Try some of them, just for fun.
+
+
+10. The meta key modifier *beos-meta*
+
+The META key modifier is obtained by the left or right OPTION keys. This is
+because the ALT (aka COMMAND) keys are not passed to applications.
+
+
+11. Mouse key mappings *beos-mouse*
+
+Vim calls the various mouse buttons LeftMouse, MiddleMouse and RightMouse. If
+you use the default Mouse preference settings these names indeed correspond to
+reality. Vim uses this mapping:
+
+ Button 1 -> LeftMouse,
+ Button 2 -> RightMouse,
+ Button 3 -> MiddleMouse.
+
+If your mouse has fewer than 3 buttons you can provide your own mapping from
+mouse clicks with modifier(s) to other mouse buttons. See the file
+vim-5.x/macros/swapmous.vim for an example. |gui-mouse-mapping|
+
+
+12. Color names *beos-colors*
+
+Vim has a number of color names built-in. Additional names are read from the
+file $VIMRUNTIME/rgb.txt, if present. This file is basically the color
+database from X. Names used from this file are cached for efficiency.
+
+
+13. Compiling with Perl *beos-perl*
+
+Compiling with Perl support enabled is slightly tricky. The Metrowerks
+compiler has some strange ideas where to search for include files. Since
+several include files with Perl have the same names as some Vim header
+files, the wrong ones get included. To fix this, run the following Perl
+script while in the vim-5.0/src directory: >
+
+ preproc.pl > perl.h
+
+ #!/bin/env perl
+ # Simple #include expander, just good enough for the Perl header files.
+
+ use strict;
+ use IO::File;
+ use Config;
+
+ sub doinclude
+ {
+ my $filename = $_[0];
+ my $fh = new IO::File($filename, "r");
+ if (defined $fh) {
+ print "/* Start of $filename */\n";
+
+ while (<$fh>) {
+ if (/^#include "(.*)"/) {
+ doinclude($1);
+ print "/* Back in $filename */\n";
+ } else {
+ print $_;
+ }
+ }
+ print "/* End of $filename */\n";
+
+ undef $fh;
+ } else {
+ print "/* Cannot open $filename */\n";
+ print "#include \"$filename\"\n";
+ }
+ }
+
+ chdir $Config{installarchlib}."/CORE";
+ doinclude "perl.h";
+
+It expands the "perl.h" header file, using only other Perl header files.
+
+Now you can configure & make Vim with the --enable-perlinterp option.
+Be warned though that this adds about 616 kilobytes to the size of Vim!
+Without Perl, Vim with default features and GUI is about 575K, with Perl
+it is about 1191K.
+
+-Olaf Seibert
+
+[Note: these addresses no longer work:]
+<rhialto@polder.ubc.kun.nl>
+http://polder.ubc.kun.nl/~rhialto/be
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
new file mode 100644
index 000000000..3c82f17fe
--- /dev/null
+++ b/runtime/doc/os_dos.txt
@@ -0,0 +1,295 @@
+*os_dos.txt* For Vim version 7.0aa. Last change: 2003 Dec 20
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *dos* *DOS*
+This file documents the common particularities of the MS-DOS and Win32
+versions of Vim. Also see |os_win32.txt| and |os_msdos.txt|.
+
+1. File locations |dos-locations|
+2. Using backslashes |dos-backslash|
+3. Standard mappings |dos-standard-mappings|
+4. Screen output and colors |dos-colors|
+5. File formats |dos-file-formats|
+6. :cd command |dos-:cd|
+7. Interrupting |dos-CTRL-Break|
+8. Temp files |dos-temp-files|
+9. Shell option default |dos-shell|
+
+==============================================================================
+1. File locations *dos-locations*
+
+If you keep the Vim executable in the directory that contains the help and
+syntax subdirectories, there is no need to do anything special for Vim to
+work. No registry entries or environment variables need to be set. Just make
+sure that the directory is in your search path, or use a shortcut on the
+desktop.
+
+Your vimrc files ("_vimrc" and "_gvimrc") are normally located one directory
+up from the runtime files. If you want to put them somewhere else, set the
+environment variable $VIM to the directory where you keep them. Example: >
+ set VIM=C:\user\piet
+Will find "c:\user\piet\_vimrc".
+Note: This would only be needed when the computer is used by several people.
+Otherwise it's simpler to keep your _vimrc file in the default place.
+
+If you move the executable to another location, you also need to set the $VIM
+environment variable. The runtime files will be found in "$VIM/vim{version}".
+Example: >
+ set VIM=E:\vim
+Will find the version 5.4 runtime files in "e:\vim\vim54".
+Note: This is _not_ recommended. The preferred way is to keep the executable
+in the runtime directory.
+
+If you move your executable AND want to put your "_vimrc" and "_gvimrc" files
+somewhere else, you must set $VIM to where you vimrc files are, and set
+$VIMRUNTIME to the runtime files. Example: >
+ set VIM=C:\usr\piet
+ set VIMRUNTIME=E:\vim\vim54
+Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
+
+See |$VIM| and |$VIMRUNTIME| for more information.
+
+Under Windows 95, you can set $VIM in your C:\autoexec.bat file. For
+example: >
+ set VIM=D:\vim
+Under Windows NT, you can set environment variables for each user separately
+under "Start/Settings/Control Panel->System", or through the properties in the
+menu of "My Computer", under the Environment Tab.
+
+==============================================================================
+2. Using backslashes *dos-backslash*
+
+Using backslashes in file names can be a problem. Vi halves the number of
+backslashes for some commands. Vim is a bit more tolerant and does not remove
+backslashes from a file name, so ":e c:\foo\bar" works as expected. But when
+a backslash occurs before a special character (space, comma, backslash, etc.),
+Vim removes the backslash. Use slashes to avoid problems: ":e c:/foo/bar"
+works fine. Vim replaces the slashes with backslashes internally to avoid
+problems with some MS-DOS programs and Win32 programs.
+
+When you prefer to use forward slashes, set the 'shellslash' option. Vim will
+then replace backslashes with forward slashes when expanding file names. This
+is especially useful when using a Unix-like 'shell'.
+
+==============================================================================
+3. Standard mappings *dos-standard-mappings*
+
+CTRL-PageUp cursor to first screen line *<C-PageUp>*
+CTRL-PageDown cursor to last screen line, last character *<C-PageDown>*
+
+These mappings accomplish this:
+
+key key code Normal/Visual mode Insert mode ~
+CTRL-PageUp <M-N><M-C-D> H <C-O>H
+CTRL-PageDown <M-N>v L$ <C-O>L<C-O>$
+
+Additionally, these keys are available for copy/cut/paste. In the Win32
+and DJGPP versions, they also use the clipboard.
+
+Shift-Insert paste text (from clipboard) *<S-Insert>*
+CTRL-Insert copy Visual text (to clipboard) *<C-Insert>*
+CTRL-Del cut Visual text (to clipboard) *<C-Del>*
+Shift-Del cut Visual text (to clipboard) *<S-Del>*
+
+These mappings accomplish this (Win32 and DJGPP versions of Vim):
+
+key key code Normal Visual Insert ~
+Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>*
+CTRL-Insert <M-N><M-U> "*y
+Shift-Del <M-N><M-W> "*d
+CTRL-Del <M-N><M-X> "*d
+
+Or these mappings (non-Win32 version of Vim):
+
+key key code Normal Visual Insert ~
+Shift-Insert <M-N><M-T> P "-dP <C-R><C-O>"
+CTRL-Insert <M-N><M-U> y
+Shift-Del <M-N><M-W> d
+CTRL-Del <M-N><M-X> d
+
+When the clipboard is supported, the "* register is used.
+
+==============================================================================
+4. Screen output and colors *dos-colors*
+
+The default output method for the screen is to use bios calls. This works
+right away on most systems. You do not need ansi.sys. You can use ":mode" to
+set the current screen mode. See |:mode|.
+
+To change the screen colors that Vim uses, you can use the |:highlight|
+command. The Normal highlight group specifies the colors Vim uses for normal
+text. For example, to get grey text on a blue background: >
+ :hi Normal ctermbg=Blue ctermfg=grey
+See |highlight-groups| for other groups that are available.
+
+A DOS console does not support attributes like bold and underlining. You can
+set the color used in five modes with nine termcap options. Note that this is
+not necessary since you can set the color directly with the ":highlight"
+command; these options are for backward compatibility with older Vim versions.
+The |'highlight'| option specifies which of the five modes is used for which
+action. >
+
+ :set t_mr=^V^[\|xxm start of invert mode
+ :set t_md=^V^[\|xxm start of bold mode
+ :set t_me=^V^[\|xxm back to normal text
+
+ :set t_so=^V^[\|xxm start of standout mode
+ :set t_se=^V^[\|xxm back to normal text
+
+ :set t_us=^V^[\|xxm start of underline mode
+ :set t_ue=^V^[\|xxm back to normal text
+
+ :set t_ZH=^V^[\|xxm start of italics mode
+ :set t_ZR=^V^[\|xxm back to normal text
+
+^V is CTRL-V
+^[ is <Esc>
+You must replace xx with a decimal code, which is the foreground color number
+and background color number added together:
+
+COLOR FOREGROUND BACKGROUND ~
+Black 0 0
+DarkBlue 1 16
+DarkGreen 2 32
+DarkCyan 3 48
+DarkRed 4 64
+DarkMagenta 5 80
+Brown, DarkYellow 6 96
+LightGray 7 112
+DarkGray 8 128 *
+Blue, LightBlue 9 144 *
+Green, LightGreen 10 160 *
+Cyan, LightCyan 11 176 *
+Red, LightRed 12 192 *
+Magenta, LightMagenta 13 208 *
+Yellow, LightYellow 14 224 *
+White 15 240 *
+
+* Depending on the display mode, the color codes above 128 may not be
+ available, and code 128 will make the text blink.
+
+When you use 0, the color is reset to the one used when you started Vim
+(usually 7, lightgray on black, but you can override this. If you have
+overridden the default colors in a command prompt, you may need to adjust
+some of the highlight colors in your vimrc---see below).
+This is the default for t_me.
+
+The defaults for the various highlight modes are:
+ t_mr 112 reverse mode: Black text (0) on LightGray (112)
+ t_md 15 bold mode: White text (15) on Black (0)
+ t_me 0 normal mode (revert to default)
+
+ t_so 31 standout mode: White (15) text on DarkBlue (16)
+ t_se 0 standout mode end (revert to default)
+
+ t_czh 225 italic mode: DarkBlue text (1) on Yellow (224)
+ t_czr 0 italic mode end (revert to default)
+
+ t_us 67 underline mode: DarkCyan text (3) on DarkRed (64)
+ t_ue 0 underline mode end (revert to default)
+
+These colors were chosen because they also look good when using an inverted
+display, but you can change them to your liking.
+
+Example: >
+ :set t_mr=^V^[\|97m " start of invert mode: DarkBlue (1) on Brown (96)
+ :set t_md=^V^[\|67m " start of bold mode: DarkCyan (3) on DarkRed (64)
+ :set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
+
+ :set t_so=^V^[\|37m " start of standout mode: DarkMagenta (5) on DarkGreen
+ (32)
+ :set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
+
+==============================================================================
+5. File formats *dos-file-formats*
+
+If the 'fileformat' option is set to "dos" (which is the default), Vim accepts
+a single <NL> or a <CR><NL> pair for end-of-line (<EOL>). When writing a
+file, Vim uses <CR><NL>. Thus, if you edit a file and write it, Vim replaces
+<NL> with <CR><NL>.
+
+If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL>
+and shows <CR> as ^M.
+
+You can use Vim to replace <NL> with <CR><NL> by reading in any mode and
+writing in Dos mode (":se ff=dos").
+You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and
+writing in Unix mode (":se ff=unix").
+
+Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is
+the default), so you don't really have to worry about what you are doing.
+ |'fileformat'| |'fileformats'|
+
+If you want to edit a script file or a binary file, you should set the
+'binary' option before loading the file. Script files and binary files may
+contain single <NL> characters which Vim would replace with <CR><NL>. You can
+set 'binary' automatically by starting Vim with the "-b" (binary) option.
+
+==============================================================================
+6. :cd command *dos-:cd*
+
+The ":cd" command recognizes the drive specifier and changes the current
+drive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\foo" to go
+to the directory "foo" in the root of drive D. Vim also recognizes UNC names
+if the system supports them; e.g., ":cd \\server\share\dir". |:cd|
+
+==============================================================================
+7. Interrupting *dos-CTRL-Break*
+
+Use CTRL-Break instead of CTRL-C to interrupt searches. Vim does not detect
+the CTRL-C until it tries to read a key.
+
+==============================================================================
+8. Temp files *dos-temp-files*
+
+Only for the 16 bit and 32 bit DOS version:
+Vim puts temporary files (for filtering) in the first of these directories
+that exists and in which Vim can create a file:
+ $TMP
+ $TEMP
+ C:\TMP
+ C:\TEMP
+ current directory
+
+For the Win32 version (both console and GUI):
+Vim uses standard Windows functions to obtain a temporary file name (for
+filtering). The first of these directories that exists and in which Vim can
+create a file is used:
+ $TMP
+ $TEMP
+ current directory
+
+==============================================================================
+9. Shell option default *dos-shell*
+
+The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
+"cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if
+SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external
+commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command
+subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
+
+If you are running a third-party shell, you may need to set the
+|'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'|
+('sxq') options. Unfortunately, this also depends on the version of Vim used.
+For example, with the MKS Korn shell or with bash, the values of the options
+should be:
+
+ DOS 16 bit DOS 32 bit Win32 ~
+'shellcmdflag' -c -c -c
+'shellquote' "
+'shellxquote' "
+
+For Dos 16 bit this starts the shell as:
+ <shell> -c "command name" >file
+For Win32 as:
+ <shell> -c "command name >file"
+For DOS 32 bit, DJGPP does this internally somehow.
+
+When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
+option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
+'shellxquote' options will be set as described above.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt
new file mode 100644
index 000000000..c2102bfc0
--- /dev/null
+++ b/runtime/doc/os_mac.txt
@@ -0,0 +1,98 @@
+*os_mac.txt* For Vim version 7.0aa. Last change: 2004 Apr 27
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar et al.
+
+
+ *mac* *Mac* *macintosh* *Macintosh*
+
+This file documents the particularities of the Macintosh version of Vim.
+
+NOTE: This file is a bit outdated. You might find more useful info here:
+ http://macvim.swdev.org/
+
+1. Filename Convention |mac-filename|
+2. .vimrc an .vim files |mac-vimfile|
+3. FAQ |mac-faq|
+4. Known Lack |mac-lack|
+5. Mac Bug Report |mac-bug|
+6. Compiling Vim |mac-compile|
+
+There was a Mac port for version 3.0 of Vim. Here are the first few lines
+from the old file:
+
+VIM Release Notes
+Initial Macintosh release, VIM version 3.0
+19 October 1994
+
+Eric Fischer
+<enf1@midway.uchicago.edu>, <eric@jcp.uchicago.edu>, <etaoin@uchicago.edu>
+5759 N. Guilford Ave
+Indianapolis IN 46220 USA
+
+==============================================================================
+1. Filename Convention *mac-filename*
+
+You can use either the unix or mac path separator or a mix of both. In order
+to determine if the specified filename is relative to the current folder or
+absolute (i.e. relative to the "Desktop"), the following algorithm is used:
+
+ If the path start by a "/", the path is absolute
+ If the path start by a ":", the path is relative
+ If the path doesn't start by neither a "/" nor ":",
+ and a ":" is found before a "/" then the path is absolute
+>
+ :e /HD/text
+ :e HD:text
+< Edit the file "text" of the disk "HD" >
+ :e :src:main.c
+ :e src/main.c
+< Edit the file "main.c" in the folder "src" in the current folder >
+ :e os_mac.c
+< Edit the file "os_mac.c" in the current folder.
+
+You can use the |$VIM| and |$VIMRUNTIME| variable. >
+
+ :so $VIMRUNTIME:syntax:syntax.vim
+
+==============================================================================
+2. .vimrc and .vim files *mac-vimfile*
+
+On the Mac files starting with a dot "." are discouraged, thus the rc files
+are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files can be in
+any format (mac, dos or unix). Vim can handle any file format when the
+|'nocompatible'| option is set, otherwise it will only handle mac format
+files.
+
+==============================================================================
+3. Mac FAQ *mac-faq*
+
+Q: I can't enter non-ASCII character in Apple Terminal.
+A: Under Window Settings, Emulation, make sure that "Escape non-ASCII
+ characters" is not checked.
+
+==============================================================================
+4. Mac Lack *mac-lack*
+
+-The filenames containing both ":" and "/" are sometimes misinterpreted.
+ (just re-execute the command)
+-Scrollbar are not scrolling live, and when only the arrow or scroll area,
+ a limit of 32 line or page is scrolled.
+-Syntax highlighting works on 68k Macs but is _really_ slow.
+
+==============================================================================
+5. Mac Bug Report *mac-bug*
+
+When reporting any Mac specific bug or feature change, please use the vim-mac
+maillist |vim-mac|. However, you need to be subscribed. An alternative is to
+send a message to the current MacVim maintainers:
+
+ mac@vim.org
+
+==============================================================================
+6. Compiling Vim *mac-compile*
+
+See the file "src/INSTALLmac.txt" that comes with the source files.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_mint.txt b/runtime/doc/os_mint.txt
new file mode 100644
index 000000000..979776e20
--- /dev/null
+++ b/runtime/doc/os_mint.txt
@@ -0,0 +1,39 @@
+*os_mint.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Jens M. Felderhoff
+
+
+ *MiNT* *Atari*
+This file contains the particularities for the Atari MiNT version of Vim.
+
+For compiling Vim on the Atari running MiNT see "INSTALL" and "Makefile"
+in the src directory.
+
+Vim for MiNT behaves almost exactly like the Unix version.
+The Unix behavior described in the documentation also refers to the
+MiNT version of Vim unless explicitly stated otherwise.
+
+For wildcard expansion of <~> (home directory) you need a shell that
+expands the tilde. The vanilla Bourne shell doesn't recognize it.
+With csh and ksh it should work OK.
+
+The MiNT version of vim needs the termcap file /etc/termcap with the
+terminal capabilities of your terminal. Builtin termcaps are
+supported for the vt52 terminal. Termcap entries for the TOSWIN window
+manager and the virtual console terminals have been appended to the
+termcap file that comes with the Vim distribution.
+
+If you should encounter problems with swapped <BS> and <Del> keys, see
+|:fixdel|.
+
+Because terminal updating under MiNT is often slow (e.g. serial line
+terminal), the 'showcmd' and 'ruler' options are default off.
+If you have a fast terminal, try setting them on. You might
+also want to set 'ttyfast'.
+
+Send bug reports to
+
+ Jens M. Felderhoff, e-mail: <jmf@infko.uni-koblenz.de>
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt
new file mode 100644
index 000000000..01290e9ff
--- /dev/null
+++ b/runtime/doc/os_msdos.txt
@@ -0,0 +1,270 @@
+*os_msdos.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *msdos* *ms-dos* *MSDOS* *MS-DOS*
+This file contains the particularities for the MS-DOS version of Vim.
+
+1. Two versions for MS-DOS |msdos-versions|
+2. Known problems |msdos-problems|
+3. Long file names |msdos-longfname|
+4. Termcap codes |msdos-termcap|
+5. Shifted arrow keys |msdos-arrows|
+6. Filename extensions |msdos-fname-extensions|
+7. Memory usage and limitations |msdos-limitations|
+8. Symbolically linked files |msdos-linked-files|
+9. Copy/paste in a dos box |msdos-copy-paste|
+
+Additionally, there are a number of common Win32 and DOS items:
+File locations |dos-locations|
+Using backslashes |dos-backslash|
+Standard mappings |dos-standard-mappings|
+Screen output and colors |dos-colors|
+File formats |dos-file-formats|
+:cd command |dos-:cd|
+Interrupting |dos-CTRL-Break|
+Temp files |dos-temp-files|
+Shell option default |dos-shell|
+
+For compiling Vim see src/INSTALL.pc. *msdos-compiling*
+
+==============================================================================
+1. Two versions for MS-DOS *msdos-versions*
+
+There are two versions of Vim that can be used with MS-DOS machines:
+
+ *dos16*
+Dos16 version Can be used on any MS-DOS system, only uses up to 640 Kbyte of
+ memory. Also runs on OS/2, Windows 95, and NT. Excludes some
+ Vim-specific features (autocommands, syntax highlighting,
+ etc.). Recommended for use on pre-386 machines.
+ *dos32*
+Dos32 version Requires 386 processor and a |DPMI| driver, uses all
+ available memory. Supports long file names and the Windows
+ clipboard, but NOT on Windows NT. Recommended for MS-DOS,
+ Windows 3.1 and Windows 95.
+
+There are also two versions that run under Windows:
+Win32 version Requires Windows 95 or Windows NT, uses all available
+ memory, supports long file names, etc. Has some problems on
+ Windows 95. Recommended for Windows NT. See |os_win32.txt|
+Win32 GUI Requirements like the Win32 version, but runs in its own
+ window, instead of a console. Has scrollbars, menu, etc.
+ Recommended for Windows 95 and Windows NT. See |gui-w32|.
+
+It is recommended to use the Dos32 or Win32 version. Although the Dos16
+version is able to edit very big files, it quickly runs out of memory when
+making big changes. Disabling undo helps: ":set ul=-1". The screen updating
+of the Dos16 version is the fastest of the three on DOS or Windows 95; on
+Windows NT, the Win32 version is just as fast.
+
+ *DPMI*
+For the Dos32 version, you may need a DPMI driver when running in MS-DOS. If
+you are running Windows or installed a clever memory manager, it will probably
+work already. If you get the message "No DPMI", you need to install a DPMI
+driver. Such a driver is included with the executable in CSDPMI4B.ZIP. Run
+"cwsdpmi" just before starting Vim each time. Or you might want to include
+"cwsdpmi -p" in your autoexec.bat to make it resident. The latest version of
+"CSDPMI*.ZIP" can be obtained from: "ftp.neosoft.com:pub/users/s/sandmann".
+
+ *minimal-features*
+The 16 bit DOS version has been compiled with minimal features. Check the
+|+feature-list| which ones are included (marked with a "T").
+You can include more features by editing feature.h and recompiling.
+
+==============================================================================
+2. Known problems *msdos-problems*
+
+When using smartdrive (MS-DOS 6.x) with write-behind caching, it is possible
+that Vim will try to create a swap file on a read-only file system (e.g.
+write protected floppy). You will then be given the message >
+ A serious disk error has occurred .., Retry (r)?
+There is nothing you can do but unprotect the floppy or switch off the
+computer. Even CTRL-ALT-DEL will not get you out of this. This is really a
+problem of smartdrive, not Vim. Smartdrive works fine otherwise. If this
+bothers you, don't use the write-behind caching.
+
+Vim can't read swap files that have been opened already, unless the "share"
+command has been used. If you see stray warnings for existing swap files,
+include the "share" command in your config.sys or autoexec.bat (see your MSDOS
+documentation).
+
+The Dos16 version can only have about 10 files open (in a window or hidden) at
+one time. With more files you will get error messages when trying to read or
+write a file, and for filter commands. Or Vim runs out of memory, and random
+problems may result.
+
+The Dos32 version cannot have an unlimited number of files open at any one
+time. The limit depends on the setting of FILES in your CONFIG.SYS. This
+defaults to 15; if you need to edit a lot of files, you should increase this.
+If you do not set FILES high enough, you can get strange errors, and shell
+commands may cause a crash!
+
+The Dos32 version can work with long file names. When doing file name
+completion, matches for the short file name will also be found. But this will
+result in the corresponding long file name. For example, if you have the long
+file name "this_is_a_test" with the short file name "this_i~1", the command
+":e *1" will start editing "this_is_a_test".
+
+When using the Dos32 version and you run into problems with DPMI support,
+check if there is a program in your config.sys that eats resources. One
+program known to cause this problem is "netx", which says "NetWare v. 3.26
+Workstation shell". Replace it with version 3.32 to fix the problem.
+
+The Dos32 version will parse its arguments to handle quotation. This is good
+to edit a file with spaces in its name, for example: >
+ vim "program files\accessories\ppp.scp"
+A side effect is that single quotes are removed. Insert a backslash to avoid
+that. For example, to edit the file "fi'le.txt": >
+ vim fi\'le.txt
+
+==============================================================================
+3. Long file names *msdos-longfname*
+
+If the Dos32 version is run on Windows 95, it can use long file names. It
+will work by default. If you want to disable this, use this setting:
+ set LFN=N
+You can put this in your autoexec.bat file.
+
+Note: If you have installed DJGPP on your machine, you probably have a
+"djgpp.env" file, which contains "LFN=n". You need to use "LFN=Y" to switch
+on using long file names then.
+
+==============================================================================
+4. Termcap codes *msdos-termcap*
+
+If you want to use another output method (e.g., when using a terminal on a COM
+port), set the terminal name to "pcansi". You can change the termcap options
+when needed (see |terminal-options|). Note that the
+normal IBM ansi.sys does not support all the codes of the builtin pcansi
+terminal. If you use ansi.sys, you will need to delete the termcap entries
+t_al and t_dl with >
+ :set t_al= t_dl=
+Otherwise, the screen will not be updated correctly. It is better to use
+nansi.sys, nnansi.sys, or the like instead of ansi.sys.
+
+If you want to use Vim on a terminal connected to a COM: port, reset the
+'bioskey' option. Otherwise the commands will be read from the PC keyboard.
+CTRL-C and CTRL-P may not work correctly with 'bioskey' reset.
+
+==============================================================================
+5. Shifted arrow keys *msdos-arrows*
+
+Use CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
+SHIFT-arrow-right. The arrow-up and arrow-down cannot be used with SHIFT or
+CTRL.
+
+==============================================================================
+6. Filename extensions *msdos-fname-extensions*
+
+MS-DOS allows for only one file name extension. Therefore, when appending an
+extension, the '.' in the original file name is replaced with a '_', the name
+is truncated to 8 characters, and the new extension (e.g., ".swp") is
+appended. Two examples: "test.c" becomes "test_c.bak", "thisisat.est"
+becomes "thisisat.bak". To reduce these problems, the default for
+'backupext' is "~" instead of ".bak". The backup file for "thisisat.est"
+then becomes "thisisat.es~". The 'shortname' option is not available,
+because it would always be set.
+
+==============================================================================
+7. Memory usage and limitations *msdos-limitations*
+
+A swap file is used to store most of the text. You should be able to edit
+very large files. However, memory is used for undo and other things. If you
+delete a lot of text, you can still run out of memory in the Dos16 version.
+
+If Vim gives an "Out of memory" warning, you should stop editing. The result
+of further editing actions is unpredictable. Setting 'undolevels' to 0 saves
+some memory. Running the maze macros on a big maze is guaranteed to run out
+of memory, because each change is remembered for undo. In this case set
+'undolevels' to a negative number. This will switch off undo completely.
+
+ *msdos-clipboard-limits*
+In the Dos32 version, extended memory is used to avoid these problems.
+However, if you are using the clipboard, you can still run into memory
+limitations because the Windows clipboard can only communicate with Vim using
+Dos memory. This means that the largest amount of text that can be sent to
+or received from the Windows clipboard is limited by how much free Dos memory
+is available on your system.
+
+You can usually maximize the amount of available Dos memory by adding the
+following lines to Dos's "config.sys" file: >
+
+ DOS=HIGH,UMB
+ DEVICE=C:\WINDOWS\himem.sys
+ DEVICE=C:\WINDOWS\emm386.exe RAM
+
+Modifying config.sys in this way will also help to make more memory available
+for the Dos16 version, if you are using that.
+
+In the Dos16 version the line length is limited to about 32000 characters.
+When reading a file the lines are automatically split. But editing a line
+in such a way that it becomes too long may give unexpected results.
+
+==============================================================================
+8. Symbolically linked files *msdos-linked-files*
+
+When using Vim to edit a symbolically linked file on a unix NFS file server,
+you may run into problems.
+When writing the file, Vim does not "write through" the symlink. Instead, it
+deletes the symbolic link and creates a new file in its place.
+ On Unix, Vim is prepared for links (symbolic or hard). A backup copy of
+the original file is made and then the original file is overwritten. This
+assures that all properties of the file remain the same. On non-Unix systems,
+the original file is renamed and a new file is written. Only the protection
+bits are set like the original file. However, this doesn't work properly when
+working on an NFS-mounted file system where links and other things exist. The
+only way to fix this in the current version is not making a backup file, by
+":set nobackup nowritebackup" |'writebackup'|
+
+==============================================================================
+9. Copy/paste in a dos box *msdos-copy-paste*
+
+ *E450* *E451* *E452* *E453* *E454*
+The 32 bit version can copy/paste from/to the Windows clipboard directly. Use
+the "* register. Large amounts of text can be copied this way, but it must be
+possible to allocate memory for it, see |msdos-clipboard-limits|. When moving
+text from one Vim to another, the type of the selection
+(characterwise/linewise/blockwise) is passed on.
+
+In other versions, the following can be used.
+
+(posted to comp.editors by John Velman <velman@igate1.hac.com>)
+
+How to copy/paste text from/to vim in a dos box:
+
+1) to get VIM to run in a window, instead of full screen, press alt+enter.
+ This toggles back and forth between full screen and a dos window.
+ NOTE: In Windows 95 you must have the property "Fast Pasting" unchecked!
+ In the properties dialog box for the MS-DOS window, go to "MS-DOS
+ Prompt/Misc/Fast pasting" and make sure that it is NOT checked.
+ To make this permanent, change the properties for
+ "\windows\system\conagent.exe" (from Philip Nelson, unverified).
+
+2) To paste something _into_ Vim, put Vim in insert mode.
+
+3) put the text you want to paste on the windows clipboard.
+
+4) Click the control box in the upper left of the Vim window. (This looks
+ like a big minus sign). If you don't want to use the mouse, you can get
+ this with alt+spacebar.
+5) on the resulting dropdown menu choose "Edit"
+6) on the child dropdown menu choose "Paste"
+
+To copy something from the Vim window to the clipboard,
+
+1) select the control box to get the control drop down menu.
+2) select "Edit".
+3) select "Mark"
+4) using either the keys or the mouse, select the part of the Vim window that
+ you want to copy. To use the keys, use the arrow keys, and hold down shift
+ to extend the selection.
+5) when you've completed your selection, press 'enter.' The selection
+ is now in the windows clipboard. By the way, this can be any
+ rectangular selection, for example columns 4-25 in rows 7-10. It can
+ include anything in the VIM window: the output of a :!dir, for
+ example.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_os2.txt b/runtime/doc/os_os2.txt
new file mode 100644
index 000000000..3a4dd476f
--- /dev/null
+++ b/runtime/doc/os_os2.txt
@@ -0,0 +1,220 @@
+*os_os2.txt* For Vim version 7.0aa. Last change: 2004 Jan 09
+
+
+ VIM REFERENCE MANUAL by Paul Slootman
+
+
+ *os2* *OS2* *OS/2*
+This file contains the particularities for the OS/2 version of Vim.
+
+At present there is no native PM version of the GUI version of Vim: The OS/2
+version is a console application. However, there is now a Win32s-compatible
+GUI version, which should be usable by owners of Warp 4 (which supports
+Win32s) in a Win-OS/2 session. The notes in this file refer to the native
+console version.
+
+
+NOTE
+
+This OS/2 port works well for me and a couple of other OS/2 users; however,
+since I haven't had much feedback, that either means no (OS/2-specific) bugs
+exist (besides the ones mentioned below), or no one has yet created a
+situation in which any bugs are apparent. File I/O in Dos and Unix mode,
+binary mode, and FAT handling all seem to work well, which would seem to be
+the most likely places for trouble.
+
+A known problem is that files opened by Vim are inherited by other programs
+that are started via a shell escape from within Vim. This specifically means
+that Vim won't be able to remove the swap file(s) associated with buffers open
+at the time the other program was started, until the other program is stopped.
+At that time, the swap file may be removed, but if Vim could not do that the
+first time, it won't be removed at all. You'll get warnings that some other
+Vim session may be editing the file when you start Vim up again on that file.
+This can be reproduced with ":!start epm". Now quit Vim, and start Vim again
+with the file that was in the buffer at the time epm was started. I'm working
+on this!
+
+A second problem is that Vim doesn't understand the situation when using it
+when accessing the OS/2 system via the network, e.g. using telnet from a Unix
+system, and then starting Vim. The problem seems to be that OS/2 =sometimes=
+recognizes function / cursor keys, and tries to convert those to the
+corresponding OS/2 codes generated by the "normal" PC keyboard. I've been
+testing a workaround (mapping the OS/2 codes to the correct functions), but so
+far I can't say anything conclusive (this is on Warp 3, by the way). In the
+meantime any help will be appreciated.
+
+
+PREREQUISITES
+
+To run Vim, you need the emx runtime environment (at least rev. 0.9b). This
+is generally available as (ask Archie about it):
+
+ emxrt.zip emx runtime package
+
+I've included a copy of emx.dll, which should be copied to one of the
+directories listed in your LIBPATH. Emx is GPL'ed, but the emx.dll library is
+not (read COPYING.EMX to find out what that means to you).
+
+This emx.dll is from the emxfix04.zip package, which unfortunately has a bug,
+eh, I mean a POSIX feature, in select(). Versions of Vim before 3.27 will
+appear to hang when starting (actually, while processing vimrc). Hit <Enter> a
+couple of times until Vim starts working if this happens. Next, get an up to
+date version of Vim!
+
+
+HELP AND VIMRC FILE
+
+If you unpack the archive that Vim came in and run Vim directly from where it
+was unpacked, Vim should be able to find the runtime files and your .vimrc
+without any settings.
+
+If you put the runtime files separately from the binary, the VIM environment
+variable is used to find the location of the help files and the system .vimrc.
+Place an entry such as this in CONFIG.SYS: >
+
+ SET VIM=c:/local/lib/vim
+
+Put your .vimrc and your other Vim files in this directory. Copy the runtime
+directory to this directory. Each version of Vim has its own runtime
+directory. It will be called something like "c:/local/lib/vim/vim54". Thus
+you get a tree of Vim files like this:
+ c:/local/lib/vim/.vimrc
+ c:/local/lib/vim/vim54/filetype.vim
+ c:/local/lib/vim/vim54/doc/help.txt
+ etc.
+
+Note: .vimrc may also be called _vimrc to accommodate those who have chosen to
+install OS/2 on a FAT file system. Vim first tries to find .vimrc and if that
+fails, looks for _vimrc in the same place. The existence of a .vimrc or
+_vimrc file influences the 'compatible' options, which can have unexpected side
+effects. See |'compatible'|.
+
+If you're using network drives with OS/2, then you can install Vim on a
+network drive (including .vimrc; this is then called the "system" vimrc file),
+and then use a personal copy of .vimrc (the "user" vimrc file). This should be
+located in a directory indicated by the HOME environment variable.
+
+
+ENVIRONMENT VARIABLES IN FILE NAMES
+
+This HOME environment variable is also used when using ~ in file names, so
+":e ~/textfile" will edit the file "textfile" in the directory referred to by
+HOME. Additionally you can use other environment variables in file names, as
+as ":n $SRC/*.c".
+
+The HOME environment variable is also used to locate the .viminfo file
+(see |viminfo-file|). There is no support yet for .viminfo on FAT file
+systems yet, sorry. You could try the -i startup flag (as in "vim -i
+$HOME/_viminfo") however.
+
+If the HOME environment variable is not set, the value "C:/" is used as a
+default.
+
+
+BACKSLASHES
+
+Using slashes ('/') and backslashes ('\') can be a bit of a problem (see
+|dos-backslash| for more explanation), but in almost all cases Vim does "The
+Right Thing". Vim itself uses backslashes in file names, but will happily
+accept forward slashes if they are entered (in fact, sometimes that works
+better!).
+
+
+TEMP FILES
+
+Temporary files (for filtering) are put in the first directory in the next
+list that exists and where a file can be created:
+ $TMP
+ $TEMP
+ C:\TMP
+ C:\TEMP
+ current directory
+
+
+TERMINAL SETTING
+
+ *os2ansi*
+Use "os2ansi" as the TERM environment variable (or don't set it at all, as the
+default is the correct value). You can set term to os2ansi in the .vimrc, in
+case you need TERM to be a different value for other applications. The
+problem is that OS/2 ANSI emulation is quite limited (it doesn't have insert /
+delete line, for example).
+
+If you want to use a different value for TERM (because of other programs, for
+example), make sure that the termcap entry for that TERM value has the
+appropriate key mappings. The termcap.dat distributed with emx does not always
+have them. Here are some suitable values to add to the termcap entry of your
+choice; these allow the cursor keys and the named function keys (such as
+pagedown) to work.
+
+ :ku=\316H:kd=\316P:kl=\316K:kr=\316M:%i=\316t:#4=\316s:\
+ :kD=\316S:kI=\316R:kN=\316Q:kP=\316I:kh=\316G:@7=\316O:\
+ :k1=\316;:k2=\316<:k3=\316=:k4=\316>:k5=\316?:k6=\316@:\
+ :k7=\316A:k8=\316B:k9=\316C:k;=\316D:
+
+
+Paul Slootman
+
+
+43 LINE WINDOW
+
+A suggestion from Steven Tryon, on how to run Vim in a bigger window:
+
+When I call Vim from an OS/2 WPS application such as PMMail it comes up
+in the default 25-line mode. To get a more useful window size I make
+my external editor "vimbig.cmd" which in turn calls "vimbig2.cmd".
+Brute force and awkwardness, perhaps, but it works.
+
+vimbig.cmd: >
+ @echo off
+ start "Vi Improved" /f vimbig2.cmd %1 %2 %3 %4
+
+vimbig2.cmd: >
+ @echo off
+ mode 80,43
+ vim.exe %1 %2 %3 %4
+ exit
+<
+
+CLIPBOARD ACCESS (provided by Alexander Wagner)
+
+Vim for OS/2 has no direct access to the system clipboard. To enable access
+anyway you need an additional tool which gives you access to the clipboard
+from within a vio application. The freeware package clipbrd.zip by Stefan
+Gruendel can be used for this purpose. You might download the package
+including precompiled binaries and all sources from:
+ http://www.stellarcom.org/vim/index.html
+
+Installation of this package is straight forward: just put the two executables
+that come with this package into a directory within your PATH for Vim should
+be able to call them from whatever directory you are working.
+
+To copy text from the clipboard to your Vim session you can use the :r
+command. Simply call clipbrd.exe from within Vim in the following way: >
+
+ :r !clipbrd -r
+
+To copy text from Vim to the system clipboard just mark the text in the usual
+vim-manner and call: >
+
+ :!clipbrd -w
+
+which will write your selection right into OS/2's clipboard.
+
+For ease of use you might want to add some maps for this commands. E.g. to
+use F11 to paste the clipboard into Vim and F12 to copy selected text to the
+clipboard you would use: >
+
+ if has("os2")
+ imap <F11> <ESC>:r !clipbrd -r<CR>i
+ vmap <F12> :!clipbrd -w<cr>
+ else
+ imap <F11> <ESC>"*p<CR>i
+ vmap <F12> "*y
+ endif
+
+This will ensure that only on OS/2 clipbrd is called whereas on other
+platforms vims build in mechanism is used. (To enable this functions on every
+load of Vim place the above lines in your .vimrc.)
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_qnx.txt b/runtime/doc/os_qnx.txt
new file mode 100644
index 000000000..c0d1a4b32
--- /dev/null
+++ b/runtime/doc/os_qnx.txt
@@ -0,0 +1,138 @@
+*os_qnx.txt* For Vim version 7.0aa. Last change: 2004 Apr 23
+
+
+ VIM REFERENCE MANUAL by Julian Kinraid
+
+
+ *QNX* *qnx*
+
+1. General |qnx-general|
+2. Compiling Vim |qnx-compiling|
+3. Terminal support |qnx-terminal|
+4. Photon GUI |photon-gui|
+5. Photon fonts |photon-fonts|
+6. Bugs & things To Do
+
+==============================================================================
+
+1. General *qnx-general*
+
+Vim on QNX behaves much like other unix versions. |os_unix.txt|
+
+
+2. Compiling Vim *qnx-compiling*
+
+Vim can be compiled using the standard configure/make approach. If you want to
+compile for X11, pass the --with-x option to configure. Otherwise, running
+./configure without any arguments or passing --enable-gui=photon, will compile
+vim with the Photon gui support. Run ./configure --help , to find out other
+features you can enable/disable.
+
+
+3. Terminal support *qnx-terminal*
+
+Vim has support for the mouse and clipboard in a pterm, if those options
+are compiled in, which they are normally.
+
+The options that affect mouse support are |'mouse'| and |'ttymouse'|. When
+using the mouse, only simple left and right mouse clicking/dragging is
+supported. If you hold down shift, ctrl, or alt while using the mouse, pterm
+will handle the mouse itself. It will make a selection, separate from what
+vim's doing.
+
+When the mouse is in use, you can press Alt-RightMouse to open the pterm menu.
+To turn the mouse off in vim, set the mouse option to nothing, set mouse=
+
+
+4. Photon GUI *photon-gui*
+
+To start the gui for vim, you need to run either gvim or vim -g, otherwise
+the terminal version will run. For more info - |gui-x11-start|
+
+Supported features:
+ :browse command |:browse|
+ :confirm command |:confirm|
+ Cursor blinking |'guicursor'|
+ Menus, popup menus and menu priorities |:menu|
+ |popup-menu|
+ |menu-priority|
+ Toolbar |gui-toolbar|
+ |'toolbar'|
+ Font selector (:set guifont=*) |photon-fonts|
+ Mouse focus |'mousefocus'|
+ Mouse hide |'mousehide'|
+ Mouse cursor shapes |'mouseshape'|
+ Clipboard |gui-clipboard|
+
+Unfinished features:
+ Various international support, such as Farsi & Hebrew support,
+ different encodings, etc.
+
+ This help file
+
+Unsupported features:
+ Find & Replace window |:promptfind|
+ Tearoff menus
+
+ Other things which I can't think of so I can't list them
+
+
+5. Fonts *photon-fonts*
+
+You set fonts in the gui with the guifont option >
+ :set guifont=Lucida\ Terminal
+<
+The font must be a monospace font, and any spaces in the font name must be
+escaped with a '\'. The default font used is PC Terminal, size 8. Using
+'*' as the font name will open a standard Photon font selector where you can
+select a font.
+
+Following the name, you can include optional settings to control the size and
+style of the font, each setting separated by a ':'. Not all fonts support the
+various styles.
+
+The options are,
+ s{size} Set the size of the font to {size}
+ b Bold style
+ a Use antialiasing
+ i Italic style
+
+Examples:
+
+Set the font to monospace size 10 with antialiasing >
+ :set guifont=monospace:s10:a
+<
+Set the font to Courier size 12, with bold and italics >
+ :set guifont=Courier:s12:b:i
+<
+Select a font with the requester >
+ :set guifont=*
+<
+
+
+6. Bugs & things To Do
+
+Known problems:
+ - Vim hangs sometimes when running an external program. Workaround:
+ put this line in your |vimrc| file: >
+ set noguipty
+
+Bugs:
+ - Still a slight problem with menu highlighting
+ - When using phditto/phinows/etc., if you are using a font that
+ doesn't support the bold attribute, when vim attempts to draw
+ bold text it will be all messed up.
+ - The cursor can sometimes be hard to see.
+ - A number of minor problems that can fixed :)
+
+Todo:
+ - Improve multi-language support.
+ - Options for setting the fonts used in the menu and toolbar.
+ - Find & Replace dialog.
+ - The clientserver features.
+ - Maybe tearoff menus.
+
+ - Replace usage of fork() with spawn() when launching external
+ programs.
+
+ vim:tw=78:sw=4:ts=8:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_risc.txt b/runtime/doc/os_risc.txt
new file mode 100644
index 000000000..04f9ba551
--- /dev/null
+++ b/runtime/doc/os_risc.txt
@@ -0,0 +1,323 @@
+*os_risc.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Thomas Leonard
+
+
+ *riscos* *RISCOS* *RISC-OS*
+This file contains the particularities for the RISC OS version of Vim.
+
+The RISC OS port is a completely new port and is not based on the old `archi'
+port.
+
+1. File locations |riscos-locations|
+2. Filename munging |riscos-munging|
+3. Command-line use |riscos-commandline|
+4. Desktop (GUI) use |riscos-gui|
+5. Remote use (telnet) |riscos-remote|
+6. Temporary files |riscos-temp-files|
+7. Interrupting |riscos-interrupt|
+8. Memory usage |riscos-memory|
+9. Filetypes |riscos-filetypes|
+10. The shell |riscos-shell|
+11. Porting new releases |riscos-porting|
+
+If I've missed anything, email me and I'll try to fix it. In fact, even if I
+haven't missed anything then email me anyway to give me some confidence that it
+actually works!
+
+Thomas Leonard <tal197@ecs.soton.ac.uk>
+
+ [these URLs no longer work...]
+ Port homepage: http://www.ecs.soton.ac.uk/~tal197/
+ or try: http://www.soton.ac.uk/~tal197/
+
+==============================================================================
+ *riscos-locations*
+1. File locations
+
+The Vim executable and shared resource files are all stored inside the !Vim
+application directory.
+
+When !Vim is first seen by the filer, it aliases the *vi and *ex commands to
+run the command-line versions of Vim (see |riscos-commandline|).
+
+!Vim.Resources and !Vim.Resources2 contain the files from the standard Vim
+distribution, but modified slightly to work within the limits of ADFS, plus
+some extra files such as the window templates.
+
+User choices are read from `Choices:*' and are saved to `<Choices$Write>.*'.
+If you have the new !Boot structure then these should be set up already. If
+not, set Choices$Path to a list of directories to search when looking for
+user configuration files. Set Choices$Write to the directory you want files
+to be saved into (so your search patterns and marks can be remembered between
+sessions).
+
+==============================================================================
+ *riscos-munging*
+2. Filename munging
+
+All pathname munging is disabled by default, so Vim should behave like a
+normal RISC OS application now. So, if you want to edit `doc/html' then you
+actually type `*vi doc/html'.
+
+The only times munging is done is when:
+
+- Searching included files from C programs, since these are always munged.
+ See |[I|.
+ Note: make sure you are in the right directory when you use this
+ command (ie the one with subdirectories 'c' and 'h').
+
+- Sourcing files using |:so|.
+ Paths starting `$VIM/' are munged like this:
+
+ $VIM/syntax/help.vim -> Vim:syntax.help
+
+ Also, files ending in `.vim' have their extensions removed, and slashes
+ replaced with dots.
+
+Some tag files and script files may have to be edited to work under this port.
+
+==============================================================================
+ *riscos-commandline*
+3. Command-line use
+
+To use Vim from the command-line use the `*vi' command (or '*ex' for
+|Ex-mode|).
+
+Type `*vi -h' for a list of options.
+
+Running the command-line version of Vim in a large high-color mode may cause
+the scrolling to be very slow. Either change to a mode with fewer colors or
+use the GUI version.
+
+Also, holding down Ctrl will slow it down even more, and Ctrl-Shift will
+freeze it, as usual for text programs.
+
+==============================================================================
+ *riscos-gui*
+4. Desktop use
+
+Limitations:
+
+- Left scrollbars don't work properly (right and bottom are fine).
+- Doesn't increase scroll speed if it gets behind.
+
+You can resize the window by dragging the lower-right corner, even though
+there is no icon shown there.
+
+You can use the --rows and --columns arguments to specify the initial size of
+the Vim window, like this: >
+
+ *Vi -g --rows 20 --columns 80
+
+The global clipboard is supported, so you can select some text and then
+paste it directly into another application (provided it supports the
+clipboard too).
+
+Clicking Menu now opens a menu like a normal RISC OS program. Hold down Shift
+when clicking Menu to paste (from the global clipboard).
+
+Dragging a file to the window replaces the CURRENT buffer (the one with the
+cursor, NOT the one you dragged to) with the file.
+
+Dragging with Ctrl held down causes a new Vim window to be opened for the
+file (see |:sp|).
+
+Dragging a file in with Shift held down in insert mode inserts the pathname of
+the file.
+
+:browse :w opens a standard RISC OS save box.
+:browse :e opens a directory viewer.
+
+For fonts, you have the choice of the system font, an outline font, the system
+font via ZapRedraw and any of the Zap fonts via ZapRedraw: >
+
+ :set guifont=
+< To use the system font via the VDU drivers. Supports
+ bold and underline.
+>
+ :set guifont=Corpus.Medium
+< Use the named outline font. You can use any font, but
+ only monospaced ones like Corpus look right.
+>
+ :set guifont=Corpus.Medium:w8:h12:b:i
+< As before, but with size of 8 point by 12 point, and
+ in bold italic.
+ If only one of width and height is given then that
+ value is used for both. If neither is given then 10
+ point is used.
+
+Thanks to John Kortink, Vim can use the ZapRedraw module. Start the font name
+with '!' (or '!!' for double height), like this: >
+
+ :set guifont=!!
+< Use the system font, but via ZapRedraw. This gives a
+ faster redraw on StrongARM processors, but you can't
+ get bold or italic text. Double height.
+>
+ :set guifont=!script
+< Uses the named Zap font (a directory in VimFont$Path).
+ The redraw is the same speed as for '!!', but you get
+ a nicer looking font.
+ Only the "man+" and "script" fonts are supplied
+ currently, but you can use any of the Zap fonts if
+ they are in VimFont$Path.
+ Vim will try to load font files '0', 'B', 'I' and 'IB'
+ from the named directory. Only '0' (normal style) MUST
+ be present. Link files are not currently supported.
+
+Note that when using ZapRedraw the edit bar is drawn in front of the character
+you are on rather than behind it. Also redraw is incorrect for screen modes
+with eigen values of 0. If the font includes control characters then you can
+get Vim to display them by changing the 'isprint' option.
+
+If you find the scrolling is too slow on your machine, try experimenting
+with the 'scrolljump' and 'ttyscroll' options.
+
+In particular, StrongARM users may find that: >
+
+ :set ttyscroll=0
+
+makes scrolling faster in high-color modes.
+
+=============================================================================
+ *riscos-remote*
+5. Remote use (telnet)
+
+I have included a built-in termcap entry, but you can edit the termcap file to
+allow other codes to be used if you want to use Vim from a remote terminal.
+
+Although I do not have an internet connection to my Acorn, I have managed to
+run Vim in a FreeTerm window using the loopback connection.
+
+It seems to work pretty well now, using '*vi -T ansi'.
+
+==============================================================================
+ *riscos-temp-files*
+6. Temporary files
+
+If Vim crashes then the swap and backup files (if any) will be in the
+directories set with the 'directory' and 'bdir' options. By default the swap
+files are in <Wimp$ScrapDir> (ie inside !Scrap) and backups are in the
+directory you were saving to. Vim will allow you to try and recover the file
+when you next try to edit it.
+
+To see a list of swap files, press <F12> and type `*vi -r'.
+
+Vim no longer brings up ATTENTION warnings if you try to edit two files with
+the same name in different directories.
+
+However, it also no longer warns if you try to edit the same file twice (with
+two copies of Vim), though you will still be warned when you save that the
+datestamp has changed.
+
+==============================================================================
+ *riscos-interrupt*
+7. Interrupting
+
+To break out of a looping macro, or similar, hold down Escape in the
+command-line version, or press CTRL-C in the GUI version.
+
+==============================================================================
+ *riscos-memory*
+8. Memory usage
+
+Vim will use dynamic areas on RISC OS 3.5 or later. If you can use them on
+older machines then edit the !RunTxt and GVim files. I don't know what UnixLib
+does by default on these machines so I'm playing safe.
+
+It doesn't work at all well without dynamic areas, since it can't change its
+memory allocation once running. Hence you should edit `!Vim.GVim' and
+`!Vim.!RunTxt' to choose the best size for you. You probably need at least
+about 1400K.
+
+==============================================================================
+ *riscos-filetypes*
+9. Filetypes
+
+You can now specify that autocommands are only executed for files of certain
+types. The filetype is given in the form &xxx, when xxx is the filetype.
+
+Filetypes must be specified by number (eg &fff for Text).
+
+The system has changed from version 5.3. The new sequence of events is:
+
+- A file is loaded. |'osfiletype'| is set to the RISC OS filetype.
+- Based on the filetype and pathname, Vim will try to set |'filetype'| to the
+ Vim-type of the file.
+- Setting this option may load syntax files and perform other actions.
+- Saving the file will give it a filetype of |'osfiletype'|.
+
+Some examples may make this clearer:
+
+ Kind of file loaded osfiletype filetype ~
+ C code 'c.hellow' Text (&fff) C
+ LaTeX document LaTeX (&2a8) TeX
+ Draw document DrawFile (&aff) (not changed)
+
+==============================================================================
+ *riscos-shell*
+10. The shell
+
+- Bangs (!s) are only replaced if they are followed by a space or end-of-line,
+ since many pathnames contain them.
+
+- You can prefix the command with '~', which stops any output from being
+ displayed. This also means that you don't have to press <Enter> afterwards,
+ and stops the screen from being redrawn. {only in the GUI version}
+
+==============================================================================
+ *riscos-porting*
+11. Porting new releases to RISC OS
+
+Downloading everything you need:
+
+- Get the latest source distribution (see www.vim.org)
+- Get the runtime environment files (eg these help files)
+- Get the `extra' archive (contains the RISC OS specific bits)
+- Get the RISC OS binary distribution (if possible)
+
+
+Unarchiving:
+
+- Create a raFS disk and put the archives on it.
+- Un-gzip them
+- Un-tar them (*tar xELf 50 archive/tar)
+
+
+Recompiling the sources:
+
+- Create c, s, and h directories.
+- Put all the header files in 'h' \
+- Put all the C files in `c' | And lose the extensions
+- Put the assembler file (`swis/s') in 's' /
+- Rename all the files in `proto' to `h', like this:
+ raFS::VimSrc.source.proto.file/pro
+ becomes
+ raFS::VimSrc.source.h.file_pro
+- In the files `h.proto' and `c.termlib', search and replace
+ .pro"
+ with
+ _pro.h"
+- Create a simple Makefile if desired and do '*make -k'
+ Use 'CC = gcc -DRISCOS -DUSE_GUI -O2 -x c' in the Makefile
+- Save the binary as !Vim.Vim in the binary distribution
+
+
+Updating the run-time environment:
+
+- Replace old or missing files inside !Vim.Resources with the
+ new files.
+- Remove files in `doc' not ending in `/txt', except for `tags'.
+- Lose the extensions from the files in `doc'.
+- Edit the `doc.tags' file. Remove extensions from the second column: >
+ :%s/^\(.[^\t]*\t.*\)\.txt\t/\1\t/
+- Remove extensions from the syntax files. Split them into two directories
+ to avoid the 77 entry limit on old ADFS filesystems.
+- Edit `Vim:FileType' to match `*.c.*' as well as `*/c' and so on.
+ Add filetype checking too.
+- Edit `Vim:Menu' and remove all the keys from the menus: >
+ :%s/<Tab>[^ \t]*//
+<
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt
new file mode 100644
index 000000000..903a574ab
--- /dev/null
+++ b/runtime/doc/os_unix.txt
@@ -0,0 +1,60 @@
+*os_unix.txt* For Vim version 7.0aa. Last change: 2003 Mar 15
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *unix* *Unix*
+This file contains the particularities for the Unix version of Vim.
+
+For compiling Vim on Unix see "INSTALL" and "Makefile" in the src directory.
+
+The default help file name is "/usr/local/lib/vim/help.txt"
+The files "$HOME/.vimrc" and "$HOME/.exrc" are used instead of "s:.vimrc" and
+"s:.exrc". Additionally "/usr/local/etc/vimrc" is used first.
+If "/usr/local/share" exists it is used instead of "/usr/local/lib".
+
+Temporary files (for filtering) are put in "/tmp". If you want to place them
+somewhere else, set the environment variable $TMPDIR to the directory you
+prefer.
+
+With wildcard expansion you can use '~' (home directory) and '$'
+(environment variable).
+
+ *fork* *spoon*
+For executing external commands fork()/exec() is used when possible, otherwise
+system() is used, which is a bit slower. The output of ":version" includes
+|+fork| when fork()/exec() is used, |+system()| when system() is used. This
+can be changed at compile time.
+(For forking of the GUI version see |gui-fork|).
+
+Because terminal updating under Unix is often slow (e.g. serial line
+terminal, shell window in suntools), the 'showcmd' and 'ruler' options
+are default off. If you have a fast terminal, try setting them on. You might
+also want to set 'ttyfast'.
+
+When using Vim in an xterm the mouse clicks can be used by Vim by setting
+'mouse' to "a". If there is access to an X-server gui style copy/paste will
+be used and visual feedback will be provided while dragging with the mouse.
+If you then still want the xterm copy/paste with the mouse, press the shift
+key when using the mouse. See |mouse-using|. Visual feedback while dragging
+can also be achieved via the 'ttymouse' option if your xterm is new enough.
+
+ *terminal-colors*
+To use colors in Vim you can use the following example (if your terminal
+supports colors, but "T_Co" is empty or zero): >
+ :set t_me=^[[0;1;36m " normal mode (undoes t_mr and t_md)
+ :set t_mr=^[[0;1;33;44m " reverse (invert) mode
+ :set t_md=^[[1;33;41m " bold mode
+ :set t_se=^[[1;36;40m " standout end
+ :set t_so=^[[1;32;45m " standout mode
+ :set t_ue=^[[0;1;36m " underline end
+ :set t_us=^[[1;32m " underline mode start
+[the ^[ is an <Esc>, type CTRL-V <Esc> to enter it]
+
+For real color terminals the ":highlight" command can be used.
+
+The file "tools/Vim132" is a shell script that can be used to put Vim in 132
+column mode on a vt100 and lookalikes.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
new file mode 100644
index 000000000..834b35b16
--- /dev/null
+++ b/runtime/doc/os_vms.txt
@@ -0,0 +1,779 @@
+*os_vms.txt* For Vim version 7.0aa. Last change: 2004 May 16
+
+
+ VIM REFERENCE MANUAL
+
+
+ *VMS* *vms*
+This file contains the particularities for the VMS version of Vim.
+You can reach this information file by typing :help VMS in Vim command
+prompt.
+
+ 1. Getting started |vms-started|
+ 2. Download files |vms-download|
+ 3. Compiling |vms-compiling|
+ 4. Problems |vms-problems|
+ 5. Deploy |vms-deploy|
+ 6. Practical usage |vms-usage|
+ 7. GUI mode questions |vms-gui|
+ 8. Useful notes |vms-notes|
+ 9. VMS related changes |vms-changes|
+10. Authors |vms-authors|
+
+==============================================================================
+
+1. Getting started *vms-started*
+
+Vim (Vi IMproved) is a vi-compatible text editor that runs on nearly every
+operating system known to humanity. Now use Vim on OpenVMS too, in character
+or X/Motif environment. It is fully featured and absolutely compatible with
+Vim on other operating systems.
+
+==============================================================================
+
+2. Download files *vms-download*
+
+You can download the Vim source code by ftp from the official Vim site:
+ ftp://ftp.vim.org/pub/vim/
+Or use one of the mirrors:
+ ftp://ftp.vim.org/pub/vim/MIRRORS
+
+You will need both the Unix and Extra archives to build vim.exe for VMS.
+For using Vim's full power you will need the runtime files as well.
+
+You can download precompiled executables from:
+ http://www.polarhome.com/vim/
+ ftp://ftp.polarhome.com/pub/vim/
+
+To use the precompiled binary version, you need one of these archives:
+
+ vim-XX-exe-alpha-gui.zip Alpha GUI/Motif executables
+ vim-XX-exe-alpha-gtk.zip Alpha GUI/GTK executables
+ vim-XX-exe-alpha-term.zip Alpha console executables
+ vim-XX-exe-vax-gui.zip VAX GUI executables
+ vim-XX-exe-vax-term.zip VAX console executables
+
+and of course
+ vim-XX-runtime.zip runtime files
+
+The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files.
+
+==============================================================================
+
+3. Compiling *vms-compiling*
+
+See the file [.SRC]INSTALLVMS.TXT.
+
+==============================================================================
+
+4. Problems *vms-problems*
+
+The code has been tested under Open VMS 6.2 - 7.3 on Alpha and VAX platforms
+with the DECC compiler. It should work without bigger problems.
+If it happened that your system does not have some include libraries you can
+tune up in OS_VMS_CONF.H file.
+
+If you decided to build Vim with +perl, +python, etc. options, first you need
+to download OpenVMS distributions of Perl and Python. Build and deploy the
+libraries and change adequate lines in MAKE_VMS.MMS file. There should not be
+problem from Vim side.
+
+Note: Under VAX it should work with DEC C compiler without problem. VAXC
+compiler is not fully ANSI C compatible in pre-processor directives
+semantics, therefore you have to use a converter program what will do the
+lion part of the job. For detailed instruction read file INSTALLvms.txt
+
+MMS_VIM.EXE is building together with VIM.EXE, but for XD.EXE you should
+change to subdirectory and build it separately.
+
+CTAGS is not part of Vim source distribution any more, however the OpenVMS
+specific source might contain CTAGS source files as it is described above.
+You can find more information about CTAGS on VMS at
+http://www.polarhome.com/ctags/
+
+Advanced users may try some acrobatics in FEATURE.H file also.
+
+It is possible to compile with +xfontset +xim options too, but then you have
+to set up GUI fonts etc. correctly. See. :help xim from Vim command prompt.
+
+You may want to use GUI with GTK icons, then you have to download and install
+GTK for OpenVMS or at least runtime shareable images - LIBGTK from
+polarhome.com
+
+For more advanced questions, please send your problem to Vim on VMS mailing
+list <vim-vms@polarhome.com>
+More about the vim-vms list can be found at:
+http://www.polarhome.com/mailman/listinfo/vim-vms
+
+==============================================================================
+
+5. Deploy *vms-deploy*
+
+Vim uses a special directory structure to hold the document and runtime files:
+
+ vim (or wherever)
+ |- tmp
+ |- vim57
+ |----- doc
+ |----- syntax
+ |- vim60
+ |----- doc
+ |----- syntax
+ |- vim61
+ |----- doc
+ |----- syntax
+ vimrc (system rc files)
+ gvimrc
+
+Use: >
+
+ define/nolog VIM device:[path.vim]
+ define/nolog VIMRUNTIME device:[path.vim.vim60]
+ define/nolog TMP device:[path.tmp]
+
+to get vim.exe to find its document, filetype, and syntax files, and to
+specify a directory where temporary files will be located. Copy the "runtime"
+subdirectory of the vim distribution to vimruntime.
+
+Logicals $VIMRUNTIME and $TMP are optional.
+
+If $VIMRUNTIME is not set, Vim will guess and try to set up automatically.
+Read more about at :help runtime
+
+If $TMP is not set, you will not be able to use some functions as CTAGS,
+XXD, printing etc. that use temporary directory for normal operation.
+$TMP directory should be readable and writable by the user(s).
+The easiest way to set up $TMP is to define logical: >
+
+ define/nolog TMP SYS$SCRATCH
+or as: >
+ define/nolog TMP SYS$LOGIN
+
+==============================================================================
+
+6. Practical usage *vms-usage*
+
+Usually, you want to run just one version of Vim on your system, therefore
+it is enough to dedicate one directory for Vim.
+Copy all Vim runtime directory structure to the deployment position.
+Add the following lines to your LOGIN.COM (in SYS$LOGIN directory).
+Set up logical $VIM as: >
+
+ $ define VIM device:<path>
+
+Set up some symbols: >
+
+ $ ! vi starts Vim in chr. mode.
+ $ vi*m :== mcr VIM:VIM.EXE
+
+ $ !gvi starts Vim in GUI mode.
+ $ gv*im :== spawn/nowait mcr VIM:VIM.EXE -g
+
+Please, check the notes for customization and configuration of symbols.
+
+You may want to create .vimrc and .gvimrc files in your home directory
+(SYS$LOGIN) to overwrite default settings.
+
+The easiest way is just rename example files. You may leave the menu file
+(MENU.VIM) and files vimrc and gvimrc in the original $VIM directory. It will
+be default setup for all users, and for users is enough just to have their
+own additions or resetting in home directory in files .vimrc and .gvimrc.
+It should work without problems.
+
+Note: Remember, system rc files (default for all users) does not have leading
+"." So, system rc files are: >
+
+ $VIM:vimrc
+ $VIM:gvimrc
+ $VIM:menu.vim
+
+and user's customized rc files are: >
+
+ sys$login:.vimrc
+ sys$login:.gvimrc
+
+You can check that everything is on the right place with the :version command.
+
+Example LOGIN.COM: >
+
+ $ define/nolog VIM RF10:[UTIL.VIM]
+ $ vi*m :== mcr VIM:VIM.EXE
+ $ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40
+ $ set disp/create/node=192.168.5.223/trans=tcpip
+
+Note: This set-up should be enough, if you are working on standalone server or
+clustered environment, but if you want to use Vim as internode editor in
+DECNET environment, it will satisfy you as well.
+You just have to define the "whole" path: >
+
+ $ define VIM "<server_name>[""user password""]::device:<path>"
+ $ vi*m :== "mcr VIM:VIM.EXE"
+
+as for example: >
+
+ $ define VIM "PLUTO::RF10:[UTIL.VIM]"
+ $ define VIM "PLUTO""ZAY mypass""::RF10:[UTIL.VIM]" ! if passwd required
+
+You can also use $VIMRUNTIME logical to point to proper version of Vim if you
+have installed more versions in the same time. If $VIMRUNTIME is not defined
+Vim will borrow value from $VIM logical. You can find more information about
+$VIMRUNTIME logical by typing :help runtime as a Vim command.
+
+System administrators might want to set up a system wide Vim installation,
+then add to the SYS$STARTUP:SYLOGICALS.COM >
+
+ $ define/nolog/sys VIM device:<path>
+ $ define/nolog/sys TMP SYS$SCRATCH
+
+and to the SYS$STARTUP:SYLOGIN.COM >
+
+ $ vi*m :== mcr VIM:VIM.EXE
+ $ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40
+
+
+It will set up normal Vim work environment for every user on the system.
+
+==============================================================================
+
+7. GUI mode questions *vms-gui*
+
+OpenVMS in a real mainframe OS, therefore even if it has a GUI console, most of
+the users does not use a native X/Window environment during normal operation.
+It is not possible to start Vim in GUI mode "just like that". But anyhow it is
+not too complicate either.
+
+First of all: you will need an executable that is built with enabled GUI.
+
+Second: you need to have installed DECW/Motif on your VMS server, otherwise
+you will get errors that some shareable libraries are missing.
+
+Third: If you choose to run Vim with extra feature as GUI/GTK then you need
+GTK installation too or at least GTK runtime environment (LIBGTK etc.)
+
+1) If you are working on the VMS X/Motif console:
+ Start Vim with the command: >
+
+ $ mc device:<path>VIM.EXE -g
+<
+ or type :gui as a command to the Vim command prompt. For more info :help gui
+
+2) If you are working on other X/Window environment as Unix or some remote X
+ VMS console. Set up display to your host with: >
+
+ $ set disp/create/node=<your IP address>/trans=<transport-name>
+<
+ and start Vim as in point 1. You can find more help in VMS documentation or
+ type: help set disp in VMS prompt.
+ Examples: >
+
+ $ set disp/create/node=192.168.5.159 ! default trans is DECnet
+ $ set disp/create/node=192.168.5.159/trans=tcpip ! TCP/IP network
+ $ set disp/create/node=192.168.5.159/trans=local ! display on the same node
+
+Note: you should define just one of these.
+For more information type $help set disp in VMS prompt.
+
+3) Another elegant solution is XDM if you have installed on OpenVMS box.
+ It is possible to work from XDM client as from GUI console.
+
+4) If you are working on MS Windows or other non X/Window environment
+ You need to set up one X server and run Vim as in point 2.
+ For MS Windows there are available free X servers as MIX , Omni X etc.
+ as well as excellent commercial products as eXcursion or ReflectionX with
+ buit in DEC support.
+
+Please note, that executables without GUI are slightly faster during startup
+then with enabled GUI in character mode. Therefore, if you do not use GUI
+features, it is worth to choose non GUI executables.
+
+==============================================================================
+
+8. Useful notes *vms-notes*
+
+8.1 backspace/delete
+8.2 Filters
+8.3 VMS file version numbers
+8.4 Directory conversion
+8.5 Remote host invocation
+8.6 Terminal problems
+8.7 Hex-editing and other external tools
+8.8 Sourcing vimrc and gvimrc
+8.9 Printing from Vim
+8.10 Setting up the symbols
+8.11 diff and other GNU programs
+8.12 diff-mode
+8.13 Allow '$' in C keywords
+8.14 VIMTUTOR for beginners
+
+8.1 backspace/delete
+
+There are backspace/delete key inconsistencies with VMS.
+:fixdel doesn't do the trick, but the solution is: >
+
+ :inoremap ^? ^H " for terminal mode
+ :inoremap <Del> ^H " for gui mode
+
+Read more in ch: 8.6 (Terminal problems).
+(Bruce Hunsaker <BNHunsaker@chq.byu.edu> Vim 5.3)
+
+
+8.2 Filters
+
+Vim supports filters; ie. if you have a sort program that can handle
+input/output redirection like Unix (<infile >outfile), you could use >
+
+ :map \s 0!'aqsort<CR>
+
+(Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov> Vim 5.4)
+
+
+8.3 VMS file version numbers
+
+Vim is saving files into a new file with the next higher file version
+number, try these settings. >
+
+ :set nobackup " does not create *.*_ backup files
+ :set nowritebackup " does not have any purpose on VMS. It's default.
+
+Recovery is working perfect as well from the default swap file.
+Read more with :help swapfile
+
+(Claude Marinier <ClaudeMarinier@xwavesolutions.com> Vim 5.5, Zoltan Arpadffy
+Vim 5.6 )
+
+
+8.4 Directory conversion
+
+Vim will internally convert any unix-style paths and even mixed unix/VMS
+paths into VMS style paths. Some typical conversions resemble:
+
+ /abc/def/ghi -> abc:[def]ghi.
+ /abc/def/ghi.j -> abc:[def]ghi.j
+ /abc/def/ghi.j;2 -> abc:[def]ghi.j;2
+ /abc/def/ghi/jkl/mno -> abc:[def.ghi.jkl]mno.
+ abc:[def.ghi]jkl/mno -> abc:[def.ghi.jkl]mno.
+ ./ -> current directory
+ ../ -> relative parent directory
+ [.def.ghi] -> relative child directory
+ ./def/ghi -> relative child directory
+
+Note: You may use <,> brackets as well (device:<path>file.ext;version) as
+rf10:<user.zay.work>test.c;1
+
+(David Elins <delins@foliage.com>, Jerome Lauret
+<JLAURET@mail.chem.sunysb.edu> Vim 5.6 )
+
+
+8.5 Remote host invocation
+
+It is possible to use Vim as an internode editor.
+1. Edit some file from remote node: >
+
+ vi "<server>""username passwd""::<device>:<path><filename>;<version>"
+
+example: >
+ vi "pluto""zay passwd""::RF10:<USER.ZAY.WORK>TEST.C;1"
+
+Note: syntax is very important, otherwise VMS will recognize more parameters
+instead of one (resulting with: file not found)
+
+2. Set up Vim as your internode editor. If Vim is not installed on your host,
+just set up your IP address, full Vim path including the server name and run
+the command procedure below: >
+
+ $ if (p1 .eqs. "") .OR. (p2 .eqs. "") then goto usage
+ $ set disp/create/node=<your_IP_here>/trans=tcpip
+ $ define "VIM "<vim_server>""''p1' ''p2'""::<device>:<vim_path>"
+ $ vi*m :== "mcr VIM:VIM.EXE"
+ $ gv*im :== "spawn/nowait mcr VIM:VIM.EXE -g"
+ $ goto end
+ $ usage:
+ $ write sys$output " Please enter username and password as a parameter."
+ $ write sys$output " Example: @SETVIM.COM username passwd"
+ $ end:
+
+Note: Never use it in clustered environment (you do not need it), and load could
+be very-very slow, but even faster then a local Emacs. :-)
+
+(Zoltan Arpadffy, Vim 5.6)
+
+
+8.6 Terminal problems
+
+If your terminal name is not known to Vim and it is trying to find the default
+one you will get the following message during start-up:
+---
+Terminal entry not found in termcap
+'unknown-terminal' not known. Available built-in terminals are:
+ builtin_gui
+ builtin_riscos
+ builtin_amiga
+ builtin_beos-ansi
+ builtin_ansi
+ builtin_vt320
+ builtin_vt52
+ builtin_pcansi
+ builtin_win32
+ builtin_xterm
+ builtin_iris-ansi
+ builtin_debug
+ builtin_dumb
+defaulting to 'vt320'
+---
+The solution is to define default terminal name: >
+
+ $ ! unknown terminal name. let us use vt320 or ansi instead.
+ $ ! Note: it's case sensitive
+ $ define term "vt320"
+
+Terminals from VT100 to VT320 (as V300, VT220, VT200 ) do not need any extra
+keyboard mappings. They should work perfect as they are, including arrows,
+Ins, Del buttons etc. Except Backspace in GUI mode. To solve it, add to
+.gvimrc: >
+
+ inoremap <Del> <BS>
+
+Vim will also recognize that they are fast terminals.
+
+If you have some annoying line jumping on the screen between windows add to
+your .vimrc file: >
+
+ set ttyfast " set fast terminal
+
+Note: if you're using Vim on remote host or through very slow connection, it's
+recommended to avoid fast terminal option with: >
+
+ set nottyfast " set terminal to slow mode
+
+(Zoltan Arpadffy, Vim 5.6)
+
+
+8.7 Hex-editing and other external tools
+
+A very important difference between OpenVMS and other systems is that VMS uses
+special commands to execute executables: >
+
+ RUN <path>filename
+ MCR <path>filename <parameters>
+
+OpenVMS users always have to be aware that the Vim command :! "just" drop them
+to DCL prompt. This feature is possible to use without any problem with all
+DCL commands, but if we want to execute some program as XXD, CTAGS, JTAGS etc.
+we're running into trouble if we following the Vim documentation (see: help
+xxd).
+
+Solution: Execute with the MC command and add the full path to the executable.
+Example: Instead of :%!xxd command use: >
+
+ :%!mc vim:xxd
+
+... or in general: >
+ :!mc <path>filename <parameters>
+
+Note: You can use XXD, and CTAGS from GUI menu.
+
+To customize ctags it is possible to define logical $CTAGS with standard
+parameters as: >
+
+ define/nolog CTAGS "--totals -o sys$login:tags"
+
+For additional information, please read :help tagsearch and CTAGS
+documentation at http://ctags.sourceforge.net/ctags.html.
+
+(Zoltan Arpadffy, Vim 5.6-70)
+
+
+8.8 Sourcing vimrc and gvimrc
+
+If you want to use your .vimrc and .gvimrc from other platforms (e.g. Windows)
+you can get in trouble if you ftp that file(s): VMS has different end-of-line
+indication.
+The symptom is that ViM is not sourcing your .vimrc/.gvimrc, even if you say:
+>
+ :so sys$login:.vimrc
+
+One trick is to compress (e.g. zip) the files on the other platform and
+uncompress it on VMS; if you have the same symptom, try to create the files
+with copy-paste (for this you need both op. systems reachable from one
+machine, e.g. an Xterm on Windows or telnet to Windows from VMS).
+
+(Sandor Kopanyi, <sandor.kopanyi@mailbox.hu> Vim 6.0a)
+
+
+8.9 Printing from Vim
+
+To be able to print from Vim (running in GUI mode) under VMS you have to set
+up $TMP logical which should point to some temporary directory and logical
+SYS$PRINT to your default print queue.
+Example: >
+
+ $define SYS$PRINT HP5ANSI
+
+You can print out whole buffer or just the marked area.
+More info under :help hardcopy
+
+(Zoltan Arpadffy, Vim 6.0c)
+
+
+8.10 Setting up the symbols
+
+When I use GVIM this way and press CTRL-Y in the parent terminal, gvim exits.
+I now use a different symbol that seems to work OK and fixes the problem.
+I suggest this instead: >
+
+ $ GV*IM:==SPAWN/NOWAIT/INPUT=NLA0: MCR VIM:VIM.EXE -G -GEOMETRY 80X40
+
+The /INPUT=NLA0: separates the standard input of the gvim process from the
+parent terminal, to block signals from the parent window.
+Without the -GEOMETRY, the GVIM window size will be minimal and the menu
+will be confused after a window-resize.
+
+(Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac)
+
+
+8.11 diff and other GNU programs
+
+From 6.0 diff functionality has been implemented, but OpenVMS does not use
+GNU/Unix like diff therefore built in diff does not work.
+There is a simple solution to solve this anomaly. Install an Unix like diff
+and Vim will work perfect in diff mode too. You just have to redefine your
+diff program as: >
+
+ define /nolog diff <GNU_PATH>diff.exe
+
+Another, more sophisticated solution is described below (8.12 diff-mode)
+There are some other programs as patch, make etc that may cause same problems.
+At www.polarhome.com is possible to download an GNU package for Alpha and VAX
+boxes that is meant to solve GNU problems on OpenVMS.
+( Zoltan Arpadffy, Vim 6.1)
+
+
+8.12 diff-mode
+
+Vim 6.0 and higher supports vim diff-mode (See |new-diff-mode|, |diff-mode|
+and |08.7|). This uses the external program 'diff' and expects a Unix-like
+output format from diff. The standard VMS diff has a different output
+format. To use vim on VMS in diff-mode, you need to:
+ 1 Install a Unix-like diff program, e.g. GNU diff
+ 2 Tell vim to use the Unix-like diff for diff-mode.
+
+You can download GNU diff from the VIM-VMS website, it is one of the GNU
+tools in http://www.polarhome.com/vim/files/gnu_tools.zip. I suggest to
+unpack it in a separate directory "GNU" and create a logical GNU: that
+points to that directory. e.g: >
+
+ DEFINE GNU <DISK>:[<DIRECTORY>.BIN.GNU]
+
+You may also want to define a symbol GDIFF, to use the GNU diff from the DCL
+prompt: >
+
+ GDIFF :== $GNU:DIFF.EXE
+
+Now you need to tell vim to use the new diff program. Take the example
+settings from |diff-diffexpr| and change the call to the external diff
+program to the new diff on VMS. Add this to your .vimrc file: >
+
+ " Set up vimdiff options
+ if v:version >= 600
+ " Use GNU diff on VMS
+ set diffexpr=MyDiff()
+ function MyDiff()
+ let opt = ""
+ if &diffopt =~ "icase"
+ let opt = opt . "-i "
+ endif
+ if &diffopt =~ "iwhite"
+ let opt = opt . "-b "
+ endif
+ silent execute "!mc GNU:diff.exe -a " . opt . v:fname_in . " " . v:fname_new .
+ \ " > " . v:fname_out
+ endfunction
+ endif
+
+You can now use vim in diff-mode, e.g. to compare two files in read-only
+mode: >
+
+ $ VIM -D/R <FILE1> <FILE2>
+
+You can also define new symbols for vimdiff, e.g.: >
+
+ $ VIMDIFF :== 'VIM' -D/R
+ $ GVIMDIFF :== 'GVIM' -D/R
+
+You can now compare files in 4 ways: >
+
+ 1. VMS diff: $ DIFF <FILE1> <FILE2>
+ 2. GNU diff: $ GDIFF <FILE1> <FILE2>
+ 3. VIM diff: $ VIMDIFF <FILE1> <FILE2>
+ 4. GVIM diff: $ GVIMDIFF <FILE1> <FILE2>
+
+( Coen Engelbarts, Vim 6.1)
+
+
+8.13 Allow '$' in C keywords
+
+DEC C uses many identifiers with '$' in them. This is not allowed in ANSI C,
+and vim recognises the '$' as the end of the identifier. You can change this
+with the |iskeyword|command.
+Add this command to your .vimrc file: >
+
+ autocmd FileType c,cpp,cs set iskeyword+=$
+
+You can also create the file(s) $VIM/FTPLUGIN/C.VIM (and/or CPP.VIM and
+CS.VIM) and add this command: >
+
+ set iskeyword+=$
+
+Now word-based commands, e.g. the '*'-search-command and the CTRL-]
+tag-lookup, work on the whole identifier. (Ctags on VMS also supports '$' in
+C keywords since ctags version 5.1.)
+
+( Coen Engelbarts, Vim 6.1)
+
+8.14 VIMTUTOR for beginners
+
+It exits VIMTUTOR.COM DCL script that can help Vim beginners to learn/make
+first steps with Vim on OpenVMS. Depending of binary distribution you may start
+it with: >
+
+ @vim:vimtutor
+
+(Thomas.R.Wyant III, Vim 6.1)
+
+==============================================================================
+
+9. VMS related changes *vms-changes*
+
+Version 6.3 (2004 May 10)
+- Improved vms_read function
+- CTAGS v5.5.4 included
+- Documentation corrected and updated
+
+Version 6.2 (2003 May 7)
+- Corrected VMS system call results
+- Low level character input is rewritten
+- Correction in tag and quickfix handling
+- First GTK build
+- Make file changes
+ - GTK feature added
+ - Define for OLD_VMS
+ - OpenVMS version 6.2 or older
+- Documentation updated with GTK features
+- CTAGS v5.5 included
+- VMS VIM tutor created
+
+Version 6.1 (2002 Mar 25)
+- TCL init_tcl() problem fixed
+- CTAGS v5.4 included
+- GNU tools binaries for OpenVMS
+- Make file changes
+ - PERL, PYTHON and TCL support improved
+ - InstallVMS.txt has a detailed description HOWTO build
+- VMS/Unix file handling rewritten
+- Minor casting and bug fixes
+
+Version 6.0 (2001 Sep 28)
+- Unix and VMS code has been merged
+ - separated "really" VMS related code
+ - included all possible Unix functionality
+ - simplified or deleted the configuration files
+ - makefile MAKE_VMS.MMS reviewed
+- menu changes (fixed printing, CTAGS and XXD usage)
+- fixed variable RMS record format handling anomaly
+- corrected syntax, ftplugin etc files load
+- changed expand_wildcards and expandpath functions to work more general
+- created OS_VMS_FILTER.COM - DECC->VAXC pre-processor directive convert
+ script.
+- Improved code's VAXC and new DECC compilers compatibility
+- changed quickfix parameters:
+ - errormessage format to suite DECC
+ - search, make and other commands to suite VMS system
+- updated and renamed MMS make files for Vim and CTAGS.
+- CTAGS has been removed from source distribution of Vim but it will remain
+ in OpenVMS binary distributions.
+- simplified build/configuration procedure
+- created INSTALLvms.txt - detailed compiling instructions under VMS.
+- updated test scripts.
+
+Version 5.8 (2001 Jun 1)
+- OS_VMS.TXT updated with new features.
+- other minor fixes.
+- documentation updated
+- this version had been tested much more than any other OpenVMS version
+ earlier
+
+Version 5.7 (2000 Jun 24)
+- New CTAGS v5.0 in distribution
+- Documentation updated
+
+Version 5.6 (2000 Jan 17)
+- VMS filename related changes:
+ - version handling (open everything, save to new version)
+ - correct file extension matching for syntax (version problem)
+ - handle <,> characters and passwords in directory definition
+ - handle internode/remote invocation and editing with passwords
+ - OpenVMS files will be treated case insensitive from now
+ - corrected response of expand("%:.") etc path related functions
+ (in one word: VMS directory handling internally)
+- version command
+ - corrected (+,-) information data
+ - added compiler and OS version
+ - added user and host information
+ - resolving $VIM and $VIMRUNTIME logicals
+- VMS port is in MAX_FEAT (maximum features) club with Unix, Win32 and OS/2.
+ - enabled farsi, rightleft etc. features
+ - undo level raised up to 1000
+- Updated OS_VMS.MMS file.
+ - maximum features ON is default
+ - Vim is compilable with +perl, +python and +tcl features.
+ - improved MMK compatibility
+- Created MAKEFILE_VMS.MMS, makefile for testing Vim during development.
+- Defined DEC terminal VT320
+ - compatibility for VT3*0, VT2*0 and VT1*0 - ANSI terminals
+ backwards, but not VT340 and newer with colour capability.
+ - VT320 is default terminal for OpenVMS
+ - these new terminals are also fast ttys (default for OpenVMS).
+ - allowed dec_mouse ttym
+- Updated files vimrc and gvimrc with VMS specific suggestions.
+- OS_VMS.TXT updated with new features.
+
+Version 5.5 (1999 Dec 3)
+- Popup menu line crash corrected.
+- Handle full file names with version numbers.
+- Directory handling (CD command etc.)
+- Corrected file name conversion VMS to Unix and v.v.
+- Correct response of expand wildcards
+- Recovery is working from this version under VMS as well.
+- Improved terminal and signal handing.
+- Improved OS_VMS.TXT
+
+Version 5.4 (1999 Sep 9)
+- Cut and paste mismatch corrected.
+- Motif directories during open and save are corrected.
+
+Version 5.3 (1998 Oct 12)
+- Minor changes in the code
+- Standard distribution with +GUI option
+
+Version 5.1 (1998 Apr 21)
+- Syntax and DEC C changes in the code
+- Fixing problems with the /doc subdirectory
+- Improve OS_VMS.MMS
+
+Version 4.5 (1996 Dec 16)
+- First VMS port by Henk Elbers <henk@xs4all.nl>
+
+==============================================================================
+
+10. Authors *vms-authors*
+
+OpenVMS documentation and executables are maintained by:
+Zoltan Arpadffy <arpadffy@polarhome.com>
+
+This document uses parts and remarks from earlier authors and contributors
+of OS_VMS.TXT:
+ Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
+ Bruce Hunsaker <BNHunsaker@chq.byu.edu>
+ Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
new file mode 100644
index 000000000..29d7096bf
--- /dev/null
+++ b/runtime/doc/os_win32.txt
@@ -0,0 +1,319 @@
+*os_win32.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by George Reilly
+
+
+ *win32* *Win32* *MS-Windows*
+This file documents the idiosyncrasies of the Win32 version of Vim.
+
+The Win32 version of Vim works on both Windows NT and Windows 95. There are
+both console and GUI versions. There is GUI version for use in the Win32s
+subsystem in Windows 3.1[1]. You can also use the 32-bit DOS version of Vim
+instead. See |os_msdos.txt|.
+
+1. Known problems |win32-problems|
+2. Startup |win32-startup|
+3. Restore screen contents |win32-restore|
+4. Using the mouse |win32-mouse|
+5. Running under Windows 3.1 |win32-win3.1|
+6. Win32 mini FAQ |win32-faq|
+
+Additionally, there are a number of common Win32 and DOS items:
+File locations |dos-locations|
+Using backslashes |dos-backslash|
+Standard mappings |dos-standard-mappings|
+Screen output and colors |dos-colors|
+File formats |dos-file-formats|
+:cd command |dos-:cd|
+Interrupting |dos-CTRL-Break|
+Temp files |dos-temp-files|
+Shell option default |dos-shell|
+
+Win32 GUI |gui-w32|
+
+Credits:
+The Win32 version was written by George V. Reilly <george@reilly.org>.
+The original Windows NT port was done by Roger Knobbe <RogerK@wonderware.com>.
+The GUI version was made by George V. Reilly and Robert Webb.
+
+For compiling see "src/INSTALL.pc". *win32-compiling*
+
+==============================================================================
+1. Known problems *windows95* *win32-problems*
+
+There are a few known problems with running in a console on Windows 95. As
+far as we know, this is the same in Windows 98 and Windows ME.
+
+Comments from somebody working at Microsoft: "Win95 console support has always
+been and will always be flaky".
+1. Dead key support doesn't work.
+2. Resizing the window with ":set columns=nn lines=nn" works, but executing
+ external commands MAY CAUSE THE SYSTEM TO HANG OR CRASH.
+3. Screen updating is slow, unless you change 'columns' or 'lines' to a
+ non-DOS value. But then the second problem applies!
+
+If this bothers you, use the 32 bit MS-DOS version or the Win32 GUI version.
+
+When doing file name completion, Vim also finds matches for the short file
+name. But Vim will still find and use the corresponding long file name. For
+example, if you have the long file name "this_is_a_test" with the short file
+name "this_i~1", the command ":e *1" will start editing "this_is_a_test".
+
+==============================================================================
+2. Startup *win32-startup*
+
+Current directory *win32-curdir*
+
+If Vim is started with a single file name argument, and it has a full path
+(starts with "x:\"), Vim assumes it was started from the file explorer and
+will set the current directory to where that file is. To avoid this when
+typing a command to start Vim, use a forward slash instead of a backslash.
+Example: >
+
+ vim c:\text\files\foo.txt
+
+Will change to the "C:\text\files" directory. >
+
+ vim c:/text\files\foo.txt
+
+Will use the current directory.
+
+
+Term option *win32-term*
+
+The only kind of terminal type that the Win32 version of Vim understands is
+"win32", which is built-in. If you set 'term' to anything else, you will
+probably get very strange behavior from Vim. Therefore Vim does not obtain
+the default value of 'term' from the environment variable "TERM".
+
+==============================================================================
+3. Restore screen contents *win32-restore*
+
+When 'restorescreen' is set (which is the default), Vim will restore the
+original contents of the console when exiting or when executing external
+commands. If you don't want this, use ":set nors". |'restorescreen'|
+
+==============================================================================
+4. Using the mouse *win32-mouse*
+
+The Win32 version of Vim supports using the mouse. If you have a two-button
+mouse, the middle button can be emulated by pressing both left and right
+buttons simultaneously - but note that in the Win32 GUI, if you have the right
+mouse button pop-up menu enabled (see 'mouse'), you should err on the side of
+pressing the left button first. |mouse-using|
+
+When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
+the console.
+
+==============================================================================
+5. Running under Windows 3.1 *win32-win3.1*
+
+ *win32s* *windows-3.1*
+There is a special version of Gvim that runs under Windows 3.1 and 3.11. You
+need the gvim.exe that was compiled with Visual C++ 4.1.
+
+To run the Win32 version under Windows 3.1, you need to install Win32s. You
+might have it already from another Win32 application which you have installed.
+If Vim doesn't seem to be running properly, get the latest version: 1.30c.
+You can find it at:
+
+ http://support.microsoft.com/download/support/mslfiles/pw1118.exe
+
+(Microsoft moved it again, we don't know where it is now :-( ).
+
+The reason for having two versions of gvim.exe is that the Win32s version was
+compiled with VC++ 4.1. This is the last version of VC++ that supports Win32s
+programs. VC++ 5.0 is better, so that one was used for the Win32 version.
+Apart from that, there is no difference between the programs. If you are in a
+mixed environment, you can use the gvim.exe for Win32s on both.
+
+The Win32s version works the same way as the Win32 version under 95/NT. When
+running under Win32s the following differences apply:
+- You cannot use long file names, because Windows 3.1 doesn't support them!
+- When executing an external command, it doesn't return an exit code. After
+ doing ":make" you have to do ":cn" yourself.
+
+==============================================================================
+6. Win32 mini FAQ *win32-faq*
+
+Q. Why does the Win32 version of Vim update the screen so slowly on Windows 95?
+A. The support for Win32 console mode applications is very buggy in Win95.
+ For some unknown reason, the screen updates very slowly when Vim is run at
+ one of the standard resolutions (80x25, 80x43, or 80x50) and the 16-bit DOS
+ version updates the screen much more quickly than the Win32 version.
+ However, if the screen is set to some other resolution, such as by ":set
+ columns=100" or ":set lines=40", screen updating becomes about as fast as
+ it is with the 16-bit version.
+
+ WARNING: Changing 'columns' may make Windows 95 crash while updating the
+ window (complaints --> Microsoft). Since this mostly works, this has not
+ been disabled, but be careful with changing 'columns'.
+
+ Changing the screen resolution makes updates faster, but it brings
+ additional problems. External commands (e.g., ":!dir") can cause Vim to
+ freeze when the screen is set to a non-standard resolution, particularly
+ when 'columns' is not equal to 80. It is not possible for Vim to reliably
+ set the screen resolution back to the value it had upon startup before
+ running external commands, so if you change the number of 'lines' or
+ 'columns', be very, very careful. In fact, Vim will not allow you to
+ execute external commands when 'columns' is not equal to 80, because it is
+ so likely to freeze up afterwards.
+
+ None of the above applies on Windows NT. Screen updates are fast, no
+ matter how many 'lines' or 'columns' the window has, and external commands
+ do not cause Vim to freeze.
+
+Q. So if the Win32 version updates the screen so slowly on Windows 95 and the
+ 16-bit DOS version updates the screen quickly, why would I want to run the
+ Win32 version?
+A. Firstly, the Win32 version isn't that slow, especially when the screen is
+ set to some non-standard number of 'lines' or 'columns'. Secondly, the
+ 16-bit DOS version has some severe limitations: It can't do big changes and
+ it doesn't know about long file names. The Win32 version doesn't have these
+ limitations and it's faster overall (the same is true for the 32-bit DJGPP
+ DOS version of Vim). The Win32 version is smarter about handling the
+ screen, the mouse, and the keyboard than the DJGPP version is.
+
+Q. And what about the 16-bit DOS version versus the Win32 version on NT?
+A. There are no good reasons to run the 16-bit DOS version on NT. The Win32
+ version updates the screen just as fast as the 16-bit version does when
+ running on NT. All of the above disadvantages apply. Finally, DOS
+ applications can take a long time to start up and will run more slowly. On
+ non-Intel NT platforms, the DOS version is almost unusably slow, because it
+ runs on top of an 80x86 emulator.
+
+Q. How do I change the font?
+A. In the GUI version, you can use the 'guifont' option.
+ In the console version, you need to set the font of the console itself.
+ You cannot do this from within Vim.
+
+Q. When I change the size of the console window with ':set lines=xx' or
+ similar, the font changes! (Win95)
+A. You have the console font set to 'Auto' in Vim's (or your MS-DOS prompt's)
+ properties. This makes W95 guess (badly!) what font is best. Set an explicit
+ font instead.
+
+Q. Why can't I paste into Vim when running Windows 95?
+A. In the properties dialog box for the MS-DOS window, go to "MS-DOS
+ Prompt/Misc/Fast pasting" and make sure that it is NOT checked. You should
+ also do ":set paste" in Vim to avoid unexpected effects. |'paste'|
+
+Q. How do I type dead keys on Windows 95, in the console version?
+ (A dead key is an accent key, such as acute, grave, or umlaut, that doesn't
+ produce a character by itself, but when followed by another key, produces
+ an accented character, such as a-acute, e-grave, u-umlaut, n-tilde, and so
+ on. Very useful for most European languages. English-language keyboard
+ layouts don't use dead keys, as far as we know.)
+A. You don't. The console mode input routines simply do not work correctly in
+ Windows 95, and I have not been able to work around them. In the words
+ of a senior developer at Microsoft:
+ Win95 console support has always been and will always be flaky.
+
+ The flakiness is unavoidable because we are stuck between the world of
+ MS-DOS keyboard TSRs like KEYB (which wants to cook the data;
+ important for international) and the world of Win32.
+
+ So keys that don't "exist" in MS-DOS land (like dead keys) have a
+ very tenuous existence in Win32 console land. Keys that act
+ differently between MS-DOS land and Win32 console land (like
+ capslock) will act flaky.
+
+ Don't even _mention_ the problems with multiple language keyboard
+ layouts...
+
+ You may be able to fashion some sort of workaround with the digraphs
+ mechanism. |digraphs|
+
+ The best solution is to use the Win32 GUI version gvim.exe. Alternatively,
+ you can try one of the DOS versions of Vim where dead keys reportedly do
+ work.
+
+Q. How do I type dead keys on Windows NT?
+A. Dead keys work on NT 3.51. Just type them as you would in any other
+ application.
+ On NT 4.0, you need to make sure that the default locale (set in the
+ Keyboard part of the Control Panel) is the same as the currently active
+ locale. Otherwise the NT code will get confused and crash! This is a NT
+ 4.0 problem, not really a Vim problem.
+
+Q. I'm using Vim to edit a symbolically linked file on a Unix NFS file server.
+ When I write the file, Vim does not "write through" the symlink. Instead,
+ it deletes the symbolic link and creates a new file in its place. Why?
+A. On Unix, Vim is prepared for links (symbolic or hard). A backup copy of
+ the original file is made and then the original file is overwritten. This
+ assures that all properties of the file remain the same. On non-Unix
+ systems, the original file is renamed and a new file is written. Only the
+ protection bits are set like the original file. However, this doesn't work
+ properly when working on an NFS-mounted file system where links and other
+ things exist. The only way to fix this in the current version is not
+ making a backup file, by ":set nobackup nowritebackup" |'writebackup'|
+
+Q. How do I get to see the output of ":make" while it's running?
+A. Basically what you need is to put a tee program that will copy its input
+ (the output from make) to both stdout and to the errorfile. You can find a
+ copy of tee (and a number of other GNU tools tools) at
+ http://gnuwin32.sourceforge.net or http://unxutils.sourceforge.net
+ Alternatively, try the more recent Cygnus version of the GNU tools at
+ http://www.cygwin.com Other Unix-style tools for Win32 are listed at
+ http://directory.google.com/Top/Computers/Software/Operating_Systems/Unix/Win32/
+ When you do get a copy of tee, you'll need to add >
+ :set shellpipe=\|\ tee
+< to your _vimrc.
+
+Q. I'm storing files on a remote machine that works with VisionFS, and files
+ disappear!
+A. VisionFS can't handle certain dot (.) three letter extension file names.
+ SCO declares this behavior required for backwards compatibility with 16bit
+ DOS/Windows environments. The two commands below demonstrate the behavior:
+>
+ echo Hello > file.bat~
+ dir > file.bat
+<
+ The result is that the "dir" command updates the "file.bat~" file, instead
+ of creating a new "file.bat" file. This same behavior is exhibited in Vim
+ when editing an existing file named "foo.bat" because the default behavior
+ of Vim is to create a temporary file with a '~' character appended to the
+ name. When the file is written, it winds up being deleted.
+
+ Solution: Add this command to your _vimrc file: >
+ :set backupext=.temporary
+
+Q. How do I change the blink rate of the cursor?
+A. You can't! This is a limitation of the NT console. NT 5.0 is reported to
+ be able to set the blink rate for all console windows at the same time.
+
+ *:!start*
+Q. How can I run an external command or program asynchronously?
+A. When using :! to run an external command, you can run it with "start": >
+ :!start winfile.exe<CR>
+< Using "start" stops Vim switching to another screen, opening a new console,
+ or waiting for the program to complete; it indicates that you are running a
+ program that does not effect the files you are editing. Programs begun
+ with :!start do not get passed Vim's open file handles, which means they do
+ not have to be closed before Vim.
+ To avoid this special treatment, use ":! start".
+
+Q. I'm using Win32s, and when I try to run an external command like "make",
+ Vim doesn't wait for it to finish! Help!
+A. The problem is that a 32-bit application (Vim) can't get notification from
+ Windows that a 16-bit application (your DOS session) has finished. Vim
+ includes a work-around for this, but you must set up your DOS commands to
+ run in a window, not full-screen. Unfortunately the default when you
+ install Windows is full-screen. To change this:
+ 1) Start PIF editor (in the Main program group)
+ 2) Open the file "_DEFAULT.PIF" in your Windows directory.
+ 3) Changes the display option from "Full Screen" to "Windowed".
+ 4) Save and exit.
+
+ To test, start Vim and type >
+ :!dir C:\<CR>".
+< You should see a DOS box window appear briefly with the directory listing.
+
+Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
+ 50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in
+ W3.1x, or am I stuck with 80x25?
+A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
+ prompts and external DOS commands will now run in a 50-line window.
+
+ vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
new file mode 100644
index 000000000..caa5a00d7
--- /dev/null
+++ b/runtime/doc/pattern.txt
@@ -0,0 +1,1146 @@
+*pattern.txt* For Vim version 7.0aa. Last change: 2004 May 09
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Patterns and search commands *pattern-searches*
+
+The very basics can be found in section |03.9| of the user manual. A few more
+explanations are in chapter 27 |usr_27.txt|.
+
+1. Search commands |search-commands|
+2. The definition of a pattern |search-pattern|
+3. Magic |/magic|
+4. Overview of pattern items |pattern-overview|
+5. Multi items |pattern-multi-items|
+6. Ordinary atoms |pattern-atoms|
+7. Ignoring case in a pattern |/ignorecase|
+8. Compare with Perl patterns |perl-patterns|
+9. Highlighting matches |match-highlight|
+
+==============================================================================
+1. Search commands *search-commands* *E486*
+
+ */*
+/{pattern}[/]<CR> Search forward for the [count]'th occurrence of
+ {pattern} |exclusive|.
+
+/{pattern}/{offset}<CR> Search forward for the [count]'th occurrence of
+ {pattern} and go |{offset}| lines up or down.
+ |linewise|.
+
+ */<CR>*
+/<CR> Search forward for the [count]'th latest used
+ pattern |last-pattern| with latest used |{offset}|.
+
+//{offset}<CR> Search forward for the [count]'th latest used
+ pattern |last-pattern| with new |{offset}|. If
+ {offset} is empty no offset is used.
+
+ *?*
+?{pattern}[?]<CR> Search backward for the [count]'th previous
+ occurrence of {pattern} |exclusive|.
+
+?{pattern}?{offset}<CR> Search backward for the [count]'th previous
+ occurrence of {pattern} and go |{offset}| lines up or
+ down |linewise|.
+
+ *?<CR>*
+?<CR> Search backward for the [count]'th latest used
+ pattern |last-pattern| with latest used |{offset}|.
+
+??{offset}<CR> Search backward for the [count]'th latest used
+ pattern |last-pattern| with new |{offset}|. If
+ {offset} is empty no offset is used.
+
+ *n*
+n Repeat the latest "/" or "?" [count] times.
+ |last-pattern| {Vi: no count}
+
+ *N*
+N Repeat the latest "/" or "?" [count] times in
+ opposite direction. |last-pattern| {Vi: no count}
+
+ *star* *E348* *E349*
+* Search forward for the [count]'th occurrence of the
+ word nearest to the cursor. The word used for the
+ search is the first of:
+ 1. the keyword under the cursor |'iskeyword'|
+ 2. the first keyword after the cursor, in the
+ current line
+ 3. the non-blank word under the cursor
+ 4. the first non-blank word after the cursor,
+ in the current line
+ Only whole keywords are searched for, like with the
+ command "/\<keyword\>". |exclusive| {not in Vi}
+ 'ignorecase' is used, 'smartcase' is not.
+
+ *#*
+# Same as "*", but search backward. The pound sign
+ (character 163) also works. If the "#" key works as
+ backspace, try using "stty erase <BS>" before starting
+ Vim (<BS> is CTRL-H or a real backspace). {not in Vi}
+
+ *gstar*
+g* Like "*", but don't put "\<" and "\>" around the word.
+ This makes the search also find matches that are not a
+ whole word. {not in Vi}
+
+ *g#*
+g# Like "#", but don't put "\<" and "\>" around the word.
+ This makes the search also find matches that are not a
+ whole word. {not in Vi}
+
+ *gd*
+gd Goto local Declaration. When the cursor is on a local
+ variable, this command will jump to its declaration.
+ First Vim searches for the start of the current
+ function, just like "[[". If it is not found the
+ search stops in line 1. If it is found, Vim goes back
+ until a blank line is found. From this position Vim
+ searches for the keyword under the cursor, like with
+ "*", but lines that look like a comment are ignored
+ (see 'comments' option).
+ Note that this is not guaranteed to work, Vim does not
+ really check the syntax, it only searches for a match
+ with the keyword. If included files also need to be
+ searched use the commands listed in |include-search|.
+ After this command |n| searches forward for the next
+ match (not backward).
+ {not in Vi}
+
+ *gD*
+gD Goto global Declaration. When the cursor is on a
+ global variable that is defined in the file, this
+ command will jump to its declaration. This works just
+ like "gd", except that the search for the keyword
+ always starts in line 1. {not in Vi}
+
+ *CTRL-C*
+CTRL-C Interrupt current (search) command. Use CTRL-Break on
+ MS-DOS |dos-CTRL-Break|.
+ In Normal mode, any pending command is aborted.
+
+ *:noh* *:nohlsearch*
+:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It
+ is automatically turned back on when using a search
+ command, or setting the 'hlsearch' option.
+ This command doesn't work in an autocommand, because
+ the highlighting state is saved and restored when
+ executing autocommands |autocmd-searchpat|.
+
+While typing the search pattern the current match will be shown if the
+'incsearch' option is on. Remember that you still have to finish the search
+command with <CR> to actually position the cursor at the displayed match. Or
+use <Esc> to abandon the search.
+
+All matches for the last used search pattern will be highlighted if you set
+the 'hlsearch' option. This can be suspended with the |:nohlsearch| command.
+
+ *search-offset* *{offset}*
+These commands search for the specified pattern. With "/" and "?" an
+additional offset may be given. There are two types of offsets: line offsets
+and character offsets. {the character offsets are not in Vi}
+
+The offset gives the cursor position relative to the found match:
+ [num] [num] lines downwards, in column 1
+ +[num] [num] lines downwards, in column 1
+ -[num] [num] lines upwards, in column 1
+ e[+num] [num] characters to the right of the end of the match
+ e[-num] [num] characters to the left of the end of the match
+ s[+num] [num] characters to the right of the start of the match
+ s[-num] [num] characters to the left of the start of the match
+ b[+num] [num] identical to s[+num] above (mnemonic: begin)
+ b[-num] [num] identical to s[-num] above (mnemonic: begin)
+
+If a '-' or '+' is given but [num] is omitted, a count of one will be used.
+When including an offset with 'e', the search becomes inclusive (the
+character the cursor lands on is included in operations).
+
+Examples:
+
+pattern cursor position ~
+/test/+1 one line below "test", in column 1
+/test/e on the last t of "test"
+/test/s+2 on the 's' of "test"
+/test/b-3 three characters before "test"
+
+If one of these commands is used after an operator, the characters between
+the cursor position before and after the search is affected. However, if a
+line offset is given, the whole lines between the two cursor positions are
+affected.
+
+An example of how to search for matches with a pattern and change the match
+with another word: >
+ /foo<CR> find "foo"
+ c//e change until end of match
+ bar<Esc> type replacement
+ //<CR> go to start of next match
+ c//e change until end of match
+ beep<Esc> type another replacement
+ etc.
+<
+ *//;* *E386*
+A very special offset is ';' followed by another search command. For example: >
+
+ /test 1/;/test
+ /test.*/+1;?ing?
+
+The first one first finds the next occurrence of "test 1", and then the first
+occurrence of "test" after that.
+
+This is like executing two search commands after each other, except that:
+- It can be used as a single motion command after an operator.
+- The direction for a following "n" or "N" command comes from the first
+ search command.
+- When an error occurs the cursor is not moved at all.
+
+ *last-pattern*
+The last used pattern and offset are remembered. They can be used to repeat
+the search, possibly in another direction or with another count. Note that
+two patterns are remembered: One for 'normal' search commands and one for the
+substitute command ":s". Each time an empty pattern is given, the previously
+used pattern is used.
+
+The 'magic' option sticks with the last used pattern. If you change 'magic',
+this will not change how the last used pattern will be interpreted.
+The 'ignorecase' option does not do this. When 'ignorecase' is changed, it
+will result in the pattern to match other text.
+
+All matches for the last used search pattern will be highlighted if you set
+the 'hlsearch' option.
+
+To clear the last used search pattern: >
+ :let @/ = ""
+This will not set the pattern to an empty string, because that would match
+everywhere. The pattern is really cleared, like when starting Vim.
+
+The search usual skips matches that don't move the cursor. Whether the next
+match is found at the next character or after the skipped match depends on the
+'c' flag in 'cpoptions'. See |cpo-c|.
+ with 'c' flag: "/..." advances 1 to 3 characters
+ without 'c' flag: "/..." advances 1 character
+The unpredictability with the 'c' flag is caused by starting the search in the
+first column, skipping matches until one is found past the cursor position.
+
+In Vi the ":tag" command sets the last search pattern when the tag is searched
+for. In Vim this is not done, the previous search pattern is still remembered,
+unless the 't' flag is present in 'cpoptions'. The search pattern is always
+put in the search history.
+
+If the 'wrapscan' option is on (which is the default), searches wrap around
+the end of the buffer. If 'wrapscan' is not set, the backward search stops
+at the beginning and the forward search stops at the end of the buffer. If
+'wrapscan' is set and the pattern was not found the error message "pattern
+not found" is given, and the cursor will not be moved. If 'wrapscan' is not
+set the message becomes "search hit BOTTOM without match" when searching
+forward, or "search hit TOP without match" when searching backward. If
+wrapscan is set and the search wraps around the end of the file the message
+"search hit TOP, continuing at BOTTOM" or "search hit BOTTOM, continuing at
+TOP" is given when searching backwards or forwards respectively. This can be
+switched off by setting the 's' flag in the 'shortmess' option. The highlight
+method 'w' is used for this message (default: standout).
+
+ *search-range*
+You cannot limit the search command "/" to a certain range of lines. A trick
+to do this anyway is to use the ":substitute" command with the 'c' flag.
+Example: >
+ :.,300s/Pattern//gc
+This command will search from the cursor position until line 300 for
+"Pattern". At the match, you will be asked to type a character. Type 'q' to
+stop at this match, type 'n' to find the next match.
+
+The "*", "#", "g*" and "g#" commands look for a word near the cursor in this
+order, the first one that is found is used:
+- The keyword currently under the cursor.
+- The first keyword to the right of the cursor, in the same line.
+- The WORD currently under the cursor.
+- The first WORD to the right of the cursor, in the same line.
+The keyword may only contain letters and characters in 'iskeyword'.
+The WORD may contain any non-blanks (<Tab>s and/or <Space>s).
+Note that if you type with ten fingers, the characters are easy to remember:
+the "#" is under your left hand middle finger (search to the left and up) and
+the "*" is under your right hand middle finger (search to the right and down).
+(this depends on your keyboard layout though).
+
+==============================================================================
+2. The definition of a pattern *search-pattern* *pattern* *[pattern]*
+ *regular-expression* *regexp* *Pattern*
+ *E76* *E361* *E363* *E383* *E476*
+
+For starters, read chapter 27 of the user manual |usr_27.txt|.
+
+ */bar* */\bar* */pattern*
+1. A pattern is one or more branches, separated by "\|". It matches anything
+ that matches one of the branches. Example: "foo\|beep" matches "foo" and
+ matches "beep". If more than one branch matches, the first one is used.
+
+ pattern ::= branch
+ or branch \| branch
+ or branch \| branch \| branch
+ etc.
+
+ */branch* */\&*
+2. A branch is one or more concats, separated by "\&". It matches the last
+ concat, but only if all the preceding concats also match at the same
+ position. Examples:
+ "foobeep\&..." matches "foo" in "foobeep".
+ ".*Peter\&.*Bob" matches in a line containing both "Peter" and "Bob"
+
+ branch ::= concat
+ or concat \& concat
+ or concat \& concat \& concat
+ etc.
+
+ */concat*
+3. A concat is one or more pieces, concatenated. It matches a match for the
+ first piece, followed by a match for the second piece, etc. Example:
+ "f[0-9]b", first matches "f", then a digit and then "b".
+
+ concat ::= piece
+ or piece piece
+ or piece piece piece
+ etc.
+
+ */piece*
+4. A piece is an atom, possibly followed by a multi, an indication of how many
+ times the atom can be matched. Example: "a*" matches any sequence of "a"
+ characters: "", "a", "aa", etc. See |/multi|.
+
+ piece ::= atom
+ or atom multi
+
+ */atom*
+5. An atom can be one of a long list of items. Many atoms match one character
+ in the text. It is often an ordinary character or a character class.
+ Braces can be used to make a pattern into an atom. The "\z(\)" construct
+ is only for syntax highlighting.
+
+ atom ::= ordinary-atom |/ordinary-atom|
+ or \( pattern \) |/\(|
+ or \%( pattern \) |/\%(|
+ or \z( pattern \) |/\z(|
+
+
+==============================================================================
+4. Overview of pattern items *pattern-overview*
+
+Overview of multi items. */multi* *E61* *E62*
+More explanation and examples below, follow the links. *E64*
+
+ multi ~
+ 'magic' 'nomagic' matches of the preceding atom ~
+|/star| * \* 0 or more as many as possible
+|/\+| \+ \+ 1 or more as many as possible (*)
+|/\=| \= \= 0 or 1 as many as possible (*)
+|/\?| \? \? 0 or 1 as many as possible (*)
+
+|/\{| \{n,m} \{n,m} n to m as many as possible (*)
+ \{n} \{n} n exactly (*)
+ \{n,} \{n,} at least n as many as possible (*)
+ \{,m} \{,m} 0 to m as many as possible (*)
+ \{} \{} 0 or more as many as possible (same as *) (*)
+
+|/\{-| \{-n,m} \{-n,m} n to m as few as possible (*)
+ \{-n} \{-n} n exactly (*)
+ \{-n,} \{-n,} at least n as few as possible (*)
+ \{-,m} \{-,m} 0 to m as few as possible (*)
+ \{-} \{-} 0 or more as few as possible (*)
+
+ *E59*
+|/\@>| \@> \@> 1, like matching a whole pattern (*)
+|/\@=| \@= \@= nothing, requires a match |/zero-width| (*)
+|/\@!| \@! \@! nothing, requires NO match |/zero-width| (*)
+|/\@<=| \@<= \@<= nothing, requires a match behind |/zero-width| (*)
+|/\@<!| \@<! \@<! nothing, requires NO match behind |/zero-width| (*)
+
+(*) {not in Vi}
+
+
+Overview of ordinary atoms. */ordinary-atom*
+More explanation and examples below, follow the links.
+
+ ordinary atom ~
+ magic nomagic matches ~
+|/^| ^ ^ start-of-line (at start of pattern) |/zero-width|
+|/\^| \^ \^ literal '^'
+|/\_^| \_^ \_^ start-of-line (used anywhere) |/zero-width|
+|/$| $ $ end-of-line (at end of pattern) |/zero-width|
+|/\$| \$ \$ literal '$'
+|/\_$| \_$ \_$ end-of-line (used anywhere) |/zero-width|
+|/.| . \. any single character (not an end-of-line)
+|/\_.| \_. \_. any single character or end-of-line
+|/\<| \< \< beginning of a word |/zero-width|
+|/\>| \> \> end of a word |/zero-width|
+|/\zs| \zs \zs anything, sets start of match
+|/\ze| \ze \ze anything, sets end of match
+|/\%^| \%^ \%^ beginning of file |/zero-width| *E71*
+|/\%$| \%$ \%$ end of file |/zero-width|
+|/\%#| \%# \%# cursor position |/zero-width|
+|/\%l| \%23l \%23l in line 23 |/zero-width|
+|/\%c| \%23c \%23c in column 23 |/zero-width|
+|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
+
+Character classes {not in Vi}:
+|/\i| \i \i identifier character (see 'isident' option)
+|/\I| \I \I like "\i", but excluding digits
+|/\k| \k \k keyword character (see 'iskeyword' option)
+|/\K| \K \K like "\k", but excluding digits
+|/\f| \f \f file name character (see 'isfname' option)
+|/\F| \F \F like "\f", but excluding digits
+|/\p| \p \p printable character (see 'isprint' option)
+|/\P| \P \P like "\p", but excluding digits
+|/\s| \s \s whitespace character: <Space> and <Tab>
+|/\S| \S \S non-whitespace character; opposite of \s
+|/\d| \d \d digit: [0-9]
+|/\D| \D \D non-digit: [^0-9]
+|/\x| \x \x hex digit: [0-9A-Fa-f]
+|/\X| \X \X non-hex digit: [^0-9A-Fa-f]
+|/\o| \o \o octal digit: [0-7]
+|/\O| \O \O non-octal digit: [^0-7]
+|/\w| \w \w word character: [0-9A-Za-z_]
+|/\W| \W \W non-word character: [^0-9A-Za-z_]
+|/\h| \h \h head of word character: [A-Za-z_]
+|/\H| \H \H non-head of word character: [^A-Za-z_]
+|/\a| \a \a alphabetic character: [A-Za-z]
+|/\A| \A \A non-alphabetic character: [^A-Za-z]
+|/\l| \l \l lowercase character: [a-z]
+|/\L| \L \L non-lowercase character: [^a-z]
+|/\u| \u \u uppercase character: [A-Z]
+|/\U| \U \U non-uppercase character [^A-Z]
+|/\_| \_x \_x where x is any of the characters above: character
+ class with end-of-line included
+(end of character classes)
+
+|/\e| \e \e <Esc>
+|/\t| \t \t <Tab>
+|/\r| \r \r <CR>
+|/\b| \b \b <BS>
+|/\n| \n \n end-of-line
+|/~| ~ \~ last given substitute string
+|/\1| \1 \1 same string as matched by first \(\) {not in Vi}
+|/\2| \2 \2 Like "\1", but uses second \(\)
+ ...
+|/\9| \9 \9 Like "\1", but uses ninth \(\)
+ *E68*
+|/\z1| \z1 \z1 only for syntax highlighting, see |:syn-ext-match|
+ ...
+|/\z1| \z9 \z9 only for syntax highlighting, see |:syn-ext-match|
+
+ x x a character with no special meaning matches itself
+
+|/[]| [] \[] any character specified inside the []
+|/\%[]| \%[] \%[] a list of optionally matched atoms
+
+|/\c| \c \c ignore case
+|/\C| \C \C match case
+|/\m| \m \m 'magic' on for the following chars in the pattern
+|/\M| \M \M 'magic' off for the following chars in the pattern
+|/\v| \v \v the following chars in the pattern are "very magic"
+|/\V| \V \V the following chars in the pattern are "very nomagic"
+|/\Z| \Z \Z ignore differences in Unicode "combining characters".
+ Useful when searching voweled Hebrew or Arabic text.
+
+
+Example matches ~
+\<\I\i* or
+\<\h\w*
+\<[a-zA-Z_][a-zA-Z0-9_]*
+ An identifier (e.g., in a C program).
+
+\(\.$\|\. \) A period followed by <EOL> or a space.
+
+[.!?][])"']*\($\|[ ]\) A search pattern that finds the end of a sentence,
+ with almost the same definition as the ")" command.
+
+cat\Z Both "cat" and "càt" ("a" followed by 0x0300)
+ Does not match "càt" (character 0x00e0), even
+ though it may look the same.
+
+
+==============================================================================
+3. Magic */magic*
+
+Some characters in the pattern are taken literally. They match with the same
+character in the text. When preceded with a backslash however, these
+characters get a special meaning.
+
+Other characters have a special meaning without a backslash. They need to be
+preceded with a backslash to match literally.
+
+If a character is taken literally or not depends on the 'magic' option and the
+items mentioned next.
+ */\m* */\M*
+Use of "\m" makes the pattern after it be interpreted as if 'magic' is set,
+ignoring the actual value of the 'magic' option.
+Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
+ */\v* */\V*
+Use of "\v" means that in the pattern after it all ASCII characters except
+'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic"
+
+Use of "\V" means that in the pattern after it only the backslash has a
+special meaning. "very nomagic"
+
+Examples:
+after: \v \m \M \V matches ~
+ 'magic' 'nomagic'
+ $ $ $ \$ matches end-of-line
+ . . \. \. matches any character
+ * * \* \* any number of the previous atom
+ () \(\) \(\) \(\) grouping into an atom
+ | \| \| \| separating alternatives
+ \a \a \a \a alphabetic character
+ \\ \\ \\ \\ literal backslash
+ \. \. . . literal dot
+ \{ { { { literal '{'
+ a a a a literal 'a'
+
+{only Vim supports \m, \M, \v and \V}
+
+It is recommended to always keep the 'magic' option at the default setting,
+which is 'magic'. This avoids portability problems. To make a pattern immune
+to the 'magic' option being set or not, put "\m" or "\M" at the start of the
+pattern.
+
+
+==============================================================================
+5. Multi items *pattern-multi-items*
+
+An atom can be followed by an indication of how many times the atom can be
+matched and in what way. This is called a multi. See |/multi| for an
+overview.
+
+It is not possible to use a multi that can match more than one time after an
+atom that can match an empty string. That's because this could result in an
+endless loop. If you try it, you will get this error message: >
+ *, \+ or \{ operand could be empty
+<
+ */star* */\star* *E56*
+* (use \* when 'magic' is not set)
+ Matches 0 or more of the preceding atom, as many as possible.
+ Example 'nomagic' matches ~
+ a* a\* "", "a", "aa", "aaa", etc.
+ .* \.\* anything, also an empty string, no end-of-line
+ \_.* \_.\* everything up to the end of the buffer
+ \_.*END \_.\*END everything up to and including the last "END"
+ in the buffer
+
+ Exception: When "*" is used at the start of the pattern or just after
+ "^" it matches the star character.
+
+ Be aware that repeating "\_." can match a lot of text and take a long
+ time. For example, "\_.*END" matches all text from the current
+ position to the last occurrence of "END" in the file. Since the "*"
+ will match as many as possible, this first skips over all lines until
+ the end of the file and then tries matching "END", backing up one
+ character at a time.
+
+ */\+* *E57*
+\+ Matches 1 or more of the preceding atom, as many as possible. {not in
+ Vi}
+ Example matches ~
+ ^.\+$ any non-empty line
+ \s\+ white space of at least one character
+
+ */\=*
+\= Matches 0 or 1 of the preceding atom, as many as possible. {not in Vi}
+ Example matches ~
+ foo\= "fo" and "foo"
+
+ */\?*
+\? Just like \=. Cannot be used when searching backwards with the "?"
+ command. {not in Vi}
+
+ */\{* *E58* *E60* *E554*
+\{n,m} Matches n to m of the preceding atom, as many as possible
+\{n} Matches n of the preceding atom
+\{n,} Matches at least n of the preceding atom, as many as possible
+\{,m} Matches 0 to m of the preceding atom, as many as possible
+\{} Matches 0 or more of the preceding atom, as many as possible (like *)
+ */\{-*
+\{-n,m} matches n to m of the preceding atom, as few as possible
+\{-n} matches n of the preceding atom
+\{-n,} matches at least n of the preceding atom, as few as possible
+\{-,m} matches 0 to m of the preceding atom, as few as possible
+\{-} matches 0 or more of the preceding atom, as few as possible
+ {Vi does not have any of these}
+
+ n and m are positive decimal numbers
+
+ If a "-" appears immediately after the "{", then a shortest match
+ first algorithm is used (see example below). In particular, "\{-}" is
+ the same as "*" but uses the shortest match first algorithm. BUT: A
+ match that starts earlier is preferred over a shorter match: "a\{-}b"
+ matches "aaab" in "xaaab".
+
+ Example matches ~
+ ab\{2,3}c "abbc" or "abbbc"
+ a\{5} "aaaaa".
+ ab\{2,}c "abbc", "abbbc", "abbbbc", etc
+ ab\{,3}c "ac", "abc", "abbc" or "abbbc".
+ a[bc]\{3}d "abbbd", "abbcd", "acbcd", "acccd", etc.
+ a\(bc\)\{1,2}d "abcd" or "abcbcd"
+ a[bc]\{-}[cd] "abc" in "abcd"
+ a[bc]*[cd] "abcd" in "abcd"
+
+ The } may optionally be preceded with a backslash: \{n,m\}.
+
+ */\@=*
+\@= Matches the preceding atom with zero width. {not in Vi}
+ Like "(?=pattern)" in Perl.
+ Example matches ~
+ foo\(bar\)\@= "foo" in "foobar"
+ foo\(bar\)\@=foo nothing
+ */zero-width*
+ When using "\@=" (or "^", "$", "\<", "\>") no characters are included
+ in the match. These items are only used to check if a match can be
+ made. This can be tricky, because a match with following items will
+ be done in the same position. The last example above will not match
+ "foobarfoo", because it tries match "foo" in the same position where
+ "bar" matched.
+
+ Note that using "\&" works the same as using "\@=": "foo\&.." is the
+ same as "\(foo\)\@=..". But using "\&" is easier, you don't need the
+ braces.
+
+
+ */\@!*
+\@! Matches with zero width if the preceding atom does NOT match at the
+ current position. |/zero-width| {not in Vi}
+ Like '(?!pattern)" in Perl.
+ Example matches ~
+ foo\(bar\)\@! any "foo" not followed by "bar"
+ a.\{-}p\@! "a", "ap", "app", etc. not followed by a "p"
+ if \(\(then\)\@!.\)*$ "if " not followed by "then"
+
+ Using "\@!" is tricky, because there are many places where a pattern
+ does not match. "a.*p\@!" will match from an "a" to the end of the
+ line, because ".*" can match all characters in the line and the "p"
+ doesn't match at the end of the line. "a.\{-}p\@!" will match any
+ "a", "ap", "aap", etc. that isn't followed by a "p", because the "."
+ can match a "p" and "p\@!" doesn't match after that.
+
+ You can't use "\@!" to look for a non-match before the matching
+ position: "\(foo\)\@!bar" will match "bar" in "foobar", because at the
+ position where "bar" matches, "foo" does not match. To avoid matching
+ "foobar" you could use "\(foo\)\@!...bar", but that doesn't match a
+ bar at the start of a line. Use "\(foo\)\@<!bar".
+
+ */\@<=*
+\@<= Matches with zero width if the preceding atom matches just before what
+ follows. |/zero-width| {not in Vi}
+ Like '(?<=pattern)" in Perl, but Vim allows non-fixed-width patterns.
+ Example matches ~
+ \(an\_s\+\)\@<=file "file" after "an" and white space or an
+ end-of-line
+ For speed it's often much better to avoid this multi. Try using "\zs"
+ instead |/\zs|. To match the same as the above example:
+ an\_s\+\zsfile
+
+ "\@<=" and "\@<!" check for matches just before what follows.
+ Theoretically these matches could start anywhere before this position.
+ But to limit the time needed, only the line where what follows matches
+ is searched, and one line before that (if there is one). This should
+ be sufficient to match most things and not be too slow.
+ The part of the pattern after "\@<=" and "\@<!" are checked for a
+ match first, thus things like "\1" don't work to reference \(\) inside
+ the preceding atom. It does work the other way around:
+ Example matches ~
+ \1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
+
+ */\@<!*
+\@<! Matches with zero width if the preceding atom does NOT match just
+ before what follows. Thus this matches if there is no position in the
+ current or previous line where the atom matches such that it ends just
+ before what follows. |/zero-width| {not in Vi}
+ Like '(?<!pattern)" in Perl, but Vim allows non-fixed-width patterns.
+ The match with the preceding atom is made to end just before the match
+ with what follows, thus an atom that ends in ".*" will work.
+ Warning: This can be slow (because many positions need to be checked
+ for a match).
+ Example matches ~
+ \(foo\)\@<!bar any "bar" that's not in "foobar"
+ \(\/\/.*\)\@\<!in "in" which is not after "//"
+
+ */\@>*
+\@> Matches the preceding atom like matching a whole pattern. {not in Vi}
+ Like '(?>pattern)" in Perl.
+ Example matches ~
+ \(a*\)\@>a nothing (the "a*" takes all the "a"'s, there can't be
+ another one following)
+
+ This matches the preceding atom as if it was a pattern by itself. If
+ it doesn't match, there is no retry with shorter sub-matches or
+ anything. Observe this difference: "a*b" and "a*ab" both match
+ "aaab", but in the second case the "a*" matches only the first two
+ "a"s. "\(a*\)\@>ab" will not match "aaab", because the "a*" matches
+ the "aaa" (as many "a"s as possible), thus the "ab" can't match.
+
+
+==============================================================================
+6. Ordinary atoms *pattern-atoms*
+
+An ordinary atom can be:
+
+ */^*
+^ At beginning of pattern or after "\|", "\(", "\%(" or "\n": matches
+ start-of-line; at other positions, matches literal '^'. |/zero-width|
+ Example matches ~
+ ^beep( the start of the C function "beep" (probably).
+
+ */\^*
+\^ Matches literal '^'. Can be used at any position in the pattern.
+
+ */\_^*
+\_^ Matches start-of-line. |/zero-width| Can be used at any position in
+ the pattern.
+ Example matches ~
+ \_s*\_^foo white space and blank lines and then "foo" at
+ start-of-line
+
+ */$*
+$ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
+ matches end-of-line <EOL>; at other positions, matches literal '$'.
+ |/zero-width|
+
+ */\$*
+\$ Matches literal '$'. Can be used at any position in the pattern.
+
+ */\_$*
+\_$ Matches end-of-line. |/zero-width| Can be used at any position in the
+ pattern. Note that "a\_$b" never matches, since "b" cannot match an
+ end-of-line. Use "a\nb" instead |/\n|.
+ Example matches ~
+ foo\_$\_s* "foo" at end-of-line and following white space and
+ blank lines
+
+. (with 'nomagic': \.) */.* */\.*
+ Matches any single character, but not an end-of-line.
+
+ */\_.*
+\_. Matches any single character or end-of-line.
+ Careful: "\_.*" matches all text to the end of the buffer!
+
+ */\<*
+\< Matches the beginning of a word: The next char is the first char of a
+ word. The 'iskeyword' option specifies what is a word character.
+ |/zero-width|
+
+ */\>*
+\> Matches the end of a word: The previous char is the last char of a
+ word. The 'iskeyword' option specifies what is a word character.
+ |/zero-width|
+
+ */\zs*
+\zs Matches at any position, and sets the start of the match there: The
+ next char is the first char of the whole match. |/zero-width|
+ Example: >
+ /^\s*\zsif
+< matches an "if" at the start of a line, ignoring white space.
+ Can be used multiple times, the last one encountered in a matching
+ branch is used. Example: >
+ /\(.\{-}\zsFab\)\{3}
+< Finds the third occurrence of "Fab".
+ {not in Vi} {not available when compiled without the +syntax feature}
+ */\ze*
+\ze Matches at any position, and sets the end of the match there: The
+ previous char is the last char of the whole match. |/zero-width|
+ Can be used multiple times, the last one encountered in a matching
+ branch is used.
+ Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
+ "endfor".
+ {not in Vi} {not available when compiled without the +syntax feature}
+
+ */\%^* *start-of-file*
+\%^ Matches start of the file. When matching with a string, matches the
+ start of the string. {not in Vi}
+ For example, to find the first "VIM" in a file: >
+ /\%^\_.\{-}\zsVIM
+<
+ */\%$* *end-of-file*
+\%$ Matches end of the file. When matching with a string, matches the
+ end of the string. {not in Vi}
+ Note that this does NOT find the last "VIM" in a file: >
+ /VIM\_.\{-}\%$
+< It will find the next VIM, because the part after it will always
+ match. This one will find the last "VIM" in the file: >
+ /VIM\ze\(\(VIM\)\@!\_.\)*\%$
+< This uses |/\@!| to ascertain that "VIM" does NOT match in any
+ position after the first "VIM".
+ Searching from the end of the file backwards is easier!
+
+ */\%#* *cursor-position*
+\%# Matches with the cursor position. Only works when matching in a
+ buffer displayed in a window. {not in Vi}
+ WARNING: When the cursor is moved after the pattern was used, the
+ result becomes invalid. Vim doesn't automatically update the matches.
+ This is especially relevant for syntax highlighting and 'hlsearch'.
+ In other words: When the cursor moves the display isn't updated for
+ this change. An update is done for lines which are changed (the whole
+ line is updated) or when using the |CTRL-L| command (the whole screen
+ is updated). Example, to highlight the word under the cursor: >
+ /\k*\%#\k*
+< When 'hlsearch' is set and you move the cursor around and make changes
+ this will clearly show when the match is updated or not.
+
+ */\%l* */\%>l* */\%<l*
+\%23l Matches in a specific line.
+\%<23l Matches above a specific line.
+\%>23l Matches below a specific line.
+ These three can be used to match specific lines in a buffer. The "23"
+ can be any line number. The first line is 1. {not in Vi}
+ WARNING: When inserting or deleting lines Vim does not automatically
+ update the matches. This means Syntax highlighting quickly becomes
+ wrong.
+ Example, to highlight the line where the cursor currently is: >
+ :exe '/\%' . line(".") . 'l.*'
+< When 'hlsearch' is set and you move the cursor around and make changes
+ this will clearly show when the match is updated or not.
+
+ */\%c* */\%>c* */\%<c*
+\%23c Matches in a specific column.
+\%<23c Matches before a specific column.
+\%>23c Matches after a specific column.
+ These three can be used to match specific columns in a buffer or
+ string. The "23" can be any column number. The first column is 1.
+ Actually, the column is the byte number (thus it's not exactly right
+ for multi-byte characters). {not in Vi}
+ WARNING: When inserting or deleting text Vim does not automatically
+ update the matches. This means Syntax highlighting quickly becomes
+ wrong.
+ Example, to highlight the column where the cursor currently is: >
+ :exe '/\%' . col(".") . 'c'
+< When 'hlsearch' is set and you move the cursor around and make changes
+ this will clearly show when the match is updated or not.
+ Example for matching a single byte in column 44: >
+ /\%>43c.\%<46c
+< Note that "\%<46c" matches in column 45 when the "." matches a byte in
+ column 44.
+ */\%v* */\%>v* */\%<v*
+\%23v Matches in a specific virtual column.
+\%<23v Matches before a specific virtual column.
+\%>23v Matches after a specific virtual column.
+ These three can be used to match specific virtual columns in a buffer
+ or string. When not matching with a buffer in a window, the option
+ values of the current window are used (e.g., 'tabstop').
+ The "23" can be any column number. The first column is 1.
+ Note that some virtual column positions will never match, because they
+ are halfway a Tab or other character that occupies more than one
+ screen character. {not in Vi}
+ WARNING: When inserting or deleting text Vim does not automatically
+ update the matches. This means Syntax highlighting quickly becomes
+ wrong.
+ Example, to highlight the all characters after virtual column 72: >
+ /\%>72v.*
+< When 'hlsearch' is set and you move the cursor around and make changes
+ this will clearly show when the match is updated or not.
+ To match the text up to column 17: >
+ /.*\%17v
+< Column 17 is not included, because that's where the "\%17v" matches,
+ and since this is a |/zero-width| match, column 17 isn't included in
+ the match. This does the same: >
+ /.*\%<18v
+<
+
+Character classes: {not in Vi}
+\i identifier character (see 'isident' option) */\i*
+\I like "\i", but excluding digits */\I*
+\k keyword character (see 'iskeyword' option) */\k*
+\K like "\k", but excluding digits */\K*
+\f file name character (see 'isfname' option) */\f*
+\F like "\f", but excluding digits */\F*
+\p printable character (see 'isprint' option) */\p*
+\P like "\p", but excluding digits */\P*
+
+NOTE: the above also work for multi-byte characters. The ones below only
+match ASCII characters, as indicated by the range.
+
+ *whitespace* *white-space*
+\s whitespace character: <Space> and <Tab> */\s*
+\S non-whitespace character; opposite of \s */\S*
+\d digit: [0-9] */\d*
+\D non-digit: [^0-9] */\D*
+\x hex digit: [0-9A-Fa-f] */\x*
+\X non-hex digit: [^0-9A-Fa-f] */\X*
+\o octal digit: [0-7] */\o*
+\O non-octal digit: [^0-7] */\O*
+\w word character: [0-9A-Za-z_] */\w*
+\W non-word character: [^0-9A-Za-z_] */\W*
+\h head of word character: [A-Za-z_] */\h*
+\H non-head of word character: [^A-Za-z_] */\H*
+\a alphabetic character: [A-Za-z] */\a*
+\A non-alphabetic character: [^A-Za-z] */\A*
+\l lowercase character: [a-z] */\l*
+\L non-lowercase character: [^a-z] */\L*
+\u uppercase character: [A-Z] */\u*
+\U non-uppercase character [^A-Z] */\U*
+
+ NOTE: Using the atom is faster than the [] form.
+
+ NOTE: 'ignorecase', "\c" and "\C" are not used by character classes.
+
+ */\_* *E63* */\_i* */\_I* */\_k* */\_K* */\_f* */\_F*
+ */\_p* */\_P* */\_s* */\_S* */\_d* */\_D* */\_x* */\_X*
+ */\_o* */\_O* */\_w* */\_W* */\_h* */\_H* */\_a* */\_A*
+ */\_l* */\_L* */\_u* */\_U*
+\_x Where "x" is any of the characters above: The character class with
+ end-of-line added
+(end of character classes)
+
+\e matches <Esc> */\e*
+\t matches <Tab> */\t*
+\r matches <CR> */\r*
+\b matches <BS> */\b*
+\n matches an end-of-line */\n*
+ When matching in a string instead of buffer text a literal newline
+ character is matched.
+
+~ matches the last given substitute string */~* */\~*
+
+\(\) A pattern enclosed by escaped parentheses. */\(* */\(\)* */\)*
+ E.g., "\(^a\)" matches 'a' at the start of a line. *E51* *E54* *E55*
+
+\1 Matches the same string that was matched by */\1* *E65*
+ the first sub-expression in \( and \). {not in Vi}
+ Example: "\([a-z]\).\1" matches "ata", "ehe", "tot", etc.
+\2 Like "\1", but uses second sub-expression, */\2*
+ ... */\3*
+\9 Like "\1", but uses ninth sub-expression. */\9*
+ Note: The numbering of groups is done based on which "\(" comes first
+ in the pattern (going left to right), NOT based on what is matched
+ first.
+
+\%(\) A pattern enclosed by escaped parentheses. */\%(\)* */\%(* *E53*
+ Just like \(\), but without counting it as a sub-expression. This
+ allows using more groups and it's a little bit faster.
+ {not in Vi}
+
+x A single character, with no special meaning, matches itself
+
+ */\* */\\*
+\x A backslash followed by a single character, with no special meaning,
+ is reserved for future expansions
+
+[] (with 'nomagic': \[]) */[]* */\[]* */\_[]* */collection*
+\_[]
+ A collection. This is a sequence of characters enclosed in brackets.
+ It matches any single character in the collection.
+ Example matches ~
+ [xyz] any 'x', 'y' or 'z'
+ [a-zA-Z]$ any alphabetic character at the end of a line
+ \c[a-z]$ same
+
+ With "\_" prepended the collection also includes the end-of-line.
+ The same can be done by including "\n" in the collection. The
+ end-of-line is also matched when the collection starts with "^"! Thus
+ "\_[^ab]" matches the end-of-line and any character but "a" and "b".
+ This makes it Vi compatible: Without the "\_" or "\n" the collection
+ does not match an end-of-line.
+
+ If the sequence begins with "^", it matches any single character NOT
+ in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
+ - If two characters in the sequence are separated by '-', this is
+ shorthand for the full list of ASCII characters between them. E.g.,
+ "[0-9]" matches any decimal digit.
+ - A character class expression is evaluated to the set of characters
+ belonging to that character class. The following character classes
+ are supported:
+ Name Contents ~
+*[:alnum:]* [:alnum:] letters and digits
+*[:alpha:]* [:alpha:] letters
+*[:blank:]* [:blank:] space and tab characters
+*[:cntrl:]* [:cntrl:] control characters
+*[:digit:]* [:digit:] decimal digits
+*[:graph:]* [:graph:] printable characters excluding space
+*[:lower:]* [:lower:] lowercase letters (all letters when
+ 'ignorecase' is used)
+*[:print:]* [:print:] printable characters including space
+*[:punct:]* [:punct:] punctuation characters
+*[:space:]* [:space:] whitespace characters
+*[:upper:]* [:upper:] uppercase letters (all letters when
+ 'ignorecase' is used)
+*[:xdigit:]* [:xdigit:] hexadecimal digits
+*[:return:]* [:return:] the <CR> character
+*[:tab:]* [:tab:] the <Tab> character
+*[:escape:]* [:escape:] the <Esc> character
+*[:backspace:]* [:backspace:] the <BS> character
+ The brackets in character class expressions are additional to the
+ brackets delimiting a collection. For example, the following is a
+ plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
+ a list of at least one character, each of which is either '-', '.',
+ '/', alphabetic, numeric, '_' or '~'.
+ These items only work for 8-bit characters.
+ */\]*
+ - To include a literal ']', '^', '-' or '\' in the collection, put a
+ backslash before it: "[xyz\]]", "[\^xyz]", "[xy\-z]" and "[xyz\\]".
+ (Note: POSIX does not support the use of a backslash this way). For
+ ']' you can also make it the first character (following a possible
+ "^"): "[]xyz]" or "[^]xyz]" {not in Vi}.
+ For '-' you can also make it the first or last character: "[-xyz]",
+ "[^-xyz]" or "[xyz-]". For '\' you can also let it be followed by
+ any character that's not in "^]-\bertn". "[\xyz]" matches '\', 'x',
+ 'y' and 'z'. It's better to use "\\" though, future expansions may
+ use other characters after '\'.
+ - The following translations are accepted when the 'l' flag is not
+ included in 'cpoptions' {not in Vi}:
+ \e <Esc>
+ \t <Tab>
+ \r <CR> (NOT end-of-line!)
+ \b <BS>
+ NOTE: The other backslash codes mentioned above do not work inside
+ []!
+ - Matching with a collection can be slow, because each character in
+ the text has to be compared with each character in the collection.
+ Use one of the other atoms above when possible. Example: "\d" is
+ much faster than "[0-9]" and matches the same characters.
+
+ */\%[]* *E69* *E70* *E369*
+\%[] A list of optionally matched atoms. This always matches.
+ It matches as much of the list of atoms it contains as possible. Thus
+ it stops at the first atom that doesn't match. For example: >
+ /r\%[ead]
+< matches "r", "re", "rea" or "read". The longest that matches is used.
+ To match the Ex command "function", where "fu" is required and
+ "nction" is optional, this would work: >
+ /\<fu\%[nction]\>
+< The end-of-word atom "\>" is used to avoid matching "fu" in "full".
+ It gets more complicated when the atoms are not ordinary characters.
+ You don't often have to use it, but it is possible. Example: >
+ /\<r\%[[eo]ad]\>
+< Matches the words "r", "re", "ro", "rea", "roa", "read" and "road".
+ {not available when compiled without the +syntax feature}
+
+
+==============================================================================
+7. Ignoring case in a pattern */ignorecase*
+
+If the 'ignorecase' option is on, the case of normal letters is ignored.
+'smartcase' can be set to ignore case when the pattern contains lowercase
+letters only.
+ */\c* */\C*
+When "\c" appears anywhere in the pattern, the whole pattern is handled like
+'ignorecase' is on. The actual value of 'ignorecase' and 'smartcase' is
+ignored. "\C" does the opposite: Force matching case for the whole pattern.
+{only Vim supports \c and \C}
+Note that 'ignorecase', "\c" and "\C" are not used for the character classes.
+
+Examples:
+ pattern 'ignorecase' 'smartcase' matches ~
+ foo off - foo
+ foo on - foo Foo FOO
+ Foo on off foo Foo FOO
+ Foo on on Foo
+ \cfoo - - foo Foo FOO
+ foo\C - - foo
+
+ */\Z*
+When "\Z" appears anywhere in the pattern, composing characters are ignored.
+Thus only the base characters need to match, the composing characters may be
+different and the number of composing characters may differ. Only relevant
+when 'encoding' is "utf-8".
+
+Technical detail: *NL-used-for-Nul*
+<Nul> characters in the file are stored as <NL> in memory. In the display
+they are shown as "^@". The translation is done when reading and writing
+files. To match a <Nul> with a search pattern you can just enter CTRL-@ or
+"CTRL-V 000". This is probably just what you expect. Internally the
+character is replaced with a <NL> in the search pattern. What is unusual is
+that typing CTRL-V CTRL-J also inserts a <NL>, thus also searches for a <Nul>
+in the file. {Vi cannot handle <Nul> characters in the file at all}
+
+ *CR-used-for-NL*
+When 'fileformat' is "mac", <NL> characters in the file are stored as <CR>
+characters internally. In the display they are shown as "^M". Otherwise this
+works similar to the usage of <NL> for a <Nul>.
+
+When working with expression evaluation, a <NL> character in the pattern
+matches a <NL> in the string. The use of "\n" (backslash n) to match a <NL>
+doesn't work there, it only works to match text in the buffer.
+
+ *pattern-multi-byte*
+Patterns will also work with multi-byte characters, mostly as you would
+expect. But invalid bytes may cause trouble, a pattern with an invalid byte
+will probably never match.
+
+==============================================================================
+8. Compare with Perl patterns *perl-patterns*
+
+Vim's regexes are most similar to Perl's, in terms of what you can do. The
+difference between them is mostly just notation; here's a summary of where
+they differ:
+
+Capability in Vimspeak in Perlspeak ~
+----------------------------------------------------------------
+force case insensitivity \c (?i)
+force case sensitivity \C (?-i)
+backref-less grouping \%(atom) (?:atom)
+conservative quantifiers \{-n,m} *?, +?, ??, {}?
+0-width match atom\@= (?=atom)
+0-width non-match atom\@! (?!atom)
+0-width preceding match atom\@<= (?<=atom)
+0-width preceding non-match atom\@<! (?<!atom)
+match without retry atom\@> (?>atom)
+
+Vim and Perl handle newline characters inside a string a bit differently:
+
+In Perl, ^ and $ only match at the very beginning and end of the text,
+by default, but you can set the 'm' flag, which lets them match at
+embedded newlines as well. You can also set the 's' flag, which causes
+a . to match newlines as well. (Both these flags can be changed inside
+a pattern using the same syntax used for the i flag above, BTW.)
+
+On the other hand, Vim's ^ and $ always match at embedded newlines, and
+you get two separate atoms, \%^ and \%$, which only match at the very
+start and end of the text, respectively. Vim solves the second problem
+by giving you the \_ "modifier": put it in front of a . or a character
+class, and they will match newlines as well.
+
+Finally, these constructs are unique to Perl:
+- execution of arbitrary code in the regex: (?{perl code})
+- conditional expressions: (?(condition)true-expr|false-expr)
+
+...and these are unique to Vim:
+- changing the magic-ness of a pattern: \v \V \m \M
+ (very useful for avoiding backslashitis)
+- sequence of optionally matching atoms: \%[atoms]
+- \& (which is to \| what "and" is to "or"; it forces several branches
+ to match at one spot)
+- matching lines/columns by number: \%5l \%5c \%5v
+- limiting the "return value" of a regex: \zs \ze
+
+==============================================================================
+9. Highlighting matches *match-highlight*
+
+ *:mat* *:match*
+:mat[ch] {group} /{pattern}/
+ Define a pattern to highlight in the current window. It will
+ be highlighted with {group}. Example: >
+ :highlight MyGroup ctermbg=green guibg=green
+ :match MyGroup /TODO/
+< Instead of // any character can be used to mark the start and
+ end of the {pattern}. Watch out for using special characters,
+ such as '"' and '|'.
+ {group} must exist at the moment this command is executed.
+ The match overrides the 'hlsearch' highlighting.
+ 'ignorecase' does not apply, use |/\c| in the pattern to
+ ignore case. Otherwise case is not ignored.
+ Note that highlighting the last used search pattern with
+ 'hlsearch' is used in all windows, while the pattern defined
+ with ":match" only exists in the current window. It is kept
+ when switching to another buffer.
+ Another example, which highlights all characters in virtual
+ column 72 and more: >
+ :highlight rightMargin term=bold ctermfg=blue guifg=blue
+ :match rightMargin /.\%>72v/
+< To highlight all character that are in virtual column 7: >
+ :highlight col8 ctermbg=grey guibg=grey
+ :match col8 /\%<8v.\%>7v/
+< Note the use of two items to also match a character that
+ occupies more than one virtual column, such as a TAB.
+
+:mat[ch]
+:mat[ch] none
+ Clear a previously defined match pattern.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/pi_expl.txt b/runtime/doc/pi_expl.txt
new file mode 100644
index 000000000..4c962ffc8
--- /dev/null
+++ b/runtime/doc/pi_expl.txt
@@ -0,0 +1,215 @@
+*pi_expl.txt* For Vim version 7.0aa. Last change: 2002 Nov 08
+
+
+ VIM REFERENCE MANUAL by M A Aziz Ahmed
+ updated by Mark Waggoner
+
+
+ *file-explorer* *file-browser*
+Plugin for exploring (or browsing) directories and files
+
+1. Starting the file explorer |expl-starting|
+
+The functionality mentioned here is a |standard-plugin|.
+This plugin is only available if 'compatible' is not set.
+You can avoid loading this plugin by setting the "loaded_explorer" variable: >
+ :let loaded_explorer = 1
+
+{Vi does not have any of this}
+
+==============================================================================
+1. Starting the file explorer *expl-starting*
+
+This plugin is used to explore directories inside Vim. The file explorer is
+launched whenever the user tries to edit a directory.
+ *:Explore* *:Sexplore*
+To launch the explorer in the directory of the file currently edited: >
+ :Explore
+If the file has changes the window is split. To always split the window: >
+ :Sexplore
+To launch the explorer in a specific directory: >
+ :Explore dirname
+ :Sexplore dirname
+
+From inside the explorer move your cursor to a line containing a file or
+directory name. The following command keys are available:
+
+ <enter> will open the file in the window the explorer is currently
+ occupying.
+ 'o' will split a new window and open the file in the new window.
+ 'O' will open the file chosen using the window that the cursor was in just
+ before you started or entered the explorer window. If the explorer is
+ the only window, it will first split a new window to use for the file to
+ be opened.
+ 'p' will open (or use) the preview window showing the file
+ 'x' will execute the file with the system tools. Only when supported
+ (currently MS-Windows and KDE).
+
+When splitting off a new window, you can control where the split window will
+go relative to the explorer window using the variables g:explVertical,
+g:explSplitBelow and g:explSplitRight.
+
+ *g:explVertical*
+ *g:explSplitBelow*
+ *g:explSplitRight*
+ *g:explStartBelow*
+ *g:explStartRight*
+To control whether the split is made horizontally or vertically, use: >
+ let g:explVertical=1 " Split vertically
+ let g:explVertical=0 " Split horizontally (default)
+
+To control where the window goes relative to the explorer window when
+splitting horizontally, use the variable: >
+ let g:explSplitBelow=1 " Put new window below explorer window
+ let g:explSplitBelow=0 " Put new window above explorer window
+The default for this is the setting of splitbelow at the time the plugin is
+loaded.
+
+To control where the windows goes relative to the explorer window when
+splitting vertically, use the variable: >
+ let g:explSplitRight=1 " Put new window to the right of the explorer
+ let g:explSplitRight=0 " Put new window to the left of the explorer
+The default for this is the setting of splitright at the time the plugin is
+loaded.
+
+To use a different split method for the explorer window, use: >
+ let g:explStartRight=1 " Put new explorer window to the right of the
+ " current window
+ let g:explStartRight=0 " Put new explorer window to the left of the
+ " current window
+The default for this set to g:explSplitRight at the time the plugin is loaded.
+
+To use a different split method for the explorer window, use: >
+ let g:explStartBelow=1 " Put new explorer window below the
+ " current window
+ let g:explStartBelow=0 " Put new explorer window above the
+ " current window
+The default for this set to g:explSplitBelow at the time the plugin is loaded.
+
+The start splits allow for the explorer window to be placed in a file browser
+type arrangement, where the directories are shown on the left and the contents
+opened on the right. The start split settings are only used when issuing
+the Sexplore command.
+
+Note that the window split is done a little bit differently than window splits
+are usually done. Ordinarily, when splitting a window, the space occupied by
+the current window will be split to give space for the new window. The
+explorer attempts to instead split from a window adjacent to the explorer
+window so that the explorer window will not change sizes. If there is not an
+adjacent window in the direction you are splitting, the explorer window is
+split.
+
+ *g:explWinSize*
+After opening a file with the 'o' command, you might want to resize the
+explorer window. This can be done by setting the variable >
+ let g:explWinSize=N
+N is the number of rows (when the window is split horizontally) or the number
+of columns (when the window is split vertically). If g:explWinSize is set to
+an empty string (""), resizing will not be done. g:explWinSize defaults to
+15.
+
+ *g:explDetailedList*
+The file size (in bytes) and modification time can be displayed inside the
+file explorer window. By pressing 'i', you can toggle between the name only
+display and the more lengthy display. If you want the size and date to show
+by default, use >
+ let g:explDetailedList=1
+Doing this may slightly slow down explorer. The difference may or may not be
+noticeable depending on your system and whether the directory is local or on
+the network and on the size of the directory.
+
+ *g:explDateFormat*
+The format of date displayed is configurable using the variable
+g:explDateFormat. explorer uses this variable to pass to strftime() to fetch
+the date information. |strftime()| The default is >
+ let g:explDateFormat="%d %b %Y %H:%M"
+
+Note that for sorting purposes, the date is always placed at the end of the
+line in its 'raw' form. If you have syntax highlighting turned on, this raw
+date should be invisible.
+
+ *g:explHideFiles*
+You can hide some files by filling the variable g:explHidFiles with regular
+expressions. A filename that matches any of these regular expressions will not
+be shown. For example, >
+
+ let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$'
+
+will not show files that begin with "." and those that end in .gz, .exe or
+.zip. However, all directory names will always be shown. If while exploring,
+you'd like to see the hidden files as well, use the command "a".
+The explorer header will indicate if filtering is being done.
+
+ *g:explDetailedHelp*
+The help information spanning a few lines can be turned off (and just a single
+help message enabled) using the option >
+ let g:explDetailedHelp=0
+You can anytime switch to the detailed help format by pressing ?.
+
+ *explorer-delete*
+Pressing 'D' inside explorer deletes the file under the cursor. You can delete
+many files by visually selecting them and using 'D'. The deletion is
+interactive in the form y/n/a/q. Directory deletion is not supported (mainly
+because there is no way to delete a directory using a vim built-in function).
+
+ *explorer-rename*
+Pressing 'R' inside explorer will allow you to rename the file under the
+cursor.
+
+ *g:explSortBy*
+The display in the file explorer can be sorted in forward or reverse order by
+name, size, or modification date. You can set the default sorting direction
+with the option >
+ let g:explSortBy='name' " alphabetically
+ let g:explSortBy='reverse name' " reverse alphabetically
+ let g:explSortBy='date' " newest first
+ let g:explSortBy='reverse date' " oldest first
+ let g:explSortBy='size' " largest first
+ let g:explSortBy='reverse size' " smallest first
+While in the explorer, you can rotate through the sort fields by pressing the
+'s' key and you can reverse the current sort order by pressing the 'r' key.
+Sorting on fields other than the name will be faster if the size and date are
+displayed (using 'i' or g:explDetailedList).
+The explorer heading will indicate the current sort order.
+
+ *g:explDirsFirst*
+To control the segregation of directories and files, you can set this option >
+ let g:explDirsFirst=1 " Directories at the top of the list (default)
+ let g:explDirsFirst=0 " Directories mixed in with files
+ let g:explDirsFirst=-1 " Directories at the bottom of the list
+
+ *g:explSuffixesLast*
+To control the segregation of files matching the suffixes option, you can set
+this option >
+ let g:explSuffixesLast=1 " Files matching suffixes sorted at the bottom
+ " of the list (default)
+ let g:explSuffixesLast=0 " Files matching suffixes sorted normally
+ let g:explSuffixesLast=-1 " Files matching suffixes sorted at the top of
+ " the list
+The heading will indicate if suffixes have been moved to the end (or start) of
+the list.
+
+ *g:explUseSeparators*
+Directories and files matching the suffixes list will be highlighted. If you
+have the directories, files, and suffixes separated, and you would like a
+separator line between the groups, you can set the option >
+ let g:explUseSeparators=1 " Use separator lines
+ let g:explUseSeparators=0 " Don't use separator lines
+<
+ *g:explFileHandler*
+If you set the "g:explFileHandler" variable to the name of a function, typing
+'x' will call this function. The file or directory under the cursor will be
+passed as an argument to the function. Suppose you have KDE, you could use
+this: >
+
+ function MyFileHandler(fn)
+ exec "silent! !kfmclient exec " . escape(a:fn,' \%#')
+ endfunction
+ let g:explFileHandler = 'MyFileHandler'
+
+For Win32 the variable is set by default to invoke the execute action. If you
+type 'x' on a HTML file, Microsoft Internet Explorer will start (or whatever
+application you have associated with HTML files).
+
+==============================================================================
+ vim:tw=78:noet:ts=8:ft=help:norl:
diff --git a/runtime/doc/pi_gzip.txt b/runtime/doc/pi_gzip.txt
new file mode 100644
index 000000000..19ecdc430
--- /dev/null
+++ b/runtime/doc/pi_gzip.txt
@@ -0,0 +1,39 @@
+*pi_gzip.txt* For Vim version 7.0aa. Last change: 2002 Oct 29
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Editing compressed files with Vim *gzip* *bzip2* *compress*
+
+1. Autocommands |gzip-autocmd|
+
+The functionality mentioned here is a |standard-plugin|.
+This plugin is only available if 'compatible' is not set.
+You can avoid loading this plugin by setting the "loaded_gzip" variable: >
+ :let loaded_gzip = 1
+
+{Vi does not have any of this}
+
+==============================================================================
+1. Autocommands *gzip-autocmd*
+
+The plugin installs autocommands to intercept reading and writing of files
+with these extensions:
+
+ extension compression ~
+ *.Z compress (Lempel-Ziv)
+ *.gz gzip
+ *.bz2 bzip2
+
+That's actually the only thing you need to know. There are no options.
+
+After decompressing a file, the filetype will be detected again. This will
+make a file like "foo.c.gz" get the "c" filetype.
+
+If you have 'patchmode' set, it will be appended after the extension for
+compression. Thus editing the patchmode file will not give you the automatic
+decompression. You have to rename the file if you want this.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
new file mode 100644
index 000000000..abfa8ce2f
--- /dev/null
+++ b/runtime/doc/pi_netrw.txt
@@ -0,0 +1,543 @@
+*pi_netrw.txt* For Vim version 7.0aa. Last change: Apr 21, 2004
+
+
+ VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
+
+*dav* *http* *network* *rcp* *scp*
+*fetch* *netrw* *Nread* *rsync* *sftp*
+*ftp* *netrw.vim* *Nwrite* *netrw-file*
+
+==============================================================================
+0. Contents *netrw-contents*
+
+1. Netrw Reference.....................................|netrw-ref|
+2. Network-Oriented File Transfer......................|netrw-xfer|
+3. Activation..........................................|netrw-activate|
+4. Transparent File Transfer...........................|netrw-transparent|
+5. Ex Commands.........................................|netrw-ex|
+6. Variables and Options...............................|netrw-var|
+7. Debugging...........................................|netrw-debug|
+8. New Stuff...........................................|netrw-new|
+9. Credits.............................................|netrw-credits|
+
+The functionality mentioned here is done via using |standard-plugin|
+techniques. This plugin is only available if
+
+ set nocp " 'compatible' is not set
+ filetype plugin on " plugins are enabled
+
+You can avoid loading this plugin by setting the "loaded_netrw" variable
+in your <.vimrc> file: >
+
+ :let loaded_netrw = 1
+
+{Vi does not have any of this}
+
+==============================================================================
+1. Netrw Reference *netrw-ref*
+
+ OPTIONS
+ let g:netrw_ftp =0 use ftp (default) (uid password)
+ =1 use alternate ftp method (user uid password)
+ If you're having trouble with ftp, try changing the value
+ of this variable in your <.vimrc> to change methods
+
+ let g:netrw_ignorenetrc= 1
+ If you have a <.netrc> file but it doesn't work and you
+ want it ignored, then set this variable as shown. Its mere
+ existence is enough to cause <.netrc> to be ignored.
+
+ Controlling External Applications
+
+ Protocol Variable Default Value
+ -------- ---------------- -------------
+ dav: g:netrw_dav_cmd = "cadaver"
+ fetch: g:netrw_fetch_cmd = "fetch -o"
+ ftp: g:netrw_ftp_cmd = "ftp"
+ http: g:netrw_http_cmd = "fetch -o" else if fetch is available
+ http: g:netrw_http_cmd = "wget -q -O" If wget is available
+ rcp: g:netrw_rcp_cmd = "rcp"
+ rsync: g:netrw_rsync_cmd = "rsync -a"
+ scp: g:netrw_scp_cmd = "scp -q"
+ sftp: g:netrw_sftp_cmd = "sftp"
+
+ READING
+ :Nread ? give help
+ :Nread "machine:file" uses rcp
+ :Nread "machine file" uses ftp with <.netrc>
+ :Nread "machine id password file" uses ftp
+ :Nread "dav://machine[:port]/file" uses cadaver
+ :Nread "fetch://[user@]machine/file" uses fetch
+ :Nread "ftp://[user@]machine[[:#]port]/file" uses ftp autodetects <.netrc>
+ :Nread "http://[user@]machine/file" uses http uses wget
+ :Nread "rcp://[user@]machine/file" uses rcp
+ :Nread "rsync://[user@]machine[:port]/file" uses rsync
+ :Nread "scp://[user@]machine[[:#]port]/file" uses scp
+ :Nread "sftp://[user@]machine/file" uses sftp
+
+ WRITING
+ :Nwrite ? give help
+ :Nwrite "machine:file" uses rcp
+ :Nwrite "machine file" uses ftp with <.netrc>
+ :Nwrite "machine id password file" uses ftp
+ :Nwrite "dav://machine[:port]/file" uses cadaver
+ :Nwrite "ftp://[user@]machine[[:#]port]/file" uses ftp autodetects <.netrc>
+ :Nwrite "rcp://[user@]machine/file" uses rcp
+ :Nwrite "rsync://[user@]machine[:port]/file" uses rsync
+ :Nwrite "scp://[user@]machine[[:#]port]/file" uses scp
+ :Nwrite "sftp://[user@]machine/file" uses sftp
+ http: not supported!
+
+ USER AND PASSWORD CHANGING
+ Attempts to use ftp will prompt you for a user-id and a password.
+ These will be saved in g:netrw_uid and g:netrw_passwd Subsequent uses
+ of ftp will re-use those. If you need to use a different user id
+ and/or password, you'll want to call NetUserPass() first.
+
+ :NetUserPass [uid [password]] -- prompts as needed
+ :call NetUserPass() -- prompts for uid and password
+ :call NetUserPass("uid") -- prompts for password
+ :call NetUserPass("uid","password") -- sets global uid and password
+
+ VARIABLES
+ b:netrw_lastfile last file Network-read/written retained on
+ a per-buffer basis (supports plain :Nw )
+ s:netrw_line during Nw/NetWrite, holds current line number
+ s:netrw_col during Nw/NetWrite, holds current column number
+ s:netrw_line and s:netrw_col are used to
+ restore the cursor position on writes
+ g:netrw_ftp if it doesn't exist, use default ftp
+ =0 use default ftp (uid password)
+ =1 use alternate ftp method (user uid password)
+ g:netrw_ftpmode ="binary" (default)
+ ="ascii" (or your choice)
+ g:netrw_uid (ftp) user-id, retained on a per-session basis
+ g:netrw_passwd (ftp) password, retained on a per-session basis
+ g:netrw_win95ftp =0 use unix-style ftp even if win95/win98/winME
+ =1 use default method to do ftp
+ g:netrw_cygwin =1 assume scp under windows is from cygwin
+ (default if windows)
+ =0 assume scp under windows accepts
+ windows-style paths (default otherwise)
+ g:netrw_use_nt_rcp=0 don't use the rcp of WinNT, Win2000 and WinXP (default)
+ =1 use the rcp of WinNT,... in binary mode
+
+
+==============================================================================
+2. Network-Oriented File Transfer *netrw-xfer*
+
+Network-oriented file transfer under Vim is implemented by a VimL-based script
+(<netrw.vim>) using plugin techniques. It currently supports both reading
+and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch,
+dav/cadaver, rsync, or sftp.
+
+http is currently supported read-only via use of wget or fetch.
+
+<netrw.vim> is a standard plugin which acts as glue between Vim and the
+various file transfer programs. It uses autocommand events (BufReadCmd,
+FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
+
+ ex. vim ftp://hostname/path/to/file
+<
+The characters preceding the colon specify the protocol to use;
+in the example, its ftp. The <netrw.vim> script then formulates
+a command or a series of commands (typically ftp) which it issues
+to an external program (ftp, scp, etc) which does the actual file
+transfer/protocol. Files are read from/written to a temporary file
+(under Unix/Linux, /tmp/...) which the <netrw.vim> script will
+clean up.
+
+One may modify any protocol's implementing external application
+by setting a variable (ex. scp uses the variable g:netrw_scp_cmd,
+which is defaulted to "scp -q").
+
+Ftp, an old protocol, seems to be blessed by numerous implementations.
+Unfortunately, some implementations are noisy (ie., add junk to the end
+of the file). Thus, concerned users may decide to write a NetReadFixup()
+function that will clean up after reading with their ftp. Some Unix systems
+(ie., FreeBSD) provide a utility called "fetch" which uses the ftp protocol
+but is not noisy and more convenient, actually, for <netrw.vim> to use.
+Consequently, if "fetch" is executable, it will be used to do reads for
+ftp://... (and http://...) . See |netrw-var| for more about this.
+
+For rcp, scp, sftp, and http, one may use network-oriented file transfers
+transparently; ie.
+>
+ vim rcp://[user@]machine/path
+ vim scp://[user@]machine/path
+<
+If your ftp supports <.netrc>, then it too can be just as transparently used
+if the needed triad of machine name, user id, and password are present in
+that file. Your ftp must be able to use the <.netrc> file on its own, however.
+>
+ vim ftp://[user@]machine[[:#]portnumber]/path
+<
+However, ftp will often need to query the user for the userid and password.
+The latter will be done "silently"; ie. asterisks will show up instead of
+the actually-typed-in password. Netrw will retain the userid and password
+for subsequent read/writes from the most recent transfer so subsequent
+transfers (read/write) to or from that machine will take place without
+additional prompting.
+
+ *netrw-urls*
+ +=================================+============================+============+
+ | Reading | Writing | Uses |
+ +=================================+============================+============+
+ | DAV: | | |
+ | dav://host/path | | cadaver |
+ | :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
+ +---------------------------------+----------------------------+------------+
+ | FETCH: | | |
+ | fetch://[user@]host/path | | |
+ | fetch://[user@]host:http/path | Not Available | fetch |
+ | :Nread fetch://[user@]host/path| | |
+ +---------------------------------+----------------------------+------------+
+ | FILE: | | |
+ | file:///* | file:///* | |
+ | file://localhost/* | file://localhost/* | |
+ +---------------------------------+----------------------------+------------+
+ | FTP: (*3) | (*3) | |
+ | ftp://[user@]host/path | ftp://[user@]host/path | ftp (*2) |
+ | :Nread ftp://host/path | :Nwrite ftp://host/path | ftp+.netrc |
+ | :Nread host path | :Nwrite host path | ftp+.netrc |
+ | :Nread host uid pass path | :Nwrite host uid pass path | ftp |
+ +---------------------------------+----------------------------+------------+
+ | HTTP: wget is executable: (*4) | | |
+ | http://[user@]host/path | Not Available | wget |
+ +---------------------------------+----------------------------+------------+
+ | HTTP: fetch is executable (*4) | | |
+ | http://[user@]host/path | Not Available | fetch |
+ +---------------------------------+----------------------------+------------+
+ | RCP: | | |
+ | rcp://[user@]host/path | rcp://[user@]host/path | rcp |
+ +---------------------------------+----------------------------+------------+
+ | RSYNC: | | |
+ | rsync://[user@]host/path | rsync://[user@]host/path | rsync |
+ | :Nread rsync://host/path | :Nwrite rsync://host/path | rsync |
+ | :Nread rcp://host/path | :Nwrite rcp://host/path | rcp |
+ +---------------------------------+----------------------------+------------+
+ | SCP: | | |
+ | scp://[user@]host/path | scp://[user@]host/path | scp |
+ | :Nread scp://host/path | :Nwrite scp://host/path | scp (*1) |
+ +---------------------------------+----------------------------+------------+
+ | SFTP: | | |
+ | sftp://[user@]host/path | sftp://[user@]host/path | sftp |
+ | :Nread sftp://host/path | :Nwrite sftp://host/path | sftp (*1) |
+ +=================================+============================+============+
+
+ (*1) For an absolute path use scp://machine//path.
+
+ (*2) if <.netrc> is present, it is assumed that it will
+ work with your ftp client. Otherwise the script will
+ prompt for user-id and password.
+
+ (*3) for ftp, "machine" may be machine#port or machine:port
+ if a different port is needed than the standard ftp port
+
+ (*4) for http:..., if wget is available it will be used. Otherwise,
+ if fetch is available it will be used.
+
+Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
+
+
+NETRC *netrw-netrc*
+
+The typical syntax for lines in a <.netrc> file is given as shown below.
+Ftp under Unix usually support <.netrc>; Windows' ftp usually doesn't.
+>
+ machine {full machine name} login {user-id} password "{password}"
+ default login {user-id} password "{password}"
+
+Your ftp client must handle the use of <.netrc> on its own, but if the
+<.netrc> file exists, an ftp transfer will not ask for the user-id or
+password.
+
+ Note:
+ Since this file contains passwords, make very sure nobody else can
+ read this file! Most programs will refuse to use a .netrc that is
+ readable for others. Don't forget that the system administrator can
+ still read the file!
+
+
+PASSWORD *netrw-passwd*
+
+The script attempts to get passwords for ftp invisibly using |inputsecret()|,
+a built-in Vim function. See |netrw-uidpass| for how to change the password
+after one has set it.
+
+Unfortunately there doesn't appear to be a way for netrw to feed a password
+to scp. Thus every transfer via scp will require re-entry of the password.
+
+
+==============================================================================
+3. Activation *netrw-activate*
+
+Network-oriented file transfers are available by default whenever
+|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
+system's vim-plugin directory and is sourced automatically whenever you
+bring up vim.
+
+
+==============================================================================
+4. Transparent File Transfer *netrw-transparent*
+
+Transparent file transfers occur whenever a regular file read or write
+(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
+Thus one may use files across networks as if they were local. >
+
+ vim ftp://[user@]machine/path
+ ...
+ :wq
+
+
+==============================================================================
+5. Ex Commands *netrw-ex*
+
+The usual read/write commands are supported. There are also a couple of
+additional commands available.
+
+:[range]Nw Write the specified lines to the current
+ file as specified in b:netrw_lastfile.
+
+:[range]Nw {netfile} [{netfile}]...
+ Write the specified lines to the {netfile}.
+
+:Nread
+ Read the specified lines into the current
+ buffer from the file specified in
+ b:netrw_lastfile.
+
+:Nread {netfile} {netfile}...
+ Read the {netfile} after the current line.
+
+ *netrw-uidpass*
+:call NetUserPass()
+ If b:netrw_uid and b:netrw_passwd don't exist,
+ this function query the user for them.
+
+:call NetUserPass("userid")
+ This call will set the b:netrw_uid and, if
+ the password doesn't exist, will query the user for it.
+
+:call NetUserPass("userid","passwd")
+ This call will set both the b:netrw_uid and b:netrw_passwd.
+ The user-id and password are used by ftp transfers. One may
+ effectively remove the user-id and password by using ""
+ strings.
+
+
+==============================================================================
+6. Variables and Options *netrw-options* *netrw-var*
+
+The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
+behavior. These variables typically may be set in the user's <.vimrc> file:
+
+ g:netrw_uid Holds current user-id for ftp.
+ g:netrw_passwd Holds current password for ftp.
+ b:netrw_lastfile Holds latest method/machine/path.
+ b:netrw_line Holds current line number (during NetWrite)
+ b:netrw_col Holds current cursor position (during NetWrite)
+ g:netrw_ftp =0 use default ftp (uid password)
+ =1 use alternate ftp (user uid password)
+ (see |netrw-options|)
+ g:netrw_ftpmode ="binary" (default)
+ ="ascii" (your choice)
+ g:netrw_ignorenetrc =1 (default)
+ if you have a <.netrc> file but you don't
+ want it used, then set this variable. Its
+ mere existence is enough to cause <.netrc>
+ to be ignored.
+ g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
+ =1 use default method to do ftp
+ g:netrw_cygwin =1 assume scp under windows is from cygwin
+ (default/windows)
+ =0 assume scp under windows accepts windows
+ style paths (default/else)
+ g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
+ =1 use WinNT/2K/XP's rcp, binary mode
+
+
+The script will also make use of the following variables internally, albeit
+temporarily.
+
+ g:netrw_method Index indicating rcp/ftp+.netrc/ftp
+ g:netrw_machine Holds machine name parsed from input
+ g:netrw_fname Holds filename being accessed
+
+ *netrw-protocol*
+>
+ ------------------------
+ Protocol Control Options
+ ------------------------
+ Option Type Setting Meaning ~
+ --------- -------- -------------- --------------------------- >
+ netrw_ftp variable =doesn't exist userid set by "user userid"
+ =0 userid set by "user userid"
+ =1 userid set by "userid"
+ NetReadFixup function =doesn't exist no change
+ =exists Allows user to have files
+ read via ftp automatically
+ transformed however they wish
+ by NetReadFixup()
+ g:netrw_dav_cmd variable ="cadaver"
+ g:netrw_fetch_cmd variable ="fetch -o"
+ g:netrw_ftp_cmd variable ="ftp"
+ g:netrw_http_cmd variable ="fetch -o" else if fetch is executable
+ g:netrw_http_cmd variable ="wget -O" if wget is executable
+ g:netrw_rcp_cmd variable ="rcp"
+ g:netrw_rsync_cmd variable ="rsync -a"
+ g:netrw_scp_cmd variable ="scp -q"
+ g:netrw_sftp_cmd variable ="sftp"
+<
+The first two options both help with certain ftp's that give trouble otherwise.
+In order to best understand how to use these options if ftp is giving you
+troubles, a bit of discussion follows on how netrw does ftp reads.
+
+The g:netrw_..._cmd variables specify the external program to use handle
+the associated protocol (rcp, ftp, etc), plus any options.
+
+Netrw typically builds up lines of one of the following formats in a
+temporary file:
+>
+ IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
+ ---------------------------------- ------------------------------
+ open machine [port] open machine [port]
+ user userid password userid password
+ [g:netrw_ftpmode] password
+ get filename tempfile [g:netrw_ftpmode]
+ get filename tempfile
+<
+Netrw then executes the lines above by use of a filter:
+>
+ :%! {g:netrw_ftp_cmd} -i [-n]
+<
+
+where
+ g:netrw_ftp_cmd is usually "ftp",
+ -i tells ftp not to be interactive
+ -n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
+
+If <.netrc> exists it will be used to avoid having to query the user for
+userid and password). The transferred file is put into a temporary file.
+The temporary file is then read into the main editing session window that
+requested it and the temporary file deleted.
+
+If your ftp doesn't accept the "user" command and immediately just demands
+a userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
+
+ *netrw-fixup*
+If your ftp for whatever reason generates unwanted lines (such as AUTH
+messages) you may write a NetReadFixup(tmpfile) function:
+>
+ function! NetReadFixup(method,line1,line2)
+ " a:line1: first new line in current file
+ " a:line2: last new line in current file
+ if a:method == 1 "rcp
+ elseif a:method == 2 "ftp + <.netrc>
+ elseif a:method == 3 "ftp + machine,uid,password,filename
+ elseif a:method == 4 "scp
+ elseif a:method == 5 "http/wget
+ elseif a:method == 6 "dav/cadaver
+ elseif a:method == 7 "rsync
+ elseif a:method == 8 "fetch
+ elseif a:method == 9 "sftp
+ else " complain
+ endif
+ endfunction
+>
+The NetReadFixup() function will be called if it exists and thus allows
+you to customize your reading process. As a further example, <netrw.vim>
+contains just such a function to handle Windows 95 ftp. For whatever
+reason, Windows 95's ftp dumps four blank lines at the end of a transfer,
+and so it is desirable to automate their removal. Here's some code taken
+from <netrw.vim> itself:
+>
+ if has("win95") && g:netrw_win95ftp
+ fu! NetReadFixup(method, line1, line2)
+ if method == 3 " ftp (no <.netrc>)
+ let fourblanklines= line2 - 3
+ silent fourblanklines.",".line2."g/^\s*/d"
+ endif
+ endfunction
+ endif
+>
+
+==============================================================================
+7. Debugging *netrw-debug*
+
+The <netrw.vim> script is typically available as:
+
+ /usr/local/share/vim/vim6x/plugin/netrw.vim
+
+which is loaded automatically at startup (assuming :set nocp).
+
+ 1. Get the <Decho.vim> script, available as:
+
+ http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
+ as "Decho, a vimL debugging aid"
+ or
+ http://vim.sourceforge.net/scripts/script.php?script_id=120
+
+ and put it into your local plugin directory
+
+ 2. Edit the <netrw.vim> file as follows:
+
+ :DechoOn
+
+ (to restore to normal, use :DechoOff )
+
+ 3. Then bring up vim and attempt a transfer. A set of messages
+ should appear concerning the steps that <netrw.vim> took in
+ attempting to read/write your file over the network. Please
+ send that information to <netrw.vim>'s maintainer,
+
+ drchipNOSPAM at campbellfamily.biz - NOSPAM
+
+==============================================================================
+8. New Stuff *netrw-new* *netrw-newstuff*
+
+ v43: * moved "Explanation" comments to <pi_netrw.txt> help file
+ as "Network Reference" (|netrw-ref|)
+ * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
+ * removed superfluous NetRestorePosn() calls
+ v42: * now does BufReadPre and BufReadPost events on file:///*
+ and file://localhost/*
+ v41: * installed file:///* and file://localhost/* handling
+ v40: * prevents redraw when a protocol error occurs so that the
+ user may see it
+ v39: * sftp support
+ v38: * Now uses NetRestorePosn() calls with Nread/Nwrite commands
+ * Temporary files now removed via bwipe! instead of bwipe
+ (thanks to Dave Roberts)
+ v37: * Claar's modifications which test if ftp is successful, otherwise
+ give an error message
+ * After a read, the alternate file was pointing to the temp file.
+ The temp file buffer is now wiped out.
+ * removed silent from transfer methods so user can see what's
+ happening
+
+
+==============================================================================
+9. Credits *netrw-credits*
+
+ Vim editor by Bram Moolenaar (Thanks, Bram!)
+ dav support by C Campbell
+ fetch support by Bram Moolenaar and C Campbell
+ ftp support by C Campbell <NdrOchip@ScampbellPfamily.AbizM> - NOSPAM
+ http support by Bram Moolenaar <bram@moolenaar.net>
+ rcp
+ rsync support by C Campbell (suggested by Erik Warendorph)
+ scp support by raf <raf@comdyn.com.au>
+ sftp support by C Campbell
+
+ inputsecret(), BufReadCmd, BufWriteCmd contributed by C Campbell
+
+ Jérôme Augé -- also using new buffer method with ftp+.netrc
+ Bram Moolenaar -- obviously vim itself, :e and v:cmdarg use, fetch,...
+ Yasuhiro Matsumoto -- pointing out undo+0r problem and a solution
+ Erik Warendorph -- for several suggestions (g:netrw_..._cmd
+ variables, rsync etc)
+ Doug Claar -- modifications to test for success with ftp operation
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt
new file mode 100644
index 000000000..a52984a58
--- /dev/null
+++ b/runtime/doc/pi_spec.txt
@@ -0,0 +1,111 @@
+*pi_spec.txt* For Vim version 7.0aa. Last change: 2002 Oct 29
+
+by Gustavo Niemeyer ~
+
+This is a filetype plugin to work with rpm spec files.
+
+Currently, this Vim plugin allows you to easily update the %changelog
+section in RPM spec files. It will even create a section for you if it
+doesn't exist yet. If you've already inserted an entry today, it will
+give you the opportunity to just add a new item in today's entry. If you
+don't provide a format string (|spec_chglog_format|), it'll ask you an
+email address and build a format string by itself.
+
+1. How to use it |spec-how-to-use-it|
+2. Customizing |spec-customizing|
+
+==============================================================================
+1. How to use it *spec-how-to-use-it*
+
+The spec_chglog plugin provides a map like the following:
+
+ :map <buffer> <LocalLeader>c <Plug>SpecChangelog
+
+It means that you may run the plugin inside a spec file by pressing
+your maplocalleader key (default is '\') plus 'c'. If you do not have
+|spec_chglog_format| set, the plugin will ask you for an email address
+to use in this edit session.
+
+Everytime you run the plugin, it will check to see if the last entry
+in the changelog has been written today and by you. If it's the entry
+mathes, it will just insert a new changelog item, otherwise it will
+create a new changelog entry. If you are running with
+|spec_chglog_release_info| enabled, it will also check if the name, version
+and release matches. The plugin is smart enough to ask you if it should
+update the package release, if you have not done so.
+
+Setting a map *spec-setting-a-map*
+-------------
+
+As you should know, you can easily set a map to access any Vim command (or
+anything, for that matter). If you don't like the default map of
+<LocalLeader>c, you may just set up your own key. The following line
+shows you how you could do this in your .vimrc file, mapping the plugin to
+the <F5> key:
+
+ au FileType spec map <buffer> <F5> <Plug>SpecChangelog
+
+Note: the plugin will respect your desire to change the default mapping
+ and won't set it.
+
+This command will add a map only in the spec file buffers.
+
+
+==============================================================================
+2. Customizing *spec-customizing*
+
+The format string *spec_chglog_format*
+-----------------
+
+You can easily customize how your spec file entry will look like. To do
+this just set the variable "spec_chglog_format" in your .vimrc file like
+this: >
+
+ let spec_chglog_format = "%a %b %d %Y My Name <my@email.com>"
+
+Note that "%a %b %d %Y" is the most used time format. If you don't provide
+a format string, when you run the SpecChangelog command for the first
+time, it will ask you an email address and build the |spec_chglog_format|
+variable for you. This way, you will only need to provide your email
+address once.
+
+To discover which format options you can use, take a look at the strftime()
+function man page.
+
+Where to insert new items *spec_chglog_prepend*
+-------------------------
+
+The plugin will usually insert new %changelog entry items (note that it's
+not the entry itself) after the existing ones. If you set the
+spec_chglog_prepend variable >
+
+ let spec_chglog_prepend = 1
+
+it will insert new items before the existing ones.
+
+Inserting release info *spec_chglog_release_info*
+----------------------
+
+If you want, the plugin may automatically insert release information
+on each changelog entry. One advantage of turning this feature on is
+that it may control if the release has been updated after the last
+change in the package or not. If you have not updated the package
+version or release, it will ask you if it should update the package
+release for you. To turn this feature on, just insert the following
+code in your .vimrc: >
+
+ let spec_chglog_release_info = 1
+
+Then, the first item in your changelog entry will be something like: >
+
+ + name-1.0-1cl
+
+If you don't like the release updating feature and don't want to answer
+"No" each time it detects an old release, you may disable it with >
+
+ let spec_chglog_never_increase_release = 1
+
+
+Good luck!!
+
+vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
new file mode 100644
index 000000000..1c35d685a
--- /dev/null
+++ b/runtime/doc/quickfix.txt
@@ -0,0 +1,1010 @@
+*quickfix.txt* For Vim version 7.0aa. Last change: 2004 May 20
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+This subject is introduced in section |30.1| of the user manual.
+
+1. Using QuickFix commands |quickfix|
+2. The error window |quickfix-window|
+3. Using more than one list of errors |quickfix-error-lists|
+4. Using :make |:make_makeprg|
+5. Using :grep |grep|
+6. Selecting a compiler |compiler-select|
+7. The error format |error-file-format|
+8. The directory stack |quickfix-directory-stack|
+9. Specific error file formats |errorformats|
+
+{Vi does not have any of these commands}
+
+The quickfix commands are not available when the |+quickfix| feature was
+disabled at compile time.
+
+=============================================================================
+1. Using QuickFix commands *quickfix* *Quickfix* *E42*
+
+Vim has a special mode to speedup the edit-compile-edit cycle. This is
+inspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
+The idea is to save the error messages from the compiler in a file and use Vim
+to jump to the errors one by one. You can examine each problem and fix it,
+without having to remember all the error messages.
+
+If you are using Manx's Aztec C compiler on the Amiga look here for how to use
+it with Vim: |quickfix-manx|. If you are using another compiler you should
+save the error messages in a file and start Vim with "vim -q filename". An
+easy way to do this is with the |:make| command (see below). The
+'errorformat' option should be set to match the error messages from your
+compiler (see |errorformat| below).
+
+The following quickfix commands can be used:
+
+ *:cc*
+:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
+ error is displayed again. Without [!] this doesn't
+ work when jumping to another buffer, the current buffer
+ has been changed, there is the only window for the
+ buffer and both 'hidden' and 'autowrite' are off.
+ When jumping to another buffer with [!] any changes to
+ the current buffer are lost, unless 'hidden' is set or
+ there is another window for this buffer.
+ The 'switchbuf' settings are respected when jumping
+ to a buffer.
+
+ *:cn* *:cnext* *E553*
+:[count]cn[ext][!] Display the [count] next error in the list that
+ includes a file name. If there are no file names at
+ all, go to the [count] next error. See |:cc| for
+ [!] and 'switchbuf'.
+
+:[count]cN[ext][!] *:cp* *:cprevious* *:cN* *:cNext*
+:[count]cp[revious][!] Display the [count] previous error in the list that
+ includes a file name. If there are no file names at
+ all, go to the [count] previous error. See |:cc| for
+ [!] and 'switchbuf'.
+
+ *:cnf* *:cnfile*
+:[count]cnf[ile][!] Display the first error in the [count] next file in
+ the list that includes a file name. If there are no
+ file names at all or if there is no next file, go to
+ the [count] next error. See |:cc| for [!] and
+ 'switchbuf'.
+
+:[count]cNf[ile][!] *:cpf* *:cpfile* *:cNf* *:cNfile*
+:[count]cpf[ile][!] Display the last error in the [count] previous file in
+ the list that includes a file name. If there are no
+ file names at all or if there is no next file, go to
+ the [count] previous error. See |:cc| for [!] and
+ 'switchbuf'.
+
+ *:crewind* *:cr*
+:cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
+ error is displayed. See |:cc|.
+
+ *:cfirst* *:cfir*
+:cfir[st][!] [nr] Same as ":crewind".
+
+ *:clast* *:cla*
+:cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
+ error is displayed. See |:cc|.
+
+ *:cq* *:cquit*
+:cq[uit] Quit Vim with an error code, so that the compiler
+ will not compile the same file again.
+
+ *:cf* *:cfile*
+:cf[ile][!] [errorfile] Read the error file and jump to the first error.
+ This is done automatically when Vim is started with
+ the -q option. You can use this command when you
+ keep Vim running while compiling. If you give the
+ name of the errorfile, the 'errorfile' option will
+ be set to [errorfile]. See |:cc| for [!].
+
+ *:cg* *:cgetfile*
+:cg[etfile][!] [errorfile]
+ Read the error file. Just like ":cfile" but don't
+ jump to the first error.
+
+ *:cl* *:clist*
+:cl[ist] [from] [, [to]]
+ List all errors that are valid |quickfix-valid|.
+ If numbers [from] and/or [to] are given, the respective
+ range of errors is listed. A negative number counts
+ from the last error backwards, -1 being the last error.
+ The 'switchbuf' settings are respected when jumping
+ to a buffer.
+
+:cl[ist]! [from] [, [to]]
+ List all errors.
+
+If you insert or delete lines, mostly the correct error location is still
+found because hidden marks are used. Sometimes, when the mark has been
+deleted for some reason, the message "line changed" is shown to warn you that
+the error location may not be correct. If you quit Vim and start again the
+marks are lost and the error locations may not be correct anymore.
+
+=============================================================================
+2. The error window *quickfix-window*
+
+ *:cope* *:copen*
+:cope[n] [height] Open a window to show the current list of errors.
+ When [height] is given, the window becomes that high
+ (if there is room). Otherwise the window is made ten
+ lines high.
+ The window will contain a special buffer, with
+ 'buftype' equal to "quickfix". Don't change this!
+ If there already is a quickfix window, it will be made
+ the current window. It is not possible to open a
+ second quickfix window.
+
+ *:ccl* *:cclose*
+:ccl[ose] Close the quickfix window.
+
+ *:cw* *:cwindow*
+:cw[indow] [height] Open the quickfix window when there are recognized
+ errors. If the window is already open and there are
+ no recognized errors, close the window.
+
+
+Normally the quickfix window is at the bottom of the screen. If there are
+vertical splits, it's at the bottom of the rightmost column of windows. To
+make it always occupy the full width: >
+ :botright cwindow
+You can move the window around with |window-moving| commands.
+For example, to move it to the top: CTRL-W K
+The 'winfixheight' option will be set, which means that the window will mostly
+keep its height, ignoring 'winheight' and 'equalalways'. You can change the
+height manually (e.g., by dragging the status line above it with the mouse).
+
+In the quickfix window, each line is one error. The line number is equal to
+the error number. You can use ":.cc" to jump to the error under the cursor.
+Hitting the <CR> key or double-clicking the mouse on a line has the same
+effect. The file containing the error is opened in the window above the
+quickfix window. If there already is a window for that file, it is used
+instead. If the buffer in the used window has changed, and the error is in
+another file, jumping to the error will fail. You will first have to make
+sure the window contains a buffer which can be abandoned.
+
+When the quickfix window has been filled, two autocommand events are
+triggered. First the 'filetype' option is set to "qf", which triggers the
+FileType event. Then the BufReadPost event is triggered. This can be used to
+perform some action on the listed errors. Example: >
+ au BufReadPost quickfix setlocal nomodifiable
+ \ | silent g/^/s//\=line(".")." "/
+ \ | setlocal modifiable
+This prepends the line number to each line. Note the use of "\=" in the
+substitute string of the ":s" command, which is used to evaluate an
+expression.
+
+Note: Making changes in the quickfix window has no effect on the list of
+errors. 'modifiable' is off to avoid making changes. If you delete or insert
+lines anyway, the relation between the text and the error number is messed up.
+If you really want to do this, you could write the contents of the quickfix
+window to a file and use ":cfile" to have it parsed and used as the new error
+list.
+
+=============================================================================
+3. Using more than one list of errors *quickfix-error-lists*
+
+So far has been assumed that there is only one list of errors. Actually the
+ten last used lists are remembered. When starting a new list, the previous
+ones are automatically kept. Two commands can be used to access older error
+lists. They set one of the existing error lists as the current one.
+
+ *:colder* *:col* *E380*
+:col[der] [count] Go to older error list. When [count] is given, do
+ this [count] times. When already at the oldest error
+ list, an error message is given.
+
+ *:cnewer* *:cnew* *E381*
+:cnew[er] [count] Go to newer error list. When [count] is given, do
+ this [count] times. When already at the newest error
+ list, an error message is given.
+
+When adding a new error list, it becomes the current list.
+
+When ":colder" has been used and ":make" or ":grep" is used to add a new error
+list, one newer list is overwritten. This is especially useful if you are
+browsing with ":grep" |grep|. If you want to keep the more recent error
+lists, use ":cnewer 99" first.
+
+=============================================================================
+4. Using :make *:make_makeprg*
+
+ *:mak* *:make*
+:mak[e][!] [arguments] 1. If the 'autowrite' option is on, write any changed
+ buffers
+ 2. An errorfile name is made from 'makeef'. If
+ 'makeef' doesn't contain "##", and a file with this
+ name already exists, it is deleted.
+ 3. The program given with the 'makeprg' option is
+ started (default "make") with the optional
+ [arguments] and the output is saved in the
+ errorfile (for Unix it is also echoed on the
+ screen).
+ 4. The errorfile is read using 'errorformat'.
+ 5. If [!] is not given the first error is jumped to.
+ 6. The errorfile is deleted.
+ 7. You can now move through the errors with commands
+ like |:cnext| and |:cprevious|, see above.
+ This command does not accept a comment, any "
+ characters are considered part of the arguments.
+
+The ":make" command executes the command given with the 'makeprg' option.
+This is done by passing the command to the shell given with the 'shell'
+option. This works almost like typing
+
+ ":!{makeprg} [arguments] {shellpipe} {errorfile}".
+
+{makeprg} is the string given with the 'makeprg' option. Any command can be
+used, not just "make". Characters '%' and '#' are expanded as usual on a
+command-line. You can use "%<" to insert the current file name without
+extension, or "#<" to insert the alternate file name without extension, for
+example: >
+ :set makeprg=make\ #<.o
+
+[arguments] is anything that is typed after ":make".
+{shellpipe} is the 'shellpipe' option.
+{errorfile} is the 'makeef' option, with ## replaced to make it unique.
+
+The placeholder "$*" can be used for the argument list in {makeprog} if the
+command needs some additional characters after its arguments. The $* is
+replaced then by all arguments. Example: >
+ :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
+or simpler >
+ :let &mp = 'latex \\nonstopmode \\input\{$*}'
+"$*" can be given multiple times, for example: >
+ :set makeprg=gcc\ -o\ $*\ $*
+
+The 'shellpipe' option defaults to ">" for the Amiga, MS-DOS and Win32. This
+means that the output of the compiler is saved in a file and not shown on the
+screen directly. For Unix "| tee" is used. The compiler output is shown on
+the screen and saved in a file the same time. Depending on the shell used
+"|& tee" or "2>&1| tee" is the default, so stderr output will be included.
+
+If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
+for compilers that write to an errorfile themselves (e.g., Manx's Amiga C).
+
+==============================================================================
+5. Using :grep *grep* *lid*
+
+Vim can interface with "grep" and grep-like programs (such as the GNU
+id-utils) in a similar way to its compiler integration (see |:make| above).
+
+[Unix trivia: The name for the Unix "grep" command comes from ":g/re/p", where
+"re" stands for Regular Expression.]
+
+ *:gr* *:grep*
+:gr[ep][!] [arguments] Just like ":make", but use 'grepprg' instead of
+ 'makeprg' and 'grepformat' instead of 'errorformat'.
+ *:grepa* *:grepadd*
+:grepa[dd][!] [arguments]
+ Just like ":grep", but instead of making a new list of
+ errors the matches are appended to the current list.
+ Example: >
+ :grep nothing %
+ :bufdo grepadd! something %
+< The first command makes a new error list which is
+ empty. The second command executes "grepadd" for each
+ listed buffer. Note the use of ! to avoid that
+ ":grepadd" jumps to the first error, which is not
+ allowed with |:bufdo|.
+
+5.1 Setting up grep
+
+If you have a standard "grep" program installed, the :grep command may work
+well with the defaults. The syntax is very similar to the standard command: >
+
+ :grep foo *.c
+
+Will search all files with the .c extension for the substring "foo". The
+arguments to :grep are passed straight to the "grep" program, so you can use
+whatever options your "grep" supports.
+
+By default, :grep invokes grep with the -n option (show file and line
+numbers). You can change this with the 'grepprg' option. You will need to set
+'grepprg' if:
+
+a) You are using a program that isn't called "grep"
+b) You have to call grep with a full path
+c) You want to pass other options automatically (e.g. case insensitive
+ search.)
+
+Once "grep" has executed, Vim parses the results using the 'grepformat'
+option. This option works in the same way as the 'errorformat' option - see
+that for details. You may need to change 'grepformat' from the default if
+your grep outputs in a non-standard format, or you are using some other
+program with a special format.
+
+Once the results are parsed, Vim loads the first file containing a match and
+jumps to the appropriate line, in the same way that it jumps to a compiler
+error in |quickfix| mode. You can then use the |:cnext|, |:clist|, etc.
+commands to see the other matches.
+
+
+5.2 Using :grep with id-utils
+
+You can set up :grep to work with the GNU id-utils like this: >
+
+ :set grepprg=lid\ -Rgrep\ -s
+ :set grepformat=%f:%l:%m
+
+then >
+ :grep (regexp)
+
+works just as you'd expect.
+(provided you remembered to mkid first :)
+
+
+5.3 Browsing source code with :grep
+
+Using the stack of error lists that Vim keeps, you can browse your files to
+look for functions and the functions they call. For example, suppose that you
+have to add an argument to the read_file() function. You enter this command: >
+
+ :grep read_file *.c
+
+You use ":cn" to go along the list of matches and add the argument. At one
+place you have to get the new argument from a higher level function msg(), and
+need to change that one too. Thus you use: >
+
+ :grep msg *.c
+
+While changing the msg() functions, you find another function that needs to
+get the argument from a higher level. You can again use ":grep" to find these
+functions. Once you are finished with one function, you can use >
+
+ :colder
+
+to go back to the previous one.
+
+This works like browsing a tree: ":grep" goes one level deeper, creating a
+list of branches. ":colder" goes back to the previous level. You can mix
+this use of ":grep" and "colder" to browse all the locations in a tree-like
+way. If you do this consistently, you will find all locations without the
+need to write down a "todo" list.
+
+=============================================================================
+6. Selecting a compiler *compiler-select*
+
+ *:comp* *:compiler* *E666*
+:comp[iler][!] {name} Set options to work with compiler {name}.
+ Without the "!" options are set for the
+ current buffer. With "!" global options are
+ set.
+ If you use ":compiler foo" in "file.foo" and
+ then ":compiler! bar" in another buffer, Vim
+ will keep on using "foo" in "file.foo".
+ {not available when compiled without the
+ |+eval| feature}
+
+
+The Vim plugins in the "compiler" directory will set options to use the
+selected compiler. For ":compiler" local options are set, for ":compiler!"
+global options.
+ *current_compiler*
+To support older Vim versions, the plugins always use "current_compiler" and
+not "b:current_compiler". What the command actually does is the following:
+
+- Delete the "current_compiler" and "b:current_compiler" variables.
+- Define the "CompilerSet" user command. With "!" it does ":set", without "!"
+ it does ":setlocal".
+- Execute ":runtime! compiler/{name}.vim". The plugins are expected to set
+ options with "CompilerSet" and set the "current_compiler" variable to the
+ name of the compiler.
+- Delete the "CompilerSet user command.
+- Set "b:current_compiler" to the value of "current_compiler".
+- Without "!" the old value of "current_compiler" is restored.
+
+
+For writing a compiler plugin, see |write-compiler-plugin|.
+
+
+MANX AZTEC C *quickfix-manx* *compiler-manx*
+
+To use Vim with Manx's Aztec C compiler on the Amiga you should do the
+following:
+- Set the CCEDIT environment variable with the command: >
+ mset "CCEDIT=vim -q"
+- Compile with the -qf option. If the compiler finds any errors, Vim is
+ started and the cursor is positioned on the first error. The error message
+ will be displayed on the last line. You can go to other errors with the
+ commands mentioned above. You can fix the errors and write the file(s).
+- If you exit Vim normally the compiler will re-compile the same file. If you
+ exit with the :cq command, the compiler will terminate. Do this if you
+ cannot fix the error, or if another file needs to be compiled first.
+
+There are some restrictions to the Quickfix mode on the Amiga. The
+compiler only writes the first 25 errors to the errorfile (Manx's
+documentation does not say how to get more). If you want to find the others,
+you will have to fix a few errors and exit the editor. After recompiling,
+up to 25 remaining errors will be found.
+
+If Vim was started from the compiler, the :sh and some :! commands will not
+work, because Vim is then running in the same process as the compiler and
+stdin (standard input) will not be interactive.
+
+
+PYUNIT COMPILER *compiler-pyunit*
+
+This is not actually a compiler, but a unit testing framework for the
+Python language. It is included into standard Python distribution
+starting from version 2.0. For older versions, you can get it from
+http://pyunit.sourceforge.net.
+
+When you run your tests with the help of the framework, possible errors
+are parsed by Vim and presented for you in quick-fix mode.
+
+Unfortunately, there is no standard way to run the tests.
+The alltests.py script seems to be used quite often, that's all.
+Useful values for the 'makeprg' options therefore are:
+ setlocal makeprg=./alltests.py " Run a testsuite
+ setlocal makeprg=python % " Run a single testcase
+
+Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
+
+
+TEX COMPILER *compiler-tex*
+
+Included in the distribution compiler for TeX ($VIMRUNTIME/compiler/tex.vim)
+uses make command if possible. If the compiler finds a file named "Makefile"
+or "makefile" in the current directory, it supposes that you want to process
+your *TeX files with make, and the makefile does the right work. In this case
+compiler sets 'errorformat' for *TeX output and leaves 'makeprg' untouched. If
+neither "Makefile" nor "makefile" is found, the compiler will not use make.
+You can force the compiler to ignore makefiles by defining
+b:tex_ignore_makefile or g:tex_ignore_makefile variable (they are checked for
+existence only).
+
+If the compiler chose not to use make, it need to choose a right program for
+processing your input. If b:tex_flavor or g:tex_flavor (in this precedence)
+variable exists, it defines TeX flavor for :make (actually, this is the name
+of executed command), and if both variables do not exist, it defaults to
+"latex". For example, while editing chapter2.tex \input-ed from mypaper.tex
+written in AMS-TeX: >
+
+ :let b:tex_flavor = 'amstex'
+ :compiler tex
+< [editing...] >
+ :make mypaper
+
+Note that you must specify a name of the file to process as an argument (to
+process the right file when editing \input-ed or \include-ed file; portable
+solution for substituting % for no arguments is welcome). This is not in the
+semantics of make, where you specify a target, not source, but you may specify
+filename without extension ".tex" and mean this as "make filename.dvi or
+filename.pdf or filename.some_result_extension according to compiler".
+
+Note: tex command line syntax is set to usable both for MikTeX (suggestion
+by Srinath Avadhanula) and teTeX (checked by Artem Chuprina). Suggestion
+from |errorformat-LaTeX| is too complex to keep it working for different
+shells and OSes and also does not allow to use other available TeX options,
+if any. If your TeX doesn't support "-interaction=nonstopmode", please
+report it with different means to express \nonstopmode from the command line.
+
+=============================================================================
+7. The error format *error-file-format*
+
+ *errorformat* *E372* *E373* *E374*
+ *E375* *E376* *E377* *E378*
+The 'errorformat' option specifies a list of formats that are recognized. The
+first format that matches with an error message is used. You can add several
+formats for different messages your compiler produces, or even entries for
+multiple compilers. See |efm-entries|.
+
+Each entry in 'errorformat' is a scanf-like string that describes the format.
+First, you need to know how scanf works. Look in the documentation of your
+C compiler. Below you find the % items that Vim understands. Others are
+invalid.
+
+Special characters in 'errorformat' are comma and backslash. See
+|efm-entries| for how to deal with them. Note that a literal "%" is matched
+by "%%", thus it is not escaped with a backslash.
+
+Note: By default the difference between upper and lowercase is ignored. If
+you want to match case, add "\C" to the pattern |/\C|.
+
+
+Basic items
+
+ %f file name (finds a string)
+ %l line number (finds a number)
+ %c column number (finds a number representing character
+ column of the error, (1 <tab> == 1 character column))
+ %v virtual column number (finds a number representing
+ screen column of the error (1 <tab> == 8 screen
+ columns)
+ %t error type (finds a single character)
+ %n error number (finds a number)
+ %m error message (finds a string)
+ %r matches the "rest" of a single-line file message %O/P/Q
+ %p pointer line (finds a sequence of '-', '.' or ' ' and
+ uses the length for the column number)
+ %*{conv} any scanf non-assignable conversion
+ %% the single '%' character
+
+The "%f" conversion depends on the current 'isfname' setting.
+
+The "%f" and "%m" conversions have to detect the end of the string. They
+should be followed by a character that cannot be in the string. Everything
+up to that character is included in the string. But when the next character
+is a '%' or a backslash, "%f" will look for any 'isfname' character and "%m"
+finds anything. If the "%f" or "%m" is at the end, everything up to the end
+of the line is included.
+
+On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
+when using "%f:". This means that a file name which is a single alphabetical
+letter will not be detected.
+
+The "%p" conversion is normally followed by a "^". It's used for compilers
+that output a line like: >
+ ^
+or >
+ ---------^
+to indicate the column of the error. This is to be used in a multi-line error
+message. See |errorformat-javac| for a useful example.
+
+
+Changing directory
+
+The following uppercase conversion characters specify the type of special
+format strings. At most one of them may be given as a prefix at the begin
+of a single comma-separated format pattern.
+Some compilers produce messages that consist of directory names that have to
+be prepended to each file name read by %f (example: GNU make). The following
+codes can be used to scan these directory names; they will be stored in an
+internal directory stack. *E379*
+ %D "enter directory" format string; expects a following
+ %f that finds the directory name
+ %X "leave directory" format string; expects following %f
+
+When defining an "enter directory" or "leave directory" format, the "%D" or
+"%X" has to be given at the start of that substring. Vim tracks the directory
+changes and prepends the current directory to each erroneous file found with a
+relative path. See |quickfix-directory-stack| for details, tips and
+limitations.
+
+
+Multi-line messages *errorformat-multi-line*
+
+It is possible to read the output of programs that produce multi-line
+messages, ie. error strings that consume more than one line. Possible
+prefixes are:
+ %E start of a multi-line error message
+ %W start of a multi-line warning message
+ %I start of a multi-line informational message
+ %A start of a multi-line message (unspecified type)
+ %C continuation of a multi-line message
+ %Z end of a multi-line message
+These can be used with '+' and '-', see |efm-ignore| below.
+
+Example: Your compiler happens to write out errors in the following format
+(leading line numbers not being part of the actual output):
+
+ 1 Error 275
+ 2 line 42
+ 3 column 3
+ 4 ' ' expected after '--'
+
+The appropriate error format string has to look like this: >
+ :set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
+
+And the |:clist| error message generated for this error is:
+
+ 1:42 col 3 error 275: ' ' expected after '--'
+
+Another example: Think of a Python interpreter that produces the following
+error message (line numbers are not part of the actual output):
+
+ 1 ==============================================================
+ 2 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)
+ 3 --------------------------------------------------------------
+ 4 Traceback (most recent call last):
+ 5 File "unittests/dbfacadeTest.py", line 89, in testFoo
+ 6 self.assertEquals(34, dtid)
+ 7 File "/usr/lib/python2.2/unittest.py", line 286, in
+ 8 failUnlessEqual
+ 9 raise self.failureException, \
+ 10 AssertionError: 34 != 33
+ 11
+ 12 --------------------------------------------------------------
+ 13 Ran 27 tests in 0.063s
+
+Say you want |:clist| write the relevant information of this message only,
+namely:
+ 5 unittests/dbfacadeTest.py:89: AssertionError: 34 != 33
+
+Then the error format string could be defined as follows: >
+ :set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
+
+Note that the %C string is given before the %A here: since the expression
+' %.%#' (which stands for the regular expression ' .*') matches every line
+starting with a space, followed by any characters to the end of the line,
+it also hides line 7 which would trigger a separate error message otherwise.
+Error format strings are always parsed pattern by pattern until the first
+match occurs.
+
+
+Separate file name *errorformat-separate-filename*
+
+These prefixes are useful if the file name is given once and multiple messages
+follow that refer to this file name.
+ %O single-line file message: overread the matched part
+ %P single-line file message: push file %f onto the stack
+ %Q single-line file message: pop the last file from stack
+
+Example: Given a compiler that produces the following error logfile (without
+leading line numbers):
+
+ 1 [a1.tt]
+ 2 (1,17) error: ';' missing
+ 3 (21,2) warning: variable 'z' not defined
+ 4 (67,3) error: end of file found before string ended
+ 5
+ 6 [a2.tt]
+ 7
+ 8 [a3.tt]
+ 9 NEW compiler v1.1
+ 10 (2,2) warning: variable 'x' not defined
+ 11 (67,3) warning: 's' already defined
+
+This logfile lists several messages for each file enclosed in [...] which are
+properly parsed by an error format like this: >
+ :set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q
+
+A call of |:clist| writes them accordingly with their correct filenames:
+
+ 2 a1.tt:1 col 17 error: ';' missing
+ 3 a1.tt:21 col 2 warning: variable 'z' not defined
+ 4 a1.tt:67 col 3 error: end of file found before string ended
+ 8 a3.tt:2 col 2 warning: variable 'x' not defined
+ 9 a3.tt:67 col 3 warning: 's' already defined
+
+Unlike the other prefixes that all match against whole lines, %P, %Q and %O
+can be used to match several patterns in the same line. Thus it is possible
+to parse even nested files like in the following line:
+ {"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}}
+The %O then parses over strings that do not contain any push/pop file name
+information. See |errorformat-LaTeX| for an extended example.
+
+
+Ignoring and using whole messages *efm-ignore*
+
+The codes '+' or '-' can be combined with the uppercase codes above; in that
+case they have to precede the letter, eg. '%+A' or '%-G':
+ %- do not include the matching multi-line in any output
+ %+ include the whole matching line in the %m error string
+
+One prefix is only useful in combination with '+' or '-', namely %G. It parses
+over lines containing general information like compiler version strings or
+other headers that can be skipped.
+ %-G ignore this message
+ %+G general message
+
+
+Pattern matching
+
+The scanf()-like "%*[]" notation is supported for backward-compatibility
+with previous versions of Vim. However, it is also possible to specify
+(nearly) any Vim supported regular expression in format strings.
+Since meta characters of the regular expression language can be part of
+ordinary matching strings or file names (and therefore internally have to
+be escaped), meta symbols have to be written with leading '%':
+ %\ the single '\' character. Note that this has to be
+ escaped ("%\\") in ":set errorformat=" definitions.
+ %. the single '.' character.
+ %# the single '*'(!) character.
+ %^ the single '^' character.
+ %$ the single '$' character.
+ %[ the single '[' character for a [] character range.
+ %~ the single '~' character.
+When using character classes in expressions (see |/\i| for an overview),
+terms containing the "\+" quantifier can be written in the scanf() "%*"
+notation. Example: "%\\d%\\+" ("\d\+", "any number") is equivalent to "%*\\d".
+Important note: The \(...\) grouping of sub-matches can not be used in format
+specifications because it is reserved for internal conversions.
+
+
+Multiple entries in 'errorformat' *efm-entries*
+
+To be able to detect output from several compilers, several format patterns
+may be put in 'errorformat', separated by commas (note: blanks after the comma
+are ignored). The first pattern that has a complete match is used. If no
+match is found, matching parts from the last one will be used, although the
+file name is removed and the error message is set to the whole message. If
+there is a pattern that may match output from several compilers (but not in a
+right way), put it after one that is more restrictive.
+
+To include a comma in a pattern precede it with a backslash (you have to type
+two in a ":set" command). To include a backslash itself give two backslashes
+(you have to type four in a ":set" command). You also need to put a backslash
+before a space for ":set".
+
+
+Valid matches *quickfix-valid*
+
+If a line does not completely match one of the entries in 'errorformat', the
+whole line is put in the error message and the entry is marked "not valid"
+These lines are skipped with the ":cn" and ":cp" commands (unless there is
+no valid line at all). You can use ":cl!" to display all the error messages.
+
+If the error format does not contain a file name Vim cannot switch to the
+correct file. You will have to do this by hand.
+
+
+Examples
+
+The format of the file from the Amiga Aztec compiler is:
+
+ filename>linenumber:columnnumber:errortype:errornumber:errormessage
+
+ filename name of the file in which the error was detected
+ linenumber line number where the error was detected
+ columnnumber column number where the error was detected
+ errortype type of the error, normally a single 'E' or 'W'
+ errornumber number of the error (for lookup in the manual)
+ errormessage description of the error
+
+This can be matched with this 'errorformat' entry:
+ %f>%l:%c:%t:%n:%m
+
+Some examples for C compilers that produce single-line error outputs:
+%f:%l:\ %t%*[^0123456789]%n:\ %m for Manx/Aztec C error messages
+ (scanf() doesn't understand [0-9])
+%f\ %l\ %t%*[^0-9]%n:\ %m for SAS C
+\"%f\"\\,%*[^0-9]%l:\ %m for generic C compilers
+%f:%l:\ %m for GCC
+%f:%l:\ %m,%Dgmake[%*\\d]:\ Entering\ directory\ `%f',
+%Dgmake[%*\\d]:\ Leaving\ directory\ `%f'
+ for GCC with gmake (concat the lines!)
+%f(%l)\ :\ %*[^:]:\ %m old SCO C compiler (pre-OS5)
+%f(%l)\ :\ %t%*[^0-9]%n:\ %m idem, with error type and number
+%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
+ for GCC, with some extras
+
+Extended examples for the handling of multi-line messages are given below,
+see |errorformat-Jikes| and |errorformat-LaTeX|.
+
+Note the backslash in front of a space and double quote. It is required for
+the :set command. There are two backslashes in front of a comma, one for the
+:set command and one to avoid recognizing the comma as a separator of error
+formats.
+
+
+Filtering messages
+
+If you have a compiler that produces error messages that do not fit in the
+format string, you could write a program that translates the error messages
+into this format. You can use this program with the ":make" command by
+changing the 'makeprg' option. For example: >
+ :set mp=make\ \\\|&\ error_filter
+The backslashes before the pipe character are required to avoid it to be
+recognized as a command separator. The backslash before each space is
+required for the set command.
+
+=============================================================================
+8. The directory stack *quickfix-directory-stack*
+
+Quickfix maintains a stack for saving all used directories parsed from the
+make output. For GNU-make this is rather simple, as it always prints the
+absolute path of all directories it enters and leaves. Regardless if this is
+done via a 'cd' command in the makefile or with the parameter "-C dir" (change
+to directory before reading the makefile). It may be useful to use the switch
+"-w" to force GNU-make to print out the working directory before and after
+processing.
+
+Maintaining the correct directory is more complicated if you don't use
+GNU-make. AIX-make for example doesn't print any information about its working
+directory. Then you need to enhance the makefile. In the makefile of lesstiff
+there is a command which echoes "Making {target} in {dir}". The special
+problem here is that it doesn't print informations on leaving the directory
+and that it doesn't print the absolute path.
+
+To solve the problem with relative paths and missing "leave directory"
+messages Vim uses following algorithm:
+
+1) Check if the given directory is a subdirectory of the current directory.
+ If this is true, store it as the current directory.
+2) If it is not a subdir of the current directory, try if this is a
+ subdirectory of one of the upper directories.
+3) If the directory still isn't found, it is assumed to be a subdirectory
+ of Vim's current directory.
+
+Additionally it is checked for every file, if it really exists in the
+identified directory. If not, it is searched in all other directories of the
+directory stack (NOT the directory subtree!). If it is still not found, it is
+assumed that it is in Vim's current directory.
+
+There are limitation in this algorithm. This examples assume that make just
+prints information about entering a directory in the form "Making all in dir".
+
+1) Assume you have following directories and files:
+ ./dir1
+ ./dir1/file1.c
+ ./file1.c
+
+ If make processes the directory "./dir1" before the current directory and
+ there is an error in the file "./file1.c", you will end up with the file
+ "./dir1/file.c" loaded by Vim.
+
+ This can only be solved with a "leave directory" message.
+
+2) Assume you have following directories and files:
+ ./dir1
+ ./dir1/dir2
+ ./dir2
+
+ You get the following:
+
+ Make output Directory interpreted by Vim
+ ------------------------ ----------------------------
+ Making all in dir1 ./dir1
+ Making all in dir2 ./dir1/dir2
+ Making all in dir2 ./dir1/dir2
+
+ This can be solved by printing absolute directories in the "enter directory"
+ message or by printing "leave directory" messages..
+
+To avoid this problems, ensure to print absolute directory names and "leave
+directory" messages.
+
+Examples for Makefiles:
+
+Unix:
+ libs:
+ for dn in $(LIBDIRS); do \
+ (cd $$dn; echo "Entering dir '$$(pwd)'"; make); \
+ echo "Leaving dir"; \
+ done
+
+Add
+ %DEntering\ dir\ '%f',%XLeaving\ dir
+to your 'errorformat' to handle the above output.
+
+Note that Vim doesn't check if the directory name in a "leave directory"
+messages is the current directory. This is why you could just use the message
+"Leaving dir".
+
+=============================================================================
+9. Specific error file formats *errorformats*
+
+ *errorformat-Jikes*
+Jikes(TM), a source-to-bytecode Java compiler published by IBM Research,
+produces simple multi-line error messages.
+
+An 'errorformat' string matching the produced messages is shown below.
+The following lines can be placed in the user's |vimrc| to overwrite Vim's
+recognized default formats, or see |:set+=| how to install this format
+additionally to the default. >
+
+ :set efm=%A%f:%l:%c:%*\\d:%*\\d:,
+ \%C%*\\s%trror:%m,
+ \%+C%*[^:]%trror:%m,
+ \%C%*\\s%tarning:%m,
+ \%C%m
+<
+Jikes(TM) produces a single-line error message when invoked with the option
+"+E", and can be matched with the following: >
+
+ :set efm=%f:%l:%v:%*\\d:%*\\d:%*\\s%m
+<
+ *errorformat-javac*
+This 'errorformat' has been reported to work well for javac, which outputs a
+line with "^" to indicate the column of the error: >
+ :set efm=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
+or: >
+ :set efm=%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#
+<
+ *errorformat-ant*
+For ant (http://jakarta.apache.org/) the above errorformat has to be modified
+to honour the leading [javac] in front of each javac output line: >
+ :set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
+
+The 'errorformat' can also be configured to handle ant together with either
+javac or jikes. If you're using jikes, you should tell ant to use jikes' +E
+command line switch which forces jikes to generate one-line error messages.
+This is what the second line (of a build.xml file) below does: >
+ <property name = "build.compiler" value = "jikes"/>
+ <property name = "build.compiler.emacs" value = "true"/>
+
+The 'errorformat' which handles ant with both javac and jikes is: >
+ :set efm=\ %#[javac]\ %#%f:%l:%c:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
+ \%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
+<
+ *errorformat-jade*
+parsing jade (see http://www.jclark.com/) errors is simple: >
+ :set efm=jade:%f:%l:%c:%t:%m
+<
+ *errorformat-LaTeX*
+The following is an example how an 'errorformat' string can be specified
+for the (La)TeX typesetting system which displays error messages over
+multiple lines. The output of ":clist" and ":cc" etc. commands displays
+multi-lines in a single line, leading white space is removed.
+It should be easy to adopt the above LaTeX errorformat to any compiler output
+consisting of multi-line errors.
+
+The commands can be placed in a |vimrc| file or some other Vim script file,
+eg. a script containing LaTeX related stuff which is loaded only when editing
+LaTeX sources.
+Make sure to copy all lines of the example (in the given order), afterwards
+remove the comment lines. For the '\' notation at the start of some lines see
+|line-continuation|.
+
+ First prepare 'makeprg' such that LaTeX will report multiple
+ errors; do not stop when the first error has occurred: >
+ :set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
+<
+ Start of multi-line error messages: >
+ :set efm=%E!\ LaTeX\ %trror:\ %m,
+ \%E!\ %m,
+< Start of multi-line warning messages; the first two also
+ include the line number. Meaning of some regular expressions:
+ - "%.%#" (".*") matches a (possibly empty) string
+ - "%*\\d" ("\d\+") matches a number >
+ \%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
+ \%+W%.%#\ at\ lines\ %l--%*\\d,
+ \%WLaTeX\ %.%#Warning:\ %m,
+< Possible continuations of error/warning messages; the first
+ one also includes the line number: >
+ \%Cl.%l\ %m,
+ \%+C\ \ %m.,
+ \%+C%.%#-%.%#,
+ \%+C%.%#[]%.%#,
+ \%+C[]%.%#,
+ \%+C%.%#%[{}\\]%.%#,
+ \%+C<%.%#>%.%#,
+ \%C\ \ %m,
+< Lines that match the following patterns do not contain any
+ important information; do not include them in messages: >
+ \%-GSee\ the\ LaTeX%m,
+ \%-GType\ \ H\ <return>%m,
+ \%-G\ ...%.%#,
+ \%-G%.%#\ (C)\ %.%#,
+ \%-G(see\ the\ transcript%.%#),
+< Generally exclude any empty or whitespace-only line from
+ being displayed: >
+ \%-G\\s%#,
+< The LaTeX output log does not specify the names of erroneous
+ source files per line; rather they are given globally,
+ enclosed in parentheses.
+ The following patterns try to match these names and store
+ them in an internal stack. The patterns possibly scan over
+ the same input line (one after another), the trailing "%r"
+ conversion indicates the "rest" of the line that will be
+ parsed in the next go until the end of line is reached.
+
+ Overread a file name enclosed in '('...')'; do not push it
+ on a stack since the file apparently does not contain any
+ error: >
+ \%+O(%f)%r,
+< Push a file name onto the stack. The name is given after '(': >
+ \%+P(%f%r,
+ \%+P\ %\\=(%f%r,
+ \%+P%*[^()](%f%r,
+ \%+P[%\\d%[^()]%#(%f%r,
+< Pop the last stored file name when a ')' is scanned: >
+ \%+Q)%r,
+ \%+Q%*[^()])%r,
+ \%+Q[%\\d%*[^()])%r
+
+Note that in some cases file names in the LaTeX output log cannot be parsed
+properly. The parser might have been messed up by unbalanced parentheses
+then. The above example tries to catch the most relevant cases only.
+You can customize the given setting to suit your own purposes, for example,
+all the annoying "Overfull ..." warnings could be excluded from being
+recognized as an error.
+Alternatively to filtering the LaTeX compiler output, it is also possible
+to directly read the *.log file that is produced by the [La]TeX compiler.
+This contains even more useful information about possible error causes.
+However, to properly parse such a complex file, an external filter should
+be used. See the description further above how to make such a filter known
+by Vim.
+
+ *errorformat-Perl*
+In $VIMRUNTIME/tools you can find the efm_perl.pl script, which filters Perl
+error messages into a format that quickfix mode will understand. See the
+start of the file about how to use it.
+
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
new file mode 100644
index 000000000..e18827f2d
--- /dev/null
+++ b/runtime/doc/quickref.txt
@@ -0,0 +1,1325 @@
+*quickref.txt* For Vim version 7.0aa. Last change: 2004 May 05
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+ Quick reference guide
+
+ *quickref* *Contents*
+ tag subject tag subject ~
+|Q_ct| list of help files |Q_re| Repeating commands
+|Q_lr| motion: Left-right |Q_km| Key mapping
+|Q_ud| motion: Up-down |Q_ab| Abbreviations
+|Q_tm| motion: Text object |Q_op| Options
+|Q_pa| motion: Pattern searches |Q_ur| Undo/Redo commands
+|Q_ma| motion: Marks |Q_et| External commands
+|Q_vm| motion: Various |Q_qf| Quickfix commands
+|Q_ta| motion: Using tags |Q_vc| Various commands
+|Q_sc| Scrolling |Q_ce| Ex: Command-line editing
+|Q_in| insert: Inserting text |Q_ra| Ex: Ranges
+|Q_ai| insert: Keys |Q_ex| Ex: Special characters
+|Q_ss| insert: Special keys |Q_ed| Editing a file
+|Q_di| insert: Digraphs |Q_fl| Using the argument list
+|Q_si| insert: Special inserts |Q_wq| Writing and quitting
+|Q_de| change: Deleting text |Q_st| Starting VIM
+|Q_cm| change: Copying and moving |Q_ac| Automatic commands
+|Q_ch| change: Changing text |Q_wi| Multi-window commands
+|Q_co| change: Complex |Q_bu| Buffer list commands
+|Q_vi| Visual mode |Q_sy| Syntax highlighting
+|Q_to| Text objects |Q_gu| GUI commands
+ |Q_fo| Folding
+
+------------------------------------------------------------------------------
+N is used to indicate an optional count that can be given before the command.
+------------------------------------------------------------------------------
+*Q_lr* Left-right motions
+
+|h| N h left (also: CTRL-H, <BS>, or <Left> key)
+|l| N l right (also: <Space> or <Right> key)
+|0| 0 to first character in the line (also: <Home> key)
+|^| ^ to first non-blank character in the line
+|$| N $ to the last character in the line (N-1 lines lower)
+ (also: <End> key)
+|g0| N g0 to first character in screen line (differs from "0"
+ when lines wrap)
+|g^| N g^ to first non-blank character in screen line (differs
+ from "^" when lines wrap)
+|g$| N g$ to last character in screen line (differs from "$"
+ when lines wrap)
+|gm| N gm to middle of the screen line
+|bar| N | to column N (default: 1)
+|f| N f{char} to the Nth occurrence of {char} to the right
+|F| N F{char} to the Nth occurrence of {char} to the left
+|t| N t{char} till before the Nth occurrence of {char} to the right
+|T| N T{char} till before the Nth occurrence of {char} to the left
+|;| N ; repeat the last "f", "F", "t", or "T" N times
+|,| N , repeat the last "f", "F", "t", or "T" N times in
+ opposite direction
+------------------------------------------------------------------------------
+*Q_ud* Up-down motions
+
+|k| N k up N lines (also: CTRL-P and <Up>)
+|j| N j down N lines (also: CTRL-J, CTRL-N, <NL>, and <Down>)
+|-| N - up N lines, on the first non-blank character
+|+| N + down N lines, on the first non-blank character (also:
+ CTRL-M and <CR>)
+|_| N _ down N-1 lines, on the first non-blank character
+|G| N G goto line N (default: last line), on the first
+ non-blank character
+|gg| N gg goto line N (default: first line), on the first
+ non-blank character
+|N%| N % goto line N percentage down in the file. N must be
+ given, otherwise it is the |%| command.
+|gk| N gk up N screen lines (differs from "k" when line wraps)
+|gj| N gj down N screen lines (differs from "j" when line wraps)
+------------------------------------------------------------------------------
+*Q_tm* Text object motions
+
+|w| N w N words forward
+|W| N W N blank-separated |WORD|s forward
+|e| N e forward to the end of the Nth word
+|E| N E forward to the end of the Nth blank-separated |WORD|
+|b| N b N words backward
+|B| N B N blank-separated |WORD|s backward
+|ge| N ge backward to the end of the Nth word
+|gE| N gE backward to the end of the Nth blank-separated |WORD|
+
+|)| N ) N sentences forward
+|(| N ( N sentences backward
+|}| N } N paragraphs forward
+|{| N { N paragraphs backward
+|]]| N ]] N sections forward, at start of section
+|[[| N [[ N sections backward, at start of section
+|][| N ][ N sections forward, at end of section
+|[]| N [] N sections backward, at end of section
+|[(| N [( N times back to unclosed '('
+|[{| N [{ N times back to unclosed '{'
+|[m| N [m N times back to start of method (for Java)
+|[M| N [M N times back to end of method (for Java)
+|])| N ]) N times forward to unclosed ')'
+|]}| N ]} N times forward to unclosed '}'
+|]m| N ]m N times forward to start of method (for Java)
+|]M| N ]M N times forward to end of method (for Java)
+|[#| N [# N times back to unclosed "#if" or "#else"
+|]#| N ]# N times forward to unclosed "#else" or "#endif"
+|[star| N [* N times back to start of comment "/*"
+|]star| N ]* N times forward to end of comment "*/"
+------------------------------------------------------------------------------
+*Q_pa* Pattern searches
+
+|/| N /{pattern}[/[offset]]<CR>
+ search forward for the Nth occurrence of {pattern}
+|?| N ?{pattern}[?[offset]]<CR>
+ search backward for the Nth occurrence of {pattern}
+|/<CR>| N /<CR> repeat last search, in the forward direction
+|?<CR>| N ?<CR> repeat last search, in the backward direction
+|n| N n repeat last search
+|N| N N repeat last search, in opposite direction
+|star| N * search forward for the identifier under the cursor
+|#| N # search backward for the identifier under the cursor
+|gstar| N g* like "*", but also find partial matches
+|g#| N g# like "#", but also find partial matches
+|gd| gd goto local declaration of identifier under the cursor
+|gD| gD goto global declaration of identifier under the cursor
+
+|pattern| Special characters in search patterns
+
+ meaning magic nomagic ~
+ matches any single character . \.
+ matches start of line ^ ^
+ matches <EOL> $ $
+ matches start of word \< \<
+ matches end of word \> \>
+ matches a single char from the range [a-z] \[a-z]
+ matches a single char not in the range [^a-z] \[^a-z]
+ matches an identifier char \i \i
+ idem but excluding digits \I \I
+ matches a keyword character \k \k
+ idem but excluding digits \K \K
+ matches a file name character \f \f
+ idem but excluding digits \F \F
+ matches a printable character \p \p
+ idem but excluding digits \P \P
+ matches a white space character \s \s
+ matches a non-white space character \S \S
+
+ matches <Esc> \e \e
+ matches <Tab> \t \t
+ matches <CR> \r \r
+ matches <BS> \b \b
+
+ matches 0 or more of the preceding atom * \*
+ matches 1 or more of the preceding atom \+ \+
+ matches 0 or 1 of the preceding atom \= \=
+ matches 2 to 5 of the preceding atom \{2,5} \{2,5}
+ separates two alternatives \| \|
+ group a pattern into an atom \(\) \(\)
+
+|search-offset| Offsets allowed after search command
+
+ [num] [num] lines downwards, in column 1
+ +[num] [num] lines downwards, in column 1
+ -[num] [num] lines upwards, in column 1
+ e[+num] [num] characters to the right of the end of the match
+ e[-num] [num] characters to the left of the end of the match
+ s[+num] [num] characters to the right of the start of the match
+ s[-num] [num] characters to the left of the start of the match
+ b[+num] [num] identical to s[+num] above (mnemonic: begin)
+ b[-num] [num] identical to s[-num] above (mnemonic: begin)
+ ;{search-command} execute {search-command} next
+------------------------------------------------------------------------------
+*Q_ma* Marks and motions
+
+|m| m{a-zA-Z} mark current position with mark {a-zA-Z}
+|`a| `{a-z} go to mark {a-z} within current file
+|`A| `{A-Z} go to mark {A-Z} in any file
+|`0| `{0-9} go to the position where Vim was previously exited
+|``| `` go to the position before the last jump
+|`quote| `" go to the position when last editing this file
+|`[| `[ go to the start of the previously operated or put text
+|`]| `] go to the end of the previously operated or put text
+|`<| `< go to the start of the (previous) Visual area
+|`>| `> go to the end of the (previous) Visual area
+|`.| `. go to the position of the last change in this file
+|'| '{a-zA-Z0-9[]'"<>.}
+ same as `, but on the first non-blank in the line
+|:marks| :marks print the active marks
+|CTRL-O| N CTRL-O go to Nth older position in jump list
+|CTRL-I| N CTRL-I go to Nth newer position in jump list
+|:ju| :ju[mps] print the jump list
+------------------------------------------------------------------------------
+*Q_vm* Various motions
+
+|%| % find the next brace, bracket, comment, or "#if"/
+ "#else"/"#endif" in this line and go to its match
+|H| N H go to the Nth line in the window, on the first
+ non-blank
+|M| M go to the middle line in the window, on the first
+ non-blank
+|L| N L go to the Nth line from the bottom, on the first
+ non-blank
+
+|go| N go go to Nth byte in the buffer
+|:go| :[range]go[to] [off] go to [off] byte in the buffer
+------------------------------------------------------------------------------
+*Q_ta* Using tags
+
+|:ta| :ta[g][!] {tag} Jump to tag {tag}
+|:ta| :[count]ta[g][!] Jump to [count]'th newer tag in tag list
+|CTRL-]| CTRL-] Jump to the tag under cursor, unless changes
+ have been made
+|:ts| :ts[elect][!] [tag] List matching tags and select one to jump to
+|:tjump| :tj[ump][!] [tag] Jump to tag [tag] or select from list when
+ there are multiple matches
+
+|:tags| :tags Print tag list
+|CTRL-T| N CTRL-T Jump back from Nth older tag in tag list
+|:po| :[count]po[p][!] Jump back from [count]'th older tag in tag list
+|:tnext| :[count]tn[ext][!] Jump to [count]'th next matching tag
+|:tp| :[count]tp[revious][!] Jump to [count]'th previous matching tag
+|:tr| :[count]tr[ewind][!] Jump to [count]'th matching tag
+|:tl| :tl[ast][!] Jump to last matching tag
+
+|:ptag| :pt[ag] {tag} open a preview window to show tag {tag}
+|CTRL-W_}| CTRL-W } like CTRL-] but show tag in preview window
+|:pts| :pts[elect] like ":tselect" but show tag in preview window
+|:ptjump| :ptj[ump] like ":tjump" but show tag in preview window
+|:pclose| :pc[lose] close tag preview window
+|CTRL-W_z| CTRL-W z close tag preview window
+------------------------------------------------------------------------------
+*Q_sc* Scrolling
+
+|CTRL-E| N CTRL-E window N lines downwards (default: 1)
+|CTRL-D| N CTRL-D window N lines Downwards (default: 1/2 window)
+|CTRL-F| N CTRL-F window N pages Forwards (downwards)
+|CTRL-Y| N CTRL-Y window N lines upwards (default: 1)
+|CTRL-U| N CTRL-U window N lines Upwards (default: 1/2 window)
+|CTRL-B| N CTRL-B window N pages Backwards (upwards)
+|z<CR>| z<CR> or zt redraw, current line at top of window
+|z.| z. or zz redraw, current line at center of window
+|z-| z- or zb redraw, current line at bottom of window
+
+These only work when 'wrap' is off:
+|zh| N zh scroll screen N characters to the right
+|zl| N zl scroll screen N characters to the left
+|zH| N zH scroll screen half a screenwidth to the right
+|zL| N zL scroll screen half a screenwidth to the left
+------------------------------------------------------------------------------
+*Q_in* Inserting text
+
+|a| N a append text after the cursor (N times)
+|A| N A append text at the end of the line (N times)
+|i| N i insert text before the cursor (N times) (also: <Insert>)
+|I| N I insert text before the first non-blank in the line (N times)
+|gI| N gI insert text in column 1 (N times)
+|o| N o open a new line below the current line, append text (N times)
+|O| N O open a new line above the current line, append text (N times)
+|:startinsert| :star[tinsert][!] start Insert mode, append when [!] used
+
+in Visual block mode:
+|v_b_I| I insert the same text in front of all the selected lines
+|v_b_A| A append the same text after all the selected lines
+------------------------------------------------------------------------------
+*Q_ai* Insert mode keys
+
+|insert-index| alphabetical index of Insert mode commands
+
+leaving Insert mode:
+|i_<Esc>| <Esc> end Insert mode, back to Normal mode
+|i_CTRL-C| CTRL-C like <Esc>, but do not use an abbreviation
+|i_CTRL-O| CTRL-O {command} execute {command} and return to Insert mode
+
+moving around:
+|i_<Up>| cursor keys move cursor left/right/up/down
+|i_<S-Left>| shift-left/right one word left/right
+|i_<S-Up>| shift-up/down one screenful backward/forward
+|i_<End>| <End> cursor after last character in the line
+|i_<Home>| <Home> cursor to first character in the line
+------------------------------------------------------------------------------
+*Q_ss* Special keys in Insert mode
+
+|i_CTRL-V| CTRL-V {char}.. insert character literally, or enter decimal
+ byte value
+|i_<NL>| <NL> or <CR> or CTRL-M or CTRL-J
+ begin new line
+|i_CTRL-E| CTRL-E insert the character from below the cursor
+|i_CTRL-Y| CTRL-Y insert the character from above the cursor
+
+|i_CTRL-A| CTRL-A insert previously inserted text
+|i_CTRL-@| CTRL-@ insert previously inserted text and stop
+ Insert mode
+|i_CTRL-R| CTRL-R {0-9a-z%#:.-="} insert the contents of a register
+
+|i_CTRL-N| CTRL-N insert next match of identifier before the
+ cursor
+|i_CTRL-P| CTRL-P insert previous match of identifier before
+ the cursor
+|i_CTRL-X| CTRL-X ... complete the word before the cursor in
+ various ways
+
+|i_<BS>| <BS> or CTRL-H delete the character before the cursor
+|i_<Del>| <Del> delete the character under the cursor
+|i_CTRL-W| CTRL-W delete word before the cursor
+|i_CTRL-U| CTRL-U delete all entered characters in the current
+ line
+|i_CTRL-T| CTRL-T insert one shiftwidth of indent in front of
+ the current line
+|i_CTRL-D| CTRL-D delete one shiftwidth of indent in front of
+ the current line
+|i_0_CTRL-D| 0 CTRL-D delete all indent in the current line
+|i_^_CTRL-D| ^ CTRL-D delete all indent in the current line,
+ restore indent in next line
+------------------------------------------------------------------------------
+*Q_di* Digraphs
+
+|:dig| :dig[raphs] show current list of digraphs
+|:dig| :dig[raphs] {char1}{char2} {number} ...
+ add digraph(s) to the list
+
+In Insert or Command-line mode:
+|i_CTRL-K| CTRL-K {char1} {char2}
+ enter digraph
+|i_digraph| {char1} <BS> {char2}
+ enter digraph if 'digraph' option set
+------------------------------------------------------------------------------
+*Q_si* Special inserts
+
+|:r| :r [file] insert the contents of [file] below the cursor
+|:r!| :r! {command} insert the standard output of {command} below the
+ cursor
+------------------------------------------------------------------------------
+*Q_de* Deleting text
+
+|x| N x delete N characters under and after the cursor
+|<Del>| N <Del> delete N characters under and after the cursor
+|X| N X delete N characters before the cursor
+|d| N d{motion} delete the text that is moved over with {motion}
+|v_d| {visual}d delete the highlighted text
+|dd| N dd delete N lines
+|D| N D delete to the end of the line (and N-1 more lines)
+|J| N J join N-1 lines (delete <EOL>s)
+|v_J| {visual}J join the highlighted lines
+|gJ| N gJ like "J", but without inserting spaces
+|v_gJ| {visual}gJ like "{visual}J", but without inserting spaces
+|:d| :[range]d [x] delete [range] lines [into register x]
+------------------------------------------------------------------------------
+*Q_cm* Copying and moving text
+
+|quote| "{char} use register {char} for the next delete, yank, or put
+|:reg| :reg show the contents of all registers
+|:reg| :reg {arg} show the contents of registers mentioned in {arg}
+|y| N y{motion} yank the text moved over with {motion} into a register
+|v_y| {visual}y yank the highlighted text into a register
+|yy| N yy yank N lines into a register
+|Y| N Y yank N lines into a register
+|p| N p put a register after the cursor position (N times)
+|P| N P put a register before the cursor position (N times)
+|]p| N ]p like p, but adjust indent to current line
+|[p| N [p like P, but adjust indent to current line
+|gp| N gp like p, but leave cursor after the new text
+|gP| N gP like P, but leave cursor after the new text
+------------------------------------------------------------------------------
+*Q_ch* Changing text
+
+|r| N r{char} replace N characters with {char}
+|gr| N gr{char} replace N characters without affecting layout
+|R| N R enter Replace mode (repeat the entered text N times)
+|gR| N gR enter virtual Replace mode: Like Replace mode but
+ without affecting layout
+|v_b_r| {visual}r{char}
+ in Visual block mode: Replace each char of the
+ selected text with {char}
+
+ (change = delete text and enter Insert mode)
+|c| N c{motion} change the text that is moved over with {motion}
+|v_c| {visual}c change the highlighted text
+|cc| N cc change N lines
+|S| N S change N lines
+|C| N C change to the end of the line (and N-1 more lines)
+|s| N s change N characters
+|v_b_c| {visual}c in Visual block mode: Change each of the selected
+ lines with the entered text
+|v_b_C| {visual}C in Visual block mode: Change each of the selected
+ lines until end-of-line with the entered text
+
+|~| N ~ switch case for N characters and advance cursor
+|v_~| {visual}~ switch case for highlighted text
+|v_u| {visual}u make highlighted text lowercase
+|v_U| {visual}U make highlighted text uppercase
+|g~| g~{motion} switch case for the text that is moved over with
+ {motion}
+|gu| gu{motion} make the text that is moved over with {motion}
+ lowercase
+|gU| gU{motion} make the text that is moved over with {motion}
+ uppercase
+|v_g?| {visual}g? perform rot13 encoding on highlighted text
+|g?| g?{motion} perform rot13 encoding on the text that is moved over
+ with {motion}
+
+|CTRL-A| N CTRL-A add N to the number at or after the cursor
+|CTRL-X| N CTRL-X subtract N from the number at or after the cursor
+
+|<| N <{motion} move the lines that are moved over with {motion} one
+ shiftwidth left
+|<<| N << move N lines one shiftwidth left
+|>| N >{motion} move the lines that are moved over with {motion} one
+ shiftwidth right
+|>>| N >> move N lines one shiftwidth right
+|gq| N gq{motion} format the lines that are moved over with {motion} to
+ 'textwidth' length
+|:ce| :[range]ce[nter] [width]
+ center the lines in [range]
+|:le| :[range]le[ft] [indent]
+ left-align the lines in [range] (with [indent])
+|:ri| :[range]ri[ght] [width]
+ right-align the lines in [range]
+------------------------------------------------------------------------------
+*Q_co* Complex changes
+
+|!| N !{motion}{command}<CR>
+ filter the lines that are moved over through {command}
+|!!| N !!{command}<CR>
+ filter N lines through {command}
+|v_!| {visual}!{command}<CR>
+ filter the highlighted lines through {command}
+|:range!| :[range]! {command}<CR>
+ filter [range] lines through {command}
+|=| N ={motion}
+ filter the lines that are moved over through 'equalprg'
+|==| N == filter N lines through 'equalprg'
+|v_=| {visual}=
+ filter the highlighted lines through 'equalprg'
+|:s| :[range]s[ubstitute]/{pattern}/{string}/[g][c]
+ substitute {pattern} by {string} in [range] lines;
+ with [g], replace all occurrences of {pattern};
+ with [c], confirm each replacement
+|:s| :[range]s[ubstitute] [g][c]
+ repeat previous ":s" with new range and options
+|&| & Repeat previous ":s" on current line without options
+|:ret| :[range]ret[ab][!] [tabstop]
+ set 'tabstop' to new value and adjust white space
+ accordingly
+------------------------------------------------------------------------------
+*Q_vi* Visual mode
+
+|visual-index| list of Visual mode commands.
+
+|v| v start highlighting characters } move cursor and use
+|V| V start highlighting linewise } operator to affect
+|CTRL-V| CTRL-V start highlighting blockwise } highlighted text
+|v_o| o exchange cursor position with start of highlighting
+|gv| gv start highlighting on previous visual area
+|v_v| v highlight characters or stop highlighting
+|v_V| V highlight linewise or stop highlighting
+|v_CTRL-V| CTRL-V highlight blockwise or stop highlighting
+------------------------------------------------------------------------------
+*Q_to* Text objects (only in Visual mode or after an operator)
+
+|v_aw| N aw Select "a word"
+|v_iw| N iw Select "inner word"
+|v_aW| N aW Select "a |WORD|"
+|v_iW| N iW Select "inner |WORD|"
+|v_as| N as Select "a sentence"
+|v_is| N is Select "inner sentence"
+|v_ap| N ap Select "a paragraph"
+|v_ip| N ip Select "inner paragraph"
+|v_ab| N ab Select "a block" (from "[(" to "])")
+|v_ib| N ib Select "inner block" (from "[(" to "])")
+|v_aB| N aB Select "a Block" (from "[{" to "]}")
+|v_iB| N iB Select "inner Block" (from "[{" to "]}")
+------------------------------------------------------------------------------
+*Q_re* Repeating commands
+
+|.| N . repeat last change (with count replaced with N)
+|q| q{a-z} record typed characters into register {a-z}
+|q| q{A-Z} record typed characters, appended to register {a-z}
+|q| q stop recording
+|@| N @{a-z} execute the contents of register {a-z} (N times)
+|@@| N @@ repeat previous @{a-z} (N times)
+|:@| :@{a-z} execute the contents of register {a-z} as an Ex
+ command
+|:@@| :@@ repeat previous :@{a-z}
+|:g| :[range]g[lobal]/{pattern}/[cmd]
+ Execute Ex command [cmd] (default: ":p") on the lines
+ within [range] where {pattern} matches.
+|:g| :[range]g[lobal]!/{pattern}/[cmd]
+ Execute Ex command [cmd] (default: ":p") on the lines
+ within [range] where {pattern} does NOT match.
+|:so| :so[urce] {file}
+ Read Ex commands from {file}.
+|:so| :so[urce]! {file}
+ Read Vim commands from {file}.
+|:sl| :sl[eep] [sec]
+ don't do anything for [sec] seconds
+|gs| N gs Goto Sleep for N seconds
+------------------------------------------------------------------------------
+*Q_km* Key mapping
+
+|:map| :ma[p] {lhs} {rhs} Map {lhs} to {rhs} in Normal and Visual
+ mode.
+|:map!| :ma[p]! {lhs} {rhs} Map {lhs} to {rhs} in Insert and Command-line
+ mode.
+|:noremap| :no[remap][!] {lhs} {rhs}
+ Same as ":map", no remapping for this {rhs}
+|:unmap| :unm[ap] {lhs} Remove the mapping of {lhs} for Normal and
+ Visual mode.
+|:unmap!| :unm[ap]! {lhs} Remove the mapping of {lhs} for Insert and
+ Command-line mode.
+|:map_l| :ma[p] [lhs] List mappings (starting with [lhs]) for
+ Normal and Visual mode.
+|:map_l!| :ma[p]! [lhs] List mappings (starting with [lhs]) for
+ Insert and Command-line mode.
+|:cmap| :cmap/:cunmap/:cnoremap
+ like ":map!"/":unmap!"/":noremap!" but for
+ Command-line mode only
+|:imap| :imap/:iunmap/:inoremap
+ like ":map!"/":unmap!"/":noremap!" but for
+ Insert mode only
+|:nmap| :nmap/:nunmap/:nnoremap
+ like ":map"/":unmap"/":noremap" but for
+ Normal mode only
+|:vmap| :vmap/:vunmap/:vnoremap
+ like ":map"/":unmap"/":noremap" but for
+ Visual mode only
+|:omap| :omap/:ounmap/:onoremap
+ like ":map"/":unmap"/":noremap" but only for
+ when an operator is pending
+|:mapc| :mapc[lear] remove mappings for Normal and Visual mode
+|:mapc| :mapc[lear]! remove mappings for Insert and Cmdline mode
+|:imapc| :imapc[lear] remove mappings for Insert mode
+|:vmapc| :vmapc[lear] remove mappings for Visual mode
+|:omapc| :omapc[lear] remove mappings for Operator-pending mode
+|:nmapc| :nmapc[lear] remove mappings for Normal mode
+|:cmapc| :cmapc[lear] remove mappings for Cmdline mode
+|:mkexrc| :mk[exrc][!] [file] write current mappings, abbreviations, and
+ settings to [file] (default: ".exrc";
+ use ! to overwrite)
+|:mkvimrc| :mkv[imrc][!] [file]
+ same as ":mkexrc", but with default ".vimrc"
+|:mksession| :mks[ession][!] [file]
+ like ":mkvimrc", but store current files,
+ windows, etc. too, to be able to continue
+ this session later.
+------------------------------------------------------------------------------
+*Q_ab* Abbreviations
+
+|:abbreviate| :ab[breviate] {lhs} {rhs} add abbreviation for {lhs} to {rhs}
+|:abbreviate| :ab[breviate] {lhs} show abbr's that start with {lhs}
+|:abbreviate| :ab[breviate] show all abbreviations
+|:unabbreviate| :una[bbreviate] {lhs} remove abbreviation for {lhs}
+|:noreabbrev| :norea[bbrev] [lhs] [rhs] like ":ab", but don't remap [rhs]
+|:iabbrev| :iab/:iunab/:inoreab like ":ab", but only for Insert mode
+|:cabbrev| :cab/:cunab/:cnoreab like ":ab", but only for
+ Command-line mode
+|:abclear| :abc[lear] remove all abbreviations
+|:cabclear| :cabc[lear] remove all abbr's for Cmdline mode
+|:iabclear| :iabc[lear] remove all abbr's for Insert mode
+------------------------------------------------------------------------------
+*Q_op* Options
+
+|:set| :se[t] Show all modified options.
+|:set| :se[t] all Show all non-termcap options.
+|:set| :se[t] termcap Show all termcap options.
+|:set| :se[t] {option} Set boolean option (switch it on),
+ show string or number option.
+|:set| :se[t] no{option} Reset boolean option (switch it off).
+|:set| :se[t] inv{option} invert boolean option.
+|:set| :se[t] {option}={value} Set string/number option to {value}.
+|:set| :se[t] {option}+={value} append {value} to string option, add
+ {value} to number option
+|:set| :se[t] {option}-={value} remove {value} to string option,
+ subtract {value} from number option
+|:set| :se[t] {option}? Show value of {option}.
+|:set| :se[t] {option}& Reset {option} to its default value.
+
+|:setlocal| :setl[ocal] like ":set" but set the local value
+ for options that have one
+|:setglobal| :setg[lobal] like ":set" but set the global value
+ of a local option
+
+|:fix| :fix[del] Set value of 't_kD' according to
+ value of 't_kb'.
+|:options| :opt[ions] Open a new window to view and set
+ options, grouped by functionality,
+ a one line explanation and links to
+ the help.
+
+Short explanation of each option: *option-list*
+|'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew)
+|'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode
+|'altkeymap'| |'akm'| for default second language (Farsi/Hebrew)
+|'ambiwidth'| |'ambw'| what to do with Unicode chars of ambiguous width
+|'antialias'| |'anti'| Mac OS X: use smooth, antialiased fonts
+|'autochdir'| |'acd'| change directory to the file in the current window
+|'arabic'| |'arab'| for Arabic as a default second language
+|'arabicshape'| |'arshape'| do shaping for Arabic characters
+|'autoindent'| |'ai'| take indent for new line from previous line
+|'autoread'| |'ar'| autom. read file when changed outside of Vim
+|'autowrite'| |'aw'| automatically write file if changed
+|'autowriteall'| |'awa'| as 'autowrite', but works with more commands
+|'background'| |'bg'| "dark" or "light", used for highlight colors
+|'backspace'| |'bs'| how backspace works at start of line
+|'backup'| |'bk'| keep backup file after overwriting a file
+|'backupcopy'| |'bkc'| make backup as a copy, don't rename the file
+|'backupdir'| |'bdir'| list of directories for the backup file
+|'backupext'| |'bex'| extension used for the backup file
+|'backupskip'| |'bsk'| no backup for files that match these patterns
+|'balloondelay'| |'bdlay'| delay in mS before a balloon may pop up
+|'ballooneval'| |'beval'| switch on balloon evaluation
+|'binary'| |'bin'| read/write/edit file in binary mode
+|'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters
+|'bomb'| prepend a Byte Order Mark to the file
+|'breakat'| |'brk'| characters that may cause a line break
+|'browsedir'| |'bsdir'| which directory to start browsing in
+|'bufhidden'| |'bh'| what to do when buffer is no longer in window
+|'buflisted'| |'bl'| whether the buffer shows up in the buffer list
+|'buftype'| |'bt'| special type of buffer
+|'casemap'| |'cmp'| specifies how case of letters is changed
+|'cdpath'| |'cd'| list of directories searched with ":cd"
+|'cedit'| key used to open the command-line window
+|'charconvert'| |'ccv'| expression for character encoding conversion
+|'cindent'| |'cin'| do C program indenting
+|'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set
+|'cinoptions'| |'cino'| how to do indenting when 'cindent' is set
+|'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent
+|'clipboard'| |'cb'| use the clipboard as the unnamed register
+|'cmdheight'| |'ch'| number of lines to use for the command-line
+|'cmdwinheight'| |'cwh'| height of the command-line window
+|'columns'| |'co'| number of columns in the display
+|'comments'| |'com'| patterns that can start a comment line
+|'commentstring'| |'cms'| template for comments; used for fold marker
+|'compatible'| |'cp'| behave Vi-compatible as much as possible
+|'complete'| |'cpt'| specify how Insert mode completion works
+|'confirm'| |'cf'| ask what to do about unsaved/read-only files
+|'conskey'| |'consk'| get keys directly from console (MS-DOS only)
+|'copyindent'| |'ci'| make 'autoindent' use existing indent structure
+|'cpoptions'| |'cpo'| flags for Vi-compatible behavior
+|'cscopepathcomp'| |'cspc'| how many components of the path to show
+|'cscopeprg'| |'csprg'| command to execute cscope
+|'cscopequickfix'| |'csqf'| use quickfix window for cscope results
+|'cscopetag'| |'cst'| use cscope for tag commands
+|'cscopetagorder'| |'csto'| determines ":cstag" search order
+|'cscopeverbose'| |'csverb'| give messages when adding a cscope database
+|'debug'| set to "msg" to see all error messages
+|'define'| |'def'| pattern to be used to find a macro definition
+|'delcombine'| |'deco'| delete combining characters on their own
+|'dictionary'| |'dict'| list of file names used for keyword completion
+|'diff'| use diff mode for the current window
+|'diffexpr'| |'dex'| expression used to obtain a diff file
+|'diffopt'| |'dip'| options for using diff mode
+|'digraph'| |'dg'| enable the entering of digraphs in Insert mode
+|'directory'| |'dir'| list of directory names for the swap file
+|'display'| |'dy'| list of flags for how to display text
+|'eadirection'| |'ead'| in which direction 'equalalways' works
+|'edcompatible'| |'ed'| toggle flags of ":substitute" command
+|'encoding'| |'enc'| encoding used internally
+|'endofline'| |'eol'| write <EOL> for last line in file
+|'equalalways'| |'ea'| windows are automatically made the same size
+|'equalprg'| |'ep'| external program to use for "=" command
+|'errorbells'| |'eb'| ring the bell for error messages
+|'errorfile'| |'ef'| name of the errorfile for the QuickFix mode
+|'errorformat'| |'efm'| description of the lines in the error file
+|'esckeys'| |'ek'| recognize function keys in Insert mode
+|'eventignore'| |'ei'| autocommand events that are ignored
+|'expandtab'| |'et'| use spaces when <Tab> is inserted
+|'exrc'| |'ex'| read .vimrc and .exrc in the current directory
+|'fileencoding'| |'fenc'| file encoding for multi-byte text
+|'fileencodings'| |'fencs'| automatically detected character encodings
+|'fileformat'| |'ff'| file format used for file I/O
+|'fileformats'| |'ffs'| automatically detected values for 'fileformat'
+|'filetype'| |'ft'| type of file, used for autocommands
+|'fillchars'| |'fcs'| characters to use for displaying special items
+|'fkmap'| |'fk'| Farsi keyboard mapping
+|'foldclose'| |'fcl'| close a fold when the cursor leaves it
+|'foldcolumn'| |'fdc'| width of the column used to indicate folds
+|'foldenable'| |'fen'| set to display all folds open
+|'foldexpr'| |'fde'| expression used when 'foldmethod' is "expr"
+|'foldignore'| |'fdi'| ignore lines when 'foldmethod' is "indent"
+|'foldlevel'| |'fdl'| close folds with a level higher than this
+|'foldlevelstart'| |'fdls'| 'foldlevel' when starting to edit a file
+|'foldmarker'| |'fmr'| markers used when 'foldmethod' is "marker"
+|'foldmethod'| |'fdm'| folding type
+|'foldminlines'| |'fml'| minimum number of lines for a fold to be closed
+|'foldnestmax'| |'fdn'| maximum fold depth
+|'foldopen'| |'fdo'| for which commands a fold will be opened
+|'foldtext'| |'fdt'| expression used to display for a closed fold
+|'formatoptions'| |'fo'| how automatic formatting is to be done
+|'formatprg'| |'fp'| name of external program used with "gq" command
+|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
+|'grepformat'| |'gfm'| format of 'grepprg' output
+|'grepprg'| |'gp'| program to use for ":grep"
+|'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking
+|'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used
+|'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used
+|'guifontwide'| |'gfw'| list of font names for double-wide characters
+|'guiheadroom'| |'ghr'| GUI: pixels room for window decorations
+|'guioptions'| |'go'| GUI: Which components and options are used
+|'guipty'| GUI: try to use a pseudo-tty for ":!" commands
+|'helpfile'| |'hf'| full path name of the main help file
+|'helpheight'| |'hh'| minimum height of a new help window
+|'helplang'| |'hlg'| preferred help languages
+|'hidden'| |'hid'| don't unload buffer when it is |abandon|ed
+|'highlight'| |'hl'| sets highlighting mode for various occasions
+|'hlsearch'| |'hls'| highlight matches with last search pattern
+|'history'| |'hi'| number of command-lines that are remembered
+|'hkmap'| |'hk'| Hebrew keyboard mapping
+|'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping
+|'icon'| let Vim set the text of the window icon
+|'iconstring'| string to use for the Vim icon text
+|'ignorecase'| |'ic'| ignore case in search patterns
+|'imactivatekey'| |'imak'| key that activates the X input method
+|'imcmdline'| |'imc'| use IM when starting to edit a command line
+|'imdisable'| |'imd'| do not use the IM in any mode
+|'iminsert'| |'imi'| use :lmap or IM in Insert mode
+|'imsearch'| |'ims'| use :lmap or IM when typing a search pattern
+|'include'| |'inc'| pattern to be used to find an include file
+|'includeexpr'| |'inex'| expression used to process an include line
+|'incsearch'| |'is'| highlight match while typing search pattern
+|'indentexpr'| |'inde'| expression used to obtain the indent of a line
+|'indentkeys'| |'indk'| keys that trigger indenting with 'indentexpr'
+|'infercase'| |'inf'| adjust case of match for keyword completion
+|'insertmode'| |'im'| start the edit of a file in Insert mode
+|'isfname'| |'isf'| characters included in file names and pathnames
+|'isident'| |'isi'| characters included in identifiers
+|'iskeyword'| |'isk'| characters included in keywords
+|'isprint'| |'isp'| printable characters
+|'joinspaces'| |'js'| two spaces after a period with a join command
+|'key'| encryption key
+|'keymap'| |'kmp'| name of a keyboard mapping
+|'keymodel'| |'km'| enable starting/stopping selection with keys
+|'keywordprg'| |'kp'| program to use for the "K" command
+|'langmap'| |'lmap'| alphabetic characters for other language mode
+|'langmenu'| |'lm'| language to be used for the menus
+|'laststatus'| |'ls'| tells when last window has status lines
+|'lazyredraw'| |'lz'| don't redraw while executing macros
+|'linebreak'| |'lbr'| wrap long lines at a blank
+|'lines'| number of lines in the display
+|'linespace'| |'lsp'| number of pixel lines to use between characters
+|'lisp'| automatic indenting for Lisp
+|'lispwords'| |'lw'| words that change how lisp indenting works
+|'list'| show <Tab> and <EOL>
+|'listchars'| |'lcs'| characters for displaying in list mode
+|'loadplugins'| |'lpl'| load plugin scripts when starting up
+|'magic'| changes special characters in search patterns
+|'makeef'| |'mef'| name of the errorfile for ":make"
+|'makeprg'| |'mp'| program to use for the ":make" command
+|'matchpairs'| |'mps'| pairs of characters that "%" can match
+|'matchtime'| |'mat'| tenths of a second to show matching paren
+|'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions
+|'maxmapdepth'| |'mmd'| maximum recursive depth for mapping
+|'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer
+|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
+|'menuitems'| |'mis'| maximum number of items in a menu
+|'modeline'| |'ml'| recognize modelines at start or end of file
+|'modelines'| |'mls'| number of lines checked for modelines
+|'modifiable'| |'ma'| changes to the text are not possible
+|'modified'| |'mod'| buffer has been modified
+|'more'| pause listings when the whole screen is filled
+|'mouse'| enable the use of mouse clicks
+|'mousefocus'| |'mousef'| keyboard focus follows the mouse
+|'mousehide'| |'mh'| hide mouse pointer while typing
+|'mousemodel'| |'mousem'| changes meaning of mouse buttons
+|'mouseshape'| |'mouses'| shape of the mouse pointer in different modes
+|'mousetime'| |'mouset'| max time between mouse double-click
+|'nrformats'| |'nf'| number formats recognized for CTRL-A command
+|'number'| |'nu'| print the line number in front of each line
+|'osfiletype'| |'oft'| operating system-specific filetype information
+|'paragraphs'| |'para'| nroff macros that separate paragraphs
+|'paste'| allow pasting text
+|'pastetoggle'| |'pt'| key code that causes 'paste' to toggle
+|'patchexpr'| |'pex'| expression used to patch a file
+|'patchmode'| |'pm'| keep the oldest version of a file
+|'path'| |'pa'| list of directories searched with "gf" et.al.
+|'preserveindent'| |'pi'| preserve the indent structure when reindenting
+|'previewheight'| |'pvh'| height of the preview window
+|'previewwindow'| |'pvw'| identifies the preview window
+|'printdevice'| |'pdev'| name of the printer to be used for :hardcopy
+|'printencoding'| |'penc'| encoding to be used for printing
+|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy
+|'printfont'| |'pfn'| name of the font to be used for :hardcopy
+|'printheader'| |'pheader'| format of the header used for :hardcopy
+|'printoptions'| |'popt'| controls the format of :hardcopy output
+|'readonly'| |'ro'| disallow writing the buffer
+|'remap'| allow mappings to work recursively
+|'report'| threshold for reporting nr. of lines changed
+|'restorescreen'| |'rs'| Win32: restore screen when exiting
+|'revins'| |'ri'| inserting characters will work backwards
+|'rightleft'| |'rl'| window is right-to-left oriented
+|'rightleftcmd'| |'rlc'| commands for which editing works right-to-left
+|'ruler'| |'ru'| show cursor line and column in the status line
+|'rulerformat'| |'ruf'| custom format for the ruler
+|'runtimepath'| |'rtp'| list of directories used for runtime files
+|'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D
+|'scrollbind'| |'scb'| scroll in window as other windows scroll
+|'scrolljump'| |'sj'| minimum number of lines to scroll
+|'scrolloff'| |'so'| minimum nr. of lines above and below cursor
+|'scrollopt'| |'sbo'| how 'scrollbind' should behave
+|'sections'| |'sect'| nroff macros that separate sections
+|'secure'| secure mode for reading .vimrc in current dir
+|'selection'| |'sel'| what type of selection to use
+|'selectmode'| |'slm'| when to use Select mode instead of Visual mode
+|'sessionoptions'| |'ssop'| options for |:mksession|
+|'shell'| |'sh'| name of shell to use for external commands
+|'shellcmdflag'| |'shcf'| flag to shell to execute one command
+|'shellpipe'| |'sp'| string to put output of ":make" in error file
+|'shellquote'| |'shq'| quote character(s) for around shell command
+|'shellredir'| |'srr'| string to put output of filter in a temp file
+|'shellslash'| |'ssl'| use forward slash for shell file names
+|'shelltype'| |'st'| Amiga: influences how to use a shell
+|'shellxquote'| |'sxq'| like 'shellquote', but include redirection
+|'shiftround'| |'sr'| round indent to multiple of shiftwidth
+|'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step
+|'shortmess'| |'shm'| list of flags, reduce length of messages
+|'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars
+|'showbreak'| |'sbr'| string to use at the start of wrapped lines
+|'showcmd'| |'sc'| show (partial) command in status line
+|'showfulltag'| |'sft'| show full tag pattern when completing tag
+|'showmatch'| |'sm'| briefly jump to matching bracket if insert one
+|'showmode'| |'smd'| message on status line to show current mode
+|'sidescroll'| |'ss'| minimum number of columns to scroll horizontal
+|'sidescrolloff'| |'siso'| min. nr. of columns to left and right of cursor
+|'smartcase'| |'scs'| no ignore case when pattern has uppercase
+|'smartindent'| |'si'| smart autoindenting for C programs
+|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
+|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
+|'splitbelow'| |'sb'| new window from split is below the current one
+|'splitright'| |'spr'| new window is put right of the current one
+|'startofline'| |'sol'| commands move cursor to first blank in line
+|'statusline'| |'stl'| custom format for the status line
+|'suffixes'| |'su'| suffixes that are ignored with multiple match
+|'suffixesadd'| |'sua'| suffixes added when searching for a file
+|'swapfile'| |'swf'| whether to use a swapfile for a buffer
+|'swapsync'| |'sws'| how to sync the swap file
+|'switchbuf'| |'swb'| sets behavior when switching to another buffer
+|'syntax'| |'syn'| syntax to be loaded for current buffer
+|'tabstop'| |'ts'| number of spaces that <Tab> in file uses
+|'tagbsearch'| |'tbs'| use binary searching in tags files
+|'taglength'| |'tl'| number of significant characters for a tag
+|'tagrelative'| |'tr'| file names in tag file are relative
+|'tags'| |'tag'| list of file names used by the tag command
+|'tagstack'| |'tgst'| push tags onto the tag stack
+|'term'| name of the terminal
+|'termbidi'| |'tbidi'| terminal takes care of bi-directionality
+|'termencoding'| |'tenc'| character encoding used by the terminal
+|'terse'| shorten some messages
+|'textauto'| |'ta'| obsolete, use 'fileformats'
+|'textmode'| |'tx'| obsolete, use 'fileformat'
+|'textwidth'| |'tw'| maximum width of text that is being inserted
+|'thesaurus'| |'tsr'| list of thesaurus files for keyword completion
+|'tildeop'| |'top'| tilde command "~" behaves like an operator
+|'timeout'| |'to'| time out on mappings and key codes
+|'timeoutlen'| |'tm'| time out time in milliseconds
+|'title'| let Vim set the title of the window
+|'titlelen'| percentage of 'columns' used for window title
+|'titleold'| old title, restored when exiting
+|'titlestring'| string to use for the Vim window title
+|'toolbar'| |'tb'| GUI: which items to show in the toolbar
+|'toolbariconsize'| |'tbis'| size of the toolbar icons (for GTK 2 only)
+|'ttimeout'| time out on mappings
+|'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds
+|'ttybuiltin'| |'tbi'| use built-in termcap before external termcap
+|'ttyfast'| |'tf'| indicates a fast terminal connection
+|'ttymouse'| |'ttym'| type of mouse codes generated
+|'ttyscroll'| |'tsl'| maximum number of lines for a scroll
+|'ttytype'| |'tty'| alias for 'term'
+|'undolevels'| |'ul'| maximum number of changes that can be undone
+|'updatecount'| |'uc'| after this many characters flush swap file
+|'updatetime'| |'ut'| after this many milliseconds flush swap file
+|'verbose'| |'vbs'| give informative messages
+|'viewdir'| |'vdir'| directory where to store files with :mkview
+|'viewoptions'| |'vop'| specifies what to save for :mkview
+|'viminfo'| |'vi'| use .viminfo file upon startup and exiting
+|'virtualedit'| |'ve'| when to use virtual editing
+|'visualbell'| |'vb'| use visual bell instead of beeping
+|'warn'| warn for shell command when buffer was changed
+|'weirdinvert'| |'wi'| for terminals that have weird inversion method
+|'whichwrap'| |'ww'| allow specified keys to cross line boundaries
+|'wildchar'| |'wc'| command-line character for wildcard expansion
+|'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped
+|'wildignore'| |'wig'| files matching these patterns are not completed
+|'wildmenu'| |'wmnu'| use menu for command line completion
+|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
+|'winaltkeys'| |'wak'| when the windows system handles ALT keys
+|'winheight'| |'wh'| minimum number of lines for the current window
+|'winfixheight'| |'wfh'| keep window height when opening/closing windows
+|'winminheight'| |'wmh'| minimum number of lines for any window
+|'winminwidth'| |'wmw'| minimal number of columns for any window
+|'winwidth'| |'wiw'| minimal number of columns for current window
+|'wrap'| long lines wrap and continue on the next line
+|'wrapmargin'| |'wm'| chars from the right where wrapping starts
+|'wrapscan'| |'ws'| searches wrap around the end of the file
+|'write'| writing to a file is allowed
+|'writeany'| |'wa'| write to file with no need for "!" override
+|'writebackup'| |'wb'| make a backup before overwriting a file
+|'writedelay'| |'wd'| delay this many msec for each char (for debug)
+------------------------------------------------------------------------------
+*Q_ur* Undo/Redo commands
+
+|u| N u undo last N changes
+|CTRL-R| N CTRL-R redo last N undone changes
+|U| U restore last changed line
+------------------------------------------------------------------------------
+*Q_et* External commands
+
+|:shell| :sh[ell] start a shell
+|:!| :!{command} execute {command} with a shell
+|K| K lookup keyword under the cursor with
+ 'keywordprg' program (default: "man")
+------------------------------------------------------------------------------
+*Q_qf* Quickfix commands
+
+|:cc| :cc [nr] display error [nr] (default is the same again)
+|:cnext| :cn display the next error
+|:cprevious| :cp display the previous error
+|:clist| :cl list all errors
+|:cfile| :cf read errors from the file 'errorfile'
+|:cquit| :cq quit without writing and return error code (to
+ the compiler)
+|:make| :make [args] start make, read errors, and jump to first
+ error
+|:grep| :gr[ep] [args] execute 'grepprg' to find matches and jump to
+ the first one.
+------------------------------------------------------------------------------
+*Q_vc* Various commands
+
+|CTRL-L| CTRL-L Clear and redraw the screen.
+|CTRL-G| CTRL-G show current file name (with path) and cursor
+ position
+|ga| ga show ascii value of character under cursor in
+ decimal, hex, and octal
+|g_CTRL-G| g CTRL-G show cursor column, line, and character
+ position
+|CTRL-C| CTRL-C during searches: Interrupt the search
+|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search
+|<Del>| <Del> while entering a count: delete last character
+|:version| :ve[rsion] show version information
+|:mode| :mode N MS-DOS: set screen mode to N (number, C80,
+ C4350, etc.)
+|:normal| :norm[al][!] {commands}
+ Execute Normal mode commands.
+|Q| Q switch to "Ex" mode
+
+|:redir| :redir >{file} redirect messages to {file}
+|:silent| :silent[!] {command} execute {command} silently
+|:confirm| :confirm {command} quit, write, etc., asking about
+ unsaved changes or read-only files.
+|:browse| :browse {command} open/read/write file, using a
+ file selection dialog
+------------------------------------------------------------------------------
+*Q_ce* Command-line editing
+
+|c_<Esc>| <Esc> abandon command-line (if 'wildchar' is
+ <Esc>, type it twice)
+
+|c_CTRL-V| CTRL-V {char} insert {char} literally
+|c_CTRL-V| CTRL-V {number} enter decimal value of character (up to
+ three digits)
+|c_CTRL-K| CTRL-K {char1} {char2}
+ enter digraph (See |Q_di|)
+|c_CTRL-R| CTRL-R {0-9a-z"%#:-=}
+ insert the contents of a register
+
+|c_<Left>| <Left>/<Right> cursor left/right
+|c_<S-Left>| <S-Left>/<S-Right> cursor one word left/right
+|c_CTRL-B| CTRL-B/CTRL-E cursor to beginning/end of command-line
+
+|c_<BS>| <BS> delete the character in front of the cursor
+|c_<Del>| <Del> delete the character under the cursor
+|c_CTRL-W| CTRL-W delete the word in front of the cursor
+|c_CTRL-U| CTRL-U remove all characters
+
+|c_<Up>| <Up>/<Down> recall older/newer command-line that starts
+ with current command
+|c_<S-Up>| <S-Up>/<S-Down> recall older/newer command-line from history
+|:history| :his[tory] show older command-lines
+
+Context-sensitive completion on the command-line:
+
+|c_wildchar| 'wildchar' (default: <Tab>)
+ do completion on the pattern in front of the
+ cursor. If there are multiple matches,
+ beep and show the first one; further
+ 'wildchar' will show the next ones.
+|c_CTRL-D| CTRL-D list all names that match the pattern in
+ front of the cursor
+|c_CTRL-A| CTRL-A insert all names that match pattern in front
+ of cursor
+|c_CTRL-L| CTRL-L insert longest common part of names that
+ match pattern
+|c_CTRL-N| CTRL-N after 'wildchar' with multiple matches: go
+ to next match
+|c_CTRL-P| CTRL-P after 'wildchar' with multiple matches: go
+ to previous match
+------------------------------------------------------------------------------
+*Q_ra* Ex ranges
+
+|:range| , separates two line numbers
+|:range| ; idem, set cursor to the first line number
+ before interpreting the second one
+
+|:range| {number} an absolute line number
+|:range| . the current line
+|:range| $ the last line in the file
+|:range| % equal to 1,$ (the entire file)
+|:range| * equal to '<,'> (visual area)
+|:range| 't position of mark t
+|:range| /{pattern}[/] the next line where {pattern} matches
+|:range| ?{pattern}[?] the previous line where {pattern} matches
+
+|:range| +[num] add [num] to the preceding line number
+ (default: 1)
+|:range| -[num] subtract [num] from the preceding line
+ number (default: 1)
+------------------------------------------------------------------------------
+*Q_ex* Special Ex characters
+
+|:bar| | separates two commands (not for ":global" and ":!")
+|:quote| " begins comment
+
+|:_%| % current file name (only where a file name is expected)
+|:_#| #[num] alternate file name [num] (only where a file name is
+ expected)
+ Note: The next four are typed literally; these are not special keys!
+|:<cword>| <cword> word under the cursor (only where a file name is
+ expected)
+|:<cWORD>| <cWORD> WORD under the cursor (only where a file name is
+ expected) (see |WORD|)
+|:<cfile>| <cfile> file name under the cursor (only where a file name is
+ expected)
+|:<afile>| <afile> file name for autocommand (only where a file name is
+ expected)
+|:<sfile>| <sfile> file name of a ":source"d file, within that file (only
+ where a file name is expected)
+
+ After "%", "#", "<cfile>", "<sfile>" or "<afile>"
+ |::p| :p full path
+ |::h| :h head (file name removed)
+ |::t| :t tail (file name only)
+ |::r| :r root (extension removed)
+ |::e| :e extension
+ |::s| :s/{pat}/{repl}/ substitute {pat} with {repl}
+------------------------------------------------------------------------------
+*Q_ed* Editing a file
+
+ Without !: Fail if changes has been made to the current buffer.
+ With !: Discard any changes to the current buffer.
+|:edit_f| :e[dit][!] {file} Edit {file}.
+|:edit| :e[dit][!] Reload the current file.
+|:enew| :ene[w][!] Edit a new, unnamed buffer.
+|:find| :fin[d][!] {file} Find {file} in 'path' and edit it.
+
+|CTRL-^| N CTRL-^ Edit alternate file N (equivalent to ":e #N").
+|gf| gf or ]f Edit the file whose name is under the cursor
+|:pwd| :pwd Print the current directory name.
+|:cd| :cd [path] Change the current directory to [path].
+|:cd-| :cd - Back to previous current directory.
+|:file| :f[ile] Print the current file name and the cursor
+ position.
+|:file| :f[ile] {name} Set the current file name to {name}.
+|:files| :files Show alternate file names.
+------------------------------------------------------------------------------
+*Q_fl* Using the argument list |argument-list|
+
+|:args| :ar[gs] Print the argument list, with the current file
+ in "[]".
+|:all| :all or :sall Open a window for every file in the arg list.
+|:wn| :wn[ext][!] Write file and edit next file.
+|:wn| :wn[ext][!] {file} Write to {file} and edit next file, unless
+ {file} exists. With !, overwrite existing
+ file.
+|:wN| :wN[ext][!] [file] Write file and edit previous file.
+
+ in current window in new window ~
+|:argument| :argu[ment] N :sar[gument] N Edit file N
+|:next| :n[ext] :sn[ext] Edit next file
+|:next_f| :n[ext] {arglist} :sn[ext] {arglist} define new arg list
+ and edit first file
+|:Next| :N[ext] :sN[ext] Edit previous file
+|:first| :fir[st] :sfir[st] Edit first file
+|:last| :la[st] :sla[st] Edit last file
+------------------------------------------------------------------------------
+*Q_wq* Writing and quitting
+
+|:w| :[range]w[rite][!] Write to the current file.
+|:w_f| :[range]w[rite] {file} Write to {file}, unless it already
+ exists.
+|:w_f| :[range]w[rite]! {file} Write to {file}. Overwrite an existing
+ file.
+|:w_a| :[range]w[rite][!] >> Append to the current file.
+|:w_a| :[range]w[rite][!] >> {file} Append to {file}.
+|:w_c| :[range]w[rite] !{cmd} Execute {cmd} with [range] lines as
+ standard input.
+|:up| :[range]up[date][!] write to current file if modified
+|:wall| :wa[ll][!] write all changed buffers
+
+|:q| :q[uit] Quit current buffer, unless changes have been
+ made. Exit Vim when there are no other
+ non-help buffers
+|:q| :q[uit]! Quit current buffer always, discard any
+ changes. Exit Vim when there are no other
+ non-help buffers
+|:qa| :qa[ll] Exit Vim, unless changes have been made.
+|:qa| :qa[ll]! Exit Vim always, discard any changes.
+|:cq| :cq Quit without writing and return error code.
+
+|:wq| :wq[!] Write the current file and exit.
+|:wq| :wq[!] {file} Write to {file} and exit.
+|:xit| :x[it][!] [file] Like ":wq" but write only when changes have
+ been made
+|ZZ| ZZ Same as ":x".
+|ZQ| ZQ Same as ":q!".
+|:xall| :xa[ll][!] or :wqall[!]
+ Write all changed buffers and exit
+
+|:stop| :st[op][!] Suspend VIM or start new shell. If 'aw' option
+ is set and [!] not given write the buffer.
+|CTRL-Z| CTRL-Z Same as ":stop"
+------------------------------------------------------------------------------
+*Q_st* Starting VIM
+
+|-vim| vim [options] start editing with an empty buffer
+|-file| vim [options] {file} .. start editing one or more files
+|--| vim [options] - read file from stdin
+|-tag| vim [options] -t {tag} edit the file associated with {tag}
+|-qf| vim [options] -q [fname] start editing in QuickFix mode,
+ display the first error
+
+ Vim arguments:
+
+|-gui| -g start GUI (also allows other options)
+
+|-+| +[num] put the cursor at line [num] (default: last line)
+|-+c| +{command} execute {command} after loading the file
+|-+/| +/{pat} {file} .. put the cursor at the first occurrence of {pat}
+|-v| -v Vi mode, start ex in Normal mode
+|-e| -e Ex mode, start vim in Ex mode
+|-R| -R Read-only mode, implies -n
+|-m| -m modifications not allowed (resets 'write' option)
+|-b| -b binary mode
+|-l| -l lisp mode
+|-A| -A Arabic mode ('arabic' is set)
+|-F| -F Farsi mode ('fkmap' and 'rightleft' are set)
+|-H| -H Hebrew mode ('hkmap' and 'rightleft' are set)
+|-V| -V Verbose, give informative messages
+|-C| -C Compatible, set the 'compatible' option
+|-N| -N Nocompatible, reset the 'compatible' option
+|-r| -r give list of swap files
+|-r| -r {file} .. recover aborted edit session
+|-n| -n do not create a swap file
+|-o| -o [num] open [num] windows (default: one for each file)
+|-f| -f GUI: foreground process, don't fork
+ Amiga: do not restart VIM to open a window (for
+ e.g., mail)
+|-s| -s {scriptin} first read commands from the file {scriptin}
+|-w| -w {scriptout} write typed chars to file {scriptout} (append)
+|-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)
+|-T| -T {terminal} set terminal name
+|-d| -d {device} Amiga: open {device} to be used as a console
+|-u| -u {vimrc} read inits from {vimrc} instead of other inits
+|-U| -U {gvimrc} idem, for when starting the GUI
+|-i| -i {viminfo} read info from {viminfo} instead of other files
+|---| -- end of options, other arguments are file names
+|--help| --help show list of arguments and exit
+|--version| --version show version info and exit
+|--| - Read file from stdin.
+------------------------------------------------------------------------------
+*Q_ac* Automatic Commands
+
+|viminfo-file| Read registers, marks, history at startup, save when exiting.
+
+|:rviminfo| :rv[iminfo] [file] Read info from viminfo file [file]
+|:rviminfo| :rv[iminfo]! [file] idem, overwrite existing info
+|:wviminfo| :wv[iminfo] [file] Add info to viminfo file [file]
+|:wviminfo| :wv[iminfo]! [file] Write info to viminfo file [file]
+
+|modeline| Automatic option setting when editing a file
+
+|modeline| vim:{set-arg}: .. In the first and last lines of the
+ file (see 'ml' option), {set-arg} is
+ given as an argument to ":set"
+
+|autocommand| Automatic execution of commands on certain events.
+
+|:autocmd| :au List all autocommands
+|:autocmd| :au {event} List all autocommands for {event}
+|:autocmd| :au {event} {pat} List all autocommands for {event} with
+ {pat}
+|:autocmd| :au {event} {pat} {cmd} Enter new autocommands for {event}
+ with {pat}
+|:autocmd| :au! Remove all autocommands
+|:autocmd| :au! {event} Remove all autocommands for {event}
+|:autocmd| :au! * {pat} Remove all autocommands for {pat}
+|:autocmd| :au! {event} {pat} Remove all autocommands for {event}
+ with {pat}
+|:autocmd| :au! {event} {pat} {cmd} Remove all autocommands for {event}
+ with {pat} and enter new one
+------------------------------------------------------------------------------
+*Q_wi* Multi-window commands
+
+|CTRL-W_s| CTRL-W s or :split Split window into two parts
+|:split_f| :split {file} Split window and edit {file} in one of
+ them
+|:vsplit| :vsplit {file} Same, but split vertically
+|:vertical| :vertical {cmd} Make {cmd} split vertically
+
+|:sfind| :sf[ind] {file} Split window, find {file} in 'path'
+ and edit it.
+|CTRL-W_]| CTRL-W ] Split window and jump to tag under
+ cursor
+|CTRL-W_f| CTRL-W f Split window and edit file name under
+ the cursor
+|CTRL-W_^| CTRL-W ^ Split window and edit alternate file
+|CTRL-W_n| CTRL-W n or :new Create new empty window
+|CTRL-W_q| CTRL-W q or :q[uit] Quit editing and close window
+|CTRL-W_c| CTRL-W c or :cl[ose] Make buffer hidden and close window
+|CTRL-W_o| CTRL-W o or :on[ly] Make current window only one on the
+ screen
+
+|CTRL-W_j| CTRL-W j Move cursor to window below
+|CTRL-W_k| CTRL-W k Move cursor to window above
+|CTRL-W_CTRL-W| CTRL-W CTRL-W Move cursor to window below (wrap)
+|CTRL-W_W| CTRL-W W Move cursor to window above (wrap)
+|CTRL-W_t| CTRL-W t Move cursor to top window
+|CTRL-W_b| CTRL-W b Move cursor to bottom window
+|CTRL-W_p| CTRL-W p Move cursor to previous active window
+
+|CTRL-W_r| CTRL-W r Rotate windows downwards
+|CTRL-W_R| CTRL-W R Rotate windows upwards
+|CTRL-W_x| CTRL-W x Exchange current window with next one
+
+|CTRL-W_=| CTRL-W = Make all windows equal height
+|CTRL-W_-| CTRL-W - Decrease current window height
+|CTRL-W_+| CTRL-W + Increase current window height
+|CTRL-W__| CTRL-W _ Set current window height (default:
+ very high)
+------------------------------------------------------------------------------
+*Q_bu* Buffer list commands
+
+|:buffers| :buffers or :files list all known buffer and file names
+
+|:ball| :ball or :sball edit all args/buffers
+|:unhide| :unhide or :sunhide edit all loaded buffers
+
+|:badd| :badd {fname} add file name {fname} to the list
+|:bunload| :bunload[!] [N] unload buffer [N] from memory
+|:bdelete| :bdelete[!] [N] unload buffer [N] and delete it from
+ the buffer list
+
+ in current window in new window ~
+|:buffer| :[N]buffer [N] :[N]sbuffer [N] to arg/buf N
+|:bnext| :[N]bnext [N] :[N]sbnext [N] to Nth next arg/buf
+|:bNext| :[N]bNext [N] :[N]sbNext [N] to Nth previous arg/buf
+|:bprevious| :[N]bprevious [N] :[N]sbprevious [N] to Nth previous arg/buf
+|:bfirst| :bfirst :sbfirst to first arg/buf
+|:blast| :blast :sblast to last arg/buf
+|:bmodified| :[N]bmod [N] :[N]sbmod [N] to Nth modified buf
+------------------------------------------------------------------------------
+*Q_sy* Syntax Highlighting
+
+|:syn-on| :syntax on start using syntax highlighting
+|:syn-off| :syntax off stop using syntax highlighting
+
+|:syn-keyword| :syntax keyword {group-name} {keyword} ..
+ add a syntax keyword item
+|:syn-match| :syntax match {group-name} {pattern} ...
+ add syntax match item
+|:syn-region| :syntax region {group-name} {pattern} ...
+ add syntax region item
+|:syn-sync| :syntax sync [ccomment | lines {N} | ...]
+ tell syntax how to sync
+|:syntax| :syntax [list] list current syntax items
+|:syn-clear| :syntax clear clear all syntax info
+
+|:highlight| :highlight clear clear all highlight info
+|:highlight| :highlight {group-name} {key}={arg} ..
+ set highlighting for {group-name}
+
+|:filetype| :filetype on switch on file type detection, without
+ syntax highlighting
+|:filetype| :filetype plugin indent on
+ switch on file type detection, with
+ automatic indenting and settings
+------------------------------------------------------------------------------
+*Q_gu* GUI commands
+
+|:gui| :gui UNIX: start the GUI
+|:gui| :gui {fname} .. idem, and edit {fname} ..
+
+|:menu| :menu list all menus
+|:menu| :menu {mpath} list menus starting with {mpath}
+|:menu| :menu {mpath} {rhs} add menu {mpath}, giving {lhs}
+|:menu| :menu {pri} {mpath} {rhs}
+ idem, with priorities {pri}
+|:menu| :menu ToolBar.{name} {rhs}
+ add toolbar item, giving {lhs}
+|:tmenu| :tmenu {mpath} {text} add tooltip to menu {mpath}
+|:unmenu| :unmenu {mpath} remove menu {mpath}
+------------------------------------------------------------------------------
+*Q_fo* Folding
+
+|'foldmethod'| set foldmethod=manual manual folding
+ set foldmethod=indent folding by indent
+ set foldmethod=expr folding by 'foldexpr'
+ set foldmethod=syntax folding by syntax regions
+ set foldmethod=marker folding by 'foldmarkers'
+
+|zf| zf{motion} operator: Define a fold manually
+|:fold| :{range}fold define a fold for {range} lines
+|zd| zd delete one fold under the cursor
+|zD| zD delete all folds under the cursor
+
+|zo| zo open one fold under the cursor
+|zO| zO open all folds under the cursor
+|zc| zc close one fold under the cursor
+|zC| zC close all folds under the cursor
+
+|zm| zm fold more: decrease 'foldlevel'
+|zM| zM close all folds: make 'foldlevel' zero
+|zr| zr reduce folding: increase 'foldlevel'
+|zR| zR open all folds: make 'foldlevel' max.
+
+|zn| zn fold none: reset 'foldenable'
+|zN| zN fold normal set 'foldenable'
+|zi| zi invert 'foldenable'
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
new file mode 100644
index 000000000..3c5c3a3e6
--- /dev/null
+++ b/runtime/doc/quotes.txt
@@ -0,0 +1,274 @@
+*quotes.txt* For Vim version 7.0aa. Last change: 2004 May 06
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *quotes*
+Here are some nice quotes about Vim that I collected from news and mail.
+
+
+vim (vim) noun - Ebullient vitality and energy. [Latin, accusative of vis,
+strength] (Dictionary)
+
+Vim is so much better than vi that a great many of my old vi :map's became
+immediately obsolete! (Tony Nugent, Australia)
+
+Coming with a very GUI mindset from Windows, I always thought of people using
+Vi as some kind of outer space alien in human clothes. Once I tried I really
+got addicted by its power and now I found myself typing Vim keypresses in the
+oddest places! That's why I would like to see Vim embedded in every
+application which deals with text editing. (José Fonseca)
+
+I was a 12-year emacs user who switched to Vim about a year ago after finally
+giving up on the multiple incompatible versions, flaky contributed packages,
+disorganized keystrokes, etc. And it was one of the best moves I ever made.
+(Joel Burton)
+
+Although all of the programs were used during the preparation of the new and
+revised material, most of the editing was done with Vim versions 4.5 and 5.0
+under GNU-Linux (Redhat 4.2). (Arnold Robbins, Israel, author of "Learning
+the Vi editor")
+
+Out of all the open software i've ever seen and used, and i've seen a lot, Vim
+is the best, most useful and highest quality to work with, second only to the
+linux kernel itself. (Peter Jay Salzman)
+
+It's well worth noting that the _entirety_ of SourceForge was written using
+Vim and its nifty PHP syntax highlighting. I think the entire SF.net tech
+staff uses Vim and we're all excited to have you aboard! (Tim Perdue)
+
+Vim is one of a select bunch of tools for which I have no substitute. It is
+a brilliant piece of work! (Biju Chacko)
+
+A previous girlfriend of mine switched to emacs. Needless to say, the
+relationship went nowhere. (Geoffrey Mann)
+
+I rarely think about Vim, in the same way that I guess a fish rarely thinks
+about water. It's the environment in which everything else happens. I'm a
+fairly busy system administrator working on a lot of different platforms. Vim
+is the only thing that's consistent across all my systems, and it's just about
+the only thing that doesn't break from time to time. When a new system comes
+in the door without Vim, I install it right away. Great to have a tool that's
+the same everywhere, that's completely reliable, so I can ignore it and think
+about other things. (Pete Schaeffer)
+
+Having recently succeeded in running Vim via telnet through a Nokia
+Communicator, I can now report that it works nicely on a Palm Pilot too.
+(Allan Kelly, Scotland)
+
+You've done a tremendous job with 'VIM', Bram! The more I use it, the more
+impressed I get (I am an old 'vi' die hard who once started out with early
+versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
+first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
+replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
+
+I love and use VIM heavily too. (Larry Wall)
+
+Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
+you get the hang of it, its small, powerful and FAST! (Unknown)
+VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
+(Stephen Riehm, Germany)
+
+Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht
+schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
+Translated: Even when only using a fraction of VIM-functions, the user will
+quickly get used to and appreciate the advantages of this editor. (Garry
+Glendown, conclusion of an article on VIM in iX magazine 9/1998)
+
+I've recently acquired the O'Reilly book on VI (it also discusses VIM
+in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
+Rankin)
+
+This guide was written using the Windows 9.x distribution of GVIM, which is
+quite possibly the greatest thing to come along since God created the naked
+girl. (Michael DiBernardo)
+
+Boy, I thought I knew almost everything about VIM, but every time I browse the
+online documentation, I hit upon a minor but cool aspect of a VIM feature that
+I didn't know before! I must say the documentation is one the finest I've
+ever seen in a product -- even better than most commercial products.
+(Gautam Mudunuri)
+
+VIM 4.5 is really a fantastic editor. It has sooooo many features and more
+importantly, the defaults are so well thought out that you really don't have
+to change anything!! Words cannot express my amazement and gratitude to the
+creators of VIM. Keep it up. (Vikas, USA)
+
+I wonder how long it will be before people will refer to other Vi editors as
+VIM clones? (Darren Hiebert)
+
+I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
+of those "Perfect Programmer's Editor" threads and was delighted to discover
+that VIM already supports it. (Brendan Macmillan, Australia)
+
+I just discovered VIM (5.0) and I'm telling everyone I know about it!
+I tell them VIM stands for VI for the new (M)illenium. Thanks so much!
+(Matt F. Valentine)
+
+I think from now on "vi" should be called "Vim Imitation", not the other way
+around. (Rungun Ramanathan)
+
+The Law of VIM:
+For each member b of the possible behaviour space B of program P, there exists
+a finite time t before which at least one user u in the total user space U of
+program P will request b becomes a member of the allowed behaviour space B'
+(B' <= B).
+In other words: Sooner or later everyone wants everything as an option.
+(Negri)
+
+Whenever I move to a new computing platform, the first thing I do is to port
+VIM. Lately, I am simply stunned by its ease of compilation using the
+configure facility. (A.M. Sabuncu, Turkey)
+
+The options are really excellent and very powerful. (Anish Maharaj)
+
+The Spring user-interface designs are in, and word from the boutiques is that
+80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto
+March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
+look. Strident and customizable, VIM raises eyebrows with its interpretation
+of the classic Vi single-key macro collection.
+http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
+
+I just wanted to take this opportunity to let you know that VIM 5 ROCKS!
+Syntax highlighting: how did I survive without it?! Thank you for creating
+mankind's best editor! (Mun Johl, USA)
+
+Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson,
+author of the book "UNIX Programming Tools")
+
+The BEST EDITOR EVER (Stuart Woolford)
+
+I have used most of VIM's fancy features at least once, many frequently, and I
+can honestly say that I couldn't live with anything less anymore. My
+productivity has easily doubled compared to what it was when I used vi.
+(Sitaram Chamarty)
+
+I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose
+Unpingco, USA)
+
+Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany)
+
+I use VIM every day. I spend more time in VIM than in any other program...
+It's the best vi clone there is. I think it's great. (Craig Sanders,
+Australia)
+
+I strongly advise using VIM--its infinite undo/redo saved me much grief.
+(Terry Brown)
+
+Thanks very much for writing what in my opinion is the finest text editor on
+the planet. If I were to get another cat, I would name it "Vim".
+(Bob Sheehan, USA)
+
+I typed :set all and the screen FILLED up with options. A whole screen of
+things to be set and unset. I saw some of my old friends like wrapmargin,
+modelines and showmode, but the screen was FILLED with new friends! I love
+them all! I love VIM! I'm so happy that I've found this editor! I feel
+like how I once felt when I started using vi after a couple of years of using
+ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
+great. And now, VIM. (Peter Jay Salzman, USA)
+
+I am really happy with such a wonderful software package. Much better than
+almost any expensive, off the shelf program. (Jeff Walker)
+
+Whenever I reread the VIM documentation I'm overcome with excitement at the
+power of the editor. (William Edward Webber, Australia)
+
+Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
+that vi sorely needs: highlighting for executing commands on blocks, an easily
+navigable and digestible help screen, and more. (Paul Pax)
+
+The reason WHY I don't have this amazingly useful macro any more, is that I
+now use VIM - and this is built in!! (Stephen Riehm, Germany)
+
+I am a user of VIM and I love it. I use it to do all my programming, C,
+C++, HTML what ever. (Tim Allwine)
+
+I discovered VIM after years of struggling with the original vi, and I just
+can't live without it any more. (Emmanuel Mogenet, USA)
+
+Emacs has not a bit of chance to survive so long as VIM is around. Besides,
+it also has the most detailed software documentation I have ever seen---much
+better than most commercial software! (Leiming Qian)
+
+This version of VIM will just blow people apart when they discover just how
+fantastic it is! (Tony Nugent, Australia)
+
+I took your advice & finally got VIM & I'm really impressed. Instant convert.
+(Patrick Killelea, USA)
+
+VIM is by far my favorite piece of shareware and I have been particularly
+pleased with version 3.0. This is really a solid piece of work. (Robert
+Colon, USA)
+
+VIM is a joy to use, it is so well thought and practical that I wonder why
+anybody would use visual development tools. VIM is powerful and elegant, it
+looks deceptively simple but is almost as complex as a 747 (especially when I
+look at my growing .vimrc), keep up that wonderful job, VIM is a centerpiece
+of the free software world. (Louis-David Mitterand, USA)
+
+I cannot believe how great it is to use VIM. I think the guys at work are
+getting tired of hearing me bragging about it. Others eyes are lighting up.
+(Rick Croote)
+
+Emacs takes way to much time to start up and run, it is to big and bulky for
+effective use and the interface is more confusing than it is of any help. VIM
+however is short, it is fast, it is powerful, it has a good interface and it
+is all purpose. (Paal Ditlefsen Ekran)
+
+From the first time I got VIM3.0, I was very enthusiastic. It has almost no
+problems. The swapfile handling and the backup possibilities are robust, also
+the protection against editing one file twice. It is very compatible to the
+real VI (and that is a MUST, because my brain is trained over years in using
+it). (Gert van Antwerpen, Holland)
+
+Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia)
+
+I have to say that VIM is =THE= single greatest piece of source code to ever
+come across the net (Jim Battle, USA).
+
+In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by
+far, the best version of vi I've ever seen (Albert W. Schueller).
+
+I should mention that VIM is a very good editor and can compete with anything
+(Ilya Beloozerov).
+
+To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
+the reason that I can state that VIM is the best! (Ferenc Deak, Hungary)
+
+VIM is by far the best editor that I have used in a long time, and I have
+looked at just about every thing that is available for every platform that I
+use. VIM is the best on all of them. (Guy L. Oliver)
+
+VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA)
+
+I would like to say that with VIM I am finally making the 'emacs to vi'
+transition - as an Editor it is so much better in many ways: keyboard layout,
+memory usage, text alteration to name 3. (Mark Adam)
+
+In fact, now if I want to know what a particular setting does in vi, I fire up
+VIM and check out it's help! (Nikhil Patel, USA)
+
+As a vi user, VIM has made working with text a far more pleasant task than
+before I encountered this program. (Steinar Knutsen, Norway)
+
+I use VIM since version 3.0. Since that time, it is the ONLY editor I use,
+with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they
+try, and they continue using it. VIM is really the best software I have ever
+downloaded from the Internet, and the best editor I know of. (Marco
+Eccettuato, Italy)
+
+
+In summary:
+ __ ___ _ _ _ ___ _____
+ \ \ / (_)_ __ ___ (_)___ | | | |/ _ \_ _|
+ \ \ / /| | '_ ` _ \ | / __| | |_| | | | || |
+ \ V / | | | | | | | | \__ \ | _ | |_| || |
+ \_/ |_|_| |_| |_| |_|___/ |_| |_|\___/ |_|
+ ____ _____ _ _ _____ _____ _ _
+ / ___|_ _| | | | ___| ___| | |
+ \___ \ | | | | | | |_ | |_ | | |
+ ___) || | | |_| | _| | _| |_|_|
+ |____/ |_| \___/|_| |_| (_|_) (Tony Nugent, Australia)
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
new file mode 100644
index 000000000..19cbe0130
--- /dev/null
+++ b/runtime/doc/recover.txt
@@ -0,0 +1,165 @@
+*recover.txt* For Vim version 7.0aa. Last change: 2004 Apr 16
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Recovery after a crash *crash-recovery*
+
+You have spent several hours typing in that text that has to be finished
+next morning, and then disaster strikes: Your computer crashes.
+
+ DON'T PANIC!
+
+You can recover most of your changes from the files that Vim uses to store
+the contents of the file. Mostly you can recover your work with one command:
+ vim -r filename
+
+1. The swap file |swap-file|
+2. Recovery |recovery|
+
+==============================================================================
+1. The swap file *swap-file*
+
+Vim stores the things you changed in a swap file. Using the original file
+you started from plus the swap file you can mostly recover your work.
+
+You can see the name of the current swap file being used with the command:
+
+ :sw[apname] *:sw* *:swapname*
+
+The name of the swap file is normally the same as the file you are editing,
+with the extension ".swp".
+- On Unix, a '.' is prepended to swap file names in the same directory as the
+ edited file. This avoids that the swap file shows up in a directory
+ listing.
+- On MS-DOS machines and when the 'shortname' option is on, any '.' in the
+ original file name is replaced with '_'.
+- If this file already exists (e.g., when you are recovering from a crash) a
+ warning is given and another extension is used, ".swo", ".swn", etc.
+- An existing file will never be overwritten.
+- The swap file is deleted as soon as Vim stops editing the file.
+
+Technical: The replacement of '.' with '_' is done to avoid problems with
+ MS-DOS compatible filesystems (e.g., crossdos, multidos). If Vim
+ is able to detect that the file is on an MS-DOS-like filesystem, a
+ flag is set that has the same effect as the 'shortname' option.
+ This flag is reset when you start editing another file.
+ *E326*
+ If the ".swp" file name already exists, the last character is
+ decremented until there is no file with that name or ".saa" is
+ reached. In the last case, no swap file is created.
+
+By setting the 'directory' option you can place the swap file in another place
+than where the edited file is.
+Advantages:
+- You will not pollute the directories with ".swp" files.
+- When the 'directory' is on another partition, reduce the risk of damaging
+ the file system where the file is (in a crash).
+Disadvantages:
+- You can get name collisions from files with the same name but in different
+ directories (although Vim tries to avoid that by comparing the path name).
+ This will result in bogus ATTENTION warning messages.
+- When you use your home directory, and somebody else tries to edit the same
+ file, he will not see your swap file and will not get the ATTENTION waring
+ message.
+On the Amiga you can also use a recoverable ram disk, but there is no 100%
+guarantee that this works. Putting swap files in a normal ram disk (like RAM:
+on the Amiga) or in a place that is cleared when rebooting (like /tmp on Unix)
+makes no sense, you will lose the swap file in a crash.
+
+If you want to put swap files in a fixed place, put a command resembling the
+following ones in your .vimrc:
+ :set dir=dh2:tmp (for Amiga)
+ :set dir=~/tmp (for Unix)
+ :set dir=c:\\tmp (for MS-DOS and Win32)
+This is also very handy when editing files on floppy. Of course you will have
+to create that "tmp" directory for this to work!
+
+For read-only files, a swap file is not used. Unless the file is big, causing
+the amount of memory used to be higher than given with 'maxmem' or
+'maxmemtot'. And when making a change to a read-only file, the swap file is
+created anyway.
+
+The 'swapfile' option can be reset to avoid creating a swapfile.
+
+
+Detecting an existing swap file ~
+
+You can find this in the user manual, section |11.3|.
+
+
+Updating the swapfile ~
+
+The swap file is updated after typing 200 characters or when you have not
+typed anything for four seconds. This only happens if the buffer was
+changed, not when you only moved around. The reason why it is not kept up to
+date all the time is that this would slow down normal work too much. You can
+change the 200 character count with the 'updatecount' option. You can set
+the time with the 'updatetime' option. The time is given in milliseconds.
+After writing to the swap file Vim syncs the file to disk. This takes some
+time, especially on busy Unix systems. If you don't want this you can set the
+'swapsync' option to an empty string. The risk of losing work becomes bigger
+though. On some non-Unix systems (MS-DOS, Amiga) the swap file won't be
+written at all.
+
+If the writing to the swap file is not wanted, it can be switched off by
+setting the 'updatecount' option to 0. The same is done when starting Vim
+with the "-n" option. Writing can be switched back on by setting the
+'updatecount' option to non-zero. Swap files will be created for all buffers
+when doing this. But when setting 'updatecount' to zero, the existing swap
+files will not be removed, it will only affect files that will be opened
+after this.
+
+If you want to make sure that your changes are in the swap file use this
+command:
+
+ *:pre* *:preserve* *E313* *E314*
+:pre[serve] Write all text for all buffers into swap file. The
+ original file is no longer needed for recovery. {Vi:
+ emergency exit}
+
+A Vim swap file can be recognized by the first six characters: "b0VIM ".
+After that comes the version number, e.g., "3.0".
+
+==============================================================================
+2. Recovery *recovery* *E308* *E311*
+
+Basic file recovery is explained in the user manual: |usr_11.txt|.
+
+Another way to do recovery is to start Vim and use the ":recover" command.
+This is easy when you start Vim to edit a file and you get the "ATTENTION:
+Found a swap file ..." message. In this case the single command ":recover"
+will do the work. You can also give the name of the file or the swap file to
+the recover command:
+ *:rec* *:recover* *E305* *E306* *E307*
+:rec[over] [file] Try to recover [file] from the swap file. If [file]
+ is not given use the file name for the current
+ buffer. The current contents of the buffer are lost.
+ This command fails if the buffer was modified.
+
+:rec[over]! [file] Like ":recover", but any changes in the current
+ buffer are lost.
+
+ *E312* *E309* *E310*
+Vim has some intelligence about what to do if the swap file is corrupt in
+some way. If Vim has doubt about what it found, it will give an error
+message and insert lines with "???" in the text. If you see an error message
+while recovering, search in the file for "???" to see what is wrong. You may
+want to cut and paste to get the text you need.
+
+The most common remark is "???LINES MISSING". This means that Vim cannot read
+the text from the original file. This can happen if the system crashed and
+parts of the original file were not written to disk.
+
+Be sure that the recovery was successful before overwriting the original
+file or deleting the swap file. It is good practice to write the recovered
+file elsewhere and run 'diff' to find out if the changes you want are in the
+recovered file.
+
+Once you are sure the recovery is ok delete the swap file. Otherwise, you
+will continue to get warning messages that the ".swp" file already exists.
+
+{Vi: recovers in another way and sends mail if there is something to recover}
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt
new file mode 100644
index 000000000..e3d3224e7
--- /dev/null
+++ b/runtime/doc/remote.txt
@@ -0,0 +1,188 @@
+*remote.txt* For Vim version 7.0aa. Last change: 2003 Nov 10
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Vim client-server communication *client-server*
+
+1. Common functionality |clientserver|
+2. X11 specific items |x11-clientserver|
+3. MS-Windows specific items |w32-clientserver|
+
+{Vi does not have any of these commands}
+
+==============================================================================
+1. Common functionality *clientserver*
+
+When compiled with the |+clientserver| option, Vim can act as a command
+server. It accepts messages from a client and executes them. At the same
+time, Vim can function as a client and send commands to a Vim server.
+
+The following command line arguments are available:
+
+ argument meaning ~
+
+ --remote [+{cmd}] {file} ... *--remote*
+ Open the file list in a remote Vim. When
+ there is no Vim server, execute locally.
+ There is one optional init command: +{cmd}.
+ This must be an Ex command that can be
+ followed by "|".
+ The rest of the command line is taken as the
+ file list. Thus any non-file arguments must
+ come before this.
+ You cannot edit stdin this way |--|.
+ The remote Vim is raised. If you don't want
+ this use >
+ vim --remote-send "<C-\><C-N>:n filename<CR>"
+< --remote-silent [+{cmd}] {file} ... *--remote-silent*
+ As above, but don't complain if there is no
+ server and the file is edited locally.
+ --remote-wait [+{cmd}] {file} ... *--remote-wait*
+ As --remote, but wait for files to complete
+ (unload) in remote Vim.
+ --remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
+ As --remote-wait, but don't complain if there
+ is no server.
+ *--servername*
+ --servername {name} Become the server {name}. When used together
+ with one of the --remote commands: connect to
+ server {name} instead of the default (see
+ below).
+ *--remote-send*
+ --remote-send {keys} Send {keys} to server and exit.
+ *--remote-expr*
+ --remote-expr {expr} Evaluate {expr} in server and
+ print the result on stdout.
+ *--serverlist*
+ --serverlist Output a list of server names.
+
+
+Examples ~
+
+Edit "file.txt" in an already running GVIM server: >
+ gvim --remote file.txt
+
+Edit "file.txt" in an already running server called FOOBAR: >
+ gvim --servername FOOBAR --remote file.txt
+
+Edit "file.txt" in server "FILES" if it exists, become server "FILES"
+otherwise: >
+ gvim --servername FILES --remote-silent file.txt
+
+This doesn't work, all arguments after --remote will be used as file names: >
+ gvim --remote --servername FOOBAR file.txt
+
+Edit file "+foo" in a remote server (note the use of "./" to avoid the special
+meaning of the leading plus): >
+ vim --remote ./+foo
+
+Tell the remote server "BLA" to write all files and exit: >
+ vim --servername BLA --remote-send '<C-\><C-N>:wqa<CR>'
+
+
+SERVER NAME
+
+By default Vim will try to register the name under which it was invoked (gvim,
+egvim ...). This can be overridden with the --servername argument. If the
+specified name is not available, a postfix is applied until a free name is
+encountered, ie. "gvim1" for the second invocation of gvim on a particular
+X-server. The resulting name is available in the servername builtin variable
+|v:servername|. The case of the server name is ignored, thus "gvim" and
+"GVIM" are considered equal.
+
+When Vim is invoked with --remote, --remote-wait or --remote-send it will try
+to locate the server name determined by the invocation name and --servername
+argument as described above. If an exact match is not available, the first
+server with the number postfix will be used. If a name with the number
+postfix is specified with the --servername argument, it must match exactly.
+
+If no server can be located and --remote or --remote-wait was used, Vim will
+start up according to the rest of the command line and do the editing by
+itself. This way it is not necessary to know whether gvim is already started
+when sending command to it.
+
+The --serverlist argument will cause Vim to print a list of registered command
+servers on the standard output (stdout) and exit.
+
+Win32 Note: Making the Vim server go to the foreground doesn't always work,
+because MS-Windows doesn't allow it. The client will move the server to the
+foreground when using the --remote or --remote-wait argument and the server
+name starts with "g".
+
+
+REMOTE EDITING
+
+The --remote argument will cause a |:drop| command to be constructed from the
+rest of the command line and sent as described above.
+The --remote-wait argument does the same thing and additionally sets up to
+wait for each of the files to have been edited. This uses the BufUnload
+event, thus as soon as a file has been unloaded, Vim assumes you are done
+editing it.
+Note that the --remote and --remote-wait arguments will consume the rest of
+the command line. Ie. all remaining arguments will be regarded as filenames.
+You can not put options there!
+
+
+FUNCTIONS
+ *E240* *E573*
+There are a number of Vim functions for scripting the command server. See
+the description in |eval.txt| or use CTRL-] on the function name to jump to
+the full explanation.
+
+ synopsis explanation ~
+ remote_expr( server, string, idvar) send expression
+ remote_send( server, string, idvar) send key sequence
+ serverlist() get a list of available servers
+ remote_peek( serverid, retvar) check for reply string
+ remote_read( serverid) read reply string
+ server2client( serverid, string) send reply string
+ remote_foreground( server) bring server to the front
+
+See also the explanation of |CTRL-\_CTRL-N|. Very useful as a leading key
+sequence.
+The {serverid} for server2client() can be obtained with expand("<client>")
+
+==============================================================================
+2. X11 specific items *x11-clientserver*
+ *E247* *E248* *E251* *E258* *E277*
+
+The communication between client and server goes through the X server. The
+display of the Vim server must be specified. The usual protection of the X
+server is used, you must be able to open a window on the X server for the
+communication to work. It is possible to communicate between different
+systems.
+
+By default, a GUI Vim will register a name on the X-server by which it can be
+addressed for subsequent execution of injected strings. Vim can also act as
+a client and send strings to other instances of Vim on the same X11 display.
+
+When an X11 GUI Vim (gvim) is started, it will try to register a send-server
+name on the 'VimRegistry' property on the root window.
+
+A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can
+also act as a command server if a server name is explicitly given with the
+--servername argument.
+
+An empty --servername argument will cause the command server to be disabled.
+
+To send commands to a Vim server from another application, read the source
+file src/if_xcmdsrv.c, it contains some hints about the protocol used.
+
+==============================================================================
+3. Win32 specific items *w32-clientserver*
+
+Every Win32 Vim can work as a server, also in the console. You do not need a
+version compiled with OLE. Windows messages are used, this works on any
+version of MS-Windows. But only communication within one system is possible.
+
+Since MS-Windows messages are used, any other application should be able to
+communicate with a Vim server. An alternative is using the OLE functionality
+|ole-interface|.
+
+When using gvim, the --remote-wait only works properly this way: >
+
+ start /w gvim --remote-wait file.txt
+<
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
new file mode 100644
index 000000000..5aee40187
--- /dev/null
+++ b/runtime/doc/repeat.txt
@@ -0,0 +1,529 @@
+*repeat.txt* For Vim version 7.0aa. Last change: 2004 Apr 02
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Repeating commands, Vim scripts and debugging *repeating*
+
+Chapter 26 of the user manual introduces repeating |usr_26.txt|.
+
+1. Single repeats |single-repeat|
+2. Multiple repeats |multi-repeat|
+3. Complex repeats |complex-repeat|
+4. Using Vim scripts |using-scripts|
+5. Debugging scripts |debug-scripts|
+
+==============================================================================
+1. Single repeats *single-repeat*
+
+ *.*
+. Repeat last change, with count replaced with [count].
+ Also repeat a yank command, when the 'y' flag is
+ included in 'cpoptions'.
+
+Simple changes can be repeated with the "." command. Without a count, the
+count of the last change is used. If you enter a count, it will replace the
+last one. If the last change included a specification of a numbered register,
+the register number will be incremented. See |redo-register| for an example
+how to use this. Note that when repeating a command that used a Visual
+selection, the same SIZE of area is used, see |visual-repeat|.
+
+ *@:*
+@: Repeat last command-line [count] times.
+ {not available when compiled without the
+ |+cmdline_hist| feature}
+
+
+==============================================================================
+2. Multiple repeats *multi-repeat*
+
+ *:g* *:global* *E147* *E148*
+:[range]g[lobal]/{pattern}/[cmd]
+ Execute the Ex command [cmd] (default ":p") on the
+ lines within [range] where {pattern} matches.
+
+:[range]g[lobal]!/{pattern}/[cmd]
+ Execute the Ex command [cmd] (default ":p") on the
+ lines within [range] where {pattern} does NOT match.
+
+ *:v* *:vglobal*
+:[range]v[global]/{pattern}/[cmd]
+ Same as :g!.
+
+The global commands work by first scanning through the [range] lines and
+marking each line where a match occurs (for a multi-line pattern, only the
+start of the match matters).
+In a second scan the [cmd] is executed for each marked line with its line
+number prepended. For ":v" and ":g!" the command is executed for each not
+marked line. If a line is deleted its mark disappears.
+The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
+the command. If an error message is given for a line, the command for that
+line is aborted and the global command continues with the next marked or
+unmarked line.
+
+To repeat a non-Ex command, you can use the ":normal" command: >
+ :g/pat/normal {commands}
+Make sure that {commands} ends with a whole command, otherwise Vim will wait
+for you to type the rest of the command for each match. The screen will not
+have been updated, so you don't know what you are doing. See |:normal|.
+
+The undo/redo command will undo/redo the whole global command at once.
+The previous context mark will only be set once (with "''" you go back to
+where the cursor was before the global command).
+
+The global command sets both the last used search pattern and the last used
+substitute pattern (this is vi compatible). This makes it easy to globally
+replace a string:
+ :g/pat/s//PAT/g
+This replaces all occurrences of "pat" with "PAT". The same can be done with:
+ :%s/pat/PAT/g
+Which is two characters shorter!
+
+==============================================================================
+3. Complex repeats *complex-repeat*
+
+ *q* *recording*
+q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
+ (uppercase to append). The 'q' command is disabled
+ while executing a register, and it doesn't work inside
+ a mapping. {Vi: no recording}
+
+q Stops recording. (Implementation note: The 'q' that
+ stops recording is not stored in the register, unless
+ it was the result of a mapping) {Vi: no recording}
+
+ *@*
+@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} [count]
+ times. Note that register '%' (name of the current
+ file) and '#' (name of the alternate file) cannot be
+ used. For "@=" you are prompted to enter an
+ expression. The result of the expression is then
+ executed. See also |@:|. {Vi: only named registers}
+
+ *@@*
+@@ Repeat the previous @{0-9a-z":*} [count] times.
+
+:[addr]*{0-9a-z".=} *:@* *:star*
+:[addr]@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} as an Ex
+ command. First set cursor at line [addr] (default is
+ current line). When the last line in the register does
+ not have a <CR> it will be added automatically when
+ the 'e' flag is present in 'cpoptions'.
+ Note that the ":*" command is only recognized when the
+ '*' flag is present in 'cpoptions'. This is NOT the
+ default when 'nocompatible' is used.
+ For ":@=" the last used expression is used. The
+ result of evaluating the expression is executed as an
+ Ex command.
+ Mappings are not recognized in these commands.
+ {Vi: only in some versions} Future: Will execute the
+ register for each line in the address range.
+
+ *:@:*
+:[addr]@: Repeat last command-line. First set cursor at line
+ [addr] (default is current line). {not in Vi}
+
+ *:@@*
+:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
+ line [addr] (default is current line). {Vi: only in
+ some versions}
+
+==============================================================================
+4. Using Vim scripts *using-scripts*
+
+For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
+
+ *:so* *:source* *load-vim-script*
+:so[urce] {file} Read Ex commands from {file}. These are commands that
+ start with a ":".
+
+:so[urce]! {file} Read Vim commands from {file}. These are commands
+ that are executed from Normal mode, like you type
+ them.
+ When used after |:global|, |:argdo|, |:windo|,
+ |:bufdo|, in a loop or when another command follows
+ the display won't be updated while executing the
+ commands.
+ {not in Vi}
+
+ *:ru* *:runtime*
+:ru[ntime][!] {file} ..
+ Read Ex commands from {file} in each directory given
+ by 'runtimepath'. There is no error for non-existing
+ files. Example: >
+ :runtime syntax/c.vim
+
+< There can be multiple {file} arguments, separated by
+ spaces. Each {file} is searched for in the first
+ directory from 'runtimepath', then in the second
+ directory, etc. Use a backslash to include a space
+ inside {file} (although it's better not to use spaces
+ in file names, it causes trouble).
+
+ When [!] is included, all found files are sourced.
+ When it is not included only the first found file is
+ sourced.
+
+ When {file} contains wildcards it is expanded to all
+ matching files. Example: >
+ :runtime! plugin/*.vim
+< This is what Vim uses to load the plugin files when
+ starting up. This similar command: >
+ :runtime plugin/*.vim
+< would source the first file only.
+
+ When 'verbose' is one or higher, there is a message
+ when no file could be found.
+ When 'verbose' is two or higher, there is a message
+ about each searched file.
+ {not in Vi}
+
+:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
+ Specify the character encoding used in the script.
+ The following lines will be converted from [encoding]
+ to the value of the 'encoding' option, if they are
+ different. Examples: >
+ scriptencoding iso-8859-5
+ scriptencoding cp932
+<
+ When [encoding] is empty, no conversion is done. This
+ can be used to restrict conversion to a sequence of
+ lines: >
+ scriptencoding euc-jp
+ ... lines to be converted ...
+ scriptencoding
+ ... not converted ...
+
+< When conversion isn't supported by the system, there
+ is no error message and no conversion is done.
+
+ Don't use "ucs-2" or "ucs-4", scripts cannot be in
+ these encodings (they would contain NUL bytes).
+ When a sourced script starts with a BOM (Byte Order
+ Mark) in utf-8 format Vim will recognized it, no need
+ to use ":scriptencoding utf-8" then.
+
+ When compiled without the |+multi_byte| feature this
+ command is ignored.
+ {not in Vi}
+
+ *:scrip* *:scriptnames*
+:scrip[tnames] List all sourced script names, in the order they were
+ first sourced. The number is used for the script ID
+ |<SID>|.
+ {not in Vi} {not available when compiled without the
+ |+eval| feature}
+
+ *:fini* *:finish* *E168*
+:fini[sh] Stop sourcing a script. Can only be used in a Vim
+ script file. This is a quick way to skip the rest of
+ the file. If it is used after a |:try| but before the
+ matching |:finally| (if present), the commands
+ following the ":finally" up to the matching |:endtry|
+ are executed first. This process applies to all
+ nested ":try"s in the script. The outermost ":endtry"
+ then stops sourcing the script. {not in Vi}
+
+All commands and command sequences can be repeated by putting them in a named
+register and then executing it. There are two ways to get the commands in the
+register:
+- Use the record command "q". You type the commands once, and while they are
+ being executed they are stored in a register. Easy, because you can see
+ what you are doing. If you make a mistake, "p"ut the register into the
+ file, edit the command sequence, and then delete it into the register
+ again. You can continue recording by appending to the register (use an
+ uppercase letter).
+- Delete or yank the command sequence into the register.
+
+Often used command sequences can be put under a function key with the ':map'
+command.
+
+An alternative is to put the commands in a file, and execute them with the
+':source!' command. Useful for long command sequences. Can be combined with
+the ':map' command to put complicated commands under a function key.
+
+The ':source' command reads Ex commands from a file line by line. You will
+have to type any needed keyboard input. The ':source!' command reads from a
+script file character by character, interpreting each character as if you
+typed it.
+
+Example: When you give the ":!ls" command you get the |hit-enter| prompt. If
+you ':source' a file with the line "!ls" in it, you will have to type the
+<Enter> yourself. But if you ':source!' a file with the line ":!ls" in it,
+the next characters from that file are read until a <CR> is found. You will
+not have to type <CR> yourself, unless ":!ls" was the last line in the file.
+
+It is possible to put ':source[!]' commands in the script file, so you can
+make a top-down hierarchy of script files. The ':source' command can be
+nested as deep as the number of files that can be opened at one time (about
+15). The ':source!' command can be nested up to 15 levels deep.
+
+You can use the "<sfile>" string (literally, this is not a special key) inside
+of the sourced file, in places where a file name is expected. It will be
+replaced by the file name of the sourced file. For example, if you have a
+"other.vimrc" file in the same directory as your ".vimrc" file, you can source
+it from your ".vimrc" file with this command: >
+ :source <sfile>:h/other.vimrc
+
+In script files terminal-dependent key codes are represented by
+terminal-independent two character codes. This means that they can be used
+in the same way on different kinds of terminals. The first character of a
+key code is 0x80 or 128, shown on the screen as "~@". The second one can be
+found in the list |key-notation|. Any of these codes can also be entered
+with CTRL-V followed by the three digit decimal code. This does NOT work for
+the <t_xx> termcap codes, these can only be used in mappings.
+
+ *:source_crnl* *W15*
+MS-DOS, Win32 and OS/2: Files that are read with ":source" normally have
+<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s
+(for example, a file made on Unix), this will be recognized if 'fileformats'
+is not empty and the first line does not end in a <CR>. This fails if the
+first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
+the first line ends in a <CR>, but following ones don't, you will get an error
+message, because the <CR> from the first lines will be lost.
+
+Macintosh: Files that are read with ":source" normally have <CR> <EOL>s.
+These always work. If you are using a file with <NL> <EOL>s (for example, a
+file made on Unix), this will be recognized if 'fileformats' is not empty and
+the first line does not end in a <CR>. Be careful not to use a file with <NL>
+linebreaks which has a <CR> in first line.
+
+On other systems, Vim expects ":source"ed files to end in a <NL>. These
+always work. If you are using a file with <CR><NL> <EOL>s (for example, a
+file made on MS-DOS), all lines will have a trailing <CR>. This may cause
+problems for some commands (e.g., mappings). There is no automatic <EOL>
+detection, because it's common to start with a line that defines a mapping
+that ends in a <CR>, which will confuse the automaton.
+
+ *line-continuation*
+Long lines in a ":source"d Ex command script file can be split by inserting
+a line continuation symbol "\" (backslash) at the start of the next line.
+There can be white space before the backslash, which is ignored.
+
+Example: the lines >
+ :set comments=sr:/*,mb:*,el:*/,
+ \://,
+ \b:#,
+ \:%,
+ \n:>,
+ \fb:-
+are interpreted as if they were given in one line:
+ :set comments=sr:/*,mb:*,el:*/,://,b:#,:%,n:>,fb:-
+
+All leading whitespace characters in the line before a backslash are ignored.
+Note however that trailing whitespace in the line before it cannot be
+inserted freely; it depends on the position where a command is split up
+whether additional whitespace is allowed or not.
+
+There is a problem with the ":append" and ":insert" commands: >
+ :1append
+ \asdf
+ .
+The backslash is seen as a line-continuation symbol, thus this results in the
+command: >
+ :1appendasdf
+ .
+To avoid this, add the 'C' flag to the 'cpoptions' option: >
+ :set cpo+=C
+ :1append
+ \asdf
+ .
+ :set cpo-=C
+
+Note that when the commands are inside a function, you need to add the 'C'
+flag when defining the function, it is not relevant when executing it. >
+ :set cpo+=C
+ :function Foo()
+ :1append
+ \asdf
+ .
+ :endfunction
+ :set cpo-=C
+
+Rationale:
+ Most programs work with a trailing backslash to indicate line
+ continuation. Using this in Vim would cause incompatibility with Vi.
+ For example for this Vi mapping: >
+ :map xx asdf\
+< Therefore the unusual leading backslash is used.
+
+==============================================================================
+5. Debugging scripts *debug-scripts*
+
+Besides the obvious messages that you can add to your scripts to find out what
+they are doing, Vim offers a debug mode. This allows you to step through a
+sourced file or user function and set breakpoints.
+
+NOTE: The debugging mode is far from perfect. Debugging will have side
+effects on how Vim works. You cannot use it to debug everything. For
+example, the display is messed up by the debugging messages.
+{Vi does not have a debug mode}
+
+An alternative to debug mode is setting the 'verbose' option. With a bigger
+number it will give more verbose messages about what Vim is doing.
+
+
+STARTING DEBUG MODE *debug-mode*
+
+To enter debugging mode use one of these methods:
+1. Start Vim with the |-D| argument: >
+ vim -D file.txt
+< Debugging will start as soon as the first vimrc file is sourced. This is
+ useful to find out what is happening when Vim is starting up. A side
+ effect is that Vim will switch the terminal mode before initialisations
+ have finished, with unpredictable results.
+ For a GUI-only version (Windows, Macintosh) the debugging will start as
+ soon as the GUI window has been opened. To make this happen early, add a
+ ":gui" command in the vimrc file.
+ *:debug*
+2. Run a command with ":debug" prepended. Debugging will only be done while
+ this command executes. Useful for debugging a specific script or user
+ function. And for scripts and functions used by autocommands. Example: >
+ :debug edit test.txt.gz
+
+3. Set a breakpoint in a sourced file or user function. You could do this in
+ the command line: >
+ vim -c "breakadd file */explorer.vim" .
+< This will run Vim and stop in the first line of the "explorer.vim" script.
+ Breakpoints can also be set while in debugging mode.
+
+In debugging mode every executed command is displayed before it is executed.
+Comment lines, empty lines and lines that are not executed are skipped. When
+a line contains two commands, separated by "|", each command will be displayed
+separately.
+
+
+DEBUG MODE
+
+Once in debugging mode, the usual Ex commands can be used. For example, to
+inspect the value of a variable: >
+ echo idx
+When inside a user function, this will print the value of the local variable
+"idx". Prepend "g:" to get the value of a global variable: >
+ echo g:idx
+All commands are executed in the context of the current function or script.
+You can also set options, for example setting or resetting 'verbose' will show
+what happens, but you might want to set it just before executing the lines you
+are interested in: >
+ :set verbose=20
+
+Commands that require updating the screen should be avoided, because their
+effect won't be noticed until after leaving debug mode. For example: >
+ :help
+won't be very helpful.
+
+There is a separate command-line history for debug mode.
+
+The line number for a function line is relative to the start of the function.
+If you have trouble figuring out where you are, edit the file that defines
+the function in another Vim, search for the start of the function and do
+"99j". Replace "99" with the line number.
+
+Additionally, these commands can be used:
+ *>cont*
+ cont Continue execution until the next breakpoint is hit.
+ *>quit*
+ quit Abort execution. This is like using CTRL-C, some
+ things might still be executed, doesn't abort
+ everything. Still stops at the next breakpoint.
+ *>next*
+ next Execute the command and come back to debug mode when
+ it's finished. This steps over user function calls
+ and sourced files.
+ *>step*
+ step Execute the command and come back to debug mode for
+ the next command. This steps into called user
+ functions and sourced files.
+ *>interrupt*
+ interrupt This is like using CTRL-C, but unlike ">quit" comes
+ back to debug mode for the next command that is
+ executed. Useful for testing |:finally| and |:catch|
+ on interrupt exceptions.
+ *>finish*
+ finish Finish the current script or user function and come
+ back to debug mode for the command after the one that
+ sourced or called it.
+
+About the additional commands in debug mode:
+- There is no command-line completion for them, you get the completion for the
+ normal Ex commands only.
+- You can shorten them, up to a single character: "c", "n", "s" and "f".
+- Hitting <CR> will repeat the previous one. When doing another command, this
+ is reset (because it's not clear what you want to repeat).
+- When you want to use the Ex command with the same name, prepend a colon:
+ ":cont", ":next", ":finish" (or shorter).
+
+
+DEFINING BREAKPOINTS
+ *:breaka* *:breakadd*
+:breaka[dd] func [lnum] {name}
+ Set a breakpoint in a function. Example: >
+ :breakadd func Explore
+< Doesn't check for a valid function name, thus the breakpoint
+ can be set before the function is defined.
+
+:breaka[dd] file [lnum] {name}
+ Set a breakpoint in a sourced file. Example: >
+ :breakadd file 43 .vimrc
+
+The [lnum] is the line number of the breakpoint. Vim will stop at or after
+this line. When omitted line 1 is used.
+
+{name} is a pattern that is matched with the file or function name. The
+pattern is like what is used for autocommands. There must be a full match (as
+if the pattern starts with "^" and ends in "$"). A "*" matches any sequence
+of characters. 'ignorecase' is not used, but "\c" can be used in the pattern
+to ignore case |/\c|. Don't include the () for the function name!
+
+The match for sourced scripts is done against the full file name. Examples: >
+ breakadd file explorer
+won't match, the path is missing. >
+ breakadd file *explorer.vim
+matches ".../plugin/explorer.vim" and ".../plugin/iexplorer.vim". >
+ breakadd file */explorer.vim
+matches ".../plugin/explorer.vim" only.
+
+The match for functions is done against the name as it's shown in the output
+of ":function". For local functions this means that something like "<SNR>99_"
+is prepended.
+
+
+DELETING BREAKPOINTS
+ *:breakd* *:breakdel* *E161*
+:breakd[el] {nr}
+ Delete breakpoint {nr}. Use |:breaklist| to see the number of
+ each breakpoint.
+
+:breakd[el] func [lnum] {name}
+ Delete a breakpoint in a function.
+
+:breakd[el] file [lnum] {name}
+ Delete a breakpoint in a sourced file.
+
+When [lnum] is omitted, the first breakpoint in the function or file is
+deleted.
+The {name} must be exactly the same as what was typed for the ":breakadd"
+command. "explorer", "*explorer.vim" and "*explorer*" are different.
+
+
+LISTING BREAKPOINTS
+ *:breakl* *:breaklist*
+:breakl[ist]
+ List all breakpoints.
+
+
+OBSCURE
+
+ *:debugg* *:debuggreedy*
+:debugg[reedy]
+ Read debug mode commands from the normal input stream, instead
+ of getting them directly from the user. Only useful for test
+ scripts. Example: >
+ echo 'q^Mq' | vim -e -s -c debuggreedy -c 'breakadd file script.vim' -S script.vim
+
+:0debugg[reedy]
+ Undo ":debuggreedy": get debug mode commands directly from the
+ user, don't use typeahead for debug commands.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
new file mode 100644
index 000000000..c7c53aaf0
--- /dev/null
+++ b/runtime/doc/rileft.txt
@@ -0,0 +1,125 @@
+*rileft.txt* For Vim version 7.0aa. Last change: 2003 May 07
+
+
+ VIM REFERENCE MANUAL by Avner Lottem
+ updated by Nadim Shaikli
+
+
+Right to Left display mode for Vim *rileft*
+
+
+These functions were originally created by Avner Lottem:
+ E-mail: alottem@iil.intel.com
+ Phone: +972-4-8307322
+
+{Vi does not have any of these commands}
+
+ *E26*
+This feature is only available when the |+rightleft| feature was enabled
+at compile time.
+
+
+Introduction
+------------
+Some languages such as Arabic, Farsi, Hebrew (among others) require the
+ability to display their text from right-to-left. Files in those languages
+are stored conventionally and the right-to-left requirement is only a
+function of the display engine (per the Unicode specification). In
+right-to-left oriented files the characters appear on the screen from
+right to left.
+
+Bidirectionality (or bidi for short) is what Unicode offers as a full
+solution to these languages. Bidi offers the user the ability to view
+both right-to-left as well as left-to-right text properly at the same time
+within the same window. Vim currently, due to simplicity, does not offer
+bidi and is merely opting to present a functional means to display/enter/use
+right-to-left languages. An older hybrid solution in which direction is
+encoded for every character (or group of characters) are not supported either
+as this kind of support is out of the scope of a simple addition to an
+existing editor (and its not sanctioned by Unicode either).
+
+
+Highlights
+----------
+o Editing left-to-right files as in the original Vim, no change.
+
+o Viewing and editing files in right-to-left windows. File orientation
+ is per window, so it is possible to view the same file in right-to-left
+ and left-to-right modes, simultaneously. (Useful for editing mixed files
+ in which both right-to-left and left-to-right text exist).
+
+o Compatibility to the original Vim. Almost all features work in
+ right-to-left mode (see Bugs below).
+
+o Backing from reverse insert mode to the correct place in the file
+ (if possible).
+
+o No special terminal with right-to-left capabilities is required. The
+ right-to-left changes are completely hardware independent.
+
+o Many languages use and require right-to-left support. These languages
+ can quite easily be supported given the inclusion of their required
+ keyboard mappings and some possible minor code change. Some of the
+ current supported languages include - |arabic.txt|, |farsi.txt| and
+ |hebrew.txt|.
+
+
+Of Interest...
+--------------
+
+o Invocations
+ -----------
+ + 'rightleft' ('rl') sets window orientation to right-to-left.
+ + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
+ allows one to remove a composing character which gets superimposed
+ on those that proceeded them (some languages require this).
+ + 'rightleftcmd' ('rlc') sets the command-line within certain modes
+ (such as search) to be utilized in right-to-left orientation as well.
+
+o Typing backwards *ins-reverse*
+ ----------------
+ In lieu of using full-fledged the 'rightleft' option, one can opt for
+ reverse insertion. When the 'revins' (reverse insert) option is set,
+ inserting happens backwards. This can be used to type right-to-left
+ text. When inserting characters the cursor is not moved and the text
+ moves rightwards. A <BS> deletes the character under the cursor.
+ CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
+ and CTRL-U do not stop at the start of insert or end of line, no matter
+ how the 'backspace' option is set.
+
+ There is no reverse replace mode (yet).
+
+ If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
+ in the status line when reverse Insert mode is active.
+
+o Pasting when in a rightleft window
+ ----------------------------------
+ When cutting text with the mouse and pasting it in a rightleft window
+ the text will be reversed, because the characters come from the cut buffer
+ from the left to the right, while inserted in the file from the right to
+ the left. In order to avoid it, toggle 'revins' before pasting.
+
+
+Bugs
+----
+o Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly
+ when in rightleft window.
+
+o Does not support reverse insert and rightleft modes on the command-line.
+ However, functionality of the editor is not reduced, because it is
+ possible to enter mappings, abbreviations and searches typed from the
+ left to the right on the command-line.
+
+o Somewhat slower in right-to-left mode, because right-to-left motion is
+ emulated inside Vim, not by the controlling terminal.
+
+o When the Athena GUI is used, the bottom scrollbar works in the wrong
+ direction. This is difficult to fix.
+
+o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
+ Lines do not wrap at all; you just get a single, long line.
+
+o There is no full bidirectionality (bidi) support.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt
new file mode 100644
index 000000000..868f5c876
--- /dev/null
+++ b/runtime/doc/russian.txt
@@ -0,0 +1,83 @@
+*russian.txt* For Vim version 7.0aa. Last change: 2004 Jun 09
+
+
+ VIM REFERENCE MANUAL by Vassily Ragosin
+
+
+Russian language localization and support in Vim *russian* *Russian*
+
+1. Introduction |russian-intro|
+2. Russian keymaps |russian-keymap|
+3. Localization |russian-l18n|
+4. Known issues |russian-issues|
+
+===============================================================================
+1. Introduction *russian-intro*
+
+Russian language is supported perfectly well in Vim. You can type and view
+Russian text just as any other, without the need to tweak the settings.
+
+===============================================================================
+2. Russian keymaps *russian-keymap*
+
+To switch between languages you can use your system native keyboard switcher,
+or use one of the Russian keymaps, included in the Vim distribution. For
+example,
+>
+ :set keymap=russian-jcukenwin
+<
+In the latter case, you can switch between languages even if you do not have
+system Russian keyboard or independently from a system-wide keyboard settings.
+See 'keymap'. You can also map a key to switch between keyboards, if you
+choose the latter option. See |:map|.
+
+For your convenience, to avoid switching between keyboards, when you need to
+enter Normal mode command, you can also set 'langmap' option:
+>
+ :set langmap=ФИСВУÐПРШОЛДЬТЩЗЙКЫЕГМЦЧÐЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,
+ фиÑвуапршолдьтщзйкыегмцчнÑ;abcdefghijklmnopqrstuvwxyz
+
+This is in utf-8, you cannot read this if your 'encoding' is not utf-8.
+You have to type this command in one line, it is wrapped for the sake of
+readability.
+
+===============================================================================
+3. Localization *russian-l18n*
+
+If you wish to use messages, help files, menus and other items translated to
+Russian, you will need to install the RuVim Language Pack, available in
+different codepages from
+
+ http://www.sourceforge.net/projects/ruvim/
+
+Make sure that your Vim is at least 6.2.506 and use ruvim 0.5 or later for
+automatic installs. Vim also needs to be compiled with |+gettext| feature for
+user interface items translations to work.
+
+After downloading an archive from RuVim project, unpack it into your
+$VIMRUNTIME directory. We recommend using UTF-8 archive, if your version of
+Vim is compiled with |+multi_byte| feature enabled.
+
+In order to use the Russian documentation, make sure you have set the
+'helplang' option to "ru".
+
+===============================================================================
+4. Known issues *russian-issues*
+
+-- If you are using Russian message translations in Win32 console, then
+ you may see the output produced by "vim --help", "vim --version" commands
+ and Win32 console window title appearing in a wrong codepage. This problem
+ is related to a bug in GNU gettext library and may be fixed in the future
+ releases of gettext.
+
+-- When using the Win32 console version of Vim you may experience a problem
+ with many Cyrillic glyphs being replaced by whitespaces for some unknown
+ reason. Sergey Khorev suggested a registry hack to avoid this:
+
+ REGEDIT4
+
+ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage]
+ "1252"="c_1251.nls"
+
+===============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt
new file mode 100644
index 000000000..288552d5c
--- /dev/null
+++ b/runtime/doc/scroll.txt
@@ -0,0 +1,303 @@
+*scroll.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Scrolling *scrolling*
+
+These commands move the contents of the window. If the cursor position is
+moved off of the window, the cursor is moved onto the window (with
+'scrolloff' screen lines around it). A page is the number of lines in the
+window minus two. The mnemonics for these commands may be a bit confusing.
+Remember that the commands refer to moving the window (the part of the buffer
+that you see) upwards or downwards in the buffer. When the window moves
+upwards in the buffer, the text in the window moves downwards on your screen.
+
+See section |03.7| of the user manual for an introduction.
+
+1. Scrolling downwards |scroll-down|
+2. Scrolling upwards |scroll-up|
+3. Scrolling relative to cursor |scroll-cursor|
+4. Scrolling horizontally |scroll-horizontal|
+5. Scrolling synchronously |scroll-binding|
+6. Scrolling with a mouse wheel |scroll-mouse-wheel|
+
+==============================================================================
+1. Scrolling downwards *scroll-down*
+
+The following commands move the edit window (the part of the buffer that you
+see) downwards (this means that more lines downwards in the text buffer can be
+seen):
+
+ *CTRL-E*
+CTRL-E Scroll window [count] lines downwards in the buffer.
+ Mnemonic: Extra lines.
+
+ *CTRL-D*
+CTRL-D Scroll window Downwards in the buffer. The number of
+ lines comes from the 'scroll' option (default: half a
+ screen). If [count] given, first set 'scroll' option
+ to [count]. The cursor is moved the same number of
+ lines down in the file (if possible; when lines wrap
+ and when hitting the end of the file there may be a
+ difference). When the cursor is on the last line of
+ the buffer nothing happens and a beep is produced.
+ See also 'startofline' option.
+ {difference from vi: Vim scrolls 'scroll' screen
+ lines, instead of file lines; makes a difference when
+ lines wrap}
+
+<S-Down> or *<S-Down>* *<kPageDown>*
+<PageDown> or *<PageDown>* *CTRL-F*
+CTRL-F Scroll window [count] pages Forwards (downwards) in
+ the buffer. See also 'startofline' option.
+
+ *z+*
+z+ Without [count]: Redraw with the line just below the
+ window at the top of the window. Put the cursor in
+ that line, at the first non-blank in the line.
+ With [count]: just like "z<CR>".
+
+==============================================================================
+2. Scrolling upwards *scroll-up*
+
+The following commands move the edit window (the part of the buffer that you
+see) upwards (this means that more lines upwards in the text buffer can be
+seen):
+
+ *CTRL-Y*
+CTRL-Y Scroll window [count] lines upwards in the buffer.
+ Note: When using the MS-Windows key bindings CTRL-Y is
+ remapped to redo.
+
+ *CTRL-U*
+CTRL-U Scroll window Upwards in the buffer. The number of
+ lines comes from the 'scroll' option (default: half a
+ screen). If [count] given, first set the 'scroll'
+ option to [count]. The cursor is moved the same
+ number of lines up in the file (if possible; when
+ lines wrap and when hitting the end of the file there
+ may be a difference). When the cursor is on the first
+ line of the buffer nothing happens and a beep is
+ produced. See also 'startofline' option.
+ {difference from vi: Vim scrolls 'scroll' screen
+ lines, instead of file lines; makes a difference when
+ lines wrap}
+
+<S-Up> or *<S-Up>* *<kPageUp>*
+<PageUp> or *<PageUp>* *CTRL-B*
+CTRL-B Scroll window [count] pages Backwards (upwards) in the
+ buffer. See also 'startofline' option.
+
+ *z^*
+z^ Without [count]: Redraw with the line just above the
+ window at the bottom of the window. Put the cursor in
+ that line, at the first non-blank in the line.
+ With [count]: First scroll the text to put the [count]
+ line at the bottom of the window, then redraw with the
+ line which is now at the top of the window at the
+ bottom of the window. Put the cursor in that line, at
+ the first non-blank in the line.
+
+==============================================================================
+3. Scrolling relative to cursor *scroll-cursor*
+
+The following commands reposition the edit window (the part of the buffer that
+you see) while keeping the cursor on the same line:
+
+ *z<CR>*
+z<CR> Redraw, line [count] at top of window (default
+ cursor line). Put cursor at first non-blank in the
+ line.
+
+ *zt*
+zt Like "z<CR>", but leave the cursor in the same
+ column. {not in Vi}
+
+ *zN<CR>*
+z{height}<CR> Redraw, make window {height} lines tall. This is
+ useful to make the number of lines small when screen
+ updating is very slow. Cannot make the height more
+ than the physical screen height.
+
+ *z.*
+z. Redraw, line [count] at center of window (default
+ cursor line). Put cursor at first non-blank in the
+ line.
+
+ *zz*
+zz Like "z.", but leave the cursor in the same column.
+ Careful: If caps-lock is on, this commands becomes
+ "ZZ": write buffer and exit! {not in Vi}
+
+ *z-*
+z- Redraw, line [count] at bottom of window (default
+ cursor line). Put cursor at first non-blank in the
+ line.
+
+ *zb*
+zb Like "z-", but leave the cursor in the same column.
+ {not in Vi}
+
+==============================================================================
+4. Scrolling horizontally *scroll-horizontal*
+
+For the following four commands the cursor follows the screen. If the
+character that the cursor is on is moved off the screen, the cursor is moved
+to the closest character that is on the screen. The value of 'sidescroll' is
+not used.
+
+z<Right> or *zl* *z<Right>*
+zl Scroll the screen [count] characters to the left.
+ This only works when 'wrap' is off. {not in Vi}
+
+z<Left> or *zh* *z<Left>*
+zh Scroll the screen [count] characters to the right.
+ This only works when 'wrap' is off. {not in Vi}
+
+ *zL*
+zL Scroll the screen half a screenwidth to the left.
+ This only works when 'wrap' is off. {not in Vi}
+
+ *zH*
+zH Scroll the screen half a screenwidth to the right.
+ This only works when 'wrap' is off. {not in Vi}
+
+For the following two commands the cursor is not moved in the text, only the
+text scrolls on the screen.
+
+ *zs*
+zs Scroll the screen horizontally to position the cursor
+ at the start (left side) of the screen. This only
+ works when 'wrap' is off. {not in Vi}
+
+ *ze*
+ze Scroll the screen horizontally to position the cursor
+ at the end (right side) of the screen. This only
+ works when 'wrap' is off. {not in Vi}
+
+==============================================================================
+5. Scrolling synchronously *scroll-binding*
+
+Occasionally, it is desirable to bind two or more windows together such that
+when one window is scrolled, the other windows are scrolled also. In Vim,
+windows can be given this behavior by setting the (window-specific)
+'scrollbind' option. When a window that has 'scrollbind' set is scrolled, all
+other 'scrollbind' windows are scrolled the same amount, if possible. The
+behavior of 'scrollbind' can be modified by the 'scrollopt' option.
+
+When using the scrollbars, the binding only happens when scrolling the window
+with focus (where the cursor is). You can use this to avoid scroll-binding
+for a moment without resetting options.
+
+When a window also has the 'diff' option set, the scroll-binding uses the
+differences between the two buffers to synchronize the position precisely.
+Otherwise the following method is used.
+
+ *scrollbind-relative*
+Each 'scrollbind' window keeps track of its "relative offset," which can be
+thought of as the difference between the current window's vertical scroll
+position and the other window's vertical scroll position. When one of the
+'scrollbind' windows is asked to vertically scroll past the beginning or end
+limit of its text, the window no longer scrolls, but remembers how far past
+the limit it wishes to be. The window keeps this information so that it can
+maintain the same relative offset, regardless of its being asked to scroll
+past its buffer's limits.
+
+However, if a 'scrollbind' window that has a relative offset that is past its
+buffer's limits is given the cursor focus, the other 'scrollbind' windows must
+jump to a location where the current window's relative offset is valid. This
+behavior can be changed by clearing the 'jump' flag from the 'scrollopt'
+option.
+
+ *syncbind* *:syncbind*
+:syncbind Force all 'scrollbind' windows to have the same
+ relative offset. I.e., when any of the 'scrollbind'
+ windows is scrolled to the top of its buffer, all of
+ the 'scrollbind' windows will also be at the top of
+ their buffers.
+
+ *scrollbind-quickadj*
+The 'scrollbind' flag is meaningful when using keyboard commands to vertically
+scroll a window, and also meaningful when using the vertical scrollbar of the
+window which has the cursor focus. However, when using the vertical scrollbar
+of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
+This allows quick adjustment of the relative offset of 'scrollbind' windows.
+
+==============================================================================
+6. Scrolling with a mouse wheel *scroll-mouse-wheel*
+
+When your mouse has a scroll wheel, it should work with Vim in the GUI. How
+it works depends on your system. It might also work in an xterm
+|xterm-mouse-wheel|.
+
+For the Win32 GUI the scroll action is hard coded. It works just like
+dragging the scrollbar of the current window. How many lines are scrolled
+depends on your mouse driver. If the scroll action causes input focus
+problems, see |intellimouse-wheel-problems|.
+
+For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
+presses <MouseDown> and <MouseUp>. The default action for these keys are:
+ <MouseDown> scroll three lines down. *<MouseDown>*
+ <S-MouseDown> scroll a full page down. *<S-MouseDown>*
+ <C-MouseDown> scroll a full page down. *<C-MouseDown>*
+ <MouseUp> scroll three lines up. *<MouseUp>*
+ <S-MouseUp> scroll a full page up. *<S-MouseUp>*
+ <C-MouseUp> scroll a full page up. *<C-MouseUp>*
+This should work in all modes, except when editing the command line.
+
+Note that <MouseDown> is used for scrolling the text down, this happens when
+you turn the mouse wheel up!
+
+You can modify this behavior by mapping the keys. For example, to make the
+scroll wheel move one line or half a page in Normal mode: >
+ :map <MouseDown> <C-Y>
+ :map <S-MouseDown> <C-U>
+ :map <MouseUp> <C-E>
+ :map <S-MouseUp> <C-D>
+You can also use Alt and Ctrl modifiers.
+
+This only works when Vim gets the scroll wheel events, of course. You can
+check if this works with the "xev" program.
+
+When using Xfree86, the /etc/XF86Config file should have the correct entry for
+your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
+ Protocol "MouseMan"
+ Device "/dev/psm0"
+ ZAxisMapping 4 5
+See the Xfree86 documentation for information.
+
+ *xterm-mouse-wheel*
+To use the mouse wheel in a new xterm you only have to make the scroll wheel
+work in your Xserver, as mentioned above.
+
+To use the mouse wheel in an older xterm you must do this:
+1. Make it work in your Xserver, as mentioned above.
+2. Add translations for the xterm, so that the xterm will pass a scroll event
+ to Vim as an escape sequence.
+3. Add mappings in Vim, to interpret the escape sequences as <MouseUp> or
+ <MouseDown> keys.
+
+You can do the translations by adding this to your ~.Xdefaults file (or other
+file where your X resources are kept): >
+
+ XTerm*VT100.Translations: #override \n\
+ s<Btn4Down>: string("0x9b") string("[64~") \n\
+ s<Btn5Down>: string("0x9b") string("[65~") \n\
+ <Btn4Down>: string("0x9b") string("[62~") \n\
+ <Btn5Down>: string("0x9b") string("[63~") \n\
+ <Btn4Up>: \n\
+ <Btn5Up>:
+
+Add these mappings to your vimrc file: >
+ :map <M-Esc>[62~ <MouseDown>
+ :map! <M-Esc>[62~ <MouseDown>
+ :map <M-Esc>[63~ <MouseUp>
+ :map! <M-Esc>[63~ <MouseUp>
+ :map <M-Esc>[64~ <S-MouseDown>
+ :map! <M-Esc>[64~ <S-MouseDown>
+ :map <M-Esc>[65~ <S-MouseUp>
+ :map! <M-Esc>[65~ <S-MouseUp>
+<
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
new file mode 100644
index 000000000..b65b4e195
--- /dev/null
+++ b/runtime/doc/sign.txt
@@ -0,0 +1,191 @@
+*sign.txt* For Vim version 7.0aa. Last change: 2004 May 22
+
+
+ VIM REFERENCE MANUAL by Gordon Prieur
+ and Bram Moolenaar
+
+
+Sign Support Features *sign-support*
+
+1. Introduction |sign-intro|
+2. Commands |sign-commands|
+
+{Vi does not have any of these features}
+{only available when compiled with the |+signs| feature}
+
+==============================================================================
+1. Introduction *sign-intro* *signs*
+
+When a debugger or other IDE tool is driving an editor it needs to be able
+to give specific highlights which quickly tell the user useful information
+about the file. One example of this would be a debugger which had an icon
+in the left-hand column denoting a breakpoint. Another example might be an
+arrow representing the Program Counter (PC). The sign features allow both
+placement of a sign, or icon, in the left-hand side of the window and
+definition of a highlight which will be applied to that line. Displaying the
+sign as an image is most likely only feasible in gvim (although Sun
+Microsystem's dtterm does support this its the only terminal emulator I know
+of which does). A text sign and the highlight should be feasible in any color
+terminal emulator.
+
+Signs and highlights are not useful just for debuggers. Sun's Visual
+WorkShop uses signs and highlights to mark build errors and SourceBrowser
+hits. Additionally, the debugger supports 8 to 10 different signs and
+highlight colors. |workshop| Same for Netbeans |netbeans|.
+
+There are two steps in using signs:
+
+1. Define the sign. This specifies the image, text and highlighting. For
+ example, you can define a "break" sign with an image of a stop roadsign and
+ text "!!".
+
+2. Place the sign. This specifies the file and line number where the sign is
+ displayed. A defined sign can be placed several times in different lines
+ and files.
+
+When signs are defined for a file, Vim will automatically add a column of two
+characters to display them in. When the last sign is unplaced the column
+disappears again. The color of the column is set with the SignColumn group
+|hl-SignColumn|. Example to set the color: >
+
+ :highlight SignColumn guibg=darkgrey
+
+==============================================================================
+2. Commands *sign-commands* *:sig* *:sign*
+
+Here is an example that places a sign piet, displayed with the text ">>", in
+line 23 of the current file: >
+ :sign define piet text=>> texthl=Search
+ :exe ":sign place 2 line=23 name=piet file=" . expand("%:p")
+
+And here is the command to delete it again: >
+ :sign unplace 2
+
+Note that the ":sign" command cannot be followed by another command or a
+comment. If you do need that, use the |:execute| command.
+
+
+DEFINING A SIGN. *:sign-define* *E255* *E160* *E612*
+
+:sign define {name} {argument}...
+ Define a new sign or set attributes for an existing sign.
+ The {name} can either be a number (all digits) or a name
+ starting with a non-digit.
+ About 120 different signs can be defined.
+
+ Accepted arguments:
+
+ icon={pixmap}
+ Define the file name where the bitmap can be found. Should be
+ a full path. The bitmap should fit in the place of two
+ characters. This is not checked. If the bitmap is too big it
+ will cause redraw problems. Only GTK 2 can scale the bitmap
+ to fit the space available.
+ toolkit supports ~
+ GTK 1 pixmap (.xpm)
+ GTK 2 many
+ Motif pixmap (.xpm)
+
+ linehl={group}
+ Highlighting group used for the whole line the sign is placed
+ in. Most useful is defining a background color.
+
+ text={text} *E239*
+ Define the text that is displayed when there is no icon or the
+ GUI is not being used. Only printable characters are allowed
+ and they must occupy one or two display cells.
+
+ texthl={group}
+ Highlighting group used for the text item.
+
+
+DELETING A SIGN *:sign-undefine* *E155*
+
+:sign undefine {name}
+ Deletes a previously defined sign. If signs with this {name}
+ are still placed this will cause trouble.
+
+
+LISTING SIGNS *:sign-list* *E156*
+
+:sign list Lists all defined signs and their attributes.
+
+:sign list {name}
+ Lists one defined sign and its attributes.
+
+
+PLACING SIGNS *:sign-place* *E158*
+
+:sign place {id} line={lnum} name={name} file={fname}
+ Place sign defined as {name} at line {lnum} in file {fname}.
+ *:sign-fname*
+ The file {fname} must already be loaded in a buffer. The
+ exact file name must be used, wildcards, $ENV and ~ are not
+ expanded, white space must not be escaped. Trailing white
+ space is ignored.
+
+ The sign is remembered under {id}, this can be used for
+ further manipulation. {id} must be a number.
+ It's up to the user to make sure the {id} is used only once in
+ each file (if it's used several times unplacing will also have
+ to be done several times and making changes may not work as
+ expected).
+
+:sign place {id} line={lnum} name={name} buffer={nr}
+ Same, but use buffer {nr}.
+
+:sign place {id} name={name} file={fname}
+ Change the placed sign {id} in file {fname} to use the defined
+ sign {name}. See remark above about {fname} |:sign-fname|.
+ This can be used to change the displayed sign without moving
+ it (e.g., when the debugger has stopped at a breakpoint).
+
+:sign place {id} name={name} buffer={nr}
+ Same, but use buffer {nr}.
+
+
+REMOVING SIGNS *:sign-unplace* *E159*
+
+:sign unplace {id} file={fname}
+ Remove the previously placed sign {id} from file {fname}.
+ See remark above about {fname} |:sign-fname|.
+
+:sign unplace {id} buffer={nr}
+ Same, but use buffer {nr}.
+
+:sign unplace {id}
+ Remove the previously placed sign {id} from all files it
+ appears in.
+
+:sign unplace *
+ Remove all placed signs.
+
+:sign unplace
+ Remove the placed sign at the cursor position.
+
+
+LISTING PLACED SIGNS
+
+:sign place file={fname}
+ List signs placed in file {fname}.
+ See remark above about {fname} |:sign-fname|.
+
+:sign place buffer={nr}
+ List signs placed in buffer {nr}.
+
+:sign place List placed signs in all files.
+
+
+JUMPING TO A SIGN *:sign-jump* *E157*
+
+:sign jump {id} file={fname}
+ Open the file {fname} or jump to the window that contains
+ {fname} and position the cursor at sign {id}.
+ See remark above about {fname} |:sign-fname|.
+ If the file isn't displayed in window and the current file can
+ not be |abandon|ed this fails.
+
+:sign jump {id} buffer={nr}
+ Same, but use buffer {nr}.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt
new file mode 100644
index 000000000..34abc46d4
--- /dev/null
+++ b/runtime/doc/sponsor.txt
@@ -0,0 +1,229 @@
+*sponsor.txt* For Vim version 7.0aa. Last change: 2004 Apr 23
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+
+SPONSOR VIM DEVELOPMENT *sponsor*
+
+Fixing bugs and adding new features takes a lot of effort. For a few years
+Bram has attempted to do this next to a full-time job. During that time the
+todo list kept getting longer and longer.
+
+In order for Bram to support Vim properly he needs your support. Through your
+donations Bram will be able to have a part-time job and spend more time on
+fixing bugs and adding new features.
+
+For the most recent information about sponsoring look on the Vim web site:
+
+ http://www.vim.org/sponsor/
+
+More explanations can be found in the |sponsor-faq|.
+
+
+REGISTERED VIM USER *register*
+
+You can become a registered Vim user by sending at least 10 euro. This works
+similar to sponsoring Vim, see |sponsor| above. Registration was made
+possible for the situation where your boss or bookkeeper may be willing to
+register software, but does not like the terms "sponsoring" and "donation".
+
+More explanations can be found in the |register-faq|.
+
+
+VOTE FOR FEATURES *vote-for-features*
+
+To give registered Vim users and sponsors an advantage over lurkers they can
+vote for the items Bram should work on. How does this voting work?
+
+1. You send at least 10 euro. See below for ways to transfer money
+ |send-money|.
+
+2. You will be e-mailed a registration key. Enter this key on your account
+ page on the Vim website. You can easily create an account if you don't
+ have one yet.
+
+3. You can enter your votes on the voting page. There is a link to that page
+ on your account page after entering a registration key. Your votes will
+ be counted for two years.
+
+4. The voting results appear on the results page, which is visible for
+ everybody: http://www.vim.org/sponsor/vote_results.php
+
+Additionally, once you have send 100 euro or more in total, your name appears
+in the "Vim hall of honour": http://www.vim.org/sponsor/hall_of_honour.php
+But only if you enable this on your account page.
+
+
+HOW TO SEND MONEY *send-money*
+
+Creditcard Through PayPal, see the PayPal site for information:
+ https://www.paypal.com
+ The e-mail address for sending sponsorship money is:
+ donate@vim.org
+ The e-mail address for Vim registration is:
+ register@vim.org
+ Using Euro is preferred, other currencies are also accepted.
+ In Euro countries a bank transfer is preferred, this has lower
+ costs.
+
+Bank transfer Transfer to Bram's account at the Postbank: 1644503. For
+ international transfers you can use these numbers:
+ IBAN: NL79 PSTB 0001 6445 03
+ SWIFT/BIC: PSTBNL21
+ This is the address of the bank:
+ ING Bank Amsterdam, Foreign Operations
+ PO Box 1800
+ 1000 BV Amsterdam
+ The Netherlands
+ Include "Vim sponsor" or "Vim registration" in the comment of
+ your money transfer. Send me an e-mail that mentions the
+ amount you transferred if you want to vote for features and
+ show others you are a registered Vim user or sponsor.
+
+Cash Small amounts can be send with ordinary mail. Put something
+ around the money, so that it's not noticable from the outside.
+ Mention your e-mail address if you want to vote for features
+ and show others you are a registered Vim user or sponsor.
+
+This is Bram's address: Bram Moolenaar
+ Clematisstraat 30
+ 5925 BE Venlo
+ The Netherlands
+
+
+ALTERNATIVE
+
+If you don't care about sponsoring Vim Development or becoming a registered
+Vim user, but do care about helping needy children, consider giving to the
+ICCF Holland foundation. This is the charity recommended by Vim's author.
+The money is used for a children centre in the south of Uganda, where AIDS has
+caused many victims. See |uganda|.
+
+
+QUESTIONS AND ANSWERS *sponsor-faq* *register-faq*
+
+Why should I give money?
+
+Bram has tried to work on Vim next to a full-time job. The list of known bugs
+and ideas for new features has constantly been growing during this time. Bram
+simply can't spend enough time on Vim development when he has a full-time job.
+Your contribution will make it possible for Bram to have a part-time job and
+spend much more time on Vim development. Bugs will be fixed quicker and new
+Vim releases will become available more often.
+
+
+How much money should I send?
+
+That is up to you. The more you give, the more time Bram can work on Vim. An
+indication for individuals that use Vim at home: 10 Euro per year. For
+professional use: 30 Euro per year per person. Send at least 10 euro to be
+able to vote for features.
+
+
+What do I get in return?
+
+Each registered Vim user and sponsor who donates at least 10 euro will be able
+to vote for new features. These votes will give priority to the work on Vim.
+The votes are valid for two years. The more money you send the more your
+votes count |votes-counted|.
+
+If you send 100 Euro or more in total you will be mentioned on the "Vim hall
+of honour" page on the Vim web site. But only if you enable this on your
+account page. You can also select whether the amount will be visible.
+
+
+How do I become a Vim sponsor or registered Vim user?
+
+Send money, as explained above |send-money| and include your e-mail address.
+When the money has been received you will receive a unique registration key.
+This key can be used on the Vim website to activate voting on your Vim
+account. You will then get an extra page where you can vote for features and
+choose whether others will be able to see that you donated. There is a link
+to this page on your "My Account" page.
+
+
+What is the difference between sponsoring and registering?
+
+It has a different name. Use the term "registration" if your boss doesn't
+like "sponsoring" or "donation". The benefits are the same.
+
+
+How can I send money?
+
+See |send-money|. Check the web site for the most recent information:
+http://www.vim.org/sponsor/
+
+
+Why don't you use the SourceForge donation system?
+
+SourceForge takes 5% of the donations for themselves. If you want to support
+SourceForge you can send money to them directly.
+
+
+I cannot afford to send money, may I still use Vim?
+
+Yes.
+
+
+I did not register Vim, can I use all available features?
+
+Yes.
+
+
+I noticed a bug, do I need to register before I can report it?
+
+No, suggestions for improving Vim can always be given. For improvements use
+the developer |maillist|, for reporting bugs see |bugs|.
+
+
+How are my votes counted? *votes-counted*
+
+You may vote when you send 10 euro or more. You can enter up to ten votes.
+You can select the same item several times to give it more points. You can
+also enter three counter votes, these count as negative points.
+
+When you send 30 euro or more the points are doubled. Above 100 euro they
+count four times, above 300 euro they count six times, above 1000 euro ten
+times.
+
+
+Can I change my votes?
+
+You can change your votes any time you like, up to two years after you
+sent money. The points will be counted right away.
+
+
+How about Charityware?
+
+You have to decide yourself whether you want to sponsor Vim development, help
+the poor children in Uganda (see |uganda|) or both. Bram will certainly keep
+on supporting the project in Uganda. In the (unlikely) situation that Bram
+gets more donations for Vim development than he needs, he will send the money
+to Uganda.
+
+
+I donated $$$, now please add feature XYZ!
+
+There is no direct relation between your donation and the work Bram does.
+Otherwise you would be paying for work and Bram has to pay income tax over the
+donation. If you want to hire Bram for specific work, contact him directly,
+don't use the donation system.
+
+
+Are the donations tax deductable?
+
+No. Setting up a system for this is complex and imposes too many restrictions.
+The donations to help the children in |Uganda| are tax deductable in Holland,
+Germany, Canada and probably also in the USA.
+
+
+Can you send me a bill?
+
+Sending a bill would mean Bram does something in return for your contribution.
+That is work and would mean Bram has to pay income tax over the amount. It is
+possible, but the net amount will be lower.
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
new file mode 100644
index 000000000..160bcb914
--- /dev/null
+++ b/runtime/doc/starting.txt
@@ -0,0 +1,1418 @@
+*starting.txt* For Vim version 7.0aa. Last change: 2004 May 28
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Starting Vim *starting*
+
+1. Vim arguments |vim-arguments|
+2. Vim on the Amiga |starting-amiga|
+3. Running eVim |evim-keys|
+4. Initialization |initialization|
+5. $VIM and $VIMRUNTIME |$VIM|
+6. Suspending |suspend|
+7. Saving settings |save-settings|
+8. Views and Sessions |views-sessions|
+9. The viminfo file |viminfo-file|
+
+==============================================================================
+1. Vim arguments *vim-arguments*
+
+Most often, Vim is started to edit a single file with the command
+
+ vim filename *-vim*
+
+More generally, Vim is started with:
+
+ vim [option | filename] ..
+
+Option arguments and file name arguments can be mixed, and any number of them
+can be given. However, watch out for options that take an argument.
+
+For compatibility with various Vi versions, see |cmdline-arguments|.
+
+Exactly one out of the following five items may be used to choose how to
+start editing:
+
+ *-file* *---*
+filename One or more file names. The first one will be the current
+ file and read into the buffer. The cursor will be positioned
+ on the first line of the buffer.
+ To avoid a file name starting with a '-' being interpreted as
+ an option, precede the arglist with "--", e.g.: >
+ vim -- -filename
+< All arguments after the "--" will be interpreted as file names,
+ no other options or "+command" argument can follow.
+
+ *--*
+- This argument can mean two things, depending on whether Ex
+ mode is to be used.
+
+ Starting in Normal mode: >
+ vim -
+ ex -v -
+< Start editing a new buffer, which is filled with text
+ that is read from stdin. The commands that would normally be
+ read from stdin will now be read from stderr. Example: >
+ find . -name "*.c" -print | vim -
+< The buffer will be marked modified, because it contains text
+ that needs to be saved. Except when in readonly mode, then
+ the buffer is not marked modified. Example: >
+ ls | view -
+<
+ Starting in Ex mode: >
+ ex -
+ vim -e -
+ exim -
+ vim -E
+< Start editing in silent mode. See |-s-ex|.
+
+ *-t* *-tag*
+-t {tag} A tag. "tag" is looked up in the tags file, the associated
+ file becomes the current file, and the associated command is
+ executed. Mostly this is used for C programs, in which case
+ "tag" often is a function name. The effect is that the file
+ containing that function becomes the current file and the
+ cursor is positioned on the start of the function (see
+ |tags|).
+
+ *-q* *-qf*
+-q [errorfile] QuickFix mode. The file with the name [errorfile] is read
+ and the first error is displayed. See |quickfix|.
+ If [errorfile] is not given, the 'errorfile' option is used
+ for the file name. See 'errorfile' for the default value.
+ {not in Vi}
+
+(nothing) Without one of the four items above, Vim will start editing a
+ new buffer. It's empty and doesn't have a file name.
+
+
+The startup mode can be changed by using another name instead of "vim", which
+is equal to giving options:
+ex vim -e Start in Ex mode (see |Ex-mode|). *ex*
+exim vim -E Start in improved Ex mode (see |Ex-mode|). *exim*
+ (normally not installed)
+view vim -R Start in read-only mode (see |-R|). *view*
+gvim vim -g Start the GUI (see |gui|). *gvim*
+gex vim -eg Start the GUI in Ex mode. *gex*
+gview vim -Rg Start the GUI in read-only mode. *gview*
+rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim*
+rview vim -RZ Like "view", but in restricted mode. *rview*
+rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim*
+rgview vim -RgZ Like "gview", but in restricted mode. *rgview*
+evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim*
+eview vim -yR Like "evim" in read-only mode *eview*
+vimdiff vim -d Start in diff mode |diff-mode|
+gvimdiff vim -gd Start in diff mode |diff-mode|
+
+Additional characters may follow, they are ignored. For example, you can have
+"gvim-5" to start the GUI. You must have an executable by that name then, of
+course.
+
+On Unix, you would normally have one executable called Vim, and links from the
+different startup-names to that executable. If your system does not support
+links and you do not want to have several copies of the executable, you could
+use an alias instead. For example: >
+ alias view vim -R
+ alias gvim vim -g
+<
+ *startup-options*
+The option arguments may be given in any order. Single-letter options can be
+combined after one dash. There can be no option arguments after the "--"
+argument.
+
+On VMS all option arguments are assumed to be lowercase, unless preceded with
+a slash. Thus "-R" means recovery and "-/R" readonly.
+
+--help *-h* *--help*
+-h Give usage (help) message and exit. {not in Vi}
+ See |info-message| about capturing the text.
+
+ *--version*
+--version Print version information and exit. Same output as for
+ |:version| command. {not in Vi}
+ See |info-message| about capturing the text.
+
+ *--noplugin*
+--noplugin Skip loading plugins. Resets the 'loadplugins' option.
+ {not in Vi}
+ Note that the |-u| argument may also disable loading plugins:
+ argument load vimrc files load plugins ~
+ (nothing) yes yes
+ -u NONE no no
+ -u NORC no yes
+ --noplugin yes no
+
+ *--literal*
+--literal Take file names literally, don't expand wildcards. Not needed
+ for Unix, because Vim always takes file names literally (the
+ shell expands wildcards).
+ Applies to all the names, also the ones that come before this
+ argument.
+
+ *-+*
++[num] The cursor will be positioned on line "num" for the first
+ file being edited. If "num" is missing, the cursor will be
+ positioned on the last line.
+
+ *-+/*
++/{pat} The cursor will be positioned on the first line containing
+ "pat" in the first file being edited (see |pattern| for the
+ available search patterns).
+
++{command} *-+c* *-c*
+-c {command} {command} will be executed after the first file has been
+ read (and after autocommands and modelines for that file have
+ been processed). "command" is interpreted as an Ex command.
+ If the "command" contains spaces, it must be enclosed in
+ double quotes (this depends on the shell that is used).
+ Example: >
+ vim "+set si" main.c
+ vim "+find stdio.h"
+ vim -c "set ff=dos" -c wq mine.mak
+<
+ Note: You can use up to 10 "+" or "-c" arguments in a Vim
+ command. They are executed in the order given. A "-S"
+ argument counts as a "-c" argument as well.
+ {Vi only allows one command}
+
+--cmd {command} *--cmd*
+ {command} will be executed before processing any vimrc file.
+ Otherwise it acts like -c {command}. You can use up to 10 of
+ these commands, independently from "-c" commands.
+ {not in Vi}
+
+ *-S*
+-S {file} The {file} will be sourced after the first file has been read.
+ This is an easy way to do the equivalent of: >
+ -c "source {file}"
+< It can be mixed with "-c" arguments and repeated like "-c".
+ The limit of 10 "-c" arguments applies here as well.
+ {file} cannot start with a "-".
+ {not in Vi}
+
+-S Works like "-S Session.vim". Only when used as the last
+ argument or when another "-" option follows.
+
+ *-r*
+-r Recovery mode. Without a file name argument, a list of
+ existing swap files is given. With a file name, a swap file
+ is read to recover a crashed editing session. See
+ |crash-recovery|.
+
+ *-L*
+-L Same as -r. {only in some versions of Vi: "List recoverable
+ edit sessions"}
+
+ *-R*
+-R Readonly mode. The 'readonly' option will be set for all the
+ files being edited. You can still edit the buffer, but will
+ be prevented from accidentally overwriting a file. If you
+ forgot that you are in View mode and did make some changes,
+ you can overwrite a file by adding an exclamation mark to
+ the Ex command, as in ":w!". The 'readonly' option can be
+ reset with ":set noro" (see the options chapter, |options|).
+ Subsequent edits will not be done in readonly mode. Calling
+ the executable "view" has the same effect as the -R argument.
+ The 'updatecount' option will be set to 10000, meaning that
+ the swap file will not be updated automatically very often.
+
+ *-m*
+-m Modifications not allowed to be written. The 'write' option
+ will be reset, so that writing files is disabled. However,
+ the 'write' option can be set to enable writing again.
+ {not in Vi}
+
+ *-M*
+-M Modifications not allowed. The 'modifiable' option will be
+ reset, so that changes are not allowed. The 'write' option
+ will be reset, so that writing files is disabled. However,
+ the 'modifiable' and 'write' options can be set to enable
+ changes and writing.
+ {not in Vi}
+
+ *-Z* *restricted-mode* *E145*
+-Z Restricted mode. All commands that make use of an external
+ shell are disabled. This includes suspending with CTRL-Z,
+ ":sh", filtering, the system() function, backtick expansion,
+ etc.
+ {not in Vi}
+
+ *-g*
+-g Start Vim in GUI mode. See |gui|. {not in Vi}
+
+ *-v*
+-v Start Ex in Vi mode. Only makes a difference when the
+ executable is called "ex" or "gvim". For gvim the GUI is not
+ started if possible.
+
+ *-e*
+-e Start Vim in Ex mode |Q|. Only makes a difference when the
+ executable is not called "ex".
+
+ *-E*
+-E Start Vim in improved Ex mode |gQ|. Only makes a difference
+ when the executable is not called "exim".
+ {not in Vi}
+
+ *-s-ex*
+-s Silent or batch mode. Only when Vim was started as "ex" or
+ when preceded with the "-e" argument. Otherwise see |-s|,
+ which does take an argument while this use of "-s" doesn't.
+ To be used when Vim is used to execute Ex commands from a file
+ instead of a terminal. Switches off most prompts and
+ informative messages. Also warnings and error messages.
+ But ":print" output is displayed. And when 'verbose' is
+ non-zero messages are printed (for debugging).
+ If Vim appears to be stuck try typing "qa!<Enter>". You don't
+ get a prompt thus you can't see Vim is waiting for you to type
+ something.
+ Initializations are skipped (except the ones given with the
+ "-u" argument).
+ Example: >
+ vim -e -s < thefilter thefile
+<
+ *-b*
+-b Binary mode. File I/O will only recognize <NL> to separate
+ lines. The 'expandtab' option will be reset. The 'textwidth'
+ option is set to 0. 'modeline' is reset. The 'binary' option
+ is set. This is done after reading the vimrc/exrc files but
+ before reading any file in the arglist. See also
+ |edit-binary|. {not in Vi}
+
+ *-l*
+-l Lisp mode. Sets the 'lisp' and 'showmatch' options on.
+
+ *-A*
+-A Arabic mode. Sets the 'arabic' option on. (Only when
+ compiled with the |+arabic| features (which include
+ |+rightleft|), otherwise Vim gives an error message
+ and exits. {not in Vi}
+
+ *-F*
+-F Farsi mode. Sets the 'fkmap' and 'rightleft' options on.
+ (Only when compiled with |+rightleft| and |+farsi| features,
+ otherwise Vim gives an error message and exits). {not in Vi}
+
+ *-H*
+-H Hebrew mode. Sets the 'hkmap' and 'rightleft' options on.
+ (Only when compiled with the |+rightleft| feature, otherwise
+ Vim gives an error message and exits). {not in Vi}
+
+ *-V* *verbose*
+-V[N] Verbose. Sets the 'verbose' option to [N] (default: 10).
+ Messages will be given for each file that is ":source"d and
+ for reading or writing a viminfo file. Can be used to find
+ out what is happening upon startup and exit. {not in Vi}
+
+ *-D*
+-D Debugging. Go to debugging mode when executing the first
+ command from a script. |debug-mode|
+ {not available when compiled without the |+eval| feature}
+ {not in Vi}
+
+ *-C*
+-C Compatible mode. Sets the 'compatible' option. You can use
+ this to get 'compatible', even though a .vimrc file exists.
+ But the command ":set nocompatible" overrules it anyway.
+ Also see |compatible-default|. {not in Vi}
+
+ *-N*
+-N Not compatible mode. Resets the 'compatible' option. You can
+ use this to get 'nocompatible', when there is no .vimrc file.
+ Also see |compatible-default|. {not in Vi}
+
+ *-y* *easy*
+-y Easy mode. Implied for |evim| and |eview|. Starts with
+ 'insertmode' set and behaves like a click-and-type editor.
+ This sources the script $VIMRUNTIME/evim.vim. Mappings are
+ set up to work like most click-and-type editors, see
+ |evim-keys|. The GUI is started when available.
+ {not in Vi}
+
+ *-n*
+-n No swap file will be used. Recovery after a crash will be
+ impossible. Handy if you want to view or edit a file on a
+ very slow medium (e.g., a floppy).
+ Can also be done with ":set updatecount=0". You can switch it
+ on again by setting the 'updatecount' option to some value,
+ e.g., ":set uc=100".
+ 'updatecount' is set to 0 AFTER executing commands from a
+ vimrc file, but before the GUI initializations. Thus it
+ overrides a setting for 'updatecount' in a vimrc file, but not
+ in a gvimrc file. See |startup|.
+ When you want to reduce accesses to the disk (e.g., for a
+ laptop), don't use "-n", but set 'updatetime' and
+ 'updatecount' to very big numbers, and type ":preserve" when
+ you want to save your work. This way you keep the possibility
+ for crash recovery.
+ {not in Vi}
+
+ *-o*
+-o[N] Open N windows, split horizontally. If [N] is not given,
+ one window is opened for every file given as argument. If
+ there is not enough room, only the first few files get a
+ window. If there are more windows than arguments, the last
+ few windows will be editing an empty file.
+ {not in Vi}
+
+ *-O*
+-O[N] Open N windows, split vertically. Otherwise it's like -o.
+ If both the -o and the -O option are given, the last one on
+ the command line determines how the windows will be split.
+ {not in Vi}
+
+ *-T*
+-T {terminal} Set the terminal type to "terminal". This influences the
+ codes that Vim will send to your terminal. This is normally
+ not needed, because Vim will be able to find out what type
+ of terminal you are using (See |terminal-info|). {not in Vi}
+
+ *-d*
+-d Start in diff mode, like |vimdiff|.
+ {not in Vi} {not available when compiled without the |+diff|
+ feature}
+
+-d {device} Only on the Amiga and when not compiled with the |+diff|
+ feature. Works like "-dev".
+ *-dev*
+-dev {device} Only on the Amiga: The {device} is opened to be used for
+ editing.
+ Normally you would use this to set the window position and
+ size: "-d con:x/y/width/height", e.g.,
+ "-d con:30/10/600/150". But you can also use it to start
+ editing on another device, e.g., AUX:. {not in Vi}
+ *-f*
+-f Amiga: Do not restart Vim to open a new window. This
+ option should be used when Vim is started by a program that
+ will wait for the edit session to finish (e.g., mail or
+ readnews). See |amiga-window|.
+
+ GUI: Do not disconnect from the program that started Vim.
+ 'f' stands for "foreground". If omitted, the GUI forks a new
+ process and exits the current one. "-f" should be used when
+ gvim is started by a program that will wait for the edit
+ session to finish (e.g., mail or readnews). If you want gvim
+ never to fork, include 'f' in 'guioptions' in your .gvimrc.
+ Careful: You can use "-gf" to start the GUI in the foreground,
+ but "-fg" is used to specify the foreground color. |gui-fork|
+ {not in Vi}
+
+ *--nofork*
+--nofork GUI: Do not fork. Same as |-f|.
+ *-u* *E282*
+-u {vimrc} The file {vimrc} is read for initializations. Most other
+ initializations are skipped; see |initialization|. This can
+ be used to start Vim in a special mode, with special
+ mappings and settings. A shell alias can be used to make
+ this easy to use. For example: >
+ alias vimc vim -u ~/.c_vimrc !*
+< Also consider using autocommands; see |autocommand|.
+ When {vimrc} is equal to "NONE" (all uppercase), all
+ initializations from files and environment variables are
+ skipped, including reading the .gvimrc file when the GUI
+ starts. Loading plugins is also skipped.
+ When {vimrc} is equal to "NORC" (all uppercase), this has the
+ same effect as "NONE", but loading plugins is not skipped.
+ Using the "-u" argument has the side effect that the
+ 'compatible' option will be on by default. This can have
+ unexpected effects. See |'compatible'|.
+ {not in Vi}
+
+ *-U* *E230*
+-U {gvimrc} The file "gvimrc" is read for initializations when the GUI
+ starts. Other GUI initializations are skipped. When {gvimrc}
+ is equal to "NONE", no file is read for initializations at
+ all.
+ Exception: Reading the system-wide menu file is always done.
+ {not in Vi}
+
+ *-i*
+-i {viminfo} The file "viminfo" is used instead of the default viminfo
+ file. If the name "NONE" is used (all uppercase), no viminfo
+ file is read or written, even if 'viminfo' is set or when
+ ":rv" or ":wv" are used. See also |viminfo-file|.
+ {not in Vi}
+
+ *-x*
+-x Use encryption to read/write files. Will prompt for a key,
+ which is then stored in the 'key' option. All writes will
+ then use this key to encrypt the text. The '-x' argument is
+ not needed when reading a file, because there is a check if
+ the file that is being read has been encrypted, and Vim asks
+ for a key automatically. |encryption|
+
+ *-X*
+-X Do not try connecting to the X server to get the current
+ window title and copy/paste using the X clipboard. This
+ avoids a long startup time when running Vim in a terminal
+ emulator and the connection to the X server is slow.
+ Only makes a difference on Unix or VMS, when compiled with the
+ |+X11| feature. Otherwise it's ignored.
+ To disable the connection only for specific terminals, see the
+ 'clipboard' option.
+ When the X11 Session Management Protocol (XSMP) handler has
+ been built in, the -X option also disables that connection as
+ it, too, may have undesirable delays.
+ When the connection is desired later anyway (e.g., for
+ client-server messages), call the |serverlist()| function.
+ This does not enable the XSMP handler though.
+ {not in Vi}
+
+ *-s*
+-s {scriptin} The script file "scriptin" is read. The characters in the
+ file are interpreted as if you had typed them. The same can
+ be done with the command ":source! {scriptin}". If the end
+ of the file is reached before the editor exits, further
+ characters are read from the keyboard. Only works when not
+ started in Ex mode, see |-s-ex|. See also |complex-repeat|.
+ {not in Vi}
+
+ *-w*
+-w {scriptout} All the characters that you type are recorded in the file
+ "scriptout", until you exit Vim. This is useful if you want
+ to create a script file to be used with "vim -s" or
+ ":source!". When the "scriptout" file already exists, new
+ characters are appended. See also |complex-repeat|.
+ {not in Vi}
+
+ *-W*
+-W {scriptout} Like -w, but do not append, overwrite an existing file.
+ {not in Vi}
+
+ *-w_nr*
+-w{number} Does nothing. This was included for Vi-compatibility. In Vi
+ it sets the 'window' option, which is not implemented in Vim.
+
+--remote [+{cmd}] {file} ...
+ Open the {file} in another Vim that functions as a server.
+ Any non-file arguments must come before this.
+ See |--remote|. {not in Vi}
+
+--remote-silent [+{cmd}] {file} ...
+ Like --remote, but don't complain if there is no server.
+ See |--remote-silent|. {not in Vi}
+
+--remote-wait [+{cmd}] {file} ...
+ Like --remote, but wait for the server to finish editing the
+ file(s).
+ See |--remote-wait|. {not in Vi}
+
+--remote-wait-silent [+{cmd}] {file} ...
+ Like --remote-wait, but don't complain if there is no server.
+ See |--remote-wait-silent|. {not in Vi}
+
+--servername {name}
+ Specify the name of the Vim server to send to or to become.
+ See |--servername|. {not in Vi}
+
+--remote-send {keys}
+ Send {keys} to a Vim server and exit.
+ See |--remote-send|. {not in Vi}
+
+--remote-expr {expr}
+ Evaluate {expr} in another Vim that functions as a server.
+ The result is printed on stdout.
+ See |--remote-expr|. {not in Vi}
+
+--serverlist Output a list of Vim server names and exit. See
+ See |--serverlist|. {not in Vi}
+
+--socketid {id} *--socketid*
+ GTK+ GUI Vim only. Make gvim try to use GtkPlug mechanism, so
+ that it runs inside another window. See |gui-gtk-socketid|
+ for details. {not in Vi}
+
+--echo-wid *--echo-wid*
+ GTK+ GUI Vim only. Make gvim echo the Window ID on stdout,
+ which can be used to run gvim in a kpart widget. The format
+ of the output is: >
+ WID: 12345\n
+< {not in Vi}
+
+--role {role} *--role*
+ GTK+ 2 GUI only. Set the role of the main window to {role}.
+ The window role can be used by a window manager to uniquely
+ identify a window, in order to restore window placement and
+ such. The --role argument is passed automatically when
+ restoring the session on login. See |gui-gnome-session|
+ {not in Vi}
+
+-P {parent-title} *-P* *MDI* *E671* *E672*
+ Win32 only: Specify the title of the parent application. When
+ possible, Vim will run in an MDI window inside the
+ application.
+ {parent-title} must appear in the window title of the parent
+ application. Make sure that it is specific enough.
+ Note that the implementation is still primitive. It won't
+ work with all applications and the menu doesn't work.
+
+-nb *-nb*
+-nb={fname}
+-nb:{hostname}:{addr}:{password}
+ Attempt connecting to Netbeans and become an editor server for
+ it. The second form specifies a file to read connection info
+ from. The third form specifies the hostname, address and
+ password for connecting to Netbeans. |netbeans-run|
+
+Example for using a script file to change a name in several files:
+ Create a file "subs.vi" containing substitute commands and a :wq
+ command: >
+ :%s/Jones/Smith/g
+ :%s/Allen/Peter/g
+ :wq
+<
+ Execute Vim on all files you want to change: >
+
+ foreach i ( *.let ) vim -s subs.vi $i
+
+If the executable is called "view", Vim will start in Readonly mode. This is
+useful if you can make a hard or symbolic link from "view" to "vim".
+Starting in Readonly mode can also be done with "vim -R".
+
+If the executable is called "ex", Vim will start in "Ex" mode. This means it
+will accept only ":" commands. But when the "-v" argument is given, Vim will
+start in Normal mode anyway.
+
+Additional arguments are available on unix like systems when compiled with
+X11 GUI support. See |gui-resources|.
+
+==============================================================================
+2. Vim on the Amiga *starting-amiga*
+
+Starting Vim from the Workbench *workbench*
+-------------------------------
+
+Vim can be started from the Workbench by clicking on its icon twice. It will
+then start with an empty buffer.
+
+Vim can be started to edit one or more files by using a "Project" icon. The
+"Default Tool" of the icon must be the full pathname of the Vim executable.
+The name of the ".info" file must be the same as the name of the text file.
+By clicking on this icon twice, Vim will be started with the file name as
+current file name, which will be read into the buffer (if it exists). You can
+edit multiple files by pressing the shift key while clicking on icons, and
+clicking twice on the last one. The "Default Tool" for all these icons must
+be the same.
+
+It is not possible to give arguments to Vim, other than file names, from the
+workbench.
+
+Vim window *amiga-window*
+----------
+
+Vim will run in the CLI window where it was started. If Vim was started with
+the "run" or "runback" command, or if Vim was started from the workbench, it
+will open a window of its own.
+
+Technical detail:
+ To open the new window a little trick is used. As soon as Vim
+ recognizes that it does not run in a normal CLI window, it will
+ create a script file in "t:". This script file contains the same
+ command as the one Vim was started with, and an "endcli" command.
+ This script file is then executed with a "newcli" command (the "c:run"
+ and "c:newcli" commands are required for this to work). The script
+ file will hang around until reboot, or until you delete it. This
+ method is required to get the ":sh" and ":!" commands to work
+ correctly. But when Vim was started with the -f option (foreground
+ mode), this method is not used. The reason for this is that
+ when a program starts Vim with the -f option it will wait for Vim to
+ exit. With the script trick, the calling program does not know when
+ Vim exits. The -f option can be used when Vim is started by a mail
+ program which also waits for the edit session to finish. As a
+ consequence, the ":sh" and ":!" commands are not available when the
+ -f option is used.
+
+Vim will automatically recognize the window size and react to window
+resizing. Under Amiga DOS 1.3, it is advised to use the fastfonts program,
+"FF", to speed up display redrawing.
+
+==============================================================================
+3. Running eVim *evim-keys*
+
+EVim runs Vim as click-and-type editor. This is very unlike the original Vi
+idea. But it helps for people that don't use Vim often enough to learn the
+commands. Hopefully they will find out that learning to use Normal mode
+commands will make their editing much more effective.
+
+In Evim these options are changed from their default value:
+
+ :set nocompatible Use Vim improvements
+ :set insertmode Remain in Insert mode most of the time
+ :set hidden Keep invisible buffers loaded
+ :set backup Keep backup files (not for VMS)
+ :set backspace=2 Backspace over everything
+ :set autoindent auto-indent new lines
+ :set history=50 keep 50 lines of Ex commands
+ :set ruler show the cursor position
+ :set incsearch show matches halfway typing a pattern
+ :set mouse=a use the mouse in all modes
+ :set hlsearch highlight all matches for a search pattern
+ :set whichwrap+=<,>,[,] <Left> and <Right> wrap around line breaks
+ :set guioptions-=a non-Unix only: don't do auto-select
+
+Key mappings:
+ <Down> moves by screen lines rather than file lines
+ <Up> idem
+ Q does "gq", formatting, instead of Ex mode
+ <BS> in Visual mode: deletes the selection
+ CTRL-X in Visual mode: Cut to clipboard
+ <S-Del> idem
+ CTRL-C in Visual mode: Copy to clipboard
+ <C-Insert> idem
+ CTRL-V Pastes from the clipboard (in any mode)
+ <S-Insert> idem
+ CTRL-Q do what CTRL-V used to do
+ CTRL-Z undo
+ CTRL-Y redo
+ <M-Space> system menu
+ CTRL-A select all
+ <C-Tab> next window, CTRL-W w
+ <C-F4> close window, CTRL-W c
+
+Additionally:
+- ":behave mswin" is used |:behave|
+- syntax highlighting is enabled
+- filetype detection is enabled, filetype plugins and indenting is enabled
+- in a text file 'textwidth' is set to 78
+
+One hint: If you want to go to Normal mode to be able to type a sequence of
+commands, use CTRL-L. |i_CTRL-L|
+
+==============================================================================
+4. Initialization *initialization* *startup*
+
+This section is about the non-GUI version of Vim. See |gui-fork| for
+additional initialization when starting the GUI.
+
+At startup, Vim checks environment variables and files and sets values
+accordingly. Vim proceeds in this order:
+
+1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
+ The environment variable SHELL, if it exists, is used to set the
+ 'shell' option. On MS-DOS and Win32, the COMSPEC variable is used
+ if SHELL is not set.
+ The environment variable TERM, if it exists, is used to set the 'term'
+ option.
+
+2. Process the arguments
+ The options and file names from the command that start Vim are
+ inspected. Buffers are created for all files (but not loaded yet).
+
+3. Execute Ex commands, from environment variables and/or files
+ An environment variable is read as one Ex command line, where multiple
+ commands must be separated with '|' or "<NL>".
+ *vimrc* *exrc*
+ A file that contains initialization commands is called a "vimrc" file.
+ Each line in a vimrc file is executed as an Ex command line. It is
+ sometimes also referred to as "exrc" file. They are the same type of
+ file, but "exrc" is what Vi always used, "vimrc" is a Vim specific
+ name. Also see |vimrc-intro|.
+
+ Recommended place for your personal initializations:
+ Unix $HOME/.vimrc
+ OS/2 $HOME/.vimrc or $VIM/.vimrc (or _vimrc)
+ MS-DOS and Win32 $HOME/_vimrc or $VIM/_vimrc
+ Amiga s:.vimrc or $VIM/.vimrc
+
+ If Vim was started with "-u filename", the file "filename" is used.
+ All following initializations until 4. are skipped.
+ "vim -u NORC" can be used to skip these initializations without
+ reading a file. "vim -u NONE" also skips loading plugins. |-u|
+
+ If Vim was started in Ex mode with the "-s" argument, all following
+ initializations until 4. are skipped. Only the "-u" option is
+ interpreted.
+ *evim.vim*
+ a. If vim was started as |evim| or |eview| or with the |-y| argument, the
+ script $VIMRUNTIME/evim.vim will be loaded.
+ *system-vimrc*
+ b. For Unix, MS-DOS, MS-Windows, OS/2, VMS, Macintosh, RISC-OS and Amiga
+ the system vimrc file is read for initializations. The path of this
+ file is shown with the ":version" command. Mostly it's "$VIM/vimrc".
+ Note that this file is ALWAYS read in 'compatible' mode, since the
+ automatic resetting of 'compatible' is only done later. Add a ":set
+ nocp" command if you like.
+
+ *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc*
+ c. Four places are searched for initializations. The first that exists
+ is used, the others are ignored.
+ - The environment variable VIMINIT (see also |compatible-default|) (*)
+ The value of $VIMINIT is used as an Ex command line.
+ - The user vimrc file(s):
+ "$HOME/.vimrc" (for Unix and OS/2) (*)
+ "s:.vimrc" (for Amiga) (*)
+ "home:.vimrc" (for Amiga) (*)
+ "$VIM/.vimrc" (for OS/2 and Amiga) (*)
+ "$HOME/_vimrc" (for MS-DOS and Win32) (*)
+ "$VIM\_vimrc" (for MS-DOS and Win32) (*)
+ Note: For Unix, OS/2 and Amiga, when ".vimrc" does not exist,
+ "_vimrc" is also tried, in case an MS-DOS compatible file
+ system is used. For MS-DOS and Win32 ".vimrc" is checked
+ after "_vimrc", in case long file names are used.
+ Note: For MS-DOS and Win32, "$HOME" is checked first. If no
+ "_vimrc" or ".vimrc" is found there, "$VIM" is tried.
+ See |$VIM| for when $VIM is not set.
+ - The environment variable EXINIT.
+ The value of $EXINIT is used as an Ex command line.
+ - The user exrc file(s). Same as for the user vimrc file, but with
+ "vimrc" replaced by "exrc". But without the (*)!
+
+ d. If the 'exrc' option is on (which is not the default), the current
+ directory is searched for four files. The first that exists is used,
+ the others are ignored.
+ - The file ".vimrc" (for Unix, Amiga and OS/2) (*)
+ "_vimrc" (for MS-DOS and Win32) (*)
+ - The file "_vimrc" (for Unix, Amiga and OS/2) (*)
+ ".vimrc" (for MS-DOS and Win32) (*)
+ - The file ".exrc" (for Unix, Amiga and OS/2)
+ "_exrc" (for MS-DOS and Win32)
+ - The file "_exrc" (for Unix, Amiga and OS/2)
+ ".exrc" (for MS-DOS and Win32)
+
+ (*) Using this file or environment variable will cause 'compatible' to be
+ off by default. See |compatible-default|.
+
+4. Load the plugin scripts. *load-plugins*
+ This does the same as the command: >
+ :runtime! plugin/*.vim
+< The result is that all directories in the 'runtimepath' option will be
+ searched for the "plugin" sub-directory and all files ending in ".vim"
+ will be sourced (in alphabetical order per directory).
+ Loading plugins won't be done when:
+ - The 'loadplugins' option was reset in a vimrc file.
+ - The |--noplugin| command line argument is used.
+ - The "-u NONE" command line argument is used |-u|.
+ - When Vim was compiled without the |+eval| feature.
+ Note that using "-c set noloadplugins" doesn't work, because the
+ commands from the command line have not been executed yet.
+
+5. Set 'shellpipe' and 'shellredir'
+ The 'shellpipe' and 'shellredir' options are set according to the
+ value of the 'shell' option, unless they have been set before.
+ This means that Vim will figure out the values of 'shellpipe' and
+ 'shellredir' for you, unless you have set them yourself.
+
+6. Set 'updatecount' to zero, if "-n" command argument used
+
+7. Set binary options
+ If the "-b" flag was given to Vim, the options for binary editing will
+ be set now. See |-b|.
+
+8. Perform GUI initializations
+ Only when starting "gvim", the GUI initializations will be done. See
+ |gui-init|.
+
+9. Read the viminfo file
+ If the 'viminfo' option is not empty, the viminfo file is read. See
+ |viminfo-file|.
+
+10. Read the quickfix file
+ If the "-q" flag was given to Vim, the quickfix file is read. If this
+ fails, Vim exits.
+
+11. Open all windows
+ When the |-o| flag was given, windows will be opened (but not
+ displayed yet).
+ When switching screens, it happens now. Redrawing starts.
+ If the "-q" flag was given to Vim, the first error is jumped to.
+ Buffers for all windows will be loaded.
+
+12. Execute startup commands
+ If a "-t" flag was given to Vim, the tag is jumped to.
+ The commands given with the |-c| and |+cmd| arguments are executed.
+ If the 'insertmode' option is set, Insert mode is entered.
+ The |VimEnter| autocommands are executed.
+
+Some hints on using initializations:
+
+Standard setup:
+Create a vimrc file to set the default settings and mappings for all your edit
+sessions. Put it in a place so that it will be found by 3b:
+ ~/.vimrc (Unix and OS/2)
+ s:.vimrc (Amiga)
+ $VIM\_vimrc (MS-DOS and Win32)
+Note that creating a vimrc file will cause the 'compatible' option to be off
+by default. See |compatible-default|.
+
+Local setup:
+Put all commands that you need for editing a specific directory only into a
+vimrc file and place it in that directory under the name ".vimrc" ("_vimrc"
+for MS-DOS and Win32). NOTE: To make Vim look for these special files you
+have to turn on the option 'exrc'. See |trojan-horse| too.
+
+System setup:
+This only applies if you are managing a Unix system with several users and
+want to set the defaults for all users. Create a vimrc file with commands
+for default settings and mappings and put it in the place that is given with
+the ":version" command.
+
+Saving the current state of Vim to a file:
+Whenever you have changed values of options or when you have created a
+mapping, then you may want to save them in a vimrc file for later use. See
+|save-settings| about saving the current state of settings to a file.
+
+Avoiding setup problems for Vi users:
+Vi uses the variable EXINIT and the file "~/.exrc". So if you do not want to
+interfere with Vi, then use the variable VIMINIT and the file "vimrc" instead.
+
+Amiga environment variables:
+On the Amiga, two types of environment variables exist. The ones set with the
+DOS 1.3 (or later) setenv command are recognized. See the AmigaDos 1.3
+manual. The environment variables set with the old Manx Set command (before
+version 5.0) are not recognized.
+
+MS-DOS line separators:
+On MS-DOS-like systems (MS-DOS itself, Win32, and OS/2), Vim assumes that all
+the vimrc files have <CR> <NL> pairs as line separators. This will give
+problems if you have a file with only <NL>s and have a line like
+":map xx yy^M". The trailing ^M will be ignored.
+
+ *compatible-default*
+When Vim starts, the 'compatible' option is on. This will be used when Vim
+starts its initializations. But as soon as a user vimrc file is found, or a
+vimrc file in the current directory, or the "VIMINIT" environment variable is
+set, it will be set to 'nocompatible'. This has the side effect of setting or
+resetting other options (see 'compatible'). But only the options that have
+not been set or reset will be changed. This has the same effect like the
+value of 'compatible' had this value when starting Vim. Note that this
+doesn't happen for the system-wide vimrc file.
+
+But there is a side effect of setting or resetting 'compatible' at the moment
+a .vimrc file is found: Mappings are interpreted the moment they are
+encountered. This makes a difference when using things like "<CR>". If the
+mappings depend on a certain value of 'compatible', set or reset it before
+giving the mapping.
+
+The above behavior can be overridden in these ways:
+- If the "-N" command line argument is given, 'nocompatible' will be used,
+ even when no vimrc file exists.
+- If the "-C" command line argument is given, 'compatible' will be used, even
+ when a vimrc file exists.
+- If the "-u {vimrc}" argument is used, 'compatible' will be used.
+- When the name of the executable ends in "ex", then this works like the "-C"
+ argument was given: 'compatible' will be used, even when a vimrc file
+ exists. This has been done to make Vim behave like "ex", when it is started
+ as "ex".
+
+Avoiding trojan horses: *trojan-horse*
+While reading the "vimrc" or the "exrc" file in the current directory, some
+commands can be disabled for security reasons by setting the 'secure' option.
+This is always done when executing the command from a tags file. Otherwise it
+would be possible that you accidentally use a vimrc or tags file that somebody
+else created and contains nasty commands. The disabled commands are the ones
+that start a shell, the ones that write to a file, and ":autocmd". The ":map"
+commands are echoed, so you can see which keys are being mapped.
+ If you want Vim to execute all commands in a local vimrc file, you
+can reset the 'secure' option in the EXINIT or VIMINIT environment variable or
+in the global "exrc" or "vimrc" file. This is not possible in "vimrc" or
+"exrc" in the current directory, for obvious reasons.
+ On Unix systems, this only happens if you are not the owner of the
+vimrc file. Warning: If you unpack an archive that contains a vimrc or exrc
+file, it will be owned by you. You won't have the security protection. Check
+the vimrc file before you start Vim in that directory, or reset the 'exrc'
+option. Some Unix systems allow a user to do "chown" on a file. This makes
+it possible for another user to create a nasty vimrc and make you the owner.
+Be careful!
+ When using tag search commands, executing the search command (the last
+part of the line in the tags file) is always done in secure mode. This works
+just like executing a command from a vimrc/exrc in the current directory.
+
+ *slow-start*
+If Vim takes a long time to start up, there may be a few causes:
+- If the Unix version was compiled with the GUI and/or X11 (check the output
+ of ":version" for "+GUI" and "+X11"), it may need to load shared libraries
+ and connect to the X11 server. Try compiling a version with GUI and X11
+ disabled. This also should make the executable smaller.
+ Use the |-X| command line argument to avoid connecting to the X server when
+ running in a terminal.
+- If you have "viminfo" enabled, the loading of the viminfo file may take a
+ while. You can find out if this is the problem by disabling viminfo for a
+ moment (use the Vim argument "-i NONE", |-i|). Try reducing the number of
+ lines stored in a register with ":set viminfo='20,<50,s10". |viminfo-file|.
+
+ *:intro*
+When Vim starts without a file name, an introductory message is displayed (for
+those who don't know what Vim is). It is removed as soon as the display is
+redrawn in any way. To see the message again, use the ":intro" command (if
+there is not enough room, you will see only part of it).
+ To avoid the intro message on startup, add the 'I' flag to 'shortmess'.
+
+ *info-message*
+The |--help| and |--version| arguments cause Vim to print a message and then
+exit. Normally the message is send to stdout, thus can be redirected to a
+file with: >
+
+ vim --help >file
+
+From inside Vim: >
+
+ :read !vim --help
+
+When using gvim, it detects that it might have been started from the desktop,
+without a terminal to show messages on. This is detected when both stdout and
+stderr are not a tty. This breaks the ":read" command, as used in the example
+above. To make it work again, set 'shellredir' to ">" instead of the default
+">&": >
+
+ :set shellredir=>
+ :read !gvim --help
+
+This still won't work for systems where gvim does not use stdout at all
+though.
+
+==============================================================================
+5. $VIM and $VIMRUNTIME
+ *$VIM*
+The environment variable "$VIM" is used to locate various user files for Vim,
+such as the user startup script ".vimrc". This depends on the system, see
+|startup|.
+
+To avoid the need for every user to set the $VIM environment variable, Vim
+will try to get the value for $VIM in this order:
+1. The value defined by the $VIM environment variable. You can use this to
+ make Vim look in a specific directory for its support files. Example: >
+ setenv VIM /home/paul/vim
+2. The path from 'helpfile' is used, unless it contains some environment
+ variable too (the default is "$VIMRUNTIME/doc/help.txt": chicken-egg
+ problem). The file name ("help.txt" or any other) is removed. Then
+ trailing directory names are removed, in this order: "doc", "runtime" and
+ "vim{version}" (e.g., "vim54").
+3. For MSDOS, Win32 and OS/2 Vim tries to use the directory name of the
+ executable. If it ends in "/src", this is removed. This is useful if you
+ unpacked the .zip file in some directory, and adjusted the search path to
+ find the vim executable. Trailing directory names are removed, in this
+ order: "runtime" and "vim{version}" (e.g., "vim54").
+4. For Unix the compile-time defined installation directory is used (see the
+ output of ":version").
+
+Once Vim has done this once, it will set the $VIM environment variable. To
+change it later, use a ":let" command like this: >
+ :let $VIM = "/home/paul/vim/"
+<
+ *$VIMRUNTIME*
+The environment variable "$VIMRUNTIME" is used to locate various support
+files, such as the on-line documentation and files used for syntax
+highlighting. For example, the main help file is normally
+"$VIMRUNTIME/doc/help.txt".
+You don't normally set $VIMRUNTIME yourself, but let Vim figure it out. This
+is the order used to find the value of $VIMRUNTIME:
+1. If the environment variable $VIMRUNTIME is set, it is used. You can use
+ this when the runtime files are in an unusual location.
+2. If "$VIM/vim{version}" exists, it is used. {version} is the version
+ number of Vim, without any '-' or '.'. For example: "$VIM/vim54". This is
+ the normal value for $VIMRUNTIME.
+3. If "$VIM/runtime" exists, it is used.
+4. The value of $VIM is used. This is for backwards compatibility with older
+ versions.
+5. When the 'helpfile' option is set and doesn't contain a '$', its value is
+ used, with "doc/help.txt" removed from the end.
+
+For Unix, when there is a compiled-in default for $VIMRUNTIME (check the
+output of ":version"), steps 2, 3 and 4 are skipped, and the compiled-in
+default is used after step 5. This means that the compiled-in default
+overrules the value of $VIM. This is useful if $VIM is "/etc" and the runtime
+files are in "/usr/share/vim/vim54".
+
+Once Vim has done this once, it will set the $VIMRUNTIME environment variable.
+To change it later, use a ":let" command like this: >
+ :let $VIMRUNTIME = "/home/piet/vim/vim54"
+
+==============================================================================
+6. Suspending *suspend*
+
+ *iconize* *iconise* *CTRL-Z* *v_CTRL-Z*
+CTRL-Z Suspend Vim, like ":stop".
+ Works in Normal and in Visual mode. In Insert and
+ Command-line mode, the CTRL-Z is inserted as a normal
+ character. In Visual mode Vim goes back to Normal
+ mode.
+
+
+:sus[pend][!] or *:sus* *:suspend* *:st* *:stop*
+:st[op][!] Suspend Vim.
+ If the '!' is not given and 'autowrite' is set, every
+ buffer with changes and a file name is written out.
+ If the '!' is given or 'autowrite' is not set, changed
+ buffers are not written, don't forget to bring Vim
+ back to the foreground later!
+
+In the GUI, suspending is implemented as iconising gvim. In Windows 95/NT,
+gvim is minimized.
+
+On many Unix systems, it is possible to suspend Vim with CTRL-Z. This is only
+possible in Normal and Visual mode (see next chapter, |vim-modes|). Vim will
+continue if you make it the foreground job again. On other systems, CTRL-Z
+will start a new shell. This is the same as the ":sh" command. Vim will
+continue if you exit from the shell.
+
+In X-windows the selection is disowned when Vim suspends. this means you
+can't paste it in another application (since Vim is going to sleep an attempt
+to get the selection would make the program hang).
+
+==============================================================================
+7. Saving settings *save-settings*
+
+Mostly you will edit your vimrc files manually. This gives you the greatest
+flexibility. There are a few commands to generate a vimrc file automatically.
+You can use these files as they are, or copy/paste lines to include in another
+vimrc file.
+
+ *:mk* *:mkexrc*
+:mk[exrc] [file] Write current key mappings and changed options to
+ [file] (default ".exrc" in the current directory),
+ unless it already exists. {not in Vi}
+
+:mk[exrc]! [file] Always write current key mappings and changed
+ options to [file] (default ".exrc" in the current
+ directory). {not in Vi}
+
+ *:mkv* *:mkvimrc*
+:mkv[imrc][!] [file] Like ":mkexrc", but the default is ".vimrc" in the
+ current directory. The ":version" command is also
+ written to the file. {not in Vi}
+
+These commands will write ":map" and ":set" commands to a file, in such a way
+that when these commands are executed, the current key mappings and options
+will be set to the same values. The options 'columns', 'endofline',
+'fileformat', 'key', 'lines', 'modified', 'scroll', 'term', 'textmode',
+'ttyfast' and 'ttymouse' are not included, because these are terminal or file
+dependent. Note that the options 'binary', 'paste' and 'readonly' are
+included, this might not always be what you want.
+
+When special keys are used in mappings, The 'cpoptions' option will be
+temporarily set to its Vim default, to avoid the mappings to be
+misinterpreted. This makes the file incompatible with Vi, but makes sure it
+can be used with different terminals.
+
+Only global mappings are stored, not mappings local to a buffer.
+
+A common method is to use a default ".vimrc" file, make some modifications
+with ":map" and ":set" commands and write the modified file. First read the
+default ".vimrc" in with a command like ":source ~piet/.vimrc.Cprogs", change
+the settings and then save them in the current directory with ":mkvimrc!". If
+you want to make this file your default .vimrc, move it to your home directory
+(on Unix), s: (Amiga) or $VIM directory (MS-DOS). You could also use
+autocommands |autocommand| and/or modelines |modeline|.
+
+If you only want to add a single option setting to your vimrc, you can use
+these steps:
+1. Edit your vimrc file with Vim.
+2. Play with the option until it's right. E.g., try out different values for
+ 'guifont'.
+3. Append a line to set the value of the option, using the expression register
+ '=' to enter the value. E.g., for the 'guifont' option: >
+ o:set guifont=<C-R>=&guifont<CR><Esc>
+< [<C-R> is a CTRL-R, <CR> is a return, <Esc> is the escape key]
+
+Note that when you create a .vimrc file, this can influence the 'compatible'
+option, which has several side effects. See |'compatible'|.
+":mkvimrc", ":mkexrc" and ":mksession" write the command to set or reset the
+'compatible' option to the output file first, because of these side effects.
+
+==============================================================================
+8. Views and Sessions *views-sessions*
+
+This is introduced in sections |21.4| and |21.5| of the user manual.
+
+ *View* *view-file*
+A View is a collection of settings that apply to one window. You can save a
+View and when you restore it later, the text is displayed in the same way.
+The options and mappings in this window will also be restored, so that you can
+continue editing like when the View was saved.
+
+ *Session* *session-file*
+A Session keeps the Views for all windows, plus the global settings. You can
+save a Session and when you restore it later the window layout looks the same.
+You can use a Session to quickly switch between different projects,
+automatically loading the files you were last working on in that project.
+
+Views and Sessions are a nice addition to viminfo-files, which are used to
+remember information for all Views and Sessions together |viminfo-file|.
+
+You can quickly start editing with a previously saved View or Session with the
+|-S| argument: >
+ vim -S Session.vim
+<
+All this is {not in Vi} and {not available when compiled without the
+|+mksession| feature}.
+
+ *:mks* *:mksession*
+:mks[ession][!] [file] Write a Vim script that restores the current editing
+ session.
+ When [!] is included an existing file is overwritten.
+ When [file] is omitted "Session.vim" is used.
+
+The output of ":mksession" is like ":mkvimrc", but additional commands are
+added to the file. Which ones depends on the 'sessionoptions' option. The
+resulting file, when executed with a ":source" command:
+1. Restores global mappings and options, if 'sessionoptions' contains
+ "options". Script-local mappings will not be written.
+2. Restores global variables that start with an uppercase letter and contain
+ at least one lowercase letter, if 'sessionoptions' contains "globals".
+3. Unloads all currently loaded buffers.
+4. Restores the current directory if 'sessionoptions' contains "curdir", or
+ sets the current directory to where the Session file is if 'sessionoptions'
+ contains "sesdir".
+5. Restores GUI Vim window position, if 'sessionoptions' contains "winpos".
+6. Restores screen size, if 'sessionoptions' contains "resize".
+7. Reloads the buffer list, with the last cursor positions. If
+ 'sessionoptions' contains "buffers" then all buffers are restored,
+ including hidden and unloaded buffers. Otherwise only buffers in windows
+ are restored.
+8. Restores all windows with the same layout. If 'sessionoptions' contains
+ contains "help", help windows are restored. If 'sessionoptions' contains
+ "blank", windows editing a buffer without a name will be restored.
+ If 'sessionoptions' contains "winsize" and no (help/blank) windows were
+ left out, the window sizes are restored (relative to the screen size).
+ Otherwise, the windows are just given sensible sizes.
+9. Restores the Views for all the windows, as with |:mkview|. But
+ 'sessionoptions' is used instead of 'viewoptions'.
+10. If a file exists with the same name as the Session file, but ending in
+ "x.vim" (for eXtra), executes that as well. You can use *x.vim files to
+ specify additional settings and actions associated with a given Session,
+ such as creating menu items in the GUI version.
+
+After restoring the Session, the full filename of your current Session is
+available in the internal variable "v:this_session" |this_session-variable|.
+An example mapping: >
+ :nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/
+This saves the current Session, and starts off the command to load another.
+
+ *:mkvie* *:mkview*
+:mkvie[w][!] [file] Write a Vim script that restores the contents of the
+ current window.
+ When [!] is included an existing file is overwritten.
+ When [file] is omitted or is a number from 1 to 9, a
+ name is generated and 'viewdir' prepended. When last
+ directory name in 'viewdir' does not exist, this
+ directory is created.
+ An existing file is always overwritten then. Use
+ |:loadview| to load this view again.
+ When [file] is the name of a file ('viewdir' is not
+ used), a command to edit the file is added to the
+ generated file.
+
+The output of ":mkview" contains these items:
+1. The argument list used in the window. When the global argument list is
+ used it is reset to the global list.
+ The index in the argument list is also restored.
+2. The file being edited in the window. If there is no file, the window is
+ made empty.
+3. Restore mappings, abbreviations and options local to the window if
+ 'viewoptions' contains "options" or "localoptions". For the options it
+ restores only values that are local to the current buffer and values local
+ to the window.
+ When storing the view as part of a session and "options" is in
+ 'sessionoptions', global values for local options will be stored too.
+4. Restore folds when using manual folding and 'viewoptions' contains
+ "folds". Restore manually opened and closed folds.
+5. The scroll position and the cursor position in the file. Doesn't work very
+ well when there are closed folds.
+6. The local current directory, if it is different from the global current
+ directory.
+
+Note that Views and Sessions are not perfect:
+- They don't restore everything. For example, defined functions, autocommands
+ and ":syntax on" are not included. Things like register contents and
+ command line history are in viminfo, not in Sessions or Views.
+- Global option values are only set when the differ from the default value.
+ When the current value is not the default value, loading a Session will not
+ set it back to the default value. Local options will be set back to the
+ default value though.
+- Existing mappings will be overwritten without warning. An existing mapping
+ may cause an error for ambiguity.
+- When storing manual folds and when storing manually opened/closed folds,
+ changes in the file between saving and loading the view will mess it up.
+- The Vim script is not very efficient. But still faster than typing the
+ commands yourself!
+
+ *:lo* *:loadview*
+:lo[adview] [nr] Load the view for the current file. When [nr] is
+ omitted, the view stored with ":mkview" is loaded.
+ When [nr] is specified, the view stored with ":mkview
+ [nr]" is loaded.
+
+The combination of ":mkview" and ":loadview" can be used to store up to ten
+different views of a file. These are remembered in the directory specified
+with the 'viewdir' option. The views are stored using the file name. If a
+file is renamed or accessed through a (symbolic) link the view will not be
+found.
+
+You might want to clean up your 'viewdir' directory now and then.
+
+To automatically save and restore views for *.c files: >
+ au BufWinLeave *.c mkview
+ au BufWinEnter *.c silent loadview
+
+==============================================================================
+9. The viminfo file *viminfo* *viminfo-file* *E136*
+ *E575* *E576* *E577*
+If you exit Vim and later start it again, you would normally lose a lot of
+information. The viminfo file can be used to remember that information, which
+enables you to continue where you left off.
+
+This is introduced in section |21.3| of the user manual.
+
+The viminfo file is used to store:
+- The command line history.
+- The search string history.
+- The input-line history.
+- Contents of registers.
+- Marks for several files.
+- File marks, pointing to locations in files.
+- Last search/substitute pattern (for 'n' and '&').
+- The buffer list.
+- Global variables.
+
+The viminfo file is not supported when the |+viminfo| feature has been
+disabled at compile time.
+
+You could also use a Session file. The difference is that the viminfo file
+does not depend on what you are working on. There normally is only one
+viminfo file. Session files are used to save the state of a specific editing
+Session. You could have several Session files, one for each project you are
+working on. Viminfo and Session files together can be used to effectively
+enter Vim and directly start working in your desired setup. |session-file|
+
+ *viminfo-read*
+When Vim is started and the 'viminfo' option is non-empty, the contents of
+the viminfo file are read and the info can be used in the appropriate places.
+The marks are not read in at startup (but file marks are). See
+|initialization| for how to set the 'viminfo' option upon startup.
+
+ *viminfo-write*
+When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
+file (it's actually merged with the existing one, if one exists). The
+'viminfo' option is a string containing information about what info should be
+stored, and contains limits on how much should be stored (see 'viminfo').
+
+Notes for Unix:
+- The file protection for the viminfo file will be set to prevent other users
+ from being able to read it, because it may contain any text or commands that
+ you have worked with.
+- If you want to share the viminfo file with other users (e.g. when you "su"
+ to another user), you can make the file writable for the group or everybody.
+ Vim will preserve this when writing new viminfo files. Be careful, don't
+ allow just anybody to read and write your viminfo file!
+- Vim will not overwrite a viminfo file that is not writable by the current
+ "real" user. This helps for when you did "su" to become root, but your
+ $HOME is still set to a normal user's home directory. Otherwise Vim would
+ create a viminfo file owned by root that nobody else can read.
+
+Marks are stored for each file separately. When a file is read and 'viminfo'
+is non-empty, the marks for that file are read from the viminfo file. NOTE:
+The marks are only written when exiting Vim, which is fine because marks are
+remembered for all the files you have opened in the current editing session,
+unless ":bdel" is used. If you want to save the marks for a file that you are
+about to abandon with ":bdel", use ":wv". The '[' and ']' marks are not
+stored, but the '"' mark is. The '"' mark is very useful for jumping to the
+cursor position when the file was last exited. No marks are saved for files
+that start with any string given with the "r" flag in 'viminfo'. This can be
+used to avoid saving marks for files on removable media (for MS-DOS you would
+use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
+
+ *viminfo-file-marks*
+Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The
+numbered marks ('0 to '9) are a bit special. When the viminfo file is written
+(when exiting or with the ":wviminfo" command), '0 is set to the current cursor
+position and file. The old '0 is moved to '1, '1 to '2, etc. This
+resembles what happens with the "1 to "9 delete registers. If the current
+cursor position is already present in '0 to '9, it is moved to '0, to avoid
+having the same position twice. The result is that with "'0", you can jump
+back to the file and line where you exited Vim. To do that right away, try
+using this command: >
+
+ vim -c "normal '0"
+
+In a shell you could make an alias for it: >
+
+ alias lvim vim -c '"'normal "'"0'"'
+
+Use the "r" flag in 'viminfo' to specify for which files no marks should be
+remembered.
+
+
+VIMINFO FILE NAME *viminfo-file-name*
+
+- The default name of the viminfo file is "$HOME/.viminfo" for Unix and OS/2,
+ "s:.viminfo" for Amiga, "$HOME\_viminfo" for MS-DOS and Win32. For the last
+ two, when $HOME is not set, "$VIM\_viminfo" is used. When $VIM is also not
+ set, "c:\_viminfo" is used. For OS/2 "$VIM/.viminfo" is used when $HOME is
+ not set and $VIM is set.
+- The 'n' flag in the 'viminfo' option can be used to specify another viminfo
+ file name |'viminfo'|.
+- The "-i" Vim argument can be used to set another file name, |-i|. When the
+ file name given is "NONE" (all uppercase), no viminfo file is ever read or
+ written. Also not for the commands below!
+- For the commands below, another file name can be given, overriding the
+ default and the name given with 'viminfo' or "-i" (unless it's NONE).
+
+
+CHARACTER ENCODING *viminfo-encoding*
+
+The text in the viminfo file is encoded as specified with the 'encoding'
+option. Normally you will always work with the same 'encoding' value, and
+this works just fine. However, if you read the viminfo file with another
+value for 'encoding' than what it was written with, some of the text
+(non-ASCII characters) may be invalid. If this is unacceptable, add the 'c'
+flag to the 'viminfo' option: >
+ :set viminfo+=c
+Vim will then attempt to convert the text in the viminfo file from the
+'encoding' value it was written with to the current 'encoding' value. This
+requires Vim to be compiled with the |+iconv| feature. Filenames are not
+converted.
+
+
+MANUALLY READING AND WRITING
+
+Two commands can be used to read and write the viminfo file manually. This
+can be used to exchange registers between two running Vim programs: First
+type ":wv" in one and then ":rv" in the other. Note that if the register
+already contained something, then ":rv!" would be required. Also note
+however that this means everything will be overwritten with information from
+the first Vim, including the command line history, etc.
+
+The viminfo file itself can be edited by hand too, although we suggest you
+start with an existing one to get the format right. It is reasonably
+self-explanatory once you're in there. This can be useful in order to
+create a second file, say "~/.my_viminfo" which could contain certain
+settings that you always want when you first start Vim. For example, you
+can preload registers with particular data, or put certain commands in the
+command line history. A line in your .vimrc file like >
+ :rviminfo! ~/.my_viminfo
+can be used to load this information. You could even have different viminfos
+for different types of files (e.g., C code) and load them based on the file
+name, using the ":autocmd" command (see |:autocmd|).
+
+ *viminfo-errors*
+When Vim detects an error while reading a viminfo file, it will not overwrite
+that file. If there are more than 10 errors, Vim stops reading the viminfo
+file. This was done to avoid accidentally destroying a file when the file
+name of the viminfo file is wrong. This could happen when accidentally typing
+"vim -i file" when you wanted "vim -R file" (yes, somebody accidentally did
+that!). If you want to overwrite a viminfo file with an error in it, you will
+either have to fix the error, or delete the file (while Vim is running, so
+most of the information will be restored).
+
+ *:rv* *:rviminfo* *E195*
+:rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
+ If [!] is given, then any information that is
+ already set (registers, marks, etc.) will be
+ overwritten. {not in Vi}
+
+ *:wv* *:wviminfo* *E137* *E138* *E574*
+:wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
+ The information in the file is first read in to make
+ a merge between old and new info. When [!] is used,
+ the old information is not read first, only the
+ internal info is written. If 'viminfo' is empty, marks
+ for up to 100 files will be written.
+ When you get error "E138: Can't write viminfo file"
+ check that no old temp files were left behind (e.g.
+ ~/.viminf*) and that you can write in the directory of
+ the .viminfo file.
+ {not in Vi}
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
new file mode 100644
index 000000000..db322355b
--- /dev/null
+++ b/runtime/doc/syntax.txt
@@ -0,0 +1,4161 @@
+*syntax.txt* For Vim version 7.0aa. Last change: 2004 Jun 09
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Syntax highlighting *syntax* *syntax-highlighting* *coloring*
+
+Syntax highlighting enables Vim to show parts of the text in another font or
+color. Those parts can be specific keywords or text matching a pattern. Vim
+doesn't parse the whole file (to keep it fast), so the highlighting has its
+limitations. Lexical highlighting might be a better name, but since everybody
+calls it syntax highlighting we'll stick with that.
+
+Vim supports syntax highlighting on all terminals. But since most ordinary
+terminals have very limited highlighting possibilities, it works best in the
+GUI version, gvim.
+
+In the User Manual:
+|usr_06.txt| introduces syntax highlighting.
+|usr_44.txt| introduces writing a syntax file.
+
+1. Quick start |:syn-qstart|
+2. Syntax files |:syn-files|
+3. Syntax loading procedure |syntax-loading|
+4. Syntax file remarks |:syn-file-remarks|
+5. Defining a syntax |:syn-define|
+6. :syntax arguments |:syn-arguments|
+7. Syntax patterns |:syn-pattern|
+8. Syntax clusters |:syn-cluster|
+9. Including syntax files |:syn-include|
+10. Synchronizing |:syn-sync|
+11. Listing syntax items |:syntax|
+12. Highlight command |:highlight|
+13. Linking groups |:highlight-link|
+14. Cleaning up |:syn-clear|
+15. Highlighting tags |tag-highlight|
+16. Color xterms |xterm-color|
+
+{Vi does not have any of these commands}
+
+Syntax highlighting is not available when the |+syntax| feature has been
+disabled at compile time.
+
+==============================================================================
+1. Quick start *:syn-qstart*
+
+ *:syn-enable* *:syntax-enable*
+This command switches on syntax highlighting: >
+
+ :syntax enable
+
+What this command actually does is to execute the command >
+ :source $VIMRUNTIME/syntax/syntax.vim
+
+If the VIM environment variable is not set, Vim will try to find
+the path in another way (see |$VIMRUNTIME|). Usually this works just
+fine. If it doesn't, try setting the VIM environment variable to the
+directory where the Vim stuff is located. For example, if your syntax files
+are in the "/usr/vim/vim50/syntax" directory, set $VIMRUNTIME to
+"/usr/vim/vim50". You must do this in the shell, before starting Vim.
+
+ *:syn-on* *:syntax-on*
+The ":syntax enable" command will keep your current color settings. This
+allows using ":highlight" commands to set your preferred colors before or
+after using this command. If you want Vim to overrule your settings with the
+defaults, use: >
+ :syntax on
+<
+ *:hi-normal* *:highlight-normal*
+If you are running in the GUI, you can get white text on a black background
+with: >
+ :highlight Normal guibg=Black guifg=White
+For a color terminal see |:hi-normal-cterm|.
+For setting up your own colors syntax highlighting see |syncolor|.
+
+NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>.
+The files for Unix end in <NL>. This means you should use the right type of
+file for your system. Although on MS-DOS and Windows the right format is
+automatically selected if the 'fileformats' option is not empty.
+
+NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
+of 'background' will not be set until the GUI window is opened, which is after
+reading the .gvimrc. This will cause the wrong default highlighting to be
+used. To set the default value of 'background' before switching on
+highlighting, include the ":gui" command in the .gvimrc: >
+
+ :gui " open window and set default for 'background'
+ :syntax on " start highlighting, use 'background' to set colors
+
+NOTE: Using ":gui" in the .gvimrc means that "gvim -f" won't start in the
+foreground! Use ":gui -f" then.
+
+
+You can toggle the syntax on/off with this command >
+ :if exists("syntax_on") | syntax off | else | syntax enable | endif
+
+To put this into a mapping, you can use: >
+ :map <F7> :if exists("syntax_on") <Bar>
+ \ syntax off <Bar>
+ \ else <Bar>
+ \ syntax enable <Bar>
+ \ endif <CR>
+[using the |<>| notation, type this literally]
+
+Details
+The ":syntax" commands are implemented by sourcing a file. To see exactly how
+this works, look in the file:
+ command file ~
+ :syntax enable $VIMRUNTIME/syntax/syntax.vim
+ :syntax on $VIMRUNTIME/syntax/syntax.vim
+ :syntax manual $VIMRUNTIME/syntax/manual.vim
+ :syntax off $VIMRUNTIME/syntax/nosyntax.vim
+Also see |syntax-loading|.
+
+==============================================================================
+2. Syntax files *:syn-files*
+
+The syntax and highlighting commands for one language are normally stored in
+a syntax file. The name convention is: "{name}.vim". Where {name} is the
+name of the language, or an abbreviation (to fit the name in 8.3 characters,
+a requirement in case the file is used on a DOS filesystem).
+Examples:
+ c.vim perl.vim java.vim html.vim
+ cpp.vim sh.vim csh.vim
+
+The syntax file can contain any Ex commands, just like a vimrc file. But
+the idea is that only commands for a specific language are included. When a
+language is a superset of another language, it may include the other one,
+for example, the cpp.vim file could include the c.vim file: >
+ :so $VIMRUNTIME/syntax/c.vim
+
+The .vim files are normally loaded with an autocommand. For example: >
+ :au Syntax c runtime! syntax/c.vim
+ :au Syntax cpp runtime! syntax/cpp.vim
+These commands are normally in the file $VIMRUNTIME/syntax/synload.vim.
+
+
+MAKING YOUR OWN SYNTAX FILES *mysyntaxfile*
+
+When you create your own syntax files, and you want to have Vim use these
+automatically with ":syntax enable", do this:
+
+1. Create your user runtime directory. You would normally use the first item
+ of the 'runtimepath' option. Example for Unix: >
+ mkdir ~/.vim
+
+2. Create a directory in there called "syntax". For Unix: >
+ mkdir ~/.vim/syntax
+
+3. Write the Vim syntax file. Or download one from the internet. Then write
+ it in your syntax directory. For example, for the "mine" syntax: >
+ :w ~/.vim/syntax/mine.vim
+
+Now you can start using your syntax file manually: >
+ :set syntax=mine
+You don't have to exit Vim to use this.
+
+If you also want Vim to detect the type of file, see |new-filetype|.
+
+If you are setting up a system with many users and you don't want each user
+to add the same syntax file, you can use another directory from 'runtimepath'.
+
+
+ADDING TO AN EXISTING SYNTAX FILE *mysyntaxfile-add*
+
+If you are mostly satisfied with an existing syntax file, but would like to
+add a few items or change the highlighting, follow these steps:
+
+1. Create your user directory from 'runtimepath', see above.
+
+2. Create a directory in there called "after/syntax". For Unix: >
+ mkdir ~/.vim/after
+ mkdir ~/.vim/after/syntax
+
+3. Write a Vim script that contains the commands you want to use. For
+ example, to change the colors for the C syntax: >
+ highlight cComment ctermfg=Green guifg=Green
+
+4. Write that file in the "after/syntax" directory. Use the name of the
+ syntax, with ".vim" added. For our C syntax: >
+ :w ~/.vim/after/syntax/c.vim
+
+That's it. The next time you edit a C file the Comment color will be
+different. You don't even have to restart Vim.
+
+
+REPLACING AN EXISTING SYNTAX FILE *mysyntaxfile-replace*
+
+If you don't like a distributed syntax file, or you have downloaded a new
+version, follow the same steps as for |mysyntaxfile| above. Just make sure
+that you write the syntax file in a directory that is early in 'runtimepath'.
+Vim will only load the first syntax file found.
+
+
+NAMING CONVENTIONS
+ *group-name* *{group-name}* *E669* *W18*
+The name for a highlight or syntax group must consist of ASCII letters, digits
+and the underscore. As a regexp: "[a-zA-Z0-9_]*"
+
+To be able to allow each user to pick his favorite set of colors, there must
+be preferred names for highlight groups that are common for many languages.
+These are the suggested group names (if syntax highlighting works properly
+you can see the actual color, except for "Ignore"):
+
+ *Comment any comment
+
+ *Constant any constant
+ String a string constant: "this is a string"
+ Character a character constant: 'c', '\n'
+ Number a number constant: 234, 0xff
+ Boolean a boolean constant: TRUE, false
+ Float a floating point constant: 2.3e10
+
+ *Identifier any variable name
+ Function function name (also: methods for classes)
+
+ *Statement any statement
+ Conditional if, then, else, endif, switch, etc.
+ Repeat for, do, while, etc.
+ Label case, default, etc.
+ Operator "sizeof", "+", "*", etc.
+ Keyword any other keyword
+ Exception try, catch, throw
+
+ *PreProc generic Preprocessor
+ Include preprocessor #include
+ Define preprocessor #define
+ Macro same as Define
+ PreCondit preprocessor #if, #else, #endif, etc.
+
+ *Type int, long, char, etc.
+ StorageClass static, register, volatile, etc.
+ Structure struct, union, enum, etc.
+ Typedef A typedef
+
+ *Special any special symbol
+ SpecialChar special character in a constant
+ Tag you can use CTRL-] on this
+ Delimiter character that needs attention
+ SpecialComment special things inside a comment
+ Debug debugging statements
+
+ *Underlined text that stands out, HTML links
+
+ *Ignore left blank, hidden
+
+ *Error any erroneous construct
+
+ *Todo anything that needs extra attention; mostly the
+ keywords TODO FIXME and XXX
+
+The names marked with * are the preferred groups; the others are minor groups.
+For the preferred groups, the "syntax.vim" file contains default highlighting.
+The minor groups are linked to the preferred groups, so they get the same
+highlighting. You can override these defaults by using ":highlight" commands
+after sourcing the "syntax.vim" file.
+
+Note that highlight group names are not case sensitive. "String" and "string"
+can be used for the same group.
+
+The following names are reserved and cannot be used as a group name:
+ NONE ALL ALLBUT contains contained
+
+==============================================================================
+3. Syntax loading procedure *syntax-loading*
+
+This explains the details that happen when the command ":syntax enable" is
+issued. When Vim initializes itself, it finds out where the runtime files are
+located. This is used here as the variable |$VIMRUNTIME|.
+
+":syntax enable" and ":syntax on" do the following:
+
+ Source $VIMRUNTIME/syntax/syntax.vim
+ |
+ +- Clear out any old syntax by sourcing $VIMRUNTIME/syntax/nosyntax.vim
+ |
+ +- Source first syntax/synload.vim in 'runtimepath'
+ | |
+ | +- Setup the colors for syntax highlighting. If a color scheme is
+ | | defined it is loaded again with ":colors {name}". Otherwise
+ | | ":runtime! syntax/syncolor.vim" is used. ":syntax on" overrules
+ | | existing colors, ":syntax enable" only sets groups that weren't
+ | | set yet.
+ | |
+ | +- Set up syntax autocmds to load the appropriate syntax file when
+ | | the 'syntax' option is set. *synload-1*
+ | |
+ | +- Source the user's optional file, from the |mysyntaxfile| variable.
+ | This is for backwards compatibility with Vim 5.x only. *synload-2*
+ |
+ +- Do ":filetype on", which does ":runtime! filetype.vim". It loads any
+ | filetype.vim files found. It should always Source
+ | $VIMRUNTIME/filetype.vim, which does the following.
+ | |
+ | +- Install autocmds based on suffix to set the 'filetype' option
+ | | This is where the connection between file name and file type is
+ | | made for known file types. *synload-3*
+ | |
+ | +- Source the user's optional file, from the *myfiletypefile*
+ | | variable. This is for backwards compatibility with Vim 5.x only.
+ | | *synload-4*
+ | |
+ | +- Install one autocommand which sources scripts.vim when no file
+ | | type was detected yet. *synload-5*
+ | |
+ | +- Source $VIMRUNTIME/menu.vim, to setup the Syntax menu. |menu.vim|
+ |
+ +- Install a FileType autocommand to set the 'syntax' option when a file
+ | type has been detected. *synload-6*
+ |
+ +- Execute syntax autocommands to start syntax highlighting for each
+ already loaded buffer.
+
+
+Upon loading a file, Vim finds the relevant syntax file as follows:
+
+ Loading the file triggers the BufReadPost autocommands.
+ |
+ +- If there is a match with one of the autocommands from |synload-3|
+ | (known file types) or |synload-4| (user's file types), the 'filetype'
+ | option is set to the file type.
+ |
+ +- The autocommand at |synload-5| is triggered. If the file type was not
+ | found yet, then scripts.vim is searched for in 'runtimepath'. This
+ | should always load $VIMRUNTIME/scripts.vim, which does the following.
+ | |
+ | +- Source the user's optional file, from the *myscriptsfile*
+ | | variable. This is for backwards compatibility with Vim 5.x only.
+ | |
+ | +- If the file type is still unknown, check the contents of the file,
+ | again with checks like "getline(1) =~ pattern" as to whether the
+ | file type can be recognized, and set 'filetype'.
+ |
+ +- When the file type was determined and 'filetype' was set, this
+ | triggers the FileType autocommand |synload-6| above. It sets
+ | 'syntax' to the determined file type.
+ |
+ +- When the 'syntax' option was set above, this triggers an autocommand
+ | from |synload-1| (and |synload-2|). This find the main syntax file in
+ | 'runtimepath', with this command:
+ | runtime! syntax/<name>.vim
+ |
+ +- Any other user installed FileType or Syntax autocommands are
+ triggered. This can be used to change the highlighting for a specific
+ syntax.
+
+==============================================================================
+4. Syntax file remarks *:syn-file-remarks*
+
+ *b:current_syntax-variable*
+Vim stores the name of the syntax that has been loaded in the
+"b:current_syntax" variable. You can use this if you want to load other
+settings, depending on which syntax is active. Example: >
+ :au BufReadPost * if b:current_syntax == "csh"
+ :au BufReadPost * do-some-things
+ :au BufReadPost * endif
+
+
+2HTML *2html.vim* *convert-to-HTML*
+
+This is not a syntax file itself, but a script that converts the current
+window into HTML. Vim opens a new window in which it builds the HTML file.
+
+You are not supposed to set the 'filetype' or 'syntax' option to "2html"!
+Source the script to convert the current file: >
+
+ :runtime! syntax/2html.vim
+<
+Warning: This is slow!
+ *:TOhtml*
+Or use the ":TOhtml" user command. It is defined in a standard plugin.
+":TOhtml" also works with a range and in a Visual area: >
+
+ :10,40TOhtml
+
+After you save the resulting file, you can view it with any HTML viewer, such
+as Netscape. The colors should be exactly the same as you see them in Vim.
+
+To restrict the conversion to a range of lines set "html_start_line" and
+"html_end_line" to the first and last line to be converted. Example, using
+the last set Visual area: >
+
+ :let html_start_line = line("'<")
+ :let html_end_line = line("'>")
+
+The lines are numbered according to 'number' option and the Number
+highlighting. You can force lines to be numbered in the HTML output by
+setting "html_number_lines" to non-zero value: >
+ :let html_number_lines = 1
+Force to omit the line numbers by using a zero value: >
+ :let html_number_lines = 0
+Go back to the default to use 'number' by deleting the variable: >
+ :unlet html_number_lines
+
+By default, HTML optimized for old browsers is generated. If you prefer using
+cascading style sheets (CSS1) for the attributes (resulting in considerably
+shorter and valid HTML 4 file), use: >
+ :let html_use_css = 1
+
+By default "<pre>" and "</pre>" is used around the text. This makes it show
+up as you see it in Vim, but without wrapping. If you prefer wrapping, at the
+risk of making some things look a bit different, use: >
+ :let html_no_pre = 1
+This will use <br> at the end of each line and use "&nbsp;" for repeated
+spaces.
+
+The current value of 'encoding' is used to specify the charset of the HTML
+file. This only works for those values of 'encoding' that have an equivalent
+HTML charset name. To overrule this set g:html_use_encoding to the name of
+the charset to be used: >
+ :let html_use_encoding = "foobar"
+To omit the line that specifies the charset, set g:html_use_encoding to an
+empty string: >
+ :let html_use_encoding = ""
+To go back to the automatic mechanism, delete the g:html_use_encoding
+variable: >
+ :unlet html_use_encoding
+<
+ *convert-to-XML* *convert-to-XHTML*
+An alternative is to have the script generate XHTML (XML compliant HTML). To
+do this set the "use_xhtml" variable: >
+ :let use_xhtml = 1
+To disable it again delete the variable: >
+ :unlet use_xhtml
+The generated XHTML file can be used in DocBook XML documents. See:
+ http://people.mech.kuleuven.ac.be/~pissaris/howto/src2db.html
+
+Remarks:
+- This only works in a version with GUI support. If the GUI is not actually
+ running (possible for X11) it still works, but not very well (the colors
+ may be wrong).
+- Older browsers will not show the background colors.
+- From most browsers you can also print the file (in color)!
+
+Here is an example how to run the script over all .c and .h files from a
+Unix shell: >
+ for f in *.[ch]; do gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; done
+<
+
+ABEL *abel.vim* *abel-syntax*
+
+ABEL highlighting provides some user-defined options. To enable them, assign
+any value to the respective variable. Example: >
+ :let abel_obsolete_ok=1
+To disable them use ":unlet". Example: >
+ :unlet abel_obsolete_ok
+
+Variable Highlight ~
+abel_obsolete_ok obsolete keywords are statements, not errors
+abel_cpp_comments_illegal do not interpret '//' as inline comment leader
+
+
+ADA *ada.vim* *ada-syntax*
+
+This mode is designed for the 1995 edition of Ada ("Ada95"), which
+includes support for objected-programming, protected types, and so on.
+It handles code written for the original Ada language
+("Ada83" or "Ada87") as well, though Ada83 code which uses Ada95-only
+keywords will be wrongly colored (such code should be fixed anyway).
+For more information about Ada, see http://www.adapower.com.
+
+The Ada mode handles a number of situations cleanly.
+For example, it knows that the "-" in "-5" is a number, but the same
+character in "A-5" is an operator. Normally, a "with" or "use" clause
+referencing another compilation unit is colored the same way as C's
+"#include" is colored. If you have "Conditional" or "Repeat"
+groups colored differently, then "end if" and "end loop" will be
+colored as part of those respective groups.
+You can set these to different colors using vim's "highlight" command
+(e.g., to change how loops are displayed, enter the command
+":hi Repeat" followed by the color specification; on simple terminals
+the color specification ctermfg=White often shows well).
+
+There are several options you can select in this Ada mode.
+To enable them, assign a value to the option. For example, to turn one on:
+ let ada_standard_types = 1
+To disable them use ":unlet". Example:
+ unlet ada_standard_types = 1
+You can just use ":" and type these into the command line to set these
+temporarily before loading an Ada file. You can make these option settings
+permanent by adding the "let" command(s), without a colon,
+to your "~/.vimrc" file.
+
+Here are the Ada mode options:
+
+Variable Action ~
+ada_standard_types Highlight types in package Standard (e.g., "Float")
+ada_space_errors Highlight extraneous errors in spaces...
+ada_no_trail_space_error but ignore trailing spaces at the end of a line
+ada_no_tab_space_error but ignore tabs after spaces
+ada_withuse_ordinary Show "with" and "use" as ordinary keywords
+ (when used to reference other compilation units
+ they're normally highlighted specially).
+ada_begin_preproc Show all begin-like keywords using the coloring
+ of C preprocessor commands.
+
+Even on a slow (90Mhz) PC this mode works quickly, but if you find
+the performance unacceptable, turn on ada_withuse_ordinary.
+
+
+ANT *ant.vim* *ant-syntax*
+
+The ant syntax file provides syntax highlighting for javascript and python
+by default. Syntax highlighting for other script languages can be installed
+by the function AntSyntaxScript(), which takes the tag name as first argument
+and the script syntax file name as second argument. Example: >
+
+ :call AntSyntaxScript('perl', 'perl.vim')
+
+will install syntax perl highlighting for the following ant code >
+
+ <script language = 'perl'><![CDATA[
+ # everything inside is highlighted as perl
+ ]]></script>
+
+See |mysyntaxfile-add| for installing script languages permanently.
+
+
+APACHE *apache.vim* *apache-syntax*
+
+The apache syntax file provides syntax highlighting depending on Apache HTTP
+server version, by default for 1.3.x. Set "apache_version" to Apache version
+(as a string) to get highlighting for another version. Example: >
+
+ :let apache_version = "2.0"
+<
+
+ *asm.vim* *asmh8300.vim* *nasm.vim* *masm.vim* *asm68k*
+ASSEMBLY *asm-syntax* *asmh8300-syntax* *nasm-syntax* *masm-syntax*
+ *asm68k-syntax* *fasm.vim*
+
+Files matching "*.i" could be Progress or Assembly. If the automatic detection
+doesn't work for you, or you don't edit Progress at all, use this in your
+startup vimrc: >
+ :let filetype_i = "asm"
+Replace "asm" with the type of assembly you use.
+
+There are many types of assembly languages that all use the same file name
+extensions. Therefore you will have to select the type yourself, or add a
+line in the assembly file that Vim will recognize. Currently these syntax
+files are included:
+ asm GNU assembly (the default)
+ asm68k Motorola 680x0 assembly
+ asmh8300 Hitachi H-8300 version of GNU assembly
+ ia64 Intel Itanium 64
+ fasm Flat assembly (http://flatassembler.net)
+ masm Microsoft assembly (probably works for any 80x86)
+ nasm Netwide assembly
+ tasm Turbo Assembly (with opcodes 80x86 up to Pentium, and
+ MMX)
+ pic PIC assembly (currently for PIC16F84)
+
+The most flexible is to add a line in your assembly file containing: >
+ :asmsyntax=nasm
+Replace "nasm" with the name of the real assembly syntax. This line must be
+one of the first five lines in the file.
+
+The syntax type can always be overruled for a specific buffer by setting the
+b:asmsyntax variable: >
+ :let b:asmsyntax=nasm
+
+If b:asmsyntax is not set, either automatically or by hand, then the value of
+the global variable asmsyntax is used. This can be seen as a default assembly
+language: >
+ :let asmsyntax=nasm
+
+As a last resort, if nothing is defined, the "asm" syntax is used.
+
+
+Netwide assembler (nasm.vim) optional highlighting ~
+
+To enable a feature: >
+ :let {variable}=1|set syntax=nasm
+To disable a feature: >
+ :unlet {variable} |set syntax=nasm
+
+Variable Highlight ~
+nasm_loose_syntax unofficial parser allowed syntax not as Error
+ (parser dependent; not recommended)
+nasm_ctx_outside_macro contexts outside macro not as Error
+nasm_no_warn potentially risky syntax not as ToDo
+
+
+ASPPERL and ASPVBS *aspperl-syntax* *aspvbs-syntax*
+
+*.asp and *.asa files could be either Perl or Visual Basic script. Since it's
+hard to detect this you can set two global variables to tell Vim what you are
+using. For Perl script use: >
+ :let g:filetype_asa = "aspperl"
+ :let g:filetype_asp = "aspperl"
+For Visual Basic use: >
+ :let g:filetype_asa = "aspvbs"
+ :let g:filetype_asp = "aspvbs"
+
+
+BASIC *basic.vim* *vb.vim* *basic-syntax* *vb-syntax*
+
+Both Visual Basic and "normal" basic use the extension ".bas". To detect
+which one should be used, Vim checks for the string "VB_Name" in the first
+five lines of the file. If it is not found, filetype will be "basic",
+otherwise "vb". Files with the ".frm" extension will always be seen as Visual
+Basic.
+
+
+C *c.vim* *c-syntax*
+
+A few things in C highlighting are optional. To enable them assign any value
+to the respective variable. Example: >
+ :let c_comment_strings=1
+To disable them use ":unlet". Example: >
+ :unlet c_comment_strings
+
+Variable Highlight ~
+c_gnu GNU gcc specific items
+c_comment_strings strings and numbers inside a comment
+c_space_errors trailing white space and spaces before a <Tab>
+c_no_trail_space_error ... but no trailing spaces
+c_no_tab_space_error ... but no spaces before a <Tab>
+c_no_bracket_error don't highlight {}; inside [] as errors
+c_no_ansi don't do standard ANSI types and constants
+c_ansi_typedefs ... but do standard ANSI types
+c_ansi_constants ... but do standard ANSI constants
+c_no_utf don't highlight \u and \U in strings
+c_syntax_for_h use C syntax for *.h files, instead of C++
+c_no_if0 don't highlight "#if 0" blocks as comments
+c_no_cformat don't highlight %-formats in strings
+c_no_c99 don't highlight C99 standard items
+
+If you notice highlighting errors while scrolling backwards, which are fixed
+when redrawing with CTRL-L, try setting the "c_minlines" internal variable
+to a larger number: >
+ :let c_minlines = 100
+This will make the syntax synchronization start 100 lines before the first
+displayed line. The default value is 50 (15 when c_no_if0 is set). The
+disadvantage of using a larger number is that redrawing can become slow.
+
+When using the "#if 0" / "#endif" comment highlighting, notice that this only
+works when the "#if 0" is within "c_minlines" from the top of the window. If
+you have a long "#if 0" construct it will not be highlighted correctly.
+
+To match extra items in comments, use the cCommentGroup cluster.
+Example: >
+ :au Syntax c call MyCadd()
+ :function MyCadd()
+ : syn keyword cMyItem contained Ni
+ : syn cluster cCommentGroup add=cMyItem
+ : hi link cMyItem Title
+ :endfun
+
+ANSI constants will be highlighted with the "cConstant" group. This includes
+"NULL", "SIG_IGN" and others. But not "TRUE", for example, because this is
+not in the ANSI standard. If you find this confusing, remove the cConstant
+highlighting: >
+ :hi link cConstant NONE
+
+If you see '{' and '}' highlighted as an error where they are OK, reset the
+highlighting for cErrInParen and cErrInBracket.
+
+If you want to use folding in your C files, you can add these lines in a file
+an the "after" directory in 'runtimepath'. For Unix this would be
+~/.vim/after/syntax/c.vim. >
+ syn region myFold start="{" end="}" transparent fold
+ syn sync fromstart
+ set foldmethod=syntax
+
+
+CHILL *chill.vim* *chill-syntax*
+
+Chill syntax highlighting is similar to C. See |c.vim| for all the settings
+that are available. Additionally there is:
+
+chill_syntax_for_h use Ch syntax for *.h files, instead of C or C++
+chill_space_errors like c_space_errors
+chill_comment_string like c_comment_strings
+chill_minlines like c_minlines
+
+
+CHANGELOG *changelog.vim* *changelog-syntax*
+
+ChangeLog supports highlighting spaces at the start of a line.
+If you do not like this, add following line to your .vimrc: >
+ let g:changelog_spacing_errors = 0
+This works the next time you edit a changelog file. You can also use
+"b:changelog_spacing_errors" to set this per buffer (before loading the syntax
+file).
+
+You can change the highlighting used, e.g., to flag the spaces as an error: >
+ :hi link ChangelogError Error
+Or to avoid the highlighting: >
+ :hi link ChangelogError NONE
+This works immediately.
+
+
+COBOL *cobol.vim* *cobol-syntax*
+
+COBOL highlighting has different needs for legacy code than it does for fresh
+development. This is due to differences in what is being done (maintenance
+versus development) and other factors. To enable legacy code highlighting,
+add this line to your .vimrc: >
+ :let cobol_legacy_code = 1
+To disable it again, use this: >
+ :unlet cobol_legacy_code
+
+
+COLD FUSION *coldfusion.vim* *coldfusion-syntax*
+
+The ColdFusion has its own version of HTML comments. To turn on ColdFusion
+comment highlighting, add the following line to your startup file: >
+
+ :let html_wrong_comments = 1
+
+The ColdFusion syntax file is based on the HTML syntax file.
+
+
+CSH *csh.vim* *csh-syntax*
+
+This covers the shell named "csh". Note that on some systems tcsh is actually
+used.
+
+Detecting whether a file is csh or tcsh is notoriously hard. Some systems
+symlink /bin/csh to /bin/tcsh, making it almost impossible to distinguish
+between csh and tcsh. In case VIM guesses wrong you can set the
+"filetype_csh" variable. For using csh: >
+
+ :let filetype_csh = "csh"
+
+For using tcsh: >
+
+ :let filetype_csh = "tcsh"
+
+Any script with a tcsh extension or a standard tcsh filename (.tcshrc,
+tcsh.tcshrc, tcsh.login) will have filetype tcsh. All other tcsh/csh scripts
+will be classified as tcsh, UNLESS the "filetype_csh" variable exists. If the
+"filetype_csh" variable exists, the filetype will be set to the value of the
+variable.
+
+
+CYNLIB *cynlib.vim* *cynlib-syntax*
+
+Cynlib files are C++ files that use the Cynlib class library to enable
+hardware modeling and simulation using C++. Typically Cynlib files have a .cc
+or a .cpp extension, which makes it very difficult to distinguish them from a
+normal C++ file. Thus, to enable Cynlib highlighting for .cc files, add this
+line to your .vimrc file: >
+
+ :let cynlib_cyntax_for_cc=1
+
+Similarly for cpp files (this extension is only usually used in Windows) >
+
+ :let cynlib_cyntax_for_cpp=1
+
+To disable these again, use this: >
+
+ :unlet cynlib_cyntax_for_cc
+ :unlet cynlib_cyntax_for_cpp
+<
+
+CWEB *cweb.vim* *cweb-syntax*
+
+Files matching "*.w" could be Progress or cweb. If the automatic detection
+doesn't work for you, or you don't edit Progress at all, use this in your
+startup vimrc: >
+ :let filetype_w = "cweb"
+
+
+DESKTOP *desktop.vim* *desktop-syntax*
+
+Primary goal of this syntax file is to highlight .desktop and .directory files
+according to freedesktop.org standard: http://pdx.freedesktop.org/Standards/
+But actually almost none implements this standard fully. Thus it will
+highlight all Unix ini files. But you can force strict highlighting according
+to standard by placing this in your vimrc file: >
+ :let enforce_freedesktop_standard = 1
+
+
+DIRCOLORS *dircolors.vim* *dircolors-syntax*
+
+The dircolors utility highlighting definition has one option. It exists to
+provide compatibility with the Slackware GNU/Linux distributions version of
+the command. It adds a few keywords that are generally ignored by most
+versions. On Slackware systems, however, the utility accepts the keywords and
+uses them for processing. To enable the Slackware keywords add the following
+line to your startup file: >
+ let dircolors_is_slackware = 1
+
+
+DOCBOOK *docbk.vim* *docbk-syntax* *docbook*
+DOCBOOK XML *docbkxml.vim* *docbkxml-syntax*
+DOCBOOK SGML *docbksgml.vim* *docbksgml-syntax*
+
+There are two types of DocBook files: SGML and XML. To specify what type you
+are using the "b:docbk_type" variable should be set. Vim does this for you
+automatically if it can recognize the type. When Vim can't guess it the type
+defaults to XML.
+You can set the type manually: >
+ :let docbk_type = "sgml"
+or: >
+ :let docbk_type = "xml"
+You need to do this before loading the syntax file, which is complicated.
+Simpler is setting the filetype to "docbkxml" or "docbksgml": >
+ :set filetype=docbksgml
+or: >
+ :set filetype=docbkxml
+
+
+DOSBATCH *dosbatch.vim* *dosbatch-syntax*
+
+There is one option with highlighting DOS batch files. This covers new
+extensions to the Command Interpreter introduced with Windows 2000 and
+is controlled by the variable dosbatch_cmdextversion. For Windows NT
+this should have the value 1, and for Windows 2000 it should be 2.
+Select the version you want with the following line: >
+
+ :let dosbatch_cmdextversion = 1
+
+If this variable is not defined it defaults to a value of 2 to support
+Windows 2000.
+
+
+DTD *dtd.vim* *dtd-syntax*
+
+The DTD syntax highlighting is case sensitive by default. To disable
+case-sensitive highlighting, add the following line to your startup file: >
+
+ :let dtd_ignore_case=1
+
+The DTD syntax file will highlight unknown tags as errors. If
+this is annoying, it can be turned off by setting: >
+
+ :let dtd_no_tag_errors=1
+
+before sourcing the dtd.vim syntax file.
+Parameter entity names are highlighted in the definition using the
+'Type' highlighting group and 'Comment' for punctuation and '%'.
+Parameter entity instances are highlighted using the 'Constant'
+highlighting group and the 'Type' highlighting group for the
+delimiters % and ;. This can be turned off by setting: >
+
+ :let dtd_no_param_entities=1
+
+The DTD syntax file is also included by xml.vim to highlight included dtd's.
+
+
+EIFFEL *eiffel.vim* *eiffel-syntax*
+
+While Eiffel is not case-sensitive, its style guidelines are, and the
+syntax highlighting file encourages their use. This also allows to
+highlight class names differently. If you want to disable case-sensitive
+highlighting, add the following line to your startup file: >
+
+ :let eiffel_ignore_case=1
+
+Case still matters for class names and TODO marks in comments.
+
+Conversely, for even stricter checks, add one of the following lines: >
+
+ :let eiffel_strict=1
+ :let eiffel_pedantic=1
+
+Setting eiffel_strict will only catch improper capitalization for the
+five predefined words "Current", "Void", "Result", "Precursor", and
+"NONE", to warn against their accidental use as feature or class names.
+
+Setting eiffel_pedantic will enforce adherence to the Eiffel style
+guidelines fairly rigorously (like arbitrary mixes of upper- and
+lowercase letters as well as outdated ways to capitalize keywords).
+
+If you want to use the lower-case version of "Current", "Void",
+"Result", and "Precursor", you can use >
+
+ :let eiffel_lower_case_predef=1
+
+instead of completely turning case-sensitive highlighting off.
+
+Support for ISE's proposed new creation syntax that is already
+experimentally handled by some compilers can be enabled by: >
+
+ :let eiffel_ise=1
+
+Finally, some vendors support hexadecimal constants. To handle them, add >
+
+ :let eiffel_hex_constants=1
+
+to your startup file.
+
+
+ERLANG *erlang.vim* *erlang-syntax*
+
+The erlang highlighting supports Erlang (ERicsson LANGuage).
+Erlang is case sensitive and default extension is ".erl".
+
+If you want to disable keywords highlighting, put in your .vimrc: >
+ :let erlang_keywords = 1
+If you want to disable built-in-functions highlighting, put in your
+.vimrc file: >
+ :let erlang_functions = 1
+If you want to disable special characters highlighting, put in
+your .vimrc: >
+ :let erlang_characters = 1
+
+
+FORM *form.vim* *form-syntax*
+
+The coloring scheme for syntax elements in the FORM file uses the default
+modes Conditional, Number, Statement, Comment, PreProc, Type, and String,
+following the language specifications in 'Symbolic Manipulation with FORM'' by
+J.A.M. Vermaseren, CAN, Netherlands, 1991.
+
+If you want include your own changes to the default colors, you have to
+redefine the following syntax groups:
+
+ - formConditional
+ - formNumber
+ - formStatement
+ - formHeaderStatement
+ - formComment
+ - formPreProc
+ - formDirective
+ - formType
+ - formString
+
+Note that the form.vim syntax file implements FORM preprocessor commands and
+directives per default in the same syntax group.
+
+A predefined enhanced color mode for FORM is available to distinguish between
+header statements and statements in the body of a FORM program. To activate
+this mode define the following variable in your vimrc file >
+
+ :let form_enhanced_color=1
+
+The enhanced mode also takes advantage of additional color features for a dark
+gvim display. Here, statements are colored LightYellow instead of Yellow, and
+conditionals are LightBlue for better distinction.
+
+
+FORTRAN *fortran.vim* *fortran-syntax*
+
+Default highlighting and dialect ~
+Highlighting appropriate for f95 (Fortran 95) is used by default. This choice
+should be appropriate for most users most of the time because Fortran 95 is a
+superset of Fortran 90 and almost a superset of Fortran 77.
+
+Fortran source code form ~
+Fortran 9x code can be in either fixed or free source form. Note that the
+syntax highlighting will not be correct if the form is incorrectly set.
+
+When you create a new fortran file, the syntax script assumes fixed source
+form. If you always use free source form, then >
+ :let fortran_free_source=1
+in your .vimrc prior to the :syntax on command. If you always use fixed source
+form, then >
+ :let fortran_fixed_source=1
+in your .vimrc prior to the :syntax on command.
+
+If the form of the source code depends upon the file extension, then it is
+most convenient to set fortran_free_source in a ftplugin file. For more
+information on ftplugin files, see |ftplugin|. For example, if all your
+fortran files with an .f90 extension are written in free source form and the
+rest in fixed source form, add the following code to your ftplugin file >
+ let s:extfname = expand("%:e")
+ if s:extfname ==? "f90"
+ let fortran_free_source=1
+ unlet! fortran_fixed_source
+ else
+ let fortran_fixed_source=1
+ unlet! fortran_free_source
+ endif
+Note that this will work only if the "filetype plugin indent on" command
+precedes the "syntax on" command in your .vimrc file.
+
+When you edit an existing fortran file, the syntax script will assume free
+source form if the fortran_free_source variable has been set, and assumes
+fixed source form if the fortran_fixed_source variable has been set. If
+neither of these variables have been set, the syntax script attempts to
+determine which source form has been used by examining the first five columns
+of the first 25 lines of your file. If no signs of free source form are
+detected, then the file is assumed to be in fixed source form. The algorithm
+should work in the vast majority of cases. In some cases, such as a file that
+begins with 25 or more full-line comments, the script may incorrectly decide
+that the fortran code is in fixed form. If that happens, just add a
+non-comment statement beginning anywhere in the first five columns of the
+first twenty five lines, save (:w) and then reload (:e!) the file.
+
+Tabs in fortran files ~
+Tabs are not recognized by the Fortran standards. Tabs are not a good idea in
+fixed format fortran source code which requires fixed column boundaries.
+Therefore, tabs are marked as errors. Nevertheless, some programmers like
+using tabs. If your fortran files contain tabs, then you should set the
+variable fortran_have_tabs in your .vimrc with a command such as >
+ :let fortran_have_tabs=1
+placed prior to the :syntax on command. Unfortunately, the use of tabs will
+mean that the syntax file will not be able to detect incorrect margins.
+
+Syntax folding of fortran files ~
+If you wish to use foldmethod=syntax, then you must first set the variable
+fortran_fold with a command such as >
+ :let fortran_fold=1
+to instruct the syntax script to define fold regions for program units, that
+is main programs starting with a program statement, subroutines, function
+subprograms, block data subprograms, interface blocks, and modules. If you
+also set the variable fortran_fold_conditionals with a command such as >
+ :let fortran_fold_conditionals=1
+then fold regions will also be defined for do loops, if blocks, and select
+case constructs. If you also set the variable
+fortran_fold_multilinecomments with a command such as >
+ :let fortran_fold_multilinecomments=1
+then fold regions will also be defined for three or more consecutive comment
+lines. Note that defining fold regions can be slow for large files.
+
+If fortran_fold, and possibly fortran_fold_conditionals and/or
+fortran_fold_multilinecomments, have been set, then vim will fold your file if
+you set foldmethod=syntax. Comments or blank lines placed between two program
+units are not folded because they are seen as not belonging to any program
+unit.
+
+More precise fortran syntax ~
+If you set the variable fortran_more_precise with a command such as >
+ :let fortran_more_precise=1
+then the syntax coloring will be more precise but slower. In particular,
+statement labels used in do, goto and arithmetic if statements will be
+recognized, as will construct names at the end of a do, if, select or forall
+construct.
+
+Non-default fortran dialects ~
+The syntax script supports five Fortran dialects: f95, f90, f77, the Lahey
+subset elf90, and the Imagine1 subset F.
+
+If you use f77 with extensions, even common ones like do/enddo loops, do/while
+loops and free source form that are supported by most f77 compilers including
+g77 (GNU Fortran), then you will probably find the default highlighting
+satisfactory. However, if you use strict f77 with no extensions, not even free
+source form or the MIL STD 1753 extensions, then the advantages of setting the
+dialect to f77 are that names such as SUM are recognized as user variable
+names and not highlighted as f9x intrinsic functions, that obsolete constructs
+such as ASSIGN statements are not highlighted as todo items, and that fixed
+source form will be assumed.
+
+If you use elf90 or F, the advantage of setting the dialect appropriately is
+that f90 features excluded from these dialects will be highlighted as todo
+items and that free source form will be assumed as required for these
+dialects.
+
+The dialect can be selected by setting the variable fortran_dialect. The
+permissible values of fortran_dialect are case-sensitive and must be "f95",
+"f90", "f77", "elf" or "F". Invalid values of fortran_dialect are ignored.
+
+If all your fortran files use the same dialect, set fortran_dialect in your
+.vimrc prior to your syntax on statement. If the dialect depends upon the file
+extension, then it is most convenient to set it in a ftplugin file. For more
+information on ftplugin files, see |ftplugin|. For example, if all your
+fortran files with an .f90 extension are written in the elf subset, your
+ftplugin file should contain the code >
+ let s:extfname = expand("%:e")
+ if s:extfname ==? "f90"
+ let fortran_dialect="elf"
+ else
+ unlet! fortran_dialect
+ endif
+Note that this will work only if the "filetype plugin indent on" command
+precedes the "syntax on" command in your .vimrc file.
+
+Finer control is necessary if the file extension does not uniquely identify
+the dialect. You can override the default dialect, on a file-by-file basis, by
+including a comment with the directive "fortran_dialect=xx" (where xx=f77 or
+elf or F or f90 or f95) in one of the first three lines in your file. For
+example, your older .f files may be written in extended f77 but your newer
+ones may be F codes, and you would identify the latter by including in the
+first three lines of those files a Fortran comment of the form >
+ ! fortran_dialect=F
+F overrides elf if both directives are present.
+
+Limitations ~
+Parenthesis checking does not catch too few closing parentheses. Hollerith
+strings are not recognized. Some keywords may be highlighted incorrectly
+because Fortran90 has no reserved words.
+
+For further information related to fortran, see |fortran-indent| and
+|fortran-plugin|.
+
+
+FVWM CONFIGURATION FILES *fvwm.vim* *fvwm-syntax*
+
+In order for Vim to recognize Fvwm configuration files that do not match
+the patterns *fvwmrc* or *fvwm2rc* , you must put additional patterns
+appropriate to your system in your myfiletypes.vim file. For these
+patterns, you must set the variable "b:fvwm_version" to the major version
+number of Fvwm, and the 'filetype' option to fvwm.
+
+For example, to make Vim identify all files in /etc/X11/fvwm2/
+as Fvwm2 configuration files, add the following: >
+
+ :au! BufNewFile,BufRead /etc/X11/fvwm2/* let b:fvwm_version = 2 |
+ \ set filetype=fvwm
+
+If you'd like Vim to highlight all valid color names, tell it where to
+find the color database (rgb.txt) on your system. Do this by setting
+"rgb_file" to its location. Assuming your color database is located
+in /usr/X11/lib/X11/, you should add the line >
+
+ :let rgb_file = "/usr/X11/lib/X11/rgb.txt"
+
+to your .vimrc file.
+
+
+GSP *gsp.vim*
+
+The default coloring style for GSP pages is defined by |html.vim|, and
+the coloring for java code (within java tags or inline between backticks)
+is defined by |java.vim|. The following HTML groups defined in |html.vim|
+are redefined to incorporate and highlight inline java code:
+
+ htmlString
+ htmlValue
+ htmlEndTag
+ htmlTag
+ htmlTagN
+
+Highlighting should look fine most of the places where you'd see inline
+java code, but in some special cases it may not. To add another HTML
+group where you will have inline java code where it does not highlight
+correctly, just copy the line you want from |html.vim| and add gspJava
+to the contains clause.
+
+The backticks for inline java are highlighted according to the htmlError
+group to make them easier to see.
+
+
+GROFF *groff.vim* *groff-syntax*
+
+The groff syntax file is a wrapper for |nroff.vim|, see the notes
+under that heading for examples of use and configuration. The purpose
+of this wrapper is to set up groff syntax extensions by setting the
+filetype from a |modeline| or in a personal filetype definitions file
+(see |filetype.txt|).
+
+
+HASKELL *haskell.vim* *lhaskell.vim* *haskell-syntax*
+
+The Haskell syntax files support plain Haskell code as well as literate
+Haskell code, the latter in both Bird style and TeX style. The Haskell
+syntax highlighting will also highlight C preprocessor directives.
+
+If you want to highlight delimiter characters (useful if you have a
+light-coloured background), add to your .vimrc: >
+ :let hs_highlight_delimiters = 1
+To treat True and False as keywords as opposed to ordinary identifiers,
+add: >
+ :let hs_highlight_boolean = 1
+To also treat the names of primitive types as keywords: >
+ :let hs_highlight_types = 1
+And to treat the names of even more relatively common types as keywords: >
+ :let hs_highlight_more_types = 1
+If you want to highlight the names of debugging functions, put in
+your .vimrc: >
+ :let hs_highlight_debug = 1
+
+The Haskell syntax highlighting also highlights C preprocessor
+directives, and flags lines that start with # but are not valid
+directives as erroneous. This interferes with Haskell's syntax for
+operators, as they may start with #. If you want to highlight those
+as operators as opposed to errors, put in your .vimrc: >
+ :let hs_allow_hash_operator = 1
+
+The syntax highlighting for literate Haskell code will try to
+automatically guess whether your literate Haskell code contains
+TeX markup or not, and correspondingly highlight TeX constructs
+or nothing at all. You can override this globally by putting
+in your .vimrc >
+ :let lhs_markup = none
+for no highlighting at all, or >
+ :let lhs_markup = tex
+to force the highlighting to always try to highlight TeX markup.
+For more flexibility, you may also use buffer local versions of
+this variable, so e.g. >
+ :let b:lhs_markup = tex
+will force TeX highlighting for a particular buffer. It has to be
+set before turning syntax highlighting on for the buffer or
+loading a file.
+
+
+HTML *html.vim* *html-syntax*
+
+The coloring scheme for tags in the HTML file works as follows.
+
+The <> of opening tags are colored differently than the </> of a closing tag.
+This is on purpose! For opening tags the 'Function' color is used, while for
+closing tags the 'Type' color is used (See syntax.vim to check how those are
+defined for you)
+
+Known tag names are colored the same way as statements in C. Unknown tag
+names are colored with the same color as the <> or </> respectively which
+makes it easy to spot errors
+
+Note that the same is true for argument (or attribute) names. Known attribute
+names are colored differently than unknown ones.
+
+Some HTML tags are used to change the rendering of text. The following tags
+are recognized by the html.vim syntax coloring file and change the way normal
+text is shown: <B> <I> <U> <EM> <STRONG> (<EM> is used as an alias for <I>,
+while <STRONG> as an alias for <B>), <H1> - <H6>, <HEAD>, <TITLE> and <A>, but
+only if used as a link that is, it must include a href as in
+<A href="somfile.html">).
+
+If you want to change how such text is rendered, you must redefine the
+following syntax groups:
+
+ - htmlBold
+ - htmlBoldUnderline
+ - htmlBoldUnderlineItalic
+ - htmlUnderline
+ - htmlUnderlineItalic
+ - htmlItalic
+ - htmlTitle for titles
+ - htmlH1 - htmlH6 for headings
+
+To make this redefinition work you must redefine them all with the exception
+of the last two (htmlTitle and htmlH[1-6], which are optional) and define the
+following variable in your vimrc (this is due to the order in which the files
+are read during initialization) >
+ :let html_my_rendering=1
+
+If you'd like to see an example download mysyntax.vim at
+http://www.fleiner.com/vim/download.html
+
+You can also disable this rendering by adding the following line to your
+vimrc file: >
+ :let html_no_rendering=1
+
+HTML comments are rather special (see an HTML reference document for the
+details), and the syntax coloring scheme will highlight all errors.
+However, if you prefer to use the wrong style (starts with <!-- and
+ends with --!>) you can define >
+ :let html_wrong_comments=1
+
+JavaScript and Visual Basic embedded inside HTML documents are highlighted as
+'Special' with statements, comments, strings and so on colored as in standard
+programming languages. Note that only JavaScript and Visual Basic are currently
+supported, no other scripting language has been added yet.
+
+Embedded and inlined cascading style sheets (CSS) are highlighted too.
+
+There are several html preprocessor languages out there. html.vim has been
+written such that it should be trivial to include it. To do so add the
+following two lines to the syntax coloring file for that language
+(the example comes from the asp.vim file):
+
+ runtime! syntax/html.vim
+ syn cluster htmlPreproc add=asp
+
+Now you just need to make sure that you add all regions that contain
+the preprocessor language to the cluster htmlPreproc.
+
+
+HTML/OS (by Aestiva) *htmlos.vim* *htmlos-syntax*
+
+The coloring scheme for HTML/OS works as follows:
+
+Functions and variable names are the same color by default, because VIM
+doesn't specify different colors for Functions and Identifiers. To change
+this (which is recommended if you want function names to be recognizable in a
+different color) you need to add the following line to either your ~/.vimrc: >
+ :hi Function term=underline cterm=bold ctermfg=LightGray
+
+Of course, the ctermfg can be a different color if you choose.
+
+Another issues that HTML/OS runs into is that there is no special filetype to
+signify that it is a file with HTML/OS coding. You can change this by opening
+a file and turning on HTML/OS syntax by doing the following: >
+ :set syntax=htmlos
+
+Lastly, it should be noted that the opening and closing characters to begin a
+block of HTML/OS code can either be << or [[ and >> or ]], respectively.
+
+
+IA64 *ia64.vim* *intel-itanium* *ia64-syntax*
+
+Highlighting for the Intel Itanium 64 assembly language. See |asm.vim| for
+how to recognize this filetype.
+
+To have *.inc files be recognized as IA64, add this to your .vimrc file: >
+ :let g:filetype_inc = "ia64"
+
+
+INFORM *inform.vim* *inform-syntax*
+
+Inform highlighting includes symbols provided by the Inform Library, as
+most programs make extensive use of it. If do not wish Library symbols
+to be highlighted add this to your vim startup: >
+ :let inform_highlight_simple=1
+
+By default it is assumed that Inform programs are Z-machine targeted,
+and highlights Z-machine assembly language symbols appropriately. If
+you intend your program to be targeted to a Glulx/Glk environment you
+need to add this to your startup sequence: >
+ :let inform_highlight_glulx=1
+
+This will highlight Glulx opcodes instead, and also adds glk() to the
+set of highlighted system functions.
+
+The Inform compiler will flag certain obsolete keywords as errors when
+it encounters them. These keywords are normally highlighted as errors
+by Vim. To prevent such error highlighting, you must add this to your
+startup sequence: >
+ :let inform_suppress_obsolete=1
+
+By default, the language features highlighted conform to Compiler
+version 6.30 and Library version 6.11. If you are using an older
+Inform development environment, you may with to add this to your
+startup sequence: >
+ :let inform_highlight_old=1
+
+
+JAVA *java.vim* *java-syntax*
+
+The java.vim syntax highlighting file offers several options:
+
+In Java 1.0.2 it was never possible to have braces inside parens, so this was
+flagged as an error. Since Java 1.1 this is possible (with anonymous
+classes), and therefore is no longer marked as an error. If you prefer the old
+way, put the following line into your vim startup file: >
+ :let java_mark_braces_in_parens_as_errors=1
+
+All identifiers in java.lang.* are always visible in all classes. To
+highlight them use: >
+ :let java_highlight_java_lang_ids=1
+
+You can also highlight identifiers of most standard java packages if you
+download the javaid.vim script at http://www.fleiner.com/vim/download.html.
+If you prefer to only highlight identifiers of a certain package, say java.io
+use the following: >
+ :let java_highlight_java_io=1
+Check the javaid.vim file for a list of all the packages that are supported.
+
+Function names are not highlighted, as the way to find functions depends on
+how you write java code. The syntax file knows two possible ways to highlight
+functions:
+
+If you write function declarations that are always indented by either
+a tab, 8 spaces or 2 spaces you may want to set >
+ :let java_highlight_functions="indent"
+However, if you follow the Java guidelines about how functions and classes are
+supposed to be named (with respect to upper and lowercase), use >
+ :let java_highlight_functions="style"
+If both options do not work for you, but you would still want function
+declarations to be highlighted create your own definitions by changing the
+definitions in java.vim or by creating your own java.vim which includes the
+original one and then adds the code to highlight functions.
+
+In java 1.1 the functions System.out.println() and System.err.println() should
+only be used for debugging. Therefor it is possible to highlight debugging
+statements differently. To do this you must add the following definition in
+your startup file: >
+ :let java_highlight_debug=1
+The result will be that those statements are highlighted as 'Special'
+characters. If you prefer to have them highlighted differently you must define
+new highlightings for the following groups.:
+ Debug, DebugSpecial, DebugString, DebugBoolean, DebugType
+which are used for the statement itself, special characters used in debug
+strings, strings, boolean constants and types (this, super) respectively. I
+have opted to chose another background for those statements.
+
+In order to help you to write code that can be easily ported between
+java and C++, all C++ keywords are marked as error in a java program.
+However, if you use them regularly, you may want to define the following
+variable in your .vimrc file: >
+ :let java_allow_cpp_keywords=1
+
+Javadoc is a program that takes special comments out of java program files and
+creates HTML pages. The standard configuration will highlight this HTML code
+similarly to HTML files (see |html.vim|). You can even add javascript
+and CSS inside this code (see below). There are four differences however:
+ 1. The title (all characters up to the first '.' which is followed by
+ some white space or up to the first '@') is colored differently (to change
+ the color change the group CommentTitle).
+ 2. The text is colored as 'Comment'.
+ 3. HTML comments are colored as 'Special'
+ 4. The special javadoc tags (@see, @param, ...) are highlighted as specials
+ and the argument (for @see, @param, @exception) as Function.
+To turn this feature off add the following line to your startup file: >
+ :let java_ignore_javadoc=1
+
+If you use the special javadoc comment highlighting described above you
+can also turn on special highlighting for javascript, visual basic
+scripts and embedded CSS (stylesheets). This makes only sense if you
+actually have javadoc comments that include either javascript or embedded
+CSS. The options to use are >
+ :let java_javascript=1
+ :let java_css=1
+ :let java_vb=1
+
+In order to highlight nested parens with different colors define colors
+for javaParen, javaParen1 and javaParen2, for example with >
+ :hi link javaParen Comment
+or >
+ :hi javaParen ctermfg=blue guifg=#0000ff
+
+If you notice highlighting errors while scrolling backwards, which are fixed
+when redrawing with CTRL-L, try setting the "java_minlines" internal variable
+to a larger number: >
+ :let java_minlines = 50
+This will make the syntax synchronization start 50 lines before the first
+displayed line. The default value is 10. The disadvantage of using a larger
+number is that redrawing can become slow.
+
+
+LACE *lace.vim* *lace-syntax*
+
+Lace (Language for Assembly of Classes in Eiffel) is case insensitive, but the
+style guide lines are not. If you prefer case insensitive highlighting, just
+define the vim variable 'lace_case_insensitive' in your startup file: >
+ :let lace_case_insensitive=1
+
+
+LEX *lex.vim* *lex-syntax*
+
+Lex uses brute-force synchronizing as the "^%%$" section delimiter
+gives no clue as to what section follows. Consequently, the value for >
+ :syn sync minlines=300
+may be changed by the user if s/he is experiencing synchronization
+difficulties (such as may happen with large lex files).
+
+
+LITE *lite.vim* *lite-syntax*
+
+There are two options for the lite syntax highlighting.
+
+If you like SQL syntax highlighting inside Strings, use this: >
+
+ :let lite_sql_query = 1
+
+For syncing, minlines defaults to 100. If you prefer another value, you can
+set "lite_minlines" to the value you desire. Example: >
+
+ :let lite_minlines = 200
+
+
+LPC *lpc.vim* *lpc-syntax*
+
+LPC stands for a simple, memory-efficient language: Lars Pensj| C. The
+file name of LPC is usually *.c. Recognizing these files as LPC would bother
+users writing only C programs. If you want to use LPC syntax in Vim, you
+should set a variable in your .vimrc file: >
+
+ :let lpc_syntax_for_c = 1
+
+If it doesn't work properly for some particular C or LPC files, use a
+modeline. For a LPC file:
+
+ // vim:set ft=lpc:
+
+For a C file that is recognized as LPC:
+
+ // vim:set ft=c:
+
+If you don't want to set the variable, use the modeline in EVERY LPC file.
+
+There are several implementations for LPC, we intend to support most widely
+used ones. Here the default LPC syntax is for MudOS series, for MudOS v22
+and before, you should turn off the sensible modifiers, and this will also
+asserts the new efuns after v22 to be invalid, don't set this variable when
+you are using the latest version of MudOS: >
+
+ :let lpc_pre_v22 = 1
+
+For LpMud 3.2 series of LPC: >
+
+ :let lpc_compat_32 = 1
+
+For LPC4 series of LPC: >
+
+ :let lpc_use_lpc4_syntax = 1
+
+For uLPC series of LPC:
+uLPC has been developed to Pike, so you should use Pike syntax
+instead, and the name of your source file should be *.pike
+
+
+LUA *lua.vim* *lua-syntax*
+
+This syntax file may be used for Lua 4.0 and Lua 5.0 (default). If you are
+programming in Lua 4.0, use this: >
+
+ :let lua_version = 4
+
+If lua_version variable doesn't exist, it is set to 5.
+
+
+MAIL *mail.vim*
+
+Vim highlights all the standard elements of an email (headers, signatures,
+quoted text and URLs / email addresses). In keeping with standard conventions,
+signatures begin in a line containing only "--" followed optionally by
+whitespaces and end with a newline.
+
+Vim treats lines beginning with ']', '}', '|', '>' or a word followed by '>'
+as quoted text. However Vim highlights headers and signatures in quoted text
+only if the text is quoted with '>' (optionally followed by one space).
+
+By default mail.vim synchronises syntax to 100 lines before the first
+displayed line. If you have a slow machine, and generally deal with emails
+with short headers, you can change this to a smaller value: >
+
+ :let mail_minlines = 30
+
+
+MAKE *make.vim* *make-syntax*
+
+In makefiles, commands are usually highlighted to make it easy for you to spot
+errors. However, this may be too much coloring for you. You can turn this
+feature off by using: >
+
+ :let make_no_commands = 1
+
+
+MAPLE *maple.vim* *maple-syntax*
+
+Maple V, by Waterloo Maple Inc, supports symbolic algebra. The language
+supports many packages of functions which are selectively loaded by the user.
+The standard set of packages' functions as supplied in Maple V release 4 may be
+highlighted at the user's discretion. Users may place in their .vimrc file: >
+
+ :let mvpkg_all= 1
+
+to get all package functions highlighted, or users may select any subset by
+choosing a variable/package from the table below and setting that variable to
+1, also in their .vimrc file (prior to sourcing
+$VIMRUNTIME/syntax/syntax.vim).
+
+ Table of Maple V Package Function Selectors >
+ mv_DEtools mv_genfunc mv_networks mv_process
+ mv_Galois mv_geometry mv_numapprox mv_simplex
+ mv_GaussInt mv_grobner mv_numtheory mv_stats
+ mv_LREtools mv_group mv_orthopoly mv_student
+ mv_combinat mv_inttrans mv_padic mv_sumtools
+ mv_combstruct mv_liesymm mv_plots mv_tensor
+ mv_difforms mv_linalg mv_plottools mv_totorder
+ mv_finance mv_logic mv_powseries
+
+
+MOO *moo.vim* *moo-syntax*
+
+If you use C-style comments inside expressions and find it mangles your
+highlighting, you may want to use extended (slow!) matches for C-style
+comments: >
+
+ :let moo_extended_cstyle_comments = 1
+
+To disable highlighting of pronoun substitution patterns inside strings: >
+
+ :let moo_no_pronoun_sub = 1
+
+To disable highlighting of the regular expression operator '%|', and matching
+'%(' and '%)' inside strings: >
+
+ :let moo_no_regexp = 1
+
+Unmatched double quotes can be recognized and highlighted as errors: >
+
+ :let moo_unmatched_quotes = 1
+
+To highlight builtin properties (.name, .location, .programmer etc.): >
+
+ :let moo_builtin_properties = 1
+
+Unknown builtin functions can be recognized and highlighted as errors. If you
+use this option, add your own extensions to the mooKnownBuiltinFunction group.
+To enable this option: >
+
+ :let moo_unknown_builtin_functions = 1
+
+An example of adding sprintf() to the list of known builtin functions: >
+
+ :syn keyword mooKnownBuiltinFunction sprintf contained
+
+
+MSQL *msql.vim* *msql-syntax*
+
+There are two options for the msql syntax highlighting.
+
+If you like SQL syntax highlighting inside Strings, use this: >
+
+ :let msql_sql_query = 1
+
+For syncing, minlines defaults to 100. If you prefer another value, you can
+set "msql_minlines" to the value you desire. Example: >
+
+ :let msql_minlines = 200
+
+
+NCF *ncf.vim* *ncf-syntax*
+
+There is one option for NCF syntax highlighting.
+
+If you want to have unrecognized (by ncf.vim) statements highlighted as
+errors, use this: >
+
+ :let ncf_highlight_unknowns = 1
+
+If you don't want to highlight these errors, leave it unset.
+
+
+NROFF *nroff.vim* *nroff-syntax*
+
+The nroff syntax file works with AT&T n/troff out of the box. You need to
+activate the GNU groff extra features included in the syntax file before you
+can use them.
+
+For example, Linux and BSD distributions use groff as their default text
+processing package. In order to activate the extra syntax highlighting
+features for groff, add the following option to your start-up files: >
+
+ :let b:nroff_is_groff = 1
+
+Groff is different from the old AT&T n/troff that you may still find in
+Solaris. Groff macro and request names can be longer than 2 characters and
+there are extensions to the language primitives. For example, in AT&T troff
+you access the year as a 2-digit number with the request \(yr. In groff you
+can use the same request, recognized for compatibility, or you can use groff's
+native syntax, \[yr]. Furthermore, you can use a 4-digit year directly:
+\[year]. Macro requests can be longer than 2 characters, for example, GNU mm
+accepts the requests ".VERBON" and ".VERBOFF" for creating verbatim
+environments.
+
+In order to obtain the best formatted output g/troff can give you, you should
+follow a few simple rules about spacing and punctuation.
+
+1. Do not leave empty spaces at the end of lines.
+
+2. Leave one space and one space only after an end-of-sentence period,
+ exclamation mark, etc.
+
+3. For reasons stated below, it is best to follow all period marks with a
+ carriage return.
+
+The reason behind these unusual tips is that g/n/troff have a line breaking
+algorithm that can be easily upset if you don't follow the rules given above.
+
+Unlike TeX, troff fills text line-by-line, not paragraph-by-paragraph and,
+furthermore, it does not have a concept of glue or stretch, all horizontal and
+vertical space input will be output as is.
+
+Therefore, you should be careful about not using more space between sentences
+than you intend to have in your final document. For this reason, the common
+practice is to insert a carriage return immediately after all punctuation
+marks. If you want to have "even" text in your final processed output, you
+need to maintaining regular spacing in the input text. To mark both trailing
+spaces and two or more spaces after a punctuation as an error, use: >
+
+ :let nroff_space_errors = 1
+
+Another technique to detect extra spacing and other errors that will interfere
+with the correct typesetting of your file, is to define an eye-catching
+highlighting definition for the syntax groups "nroffDefinition" and
+"nroffDefSpecial" in your configuration files. For example: >
+
+ hi def nroffDefinition term=italic cterm=italic gui=reverse
+ hi def nroffDefSpecial term=italic,bold cterm=italic,bold
+ \ gui=reverse,bold
+
+If you want to navigate preprocessor entries in your source file as easily as
+with section markers, you can activate the following option in your .vimrc
+file: >
+
+ let b:preprocs_as_sections = 1
+
+As well, the syntax file adds an extra paragraph marker for the exdented
+paragraph macro (.XP) in the ms package.
+
+Finally, there is a |groff.vim| syntax file that can be used for enabling
+groff syntax highlighting either on a file basis or globally by default.
+
+
+OCAML *ocaml.vim* *ocaml-syntax*
+
+The OCaml syntax file handles files having the following prefixes: .ml,
+.mli, .mll and .mly. By setting the following variable >
+
+ :let ocaml_revised = 1
+
+you can switch from standard OCaml-syntax to revised syntax as supported
+by the camlp4 preprocessor. Setting the variable >
+
+ :let ocaml_noend_error = 1
+
+prevents highlighting of "end" as error, which is useful when sources
+contain very long structures that Vim does not synchronize anymore.
+
+
+PAPP *papp.vim* *papp-syntax*
+
+The PApp syntax file handles .papp files and, to a lesser extend, .pxml
+and .pxsl files which are all a mixture of perl/xml/html/other using xml
+as the top-level file format. By default everything inside phtml or pxml
+sections is treated as a string with embedded preprocessor commands. If
+you set the variable: >
+
+ :let papp_include_html=1
+
+in your startup file it will try to syntax-hilight html code inside phtml
+sections, but this is relatively slow and much too colourful to be able to
+edit sensibly ;)
+
+The newest version of the papp.vim syntax file can usually be found at
+http://papp.plan9.de.
+
+
+PASCAL *pascal.vim* *pascal-syntax*
+
+Files matching "*.p" could be Progress or Pascal. If the automatic detection
+doesn't work for you, or you don't edit Progress at all, use this in your
+startup vimrc: >
+
+ :let filetype_p = "pascal"
+
+The Pascal syntax file has been extended to take into account some extensions
+provided by Turbo Pascal, Free Pascal Compiler and GNU Pascal Compiler.
+Delphi keywords are also supported. By default, Turbo Pascal 7.0 features are
+enabled. If you prefer to stick with the standard Pascal keywords, add the
+following line to your startup file: >
+
+ :let pascal_traditional=1
+
+To switch on Delphi specific constructions (such as one-line comments,
+keywords, etc): >
+
+ :let pascal_delphi=1
+
+
+The option pascal_symbol_operator controls whether symbol operators such as +,
+*, .., etc. are displayed using the Operator color or not. To colorize symbol
+operators, add the following line to your startup file: >
+
+ :let pascal_symbol_operator=1
+
+Some functions are highlighted by default. To switch it off: >
+
+ :let pascal_no_functions=1
+
+Furthermore, there are specific variable for some compiler. Besides
+pascal_delphi, there are pascal_gpc and pascal_fpc. Default extensions try to
+match Turbo Pascal. >
+
+ :let pascal_gpc=1
+
+or >
+
+ :let pascal_fpc=1
+
+To ensure that strings are defined on a single line, you can define the
+pascal_one_line_string variable. >
+
+ :let pascal_one_line_string=1
+
+If you dislike <Tab> chars, you can set the pascal_no_tabs variable. Tabs
+will be highlighted as Error. >
+
+ :let pascal_no_tabs=1
+
+
+
+PERL *perl.vim* *perl-syntax*
+
+There are a number of possible options to the perl syntax highlighting.
+
+If you use POD files or POD segments, you might: >
+
+ :let perl_include_pod = 1
+
+To handle package references in variable and function names differently from
+the rest of the name (like 'PkgName::' in '$PkgName::VarName'): >
+
+ :let perl_want_scope_in_variables = 1
+
+If you want complex things like '@{${"foo"}}' to be parsed: >
+
+ :let perl_extended_vars = 1
+
+The coloring strings can be changed. By default strings and qq friends will be
+highlighted like the first line. If you set the variable
+perl_string_as_statement, it will be highlighted as in the second line.
+
+ "hello world!"; qq|hello world|;
+ ^^^^^^^^^^^^^^NN^^^^^^^^^^^^^^^N (unlet perl_string_as_statement)
+ S^^^^^^^^^^^^SNNSSS^^^^^^^^^^^SN (let perl_string_as_statement)
+
+(^ = perlString, S = perlStatement, N = None at all)
+
+The syncing has 3 options. The first two switch off some triggering of
+synchronization and should only be needed in case it fails to work properly.
+If while scrolling all of a sudden the whole screen changes color completely
+then you should try and switch off one of those. Let me know if you can figure
+out the line that causes the mistake.
+
+One triggers on "^\s*sub\s*" and the other on "^[$@%]" more or less. >
+
+ :let perl_no_sync_on_sub
+ :let perl_no_sync_on_global_var
+
+Below you can set the maximum distance VIM should look for starting points for
+its attempts in syntax highlighting. >
+
+ :let perl_sync_dist = 100
+
+If you want to use folding with perl, set perl_fold: >
+
+ :let perl_fold = 1
+
+
+PHP3 and PHP4 *php.vim* *php3.vim* *php-syntax* *php3-syntax*
+
+[note: previously this was called "php3", but since it now also supports php4
+it has been renamed to "php"]
+
+There are the following options for the php syntax highlighting.
+
+If you like SQL syntax highlighting inside Strings: >
+
+ let php_sql_query = 1
+
+For highlighting the Baselib methods: >
+
+ let php_baselib = 1
+
+Enable HTML syntax highlighting inside strings: >
+
+ let php_htmlInStrings = 1
+
+Using the old colorstyle: >
+
+ let php_oldStyle = 1
+
+Enable highlighting ASP-style short tags: >
+
+ let php_asp_tags = 1
+
+Disable short tags: >
+
+ let php_noShortTags = 1
+
+For highlighting parent error ] or ): >
+
+ let php_parent_error_close = 1
+
+For skipping an php end tag, if there exists an open ( or [ without a closing
+one: >
+
+ let php_parent_error_open = 1
+
+Enable folding for classes and functions: >
+
+ let php_folding = 1
+
+Selecting syncing method: >
+
+ let php_sync_method = x
+
+x = -1 to sync by search (default),
+x > 0 to sync at least x lines backwards,
+x = 0 to sync from start.
+
+
+PPWIZARD *ppwiz.vim* *ppwiz-syntax*
+
+PPWizard is a preprocessor for HTML and OS/2 INF files
+
+This syntax file has the options:
+
+- ppwiz_highlight_defs : determines highlighting mode for PPWizard's
+ definitions. Possible values are
+
+ ppwiz_highlight_defs = 1 : PPWizard #define statements retain the
+ colors of their contents (e. g. PPWizard macros and variables)
+
+ ppwiz_highlight_defs = 2 : preprocessor #define and #evaluate
+ statements are shown in a single color with the exception of line
+ continuation symbols
+
+ The default setting for ppwiz_highlight_defs is 1.
+
+- ppwiz_with_html : If the value is 1 (the default), highlight literal
+ HTML code; if 0, treat HTML code like ordinary text.
+
+
+PHTML *phtml.vim* *phtml-syntax*
+
+There are two options for the phtml syntax highlighting.
+
+If you like SQL syntax highlighting inside Strings, use this: >
+
+ :let phtml_sql_query = 1
+
+For syncing, minlines defaults to 100. If you prefer another value, you can
+set "phtml_minlines" to the value you desire. Example: >
+
+ :let phtml_minlines = 200
+
+
+POSTSCRIPT *postscr.vim* *postscr-syntax*
+
+There are several options when it comes to highlighting PostScript.
+
+First which version of the PostScript language to highlight. There are
+currently three defined language versions, or levels. Level 1 is the original
+and base version, and includes all extensions prior to the release of level 2.
+Level 2 is the most common version around, and includes its own set of
+extensions prior to the release of level 3. Level 3 is currently the highest
+level supported. You select which level of the PostScript language you want
+highlighted by defining the postscr_level variable as follows: >
+
+ :let postscr_level=2
+
+If this variable is not defined it defaults to 2 (level 2) since this is
+the most prevalent version currently.
+
+Note, not all PS interpreters will support all language features for a
+particular language level. In particular the %!PS-Adobe-3.0 at the start of
+PS files does NOT mean the PostScript present is level 3 PostScript!
+
+If you are working with Display PostScript, you can include highlighting of
+Display PS language features by defining the postscr_display variable as
+follows: >
+
+ :let postscr_display=1
+
+If you are working with Ghostscript, you can include highlighting of
+Ghostscript specific language features by defining the variable
+postscr_ghostscript as follows: >
+
+ :let postscr_ghostscript=1
+
+PostScript is a large language, with many predefined elements. While it
+useful to have all these elements highlighted, on slower machines this can
+cause Vim to slow down. In an attempt to be machine friendly font names and
+character encodings are not highlighted by default. Unless you are working
+explicitly with either of these this should be ok. If you want them to be
+highlighted you should set one or both of the following variables: >
+
+ :let postscr_fonts=1
+ :let postscr_encodings=1
+
+There is a stylistic option to the highlighting of and, or, and not. In
+PostScript the function of these operators depends on the types of their
+operands - if the operands are booleans then they are the logical operators,
+if they are integers then they are binary operators. As binary and logical
+operators can be highlighted differently they have to be highlighted one way
+or the other. By default they are treated as logical operators. They can be
+highlighted as binary operators by defining the variable
+postscr_andornot_binary as follows: >
+
+ :let postscr_andornot_binary=1
+<
+
+ *ptcap.vim*
+PRINTCAP + TERMCAP *ptcap-syntax* *termcap-syntax* *printcap-syntax*
+
+This syntax file applies to the printcap and termcap databases.
+
+In order for Vim to recognize printcap/termcap files that do not match
+the patterns *printcap*, or *termcap*, you must put additional patterns
+appropriate to your system in your |myfiletypefile| file. For these
+patterns, you must set the variable "b:ptcap_type" to either "print" or
+"term", and then the 'filetype' option to ptcap.
+
+For example, to make Vim identify all files in /etc/termcaps/ as termcap
+files, add the following: >
+
+ :au BufNewFile,BufRead /etc/termcaps/* let b:ptcap_type = "term" |
+ \ set filetype=ptcap
+
+If you notice highlighting errors while scrolling backwards, which
+are fixed when redrawing with CTRL-L, try setting the "ptcap_minlines"
+internal variable to a larger number: >
+
+ :let ptcap_minlines = 50
+
+(The default is 20 lines.)
+
+
+PROGRESS *progress.vim* *progress-syntax*
+
+Files matching "*.w" could be Progress or cweb. If the automatic detection
+doesn't work for you, or you don't edit cweb at all, use this in your
+startup vimrc: >
+ :let filetype_w = "progress"
+The same happens for "*.i", which could be assembly, and "*.p", which could be
+Pascal. Use this if you don't use assembly and Pascal: >
+ :let filetype_i = "progress"
+ :let filetype_p = "progress"
+
+
+PYTHON *python.vim* *python-syntax*
+
+There are four options to control Python syntax highlighting.
+
+For highlighted numbers: >
+ :let python_highlight_numbers = 1
+
+For highlighted builtin functions: >
+ :let python_highlight_builtins = 1
+
+For highlighted standard exceptions: >
+ :let python_highlight_exceptions = 1
+
+For highlighted trailing whitespace and mix of spaces and tabs:
+ :let python_highlight_space_errors = 1
+
+If you want all possible Python highlighting (the same as setting the
+preceding three options): >
+ :let python_highlight_all = 1
+
+
+QUAKE *quake.vim* *quake-syntax*
+
+The Quake syntax definition should work for most any FPS (First Person
+Shooter) based on one of the Quake engines. However, the command names vary
+a bit between the three games (Quake, Quake 2, and Quake 3 Arena) so the
+syntax definition checks for the existence of three global variables to allow
+users to specify what commands are legal in their files. The three variables
+can be set for the following effects:
+
+set to highlight commands only available in Quake: >
+ :let quake_is_quake1 = 1
+
+set to highlight commands only available in Quake 2: >
+ :let quake_is_quake2 = 1
+
+set to highlight commands only available in Quake 3 Arena: >
+ :let quake_is_quake3 = 1
+
+Any combination of these three variables is legal, but might highlight more
+commands than are actually available to you by the game.
+
+
+READLINE *readline.vim* *readline-syntax*
+
+The readline library is primarily used by the BASH shell, which adds quite a
+few commands and options to the ones already available. To highlight these
+items as well you can add the following to your |vimrc| or just type it in the
+command line before loading a file with the readline syntax: >
+ let readline_has_bash = 1
+
+This will add highlighting for the commands that BASH (version 2.05a and
+later, and part earlier) adds.
+
+
+REXX *rexx.vim* *rexx-syntax*
+
+If you notice highlighting errors while scrolling backwards, which are fixed
+when redrawing with CTRL-L, try setting the "rexx_minlines" internal variable
+to a larger number: >
+ :let rexx_minlines = 50
+This will make the syntax synchronization start 50 lines before the first
+displayed line. The default value is 10. The disadvantage of using a larger
+number is that redrawing can become slow.
+
+
+RUBY *ruby.vim* *ruby-syntax*
+
+There are a few options to the Ruby syntax highlighting.
+
+By default, the "end" keyword is colorized according to the opening statement
+of the block it closes. While useful, this feature can be expensive: if you
+experience slow redrawing (or you are on a terminal with poor color support)
+you may want to turn it off by defining the "ruby_no_expensive" variable: >
+ :let ruby_no_expensive = 1
+In this case the same color will be used for all control keywords.
+
+If you do want this feature enabled, but notice highlighting errors while
+scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
+the "ruby_minlines" variable to a value larger than 50: >
+ :let ruby_minlines = 100
+Ideally, this value should be a number of lines large enough to embrace your
+largest class or module.
+
+Finally, if you do not like to see too many color items around, you can define
+"ruby_no_identifiers": >
+ :let ruby_no_identifiers = 1
+This will prevent highlighting of special identifiers like "ConstantName",
+"$global_var", "@instance_var", "| iterator |", and ":symbol".
+
+
+SDL *sdl.vim* *sdl-syntax*
+
+The SDL highlighting probably misses a few keywords, but SDL has so many
+of them it's almost impossibly to cope.
+
+The new standard, SDL-2000, specifies that all identifiers are
+case-sensitive (which was not so before), and that all keywords can be
+used either completely lowercase or completely uppercase. To have the
+highlighting reflect this, you can set the following variable: >
+ :let sdl_2000=1
+
+This also sets many new keywords. If you want to disable the old
+keywords, which is probably a good idea, use: >
+ :let SDL_no_96=1
+
+
+The indentation is probably also incomplete, but right now I am very
+satisfied with it for my own projects.
+
+
+SED *sed.vim* *sed-syntax*
+
+To make tabs stand out from regular blanks (accomplished by using Todo
+highlighting on the tabs), define "highlight_sedtabs" by putting >
+
+ :let highlight_sedtabs = 1
+
+in the vimrc file. (This special highlighting only applies for tabs
+inside search patterns, replacement texts, addresses or text included
+by an Append/Change/Insert command.) If you enable this option, it is
+also a good idea to set the tab width to one character; by doing that,
+you can easily count the number of tabs in a string.
+
+Bugs:
+
+ The transform command (y) is treated exactly like the substitute
+ command. This means that, as far as this syntax file is concerned,
+ transform accepts the same flags as substitute, which is wrong.
+ (Transform accepts no flags.) I tolerate this bug because the
+ involved commands need very complex treatment (95 patterns, one for
+ each plausible pattern delimiter).
+
+
+SGML *sgml.vim* *sgml-syntax*
+
+The coloring scheme for tags in the SGML file works as follows.
+
+The <> of opening tags are colored differently than the </> of a closing tag.
+This is on purpose! For opening tags the 'Function' color is used, while for
+closing tags the 'Type' color is used (See syntax.vim to check how those are
+defined for you)
+
+Known tag names are colored the same way as statements in C. Unknown tag
+names are not colored which makes it easy to spot errors.
+
+Note that the same is true for argument (or attribute) names. Known attribute
+names are colored differently than unknown ones.
+
+Some SGML tags are used to change the rendering of text. The following tags
+are recognized by the sgml.vim syntax coloring file and change the way normal
+text is shown: <varname> <emphasis> <command> <function> <literal>
+<replaceable> <ulink> and <link>.
+
+If you want to change how such text is rendered, you must redefine the
+following syntax groups:
+
+ - sgmlBold
+ - sgmlBoldItalic
+ - sgmlUnderline
+ - sgmlItalic
+ - sgmlLink for links
+
+To make this redefinition work you must redefine them all and define the
+following variable in your vimrc (this is due to the order in which the files
+are read during initialization) >
+ let sgml_my_rendering=1
+
+You can also disable this rendering by adding the following line to your
+vimrc file: >
+ let sgml_no_rendering=1
+
+(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
+
+
+SH *sh.vim* *sh-syntax*
+
+This covers the "normal" Unix (Bourne) sh, bash and the Korn shell.
+
+Vim attempts to determine which shell type is in use by specifying that
+various filenames are of specific types: >
+
+ ksh : .kshrc* *.ksh
+ bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
+<
+If none of these cases pertain, then the first line of the file is examined
+(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype,
+then that shelltype is used. However some files (ex. .profile) are known to
+be shell files but the type is not apparent. Furthermore, on many systems
+sh is symbolically linked to "bash" (linux) or "ksh" (posix).
+
+One may specify a global default by instantiating one of the following three
+variables in your <.vimrc>:
+
+ ksh: >
+ let is_kornshell = 1
+< bash: >
+ let is_bash = 1
+< sh: >
+ let is_sh = 1
+
+If, in your <.vimrc>, you set >
+ let g:sh_fold_enabled= 1
+>
+then various syntax items (HereDocuments and function bodies) become
+syntax-foldable (see |:syn-fold|).
+
+If you notice highlighting errors while scrolling backwards, which are fixed
+when redrawing with CTRL-L, try setting the "sh_minlines" internal variable
+to a larger number. Example: >
+
+ let sh_minlines = 500
+
+This will make syntax synchronization start 500 lines before the first
+displayed line. The default value is 200. The disadvantage of using a larger
+number is that redrawing can become slow.
+
+If you don't have much to synchronize on, displaying can be very slow. To
+reduce this, the "sh_maxlines" internal variable can be set. Example: >
+
+ let sh_maxlines = 100
+<
+The default is to use the twice sh_minlines. Set it to a smaller number to
+speed up displaying. The disadvantage is that highlight errors may appear.
+
+
+SPEEDUP (AspenTech plant simulator) *spup.vim* *spup-syntax*
+
+The Speedup syntax file has some options:
+
+- strict_subsections : If this variable is defined, only keywords for
+ sections and subsections will be highlighted as statements but not
+ other keywords (like WITHIN in the OPERATION section).
+
+- highlight_types : Definition of this variable causes stream types
+ like temperature or pressure to be highlighted as Type, not as a
+ plain Identifier. Included are the types that are usually found in
+ the DECLARE section; if you defined own types, you have to include
+ them in the syntax file.
+
+- oneline_comments : this value ranges from 1 to 3 and determines the
+ highlighting of # style comments.
+
+ oneline_comments = 1 : allow normal Speedup code after an even
+ number of #s.
+
+ oneline_comments = 2 : show code starting with the second # as
+ error. This is the default setting.
+
+ oneline_comments = 3 : show the whole line as error if it contains
+ more than one #.
+
+Since especially OPERATION sections tend to become very large due to
+PRESETting variables, syncing may be critical. If your computer is
+fast enough, you can increase minlines and/or maxlines near the end of
+the syntax file.
+
+
+TCSH *tcsh.vim* *tcsh-syntax*
+
+This covers the shell named "tcsh". It is a superset of csh. See |csh.vim|
+for how the filetype is detected.
+
+Tcsh does not allow \" in strings unless the "backslash_quote" shell variable
+is set. If you want VIM to assume that no backslash quote constructs exist add
+this line to your .vimrc: >
+
+ :let tcsh_backslash_quote = 0
+
+If you notice highlighting errors while scrolling backwards, which are fixed
+when redrawing with CTRL-L, try setting the "tcsh_minlines" internal variable
+to a larger number: >
+
+ :let tcsh_minlines = 100
+
+This will make the syntax synchronization start 100 lines before the first
+displayed line. The default value is 15. The disadvantage of using a larger
+number is that redrawing can become slow.
+
+
+TEX *tex.vim* *tex-syntax*
+
+Run-on Comments/Math? ~
+
+The tex highlighting supports TeX, LaTeX, and some AmsTeX. The
+highlighting supports three primary zones: normal, texZone, and texMathZone.
+Although a considerable effort has been made to have these zones terminate
+properly, zones delineated by $..$ and $$..$$ cannot be synchronized as
+there's no difference between start and end patterns. Consequently, a
+special "TeX comment" has been provided >
+ %stopzone
+which will forcibly terminate the highlighting of either a texZone or a
+texMathZone.
+
+Slow Syntax Highlighting? ~
+
+If you have a slow computer, you may wish to reduce the values for >
+ :syn sync maxlines=200
+ :syn sync minlines=50
+(especially the latter). If your computer is fast, you may wish to
+increase them. This primarily affects synchronizing (ie. just what group,
+if any, is the text at the top of the screen supposed to be in?).
+
+Excessive Error Highlighting? ~
+
+The <tex.vim> supports lexical error checking of various sorts. Thus,
+although the error checking is ofttimes very useful, it can indicate
+errors where none actually are. If this proves to be a problem for you,
+you may put in your <.vimrc> the following statement: >
+ let tex_no_error=1
+and all error checking by <tex.vim> will be suppressed.
+
+Need a new Math Group? ~
+
+If you want to include a new math group in your LaTeX, the following
+code shows you an example as to how you might do so: >
+
+ syn cluster texMathZones add=texMathZoneLOCAL
+ syn region texMathZoneLOCAL start="\\begin\s*{\s*LOCALMATH\s*}"
+ \ end="\\end\s*{\s*LOCALMATH\s*}" keepend
+ \ contains=@texMathZoneGroup
+ if !exists("tex_no_math")
+ syn sync match texSyncMathZoneLOCAL grouphere texMathZoneLOCAL
+ \ "\\begin\s*{\s*LOCALMATH\*\s*}"
+ syn sync match texSyncMathZoneLOCAL groupthere NONE
+ \ "\\end\s*{\s*LOCALMATH\*\s*}"
+ endif
+ hi link texMathZoneLOCAL texMath
+<
+You'll need to change LOCALMATH to the name of your new math group,
+and then to put it into .vim/after/syntax/tex.vim.
+
+Starting a New Style? ~
+
+One may use "\makeatletter" in *.tex files, thereby making the use of "@" in
+commands available. However, since the *.tex file doesn't have one of the
+following suffices: sty cls clo dtx ltx, the syntax highlighting will flag
+such use of @ as an error. To solve this: >
+
+ :let b:tex_stylish = 1
+ :set ft=tex
+
+Putting "let g:tex_stylish=1" into your <.vimrc> will make <syntax/tex.vim>
+always accept such use of @.
+
+
+TF *tf.vim* *tf-syntax*
+
+There is one option for the tf syntax highlighting.
+
+For syncing, minlines defaults to 100. If you prefer another value, you can
+set "tf_minlines" to the value you desire. Example: >
+
+ :let tf_minlines = your choice
+
+
+VIM *vim.vim* *vim-syntax*
+
+There is a tradeoff between more accurate syntax highlighting versus
+screen updating speed. To improve accuracy, you may wish to increase
+the g:vim_minlines variable. The g:vim_maxlines variable may be used
+to improve screen updating rates (see |:syn-sync| for more on this).
+
+ g:vim_minlines : used to set synchronization minlines
+ g:vim_maxlines : used to set synchronization maxlines
+
+The g:vimembedscript option allows for somewhat faster loading of syntax
+highlighting for vim scripts at the expense of supporting syntax highlighting
+for external scripting languages (currently perl, python, ruby, and tcl).
+
+ g:vimembedscript == 1 (default) <vim.vim> will allow highlighting
+ g:vimembedscript doesn't exist of supported embedded scripting
+ languages: perl, python, ruby and
+ tcl.
+
+ g:vimembedscript == 0 Syntax highlighting for embedded
+ scripting languages will not be
+ loaded.
+
+
+XF86CONFIG *xf86conf.vim* *xf86conf-syntax*
+
+The syntax of XF86Config file differs in XFree86 v3.x and v4.x. Both
+variants are supported. Automatic detection is used, but is far from perfect.
+You may need to specify the version manually. Set the variable
+xf86conf_xfree86_version to 3 or 4 according to your XFree86 version in
+your .vimrc. Example: >
+ :let xf86conf_xfree86_version=3
+When using a mix of versions, set the b:xf86conf_xfree86_version variable.
+
+Note that spaces and underscores in option names are not supported. Use
+"SyncOnGreen" instead of "__s yn con gr_e_e_n" if you want the option name
+highlighted.
+
+
+XML *xml.vim* *xml-syntax*
+
+Xml namespaces are highlighted by default. This can be inhibited by
+setting a global variable: >
+
+ :let g:xml_namespace_transparent=1
+<
+ *xml-folding*
+The xml syntax file provides syntax |folding| (see |:syn-fold|) between
+start and end tags. This can be turned on by >
+
+ :let g:xml_syntax_folding = 1
+ :set foldmethod=syntax
+
+Note: syntax folding might slow down syntax highlighting significantly,
+especially for large files.
+
+
+X Pixmaps (XPM) *xpm.vim* *xpm-syntax*
+
+xpm.vim creates its syntax items dynamically based upon the contents of the
+XPM file. Thus if you make changes e.g. in the color specification strings,
+you have to source it again e.g. with ":set syn=xpm".
+
+To copy a pixel with one of the colors, yank a "pixel" with "yl" and insert it
+somewhere else with "P".
+
+Do you want to draw with the mouse? Try the following: >
+ :function! GetPixel()
+ : let c = getline(line("."))[col(".") - 1]
+ : echo c
+ : exe "noremap <LeftMouse> <LeftMouse>r".c
+ : exe "noremap <LeftDrag> <LeftMouse>r".c
+ :endfunction
+ :noremap <RightMouse> <LeftMouse>:call GetPixel()<CR>
+ :set guicursor=n:hor20 " to see the color beneath the cursor
+This turns the right button into a pipette and the left button into a pen.
+It will work with XPM files that have one character per pixel only and you
+must not click outside of the pixel strings, but feel free to improve it.
+
+It will look much better with a font in a quadratic cell size, e.g. for X: >
+ :set guifont=-*-clean-medium-r-*-*-8-*-*-*-*-80-*
+
+==============================================================================
+5. Defining a syntax *:syn-define* *E410*
+
+Vim understands three types of syntax items:
+
+1. Keyword.
+ It can only contain keyword characters, according to the 'iskeyword'
+ option. It cannot contain other syntax items. It will only match with a
+ complete word (there are no keyword characters before or after the match).
+ The keyword "if" would match in "if(a=b)", but not in "ifdef x", because
+ "(" is not a keyword character and "d" is.
+
+2. Match.
+ This is a match with a single regexp pattern.
+
+3. Region.
+ This starts at a match of the "start" regexp pattern and ends with a match
+ with the "end" regexp pattern. Any other text can appear in between. A
+ "skip" regexp pattern can be used to avoid matching the "end" pattern.
+
+Several syntax ITEMs can be put into one syntax GROUP. For a syntax group
+you can give highlighting attributes. For example, you could have an item
+to define a "/* .. */" comment and another one that defines a "// .." comment,
+and put them both in the "Comment" group. You can then specify that a
+"Comment" will be in bold font and have a blue color. You are free to make
+one highlight group for one syntax item, or put all items into one group.
+This depends on how you want to specify your highlighting attributes. Putting
+each item in its own group results in having to specify the highlighting
+for a lot of groups.
+
+Note that a syntax group and a highlight group are similar. For a highlight
+group you will have given highlight attributes. These attributes will be used
+for the syntax group with the same name.
+
+In case more than one item matches at the same position, the one that was
+defined LAST wins. Thus you can override previously defined syntax items by
+using an item that matches the same text. But a keyword always goes before a
+match or region. And a keyword with matching case always goes before a
+keyword with ignoring case.
+
+
+PRIORITY *:syn-priority*
+
+When several syntax items may match, these rules are used:
+
+1. When multiple Match or Region items start in the same position, the item
+ defined last has priority.
+2. A Keyword has priority over Match and Region items.
+3. An item that starts in an earlier position has priority over items that
+ start in later positions.
+
+
+DEFINING CASE *:syn-case* *E390*
+
+:sy[ntax] case [match|ignore]
+ This defines if the following ":syntax" commands will work with
+ matching case, when using "match", or with ignoring case, when using
+ "ignore". Note that any items before this are not affected, and all
+ items until the next ":syntax case" command are affected.
+
+
+DEFINING KEYWORDS *:syn-keyword*
+
+:sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}]
+
+ This defines a number of keywords.
+
+ {group-name} Is a syntax group name such as "Comment".
+ [{options}] See |:syn-arguments| below.
+ {keyword} .. Is a list of keywords which are part of this group.
+
+ Example: >
+ :syntax keyword Type int long char
+<
+ The {options} can be given anywhere in the line. They will apply to
+ all keywords given, also for options that come after a keyword.
+ These examples do exactly the same: >
+ :syntax keyword Type contained int long char
+ :syntax keyword Type int long contained char
+ :syntax keyword Type int long char contained
+<
+ When you have a keyword with an optional tail, like Ex commands in
+ Vim, you can put the optional characters inside [], to define all the
+ variations at once: >
+ :syntax keyword vimCommand ab[breviate] n[ext]
+<
+ Don't forget that a keyword can only be recognized if all the
+ characters are included in the 'iskeyword' option. If one character
+ isn't, the keyword will never be recognized.
+ Multi-byte characters can also be used. These do not have to be in
+ 'iskeyword'.
+
+ A keyword always has higher priority than a match or region, the
+ keyword is used if more than one item matches. Keywords do not nest
+ and a keyword can't contain anything else.
+
+ Note that when you have a keyword that is the same as an option (even
+ one that isn't allowed here), you can not use it. Use a match
+ instead.
+
+ The maximum length of a keyword is 80 characters.
+
+ The same keyword can be defined multiple times, when its containment
+ differs. For example, you can define the keyword once not contained
+ and use one highlight group, and once contained, and use a different
+ highlight group. Example: >
+ :syn keyword vimCommand tag
+ :syn keyword vimSetting contained tag
+< When finding "tag" outside of any syntax item, the "vimCommand"
+ highlight group is used. When finding "tag" in a syntax item that
+ contains "vimSetting", the "vimSetting" group is used.
+
+
+DEFINING MATCHES *:syn-match*
+
+:sy[ntax] match {group-name} [{options}] [excludenl] {pattern} [{options}]
+
+ This defines one match.
+
+ {group-name} A syntax group name such as "Comment".
+ [{options}] See |:syn-arguments| below.
+ [excludenl] Don't make a pattern with the end-of-line "$"
+ extend a containing match or region. Must be
+ given before the pattern. |:syn-excludenl|
+ {pattern} The search pattern that defines the match.
+ See |:syn-pattern| below.
+ Note that the pattern may match more than one
+ line, which makes the match depend on where
+ Vim starts searching for the pattern. You
+ need to make sure syncing takes care of this.
+
+ Example (match a character constant): >
+ :syntax match Character /'.'/hs=s+1,he=e-1
+<
+
+DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end*
+ *E398* *E399*
+:sy[ntax] region {group-name} [{options}]
+ [matchgroup={group-name}]
+ [keepend]
+ [extend]
+ [excludenl]
+ start={start_pattern} ..
+ [skip={skip_pattern}]
+ end={end_pattern} ..
+ [{options}]
+
+ This defines one region. It may span several lines.
+
+ {group-name} A syntax group name such as "Comment".
+ [{options}] See |:syn-arguments| below.
+ [matchgroup={group-name}] The syntax group to use for the following
+ start or end pattern matches only. Not used
+ for the text in between the matched start and
+ end patterns. Use NONE to reset to not using
+ a different group for the start or end match.
+ See |:syn-matchgroup|.
+ keepend Don't allow contained matches to go past a
+ match with the end pattern. See
+ |:syn-keepend|.
+ extend Override a "keepend" for an item this region
+ is contained in. See |:syn-extend|.
+ excludenl Don't make a pattern with the end-of-line "$"
+ extend a containing match or item. Only
+ useful for end patterns. Must be given before
+ the patterns it applies to. |:syn-excludenl|
+ start={start_pattern} The search pattern that defines the start of
+ the region. See |:syn-pattern| below.
+ skip={skip_pattern} The search pattern that defines text inside
+ the region where not to look for the end
+ pattern. See |:syn-pattern| below.
+ end={end_pattern} The search pattern that defines the end of
+ the region. See |:syn-pattern| below.
+
+ Example: >
+ :syntax region String start=+"+ skip=+\\"+ end=+"+
+<
+ The start/skip/end patterns and the options can be given in any order.
+ There can be zero or one skip pattern. There must be one or more
+ start and end patterns. This means that you can omit the skip
+ pattern, but you must give at least one start and one end pattern. It
+ is allowed to have white space before and after the equal sign
+ (although it mostly looks better without white space).
+
+ When more than one start pattern is given, a match with one of these
+ is sufficient. This means there is an OR relation between the start
+ patterns. The last one that matches is used. The same is true for
+ the end patterns.
+
+ The search for the end pattern starts right after the start pattern.
+ Offsets are not used for this. This implies that the match for the
+ end pattern will never overlap with the start pattern.
+
+ The skip and end pattern can match across line breaks, but since the
+ search for the pattern can start in any line it often does not do what
+ you want. The skip pattern doesn't avoid a match of an end pattern in
+ the next line. Use single-line patterns to avoid trouble.
+
+ Note: The decision to start a region is only based on a matching start
+ pattern. There is no check for a matching end pattern. This does NOT
+ work: >
+ :syn region First start="(" end=":"
+ :syn region Second start="(" end=";"
+< The Second always matches before the First (last defined pattern has
+ higher priority). The Second region then continues until the next
+ ';', no matter if there is a ':' before it. Using a match does work: >
+ :syn match First "(\_.\{-}:"
+ :syn match Second "(\_.\{-};"
+< This pattern matches any character or line break with "\_." and
+ repeats that with "\{-}" (repeat as few as possible).
+
+ *:syn-keepend*
+ By default, a contained match can obscure a match for the end pattern.
+ This is useful for nesting. For example, a region that starts with
+ "{" and ends with "}", can contain another region. An encountered "}"
+ will then end the contained region, but not the outer region:
+ { starts outer "{}" region
+ { starts contained "{}" region
+ } ends contained "{}" region
+ } ends outer "{} region
+ If you don't want this, the "keepend" argument will make the matching
+ of an end pattern of the outer region also end any contained item.
+ This makes it impossible to nest the same region, but allows for
+ contained items to highlight parts of the end pattern, without causing
+ that to skip the match with the end pattern. Example: >
+ :syn match vimComment +"[^"]\+$+
+ :syn region vimCommand start="set" end="$" contains=vimComment keepend
+< The "keepend" makes the vimCommand always end at the end of the line,
+ even though the contained vimComment includes a match with the <EOL>.
+
+ When "keepend" is not used, a match with an end pattern is retried
+ after each contained match. When "keepend" is included, the first
+ encountered match with an end pattern is used, truncating any
+ contained matches.
+ *:syn-extend*
+ The "keepend" behavior can be changed by using the "extend" argument.
+ When an item with "extend" is contained in an item that uses
+ "keepend", the "keepend" is ignored and the containing region will be
+ extended.
+ This can be used to have some contained items extend a region while
+ others don't. Example: >
+
+ :syn region htmlRef start=+<a>+ end=+</a>+ keepend contains=htmlItem,htmlScript
+ :syn match htmlItem +<[^>]*>+ contained
+ :syn region htmlScript start=+<script+ end=+</script[^>]*>+ contained extend
+
+< Here the htmlItem item does not make the htmlRef item continue
+ further, it is only used to highlight the <> items. The htmlScript
+ item does extend the htmlRef item.
+
+ Another example: >
+ :syn region xmlFold start="<a>" end="</a>" fold transparent keepend extend
+< This defines a region with "keepend", so that its end cannot be
+ changed by contained items, like when the "</a>" is matched to
+ highlight it differently. But when the xmlFold region is nested (it
+ includes itself), the "extend" applies, so that the "</a>" of a nested
+ region only ends that region, and not the one it is contained in.
+
+ *:syn-excludenl*
+ When a pattern for a match or end pattern of a region includes a '$'
+ to match the end-of-line, it will make a region item that it is
+ contained in continue on the next line. For example, a match with
+ "\\$" (backslash at the end of the line) can make a region continue
+ that would normally stop at the end of the line. This is the default
+ behavior. If this is not wanted, there are two ways to avoid it:
+ 1. Use "keepend" for the containing item. This will keep all
+ contained matches from extending the match or region. It can be
+ used when all contained items must not extend the containing item.
+ 2. Use "excludenl" in the contained item. This will keep that match
+ from extending the containing match or region. It can be used if
+ only some contained items must not extend the containing item.
+ "excludenl" must be given before the pattern it applies to.
+
+ *:syn-matchgroup*
+ "matchgroup" can be used to highlight the start and/or end pattern
+ differently than the body of the region. Example: >
+ :syntax region String matchgroup=Quote start=+"+ skip=+\\"+ end=+"+
+< This will highlight the quotes with the "Quote" group, and the text in
+ between with the "String" group.
+ The "matchgroup" is used for all start and end patterns that follow,
+ until the next "matchgroup". Use "matchgroup=NONE" to go back to not
+ using a matchgroup.
+
+ In a start or end pattern that is highlighted with "matchgroup" the
+ contained items of the region are not used. This can be used to avoid
+ that a contained item matches in the start or end pattern match. When
+ using "transparent", this does not apply to a start or end pattern
+ match that is highlighted with "matchgroup".
+
+ Here is an example, which highlights three levels of parentheses in
+ different colors: >
+ :sy region par1 matchgroup=par1 start=/(/ end=/)/ contains=par2
+ :sy region par2 matchgroup=par2 start=/(/ end=/)/ contains=par3 contained
+ :sy region par3 matchgroup=par3 start=/(/ end=/)/ contains=par1 contained
+ :hi par1 ctermfg=red guifg=red
+ :hi par2 ctermfg=blue guifg=blue
+ :hi par3 ctermfg=darkgreen guifg=darkgreen
+
+==============================================================================
+6. :syntax arguments *:syn-arguments*
+
+The :syntax commands that define syntax items take a number of arguments.
+The common ones are explained here. The arguments may be given in any order
+and may be mixed with patterns.
+
+Not all commands accept all arguments. This table shows which arguments
+can not be used for all commands:
+ *E395* *E396*
+ contains oneline fold display extend ~
+:syntax keyword - - - - -
+:syntax match yes - yes yes yes
+:syntax region yes yes yes yes yes
+
+These arguments can be used for all three commands:
+ contained
+ containedin
+ nextgroup
+ transparent
+ skipwhite
+ skipnl
+ skipempty
+
+
+contained *:syn-contained*
+
+When the "contained" argument is given, this item will not be recognized at
+the top level, but only when it is mentioned in the "contains" field of
+another match. Example: >
+ :syntax keyword Todo TODO contained
+ :syntax match Comment "//.*" contains=Todo
+
+
+display *:syn-display*
+
+If the "display" argument is given, this item will be skipped when the
+detected highlighting will not be displayed. This will speed up highlighting,
+by skipping this item when only finding the syntax state for the text that is
+to be displayed.
+
+Generally, you can use "display" for match and region items that meet these
+conditions:
+- The item does not continue past the end of a line. Example for C: A region
+ for a "/*" comment can't contain "display", because it continues on the next
+ line.
+- The item does not contain items that continue past the end of the line or
+ make it continue on the next line.
+- The item does not change the size of any item it is contained in. Example
+ for C: A match with "\\$" in a preprocessor match can't have "display",
+ because it may make that preprocessor match shorter.
+- The item does not allow other items to match that didn't match otherwise,
+ and that item may extend the match too far. Example for C: A match for a
+ "//" comment can't use "display", because a "/*" inside that comment would
+ match then and start a comment which extends past the end of the line.
+
+Examples, for the C language, where "display" can be used:
+- match with a number
+- match with a label
+
+
+transparent *:syn-transparent*
+
+If the "transparent" argument is given, this item will not be highlighted
+itself, but will take the highlighting of the item it is contained in. This
+is useful for syntax items that don't need any highlighting but are used
+only to skip over a part of the text.
+
+The "contains=" argument is also inherited from the item it is contained in,
+unless a "contains" argument is given for the transparent item itself. To
+avoid that unwanted items are contained, use "contains=NONE". Example, which
+highlights words in strings, but makes an exception for "vim": >
+ :syn match myString /'[^']*'/ contains=myWord,myVim
+ :syn match myWord /\<[a-z]*\>/ contained
+ :syn match myVim /\<vim\>/ transparent contained contains=NONE
+ :hi link myString String
+ :hi link myWord Comment
+Since the "myVim" match comes after "myWord" it is the preferred match (last
+match in the same position overrules an earlier one). The "transparent"
+argument makes the "myVim" match use the same highlighting as "myString". But
+it does not contain anything. If the "contains=NONE" argument would be left
+out, then "myVim" would use the contains argument from myString and allow
+"myWord" to be contained, which will be highlighted as a Constant. This
+happens because a contained match doesn't match inside itself in the same
+position, thus the "myVim" match doesn't overrule the "myWord" match here.
+
+When you look at the colored text, it is like looking at layers of contained
+items. The contained item is on top of the item it is contained in, thus you
+see the contained item. When a contained item is transparent, you can look
+through, thus you see the item it is contained in. In a picture:
+
+ look from here
+
+ | | | | | |
+ V V V V V V
+
+ xxxx yyy more contained items
+ .................... contained item (transparent)
+ ============================= first item
+
+The 'x', 'y' and '=' represent a highlighted syntax item. The '.' represent a
+transparent group.
+
+What you see is:
+
+ =======xxxx=======yyy========
+
+Thus you look through the transparent "....".
+
+
+oneline *:syn-oneline*
+
+The "oneline" argument indicates that the region does not cross a line
+boundary. It must match completely in the current line. However, when the
+region has a contained item that does cross a line boundary, it continues on
+the next line anyway. A contained item can be used to recognize a line
+continuation pattern. But the "end" pattern must still match in the first
+line, otherwise the region doesn't even start.
+
+When the start pattern includes a "\n" to match an end-of-line, the end
+pattern must be found in the same line as where the start pattern ends. The
+end pattern may also include an end-of-line. Thus the "oneline" argument
+means that the end of the start pattern and the start of the end pattern must
+be within one line. This can't be changed by a skip pattern that matches a
+line break.
+
+
+fold *:syn-fold*
+
+The "fold" argument makes the fold level increased by one for this item.
+Example: >
+ :syn region myFold start="{" end="}" transparent fold
+ :syn sync fromstart
+ :set foldmethod=syntax
+This will make each {} block form one fold.
+
+The fold will start on the line where the item starts, and end where the item
+ends. If the start and end are within the same line, there is no fold.
+The 'foldnestmax' option limits the nesting of syntax folds.
+{not available when Vim was compiled without |+folding| feature}
+
+
+ *:syn-contains* *E405* *E406* *E407* *E408* *E409*
+contains={groupname},..
+
+The "contains" argument is followed by a list of syntax group names. These
+groups will be allowed to begin inside the item (they may extend past the
+containing group's end). This allows for recursive nesting of matches and
+regions. If there is no "contains" argument, no groups will be contained in
+this item. The group names do not need to be defined before they can be used
+here.
+
+contains=ALL
+ If the only item in the contains list is "ALL", then all
+ groups will be accepted inside the item.
+
+contains=ALLBUT,{group-name},..
+ If the first item in the contains list is "ALLBUT", then all
+ groups will be accepted inside the item, except the ones that
+ are listed. Example: >
+ :syntax region Block start="{" end="}" ... contains=ALLBUT,Function
+
+contains=TOP
+ If the first item in the contains list is "TOP", then all
+ groups will be accepted that don't have the "contained"
+ argument.
+contains=TOP,{group-name},..
+ Like "TOP", but excluding the groups that are listed.
+
+contains=CONTAINED
+ If the first item in the contains list is "CONTAINED", then
+ all groups will be accepted that have the "contained"
+ argument.
+contains=CONTAINED,{group-name},..
+ Like "CONTAINED", but excluding the groups that are
+ listed.
+
+
+The {group-name} in the "contains" list can be a pattern. All group names
+that match the pattern will be included (or excluded, if "ALLBUT" is used).
+The pattern cannot contain white space or a ','. Example: >
+ ... contains=Comment.*,Keyw[0-3]
+The matching will be done at moment the syntax command is executed. Groups
+that are defined later will not be matched. Also, if the current syntax
+command defines a new group, it is not matched. Be careful: When putting
+syntax commands in a file you can't rely on groups NOT being defined, because
+the file may have been sourced before, and ":syn clear" doesn't remove the
+group names.
+
+The contained groups will also match in the start and end patterns of a
+region. If this is not wanted, the "matchgroup" argument can be used
+|:syn-matchgroup|. The "ms=" and "me=" offsets can be used to change the
+region where contained items do match. Note that this may also limit the
+area that is highlighted
+
+
+containedin={groupname}... *:syn-containedin*
+
+The "containedin" argument is followed by a list of syntax group names. The
+item will be allowed to begin inside these groups. This works as if the
+containing item has a "contains=" argument that includes this item.
+
+The {groupname}... can be used just like for "contains", as explained above.
+
+This is useful when adding a syntax item afterwards. An item can be told to
+be included inside an already existing item, without changing the definition
+of that item. For example, to highlight a word in a C comment after loading
+the C syntax: >
+ :syn keyword myword HELP containedin=cComment contained
+Note that "contained" is also used, to avoid that the item matches at the top
+level.
+
+Matches for "containedin" are added to the other places where the item can
+appear. A "contains" argument may also be added as usual. Don't forget that
+keywords never contain another item, thus adding them to "containedin" won't
+work.
+
+
+nextgroup={groupname},.. *:syn-nextgroup*
+
+The "nextgroup" argument is followed by a list of syntax group names,
+separated by commas (just like with "contains", so you can also use patterns).
+
+If the "nextgroup" argument is given, the mentioned syntax groups will be
+tried for a match, after the match or region ends. If none of the groups have
+a match, highlighting continues normally. If there is a match, this group
+will be used, even when it is not mentioned in the "contains" field of the
+current group. This is like giving the mentioned group priority over all
+other groups. Example: >
+ :syntax match ccFoobar "Foo.\{-}Bar" contains=ccFoo
+ :syntax match ccFoo "Foo" contained nextgroup=ccFiller
+ :syntax region ccFiller start="." matchgroup=ccBar end="Bar" contained
+
+This will highlight "Foo" and "Bar" differently, and only when there is a
+"Bar" after "Foo". In the text line below, "f" shows where ccFoo is used for
+highlighting, and "bbb" where ccBar is used. >
+
+ Foo asdfasd Bar asdf Foo asdf Bar asdf
+ fff bbb fff bbb
+
+Note the use of ".\{-}" to skip as little as possible until the next Bar.
+when ".*" would be used, the "asdf" in between "Bar" and "Foo" would be
+highlighted according to the "ccFoobar" group, because the ccFooBar match
+would include the first "Foo" and the last "Bar" in the line (see |pattern|).
+
+
+skipwhite *:syn-skipwhite*
+skipnl *:syn-skipnl*
+skipempty *:syn-skipempty*
+
+These arguments are only used in combination with "nextgroup". They can be
+used to allow the next group to match after skipping some text:
+ skipwhite skip over space and Tab characters
+ skipnl skip over the end of a line
+ skipempty skip over empty lines (implies a "skipnl")
+
+When "skipwhite" is present, the white space is only skipped if there is no
+next group that matches the white space.
+
+When "skipnl" is present, the match with nextgroup may be found in the next
+line. This only happens when the current item ends at the end of the current
+line! When "skipnl" is not present, the nextgroup will only be found after
+the current item in the same line.
+
+When skipping text while looking for a next group, the matches for other
+groups are ignored. Only when no next group matches, other items are tried
+for a match again. This means that matching a next group and skipping white
+space and <EOL>s has a higher priority than other items.
+
+Example: >
+ :syn match ifstart "\<if.*" nextgroup=ifline skipwhite skipempty
+ :syn match ifline "[^ \t].*" nextgroup=ifline skipwhite skipempty contained
+ :syn match ifline "endif" contained
+Note that the "[^ \t].*" match matches all non-white text. Thus it would also
+match "endif". Therefore the "endif" match is put last, so that it takes
+precedence.
+Note that this example doesn't work for nested "if"s. You need to add
+"contains" arguments to make that work (omitted for simplicity of the
+example).
+
+==============================================================================
+7. Syntax patterns *:syn-pattern* *E401* *E402*
+
+In the syntax commands, a pattern must be surrounded by two identical
+characters. This is like it works for the ":s" command. The most common to
+use is the double quote. But if the pattern contains a double quote, you can
+use another character that is not used in the pattern. Examples: >
+ :syntax region Comment start="/\*" end="\*/"
+ :syntax region String start=+"+ end=+"+ skip=+\\"+
+
+See |pattern| for the explanation of what a pattern is. Syntax patterns are
+always interpreted like the 'magic' options is set, no matter what the actual
+value of 'magic' is. And the patterns are interpreted like the 'l' flag is
+not included in 'cpoptions'. This was done to make syntax files portable and
+independent of 'compatible' and 'magic' settings.
+
+Try to avoid patterns that can match an empty string, such as "[a-z]*".
+This slows down the highlighting a lot, because it matches everywhere.
+
+ *:syn-pattern-offset*
+The pattern can be followed by a character offset. This can be used to
+change the highlighted part, and to change the text area included in the
+match or region (which only matters when trying to match other items). Both
+are relative to the matched pattern. The character offset for a skip
+pattern can be used to tell where to continue looking for an end pattern.
+
+The offset takes the form of "{what}={offset}"
+The {what} can be one of seven strings:
+
+ms Match Start offset for the start of the matched text
+me Match End offset for the end of the matched text
+hs Highlight Start offset for where the highlighting starts
+he Highlight End offset for where the highlighting ends
+rs Region Start offset for where the body of a region starts
+re Region End offset for where the body of a region ends
+lc Leading Context offset past "leading context" of pattern
+
+The {offset} can be:
+
+s start of the matched pattern
+s+{nr} start of the matched pattern plus {nr} chars to the right
+s-{nr} start of the matched pattern plus {nr} chars to the left
+e end of the matched pattern
+e+{nr} end of the matched pattern plus {nr} chars to the right
+e-{nr} end of the matched pattern plus {nr} chars to the left
+{nr} (for "lc" only): start matching {nr} chars to the left
+
+Examples: "ms=s+1", "hs=e-2", "lc=3".
+
+Although all offsets are accepted after any pattern, they are not always
+meaningful. This table shows which offsets are actually used:
+
+ ms me hs he rs re lc ~
+match item yes yes yes yes - - yes
+region item start yes - yes - yes - yes
+region item skip - yes - - - - yes
+region item end - yes - yes - yes yes
+
+Offsets can be concatenated, with a ',' in between. Example: >
+ :syn match String /"[^"]*"/hs=s+1,he=e-1
+<
+ some "string" text
+ ^^^^^^ highlighted
+
+Notes:
+- There must be no white space between the pattern and the character
+ offset(s).
+- The highlighted area will never be outside of the matched text.
+- A negative offset for an end pattern may not always work, because the end
+ pattern may be detected when the highlighting should already have stopped.
+- The start of a match cannot be in a line other than where the pattern
+ matched. This doesn't work: "a\nb"ms=e. You can make the highlighting
+ start in another line, this does work: "a\nb"hs=e.
+
+Example (match a comment but don't highlight the /* and */): >
+ :syntax region Comment start="/\*"hs=e+1 end="\*/"he=s-1
+<
+ /* this is a comment */
+ ^^^^^^^^^^^^^^^^^^^ highlighted
+
+A more complicated Example: >
+ :syn region Exa matchgroup=Foo start="foo"hs=s+2,rs=e+2 matchgroup=Bar end="bar"me=e-1,he=e-1,re=s-1
+<
+ abcfoostringbarabc
+ mmmmmmmmmmm match
+ ssrrrreee highlight start/region/end ("Foo", "Exa" and "Bar")
+
+Leading context *:syn-lc* *:syn-leading* *:syn-context*
+
+Note: This is an obsolete feature, only included for backwards compatibility
+with previous Vim versions. It's now recommended to use the |/\@<=| construct
+in the pattern.
+
+The "lc" offset specifies leading context -- a part of the pattern that must
+be present, but is not considered part of the match. An offset of "lc=n" will
+cause Vim to step back n columns before attempting the pattern match, allowing
+characters which have already been matched in previous patterns to also be
+used as leading context for this match. This can be used, for instance, to
+specify that an "escaping" character must not precede the match: >
+
+ :syn match ZNoBackslash "[^\\]z"ms=s+1
+ :syn match WNoBackslash "[^\\]w"lc=1
+ :syn match Underline "_\+"
+<
+ ___zzzz ___wwww
+ ^^^ ^^^ matches Underline
+ ^ ^ matches ZNoBackslash
+ ^^^^ matches WNoBackslash
+
+The "ms" offset is automatically set to the same value as the "lc" offset,
+unless you set "ms" explicitly.
+
+
+Multi-line patterns *:syn-multi-line*
+
+The patterns can include "\n" to match an end-of-line. Mostly this works as
+expected, but there are a few exceptions.
+
+When using a start pattern with an offset, the start of the match is not
+allowed to start in a following line. The highlighting can start in a
+following line though.
+
+The skip pattern can include the "\n", but the search for an end pattern will
+continue in the first character of the next line, also when that character is
+matched by the skip pattern. This is because redrawing may start in any line
+halfway a region and there is no check if the skip pattern started in a
+previous line. For example, if the skip pattern is "a\nb" and an end pattern
+is "b", the end pattern does match in the second line of this: >
+ x x a
+ b x x
+Generally this means that the skip pattern should not match any characters
+after the "\n".
+
+
+External matches *:syn-ext-match*
+
+These extra regular expression items are available in region patterns:
+
+ */\z(* */\z(\)* *E50* *E52*
+ \z(\) Marks the sub-expression as "external", meaning that it is can
+ be accessed from another pattern match. Currently only usable
+ in defining a syntax region start pattern.
+
+ */\z1* */\z2* */\z3* */\z4* */\z5*
+ \z1 ... \z9 */\z6* */\z7* */\z8* */\z9* *E66* *E67*
+ Matches the same string that was matched by the corresponding
+ sub-expression in a previous start pattern match.
+
+Sometimes the start and end patterns of a region need to share a common
+sub-expression. A common example is the "here" document in Perl and many Unix
+shells. This effect can be achieved with the "\z" special regular expression
+items, which marks a sub-expression as "external", in the sense that it can be
+referenced from outside the pattern in which it is defined. The here-document
+example, for instance, can be done like this: >
+ :syn region hereDoc start="<<\z(\I\i*\)" end="^\z1$"
+
+As can be seen here, the \z actually does double duty. In the start pattern,
+it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it
+changes the \1 back-reference into an external reference referring to the
+first external sub-expression in the start pattern. External references can
+also be used in skip patterns: >
+ :syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1"
+
+Note that normal and external sub-expressions are completely orthogonal and
+indexed separately; for instance, if the pattern "\z(..\)\(..\)" is applied
+to the string "aabb", then \1 will refer to "bb" and \z1 will refer to "aa".
+Note also that external sub-expressions cannot be accessed as back-references
+within the same pattern like normal sub-expressions. If you want to use one
+sub-expression as both a normal and an external sub-expression, you can nest
+the two, as in "\(\z(...\)\)".
+
+Note that only matches within a single line can be used. Multi-line matches
+cannot be referred to.
+
+==============================================================================
+8. Syntax clusters *:syn-cluster* *E400*
+
+:sy[ntax] cluster {cluster-name} [contains={group-name}..]
+ [add={group-name}..]
+ [remove={group-name}..]
+
+This command allows you to cluster a list of syntax groups together under a
+single name.
+
+ contains={group-name}..
+ The cluster is set to the specified list of groups.
+ add={group-name}..
+ The specified groups are added to the cluster.
+ remove={group-name}..
+ The specified groups are removed from the cluster.
+
+A cluster so defined may be referred to in a contains=.., nextgroup=.., add=..
+or remove=.. list with a "@" prefix. You can also use this notation to
+implicitly declare a cluster before specifying its contents.
+
+Example: >
+ :syntax match Thing "# [^#]\+ #" contains=@ThingMembers
+ :syntax cluster ThingMembers contains=ThingMember1,ThingMember2
+
+As the previous example suggests, modifications to a cluster are effectively
+retroactive; the membership of the cluster is checked at the last minute, so
+to speak: >
+ :syntax keyword A aaa
+ :syntax keyword B bbb
+ :syntax cluster AandB contains=A
+ :syntax match Stuff "( aaa bbb )" contains=@AandB
+ :syntax cluster AandB add=B " now both keywords are matched in Stuff
+
+This also has implications for nested clusters: >
+ :syntax keyword A aaa
+ :syntax keyword B bbb
+ :syntax cluster SmallGroup contains=B
+ :syntax cluster BigGroup contains=A,@SmallGroup
+ :syntax match Stuff "( aaa bbb )" contains=@BigGroup
+ :syntax cluster BigGroup remove=B " no effect, since B isn't in BigGroup
+ :syntax cluster SmallGroup remove=B " now bbb isn't matched within Stuff
+
+==============================================================================
+9. Including syntax files *:syn-include* *E397*
+
+It is often useful for one language's syntax file to include a syntax file for
+a related language. Depending on the exact relationship, this can be done in
+two different ways:
+
+ - If top-level syntax items in the included syntax file are to be
+ allowed at the top level in the including syntax, you can simply use
+ the |:runtime| command: >
+
+ " In cpp.vim:
+ :runtime! syntax/c.vim
+ :unlet b:current_syntax
+
+< - If top-level syntax items in the included syntax file are to be
+ contained within a region in the including syntax, you can use the
+ ":syntax include" command:
+
+:sy[ntax] include [@{grouplist-name}] {file-name}
+
+ All syntax items declared in the included file will have the
+ "contained" flag added. In addition, if a group list is specified,
+ all top-level syntax items in the included file will be added to
+ that list. >
+
+ " In perl.vim:
+ :syntax include @Pod <sfile>:p:h/pod.vim
+ :syntax region perlPOD start="^=head" end="^=cut" contains=@Pod
+<
+ When {file-name} is an absolute path (starts with "/", "c:", "$VAR"
+ or "<sfile>") that file is sourced. When it is a relative path
+ (e.g., "syntax/pod.vim") the file is searched for in 'runtimepath'.
+ All matching files are loaded. Using a relative path is
+ recommended, because it allows a user to replace the included file
+ with his own version, without replacing the file that does the ":syn
+ include".
+
+==============================================================================
+10. Synchronizing *:syn-sync* *E403* *E404*
+
+Vim wants to be able to start redrawing in any position in the document. To
+make this possible it needs to know the syntax state at the position where
+redrawing starts.
+
+:sy[ntax] sync [ccomment [group-name] | minlines={N} | ...]
+
+There are four ways to synchronize:
+1. Always parse from the start of the file.
+ |:syn-sync-first|
+2. Based on C-style comments. Vim understands how C-comments work and can
+ figure out if the current line starts inside or outside a comment.
+ |:syn-sync-second|
+3. Jumping back a certain number of lines and start parsing there.
+ |:syn-sync-third|
+4. Searching backwards in the text for a pattern to sync on.
+ |:syn-sync-fourth|
+
+ *:syn-sync-maxlines* *:syn-sync-minlines*
+For the last three methods, the line range where the parsing can start is
+limited by "minlines" and "maxlines".
+
+If the "minlines={N}" argument is given, the parsing always starts at least
+that many lines backwards. This can be used if the parsing may take a few
+lines before it's correct, or when it's not possible to use syncing.
+
+If the "maxlines={N}" argument is given, the number of lines that are searched
+for a comment or syncing pattern is restricted to N lines backwards (after
+adding "minlines"). This is useful if you have few things to sync on and a
+slow machine. Example: >
+ :syntax sync ccomment maxlines=500
+<
+ *:syn-sync-linebreaks*
+When using a pattern that matches multiple lines, a change in one line may
+cause a pattern to no longer match in a previous line. This means has to
+start above where the change was made. How many lines can be specified with
+the "linebreaks" argument. For example, when a pattern may include one line
+break use this: >
+ :syntax sync linebreaks=1
+The result is that redrawing always starts at least one line before where a
+change was made. The default value for "linebreaks" is zero. Usually the
+value for "minlines" is bigger than "linebreaks".
+
+
+First syncing method: *:syn-sync-first*
+>
+ :syntax sync fromstart
+
+The file will be parsed from the start. This makes syntax highlighting
+accurate, but can be slow for long files. Vim caches previously parsed text,
+so that it's only slow when parsing the text for the first time. However,
+when making changes some part of the next needs to be parsed again (worst
+case: to the end of the file).
+
+Using "fromstart" is equivalent to using "minlines" with a very large number.
+
+
+Second syncing method: *:syn-sync-second* *:syn-sync-ccomment*
+
+For the second method, only the "ccomment" argument needs to be given.
+Example: >
+ :syntax sync ccomment
+
+When Vim finds that the line where displaying starts is inside a C-style
+comment, the last region syntax item with the group-name "Comment" will be
+used. This requires that there is a region with the group-name "Comment"!
+An alternate group name can be specified, for example: >
+ :syntax sync ccomment javaComment
+This means that the last item specified with "syn region javaComment" will be
+used for the detected C comment region. This only works properly if that
+region does have a start pattern "\/*" and an end pattern "*\/".
+
+The "maxlines" argument can be used to restrict the search to a number of
+lines. The "minlines" argument can be used to at least start a number of
+lines back (e.g., for when there is some construct that only takes a few
+lines, but it hard to sync on).
+
+Note: Syncing on a C comment doesn't work properly when strings are used
+that cross a line and contain a "*/". Since letting strings cross a line
+is a bad programming habit (many compilers give a warning message), and the
+chance of a "*/" appearing inside a comment is very small, this restriction
+is hardly ever noticed.
+
+
+Third syncing method: *:syn-sync-third*
+
+For the third method, only the "minlines={N}" argument needs to be given.
+Vim will subtract {N} from the line number and start parsing there. This
+means {N} extra lines need to be parsed, which makes this method a bit slower.
+Example: >
+ :syntax sync minlines=50
+
+"lines" is equivalent to "minlines" (used by older versions).
+
+
+Fourth syncing method: *:syn-sync-fourth*
+
+The idea is to synchronize on the end of a few specific regions, called a
+sync pattern. Only regions can cross lines, so when we find the end of some
+region, we might be able to know in which syntax item we are. The search
+starts in the line just above the one where redrawing starts. From there
+the search continues backwards in the file.
+
+This works just like the non-syncing syntax items. You can use contained
+matches, nextgroup, etc. But there are a few differences:
+- Keywords cannot be used.
+- The syntax items with the "sync" keyword form a completely separated group
+ of syntax items. You can't mix syncing groups and non-syncing groups.
+- The matching works backwards in the buffer (line by line), instead of
+ forwards.
+- A line continuation pattern can be given. It is used to decide which group
+ of lines need to be searched like they were one line. This means that the
+ search for a match with the specified items starts in the first of the
+ consecutive that contain the continuation pattern.
+- When using "nextgroup" or "contains", this only works within one line (or
+ group of continued lines).
+- When using a region, it must start and end in the same line (or group of
+ continued lines). Otherwise the end is assumed to be at the end of the
+ line (or group of continued lines).
+- When a match with a sync pattern is found, the rest of the line (or group of
+ continued lines) is searched for another match. The last match is used.
+ This is used when a line can contain both the start end the end of a region
+ (e.g., in a C-comment like /* this */, the last "*/" is used).
+
+There are two ways how a match with a sync pattern can be used:
+1. Parsing for highlighting starts where redrawing starts (and where the
+ search for the sync pattern started). The syntax group that is expected
+ to be valid there must be specified. This works well when the regions
+ that cross lines cannot contain other regions.
+2. Parsing for highlighting continues just after the match. The syntax group
+ that is expected to be present just after the match must be specified.
+ This can be used when the previous method doesn't work well. It's much
+ slower, because more text needs to be parsed.
+Both types of sync patterns can be used at the same time.
+
+Besides the sync patterns, other matches and regions can be specified, to
+avoid finding unwanted matches.
+
+[The reason that the sync patterns are given separately, is that mostly the
+search for the sync point can be much simpler than figuring out the
+highlighting. The reduced number of patterns means it will go (much)
+faster.]
+
+ *syn-sync-grouphere* *E393* *E394*
+ :syntax sync match {sync-group-name} grouphere {group-name} "pattern" ..
+
+ Define a match that is used for syncing. {group-name} is the
+ name of a syntax group that follows just after the match. Parsing
+ of the text for highlighting starts just after the match. A region
+ must exist for this {group-name}. The first one defined will be used.
+ "NONE" can be used for when there is no syntax group after the match.
+
+ *syn-sync-groupthere*
+ :syntax sync match {sync-group-name} groupthere {group-name} "pattern" ..
+
+ Like "grouphere", but {group-name} is the name of a syntax group that
+ is to be used at the start of the line where searching for the sync
+ point started. The text between the match and the start of the sync
+ pattern searching is assumed not to change the syntax highlighting.
+ For example, in C you could search backwards for "/*" and "*/". If
+ "/*" is found first, you know that you are inside a comment, so the
+ "groupthere" is "cComment". If "*/" is found first, you know that you
+ are not in a comment, so the "groupthere" is "NONE". (in practice
+ it's a bit more complicated, because the "/*" and "*/" could appear
+ inside a string. That's left as an exercise to the reader...).
+
+ :syntax sync match ..
+ :syntax sync region ..
+
+ Without a "groupthere" argument. Define a region or match that is
+ skipped while searching for a sync point.
+
+ :syntax sync linecont {pattern}
+
+ When {pattern} matches in a line, it is considered to continue in
+ the next line. This means that the search for a sync point will
+ consider the lines to be concatenated.
+
+If the "maxlines={N}" argument is given too, the number of lines that are
+searched for a match is restricted to N. This is useful if you have very
+few things to sync on and a slow machine. Example: >
+ :syntax sync maxlines=100
+
+You can clear all sync settings with: >
+ :syntax sync clear
+
+You can clear specific sync patterns with: >
+ :syntax sync clear {sync-group-name} ..
+
+==============================================================================
+11. Listing syntax items *:syntax* *:sy* *:syn* *:syn-list*
+
+This commands lists all the syntax items: >
+
+ :sy[ntax] [list]
+
+To show the syntax items for one syntax group: >
+
+ :sy[ntax] list {group-name}
+
+To list the syntax groups in one cluster: *E392* >
+
+ :sy[ntax] list @{cluster-name}
+
+See above for other arguments for the ":syntax" command.
+
+Note that the ":syntax" command can be abbreviated to ":sy", although ":syn"
+is mostly used, because it looks better.
+
+==============================================================================
+12. Highlight command *:highlight* *:hi* *E28* *E411* *E415*
+
+There are three types of highlight groups:
+- The ones used for specific languages. For these the name starts with the
+ name of the language. Many of these don't have any attributes, but are
+ linked to a group of the second type.
+- The ones used for all syntax languages.
+- The ones used for the 'highlight' option.
+ *hitest.vim*
+You can see all the groups currently active with this command: >
+ :so $VIMRUNTIME/syntax/hitest.vim
+This will open a new window containing all highlight group names, displayed
+in their own color.
+
+ *:colo* *:colorscheme* *E185*
+:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath'
+ for the file "colors/{name}.vim. The first one that
+ is found is loaded.
+ To see the name of the currently active color scheme
+ (if there is one): >
+ :echo g:colors_name
+< Doesn't work recursively, thus you can't use
+ ":colorscheme" in a color scheme script.
+
+:hi[ghlight] List all the current highlight groups that have
+ attributes set.
+
+:hi[ghlight] {group-name}
+ List one highlight group.
+
+:hi[ghlight] clear Reset all highlighting to the defaults. Removes all
+ highlighting for groups added by the user!
+ Uses the current value of 'background' to decide which
+ default colors to use.
+
+:hi[ghlight] clear {group-name}
+:hi[ghlight] {group-name} NONE
+ Disable the highlighting for one highlight group. It
+ is _not_ set back to the default colors.
+
+:hi[ghlight] [default] {group-name} {key}={arg} ..
+ Add a highlight group, or change the highlighting for
+ an existing group.
+ See |highlight-args| for the {key}={arg} arguments.
+ See |:highlight-default| for the optional [default]
+ argument.
+
+Normally a highlight group is added once when starting up. This sets the
+default values for the highlighting. After that, you can use additional
+highlight commands to change the arguments that you want to set to non-default
+values. The value "NONE" can be used to switch the value off or go back to
+the default value.
+
+A simple way to change colors is with the |:colorscheme| command. This loads
+a file with ":highlight" commands such as this: >
+
+ :hi Comment gui=bold
+
+Note that all settings that are not included remain the same, only the
+specified field is used, and settings are merged with previous ones. So, the
+result is like this single command has been used: >
+ :hi Comment term=bold ctermfg=Cyan guifg=#80a0ff gui=bold
+<
+ *highlight-args* *E416* *E417* *E423*
+There are three types of terminals for highlighting:
+term a normal terminal (vt100, xterm)
+cterm a color terminal (MS-DOS console, color-xterm, these have the "Co"
+ termcap entry)
+gui the GUI
+
+For each type the highlighting can be given. This makes it possible to use
+the same syntax file on all terminals, and use the optimal highlighting.
+
+1. highlight arguments for normal terminals
+
+term={attr-list} *attr-list* *highlight-term* *E418*
+ attr-list is a comma separated list (without spaces) of the
+ following items (in any order):
+ bold
+ underline
+ reverse
+ inverse same as reverse
+ italic
+ standout
+ NONE no attributes used (used to reset it)
+
+ Note that "bold" can be used here and by using a bold font. They
+ have the same effect.
+
+start={term-list} *highlight-start* *E422*
+stop={term-list} *term-list* *highlight-stop*
+ These lists of terminal codes can be used to get
+ non-standard attributes on a terminal.
+
+ The escape sequence specified with the "start" argument
+ is written before the characters in the highlighted
+ area. It can be anything that you want to send to the
+ terminal to highlight this area. The escape sequence
+ specified with the "stop" argument is written after the
+ highlighted area. This should undo the "start" argument.
+ Otherwise the screen will look messed up.
+
+ The {term-list} can have two forms:
+
+ 1. A string with escape sequences.
+ This is any string of characters, except that it can't start with
+ "t_" and blanks are not allowed. The <> notation is recognized
+ here, so you can use things like "<Esc>" and "<Space>". Example:
+ start=<Esc>[27h;<Esc>[<Space>r;
+
+ 2. A list of terminal codes.
+ Each terminal code has the form "t_xx", where "xx" is the name of
+ the termcap entry. The codes have to be separated with commas.
+ White space is not allowed. Example:
+ start=t_C1,t_BL
+ The terminal codes must exist for this to work.
+
+
+2. highlight arguments for color terminals
+
+cterm={attr-list} *highlight-cterm*
+ See above for the description of {attr-list} |attr-list|.
+ The "cterm" argument is likely to be different from "term", when
+ colors are used. For example, in a normal terminal comments could
+ be underlined, in a color terminal they can be made Blue.
+ Note: Many terminals (e.g., DOS console) can't mix these attributes
+ with coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=".
+
+ctermfg={color-nr} *highlight-ctermfg* *E421*
+ctermbg={color-nr} *highlight-ctermbg*
+ The {color-nr} argument is a color number. Its range is zero to
+ (not including) the number given by the termcap entry "Co".
+ The actual color with this number depends on the type of terminal
+ and its settings. Sometimes the color also depends on the settings of
+ "cterm". For example, on some systems "cterm=bold ctermfg=3" gives
+ another color, on others you just get color 3.
+
+ For an xterm this depends on your resources, and is a bit
+ unpredictable. See your xterm documentation for the defaults. The
+ colors for a color-xterm can be changed from the .Xdefaults file.
+ Unfortunately this means that it's not possible to get the same colors
+ for each user. See |xterm-color| for info about color xterms.
+
+ The MSDOS standard colors are fixed (in a console window), so these
+ have been used for the names. But the meaning of color names in X11
+ are fixed, so these color settings have been used, to make the
+ highlighting settings portable (complicated, isn't it?). The
+ following names are recognized, with the color number used:
+
+ *cterm-colors*
+ NR-16 NR-8 COLOR NAME ~
+ 0 0 Black
+ 1 4 DarkBlue
+ 2 2 DarkGreen
+ 3 6 DarkCyan
+ 4 1 DarkRed
+ 5 5 DarkMagenta
+ 6 3 Brown, DarkYellow
+ 7 7 LightGray, LightGrey, Gray, Grey
+ 8 0* DarkGray, DarkGrey
+ 9 4* Blue, LightBlue
+ 10 2* Green, LightGreen
+ 11 6* Cyan, LightCyan
+ 12 1* Red, LightRed
+ 13 5* Magenta, LightMagenta
+ 14 3* Yellow, LightYellow
+ 15 7* White
+
+ The number under "NR-16" is used for 16-color terminals ('t_Co'
+ greater than or equal to 16). The number under "NR-8" is used for
+ 8-color terminals ('t_Co' less than 16). The '*' indicates that the
+ bold attribute is set for ctermfg. In many 8-color terminals (e.g.,
+ "linux"), this causes the bright colors to appear. This doesn't work
+ for background colors! Without the '*' the bold attribute is removed.
+ If you want to set the bold attribute in a different way, put a
+ "cterm=" argument AFTER the "ctermfg=" or "ctermbg=" argument. Or use
+ a number instead of a color name.
+
+ The case of the color names is ignored.
+ Note that for 16 color ansi style terminals (including xterms), the
+ numbers in the NR-8 column is used. Here '*' means 'add 8' so that Blue
+ is 12, DarkGray is 8 etc.
+
+ Note that for some color terminals these names may result in the wrong
+ colors!
+
+ *:hi-normal-cterm*
+ When setting the "ctermfg" or "ctermbg" colors for the Normal group,
+ these will become the colors used for the non-highlighted text.
+ Example: >
+ :highlight Normal ctermfg=grey ctermbg=darkblue
+< When setting the "ctermbg" color for the Normal group, the
+ 'background' option will be adjusted automatically. This causes the
+ highlight groups that depend on 'background' to change! This means
+ you should set the colors for Normal first, before setting other
+ colors.
+ When a colorscheme is being used, changing 'background' causes it to
+ be reloaded, which may reset all colors (including Normal). First
+ delete the "colors_name" variable when you don't want this.
+
+ When you have set "ctermfg" or "ctermbg" for the Normal group, Vim
+ needs to reset the color when exiting. This is done with the "op"
+ termcap entry |t_op|. If this doesn't work correctly, try setting the
+ 't_op' option in your .vimrc.
+ *E419* *E420*
+ When Vim knows the normal foreground and background colors, "fg" and
+ "bg" can be used as color names. This only works after setting the
+ colors for the Normal group and for the MS-DOS console. Example, for
+ reverse video: >
+ :highlight Visual ctermfg=bg ctermbg=fg
+< Note that the colors are used that are valid at the moment this
+ command are given. If the Normal group colors are changed later, the
+ "fg" and "bg" colors will not be adjusted.
+
+
+3. highlight arguments for the GUI
+
+gui={attr-list} *highlight-gui*
+ These give the attributes to use in the GUI mode.
+ See |attr-list| for a description.
+ Note that "bold" can be used here and by using a bold font. They
+ have the same effect.
+ Note that the attributes are ignored for the "Normal" group.
+
+font={font-name} *highlight-font*
+ font-name is the name of a font, as it is used on the system Vim
+ runs on. For X11 this is a complicated name, for example: >
+ font=-misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
+<
+ The font-name "NONE" can be used to revert to the default font.
+ When setting the font for the "Normal" group, this becomes the default
+ font (until the 'guifont' option is changed; the last one set is
+ used).
+ The following only works with Motif and Athena, not with other GUIs:
+ When setting the font for the "Menu" group, the menus will be changed.
+ When setting the font for the "Tooltip" group, the tooltips will be
+ changed.
+ All fonts used, except for Menu and Tooltip, should be of the same
+ character size as the default font! Otherwise redrawing problems will
+ occur.
+
+guifg={color-name} *highlight-guifg*
+guibg={color-name} *highlight-guibg*
+ These give the foreground (guifg) and background (guibg) color to
+ use in the GUI. There are a few special names:
+ NONE no color (transparent)
+ bg use normal background color
+ background use normal background color
+ fg use normal foreground color
+ foreground use normal foreground color
+ To use a color name with an embedded space or other special character,
+ put it in single quotes. The single quote cannot be used then.
+ Example: >
+ :hi comment guifg='salmon pink'
+<
+ *gui-colors*
+ Suggested color names (these are available on most systems):
+ Red LightRed DarkRed
+ Green LightGreen DarkGreen SeaGreen
+ Blue LightBlue DarkBlue SlateBlue
+ Cyan LightCyan DarkCyan
+ Magenta LightMagenta DarkMagenta
+ Yellow LightYellow Brown DarkYellow
+ Gray LightGray DarkGray
+ Black White
+ Orange Purple Violet
+
+ In the Win32 GUI version, additional system colors are available. See
+ |win32-colors|.
+
+ You can also specify a color by its Red, Green and Blue values.
+ The format is "#rrggbb", where
+ "rr" is the Red value
+ "bb" is the Blue value
+ "gg" is the Green value
+ All values are hexadecimal, range from "00" to "ff". Examples: >
+ :highlight Comment guifg=#11f0c3 guibg=#ff00ff
+<
+ *highlight-groups* *highlight-default*
+These are the default highlighting groups. These groups are used by the
+'highlight' option default. Note that the highlighting depends on the value
+of 'background'. You can see the current settings with the ":highlight"
+command.
+ *hl-Cursor*
+Cursor the character under the cursor
+ *hl-CursorIM*
+CursorIM like Cursor, but used when in IME mode |CursorIM|
+ *hl-Directory*
+Directory directory names (and other special names in listings)
+ *hl-DiffAdd*
+DiffAdd diff mode: Added line |diff.txt|
+ *hl-DiffChange*
+DiffChange diff mode: Changed line |diff.txt|
+ *hl-DiffDelete*
+DiffDelete diff mode: Deleted line |diff.txt|
+ *hl-DiffText*
+DiffText diff mode: Changed text within a changed line |diff.txt|
+ *hl-ErrorMsg*
+ErrorMsg error messages on the command line
+ *hl-VertSplit*
+VertSplit the column separating vertically split windows
+ *hl-Folded*
+Folded line used for closed folds
+ *hl-FoldColumn*
+FoldColumn 'foldcolumn'
+ *hl-SignColumn*
+SignColumn column where |signs| are displayed
+ *hl-IncSearch*
+IncSearch 'incsearch' highlighting; also used for the text replaced with
+ ":s///c"
+ *hl-LineNr*
+LineNr line number for ":number" and ":#" commands, and when 'number'
+ option is set.
+ *hl-ModeMsg*
+ModeMsg 'showmode' message (e.g., "-- INSERT --")
+ *hl-MoreMsg*
+MoreMsg |more-prompt|
+ *hl-NonText*
+NonText '~' and '@' at the end of the window, characters from
+ 'showbreak' and other characters that do not really exist in
+ the text (e.g., ">" displayed when a double-wide character
+ doesn't fit at the end of the line).
+ *hl-Normal*
+Normal normal text
+ *hl-Question*
+Question |hit-enter| prompt and yes/no questions
+ *hl-Search*
+Search Last search pattern highlighting (see 'hlsearch').
+ Also used for highlighting the current line in the quickfix
+ window and similar items that need to stand out.
+ *hl-SpecialKey*
+SpecialKey Meta and special keys listed with ":map", also for text used
+ to show unprintable characters in the text, 'listchars'.
+ Generally: text that is displayed differently from what it
+ really is.
+ *hl-StatusLine*
+StatusLine status line of current window
+ *hl-StatusLineNC*
+StatusLineNC status lines of not-current windows
+ Note: if this is equal to "StatusLine" Vim will use "^^^" in
+ the status line of the current window.
+ *hl-Title*
+Title titles for output from ":set all", ":autocmd" etc.
+ *hl-Visual*
+Visual Visual mode selection
+ *hl-VisualNOS*
+VisualNOS Visual mode selection when vim is "Not Owning the Selection".
+ Only X11 Gui's |gui-x11| and |xterm-clipboard| supports this.
+ *hl-WarningMsg*
+WarningMsg warning messages
+ *hl-WildMenu*
+WildMenu current match in 'wildmenu' completion
+
+ *hl-User1* *hl-User1..9*
+The 'statusline' syntax allows the use of 9 different highlights in the
+statusline and ruler (via 'rulerformat'). The names are User1 to User9.
+
+For the GUI you can use these groups to set the colors for the menu,
+scrollbars and tooltips. They don't have defaults. This doesn't work for the
+Win32 GUI. Only three highlight arguments have any effect here: font, guibg,
+and guifg.
+
+ *hl-Menu*
+Menu Current font, background and foreground colors of the menus.
+ Also used for the toolbar.
+ Applicable highlight arguments: font, guibg, guifg.
+
+ NOTE: For Motif and Athena the font argument actually
+ specifies a fontset at all times, no matter if 'guifontset' is
+ empty, and as such it is tied to the current |:language| when
+ set.
+
+ *hl-Scrollbar*
+Scrollbar Current background and foreground of the main window's
+ scrollbars.
+ Applicable highlight arguments: guibg, guifg.
+
+ *hl-Tooltip*
+Tooltip Current font, background and foreground of the tooltips.
+ Applicable highlight arguments: font, guibg, guifg.
+
+ NOTE: For Motif and Athena the font argument actually
+ specifies a fontset at all times, no matter if 'guifontset' is
+ empty, and as such it is tied to the current |:language| when
+ set.
+
+==============================================================================
+13. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
+
+When you want to use the same highlighting for several syntax groups, you
+can do this more easily by linking the groups into one common highlight
+group, and give the color attributes only for that group.
+
+To set a link:
+
+ :hi[ghlight][!] [default] link {from-group} {to-group}
+
+To remove a link:
+
+ :hi[ghlight][!] [default] link {from-group} NONE
+
+Notes: *E414*
+- If the {from-group} and/or {to-group} doesn't exist, it is created. You
+ don't get an error message for a non-existing group.
+- As soon as you use a ":highlight" command for a linked group, the link is
+ removed.
+- If there are already highlight settings for the {from-group}, the link is
+ not made, unless the '!' is given. For a ":highlight link" command in a
+ sourced file, you don't get an error message. This can be used to skip
+ links for groups that already have settings.
+
+ *:hi-default* *:highlight-default*
+The [default] argument is used for setting the default highlighting for a
+group. If highlighting has already been specified for the group the command
+will be ignored. Also when there is an existing link.
+
+Using [default] is especially useful to overrule the highlighting of a
+specific syntax file. For example, the C syntax file contains: >
+ :highlight default link cComment Comment
+If you like Question highlighting for C comments, put this in your vimrc file: >
+ :highlight link cComment Question
+Without the "default" in the C syntax file, the highlighting would be
+overruled when the syntax file is loaded.
+
+==============================================================================
+14. Cleaning up *:syn-clear* *E391*
+
+If you want to clear the syntax stuff for the current buffer, you can use this
+command: >
+ :syntax clear
+
+This command should be used when you want to switch off syntax highlighting,
+or when you want to switch to using another syntax. It's normally not needed
+in a syntax file itself, because syntax is cleared by the autocommands that
+load the syntax file.
+The command also deletes the "b:current_syntax" variable, since no syntax is
+loaded after this command.
+
+If you want to disable syntax highlighting for all buffers, you need to remove
+the autocommands that load the syntax files: >
+ :syntax off
+
+What this command actually does, is executing the command >
+ :source $VIMRUNTIME/syntax/nosyntax.vim
+See the "nosyntax.vim" file for details. Note that for this to work
+$VIMRUNTIME must be valid. See |$VIMRUNTIME|.
+
+To clean up specific syntax groups for the current buffer: >
+ :syntax clear {group-name} ..
+This removes all patterns and keywords for {group-name}.
+
+To clean up specific syntax group lists for the current buffer: >
+ :syntax clear @{grouplist-name} ..
+This sets {grouplist-name}'s contents to an empty list.
+
+ *:syntax-reset* *:syn-reset*
+If you have changed the colors and messed them up, use this command to get the
+defaults back: >
+
+ :syntax reset
+
+This doesn't change the colors for the 'highlight' option.
+
+Note that the syntax colors that you set in your vimrc file will also be reset
+back to their Vim default.
+Note that if you are using a color scheme, the colors defined by the color
+scheme for syntax highlighting will be lost.
+
+What this actually does is: >
+
+ let g:syntax_cmd = "reset"
+ runtime! syntax/syncolor.vim
+
+Note that this uses the 'runtimepath' option.
+
+ *syncolor*
+If you want to use different colors for syntax highlighting, you can add a Vim
+script file to set these colors. Put this file in a directory in
+'runtimepath' which comes after $VIMRUNTIME, so that your settings overrule
+the default colors. This way these colors will be used after the ":syntax
+reset" command.
+
+For Unix you can use the file ~/.vim/after/syntax/syncolor.vim. Example: >
+
+ if &background == "light"
+ highlight comment ctermfg=darkgreen guifg=darkgreen
+ else
+ highlight comment ctermfg=green guifg=green
+ endif
+
+Note that when a color scheme is used, there might be some confusion whether
+your defined colors are to be used or the colors from the scheme. This
+depends on the color scheme file. See |:colorscheme|.
+
+ *syntax_cmd*
+The "syntax_cmd" variable is set to one of these values when the
+syntax/syncolor.vim files are loaded:
+ "on" ":syntax on" command. Highlight colors are overruled but
+ links are kept
+ "enable" ":syntax enable" command. Only define colors for groups that
+ don't have highlighting yet. Use ":syntax default".
+ "reset" ":syntax reset" command or loading a color scheme. Define all
+ the colors.
+ "skip" Don't define colors. Used to skip the default settings when a
+ syncolor.vim file earlier in 'runtimepath' has already set
+ them.
+
+==============================================================================
+15. Highlighting tags *tag-highlight*
+
+If you want to highlight all the tags in your file, you can use the following
+mappings.
+
+ <F11> -- Generate tags.vim file, and highlight tags.
+ <F12> -- Just highlight tags based on existing tags.vim file.
+>
+ :map <F11> :sp tags<CR>:%s/^\([^ :]*:\)\=\([^ ]*\).*/syntax keyword Tag \2/<CR>:wq! tags.vim<CR>/^<CR><F12>
+ :map <F12> :so tags.vim<CR>
+
+WARNING: The longer the tags file, the slower this will be, and the more
+memory Vim will consume.
+
+Only highlighting typedefs, unions and structs can be done too. For this you
+must use Exuberant ctags (found at http://ctags.sf.net).
+
+Put these lines in your Makefile:
+
+# Make a highlight file for types. Requires Exuberant ctags and awk
+types: types.vim
+types.vim: *.[ch]
+ ctags -i=gstuS -o- *.[ch] |\
+ awk 'BEGIN{printf("syntax keyword Type\t")}\
+ {printf("%s ", $$1)}END{print ""}' > $@
+
+And put these lines in your .vimrc: >
+
+ " load the types.vim highlighting file, if it exists
+ autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') . '/types.vim'
+ autocmd BufRead,BufNewFile *.[ch] if filereadable(fname)
+ autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname
+ autocmd BufRead,BufNewFile *.[ch] endif
+
+==============================================================================
+16. Color xterms *xterm-color* *color-xterm*
+
+Most color xterms have only eight colors. If you don't get colors with the
+default setup, it should work with these lines in your .vimrc: >
+ :if &term =~ "xterm"
+ : if has("terminfo")
+ : set t_Co=8
+ : set t_Sf=<Esc>[3%p1%dm
+ : set t_Sb=<Esc>[4%p1%dm
+ : else
+ : set t_Co=8
+ : set t_Sf=<Esc>[3%dm
+ : set t_Sb=<Esc>[4%dm
+ : endif
+ :endif
+< [<Esc> is a real escape, type CTRL-V <Esc>]
+
+You might want to change the first "if" to match the name of your terminal,
+e.g. "dtterm" instead of "xterm".
+
+Note: Do these settings BEFORE doing ":syntax on". Otherwise the colors may
+be wrong.
+ *xiterm* *rxvt*
+The above settings have been mentioned to work for xiterm and rxvt too.
+But for using 16 colors in an rxvt these should work with terminfo: >
+ :set t_AB=<Esc>[%?%p1%{8}%<%t25;%p1%{40}%+%e5;%p1%{32}%+%;%dm
+ :set t_AF=<Esc>[%?%p1%{8}%<%t22;%p1%{30}%+%e1;%p1%{22}%+%;%dm
+<
+ *colortest.vim*
+To test your color setup, a file has been included in the Vim distribution.
+To use it, execute these commands: >
+ :e $VIMRUNTIME/syntax/colortest.vim
+ :so %
+
+Some versions of xterm (and other terminals, like the linux console) can
+output lighter foreground colors, even though the number of colors is defined
+at 8. Therefore Vim sets the "cterm=bold" attribute for light foreground
+colors, when 't_Co' is 8.
+
+ *xfree-xterm*
+To get 16 colors or more, get the newest xterm version (which should be
+included with Xfree86 3.3 and later). You can also find the latest version
+at: >
+ http://invisible-island.net/xterm/xterm.html
+Here is a good way to configure it. This uses 88 colors and enables the
+termcap-query feature, which allows Vim to ask the xterm how many colors it
+supports. >
+ ./configure --disable-bold-color --enable-88-color --enable-tcap-query
+If you only get 8 colors, check the xterm compilation settings.
+(Also see |UTF8-xterm| for using this xterm with UTF-8 character encoding).
+
+This xterm should work with these lines in your .vimrc (for 16 colors): >
+ :if has("terminfo")
+ : set t_Co=16
+ : set t_AB=<Esc>[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm
+ : set t_AF=<Esc>[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm
+ :else
+ : set t_Co=16
+ : set t_Sf=<Esc>[3%dm
+ : set t_Sb=<Esc>[4%dm
+ :endif
+< [<Esc> is a real escape, type CTRL-V <Esc>]
+
+Without |+terminfo|, Vim will recognize these settings, and automatically
+translate cterm colors of 8 and above to "<Esc>[9%dm" and "<Esc>[10%dm".
+Colors above 16 are also translated automatically.
+
+For 256 colors this has been reported to work: >
+
+ :set t_AB=<Esc>[48;5;%dm
+ :set t_AF=<Esc>[38;5;%dm
+
+Or just set the TERM environment variable to "xterm-color" or "xterm-16color"
+and try if that works.
+
+You probably want to use these X resources (in your ~/.Xdefaults file):
+ XTerm*color0: #000000
+ XTerm*color1: #c00000
+ XTerm*color2: #008000
+ XTerm*color3: #808000
+ XTerm*color4: #0000c0
+ XTerm*color5: #c000c0
+ XTerm*color6: #008080
+ XTerm*color7: #c0c0c0
+ XTerm*color8: #808080
+ XTerm*color9: #ff6060
+ XTerm*color10: #00ff00
+ XTerm*color11: #ffff00
+ XTerm*color12: #8080ff
+ XTerm*color13: #ff40ff
+ XTerm*color14: #00ffff
+ XTerm*color15: #ffffff
+ Xterm*cursorColor: Black
+
+[Note: The cursorColor is required to work around a bug, which changes the
+cursor color to the color of the last drawn text. This has been fixed by a
+newer version of xterm, but not everybody is it using yet.]
+
+To get these right away, reload the .Xdefaults file to the X Option database
+Manager (you only need to do this when you just changed the .Xdefaults file): >
+ xrdb -merge ~/.Xdefaults
+<
+ *xterm-blink* *xterm-blinking-cursor*
+To make the cursor blink in an xterm, see tools/blink.c. Or use Thomas
+Dickey's xterm above patchlevel 107 (see above for where to get it), with
+these resources:
+ XTerm*cursorBlink: on
+ XTerm*cursorOnTime: 400
+ XTerm*cursorOffTime: 250
+ XTerm*cursorColor: White
+
+ *hpterm-color*
+These settings work (more or less) for a hpterm, which only supports 8
+foreground colors: >
+ :if has("terminfo")
+ : set t_Co=8
+ : set t_Sf=<Esc>[&v%p1%dS
+ : set t_Sb=<Esc>[&v7S
+ :else
+ : set t_Co=8
+ : set t_Sf=<Esc>[&v%dS
+ : set t_Sb=<Esc>[&v7S
+ :endif
+< [<Esc> is a real escape, type CTRL-V <Esc>]
+
+ *Eterm* *enlightened-terminal*
+These settings have been reported to work for the Enlightened terminal
+emulator, or Eterm. They might work for all xterm-like terminals that use the
+bold attribute to get bright colors. Add an ":if" like above when needed. >
+ :set t_Co=16
+ :set t_AF=^[[%?%p1%{8}%<%t3%p1%d%e%p1%{22}%+%d;1%;m
+ :set t_AB=^[[%?%p1%{8}%<%t4%p1%d%e%p1%{32}%+%d;1%;m
+<
+ *TTpro-telnet*
+These settings should work for TTpro telnet. Tera Term Pro is a freeware /
+open-source program for MS-Windows. >
+ set t_Co=16
+ set t_AB=^[[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{32}%+5;%;%dm
+ set t_AF=^[[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{22}%+1;%;%dm
+Also make sure TTpro's Setup / Window / Full Color is enabled, and make sure
+that Setup / Font / Enable Bold is NOT enabled.
+(info provided by John Love-Jensen <eljay@Adobe.COM>)
+
+ vim:tw=78:sw=4:ts=8:ft=help:norl:
diff --git a/runtime/doc/tags b/runtime/doc/tags
new file mode 100644
index 000000000..9a77ade8a
--- /dev/null
+++ b/runtime/doc/tags
@@ -0,0 +1,6649 @@
+! change.txt /*!*
+!! change.txt /*!!*
+# pattern.txt /*#*
+$ motion.txt /*$*
+$HOME options.txt /*$HOME*
+$HOME-use version5.txt /*$HOME-use*
+$VIM starting.txt /*$VIM*
+$VIM-use version5.txt /*$VIM-use*
+$VIMRUNTIME starting.txt /*$VIMRUNTIME*
+% motion.txt /*%*
+& change.txt /*&*
+' motion.txt /*'*
+'' motion.txt /*''*
+'( motion.txt /*'(*
+') motion.txt /*')*
+'. motion.txt /*'.*
+'0 motion.txt /*'0*
+'< motion.txt /*'<*
+'> motion.txt /*'>*
+'A motion.txt /*'A*
+'[ motion.txt /*'[*
+'] motion.txt /*']*
+'^ motion.txt /*'^*
+'a motion.txt /*'a*
+'acd' options.txt /*'acd'*
+'ai' options.txt /*'ai'*
+'akm' options.txt /*'akm'*
+'al' options.txt /*'al'*
+'aleph' options.txt /*'aleph'*
+'allowrevins' options.txt /*'allowrevins'*
+'altkeymap' options.txt /*'altkeymap'*
+'ambiwidth' options.txt /*'ambiwidth'*
+'ambw' options.txt /*'ambw'*
+'anti' options.txt /*'anti'*
+'antialias' options.txt /*'antialias'*
+'ap' vi_diff.txt /*'ap'*
+'ar' options.txt /*'ar'*
+'arab' options.txt /*'arab'*
+'arabic' options.txt /*'arabic'*
+'arabicshape' options.txt /*'arabicshape'*
+'ari' options.txt /*'ari'*
+'arshape' options.txt /*'arshape'*
+'as' todo.txt /*'as'*
+'autochdir' options.txt /*'autochdir'*
+'autoindent' options.txt /*'autoindent'*
+'autoprint' vi_diff.txt /*'autoprint'*
+'autoread' options.txt /*'autoread'*
+'autosave' todo.txt /*'autosave'*
+'autowrite' options.txt /*'autowrite'*
+'autowriteall' options.txt /*'autowriteall'*
+'aw' options.txt /*'aw'*
+'awa' options.txt /*'awa'*
+'background' options.txt /*'background'*
+'backspace' options.txt /*'backspace'*
+'backup' options.txt /*'backup'*
+'backupcopy' options.txt /*'backupcopy'*
+'backupdir' options.txt /*'backupdir'*
+'backupext' options.txt /*'backupext'*
+'backupskip' options.txt /*'backupskip'*
+'balloondelay' options.txt /*'balloondelay'*
+'ballooneval' options.txt /*'ballooneval'*
+'bdir' options.txt /*'bdir'*
+'bdlay' options.txt /*'bdlay'*
+'beautify' vi_diff.txt /*'beautify'*
+'beval' options.txt /*'beval'*
+'bex' options.txt /*'bex'*
+'bf' vi_diff.txt /*'bf'*
+'bg' options.txt /*'bg'*
+'bh' options.txt /*'bh'*
+'bin' options.txt /*'bin'*
+'binary' options.txt /*'binary'*
+'biosk' options.txt /*'biosk'*
+'bioskey' options.txt /*'bioskey'*
+'bk' options.txt /*'bk'*
+'bkc' options.txt /*'bkc'*
+'bl' options.txt /*'bl'*
+'bomb' options.txt /*'bomb'*
+'breakat' options.txt /*'breakat'*
+'brk' options.txt /*'brk'*
+'browsedir' options.txt /*'browsedir'*
+'bs' options.txt /*'bs'*
+'bsdir' options.txt /*'bsdir'*
+'bsk' options.txt /*'bsk'*
+'bt' options.txt /*'bt'*
+'bufhidden' options.txt /*'bufhidden'*
+'buflisted' options.txt /*'buflisted'*
+'buftype' options.txt /*'buftype'*
+'casemap' options.txt /*'casemap'*
+'cb' options.txt /*'cb'*
+'ccv' options.txt /*'ccv'*
+'cd' options.txt /*'cd'*
+'cdpath' options.txt /*'cdpath'*
+'cedit' options.txt /*'cedit'*
+'cf' options.txt /*'cf'*
+'ch' options.txt /*'ch'*
+'character' intro.txt /*'character'*
+'charconvert' options.txt /*'charconvert'*
+'ci' options.txt /*'ci'*
+'cin' options.txt /*'cin'*
+'cindent' options.txt /*'cindent'*
+'cink' options.txt /*'cink'*
+'cinkeys' options.txt /*'cinkeys'*
+'cino' options.txt /*'cino'*
+'cinoptions' options.txt /*'cinoptions'*
+'cinw' options.txt /*'cinw'*
+'cinwords' options.txt /*'cinwords'*
+'clipboard' options.txt /*'clipboard'*
+'cmdheight' options.txt /*'cmdheight'*
+'cmdwinheight' options.txt /*'cmdwinheight'*
+'cmp' options.txt /*'cmp'*
+'cms' options.txt /*'cms'*
+'co' options.txt /*'co'*
+'columns' options.txt /*'columns'*
+'com' options.txt /*'com'*
+'comments' options.txt /*'comments'*
+'commentstring' options.txt /*'commentstring'*
+'compatible' options.txt /*'compatible'*
+'complete' options.txt /*'complete'*
+'confirm' options.txt /*'confirm'*
+'consk' options.txt /*'consk'*
+'conskey' options.txt /*'conskey'*
+'copyindent' options.txt /*'copyindent'*
+'cp' options.txt /*'cp'*
+'cpo' options.txt /*'cpo'*
+'cpoptions' options.txt /*'cpoptions'*
+'cpt' options.txt /*'cpt'*
+'cscopepathcomp' options.txt /*'cscopepathcomp'*
+'cscopeprg' options.txt /*'cscopeprg'*
+'cscopequickfix' options.txt /*'cscopequickfix'*
+'cscopetag' options.txt /*'cscopetag'*
+'cscopetagorder' options.txt /*'cscopetagorder'*
+'cscopeverbose' options.txt /*'cscopeverbose'*
+'cspc' options.txt /*'cspc'*
+'csprg' options.txt /*'csprg'*
+'csqf' options.txt /*'csqf'*
+'cst' options.txt /*'cst'*
+'csto' options.txt /*'csto'*
+'csverb' options.txt /*'csverb'*
+'cwh' options.txt /*'cwh'*
+'debug' options.txt /*'debug'*
+'deco' options.txt /*'deco'*
+'def' options.txt /*'def'*
+'define' options.txt /*'define'*
+'delcombine' options.txt /*'delcombine'*
+'dex' options.txt /*'dex'*
+'dg' options.txt /*'dg'*
+'dict' options.txt /*'dict'*
+'dictionary' options.txt /*'dictionary'*
+'diff' options.txt /*'diff'*
+'diffexpr' options.txt /*'diffexpr'*
+'diffopt' options.txt /*'diffopt'*
+'digraph' options.txt /*'digraph'*
+'dip' options.txt /*'dip'*
+'dir' options.txt /*'dir'*
+'directory' options.txt /*'directory'*
+'display' options.txt /*'display'*
+'dy' options.txt /*'dy'*
+'ea' options.txt /*'ea'*
+'ead' options.txt /*'ead'*
+'eadirection' options.txt /*'eadirection'*
+'eb' options.txt /*'eb'*
+'ed' options.txt /*'ed'*
+'edcompatible' options.txt /*'edcompatible'*
+'ef' options.txt /*'ef'*
+'efm' options.txt /*'efm'*
+'ei' options.txt /*'ei'*
+'ek' options.txt /*'ek'*
+'enc' options.txt /*'enc'*
+'encoding' options.txt /*'encoding'*
+'endofline' options.txt /*'endofline'*
+'eol' options.txt /*'eol'*
+'ep' options.txt /*'ep'*
+'equalalways' options.txt /*'equalalways'*
+'equalprg' options.txt /*'equalprg'*
+'errorbells' options.txt /*'errorbells'*
+'errorfile' options.txt /*'errorfile'*
+'errorformat' options.txt /*'errorformat'*
+'esckeys' options.txt /*'esckeys'*
+'et' options.txt /*'et'*
+'eventignore' options.txt /*'eventignore'*
+'ex' options.txt /*'ex'*
+'expandtab' options.txt /*'expandtab'*
+'exrc' options.txt /*'exrc'*
+'fcl' options.txt /*'fcl'*
+'fcs' options.txt /*'fcs'*
+'fdc' options.txt /*'fdc'*
+'fde' options.txt /*'fde'*
+'fdi' options.txt /*'fdi'*
+'fdl' options.txt /*'fdl'*
+'fdls' options.txt /*'fdls'*
+'fdm' options.txt /*'fdm'*
+'fdn' options.txt /*'fdn'*
+'fdo' options.txt /*'fdo'*
+'fdt' options.txt /*'fdt'*
+'fe' options.txt /*'fe'*
+'fen' options.txt /*'fen'*
+'fenc' options.txt /*'fenc'*
+'fencs' options.txt /*'fencs'*
+'ff' options.txt /*'ff'*
+'ffs' options.txt /*'ffs'*
+'fileencoding' options.txt /*'fileencoding'*
+'fileencodings' options.txt /*'fileencodings'*
+'fileformat' options.txt /*'fileformat'*
+'fileformats' options.txt /*'fileformats'*
+'filetype' options.txt /*'filetype'*
+'fillchars' options.txt /*'fillchars'*
+'fk' options.txt /*'fk'*
+'fkmap' options.txt /*'fkmap'*
+'fl' vi_diff.txt /*'fl'*
+'flash' vi_diff.txt /*'flash'*
+'fml' options.txt /*'fml'*
+'fmr' options.txt /*'fmr'*
+'fo' options.txt /*'fo'*
+'foldclose' options.txt /*'foldclose'*
+'foldcolumn' options.txt /*'foldcolumn'*
+'foldenable' options.txt /*'foldenable'*
+'foldexpr' options.txt /*'foldexpr'*
+'foldignore' options.txt /*'foldignore'*
+'foldlevel' options.txt /*'foldlevel'*
+'foldlevelstart' options.txt /*'foldlevelstart'*
+'foldmarker' options.txt /*'foldmarker'*
+'foldmethod' options.txt /*'foldmethod'*
+'foldminlines' options.txt /*'foldminlines'*
+'foldnestmax' options.txt /*'foldnestmax'*
+'foldopen' options.txt /*'foldopen'*
+'foldtext' options.txt /*'foldtext'*
+'formatoptions' options.txt /*'formatoptions'*
+'formatprg' options.txt /*'formatprg'*
+'fp' options.txt /*'fp'*
+'ft' options.txt /*'ft'*
+'gcr' options.txt /*'gcr'*
+'gd' options.txt /*'gd'*
+'gdefault' options.txt /*'gdefault'*
+'gfm' options.txt /*'gfm'*
+'gfn' options.txt /*'gfn'*
+'gfs' options.txt /*'gfs'*
+'gfw' options.txt /*'gfw'*
+'ghr' options.txt /*'ghr'*
+'go' options.txt /*'go'*
+'gp' options.txt /*'gp'*
+'gr' vi_diff.txt /*'gr'*
+'graphic' vi_diff.txt /*'graphic'*
+'grepformat' options.txt /*'grepformat'*
+'grepprg' options.txt /*'grepprg'*
+'guicursor' options.txt /*'guicursor'*
+'guifont' options.txt /*'guifont'*
+'guifontset' options.txt /*'guifontset'*
+'guifontwide' options.txt /*'guifontwide'*
+'guiheadroom' options.txt /*'guiheadroom'*
+'guioptions' options.txt /*'guioptions'*
+'guipty' options.txt /*'guipty'*
+'hardtabs' vi_diff.txt /*'hardtabs'*
+'helpfile' options.txt /*'helpfile'*
+'helpheight' options.txt /*'helpheight'*
+'helplang' options.txt /*'helplang'*
+'hf' options.txt /*'hf'*
+'hh' options.txt /*'hh'*
+'hi' options.txt /*'hi'*
+'hid' options.txt /*'hid'*
+'hidden' options.txt /*'hidden'*
+'highlight' options.txt /*'highlight'*
+'history' options.txt /*'history'*
+'hk' options.txt /*'hk'*
+'hkmap' options.txt /*'hkmap'*
+'hkmapp' options.txt /*'hkmapp'*
+'hkp' options.txt /*'hkp'*
+'hl' options.txt /*'hl'*
+'hlg' options.txt /*'hlg'*
+'hls' options.txt /*'hls'*
+'hlsearch' options.txt /*'hlsearch'*
+'ht' vi_diff.txt /*'ht'*
+'ic' options.txt /*'ic'*
+'icon' options.txt /*'icon'*
+'iconstring' options.txt /*'iconstring'*
+'ignorecase' options.txt /*'ignorecase'*
+'im' options.txt /*'im'*
+'imactivatekey' options.txt /*'imactivatekey'*
+'imak' options.txt /*'imak'*
+'imc' options.txt /*'imc'*
+'imcmdline' options.txt /*'imcmdline'*
+'imd' options.txt /*'imd'*
+'imdisable' options.txt /*'imdisable'*
+'imi' options.txt /*'imi'*
+'iminsert' options.txt /*'iminsert'*
+'ims' options.txt /*'ims'*
+'imsearch' options.txt /*'imsearch'*
+'inc' options.txt /*'inc'*
+'include' options.txt /*'include'*
+'includeexpr' options.txt /*'includeexpr'*
+'incsearch' options.txt /*'incsearch'*
+'inde' options.txt /*'inde'*
+'indentexpr' options.txt /*'indentexpr'*
+'indentkeys' options.txt /*'indentkeys'*
+'indk' options.txt /*'indk'*
+'inex' options.txt /*'inex'*
+'inf' options.txt /*'inf'*
+'infercase' options.txt /*'infercase'*
+'insertmode' options.txt /*'insertmode'*
+'is' options.txt /*'is'*
+'isf' options.txt /*'isf'*
+'isfname' options.txt /*'isfname'*
+'isi' options.txt /*'isi'*
+'isident' options.txt /*'isident'*
+'isk' options.txt /*'isk'*
+'iskeyword' options.txt /*'iskeyword'*
+'isp' options.txt /*'isp'*
+'isprint' options.txt /*'isprint'*
+'joinspaces' options.txt /*'joinspaces'*
+'js' options.txt /*'js'*
+'key' options.txt /*'key'*
+'keymap' options.txt /*'keymap'*
+'keymodel' options.txt /*'keymodel'*
+'keywordprg' options.txt /*'keywordprg'*
+'km' options.txt /*'km'*
+'kmp' options.txt /*'kmp'*
+'kp' options.txt /*'kp'*
+'langmap' options.txt /*'langmap'*
+'langmenu' options.txt /*'langmenu'*
+'laststatus' options.txt /*'laststatus'*
+'lazyredraw' options.txt /*'lazyredraw'*
+'lbr' options.txt /*'lbr'*
+'lcs' options.txt /*'lcs'*
+'linebreak' options.txt /*'linebreak'*
+'lines' options.txt /*'lines'*
+'linespace' options.txt /*'linespace'*
+'lisp' options.txt /*'lisp'*
+'lispwords' options.txt /*'lispwords'*
+'list' options.txt /*'list'*
+'listchars' options.txt /*'listchars'*
+'lm' options.txt /*'lm'*
+'lmap' options.txt /*'lmap'*
+'loadplugins' options.txt /*'loadplugins'*
+'lpl' options.txt /*'lpl'*
+'ls' options.txt /*'ls'*
+'lsp' options.txt /*'lsp'*
+'lw' options.txt /*'lw'*
+'lz' options.txt /*'lz'*
+'ma' options.txt /*'ma'*
+'magic' options.txt /*'magic'*
+'makeef' options.txt /*'makeef'*
+'makeprg' options.txt /*'makeprg'*
+'mat' options.txt /*'mat'*
+'matchpairs' options.txt /*'matchpairs'*
+'matchtime' options.txt /*'matchtime'*
+'maxfuncdepth' options.txt /*'maxfuncdepth'*
+'maxmapdepth' options.txt /*'maxmapdepth'*
+'maxmem' options.txt /*'maxmem'*
+'maxmemtot' options.txt /*'maxmemtot'*
+'mef' options.txt /*'mef'*
+'menuitems' options.txt /*'menuitems'*
+'mesg' vi_diff.txt /*'mesg'*
+'mfd' options.txt /*'mfd'*
+'mh' options.txt /*'mh'*
+'mis' options.txt /*'mis'*
+'ml' options.txt /*'ml'*
+'mls' options.txt /*'mls'*
+'mm' options.txt /*'mm'*
+'mmd' options.txt /*'mmd'*
+'mmt' options.txt /*'mmt'*
+'mod' options.txt /*'mod'*
+'modeline' options.txt /*'modeline'*
+'modelines' options.txt /*'modelines'*
+'modifiable' options.txt /*'modifiable'*
+'modified' options.txt /*'modified'*
+'more' options.txt /*'more'*
+'mouse' options.txt /*'mouse'*
+'mousef' options.txt /*'mousef'*
+'mousefocus' options.txt /*'mousefocus'*
+'mousehide' options.txt /*'mousehide'*
+'mousem' options.txt /*'mousem'*
+'mousemodel' options.txt /*'mousemodel'*
+'mouses' options.txt /*'mouses'*
+'mouseshape' options.txt /*'mouseshape'*
+'mouset' options.txt /*'mouset'*
+'mousetime' options.txt /*'mousetime'*
+'mp' options.txt /*'mp'*
+'mps' options.txt /*'mps'*
+'nf' options.txt /*'nf'*
+'noacd' options.txt /*'noacd'*
+'noai' options.txt /*'noai'*
+'noakm' options.txt /*'noakm'*
+'noallowrevins' options.txt /*'noallowrevins'*
+'noaltkeymap' options.txt /*'noaltkeymap'*
+'noanti' options.txt /*'noanti'*
+'noantialias' options.txt /*'noantialias'*
+'noar' options.txt /*'noar'*
+'noarab' options.txt /*'noarab'*
+'noarabic' options.txt /*'noarabic'*
+'noarabicshape' options.txt /*'noarabicshape'*
+'noari' options.txt /*'noari'*
+'noarshape' options.txt /*'noarshape'*
+'noas' todo.txt /*'noas'*
+'noautochdir' options.txt /*'noautochdir'*
+'noautoindent' options.txt /*'noautoindent'*
+'noautoread' options.txt /*'noautoread'*
+'noautosave' todo.txt /*'noautosave'*
+'noautowrite' options.txt /*'noautowrite'*
+'noautowriteall' options.txt /*'noautowriteall'*
+'noaw' options.txt /*'noaw'*
+'noawa' options.txt /*'noawa'*
+'nobackup' options.txt /*'nobackup'*
+'noballooneval' options.txt /*'noballooneval'*
+'nobeval' options.txt /*'nobeval'*
+'nobin' options.txt /*'nobin'*
+'nobinary' options.txt /*'nobinary'*
+'nobiosk' options.txt /*'nobiosk'*
+'nobioskey' options.txt /*'nobioskey'*
+'nobk' options.txt /*'nobk'*
+'nobl' options.txt /*'nobl'*
+'nobomb' options.txt /*'nobomb'*
+'nobuflisted' options.txt /*'nobuflisted'*
+'nocf' options.txt /*'nocf'*
+'noci' options.txt /*'noci'*
+'nocin' options.txt /*'nocin'*
+'nocindent' options.txt /*'nocindent'*
+'nocompatible' options.txt /*'nocompatible'*
+'noconfirm' options.txt /*'noconfirm'*
+'noconsk' options.txt /*'noconsk'*
+'noconskey' options.txt /*'noconskey'*
+'nocopyindent' options.txt /*'nocopyindent'*
+'nocp' options.txt /*'nocp'*
+'nocscopetag' options.txt /*'nocscopetag'*
+'nocscopeverbose' options.txt /*'nocscopeverbose'*
+'nocst' options.txt /*'nocst'*
+'nocsverb' options.txt /*'nocsverb'*
+'nodeco' options.txt /*'nodeco'*
+'nodelcombine' options.txt /*'nodelcombine'*
+'nodg' options.txt /*'nodg'*
+'nodiff' options.txt /*'nodiff'*
+'nodigraph' options.txt /*'nodigraph'*
+'nodisable' options.txt /*'nodisable'*
+'noea' options.txt /*'noea'*
+'noeb' options.txt /*'noeb'*
+'noed' options.txt /*'noed'*
+'noedcompatible' options.txt /*'noedcompatible'*
+'noek' options.txt /*'noek'*
+'noendofline' options.txt /*'noendofline'*
+'noeol' options.txt /*'noeol'*
+'noequalalways' options.txt /*'noequalalways'*
+'noerrorbells' options.txt /*'noerrorbells'*
+'noesckeys' options.txt /*'noesckeys'*
+'noet' options.txt /*'noet'*
+'noex' options.txt /*'noex'*
+'noexpandtab' options.txt /*'noexpandtab'*
+'noexrc' options.txt /*'noexrc'*
+'nofen' options.txt /*'nofen'*
+'nofk' options.txt /*'nofk'*
+'nofkmap' options.txt /*'nofkmap'*
+'nofoldenable' options.txt /*'nofoldenable'*
+'nogd' options.txt /*'nogd'*
+'nogdefault' options.txt /*'nogdefault'*
+'noguipty' options.txt /*'noguipty'*
+'nohid' options.txt /*'nohid'*
+'nohidden' options.txt /*'nohidden'*
+'nohk' options.txt /*'nohk'*
+'nohkmap' options.txt /*'nohkmap'*
+'nohkmapp' options.txt /*'nohkmapp'*
+'nohkp' options.txt /*'nohkp'*
+'nohls' options.txt /*'nohls'*
+'nohlsearch' options.txt /*'nohlsearch'*
+'noic' options.txt /*'noic'*
+'noicon' options.txt /*'noicon'*
+'noignorecase' options.txt /*'noignorecase'*
+'noim' options.txt /*'noim'*
+'noimc' options.txt /*'noimc'*
+'noimcmdline' options.txt /*'noimcmdline'*
+'noimd' options.txt /*'noimd'*
+'noincsearch' options.txt /*'noincsearch'*
+'noinf' options.txt /*'noinf'*
+'noinfercase' options.txt /*'noinfercase'*
+'noinsertmode' options.txt /*'noinsertmode'*
+'nois' options.txt /*'nois'*
+'nojoinspaces' options.txt /*'nojoinspaces'*
+'nojs' options.txt /*'nojs'*
+'nolazyredraw' options.txt /*'nolazyredraw'*
+'nolbr' options.txt /*'nolbr'*
+'nolinebreak' options.txt /*'nolinebreak'*
+'nolisp' options.txt /*'nolisp'*
+'nolist' options.txt /*'nolist'*
+'noloadplugins' options.txt /*'noloadplugins'*
+'nolpl' options.txt /*'nolpl'*
+'nolz' options.txt /*'nolz'*
+'noma' options.txt /*'noma'*
+'nomagic' options.txt /*'nomagic'*
+'nomh' options.txt /*'nomh'*
+'noml' options.txt /*'noml'*
+'nomod' options.txt /*'nomod'*
+'nomodeline' options.txt /*'nomodeline'*
+'nomodifiable' options.txt /*'nomodifiable'*
+'nomodified' options.txt /*'nomodified'*
+'nomore' options.txt /*'nomore'*
+'nomousef' options.txt /*'nomousef'*
+'nomousefocus' options.txt /*'nomousefocus'*
+'nomousehide' options.txt /*'nomousehide'*
+'nonu' options.txt /*'nonu'*
+'nonumber' options.txt /*'nonumber'*
+'nopaste' options.txt /*'nopaste'*
+'nopi' options.txt /*'nopi'*
+'nopreserveindent' options.txt /*'nopreserveindent'*
+'nopreviewwindow' options.txt /*'nopreviewwindow'*
+'nopvw' options.txt /*'nopvw'*
+'noreadonly' options.txt /*'noreadonly'*
+'noremap' options.txt /*'noremap'*
+'norestorescreen' options.txt /*'norestorescreen'*
+'norevins' options.txt /*'norevins'*
+'nori' options.txt /*'nori'*
+'norightleft' options.txt /*'norightleft'*
+'norightleftcmd' options.txt /*'norightleftcmd'*
+'norl' options.txt /*'norl'*
+'norlc' options.txt /*'norlc'*
+'noro' options.txt /*'noro'*
+'nors' options.txt /*'nors'*
+'noru' options.txt /*'noru'*
+'noruler' options.txt /*'noruler'*
+'nosb' options.txt /*'nosb'*
+'nosc' options.txt /*'nosc'*
+'noscb' options.txt /*'noscb'*
+'noscrollbind' options.txt /*'noscrollbind'*
+'noscs' options.txt /*'noscs'*
+'nosecure' options.txt /*'nosecure'*
+'nosft' options.txt /*'nosft'*
+'noshellslash' options.txt /*'noshellslash'*
+'noshiftround' options.txt /*'noshiftround'*
+'noshortname' options.txt /*'noshortname'*
+'noshowcmd' options.txt /*'noshowcmd'*
+'noshowfulltag' options.txt /*'noshowfulltag'*
+'noshowmatch' options.txt /*'noshowmatch'*
+'noshowmode' options.txt /*'noshowmode'*
+'nosi' options.txt /*'nosi'*
+'nosm' options.txt /*'nosm'*
+'nosmartcase' options.txt /*'nosmartcase'*
+'nosmartindent' options.txt /*'nosmartindent'*
+'nosmarttab' options.txt /*'nosmarttab'*
+'nosmd' options.txt /*'nosmd'*
+'nosn' options.txt /*'nosn'*
+'nosol' options.txt /*'nosol'*
+'nosplitbelow' options.txt /*'nosplitbelow'*
+'nosplitright' options.txt /*'nosplitright'*
+'nospr' options.txt /*'nospr'*
+'nosr' options.txt /*'nosr'*
+'nossl' options.txt /*'nossl'*
+'nosta' options.txt /*'nosta'*
+'nostartofline' options.txt /*'nostartofline'*
+'noswapfile' options.txt /*'noswapfile'*
+'noswf' options.txt /*'noswf'*
+'nota' options.txt /*'nota'*
+'notagbsearch' options.txt /*'notagbsearch'*
+'notagrelative' options.txt /*'notagrelative'*
+'notagstack' options.txt /*'notagstack'*
+'notbi' options.txt /*'notbi'*
+'notbidi' options.txt /*'notbidi'*
+'notbs' options.txt /*'notbs'*
+'notermbidi' options.txt /*'notermbidi'*
+'noterse' options.txt /*'noterse'*
+'notextauto' options.txt /*'notextauto'*
+'notextmode' options.txt /*'notextmode'*
+'notf' options.txt /*'notf'*
+'notgst' options.txt /*'notgst'*
+'notildeop' options.txt /*'notildeop'*
+'notimeout' options.txt /*'notimeout'*
+'notitle' options.txt /*'notitle'*
+'noto' options.txt /*'noto'*
+'notop' options.txt /*'notop'*
+'notr' options.txt /*'notr'*
+'nottimeout' options.txt /*'nottimeout'*
+'nottybuiltin' options.txt /*'nottybuiltin'*
+'nottyfast' options.txt /*'nottyfast'*
+'notx' options.txt /*'notx'*
+'novb' options.txt /*'novb'*
+'novice' vi_diff.txt /*'novice'*
+'novisualbell' options.txt /*'novisualbell'*
+'nowa' options.txt /*'nowa'*
+'nowarn' options.txt /*'nowarn'*
+'nowb' options.txt /*'nowb'*
+'noweirdinvert' options.txt /*'noweirdinvert'*
+'nowfh' options.txt /*'nowfh'*
+'nowildmenu' options.txt /*'nowildmenu'*
+'nowinfixheight' options.txt /*'nowinfixheight'*
+'nowiv' options.txt /*'nowiv'*
+'nowmnu' options.txt /*'nowmnu'*
+'nowrap' options.txt /*'nowrap'*
+'nowrapscan' options.txt /*'nowrapscan'*
+'nowrite' options.txt /*'nowrite'*
+'nowriteany' options.txt /*'nowriteany'*
+'nowritebackup' options.txt /*'nowritebackup'*
+'nows' options.txt /*'nows'*
+'nrformats' options.txt /*'nrformats'*
+'nu' options.txt /*'nu'*
+'number' options.txt /*'number'*
+'oft' options.txt /*'oft'*
+'op' vi_diff.txt /*'op'*
+'open' vi_diff.txt /*'open'*
+'optimize' vi_diff.txt /*'optimize'*
+'option' intro.txt /*'option'*
+'osfiletype' options.txt /*'osfiletype'*
+'pa' options.txt /*'pa'*
+'para' options.txt /*'para'*
+'paragraphs' options.txt /*'paragraphs'*
+'paste' options.txt /*'paste'*
+'pastetoggle' options.txt /*'pastetoggle'*
+'patchexpr' options.txt /*'patchexpr'*
+'patchmode' options.txt /*'patchmode'*
+'path' options.txt /*'path'*
+'pdev' options.txt /*'pdev'*
+'penc' options.txt /*'penc'*
+'pex' options.txt /*'pex'*
+'pexpr' options.txt /*'pexpr'*
+'pfn' options.txt /*'pfn'*
+'pheader' options.txt /*'pheader'*
+'pi' options.txt /*'pi'*
+'pm' options.txt /*'pm'*
+'popt' options.txt /*'popt'*
+'preserveindent' options.txt /*'preserveindent'*
+'previewheight' options.txt /*'previewheight'*
+'previewwindow' options.txt /*'previewwindow'*
+'printdevice' options.txt /*'printdevice'*
+'printencoding' options.txt /*'printencoding'*
+'printexpr' options.txt /*'printexpr'*
+'printfont' options.txt /*'printfont'*
+'printheader' options.txt /*'printheader'*
+'printoptions' options.txt /*'printoptions'*
+'prompt' vi_diff.txt /*'prompt'*
+'pt' options.txt /*'pt'*
+'pvh' options.txt /*'pvh'*
+'pvw' options.txt /*'pvw'*
+'quote motion.txt /*'quote*
+'readonly' options.txt /*'readonly'*
+'redraw' vi_diff.txt /*'redraw'*
+'remap' options.txt /*'remap'*
+'report' options.txt /*'report'*
+'restorescreen' options.txt /*'restorescreen'*
+'revins' options.txt /*'revins'*
+'ri' options.txt /*'ri'*
+'rightleft' options.txt /*'rightleft'*
+'rightleftcmd' options.txt /*'rightleftcmd'*
+'rl' options.txt /*'rl'*
+'rlc' options.txt /*'rlc'*
+'ro' options.txt /*'ro'*
+'rs' options.txt /*'rs'*
+'rtp' options.txt /*'rtp'*
+'ru' options.txt /*'ru'*
+'ruf' options.txt /*'ruf'*
+'ruler' options.txt /*'ruler'*
+'rulerformat' options.txt /*'rulerformat'*
+'runtimepath' options.txt /*'runtimepath'*
+'sb' options.txt /*'sb'*
+'sbo' options.txt /*'sbo'*
+'sbr' options.txt /*'sbr'*
+'sc' options.txt /*'sc'*
+'scb' options.txt /*'scb'*
+'scr' options.txt /*'scr'*
+'scroll' options.txt /*'scroll'*
+'scrollbind' options.txt /*'scrollbind'*
+'scrolljump' options.txt /*'scrolljump'*
+'scrolloff' options.txt /*'scrolloff'*
+'scrollopt' options.txt /*'scrollopt'*
+'scs' options.txt /*'scs'*
+'sect' options.txt /*'sect'*
+'sections' options.txt /*'sections'*
+'secure' options.txt /*'secure'*
+'sel' options.txt /*'sel'*
+'selection' options.txt /*'selection'*
+'selectmode' options.txt /*'selectmode'*
+'sessionoptions' options.txt /*'sessionoptions'*
+'sft' options.txt /*'sft'*
+'sh' options.txt /*'sh'*
+'shcf' options.txt /*'shcf'*
+'shell' options.txt /*'shell'*
+'shellcmdflag' options.txt /*'shellcmdflag'*
+'shellpipe' options.txt /*'shellpipe'*
+'shellquote' options.txt /*'shellquote'*
+'shellredir' options.txt /*'shellredir'*
+'shellslash' options.txt /*'shellslash'*
+'shelltype' options.txt /*'shelltype'*
+'shellxquote' options.txt /*'shellxquote'*
+'shiftround' options.txt /*'shiftround'*
+'shiftwidth' options.txt /*'shiftwidth'*
+'shm' options.txt /*'shm'*
+'shortmess' options.txt /*'shortmess'*
+'shortname' options.txt /*'shortname'*
+'showbreak' options.txt /*'showbreak'*
+'showcmd' options.txt /*'showcmd'*
+'showfulltag' options.txt /*'showfulltag'*
+'showmatch' options.txt /*'showmatch'*
+'showmode' options.txt /*'showmode'*
+'shq' options.txt /*'shq'*
+'si' options.txt /*'si'*
+'sidescroll' options.txt /*'sidescroll'*
+'sidescrolloff' options.txt /*'sidescrolloff'*
+'siso' options.txt /*'siso'*
+'sj' options.txt /*'sj'*
+'slm' options.txt /*'slm'*
+'slow' vi_diff.txt /*'slow'*
+'slowopen' vi_diff.txt /*'slowopen'*
+'sm' options.txt /*'sm'*
+'smartcase' options.txt /*'smartcase'*
+'smartindent' options.txt /*'smartindent'*
+'smarttab' options.txt /*'smarttab'*
+'smd' options.txt /*'smd'*
+'sn' options.txt /*'sn'*
+'so' options.txt /*'so'*
+'softtabstop' options.txt /*'softtabstop'*
+'sol' options.txt /*'sol'*
+'sourceany' vi_diff.txt /*'sourceany'*
+'sp' options.txt /*'sp'*
+'splitbelow' options.txt /*'splitbelow'*
+'splitright' options.txt /*'splitright'*
+'spr' options.txt /*'spr'*
+'sr' options.txt /*'sr'*
+'srr' options.txt /*'srr'*
+'ss' options.txt /*'ss'*
+'ssl' options.txt /*'ssl'*
+'ssop' options.txt /*'ssop'*
+'st' options.txt /*'st'*
+'sta' options.txt /*'sta'*
+'startofline' options.txt /*'startofline'*
+'statusline' options.txt /*'statusline'*
+'stl' options.txt /*'stl'*
+'sts' options.txt /*'sts'*
+'su' options.txt /*'su'*
+'sua' options.txt /*'sua'*
+'suffixes' options.txt /*'suffixes'*
+'suffixesadd' options.txt /*'suffixesadd'*
+'sw' options.txt /*'sw'*
+'swapfile' options.txt /*'swapfile'*
+'swapsync' options.txt /*'swapsync'*
+'swb' options.txt /*'swb'*
+'swf' options.txt /*'swf'*
+'switchbuf' options.txt /*'switchbuf'*
+'sws' options.txt /*'sws'*
+'sxq' options.txt /*'sxq'*
+'syn' options.txt /*'syn'*
+'syntax' options.txt /*'syntax'*
+'t_#2' term.txt /*'t_#2'*
+'t_#4' term.txt /*'t_#4'*
+'t_%1' term.txt /*'t_%1'*
+'t_%i' term.txt /*'t_%i'*
+'t_&8' term.txt /*'t_&8'*
+'t_@7' term.txt /*'t_@7'*
+'t_AB' term.txt /*'t_AB'*
+'t_AF' term.txt /*'t_AF'*
+'t_AL' term.txt /*'t_AL'*
+'t_CS' term.txt /*'t_CS'*
+'t_CV' term.txt /*'t_CV'*
+'t_Co' term.txt /*'t_Co'*
+'t_DL' term.txt /*'t_DL'*
+'t_F1' term.txt /*'t_F1'*
+'t_F2' term.txt /*'t_F2'*
+'t_F3' term.txt /*'t_F3'*
+'t_F4' term.txt /*'t_F4'*
+'t_F5' term.txt /*'t_F5'*
+'t_F6' term.txt /*'t_F6'*
+'t_F7' term.txt /*'t_F7'*
+'t_F8' term.txt /*'t_F8'*
+'t_F9' term.txt /*'t_F9'*
+'t_IE' term.txt /*'t_IE'*
+'t_IS' term.txt /*'t_IS'*
+'t_K1' term.txt /*'t_K1'*
+'t_K3' term.txt /*'t_K3'*
+'t_K4' term.txt /*'t_K4'*
+'t_K5' term.txt /*'t_K5'*
+'t_K6' term.txt /*'t_K6'*
+'t_K7' term.txt /*'t_K7'*
+'t_K8' term.txt /*'t_K8'*
+'t_K9' term.txt /*'t_K9'*
+'t_KA' term.txt /*'t_KA'*
+'t_KB' term.txt /*'t_KB'*
+'t_KC' term.txt /*'t_KC'*
+'t_KD' term.txt /*'t_KD'*
+'t_KE' term.txt /*'t_KE'*
+'t_KF' term.txt /*'t_KF'*
+'t_KG' term.txt /*'t_KG'*
+'t_KH' term.txt /*'t_KH'*
+'t_KI' term.txt /*'t_KI'*
+'t_KJ' term.txt /*'t_KJ'*
+'t_KK' term.txt /*'t_KK'*
+'t_KL' term.txt /*'t_KL'*
+'t_RI' term.txt /*'t_RI'*
+'t_RV' term.txt /*'t_RV'*
+'t_Sb' term.txt /*'t_Sb'*
+'t_Sf' term.txt /*'t_Sf'*
+'t_WP' term.txt /*'t_WP'*
+'t_WS' term.txt /*'t_WS'*
+'t_ZH' term.txt /*'t_ZH'*
+'t_ZR' term.txt /*'t_ZR'*
+'t_al' term.txt /*'t_al'*
+'t_bc' term.txt /*'t_bc'*
+'t_cd' term.txt /*'t_cd'*
+'t_ce' term.txt /*'t_ce'*
+'t_cl' term.txt /*'t_cl'*
+'t_cm' term.txt /*'t_cm'*
+'t_cs' term.txt /*'t_cs'*
+'t_da' term.txt /*'t_da'*
+'t_db' term.txt /*'t_db'*
+'t_dl' term.txt /*'t_dl'*
+'t_fs' term.txt /*'t_fs'*
+'t_k1' term.txt /*'t_k1'*
+'t_k2' term.txt /*'t_k2'*
+'t_k3' term.txt /*'t_k3'*
+'t_k4' term.txt /*'t_k4'*
+'t_k5' term.txt /*'t_k5'*
+'t_k6' term.txt /*'t_k6'*
+'t_k7' term.txt /*'t_k7'*
+'t_k8' term.txt /*'t_k8'*
+'t_k9' term.txt /*'t_k9'*
+'t_k;' term.txt /*'t_k;'*
+'t_kB' term.txt /*'t_kB'*
+'t_kD' term.txt /*'t_kD'*
+'t_kI' term.txt /*'t_kI'*
+'t_kN' term.txt /*'t_kN'*
+'t_kP' term.txt /*'t_kP'*
+'t_kb' term.txt /*'t_kb'*
+'t_kd' term.txt /*'t_kd'*
+'t_ke' term.txt /*'t_ke'*
+'t_kh' term.txt /*'t_kh'*
+'t_kl' term.txt /*'t_kl'*
+'t_kr' term.txt /*'t_kr'*
+'t_ks' term.txt /*'t_ks'*
+'t_ku' term.txt /*'t_ku'*
+'t_le' term.txt /*'t_le'*
+'t_mb' term.txt /*'t_mb'*
+'t_md' term.txt /*'t_md'*
+'t_me' term.txt /*'t_me'*
+'t_mr' term.txt /*'t_mr'*
+'t_ms' term.txt /*'t_ms'*
+'t_nd' term.txt /*'t_nd'*
+'t_op' term.txt /*'t_op'*
+'t_se' term.txt /*'t_se'*
+'t_so' term.txt /*'t_so'*
+'t_sr' term.txt /*'t_sr'*
+'t_star7' term.txt /*'t_star7'*
+'t_te' term.txt /*'t_te'*
+'t_ti' term.txt /*'t_ti'*
+'t_ts' term.txt /*'t_ts'*
+'t_ue' term.txt /*'t_ue'*
+'t_us' term.txt /*'t_us'*
+'t_ut' term.txt /*'t_ut'*
+'t_vb' term.txt /*'t_vb'*
+'t_ve' term.txt /*'t_ve'*
+'t_vi' term.txt /*'t_vi'*
+'t_vs' term.txt /*'t_vs'*
+'t_xs' term.txt /*'t_xs'*
+'ta' options.txt /*'ta'*
+'tabstop' options.txt /*'tabstop'*
+'tag' options.txt /*'tag'*
+'tagbsearch' options.txt /*'tagbsearch'*
+'taglength' options.txt /*'taglength'*
+'tagrelative' options.txt /*'tagrelative'*
+'tags' options.txt /*'tags'*
+'tagstack' options.txt /*'tagstack'*
+'tb' options.txt /*'tb'*
+'tbi' options.txt /*'tbi'*
+'tbidi' options.txt /*'tbidi'*
+'tbis' options.txt /*'tbis'*
+'tbs' options.txt /*'tbs'*
+'tenc' options.txt /*'tenc'*
+'term' options.txt /*'term'*
+'termbidi' options.txt /*'termbidi'*
+'termencoding' options.txt /*'termencoding'*
+'terse' options.txt /*'terse'*
+'textauto' options.txt /*'textauto'*
+'textmode' options.txt /*'textmode'*
+'textwidth' options.txt /*'textwidth'*
+'tf' options.txt /*'tf'*
+'tgst' options.txt /*'tgst'*
+'thesaurus' options.txt /*'thesaurus'*
+'tildeop' options.txt /*'tildeop'*
+'timeout' options.txt /*'timeout'*
+'timeoutlen' options.txt /*'timeoutlen'*
+'title' options.txt /*'title'*
+'titlelen' options.txt /*'titlelen'*
+'titleold' options.txt /*'titleold'*
+'titlestring' options.txt /*'titlestring'*
+'tl' options.txt /*'tl'*
+'tm' options.txt /*'tm'*
+'to' options.txt /*'to'*
+'toolbar' options.txt /*'toolbar'*
+'toolbariconsize' options.txt /*'toolbariconsize'*
+'top' options.txt /*'top'*
+'tr' options.txt /*'tr'*
+'ts' options.txt /*'ts'*
+'tsl' options.txt /*'tsl'*
+'tsr' options.txt /*'tsr'*
+'ttimeout' options.txt /*'ttimeout'*
+'ttimeoutlen' options.txt /*'ttimeoutlen'*
+'ttm' options.txt /*'ttm'*
+'tty' options.txt /*'tty'*
+'ttybuiltin' options.txt /*'ttybuiltin'*
+'ttyfast' options.txt /*'ttyfast'*
+'ttym' options.txt /*'ttym'*
+'ttymouse' options.txt /*'ttymouse'*
+'ttyscroll' options.txt /*'ttyscroll'*
+'ttytype' options.txt /*'ttytype'*
+'tw' options.txt /*'tw'*
+'tx' options.txt /*'tx'*
+'uc' options.txt /*'uc'*
+'ul' options.txt /*'ul'*
+'undolevels' options.txt /*'undolevels'*
+'updatecount' options.txt /*'updatecount'*
+'updatetime' options.txt /*'updatetime'*
+'ut' options.txt /*'ut'*
+'vb' options.txt /*'vb'*
+'vbs' options.txt /*'vbs'*
+'vdir' options.txt /*'vdir'*
+'ve' options.txt /*'ve'*
+'verbose' options.txt /*'verbose'*
+'vi' options.txt /*'vi'*
+'viewdir' options.txt /*'viewdir'*
+'viewoptions' options.txt /*'viewoptions'*
+'viminfo' options.txt /*'viminfo'*
+'virtualedit' options.txt /*'virtualedit'*
+'visualbell' options.txt /*'visualbell'*
+'vop' options.txt /*'vop'*
+'w1200' vi_diff.txt /*'w1200'*
+'w300' vi_diff.txt /*'w300'*
+'w9600' vi_diff.txt /*'w9600'*
+'wa' options.txt /*'wa'*
+'wak' options.txt /*'wak'*
+'warn' options.txt /*'warn'*
+'wb' options.txt /*'wb'*
+'wc' options.txt /*'wc'*
+'wcm' options.txt /*'wcm'*
+'wd' options.txt /*'wd'*
+'weirdinvert' options.txt /*'weirdinvert'*
+'wfh' options.txt /*'wfh'*
+'wh' options.txt /*'wh'*
+'whichwrap' options.txt /*'whichwrap'*
+'wi' vi_diff.txt /*'wi'*
+'wig' options.txt /*'wig'*
+'wildchar' options.txt /*'wildchar'*
+'wildcharm' options.txt /*'wildcharm'*
+'wildignore' options.txt /*'wildignore'*
+'wildmenu' options.txt /*'wildmenu'*
+'wildmode' options.txt /*'wildmode'*
+'wim' options.txt /*'wim'*
+'winaltkeys' options.txt /*'winaltkeys'*
+'window' vi_diff.txt /*'window'*
+'winfixheight' options.txt /*'winfixheight'*
+'winheight' options.txt /*'winheight'*
+'winminheight' options.txt /*'winminheight'*
+'winminwidth' options.txt /*'winminwidth'*
+'winwidth' options.txt /*'winwidth'*
+'wiv' options.txt /*'wiv'*
+'wiw' options.txt /*'wiw'*
+'wm' options.txt /*'wm'*
+'wmh' options.txt /*'wmh'*
+'wmnu' options.txt /*'wmnu'*
+'wmw' options.txt /*'wmw'*
+'wrap' options.txt /*'wrap'*
+'wrapmargin' options.txt /*'wrapmargin'*
+'wrapscan' options.txt /*'wrapscan'*
+'write' options.txt /*'write'*
+'writeany' options.txt /*'writeany'*
+'writebackup' options.txt /*'writebackup'*
+'writedelay' options.txt /*'writedelay'*
+'ws' options.txt /*'ws'*
+'ww' options.txt /*'ww'*
+'{ motion.txt /*'{*
+'} motion.txt /*'}*
+( motion.txt /*(*
+) motion.txt /*)*
++ motion.txt /*+*
+++bin editing.txt /*++bin*
+++builtin_terms various.txt /*++builtin_terms*
+++enc editing.txt /*++enc*
+++ff editing.txt /*++ff*
+++nobin editing.txt /*++nobin*
+++opt editing.txt /*++opt*
++ARP various.txt /*+ARP*
++GUI_Athena various.txt /*+GUI_Athena*
++GUI_BeOS various.txt /*+GUI_BeOS*
++GUI_GTK various.txt /*+GUI_GTK*
++GUI_Motif various.txt /*+GUI_Motif*
++GUI_Photon various.txt /*+GUI_Photon*
++GUI_neXtaw various.txt /*+GUI_neXtaw*
++X11 various.txt /*+X11*
++arabic various.txt /*+arabic*
++autocmd various.txt /*+autocmd*
++balloon_eval various.txt /*+balloon_eval*
++browse various.txt /*+browse*
++builtin_terms various.txt /*+builtin_terms*
++byte_offset various.txt /*+byte_offset*
++cindent various.txt /*+cindent*
++clientserver various.txt /*+clientserver*
++clipboard various.txt /*+clipboard*
++cmd editing.txt /*+cmd*
++cmdline_compl various.txt /*+cmdline_compl*
++cmdline_hist various.txt /*+cmdline_hist*
++cmdline_info various.txt /*+cmdline_info*
++comments various.txt /*+comments*
++cryptv various.txt /*+cryptv*
++cscope various.txt /*+cscope*
++dialog_con various.txt /*+dialog_con*
++dialog_con_gui various.txt /*+dialog_con_gui*
++dialog_gui various.txt /*+dialog_gui*
++diff various.txt /*+diff*
++digraphs various.txt /*+digraphs*
++dnd various.txt /*+dnd*
++emacs_tags various.txt /*+emacs_tags*
++eval various.txt /*+eval*
++ex_extra various.txt /*+ex_extra*
++extra_search various.txt /*+extra_search*
++farsi various.txt /*+farsi*
++feature-list various.txt /*+feature-list*
++file_in_path various.txt /*+file_in_path*
++find_in_path various.txt /*+find_in_path*
++folding various.txt /*+folding*
++footer various.txt /*+footer*
++fork various.txt /*+fork*
++gettext various.txt /*+gettext*
++hangul_input various.txt /*+hangul_input*
++iconv various.txt /*+iconv*
++insert_expand various.txt /*+insert_expand*
++jumplist various.txt /*+jumplist*
++keymap various.txt /*+keymap*
++langmap various.txt /*+langmap*
++libcall various.txt /*+libcall*
++linebreak various.txt /*+linebreak*
++lispindent various.txt /*+lispindent*
++listcmds various.txt /*+listcmds*
++localmap various.txt /*+localmap*
++menu various.txt /*+menu*
++mksession various.txt /*+mksession*
++modify_fname various.txt /*+modify_fname*
++mouse various.txt /*+mouse*
++mouse_dec various.txt /*+mouse_dec*
++mouse_gpm various.txt /*+mouse_gpm*
++mouse_netterm various.txt /*+mouse_netterm*
++mouse_pterm various.txt /*+mouse_pterm*
++mouse_xterm various.txt /*+mouse_xterm*
++mouseshape various.txt /*+mouseshape*
++multi_byte various.txt /*+multi_byte*
++multi_byte_ime various.txt /*+multi_byte_ime*
++multi_lang various.txt /*+multi_lang*
++netbeans_intg various.txt /*+netbeans_intg*
++ole various.txt /*+ole*
++osfiletype various.txt /*+osfiletype*
++path_extra various.txt /*+path_extra*
++perl various.txt /*+perl*
++postscript various.txt /*+postscript*
++printer various.txt /*+printer*
++python various.txt /*+python*
++quickfix various.txt /*+quickfix*
++rightleft various.txt /*+rightleft*
++ruby various.txt /*+ruby*
++scrollbind various.txt /*+scrollbind*
++signs various.txt /*+signs*
++smartindent various.txt /*+smartindent*
++sniff various.txt /*+sniff*
++statusline various.txt /*+statusline*
++sun_workshop various.txt /*+sun_workshop*
++syntax various.txt /*+syntax*
++system() various.txt /*+system()*
++tag_any_white various.txt /*+tag_any_white*
++tag_binary various.txt /*+tag_binary*
++tag_old_static various.txt /*+tag_old_static*
++tcl various.txt /*+tcl*
++terminfo various.txt /*+terminfo*
++termresponse various.txt /*+termresponse*
++textobjects various.txt /*+textobjects*
++tgetent various.txt /*+tgetent*
++title various.txt /*+title*
++toolbar various.txt /*+toolbar*
++user_commands various.txt /*+user_commands*
++vertsplit various.txt /*+vertsplit*
++viminfo various.txt /*+viminfo*
++virtualedit various.txt /*+virtualedit*
++visual various.txt /*+visual*
++visualextra various.txt /*+visualextra*
++vreplace various.txt /*+vreplace*
++wildignore various.txt /*+wildignore*
++wildmenu various.txt /*+wildmenu*
++windows various.txt /*+windows*
++writebackup various.txt /*+writebackup*
++xfontset various.txt /*+xfontset*
++xim various.txt /*+xim*
++xsmp various.txt /*+xsmp*
++xsmp_interact various.txt /*+xsmp_interact*
++xterm_clipboard various.txt /*+xterm_clipboard*
++xterm_save various.txt /*+xterm_save*
+, motion.txt /*,*
+- motion.txt /*-*
+-+ starting.txt /*-+*
+-+/ starting.txt /*-+\/*
+-+c starting.txt /*-+c*
+-+reverse gui_x11.txt /*-+reverse*
+-+rv gui_x11.txt /*-+rv*
+-- starting.txt /*--*
+--- starting.txt /*---*
+--cmd starting.txt /*--cmd*
+--echo-wid starting.txt /*--echo-wid*
+--help starting.txt /*--help*
+--literal starting.txt /*--literal*
+--nofork starting.txt /*--nofork*
+--noplugin starting.txt /*--noplugin*
+--remote remote.txt /*--remote*
+--remote-expr remote.txt /*--remote-expr*
+--remote-send remote.txt /*--remote-send*
+--remote-silent remote.txt /*--remote-silent*
+--remote-wait remote.txt /*--remote-wait*
+--remote-wait-silent remote.txt /*--remote-wait-silent*
+--role starting.txt /*--role*
+--serverlist remote.txt /*--serverlist*
+--servername remote.txt /*--servername*
+--socketid starting.txt /*--socketid*
+--version starting.txt /*--version*
+-A starting.txt /*-A*
+-C starting.txt /*-C*
+-D starting.txt /*-D*
+-E starting.txt /*-E*
+-F starting.txt /*-F*
+-H starting.txt /*-H*
+-L starting.txt /*-L*
+-M starting.txt /*-M*
+-N starting.txt /*-N*
+-O starting.txt /*-O*
+-P starting.txt /*-P*
+-R starting.txt /*-R*
+-S starting.txt /*-S*
+-T starting.txt /*-T*
+-U starting.txt /*-U*
+-V starting.txt /*-V*
+-W starting.txt /*-W*
+-X starting.txt /*-X*
+-Z starting.txt /*-Z*
+-b starting.txt /*-b*
+-background gui_x11.txt /*-background*
+-bg gui_x11.txt /*-bg*
+-boldfont gui_x11.txt /*-boldfont*
+-borderwidth gui_x11.txt /*-borderwidth*
+-bw gui_x11.txt /*-bw*
+-c starting.txt /*-c*
+-d starting.txt /*-d*
+-dev starting.txt /*-dev*
+-display gui_x11.txt /*-display*
+-e starting.txt /*-e*
+-f starting.txt /*-f*
+-fg gui_x11.txt /*-fg*
+-file starting.txt /*-file*
+-fn gui_x11.txt /*-fn*
+-font gui_x11.txt /*-font*
+-foreground gui_x11.txt /*-foreground*
+-g starting.txt /*-g*
+-geom gui_x11.txt /*-geom*
+-geometry gui_x11.txt /*-geometry*
+-geometry-example gui_x11.txt /*-geometry-example*
+-gui gui_x11.txt /*-gui*
+-h starting.txt /*-h*
+-i starting.txt /*-i*
+-iconic gui_x11.txt /*-iconic*
+-italicfont gui_x11.txt /*-italicfont*
+-l starting.txt /*-l*
+-m starting.txt /*-m*
+-menufont gui_x11.txt /*-menufont*
+-menufontset gui_x11.txt /*-menufontset*
+-menuheight gui_x11.txt /*-menuheight*
+-mf gui_x11.txt /*-mf*
+-mh gui_x11.txt /*-mh*
+-n starting.txt /*-n*
+-nb starting.txt /*-nb*
+-o starting.txt /*-o*
+-q starting.txt /*-q*
+-qf starting.txt /*-qf*
+-r starting.txt /*-r*
+-register if_ole.txt /*-register*
+-reverse gui_x11.txt /*-reverse*
+-rv gui_x11.txt /*-rv*
+-s starting.txt /*-s*
+-s-ex starting.txt /*-s-ex*
+-scrollbarwidth gui_x11.txt /*-scrollbarwidth*
+-silent if_ole.txt /*-silent*
+-sw gui_x11.txt /*-sw*
+-t starting.txt /*-t*
+-tag starting.txt /*-tag*
+-u starting.txt /*-u*
+-ul gui_x11.txt /*-ul*
+-unregister if_ole.txt /*-unregister*
+-v starting.txt /*-v*
+-vim starting.txt /*-vim*
+-w starting.txt /*-w*
+-w_nr starting.txt /*-w_nr*
+-x starting.txt /*-x*
+-xrm gui_x11.txt /*-xrm*
+-y starting.txt /*-y*
+. repeat.txt /*.*
+.Xdefaults gui_x11.txt /*.Xdefaults*
+.exrc starting.txt /*.exrc*
+.gvimrc gui.txt /*.gvimrc*
+.vimrc starting.txt /*.vimrc*
+/ pattern.txt /*\/*
+/$ pattern.txt /*\/$*
+/. pattern.txt /*\/.*
+//; pattern.txt /*\/\/;*
+/<CR> pattern.txt /*\/<CR>*
+/[] pattern.txt /*\/[]*
+/\ pattern.txt /*\/\\*
+/\$ pattern.txt /*\/\\$*
+/\%# pattern.txt /*\/\\%#*
+/\%$ pattern.txt /*\/\\%$*
+/\%( pattern.txt /*\/\\%(*
+/\%(\) pattern.txt /*\/\\%(\\)*
+/\%<c pattern.txt /*\/\\%<c*
+/\%<l pattern.txt /*\/\\%<l*
+/\%<v pattern.txt /*\/\\%<v*
+/\%>c pattern.txt /*\/\\%>c*
+/\%>l pattern.txt /*\/\\%>l*
+/\%>v pattern.txt /*\/\\%>v*
+/\%[] pattern.txt /*\/\\%[]*
+/\%^ pattern.txt /*\/\\%^*
+/\%c pattern.txt /*\/\\%c*
+/\%l pattern.txt /*\/\\%l*
+/\%v pattern.txt /*\/\\%v*
+/\& pattern.txt /*\/\\&*
+/\( pattern.txt /*\/\\(*
+/\(\) pattern.txt /*\/\\(\\)*
+/\) pattern.txt /*\/\\)*
+/\+ pattern.txt /*\/\\+*
+/\. pattern.txt /*\/\\.*
+/\1 pattern.txt /*\/\\1*
+/\2 pattern.txt /*\/\\2*
+/\3 pattern.txt /*\/\\3*
+/\9 pattern.txt /*\/\\9*
+/\< pattern.txt /*\/\\<*
+/\= pattern.txt /*\/\\=*
+/\> pattern.txt /*\/\\>*
+/\? pattern.txt /*\/\\?*
+/\@! pattern.txt /*\/\\@!*
+/\@<! pattern.txt /*\/\\@<!*
+/\@<= pattern.txt /*\/\\@<=*
+/\@= pattern.txt /*\/\\@=*
+/\@> pattern.txt /*\/\\@>*
+/\A pattern.txt /*\/\\A*
+/\C pattern.txt /*\/\\C*
+/\D pattern.txt /*\/\\D*
+/\F pattern.txt /*\/\\F*
+/\H pattern.txt /*\/\\H*
+/\I pattern.txt /*\/\\I*
+/\K pattern.txt /*\/\\K*
+/\L pattern.txt /*\/\\L*
+/\M pattern.txt /*\/\\M*
+/\O pattern.txt /*\/\\O*
+/\P pattern.txt /*\/\\P*
+/\S pattern.txt /*\/\\S*
+/\U pattern.txt /*\/\\U*
+/\V pattern.txt /*\/\\V*
+/\W pattern.txt /*\/\\W*
+/\X pattern.txt /*\/\\X*
+/\Z pattern.txt /*\/\\Z*
+/\[] pattern.txt /*\/\\[]*
+/\\ pattern.txt /*\/\\\\*
+/\] pattern.txt /*\/\\]*
+/\^ pattern.txt /*\/\\^*
+/\_ pattern.txt /*\/\\_*
+/\_$ pattern.txt /*\/\\_$*
+/\_. pattern.txt /*\/\\_.*
+/\_A pattern.txt /*\/\\_A*
+/\_D pattern.txt /*\/\\_D*
+/\_F pattern.txt /*\/\\_F*
+/\_H pattern.txt /*\/\\_H*
+/\_I pattern.txt /*\/\\_I*
+/\_K pattern.txt /*\/\\_K*
+/\_L pattern.txt /*\/\\_L*
+/\_O pattern.txt /*\/\\_O*
+/\_P pattern.txt /*\/\\_P*
+/\_S pattern.txt /*\/\\_S*
+/\_U pattern.txt /*\/\\_U*
+/\_W pattern.txt /*\/\\_W*
+/\_X pattern.txt /*\/\\_X*
+/\_[] pattern.txt /*\/\\_[]*
+/\_^ pattern.txt /*\/\\_^*
+/\_a pattern.txt /*\/\\_a*
+/\_d pattern.txt /*\/\\_d*
+/\_f pattern.txt /*\/\\_f*
+/\_h pattern.txt /*\/\\_h*
+/\_i pattern.txt /*\/\\_i*
+/\_k pattern.txt /*\/\\_k*
+/\_l pattern.txt /*\/\\_l*
+/\_o pattern.txt /*\/\\_o*
+/\_p pattern.txt /*\/\\_p*
+/\_s pattern.txt /*\/\\_s*
+/\_u pattern.txt /*\/\\_u*
+/\_w pattern.txt /*\/\\_w*
+/\_x pattern.txt /*\/\\_x*
+/\a pattern.txt /*\/\\a*
+/\b pattern.txt /*\/\\b*
+/\bar pattern.txt /*\/\\bar*
+/\c pattern.txt /*\/\\c*
+/\d pattern.txt /*\/\\d*
+/\e pattern.txt /*\/\\e*
+/\f pattern.txt /*\/\\f*
+/\h pattern.txt /*\/\\h*
+/\i pattern.txt /*\/\\i*
+/\k pattern.txt /*\/\\k*
+/\l pattern.txt /*\/\\l*
+/\m pattern.txt /*\/\\m*
+/\n pattern.txt /*\/\\n*
+/\o pattern.txt /*\/\\o*
+/\p pattern.txt /*\/\\p*
+/\r pattern.txt /*\/\\r*
+/\s pattern.txt /*\/\\s*
+/\star pattern.txt /*\/\\star*
+/\t pattern.txt /*\/\\t*
+/\u pattern.txt /*\/\\u*
+/\v pattern.txt /*\/\\v*
+/\w pattern.txt /*\/\\w*
+/\x pattern.txt /*\/\\x*
+/\z( syntax.txt /*\/\\z(*
+/\z(\) syntax.txt /*\/\\z(\\)*
+/\z1 syntax.txt /*\/\\z1*
+/\z2 syntax.txt /*\/\\z2*
+/\z3 syntax.txt /*\/\\z3*
+/\z4 syntax.txt /*\/\\z4*
+/\z5 syntax.txt /*\/\\z5*
+/\z6 syntax.txt /*\/\\z6*
+/\z7 syntax.txt /*\/\\z7*
+/\z8 syntax.txt /*\/\\z8*
+/\z9 syntax.txt /*\/\\z9*
+/\ze pattern.txt /*\/\\ze*
+/\zs pattern.txt /*\/\\zs*
+/\{ pattern.txt /*\/\\{*
+/\{- pattern.txt /*\/\\{-*
+/\~ pattern.txt /*\/\\~*
+/^ pattern.txt /*\/^*
+/atom pattern.txt /*\/atom*
+/bar pattern.txt /*\/bar*
+/branch pattern.txt /*\/branch*
+/collection pattern.txt /*\/collection*
+/concat pattern.txt /*\/concat*
+/dyn various.txt /*\/dyn*
+/ignorecase pattern.txt /*\/ignorecase*
+/magic pattern.txt /*\/magic*
+/multi pattern.txt /*\/multi*
+/ordinary-atom pattern.txt /*\/ordinary-atom*
+/pattern pattern.txt /*\/pattern*
+/piece pattern.txt /*\/piece*
+/star pattern.txt /*\/star*
+/zero-width pattern.txt /*\/zero-width*
+/~ pattern.txt /*\/~*
+0 motion.txt /*0*
+01.1 usr_01.txt /*01.1*
+01.2 usr_01.txt /*01.2*
+01.3 usr_01.txt /*01.3*
+01.4 usr_01.txt /*01.4*
+02.1 usr_02.txt /*02.1*
+02.2 usr_02.txt /*02.2*
+02.3 usr_02.txt /*02.3*
+02.4 usr_02.txt /*02.4*
+02.5 usr_02.txt /*02.5*
+02.6 usr_02.txt /*02.6*
+02.7 usr_02.txt /*02.7*
+02.8 usr_02.txt /*02.8*
+03.1 usr_03.txt /*03.1*
+03.10 usr_03.txt /*03.10*
+03.2 usr_03.txt /*03.2*
+03.3 usr_03.txt /*03.3*
+03.4 usr_03.txt /*03.4*
+03.5 usr_03.txt /*03.5*
+03.6 usr_03.txt /*03.6*
+03.7 usr_03.txt /*03.7*
+03.8 usr_03.txt /*03.8*
+03.9 usr_03.txt /*03.9*
+04.1 usr_04.txt /*04.1*
+04.10 usr_04.txt /*04.10*
+04.2 usr_04.txt /*04.2*
+04.3 usr_04.txt /*04.3*
+04.4 usr_04.txt /*04.4*
+04.5 usr_04.txt /*04.5*
+04.6 usr_04.txt /*04.6*
+04.7 usr_04.txt /*04.7*
+04.8 usr_04.txt /*04.8*
+04.9 usr_04.txt /*04.9*
+05.1 usr_05.txt /*05.1*
+05.2 usr_05.txt /*05.2*
+05.3 usr_05.txt /*05.3*
+05.4 usr_05.txt /*05.4*
+05.5 usr_05.txt /*05.5*
+05.6 usr_05.txt /*05.6*
+05.7 usr_05.txt /*05.7*
+06.1 usr_06.txt /*06.1*
+06.2 usr_06.txt /*06.2*
+06.3 usr_06.txt /*06.3*
+06.4 usr_06.txt /*06.4*
+06.5 usr_06.txt /*06.5*
+06.6 usr_06.txt /*06.6*
+07.1 usr_07.txt /*07.1*
+07.2 usr_07.txt /*07.2*
+07.3 usr_07.txt /*07.3*
+07.4 usr_07.txt /*07.4*
+07.5 usr_07.txt /*07.5*
+07.6 usr_07.txt /*07.6*
+07.7 usr_07.txt /*07.7*
+08.1 usr_08.txt /*08.1*
+08.2 usr_08.txt /*08.2*
+08.3 usr_08.txt /*08.3*
+08.4 usr_08.txt /*08.4*
+08.5 usr_08.txt /*08.5*
+08.6 usr_08.txt /*08.6*
+08.7 usr_08.txt /*08.7*
+08.8 usr_08.txt /*08.8*
+09.1 usr_09.txt /*09.1*
+09.2 usr_09.txt /*09.2*
+09.3 usr_09.txt /*09.3*
+09.4 usr_09.txt /*09.4*
+10.1 usr_10.txt /*10.1*
+10.2 usr_10.txt /*10.2*
+10.3 usr_10.txt /*10.3*
+10.4 usr_10.txt /*10.4*
+10.5 usr_10.txt /*10.5*
+10.6 usr_10.txt /*10.6*
+10.7 usr_10.txt /*10.7*
+10.8 usr_10.txt /*10.8*
+10.9 usr_10.txt /*10.9*
+11.1 usr_11.txt /*11.1*
+11.2 usr_11.txt /*11.2*
+11.3 usr_11.txt /*11.3*
+11.4 usr_11.txt /*11.4*
+12.1 usr_12.txt /*12.1*
+12.2 usr_12.txt /*12.2*
+12.3 usr_12.txt /*12.3*
+12.4 usr_12.txt /*12.4*
+12.5 usr_12.txt /*12.5*
+12.6 usr_12.txt /*12.6*
+12.7 usr_12.txt /*12.7*
+12.8 usr_12.txt /*12.8*
+20.1 usr_20.txt /*20.1*
+20.2 usr_20.txt /*20.2*
+20.3 usr_20.txt /*20.3*
+20.4 usr_20.txt /*20.4*
+20.5 usr_20.txt /*20.5*
+21.1 usr_21.txt /*21.1*
+21.2 usr_21.txt /*21.2*
+21.3 usr_21.txt /*21.3*
+21.4 usr_21.txt /*21.4*
+21.5 usr_21.txt /*21.5*
+21.6 usr_21.txt /*21.6*
+22.1 usr_22.txt /*22.1*
+22.2 usr_22.txt /*22.2*
+22.3 usr_22.txt /*22.3*
+22.4 usr_22.txt /*22.4*
+23.1 usr_23.txt /*23.1*
+23.2 usr_23.txt /*23.2*
+23.3 usr_23.txt /*23.3*
+23.4 usr_23.txt /*23.4*
+23.5 usr_23.txt /*23.5*
+24.1 usr_24.txt /*24.1*
+24.10 usr_24.txt /*24.10*
+24.2 usr_24.txt /*24.2*
+24.3 usr_24.txt /*24.3*
+24.4 usr_24.txt /*24.4*
+24.5 usr_24.txt /*24.5*
+24.6 usr_24.txt /*24.6*
+24.7 usr_24.txt /*24.7*
+24.8 usr_24.txt /*24.8*
+24.9 usr_24.txt /*24.9*
+25.1 usr_25.txt /*25.1*
+25.2 usr_25.txt /*25.2*
+25.3 usr_25.txt /*25.3*
+25.4 usr_25.txt /*25.4*
+25.5 usr_25.txt /*25.5*
+26.1 usr_26.txt /*26.1*
+26.2 usr_26.txt /*26.2*
+26.3 usr_26.txt /*26.3*
+26.4 usr_26.txt /*26.4*
+27.1 usr_27.txt /*27.1*
+27.2 usr_27.txt /*27.2*
+27.3 usr_27.txt /*27.3*
+27.4 usr_27.txt /*27.4*
+27.5 usr_27.txt /*27.5*
+27.6 usr_27.txt /*27.6*
+27.7 usr_27.txt /*27.7*
+27.8 usr_27.txt /*27.8*
+27.9 usr_27.txt /*27.9*
+28.1 usr_28.txt /*28.1*
+28.10 usr_28.txt /*28.10*
+28.2 usr_28.txt /*28.2*
+28.3 usr_28.txt /*28.3*
+28.4 usr_28.txt /*28.4*
+28.5 usr_28.txt /*28.5*
+28.6 usr_28.txt /*28.6*
+28.7 usr_28.txt /*28.7*
+28.8 usr_28.txt /*28.8*
+28.9 usr_28.txt /*28.9*
+29.1 usr_29.txt /*29.1*
+29.2 usr_29.txt /*29.2*
+29.3 usr_29.txt /*29.3*
+29.4 usr_29.txt /*29.4*
+29.5 usr_29.txt /*29.5*
+2html.vim syntax.txt /*2html.vim*
+30.1 usr_30.txt /*30.1*
+30.2 usr_30.txt /*30.2*
+30.3 usr_30.txt /*30.3*
+30.4 usr_30.txt /*30.4*
+30.5 usr_30.txt /*30.5*
+30.6 usr_30.txt /*30.6*
+31.1 usr_31.txt /*31.1*
+31.2 usr_31.txt /*31.2*
+31.3 usr_31.txt /*31.3*
+31.4 usr_31.txt /*31.4*
+31.5 usr_31.txt /*31.5*
+40.1 usr_40.txt /*40.1*
+40.2 usr_40.txt /*40.2*
+40.3 usr_40.txt /*40.3*
+41.1 usr_41.txt /*41.1*
+41.10 usr_41.txt /*41.10*
+41.11 usr_41.txt /*41.11*
+41.12 usr_41.txt /*41.12*
+41.2 usr_41.txt /*41.2*
+41.3 usr_41.txt /*41.3*
+41.4 usr_41.txt /*41.4*
+41.5 usr_41.txt /*41.5*
+41.6 usr_41.txt /*41.6*
+41.7 usr_41.txt /*41.7*
+41.8 usr_41.txt /*41.8*
+41.9 usr_41.txt /*41.9*
+42 usr_42.txt /*42*
+42.1 usr_42.txt /*42.1*
+42.2 usr_42.txt /*42.2*
+42.3 usr_42.txt /*42.3*
+42.4 usr_42.txt /*42.4*
+43.1 usr_43.txt /*43.1*
+43.2 usr_43.txt /*43.2*
+44.1 usr_44.txt /*44.1*
+44.10 usr_44.txt /*44.10*
+44.11 usr_44.txt /*44.11*
+44.12 usr_44.txt /*44.12*
+44.2 usr_44.txt /*44.2*
+44.3 usr_44.txt /*44.3*
+44.4 usr_44.txt /*44.4*
+44.5 usr_44.txt /*44.5*
+44.6 usr_44.txt /*44.6*
+44.7 usr_44.txt /*44.7*
+44.8 usr_44.txt /*44.8*
+44.9 usr_44.txt /*44.9*
+45.1 usr_45.txt /*45.1*
+45.2 usr_45.txt /*45.2*
+45.3 usr_45.txt /*45.3*
+45.4 usr_45.txt /*45.4*
+45.5 usr_45.txt /*45.5*
+90.1 usr_90.txt /*90.1*
+90.2 usr_90.txt /*90.2*
+90.3 usr_90.txt /*90.3*
+90.4 usr_90.txt /*90.4*
+90.5 usr_90.txt /*90.5*
+: cmdline.txt /*:*
+:! various.txt /*:!*
+:!! various.txt /*:!!*
+:!cmd various.txt /*:!cmd*
+:!start os_win32.txt /*:!start*
+:# various.txt /*:#*
+:$ cmdline.txt /*:$*
+:% cmdline.txt /*:%*
+:& change.txt /*:&*
+:' cmdline.txt /*:'*
+:, cmdline.txt /*:,*
+:. cmdline.txt /*:.*
+:/ cmdline.txt /*:\/*
+::. cmdline.txt /*::.*
+::8 cmdline.txt /*::8*
+::e cmdline.txt /*::e*
+::gs cmdline.txt /*::gs*
+::h cmdline.txt /*::h*
+::p cmdline.txt /*::p*
+::r cmdline.txt /*::r*
+::s cmdline.txt /*::s*
+::t cmdline.txt /*::t*
+::~ cmdline.txt /*::~*
+:; cmdline.txt /*:;*
+:< change.txt /*:<*
+:<abuf> cmdline.txt /*:<abuf>*
+:<afile> cmdline.txt /*:<afile>*
+:<amatch> cmdline.txt /*:<amatch>*
+:<cWORD> cmdline.txt /*:<cWORD>*
+:<cfile> cmdline.txt /*:<cfile>*
+:<cword> cmdline.txt /*:<cword>*
+:<sfile> cmdline.txt /*:<sfile>*
+:= various.txt /*:=*
+:> change.txt /*:>*
+:? cmdline.txt /*:?*
+:@ repeat.txt /*:@*
+:@: repeat.txt /*:@:*
+:@@ repeat.txt /*:@@*
+:Explore pi_expl.txt /*:Explore*
+:Man filetype.txt /*:Man*
+:N editing.txt /*:N*
+:Next editing.txt /*:Next*
+:P various.txt /*:P*
+:Print various.txt /*:Print*
+:Sexplore pi_expl.txt /*:Sexplore*
+:TOhtml syntax.txt /*:TOhtml*
+:X editing.txt /*:X*
+:\bar cmdline.txt /*:\\bar*
+:_! cmdline.txt /*:_!*
+:_# cmdline.txt /*:_#*
+:_## cmdline.txt /*:_##*
+:_% cmdline.txt /*:_%*
+:_%: cmdline.txt /*:_%:*
+:_%< cmdline.txt /*:_%<*
+:a insert.txt /*:a*
+:ab map.txt /*:ab*
+:abbreviate map.txt /*:abbreviate*
+:abbreviate-<buffer> map.txt /*:abbreviate-<buffer>*
+:abbreviate-local map.txt /*:abbreviate-local*
+:abc map.txt /*:abc*
+:abclear map.txt /*:abclear*
+:abo windows.txt /*:abo*
+:aboveleft windows.txt /*:aboveleft*
+:al windows.txt /*:al*
+:all windows.txt /*:all*
+:am gui.txt /*:am*
+:amenu gui.txt /*:amenu*
+:an gui.txt /*:an*
+:anoremenu gui.txt /*:anoremenu*
+:append insert.txt /*:append*
+:ar editing.txt /*:ar*
+:arga editing.txt /*:arga*
+:argadd editing.txt /*:argadd*
+:argd editing.txt /*:argd*
+:argdelete editing.txt /*:argdelete*
+:argdo editing.txt /*:argdo*
+:arge editing.txt /*:arge*
+:argedit editing.txt /*:argedit*
+:argglobal editing.txt /*:argglobal*
+:arglocal editing.txt /*:arglocal*
+:args editing.txt /*:args*
+:args_f editing.txt /*:args_f*
+:args_f! editing.txt /*:args_f!*
+:argu editing.txt /*:argu*
+:argument editing.txt /*:argument*
+:as various.txt /*:as*
+:ascii various.txt /*:ascii*
+:au autocmd.txt /*:au*
+:aug autocmd.txt /*:aug*
+:augroup autocmd.txt /*:augroup*
+:augroup-delete autocmd.txt /*:augroup-delete*
+:aun gui.txt /*:aun*
+:aunmenu gui.txt /*:aunmenu*
+:autocmd autocmd.txt /*:autocmd*
+:b windows.txt /*:b*
+:bN windows.txt /*:bN*
+:bNext windows.txt /*:bNext*
+:ba windows.txt /*:ba*
+:bad windows.txt /*:bad*
+:badd windows.txt /*:badd*
+:ball windows.txt /*:ball*
+:bar cmdline.txt /*:bar*
+:bd windows.txt /*:bd*
+:bdel windows.txt /*:bdel*
+:bdelete windows.txt /*:bdelete*
+:be gui.txt /*:be*
+:behave gui.txt /*:behave*
+:bel windows.txt /*:bel*
+:belowright windows.txt /*:belowright*
+:bf windows.txt /*:bf*
+:bfirst windows.txt /*:bfirst*
+:bl windows.txt /*:bl*
+:blast windows.txt /*:blast*
+:bm windows.txt /*:bm*
+:bmodified windows.txt /*:bmodified*
+:bn windows.txt /*:bn*
+:bnext windows.txt /*:bnext*
+:botright windows.txt /*:botright*
+:bp windows.txt /*:bp*
+:bprevious windows.txt /*:bprevious*
+:br windows.txt /*:br*
+:brea eval.txt /*:brea*
+:break eval.txt /*:break*
+:breaka repeat.txt /*:breaka*
+:breakadd repeat.txt /*:breakadd*
+:breakd repeat.txt /*:breakd*
+:breakdel repeat.txt /*:breakdel*
+:breakl repeat.txt /*:breakl*
+:breaklist repeat.txt /*:breaklist*
+:brewind windows.txt /*:brewind*
+:bro editing.txt /*:bro*
+:browse editing.txt /*:browse*
+:browse-set options.txt /*:browse-set*
+:bu windows.txt /*:bu*
+:buf windows.txt /*:buf*
+:bufdo windows.txt /*:bufdo*
+:buffer windows.txt /*:buffer*
+:buffer-! windows.txt /*:buffer-!*
+:buffers windows.txt /*:buffers*
+:bun windows.txt /*:bun*
+:bunload windows.txt /*:bunload*
+:bw windows.txt /*:bw*
+:bwipe windows.txt /*:bwipe*
+:bwipeout windows.txt /*:bwipeout*
+:c change.txt /*:c*
+:cN quickfix.txt /*:cN*
+:cNext quickfix.txt /*:cNext*
+:cNf quickfix.txt /*:cNf*
+:cNfile quickfix.txt /*:cNfile*
+:ca map.txt /*:ca*
+:cabbrev map.txt /*:cabbrev*
+:cabc map.txt /*:cabc*
+:cabclear map.txt /*:cabclear*
+:cal eval.txt /*:cal*
+:call eval.txt /*:call*
+:cat eval.txt /*:cat*
+:catch eval.txt /*:catch*
+:cc quickfix.txt /*:cc*
+:ccl quickfix.txt /*:ccl*
+:cclose quickfix.txt /*:cclose*
+:cd editing.txt /*:cd*
+:cd- editing.txt /*:cd-*
+:ce change.txt /*:ce*
+:center change.txt /*:center*
+:cf quickfix.txt /*:cf*
+:cfile quickfix.txt /*:cfile*
+:cfir quickfix.txt /*:cfir*
+:cfirst quickfix.txt /*:cfirst*
+:cg quickfix.txt /*:cg*
+:cgetfile quickfix.txt /*:cgetfile*
+:ch change.txt /*:ch*
+:change change.txt /*:change*
+:changes motion.txt /*:changes*
+:chd editing.txt /*:chd*
+:chdir editing.txt /*:chdir*
+:che tagsrch.txt /*:che*
+:checkpath tagsrch.txt /*:checkpath*
+:checkt editing.txt /*:checkt*
+:checktime editing.txt /*:checktime*
+:cl quickfix.txt /*:cl*
+:cla quickfix.txt /*:cla*
+:clast quickfix.txt /*:clast*
+:clist quickfix.txt /*:clist*
+:clo windows.txt /*:clo*
+:close windows.txt /*:close*
+:cm map.txt /*:cm*
+:cmap map.txt /*:cmap*
+:cmap_l map.txt /*:cmap_l*
+:cmapc map.txt /*:cmapc*
+:cmapclear map.txt /*:cmapclear*
+:cme gui.txt /*:cme*
+:cmenu gui.txt /*:cmenu*
+:cn quickfix.txt /*:cn*
+:cnew quickfix.txt /*:cnew*
+:cnewer quickfix.txt /*:cnewer*
+:cnext quickfix.txt /*:cnext*
+:cnf quickfix.txt /*:cnf*
+:cnfile quickfix.txt /*:cnfile*
+:cno map.txt /*:cno*
+:cnorea map.txt /*:cnorea*
+:cnoreabbrev map.txt /*:cnoreabbrev*
+:cnoremap map.txt /*:cnoremap*
+:cnoreme gui.txt /*:cnoreme*
+:cnoremenu gui.txt /*:cnoremenu*
+:co change.txt /*:co*
+:col quickfix.txt /*:col*
+:colder quickfix.txt /*:colder*
+:colo syntax.txt /*:colo*
+:colorscheme syntax.txt /*:colorscheme*
+:com map.txt /*:com*
+:comc map.txt /*:comc*
+:comclear map.txt /*:comclear*
+:command map.txt /*:command*
+:command-completion map.txt /*:command-completion*
+:command-completion-custom map.txt /*:command-completion-custom*
+:comment eval.txt /*:comment*
+:comp quickfix.txt /*:comp*
+:compiler quickfix.txt /*:compiler*
+:con eval.txt /*:con*
+:conf editing.txt /*:conf*
+:confirm editing.txt /*:confirm*
+:continue eval.txt /*:continue*
+:cope quickfix.txt /*:cope*
+:copen quickfix.txt /*:copen*
+:copy change.txt /*:copy*
+:cp quickfix.txt /*:cp*
+:cpf quickfix.txt /*:cpf*
+:cpfile quickfix.txt /*:cpfile*
+:cprevious quickfix.txt /*:cprevious*
+:cq quickfix.txt /*:cq*
+:cquit quickfix.txt /*:cquit*
+:cr quickfix.txt /*:cr*
+:crewind quickfix.txt /*:crewind*
+:cs if_cscop.txt /*:cs*
+:cscope if_cscop.txt /*:cscope*
+:cstag if_cscop.txt /*:cstag*
+:cu map.txt /*:cu*
+:cuna map.txt /*:cuna*
+:cunabbrev map.txt /*:cunabbrev*
+:cunmap map.txt /*:cunmap*
+:cunme gui.txt /*:cunme*
+:cunmenu gui.txt /*:cunmenu*
+:cw quickfix.txt /*:cw*
+:cwindow quickfix.txt /*:cwindow*
+:d change.txt /*:d*
+:de change.txt /*:de*
+:debug repeat.txt /*:debug*
+:debugg repeat.txt /*:debugg*
+:debuggreedy repeat.txt /*:debuggreedy*
+:del change.txt /*:del*
+:delc map.txt /*:delc*
+:delcommand map.txt /*:delcommand*
+:delcr todo.txt /*:delcr*
+:delete change.txt /*:delete*
+:delf eval.txt /*:delf*
+:delfunction eval.txt /*:delfunction*
+:di change.txt /*:di*
+:diffg diff.txt /*:diffg*
+:diffget diff.txt /*:diffget*
+:diffp diff.txt /*:diffp*
+:diffpatch diff.txt /*:diffpatch*
+:diffpu diff.txt /*:diffpu*
+:diffput diff.txt /*:diffput*
+:diffs diff.txt /*:diffs*
+:diffsplit diff.txt /*:diffsplit*
+:difft diff.txt /*:difft*
+:diffthis diff.txt /*:diffthis*
+:diffu diff.txt /*:diffu*
+:diffupdate diff.txt /*:diffupdate*
+:dig digraph.txt /*:dig*
+:digraphs digraph.txt /*:digraphs*
+:display change.txt /*:display*
+:dj tagsrch.txt /*:dj*
+:djump tagsrch.txt /*:djump*
+:dl tagsrch.txt /*:dl*
+:dlist tagsrch.txt /*:dlist*
+:do autocmd.txt /*:do*
+:doau autocmd.txt /*:doau*
+:doautoa autocmd.txt /*:doautoa*
+:doautoall autocmd.txt /*:doautoall*
+:doautocmd autocmd.txt /*:doautocmd*
+:dr windows.txt /*:dr*
+:drop windows.txt /*:drop*
+:ds tagsrch.txt /*:ds*
+:dsearch tagsrch.txt /*:dsearch*
+:dsp tagsrch.txt /*:dsp*
+:dsplit tagsrch.txt /*:dsplit*
+:e editing.txt /*:e*
+:ec eval.txt /*:ec*
+:echo eval.txt /*:echo*
+:echoe eval.txt /*:echoe*
+:echoerr eval.txt /*:echoerr*
+:echoh eval.txt /*:echoh*
+:echohl eval.txt /*:echohl*
+:echom eval.txt /*:echom*
+:echomsg eval.txt /*:echomsg*
+:echon eval.txt /*:echon*
+:edit editing.txt /*:edit*
+:edit! editing.txt /*:edit!*
+:edit!_f editing.txt /*:edit!_f*
+:edit_f editing.txt /*:edit_f*
+:el eval.txt /*:el*
+:else eval.txt /*:else*
+:elsei eval.txt /*:elsei*
+:elseif eval.txt /*:elseif*
+:em gui.txt /*:em*
+:emenu gui.txt /*:emenu*
+:en eval.txt /*:en*
+:endf eval.txt /*:endf*
+:endfunction eval.txt /*:endfunction*
+:endif eval.txt /*:endif*
+:endt eval.txt /*:endt*
+:endtry eval.txt /*:endtry*
+:endw eval.txt /*:endw*
+:endwhile eval.txt /*:endwhile*
+:ene editing.txt /*:ene*
+:ene! editing.txt /*:ene!*
+:enew editing.txt /*:enew*
+:enew! editing.txt /*:enew!*
+:ex editing.txt /*:ex*
+:exe eval.txt /*:exe*
+:execute eval.txt /*:execute*
+:exi editing.txt /*:exi*
+:exit editing.txt /*:exit*
+:f editing.txt /*:f*
+:fi editing.txt /*:fi*
+:file editing.txt /*:file*
+:file_f editing.txt /*:file_f*
+:filename editing.txt /*:filename*
+:files windows.txt /*:files*
+:filet filetype.txt /*:filet*
+:filetype filetype.txt /*:filetype*
+:filetype-indent-off filetype.txt /*:filetype-indent-off*
+:filetype-indent-on filetype.txt /*:filetype-indent-on*
+:filetype-off filetype.txt /*:filetype-off*
+:filetype-overview filetype.txt /*:filetype-overview*
+:filetype-plugin-off filetype.txt /*:filetype-plugin-off*
+:filetype-plugin-on filetype.txt /*:filetype-plugin-on*
+:fin editing.txt /*:fin*
+:fina eval.txt /*:fina*
+:finally eval.txt /*:finally*
+:find editing.txt /*:find*
+:fini repeat.txt /*:fini*
+:finish repeat.txt /*:finish*
+:fir editing.txt /*:fir*
+:first editing.txt /*:first*
+:fix options.txt /*:fix*
+:fixdel options.txt /*:fixdel*
+:fo fold.txt /*:fo*
+:fold fold.txt /*:fold*
+:foldc fold.txt /*:foldc*
+:foldclose fold.txt /*:foldclose*
+:foldd fold.txt /*:foldd*
+:folddoc fold.txt /*:folddoc*
+:folddoclosed fold.txt /*:folddoclosed*
+:folddoopen fold.txt /*:folddoopen*
+:foldo fold.txt /*:foldo*
+:foldopen fold.txt /*:foldopen*
+:fu eval.txt /*:fu*
+:function eval.txt /*:function*
+:g repeat.txt /*:g*
+:global repeat.txt /*:global*
+:go motion.txt /*:go*
+:goto motion.txt /*:goto*
+:gr quickfix.txt /*:gr*
+:grep quickfix.txt /*:grep*
+:grepa quickfix.txt /*:grepa*
+:grepadd quickfix.txt /*:grepadd*
+:gu gui_x11.txt /*:gu*
+:gui gui_x11.txt /*:gui*
+:gv gui_x11.txt /*:gv*
+:gvim gui_x11.txt /*:gvim*
+:h various.txt /*:h*
+:ha various.txt /*:ha*
+:hardcopy various.txt /*:hardcopy*
+:help various.txt /*:help*
+:helpf various.txt /*:helpf*
+:helpfind various.txt /*:helpfind*
+:helpg various.txt /*:helpg*
+:helpgrep various.txt /*:helpgrep*
+:helpt various.txt /*:helpt*
+:helptags various.txt /*:helptags*
+:hi syntax.txt /*:hi*
+:hi-default syntax.txt /*:hi-default*
+:hi-link syntax.txt /*:hi-link*
+:hi-normal syntax.txt /*:hi-normal*
+:hi-normal-cterm syntax.txt /*:hi-normal-cterm*
+:hide windows.txt /*:hide*
+:highlight syntax.txt /*:highlight*
+:highlight-default syntax.txt /*:highlight-default*
+:highlight-link syntax.txt /*:highlight-link*
+:highlight-normal syntax.txt /*:highlight-normal*
+:history cmdline.txt /*:history*
+:history-indexing cmdline.txt /*:history-indexing*
+:i insert.txt /*:i*
+:ia map.txt /*:ia*
+:iabbrev map.txt /*:iabbrev*
+:iabc map.txt /*:iabc*
+:iabclear map.txt /*:iabclear*
+:if eval.txt /*:if*
+:ij tagsrch.txt /*:ij*
+:ijump tagsrch.txt /*:ijump*
+:il tagsrch.txt /*:il*
+:ilist tagsrch.txt /*:ilist*
+:im map.txt /*:im*
+:imap map.txt /*:imap*
+:imap_l map.txt /*:imap_l*
+:imapc map.txt /*:imapc*
+:imapclear map.txt /*:imapclear*
+:ime gui.txt /*:ime*
+:imenu gui.txt /*:imenu*
+:in insert.txt /*:in*
+:index index.txt /*:index*
+:ino map.txt /*:ino*
+:inorea map.txt /*:inorea*
+:inoreabbrev map.txt /*:inoreabbrev*
+:inoremap map.txt /*:inoremap*
+:inoreme gui.txt /*:inoreme*
+:inoremenu gui.txt /*:inoremenu*
+:insert insert.txt /*:insert*
+:intro starting.txt /*:intro*
+:is tagsrch.txt /*:is*
+:isearch tagsrch.txt /*:isearch*
+:isp tagsrch.txt /*:isp*
+:isplit tagsrch.txt /*:isplit*
+:iu map.txt /*:iu*
+:iuna map.txt /*:iuna*
+:iunabbrev map.txt /*:iunabbrev*
+:iunmap map.txt /*:iunmap*
+:iunme gui.txt /*:iunme*
+:iunmenu gui.txt /*:iunmenu*
+:j change.txt /*:j*
+:join change.txt /*:join*
+:ju motion.txt /*:ju*
+:jumps motion.txt /*:jumps*
+:k motion.txt /*:k*
+:kee motion.txt /*:kee*
+:keepj motion.txt /*:keepj*
+:keepjumps motion.txt /*:keepjumps*
+:keepmarks motion.txt /*:keepmarks*
+:l various.txt /*:l*
+:la editing.txt /*:la*
+:lan mlang.txt /*:lan*
+:lang mlang.txt /*:lang*
+:language mlang.txt /*:language*
+:last editing.txt /*:last*
+:lc editing.txt /*:lc*
+:lcd editing.txt /*:lcd*
+:lch editing.txt /*:lch*
+:lchdir editing.txt /*:lchdir*
+:le change.txt /*:le*
+:left change.txt /*:left*
+:lefta windows.txt /*:lefta*
+:leftabove windows.txt /*:leftabove*
+:let eval.txt /*:let*
+:let-$ eval.txt /*:let-$*
+:let-@ eval.txt /*:let-@*
+:let-environment eval.txt /*:let-environment*
+:let-option eval.txt /*:let-option*
+:let-register eval.txt /*:let-register*
+:let-star eval.txt /*:let-star*
+:list various.txt /*:list*
+:lm map.txt /*:lm*
+:lmap map.txt /*:lmap*
+:lmap_l map.txt /*:lmap_l*
+:lmapc map.txt /*:lmapc*
+:lmapclear map.txt /*:lmapclear*
+:ln map.txt /*:ln*
+:lnoremap map.txt /*:lnoremap*
+:lo starting.txt /*:lo*
+:loadk mbyte.txt /*:loadk*
+:loadkeymap mbyte.txt /*:loadkeymap*
+:loadview starting.txt /*:loadview*
+:loc motion.txt /*:loc*
+:lockmarks motion.txt /*:lockmarks*
+:ls windows.txt /*:ls*
+:lu map.txt /*:lu*
+:lunmap map.txt /*:lunmap*
+:m change.txt /*:m*
+:ma motion.txt /*:ma*
+:mak quickfix.txt /*:mak*
+:make quickfix.txt /*:make*
+:make_makeprg quickfix.txt /*:make_makeprg*
+:map map.txt /*:map*
+:map! map.txt /*:map!*
+:map-<buffer> map.txt /*:map-<buffer>*
+:map-<script> map.txt /*:map-<script>*
+:map-<silent> map.txt /*:map-<silent>*
+:map-<unique> map.txt /*:map-<unique>*
+:map-local map.txt /*:map-local*
+:map-script map.txt /*:map-script*
+:map-silent map.txt /*:map-silent*
+:map-special-keys map.txt /*:map-special-keys*
+:map-undo map.txt /*:map-undo*
+:map_l map.txt /*:map_l*
+:map_l! map.txt /*:map_l!*
+:mapc map.txt /*:mapc*
+:mapc! map.txt /*:mapc!*
+:mapclear map.txt /*:mapclear*
+:mapclear! map.txt /*:mapclear!*
+:mark motion.txt /*:mark*
+:marks motion.txt /*:marks*
+:mat pattern.txt /*:mat*
+:match pattern.txt /*:match*
+:me gui.txt /*:me*
+:menu gui.txt /*:menu*
+:menu-<script> gui.txt /*:menu-<script>*
+:menu-<silent> gui.txt /*:menu-<silent>*
+:menu-disable gui.txt /*:menu-disable*
+:menu-enable gui.txt /*:menu-enable*
+:menu-script gui.txt /*:menu-script*
+:menu-silent gui.txt /*:menu-silent*
+:menut mlang.txt /*:menut*
+:menutrans mlang.txt /*:menutrans*
+:menutranslate mlang.txt /*:menutranslate*
+:mes message.txt /*:mes*
+:messages message.txt /*:messages*
+:mk starting.txt /*:mk*
+:mkexrc starting.txt /*:mkexrc*
+:mks starting.txt /*:mks*
+:mksession starting.txt /*:mksession*
+:mkv starting.txt /*:mkv*
+:mkvie starting.txt /*:mkvie*
+:mkview starting.txt /*:mkview*
+:mkvimrc starting.txt /*:mkvimrc*
+:mo change.txt /*:mo*
+:mod term.txt /*:mod*
+:mode term.txt /*:mode*
+:move change.txt /*:move*
+:n editing.txt /*:n*
+:ne editing.txt /*:ne*
+:new windows.txt /*:new*
+:next editing.txt /*:next*
+:next_f editing.txt /*:next_f*
+:nm map.txt /*:nm*
+:nmap map.txt /*:nmap*
+:nmap_l map.txt /*:nmap_l*
+:nmapc map.txt /*:nmapc*
+:nmapclear map.txt /*:nmapclear*
+:nme gui.txt /*:nme*
+:nmenu gui.txt /*:nmenu*
+:nn map.txt /*:nn*
+:nnoremap map.txt /*:nnoremap*
+:nnoreme gui.txt /*:nnoreme*
+:nnoremenu gui.txt /*:nnoremenu*
+:no map.txt /*:no*
+:no! map.txt /*:no!*
+:noh pattern.txt /*:noh*
+:nohlsearch pattern.txt /*:nohlsearch*
+:norea map.txt /*:norea*
+:noreabbrev map.txt /*:noreabbrev*
+:noremap map.txt /*:noremap*
+:noremap! map.txt /*:noremap!*
+:noreme gui.txt /*:noreme*
+:noremenu gui.txt /*:noremenu*
+:norm various.txt /*:norm*
+:normal various.txt /*:normal*
+:normal-range various.txt /*:normal-range*
+:nu various.txt /*:nu*
+:number various.txt /*:number*
+:nun map.txt /*:nun*
+:nunmap map.txt /*:nunmap*
+:nunme gui.txt /*:nunme*
+:nunmenu gui.txt /*:nunmenu*
+:o vi_diff.txt /*:o*
+:om map.txt /*:om*
+:omap map.txt /*:omap*
+:omap_l map.txt /*:omap_l*
+:omapc map.txt /*:omapc*
+:omapclear map.txt /*:omapclear*
+:ome gui.txt /*:ome*
+:omenu gui.txt /*:omenu*
+:on windows.txt /*:on*
+:only windows.txt /*:only*
+:ono map.txt /*:ono*
+:onoremap map.txt /*:onoremap*
+:onoreme gui.txt /*:onoreme*
+:onoremenu gui.txt /*:onoremenu*
+:op vi_diff.txt /*:op*
+:open vi_diff.txt /*:open*
+:opt options.txt /*:opt*
+:options options.txt /*:options*
+:ou map.txt /*:ou*
+:ounmap map.txt /*:ounmap*
+:ounme gui.txt /*:ounme*
+:ounmenu gui.txt /*:ounmenu*
+:p various.txt /*:p*
+:pc windows.txt /*:pc*
+:pclose windows.txt /*:pclose*
+:pe if_perl.txt /*:pe*
+:ped windows.txt /*:ped*
+:pedit windows.txt /*:pedit*
+:perl if_perl.txt /*:perl*
+:perld if_perl.txt /*:perld*
+:perldo if_perl.txt /*:perldo*
+:po tagsrch.txt /*:po*
+:pop tagsrch.txt /*:pop*
+:popu gui.txt /*:popu*
+:popup gui.txt /*:popup*
+:pp windows.txt /*:pp*
+:ppop windows.txt /*:ppop*
+:pr various.txt /*:pr*
+:pre recover.txt /*:pre*
+:preserve recover.txt /*:preserve*
+:prev editing.txt /*:prev*
+:previous editing.txt /*:previous*
+:print various.txt /*:print*
+:pro change.txt /*:pro*
+:promptfind change.txt /*:promptfind*
+:promptr change.txt /*:promptr*
+:promptrepl change.txt /*:promptrepl*
+:ps windows.txt /*:ps*
+:psearch windows.txt /*:psearch*
+:ptN tagsrch.txt /*:ptN*
+:ptNext tagsrch.txt /*:ptNext*
+:pta windows.txt /*:pta*
+:ptag windows.txt /*:ptag*
+:ptf tagsrch.txt /*:ptf*
+:ptfirst tagsrch.txt /*:ptfirst*
+:ptj tagsrch.txt /*:ptj*
+:ptjump tagsrch.txt /*:ptjump*
+:ptl tagsrch.txt /*:ptl*
+:ptlast tagsrch.txt /*:ptlast*
+:ptn tagsrch.txt /*:ptn*
+:ptnext tagsrch.txt /*:ptnext*
+:ptp tagsrch.txt /*:ptp*
+:ptprevious tagsrch.txt /*:ptprevious*
+:ptr tagsrch.txt /*:ptr*
+:ptrewind tagsrch.txt /*:ptrewind*
+:pts tagsrch.txt /*:pts*
+:ptselect tagsrch.txt /*:ptselect*
+:pu change.txt /*:pu*
+:put change.txt /*:put*
+:pw editing.txt /*:pw*
+:pwd editing.txt /*:pwd*
+:py if_pyth.txt /*:py*
+:pyf if_pyth.txt /*:pyf*
+:pyfile if_pyth.txt /*:pyfile*
+:python if_pyth.txt /*:python*
+:q editing.txt /*:q*
+:qa editing.txt /*:qa*
+:qall editing.txt /*:qall*
+:quit editing.txt /*:quit*
+:quita editing.txt /*:quita*
+:quitall editing.txt /*:quitall*
+:quote cmdline.txt /*:quote*
+:r insert.txt /*:r*
+:r! insert.txt /*:r!*
+:range cmdline.txt /*:range*
+:range! change.txt /*:range!*
+:re insert.txt /*:re*
+:read insert.txt /*:read*
+:read! insert.txt /*:read!*
+:rec recover.txt /*:rec*
+:recover recover.txt /*:recover*
+:red undo.txt /*:red*
+:redi various.txt /*:redi*
+:redir various.txt /*:redir*
+:redo undo.txt /*:redo*
+:redr various.txt /*:redr*
+:redraw various.txt /*:redraw*
+:redraws various.txt /*:redraws*
+:redrawstatus various.txt /*:redrawstatus*
+:reg change.txt /*:reg*
+:registers change.txt /*:registers*
+:res windows.txt /*:res*
+:resize windows.txt /*:resize*
+:ret change.txt /*:ret*
+:retab change.txt /*:retab*
+:retu eval.txt /*:retu*
+:return eval.txt /*:return*
+:rew editing.txt /*:rew*
+:rewind editing.txt /*:rewind*
+:ri change.txt /*:ri*
+:right change.txt /*:right*
+:rightb windows.txt /*:rightb*
+:rightbelow windows.txt /*:rightbelow*
+:ru repeat.txt /*:ru*
+:rub if_ruby.txt /*:rub*
+:ruby if_ruby.txt /*:ruby*
+:rubyd if_ruby.txt /*:rubyd*
+:rubydo if_ruby.txt /*:rubydo*
+:rubyf if_ruby.txt /*:rubyf*
+:rubyfile if_ruby.txt /*:rubyfile*
+:runtime repeat.txt /*:runtime*
+:rv starting.txt /*:rv*
+:rviminfo starting.txt /*:rviminfo*
+:s change.txt /*:s*
+:sN windows.txt /*:sN*
+:sNext windows.txt /*:sNext*
+:s\= change.txt /*:s\\=*
+:s_c change.txt /*:s_c*
+:s_flags change.txt /*:s_flags*
+:sa windows.txt /*:sa*
+:sal windows.txt /*:sal*
+:sall windows.txt /*:sall*
+:sargument windows.txt /*:sargument*
+:sav editing.txt /*:sav*
+:saveas editing.txt /*:saveas*
+:sb windows.txt /*:sb*
+:sbN windows.txt /*:sbN*
+:sbNext windows.txt /*:sbNext*
+:sba windows.txt /*:sba*
+:sball windows.txt /*:sball*
+:sbf windows.txt /*:sbf*
+:sbfirst windows.txt /*:sbfirst*
+:sbl windows.txt /*:sbl*
+:sblast windows.txt /*:sblast*
+:sbm windows.txt /*:sbm*
+:sbmodified windows.txt /*:sbmodified*
+:sbn windows.txt /*:sbn*
+:sbnext windows.txt /*:sbnext*
+:sbp windows.txt /*:sbp*
+:sbprevious windows.txt /*:sbprevious*
+:sbr windows.txt /*:sbr*
+:sbrewind windows.txt /*:sbrewind*
+:sbuffer windows.txt /*:sbuffer*
+:scrip repeat.txt /*:scrip*
+:scripte repeat.txt /*:scripte*
+:scriptencoding repeat.txt /*:scriptencoding*
+:scriptnames repeat.txt /*:scriptnames*
+:scs if_cscop.txt /*:scs*
+:scscope if_cscop.txt /*:scscope*
+:se options.txt /*:se*
+:search-args tagsrch.txt /*:search-args*
+:set options.txt /*:set*
+:set+= options.txt /*:set+=*
+:set-& options.txt /*:set-&*
+:set-&vi options.txt /*:set-&vi*
+:set-&vim options.txt /*:set-&vim*
+:set-= options.txt /*:set-=*
+:set-args options.txt /*:set-args*
+:set-browse options.txt /*:set-browse*
+:set-default options.txt /*:set-default*
+:set-termcap options.txt /*:set-termcap*
+:set-verbose options.txt /*:set-verbose*
+:set^= options.txt /*:set^=*
+:set_env options.txt /*:set_env*
+:setf options.txt /*:setf*
+:setfiletype options.txt /*:setfiletype*
+:setg options.txt /*:setg*
+:setglobal options.txt /*:setglobal*
+:setl options.txt /*:setl*
+:setlocal options.txt /*:setlocal*
+:sf windows.txt /*:sf*
+:sfind windows.txt /*:sfind*
+:sfir windows.txt /*:sfir*
+:sfirst windows.txt /*:sfirst*
+:sh various.txt /*:sh*
+:shell various.txt /*:shell*
+:si gui_w32.txt /*:si*
+:sig sign.txt /*:sig*
+:sign sign.txt /*:sign*
+:sign-define sign.txt /*:sign-define*
+:sign-fname sign.txt /*:sign-fname*
+:sign-jump sign.txt /*:sign-jump*
+:sign-list sign.txt /*:sign-list*
+:sign-place sign.txt /*:sign-place*
+:sign-undefine sign.txt /*:sign-undefine*
+:sign-unplace sign.txt /*:sign-unplace*
+:sil various.txt /*:sil*
+:silent various.txt /*:silent*
+:simalt gui_w32.txt /*:simalt*
+:sl various.txt /*:sl*
+:sla windows.txt /*:sla*
+:slast windows.txt /*:slast*
+:sleep various.txt /*:sleep*
+:sm change.txt /*:sm*
+:smagic change.txt /*:smagic*
+:sn windows.txt /*:sn*
+:snext windows.txt /*:snext*
+:sni if_sniff.txt /*:sni*
+:sniff if_sniff.txt /*:sniff*
+:sno change.txt /*:sno*
+:snomagic change.txt /*:snomagic*
+:so repeat.txt /*:so*
+:source repeat.txt /*:source*
+:source_crnl repeat.txt /*:source_crnl*
+:sp windows.txt /*:sp*
+:split windows.txt /*:split*
+:split_f windows.txt /*:split_f*
+:spr windows.txt /*:spr*
+:sprevious windows.txt /*:sprevious*
+:sre windows.txt /*:sre*
+:srewind windows.txt /*:srewind*
+:st starting.txt /*:st*
+:sta windows.txt /*:sta*
+:stag windows.txt /*:stag*
+:star repeat.txt /*:star*
+:start insert.txt /*:start*
+:startinsert insert.txt /*:startinsert*
+:stj tagsrch.txt /*:stj*
+:stjump tagsrch.txt /*:stjump*
+:stop starting.txt /*:stop*
+:stopi insert.txt /*:stopi*
+:stopinsert insert.txt /*:stopinsert*
+:sts tagsrch.txt /*:sts*
+:stselect tagsrch.txt /*:stselect*
+:su change.txt /*:su*
+:substitute change.txt /*:substitute*
+:sun windows.txt /*:sun*
+:sunhide windows.txt /*:sunhide*
+:sus starting.txt /*:sus*
+:suspend starting.txt /*:suspend*
+:sv windows.txt /*:sv*
+:sview windows.txt /*:sview*
+:sw recover.txt /*:sw*
+:swapname recover.txt /*:swapname*
+:sy syntax.txt /*:sy*
+:syn syntax.txt /*:syn*
+:syn-arguments syntax.txt /*:syn-arguments*
+:syn-case syntax.txt /*:syn-case*
+:syn-clear syntax.txt /*:syn-clear*
+:syn-cluster syntax.txt /*:syn-cluster*
+:syn-contained syntax.txt /*:syn-contained*
+:syn-containedin syntax.txt /*:syn-containedin*
+:syn-contains syntax.txt /*:syn-contains*
+:syn-context syntax.txt /*:syn-context*
+:syn-default-override usr_06.txt /*:syn-default-override*
+:syn-define syntax.txt /*:syn-define*
+:syn-display syntax.txt /*:syn-display*
+:syn-enable syntax.txt /*:syn-enable*
+:syn-end syntax.txt /*:syn-end*
+:syn-excludenl syntax.txt /*:syn-excludenl*
+:syn-ext-match syntax.txt /*:syn-ext-match*
+:syn-extend syntax.txt /*:syn-extend*
+:syn-file-remarks syntax.txt /*:syn-file-remarks*
+:syn-files syntax.txt /*:syn-files*
+:syn-fold syntax.txt /*:syn-fold*
+:syn-include syntax.txt /*:syn-include*
+:syn-keepend syntax.txt /*:syn-keepend*
+:syn-keyword syntax.txt /*:syn-keyword*
+:syn-lc syntax.txt /*:syn-lc*
+:syn-leading syntax.txt /*:syn-leading*
+:syn-list syntax.txt /*:syn-list*
+:syn-manual usr_06.txt /*:syn-manual*
+:syn-match syntax.txt /*:syn-match*
+:syn-matchgroup syntax.txt /*:syn-matchgroup*
+:syn-multi-line syntax.txt /*:syn-multi-line*
+:syn-nextgroup syntax.txt /*:syn-nextgroup*
+:syn-off usr_06.txt /*:syn-off*
+:syn-on syntax.txt /*:syn-on*
+:syn-oneline syntax.txt /*:syn-oneline*
+:syn-pattern syntax.txt /*:syn-pattern*
+:syn-pattern-offset syntax.txt /*:syn-pattern-offset*
+:syn-priority syntax.txt /*:syn-priority*
+:syn-qstart syntax.txt /*:syn-qstart*
+:syn-region syntax.txt /*:syn-region*
+:syn-reset syntax.txt /*:syn-reset*
+:syn-skip syntax.txt /*:syn-skip*
+:syn-skipempty syntax.txt /*:syn-skipempty*
+:syn-skipnl syntax.txt /*:syn-skipnl*
+:syn-skipwhite syntax.txt /*:syn-skipwhite*
+:syn-start syntax.txt /*:syn-start*
+:syn-sync syntax.txt /*:syn-sync*
+:syn-sync-ccomment syntax.txt /*:syn-sync-ccomment*
+:syn-sync-first syntax.txt /*:syn-sync-first*
+:syn-sync-fourth syntax.txt /*:syn-sync-fourth*
+:syn-sync-linebreaks syntax.txt /*:syn-sync-linebreaks*
+:syn-sync-maxlines syntax.txt /*:syn-sync-maxlines*
+:syn-sync-minlines syntax.txt /*:syn-sync-minlines*
+:syn-sync-second syntax.txt /*:syn-sync-second*
+:syn-sync-third syntax.txt /*:syn-sync-third*
+:syn-transparent syntax.txt /*:syn-transparent*
+:syncbind scroll.txt /*:syncbind*
+:syntax syntax.txt /*:syntax*
+:syntax-enable syntax.txt /*:syntax-enable*
+:syntax-on syntax.txt /*:syntax-on*
+:syntax-reset syntax.txt /*:syntax-reset*
+:t change.txt /*:t*
+:tN tagsrch.txt /*:tN*
+:tNext tagsrch.txt /*:tNext*
+:ta tagsrch.txt /*:ta*
+:tag tagsrch.txt /*:tag*
+:tags tagsrch.txt /*:tags*
+:tc if_tcl.txt /*:tc*
+:tcl if_tcl.txt /*:tcl*
+:tcld if_tcl.txt /*:tcld*
+:tcldo if_tcl.txt /*:tcldo*
+:tclf if_tcl.txt /*:tclf*
+:tclfile if_tcl.txt /*:tclfile*
+:te gui_w32.txt /*:te*
+:tearoff gui_w32.txt /*:tearoff*
+:tf tagsrch.txt /*:tf*
+:tfirst tagsrch.txt /*:tfirst*
+:th eval.txt /*:th*
+:throw eval.txt /*:throw*
+:tj tagsrch.txt /*:tj*
+:tjump tagsrch.txt /*:tjump*
+:tl tagsrch.txt /*:tl*
+:tlast tagsrch.txt /*:tlast*
+:tm gui.txt /*:tm*
+:tmenu gui.txt /*:tmenu*
+:tn tagsrch.txt /*:tn*
+:tnext tagsrch.txt /*:tnext*
+:topleft windows.txt /*:topleft*
+:tp tagsrch.txt /*:tp*
+:tprevious tagsrch.txt /*:tprevious*
+:tr tagsrch.txt /*:tr*
+:trewind tagsrch.txt /*:trewind*
+:try eval.txt /*:try*
+:ts tagsrch.txt /*:ts*
+:tselect tagsrch.txt /*:tselect*
+:tu gui.txt /*:tu*
+:tunmenu gui.txt /*:tunmenu*
+:u undo.txt /*:u*
+:un undo.txt /*:un*
+:una map.txt /*:una*
+:unabbreviate map.txt /*:unabbreviate*
+:undo undo.txt /*:undo*
+:unh windows.txt /*:unh*
+:unhide windows.txt /*:unhide*
+:unl eval.txt /*:unl*
+:unlet eval.txt /*:unlet*
+:unm map.txt /*:unm*
+:unm! map.txt /*:unm!*
+:unmap map.txt /*:unmap*
+:unmap! map.txt /*:unmap!*
+:unme gui.txt /*:unme*
+:unmenu gui.txt /*:unmenu*
+:unmenu-all gui.txt /*:unmenu-all*
+:up editing.txt /*:up*
+:update editing.txt /*:update*
+:v repeat.txt /*:v*
+:ve various.txt /*:ve*
+:verb various.txt /*:verb*
+:verbose various.txt /*:verbose*
+:version various.txt /*:version*
+:vert windows.txt /*:vert*
+:vertical windows.txt /*:vertical*
+:vertical-resize windows.txt /*:vertical-resize*
+:vglobal repeat.txt /*:vglobal*
+:vi editing.txt /*:vi*
+:vie editing.txt /*:vie*
+:view editing.txt /*:view*
+:visual editing.txt /*:visual*
+:visual_example visual.txt /*:visual_example*
+:vm map.txt /*:vm*
+:vmap map.txt /*:vmap*
+:vmap_l map.txt /*:vmap_l*
+:vmapc map.txt /*:vmapc*
+:vmapclear map.txt /*:vmapclear*
+:vme gui.txt /*:vme*
+:vmenu gui.txt /*:vmenu*
+:vn map.txt /*:vn*
+:vne windows.txt /*:vne*
+:vnew windows.txt /*:vnew*
+:vnoremap map.txt /*:vnoremap*
+:vnoreme gui.txt /*:vnoreme*
+:vnoremenu gui.txt /*:vnoremenu*
+:vs windows.txt /*:vs*
+:vsplit windows.txt /*:vsplit*
+:vu map.txt /*:vu*
+:vunmap map.txt /*:vunmap*
+:vunme gui.txt /*:vunme*
+:vunmenu gui.txt /*:vunmenu*
+:w editing.txt /*:w*
+:w! editing.txt /*:w!*
+:wN editing.txt /*:wN*
+:wNext editing.txt /*:wNext*
+:w_a editing.txt /*:w_a*
+:w_c editing.txt /*:w_c*
+:w_f editing.txt /*:w_f*
+:wa editing.txt /*:wa*
+:wall editing.txt /*:wall*
+:wh eval.txt /*:wh*
+:while eval.txt /*:while*
+:win gui.txt /*:win*
+:winc windows.txt /*:winc*
+:wincmd windows.txt /*:wincmd*
+:windo windows.txt /*:windo*
+:winp gui.txt /*:winp*
+:winpos gui.txt /*:winpos*
+:winsize gui.txt /*:winsize*
+:wn editing.txt /*:wn*
+:wnext editing.txt /*:wnext*
+:wp editing.txt /*:wp*
+:wprevious editing.txt /*:wprevious*
+:wq editing.txt /*:wq*
+:wqa editing.txt /*:wqa*
+:wqall editing.txt /*:wqall*
+:write editing.txt /*:write*
+:write_a editing.txt /*:write_a*
+:write_c editing.txt /*:write_c*
+:write_f editing.txt /*:write_f*
+:ws workshop.txt /*:ws*
+:wsverb workshop.txt /*:wsverb*
+:wv starting.txt /*:wv*
+:wviminfo starting.txt /*:wviminfo*
+:x editing.txt /*:x*
+:xa editing.txt /*:xa*
+:xall editing.txt /*:xall*
+:xit editing.txt /*:xit*
+:y change.txt /*:y*
+:yank change.txt /*:yank*
+:z various.txt /*:z*
+:z# various.txt /*:z#*
+:~ change.txt /*:~*
+; motion.txt /*;*
+< change.txt /*<*
+<2-LeftMouse> term.txt /*<2-LeftMouse>*
+<3-LeftMouse> term.txt /*<3-LeftMouse>*
+<4-LeftMouse> term.txt /*<4-LeftMouse>*
+<< change.txt /*<<*
+<> intro.txt /*<>*
+<A- intro.txt /*<A-*
+<BS> motion.txt /*<BS>*
+<Bar> intro.txt /*<Bar>*
+<Bslash> intro.txt /*<Bslash>*
+<C- intro.txt /*<C-*
+<C-Del> os_dos.txt /*<C-Del>*
+<C-End> motion.txt /*<C-End>*
+<C-Home> motion.txt /*<C-Home>*
+<C-Insert> os_dos.txt /*<C-Insert>*
+<C-Left> motion.txt /*<C-Left>*
+<C-LeftMouse> tagsrch.txt /*<C-LeftMouse>*
+<C-MouseDown> scroll.txt /*<C-MouseDown>*
+<C-MouseUp> scroll.txt /*<C-MouseUp>*
+<C-PageDown> os_dos.txt /*<C-PageDown>*
+<C-PageUp> os_dos.txt /*<C-PageUp>*
+<C-Right> motion.txt /*<C-Right>*
+<C-RightMouse> tagsrch.txt /*<C-RightMouse>*
+<CR> motion.txt /*<CR>*
+<CSI> intro.txt /*<CSI>*
+<Char-> map.txt /*<Char->*
+<Char> map.txt /*<Char>*
+<D- intro.txt /*<D-*
+<Del> change.txt /*<Del>*
+<Down> motion.txt /*<Down>*
+<Drop> change.txt /*<Drop>*
+<EOL> intro.txt /*<EOL>*
+<End> motion.txt /*<End>*
+<Enter> intro.txt /*<Enter>*
+<Esc> intro.txt /*<Esc>*
+<F10> term.txt /*<F10>*
+<F11> term.txt /*<F11>*
+<F12> term.txt /*<F12>*
+<F13> term.txt /*<F13>*
+<F14> term.txt /*<F14>*
+<F15> term.txt /*<F15>*
+<F16> term.txt /*<F16>*
+<F17> term.txt /*<F17>*
+<F18> term.txt /*<F18>*
+<F19> term.txt /*<F19>*
+<F1> various.txt /*<F1>*
+<F2> term.txt /*<F2>*
+<F3> term.txt /*<F3>*
+<F4> term.txt /*<F4>*
+<F5> term.txt /*<F5>*
+<F6> term.txt /*<F6>*
+<F7> term.txt /*<F7>*
+<F8> term.txt /*<F8>*
+<F9> term.txt /*<F9>*
+<Help> various.txt /*<Help>*
+<Home> motion.txt /*<Home>*
+<Insert> insert.txt /*<Insert>*
+<Leader> map.txt /*<Leader>*
+<Left> motion.txt /*<Left>*
+<LeftDrag> term.txt /*<LeftDrag>*
+<LeftMouse> visual.txt /*<LeftMouse>*
+<LeftRelease> visual.txt /*<LeftRelease>*
+<LocalLeader> map.txt /*<LocalLeader>*
+<M- intro.txt /*<M-*
+<MiddleDrag> term.txt /*<MiddleDrag>*
+<MiddleMouse> change.txt /*<MiddleMouse>*
+<MiddleRelease> term.txt /*<MiddleRelease>*
+<Mouse> term.txt /*<Mouse>*
+<MouseDown> scroll.txt /*<MouseDown>*
+<MouseUp> scroll.txt /*<MouseUp>*
+<NL> motion.txt /*<NL>*
+<Nop> map.txt /*<Nop>*
+<Nul> intro.txt /*<Nul>*
+<PageDown> scroll.txt /*<PageDown>*
+<PageUp> scroll.txt /*<PageUp>*
+<Plug> map.txt /*<Plug>*
+<Return> intro.txt /*<Return>*
+<Right> motion.txt /*<Right>*
+<RightDrag> term.txt /*<RightDrag>*
+<RightMouse> visual.txt /*<RightMouse>*
+<RightRelease> term.txt /*<RightRelease>*
+<S- intro.txt /*<S-*
+<S-Del> os_dos.txt /*<S-Del>*
+<S-Down> scroll.txt /*<S-Down>*
+<S-End> term.txt /*<S-End>*
+<S-F10> term.txt /*<S-F10>*
+<S-F11> term.txt /*<S-F11>*
+<S-F12> term.txt /*<S-F12>*
+<S-F1> intro.txt /*<S-F1>*
+<S-F2> term.txt /*<S-F2>*
+<S-F3> term.txt /*<S-F3>*
+<S-F4> term.txt /*<S-F4>*
+<S-F5> term.txt /*<S-F5>*
+<S-F6> term.txt /*<S-F6>*
+<S-F7> term.txt /*<S-F7>*
+<S-F8> term.txt /*<S-F8>*
+<S-F9> term.txt /*<S-F9>*
+<S-Home> term.txt /*<S-Home>*
+<S-Insert> os_dos.txt /*<S-Insert>*
+<S-Left> motion.txt /*<S-Left>*
+<S-LeftMouse> term.txt /*<S-LeftMouse>*
+<S-MouseDown> scroll.txt /*<S-MouseDown>*
+<S-MouseUp> scroll.txt /*<S-MouseUp>*
+<S-Right> motion.txt /*<S-Right>*
+<S-RightMouse> term.txt /*<S-RightMouse>*
+<S-Tab> term.txt /*<S-Tab>*
+<S-Up> scroll.txt /*<S-Up>*
+<S-xF1> term.txt /*<S-xF1>*
+<S-xF2> term.txt /*<S-xF2>*
+<S-xF3> term.txt /*<S-xF3>*
+<S-xF4> term.txt /*<S-xF4>*
+<SID> map.txt /*<SID>*
+<SNR> map.txt /*<SNR>*
+<Space> motion.txt /*<Space>*
+<Tab> motion.txt /*<Tab>*
+<Undo> undo.txt /*<Undo>*
+<Up> motion.txt /*<Up>*
+<abuf> cmdline.txt /*<abuf>*
+<afile> cmdline.txt /*<afile>*
+<amatch> cmdline.txt /*<amatch>*
+<args> map.txt /*<args>*
+<bang> map.txt /*<bang>*
+<cfile> cmdline.txt /*<cfile>*
+<character> intro.txt /*<character>*
+<count> map.txt /*<count>*
+<k0> term.txt /*<k0>*
+<k1> term.txt /*<k1>*
+<k2> term.txt /*<k2>*
+<k3> term.txt /*<k3>*
+<k4> term.txt /*<k4>*
+<k5> term.txt /*<k5>*
+<k6> term.txt /*<k6>*
+<k7> term.txt /*<k7>*
+<k8> term.txt /*<k8>*
+<k9> term.txt /*<k9>*
+<kDivide> term.txt /*<kDivide>*
+<kEnd> motion.txt /*<kEnd>*
+<kEnter> term.txt /*<kEnter>*
+<kHome> motion.txt /*<kHome>*
+<kMinus> term.txt /*<kMinus>*
+<kMultiply> term.txt /*<kMultiply>*
+<kPageDown> scroll.txt /*<kPageDown>*
+<kPageUp> scroll.txt /*<kPageUp>*
+<kPlus> term.txt /*<kPlus>*
+<kPoint> term.txt /*<kPoint>*
+<line1> map.txt /*<line1>*
+<line2> map.txt /*<line2>*
+<lt> intro.txt /*<lt>*
+<q-args> map.txt /*<q-args>*
+<reg> map.txt /*<reg>*
+<register> map.txt /*<register>*
+<sfile> cmdline.txt /*<sfile>*
+<xCSI> intro.txt /*<xCSI>*
+<xEnd> term.txt /*<xEnd>*
+<xEnd>-xterm term.txt /*<xEnd>-xterm*
+<xF1> term.txt /*<xF1>*
+<xF1>-xterm term.txt /*<xF1>-xterm*
+<xF2> term.txt /*<xF2>*
+<xF2>-xterm term.txt /*<xF2>-xterm*
+<xF3> term.txt /*<xF3>*
+<xF3>-xterm term.txt /*<xF3>-xterm*
+<xF4> term.txt /*<xF4>*
+<xF4>-xterm term.txt /*<xF4>-xterm*
+<xHome> term.txt /*<xHome>*
+<xHome>-xterm term.txt /*<xHome>-xterm*
+= change.txt /*=*
+== change.txt /*==*
+> change.txt /*>*
+>> change.txt /*>>*
+>cont repeat.txt /*>cont*
+>finish repeat.txt /*>finish*
+>interrupt repeat.txt /*>interrupt*
+>next repeat.txt /*>next*
+>quit repeat.txt /*>quit*
+>step repeat.txt /*>step*
+? pattern.txt /*?*
+?<CR> pattern.txt /*?<CR>*
+@ repeat.txt /*@*
+@/ change.txt /*@\/*
+@: repeat.txt /*@:*
+@@ repeat.txt /*@@*
+A insert.txt /*A*
+ACL editing.txt /*ACL*
+ATTENTION usr_11.txt /*ATTENTION*
+Abbreviations map.txt /*Abbreviations*
+Aleph options.txt /*Aleph*
+Amiga os_amiga.txt /*Amiga*
+Arabic arabic.txt /*Arabic*
+Atari os_mint.txt /*Atari*
+Athena gui_x11.txt /*Athena*
+B motion.txt /*B*
+BeBox os_beos.txt /*BeBox*
+BeOS os_beos.txt /*BeOS*
+BufAdd autocmd.txt /*BufAdd*
+BufCreate autocmd.txt /*BufCreate*
+BufDelete autocmd.txt /*BufDelete*
+BufEnter autocmd.txt /*BufEnter*
+BufFilePost autocmd.txt /*BufFilePost*
+BufFilePre autocmd.txt /*BufFilePre*
+BufHidden autocmd.txt /*BufHidden*
+BufLeave autocmd.txt /*BufLeave*
+BufNew autocmd.txt /*BufNew*
+BufNewFile autocmd.txt /*BufNewFile*
+BufRead autocmd.txt /*BufRead*
+BufReadCmd autocmd.txt /*BufReadCmd*
+BufReadPost autocmd.txt /*BufReadPost*
+BufReadPre autocmd.txt /*BufReadPre*
+BufUnload autocmd.txt /*BufUnload*
+BufWinEnter autocmd.txt /*BufWinEnter*
+BufWinLeave autocmd.txt /*BufWinLeave*
+BufWipeout autocmd.txt /*BufWipeout*
+BufWrite autocmd.txt /*BufWrite*
+BufWriteCmd autocmd.txt /*BufWriteCmd*
+BufWritePost autocmd.txt /*BufWritePost*
+BufWritePre autocmd.txt /*BufWritePre*
+C change.txt /*C*
+C-editing tips.txt /*C-editing*
+C-indenting indent.txt /*C-indenting*
+COMSPEC starting.txt /*COMSPEC*
+CR-used-for-NL pattern.txt /*CR-used-for-NL*
+CTRL-6 editing.txt /*CTRL-6*
+CTRL-A change.txt /*CTRL-A*
+CTRL-B scroll.txt /*CTRL-B*
+CTRL-C pattern.txt /*CTRL-C*
+CTRL-D scroll.txt /*CTRL-D*
+CTRL-E scroll.txt /*CTRL-E*
+CTRL-F scroll.txt /*CTRL-F*
+CTRL-G editing.txt /*CTRL-G*
+CTRL-H motion.txt /*CTRL-H*
+CTRL-I motion.txt /*CTRL-I*
+CTRL-J motion.txt /*CTRL-J*
+CTRL-L various.txt /*CTRL-L*
+CTRL-M motion.txt /*CTRL-M*
+CTRL-N motion.txt /*CTRL-N*
+CTRL-O motion.txt /*CTRL-O*
+CTRL-P motion.txt /*CTRL-P*
+CTRL-R undo.txt /*CTRL-R*
+CTRL-T tagsrch.txt /*CTRL-T*
+CTRL-U scroll.txt /*CTRL-U*
+CTRL-U-changed version6.txt /*CTRL-U-changed*
+CTRL-V visual.txt /*CTRL-V*
+CTRL-V-alternative gui_w32.txt /*CTRL-V-alternative*
+CTRL-W index.txt /*CTRL-W*
+CTRL-W_+ windows.txt /*CTRL-W_+*
+CTRL-W_- windows.txt /*CTRL-W_-*
+CTRL-W_< windows.txt /*CTRL-W_<*
+CTRL-W_<BS> windows.txt /*CTRL-W_<BS>*
+CTRL-W_<Down> windows.txt /*CTRL-W_<Down>*
+CTRL-W_<Left> windows.txt /*CTRL-W_<Left>*
+CTRL-W_<Right> windows.txt /*CTRL-W_<Right>*
+CTRL-W_<Up> windows.txt /*CTRL-W_<Up>*
+CTRL-W_= windows.txt /*CTRL-W_=*
+CTRL-W_> windows.txt /*CTRL-W_>*
+CTRL-W_CTRL-B windows.txt /*CTRL-W_CTRL-B*
+CTRL-W_CTRL-C windows.txt /*CTRL-W_CTRL-C*
+CTRL-W_CTRL-D tagsrch.txt /*CTRL-W_CTRL-D*
+CTRL-W_CTRL-F windows.txt /*CTRL-W_CTRL-F*
+CTRL-W_CTRL-H windows.txt /*CTRL-W_CTRL-H*
+CTRL-W_CTRL-I tagsrch.txt /*CTRL-W_CTRL-I*
+CTRL-W_CTRL-J windows.txt /*CTRL-W_CTRL-J*
+CTRL-W_CTRL-K windows.txt /*CTRL-W_CTRL-K*
+CTRL-W_CTRL-L windows.txt /*CTRL-W_CTRL-L*
+CTRL-W_CTRL-N windows.txt /*CTRL-W_CTRL-N*
+CTRL-W_CTRL-O windows.txt /*CTRL-W_CTRL-O*
+CTRL-W_CTRL-P windows.txt /*CTRL-W_CTRL-P*
+CTRL-W_CTRL-Q windows.txt /*CTRL-W_CTRL-Q*
+CTRL-W_CTRL-R windows.txt /*CTRL-W_CTRL-R*
+CTRL-W_CTRL-S windows.txt /*CTRL-W_CTRL-S*
+CTRL-W_CTRL-T windows.txt /*CTRL-W_CTRL-T*
+CTRL-W_CTRL-V windows.txt /*CTRL-W_CTRL-V*
+CTRL-W_CTRL-W windows.txt /*CTRL-W_CTRL-W*
+CTRL-W_CTRL-X windows.txt /*CTRL-W_CTRL-X*
+CTRL-W_CTRL-Z windows.txt /*CTRL-W_CTRL-Z*
+CTRL-W_CTRL-] windows.txt /*CTRL-W_CTRL-]*
+CTRL-W_CTRL-^ windows.txt /*CTRL-W_CTRL-^*
+CTRL-W_CTRL-_ windows.txt /*CTRL-W_CTRL-_*
+CTRL-W_H windows.txt /*CTRL-W_H*
+CTRL-W_J windows.txt /*CTRL-W_J*
+CTRL-W_K windows.txt /*CTRL-W_K*
+CTRL-W_L windows.txt /*CTRL-W_L*
+CTRL-W_P windows.txt /*CTRL-W_P*
+CTRL-W_R windows.txt /*CTRL-W_R*
+CTRL-W_S windows.txt /*CTRL-W_S*
+CTRL-W_W windows.txt /*CTRL-W_W*
+CTRL-W_] windows.txt /*CTRL-W_]*
+CTRL-W_^ windows.txt /*CTRL-W_^*
+CTRL-W__ windows.txt /*CTRL-W__*
+CTRL-W_b windows.txt /*CTRL-W_b*
+CTRL-W_bar windows.txt /*CTRL-W_bar*
+CTRL-W_c windows.txt /*CTRL-W_c*
+CTRL-W_d tagsrch.txt /*CTRL-W_d*
+CTRL-W_f windows.txt /*CTRL-W_f*
+CTRL-W_g] windows.txt /*CTRL-W_g]*
+CTRL-W_g_CTRL-] windows.txt /*CTRL-W_g_CTRL-]*
+CTRL-W_g} windows.txt /*CTRL-W_g}*
+CTRL-W_h windows.txt /*CTRL-W_h*
+CTRL-W_i tagsrch.txt /*CTRL-W_i*
+CTRL-W_j windows.txt /*CTRL-W_j*
+CTRL-W_k windows.txt /*CTRL-W_k*
+CTRL-W_l windows.txt /*CTRL-W_l*
+CTRL-W_n windows.txt /*CTRL-W_n*
+CTRL-W_o windows.txt /*CTRL-W_o*
+CTRL-W_p windows.txt /*CTRL-W_p*
+CTRL-W_q windows.txt /*CTRL-W_q*
+CTRL-W_r windows.txt /*CTRL-W_r*
+CTRL-W_s windows.txt /*CTRL-W_s*
+CTRL-W_t windows.txt /*CTRL-W_t*
+CTRL-W_v windows.txt /*CTRL-W_v*
+CTRL-W_w windows.txt /*CTRL-W_w*
+CTRL-W_x windows.txt /*CTRL-W_x*
+CTRL-W_z windows.txt /*CTRL-W_z*
+CTRL-W_} windows.txt /*CTRL-W_}*
+CTRL-X change.txt /*CTRL-X*
+CTRL-Y scroll.txt /*CTRL-Y*
+CTRL-Z starting.txt /*CTRL-Z*
+CTRL-\_CTRL-G intro.txt /*CTRL-\\_CTRL-G*
+CTRL-\_CTRL-N intro.txt /*CTRL-\\_CTRL-N*
+CTRL-] tagsrch.txt /*CTRL-]*
+CTRL-^ editing.txt /*CTRL-^*
+CTRL-{char} intro.txt /*CTRL-{char}*
+Chinese mbyte.txt /*Chinese*
+Cmd-event autocmd.txt /*Cmd-event*
+Cmdline cmdline.txt /*Cmdline*
+Cmdline-mode cmdline.txt /*Cmdline-mode*
+CmdwinEnter autocmd.txt /*CmdwinEnter*
+CmdwinLeave autocmd.txt /*CmdwinLeave*
+Command-line cmdline.txt /*Command-line*
+Command-line-mode cmdline.txt /*Command-line-mode*
+Contents quickref.txt /*Contents*
+Cscope if_cscop.txt /*Cscope*
+CursorHold autocmd.txt /*CursorHold*
+CursorHold-example windows.txt /*CursorHold-example*
+CursorIM mbyte.txt /*CursorIM*
+D change.txt /*D*
+DOS os_dos.txt /*DOS*
+DOS-format editing.txt /*DOS-format*
+DOS-format-write editing.txt /*DOS-format-write*
+DPMI os_msdos.txt /*DPMI*
+Digraphs digraph.txt /*Digraphs*
+E motion.txt /*E*
+E10 message.txt /*E10*
+E100 diff.txt /*E100*
+E101 diff.txt /*E101*
+E102 diff.txt /*E102*
+E103 diff.txt /*E103*
+E104 digraph.txt /*E104*
+E105 mbyte.txt /*E105*
+E106 eval.txt /*E106*
+E107 eval.txt /*E107*
+E108 eval.txt /*E108*
+E109 eval.txt /*E109*
+E11 cmdline.txt /*E11*
+E110 eval.txt /*E110*
+E111 eval.txt /*E111*
+E112 eval.txt /*E112*
+E113 eval.txt /*E113*
+E114 eval.txt /*E114*
+E115 eval.txt /*E115*
+E116 eval.txt /*E116*
+E117 eval.txt /*E117*
+E118 eval.txt /*E118*
+E119 eval.txt /*E119*
+E12 message.txt /*E12*
+E120 eval.txt /*E120*
+E121 eval.txt /*E121*
+E122 eval.txt /*E122*
+E123 eval.txt /*E123*
+E124 eval.txt /*E124*
+E125 eval.txt /*E125*
+E126 eval.txt /*E126*
+E127 eval.txt /*E127*
+E128 eval.txt /*E128*
+E129 eval.txt /*E129*
+E13 message.txt /*E13*
+E130 eval.txt /*E130*
+E131 eval.txt /*E131*
+E132 eval.txt /*E132*
+E133 eval.txt /*E133*
+E134 change.txt /*E134*
+E135 autocmd.txt /*E135*
+E136 starting.txt /*E136*
+E137 starting.txt /*E137*
+E138 starting.txt /*E138*
+E139 message.txt /*E139*
+E14 cmdline.txt /*E14*
+E140 message.txt /*E140*
+E141 message.txt /*E141*
+E142 message.txt /*E142*
+E143 autocmd.txt /*E143*
+E144 various.txt /*E144*
+E145 starting.txt /*E145*
+E146 change.txt /*E146*
+E147 repeat.txt /*E147*
+E148 repeat.txt /*E148*
+E149 various.txt /*E149*
+E15 eval.txt /*E15*
+E150 various.txt /*E150*
+E151 various.txt /*E151*
+E152 various.txt /*E152*
+E153 various.txt /*E153*
+E154 various.txt /*E154*
+E155 sign.txt /*E155*
+E156 sign.txt /*E156*
+E157 sign.txt /*E157*
+E158 sign.txt /*E158*
+E159 sign.txt /*E159*
+E16 cmdline.txt /*E16*
+E160 sign.txt /*E160*
+E161 repeat.txt /*E161*
+E162 message.txt /*E162*
+E163 editing.txt /*E163*
+E164 editing.txt /*E164*
+E165 editing.txt /*E165*
+E166 message.txt /*E166*
+E167 repeat.txt /*E167*
+E168 repeat.txt /*E168*
+E169 message.txt /*E169*
+E17 message.txt /*E17*
+E170 eval.txt /*E170*
+E171 eval.txt /*E171*
+E172 message.txt /*E172*
+E173 message.txt /*E173*
+E174 map.txt /*E174*
+E175 map.txt /*E175*
+E176 map.txt /*E176*
+E177 map.txt /*E177*
+E178 map.txt /*E178*
+E179 map.txt /*E179*
+E18 eval.txt /*E18*
+E180 map.txt /*E180*
+E181 map.txt /*E181*
+E182 map.txt /*E182*
+E183 map.txt /*E183*
+E184 map.txt /*E184*
+E185 syntax.txt /*E185*
+E186 editing.txt /*E186*
+E187 editing.txt /*E187*
+E188 gui.txt /*E188*
+E189 message.txt /*E189*
+E19 message.txt /*E19*
+E190 message.txt /*E190*
+E191 motion.txt /*E191*
+E192 message.txt /*E192*
+E193 eval.txt /*E193*
+E194 message.txt /*E194*
+E195 starting.txt /*E195*
+E196 various.txt /*E196*
+E197 mlang.txt /*E197*
+E198 options.txt /*E198*
+E199 cmdline.txt /*E199*
+E20 motion.txt /*E20*
+E200 autocmd.txt /*E200*
+E201 autocmd.txt /*E201*
+E202 options.txt /*E202*
+E203 autocmd.txt /*E203*
+E204 autocmd.txt /*E204*
+E205 if_pyth.txt /*E205*
+E206 options.txt /*E206*
+E207 editing.txt /*E207*
+E208 message.txt /*E208*
+E209 message.txt /*E209*
+E21 options.txt /*E21*
+E210 message.txt /*E210*
+E211 message.txt /*E211*
+E212 message.txt /*E212*
+E213 options.txt /*E213*
+E214 options.txt /*E214*
+E215 autocmd.txt /*E215*
+E216 autocmd.txt /*E216*
+E217 autocmd.txt /*E217*
+E218 autocmd.txt /*E218*
+E219 message.txt /*E219*
+E22 message.txt /*E22*
+E220 message.txt /*E220*
+E222 message.txt /*E222*
+E223 options.txt /*E223*
+E224 map.txt /*E224*
+E225 map.txt /*E225*
+E226 map.txt /*E226*
+E227 map.txt /*E227*
+E228 message.txt /*E228*
+E229 gui.txt /*E229*
+E23 message.txt /*E23*
+E230 starting.txt /*E230*
+E231 options.txt /*E231*
+E232 message.txt /*E232*
+E233 gui.txt /*E233*
+E234 options.txt /*E234*
+E235 options.txt /*E235*
+E236 options.txt /*E236*
+E237 various.txt /*E237*
+E238 various.txt /*E238*
+E239 sign.txt /*E239*
+E24 message.txt /*E24*
+E240 remote.txt /*E240*
+E241 eval.txt /*E241*
+E243 if_ole.txt /*E243*
+E244 options.txt /*E244*
+E245 options.txt /*E245*
+E246 autocmd.txt /*E246*
+E247 remote.txt /*E247*
+E248 remote.txt /*E248*
+E25 message.txt /*E25*
+E250 options.txt /*E250*
+E251 remote.txt /*E251*
+E252 options.txt /*E252*
+E253 mbyte.txt /*E253*
+E254 message.txt /*E254*
+E255 sign.txt /*E255*
+E256 message.txt /*E256*
+E257 if_cscop.txt /*E257*
+E258 remote.txt /*E258*
+E259 if_cscop.txt /*E259*
+E26 rileft.txt /*E26*
+E260 if_cscop.txt /*E260*
+E261 if_cscop.txt /*E261*
+E262 if_cscop.txt /*E262*
+E263 if_pyth.txt /*E263*
+E264 if_pyth.txt /*E264*
+E265 if_ruby.txt /*E265*
+E266 if_ruby.txt /*E266*
+E267 if_ruby.txt /*E267*
+E268 if_ruby.txt /*E268*
+E269 if_ruby.txt /*E269*
+E27 farsi.txt /*E27*
+E270 if_ruby.txt /*E270*
+E271 if_ruby.txt /*E271*
+E272 if_ruby.txt /*E272*
+E273 if_ruby.txt /*E273*
+E274 if_sniff.txt /*E274*
+E275 if_sniff.txt /*E275*
+E276 if_sniff.txt /*E276*
+E277 remote.txt /*E277*
+E278 if_sniff.txt /*E278*
+E279 if_sniff.txt /*E279*
+E28 syntax.txt /*E28*
+E280 if_tcl.txt /*E280*
+E281 if_tcl.txt /*E281*
+E282 starting.txt /*E282*
+E283 motion.txt /*E283*
+E284 mbyte.txt /*E284*
+E285 mbyte.txt /*E285*
+E286 mbyte.txt /*E286*
+E287 mbyte.txt /*E287*
+E288 mbyte.txt /*E288*
+E289 mbyte.txt /*E289*
+E29 change.txt /*E29*
+E290 mbyte.txt /*E290*
+E291 mbyte.txt /*E291*
+E292 mbyte.txt /*E292*
+E293 message.txt /*E293*
+E294 message.txt /*E294*
+E295 message.txt /*E295*
+E296 message.txt /*E296*
+E297 message.txt /*E297*
+E298 message.txt /*E298*
+E299 if_perl.txt /*E299*
+E30 change.txt /*E30*
+E300 message.txt /*E300*
+E301 message.txt /*E301*
+E302 message.txt /*E302*
+E303 message.txt /*E303*
+E304 message.txt /*E304*
+E305 recover.txt /*E305*
+E306 recover.txt /*E306*
+E307 recover.txt /*E307*
+E308 recover.txt /*E308*
+E309 recover.txt /*E309*
+E31 message.txt /*E31*
+E310 recover.txt /*E310*
+E311 recover.txt /*E311*
+E312 recover.txt /*E312*
+E313 recover.txt /*E313*
+E314 recover.txt /*E314*
+E315 message.txt /*E315*
+E316 message.txt /*E316*
+E317 message.txt /*E317*
+E318 message.txt /*E318*
+E319 message.txt /*E319*
+E32 message.txt /*E32*
+E320 message.txt /*E320*
+E321 editing.txt /*E321*
+E322 message.txt /*E322*
+E323 message.txt /*E323*
+E324 various.txt /*E324*
+E325 usr_11.txt /*E325*
+E326 recover.txt /*E326*
+E327 gui.txt /*E327*
+E328 gui.txt /*E328*
+E329 gui.txt /*E329*
+E33 message.txt /*E33*
+E330 gui.txt /*E330*
+E331 gui.txt /*E331*
+E332 gui.txt /*E332*
+E333 gui.txt /*E333*
+E334 gui.txt /*E334*
+E335 gui.txt /*E335*
+E336 gui.txt /*E336*
+E337 gui.txt /*E337*
+E338 editing.txt /*E338*
+E339 message.txt /*E339*
+E34 various.txt /*E34*
+E340 vi_diff.txt /*E340*
+E341 message.txt /*E341*
+E342 message.txt /*E342*
+E343 options.txt /*E343*
+E344 options.txt /*E344*
+E345 options.txt /*E345*
+E346 options.txt /*E346*
+E347 options.txt /*E347*
+E348 pattern.txt /*E348*
+E349 pattern.txt /*E349*
+E35 message.txt /*E35*
+E350 fold.txt /*E350*
+E351 fold.txt /*E351*
+E352 fold.txt /*E352*
+E353 change.txt /*E353*
+E354 change.txt /*E354*
+E355 options.txt /*E355*
+E356 message.txt /*E356*
+E357 options.txt /*E357*
+E358 options.txt /*E358*
+E359 term.txt /*E359*
+E36 windows.txt /*E36*
+E360 various.txt /*E360*
+E361 pattern.txt /*E361*
+E362 term.txt /*E362*
+E363 pattern.txt /*E363*
+E364 eval.txt /*E364*
+E365 options.txt /*E365*
+E366 options.txt /*E366*
+E367 autocmd.txt /*E367*
+E368 eval.txt /*E368*
+E369 pattern.txt /*E369*
+E37 message.txt /*E37*
+E370 various.txt /*E370*
+E371 various.txt /*E371*
+E372 quickfix.txt /*E372*
+E373 quickfix.txt /*E373*
+E374 quickfix.txt /*E374*
+E375 quickfix.txt /*E375*
+E376 quickfix.txt /*E376*
+E377 quickfix.txt /*E377*
+E378 quickfix.txt /*E378*
+E379 quickfix.txt /*E379*
+E38 message.txt /*E38*
+E380 quickfix.txt /*E380*
+E381 quickfix.txt /*E381*
+E382 options.txt /*E382*
+E383 pattern.txt /*E383*
+E384 options.txt /*E384*
+E385 options.txt /*E385*
+E386 pattern.txt /*E386*
+E387 tagsrch.txt /*E387*
+E388 tagsrch.txt /*E388*
+E389 tagsrch.txt /*E389*
+E39 digraph.txt /*E39*
+E390 syntax.txt /*E390*
+E391 syntax.txt /*E391*
+E392 syntax.txt /*E392*
+E393 syntax.txt /*E393*
+E394 syntax.txt /*E394*
+E395 syntax.txt /*E395*
+E396 syntax.txt /*E396*
+E397 syntax.txt /*E397*
+E398 syntax.txt /*E398*
+E399 syntax.txt /*E399*
+E40 message.txt /*E40*
+E400 syntax.txt /*E400*
+E401 syntax.txt /*E401*
+E402 syntax.txt /*E402*
+E403 syntax.txt /*E403*
+E404 syntax.txt /*E404*
+E405 syntax.txt /*E405*
+E406 syntax.txt /*E406*
+E407 syntax.txt /*E407*
+E408 syntax.txt /*E408*
+E409 syntax.txt /*E409*
+E41 message.txt /*E41*
+E410 syntax.txt /*E410*
+E411 syntax.txt /*E411*
+E412 syntax.txt /*E412*
+E413 syntax.txt /*E413*
+E414 syntax.txt /*E414*
+E415 syntax.txt /*E415*
+E416 syntax.txt /*E416*
+E417 syntax.txt /*E417*
+E418 syntax.txt /*E418*
+E419 syntax.txt /*E419*
+E42 quickfix.txt /*E42*
+E420 syntax.txt /*E420*
+E421 syntax.txt /*E421*
+E422 syntax.txt /*E422*
+E423 syntax.txt /*E423*
+E424 message.txt /*E424*
+E425 tagsrch.txt /*E425*
+E426 tagsrch.txt /*E426*
+E427 tagsrch.txt /*E427*
+E428 tagsrch.txt /*E428*
+E429 tagsrch.txt /*E429*
+E43 message.txt /*E43*
+E430 tagsrch.txt /*E430*
+E431 tagsrch.txt /*E431*
+E432 message.txt /*E432*
+E433 options.txt /*E433*
+E434 tagsrch.txt /*E434*
+E435 tagsrch.txt /*E435*
+E436 term.txt /*E436*
+E437 term.txt /*E437*
+E438 message.txt /*E438*
+E439 message.txt /*E439*
+E44 message.txt /*E44*
+E440 message.txt /*E440*
+E441 windows.txt /*E441*
+E442 windows.txt /*E442*
+E443 windows.txt /*E443*
+E444 windows.txt /*E444*
+E445 windows.txt /*E445*
+E446 editing.txt /*E446*
+E447 editing.txt /*E447*
+E448 various.txt /*E448*
+E449 eval.txt /*E449*
+E45 message.txt /*E45*
+E450 os_msdos.txt /*E450*
+E451 os_msdos.txt /*E451*
+E452 os_msdos.txt /*E452*
+E453 os_msdos.txt /*E453*
+E454 os_msdos.txt /*E454*
+E455 various.txt /*E455*
+E456 various.txt /*E456*
+E457 various.txt /*E457*
+E458 message.txt /*E458*
+E459 message.txt /*E459*
+E46 message.txt /*E46*
+E460 message.txt /*E460*
+E461 eval.txt /*E461*
+E462 editing.txt /*E462*
+E463 netbeans.txt /*E463*
+E464 message.txt /*E464*
+E465 gui.txt /*E465*
+E466 gui.txt /*E466*
+E467 map.txt /*E467*
+E468 map.txt /*E468*
+E469 if_cscop.txt /*E469*
+E47 message.txt /*E47*
+E470 change.txt /*E470*
+E471 message.txt /*E471*
+E472 editing.txt /*E472*
+E473 message.txt /*E473*
+E474 message.txt /*E474*
+E475 message.txt /*E475*
+E476 pattern.txt /*E476*
+E477 message.txt /*E477*
+E478 message.txt /*E478*
+E479 editing.txt /*E479*
+E48 eval.txt /*E48*
+E480 editing.txt /*E480*
+E481 message.txt /*E481*
+E482 message.txt /*E482*
+E483 message.txt /*E483*
+E484 message.txt /*E484*
+E485 message.txt /*E485*
+E486 pattern.txt /*E486*
+E487 options.txt /*E487*
+E488 message.txt /*E488*
+E489 intro.txt /*E489*
+E49 message.txt /*E49*
+E490 fold.txt /*E490*
+E492 message.txt /*E492*
+E493 cmdline.txt /*E493*
+E494 editing.txt /*E494*
+E495 cmdline.txt /*E495*
+E496 cmdline.txt /*E496*
+E497 cmdline.txt /*E497*
+E498 cmdline.txt /*E498*
+E499 cmdline.txt /*E499*
+E50 syntax.txt /*E50*
+E500 cmdline.txt /*E500*
+E501 intro.txt /*E501*
+E502 editing.txt /*E502*
+E503 editing.txt /*E503*
+E504 editing.txt /*E504*
+E505 editing.txt /*E505*
+E506 editing.txt /*E506*
+E507 editing.txt /*E507*
+E508 editing.txt /*E508*
+E509 editing.txt /*E509*
+E51 pattern.txt /*E51*
+E510 editing.txt /*E510*
+E512 editing.txt /*E512*
+E513 options.txt /*E513*
+E514 editing.txt /*E514*
+E515 windows.txt /*E515*
+E516 windows.txt /*E516*
+E517 windows.txt /*E517*
+E518 options.txt /*E518*
+E519 options.txt /*E519*
+E52 syntax.txt /*E52*
+E520 options.txt /*E520*
+E521 options.txt /*E521*
+E522 options.txt /*E522*
+E523 options.txt /*E523*
+E524 options.txt /*E524*
+E525 options.txt /*E525*
+E526 options.txt /*E526*
+E527 options.txt /*E527*
+E528 options.txt /*E528*
+E529 options.txt /*E529*
+E53 pattern.txt /*E53*
+E530 options.txt /*E530*
+E531 options.txt /*E531*
+E533 options.txt /*E533*
+E534 options.txt /*E534*
+E535 options.txt /*E535*
+E536 options.txt /*E536*
+E537 options.txt /*E537*
+E538 options.txt /*E538*
+E539 options.txt /*E539*
+E54 pattern.txt /*E54*
+E540 options.txt /*E540*
+E541 options.txt /*E541*
+E542 options.txt /*E542*
+E543 options.txt /*E543*
+E544 options.txt /*E544*
+E545 options.txt /*E545*
+E546 options.txt /*E546*
+E547 options.txt /*E547*
+E548 options.txt /*E548*
+E549 options.txt /*E549*
+E55 pattern.txt /*E55*
+E550 options.txt /*E550*
+E551 options.txt /*E551*
+E552 options.txt /*E552*
+E553 quickfix.txt /*E553*
+E554 pattern.txt /*E554*
+E555 tagsrch.txt /*E555*
+E556 tagsrch.txt /*E556*
+E557 term.txt /*E557*
+E558 term.txt /*E558*
+E559 term.txt /*E559*
+E56 pattern.txt /*E56*
+E560 if_cscop.txt /*E560*
+E561 if_cscop.txt /*E561*
+E562 if_cscop.txt /*E562*
+E563 if_cscop.txt /*E563*
+E564 if_cscop.txt /*E564*
+E565 if_cscop.txt /*E565*
+E566 if_cscop.txt /*E566*
+E567 if_cscop.txt /*E567*
+E568 if_cscop.txt /*E568*
+E569 if_cscop.txt /*E569*
+E57 pattern.txt /*E57*
+E570 message.txt /*E570*
+E571 if_tcl.txt /*E571*
+E572 if_tcl.txt /*E572*
+E573 remote.txt /*E573*
+E574 starting.txt /*E574*
+E575 starting.txt /*E575*
+E576 starting.txt /*E576*
+E577 starting.txt /*E577*
+E578 editing.txt /*E578*
+E579 eval.txt /*E579*
+E58 pattern.txt /*E58*
+E580 eval.txt /*E580*
+E581 eval.txt /*E581*
+E582 eval.txt /*E582*
+E583 eval.txt /*E583*
+E584 eval.txt /*E584*
+E585 eval.txt /*E585*
+E586 eval.txt /*E586*
+E587 eval.txt /*E587*
+E588 eval.txt /*E588*
+E589 options.txt /*E589*
+E59 pattern.txt /*E59*
+E590 options.txt /*E590*
+E591 options.txt /*E591*
+E592 options.txt /*E592*
+E593 options.txt /*E593*
+E594 options.txt /*E594*
+E595 options.txt /*E595*
+E596 options.txt /*E596*
+E597 options.txt /*E597*
+E598 options.txt /*E598*
+E60 pattern.txt /*E60*
+E600 eval.txt /*E600*
+E601 eval.txt /*E601*
+E602 eval.txt /*E602*
+E603 eval.txt /*E603*
+E604 eval.txt /*E604*
+E605 eval.txt /*E605*
+E606 eval.txt /*E606*
+E607 eval.txt /*E607*
+E608 eval.txt /*E608*
+E609 if_cscop.txt /*E609*
+E61 pattern.txt /*E61*
+E610 options.txt /*E610*
+E611 options.txt /*E611*
+E612 sign.txt /*E612*
+E613 options.txt /*E613*
+E614 editing.txt /*E614*
+E615 editing.txt /*E615*
+E616 editing.txt /*E616*
+E617 options.txt /*E617*
+E618 various.txt /*E618*
+E619 various.txt /*E619*
+E62 pattern.txt /*E62*
+E620 options.txt /*E620*
+E621 various.txt /*E621*
+E622 if_cscop.txt /*E622*
+E623 if_cscop.txt /*E623*
+E624 various.txt /*E624*
+E625 if_cscop.txt /*E625*
+E626 if_cscop.txt /*E626*
+E627 netbeans.txt /*E627*
+E628 netbeans.txt /*E628*
+E629 netbeans.txt /*E629*
+E63 pattern.txt /*E63*
+E630 netbeans.txt /*E630*
+E631 netbeans.txt /*E631*
+E632 netbeans.txt /*E632*
+E633 netbeans.txt /*E633*
+E634 netbeans.txt /*E634*
+E635 netbeans.txt /*E635*
+E636 netbeans.txt /*E636*
+E637 netbeans.txt /*E637*
+E638 netbeans.txt /*E638*
+E639 netbeans.txt /*E639*
+E64 pattern.txt /*E64*
+E640 netbeans.txt /*E640*
+E641 netbeans.txt /*E641*
+E642 netbeans.txt /*E642*
+E643 netbeans.txt /*E643*
+E644 netbeans.txt /*E644*
+E645 netbeans.txt /*E645*
+E646 netbeans.txt /*E646*
+E647 netbeans.txt /*E647*
+E648 netbeans.txt /*E648*
+E649 netbeans.txt /*E649*
+E65 pattern.txt /*E65*
+E650 netbeans.txt /*E650*
+E651 netbeans.txt /*E651*
+E652 netbeans.txt /*E652*
+E653 netbeans.txt /*E653*
+E654 netbeans.txt /*E654*
+E655 eval.txt /*E655*
+E656 netbeans.txt /*E656*
+E657 netbeans.txt /*E657*
+E658 netbeans.txt /*E658*
+E659 if_pyth.txt /*E659*
+E66 syntax.txt /*E66*
+E660 netbeans.txt /*E660*
+E661 various.txt /*E661*
+E662 motion.txt /*E662*
+E663 motion.txt /*E663*
+E664 motion.txt /*E664*
+E665 gui_x11.txt /*E665*
+E666 quickfix.txt /*E666*
+E667 editing.txt /*E667*
+E668 netbeans.txt /*E668*
+E669 syntax.txt /*E669*
+E67 syntax.txt /*E67*
+E670 various.txt /*E670*
+E671 starting.txt /*E671*
+E672 starting.txt /*E672*
+E68 pattern.txt /*E68*
+E69 pattern.txt /*E69*
+E70 pattern.txt /*E70*
+E71 pattern.txt /*E71*
+E72 message.txt /*E72*
+E73 tagsrch.txt /*E73*
+E74 message.txt /*E74*
+E75 vi_diff.txt /*E75*
+E76 pattern.txt /*E76*
+E77 message.txt /*E77*
+E78 motion.txt /*E78*
+E79 message.txt /*E79*
+E80 message.txt /*E80*
+E800 arabic.txt /*E800*
+E81 map.txt /*E81*
+E82 message.txt /*E82*
+E83 message.txt /*E83*
+E84 windows.txt /*E84*
+E85 options.txt /*E85*
+E86 windows.txt /*E86*
+E87 windows.txt /*E87*
+E88 windows.txt /*E88*
+E89 message.txt /*E89*
+E90 message.txt /*E90*
+E91 options.txt /*E91*
+E92 message.txt /*E92*
+E93 windows.txt /*E93*
+E94 windows.txt /*E94*
+E95 message.txt /*E95*
+E96 diff.txt /*E96*
+E97 diff.txt /*E97*
+E98 diff.txt /*E98*
+E99 diff.txt /*E99*
+EX intro.txt /*EX*
+EXINIT starting.txt /*EXINIT*
+Elvis intro.txt /*Elvis*
+EncodingChanged autocmd.txt /*EncodingChanged*
+Eterm syntax.txt /*Eterm*
+Ex intro.txt /*Ex*
+Ex-mode intro.txt /*Ex-mode*
+F motion.txt /*F*
+FAQ intro.txt /*FAQ*
+Farsi farsi.txt /*Farsi*
+FileAppendCmd autocmd.txt /*FileAppendCmd*
+FileAppendPost autocmd.txt /*FileAppendPost*
+FileAppendPre autocmd.txt /*FileAppendPre*
+FileChangedRO autocmd.txt /*FileChangedRO*
+FileChangedShell autocmd.txt /*FileChangedShell*
+FileEncoding autocmd.txt /*FileEncoding*
+FileReadCmd autocmd.txt /*FileReadCmd*
+FileReadPost autocmd.txt /*FileReadPost*
+FileReadPre autocmd.txt /*FileReadPre*
+FileType autocmd.txt /*FileType*
+FileWriteCmd autocmd.txt /*FileWriteCmd*
+FileWritePost autocmd.txt /*FileWritePost*
+FileWritePre autocmd.txt /*FileWritePre*
+FilterReadPost autocmd.txt /*FilterReadPost*
+FilterReadPre autocmd.txt /*FilterReadPre*
+FilterWritePost autocmd.txt /*FilterWritePost*
+FilterWritePre autocmd.txt /*FilterWritePre*
+FocusGained autocmd.txt /*FocusGained*
+FocusLost autocmd.txt /*FocusLost*
+Folding fold.txt /*Folding*
+FuncUndefined autocmd.txt /*FuncUndefined*
+G motion.txt /*G*
+GNOME gui_x11.txt /*GNOME*
+GTK gui_x11.txt /*GTK*
+GTK+ gui_x11.txt /*GTK+*
+GUI gui.txt /*GUI*
+GUI-X11 gui_x11.txt /*GUI-X11*
+GUIEnter autocmd.txt /*GUIEnter*
+Gnome gui_x11.txt /*Gnome*
+H motion.txt /*H*
+I insert.txt /*I*
+ICCF uganda.txt /*ICCF*
+IM-server mbyte.txt /*IM-server*
+IME mbyte.txt /*IME*
+Insert insert.txt /*Insert*
+Insert-mode insert.txt /*Insert-mode*
+J change.txt /*J*
+Japanese mbyte.txt /*Japanese*
+K various.txt /*K*
+Korean mbyte.txt /*Korean*
+L motion.txt /*L*
+Linux-backspace options.txt /*Linux-backspace*
+M motion.txt /*M*
+MDI starting.txt /*MDI*
+MS-DOS os_msdos.txt /*MS-DOS*
+MS-Windows os_win32.txt /*MS-Windows*
+MSDOS os_msdos.txt /*MSDOS*
+MSVisualStudio if_ole.txt /*MSVisualStudio*
+MVS os_390.txt /*MVS*
+Mac os_mac.txt /*Mac*
+Mac-format editing.txt /*Mac-format*
+Mac-format-write editing.txt /*Mac-format-write*
+Macintosh os_mac.txt /*Macintosh*
+Mark motion.txt /*Mark*
+MiNT os_mint.txt /*MiNT*
+MorphOS os_amiga.txt /*MorphOS*
+Motif gui_x11.txt /*Motif*
+N pattern.txt /*N*
+N% motion.txt /*N%*
+N: cmdline.txt /*N:*
+N<Del> various.txt /*N<Del>*
+NL-used-for-Nul pattern.txt /*NL-used-for-Nul*
+NetBSD-backspace options.txt /*NetBSD-backspace*
+Normal intro.txt /*Normal*
+Normal-mode intro.txt /*Normal-mode*
+Nread pi_netrw.txt /*Nread*
+Nvi intro.txt /*Nvi*
+Nwrite pi_netrw.txt /*Nwrite*
+O insert.txt /*O*
+OS/2 os_os2.txt /*OS\/2*
+OS2 os_os2.txt /*OS2*
+OS390 os_390.txt /*OS390*
+OS390-Motif os_390.txt /*OS390-Motif*
+OS390-bugs os_390.txt /*OS390-bugs*
+OS390-building os_390.txt /*OS390-building*
+OS390-changes os_390.txt /*OS390-changes*
+OS390-feedback os_390.txt /*OS390-feedback*
+OS390-has-ebcdic os_390.txt /*OS390-has-ebcdic*
+OS390-open-source os_390.txt /*OS390-open-source*
+OS390-weaknesses os_390.txt /*OS390-weaknesses*
+OS390-xterm os_390.txt /*OS390-xterm*
+OffTheSpot mbyte.txt /*OffTheSpot*
+OnTheSpot mbyte.txt /*OnTheSpot*
+Operator-pending intro.txt /*Operator-pending*
+Operator-pending-mode intro.txt /*Operator-pending-mode*
+OverTheSpot mbyte.txt /*OverTheSpot*
+P change.txt /*P*
+Pattern pattern.txt /*Pattern*
+Perl if_perl.txt /*Perl*
+Posix intro.txt /*Posix*
+Python if_pyth.txt /*Python*
+Q intro.txt /*Q*
+Q-command-changed version5.txt /*Q-command-changed*
+QNX os_qnx.txt /*QNX*
+Q_ab quickref.txt /*Q_ab*
+Q_ac quickref.txt /*Q_ac*
+Q_ai quickref.txt /*Q_ai*
+Q_bu quickref.txt /*Q_bu*
+Q_ce quickref.txt /*Q_ce*
+Q_ch quickref.txt /*Q_ch*
+Q_cm quickref.txt /*Q_cm*
+Q_co quickref.txt /*Q_co*
+Q_ct help.txt /*Q_ct*
+Q_de quickref.txt /*Q_de*
+Q_di quickref.txt /*Q_di*
+Q_ed quickref.txt /*Q_ed*
+Q_et quickref.txt /*Q_et*
+Q_ex quickref.txt /*Q_ex*
+Q_fl quickref.txt /*Q_fl*
+Q_fo quickref.txt /*Q_fo*
+Q_gu quickref.txt /*Q_gu*
+Q_in quickref.txt /*Q_in*
+Q_km quickref.txt /*Q_km*
+Q_lr quickref.txt /*Q_lr*
+Q_ma quickref.txt /*Q_ma*
+Q_op quickref.txt /*Q_op*
+Q_pa quickref.txt /*Q_pa*
+Q_qf quickref.txt /*Q_qf*
+Q_ra quickref.txt /*Q_ra*
+Q_re quickref.txt /*Q_re*
+Q_sc quickref.txt /*Q_sc*
+Q_si quickref.txt /*Q_si*
+Q_ss quickref.txt /*Q_ss*
+Q_st quickref.txt /*Q_st*
+Q_sy quickref.txt /*Q_sy*
+Q_ta quickref.txt /*Q_ta*
+Q_tm quickref.txt /*Q_tm*
+Q_to quickref.txt /*Q_to*
+Q_ud quickref.txt /*Q_ud*
+Q_ur quickref.txt /*Q_ur*
+Q_vc quickref.txt /*Q_vc*
+Q_vi quickref.txt /*Q_vi*
+Q_vm quickref.txt /*Q_vm*
+Q_wi quickref.txt /*Q_wi*
+Q_wq quickref.txt /*Q_wq*
+Quickfix quickfix.txt /*Quickfix*
+R change.txt /*R*
+RISC-OS os_risc.txt /*RISC-OS*
+RISCOS os_risc.txt /*RISCOS*
+RemoteReply autocmd.txt /*RemoteReply*
+Replace insert.txt /*Replace*
+Replace-mode insert.txt /*Replace-mode*
+Root mbyte.txt /*Root*
+Ruby if_ruby.txt /*Ruby*
+Russian russian.txt /*Russian*
+S change.txt /*S*
+SHELL starting.txt /*SHELL*
+Select visual.txt /*Select*
+Select-mode visual.txt /*Select-mode*
+Select-mode-mapping visual.txt /*Select-mode-mapping*
+Session starting.txt /*Session*
+StdinReadPost autocmd.txt /*StdinReadPost*
+StdinReadPre autocmd.txt /*StdinReadPre*
+Syntax autocmd.txt /*Syntax*
+T motion.txt /*T*
+TCL if_tcl.txt /*TCL*
+TERM starting.txt /*TERM*
+TTpro-telnet syntax.txt /*TTpro-telnet*
+Tab intro.txt /*Tab*
+Tcl if_tcl.txt /*Tcl*
+TermChanged autocmd.txt /*TermChanged*
+TermResponse autocmd.txt /*TermResponse*
+U undo.txt /*U*
+UTF-8 mbyte.txt /*UTF-8*
+UTF8-xterm mbyte.txt /*UTF8-xterm*
+Uganda uganda.txt /*Uganda*
+Unicode mbyte.txt /*Unicode*
+Unix os_unix.txt /*Unix*
+Unix-format editing.txt /*Unix-format*
+Unix-format-write editing.txt /*Unix-format-write*
+User autocmd.txt /*User*
+UserGettingBored autocmd.txt /*UserGettingBored*
+V visual.txt /*V*
+VIMINIT starting.txt /*VIMINIT*
+VMS os_vms.txt /*VMS*
+Vi intro.txt /*Vi*
+View starting.txt /*View*
+VimEnter autocmd.txt /*VimEnter*
+VimLeave autocmd.txt /*VimLeave*
+VimLeavePre autocmd.txt /*VimLeavePre*
+Virtual-Replace-mode insert.txt /*Virtual-Replace-mode*
+VisVim if_ole.txt /*VisVim*
+Visual visual.txt /*Visual*
+Visual-mode visual.txt /*Visual-mode*
+W motion.txt /*W*
+W10 message.txt /*W10*
+W11 message.txt /*W11*
+W12 message.txt /*W12*
+W13 message.txt /*W13*
+W14 message.txt /*W14*
+W15 repeat.txt /*W15*
+W16 message.txt /*W16*
+W17 arabic.txt /*W17*
+W18 syntax.txt /*W18*
+WORD motion.txt /*WORD*
+Win32 os_win32.txt /*Win32*
+WinEnter autocmd.txt /*WinEnter*
+WinLeave autocmd.txt /*WinLeave*
+X change.txt /*X*
+X11 options.txt /*X11*
+X11-icon gui_x11.txt /*X11-icon*
+X11_mouse_shapes gui_x11.txt /*X11_mouse_shapes*
+X1Drag term.txt /*X1Drag*
+X1Mouse term.txt /*X1Mouse*
+X1Release term.txt /*X1Release*
+X2Drag term.txt /*X2Drag*
+X2Mouse term.txt /*X2Mouse*
+X2Release term.txt /*X2Release*
+XIM mbyte.txt /*XIM*
+XLFD mbyte.txt /*XLFD*
+Y change.txt /*Y*
+Y2K intro.txt /*Y2K*
+ZQ editing.txt /*ZQ*
+ZZ editing.txt /*ZZ*
+[ index.txt /*[*
+[# motion.txt /*[#*
+[' motion.txt /*['*
+[( motion.txt /*[(*
+[++opt] editing.txt /*[++opt]*
+[+cmd] editing.txt /*[+cmd]*
+[/ motion.txt /*[\/*
+[:alnum:] pattern.txt /*[:alnum:]*
+[:alpha:] pattern.txt /*[:alpha:]*
+[:backspace:] pattern.txt /*[:backspace:]*
+[:blank:] pattern.txt /*[:blank:]*
+[:cntrl:] pattern.txt /*[:cntrl:]*
+[:digit:] pattern.txt /*[:digit:]*
+[:escape:] pattern.txt /*[:escape:]*
+[:graph:] pattern.txt /*[:graph:]*
+[:lower:] pattern.txt /*[:lower:]*
+[:print:] pattern.txt /*[:print:]*
+[:punct:] pattern.txt /*[:punct:]*
+[:return:] pattern.txt /*[:return:]*
+[:space:] pattern.txt /*[:space:]*
+[:tab:] pattern.txt /*[:tab:]*
+[:upper:] pattern.txt /*[:upper:]*
+[:xdigit:] pattern.txt /*[:xdigit:]*
+[<MiddleMouse> change.txt /*[<MiddleMouse>*
+[D tagsrch.txt /*[D*
+[I tagsrch.txt /*[I*
+[M motion.txt /*[M*
+[P change.txt /*[P*
+[[ motion.txt /*[[*
+[] motion.txt /*[]*
+[_CTRL-D tagsrch.txt /*[_CTRL-D*
+[_CTRL-I tagsrch.txt /*[_CTRL-I*
+[` motion.txt /*[`*
+[c diff.txt /*[c*
+[count] intro.txt /*[count]*
+[d tagsrch.txt /*[d*
+[f editing.txt /*[f*
+[i tagsrch.txt /*[i*
+[m motion.txt /*[m*
+[p change.txt /*[p*
+[pattern] pattern.txt /*[pattern]*
+[quotex] intro.txt /*[quotex]*
+[range] cmdline.txt /*[range]*
+[star motion.txt /*[star*
+[z fold.txt /*[z*
+[{ motion.txt /*[{*
+\0 change.txt /*\\0*
+] index.txt /*]*
+]# motion.txt /*]#*
+]' motion.txt /*]'*
+]) motion.txt /*])*
+]/ motion.txt /*]\/*
+]<MiddleMouse> change.txt /*]<MiddleMouse>*
+]D tagsrch.txt /*]D*
+]I tagsrch.txt /*]I*
+]M motion.txt /*]M*
+]P change.txt /*]P*
+][ motion.txt /*][*
+]] motion.txt /*]]*
+]_CTRL-D tagsrch.txt /*]_CTRL-D*
+]_CTRL-I tagsrch.txt /*]_CTRL-I*
+]` motion.txt /*]`*
+]c diff.txt /*]c*
+]d tagsrch.txt /*]d*
+]f editing.txt /*]f*
+]i tagsrch.txt /*]i*
+]m motion.txt /*]m*
+]p change.txt /*]p*
+]star motion.txt /*]star*
+]z fold.txt /*]z*
+]} motion.txt /*]}*
+^ motion.txt /*^*
+_ motion.txt /*_*
+_exrc starting.txt /*_exrc*
+_gvimrc gui.txt /*_gvimrc*
+_vimrc starting.txt /*_vimrc*
+` motion.txt /*`*
+`( motion.txt /*`(*
+`) motion.txt /*`)*
+`-expansion editing.txt /*`-expansion*
+`. motion.txt /*`.*
+`0 motion.txt /*`0*
+`< motion.txt /*`<*
+`> motion.txt /*`>*
+`A motion.txt /*`A*
+`[ motion.txt /*`[*
+`] motion.txt /*`]*
+`^ motion.txt /*`^*
+`` motion.txt /*``*
+`a motion.txt /*`a*
+`quote motion.txt /*`quote*
+`{ motion.txt /*`{*
+`} motion.txt /*`}*
+a insert.txt /*a*
+a( motion.txt /*a(*
+a) motion.txt /*a)*
+a4 options.txt /*a4*
+a:firstline eval.txt /*a:firstline*
+a:lastline eval.txt /*a:lastline*
+a:var eval.txt /*a:var*
+a< motion.txt /*a<*
+a> motion.txt /*a>*
+aB motion.txt /*aB*
+aW motion.txt /*aW*
+a[ motion.txt /*a[*
+a] motion.txt /*a]*
+ab motion.txt /*ab*
+abandon editing.txt /*abandon*
+abbreviations map.txt /*abbreviations*
+abel-syntax syntax.txt /*abel-syntax*
+abel.vim syntax.txt /*abel.vim*
+active-buffer windows.txt /*active-buffer*
+ada-syntax syntax.txt /*ada-syntax*
+ada.vim syntax.txt /*ada.vim*
+add-filetype-plugin usr_05.txt /*add-filetype-plugin*
+add-global-plugin usr_05.txt /*add-global-plugin*
+add-local-help usr_05.txt /*add-local-help*
+add-option-flags options.txt /*add-option-flags*
+add-plugin usr_05.txt /*add-plugin*
+added-5.1 version5.txt /*added-5.1*
+added-5.2 version5.txt /*added-5.2*
+added-5.3 version5.txt /*added-5.3*
+added-5.4 version5.txt /*added-5.4*
+added-5.5 version5.txt /*added-5.5*
+added-5.6 version5.txt /*added-5.6*
+added-5.7 version5.txt /*added-5.7*
+added-5.8 version5.txt /*added-5.8*
+added-6.1 version6.txt /*added-6.1*
+added-6.2 version6.txt /*added-6.2*
+added-6.3 version6.txt /*added-6.3*
+added-BeOS version5.txt /*added-BeOS*
+added-Mac version5.txt /*added-Mac*
+added-VMS version5.txt /*added-VMS*
+added-cmdline-args version5.txt /*added-cmdline-args*
+added-options version5.txt /*added-options*
+added-regexp version5.txt /*added-regexp*
+added-various version5.txt /*added-various*
+added-win32-GUI version5.txt /*added-win32-GUI*
+after-directory options.txt /*after-directory*
+aleph options.txt /*aleph*
+alt intro.txt /*alt*
+alt-input debugger.txt /*alt-input*
+alternate-file editing.txt /*alternate-file*
+amiga-window starting.txt /*amiga-window*
+ant-syntax syntax.txt /*ant-syntax*
+ant.vim syntax.txt /*ant.vim*
+ap motion.txt /*ap*
+apache-syntax syntax.txt /*apache-syntax*
+apache.vim syntax.txt /*apache.vim*
+append() eval.txt /*append()*
+arabic.txt arabic.txt /*arabic.txt*
+arabicfonts arabic.txt /*arabicfonts*
+arabickeymap arabic.txt /*arabickeymap*
+argc() eval.txt /*argc()*
+argidx() eval.txt /*argidx()*
+arglist editing.txt /*arglist*
+arglist-position editing.txt /*arglist-position*
+arglist-quit usr_07.txt /*arglist-quit*
+argument-list editing.txt /*argument-list*
+argv() eval.txt /*argv()*
+as motion.txt /*as*
+asm-syntax syntax.txt /*asm-syntax*
+asm.vim syntax.txt /*asm.vim*
+asm68k syntax.txt /*asm68k*
+asm68k-syntax syntax.txt /*asm68k-syntax*
+asmh8300-syntax syntax.txt /*asmh8300-syntax*
+asmh8300.vim syntax.txt /*asmh8300.vim*
+aspperl-syntax syntax.txt /*aspperl-syntax*
+aspvbs-syntax syntax.txt /*aspvbs-syntax*
+athena-intellimouse gui.txt /*athena-intellimouse*
+attr-list syntax.txt /*attr-list*
+author intro.txt /*author*
+auto-format change.txt /*auto-format*
+auto-setting options.txt /*auto-setting*
+auto-shortname editing.txt /*auto-shortname*
+autocmd-<> tips.txt /*autocmd-<>*
+autocmd-define autocmd.txt /*autocmd-define*
+autocmd-events autocmd.txt /*autocmd-events*
+autocmd-execute autocmd.txt /*autocmd-execute*
+autocmd-groups autocmd.txt /*autocmd-groups*
+autocmd-intro autocmd.txt /*autocmd-intro*
+autocmd-list autocmd.txt /*autocmd-list*
+autocmd-nested autocmd.txt /*autocmd-nested*
+autocmd-osfiletypes filetype.txt /*autocmd-osfiletypes*
+autocmd-patterns autocmd.txt /*autocmd-patterns*
+autocmd-remove autocmd.txt /*autocmd-remove*
+autocmd-searchpat autocmd.txt /*autocmd-searchpat*
+autocmd-use autocmd.txt /*autocmd-use*
+autocmd.txt autocmd.txt /*autocmd.txt*
+autocmds-kept version5.txt /*autocmds-kept*
+autocommand autocmd.txt /*autocommand*
+autocommand-events autocmd.txt /*autocommand-events*
+autocommand-pattern autocmd.txt /*autocommand-pattern*
+autoload-functions eval.txt /*autoload-functions*
+avoid-hit-enter version5.txt /*avoid-hit-enter*
+aw motion.txt /*aw*
+a{ motion.txt /*a{*
+a} motion.txt /*a}*
+b motion.txt /*b*
+b:changedtick-variable eval.txt /*b:changedtick-variable*
+b:current_syntax-variable syntax.txt /*b:current_syntax-variable*
+b:var eval.txt /*b:var*
+backslash intro.txt /*backslash*
+backspace intro.txt /*backspace*
+backspace-delete version4.txt /*backspace-delete*
+backtick-expansion editing.txt /*backtick-expansion*
+backup editing.txt /*backup*
+backup-changed version4.txt /*backup-changed*
+backup-extension version4.txt /*backup-extension*
+backup-table editing.txt /*backup-table*
+balloon-eval debugger.txt /*balloon-eval*
+bar motion.txt /*bar*
+bars help.txt /*bars*
+base_font_name_list mbyte.txt /*base_font_name_list*
+basic-syntax syntax.txt /*basic-syntax*
+basic.vim syntax.txt /*basic.vim*
+beep options.txt /*beep*
+beos-colors os_beos.txt /*beos-colors*
+beos-compiling os_beos.txt /*beos-compiling*
+beos-dragndrop os_beos.txt /*beos-dragndrop*
+beos-fonts os_beos.txt /*beos-fonts*
+beos-general os_beos.txt /*beos-general*
+beos-gui os_beos.txt /*beos-gui*
+beos-launch os_beos.txt /*beos-launch*
+beos-meta os_beos.txt /*beos-meta*
+beos-mouse os_beos.txt /*beos-mouse*
+beos-perl os_beos.txt /*beos-perl*
+beos-timeout os_beos.txt /*beos-timeout*
+beos-unicode os_beos.txt /*beos-unicode*
+beos-utf8 os_beos.txt /*beos-utf8*
+beos-vimdir os_beos.txt /*beos-vimdir*
+blockwise-examples visual.txt /*blockwise-examples*
+blockwise-operators visual.txt /*blockwise-operators*
+blockwise-register change.txt /*blockwise-register*
+blockwise-visual visual.txt /*blockwise-visual*
+book intro.txt /*book*
+boolean options.txt /*boolean*
+break-finally eval.txt /*break-finally*
+browse() eval.txt /*browse()*
+browsefilter editing.txt /*browsefilter*
+bufexists() eval.txt /*bufexists()*
+buffer-hidden windows.txt /*buffer-hidden*
+buffer-list windows.txt /*buffer-list*
+buffer-variable eval.txt /*buffer-variable*
+buffer-write editing.txt /*buffer-write*
+buffer_exists() eval.txt /*buffer_exists()*
+buffer_name() eval.txt /*buffer_name()*
+buffer_number() eval.txt /*buffer_number()*
+buffers windows.txt /*buffers*
+buffers-menu gui.txt /*buffers-menu*
+buflisted() eval.txt /*buflisted()*
+bufloaded() eval.txt /*bufloaded()*
+bufname() eval.txt /*bufname()*
+bufnr() eval.txt /*bufnr()*
+bufwinnr() eval.txt /*bufwinnr()*
+bug-fixes-5 version5.txt /*bug-fixes-5*
+bug-fixes-6 version6.txt /*bug-fixes-6*
+bug-reports intro.txt /*bug-reports*
+bugreport.vim intro.txt /*bugreport.vim*
+bugs intro.txt /*bugs*
+builtin-terms term.txt /*builtin-terms*
+builtin-tools gui.txt /*builtin-tools*
+builtin_terms term.txt /*builtin_terms*
+byte-count editing.txt /*byte-count*
+byte2line() eval.txt /*byte2line()*
+bzip2 pi_gzip.txt /*bzip2*
+c change.txt /*c*
+c-syntax syntax.txt /*c-syntax*
+c.vim syntax.txt /*c.vim*
+cW change.txt /*cW*
+c_<BS> cmdline.txt /*c_<BS>*
+c_<C-Left> cmdline.txt /*c_<C-Left>*
+c_<C-R> cmdline.txt /*c_<C-R>*
+c_<C-R>_<C-A> cmdline.txt /*c_<C-R>_<C-A>*
+c_<C-R>_<C-F> cmdline.txt /*c_<C-R>_<C-F>*
+c_<C-R>_<C-O> cmdline.txt /*c_<C-R>_<C-O>*
+c_<C-R>_<C-P> cmdline.txt /*c_<C-R>_<C-P>*
+c_<C-R>_<C-R> cmdline.txt /*c_<C-R>_<C-R>*
+c_<C-R>_<C-W> cmdline.txt /*c_<C-R>_<C-W>*
+c_<C-Right> cmdline.txt /*c_<C-Right>*
+c_<CR> cmdline.txt /*c_<CR>*
+c_<Del> cmdline.txt /*c_<Del>*
+c_<Down> cmdline.txt /*c_<Down>*
+c_<End> cmdline.txt /*c_<End>*
+c_<Esc> cmdline.txt /*c_<Esc>*
+c_<Home> cmdline.txt /*c_<Home>*
+c_<Insert> cmdline.txt /*c_<Insert>*
+c_<Left> cmdline.txt /*c_<Left>*
+c_<LeftMouse> cmdline.txt /*c_<LeftMouse>*
+c_<NL> cmdline.txt /*c_<NL>*
+c_<PageDown> cmdline.txt /*c_<PageDown>*
+c_<PageUp> cmdline.txt /*c_<PageUp>*
+c_<Right> cmdline.txt /*c_<Right>*
+c_<S-Down> cmdline.txt /*c_<S-Down>*
+c_<S-Left> cmdline.txt /*c_<S-Left>*
+c_<S-Right> cmdline.txt /*c_<S-Right>*
+c_<S-Tab> cmdline.txt /*c_<S-Tab>*
+c_<S-Up> cmdline.txt /*c_<S-Up>*
+c_<Tab> cmdline.txt /*c_<Tab>*
+c_<Up> cmdline.txt /*c_<Up>*
+c_CTRL-A cmdline.txt /*c_CTRL-A*
+c_CTRL-B cmdline.txt /*c_CTRL-B*
+c_CTRL-C cmdline.txt /*c_CTRL-C*
+c_CTRL-D cmdline.txt /*c_CTRL-D*
+c_CTRL-E cmdline.txt /*c_CTRL-E*
+c_CTRL-H cmdline.txt /*c_CTRL-H*
+c_CTRL-I cmdline.txt /*c_CTRL-I*
+c_CTRL-J cmdline.txt /*c_CTRL-J*
+c_CTRL-K cmdline.txt /*c_CTRL-K*
+c_CTRL-L cmdline.txt /*c_CTRL-L*
+c_CTRL-N cmdline.txt /*c_CTRL-N*
+c_CTRL-P cmdline.txt /*c_CTRL-P*
+c_CTRL-Q cmdline.txt /*c_CTRL-Q*
+c_CTRL-R cmdline.txt /*c_CTRL-R*
+c_CTRL-R_= cmdline.txt /*c_CTRL-R_=*
+c_CTRL-R_CTRL-A cmdline.txt /*c_CTRL-R_CTRL-A*
+c_CTRL-R_CTRL-F cmdline.txt /*c_CTRL-R_CTRL-F*
+c_CTRL-R_CTRL-O cmdline.txt /*c_CTRL-R_CTRL-O*
+c_CTRL-R_CTRL-P cmdline.txt /*c_CTRL-R_CTRL-P*
+c_CTRL-R_CTRL-R cmdline.txt /*c_CTRL-R_CTRL-R*
+c_CTRL-R_CTRL-W cmdline.txt /*c_CTRL-R_CTRL-W*
+c_CTRL-U cmdline.txt /*c_CTRL-U*
+c_CTRL-V cmdline.txt /*c_CTRL-V*
+c_CTRL-W cmdline.txt /*c_CTRL-W*
+c_CTRL-Y cmdline.txt /*c_CTRL-Y*
+c_CTRL-\_CTRL-G intro.txt /*c_CTRL-\\_CTRL-G*
+c_CTRL-\_CTRL-N intro.txt /*c_CTRL-\\_CTRL-N*
+c_CTRL-\_e cmdline.txt /*c_CTRL-\\_e*
+c_CTRL-^ cmdline.txt /*c_CTRL-^*
+c_CTRL-_ cmdline.txt /*c_CTRL-_*
+c_digraph cmdline.txt /*c_digraph*
+c_wildchar cmdline.txt /*c_wildchar*
+carriage-return intro.txt /*carriage-return*
+case change.txt /*case*
+catch-all eval.txt /*catch-all*
+catch-errors eval.txt /*catch-errors*
+catch-interrupt eval.txt /*catch-interrupt*
+catch-order eval.txt /*catch-order*
+catch-text eval.txt /*catch-text*
+cc change.txt /*cc*
+change-list-jumps motion.txt /*change-list-jumps*
+change.txt change.txt /*change.txt*
+changed-5.1 version5.txt /*changed-5.1*
+changed-5.2 version5.txt /*changed-5.2*
+changed-5.3 version5.txt /*changed-5.3*
+changed-5.4 version5.txt /*changed-5.4*
+changed-5.5 version5.txt /*changed-5.5*
+changed-5.6 version5.txt /*changed-5.6*
+changed-5.7 version5.txt /*changed-5.7*
+changed-5.8 version5.txt /*changed-5.8*
+changed-6.1 version6.txt /*changed-6.1*
+changed-6.2 version6.txt /*changed-6.2*
+changed-6.3 version6.txt /*changed-6.3*
+changelist motion.txt /*changelist*
+changelog-plugin filetype.txt /*changelog-plugin*
+changelog-syntax syntax.txt /*changelog-syntax*
+changelog.vim syntax.txt /*changelog.vim*
+changetick eval.txt /*changetick*
+changing change.txt /*changing*
+char2nr() eval.txt /*char2nr()*
+characterwise motion.txt /*characterwise*
+characterwise-register change.txt /*characterwise-register*
+characterwise-visual visual.txt /*characterwise-visual*
+charconvert_from-variable eval.txt /*charconvert_from-variable*
+charconvert_to-variable eval.txt /*charconvert_to-variable*
+charset mbyte.txt /*charset*
+charset-conversion mbyte.txt /*charset-conversion*
+chill-syntax syntax.txt /*chill-syntax*
+chill.vim syntax.txt /*chill.vim*
+cindent() eval.txt /*cindent()*
+cinkeys-format indent.txt /*cinkeys-format*
+cinoptions-values indent.txt /*cinoptions-values*
+client-server remote.txt /*client-server*
+clientserver remote.txt /*clientserver*
+clipboard gui.txt /*clipboard*
+cmdarg-variable eval.txt /*cmdarg-variable*
+cmdbang-variable eval.txt /*cmdbang-variable*
+cmdline-arguments vi_diff.txt /*cmdline-arguments*
+cmdline-changed version5.txt /*cmdline-changed*
+cmdline-completion cmdline.txt /*cmdline-completion*
+cmdline-editing cmdline.txt /*cmdline-editing*
+cmdline-history cmdline.txt /*cmdline-history*
+cmdline-lines cmdline.txt /*cmdline-lines*
+cmdline-ranges cmdline.txt /*cmdline-ranges*
+cmdline-special cmdline.txt /*cmdline-special*
+cmdline-too-long cmdline.txt /*cmdline-too-long*
+cmdline-window cmdline.txt /*cmdline-window*
+cmdline.txt cmdline.txt /*cmdline.txt*
+cmdwin cmdline.txt /*cmdwin*
+cmdwin-char cmdline.txt /*cmdwin-char*
+cobol-syntax syntax.txt /*cobol-syntax*
+cobol.vim syntax.txt /*cobol.vim*
+codeset mbyte.txt /*codeset*
+coding-style develop.txt /*coding-style*
+col() eval.txt /*col()*
+coldfusion-syntax syntax.txt /*coldfusion-syntax*
+coldfusion.vim syntax.txt /*coldfusion.vim*
+collapse tips.txt /*collapse*
+color-xterm syntax.txt /*color-xterm*
+coloring syntax.txt /*coloring*
+colortest.vim syntax.txt /*colortest.vim*
+command-mode intro.txt /*command-mode*
+compatible-default starting.txt /*compatible-default*
+compile-changes-5 version5.txt /*compile-changes-5*
+compile-changes-6 version6.txt /*compile-changes-6*
+compiler-manx quickfix.txt /*compiler-manx*
+compiler-pyunit quickfix.txt /*compiler-pyunit*
+compiler-select quickfix.txt /*compiler-select*
+compiler-tex quickfix.txt /*compiler-tex*
+compl-current insert.txt /*compl-current*
+compl-define insert.txt /*compl-define*
+compl-dictionary insert.txt /*compl-dictionary*
+compl-filename insert.txt /*compl-filename*
+compl-generic insert.txt /*compl-generic*
+compl-keyword insert.txt /*compl-keyword*
+compl-tag insert.txt /*compl-tag*
+compl-vim insert.txt /*compl-vim*
+compl-whole-line insert.txt /*compl-whole-line*
+complex-change change.txt /*complex-change*
+complex-repeat repeat.txt /*complex-repeat*
+compress pi_gzip.txt /*compress*
+confirm() eval.txt /*confirm()*
+connection-refused message.txt /*connection-refused*
+console-menus gui.txt /*console-menus*
+control intro.txt /*control*
+conversion-server mbyte.txt /*conversion-server*
+convert-to-HTML syntax.txt /*convert-to-HTML*
+convert-to-XHTML syntax.txt /*convert-to-XHTML*
+convert-to-XML syntax.txt /*convert-to-XML*
+copy-diffs diff.txt /*copy-diffs*
+copy-move change.txt /*copy-move*
+copying uganda.txt /*copying*
+copyright uganda.txt /*copyright*
+count intro.txt /*count*
+count-bytes tips.txt /*count-bytes*
+count-items tips.txt /*count-items*
+count-variable eval.txt /*count-variable*
+count1-variable eval.txt /*count1-variable*
+cp-default version5.txt /*cp-default*
+cpo-! options.txt /*cpo-!*
+cpo-$ options.txt /*cpo-$*
+cpo-% options.txt /*cpo-%*
+cpo-< options.txt /*cpo-<*
+cpo-A options.txt /*cpo-A*
+cpo-B options.txt /*cpo-B*
+cpo-C options.txt /*cpo-C*
+cpo-D options.txt /*cpo-D*
+cpo-E options.txt /*cpo-E*
+cpo-F options.txt /*cpo-F*
+cpo-J options.txt /*cpo-J*
+cpo-K options.txt /*cpo-K*
+cpo-L options.txt /*cpo-L*
+cpo-M options.txt /*cpo-M*
+cpo-O options.txt /*cpo-O*
+cpo-R options.txt /*cpo-R*
+cpo-S options.txt /*cpo-S*
+cpo-W options.txt /*cpo-W*
+cpo-a options.txt /*cpo-a*
+cpo-b options.txt /*cpo-b*
+cpo-c options.txt /*cpo-c*
+cpo-d options.txt /*cpo-d*
+cpo-e options.txt /*cpo-e*
+cpo-f options.txt /*cpo-f*
+cpo-g options.txt /*cpo-g*
+cpo-i options.txt /*cpo-i*
+cpo-j options.txt /*cpo-j*
+cpo-k options.txt /*cpo-k*
+cpo-l options.txt /*cpo-l*
+cpo-m options.txt /*cpo-m*
+cpo-n options.txt /*cpo-n*
+cpo-o options.txt /*cpo-o*
+cpo-p options.txt /*cpo-p*
+cpo-r options.txt /*cpo-r*
+cpo-s options.txt /*cpo-s*
+cpo-star options.txt /*cpo-star*
+cpo-t options.txt /*cpo-t*
+cpo-u options.txt /*cpo-u*
+cpo-v options.txt /*cpo-v*
+cpo-w options.txt /*cpo-w*
+cpo-x options.txt /*cpo-x*
+cpo-y options.txt /*cpo-y*
+crash-recovery recover.txt /*crash-recovery*
+creating-menus gui.txt /*creating-menus*
+credits intro.txt /*credits*
+crontab options.txt /*crontab*
+cs-find if_cscop.txt /*cs-find*
+cs7-problem term.txt /*cs7-problem*
+cscope if_cscop.txt /*cscope*
+cscope-commands if_cscop.txt /*cscope-commands*
+cscope-find if_cscop.txt /*cscope-find*
+cscope-howtouse if_cscop.txt /*cscope-howtouse*
+cscope-info if_cscop.txt /*cscope-info*
+cscope-intro if_cscop.txt /*cscope-intro*
+cscope-limitations if_cscop.txt /*cscope-limitations*
+cscope-options if_cscop.txt /*cscope-options*
+cscope-suggestions if_cscop.txt /*cscope-suggestions*
+cscope-win32 if_cscop.txt /*cscope-win32*
+cscope_connection() eval.txt /*cscope_connection()*
+cscopepathcomp if_cscop.txt /*cscopepathcomp*
+cscopeprg if_cscop.txt /*cscopeprg*
+cscopequickfix if_cscop.txt /*cscopequickfix*
+cscopetag if_cscop.txt /*cscopetag*
+cscopetagorder if_cscop.txt /*cscopetagorder*
+cscopeverbose if_cscop.txt /*cscopeverbose*
+csh-syntax syntax.txt /*csh-syntax*
+csh.vim syntax.txt /*csh.vim*
+cspc if_cscop.txt /*cspc*
+csprg if_cscop.txt /*csprg*
+csqf if_cscop.txt /*csqf*
+cst if_cscop.txt /*cst*
+csto if_cscop.txt /*csto*
+csverb if_cscop.txt /*csverb*
+ctags tagsrch.txt /*ctags*
+ctags-gone version6.txt /*ctags-gone*
+cterm-colors syntax.txt /*cterm-colors*
+ctrl intro.txt /*ctrl*
+ctype-variable eval.txt /*ctype-variable*
+curly-braces-function-names eval.txt /*curly-braces-function-names*
+curly-braces-names eval.txt /*curly-braces-names*
+curpos-visual version6.txt /*curpos-visual*
+current-directory editing.txt /*current-directory*
+current-file editing.txt /*current-file*
+current_compiler quickfix.txt /*current_compiler*
+cursor() eval.txt /*cursor()*
+cursor-blinking options.txt /*cursor-blinking*
+cursor-down intro.txt /*cursor-down*
+cursor-left intro.txt /*cursor-left*
+cursor-motions motion.txt /*cursor-motions*
+cursor-position pattern.txt /*cursor-position*
+cursor-right intro.txt /*cursor-right*
+cursor-up intro.txt /*cursor-up*
+cursor_down intro.txt /*cursor_down*
+cursor_left intro.txt /*cursor_left*
+cursor_right intro.txt /*cursor_right*
+cursor_up intro.txt /*cursor_up*
+cw change.txt /*cw*
+cweb-syntax syntax.txt /*cweb-syntax*
+cweb.vim syntax.txt /*cweb.vim*
+cynlib-syntax syntax.txt /*cynlib-syntax*
+cynlib.vim syntax.txt /*cynlib.vim*
+d change.txt /*d*
+daB motion.txt /*daB*
+daW motion.txt /*daW*
+dab motion.txt /*dab*
+dap motion.txt /*dap*
+das motion.txt /*das*
+dav pi_netrw.txt /*dav*
+daw motion.txt /*daw*
+dd change.txt /*dd*
+debug-highlight debugger.txt /*debug-highlight*
+debug-mode repeat.txt /*debug-mode*
+debug-scripts repeat.txt /*debug-scripts*
+debug-signs debugger.txt /*debug-signs*
+debug-vim intro.txt /*debug-vim*
+debugger-compilation debugger.txt /*debugger-compilation*
+debugger-features debugger.txt /*debugger-features*
+debugger-integration debugger.txt /*debugger-integration*
+debugger-support debugger.txt /*debugger-support*
+debugger.txt debugger.txt /*debugger.txt*
+dec-mouse options.txt /*dec-mouse*
+definition-search tagsrch.txt /*definition-search*
+definitions intro.txt /*definitions*
+delete() eval.txt /*delete()*
+delete-insert change.txt /*delete-insert*
+delete-menus gui.txt /*delete-menus*
+deleting change.txt /*deleting*
+design-assumptions develop.txt /*design-assumptions*
+design-compatible develop.txt /*design-compatible*
+design-decisions develop.txt /*design-decisions*
+design-documented develop.txt /*design-documented*
+design-flexible develop.txt /*design-flexible*
+design-goals develop.txt /*design-goals*
+design-improved develop.txt /*design-improved*
+design-maintain develop.txt /*design-maintain*
+design-multi-platform develop.txt /*design-multi-platform*
+design-not develop.txt /*design-not*
+design-speed-size develop.txt /*design-speed-size*
+desktop-syntax syntax.txt /*desktop-syntax*
+desktop.vim syntax.txt /*desktop.vim*
+develop.txt develop.txt /*develop.txt*
+development develop.txt /*development*
+dh change.txt /*dh*
+diB motion.txt /*diB*
+diW motion.txt /*diW*
+dialog gui_w32.txt /*dialog*
+dialogs-added version5.txt /*dialogs-added*
+dib motion.txt /*dib*
+did_filetype() eval.txt /*did_filetype()*
+diff diff.txt /*diff*
+diff-diffexpr diff.txt /*diff-diffexpr*
+diff-mode diff.txt /*diff-mode*
+diff-options diff.txt /*diff-options*
+diff-patchexpr diff.txt /*diff-patchexpr*
+diff.txt diff.txt /*diff.txt*
+digraph-arg change.txt /*digraph-arg*
+digraph-table digraph.txt /*digraph-table*
+digraph.txt digraph.txt /*digraph.txt*
+digraphs digraph.txt /*digraphs*
+digraphs-changed version6.txt /*digraphs-changed*
+digraphs-default digraph.txt /*digraphs-default*
+digraphs-define digraph.txt /*digraphs-define*
+digraphs-use digraph.txt /*digraphs-use*
+dip motion.txt /*dip*
+dircolors-syntax syntax.txt /*dircolors-syntax*
+dircolors.vim syntax.txt /*dircolors.vim*
+dis motion.txt /*dis*
+disable-menus gui.txt /*disable-menus*
+distribution intro.txt /*distribution*
+diw motion.txt /*diw*
+dl change.txt /*dl*
+do diff.txt /*do*
+doc-file-list help.txt /*doc-file-list*
+docbk-syntax syntax.txt /*docbk-syntax*
+docbk.vim syntax.txt /*docbk.vim*
+docbksgml-syntax syntax.txt /*docbksgml-syntax*
+docbksgml.vim syntax.txt /*docbksgml.vim*
+docbkxml-syntax syntax.txt /*docbkxml-syntax*
+docbkxml.vim syntax.txt /*docbkxml.vim*
+docbook syntax.txt /*docbook*
+documentation-6 version6.txt /*documentation-6*
+dos os_dos.txt /*dos*
+dos-:cd os_dos.txt /*dos-:cd*
+dos-CTRL-Break os_dos.txt /*dos-CTRL-Break*
+dos-backslash os_dos.txt /*dos-backslash*
+dos-colors os_dos.txt /*dos-colors*
+dos-file-formats os_dos.txt /*dos-file-formats*
+dos-locations os_dos.txt /*dos-locations*
+dos-shell os_dos.txt /*dos-shell*
+dos-standard-mappings os_dos.txt /*dos-standard-mappings*
+dos-temp-files os_dos.txt /*dos-temp-files*
+dos16 os_msdos.txt /*dos16*
+dos32 os_msdos.txt /*dos32*
+dosbatch-syntax syntax.txt /*dosbatch-syntax*
+dosbatch.vim syntax.txt /*dosbatch.vim*
+double-click term.txt /*double-click*
+download intro.txt /*download*
+dp diff.txt /*dp*
+drag-n-drop gui.txt /*drag-n-drop*
+drag-n-drop-win32 gui_w32.txt /*drag-n-drop-win32*
+drag-status-line term.txt /*drag-status-line*
+dtd-syntax syntax.txt /*dtd-syntax*
+dtd.vim syntax.txt /*dtd.vim*
+dying-variable eval.txt /*dying-variable*
+e motion.txt /*e*
+easy starting.txt /*easy*
+edit-a-file editing.txt /*edit-a-file*
+edit-binary editing.txt /*edit-binary*
+edit-dialogs editing.txt /*edit-dialogs*
+edit-files editing.txt /*edit-files*
+edit-intro editing.txt /*edit-intro*
+edit-no-break usr_25.txt /*edit-no-break*
+editing.txt editing.txt /*editing.txt*
+efm-entries quickfix.txt /*efm-entries*
+efm-ignore quickfix.txt /*efm-ignore*
+eiffel-syntax syntax.txt /*eiffel-syntax*
+eiffel.vim syntax.txt /*eiffel.vim*
+emacs-keys tips.txt /*emacs-keys*
+emacs-tags tagsrch.txt /*emacs-tags*
+emacs_tags tagsrch.txt /*emacs_tags*
+encoding-names mbyte.txt /*encoding-names*
+encoding-table mbyte.txt /*encoding-table*
+encoding-values mbyte.txt /*encoding-values*
+encryption editing.txt /*encryption*
+end intro.txt /*end*
+end-of-file pattern.txt /*end-of-file*
+enlightened-terminal syntax.txt /*enlightened-terminal*
+erlang-syntax syntax.txt /*erlang-syntax*
+erlang.vim syntax.txt /*erlang.vim*
+errmsg-variable eval.txt /*errmsg-variable*
+error-file-format quickfix.txt /*error-file-format*
+error-messages message.txt /*error-messages*
+errorformat quickfix.txt /*errorformat*
+errorformat-Jikes quickfix.txt /*errorformat-Jikes*
+errorformat-LaTeX quickfix.txt /*errorformat-LaTeX*
+errorformat-Perl quickfix.txt /*errorformat-Perl*
+errorformat-ant quickfix.txt /*errorformat-ant*
+errorformat-changed version4.txt /*errorformat-changed*
+errorformat-jade quickfix.txt /*errorformat-jade*
+errorformat-javac quickfix.txt /*errorformat-javac*
+errorformat-multi-line quickfix.txt /*errorformat-multi-line*
+errorformat-separate-filename quickfix.txt /*errorformat-separate-filename*
+errorformats quickfix.txt /*errorformats*
+escape intro.txt /*escape*
+escape() eval.txt /*escape()*
+escape-bar version4.txt /*escape-bar*
+eval eval.txt /*eval*
+eval-examples eval.txt /*eval-examples*
+eval-sandbox eval.txt /*eval-sandbox*
+eval.txt eval.txt /*eval.txt*
+eventhandler() eval.txt /*eventhandler()*
+eview starting.txt /*eview*
+evim starting.txt /*evim*
+evim-keys starting.txt /*evim-keys*
+evim.vim starting.txt /*evim.vim*
+ex starting.txt /*ex*
+ex-cmd-index index.txt /*ex-cmd-index*
+ex-edit-index index.txt /*ex-edit-index*
+ex: options.txt /*ex:*
+except-autocmd eval.txt /*except-autocmd*
+except-autocmd-Cmd eval.txt /*except-autocmd-Cmd*
+except-autocmd-Post eval.txt /*except-autocmd-Post*
+except-autocmd-Pre eval.txt /*except-autocmd-Pre*
+except-autocmd-ill eval.txt /*except-autocmd-ill*
+except-compat eval.txt /*except-compat*
+except-examine eval.txt /*except-examine*
+except-from-finally eval.txt /*except-from-finally*
+except-hier-param eval.txt /*except-hier-param*
+except-several-errors eval.txt /*except-several-errors*
+except-single-line eval.txt /*except-single-line*
+except-syntax-err eval.txt /*except-syntax-err*
+except-syntax-error eval.txt /*except-syntax-error*
+exception-handling eval.txt /*exception-handling*
+exception-variable eval.txt /*exception-variable*
+exclusive motion.txt /*exclusive*
+executable() eval.txt /*executable()*
+execute-menus gui.txt /*execute-menus*
+exim starting.txt /*exim*
+exists() eval.txt /*exists()*
+expand() eval.txt /*expand()*
+expand-env options.txt /*expand-env*
+expand-environment-var options.txt /*expand-environment-var*
+expl-starting pi_expl.txt /*expl-starting*
+explorer-delete pi_expl.txt /*explorer-delete*
+explorer-rename pi_expl.txt /*explorer-rename*
+expr eval.txt /*expr*
+expr-! eval.txt /*expr-!*
+expr-!= eval.txt /*expr-!=*
+expr-!=# eval.txt /*expr-!=#*
+expr-!=? eval.txt /*expr-!=?*
+expr-!~ eval.txt /*expr-!~*
+expr-!~# eval.txt /*expr-!~#*
+expr-!~? eval.txt /*expr-!~?*
+expr-% eval.txt /*expr-%*
+expr-&& eval.txt /*expr-&&*
+expr-' eval.txt /*expr-'*
+expr-+ eval.txt /*expr-+*
+expr-- eval.txt /*expr--*
+expr-. eval.txt /*expr-.*
+expr-/ eval.txt /*expr-\/*
+expr-< eval.txt /*expr-<*
+expr-<# eval.txt /*expr-<#*
+expr-<= eval.txt /*expr-<=*
+expr-<=# eval.txt /*expr-<=#*
+expr-<=? eval.txt /*expr-<=?*
+expr-<? eval.txt /*expr-<?*
+expr-== eval.txt /*expr-==*
+expr-==# eval.txt /*expr-==#*
+expr-==? eval.txt /*expr-==?*
+expr-=~ eval.txt /*expr-=~*
+expr-=~# eval.txt /*expr-=~#*
+expr-=~? eval.txt /*expr-=~?*
+expr-> eval.txt /*expr->*
+expr-># eval.txt /*expr->#*
+expr->= eval.txt /*expr->=*
+expr->=# eval.txt /*expr->=#*
+expr->=? eval.txt /*expr->=?*
+expr->? eval.txt /*expr->?*
+expr-[] eval.txt /*expr-[]*
+expr-barbar eval.txt /*expr-barbar*
+expr-env eval.txt /*expr-env*
+expr-env-expand eval.txt /*expr-env-expand*
+expr-function eval.txt /*expr-function*
+expr-nesting eval.txt /*expr-nesting*
+expr-number eval.txt /*expr-number*
+expr-option eval.txt /*expr-option*
+expr-quote eval.txt /*expr-quote*
+expr-register eval.txt /*expr-register*
+expr-star eval.txt /*expr-star*
+expr-string eval.txt /*expr-string*
+expr-unary-+ eval.txt /*expr-unary-+*
+expr-unary-- eval.txt /*expr-unary--*
+expr-variable eval.txt /*expr-variable*
+expr1 eval.txt /*expr1*
+expr2 eval.txt /*expr2*
+expr3 eval.txt /*expr3*
+expr4 eval.txt /*expr4*
+expr5 eval.txt /*expr5*
+expr6 eval.txt /*expr6*
+expr7 eval.txt /*expr7*
+expr8 eval.txt /*expr8*
+expr9 eval.txt /*expr9*
+expression eval.txt /*expression*
+expression-commands eval.txt /*expression-commands*
+expression-syntax eval.txt /*expression-syntax*
+exrc starting.txt /*exrc*
+extension-removal cmdline.txt /*extension-removal*
+extensions-improvements todo.txt /*extensions-improvements*
+f motion.txt /*f*
+faq intro.txt /*faq*
+farsi farsi.txt /*farsi*
+farsi.txt farsi.txt /*farsi.txt*
+fasm.vim syntax.txt /*fasm.vim*
+feature-list eval.txt /*feature-list*
+fetch pi_netrw.txt /*fetch*
+file-browser pi_expl.txt /*file-browser*
+file-browser-5.2 version5.txt /*file-browser-5.2*
+file-explorer pi_expl.txt /*file-explorer*
+file-formats editing.txt /*file-formats*
+file-pattern autocmd.txt /*file-pattern*
+file-read insert.txt /*file-read*
+file-searching editing.txt /*file-searching*
+file-type filetype.txt /*file-type*
+file-types filetype.txt /*file-types*
+file_readable() eval.txt /*file_readable()*
+fileencoding-changed version6.txt /*fileencoding-changed*
+filename-backslash cmdline.txt /*filename-backslash*
+filename-modifiers cmdline.txt /*filename-modifiers*
+filereadable() eval.txt /*filereadable()*
+filetype filetype.txt /*filetype*
+filetype-detect filetype.txt /*filetype-detect*
+filetype-ignore filetype.txt /*filetype-ignore*
+filetype-overrule filetype.txt /*filetype-overrule*
+filetype-plugin usr_43.txt /*filetype-plugin*
+filetype-plugins filetype.txt /*filetype-plugins*
+filetype.txt filetype.txt /*filetype.txt*
+filetypedetect-changed version6.txt /*filetypedetect-changed*
+filetypes filetype.txt /*filetypes*
+filewritable() eval.txt /*filewritable()*
+filter change.txt /*filter*
+find-manpage usr_12.txt /*find-manpage*
+find-replace usr_10.txt /*find-replace*
+fixed-5.1 version5.txt /*fixed-5.1*
+fixed-5.2 version5.txt /*fixed-5.2*
+fixed-5.3 version5.txt /*fixed-5.3*
+fixed-5.4 version5.txt /*fixed-5.4*
+fixed-5.5 version5.txt /*fixed-5.5*
+fixed-5.6 version5.txt /*fixed-5.6*
+fixed-5.7 version5.txt /*fixed-5.7*
+fixed-5.8 version5.txt /*fixed-5.8*
+fixed-6.1 version6.txt /*fixed-6.1*
+fixed-6.2 version6.txt /*fixed-6.2*
+fixed-6.3 version6.txt /*fixed-6.3*
+fname_diff-variable eval.txt /*fname_diff-variable*
+fname_in-variable eval.txt /*fname_in-variable*
+fname_new-variable eval.txt /*fname_new-variable*
+fname_out-variable eval.txt /*fname_out-variable*
+fnamemodify() eval.txt /*fnamemodify()*
+fo-table change.txt /*fo-table*
+fold-behavior fold.txt /*fold-behavior*
+fold-colors fold.txt /*fold-colors*
+fold-commands fold.txt /*fold-commands*
+fold-create-marker fold.txt /*fold-create-marker*
+fold-delete-marker fold.txt /*fold-delete-marker*
+fold-diff fold.txt /*fold-diff*
+fold-expr fold.txt /*fold-expr*
+fold-foldcolumn fold.txt /*fold-foldcolumn*
+fold-foldlevel fold.txt /*fold-foldlevel*
+fold-foldtext fold.txt /*fold-foldtext*
+fold-indent fold.txt /*fold-indent*
+fold-manual fold.txt /*fold-manual*
+fold-marker fold.txt /*fold-marker*
+fold-methods fold.txt /*fold-methods*
+fold-options fold.txt /*fold-options*
+fold-syntax fold.txt /*fold-syntax*
+fold.txt fold.txt /*fold.txt*
+foldclosed() eval.txt /*foldclosed()*
+foldclosedend() eval.txt /*foldclosedend()*
+folddashes-variable eval.txt /*folddashes-variable*
+foldend-variable eval.txt /*foldend-variable*
+folding fold.txt /*folding*
+foldlevel() eval.txt /*foldlevel()*
+foldlevel-variable eval.txt /*foldlevel-variable*
+foldstart-variable eval.txt /*foldstart-variable*
+foldtext() eval.txt /*foldtext()*
+font-sizes gui_x11.txt /*font-sizes*
+fontset mbyte.txt /*fontset*
+foreground() eval.txt /*foreground()*
+fork os_unix.txt /*fork*
+form-syntax syntax.txt /*form-syntax*
+form.vim syntax.txt /*form.vim*
+format-bullet-list tips.txt /*format-bullet-list*
+format-comments change.txt /*format-comments*
+formatting change.txt /*formatting*
+formfeed intro.txt /*formfeed*
+fortran-indent indent.txt /*fortran-indent*
+fortran-plugin filetype.txt /*fortran-plugin*
+fortran-syntax syntax.txt /*fortran-syntax*
+fortran.vim syntax.txt /*fortran.vim*
+french-maillist intro.txt /*french-maillist*
+frombook usr_01.txt /*frombook*
+ftp pi_netrw.txt /*ftp*
+ftplugin usr_41.txt /*ftplugin*
+ftplugin-docs filetype.txt /*ftplugin-docs*
+ftplugin-name usr_05.txt /*ftplugin-name*
+ftplugin-overrule filetype.txt /*ftplugin-overrule*
+ftplugin-special usr_41.txt /*ftplugin-special*
+ftplugins usr_05.txt /*ftplugins*
+function-argument eval.txt /*function-argument*
+function-key intro.txt /*function-key*
+function-list usr_41.txt /*function-list*
+function-range-example eval.txt /*function-range-example*
+function_key intro.txt /*function_key*
+functions eval.txt /*functions*
+fvwm-syntax syntax.txt /*fvwm-syntax*
+fvwm.vim syntax.txt /*fvwm.vim*
+fvwm2rc syntax.txt /*fvwm2rc*
+fvwmrc syntax.txt /*fvwmrc*
+g index.txt /*g*
+g# pattern.txt /*g#*
+g$ motion.txt /*g$*
+g& change.txt /*g&*
+g' motion.txt /*g'*
+g'a motion.txt /*g'a*
+g, motion.txt /*g,*
+g0 motion.txt /*g0*
+g8 various.txt /*g8*
+g:explDateFormat pi_expl.txt /*g:explDateFormat*
+g:explDetailedHelp pi_expl.txt /*g:explDetailedHelp*
+g:explDetailedList pi_expl.txt /*g:explDetailedList*
+g:explDirsFirst pi_expl.txt /*g:explDirsFirst*
+g:explFileHandler pi_expl.txt /*g:explFileHandler*
+g:explHideFiles pi_expl.txt /*g:explHideFiles*
+g:explSortBy pi_expl.txt /*g:explSortBy*
+g:explSplitBelow pi_expl.txt /*g:explSplitBelow*
+g:explSplitRight pi_expl.txt /*g:explSplitRight*
+g:explStartBelow pi_expl.txt /*g:explStartBelow*
+g:explStartRight pi_expl.txt /*g:explStartRight*
+g:explSuffixesLast pi_expl.txt /*g:explSuffixesLast*
+g:explUseSeparators pi_expl.txt /*g:explUseSeparators*
+g:explVertical pi_expl.txt /*g:explVertical*
+g:explWinSize pi_expl.txt /*g:explWinSize*
+g:var eval.txt /*g:var*
+g; motion.txt /*g;*
+g<Down> motion.txt /*g<Down>*
+g<End> motion.txt /*g<End>*
+g<Home> motion.txt /*g<Home>*
+g<LeftMouse> tagsrch.txt /*g<LeftMouse>*
+g<RightMouse> tagsrch.txt /*g<RightMouse>*
+g<Up> motion.txt /*g<Up>*
+g? change.txt /*g?*
+g?? change.txt /*g??*
+g?g? change.txt /*g?g?*
+gD pattern.txt /*gD*
+gE motion.txt /*gE*
+gH visual.txt /*gH*
+gI insert.txt /*gI*
+gJ change.txt /*gJ*
+gP change.txt /*gP*
+gQ intro.txt /*gQ*
+gR change.txt /*gR*
+gU change.txt /*gU*
+gUU change.txt /*gUU*
+gUgU change.txt /*gUgU*
+gV visual.txt /*gV*
+g] tagsrch.txt /*g]*
+g^ motion.txt /*g^*
+g_ motion.txt /*g_*
+g_CTRL-A various.txt /*g_CTRL-A*
+g_CTRL-G editing.txt /*g_CTRL-G*
+g_CTRL-H visual.txt /*g_CTRL-H*
+g_CTRL-] tagsrch.txt /*g_CTRL-]*
+g` motion.txt /*g`*
+g`a motion.txt /*g`a*
+ga various.txt /*ga*
+gd pattern.txt /*gd*
+ge motion.txt /*ge*
+getbufvar() eval.txt /*getbufvar()*
+getchar() eval.txt /*getchar()*
+getcharmod() eval.txt /*getcharmod()*
+getcmdline() eval.txt /*getcmdline()*
+getcmdpos() eval.txt /*getcmdpos()*
+getcwd() eval.txt /*getcwd()*
+getfsize() eval.txt /*getfsize()*
+getftime() eval.txt /*getftime()*
+getline() eval.txt /*getline()*
+getreg() eval.txt /*getreg()*
+getregtype() eval.txt /*getregtype()*
+getwinposx() eval.txt /*getwinposx()*
+getwinposy() eval.txt /*getwinposy()*
+getwinvar() eval.txt /*getwinvar()*
+gex starting.txt /*gex*
+gf editing.txt /*gf*
+gg motion.txt /*gg*
+gh visual.txt /*gh*
+gi insert.txt /*gi*
+gj motion.txt /*gj*
+gk motion.txt /*gk*
+glob() eval.txt /*glob()*
+global-ime mbyte.txt /*global-ime*
+global-local options.txt /*global-local*
+global-variable eval.txt /*global-variable*
+globpath() eval.txt /*globpath()*
+gm motion.txt /*gm*
+gnome-session gui_x11.txt /*gnome-session*
+go motion.txt /*go*
+gp change.txt /*gp*
+gpm-mouse term.txt /*gpm-mouse*
+gq change.txt /*gq*
+gqap change.txt /*gqap*
+gqgq change.txt /*gqgq*
+gqq change.txt /*gqq*
+gr change.txt /*gr*
+graphic-option-gone version4.txt /*graphic-option-gone*
+greek options.txt /*greek*
+grep quickfix.txt /*grep*
+groff-syntax syntax.txt /*groff-syntax*
+groff.vim syntax.txt /*groff.vim*
+group-name syntax.txt /*group-name*
+gs various.txt /*gs*
+gsp.vim syntax.txt /*gsp.vim*
+gstar pattern.txt /*gstar*
+gtk-tooltip-colors gui_x11.txt /*gtk-tooltip-colors*
+gu change.txt /*gu*
+gugu change.txt /*gugu*
+gui gui.txt /*gui*
+gui-clipboard gui_w32.txt /*gui-clipboard*
+gui-colors syntax.txt /*gui-colors*
+gui-extras gui.txt /*gui-extras*
+gui-footer debugger.txt /*gui-footer*
+gui-fork gui_x11.txt /*gui-fork*
+gui-gnome gui_x11.txt /*gui-gnome*
+gui-gnome-session gui_x11.txt /*gui-gnome-session*
+gui-gtk gui_x11.txt /*gui-gtk*
+gui-gtk-socketid gui_x11.txt /*gui-gtk-socketid*
+gui-horiz-scroll gui.txt /*gui-horiz-scroll*
+gui-init gui.txt /*gui-init*
+gui-mouse gui.txt /*gui-mouse*
+gui-mouse-focus gui.txt /*gui-mouse-focus*
+gui-mouse-mapping gui.txt /*gui-mouse-mapping*
+gui-mouse-modeless gui.txt /*gui-mouse-modeless*
+gui-mouse-move gui.txt /*gui-mouse-move*
+gui-mouse-select gui.txt /*gui-mouse-select*
+gui-mouse-status gui.txt /*gui-mouse-status*
+gui-mouse-various gui.txt /*gui-mouse-various*
+gui-pty gui_x11.txt /*gui-pty*
+gui-pty-erase gui_x11.txt /*gui-pty-erase*
+gui-resources gui_x11.txt /*gui-resources*
+gui-scrollbars gui.txt /*gui-scrollbars*
+gui-selections gui.txt /*gui-selections*
+gui-shell gui.txt /*gui-shell*
+gui-shell-win32 gui_w32.txt /*gui-shell-win32*
+gui-start gui.txt /*gui-start*
+gui-toolbar gui.txt /*gui-toolbar*
+gui-vert-scroll gui.txt /*gui-vert-scroll*
+gui-w16 gui_w16.txt /*gui-w16*
+gui-w32 gui_w32.txt /*gui-w32*
+gui-w32-cmdargs gui_w32.txt /*gui-w32-cmdargs*
+gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
+gui-w32-printing gui_w32.txt /*gui-w32-printing*
+gui-w32-start gui_w32.txt /*gui-w32-start*
+gui-w32-various gui_w32.txt /*gui-w32-various*
+gui-w32s gui_w32.txt /*gui-w32s*
+gui-win32-maximized gui_w32.txt /*gui-win32-maximized*
+gui-x11 gui_x11.txt /*gui-x11*
+gui-x11-athena gui_x11.txt /*gui-x11-athena*
+gui-x11-compiling gui_x11.txt /*gui-x11-compiling*
+gui-x11-gtk gui_x11.txt /*gui-x11-gtk*
+gui-x11-misc gui_x11.txt /*gui-x11-misc*
+gui-x11-motif gui_x11.txt /*gui-x11-motif*
+gui-x11-neXtaw gui_x11.txt /*gui-x11-neXtaw*
+gui-x11-printing gui_x11.txt /*gui-x11-printing*
+gui-x11-start gui_x11.txt /*gui-x11-start*
+gui-x11-various gui_x11.txt /*gui-x11-various*
+gui.txt gui.txt /*gui.txt*
+gui_w16.txt gui_w16.txt /*gui_w16.txt*
+gui_w32.txt gui_w32.txt /*gui_w32.txt*
+gui_x11.txt gui_x11.txt /*gui_x11.txt*
+guifontwide_gtk2 options.txt /*guifontwide_gtk2*
+guioptions_a options.txt /*guioptions_a*
+guu change.txt /*guu*
+gv visual.txt /*gv*
+gview starting.txt /*gview*
+gvim starting.txt /*gvim*
+gvimdiff diff.txt /*gvimdiff*
+gvimrc gui.txt /*gvimrc*
+gw change.txt /*gw*
+gzip pi_gzip.txt /*gzip*
+gzip-autocmd pi_gzip.txt /*gzip-autocmd*
+gzip-example autocmd.txt /*gzip-example*
+gzip-helpfile tips.txt /*gzip-helpfile*
+g~ change.txt /*g~*
+g~g~ change.txt /*g~g~*
+g~~ change.txt /*g~~*
+h motion.txt /*h*
+hangul hangulin.txt /*hangul*
+hangulin.txt hangulin.txt /*hangulin.txt*
+has() eval.txt /*has()*
+has-patch eval.txt /*has-patch*
+haskell-syntax syntax.txt /*haskell-syntax*
+haskell.vim syntax.txt /*haskell.vim*
+hasmapto() eval.txt /*hasmapto()*
+hebrew hebrew.txt /*hebrew*
+hebrew.txt hebrew.txt /*hebrew.txt*
+help various.txt /*help*
+help-context help.txt /*help-context*
+help-tags tags 1
+help-translated various.txt /*help-translated*
+help-xterm-window various.txt /*help-xterm-window*
+help.txt help.txt /*help.txt*
+hex-editing tips.txt /*hex-editing*
+hidden-buffer windows.txt /*hidden-buffer*
+hidden-changed version5.txt /*hidden-changed*
+hidden-menus gui.txt /*hidden-menus*
+hidden-quit windows.txt /*hidden-quit*
+highlight-args syntax.txt /*highlight-args*
+highlight-changed version4.txt /*highlight-changed*
+highlight-cterm syntax.txt /*highlight-cterm*
+highlight-ctermbg syntax.txt /*highlight-ctermbg*
+highlight-ctermfg syntax.txt /*highlight-ctermfg*
+highlight-default syntax.txt /*highlight-default*
+highlight-font syntax.txt /*highlight-font*
+highlight-groups syntax.txt /*highlight-groups*
+highlight-gui syntax.txt /*highlight-gui*
+highlight-guibg syntax.txt /*highlight-guibg*
+highlight-guifg syntax.txt /*highlight-guifg*
+highlight-start syntax.txt /*highlight-start*
+highlight-stop syntax.txt /*highlight-stop*
+highlight-term syntax.txt /*highlight-term*
+highlightID() eval.txt /*highlightID()*
+highlight_exists() eval.txt /*highlight_exists()*
+his cmdline.txt /*his*
+hist-names eval.txt /*hist-names*
+histadd() eval.txt /*histadd()*
+histdel() eval.txt /*histdel()*
+histget() eval.txt /*histget()*
+histnr() eval.txt /*histnr()*
+history cmdline.txt /*history*
+hit-enter message.txt /*hit-enter*
+hit-return message.txt /*hit-return*
+hitest.vim syntax.txt /*hitest.vim*
+hjkl usr_02.txt /*hjkl*
+hl-Cursor syntax.txt /*hl-Cursor*
+hl-CursorIM syntax.txt /*hl-CursorIM*
+hl-DiffAdd syntax.txt /*hl-DiffAdd*
+hl-DiffChange syntax.txt /*hl-DiffChange*
+hl-DiffDelete syntax.txt /*hl-DiffDelete*
+hl-DiffText syntax.txt /*hl-DiffText*
+hl-Directory syntax.txt /*hl-Directory*
+hl-ErrorMsg syntax.txt /*hl-ErrorMsg*
+hl-FoldColumn syntax.txt /*hl-FoldColumn*
+hl-Folded syntax.txt /*hl-Folded*
+hl-IncSearch syntax.txt /*hl-IncSearch*
+hl-LineNr syntax.txt /*hl-LineNr*
+hl-Menu syntax.txt /*hl-Menu*
+hl-ModeMsg syntax.txt /*hl-ModeMsg*
+hl-MoreMsg syntax.txt /*hl-MoreMsg*
+hl-NonText syntax.txt /*hl-NonText*
+hl-Normal syntax.txt /*hl-Normal*
+hl-Question syntax.txt /*hl-Question*
+hl-Scrollbar syntax.txt /*hl-Scrollbar*
+hl-Search syntax.txt /*hl-Search*
+hl-SignColumn syntax.txt /*hl-SignColumn*
+hl-SpecialKey syntax.txt /*hl-SpecialKey*
+hl-StatusLine syntax.txt /*hl-StatusLine*
+hl-StatusLineNC syntax.txt /*hl-StatusLineNC*
+hl-Title syntax.txt /*hl-Title*
+hl-Tooltip syntax.txt /*hl-Tooltip*
+hl-User1 syntax.txt /*hl-User1*
+hl-User1..9 syntax.txt /*hl-User1..9*
+hl-VertSplit syntax.txt /*hl-VertSplit*
+hl-Visual syntax.txt /*hl-Visual*
+hl-VisualNOS syntax.txt /*hl-VisualNOS*
+hl-WarningMsg syntax.txt /*hl-WarningMsg*
+hl-WildMenu syntax.txt /*hl-WildMenu*
+hlID() eval.txt /*hlID()*
+hlexists() eval.txt /*hlexists()*
+holy-grail index.txt /*holy-grail*
+home intro.txt /*home*
+home-replace editing.txt /*home-replace*
+hostname() eval.txt /*hostname()*
+how-do-i howto.txt /*how-do-i*
+how-to howto.txt /*how-to*
+howdoi howto.txt /*howdoi*
+howto howto.txt /*howto*
+howto.txt howto.txt /*howto.txt*
+hpterm term.txt /*hpterm*
+hpterm-color syntax.txt /*hpterm-color*
+html-syntax syntax.txt /*html-syntax*
+html.vim syntax.txt /*html.vim*
+htmlos-syntax syntax.txt /*htmlos-syntax*
+htmlos.vim syntax.txt /*htmlos.vim*
+http pi_netrw.txt /*http*
+i insert.txt /*i*
+i( motion.txt /*i(*
+i) motion.txt /*i)*
+i< motion.txt /*i<*
+i> motion.txt /*i>*
+iB motion.txt /*iB*
+iW motion.txt /*iW*
+i[ motion.txt /*i[*
+i] motion.txt /*i]*
+i_0_CTRL-D insert.txt /*i_0_CTRL-D*
+i_<BS> insert.txt /*i_<BS>*
+i_<C-End> insert.txt /*i_<C-End>*
+i_<C-Home> insert.txt /*i_<C-Home>*
+i_<C-Left> insert.txt /*i_<C-Left>*
+i_<C-Right> insert.txt /*i_<C-Right>*
+i_<CR> insert.txt /*i_<CR>*
+i_<Del> insert.txt /*i_<Del>*
+i_<Down> insert.txt /*i_<Down>*
+i_<End> insert.txt /*i_<End>*
+i_<Esc> insert.txt /*i_<Esc>*
+i_<F1> various.txt /*i_<F1>*
+i_<Help> various.txt /*i_<Help>*
+i_<Home> insert.txt /*i_<Home>*
+i_<Insert> insert.txt /*i_<Insert>*
+i_<Left> insert.txt /*i_<Left>*
+i_<LeftMouse> insert.txt /*i_<LeftMouse>*
+i_<MouseDown> insert.txt /*i_<MouseDown>*
+i_<MouseUp> insert.txt /*i_<MouseUp>*
+i_<NL> insert.txt /*i_<NL>*
+i_<PageDown> insert.txt /*i_<PageDown>*
+i_<PageUp> insert.txt /*i_<PageUp>*
+i_<Right> insert.txt /*i_<Right>*
+i_<S-Down> insert.txt /*i_<S-Down>*
+i_<S-Left> insert.txt /*i_<S-Left>*
+i_<S-MouseDown> insert.txt /*i_<S-MouseDown>*
+i_<S-MouseUp> insert.txt /*i_<S-MouseUp>*
+i_<S-Right> insert.txt /*i_<S-Right>*
+i_<S-Up> insert.txt /*i_<S-Up>*
+i_<Tab> insert.txt /*i_<Tab>*
+i_<Up> insert.txt /*i_<Up>*
+i_BS insert.txt /*i_BS*
+i_CTRL-@ insert.txt /*i_CTRL-@*
+i_CTRL-A insert.txt /*i_CTRL-A*
+i_CTRL-B-gone version5.txt /*i_CTRL-B-gone*
+i_CTRL-C insert.txt /*i_CTRL-C*
+i_CTRL-D insert.txt /*i_CTRL-D*
+i_CTRL-E insert.txt /*i_CTRL-E*
+i_CTRL-G_<Down> insert.txt /*i_CTRL-G_<Down>*
+i_CTRL-G_<Up> insert.txt /*i_CTRL-G_<Up>*
+i_CTRL-G_CTRL-J insert.txt /*i_CTRL-G_CTRL-J*
+i_CTRL-G_CTRL-K insert.txt /*i_CTRL-G_CTRL-K*
+i_CTRL-G_j insert.txt /*i_CTRL-G_j*
+i_CTRL-G_k insert.txt /*i_CTRL-G_k*
+i_CTRL-G_u insert.txt /*i_CTRL-G_u*
+i_CTRL-H insert.txt /*i_CTRL-H*
+i_CTRL-I insert.txt /*i_CTRL-I*
+i_CTRL-J insert.txt /*i_CTRL-J*
+i_CTRL-K insert.txt /*i_CTRL-K*
+i_CTRL-L options.txt /*i_CTRL-L*
+i_CTRL-M insert.txt /*i_CTRL-M*
+i_CTRL-N insert.txt /*i_CTRL-N*
+i_CTRL-O insert.txt /*i_CTRL-O*
+i_CTRL-P insert.txt /*i_CTRL-P*
+i_CTRL-Q insert.txt /*i_CTRL-Q*
+i_CTRL-R insert.txt /*i_CTRL-R*
+i_CTRL-R_CTRL-O insert.txt /*i_CTRL-R_CTRL-O*
+i_CTRL-R_CTRL-P insert.txt /*i_CTRL-R_CTRL-P*
+i_CTRL-R_CTRL-R insert.txt /*i_CTRL-R_CTRL-R*
+i_CTRL-T insert.txt /*i_CTRL-T*
+i_CTRL-U insert.txt /*i_CTRL-U*
+i_CTRL-V insert.txt /*i_CTRL-V*
+i_CTRL-V_digit insert.txt /*i_CTRL-V_digit*
+i_CTRL-W insert.txt /*i_CTRL-W*
+i_CTRL-X insert.txt /*i_CTRL-X*
+i_CTRL-X_CTRL-D insert.txt /*i_CTRL-X_CTRL-D*
+i_CTRL-X_CTRL-E insert.txt /*i_CTRL-X_CTRL-E*
+i_CTRL-X_CTRL-F insert.txt /*i_CTRL-X_CTRL-F*
+i_CTRL-X_CTRL-I insert.txt /*i_CTRL-X_CTRL-I*
+i_CTRL-X_CTRL-K insert.txt /*i_CTRL-X_CTRL-K*
+i_CTRL-X_CTRL-L insert.txt /*i_CTRL-X_CTRL-L*
+i_CTRL-X_CTRL-N insert.txt /*i_CTRL-X_CTRL-N*
+i_CTRL-X_CTRL-P insert.txt /*i_CTRL-X_CTRL-P*
+i_CTRL-X_CTRL-T insert.txt /*i_CTRL-X_CTRL-T*
+i_CTRL-X_CTRL-V insert.txt /*i_CTRL-X_CTRL-V*
+i_CTRL-X_CTRL-Y insert.txt /*i_CTRL-X_CTRL-Y*
+i_CTRL-X_CTRL-] insert.txt /*i_CTRL-X_CTRL-]*
+i_CTRL-Y insert.txt /*i_CTRL-Y*
+i_CTRL-Z options.txt /*i_CTRL-Z*
+i_CTRL-[ insert.txt /*i_CTRL-[*
+i_CTRL-\_CTRL-G intro.txt /*i_CTRL-\\_CTRL-G*
+i_CTRL-\_CTRL-N intro.txt /*i_CTRL-\\_CTRL-N*
+i_CTRL-] insert.txt /*i_CTRL-]*
+i_CTRL-^ insert.txt /*i_CTRL-^*
+i_CTRL-_ insert.txt /*i_CTRL-_*
+i_DEL insert.txt /*i_DEL*
+i_Tab insert.txt /*i_Tab*
+i_^_CTRL-D insert.txt /*i_^_CTRL-D*
+i_backspacing insert.txt /*i_backspacing*
+i_digraph digraph.txt /*i_digraph*
+i_esc intro.txt /*i_esc*
+ia64-syntax syntax.txt /*ia64-syntax*
+ia64.vim syntax.txt /*ia64.vim*
+ib motion.txt /*ib*
+iccf uganda.txt /*iccf*
+icon-changed version4.txt /*icon-changed*
+iconise starting.txt /*iconise*
+iconize starting.txt /*iconize*
+iconv() eval.txt /*iconv()*
+ident-search tips.txt /*ident-search*
+if_cscop.txt if_cscop.txt /*if_cscop.txt*
+if_ole.txt if_ole.txt /*if_ole.txt*
+if_perl.txt if_perl.txt /*if_perl.txt*
+if_pyth.txt if_pyth.txt /*if_pyth.txt*
+if_ruby.txt if_ruby.txt /*if_ruby.txt*
+if_sniff.txt if_sniff.txt /*if_sniff.txt*
+if_tcl.txt if_tcl.txt /*if_tcl.txt*
+ignore-errors eval.txt /*ignore-errors*
+improved-autocmds-5.4 version5.txt /*improved-autocmds-5.4*
+improved-quickfix version5.txt /*improved-quickfix*
+improved-sessions version5.txt /*improved-sessions*
+improved-viminfo version5.txt /*improved-viminfo*
+improvements-5 version5.txt /*improvements-5*
+improvements-6 version6.txt /*improvements-6*
+inactive-buffer windows.txt /*inactive-buffer*
+include-search tagsrch.txt /*include-search*
+inclusive motion.txt /*inclusive*
+incomp-small-6 version6.txt /*incomp-small-6*
+incompatible-5 version5.txt /*incompatible-5*
+incompatible-6 version6.txt /*incompatible-6*
+indent() eval.txt /*indent()*
+indent-expression indent.txt /*indent-expression*
+indent.txt indent.txt /*indent.txt*
+indentkeys-format indent.txt /*indentkeys-format*
+index index.txt /*index*
+index.txt index.txt /*index.txt*
+info-message starting.txt /*info-message*
+inform-syntax syntax.txt /*inform-syntax*
+inform.vim syntax.txt /*inform.vim*
+initialization starting.txt /*initialization*
+input() eval.txt /*input()*
+inputdialog() eval.txt /*inputdialog()*
+inputrestore() eval.txt /*inputrestore()*
+inputsave() eval.txt /*inputsave()*
+inputsecret() eval.txt /*inputsecret()*
+ins-completion insert.txt /*ins-completion*
+ins-expandtab insert.txt /*ins-expandtab*
+ins-reverse rileft.txt /*ins-reverse*
+ins-smarttab insert.txt /*ins-smarttab*
+ins-softtabstop insert.txt /*ins-softtabstop*
+ins-special-keys insert.txt /*ins-special-keys*
+ins-special-special insert.txt /*ins-special-special*
+ins-textwidth insert.txt /*ins-textwidth*
+insert insert.txt /*insert*
+insert-index index.txt /*insert-index*
+insert.txt insert.txt /*insert.txt*
+insert_expand insert.txt /*insert_expand*
+inserting insert.txt /*inserting*
+inserting-ex insert.txt /*inserting-ex*
+inserting-file insert.txt /*inserting-file*
+install usr_90.txt /*install*
+install-home usr_90.txt /*install-home*
+install-registry gui_w32.txt /*install-registry*
+intel-itanium syntax.txt /*intel-itanium*
+intellimouse-wheel-problems gui_w32.txt /*intellimouse-wheel-problems*
+interfaces-5.2 version5.txt /*interfaces-5.2*
+internal-variables eval.txt /*internal-variables*
+internet intro.txt /*internet*
+intro intro.txt /*intro*
+intro.txt intro.txt /*intro.txt*
+ip motion.txt /*ip*
+is motion.txt /*is*
+isdirectory() eval.txt /*isdirectory()*
+iw motion.txt /*iw*
+i{ motion.txt /*i{*
+i} motion.txt /*i}*
+j motion.txt /*j*
+java-cinoptions indent.txt /*java-cinoptions*
+java-indenting indent.txt /*java-indenting*
+java-syntax syntax.txt /*java-syntax*
+java.vim syntax.txt /*java.vim*
+jsbterm-mouse options.txt /*jsbterm-mouse*
+jtags tagsrch.txt /*jtags*
+jump-motions motion.txt /*jump-motions*
+jumplist motion.txt /*jumplist*
+jumpto-diffs diff.txt /*jumpto-diffs*
+k motion.txt /*k*
+kcc uganda.txt /*kcc*
+key-codes intro.txt /*key-codes*
+key-codes-changed version4.txt /*key-codes-changed*
+key-mapping map.txt /*key-mapping*
+key-notation intro.txt /*key-notation*
+keycodes intro.txt /*keycodes*
+keymap-file-format mbyte.txt /*keymap-file-format*
+keymap-hebrew mbyte.txt /*keymap-hebrew*
+keypad-0 intro.txt /*keypad-0*
+keypad-9 intro.txt /*keypad-9*
+keypad-divide intro.txt /*keypad-divide*
+keypad-end intro.txt /*keypad-end*
+keypad-enter intro.txt /*keypad-enter*
+keypad-home intro.txt /*keypad-home*
+keypad-minus intro.txt /*keypad-minus*
+keypad-multiply intro.txt /*keypad-multiply*
+keypad-page-down intro.txt /*keypad-page-down*
+keypad-page-up intro.txt /*keypad-page-up*
+keypad-plus intro.txt /*keypad-plus*
+keypad-point intro.txt /*keypad-point*
+known-bugs todo.txt /*known-bugs*
+l motion.txt /*l*
+l:var eval.txt /*l:var*
+lace-syntax syntax.txt /*lace-syntax*
+lace.vim syntax.txt /*lace.vim*
+lang-variable eval.txt /*lang-variable*
+language-mapping map.txt /*language-mapping*
+last-pattern pattern.txt /*last-pattern*
+last-position-jump eval.txt /*last-position-jump*
+last_buffer_nr() eval.txt /*last_buffer_nr()*
+lc_time-variable eval.txt /*lc_time-variable*
+left-right-motions motion.txt /*left-right-motions*
+less various.txt /*less*
+letter options.txt /*letter*
+lex-syntax syntax.txt /*lex-syntax*
+lex.vim syntax.txt /*lex.vim*
+lhaskell.vim syntax.txt /*lhaskell.vim*
+libcall() eval.txt /*libcall()*
+libcallnr() eval.txt /*libcallnr()*
+license uganda.txt /*license*
+lid quickfix.txt /*lid*
+limits vi_diff.txt /*limits*
+line() eval.txt /*line()*
+line-continuation repeat.txt /*line-continuation*
+line2byte() eval.txt /*line2byte()*
+linefeed intro.txt /*linefeed*
+linewise motion.txt /*linewise*
+linewise-register change.txt /*linewise-register*
+linewise-visual visual.txt /*linewise-visual*
+lispindent() eval.txt /*lispindent()*
+list-repeat windows.txt /*list-repeat*
+lite-syntax syntax.txt /*lite-syntax*
+lite.vim syntax.txt /*lite.vim*
+literal-string eval.txt /*literal-string*
+lnum-variable eval.txt /*lnum-variable*
+load-plugins starting.txt /*load-plugins*
+load-vim-script repeat.txt /*load-vim-script*
+local-additions help.txt /*local-additions*
+local-function eval.txt /*local-function*
+local-options options.txt /*local-options*
+local-variable eval.txt /*local-variable*
+locale mbyte.txt /*locale*
+locale-name mbyte.txt /*locale-name*
+localtime() eval.txt /*localtime()*
+long-lines version5.txt /*long-lines*
+lowercase change.txt /*lowercase*
+lpc-syntax syntax.txt /*lpc-syntax*
+lpc.vim syntax.txt /*lpc.vim*
+lua-syntax syntax.txt /*lua-syntax*
+lua.vim syntax.txt /*lua.vim*
+m motion.txt /*m*
+m' motion.txt /*m'*
+m[ motion.txt /*m[*
+m] motion.txt /*m]*
+m` motion.txt /*m`*
+mac os_mac.txt /*mac*
+mac-bug os_mac.txt /*mac-bug*
+mac-compile os_mac.txt /*mac-compile*
+mac-faq os_mac.txt /*mac-faq*
+mac-filename os_mac.txt /*mac-filename*
+mac-lack os_mac.txt /*mac-lack*
+mac-vimfile os_mac.txt /*mac-vimfile*
+macintosh os_mac.txt /*macintosh*
+macro map.txt /*macro*
+mail-list intro.txt /*mail-list*
+mail-plugin filetype.txt /*mail-plugin*
+mail.vim syntax.txt /*mail.vim*
+maillist intro.txt /*maillist*
+maillist-archive intro.txt /*maillist-archive*
+make-syntax syntax.txt /*make-syntax*
+make.vim syntax.txt /*make.vim*
+man-plugin filetype.txt /*man-plugin*
+manual-copyright usr_01.txt /*manual-copyright*
+map-<SID> map.txt /*map-<SID>*
+map-ambiguous map.txt /*map-ambiguous*
+map-backtick tips.txt /*map-backtick*
+map-comments map.txt /*map-comments*
+map-examples map.txt /*map-examples*
+map-keys-fails map.txt /*map-keys-fails*
+map-listing map.txt /*map-listing*
+map-modes map.txt /*map-modes*
+map-multibyte map.txt /*map-multibyte*
+map-overview map.txt /*map-overview*
+map-self-destroy tips.txt /*map-self-destroy*
+map-typing map.txt /*map-typing*
+map-which-keys map.txt /*map-which-keys*
+map.txt map.txt /*map.txt*
+map_CTRL_C map.txt /*map_CTRL_C*
+map_backslash map.txt /*map_backslash*
+map_bar map.txt /*map_bar*
+map_empty_rhs map.txt /*map_empty_rhs*
+map_return map.txt /*map_return*
+map_space_in_lhs map.txt /*map_space_in_lhs*
+map_space_in_rhs map.txt /*map_space_in_rhs*
+maparg() eval.txt /*maparg()*
+mapcheck() eval.txt /*mapcheck()*
+maple-syntax syntax.txt /*maple-syntax*
+maple.vim syntax.txt /*maple.vim*
+mapleader map.txt /*mapleader*
+maplocalleader map.txt /*maplocalleader*
+mapping map.txt /*mapping*
+mark motion.txt /*mark*
+mark-motions motion.txt /*mark-motions*
+masm-syntax syntax.txt /*masm-syntax*
+masm.vim syntax.txt /*masm.vim*
+match() eval.txt /*match()*
+match-highlight pattern.txt /*match-highlight*
+matchend() eval.txt /*matchend()*
+matchit-install usr_05.txt /*matchit-install*
+matchstr() eval.txt /*matchstr()*
+mbyte-IME mbyte.txt /*mbyte-IME*
+mbyte-XIM mbyte.txt /*mbyte-XIM*
+mbyte-conversion mbyte.txt /*mbyte-conversion*
+mbyte-encoding mbyte.txt /*mbyte-encoding*
+mbyte-first mbyte.txt /*mbyte-first*
+mbyte-fonts-MSwin mbyte.txt /*mbyte-fonts-MSwin*
+mbyte-fonts-X11 mbyte.txt /*mbyte-fonts-X11*
+mbyte-keymap mbyte.txt /*mbyte-keymap*
+mbyte-locale mbyte.txt /*mbyte-locale*
+mbyte-options mbyte.txt /*mbyte-options*
+mbyte-terminal mbyte.txt /*mbyte-terminal*
+mbyte-utf8 mbyte.txt /*mbyte-utf8*
+mbyte.txt mbyte.txt /*mbyte.txt*
+menu-changes-5.4 version5.txt /*menu-changes-5.4*
+menu-examples gui.txt /*menu-examples*
+menu-priority gui.txt /*menu-priority*
+menu-separator gui.txt /*menu-separator*
+menu.vim gui.txt /*menu.vim*
+menus gui.txt /*menus*
+message-history message.txt /*message-history*
+message.txt message.txt /*message.txt*
+messages message.txt /*messages*
+meta intro.txt /*meta*
+minimal-features os_msdos.txt /*minimal-features*
+missing-commands vi_diff.txt /*missing-commands*
+missing-options vi_diff.txt /*missing-options*
+mlang.txt mlang.txt /*mlang.txt*
+mode() eval.txt /*mode()*
+mode-Ex intro.txt /*mode-Ex*
+mode-cmdline cmdline.txt /*mode-cmdline*
+mode-ins-repl insert.txt /*mode-ins-repl*
+mode-replace insert.txt /*mode-replace*
+mode-switching intro.txt /*mode-switching*
+modeless-and-clipboard version6.txt /*modeless-and-clipboard*
+modeless-selection gui.txt /*modeless-selection*
+modeline options.txt /*modeline*
+modeline-local options.txt /*modeline-local*
+modeline-version options.txt /*modeline-version*
+moo-syntax syntax.txt /*moo-syntax*
+moo.vim syntax.txt /*moo.vim*
+more-compatible version5.txt /*more-compatible*
+more-prompt message.txt /*more-prompt*
+motion.txt motion.txt /*motion.txt*
+mouse-mode-table term.txt /*mouse-mode-table*
+mouse-overview term.txt /*mouse-overview*
+mouse-swap-buttons term.txt /*mouse-swap-buttons*
+mouse-using term.txt /*mouse-using*
+ms-dos os_msdos.txt /*ms-dos*
+msdos os_msdos.txt /*msdos*
+msdos-arrows os_msdos.txt /*msdos-arrows*
+msdos-clipboard-limits os_msdos.txt /*msdos-clipboard-limits*
+msdos-compiling os_msdos.txt /*msdos-compiling*
+msdos-copy-paste os_msdos.txt /*msdos-copy-paste*
+msdos-fname-extensions os_msdos.txt /*msdos-fname-extensions*
+msdos-limitations os_msdos.txt /*msdos-limitations*
+msdos-linked-files os_msdos.txt /*msdos-linked-files*
+msdos-longfname os_msdos.txt /*msdos-longfname*
+msdos-mode gui_w32.txt /*msdos-mode*
+msdos-problems os_msdos.txt /*msdos-problems*
+msdos-termcap os_msdos.txt /*msdos-termcap*
+msdos-versions os_msdos.txt /*msdos-versions*
+msql-syntax syntax.txt /*msql-syntax*
+msql.vim syntax.txt /*msql.vim*
+mswin.vim gui_w32.txt /*mswin.vim*
+multi-byte mbyte.txt /*multi-byte*
+multi-lang mlang.txt /*multi-lang*
+multi-repeat repeat.txt /*multi-repeat*
+multibyte mbyte.txt /*multibyte*
+multibyte-ime mbyte.txt /*multibyte-ime*
+multibyte-input mbyte.txt /*multibyte-input*
+multilang mlang.txt /*multilang*
+multilang-menus mlang.txt /*multilang-menus*
+multilang-messages mlang.txt /*multilang-messages*
+multilang-scripts mlang.txt /*multilang-scripts*
+myfiletypefile syntax.txt /*myfiletypefile*
+myscriptsfile syntax.txt /*myscriptsfile*
+mysyntaxfile syntax.txt /*mysyntaxfile*
+mysyntaxfile-add syntax.txt /*mysyntaxfile-add*
+mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace*
+n pattern.txt /*n*
+nasm-syntax syntax.txt /*nasm-syntax*
+nasm.vim syntax.txt /*nasm.vim*
+navigation motion.txt /*navigation*
+nb-commands netbeans.txt /*nb-commands*
+nb-events netbeans.txt /*nb-events*
+nb-functions netbeans.txt /*nb-functions*
+nb-messages netbeans.txt /*nb-messages*
+nb-special netbeans.txt /*nb-special*
+nb-terms netbeans.txt /*nb-terms*
+ncf-syntax syntax.txt /*ncf-syntax*
+ncf.vim syntax.txt /*ncf.vim*
+netbeans netbeans.txt /*netbeans*
+netbeans-configure netbeans.txt /*netbeans-configure*
+netbeans-download netbeans.txt /*netbeans-download*
+netbeans-intro netbeans.txt /*netbeans-intro*
+netbeans-keybindings netbeans.txt /*netbeans-keybindings*
+netbeans-messages netbeans.txt /*netbeans-messages*
+netbeans-preparation netbeans.txt /*netbeans-preparation*
+netbeans-problems netbeans.txt /*netbeans-problems*
+netbeans-protocol netbeans.txt /*netbeans-protocol*
+netbeans-run netbeans.txt /*netbeans-run*
+netbeans-setup netbeans.txt /*netbeans-setup*
+netbeans-support netbeans.txt /*netbeans-support*
+netbeans.txt netbeans.txt /*netbeans.txt*
+netrw pi_netrw.txt /*netrw*
+netrw-activate pi_netrw.txt /*netrw-activate*
+netrw-contents pi_netrw.txt /*netrw-contents*
+netrw-credits pi_netrw.txt /*netrw-credits*
+netrw-debug pi_netrw.txt /*netrw-debug*
+netrw-ex pi_netrw.txt /*netrw-ex*
+netrw-file pi_netrw.txt /*netrw-file*
+netrw-fixup pi_netrw.txt /*netrw-fixup*
+netrw-netrc pi_netrw.txt /*netrw-netrc*
+netrw-new pi_netrw.txt /*netrw-new*
+netrw-newstuff pi_netrw.txt /*netrw-newstuff*
+netrw-options pi_netrw.txt /*netrw-options*
+netrw-passwd pi_netrw.txt /*netrw-passwd*
+netrw-protocol pi_netrw.txt /*netrw-protocol*
+netrw-ref pi_netrw.txt /*netrw-ref*
+netrw-transparent pi_netrw.txt /*netrw-transparent*
+netrw-uidpass pi_netrw.txt /*netrw-uidpass*
+netrw-urls pi_netrw.txt /*netrw-urls*
+netrw-var pi_netrw.txt /*netrw-var*
+netrw-xfer pi_netrw.txt /*netrw-xfer*
+netrw.vim pi_netrw.txt /*netrw.vim*
+netterm-mouse options.txt /*netterm-mouse*
+network pi_netrw.txt /*network*
+new-5 version5.txt /*new-5*
+new-6 version6.txt /*new-6*
+new-GTK-GUI version5.txt /*new-GTK-GUI*
+new-Select-mode version5.txt /*new-Select-mode*
+new-View version6.txt /*new-View*
+new-argument-list version6.txt /*new-argument-list*
+new-buftype version6.txt /*new-buftype*
+new-cmdwin version6.txt /*new-cmdwin*
+new-color-schemes version6.txt /*new-color-schemes*
+new-commands version5.txt /*new-commands*
+new-commands-5.4 version5.txt /*new-commands-5.4*
+new-debug-itf version6.txt /*new-debug-itf*
+new-debug-mode version6.txt /*new-debug-mode*
+new-diff-mode version6.txt /*new-diff-mode*
+new-encryption version5.txt /*new-encryption*
+new-evim version6.txt /*new-evim*
+new-ex-commands-5.2 version5.txt /*new-ex-commands-5.2*
+new-file-browser version6.txt /*new-file-browser*
+new-file-writing version6.txt /*new-file-writing*
+new-filetype filetype.txt /*new-filetype*
+new-filetype-5.4 version5.txt /*new-filetype-5.4*
+new-filetype-plugins version6.txt /*new-filetype-plugins*
+new-filetype-scripts filetype.txt /*new-filetype-scripts*
+new-folding version6.txt /*new-folding*
+new-functions-5.2 version5.txt /*new-functions-5.2*
+new-global-values version6.txt /*new-global-values*
+new-highlighting version5.txt /*new-highlighting*
+new-indent-flex version6.txt /*new-indent-flex*
+new-items-6 version6.txt /*new-items-6*
+new-line-continuation version5.txt /*new-line-continuation*
+new-multi-byte version5.txt /*new-multi-byte*
+new-multi-lang version6.txt /*new-multi-lang*
+new-network-files version6.txt /*new-network-files*
+new-operator-mod version6.txt /*new-operator-mod*
+new-options-5.2 version5.txt /*new-options-5.2*
+new-options-5.4 version5.txt /*new-options-5.4*
+new-perl-python version5.txt /*new-perl-python*
+new-plugins version6.txt /*new-plugins*
+new-printing version6.txt /*new-printing*
+new-runtime-dir version5.txt /*new-runtime-dir*
+new-script version5.txt /*new-script*
+new-script-5.4 version5.txt /*new-script-5.4*
+new-search-path version6.txt /*new-search-path*
+new-searchpat version6.txt /*new-searchpat*
+new-session-files version5.txt /*new-session-files*
+new-unlisted-buffers version6.txt /*new-unlisted-buffers*
+new-user-defined version5.txt /*new-user-defined*
+new-user-manual version6.txt /*new-user-manual*
+new-utf-8 version6.txt /*new-utf-8*
+new-vertsplit version6.txt /*new-vertsplit*
+new-vim-server version6.txt /*new-vim-server*
+new-virtedit version6.txt /*new-virtedit*
+news intro.txt /*news*
+nextnonblank() eval.txt /*nextnonblank()*
+no-eval-feature eval.txt /*no-eval-feature*
+no_buffers_menu gui.txt /*no_buffers_menu*
+normal-index index.txt /*normal-index*
+not-compatible usr_01.txt /*not-compatible*
+not-edited editing.txt /*not-edited*
+notation intro.txt /*notation*
+notepad gui_w32.txt /*notepad*
+nr2char() eval.txt /*nr2char()*
+nroff-syntax syntax.txt /*nroff-syntax*
+nroff.vim syntax.txt /*nroff.vim*
+o insert.txt /*o*
+o_CTRL-V motion.txt /*o_CTRL-V*
+o_V motion.txt /*o_V*
+o_v motion.txt /*o_v*
+object-motions motion.txt /*object-motions*
+object-select motion.txt /*object-select*
+objects index.txt /*objects*
+obtaining-exted netbeans.txt /*obtaining-exted*
+ocaml-syntax syntax.txt /*ocaml-syntax*
+ocaml.vim syntax.txt /*ocaml.vim*
+ole-activation if_ole.txt /*ole-activation*
+ole-eval if_ole.txt /*ole-eval*
+ole-gethwnd if_ole.txt /*ole-gethwnd*
+ole-interface if_ole.txt /*ole-interface*
+ole-methods if_ole.txt /*ole-methods*
+ole-normal if_ole.txt /*ole-normal*
+ole-registration if_ole.txt /*ole-registration*
+ole-sendkeys if_ole.txt /*ole-sendkeys*
+ole-setforeground if_ole.txt /*ole-setforeground*
+online-help various.txt /*online-help*
+opening-window windows.txt /*opening-window*
+operator motion.txt /*operator*
+option-backslash options.txt /*option-backslash*
+option-list quickref.txt /*option-list*
+option-summary options.txt /*option-summary*
+options options.txt /*options*
+options-changed version5.txt /*options-changed*
+options.txt options.txt /*options.txt*
+os2 os_os2.txt /*os2*
+os2ansi os_os2.txt /*os2ansi*
+os390 os_390.txt /*os390*
+os_390.txt os_390.txt /*os_390.txt*
+os_amiga.txt os_amiga.txt /*os_amiga.txt*
+os_beos.txt os_beos.txt /*os_beos.txt*
+os_dos.txt os_dos.txt /*os_dos.txt*
+os_mac.txt os_mac.txt /*os_mac.txt*
+os_mint.txt os_mint.txt /*os_mint.txt*
+os_msdos.txt os_msdos.txt /*os_msdos.txt*
+os_os2.txt os_os2.txt /*os_os2.txt*
+os_qnx.txt os_qnx.txt /*os_qnx.txt*
+os_risc.txt os_risc.txt /*os_risc.txt*
+os_unix.txt os_unix.txt /*os_unix.txt*
+os_vms.txt os_vms.txt /*os_vms.txt*
+os_win32.txt os_win32.txt /*os_win32.txt*
+other-features vi_diff.txt /*other-features*
+p change.txt /*p*
+page-down intro.txt /*page-down*
+page-up intro.txt /*page-up*
+page_down intro.txt /*page_down*
+page_up intro.txt /*page_up*
+pager message.txt /*pager*
+papp-syntax syntax.txt /*papp-syntax*
+papp.vim syntax.txt /*papp.vim*
+paragraph motion.txt /*paragraph*
+pascal-syntax syntax.txt /*pascal-syntax*
+pascal.vim syntax.txt /*pascal.vim*
+pattern pattern.txt /*pattern*
+pattern-atoms pattern.txt /*pattern-atoms*
+pattern-multi-byte pattern.txt /*pattern-multi-byte*
+pattern-multi-items pattern.txt /*pattern-multi-items*
+pattern-overview pattern.txt /*pattern-overview*
+pattern-searches pattern.txt /*pattern-searches*
+pattern.txt pattern.txt /*pattern.txt*
+perl if_perl.txt /*perl*
+perl-Append if_perl.txt /*perl-Append*
+perl-Buffer if_perl.txt /*perl-Buffer*
+perl-Buffers if_perl.txt /*perl-Buffers*
+perl-Count if_perl.txt /*perl-Count*
+perl-Delete if_perl.txt /*perl-Delete*
+perl-DoCommand if_perl.txt /*perl-DoCommand*
+perl-Eval if_perl.txt /*perl-Eval*
+perl-Get if_perl.txt /*perl-Get*
+perl-GetCursor if_perl.txt /*perl-GetCursor*
+perl-Msg if_perl.txt /*perl-Msg*
+perl-Name if_perl.txt /*perl-Name*
+perl-Number if_perl.txt /*perl-Number*
+perl-Set if_perl.txt /*perl-Set*
+perl-SetHeight if_perl.txt /*perl-SetHeight*
+perl-SetOption if_perl.txt /*perl-SetOption*
+perl-Windows if_perl.txt /*perl-Windows*
+perl-compiling if_perl.txt /*perl-compiling*
+perl-editing if_perl.txt /*perl-editing*
+perl-overview if_perl.txt /*perl-overview*
+perl-patterns pattern.txt /*perl-patterns*
+perl-syntax syntax.txt /*perl-syntax*
+perl-using if_perl.txt /*perl-using*
+perl.vim syntax.txt /*perl.vim*
+photon-fonts os_qnx.txt /*photon-fonts*
+photon-gui os_qnx.txt /*photon-gui*
+php-syntax syntax.txt /*php-syntax*
+php.vim syntax.txt /*php.vim*
+php3-syntax syntax.txt /*php3-syntax*
+php3.vim syntax.txt /*php3.vim*
+phtml-syntax syntax.txt /*phtml-syntax*
+phtml.vim syntax.txt /*phtml.vim*
+pi_expl.txt pi_expl.txt /*pi_expl.txt*
+pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
+pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
+pi_spec.txt pi_spec.txt /*pi_spec.txt*
+plugin usr_05.txt /*plugin*
+plugin-details filetype.txt /*plugin-details*
+plugin-filetype usr_41.txt /*plugin-filetype*
+plugin-special usr_41.txt /*plugin-special*
+popup-menu gui.txt /*popup-menu*
+popup-menu-added version5.txt /*popup-menu-added*
+ports-5.2 version5.txt /*ports-5.2*
+ports-6 version6.txt /*ports-6*
+postscr-syntax syntax.txt /*postscr-syntax*
+postscr.vim syntax.txt /*postscr.vim*
+postscript-print-encoding various.txt /*postscript-print-encoding*
+postscript-print-trouble various.txt /*postscript-print-trouble*
+postscript-print-util various.txt /*postscript-print-util*
+postscript-printing various.txt /*postscript-printing*
+ppwiz-syntax syntax.txt /*ppwiz-syntax*
+ppwiz.vim syntax.txt /*ppwiz.vim*
+press-enter message.txt /*press-enter*
+press-return message.txt /*press-return*
+prevcount-variable eval.txt /*prevcount-variable*
+preview-window windows.txt /*preview-window*
+prevnonblank() eval.txt /*prevnonblank()*
+printcap-syntax syntax.txt /*printcap-syntax*
+printing various.txt /*printing*
+printing-formfeed various.txt /*printing-formfeed*
+progname-variable eval.txt /*progname-variable*
+progress-syntax syntax.txt /*progress-syntax*
+progress.vim syntax.txt /*progress.vim*
+ptcap-syntax syntax.txt /*ptcap-syntax*
+ptcap.vim syntax.txt /*ptcap.vim*
+pterm-mouse options.txt /*pterm-mouse*
+put change.txt /*put*
+put-Visual-mode change.txt /*put-Visual-mode*
+python if_pyth.txt /*python*
+python-buffer if_pyth.txt /*python-buffer*
+python-buffers if_pyth.txt /*python-buffers*
+python-command if_pyth.txt /*python-command*
+python-commands if_pyth.txt /*python-commands*
+python-current if_pyth.txt /*python-current*
+python-error if_pyth.txt /*python-error*
+python-eval if_pyth.txt /*python-eval*
+python-examples if_pyth.txt /*python-examples*
+python-input if_pyth.txt /*python-input*
+python-output if_pyth.txt /*python-output*
+python-range if_pyth.txt /*python-range*
+python-syntax syntax.txt /*python-syntax*
+python-vim if_pyth.txt /*python-vim*
+python-window if_pyth.txt /*python-window*
+python-windows if_pyth.txt /*python-windows*
+python.vim syntax.txt /*python.vim*
+q repeat.txt /*q*
+q/ cmdline.txt /*q\/*
+q: cmdline.txt /*q:*
+q? cmdline.txt /*q?*
+qnx os_qnx.txt /*qnx*
+qnx-compiling os_qnx.txt /*qnx-compiling*
+qnx-general os_qnx.txt /*qnx-general*
+qnx-terminal os_qnx.txt /*qnx-terminal*
+quake-syntax syntax.txt /*quake-syntax*
+quake.vim syntax.txt /*quake.vim*
+quickfix quickfix.txt /*quickfix*
+quickfix-6 version6.txt /*quickfix-6*
+quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
+quickfix-error-lists quickfix.txt /*quickfix-error-lists*
+quickfix-manx quickfix.txt /*quickfix-manx*
+quickfix-valid quickfix.txt /*quickfix-valid*
+quickfix-window quickfix.txt /*quickfix-window*
+quickfix.txt quickfix.txt /*quickfix.txt*
+quickref quickref.txt /*quickref*
+quickref.txt quickref.txt /*quickref.txt*
+quote change.txt /*quote*
+quote# change.txt /*quote#*
+quote% change.txt /*quote%*
+quote+ gui_x11.txt /*quote+*
+quote- change.txt /*quote-*
+quote. change.txt /*quote.*
+quote/ change.txt /*quote\/*
+quote0 change.txt /*quote0*
+quote1 change.txt /*quote1*
+quote2 change.txt /*quote2*
+quote3 change.txt /*quote3*
+quote4 change.txt /*quote4*
+quote9 change.txt /*quote9*
+quote: change.txt /*quote:*
+quote= change.txt /*quote=*
+quote_ change.txt /*quote_*
+quote_# change.txt /*quote_#*
+quote_% change.txt /*quote_%*
+quote_- change.txt /*quote_-*
+quote_. change.txt /*quote_.*
+quote_/ change.txt /*quote_\/*
+quote_: change.txt /*quote_:*
+quote_= change.txt /*quote_=*
+quote_alpha change.txt /*quote_alpha*
+quote_number change.txt /*quote_number*
+quote_quote change.txt /*quote_quote*
+quote_~ change.txt /*quote_~*
+quotea change.txt /*quotea*
+quotecommandquote intro.txt /*quotecommandquote*
+quoteplus gui_x11.txt /*quoteplus*
+quotequote change.txt /*quotequote*
+quotes quotes.txt /*quotes*
+quotes.txt quotes.txt /*quotes.txt*
+quotestar gui.txt /*quotestar*
+quote~ change.txt /*quote~*
+r change.txt /*r*
+raw-terminal-mode term.txt /*raw-terminal-mode*
+rcp pi_netrw.txt /*rcp*
+read-messages insert.txt /*read-messages*
+read-only-share editing.txt /*read-only-share*
+read-stdin version5.txt /*read-stdin*
+readline-syntax syntax.txt /*readline-syntax*
+readline.vim syntax.txt /*readline.vim*
+recording repeat.txt /*recording*
+recover.txt recover.txt /*recover.txt*
+recovery recover.txt /*recovery*
+recursive_mapping map.txt /*recursive_mapping*
+redo undo.txt /*redo*
+redo-register undo.txt /*redo-register*
+ref intro.txt /*ref*
+reference intro.txt /*reference*
+regexp pattern.txt /*regexp*
+regexp-changes-5.4 version5.txt /*regexp-changes-5.4*
+register sponsor.txt /*register*
+register-faq sponsor.txt /*register-faq*
+register-variable eval.txt /*register-variable*
+registers change.txt /*registers*
+regular-expression pattern.txt /*regular-expression*
+remote.txt remote.txt /*remote.txt*
+remote_expr() eval.txt /*remote_expr()*
+remote_foreground() eval.txt /*remote_foreground()*
+remote_peek() eval.txt /*remote_peek()*
+remote_read() eval.txt /*remote_read()*
+remote_send() eval.txt /*remote_send()*
+remove-filetype filetype.txt /*remove-filetype*
+remove-option-flags options.txt /*remove-option-flags*
+rename() eval.txt /*rename()*
+rename-files tips.txt /*rename-files*
+repeat.txt repeat.txt /*repeat.txt*
+repeating repeat.txt /*repeating*
+replacing change.txt /*replacing*
+resolve() eval.txt /*resolve()*
+restore-position tips.txt /*restore-position*
+restricted-mode starting.txt /*restricted-mode*
+retab-example change.txt /*retab-example*
+rethrow eval.txt /*rethrow*
+rexx-syntax syntax.txt /*rexx-syntax*
+rexx.vim syntax.txt /*rexx.vim*
+rgb.txt gui_w32.txt /*rgb.txt*
+rgview starting.txt /*rgview*
+rgvim starting.txt /*rgvim*
+right-justify change.txt /*right-justify*
+rileft rileft.txt /*rileft*
+rileft.txt rileft.txt /*rileft.txt*
+riscos os_risc.txt /*riscos*
+riscos-commandline os_risc.txt /*riscos-commandline*
+riscos-filetypes os_risc.txt /*riscos-filetypes*
+riscos-gui os_risc.txt /*riscos-gui*
+riscos-interrupt os_risc.txt /*riscos-interrupt*
+riscos-locations os_risc.txt /*riscos-locations*
+riscos-memory os_risc.txt /*riscos-memory*
+riscos-munging os_risc.txt /*riscos-munging*
+riscos-porting os_risc.txt /*riscos-porting*
+riscos-remote os_risc.txt /*riscos-remote*
+riscos-shell os_risc.txt /*riscos-shell*
+riscos-temp-files os_risc.txt /*riscos-temp-files*
+rot13 change.txt /*rot13*
+rsync pi_netrw.txt /*rsync*
+ruby if_ruby.txt /*ruby*
+ruby-buffer if_ruby.txt /*ruby-buffer*
+ruby-command if_ruby.txt /*ruby-command*
+ruby-commands if_ruby.txt /*ruby-commands*
+ruby-evaluate if_ruby.txt /*ruby-evaluate*
+ruby-globals if_ruby.txt /*ruby-globals*
+ruby-message if_ruby.txt /*ruby-message*
+ruby-set_option if_ruby.txt /*ruby-set_option*
+ruby-syntax syntax.txt /*ruby-syntax*
+ruby-vim if_ruby.txt /*ruby-vim*
+ruby-window if_ruby.txt /*ruby-window*
+ruby.vim syntax.txt /*ruby.vim*
+russian russian.txt /*russian*
+russian-intro russian.txt /*russian-intro*
+russian-issues russian.txt /*russian-issues*
+russian-keymap russian.txt /*russian-keymap*
+russian-l18n russian.txt /*russian-l18n*
+russian.txt russian.txt /*russian.txt*
+rview starting.txt /*rview*
+rvim starting.txt /*rvim*
+rxvt syntax.txt /*rxvt*
+s change.txt /*s*
+s/\& change.txt /*s\/\\&*
+s/\0 change.txt /*s\/\\0*
+s/\1 change.txt /*s\/\\1*
+s/\2 change.txt /*s\/\\2*
+s/\3 change.txt /*s\/\\3*
+s/\9 change.txt /*s\/\\9*
+s/\<CR> change.txt /*s\/\\<CR>*
+s/\E change.txt /*s\/\\E*
+s/\L change.txt /*s\/\\L*
+s/\U change.txt /*s\/\\U*
+s/\\ change.txt /*s\/\\\\*
+s/\b change.txt /*s\/\\b*
+s/\e change.txt /*s\/\\e*
+s/\l change.txt /*s\/\\l*
+s/\n change.txt /*s\/\\n*
+s/\r change.txt /*s\/\\r*
+s/\t change.txt /*s\/\\t*
+s/\u change.txt /*s\/\\u*
+s/\~ change.txt /*s\/\\~*
+s:var eval.txt /*s:var*
+s<CR> change.txt /*s<CR>*
+sandbox eval.txt /*sandbox*
+save-file editing.txt /*save-file*
+save-settings starting.txt /*save-settings*
+scp pi_netrw.txt /*scp*
+script-here if_perl.txt /*script-here*
+script-local map.txt /*script-local*
+script-variable eval.txt /*script-variable*
+scriptout-changed version4.txt /*scriptout-changed*
+scroll-binding scroll.txt /*scroll-binding*
+scroll-cursor scroll.txt /*scroll-cursor*
+scroll-down scroll.txt /*scroll-down*
+scroll-horizontal scroll.txt /*scroll-horizontal*
+scroll-insert tips.txt /*scroll-insert*
+scroll-mouse-wheel scroll.txt /*scroll-mouse-wheel*
+scroll-region term.txt /*scroll-region*
+scroll-smooth tips.txt /*scroll-smooth*
+scroll-up scroll.txt /*scroll-up*
+scroll.txt scroll.txt /*scroll.txt*
+scrollbind-quickadj scroll.txt /*scrollbind-quickadj*
+scrollbind-relative scroll.txt /*scrollbind-relative*
+scrolling scroll.txt /*scrolling*
+sdl-syntax syntax.txt /*sdl-syntax*
+sdl.vim syntax.txt /*sdl.vim*
+search() eval.txt /*search()*
+search-commands pattern.txt /*search-commands*
+search-offset pattern.txt /*search-offset*
+search-pattern pattern.txt /*search-pattern*
+search-range pattern.txt /*search-range*
+searchpair() eval.txt /*searchpair()*
+section motion.txt /*section*
+sed-syntax syntax.txt /*sed-syntax*
+sed.vim syntax.txt /*sed.vim*
+send-money sponsor.txt /*send-money*
+send-to-menu gui_w32.txt /*send-to-menu*
+sendto gui_w32.txt /*sendto*
+sentence motion.txt /*sentence*
+server2client() eval.txt /*server2client()*
+serverlist() eval.txt /*serverlist()*
+servername-variable eval.txt /*servername-variable*
+session-file starting.txt /*session-file*
+set-option options.txt /*set-option*
+setbufvar() eval.txt /*setbufvar()*
+setcmdpos() eval.txt /*setcmdpos()*
+setline() eval.txt /*setline()*
+setreg() eval.txt /*setreg()*
+setwinvar() eval.txt /*setwinvar()*
+sftp pi_netrw.txt /*sftp*
+sgml-syntax syntax.txt /*sgml-syntax*
+sgml.vim syntax.txt /*sgml.vim*
+sh-syntax syntax.txt /*sh-syntax*
+sh.vim syntax.txt /*sh.vim*
+shell-window tips.txt /*shell-window*
+shell_error-variable eval.txt /*shell_error-variable*
+shift intro.txt /*shift*
+shift-left-right change.txt /*shift-left-right*
+short-name-changed version4.txt /*short-name-changed*
+showing-menus gui.txt /*showing-menus*
+sign-commands sign.txt /*sign-commands*
+sign-intro sign.txt /*sign-intro*
+sign-support sign.txt /*sign-support*
+sign.txt sign.txt /*sign.txt*
+signs sign.txt /*signs*
+simple-change change.txt /*simple-change*
+simplify() eval.txt /*simplify()*
+single-repeat repeat.txt /*single-repeat*
+skeleton autocmd.txt /*skeleton*
+slow-fast-terminal term.txt /*slow-fast-terminal*
+slow-start starting.txt /*slow-start*
+slow-terminal term.txt /*slow-terminal*
+sniff if_sniff.txt /*sniff*
+sniff-commands if_sniff.txt /*sniff-commands*
+sniff-compiling if_sniff.txt /*sniff-compiling*
+sniff-intro if_sniff.txt /*sniff-intro*
+space intro.txt /*space*
+spec-customizing pi_spec.txt /*spec-customizing*
+spec-how-to-use-it pi_spec.txt /*spec-how-to-use-it*
+spec-plugin filetype.txt /*spec-plugin*
+spec-setting-a-map pi_spec.txt /*spec-setting-a-map*
+spec_chglog_format pi_spec.txt /*spec_chglog_format*
+spec_chglog_prepend pi_spec.txt /*spec_chglog_prepend*
+spec_chglog_release_info pi_spec.txt /*spec_chglog_release_info*
+special-buffers windows.txt /*special-buffers*
+speed-up tips.txt /*speed-up*
+splitfind windows.txt /*splitfind*
+splitview windows.txt /*splitview*
+sponsor sponsor.txt /*sponsor*
+sponsor-faq sponsor.txt /*sponsor-faq*
+sponsor.txt sponsor.txt /*sponsor.txt*
+spoon os_unix.txt /*spoon*
+spup-syntax syntax.txt /*spup-syntax*
+spup.vim syntax.txt /*spup.vim*
+sscanf eval.txt /*sscanf*
+standard-plugin usr_05.txt /*standard-plugin*
+standard-plugin-list help.txt /*standard-plugin-list*
+star pattern.txt /*star*
+start-of-file pattern.txt /*start-of-file*
+starting starting.txt /*starting*
+starting-amiga starting.txt /*starting-amiga*
+starting.txt starting.txt /*starting.txt*
+startup starting.txt /*startup*
+startup-options starting.txt /*startup-options*
+startup-terminal term.txt /*startup-terminal*
+static-tag tagsrch.txt /*static-tag*
+status-line windows.txt /*status-line*
+statusmsg-variable eval.txt /*statusmsg-variable*
+strftime() eval.txt /*strftime()*
+stridx() eval.txt /*stridx()*
+string-match eval.txt /*string-match*
+strlen() eval.txt /*strlen()*
+strpart() eval.txt /*strpart()*
+strridx() eval.txt /*strridx()*
+strtrans() eval.txt /*strtrans()*
+style-changes develop.txt /*style-changes*
+style-examples develop.txt /*style-examples*
+style-functions develop.txt /*style-functions*
+style-names develop.txt /*style-names*
+style-spaces develop.txt /*style-spaces*
+style-various develop.txt /*style-various*
+sub-menu-priority gui.txt /*sub-menu-priority*
+sub-replace-expression change.txt /*sub-replace-expression*
+sub-replace-special change.txt /*sub-replace-special*
+submatch() eval.txt /*submatch()*
+subscribe-maillist intro.txt /*subscribe-maillist*
+substitute() eval.txt /*substitute()*
+substitute-CR version6.txt /*substitute-CR*
+suffixes cmdline.txt /*suffixes*
+suspend starting.txt /*suspend*
+swap-file recover.txt /*swap-file*
+swapfile-changed version4.txt /*swapfile-changed*
+syn-sync-grouphere syntax.txt /*syn-sync-grouphere*
+syn-sync-groupthere syntax.txt /*syn-sync-groupthere*
+synID() eval.txt /*synID()*
+synIDattr() eval.txt /*synIDattr()*
+synIDtrans() eval.txt /*synIDtrans()*
+syncbind scroll.txt /*syncbind*
+syncolor syntax.txt /*syncolor*
+synload-1 syntax.txt /*synload-1*
+synload-2 syntax.txt /*synload-2*
+synload-3 syntax.txt /*synload-3*
+synload-4 syntax.txt /*synload-4*
+synload-5 syntax.txt /*synload-5*
+synload-6 syntax.txt /*synload-6*
+syntax syntax.txt /*syntax*
+syntax-highlighting syntax.txt /*syntax-highlighting*
+syntax-loading syntax.txt /*syntax-loading*
+syntax-printing usr_06.txt /*syntax-printing*
+syntax.txt syntax.txt /*syntax.txt*
+syntax_cmd syntax.txt /*syntax_cmd*
+sys-file-list help.txt /*sys-file-list*
+system() eval.txt /*system()*
+system-vimrc starting.txt /*system-vimrc*
+s~ change.txt /*s~*
+t motion.txt /*t*
+t_#2 term.txt /*t_#2*
+t_#4 term.txt /*t_#4*
+t_%1 term.txt /*t_%1*
+t_%i term.txt /*t_%i*
+t_&8 term.txt /*t_&8*
+t_@7 term.txt /*t_@7*
+t_AB term.txt /*t_AB*
+t_AF term.txt /*t_AF*
+t_AL term.txt /*t_AL*
+t_CS term.txt /*t_CS*
+t_CV term.txt /*t_CV*
+t_Co term.txt /*t_Co*
+t_DL term.txt /*t_DL*
+t_F1 term.txt /*t_F1*
+t_F2 term.txt /*t_F2*
+t_F3 term.txt /*t_F3*
+t_F4 term.txt /*t_F4*
+t_F5 term.txt /*t_F5*
+t_F6 term.txt /*t_F6*
+t_F7 term.txt /*t_F7*
+t_F8 term.txt /*t_F8*
+t_F9 term.txt /*t_F9*
+t_IE term.txt /*t_IE*
+t_IS term.txt /*t_IS*
+t_K1 term.txt /*t_K1*
+t_K3 term.txt /*t_K3*
+t_K4 term.txt /*t_K4*
+t_K5 term.txt /*t_K5*
+t_K6 term.txt /*t_K6*
+t_K7 term.txt /*t_K7*
+t_K8 term.txt /*t_K8*
+t_K9 term.txt /*t_K9*
+t_KA term.txt /*t_KA*
+t_KB term.txt /*t_KB*
+t_KC term.txt /*t_KC*
+t_KD term.txt /*t_KD*
+t_KE term.txt /*t_KE*
+t_KF term.txt /*t_KF*
+t_KG term.txt /*t_KG*
+t_KH term.txt /*t_KH*
+t_KI term.txt /*t_KI*
+t_KJ term.txt /*t_KJ*
+t_KK term.txt /*t_KK*
+t_KL term.txt /*t_KL*
+t_RI term.txt /*t_RI*
+t_RV term.txt /*t_RV*
+t_Sb term.txt /*t_Sb*
+t_Sf term.txt /*t_Sf*
+t_WP term.txt /*t_WP*
+t_WS term.txt /*t_WS*
+t_ZH term.txt /*t_ZH*
+t_ZR term.txt /*t_ZR*
+t_al term.txt /*t_al*
+t_bc term.txt /*t_bc*
+t_cd term.txt /*t_cd*
+t_cdl version4.txt /*t_cdl*
+t_ce term.txt /*t_ce*
+t_ci version4.txt /*t_ci*
+t_cil version4.txt /*t_cil*
+t_cl term.txt /*t_cl*
+t_cm term.txt /*t_cm*
+t_cri version4.txt /*t_cri*
+t_cs term.txt /*t_cs*
+t_csc version4.txt /*t_csc*
+t_cv version4.txt /*t_cv*
+t_cvv version4.txt /*t_cvv*
+t_da term.txt /*t_da*
+t_db term.txt /*t_db*
+t_dl term.txt /*t_dl*
+t_ed version4.txt /*t_ed*
+t_el version4.txt /*t_el*
+t_f1 version4.txt /*t_f1*
+t_f10 version4.txt /*t_f10*
+t_f2 version4.txt /*t_f2*
+t_f3 version4.txt /*t_f3*
+t_f4 version4.txt /*t_f4*
+t_f5 version4.txt /*t_f5*
+t_f6 version4.txt /*t_f6*
+t_f7 version4.txt /*t_f7*
+t_f8 version4.txt /*t_f8*
+t_f9 version4.txt /*t_f9*
+t_fs term.txt /*t_fs*
+t_help version4.txt /*t_help*
+t_il version4.txt /*t_il*
+t_k1 term.txt /*t_k1*
+t_k2 term.txt /*t_k2*
+t_k3 term.txt /*t_k3*
+t_k4 term.txt /*t_k4*
+t_k5 term.txt /*t_k5*
+t_k6 term.txt /*t_k6*
+t_k7 term.txt /*t_k7*
+t_k8 term.txt /*t_k8*
+t_k9 term.txt /*t_k9*
+t_k; term.txt /*t_k;*
+t_kB term.txt /*t_kB*
+t_kD term.txt /*t_kD*
+t_kI term.txt /*t_kI*
+t_kN term.txt /*t_kN*
+t_kP term.txt /*t_kP*
+t_kb term.txt /*t_kb*
+t_kd term.txt /*t_kd*
+t_ke term.txt /*t_ke*
+t_kh term.txt /*t_kh*
+t_kl term.txt /*t_kl*
+t_kr term.txt /*t_kr*
+t_ks term.txt /*t_ks*
+t_ku term.txt /*t_ku*
+t_le term.txt /*t_le*
+t_mb term.txt /*t_mb*
+t_md term.txt /*t_md*
+t_me term.txt /*t_me*
+t_mr term.txt /*t_mr*
+t_ms term.txt /*t_ms*
+t_nd term.txt /*t_nd*
+t_op term.txt /*t_op*
+t_se term.txt /*t_se*
+t_sf1 version4.txt /*t_sf1*
+t_sf10 version4.txt /*t_sf10*
+t_sf2 version4.txt /*t_sf2*
+t_sf3 version4.txt /*t_sf3*
+t_sf4 version4.txt /*t_sf4*
+t_sf5 version4.txt /*t_sf5*
+t_sf6 version4.txt /*t_sf6*
+t_sf7 version4.txt /*t_sf7*
+t_sf8 version4.txt /*t_sf8*
+t_sf9 version4.txt /*t_sf9*
+t_skd version4.txt /*t_skd*
+t_skl version4.txt /*t_skl*
+t_skr version4.txt /*t_skr*
+t_sku version4.txt /*t_sku*
+t_so term.txt /*t_so*
+t_sr term.txt /*t_sr*
+t_star7 term.txt /*t_star7*
+t_tb version4.txt /*t_tb*
+t_te term.txt /*t_te*
+t_ti term.txt /*t_ti*
+t_tp version4.txt /*t_tp*
+t_ts term.txt /*t_ts*
+t_ts_old version4.txt /*t_ts_old*
+t_ue term.txt /*t_ue*
+t_undo version4.txt /*t_undo*
+t_us term.txt /*t_us*
+t_ut term.txt /*t_ut*
+t_vb term.txt /*t_vb*
+t_ve term.txt /*t_ve*
+t_vi term.txt /*t_vi*
+t_vs term.txt /*t_vs*
+t_xs term.txt /*t_xs*
+tab intro.txt /*tab*
+tag tagsrch.txt /*tag*
+tag-! tagsrch.txt /*tag-!*
+tag-any-white tagsrch.txt /*tag-any-white*
+tag-binary-search tagsrch.txt /*tag-binary-search*
+tag-commands tagsrch.txt /*tag-commands*
+tag-details tagsrch.txt /*tag-details*
+tag-highlight syntax.txt /*tag-highlight*
+tag-matchlist tagsrch.txt /*tag-matchlist*
+tag-old-static tagsrch.txt /*tag-old-static*
+tag-overloaded version5.txt /*tag-overloaded*
+tag-priority tagsrch.txt /*tag-priority*
+tag-regexp tagsrch.txt /*tag-regexp*
+tag-search tagsrch.txt /*tag-search*
+tag-security tagsrch.txt /*tag-security*
+tag-skip-file tagsrch.txt /*tag-skip-file*
+tag-stack tagsrch.txt /*tag-stack*
+tags tagsrch.txt /*tags*
+tags-and-searches tagsrch.txt /*tags-and-searches*
+tags-file-changed version5.txt /*tags-file-changed*
+tags-file-format tagsrch.txt /*tags-file-format*
+tags-option tagsrch.txt /*tags-option*
+tagsrch.txt tagsrch.txt /*tagsrch.txt*
+tagstack tagsrch.txt /*tagstack*
+tcl if_tcl.txt /*tcl*
+tcl-beep if_tcl.txt /*tcl-beep*
+tcl-buffer if_tcl.txt /*tcl-buffer*
+tcl-buffer-append if_tcl.txt /*tcl-buffer-append*
+tcl-buffer-cmds if_tcl.txt /*tcl-buffer-cmds*
+tcl-buffer-command if_tcl.txt /*tcl-buffer-command*
+tcl-buffer-count if_tcl.txt /*tcl-buffer-count*
+tcl-buffer-delcmd if_tcl.txt /*tcl-buffer-delcmd*
+tcl-buffer-delete if_tcl.txt /*tcl-buffer-delete*
+tcl-buffer-expr if_tcl.txt /*tcl-buffer-expr*
+tcl-buffer-get if_tcl.txt /*tcl-buffer-get*
+tcl-buffer-insert if_tcl.txt /*tcl-buffer-insert*
+tcl-buffer-last if_tcl.txt /*tcl-buffer-last*
+tcl-buffer-mark if_tcl.txt /*tcl-buffer-mark*
+tcl-buffer-option if_tcl.txt /*tcl-buffer-option*
+tcl-buffer-set if_tcl.txt /*tcl-buffer-set*
+tcl-buffer-windows if_tcl.txt /*tcl-buffer-windows*
+tcl-bugs if_tcl.txt /*tcl-bugs*
+tcl-command if_tcl.txt /*tcl-command*
+tcl-commands if_tcl.txt /*tcl-commands*
+tcl-ex-commands if_tcl.txt /*tcl-ex-commands*
+tcl-examples if_tcl.txt /*tcl-examples*
+tcl-expr if_tcl.txt /*tcl-expr*
+tcl-linenumbers if_tcl.txt /*tcl-linenumbers*
+tcl-misc if_tcl.txt /*tcl-misc*
+tcl-option if_tcl.txt /*tcl-option*
+tcl-output if_tcl.txt /*tcl-output*
+tcl-var-current if_tcl.txt /*tcl-var-current*
+tcl-var-lbase if_tcl.txt /*tcl-var-lbase*
+tcl-var-line if_tcl.txt /*tcl-var-line*
+tcl-var-lnum if_tcl.txt /*tcl-var-lnum*
+tcl-var-range if_tcl.txt /*tcl-var-range*
+tcl-variables if_tcl.txt /*tcl-variables*
+tcl-window if_tcl.txt /*tcl-window*
+tcl-window-buffer if_tcl.txt /*tcl-window-buffer*
+tcl-window-cmds if_tcl.txt /*tcl-window-cmds*
+tcl-window-command if_tcl.txt /*tcl-window-command*
+tcl-window-cursor if_tcl.txt /*tcl-window-cursor*
+tcl-window-delcmd if_tcl.txt /*tcl-window-delcmd*
+tcl-window-expr if_tcl.txt /*tcl-window-expr*
+tcl-window-height if_tcl.txt /*tcl-window-height*
+tcl-window-option if_tcl.txt /*tcl-window-option*
+tcsh-style cmdline.txt /*tcsh-style*
+tcsh-syntax syntax.txt /*tcsh-syntax*
+tcsh.vim syntax.txt /*tcsh.vim*
+tear-off-menus gui.txt /*tear-off-menus*
+telnet-CTRL-] tagsrch.txt /*telnet-CTRL-]*
+temp-file-name eval.txt /*temp-file-name*
+template autocmd.txt /*template*
+tempname() eval.txt /*tempname()*
+term-dependent-settings term.txt /*term-dependent-settings*
+term-list syntax.txt /*term-list*
+term.txt term.txt /*term.txt*
+termcap term.txt /*termcap*
+termcap-changed version4.txt /*termcap-changed*
+termcap-colors term.txt /*termcap-colors*
+termcap-syntax syntax.txt /*termcap-syntax*
+termcap-title term.txt /*termcap-title*
+terminal-colors os_unix.txt /*terminal-colors*
+terminal-info term.txt /*terminal-info*
+terminal-options term.txt /*terminal-options*
+terminfo term.txt /*terminfo*
+termresponse-variable eval.txt /*termresponse-variable*
+tex-syntax syntax.txt /*tex-syntax*
+tex.vim syntax.txt /*tex.vim*
+text-objects motion.txt /*text-objects*
+text-objects-changed version5.txt /*text-objects-changed*
+tf-syntax syntax.txt /*tf-syntax*
+tf.vim syntax.txt /*tf.vim*
+this_session-variable eval.txt /*this_session-variable*
+throw-catch eval.txt /*throw-catch*
+throw-expression eval.txt /*throw-expression*
+throw-from-catch eval.txt /*throw-from-catch*
+throw-variables eval.txt /*throw-variables*
+throwpoint-variable eval.txt /*throwpoint-variable*
+timestamp editing.txt /*timestamp*
+timestamps editing.txt /*timestamps*
+tips tips.txt /*tips*
+tips.txt tips.txt /*tips.txt*
+todo todo.txt /*todo*
+todo.txt todo.txt /*todo.txt*
+toggle options.txt /*toggle*
+toggle-revins version4.txt /*toggle-revins*
+tolower() eval.txt /*tolower()*
+toolbar-icon gui.txt /*toolbar-icon*
+toupper() eval.txt /*toupper()*
+trojan-horse starting.txt /*trojan-horse*
+try-conditionals eval.txt /*try-conditionals*
+try-echoerr eval.txt /*try-echoerr*
+try-finally eval.txt /*try-finally*
+try-nested eval.txt /*try-nested*
+try-nesting eval.txt /*try-nesting*
+tutor usr_01.txt /*tutor*
+twice if_cscop.txt /*twice*
+type() eval.txt /*type()*
+type-mistakes tips.txt /*type-mistakes*
+typecorr-settings usr_41.txt /*typecorr-settings*
+typecorr.txt usr_41.txt /*typecorr.txt*
+u undo.txt /*u*
+uganda uganda.txt /*uganda*
+uganda.txt uganda.txt /*uganda.txt*
+undo undo.txt /*undo*
+undo-commands undo.txt /*undo-commands*
+undo-redo undo.txt /*undo-redo*
+undo-remarks undo.txt /*undo-remarks*
+undo-two-ways undo.txt /*undo-two-ways*
+undo.txt undo.txt /*undo.txt*
+undo_ftplugin usr_41.txt /*undo_ftplugin*
+unicode mbyte.txt /*unicode*
+unix os_unix.txt /*unix*
+unlisted-buffer windows.txt /*unlisted-buffer*
+up-down-motions motion.txt /*up-down-motions*
+uppercase change.txt /*uppercase*
+use-cpo-save usr_41.txt /*use-cpo-save*
+use-visual-cmds version4.txt /*use-visual-cmds*
+useful-mappings tips.txt /*useful-mappings*
+usenet intro.txt /*usenet*
+user-cmd-ambiguous map.txt /*user-cmd-ambiguous*
+user-commands map.txt /*user-commands*
+user-functions eval.txt /*user-functions*
+user-manual usr_toc.txt /*user-manual*
+using-<Plug> usr_41.txt /*using-<Plug>*
+using-menus gui.txt /*using-menus*
+using-scripts repeat.txt /*using-scripts*
+using-xxd tips.txt /*using-xxd*
+using_CTRL-V map.txt /*using_CTRL-V*
+usr_01.txt usr_01.txt /*usr_01.txt*
+usr_02.txt usr_02.txt /*usr_02.txt*
+usr_03.txt usr_03.txt /*usr_03.txt*
+usr_04.txt usr_04.txt /*usr_04.txt*
+usr_05.txt usr_05.txt /*usr_05.txt*
+usr_06.txt usr_06.txt /*usr_06.txt*
+usr_07.txt usr_07.txt /*usr_07.txt*
+usr_08.txt usr_08.txt /*usr_08.txt*
+usr_09.txt usr_09.txt /*usr_09.txt*
+usr_10.txt usr_10.txt /*usr_10.txt*
+usr_11.txt usr_11.txt /*usr_11.txt*
+usr_12.txt usr_12.txt /*usr_12.txt*
+usr_20.txt usr_20.txt /*usr_20.txt*
+usr_21.txt usr_21.txt /*usr_21.txt*
+usr_22.txt usr_22.txt /*usr_22.txt*
+usr_23.txt usr_23.txt /*usr_23.txt*
+usr_24.txt usr_24.txt /*usr_24.txt*
+usr_25.txt usr_25.txt /*usr_25.txt*
+usr_26.txt usr_26.txt /*usr_26.txt*
+usr_27.txt usr_27.txt /*usr_27.txt*
+usr_28.txt usr_28.txt /*usr_28.txt*
+usr_29.txt usr_29.txt /*usr_29.txt*
+usr_30.txt usr_30.txt /*usr_30.txt*
+usr_31.txt usr_31.txt /*usr_31.txt*
+usr_40.txt usr_40.txt /*usr_40.txt*
+usr_41.txt usr_41.txt /*usr_41.txt*
+usr_42.txt usr_42.txt /*usr_42.txt*
+usr_43.txt usr_43.txt /*usr_43.txt*
+usr_44.txt usr_44.txt /*usr_44.txt*
+usr_45.txt usr_45.txt /*usr_45.txt*
+usr_90.txt usr_90.txt /*usr_90.txt*
+usr_toc.txt usr_toc.txt /*usr_toc.txt*
+utf-8 mbyte.txt /*utf-8*
+utf-8-char-arg mbyte.txt /*utf-8-char-arg*
+utf-8-in-xwindows mbyte.txt /*utf-8-in-xwindows*
+utf-8-typing mbyte.txt /*utf-8-typing*
+utf8 mbyte.txt /*utf8*
+v visual.txt /*v*
+v:charconvert_from eval.txt /*v:charconvert_from*
+v:charconvert_to eval.txt /*v:charconvert_to*
+v:cmdarg eval.txt /*v:cmdarg*
+v:cmdbang eval.txt /*v:cmdbang*
+v:count eval.txt /*v:count*
+v:count1 eval.txt /*v:count1*
+v:ctype eval.txt /*v:ctype*
+v:dying eval.txt /*v:dying*
+v:errmsg eval.txt /*v:errmsg*
+v:exception eval.txt /*v:exception*
+v:fname_diff eval.txt /*v:fname_diff*
+v:fname_in eval.txt /*v:fname_in*
+v:fname_new eval.txt /*v:fname_new*
+v:fname_out eval.txt /*v:fname_out*
+v:folddashes eval.txt /*v:folddashes*
+v:foldend eval.txt /*v:foldend*
+v:foldlevel eval.txt /*v:foldlevel*
+v:foldstart eval.txt /*v:foldstart*
+v:lang eval.txt /*v:lang*
+v:lc_time eval.txt /*v:lc_time*
+v:lnum eval.txt /*v:lnum*
+v:prevcount eval.txt /*v:prevcount*
+v:progname eval.txt /*v:progname*
+v:register eval.txt /*v:register*
+v:servername eval.txt /*v:servername*
+v:shell_error eval.txt /*v:shell_error*
+v:statusmsg eval.txt /*v:statusmsg*
+v:termresponse eval.txt /*v:termresponse*
+v:this_session eval.txt /*v:this_session*
+v:throwpoint eval.txt /*v:throwpoint*
+v:var eval.txt /*v:var*
+v:version eval.txt /*v:version*
+v:warningmsg eval.txt /*v:warningmsg*
+v_! change.txt /*v_!*
+v_$ visual.txt /*v_$*
+v_: cmdline.txt /*v_:*
+v_< change.txt /*v_<*
+v_<BS> change.txt /*v_<BS>*
+v_<Del> change.txt /*v_<Del>*
+v_= change.txt /*v_=*
+v_> change.txt /*v_>*
+v_C change.txt /*v_C*
+v_CTRL-C visual.txt /*v_CTRL-C*
+v_CTRL-G visual.txt /*v_CTRL-G*
+v_CTRL-H change.txt /*v_CTRL-H*
+v_CTRL-O visual.txt /*v_CTRL-O*
+v_CTRL-V visual.txt /*v_CTRL-V*
+v_CTRL-Z starting.txt /*v_CTRL-Z*
+v_CTRL-\_CTRL-G intro.txt /*v_CTRL-\\_CTRL-G*
+v_CTRL-\_CTRL-N intro.txt /*v_CTRL-\\_CTRL-N*
+v_CTRL-] tagsrch.txt /*v_CTRL-]*
+v_D change.txt /*v_D*
+v_J change.txt /*v_J*
+v_K various.txt /*v_K*
+v_O visual.txt /*v_O*
+v_P change.txt /*v_P*
+v_R change.txt /*v_R*
+v_S change.txt /*v_S*
+v_U change.txt /*v_U*
+v_V visual.txt /*v_V*
+v_X change.txt /*v_X*
+v_Y change.txt /*v_Y*
+v_a motion.txt /*v_a*
+v_a( motion.txt /*v_a(*
+v_a) motion.txt /*v_a)*
+v_a< motion.txt /*v_a<*
+v_a> motion.txt /*v_a>*
+v_aB motion.txt /*v_aB*
+v_aW motion.txt /*v_aW*
+v_a[ motion.txt /*v_a[*
+v_a] motion.txt /*v_a]*
+v_ab motion.txt /*v_ab*
+v_ap motion.txt /*v_ap*
+v_as motion.txt /*v_as*
+v_aw motion.txt /*v_aw*
+v_a{ motion.txt /*v_a{*
+v_a} motion.txt /*v_a}*
+v_b_< visual.txt /*v_b_<*
+v_b_<_example visual.txt /*v_b_<_example*
+v_b_> visual.txt /*v_b_>*
+v_b_>_example visual.txt /*v_b_>_example*
+v_b_A visual.txt /*v_b_A*
+v_b_A_example visual.txt /*v_b_A_example*
+v_b_C visual.txt /*v_b_C*
+v_b_D change.txt /*v_b_D*
+v_b_I visual.txt /*v_b_I*
+v_b_I_example visual.txt /*v_b_I_example*
+v_b_c visual.txt /*v_b_c*
+v_b_r visual.txt /*v_b_r*
+v_b_r_example visual.txt /*v_b_r_example*
+v_c change.txt /*v_c*
+v_d change.txt /*v_d*
+v_g? change.txt /*v_g?*
+v_gJ change.txt /*v_gJ*
+v_gV visual.txt /*v_gV*
+v_g] tagsrch.txt /*v_g]*
+v_g_CTRL-G editing.txt /*v_g_CTRL-G*
+v_g_CTRL-] tagsrch.txt /*v_g_CTRL-]*
+v_gf editing.txt /*v_gf*
+v_gq change.txt /*v_gq*
+v_gv visual.txt /*v_gv*
+v_i motion.txt /*v_i*
+v_i( motion.txt /*v_i(*
+v_i) motion.txt /*v_i)*
+v_i< motion.txt /*v_i<*
+v_i> motion.txt /*v_i>*
+v_iB motion.txt /*v_iB*
+v_iW motion.txt /*v_iW*
+v_i[ motion.txt /*v_i[*
+v_i] motion.txt /*v_i]*
+v_ib motion.txt /*v_ib*
+v_ip motion.txt /*v_ip*
+v_is motion.txt /*v_is*
+v_iw motion.txt /*v_iw*
+v_i{ motion.txt /*v_i{*
+v_i} motion.txt /*v_i}*
+v_o visual.txt /*v_o*
+v_p change.txt /*v_p*
+v_r change.txt /*v_r*
+v_s change.txt /*v_s*
+v_u change.txt /*v_u*
+v_v visual.txt /*v_v*
+v_x change.txt /*v_x*
+v_y change.txt /*v_y*
+v_~ change.txt /*v_~*
+variables eval.txt /*variables*
+various various.txt /*various*
+various-cmds various.txt /*various-cmds*
+various-motions motion.txt /*various-motions*
+various.txt various.txt /*various.txt*
+vb-syntax syntax.txt /*vb-syntax*
+vb.vim syntax.txt /*vb.vim*
+verbose starting.txt /*verbose*
+verilog-indent indent.txt /*verilog-indent*
+version-5.1 version5.txt /*version-5.1*
+version-5.2 version5.txt /*version-5.2*
+version-5.3 version5.txt /*version-5.3*
+version-5.4 version5.txt /*version-5.4*
+version-5.5 version5.txt /*version-5.5*
+version-5.6 version5.txt /*version-5.6*
+version-5.7 version5.txt /*version-5.7*
+version-5.8 version5.txt /*version-5.8*
+version-6.1 version6.txt /*version-6.1*
+version-6.2 version6.txt /*version-6.2*
+version-6.3 version6.txt /*version-6.3*
+version-variable eval.txt /*version-variable*
+version4.txt version4.txt /*version4.txt*
+version5.txt version5.txt /*version5.txt*
+version6.txt version6.txt /*version6.txt*
+vi-differences vi_diff.txt /*vi-differences*
+vi: options.txt /*vi:*
+vi_diff.txt vi_diff.txt /*vi_diff.txt*
+view starting.txt /*view*
+view-diffs diff.txt /*view-diffs*
+view-file starting.txt /*view-file*
+views-sessions starting.txt /*views-sessions*
+vim-additions vi_diff.txt /*vim-additions*
+vim-announce intro.txt /*vim-announce*
+vim-arguments starting.txt /*vim-arguments*
+vim-default-editor gui_w32.txt /*vim-default-editor*
+vim-dev intro.txt /*vim-dev*
+vim-mac intro.txt /*vim-mac*
+vim-modes intro.txt /*vim-modes*
+vim-modes-intro intro.txt /*vim-modes-intro*
+vim-multibyte intro.txt /*vim-multibyte*
+vim-script-intro usr_41.txt /*vim-script-intro*
+vim-syntax syntax.txt /*vim-syntax*
+vim-variable eval.txt /*vim-variable*
+vim.vim syntax.txt /*vim.vim*
+vim: options.txt /*vim:*
+vimdev intro.txt /*vimdev*
+vimdiff diff.txt /*vimdiff*
+vimfiles options.txt /*vimfiles*
+viminfo starting.txt /*viminfo*
+viminfo-encoding starting.txt /*viminfo-encoding*
+viminfo-errors starting.txt /*viminfo-errors*
+viminfo-file starting.txt /*viminfo-file*
+viminfo-file-marks starting.txt /*viminfo-file-marks*
+viminfo-file-name starting.txt /*viminfo-file-name*
+viminfo-read starting.txt /*viminfo-read*
+viminfo-write starting.txt /*viminfo-write*
+vimrc starting.txt /*vimrc*
+vimrc-filetype usr_05.txt /*vimrc-filetype*
+vimrc-intro usr_05.txt /*vimrc-intro*
+vimrc_example.vim usr_05.txt /*vimrc_example.vim*
+vimtutor usr_01.txt /*vimtutor*
+virtcol() eval.txt /*virtcol()*
+visual-block visual.txt /*visual-block*
+visual-change visual.txt /*visual-change*
+visual-examples visual.txt /*visual-examples*
+visual-index index.txt /*visual-index*
+visual-mode visual.txt /*visual-mode*
+visual-operators visual.txt /*visual-operators*
+visual-repeat visual.txt /*visual-repeat*
+visual-search visual.txt /*visual-search*
+visual-start visual.txt /*visual-start*
+visual-use visual.txt /*visual-use*
+visual.txt visual.txt /*visual.txt*
+visualmode() eval.txt /*visualmode()*
+vms os_vms.txt /*vms*
+vms-authors os_vms.txt /*vms-authors*
+vms-changes os_vms.txt /*vms-changes*
+vms-compiling os_vms.txt /*vms-compiling*
+vms-deploy os_vms.txt /*vms-deploy*
+vms-download os_vms.txt /*vms-download*
+vms-gui os_vms.txt /*vms-gui*
+vms-notes os_vms.txt /*vms-notes*
+vms-problems os_vms.txt /*vms-problems*
+vms-started os_vms.txt /*vms-started*
+vms-usage os_vms.txt /*vms-usage*
+vote-for-features sponsor.txt /*vote-for-features*
+votes-counted sponsor.txt /*votes-counted*
+votes-for-changes todo.txt /*votes-for-changes*
+vreplace-mode insert.txt /*vreplace-mode*
+vt100-cursor-keys term.txt /*vt100-cursor-keys*
+vt100-function-keys term.txt /*vt100-function-keys*
+w motion.txt /*w*
+w32-clientserver remote.txt /*w32-clientserver*
+w:var eval.txt /*w:var*
+warningmsg-variable eval.txt /*warningmsg-variable*
+white-space pattern.txt /*white-space*
+whitespace pattern.txt /*whitespace*
+win16-!start gui_w16.txt /*win16-!start*
+win16-clipboard gui_w16.txt /*win16-clipboard*
+win16-colors gui_w16.txt /*win16-colors*
+win16-default-editor gui_w16.txt /*win16-default-editor*
+win16-dialogs gui_w16.txt /*win16-dialogs*
+win16-drag-n-drop gui_w16.txt /*win16-drag-n-drop*
+win16-gui gui_w16.txt /*win16-gui*
+win16-maximized gui_w16.txt /*win16-maximized*
+win16-printing gui_w16.txt /*win16-printing*
+win16-shell gui_w16.txt /*win16-shell*
+win16-start gui_w16.txt /*win16-start*
+win16-truetype gui_w16.txt /*win16-truetype*
+win16-various gui_w16.txt /*win16-various*
+win32 os_win32.txt /*win32*
+win32-!start gui_w32.txt /*win32-!start*
+win32-colors gui_w32.txt /*win32-colors*
+win32-compiling os_win32.txt /*win32-compiling*
+win32-curdir os_win32.txt /*win32-curdir*
+win32-faq os_win32.txt /*win32-faq*
+win32-gettext mlang.txt /*win32-gettext*
+win32-gui gui_w32.txt /*win32-gui*
+win32-hidden-menus gui.txt /*win32-hidden-menus*
+win32-mouse os_win32.txt /*win32-mouse*
+win32-open-with-menu gui_w32.txt /*win32-open-with-menu*
+win32-popup-menu gui_w32.txt /*win32-popup-menu*
+win32-problems os_win32.txt /*win32-problems*
+win32-restore os_win32.txt /*win32-restore*
+win32-startup os_win32.txt /*win32-startup*
+win32-term os_win32.txt /*win32-term*
+win32-vimrun gui_w32.txt /*win32-vimrun*
+win32-win3.1 os_win32.txt /*win32-win3.1*
+win32s os_win32.txt /*win32s*
+winbufnr() eval.txt /*winbufnr()*
+wincol() eval.txt /*wincol()*
+window-contents intro.txt /*window-contents*
+window-exit editing.txt /*window-exit*
+window-move-cursor windows.txt /*window-move-cursor*
+window-moving windows.txt /*window-moving*
+window-resize windows.txt /*window-resize*
+window-size term.txt /*window-size*
+window-tag windows.txt /*window-tag*
+window-variable eval.txt /*window-variable*
+windows windows.txt /*windows*
+windows-3.1 os_win32.txt /*windows-3.1*
+windows-intro windows.txt /*windows-intro*
+windows-starting windows.txt /*windows-starting*
+windows.txt windows.txt /*windows.txt*
+windows95 os_win32.txt /*windows95*
+winheight() eval.txt /*winheight()*
+winline() eval.txt /*winline()*
+winnr() eval.txt /*winnr()*
+winrestcmd() eval.txt /*winrestcmd()*
+winwidth() eval.txt /*winwidth()*
+word motion.txt /*word*
+word-count editing.txt /*word-count*
+word-motions motion.txt /*word-motions*
+workbench starting.txt /*workbench*
+workshop workshop.txt /*workshop*
+workshop-commands workshop.txt /*workshop-commands*
+workshop-compiling workshop.txt /*workshop-compiling*
+workshop-configure workshop.txt /*workshop-configure*
+workshop-intro workshop.txt /*workshop-intro*
+workshop-support workshop.txt /*workshop-support*
+workshop-xpm workshop.txt /*workshop-xpm*
+workshop.txt workshop.txt /*workshop.txt*
+wrap-off intro.txt /*wrap-off*
+write-compiler-plugin usr_41.txt /*write-compiler-plugin*
+write-device editing.txt /*write-device*
+write-fail editing.txt /*write-fail*
+write-filetype-plugin usr_41.txt /*write-filetype-plugin*
+write-local-help usr_41.txt /*write-local-help*
+write-plugin usr_41.txt /*write-plugin*
+write-quit editing.txt /*write-quit*
+write-readonly editing.txt /*write-readonly*
+writing editing.txt /*writing*
+www intro.txt /*www*
+x change.txt /*x*
+x-input-method mbyte.txt /*x-input-method*
+x-resources version5.txt /*x-resources*
+x11-clientserver remote.txt /*x11-clientserver*
+x11-cut-buffer gui_x11.txt /*x11-cut-buffer*
+x11-selection gui_x11.txt /*x11-selection*
+xf86conf-syntax syntax.txt /*xf86conf-syntax*
+xf86conf.vim syntax.txt /*xf86conf.vim*
+xfontset mbyte.txt /*xfontset*
+xfree-xterm syntax.txt /*xfree-xterm*
+xim mbyte.txt /*xim*
+xim-input-style mbyte.txt /*xim-input-style*
+xiterm syntax.txt /*xiterm*
+xml-folding syntax.txt /*xml-folding*
+xml-syntax syntax.txt /*xml-syntax*
+xml.vim syntax.txt /*xml.vim*
+xpm-syntax syntax.txt /*xpm-syntax*
+xpm.vim syntax.txt /*xpm.vim*
+xterm-8-bit term.txt /*xterm-8-bit*
+xterm-8bit term.txt /*xterm-8bit*
+xterm-blink syntax.txt /*xterm-blink*
+xterm-blinking-cursor syntax.txt /*xterm-blinking-cursor*
+xterm-clipboard term.txt /*xterm-clipboard*
+xterm-codes term.txt /*xterm-codes*
+xterm-color syntax.txt /*xterm-color*
+xterm-command-server term.txt /*xterm-command-server*
+xterm-copy-paste term.txt /*xterm-copy-paste*
+xterm-cursor-keys term.txt /*xterm-cursor-keys*
+xterm-end-home-keys term.txt /*xterm-end-home-keys*
+xterm-function-keys term.txt /*xterm-function-keys*
+xterm-mouse options.txt /*xterm-mouse*
+xterm-mouse-wheel scroll.txt /*xterm-mouse-wheel*
+xterm-save-screen tips.txt /*xterm-save-screen*
+xterm-screens tips.txt /*xterm-screens*
+xterm-scroll-region term.txt /*xterm-scroll-region*
+xterm-shifted-keys term.txt /*xterm-shifted-keys*
+y change.txt /*y*
+yank change.txt /*yank*
+ye-option-gone version4.txt /*ye-option-gone*
+year-2000 intro.txt /*year-2000*
+your-runtime-dir usr_43.txt /*your-runtime-dir*
+yy change.txt /*yy*
+z index.txt /*z*
+z+ scroll.txt /*z+*
+z- scroll.txt /*z-*
+z. scroll.txt /*z.*
+z/OS os_390.txt /*z\/OS*
+z<CR> scroll.txt /*z<CR>*
+z<Left> scroll.txt /*z<Left>*
+z<Right> scroll.txt /*z<Right>*
+zA fold.txt /*zA*
+zC fold.txt /*zC*
+zD fold.txt /*zD*
+zE fold.txt /*zE*
+zF fold.txt /*zF*
+zH scroll.txt /*zH*
+zL scroll.txt /*zL*
+zM fold.txt /*zM*
+zN fold.txt /*zN*
+zN<CR> scroll.txt /*zN<CR>*
+zO fold.txt /*zO*
+zOS os_390.txt /*zOS*
+zOS-Bugs os_390.txt /*zOS-Bugs*
+zOS-Motif os_390.txt /*zOS-Motif*
+zOS-building os_390.txt /*zOS-building*
+zOS-changes os_390.txt /*zOS-changes*
+zOS-feedback os_390.txt /*zOS-feedback*
+zOS-has-ebcdic os_390.txt /*zOS-has-ebcdic*
+zOS-open-source os_390.txt /*zOS-open-source*
+zOS-weaknesses os_390.txt /*zOS-weaknesses*
+zOS-xterm os_390.txt /*zOS-xterm*
+zR fold.txt /*zR*
+zX fold.txt /*zX*
+z^ scroll.txt /*z^*
+za fold.txt /*za*
+zb scroll.txt /*zb*
+zc fold.txt /*zc*
+zd fold.txt /*zd*
+ze scroll.txt /*ze*
+zf fold.txt /*zf*
+zh scroll.txt /*zh*
+zi fold.txt /*zi*
+zj fold.txt /*zj*
+zk fold.txt /*zk*
+zl scroll.txt /*zl*
+zm fold.txt /*zm*
+zn fold.txt /*zn*
+zo fold.txt /*zo*
+zr fold.txt /*zr*
+zs scroll.txt /*zs*
+zt scroll.txt /*zt*
+zv fold.txt /*zv*
+zx fold.txt /*zx*
+zz scroll.txt /*zz*
+{ motion.txt /*{*
+{Visual} intro.txt /*{Visual}*
+{address} cmdline.txt /*{address}*
+{char1-char2} intro.txt /*{char1-char2}*
+{event} autocmd.txt /*{event}*
+{file} editing.txt /*{file}*
+{group-name} syntax.txt /*{group-name}*
+{lhs} map.txt /*{lhs}*
+{motion} intro.txt /*{motion}*
+{move-around} visual.txt /*{move-around}*
+{offset} pattern.txt /*{offset}*
+{pat} autocmd.txt /*{pat}*
+{rhs} map.txt /*{rhs}*
+{subject} various.txt /*{subject}*
+{} intro.txt /*{}*
+} motion.txt /*}*
+~ change.txt /*~*
diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt
new file mode 100644
index 000000000..7787e0e2a
--- /dev/null
+++ b/runtime/doc/tagsrch.txt
@@ -0,0 +1,809 @@
+*tagsrch.txt* For Vim version 7.0aa. Last change: 2004 Apr 29
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Tags and special searches *tags-and-searches*
+
+See section |29.1| of the user manual for an introduction.
+
+1. Jump to a tag |tag-commands|
+2. Tag stack |tag-stack|
+3. Tag match list |tag-matchlist|
+4. Tags details |tag-details|
+5. Tags file format |tags-file-format|
+6. Include file searches |include-search|
+
+==============================================================================
+1. Jump to a tag *tag-commands*
+
+ *tag* *tags*
+A tag is an identifier that appears in a "tags" file. It is a sort of label
+that can be jumped to. For example: In C programs each function name can be
+used as a tag. The "tags" file has to be generated by a program like ctags,
+before the tag commands can be used.
+
+With the ":tag" command the cursor will be positioned on the tag. With the
+CTRL-] command, the keyword on which the cursor is standing is used as the
+tag. If the cursor is not on a keyword, the first keyword to the right of the
+cursor is used.
+
+The ":tag" command works very well for C programs. If you see a call to a
+function and wonder what that function does, position the cursor inside of the
+function name and hit CTRL-]. This will bring you to the function definition.
+An easy way back is with the CTRL-T command. Also read about the tag stack
+below.
+
+ *:ta* *:tag* *E426* *E429*
+:ta[g][!] {ident} Jump to the definition of {ident}, using the
+ information in the tags file(s). Put {ident} in the
+ tag stack. See |tag-!| for [!].
+ {ident} can be a regexp pattern, see |tag-regexp|.
+ When there are several matching tags for {ident}, the
+ first one is jumped to. |:tnext|.
+
+g<LeftMouse> *g<LeftMouse>*
+<C-LeftMouse> *<C-LeftMouse>* *CTRL-]*
+CTRL-] Jump to the definition of the keyword under the
+ cursor. Same as ":tag {ident}", where {ident} is the
+ keyword under or after cursor. {Vi: identifier after
+ the cursor}
+
+ *v_CTRL-]*
+{Visual}CTRL-] Same as ":tag {ident}", where {ident} is the text that
+ is highlighted. {not in Vi}
+
+ *telnet-CTRL-]*
+CTRL-] is the default telnet escape key. When you type CTRL-] to jump to a
+tag, you will get the telnet prompt instead. Most versions of telnet allow
+changing or disabling the default escape key. See the telnet man page. You
+can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e
+{EscapeCharacter} {Hostname}' to specify another escape character. If
+possible, try to use "rsh" instead of "telnet" to avoid this problem.
+
+ *tag-priority*
+When there are multiple matches for a tag, this priority is used:
+1. "FSC" A full matching static tag for the current file.
+2. "F C" A full matching global tag for the current file.
+3. "F " A full matching global tag for another file.
+4. "FS " A full matching static tag for another file.
+5. " SC" An ignore-case matching static tag for the current file.
+6. " C" An ignore-case matching global tag for the current file.
+7. " " An ignore-case matching global tag for another file.
+8. " S " An ignore-case matching static tag for another file.
+
+Note that when the current file changes, the priority list is mostly not
+changed, to avoid confusion when using ":tnext". It is changed when using
+":tag {ident}".
+
+The ignore-case matches are not found for a ":tag" command when the
+'ignorecase' option is off. They are found when a pattern is used (starting
+with a "/") and for ":tselect", also when 'ignorecase' is off. Note that
+using ignore-case tag searching disables binary searching in the tags file,
+which causes a slowdown. This can be avoided by fold-case sorting the tag
+file. See the 'tagbsearch' option for an explanation.
+
+==============================================================================
+2. Tag stack *tag-stack* *tagstack* *E425*
+
+On the tag stack is remembered which tags you jumped to, and from where.
+Tags are only pushed onto the stack when the 'tagstack' option is set.
+
+g<RightMouse> *g<RightMouse>*
+<C-RightMouse> *<C-RightMouse>* *CTRL-T*
+CTRL-T Jump to [count] older entry in the tag stack
+ (default 1). {not in Vi}
+
+ *:po* *:pop* *E555* *E556*
+:[count]po[p][!] Jump to [count] older entry in tag stack (default 1).
+ See |tag-!| for [!]. {not in Vi}
+
+:[count]ta[g][!] Jump to [count] newer entry in tag stack (default 1).
+ See |tag-!| for [!]. {not in Vi}
+
+ *:tags*
+:tags Show the contents of the tag stack. The active
+ entry is marked with a '>'. {not in Vi}
+
+The output of ":tags" looks like this:
+
+ # TO tag FROM line in file/line
+ 1 1 main 1 harddisk2:text/vim/test
+ > 2 2 FuncA 58 i = FuncA(10);
+ 3 1 FuncC 357 harddisk2:text/vim/src/amiga.c
+
+This list shows the tags that you jumped to and the cursor position before
+that jump. The older tags are at the top, the newer at the bottom.
+
+The '>' points to the active entry. This is the tag that will be used by the
+next ":tag" command. The CTRL-T and ":pop" command will use the position
+above the active entry.
+
+Below the "TO" is the number of the current match in the match list. Note
+that this doesn't change when using ":pop" or ":tag".
+
+The line number and file name are remembered to be able to get back to where
+you were before the tag command. The line number will be correct, also when
+deleting/inserting lines, unless this was done by another program (e.g.
+another instance of Vim).
+
+For the current file, the "file/line" column shows the text at the position.
+An indent is removed and a long line is truncated to fit in the window.
+
+You can jump to previously used tags with several commands. Some examples:
+
+ ":pop" or CTRL-T to position before previous tag
+ {count}CTRL-T to position before {count} older tag
+ ":tag" to newer tag
+ ":0tag" to last used tag
+
+The most obvious way to use this is while browsing through the call graph of
+a program. Consider the following call graph:
+
+ main ---> FuncA ---> FuncC
+ ---> FuncB
+
+(Explanation: main calls FuncA and FuncB; FuncA calls FuncC).
+You can get from main to FuncA by using CTRL-] on the call to FuncA. Then
+you can CTRL-] to get to FuncC. If you now want to go back to main you can
+use CTRL-T twice. Then you can CTRL-] to FuncB.
+
+If you issue a ":ta {ident}" or CTRL-] command, this tag is inserted at the
+current position in the stack. If the stack was full (it can hold up to 20
+entries), the oldest entry is deleted and the older entries shift one
+position up (their index number is decremented by one). If the last used
+entry was not at the bottom, the entries below the last used one are
+deleted. This means that an old branch in the call graph is lost. After the
+commands explained above the tag stack will look like this:
+
+ # TO tag FROM line in file
+ 1 main 1 harddisk2:text/vim/test
+ 2 FuncB 59 harddisk2:text/vim/src/main.c
+
+ *E73*
+When you try to use the tag stack while it doesn't contain anything you will
+get an error message.
+
+==============================================================================
+3. Tag match list *tag-matchlist* *E427* *E428*
+
+When there are several matching tags, these commands can be used to jump
+between them. Note that these command don't change the tag stack, they keep
+the same entry.
+
+ *:ts* *:tselect*
+:ts[elect][!] [ident] List the tags that match [ident], using the
+ information in the tags file(s).
+ When [ident] is not given, the last tag name from the
+ tag stack is used.
+ With a '>' in the first column is indicated which is
+ the current position in the list (if there is one).
+ [ident] can be a regexp pattern, see |tag-regexp|.
+ See |tag-priority| for the priorities used in the
+ listing. {not in Vi}
+ Example output:
+
+>
+ nr pri kind tag file
+ 1 F f mch_delay os_amiga.c
+ mch_delay(msec, ignoreinput)
+ > 2 F f mch_delay os_msdos.c
+ mch_delay(msec, ignoreinput)
+ 3 F f mch_delay os_unix.c
+ mch_delay(msec, ignoreinput)
+ Enter nr of choice (<CR> to abort):
+<
+ See |tag-priority| for the "pri" column. Note that
+ this depends on the current file, thus using
+ ":tselect xxx" can produce different results.
+ The "kind" column gives the kind of tag, if this was
+ included in the tags file.
+ The "info" column shows information that could be
+ found in the tags file. It depends on the program
+ that produced the tags file.
+ When the list is long, you may get the |more-prompt|.
+ If you already see the tag you want to use, you can
+ type 'q' and enter the number.
+
+ *:sts* *:stselect*
+:sts[elect][!] [ident] Does ":tselect[!] [ident]" and splits the window for
+ the selected tag. {not in Vi}
+
+ *g]*
+g] Like CTRL-], but use ":tselect" instead of ":tag".
+ {not in Vi}
+
+ *v_g]*
+{Visual}g] Same as "g]", but use the highlighted text as the
+ identifier. {not in Vi}
+
+ *:tj* *:tjump*
+:tj[ump][!] [ident] Like ":tselect", but jump to the tag directly when
+ there is only one match. {not in Vi}
+
+ *:stj* *:stjump*
+:stj[ump][!] [ident] Does ":tjump[!] [ident]" and splits the window for the
+ selected tag. {not in Vi}
+
+ *g_CTRL-]*
+g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag".
+ {not in Vi}
+
+ *v_g_CTRL-]*
+{Visual}g CTRL-] Same as "g CTRL-]", but use the highlighted text as
+ the identifier. {not in Vi}
+
+ *:tn* *:tnext*
+:[count]tn[ext][!] Jump to [count] next matching tag (default 1). See
+ |tag-!| for [!]. {not in Vi}
+
+ *:tp* *:tprevious*
+:[count]tp[revious][!] Jump to [count] previous matching tag (default 1).
+ See |tag-!| for [!]. {not in Vi}
+
+ *:tN* *:tNext*
+:[count]tN[ext][!] Same as ":tprevious". {not in Vi}
+
+ *:tr* *:trewind*
+:[count]tr[ewind][!] Jump to first matching tag. If [count] is given, jump
+ to [count]th matching tag. See |tag-!| for [!]. {not
+ in Vi}
+
+ *:tf* *:tfirst*
+:[count]tf[irst][!] Same as ":trewind". {not in Vi}
+
+ *:tl* *:tlast*
+:tl[ast][!] Jump to last matching tag. See |tag-!| for [!]. {not
+ in Vi}
+
+
+When there is no other message, Vim shows which matching tag has been jumped
+to, and the number of matching tags: >
+ tag 1 of 3 or more
+The " or more" is used to indicate that Vim didn't try all the tags files yet.
+When using ":tnext" a few times, or with ":tlast", more matches may be found.
+
+When you didn't see this message because of some other message, or you just
+want to know where you are, this command will show it again (and jump to the
+same tag as last time): >
+ :0tn
+<
+ *tag-skip-file*
+When a matching tag is found for which the file doesn't exist, this match is
+skipped and the next matching tag is used. Vim reports this, to notify you of
+missing files. When the end of the list of matches has been reached, an error
+message is given.
+
+The tag match list can also be used in the preview window. The commands are
+the same as above, with a "p" prepended.
+{not available when compiled without the |+quickfix| feature}
+
+ *:pts* *:ptselect*
+:pts[elect][!] [ident] Does ":tselect[!] [ident]" and shows the new tag in a
+ "Preview" window. See |:ptag| for more info.
+ {not in Vi}
+
+ *:ptj* *:ptjump*
+:ptj[ump][!] [ident] Does ":tjump[!] [ident]" and shows the new tag in a
+ "Preview" window. See |:ptag| for more info.
+ {not in Vi}
+
+ *:ptn* *:ptnext*
+:[count]ptn[ext][!] ":tnext" in the preview window. See |:ptag|.
+ {not in Vi}
+
+ *:ptp* *:ptprevious*
+:[count]ptp[revious][!] ":tprevious" in the preview window. See |:ptag|.
+ {not in Vi}
+
+ *:ptN* *:ptNext*
+:[count]ptN[ext][!] Same as ":ptprevious". {not in Vi}
+
+ *:ptr* *:ptrewind*
+:[count]ptr[ewind][!] ":trewind" in the preview window. See |:ptag|.
+ {not in Vi}
+
+ *:ptf* *:ptfirst*
+:[count]ptf[irst][!] Same as ":ptrewind". {not in Vi}
+
+ *:ptl* *:ptlast*
+:ptl[ast][!] ":tlast" in the preview window. See |:ptag|.
+ {not in Vi}
+
+==============================================================================
+4. Tags details *tag-details*
+
+ *static-tag*
+A static tag is a tag that is defined for a specific file. In a C program
+this could be a static function.
+
+In Vi jumping to a tag sets the current search pattern. This means that
+the "n" command after jumping to a tag does not search for the same pattern
+that it did before jumping to the tag. Vim does not do this as we consider it
+to be a bug. You can still find the tag search pattern in the search history.
+If you really want the old Vi behavior, set the 't' flag in 'cpoptions'.
+
+ *tag-binary-search*
+Vim uses binary searching in the tags file to find the desired tag quickly
+(when enabled at compile time |+tag_binary|). But this only works if the
+tags file was sorted on ASCII byte value. Therefore, if no match was found,
+another try is done with a linear search. If you only want the linear search,
+reset the 'tagbsearch' option. Or better: Sort the tags file!
+
+Note that the binary searching is disabled when not looking for a tag with a
+specific name. This happens when ignoring case and when a regular expression
+is used that doesn't start with a fixed string. Tag searching can be a lot
+slower then. The former can be avoided by case-fold sorting the tags file.
+See 'tagbsearch' for details.
+
+ *tag-regexp*
+The ":tag" and "tselect" commands accept a regular expression argument. See
+|pattern| for the special characters that can be used.
+When the argument starts with '/', it is used as a pattern. If the argument
+does not start with '/', it is taken literally, as a full tag name.
+Examples: >
+ :tag main
+< jumps to the tag "main" that has the highest priority. >
+ :tag /^get
+< jumps to the tag that starts with "get" and has the highest priority. >
+ :tag /norm
+< lists all the tags that contain "norm", including "id_norm".
+When the argument both exists literally, and match when used as a regexp, a
+literal match has a higher priority. For example, ":tag /open" matches "open"
+before "open_file" and "file_open".
+
+ *tag-!*
+If the tag is in the current file this will always work. Otherwise the
+performed actions depend on whether the current file was changed, whether a !
+is added to the command and on the 'autowrite' option:
+
+ tag in file autowrite ~
+current file changed ! option action ~
+-----------------------------------------------------------------------------
+ yes x x x goto tag
+ no no x x read other file, goto tag
+ no yes yes x abandon current file, read other file, goto
+ tag
+ no yes no on write current file, read other file, goto
+ tag
+ no yes no off fail
+-----------------------------------------------------------------------------
+
+- If the tag is in the current file, the command will always work.
+- If the tag is in another file and the current file was not changed, the
+ other file will be made the current file and read into the buffer.
+- If the tag is in another file, the current file was changed and a ! is
+ added to the command, the changes to the current file are lost, the other
+ file will be made the current file and read into the buffer.
+- If the tag is in another file, the current file was changed and the
+ 'autowrite' option is on, the current file will be written, the other
+ file will be made the current file and read into the buffer.
+- If the tag is in another file, the current file was changed and the
+ 'autowrite' option is off, the command will fail. If you want to save
+ the changes, use the ":w" command and then use ":tag" without an argument.
+ This works because the tag is put on the stack anyway. If you want to lose
+ the changes you can use the ":tag!" command.
+
+ *tag-security*
+Note that Vim forbids some commands, for security reasons. This works like
+using the 'secure' option for exrc/vimrc files in the current directory. See
+|trojan-horse| and |sandbox|.
+When the {tagaddress} changes a buffer, you will get a warning message:
+ "WARNING: tag command changed a buffer!!!"
+In a future version changing the buffer will be impossible. All this for
+security reasons: Somebody might hide a nasty command in the tags file, which
+would otherwise go unnoticed. Example: >
+ :$d|/tag-function-name/
+{this security prevention is not present in Vi}.
+
+In Vi the ":tag" command sets the last search pattern when the tag is searched
+for. In Vim this is not done, the previous search pattern is still remembered,
+unless the 't' flag is present in 'cpoptions'. The search pattern is always
+put in the search history, so you can modify it if searching fails.
+
+ *emacs-tags* *emacs_tags* *E430*
+Emacs style tag files are only supported if Vim was compiled with the
+|+emacs_tags| feature enabled. Sorry, there is no explanation about Emacs tag
+files here, it is only supported for backwards compatibility :-).
+
+ *tags-option*
+The 'tags' option is a list of file names. Each of these files is searched
+for the tag. This can be used to use a different tags file than the default
+file "tags". It can also be used to access a common tags file.
+
+The next file in the list is not used when:
+- A matching static tag for the current buffer has been found.
+- A matching global tag has been found.
+This also depends on the 'ignorecase' option. If it is off, and the tags file
+only has a match without matching case, the next tags file is searched for a
+match with matching case. If no tag with matching case is found, the first
+match without matching case is used. If 'ignorecase' is on, and a matching
+global tag with or without matching case is found, this one is used, no
+further tags files are searched.
+
+When a tag file name starts with "./", the '.' is replaced with the path of
+the current file. This makes it possible to use a tags file in the directory
+where the current file is (no matter what the current directory is). The idea
+of using "./" is that you can define which tag file is searched first: In the
+current directory ("tags,./tags") or in the directory of the current file
+("./tags,tags").
+
+For example: >
+ :set tags=./tags,tags,/home/user/commontags
+
+In this example the tag will first be searched for in the file "tags" in the
+directory where the current file is. Next the "tags" file in the current
+directory. If it is not found there, then the file "/home/user/commontags"
+will be searched for the tag.
+
+This can be switched off by including the 'd' flag in 'cpoptions', to make
+it Vi compatible. "./tags" will than be the tags file in the current
+directory, instead of the tags file in the directory where the current file
+is.
+
+Instead of the comma a space may be used. Then a backslash is required for
+the space to be included in the string option: >
+ :set tags=tags\ /home/user/commontags
+
+To include a space in a file name use three backslashes. To include a comma
+in a file name use two backslashes. For example, use: >
+ :set tags=tag\\\ file,/home/user/common\\,tags
+
+for the files "tag file" and "/home/user/common,tags". The 'tags' option will
+have the value "tag\ file,/home/user/common\,tags".
+
+If the 'tagrelative' option is on (which is the default) and using a tag file
+in another directory, file names in that tag file are relative to the
+directory where the tag file is.
+
+==============================================================================
+5. Tags file format *tags-file-format* *E431*
+
+ *ctags* *jtags*
+A tags file can be created with an external command, for example "ctags". It
+will contain a tag for each function. Some versions of "ctags" will also make
+a tag for each "#defined" macro, typedefs, enums, etc.
+
+Some programs that generate tags files:
+ctags As found on most Unix systems. Only supports C. Only
+ does the basic work.
+exuberant ctags This a very good one. It works for C, C++, Java,
+ Fortran, Eiffel and others. It can generate tags for
+ many items. See http://ctags.sourceforge.net.
+etags Connected to Emacs. Supports many languages.
+JTags For Java, in Java. It can be found at
+ http://www.fleiner.com/jtags/.
+ptags.py For Python, in Python. Found in your Python source
+ directory at Tools/scripts/ptags.py.
+ptags For Perl, in Perl. It can be found at
+ http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
+gnatxref For Ada. See http://www.gnuada.org/. gnatxref is
+ part of the gnat package.
+
+
+The lines in the tags file must have one of these three formats:
+
+1. {tagname} {TAB} {tagfile} {TAB} {tagaddress}
+2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
+3. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..
+
+The first is a normal tag, which is completely compatible with Vi. It is the
+only format produced by traditional ctags implementations. This is often used
+for functions that are global, also referenced in other files.
+
+The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR>
+also works. The <CR> and <NL> characters can never appear inside a line.
+
+ *tag-old-static*
+The second format is for a static tag only. It is obsolete now, replaced by
+the third format. It is only supported by Elvis 1.x and Vim and a few
+versions of ctags. A static tag is often used for functions that are local,
+only referenced in the file {tagfile}. Note that for the static tag, the two
+occurrences of {tagfile} must be exactly the same. Also see |tags-option|
+below, for how static tags are used.
+
+The third format is new. It includes additional information in optional
+fields at the end of each line. It is backwards compatible with Vi. It is
+only supported by new versions of ctags (such as Exuberant ctags).
+
+{tagname} The identifier. Normally the name of a function, but it can
+ be any identifier. It cannot contain a <Tab>.
+{TAB} One <Tab> character. Note: previous versions allowed any
+ white space here. This has been abandoned to allow spaces in
+ {tagfile}. It can be re-enabled by including the
+ |+tag_any_white| feature at compile time. *tag-any-white*
+{tagfile} The file that contains the definition of {tagname}. It can
+ have an absolute or relative path. It may contain environment
+ variables and wildcards (although the use of wildcards is
+ doubtful). It cannot contain a <Tab>.
+{tagaddress} The Ex command that positions the cursor on the tag. It can
+ be any Ex command, although restrictions apply (see
+ |tag-security|). Posix only allows line numbers and search
+ commands, which are mostly used.
+{term} ;" The two characters semicolon and double quote. This is
+ interpreted by Vi as the start of a comment, which makes the
+ following be ignored. This is for backwards compatibility
+ with Vi, it ignores the following fields.
+{field} .. A list of optional fields. Each field has the form:
+
+ <Tab>{fieldname}:{value}
+
+ The {fieldname} identifies the field, and can only contain
+ alphabetical characters [a-zA-Z].
+ The {value} is any string, but cannot contain a <Tab>.
+ These characters are special:
+ "\t" stands for a <Tab>
+ "\r" stands for a <CR>
+ "\n" stands for a <NL>
+ "\\" stands for a single '\' character
+
+ There is one field that doesn't have a ':'. This is the kind
+ of the tag. It is handled like it was preceded with "kind:".
+ See the documentation of ctags for the kinds it produces.
+
+ The only other field currently recognized by Vim is "file:"
+ (with an empty value). It is used for a static tag.
+
+The first lines in the tags file can contain lines that start with
+ !_TAG_
+These are sorted to the first lines, only rare tags that start with "!" can
+sort to before them. Vim recognizes two items. The first one is the line
+that indicates if the file was sorted. When this line is found, Vim uses
+binary searching for the tags file:
+ !_TAG_FILE_SORTED<Tab>1<Tab>{anything} ~
+
+A tag file may be case-fold sorted to avoid a linear search when 'ignorecase'
+is on. See 'tagbsearch' for details. The value '2' should be used then:
+ !_TAG_FILE_SORTED<Tab>2<Tab>{anything} ~
+
+The other tag that Vim recognizes, but only when compiled with the
+|+multi_byte| feature, is the encoding of the tags file:
+ !_TAG_FILE_ENCODING<Tab>utf-8<Tab>{anything} ~
+Here "utf-8" is the encoding used for the tags. Vim will then convert the tag
+being searched for from 'encoding' to the encoding of the tags file. And when
+listing tags the reverse happens. When the conversion fails the unconverted
+tag is used.
+
+ *tag-search*
+The command can be any Ex command, but often it is a search command.
+Examples:
+ tag1 file1 /^main(argc, argv)/ ~
+ tag2 file2 108 ~
+
+The command is always executed with 'magic' not set. The only special
+characters in a search pattern are "^" (begin-of-line) and "$" (<EOL>).
+See |pattern|. Note that you must put a backslash before each backslash in
+the search text. This is for backwards compatibility with Vi.
+
+ *E434* *E435*
+If the command is a normal search command (it starts and ends with "/" or
+"?"), some special handling is done:
+- Searching starts on line 1 of the file.
+ The direction of the search is forward for "/", backward for "?".
+ Note that 'wrapscan' does not matter, the whole file is always searched. {Vi
+ does use 'wrapscan', which caused tags sometimes not be found). {Vi starts
+ searching in line 2 of another file. It does not find a tag in line 1 of
+ another file when 'wrapscan' is not set}
+- If the search fails, another try is done ignoring case. If that fails too,
+ a search is done for:
+ "^tagname[ \t]*("
+ (the tag with '^' prepended and "[ \t]*(" appended). When using function
+ names, this will find the function name when it is in column 0. This will
+ help when the arguments to the function have changed since the tags file was
+ made. If this search also fails another search is done with:
+ "^[#a-zA-Z_].*\<tagname[ \t]*("
+ This means: A line starting with '#' or an identifier and containing the tag
+ followed by white space and a '('. This will find macro names and function
+ names with a type prepended. {the extra searches are not in Vi}.
+
+==============================================================================
+6. Include file searches *include-search* *definition-search*
+ *E387* *E388* *E389*
+
+These commands look for a string in the current file and in all encountered
+included files (recursively). This can be used to find the definition of a
+variable, function or macro. If you only want to search in the current
+buffer, use the commands listed at |pattern-searches|.
+
+These commands are not available when the |+find_in_path| feature was disabled
+at compile time.
+
+When a line is encountered that includes another file, that file is searched
+before continuing in the current buffer. Files included by included files are
+also searched. When an include file could not be found it is silently
+ignored. Use the |:checkpath| command to discover which files could not be
+found, possibly your 'path' option is not set up correctly. Note: the
+included file is searched, not a buffer that may be editing that file. Only
+for the current file the lines in the buffer are used.
+
+The string can be any keyword or a defined macro. For the keyword any match
+will be found. For defined macros only lines that match with the 'define'
+option will be found. The default is "^#\s*define", which is for C programs.
+For other languages you probably want to change this. See 'define' for an
+example for C++. The string cannot contain an end-of-line, only matches
+within a line are found.
+
+When a match is found for a defined macro, the displaying of lines continues
+with the next line when a line ends in a backslash.
+
+The commands that start with "[" start searching from the start of the current
+file. The commands that start with "]" start at the current cursor position.
+
+The 'include' option is used to define a line that includes another file. The
+default is "\^#\s*include", which is for C programs. Note: Vim does not
+recognize C syntax, if the 'include' option matches a line inside
+"#ifdef/#endif" or inside a comment, it is searched anyway. The 'isfname'
+option is used to recognize the file name that comes after the matched
+pattern.
+
+The 'path' option is used to find the directory for the include files that
+do not have an absolute path.
+
+The 'comments' option is used for the commands that display a single line or
+jump to a line. It defines patterns that may start a comment. Those lines
+are ignored for the search, unless [!] is used. One exception: When the line
+matches the pattern "^# *define" it is not considered to be a comment.
+
+If you want to list matches, and then select one to jump to, you could use a
+mapping to do that for you. Here is an example: >
+
+ :map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
+<
+ *[i*
+[i Display the first line that contains the keyword
+ under the cursor. The search starts at the beginning
+ of the file. Lines that look like a comment are
+ ignored (see 'comments' option). If a count is given,
+ the count'th matching line is displayed, and comment
+ lines are not ignored. {not in Vi}
+
+ *]i*
+]i like "[i", but start at the current cursor position.
+ {not in Vi}
+
+ *:is* *:isearch*
+:[range]is[earch][!] [count] [/]pattern[/]
+ Like "[i" and "]i", but search in [range] lines
+ (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *[I*
+[I Display all lines that contain the keyword under the
+ cursor. Filenames and line numbers are displayed
+ for the found lines. The search starts at the
+ beginning of the file. {not in Vi}
+
+ *]I*
+]I like "[I", but start at the current cursor position.
+ {not in Vi}
+
+ *:il* *:ilist*
+:[range]il[ist][!] [/]pattern[/]
+ Like "[I" and "]I", but search in [range] lines
+ (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *[_CTRL-I*
+[ CTRL-I Jump to the first line that contains the keyword
+ under the cursor. The search starts at the beginning
+ of the file. Lines that look like a comment are
+ ignored (see 'comments' option). If a count is given,
+ the count'th matching line is jumped to, and comment
+ lines are not ignored. {not in Vi}
+
+ *]_CTRL-I*
+] CTRL-I like "[ CTRL-I", but start at the current cursor
+ position. {not in Vi}
+
+ *:ij* *:ijump*
+:[range]ij[ump][!] [count] [/]pattern[/]
+ Like "[ CTRL-I" and "] CTRL-I", but search in
+ [range] lines (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+CTRL-W CTRL-I *CTRL-W_CTRL-I* *CTRL-W_i*
+CTRL-W i Open a new window, with the cursor on the first line
+ that contains the keyword under the cursor. The
+ search starts at the beginning of the file. Lines
+ that look like a comment line are ignored (see
+ 'comments' option). If a count is given, the count'th
+ matching line is jumped to, and comment lines are not
+ ignored. {not in Vi}
+
+ *:isp* *:isplit*
+:[range]isp[lit][!] [count] [/]pattern[/]
+ Like "CTRL-W i" and "CTRL-W i", but search in
+ [range] lines (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *[d*
+[d Display the first macro definition that contains the
+ macro under the cursor. The search starts from the
+ beginning of the file. If a count is given, the
+ count'th matching line is displayed. {not in Vi}
+
+ *]d*
+]d like "[d", but start at the current cursor position.
+ {not in Vi}
+
+ *:ds* *:dsearch*
+:[range]ds[earch][!] [count] [/]string[/]
+ Like "[d" and "]d", but search in [range] lines
+ (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *[D*
+[D Display all macro definitions that contain the macro
+ under the cursor. Filenames and line numbers are
+ displayed for the found lines. The search starts
+ from the beginning of the file. {not in Vi}
+
+ *]D*
+]D like "[D", but start at the current cursor position.
+ {not in Vi}
+
+ *:dl* *:dlist*
+:[range]dl[ist][!] [/]string[/]
+ Like "[D" and "]D", but search in [range] lines
+ (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *[_CTRL-D*
+[ CTRL-D Jump to the first macro definition that contains the
+ keyword under the cursor. The search starts from
+ the beginning of the file. If a count is given, the
+ count'th matching line is jumped to. {not in Vi}
+
+ *]_CTRL-D*
+] CTRL-D like "[ CTRL-D", but start at the current cursor
+ position. {not in Vi}
+
+ *:dj* *:djump*
+:[range]dj[ump][!] [count] [/]string[/]
+ Like "[ CTRL-D" and "] CTRL-D", but search in
+ [range] lines (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+CTRL-W CTRL-D *CTRL-W_CTRL-D* *CTRL-W_d*
+CTRL-W d Open a new window, with the cursor on the first
+ macro definition line that contains the keyword
+ under the cursor. The search starts from the
+ beginning of the file. If a count is given, the
+ count'th matching line is jumped to. {not in Vi}
+
+ *:dsp* *:dsplit*
+:[range]dsp[lit][!] [count] [/]string[/]
+ Like "CTRL-W d", but search in [range] lines
+ (default: whole file).
+ See |:search-args| for [/] and [!]. {not in Vi}
+
+ *:che* *:checkpath*
+:che[ckpath] List all the included files that could not be found.
+ {not in Vi}
+
+:che[ckpath]! List all the included files. {not in Vi}
+
+ *:search-args*
+Common arguments for the commands above:
+[!] When included, find matches in lines that are recognized as comments.
+ When excluded, a match is ignored when the line is recognized as a
+ comment (according to 'comments'), or the match is in a C comment (after
+ "//" or inside /* */). Note that a match may be missed if a line is
+ recognized as a comment, but the comment ends halfway the line.
+ And if the line is a comment, but it is not recognized (according to
+ 'comments') a match may be found in it anyway. Example: >
+ /* comment
+ foobar */
+< A match for "foobar" is found, because this line is not recognized as a
+ comment (even though syntax highlighting does recognize it).
+ Note: Since a macro definition mostly doesn't look like a comment, the
+ [!] makes no difference for ":dlist", ":dsearch" and ":djump".
+[/] A pattern can be surrounded by '/'. Without '/' only whole words are
+ matched, using the pattern "\<pattern\>". Only after the second '/' a
+ next command can be appended with '|'. Example: >
+ :isearch /string/ | echo "the last one"
+< For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern
+ is used as a literal string, not as a search pattern.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
new file mode 100644
index 000000000..4ddd63e42
--- /dev/null
+++ b/runtime/doc/term.txt
@@ -0,0 +1,808 @@
+*term.txt* For Vim version 7.0aa. Last change: 2004 Jan 09
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Terminal information *terminal-info*
+
+Vim uses information about the terminal you are using to fill the screen and
+recognize what keys you hit. If this information is not correct, the screen
+may be messed up or keys may not be recognized. The actions which have to be
+performed on the screen are accomplished by outputting a string of
+characters. Special keys produce a string of characters. These strings are
+stored in the terminal options, see |terminal-options|.
+
+NOTE: Most of this is not used when running the |GUI|.
+
+1. Startup |startup-terminal|
+2. Terminal options |terminal-options|
+3. Window size |window-size|
+4. Slow and fast terminals |slow-fast-terminal|
+5. Using the mouse |mouse-using|
+
+==============================================================================
+1. Startup *startup-terminal*
+
+When Vim is started a default terminal type is assumed. For the Amiga this is
+a standard CLI window, for MS-DOS the pc terminal, for Unix an ansi terminal.
+A few other terminal types are always available, see below |builtin-terms|.
+
+You can give the terminal name with the '-T' Vim argument. If it is not given
+Vim will try to get the name from the TERM environment variable.
+
+ *termcap* *terminfo* *E557* *E558* *E559*
+On Unix the terminfo database or termcap file is used. This is referred to as
+"termcap" in all the documentation. At compile time, when running configure,
+the choice whether to use terminfo or termcap is done automatically. When
+running Vim the output of ":version" will show |+terminfo| if terminfo is
+used. Also see |xterm-screens|.
+
+On non-Unix systems a termcap is only available if Vim was compiled with
+TERMCAP defined.
+
+ *builtin-terms* *builtin_terms*
+Which builtin terminals are available depends on a few defines in feature.h,
+which need to be set at compile time:
+ define output of ":version" terminals builtin ~
+NO_BUILTIN_TCAPS -builtin_terms none
+SOME_BUILTIN_TCAPS +builtin_terms most common ones (default)
+ALL_BUILTIN_TCAPS ++builtin_terms all available
+
+You can see a list of available builtin terminals with ":set term=xxx" (when
+not running the GUI). Also see |+builtin_terms|.
+
+If the termcap code is included Vim will try to get the strings for the
+terminal you are using from the termcap file and the builtin termcaps. Both
+are always used, if an entry for the terminal you are using is present. Which
+one is used first depends on the 'ttybuiltin' option:
+
+'ttybuiltin' on 1: builtin termcap 2: external termcap
+'ttybuiltin' off 1: external termcap 2: builtin termcap
+
+If an option is missing in one of them, it will be obtained from the other
+one. If an option is present in both, the one first encountered is used.
+
+Which external termcap file is used varies from system to system and may
+depend on the environment variables "TERMCAP" and "TERMPATH". See "man
+tgetent".
+
+Settings depending on terminal *term-dependent-settings*
+
+If you want to set options or mappings, depending on the terminal name, you
+can do this best in your .vimrc. Example: >
+
+ if &term == "xterm"
+ ... xterm maps and settings ...
+ elseif &term =~ "vt10."
+ ... vt100, vt102 maps and settings ...
+ endif
+<
+ *raw-terminal-mode*
+For normal editing the terminal will be put into "raw" mode. The strings
+defined with 't_ti' and 't_ks' will be sent to the terminal. Normally this
+puts the terminal in a state where the termcap codes are valid and activates
+the cursor and function keys. When Vim exits the terminal will be put back
+into the mode it was before Vim started. The strings defined with 't_te' and
+'t_ke' will be sent to the terminal. On the Amiga, with commands that execute
+an external command (e.g., "!!"), the terminal will be put into Normal mode
+for a moment. This means that you can stop the output to the screen by
+hitting a printing key. Output resumes when you hit <BS>.
+
+ *cs7-problem*
+Note: If the terminal settings are changed after running Vim, you might have
+an illegal combination of settings. This has been reported on Solaris 2.5
+with "stty cs8 parenb", which is restored as "stty cs7 parenb". Use
+"stty cs8 -parenb -istrip" instead, this is restored correctly.
+
+Some termcap entries are wrong in the sense that after sending 't_ks' the
+cursor keys send codes different from the codes defined in the termcap. To
+avoid this you can set 't_ks' (and 't_ke') to empty strings. This must be
+done during initialization (see |initialization|), otherwise it's too late.
+
+Some termcap entries assume that the highest bit is always reset. For
+example: The cursor-up entry for the Amiga could be ":ku=\E[A:". But the
+Amiga really sends "\233A". This works fine if the highest bit is reset,
+e.g., when using an Amiga over a serial line. If the cursor keys don't work,
+try the entry ":ku=\233A:".
+
+Some termcap entries have the entry ":ku=\E[A:". But the Amiga really sends
+"\233A". On output "\E[" and "\233" are often equivalent, on input they
+aren't. You will have to change the termcap entry, or change the key code with
+the :set command to fix this.
+
+Many cursor key codes start with an <Esc>. Vim must find out if this is a
+single hit of the <Esc> key or the start of a cursor key sequence. It waits
+for a next character to arrive. If it does not arrive within one second a
+single <Esc> is assumed. On very slow systems this may fail, causing cursor
+keys not to work sometimes. If you discover this problem reset the 'timeout'
+option. Vim will wait for the next character to arrive after an <Esc>. If
+you want to enter a single <Esc> you must type it twice. Resetting the
+'esckeys' option avoids this problem in Insert mode, but you lose the
+possibility to use cursor and function keys in Insert mode.
+
+On the Amiga the recognition of window resizing is activated only when the
+terminal name is "amiga" or "builtin_amiga".
+
+Some terminals have confusing codes for the cursor keys. The televideo 925 is
+such a terminal. It sends a CTRL-H for cursor-left. This would make it
+impossible to distinguish a backspace and cursor-left. To avoid this problem
+CTRL-H is never recognized as cursor-left.
+
+ *vt100-cursor-keys* *xterm-cursor-keys*
+Other terminals (e.g., vt100 and xterm) have cursor keys that send <Esc>OA,
+<Esc>OB, etc. Unfortunately these are valid commands in insert mode: Stop
+insert, Open a new line above the new one, start inserting 'A', 'B', etc.
+Instead of performing these commands Vim will erroneously recognize this typed
+key sequence as a cursor key movement. To avoid this and make Vim do what you
+want in either case you could use these settings: >
+ :set notimeout " don't timeout on mappings
+ :set ttimeout " do timeout on terminal key codes
+ :set timeoutlen=100 " timeout after 100 msec
+This requires the key-codes to be sent within 100msec in order to recognize
+them as a cursor key. When you type you normally are not that fast, so they
+are recognized as individual typed commands, even though Vim receives the same
+sequence of bytes.
+
+ *vt100-function-keys* *xterm-function-keys*
+An xterm can send function keys F1 to F4 in two modes: vt100 compatible or
+not. Because Vim cannot know what the xterm is sending, both types of keys
+are recognized. The same happens for the <Home> and <End> keys.
+ normal vt100 ~
+ <F1> t_k1 <Esc>[11~ <xF1> <Esc>OP *<xF1>-xterm*
+ <F2> t_k2 <Esc>[12~ <xF2> <Esc>OQ *<xF2>-xterm*
+ <F3> t_k3 <Esc>[13~ <xF3> <Esc>OR *<xF3>-xterm*
+ <F4> t_k4 <Esc>[14~ <xF4> <Esc>OS *<xF4>-xterm*
+ <Home> t_kh <Esc>[7~ <xHome> <Esc>OH *<xHome>-xterm*
+ <End> t_@7 <Esc>[4~ <xEnd> <Esc>OF *<xEnd>-xterm*
+
+When Vim starts, <xF1> is mapped to <F1>, <xF2> to <F2> etc. This means that
+by default both codes do the same thing. If you make a mapping for <xF2>,
+because your terminal does have two keys, the default mapping is overwritten,
+thus you can use the <F2> and <xF2> keys for something different.
+
+ *xterm-shifted-keys*
+Newer versions of xterm support shifted function keys and special keys. Vim
+recognizes most of them. Use ":set termcap" to check which are supported and
+what the codes are. Mostly these are not in a termcap, they are only
+supported by the builtin_xterm termcap.
+
+ *xterm-scroll-region*
+The default termcap entry for xterm on Sun and other platforms does not
+contain the entry for scroll regions. Add ":cs=\E[%i%d;%dr:" to the xterm
+entry in /etc/termcap and everything should work.
+
+ *xterm-end-home-keys*
+On some systems (at least on FreeBSD with XFree86 3.1.2) the codes that the
+<End> and <Home> keys send contain a <Nul> character. To make these keys send
+the proper key code, add these lines to your ~/.Xdefaults file:
+
+*VT100.Translations: #override \n\
+ <Key>Home: string("0x1b") string("[7~") \n\
+ <Key>End: string("0x1b") string("[8~")
+
+ *xterm-8bit* *xterm-8-bit*
+Xterm can be run in a mode where it uses 8-bit escape sequences. The CSI code
+is used instead of <Esc>[. The advantage is that an <Esc> can quickly be
+recognized in Insert mode, because it can't be confused with the start of a
+special key.
+For the builtin termcap entries, Vim checks if the 'term' option contains
+"8bit" anywhere. It then uses 8-bit characters for the termcap entries, the
+mouse and a few other things. You would normally set $TERM in your shell to
+"xterm-8bit" and Vim picks this up and adjusts to the 8-bit setting
+automatically.
+When Vim receives a response to the |t_RV| (request version) sequence and it
+starts with CSI, it assumes that the terminal is in 8-bit mode and will
+convert all key sequences to their 8-bit variants.
+
+==============================================================================
+2. Terminal options *terminal-options* *E436*
+
+The terminal options can be set just like normal options. But they are not
+shown with the ":set all" command. Instead use ":set termcap".
+
+It is always possible to change individual strings by setting the
+appropriate option. For example: >
+ :set t_ce=^V^[[K (CTRL-V, <Esc>, [, K)
+
+{Vi: no terminal options. You have to exit Vi, edit the termcap entry and
+try again}
+
+The options are listed below. The associated termcap code is always equal to
+the last two characters of the option name. Only one termcap code is
+required: Cursor motion, 't_cm'.
+
+The options 't_da', 't_db', 't_ms', 't_xs' represent flags in the termcap.
+When the termcap flag is present, the option will be set to "y". But any
+non-empty string means that the flag is set. An empty string means that the
+flag is not set. 't_CS' works like this too, but it isn't a termcap flag.
+
+OUTPUT CODES
+ option meaning ~
+
+ t_AB set background color (ANSI) *t_AB* *'t_AB'*
+ t_AF set foreground color (ANSI) *t_AF* *'t_AF'*
+ t_AL add number of blank lines *t_AL* *'t_AL'*
+ t_al add new blank line *t_al* *'t_al'*
+ t_bc backspace character *t_bc* *'t_bc'*
+ t_cd clear to end of screen *t_cd* *'t_cd'*
+ t_ce clear to end of line *t_ce* *'t_ce'*
+ t_cl clear screen *t_cl* *'t_cl'*
+ t_cm cursor motion (required!) *E437* *t_cm* *'t_cm'*
+ t_Co number of colors *t_Co* *'t_Co'*
+ t_CS if non-empty, cursor relative to scroll region *t_CS* *'t_CS'*
+ t_cs define scrolling region *t_cs* *'t_cs'*
+ t_CV define vertical scrolling region *t_CV* *'t_CV'*
+ t_da if non-empty, lines from above scroll down *t_da* *'t_da'*
+ t_db if non-empty, lines from below scroll up *t_db* *'t_db'*
+ t_DL delete number of lines *t_DL* *'t_DL'*
+ t_dl delete line *t_dl* *'t_dl'*
+ t_fs set window title end (from status line) *t_fs* *'t_fs'*
+ t_ke exit "keypad transmit" mode *t_ke* *'t_ke'*
+ t_ks start "keypad transmit" mode *t_ks* *'t_ks'*
+ t_le move cursor one char left *t_le* *'t_le'*
+ t_mb blinking mode *t_mb* *'t_mb'*
+ t_md bold mode *t_md* *'t_md'*
+ t_me Normal mode (undoes t_mr, t_mb, t_md and color) *t_me* *'t_me'*
+ t_mr reverse (invert) mode *t_mr* *'t_mr'*
+ *t_ms* *'t_ms'*
+ t_ms if non-empty, cursor can be moved in standout/inverse mode
+ t_nd non destructive space character *t_nd* *'t_nd'*
+ t_op reset to original color pair *t_op* *'t_op'*
+ t_RI cursor number of chars right *t_RI* *'t_RI'*
+ t_Sb set background color *t_Sb* *'t_Sb'*
+ t_Sf set foreground color *t_Sf* *'t_Sf'*
+ t_se standout end *t_se* *'t_se'*
+ t_so standout mode *t_so* *'t_so'*
+ t_sr scroll reverse (backward) *t_sr* *'t_sr'*
+ t_te out of "termcap" mode *t_te* *'t_te'*
+ t_ti put terminal in "termcap" mode *t_ti* *'t_ti'*
+ t_ts set window title start (to status line) *t_ts* *'t_ts'*
+ t_ue underline end *t_ue* *'t_ue'*
+ t_us underline mode *t_us* *'t_us'*
+ t_ut clearing uses the current background color *t_ut* *'t_ut'*
+ t_vb visual bell *t_vb* *'t_vb'*
+ t_ve cursor visible *t_ve* *'t_ve'*
+ t_vi cursor invisible *t_vi* *'t_vi'*
+ t_vs cursor very visible *t_vs* *'t_vs'*
+ *t_xs* *'t_xs'*
+ t_xs if non-empty, standout not erased by overwriting (hpterm)
+ t_ZH italics mode *t_ZH* *'t_ZH'*
+ t_ZR italics end *t_ZR* *'t_ZR'*
+
+Added by Vim (there are no standard codes for these):
+ t_IS set icon text start *t_IS* *'t_IS'*
+ t_IE set icon text end *t_IE* *'t_IE'*
+ t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
+ t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
+ t_RV request terminal version string (for xterm) *t_RV* *'t_RV'*
+ |xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes|
+
+KEY CODES
+Note: Use the <> form if possible
+
+ option name meaning ~
+
+ t_ku <Up> arrow up *t_ku* *'t_ku'*
+ t_kd <Down> arrow down *t_kd* *'t_kd'*
+ t_kr <Right> arrow right *t_kr* *'t_kr'*
+ t_kl <Left> arrow left *t_kl* *'t_kl'*
+ <S-Up> shift arrow up
+ <S-Down> shift arrow down
+ t_%i <S-Right> shift arrow right *t_%i* *'t_%i'*
+ t_#4 <S-Left> shift arrow left *t_#4* *'t_#4'*
+ t_k1 <F1> function key 1 *t_k1* *'t_k1'*
+ <xF1> alternate F1 *<xF1>*
+ t_k2 <F2> function key 2 *<F2>* *t_k2* *'t_k2'*
+ <xF2> alternate F2 *<xF2>*
+ t_k3 <F3> function key 3 *<F3>* *t_k3* *'t_k3'*
+ <xF3> alternate F3 *<xF3>*
+ t_k4 <F4> function key 4 *<F4>* *t_k4* *'t_k4'*
+ <xF4> alternate F4 *<xF4>*
+ t_k5 <F5> function key 5 *<F5>* *t_k5* *'t_k5'*
+ t_k6 <F6> function key 6 *<F6>* *t_k6* *'t_k6'*
+ t_k7 <F7> function key 7 *<F7>* *t_k7* *'t_k7'*
+ t_k8 <F8> function key 8 *<F8>* *t_k8* *'t_k8'*
+ t_k9 <F9> function key 9 *<F9>* *t_k9* *'t_k9'*
+ t_k; <F10> function key 10 *<F10>* *t_k;* *'t_k;'*
+ t_F1 <F11> function key 11 *<F11>* *t_F1* *'t_F1'*
+ t_F2 <F12> function key 12 *<F12>* *t_F2* *'t_F2'*
+ t_F3 <F13> function key 13 *<F13>* *t_F3* *'t_F3'*
+ t_F4 <F14> function key 14 *<F14>* *t_F4* *'t_F4'*
+ t_F5 <F15> function key 15 *<F15>* *t_F5* *'t_F5'*
+ t_F6 <F16> function key 16 *<F16>* *t_F6* *'t_F6'*
+ t_F7 <F17> function key 17 *<F17>* *t_F7* *'t_F7'*
+ t_F8 <F18> function key 18 *<F18>* *t_F8* *'t_F8'*
+ t_F9 <F19> function key 19 *<F19>* *t_F9* *'t_F9'*
+ <S-F1> shifted function key 1
+ <S-xF1> alternate <S-F1> *<S-xF1>*
+ <S-F2> shifted function key 2 *<S-F2>*
+ <S-xF2> alternate <S-F2> *<S-xF2>*
+ <S-F3> shifted function key 3 *<S-F3>*
+ <S-xF3> alternate <S-F3> *<S-xF3>*
+ <S-F4> shifted function key 4 *<S-F4>*
+ <S-xF4> alternate <S-F4> *<S-xF4>*
+ <S-F5> shifted function key 5 *<S-F5>*
+ <S-F6> shifted function key 6 *<S-F6>*
+ <S-F7> shifted function key 7 *<S-F7>*
+ <S-F8> shifted function key 8 *<S-F8>*
+ <S-F9> shifted function key 9 *<S-F9>*
+ <S-F10> shifted function key 10 *<S-F10>*
+ <S-F11> shifted function key 11 *<S-F11>*
+ <S-F12> shifted function key 12 *<S-F12>*
+ t_%1 <Help> help key *t_%1* *'t_%1'*
+ t_&8 <Undo> undo key *t_&8* *'t_&8'*
+ t_kI <Insert> insert key *t_kI* *'t_kI'*
+ t_kD <Del> delete key *t_kD* *'t_kD'*
+ t_kb <BS> backspace key *t_kb* *'t_kb'*
+ t_kB <S-Tab> back-tab (shift-tab) *<S-Tab>* *t_kB* *'t_kB'*
+ t_kh <Home> home key *t_kh* *'t_kh'*
+ t_#2 <S-Home> shifted home key *<S-Home>* *t_#2* *'t_#2'*
+ <xHome> alternate home key *<xHome>*
+ t_@7 <End> end key *t_@7* *'t_@7'*
+ t_*7 <S-End> shifted end key *<S-End>* *t_star7* *'t_star7'*
+ <xEnd> alternate end key *<xEnd>*
+ t_kP <PageUp> page-up key *t_kP* *'t_kP'*
+ t_kN <PageDown> page-down key *t_kN* *'t_kN'*
+ t_K1 <kHome> keypad home key *t_K1* *'t_K1'*
+ t_K4 <kEnd> keypad end key *t_K4* *'t_K4'*
+ t_K3 <kPageUp> keypad page-up key *t_K3* *'t_K3'*
+ t_K5 <kPageDown> keypad page-down key *t_K5* *'t_K5'*
+ t_K6 <kPlus> keypad plus key *<kPlus>* *t_K6* *'t_K6'*
+ t_K7 <kMinus> keypad minus key *<kMinus>* *t_K7* *'t_K7'*
+ t_K8 <kDivide> keypad divide *<kDivide>* *t_K8* *'t_K8'*
+ t_K9 <kMultiply> keypad multiply *<kMultiply>* *t_K9* *'t_K9'*
+ t_KA <kEnter> keypad enter key *<kEnter>* *t_KA* *'t_KA'*
+ t_KB <kPoint> keypad decimal point *<kPoint>* *t_KB* *'t_KB'*
+ t_KC <k0> keypad 0 *<k0>* *t_KC* *'t_KC'*
+ t_KD <k1> keypad 1 *<k1>* *t_KD* *'t_KD'*
+ t_KE <k2> keypad 2 *<k2>* *t_KE* *'t_KE'*
+ t_KF <k3> keypad 3 *<k3>* *t_KF* *'t_KF'*
+ t_KG <k4> keypad 4 *<k4>* *t_KG* *'t_KG'*
+ t_KH <k5> keypad 5 *<k5>* *t_KH* *'t_KH'*
+ t_KI <k6> keypad 6 *<k6>* *t_KI* *'t_KI'*
+ t_KJ <k7> keypad 7 *<k7>* *t_KJ* *'t_KJ'*
+ t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
+ t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
+ <Mouse> leader of mouse code *<Mouse>*
+
+Note about t_so and t_mr: When the termcap entry "so" is not present the
+entry for "mr" is used. And vice versa. The same is done for "se" and "me".
+If your terminal supports both inversion and standout mode, you can see two
+different modes. If your terminal supports only one of the modes, both will
+look the same.
+
+The keypad keys, when they are not mapped, behave like the equivalent normal
+key.
+ *xterm-codes*
+There is a special trick to obtain the key codes which currently only works
+for xterm. When |t_RV| is defined and a response is received which indicates
+an xterm with patchlevel 141 or higher, Vim uses special escape sequences to
+request the key codes directly from the xterm. The responses are used to
+adjust the various t_ codes. This avoids the problem that the xterm can
+produce different codes, depending on the mode it is in (8-bit, VT102,
+VT220, etc.). The result is that codes like <xF1> are no longer needed.
+Note: This is only done on startup. If the xterm options are changed after
+Vim has started, the escape sequences may not be recognized any more.
+
+ *termcap-colors*
+Note about colors: The 't_Co' option tells Vim the number of colors available.
+When it is non-zero, the 't_AB' and 't_AF' options are used to set the color.
+If one of these is not available, 't_Sb' and 't_Sf' are used. 't_me' is used
+to reset to the default colors.
+
+ *termcap-title*
+The 't_ts' and 't_fs' options are used to set the window title if the terminal
+allows title setting via sending strings. They are sent before and after the
+title string, respectively. Similar 't_IS' and 't_IE' are used to set the
+icon text. These are Vim-internal extensions of the Unix termcap, so they
+cannot be obtained from an external termcap. However, the builtin termcap
+contains suitable entries for xterm and iris-ansi, so you don't need to set
+them here.
+ *hpterm*
+If inversion or other highlighting does not work correctly, try setting the
+'t_xs' option to a non-empty string. This makes the 't_ce' code be used to
+remove highlighting from a line. This is required for "hpterm". Setting the
+'weirdinvert' option has the same effect as making 't_xs' non-empty, and vice
+versa.
+
+ *scroll-region*
+Some termcaps do not include an entry for 'cs' (scroll region), although the
+terminal does support it. For example: xterm on a Sun. You can use the
+builtin_xterm or define t_cs yourself. For example: >
+ :set t_cs=^V^[[%i%d;%dr
+Where ^V is CTRL-V and ^[ is <Esc>.
+
+The vertical scroll region t_CV is not a standard termcap code. Vim uses it
+internally in the GUI. But it can also be defined for a terminal, if you can
+find one that supports it. The two arguments are the left and right column of
+the region which to restrict the scrolling to. Just like t_cs defines the top
+and bottom lines. Defining t_CV will make scrolling in vertically split
+windows a lot faster. Don't set t_CV when t_da or t_db is set (text isn't
+cleared when scrolling).
+
+Unfortunately it is not possible to deduce from the termcap how cursor
+positioning should be done when using a scrolling region: Relative to the
+beginning of the screen or relative to the beginning of the scrolling region.
+Most terminals use the first method. A known exception is the MS-DOS console
+(pcterm). The 't_CS' option should be set to any string when cursor
+positioning is relative to the start of the scrolling region. It should be
+set to an empty string otherwise. It defaults to "yes" when 'term' is
+"pcterm".
+
+Note for xterm users: The shifted cursor keys normally don't work. You can
+ make them work with the xmodmap command and some mappings in Vim.
+
+ Give these commands in the xterm:
+ xmodmap -e "keysym Up = Up F13"
+ xmodmap -e "keysym Down = Down F16"
+ xmodmap -e "keysym Left = Left F18"
+ xmodmap -e "keysym Right = Right F19"
+
+ And use these mappings in Vim:
+ :map <t_F3> <S-Up>
+ :map! <t_F3> <S-Up>
+ :map <t_F6> <S-Down>
+ :map! <t_F6> <S-Down>
+ :map <t_F8> <S-Left>
+ :map! <t_F8> <S-Left>
+ :map <t_F9> <S-Right>
+ :map! <t_F9> <S-Right>
+
+Instead of, say, <S-Up> you can use any other command that you want to use the
+shift-cursor-up key for. (Note: To help people that have a Sun keyboard with
+left side keys F14 is not used because it is confused with the undo key; F15
+is not used, because it does a window-to-front; F17 is not used, because it
+closes the window. On other systems you can probably use them.)
+
+==============================================================================
+3. Window size *window-size*
+
+[This is about the size of the whole window Vim is using, not a window that is
+created with the ":split" command.]
+
+If you are running Vim on an Amiga and the terminal name is "amiga" or
+"builtin_amiga", the amiga-specific window resizing will be enabled. On Unix
+systems three methods are tried to get the window size:
+
+- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system)
+- the environment variables "LINES" and "COLUMNS"
+- from the termcap entries "li" and "co"
+
+If everything fails a default size of 24 lines and 80 columns is assumed. If
+a window-resize signal is received the size will be set again. If the window
+size is wrong you can use the 'lines' and 'columns' options to set the
+correct values.
+
+One command can be used to set the screen size:
+
+ *:mod* *:mode* *E359* *E362*
+:mod[e] [mode]
+
+Without argument this only detects the screen size and redraws the screen.
+With MS-DOS it is possible to switch screen mode. [mode] can be one of these
+values:
+ "bw40" 40 columns black&white
+ "c40" 40 columns color
+ "bw80" 80 columns black&white
+ "c80" 80 columns color (most people use this)
+ "mono" 80 columns monochrome
+ "c4350" 43 or 50 lines EGA/VGA mode
+ number mode number to use, depends on your video card
+
+==============================================================================
+4. Slow and fast terminals *slow-fast-terminal*
+ *slow-terminal*
+
+If you have a fast terminal you may like to set the 'ruler' option. The
+cursor position is shown in the status line. If you are using horizontal
+scrolling ('wrap' option off) consider setting 'sidescroll' to a small
+number.
+
+If you have a slow terminal you may want to reset the 'showcmd' option.
+The command characters will not be shown in the status line. If the terminal
+scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved
+off the screen (e.g., with "j") Vim will scroll 5 lines at a time. Another
+possibility is to reduce the number of lines that Vim uses with the command
+"z{height}<CR>".
+
+If the characters from the terminal are arriving with more than 1 second
+between them you might want to set the 'timeout' and/or 'ttimeout' option.
+See the "Options" chapter |options|.
+
+If your terminal does not support a scrolling region, but it does support
+insert/delete line commands, scrolling with multiple windows may make the
+lines jump up and down. If you don't want this set the 'ttyfast' option.
+This will redraw the window instead of scroll it.
+
+If your terminal scrolls very slowly, but redrawing is not slow, set the
+'ttyscroll' option to a small number, e.g., 3. This will make Vim redraw the
+screen instead of scrolling, when there are more than 3 lines to be scrolled.
+
+If you are using a color terminal that is slow, use this command: >
+ hi NonText cterm=NONE ctermfg=NONE
+This avoids that spaces are sent when they have different attributes. On most
+terminals you can't see this anyway.
+
+If you are using Vim over a slow serial line, you might want to try running
+Vim inside the "screen" program. Screen will optimize the terminal I/O quite
+a bit.
+
+If you are testing termcap options, but you cannot see what is happening,
+you might want to set the 'writedelay' option. When non-zero, one character
+is sent to the terminal at a time (does not work for MS-DOS). This makes the
+screen updating a lot slower, making it possible to see what is happening.
+
+==============================================================================
+5. Using the mouse *mouse-using*
+
+This section is about using the mouse on a terminal or a terminal window. How
+to use the mouse in a GUI window is explained in |gui-mouse|. For scrolling
+with a mouse wheel see |scroll-mouse-wheel|.
+
+Don't forget to enable the mouse with this commands: >
+ :set mouse=a
+Otherwise Vim won't recognize the mouse in all modes (See 'mouse').
+
+Currently the mouse is supported for Unix in an xterm window, in a Linux
+console (with GPM |gpm-mouse|), for MS-DOS and in a Windows console.
+Mouse clicks can be used to position the cursor, select an area and paste.
+
+These characters in the 'mouse' option tell in which situations the mouse will
+be used by Vim:
+ n Normal mode
+ v Visual mode
+ i Insert mode
+ c Command-line mode
+ h all previous modes when in a help file
+ a all previous modes
+ r for |hit-enter| prompt
+ A auto-select in Visual mode
+
+The default for 'mouse' is empty, the mouse is not used. Normally you would
+do: >
+ :set mouse=a
+to start using the mouse (this is equivalent to setting 'mouse' to "nvich").
+If you only want to use the mouse in a few modes or also want to use it for
+the two questions you will have to concatenate the letters for those modes.
+For example: >
+ :set mouse=nv
+Will make the mouse work in Normal mode and Visual mode. >
+ :set mouse=h
+Will make the mouse work in help files only (so you can use "g<LeftMouse>" to
+jump to tags).
+
+Whether the selection that is started with the mouse is in Visual mode or
+Select mode depends on whether "mouse" is included in the 'selectmode'
+option.
+
+In an xterm, with the currently active mode included in the 'mouse' option,
+normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key
+pressed go to the xterm. With the currently active mode not included in
+'mouse' all mouse clicks go to the xterm.
+
+ *xterm-clipboard*
+In the Athena and Motif GUI versions, when running in a terminal and there is
+access to the X-server (DISPLAY is set), the copy and paste will behave like
+in the GUI. If not, the middle mouse button will insert the unnamed register.
+In that case, here is how you copy and paste a piece of text:
+
+Copy/paste with the mouse and Visual mode ('mouse' option must be set, see
+above):
+1. Press left mouse button on first letter of text, move mouse pointer to last
+ letter of the text and release the button. This will start Visual mode and
+ highlight the selected area.
+2. Press "y" to yank the Visual text in the unnamed register.
+3. Click the left mouse button at the insert position.
+4. Click the middle mouse button.
+
+Shortcut: If the insert position is on the screen at the same time as the
+Visual text, you can do 2, 3 and 4 all in one: Click the middle mouse button
+at the insert position.
+
+Note: When the |-X| command line argument is used, Vim will not connect to the
+X server and copy/paste to the X clipboard (selection) will not work. Use the
+shift key with the mouse buttons to let the xterm do the selection.
+
+ *xterm-command-server*
+When the X-server clipboard is available, the command server described in
+|x11-clientserver| can be enabled with the --servername command line argument.
+
+ *xterm-copy-paste*
+NOTE: In some (older) xterms, it's not possible to move the cursor past column
+95. This is an xterm problem, not Vim's. Get a newer xterm |color-xterm|.
+
+Copy/paste in xterm with (current mode NOT included in 'mouse'):
+1. Press left mouse button on first letter of text, move mouse pointer to last
+ letter of the text and release the button.
+2. Use normal Vim commands to put the cursor at the insert position.
+3. Press "a" to start Insert mode.
+4. Click the middle mouse button.
+5. Press ESC to end Insert mode.
+(The same can be done with anything in 'mouse' if you keep the shift key
+pressed while using the mouse.)
+
+Note: if you lose the 8th bit when pasting (special characters are translated
+into other characters), you may have to do "stty cs8 -istrip -parenb" in your
+shell before starting Vim.
+
+Thus in an xterm the shift and ctrl keys cannot be used with the mouse. Mouse
+commands requiring the CTRL modifier can be simulated by typing the "g" key
+before using the mouse:
+ "g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click)
+ "g<RightMouse>" is "<C-RightMouse> ("CTRL-T")
+
+ *mouse-mode-table* *mouse-overview*
+A short overview of what the mouse buttons do, when 'mousemodel' is "extend":
+
+Normal Mode:
+event position selection change action ~
+ cursor window ~
+<LeftMouse> yes end yes
+<C-LeftMouse> yes end yes "CTRL-]" (2)
+<S-LeftMouse> yes no change yes "*" (2) *<S-LeftMouse>*
+<LeftDrag> yes start or extend (1) no *<LeftDrag>*
+<LeftRelease> yes start or extend (1) no
+<MiddleMouse> yes if not active no put
+<MiddleMouse> yes if active no yank and put
+<RightMouse> yes start or extend yes
+<S-RightMouse> yes no change yes "#" (2) *<S-RightMouse>*
+<C-RightMouse> no no change no "CTRL-T"
+<RightDrag> yes extend no *<RightDrag>*
+<RightRelease> yes extend no *<RightRelease>*
+
+Insert or Replace Mode:
+event position selection change action ~
+ cursor window ~
+<LeftMouse> yes (cannot be active) yes
+<C-LeftMouse> yes (cannot be active) yes "CTRL-O^]" (2)
+<S-LeftMouse> yes (cannot be active) yes "CTRL-O*" (2)
+<LeftDrag> yes start or extend (1) no like CTRL-O (1)
+<LeftRelease> yes start or extend (1) no like CTRL-O (1)
+<MiddleMouse> no (cannot be active) no put register
+<RightMouse> yes start or extend yes like CTRL-O
+<S-RightMouse> yes (cannot be active) yes "CTRL-O#" (2)
+<C-RightMouse> no (cannot be active) no "CTRL-O CTRL-T"
+
+In a help window:
+event position selection change action ~
+ cursor window ~
+<2-LeftMouse> yes (cannot be active) no "^]" (jump to help tag)
+
+When 'mousemodel' is "popup", these are different:
+
+Normal Mode:
+event position selection change action ~
+ cursor window ~
+<S-LeftMouse> yes start or extend (1) no
+<RightMouse> no popup menu no
+
+Insert or Replace Mode:
+event position selection change action ~
+ cursor window ~
+<S-LeftMouse> yes start or extend (1) no like CTRL-O (1)
+<RightMouse> no popup menu no
+
+(1) only if mouse pointer moved since press
+(2) only if click is in same buffer
+
+Clicking the left mouse button causes the cursor to be positioned. If the
+click is in another window that window is made the active window. When
+editing the command-line the cursor can only be positioned on the
+command-line. When in Insert mode Vim remains in Insert mode. If 'scrolloff'
+is set, and the cursor is positioned within 'scrolloff' lines from the window
+border, the text is scrolled.
+
+A selection can be started by pressing the left mouse button on the first
+character, moving the mouse to the last character, then releasing the mouse
+button. You will not always see the selection until you release the button,
+only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown
+immediately. Note that you can make the text scroll by moving the mouse at
+least one character in the first/last line in the window when 'scrolloff' is
+non-zero.
+
+In Normal, Visual and Select mode clicking the right mouse button causes the
+Visual area to be extended. When 'mousemodel' is "popup", the left button has
+to be used while keeping the shift key pressed. When clicking in a window
+which is editing another buffer, the Visual or Select mode is stopped.
+
+ *double-click*
+Double, triple and quadruple clicks are supported when the GUI is active,
+for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is
+available). For selecting text, extra clicks extend the selection:
+ click select ~
+ double word or % match *<2-LeftMouse>*
+ triple line *<3-LeftMouse>*
+ quadruple rectangular block *<4-LeftMouse>*
+Exception: In a Help window a double click jumps to help for the word that is
+clicked on.
+A double click on a word selects that word. 'iskeyword' is used to specify
+which characters are included in a word. A double click on a character
+that has a match selects until that match (like using "v%"). If the match is
+an #if/#else/#endif block, the selection becomes linewise.
+For MS-DOS and xterm the time for double clicking can be set with the
+'mousetime' option. For the other systems this time is defined outside of
+Vim.
+An example, for using a double click to jump to the tag under the cursor: >
+ :map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR>
+
+Dragging the mouse with a double click (button-down, button-up, button-down
+and then drag) will result in whole words to be selected. This continues
+until the button is released, at which point the selection is per character
+again.
+
+ *gpm-mouse*
+The GPM mouse is only supported when the |+mouse_gpm| feature was enabled at
+compile time. The GPM mouse driver (Linux console) does not support quadruple
+clicks.
+
+In Insert mode, when a selection is started, Vim goes into Normal mode
+temporarily. When Visual or Select mode ends, it returns to Insert mode.
+This is like using CTRL-O in Insert mode. Select mode is used when the
+'selectmode' option contains "mouse".
+
+ *drag-status-line*
+When working with several windows, the size of the windows can be changed by
+dragging the status line with the mouse. Point the mouse at a status line,
+press the left button, move the mouse to the new position of the status line,
+release the button. Just clicking the mouse in a status line makes that window
+the current window, without moving the cursor. If by selecting a window it
+will change position or size, the dragging of the status line will look
+confusing, but it will work (just try it).
+
+ *<MiddleRelease>* *<MiddleDrag>*
+Mouse clicks can be mapped. The codes for mouse clicks are:
+ code mouse button normal action ~
+ <LeftMouse> left pressed set cursor position
+ <LeftDrag> left moved while pressed extend selection
+ <LeftRelease> left released set selection end
+ <MiddleMouse> middle pressed paste text at cursor position
+ <MiddleDrag> middle moved while pressed -
+ <MiddleRelease> middle released -
+ <RightMouse> right pressed extend selection
+ <RightDrag> right moved while pressed extend selection
+ <RightRelease> right released set selection end
+ <X1Mouse> X1 button pressed - *X1Mouse*
+ <X1Drag> X1 moved while pressed - *X1Drag*
+ <X1Release> X1 button release - *X1Release*
+ <X2Mouse> X2 button pressed - *X2Mouse*
+ <X2Drag> X2 moved while pressed - *X2Drag*
+ <X2Release> X2 button release - *X2Release*
+
+The X1 and X2 buttons refer to the extra buttons found on some mice. The
+'Microsoft Explorer' mouse has these buttons available to the right thumb.
+Currently X1 and X2 only work on Win32 environments.
+
+Examples: >
+ :noremap <MiddleMouse> <LeftMouse><MiddleMouse>
+Paste at the position of the middle mouse button click (otherwise the paste
+would be done at the cursor position). >
+
+ :noremap <LeftRelease> <LeftRelease>y
+Immediately yank the selection, when using Visual mode.
+
+Note the use of ":noremap" instead of "map" to avoid a recursive mapping.
+>
+ :map <X1Mouse> <C-O>
+ :map <X2Mouse> <C-I>
+Map the X1 and X2 buttons to go forwards and backwards in the jump list, see
+|CTRL-O| and |CTRL-I|.
+
+ *mouse-swap-buttons*
+To swap the meaning of the left and right mouse buttons: >
+ :noremap <LeftMouse> <RightMouse>
+ :noremap <LeftDrag> <RightDrag>
+ :noremap <LeftRelease> <RightRelease>
+ :noremap <RightMouse> <LeftMouse>
+ :noremap <RightDrag> <LeftDrag>
+ :noremap <RightRelease> <LeftRelease>
+ :noremap g<LeftMouse> <C-RightMouse>
+ :noremap g<RightMouse> <C-LeftMouse>
+ :noremap! <LeftMouse> <RightMouse>
+ :noremap! <LeftDrag> <RightDrag>
+ :noremap! <LeftRelease> <RightRelease>
+ :noremap! <RightMouse> <LeftMouse>
+ :noremap! <RightDrag> <LeftDrag>
+ :noremap! <RightRelease> <LeftRelease>
+<
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
new file mode 100644
index 000000000..70747797e
--- /dev/null
+++ b/runtime/doc/tips.txt
@@ -0,0 +1,445 @@
+*tips.txt* For Vim version 7.0aa. Last change: 2004 Feb 17
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Tips and ideas for using Vim *tips*
+
+Don't forget to browse the user manual, it also contains lots of useful tips
+|usr_toc.txt|.
+
+Editing C programs |C-editing|
+Finding where identifiers are used |ident-search|
+Switching screens in an xterm |xterm-screens|
+Scrolling in Insert mode |scroll-insert|
+Smooth scrolling |scroll-smooth|
+Correcting common typing mistakes |type-mistakes|
+Counting words, lines, etc. |count-items|
+Restoring the cursor position |restore-position|
+Renaming files |rename-files|
+Speeding up external commands |speed-up|
+Useful mappings |useful-mappings|
+Compressing the help files |gzip-helpfile|
+Hex editing |hex-editing|
+Executing shell commands in a window |shell-window|
+Using <> notation in autocommands |autocmd-<>|
+
+==============================================================================
+Editing C programs *C-editing*
+
+There are quite a few features in Vim to help you edit C program files. Here
+is an overview with tags to jump to:
+
+|usr_29.txt| Moving through programs chapter in the user manual.
+|usr_30.txt| Editing programs chapter in the user manual.
+|C-indenting| Automatically set the indent of a line while typing
+ text.
+|=| Re-indent a few lines.
+|format-comments| Format comments.
+
+|:checkpath| Show all recursively included files.
+|[i| Search for identifier under cursor in current and
+ included files.
+|[_CTRL-I| Jump to match for "[i"
+|[I| List all lines in current and included files where
+ identifier under the cursor matches.
+|[d| Search for define under cursor in current and included
+ files.
+
+|CTRL-]| Jump to tag under cursor (e.g., definition of a
+ function).
+|CTRL-T| Jump back to before a CTRL-] command.
+|:tselect| Select one tag out of a list of matching tags.
+
+|gd| Go to Declaration of local variable under cursor.
+|gD| Go to Declaration of global variable under cursor.
+
+|gf| Go to file name under the cursor.
+
+|%| Go to matching (), {}, [], /* */, #if, #else, #endif.
+|[/| Go to previous start of comment.
+|]/| Go to next end of comment.
+|[#| Go back to unclosed #if, #ifdef, or #else.
+|]#| Go forward to unclosed #else or #endif.
+|[(| Go back to unclosed '('
+|])| Go forward to unclosed ')'
+|[{| Go back to unclosed '{'
+|]}| Go forward to unclosed '}'
+
+|v_ab| Select "a block" from "[(" to "])", including braces
+|v_ib| Select "inner block" from "[(" to "])"
+|v_aB| Select "a block" from "[{" to "]}", including brackets
+|v_iB| Select "inner block" from "[{" to "]}"
+
+==============================================================================
+Finding where identifiers are used *ident-search*
+
+You probably already know that |tags| can be used to jump to the place where a
+function or variable is defined. But sometimes you wish you could jump to all
+the places where a function or variable is being used. This is possible in
+two ways:
+1. Using the |:grep| command. This should work on most Unix systems,
+ but can be slow (it reads all files) and only searches in one directory.
+2. Using ID utils. This is fast and works in multiple directories. It uses a
+ database to store locations. You will need some additional programs for
+ this to work. And you need to keep the database up to date.
+
+Using the GNU id-tools:
+
+What you need:
+- The GNU id-tools installed (mkid is needed to create ID and lid is needed to
+ use the macros).
+- An identifier database file called "ID" in the current directory. You can
+ create it with the shell command "mkid file1 file2 ..".
+
+Put this in your .vimrc: >
+ map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR>
+ map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR>
+
+ function! ID_search()
+ let g:word = expand("<cword>")
+ let x = system("lid --key=none ". g:word)
+ let x = substitute(x, "\n", " ", "g")
+ execute "next " . x
+ endfun
+
+To use it, place the cursor on a word, type "_u" and vim will load the file
+that contains the word. Search for the next occurrence of the word in the
+same file with "n". Go to the next file with "_n".
+
+This has been tested with id-utils-3.2 (which is the name of the id-tools
+archive file on your closest gnu-ftp-mirror).
+
+[the idea for this comes from Andreas Kutschera]
+
+==============================================================================
+Switching screens in an xterm *xterm-screens* *xterm-save-screen*
+
+(From comp.editors, by Juergen Weigert, in reply to a question)
+
+:> Another question is that after exiting vim, the screen is left as it
+:> was, i.e. the contents of the file I was viewing (editing) was left on
+:> the screen. The output from my previous like "ls" were lost,
+:> ie. no longer in the scrolling buffer. I know that there is a way to
+:> restore the screen after exiting vim or other vi like editors,
+:> I just don't know how. Helps are appreciated. Thanks.
+:
+:I imagine someone else can answer this. I assume though that vim and vi do
+:the same thing as each other for a given xterm setup.
+
+They not necessarily do the same thing, as this may be a termcap vs.
+terminfo problem. You should be aware that there are two databases for
+describing attributes of a particular type of terminal: termcap and
+terminfo. This can cause differences when the entries differ AND when of
+the programs in question one uses terminfo and the other uses termcap
+(also see |+terminfo|).
+
+In your particular problem, you are looking for the control sequences
+^[[?47h and ^[[?47l. These switch between xterms alternate and main screen
+buffer. As a quick workaround a command sequence like >
+ echo -n "^[[?47h"; vim ... ; echo -n "^[[?47l"
+may do what you want. (My notation ^[ means the ESC character, further down
+you'll see that the databases use \E instead).
+
+On startup, vim echoes the value of the termcap variable ti (terminfo:
+smcup) to the terminal. When exiting, it echoes te (terminfo: rmcup). Thus
+these two variables are the correct place where the above mentioned control
+sequences should go.
+
+Compare your xterm termcap entry (found in /etc/termcap) with your xterm
+terminfo entry (retrieved with /usr/5bin/infocmp -C xterm). Both should
+contain entries similar to: >
+ :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:
+
+PS: If you find any difference, someone (your sysadmin?) should better check
+ the complete termcap and terminfo database for consistency.
+
+NOTE 1: If you recompile Vim with FEAT_XTERM_SAVE defined in feature.h, the
+builtin xterm will include the mentioned "te" and "ti" entries.
+
+NOTE 2: If you want to disable the screen switching, and you don't want to
+change your termcap, you can add these lines to your .vimrc: >
+ :set t_ti= t_te=
+
+==============================================================================
+Scrolling in Insert mode *scroll-insert*
+
+If you are in insert mode and you want to see something that is just off the
+screen, you can use CTRL-X CTRL-E and CTRL-X CTRL-Y to scroll the screen.
+ |i_CTRL-X_CTRL-E|
+
+To make this easier, you could use these mappings: >
+ :inoremap <C-E> <C-X><C-E>
+ :inoremap <C-Y> <C-X><C-Y>
+(Type this literally, make sure the '<' flag is not in 'cpoptions').
+You then lose the ability to copy text from the line above/below the cursor
+|i_CTRL-E|.
+
+Also consider setting 'scrolloff' to a larger value, so that you can always see
+some context around the cursor. If 'scrolloff' is bigger than half the window
+height, the cursor will always be in the middle and the text is scrolled when
+the cursor is moved up/down.
+
+==============================================================================
+Smooth scrolling *scroll-smooth*
+
+If you like the scrolling to go a bit smoother, you can use these mappings: >
+ :map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y>
+ :map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
+
+(Type this literally, make sure the '<' flag is not in 'cpoptions').
+
+==============================================================================
+Correcting common typing mistakes *type-mistakes*
+
+When there are a few words that you keep on typing in the wrong way, make
+abbreviations that correct them. For example: >
+ :ab teh the
+ :ab fro for
+
+==============================================================================
+Counting words, lines, etc. *count-items*
+
+To count how often any pattern occurs in a buffer, set 'report' to 0, and use
+the substitute command to replace the pattern with itself. The reported
+number of substitutions is the number of items. Examples: >
+
+ :set report=0
+ :%s/./&/g characters
+ :%s/\i\+/&/g words
+ :%s/^ lines
+ :%s/the/&/g "the" anywhere
+ :%s/\<the\>/&/g "the" as a word
+
+You might want to reset 'hlsearch' or do ":nohlsearch".
+
+This does not work if the 'modifiable' option is off. An alternative is using
+|v_g_CTRL-G| in Visual mode.
+
+ *count-bytes*
+If you want to count bytes, you can use this:
+
+ Visually select the characters (block is also possible)
+ Use "y" to yank the characters
+ Use the strlen() function: >
+ :echo strlen(@")
+A line break is counted for one byte.
+
+==============================================================================
+Restoring the cursor position *restore-position*
+
+Sometimes you want to write a mapping that makes a change somewhere in the
+file and restores the cursor position, without scrolling the text. For
+example, to change the date mark in a file: >
+ :map <F2> msHmtgg/Last [cC]hange:\s*/e+1<CR>"_D"=strftime("%Y %b %d")<CR>p'tzt`s
+
+Breaking up saving the position:
+ ms store cursor position in the 's' mark
+ H go to the first line in the window
+ mt store this position in the 't' mark
+
+Breaking up restoring the position:
+ 't go to the line previously at the top of the window
+ zt scroll to move this line to the top of the window
+ `s jump to the original position of the cursor
+
+==============================================================================
+Renaming files *rename-files*
+
+Say I have a directory with the following files in them (directory picked at
+random :-):
+
+buffer.c
+charset.c
+digraph.c
+...
+
+and I want to rename *.c *.bla. I'd do it like this: >
+
+ $ vim
+ :r! ls *.c
+ :%s/\(.*\).c/mv & \1.bla
+ :w !sh
+ :q!
+
+==============================================================================
+Speeding up external commands *speed-up*
+
+In some situations, execution of an external command can be very slow. This
+can also slow down wildcard expansion on Unix. Here are a few suggestions to
+increase the speed.
+
+If your .cshrc (or other file, depending on the shell used) is very long, you
+should separate it into a section for interactive use and a section for
+non-interactive use (often called secondary shells). When you execute a
+command from Vim like ":!ls", you do not need the interactive things (for
+example, setting the prompt). Put the stuff that is not needed after these
+lines: >
+
+ if ($?prompt == 0) then
+ exit 0
+ endif
+
+Another way is to include the "-f" flag in the 'shell' option, e.g.: >
+
+ :set shell=csh\ -f
+
+(the backslash is needed to include the space in the option).
+This will make csh completely skip the use of the .cshrc file. This may cause
+some things to stop working though.
+
+==============================================================================
+Useful mappings *useful-mappings*
+
+Here are a few mappings that some people like to use.
+
+ *map-backtick* >
+ :map ' `
+Make the single quote work like a backtick. Puts the cursor on the column of
+a mark, instead of going to the first non-blank character in the line.
+
+ *emacs-keys*
+For Emacs-style editing on the command-line: >
+ " start of line
+ :cnoremap <C-A> <Home>
+ " back one character
+ :cnoremap <C-B> <Left>
+ " delete character under cursor
+ :cnoremap <C-D> <Del>
+ " end of line
+ :cnoremap <C-E> <End>
+ " forward one character
+ :cnoremap <C-F> <Right>
+ " recall newer command-line
+ :cnoremap <C-N> <Down>
+ " recall previous (older) command-line
+ :cnoremap <C-P> <Up>
+ " back one word
+ :cnoremap <Esc><C-B> <S-Left>
+ " forward one word
+ :cnoremap <Esc><C-F> <S-Right>
+
+NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>|
+
+ *format-bullet-list*
+This mapping will format any bullet list. It requires that there is an empty
+line above and below each list entry. The expression commands are used to
+be able to give comments to the parts of the mapping. >
+
+ :let m = ":map _f :set ai<CR>" " need 'autoindent' set
+ :let m = m . "{O<Esc>" " add empty line above item
+ :let m = m . "}{)^W" " move to text after bullet
+ :let m = m . "i <CR> <Esc>" " add space for indent
+ :let m = m . "gq}" " format text after the bullet
+ :let m = m . "{dd" " remove the empty line
+ :let m = m . "5lDJ" " put text after bullet
+ :execute m |" define the mapping
+
+(<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not
+CTRL-W. You can copy/paste this into Vim if '<' is not included in
+'cpoptions')
+
+Note that the last comment starts with |", because the ":execute" command
+doesn't accept a comment directly.
+
+You also need to set 'textwidth' to a non-zero value, e.g., >
+ :set tw=70
+
+A mapping that does about the same, but takes the indent for the list from the
+first line (Note: this mapping is a single long line with a lot of spaces): >
+ :map _f :set ai<CR>}{a <Esc>WWmmkD`mi<CR><Esc>kkddpJgq}'mJO<Esc>j
+<
+ *collapse*
+These two mappings reduce a sequence of empty (;b) or blank (;n) lines into a
+single line >
+ :map ;b GoZ<Esc>:g/^$/.,/./-j<CR>Gdd
+ :map ;n GoZ<Esc>:g/^[ <Tab>]*$/.,/[^ <Tab>]/-j<CR>Gdd
+
+==============================================================================
+Compressing the help files *gzip-helpfile*
+
+For those of you who are really short on disk space, you can compress the help
+files and still be able to view them with Vim. This makes accessing the help
+files a bit slower and requires the "gzip" program.
+
+(1) Compress all the help files: "gzip doc/*.txt".
+
+(2) Edit "doc/tags" and change the ".txt" to ".txt.gz": >
+ :%s=\(\t.*\.txt\)\t=\1.gz\t=
+
+(3) Add this line to your vimrc: >
+ set helpfile={dirname}/help.txt.gz
+
+Where {dirname} is the directory where the help files are. The |gzip| plugin
+will take care of decompressing the files.
+You must make sure that $VIMRUNTIME is set to where the other Vim files are,
+when they are not in the same location as the compressed "doc" directory. See
+|$VIMRUNTIME|.
+
+==============================================================================
+Executing shell commands in a window *shell-window*
+
+There have been questions for the possibility to execute a shell in a window
+inside Vim. The answer: you can't! Including this would add a lot of code to
+Vim, which is a good reason not to do this. After all, Vim is an editor, it
+is not supposed to do non-editing tasks. However, to get something like this,
+you might try splitting your terminal screen or display window with the
+"splitvt" program. You can probably find it on some ftp server. The person
+that knows more about this is Sam Lantinga <slouken@cs.ucdavis.edu>.
+An alternative is the "window" command, found on BSD Unix systems, which
+supports multiple overlapped windows. Or the "screen" program, found at
+www.uni-erlangen.de, which supports a stack of windows.
+
+==============================================================================
+Hex editing *hex-editing* *using-xxd*
+
+See section |23.4| of the user manual.
+
+If one has a particular extension that one uses for binary files (such as exe,
+bin, etc), you may find it helpful to automate the process with the following
+bit of autocmds for your <.vimrc>. Change that "*.bin" to whatever
+comma-separated list of extension(s) you find yourself wanting to edit: >
+
+ " vim -b : edit binary using xxd-format!
+ augroup Binary
+ au!
+ au BufReadPre *.bin let &bin=1
+ au BufReadPost *.bin if &bin | %!xxd
+ au BufReadPost *.bin set ft=xxd | endif
+ au BufWritePre *.bin if &bin | %!xxd -r
+ au BufWritePre *.bin endif
+ au BufWritePost *.bin if &bin | %!xxd
+ au BufWritePost *.bin set nomod | endif
+ augroup END
+
+==============================================================================
+Using <> notation in autocommands *autocmd-<>*
+
+The <> notation is not recognized in the argument of an :autocmd. To avoid
+having to use special characters, you could use a self-destroying mapping to
+get the <> notation and then call the mapping from the autocmd. Example:
+
+ *map-self-destroy* >
+ " This is for automatically adding the name of the file to the menu list.
+ " It uses a self-destroying mapping!
+ " 1. use a line in the buffer to convert the 'dots' in the file name to \.
+ " 2. store that in register '"'
+ " 3. add that name to the Buffers menu list
+ " WARNING: this does have some side effects, like overwriting the
+ " current register contents and removing any mapping for the "i" command.
+ "
+ autocmd BufNewFile,BufReadPre * nmap i :nunmap i<CR>O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><CR><CR>
+ autocmd BufNewFile,BufReadPre * normal i
+
+Another method, perhaps better, is to use the ":execute" command. In the
+string you can use the <> notation by preceding it with a backslash. Don't
+forget to double the number of existing backslashes and put a backslash before
+'"'.
+>
+ autocmd BufNewFile,BufReadPre * exe "normal O\<C-R>%\<Esc>:.g/\\./s/\\./\\\\./g\<CR>0\"9y$u:menu Buffers.\<C-R>9 :buffer \<C-R>%\<C-V>\<CR>\<CR>"
+
+For a real buffer menu, user functions should be used (see |:function|), but
+then the <> notation isn't used, which defeats using it as an example here.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
new file mode 100644
index 000000000..c8b9576f6
--- /dev/null
+++ b/runtime/doc/todo.txt
@@ -0,0 +1,3441 @@
+*todo.txt* For Vim version 7.0aa. Last change: 2004 Jun 13
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ TODO list for Vim *todo*
+
+This is a veeeery long list of known bugs, current work and desired
+improvements. To make it a little bit accessible, the items are grouped by
+subject. In the first column of the line a classification is used to be able
+to look for "the next thing to do":
+
+Priority classification:
+9 next point release
+8 next release
+7 as soon as possible
+6 soon
+5 should be included
+4 nice to have
+3 consider including
+2 maybe not
+1 probably not
+- unclassified
+
+ *votes-for-changes*
+See |develop.txt| for development plans. You can vote for which items should
+be worked on, but only if you sponsor Vim development. See |sponsor|.
+
+ *known-bugs*
+-------------------- Known bugs and current work -----------------------
+
+GTK2: font dialog uses font size zero when 'guifont' is "Courier". Patch from
+Yasuhiro Matsumoto, 2004 June 8.
+
+Python indent: # aser: still adds extra indent.
+
+
+For version 7.0:
+- Include many PATCHES:
+ - Include the kvim patch. http://freenux.org/vim/ (Mickael Marchand)
+ Do not add Qtopia yet, it doesn't work very well.
+- new DATA TYPES: lists, dictionaries and function references.
+ Add type checking? See ~/vim/ideas.txt.
+- Add SPELLCHECKER, with easy to add support for many languages.
+- REFACTORING: The main() function is very long. Move parts to separate
+ functions, especially loops. Ideas from Walter Briscoe (2003 Apr 3, 2004
+ Feb 9).
+- Store messages to allow SCROLLING BACK for all commands. And other "less"
+ like commands.
+- "INTELLISENSE". First cleanup the Insert-mode completion.
+ http://www.vim.org/scripts/script.php?script_id=747
+ http://sourceforge.net/projects/insenvim
+- PERSISTENT UNDO: store undo in a file.
+ Support multiple threads. Show the list of changes in a window to be able
+ to select a version.
+7 SWAP FILE CHANGE: When a dos format file was edited with ":e ++ff=unix",
+ Vim is killed and trying to recover the file, 'ff' will be dos. Same for
+ non-default fileencoding. (Miroslaw Dobrzanski-Neumann, Jul 17)
+ Should store the values in block 0 of the swap file, but that is an
+ incompatible change.
+7 Support WINDOW TABS. Works like several pages, each with their own
+ split windows. Patch for GTK 1.2 from Christian Michon, 2004 Jan 6.
+ Also for the console!
+- EMBEDDING: Make it possible to run Vim inside a window of another program.
+ For Xwindows this can be done with XReparentWindow().
+ For GTK Neil Bird has a patch to use Vim like a widget.
+- Add COLUMN NUMBERS to ":" commands ":line1,line2[col1,col2]cmd". Block
+ can be selected with CTRL-V. Allow '$' (end of line) for col2.
+- Add DEBUGGER INTERFACE. Implementation for gdb by Xavier de Gaye,
+ assisted by Mikolaj Machowski. Should work like an IDE. Try to keep it
+ generic. Also found here: http://skawina.eu.org/mikolaj/vimgdb
+ To be able to start the debugger from inside Vim: For GUI run a program
+ with a netbeans connection; for console: start a program that splits the
+ terminal, runs the debugger in one window and reconnect Vim I/O to the
+ other window.
+ Wishes for NetBeans commands:
+ - make it possible to have 'defineAnnoType' also handle terminal colors.
+ - send 'balloonText' events for the cursor position (using CursorHold ?)
+ in terminal mode.
+- STICKY CURSOR: Add a way of scrolling that leaves the cursor where it is.
+ Especially when using the scrollbar. Typing a cursor-movement command
+ scrolls back to where the cursor is.
+
+
+Vi incompatibility:
+8 With undo/redo only marks in the changed lines should be changed. Other
+ marks should be kept. Vi keeps each mark at the same text, even when it
+ is deleted or restored. (Webb)
+ Also: A mark is lost after: make change, undo, redo and undo.
+ Example: "{d''" then "u" then "d''": deletes an extra line, because the ''
+ position is one line down. (Veselinovic)
+8 ":change" in a single-line file adds an empty line. When the file used to
+ be longer a "~" line is displayed, but there really is an empty line.
+ (Haakon Riiser, 2003 Dec 3 and Dec 16)
+8 ":append" and ":insert" in an empty file add an extra empty line. (Haakon
+ Riiser, 2003 Dec 3) Test for ML_EMPTY.
+8 When stdin is not a tty, and Vim reads commands from it, an error should
+ make Vim exit.
+7 Unix Vim (not gvim): Typing CTRL-C in Ex mode should finish the line
+ (currently you can continue typing, but it's truncated later anyway).
+ Requires a way to make CTRL-C interrupt select() when in cooked input.
+8 When loading a file in the .exrc, Vi loads the argument anyway. Vim skips
+ loading the argument if there is a file already. When no file argument
+ given, Vi starts with an empty buffer, Vim keeps the loaded file. (Bearded)
+6 In Insert mode, when using <BS> or <Del>, don't wipe out the text, but
+ only move back the cursor. Behaves like '$' in 'cpoptions'. Use a flag
+ in 'cpoptions' to switch this on/off.
+8 When editing a file which is a symbolic link, and then opening another
+ symbolic link on the same file, Vim uses the name of the first one.
+ Adjust the file name in the buffer to the last one used? Use several file
+ names in one buffer???
+ Also: When first editing file "test", which is symlink to "test2", and
+ then editing "test2", you end up editing buffer "test" again. It's not
+ logical that the name that was first used sticks with the buffer.
+7 The ":undo" command works differently in Ex mode. Edit a file, make some
+ changes, "Q", "undo" and _all_ changes are undone, like the ":visual"
+ command was one command.
+7 The ":map" command output overwrites the command. Perhaps it should keep
+ the ":map" when it's used without arguments?
+7 CTRL-L is not the end of a section? It is for Posix! Make it an option.
+7 Implement 'prompt' option. Init to off when stdin is not a tty.
+7 CTRL-T in Insert mode inserts 'shiftwidth' of spaces at the cursor. Add a
+ flag in 'cpoptions' for this.
+7 Add a way to send an email for a crashed edit session. Create a file when
+ making changes (containing name of the swap file), delete it when writing
+ the file. Supply a program that can check for crashed sessions (either
+ all, for a system startup, or for one user, for in a .login file).
+7 Vi doesn't do autoindenting when input is not from a tty (in Ex mode).
+7 "z3<CR>" should still use the whole window, but only redisplay 3 lines.
+7 ":tag xx" should move the cursor to the first non-blank. Or should it go
+ to the match with the tag? Option?
+7 Implement 'autoprint'/'ap' option.
+7 Add flag in 'cpoptions' that makes <BS> after a count work like <Del>
+ (Sayre).
+7 Add flag in 'cpoptions' that makes operator (yank, filter) not move the
+ cursor, at least when cancelled. (default Vi compatible).
+7 Make "5dd" on last-but-one-line not delete anything (Vi compatible).
+ Add flag in 'cpoptions' for this. When not present, "2dd" in the last
+ line should delete the last line. Patch from greenx 2002 Apr 11.
+7 This Vi-trick doesn't work: "Q" to go to Ex mode, then "g/pattern/visual".
+ In Vi you can edit in visual mode, and when doing "Q" you jump to the next
+ match. Nvi can do it too.
+7 Support '\' for line continuation in Ex mode for these commands: (Luebking)
+ g/./a\ g/pattern1/ s/pattern2/rep1\\
+ line 1\ line 2\\
+ line 2\ line 3\\
+ . line4/
+6 ":e /tmp/$tty" doesn't work. ":e $uid" does. Is $tty not set because of
+ the way the shell is started?
+6 Vi compatibility (optional): make "ia<CR><ESC>10." do the same strange
+ thing. (only repeat insert for the first line).
+
+
+GTK+ 1 (OK in GTK 2):
+8 When menus are disabled, 'm' removed from 'guioptions', Alt-F still pops
+ up the File menu. Cannot reproduce this: gives a warning for a NULL
+ pointer if the menu was never displayed.
+8 When using "gvim -geom 40x30" or setting 'columns' in .gvimrc or with a
+ GUIEnter autocommand, the width is still set to fit the toolbar. Also
+ happens when changing the font. How to avoid that the toolbar specifies
+ the minimal window width?
+8 When using a theme with different scrollbars (gtkstep), the scrollbars can
+ be too narrow. (Drazen Kacar)
+8 Font "7x14" has a bold version "7x14bold". Try to find the bold font by
+ appending "bold" when there are not 14 dashes.
+
+GTK+ GUI known bugs:
+8 GTK 2: Combining UTF-8 characters not displayed properly in menus (Mikolaj
+ Machowski) They are displayed as separate characters. Problem in
+ creating a label?
+9 Can't paste a Visual selection from GTK-gvim to vim in xterm or Motif gvim
+ when it is longer than 4000 characters. Works OK from gvim to gvim and
+ vim to vim. Pasting through xterm (using the shift key) also works.
+ It starts working after GTK gvim loses the selection and gains it again.
+7 DND doesn't work with KDE (also with GTK 1).
+
+
+Win32 GUI known bugs:
+8 On Windows 98 the unicows library is needed to support functions with UCS2
+ file names. Can we load unicows.dll dynamically?
+8 The -P argument doesn't work very well with many MDI applications.
+ The last argument of CreateWindowEx() should be used, see MSDN docs.
+ Tutorial: http://win32assembly.online.fr/tut32.html
+8 In eval.c, io.h is included when MSWIN32 is defined. Shouldn't this be
+ WIN32? Or can including io.h be moved to vim.h? (Dan Sharp)
+7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
+ pixels remains when typing spaces in front of a "D" ('guifont' set to
+ "lucida_console:h8").
+6 Win32 GUI: With "-u NONE -U NONE" and doing "CTRL-W v" "CTRL-W o", the ":"
+ of ":only" is highlighted like the cursor. (Lipelis)
+7 When font smoothing is enabled, redrawing can become very slow. The reason
+ appears to be drawing with a transparent background. Would it be possible
+ to use an opaque background in most places?
+8 Use another default for 'termencoding': the active codepage. Means that
+ when 'encoding' is changed typing characters still works properly.
+ Alternative: use the Unicode functions to obtain typed characters.
+8 Win32: Multi-byte characters are not displayed, even though the same font
+ in Notepad can display them. (Srinath Avadhanula) Try with the
+ UTF-8-demo.txt page with Andale Mono.
+7 The cursor color indicating IME mode doesn't work properly. (Shizhu Pan,
+ 2004 May 9)
+8 Win32: When clicking on the gvim title bar, which gives it focus, produces
+ a file-changed dialog, after clicking on a button in that dialog the gvim
+ window follows the mouse. The button-up event is lost. Only with
+ MS-Windows 98?
+ Try this: ":set sw ts", get enter-prompt, then change the file in a
+ console, go back to Vim and click "reload" in the dialog for the changed
+ file: Window moves with the cursor!
+ Put focus event in input buffer and let generic Vim code handle it?
+8 When activating the Vim window with mouse click, don't move cursor to
+ mouse position. Catch WM_MOUSEACTIVATE. (Luevelsmeyer)
+9 The print dialog uses a font which doesn't display multi-byte messages.
+ Include patch from Vipin Aravind? Update from Yasuhiro Matsumoto.
+8 Win32: When mouse is hidden and in the toolbar, moving it won't make it
+ appear. (Sami Salonen)
+8 Windows NT: writing to aux.* makes Vim hang. (Acevedo)
+8 Win32 GUI: With maximized window, ":set go-=r" doesn't use the space that
+ comes available. (Poucet) It works OK on Win 98 but doesn't work on Win
+ NT 4.0. Leaves a grey area where the scrollbar was. ":set go+=r" also
+ doesn't work properly.
+8 When Vim is minimized and when maximizing it a file-changed dialog pops
+ up, Vim isn't maximized. It should be done before the dialog, so that it
+ appears in the right position. (Webb)
+9 When selecting at the more-prompt or hit-enter-prompt, the right mouse
+ button doesn't give popup menu.
+ At the hit-enter prompt CTRL-Y doesn't work to copy the modeless
+ selection.
+ On the command line, don't get a popup menu for the right mouse button.
+ Let the middle button paste selected text (not the clipboard but the
+ non-Visual selection)? Otherwise CTRL-Y has to be used to copy the text.
+8 When 'grepprg' doesn't execute, the error only flashes by, the
+ user can hardly see what is wrong. (Moore)
+ Could use vimrun with an "-nowait" argument to only wait when an error
+ occurs, but "command.com" doesn't return an error code.
+8 When the 'shell' cannot be executed, should give an appropriate error msg.
+ Esp. for a filter command, currently it only complains the file could not
+ be read.
+8 MessageBox used for error messages can be too big. There is no way to
+ scroll it, or even hit the OK button (but you can hit return).
+ Use a scrollable window.
+7 Add an option to add one pixel column to the character width? Lucida
+ Console italic is wider than the normal font ("d" overlaps with next char).
+ Opposite of 'linespace': 'columnspace'.
+7 At the hit-enter prompt scrolling now no longer works. Need to use the
+ keyboard to get around this. Pretend <CR> was hit when the user tries to
+ scroll? Need to be able to get out of hit-enter prompt with the mouse
+ anyway.
+7 Scrollbar width doesn't change when selecting other windows appearance.
+ Also background color of Toolbar and rectangle below vert. scrollbar.
+7 "!start /min cmd" should run in a minimized window, instead of using
+ "/min" as the command name. (Rogall)
+6 Drawing text transparently doesn't seem to work (when drawing part cursor).
+8 CTRL key doesn't always work in combination with ALT key. It does work
+ for function keys, not for alphabetic characters. Perhaps this is because
+ CTRL-ALT is used by Windows as AltGr?
+8 CTRL-- doesn't work for AZERTY, because it's CTRL-[ for QWERTY. How do we
+ know which keyboard is being used?
+7 When scrolling, and a background color is dithered, the dither pattern
+ doesn't always join correctly between the scrolled area and the new drawn
+ area (Koloseike).
+8 When gui_init_font() is called with "*", p_guifont is freed while it might
+ still be used somewhere. This is too tricky, do the font selection first,
+ then set the new font by name (requires putting all logfont parameters in
+ the font name).
+
+
+Athena and Motif:
+9 Can configure be changed to disable netbeans if the Xpm library is
+ required and it's missing?
+8 When using the resource "Vim*borderwidth 2" the widgets are positioned
+ wrong.
+9 XIM is disabled by default for SGI/IRIX. Fix XIM so that 'imdisable' can
+ be off by default.
+9 XIM doesn't work properly for Athena/Motif. (Yasuhiro Matsumoto) For now,
+ keep XIM active at all times when the input method has the preediting
+ flag.
+8 X11: A menu that contains an umlaut is truncated at that character.
+ Happens when the locale is "C", which uses ASCII instead of IS0-8859-1.
+ Is there a way to use latin1 by default? Gnome_init() seems to do this.
+8 Perhaps use fontsets for everything?
+6 When starting in English and switching the language to Japanese, setting
+ the locale with ":lang", 'guifontset' and "hi menu font=", deleting all
+ menus and setting them again, the menus don't use the new font. Most of
+ the tooltips work though...
+7 Motif: when using a file selection dialog, the specified file name is not
+ always used (when specifying a filter or another directory).
+8 When 'encoding' is different from the current locale (e.g., utf-8) the
+ menu strings don't work. Requires conversion from 'encoding' to the
+ current locale. Workaround: set 'langmenu'.
+
+
+Athena GUI:
+9 When dragging the scrollbar thumb very fast, focus is only obtained in
+ the scrollbar itself. And the thumb is no longer updated when moving
+ through files.
+7 The file selector is not resizable. With a big font it is difficult to
+ read long file names. (Schroeder)
+4 Re-write the widget attachments and code so that we will not have to go
+ through and calculate the absolute position of every widget every time the
+ window is refreshed/changes size. This will help the "flashing-widgets"
+ problem during a refresh.
+5 When starting gvim with all the default colors and then typing
+ ":hi Menu guibg=cyan", the menus change color but the background of the
+ pullright pixmap doesn't change colors.
+ If you type ":hi Menu guibg=cyan font=anyfont", then the pixmap changes
+ colors as it should.
+ Allocating a new pixmap and setting the resource doesn't change the
+ pullright pixmap's colors. Why? Possible Athena bug?
+
+
+Motif GUI:
+8 Popup menu ordering is wrong.
+8 Accelerators don't work in a dialog. Include patch from Martin Dalecki
+ (Jan 3, tested by David Harrison). Should work with Alt-o then.
+7 Use accelerators for the Motif file selection dialog. Patch from Martin
+ Dalecki 2002 Jan 11.
+7 Use XmStringCreateLocalized() instead of XmStringCreateSimple()?
+ David Harrison says it's OK (it exists in Motif 1.2).
+8 The texts in the find/replace dialog don't use the right font.
+8 Lesstif: When deleting a menu that's torn off, the torn off menu becomes
+ very small instead of disappearing. When closing it, Vim crashes.
+ (Phillipps)
+
+
+GUI:
+9 On Solaris, creating the popup menu causes the right mouse button no
+ longer to work for extending the selection. (Halevy)
+9 When running an external program, it can't always be killed with CTRL-C.
+ e.g. on Solaris 5.5, when using "K" (Keech). Other 'guipty' problems on
+ Solaris 2.6. (Marley)
+9 On Solaris: Using a "-geometry" argument, bigger than the window where Vim
+ is started from, causes empty lines below the cmdline. (raf)
+8 X11 GUI: When menu is disabled by excluding 'm' from 'guioptions', ALT key
+ should not be used to trigger a menu (like the Win32 version).
+8 When setting 'langmenu', it should be effective immediately. Store both
+ the English and the translated text in the menu structure. Re-generate
+ the translation when 'langmenu' has changed.
+8 Basic flaw in the GUI code: NextScreen is updated before calling
+ gui_write(), but the GUI code relies on NextScreen to represent the state
+ of where it is processing the output.
+ Need better separation of Vim core and GUI code.
+8 When fontset support is enabled, setting 'guifont' to a single font
+ doesn't work.
+8 Menu priority for sub-menus for: Amiga, BeOS.
+8 Add menu separators for Amiga, RISCOS.
+8 Add a few more command names. Patch from Jiri Brezina (28 feb 2002).
+8 Add way to specify the file filter for the browse dialog. At least for
+ browse().
+8 Add dialog for search/replace to other GUIs? Tk has something for this,
+ use that code? Or use console dialog.
+8 When selecting a font with the font dialog and the font is invalid, the
+ error message disappears too quick.
+8 gui_check_colors() is not called at the right moment. Do it much later,
+ to avoid problems.
+8 gui_update_cursor() is called for a cursor shape change, even when there
+ are mappings to be processed. Only do something when going to wait for
+ input. Or maybe every 100 ms?
+8 X11: When the window size is reduced to fit on screen, there are blank
+ lines below the text and bottom scrollbar. "gvim -geometry 80x78+0+0".
+ When the "+0+0" is omitted it works.
+8 When starting an external command, and 'guipty' set, BS and DEL are mixed
+ up. Set erase character somehow?
+8 A dead circumflex followed by a space should give the '^' character
+ (Rommel). Look how xterm does this.
+ Also: Bednar has some code for dead key handling.
+ Also: Nedit 5.0.2 with USE_XMIM does it right. (Gaya)
+8 The compose key doesn't work properly (Cepas). Both for Win32 and X11.
+7 The cursor in an inactive window should be hollow. Currently it's not
+ visible.
+7 GUI on Solaris 2.5.1, using /usr/dt/..: When gvim starts, cursor is
+ hollow, after window lowered/raised it's OK. (Godfrey)
+7 When starting GUI with ":gui", and window is made smaller because it
+ doesn't fit on the screen, there is an extra redraw.
+8 When setting font with .Xdefaults, there is an extra empty line at the
+ bottom, which disappears when using ":set guifont=<Tab>". (Chadzelek)
+8 When font shape changes, but not the size, doing ":set font=" does not
+ redraw the screen with the new font. Also for Win32.
+ When the size changes, on Solaris 2.5 there isn't a redraw for the
+ remaining part of the window (Phillipps).
+- Flashes really badly in certain cases when running remotely from a Sun.
+4 Re-write the code so that the highlighting isn't changed multiple times
+ when doing a ":hi clear". The color changes happen three or more times
+ currently. This is very obvious on a 66Mhz 486.
+
+
+MSDOS/DJGPP:
+9 Pressing CTRL-C often crashes the console Vim runs in. (Ken Liao)
+ When 'bioskey' isn't set it doesn't happen. Could be a problem with the
+ BIOS emulation of the console. Version 5.6 already had this problem.
+8 DJGPP: "cd c:" can take us to a directory that no longer exists.
+ change_drive() doesn't check this. How to check for this error?
+9 The 16 bit version runs out of memory very quickly. Should find unused
+ code and reduce static data.
+9 Crash when running on Windows 98 in a console window and pressing CTRL-C.
+ Happens now and then. When debugging Vim in gdb this also happens. Since
+ the console crashes, might be a bug in the DOS console. Resetting
+ 'bioskey' avoids it, but then CTRL-C doesn't work.
+9 DOS: Make CTRL-Fx and ALT-Fx work.
+ CTRL-F1 = CE-5E, CTRL-F2 = CE-5F, .., CTRL-F10 = CE-67
+ ALT-F1 = CE-68, ALT-F2 = CE-69, .., ALT-F10 = CE-71
+ Shifted cursor keys produce same codes as unshifted keys. Use bioskey(2)
+ to get modifier mask for <S-C-M-Fx>.
+ Use K_SPECIAL/KS_MODIFIER codes to insert modifier mask in input stream?
+ Make this work like in Win32 console.
+ Mapping things like <M-A> doesn't work, because it generates an extended
+ key code. Use a translation table?
+9 Can't read an opened swap file when the "share" command has not been used.
+ At least ignore the swap files that Vim has opened itself.
+8 Use DJGPP 2.03.
+8 The Dos32 version (DJGPP) can't use long file names on Windows NT.
+ Check if new package can be used (v2misc/ntlfn08[bs].zip).
+8 setlocale() is bogus.
+8 Vim busy waits for new characters or mouse clicks. Should put in some
+ sort of sleep, to avoid eating 50% of the CPU time. Test on an unpatched
+ Windows 95 system!
+8 DJGPP: when shell is bash, make fails. (Donahoe)
+7 Hitting CTRL-P twice quickly (e.g. in keyword completion) on a 8088
+ machine, starts printer echo! (John Mullin).
+7 MSDOS 16 bit version can't work with COMSPEC that has an argument, e.g.:
+ COMSPEC=C:\WINDOWS\COMMAND.COM /E:4096 (Bradley)
+ Caused by BCC system() function (Borland "make" has the same problem).
+8 Mouse: handle left&right button pressed as middle button pressed. Add
+ modifier keys shift, ctrl and alt.
+7 When too many files are open (depends on FILES), strange things happen.
+ The Dos16 version runs out of memory, in the Dos32 version "!ls" causes a
+ crash. Another symptom: .swp files are not deleted, existing files are
+ "[New file]".
+7 DJGPP version doesn't work with graphics display mode. Switch to a mode
+ that is supported?
+8 DJGPP: ":mode" doesn't work for many modes. Disable them.
+8 DJGPP: When starting in Ex mode, shouldn't clear the screen. (Walter
+ Briscoe)
+
+
+MSDOS, OS/2 and Win32:
+8 OS/2: Add backtick expansion. Undefine NO_EXPANDPATH and use
+ gen_expand_wildcards().
+8 OS/2: Add clipboard support? See example clipbrd.exe from Alexander
+ Wagner.
+8 OS/2: Add Extended Attributes support and define HAVE_ACL.
+8 OS/2: When editing a file name "foo.txt" that is actually called FOO.txt,
+ writing uses "foo.txt". Should obtain the real file name.
+8 Should $USERPROFILE be used instead of $HOMEDRIVE/$HOMEPATH?
+8 Win32 console: <M-Up> and <M-Down> don't work. (Geddes) We don't have
+ special keys for these. Should use modifier + key.
+8 Win32 console: caps-lock makes non-alpha keys work like with shift.
+ Should work like in the GUI version.
+8 Environment variables in DOS are not case sensitive. Make a define for
+ STRCMP_ENV(), and use it when comparing environment var names.
+8 Setting 'shellslash' has no immediate effect. Change all file names when
+ it is set/reset? Or only use it when actually executing a shell command?
+8 When editing a file on a Samba server, case might matter. ":e file"
+ followed by ":e FILE" will edit "file" again, even though "FILE" might be
+ another one. Set last used name in buflist_new()? Fix do_ecmd(), etc.
+8 ":mksession" generates a "cd" command where "aa\#bb" means directory "#bb"
+ in "aa", but it's used as "aa#bb". (Ronald Hoellwarth)
+8 When a buffer is editing a file like "ftp://mach/file", which is not going
+ to be used like a normal file name, don't change the slashes to
+ backslashes. (Ronald Hoellwarth)
+
+
+Windows 95:
+8 Editing a file by it's short file name and writing it, makes the long file
+ name disappear. Setting 'backupcopy' helps.
+ Use FindFirstFile()->cAlternateFileName in fname_case() (George Reilly).
+8 Doing wildcard expansion, will match the short filename, but result in the
+ long filename (both DJGPP and Win32).
+
+
+Win32 console:
+9 When editing a file by its short file name, it should be expanded into its
+ long file name, to avoid problems like these: (Mccollister)
+ 1) Create a file called ".bashrc" using some other editor.
+ 2) Drag that file onto a shortcut or the actual executable.
+ 3) Note that the file name is something like BASHRC~1
+ 4) Go to File->Save As menu item and type ".bashrc" as the file name.
+ 5) Press "Yes" to indicate that I want to overwrite the file.
+ 6) Note that the message "File exists (add ! to override)" is displayed
+ and the file is not saved.
+ Use FindFirstFile() to expand a file name and directory in the path to its
+ long name.
+8 Also implement 'conskey' option for the Win32 console version? Look at
+ how Xvi does console I/O under Windows NT.
+7 Re-install the use of $TERM and support the use of different terminals,
+ besides the console.
+8 Use of <altgr> modifier doesn't work? 5.3 was OK. (Garcia-Suarez/Guckes)
+9 Mapping <C-S-Tab> doesn't work correctly. How to see the difference with
+ <C-S-i>?
+9 tmpnam() uses file in root of file system: "\asdf". That doesn't work on
+ a Netware network drive. Use same function as for Win32 GUI?
+8 In os_win32.h, HAVE_STRICMP and HAVE_STRNICMP are defined only if __GNUC__
+ is not defined. Shouldn't that be the other way around?
+8 ":winpos" doesn't work. Patch from Vipin Aravind.
+7 Use SetConsoleCP() and SetConsoleOutputCP() to implement 'termencoding'?
+ Avoids that input and output work differently. Need to be restored when
+ exiting.
+
+
+Amiga:
+8 In mch_inchar() should use convert_input_safe() to handle incomplete byte
+ sequences.
+9 In mch_expandpath() a "*" is to be expanded, but "\*" isn't. Remove
+ backslashes in result.
+8 Executing a shell, only one option for 'shell' is separated. Should do
+ all options, using white space separation.
+
+
+Macintosh:
+9 Mac: The motion type is not stored on the clipboard. Using ":set
+ clipboard=unnamed" makes "yyp" work characterwise. (Michael DeMoney)
+7 Loading the Perl library only works on OS/X 10.2 or 10.3, never on both.
+ Load the Perl library dynamically see Python sources file dynload_mac
+ (Jack)
+ dynamic linking: http://developer.apple.com/technotes/tn2002/tn2064.html
+8 Inputting Unicode characters does not work in the terminal. They appear
+ to arrive as upper and lower bytes. (David Brown, 2004 April 17)
+8 Typing Unicode characters doesn't work at all in the GUI.
+8 Patch to add 'transparency' option. Disadvantage: it's slow. (Eckehard
+ Berns, 2004 May 9) http://ecki.to/vim-icns/TransBack.diff
+8 Patches from "Rain Dog" Cucka:
+ - guifont selector (2002 Dec 15)
+ - scrollbar (2002 Dec 8)
+ - Quartz fonts (2002 Dec 8)
+9 Problems in Carbon version for OS X: (Benji Fisher)
+ - keyboard shortcuts in the menus get lost.
+8 The Vim/About menu doesn't work.
+8 ":gui" doesn't fork. Enabling the code in gui.c to fork causes a SEGV.
+8 Define vim_mkdir() for Macintosh.
+8 Define mch_writable() for Macintosh.
+9 When DiskLock is running, using a swap file causes a crash. Appears to be
+ a problem with writing a file that starts with a dot. (Giacalone)
+9 On G3 Mac, OS version 8, control strip causes characters messed up when
+ scrolling (CTRL-L cleans it up). (Benji Fisher)
+9 On G3 Mac, OS version 8, variable-speed scrolling doesn't work, after two
+ seconds of scrolling the screen freezes. (Benji Fisher)
+9 In mac_expandpath() check that handling of backslashes is done properly.
+8 Standard Mac shortcuts are missing. (Amerige)
+8 Handling of non-fixed width fonts is wrong. (Amerige)
+
+
+"Small" problems:
+8 When an ":edit" is inside a try command and the ATTENTION prompt is used,
+ the :catch commands are always executed, also when the file is edited
+ normally. Should reset did_emsg and undo side effects. Also make sure
+ the ATTENTION message shows up.
+9 When using ":e ++enc=foo file" and the file is already loaded with
+ 'fileencoding' set to "bar", then do_ecmd() uses that buffer, even though
+ the fileencoding differs. Reload the buffer in this situation? Need to
+ check for the buffer to be unmodified.
+8 ":g//" gives "Pattern not found error" with E486. Should not use the
+ error number, it's not a regular error message.
+7 Vimtutor leaves escape sequence in terminal. This is the xterm response to
+ requesting the version number. (Yasuhiro Matsumoto)
+8 When redirecting and using ":silent" the current column for displaying and
+ redirection can be different. Use a separate variable to hold the column
+ for redirection.
+7 There is no way to change directory and go back without changing the local
+ and/or global directory. Add a way to find out if the current window uses
+ a local directory. Add cdcmd() that returns ":cd" or ":lcd"?
+7 After running "make test" the window title is sometimes not restored.
+ Mostly sticks at "test3.in", but not always. Appears to happen more often
+ when compiled with Python (threading).
+7 The messages for "vim --help" and "vim --version" don't use
+ 'termencoding'.
+7 ATTENTION dialog choices are more logical when "Delete it' appears before
+ "Quit". Patch by Robert Webb, 2004 May 3.
+8 When 'scrollbind' is set, a window won't scroll horizontally if the cursor
+ line is too short. Add a word in 'scrollopt' to allow moving the cursor
+ to longer line that is visible. A similar thing is done for the GUI when
+ using the horizontal scrollbar.
+7 VisVim can only open one file. Hard to solve: each opened file is passed
+ with a separate invocation, would need to use timestamps to know the
+ invocations belong together.
+8 When giving a ":bwipeout" command a file-changed dialog may popup for this
+ buffer, which is pointless. (Mike Williams)
+8 On MS-Windows ":make" doesn't show output while it is working. Use the
+ tee.exe from http://unxutils.sourceforge.net/ ? About 16 Kbyte in the
+ UnxUtils.zip archive.
+ Alternate one: http://www.pramodx.20m.com/tee_for_win32.htm, but Walter
+ Briscoe says it's not as good.
+8 'fillchars' doesn't work for multi-byte characters.
+9 Editing a XML file with a long line is extremely slow. Example file from
+ Randy Parker (Dec 13). Editing the dictionaries for engspchk plugin with
+ syntax highlighting is also very slow.
+ Limit the searching for items to a few hundred characters?
+8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
+ ":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
+7 Output for ":scriptnames" and ":breaklist" should shorten the file names:
+ use "~/" when possible.
+8 After using diff mode, ":set nodiff" doesn't restore the old foldmethod.
+ (Thomas S. Urban)
+7 mb_off2cells() doesn't work correctly on the tail byte of a double-byte
+ character. (Yasuhiro Matsumoto) It should return 1 when used on a tail
+ byte, like for utf-8. Store second byte of double-byte in ScreenLines2[]
+ (like for DBCS_JPNU) and put a zero in the second byte (like for UTF-8).
+8 'backupdir' and 'directory' should use $TMPDIR, $TMP and/or $TEMP when
+ defined.
+7 Inside a function with "perl <<EOF" a line with "$i++" is recognized as an
+ ":insert" command, causing the following "endfunction" not to be found.
+ Add skipping this perl construction inside function definitions.
+7 When 'ttimeoutlen' is 10 and 'timeoutlen' is 1000, there is a keycode
+ "<Esc>a" and a mapping <Esc>x", when typing "<Esc>a" with half a second
+ delay should not be interpreted as a keycode. (Hans Ginzel)
+7 ":botright 1 new" twice causes all window heights to be changed. Make the
+ bottom window only bigger as much as needed.
+7 "[p" doesn't work in Visual mode. (David Brown)
+7 The Cygwin and MingW makefiles define "PC", but it's not used anywhere.
+ Remove? (Dan Sharp)
+9 The argument <f-args> of a user command doesn't handle backslashes
+ properly. "Cmd \ e" is one argument, "Cmd \\ e" still is one argument.
+ "Cmd \ e" is two arguments, first one ending in space. (Kontra Gergely)
+9 User commands use the context of the script they were defined in. This
+ causes a "s:var" argument to unexpectedly use a variable in the defining
+ script, not the calling script. Add an argument to ":command":
+ "-keepcontext". Do replace <SID>, so that a function in the defining
+ script can be called.
+8 The Japanese message translations for MS-Windows are called ja.sjis.po,
+ but they use encoding cp932. Rename the file and check that it still
+ works.
+9 When a syntax region does not use "keepend" and a contained item does use
+ "extend", this makes the outer region stop at the end of the contained
+ region. (Lutz Eymers) Another example Nov 14 2002.
+8 A very long message in confirm() can't be quit. Make this possible with
+ CTRL-C.
+7 clip_x11_own_selection() uses CurrentTime, that is not allowed. VNC X
+ server has a problem with this. (Mark Waggoner) Remembering the timestamp
+ of events isn't always possible. We don't get them in an xterm. GTK
+ doesn't obtain the selection again when the timestamp differs, thus it
+ won't work for GTK anyway.
+8 When the clipboard isn't supported: ":yank*" gives a confusing error
+ message. Specifically mention that the register name is invalid.
+8 "gf" always excludes trailing punctuation characters. file_name_in_line()
+ is currently fixed to use ".,:;!". Add an option to make this
+ configurable?
+8 'hkmap' should probably be global-local.
+9 When "$" is in 'cpoptions' and folding is active, a "C" command changes
+ the folds and resets w_lines_valid. The display updating doesn't work
+ then. (Pritesh Mistry)
+8 ":s!from!to!" works, but ":smagic!from!to!" doesn't. It sees the "!" as a
+ flag to to the command. Same for ":snomagic". (Johan Spetz)
+8 Using ":s" in a function changes the previous replacement string. Save
+ "old_sub" in save_search_patterns()?
+8 When appending to a file and 'patchmode' isn't empty, a backup file is
+ always written, even when the original file already exists.
+7 When using "daw" on the last word in a file and this is a single letter,
+ nothing is deleted. Should delete the letter and preceding white space.
+9 When getting focus while writing a large file, could warn for this file
+ being changed outside of Vim. Avoid checking this while the file is being
+ written.
+9 The "Error detected while processing modelines" message should have an
+ error number.
+7 The message in bt_dontwrite_msg() could be clearer.
+8 Unix: When libcall() fails there is no clear error message. Johannes
+ Zellner has a patch for this.
+8 The script ID that is stored with an option and displayed with ":verbose
+ set" isn't reset when the option is set internally. For example when
+ 'foldlevel' is set from 'foldlevelstart'.
+8 In the fileformat dialog, "Cancel" isn't translated. Add a global
+ variable for this. (Eduardo Fernandez)
+9 When editing a file with 'readonly' set, there is no check for an existing
+ swap file. Then using ":write" (without making any changes) doesn't give
+ a warning either. Should check for an existing swap file without creating
+ one.
+7 On MS-DOS or MS-Windows, when editing the same file over a network, the
+ drive letter is different, thus an existing swap file doesn't generate a
+ warning. Use some flag to indicate the swap file is in the same directory
+ as the original file? Could make b0_fname[] start with a special
+ character like ">".
+7 When 'showbreak' is set, the amount of space a Tab occupies changes.
+ Should work like 'showbreak' is inserted without changing the Tabs.
+7 When there is a "help.txt" window in a session file, restoring that
+ session will not get the "LOCAL ADDITIONS" back.
+7 When 'mousefocus' is set and switching to another window with a typed
+ command, the mouse pointer may be moved to a part of the window that's
+ covered by another window and we lose focus. Only move in the y
+ direction, not horizontally?
+8 When using CTRL-D after ":help", restrict the number of matches to a
+ thousand, otherwise using CTRL-D without an argument takes too long.
+8 ":hardcopy":
+ - Patch to append CTRL-D to PostScript output (Mike Williams, 2004 Jun 11)
+ - Using the cterm_color[] table is wrong when t_colors is > 16.
+ - Need to handle unprintable characters.
+ - Win32: On a B&W printer syntax highlighting isn't visible. Perform
+ dithering to make grey text?
+ - support printing multi-byte characters. Patch from Motonobu Ichimura.
+ New (better) patch from Mike Williams (2004 Jan 20)
+ - Add a flag in 'printoptions' to add an empty page to make the total
+ number even. "addempty"? (Mike Williams)
+ - Should interpreted CTRL-L as a page break.
+ - Grey line numbers are not always readable. Add field in 'printoptions'.
+ Default to black when no syntax highlighting.
+ - Be able to print a window in diff mode.
+ - Be able to specify a colorscheme to use for printing. And a separate
+ one for B&W printing (if that can be detected).
+8 In Visual block mode with 'lbr' set, a change command doesn't insert the
+ text in following lines where the linebreak changes.
+9 dosinst.c: The DJGPP version can't uninstall the Uninstall registry key on
+ Windows NT. How to install a .inf file on Windows NT and how to detect
+ that Windows NT is being used?
+8 When opening the same file on Unix and on MS-Windows, there is no
+ ATTENTION message, because the path in the swap file is different. Using
+ a relative path name will cause no ATTENTION for Vim 5.8.
+ Somehow add a flag that the swap file is in the same dir as the file?
+8 When 'virtualedit' is "block,insert" and encoding is "utf-8", selecting a
+ block of one double-wide character, then "d" deletes only half of it.
+8 When 'virtualedit' is set, should "I" in blockwise visual mode also insert
+ in lines that don't extend into the block?
+8 With 'virtualedit' set, in Insert mode just after the end of line, CTRL-O
+ yh does not yank the last character of the line. (Pavel Papushev)
+ Doing "hl" first appears to make it work.
+8 With 'virtualedit' set it's possible to move into the blank area from
+ 'linebreak'.
+8 With 'virtualedit' set and 'selection' "exclusive", a Visual selection
+ that ends in or after a tab, "d" doesn't delete (part of) the tab.
+ (Helmut Stiegler)
+8 With 'virtualedit' set, a blockwise Visual selection that starts and ends
+ in a tab, "<" shifts too much. (Helmut Stiegler)
+9 When jumping to a tag, the search pattern is put in the history. When
+ 'magic' is on, the pattern may not work. Translate the pattern depending
+ on p_magic when putting it in the history? Alternative: Store value of
+ 'magic' in history. (Margo)
+9 optwin.vim: Restoring a mapping for <Space> or <CR> is not correct for
+ ":noremap". Add "mapcmd({string}, {mode})? Use code from ":mkexrc".
+9 incsearch is incorrect for "/that/<Return>/this/;//" (last search pattern
+ isn't updated).
+9 term_console is used before it is set (msdos, Amiga).
+9 Get out-of-memory for ":g/^/,$s//@/" on 1000 lines, this is not handled
+ correctly. Get many error messages while redrawing the screen, which
+ cause another redraw, etc.
+8 [<C-I> doesn't work when '*' is in 'iskeyword'. find_pattern_in_path()
+ must escape special characters in the pattern.
+8 Vim can overwrite a read-only file with ":w!". ":w" can't overwrite an
+ existing file, "w!" can, but perhaps not a read-only file? Then use
+ ":w!!" for that.
+ Or ask for permission to overwrite it (if file can be made writable) and
+ restore file to readonly afterwards.
+7 When compiled with "xterm_clipboard", startup can be slower and might get
+ error message for invalid $DISPLAY. Try connecting to the X server in the
+ background (forked), so that Vim starts up quicker? Connect as soon as
+ the clipboard is to be used (Visual select mode starts, paste from
+ clipboard)
+7 X11: Some people prefer to use CLIPBOARD instead of PRIMARY for the normal
+ selection. Add an "xclipboard" argument to the 'clipboard' option? (Mark
+ Waggoner)
+8 For xterm need to open a connection to the X server to get the window
+ title, which can be slow. Can also get the title with "<Esc>[21t", no
+ need to use X11 calls. This returns "<Esc>]l{title}<Esc>\".
+8 When the builtin xterm termcap contains codes that are not wanted, need a
+ way to avoid using the builtin termcap.
+8 Xterm sends ^[[H for <Home> and ^[[F for <End> in some mode. Also
+ recognize these keys? Mostly useful for xterm simulators, like gnometerm.
+ See http://dickey.his.com/xterm/xterm.faq.html#xterm_pc_style.
+8 '[ and '] should be set to start/end of line when using a linewise operator
+ (e.g., ":w").
+8 CTRL-A can't handle big "long" numbers, they become negative. Check for
+ "-" character, if not present, use unsigned long.
+8 Make it possible to disable the special meaning of "#" in the first column
+ for ">>".
+8 Add suspending with CTRL-Z at the "more" prompt, and when executing a long
+ script in do_cmdline().
+8 When using 'hidden', many swap files will be open. When Vim runs into the
+ maximum number of open files, error messages will appear. Detect that
+ this problem is present, and close any hidden files that don't have
+ changes.
+8 With 'viminfo' set such that the ".viminfo" file is written on a FAT
+ filesystem, an illegal file name may be created: ".vim".
+8 For each buffer that is opened, the viminfo file is opened and read to
+ check for file marks. This can be slow.
+7 In xterm, recognize both vt100 and vt220 cursor keys. Change
+ add_termcode() to not remove an existing entry for a name, when it's
+ needed.
+ Need a generic solution to recognize different codes for the same key.
+8 Core dump within signal function: gdb doesn't show stack backtrace! Option
+ to skip catch_signals()?
+9 Repeating a "cw" with "." doesn't work if the text was pasted from the
+ clipboard. (Thomas Jones) It's because the menu/toolbar item exits Insert
+ mode and uses "gP". How to fix this without breaking inserting a block of
+ text?
+8 In Replace mode pasting from the clipboard (using menu or toolbar) inserts
+ all the text. Add ":rmenu"?
+8 Pasting with the mouse in Replace mode inserts the text, instead of
+ overwriting, when it is more than one line. Same for using <C-R>.
+9 CTRL-E and CTRL-Y don't work in small window when 'so' is 4 and lines are
+ wrapping (Acevedo/in.226). E.g., when using CTRL-E, window height 7,
+ window might actually scroll down when last line of buffer is displayed.
+ --> Remember if the previous command was "cursor follows screen" or
+ "screen follow cursor" and use this in cursupdate().
+7 tilde_replace() can only handle "~/", should also do "~user/".
+ Get the list of home directories (from /etc/passwd? Use getpwent()) and
+ use some clever algorithm to match a path with that. Find common strings
+ in the list?
+8 When dragging status line with mouse, sometimes a jump when first clicking
+ on the status line (caused by 'winheight'). Select window on button up,
+ instead of on button down.
+8 Dragging the status line doesn't scroll but redraw.
+9 Evaluating 'statusline' in build_stl_str_hl() does not properly check for
+ reaching the end of the available buffer.
+8 When performing incremental search, should abort searching as soon as a
+ character is typed.
+8 When the value of $MAKE contains a path, configure can't handle this.
+ It's an autoconf bug. Remove the path from $MAKE to work around it.
+8 How to set VIMRC_FILE to \"something\" for configure? Why does this not
+ work: CFLAGS='-DVIMRC_FILE=\"/mydir/myfile\"' ./configure
+8 The temporary file is sometimes not writable. Check for this, and use an
+ alternate name when it isn't. Or add the 'temptemplate' option: template
+ for the temp file name ":set temptemplate=/usr/tmp/?????.tmp".
+ Also: Win32 version uses Windows temp directory, which might not work for
+ cygwin bash.
+7 Get error "*, \+ or \( operand could be empty" for pattern "\(.\)\1\{3}".
+ Remember flags for backreferences.
+7 When switching to Daylight Saving Time, Vim complains that a file has been
+ changed since last read. Can we use a function that uses GMT?
+7 When completing an environment variable after a '$', check for file names
+ that contain a '$' after all have been found.
+8 When "cm" termcap entry is missing, starting gvim shouldn't complain about
+ it. (Lohner) Try out with "vt100" entry, cm replaced with cX.
+7 When an include file starts with "../", the check for already visiting
+ this file doesn't work. Need to simplify the file name.
+8 On Sinix SYS_NMLN isn't defined. Include patch from Cristiano De Michele.
+7 The names and comments for the arguments of do_browse() are confusing.
+ "dflt" isn't the default file name when "initdir" is not NULL and
+ "initdir" is the default path to be used.
+7 When 'scrolloff' is exactly half the window height, "j" causes a scroll of
+ two lines at a time. "k" doesn't do this. (Cory T. Echols)
+8 When write_viminfo() is used while there are many orphaned viminfo
+ tempfiles writing the viminfo file fails. Give a clear error message so
+ that the user knows he has to delete the files.
+7 It's possible to redefine a script-local function with ":func
+ <SNR>123_Test()". (Krishna) Disallow this.
+7 After ":%d" an undo reports the number of lines added as if there still
+ was one line.
+
+
+I can't reproduce these (if you can, let me know how!):
+9 NT 4.0 on NTFS file system: Editing ".bashrc" (drag and drop), file
+ disappears. Editing ".xyz" is OK. Also, drag&drop only works for three
+ files. (McCollister)
+8 Motif: Tear-off menu item crashes Vim on some machines. (Netherton) It
+ works fine for me, maybe it's a Motif problem.
+
+
+Problems that will (probably) not be solved:
+- In a terminal with 'mouse' set such that the mouse is active when entering
+ a command line, after executing a shell command that scrolls up the
+ display and then pressing ":": Selecting text with the mouse works like
+ the display wasn't scrolled. Vim doesn't know how much the external
+ command scrolled up the display. Use Shift to select text.
+- X windows: When $DISPLAY points to a X server where there is no access
+ permission, trying to connect to the X server causes an error message.
+ XtOpenDisplay() prints this directly, there is no way to avoid it.
+- X windows: Setting 'guifontset' to an illegal value sometimes crashes Vim.
+ This is caused by a fault in a X library function, can't be solved in Vim.
+- Motif: When adding a menu item "Find this &Symbol", the "s" in "this" will
+ be underlined, instead of in "Symbol". Motif doesn't let us specify which
+ character gets the highlighting.
+- Moving the cursor removes color in color-xterm. This is a color-xterm
+ problem! color-xterm ver. 6.1 beta 3 and later work properly.
+- In zsh, "gvim&" changes the terminal settings. This is a zsh problem.
+ (Jennings)
+- Problem with HPterm under X: old contents of window is lost (Cosentino).
+- Amiga: When using quickfix with the Manx compiler we only get the first 25
+ errors. How do we get the rest?
+- Amiga: The ":cq" command does not always abort the Manx compiler. Why?
+- Linux: A file with protection r--rw-rw- is seen readonly for others. The
+ access() function in GNU libc is probably wrong.
+- MSDOS: When using smartdrive with write-back buffering, writing to a
+ readonly floppy will cause problems. How to test for a writable floppy
+ first?
+- MSDOS: Both 16 and 32 bit versions: File name expansion doesn't work for
+ names that start with a dot. These used to be illegal file names.
+- When doing a CTRL-Z and typing a command for the shell, while Vim is busy
+ (e.g. writing a file), the command for the shell is sometimes eaten by Vim,
+ because the terminal mode is changed from RAW to CBREAK.
+- An old version of GNU tgoto can't handle the terminfo code for "AF". The
+ "%p1" is interpreted as "%p" and "1", causing color not to be working.
+ Fix: Change the "%p1" in the "AF" and "AB" terminfo entries to "%p".
+ (Benzinger).
+- When running an external command from the GUI, typeahead is going to that
+ program, not to Vim. It looks like the shell eats the characters, Vim
+ can't get back what the external command didn't use.
+- Win32 GUI: Error code from external command not returned in shell_error.
+ It appears that cmd.exe and command.com don't return an error code.
+- Win32 GUI: The Toolbar is a bit too high when the flat style is being
+ used. We don't have control over the height of the Toolbar.
+- Win32: All files created on the day of switching from winter to summer
+ time cause "changed since editing started" messages. It goes away when
+ the file is written again the next day, or the timezone is adjusted.
+ DJGPP version is OK. (Zaimi) Looks like a problem with the Win32 library.
+ Rebooting doesn't help. Time stamps look OK in directory. (Penn)
+ Is this on FAT (stores wall clock time) or NTFS (stores UTS)?
+- Win32, MS-Windows XP: $HOME uses the wrong drive when the user profiles
+ are not on the boot disk. This is caused by a wrong value of $HOMEDRIVE.
+ This is a bug in XP, see MSKB article 818134.
+- SunOS 5.5.1 with Motif: The file open dialog does not have a horizontal
+ scroll bar for the "files" selection. This is a problem in the Motif
+ libraries, get a patch from Sun.
+- Solaris 2.6 with GTK and Perl: gvim crashes when started. Problem with X
+ input method called from GDK code. Without Perl it doesn't crash.
+- VMS: Vimdiff doesn't work with the VMS diff, because the output looks
+ different. This makes test 47 fail. Install a Unix-compatible diff.
+- VMS v7.1 and older: Tests 21 and 32 fail. From VMS v7.1-2 and newer Vim
+ does not have this behavior. (Zoltan Arpadffy)
+- Win32 GUI: mouse wheel always scrolls rightmost window. The events arrive
+ in Vim as if the rightmost scrollbar was used.
+- GTK with Gnome: Produces an error message when starting up:
+ Gdk-WARNING **: locale not supported by C library
+ This is caused by the gnome library gnome_init() setting $LC_CTYPE to
+ "en_US". Not all systems support this locale name, thus causing the
+ error. Hopefully a newer version of GTK/Gnome fixes this problem.
+- GTK 2: With this mapping the hit-enter prompt is _sometimes_ below the
+ screen, at other times there is a grey area below the command line:
+ :nmap <F11> :if &guioptions=~'m' \| set guioptions-=m \| else \| set guioptions+=m \| endif<cr>
+- GTK: When pasting a selection from Vim to xclipboard gvim crashes with a
+ ABRT signal. Probably an error in the file gdkselection.c, the assert
+ always fails when XmbTextListToTextProperty() fails. (Tom Allard)
+- When using an xterm that supports the termresponse feature, and the 't_Co'
+ termcap option was wrong when Vim started, it will be corrected when the
+ termresponse is received. Since the number of colors changes, the
+ highlighting needs to be initialized again. This may cause colors defined
+ in the vimrc file to be lost.
+- On Windows NT 4.0 the number of files passed to Vim with drag&drop and
+ "Edit with Vim" is limited. The maximum command line length is 255 chars.
+
+--------------------- extensions and improvements ----------------------
+ *extensions-improvements*
+
+Documentation:
+8 Extend usr_27.txt a bit. (Adam Seyfarth)
+9 Merge in ideas from ~/vim/patches/tutor.txt (Gabriel Zachmann)
+7 Add a section on debugging scripts in the user manual.
+9 Make the Reference Manual more precise. For each command mention:
+ - change to cursor position and curswant
+ - if it can be undone (u/CTRL-R) and redone (.)
+ - how it works for folded lines
+ - how it works with multi-byte characters
+9 In change.txt, remark about Javadoc isn't right. Right alignment would
+ work too.
+8 Spread the windows commands over the other files. For example, ":stag"
+ should be with ":tag". Cross-link with tags to avoid too much double
+ text.
+8 Add tags for all features, e.g. "gui_running".
+7 MS-Windows: When a wrong command is typed with an ALT key, give a hint to
+ look at the help for 'winaltkeys'.
+7 Add a help.vim plugin that maps <Tab> to jump to the next tag in || and
+ <C-Tab> (and <S-Tab>) to the previous tag.
+- Check text editor compendium for vi and Vim remarks.
+
+
+Help:
+- First try using the ":help" argument literally, before using it as a
+ pattern. And then match it as part of a tag.
+- When a help item has multiple matches make it possible to use ":tn" to go
+ to the other matches.
+- Support a way to view (and edit) .info files.
+- Default mapping for help files: <Tab> to position cursor on next |:tag|.
+- Implement a "sticky" help window, some help text lines that are always
+ displayed in a window with fixed height. (Guckes) Use "~/.vimhelp" file,
+ user can edit it to insert his favorite commands, new account can contain a
+ default contents.
+- Make 'winminheight' a local option, so that the user can set a minimal
+ height for the help window (and other windows).
+- ":help :s^I" should expand to ":help :substitute".
+- Make the help key (<F1>) context sensitive?
+- Learn mode: show short help while typing commands.
+
+
+User Friendlier:
+8 Windows install with install.exe: Use .exe instead of .bat files for
+ links, so that command line arguments are passed on unmodified? (Walter
+ Briscoe)
+8 Windows install: Be able to associate Vim with a selection of file types?
+8 Windows uninstall: Have uninstal.c delete the vimfiles directories that
+ dosinst.c creates. List the contents of the directory (recursively) if
+ the user asks for it. Requires an implementation of "rm -rf".
+8 Remember the name of the vimrc file that was used (~/.vimrc, $VIM/_vimrc,
+ $HOME/_vimrc, etc.) and add "edit vimrc" to the File menu.
+- Add a way to save local settings and mappings into a new plugin file.
+ ":mkplugin <file>"?
+8 Add ":plugininstall" command. Can be used to install a plugin file that
+ includes documentation. Let the user select a directory from
+ 'runtimepath'.
+ " Vim plugin
+ <main plugin code>
+ " >>> plugin help start <<<
+ <plugin docs>
+- Add mappings local to a window: ":map <window> ..."?
+9 Add buffer-local menu. Should offer a choice between removing the menu or
+ disabling it. Be careful that tear-offs don't disappear (keep one empty
+ item?).
+ Alternative: use BufEnter and BufLeave autocommands.
+8 Add file locking. Lock a file when starting to edit it with flock() or
+ fcntl(). This patch has advisory file locking while reading/writing the
+ file: ~/vim/patches/kahn_file_locking .
+8 make a vimtutor script for Amiga and other systems.
+7 Add the arguments for configure to the ":version" output?
+
+
+Diff mode:
+8 Add a command to stop diff mode: ":set nodiff fdc = 0 noscrollbind"
+8 Use diff mode to show the changes made in a buffer (compared to the file).
+ Use an unnamed buffer, like doing:
+ new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
+7 Add cursor-binding: when moving the cursor in one diff'ed buffer, also
+ move it in other diff'ed buffers, so that CTRL-W commands go to the same
+ location.
+
+
+Folding:
+ (commands still available: zg zG zI zJ zK zp zP zq zQ zV zw zW zy zY;
+ secondary: zB zS zT zZ)
+8 Add different highlighting for a fold line depending on the fold level.
+ (Noel Henson)
+8 When a closed fold is displayed open because of 'foldminlines', the
+ behavior of commands is still like the fold is closed. How to make the
+ user aware of this?
+8 Add an option 'foldskip' with values like 'foldopen' that specifies which
+ commands skip over a closed fold.
+8 "H" and "L" count buffer lines instead of window lines. (Servatius Brandt)
+8 Add a way to add fold-plugins. Johannes Zellner has one for VB.
+7 When using 2html.vim, also reproduce folds as you can see them. When
+ someone doesn't want the folds he can disable them before converting.
+ First attempt by Carl Osterwisch, 2004 May 10.
+7 When using manual folding, the undo command should also restore folds.
+- Allow completely hiding a closed fold. Require showing a character in
+ 'foldcolumn' to avoid the missing line goes unnoticed.
+- When pressing the down arrow of a scrollbar, a closed fold doesn't scroll
+ until after a long time. How to make scrolling with closed folds
+ smoother?
+- When creating a session, also store folds for buffers in the buffer list,
+ using the wininfo in wi_folds.
+- 'foldmethod' "textobject": fold on sections and paragraph text objects.
+- Add 'hidecomment' option: don't display comments in /* */ and after //.
+- "zu": undo change in manual fold. "zU" redo change in manual fold. How to
+ implement this?
+- "zJ" command: add the line or fold below the fold in the fold under the
+ cursor.
+- 'foldmethod' "syntax": "fold=3": set fold level for a region.
+- Can set 'foldtext' to empty string: don't display any line. How to
+ implement this?
+- Apply a new foldlevel to a range of lines. (Steve Litt)
+- Have some way to restrict commands to not folded text. Also commands like
+ searches.
+
+
+Multi-byte characters:
+9 When the tail byte of a double-byte character is illegal (e.g., a CR), the
+ display is messed up (Yasuhiro Matsumoto). Should check for illegal
+ double-byte characters and display them differently (display each single
+ byte).
+8 Add an item in 'fileencodings' to check the first lines of a file for
+ the encoding. See Python PEP: http://www.python.org/peps/pep-0263.html.
+ To avoid getting a wrong encoding only accept something Emacs-like:
+ "-*- coding: enc-na_me.foo -*-" and "-*- coding= enc-na_me.foo -*-"
+ Match with "-\*-\s*coding[:=]\s*\([::word::-_.]\+\)\s*-\*-" and use first
+ item.
+8 Add an item in 'fileencodings' to check the first line of an XML file for
+ the encoding. <?xml version="1.0" encoding="UTF-8"?> Or "charset=UTF-8"?
+8 The quickfix file is read without conversion, thus in 'encoding'. Add an
+ option to specify the encoding of the errorfile and convert it. Also for
+ ":grep".
+8 When a file was converted from 'fileencoding' to 'encoding', a tag search
+ should also do this on the search pattern. (Andrzej M. Ostruszka)
+7 When converting a file fails, mention which byte could not be converted,
+ so that the user can fix the problem.
+8 Add configure option to be able to disable using the iconv library. (Udo
+ Schweigert)
+8 Add patch from Muraoka Taro (Mar 16) to support input method on Mac?
+9 'aleph' should be set to 1488 for Unicode. (Zvi Har'El)
+8 Should add test for using various commands with multi-byte characters.
+- Include flipcase patch: ~/vim/patches/wall.flipcase2 ? Make it work for
+ multi-byte characters.
+8 'infercase' doesn't work with multi-byte characters.
+8 toupper() function doesn't handle byte count changes.
+8 Support four composing characters, needed for Hebrew. (Ron Aaron)
+8 "ga" should show all composing characters, also if there are more than 2.
+7 When searching, should order of composing characters be ignored?
+8 Should implement 'delcombine' for command line editing.
+8 Detect overlong UTF-8 sequences and handle them like illegal bytes.
+8 ":s/x/\u\1/" doesn't work, making uppercase isn't done for multi-byte
+ characters.
+8 UTF-8: "r" in Visual mode doesn't take composing characters.
+8 UTF-8: When there is a precomposed character in the font, use it instead
+ of a character and a composing character. See xterm for an example.
+7 When a character can't be displayed, display its digraph instead.
+ 'display' option to specify this.
+7 Use ideas for nl_langinfo() from Markus Kuhn in enc_default():
+ (www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c)
+- GTK and Win32: Allow selecting fonts for 'guifontset' with the
+ fontselector somehow.
+- GTK and Win32: make it possible to set the font for the menu to make it
+ possible to have 'encoding' different from the current locale.
+- dbcs_class() only works for Japanese and Korean. Implement this for
+ other encodings. The "euc-jp" and "euc-kr" choices might be wrong.
+- Find some way to automatically select the right GUI font or fontset,
+ depending on the default value of 'encoding'.
+ Irrelevant in the GTK+ 2 GUI so long as UTF-8 is used.
+ For Windows, the charset_pairs[] table could be used. But how do we know
+ if a font exists?
+- Do keyboard conversion from 'termencoding' to 'encoding' with
+ convert_input() for Mac GUI, RiscOS GUI, BeOS GUI.
+- Add mnemonics from RFC1345 longer than two characters.
+ Support CTRL-K _{mnemonic}_
+7 In "-- INSERT (lang) --" show the name of the keymap used instead of
+ "lang". (Ilya Dogolazky)
+- Make 'langmap' accept multi-byte characters.
+- Do we need the reverse of 'keymap', like 'langmap' but with files and
+ multi-byte characters? E.g., when using a Russian keyboard.
+- Add the possibility to enter mappings which are used whenever normal text
+ could be entered. E.g., for "f" command. But not in Normal mode. Sort
+ of opposite of 'langmap'. Use ":tmap" command?
+- When breaking a line, take properties of multi-byte characters into
+ account. The "linebreak" program from Bruno Haible can do it:
+ ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz
+ But it's very complicated...
+
+
+Printing:
+- Add "page width" to wrap long lines.
+- Win32: use a font dialog for setting 'printfont'. Can reuse the code for
+ the 'guifont' dialog, put the common code in a separate function.
+- Win32: when 'printfont' is empty use 'guifont'.
+- Unix: Use some dialog box to do the obvious settings (paper size, printer
+ name, portrait/landscape, etc).
+- Win32: add options to print dialog. Patch from Vipin Aravind.
+- PostScript: only works for 7-bit ASCII and EBCDIC. Should support
+ different 'encoding' values somehow.
+- Allow specifying the paper size, instead of using a standard size. Same
+ units as for the margins.
+- Support right-to-left text?
+8 Make the foreground color darkening function preserve the hue of the
+ color.
+
+
+Syntax highlighting:
+- Patch to add highlighting for whitespace. (Tom Schumm, 2003 Jul 5)
+ use the patch that keeps using HLF_8 if HLF_WS has not
+ been given values.
+ Add section in help files for these highlight groups?
+8 Make ":syn off" use 'runtimepath' instead of $VIMRUNTIME. (Gary Johnson)
+ Should do the same for ":syn on" and ":syn manual".
+8 Support "containedin" argument for ":syn include", so that the defined
+ cluster can be added to existing syntax items.
+8 C syntax: Don't highlight {} as errors inside () when used like this:
+ "({ something })", often used in GCC code.
+8 When editing a new file without a name and giving it a name (by writing
+ it) and 'filetype' is not set, detect the filetype. Avoid doing it for
+ ":wq file".
+8 Make conversion to HTML faster (Write it in C or pre-compile the script).
+9 There is still a redraw bug somewhere. Probably because a cached state is
+ used in a wrong way. I can't reproduce it...
+7 Make syntax keyword table configurable. Set number of bits used with
+ ":syn clear [hashbits]", so that we don't need to reallocate the table.
+ minimal 4 bits, maximal 16. (Campbell)
+7 Be able to change only the background highlighting. Useful for Diff* and
+ Search highlighting.
+8 Allow the user to add items to the Syntax menu sorted, without having to
+ change this for each release.
+8 Add a "matchcontains" for regions: items contained in the start or end
+ pattern, but not in the body.
+8 Add a "keepend-contained" argument: Don't change the end of an item this
+ one is contained in. Like "keepend" but specified on the contained item,
+ instead of the containing item.
+8 For keywords, allow to define the size of the hash table with ":syn
+ clear". Change KHASH_ defines into variables stored in buffer struct.
+ Use something else than linear linked list from the hash table. (Campbell)
+8 cpp.vim: In C++ it's allowed to use {} inside ().
+8 Some syntax files set 'iskeyword'. When switching to another filetype
+ this isn't reset. Add a special keyword definition for the syntax rules?
+ When this is done, use vim.vim syntax highlighting for help file examples,
+ but without ":" in 'iskeyword' for syntax.
+8 Add specific syntax item to match with parens/braces that don't have a
+ "%" match. :syntax nomatch cMatchError (,{,[,),},] [contained]
+8 Highlight the text between two matching parens (e.g., with a grey
+ background) when on one of the parens or in between them.
+ Or highlight the matching paren when the cursor is on one.
+8 Add a command to jump to the next character highlighted with "Error".
+8 When using a cterm, and no ctermfg or ctermbg are defined, use start/stop
+ sequences. Add remark in docs that :if 'term' == "term-name" should be
+ used.
+8 Add @spell cluster to String and Comment groups for many languages. Will
+ allow spell checking. (Fleiner)
+8 When listing syntax items, try to sort the keywords alphabetically. And
+ re-insert the [] if possible.
+8 Make it possible to use color of text for Visual highlight group (like for
+ the Cursor).
+8 "fg" and "bg" don't work in an xterm. Get default colors from xterm with
+ an ESC sequence. Ideas in: ~/vim/patches/vikas.xtermcolors .
+8 Make it possible to only highlight a sub-expression of a match. Like
+ using "\1" in a ":s" command.
+8 Support for deleting syntax items:
+ :syn keyword cTodo remove this
+ :syn match cTodo remove "pattern"
+ :syn region cString remove start="this" end="that"
+8 Add possibility to sync on something else, when the syncing in one way
+ doesn't find match. For HTML: When no {script} is found, try looking for
+ a '<'. (Fleiner)
+7 Replace the synchronizing method with a state machine specification?
+ Should be able to start at any line in the file, search forwards or
+ backwards, and use the result of matching a pattern.
+7 Use parsing like awk, so that e.g., a ( without a matching ) can be
+ detected.
+8 Make it possible to use "inverted" highlighting, invert the original
+ character. For Visual mode. (xterm-selection already does this).
+8 Highlight non-printable characters with "SpecialChar", linked to
+ "Special". Display them with the digraph characters, if possible.
+7 Add "DefaultFG" and "DefaultBG" for the colors of the menu. (Martin
+ Dalecki has a patch for Motif)
+8 Highlight the clipboard-selection with a highlight group.
+8 Be able to reset highlighting to its original (default) values.
+7 Be able to write current highlighting to a file as commands, similar to
+ ":mkvimrc".
+8 Improve c.vim:
+ - Add check for unterminated strings, with a variable to switch it on:
+ "c_strict_ansi".
+ - Detect unbalanced "#endif". Requires looking back a long way...
+8 Add an option to restrict the updating of syntax highlighting to the
+ current line while in Insert mode.
+8 When guessing value of 'background', the syntax file has already been
+ loaded (from the .gvimrc). After changing 'background', load it again?
+8 Add ":syn resync" command, to re-parse the whole file until the current
+ display position.
+8 Should support "me" offset for a region start pattern. To be used to
+ allow searching for the end pattern inside the match of the end pattern.
+ Example: syn region pikeXX start="([^{]" end=")" should work on "()".
+8 When using a regexp for "contains=", should delay matching with it until
+ redrawing happens. Set a flag when a group is added, check this flag when
+ highlighting starts.
+7 Add "semitrans": Add highlighting. E.g., make the text bold, but keep the
+ colors. And add colors, so that Green+Red becomes Yellow.
+ E.g. for this html:
+ <B> bold text <I> italic+bold text </B> italic text </I>
+7 Wild idea: Not only set highlighting, but also change what is displayed
+ (e.g., remove characters, so that "<B>bold</B>" can be shown as "bold"):
+ :syn region boldstuff start="<B>" display="" end="</B>" display=""
+7 CTRL-] checks the highlight group for finding out what the tag is.
+7 Add an explanation how a list of words can be used to highlight misspelled
+ words.
+8 Add spell checking. Use "ispell -a" somehow.
+ ~/vim/patches/wm_vim-5_4d.zip can be used as an example (includes ispell
+ inside Vim). Gautam Iyer has an example with "aspell". "engspchk" from
+ Charles Campbell is a good way. Support for approximate-regexps will help
+ (agrep http://www.tgries.de/agrep/).
+7 Command line completion for ":find" should search in 'path'.
+8 Add more command line completion for :syntax.
+8 Add more command line completion for :highlight.
+8 Add more command line completion for :sign.
+7 Should find a better way to parse the :syntax and :highlight commands.
+ Use tables or lists that can be shared by parsing for execution and
+ completion?
+8 Add ColorSchemePost autocommand event, so that scripts can set up their
+ highlighting. (Salman Halim)
+7 Add a few sets of colors (e.g. Borland Turbo C one). With a menu to
+ select one of the sets.
+8 Add offsets to sub-matches: "\(a*\) *"he=e1-1
+ 'e' is end of match 'e1' is end of sub-match 1, 's2' is start of submatch
+ 2, etc.
+8 In Insert mode, when there are typeahead characters, postpone the
+ highlighting (for "." command).
+8 Syncing on comments isn't 100% correct when / / lines mix with / * and * /.
+ For example: What about a line that starts with / / and contains * /?
+8 Ignore / * and * / inside strings, when syncing.
+7 Build a few more syntax files from the file "/usr/share/misc/vgrindefs":
+ ISP, LDL, Icon, ratfor. And check "nedit/source/highlight.c".
+6 Add possibility to have background color continue until the right edge of
+ the window. Useful for comment blocks and function headings. (Rogall)
+- Make it possible to add "contains" items for all items in a group. Useful
+ when extending an already existing syntax file.
+- Add line-continuation pattern for non-syncing items too?
+- Add possibility to highlight specific columns (for Fortran). Or put a
+ line in between columns (e.g. for 'textwidth').
+ Patch to add 'hlcolumn' from Vit Stradal, 2004 May 20.
+- Add possibility to highlight the whole line, including the right margin
+ (for comment blocks).
+- Add 'hlmatch' option: List of flags:
+ 'c': highlight match for character under the cursor.
+ 'b': highlight the previous (, and its match.
+ 'a': highlight all text from the previous ( until its match.
+ Also for {}, <>, etc.?
+ 'e': highlight all braces without a match (slow?)
+ OR: add an argument "cursor" to the syntax command, which means that the
+ region/match/keyword is only highlighted when the cursor is on it.
+ (Campbell)
+ Or do it like Elvis: define text objects and how to highlight them around
+ the cursor. (Iain Truskett)
+7 Make it possible to use all words in the tags files as Keyword.
+ Can also be done with a script (but it's slow).
+7 Make it possible to call a ":" command when a match is found. Should
+ allow for adding keywords from the text (e.g. variables that are set).
+ And allows for sections with different highlighting.
+7 Add highlight group for commandline: "Commandline". Make sure it
+ highlights the command line while typing a command, and any output from
+ messages. And external commands?
+8 Make a version that works like less, but with highlighting: read stdin for
+ text, exit at end of file, don't allow editing, etc. moreim? lessim?
+7 SpecialKey highlighting overrules syntax highlighting. Can't give an
+ unprintable char another color. Would be useful for ^M at end of line.
+
+
+Built-in script language:
+8 Add referring to key options with "&t_xx". Both for "echo &t_xx" and
+ ":let &t_xx =". Useful for making portable mappings.
+8 Allow range for ":exec". Pass it on to the executed command. (Webb)
+8 exists("&&option") tests if 'option' is actually implemented. Useful for
+ 'shellslash', for example.
+7 Be able to call a function while passing on a variable number of
+ arguments:
+ :function Foo(abc, ...)
+ : call Bar(a:abc, a:*)
+ Charles Campbell has a patch for this
+8 Have a look at VSEL. Would it be useful to include? (Bigham)
+8 Add ":fungroup" command, to group function definitions together. When
+ encountered, all functions in the group are removed. Suggest using an
+ obscure name to avoid name clashes. Require a ":fungroup END" in the same
+ sourced file? Assume the group ends at the end of the file. Handle
+ nested packages?
+ Alternative: Support packages. {package-name}:{function-name}().
+ Packages are loaded automatically when first used, from
+ $VIMRUNTIME/packages (or use a search path).
+7 Make globpath() also work with "**" and upwards search. (Brian Medley)
+7 Pre-parse or compile Vim scripts into a bytecode.
+ 1. Put the bytecode with the original script, with an ":if
+ has('bytecode')" around it, so that it's only used with a Vim that
+ supports it. Update the code with a command, can be used in an
+ autocommand.
+ 2. Use a ".vic" file (like Python use .pyc). Create it when writing a
+ .vim file. Problem: distribution.
+ 3. Use a cache directory for each user. How to recognize which cached
+ file belongs to a sourced script?
+7 Add "n" flag to search() function, just like searchpair(). (Alexey
+ Marinichev)
+8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible.
+ Aric Blumer has a patch for this.
+7 Add argument to winwidth() to subtract the space taken by 'foldcolumn',
+ signs and/or 'number'.
+8 Add functions:
+ multibyteidx(string, idx) Byte index in multi-byte character.
+ Patch by Ilya Sher, 2004 Feb 25
+ menuprop({name}, {idx}, {what})
+ Get menu property of menu {name} item {idx}.
+ menuprop("", 1, "name") returns "File".
+ menuprop("File", 1, "n") returns "nmenu
+ File.Open..." argument.
+ Patch by Ilya Sher, 2004 Apr 22
+ mapname({idx}, mode) return the name of the idx'th mapping.
+ Patch by Ilya Sher, 2004 Mar 4.
+ match({pat}, {string} [,start] [,count]) get index of count'th match
+ Patch by Ilya Sher, 2004 Mar 31
+ sprintf(format, arg, ..) How to prevent a crash???
+ mousex() mousey() get position of mouse pointer (patch by Ross
+ Presser)
+ attributes() return file protection flags "drwxrwxrwx"
+ mkdir(dir) Create directory
+ copy(from, to) Copy a file
+ perl(cmd) call Perl and return string
+ shorten(fname) shorten a file name, like home_replace()
+ input(prompt, complete) like input() but do specified completion
+ inputrl() like input() but right-to-left
+ virtualmode() add argument to obtain whether "$" was used in
+ Visual block mode.
+ tagtype(tag) get type of tag (also checks if it exists)
+ getacp() Win32: get codepage (Glenn Maynard)
+ tr(expr, from, to) translate chars (Patch from Ron Aaron, Apr 8
+ 2004)
+ find() find file in 'path' (patch from Johannes
+ Zellner 2001 Dec 20)
+ realname() Get user name (first, last, full)
+ user_fullname() patch by Nikolai Weibull, Nov
+ 3 2002)
+ getfperm() file permissions, in form "rwxrwxrwx"
+ (patch from Nikolai Weibull 2003 Jan 13)
+ getftype() "file", "dir", "link", "other"?
+ (patch from Nikolai Weibull 2003 Jan 13)
+ setbufline() set line in any buffer (patch from Yegappan
+ Lakshmanan, 2003 Jan 21)
+ getbufline() get line from any buffer
+ deletebufline() delete line in any buffer
+ appendbufline() append line in any buffer
+ winnr("$") Get number of windows. (patch from Nikolai
+ Weibull 2003 Jan 13) (another patch from
+ Yegappan Lakshmanan, 2003 Aug 31)
+ search() Add optional offset argument.
+ Add 'n' flag. (patch from Nikolai Weibull
+ 2003 Jan 13)
+ sort() Sort a newline-separated string. Also:
+ ":sort".
+ libcall() Allow more than one argument.
+ libcallext() Like libcall(), but using a callback function
+ to allow the library to execute a command or
+ evaluate an expression.
+ confirm() add "flags" argument, with 'v' for vertical
+ layout and 'c' for console dialog. (Haegg)
+ Flemming Madsen has a patch for the 'c' flag
+ (2003 May 13)
+ system({cmd}, {expr}) Filter {expr} through the shell command
+ {cmd} and return the result.
+ (Patch from Yegappan Lakshmanan)
+ raisewin() raise gvim window (see HierAssist patch for
+ Tcl implementation ~/vim/HierAssist/ )
+ gettext() Translate a message. (Patch from Yasuhiro
+ Matsumoto) How to get the messages into the
+ .po files?
+ strrep() Repeat a string (patch from Christophe Poucet,
+ 2003 Sep 12, also contains XX)
+ char2hex() convert char string to hex string. XX
+ hex2char() convert hex string to char string. XX
+7 Make bufname("'0") return the buffer name from mark '0. How to get the
+ column and line number? col("'0") currently returns zero.
+8 argc() returns 0 when using "vim -t tag". How to detect that no file was
+ specified in any way? To be able to jump to the last edited file.
+8 Pass the executable name to the Vim scripts in some way. As v:argv0?
+8 Add command arguments with three dashes, passed on to Vim scripts.
+8 When starting to source a vim script, delete all functions that it has
+ previously defined? Avoids using ":fun!" all the time.
+7 Add optional arguments to user functions:
+ :func myFunc(arg1, arg2, arg3 = "blah", arg4 = 17)
+6 User functions: Functions local to buffer "b:func()"?
+8 Add ":let var[{expr}] = {expr}". When past the end of "var" just ignore.
+8 The "= register should be writable, if followed by the name of a variable,
+ option or environment variable.
+8 ":let &option" should list the value of the option.
+7 Add synIDlist(), making the whole list of syntax items on the
+ stack available (separated with '\n').
+8 Add autocommand-event for when a variable is changed:
+ :au VarChanged {varname} {commands}
+8 Add "has("gui_capable")", to check if the GUI can be started.
+8 Add possibility to use variables like registers: characterwise (default),
+ linewise (when ending in '\n'), blockwise (when ending in '\001'). reg0,
+ rega, reg%, etc. Add functions linewise({expr}), blockwise({expr}) and
+ charwise({expr}).
+7 Make it possible to do any command on a string variable (make a buffer
+ with one line, containing the string). Maybe add an (invisible) scratch
+ buffer for this?
+ result = scratch(string, command)
+ result = apply(string, command)
+ result = execute(string, command)
+ "command" would use <> notation.
+ Does scratch buffer have a number? Or re-use same number?
+7 Add function to generate unique number (date in milliseconds).
+7 Automatically load a function from a file when it is called. Need an
+ option for the search path. (Sekera)
+7 Persistent variables: "p:var"; stored in viminfo file and sessions files.
+7 Include support for arrays? Patch from Robert Webb.
+ This is restricted to fixed-size arrays indexed by number. Better: Use
+ associative arrays: a[5] = 3, a["some"] = 'x'. Implement by translating
+ into ordinary variables: a[5] is "-a-5", a["some"] is "a-some", a[5][6] is
+ "a-5-6". But how to do array assignment and concatenation?
+ Alternative: use dictionaries, like Python.
+
+
+Robustness:
+8 This pattern in syntax/java.vim causes a recursive call of regmatch():
+ syn match javaStringError +"\([^"\\]\|\\.\)*$+
+ A long line with a " in it can cause a crash when it runs out of stack
+ space (on systems where this isn't caught). How can we catch this for
+ more systems?
+
+
+Performance:
+8 Loading plugins takes startup time. Only load the part that is used to
+ trigger the rest, and load the rest when it's needed?
+8 Turn b_syn_ic and b_syn_containedin into b_syn_flags.
+9 Loading menu.vim still takes quite a bit of time. How to make it faster?
+8 in_id_list() takes much time for syntax highlighting. Cache the result?
+7 setpcmark() shifts the jumplist, this takes quite a bit of time when
+ jumping around. Instead use an index for the start?
+8 When displaying a space with only foreground highlighting, it's the same
+ as a space without attributes. Avoid displaying spaces for the "~" lines
+ when starting up in a color terminal.
+8 Avoid alloc() for scratch buffer use, esp. in syntax.c. It's very slow on
+ Win16.
+9 Setting GUI options in the console (e.g., 'guifont') should not cause a
+ redraw.
+8 Profiling shows that in_id_list() is used very often for C code. Can this
+ function be improved?
+8 For an existing file, the page size of the swap file is always the
+ default, instead of using the block size of the device, because the swap
+ file is created only after setting the block size in mf_open(). How can
+ this be improved?
+8 Set default for 'ttyscroll' to half a screen height? Should speed up
+ MS-DOS version. (Negri)
+7 C syntax highlighting gets a lot slower when adding a region for folding
+ from { to }. (Charles Campbell) Inserting a "{" is very slow. (dman)
+7 HTML syntax highlighting is slow for long lines. Try displaying
+ http://www.theregister.co.uk/content/4/22908.html. (Andre Pang)
+7 Check how performance of loading the wordlist can be improved (adding a
+ lot of abbreviations).
+7 DOS console: Add t_DL support, to make scrolling faster.
+7 Compile Ex commands to byte codes. Store byte codes in a vim script file
+ at the end, after "compiled:. Make it look like a single comment line
+ for old Vim versions. Insert first line "Vim script compiled <timestamp>.
+ Only used compiled code when timestamp matches the file stat.
+ Add command to compile a vim script and add it to the file in-place.
+ Split Ex command executing into a parsing and executing phase.
+ Use compiled code for functions, while loops, etc.
+8 When editing a file with extremely long lines (e.g., an executable), the
+ "linerest" in readfile() is allocated twice to be able to copy what was
+ read so far. Use realloc() instead? Or split the line when allocating
+ memory fails and "linerest" is big (> 100000)?
+8 When defining autocommands (e.g., from $VIMRUNTIME/filetype.vim), need to
+ compare each pattern with all existing patterns. Use a hash code to avoid
+ using strcmp() too often?
+7 Include turbo_loader patches, speeding up reading a file?
+ Speed up reading a file by reading it into a fixed-size buffer, creating
+ the list of indexes in another buffer, and then copying the result into a
+ memfile block with two copies. Then read the next block into another
+ fixed-size buffer, create the second list of indexes and copy text from
+ the two blocks to the memfile block.
+7 do_cmdline(): Avoid that the command line is copied to allocated memory
+ and freed again later all the time. For while loops, and for when called
+ with an argument that can be messed with.
+ Generic solution: Make a struct that contains a pointer and a flag that
+ indicates if the pointer should be freed when replaced.
+7 Check that the file size is not more than "sizeof(long)".
+- Further improve finding mappings in maphash[] in vgetorpeek()
+8 Syntax highlighting is slow when deleting lines. Try in
+ $VIMRUNTIME/filetype.vim.
+- "out of memory" after deleting (1,$d) and changing (:%s/^/> /) a lot of
+ lines (27000) a few times. Memory fragmentation?
+- Have a look at how pdksh does memory allocation (alloc.c). (Dalecki)
+- Do profiling on:
+ - :g/pat/normal cmd
+ - 1000ii<Esc>
+ - deleting 10Mbyte worth of lines (netscape binary)
+ - "[i" and "[d" (Yegappan Lakshmanan)
+ - ":g/^/m0" on a 450Kbyte file. And the "u".
+ - highlighting "~/vim/test/longline.tex", "~/vim/test/scwoop.tcl" and
+ "~/vim/test/lockup.pl".
+ - loading a syntax file to highlight all words not from a dictionary.
+ - editing a vim script with syntax highlighting on (loading vim.vim).
+7 Screen updating can be further improved by only redrawing lines that were
+ changed (and lines after them, when syntax highlighting was used, and it
+ changed).
+ - On each change, remember start and end of the change.
+ - When inserting/deleting lines, remember begin, end, and line count.
+- Use macros/duarte/capicua for profiling. Nvi 1.71 is the fastest!
+- When using a file with one long line (1Mbyte), then do "$hhhh", is still
+ very slow. Avoid calling getvcol() for each "h"?
+- Executing a register, e.g. "10000@@" is slow, because ins_typebuf has to
+ move the previous commands forward each time. Pass count from
+ normal_cmd() down to do_execreg().
+- Repeating insert "1000i-<Esc>" displays --INSERT-- all the time, because of
+ the <Esc> at the end. Make this work faster (disable redrawing).
+- Avoid calls to plines() for cursor line, use w_cline_height.
+- After ":set nowrap" remove superfluous redraw with wrong hor. offset if
+ cursor is right of the screen.
+8 Make CTRL-C on Unix generate a signal, avoid using select() to check for a
+ CTRL-C (it's slow).
+
+
+Code size:
+8 GUI: When NO_CONSOLE is defined, more code can be excluded.
+- Put getline() and cookie in a struct, so only one argument has to be
+ passed to do_cmdline() and other functions.
+8 Make a GUI-only version for Unix?
+8 In buf_write _() isn't needed when setting errmsg, do it once when using
+ it.
+7 When compiling with a GUI-only version, the code for cterm colors can be
+ left out.
+8 When compiled with a GUI-only version, the termcap entries for terminals
+ can be removed.
+8 Can the check for libelf in configure.in be removed?
+
+
+Messages:
+8 When using ":q" in a changed file, the error says to "add !". Add the
+ command so that beginners understand it: "use :q!".
+8 For 'verbose' level 12 prints commands from source'ed files. How to skip
+ lines that aren't executed? Perhaps move the echoing to do_cmdline()?
+8 Use 'report' for ":bdel"? (Krishna) To avoid these messages when using a
+ script.
+8 "vim --version" output goes to stderr, should be stdout. Can all output
+ from messages using printf() go to stdout?
+- Delete message after new command has been entered and have waited for key.
+ Perhaps after ten seconds?
+- Make message history available in "msg" variables: msg1, msg2, .. msg9.
+9 Check handling of overwriting of messages and delays:
+ Very wrong: errors while redrawing cause endless loop.
+ When switching to another file and screen scrolls because of the long
+ message and return must be typed, don't scroll the screen back before
+ redrawing.
+7 Add an option, which is a regexp, that disables warning messages which
+ match that regexp (Tsirkin).
+8 When address range is wrong you only get "Invalid range". Be a bit more
+ specific: Negative, beyond last line, reverse range? Include the text.
+8 Make it possible to ignore errors for a moment ('errorignore'?). Another
+ option to switch off giving error messages ('errorquiet'?). Also an option
+ not to give any messages ('quiet')? Or ":quiet on", ":quiet off".
+ Careful: For a severe error (out of memory), and when the user starts
+ typing, error messages must be switched back on.
+ Also a flag to ignore error messages for shell commands (for mappings).
+- Option to set time for emsg() sleep. Interrupt sleep when key is typed?
+ sleep before second message?
+8 In Ex silent mode or when reading commands from a file, what exactly is
+ not printed and what is? Check ":print", ":set all", ":args", ":vers",
+ etc. At least there should be no prompt. (Smulders) And don't clear the
+ screen when reading commands from stdin. (Kendall)
+ --> Make a difference between informative messages, prompts, etc. and
+ error messages, printing text, etc.
+8 Window should be redrawn when resizing at the hit-enter prompt.
+ Also at the ":tselect" prompt. Find a generic solution for redrawing when
+ a prompt is present (with a callback function?).
+
+
+Screen updating:
+7 Add a string to the 'display' option to make CTRL-E and CTRL-Y scroll one
+ screen line, also if this means the first line doesn't start with the
+ first character (like what happens with a single line that doesn't fit).
+- screen_line():
+ - insert/delete character stuff.
+ - improve delete rest of line (spaces at end of line).
+- When moving or resizing window, try to avoid a complete redraw (esp. when
+ dragging the status line with the mouse).
+- When 'lazyredraw' set, don't echo :ex commands? Need a flag to redraw when
+ waiting for a character.
+8 Add a ":refresh [winnr]" command, to force updating a window. Useful from
+ an event handler where ":normal" can't be used. Also useful when
+ 'lazyredraw' is set in a mapping.
+7 Make 'list' and 'linebreak' work together.
+7 Add "nbsp" in 'listchars'? Patch from David Blanchet, 2003 Jul 28.
+
+
+Scrolling:
+8 Add "zm" command: scroll horizontally to put the cursor in the middle.
+6 Add option to set the overlap for CTRL-F and CTRL-B. (Garhi)
+- extend 'scrollbind' option: 'scrollopt' words "search", "relative", etc..
+ Also 'e'xecute some commands (search, vertical movements) in all bound
+ windows.
+7 Add 'scrollbind' feature to make the offset of one window with the next
+ one equal to the window height. When editing one file in both windows it
+ looks like each window displays a page of the buffer.
+- Allow scrolling by dragging with the mouse (grab a character and move it
+ up/down). Like the "hand" in Acrobat reader. Use Alt-LeftMouse for this?
+ (Goldfarb)
+- Add command to execute some commands (search, vertical movements) in all
+ bound windows.
+- Add 'search' option to 'scrollopt' to allow 'scrollbind' windows to
+ be bound by regexp searches
+- Add "z>" and "z<": scroll sideways one screenfull. (Campbell)
+- Add option to set the number of lines when not to scroll, instead of the
+ fixed number used now (for terminals that scroll slow with a large number
+ of lines but not with a single line).
+
+
+Autoconf:
+8 Should use acconfig.h to define prototypes that are used by autoheader.
+8 Some compilers don't give an error for "-OPT:Olimit" but a warning. (Webb)
+ Add a check for the warning, so that "Olimit" can be added automatically?
+- Autoconf: Use @datadir@ for the system independent files. Make sure the
+ system dependent and system independent files are separated. (Leitner).
+- Add autoconf check for waitpid()/wait4().
+- Remove fcntl() from autoconf, all systems have it?
+- Set default for 'dictionary', add search for dictionary to autoconf.
+
+
+Perl interface:
+8 Rename typemap file to something else?
+7 Add patch from Benoit Cerrina to integrate Vim and Perl functions better.
+ Now also works for Ruby (2001 Nov 10)
+7 Make buffers accessed as Perl arrays. (Clark)
+7 Make it possible to compile with non-ANSI C?
+6 Tcl/Tk has the "load" command: load a shared library (.so or .dll).
+
+
+Shared libraries:
+6 Add support for loading shared libraries, and calling functions in it.
+ :libload internal-name libname
+ :libunload internal-name
+ :liblist
+ :libcall internal-name function(arg1, arg2, ...)
+ :libcall function(arg1, arg2, ...)
+ libcall() can have only one integer or String argument at the moment.
+6 Have a look on how Perl handles loading dynamic libraries.
+
+
+Tags:
+8 Add a command to jump to a certain kind of tag. Allow the user to specify
+ values for the optional fields. E.g., ":tag size type=m".
+8 Add a function that returns the line in the tags file for a matching tag.
+ Can be used to extract more info (class name, inheritance, etc.) (Rico
+ Hendriks)
+7 Count before CTRL-]: jump to N'th match
+8 Scope arguments for ":tag", e.g.: ":tag class:cPage open", like Elvis.
+8 When output of ":tselect" is long, getting the more-prompt, should be able
+ to type the tag number directly.
+7 Add a tag-select window. Works like ":cwindow". (Michal Malecki)
+7 Add the possibility to use the "-t {tag}" argument multiple times. Open a
+ window for each tag.
+7 Make output of ":tselect" a bit nicer. Use highlighting?
+7 Highlight the "tag 1 of >2" message. New highlight group, or same as "hit
+ bottom" search message.
+7 When using ":tag" at the top of the tag stack, should add another entry,
+ so CTRL-T can bring you back to where you are now AND to where you were
+ before the previous ":tag" command. (Webb)
+7 When using CTRL-] on someClass::someMethod, separate class from method and
+ use ":ta class:someClass someMethod".
+ Include C++ tags changes (Bertin). Change "class::func" tag into "func"
+ with "class=class"? Docs in oldmail/bertin/in.xxx.
+7 Add ":tagargs", to set values for fields:
+ :tagargs class:someclass file:version.c
+ :tagargs clear
+ These are then the default values (changes the order of priority in tag
+ matching).
+7 Support for "gtags" and "global"? With ":rtag" command?
+ There is an example for how to do this in Nvi.
+ Or do it like Elvis: 'tagprg' and 'tagprgonce' options. (Yamaguchi)
+ The Elvis method is far more flexible, do it that way.
+7 Support "col:99" extra field, to position the cursor in that column. With
+ a flag in 'cpoptions' to switch it off again.
+7 Better support for jumping to where a function or variable is used. Use
+ the id-utils, with a connection to "gid" (Emacs can do it too). Add
+ ":idselect", which uses an "ID" database (made by "mkid") like "tselect".
+7 Add 'taglistfiles' option, show file name and type when listing matching
+ tags name with CTRL-D completion. Patch from Yegappan Lakshmanan.
+
+
+Security:
+- nothing at the moment
+
+
+Win32 GUI:
+8 Make debug mode work while starting up (vim -D). Open console window for
+ the message and input?
+7 The Python interface only works with one version of Python, selected at
+ compile time. Can this be made to work with version 2.1 and 2.2
+ dynamically?
+7 GvimExt: when there are several existing Vims, move the list to a submenu.
+ (Mike McCollister)
+8 When using "Edit with Vim" for one file it changes directory, when several
+ files are selected and using "Edit with single Vim" the directory isn't
+ changed. At least change directory when the path is the same for all
+ files. Perhaps just use the path of the first file or use the longest
+ common part of the path.
+8 Add font argument to set the lfCharSet. (Bobcik)
+8 Somehow automatically detect the system language and set $LANG, so that
+ gettext and menus work.
+8 Could keep console open to run multiple commands, to avoid the need to hit
+ return in every console.
+ Also: Look at how Emacs does runs external commands:
+ http://www.cs.washington.edu/homes/voelker/ntemacs.html.
+8 Need a separate PopUp menu for modeless selection. Need two new commands:
+ Copy selection to clipboard, Paste selection (as typed text).
+8 Support copy/paste for other file formats. At least HTML, perhaps RTF.
+ Add "copy special" and "paste special" commands?
+7 Use different default colors, to match the current Windows color scheme.
+ Sys_WindowText, Sys_Window, etc. (Lionel Schaffhauser)
+7 Use <C-Tab> to cycle through open windows (e.g., the find dialog).
+7 <Esc> should close a dialog.
+7 Keep the console for external commands open. Don't wait for a key to be
+ hit. Re-open it when the user has closed it anyway. Or use a prepended
+ command: ":nowait {cmd}", or ":quiet", which executes {cmd} without any
+ prompts.
+7 Should be able to set an option so that when you double click a file that
+ is associated with Vim, you can either get a new instance of Vim, or have
+ the file added into an already running Vim.
+7 The "-P" argument only works for the current codepage. Use wide
+ functions to find the window title.
+
+
+GUI:
+8 Add GTK 2.3 file dialog support. Patch by Grahame Bowland, 2004 Mar 15,
+ but it doesn't use "initdir" or "dflt".
+8 Make inputdialog() work for Photon, Amiga, RiscOS.
+- <C--> cannot be mapped. Should be possible to recognize this as a
+ normal "-" with the Ctrl modifier.
+7 Implement ":popup" for other systems than Windows.
+8 Implement ":tearoff" for other systems than Win32 GUI.
+6 Implement ":untearoff": hide a torn-off menu.
+8 When using the scrollbar to scroll, don't move the cursor position. When
+ moving the cursor: scroll to the cursor position.
+9 Make <S-Insert> paste from the clipboard by default. (Kunze)
+7 Menu local to a buffer, like mappings. Or local to a filetype?
+8 In Buffers menu, add a choice whether selecting a buffer opens it in the
+ current window, splits the window or uses ":hide".
+8 Dragging the mouse pointer outside of a Vim Window should make the text
+ scroll. Return a value from gui_send_mouse_event() to the machine
+ specific code to indicate the time in which the event should be repeated.
+8 Make it possible to ignore a mouse click when it's used to give Vim (gvim)
+ window focus. Also when a mouse click is used to bring a window to front.
+8 Make the split into system independent code and system specific code more
+ explicit. There are too many #ifdefs in gui.c.
+ If possible, separate the Vim code completely from the GUI code, to allow
+ running them in separate processes.
+8 Support a background bitmap. Useful for marking a column. Patch from
+ Heather Downs (GTK) and Vince Negri (Win32).
+7 X11: Support cursorColor resource and "-cr" argument.
+8 X11 (and others): CTRL-; is not different from ';'. Set the modifier mask
+ to include CTRL for keys where CTRL produces the same ASCII code.
+7 Add some code to handle proportional fonts? Need to draw each character
+ separately (like xterm). Also for when a double-width font is not exactly
+ double-width. (Maeda)
+8 Should take font from xterm where gvim was started (if no other default).
+8 Selecting font names in X11 is difficult, make a script or something to
+ select one. Martin Dalecki has a font selector for Motif, but it needs a
+ bit more work.
+7 Motif: use the menu font consistently. Patch from Martin Dalecki 2002 Jan
+ 11.
+8 Visual highlighting should keep the same font (bold, italic, etc.).
+8 Add flag to 'guioptions' to not put anything in the clipboard at all?
+8 Should support a way to use keys that we don't recognize yet. Add a
+ command that adds entries to special_keys somehow. How do we make this
+ portable (X11, Win32, ..)?
+7 Add a flag to 'guioptions' that tells not to remove inactive menu items.
+ For systems where greying-out or removing menu items is very slow. The
+ menu items would remain visibly normally, but not do anything.
+7 Add ":minimize" and ":maximize", which iconize the window and back.
+ Useful when using gvim to run a script (e.g. 2html.vim).
+7 X11: Is it possible to free allocated colors, so that other programs can
+ use them again? Otherwise, allow disabling allocating the default colors.
+ Or allocate an own colormap (check UAE). With an option to use it. For
+ the commandline, "-install" is mostly used for X11 programs.
+7 Add command line argument for "gvim" not to start the GUI. Sort of the
+ inverse of "vim -g". (Vikas)
+7 Should support multi-column menus.
+- Should add option for where to put the "Help" menu: like Motif at the far
+ right, or with the other menus (but still at the right).
+- Add menu item to "Keep Insert mode".
+8 ":mkgvimrc" command, that includes menus.
+6 Big change: Move GUI to separate program "vimgui", to make startup of vim a
+ lot faster, but still be able to do "vim -g" or ":gui".
+7 More explicit mouse button binding instead of 'mousemodel'?
+7 Add option to set the position of the window on the screen. 'windowpos',
+ which has a value of "123,456": <x>,<y>.
+ Or add a command, like ":winsize"?
+7 Add toolbar for more GUIs.
+8 Make it possible to use "amenu icon=BuiltIn##", so that the toolbar item
+ name can be chosen free.
+7 Make it possible to put the toolbar on top, left, right and/or bottom of
+ the window? Allows for softkey-like use.
+6 Separate the part of Vim that does the editing from the part that runs the
+ GUI. Communicate through a pseudo-tty. Vim starts up, creates a
+ pty that is connected to the terminal. When the GUI starts, the pty is
+ reconnected to the GUI process. When the GUI stops, it is connected to
+ the terminal again. Also use the pty for external processes, it looks
+ like a vt100 terminal to them. Vim uses extra commands to communicate GUI
+ things.
+7 Motif: For a confirm() dialog <Enter> should be ignored when no default
+ button selected, <Esc> should close the dialog.
+- Motif steals <F10> from us, to pop up menus with the keyboard. How do we
+ get it back if we want it?
+- Motif: add 3D shading for the menu entries? Patch from Martin Dalecki.
+- Paste in Insert mode should not do autowrap etc. Or maybe this should be
+ changeable with an option?
+- Put a nice picture in the icon (but how do we do that?).
+7 When using a pseudo-tty Vim should behave like some terminal (vt52 looks
+ simple enough). Terminal codes to/from shell should be translated.
+- Would it be useful to be able to quit the GUI and go back to the terminal
+ where it was started from?
+7 Support "-visual <type>" command line argument.
+
+
+VMS:
+- Improvement: rewrite term/TTY handling.
+- Improvement: create VMS GTK runtime libraries on OpenVMS 7.1-2 (today GTK
+ works just on 7.3).
+
+
+Autocommands:
+9 Make sure that side effects of autocommands are handled correctly. Don't
+ execute autocommands when a buffer or window is halfway some changes.
+ Move all apply_autocmds() calls to a higher level where needed.
+8 Add ScriptReadCmd event: used to load remote Vim scripts, e.g.
+ "vim -u http://mach/path/vimrc".
+8 Use another option than 'updatetime' for the CursorHold event. The two
+ things are unrelated for the user (but the implementation is more
+ difficult).
+8 Also trigger CursorHold in Insert mode?
+7 Add autocommand event for when a buffer cannot be abandoned. So that user
+ can define the action taking (autowrite, dialog, fail) based on the kind
+ of file. (Yakov Lerner) Or is BufLeave sufficient?
+8 Can't use ":normal" in CursorHold autocommands. Make the CursorHold event
+ insert a special key code, and call the autocommand functions from a
+ higher level, so that vgetc() isn't used recursively.
+8 Autocommands should not change registers. And marks? And the jumplist?
+ And anything else?
+8 Autocommand for when modified files have been found, when getting input
+ focus again (e.g., FileChangedFocus).
+ Check when: getting focus, jumping to another buffer, ...
+8 Add autocommands, user functions and user commands to ":mkvimrc".
+8 Add "TagJumpFile" autocommand: When jumping to another file for a tag.
+ Can be used to open "main.c.gz" when "main.c" isn't found.
+6 Add KeymapChanged event, so that the effects of a different keymap can be
+ handled (e.g., other font) (Ron Aaron)
+7 Add a way to skip an autocommand if going from one *.c file to another *.c
+ file.
+7 When trying to open a directory, don't load the file but trigger an
+ autocommand event OpenDirectory.
+7 Add file type in front of file pattern: <d> for directory, <l> for link,
+ <x> for executable, etc. <&xxx> for Risc OS. With commas to separate
+ alternatives. The autocommand is only executed when both the file type
+ AND the file pattern match. (Leonard)
+5 Add option that specifies extensions which are to be discarded from the
+ file name. E.g. 'ausuffix', with ".gz,.orig". Such that file.c.gz will
+ trigger the "*.c" autocommands. (Belabas)
+7 Add something to break the autocommands for the current event, and for
+ what follows. Useful for a "BufWritePre" that wants to avoid writing the
+ file.
+8 When editing "tt.gz", which is in DOS format, 'fileformat' stays at
+ "unix", thus writing the file changes it. Somehow detect that the read
+ command used dos fileformat. Same for 'fileencoding'.
+8 Add buffer-local autocommands? Reduces overhead for autocommands that
+ trigger often (inserting a character, switching mode).
+ :au Event <buffer> do-something
+ E.g.:
+ :au BufEnter <buffer> menu enable ...
+ :au BufLeave <buffer> menu disable ...
+ Patch from Yakov Lerner, including test (2004 Jan 7).
+- Add events to autocommands:
+ Error - When an error happens
+ NormalEnter - Entering Normal mode
+ InsertEnter - Entering Insert mode
+ ReplaceEnter - Entering Replace mode
+ CmdEnter - Entering Cmdline mode
+ VisualEnter - Entering Visual mode
+ CmdUndefined - Like FuncUndefined but for user commands.
+ *Leave - Leaving the mode
+ SearchPost - After doing a search command (e.g. to do "M")
+ PreDirChanged/PostDirChanged
+ - Before/after ":cd" has been used (for changing the
+ window title)
+ BufReadAction - replaces reading a file
+ BufWriteAction - replaces writing a file
+ ShutDown - when the system is about to shut down
+ InsertCharPre - user typed character Insert mode, before inserting the
+ char. Pattern is matched with text before the cursor.
+ Set v:char to the character, can be changed.
+ (not triggered when 'paste' is set).
+ InsertCharPost - user typed a character in Insert mode, after inserting
+ the char.
+ BufModified - When a buffer becomes modified, or unmodified (for
+ putting a [+] in the window title or checking out the
+ file from CVS).
+ BufFirstChange - When making a change, when 'modified' is set. Can be
+ used to do a :preserve for remote files.
+ BufChange - after a change was made. Set some variables to indicate
+ the position and number of inserted/deleted lines, so
+ that marks can be updated. HierAssist has patch to add
+ BufChangePre, BufChangePost and RevertBuf. (Shah)
+ WinResized - When a window has been resized
+ VimResized - When the Vim window has been resized (SIGWINCH)
+ patch from Yakov Lerner, 2003 July 24.
+- Add autocommand to be executed every so many seconds? For writing the
+ file now and then ('autosave').
+ *'autosave'* *'as'* *'noautosave'* *'noas'*
+ 'autosave' 'aw' number (default 0)
+ Automatically write the current buffer to file N seconds after the
+ last change has been made and when |'modified'| is still set.
+ Default: 0 = do not autosave the buffer.
+ Alternative: have 'autosave' use 'updatetime' and 'updatecount' but make
+ them save the file itself besides the swapfile.
+
+
+Insert mode completion/expansion:
+8 When there is no word before the cursor but something like "sys." complete
+ with "sys.". Works well for C and similar languages.
+9 ^X^L completion doesn't repeat correctly. It uses the first match with
+ the last added line, instead of continuing where the last match ended.
+ (Webb)
+8 The code has become too complex. Redesign it, or at least add proper
+ comments.
+8 Add option to set different behavior for Insert mode completion:
+ - ignore/match case
+ - different characters than 'iskeyword'
+8 Add expression-expansion, so that the user can define his own kind of
+ completion. Patch from Taro Muraoka, 2003 Aug 26.
+8 Add a command to undo the completion, go back to the original text.
+8 Use the class information in the tags file to do context-sensitive
+ completion. After "foo." complete all member functions/variables of
+ "foo". Need to search backwards for the class definition of foo.
+ Should work for C++ and Java.
+ Even more context would be nice: "import java.^N" -> "io", "lang", etc.
+7 When expanding $HOME/dir with ^X^F keep the $HOME (with an option?).
+7 Add CTRL-X command in Insert mode like CTRL-X CTRL-N, that completes WORDS
+ instead of words.
+8 Add CTRL-X CTRL-R: complete words from register contents.
+8 Add completion of previously inserted texts (like what CTRL-A does).
+ Requires remembering a number of insertions.
+8 Add 'f' flag to 'complete': Expand file names.
+ Also apply 'complete' to whole line completion.
+- Make it possible to search include files in several places. Use the
+ 'path' option? Can this be done with the dictionary completion (use
+ wildcards in the file name)?
+- Make CTRL-X CTRL-K do a binary search in the dictionary (if it's sorted).
+- Speed up CTRL-X CTRL-K dictionary searching (don't use a regexp?).
+- Set a mark at the position where the match was found (file mark, could
+ be in another file).
+- Add CTRL-A command in CTRL-X mode: show all matches.
+- Make CTRL-X CTRL-L use the 'complete' option?
+- Add command in CTRL-X mode to add following words to the completed string
+ (e.g. to complete "Pointer->element" with CTRL-X CTRL-P CTRL-W CTRL-W)
+- CTRL-X CTRL-F: Use 'path' to find completions.
+- CTRL-X CTRL-F: Option to use forward slashes on MS-Windows?
+- CTRL-X CTRL-F: Don't replace "$VIM" with the actual value. (Kelly)
+8 Add option 'isexpand', containing characters when doing expansion (so that
+ "." and "\" can be included, without changing 'iskeyword'). (Goldfarb)
+ Also: 'istagword': characters used for CTRL-].
+ When 'isexpand' or 'istagword' are empty, use 'iskeyword'.
+- Allow listing all matches in some way (and picking one from the list).
+
+
+Command line editing:
+7 Add commands (keys) to delete from the cursor to the end of the command
+ line.
+8 Custom completion of user commands can't use the standard completion
+ functions. Add a hook to invoke a user function that returns the type of
+ completion to be done: "file", "tag", "custom", etc.
+- Add flags to 'whichwrap' for command line editing (cursor right at end of
+ lines wraps to start of line).
+- Make editing the command line work like Insert mode in a single-line view
+ on a buffer that contains the command line history. But this has many
+ disadvantages, only implement it when these can be solved. Elvis has run
+ into these, see remarks from Steve (~/Mail/oldmail/kirkendall/in.00012).
+ - Going back in history and editing a line there would change the history.
+ Would still need to keep a copy of the history elsewhere. Like the
+ cmdwin does now already.
+ - Use CTRL-O to execute one Normal mode command. How to switch to normal
+ mode for more commands? <Esc> should cancel the command line. CTRL-T?
+ - To allow "/" and "= need to recursively call getcmdline(), overwrite the
+ cmdline. But then we are editing a command-line again. How to avoid
+ that the user gets confused by the stack of command lines?
+ - Use edit() for normal cmdline editing? Would have to integrate
+ getcmdline() into edit(). Need to solve conflicts between Insert mode
+ and Command-line mode commands. Make it work like Korn shell and tcsh.
+ Problems:
+ - Insert: completion with 'wildchar'
+ - Insert: use cmdline abbreviations
+ - Insert: CTRL-D deletes indent instead of listing matches
+ - Normal: no CTRL-W commands
+ - Normal: no ":" commands?
+ - Normal: allow Visual mode only within one line.
+ - where to show insert/normal mode message? Change highlighting of
+ character in first column?
+ - Implementation ideas:
+ - Set "curwin" and "curbuf" to the command line window and buffer.
+ - curwin->w_topline is always equal to curwin->w_cursor.lnum.
+ - never set 'number', no folding, etc. No status line.
+ - sync undo after entering a command line?
+ - use NV_NOCL flag for commands that are not allowed in Command-line
+ Mode.
+
+
+Command line completion:
+8 Change expand_interactively into a flag that is passed as an argument.
+8 With command line completion after '%' and '#', expand current/alternate
+ file name, so it can be edited. Also with modifiers, such as "%:h".
+8 When completing command names, either sort them on the long name, or list
+ them with the optional part inside [].
+7 Completion of network shares, patch by Yasuhiro Matsumoto.
+7 Completion of ":map x ": fill in the current mapping, so that it can be
+ edited. (Sven Guckes)
+7 Add completion for when entering an expression after CTRL-R= and "=.
+ (Servatius Brandt)
+- For 'wildmenu': Simplify "../bar" when possible.
+- When using <Up> in wildmenu mode for a submenu, should go back to the
+ current menu, not the first one. E.g., ":emenu File.Save<Up>".
+8 For ":find" and ":sfind" expand files found in 'path'.
+8 Add cmdline completion for the ":debug" command.
+8 When using backtick expansion, the external command may write a greeting
+ message. Add an option or commands to remove lines that match a regexp?
+7 When listing matches of files, display the common path separately from the
+ file names, if this makes the listing shorter. (Webb)
+- Add command line completion for ":ilist" and friends, show matching
+ identifiers (Webb).
+8 Add command line completion for "old value" of a command. ":args <key>"
+ would result in the current list of arguments, which you can then edit.
+7 Add command line completion with CTRL-X, just like Insert mode completion.
+ Useful for ":s/word/xx/".
+- Add command to go back to the text as it was before completion started.
+ Also to be used for <Up> in the command line.
+- Add 'wildlongest' option: Key to use to find longest common match for
+ command line completion (default CTRL-L), like 'wildchar'. (Cregut)
+ Also: when there are several matches, show them line a CTRL-D.
+- Add completion for Environment variables: ":echo $SH<Tab>" -> "$SHELL".
+
+
+Command line history:
+- Add "KeyWasTyped" flag: It's reset before each command and set when a
+ character from the keyboard is consumed. Value is used to decide to put a
+ command line in history or not. Put line in history if it didn't
+ completely resulted from one mapping.
+- When using ":browse", also put the resulting edit command in the history,
+ so that it can be repeated. (Demirel)
+
+
+Insert mode:
+9 When 'autoindent' is set, hitting <CR> twice, while there is text after
+ the cursor, doesn't delete the autoindent in the resulting blank line.
+ (Rich Wales) This is Vi compatible, but it looks like a bug. Rich has a
+ suggestion for a patch to fix this.
+8 When using CTRL-O in Insert mode, then executing an insert command
+ "a" or "i", should we return to Insert mode after <Esc>? (Eggink)
+ Perhaps it can be allowed a single time, to be able to do
+ "<C-O>10axyz<Esc>". Nesting this further is confusing.
+ ":map <F2> 5aabc<Esc>" works only once from Insert mode.
+7 Use CTRL-G <count> to repeat what follows. Useful for inserting a
+ character multiple times or repeating CTRL-Y.
+7 Make ":startinsert" command work directly for functions and scripts?
+ Also make it possible to append (it's difficult at end of line).
+ And add ":startreplace" (patch by Charles Campbell, 2004 Jan 9,
+ http://www.erols.com/astronaut/vim/index.html#Patch)
+7 Use 'matchpairs' for 'showmatch': When inserting a character check if it
+ appears in the rhs of 'matchpairs'.
+- In Insert mode (and command line editing?): Allow undo of the last typed
+ character. This is useful for CTRL-U, CTRL-W, delete and backspace, and
+ also for characters that wrap to the next line.
+ Also: be able to undo CTRL-R (insert register).
+ Possibly use 'backspace'="whole" for a mode where at least a <CR> that
+ inserts autoindent is undone by a single <BS>.
+- Use CTRL-G in Insert mode for an extra range of commands, like "g" in
+ Normal mode.
+- Make 'paste' work without resetting other options, but override their
+ value. Avoids problems when changing files and modelines or autocommands
+ are used.
+- When typing CTRL-V and a digit higher than 2, only expect two digits.
+- Insert binary numbers with CTRL-V b.
+- Make it possible to undo <BS>, <C-W> and <C-U>. Bash uses CTRL-Y.
+
+
+'cindent', 'smartindent':
+8 Wrong indent for ":" after a method with line break in arguments:
+ Foo::Foo (int one,
+ int two)
+ : something(4)
+ {}
+8 Wrong indent for ":" after a method with multiple lines:
+ Foo::Foo (int one, int two)
+ : something(4),
+ somethingelse(3)
+ {}
+9 Too much indent for "lulu": (Uwe Zeisberger)
+ int main ()
+ {
+ if (lala)
+ do
+ ++(*lolo);
+ while (lili
+ && lele);
+ lulu;
+ }
+9 Function gets extra indent: (Jamax)
+ void function(int param) {
+ if (false)
+ return;
+ }
+9 brace not indented correctly:
+ case 'c': if (cond)
+ {
+ Should align with "if" in case statement.
+7 Allow aligning a closing ")" with the line above, instead of the matching
+ "(": (Riehm) if (asdfasdf &&
+ asdf
+ )
+8 Java: Inside an anonymous class, after an "else" or "try" the indent is
+ too small. (Vincent Bergbauer)
+8 In C++ it's possible to have {} inside (): (Kirshna)
+ func(
+ new String[] {
+ "asdf",
+ "asdf"
+ }
+ );
+7 Separate "(0" option into inside/outside a function (Zellner):
+ func(
+ int x) // indent like "(4"
+ {
+ if (a
+ && b) // indent like "(0"
+8 Strange problem with this code, "hello" is indented wrong: (Gary Holloway)
+ main() { char foo[] = "/*";
+ /* This is a comment; the indentation of C
+ * source below this comment gets messed up due to the string above.
+ */
+ hello
+9 Using "{" in a comment: (Helmut Stiegler)
+ if (a)
+ {
+ if (b)
+ {
+ // {
+ }
+ } <-- this is indented incorrect
+9 Wrong indent for cino=(4, removing the (void) fixes it: (Zellner)
+ (void) MyFancyFunction(
+ argument);
+- Make smartindenting configurable. Add 'sioptions', e.g. '#' setting the
+ indent to 0 should be switched on/off.
+7 Support ANSI style function header, with each argument on its own line.
+- "[p" and "]p" should use 'cindent' code if it's on (only for the first
+ line).
+- Add option to 'cindent' to set indent for comments outside of {}?
+- Make a command to line up a comment after a code line with a previous
+ comment after a code line. Can 'cindent' do this automatically?
+7 Add 'j' flag to 'formatoptions': Remove comment leader when joining lines.
+- When 'cindent'ing a '}', showmatch is done before fixing the indent. It
+ looks better when the indent is fixed before the showmatch. (Webb)
+- Add option to make indenting work in comments too (for commented-out
+ code), unless the line starts with "*".
+- Don't use 'cindent' when doing formatting with "gq"?
+- When formatting a comment after some text, insert the '*' for the new line
+ (indent is correct if 'cindent' is set, but '*' doesn't get inserted).
+8 When 'comments' has both "s1:/*,mb:*,ex:*/" and "s1:(*,mb:*,ex:*)", the
+ 'x' flag always uses the first match. Need to continue looking for more
+ matches of "*" and remember all characters that could end the comment.
+- For smartindent: When typing 'else' line it up with matching 'if'.
+- 'smartindent': allow patterns in 'cinwords', for e.g. TeX files, where
+ lines start with "\item".
+- Support this style of comments (with an option): (Brown)
+ /* here is a comment that
+ is just autoindented, and
+ nothing else */
+- Add words to 'cinwords' to reduce the indent, e.g., "end" or "fi".
+7 Use Tabs for the indent of starting lines, pad with spaces for
+ continuation lines. Allows changing 'tabstop' without messing up the
+ indents.
+ And/or: Add option to copy indent as-is, without changing spaces to tabs.
+ also for 'autoindent'. 'keeptabs': when set don't change the tabs and
+ spaces used for indent, when the indent remains the same or increases.
+
+
+Java:
+8 Can have {} constructs inside parens. Include changes from Steve
+ Odendahl?
+8 Recognize "import java.util.Vector" and use $CLASSPATH to find files for
+ "[i" commands and friends.
+- For files found with 'include': handle "*" in included name, for Java.
+ (Jason)
+- How to make a "package java.util" cause all classes in the package to be
+ searched? Also for "import java.util.*". (Mark Brophy)
+
+
+'comments':
+8 When formatting C comments that are after code, the "*" isn't repeated
+ like it's done when there is no code. And there is no automatic wrapping.
+ Recognize comments that come after code. Should insert the comment leader
+ when it's "#" or "//".
+7 When using "comments=fg:--", Vim inserts three spaces for a new line.
+ When hitting a TAB, these spaces could be removed.
+7 The 'n'esting flag doesn't do the indenting of the last (rightmost) item.
+6 Make strings in 'comments' option a RE, to be able to match more
+ complicated things. (Phillipps) Use a special flag to indicate that a
+ regexp is used.
+8 Make the 'comments' option with "/* * */" lines only repeat the "*" line
+ when there is a "/*" before it? Or include this in 'cindent'?
+
+
+Virtual edit:
+8 Make the horizontal scrollbar work to move the text further left.
+7 Add a mode where the cursor is only allowed to go one character after the
+ end of the line?
+7 Allow specifying it separately for Tabs and beyond end-of-line?
+
+
+Text objects:
+8 Add test script for text object commands "aw", "iW", etc.
+7 Add text object for current search pattern: "a/" and "i/". Makes it
+ possible to turn text highlighted for 'hlsearch' into a Visual area.
+8 Add "gp" and "gP" commands: insert text and make sure there is a single
+ space before it, unless at the start of the line, and after it, unless at
+ the end of the line or before a ".".
+7 Add objects with backwards extension? Use "I" and "A". Thus "2dAs"
+ deletes the current and previous sentence. (Jens Paulus)
+7 Add "g{" and "g}" to move to the first/last character of a paragraph
+ (instead of the line just before/after a paragraph as with "{" and "}").
+8 Add "a'" and 'a"': a single or double quoted string. (Tim Chase)
+ Patch from Taro Muraoka (2003 Dec 16).
+6 Ignore comment leaders for objects. Make "das" work in reply-email.
+5 Make it possible to use syntax group matches as a text object. For
+ example, define a "ccItem" group, then do "da<ccItem>" to delete one.
+ Or, maybe just define "dai", delete-an-item, to delete the syntax item the
+ cursor is on.
+
+
+Select mode:
+8 In blockwise mode, typed characters are inserted in front of the block,
+ backspace deletes a column before the block. (Steve Hall)
+7 Alt-leftmouse starts block mode selection in MS Word.
+ See http://www.vim.org/tips/tip.php?tip_id=743
+7 Add Cmdline-select mode. Like Select mode, but used on the command line.
+ - Change gui_send_mouse_event() to pass on mouse events when 'mouse'
+ contains 'C' or 'A'.
+ - Catch mouse events in ex_getln.c. Also shift-cursor, etc., like in
+ normal_cmd().
+ - remember start and end of selection in cmdline_info.
+ - Typing text replaces the selection.
+
+
+Visual mode:
+- When dragging the Visual selection with the mouse and 'scrolloff' is zero,
+ behave like 'scrolloff' is one, so that the text scrolls when the pointer
+ is in the top line.
+8 When using "I" or "A" in Visual block mode, short lines do not get the new
+ text. make it possible to add the text to short lines too, with padding
+ where needed.
+7 With a Visual block selected, "2x" deletes a block of double the width,
+ "3y" yanks a block of triple width, etc.
+7 When selecting linewise, using "itext" should insert "text" at the start
+ of each selected line.
+8 What is "R" supposed to do in Visual mode?
+8 Make Visual mode local to the buffer. Allow changing to another buffer.
+ When starting a new Visual selection, remove the Visual selection in any
+ other buffer. (Ron Aaron)
+8 Support dragging the Visual area to drop it somewhere else. (Ron Aaron,
+ Ben Godfrey)
+7 Support dragging the Visual area to drop it in another program, and
+ receive dropped text from another program. (Ben Godfrey)
+7 With blockwise Visual mode and "c", "C", "I", "A", etc., allow the use of
+ a <CR>. The entered lines are repeated over the Visual area.
+7 CTRL-V :s should substitute only in the block, not to whole lines. (David
+ Young is working on this)
+7 Filtering a block should only apply to the block, not to the whole lines.
+ When the number of lines is increased, add lines. When decreased, padd with
+ spaces or delete? Use ":`<,`>" on the command line.
+8 After filtering the Visual area, make "gv" select the filtered text?
+ Currently "gv" only selects a single line, not useful.
+7 Don't move the cursor when scrolling? Needed when the selection should
+ stay the same. Scroll to the cursor at any movement command. With an
+ option!
+7 In Visual block mode, need to be able to define a corner on a position
+ that doesn't have text? Also: when using the mouse, be able to select
+ part of a TAB. Even more: Add a mode where the cursor can be on a screen
+ position where there is no text. When typing, add spaces to fill the gap.
+ Other solution: Always use curswant, so that you can move the cursor to
+ the right column, and then use up/down movements to select the line,
+ without changing the column.
+6 ":left" and ":right" should work in Visual block mode.
+7 For Visual mode: Command to do a search for the string in the marked area.
+ Only when fewer than two lines. Use "g/" and "gb". Patch from Yegappan
+ Lakshmanan.
+7 CTRL-I and CTRL-O should work in Visual mode, but only jump to marks in the
+ current buffer.
+7 CTRL-A and CTRL-X should increase/decrease all numbers in the Visual area.
+6 In non-Block mode, "I" should insert the same text in front of each line,
+ before the first non-blank, "gI" in column 1.
+6 In non-Block mode, "A" should append the same text after each line.
+6 ":'<,'>source" should read the selected lines and ":source" them.
+6 When in blockwise visual selection (CTRL-V), allow cursor to be placed
+ right of the line. Could also allow cursor to be placed anywhere on a TAB
+ or other special character.
+6 Add commands to move selected text, without deselecting.
+
+
+More advanced repeating commands:
+- Add "." command for visual mode: redo last visual command (e.g. ":fmt").
+7 Repeating "d:{cmd}" with "." doesn't work. (Benji Fisher) Somehow remember
+ the command line so that it can be repeated?
+- Add "." command after operator: repeat last command of same operator. E.g.
+ "c." will repeat last change, also when "x" used since then (Webb).
+ "y." will repeat last yank.
+ "c2." will repeat the last but one change?
+ Also: keep history of Normal mode commands, add command to list the history
+ and/or pick an older command.
+- History stack for . command? Use "g." command.
+
+
+Mappings and Abbreviations:
+8 Let ":verbose map xx" report where the mapping was set, just like with
+ ":verbose set".
+8 When "0" is mapped (it is a movement command) this mapping should not be
+ used after typing another number, e.g. "20l". (Charles Campbell)
+ Is this possible without disabling the mapping of the following command?
+8 Should mapping <C-A> and <C-S-A> both work?
+7 ":abbr b byte", append "b " to an existing word still expands to "byte".
+ This is Vi compatible, but can we avoid it anyway?
+8 ":verbose map" could show the script where the mapping was defined.
+ m_script_ID can be used.
+8 To make a mapping work with a prepended "x to select a register, store the
+ last _typed_ register name and access it with "&.
+8 Add ":amap", like ":amenu".
+8 Add ":cab!", abbreviations that only apply to Command-line mode and not to
+ entering search strings.
+8 Add a flag to ":abbrev" to eat the character that triggers the
+ abbreviation. Thus "abb ab xxx" and typing "ab<Space>" inserts "xxx" and
+ not the <Space>.
+8 Allow mapping of CTRL-@ (anywhere in the LHS).
+8 Give a warning when using CTRL-C in the lhs of a mapping. It will never
+ (?) work.
+7 ":verbose map" should display where a mapping was defined, like ":verbose
+ set".
+8 Add a way to save a current mapping and restore it later. Use a function
+ that returns the mapping command to restore it: mapcmd()? mapcheck() is
+ not fool proof. How to handle ambiguous mappings?
+7 Add <0x8f> (hex), <033> (octal) and <123> (decimal) to <> notation?
+7 Allow mapping "Q" and "Q}" at the same time. Need to put a flag with "Q",
+ that it needs an extra character before it can match. See Vile 'maplonger'
+ option.
+7 When someone tries to unmap with a trailing space, and it fails, try
+ unmapping without the trailing space. Helps for ":unmap xx | unmap yy".
+7 Make it possible to map 'wildchar', but only when it's a special character
+ (like CTRL-E). Currently it's only recognized when typed. Useful for
+ mapping a key to do something and then completion.
+7 Add a mapping that works always, for remapping the keyboard.
+6 Context-sensitive abbreviations: Specify syntax group(s) in which the
+ abbreviations are to be used.
+- Add mappings that take arguments. Could work like the ":s" command. For
+ example, for a mouse escape sequence:
+ :mapexp <Esc>{\([0-9]*\),\([0-9]*\); H\1j\2l
+- Make it possible to include a <Nul> in the lhs and rhs of a mapping.
+- Add command to repeat a whole mapping ("." only repeats the last change in
+ a mapping). Also: Repeat a whole insert command, including any mappings
+ that it included. Sort-of automatic recording?
+- Make it possible to undo all the commands from a mapping, including a
+ trailing unfinished command, e.g. for ":map K iX^[r".
+- Add an option to ":map" that makes it display the special keys in
+ <> notation (e.g. <CR> instead of ^M). Or just always do this?
+- Include an option (or flag to 'cpoptions') that makes errors in mappings
+ not flush the rest of the mapping (like nvi does).
+- Use context sensitiveness of completion to switch abbreviations and
+ mappings off for :unab and :unmap.
+6 When using mappings in Insert mode, insert characters for incomplete
+ mappings first, then remove them again when a mapping matches. Avoids
+ that characters that are the start of some mapping are not shown until you
+ hit another character.
+- Add optional <Number> argument for mappings:
+ :map <Number>q ^W^W<Number>G
+ :map <Number>q<Number>t ^W^W<Number1-1>G<Number2>l
+ :map q<Char> :s/<Char>/\u\0/g
+ Or implicit:
+ :map q <Register>d<Number>$
+- Add mappings for replace mode: ":rmap". How do we then enter mappings for
+ non-replace Insert mode?
+- Add separate mappings for Visual-character/block/line mode?
+6 Alias for Normal mode commands, works like :substitute? Would allow
+ mappings with arguments.
+- Add 'mapstop' command, to stop recursive mappings.
+- List mappings that have a raw escape sequence both with the name of the key
+ for that escape sequence (if there is one) and the sequence itself.
+- List mappings: Once with special keys listed as <>, once with meta chars as
+ <M-a>, once with the byte values (octal?). Sort of "spell mapping" command?
+- When entering mappings: Add the possibility to enter meta keys like they
+ are displayed, within <>: <M-a>, <~@> or <|a>.
+- Allow multiple arguments to :unmap.
+- Command to show keys that are not used and available for mapping
+ ":freekeys".
+- Allow any character except white space in abbreviations lhs (Riehm).
+
+
+Incsearch:
+- Add a limit to the number of lines that are searched for 'incsearch'?
+- When no match is found and the user types more, the screen is redrawn
+ anyway. Could skip that. Esp. if the line wraps and the text is scrolled
+ up every time.
+- Temporarily open folds to show where the search ends up. Restore the
+ folds when going to another line.
+- When incsearch used and hitting return, no need to search again in many
+ cases, saves a lot of time in big files. (Slootman wants to work on this?)
+ When not using special characters, can continue search from the last match
+ (or not at all, when there was no match). See oldmail/webb/in.872.
+- With incsearch, use CTRL-N/CTRL-P to go to next/previous match, some other
+ key to copy matched word to search pattern (Alexander Schmid).
+
+
+Searching:
+8 Add a mechanism for recursiveness: "\(([^()]*\@@[^()]*)\)\@r". \@@ stands
+ for "go recursive here" and \@r marks the recursive atom.
+item stack to allow matching (). One side is "push X on
+ the stack if previous atom matched". Other side is "match with top of
+ stack, pop it when it matches". Use "\@pX" and "\@m"?
+ Example: \((\@p).\{-}\@m\)*
+7 Add an option to accept a match at the cursor position. Also for
+ search(). (Brett)
+7 Add pattern item to use properties of Unicode characters. In Perl it's
+ "\p{L}" for a letter. See Regular Expression Pocket Reference.
+7 When 'rightleft' is set, the search pattern should be displayed right to
+ left as well? See patch of Dec 26. (Nadim Shaikli)
+8 Would it be possible to allow ":23,45/pat/flags" to search for "pat" in
+ lines 23 to 45? Or does this conflict with Ex range syntax?
+8 Allow identical pairs in 'matchpairs'. Restrict the search to the current
+ line.
+7 Allow longer pairs in 'matchpairs'. Use ~/vim/macros/matchit.vim as an
+ example.
+8 Make it possible to define the character that "%" checks for in
+ #if/#endif. For nmake it's !if/!endif.
+- For "%" command: set hierarchy for which things include other things that
+ should be ignored (like "*/" or "#endif" inside /* */).
+ Also: use "%" to jump from start to end of syntax region and back.
+ Alternative: use matchit.vim
+8 "/:/e+1" gets stuck on a match at the end of the line. Do we care?
+8 A pattern like "\([^a]\+\)\+" takes an awful long time. Recognize that
+ the recursive "\+" is meaningless and optimize for it.
+ This one is also very slow on "/* some comment */": "^\/\*\(.*[^/]\)*$".
+7 Recognize "[a-z]", "[0-9]", etc. and replace them with the faster "\l" and
+ "\d".
+7 Add a way to specify characters as hex, octal or <C-M> form. Could be
+ \%1ax, \%200o and \%<C-M>. Also \%1234u for multi-byte chars.
+8 Flags that apply to the whole pattern.
+ This works for all places where a regexp is used.
+ Add "\q" to not store this pattern as the last search pattern?
+8 Add an argument after ":s/pat/str/" for a range of matches. For example,
+ ":s/pat/str/#3-4" to replace only the third and fourth "pat" in a line.
+8 Add an option not to use 'hlsearch' highlighting for ":s" and ":g"
+ commands. (Kahn) It would work like ":noh" is used after that command.
+ Also: An extra flag to do this once, and a flag to keep the existing
+ search pattern.
+- Add \%h{group-name}; to search for a specific highlight group.
+ Add \%s{syntax-group}; to search for a specific syntax group.
+- Support Perl regexp. Use PCRE (Perl Compatible RE) package. (Shade)
+ Or translate the pattern to a Vim one.
+ Don't switch on with an option for typed commands/mappings/functions, it's
+ too confusing. Use "\@@" in the pattern, to avoid incompatibilities.
+7 Add POSIX regexp, like Nvi, with 'extended' option? It's like very-magic.
+- Remember flags for backreferenced items, so that "*" can be used after it.
+ Check with "\(\S\)\1\{3}". (Hemmerling)
+- Add flags to search command (also for ":s"?):
+ i ignore case
+ I use case
+ p use Perl regexp syntax (or POSIX?)
+ v use Vi regexp syntax
+ f forget pattern, don't keep it for "n" command
+ F remember pattern, keep it for "n" command
+ Perl uses these too:
+ e evaluate the right side as an expression (Perl only)
+ m multiple line expression (we don't need it)
+ o compile only once (Perl only)
+ s single line expression (we don't need it)
+ x extended regexp (we don't need it)
+ When used after ":g" command, backslash needed to avoid confusion with the
+ following command.
+ Add 'searchflags' for default flags (replaces 'gdefault').
+- Add command to display the last used substitute pattern and last used
+ pattern. (Margo) Maybe make it accessible through a register (like "/
+ for search string)?
+7 Use T-search algorithm, to speed up searching for strings without special
+ characters. See C't article, August 1997.
+- Add 'fuzzycase' option, so that case doesn't matter, and '-' and '_' are
+ equivalent (for Unix filenames).
+- Add 'v' flag to search command: enter Visual mode, with the matching text
+ as Visual area. (variation on idea from Bertin)
+- Searching: "/this//that/" should find "that" after "this".
+- Add global search commands: Instead of wrapping at the end of the buffer,
+ they continue in another buffer. Use flag after search pattern:
+ a for the next file in the argument list
+ f for file in the buffer list
+ w for file edited in a window.
+ e.g. "/pat/f". Then "n" and "N" work through files too. "f" flag also for
+ ":s/pat/foo/f"??? Then when 'autowrite' and 'hidden' are both not set, ask
+ before saving files: "Save modified buffer "/path/file"? (Yes/Hide/No
+ Save-all/hide-All/Quit) ".
+- ":s/pat/foo/3": find 3rd match of "pat", like sed. (Thomas Koehler)
+- Special characters in patterns:
+ Inside []:
+ \012 octal character
+ \0x1a hex character
+ \0<BS> \0<Esc>: special character
+7 When searching with 'n' give message when getting back where the search
+ first started. Remember start of search in '/ mark.
+7 Add option that scrolls screen to put cursor in middle of screen after
+ search always/when off-screen/never. And after a ":tag" command. Maybe
+ specify how many lines below the screen causes a redraw with the cursor in
+ the middle (default would be half a screen, zero means always).
+6 Support multiple search buffers, so macros can be made without side
+ effects.
+7 From xvim: Allow a newline in search patterns (also for :s, can delete
+ newline). Add BOW, EOW, NEWL, NLORANY, NLBUTANY, magic 'n' and 'r', etc.
+ [not in xvim:] Add option to switch on matches crossing ONE line boundary.
+7 Add ":iselect", a combination of ":ilist" and ":tselect". (Aaron)
+ Also ":dselect".
+
+
+Undo:
+- When accidentally hitting "R" instead of Ctrl-R, further Ctrl-R is not
+ possible, even when typing <Esc> immediately. (Grahn) Also for "i", "a",
+ etc. Postpone saving for undo until something is really inserted?
+8 When Inserting a lot of text, it can only be undone as a whole. Make undo
+ sync points at every line or word. Could recognize the start of a new
+ word (white space and then non-white space) and backspacing.
+ Can already use CTRL-G u, but that requires remapping a lot of things.
+8 Make undo more memory-efficient: Compare text before and after change,
+ only remember the lines that really changed.
+7 Add undo for a range of lines. Can change these back to a previous
+ version without changing the rest of the file. Stop doing this when a
+ change includes only some of these lines and changes the line count. Need
+ to store these undo actions as a separate change that can be undone.
+7 Add an undo tree: When making a change, instead of clearing any future
+ undo (thus redo) info, make a new branch. How to navigate through the
+ undo tree?
+- For u_save() include the column number. This can be used to set '[ and '].
+ And in the future the undo can be made more efficient (Webb).
+- In out-of-memory situations: Free allocated space in undo, and reduce the
+ number of undo levels (with confirmation).
+- Instead of [+], give the number of changes since the last write: [+123].
+ When undoing to before the last write, change this to a negative number:
+ [-99].
+- With undo with simple line delete/insert: optimize screen updating.
+- When executing macro's: Save each line for undo only once.
+- Store undo info in a file that survives until the next edit. Then it's
+ possible to undo to before the current editing session. Combined with
+ viminfo?
+- When doing a global substitute, causing almost all lines to be changed,
+ undo info becomes very big. Put undo info in swap file??
+
+
+Buffer list:
+8 Add patch from Charles Campbell to have ":0file!" remove the name of the
+ current buffer. (2003 June 17)
+7 Command to execute a command in another buffer: ":inbuf {bufname} {cmd}".
+ Also for other windows: ":inwin {winnr} {cmd}". How to make sure that
+ this works properly for all commands, and still be able to return to the
+ current buffer/window? E.g.: ":inbuf xxx only".
+8 Add File.{recent_files} menu entries: Recently edited files.
+ Ron Aaron has a plugin for this: mru.vim.
+8 Unix: Check all uses of fnamecmp() and fnamencmp() if they should check
+ inode too.
+7 Add another number for a buffer, which is visible for the user. When
+ creating a new buffer, use the lowest number not in use. (or the highest
+ number in use plus one?)
+7 Offer some buffer selection from the command line? Like using ":ls" and
+ asking for a buffer number. (Zachmann)
+- When starting to edit a file that is already in the buffer list, use the
+ file name argument for the new short file name. (Webb)
+- Add an option to make ":bnext" and ":bprev" wrap around the end of the
+ buffer list. Also for ":next" and ":prev"?
+7 Add argument to ":ls" which is a pattern for buffers to list.
+ E.g. ":ls *.c". (Thompson)
+7 Add expansion of buffer names, so that "*.c" is expanded to all buffer
+ names. Needed for ":bdel *.c", ":bunload *.c", etc.
+8 Support for <afile> where a buffer name is expected.
+8 Some commands don't use line numbers, but buffer numbers. '$'
+ should then mean the number of the last buffer. E.g.: "4,$bdel".
+7 Add an option to mostly use slashes in file names. Separately for
+ internal use and for when executing an external program?
+
+
+Swap (.swp) files:
+8 If writing to the swap file fails, should try to open one in another
+ directory from 'dir'. Useful in case the file system is full and when
+ there are short file name problems.
+8 Also use the code to try using a short file name for the backup and swap
+ file for the Win32 and Dos 32 bit versions.
+8 When a file is edited by root, add $LOGNAME to know who did su.
+8 When the edited file is a symlink, try to put the swap file in the same
+ dir as the actual file. Adjust FullName(). Avoids editing the same file
+ twice (e.g. when using quickfix). Also try to make the name of the backup
+ file the same as the actual file?
+ Use the code for resolve()?
+7 Store the options 'fileencoding', 'fileformat', etc. in the swapfile,
+ because they change what will be written to the file. Requires adding
+ another block to the swapfile.
+7 When using 64 bit inode numbers, also store the top 32 bits. Add another
+ field for this, using part of bo_fname[], to keep it compatible.
+7 When editing a file on removable media, should put swap file somewhere
+ else. Use something like 'r' flag in 'viminfo'. 'diravoid'?
+ Also: Be able to specify minimum disk space, skip directory when not
+ enough room.
+7 Add a configure check for which directory should be used: /tmp, /var/tmp
+ or /var/preserve.
+- Add an option to create a swap file only when making the first change to
+ the buffer. (Liang) Or only when the buffer is not read-only.
+- Add option to set "umask" for backup files and swap files (Antwerpen).
+ 'backupumask' and 'swapumask'? Or 'umaskback' and 'umaskswap'?
+- When editing a readonly file, don't use a swap file but read parts from the
+ original file. Also do this when the file is huge (>'maxmem'). We do
+ need to load the file once to count the number of lines? Perhaps keep a
+ cached list of which line is where.
+
+
+Viminfo:
+7 Can probably remove the code that checks for a writable viminfo file,
+ because we now do the chown() for root, and others can't overwrite someone
+ else's viminfo file.
+8 Add argument to keep the list of buffers when Vim is started with a file
+ name. (Schild)
+8 Keep the last used directory of the file browser (File/Open menu).
+8 Remember the last used register for "@@".
+8 Remember a list of last accessed files. To be used in the
+ "File.Open Recent" menu. Default is to remember 10 files or so.
+ Also remember which files have been read and written. How to display
+ this?
+7 Also store the ". register (last inserted text).
+7 Make it possible to store buffer names in viminfo file relative to some
+ directory, to make them portable over a network. (Aaron)
+6 Store a snapshot of the currently opened windows. So that when quitting
+ Vim, and then starting again (without a file name argument), you see the
+ same files in the windows. Use ":mksession" code?
+- Make marks present in .viminfo usable as file marks: Display a list of
+ "last visited files" and select one to jump to.
+
+
+Modelines:
+8 Before trying to execute a modeline, check that it looks like one (valid
+ option names). If it's very wrong, silently ignore it.
+ Ignore a line that starts with "Subject: ".
+- When an option value is coming from a modeline, do not carry it over to
+ another edited file? Would need to remember the value from before the
+ modeline setting.
+- Allow setting a variable from a modeline? Only allow using fixed strings,
+ no function calls, to avoid a security problem.
+- Allow ":doauto BufRead x.cpp" in modelines, to execute autocommands for
+ .cpp files.
+- Support the "abbreviate" command in modelines (Kearns). Careful for
+ characters after <Esc>, that is a security leak.
+- Add option setting to ask user if he wants to have the modelines executed
+ or not. Same for .exrc in local dir.
+
+
+Options:
+8 Make ":mksession" store buffer-specific options for the specific buffer.
+8 With ":mksession" always store the 'sessionoptions' option, even when
+ "options" isn't in it. (St-Amant)
+7 Setting an option always sets "w_set_curswant", while this is only
+ required for a few options. Only do it for those options to avoid the
+ side effect.
+8 When using ":mksession", also store a command to reset all options to
+ their default value, before setting the options that are not at their
+ default value.
+8 Should ":mksession" restore the current directory when writing the
+ session, or the directory where the session file is? Probably need a word
+ in 'sessionoptions' to make a choice:
+ "curdir" (cd to current directory when session file was generated)
+ "sessiondir" (cd to directory of session file)
+ "nodir" (don't cd at all)
+8 Make "old" number options that really give a number of effects into string
+ options that are a comma separated list. The old number values should
+ also be supported.
+8 Add commands to save and restore an option, which also preserves the flag
+ that marks if the option was set. Useful to keep the effect of setting
+ 'compatible' after ":syntax on" has been used.
+7 There is 'titleold', why is there no 'iconold'? (Chazelas)
+7 Make 'scrolloff' a global-local option, so that it can be different in the
+ quickfix window, for example. (Gary Holloway)
+7 Add plugins for formatting. Should be able to make a choice depending on
+ the language of a file (English/Korean/Japanese/etc.).
+
+
+External commands:
+8 When filtering text, redirect stderr so that it can't mess up the screen
+ and Vim doesn't need to redraw it. Also for ":r !cmd".
+4 Set separate shell for ":sh", piping "range!filter", reading text "r !ls"
+ and writing text "w !wc". (Deutsche) Allow arguments for fast start (e.g.
+ -f).
+4 Allow direct execution, without using a shell.
+4 Run an external command in the background. But how about I/O in the GUI?
+ Careful: don't turn Vim into a shell!
+4 Add feature to disable using a shell or external commands.
+
+
+Multiple Windows:
+7 "vim -oO file ..." use both horizontal and vertical splits.
+8 Add CTRL-W T: go to the top window in the column of the current window.
+ And CTRL-W B: go to bottom window.
+7 Use CTRL-W <Tab>, like alt-tab, to switch between buffers. Repeat <Tab>
+ to select another buffer (only loaded ones?), <BS> to go back, <Enter> to
+ select buffer, <Esc> to go back to original buffer.
+7 Add a 'winfixwidth' option, similar to 'winfixheight'.
+6 Add an option to resize the shell when splitting and/or closing a window.
+ ":vsp" would make the shell wider by as many columns as needed for the new
+ window. Specify a maximum size (or use the screen size). ":close" would
+ shrink the shell by as many columns as come available. (Demirel)
+7 When starting Vim several times, instantiate a Vim server, that allows
+ communication between the different Vims. Feels like one Vim running with
+ multiple top-level windows. Esp. useful when Vim is started from an IDE
+ too. Requires some form of inter process communication.
+- Support a connection to an external viewer. Could call the viewer
+ automatically after some seconds of non-activity, or with a command.
+ Allow some way of reporting scrolling and cursor positioning in the viewer
+ to Vim, so that the link between the viewed and edited text can be made.
+
+
+Marks:
+8 When cursor is first moved because of scrolling, set a mark at this
+ position. (Rimon Barr) Use '-.
+8 Add a command to jump to a mark and make the motion inclusive. g'm and g`m?
+8 The '" mark is set to the first line, even when doing ":next" a few times.
+ Only set the '" mark when the cursor was really moved in a file.
+8 Make `` and '', which would position the new cursor position in the middle
+ of the window, restore the old topline (or relative position) from when
+ the mark was set.
+7 Make a list of file marks in a separate window. For listing all buffers,
+ matching tags, errors, etc. Normal commands to move around. Add commands
+ to jump to the mark (in current window or new window). Start it with
+ ":browse marks"?
+6 Add a menu that lists the Marks like ":marks". (Amerige)
+8 Make it possible to delete marks. Charles Campbell has a patch that does
+ this with the markclear() function (2004 Jan 9). And the ":delmark"
+ command (2004 Feb 9)
+7 For ":jumps", ":tags" and ":marks", for not loaded buffers, remember the
+ text at the mark. Highlight the column with the mark.
+7 Highlight each mark in some way (With "Mark" highlight group).
+ Or display marks in a separate column, like 'number' does.
+7 Use d"m to delete rectangular area from cursor to mark m (like Vile's \m
+ command).
+7 Try to keep marks in the same position when:
+ - replacing with a line break, like in ":s/pat/^M/", move marks after the
+ line break column to the next line. (Acevedo)
+ - inserting/deleting characters in a line.
+5 Include marks for start/end of the current word and section. Useful in
+ mappings.
+6 Add "unnamed mark" feature: Like marks for the ":g" command, but place and
+ unplace them with commands before doing something with the lines.
+ Highlight the marked lines somehow.
+
+
+Digraphs:
+7 Make "ga" show the digraph for a character, if it exists.
+ Also the keymap?
+- Make it possible to enter "r<C-E>" and "r<C-Y>" (get character from line
+ below/above).
+- Use digraph table to tell Vim about the collating sequence of special
+ characters?
+8 Add command to remove (all) digraphs. (Brown)
+7 Support different sets of digraphs (depending on the character set?). At
+ least Latin1/Unicode, Latin-2, MS-DOS (esp. for Win32).
+
+
+Writing files:
+- In vim_rename(), should lock "from" file when deleting "to" file for
+ systems other than Amiga. Avoids problems with unexpected longname to
+ shortname conversion.
+8 write mch_isdevice() for Amiga, Mac, VMS, etc.
+8 When appending to a file, Vim should also make a backup and a 'patchmode'
+ file.
+8 'backupskip' doesn't write a backup file at all, a bit dangerous for some
+ applications. Add 'backupelsewhere' to write a backup file in another
+ directory? Or add a flag to 'backupdir'?
+7 The 'directory' option supports changing path separators to "%" to make
+ file names unique, also support this for 'backupdir'. (Mikolaj Machowski)
+6 Add an option to write a new, numbered, backup file each time. Like
+ 'patchmode', e.g., 'backupmode'.
+6 Make it possible to write 'patchmode' files to a different directory.
+ E.g., ":set patchmode=~/backups/*.orig". (Thomas)
+6 Add an option to prepend something to the backup file name. E.g., "#".
+ Or maybe allow a function to modify the backup file name?
+8 Only make a backup when overwriting a file for the first time. Avoids
+ losing the original when writing twice. (Slootman)
+7 On non-Unix machines, also overwrite the original file in some situations
+ (file system full, it's a link on an NFS partition).
+7 When editing a file, check that it has been change outside of Vim more
+ often, not only when writing over it. E.g., at the time the swap file is
+ flushed. Or every ten seconds or so (use the time of day, check it before
+ waiting for a character to be typed).
+8 When a file was changed since editing started, show this in the status
+ line of the window, like "[time]".
+ Make it easier to reload all outdated files that don't have changes.
+ Automatic and/or with a command.
+
+
+Substitute:
+8 Make it easier to replace in all files in the argument list. E.g.:
+ ":argsub/oldword/newword/". Works like ":argdo %s/oldword/newword/g|w".
+- :s///p prints the line after a substitution.
+- With :s///c replace \&, ~, etc. when showing the replacement pattern.
+8 With :s///c allow scrolling horizontally when 'nowrap' is effective.
+ Also allow a count before the scrolling keys.
+- Add number option to ":s//2": replace second occurrence of string? Or:
+ :s///N substitutes N times.
+- Add answers to ":substitute" with 'c' flag, used in a ":global", e.g.:
+ ":g/pat1/s/pat2/pat3/cg": 'A' do all remaining replacements, 'Q' don't do
+ any replacements, 'u' undo last substitution.
+7 Substitute in a block of text. Use {line}.{column} notation in an Ex
+ range, e.g.: ":1.3,$.5s" means to substitute from line 1 column 3 to the
+ last line column 5.
+5 Add commands to bookmark lines, display bookmarks, remove bookmarks,
+ operate on lines with bookmarks, etc. Like ":global" but with the
+ possibility to keep the bookmarks and use them with several commands.
+ (Stanislav Sitar)
+
+
+Mouse support:
+7 Win32: Add patch for 5-button mouse. (Michael Geddes 2001 Nov 26)
+8 Add 'o' flag to 'mouse'?
+7 Be able to set a 'mouseshape' for the popup menu.
+8 Add 'mouse' flag, which sets a behavior like Visual mode, but automatic
+ yanking at the button-up event. Or like Select mode, but typing gets you
+ out of Select mode, instead of replacing the text. (Bhaskar)
+7 Checkout sysmouse() for FreeBSD console mouse support.
+- Implement mouse support for the Amiga console.
+- Using right mouse button to extend a blockwise selection should attach to
+ the nearest corner of the rectangle (four possible corners).
+- Precede mouse click by a number to simulate double clicks?!?
+- When mouse click after 'r' command, get character that was pointed to.
+
+
+Crypt and security:
+8 Also crypt the swapfile, each block separately. Change mf_write() and
+ mf_read(). How to get b_p_key to these functions?
+7 Support a stronger encryption. Jason Holt implemented AES (May 6 2003).
+8 Lock all used memory so that it doesn't get swapped to disk (uncrypted).
+ Patch by Jason Holt, 2003 May 23.
+
+
+Argument list:
+6 Add command to put all filenames from the tag files in the argument list.
+ When given an argument, only use the files where that argument matches
+ (like `grep -l ident`) and jump to the first match.
+6 Add command to form an args list from all the buffers?
+
+
+Registers:
+8 Don't display empty registers with ":display". (Etienne)
+8 Make the # register writable, so that it can be restored after jumping
+ around in windows.
+8 Add put command that overwrites existing text. Should also work for
+ blocks. Useful to move text around in a table. Works like using "R ^R r"
+ for every line.
+6 When yanking into the unnamed registers several times, somehow make the
+ previous contents also available (like it's done for deleting). What
+ register names to use? g"1, g"2, etc.?
+- When appending to a register, also report the total resulting number of
+ lines. Or just say "99 more lines yanked", add the "more".
+- When inserting a register in Insert mode with CTRL-R, don't insert comment
+ leader when line wraps?
+- The ":@r" commands should take a range and execute the register for each
+ line in the range.
+- Add "P" command to insert contents of unnamed register, move selected text
+ to position of previous deleted (to swap foo and bar in " + foo")
+8 Should be able to yank and delete into the "/ register.
+ How to take care of the flags (offset, magic)?
+7 Add ! register, for shell commands. (patch from Grenie)
+
+Debug mode:
+7 Add something to enable debugging when a remote message is received.
+8 Add breakpoints for setting an option
+8 Add breakpoits for assigning to a variable.
+7 Add a watchpoint in the debug mode: An expression that breaks execution
+ when evaluating to non-zero.
+7 Store the history from debug mode in viminfo.
+7 Make the debug mode history available with histget() et al.
+
+
+Various improvements:
+8 Add ":rename" command: rename the file of the current buffer and rename
+ the buffer. Buffer may be modified.
+7 Add the MzScheme interface. Patch on http://iamphet.nm.ru/scheme/
+ (Sergey Khorev)
+6 In the quickfix window statusline add the command used to get the list of
+ errors, e.g. ":make foo", ":grep something *.c".
+6 Python interface: add vim.message() function. (Michal Vitecek, 2002 Nov 5)
+7 Support using ":vert" with User commands. Add expandable items <vert>.
+ Do the same for ":browse" and ":confirm"?
+ For ":silent" and ":debug" apply to the whole user command.
+7 Allow a window not to have a statusline. Makes it possible to use a
+ window as a buffer-tab selection.
+7 Add an invisible buffer which can be edited. For use in scripts that want
+ to manipulate text without changing the window layout.
+8 Add a command to revert to the saved version of file; undo or redo until
+ all changes are gone.
+8 Make 'statusline' local, so that each window can have a different value.
+ But should it also be local to a buffer? (Yegappan Lakshmanan has a patch,
+ 2002 feb 15)
+7 Add a ":cpfile", go in the other direction as ":cnfile".
+6 "vim -q -" should read the list of errors from stdin. (Gautam Mudunuri)
+8 In the gzip plugin, also recognize *.gz.orig, *.gz.bak, etc. Like it's
+ done for filetype detection. Patch from Walter Briscoe, 2003 Jul 1.
+8 Add "--remote-fail": When contacting the server fails, exit Vim.
+ Add "--remote-self": When contacting the server fails, do it in this Vim.
+ Overrules the default of "--remote-send" to fail and "--remote" to do it
+ in this Vim.
+8 When Vim was started without a server, make it possible to start one, as
+ if the "--servername" argument was given. ":startserver <name>"?
+8 No address range can be used before the command modifiers. This makes
+ them difficult to use in a menu for Visual mode. Accept the range and
+ have it apply to the following command.
+8 Add the possibility to set 'fileformats' to force a format and strip other
+ CR characters. For example, for "dos" files remove CR characters at the
+ end of the line, so that a file with mixed line endings is cleaned up.
+ To just not display the CR characters: Add a flag to 'display'?
+7 Add a "-@ filelist" argument: read file names from a file. (David Kotchan
+ has a patch for it)
+7 Some compilers give error messages in which the file name does not have a
+ path. Be able to specify that 'path' is used for these files.
+8 Add term entries for function keys on xterm with alt and ctrl (new in pl
+ 94). E.g., Control adds ";5" in "<Esc>[20;5~". Find a generic way to
+ prepend a modifier in console mode, to avoid having to specify each
+ individual modified key.
+ Steve Wall has a patch (2002 Mar 12) for adding function keys up to 37,
+ with modifiers.
+7 Xterm sends <Esc>O3F for <M-End>. Similarly for other <M-Home>, <M-Left>,
+ etc. Combinations of Alt, Ctrl and Shift are also possible. Recognize
+ these to avoid inserting the raw byte sequence, handle like the key
+ without modifier (unless mapped).
+8 Add ":breakdel *": delete all breakpoints.
+7 Support ":browse edit" in console, using explorer.vim?
+6 Add "gG": like what "gj" is to "j": go to the N'th window line.
+8 Add command like ":normal" that accepts <Key> notation like ":map".
+9 Support ACLs on more systems.
+7 Add ModeMsgVisual, ModeMsgInsert, etc. so that each mode message can be
+ highlighted differently.
+8 Allow using "**" as a wildcard in commands like ":next" and ":args".
+8 Provide a way to avoid wildcard expansion. Use double quotes, like in the
+ shell? :edit "my[file].txt" (currently works if there is no "myf.txt")
+7 Add a message area for the user. Set some option to reserve space (above
+ the command line?). Use an ":echouser" command to display the message
+ (truncated to fit in the space).
+7 Add %s to 'keywordprg': replace with word under the cursor. (Zellner)
+8 Support printing on Unix. Can use "lpansi.c" as an example. (Bookout)
+8 Add put command that replaces the text under it. Esp. for blockwise
+ Visual mode.
+7 Enhance termreponse stuff: Add t_CV(?): pattern of term response, use
+ regexp: "\e\[[>?][0-9;]*c", but only check just after sending t_RV.
+7 Add "g|" command: move to N'th column from the left margin (after wrapping
+ and applying 'leftcol'). Works as "|" like what "g0" is to "0".
+7 Add patch from Wall for this one ( ~/Mail/oldmail/wall/in.00019 ):
+ 'flipcase' variable: upper/lowercase pairs.
+ Insert comma's between pairs and allow a range, make it look like
+ 'isfname'. E.g. ":set flipcase=a-zA-Z,xX,23-33:143-153". The colon to
+ separate the from and to part is optional.
+7 Support setting 'equalprg' to a user function name.
+9 Add cursor-column highlighting. Enable it with 'cursorcolumn' option, set
+ highlighting with "CursorColumn" group. Useful for aligning text.
+ Also cursor-row highlighting.
+ Patch from Yasuhiro Matsumoto for underlining the cursor line, 2004 Mar 24.
+ Alternatie: when 'number' is set highlight the number of the current line.
+7 Highlight the characters after the end-of-line differently.
+7 When 'whichwrap' contains "l", "$dl" should join lines?
+8 Include a connection to an external program through a pipe? See patches
+ from Felbinger for a mathematica interface.
+ Or use emacs server kind of thing?
+8 Add an argument to configure to use $CFLAGS and not modify it? (Mooney)
+8 Enabling features is a mix of configure arguments and defines in
+ feature.h. How to make this consistent? Feature.h is required for
+ non-unix systems. Perhaps let configure define CONF_XXX, and use #ifdef
+ CONF_XXX in feature.h? Then what should min-features and max-features do?
+8 Add "g^E" and "g^Y", to scroll a screen-full line up and down.
+6 Add ":timer" command, to set a command to be executed at a certain
+ interval, or once after some time has elapsed. (Aaron)
+8 Add ":confirm" handling in open_exfile(), for when file already exists.
+8 Use confirm/dialog stuff to ask the user, when a file has changed outside
+ of Vim, if he wants to reload it. Triggered when focus gained, after
+ shell command, when entering another buffer, etc..
+ Also do this when editing a new file, and another application creates
+ the file before doing ":w" in Vim.
+ Also check if the file protection has changed. When checking a file into
+ RCS it is made read-only, when checking out it is made read-write.
+8 When quitting with changed files, make the dialog list the changed file
+ and allow "write all", "discard all", "write some". The last one would
+ then ask "write" or "discard" for each changed file. Patch in HierAssist
+ does something like this. (Shah)
+7 Use growarray for replace stack.
+7 Have a look at viH (Hellenic or Greek version of Vim). But a solution
+ outside of Vim might be satisfactory (Haritsis).
+3 Make "2d%" work like "d%d%" instead of "d2%"?
+8 Make "more" prompt accept command characters, like "hit-enter" prompt?
+ Or extend it with more commands, like "less": 'b' for back, 'j' for one
+ line down, etc.
+8 For the "--more--" prompt, support the 'b'ack command for more commands.
+ Possible implementation: Do it at a very low level, caching the lines that
+ are on the screen (with highlight attributes). Avoids that changes have
+ to be made for all functions that list something.
+7 "g CTRL-O" jumps back to last used buffer. Skip CTRL-O jumps in the same
+ buffer. Make jumplist remember the last ten accessed buffers?
+- Keep a list of most recently used files for each window, use "[o" to go
+ back (older file) and "]n" to go forward (newer file) (like ^O and ^I for
+ jumps) (Webb). Use ":files" and ":ls" to list the files in history order.
+7 Add a history of recently accessed buffer. Maybe make "2 CTRL-^" jump to
+ the 2nd previously visited buffer, "3 CTRL-^" to the third, etc. Or use
+ "3 g CTRL-^" for this?
+7 Add an option to set the width of the 'number' column. Eight positions is
+ often more than needed. Or adjust the width to the length of the file?
+ Add patch that adds 'numberlen' option. (James Harvey)
+ Other patch with min and max from Emmanuel Renieris (2002 Jul 24)
+ Other patch without an option by Gilles Roy (2002 Jul 25)
+- Add code to disable the CAPS key when going from Insert to Normal mode.
+- Set date/protection/etc. of the patchfile the same as the original file.
+- Use growarray for termcodes[] in term.c
+- Add <window-99>, like <cword> but use filename of 99'th window.
+7 Add a way to change an operator to always work characterwise-inclusive
+ (like "v" makes the operator characterwise-exclusive). "x" could be used.
+- Make a set of operations on list of names: expand wildcards, replace home
+ dir, append a string, delete a string, etc.
+- Remove mktemp() and use tmpname() only? Ctags does this.
+- When replacing environment variables, and there is one that is not set,
+ turn it into an empty string? Only when expanding options? (Hiebert)
+- Option to set command to be executed instead of producing a beep (e.g. to
+ call "play newbeep.au").
+- Add option to show the current function name in the status line. More or
+ less what you find with "[[k", like how 'cindent' recognizes a function.
+ (Bhatt).
+- "[r" and "]r": like "p" and "P", but replace instead of insert (esp. for
+ blockwise registers).
+- Add 'timecheck' option, on by default. Makes it possible to switch off the
+ timestamp warning and question. (Dodt).
+- Add an option to set the time after which Vim should check the timestamps
+ of the files. Only check when an event occurs (e.g., character typed,
+ mouse moved). Useful for non-GUI versions where keyboard focus isn't
+ noticeable.
+9 When using ":w <fname>" it's possible that this file is loaded in another
+ buffer. Give a warning right away, don't wait for a shell command.
+- Make 'smartcase' work even though 'ic' isn't set (Webb).
+7 Add ":justify" command. Patch from Vit Stradal 2002 Nov 25.
+7 When formatting text, allow to break the line at a number of characters.
+ Use an option for this: 'breakchars'? Useful for formatting Fortran code.
+- Add flag to 'formatoptions' to be able to format book-style paragraphs
+ (first line of paragraph has larger indent, no empty lines between
+ paragraphs). Complements the '2' flag. Use '>' flag when larger indent
+ starts a new paragraph, use '<' flag when smaller indent starts a new
+ paragraph. Both start a new paragraph on any indent change.
+8 Add 'formatexpr' option: Used for formatting operator "gq" instead of the
+ builtin formatting or 'formatprg'.
+8 Allow using a trailing space to signal a paragraph that continues on the
+ next line (MIME text/plain; format=flowed, RFC 2646). Can be used for
+ continuous formatting. Could use 'autoformat' option, which specifies a
+ regexp which triggers auto-formatting (for one line).
+ ":set autoformat=\\s$".
+- Be able to redefine where a sentence stops. Use a regexp pattern?
+7 Add command "g)" to go to the end of a sentence, "g(" to go back to the
+ end of a sentence. (Servatius Brandt)
+- Be able to redefine where a paragraph starts. For "[[" where the '{' is
+ not in column 1.
+6 Add ":cdprev": go back to the previous directory. Need to remember a
+ stack of previous directories. We also need ":cdnext".
+7 Should ":cd" for MS-DOS go to $HOME, when it's defined?
+- Make "gq<CR>" work on the last line in the file. Maybe for every operator?
+8 findmatchlimit() should be able to skip comments. Solves problem of
+ matching the '{' in /* if (foo) { */ (Fiveash)
+- findmatch() should be adjusted for Lisp. See remark at get_lisp_indent().
+ Esp. \( and \) should be skipped. (Dorai Sitaram, incomplete patch Mar 18)
+- Add more redirecting of Ex commands:
+ :redir @> register (append)
+ :redir # bufname
+ :redir #> bufname (append)
+ :redir = variable
+ :redir => variable (append)
+- Setting of options, specifically for a buffer or window, with
+ ":set window.option" or ":set buffer.option=val". Or use ":buffer.set".
+ Also: "buffer.map <F1> quit".
+6 Would it be possible to change the color of the cursor in the Win32
+ console? (Klaus Hast)
+- Add :delcr command:
+ *:delcr*
+ :[range]delcr[!] Check [range] lines (default: whole buffer) for lines
+ ending in <CR>. If all lines end in <CR>, or [!] is
+ used, remove the <CR> at the end of lines in [range].
+ A CTRL-Z at the end of the file is removed. If
+ [range] is omitted, or it is the whole file, and all
+ lines end in <CR> 'textmode' is set. {not in Vi}
+- Should integrate addstar() and file_pat_to_reg_pat().
+- When working over a serial line with 7 bit characters, remove meta
+ characters from 'isprint'.
+- Use fchdir() in init_homedir(), like in FullName().
+- In win_update(), when the GUI is active, always use the scrolling area.
+ Avoid that the last status line is deleted and needs to be redrawn.
+- That "cTx" fails when the cursor is just after 'x' is Vi compatible, but
+ may not be what you expect. Add a flag in 'cpoptions' for this? More
+ general: Add an option to allow "c" to work with a null motion.
+- Give better error messages by using errno (strerror()).
+- Give "Usage:" error message when command used with wrong arguments (like
+ Nvi).
+- Make 'restorescreen' option also work for xterm (and others), replaces the
+ SAVE_XTERM_SCREEN define.
+7 Support for ":winpos" In xterm: report the current window position.
+- Give warning message when using ":set t_xx=asdf" for a termcap code that
+ Vim doesn't know about. Add flag in 'shortmess'?
+6 Add ":che <file>", list all the include paths which lead to this file.
+- For a commandline that has several commands (:s, :d, etc.) summarize the
+ changes all together instead of for each command (e.g. for the rot13
+ macro).
+- Add command like "[I" that also shows the tree of included files.
+- Add command like ":ts" that shows the output of "[I" and asks for a match
+ to jump to. (Zellner)
+- ":set sm^L" results in ":set s", because short names of options are also
+ expanded. Is there a better way to do this?
+- Add ":@!" command, to ":@" like what ":source!" is to ":source".
+8 Add ":@:!": repeat last command with forceit set.
+- Should be possible to write to a device, e.g. ":w! /dev/null".
+- Add 't_normal': Used whenever t_me, t_se, t_ue or t_Zr is empty.
+- ":cab map test ^V| je", ":cunab map" doesn't work. This is vi compatible!
+- CTRL-W CTRL-E and CTRL-W CTRL-Y should move the current window up or down
+ if it is not the first or last window.
+- Include-file-search commands should look in the loaded buffer of a file (if
+ there is one) instead of the file itself.
+7 Change 'nrformats' to include the leader for each format. Example:
+ nrformats=hex:$,binary:b,octal:0
+ Add setting of 'nrformats' to syntax files.
+- 'path' can become very long, don't use NameBuff for expansion.
+- When unhiding a hidden buffer, put the same line at top of the window as
+ the one before hiding it. Or: keep the same relative cursor position (so
+ many percent down the windows).
+- Make it possible for the 'showbreak' to be displayed at the end of the
+ line. Use a comma to separate the part at the end and the start of the
+ line? Highlight the linebreak characters, add flag in 'highlight'.
+- Some string options should be expanded if they have wildcards, e.g.
+ 'dictionary' when it is "*.h".
+- Use a specific type for number and boolean options, making it possible to
+ change it for specific machines (e.g. when a long is 64 bit).
+- Add option for <Insert> in replace mode going to normal mode. (Nugent)
+- Add a next/previous possibility to "[^I" and friends.
+- Add possibility to change the HOME directory. Use the directory from the
+ passwd file? (Antwerpen)
+- When doing "[^I" or "[^D" add position to tag stack.
+- Add command to put current position to tag stack: ":tpush".
+8 Add commands to push and pop all or individual options. ":setpush tw",
+ ":setpop tw", ":setpush all". Maybe pushing/popping all options is
+ sufficient. ":setflush" resets the option stack?
+ How to handle an aborted mapping? Remember position in tag stack when
+ mapping starts, restore it when an error aborts the mapping?
+- Use a builtin grep command for ":grep"? Makes it possible to add the
+ column number. Can use the code of ":helpgrep".
+ Also support using "**" in filename, so that a directory tree can be
+ searched.
+- Change ":fixdel" into option 'fixdel', t_del will be adjusted each time
+ t_bs is set? (Webb)
+- "gc": goto character, move absolute character positions forward, also
+ counting newlines. "gC" goes backwards (Weigert).
+- When doing CTRL-^, redraw buffer with the same topline (Demirel). Store
+ cursor row and window height to redraw cursor at same percentage of window
+ (Webb).
+- Besides remembering the last used line number of a file, also remember the
+ column. Use it with CTRL-^ et. al.
+- Check for non-digits when setting a number option (careful when entering
+ hex codes like 0xff).
+- Add option to make "." redo the "@r" command, instead of the last command
+ executed by it. Also to make "." redo the whole mapping. Basically: redo
+ the last TYPED command.
+- Support URL links for ^X^F in Insert mode, like for "gf".
+- Support %name% expansion for "gf" on Windows.
+- Make "gf" work on "file://c:/path/name". "file:/c:/" and "file:///c:/"
+ should also work?
+- Add 'urlpath', used like 'path' for when "gf" used on an URL?
+8 When using "gf" on an absolute file name, while editing a remote file
+ (starts with scp:// or http://) should prepend the method and machine
+ name.
+- When finding an URL or file name, and it doesn't exist, try removing a
+ trailing '.'.
+- Add ":path" command modifier. Should work for every command that takes a
+ file name argument, to search for the file name in 'path'. Use
+ find_file_in_path().
+- Highlight control characters on the screen: Shows the difference between
+ CTRL-X and "^" followed by "X" (Colon).
+- Integrate parsing of cmdline command and parsing for expansion.
+- Create a program that can translate a .swp file from any machine into a
+ form usable by Vim on the current machine.
+- Add ":noro" command: Reset 'ro' flag for all buffers, except ones that have
+ a readonly file. ":noro!" will reset all 'ro' flags.
+- Add a variant of CTRL-V that stops interpretation of more than one
+ character. For entering mappings on the command line where a key contains
+ several special characters, e.g. a trailing newline.
+- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine
+ the two into a regex for searching. (Ned Konz)
+- Make '2' option in 'formatoptions' also work inside comments.
+- Add 's' flag to 'formatoptions': Do not break when inside a string. (Dodt)
+- When window size changed (with the mouse) and made too small, set it back
+ to the minimal size.
+- Add "]>" and "[<", shift comment at end of line (command; /* comment */).
+- Should not call cursorcmd() for each vgetc() in getcmdline().
+- ":split file1 file2" adds two more windows (Webb).
+- Don't give message "Incomplete last line" when editing binary file.
+- Add ":a", ":i" for preloading of named buffers.
+- Allow autowrite when doing ":e file" (with an option 'eaw').
+- Allow a "+command" argument before each file name in the Vim command line:
+ "vim +123 file1 +234 file2 +345 file3". ???
+- When entering text, keep other windows on same buffer updated (when a line
+ entered)?
+- Check out how screen does output optimizing. Apparently this is possible
+ as an output filter.
+- In dosub() regexec is called twice for the same line. Try to avoid this.
+- Window updating from memline.c: insert/delete/replace line.
+- Optimize ml_append() for speed, esp. for reading a file.
+- V..c should keep indent when 'ai' is set, just like [count]cc.
+- Updatescript() can be done faster with a string instead of a char.
+- Screen updating is inefficient with CTRL-F and CTRL-B when there are long
+ lines.
+- Uppercase characters in ex commands can be made lowercase?
+8 Add option to show characters in text not as "|A" but as decimal ("^129"),
+ hex ("\x81") or octal ("\201") or meta (M-x). Nvi has the 'octal' option
+ to switch from hex to octal. Vile can show unprintable characters in hex
+ or in octal.
+7 Tighter integration with xxd to edit binary files. Make it more
+ easy/obvious to use. Command line argument?
+- How does vi detect whether a filter has messed up the screen? Check source.
+ After ":w !command" a wait_return?
+- Improve screen updating code for doput() (use s_ins()).
+- With 'p' command on last line: scroll screen up (also for terminals without
+ insert line command).
+- Use insert/delete char when terminal supports it.
+- Optimize screen redraw for slow terminals.
+- Optimize "dw" for long row of spaces (say, 30000).
+- Add "-d null" for editing from a script file without displaying.
+- In Insert mode: Remember the characters that were removed with backspace
+ and re-insert them one at a time with <key1>, all together with <key2>.
+- Amiga: Add possibility to set a keymap. The code in amiga.c does not work
+ yet.
+- Implement 'redraw' option.
+- Add special code to 'sections' option to define something else but '{' or
+ '}' as the start of a section (e.g. one shiftwidth to the right).
+- Add 'indent' option: Always use this amount of indent when starting a new
+ line and when formatting text.
+- Use pipes for filtering on Unix. Requires using fork() to be able to read
+ and write at the same time, or some select() mechanism.
+7 Allow using Vim in a pipe: "ls | vim -u xxx.vim - | yyy". Only needs
+ implementing ":w" to stdout in the buffer that was read from stdin.
+8 Allow opening an unnamed buffer with ":e !cmd" and ":sp !cmd". Vile can
+ do it.
+- Add commands like ]] and [[ that do not include the line jumped to.
+- When :unab without matching "from" part and several matching "to" parts,
+ delete the entry that was used last, instead of the first in the list.
+- Add text justification option.
+- Set boolean options on/off with ":set paste=off", ":set paste=on".
+- After "inv"ing an option show the value: ":set invpaste" gives "paste is
+ off".
+- Check handling of CTRL-V and '\' for ":" commands that do not have TRLBAR.
+- When a file cannot be opened but does exist, give error message.
+- Amiga: When 'r' protection bit is not set, file can still be opened but
+ gives read errors. Check protection before opening.
+- When writing check for file exists but no permission, "Permission denied".
+- If file does not exists, check if directory exists.
+- MSDOS: although t_cv and t_ci are not set, do invert char under cursor.
+- Settings edit mode: make file with ":set opt=xx", edit it, parse it as ex
+ commands.
+- ":set -w all": list one option per line.
+- Amiga: test for 'w' flag when reading a file.
+- :table command (Webb)
+- Add new operator: clear, make area white (replace with spaces): "g ".
+- Make it possible for a user to define a new operator. Implementation with
+ internal scripting language or Perl?
+- Add command to ":read" a file at a certain column (blockwise read?).
+- Add sort of replace mode where case is taken from the old text (Goldfarb).
+- Allow multiple arguments for ":read", read all the files.
+- Support for tabs in specific columns: ":set tabcol=8,20,34,56" (Demirel).
+- Add 'searchdir' option: Directories to search for file name being edited
+ (Demirel).
+- Modifier for the put command: Change to linewise, charwise, blockwise, etc.
+- Add commands for saving and restoring options ":set save" "set restore",
+ for use in macro's and the like.
+- Keep output from listings in a window, so you can have a look at it while
+ working in another window. Put cmdline in a separate window?
+- Add possibility to put output of ex commands in a buffer or file, e.g. for
+ ":set all". ":r :set all"?
+- 'edit' option: When off changing the buffer is not possible (Really
+ read-only mode).
+- When the 'equalalways' option is set, creating a new window should not
+ result in windows to become bigger. Deleting a window should not result in
+ a window to become smaller (Webb).
+- When resizing the whole Vim window, the windows inside should be resized
+ proportionally (Webb).
+- Include options directly in option table, no indirect pointers. Use
+ mkopttab to make option table?
+- When doing ":w dir", where "dir" is a directory name, write the current
+ file into that directory, with the current file name (without the path)?
+- Support for 'dictionary's that are sorted, makes access a lot faster
+ (Haritsis).
+- Add "^Vrx" on the command line, replace with contents of register x. Used
+ instead of CTRL-R to make repeating possible. (Marinichev)
+- Add "^Vb" on the command line, replace with word before or under the
+ cursor?
+- Option to make a .swp file only when a change is made (Templeton).
+- Support mapping for replace mode and "r" command (Vi doesn't do this)?
+5 Add 'ignorefilecase' option: Ignore case when expanding file names.
+ ":e ma<Tab>" would also find "Makefile" on Unix.
+8 Sorting of filenames for completion is wrong on systems that ignore case
+ of filenames. Add 'ignorefncase' option. When set, case in filenames is
+ ignored for sorting them. Patch by Mike Williams:
+ ~/vim/patches/ignorefncase. Also change what matches? Or use another
+ option name.
+8 Should be able to compile Vim in another directory, with $(srcdir) set to
+ where the sources are. Add $(srcdir) in the Makefile in a lot of places.
+ (Netherton)
+6 Make it configurable when "J" inserts a space or not. Should not add a
+ space after "(", for example.
+5 When inserting spaces after the end-of-line for 'virtualedit', use tabs
+ when the user wants this (e.g., add a "tab" field to 'virtualedit').
+ (Servatius Brandt)
+
+
+From Elvis:
+- Use "instman.sh" to install manpages?
+- Add ":alias" command.
+- fontchanges recognized "\\fB" etc.
+- Search patterns:
+ \@ match word under cursor.
+ but do:
+ \@w match the word under the cursor?
+ \@W match the WORD under the cursor?
+8 ":window" command:
+ :win + next window (up)
+ :win ++ idem, wrapping
+ :win - previous window (down)
+ :win -- idem, wrapping
+ :win nr to window number "nr"
+ :win name to window editing buffer "name"
+7 ":cc" compiles a single file (default: current one). 'ccprg' option is
+ program to use with ":cc". Use ":compile" instead of ":cc"?
+
+
+From Nvi:
+- 'searchincr' option, alias for 'incsearch'?
+- 'leftright' option, alias for 'nowrap'?
+- Have a look at "vi/doc/vi.chart", for Nvi specialties.
+8 Add 'keytime', time in 1/10 sec for mapping timeout?
+- Add 'filec' option as an alternative for 'wildchar'.
+6 Support Nvi command names as an alias:
+ :bg :hide
+ :fg fname :buf fname (with 'hidden' set?)
+ :dis b :ls
+ :Edit fname :split fname
+ :Fg fname :sbuf fname (with 'hidden' set?)
+ :Next :snext (can't do this, already use :Next)
+ :Previous :sprevious
+ :Tag :stag
+
+
+From xvi:
+- CTRL-_ : swap 8th bit of character.
+- Add egrep-like regex type, like xvi (Ned Konz) or Perl (Emmanuel Mogenet)
+
+
+From vile:
+- When horizontal scrolling, use '>' for lines continuing right of a window.
+- Support putting .swp files in /tmp: Command in rc.local to move .swp files
+ from /tmp to some directory before deleting files.
+
+
+Far future and "big" extensions:
+- Make it easy to setup Vim for groups of users: novice vi users, novice
+ Vim users, C programmers, xterm users, GUI users,...
+- Change layout of blocks in swap file: Text at the start, with '\n' in
+ between lines (just load the file without changes, except for Mac).
+ Indexes for lines are from the end of the block backwards. It's the
+ current layout mirrored.
+- Make it possible to edit a register, in a window, like a buffer.
+- Add stuff to syntax highlighting to change the text (upper-case keywords,
+ set indent, define other highlighting, etc.).
+- Mode to keep C-code formatted all the time (sort of on-line indent).
+- Several top-level windows in one Vim session. Be able to use a different
+ font in each top-level window.
+- Allow editing above start and below end of buffer (flag in 'virtualedit').
+- Smart cut/paste: recognize words and adjust spaces before/after them.
+- Add open mode, use it when terminal has no cursor positioning.
+- Special "drawing mode": a line is drawn where the cursor is moved to.
+ Backspace deletes along the line (from jvim).
+- Implement ":Bset", set option in all buffers. Also ":Wset", set in all
+ windows, ":Aset, set in all arguments and ":Tset", set in all files
+ mentioned in the tags file.
+ Add buffer/arg range, like in ":2,5B%s/..." (do we really need this???)
+ Add search string: "B/*.c/%s/.."? Or ":F/*.c/%s/.."?
+- Support for underlining (underscore-BS-char), bold (char-BS-char) and other
+ standout modes switched on/off with , 'overstrike' option (Reiter).
+- Add vertical mode (Paul Jury, Demirel): "5vdw" deletes a word in five
+ lines, "3vitextESC" will insert "text" in three lines, etc..
+4 Recognize l, #, p as 'flags' to EX commands:
+ :g/RE/#l shall print lines with line numbers and in list format.
+ :g/RE/dp shall print lines that are deleted.
+ POSIX: Commands where flags shall apply to all lines written: list,
+ number, open, print, substitute, visual, &, z. For other commands, flags
+ shall apply to the current line after the command completes. Examples:
+ :7,10j #l Join the lines 7-10 and print the result in list
+- Allow two or more users to edit the same file at the same time. Changes
+ are reflected in each Vim immediately. Could work with local files but
+ also over the internet. See http://www.codingmonkeys.de/subethaedit/.
+
+
+vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl:
+vim: set fo+=n :
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
new file mode 100644
index 000000000..ebdf7c7c0
--- /dev/null
+++ b/runtime/doc/uganda.txt
@@ -0,0 +1,277 @@
+*uganda.txt* For Vim version 7.0aa. Last change: 2004 May 12
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+ *uganda* *Uganda* *copying* *copyright* *license*
+SUMMARY
+ *iccf* *ICCF*
+Vim is Charityware. You can use and copy it as much as you like, but you are
+encouraged to make a donation for needy children in Uganda. Please see |kcc|
+below or visit the ICCF web site, available at these URLs:
+
+ http://iccf-holland.org/
+ http://www.vim.org/iccf/
+
+You can also sponsor the development of Vim. Vim sponsors can vote for
+features. See |sponsor|.
+
+The Open Publication License applies to the Vim documentation, see
+|manual-copyright|.
+
+=== begin of license ===
+
+VIM LICENSE
+
+I) There are no restrictions on distributing unmodified copies of Vim except
+ that they must include this license text. You can also distribute
+ unmodified parts of Vim, likewise unrestricted except that they must
+ include this license text. You are also allowed to include executables
+ that you made from the unmodified Vim sources, plus your own usage
+ examples and Vim scripts.
+
+II) It is allowed to distribute a modified (or extended) version of Vim,
+ including executables and/or source code, when the following four
+ conditions are met:
+ 1) This license text must be included unmodified.
+ 2) The modified Vim must be distributed in one of the following five ways:
+ a) If you make changes to Vim yourself, you must clearly describe in
+ the distribution how to contact you. When the maintainer asks you
+ (in any way) for a copy of the modified Vim you distributed, you
+ must make your changes, including source code, available to the
+ maintainer without fee. The maintainer reserves the right to
+ include your changes in the official version of Vim. What the
+ maintainer will do with your changes and under what license they
+ will be distributed is negotiable. If there has been no negotiation
+ then this license, or a later version, also applies to your changes.
+ The current maintainer is Bram Moolenaar <Bram@vim.org>. If this
+ changes it will be announced in appropriate places (most likely
+ vim.sf.net, www.vim.org and/or comp.editors). When it is completely
+ impossible to contact the maintainer, the obligation to send him
+ your changes ceases. Once the maintainer has confirmed that he has
+ received your changes they will not have to be sent again.
+ b) If you have received a modified Vim that was distributed as
+ mentioned under a) you are allowed to further distribute it
+ unmodified, as mentioned at I). If you make additional changes the
+ text under a) applies to those changes.
+ c) Provide all the changes, including source code, with every copy of
+ the modified Vim you distribute. This may be done in the form of a
+ context diff. You can choose what license to use for new code you
+ add. The changes and their license must not restrict others from
+ making their own changes to the official version of Vim.
+ d) When you have a modified Vim which includes changes as mentioned
+ under c), you can distribute it without the source code for the
+ changes if the following three conditions are met:
+ - The license that applies to the changes permits you to distribute
+ the changes to the Vim maintainer without fee or restriction, and
+ permits the Vim maintainer to include the changes in the official
+ version of Vim without fee or restriction.
+ - You keep the changes for at least three years after last
+ distributing the corresponding modified Vim. When the maintainer
+ or someone who you distributed the modified Vim to asks you (in
+ any way) for the changes within this period, you must make them
+ available to him.
+ - You clearly describe in the distribution how to contact you. This
+ contact information must remain valid for at least three years
+ after last distributing the corresponding modified Vim, or as long
+ as possible.
+ e) When the GNU General Public License (GPL) applies to the changes,
+ you can distribute the modified Vim under the GNU GPL version 2 or
+ any later version.
+ 3) A message must be added, at least in the output of the ":version"
+ command and in the intro screen, such that the user of the modified Vim
+ is able to see that it was modified. When distributing as mentioned
+ under 2)e) adding the message is only required for as far as this does
+ not conflict with the license used for the changes.
+ 4) The contact information as required under 2)a) and 2)d) must not be
+ removed or changed, except that the person himself can make
+ corrections.
+
+III) If you distribute a modified version of Vim, you are encouraged to use
+ the Vim license for your changes and make them available to the
+ maintainer, including the source code. The preferred way to do this is
+ by e-mail or by uploading the files to a server and e-mailing the URL.
+ If the number of changes is small (e.g., a modified Makefile) e-mailing a
+ context diff will do. The e-mail address to be used is
+ <maintainer@vim.org>
+
+IV) It is not allowed to remove this license from the distribution of the Vim
+ sources, parts of it or from a modified version. You may use this
+ license for previous Vim releases instead of the license that they came
+ with, at your option.
+
+=== end of license ===
+
+Note:
+
+- If you are happy with Vim, please express that by reading the rest of this
+ file and consider helping needy children in Uganda.
+
+- If you want to support further Vim development consider becoming a
+ |sponsor|.
+
+- According to Richard Stallman the Vim license is GNU GPL compatible.
+ A few minor changes have been made since he checked it, but that should not
+ make a difference.
+
+- If you link Vim with a library that goes under the GNU GPL, this limits
+ further distribution to the GNU GPL. Also when you didn't actually change
+ anything in Vim.
+
+- Once a change is included that goes under the GNU GPL, this forces all
+ further changes to also be made under the GNU GPL or a compatible license.
+
+- If you distribute a modified version of Vim, you can include your name and
+ contact information with the "--with-modified-by" configure argument or the
+ MODIFIED_BY define.
+
+==============================================================================
+Kibaale Children's Centre *kcc*
+
+Kibaale Children's Centre (KCC) is located in Kibaale, a small town in the
+south of Uganda, near Tanzania, in East Africa. The area is known as Rakai
+District. The population is mostly farmers. Although people are poor, there
+is enough food. But this district is suffering from AIDS more than any other
+part of the world. Some say that it started there. Estimations are that 10
+to 30% of the Ugandans are infected with HIV. Because parents die, there are
+many orphans. In this district about 60,000 children have lost one or both
+parents, out of a population of 350,000. And this is still continuing.
+
+The children need a lot of help. The KCC is working hard to provide the needy
+with food, medical care and education. Food and medical care to keep them
+healthy now, and education so that they can take care of themselves in the
+future. KCC works on a Christian base, but help is given to children of any
+religion.
+
+The key to solving the problems in this area is education. This has been
+neglected in the past years with president Idi Amin and the following civil
+wars. Now that the government is stable again, the children and parents have
+to learn how to take care of themselves and how to avoid infections. There is
+also help for people who are ill and hungry, but the primary goal is to
+prevent people from getting ill and to teach them how to grow healthy food.
+
+Most of the orphans are living in an extended family. An uncle or older
+sister is taking care of them. Because these families are big and the income
+(if any) is low, a child is lucky if it gets healthy food. Clothes, medical
+care and schooling is beyond its reach. To help these needy children, a
+sponsorship program was put into place. A child can be financially adopted.
+For a few dollars a month KCC sees to it that the child gets indispensable
+items, is healthy, goes to school and KCC takes care of anything else that
+needs to be done for the child and the family that supports it.
+
+Besides helping the child directly, the environment where the child grows up
+needs to be improved. KCC helps schools to improve their teaching methods.
+There is a demonstration school at the centre and teacher trainings are given.
+Health workers are being trained, hygiene education is carried out and
+households are stimulated to build a proper latrine. I helped setting up a
+production site for cement slabs. These are used to build a good latrine.
+They are sold below cost price.
+
+There is a small clinic at the project, which provides children and their
+family with medical help. When needed, transport to a hospital is offered.
+Immunization programs are carried out and help is provided when an epidemic is
+breaking out (measles and cholera have been a problem).
+
+Summer 1994 to summer 1995 I spent a whole year at the centre, working as a
+volunteer. I have helped to expand the centre and worked in the area of water
+and sanitation. I learned that the help that the KCC provides really helps.
+Now that I'm back in Holland, I would like to continue supporting KCC. To do
+this I'm raising funds and organizing the sponsorship program. Please
+consider one of these possibilities:
+
+1. Sponsor a child in primary school: 17 euro a month (or more).
+2. Sponsor a child in secondary school: 25 euro a month (or more).
+3. Sponsor the clinic: Any amount a month or quarter
+4. A one-time donation
+
+Compared with other organizations that do child sponsorship the amounts are
+very low. This is because the money goes directly to the centre. Less than
+5% is used for administration. This is possible because this is a small
+organization that works with volunteers. If you would like to sponsor a
+child, you should have the intention to do this for at least one year.
+
+How do you know that the money will be spent right? First of all you have my
+personal guarantee as the author of Vim. I trust the people that are working
+at the centre, I know them personally. Further more, the centre is
+co-sponsored and inspected by World Vision, Save the Children Fund and
+International Child Care Fund. The centre is visited about once a year to
+check the progress (at our own cost). I have visited the centre myself in
+1996, 1998, 2000, 2001 and 2003. The visit reports are on the ICCF web site.
+
+If you have any further questions, send me e-mail: <Bram@vim.org>.
+
+The address of the centre is:
+ Kibaale Children's Centre
+ p.o. box 1658
+ Masaka, Uganda, East Africa
+
+Sending money:
+
+Check the ICCF web site for the latest information! See |iccf| for the URL.
+
+
+USA and Canada: Contact Kibaale Children's Fund (KCF) in Surrey, Canada. They
+ take care of the Canadian sponsors for the children in
+ Kibaale. You can send them a one time donation directly.
+ Please send me a note so that know what has been donated
+ because of Vim. Ask KCF for information about sponsorship.
+ Kibaale Children's Fund c/o Pacific Academy
+ 10238-168 Street
+ Surrey, B.C. V4N 1Z4
+ Canada
+ Phone: 604-581-5353
+ If you make a donation to Kibaale Children's Fund (KCF) you
+ will receive a tax receipt which can be submitted with your
+ tax return (under the Free Trade Agreement tax receipts issued
+ by an organization registered in Canada are fully accepted by
+ the IRS in the USA, with a few conditions).
+
+Holland: Transfer to the account of "Stichting ICCF Holland" in Venlo.
+ This will allow for tax deduction (if you live in Holland)!
+ Postbank, nr. 4548774
+
+Germany: It is possible to make donations that allow for a tax return.
+ Check the ICCF web site for the latest information:
+ http://iccf-holland.org/germany.html
+
+World: Use a postal money order. That should be possible from any
+ country, mostly from the post office. Use this name (which is
+ in my passport): "Abraham Moolenaar". Use Euro for the
+ currency if possible.
+
+Europe: Use a bank transfer if possible. Your bank should have a form
+ that you can use for this. See "Others" below for the swift
+ code and IBAN number.
+ Any other method should work. Ask for information about
+ sponsorship.
+
+Credit Card: You can use PayPal to send money with a Credit card. This is
+ the most widely used Internet based payment system. It's
+ really simple to use. Use this link to find more info:
+ https://www.paypal.com/affil/pal=Bram%40moolenaar.net
+ The e-mail address for sending the money to is:
+ Bram@iccf-holland.org
+ For amounts above $150 sending a cheque is preferred.
+
+Others: Transfer to one of these accounts if possible:
+ Postbank, account 4548774
+ Swift code: INGB NL 2A
+ IBAN: NL47 PSTB 0004 5487 74
+ under the name "stichting ICCF Holland", Venlo
+ If that doesn't work:
+ Rabobank Venlo, account 3765.05.117
+ Swift code: RABO NL 2U
+ under the name "Bram Moolenaar", Venlo
+ Otherwise, send a cheque in euro or US dollars to the address
+ below. Minimal amount: $70 (my bank does not accept smaller
+ amounts for foreign cheques, sorry)
+
+Address to send cheques to:
+ stichting ICCF Holland
+ Bram Moolenaar
+ Clematisstraat 30
+ 5925 BE Venlo
+ The Netherlands
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt
new file mode 100644
index 000000000..433fc759a
--- /dev/null
+++ b/runtime/doc/undo.txt
@@ -0,0 +1,117 @@
+*undo.txt* For Vim version 7.0aa. Last change: 2003 Oct 21
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Undo and redo *undo-redo*
+
+The basics are explained in section |02.5| of the user manual.
+
+1. Undo and redo commands |undo-commands|
+2. Two ways of undo |undo-two-ways|
+3. Remarks about undo |undo-remarks|
+
+==============================================================================
+1. Undo and redo commands *undo-commands*
+
+<Undo> or *undo* *<Undo>* *u*
+u Undo [count] changes. {Vi: only one level}
+
+ *:u* *:un* *:undo*
+:u[ndo] Undo one change. {Vi: only one level}
+
+ *CTRL-R*
+CTRL-R Redo [count] changes which were undone. {Vi: redraw
+ screen}
+
+ *:red* *:redo* *redo*
+:red[o] Redo one change which was undone. {Vi: no redo}
+
+ *U*
+U Undo all latest changes on one line. {Vi: while not
+ moved off of it}
+
+The last changes are remembered. You can use the undo and redo commands above
+to revert the text to how it was before each change. You can also apply the
+changes again, getting back the text before the undo.
+
+The "U" command is treated by undo/redo just like any other command. Thus a
+"u" command undoes a "U" command and a 'CTRL-R' command redoes it again. When
+mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will
+restore the situation of a line to before the previous "U" command. This may
+be confusing. Try it out to get used to it.
+The "U" command will always mark the buffer as changed. When "U" changes the
+buffer back to how it was without changes, it is still considered changed.
+Use "u" to undo changes until the buffer becomes unchanged.
+
+==============================================================================
+2. Two ways of undo *undo-two-ways*
+
+How undo and redo commands work depends on the 'u' flag in 'cpoptions'.
+There is the Vim way ('u' excluded) and the vi-compatible way ('u' included).
+In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does
+nothing (undoes an undo).
+
+'u' excluded, the Vim way:
+You can go back in time with the undo command. You can then go forward again
+with the redo command. If you make a new change after the undo command,
+the redo will not be possible anymore.
+
+'u' included, the Vi-compatible way:
+The undo command undoes the previous change, and also the previous undo command.
+The redo command repeats the previous undo command. It does NOT repeat a
+change command, use "." for that.
+
+Examples Vim way Vi-compatible way ~
+"uu" two times undo no-op
+"u CTRL-R" no-op two times undo
+
+Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this
+ is not Vi compatible. For example "dwdwu." in Vi deletes two
+ words, in Nvi it does nothing.
+
+==============================================================================
+3. Remarks about undo *undo-remarks*
+
+The number of changes that are remembered is set with the 'undolevels' option.
+If it is zero, the Vi-compatible way is always used. If it is negative no
+undo is possible. Use this if you are running out of memory.
+
+Marks for the buffer ('a to 'z) are also saved and restored, together with the
+text. {Vi does this a little bit different}
+
+When all changes have been undone, the buffer is not considered to be changed.
+It is then possible to exit Vim with ":q" instead of ":q!" {not in Vi}. Note
+that this is relative to the last write of the file. Typing "u" after ":w"
+actually changes the buffer, compared to what was written, so the buffer is
+considered changed then.
+
+When manual |folding| is being used, the folds are not saved and restored.
+Only changes completely within a fold will keep the fold as it was, because
+the first and last line of the fold don't change.
+
+The numbered registers can also be used for undoing deletes. Each time you
+delete text, it is put into register "1. The contents of register "1 are
+shifted to "2, etc. The contents of register "9 are lost. You can now get
+back the most recent deleted text with the put command: '"1P'. (also, if the
+deleted text was the result of the last delete or copy operation, 'P' or 'p'
+also works as this puts the contents of the unnamed register). You can get
+back the text of three deletes ago with '"3P'.
+
+ *redo-register*
+If you want to get back more than one part of deleted text, you can use a
+special feature of the repeat command ".". It will increase the number of the
+register used. So if you first do ""1P", the following "." will result in a
+'"2P'. Repeating this will result in all numbered registers being inserted.
+
+Example: If you deleted text with 'dd....' it can be restored with
+ '"1P....'.
+
+If you don't know in which register the deleted text is, you can use the
+:display command. An alternative is to try the first register with '"1P', and
+if it is not what you want do 'u.'. This will remove the contents of the
+first put, and repeat the put command for the second register. Repeat the
+'u.' until you got what you want.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt
new file mode 100644
index 000000000..39a603ac1
--- /dev/null
+++ b/runtime/doc/usr_01.txt
@@ -0,0 +1,180 @@
+*usr_01.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ About the manuals
+
+
+This chapter introduces the manuals available with Vim. Read this to know the
+conditions under which the commands are explained.
+
+|01.1| Two manuals
+|01.2| Vim installed
+|01.3| Using the Vim tutor
+|01.4| Copyright
+
+ Next chapter: |usr_02.txt| The first steps in Vim
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*01.1* Two manuals
+
+The Vim documentation consists of two parts:
+
+1. The User manual
+ Task oriented explanations, from simple to complex. Reads from start to
+ end like a book.
+
+2. The Reference manual
+ Precise description of how everything in Vim works.
+
+The notation used in these manuals is explained here: |notation|
+
+
+JUMPING AROUND
+
+The text contains hyperlinks between the two parts, allowing you to quickly
+jump between the description of an editing task and a precise explanation of
+the commands and options used for it. Use these two commands:
+
+ Press CTRL-] to jump to a subject under the cursor.
+ Press CTRL-O to jump back (repeat to go further back).
+
+Many links are in vertical bars, like this: |bars|. An option name, like
+'number', a command in double quotes like ":write" and any other word can also
+be used as a link. Try it out: Move the cursor to CTRL-] and press CTRL-]
+on it.
+
+Other subjects can be found with the ":help" command, see |help.txt|.
+
+==============================================================================
+*01.2* Vim installed
+
+Most of the manuals assume that Vim has been properly installed. If you
+didn't do that yet, or if Vim doesn't run properly (e.g., files can't be found
+or in the GUI the menus do not show up) first read the chapter on
+installation: |usr_90.txt|.
+ *not-compatible*
+The manuals often assume you are using Vim with Vi-compatibility switched
+off. For most commands this doesn't matter, but sometimes it is important,
+e.g., for multi-level undo. An easy way to make sure you are using the right
+setup, copy the example vimrc file. By doing this inside Vim you don't have
+to check out where it is located. How to do this depends on the system you
+are using:
+
+Unix: >
+ :!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
+MS-DOS, MS-Windows, OS/2: >
+ :!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
+Amiga: >
+ :!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
+
+If the file already exists you probably want to keep it.
+
+If you start Vim now, the 'compatible' option should be off. You can check it
+with this command: >
+
+ :set compatible?
+
+If it responds with "nocompatible" you are doing well. If the response is
+"compatible" you are in trouble. You will have to find out why the option is
+still set. Perhaps the file you wrote above is not found. Use this command
+to find out: >
+
+ :scriptnames
+
+If your file is not in the list, check its location and name. If it is in the
+list, there must be some other place where the 'compatible' option is switched
+back on.
+
+For more info see |vimrc| and |compatible-default|.
+
+ Note:
+ This manual is about using Vim in the normal way. There is an
+ alternative called "evim" (easy Vim). This is still Vim, but used in
+ a way that resembles a click-and-type editor like Notepad. It always
+ stays in Insert mode, thus it feels very different. It is not
+ explained in the user manual, since it should be mostly self
+ explanatory. See |evim-keys| for details.
+
+==============================================================================
+*01.3* Using the Vim tutor *tutor* *vimtutor*
+
+Instead of reading the text (boring!) you can use the vimtutor to learn your
+first Vim commands. This is a 30 minute tutorial that teaches the most basic
+Vim functionality hands-on.
+
+On Unix and MS-Windows, if Vim has been properly installed, you can start it
+from the shell:
+>
+ vimtutor
+
+This will make a copy of the tutor file, so that you can edit it without
+the risk of damaging the original.
+ There are a few translated versions of the tutor. To find out if yours is
+available, use the two-letter language code. For French: >
+
+ vimtutor fr
+
+For OpenVMS, if Vim has been properly installed, you can start vimtutor from a
+VMS prompt with: >
+
+ @VIM:vimtutor
+
+Optionally add the two-letter language code as above.
+
+
+On other systems, you have to do a little work:
+
+1. Copy the tutor file. You can do this with Vim (it knows where to find it):
+>
+ vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q'
+<
+ This will write the file "TUTORCOPY" in the current directory. To use a
+translated version of the tutor, append the two-letter language code to the
+filename. For French:
+>
+ vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q'
+<
+2. Edit the copied file with Vim:
+>
+ vim -u NONE -c "set nocp" TUTORCOPY
+<
+ The extra arguments make sure Vim is started in a good mood.
+
+3. Delete the copied file when you are finished with it:
+>
+ del TUTORCOPY
+<
+==============================================================================
+*01.4* Copyright *manual-copyright*
+
+The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
+Moolenaar. This material may be distributed only subject to the terms and
+conditions set forth in the Open Publication License, v1.0 or later. The
+latest version is presently available at:
+ http://www.opencontent.org/opl.shtml
+
+People who contribute to the manuals must agree with the above copyright
+notice.
+ *frombook*
+Parts of the user manual come from the book "Vi IMproved - Vim" by Steve
+Oualline (published by New Riders Publishing, ISBN: 0735710015). The Open
+Publication License applies to this book. Only selected parts are included
+and these have been modified (e.g., by removing the pictures, updating the
+text for Vim 6.0 and fixing mistakes). The omission of the |frombook| tag
+does not mean that the text does not come from the book.
+
+Many thanks to Steve Oualline and New Riders for creating this book and
+publishing it under the OPL! It has been a great help while writing the user
+manual. Not only by providing literal text, but also by setting the tone and
+style.
+
+If you make money through selling the manuals, you are strongly encouraged to
+donate part of the profit to help AIDS victims in Uganda. See |iccf|.
+
+==============================================================================
+
+Next chapter: |usr_02.txt| The first steps in Vim
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt
new file mode 100644
index 000000000..7d3206b66
--- /dev/null
+++ b/runtime/doc/usr_02.txt
@@ -0,0 +1,504 @@
+*usr_02.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ The first steps in Vim
+
+
+This chapter provides just enough information to edit a file with Vim. Not
+well or fast, but you can edit. Take some time to practice with these
+commands, they form the base for what follows.
+
+|02.1| Running Vim for the First Time
+|02.2| Inserting text
+|02.3| Moving around
+|02.4| Deleting characters
+|02.5| Undo and Redo
+|02.6| Other editing commands
+|02.7| Getting out
+|02.8| Finding help
+
+ Next chapter: |usr_03.txt| Moving around
+ Previous chapter: |usr_01.txt| About the manuals
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*02.1* Running Vim for the First Time
+
+To start Vim, enter this command: >
+
+ gvim file.txt
+
+In UNIX you can type this at any command prompt. If you are running Microsoft
+Windows, open an MS-DOS prompt window and enter the command.
+ In either case, Vim starts editing a file called file.txt. Because this
+is a new file, you get a blank window. This is what your screen will look
+like:
+
+ +---------------------------------------+
+ |# |
+ |~ |
+ |~ |
+ |~ |
+ |~ |
+ |"file.txt" [New file] |
+ +---------------------------------------+
+ ('#" is the cursor position.)
+
+The tilde (~) lines indicate lines not in the file. In other words, when Vim
+runs out of file to display, it displays tilde lines. At the bottom of the
+screen, a message line indicates the file is named file.txt and shows that you
+are creating a new file. The message information is temporary and other
+information overwrites it.
+
+
+THE VIM COMMAND
+
+The gvim command causes the editor to create a new window for editing. If you
+use this command: >
+
+ vim file.txt
+
+the editing occurs inside your command window. In other words, if you are
+running inside an xterm, the editor uses your xterm window. If you are using
+an MS-DOS command prompt window under Microsoft Windows, the editing occurs
+inside this window. The text in the window will look the same for both
+versions, but with gvim you have extra features, like a menu bar. More about
+that later.
+
+==============================================================================
+*02.2* Inserting text
+
+The Vim editor is a modal editor. That means that the editor behaves
+differently, depending on which mode you are in. The two basic modes are
+called Normal mode and Insert mode. In Normal mode the characters you type
+are commands. In Insert mode the characters are inserted as text.
+ Since you have just started Vim it will be in Normal mode. To start Insert
+mode you type the "i" command (i for Insert). Then you can enter
+the text. It will be inserted into the file. Do not worry if you make
+mistakes; you can correct them later. To enter the following programmer's
+limerick, this is what you type: >
+
+ iA very intelligent turtle
+ Found programming UNIX a hurdle
+
+After typing "turtle" you press the <Enter> key to start a new line. Finally
+you press the <Esc> key to stop Insert mode and go back to Normal mode. You
+now have two lines of text in your Vim window:
+
+ +---------------------------------------+
+ |A very intelligent turtle |
+ |Found programming UNIX a hurdle |
+ |~ |
+ |~ |
+ | |
+ +---------------------------------------+
+
+
+WHAT IS THE MODE?
+
+To be able to see what mode you are in, type this command: >
+
+ :set showmode
+
+You will notice that when typing the colon Vim moves the cursor to the last
+line of the window. That's where you type colon commands (commands that start
+with a colon). Finish this command by pressing the <Enter> key (all commands
+that start with a colon are finished this way).
+ Now, if you type the "i" command Vim will display --INSERT-- at the bottom
+of the window. This indicates you are in Insert mode.
+
+ +---------------------------------------+
+ |A very intelligent turtle |
+ |Found programming UNIX a hurdle |
+ |~ |
+ |~ |
+ |-- INSERT -- |
+ +---------------------------------------+
+
+If you press <Esc> to go back to Normal mode the last line will be made blank.
+
+
+GETTING OUT OF TROUBLE
+
+One of the problems for Vim novices is mode confusion, which is caused by
+forgetting which mode you are in or by accidentally typing a command that
+switches modes. To get back to Normal mode, no matter what mode you are in,
+press the <Esc> key. Sometimes you have to press it twice. If Vim beeps back
+at you, you already are in Normal mode.
+
+==============================================================================
+*02.3* Moving around
+
+After you return to Normal mode, you can move around by using these keys:
+
+ h left *hjkl*
+ j down
+ k up
+ l right
+
+At first, it may appear that these commands were chosen at random. After all,
+who ever heard of using l for right? But actually, there is a very good
+reason for these choices: Moving the cursor is the most common thing you do in
+an editor, and these keys are on the home row of your right hand. In other
+words, these commands are placed where you can type them the fastest
+(especially when you type with ten fingers).
+
+ Note:
+ You can also move the cursor by using the arrow keys. If you do,
+ however, you greatly slow down your editing because to press the arrow
+ keys, you must move your hand from the text keys to the arrow keys.
+ Considering that you might be doing it hundreds of times an hour, this
+ can take a significant amount of time.
+ Also, there are keyboards which do not have arrow keys, or which
+ locate them in unusual places; therefore, knowing the use of the hjkl
+ keys helps in those situations.
+
+One way to remember these commands is that h is on the left, l is on the
+right and j points down. In a picture: >
+
+ k
+ h l
+ j
+
+The best way to learn these commands is by using them. Use the "i" command to
+insert some more lines of text. Then use the hjkl keys to move around and
+insert a word somewhere. Don't forget to press <Esc> to go back to Normal
+mode. The |vimtutor| is also a nice way to learn by doing.
+
+For Japanese users, Hiroshi Iwatani suggested using this:
+
+ Komsomolsk
+ ^
+ |
+ Huan Ho <--- ---> Los Angeles
+ (Yellow river) |
+ v
+ Java (the island, not the programming language)
+
+==============================================================================
+*02.4* Deleting characters
+
+To delete a character, move the cursor over it and type "x". (This is a
+throwback to the old days of the typewriter, when you deleted things by typing
+xxxx over them.) Move the cursor to the beginning of the first line, for
+example, and type xxxxxxx (seven x's) to delete "A very ". The result should
+look like this:
+
+ +---------------------------------------+
+ |intelligent turtle |
+ |Found programming UNIX a hurdle |
+ |~ |
+ |~ |
+ | |
+ +---------------------------------------+
+
+Now you can insert new text, for example by typing: >
+
+ iA young <Esc>
+
+This begins an insert (the i), inserts the words "A young", and then exits
+insert mode (the final <Esc>). The result:
+
+ +---------------------------------------+
+ |A young intelligent turtle |
+ |Found programming UNIX a hurdle |
+ |~ |
+ |~ |
+ | |
+ +---------------------------------------+
+
+
+DELETING A LINE
+
+To delete a whole line use the "dd" command. The following line will
+then move up to fill the gap:
+
+ +---------------------------------------+
+ |Found programming UNIX a hurdle |
+ |~ |
+ |~ |
+ |~ |
+ | |
+ +---------------------------------------+
+
+
+DELETING A LINE BREAK
+
+In Vim you can join two lines together, which means that the line break
+between them is deleted. The "J" command does this.
+ Take these two lines:
+
+ A young intelligent ~
+ turtle ~
+
+Move the cursor to the first line and press "J":
+
+ A young intelligent turtle ~
+
+==============================================================================
+*02.5* Undo and Redo
+
+Suppose you delete too much. Well, you can type it in again, but an easier
+way exists. The "u" command undoes the last edit. Take a look at this in
+action: After using "dd" to delete the first line, "u" brings it back.
+ Another one: Move the cursor to the A in the first line:
+
+ A young intelligent turtle ~
+
+Now type xxxxxxx to delete "A young". The result is as follows:
+
+ intelligent turtle ~
+
+Type "u" to undo the last delete. That delete removed the g, so the undo
+restores the character.
+
+ g intelligent turtle ~
+
+The next u command restores the next-to-last character deleted:
+
+ ng intelligent turtle ~
+
+The next u command gives you the u, and so on:
+
+ ung intelligent turtle ~
+ oung intelligent turtle ~
+ young intelligent turtle ~
+ young intelligent turtle ~
+ A young intelligent turtle ~
+
+ Note:
+ If you type "u" twice, and the result is that you get the same text
+ back, you have Vim configured to work Vi compatible. Look here to fix
+ this: |not-compatible|.
+ This text assumes you work "The Vim Way". You might prefer to use
+ the good old Vi way, but you will have to watch out for small
+ differences in the text then.
+
+
+REDO
+
+If you undo too many times, you can press CTRL-R (redo) to reverse the
+preceding command. In other words, it undoes the undo. To see this in
+action, press CTRL-R twice. The character A and the space after it disappear:
+
+ young intelligent turtle ~
+
+There's a special version of the undo command, the "U" (undo line) command.
+The undo line command undoes all the changes made on the last line that was
+edited. Typing this command twice cancels the preceding "U".
+
+ A very intelligent turtle ~
+ xxxx Delete very
+
+ A intelligent turtle ~
+ xxxxxx Delete turtle
+
+ A intelligent ~
+ Restore line with "U"
+ A very intelligent turtle ~
+ Undo "U" with "u"
+ A intelligent ~
+
+The "U" command is a change by itself, which the "u" command undoes and CTRL-R
+redoes. This might be a bit confusing. Don't worry, with "u" and CTRL-R you
+can go to any of the situations you had.
+
+==============================================================================
+*02.6* Other editing commands
+
+Vim has a large number of commands to change the text. See |Q_in| and below.
+Here are a few often used ones.
+
+
+APPENDING
+
+The "i" command inserts a character before the character under the cursor.
+That works fine; but what happens if you want to add stuff to the end of the
+line? For that you need to insert text after the cursor. This is done with
+the "a" (append) command.
+ For example, to change the line
+
+ and that's not saying much for the turtle. ~
+to
+ and that's not saying much for the turtle!!! ~
+
+move the cursor over to the dot at the end of the line. Then type "x" to
+delete the period. The cursor is now positioned at the end of the line on the
+e in turtle. Now type >
+
+ a!!!<Esc>
+
+to append three exclamation points after the e in turtle:
+
+ and that's not saying much for the turtle!!! ~
+
+
+OPENING UP A NEW LINE
+
+The "o" command creates a new, empty line below the cursor and puts Vim in
+Insert mode. Then you can type the text for the new line.
+ Suppose the cursor is somewhere in the first of these two lines:
+
+ A very intelligent turtle ~
+ Found programming UNIX a hurdle ~
+
+If you now use the "o" command and type new text: >
+
+ oThat liked using Vim<Esc>
+
+The result is:
+
+ A very intelligent turtle ~
+ That liked using Vim ~
+ Found programming UNIX a hurdle ~
+
+The "O" command (uppercase) opens a line above the cursor.
+
+
+USING A COUNT
+
+Suppose you want to move up nine lines. You can type "kkkkkkkkk" or you can
+enter the command "9k". In fact, you can precede many commands with a number.
+Earlier in this chapter, for instance, you added three exclamation points to
+the end of a line by typing "a!!!<Esc>". Another way to do this is to use the
+command "3a!<Esc>". The count of 3 tells the command that follows to triple
+its effect. Similarly, to delete three characters, use the command "3x". The
+count always comes before the command it applies to.
+
+==============================================================================
+*02.7* Getting out
+
+To exit, use the "ZZ" command. This command writes the file and exits.
+
+ Note:
+ Unlike many other editors, Vim does not automatically make a backup
+ file. If you type "ZZ", your changes are committed and there's no
+ turning back. You can configure the Vim editor to produce backup
+ files, see |07.4|.
+
+
+DISCARDING CHANGES
+
+Sometimes you will make a sequence of changes and suddenly realize you were
+better off before you started. Not to worry; Vim has a
+quit-and-throw-things-away command. It is: >
+
+ :q!
+
+Don't forget to press <Enter> to finish the command.
+
+For those of you interested in the details, the three parts of this command
+are the colon (:), which enters Command-line mode; the q command, which tells
+the editor to quit; and the override command modifier (!).
+ The override command modifier is needed because Vim is reluctant to throw
+away changes. If you were to just type ":q", Vim would display an error
+message and refuse to exit:
+
+ E37: No write since last change (use ! to override) ~
+
+By specifying the override, you are in effect telling Vim, "I know that what
+I'm doing looks stupid, but I'm a big boy and really want to do this."
+
+If you want to continue editing with Vim: The ":e!" command reloads the
+original version of the file.
+
+==============================================================================
+*02.8* Finding help
+
+Everything you always wanted to know can be found in the Vim help files.
+Don't be afraid to ask!
+ To get generic help use this command: >
+
+ :help
+
+You could also use the first function key <F1>. If your keyboard has a <Help>
+key it might work as well.
+ If you don't supply a subject, ":help" displays the general help window.
+The creators of Vim did something very clever (or very lazy) with the help
+system: They made the help window a normal editing window. You can use all
+the normal Vim commands to move through the help information. Therefore h, j,
+k, and l move left, down, up and right.
+ To get out of the help window, use the same command you use to get out of
+the editor: "ZZ". This will only close the help window, not exit Vim.
+
+As you read the help text, you will notice some text enclosed in vertical bars
+(for example, |help|). This indicates a hyperlink. If you position the
+cursor anywhere between the bars and press CTRL-] (jump to tag), the help
+system takes you to the indicated subject. (For reasons not discussed here,
+the Vim terminology for a hyperlink is tag. So CTRL-] jumps to the location
+of the tag given by the word under the cursor.)
+ After a few jumps, you might want to go back. CTRL-T (pop tag) takes you
+back to the preceding position. CTRL-O (jump to older position) also works
+nicely here.
+ At the top of the help screen, there is the notation *help.txt*. This name
+between "*" characters is used by the help system to define a tag (hyperlink
+destination).
+ See |29.1| for details about using tags.
+
+To get help on a given subject, use the following command: >
+
+ :help {subject}
+
+To get help on the "x" command, for example, enter the following: >
+
+ :help x
+
+To find out how to delete text, use this command: >
+
+ :help deleting
+
+To get a complete index of all Vim commands, use the following command: >
+
+ :help index
+
+When you need to get help for a control character command (for example,
+CTRL-A), you need to spell it with the prefix "CTRL-". >
+
+ :help CTRL-A
+
+The Vim editor has many different modes. By default, the help system displays
+the normal-mode commands. For example, the following command displays help
+for the normal-mode CTRL-H command: >
+
+ :help CTRL-H
+
+To identify other modes, use a mode prefix. If you want the help for the
+insert-mode version of a command, use "i_". For CTRL-H this gives you the
+following command: >
+
+ :help i_CTRL-H
+
+When you start the Vim editor, you can use several command-line arguments.
+These all begin with a dash (-). To find what the -t argument does, for
+example, use the command: >
+
+ :help -t
+
+The Vim editor has a number of options that enable you to configure and
+customize the editor. If you want help for an option, you need to enclose it
+in single quotation marks. To find out what the 'number' option does, for
+example, use the following command: >
+
+ :help 'number'
+
+The table with all mode prefixes can be found here: |help-context|.
+
+Special keys are enclosed in angle brackets. To find help on the up-arrow key
+in Insert mode, for instance, use this command: >
+
+ :help i_<Up>
+
+If you see an error message that you don't understand, for example:
+
+ E37: No write since last change (use ! to override) ~
+
+You can use the error ID at the start to find help about it: >
+
+ :help E37
+
+==============================================================================
+
+Next chapter: |usr_03.txt| Moving around
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
new file mode 100644
index 000000000..f2ef2af02
--- /dev/null
+++ b/runtime/doc/usr_03.txt
@@ -0,0 +1,654 @@
+*usr_03.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Moving around
+
+
+Before you can insert or delete text the cursor has to be moved to the right
+place. Vim has a large number of commands to position the cursor. This
+chapter shows you how to use the most important ones. You can find a list of
+these commands below |Q_lr|.
+
+|03.1| Word movement
+|03.2| Moving to the start or end of a line
+|03.3| Moving to a character
+|03.4| Matching a paren
+|03.5| Moving to a specific line
+|03.6| Telling where you are
+|03.7| Scrolling around
+|03.8| Simple searches
+|03.9| Simple search patterns
+|03.10| Using marks
+
+ Next chapter: |usr_04.txt| Making small changes
+ Previous chapter: |usr_02.txt| The first steps in Vim
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*03.1* Word movement
+
+To move the cursor forward one word, use the "w" command. Like most Vim
+commands, you can use a numeric prefix to move past multiple words. For
+example, "3w" moves three words. This figure shows how it works:
+
+ This is a line with example text ~
+ --->-->->----------------->
+ w w w 3w
+
+Notice that "w" moves to the start of the next word if it already is at the
+start of a word.
+ The "b" command moves backward to the start of the previous word:
+
+ This is a line with example text ~
+ <----<--<-<---------<---
+ b b b 2b b
+
+There is also the "e" command that moves to the next end of a word and "ge",
+which moves to the previous end of a word:
+
+ This is a line with example text ~
+ <- <--- -----> ---->
+ ge ge e e
+
+If you are at the last word of a line, the "w" command will take you to the
+first word in the next line. Thus you can use this to move through a
+paragraph, much faster than using "l". "b" does the same in the other
+direction.
+
+A word ends at a non-word character, such as a ".", "-" or ")". To change
+what Vim considers to be a word, see the 'iskeyword' option.
+ It is also possible to move by white-space separated WORDs. This is not a
+word in the normal sense, that's why the uppercase is used. The commands for
+moving by WORDs are also uppercase, as this figure shows:
+
+ ge b w e
+ <- <- ---> --->
+ This is-a line, with special/separated/words (and some more). ~
+ <----- <----- --------------------> ----->
+ gE B W E
+
+With this mix of lowercase and uppercase commands, you can quickly move
+forward and backward through a paragraph.
+
+==============================================================================
+*03.2* Moving to the start or end of a line
+
+The "$" command moves the cursor to the end of a line. If your keyboard has
+an <End> key it will do the same thing.
+
+The "^" command moves to the first non-blank character of the line. The "0"
+command (zero) moves to the very first character of the line. The <Home> key
+does the same thing. In a picture:
+
+ ^
+ <------------
+ .....This is a line with example text ~
+ <----------------- --------------->
+ 0 $
+
+(the "....." indicates blanks here)
+
+ The "$" command takes a count, like most movement commands. But moving to
+the end of the line several times doesn't make sense. Therefore it causes the
+editor to move to the end of another line. For example, "1$" moves you to
+the end of the first line (the one you're on), "2$" to the end of the next
+line, and so on.
+ The "0" command doesn't take a count argument, because the "0" would be
+part of the count. Unexpectedly, using a count with "^" doesn't have any
+effect.
+
+==============================================================================
+*03.3* Moving to a character
+
+One of the most useful movement commands is the single-character search
+command. The command "fx" searches forward in the line for the single
+character x. Hint: "f" stands for "Find".
+ For example, you are at the beginning of the following line. Suppose you
+want to go to the h of human. Just execute the command "fh" and the cursor
+will be positioned over the h:
+
+ To err is human. To really foul up you need a computer. ~
+ ---------->--------------->
+ fh fy
+
+This also shows that the command "fy" moves to the end of the word really.
+ You can specify a count; therefore, you can go to the "l" of "foul" with
+"3fl":
+
+ To err is human. To really foul up you need a computer. ~
+ --------------------->
+ 3fl
+
+The "F" command searches to the left:
+
+ To err is human. To really foul up you need a computer. ~
+ <---------------------
+ Fh
+
+The "tx" command works like the "fx" command, except it stops one character
+before the searched character. Hint: "t" stands for "To". The backward
+version of this command is "Tx".
+
+ To err is human. To really foul up you need a computer. ~
+ <------------ ------------->
+ Th tn
+
+These four commands can be repeated with ";". "," repeats in the other
+direction. The cursor is never moved to another line. Not even when the
+sentence continues.
+
+Sometimes you will start a search, only to realize that you have typed the
+wrong command. You type "f" to search backward, for example, only to realize
+that you really meant "F". To abort a search, press <Esc>. So "f<Esc>" is an
+aborted forward search and doesn't do anything. Note: <Esc> cancels most
+operations, not just searches.
+
+==============================================================================
+*03.4* Matching a paren
+
+When writing a program you often end up with nested () constructs. Then the
+"%" command is very handy: It moves to the matching paren. If the cursor is
+on a "(" it will move to the matching ")". If it's on a ")" it will move to
+the matching "(".
+
+ %
+ <----->
+ if (a == (b * c) / d) ~
+ <---------------->
+ %
+
+This also works for [] and {} pairs. (This can be defined with the
+'matchpairs' option.)
+
+When the cursor is not on a useful character, "%" will search forward to find
+one. Thus if the cursor is at the start of the line of the previous example,
+"%" will search forward and find the first "(". Then it moves to its match:
+
+ if (a == (b * c) / d) ~
+ ---+---------------->
+ %
+
+==============================================================================
+*03.5* Moving to a specific line
+
+If you are a C or C++ programmer, you are familiar with error messages such as
+the following:
+
+ prog.c:33: j undeclared (first use in this function) ~
+
+This tells you that you might want to fix something on line 33. So how do you
+find line 33? One way is to do "9999k" to go to the top of the file and "32j"
+to go down thirty two lines. It is not a good way, but it works. A much
+better way of doing things is to use the "G" command. With a count, this
+command positions you at the given line number. For example, "33G" puts you
+on line 33. (For a better way of going through a compiler's error list, see
+|usr_30.txt|, for information on the :make command.)
+ With no argument, "G" positions you at the end of the file. A quick way to
+go to the start of a file use "gg". "1G" will do the same, but is a tiny bit
+more typing.
+
+ | first line of a file ^
+ | text text text text |
+ | text text text text | gg
+ 7G | text text text text |
+ | text text text text
+ | text text text text
+ V text text text text |
+ text text text text | G
+ text text text text |
+ last line of a file V
+
+Another way to move to a line is using the "%" command with a count. For
+example "50%" moves you to halfway the file. "90%" goes to near the end.
+
+The previous assumes that you want to move to a line in the file, no matter if
+it's currently visible or not. What if you want to move to one of the lines
+you can see? This figure shows the three commands you can use:
+
+ +---------------------------+
+ H --> | text sample text |
+ | sample text |
+ | text sample text |
+ | sample text |
+ M --> | text sample text |
+ | sample text |
+ | text sample text |
+ | sample text |
+ L --> | text sample text |
+ +---------------------------+
+
+Hints: "H" stands for Home, "M" for Middle and "L" for Last.
+
+==============================================================================
+*03.6* Telling where you are
+
+To see where you are in a file, there are three ways:
+
+1. Use the CTRL-G command. You get a message like this (assuming the 'ruler'
+ option is off):
+
+ "usr_03.txt" line 233 of 650 --35%-- col 45-52 ~
+
+ This shows the name of the file you are editing, the line number where the
+ cursor is, the total number of lines, the percentage of the way through
+ the file and the column of the cursor.
+ Sometimes you will see a split column number. For example, "col 2-9".
+ This indicates that the cursor is positioned on the second character, but
+ because character one is a tab, occupying eight spaces worth of columns,
+ the screen column is 9.
+
+2. Set the 'number' option. This will display a line number in front of
+ every line: >
+
+ :set number
+<
+ To switch this off again: >
+
+ :set nonumber
+<
+ Since 'number' is a boolean option, prepending "no" to its name has the
+ effect of switching it off. A boolean option has only these two values,
+ it is either on or off.
+ Vim has many options. Besides the boolean ones there are options with
+ a numerical value and string options. You will see examples of this where
+ they are used.
+
+3. Set the 'ruler' option. This will display the cursor position in the
+ lower right corner of the Vim window: >
+
+ :set ruler
+
+Using the 'ruler' option has the advantage that it doesn't take much room,
+thus there is more space for your text.
+
+==============================================================================
+*03.7* Scrolling around
+
+The CTRL-U command scrolls down half a screen of text. Think of looking
+through a viewing window at the text and moving this window up by half the
+height of the window. Thus the window moves up over the text, which is
+backward in the file. Don't worry if you have a little trouble remembering
+which end is up. Most users have the same problem.
+ The CTRL-D command moves the viewing window down half a screen in the file,
+thus scrolls the text up half a screen.
+
+ +----------------+
+ | some text |
+ | some text |
+ | some text |
+ +---------------+ | some text |
+ | some text | CTRL-U --> | |
+ | | | 123456 |
+ | 123456 | +----------------+
+ | 7890 |
+ | | +----------------+
+ | example | CTRL-D --> | 7890 |
+ +---------------+ | |
+ | example |
+ | example |
+ | example |
+ | example |
+ +----------------+
+
+To scroll one line at a time use CTRL-E (scroll up) and CTRL-Y (scroll down).
+Think of CTRL-E to give you one line Extra. (If you use MS-Windows compatible
+key mappings CTRL-Y will redo a change instead of scroll.)
+
+To scroll forward by a whole screen (except for two lines) use CTRL-F. The
+other way is backward, CTRL-B is the command to use. Fortunately CTRL-F is
+Forward and CTRL-B is Backward, that's easy to remember.
+
+A common issue is that after moving down many lines with "j" your cursor is at
+the bottom of the screen. You would like to see the context of the line with
+the cursor. That's done with the "zz" command.
+
+ +------------------+ +------------------+
+ | some text | | some text |
+ | some text | | some text |
+ | some text | | some text |
+ | some text | zz --> | line with cursor |
+ | some text | | some text |
+ | some text | | some text |
+ | line with cursor | | some text |
+ +------------------+ +------------------+
+
+The "zt" command puts the cursor line at the top, "zb" at the bottom. There
+are a few more scrolling commands, see |Q_sc|. To always keep a few lines of
+context around the cursor, use the 'scrolloff' option.
+
+==============================================================================
+*03.8* Simple searches
+
+To search for a string, use the "/string" command. To find the word include,
+for example, use the command: >
+
+ /include
+
+You will notice that when you type the "/" the cursor jumps to the last line
+of the Vim window, like with colon commands. That is where you type the word.
+You can press the backspace key (backarrow or <BS>) to make corrections. Use
+the <Left> and <Right> cursor keys when necessary.
+ Pressing <Enter> executes the command.
+
+ Note:
+ The characters .*[]^%/\?~$ have special meaning. If you want to use
+ them in a search you must put a \ in front of them. See below.
+
+To find the next occurrence of the same string use the "n" command. Use this
+to find the first #include after the cursor: >
+
+ /#include
+
+And then type "n" several times. You will move to each #include in the text.
+You can also use a count if you know which match you want. Thus "3n" finds
+the third match. Using a count with "/" doesn't work.
+
+The "?" command works like "/" but searches backwards: >
+
+ ?word
+
+The "N" command repeats the last search the opposite direction. Thus using
+"N" after a "/" command search backwards, using "N" after "?" searches
+forward.
+
+
+IGNORING CASE
+
+Normally you have to type exactly what you want to find. If you don't care
+about upper or lowercase in a word, set the 'ignorecase' option: >
+
+ :set ignorecase
+
+If you now search for "word", it will also match "Word" and "WORD". To match
+case again: >
+
+ :set noignorecase
+
+
+HISTORY
+
+Suppose you do three searches: >
+
+ /one
+ /two
+ /three
+
+Now let's start searching by typing a simple "/" without pressing <Enter>. If
+you press <Up> (the cursor key), Vim puts "/three" on the command line.
+Pressing <Enter> at this point searches for three. If you do not press
+<Enter>, but press <Up> instead, Vim changes the prompt to "/two". Another
+press of <Up> moves you to "/one".
+ You can also use the <Down> cursor key to move through the history of
+search commands in the other direction.
+
+If you know what a previously used pattern starts with, and you want to use it
+again, type that character before pressing <Up>. With the previous example,
+you can type "/o<Up>" and Vim will put "/one" on the command line.
+
+The commands starting with ":" also have a history. That allows you to recall
+a previous command and execute it again. These two histories are separate.
+
+
+SEARCHING FOR A WORD IN THE TEXT
+
+Suppose you see the word "TheLongFunctionName" in the text and you want to
+find the next occurrence of it. You could type "/TheLongFunctionName", but
+that's a lot of typing. And when you make a mistake Vim won't find it.
+ There is an easier way: Position the cursor on the word and use the "*"
+command. Vim will grab the word under the cursor and use it as the search
+string.
+ The "#" command does the same in the other direction. You can prepend a
+count: "3*" searches for the third occurrence of the word under the cursor.
+
+
+SEARCHING FOR WHOLE WORDS
+
+If you type "/the" it will also match "there". To only find words that end
+in "the" use: >
+
+ /the\>
+
+The "\>" item is a special marker that only matches at the end of a word.
+Similarly "\<" only matches at the begin of a word. Thus to search for the
+word "the" only: >
+
+ /\<the\>
+
+This does not match "there" or "soothe". Notice that the "*" and "#" commands
+use these start-of-word and end-of-word markers to only find whole words (you
+can use "g*" and "g#" to match partial words).
+
+
+HIGHLIGHTING MATCHES
+
+While editing a program you see a variable called "nr". You want to check
+where it's used. You could move the cursor to "nr" and use the "*" command
+and press "n" to go along all the matches.
+ There is another way. Type this command: >
+
+ :set hlsearch
+
+If you now search for "nr", Vim will highlight all matches. That is a very
+good way to see where the variable is used, without the need to type commands.
+ To switch this off: >
+
+ :set nohlsearch
+
+Then you need to switch it on again if you want to use it for the next search
+command. If you only want to remove the highlighting, use this command: >
+
+ :nohlsearch
+
+This doesn't reset the option. Instead, it disables the highlighting. As
+soon as you execute a search command, the highlighting will be used again.
+Also for the "n" and "N" commands.
+
+
+TUNING SEARCHES
+
+There are a few options that change how searching works. These are the
+essential ones:
+>
+ :set incsearch
+
+This makes Vim display the match for the string while you are still typing it.
+Use this to check if the right match will be found. Then press <Enter> to
+really jump to that location. Or type more to change the search string.
+>
+ :set nowrapscan
+
+This stops the search at the end of the file. Or, when you are searching
+backwards, at the start of the file. The 'wrapscan' option is on by default,
+thus searching wraps around the end of the file.
+
+
+INTERMEZZO
+
+If you like one of the options mentioned before, and set it each time you use
+Vim, you can put the command in your Vim startup file.
+ Edit the file, as mentioned at |not-compatible|. Or use this command to
+find out where it is: >
+
+ :scriptnames
+
+Edit the file, for example with: >
+
+ :edit ~/.vimrc
+
+Then add a line with the command to set the option, just like you typed it in
+Vim. Example: >
+
+ Go:set hlsearch<Esc>
+
+"G" moves to the end of the file. "o" starts a new line, where you type the
+":set" command. You end insert mode with <Esc>. Then write the file: >
+
+ ZZ
+
+If you now start Vim again, the 'hlsearch' option will already be set.
+
+==============================================================================
+*03.9* Simple search patterns
+
+The Vim editor uses regular expressions to specify what to search for.
+Regular expressions are an extremely powerful and compact way to specify a
+search pattern. Unfortunately, this power comes at a price, because regular
+expressions are a bit tricky to specify.
+ In this section we mention only a few essential ones. More about search
+patterns and commands in chapter 27 |usr_27.txt|. You can find the full
+explanation here: |pattern|.
+
+
+BEGINNING AND END OF A LINE
+
+The ^ character matches the beginning of a line. On an English-US keyboard
+you find it above the 6. The pattern "include" matches the word include
+anywhere on the line. But the pattern "^include" matches the word include
+only if it is at the beginning of a line.
+ The $ character matches the end of a line. Therefore, "was$" matches the
+word was only if it is at the end of a line.
+
+Let's mark the places where "the" matches in this example line with "x"s:
+
+ the solder holding one of the chips melted and the ~
+ xxx xxx xxx
+
+Using "/the$" we find this match:
+
+ the solder holding one of the chips melted and the ~
+ xxx
+
+And with "/^the" we find this one:
+ the solder holding one of the chips melted and the ~
+ xxx
+
+You can try searching with "/^the$", it will only match a single line
+consisting of "the". White space does matter here, thus if a line contains a
+space after the word, like "the ", the pattern will not match.
+
+
+MATCHING ANY SINGLE CHARACTER
+
+The . (dot) character matches any existing character. For example, the
+pattern "c.m" matches a string whose first character is a c, whose second
+character is anything, and whose the third character is m. Example:
+
+ We use a computer that became the cummin winter. ~
+ xxx xxx xxx
+
+
+MATCHING SPECIAL CHARACTERS
+
+If you really want to match a dot, you must avoid its special meaning by
+putting a backslash before it.
+ If you search for "ter.", you will find these matches:
+
+ We use a computer that became the cummin winter. ~
+ xxxx xxxx
+
+Searching for "ter\." only finds the second match.
+
+==============================================================================
+*03.10* Using marks
+
+When you make a jump to a position with the "G" command, Vim remembers the
+position from before this jump. This position is called a mark. To go back
+where you came from, use this command: >
+
+ ``
+
+This ` is a backtick or open single-quote character.
+ If you use the same command a second time you will jump back again. That's
+because the ` command is a jump itself, and the position from before this jump
+is remembered.
+
+Generally, every time you do a command that can move the cursor further than
+within the same line, this is called a jump. This includes the search
+commands "/" and "n" (it doesn't matter how far away the match is). But not
+the character searches with "fx" and "tx" or the word movements "w" and "e".
+ Also, "j" and "k" are not considered to be a jump. Even when you use a
+count to make them move the cursor quite a long way away.
+
+The `` command jumps back and forth, between two points. The CTRL-O command
+jumps to older positions (Hint: O for older). CTRL-I then jumps back to newer
+positions (Hint: I is just next to O on the keyboard). Consider this sequence
+of commands: >
+
+ 33G
+ /^The
+ CTRL-O
+
+You first jump to line 33, then search for a line that starts with "The".
+Then with CTRL-O you jump back to line 33. Another CTRL-O takes you back to
+where you started. If you now use CTRL-I you jump to line 33 again. And
+to the match for "The" with another CTRL-I.
+
+
+ | example text ^ |
+ 33G | example text | CTRL-O | CTRL-I
+ | example text | |
+ V line 33 text ^ V
+ | example text | |
+ /^The | example text | CTRL-O | CTRL-I
+ V There you are | V
+ example text
+
+ Note:
+ CTRL-I is the same as <Tab>.
+
+The ":jumps" command gives a list of positions you jumped to. The entry which
+you used last is marked with a ">".
+
+
+NAMED MARKS
+
+Vim enables you to place your own marks in the text. The command "ma" marks
+the place under the cursor as mark a. You can place 26 marks (a through z) in
+your text. You can't see them, it's just a position that Vim remembers.
+ To go to a mark, use the command `{mark}, where "{mark} is the mark letter.
+Thus to move to the a mark:
+>
+ `a
+
+The command 'mark (single quotation mark, or apostrophe) moves you to the
+beginning of the line containing the mark. This differs from the `mark
+command, which moves you to marked column.
+
+The marks can be very useful when working on two related parts in a file.
+Suppose you have some text near the start of the file you need to look at,
+while working on some text near the end of the file.
+ Move to the text at the start and place the s (start) mark there: >
+
+ ms
+
+The move to the text you want to work on and put the e (end) mark there: >
+
+ me
+
+Now you can move around, and when you want to look at the start of the file,
+you use this to jump there: >
+
+ 's
+
+Then you can use '' to jump back to where you were, or 'e to jump to the text
+you were working on at the end.
+ There is nothing special about using s for start and e for end, they are
+just easy to remember.
+
+You can use this command to get a list of marks: >
+
+ :marks
+
+You will notice a few special marks. These include:
+
+ ' The cursor position before doing a jump
+ " The cursor position when last editing the file
+ [ Start of the last change
+ ] End of the last change
+
+==============================================================================
+
+Next chapter: |usr_04.txt| Making small changes
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt
new file mode 100644
index 000000000..619e27813
--- /dev/null
+++ b/runtime/doc/usr_04.txt
@@ -0,0 +1,514 @@
+*usr_04.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Making small changes
+
+
+This chapter shows you several ways of making corrections and moving text
+around. It teaches you the three basic ways to change text: operator-motion,
+Visual mode and text objects.
+
+|04.1| Operators and motions
+|04.2| Changing text
+|04.3| Repeating a change
+|04.4| Visual mode
+|04.5| Moving text
+|04.6| Copying text
+|04.7| Using the clipboard
+|04.8| Text objects
+|04.9| Replace mode
+|04.10| Conclusion
+
+ Next chapter: |usr_05.txt| Set your settings
+ Previous chapter: |usr_03.txt| Moving around
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*04.1* Operators and motions
+
+In chapter 2 you learned the "x" command to delete a single character. And
+using a count: "4x" deletes four characters.
+ The "dw" command deletes a word. You may recognize the "w" command as the
+move word command. In fact, the "d" command may be followed by any motion
+command, and it deletes from the current location to the place where the
+cursor winds up.
+ The "4w" command, for example, moves the cursor over four words. The d4w
+command deletes four words.
+
+ To err is human. To really foul up you need a computer. ~
+ ------------------>
+ d4w
+
+ To err is human. you need a computer. ~
+
+Vim only deletes up to the position where the motion takes the cursor. That's
+because Vim knows that you probably don't want to delete the first character
+of a word. If you use the "e" command to move to the end of a word, Vim
+guesses that you do want to include that last character:
+
+ To err is human. you need a computer. ~
+ -------->
+ d2e
+
+ To err is human. a computer. ~
+
+Whether the character under the cursor is included depends on the command you
+used to move to that character. The reference manual calls this "exclusive"
+when the character isn't included and "inclusive" when it is.
+
+The "$" command moves to the end of a line. The "d$" command deletes from the
+cursor to the end of the line. This is an inclusive motion, thus the last
+character of the line is included in the delete operation:
+
+ To err is human. a computer. ~
+ ------------>
+ d$
+
+ To err is human ~
+
+There is a pattern here: operator-motion. You first type an operator command.
+For example, "d" is the delete operator. Then you type a motion command like
+"4l" or "w". This way you can operate on any text you can move over.
+
+==============================================================================
+*04.2* Changing text
+
+Another operator is "c", change. It acts just like the "d" operator, except
+it leaves you in Insert mode. For example, "cw" changes a word. Or more
+specifically, it deletes a word and then puts you in Insert mode.
+
+ To err is human ~
+ ------->
+ c2wbe<Esc>
+
+ To be human ~
+
+This "c2wbe<Esc>" contains these bits:
+
+ c the change operator
+ 2w move two words (they are deleted and Insert mode started)
+ be insert this text
+ <Esc> back to Normal mode
+
+If you have paid attention, you will have noticed something strange: The space
+before "human" isn't deleted. There is a saying that for every problem there
+is an answer that is simple, clear, and wrong. That is the case with the
+example used here for the "cw" command. The c operator works just like the
+d operator, with one exception: "cw". It actually works like "ce", change to
+end of word. Thus the space after the word isn't included. This is an
+exception that dates back to the old Vi. Since many people are used to it
+now, the inconsistency has remained in Vim.
+
+
+MORE CHANGES
+
+Like "dd" deletes a whole line, "cc" changes a whole line. It keeps the
+existing indent (leading white space) though.
+
+Just like "d$" deletes until the end of the line, "c$" changes until the end
+of the line. It's like doing "d$" to delete the text and then "a" to start
+Insert mode and append new text.
+
+
+SHORTCUTS
+
+Some operator-motion commands are used so often that they have been given a
+single letter command:
+
+ x stands for dl (delete character under the cursor)
+ X stands for dh (delete character left of the cursor)
+ D stands for d$ (delete to end of the line)
+ C stands for c$ (change to end of the line)
+ s stands for cl (change one character)
+ S stands for cc (change a whole line)
+
+
+WHERE TO PUT THE COUNT
+
+The commands "3dw" and "d3w" delete three words. If you want to get really
+picky about things, the first command, "3dw", deletes one word three times;
+the command "d3w" deletes three words once. This is a difference without a
+distinction. You can actually put in two counts, however. For example,
+"3d2w" deletes two words, repeated three times, for a total of six words.
+
+
+REPLACING WITH ONE CHARACTER
+
+The "r" command is not an operator. It waits for you to type a character, and
+will replace the character under the cursor with it. You could do the same
+with "cl" or with the "s" command, but with "r" you don't have to press <Esc>
+
+ there is somerhing grong here ~
+ rT rt rw
+
+ There is something wrong here ~
+
+Using a count with "r" causes that many characters to be replaced with the
+same character. Example:
+
+ There is something wrong here ~
+ 5rx
+
+ There is something xxxxx here ~
+
+To replace a character with a line break use "r<Enter>". This deletes one
+character and inserts a line break. Using a count here only applies to the
+number of characters deleted: "4r<Enter>" replaces four characters with one
+line break.
+
+==============================================================================
+*04.3* Repeating a change
+
+The "." command is one of the most simple yet powerful commands in Vim. It
+repeats the last change. For instance, suppose you are editing an HTML file
+and want to delete all the <B> tags. You position the cursor on the first <
+and delete the <B> with the command "df>". You then go to the < of the next
+</B> and kill it using the "." command. The "." command executes the last
+change command (in this case, "df>"). To delete another tag, position the
+cursor on the < and use the "." command.
+
+ To <B>generate</B> a table of <B>contents ~
+ f< find first < --->
+ df> delete to > -->
+ f< find next < --------->
+ . repeat df> --->
+ f< find next < ------------->
+ . repeat df> -->
+
+The "." command works for all changes you make, except for the "u" (undo),
+CTRL-R (redo) and commands that start with a colon (:).
+
+Another example: You want to change the word "four" to "five". It appears
+several times in your text. You can do this quickly with this sequence of
+commands:
+
+ /four<Enter> find the first string "four"
+ cwfive<Esc> change the word to "five"
+ n find the next "four"
+ . repeat the change to "five'
+ n find the next "four"
+ . repeat the change
+ etc.
+
+==============================================================================
+*04.4* Visual mode
+
+To delete simple items the operator-motion changes work quite well. But often
+it's not so easy to decide which command will move over the text you want to
+change. Then you can use Visual mode.
+
+You start Visual mode by pressing "v". You move the cursor over the text you
+want to work on. While you do this, the text is highlighted. Finally type
+the operator command.
+ For example, to delete from halfway one word to halfway another word:
+
+ This is an examination sample of visual mode ~
+ ---------->
+ velllld
+
+ This is an example of visual mode ~
+
+When doing this you don't really have to count how many times you have to
+press "l" to end up in the right position. You can immediately see what text
+will be deleted when you press "d".
+
+If at any time you decide you don't want to do anything with the highlighted
+text, just press <Esc> and Visual mode will stop without doing anything.
+
+
+SELECTING LINES
+
+If you want to work on whole lines, use "V" to start Visual mode. You will
+see right away that the whole line is highlighted, without moving around.
+When you move left or right nothing changes. When you move up or down the
+selection is extended whole lines at a time.
+ For example, select three lines with "Vjj":
+
+ +------------------------+
+ | text more text |
+ >> | more text more text | |
+ selected lines >> | text text text | | Vjj
+ >> | text more | V
+ | more text more |
+ +------------------------+
+
+
+SELECTING BLOCKS
+
+If you want to work on a rectangular block of characters, use CTRL-V to start
+Visual mode. This is very useful when working on tables.
+
+ name Q1 Q2 Q3
+ pierre 123 455 234
+ john 0 90 39
+ steve 392 63 334
+
+To delete the middle "Q2" column, move the cursor to the "Q" of "Q2". Press
+CTRL-V to start blockwise Visual mode. Now move the cursor three lines down
+with "3j" and to the next word with "w". You can see the first character of
+the last column is included. To exclude it, use "h". Now press "d" and the
+middle column is gone.
+
+
+GOING TO THE OTHER SIDE
+
+If you have selected some text in Visual mode, and discover that you need to
+change the other end of the selection, use the "o" command (Hint: o for other
+end). The cursor will go to the other end, and you can move the cursor to
+change where the selection starts. Pressing "o" again brings you back to the
+other end.
+
+When using blockwise selection, you have four corners. "o" only takes you to
+one of the other corners, diagonally. Use "O" to move to the other corner in
+the same line.
+
+Note that "o" and "O" in Visual mode work very different from Normal mode,
+where they open a new line below or above the cursor.
+
+==============================================================================
+*04.5* Moving text
+
+When you delete something with the "d", "x", or another command, the text is
+saved. You can paste it back by using the p command. (The Vim name for
+this is put).
+ Take a look at how this works. First you will delete an entire line, by
+putting the cursor on the line you want to delete and typing "dd". Now you
+move the cursor to where you want to put the line and use the "p" (put)
+command. The line is inserted on the line below the cursor.
+
+ a line a line a line
+ line 2 dd line 3 p line 3
+ line 3 line 2
+
+Because you deleted an entire line, the "p" command placed the text line below
+the cursor. If you delete part of a line (a word, for instance), the "p"
+command puts it just after the cursor.
+
+ Some more boring try text to out commands. ~
+ ---->
+ dw
+
+ Some more boring text to out commands. ~
+ ------->
+ welp
+
+ Some more boring text to try out commands. ~
+
+
+MORE ON PUTTING
+
+The "P" command puts text like "p", but before the cursor. When you deleted a
+whole line with "dd", "P" will put it back above the cursor. When you deleted
+a word with "dw", "P" will put it back just before the cursor.
+
+You can repeat putting as many times as you like. The same text will be used.
+
+You can use a count with "p" and "P". The text will be repeated as many times
+as specified with the count. Thus "dd" and then "3p" puts three copies of the
+same deleted line.
+
+
+SWAPPING TWO CHARACTERS
+
+Frequently when you are typing, your fingers get ahead of your brain (or the
+other way around?). The result is a typo such as "teh" for "the". Vim
+makes it easy to correct such problems. Just put the cursor on the e of "teh"
+and execute the command "xp". This works as follows: "x" deletes the
+character e and places it in a register. "p" puts the text after the cursor,
+which is after the h.
+
+ teh th the ~
+ x p
+
+==============================================================================
+*04.6* Copying text
+
+To copy text from one place to another, you could delete it, use "u" to undo
+the deletion and then "p" to put it somewhere else. There is an easier way:
+yanking. The "y" operator copies text into a register. Then a "p" command
+can be used to put it.
+ Yanking is just a Vim name for copying. The "c" letter was already used
+for the change operator, and "y" was still available. Calling this
+operator "yank" made it easier to remember to use the "y" key.
+
+Since "y" is an operator, you use "yw" to yank a word. A count is possible as
+usual. To yank two words use "y2w". Example:
+
+ let sqr = LongVariable * ~
+ -------------->
+ y2w
+
+ let sqr = LongVariable * ~
+ p
+
+ let sqr = LongVariable * LongVariable ~
+
+Notice that "yw" includes the white space after a word. If you don't want
+this, use "ye".
+
+The "yy" command yanks a whole line, just like "dd" deletes a whole line.
+Unexpectedly, while "D" deletes from the cursor to the end of the line, "Y"
+works like "yy", it yanks the whole line. Watch out for this inconsistency!
+Use "y$" to yank to the end of the line.
+
+ a text line yy a text line a text line
+ line 2 line 2 p line 2
+ last line last line a text line
+ last line
+
+==============================================================================
+*04.7* Using the clipboard
+
+If you are using the GUI version of Vim (gvim), you can find the "Copy" item
+in the "Edit" menu. First select some text with Visual mode, then use the
+Edit/Copy menu. The selected text is now copied to the clipboard. You can
+paste the text in other programs. In Vim itself too.
+
+If you have copied text to the clipboard in another application, you can paste
+it in Vim with the Edit/Paste menu. This works in Normal mode and Insert
+mode. In Visual mode the selected text is replaced with the pasted text.
+
+The "Cut" menu item deletes the text before it's put on the clipboard. The
+"Copy", "Cut" and "Paste" items are also available in the popup menu (only
+when there is a popup menu, of course). If your Vim has a toolbar, you can
+also find these items there.
+
+If you are not using the GUI, or if you don't like using a menu, you have to
+use another way. You use the normal "y" (yank) and "p" (put) commands, but
+prepend "* (double-quote star) before it. To copy a line to the clipboard: >
+
+ "*yy
+
+To put text from the clipboard back into the text: >
+
+ "*p
+
+This only works on versions of Vim that include clipboard support. More about
+the clipboard in section |09.3| and here: |clipboard|.
+
+==============================================================================
+*04.8* Text objects
+
+If the cursor is in the middle of a word and want to delete that word, you
+need to move back to its start before you can do "dw". There is a simpler way
+to do this: "daw".
+
+ this is some example text. ~
+ daw
+
+ this is some text. ~
+
+The "d" of "daw" is the delete operator. "aw" is a text object. Hint: "aw"
+stands for "A Word". Thus "daw" is "Delete A Word". To be precise, the white
+space after the word is also deleted (the white space before the word at the
+end of the line).
+
+Using text objects is the third way to make changes in Vim. We already had
+operator-motion and Visual mode. Now we add operator-text object.
+ It is very similar to operator-motion, but instead of operating on the text
+between the cursor position before and after a movement command, the text
+object is used as a whole. It doesn't matter where in the object the cursor
+was.
+
+To change a whole sentence use "cis". Take this text:
+
+ Hello there. This ~
+ is an example. Just ~
+ some text. ~
+
+Move to the start of the second line, on "is an". Now use "cis":
+
+ Hello there. Just ~
+ some text. ~
+
+The cursor is in between the blanks in the first line. Now you type the new
+sentence "Another line.":
+
+ Hello there. Another line. Just ~
+ some text. ~
+
+"cis" consists of the "c" (change) operator and the "is" text object. This
+stands for "Inner Sentence". There is also the "as" (a sentence) object. The
+difference is that "as" includes the white space after the sentence and "is"
+doesn't. If you would delete a sentence, you want to delete the white space
+at the same time, thus use "das". If you want to type new text the white
+space can remain, thus you use "cis".
+
+You can also use text objects in Visual mode. It will include the text object
+in the Visual selection. Visual mode continues, thus you can do this several
+times. For example, start Visual mode with "v" and select a sentence with
+"as". Now you can repeat "as" to include more sentences. Finally you use an
+operator to do something with the selected sentences.
+
+You can find a long list of text objects here: |text-objects|.
+
+==============================================================================
+*04.9* Replace mode
+
+The "R" command causes Vim to enter replace mode. In this mode, each
+character you type replaces the one under the cursor. This continues until
+you type <Esc>.
+ In this example you start Replace mode on the first "t" of "text":
+
+ This is text. ~
+ Rinteresting.<Esc>
+
+ This is interesting. ~
+
+You may have noticed that this command replaced 5 characters in the line with
+twelve others. The "R" command automatically extends the line if it runs out
+of characters to replace. It will not continue on the next line.
+
+You can switch between Insert mode and Replace mode with the <Insert> key.
+
+When you use <BS> (backspace) to make correction, you will notice that the
+old text is put back. Thus it works like an undo command for the last typed
+character.
+
+==============================================================================
+*04.10* Conclusion
+
+The operators, movement commands and text objects give you the possibility to
+make lots of combinations. Now that you know how it works, you can use N
+operators with M movement commands to make N * M commands!
+
+You can find a list of operators here: |operator|
+
+For example, there are many other ways to delete pieces of text. Here are a
+few often used ones:
+
+x delete character under the cursor (short for "dl")
+X delete character before the cursor (short for "dh")
+D delete from cursor to end of line (short for "d$")
+dw delete from cursor to next start of word
+db delete from cursor to previous start of word
+diw delete word under the cursor (excluding white space)
+daw delete word under the cursor (including white space)
+dG delete until the end of the file
+dgg delete until the start of the file
+
+If you use "c" instead of "d" they become change commands. And with "y" you
+yank the text. And so forth.
+
+
+There are a few often used commands to make changes that didn't fit somewhere
+else:
+
+ ~ change case of the character under the cursor, and move the
+ cursor to the next character. This is not an operator (unless
+ 'tildeop' is set), thus you can't use it with a motion
+ command. It does works in Visual mode and changes case for
+ all the selected text then.
+
+ I Start Insert mode after moving the cursor to the first
+ non-blank in the line.
+
+ A Start Insert mode after moving the cursor to the end of the
+ line.
+
+==============================================================================
+
+Next chapter: |usr_05.txt| Set your settings
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
new file mode 100644
index 000000000..ee9eba43a
--- /dev/null
+++ b/runtime/doc/usr_05.txt
@@ -0,0 +1,616 @@
+*usr_05.txt* For Vim version 7.0aa. Last change: 2004 Mar 12
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Set your settings
+
+
+Vim can be tuned to work like you want it to. This chapter shows you how to
+make Vim start with options set to different values. Add plugins to extend
+Vims capabilities. Or define your own macros.
+
+|05.1| The vimrc file
+|05.2| The example vimrc file explained
+|05.3| Simple mappings
+|05.4| Adding a plugin
+|05.5| Adding a help file
+|05.6| The option window
+|05.7| Often used options
+
+ Next chapter: |usr_06.txt| Using syntax highlighting
+ Previous chapter: |usr_04.txt| Making small changes
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*05.1* The vimrc file *vimrc-intro*
+
+You probably got tired of typing commands that you use very often. To start
+with all your favorite option settings and mappings, you write them in what is
+called the vimrc file. Vim reads this file when it starts up.
+
+If you have trouble finding your vimrc file, use this command: >
+
+ :scriptnames
+
+One of the first files in the list should be called ".vimrc" or "_vimrc" and
+is located in your home directory.
+ If you don't have a vimrc file yet, see |vimrc| to find out where you can
+create a vimrc file. Also, the ":version" command mentions the name of the
+"user vimrc file" Vim looks for.
+
+For Unix this file is always used: >
+
+ ~/.vimrc
+
+For MS-DOS and MS-Windows it is mostly one of these: >
+
+ $HOME/_vimrc
+ $VIM/_vimrc
+
+The vimrc file can contain all the commands that you type after a colon. The
+most simple ones are for setting options. For example, if you want Vim to
+always start with the 'incsearch' option on, add this line you your vimrc
+file: >
+
+ set incsearch
+
+For this new line to take effect you need to exit Vim and start it again.
+Later you will learn how to do this without exiting Vim.
+
+This chapter only explains the most basic items. For more information on how
+to write a Vim script file: |usr_41.txt|.
+
+==============================================================================
+*05.2* The example vimrc file explained *vimrc_example.vim*
+
+In the first chapter was explained how the example vimrc (included in the
+Vim distribution) file can be used to make Vim startup in not-compatible mode
+(see |not-compatible|). The file can be found here:
+
+ $VIMRUNTIME/vimrc_example.vim ~
+
+In this section we will explain the various commands used in this file. This
+will give you hints about how to set up your own preferences. Not everything
+will be explained though. Use the ":help" command to find out more.
+
+>
+ set nocompatible
+
+As mentioned in the first chapter, these manuals explain Vim working in an
+improved way, thus not completely Vi compatible. Setting the 'compatible'
+option off, thus 'nocompatible' takes care of this.
+
+>
+ set backspace=indent,eol,start
+
+This specifies where in Insert mode the <BS> is allowed to delete the
+character in front of the cursor. The three items, separated by commas, tell
+Vim to delete the white space at the start of the line, a line break and the
+character before where Insert mode started.
+>
+
+ set autoindent
+
+This makes Vim use the indent of the previous line for a newly created line.
+Thus there is the same amount of white space before the new line. For example
+when pressing <Enter> in Insert mode, and when using the "o" command to open a
+new line.
+>
+
+ if has("vms")
+ set nobackup
+ else
+ set backup
+ endif
+
+This tells Vim to keep a backup copy of a file when overwriting it. But not
+on the VMS system, since it keeps old versions of files already. The backup
+file will have the same name as the original file with "~" added. See |07.4|
+>
+
+ set history=50
+
+Keep 50 commands and 50 search patterns in the history. Use another number if
+you want to remember fewer or more lines.
+>
+
+ set ruler
+
+Always display the current cursor position in the lower right corner of the
+Vim window.
+
+>
+ set showcmd
+
+Display an incomplete command in the lower right corner of the Vim window,
+left of the ruler. For example, when you type "2f", Vim is waiting for you to
+type the character to find and "2f" is displayed. When you press "w" next,
+the "2fw" command is executed and the displayed "2f" is removed.
+
+ +-------------------------------------------------+
+ |text in the Vim window |
+ |~ |
+ |~ |
+ |-- VISUAL -- 2f 43,8 17% |
+ +-------------------------------------------------+
+ ^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^
+ 'showmode' 'showcmd' 'ruler'
+
+>
+ set incsearch
+
+Display the match for a search pattern when halfway typing it.
+
+>
+ map Q gq
+
+This defines a key mapping. More about that in the next section. This
+defines the "Q" command to do formatting with the "gq" operator. This is how
+it worked before Vim 5.0. Otherwise the "Q" command starts Ex mode, but you
+will not need it.
+
+>
+ vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>
+
+This is a complicated mapping. It will not be explained how it works here.
+What it does is to make "p" in Visual mode overwrite the selected text with
+the previously yanked text. You can see that mappings can be used to do quite
+complicated things. Still, it is just a sequence of commands that are
+executed like you typed them.
+
+>
+ if &t_Co > 2 || has("gui_running")
+ syntax on
+ set hlsearch
+ endif
+
+This switches on syntax highlighting, but only if colors are available. And
+the 'hlsearch' option tells Vim to highlight matches with the last used search
+pattern. The "if" command is very useful to set options only when some
+condition is met. More about that in |usr_41.txt|.
+
+ *vimrc-filetype* >
+ filetype plugin indent on
+
+This switches on three very clever mechanisms:
+1. Filetype detection.
+ Whenever you start editing a file, Vim will try to figure out what kind of
+ file this is. When you edit "main.c", Vim will see the ".c" extension and
+ recognize this as a "c" filetype. When you edit a file that starts with
+ "#!/bin/sh", Vim will recognize it as a "sh" filetype.
+ The filetype detection is used for syntax highlighting and the other two
+ items below.
+ See |filetypes|.
+
+2. Using filetype plugin files
+ Many different filetypes are edited with different options. For example,
+ when you edit a "c" file, it's very useful to set the 'cindent' option to
+ automatically indent the lines. These commonly useful option settings are
+ included with Vim in filetype plugins. You can also add your own, see
+ |write-filetype-plugin|.
+
+3. Using indent files
+ When editing programs, the indent of a line can often be computed
+ automatically. Vim comes with these indent rules for a number of
+ filetypes. See |:filetype-indent-on| and 'indentexpr'.
+
+>
+ autocmd FileType text setlocal textwidth=78
+
+This makes Vim break text to avoid lines getting longer than 78 characters.
+But only for files that have been detected to be plain text. There are
+actually two parts here. "autocmd FileType text" is an autocommand. This
+defines that when the file type is set to "text" the following command is
+automatically executed. "setlocal textwidth=78" sets the 'textwidth' option
+to 78, but only locally in one file.
+>
+
+ autocmd BufReadPost *
+ \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ exe "normal g`\"" |
+ \ endif
+
+Another autocommand. This time it is used after reading any file. The
+complicated stuff after it checks if the '" mark is defined, and jumps to it
+if so. The backslash at the start of a line is used to continue the command
+from the previous line. That avoids a line getting very long.
+See |line-continuation|. This only works in a Vim script file, not when
+typing commands at the command-line.
+
+==============================================================================
+*05.3* Simple mappings
+
+A mapping enables you to bind a set of Vim commands to a single key. Suppose,
+for example, that you need to surround certain words with curly braces. In
+other words, you need to change a word such as "amount" into "{amount}". With
+the :map command, you can tell Vim that the F5 key does this job. The command
+is as follows: >
+
+ :map <F5> i{<Esc>ea}<Esc>
+<
+ Note:
+ When entering this command, you must enter <F5> by typing four
+ characters. Similarly, <Esc> is not entered by pressing the <Esc>
+ key, but by typing five characters. Watch out for this difference
+ when reading the manual!
+
+Let's break this down:
+ <F5> The F5 function key. This is the trigger key that causes the
+ command to be executed as the key is pressed.
+
+ i{<Esc> Insert the { character. The <Esc> key ends Insert mode.
+
+ e Move to the end of the word.
+
+ a}<Esc> Append the } to the word.
+
+After you execute the ":map" command, all you have to do to put {} around a
+word is to put the cursor on the first character and press F5.
+
+In this example, the trigger is a single key; it can be any string. But when
+you use an existing Vim command, that command will no longer be available.
+You better avoid that.
+ One key that can be used with mappings is the backslash. Since you
+probably want to define more than one mapping, add another character. You
+could map "\p" to add parens around a word, and "\c" to add curly braces, for
+example: >
+
+ :map \p i(<Esc>ea)<Esc>
+ :map \c i{<Esc>ea}<Esc>
+
+You need to type the \ and the p quickly after another, so that Vim knows they
+belong together.
+
+The ":map" command (with no arguments) lists your current mappings. At
+least the ones for Normal mode. More about mappings in section |40.1|.
+
+==============================================================================
+*05.4* Adding a plugin *add-plugin* *plugin*
+
+Vim's functionality can be extended by adding plugins. A plugin is nothing
+more than a Vim script file that is loaded automatically when Vim starts. You
+can add a plugin very easily by dropping it in your plugin directory.
+{not available when Vim was compiled without the |+eval| feature}
+
+There are two types of plugins:
+
+ global plugin: Used for all kinds of files
+ filetype plugin: Only used for a specific type of file
+
+The global plugins will be discussed first, then the filetype ones
+|add-filetype-plugin|.
+
+
+GLOBAL PLUGINS *standard-plugin*
+
+When you start Vim, it will automatically load a number of global plugins.
+You don't have to do anything for this. They add functionality that most
+people will want to use, but which was implemented as a Vim script instead of
+being compiled into Vim. You can find them listed in the help index
+|standard-plugin-list|. Also see |load-plugins|.
+
+ *add-global-plugin*
+You can add a global plugin to add functionality that will always be present
+when you use Vim. There are only two steps for adding a global plugin:
+1. Get a copy of the plugin.
+2. Drop it in the right directory.
+
+
+GETTING A GLOBAL PLUGIN
+
+Where can you find plugins?
+- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
+ and its sub-directories.
+- Download from the net, check out http://vim.sf.net.
+- They are sometimes posted in a Vim |maillist|.
+- You could write one yourself, see |write-plugin|.
+
+
+USING A GLOBAL PLUGIN
+
+First read the text in the plugin itself to check for any special conditions.
+Then copy the file to your plugin directory:
+
+ system plugin directory ~
+ Unix ~/.vim/plugin/
+ PC and OS/2 $HOME/vimfiles/plugin or $VIM/vimfiles/plugin
+ Amiga s:vimfiles/plugin
+ Macintosh $VIM:vimfiles:plugin
+ Mac OS X ~/.vim/plugin/
+ RISC-OS Choices:vimfiles.plugin
+
+Example for Unix (assuming you didn't have a plugin directory yet): >
+
+ mkdir ~/.vim
+ mkdir ~/.vim/plugin
+ cp /usr/local/share/vim/vim60/macros/justify.vim ~/.vim/plugin
+
+That's all! Now you can use the commands defined in this plugin to justify
+text.
+
+
+FILETYPE PLUGINS *add-filetype-plugin* *ftplugins*
+
+The Vim distribution comes with a set of plugins for different filetypes that
+you can start using with this command: >
+
+ :filetype plugin on
+
+That's all! See |vimrc-filetype|.
+
+If you are missing a plugin for a filetype you are using, or you found a
+better one, you can add it. There are two steps for adding a filetype plugin:
+1. Get a copy of the plugin.
+2. Drop it in the right directory.
+
+
+GETTING A FILETYPE PLUGIN
+
+You can find them in the same places as the global plugins. Watch out if the
+type of file is mentioned, then you know if the plugin is a global or a
+filetype one. The scripts in $VIMRUNTIME/macros are global ones, the filetype
+plugins are in $VIMRUNTIME/ftplugin.
+
+
+USING A FILETYPE PLUGIN *ftplugin-name*
+
+You can add a filetype plugin by dropping it in the right directory. The
+name of this directory is in the same directory mentioned above for global
+plugins, but the last part is "ftplugin". Suppose you have found a plugin for
+the "stuff" filetype, and you are on Unix. Then you can move this file to the
+ftplugin directory: >
+
+ mv thefile ~/.vim/ftplugin/stuff.vim
+
+If that file already exists you already have a plugin for "stuff". You might
+want to check if the existing plugin doesn't conflict with the one you are
+adding. If it's OK, you can give the new one another name: >
+
+ mv thefile ~/.vim/ftplugin/stuff_too.vim
+
+The underscore is used to separate the name of the filetype from the rest,
+which can be anything. If you would use "otherstuff.vim" it wouldn't work, it
+would be loaded for the "otherstuff" filetype.
+
+On MS-DOS you cannot use long filenames. You would run into trouble if you
+add a second plugin and the filetype has more than six characters. You can
+use an extra directory to get around this: >
+
+ mkdir $VIM/vimfiles/ftplugin/fortran
+ copy thefile $VIM/vimfiles/ftplugin/fortran/too.vim
+
+The generic names for the filetype plugins are: >
+
+ ftplugin/<filetype>.vim
+ ftplugin/<filetype>_<name>.vim
+ ftplugin/<filetype>/<name>.vim
+
+Here "<name>" can be any name that you prefer.
+Examples for the "stuff" filetype on Unix: >
+
+ ~/.vim/ftplugin/stuff.vim
+ ~/.vim/ftplugin/stuff_def.vim
+ ~/.vim/ftplugin/stuff/header.vim
+
+The <filetype> part is the name of the filetype the plugin is to be used for.
+Only files of this filetype will use the settings from the plugin. The <name>
+part of the plugin file doesn't matter, you can use it to have several plugins
+for the same filetype. Note that it must end in ".vim".
+
+
+Further reading:
+|filetype-plugins| Documentation for the filetype plugins and information
+ about how to avoid that mappings cause problems.
+|load-plugins| When the global plugins are loaded during startup.
+|ftplugin-overrule| Overruling the settings from a global plugin.
+|write-plugin| How to write a plugin script.
+|plugin-details| For more information about using plugins or when your
+ plugin doesn't work.
+|new-filetype| How to detect a new file type.
+
+==============================================================================
+*05.5* Adding a help file *add-local-help* *matchit-install*
+
+If you are lucky, the plugin you installed also comes with a help file. We
+will explain how to install the help file, so that you can easily find help
+for your new plugin.
+ Let us use the "matchit.vim" plugin as an example (it is included with
+Vim). This plugin makes the "%" command jump to matching HTML tags,
+if/else/endif in Vim scripts, etc. Very useful, although it's not backwards
+compatible (that's why it is not enabled by default).
+ This plugin comes with documentation: "matchit.txt". Let's first copy the
+plugin to the right directory. This time we will do it from inside Vim, so
+that we can use $VIMRUNTIME. (You may skip some of the "mkdir" commands if
+you already have the directory.) >
+
+ :!mkdir ~/.vim
+ :!mkdir ~/.vim/plugin
+ :!cp $VIMRUNTIME/macros/matchit.vim ~/.vim/plugin
+
+Now create a "doc" directory in one of the directories in 'runtimepath'. >
+
+ :!mkdir ~/.vim/doc
+
+Copy the help file to the "doc" directory. >
+
+ :!cp $VIMRUNTIME/macros/matchit.txt ~/.vim/doc
+
+Now comes the trick, which allows you to jump to the subjects in the new help
+file: Generate the local tags file with the |:helptags| command. >
+
+ :helptags ~/.vim/doc
+
+Now you can use the >
+
+ :help g%
+
+command to find help for "g%" in the help file you just added. You can see an
+entry for the local help file when you do: >
+
+ :help local-additions
+
+The title lines from the local help files are automagically added to this
+section. There you can see which local help files have been added and jump to
+them through the tag.
+
+For writing a local help file, see |write-local-help|.
+
+==============================================================================
+*05.6* The option window
+
+If you are looking for an option that does what you want, you can search in
+the help files here: |options|. Another way is by using this command: >
+
+ :options
+
+This opens a new window, with a list of options with a one-line explanation.
+The options are grouped by subject. Move the cursor to a subject and press
+<Enter> to jump there. Press <Enter> again to jump back. Or use CTRL-O.
+
+You can change the value of an option. For example, move to the "displaying
+text" subject. Then move the cursor down to this line:
+
+ set wrap nowrap ~
+
+When you hit <Enter>, the line will change to:
+
+ set nowrap wrap ~
+
+The option has now been switched off.
+
+Just above this line is a short description of the 'wrap' option. Move the
+cursor one line up to place it in this line. Now hit <Enter> and you jump to
+the full help on the 'wrap' option.
+
+For options that take a number or string argument you can edit the value.
+Then press <Enter> to apply the new value. For example, move the cursor a few
+lines up to this line:
+
+ set so=0 ~
+
+Position the cursor on the zero with "$". Change it into a five with "r5".
+Then press <Enter> to apply the new value. When you now move the cursor
+around you will notice that the text starts scrolling before you reach the
+border. This is what the 'scrolloff' option does, it specifies an offset
+from the window border where scrolling starts.
+
+==============================================================================
+*05.7* Often used options
+
+There are an awful lot of options. Most of them you will hardly ever use.
+Some of the more useful ones will be mentioned here. Don't forget you can
+find more help on these options with the ":help" command, with single quotes
+before and after the option name. For example: >
+
+ :help 'wrap'
+
+In case you have messed up an option value, you can set it back to the
+default by putting a ampersand (&) after the option name. Example: >
+
+ :set iskeyword&
+
+
+NOT WRAPPING LINES
+
+Vim normally wraps long lines, so that you can see all of the text. Sometimes
+it's better to let the text continue right of the window. Then you need to
+scroll the text left-right to see all of a long line. Switch wrapping of with
+this command: >
+
+ :set nowrap
+
+Vim will automatically scroll the text when you move to text that is not
+displayed. To see a context of ten characters, do this: >
+
+ :set sidescroll=10
+
+This doesn't change the text in the file, only the way it is displayed.
+
+
+WRAPPING MOVEMENT COMMANDS
+
+Most commands for moving around will stop moving at the start and end of a
+line. You can change that with the 'whichwrap' option. This sets it to the
+default value: >
+
+ :set whichwrap=b,s
+
+This allows the <BS> key, when used in the first position of a line, to move
+the cursor to the end of the previous line. And the <Space> key moves from
+the end of a line to the start of the next one.
+
+To allow the cursor keys <Left> and <Right> to also wrap, use this command: >
+
+ :set whichwrap=b,s,<,>
+
+This is still only for Normal mode. To let <Left> and <Right> do this in
+Insert mode as well: >
+
+ :set whichwrap=b,s,<,>,[,]
+
+There are a few other flags that can be added, see 'whichwrap'.
+
+
+VIEWING TABS
+
+When there are tabs in a file, you cannot see where they are. To make them
+visible: >
+
+ :set list
+
+Now every Tab is displayed as ^I. And a $ is displayed at the end of each
+line, so that you can spot trailing spaces that would otherwise go unnoticed.
+ A disadvantage is that this looks ugly when there are many Tabs in a file.
+If you have a color terminal, or are using the GUI, Vim can show the spaces
+and tabs as highlighted characters. Use the 'listchars' option: >
+
+ :set listchars=tab:>-,trail:-
+
+Now every tab will be displayed as ">---" (with more or less "-") and trailing
+white space as "-". Looks a lot better, doesn't it?
+
+
+KEYWORDS
+
+The 'iskeyword' option specifies which characters can appear in a word: >
+
+ :set iskeyword
+< iskeyword=@,48-57,_,192-255 ~
+
+The "@" stands for all alphabetic letters. "48-57" stands for ASCII
+characters 48 to 57, which are the numbers 0 to 9. "192-255" are the
+printable latin characters.
+ Sometimes you will want to include a dash in keywords, so that commands
+like "w" consider "upper-case" to be one word. You can do it like this: >
+
+ :set iskeyword+=-
+ :set iskeyword
+< iskeyword=@,48-57,_,192-255,- ~
+
+If you look at the new value, you will see that Vim has added a comma for you.
+ To remove a character use "-=". For example, to remove the underscore: >
+
+ :set iskeyword-=_
+ :set iskeyword
+< iskeyword=@,48-57,192-255,- ~
+
+This time a comma is automatically deleted.
+
+
+ROOM FOR MESSAGES
+
+When Vim starts there is one line at the bottom that is used for messages.
+When a message is long, it is either truncated, thus you can only see part of
+it, or the text scrolls and you have to press <Enter> to continue.
+ You can set the 'cmdheight' option to the number of lines used for
+messages. Example: >
+
+ :set cmdheight=3
+
+This does mean there is less room to edit text, thus it's a compromise.
+
+==============================================================================
+
+Next chapter: |usr_06.txt| Using syntax highlighting
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt
new file mode 100644
index 000000000..4731762d7
--- /dev/null
+++ b/runtime/doc/usr_06.txt
@@ -0,0 +1,277 @@
+*usr_06.txt* For Vim version 7.0aa. Last change: 2002 Jul 14
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Using syntax highlighting
+
+
+Black and white text is boring. With colors your file comes to life. This
+not only looks nice, it also speeds up your work. Change the colors used for
+the different sorts of text. Print your text, with the colors you see on the
+screen.
+
+|06.1| Switching it on
+|06.2| No or wrong colors?
+|06.3| Different colors
+|06.4| With colors or without colors
+|06.5| Printing with colors
+|06.6| Further reading
+
+ Next chapter: |usr_07.txt| Editing more than one file
+ Previous chapter: |usr_05.txt| Set your settings
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*06.1* Switching it on
+
+It all starts with one simple command: >
+
+ :syntax enable
+
+That should work in most situations to get color in your files. Vim will
+automagically detect the type of file and load the right syntax highlighting.
+Suddenly comments are blue, keywords brown and strings red. This makes it
+easy to overview the file. After a while you will find that black&white text
+slows you down!
+
+If you always want to use syntax highlighting, put the ":syntax enable"
+command in your |vimrc| file.
+
+If you want syntax highlighting only when the terminal supports colors, you
+can put this in your |vimrc| file: >
+
+ if &t_Co > 1
+ syntax enable
+ endif
+
+If you want syntax highlighting only in the GUI version, put the ":syntax
+enable" command in your |gvimrc| file.
+
+==============================================================================
+*06.2* No or wrong colors?
+
+There can be a number of reasons why you don't see colors:
+
+- Your terminal does not support colors.
+ Vim will use bold, italic and underlined text, but this doesn't look
+ very nice. You probably will want to try to get a terminal with
+ colors. For Unix, I recommend the xterm from the XFree86 project:
+ |xfree-xterm|.
+
+- Your terminal does support colors, but Vim doesn't know this.
+ Make sure your $TERM setting is correct. For example, when using an
+ xterm that supports colors: >
+
+ setenv TERM xterm-color
+<
+ or (depending on your shell): >
+
+ TERM=xterm-color; export TERM
+
+< The terminal name must match the terminal you are using. If it
+ still doesn't work, have a look at |xterm-color|, which shows a few
+ ways to make Vim display colors (not only for an xterm).
+
+- The file type is not recognized.
+ Vim doesn't know all file types, and sometimes it's near to impossible
+ to tell what language a file uses. Try this command: >
+
+ :set filetype
+<
+ If the result is "filetype=" then the problem is indeed that Vim
+ doesn't know what type of file this is. You can set the type
+ manually: >
+
+ :set filetype=fortran
+
+< To see which types are available, look in the directory
+ $VIMRUNTIME/syntax. For the GUI you can use the Syntax menu.
+ Setting the filetype can also be done with a |modeline|, so that the
+ file will be highlighted each time you edit it. For example, this
+ line can be used in a Makefile (put it near the start or end of the
+ file): >
+
+ # vim: syntax=make
+
+< You might know how to detect the file type yourself. Often the file
+ name extension (after the dot) can be used.
+ See |new-filetype| for how to tell Vim to detect that file type.
+
+- There is no highlighting for your file type.
+ You could try using a similar file type by manually setting it as
+ mentioned above. If that isn't good enough, you can write your own
+ syntax file, see |mysyntaxfile|.
+
+
+Or the colors could be wrong:
+
+- The colored text is very hard to read.
+ Vim guesses the background color that you are using. If it is black
+ (or another dark color) it will use light colors for text. If it is
+ white (or another light color) it will use dark colors for text. If
+ Vim guessed wrong the text will be hard to read. To solve this, set
+ the 'background' option. For a dark background: >
+
+ :set background=dark
+
+< And for a light background: >
+
+ :set background=light
+
+< Make sure you put this _before_ the ":syntax enable" command,
+ otherwise the colors will already have been set. You could do
+ ":syntax reset" after setting 'background' to make Vim set the default
+ colors again.
+
+- The colors are wrong when scrolling bottom to top.
+ Vim doesn't read the whole file to parse the text. It starts parsing
+ wherever you are viewing the file. That saves a lot of time, but
+ sometimes the colors are wrong. A simple fix is hitting CTRL-L. Or
+ scroll back a bit and then forward again.
+ For a real fix, see |:syn-sync|. Some syntax files have a way to make
+ it look further back, see the help for the specific syntax file. For
+ example, |tex.vim| for the TeX syntax.
+
+==============================================================================
+*06.3* Different colors *:syn-default-override*
+
+If you don't like the default colors, you can select another color scheme. In
+the GUI use the Edit/Color Scheme menu. You can also type the command: >
+
+ :colorscheme evening
+
+"evening" is the name of the color scheme. There are several others you might
+want to try out. Look in the directory $VIMRUNTIME/colors.
+
+When you found the color scheme that you like, add the ":colorscheme" command
+to your |vimrc| file.
+
+You could also write your own color scheme. This is how you do it:
+
+1. Select a color scheme that comes close. Copy this file to your own Vim
+ directory. For Unix, this should work: >
+
+ !mkdir ~/.vim/colors
+ !cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim
+<
+ This is done from Vim, because it knows the value of $VIMRUNTIME.
+
+2. Edit the color scheme file. These entries are useful:
+
+ term attributes in a B&W terminal
+ cterm attributes in a color terminal
+ ctermfg foreground color in a color terminal
+ ctermbg background color in a color terminal
+ gui attributes in the GUI
+ guifg foreground color in the GUI
+ guibg background color in the GUI
+
+ For example, to make comments green: >
+
+ :highlight Comment ctermfg=green guifg=green
+<
+ Attributes you can use for "cterm" and "gui" are "bold" and "underline".
+ If you want both, use "bold,underline". For details see the |:highlight|
+ command.
+
+3. Tell Vim to always use your color scheme. Put this line in your |vimrc|: >
+
+ colorscheme mine
+
+If you want to see what the most often used color combinations look like, use
+these commands: >
+
+ :edit $VIMRUNTIME/syntax/colortest.vim
+ :source %
+
+You will see text in various color combinations. You can check which ones are
+readable and look nice.
+
+==============================================================================
+*06.4* With colors or without colors
+
+Displaying text in color takes a lot of effort. If you find the displaying
+too slow, you might want to disable syntax highlighting for a moment: >
+
+ :syntax clear
+
+When editing another file (or the same one) the colors will come back.
+
+ *:syn-off*
+If you want to stop highlighting completely use: >
+
+ :syntax off
+
+This will completely disable syntax highlighting and remove it immediately for
+all buffers.
+
+ *:syn-manual*
+If you want syntax highlighting only for specific files, use this: >
+
+ :syntax manual
+
+This will enable the syntax highlighting, but not switch it on automatically
+when starting to edit a buffer. To switch highlighting on for the current
+buffer, set the 'syntax' option: >
+
+ :set syntax=ON
+<
+==============================================================================
+*06.5* Printing with colors *syntax-printing*
+
+In the MS-Windows version you can print the current file with this command: >
+
+ :hardcopy
+
+You will get the usual printer dialog, where you can select the printer and a
+few settings. If you have a color printer, the paper output should look the
+same as what you see inside Vim. But when you use a dark background the
+colors will be adjusted to look good on white paper.
+
+There are several options that change the way Vim prints:
+ 'printdevice'
+ 'printheader'
+ 'printfont'
+ 'printoptions'
+
+To print only a range of lines, use Visual mode to select the lines and then
+type the command: >
+
+ v100j:hardcopy
+
+"v" starts Visual mode. "100j" moves a hundred lines down, they will be
+highlighted. Then ":hardcopy" will print those lines. You can use other
+commands to move in Visual mode, of course.
+
+This also works on Unix, if you have a PostScript printer. Otherwise, you
+will have to do a bit more work. You need to convert the text to HTML first,
+and then print it from a web browser such as Netscape.
+
+Convert the current file to HTML with this command: >
+
+ :source $VIMRUNTIME/syntax/2html.vim
+
+You will see it crunching away, this can take quite a while for a large file.
+Some time later another window shows the HTML code. Now write this somewhere
+(doesn't matter where, you throw it away later):
+>
+ :write main.c.html
+
+Open this file in your favorite browser and print it from there. If all goes
+well, the output should look exactly as it does in Vim. See |2html.vim| for
+details. Don't forget to delete the HTML file when you are done with it.
+
+Instead of printing, you could also put the HTML file on a web server, and let
+others look at the colored text.
+
+==============================================================================
+*06.6* Further reading
+
+|usr_44.txt| Your own syntax highlighted.
+|syntax| All the details.
+
+==============================================================================
+
+Next chapter: |usr_07.txt| Editing more than one file
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_07.txt b/runtime/doc/usr_07.txt
new file mode 100644
index 000000000..b41977699
--- /dev/null
+++ b/runtime/doc/usr_07.txt
@@ -0,0 +1,479 @@
+*usr_07.txt* For Vim version 7.0aa. Last change: 2004 Mar 12
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Editing more than one file
+
+
+No matter how many files you have, you can edit them without leaving Vim.
+Define a list of files to work on and jump from one to the other. Copy text
+from one file and put it in another one.
+
+|07.1| Edit another file
+|07.2| A list of files
+|07.3| Jumping from file to file
+|07.4| Backup files
+|07.5| Copy text between files
+|07.6| Viewing a file
+|07.7| Changing the file name
+
+ Next chapter: |usr_08.txt| Splitting windows
+ Previous chapter: |usr_06.txt| Using syntax highlighting
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*07.1* Edit another file
+
+So far you had to start Vim for every file you wanted to edit. There is a
+simpler way. To start editing another file, use this command: >
+
+ :edit foo.txt
+
+You can use any file name instead of "foo.txt". Vim will close the current
+file and open the new one. If the current file has unsaved changes, however,
+Vim displays an error message and does not open the new file:
+
+ E37: No write since last change (use ! to override) ~
+
+ Note:
+ Vim puts an error ID at the start of each error message. If you do
+ not understand the message or what caused it, look in the help system
+ for this ID. In this case: >
+
+ :help E37
+
+At this point, you have a number of alternatives. You can write the file
+using this command: >
+
+ :write
+
+Or you can force Vim to discard your changes and edit the new file, using the
+force (!) character: >
+
+ :edit! foo.txt
+
+If you want to edit another file, but not write the changes in the current
+file yet, you can make it hidden: >
+
+ :hide edit foo.txt
+
+The text with changes is still there, but you can't see it. This is further
+explained in section |22.4|: The buffer list.
+
+==============================================================================
+*07.2* A list of files
+
+You can start Vim to edit a sequence of files. For example: >
+
+ vim one.c two.c three.c
+
+This command starts Vim and tells it that you will be editing three files.
+Vim displays just the first file. After you have done your thing in this
+file, to edit the next file you use this command: >
+
+ :next
+
+If you have unsaved changes in the current file, you will get an error
+message and the ":next" will not work. This is the same problem as with
+":edit" mentioned in the previous section. To abandon the changes: >
+
+ :next!
+
+But mostly you want to save the changes and move on to the next file. There
+is a special command for this: >
+
+ :wnext
+
+This does the same as using two separate commands: >
+
+ :write
+ :next
+
+
+WHERE AM I?
+
+To see which file in the argument list you are editing, look in the window
+title. It should show something like "(2 of 3)". This means you are editing
+the second file out of three files.
+ If you want to see the list of files, use this command: >
+
+ :args
+
+This is short for "arguments". The output might look like this:
+
+ one.c [two.c] three.c ~
+
+These are the files you started Vim with. The one you are currently editing,
+"two.c", is in square brackets.
+
+
+MOVING TO OTHER ARGUMENTS
+
+To go back one file: >
+
+ :previous
+
+This is just like the ":next" command, except that it moves in the other
+direction. Again, there is a shortcut command for when you want to write the
+file first: >
+
+ :wprevious
+
+To move to the very last file in the list: >
+
+ :last
+
+And to move back to the first one again: >
+
+ :first
+
+There is no ":wlast" or ":wfirst" command though!
+
+You can use a count for ":next" and ":previous". To skip two files forward: >
+
+ :2next
+
+
+AUTOMATIC WRITING
+
+When moving around the files and making changes, you have to remember to use
+":write". Otherwise you will get an error message. If you are sure you
+always want to write modified files, you can tell Vim to automatically write
+them: >
+
+ :set autowrite
+
+When you are editing a file which you may not want to write, switch it off
+again: >
+
+ :set noautowrite
+
+
+EDITING ANOTHER LIST OF FILES
+
+You can redefine the list of files without the need to exit Vim and start it
+again. Use this command to edit three other files: >
+
+ :args five.c six.c seven.h
+
+Or use a wildcard, like it's used in the shell: >
+
+ :args *.txt
+
+Vim will take you to the first file in the list. Again, if the current file
+has changes, you can either write the file first, or use ":args!" (with !
+added) to abandon the changes.
+
+
+DID YOU EDIT THE LAST FILE?
+ *arglist-quit*
+When you use a list of files, Vim assumes you want to edit them all. To
+protect you from exiting too early, you will get this error when you didn't
+edit the last file in the list yet:
+
+ E173: 46 more files to edit ~
+
+If you really want to exit, just do it again. Then it will work (but not when
+you did other commands in between).
+
+==============================================================================
+*07.3* Jumping from file to file
+
+To quickly jump between two files, press CTRL-^ (on English-US keyboards the ^
+is above the 6 key). Example: >
+
+ :args one.c two.c three.c
+
+You are now in one.c. >
+
+ :next
+
+Now you are in two.c. Now use CTRL-^ to go back to one.c. Another CTRL-^ and
+you are back in two.c. Another CTRL-^ and you are in one.c again. If you now
+do: >
+
+ :next
+
+You are in three.c. Notice that the CTRL-^ command does not change the idea
+of where you are in the list of files. Only commands like ":next" and
+":previous" do that.
+
+The file you were previously editing is called the "alternate" file. When you
+just started Vim CTRL-^ will not work, since there isn't a previous file.
+
+
+PREDEFINED MARKS
+
+After jumping to another file, you can use two predefined marks which are very
+useful: >
+
+ `"
+
+This takes you to the position where the cursor was when you left the file.
+Another mark that is remembered is the position where you made the last
+change: >
+
+ `.
+
+Suppose you are editing the file "one.txt". Somewhere halfway the file you
+use "x" to delete a character. Then you go to the last line with "G" and
+write the file with ":w". You edit several other files, and then use ":edit
+one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
+line of the file. Using `. takes you to the position where you deleted the
+character. Even when you move around in the file `" and `. will take you to
+the remembered position. At least until you make another change or leave the
+file.
+
+
+FILE MARKS
+
+In chapter 4 was explained how you can place a mark in a file with "mx" and
+jump to that position with "`x". That works within one file. If you edit
+another file and place marks there, these are specific for that file. Thus
+each file has its own set of marks, they are local to the file.
+ So far we were using marks with a lowercase letter. There are also marks
+with an uppercase letter. These are global, they can be used from any file.
+For example suppose that we are editing the file "foo.txt". Go to halfway the
+file ("50%") and place the F mark there (F for foo): >
+
+ 50%mF
+
+Now edit the file "bar.txt" and place the B mark (B for bar) at its last line:
+>
+ GmB
+
+Now you can use the "'F" command to jump back to halfway foo.txt. Or edit yet
+another file, type "'B" and you are at the end of bar.txt again.
+
+The file marks are remembered until they are placed somewhere else. Thus you
+can place the mark, do hours of editing and still be able to jump back to that
+mark.
+ It's often useful to think of a simple connection between the mark letter
+and where it is placed. For example, use the H mark in a header file, M in
+a Makefile and C in a C code file.
+
+To see where a specific mark is, give an argument to the ":marks" command: >
+
+ :marks M
+
+You can also give several arguments: >
+
+ :marks MCP
+
+Don't forget that you can use CTRL-O and CTRL-I to jump to older and newer
+positions without placing marks there.
+
+==============================================================================
+*07.4* Backup files
+
+Usually Vim does not produce a backup file. If you want to have one, all you
+need to do is execute the following command: >
+
+ :set backup
+
+The name of the backup file is the original file with a ~ added to the end.
+If your file is named data.txt, for example, the backup file name is
+data.txt~.
+ If you do not like the fact that the backup files end with ~, you can
+change the extension: >
+
+ :set backupext=.bak
+
+This will use data.txt.bak instead of data.txt~.
+ Another option that matters here is 'backupdir'. It specifies where the
+backup file is written. The default, to write the backup in the same
+directory as the original file, will mostly be the right thing.
+
+ Note:
+ When the 'backup' option isn't set but the 'writebackup' is, Vim will
+ still create a backup file. However, it is deleted as soon as writing
+ the file was completed successfully. This functions as a safety
+ against losing your original file when writing fails in some way (disk
+ full is the most common cause; being hit by lightning might be
+ another, although less common).
+
+
+KEEPING THE ORIGINAL FILE
+
+If you are editing source files, you might want to keep the file before you
+make any changes. But the backup file will be overwritten each time you write
+the file. Thus it only contains the previous version, not the first one.
+ To make Vim keep the original file, set the 'patchmode' option. This
+specifies the extension used for the first backup of a changed file. Usually
+you would do this: >
+
+ :set patchmode=.orig
+
+When you now edit the file data.txt for the first time, make changes and write
+the file, Vim will keep a copy of the unchanged file under the name
+"data.txt.orig".
+ If you make further changes to the file, Vim will notice that
+"data.txt.orig" already exists and leave it alone. Further backup files will
+then be called "data.txt~" (or whatever you specified with 'backupext').
+ If you leave 'patchmode' empty (that is the default), the original file
+will not be kept.
+
+==============================================================================
+*07.5* Copy text between files
+
+This explains how to copy text from one file to another. Let's start with a
+simple example. Edit the file that contains the text you want to copy. Move
+the cursor to the start of the text and press "v". This starts Visual mode.
+Now move the cursor to the end of the text and press "y". This yanks (copies)
+the selected text.
+ To copy the above paragraph, you would do: >
+
+ :edit thisfile
+ /This
+ vjjjj$y
+
+Now edit the file you want to put the text in. Move the cursor to the
+character where you want the text to appear after. Use "p" to put the text
+there. >
+ :edit otherfile
+ /There
+ p
+
+Of course you can use many other commands to yank the text. For example, to
+select whole lines start Visual mode with "V". Or use CTRL-V to select a
+rectangular block. Or use "Y" to yank a single line, "yaw" to yank-a-word,
+etc.
+ The "p" command puts the text after the cursor. Use "P" to put the text
+before the cursor. Notice that Vim remembers if you yanked a whole line or a
+block, and puts it back that way.
+
+
+USING REGISTERS
+
+When you want to copy several pieces of text from one file to another, having
+to switch between the files and writing the target file takes a lot of time.
+To avoid this, copy each piece of text to its own register.
+ A register is a place where Vim stores text. Here we will use the
+registers named a to z (later you will find out there are others). Let's copy
+a sentence to the f register (f for First): >
+
+ "fyas
+
+The "yas" command yanks a sentence like before. It's the "f that tells Vim
+the text should be place in the f register. This must come just before the
+yank command.
+ Now yank three whole lines to the l register (l for line): >
+
+ "l3Y
+
+The count could be before the "l just as well. To yank a block of text to the
+b (for block) register: >
+
+ CTRL-Vjjww"by
+
+Notice that the register specification "b is just before the "y" command.
+This is required. If you would have put it before the "w" command, it would
+not have worked.
+ Now you have three pieces of text in the f, l and b registers. Edit
+another file, move around and place the text where you want it: >
+
+ "fp
+
+Again, the register specification "f comes before the "p" command.
+ You can put the registers in any order. And the text stays in the register
+until you yank something else into it. Thus you can put it as many times as
+you like.
+
+When you delete text, you can also specify a register. Use this to move
+several pieces of text around. For example, to delete-a-word and write it in
+the w register: >
+
+ "wdaw
+
+Again, the register specification comes before the delete command "d".
+
+
+APPENDING TO A FILE
+
+When collecting lines of text into one file, you can use this command: >
+
+ :write >> logfile
+
+This will write the text of the current file to the end of "logfile". Thus it
+is appended. This avoids that you have to copy the lines, edit the log file
+and put them there. Thus you save two steps. But you can only append to the
+end of a file.
+ To append only a few lines, select them in Visual mode before typing
+":write". In chapter 10 you will learn other ways to select a range of lines.
+
+==============================================================================
+*07.6* Viewing a file
+
+Sometimes you only want to see what a file contains, without the intention to
+ever write it back. There is the risk that you type ":w" without thinking and
+overwrite the original file anyway. To avoid this, edit the file read-only.
+ To start Vim in readonly mode, use this command: >
+
+ vim -R file
+
+On Unix this command should do the same thing: >
+
+ view file
+
+You are now editing "file" in read-only mode. When you try using ":w" you
+will get an error message and the file won't be written.
+ When you try to make a change to the file Vim will give you a warning:
+
+ W10: Warning: Changing a readonly file ~
+
+The change will be done though. This allows for formatting the file, for
+example, to be able to read it easily.
+ If you make changes to a file and forgot that it was read-only, you can
+still write it. Add the ! to the write command to force writing.
+
+If you really want to forbid making changes in a file, do this: >
+
+ vim -M file
+
+Now every attempt to change the text will fail. The help files are like this,
+for example. If you try to make a change you get this error message:
+
+ E21: Cannot make changes, 'modifiable' is off ~
+
+You could use the -M argument to setup Vim to work in a viewer mode. This is
+only voluntary though, since these commands will remove the protection: >
+
+ :set modifiable
+ :set write
+
+==============================================================================
+*07.7* Changing the file name
+
+A clever way to start editing a new file is by using an existing file that
+contains most of what you need. For example, you start writing a new program
+to move a file. You know that you already have a program that copies a file,
+thus you start with: >
+
+ :edit copy.c
+
+You can delete the stuff you don't need. Now you need to save the file under
+a new name. The ":saveas" command can be used for this: >
+
+ :saveas move.c
+
+Vim will write the file under the given name, and edit that file. Thus the
+next time you do ":write", it will write "move.c". "copy.c" remains
+unmodified.
+ When you want to change the name of the file you are editing, but don't
+want to write the file, you can use this command: >
+
+ :file move.c
+
+Vim will mark the file as "not edited". This means that Vim knows this is not
+the file you started editing. When you try to write the file, you might get
+this message:
+
+ E13: File exists (use ! to override) ~
+
+This protects you from accidentally overwriting another file.
+
+==============================================================================
+
+Next chapter: |usr_08.txt| Splitting windows
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_08.txt b/runtime/doc/usr_08.txt
new file mode 100644
index 000000000..fef83987e
--- /dev/null
+++ b/runtime/doc/usr_08.txt
@@ -0,0 +1,511 @@
+*usr_08.txt* For Vim version 7.0aa. Last change: 2004 Jun 04
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Splitting windows
+
+
+Display two different files above each other. Or view two locations in the
+file at the same time. See the difference between two files by putting them
+side by side. All this is possible with split windows.
+
+|08.1| Split a window
+|08.2| Split a window on another file
+|08.3| Window size
+|08.4| Vertical splits
+|08.5| Moving windows
+|08.6| Commands for all windows
+|08.7| Viewing differences with vimdiff
+|08.8| Various
+
+ Next chapter: |usr_09.txt| Using the GUI
+ Previous chapter: |usr_07.txt| Editing more than one file
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*08.1* Split a window
+
+The easiest way to open a new window is to use the following command: >
+
+ :split
+
+This command splits the screen into two windows and leaves the cursor in the
+top one:
+
+ +----------------------------------+
+ |/* file one.c */ |
+ |~ |
+ |~ |
+ |one.c=============================|
+ |/* file one.c */ |
+ |~ |
+ |one.c=============================|
+ | |
+ +----------------------------------+
+
+What you see here is two windows on the same file. The line with "====" is
+that status line. It displays information about the window above it. (In
+practice the status line will be in reverse video.)
+ The two windows allow you to view two parts of the same file. For example,
+you could make the top window show the variable declarations of a program, and
+the bottom one the code that uses these variables.
+
+The CTRL-W w command can be used to jump between the windows. If you are in
+the top window, CTRL-W w jumps to the window below it. If you are in the
+bottom window it will jump to the first window. (CTRL-W CTRL-W does the same
+thing, in case you let go of the CTRL key a bit later.)
+
+
+CLOSE THE WINDOW
+
+To close a window, use the command: >
+
+ :close
+
+Actually, any command that quits editing a file works, like ":quit" and "ZZ".
+But ":close" prevents you from accidentally exiting Vim when you close the
+last window.
+
+
+CLOSING ALL OTHER WINDOWS
+
+If you have opened a whole bunch of windows, but now want to concentrate on
+one of them, this command will be useful: >
+
+ :only
+
+This closes all windows, except for the current one. If any of the other
+windows has changes, you will get an error message and that window won't be
+closed.
+
+==============================================================================
+*08.2* Split a window on another file
+
+The following command opens a second window and starts editing the given file:
+>
+ :split two.c
+
+If you were editing one.c, then the result looks like this:
+
+ +----------------------------------+
+ |/* file two.c */ |
+ |~ |
+ |~ |
+ |two.c=============================|
+ |/* file one.c */ |
+ |~ |
+ |one.c=============================|
+ | |
+ +----------------------------------+
+
+To open a window on a new, empty file, use this: >
+
+ :new
+
+You can repeat the ":split" and ":new" commands to create as many windows as
+you like.
+
+==============================================================================
+*08.3* Window size
+
+The ":split" command can take a number argument. If specified, this will be
+the height of the new window. For example, the following opens a new window
+three lines high and starts editing the file alpha.c: >
+
+ :3split alpha.c
+
+For existing windows you can change the size in several ways. When you have a
+working mouse, it is easy: Move the mouse pointer to the status line that
+separates two windows, and drag it up or down.
+
+To increase the size of a window: >
+
+ CTRL-W +
+
+To decrease it: >
+
+ CTRL-W -
+
+Both of these commands take a count and increase or decrease the window size
+by that many lines. Thus "4 CTRL-W +" make the window four lines higher.
+
+To set the window height to a specified number of lines: >
+
+ {height}CTRL-W _
+
+That's: a number {height}, CTRL-W and then an underscore (the - key with Shift
+on English-US keyboards).
+ To make a window as high as it can be, use the CTRL-W _ command without a
+count.
+
+
+USING THE MOUSE
+
+In Vim you can do many things very quickly from the keyboard. Unfortunately,
+the window resizing commands require quite a bit of typing. In this case,
+using the mouse is faster. Position the mouse pointer on a status line. Now
+press the left mouse button and drag. The status line will move, thus making
+the window on one side higher and the other smaller.
+
+
+OPTIONS
+
+The 'winheight' option can be set to a minimal desired height of a window and
+'winminheight' to a hard minimum height.
+ Likewise, there is 'winwidth' for the minimal desired width and
+'winminwidth' for the hard minimum width.
+ The 'equalalways' option, when set, makes Vim equalize the windows sizes
+when a window is closed or opened.
+
+==============================================================================
+*08.4* Vertical splits
+
+The ":split" command creates the new window above the current one. To make
+the window appear at the left side, use: >
+
+ :vsplit
+
+or: >
+ :vsplit two.c
+
+The result looks something like this:
+
+ +--------------------------------------+
+ |/* file two.c */ |/* file one.c */ |
+ |~ |~ |
+ |~ |~ |
+ |~ |~ |
+ |two.c===============one.c=============|
+ | |
+ +--------------------------------------+
+
+Actually, the | lines in the middle will be in reverse video. This is called
+the vertical separator. It separates the two windows left and right of it.
+
+There is also the ":vnew" command, to open a vertically split window on a new,
+empty file. Another way to do this: >
+
+ :vertical new
+
+The ":vertical" command can be inserted before another command that splits a
+window. This will cause that command to split the window vertically instead
+of horizontally. (If the command doesn't split a window, it works
+unmodified.)
+
+
+MOVING BETWEEN WINDOWS
+
+Since you can split windows horizontally and vertically as much as you like,
+you can create any layout of windows. Then you can use these commands to move
+between them:
+
+ CTRL-W h move to the window on the left
+ CTRL-W j move to the window below
+ CTRL-W k move to the window above
+ CTRL-W l move to the window on the right
+
+ CTRL-W t move to the TOP window
+ CTRL-W b move to the BOTTOM window
+
+You will notice the same letters as used for moving the cursor. And the
+cursor keys can also be used, if you like.
+ More commands to move to other windows: |Q_wi|.
+
+==============================================================================
+*08.5* Moving windows
+
+You have split a few windows, but now they are in the wrong place. Then you
+need a command to move the window somewhere else. For example, you have three
+windows like this:
+
+ +----------------------------------+
+ |/* file two.c */ |
+ |~ |
+ |~ |
+ |two.c=============================|
+ |/* file three.c */ |
+ |~ |
+ |~ |
+ |three.c===========================|
+ |/* file one.c */ |
+ |~ |
+ |one.c=============================|
+ | |
+ +----------------------------------+
+
+Clearly the last one should be at the top. Go to that window (using CTRL-W w)
+and the type this command: >
+
+ CTRL-W K
+
+This uses the uppercase letter K. What happens is that the window is moved to
+the very top. You will notice that K is again used for moving upwards.
+ When you have vertical splits, CTRL-W K will move the current window to the
+top and make it occupy the full with of the Vim window. If this is your
+layout:
+
+ +-------------------------------------------+
+ |/* two.c */ |/* three.c */ |/* one.c */ |
+ |~ |~ |~ |
+ |~ |~ |~ |
+ |~ |~ |~ |
+ |~ |~ |~ |
+ |~ |~ |~ |
+ |two.c=========three.c=========one.c========|
+ | |
+ +-------------------------------------------+
+
+Then using CTRL-W K in the middle window (three.c) will result in:
+
+ +-------------------------------------------+
+ |/* three.c */ |
+ |~ |
+ |~ |
+ |three.c====================================|
+ |/* two.c */ |/* one.c */ |
+ |~ |~ |
+ |two.c==================one.c===============|
+ | |
+ +-------------------------------------------+
+
+The other three similar commands (you can probably guess these now):
+
+ CTRL-W H move window to the far left
+ CTRL-W J move window to the bottom
+ CTRL-W L move window to the far right
+
+==============================================================================
+*08.6* Commands for all windows
+
+When you have several windows open and you want to quit Vim, you can close
+each window separately. A quicker way is using this command: >
+
+ :qall
+
+This stands for "quit all". If any of the windows contain changes, Vim will
+not exit. The cursor will automatically be positioned in a window with
+changes. You can then either use ":write" to save the changes, or ":quit!" to
+throw them away.
+
+If you know there are windows with changes, and you want to save all these
+changes, use this command: >
+
+ :wall
+
+This stands for "write all". But actually, it only writes files with
+changes. Vim knows it doesn't make sense to write files that were not
+changed.
+ And then there is the combination of ":qall" and ":wall": the "write and
+quit all" command: >
+
+ :wqall
+
+This writes all modified files and quits Vim.
+ Finally, there is a command that quits Vim and throws away all changes: >
+
+ :qall!
+
+Be careful, there is no way to undo this command!
+
+
+OPENING A WINDOW FOR ALL ARGUMENTS
+
+To make Vim open a window for each file, start it with the "-o" argument: >
+
+ vim -o one.txt two.txt three.txt
+
+This results in:
+
+ +-------------------------------+
+ |file one.txt |
+ |~ |
+ |one.txt========================|
+ |file two.txt |
+ |~ |
+ |two.txt========================|
+ |file three.txt |
+ |~ |
+ |three.txt======================|
+ | |
+ +-------------------------------+
+
+The "-O" argument is used to get vertically split windows.
+ When Vim is already running, the ":all" command opens a window for each
+file in the argument list. ":vertical all" does it with vertical splits.
+
+==============================================================================
+*08.7* Viewing differences with vimdiff
+
+There is a special way to start Vim, which shows the differences between two
+files. Let's take a file "main.c" and insert a few characters in one line.
+Write this file with the 'backup' option set, so that the backup file
+"main.c~" will contain the previous version of the file.
+ Type this command in a shell (not in Vim): >
+
+ vimdiff main.c~ main.c
+
+Vim will start, with two windows side by side. You will only see the line
+in which you added characters, and a few lines above and below it.
+
+ VV VV
+ +-----------------------------------------+
+ |+ +--123 lines: /* a|+ +--123 lines: /* a| <- fold
+ | text | text |
+ | text | text |
+ | text | text |
+ | text | changed text | <- changed line
+ | text | text |
+ | text | ------------------| <- deleted line
+ | text | text |
+ | text | text |
+ | text | text |
+ |+ +--432 lines: text|+ +--432 lines: text| <- fold
+ | ~ | ~ |
+ | ~ | ~ |
+ |main.c~==============main.c==============|
+ | |
+ +-----------------------------------------+
+
+(This picture doesn't show the highlighting, use the vimdiff command for a
+better look.)
+
+The lines that were not modified have been collapsed into one line. This is
+called a closed fold. They are indicated in the picture with "<- fold". Thus
+the single fold line at the top stands for 123 text lines. These lines are
+equal in both files.
+ The line marked with "<- changed line" is highlighted, and the inserted
+text is displayed with another color. This clearly shows what the difference
+is between the two files.
+ The line that was deleted is displayed with "---" in the main.c window.
+See the "<- deleted line" marker in the picture. These characters are not
+really there. They just fill up main.c, so that it displays the same number
+of lines as the other window.
+
+
+THE FOLD COLUMN
+
+Each window has a column on the left with a slightly different background. In
+the picture above these are indicated with "VV". You notice there is a plus
+character there, in front of each closed fold. Move the mouse pointer to that
+plus and click the left button. The fold will open, and you can see the text
+that it contains.
+ The fold column contains a minus sign for an open fold. If you click on
+this -, the fold will close.
+ Obviously, this only works when you have a working mouse. You can also use
+"zo" to open a fold and "zc" to close it.
+
+
+DIFFING IN VIM
+
+Another way to start in diff mode can be done from inside Vim. Edit the
+"main.c" file, then make a split and show the differences: >
+
+ :edit main.c
+ :vertical diffsplit main.c~
+
+The ":vertical" command is used to make the window split vertically. If you
+omit this, you will get a horizontal split.
+
+If you have a patch or diff file, you can use the third way to start diff
+mode. First edit the file to which the patch applies. Then tell Vim the name
+of the patch file: >
+
+ :edit main.c
+ :vertical diffpatch main.c.diff
+
+WARNING: The patch file must contain only one patch, for the file you are
+editing. Otherwise you will get a lot of error messages, and some files might
+be patched unexpectedly.
+ The patching will only be done to the copy of the file in Vim. The file on
+your harddisk will remain unmodified (until you decide to write the file).
+
+
+SCROLL BINDING
+
+When the files have more changes, you can scroll in the usual way. Vim will
+try to keep both the windows start at the same position, so you can easily see
+the differences side by side.
+ When you don't want this for a moment, use this command: >
+
+ :set noscrollbind
+
+
+JUMPING TO CHANGES
+
+When you have disabled folding in some way, it may be difficult to find the
+changes. Use this command to jump forward to the next change: >
+
+ ]c
+
+To go the other way use: >
+
+ [c
+
+Prepended a count to jump further away.
+
+
+REMOVING CHANGES
+
+You can move text from one window to the other. This either removes
+differences or adds new ones. Vim doesn't keep the highlighting updated in
+all situations. To update it use this command: >
+
+ :diffupdate
+
+To remove a difference, you can move the text in a highlighted block from one
+window to another. Take the "main.c" and "main.c~" example above. Move the
+cursor to the left window, on the line that was deleted in the other window.
+Now type this command: >
+
+ dp
+
+The change will be removed by putting the text of the current window in the
+other window. "dp" stands for "diff put".
+ You can also do it the other way around. Move the cursor to the right
+window, to the line where "changed" was inserted. Now type this command: >
+
+ do
+
+The change will now be removed by getting the text from the other window.
+Since there are no changes left now, Vim puts all text in a closed fold.
+"do" stands for "diff obtain". "dg" would have been better, but that already
+has a different meaning ("dgg" deletes from the cursor until the first line).
+
+For details about diff mode, see |vimdiff|.
+
+==============================================================================
+*08.8* Various
+
+The 'laststatus' option can be used to specify when the last window has a
+statusline:
+
+ 0 never
+ 1 only when there are split windows (the default)
+ 2 always
+
+Many commands that edit another file have a variant that splits the window.
+For Command-line commands this is done by prepending an "s". For example:
+":tag" jumps to a tag, ":stag" splits the window and jumps to a
+tag.
+ For Normal mode commands a CTRL-W is prepended. CTRL-^ jumps to the
+alternate file, CTRL-W CTRL-^ splits the window and edits the alternate file.
+
+The 'splitbelow' option can be set to make a new window appear below the
+current window. The 'splitright' option can be set to make a vertically split
+window appear right of the current window.
+
+When splitting a window you can prepend a modifier command to tell where the
+window is to appear:
+
+ :leftabove {cmd} left or above the current window
+ :aboveleft {cmd} idem
+ :rightbelow {cmd} right or below the current window
+ :belowright {cmd} idem
+ :topleft {cmd} at the top or left of the Vim window
+ :botright {cmd} at the bottom or right of the Vim window
+
+==============================================================================
+
+Next chapter: |usr_09.txt| Using the GUI
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_09.txt b/runtime/doc/usr_09.txt
new file mode 100644
index 000000000..8d97b186a
--- /dev/null
+++ b/runtime/doc/usr_09.txt
@@ -0,0 +1,289 @@
+*usr_09.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Using the GUI
+
+
+Vim works in an ordinary terminal. GVim can do the same things and a few
+more. The GUI offers menus, a toolbar, scrollbars and other items. This
+chapter is about these extra things that the GUI offers.
+
+|09.1| Parts of the GUI
+|09.2| Using the mouse
+|09.3| The clipboard
+|09.4| Select mode
+
+ Next chapter: |usr_10.txt| Making big changes
+ Previous chapter: |usr_08.txt| Splitting windows
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*09.1* Parts of the GUI
+
+You might have an icon on your desktop that starts gVim. Otherwise, one of
+these commands should do it: >
+
+ gvim file.txt
+ vim -g file.txt
+
+If this doesn't work you don't have a version of Vim with GUI support. You
+will have to install one first.
+ Vim will open a window and display "file.txt" in it. What the window looks
+like depends on the version of Vim. It should resemble the following picture
+(for as far as this can be shown in ASCII!).
+
+ +----------------------------------------------------+
+ | file.txt + (~/dir) - VIM X | <- window title
+ +----------------------------------------------------+
+ | File Edit Tools Syntax Buffers Window Help | <- menubar
+ +----------------------------------------------------+
+ | aaa bbb ccc ddd eee fff ggg hhh iii jjj | <- toolbar
+ | aaa bbb ccc ddd eee fff ggg hhh iii jjj |
+ +----------------------------------------------------+
+ | file text | ^ |
+ | ~ | # |
+ | ~ | # | <- scrollbar
+ | ~ | # |
+ | ~ | # |
+ | ~ | # |
+ | | V |
+ +----------------------------------------------------+
+
+The largest space is occupied by the file text. This shows the file in the
+same way as in a terminal. With some different colors and another font
+perhaps.
+
+
+THE WINDOW TITLE
+
+At the very top is the window title. This is drawn by your window system.
+Vim will set the title to show the name of the current file. First comes the
+name of the file. Then some special characters and the directory of the file
+in parens. These special character can be present:
+
+ - The file cannot be modified (e.g., a help file)
+ + The file contains changes
+ = The file is read-only
+ =+ The file is read-only, contains changes anyway
+
+If nothing is shown you have an ordinary, unchanged file.
+
+
+THE MENUBAR
+
+You know how menus work, right? Vim has the usual items, plus a few more.
+Browse them to get an idea of what you can use them for. A relevant submenu
+is Edit/Global Settings. You will find these entries:
+
+ Toggle Toolbar make the toolbar appear/disappear
+ Toggle Bottom Scrollbar make a scrollbar appear/disappear at the bottom
+ Toggle Left Scrollbar make a scrollbar appear/disappear at the left
+ Toggle Right Scrollbar make a scrollbar appear/disappear at the right
+
+On most systems you can tear-off the menus. Select the top item of the menu,
+the one that looks like a dashed line. You will get a separate window with
+the items of the menu. It will hang around until you close the window.
+
+
+THE TOOLBAR
+
+This contains icons for the most often used actions. Hopefully the icons are
+self-explanatory. There are tooltips to get an extra hint (move the mouse
+pointer to the icon without clicking and don't move it for a second).
+
+The "Edit/Global Settings/Toggle Toolbar" menu item can be used to make the
+toolbar disappear. If you never want a toolbar, use this command in your
+vimrc file: >
+
+ :set guioptions-=T
+
+This removes the 'T' flag from the 'guioptions' option. Other parts of the
+GUI can also be enabled or disabled with this option. See the help for it.
+
+
+THE SCROLLBARS
+
+By default there is one scrollbar on the right. It does the obvious thing.
+When you split the window, each window will get its own scrollbar.
+ You can make a horizontal scrollbar appear with the menu item
+Edit/Global Settings/Toggle Bottom Scrollbar. This is useful in diff mode, or
+when the 'wrap' option has been reset (more about that later).
+
+When there are vertically split windows, only the windows on the right side
+will have a scrollbar. However, when you move the cursor to a window on the
+left, it will be this one the that scrollbar controls. This takes a bit of
+time to get used to.
+ When you work with vertically split windows, consider adding a scrollbar on
+the left. This can be done with a menu item, or with the 'guioptions' option:
+>
+ :set guioptions+=l
+
+This adds the 'l' flag to 'guioptions'.
+
+==============================================================================
+*09.2* Using the mouse
+
+Standards are wonderful. In Microsoft Windows, you can use the mouse to
+select text in a standard manner. The X Window system also has a standard
+system for using the mouse. Unfortunately, these two standards are not the
+same.
+ Fortunately, you can customize Vim. You can make the behavior of the mouse
+work like an X Window system mouse or a Microsoft Windows mouse. The following
+command makes the mouse behave like an X Window mouse: >
+
+ :behave xterm
+
+The following command makes the mouse work like a Microsoft Windows mouse: >
+
+ :behave mswin
+
+The default behavior of the mouse on UNIX systems is xterm. The default
+behavior on a Microsoft Windows system is selected during the installation
+process. For details about what the two behaviors are, see |:behave|. Here
+follows a summary.
+
+
+XTERM MOUSE BEHAVIOR
+
+Left mouse click position the cursor
+Left mouse drag select text in Visual mode
+Middle mouse click paste text from the clipboard
+Right mouse click extend the selected text until the mouse
+ pointer
+
+
+MSWIN MOUSE BEHAVIOR
+
+Left mouse click position the cursor
+Left mouse drag select text in Select mode (see |09.4|)
+Left mouse click, with Shift extend the selected text until the mouse
+ pointer
+Middle mouse click paste text from the clipboard
+Right mouse click display a pop-up menu
+
+
+The mouse can be further tuned. Check out these options if you want to change
+the way how the mouse works:
+
+ 'mouse' in which mode the mouse is used by Vim
+ 'mousemodel' what effect a mouse click has
+ 'mousetime' time between clicks for a double-click
+ 'mousehide' hide the mouse while typing
+ 'selectmode' whether the mouse starts Visual or Select mode
+
+==============================================================================
+*09.3* The clipboard
+
+In section |04.7| the basic use of the clipboard was explained. There is one
+essential thing to explain about X-windows: There are actually two places to
+exchange text between programs. MS-Windows doesn't have this.
+
+In X-Windows there is the "current selection". This is the text that is
+currently highlighted. In Vim this is the Visual area (this assumes you are
+using the default option settings). You can paste this selection in another
+application without any further action.
+ For example, in this text select a few words with the mouse. Vim will
+switch to Visual mode and highlight the text. Now start another gVim, without
+a file name argument, so that it displays an empty window. Click the middle
+mouse button. The selected text will be inserted.
+
+The "current selection" will only remain valid until some other text is
+selected. After doing the paste in the other gVim, now select some characters
+in that window. You will notice that the words that were previously selected
+in the other gVim window are displayed differently. This means that it no
+longer is the current selection.
+
+You don't need to select text with the mouse, using the keyboard commands for
+Visual mode works just as well.
+
+
+THE REAL CLIPBOARD
+
+Now for the other place with which text can be exchanged. We call this the
+"real clipboard", to avoid confusion. Often both the "current selection" and
+the "real clipboard" are called clipboard, you'll have to get used to that.
+ To put text on the real clipboard, select a few different words in one of
+the gVims you have running. Then use the Edit/Copy menu entry. Now the text
+has been copied to the real clipboard. You can't see this, unless you have
+some application that shows the clipboard contents (e.g., KDE's klipper).
+ Now select the other gVim, position the cursor somewhere and use the
+Edit/Paste menu. You will see the text from the real clipboard is inserted.
+
+
+USING BOTH
+
+This use of both the "current selection" and the "real clipboard" might sound
+a bit confusing. But it is very useful. Let's show this with an example.
+Use one gVim with a text file and perform these actions:
+
+- Select two words in Visual mode.
+- Use the Edit/Copy menu to get these words onto the clipboard.
+- Select one other word in Visual mode.
+- Use the Edit/Paste menu item. What will happen is that the single selected
+ word is replaced with the two words from the clipboard.
+- Move the mouse pointer somewhere else and click the middle button. You
+ will see that the word you just overwrote with the clipboard is inserted
+ here.
+
+If you use the "current selection" and the "real clipboard" with care, you can
+do a lot of useful editing with them.
+
+
+USING THE KEYBOARD
+
+If you don't like using the mouse, you can access the current selection and
+the real clipboard with two registers. The "* register is for the current
+selection.
+ To make text become the current selection, use Visual mode. For example,
+to select a whole line just press "V".
+ To insert the current selection before the cursor: >
+
+ "*P
+
+Notice the uppercase "P". The lowercase "p" puts the text after the cursor.
+
+The "+ register is used for the real clipboard. For example, to copy the text
+from the cursor position until the end of the line to the clipboard: >
+
+ "+y$
+
+Remember, "y" is yank, which is Vim's copy command.
+ To insert the contents of the real clipboard before the cursor: >
+
+ "+P
+
+It's the same as for the current selection, but uses the plus (+) register
+instead of the star (*) register.
+
+==============================================================================
+*09.4* Select mode
+
+And now something that is used more often on MS-Windows than on X-Windows.
+But both can do it. You already know about Visual mode. Select mode is like
+Visual mode, because it is also used to select text. But there is an obvious
+difference: When typing text, the selected text is deleted and the typed text
+replaces it.
+
+To start working with Select mode, you must first enable it (for MS-Windows
+it is probably already enabled, but you can do this anyway): >
+
+ :set selectmode+=mouse
+
+Now use the mouse to select some text. It is highlighted like in Visual mode.
+Now press a letter. The selected text is deleted, and the single letter
+replaces it. You are in Insert mode now, thus you can continue typing.
+
+Since typing normal text causes the selected text to be deleted, you can not
+use the normal movement commands "hjkl", "w", etc. Instead, use the shifted
+function keys. <S-Left> (shifted cursor left key) moves the cursor left. The
+selected text is changed like in Visual mode. The other shifted cursor keys
+do what you expect. <S-End> and <S-Home> also work.
+
+You can tune the way Select mode works with the 'selectmode' option.
+
+==============================================================================
+
+Next chapter: |usr_10.txt| Making big changes
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt
new file mode 100644
index 000000000..807d2f99a
--- /dev/null
+++ b/runtime/doc/usr_10.txt
@@ -0,0 +1,822 @@
+*usr_10.txt* For Vim version 7.0aa. Last change: 2004 Mar 12
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Making big changes
+
+
+In chapter 4 several ways to make small changes were explained. This chapter
+goes into making changes that are repeated or can affect a large amount of
+text. The Visual mode allows doing various things with blocks of text. Use
+an external program to do really complicated things.
+
+|10.1| Record and playback commands
+|10.2| Substitution
+|10.3| Command ranges
+|10.4| The global command
+|10.5| Visual block mode
+|10.6| Reading and writing part of a file
+|10.7| Formatting text
+|10.8| Changing case
+|10.9| Using an external program
+
+ Next chapter: |usr_11.txt| Recovering from a crash
+ Previous chapter: |usr_09.txt| Using the GUI
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*10.1* Record and playback commands
+
+The "." command repeats the preceding change. But what if you want to do
+something more complex than a single change? That's where command recording
+comes in. There are three steps:
+
+1. The "q{register}" command starts recording keystrokes into the register
+ named {register}. The register name must be between a and z.
+2. Type your commands.
+3. To finish recording, press q (without any extra character).
+
+You can now execute the macro by typing the command "@{register}".
+
+Take a look at how to use these commands in practice. You have a list of
+filenames that look like this:
+
+ stdio.h ~
+ fcntl.h ~
+ unistd.h ~
+ stdlib.h ~
+
+And what you want is the following:
+
+ #include "stdio.h" ~
+ #include "fcntl.h" ~
+ #include "unistd.h" ~
+ #include "stdlib.h" ~
+
+You start by moving to the first character of the first line. Next you
+execute the following commands:
+
+ qa Start recording a macro in register a.
+ ^ Move to the beginning of the line.
+ i#include "<Esc> Insert the string #include " at the beginning
+ of the line.
+ $ Move to the end of the line.
+ a"<Esc> Append the character double quotation mark (")
+ to the end of the line.
+ j Go to the next line.
+ q Stop recording the macro.
+
+Now that you have done the work once, you can repeat the change by typing the
+command "@a" three times.
+ The "@a" command can be preceded by a count, which will cause the macro to
+be executed that number of times. In this case you would type: >
+
+ 3@a
+
+
+MOVE AND EXECUTE
+
+You might have the lines you want to change in various places. Just move the
+cursor to each location and use the "@a" command. If you have done that once,
+you can do it again with "@@". That's a bit easier to type. If you now
+execute register b with "@b", the next "@@" will use register b.
+ If you compare the playback method with using ".", there are several
+differences. First of all, "." can only repeat one change. As seen in the
+example above, "@a" can do several changes, and move around as well.
+Secondly, "." can only remember the last change. Executing a register allows
+you to make any changes and then still use "@a" to replay the recorded
+commands. Finally, you can use 26 different registers. Thus you can remember
+26 different command sequences to execute.
+
+
+USING REGISTERS
+
+The registers used for recording are the same ones you used for yank and
+delete commands. This allows you to mix recording with other commands to
+manipulate the registers.
+ Suppose you have recorded a few commands in register n. When you execute
+this with "@n" you notice you did something wrong. You could try recording
+again, but perhaps you will make another mistake. Instead, use this trick:
+
+ G Go to the end of the file.
+ o<Esc> Create an empty line.
+ "np Put the text from the n register. You now see
+ the commands you typed as text in the file.
+ {edits} Change the commands that were wrong. This is
+ just like editing text.
+ 0 Go to the start of the line.
+ "ny$ Yank the corrected commands into the n
+ register.
+ dd Delete the scratch line.
+
+Now you can execute the corrected commands with "@n". (If your recorded
+commands include line breaks, adjust the last two items in the example to
+include all the lines.)
+
+
+APPENDING TO A REGISTER
+
+So far we have used a lowercase letter for the register name. To append to a
+register, use an uppercase letter.
+ Suppose you have recorded a command to change a word to register c. It
+works properly, but you would like to add a search for the next word to
+change. This can be done with: >
+
+ qC/word<Enter>q
+
+You start with "qC", which records to the c register and appends. Thus
+writing to an uppercase register name means to append to the register with
+the same letter, but lowercase.
+
+This works both with recording and with yank and delete commands. For
+example, you want to collect a sequence of lines into the a register. Yank
+the first line with: >
+
+ "aY
+
+Now move to the second line, and type: >
+
+ "AY
+
+Repeat this command for all lines. The a register now contains all those
+lines, in the order you yanked them.
+
+==============================================================================
+*10.2* Substitution *find-replace*
+
+The ":substitute" command enables you to perform string replacements on a
+whole range of lines. The general form of this command is as follows: >
+
+ :[range]substitute/from/to/[flags]
+
+This command changes the "from" string to the "to" string in the lines
+specified with [range]. For example, you can change "Professor" to "Teacher"
+in all lines with the following command: >
+
+ :%substitute/Professor/Teacher/
+<
+ Note:
+ The ":substitute" command is almost never spelled out completely.
+ Most of the time, people use the abbreviated version ":s". From here
+ on the abbreviation will be used.
+
+The "%" before the command specifies the command works on all lines. Without
+a range, ":s" only works on the current line. More about ranges in the next
+section |10.3|.
+
+By default, the ":substitute" command changes only the first occurrence on
+each line. For example, the preceding command changes the line:
+
+ Professor Smith criticized Professor Johnson today. ~
+
+to:
+
+ Teacher Smith criticized Professor Johnson today. ~
+
+To change every occurrence on the line, you need to add the g (global) flag.
+The command: >
+
+ :%s/Professor/Teacher/g
+
+results in (starting with the original line):
+
+ Teacher Smith criticized Teacher Johnson today. ~
+
+Other flags include p (print), which causes the ":substitute" command to print
+out each line it changes. The c (confirm) flag tells ":substitute" to ask you
+for confirmation before it performs each substitution. Enter the following: >
+
+ :%s/Professor/Teacher/c
+
+Vim finds the first occurrence of "Professor" and displays the text it is
+about to change. You get the following prompt: >
+
+ replace with Teacher (y/n/a/q/l/^E/^Y)?
+
+At this point, you must enter one of the following answers:
+
+ y Yes; make this change.
+ n No; skip this match.
+ a All; make this change and all remaining ones without
+ further confirmation.
+ q Quit; don't make any more changes.
+ l Last; make this change and then quit.
+ CTRL-E Scroll the text one line up.
+ CTRL-Y Scroll the text one line down.
+
+
+The "from" part of the substitute command is actually a pattern. The same
+kind as used for the search command. For example, this command only
+substitutes "the" when it appears at the start of a line: >
+
+ :s/^the/these/
+
+If you are substituting with a "from" or "to" part that includes a slash, you
+need to put a backslash before it. A simpler way is to use another character
+instead of the slash. A plus, for example: >
+
+ :s+one/two+one or two+
+
+==============================================================================
+*10.3* Command ranges
+
+The ":substitute" command, and many other : commands, can be applied to a
+selection of lines. This is called a range.
+ The simple form of a range is {number},{number}. For example: >
+
+ :1,5s/this/that/g
+
+Executes the substitute command on the lines 1 to 5. Line 5 is included.
+The range is always placed before the command.
+
+A single number can be used to address one specific line: >
+
+ :54s/President/Fool/
+
+Some commands work on the whole file when you do not specify a range. To make
+them work on the current line the "." address is used. The ":write" command
+works like that. Without a range, it writes the whole file. To make it write
+only the current line into a file: >
+
+ :.write otherfile
+
+The first line always has number one. How about the last line? The "$"
+character is used for this. For example, to substitute in the lines from the
+cursor to the end: >
+
+ :.,$s/yes/no/
+
+The "%" range that we used before, is actually a short way to say "1,$", from
+the first to the last line.
+
+
+USING A PATTERN IN A RANGE
+
+Suppose you are editing a chapter in a book, and want to replace all
+occurrences of "grey" with "gray". But only in this chapter, not in the next
+one. You know that only chapter boundaries have the word "Chapter" in the
+first column. This command will work then: >
+
+ :?^Chapter?,/^Chapter/s=grey=gray=g
+
+You can see a search pattern is used twice. The first "?^Chapter?" finds the
+line above the current position that matches this pattern. Thus the ?pattern?
+range is used to search backwards. Similarly, "/^Chapter/" is used to search
+forward for the start of the next chapter.
+ To avoid confusion with the slashes, the "=" character was used in the
+substitute command here. A slash or another character would have worked as
+well.
+
+
+ADD AND SUBTRACT
+
+There is a slight error in the above command: If the title of the next chapter
+had included "grey" it would be replaced as well. Maybe that's what you
+wanted, but what if you didn't? Then you can specify an offset.
+ To search for a pattern and then use the line above it: >
+
+ /Chapter/-1
+
+You can use any number instead of the 1. To address the second line below the
+match: >
+
+ /Chapter/+2
+
+The offsets can also be used with the other items in a range. Look at this
+one: >
+
+ :.+3,$-5
+
+This specifies the range that starts three lines below the cursor and ends
+five lines before the last line in the file.
+
+
+USING MARKS
+
+Instead of figuring out the line numbers of certain positions, remembering them
+and typing them in a range, you can use marks.
+ Place the marks as mentioned in chapter 3. For example, use "mt" to mark
+the top of an area and "mb" to mark the bottom. Then you can use this range
+to specify the lines between the marks (including the lines with the marks): >
+
+ :'t,'b
+
+
+VISUAL MODE AND RANGES
+
+You can select text with Visual mode. If you then press ":" to start a colon
+command, you will see this: >
+
+ :'<,'>
+
+Now you can type the command and it will be applied to the range of lines that
+was visually selected.
+
+ Note:
+ When using Visual mode to select part of a line, or using CTRL-V to
+ select a block of text, the colon commands will still apply to whole
+ lines. This might change in a future version of Vim.
+
+The '< and '> are actually marks, placed at the start and end of the Visual
+selection. The marks remain at their position until another Visual selection
+is made. Thus you can use the "'<" command to jump to position where the
+Visual area started. And you can mix the marks with other items: >
+
+ :'>,$
+
+This addresses the lines from the end of the Visual area to the end of the
+file.
+
+
+A NUMBER OF LINES
+
+When you know how many lines you want to change, you can type the number and
+then ":". For example, when you type "5:", you will get: >
+
+ :.,.+4
+
+Now you can type the command you want to use. It will use the range "."
+(current line) until ".+4" (four lines down). Thus it spans five lines.
+
+==============================================================================
+*10.4* The global command
+
+The ":global" command is one of the more powerful features of Vim. It allows
+you to find a match for a pattern and execute a command there. The general
+form is: >
+
+ :[range]global/{pattern}/{command}
+
+This is similar to the ":substitute" command. But, instead of replacing the
+matched text with other text, the command {command} is executed.
+
+ Note:
+ The command executed for ":global" must be one that starts with a
+ colon. Normal mode commands can not be used directly. The |:normal|
+ command can do this for you.
+
+Suppose you want to change "foobar" to "barfoo", but only in C++ style
+comments. These comments start with "//". Use this command: >
+
+ :g+//+s/foobar/barfoo/g
+
+This starts with ":g". That is short for ":global", just like ":s" is short
+for ":substitute". Then the pattern, enclosed in plus characters. Since the
+pattern we are looking for contains a slash, this uses the plus character to
+separate the pattern. Next comes the substitute command that changes "foobar"
+into "barfoo".
+ The default range for the global command is the whole file. Thus no range
+was specified in this example. This is different from ":substitute", which
+works on one line without a range.
+ The command isn't perfect, since it also matches lines where "//" appears
+halfway a line, and the substitution will also take place before the "//".
+
+Just like with ":substitute", any pattern can be used. When you learn more
+complicated patterns later, you can use them here.
+
+==============================================================================
+*10.5* Visual block mode
+
+With CTRL-V you can start selection of a rectangular area of text. There are
+a few commands that do something special with the text block.
+
+There is something special about using the "$" command in Visual block mode.
+When the last motion command used was "$", all lines in the Visual selection
+will extend until the end of the line, also when the line with the cursor is
+shorter. This remains effective until you use a motion command that moves the
+cursor horizontally. Thus using "j" keeps it, "h" stops it.
+
+
+INSERTING TEXT
+
+The command "I{string}<Esc>" inserts the text {string} in each line, just
+left of the visual block. You start by pressing CTRL-V to enter visual block
+mode. Now you move the cursor to define your block. Next you type I to enter
+Insert mode, followed by the text to insert. As you type, the text appears on
+the first line only.
+ After you press <Esc> to end the insert, the text will magically be
+inserted in the rest of the lines contained in the visual selection. Example:
+
+ include one ~
+ include two ~
+ include three ~
+ include four ~
+
+Move the cursor to the "o" of "one" and press CTRL-V. Move it down with "3j"
+to "four". You now have a block selection that spans four lines. Now type: >
+
+ Imain.<Esc>
+
+The result:
+
+ include main.one ~
+ include main.two ~
+ include main.three ~
+ include main.four ~
+
+If the block spans short lines that do not extend into the block, the text is
+not inserted in that line. For example, make a Visual block selection that
+includes the word "long" in the first and last line of this text, and thus has
+no text selected in the second line:
+
+ This is a long line ~
+ short ~
+ Any other long line ~
+
+ ^^^^ selected block
+
+Now use the command "Ivery <Esc>". The result is:
+
+ This is a very long line ~
+ short ~
+ Any other very long line ~
+
+In the short line no text was inserted.
+
+If the string you insert contains a newline, the "I" acts just like a Normal
+insert command and affects only the first line of the block.
+
+The "A" command works the same way, except that it appends after the right
+side of the block.
+ There is one special case for "A": Select a Visual block and then use "$"
+to make the block extend to the end of each line. Using "A" now will append
+the text to the end of each line.
+ Using the same example from above, and then typing "$A XXX<Esc>, you get
+this result:
+
+ This is a long line XXX ~
+ short XXX ~
+ Any other long line XXX ~
+
+This really requires using the "$" command. Vim remembers that it was used.
+Making the same selection by moving the cursor to the end of the longest line
+with other movement commands will not have the same result.
+
+
+CHANGING TEXT
+
+The Visual block "c" command deletes the block and then throws you into Insert
+mode to enable you to type in a string. The string will be inserted in each
+line in the block.
+ Starting with the same selection of the "long" words as above, then typing
+"c_LONG_<Esc>", you get this:
+
+ This is a _LONG_ line ~
+ short ~
+ Any other _LONG_ line ~
+
+Just like with "I" the short line is not changed. Also, you can't enter a
+newline in the new text.
+
+The "C" command deletes text from the left edge of the block to the end of
+line. It then puts you in Insert mode so that you can type in a string,
+which is added to the end of each line.
+ Starting with the same text again, and typing "Cnew text<Esc>" you get:
+
+ This is a new text ~
+ short ~
+ Any other new text ~
+
+Notice that, even though only the "long" word was selected, the text after it
+is deleted as well. Thus only the location of the left edge of the visual
+block really matters.
+ Again, short lines that do not reach into the block are excluded.
+
+Other commands that change the characters in the block:
+
+ ~ swap case (a -> A and A -> a)
+ U make uppercase (a -> A and A -> A)
+ u make lowercase (a -> a and A -> a)
+
+
+FILLING WITH A CHARACTER
+
+To fill the whole block with one character, use the "r" command. Again,
+starting with the same example text from above, and then typing "rx":
+
+ This is a xxxx line ~
+ short ~
+ Any other xxxx line ~
+
+
+ Note:
+ If you want to include characters beyond the end of the line in the
+ block, check out the 'virtualedit' feature in chapter 25.
+
+
+SHIFTING
+
+The command ">" shifts the selected text to the right one shift amount,
+inserting whitespace. The starting point for this shift is the left edge of
+the visual block.
+ With the same example again, ">" gives this result:
+
+ This is a long line ~
+ short ~
+ Any other long line ~
+
+The shift amount is specified with the 'shiftwidth' option. To change it to
+use 4 spaces: >
+
+ :set shiftwidth=4
+
+The "<" command removes one shift amount of whitespace at the left
+edge of the block. This command is limited by the amount of text that is
+there; so if there is less than a shift amount of whitespace available, it
+removes what it can.
+
+
+JOINING LINES
+
+The "J" command joins all selected lines together into one line. Thus it
+removes the line breaks. Actually, the line break, leading white space and
+trailing white space is replaced by one space. Two spaces are used after a
+line ending (that can be changed with the 'joinspaces' option).
+ Let's use the example that we got so familiar with now. The result of
+using the "J" command:
+
+ This is a long line short Any other long line ~
+
+The "J" command doesn't require a blockwise selection. It works with "v" and
+"V" selection in exactly the same way.
+
+If you don't want the white space to be changed, use the "gJ" command.
+
+==============================================================================
+*10.6* Reading and writing part of a file
+
+When you are writing an e-mail message, you may want to include another file.
+This can be done with the ":read {filename}" command. The text of the file is
+put below the cursor line.
+ Starting with this text:
+
+ Hi John, ~
+ Here is the diff that fixes the bug: ~
+ Bye, Pierre. ~
+
+Move the cursor to the second line and type: >
+
+ :read patch
+
+The file named "patch" will be inserted, with this result:
+
+ Hi John, ~
+ Here is the diff that fixes the bug: ~
+ 2c2 ~
+ < for (i = 0; i <= length; ++i) ~
+ --- ~
+ > for (i = 0; i < length; ++i) ~
+ Bye, Pierre. ~
+
+The ":read" command accepts a range. The file will be put below the last line
+number of this range. Thus ":$r patch" appends the file "patch" at the end of
+the file.
+ What if you want to read the file above the first line? This can be done
+with the line number zero. This line doesn't really exist, you will get an
+error message when using it with most commands. But this command is allowed:
+>
+ :0read patch
+
+The file "patch" will be put above the first line of the file.
+
+
+WRITING A RANGE OF LINES
+
+To write a range of lines to a file, the ":write" command can be used.
+Without a range it writes the whole file. With a range only the specified
+lines are written: >
+
+ :.,$write tempo
+
+This writes the lines from the cursor until the end of the file into the file
+"tempo". If this file already exists you will get an error message. Vim
+protects you from accidentally overwriting an existing file. If you know what
+you are doing and want to overwrite the file, append !: >
+
+ :.,$write! tempo
+
+CAREFUL: The ! must follow the ":write" command immediately, without white
+space. Otherwise it becomes a filter command, which is explained later in
+this chapter.
+
+
+APPENDING TO A FILE
+
+In the first section of this chapter was explained how to collect a number of
+lines into a register. The same can be done to collect lines in a file.
+Write the first line with this command: >
+
+ :.write collection
+
+Now move the cursor to the second line you want to collect, and type this: >
+
+ :.write >>collection
+
+The ">>" tells Vim the "collection" file is not to be written as a new file,
+but the line must be appended at the end. You can repeat this as many times
+as you like.
+
+==============================================================================
+*10.7* Formatting text
+
+When you are typing plain text, it's nice if the length of each line is
+automatically trimmed to fit in the window. To make this happen while
+inserting text, set the 'textwidth' option: >
+
+ :set textwidth=72
+
+You might remember that in the example vimrc file this command was used for
+every text file. Thus if you are using that vimrc file, you were already
+using it. To check the current value of 'textwidth': >
+
+ :set textwidth
+
+Now lines will be broken to take only up to 72 characters. But when you
+insert text halfway a line, or when you delete a few words, the lines will get
+too long or too short. Vim doesn't automatically reformat the text.
+ To tell Vim to format the current paragraph: >
+
+ gqap
+
+This starts with the "gq" command, which is an operator. Following is "ap",
+the text object that stands for "a paragraph". A paragraph is separated from
+the next paragraph by an empty line.
+
+ Note:
+ A blank line, which contains white space, does NOT separate
+ paragraphs. This is hard to notice!
+
+Instead of "ap" you could use any motion or text object. If your paragraphs
+are properly separated, you can use this command to format the whole file: >
+
+ gggqG
+
+"gg" takes you to the first line, "gq" is the format operator and "G" the
+motion that jumps to the last line.
+
+In case your paragraphs aren't clearly defined, you can format just the lines
+you manually select. Move the cursor to the first line you want to format.
+Start with the command "gqj". This formats the current line and the one below
+it. If the first line was short, words from the next line will be appended.
+If it was too long, words will be moved to the next line. The cursor moves to
+the second line. Now you can use "." to repeat the command. Keep doing this
+until you are at the end of the text you want to format.
+
+==============================================================================
+*10.8* Changing case
+
+You have text with section headers in lowercase. You want to make the word
+"section" all uppercase. Do this with the "gU" operator. Start with the
+cursor in the first column: >
+
+ gUw
+< section header ----> SECTION header
+
+The "gu" operator does exactly the opposite: >
+
+ guw
+< SECTION header ----> section header
+
+You can also use "g~" to swap case. All these are operators, thus they work
+with any motion command, with text objects and in Visual mode.
+ To make an operator work on lines you double it. The delete operator is
+"d", thus to delete a line you use "dd". Similarly, "gugu" makes a whole line
+lowercase. This can be shortened to "guu". "gUgU" is shortened to "gUU" and
+"g~g~" to "g~~". Example: >
+
+ g~~
+< Some GIRLS have Fun ----> sOME girls HAVE fUN ~
+
+==============================================================================
+*10.9* Using an external program
+
+Vim has a very powerful set of commands, it can do anything. But there may
+still be something that an external command can do better or faster.
+ The command "!{motion}{program}" takes a block of text and filters it
+through an external program. In other words, it runs the system command
+represented by {program}, giving it the block of text represented by {motion}
+as input. The output of this command then replaces the selected block.
+ Because this summarizes badly if you are unfamiliar with UNIX filters, take
+a look at an example. The sort command sorts a file. If you execute the
+following command, the unsorted file input.txt will be sorted and written to
+output.txt. (This works on both UNIX and Microsoft Windows.) >
+
+ sort <input.txt >output.txt
+
+Now do the same thing in Vim. You want to sort lines 1 through 5 of a file.
+You start by putting the cursor on line 1. Next you execute the following
+command: >
+
+ !5G
+
+The "!" tells Vim that you are performing a filter operation. The Vim editor
+expects a motion command to follow, indicating which part of the file to
+filter. The "5G" command tells Vim to go to line 5, so it now knows that it
+is to filter lines 1 (the current line) through 5.
+ In anticipation of the filtering, the cursor drops to the bottom of the
+screen and a ! prompt displays. You can now type in the name of the filter
+program, in this case "sort". Therefore, your full command is as follows: >
+
+ !5Gsort<Enter>
+
+The result is that the sort program is run on the first 5 lines. The output
+of the program replaces these lines.
+
+ line 55 line 11
+ line 33 line 22
+ line 11 --> line 33
+ line 22 line 44
+ line 44 line 55
+ last line last line
+
+The "!!" command filters the current line through a filter. In Unix the "date"
+command prints the current time and date. "!!date<Enter>" replaces the current
+line with the output of "date". This is useful to add a timestamp to a file.
+
+
+WHEN IT DOESN'T WORK
+
+Starting a shell, sending it text and capturing the output requires that Vim
+knows how the shell works exactly. When you have problems with filtering,
+check the values of these options:
+
+ 'shell' specifies the program that Vim uses to execute
+ external programs.
+ 'shellcmdflag' argument to pass a command to the shell
+ 'shellquote' quote to be used around the command
+ 'shellxquote' quote to be used around the command and redirection
+ 'shelltype' kind of shell (only for the Amiga)
+ 'shellslash' use forward slashes in the command (only for
+ MS-Windows and alikes)
+ 'shellredir' string used to write the command output into a file
+
+On Unix this is hardly ever a problem, because there are two kinds of shells:
+"sh" like and "csh" like. Vim checks the 'shell' option and sets related
+options automatically, depending on whether it sees "csh" somewhere in
+'shell'.
+ On MS-Windows, however, there are many different shells and you might have
+to tune the options to make filtering work. Check the help for the options
+for more information.
+
+
+READING COMMAND OUTPUT
+
+To read the contents of the current directory into the file, use this:
+
+on Unix: >
+ :read !ls
+on MS-Windows: >
+ :read !dir
+
+The output of the "ls" or "dir" command is captured and inserted in the text,
+below the cursor. This is similar to reading a file, except that the "!" is
+used to tell Vim that a command follows.
+ The command may have arguments. And a range can be used to tell where Vim
+should put the lines: >
+
+ :0read !date -u
+
+This inserts the current time and date in UTC format at the top of the file.
+(Well, if you have a date command that accepts the "-u" argument.) Note the
+difference with using "!!date": that replaced a line, while ":read !date" will
+insert a line.
+
+
+WRITING TEXT TO A COMMAND
+
+The Unix command "wc" counts words. To count the words in the current file: >
+
+ :write !wc
+
+This is the same write command as before, but instead of a file name the "!"
+character is used and the name of an external command. The written text will
+be passed to the specified command as its standard input. The output could
+look like this:
+
+ 4 47 249 ~
+
+The "wc" command isn't verbose. This means you have 4 lines, 47 words and 249
+characters.
+
+Watch out for this mistake: >
+
+ :write! wc
+
+This will write the file "wc" in the current directory, with force. White
+space is important here!
+
+
+REDRAWING THE SCREEN
+
+If the external command produced an error message, the display may have been
+messed up. Vim is very efficient and only redraws those parts of the screen
+that it knows need redrawing. But it can't know about what another program
+has written. To tell Vim to redraw the screen: >
+
+ CTRL-L
+
+==============================================================================
+
+Next chapter: |usr_11.txt| Recovering from a crash
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt
new file mode 100644
index 000000000..28ff3842e
--- /dev/null
+++ b/runtime/doc/usr_11.txt
@@ -0,0 +1,287 @@
+*usr_11.txt* For Vim version 7.0aa. Last change: 2004 Apr 23
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Recovering from a crash
+
+
+Did your computer crash? And you just spent hours editing? Don't panic! Vim
+keeps enough information on harddisk to be able to restore most of your work.
+This chapter shows you how to get your work back and explains how the swap
+file is used.
+
+|11.1| Basic recovery
+|11.2| Where is the swap file?
+|11.3| Crashed or not?
+|11.4| Further reading
+
+ Next chapter: |usr_12.txt| Clever tricks
+ Previous chapter: |usr_10.txt| Making big changes
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*11.1* Basic recovery
+
+In most cases recovering a file is quite simple, assuming you know which file
+you were editing (and the harddisk is still working). Start Vim on the file,
+with the "-r" argument added: >
+
+ vim -r help.txt
+
+Vim will read the swap file (used to store text you were editing) and may read
+bits and pieces of the original file. If all is well, you will see these
+messages (with different file names, of course):
+
+ Using swap file ".help.txt.swp" ~
+ Original file "~/vim/runtime/doc/help.txt" ~
+ Recovery completed. You should check if everything is OK. ~
+ (You might want to write out this file under another name ~
+ and run diff with the original file to check for changes) ~
+ Delete the .swp file afterwards. ~
+
+To be on the safe side, write this file under another name: >
+
+ :write help.txt.recovered
+
+Compare the file with the original file to check if you ended up with what you
+expected. Vimdiff is very useful for this |08.7|. Watch out for the original
+file to contain a more recent version (you saved the file just before the
+computer crashed). And check that no lines are missing (something went wrong
+that Vim could not recover).
+ If Vim produces warning messages when recovering, read them carefully.
+This is rare though.
+
+It's normal that the last few changes can not be recovered. Vim flushes the
+changes to disk when you don't type for about four seconds, or after typing
+about two hundred characters. This is set with the 'updatetime' and
+'updatecount' options. Thus when Vim didn't get a chance to save itself when
+the system went down, the changes after the last flush will be lost.
+
+If you were editing without a file name, give an empty string as argument: >
+
+ vim -r ""
+
+You must be in the right directory, otherwise Vim can't find the swap file.
+
+==============================================================================
+*11.2* Where is the swap file?
+
+Vim can store the swap file in several places. Normally it is in the same
+directory as the original file. To find it, change to the directory of the
+file, and use: >
+
+ vim -r
+
+Vim will list the swap files that it can find. It will also look in other
+directories where the swap file for files in the current directory may be
+located. It will not find swap files in any other directories though, it
+doesn't search the directory tree.
+ The output could look like this:
+
+ Swap files found: ~
+ In current directory: ~
+ 1. .main.c.swp ~
+ owned by: mool dated: Tue May 29 21:00:25 2001 ~
+ file name: ~mool/vim/vim6/src/main.c ~
+ modified: YES ~
+ user name: mool host name: masaka.moolenaar.net ~
+ process ID: 12525 ~
+ In directory ~/tmp: ~
+ -- none -- ~
+ In directory /var/tmp: ~
+ -- none -- ~
+ In directory /tmp: ~
+ -- none -- ~
+
+If there are several swap files that look like they may be the one you want to
+use, a list is given of these swap files and you are requested to enter the
+number of the one you want to use. Carefully look at the dates to decide
+which one you want to use.
+ In case you don't know which one to use, just try them one by one and check
+the resulting files if they are what you expected.
+
+
+USING A SPECIFIC SWAP FILE
+
+If you know which swap file needs to be used, you can recover by giving the
+swap file name. Vim will then finds out the name of the original file from
+the swap file.
+
+Example: >
+ vim -r .help.txt.swo
+
+This is also handy when the swap file is in another directory than expected.
+If this still does not work, see what file names Vim reports and rename the
+files accordingly. Check the 'directory' option to see where Vim may have
+put the swap file.
+
+ Note:
+ Vim tries to find the swap file by searching the directories in the
+ 'dir' option, looking for files that match "filename.sw?". If
+ wildcard expansion doesn't work (e.g., when the 'shell' option is
+ invalid), Vim does a desperate try to find the file "filename.swp".
+ If that fails too, you will have to give the name of the swapfile
+ itself to be able to recover the file.
+
+==============================================================================
+*11.3* Crashed or not? *ATTENTION* *E325*
+
+Vim tries to protect you from doing stupid things. Suppose you innocently
+start editing a file, expecting the contents of the file to show up. Instead,
+Vim produces a very long message:
+
+ E325: ATTENTION ~
+ Found a swap file by the name ".main.c.swp" ~
+ owned by: mool dated: Tue May 29 21:09:28 2001 ~
+ file name: ~mool/vim/vim6/src/main.c ~
+ modified: no ~
+ user name: mool host name: masaka.moolenaar.net ~
+ process ID: 12559 (still running) ~
+ While opening file "main.c" ~
+ dated: Tue May 29 19:46:12 2001 ~
+ ~
+ (1) Another program may be editing the same file. ~
+ If this is the case, be careful not to end up with two ~
+ different instances of the same file when making changes. ~
+ Quit, or continue with caution. ~
+ ~
+ (2) An edit session for this file crashed. ~
+ If this is the case, use ":recover" or "vim -r main.c" ~
+ to recover the changes (see ":help recovery"). ~
+ If you did this already, delete the swap file ".main.c.swp" ~
+ to avoid this message. ~
+
+You get this message, because, when starting to edit a file, Vim checks if a
+swap file already exists for that file. If there is one, there must be
+something wrong. It may be one of these two situations.
+
+1. Another edit session is active on this file. Look in the message for the
+ line with "process ID". It might look like this:
+
+ process ID: 12559 (still running) ~
+
+ The text "(still running)" indicates that the process editing this file
+ runs on the same computer. When working on a non-Unix system you will not
+ get this extra hint. When editing a file over a network, you may not see
+ the hint, because the process might be running on another computer. In
+ those two cases you must find out what the situation is yourself.
+ If there is another Vim editing the same file, continuing to edit will
+ result in two versions of the same file. The one that is written last will
+ overwrite the other one, resulting in loss of changes. You better quit
+ this Vim.
+
+2. The swap file might be the result from a previous crash of Vim or the
+ computer. Check the dates mentioned in the message. If the date of the
+ swap file is newer than the file you were editing, and this line appears:
+
+ modified: YES ~
+
+ Then you very likely have a crashed edit session that is worth recovering.
+ If the date of the file is newer than the date of the swap file, then
+ either it was changed after the crash (perhaps you recovered it earlier,
+ but didn't delete the swap file?), or else the file was saved before the
+ crash but after the last write of the swap file (then you're lucky: you
+ don't even need that old swap file). Vim will warn you for this with this
+ extra line:
+
+ NEWER than swap file! ~
+
+
+UNREADABLE SWAP FILE
+
+Sometimes the line
+
+ [cannot be read] ~
+
+will appear under the name of the swap file. This can be good or bad,
+depending on circumstances.
+
+It is good if a previous editing session crashed without having made any
+changes to the file. Then a directory listing of the swap file will show
+that it has zero bytes. You may delete it and proceed.
+
+It is slightly bad if you don't have read permission for the swap file. You
+may want to view the file read-only, or quit. On multi-user systems, if you
+yourself did the last changes under a different login name, a logout
+followed by a login under that other name might cure the "read error". Or
+else you might want to find out who last edited (or is editing) the file and
+have a talk with them.
+
+It is very bad if it means there is a physical read error on the disk
+containing the swap file. Fortunately, this almost never happens.
+You may want to view the file read-only at first (if you can), to see the
+extent of the changes that were "forgotten". If you are the one in charge of
+that file, be prepared to redo your last changes.
+
+
+WHAT TO DO?
+
+If dialogs are supported you will be asked to select one of five choices:
+
+ Swap file ".main.c.swp" already exists! ~
+ [O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort, (D)elete it: ~
+
+O Open the file readonly. Use this when you just want to view the file and
+ don't need to recover it. You might want to use this when you know someone
+ else is editing the file, but you just want to look in it and not make
+ changes.
+
+E Edit the file anyway. Use this with caution! If the file is being edited
+ in another Vim, you might end up with two versions of the file. Vim will
+ try to warn you when this happens, but better be safe then sorry.
+
+R Recover the file from the swap file. Use this if you know that the swap
+ file contains changes that you want to recover.
+
+Q Quit. This avoids starting to edit the file. Use this if there is another
+ Vim editing the same file.
+ When you just started Vim, this will exit Vim. When starting Vim with
+ files in several windows, Vim quits only if there is a swap file for the
+ first one. When using an edit command, the file will not be loaded and you
+ are taken back to the previously edited file.
+
+A Abort. Like Quit, but also abort further commands. This is useful when
+ loading a script that edits several files, such as a session with multiple
+ windows.
+
+D Delete the swap file. Use this when you are sure you no longer need it.
+ For example, when it doesn't contain changes, or when the file itself is
+ newer than the swap file.
+ On Unix this choice is only offered when the process that created the
+ swap file does not appear to be running.
+
+If you do not get the dialog (you are running a version of Vim that does not
+support it), you will have to do it manually. To recover the file, use this
+command: >
+
+ :recover
+
+
+Vim cannot always detect that a swap file already exists for a file. This is
+the case when the other edit session puts the swap files in another directory
+or when the path name for the file is different when editing it on different
+machines. Therefore, don't rely on Vim always warning you.
+
+If you really don't want to see this message, you can add the 'A' flag to the
+'shortmess' option. But it's very unusual that you need this.
+
+==============================================================================
+*11.4* Further reading
+
+|swap-file| An explanation about where the swap file will be created and
+ what its name is.
+|:preserve| Manually flushing the swap file to disk.
+|:swapname| See the name of the swap file for the current file.
+'updatecount' Number of key strokes after which the swap file is flushed to
+ disk.
+'updatetime' Timeout after which the swap file is flushed to disk.
+'swapsync' Whether the disk is synced when the swap file is flushed.
+'directory' List of directory names where to store the swap file.
+'maxmem' Limit for memory usage before writing text to the swap file.
+'maxmemtot' Same, but for all files in total.
+
+==============================================================================
+
+Next chapter: |usr_12.txt| Clever tricks
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_12.txt b/runtime/doc/usr_12.txt
new file mode 100644
index 000000000..6abf24659
--- /dev/null
+++ b/runtime/doc/usr_12.txt
@@ -0,0 +1,358 @@
+*usr_12.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Clever tricks
+
+
+By combining several commands you can make Vim do nearly everything. In this
+chapter a number of useful combinations will be presented. This uses the
+commands introduced in the previous chapters and a few more.
+
+|12.1| Replace a word
+|12.2| Change "Last, First" to "First Last"
+|12.3| Sort a list
+|12.4| Reverse line order
+|12.5| Count words
+|12.6| Find a man page
+|12.7| Trim blanks
+|12.8| Find where a word is used
+
+ Next chapter: |usr_20.txt| Typing command-line commands quickly
+ Previous chapter: |usr_11.txt| Recovering from a crash
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*12.1* Replace a word
+
+The substitute command can be used to replace all occurrences of a word with
+another word: >
+
+ :%s/four/4/g
+
+The "%" range means to replace in all lines. The "g" flag at the end causes
+all words in a line to be replaced.
+ This will not do the right thing if your file also contains "thirtyfour".
+It would be replaced with "thirty4". To avoid this, use the "\<" item to
+match the start of a word: >
+
+ :%s/\<four/4/g
+
+Obviously, this still goes wrong on "fourty". Use "\>" to match the end of a
+word: >
+
+ :%s/\<four\>/4/g
+
+If you are programming, you might want to replace "four" in comments, but not
+in the code. Since this is difficult to specify, add the "c" flag to have the
+substitute command prompt you for each replacement: >
+
+
+ :%s/\<four\>/4/gc
+
+
+REPLACING IN SEVERAL FILES
+
+Suppose you want to replace a word in more than one file. You could edit each
+file and type the command manually. It's a lot faster to use record and
+playback.
+ Let's assume you have a directory with C++ files, all ending in ".cpp".
+There is a function called "GetResp" that you want to rename to "GetAnswer".
+
+ vim *.cpp Start Vim, defining the argument list to
+ contain all the C++ files. You are now in the
+ first file.
+ qq Start recording into the q register
+ :%s/\<GetResp\>/GetAnswer/g
+ Do the replacements in the first file.
+ :wnext Write this file and move to the next one.
+ q Stop recording.
+ @q Execute the q register. This will replay the
+ substitution and ":wnext". You can verify
+ that this doesn't produce an error message.
+ 999@q Execute the q register on the remaining files.
+
+At the last file you will get an error message, because ":wnext" cannot move
+to the next file. This stops the execution, and everything is done.
+
+ Note:
+ When playing back a recorded sequence, an error stops the execution.
+ Therefore, make sure you don't get an error message when recording.
+
+There is one catch: If one of the .cpp files does not contain the word
+"GetResp", you will get an error and replacing will stop. To avoid this, add
+the "e" flag to the substitute command: >
+
+ :%s/\<GetResp\>/GetAnswer/ge
+
+The "e" flag tells ":substitute" that not finding a match is not an error.
+
+==============================================================================
+*12.2* Change "Last, First" to "First Last"
+
+You have a list of names in this form:
+
+ Doe, John ~
+ Smith, Peter ~
+
+You want to change that to:
+
+ John Doe ~
+ Peter Smith ~
+
+This can be done with just one command: >
+
+ :%s/\([^,]*\), \(.*\)/\2 \1/
+
+Let's break this down in parts. Obviously it starts with a substitute
+command. The "%" is the line range, which stands for the whole file. Thus
+the substitution is done in every line in the file.
+ The arguments for the substitute command are "/from/to/". The slashes
+separate the "from" pattern and the "to" string. This is what the "from"
+pattern contains:
+ \([^,]*\), \(.*\) ~
+
+ The first part between \( \) matches "Last" \( \)
+ match anything but a comma [^,]
+ any number of times *
+ matches ", " literally ,
+ The second part between \( \) matches "First" \( \)
+ any character .
+ any number of times *
+
+In the "to" part we have "\2" and "\1". These are called backreferences.
+They refer to the text matched by the "\( \)" parts in the pattern. "\2"
+refers to the text matched by the second "\( \)", which is the "First" name.
+"\1" refers to the first "\( \)", which is the "Last" name.
+ You can use up to nine backreferences in the "to" part of a substitute
+command. "\0" stands for the whole matched pattern. There are a few more
+special items in a substitute command, see |sub-replace-special|.
+
+==============================================================================
+*12.3* Sort a list
+
+In a Makefile you often have a list of files. For example:
+
+ OBJS = \ ~
+ version.o \ ~
+ pch.o \ ~
+ getopt.o \ ~
+ util.o \ ~
+ getopt1.o \ ~
+ inp.o \ ~
+ patch.o \ ~
+ backup.o ~
+
+To sort this list, filter the text through the external sort command: >
+
+ /^OBJS
+ j
+ :.,/^$/-1!sort
+
+This goes to the first line, where "OBJS" is the first thing in the line.
+Then it goes one line down and filters the lines until the next empty line.
+You could also select the lines in Visual mode and then use "!sort". That's
+easier to type, but more work when there are many lines.
+ The result is this:
+
+ OBJS = \ ~
+ backup.o ~
+ getopt.o \ ~
+ getopt1.o \ ~
+ inp.o \ ~
+ patch.o \ ~
+ pch.o \ ~
+ util.o \ ~
+ version.o \ ~
+
+
+Notice that a backslash at the end of each line is used to indicate the line
+continues. After sorting, this is wrong! The "backup.o" line that was at
+the end didn't have a backslash. Now that it sorts to another place, it
+must have a backslash.
+ The simplest solution is to add the backslash with "A \<Esc>". You can
+keep the backslash in the last line, if you make sure an empty line comes
+after it. That way you don't have this problem again.
+
+==============================================================================
+*12.4* Reverse line order
+
+The |:global| command can be combined with the |:move| command to move all the
+lines before the first line, resulting in a reversed file. The command is: >
+
+ :global/^/m 0
+
+Abbreviated: >
+
+ :g/^/m 0
+
+The "^" regular expression matches the beginning of the line (even if the line
+is blank). The |:move| command moves the matching line to after the mythical
+zeroth line, so the current matching line becomes the first line of the file.
+As the |:global| command is not confused by the changing line numbering,
+|:global| proceeds to match all remaining lines of the file and puts each as
+the first.
+
+This also works on a range of lines. First move to above the first line and
+mark it with "mt". Then move the cursor to the last line in the range and
+type: >
+
+ :'t+1,.g/^/m 't
+
+==============================================================================
+*12.5* Count words
+
+Sometimes you have to write a text with a maximum number of words. Vim can
+count the words for you.
+ When the whole file is what you want to count the words in, use this
+command: >
+
+ g CTRL-G
+
+Do not type a space after the g, this is just used here to make the command
+easy to read.
+ The output looks like this:
+
+ Col 1 of 0; Line 141 of 157; Word 748 of 774; Byte 4489 of 4976 ~
+
+You can see on which word you are (748), and the total number of words in the
+file (774).
+
+When the text is only part of a file, you could move to the start of the text,
+type "g CTRL-G", move to the end of the text, type "g CTRL-G" again, and then
+use your brain to compute the difference in the word position. That's a good
+exercise, but there is an easier way. With Visual mode, select the text you
+want to count words in. Then type g CTRL-G. The result:
+
+ Selected 5 of 293 Lines; 70 of 1884 Words; 359 of 10928 Bytes ~
+
+For other ways to count words, lines and other items, see |count-items|.
+
+==============================================================================
+*12.6* Find a man page *find-manpage*
+
+While editing a shell script or C program, you are using a command or function
+that you want to find the man page for (this is on Unix). Let's first use a
+simple way: Move the cursor to the word you want to find help on and press >
+
+ K
+
+Vim will run the external "man" program on the word. If the man page is
+found, it is displayed. This uses the normal pager to scroll through the text
+(mostly the "more" program). When you get to the end pressing <Enter> will
+get you back into Vim.
+
+A disadvantage is that you can't see the man page and the text you are working
+on at the same time. There is a trick to make the man page appear in a Vim
+window. First, load the man filetype plugin: >
+
+ :runtime! ftplugin/man.vim
+
+Put this command in your vimrc file if you intend to do this often. Now you
+can use the ":Man" command to open a window on a man page: >
+
+ :Man csh
+
+You can scroll around and the text is highlighted. This allows you to find
+the help you were looking for. Use CTRL-W w to jump to the window with the
+text you were working on.
+ To find a man page in a specific section, put the section number first.
+For example, to look in section 3 for "echo": >
+
+ :Man 3 echo
+
+To jump to another man page, which is in the text with the typical form
+"word(1)", press CTRL-] on it. Further ":Man" commands will use the same
+window.
+
+To display a man page for the word under the cursor, use this: >
+
+ \K
+
+(If you redefined the <Leader>, use it instead of the backslash).
+For example, you want to know the return value of "strstr()" while editing
+this line:
+
+ if (strstr(input, "aap") == ) ~
+
+Move the cursor to somewhere on "strstr" and type "\K". A window will open
+to display the man page for strstr().
+
+==============================================================================
+*12.7* Trim blanks
+
+Some people find spaces and tabs at the end of a line useless, wasteful, and
+ugly. To remove whitespace at the end of every line, execute the following
+command: >
+
+ :%s/\s\+$//
+
+The line range "%" is used, thus this works on the whole file. The pattern
+that the ":substitute" command matches with is "\s\+$". This finds white
+space characters (\s), 1 or more of them (\+), before the end-of-line ($).
+Later will be explained how you write patterns like this |usr_27.txt|.
+ The "to" part of the substitute command is empty: "//". Thus it replaces
+with nothing, effectively deleting the matched white space.
+
+Another wasteful use of spaces is placing them before a Tab. Often these can
+be deleted without changing the amount of white space. But not always!
+Therefore, you can best do this manually. Use this search command: >
+
+ /
+
+You cannot see it, but there is a space before a tab in this command. Thus
+it's "/<Space><Tab>". Now use "x" to delete the space and check that the
+amount of white space doesn't change. You might have to insert a Tab if it
+does change. Type "n" to find the next match. Repeat this until no more
+matches can be found.
+
+==============================================================================
+*12.8* Find where a word is used
+
+If you are a UNIX user, you can use a combination of Vim and the grep command
+to edit all the files that contain a given word. This is extremely useful if
+you are working on a program and want to view or edit all the files that
+contain a specific variable.
+ For example, suppose you want to edit all the C program files that contain
+the word "frame_counter". To do this you use the command: >
+
+ vim `grep -l frame_counter *.c`
+
+Let's look at this command in detail. The grep command searches through a set
+of files for a given word. Because the -l argument is specified, the command
+will only list the files containing the word and not print the matching lines.
+The word it is searching for is "frame_counter". Actually, this can be any
+regular expression. (Note: What grep uses for regular expressions is not
+exactly the same as what Vim uses.)
+ The entire command is enclosed in backticks (`). This tells the UNIX shell
+to run this command and pretend that the results were typed on the command
+line. So what happens is that the grep command is run and produces a list of
+files, these files are put on the Vim command line. This results in Vim
+editing the file list that is the output of grep. You can then use commands
+like ":next" and ":first" to browse through the files.
+
+
+FINDING EACH LINE
+
+The above command only finds the files in which the word is found. You still
+have to find the word within the files.
+ Vim has a built-in command that you can use to search a set of files for a
+given string. If you want to find all occurrences of "error_string" in all C
+program files, for example, enter the following command: >
+
+ :grep error_string *.c
+
+This causes Vim to search for the string "error_string" in all the specified
+files (*.c). The editor will now open the first file where a match is found
+and position the cursor on the first matching line. To go to the next
+matching line (no matter in what it is file), use the ":cnext" command. To go
+to the previous match, use the ":cprev" command. Use ":clist" to see all the
+matches and where they are.
+ The ":grep" command uses the external commands grep (on Unix) or findstr
+(on Windows). You can change this by setting the option 'grepprg'.
+
+==============================================================================
+
+Next chapter: |usr_20.txt| Typing command-line commands quickly
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt
new file mode 100644
index 000000000..a489a46e9
--- /dev/null
+++ b/runtime/doc/usr_20.txt
@@ -0,0 +1,384 @@
+*usr_20.txt* For Vim version 7.0aa. Last change: 2003 Apr 30
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Typing command-line commands quickly
+
+
+Vim has a few generic features that makes it easier to enter commands. Colon
+commands can be abbreviated, edited and repeated. Completion is available for
+nearly everything.
+
+|20.1| Command line editing
+|20.2| Command line abbreviations
+|20.3| Command line completion
+|20.4| Command line history
+|20.5| Command line window
+
+ Next chapter: |usr_21.txt| Go away and come back
+ Previous chapter: |usr_12.txt| Clever tricks
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*20.1* Command line editing
+
+When you use a colon (:) command or search for a string with / or ?, Vim puts
+the cursor on the bottom of the screen. There you type the command or search
+pattern. This is called the Command line. Also when it's used for entering a
+search command.
+
+The most obvious way to edit the command you type is by pressing the <BS> key.
+This erases the character before the cursor. To erase another character,
+typed earlier, first move the cursor with the cursor keys.
+ For example, you have typed this: >
+
+ :s/col/pig/
+
+Before you hit <Enter>, you notice that "col" should be "cow". To correct
+this, you type <Left> five times. The cursor is now just after "col". Type
+<BS> and "w" to correct: >
+
+ :s/cow/pig/
+
+Now you can press <Enter> directly. You don't have to move the cursor to the
+end of the line before executing the command.
+
+The most often used keys to move around in the command line:
+
+ <Left> one character left
+ <Right> one character right
+ <S-Left> or <C-Left> one word left
+ <S-Right> or <C-Right> one word right
+ CTRL-B or <Home> to begin of command line
+ CTRL-E or <End> to end of command line
+
+ Note:
+ <S-Left> (cursor left key with Shift key pressed) and <C-Left> (cursor
+ left key with Control pressed) will not work on all keyboards. Same
+ for the other Shift and Control combinations.
+
+You can also use the mouse to move the cursor.
+
+
+DELETING
+
+As mentioned, <BS> deletes the character before the cursor. To delete a whole
+word use CTRL-W.
+
+ /the fine pig ~
+
+ CTRL-W
+
+ /the fine ~
+
+CTRL-U removes all text, thus allows you to start all over again.
+
+
+OVERSTRIKE
+
+The <Insert> key toggles between inserting characters and replacing the
+existing ones. Start with this text:
+
+ /the fine pig ~
+
+Move the cursor to the start of "fine" with <S-Left> twice (or <Left> eight
+times, if <S-Left> doesn't work). Now press <Insert> to switch to overstrike
+and type "great":
+
+ /the greatpig ~
+
+Oops, we lost the space. Now, don't use <BS>, because it would delete the
+"t" (this is different from Replace mode). Instead, press <Insert> to switch
+from overstrike to inserting, and type the space:
+
+ /the great pig ~
+
+
+CANCELLING
+
+You thought of executing a : or / command, but changed your mind. To get rid
+of what you already typed, without executing it, press CTRL-C or <Esc>.
+
+ Note:
+ <Esc> is the universal "get out" key. Unfortunately, in the good old
+ Vi pressing <Esc> in a command line executed the command! Since that
+ might be considered to be a bug, Vim uses <Esc> to cancel the command.
+ But with the 'cpoptions' option it can be made Vi compatible. And
+ when using a mapping (which might be written for Vi) <Esc> also works
+ Vi compatible. Therefore, using CTRL-C is a method that always works.
+
+If you are at the start of the command line, pressing <BS> will cancel the
+command. It's like deleting the ":" or "/" that the line starts with.
+
+==============================================================================
+*20.2* Command line abbreviations
+
+Some of the ":" commands are really long. We already mentioned that
+":substitute" can be abbreviated to ":s". This is a generic mechanism, all
+":" commands can be abbreviated.
+
+How short can a command get? There are 26 letters, and many more commands.
+For example, ":set" also starts with ":s", but ":s" doesn't start a ":set"
+command. Instead ":set" can be abbreviated to ":se".
+ When the shorter form of a command could be used for two commands, it
+stands for only one of them. There is no logic behind which one, you have to
+learn them. In the help files the shortest form that works is mentioned. For
+example: >
+
+ :s[ubstitute]
+
+This means that the shortest form of ":substitute" is ":s". The following
+characters are optional. Thus ":su" and ":sub" also work.
+
+In the user manual we will either use the full name of command, or a short
+version that is still readable. For example, ":function" can be abbreviated
+to ":fu". But since most people don't understand what that stands for, we
+will use ":fun". (Vim doesn't have a ":funny" command, otherwise ":fun" would
+be confusing too.)
+
+It is recommended that in Vim scripts you write the full command name. That
+makes it easier to read back when you make later changes. Except for some
+often used commands like ":w" (":write") and ":r" (":read").
+ A particularly confusing one is ":end", which could stand for ":endif",
+":endwhile" or ":endfunction". Therefore, always use the full name.
+
+
+SHORT OPTION NAMES
+
+In the user manual the long version of the option names is used. Many options
+also have a short name. Unlike ":" commands, there is only one short name
+that works. For example, the short name of 'autoindent' is 'ai'. Thus these
+two commands do the same thing: >
+
+ :set autoindent
+ :set ai
+
+You can find the full list of long and short names here: |option-list|.
+
+==============================================================================
+*20.3* Command line completion
+
+This is one of those Vim features that, by itself, is a reason to switch from
+Vi to Vim. Once you have used this, you can't do without.
+
+Suppose you have a directory that contains these files:
+
+ info.txt
+ intro.txt
+ bodyofthepaper.txt
+
+To edit the last one, you use the command: >
+
+ :edit bodyofthepaper.txt
+
+It's easy to type this wrong. A much quicker way is: >
+
+ :edit b<Tab>
+
+Which will result in the same command. What happened? The <Tab> key does
+completion of the word before the cursor. In this case "b". Vim looks in the
+directory and finds only one file that starts with a "b". That must be the
+one you are looking for, thus Vim completes the file name for you.
+
+Now type: >
+
+ :edit i<Tab>
+
+Vim will beep, and give you: >
+
+ :edit info.txt
+
+The beep means that Vim has found more than one match. It then uses the first
+match it found (alphabetically). If you press <Tab> again, you get: >
+
+ :edit intro.txt
+
+Thus, if the first <Tab> doesn't give you the file you were looking for, press
+it again. If there are more matches, you will see them all, one at a time.
+ If you press <Tab> on the last matching entry, you will go back to what you
+first typed: >
+
+ :edit i
+
+Then it starts all over again. Thus Vim cycles through the list of matches.
+Use CTRL-P to go through the list in the other direction:
+
+ <------------------- <Tab> -------------------------+
+ |
+ <Tab> --> <Tab> -->
+ :edit i :edit info.txt :edit intro.txt
+ <-- CTRL-P <-- CTRL-P
+ |
+ +---------------------- CTRL-P ------------------------>
+
+
+CONTEXT
+
+When you type ":set i" instead of ":edit i" and press <Tab> you get: >
+
+ :set icon
+
+Hey, why didn't you get ":set info.txt"? That's because Vim has context
+sensitive completion. The kind of words Vim will look for depends on the
+command before it. Vim knows that you cannot use a file name just after a
+":set" command, but you can use an option name.
+ Again, if you repeat typing the <Tab>, Vim will cycle through all matches.
+There are quite a few, it's better to type more characters first: >
+
+ :set isk<Tab>
+
+Gives: >
+
+ :set iskeyword
+
+Now type "=" and press <Tab>: >
+
+ :set iskeyword=@,48-57,_,192-255
+
+What happens here is that Vim inserts the old value of the option. Now you
+can edit it.
+ What is completed with <Tab> is what Vim expects in that place. Just try
+it out to see how it works. In some situations you will not get what you
+want. That's either because Vim doesn't know what you want, or because
+completion was not implemented for that situation. In that case you will get
+a <Tab> inserted (displayed as ^I).
+
+
+LIST MATCHES
+
+When there are many matches, you would like to see an overview. Do this by
+pressing CTRL-D. For example, pressing CTRL-D after: >
+
+ :set is
+
+results in: >
+
+ :set is
+ incsearch isfname isident iskeyword isprint
+ :set is
+
+Vim lists the matches and then comes back with the text you typed. You can
+now check the list for the item you wanted. If it isn't there, you can use
+<BS> to correct the word. If there are many matches, type a few more
+characters before pressing <Tab> to complete the rest.
+ If you have watched carefully, you will have noticed that "incsearch"
+doesn't start with "is". In this case "is" stands for the short name of
+"incsearch". (Many options have a short and a long name.) Vim is clever
+enough to know that you might have wanted to expand the short name of the
+option into the long name.
+
+
+THERE IS MORE
+
+The CTRL-L command completes the word to the longest unambiguous string. If
+you type ":edit i" and there are files "info.txt" and "info_backup.txt" you
+will get ":edit info".
+
+The 'wildmode' option can be used to change the way completion works.
+The 'wildmenu' option can be used to get a menu-like list of matches.
+Use the 'suffixes' option to specify files that are less important and appear
+at the end of the list of files.
+The 'wildignore' option specifies files that are not listed at all.
+
+More about all of this here: |cmdline-completion|
+
+==============================================================================
+*20.4* Command line history
+
+In chapter 3 we briefly mentioned the history. The basics are that you can
+use the <Up> key to recall an older command line. <Down> then takes you back
+to newer commands.
+
+There are actually four histories. The ones we will mention here are for ":"
+commands and for "/" and "?" search commands. The "/" and "?" commands share
+the same history, because they are both search commands. The two other
+histories are for expressions and input lines for the input() function.
+|cmdline-history|
+
+Suppose you have done a ":set" command, typed ten more colon commands and then
+want to repeat that ":set" command again. You could press ":" and then ten
+times <Up>. There is a quicker way: >
+
+ :se<Up>
+
+Vim will now go back to the previous command that started with "se". You have
+a good chance that this is the ":set" command you were looking for. At least
+you should not have to press <Up> very often (unless ":set" commands is all
+you have done).
+
+The <Up> key will use the text typed so far and compare it with the lines in
+the history. Only matching lines will be used.
+ If you do not find the line you were looking for, use <Down> to go back to
+what you typed and correct that. Or use CTRL-U to start all over again.
+
+To see all the lines in the history: >
+
+ :history
+
+That's the history of ":" commands. The search history is displayed with this
+command: >
+
+ :history /
+
+CTRL-P will work like <Up>, except that it doesn't matter what you already
+typed. Similarly for CTRL-N and <Down>. CTRL-P stands for previous, CTRL-N
+for next.
+
+==============================================================================
+*20.5* Command line window
+
+Typing the text in the command line works different from typing text in Insert
+mode. It doesn't allow many commands to change the text. For most commands
+that's OK, but sometimes you have to type a complicated command. That's where
+the command line window is useful.
+
+Open the command line window with this command: >
+
+ q:
+
+Vim now opens a (small) window at the bottom. It contains the command line
+history, and an empty line at the end:
+
+ +-------------------------------------+
+ |other window |
+ |~ |
+ |file.txt=============================|
+ |:e c |
+ |:e config.h.in |
+ |:set path=.,/usr/include,, |
+ |:set iskeyword=@,48-57,_,192-255 |
+ |:set is |
+ |:q |
+ |: |
+ |command-line=========================|
+ | |
+ +-------------------------------------+
+
+You are now in Normal mode. You can use the "hjkl" keys to move around. For
+example, move up with "5k" to the ":e config.h.in" line. Type "$h" to go to
+the "i" of "in" and type "cwout". Now you have changed the line to:
+
+ :e config.h.out ~
+
+Now press <Enter> and this command will be executed. The command line window
+will close.
+ The <Enter> command will execute the line under the cursor. It doesn't
+matter whether Vim is in Insert mode or in Normal mode.
+ Changes in the command line window are lost. They do not result in the
+history to be changed. Except that the command you execute will be added to
+the end of the history, like with all executed commands.
+
+The command line window is very useful when you want to have overview of the
+history, lookup a similar command, change it a bit and execute it. A search
+command can be used to find something.
+ In the previous example the "?config" search command could have been used
+to find the previous command that contains "config". It's a bit strange,
+because you are using a command line to search in the command line window.
+While typing that search command you can't open another command line window,
+there can be only one.
+
+==============================================================================
+
+Next chapter: |usr_21.txt| Go away and come back
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt
new file mode 100644
index 000000000..a277b1375
--- /dev/null
+++ b/runtime/doc/usr_21.txt
@@ -0,0 +1,456 @@
+*usr_21.txt* For Vim version 7.0aa. Last change: 2004 Mar 29
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Go away and come back
+
+
+This chapter goes into mixing the use of other programs with Vim. Either by
+executing program from inside Vim or by leaving Vim and coming back later.
+Furthermore, this is about the ways to remember the state of Vim and restore
+it later.
+
+|21.1| Suspend and resume
+|21.2| Executing shell commands
+|21.3| Remembering information; viminfo
+|21.4| Sessions
+|21.5| Views
+|21.6| Modelines
+
+ Next chapter: |usr_22.txt| Finding the file to edit
+ Previous chapter: |usr_20.txt| Typing command-line commands quickly
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*21.1* Suspend and resume
+
+Like most Unix programs Vim can be suspended by pressing CTRL-Z. This stops
+Vim and takes you back to the shell it was started in. You can then do any
+other commands until you are bored with them. Then bring back Vim with the
+"fg" command. >
+
+ CTRL-Z
+ {any sequence of shell commands}
+ fg
+
+You are right back where you left Vim, nothing has changed.
+ In case pressing CTRL-Z doesn't work, you can also use ":suspend".
+Don't forget to bring Vim back to the foreground, you would lose any changes
+that you made!
+
+Only Unix has support for this. On other systems Vim will start a shell for
+you. This also has the functionality of being able to execute shell commands.
+But it's a new shell, not the one that you started Vim from.
+ When you are running the GUI you can't go back to the shell where Vim was
+started. CTRL-Z will minimize the Vim window instead.
+
+==============================================================================
+*21.2* Executing shell commands
+
+To execute a single shell command from Vim use ":!{command}". For example, to
+see a directory listing: >
+
+ :!ls
+ :!dir
+
+The first one is for Unix, the second one for MS-Windows.
+ Vim will execute the program. When it ends you will get a prompt to hit
+<Enter>. This allows you to have a look at the output from the command before
+returning to the text you were editing.
+ The "!" is also used in other places where a program is run. Let's take
+a look at an overview:
+
+ :!{program} execute {program}
+ :r !{program} execute {program} and read its output
+ :w !{program} execute {program} and send text to its input
+ :[range]!{program} filter text through {program}
+
+Notice that the precense of a range before "!{program}" makes a big
+difference. Without it executes the program normally, with the range a number
+of text lines is filtered through the program.
+
+Executing a whole row of programs this way is possible. But a shell is much
+better at it. You can start a new shell this way: >
+
+ :shell
+
+This is similar to using CTRL-Z to suspend Vim. The difference is that a new
+shell is started.
+
+When using the GUI the shell will be using the Vim window for its input and
+output. Since Vim is not a terminal emulator, this will not work perfectly.
+If you have trouble, try toggling the 'guipty' option. If this still doesn't
+work well enough, start a new terminal to run the shell in. For example with:
+>
+ :!xterm&
+
+==============================================================================
+*21.3* Remembering information; viminfo
+
+After editing for a while you will have text in registers, marks in various
+files, a command line history filled with carefully crafted commands. When
+you exit Vim all of this is lost. But you can get it back!
+
+The viminfo file is designed to store status information:
+
+ Command-line and Search pattern history
+ Text in registers
+ Marks for various files
+ The buffer list
+ Global variables
+
+Each time you exit Vim it will store this information in a file, the viminfo
+file. When Vim starts again, the viminfo file is read and the information
+restored.
+
+The 'viminfo' option is set by default to restore a limited number of items.
+You might want to set it to remember more information. This is done through
+the following command: >
+
+ :set viminfo=string
+
+The string specifies what to save. The syntax of this string is an option
+character followed by an argument. The option/argument pairs are separated by
+commas.
+ Take a look at how you can build up your own viminfo string. First, the '
+option is used to specify how many files for which you save marks (a-z). Pick
+a nice even number for this option (1000, for instance). Your command now
+looks like this: >
+
+ :set viminfo='1000
+
+The f option controls whether global marks (A-Z and 0-9) are stored. If this
+option is 0, none are stored. If it is 1 or you do not specify an f option,
+the marks are stored. You want this feature, so now you have this: >
+
+ :set viminfo='1000,f1
+
+The < option controls how many lines are saved for each of the registers. By
+default, all the lines are saved. If 0, nothing is saved. To avoid adding
+thousands of lines to your viminfo file (which might never get used and makes
+starting Vim slower) you use a maximum of 500 lines: >
+
+ :set viminfo='1000,f1,<500
+<
+Other options you might want to use:
+ : number of lines to save from the command line history
+ @ number of lines to save from the input line history
+ / number of lines to save from the search history
+ r removable media, for which no marks will be stored (can be
+ used several times)
+ ! global variables that start with an uppercase letter and
+ don't contain lowercase letters
+ h disable 'hlsearch' highlighting when starting
+ % the buffer list (only restored when starting Vim without file
+ arguments)
+ c convert the text using 'encoding'
+ n name used for the viminfo file (must be the last option)
+
+See the 'viminfo' option and |viminfo-file| for more information.
+
+When you run Vim multiple times, the last one exiting will store its
+information. This may cause information that previously exiting Vims stored
+to be lost. Each item can be remembered only once.
+
+
+GETTING BACK TO WHERE YOU WERE
+
+You are halfway editing a file and it's time to leave for holidays. You exit
+Vim and go enjoy yourselves, forgetting all about your work. After a couple
+of weeks you start Vim, and type:
+>
+ '0
+
+And you are right back where you left Vim. So you can get on with your work.
+ Vim creates a mark each time you exit Vim. The last one is '0. The
+position that '0 pointed to is made '1. And '1 is made to '2, and so forth.
+Mark '9 is lost.
+ The ":marks" command is useful to find out where '0 to '9 will take you.
+
+
+MOVE INFO FROM ONE VIM TO ANOTHER
+
+You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
+information while still running Vim. This is useful for exchanging register
+contents between two instances of Vim, for example. In the first Vim do: >
+
+ :wviminfo! ~/tmp/viminfo
+
+And in the second Vim do: >
+
+ :rviminfo! ~/tmp/viminfo
+
+Obviously, the "w" stands for "write" and the "r" for "read".
+ The ! character is used by ":wviminfo" to forcefully overwrite an existing
+file. When it is omitted, and the file exists, the information is merged into
+the file.
+ The ! character used for ":rviminfo" means that all the information is
+used, this may overwrite existing information. Without the ! only information
+that wasn't set is used.
+ These commands can also be used to store info and use it again later. You
+could make a directory full of viminfo files, each containing info for a
+different purpose.
+
+==============================================================================
+*21.4* Sessions
+
+Suppose you are editing along, and it is the end of the day. You want to quit
+work and pick up where you left off the next day. You can do this by saving
+your editing session and restoring it the next day.
+ A Vim session contains all the information about what you are editing.
+This includes things such as the file list, window layout, global variables,
+options and other information. (Exactly what is remembered is controlled by
+the 'sessionoptions' option, described below.)
+ The following command creates a session file: >
+
+ :mksession vimbook.vim
+
+Later if you want to restore this session, you can use this command: >
+
+ :source vimbook.vim
+
+If you want to start Vim and restore a specific session, you can use the
+following command: >
+
+ vim -S vimbook.vim
+
+This tells Vim to read a specific file on startup. The 'S' stands for
+session (actually, you can source any Vim script with -S, thus it might as
+well stand for "source").
+
+The windows that were open are restored, with the same position and size as
+before. Mappings and option values are like before.
+ What exactly is restored depends on the 'sessionoptions' option. The
+default value is "blank,buffers,curdir,folds,help,options,winsize".
+
+ blank keep empty windows
+ buffers all buffers, not only the ones in a window
+ curdir the current directory
+ folds folds, also manually created ones
+ help the help window
+ options all options and mappings
+ winsize window sizes
+
+Change this to your liking. To also restore the size of the Vim window, for
+example, use: >
+
+ :set sessionoptions+=resize
+
+
+SESSION HERE, SESSION THERE
+
+The obvious way to use sessions is when working on different projects.
+Suppose you store you session files in the directory "~/.vim". You are
+currently working on the "secret" project and have to switch to the "boring"
+project: >
+
+ :wall
+ :mksession! ~/.vim/secret.vim
+ :source ~/.vim/boring.vim
+
+This first uses ":wall" to write all modified files. Then the current session
+is saved, using ":mksession!". This overwrites the previous session. The
+next time you load the secret session you can continue where you were at this
+point. And finally you load the new "boring" session.
+
+If you open help windows, split and close various window, and generally mess
+up the window layout, you can go back to the last saved session: >
+
+ :source ~/.vim/boring.vim
+
+Thus you have complete control over whether you want to continue next time
+where you are now, by saving the current setup in a session, or keep the
+session file as a starting point.
+ Another way of using sessions is to create a window layout that you like to
+use, and save this in a session. Then you can go back to this layout whenever
+you want.
+ For example, this is a nice layout to use:
+
+ +----------------------------------------+
+ | VIM - main help file |
+ | |
+ |Move around: Use the cursor keys, or "h|
+ |help.txt================================|
+ |explorer | |
+ |dir |~ |
+ |dir |~ |
+ |file |~ |
+ |file |~ |
+ |file |~ |
+ |file |~ |
+ |~/=========|[No File]===================|
+ | |
+ +----------------------------------------+
+
+This has a help window at the top, so that you can read this text. The narrow
+vertical window on the left contains a file explorer. This is a Vim plugin
+that lists the contents of a directory. You can select files to edit there.
+More about this in the next chapter.
+ Create this from a just started Vim with: >
+
+ :help
+ CTRL-W w
+ :vertical split ~/
+
+You can resize the windows a bit to your liking. Then save the session with:
+>
+ :mksession ~/.vim/mine.vim
+
+Now you can start Vim with this layout: >
+
+ vim -S ~/.vim/mine.vim
+
+Hint: To open a file you see listed in the explorer window in the empty
+window, move the cursor to the filename and press "O". Double clicking with
+the mouse will also do this.
+
+
+UNIX AND MS-WINDOWS
+
+Some people have to do work on MS-Windows systems one day and on Unix another
+day. If you are one of them, consider adding "slash" and "unix" to
+'sessionoptions'. The session files will then be written in a format that can
+be used on both systems. This is the command to put in your vimrc file: >
+
+ :set sessionoptions+=unix,slash
+
+Vim will use the Unix format then, because the MS-Windows Vim can read and
+write Unix files, but Unix Vim can't read MS-Windows format session files.
+Similarly, MS-Windows Vim understands file names with / to separate names, but
+Unix Vim doesn't understand \.
+
+
+SESSIONS AND VIMINFO
+
+Sessions store many things, but not the position of marks, contents of
+registers and the command line history. You need to use the viminfo feature
+for these things.
+ In most situations you will want to use sessions separately from viminfo.
+This can be used to switch to another session, but keep the command line
+history. And yank text into registers in one session, and paste it back in
+another session.
+ You might prefer to keep the info with the session. You will have to do
+this yourself then. Example: >
+
+ :mksession! ~/.vim/secret.vim
+ :wviminfo! ~/.vim/secret.viminfo
+
+And to restore this again: >
+
+ :source ~/.vim/secret.vim
+ :rviminfo! ~/.vim/secret.viminfo
+
+==============================================================================
+*21.5* Views
+
+A session stores the looks of the whole of Vim. When you want to store the
+properties for one window only, use a view.
+ The use of a view is for when you want to edit a file in a specific way.
+For example, you have line numbers enabled with the 'number' option and
+defined a few folds. Just like with sessions, you can remember this view on
+the file and restore it later. Actually, when you store a session, it stores
+the view of each window.
+ There are two basic ways to use views. The first is to let Vim pick a name
+for the view file. You can restore the view when you later edit the same
+file. To store the view for the current window: >
+
+ :mkview
+
+Vim will decide where to store the view. When you later edit the same file
+you get the view back with this command: >
+
+ :loadview
+
+That's easy, isn't it?
+ Now you want to view the file without the 'number' option on, or with all
+folds open, you can set the options to make the window look that way. Then
+store this view with: >
+
+ :mkview 1
+
+Obviously, you can get this back with: >
+
+ :loadview 1
+
+Now you can switch between the two views on the file by using ":loadview" with
+and without the "1" argument.
+ You can store up to ten views for the same file this way, one unnumbered
+and nine numbered 1 to 9.
+
+
+A VIEW WITH A NAME
+
+The second basic way to use views is by storing the view in a file with a name
+you chose. This view can be loaded while editing another file. Vim will then
+switch to editing the file specified in the view. Thus you can use this to
+quickly switch to editing another file, with all its options set as you saved
+them.
+ For example, to save the view of the current file: >
+
+ :mkview ~/.vim/main.vim
+
+You can restore it with: >
+
+ :source ~/.vim/main.vim
+
+==============================================================================
+*21.6* Modelines
+
+When editing a specific file, you might set options specifically for that
+file. Typing these commands each time is boring. Using a session or view for
+editing a file doesn't work when sharing the file between several people.
+ The solution for this situation is adding a modeline to the file. This is
+a line of text that tells Vim the values of options, to be used in this file
+only.
+ A typical example is a C program where you make indents by a multiple of 4
+spaces. This requires setting the 'shiftwidth' option to 4. This modeline
+will do that:
+
+ /* vim:set shiftwidth=4: */ ~
+
+Put this line as one of the first or last five lines in the file. When
+editing the file, you will notice that 'shiftwidth' will have been set to
+four. When editing another file, it's set back to the default value of eight.
+ For some files the modeline fits well in the header, thus it can be put at
+the top of the file. For text files and other files where the modeline gets
+in the way of the normal contents, put it at the end of the file.
+
+The 'modelines' option specifies how many lines at the start and end of the
+file are inspected for containing a modeline. To inspect ten lines: >
+
+ :set modelines=10
+
+The 'modeline' option can be used to switch this off. Do this when you are
+working as root or don't trust the files you are editing: >
+
+ :set nomodeline
+
+Use this format for the modeline:
+
+ any-text vim:set {option}={value} ... : any-text ~
+
+The "any-text" indicates that you can put any text before and after the part
+that Vim will use. This allows making it look like a comment, like what was
+done above with /* and */.
+ The " vim:" part is what makes Vim recognize this line. The must be white
+space before "vim", or "vim" must be at the start of the line. Thus using
+something like "gvim:" will not work.
+ The part between the colons is a ":set" command. It works the same way as
+typing the ":set" command, except that you need to insert a backslash before a
+colon (otherwise it would be seen as the end of the modeline).
+
+Another example:
+
+ // vim:set textwidth=72 dir=c\:\tmp: use c:\tmp here ~
+
+There is an extra backslash before the first colon, so that it's included in
+the ":set" command. The text after the second colon is ignored, thus a remark
+can be placed there.
+
+For more details see |modeline|.
+
+==============================================================================
+
+Next chapter: |usr_22.txt| Finding the file to edit
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_22.txt b/runtime/doc/usr_22.txt
new file mode 100644
index 000000000..c355cb31d
--- /dev/null
+++ b/runtime/doc/usr_22.txt
@@ -0,0 +1,364 @@
+*usr_22.txt* For Vim version 7.0aa. Last change: 2003 Mar 17
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Finding the file to edit
+
+
+Files can be found everywhere. So how do you find them? Vim offers various
+ways to browse the directory tree. There are commands to jump to a file that
+is mentioned in another. And Vim remembers which files have been edited
+before.
+
+|22.1| The file explorer
+|22.2| The current directory
+|22.3| Finding a file
+|22.4| The buffer list
+
+ Next chapter: |usr_23.txt| Editing other files
+ Previous chapter: |usr_21.txt| Go away and come back
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*22.1* The file explorer
+
+Vim has a plugin that makes it possible to edit a directory. Try this: >
+
+ :edit .
+
+Through the magic of autocommands and Vim scripts, the window will be filled
+with the contents of the directory. It looks like this:
+
+ " Press ? for keyboard shortcuts ~
+ " Sorted by name (.bak,~,.o,.h,.info,.swp,.obj,.orig,.rej at end of list) ~
+ "= /home/mool/vim/vim6/runtime/doc/ ~
+ ../ ~
+ check/ ~
+ Makefile ~
+ autocmd.txt ~
+ change.txt ~
+ eval.txt~ ~
+ filetype.txt~ ~
+ help.txt.info ~
+
+You can see these items:
+1. A comment about using ? to get help for the functionality of the file
+ explorer.
+2. The second line mentions how the items in the directory are listed. They
+ can be sorted in several ways.
+3. The third line is the name of the current directory.
+4. The "../" directory item. This is the parent directory.
+5. The directory names.
+6. The ordinary file names. As mentioned in the second line, some are not
+ here but "at the end of the list".
+7. The less ordinary file names. You are expected to use these less often,
+ therefore they have been moved to the end.
+
+If you have syntax highlighting enabled, the different parts are highlighted
+to make it easier to spot them.
+
+You can use Normal mode Vim commands to move around in the text. For example,
+move to a file and press <Enter>. Now you are editing that file. To go back
+to the explorer use ":edit ." again. CTRL-O also works.
+ Try using <Enter> while the cursor is on a directory name. The result is
+that the explorer moves into that directory and displays the items found
+there. Pressing <Enter> on the first directory "../" moves you one level
+higher. Pressing "-" does the same thing, without the need to move to the
+"../" item first.
+
+You can press ? to get short help on the things you can do in the explorer.
+This is what you get:
+
+ " <enter> : open file or directory ~
+ " o : open new window for file/directory ~
+ " O : open file in previously visited window ~
+ " p : preview the file ~
+ " i : toggle size/date listing ~
+ " s : select sort field r : reverse sort ~
+ " - : go up one level c : cd to this dir ~
+ " R : rename file D : delete file ~
+ " :help file-explorer for detailed help ~
+
+The first few commands are for selecting a file to display. Depending on what
+command you use, the file appears somewhere:
+
+ <Enter> Uses the current window.
+ o Opens a new window.
+ O Uses the previously visited window.
+ p Uses the preview window, and moves the cursor back
+ into the explorer window. |preview-window|
+
+The following commands are used to display other information:
+
+ i Display the size and date for the file. Using i again
+ will hide the information.
+ s Use the field the cursor is in to sort on. First
+ display the size and date with i. Then Move the
+ cursor to the size of any file and press s. The files
+ will now be sorted on size. Press s wile the cursor
+ is on a date and the items will be sorted on date.
+ r reverse the sorting order (either size or date)
+
+There are a few extra commands:
+
+ c Change the current directory to the displayed
+ directory. You can then type an ":edit" command for
+ one of the files without prepending the path.
+ R Rename the file under the cursor. You will be
+ prompted for the new name.
+ D Delete the file under the cursor. You will get a
+ prompt to confirm this.
+
+==============================================================================
+*22.2* The current directory
+
+Just like the shell, Vim has the concept of a current directory. Suppose you
+are in your home directory and want to edit several files in a directory
+"VeryLongFileName". You could do: >
+
+ :edit VeryLongFileName/file1.txt
+ :edit VeryLongFileName/file2.txt
+ :edit VeryLongFileName/file3.txt
+
+To avoid much of the typing, do this: >
+
+ :cd VeryLongFileName
+ :edit file1.txt
+ :edit file2.txt
+ :edit file3.txt
+
+The ":cd" command changes the current directory. You can see what the current
+directory is with the ":pwd" command: >
+
+ :pwd
+ /home/Bram/VeryLongFileName
+
+Vim remembers the last directory that you used. Use "cd -" to go back to it.
+Example: >
+
+ :pwd
+ /home/Bram/VeryLongFileName
+ :cd /etc
+ :pwd
+ /etc
+ :cd -
+ :pwd
+ /home/Bram/VeryLongFileName
+ :cd -
+ :pwd
+ /etc
+
+
+WINDOW LOCAL DIRECTORY
+
+When you split a window, both windows use the same current directory. When
+you want to edit a number of files somewhere else in the new window, you can
+make it use a different directory, without changing the current directory in
+the other window. This is called a local directory. >
+
+ :pwd
+ /home/Bram/VeryLongFileName
+ :split
+ :lcd /etc
+ :pwd
+ /etc
+ CTRL-W w
+ :pwd
+ /home/Bram/VeryLongFileName
+
+So long as no ":lcd" command has been used, all windows share the same current
+directory. Doing a ":cd" command in one window will also change the current
+directory of the other window.
+ For a window where ":lcd" has been used a different current directory is
+remembered. Using ":cd" or ":lcd" in other windows will not change it.
+ When using a ":cd" command in a window that uses a different current
+directory, it will go back to using the shared directory.
+
+==============================================================================
+*22.3* Finding a file
+
+You are editing a C program that contains this line:
+
+ #include "inits.h" ~
+
+You want to see what is in that "inits.h" file. Move the cursor on the name
+of the file and type: >
+
+ gf
+
+Vim will find the file and edit it.
+ What if the file is not in the current directory? Vim will use the 'path'
+option to find the file. This option is a list of directory names where to
+look for your file.
+ Suppose you have your include files located in "c:/prog/include". This
+command will add it to the 'path' option: >
+
+ :set path+=c:/prog/include
+
+This directory is an absolute path. No matter where you are, it will be the
+same place. What if you have located files in a subdirectory, below where the
+file is? Then you can specify a relative path name. This starts with a dot:
+>
+ :set path+=./proto
+
+This tells Vim to look in the directory "proto", below the directory where the
+file in which you use "gf" is. Thus using "gf" on "inits.h" will make Vim
+look for "proto/inits.h", starting in the directory of the file.
+ Without the "./", thus "proto", Vim would look in the "proto" directory
+below the current directory. And the current directory might not be where the
+file that you are editing is located.
+
+The 'path' option allows specifying the directories where to search for files
+in many more ways. See the help on the 'path' option.
+ The 'isfname' option is used to decide which characters are included in the
+file name, and which ones are not (e.g., the " character in the example
+above).
+
+When you know the file name, but it's not to be found in the file, you can
+type it: >
+
+ :find inits.h
+
+Vim will then use the 'path' option to try and locate the file. This is the
+same as the ":edit" command, except for the use of 'path'.
+
+To open the found file in a new window use CTRL-W f instead of "gf", or use
+":sfind" instead of ":find".
+
+
+A nice way to directly start Vim to edit a file somewhere in the 'path': >
+
+ vim "+find stdio.h"
+
+This finds the file "stdio.h" in your value of 'path'. The quotes are
+necessary to have one argument |-+c|.
+
+==============================================================================
+*22.4* The buffer list
+
+The Vim editor uses the term buffer to describe a file being edited.
+Actually, a buffer is a copy of the file that you edit. When you finish
+changing the buffer, you write the contents of the buffer to the file.
+Buffers not only contain file contents, but also all the marks, settings, and
+other stuff that goes with it.
+
+
+HIDDEN BUFFERS
+
+Suppose you are editing the file one.txt and need to edit the file two.txt.
+You could simply use ":edit two.txt", but since you made changes to one.txt
+that won't work. You also don't want to write one.txt yet. Vim has a
+solution for you: >
+
+ :hide edit two.txt
+
+The buffer "one.txt" disappears from the screen, but Vim still knows that you
+are editing this buffer, so it keeps the modified text. This is called a
+hidden buffer: The buffer contains text, but you can't see it.
+ The ":hide" command argument is another command. It makes that command
+behave like the 'hidden' option was set. You could also set this option
+yourself. The effect is that when any buffer is abandoned, it becomes hidden.
+ Be careful! When you have hidden buffers with changes, don't exit Vim
+without making sure you have saved all the buffers.
+
+
+INACTIVE BUFFERS
+
+ When a buffer has been used once, Vim remembers some information about it.
+When it is not displayed in a window and it is not hidden, it is still in the
+buffer list. This is called an inactive buffer. Overview:
+
+ Active Appears in a window, text loaded.
+ Hidden Not in a window, text loaded.
+ Inactive Not in a window, no text loaded.
+
+The inactive buffers are remembered, because Vim keeps information about them,
+like marks. And remembering the file name is useful too, so that you can see
+which files you have edited. And edit them again.
+
+
+LISTING BUFFERS
+
+View the buffer list with this command: >
+
+ :buffers
+
+A command which does the same, is not so obvious to list buffers, but is much
+shorter to type: >
+
+ :ls
+
+The output could look like this:
+
+ 1 #h "help.txt" line 62 ~
+ 2 %l+ "usr_21.txt" line 1 ~
+ 3 "usr_toc.txt" line 1 ~
+
+The first column contains the buffer number. You can use this to edit the
+buffer without having to type the name, see below.
+ After the buffer number come the flags. Then the name of the file
+and the line number where the cursor was the last time.
+ The flags that can appear are these (from left to right):
+
+ u Buffer is unlisted |unlisted-buffer|.
+ % Current buffer.
+ # Alternate buffer.
+ l Buffer is loaded and displayed.
+ h Buffer is loaded but hidden.
+ = Buffer is read-only.
+ - Buffer is not modifiable, the 'modifiable' option is off.
+ + Buffer has been modified.
+
+
+EDITING A BUFFER
+
+You can edit a buffer by its number. That avoids having to type the file
+name: >
+
+ :buffer 2
+
+But the only way to know the number is by looking in the buffer list. You can
+use the name, or part of it, instead: >
+
+ :buffer help
+
+Vim will find a best match for the name you type. If there is only one
+buffer that matches the name, it will be used. In this case "help.txt".
+ To open a buffer in a new window: >
+
+ :sbuffer 3
+
+This works with a name as well.
+
+
+USING THE BUFFER LIST
+
+You can move around in the buffer list with these commands:
+
+ :bnext go to next buffer
+ :bprevious go to previous buffer
+ :bfirst go to the first buffer
+ :blast go to the last buffer
+
+To remove a buffer from the list, use this command: >
+
+ :bdelete 3
+
+Again, this also works with a name.
+ If you delete a buffer that was active (visible in a window), that window
+will be closed. If you delete the current buffer, the current window will be
+closed. If it was the last window, Vim will find another buffer to edit. You
+can't be editing nothing!
+
+ Note:
+ Even after removing the buffer with ":bdelete" Vim still remembers it.
+ It's actually made "unlisted", it no longer appears in the list from
+ ":buffers". The ":buffers!" command will list unlisted buffers (yes,
+ Vim can do the impossible). To really make Vim forget about a buffer,
+ use ":bwipe". Also see the 'buflisted' option.
+
+==============================================================================
+
+Next chapter: |usr_23.txt| Editing other files
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt
new file mode 100644
index 000000000..21e998060
--- /dev/null
+++ b/runtime/doc/usr_23.txt
@@ -0,0 +1,343 @@
+*usr_23.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Editing other files
+
+
+This chapter is about editing files that are not ordinary files. With Vim you
+can edit files that are compressed or encrypted. Some files need to be
+accessed over the internet. With some restrictions, binary files can be
+edited as well.
+
+|23.1| DOS, Mac and Unix files
+|23.2| Files on the internet
+|23.3| Encryption
+|23.4| Binary files
+|23.5| Compressed files
+
+ Next chapter: |usr_24.txt| Inserting quickly
+ Previous chapter: |usr_22.txt| Finding the file to edit
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*23.1* DOS, Mac and Unix files
+
+Back in the early days, the old Teletype machines used two characters to
+start a new line. One to move the carriage back to the first position
+(carriage return, <CR>), another to move the paper up (line feed, <LF>).
+ When computers came out, storage was expensive. Some people decided that
+they did not need two characters for end-of-line. The UNIX people decided
+they could use <Line Feed> only for end-of-line. The Apple people
+standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to
+keep the old <CR><LF>.
+ This means that if you try to move a file from one system to another, you
+have line-break problems. The Vim editor automatically recognizes the
+different file formats and handles things properly behind your back.
+ The option 'fileformats' contains the various formats that will be tried
+when a new file is edited. The following command, for example, tells Vim to
+try UNIX format first and MS-DOS format second: >
+
+ :set fileformats=unix,dos
+
+You will notice the format in the message you get when editing a file. You
+don't see anything if you edit a native file format. Thus editing a Unix file
+on Unix won't result in a remark. But when you edit a dos file, Vim will
+notify you of this:
+
+ "/tmp/test" [dos] 3L, 71C ~
+
+For a Mac file you would see "[mac]".
+ The detected file format is stored in the 'fileformat' option. To see
+which format you have, execute the following command: >
+
+ :set fileformat?
+
+The three names that Vim uses are:
+
+ unix <LF>
+ dos <CR><LF>
+ mac <CR>
+
+
+USING THE MAC FORMAT
+
+On Unix, <LF> is used to break a line. It's not unusual to have a <CR>
+character halfway a line. Incidentally, this happens quite often in Vi (and
+Vim) scripts.
+ On the Macintosh, where <CR> is the line break character, it's possible to
+have a <LF> character halfway a line.
+ The result is that it's not possible to be 100% sure whether a file
+containing both <CR> and <LF> characters is a Mac or a Unix file. Therefore,
+Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check
+for this type of file. To check for this format anyway, add "mac" to
+'fileformats': >
+
+ :set fileformats+=mac
+
+Then Vim will take a guess at the file format. Watch out for situations where
+Vim guesses wrong.
+
+
+OVERRULING THE FORMAT
+
+If you use the good old Vi and try to edit an MS-DOS format file, you will
+find that each line ends with a ^M character. (^M is <CR>). The automatic
+detection avoids this. Suppose you do want to edit the file that way? Then
+you need to overrule the format: >
+
+ :edit ++ff=unix file.txt
+
+The "++" string is an item that tells Vim that an option name follows, which
+overrules the default for this single command. "++ff" is used for
+'fileformat'. You could also use "++ff=mac" or "++ff=dos".
+ This doesn't work for any option, only "++ff" and "++enc" are currently
+implemented. The full names "++fileformat" and "++encoding" also work.
+
+
+CONVERSION
+
+You can use the 'fileformat' option to convert from one file format to
+another. Suppose, for example, that you have an MS-DOS file named README.TXT
+that you want to convert to UNIX format. Start by editing the MS-DOS format
+file: >
+ vim README.TXT
+
+Vim will recognize this as a dos format file. Now change the file format to
+UNIX: >
+
+ :set fileformat=unix
+ :write
+
+The file is written in Unix format.
+
+==============================================================================
+*23.2* Files on the internet
+
+Someone sends you an e-mail message, which refers to a file by its URL. For
+example:
+
+ You can find the information here: ~
+ ftp://ftp.vim.org/pub/vim/README ~
+
+You could start a program to download the file, save it on your local disk and
+then start Vim to edit it.
+ There is a much simpler way. Move the cursor to any character of the URL.
+Then use this command: >
+
+ gf
+
+With a bit of luck, Vim will figure out which program to use for downloading
+the file, download it and edit the copy. To open the file in a new window use
+CTRL-W f.
+ If something goes wrong you will get an error message. It's possible that
+the URL is wrong, you don't have permission to read it, the network connection
+is down, etc. Unfortunately, it's hard to tell the cause of the error. You
+might want to try the manual way of downloading the file.
+
+Accessing files over the internet works with the netrw plugin. Currently URLs
+with these formats are recognized:
+
+ ftp:// uses ftp
+ rcp:// uses rcp
+ scp:// uses scp
+ http:// uses wget (reading only)
+
+Vim doesn't do the communication itself, it relies on the mentioned programs
+to be available on your computer. On most Unix systems "ftp" and "rcp" will
+be present. "scp" and "wget" might need to be installed.
+
+Vim detects these URLs for each command that starts editing a new file, also
+with ":edit" and ":split", for example. Write commands also work, except for
+http://.
+
+For more information, also about passwords, see |netrw|.
+
+==============================================================================
+*23.3* Encryption
+
+Some information you prefer to keep to yourself. For example, when writing
+a test on a computer that students also use. You don't want clever students
+to figure out a way to read the questions before the exam starts. Vim can
+encrypt the file for you, which gives you some protection.
+ To start editing a new file with encryption, use the "-x" argument to start
+Vim. Example: >
+
+ vim -x exam.txt
+
+Vim prompts you for a key used for encrypting and decrypting the file:
+
+ Enter encryption key: ~
+
+Carefully type the secret key now. You cannot see the characters you type,
+they will be replaced by stars. To avoid the situation that a typing mistake
+will cause trouble, Vim asks you to enter the key again:
+
+ Enter same key again: ~
+
+You can now edit this file normally and put in all your secrets. When you
+finish editing the file and tell Vim to exit, the file is encrypted and
+written.
+ When you edit the file with Vim, it will ask you to enter the same key
+again. You don't need to use the "-x" argument. You can also use the normal
+":edit" command. Vim adds a magic string to the file by which it recognizes
+that the file was encrypted.
+ If you try to view this file using another program, all you get is garbage.
+Also, if you edit the file with Vim and enter the wrong key, you get garbage.
+Vim does not have a mechanism to check if the key is the right one (this makes
+it much harder to break the key).
+
+
+SWITCHING ENCRYPTION ON AND OFF
+
+To disable the encryption of a file, set the 'key' option to an empty string:
+>
+ :set key=
+
+The next time you write the file this will be done without encryption.
+ Setting the 'key' option to enable encryption is not a good idea, because
+the password appears in the clear. Anyone shoulder-surfing can read your
+password.
+ To avoid this problem, the ":X" command was created. It asks you for an
+encryption key, just like the "-x" argument did: >
+
+ :X
+ Enter encryption key: ******
+ Enter same key again: ******
+
+
+LIMITS ON ENCRYPTION
+
+The encryption algorithm used by Vim is weak. It is good enough to keep out
+the casual prowler, but not good enough to keep out a cryptology expert with
+lots of time on his hands. Also you should be aware that the swap file is not
+encrypted; so while you are editing, people with superuser privileges can read
+the unencrypted text from this file.
+ One way to avoid letting people read your swap file is to avoid using one.
+If the -n argument is supplied on the command line, no swap file is used
+(instead, Vim puts everything in memory). For example, to edit the encrypted
+file "file.txt" without a swap file use the following command: >
+
+ vim -x -n file.txt
+
+When already editing a file, the swapfile can be disabled with: >
+
+ :setlocal noswapfile
+
+Since there is no swapfile, recovery will be impossible. Save the file a bit
+more often to avoid the risk of losing your changes.
+
+While the file is in memory, it is in plain text. Anyone with privilege can
+look in the editor's memory and discover the contents of the file.
+ If you use a viminfo file, be aware that the contents of text registers are
+written out in the clear as well.
+ If you really want to secure the contents of a file, edit it only on a
+portable computer not connected to a network, use good encryption tools, and
+keep the computer locked up in a big safe when not in use.
+
+==============================================================================
+*23.4* Binary files
+
+You can edit binary files with Vim. Vim wasn't really made for this, thus
+there are a few restrictions. But you can read a file, change a character and
+write it back, with the result that only that one character was changed and
+the file is identical otherwise.
+ To make sure that Vim does not use its clever tricks in the wrong way, add
+the "-b" argument when starting Vim: >
+
+ vim -b datafile
+
+This sets the 'binary' option. The effect of this is that unexpected side
+effects are turned off. For example, 'textwidth' is set to zero, to avoid
+automatic formatting of lines. And files are always read in Unix file format.
+
+Binary mode can be used to change a message in a program. Be careful not to
+insert or delete any characters, it would stop the program from working. Use
+"R" to enter replace mode.
+
+Many characters in the file will be unprintable. To see them in Hex format: >
+
+ :set display=uhex
+
+Otherwise, the "ga" command can be used to see the value of the character
+under the cursor. The output, when the cursor is on an <Esc>, looks like
+this:
+
+ <^[> 27, Hex 1b, Octal 033 ~
+
+There might not be many line breaks in the file. To get some overview switch
+the 'wrap' option off: >
+
+ :set nowrap
+
+
+BYTE POSITION
+
+To see on which byte you are in the file use this command: >
+
+ g CTRL-G
+
+The output is verbose:
+
+ Col 9-16 of 9-16; Line 277 of 330; Word 1806 of 2058; Byte 10580 of 12206 ~
+
+The last two numbers are the byte position in the file and the total number of
+bytes. This takes into account how 'fileformat' changes the number of bytes
+that a line break uses.
+ To move to a specific byte in the file, use the "go" command. For
+example, to move to byte 2345: >
+
+ 2345go
+
+
+USING XXD
+
+A real binary editor shows the text in two ways: as it is and in hex format.
+You can do this in Vim by first converting the file with the "xxd" program.
+This comes with Vim.
+ First edit the file in binary mode: >
+
+ vim -b datafile
+
+Now convert the file to a hex dump with xxd: >
+
+ :%!xxd
+
+The text will look like this:
+
+ 0000000: 1f8b 0808 39d7 173b 0203 7474 002b 4e49 ....9..;..tt.+NI ~
+ 0000010: 4b2c 8660 eb9c ecac c462 eb94 345e 2e30 K,.`.....b..4^.0 ~
+ 0000020: 373b 2731 0b22 0ca6 c1a2 d669 1035 39d9 7;'1.".....i.59. ~
+
+You can now view and edit the text as you like. Vim treats the information as
+ordinary text. Changing the hex does not cause the printable character to be
+changed, or the other way around.
+ Finally convert it back with:
+>
+ :%!xxd -r
+
+Only changes in the hex part are used. Changes in the printable text part on
+the right are ignored.
+
+See the manual page of xxd for more information.
+
+==============================================================================
+*23.5* Compressed files
+
+This is easy: You can edit a compressed file just like any other file. The
+"gzip" plugin takes care of decompressing the file when you edit it. And
+compressing it again when you write it.
+ These compression methods are currently supported:
+
+ .Z compress
+ .gz gzip
+ .bz2 bzip2
+
+Vim uses the mentioned programs to do the actual compression and
+decompression. You might need to install the programs first.
+
+==============================================================================
+
+Next chapter: |usr_24.txt| Inserting quickly
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt
new file mode 100644
index 000000000..76274d1f5
--- /dev/null
+++ b/runtime/doc/usr_24.txt
@@ -0,0 +1,573 @@
+*usr_24.txt* For Vim version 7.0aa. Last change: 2003 Aug 18
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Inserting quickly
+
+
+When entering text, Vim offers various ways to reduce the number of keystrokes
+and avoid typing mistakes. Use Insert mode completion to repeat previously
+typed words. Abbreviate long words to short ones. Type characters that
+aren't on your keyboard.
+
+|24.1| Making corrections
+|24.2| Showing matches
+|24.3| Completion
+|24.4| Repeating an insert
+|24.5| Copying from another line
+|24.6| Inserting a register
+|24.7| Abbreviations
+|24.8| Entering special characters
+|24.9| Digraphs
+|24.10| Normal mode commands
+
+ Next chapter: |usr_25.txt| Editing formatted text
+ Previous chapter: |usr_23.txt| Editing other files
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*24.1* Making corrections
+
+The <BS> key was already mentioned. It deletes the character just before the
+cursor. The <Del> key does the same for the character under (after) the
+cursor.
+ When you typed a whole word wrong, use CTRL-W:
+
+ The horse had fallen to the sky ~
+ CTRL-W
+ The horse had fallen to the ~
+
+If you really messed up a line and want to start over, use CTRL-U to delete
+it. This keeps the text after the cursor and the indent. Only the text from
+the first non-blank to the cursor is deleted. With the cursor on the "f" of
+"fallen" in the next line pressing CTRL-U does this:
+
+ The horse had fallen to the ~
+ CTRL-U
+ fallen to the ~
+
+When you spot a mistake a few words back, you need to move the cursor there to
+correct it. For example, you typed this:
+
+ The horse had follen to the ground ~
+
+You need to change "follen" to "fallen". With the cursor at the end, you
+would type this to correct it: >
+
+ <Esc>4blraA
+
+< get out of Insert mode <Esc>
+ four words back 4b
+ move on top of the "o" l
+ replace with "a" ra
+ restart Insert mode A
+
+Another way to do this: >
+
+ <C-Left><C-Left><C-Left><C-Left><Right><Del>a<End>
+
+< four words back <C-Left><C-Left><C-Left><C-Left>
+ move on top of the "o" <Right>
+ delete the "o" <Del>
+ insert an "a" a
+ go to end of the line <End>
+
+This uses special keys to move around, while remaining in Insert mode. This
+resembles what you would do in a modeless editor. It's easier to remember,
+but takes more time (you have to move your hand from the letters to the cursor
+keys, and the <End> key is hard to press without looking at the keyboard).
+ These special keys are most useful when writing a mapping that doesn't
+leave Insert mode. The extra typing doesn't matter then.
+ An overview of the keys you can use in Insert mode:
+
+ <C-Home> to start of the file
+ <PageUp> a whole screenful up
+ <Home> to start of line
+ <S-Left> one word left
+ <C-Left> one word left
+ <S-Right> one word right
+ <C-Right> one word right
+ <End> to end of the line
+ <PageDown> a whole screenful down
+ <C-End> to end of the file
+
+There are a few more, see |ins-special-special|.
+
+==============================================================================
+*24.2* Showing matches
+
+When you type a ) it would be nice to see with which ( it matches. To make
+Vim do that use this command: >
+
+ :set showmatch
+
+When you now type a text like "(example)", as soon as you type the ) Vim will
+briefly move the cursor to the matching (, keep it there for half a second,
+and move back to where you were typing.
+ In case there is not matching (, Vim will beep. Then you know that you
+might have forgotten the ( somewhere, or typed a ) too many.
+ The match will also be shown for [] and {} pairs. You don't have to wait
+with typing the next character, as soon as Vim sees it the cursor will move
+back and inserting continues as before.
+ You can change the time Vim waits with the 'matchtime' option. For
+example, to make Vim wait one and a half second: >
+
+ :set matchtime=15
+
+The time is specified in tenths of a second.
+
+==============================================================================
+*24.3* Completion
+
+Vim can automatically complete words on insertion. You type the first part of
+a word, press CTRL-P, and Vim guesses the rest.
+ Suppose, for example, that you are creating a C program and want to type in
+the following:
+
+ total = ch_array[0] + ch_array[1] + ch_array[2]; ~
+
+You start by entering the following:
+
+ total = ch_array[0] + ch_ ~
+
+At this point, you tell Vim to complete the word using the command CTRL-P.
+Vim searches for a word that starts with what's in front of the cursor. In
+this case, it is "ch_", which matches with the word ch_array. So typing
+CTRL-P gives you the following:
+
+ total = ch_array[0] + ch_array ~
+
+After a little more typing, you get this (ending in a space):
+
+ total = ch_array[0] + ch_array[1] + ~
+
+If you now type CTRL-P Vim will search again for a word that completes the
+word before the cursor. Since there is nothing in front of the cursor, it
+finds the first word backwards, which is "ch_array". Typing CTRL-P again
+gives you the next word that matches, in this case "total". A third CTRL-P
+searches further back. If there is nothing else, it causes the editor to run
+out of words, so it returns to the original text, which is nothing. A fourth
+CTRL-P causes the editor to start over again with "ch_array".
+
+To search forward, use CTRL-N. Since the search wraps around the end of the
+file, CTRL-N and CTRL-P will find the same matches, but in a different
+sequence. Hint: CTRL-N is Next-match and CTRL-P is Previous-match.
+
+The Vim editor goes through a lot of effort to find words to complete. By
+default, it searches the following places:
+
+ 1. Current file
+ 2. Files in other windows
+ 3. Other loaded files (hidden buffers)
+ 4. Files which are not loaded (inactive buffers)
+ 5. Tag files
+ 6. All files #included by the current file
+
+
+OPTIONS
+
+You can customize the search order with the 'complete' option.
+
+The 'ignorecase' option is used. When it is set, case differences are ignored
+when searching for matches.
+
+A special option for completion is 'infercase'. This is useful to find
+matches while ignoring case ('ignorecase' must be set) but still using the
+case of the word typed so far. Thus if you type "For" and Vim finds a match
+"fortunately", it will result in "Fortunately".
+
+
+COMPLETING SPECIFIC ITEMS
+
+If you know what you are looking for, you can use these commands to complete
+with a certain type of item:
+
+ CTRL-X CTRL-F file names
+ CTRL-X CTRL-L whole lines
+ CTRL-X CTRL-D macro definitions (also in included files)
+ CTRL-X CTRL-I current and included files
+ CTRL-X CTRL-K words from a dictionary
+ CTRL-X CTRL-T words from a thesaurus
+ CTRL-X CTRL-] tags
+ CTRL-X CTRL-V Vim command line
+
+After each of them CTRL-N can be used to find the next match, CTRL-P to find
+the previous match.
+ More information for each of these commands here: |ins-completion|.
+
+
+COMPLETING FILE NAMES
+
+Let's take CTRL-X CTRL-F as an example. This will find file names. It scans
+the current directory for files and displays each one that matches the word in
+front of the cursor.
+ Suppose, for example, that you have the following files in the current
+directory:
+
+ main.c sub_count.c sub_done.c sub_exit.c
+
+Now enter Insert mode and start typing:
+
+ The exit code is in the file sub ~
+
+At this point, you enter the command CTRL-X CTRL-F. Vim now completes the
+current word "sub" by looking at the files in the current directory. The
+first match is sub_count.c. This is not the one you want, so you match the
+next file by typing CTRL-N. This match is sub_done.c. Typing CTRL-N again
+takes you to sub_exit.c. The results:
+
+ The exit code is in the file sub_exit.c ~
+
+If the file name starts with / (Unix) or C:\ (MS-Windows) you can find all
+files in the file system. For example, type "/u" and CTRL-X CTRL-F. This
+will match "/usr" (this is on Unix):
+
+ the file is found in /usr/ ~
+
+If you now press CTRL-N you go back to "/u". Instead, to accept the "/usr/"
+and go one directory level deeper, use CTRL-X CTRL-F again:
+
+ the file is found in /usr/X11R6/ ~
+
+The results depend on what is found in your file system, of course. The
+matches are sorted alphabetically.
+
+==============================================================================
+*24.4* Repeating an insert
+
+If you press CTRL-A, the editor inserts the text you typed the last time you
+were in Insert mode.
+ Assume, for example, that you have a file that begins with the following:
+
+ "file.h" ~
+ /* Main program begins */ ~
+
+You edit this file by inserting "#include " at the beginning of the first
+line:
+
+ #include "file.h" ~
+ /* Main program begins */ ~
+
+You go down to the beginning of the next line using the commands "j^". You
+now start to insert a new "#include" line. So you type: >
+
+ i CTRL-A
+
+The result is as follows:
+
+ #include "file.h" ~
+ #include /* Main program begins */ ~
+
+The "#include " was inserted because CTRL-A inserts the text of the previous
+insert. Now you type "main.h"<Enter> to finish the line:
+
+
+ #include "file.h" ~
+ #include "main.h" ~
+ /* Main program begins */ ~
+
+The CTRL-@ command does a CTRL-A and then exits Insert mode. That's a quick
+way of doing exactly the same insertion again.
+
+==============================================================================
+*24.5* Copying from another line
+
+The CTRL-Y command inserts the character above the cursor. This is useful
+when you are duplicating a previous line. For example, you have this line of
+C code:
+
+ b_array[i]->s_next = a_array[i]->s_next; ~
+
+Now you need to type the same line, but with "s_prev" instead of "s_next".
+Start the new line, and press CTRL-Y 14 times, until you are at the "n" of
+"next":
+
+ b_array[i]->s_next = a_array[i]->s_next; ~
+ b_array[i]->s_ ~
+
+Now you type "prev":
+
+ b_array[i]->s_next = a_array[i]->s_next; ~
+ b_array[i]->s_prev ~
+
+Continue pressing CTRL-Y until the following "next":
+
+ b_array[i]->s_next = a_array[i]->s_next; ~
+ b_array[i]->s_prev = a_array[i]->s_ ~
+
+Now type "prev;" to finish it off.
+
+The CTRL-E command acts like CTRL-Y except it inserts the character below the
+cursor.
+
+==============================================================================
+*24.6* Inserting a register
+
+The command CTRL-R {register} inserts the contents of the register. This is
+useful to avoid having to type a long word. For example, you need to type
+this:
+
+ r = VeryLongFunction(a) + VeryLongFunction(b) + VeryLongFunction(c) ~
+
+The function name is defined in a different file. Edit that file and move the
+cursor on top of the function name there, and yank it into register v: >
+
+ "vyiw
+
+"v is the register specification, "yiw" is yank-inner-word. Now edit the file
+where the new line is to be inserted, and type the first letters:
+
+ r = ~
+
+Now use CTRL-R v to insert the function name:
+
+ r = VeryLongFunction ~
+
+You continue to type the characters in between the function name, and use
+CTRL-R v two times more.
+ You could have done the same with completion. Using a register is useful
+when there are many words that start with the same characters.
+
+If the register contains characters such as <BS> or other special characters,
+they are interpreted as if they had been typed from the keyboard. If you do
+not want this to happen (you really want the <BS> to be inserted in the text),
+use the command CTRL-R CTRL-R {register}.
+
+==============================================================================
+*24.7* Abbreviations
+
+An abbreviation is a short word that takes the place of a long one. For
+example, "ad" stands for "advertisement". Vim enables you to type an
+abbreviation and then will automatically expand it for you.
+ To tell Vim to expand "ad" into "advertisement" every time you insert it,
+use the following command: >
+
+ :iabbrev ad advertisement
+
+Now, when you type "ad", the whole word "advertisement" will be inserted into
+the text. This is triggered by typing a character that can't be part of a
+word, for example a space:
+
+ What Is Entered What You See
+ I saw the a I saw the a ~
+ I saw the ad I saw the ad ~
+ I saw the ad<Space> I saw the advertisement<Space> ~
+
+The expansion doesn't happen when typing just "ad". That allows you to type a
+word like "add", which will not get expanded. Only whole words are checked
+for abbreviations.
+
+
+ABBREVIATING SEVERAL WORDS
+
+It is possible to define an abbreviation that results in multiple words. For
+example, to define "JB" as "Jack Benny", use the following command: >
+
+ :iabbrev JB Jack Benny
+
+As a programmer, I use two rather unusual abbreviations: >
+
+ :iabbrev #b /****************************************
+ :iabbrev #e <Space>****************************************/
+
+These are used for creating boxed comments. The comment starts with #b, which
+draws the top line. I then type the comment text and use #e to draw the
+bottom line.
+ Notice that the #e abbreviation begins with a space. In other words, the
+first two characters are space-star. Usually Vim ignores spaces between the
+abbreviation and the expansion. To avoid that problem, I spell space as seven
+characters: <, S, p, a, c, e, >.
+
+ Note:
+ ":iabbrev" is a long word to type. ":iab" works just as well.
+ That's abbreviating the abbreviate command!
+
+
+FIXING TYPING MISTAKES
+
+It's very common to make the same typing mistake every time. For example,
+typing "teh" instead of "the". You can fix this with an abbreviation: >
+
+ :abbreviate teh the
+
+You can add a whole list of these. Add one each time you discover a common
+mistake.
+
+
+LISTING ABBREVIATIONS
+
+The ":abbreviate" command lists the abbreviations:
+
+ :abbreviate
+ i #e ****************************************/
+ i #b /****************************************
+ i JB Jack Benny
+ i ad advertisement
+ ! teh the
+
+The "i" in the first column indicates Insert mode. These abbreviations are
+only active in Insert mode. Other possible characters are:
+
+ c Command-line mode :cabbrev
+ ! both Insert and Command-line mode :abbreviate
+
+Since abbreviations are not often useful in Command-line mode, you will mostly
+use the ":iabbrev" command. That avoids, for example, that "ad" gets expanded
+when typing a command like: >
+
+ :edit ad
+
+
+DELETING ABBREVIATIONS
+
+To get rid of an abbreviation, use the ":unabbreviate" command. Suppose you
+have the following abbreviation: >
+
+ :abbreviate @f fresh
+
+You can remove it with this command: >
+
+ :unabbreviate @f
+
+While you type this, you will notice that @f is expanded to "fresh". Don't
+worry about this, Vim understands it anyway (except when you have an
+abbreviation for "fresh", but that's very unlikely).
+ To remove all the abbreviations: >
+
+ :abclear
+
+":unabbreviate" and ":abclear" also come in the variants for Insert mode
+(":iunabbreviate and ":iabclear") and Command-line mode (":cunabbreviate" and
+":cabclear").
+
+
+REMAPPING ABBREVIATIONS
+
+There is one thing to watch out for when defining an abbreviation: The
+resulting string should not be mapped. For example: >
+
+ :abbreviate @a adder
+ :imap dd disk-door
+
+When you now type @a, you will get "adisk-doorer". That's not what you want.
+To avoid this, use the ":noreabbrev" command. It does the same as
+":abbreviate", but avoids that the resulting string is used for mappings: >
+
+ :noreabbrev @a adder
+
+Fortunately, it's unlikely that the result of an abbreviation is mapped.
+
+==============================================================================
+*24.8* Entering special characters
+
+The CTRL-V command is used to insert the next character literally. In other
+words, any special meaning the character has, it will be ignored. For
+example: >
+
+ CTRL-V <Esc>
+
+Inserts an escape character. Thus you don't leave Insert mode. (Don't type
+the space after CTRL-V, it's only to make this easier to read).
+
+ Note:
+ On MS-Windows CTRL-V is used to paste text. Use CTRL-Q instead of
+ CTRL-V. On Unix, on the other hand, CTRL-Q does not work on some
+ terminals, because it has a special meaning.
+
+You can also use the command CTRL-V {digits} to insert a character with the
+decimal number {digits}. For example, the character number 127 is the <Del>
+character (but not necessarily the <Del> key!). To insert <Del> type: >
+
+ CTRL-V 127
+
+You can enter characters up to 255 this way. When you type fewer than two
+digits, a non-digit will terminate the command. To avoid the need of typing a
+non-digit, prepend one or two zeros to make three digits.
+ All the next commands insert a <Tab> and then a dot:
+
+ CTRL-V 9.
+ CTRL-V 09.
+ CTRL-V 009.
+
+To enter a character in hexadecimal, use an "x" after the CTRL-V: >
+
+ CTRL-V x7f
+
+This also goes up to character 255 (CTRL-V xff). You can use "o" to type a
+character as an octal number and two more methods allow you to type up to
+a 16 bit and a 32 bit number (e.g., for a Unicode character): >
+
+ CTRL-V o123
+ CTRL-V u1234
+ CTRL-V U12345678
+
+==============================================================================
+*24.9* Digraphs
+
+Some characters are not on the keyboard. For example, the copyright character
+(©). To type these characters in Vim, you use digraphs, where two characters
+represent one. To enter a ©, for example, you press three keys: >
+
+ CTRL-K Co
+
+To find out what digraphs are available, use the following command: >
+
+ :digraphs
+
+Vim will display the digraph table. Here are three lines of it:
+
+ AC ~_ 159 NS | 160 !I ¡ 161 Ct ¢ 162 Pd £ 163 Cu ¤ 164 Ye ¥ 165 ~
+ BB ¦ 166 SE § 167 ': ¨ 168 Co © 169 -a ª 170 << « 171 NO ¬ 172 ~
+ -- ­ 173 Rg ® 174 'm ¯ 175 DG ° 176 +- ± 177 2S ² 178 3S ³ 179 ~
+
+This shows, for example, that the digraph you get by typing CTRL-K Pd is the
+character (£). This is character number 163 (decimal).
+ Pd is short for Pound. Most digraphs are selected to give you a hint about
+the character they will produce. If you look through the list you will
+understand the logic.
+ You can exchange the first and second character, if there is no digraph for
+that combination. Thus CTRL-K dP also works. Since there is no digraph for
+"dP" Vim will also search for a "Pd" digraph.
+
+ Note:
+ The digraphs depend on the character set that Vim assumes you are
+ using. On MS-DOS they are different from MS-Windows. Always use
+ ":digraphs" to find out which digraphs are currently available.
+
+You can define your own digraphs. Example: >
+
+ :digraph a" ä
+
+This defines that CTRL-K a" inserts an ä character. You can also specify the
+character with a decimal number. This defines the same digraph: >
+
+ :digraph a" 228
+
+More information about digraphs here: |digraphs|
+ Another way to insert special characters is with a keymap. More about that
+here: |45.5|
+
+==============================================================================
+*24.10* Normal mode commands
+
+Insert mode offers a limited number of commands. In Normal mode you have many
+more. When you want to use one, you usually leave Insert mode with <Esc>,
+execute the Normal mode command, and re-enter Insert mode with "i" or "a".
+ There is a quicker way. With CTRL-O {command} you can execute any Normal
+mode command from Insert mode. For example, to delete from the cursor to the
+end of the line: >
+
+ CTRL-O D
+
+You can execute only one Normal mode command this way. But you can specify a
+register or a count. A more complicated example: >
+
+ CTRL-O "g3dw
+
+This deletes up to the third word into register g.
+
+==============================================================================
+
+Next chapter: |usr_25.txt| Editing formatted text
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
new file mode 100644
index 000000000..cce72faaf
--- /dev/null
+++ b/runtime/doc/usr_25.txt
@@ -0,0 +1,578 @@
+*usr_25.txt* For Vim version 7.0aa. Last change: 2003 Jun 21
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Editing formatted text
+
+
+Text hardly ever comes in one sentence per line. This chapter is about
+breaking sentences to make them fit on a page and other formatting.
+Vim also has useful features for editing single-line paragraphs and tables.
+
+|25.1| Breaking lines
+|25.2| Aligning text
+|25.3| Indents and tabs
+|25.4| Dealing with long lines
+|25.5| Editing tables
+
+ Next chapter: |usr_26.txt| Repeating
+ Previous chapter: |usr_24.txt| Inserting quickly
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*25.1* Breaking lines
+
+Vim has a number of functions that make dealing with text easier. By default,
+the editor does not perform automatic line breaks. In other words, you have
+to press <Enter> yourself. This is useful when you are writing programs where
+you want to decide where the line ends. It is not so good when you are
+creating documentation and want the text to be at most 70 character wide.
+ If you set the 'textwidth' option, Vim automatically inserts line breaks.
+Suppose, for example, that you want a very narrow column of only 30
+characters. You need to execute the following command: >
+
+ :set textwidth=30
+
+Now you start typing (ruler added):
+
+ 1 2 3
+ 12345678901234567890123456789012345
+ I taught programming for a whi ~
+
+If you type "l" next, this makes the line longer than the 30-character limit.
+When Vim sees this, it inserts a line break and you get the following:
+
+ 1 2 3
+ 12345678901234567890123456789012345
+ I taught programming for a ~
+ whil ~
+
+Continuing on, you can type in the rest of the paragraph:
+
+ 1 2 3
+ 12345678901234567890123456789012345
+ I taught programming for a ~
+ while. One time, I was stopped ~
+ by the Fort Worth police, ~
+ because my homework was too ~
+ hard. True story. ~
+
+You do not have to type newlines; Vim puts them in automatically.
+
+ Note:
+ The 'wrap' option makes Vim display lines with a line break, but this
+ doesn't insert a line break in the file.
+
+
+REFORMATTING
+
+The Vim editor is not a word processor. In a word processor, if you delete
+something at the beginning of the paragraph, the line breaks are reworked. In
+Vim they are not; so if you delete the word "programming" from the first line,
+all you get is a short line:
+
+ 1 2 3
+ 12345678901234567890123456789012345
+ I taught for a ~
+ while. One time, I was stopped ~
+ by the Fort Worth police, ~
+ because my homework was too ~
+ hard. True story. ~
+
+This does not look good. To get the paragraph into shape you use the "gq"
+operator.
+ Let's first use this with a Visual selection. Starting from the first
+line, type: >
+
+ v4jgq
+
+"v" to start Visual mode, "4j' to move to the end of the paragraph and then
+the "gq" operator. The result is:
+
+ 1 2 3
+ 12345678901234567890123456789012345
+ I taught for a while. One ~
+ time, I was stopped by the ~
+ Fort Worth police, because my ~
+ homework was too hard. True ~
+ story. ~
+
+Note: there is a way to do automatic formatting for specific types of text
+layouts, see |auto-format|.
+
+Since "gq" is an operator, you can use one of the three ways to select the
+text it works on: With Visual mode, with a movement and with a text object.
+ The example above could also be done with "gq4j". That's less typing, but
+you have to know the line count. A more useful motion command is "}". This
+moves to the end of a paragraph. Thus "gq}" formats from the cursor to the
+end of the current paragraph.
+ A very useful text object to use with "gq" is the paragraph. Try this: >
+
+ gqap
+
+"ap" stands for "a-paragraph". This formats the text of one paragraph
+(separated by empty lines). Also the part before the cursor.
+ If you have your paragraphs separated by empty lines, you can format the
+whole file by typing this: >
+
+ gggqG
+
+"gg" to move to the first line, "gqG" to format until the last line.
+ Warning: If your paragraphs are not properly separated, they will be joined
+together. A common mistake is to have a line with a space or Tab. That's a
+blank line, but not an empty line.
+
+Vim is able format more than just plain text. See |fo-table| for how to
+change this. See the 'joinspaces' option to change the number of spaces used
+after a full stop.
+ It is possible to use an external program for formatting. This is useful
+if your text can't be properly formatted with Vim's builtin command. See the
+'formatprg' option.
+
+==============================================================================
+*25.2* Aligning text
+
+To center a range of lines, use the following command: >
+
+ :{range}center [width]
+
+{range} is the usual command-line range. [width] is an optional line width to
+use for centering. If [width] is not specified, it defaults to the value of
+'textwidth'. (If 'textwidth' is 0, the default is 80.)
+ For example: >
+
+ :1,5center 40
+
+results in the following:
+
+ I taught for a while. One ~
+ time, I was stopped by the ~
+ Fort Worth police, because my ~
+ homework was too hard. True ~
+ story. ~
+
+
+RIGHT ALIGNMENT
+
+Similarly, the ":right" command right-justifies the text: >
+
+ :1,5right 37
+
+gives this result:
+
+ I taught for a while. One ~
+ time, I was stopped by the ~
+ Fort Worth police, because my ~
+ homework was too hard. True ~
+ story. ~
+
+LEFT ALIGNMENT
+
+Finally there is this command: >
+
+ :{range}left [margin]
+
+Unlike ":center" and ":right", however, the argument to ":left" is not the
+length of the line. Instead it is the left margin. If it is omitted, the
+text will be put against the left side of the screen (using a zero margin
+would do the same). If it is 5, the text will be indented 5 spaces. For
+example, use these commands: >
+
+ :1left 5
+ :2,5left
+
+This results in the following:
+
+ I taught for a while. One ~
+ time, I was stopped by the ~
+ Fort Worth police, because my ~
+ homework was too hard. True ~
+ story. ~
+
+
+JUSTIFYING TEXT
+
+Vim has no built-in way of justifying text. However, there is a neat macro
+package that does the job. To use this package, execute the following
+command: >
+
+ :runtime macros/justify.vim
+
+This Vim script file defines a new visual command "_j". To justify a block of
+text, highlight the text in Visual mode and then execute "_j".
+ Look in the file for more explanations. To go there, do "gf" on this name:
+$VIMRUNTIME/macros/justify.vim.
+
+An alternative is to filter the text through an external program. Example: >
+
+ :%!fmt
+
+==============================================================================
+*25.3* Indents and tabs
+
+Indents can be used to make text stand out from the rest. The example texts
+in this manual, for example, are indented by eight spaces or a tab. You would
+normally enter this by typing a tab at the start of each line. Take this
+text:
+ the first line ~
+ the second line ~
+
+This is entered by typing a tab, some text, <Enter>, tab and more text.
+ The 'autoindent' option inserts indents automatically: >
+
+ :set autoindent
+
+When a new line is started it gets the same indent as the previous line. In
+the above example, the tab after the <Enter> is not needed anymore.
+
+
+INCREASING INDENT
+
+To increase the amount of indent in a line, use the ">" operator. Often this
+is used as ">>", which adds indent to the current line.
+ The amount of indent added is specified with the 'shiftwidth' option. The
+default value is 8. To make ">>" insert four spaces worth of indent, for
+example, type this: >
+
+ :set shiftwidth=4
+
+When used on the second line of the example text, this is what you get:
+
+ the first line ~
+ the second line ~
+
+"4>>" will increase the indent of four lines.
+
+
+TABSTOP
+
+If you want to make indents a multiple of 4, you set 'shiftwidth' to 4. But
+when pressing a Tab you still get 8 spaces worth of indent. To change this,
+set the 'softtabstop' option: >
+
+ :set softtabstop=4
+
+This will make the <Tab> key insert 4 spaces worth of indent. If there are
+already four spaces, a <Tab> character is used (saving seven characters in the
+file). (If you always want spaces and no tab characters, set the 'expandtab'
+option.)
+
+ Note:
+ You could set the 'tabstop' option to 4. However, if you edit the
+ file another time, with 'tabstop' set to the default value of 8, it
+ will look wrong. In other programs and when printing the indent will
+ also be wrong. Therefore it is recommended to keep 'tabstop' at eight
+ all the time. That's the standard value everywhere.
+
+
+CHANGING TABS
+
+You edit a file which was written with a tabstop of 3. In Vim it looks ugly,
+because it uses the normal tabstop value of 8. You can fix this by setting
+'tabstop' to 3. But you have to do this every time you edit this file.
+ Vim can change the use of tabstops in your file. First, set 'tabstop' to
+make the indents look good, then use the ":retab" command: >
+
+ :set tabstop=3
+ :retab 8
+
+The ":retab" command will change 'tabstop' to 8, while changing the text such
+that it looks the same. It changes spans of white space into tabs and spaces
+for this. You can now write the file. Next time you edit it the indents will
+be right without setting an option.
+ Warning: When using ":retab" on a program, it may change white space inside
+a string constant. Therefore it's a good habit to use "\t" instead of a
+real tab.
+
+==============================================================================
+*25.4* Dealing with long lines
+
+Sometimes you will be editing a file that is wider than the number of columns
+in the window. When that occurs, Vim wraps the lines so that everything fits
+on the screen.
+ If you switch the 'wrap' option off, each line in the file shows up as one
+line on the screen. Then the ends of the long lines disappear off the screen
+to the right.
+ When you move the cursor to a character that can't be seen, Vim will scroll
+the text to show it. This is like moving a viewport over the text in the
+horizontal direction.
+ By default, Vim does not display a horizontal scrollbar in the GUI. If you
+want to enable one, use the following command: >
+
+ :set guioptions+=b
+
+One horizontal scrollbar will appear at the bottom of the Vim window.
+
+If you don't have a scrollbar or don't want to use it, use these commands to
+scroll the text. The cursor will stay in the same place, but it's move back
+into the visible text if necessary.
+
+ zh scroll right
+ 4zh scroll four characters right
+ zH scroll half a window width right
+ ze scroll right to put the cursor at the end
+ zl scroll left
+ 4zl scroll four characters left
+ zL scroll half a window width left
+ zs scroll left to put the cursor at the start
+
+Let's attempt to show this with one line of text. The cursor is on the "w" of
+"which". The "current window" above the line indicates the text that is
+currently visible. The "window"s below the text indicate the text that is
+visible after the command left of it.
+
+ |<-- current window -->|
+ some long text, part of which is visible in the window ~
+ ze |<-- window -->|
+ zH |<-- window -->|
+ 4zh |<-- window -->|
+ zh |<-- window -->|
+ zl |<-- window -->|
+ 4zl |<-- window -->|
+ zL |<-- window -->|
+ zs |<-- window -->|
+
+
+MOVING WITH WRAP OFF
+
+When 'wrap' is off and the text has scrolled horizontally, you can use the
+following commands to move the cursor to a character you can see. Thus text
+left and right of the window is ignored. These never cause the text to
+scroll:
+
+ g0 to first visible character in this line
+ g^ to first non-blank visible character in this line
+ gm to middle of this line
+ g$ to last visible character in this line
+
+ |<-- window -->|
+ some long text, part of which is visible ~
+ g0 g^ gm g$
+
+
+BREAKING AT WORDS *edit-no-break*
+
+When preparing text for use by another program, you might have to make
+paragraphs without a line break. A disadvantage of using 'nowrap' is that you
+can't see the whole sentence you are working on. When 'wrap' is on, words are
+broken halfway, which makes them hard to read.
+ A good solution for editing this kind of paragraph is setting the
+'linebreak' option. Vim then breaks lines at an appropriate place when
+displaying the line. The text in the file remains unchanged.
+ Without 'linebreak' text might look like this:
+
+ +---------------------------------+
+ |letter generation program for a b|
+ |ank. They wanted to send out a s|
+ |pecial, personalized letter to th|
+ |eir richest 1000 customers. Unfo|
+ |rtunately for the programmer, he |
+ +---------------------------------+
+After: >
+
+ :set linebreak
+
+it looks like this:
+
+ +---------------------------------+
+ |letter generation program for a |
+ |bank. They wanted to send out a |
+ |special, personalized letter to |
+ |their richest 1000 customers. |
+ |Unfortunately for the programmer,|
+ +---------------------------------+
+
+Related options:
+'breakat' specifies the characters where a break can be inserted.
+'showbreak' specifies a string to show at the start of broken line.
+Set 'textwidth' to zero to avoid a paragraph to be split.
+
+
+MOVING BY VISIBLE LINES
+
+The "j" and "k" commands move to the next and previous lines. When used on
+a long line, this means moving a lot of screen lines at once.
+ To move only one screen line, use the "gj" and "gk" commands. When a line
+doesn't wrap they do the same as "j" and "k". When the line does wrap, they
+move to a character displayed one line below or above.
+ You might like to use these mappings, which bind these movement commands to
+the cursor keys: >
+
+ :map <Up> gk
+ :map <Down> gj
+
+
+TURNING A PARAGRAPH INTO ONE LINE
+
+If you want to import text into a program like MS-Word, each paragraph should
+be a single line. If your paragraphs are currently separated with empty
+lines, this is how you turn each paragraph into a single line: >
+
+ :g/./,/^$/join
+
+That looks complicated. Let's break it up in pieces:
+
+ :g/./ A ":global" command that finds all lines that contain
+ at least one character.
+ ,/^$/ A range, starting from the current line (the non-empty
+ line) until an empty line.
+ join The ":join" command joins the range of lines together
+ into one line.
+
+Starting with this text, containing eight lines broken at column 30:
+
+ +----------------------------------+
+ |A letter generation program |
+ |for a bank. They wanted to |
+ |send out a special, |
+ |personalized letter. |
+ | |
+ |To their richest 1000 |
+ |customers. Unfortunately for |
+ |the programmer, |
+ +----------------------------------+
+
+You end up with two lines:
+
+ +----------------------------------+
+ |A letter generation program for a |
+ |bank. They wanted to send out a s|
+ |pecial, personalized letter. |
+ |To their richest 1000 customers. |
+ |Unfortunately for the programmer, |
+ +----------------------------------+
+
+Note that this doesn't work when the separating line is blank but not empty;
+when it contains spaces and/or tabs. This command does work with blank lines:
+>
+ :g/\S/,/^\s*$/join
+
+This still requires a blank or empty line at the end of the file for the last
+paragraph to be joined.
+
+==============================================================================
+*25.5* Editing tables
+
+Suppose you are editing a table with four columns:
+
+ nice table test 1 test 2 test 3 ~
+ input A 0.534 ~
+ input B 0.913 ~
+
+You need to enter numbers in the third column. You could move to the second
+line, use "A", enter a lot of spaces and type the text.
+ For this kind of editing there is a special option: >
+
+ set virtualedit=all
+
+Now you can move the cursor to positions where there isn't any text. This is
+called "virtual space". Editing a table is a lot easier this way.
+ Move the cursor by searching for the header of the last column: >
+
+ /test 3
+
+Now press "j" and you are right where you can enter the value for "input A".
+Typing "0.693" results in:
+
+ nice table test 1 test 2 test 3 ~
+ input A 0.534 0.693 ~
+ input B 0.913 ~
+
+Vim has automatically filled the gap in front of the new text for you. Now,
+to enter the next field in this column use "Bj". "B" moves back to the start
+of a white space separated word. Then "j" moves to the place where the next
+field can be entered.
+
+ Note:
+ You can move the cursor anywhere in the display, also beyond the end
+ of a line. But Vim will not insert spaces there, until you insert a
+ character in that position.
+
+
+COPYING A COLUMN
+
+You want to add a column, which should be a copy of the third column and
+placed before the "test 1" column. Do this in seven steps:
+1. Move the cursor to the left upper corner of this column, e.g., with
+ "/test 3".
+2. Press CTRL-V to start blockwise Visual mode.
+3. Move the cursor down two lines with "2j". You are now in "virtual space":
+ the "input B" line of the "test 3" column.
+4. Move the cursor right, to include the whole column in the selection, plus
+ the space that you want between the columns. "9l" should do it.
+5. Yank the selected rectangle with "y".
+6. Move the cursor to "test 1", where the new column must be placed.
+7. Press "P".
+
+The result should be:
+
+ nice table test 3 test 1 test 2 test 3 ~
+ input A 0.693 0.534 0.693 ~
+ input B 0.913 ~
+
+Notice that the whole "test 1" column was shifted right, also the line where
+the "test 3" column didn't have text.
+
+Go back to non-virtual cursor movements with: >
+
+ :set virtualedit=
+
+
+VIRTUAL REPLACE MODE
+
+The disadvantage of using 'virtualedit' is that it "feels" different. You
+can't recognize tabs or spaces beyond the end of line when moving the cursor
+around. Another method can be used: Virtual Replace mode.
+ Suppose you have a line in a table that contains both tabs and other
+characters. Use "rx" on the first tab:
+
+ inp 0.693 0.534 0.693 ~
+
+ |
+ rx |
+ V
+
+ inpx0.693 0.534 0.693 ~
+
+The layout is messed up. To avoid that, use the "gr" command:
+
+ inp 0.693 0.534 0.693 ~
+
+ |
+ grx |
+ V
+
+ inpx 0.693 0.534 0.693 ~
+
+What happens is that the "gr" command makes sure the new character takes the
+right amount of screen space. Extra spaces or tabs are inserted to fill the
+gap. Thus what actually happens is that a tab is replaced by "x" and then
+blanks added to make the text after it keep it's place. In this case a
+tab is inserted.
+ When you need to replace more than one character, you use the "R" command
+to go to Replace mode (see |04.9|). This messes up the layout and replaces
+the wrong characters:
+
+ inp 0 0.534 0.693 ~
+
+ |
+ R0.786 |
+ V
+
+ inp 0.78634 0.693 ~
+
+The "gR" command uses Virtual Replace mode. This preserves the layout:
+
+ inp 0 0.534 0.693 ~
+
+ |
+ gR0.786 |
+ V
+
+ inp 0.786 0.534 0.693 ~
+
+==============================================================================
+
+Next chapter: |usr_26.txt| Repeating
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_26.txt b/runtime/doc/usr_26.txt
new file mode 100644
index 000000000..018763f6e
--- /dev/null
+++ b/runtime/doc/usr_26.txt
@@ -0,0 +1,221 @@
+*usr_26.txt* For Vim version 7.0aa. Last change: 2002 Oct 29
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Repeating
+
+
+An editing task is hardly ever unstructured. A change often needs to be made
+several times. In this chapter a number of useful ways to repeat a change
+will be explained.
+
+|26.1| Repeating with Visual mode
+|26.2| Add and subtract
+|26.3| Making a change in many files
+|26.4| Using Vim from a shell script
+
+ Next chapter: |usr_27.txt| Search commands and patterns
+ Previous chapter: |usr_25.txt| Editing formatted text
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*26.1* Repeating with Visual mode
+
+Visual mode is very handy for making a change in any sequence of lines. You
+can see the highlighted text, thus you can check if the correct lines are
+changed. But making the selection takes some typing. The "gv" command
+selects the same area again. This allows you to do another operation on the
+same text.
+ Suppose you have some lines where you want to change "2001" to "2002" and
+"2000" to "2001":
+
+ The financial results for 2001 are better ~
+ than for 2000. The income increased by 50%, ~
+ even though 2001 had more rain than 2000. ~
+ 2000 2001 ~
+ income 45,403 66,234 ~
+
+First change "2001" to "2002". Select the lines in Visual mode, and use: >
+
+ :s/2001/2002/g
+
+Now use "gv" to reselect the same text. It doesn't matter where the cursor
+is. Then use ":s/2000/2001/g" to make the second change.
+ Obviously, you can repeat these changes several times.
+
+==============================================================================
+*26.2* Add and subtract
+
+When repeating the change of one number into another, you often have a fixed
+offset. In the example above, one was added to each year. Instead of typing
+a substitute command for each year that appears, the CTRL-A command can be
+used.
+ Using the same text as above, search for a year: >
+
+ /19[0-9][0-9]\|20[0-9][0-9]
+
+Now press CTRL-A. The year will be increased by one:
+
+ The financial results for 2002 are better ~
+ than for 2000. The income increased by 50%, ~
+ even though 2001 had more rain than 2000. ~
+ 2000 2001 ~
+ income 45,403 66,234 ~
+
+Use "n" to find the next year, and press "." to repeat the CTRL-A ("." is a
+bit quicker to type). Repeat "n" and "." for all years that appear.
+ Hint: set the 'hlsearch' option to see the matches you are going to change,
+then you can look ahead and do it faster.
+
+Adding more than one can be done by prepending the number to CTRL-A. Suppose
+you have this list:
+
+ 1. item four ~
+ 2. item five ~
+ 3. item six ~
+
+Move the cursor to "1." and type: >
+
+ 3 CTRL-A
+
+The "1." will change to "4.". Again, you can use "." to repeat this on the
+other numbers.
+
+Another example:
+
+ 006 foo bar ~
+ 007 foo bar ~
+
+Using CTRL-A on these numbers results in:
+
+ 007 foo bar ~
+ 010 foo bar ~
+
+7 plus one is 10? What happened here is that Vim recognized "007" as an octal
+number, because there is a leading zero. This notation is often used in C
+programs. If you do not want a number with leading zeros to be handled as
+octal, use this: >
+
+ :set nrformats-=octal
+
+The CTRL-X command does subtraction in a similar way.
+
+==============================================================================
+*26.3* Making a change in many files
+
+Suppose you have a variable called "x_cnt" and you want to change it to
+"x_counter". This variable is used in several of your C files. You need to
+change it in all files. This is how you do it.
+ Put all the relevant files in the argument list: >
+
+ :args *.c
+<
+This finds all C files and edits the first one. Now you can perform a
+substitution command on all these files: >
+
+ :argdo %s/\<x_cnt\>/x_counter/ge | update
+
+The ":argdo" command takes an argument that is another command. That command
+will be executed on all files in the argument list.
+ The "%s" substitute command that follows works on all lines. It finds the
+word "x_cnt" with "\<x_cnt\>". The "\<" and "\>" are used to match the whole
+word only, and not "px_cnt" or "x_cnt2".
+ The flags for the substitute command include "g" to replace all occurrences
+of "x_cnt" in the same line. The "e" flag is used to avoid an error message
+when "x_cnt" does not appear in the file. Otherwise ":argdo" would abort on
+the first file where "x_cnt" was not found.
+ The "|" separates two commands. The following "update" command writes the
+file only if it was changed. If no "x_cnt" was changed to "x_counter" nothing
+happens.
+
+There is also the ":windo" command, which executes its argument in all
+windows. And ":bufdo" executes its argument on all buffers. Be careful with
+this, because you might have more files in the buffer list than you think.
+Check this with the ":buffers" command (or ":ls").
+
+==============================================================================
+*26.4* Using Vim from a shell script
+
+Suppose you have a lot of files in which you need to change the string
+"-person-" to "Jones" and then print it. How do you do that? One way is to
+do a lot of typing. The other is to write a shell script to do the work.
+ The Vim editor does a superb job as a screen-oriented editor when using
+Normal mode commands. For batch processing, however, Normal mode commands do
+not result in clear, commented command files; so here you will use Ex mode
+instead. This mode gives you a nice command-line interface that makes it easy
+to put into a batch file. ("Ex command" is just another name for a
+command-line (:) command.)
+ The Ex mode commands you need are as follows: >
+
+ %s/-person-/Jones/g
+ write tempfile
+ quit
+
+You put these commands in the file "change.vim". Now to run the editor in
+batch mode, use this shell script: >
+
+ for file in *.txt; do
+ vim -e -s $file < change.vim
+ lpr -r tempfile
+ done
+
+The for-done loop is a shell construct to repeat the two lines in between,
+while the $file variable is set to a different file name each time.
+ The second line runs the Vim editor in Ex mode (-e argument) on the file
+$file and reads commands from the file "change.vim". The -s argument tells
+Vim to operate in silent mode. In other words, do not keep outputting the
+:prompt, or any other prompt for that matter.
+ The "lpr -r tempfile" command prints the resulting "tempfile" and deletes
+it (that's what the -r argument does).
+
+
+READING FROM STDIN
+
+Vim can read text on standard input. Since the normal way is to read commands
+there, you must tell Vim to read text instead. This is done by passing the
+"-" argument in place of a file. Example: >
+
+ ls | vim -
+
+This allows you to edit the output of the "ls" command, without first saving
+the text in a file.
+ If you use the standard input to read text from, you can use the "-S"
+argument to read a script: >
+
+ producer | vim -S change.vim -
+
+
+NORMAL MODE SCRIPTS
+
+If you really want to use Normal mode commands in a script, you can use it
+like this: >
+
+ vim -s script file.txt ...
+<
+ Note:
+ "-s" has a different meaning when it is used without "-e". Here it
+ means to source the "script" as Normal mode commands. When used with
+ "-e" it means to be silent, and doesn't use the next argument as a
+ file name.
+
+The commands in "script" are executed like you typed them. Don't forget that
+a line break is interpreted as pressing <Enter>. In Normal mode that moves
+the cursor to the next line.
+ To create the script you can edit the script file and type the commands.
+You need to imagine what the result would be, which can be a bit difficult.
+Another way is to record the commands while you perform them manually. This
+is how you do that: >
+
+ vim -w script file.txt ...
+
+All typed keys will be written to "script". If you make a small mistake you
+can just continue and remember to edit the script later.
+ The "-w" argument appends to an existing script. That is good when you
+want to record the script bit by bit. If you want to start from scratch and
+start all over, use the "-W" argument. It overwrites any existing file.
+
+==============================================================================
+
+Next chapter: |usr_27.txt| Search commands and patterns
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt
new file mode 100644
index 000000000..46fb19070
--- /dev/null
+++ b/runtime/doc/usr_27.txt
@@ -0,0 +1,563 @@
+*usr_27.txt* For Vim version 7.0aa. Last change: 2003 Oct 28
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Search commands and patterns
+
+
+In chapter 3 a few simple search patterns were mentioned |03.9|. Vim can do
+much more complex searches. This chapter explains the most often used ones.
+A detailed specification can be found here: |pattern|
+
+|27.1| Ignoring case
+|27.2| Wrapping around the file end
+|27.3| Offsets
+|27.4| Matching multiple times
+|27.5| Alternatives
+|27.6| Character ranges
+|27.7| Character classes
+|27.8| Matching a line break
+|27.9| Examples
+
+ Next chapter: |usr_28.txt| Folding
+ Previous chapter: |usr_26.txt| Repeating
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*27.1* Ignoring case
+
+By default, Vim's searches are case sensitive. Therefore, "include",
+"INCLUDE", and "Include" are three different words and a search will match
+only one of them.
+ Now switch on the 'ignorecase' option: >
+
+ :set ignorecase
+
+Search for "include" again, and now it will match "Include", "INCLUDE" and
+"InClUDe". (Set the 'hlsearch' option to quickly see where a pattern
+matches.)
+ You can switch this off again with: >
+
+ :set noignorecase
+
+But lets keep it set, and search for "INCLUDE". It will match exactly the
+same text as "include" did. Now set the 'smartcase' option: >
+
+ :set ignorecase smartcase
+
+If you have a pattern with at least one uppercase character, the search
+becomes case sensitive. The idea is that you didn't have to type that
+uppercase character, so you must have done it because you wanted case to
+match. That's smart!
+ With these two options set you find the following matches:
+
+ pattern matches ~
+ word word, Word, WORD, WoRd, etc.
+ Word Word
+ WORD WORD
+ WoRd WoRd
+
+
+CASE IN ONE PATTERN
+
+If you want to ignore case for one specific pattern, you can do this by
+prepending the "\c" string. Using "\C" will make the pattern to match case.
+This overrules the 'ignorecase' and 'smartcase' options, when "\c" or "\C" is
+used their value doesn't matter.
+
+ pattern matches ~
+ \Cword word
+ \CWord Word
+ \cword word, Word, WORD, WoRd, etc.
+ \cWord word, Word, WORD, WoRd, etc.
+
+A big advantage of using "\c" and "\C" is that it sticks with the pattern.
+Thus if you repeat a pattern from the search history, the same will happen, no
+matter if 'ignorecase' or 'smartcase' was changed.
+
+ Note:
+ The use of "\" items in search patterns depends on the 'magic' option.
+ In this chapters we will assume 'magic' is on, because that is the
+ standard and recommended setting. If you would change 'magic', many
+ search patterns would suddenly become invalid.
+
+ Note:
+ If your search takes much longer than you expected, you can interrupt
+ it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows.
+
+==============================================================================
+*27.2* Wrapping around the file end
+
+By default, a forward search starts searching for the given string at the
+current cursor location. It then proceeds to the end of the file. If it has
+not found the string by that time, it starts from the beginning and searches
+from the start of the file to the cursor location.
+ Keep in mind that when repeating the "n" command to search for the next
+match, you eventually get back to the first match. If you don't notice this
+you keep searching forever! To give you a hint, Vim displays this message:
+
+ search hit BOTTOM, continuing at TOP ~
+
+If you use the "?" command, to search in the other direction, you get this
+message:
+
+ search hit TOP, continuing at BOTTOM ~
+
+Still, you don't know when you are back at the first match. One way to see
+this is by switching on the 'ruler' option: >
+
+ :set ruler
+
+Vim will display the cursor position in the lower righthand corner of the
+window (in the status line if there is one). It looks like this:
+
+ 101,29 84% ~
+
+The first number is the line number of the cursor. Remember the line number
+where you started, so that you can check if you passed this position again.
+
+
+NOT WRAPPING
+
+To turn off search wrapping, use the following command: >
+
+ :set nowrapscan
+
+Now when the search hits the end of the file, an error message displays:
+
+ E385: search hit BOTTOM without match for: forever ~
+
+Thus you can find all matches by going to the start of the file with "gg" and
+keep searching until you see this message.
+ If you search in the other direction, using "?", you get:
+
+ E384: search hit TOP without match for: forever ~
+
+==============================================================================
+*27.3* Offsets
+
+By default, the search command leaves the cursor positioned on the beginning
+of the pattern. You can tell Vim to leave it some other place by specifying
+an offset. For the forward search command "/", the offset is specified by
+appending a slash (/) and the offset: >
+
+ /default/2
+
+This command searches for the pattern "default" and then moves to the
+beginning of the second line past the pattern. Using this command on the
+paragraph above, Vim finds the word "default" in the first line. Then the
+cursor is moved two lines down and lands on "an offset".
+
+If the offset is a simple number, the cursor will be placed at the beginning
+of the line that many lines from the match. The offset number can be positive
+or negative. If it is positive, the cursor moves down that many lines; if
+negative, it moves up.
+
+
+CHARACTER OFFSETS
+
+The "e" offset indicates an offset from the end of the match. It moves the
+cursor onto the last character of the match. The command: >
+
+ /const/e
+
+puts the cursor on the "t" of "const".
+ From that position, adding a number moves forward that many characters.
+This command moves to the character just after the match: >
+
+ /const/e+1
+
+A positive number moves the cursor to the right, a negative number moves it to
+the left. For example: >
+
+ /const/e-1
+
+moves the cursor to the "s" of "const".
+
+If the offset begins with "b", the cursor moves to the beginning of the
+pattern. That's not very useful, since leaving out the "b" does the same
+thing. It does get useful when a number is added or subtracted. The cursor
+then goes forward or backward that many characters. For example: >
+
+ /const/b+2
+
+Moves the cursor to the beginning of the match and then two characters to the
+right. Thus it lands on the "n".
+
+
+REPEATING
+
+To repeat searching for the previously used search pattern, but with a
+different offset, leave out the pattern: >
+
+ /that
+ //e
+
+Is equal to: >
+
+ /that/e
+
+To repeat with the same offset: >
+
+ /
+
+"n" does the same thing. To repeat while removing a previously used offset: >
+
+ //
+
+
+SEARCHING BACKWARDS
+
+The "?" command uses offsets in the same way, but you must use "?" to separate
+the offset from the pattern, instead of "/": >
+
+ ?const?e-2
+
+The "b" and "e" keep their meaning, they don't change direction with the use
+of "?".
+
+
+START POSITION
+
+When starting a search, it normally starts at the cursor position. When you
+specify a line offset, this can cause trouble. For example: >
+
+ /const/-2
+
+This finds the next word "const" and then moves two lines up. If you
+use "n" to search again, Vim could start at the current position and find the same
+"const" match. Then using the offset again, you would be back where you started.
+You would be stuck!
+ It could be worse: Suppose there is another match with "const" in the next
+line. Then repeating the forward search would find this match and move two
+lines up. Thus you would actually move the cursor back!
+
+When you specify a character offset, Vim will compensate for this. Thus the
+search starts a few characters forward or backward, so that the same match
+isn't found again.
+
+==============================================================================
+*27.4* Matching multiple times
+
+The "*" item specifies that the item before it can match any number of times.
+Thus: >
+
+ /a*
+
+matches "a", "aa", "aaa", etc. But also "" (the empty string), because zero
+times is included.
+ The "*" only applies to the item directly before it. Thus "ab*" matches
+"a", "ab", "abb", "abbb", etc. To match a whole string multiple times, it
+must be grouped into one item. This is done by putting "\(" before it and
+"\)" after it. Thus this command: >
+
+ /\(ab\)*
+
+Matches: "ab", "abab", "ababab", etc. And also "".
+
+To avoid matching the empty string, use "\+". This makes the previous item
+match one or more times. >
+
+ /ab\+
+
+Matches "ab", "abb", "abbb", etc. It does not match "a" when no "b" follows.
+
+To match an optional item, use "\=". Example: >
+
+ /folders\=
+
+Matches "folder" and "folders".
+
+
+SPECIFIC COUNTS
+
+To match a specific number of items use the form "\{n,m}". "n" and "m" are
+numbers. The item before it will be matched "n" to "m" times |inclusive|.
+Example: >
+
+ /ab\{3,5}
+
+matches "abbb", "abbbb" and "abbbbb".
+ When "n" is omitted, it defaults to zero. When "m" is omitted it defaults
+to infinity. When ",m" is omitted, it matches exactly "n" times.
+Examples:
+
+ pattern match count ~
+ \{,4} 0, 1, 2, 3 or 4
+ \{3,} 3, 4, 5, etc.
+ \{0,1} 0 or 1, same as \=
+ \{0,} 0 or more, same as *
+ \{1,} 1 or more, same as \+
+ \{3} 3
+
+
+MATCHING AS LITTLE AS POSSIBLE
+
+The items so far match as many characters as they can find. To match as few
+as possible, use "\{-n,m}". It works the same as "\{n,m}", except that the
+minimal amount possible is used.
+ For example, use: >
+
+ /ab\{-1,3}
+
+Will match "ab" in "abbb". Actually, it will never match more than one b,
+because there is no reason to match more. It requires something else to force
+it to match more than the lower limit.
+ The same rules apply to removing "n" and "m". It's even possible to remove
+both of the, resulting in "\{-}". This matches the item before it zero or
+more times, as few as possible. The item by itself always match zero times.
+It is useful when combined with something else. Example: >
+
+ /a.\{-}b
+
+This matches "axb" in "axbxb". If this pattern would be used: >
+
+ /a.*b
+
+It would try to match as many characters as possible with ".*", thus it
+matches "axbxb" as a whole.
+
+==============================================================================
+*27.5* Alternatives
+
+The "or" operator in a pattern is "\|". Example: >
+
+ /foo\|bar
+
+This matches "foo" or "bar". More alternatives can be concatenated: >
+
+ /one\|two\|three
+
+Matches "one", "two" and "three".
+ To match multiple times, the whole thing must be placed in "\(" and "\)": >
+
+ /\(foo\|bar\)\+
+
+This matches "foo", "foobar", "foofoo", "barfoobar", etc.
+ Another example: >
+
+ /end\(if\|while\|for\)
+
+This matches "endif", "endwhile" and "endfor".
+
+A related item is "\&". This requires that both alternatives match in the
+same place. The resulting match uses the last alternative. Example: >
+
+ /forever\&...
+
+This matches "for" in "forever". It will not match "fortuin", for example.
+
+==============================================================================
+*27.6* Character ranges
+
+To match "a", "b" or "c" you could use "/a\|b\|c". When you want to match all
+letters from "a" to "z" this gets very long. There is a shorter method: >
+
+ /[a-z]
+
+The [] construct matches a single character. Inside you specify which
+characters to match. You can include a list of characters, like this: >
+
+ /[0123456789abcdef]
+
+This will match any of the characters included. For consecutive characters
+you can specify the range. "0-3" stands for "0123". "w-z" stands for "wxyz".
+Thus the same command as above can be shortened to: >
+
+ /[0-9a-f]
+
+To match the "-" character itself make it the first or last one in the range.
+These special characters are accepted to make it easier to use them inside a
+[] range (they can actually be used anywhere in the search pattern):
+
+ \e <Esc>
+ \t <Tab>
+ \r <CR>
+ \b <BS>
+
+There are a few more special cases for [] ranges, see |/[]| for the whole
+story.
+
+
+COMPLEMENTED RANGE
+
+To avoid matching a specific character, use "^" at the start of the range.
+The [] item then matches everything but the characters included. Example: >
+
+ /"[^"]*"
+<
+ " a double quote
+ [^"] any character that is not a double quote
+ * as many as possible
+ " a double quote again
+
+This matches "foo" and "3!x", including the double quotes.
+
+
+PREDEFINED RANGES
+
+A number of ranges are used very often. Vim provides a shortcut for these.
+For example: >
+
+ /\a
+
+Finds alphabetic characters. This is equal to using "/[a-zA-Z]". Here are a
+few more of these:
+
+ item matches equivalent ~
+ \d digit [0-9]
+ \D non-digit [^0-9]
+ \x hex digit [0-9a-fA-F]
+ \X non-hex digit [^0-9a-fA-F]
+ \s white space [ ] (<Tab> and <Space>)
+ \S non-white characters [^ ] (not <Tab> and <Space>)
+ \l lowercase alpha [a-z]
+ \L non-lowercase alpha [^a-z]
+ \u uppercase alpha [A-Z]
+ \U non-uppercase alpha [^A-Z]
+
+ Note:
+ Using these predefined ranges works a lot faster than the character
+ range it stands for.
+ These items can not be used inside []. Thus "[\d\l]" does NOT work to
+ match a digit or lowercase alpha. Use "\(\d\|\l\)" instead.
+
+See |/\s| for the whole list of these ranges.
+
+==============================================================================
+*27.7* Character classes
+
+The character range matches a fixed set of characters. A character class is
+similar, but with an essential difference: The set of characters can be
+redefined without changing the search pattern.
+ For example, search for this pattern: >
+
+ /\f\+
+
+The "\f" items stands for file name characters. Thus this matches a sequence
+of characters that can be a file name.
+ Which characters can be part of a file name depends on the system you are
+using. On MS-Windows, the backslash is included, on Unix it is not. This is
+specified with the 'isfname' option. The default value for Unix is: >
+
+ :set isfname
+ isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
+
+For other systems the default value is different. Thus you can make a search
+pattern with "\f" to match a file name, and it will automatically adjust to
+the system you are using it on.
+
+ Note:
+ Actually, Unix allows using just about any character in a file name,
+ including white space. Including these characters in 'isfname' would
+ be theoretically correct. But it would make it impossible to find the
+ end of a file name in text. Thus the default value of 'isfname' is a
+ compromise.
+
+The character classes are:
+
+ item matches option ~
+ \i identifier characters 'isident'
+ \I like \i, excluding digits
+ \k keyword characters 'iskeyword'
+ \K like \k, excluding digits
+ \p printable characters 'isprint'
+ \P like \p, excluding digits
+ \f file name characters 'isfname'
+ \F like \f, excluding digits
+
+==============================================================================
+*27.8* Matching a line break
+
+Vim can find a pattern that includes a line break. You need to specify where
+the line break happens, because all items mentioned so far don't match a line
+break.
+ To check for a line break in a specific place, use the "\n" item: >
+
+ /the\nword
+
+This will match at a line that ends in "the" and the next line starts with
+"word". To match "the word" as well, you need to match a space or a line
+break. The item to use for it is "\_s": >
+
+ /the\_sword
+
+To allow any amount of white space: >
+
+ /the\_s\+word
+
+This also matches when "the " is at the end of a line and " word" at the
+start of the next one.
+
+"\s" matches white space, "\_s" matches white space or a line break.
+Similarly, "\a" matches an alphabetic character, and "\_a" matches an
+alphabetic character or a line break. The other character classes and ranges
+can be modified in the same way by inserting a "_".
+
+Many other items can be made to match a line break by prepending "\_". For
+example: "\_." matches any character or a line break.
+
+ Note:
+ "\_.*" matches everything until the end of the file. Be careful with
+ this, it can make a search command very slow.
+
+Another example is "\_[]", a character range that includes a line break: >
+
+ /"\_[^"]*"
+
+This finds a text in double quotes that may be split up in several lines.
+
+==============================================================================
+*27.9* Examples
+
+Here are a few search patterns you might find useful. This shows how the
+items mentioned above can be combined.
+
+
+FINDING A CALIFORNIA LICENSE PLATE
+
+A sample license place number is "1MGU103". It has one digit, three uppercase
+letters and three digits. Directly putting this into a search pattern: >
+
+ /\d\u\u\u\d\d\d
+
+Another way is to specify that there are three digits and letters with a
+count: >
+
+ /\d\u\{3}\d\{3}
+
+Using [] ranges instead: >
+
+ /[0-9][A-Z]\{3}[0-9]\{3}
+
+Which one of these you should use? Whichever one you can remember. The
+simple way you can remember is much faster than the fancy way that you can't.
+If you can remember them all, then avoid the last one, because it's both more
+typing and slower to execute.
+
+
+FINDING AN IDENTIFIER
+
+In C programs (and many other computer languages) an identifier starts with a
+letter and further consists of letters and digits. Underscores can be used
+too. This can be found with: >
+
+ /\<\h\w*\>
+
+"\<" and "\>" are used to find only whole words. "\h" stands for "[A-Za-z_]"
+and "\w" for "[0-9A-Za-z_]".
+
+ Note:
+ "\<" and "\>" depend on the 'iskeyword' option. If it includes "-",
+ for example, then "ident-" is not matched. In this situation use: >
+
+ /\w\@<!\h\w*\w\@!
+<
+ This checks if "\w" does not match before or after the identifier.
+ See |/\@<!| and |/\@!|.
+
+==============================================================================
+
+Next chapter: |usr_28.txt| Folding
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_28.txt b/runtime/doc/usr_28.txt
new file mode 100644
index 000000000..522dc3f9f
--- /dev/null
+++ b/runtime/doc/usr_28.txt
@@ -0,0 +1,426 @@
+*usr_28.txt* For Vim version 7.0aa. Last change: 2003 Dec 21
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Folding
+
+
+Structured text can be separated in sections. And sections in sub-sections.
+Folding allows you to display a section as one line, providing an overview.
+This chapter explains the different ways this can be done.
+
+|28.1| What is folding?
+|28.2| Manual folding
+|28.3| Working with folds
+|28.4| Saving and restoring folds
+|28.5| Folding by indent
+|28.6| Folding with markers
+|28.7| Folding by syntax
+|28.8| Folding by expression
+|28.9| Folding unchanged lines
+|28.10| Which fold method to use?
+
+ Next chapter: |usr_29.txt| Moving through programs
+ Previous chapter: |usr_27.txt| Search commands and patterns
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*28.1* What is folding?
+
+Folding is used to show a range of lines in the buffer as a single line on the
+screen. Like a piece of paper which is folded to make it shorter:
+
+ +------------------------+
+ | line 1 |
+ | line 2 |
+ | line 3 |
+ |_______________________ |
+ \ \
+ \________________________\
+ / folded lines /
+ /________________________/
+ | line 12 |
+ | line 13 |
+ | line 14 |
+ +------------------------+
+
+The text is still in the buffer, unchanged. Only the way lines are displayed
+is affected by folding.
+
+The advantage of folding is that you can get a better overview of the
+structure of text, by folding lines of a section and replacing it with a line
+that indicates that there is a section.
+
+==============================================================================
+*28.2* Manual folding
+
+Try it out: Position the cursor in a paragraph and type: >
+
+ zfap
+
+You will see that the paragraph is replaced by a highlighted line. You have
+created a fold. |zf| is an operator and |ap| a text object selection. You
+can use the |zf| operator with any movement command to create a fold for the
+text that it moved over. |zf| also works in Visual mode.
+
+To view the text again, open the fold by typing: >
+
+ zo
+
+And you can close the fold again with: >
+
+ zc
+
+All the folding commands start with "z". With some fantasy, this looks like a
+folded piece of paper, seen from the side. The letter after the "z" has a
+mnemonic meaning to make it easier to remember the commands:
+
+ zf F-old creation
+ zo O-pen a fold
+ zc C-lose a fold
+
+Folds can be nested: A region of text that contains folds can be folded
+again. For example, you can fold each paragraph in this section, and then
+fold all the sections in this chapter. Try it out. You will notice that
+opening the fold for the whole chapter will restore the nested folds as they
+were, some may be open and some may be closed.
+
+Suppose you have created several folds, and now want to view all the text.
+You could go to each fold and type "zo". To do this faster, use this command: >
+
+ zr
+
+This will R-educe the folding. The opposite is: >
+
+ zm
+
+This folds M-ore. You can repeat "zr" and "zm" to open and close nested folds
+of several levels.
+
+If you have nested several levels deep, you can open all of them with: >
+
+ zR
+
+This R-educes folds until there are none left. And you can close all folds
+with: >
+
+ zM
+
+This folds M-ore and M-ore.
+
+You can quickly disable the folding with the |zn| command. Then |zN| brings
+back the folding as it was. |zi| toggles between the two. This is a useful
+way of working:
+- create folds to get overview on your file
+- move around to where you want to do your work
+- do |zi| to look at the text and edit it
+- do |zi| again to go back to moving around
+
+More about manual folding in the reference manual: |fold-manual|
+
+==============================================================================
+*28.3* Working with folds
+
+When some folds are closed, movement commands like "j" and "k" move over a
+fold like it was a single, empty line. This allows you to quickly move around
+over folded text.
+
+You can yank, delete and put folds as if it was a single line. This is very
+useful if you want to reorder functions in a program. First make sure that
+each fold contains a whole function (or a bit less) by selecting the right
+'foldmethod'. Then delete the function with "dd", move the cursor and put it
+with "p". If some lines of the function are above or below the fold, you can
+use Visual selection:
+- put the cursor on the first line to be moved
+- hit "V" to start Visual mode
+- put the cursor on the last line to be moved
+- hit "d" to delete the selected lines.
+- move the cursor to the new position and "p"ut the lines there.
+
+It is sometimes difficult to see or remember where a fold is located, thus
+where a |zo| command would actually work. To see the defined folds: >
+
+ :set foldcolumn=4
+
+This will show a small column on the left of the window to indicate folds.
+A "+" is shown for a closed fold. A "-" is shown at the start of each open
+fold and "|" at following lines of the fold.
+
+You can use the mouse to open a fold by clicking on the "+" in the foldcolumn.
+Clicking on the "-" or a "|" below it will close an open fold.
+
+To open all folds at the cursor line use |zO|.
+To close all folds at the cursor line use |zC|.
+To delete a fold at the cursor line use |zd|.
+To delete all folds at the cursor line use |zD|.
+
+When in Insert mode, the fold at the cursor line is never closed. That allows
+you to see what you type!
+
+Folds are opened automatically when jumping around or moving the cursor left
+or right. For example, the "0" command opens the fold under the cursor
+(if 'foldopen' contains "hor", which is the default). The 'foldopen' option
+can be changed to open folds for specific commands. If you want the line
+under the cursor always to be open, do this: >
+
+ :set foldopen=all
+
+Warning: You won't be able to move onto a closed fold then. You might want to
+use this only temporarily and then set it back to the default: >
+
+ :set foldopen&
+
+You can make folds close automatically when you move out of it: >
+
+ :set foldclose=all
+
+This will re-apply 'foldlevel' to all folds that don't contain the cursor.
+You have to try it out if you like how this feels. Use |zm| to fold more and
+|zr| to fold less (reduce folds).
+
+The folding is local to the window. This allows you to open two windows on
+the same buffer, one with folds and one without folds. Or one with all folds
+closed and one with all folds open.
+
+==============================================================================
+*28.4* Saving and restoring folds
+
+When you abandon a file (starting to edit another one), the state of the folds
+is lost. If you come back to the same file later, all manually opened and
+closed folds are back to their default. When folds have been created
+manually, all folds are gone! To save the folds use the |:mkview| command: >
+
+ :mkview
+
+This will store the settings and other things that influence the view on the
+file. You can change what is stored with the 'viewoptions' option.
+When you come back to the same file later, you can load the view again: >
+
+ :loadview
+
+You can store up to ten views on one file. For example, to save the current
+setup as the third view and load the second view: >
+
+ :mkview 3
+ :loadview 2
+
+Note that when you insert or delete lines the views might become invalid.
+Also check out the 'viewdir' option, which specifies where the views are
+stored. You might want to delete old views now and then.
+
+==============================================================================
+*28.5* Folding by indent
+
+Defining folds with |zf| is a lot of work. If your text is structured by
+giving lower level items a larger indent, you can use the indent folding
+method. This will create folds for every sequence of lines with the same
+indent. Lines with a larger indent will become nested folds. This works well
+with many programming languages.
+
+Try this by setting the 'foldmethod' option: >
+
+ :set foldmethod=indent
+
+Then you can use the |zm| and |zr| commands to fold more and reduce folding.
+It's easy to see on this example text:
+
+This line is not indented
+ This line is indented once
+ This line is indented twice
+ This line is indented twice
+ This line is indented once
+This line is not indented
+ This line is indented once
+ This line is indented once
+
+Note that the relation between the amount of indent and the fold depth depends
+on the 'shiftwidth' option. Each 'shiftwidth' worth of indent adds one to the
+depth of the fold. This is called a fold level.
+
+When you use the |zr| and |zm| commands you actually increase or decrease the
+'foldlevel' option. You could also set it directly: >
+
+ :set foldlevel=3
+
+This means that all folds with three times a 'shiftwidth' indent or more will
+be closed. The lower the foldlevel, the more folds will be closed. When
+'foldlevel' is zero, all folds are closed. |zM| does set 'foldlevel' to zero.
+The opposite command |zR| sets 'foldlevel' to the deepest fold level that is
+present in the file.
+
+Thus there are two ways to open and close the folds:
+(A) By setting the fold level.
+ This gives a very quick way of "zooming out" to view the structure of the
+ text, move the cursor, and "zoom in" on the text again.
+
+(B) By using |zo| and |zc| commands to open or close specific folds.
+ This allows opening only those folds that you want to be open, while other
+ folds remain closed.
+
+This can be combined: You can first close most folds by using |zm| a few times
+and then open a specific fold with |zo|. Or open all folds with |zR| and
+then close specific folds with |zc|.
+
+But you cannot manually define folds when 'foldmethod' is "indent", as that
+would conflict with the relation between the indent and the fold level.
+
+More about folding by indent in the reference manual: |fold-indent|
+
+==============================================================================
+*28.6* Folding with markers
+
+Markers in the text are used to specify the start and end of a fold region.
+This gives precise control over which lines are included in a fold. The
+disadvantage is that the text needs to be modified.
+
+Try it: >
+
+ :set foldmethod=marker
+
+Example text, as it could appear in a C program:
+
+ /* foobar () {{{ */
+ int foobar()
+ {
+ /* return a value {{{ */
+ return 42;
+ /* }}} */
+ }
+ /* }}} */
+
+Notice that the folded line will display the text before the marker. This is
+very useful to tell what the fold contains.
+
+It's quite annoying when the markers don't pair up correctly after moving some
+lines around. This can be avoided by using numbered markers. Example:
+
+ /* global variables {{{1 */
+ int varA, varB;
+
+ /* functions {{{1 */
+ /* funcA() {{{2 */
+ void funcA() {}
+
+ /* funcB() {{{2 */
+ void funcB() {}
+ /* }}}1 */
+
+At every numbered marker a fold at the specified level begins. This will make
+any fold at a higher level stop here. You can just use numbered start markers
+to define all folds. Only when you want to explicitly stop a fold before
+another starts you need to add an end marker.
+
+More about folding with markers in the reference manual: |fold-marker|
+
+==============================================================================
+*28.7* Folding by syntax
+
+For each language Vim uses a different syntax file. This defines the colors
+for various items in the file. If you are reading this in Vim, in a terminal
+that supports colors, the colors you see are made with the "help" syntax file.
+ In the syntax files it is possible to add syntax items that have the "fold"
+argument. These define a fold region. This requires writing a syntax file
+and adding these items in it. That's not so easy to do. But once it's done,
+all folding happens automatically.
+ Here we'll assume you are using an existing syntax file. Then there is
+nothing more to explain. You can open and close folds as explained above.
+The folds will be created and deleted automatically when you edit the file.
+
+More about folding by syntax in the reference manual: |fold-syntax|
+
+==============================================================================
+*28.8* Folding by expression
+
+This is similar to folding by indent, but instead of using the indent of a
+line a user function is called to compute the fold level of a line. You can
+use this for text where something in the text indicates which lines belong
+together. An example is an e-mail message where the quoted text is indicated
+by a ">" before the line. To fold these quotes use this: >
+
+ :set foldmethod=expr
+ :set foldexpr=strlen(substitute(substitute(getline(v:lnum),'\\s','',\"g\"),'[^>].*','',''))
+
+You can try it out on this text:
+
+> quoted text he wrote
+> quoted text he wrote
+> > double quoted text I wrote
+> > double quoted text I wrote
+
+Explanation for the 'foldexpr' used in the example (inside out):
+ getline(v:lnum) gets the current line
+ substitute(...,'\\s','','g') removes all white space from the line
+ substitute(...,'[^>].*','','')) removes everything after leading '>'s
+ strlen(...) counts the length of the string, which
+ is the number of '>'s found
+
+Note that a backslash must be inserted before every space, double quote and
+backslash for the ":set" command. If this confuses you, do >
+
+ :set foldexpr
+
+to check the actual resulting value. To correct a complicated expression, use
+the command-line completion: >
+
+ :set foldexpr=<Tab>
+
+Where <Tab> is a real Tab. Vim will fill in the previous value, which you can
+then edit.
+
+When the expression gets more complicated you should put it in a function and
+set 'foldexpr' to call that function.
+
+More about folding by expression in the reference manual: |fold-expr|
+
+==============================================================================
+*28.9* Folding unchanged lines
+
+This is useful when you set the 'diff' option in the same window. The
+|vimdiff| command does this for you. Example: >
+
+ setlocal diff foldmethod=diff scrollbind nowrap foldlevel=1
+
+Do this in every window that shows a different version of the same file. You
+will clearly see the differences between the files, while the text that didn't
+change is folded.
+
+For more details see |fold-diff|.
+
+==============================================================================
+*28.10* Which fold method to use?
+
+All these possibilities makes you wonder which method you should chose.
+Unfortunately, there is no golden rule. Here are some hints.
+
+If there is a syntax file with folding for the language you are editing, that
+is probably the best choice. If there isn't one, you might try to write it.
+This requires a good knowledge of search patterns. It's not easy, but when
+it's working you will not have to define folds manually.
+
+Typing commands to manually fold regions can be used for unstructured text.
+Then use the |:mkview| command to save and restore your folds.
+
+The marker method requires you to change the file. If you are sharing the
+files with other people or you have to meet company standards, you might not
+be allowed to add them.
+ The main advantage of markers is that you can put them exactly where you
+want them. That avoids that a few lines are missed when you cut and paste
+folds. And you can add a comment about what is contained in the fold.
+
+Folding by indent is something that works in many files, but not always very
+well. Use it when you can't use one of the other methods. However, it is
+very useful for outlining. Then you specifically use one 'shiftwidth' for
+each nesting level.
+
+Folding with expressions can make folds in almost any structured text. It is
+quite simple to specify, especially if the start and end of a fold can easily
+be recognized.
+ If you use the "expr" method to define folds, but they are not exactly how
+you want them, you could switch to the "manual" method. This will not remove
+the defined folds. Then you can delete or add folds manually.
+
+==============================================================================
+
+Next chapter: |usr_29.txt| Moving through programs
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
new file mode 100644
index 000000000..b906cf6bd
--- /dev/null
+++ b/runtime/doc/usr_29.txt
@@ -0,0 +1,613 @@
+*usr_29.txt* For Vim version 7.0aa. Last change: 2004 Feb 12
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Moving through programs
+
+
+The creator of Vim is a computer programmer. It's no surprise that Vim
+contains many features to aid in writing programs. Jump around to find where
+identifiers are defined and used. Preview declarations in a separate window.
+There is more in the next chapter.
+
+|29.1| Using tags
+|29.2| The preview window
+|29.3| Moving through a program
+|29.4| Finding global identifiers
+|29.5| Finding local identifiers
+
+ Next chapter: |usr_30.txt| Editing programs
+ Previous chapter: |usr_28.txt| Folding
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*29.1* Using tags
+
+What is a tag? It is a location where an identifier is defined. An example
+is a function definition in a C or C++ program. A list of tags is kept in a
+tags file. This can be used by Vim to directly jump from any place to the
+tag, the place where an identifier is defined.
+ To generate the tags file for all C files in the current directory, use the
+following command: >
+
+ ctags *.c
+
+"ctags" is a separate program. Most Unix systems already have it installed.
+If you do not have it yet, you can find Exuberant ctags here:
+
+ http://ctags.sf.net ~
+
+Now when you are in Vim and you want to go to a function definition, you can
+jump to it by using the following command: >
+
+ :tag startlist
+
+This command will find the function "startlist" even if it is in another file.
+ The CTRL-] command jumps to the tag of the word that is under the cursor.
+This makes it easy to explore a tangle of C code. Suppose, for example, that
+you are in the function "write_block". You can see that it calls
+"write_line". But what does "write_line" do? By placing the cursor on the
+call to "write_line" and pressing CTRL-], you jump to the definition of this
+function.
+ The "write_line" function calls "write_char". You need to figure out what
+it does. So you position the cursor over the call to "write_char" and press
+CTRL-]. Now you are at the definition of "write_char".
+
+ +-------------------------------------+
+ |void write_block(char **s; int cnt) |
+ |{ |
+ | int i; |
+ | for (i = 0; i < cnt; ++i) |
+ | write_line(s[i]); |
+ |} | |
+ +-----------|-------------------------+
+ |
+ CTRL-] |
+ | +----------------------------+
+ +--> |void write_line(char *s) |
+ |{ |
+ | while (*s != 0) |
+ | write_char(*s++); |
+ |} | |
+ +--------|-------------------+
+ |
+ CTRL-] |
+ | +------------------------------------+
+ +--> |void write_char(char c) |
+ |{ |
+ | putchar((int)(unsigned char)c); |
+ |} |
+ +------------------------------------+
+
+The ":tags" command shows the list of tags that you traversed through:
+
+ :tags
+ # TO tag FROM line in file/text ~
+ 1 1 write_line 8 write_block.c ~
+ 2 1 write_char 7 write_line.c ~
+ > ~
+>
+Now to go back. The CTRL-T command goes to the preceding tag. In the example
+above you get back to the "write_line" function, in the call to "write_char".
+ This command takes a count argument that indicates how many tags to jump
+back. You have gone forward, and now back. Let's go forward again. The
+following command goes to the tag on top of the list: >
+
+ :tag
+
+You can prefix it with a count and jump forward that many tags. For example:
+":3tag". CTRL-T also can be preceded with a count.
+ These commands thus allow you to go down a call tree with CTRL-] and back
+up again with CTRL-T. Use ":tags" to find out where you are.
+
+
+SPLIT WINDOWS
+
+The ":tag" command replaces the file in the current window with the one
+containing the new function. But suppose you want to see not only the old
+function but also the new one? You can split the window using the ":split"
+command followed by the ":tag" command. Vim has a shorthand command that does
+both: >
+ :stag tagname
+
+To split the current window and jump to the tag under the cursor use this
+command: >
+
+ CTRL-W ]
+
+If a count is specified, the new window will be that many lines high.
+
+
+MORE TAGS FILES
+
+When you have files in many directories, you can create a tags file in each of
+them. Vim will then only be able to jump to tags within that directory.
+ To find more tags files, set the 'tags' option to include all the relevant
+tags files. Example: >
+
+ :set tags=./tags,./../tags,./*/tags
+
+This finds a tags file in the same directory as the current file, one
+directory level higher and in all subdirectories.
+ This is quite a number of tags files, but it may still not be enough. For
+example, when editing a file in "~/proj/src", you will not find the tags file
+"~/proj/sub/tags". For this situation Vim offers to search a whole directory
+tree for tags files. Example: >
+
+ :set tags=~/proj/**/tags
+
+
+ONE TAGS FILE
+
+When Vim has to search many places for tags files, you can hear the disk
+rattling. It may get a bit slow. In that case it's better to spend this
+time while generating one big tags file. You might do this overnight.
+ This requires the Exuberant ctags program, mentioned above. It offers an
+argument to search a whole directory tree: >
+
+ cd ~/proj
+ ctags -R .
+
+The nice thing about this is that Exuberant ctags recognizes various file
+types. Thus this doesn't work just for C and C++ programs, also for Eiffel
+and even Vim scripts. See the ctags documentation to tune this.
+ Now you only need to tell Vim where your big tags file is: >
+
+ :set tags=~/proj/tags
+
+
+MULTIPLE MATCHES
+
+When a function is defined multiple times (or a method in several classes),
+the ":tag" command will jump to the first one. If there is a match in the
+current file, that one is used first.
+ You can now jump to other matches for the same tag with: >
+
+ :tnext
+
+Repeat this to find further matches. If there are many, you can select which
+one to jump to: >
+
+ :tselect tagname
+
+Vim will present you with a list of choices:
+
+ # pri kind tag file ~
+ 1 F f mch_init os_amiga.c ~
+ mch_init() ~
+ 2 F f mch_init os_mac.c ~
+ mch_init() ~
+ 3 F f mch_init os_msdos.c ~
+ mch_init(void) ~
+ 4 F f mch_init os_riscos.c ~
+ mch_init() ~
+ Enter nr of choice (<CR> to abort): ~
+
+You can now enter the number (in the first column) of the match that you would
+like to jump to. The information in the other columns give you a good idea of
+where the match is defined.
+
+To move between the matching tags, these commands can be used:
+
+ :tfirst go to first match
+ :[count]tprevious go to [count] previous match
+ :[count]tnext go to [count] next match
+ :tlast go to last match
+
+If [count] is omitted then one is used.
+
+
+GUESSING TAG NAMES
+
+Command line completion is a good way to avoid typing a long tag name. Just
+type the first bit and press <Tab>: >
+
+ :tag write_<Tab>
+
+You will get the first match. If it's not the one you want, press <Tab> until
+you find the right one.
+ Sometimes you only know part of the name of a function. Or you have many
+tags that start with the same string, but end differently. Then you can tell
+Vim to use a pattern to find the tag.
+ Suppose you want to jump to a tag that contains "block". First type
+this: >
+
+ :tag /block
+
+Now use command line completion: press <Tab>. Vim will find all tags that
+contain "block" and use the first match.
+ The "/" before a tag name tells Vim that what follows is not a literal tag
+name, but a pattern. You can use all the items for search patterns here. For
+example, suppose you want to select a tag that starts with "write_": >
+
+ :tselect /^write_
+
+The "^" specifies that the tag starts with "write_". Otherwise it would also
+be found halfway a tag name. Similarly "$" at the end makes sure the pattern
+matches until the end of a tag.
+
+
+A TAGS BROWSER
+
+Since CTRL-] takes you to the definition of the identifier under the cursor,
+you can use a list of identifier names as a table of contents. Here is an
+example.
+ First create a list of identifiers (this requires Exuberant ctags): >
+
+ ctags --c-types=f -f functions *.c
+
+Now start Vim without a file, and edit this file in Vim, in a vertically split
+window: >
+
+ vim
+ :vsplit functions
+
+The window contains a list of all the functions. There is some more stuff,
+but you can ignore that. Do ":setlocal ts=99" to clean it up a bit.
+ In this window, define a mapping: >
+
+ :nnoremap <buffer> <CR> 0ye<C-W>w:tag <C-R>"<CR>
+
+Move the cursor to the line that contains the function you want to go to.
+Now press <Enter>. Vim will go to the other window and jump to the selected
+function.
+
+
+RELATED ITEMS
+
+You can set 'ignorecase' to make case in tag names be ignored.
+
+The 'tagbsearch' option tells if the tags file is sorted or not. The default
+is to assume a sorted tags file, which makes a tags search a lot faster, but
+doesn't work if the tags file isn't sorted.
+
+The 'taglength' option can be used to tell Vim the number of significant
+characters in a tag.
+
+When you use the SNiFF+ program, you can use the Vim interface to it |sniff|.
+SNiFF+ is a commercial program.
+
+Cscope is a free program. It does not only find places where an identifier is
+declared, but also where it is used. See |cscope|.
+
+==============================================================================
+*29.2* The preview window
+
+When you edit code that contains a function call, you need to use the correct
+arguments. To know what values to pass you can look at how the function is
+defined. The tags mechanism works very well for this. Preferably the
+definition is displayed in another window. For this the preview window can be
+used.
+ To open a preview window to display the function "write_char": >
+
+ :ptag write_char
+
+Vim will open a window, and jumps to the tag "write_char". Then it takes you
+back to the original position. Thus you can continue typing without the need
+to use a CTRL-W command.
+ If the name of a function appears in the text, you can get its definition
+in the preview window with: >
+
+ CTRL-W }
+
+There is a script that automatically displays the text where the word under
+the cursor was defined. See |CursorHold-example|.
+
+To close the preview window use this command: >
+
+ :pclose
+
+To edit a specific file in the preview window, use ":pedit". This can be
+useful to edit a header file, for example: >
+
+ :pedit defs.h
+
+Finally, ":psearch" can be used to find a word in the current file and any
+included files and display the match in the preview window. This is
+especially useful when using library functions, for which you do not have a
+tags file. Example: >
+
+ :psearch popen
+
+This will show the "stdio.h" file in the preview window, with the function
+prototype for popen():
+
+ FILE *popen __P((const char *, const char *)); ~
+
+You can specify the height of the preview window, when it is opened, with the
+'previewheight' option.
+
+==============================================================================
+*29.3* Moving through a program
+
+Since a program is structured, Vim can recognize items in it. Specific
+commands can be used to move around.
+ C programs often contain constructs like this:
+
+ #ifdef USE_POPEN ~
+ fd = popen("ls", "r") ~
+ #else ~
+ fd = fopen("tmp", "w") ~
+ #endif ~
+
+But then much longer, and possibly nested. Position the cursor on the
+"#ifdef" and press %. Vim will jump to the "#else". Pressing % again takes
+you to the "#endif". Another % takes you to the "#ifdef" again.
+ When the construct is nested, Vim will find the matching items. This is a
+good way to check if you didn't forget an "#endif".
+ When you are somewhere inside a "#if" - "#endif", you can jump to the start
+of it with: >
+
+ [#
+
+If you are not after a "#if" or "#ifdef" Vim will beep. To jump forward to
+the next "#else" or "#endif" use: >
+
+ ]#
+
+These two commands skip any "#if" - "#endif" blocks that they encounter.
+Example:
+
+ #if defined(HAS_INC_H) ~
+ a = a + inc(); ~
+ # ifdef USE_THEME ~
+ a += 3; ~
+ # endif ~
+ set_width(a); ~
+
+With the cursor in the last line, "[#" moves to the first line. The "#ifdef"
+- "#endif" block in the middle is skipped.
+
+
+MOVING IN CODE BLOCKS
+
+In C code blocks are enclosed in {}. These can get pretty long. To move to
+the start of the outer block use the "[[" command. Use "][" to find the end.
+This assumes that the "{" and "}" are in the first column.
+ The "[{" command moves to the start of the current block. It skips over
+pairs of {} at the same level. "]}" jumps to the end.
+ An overview:
+
+ function(int a)
+ +-> {
+ | if (a)
+ | +-> {
+ [[ | | for (;;) --+
+ | | +-> { |
+ | [{ | | foo(32); | --+
+ | | [{ | if (bar(a)) --+ | ]} |
+ +-- | +-- break; | ]} | |
+ | } <-+ | | ][
+ +-- foobar(a) | |
+ } <-+ |
+ } <-+
+
+When writing C++ or Java, the outer {} block is for the class. The next level
+of {} is for a method. When somewhere inside a class use "[m" to find the
+previous start of a method. "]m" finds the next end of a method.
+
+Additionally, "[]" moves backward to the end of a function and "]]" moves
+forward to the start of the next function. The end of a function is defined
+by a "}" in the first column.
+
+ int func1(void)
+ {
+ return 1;
+ +----------> }
+ |
+ [] | int func2(void)
+ | +-> {
+ | [[ | if (flag)
+ start +-- +-- return flag;
+ | ][ | return 2;
+ | +-> }
+ ]] |
+ | int func3(void)
+ +----------> {
+ return 3;
+ }
+
+Don't forget you can also use "%" to move between matching (), {} and [].
+That also works when they are many lines apart.
+
+
+MOVING IN BRACES
+
+The "[(" and "])" commands work similar to "[{" and "]}", except that they
+work on () pairs instead of {} pairs.
+>
+ [(
+< <--------------------------------
+ <-------
+ if (a == b && (c == d || (e > f)) && x > y) ~
+ -------------->
+ --------------------------------> >
+ ])
+
+MOVING IN COMMENTS
+
+To move back to the start of a comment use "[/". Move forward to the end of a
+comment with "]/". This only works for /* - */ comments.
+
+ +-> +-> /*
+ | [/ | * A comment about --+
+ [/ | +-- * wonderful life. | ]/
+ | */ <-+
+ |
+ +-- foo = bar * 3; --+
+ | ]/
+ /* a short comment */ <-+
+
+==============================================================================
+*29.4* Finding global identifiers
+
+You are editing a C program and wonder if a variable is declared as "int" or
+"unsigned". A quick way to find this is with the "[I" command.
+ Suppose the cursor is on the word "column". Type: >
+
+ [I
+
+Vim will list the matching lines it can find. Not only in the current file,
+but also in all included files (and files included in them, etc.). The result
+looks like this:
+
+ structs.h ~
+ 1: 29 unsigned column; /* column number */ ~
+
+The advantage over using tags or the preview window is that included files are
+searched. In most cases this results in the right declaration to be found.
+Also when the tags file is out of date. Also when you don't have tags for the
+included files.
+ However, a few things must be right for "[I" to do its work. First of all,
+the 'include' option must specify how a file is included. The default value
+works for C and C++. For other languages you will have to change it.
+
+
+LOCATING INCLUDED FILES
+
+ Vim will find included files in the places specified with the 'path'
+option. If a directory is missing, some include files will not be found. You
+can discover this with this command: >
+
+ :checkpath
+
+It will list the include files that could not be found. Also files included
+by the files that could be found. An example of the output:
+
+ --- Included files not found in path --- ~
+ <io.h> ~
+ vim.h --> ~
+ <functions.h> ~
+ <clib/exec_protos.h> ~
+
+The "io.h" file is included by the current file and can't be found. "vim.h"
+can be found, thus ":checkpath" goes into this file and checks what it
+includes. The "functions.h" and "clib/exec_protos.h" files, included by
+"vim.h" are not found.
+
+ Note:
+ Vim is not a compiler. It does not recognize "#ifdef" statements.
+ This means every "#include" statement is used, also when it comes
+ after "#if NEVER".
+
+To fix the files that could not be found, add a directory to the 'path'
+option. A good place to find out about this is the Makefile. Look out for
+lines that contain "-I" items, like "-I/usr/local/X11". To add this directory
+use: >
+
+ :set path+=/usr/local/X11
+
+When there are many subdirectories, you an use the "*" wildcard. Example: >
+
+ :set path+=/usr/*/include
+
+This would find files in "/usr/local/include" as well as "/usr/X11/include".
+
+When working on a project with a whole nested tree of included files, the "**"
+items is useful. This will search down in all subdirectories. Example: >
+
+ :set path+=/projects/invent/**/include
+
+This will find files in the directories:
+
+ /projects/invent/include ~
+ /projects/invent/main/include ~
+ /projects/invent/main/os/include ~
+ etc.
+
+There are even more possibilities. Check out the 'path' option for info.
+ If you want to see which included files are actually found, use this
+command: >
+
+ :checkpath!
+
+You will get a (very long) list of included files, the files they include, and
+so on. To shorten the list a bit, Vim shows "(Already listed)" for files that
+were found before and doesn't list the included files in there again.
+
+
+JUMPING TO A MATCH
+
+"[I" produces a list with only one line of text. When you want to have a
+closer look at the first item, you can jump to that line with the command: >
+
+ [<Tab>
+
+You can also use "[ CTRL-I", since CTRL-I is the same as pressing <Tab>.
+
+The list that "[I" produces has a number at the start of each line. When you
+want to jump to another item than the first one, type the number first: >
+
+ 3[<Tab>
+
+Will jump to the third item in the list. Remember that you can use CTRL-O to
+jump back to where you started from.
+
+
+RELATED COMMANDS
+
+ [i only lists the first match
+ ]I only lists items below the cursor
+ ]i only lists the first item below the cursor
+
+
+FINDING DEFINED IDENTIFIERS
+
+The "[I" command finds any identifier. To find only macros, defined with
+"#define" use: >
+
+ [D
+
+Again, this searches in included files. The 'define' option specifies what a
+line looks like that defines the items for "[D". You could change it to make
+it work with other languages than C or C++.
+ The commands related to "[D" are:
+
+ [d only lists the first match
+ ]D only lists items below the cursor
+ ]d only lists the first item below the cursor
+
+==============================================================================
+*29.5* Finding local identifiers
+
+The "[I" command searches included files. To search in the current file only,
+and jump to the first place where the word under the cursor is used: >
+
+ gD
+
+Hint: Goto Definition. This command is very useful to find a variable or
+function that was declared locally ("static", in C terms). Example (cursor on
+"counter"):
+
+ +-> static int counter = 0;
+ |
+ | int get_counter(void)
+ gD | {
+ | ++counter;
+ +-- return counter;
+ }
+
+To restrict the search even further, and look only in the current function,
+use this command: >
+
+ gd
+
+This will go back to the start of the current function and find the first
+occurrence of the word under the cursor. Actually, it searches backwards to
+an empty line above the a "{" in the first column. From there it searches
+forward for the identifier. Example (cursor on "idx"):
+
+ int find_entry(char *name)
+ {
+ +-> int idx;
+ |
+ gd | for (idx = 0; idx < table_len; ++idx)
+ | if (strcmp(table[idx].name, name) == 0)
+ +-- return idx;
+ }
+
+==============================================================================
+
+Next chapter: |usr_30.txt| Editing programs
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt
new file mode 100644
index 000000000..c88f060fa
--- /dev/null
+++ b/runtime/doc/usr_30.txt
@@ -0,0 +1,643 @@
+*usr_30.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Editing programs
+
+
+Vim has various commands that aid in writing computer programs. Compile a
+program and directly jump to reported errors. Automatically set the indent
+for many languages and format comments.
+
+|30.1| Compiling
+|30.2| Indenting C files
+|30.3| Automatic indenting
+|30.4| Other indenting
+|30.5| Tabs and spaces
+|30.6| Formatting comments
+
+ Next chapter: |usr_31.txt| Exploiting the GUI
+ Previous chapter: |usr_29.txt| Moving through programs
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*30.1* Compiling
+
+Vim has a set of so called "quickfix" commands. They enable you to compile a
+program from within Vim and then go through the errors generated and fix them
+(hopefully). You can then recompile and fix any new errors that are found
+until finally your program compiles without any error.
+
+The following command runs the program "make" (supplying it with any argument
+you give) and captures the results: >
+
+ :make {arguments}
+
+If errors were generated, they are captured and the editor positions you where
+the first error occurred.
+ Take a look at an example ":make" session. (Typical :make sessions generate
+far more errors and fewer stupid ones.) After typing ":make" the screen looks
+like this:
+
+ :!make | &tee /tmp/vim215953.err ~
+ gcc -g -Wall -o prog main.c sub.c ~
+ main.c: In function 'main': ~
+ main.c:6: too many arguments to function 'do_sub' ~
+ main.c: At top level: ~
+ main.c:10: parse error before '}' ~
+ make: *** [prog] Error 1 ~
+
+ 2 returned ~
+ "main.c" 11L, 111C ~
+ (3 of 6): too many arguments to function 'do_sub' ~
+ Hit ENTER or type command to continue ~
+
+From this you can see that you have errors in the file "main.c". When you
+press <Enter>, Vim displays the file "main.c", with the cursor positioned on
+line 6, the first line with an error. You did not need to specify the file or
+the line number, Vim knew where to go by looking in the error messages.
+
+ +---------------------------------------------------+
+ |int main() |
+ |{ |
+ | int i=3; |
+ cursor -> | do_sub("foo"); |
+ | ++i; |
+ | return (0); |
+ |} |
+ |} |
+ | ~ |
+ |(3 of 12): too many arguments to function 'do_sub' |
+ +---------------------------------------------------+
+
+The following command goes to where the next error occurs: >
+
+ :cnext
+
+Vim jumps to line 10, the last line in the file, where there is an extra '}'.
+ When there is not enough room, Vim will shorten the error message. To see
+the whole message use: >
+
+ :cc
+
+You can get an overview of all the error messages with the ":clist" command.
+The output looks like this: >
+
+ :clist
+< 3 main.c: 6:too many arguments to function 'do_sub' ~
+ 5 main.c: 10:parse error before '}' ~
+
+Only the lines where Vim recognized a file name and line number are listed
+here. It assumes those are the interesting lines and the rest is just boring
+messages. However, sometimes unrecognized lines do contain something you want
+to see. Output from the linker, for example, about an undefined function.
+To see all the messages add a "!" to the command: >
+
+ :clist!
+< 1 gcc -g -Wall -o prog main.c sub.c ~
+ 2 main.c: In function 'main': ~
+ 3 main.c:6: too many arguments to function 'do_sub' ~
+ 4 main.c: At top level: ~
+ 5 main.c:10: parse error before '}' ~
+ 6 make: *** [prog] Error 1 ~
+
+Vim will highlight the current error. To go back to the previous error, use:
+>
+ :cprevious
+
+Other commands to move around in the error list:
+
+ :cfirst to first error
+ :clast to last error
+ :cc 3 to error nr 3
+
+
+USING ANOTHER COMPILER
+
+The name of the program to run when the ":make" command is executed is defined
+by the 'makeprg' option. Usually this is set to "make", but Visual C++ users
+should set this to "nmake" by executing the following command: >
+
+ :set makeprg=nmake
+
+You can also include arguments in this option. Special characters need to
+be escaped with a backslash. Example: >
+
+ :set makeprg=nmake\ -f\ project.mak
+
+You can include special Vim keywords in the command specification. The %
+character expands to the name of the current file. So if you execute the
+command: >
+ :set makeprg=make\ %
+
+When you are editing main.c, then ":make" executes the following command: >
+
+ make main.c
+
+This is not too useful, so you will refine the command a little and use the :r
+(root) modifier: >
+
+ :set makeprg=make\ %:r.o
+
+Now the command executed is as follows: >
+
+ make main.o
+
+More about these modifiers here: |filename-modifiers|.
+
+
+OLD ERROR LISTS
+
+Suppose you ":make" a program. There is an warning message in one file and an
+error message in another. You fix the error and use ":make" again to check if
+it was really fixed. Now you want to look at the warning message. It doesn't
+show up in the last error list, since the file with the warning wasn't
+compiled again. You can go back to the previous error list with: >
+
+ :colder
+
+Then use ":clist" and ":cc {nr}" to jump to the place with the warning.
+ To go forward to the next error list: >
+
+ :cnewer
+
+Vim remembers ten error lists.
+
+
+SWITCHING COMPILERS
+
+You have to tell Vim what format the error messages are that your compiler
+produces. This is done with the 'errorformat' option. The syntax of this
+option is quite complicated and it can be made to fit almost any compiler.
+You can find the explanation here: |errorformat|.
+
+You might be using various different compilers. Setting the 'makeprg' option,
+and especially the 'errorformat' each time is not easy. Vim offers a simple
+method for this. For example, to switch to using the Microsoft Visual C++
+compiler: >
+
+ :compiler msvc
+
+This will find the Vim script for the "msvc" compiler and set the appropriate
+options.
+ You can write your own compiler files. See |write-compiler-plugin|.
+
+
+OUTPUT REDIRECTION
+
+The ":make" command redirects the output of the executed program to an error
+file. How this works depends on various things, such as the 'shell'. If your
+":make" command doesn't capture the output, check the 'makeef' and
+'shellpipe' options. The 'shellquote' and 'shellxquote' options might also
+matter.
+
+In case you can't get ":make" to redirect the file for you, an alternative is
+to compile the program in another window and redirect the output into a file.
+Then have Vim read this file with: >
+
+ :cfile {filename}
+
+Jumping to errors will work like with the ":make" command.
+
+==============================================================================
+*30.2* Indenting C files
+
+A program is much easier to understand when the lines have been properly
+indented. Vim offers various ways to make this less work.
+ For C programs set the 'cindent' option. Vim knows a lot about C programs
+and will try very hard to automatically set the indent for you. Set the
+'shiftwidth' option to the amount of spaces you want for a deeper level. Four
+spaces will work fine. One ":set" command will do it: >
+
+ :set cindent shiftwidth=4
+
+With this option enabled, when you type something such as "if (x)", the next
+line will automatically be indented an additional level.
+
+ if (flag)
+ Automatic indent ---> do_the_work();
+ Automatic unindent <-- if (other_flag) {
+ Automatic indent ---> do_file();
+ keep indent do_some_more();
+ Automatic unindent <-- }
+
+When you type something in curly braces ({}), the text will be indented at the
+start and unindented at the end. The unindenting will happen after typing the
+'}', since Vim can't guess what you are going to type.
+
+One side effect of automatic indentation is that it helps you catch errors in
+your code early. When you type a } to finish a function, only to find that
+the automatic indentation gives it more indent than what you expected, there
+is probably a } missing. Use the "%" command to find out which { matches the
+} you typed.
+ A missing ) and ; also cause extra indent. Thus if you get more white
+space than you would expect, check the preceding lines.
+
+When you have code that is badly formatted, or you inserted and deleted lines,
+you need to re-indent the lines. The "=" operator does this. The simplest
+form is: >
+
+ ==
+
+This indents the current line. Like with all operators, there are three ways
+to use it. In Visual mode "=" indents the selected lines. A useful text
+object is "a{". This selects the current {} block. Thus, to re-indent the
+code code block the cursor is in: >
+
+ =a{
+
+I you have really badly indented code, you can re-indent the whole file with:
+>
+ gg=G
+
+However, don't do this in files that have been carefully indented manually.
+The automatic indenting does a good job, but in some situations you might want
+to overrule it.
+
+
+SETTING INDENT STYLE
+
+Different people have different styles of indentation. By default Vim does a
+pretty good job of indenting in a way that 90% of programmers do. There are
+different styles, however; so if you want to, you can customize the
+indentation style with the 'cinoptions' option.
+ By default 'cinoptions' is empty and Vim uses the default style. You can
+add various items where you want something different. For example, to make
+curly braces be placed like this:
+
+ if (flag) ~
+ { ~
+ i = 8; ~
+ j = 0; ~
+ } ~
+
+Use this command: >
+
+ :set cinoptions+={2
+
+There are many of these items. See |cinoptions-values|.
+
+==============================================================================
+*30.3* Automatic indenting
+
+You don't want to switch on the 'cindent' option manually every time you edit
+a C file. This is how you make it work automatically: >
+
+ :filetype indent on
+
+Actually, this does a lot more than switching on 'cindent' for C files. First
+of all, it enables detecting the type of a file. That's the same as what is
+used for syntax highlighting.
+ When the filetype is known, Vim will search for an indent file for this
+type of file. The Vim distribution includes a number of these for various
+programming languages. This indent file will then prepare for automatic
+indenting specifically for this file.
+
+If you don't like the automatic indenting, you can switch it off again: >
+
+ :filetype indent off
+
+If you don't like the indenting for one specific type of file, this is how you
+avoid it. Create a file with just this one line: >
+
+ :let b:did_indent = 1
+
+Now you need to write this in a file with a specific name:
+
+ {directory}/indent/{filetype}.vim
+
+The {filetype} is the name of the file type, such as "cpp" or "java". You can
+see the exact name that Vim detected with this command: >
+
+ :set filetype
+
+In this file the output is:
+
+ filetype=help ~
+
+This you would use "help" for {filetype}.
+ For the {directory} part you need to use your runtime directory. Look at
+the output of this command: >
+
+ set runtimepath
+
+Now use the first item, the name before the first comma. Thus if the output
+looks like this:
+
+ runtimepath=~/.vim,/usr/local/share/vim/vim60/runtime,~/.vim/after ~
+
+You use "~/.vim" for {directory}. Then the resulting file name is:
+
+ ~/.vim/indent/help.vim ~
+
+Instead of switching the indenting off, you could write your own indent file.
+How to do that is explained here: |indent-expression|.
+
+==============================================================================
+*30.4* Other indenting
+
+The most simple form of automatic indenting is with the 'autoindent' option.
+It uses the indent from the previous line. A bit smarter is the 'smartindent'
+option. This is useful for languages where no indent file is available.
+'smartindent'is not as smart as 'cindent', but smarter than 'autoindent'.
+ With 'smartindent' set, an extra level of indentation is added for each {
+and removed for each }. An extra level of indentation will also be added for
+any of the words in the 'cinwords' option. Lines that begin with # are
+treated specially: all indentation is removed. This is done so that
+preprocessor directives will all start in column 1. The indentation is
+restored for the next line.
+
+
+CORRECTING INDENTS
+
+When you are using 'autoindent' or 'smartindent' to get the indent of the
+previous line, there will be many times when you need to add or remove one
+'shiftwidth' worth of indent. A quick way to do this is using the CTRL-D and
+CTRL-T commands in Insert mode.
+ For example, you are typing a shell script that is supposed to look like
+this:
+
+ if test -n a; then ~
+ echo a ~
+ echo "-------" ~
+ fi ~
+
+Start off by setting these option: >
+
+ :set autoindent shiftwidth=3
+
+You start by typing the first line, <Enter> and the start of the second line:
+
+ if test -n a; then ~
+ echo ~
+
+Now you see that you need an extra indent. Type CTRL-T. The result:
+
+ if test -n a; then ~
+ echo ~
+
+The CTRL-T command, in Insert mode, adds one 'shiftwidth' to the indent, no
+matter where in the line you are.
+ You continue typing the second line, <Enter> and the third line. This time
+the indent is OK. Then <Enter> and the last line. Now you have this:
+
+ if test -n a; then ~
+ echo a ~
+ echo "-------" ~
+ fi ~
+
+To remove the superfluous indent in the last line press CTRL-D. This deletes
+one 'shiftwidth' worth of indent, no matter where you are in the line.
+ When you are in Normal mode, you can use the ">>" and "<<" commands to
+shift lines. ">" and "<" are operators, thus you have the usual three ways to
+specify the lines you want to indent. A useful combination is: >
+
+ >i{
+
+This adds one indent to the current block of lines, inside {}. The { and }
+lines themselves are left unmodified. ">a{" includes them. In this example
+the cursor is on "printf":
+
+ original text after ">i{" after ">a{"
+
+ if (flag) if (flag) if (flag) ~
+ { { { ~
+ printf("yes"); printf("yes"); printf("yes"); ~
+ flag = 0; flag = 0; flag = 0; ~
+ } } } ~
+
+==============================================================================
+*30.5* Tabs and spaces
+
+'tabstop' is set to eight by default. Although you can change it, you quickly
+run into trouble later. Other programs won't know what tabstop value you
+used. They probably use the default value of eight, and your text suddenly
+looks very different. Also, most printers use a fixed tabstop value of eight.
+Thus it's best to keep 'tabstop' alone. (If you edit a file which was written
+with a different tabstop setting, see |25.3| for how to fix that.)
+ For indenting lines in a program, using a multiple of eight spaces makes
+you quickly run into the right border of the window. Using a single space
+doesn't provide enough visual difference. Many people prefer to use four
+spaces, a good compromise.
+ Since a <Tab> is eight spaces and you want to use an indent of four spaces,
+you can't use a <Tab> character to make your indent. There are two ways to
+handle this:
+
+1. Use a mix of <Tab> and space characters. Since a <Tab> takes the place of
+ eight spaces, you have fewer characters in your file. Inserting a <Tab>
+ is quicker than eight spaces. Backspacing works faster as well.
+
+2. Use spaces only. This avoids the trouble with programs that use a
+ different tabstop value.
+
+Fortunately, Vim supports both methods quite well.
+
+
+SPACES AND TABS
+
+If you are using a combination of tabs and spaces, you just edit normally.
+The Vim defaults do a fine job of handling things.
+ You can make life a little easier by setting the 'softtabstop' option.
+This option tells Vim to make the <Tab> key look and feel as if tabs were set
+at the value of 'softtabstop', but actually use a combination of tabs and
+spaces.
+ After you execute the following command, every time you press the <Tab> key
+the cursor moves to the next 4-column boundary: >
+
+ :set softtabstop=4
+
+When you start in the first column and press <Tab>, you get 4 spaces inserted
+in your text. The second time, Vim takes out the 4 spaces and puts in a <Tab>
+(thus taking you to column 8). Thus Vim uses as many <Tab>s as possible, and
+then fills up with spaces.
+ When backspacing it works the other way around. A <BS> will always delete
+the amount specified with 'softtabstop'. Then <Tabs> are used as many as
+possible and spaces to fill the gap.
+ The following shows what happens pressing <Tab> a few times, and then using
+<BS>. A "." stands for a space and "------->" for a <Tab>.
+
+ type result ~
+ <Tab> ....
+ <Tab><Tab> ------->
+ <Tab><Tab><Tab> ------->....
+ <Tab><Tab><Tab><BS> ------->
+ <Tab><Tab><Tab><BS><BS> ....
+
+An alternative is to use the 'smarttab' option. When it's set, Vim uses
+'shiftwidth' for a <Tab> typed in the indent of a line, and a real <Tab> when
+typed after the first non-blank character. However, <BS> doesn't work like
+with 'softtabstop'.
+
+
+JUST SPACES
+
+If you want absolutely no tabs in your file, you can set the 'expandtab'
+option: >
+
+ :set expandtab
+
+When this option is set, the <Tab> key inserts a series of spaces. Thus you
+get the same amount of white space as if a <Tab> character was inserted, but
+there isn't a real <Tab> character in your file.
+ The backspace key will delete each space by itself. Thus after typing one
+<Tab> you have to press the <BS> key up to eight times to undo it. If you are
+in the indent, pressing CTRL-D will be a lot quicker.
+
+
+CHANGING TABS IN SPACES (AND BACK)
+
+Setting 'expandtab' does not affect any existing tabs. In other words, any
+tabs in the document remain tabs. If you want to convert tabs to spaces, use
+the ":retab" command. Use these commands: >
+
+ :set expandtab
+ :%retab
+
+Now Vim will have changed all indents to use spaces instead of tabs. However,
+all tabs that come after a non-blank character are kept. If you want these to
+be converted as well, add a !: >
+
+ :%retab!
+
+This is a little bit dangerous, because it can also change tabs inside a
+string. To check if these exist, you could use this: >
+
+ /"[^"\t]*\t[^"]*"
+
+It's recommended not to use hard tabs inside a string. Replace them with
+"\t" to avoid trouble.
+
+The other way around works just as well: >
+
+ :set noexpandtab
+ :%retab!
+
+==============================================================================
+*30.6* Formatting comments
+
+One of the great things about Vim is that it understands comments. You can
+ask Vim to format a comment and it will do the right thing.
+ Suppose, for example, that you have the following comment:
+
+ /* ~
+ * This is a test ~
+ * of the text formatting. ~
+ */ ~
+
+You then ask Vim to format it by positioning the cursor at the start of the
+comment and type: >
+
+ gq]/
+
+"gq" is the operator to format text. "]/" is the motion that takes you to the
+end of a comment. The result is:
+
+ /* ~
+ * This is a test of the text formatting. ~
+ */ ~
+
+Notice that Vim properly handled the beginning of each line.
+ An alternative is to select the text that is to be formatted in Visual mode
+and type "gq".
+
+To add a new line to the comment, position the cursor on the middle line and
+press "o". The result looks like this:
+
+ /* ~
+ * This is a test of the text formatting. ~
+ * ~
+ */ ~
+
+Vim has automatically inserted a star and a space for you. Now you can type
+the comment text. When it gets longer than 'textwidth', Vim will break the
+line. Again, the star is inserted automatically:
+
+ /* ~
+ * This is a test of the text formatting. ~
+ * Typing a lot of text here will make Vim ~
+ * break ~
+ */ ~
+
+For this to work some flags must be present in 'formatoptions':
+
+ r insert the star when typing <Enter> in Insert mode
+ o insert the star when using "o" or "O" in Normal mode
+ c break comment text according to 'textwidth'
+
+See |fo-table| for more flags.
+
+
+DEFINING A COMMENT
+
+The 'comments' option defines what a comment looks like. Vim distinguishes
+between a single-line comment and a comment that has a different start, end
+and middle part.
+ Many single-line comments start with a specific character. In C++ // is
+used, in Makefiles #, in Vim scripts ". For example, to make Vim understand
+C++ comments: >
+
+ :set comments=://
+
+The colon separates the flags of an item from the text by which the comment is
+recognized. The general form of an item in 'comments' is:
+
+ {flags}:{text}
+
+The {flags} part can be empty, as in this case.
+ Several of these items can be concatenated, separated by commas. This
+allows recognizing different types of comments at the same time. For example,
+let's edit an e-mail message. When replying, the text that others wrote is
+preceded with ">" and "!" characters. This command would work: >
+
+ :set comments=n:>,n:!
+
+There are two items, one for comments starting with ">" and one for comments
+that start with "!". Both use the flag "n". This means that these comments
+nest. Thus a line starting with ">" may have another comment after the ">".
+This allows formatting a message like this:
+
+ > ! Did you see that site? ~
+ > ! It looks really great. ~
+ > I don't like it. The ~
+ > colors are terrible. ~
+ What is the URL of that ~
+ site? ~
+
+Try setting 'textwidth' to a different value, e.g., 80, and format the text by
+Visually selecting it and typing "gq". The result is:
+
+ > ! Did you see that site? It looks really great. ~
+ > I don't like it. The colors are terrible. ~
+ What is the URL of that site? ~
+
+You will notice that Vim did not move text from one type of comment to
+another. The "I" in the second line would have fit at the end of the first
+line, but since that line starts with "> !" and the second line with ">", Vim
+knows that this is a different kind of comment.
+
+
+A THREE PART COMMENT
+
+A C comment starts with "/*", has "*" in the middle and "*/" at the end. The
+entry in 'comments' for this looks like this: >
+
+ :set comments=s1:/*,mb:*,ex:*/
+
+The start is defined with "s1:/*". The "s" indicates the start of a
+three-piece comment. The colon separates the flags from the text by which the
+comment is recognized: "/*". There is one flag: "1". This tells Vim that the
+middle part has an offset of one space.
+ The middle part "mb:*" starts with "m", which indicates it is a middle
+part. The "b" flag means that a blank must follow the text. Otherwise Vim
+would consider text like "*pointer" also to be the middle of a comment.
+ The end part "ex:*/" has the "e" for identification. The "x" flag has a
+special meaning. It means that after Vim automatically inserted a star,
+typing / will remove the extra space.
+
+For more details see |format-comments|.
+
+==============================================================================
+
+Next chapter: |usr_31.txt| Exploiting the GUI
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_31.txt b/runtime/doc/usr_31.txt
new file mode 100644
index 000000000..a836b0442
--- /dev/null
+++ b/runtime/doc/usr_31.txt
@@ -0,0 +1,267 @@
+*usr_31.txt* For Vim version 7.0aa. Last change: 2003 Oct 21
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Exploiting the GUI
+
+
+Vim works well in a terminal, but the GUI has a few extra items. A file
+browser can be used for commands that use a file. A dialog to make a choice
+between alternatives. Use keyboard shortcuts to access menu items quickly.
+
+|31.1| The file browser
+|31.2| Confirmation
+|31.3| Menu shortcuts
+|31.4| Vim window position and size
+|31.5| Various
+
+ Next chapter: |usr_40.txt| Make new commands
+ Previous chapter: |usr_30.txt| Editing programs
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*31.1* The file browser
+
+When using the File/Open... menu you get a file browser. This makes it easier
+to find the file you want to edit. But what if you want to split a window to
+edit another file? There is no menu entry for this. You could first use
+Window/Split and then File/Open..., but that's more work.
+ Since you are typing most commands in Vim, opening the file browser with a
+typed command is possible as well. To make the split command use the file
+browser, prepend "browse": >
+
+ :browse split
+
+Select a file and then the ":split" command will be executed with it. If you
+cancel the file dialog nothing happens, the window isn't split.
+ You can also specify a file name argument. This is used to tell the file
+browser where to start. Example: >
+
+ :browse split /etc
+
+The file browser will pop up, starting in the directory "/etc".
+
+The ":browse" command can be prepended to just about any command that opens a
+file.
+ If no directory is specified, Vim will decide where to start the file
+browser. By default it uses the same directory as the last time. Thus when
+you used ":browse split" and selected a file in "/usr/local/share", the next
+time you use a ":browse" it will start in "/usr/local/share" again.
+ This can be changed with the 'browsedir' option. It can have one of three
+values:
+
+ last Use the last directory browsed (default)
+ buffer Use the same directory as the current buffer
+ current use the current directory
+
+For example, when you are in the directory "/usr", editing the file
+"/usr/local/share/readme", then the command: >
+
+ :set browsedir=buffer
+ :browse edit
+
+Will start the browser in "/usr/local/share". Alternatively: >
+
+ :set browsedir=current
+ :browse edit
+
+Will start the browser in "/usr".
+
+ Note:
+ To avoid using the mouse, most file browsers offer using key presses
+ to navigate. Since this is different for every system, it is not
+ explained here. Vim uses a standard browser when possible, your
+ system documentation should contain an explanation on the keyboard
+ shortcuts somewhere.
+
+When you are not using the GUI version, you could use the file explorer window
+to select files like in a file browser. However, this doesn't work for the
+":browse" command. See |file-explorer|.
+
+==============================================================================
+*31.2* Confirmation
+
+Vim protects you from accidentally overwriting a file and other ways to lose
+changes. If you do something that might be a bad thing to do, Vim produces an
+error message and suggests appending ! if you really want to do it.
+ To avoid retyping the command with the !, you can make Vim give you a
+dialog. You can then press "OK" or "Cancel" to tell Vim what you want.
+ For example, you are editing a file and made changes to it. You start
+editing another file with: >
+
+ :confirm edit foo.txt
+
+Vim will pop up a dialog that looks something like this:
+
+ +-----------------------------------+
+ | |
+ | ? Save changes to "bar.txt"? |
+ | |
+ | YES NO CANCEL |
+ +-----------------------------------+
+
+Now make your choice. If you do want to save the changes, select "YES". If
+you want to lose the changes for ever: "NO". If you forgot what you were
+doing and want to check what really changed use "CANCEL". You will be back in
+the same file, with the changes still there.
+
+Just like ":browse", the ":confirm" command can be prepended to most commands
+that edit another file. They can also be combined: >
+
+ :confirm browse edit
+
+This will produce a dialog when the current buffer was changed. Then it will
+pop up a file browser to select the file to edit.
+
+ Note:
+ In the dialog you can use the keyboard to select the choice.
+ Typically the <Tab> key and the cursor keys change the choice.
+ Pressing <Enter> selects the choice. This depends on the system
+ though.
+
+When you are not using the GUI, the ":confirm" command works as well. Instead
+of popping up a dialog, Vim will print the message at the bottom of the Vim
+window and ask you to press a key to make a choice. >
+
+ :confirm edit main.c
+< Save changes to "Untitled"? ~
+ [Y]es, (N)o, (C)ancel: ~
+
+You can now press the single key for the choice. You don't have to press
+<Enter>, unlike other typing on the command line.
+
+==============================================================================
+*31.3* Menu shortcuts
+
+The keyboard is used for all Vim commands. The menus provide a simple way to
+select commands, without knowing what they are called. But you have to move
+your hand from the keyboard and grab the mouse.
+ Menus can often be selected with keys as well. This depends on your
+system, but most often it works this way. Use the <Alt> key in combination
+with the underlined letter of a menu. For example, <A-w> (<Alt> and w) pops
+up the Window menu.
+ In the Window menu, the "split" item has the p underlined. To select it,
+let go of the <Alt> key and press p.
+
+After the first selection of a menu with the <Alt> key, you can use the cursor
+keys to move through the menus. <Right> selects a submenu and <left> closes
+it. <Esc> also closes a menu. <Enter> selects a menu item.
+
+There is a conflict between using the <Alt> key to select menu items, and
+using <Alt> key combinations for mappings. The 'winaltkeys' option tells Vim
+what it should do with the <Alt> key.
+ The default value "menu" is the smart choice: If the key combination is a
+menu shortcut it can't be mapped. All other keys are available for mapping.
+ The value "no" doesn't use any <Alt> keys for the menus. Thus you must use
+the mouse for the menus, and all <Alt> keys can be mapped.
+ The value "yes" means that Vim will use any <Alt> keys for the menus. Some
+<Alt> key combinations may also do other things than selecting a menu.
+
+==============================================================================
+*31.4* Vim window position and size
+
+To see the current Vim window position on the screen use: >
+
+ :winpos
+
+This will only work in the GUI. The output may look like this:
+
+ Window position: X 272, Y 103 ~
+
+The position is given in screen pixels. Now you can use the numbers to move
+Vim somewhere else. For example, to move it to the left a hundred pixels: >
+
+ :winpos 172 103
+<
+ Note:
+ There may be a small offset between the reported position and where
+ the window moves. This is because of the border around the window.
+ This is added by the window manager.
+
+You can use this command in your startup script to position the window at a
+specific position.
+
+The size of the Vim window is computed in characters. Thus this depends on
+the size of the font being used. You can see the current size with this
+command: >
+
+ :set lines columns
+
+To change the size set the 'lines' and/or 'columns' options to a new value: >
+
+ :set lines=50
+ :set columns=80
+
+Obtaining the size works in a terminal just like in the GUI. Setting the size
+is not possible in most terminals.
+
+You can start the X-Windows version of gvim with an argument to specify the
+size and position of the window: >
+
+ gvim -geometry {width}x{height}+{x_offset}+{y_offset}
+
+{width} and {height} are in characters, {x_offset} and {y_offset} are in
+pixels. Example: >
+
+ gvim -geometry 80x25+100+300
+
+==============================================================================
+*31.5* Various
+
+You can use gvim to edit an e-mail message. In your e-mail program you must
+select gvim to be the editor for messages. When you try that, you will
+see that it doesn't work: The mail program thinks that editing is finished,
+while gvim is still running!
+ What happens is that gvim disconnects from the shell it was started in.
+That is fine when you start gvim in a terminal, so that you can do other work
+in that terminal. But when you really want to wait for gvim to finish, you
+must prevent it from disconnecting. The "-f" argument does this: >
+
+ gvim -f file.txt
+
+The "-f" stands for foreground. Now Vim will block the shell it was started
+in until you finish editing and exit.
+
+
+DELAYED START OF THE GUI
+
+On Unix it's possible to first start Vim in a terminal. That's useful if you
+do various tasks in the same shell. If you are editing a file and decide you
+want to use the GUI after all, you can start it with: >
+
+ :gui
+
+Vim will open the GUI window and no longer use the terminal. You can continue
+using the terminal for something else. The "-f" argument is used here to run
+the GUI in the foreground. You can also use ":gui -f".
+
+
+THE GVIM STARTUP FILE
+
+When gvim starts, it reads the gvimrc file. That's similar to the vimrc file
+used when starting Vim. The gvimrc file can be used for settings and commands
+that are only to be used when the GUI is going to be started. For example,
+you can set the 'lines' option to set a different window size: >
+
+ :set lines=55
+
+You don't want to do this in a terminal, since it's size is fixed (except for
+an xterm that supports resizing).
+ The gvimrc file is searched for in the same locations as the vimrc file.
+Normally it's name is "~/.gvimrc" for Unix and "$VIM/_gvimrc" for MS-Windows.
+ If for some reason you don't want to use the normal gvimrc file, you can
+specify another one with the "-U" argument: >
+
+ gvim -U thisrc ...
+
+That allows starting gvim for different kinds of editing. You could set
+another font size, for example.
+ To completely skip reading a gvimrc file: >
+
+ gvim -U NONE ...
+
+==============================================================================
+
+Next chapter: |usr_40.txt| Make new commands
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt
new file mode 100644
index 000000000..90664163e
--- /dev/null
+++ b/runtime/doc/usr_40.txt
@@ -0,0 +1,655 @@
+*usr_40.txt* For Vim version 7.0aa. Last change: 2004 Feb 13
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Make new commands
+
+
+Vim is an extensible editor. You can take a sequence of commands you use
+often and turn it into a new command. Or redefine an existing command.
+Autocommands make it possible to execute commands automatically.
+
+|40.1| Key mapping
+|40.2| Defining command-line commands
+|40.3| Autocommands
+
+ Next chapter: |usr_41.txt| Write a Vim script
+ Previous chapter: |usr_31.txt| Exploiting the GUI
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*40.1* Key mapping
+
+A simple mapping was explained in section |05.3|. The principle is that one
+sequence of key strokes is translated into another sequence of key strokes.
+This is a simple, yet powerful mechanism.
+ The simplest form is that one key is mapped to a sequence of keys. Since
+the function keys, except <F1>, have no predefined meaning in Vim, these are a
+good choice to map. Example: >
+
+ :map <F2> GoDate: <Esc>:read !date<CR>kJ
+
+This shows how three modes are used. After going to the last line with "G",
+the "o" command opens a new line and starts Insert mode. The text "Date: " is
+inserted and <Esc> takes you out of insert mode.
+ Notice the use of special keys inside <>. This is called angle bracket
+notation. You type these as separate characters, not by pressing the key
+itself. This makes the mappings better readable and you can copy and paste
+the text without problems.
+ The ":" character takes Vim to the command line. The ":read !date" command
+reads the output from the "date" command and appends it below the current
+line. The <CR> is required to execute the ":read" command.
+ At this point of execution the text looks like this:
+
+ Date: ~
+ Fri Jun 15 12:54:34 CEST 2001 ~
+
+Now "kJ" moves the cursor up and joins the lines together.
+ To decide which key or keys you use for mapping, see |map-which-keys|.
+
+
+MAPPING AND MODES
+
+The ":map" command defines remapping for keys in Normal mode. You can also
+define mappings for other modes. For example, ":imap" applies to Insert mode.
+You can use it to insert a date below the cursor: >
+
+ :imap <F2> <CR>Date: <Esc>:read !date<CR>kJ
+
+It looks a lot like the mapping for <F2> in Normal mode, only the start is
+different. The <F2> mapping for Normal mode is still there. Thus you can map
+the same key differently for each mode.
+ Notice that, although this mapping starts in Insert mode, it ends in Normal
+mode. If you want it to continue in Insert mode, append a "a" to the mapping.
+
+Here is an overview of map commands and in which mode they work:
+
+ :map Normal, Visual and Operator-pending
+ :vmap Visual
+ :nmap Normal
+ :omap Operator-pending
+ :map! Insert and Command-line
+ :imap Insert
+ :cmap Command-line
+
+Operator-pending mode is when you typed an operator character, such as "d" or
+"y", and you are expected to type the motion command or a text object. Thus
+when you type "dw", the "w" is entered in operator-pending mode.
+
+Suppose that you want to define <F7> so that the command d<F7> deletes a C
+program block (text enclosed in curly braces, {}). Similarly y<F7> would yank
+the program block into the unnamed register. Therefore, what you need to do
+is to define <F7> to select the current program block. You can do this with
+the following command: >
+
+ :omap <F7> a{
+
+This causes <F7> to perform a select block "a{" in operator-pending mode, just
+like you typed it. This mapping is useful if typing a { on your keyboard is a
+bit difficult.
+
+
+LISTING MAPPINGS
+
+To see the currently defined mappings, use ":map" without arguments. Or one
+of the variants that include the mode in which they work. The output could
+look like this:
+
+ _g :call MyGrep(1)<CR> ~
+ v <F2> :s/^/> /<CR>:noh<CR>`` ~
+ n <F2> :.,$s/^/> /<CR>:noh<CR>`` ~
+ <xHome> <Home>
+ <xEnd> <End>
+
+
+The first column of the list shows in which mode the mapping is effective.
+This is "n" for Normal mode, "i" for Insert mode, etc. A blank is used for a
+mapping defined with ":map", thus effective in both Normal and Visual mode.
+ One useful purpose of listing the mapping is to check if special keys in <>
+form have been recognized (this only works when color is supported). For
+example, when <Esc> is displayed in color, it stands for the escape character.
+When it has the same color as the other text, it is five characters.
+
+
+REMAPPING
+
+The result of a mapping is inspected for other mappings in it. For example,
+the mappings for <F2> above could be shortened to: >
+
+ :map <F2> G<F3>
+ :imap <F2> <Esc><F3>
+ :map <F3> oDate: <Esc>:read !date<CR>kJ
+
+For Normal mode <F2> is mapped to go to the last line, and then behave like
+<F3> was pressed. In Insert mode <F2> stops Insert mode with <Esc> and then
+also uses <F3>. Then <F3> is mapped to do the actual work.
+
+Suppose you hardly ever use Ex mode, and want to use the "Q" command to format
+text (this was so in old versions of Vim). This mapping will do it: >
+
+ :map Q gq
+
+But, in rare cases you need to use Ex mode anyway. Let's map "gQ" to Q, so
+that you can still go to Ex mode: >
+
+ :map gQ Q
+
+What happens now is that when you type "gQ" it is mapped to "Q". So far so
+good. But then "Q" is mapped to "gq", thus typing "gQ" results in "gq", and
+you don't get to Ex mode at all.
+ To avoid keys to be mapped again, use the ":noremap" command: >
+
+ :noremap gQ Q
+
+Now Vim knows that the "Q" is not to be inspected for mappings that apply to
+it. There is a similar command for every mode:
+
+ :noremap Normal, Visual and Operator-pending
+ :vnoremap Visual
+ :nnoremap Normal
+ :onoremap Operator-pending
+ :noremap! Insert and Command-line
+ :inoremap Insert
+ :cnoremap Command-line
+
+
+RECURSIVE MAPPING
+
+When a mapping triggers itself, it will run forever. This can be used to
+repeat an action an unlimited number of times.
+ For example, you have a list of files that contain a version number in the
+first line. You edit these files with "vim *.txt". You are now editing the
+first file. Define this mapping: >
+
+ :map ,, :s/5.1/5.2/<CR>:wnext<CR>,,
+
+Now you type ",,". This triggers the mapping. It replaces "5.1" with "5.2"
+in the first line. Then it does a ":wnext" to write the file and edit the
+next one. The mapping ends in ",,". This triggers the same mapping again,
+thus doing the substitution, etc.
+ This continues until there is an error. In this case it could be a file
+where the substitute command doesn't find a match for "5.1". You can then
+make a change to insert "5.1" and continue by typing ",," again. Or the
+":wnext" fails, because you are in the last file in the list.
+ When a mapping runs into an error halfway, the rest of the mapping is
+discarded. CTRL-C interrupts the mapping (CTRL-Break on MS-Windows).
+
+
+DELETE A MAPPING
+
+To remove a mapping use the ":unmap" command. Again, the mode the unmapping
+applies to depends on the command used:
+
+ :unmap Normal, Visual and Operator-pending
+ :vunmap Visual
+ :nunmap Normal
+ :ounmap Operator-pending
+ :unmap! Insert and Command-line
+ :iunmap Insert
+ :cunmap Command-line
+
+There is a trick to define a mapping that works in Normal and Operator-pending
+mode, but not in Visual mode. First define it for all three modes, then
+delete it for Visual mode: >
+
+ :map <C-A> /---><CR>
+ :vunmap <C-A>
+
+Notice that the five characters "<C-A>" stand for the single key CTRL-A.
+
+To remove all mappings use the |:mapclear| command. You can guess the
+variations for different modes by now. Be careful with this command, it can't
+be undone.
+
+
+SPECIAL CHARACTERS
+
+The ":map" command can be followed by another command. A | character
+separates the two commands. This also means that a | character can't be used
+inside a map command. To include one, use <Bar> (five characters). Example:
+>
+ :map <F8> :write <Bar> !checkin %<CR>
+
+The same problem applies to the ":unmap" command, with the addition that you
+have to watch out for trailing white space. These two commands are different:
+>
+ :unmap a | unmap b
+ :unmap a| unmap b
+
+The first command tries to unmap "a ", with a trailing space.
+
+When using a space inside a mapping, use <Space> (seven characters): >
+
+ :map <Space> W
+
+This makes the spacebar move a blank-separated word forward.
+
+It is not possible to put a comment directly after a mapping, because the "
+character is considered to be part of the mapping. You can use |", this
+starts a new, empty command with a comment. Example: >
+
+ :map <Space> W| " Use spacebar to move forward a word
+
+
+MAPPINGS AND ABBREVIATIONS
+
+Abbreviations are a lot like Insert mode mappings. The arguments are handled
+in the same way. The main difference is the way they are triggered. An
+abbreviation is triggered by typing a non-word character after the word. A
+mapping is triggered when typing the last character.
+ Another difference is that the characters you type for an abbreviation are
+inserted in the text while you type them. When the abbreviation is triggered
+these characters are deleted and replaced by what the abbreviation produces.
+When typing the characters for a mapping, nothing is inserted until you type
+the last character that triggers it. If the 'showcmd' option is set, the
+typed characters are displayed in the last line of the Vim window.
+ An exception is when a mapping is ambiguous. Suppose you have done two
+mappings: >
+
+ :imap aa foo
+ :imap aaa bar
+
+Now, when you type "aa", Vim doesn't know if it should apply the first or the
+second mapping. It waits for another character to be typed. If it is an "a",
+the second mapping is applied and results in "bar". If it is a space, for
+example, the first mapping is applied, resulting in "foo", and then the space
+is inserted.
+
+
+ADDITIONALLY...
+
+The <script> keyword can be used to make a mapping local to a script. See
+|:map-<script>|.
+
+The <buffer> keyword can be used to make a mapping local to a specific buffer.
+See |:map-<buffer>|
+
+The <unique> keyword can be used to make defining a new mapping fail when it
+already exists. Otherwise a new mapping simply overwrites the old one. See
+|:map-<unique>|.
+
+To make a key do nothing, map it to <Nop> (five characters). This will make
+the <F7> key do nothing at all: >
+
+ :map <F7> <Nop>| map! <F7> <Nop>
+
+There must be no space after <Nop>.
+
+==============================================================================
+*40.2* Defining command-line commands
+
+The Vim editor enables you to define your own commands. You execute these
+commands just like any other Command-line mode command.
+ To define a command, use the ":command" command, as follows: >
+
+ :command DeleteFirst 1delete
+
+Now when you execute the command ":DeleteFirst" Vim executes ":1delete", which
+deletes the first line.
+
+ Note:
+ User-defined commands must start with a capital letter. You cannot
+ use ":X", ":Next" and ":Print". The underscore cannot be used! You
+ can use digits, but this is discouraged.
+
+To list the user-defined commands, execute the following command: >
+
+ :command
+
+Just like with the builtin commands, the user defined commands can be
+abbreviated. You need to type just enough to distinguish the command from
+another. Command line completion can be used to get the full name.
+
+
+NUMBER OF ARGUMENTS
+
+User-defined commands can take a series of arguments. The number of arguments
+must be specified by the -nargs option. For instance, the example
+:DeleteFirst command takes no arguments, so you could have defined it as
+follows: >
+
+ :command -nargs=0 DeleteFirst 1delete
+
+However, because zero arguments is the default, you do not need to add
+"-nargs=0". The other values of -nargs are as follows:
+
+ -nargs=0 No arguments
+ -nargs=1 One argument
+ -nargs=* Any number of arguments
+ -nargs=? Zero or one argument
+ -nargs=+ One or more arguments
+
+
+USING THE ARGUMENTS
+
+Inside the command definition, the arguments are represented by the
+<args> keyword. For example: >
+
+ :command -nargs=+ Say :echo "<args>"
+
+Now when you type >
+
+ :Say Hello World
+
+Vim echoes "Hello World". However, if you add a double quote, it won't work.
+For example: >
+
+ :Say he said "hello"
+
+To get special characters turned into a string, properly escaped to use as an
+expression, use "<q-args>": >
+
+ :command -nargs=+ Say :echo <q-args>
+
+Now the above ":Say" command will result in this to be executed: >
+
+ :echo "he said \"hello\""
+
+The <f-args> keyword contains the same information as the <args> keyword,
+except in a format suitable for use as function call arguments. For example:
+>
+ :command -nargs=* DoIt :call AFunction(<f-args>)
+ :DoIt a b c
+
+Executes the following command: >
+
+ :call AFunction("a", "b", "c")
+
+
+LINE RANGE
+
+Some commands take a range as their argument. To tell Vim that you are
+defining such a command, you need to specify a -range option. The values for
+this option are as follows:
+
+ -range Range is allowed; default is the current line.
+ -range=% Range is allowed; default is the whole file.
+ -range={count} Range is allowed; the last number in it is used as a
+ single number whose default is {count}.
+
+When a range is specified, the keywords <line1> and <line2> get the values of
+the first and last line in the range. For example, the following command
+defines the SaveIt command, which writes out the specified range to the file
+"save_file": >
+
+ :command -range=% SaveIt :<line1>,<line2>write! save_file
+
+
+OTHER OPTIONS
+
+Some of the other options and keywords are as follows:
+
+ -count={number} The command can take a count whose default is
+ {number}. The resulting count can be used
+ through the <count> keyword.
+ -bang You can use a !. If present, using <bang> will
+ result in a !.
+ -register You can specify a register. (The default is
+ the unnamed register.)
+ The register specification is available as
+ <reg> (a.k.a. <register>).
+ -complete={type} Type of command-line completion used. See
+ |:command-completion| for the list of possible
+ values.
+ -bar The command can be followed by | and another
+ command, or " and a comment.
+ -buffer The command is only available for the current
+ buffer.
+
+Finally, you have the <lt> keyword. It stands for the character <. Use this
+to escape the special meaning of the <> items mentioned.
+
+
+REDEFINING AND DELETING
+
+To redefine the same command use the ! argument: >
+
+ :command -nargs=+ Say :echo "<args>"
+ :command! -nargs=+ Say :echo <q-args>
+
+To delete a user command use ":delcommand". It takes a single argument, which
+is the name of the command. Example: >
+
+ :delcommand SaveIt
+
+To delete all the user commands: >
+
+ :comclear
+
+Careful, this can't be undone!
+
+More details about all this in the reference manual: |user-commands|.
+
+==============================================================================
+*40.3* Autocommands
+
+An autocommand is a command that is executed automatically in response to some
+event, such as a file being read or written or a buffer change. Through the
+use of autocommands you can train Vim to edit compressed files, for example.
+That is used in the |gzip| plugin.
+ Autocommands are very powerful. Use them with care and they will help you
+avoid typing many commands. Use them carelessly and they will cause a lot of
+trouble.
+
+Suppose you want to replace a date stamp on the end of a file every time it is
+written. First you define a function: >
+
+ :function DateInsert()
+ : $delete
+ : read !date
+ :endfunction
+
+You want this function to be called each time, just before a file is written.
+This will make that happen: >
+
+ :autocmd FileWritePre * call DateInsert()
+
+"FileWritePre" is the event for which this autocommand is triggered: Just
+before (pre) writing a file. The "*" is a pattern to match with the file
+name. In this case it matches all files.
+ With this command enabled, when you do a ":write", Vim checks for any
+matching FileWritePre autocommands and executes them, and then it
+performs the ":write".
+ The general form of the :autocmd command is as follows: >
+
+ :autocmd [group] {events} {file_pattern} [nested] {command}
+
+The [group] name is optional. It is used in managing and calling the commands
+(more on this later). The {events} parameter is a list of events (comma
+separated) that trigger the command.
+ {file_pattern} is a filename, usually with wildcards. For example, using
+"*.txt" makes the autocommand be used for all files whose name end in ".txt".
+The optional [nested] flag allows for nesting of autocommands (see below), and
+finally, {command} is the command to be executed.
+
+
+EVENTS
+
+One of the most useful events is BufReadPost. It is triggered after a new
+file is being edited. It is commonly used to set option values. For example,
+you know that "*.gsm" files are GNU assembly language. To get the syntax file
+right, define this autocommand: >
+
+ :autocmd BufReadPost *.gsm set filetype=asm
+
+If Vim is able to detect the type of file, it will set the 'filetype' option
+for you. This triggers the Filetype event. Use this to do something when a
+certain type of file is edited. For example, to load a list of abbreviations
+for text files: >
+
+ :autocmd Filetype text source ~/.vim/abbrevs.vim
+
+When starting to edit a new file, you could make Vim insert a skeleton: >
+
+ :autocmd BufNewFile *.[ch] 0read ~/skeletons/skel.c
+
+See |autocmd-events| for a complete list of events.
+
+
+PATTERNS
+
+The {file_pattern} argument can actually be a comma-separated list of file
+patterns. For example: "*.c,*.h" matches files ending in ".c" and ".h".
+ The usual file wildcards can be used. Here is a summary of the most often
+used ones:
+
+ * Match any character any number of times
+ ? Match any character once
+ [abc] Match the character a, b or c
+ . Matches a dot
+ a{b,c} Matches "ab" and "ac"
+
+When the pattern includes a slash (/) Vim will compare directory names.
+Without the slash only the last part of a file name is used. For example,
+"*.txt" matches "/home/biep/readme.txt". The pattern "/home/biep/*" would
+also match it. But "home/foo/*.txt" wouldn't.
+ When including a slash, Vim matches the pattern against both the full path
+of the file ("/home/biep/readme.txt") and the relative path (e.g.,
+"biep/readme.txt").
+
+ Note:
+ When working on a system that uses a backslash as file separator, such
+ as MS-Windows, you still use forward slashes in autocommands. This
+ makes it easier to write the pattern, since a backslash has a special
+ meaning. It also makes the autocommands portable.
+
+
+DELETING
+
+To delete an autocommand, use the same command as what it was defined with,
+but leave out the {command} at the end and use a !. Example: >
+
+ :autocmd! FileWritePre *
+
+This will delete all autocommands for the "FileWritePre" event that use the
+"*" pattern.
+
+
+LISTING
+
+To list all the currently defined autocommands, use this: >
+
+ :autocmd
+
+The list can be very long, especially when filetype detection is used. To
+list only part of the commands, specify the group, event and/or pattern. For
+example, to list all BufNewFile autocommands: >
+
+ :autocmd BufNewFile
+
+To list all autocommands for the pattern "*.c": >
+
+ :autocmd * *.c
+
+Using "*" for the event will list all the events. To list all autocommands
+for the cprograms group: >
+
+ :autocmd cprograms
+
+
+GROUPS
+
+The {group} item, used when defining an autocommand, groups related autocommands
+together. This can be used to delete all the autocommands in a certain group,
+for example.
+ When defining several autocommands for a certain group, use the ":augroup"
+command. For example, let's define autocommands for C programs: >
+
+ :augroup cprograms
+ : autocmd BufReadPost *.c,*.h :set sw=4 sts=4
+ : autocmd BufReadPost *.cpp :set sw=3 sts=3
+ :augroup END
+
+This will do the same as: >
+
+ :autocmd cprograms BufReadPost *.c,*.h :set sw=4 sts=4
+ :autocmd cprograms BufReadPost *.cpp :set sw=3 sts=3
+
+To delete all autocommands in the "cprograms" group: >
+
+ :autocmd! cprograms
+
+
+NESTING
+
+Generally, commands executed as the result of an autocommand event will not
+trigger any new events. If you read a file in response to a FileChangedShell
+event, it will not trigger the autocommands that would set the syntax, for
+example. To make the events triggered, add the "nested" argument: >
+
+ :autocmd FileChangedShell * nested edit
+
+
+EXECUTING AUTOCOMMANDS
+
+It is possible to trigger an autocommand by pretending an event has occurred.
+This is useful to have one autocommand trigger another one. Example: >
+
+ :autocmd BufReadPost *.new execute "doautocmd BufReadPost " . expand("<afile>:r")
+
+This defines an autocommand that is triggered when a new file has been edited.
+The file name must end in ".new". The ":execute" command uses expression
+evaluation to form a new command and execute it. When editing the file
+"tryout.c.new" the executed command will be: >
+
+ :doautocmd BufReadPost tryout.c
+
+The expand() function takes the "<afile>" argument, which stands for the file
+name the autocommand was executed for, and takes the root of the file name
+with ":r".
+
+":doautocmd" executes on the current buffer. The ":doautoall" command works
+like "doautocmd" except it executes on all the buffers.
+
+
+USING NORMAL MODE COMMANDS
+
+The commands executed by an autocommand are Command-line command. If you want
+to use a Normal mode command, the ":normal" command can be used. Example: >
+
+ :autocmd BufReadPost *.log normal G
+
+This will make the cursor jump to the last line of *.log files when you start
+to edit it.
+ Using the ":normal" command is a bit tricky. First of all, make sure its
+argument is a complete command, including all the arguments. When you use "i"
+to go to Insert mode, there must also be a <Esc> to leave Insert mode again.
+If you use a "/" to start a search pattern, there must be a <CR> to execute
+it.
+ The ":normal" command uses all the text after it as commands. Thus there
+can be no | and another command following. To work around this, put the
+":normal" command inside an ":execute" command. This also makes it possible
+to pass unprintable characters in a convenient way. Example: >
+
+ :autocmd BufReadPost *.chg execute "normal ONew entry:\<Esc>" |
+ \ 1read !date
+
+This also shows the use of a backslash to break a long command into more
+lines. This can be used in Vim scripts (not at the command line).
+
+When you want the autocommand do something complicated, which involves jumping
+around in the file and then returning to the original position, you may want
+to restore the view on the file. See |restore-position| for an example.
+
+
+IGNORING EVENTS
+
+At times, you will not want to trigger an autocommand. The 'eventignore'
+option contains a list of events that will be totally ignored. For example,
+the following causes events for entering and leaving a window to be ignored: >
+
+ :set eventignore=WinEnter,WinLeave
+
+To ignore all events, use the following command: >
+
+ :set eventignore=all
+
+To set it back to the normal behavior, make 'eventignore' empty: >
+
+ :set eventignore=
+
+==============================================================================
+
+Next chapter: |usr_41.txt| Write a Vim script
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
new file mode 100644
index 000000000..e0ea026df
--- /dev/null
+++ b/runtime/doc/usr_41.txt
@@ -0,0 +1,1724 @@
+*usr_41.txt* For Vim version 7.0aa. Last change: 2004 May 06
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Write a Vim script
+
+
+The Vim script language is used for the startup vimrc file, syntax files, and
+many other things. This chapter explains the items that can be used in a Vim
+script. There are a lot of them, thus this is a long chapter.
+
+|41.1| Introduction
+|41.2| Variables
+|41.3| Expressions
+|41.4| Conditionals
+|41.5| Executing an expression
+|41.6| Using functions
+|41.7| Defining a function
+|41.8| Exceptions
+|41.9| Various remarks
+|41.10| Writing a plugin
+|41.11| Writing a filetype plugin
+|41.12| Writing a compiler plugin
+
+ Next chapter: |usr_42.txt| Add new menus
+ Previous chapter: |usr_40.txt| Make new commands
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*41.1* Introduction *vim-script-intro*
+
+Your first experience with Vim scripts is the vimrc file. Vim reads it when
+it starts up and executes the commands. You can set options to values you
+prefer. And you can use any colon command in it (commands that start with a
+":"; these are sometimes referred to as Ex commands or command-line commands).
+ Syntax files are also Vim scripts. As are files that set options for a
+specific file type. A complicated macro can be defined by a separate Vim
+script file. You can think of other uses yourself.
+
+Let's start with a simple example: >
+
+ :let i = 1
+ :while i < 5
+ : echo "count is" i
+ : let i = i + 1
+ :endwhile
+<
+ Note:
+ The ":" characters are not really needed here. You only need to use
+ them when you type a command. In a Vim script file they can be left
+ out. We will use them here anyway to make clear these are colon
+ commands and make them stand out from Normal mode commands.
+
+The ":let" command assigns a value to a variable. The generic form is: >
+
+ :let {variable} = {expression}
+
+In this case the variable name is "i" and the expression is a simple value,
+the number one.
+ The ":while" command starts a loop. The generic form is: >
+
+ :while {condition}
+ : {statements}
+ :endwhile
+
+The statements until the matching ":endwhile" are executed for as long as the
+condition is true. The condition used here is the expression "i < 5". This
+is true when the variable i is smaller than five.
+ The ":echo" command prints its arguments. In this case the string "count
+is" and the value of the variable i. Since i is one, this will print:
+
+ count is 1 ~
+
+Then there is another ":let i =" command. The value used is the expression "i
++ 1". This adds one to the variable i and assigns the new value to the same
+variable.
+ The output of the example code is:
+
+ count is 1 ~
+ count is 2 ~
+ count is 3 ~
+ count is 4 ~
+
+ Note:
+ If you happen to write a while loop that keeps on running, you can
+ interrupt it by pressing CTRL-C (CTRL-Break on MS-Windows).
+
+
+THREE KINDS OF NUMBERS
+
+Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts
+with "0x" or "0X". For example "0x1f" is 31. An octal number starts with a
+zero. "017" is 15. Careful: don't put a zero before a decimal number, it
+will be interpreted as an octal number!
+ The ":echo" command always prints decimal numbers. Example: >
+
+ :echo 0x7f 036
+< 127 30 ~
+
+A number is made negative with a minus sign. This also works for hexadecimal
+and octal numbers. A minus sign is also for subtraction. Compare this with
+the previous example: >
+
+ :echo 0x7f -036
+< 97 ~
+
+White space in an expression is ignored. However, it's recommended to use it
+for separating items, to make the expression easier to read. For example, to
+avoid the confusion with a negative number, put a space between the minus sign
+and the following number: >
+
+ :echo 0x7f - 036
+
+==============================================================================
+*41.2* Variables
+
+A variable name consists of ASCII letters, digits and the underscore. It
+cannot start with a digit. Valid variable names are:
+
+ counter
+ _aap3
+ very_long_variable_name_with_underscores
+ FuncLength
+ LENGTH
+
+Invalid names are "foo+bar" and "6var".
+ These variables are global. To see a list of currently defined variables
+use this command: >
+
+ :let
+
+You can use global variables everywhere. This also means that when the
+variable "count" is used in one script file, it might also be used in another
+file. This leads to confusion at least, and real problems at worst. To avoid
+this, you can use a variable local to a script file by prepending "s:". For
+example, one script contains this code: >
+
+ :let s:count = 1
+ :while s:count < 5
+ : source other.vim
+ : let s:count = s:count + 1
+ :endwhile
+
+Since "s:count" is local to this script, you can be sure that sourcing the
+"other.vim" script will not change this variable. If "other.vim" also uses an
+"s:count" variable, it will be a different copy, local to that script. More
+about script-local variables here: |script-variable|.
+
+There are more kinds of variables, see |internal-variables|. The most often
+used ones are:
+
+ b:name variable local to a buffer
+ w:name variable local to a window
+ g:name global variable (also in a function)
+ v:name variable predefined by Vim
+
+
+DELETING VARIABLES
+
+Variables take up memory and show up in the output of the ":let" command. To
+delete a variable use the ":unlet" command. Example: >
+
+ :unlet s:count
+
+This deletes the script-local variable "s:count" to free up the memory it
+uses. If you are not sure if the variable exists, and don't want an error
+message when it doesn't, append !: >
+
+ :unlet! s:count
+
+When a script finishes, the local variables used there will not be
+automatically freed. The next time the script executes, it can still use the
+old value. Example: >
+
+ :if !exists("s:call_count")
+ : let s:call_count = 0
+ :endif
+ :let s:call_count = s:call_count + 1
+ :echo "called" s:call_count "times"
+
+The "exists()" function checks if a variable has already been defined. Its
+argument is the name of the variable you want to check. Not the variable
+itself! If you would do this: >
+
+ :if !exists(s:call_count)
+
+Then the value of s:call_count will be used as the name of the variable that
+exists() checks. That's not what you want.
+ The exclamation mark ! negates a value. When the value was true, it
+becomes false. When it was false, it becomes true. You can read it as "not".
+Thus "if !exists()" can be read as "if not exists()".
+ What Vim calls true is anything that is not zero. Only zero is false.
+
+
+STRING VARIABLES AND CONSTANTS
+
+So far only numbers were used for the variable value. Strings can be used as
+well. Numbers and strings are the only two types of variables that Vim
+supports. The type is dynamic, it is set each time when assigning a value to
+the variable with ":let".
+ To assign a string value to a variable, you need to use a string constant.
+There are two types of these. First the string in double quotes: >
+
+ :let name = "peter"
+ :echo name
+< peter ~
+
+If you want to include a double quote inside the string, put a backslash in
+front of it: >
+
+ :let name = "\"peter\""
+ :echo name
+< "peter" ~
+
+To avoid the need for a backslash, you can use a string in single quotes: >
+
+ :let name = '"peter"'
+ :echo name
+< "peter" ~
+
+Inside a single-quote string all the characters are taken literally. The
+drawback is that it's impossible to include a single quote. A backslash is
+taken literally as well, thus you can't use it to change the meaning of the
+character after it.
+ In double-quote strings it is possible to use special characters. Here are
+a few useful ones:
+
+ \t <Tab>
+ \n <NL>, line break
+ \r <CR>, <Enter>
+ \e <Esc>
+ \b <BS>, backspace
+ \" "
+ \\ \, backslash
+ \<Esc> <Esc>
+ \<C-W> CTRL-W
+
+The last two are just examples. The "\<name>" form can be used to include
+the special key "name".
+ See |expr-quote| for the full list of special items in a string.
+
+==============================================================================
+*41.3* Expressions
+
+Vim has a rich, yet simple way to handle expressions. You can read the
+definition here: |expression-syntax|. Here we will show the most common
+items.
+ The numbers, strings and variables mentioned above are expressions by
+themselves. Thus everywhere an expression is expected, you can use a number,
+string or variable. Other basic items in an expression are:
+
+ $NAME environment variable
+ &name option
+ @r register
+
+Examples: >
+
+ :echo "The value of 'tabstop' is" &ts
+ :echo "Your home directory is" $HOME
+ :if @a > 5
+
+The &name form can be used to save an option value, set it to a new value,
+do something and restore the old value. Example: >
+
+ :let save_ic = &ic
+ :set noic
+ :/The Start/,$delete
+ :let &ic = save_ic
+
+This makes sure the "The Start" pattern is used with the 'ignorecase' option
+off. Still, it keeps the value that the user had set.
+
+
+MATHEMATICS
+
+It becomes more interesting if we combine these basic items. Let's start with
+mathematics on numbers:
+
+ a + b add
+ a - b subtract
+ a * b multiply
+ a / b divide
+ a % b modulo
+
+The usual precedence is used. Example: >
+
+ :echo 10 + 5 * 2
+< 20 ~
+
+Grouping is done with braces. No surprises here. Example: >
+
+ :echo (10 + 5) * 2
+< 30 ~
+
+Strings can be concatenated with ".". Example: >
+
+ :echo "foo" . "bar"
+< foobar ~
+
+When the ":echo" command gets multiple arguments, it separates them with a
+space. In the example the argument is a single expression, thus no space is
+inserted.
+
+Borrowed from the C language is the conditional expression:
+
+ a ? b : c
+
+If "a" evaluates to true "b" is used, otherwise "c" is used. Example: >
+
+ :let i = 4
+ :echo i > 5 ? "i is big" : "i is small"
+< i is small ~
+
+The three parts of the constructs are always evaluated first, thus you could
+see it work as:
+
+ (a) ? (b) : (c)
+
+==============================================================================
+*41.4* Conditionals
+
+The ":if" commands executes the following statements, until the matching
+":endif", only when a condition is met. The generic form is:
+
+ :if {condition}
+ {statements}
+ :endif
+
+Only when the expression {condition} evaluates to true (non-zero) will the
+{statements} be executed. These must still be valid commands. If they
+contain garbage, Vim won't be able to find the ":endif".
+ You can also use ":else". The generic form for this is:
+
+ :if {condition}
+ {statements}
+ :else
+ {statements}
+ :endif
+
+The second {statements} is only executed if the first one isn't.
+ Finally, there is ":elseif":
+
+ :if {condition}
+ {statements}
+ :elseif {condition}
+ {statements}
+ :endif
+
+This works just like using ":else" and then "if", but without the need for an
+extra ":endif".
+ A useful example for your vimrc file is checking the 'term' option and
+doing something depending upon its value: >
+
+ :if &term == "xterm"
+ : " Do stuff for xterm
+ :elseif &term == "vt100"
+ : " Do stuff for a vt100 terminal
+ :else
+ : " Do something for other terminals
+ :endif
+
+
+LOGIC OPERATIONS
+
+We already used some of them in the examples. These are the most often used
+ones:
+
+ a == b equal to
+ a != b not equal to
+ a > b greater than
+ a >= b greater than or equal to
+ a < b less than
+ a <= b less than or equal to
+
+The result is one if the condition is met and zero otherwise. An example: >
+
+ :if v:version >= 600
+ : echo "congratulations"
+ :else
+ : echo "you are using an old version, upgrade!"
+ :endif
+
+Here "v:version" is a variable defined by Vim, which has the value of the Vim
+version. 600 is for version 6.0. Version 6.1 has the value 601. This is
+very useful to write a script that works with multiple versions of Vim.
+|v:version|
+
+The logic operators work both for numbers and strings. When comparing two
+strings, the mathematical difference is used. This compares byte values,
+which may not be right for some languages.
+ When comparing a string with a number, the string is first converted to a
+number. This is a bit tricky, because when a string doesn't look like a
+number, the number zero is used. Example: >
+
+ :if 0 == "one"
+ : echo "yes"
+ :endif
+
+This will echo "yes", because "one" doesn't look like a number, thus it is
+converted to the number zero.
+
+For strings there are two more items:
+
+ a =~ b matches with
+ a !~ b does not match with
+
+The left item "a" is used as a string. The right item "b" is used as a
+pattern, like what's used for searching. Example: >
+
+ :if str =~ " "
+ : echo "str contains a space"
+ :endif
+ :if str !~ '\.$'
+ : echo "str does not end in a full stop"
+ :endif
+
+Notice the use of a single-quote string for the pattern. This is useful,
+because backslashes need to be doubled in a double-quote string and patterns
+tend to contain many backslashes.
+
+The 'ignorecase' option is used when comparing strings. When you don't want
+that, append "#" to match case and "?" to ignore case. Thus "==?" compares
+two strings to be equal while ignoring case. And "!~#" checks if a pattern
+doesn't match, also checking the case of letters. For the full table see
+|expr-==|.
+
+
+MORE LOOPING
+
+The ":while" command was already mentioned. Two more statements can be used
+in between the ":while" and the ":endwhile":
+
+ :continue Jump back to the start of the while loop; the
+ loop continues.
+ :break Jump forward to the ":endwhile"; the loop is
+ discontinued.
+
+Example: >
+
+ :while counter < 40
+ : call do_something()
+ : if skip_flag
+ : continue
+ : endif
+ : if finished_flag
+ : break
+ : endif
+ : sleep 50m
+ :endwhile
+
+The ":sleep" command makes Vim take a nap. The "50m" specifies fifty
+milliseconds. Another example is ":sleep 4", which sleeps for four seconds.
+
+==============================================================================
+*41.5* Executing an expression
+
+So far the commands in the script were executed by Vim directly. The
+":execute" command allows executing the result of an expression. This is a
+very powerful way to build commands and execute them.
+ An example is to jump to a tag, which is contained in a variable: >
+
+ :execute "tag " . tag_name
+
+The "." is used to concatenate the string "tag " with the value of variable
+"tag_name". Suppose "tag_name" has the value "get_cmd", then the command that
+will be executed is: >
+
+ :tag get_cmd
+
+The ":execute" command can only execute colon commands. The ":normal" command
+executes Normal mode commands. However, its argument is not an expression but
+the literal command characters. Example: >
+
+ :normal gg=G
+
+This jumps to the first line and formats all lines with the "=" operator.
+ To make ":normal" work with an expression, combine ":execute" with it.
+Example: >
+
+ :execute "normal " . normal_commands
+
+The variable "normal_commands" must contain the Normal mode commands.
+ Make sure that the argument for ":normal" is a complete command. Otherwise
+Vim will run into the end of the argument and abort the command. For example,
+if you start Insert mode, you must leave Insert mode as well. This works: >
+
+ :execute "normal Inew text \<Esc>"
+
+This inserts "new text " in the current line. Notice the use of the special
+key "\<Esc>". This avoids having to enter a real <Esc> character in your
+script.
+
+==============================================================================
+*41.6* Using functions
+
+Vim defines many functions and provides a large amount of functionality that
+way. A few examples will be given in this section. You can find the whole
+list here: |functions|.
+
+A function is called with the ":call" command. The parameters are passed in
+between braces, separated by commas. Example: >
+
+ :call search("Date: ", "W")
+
+This calls the search() function, with arguments "Date: " and "W". The
+search() function uses its first argument as a search pattern and the second
+one as flags. The "W" flag means the search doesn't wrap around the end of
+the file.
+
+A function can be called in an expression. Example: >
+
+ :let line = getline(".")
+ :let repl = substitute(line, '\a', "*", "g")
+ :call setline(".", repl)
+
+The getline() function obtains a line from the current file. Its argument is
+a specification of the line number. In this case "." is used, which means the
+line where the cursor is.
+ The substitute() function does something similar to the ":substitute"
+command. The first argument is the string on which to perform the
+substitution. The second argument is the pattern, the third the replacement
+string. Finally, the last arguments are the flags.
+ The setline() function sets the line, specified by the first argument, to a
+new string, the second argument. In this example the line under the cursor is
+replaced with the result of the substitute(). Thus the effect of the three
+statements is equal to: >
+
+ :substitute/\a/*/g
+
+Using the functions becomes more interesting when you do more work before and
+after the substitute() call.
+
+
+FUNCTIONS *function-list*
+
+There are many functions. We will mention them here, grouped by what they are
+used for. You can find an alphabetical list here: |functions|. Use CTRL-] on
+the function name to jump to detailed help on it.
+
+String manipulation:
+ char2nr() get ASCII value of a character
+ nr2char() get a character by its ASCII value
+ escape() escape characters in a string with a '\'
+ strtrans() translate a string to make it printable
+ tolower() turn a string to lowercase
+ toupper() turn a string to uppercase
+ match() position where a pattern matches in a string
+ matchend() position where a pattern match ends in a string
+ matchstr() match of a pattern in a string
+ stridx() first index of a short string in a long string
+ strridx() last index of a short string in a long string
+ strlen() length of a string
+ substitute() substitute a pattern match with a string
+ submatch() get a specific match in a ":substitute"
+ strpart() get part of a string
+ expand() expand special keywords
+ type() type of a variable
+ iconv() convert text from one encoding to another
+
+Working with text in the current buffer:
+ byte2line() get line number at a specific byte count
+ line2byte() byte count at a specific line
+ col() column number of the cursor or a mark
+ virtcol() screen column of the cursor or a mark
+ line() line number of the cursor or mark
+ wincol() window column number of the cursor
+ winline() window line number of the cursor
+ cursor() position the cursor at a line/column
+ getline() get a line from the buffer
+ setline() replace a line in the buffer
+ append() append {string} below line {lnum}
+ indent() indent of a specific line
+ cindent() indent according to C indenting
+ lispindent() indent according to Lisp indenting
+ nextnonblank() find next non-blank line
+ prevnonblank() find previous non-blank line
+ search() find a match for a pattern
+ searchpair() find the other end of a start/skip/end
+
+System functions and manipulation of files:
+ browse() put up a file requester
+ glob() expand wildcards
+ globpath() expand wildcards in a number of directories
+ resolve() find out where a shortcut points to
+ fnamemodify() modify a file name
+ executable() check if an executable program exists
+ filereadable() check if a file can be read
+ filewritable() check if a file can be written to
+ isdirectory() check if a directory exists
+ getcwd() get the current working directory
+ getfsize() get the size of a file
+ getftime() get last modification time of a file
+ localtime() get current time
+ strftime() convert time to a string
+ tempname() get the name of a temporary file
+ delete() delete a file
+ rename() rename a file
+ system() get the result of a shell command
+ hostname() name of the system
+
+Buffers, windows and the argument list:
+ argc() number of entries in the argument list
+ argidx() current position in the argument list
+ argv() get one entry from the argument list
+ bufexists() check if a buffer exists
+ buflisted() check if a buffer exists and is listed
+ bufloaded() check if a buffer exists and is loaded
+ bufname() get the name of a specific buffer
+ bufnr() get the buffer number of a specific buffer
+ winnr() get the window number for the current window
+ bufwinnr() get the window number of a specific buffer
+ winbufnr() get the buffer number of a specific window
+ getbufvar() get a variable value from a specific buffer
+ setbufvar() set a variable in a specific buffer
+ getwinvar() get a variable value from a specific window
+ setwinvar() set a variable in a specific window
+
+Folding:
+ foldclosed() check for a closed fold at a specific line
+ foldclosedend() like foldclosed() but return the last line
+ foldlevel() check for the fold level at a specific line
+ foldtext() generate the line displayed for a closed fold
+
+Syntax highlighting:
+ hlexists() check if a highlight group exists
+ hlID() get ID of a highlight group
+ synID() get syntax ID at a specific position
+ synIDattr() get a specific attribute of a syntax ID
+ synIDtrans() get translated syntax ID
+
+History:
+ histadd() add an item to a history
+ histdel() delete an item from a history
+ histget() get an item from a history
+ histnr() get highest index of a history list
+
+Interactive:
+ confirm() let the user make a choice
+ getchar() get a character from the user
+ getcharmod() get modifiers for the last typed character
+ input() get a line from the user
+ inputsecret() get a line from the user without showing it
+ inputdialog() get a line from the user in a dialog
+ inputresave save and clear typeahead
+ inputrestore() restore typeahead
+
+Vim server:
+ serverlist() return the list of server names
+ remote_send() send command characters to a Vim server
+ remote_expr() evaluate an expression in a Vim server
+ server2client() send a reply to a client of a Vim server
+ remote_peek() check if there is a reply from a Vim server
+ remote_read() read a reply from a Vim server
+ foreground() move the Vim window to the foreground
+ remote_foreground() move the Vim server window to the foreground
+
+Various:
+ mode() get current editing mode
+ visualmode() last visual mode used
+ hasmapto() check if a mapping exists
+ mapcheck() check if a matching mapping exists
+ maparg() get rhs of a mapping
+ exists() check if a variable, function, etc. exists
+ has() check if a feature is supported in Vim
+ cscope_connection() check if a cscope connection exists
+ did_filetype() check if a FileType autocommand was used
+ eventhandler() check if invoked by an event handler
+ getwinposx() X position of the GUI Vim window
+ getwinposy() Y position of the GUI Vim window
+ winheight() get height of a specific window
+ winwidth() get width of a specific window
+ libcall() call a function in an external library
+ libcallnr() idem, returning a number
+ getreg() get contents of a register
+ getregtype() get type of a register
+ setreg() set contents and type of a register
+
+==============================================================================
+*41.7* Defining a function
+
+Vim enables you to define your own functions. The basic function declaration
+begins as follows: >
+
+ :function {name}({var1}, {var2}, ...)
+ : {body}
+ :endfunction
+<
+ Note:
+ Function names must begin with a capital letter.
+
+Let's define a short function to return the smaller of two numbers. It starts
+with this line: >
+
+ :function Min(num1, num2)
+
+This tells Vim that the function is named "Min" and it takes two arguments:
+"num1" and "num2".
+ The first thing you need to do is to check to see which number is smaller:
+ >
+ : if a:num1 < a:num2
+
+The special prefix "a:" tells Vim that the variable is a function argument.
+Let's assign the variable "smaller" the value of the smallest number: >
+
+ : if a:num1 < a:num2
+ : let smaller = a:num1
+ : else
+ : let smaller = a:num2
+ : endif
+
+The variable "smaller" is a local variable. Variables used inside a function
+are local unless prefixed by something like "g:", "a:", or "s:".
+
+ Note:
+ To access a global variable from inside a function you must prepend
+ "g:" to it. Thus "g:count" inside a function is used for the global
+ variable "count", and "count" is another variable, local to the
+ function.
+
+You now use the ":return" statement to return the smallest number to the user.
+Finally, you end the function: >
+
+ : return smaller
+ :endfunction
+
+The complete function definition is as follows: >
+
+ :function Min(num1, num2)
+ : if a:num1 < a:num2
+ : let smaller = a:num1
+ : else
+ : let smaller = a:num2
+ : endif
+ : return smaller
+ :endfunction
+
+A user defined function is called in exactly the same way as a builtin
+function. Only the name is different. The Min function can be used like
+this: >
+
+ :echo Min(5, 8)
+
+Only now will the function be executed and the lines be interpreted by Vim.
+If there are mistakes, like using an undefined variable or function, you will
+now get an error message. When defining the function these errors are not
+detected.
+
+When a function reaches ":endfunction" or ":return" is used without an
+argument, the function returns zero.
+
+To redefine a function that already exists, use the ! for the ":function"
+command: >
+
+ :function! Min(num1, num2, num3)
+
+
+USING A RANGE
+
+The ":call" command can be given a line range. This can have one of two
+meanings. When a function has been defined with the "range" keyword, it will
+take care of the line range itself.
+ The function will be passed the variables "a:firstline" and "a:lastline".
+These will have the line numbers from the range the function was called with.
+Example: >
+
+ :function Count_words() range
+ : let n = a:firstline
+ : let count = 0
+ : while n <= a:lastline
+ : let count = count + Wordcount(getline(n))
+ : let n = n + 1
+ : endwhile
+ : echo "found " . count . " words"
+ :endfunction
+
+You can call this function with: >
+
+ :10,30call Count_words()
+
+It will be executed once and echo the number of words.
+ The other way to use a line range is by defining a function without the
+"range" keyword. The function will be called once for every line in the
+range, with the cursor in that line. Example: >
+
+ :function Number()
+ : echo "line " . line(".") . " contains: " . getline(".")
+ :endfunction
+
+If you call this function with: >
+
+ :10,15call Number()
+
+The function will be called six times.
+
+
+VARIABLE NUMBER OF ARGUMENTS
+
+Vim enables you to define functions that have a variable number of arguments.
+The following command, for instance, defines a function that must have 1
+argument (start) and can have up to 20 additional arguments: >
+
+ :function Show(start, ...)
+
+The variable "a:1" contains the first optional argument, "a:2" the second, and
+so on. The variable "a:0" contains the number of extra arguments.
+ For example: >
+
+ :function Show(start, ...)
+ : echohl Title
+ : echo "Show is " . a:start
+ : echohl None
+ : let index = 1
+ : while index <= a:0
+ : echo " Arg " . index . " is " . a:{index}
+ : let index = index + 1
+ : endwhile
+ : echo ""
+ :endfunction
+
+This uses the ":echohl" command to specify the highlighting used for the
+following ":echo" command. ":echohl None" stops it again. The ":echon"
+command works like ":echo", but doesn't output a line break.
+
+
+LISTING FUNCTIONS
+
+The ":function" command lists the names and arguments of all user-defined
+functions: >
+
+ :function
+< function Show(start, ...) ~
+ function GetVimIndent() ~
+ function SetSyn(name) ~
+
+To see what a function does, use its name as an argument for ":function": >
+
+ :function SetSyn
+< 1 if &syntax == '' ~
+ 2 let &syntax = a:name ~
+ 3 endif ~
+ endfunction ~
+
+
+DEBUGGING
+
+The line number is useful for when you get an error message or when debugging.
+See |debug-scripts| about debugging mode.
+ You can also set the 'verbose' option to 12 or higher to see all function
+calls. Set it to 15 or higher to see every executed line.
+
+
+DELETING A FUNCTION
+
+To delete the Show() function: >
+
+ :delfunction Show
+
+You get an error when the function doesn't exist.
+
+==============================================================================
+*41.8* Exceptions
+
+Let's start with an example: >
+
+ :try
+ : read ~/templates/pascal.tmpl
+ :catch /E484:/
+ : echo "Sorry, the Pascal template file cannot be found."
+ :endtry
+
+The ":read" command will fail if the file does not exist. Instead of
+generating an error message, this code catches the error and gives the user a
+nice message instead.
+
+For the commands in between ":try" and ":endtry" errors are turned into
+exceptions. An exception is a string. In the case of an error the string
+contains the error message. And every error message has a number. In this
+case, the error we catch contains "E484:". This number is guaranteed to stay
+the same (the text may change, e.g., it may be translated).
+
+When the ":read" command causes another error, the pattern "E484:" will not
+match in it. Thus this exception will not be caught and result in the usual
+error message.
+
+You might be tempted to do this: >
+
+ :try
+ : read ~/templates/pascal.tmpl
+ :catch
+ : echo "Sorry, the Pascal template file cannot be found."
+ :endtry
+
+This means all errors are caught. But then you will not see errors that are
+useful, such as "E21: Cannot make changes, 'modifiable' is off".
+
+Another useful mechanism is the ":finally" command: >
+
+ :let tmp = tempname()
+ :try
+ : exe ".,$write " . tmp
+ : exe "!filter " . tmp
+ : .,$delete
+ : exe "$read " . tmp
+ :finally
+ : call delete(tmp)
+ :endtry
+
+This filters the lines from the cursor until the end of the file through the
+"filter" command, which takes a file name argument. No matter if the
+filtering works, something goes wrong in between ":try" and ":finally" or the
+user cancels the filtering by pressing CTRL-C, the "call delete(tmp)" is
+always executed. This makes sure you don't leave the temporary file behind.
+
+More information about exception handling can be found in the reference
+manual: |exception-handling|.
+
+==============================================================================
+*41.9* Various remarks
+
+Here is a summary of items that apply to Vim scripts. They are also mentioned
+elsewhere, but form a nice checklist.
+
+The end-of-line character depends on the system. For Unix a single <NL>
+character is used. For MS-DOS, Windows, OS/2 and the like, <CR><LF> is used.
+This is important when using mappings that end in a <CR>. See |:source_crnl|.
+
+
+WHITE SPACE
+
+Blank lines are allowed and ignored.
+
+Leading whitespace characters (blanks and TABs) are always ignored. The
+whitespaces between parameters (e.g. between the 'set' and the 'cpoptions' in
+the example below) are reduced to one blank character and plays the role of a
+separator, the whitespaces after the last (visible) character may or may not
+be ignored depending on the situation, see below.
+
+For a ":set" command involving the "=" (equal) sign, such as in: >
+
+ :set cpoptions =aABceFst
+
+the whitespace immediately before the "=" sign is ignored. But there can be
+no whitespace after the "=" sign!
+
+To include a whitespace character in the value of an option, it must be
+escaped by a "\" (backslash) as in the following example: >
+
+ :set tags=my\ nice\ file
+
+The same example written as >
+
+ :set tags=my nice file
+
+will issue an error, because it is interpreted as: >
+
+ :set tags=my
+ :set nice
+ :set file
+
+
+COMMENTS
+
+The character " (the double quote mark) starts a comment. Everything after
+and including this character until the end-of-line is considered a comment and
+is ignored, except for commands that don't consider comments, as shown in
+examples below. A comment can start on any character position on the line.
+
+There is a little "catch" with comments for some commands. Examples: >
+
+ :abbrev dev development " shorthand
+ :map <F3> o#include " insert include
+ :execute cmd " do it
+ :!ls *.c " list C files
+
+The abbreviation 'dev' will be expanded to 'development " shorthand'. The
+mapping of <F3> will actually be the whole line after the 'o# ....' including
+the '" insert include'. The "execute" command will give an error. The "!"
+command will send everything after it to the shell, causing an error for an
+unmatched '"' character.
+ There can be no comment after ":map", ":abbreviate", ":execute" and "!"
+commands (there are a few more commands with this restriction). For the
+":map", ":abbreviate" and ":execute" commands there is a trick: >
+
+ :abbrev dev development|" shorthand
+ :map <F3> o#include|" insert include
+ :execute cmd |" do it
+
+With the '|' character the command is separated from the next one. And that
+next command is only a comment.
+
+Notice that there is no white space before the '|' in the abbreviation and
+mapping. For these commands, any character until the end-of-line or '|' is
+included. As a consequence of this behavior, you don't always see that
+trailing whitespace is included: >
+
+ :map <F4> o#include
+
+To avoid these problems, you can set the 'list' option when editing vimrc
+files.
+
+
+PITFALLS
+
+Even bigger problem arises in the following example: >
+
+ :map ,ab o#include
+ :unmap ,ab
+
+Here the unmap command will not work, because it tries to unmap ",ab ". This
+does not exist as a mapped sequence. An error will be issued, which is very
+hard to identify, because the ending whitespace character in ":unmap ,ab " is
+not visible.
+
+And this is the same as what happens when one uses a comment after an 'unmap'
+command: >
+
+ :unmap ,ab " comment
+
+Here the comment part will be ignored. However, Vim will try to unmap
+',ab ', which does not exist. Rewrite it as: >
+
+ :unmap ,ab| " comment
+
+
+RESTORING THE VIEW
+
+Sometimes you want to make a change and go back to where cursor was.
+Restoring the relative position would also be nice, so that the same line
+appears at the top of the window.
+ This example yanks the current line, puts it above the first line in the
+file and then restores the view: >
+
+ map ,p ma"aYHmbgg"aP`bzt`a
+
+What this does: >
+ ma"aYHmbgg"aP`bzt`a
+< ma set mark a at cursor position
+ "aY yank current line into register a
+ Hmb go to top line in window and set mark b there
+ gg go to first line in file
+ "aP put the yanked line above it
+ `b go back to top line in display
+ zt position the text in the window as before
+ `a go back to saved cursor position
+
+
+PACKAGING
+
+To avoid your function names to interfere with functions that you get from
+others, use this scheme:
+- Prepend a unique string before each function name. I often use an
+ abbreviation. For example, "OW_" is used for the option window functions.
+- Put the definition of your functions together in a file. Set a global
+ variable to indicate that the functions have been loaded. When sourcing the
+ file again, first unload the functions.
+Example: >
+
+ " This is the XXX package
+
+ if exists("XXX_loaded")
+ delfun XXX_one
+ delfun XXX_two
+ endif
+
+ function XXX_one(a)
+ ... body of function ...
+ endfun
+
+ function XXX_two(b)
+ ... body of function ...
+ endfun
+
+ let XXX_loaded = 1
+
+==============================================================================
+*41.10* Writing a plugin *write-plugin*
+
+You can write a Vim script in such a way that many people can use it. This is
+called a plugin. Vim users can drop your script in their plugin directory and
+use its features right away |add-plugin|.
+
+There are actually two types of plugins:
+
+ global plugins: For all types of files.
+filetype plugins: Only for files of a specific type.
+
+In this section the first type is explained. Most items are also relevant for
+writing filetype plugins. The specifics for filetype plugins are in the next
+section |write-filetype-plugin|.
+
+
+NAME
+
+First of all you must choose a name for your plugin. The features provided
+by the plugin should be clear from its name. And it should be unlikely that
+someone else writes a plugin with the same name but which does something
+different. And please limit the name to 8 characters, to avoid problems on
+old Windows systems.
+
+A script that corrects typing mistakes could be called "typecorr.vim". We
+will use it here as an example.
+
+For the plugin to work for everybody, it should follow a few guidelines. This
+will be explained step-by-step. The complete example plugin is at the end.
+
+
+BODY
+
+Let's start with the body of the plugin, the lines that do the actual work: >
+
+ 14 iabbrev teh the
+ 15 iabbrev otehr other
+ 16 iabbrev wnat want
+ 17 iabbrev synchronisation
+ 18 \ synchronization
+ 19 let s:count = 4
+
+The actual list should be much longer, of course.
+
+The line numbers have only been added to explain a few things, don't put them
+in your plugin file!
+
+
+HEADER
+
+You will probably add new corrections to the plugin and soon have several
+versions laying around. And when distributing this file, people will want to
+know who wrote this wonderful plugin and where they can send remarks.
+Therefore, put a header at the top of your plugin: >
+
+ 1 " Vim global plugin for correcting typing mistakes
+ 2 " Last Change: 2000 Oct 15
+ 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
+
+About copyright and licensing: Since plugins are very useful and it's hardly
+worth restricting their distribution, please consider making your plugin
+either public domain or use the Vim |license|. A short note about this near
+the top of the plugin should be sufficient. Example: >
+
+ 4 " License: This file is placed in the public domain.
+
+
+LINE CONTINUATION, AVOIDING SIDE EFFECTS *use-cpo-save*
+
+In line 18 above, the line-continuation mechanism is used |line-continuation|.
+Users with 'compatible' set will run into trouble here, they will get an error
+message. We can't just reset 'compatible', because that has a lot of side
+effects. To avoid this, we will set the 'cpoptions' option to its Vim default
+value and restore it later. That will allow the use of line-continuation and
+make the script work for most people. It is done like this: >
+
+ 11 let s:save_cpo = &cpo
+ 12 set cpo&vim
+ ..
+ 42 let &cpo = s:save_cpo
+
+We first store the old value of 'cpoptions' in the s:save_cpo variable. At
+the end of the plugin this value is restored.
+
+Notice that a script-local variable is used |s:var|. A global variable could
+already be in use for something else. Always use script-local variables for
+things that are only used in the script.
+
+
+NOT LOADING
+
+It's possible that a user doesn't always want to load this plugin. Or the
+system administrator has dropped it in the system-wide plugin directory, but a
+user has his own plugin he wants to use. Then the user must have a chance to
+disable loading this specific plugin. This will make it possible: >
+
+ 6 if exists("loaded_typecorr")
+ 7 finish
+ 8 endif
+ 9 let loaded_typecorr = 1
+
+This also avoids that when the script is loaded twice it would cause error
+messages for redefining functions and cause trouble for autocommands that are
+added twice.
+
+
+MAPPING
+
+Now let's make the plugin more interesting: We will add a mapping that adds a
+correction for the word under the cursor. We could just pick a key sequence
+for this mapping, but the user might already use it for something else. To
+allow the user to define which keys a mapping in a plugin uses, the <Leader>
+item can be used: >
+
+ 22 map <unique> <Leader>a <Plug>TypecorrAdd
+
+The "<Plug>TypecorrAdd" thing will do the work, more about that further on.
+
+The user can set the "mapleader" variable to the key sequence that he wants
+this mapping to start with. Thus if the user has done: >
+
+ let mapleader = "_"
+
+the mapping will define "_a". If the user didn't do this, the default value
+will be used, which is a backslash. Then a map for "\a" will be defined.
+
+Note that <unique> is used, this will cause an error message if the mapping
+already happened to exist. |:map-<unique>|
+
+But what if the user wants to define his own key sequence? We can allow that
+with this mechanism: >
+
+ 21 if !hasmapto('<Plug>TypecorrAdd')
+ 22 map <unique> <Leader>a <Plug>TypecorrAdd
+ 23 endif
+
+This checks if a mapping to "<Plug>TypecorrAdd" already exists, and only
+defines the mapping from "<Leader>a" if it doesn't. The user then has a
+chance of putting this in his vimrc file: >
+
+ map ,c <Plug>TypecorrAdd
+
+Then the mapped key sequence will be ",c" instead of "_a" or "\a".
+
+
+PIECES
+
+If a script gets longer, you often want to break up the work in pieces. You
+can use functions or mappings for this. But you don't want these functions
+and mappings to interfere with the ones from other scripts. For example, you
+could define a function Add(), but another script could try to define the same
+function. To avoid this, we define the function local to the script by
+prepending it with "s:".
+
+We will define a function that adds a new typing correction: >
+
+ 30 function s:Add(from, correct)
+ 31 let to = input("type the correction for " . a:from . ": ")
+ 32 exe ":iabbrev " . a:from . " " . to
+ ..
+ 36 endfunction
+
+Now we can call the function s:Add() from within this script. If another
+script also defines s:Add(), it will be local to that script and can only
+be called from the script it was defined in. There can also be a global Add()
+function (without the "s:"), which is again another function.
+
+<SID> can be used with mappings. It generates a script ID, which identifies
+the current script. In our typing correction plugin we use it like this: >
+
+ 24 noremap <unique> <script> <Plug>TypecorrAdd <SID>Add
+ ..
+ 28 noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR>
+
+Thus when a user types "\a", this sequence is invoked: >
+
+ \a -> <Plug>TypecorrAdd -> <SID>Add -> :call <SID>Add()
+
+If another script would also map <SID>Add, it would get another script ID and
+thus define another mapping.
+
+Note that instead of s:Add() we use <SID>Add() here. That is because the
+mapping is typed by the user, thus outside of the script. The <SID> is
+translated to the script ID, so that Vim knows in which script to look for
+the Add() function.
+
+This is a bit complicated, but it's required for the plugin to work together
+with other plugins. The basic rule is that you use <SID>Add() in mappings and
+s:Add() in other places (the script itself, autocommands, user commands).
+
+We can also add a menu entry to do the same as the mapping: >
+
+ 26 noremenu <script> Plugin.Add\ Correction <SID>Add
+
+The "Plugin" menu is recommended for adding menu items for plugins. In this
+case only one item is used. When adding more items, creating a submenu is
+recommended. For example, "Plugin.CVS" could be used for a plugin that offers
+CVS operations "Plugin.CVS.checkin", "Plugin.CVS.checkout", etc.
+
+Note that in line 28 ":noremap" is used to avoid that any other mappings cause
+trouble. Someone may have remapped ":call", for example. In line 24 we also
+use ":noremap", but we do want "<SID>Add" to be remapped. This is why
+"<script>" is used here. This only allows mappings which are local to the
+script. |:map-<script>| The same is done in line 26 for ":noremenu".
+|:menu-<script>|
+
+
+<SID> AND <Plug> *using-<Plug>*
+
+Both <SID> and <Plug> are used to avoid that mappings of typed keys interfere
+with mappings that are only to be used from other mappings. Note the
+difference between using <SID> and <Plug>:
+
+<Plug> is visible outside of the script. It is used for mappings which the
+ user might want to map a key sequence to. <Plug> is a special code
+ that a typed key will never produce.
+ To make it very unlikely that other plugins use the same sequence of
+ characters, use this structure: <Plug> scriptname mapname
+ In our example the scriptname is "Typecorr" and the mapname is "Add".
+ This results in "<Plug>TypecorrAdd". Only the first character of
+ scriptname and mapname is uppercase, so that we can see where mapname
+ starts.
+
+<SID> is the script ID, a unique identifier for a script.
+ Internally Vim translates <SID> to "<SNR>123_", where "123" can be any
+ number. Thus a function "<SID>Add()" will have a name "<SNR>11_Add()"
+ in one script, and "<SNR>22_Add()" in another. You can see this if
+ you use the ":function" command to get a list of functions. The
+ translation of <SID> in mappings is exactly the same, that's how you
+ can call a script-local function from a mapping.
+
+
+USER COMMAND
+
+Now let's add a user command to add a correction: >
+
+ 38 if !exists(":Correct")
+ 39 command -nargs=1 Correct :call s:Add(<q-args>, 0)
+ 40 endif
+
+The user command is defined only if no command with the same name already
+exists. Otherwise we would get an error here. Overriding the existing user
+command with ":command!" is not a good idea, this would probably make the user
+wonder why the command he defined himself doesn't work. |:command|
+
+
+SCRIPT VARIABLES
+
+When a variable starts with "s:" it is a script variable. It can only be used
+inside a script. Outside the script it's not visible. This avoids trouble
+with using the same variable name in different scripts. The variables will be
+kept as long as Vim is running. And the same variables are used when sourcing
+the same script again. |s:var|
+
+The fun is that these variables can also be used in functions, autocommands
+and user commands that are defined in the script. In our example we can add
+a few lines to count the number of corrections: >
+
+ 19 let s:count = 4
+ ..
+ 30 function s:Add(from, correct)
+ ..
+ 34 let s:count = s:count + 1
+ 35 echo s:count . " corrections now"
+ 36 endfunction
+
+First s:count is initialized to 4 in the script itself. When later the
+s:Add() function is called, it increments s:count. It doesn't matter from
+where the function was called, since it has been defined in the script, it
+will use the local variables from this script.
+
+
+THE RESULT
+
+Here is the resulting complete example: >
+
+ 1 " Vim global plugin for correcting typing mistakes
+ 2 " Last Change: 2000 Oct 15
+ 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
+ 4 " License: This file is placed in the public domain.
+ 5
+ 6 if exists("loaded_typecorr")
+ 7 finish
+ 8 endif
+ 9 let loaded_typecorr = 1
+ 10
+ 11 let s:save_cpo = &cpo
+ 12 set cpo&vim
+ 13
+ 14 iabbrev teh the
+ 15 iabbrev otehr other
+ 16 iabbrev wnat want
+ 17 iabbrev synchronisation
+ 18 \ synchronization
+ 19 let s:count = 4
+ 20
+ 21 if !hasmapto('<Plug>TypecorrAdd')
+ 22 map <unique> <Leader>a <Plug>TypecorrAdd
+ 23 endif
+ 24 noremap <unique> <script> <Plug>TypecorrAdd <SID>Add
+ 25
+ 26 noremenu <script> Plugin.Add\ Correction <SID>Add
+ 27
+ 28 noremap <SID>Add :call <SID>Add(expand("<cword>"), 1)<CR>
+ 29
+ 30 function s:Add(from, correct)
+ 31 let to = input("type the correction for " . a:from . ": ")
+ 32 exe ":iabbrev " . a:from . " " . to
+ 33 if a:correct | exe "normal viws\<C-R>\" \b\e" | endif
+ 34 let s:count = s:count + 1
+ 35 echo s:count . " corrections now"
+ 36 endfunction
+ 37
+ 38 if !exists(":Correct")
+ 39 command -nargs=1 Correct :call s:Add(<q-args>, 0)
+ 40 endif
+ 41
+ 42 let &cpo = s:save_cpo
+
+Line 33 wasn't explained yet. It applies the new correction to the word under
+the cursor. The |:normal| command is used to use the new abbreviation. Note
+that mappings and abbreviations are expanded here, even though the function
+was called from a mapping defined with ":noremap".
+
+Using "unix" for the 'fileformat' option is recommended. The Vim scripts will
+then work everywhere. Scripts with 'fileformat' set to "dos" do not work on
+Unix. Also see |:source_crnl|. To be sure it is set right, do this before
+writing the file: >
+
+ :set fileformat=unix
+
+
+DOCUMENTATION *write-local-help*
+
+It's a good idea to also write some documentation for your plugin. Especially
+when its behavior can be changed by the user. See |add-local-help| for how
+they are installed.
+
+Here is a simple example for a plugin help file, called "typecorr.txt": >
+
+ 1 *typecorr.txt* Plugin for correcting typing mistakes
+ 2
+ 3 If you make typing mistakes, this plugin will have them corrected
+ 4 automatically.
+ 5
+ 6 There are currently only a few corrections. Add your own if you like.
+ 7
+ 8 Mappings:
+ 9 <Leader>a or <Plug>TypecorrAdd
+ 10 Add a correction for the word under the cursor.
+ 11
+ 12 Commands:
+ 13 :Correct {word}
+ 14 Add a correction for {word}.
+ 15
+ 16 *typecorr-settings*
+ 17 This plugin doesn't have any settings.
+
+The first line is actually the only one for which the format matters. It will
+be extracted from the help file to be put in the "LOCAL ADDITIONS:" section of
+help.txt |local-additions|. The first "*" must be in the first column of the
+first line. After adding your help file do ":help" and check that the entries
+line up nicely.
+
+You can add more tags inside ** in your help file. But be careful not to use
+existing help tags. You would probably use the name of your plugin in most of
+them, like "typecorr-settings" in the example.
+
+Using references to other parts of the help in || is recommended. This makes
+it easy for the user to find associated help.
+
+
+FILETYPE DETECTION *plugin-filetype*
+
+If your filetype is not already detected by Vim, you should create a filetype
+detection snippet in a separate file. It is usually in the form of an
+autocommand that sets the filetype when the file name matches a pattern.
+Example: >
+
+ au BufNewFile,BufRead *.foo set filetype=foofoo
+
+Write this single-line file as "ftdetect/foofoo.vim" in the first directory
+that appears in 'runtimepath'. For Unix that would be
+"~/.vim/ftdetect/foofoo.vim". The convention is to use the name of the
+filetype for the script name.
+
+You can make more complicated checks if you like, for example to inspect the
+contents of the file to recognize the language. Also see |new-filetype|.
+
+
+SUMMARY *plugin-special*
+
+Summary of special things to use in a plugin:
+
+s:name Variables local to the script.
+
+<SID> Script-ID, used for mappings and functions local to
+ the script.
+
+hasmapto() Function to test if the user already defined a mapping
+ for functionality the script offers.
+
+<Leader> Value of "mapleader", which the user defines as the
+ keys that plugin mappings start with.
+
+:map <unique> Give a warning if a mapping already exists.
+
+:noremap <script> Use only mappings local to the script, not global
+ mappings.
+
+exists(":Cmd") Check if a user command already exists.
+
+==============================================================================
+*41.11* Writing a filetype plugin *write-filetype-plugin* *ftplugin*
+
+A filetype plugin is like a global plugin, except that it sets options and
+defines mappings for the current buffer only. See |add-filetype-plugin| for
+how this type of plugin is used.
+
+First read the section on global plugins above |41.10|. All that is said there
+also applies to filetype plugins. There are a few extras, which are explained
+here. The essential thing is that a filetype plugin should only have an
+effect on the current buffer.
+
+
+DISABLING
+
+If you are writing a filetype plugin to be used by many people, they need a
+chance to disable loading it. Put this at the top of the plugin: >
+
+ " Only do this when not done yet for this buffer
+ if exists("b:did_ftplugin")
+ finish
+ endif
+ let b:did_ftplugin = 1
+
+This also needs to be used to avoid that the same plugin is executed twice for
+the same buffer (happens when using an ":edit" command without arguments).
+
+Now users can disable loading the default plugin completely by making a
+filetype plugin with only this line: >
+
+ let b:did_ftplugin = 1
+
+This does require that the filetype plugin directory comes before $VIMRUNTIME
+in 'runtimepath'!
+
+If you do want to use the default plugin, but overrule one of the settings,
+you can write the different setting in a script: >
+
+ setlocal textwidth=70
+
+Now write this in the "after" directory, so that it gets sourced after the
+distributed "vim.vim" ftplugin |after-directory|. For Unix this would be
+"~/.vim/after/ftplugin/vim.vim". Note that the default plugin will have set
+"b:did_ftplugin", but it is ignored here.
+
+
+OPTIONS
+
+To make sure the filetype plugin only affects the current buffer use the >
+
+ :setlocal
+
+command to set options. And only set options which are local to a buffer (see
+the help for the option to check that). When using |:setlocal| for global
+options or options local to a window, the value will change for many buffers,
+and that is not what a filetype plugin should do.
+
+When an option has a value that is a list of flags or items, consider using
+"+=" and "-=" to keep the existing value. Be aware that the user may have
+changed an option value already. First resetting to the default value and
+then changing it often a good idea. Example: >
+
+ :setlocal formatoptions& formatoptions+=ro
+
+
+MAPPINGS
+
+To make sure mappings will only work in the current buffer use the >
+
+ :map <buffer>
+
+command. This needs to be combined with the two-step mapping explained above.
+An example of how to define functionality in a filetype plugin: >
+
+ if !hasmapto('<Plug>JavaImport')
+ map <buffer> <unique> <LocalLeader>i <Plug>JavaImport
+ endif
+ noremap <buffer> <unique> <Plug>JavaImport oimport ""<Left><Esc>
+
+|hasmapto()| is used to check if the user has already defined a map to
+<Plug>JavaImport. If not, then the filetype plugin defines the default
+mapping. This starts with |<LocalLeader>|, which allows the user to select
+the key(s) he wants filetype plugin mappings to start with. The default is a
+backslash.
+"<unique>" is used to give an error message if the mapping already exists or
+overlaps with an existing mapping.
+|:noremap| is used to avoid that any other mappings that the user has defined
+interferes. You might want to use ":noremap <script>" to allow remapping
+mappings defined in this script that start with <SID>.
+
+The user must have a chance to disable the mappings in a filetype plugin,
+without disabling everything. Here is an example of how this is done for a
+plugin for the mail filetype: >
+
+ " Add mappings, unless the user didn't want this.
+ if !exists("no_plugin_maps") && !exists("no_mail_maps")
+ " Quote text by inserting "> "
+ if !hasmapto('<Plug>MailQuote')
+ vmap <buffer> <LocalLeader>q <Plug>MailQuote
+ nmap <buffer> <LocalLeader>q <Plug>MailQuote
+ endif
+ vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>
+ nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>
+ endif
+
+Two global variables are used:
+no_plugin_maps disables mappings for all filetype plugins
+no_mail_maps disables mappings for a specific filetype
+
+
+USER COMMANDS
+
+To add a user command for a specific file type, so that it can only be used in
+one buffer, use the "-buffer" argument to |:command|. Example: >
+
+ :command -buffer Make make %:r.s
+
+
+VARIABLES
+
+A filetype plugin will be sourced for each buffer of the type it's for. Local
+script variables |s:var| will be shared between all invocations. Use local
+buffer variables |b:var| if you want a variable specifically for one buffer.
+
+
+FUNCTIONS
+
+When defining a function, this only needs to be done once. But the filetype
+plugin will be sourced every time a file with this filetype will be opened.
+This construct make sure the function is only defined once: >
+
+ :if !exists("*s:Func")
+ : function s:Func(arg)
+ : ...
+ : endfunction
+ :endif
+<
+
+UNDO *undo_ftplugin*
+
+When the user does ":setfiletype xyz" the effect of the previous filetype
+should be undone. Set the b:undo_ftplugin variable to the commands that will
+undo the settings in your filetype plugin. Example: >
+
+ let b:undo_ftplugin = "setlocal fo< com< tw< commentstring<"
+ \ . "| unlet b:match_ignorecase b:match_words b:match_skip"
+
+Using ":setlocal" with "<" after the option name resets the option to its
+global value. That is mostly the best way to reset the option value.
+
+This does require removing the "C" flag from 'cpoptions' to allow line
+continuation, as mentioned above |use-cpo-save|.
+
+
+FILE NAME
+
+The filetype must be included in the file name |ftplugin-name|. Use one of
+these three forms:
+
+ .../ftplugin/stuff.vim
+ .../ftplugin/stuff_foo.vim
+ .../ftplugin/stuff/bar.vim
+
+"stuff" is the filetype, "foo" and "bar" are arbitrary names.
+
+
+SUMMARY *ftplugin-special*
+
+Summary of special things to use in a filetype plugin:
+
+<LocalLeader> Value of "maplocalleader", which the user defines as
+ the keys that filetype plugin mappings start with.
+
+:map <buffer> Define a mapping local to the buffer.
+
+:noremap <script> Only remap mappings defined in this script that start
+ with <SID>.
+
+:setlocal Set an option for the current buffer only.
+
+:command -buffer Define a user command local to the buffer.
+
+exists("*s:Func") Check if a function was already defined.
+
+Also see |plugin-special|, the special things used for all plugins.
+
+==============================================================================
+*41.12* Writing a compiler plugin *write-compiler-plugin*
+
+A compiler plugin sets options for use with a specific compiler. The user can
+load it with the |:compiler| command. The main use is to set the
+'errorformat' and 'makeprg' options.
+
+Easiest is to have a look at examples. This command will edit all the default
+compiler plugins: >
+
+ :next $VIMRUNTIME/compiler/*.vim
+
+Use |:next| to go to the next plugin file.
+
+There are two special items about these files. First is a mechanism to allow
+a user to overrule or add to the default file. The default files start with: >
+
+ :if exists("current_compiler")
+ : finish
+ :endif
+ :let current_compiler = "mine"
+
+When you write a compiler file and put it in your personal runtime directory
+(e.g., ~/.vim/compiler for Unix), you set the "current_compiler" variable to
+make the default file skip the settings.
+
+The second mechanism is to use ":set" for ":compiler!" and ":setlocal" for
+":compiler". Vim defines the ":CompilerSet" user command for this. However,
+older Vim versions don't, thus your plugin should define it then. This is an
+example: >
+
+ if exists(":CompilerSet") != 2
+ command -nargs=* CompilerSet setlocal <args>
+ endif
+ CompilerSet errorformat& " use the default 'errorformat'
+ CompilerSet makeprg=nmake
+
+When you write a compiler plugin for the Vim distribution or for a system-wide
+runtime directory, use the mechanism mentioned above. When
+"current_compiler" was already set by a user plugin nothing will be done.
+
+When you write a compiler plugin to overrule settings from a default plugin,
+don't check "current_compiler". This plugin is supposed to be loaded
+last, thus it should be in a directory at the end of 'runtimepath'. For Unix
+that could be ~/.vim/after/compiler.
+
+==============================================================================
+
+Next chapter: |usr_42.txt| Add new menus
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt
new file mode 100644
index 000000000..b560d6b64
--- /dev/null
+++ b/runtime/doc/usr_42.txt
@@ -0,0 +1,365 @@
+*usr_42.txt* For Vim version 7.0aa. Last change: 2002 Oct 08
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Add new menus
+
+
+By now you know that Vim is very flexible. This includes the menus used in
+the GUI. You can define your own menu entries to make certain commands easily
+accessible. This is for mouse-happy users only.
+
+|42.1| Introduction
+|42.2| Menu commands
+|42.3| Various
+|42.4| Toolbar and popup menus
+
+ Next chapter: |usr_43.txt| Using filetypes
+ Previous chapter: |usr_41.txt| Write a Vim script
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*42.1* Introduction
+
+The menus that Vim uses are defined in the file "$VIMRUNTIME/menu.vim". If
+you want to write your own menus, you might first want to look through that
+file.
+ To define a menu item, use the ":menu" command. The basic form of this
+command is as follows: >
+
+ :menu {menu-item} {keys}
+
+The {menu-item} describes where on the menu to put the item. A typical
+{menu-item} is "File.Save", which represents the item "Save" under the
+"File" menu. A dot is used to separate the names. Example: >
+
+ :menu File.Save :update<CR>
+
+The ":update" command writes the file when it was modified.
+ You can add another level: "Edit.Settings.Shiftwidth" defines a submenu
+"Settings" under the "Edit" menu, with an item "Shiftwidth". You could use
+even deeper levels. Don't use this too much, you need to move the mouse quite
+a bit to use such an item.
+ The ":menu" command is very similar to the ":map" command: the left side
+specifies how the item is triggered and the right hand side defines the
+characters that are executed. {keys} are characters, they are used just like
+you would have typed them. Thus in Insert mode, when {keys} is plain text,
+that text is inserted.
+
+
+ACCELERATORS
+
+The ampersand character (&) is used to indicate an accelerator. For instance,
+you can use Alt-F to select "File" and S to select "Save". (The 'winaltkeys'
+option may disable this though!). Therefore, the {menu-item} looks like
+"&File.&Save". The accelerator characters will be underlined in the menu.
+ You must take care that each key is used only once in each menu. Otherwise
+you will not know which of the two will actually be used. Vim doesn't warn
+you for this.
+
+
+PRIORITIES
+
+The actual definition of the File.Save menu item is as follows: >
+
+ :menu 10.340 &File.&Save<Tab>:w :confirm w<CR>
+
+The number 10.340 is called the priority number. It is used by the editor to
+decide where it places the menu item. The first number (10) indicates the
+position on the menu bar. Lower numbered menus are positioned to the left,
+higher numbers to the right.
+ These are the priorities used for the standard menus:
+
+ 10 20 40 50 60 70 9999
+
+ +------------------------------------------------------------+
+ | File Edit Tools Syntax Buffers Window Help |
+ +------------------------------------------------------------+
+
+Notice that the Help menu is given a very high number, to make it appear on
+the far right.
+ The second number (340) determines the location of the item within the
+pull-down menu. Lower numbers go on top, higher number on the bottom. These
+are the priorities in the File menu:
+
+ +-----------------+
+ 10.310 |Open... |
+ 10.320 |Split-Open... |
+ 10.325 |New |
+ 10.330 |Close |
+ 10.335 |---------------- |
+ 10.340 |Save |
+ 10.350 |Save As... |
+ 10.400 |---------------- |
+ 10.410 |Split Diff with |
+ 10.420 |Split Patched By |
+ 10.500 |---------------- |
+ 10.510 |Print |
+ 10.600 |---------------- |
+ 10.610 |Save-Exit |
+ 10.620 |Exit |
+ +-----------------+
+
+Notice that there is room in between the numbers. This is where you can
+insert your own items, if you really want to (it's often better to leave the
+standard menus alone and add a new menu for your own items).
+ When you create a submenu, you can add another ".number" to the priority.
+Thus each name in {menu-item} has its priority number.
+
+
+SPECIAL CHARACTERS
+
+The {menu-item} in this example is "&File.&Save<Tab>:w". This brings up an
+important point: {menu-item} must be one word. If you want to put a dot,
+space or tabs in the name, you either use the <> notation (<Space> and <Tab>,
+for instance) or use the backslash (\) escape. >
+
+ :menu 10.305 &File.&Do\ It\.\.\. :exit<CR>
+
+In this example, the name of the menu item "Do It..." contains a space and the
+command is ":exit<CR>".
+
+The <Tab> character in a menu name is used to separate the part that defines
+the menu name from the part that gives a hint to the user. The part after the
+<Tab> is displayed right aligned in the menu. In the File.Save menu the name
+used is "&File.&Save<Tab>:w". Thus the menu name is "File.Save" and the hint
+is ":w".
+
+
+SEPARATORS
+
+The separator lines, used to group related menu items together, can be defined
+by using a name that starts and ends in a '-'. For example "-sep-". When
+using several separators the names must be different. Otherwise the names
+don't matter.
+ The command from a separator will never be executed, but you have to define
+one anyway. A single colon will do. Example: >
+
+ :amenu 20.510 Edit.-sep3- :
+
+==============================================================================
+*42.2* Menu commands
+
+You can define menu items that exist for only certain modes. This works just
+like the variations on the ":map" command:
+
+ :menu Normal, Visual and Operator-pending mode
+ :nmenu Normal mode
+ :vmenu Visual mode
+ :omenu Operator-pending mode
+ :menu! Insert and Command-line mode
+ :imenu Insert mode
+ :cmenu Command-line mode
+ :amenu All modes
+
+To avoid that the commands of a menu item are being mapped, use the command
+":noremenu", ":nnoremenu", ":anoremenu", etc.
+
+
+USING :AMENU
+
+The ":amenu" command is a bit different. It assumes that the {keys} you
+give are to be executed in Normal mode. When Vim is in Visual or Insert mode
+when the menu is used, Vim first has to go back to Normal mode. ":amenu"
+inserts a CTRL-C or CTRL-O for you. For example, if you use this command:
+>
+ :amenu 90.100 Mine.Find\ Word *
+
+Then the resulting menu commands will be:
+
+ Normal mode: *
+ Visual mode: CTRL-C *
+ Operator-pending mode: CTRL-C *
+ Insert mode: CTRL-O *
+ Command-line mode: CTRL-C *
+
+When in Command-line mode the CTRL-C will abandon the command typed so far.
+In Visual and Operator-pending mode CTRL-C will stop the mode. The CTRL-O in
+Insert mode will execute the command and then return to Insert mode.
+ CTRL-O only works for one command. If you need to use two or more
+commands, put them in a function and call that function. Example: >
+
+ :amenu Mine.Next\ File :call <SID>NextFile()<CR>
+ :function <SID>NextFile()
+ : next
+ : 1/^Code
+ :endfunction
+
+This menu entry goes to the next file in the argument list with ":next". Then
+it searches for the line that starts with "Code".
+ The <SID> before the function name is the script ID. This makes the
+function local to the current Vim script file. This avoids problems when a
+function with the same name is defined in another script file. See |<SID>|.
+
+
+SILENT MENUS
+
+The menu executes the {keys} as if you typed them. For a ":" command this
+means you will see the command being echoed on the command line. If it's a
+long command, the hit-Enter prompt will appear. That can be very annoying!
+ To avoid this, make the menu silent. This is done with the <silent>
+argument. For example, take the call to NextFile() in the previous example.
+When you use this menu, you will see this on the command line:
+
+ :call <SNR>34_NextFile() ~
+
+To avoid this text on the command line, insert "<silent>" as the first
+argument: >
+
+ :amenu <silent> Mine.Next\ File :call <SID>NextFile()<CR>
+
+Don't use "<silent>" too often. It is not needed for short commands. If you
+make a menu for someone else, being able the see the executed command will
+give him a hint about what he could have typed, instead of using the mouse.
+
+
+LISTING MENUS
+
+When a menu command is used without a {keys} part, it lists the already
+defined menus. You can specify a {menu-item}, or part of it, to list specific
+menus. Example: >
+
+ :amenu
+
+This lists all menus. That's a long list! Better specify the name of a menu
+to get a shorter list: >
+
+ :amenu Edit
+
+This lists only the "Edit" menu items for all modes. To list only one
+specific menu item for Insert mode: >
+
+ :imenu Edit.Undo
+
+Take care that you type exactly the right name. Case matters here. But the
+'&' for accelerators can be omitted. The <Tab> and what comes after it can be
+left out as well.
+
+
+DELETING MENUS
+
+To delete a menu, the same command is used as for listing, but with "menu"
+changed to "unmenu". Thus ":menu" becomes, ":unmenu", ":nmenu" becomes
+":nunmenu", etc. To delete the "Tools.Make" item for Insert mode: >
+
+ :iunmenu Tools.Make
+
+You can delete a whole menu, with all its items, by using the menu name.
+Example: >
+
+ :aunmenu Syntax
+
+This deletes the Syntax menu and all the items in it.
+
+==============================================================================
+*42.3* Various
+
+You can change the appearance of the menus with flags in 'guioptions'. In the
+default value they are all included. You can remove a flag with a command
+like: >
+
+ :set guioptions-=m
+<
+ m When removed the menubar is not displayed.
+
+ M When removed the default menus are not loaded.
+
+ g When removed the inactive menu items are not made grey
+ but are completely removed. (Does not work on all
+ systems.)
+
+ t When removed the tearoff feature is not enabled.
+
+The dotted line at the top of a menu is not a separator line. When you select
+this item, the menu is "teared-off": It is displayed in a separate window.
+This is called a tearoff menu. This is useful when you use the same menu
+often.
+
+For translating menu items, see |:menutrans|.
+
+Since the mouse has to be used to select a menu item, it is a good idea to use
+the ":browse" command for selecting a file. And ":confirm" to get a dialog
+instead of an error message, e.g., when the current buffer contains changes.
+These two can be combined: >
+
+ :amenu File.Open :browse confirm edit<CR>
+
+The ":browse" makes a file browser appear to select the file to edit. The
+":confirm" will pop up a dialog when the current buffer has changes. You can
+then select to save the changes, throw them away or cancel the command.
+ For more complicated items, the confirm() and inputdialog() functions can
+be used. The default menus contain a few examples.
+
+==============================================================================
+*42.4* Toolbar and popup menus
+
+There are two special menus: ToolBar and PopUp. Items that start with these
+names do not appear in the normal menu bar.
+
+
+TOOLBAR
+
+The toolbar appears only when the "T" flag is included in the 'guioptions'
+option.
+ The toolbar uses icons rather than text to represent the command. For
+example, the {menu-item} named "ToolBar.New" causes the "New" icon to appear
+on the toolbar.
+ The Vim editor has 28 built-in icons. You can find a table here:
+|builtin-tools|. Most of them are used in the default toolbar. You can
+redefine what these items do (after the default menus are setup).
+ You can add another bitmap for a toolbar item. Or define a new toolbar
+item with a bitmap. For example, define a new toolbar item with: >
+
+ :tmenu ToolBar.Compile Compile the current file
+ :amenu ToolBar.Compile :!cc % -o %:r<CR>
+
+Now you need to create the icon. For MS-Windows it must be in bitmap format,
+with the name "Compile.bmp". For Unix XPM format is used, the file name is
+"Compile.xpm". The size must be 18 by 18 pixels. On MS-Windows other sizes
+can be used as well, but it will look ugly.
+ Put the bitmap in the directory "bitmaps" in one of the directories from
+'runtimepath'. E.g., for Unix "~/.vim/bitmaps/Compile.xpm".
+
+You can define tooltips for the items in the toolbar. A tooltip is a short
+text that explains what a toolbar item will do. For example "Open file". It
+appears when the mouse pointer is on the item, without moving for a moment.
+This is very useful if the meaning of the picture isn't that obvious.
+Example: >
+
+ :tmenu ToolBar.Make Run make in the current directory
+<
+ Note:
+ Pay attention to the case used. "Toolbar" and "toolbar" are different
+ from "ToolBar"!
+
+To remove a tooltip, use the |:tunmenu| command.
+
+The 'toolbar' option can be used to display text instead of a bitmap, or both
+text and a bitmap. Most people use just the bitmap, since the text takes
+quite a bit of space.
+
+
+POPUP MENU
+
+The popup menu pops up where the mouse pointer is. On MS-Windows you activate
+it by clicking the right mouse button. Then you can select an item with the
+left mouse button. On Unix the popup menu is used by pressing and holding the
+right mouse button.
+ The popup menu only appears when the 'mousemodel' has been set to "popup"
+or "popup_setpos". The difference between the two is that "popup_setpos"
+moves the cursor to the mouse pointer position. When clicking inside a
+selection, the selection will be used unmodified. When there is a selection
+but you click outside of it, the selection is removed.
+ There is a separate popup menu for each mode. Thus there are never grey
+items like in the normal menus.
+
+What is the meaning of life, the universe and everything? *42*
+Douglas Adams, the only person who knew what this question really was about is
+now dead, unfortunately. So now you might wonder what the meaning of death
+is...
+
+==============================================================================
+
+Next chapter: |usr_43.txt| Using filetypes
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_43.txt b/runtime/doc/usr_43.txt
new file mode 100644
index 000000000..e04b8b27b
--- /dev/null
+++ b/runtime/doc/usr_43.txt
@@ -0,0 +1,172 @@
+*usr_43.txt* For Vim version 7.0aa. Last change: 2002 Jul 14
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Using filetypes
+
+
+When you are editing a file of a certain type, for example a C program or a
+shell script, you often use the same option settings and mappings. You
+quickly get tired of manually setting these each time. This chapter explains
+how to do it automatically.
+
+|43.1| Plugins for a filetype
+|43.2| Adding a filetype
+
+ Next chapter: |usr_44.txt| Your own syntax highlighted
+ Previous chapter: |usr_42.txt| Add new menus
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*43.1* Plugins for a filetype *filetype-plugin*
+
+How to start using filetype plugins has already been discussed here:
+|add-filetype-plugin|. But you probably are not satisfied with the default
+settings, because they have been kept minimal. Suppose that for C files you
+want to set the 'softtabstop' option to 4 and define a mapping to insert a
+three-line comment. You do this with only two steps:
+
+ *your-runtime-dir*
+1. Create your own runtime directory. On Unix this usually is "~/.vim". In
+ this directory create the "ftplugin" directory: >
+
+ mkdir ~/.vim
+ mkdir ~/.vim/ftplugin
+<
+ When you are not on Unix, check the value of the 'runtimepath' option to
+ see where Vim will look for the "ftplugin" directory: >
+
+ set runtimepath
+
+< You would normally use the first directory name (before the first comma).
+ You might want to prepend a directory name to the 'runtimepath' option in
+ your |vimrc| file if you don't like the default value.
+
+2. Create the file "~/.vim/ftplugin/c.vim", with the contents: >
+
+ setlocal softtabstop=4
+ noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc>
+
+Try editing a C file. You should notice that the 'softtabstop' option is set
+to 4. But when you edit another file it's reset to the default zero. That is
+because the ":setlocal" command was used. This sets the 'softtabstop' option
+only locally to the buffer. As soon as you edit another buffer, it will be
+set to the value set for that buffer. For a new buffer it will get the
+default value or the value from the last ":set" command.
+
+Likewise, the mapping for "\c" will disappear when editing another buffer.
+The ":map <buffer>" command creates a mapping that is local to the current
+buffer. This works with any mapping command: ":map!", ":vmap", etc. The
+|<LocalLeader>| in the mapping is replaced with the value of "maplocalleader".
+
+You can find examples for filetype plugins in this directory: >
+
+ $VIMRUNTIME/ftplugin/
+
+More details about writing a filetype plugin can be found here:
+|write-plugin|.
+
+==============================================================================
+*43.2* Adding a filetype
+
+If you are using a type of file that is not recognized by Vim, this is how to
+get it recognized. You need a runtime directory of your own. See
+|your-runtime-dir| above.
+
+Create a file "filetype.vim" which contains an autocommand for your filetype.
+(Autocommands were explained in section |40.3|.) Example: >
+
+ augroup filetypedetect
+ au BufNewFile,BufRead *.xyz setf xyz
+ augroup END
+
+This will recognize all files that end in ".xyz" as the "xyz" filetype. The
+":augroup" commands put this autocommand in the "filetypedetect" group. This
+allows removing all autocommands for filetype detection when doing ":filetype
+off". The "setf" command will set the 'filetype' option to its argument,
+unless it was set already. This will make sure that 'filetype' isn't set
+twice.
+
+You can use many different patterns to match the name of your file. Directory
+names can also be included. See |autocmd-patterns|. For example, the files
+under "/usr/share/scripts/" are all "ruby" files, but don't have the expected
+file name extension. Adding this to the example above: >
+
+ augroup filetypedetect
+ au BufNewFile,BufRead *.xyz setf xyz
+ au BufNewFile,BufRead /usr/share/scripts/* setf ruby
+ augroup END
+
+However, if you now edit a file /usr/share/scripts/README.txt, this is not a
+ruby file. The danger of a pattern ending in "*" is that it quickly matches
+too many files. To avoid trouble with this, put the filetype.vim file in
+another directory, one that is at the end of 'runtimepath'. For Unix for
+example, you could use "~/.vim/after/filetype.vim".
+ You now put the detection of text files in ~/.vim/filetype.vim: >
+
+ augroup filetypedetect
+ au BufNewFile,BufRead *.txt setf text
+ augroup END
+
+That file is found in 'runtimepath' first. Then use this in
+~/.vim/after/filetype.vim, which is found last: >
+
+ augroup filetypedetect
+ au BufNewFile,BufRead /usr/share/scripts/* setf ruby
+ augroup END
+
+What will happen now is that Vim searches for "filetype.vim" files in each
+directory in 'runtimepath'. First ~/.vim/filetype.vim is found. The
+autocommand to catch *.txt files is defined there. Then Vim finds the
+filetype.vim file in $VIMRUNTIME, which is halfway 'runtimepath'. Finally
+~/.vim/after/filetype.vim is found and the autocommand for detecting ruby
+files in /usr/share/scripts is added.
+ When you now edit /usr/share/scripts/README.txt, the autocommands are
+checked in the order in which they were defined. The *.txt pattern matches,
+thus "setf text" is executed to set the filetype to "text". The pattern for
+ruby matches too, and the "setf ruby" is executed. But since 'filetype' was
+already set to "text", nothing happens here.
+ When you edit the file /usr/share/scripts/foobar the same autocommands are
+checked. Only the one for ruby matches and "setf ruby" sets 'filetype' to
+ruby.
+
+
+RECOGNIZING BY CONTENTS
+
+If your file cannot be recognized by its file name, you might be able to
+recognize it by its contents. For example, many script files start with a
+line like:
+
+ #!/bin/xyz ~
+
+To recognize this script create a file "scripts.vim" in your runtime directory
+(same place where filetype.vim goes). It might look like this: >
+
+ if did_filetype()
+ finish
+ endif
+ if getline(1) =~ '^#!.*[/\\]xyz\>'
+ setf xyz
+ endif
+
+The first check with did_filetype() is to avoid that you will check the
+contents of files for which the filetype was already detected by the file
+name. That avoids wasting time on checking the file when the "setf" command
+won't do anything.
+ The scripts.vim file is sourced by an autocommand in the default
+filetype.vim file. Therefore, the order of checks is:
+
+ 1. filetype.vim files before $VIMRUNTIME in 'runtimepath'
+ 2. first part of $VIMRUNTIME/filetype.vim
+ 3. all scripts.vim files in 'runtimepath'
+ 4. remainder of $VIMRUNTIME/filetype.vim
+ 5. filetype.vim files after $VIMRUNTIME in 'runtimepath'
+
+If this is not sufficient for you, add an autocommand that matches all files
+and sources a script or executes a function to check the contents of the file.
+
+==============================================================================
+
+Next chapter: |usr_44.txt| Your own syntax highlighted
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_44.txt b/runtime/doc/usr_44.txt
new file mode 100644
index 000000000..021c41e23
--- /dev/null
+++ b/runtime/doc/usr_44.txt
@@ -0,0 +1,719 @@
+*usr_44.txt* For Vim version 7.0aa. Last change: 2002 Oct 10
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Your own syntax highlighted
+
+
+Vim comes with highlighting for a couple of hundred different file types. If
+the file you are editing isn't included, read this chapter to find out how to
+get this type of file highlighted. Also see |:syn-define| in the reference
+manual.
+
+|44.1| Basic syntax commands
+|44.2| Keywords
+|44.3| Matches
+|44.4| Regions
+|44.5| Nested items
+|44.6| Following groups
+|44.7| Other arguments
+|44.8| Clusters
+|44.9| Including another syntax file
+|44.10| Synchronizing
+|44.11| Installing a syntax file
+|44.12| Portable syntax file layout
+
+ Next chapter: |usr_45.txt| Select your language
+ Previous chapter: |usr_43.txt| Using filetypes
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*44.1* Basic syntax commands
+
+Using an existing syntax file to start with will save you a lot of time. Try
+finding a syntax file in $VIMRUNTIME/syntax for a language that is similar.
+These files will also show you the normal layout of a syntax file. To
+understand it, you need to read the following.
+
+Let's start with the basic arguments. Before we start defining any new
+syntax, we need to clear out any old definitions: >
+
+ :syntax clear
+
+This isn't required in the final syntax file, but very useful when
+experimenting.
+
+There are more simplifications in this chapter. If you are writing a syntax
+file to be used by others, read all the way through the end to find out the
+details.
+
+
+LISTING DEFINED ITEMS
+
+To check which syntax items are currently defined, use this command: >
+
+ :syntax
+
+You can use this to check which items have actually been defined. Quite
+useful when you are experimenting with a new syntax file. It also shows the
+colors used for each item, which helps to find out what is what.
+ To list the items in a specific syntax group use: >
+
+ :syntax list {group-name}
+
+This also can be used to list clusters (explained in |44.8|). Just include
+the @ in the name.
+
+
+MATCHING CASE
+
+Some languages are not case sensitive, such as Pascal. Others, such as C, are
+case sensitive. You need to tell which type you have with the following
+commands: >
+ :syntax case match
+ :syntax case ignore
+
+The "match" argument means that Vim will match the case of syntax elements.
+Therefore, "int" differs from "Int" and "INT". If the "ignore" argument is
+used, the following are equivalent: "Procedure", "PROCEDURE" and "procedure".
+ The ":syntax case" commands can appear anywhere in a syntax file and affect
+the syntax definitions that follow. In most cases, you have only one ":syntax
+case" command in your syntax file; if you work with an unusual language that
+contains both case-sensitive and non-case-sensitive elements, however, you can
+scatter the ":syntax case" command throughout the file.
+
+==============================================================================
+*44.2* Keywords
+
+The most basic syntax elements are keywords. To define a keyword, use the
+following form: >
+
+ :syntax keyword {group} {keyword} ...
+
+The {group} is the name of a syntax group. With the ":highlight" command you
+can assign colors to a {group}. The {keyword} argument is an actual keyword.
+Here are a few examples: >
+
+ :syntax keyword xType int long char
+ :syntax keyword xStatement if then else endif
+
+This example uses the group names "xType" and "xStatement". By convention,
+each group name is prefixed by the filetype for the language being defined.
+This example defines syntax for the x language (eXample language without an
+interesting name). In a syntax file for "csh" scripts the name "cshType"
+would be used. Thus the prefix is equal to the value of 'filetype'.
+ These commands cause the words "int", "long" and "char" to be highlighted
+one way and the words "if", "then", "else" and "endif" to be highlighted
+another way. Now you need to connect the x group names to standard Vim
+names. You do this with the following commands: >
+
+ :highlight link xType Type
+ :highlight link xStatement Statement
+
+This tells Vim to highlight "xType" like "Type" and "xStatement" like
+"Statement". See |group-name| for the standard names.
+
+
+UNUSUAL KEYWORDS
+
+The characters used in a keyword must be in the 'iskeyword' option. If you
+use another character, the word will never match. Vim doesn't give a warning
+message for this.
+ The x language uses the '-' character in keywords. This is how it's done:
+>
+ :setlocal iskeyword+=-
+ :syntax keyword xStatement when-not
+
+The ":setlocal" command is used to change 'iskeyword' only for the current
+buffer. Still it does change the behavior of commands like "w" and "*". If
+that is not wanted, don't define a keyword but use a match (explained in the
+next section).
+
+The x language allows for abbreviations. For example, "next" can be
+abbreviated to "n", "ne" or "nex". You can define them by using this command:
+>
+ :syntax keyword xStatement n[ext]
+
+This doesn't match "nextone", keywords always match whole words only.
+
+==============================================================================
+*44.3* Matches
+
+Consider defining something a bit more complex. You want to match ordinary
+identifiers. To do this, you define a match syntax item. This one matches
+any word consisting of only lowercase letters: >
+
+ :syntax match xIdentifier /\<\l\+\>/
+<
+ Note:
+ Keywords overrule any other syntax item. Thus the keywords "if",
+ "then", etc., will be keywords, as defined with the ":syntax keyword"
+ commands above, even though they also match the pattern for
+ xIdentifier.
+
+The part at the end is a pattern, like it's used for searching. The // is
+used to surround the pattern (like how it's done in a ":substitute" command).
+You can use any other character, like a plus or a quote.
+
+Now define a match for a comment. In the x language it is anything from # to
+the end of a line: >
+
+ :syntax match xComment /#.*/
+
+Since you can use any search pattern, you can highlight very complex things
+with a match item. See |pattern| for help on search patterns.
+
+==============================================================================
+*44.4* Regions
+
+In the example x language, strings are enclosed in double quotation marks (").
+To highlight strings you define a region. You need a region start (double
+quote) and a region end (double quote). The definition is as follows: >
+
+ :syntax region xString start=/"/ end=/"/
+
+The "start" and "end" directives define the patterns used to find the start
+and end of the region. But what about strings that look like this?
+
+ "A string with a double quote (\") in it" ~
+
+This creates a problem: The double quotation marks in the middle of the string
+will end the region. You need to tell Vim to skip over any escaped double
+quotes in the string. Do this with the skip keyword: >
+
+ :syntax region xString start=/"/ skip=/\\"/ end=/"/
+
+The double backslash matches a single backslash, since the backslash is a
+special character in search patterns.
+
+When to use a region instead of a match? The main difference is that a match
+item is a single pattern, which must match as a whole. A region starts as
+soon as the "start" pattern matches. Whether the "end" pattern is found or
+not doesn't matter. Thus when the item depends on the "end" pattern to match,
+you cannot use a region. Otherwise, regions are often simpler to define. And
+it is easier to use nested items, as is explained in the next section.
+
+==============================================================================
+*44.5* Nested items
+
+Take a look at this comment:
+
+ %Get input TODO: Skip white space ~
+
+You want to highlight TODO in big yellow letters, even though it is in a
+comment that is highlighted blue. To let Vim know about this, you define the
+following syntax groups: >
+
+ :syntax keyword xTodo TODO contained
+ :syntax match xComment /%.*/ contains=xTodo
+
+In the first line, the "contained" argument tells Vim that this keyword can
+exist only inside another syntax item. The next line has "contains=xTodo".
+This indicates that the xTodo syntax element is inside it. The result is that
+the comment line as a whole is matched with "xComment" and made blue. The
+word TODO inside it is matched by xTodo and highlighted yellow (highlighting
+for xTodo was setup for this).
+
+
+RECURSIVE NESTING
+
+The x language defines code blocks in curly braces. And a code block may
+contain other code blocks. This can be defined this way: >
+
+ :syntax region xBlock start=/{/ end=/}/ contains=xBlock
+
+Suppose you have this text:
+
+ while i < b { ~
+ if a { ~
+ b = c; ~
+ } ~
+ } ~
+
+First a xBlock starts at the { in the first line. In the second line another
+{ is found. Since we are inside a xBlock item, and it contains itself, a
+nested xBlock item will start here. Thus the "b = c" line is inside the
+second level xBlock region. Then a } is found in the next line, which matches
+with the end pattern of the region. This ends the nested xBlock. Because the
+} is included in the nested region, it is hidden from the first xBlock region.
+Then at the last } the first xBlock region ends.
+
+
+KEEPING THE END
+
+Consider the following two syntax items: >
+
+ :syntax region xComment start=/%/ end=/$/ contained
+ :syntax region xPreProc start=/#/ end=/$/ contains=xComment
+
+You define a comment as anything from % to the end of the line. A
+preprocessor directive is anything from # to the end of the line. Because you
+can have a comment on a preprocessor line, the preprocessor definition
+includes a "contains=xComment" argument. Now look what happens with this
+text:
+
+ #define X = Y % Comment text ~
+ int foo = 1; ~
+
+What you see is that the second line is also highlighted as xPreProc. The
+preprocessor directive should end at the end of the line. That is why
+you have used "end=/$/". So what is going wrong?
+ The problem is the contained comment. The comment starts with % and ends
+at the end of the line. After the comment ends, the preprocessor syntax
+continues. This is after the end of the line has been seen, so the next
+line is included as well.
+ To avoid this problem and to avoid a contained syntax item eating a needed
+end of line, use the "keepend" argument. This takes care of
+the double end-of-line matching: >
+
+ :syntax region xComment start=/%/ end=/$/ contained
+ :syntax region xPreProc start=/#/ end=/$/ contains=xComment keepend
+
+
+CONTAINING MANY ITEMS
+
+You can use the contains argument to specify that everything can be contained.
+For example: >
+
+ :syntax region xList start=/\[/ end=/\]/ contains=ALL
+
+All syntax items will be contained in this one. It also contains itself, but
+not at the same position (that would cause an endless loop).
+ You can specify that some groups are not contained. Thus contain all
+groups but the ones that are listed:
+>
+ :syntax region xList start=/\[/ end=/\]/ contains=ALLBUT,xString
+
+With the "TOP" item you can include all items that don't have a "contained"
+argument. "CONTAINED" is used to only include items with a "contained"
+argument. See |:syn-contains| for the details.
+
+==============================================================================
+*44.6* Following groups
+
+The x language has statements in this form:
+
+ if (condition) then ~
+
+You want to highlight the three items differently. But "(condition)" and
+"then" might also appear in other places, where they get different
+highlighting. This is how you can do this: >
+
+ :syntax match xIf /if/ nextgroup=xIfCondition skipwhite
+ :syntax match xIfCondition /([^)]*)/ contained nextgroup=xThen skipwhite
+ :syntax match xThen /then/ contained
+
+The "nextgroup" argument specifies which item can come next. This is not
+required. If none of the items that are specified are found, nothing happens.
+For example, in this text:
+
+ if not (condition) then ~
+
+The "if" is matched by xIf. "not" doesn't match the specified nextgroup
+xIfCondition, thus only the "if" is highlighted.
+
+The "skipwhite" argument tells Vim that white space (spaces and tabs) may
+appear in between the items. Similar arguments are "skipnl", which allows a
+line break in between the items, and "skipempty", which allows empty lines.
+Notice that "skipnl" doesn't skip an empty line, something must match after
+the line break.
+
+==============================================================================
+*44.7* Other arguments
+
+MATCHGROUP
+
+When you define a region, the entire region is highlighted according to the
+group name specified. To highlight the text enclosed in parentheses () with
+the group xInside, for example, use the following command: >
+
+ :syntax region xInside start=/(/ end=/)/
+
+Suppose, that you want to highlight the parentheses differently. You can do
+this with a lot of convoluted region statements, or you can use the
+"matchgroup" argument. This tells Vim to highlight the start and end of a
+region with a different highlight group (in this case, the xParen group): >
+
+ :syntax region xInside matchgroup=xParen start=/(/ end=/)/
+
+The "matchgroup" argument applies to the start or end match that comes after
+it. In the previous example both start and end are highlighted with xParen.
+To highlight the end with xParenEnd: >
+
+ :syntax region xInside matchgroup=xParen start=/(/
+ \ matchgroup=xParenEnd end=/)/
+
+A side effect of using "matchgroup" is that contained items will not match in
+the start or end of the region. The example for "transparent" uses this.
+
+
+TRANSPARENT
+
+In a C language file you would like to highlight the () text after a "while"
+differently from the () text after a "for". In both of these there can be
+nested () items, which should be highlighted in the same way. You must make
+sure the () highlighting stops at the matching ). This is one way to do this:
+>
+ :syntax region cWhile matchgroup=cWhile start=/while\s*(/ end=/)/
+ \ contains=cCondNest
+ :syntax region cFor matchgroup=cFor start=/for\s*(/ end=/)/
+ \ contains=cCondNest
+ :syntax region cCondNest start=/(/ end=/)/ contained transparent
+
+Now you can give cWhile and cFor different highlighting. The cCondNest item
+can appear in either of them, but take over the highlighting of the item it is
+contained in. The "transparent" argument causes this.
+ Notice that the "matchgroup" argument has the same group as the item
+itself. Why define it then? Well, the side effect of using a matchgroup is
+that contained items are not found in the match with the start item then.
+This avoids that the cCondNest group matches the ( just after the "while" or
+"for". If this would happen, it would span the whole text until the matching
+) and the region would continue after it. Now cCondNest only matches after
+the match with the start pattern, thus after the first (.
+
+
+OFFSETS
+
+Suppose you want to define a region for the text between ( and ) after an
+"if". But you don't want to include the "if" or the ( and ). You can do this
+by specifying offsets for the patterns. Example: >
+
+ :syntax region xCond start=/if\s*(/ms=e+1 end=/)/me=s-1
+
+The offset for the start pattern is "ms=e+1". "ms" stands for Match Start.
+This defines an offset for the start of the match. Normally the match starts
+where the pattern matches. "e+1" means that the match now starts at the end
+of the pattern match, and then one character further.
+ The offset for the end pattern is "me=s-1". "me" stands for Match End.
+"s-1" means the start of the pattern match and then one character back. The
+result is that in this text:
+
+ if (foo == bar) ~
+
+Only the text "foo == bar" will be highlighted as xCond.
+
+More about offsets here: |:syn-pattern-offset|.
+
+
+ONELINE
+
+The "oneline" argument indicates that the region does not cross a line
+boundary. For example: >
+
+ :syntax region xIfThen start=/if/ end=/then/ oneline
+
+This defines a region that starts at "if" and ends at "then". But if there is
+no "then" after the "if", the region doesn't match.
+
+ Note:
+ When using "oneline" the region doesn't start if the end pattern
+ doesn't match in the same line. Without "oneline" Vim does _not_
+ check if there is a match for the end pattern. The region starts even
+ when the end pattern doesn't match in the rest of the file.
+
+
+CONTINUATION LINES AND AVOIDING THEM
+
+Things now become a little more complex. Let's define a preprocessor line.
+This starts with a # in the first column and continues until the end of the
+line. A line that ends with \ makes the next line a continuation line. The
+way you handle this is to allow the syntax item to contain a continuation
+pattern: >
+
+ :syntax region xPreProc start=/^#/ end=/$/ contains=xLineContinue
+ :syntax match xLineContinue "\\$" contained
+
+In this case, although xPreProc normally matches a single line, the group
+contained in it (namely xLineContinue) lets it go on for more than one line.
+For example, it would match both of these lines:
+
+ #define SPAM spam spam spam \ ~
+ bacon and spam ~
+
+In this case, this is what you want. If it is not what you want, you can call
+for the region to be on a single line by adding "excludenl" to the contained
+pattern. For example, you want to highlight "end" in xPreProc, but only at
+the end of the line. To avoid making the xPreProc continue on the next line,
+like xLineContinue does, use "excludenl" like this: >
+
+ :syntax region xPreProc start=/^#/ end=/$/
+ \ contains=xLineContinue,xPreProcEnd
+ :syntax match xPreProcEnd excludenl /end$/ contained
+ :syntax match xLineContinue "\\$" contained
+
+"excludenl" must be placed before the pattern. Since "xLineContinue" doesn't
+have "excludenl", a match with it will extend xPreProc to the next line as
+before.
+
+==============================================================================
+*44.8* Clusters
+
+One of the things you will notice as you start to write a syntax file is that
+you wind up generating a lot of syntax groups. Vim enables you to define a
+collection of syntax groups called a cluster.
+ Suppose you have a language that contains for loops, if statements, while
+loops, and functions. Each of them contains the same syntax elements: numbers
+and identifiers. You define them like this: >
+
+ :syntax match xFor /^for.*/ contains=xNumber,xIdent
+ :syntax match xIf /^if.*/ contains=xNumber,xIdent
+ :syntax match xWhile /^while.*/ contains=xNumber,xIdent
+
+You have to repeat the same "contains=" every time. If you want to add
+another contained item, you have to add it three times. Syntax clusters
+simplify these definitions by enabling you to have one cluster stand for
+several syntax groups.
+ To define a cluster for the two items that the three groups contain, use
+the following command: >
+
+ :syntax cluster xState contains=xNumber,xIdent
+
+Clusters are used inside other syntax items just like any syntax group.
+Their names start with @. Thus, you can define the three groups like this: >
+
+ :syntax match xFor /^for.*/ contains=@xState
+ :syntax match xIf /^if.*/ contains=@xState
+ :syntax match xWhile /^while.*/ contains=@xState
+
+You can add new group names to this cluster with the "add" argument: >
+
+ :syntax cluster xState add=xString
+
+You can remove syntax groups from this list as well: >
+
+ :syntax cluster xState remove=xNumber
+
+==============================================================================
+*44.9* Including another syntax file
+
+The C++ language syntax is a superset of the C language. Because you do not
+want to write two syntax files, you can have the C++ syntax file read in the
+one for C by using the following command: >
+
+ :runtime! syntax/c.vim
+
+The ":runtime!" command searches 'runtimepath' for all "syntax/c.vim" files.
+This makes the C syntax be defined like for C files. If you have replaced the
+c.vim syntax file, or added items with an extra file, these will be loaded as
+well.
+ After loading the C syntax items the specific C++ items can be defined.
+For example, add keywords that are not used in C: >
+
+ :syntax keyword cppStatement new delete this friend using
+
+This works just like in any other syntax file.
+
+Now consider the Perl language. It consists of two distinct parts: a
+documentation section in POD format, and a program written in Perl itself.
+The POD section starts with "=head" and ends with "=cut".
+ You want to define the POD syntax in one file, and use it from the Perl
+syntax file. The ":syntax include" command reads in a syntax file and stores
+the elements it defined in a syntax cluster. For Perl, the statements are as
+follows: >
+
+ :syntax include @Pod <sfile>:p:h/pod.vim
+ :syntax region perlPOD start=/^=head/ end=/^=cut/ contains=@Pod
+
+When "=head" is found in a Perl file, the perlPOD region starts. In this
+region the @Pod cluster is contained. All the items defined as top-level
+items in the pod.vim syntax files will match here. When "=cut" is found, the
+region ends and we go back to the items defined in the Perl file.
+ The ":syntax include" command is clever enough to ignore a ":syntax clear"
+command in the included file. And an argument such as "contains=ALL" will
+only contain items defined in the included file, not in the file that includes
+it.
+ The "<sfile>:p:h/" part uses the name of the current file (<sfile>),
+expands it to a full path (:p) and then takes the head (:h). This results in
+the directory name of the file. This causes the pod.vim file in the same
+directory to be included.
+
+==============================================================================
+*44.10* Synchronizing
+
+Compilers have it easy. They start at the beginning of a file and parse it
+straight through. Vim does not have it so easy. It must start in the middle,
+where the editing is being done. So how does it tell where it is?
+ The secret is the ":syntax sync" command. This tells Vim how to figure out
+where it is. For example, the following command tells Vim to scan backward
+for the beginning or end of a C-style comment and begin syntax coloring from
+there: >
+
+ :syntax sync ccomment
+
+You can tune this processing with some arguments. The "minlines" argument
+tells Vim the minimum number of lines to look backward, and "maxlines" tells
+the editor the maximum number of lines to scan.
+ For example, the following command tells Vim to look at least 10 lines
+before the top of the screen: >
+
+ :syntax sync ccomment minlines=10 maxlines=500
+
+If it cannot figure out where it is in that space, it starts looking farther
+and farther back until it figures out what to do. But it looks no farther
+back than 500 lines. (A large "maxlines" slows down processing. A small one
+might cause synchronization to fail.)
+ To make synchronizing go a bit faster, tell Vim which syntax items can be
+skipped. Every match and region that only needs to be used when actually
+displaying text can be given the "display" argument.
+ By default, the comment to be found will be colored as part of the Comment
+syntax group. If you want to color things another way, you can specify a
+different syntax group: >
+
+ :syntax sync ccomment xAltComment
+
+If your programming language does not have C-style comments in it, you can try
+another method of synchronization. The simplest way is to tell Vim to space
+back a number of lines and try to figure out things from there. The following
+command tells Vim to go back 150 lines and start parsing from there: >
+
+ :syntax sync minlines=150
+
+A large "minlines" value can make Vim slower, especially when scrolling
+backwards in the file.
+ Finally, you can specify a syntax group to look for by using this command:
+>
+ :syntax sync match {sync-group-name}
+ \ grouphere {group-name} {pattern}
+
+This tells Vim that when it sees {pattern} the syntax group named {group-name}
+begins just after the pattern given. The {sync-group-name} is used to give a
+name to this synchronization specification. For example, the sh scripting
+language begins an if statement with "if" and ends it with "fi":
+
+ if [ --f file.txt ] ; then ~
+ echo "File exists" ~
+ fi ~
+
+To define a "grouphere" directive for this syntax, you use the following
+command: >
+
+ :syntax sync match shIfSync grouphere shIf "\<if\>"
+
+The "groupthere" argument tells Vim that the pattern ends a group. For
+example, the end of the if/fi group is as follows: >
+
+ :syntax sync match shIfSync groupthere NONE "\<fi\>"
+
+In this example, the NONE tells Vim that you are not in any special syntax
+region. In particular, you are not inside an if block.
+
+You also can define matches and regions that are with no "grouphere" or
+"groupthere" arguments. These groups are for syntax groups skipped during
+synchronization. For example, the following skips over anything inside {},
+even if it would normally match another synchronization method: >
+
+ :syntax sync match xSpecial /{.*}/
+
+More about synchronizing in the reference manual: |:syn-sync|.
+
+==============================================================================
+*44.11* Installing a syntax file
+
+When your new syntax file is ready to be used, drop it in a "syntax" directory
+in 'runtimepath'. For Unix that would be "~/.vim/syntax".
+ The name of the syntax file must be equal to the file type, with ".vim"
+added. Thus for the x language, the full path of the file would be:
+
+ ~/.vim/syntax/x.vim ~
+
+You must also make the file type be recognized. See |43.2|.
+
+If your file works well, you might want to make it available to other Vim
+users. First read the next section to make sure your file works well for
+others. Then e-mail it to the Vim maintainer: <maintainer@vim.org>. Also
+explain how the filetype can be detected. With a bit of luck your file will
+be included in the next Vim version!
+
+
+ADDING TO AN EXISTING SYNTAX FILE
+
+We were assuming you were adding a completely new syntax file. When an existing
+syntax file works, but is missing some items, you can add items in a separate
+file. That avoids changing the distributed syntax file, which will be lost
+when installing a new version of Vim.
+ Write syntax commands in your file, possibly using group names from the
+existing syntax. For example, to add new variable types to the C syntax file:
+>
+ :syntax keyword cType off_t uint
+
+Write the file with the same name as the original syntax file. In this case
+"c.vim". Place it in a directory near the end of 'runtimepath'. This makes
+it loaded after the original syntax file. For Unix this would be:
+
+ ~/.vim/after/syntax/c.vim ~
+
+==============================================================================
+*44.12* Portable syntax file layout
+
+Wouldn't it be nice if all Vim users exchange syntax files? To make this
+possible, the syntax file must follow a few guidelines.
+
+Start with a header that explains what the syntax file is for, who maintains
+it and when it was last updated. Don't include too much information about
+changes history, not many people will read it. Example: >
+
+ " Vim syntax file
+ " Language: C
+ " Maintainer: Bram Moolenaar <Bram@vim.org>
+ " Last Change: 2001 Jun 18
+ " Remark: Included by the C++ syntax.
+
+Use the same layout as the other syntax files. Using an existing syntax file
+as an example will save you a lot of time.
+
+Choose a good, descriptive name for your syntax file. Use lowercase letters
+and digits. Don't make it too long, it is used in many places: The name of
+the syntax file "name.vim", 'filetype', b:current_syntax the start of each
+syntax group (nameType, nameStatement, nameString, etc).
+
+Start with a check for "b:current_syntax". If it is defined, some other
+syntax file, earlier in 'runtimepath' was already loaded. To be compatible
+with Vim 5.8 use: >
+
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+
+Set "b:current_syntax" to the name of the syntax at the end. Don't forget
+that included files do this too, you might have to reset "b:current_syntax" if
+you include two files.
+
+If you want your syntax file to work with Vim 5.x, add a check for v:version.
+See yacc.vim for an example.
+
+Do not include anything that is a user preference. Don't set 'tabstop',
+'expandtab', etc. These belong in a filetype plugin.
+
+Do not include mappings or abbreviations. Only include setting 'iskeyword' if
+it is really necessary for recognizing keywords.
+
+Avoid using specific colors. Link to the standard highlight groups whenever
+possible. Don't forget that some people use a different background color, or
+have only eight colors available.
+For backwards compatibility with Vim 5.8 this construction is used: >
+
+ if version >= 508 || !exists("did_c_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink nameString String
+ HiLink nameNumber Number
+ ... etc ...
+
+ delcommand HiLink
+ endif
+
+Add the "display" argument to items that are not used when syncing, to speed
+up scrolling backwards and CTRL-L.
+
+==============================================================================
+
+Next chapter: |usr_45.txt| Select your language
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt
new file mode 100644
index 000000000..034b040dc
--- /dev/null
+++ b/runtime/doc/usr_45.txt
@@ -0,0 +1,419 @@
+*usr_45.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Select your language
+
+
+The messages in Vim can be given in several languages. This chapter explains
+how to change which one is used. Also, the different ways to work with files
+in various languages is explained.
+
+|45.1| Language for Messages
+|45.2| Language for Menus
+|45.3| Using another encoding
+|45.4| Editing files with a different encoding
+|45.5| Entering language text
+
+ Next chapter: |usr_90.txt| Installing Vim
+ Previous chapter: |usr_44.txt| Your own syntax highlighted
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*45.1* Language for Messages
+
+When you start Vim, it checks the environment to find out what language you
+are using. Mostly this should work fine, and you get the messages in your
+language (if they are available). To see what the current language is, use
+this command: >
+
+ :language
+
+If it replies with "C", this means the default is being used, which is
+English.
+
+ Note:
+ Using different languages only works when Vim was compiled to handle
+ it. To find out if it works, use the ":version" command and check the
+ output for "+gettext" and "+multi_lang". If they are there, you are
+ OK. If you see "-gettext" or "-multi_lang" you will have to find
+ another Vim.
+
+What if you would like your messages in a different language? There are
+several ways. Which one you should use depends on the capabilities of your
+system.
+ The first way is to set the environment to the desired language before
+starting Vim. Example for Unix: >
+
+ env LANG=de_DE.ISO_8859-1 vim
+
+This only works if the language is available on your system. The advantage is
+that all the GUI messages and things in libraries will use the right language
+as well. A disadvantage is that you must do this before starting Vim. If you
+want to change language while Vim is running, you can use the second method: >
+
+ :language fr_FR.ISO_8859-1
+
+This way you can try out several names for your language. You will get an
+error message when it's not supported on your system. You don't get an error
+when translated messages are not available. Vim will silently fall back to
+using English.
+ To find out which languages are supported on your system, find the
+directory where they are listed. On my system it is "/usr/share/locale". On
+some systems it's in "/usr/lib/locale". The manual page for "setlocale"
+should give you a hint where it is found on your system.
+ Be careful to type the name exactly as it should be. Upper and lowercase
+matter, and the '-' and '_' characters are easily confused.
+
+You can also set the language separately for messages, edited text and the
+time format. See |:language|.
+
+
+DO-IT-YOURSELF MESSAGE TRANSLATION
+
+If translated messages are not available for your language, you could write
+them yourself. To do this, get the source code for Vim and the GNU gettext
+package. After unpacking the sources, instructions can be found in the
+directory src/po/README.txt.
+ It's not too difficult to do the translation. You don't need to be a
+programmer. You must know both English and the language you are translating
+to, of course.
+ When you are satisfied with the translation, consider making it available
+to others. Upload it at vim-online (http://vim.sf.net) or e-mail it to
+the Vim maintainer <maintainer@vim.org>. Or both.
+
+==============================================================================
+*45.2* Language for Menus
+
+The default menus are in English. To be able to use your local language, they
+must be translated. Normally this is automatically done for you if the
+environment is set for your language, just like with messages. You don't need
+to do anything extra for this. But it only works if translations for the
+language are available.
+ Suppose you are in Germany, with the language set to German, but prefer to
+use "File" instead of "Datei". You can switch back to using the English menus
+this way: >
+
+ :set langmenu=none
+
+It is also possible to specify a language: >
+
+ :set langmenu=nl_NL.ISO_8859-1
+
+Like above, differences between "-" and "_" matter. However, upper/lowercase
+differences are ignored here.
+ The 'langmenu' option must be set before the menus are loaded. Once the
+menus have been defined changing 'langmenu' has no direct effect. Therefore,
+put the command to set 'langmenu' in your vimrc file.
+ If you really want to switch menu language while running Vim, you can do it
+this way: >
+
+ :source $VIMRUNTIME/delmenu.vim
+ :set langmenu=de_DE.ISO_8859-1
+ :source $VIMRUNTIME/menu.vim
+
+There is one drawback: All menus that you defined yourself will be gone. You
+will need to redefine them as well.
+
+
+DO-IT-YOURSELF MENU TRANSLATION
+
+To see which menu translations are available, look in this directory:
+
+ $VIMRUNTIME/lang ~
+
+The files are called menu_{language}.vim. If you don't see the language you
+want to use, you can do your own translations. The simplest way to do this is
+by copying one of the existing language files, and change it.
+ First find out the name of your language with the ":language" command. Use
+this name, but with all letters made lowercase. Then copy the file to your
+own runtime directory, as found early in 'runtimepath'. For example, for Unix
+you would do: >
+
+ :!cp $VIMRUNTIME/lang/menu_ko_kr.euckr.vim ~/.vim/lang/menu_nl_be.iso_8859-1.vim
+
+You will find hints for the translation in "$VIMRUNTIME/lang/README.txt".
+
+==============================================================================
+*45.3* Using another encoding
+
+Vim guesses that the files you are going to edit are encoded for your
+language. For many European languages this is "latin1". Then each byte is
+one character. That means there are 256 different characters possible. For
+Asian languages this is not sufficient. These mostly use a double-byte
+encoding, providing for over ten thousand possible characters. This still
+isn't enough when a text is to contain several different languages. This is
+where Unicode comes in. It was designed to include all characters used in
+commonly used languages. This is the "Super encoding that replaces all
+others". But it isn't used that much yet.
+ Fortunately, Vim supports these three kinds of encodings. And, with some
+restrictions, you can use them even when your environment uses another
+language than the text.
+ Nevertheless, when you only edit files that are in the encoding of your
+language, the default should work fine and you don't need to do anything. The
+following is only relevant when you want to edit different languages.
+
+ Note:
+ Using different encodings only works when Vim was compiled to handle
+ it. To find out if it works, use the ":version" command and check the
+ output for "+multi_byte". If it's there, you are OK. If you see
+ "-multi_byte" you will have to find another Vim.
+
+
+USING UNICODE IN THE GUI
+
+The nice thing about Unicode is that other encodings can be converted to it
+and back without losing information. When you make Vim use Unicode
+internally, you will be able to edit files in any encoding.
+ Unfortunately, the number of systems supporting Unicode is still limited.
+Thus it's unlikely that your language uses it. You need to tell Vim you want
+to use Unicode, and how to handle interfacing with the rest of the system.
+ Let's start with the GUI version of Vim, which is able to display Unicode
+characters. This should work: >
+
+ :set encoding=utf-8
+ :set guifont=-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
+
+The 'encoding' option tells Vim the encoding of the characters that you use.
+This applies to the text in buffers (files you are editing), registers, Vim
+script files, etc. You can regard 'encoding' as the setting for the internals
+of Vim.
+ This example assumes you have this font on your system. The name in the
+example is for the X Window System. This font is in a package that is used to
+enhance xterm with Unicode support. If you don't have this font, you might
+find it here:
+
+ http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz ~
+
+For MS-Windows, some fonts have a limited number of Unicode characters. Try
+using the "Courier New" font. You can use the Edit/Select Font... menu to
+select and try out the fonts available. Only fixed-width fonts can be used
+though. Example: >
+
+ :set guifont=courier_new:h12
+
+If it doesn't work well, try getting a fontpack. If Microsoft didn't move it,
+you can find it here:
+
+ http://www.microsoft.com/typography/fontpack/default.htm ~
+
+Now you have told Vim to use Unicode internally and display text with a
+Unicode font. Typed characters still arrive in the encoding of your original
+language. This requires converting them to Unicode. Tell Vim the language
+from which to convert with the 'termencoding' option. You can do it like
+this: >
+
+ :let &termencoding = &encoding
+ :set encoding=utf-8
+
+This assigns the old value of 'encoding' to 'termencoding' before setting
+'encoding' to utf-8. You will have to try out if this really works for your
+setup. It should work especially well when using an input method for an Asian
+language, and you want to edit Unicode text.
+
+
+USING UNICODE IN A UNICODE TERMINAL
+
+There are terminals that support Unicode directly. The standard xterm that
+comes with XFree86 is one of them. Let's use that as an example.
+ First of all, the xterm must have been compiled with Unicode support. See
+|UTF8-xterm| how to check that and how to compile it when needed.
+ Start the xterm with the "-u8" argument. You might also need so specify a
+font. Example: >
+
+ xterm -u8 -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
+
+Now you can run Vim inside this terminal. Set 'encoding' to "utf-8" as
+before. That's all.
+
+
+USING UNICODE IN AN ORDINARY TERMINAL
+
+Suppose you want to work with Unicode files, but don't have a terminal with
+Unicode support. You can do this with Vim, although characters that are not
+supported by the terminal will not be displayed. The layout of the text
+will be preserved. >
+
+ :let &termencoding = &encoding
+ :set encoding=utf-8
+
+This is the same as what was used for the GUI. But it works differently: Vim
+will convert the displayed text before sending it to the terminal. That
+avoids that the display is messed up with strange characters.
+ For this to work the conversion between 'termencoding' and 'encoding' must
+be possible. Vim will convert from latin1 to Unicode, thus that always works.
+For other conversions the |+iconv| feature is required.
+ Try editing a file with Unicode characters in it. You will notice that Vim
+will put a question mark (or underscore or some other character) in places
+where a character should be that the terminal can't display. Move the cursor
+to a question mark and use this command: >
+
+ ga
+
+Vim will display a line with the code of the character. This gives you a hint
+about what character it is. You can look it up in a Unicode table. You could
+actually view a file that way, if you have lots of time at hand.
+
+ Note:
+ Since 'encoding' is used for all text inside Vim, changing it makes
+ all non-ASCII text invalid. You will notice this when using registers
+ and the 'viminfo' file (e.g., a remembered search pattern). It's
+ recommended to set 'encoding' in your vimrc file, and leave it alone.
+
+==============================================================================
+*45.4* Editing files with a different encoding
+
+Suppose you have setup Vim to use Unicode, and you want to edit a file that is
+in 16-bit Unicode. Sounds simple, right? Well, Vim actually uses utf-8
+encoding internally, thus the 16-bit encoding must be converted. Thus there
+is a difference between the character set (Unicode) and the encoding (utf-8 or
+16-bit).
+ Vim will try to detect what kind of file you are editing. It uses the
+encoding names in the 'fileencodings' option. When using Unicode, the default
+value is: "ucs-bom,utf-8,latin1". This means that Vim checks the file to see
+if it's one of these encodings:
+
+ ucs-bom File must start with a Byte Order Mark (BOM). This
+ allows detection of 16-bit, 32-bit and utf-8 Unicode
+ encodings.
+ utf-8 utf-8 Unicode. This is rejected when a sequence of
+ bytes is illegal in utf-8.
+ latin1 The good old 8-bit encoding. Always works.
+
+When you start editing that 16-bit Unicode file, and it has a BOM, Vim will
+detect this and convert the file to utf-8 when reading it. The 'fileencoding'
+option (without s at the end) is set to the detected value. In this case it
+is "ucs-2le". That means it's Unicode, two bytes and little-endian. This
+file format is common on MS-Windows (e.g., for registry files).
+ When writing the file, Vim will compare 'fileencoding' with 'encoding'. If
+they are different, the text will be converted.
+ An empty value for 'fileencoding' means that no conversion is to be done.
+Thus the text is assumed to be encoded with 'encoding'.
+
+If the default 'fileencodings' value is not good for you, set it to the
+encodings you want Vim to try. Only when a value is found to be invalid will
+the next one be used. Putting "latin1" first doesn't work, because it is
+never illegal. An example, to fall back to Japanese when the file doesn't
+have a BOM and isn't utf-8: >
+
+ :set fileencodings=ucs-bom,utf-8,sjis
+
+See |encoding-values| for suggested values. Other values may work as well.
+This depends on the conversion available.
+
+
+FORCING AN ENCODING
+
+If the automatic detection doesn't work you must tell Vim what encoding the
+file is. Example: >
+
+ :edit ++enc=koi8-r russian.txt
+
+The "++enc" part specifies the name of the encoding to be used for this file
+only. Vim will convert the file from the specified encoding, Russian in this
+example, to 'encoding'. 'fileencoding' will also be set to the specified
+encoding, so that the reverse conversion can be done when writing the file.
+ The same argument can be used when writing the file. This way you can
+actually use Vim to convert a file. Example: >
+
+ :write ++enc=utf-8 russian.txt
+<
+ Note:
+ Conversion may result in lost characters. Conversion from an encoding
+ to Unicode and back is mostly free of this problem, unless there are
+ illegal characters. Conversion from Unicode to other encodings often
+ loses information when there was more than one language in the file.
+
+==============================================================================
+*45.5* Entering language text
+
+Computer keyboards don't have much more than a hundred keys. Some languages
+have thousands of characters, Unicode has ten thousands. So how do you type
+these characters?
+ First of all, when you don't use too many of the special characters, you
+can use digraphs. This was already explained in |24.9|.
+ When you use a language that uses many more characters than keys on your
+keyboard, you will want to use an Input Method (IM). This requires learning
+the translation from typed keys to resulting character. When you need an IM
+you probably already have one on your system. It should work with Vim like
+with other programs. For details see |mbyte-XIM| for the X Window system and
+|mbyte-IME| for MS-Windows.
+
+
+KEYMAPS
+
+For some languages the character set is different from latin, but uses a
+similar number of characters. It's possible to map keys to characters. Vim
+uses keymaps for this.
+ Suppose you want to type Hebrew. You can load the keymap like this: >
+
+ :set keymap=hebrew
+
+Vim will try to find a keymap file for you. This depends on the value of
+'encoding'. If no matching file was found, you will get an error message.
+
+Now you can type Hebrew in Insert mode. In Normal mode, and when typing a ":"
+command, Vim automatically switches to English. You can use this command to
+switch between Hebrew and English: >
+
+ CTRL-^
+
+This only works in Insert mode and Command-line mode. In Normal mode it does
+something completely different (jumps to alternate file).
+ The usage of the keymap is indicated in the mode message, if you have the
+'showmode' option set. In the GUI Vim will indicate the usage of keymaps with
+a different cursor color.
+ You can also change the usage of the keymap with the 'iminsert' and
+'imsearch' options.
+
+To see the list of mappings, use this command: >
+
+ :lmap
+
+To find out which keymap files are available, in the GUI you can use the
+Edit/Keymap menu. Otherwise you can use this command: >
+
+ :echo globpath(&rtp, "keymap/*.vim")
+
+
+DO-IT-YOURSELF KEYMAPS
+
+You can create your own keymap file. It's not very difficult. Start with
+a keymap file that is similar to the language you want to use. Copy it to the
+"keymap" directory in your runtime directory. For example, for Unix, you
+would use the directory "~/.vim/keymap".
+ The name of the keymap file must look like this:
+
+ keymap/{name}.vim ~
+or
+ keymap/{name}_{encoding}.vim ~
+
+{name} is the name of the keymap. Chose a name that is obvious, but different
+from existing keymaps (unless you want to replace an existing keymap file).
+{name} cannot contain an underscore. Optionally, add the encoding used after
+an underscore. Examples:
+
+ keymap/hebrew.vim ~
+ keymap/hebrew_utf-8.vim ~
+
+The contents of the file should be self-explanatory. Look at a few of the
+keymaps that are distributed with Vim. For the details, see |mbyte-keymap|.
+
+
+LAST RESORT
+
+If all other methods fail, you can enter any character with CTRL-V:
+
+ encoding type range ~
+ 8-bit CTRL-V 123 decimal 0-255
+ 8-bit CTRL-V x a1 hexadecimal 00-ff
+ 16-bit CTRL-V u 013b hexadecimal 0000-ffff
+ 31-bit CTRL-V U 001303a4 hexadecimal 00000000-7fffffff
+
+Don't type the spaces. See |i_CTRL-V_digit| for the details.
+
+==============================================================================
+
+Next chapter: |usr_90.txt| Installing Vim
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_90.txt b/runtime/doc/usr_90.txt
new file mode 100644
index 000000000..4a9c488be
--- /dev/null
+++ b/runtime/doc/usr_90.txt
@@ -0,0 +1,498 @@
+*usr_90.txt* For Vim version 7.0aa. Last change: 2004 Mar 21
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Installing Vim
+
+ *install*
+Before you can use Vim you have to install it. Depending on your system it's
+simple or easy. This chapter gives a few hints and also explains how
+upgrading to a new version is done.
+
+|90.1| Unix
+|90.2| MS-Windows
+|90.3| Upgrading
+|90.4| Common installation issues
+|90.5| Uninstalling Vim
+
+ Previous chapter: |usr_45.txt| Select your language
+Table of contents: |usr_toc.txt|
+
+==============================================================================
+*90.1* Unix
+
+First you have to decide if you are going to install Vim system-wide or for a
+single user. The installation is almost the same, but the directory where Vim
+is installed in differs.
+ For a system-wide installation the base directory "/usr/local" is often
+used. But this may be different for your system. Try finding out where other
+packages are installed.
+ When installing for a single user, you can use your home directory as the
+base. The files will be placed in subdirectories like "bin" and "shared/vim".
+
+
+FROM A PACKAGE
+
+You can get precompiled binaries for many different UNIX systems. There is a
+long list with links on this page:
+
+ http://www.vim.org/binaries.html ~
+
+Volunteers maintain the binaries, so they are often out of date. It is a
+good idea to compile your own UNIX version from the source. Also, creating
+the editor from the source allows you to control which features are compiled.
+This does require a compiler though.
+
+If you have a Linux distribution, the "vi" program is probably a minimal
+version of Vim. It doesn't do syntax highlighting, for example. Try finding
+another Vim package in your distribution, or search on the web site.
+
+
+FROM SOURCES
+
+To compile and install Vim, you will need the following:
+
+ - A C compiler (GCC preferred)
+ - The GZIP program (you can get it from www.gnu.org)
+ - The Vim source and runtime archives
+
+To get the Vim archives, look in this file for a mirror near you, this should
+provide the fastest download:
+
+ ftp://ftp.vim.org/pub/vim/MIRRORS ~
+
+Or use the home site ftp.vim.org, if you think it's fast enough. Go to the
+"unix" directory and you'll find a list of files there. The version number is
+embedded in the file name. You will want to get the most recent version.
+ You can get the files for Unix in two ways: One big archive that contains
+everything, or four smaller ones that each fit on a floppy disk. For version
+6.1 the single big one is called:
+
+ vim-6.1.tar.bz2 ~
+
+You need the bzip2 program to uncompress it. If you don't have it, get the
+four smaller files, which can be uncompressed with gzip. For Vim 6.1 they are
+called:
+
+ vim-6.1-src1.tar.gz ~
+ vim-6.1-src2.tar.gz ~
+ vim-6.1-rt1.tar.gz ~
+ vim-6.1-rt2.tar.gz ~
+
+
+COMPILING
+
+First create a top directory to work in, for example: >
+
+ mkdir ~/vim
+ cd ~/vim
+
+Then unpack the archives there. If you have the one big archive, you unpack
+it like this: >
+
+ bzip2 -d -c path/vim-6.1.tar.bz2 | tar xf -
+
+Change "path" to where you have downloaded the file. >
+
+ gzip -d -c path/vim-6.1-src1.tar.gz | tar xf -
+ gzip -d -c path/vim-6.1-src2.tar.gz | tar xf -
+ gzip -d -c path/vim-6.1-rt1.tar.gz | tar xf -
+ gzip -d -c path/vim-6.1-rt2.tar.gz | tar xf -
+
+If you are satisfied with getting the default features, and your environment
+is setup properly, you should be able to compile Vim with just this: >
+
+ cd vim61/src
+ make
+
+The make program will run configure and compile everything. Further on we
+will explain how to compile with different features.
+ If there are errors while compiling, carefully look at the error messages.
+There should be a hint about what went wrong. Hopefully you will be able to
+correct it. You might have to disable some features to make Vim compile.
+Look in the Makefile for specific hints for your system.
+
+
+TESTING
+
+Now you can check if compiling worked OK: >
+
+ make test
+
+This will run a sequence of test scripts to verify that Vim works as expected.
+Vim will be started many times and all kinds of text and messages flash by.
+If it is alright you will finally see:
+
+ test results: ~
+ ALL DONE ~
+
+If there are one or two messages about failed tests, Vim might still work, but
+not perfectly. If you see a lot of error messages or Vim doesn't finish until
+the end, there must be something wrong. Either try to find out yourself, or
+find someone who can solve it. You could look in the |maillist-archive| for a
+solution. If everything else fails, you could ask in the vim |maillist| if
+someone can help you.
+
+
+INSTALLING
+ *install-home*
+If you want to install in your home directory, edit the Makefile and search
+for a line:
+
+ #prefix = $(HOME) ~
+
+Remove the # at the start of the line.
+ When installing for the whole system, Vim has most likely already selected
+a good installation directory for you. You can also specify one, see below.
+You need to become root for the following.
+
+To install Vim do: >
+
+ make install
+
+That should move all the relevant files to the right place. Now you can try
+running vim to verify that it works. Use two simple tests to check if Vim can
+find its runtime files: >
+
+ :help
+ :syntax enable
+
+If this doesn't work, use this command to check where Vim is looking for the
+runtime files: >
+
+ :echo $VIMRUNTIME
+
+You can also start Vim with the "-V" argument to see what happens during
+startup: >
+
+ vim -V
+
+Don't forget that the user manual assumes you Vim in a certain way. After
+installing Vim, follow the instructions at |not-compatible| to make Vim work
+as assumed in this manual.
+
+
+SELECTING FEATURES
+
+Vim has many ways to select features. One of the simple ways is to edit the
+Makefile. There are many directions and examples. Often you can enable or
+disable a feature by uncommenting a line.
+ An alternative is to run "configure" separately. This allows you to
+specify configuration options manually. The disadvantage is that you have to
+figure out what exactly to type.
+ Some of the most interesting configure arguments follow. These can also be
+enabled from the Makefile.
+
+ --prefix={directory} Top directory where to install Vim.
+
+ --with-features=tiny Compile with many features disabled.
+ --with-features=small Compile with some features disabled.
+ --with-features=big Compile with more features enabled.
+ --with-features=huge Compile with most features enabled.
+ See |+feature-list| for which feature
+ is enabled in which case.
+
+ --enable-perlinterp Enable the Perl interface. There are
+ similar arguments for ruby, python and
+ tcl.
+
+ --disable-gui Do not compile the GUI interface.
+ --without-x Do not compile X-windows features.
+ When both of these are used, Vim will
+ not connect to the X server, which
+ makes startup faster.
+
+To see the whole list use: >
+
+ ./configure --help
+
+You can find a bit of explanation for each feature, and links for more
+information here: |feature-list|.
+ For the adventurous, edit the file "feature.h". You can also change the
+source code yourself!
+
+==============================================================================
+*90.2* MS-Windows
+
+There are two ways to install the Vim program for Microsoft Windows. You can
+uncompress several archives, or use a self-installing big archive. Most users
+with fairly recent computers will prefer the second method. For the first
+one, you will need:
+
+ - An archive with binaries for Vim.
+ - The Vim runtime archive.
+ - A program to unpack the zip files.
+
+To get the Vim archives, look in this file for a mirror near you, this should
+provide the fastest download:
+
+ ftp://ftp.vim.org/pub/vim/MIRRORS ~
+
+Or use the home site ftp.vim.org, if you think it's fast enough. Go to the
+"pc" directory and you'll find a list of files there. The version number is
+embedded in the file name. You will want to get the most recent version.
+We will use "61" here, which is version 6.1.
+
+ gvim61.exe The self-installing archive.
+
+This is all you need for the second method. Just launch the executable, and
+follow the prompts.
+
+For the first method you must chose one of the binary archives. These are
+available:
+
+ gvim61.zip The normal MS-Windows GUI version.
+ gvim61ole.zip The MS-Windows GUI version with OLE support.
+ Uses more memory, supports interfacing with
+ other OLE applications.
+ vim61w32.zip 32 bit MS-Windows console version. For use in
+ a Win NT/2000/XP console. Does not work well
+ on Win 95/98.
+ vim61d32.zip 32 bit MS-DOS version. For use in the
+ Win 95/98 console window.
+ vim61d16.zip 16 bit MS-DOS version. Only for old systems.
+ Does not support long filenames.
+
+You only need one of them. Although you could install both a GUI and a
+console version. You always need to get the archive with runtime files.
+
+ vim61rt.zip The runtime files.
+
+Use your un-zip program to unpack the files. For example, using the "unzip"
+program: >
+
+ cd c:\
+ unzip path\gvim61.zip
+ unzip path\vim61rt.zip
+
+This will unpack the files in the directory "c:\vim\vim61". If you already
+have a "vim" directory somewhere, you will want to move to the directory just
+above it.
+ Now change to the "vim\vim61" directory and run the install program: >
+
+ install
+
+Carefully look through the messages and select the options you want to use.
+If you finally select "do it" the install program will carry out the actions
+you selected.
+ The install program doesn't move the runtime files. They remain where you
+unpacked them.
+
+In case you are not satisfied with the features included in the supplied
+binaries, you could try compiling Vim yourself. Get the source archive from
+the same location as where the binaries are. You need a compiler for which a
+makefile exists. Microsoft Visual C works, but is expensive. The Free
+Borland command-line compiler 5.5 can be used, as well as the free MingW and
+Cygwin compilers. Check the file src/INSTALLpc.txt for hints.
+
+==============================================================================
+*90.3* Upgrading
+
+If you are running one version of Vim and want to install another, here is
+what to do.
+
+
+UNIX
+
+When you type "make install" the runtime files will be copied to a directory
+which is specific for this version. Thus they will not overwrite a previous
+version. This makes it possible to use two or more versions next to
+each other.
+ The executable "vim" will overwrite an older version. If you don't care
+about keeping the old version, running "make install" will work fine. You can
+delete the old runtime files manually. Just delete the directory with the
+version number in it and all files below it. Example: >
+
+ rm -rf /usr/local/share/vim/vim58
+
+There are normally no changed files below this directory. If you did change
+the "filetype.vim" file, for example, you better merge the changes into the
+new version before deleting it.
+
+If you are careful and want to try out the new version for a while before
+switching to it, install the new version under another name. You need to
+specify a configure argument. For example: >
+
+ ./configure --with-vim-name=vim6
+
+Before running "make install", you could use "make -n install" to check that
+no valuable existing files are overwritten.
+ When you finally decide to switch to the new version, all you need to do is
+to rename the binary to "vim". For example: >
+
+ mv /usr/local/bin/vim6 /usr/local/bin/vim
+
+
+MS-WINDOWS
+
+Upgrading is mostly equal to installing a new version. Just unpack the files
+in the same place as the previous version. A new directory will be created,
+e.g., "vim61", for the files of the new version. Your runtime files, vimrc
+file, viminfo, etc. will be left alone.
+ If you want to run the new version next to the old one, you will have to do
+some handwork. Don't run the install program, it will overwrite a few files
+of the old version. Execute the new binaries by specifying the full path.
+The program should be able to automatically find the runtime files for the
+right version. However, this won't work if you set the $VIMRUNTIME variable
+somewhere.
+ If you are satisfied with the upgrade, you can delete the files of the
+previous version. See |90.5|.
+
+==============================================================================
+*90.4* Common installation issues
+
+This section describes some of the common problems that occur when installing
+Vim and suggests some solutions. It also contains answers to many
+installation questions.
+
+
+Q: I Do Not Have Root Privileges. How Do I Install Vim? (Unix)
+
+Use the following configuration command to install Vim in a directory called
+$HOME/vim: >
+
+ ./configure --prefix=$HOME
+
+This gives you a personal copy of Vim. You need to put $HOME/bin in your
+path to execute the editor. Also see |install-home|.
+
+
+Q: The Colors Are Not Right on My Screen. (Unix)
+
+Check your terminal settings by using the following command in a shell: >
+
+ echo $TERM
+
+If the terminal type listed is not correct, fix it. For more hints, see
+|06.2|. Another solution is to always use the GUI version of Vim, called
+gvim. This avoids the need for a correct terminal setup.
+
+
+Q: My Backspace And Delete Keys Don't Work Right
+
+The definition of what key sends what code is very unclear for backspace <BS>
+and Delete <Del> keys. First of all, check your $TERM setting. If there is
+nothing wrong with it, try this: >
+
+ :set t_kb=^V<BS>
+ :set t_kD=^V<Del>
+
+In the first line you need to press CTRL-V and then hit the backspace key.
+In the second line you need to press CTRL-V and then hit the Delete key.
+You can put these lines in your vimrc file, see |05.1|. A disadvantage is
+that it won't work when you use another terminal some day. Look here for
+alternate solutions: |:fixdel|.
+
+
+Q: I Am Using RedHat Linux. Can I Use the Vim That Comes with the System?
+
+By default RedHat installs a minimal version of Vim. Check your RPM packages
+for something named "Vim-enhanced-version.rpm" and install that.
+
+
+Q: How Do I Turn Syntax Coloring On? How do I make plugins work?
+
+Use the example vimrc script. You can find an explanation on how to use it
+here: |not-compatible|.
+
+See chapter 6 for information about syntax highlighting: |usr_06.txt|.
+
+
+Q: What Is a Good vimrc File to Use?
+
+See the www.vim.org Web site for several good examples.
+
+
+Q: Where Do I Find a Good Vim Plugin?
+
+See the Vim-online site: http://vim.sf.net. Many users have uploaded useful
+Vim scripts and plugins there.
+
+
+Q: Where Do I Find More Tips?
+
+See the Vim-online site: http://vim.sf.net. There is an archive with hints
+from Vim users. You might also want to search in the |maillist-archive|.
+
+==============================================================================
+*90.5* Uninstalling Vim
+
+In the unlikely event you want to uninstall Vim completely, this is how you do
+it.
+
+
+UNIX
+
+When you installed Vim as a package, check your package manager to find out
+how to remove the package again.
+ If you installed Vim from sources you can use this command: >
+
+ make uninstall
+
+However, if you have deleted the original files or you used an archive that
+someone supplied, you can't do this. Do delete the files manually, here is an
+example for when "/usr/local" was used as the root: >
+
+ rm -rf /usr/local/share/vim/vim61
+ rm /usr/local/bin/eview
+ rm /usr/local/bin/evim
+ rm /usr/local/bin/ex
+ rm /usr/local/bin/gview
+ rm /usr/local/bin/gvim
+ rm /usr/local/bin/gvim
+ rm /usr/local/bin/gvimdiff
+ rm /usr/local/bin/rgview
+ rm /usr/local/bin/rgvim
+ rm /usr/local/bin/rview
+ rm /usr/local/bin/rvim
+ rm /usr/local/bin/rvim
+ rm /usr/local/bin/view
+ rm /usr/local/bin/vim
+ rm /usr/local/bin/vimdiff
+ rm /usr/local/bin/vimtutor
+ rm /usr/local/bin/xxd
+ rm /usr/local/man/man1/eview.1
+ rm /usr/local/man/man1/evim.1
+ rm /usr/local/man/man1/ex.1
+ rm /usr/local/man/man1/gview.1
+ rm /usr/local/man/man1/gvim.1
+ rm /usr/local/man/man1/gvimdiff.1
+ rm /usr/local/man/man1/rgview.1
+ rm /usr/local/man/man1/rgvim.1
+ rm /usr/local/man/man1/rview.1
+ rm /usr/local/man/man1/rvim.1
+ rm /usr/local/man/man1/view.1
+ rm /usr/local/man/man1/vim.1
+ rm /usr/local/man/man1/vimdiff.1
+ rm /usr/local/man/man1/vimtutor.1
+ rm /usr/local/man/man1/xxd.1
+
+
+MS-WINDOWS
+
+If you installed Vim with the self-installing archive you can run
+the "uninstall-gui" program located in the same directory as the other Vim
+programs, e.g. "c:\vim\vim61". You can also launch it from the Start menu if
+installed the Vim entries there. This will remove most of the files, menu
+entries and desktop shortcuts. Some files may remain however, as they need a
+Windows restart before being deleted.
+ You will be given the option to remove the whole "vim" directory. It
+probably contains your vimrc file and other runtime files that you created, so
+be careful.
+
+Else, if you installed Vim with the zip archives, the preferred way is to use
+the "uninstal" program (note the missing l at the end). You can find it in
+the same directory as the "install" program, e.g., "c:\vim\vim61". This
+should also work from the usual "install/remove software" page.
+ However, this only removes the registry entries for Vim. You have to
+delete the files yourself. Simply select the directory "vim\vim61" and delete
+it recursively. There should be no files there that you changed, but you
+might want to check that first.
+ The "vim" directory probably contains your vimrc file and other runtime
+files that you created. You might want to keep that.
+
+==============================================================================
+
+Table of contents: |usr_toc.txt|
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt
new file mode 100644
index 000000000..c371dda8f
--- /dev/null
+++ b/runtime/doc/usr_toc.txt
@@ -0,0 +1,340 @@
+*usr_toc.txt* For Vim version 7.0aa. Last change: 2003 Aug 18
+
+ VIM USER MANUAL - by Bram Moolenaar
+
+ Table Of Contents *user-manual*
+
+==============================================================================
+Overview ~
+
+Getting Started
+|usr_01.txt| About the manuals
+|usr_02.txt| The first steps in Vim
+|usr_03.txt| Moving around
+|usr_04.txt| Making small changes
+|usr_05.txt| Set your settings
+|usr_06.txt| Using syntax highlighting
+|usr_07.txt| Editing more than one file
+|usr_08.txt| Splitting windows
+|usr_09.txt| Using the GUI
+|usr_10.txt| Making big changes
+|usr_11.txt| Recovering from a crash
+|usr_12.txt| Clever tricks
+
+Editing Effectively
+|usr_20.txt| Typing command-line commands quickly
+|usr_21.txt| Go away and come back
+|usr_22.txt| Finding the file to edit
+|usr_23.txt| Editing other files
+|usr_24.txt| Inserting quickly
+|usr_25.txt| Editing formatted text
+|usr_26.txt| Repeating
+|usr_27.txt| Search commands and patterns
+|usr_28.txt| Folding
+|usr_29.txt| Moving through programs
+|usr_30.txt| Editing programs
+|usr_31.txt| Exploiting the GUI
+
+Tuning Vim
+|usr_40.txt| Make new commands
+|usr_41.txt| Write a Vim script
+|usr_42.txt| Add new menus
+|usr_43.txt| Using filetypes
+|usr_44.txt| Your own syntax highlighted
+|usr_45.txt| Select your language
+
+Making Vim Run
+|usr_90.txt| Installing Vim
+
+
+The user manual is available as a single, ready to print HTML and PDF file
+here:
+ http://vimdoc.sf.net
+
+==============================================================================
+Getting Started ~
+
+Read this from start to end to learn the essential commands.
+
+|usr_01.txt| About the manuals
+ |01.1| Two manuals
+ |01.2| Vim installed
+ |01.3| Using the Vim tutor
+ |01.4| Copyright
+
+|usr_02.txt| The first steps in Vim
+ |02.1| Running Vim for the First Time
+ |02.2| Inserting text
+ |02.3| Moving around
+ |02.4| Deleting characters
+ |02.5| Undo and Redo
+ |02.6| Other editing commands
+ |02.7| Getting out
+ |02.8| Finding help
+
+|usr_03.txt| Moving around
+ |03.1| Word movement
+ |03.2| Moving to the start or end of a line
+ |03.3| Moving to a character
+ |03.4| Matching a paren
+ |03.5| Moving to a specific line
+ |03.6| Telling where you are
+ |03.7| Scrolling around
+ |03.8| Simple searches
+ |03.9| Simple search patterns
+ |03.10| Using marks
+
+|usr_04.txt| Making small changes
+ |04.1| Operators and motions
+ |04.2| Changing text
+ |04.3| Repeating a change
+ |04.4| Visual mode
+ |04.5| Moving text
+ |04.6| Copying text
+ |04.7| Using the clipboard
+ |04.8| Text objects
+ |04.9| Replace mode
+ |04.10| Conclusion
+
+|usr_05.txt| Set your settings
+ |05.1| The vimrc file
+ |05.2| The example vimrc file explained
+ |05.3| Simple mappings
+ |05.4| Adding a plugin
+ |05.5| Adding a help file
+ |05.6| The option window
+ |05.7| Often used options
+
+|usr_06.txt| Using syntax highlighting
+ |06.1| Switching it on
+ |06.2| No or wrong colors?
+ |06.3| Different colors
+ |06.4| With colors or without colors
+ |06.5| Printing with colors
+ |06.6| Further reading
+
+|usr_07.txt| Editing more than one file
+ |07.1| Edit another file
+ |07.2| A list of files
+ |07.3| Jumping from file to file
+ |07.4| Backup files
+ |07.5| Copy text between files
+ |07.6| Viewing a file
+ |07.7| Changing the file name
+
+|usr_08.txt| Splitting windows
+ |08.1| Split a window
+ |08.2| Split a window on another file
+ |08.3| Window size
+ |08.4| Vertical splits
+ |08.5| Moving windows
+ |08.6| Commands for all windows
+ |08.7| Viewing differences with vimdiff
+ |08.8| Various
+
+|usr_09.txt| Using the GUI
+ |09.1| Parts of the GUI
+ |09.2| Using the mouse
+ |09.3| The clipboard
+ |09.4| Select mode
+
+|usr_10.txt| Making big changes
+ |10.1| Record and playback commands
+ |10.2| Substitution
+ |10.3| Command ranges
+ |10.4| The global command
+ |10.5| Visual block mode
+ |10.6| Reading and writing part of a file
+ |10.7| Formatting text
+ |10.8| Changing case
+ |10.9| Using an external program
+
+|usr_11.txt| Recovering from a crash
+ |11.1| Basic recovery
+ |11.2| Where is the swap file?
+ |11.3| Crashed or not?
+ |11.4| Further reading
+
+|usr_12.txt| Clever tricks
+ |12.1| Replace a word
+ |12.2| Change "Last, First" to "First Last"
+ |12.3| Sort a list
+ |12.4| Reverse line order
+ |12.5| Count words
+ |12.6| Find a man page
+ |12.7| Trim blanks
+ |12.8| Find where a word is used
+
+==============================================================================
+Editing Effectively ~
+
+Subjects that can be read independently.
+
+|usr_20.txt| Typing command-line commands quickly
+ |20.1| Command line editing
+ |20.2| Command line abbreviations
+ |20.3| Command line completion
+ |20.4| Command line history
+ |20.5| Command line window
+
+|usr_21.txt| Go away and come back
+ |21.1| Suspend and resume
+ |21.2| Executing shell commands
+ |21.3| Remembering information; viminfo
+ |21.4| Sessions
+ |21.5| Views
+ |21.6| Modelines
+
+|usr_22.txt| Finding the file to edit
+ |22.1| The file explorer
+ |22.2| The current directory
+ |22.3| Finding a file
+ |22.4| The buffer list
+
+|usr_23.txt| Editing other files
+ |23.1| DOS, Mac and Unix files
+ |23.2| Files on the internet
+ |23.3| Encryption
+ |23.4| Binary files
+ |23.5| Compressed files
+
+|usr_24.txt| Inserting quickly
+ |24.1| Making corrections
+ |24.2| Showing matches
+ |24.3| Completion
+ |24.4| Repeating an insert
+ |24.5| Copying from another line
+ |24.6| Inserting a register
+ |24.7| Abbreviations
+ |24.8| Entering special characters
+ |24.9| Digraphs
+ |24.10| Normal mode commands
+
+|usr_25.txt| Editing formatted text
+ |25.1| Breaking lines
+ |25.2| Aligning text
+ |25.3| Indents and tabs
+ |25.4| Dealing with long lines
+ |25.5| Editing tables
+
+|usr_26.txt| Repeating
+ |26.1| Repeating with Visual mode
+ |26.2| Add and subtract
+ |26.3| Making a change in many files
+ |26.4| Using Vim from a shell script
+
+|usr_27.txt| Search commands and patterns
+ |27.1| Ignoring case
+ |27.2| Wrapping around the file end
+ |27.3| Offsets
+ |27.4| Matching multiple times
+ |27.5| Alternatives
+ |27.6| Character ranges
+ |27.7| Character classes
+ |27.8| Matching a line break
+ |27.9| Examples
+
+|usr_28.txt| Folding
+ |28.1| What is folding?
+ |28.2| Manual folding
+ |28.3| Working with folds
+ |28.4| Saving and restoring folds
+ |28.5| Folding by indent
+ |28.6| Folding with markers
+ |28.7| Folding by syntax
+ |28.8| Folding by expression
+ |28.9| Folding unchanged lines
+ |28.10| Which fold method to use?
+
+|usr_29.txt| Moving through programs
+ |29.1| Using tags
+ |29.2| The preview window
+ |29.3| Moving through a program
+ |29.4| Finding global identifiers
+ |29.5| Finding local identifiers
+
+|usr_30.txt| Editing programs
+ |30.1| Compiling
+ |30.2| Indenting C files
+ |30.3| Automatic indenting
+ |30.4| Other indenting
+ |30.5| Tabs and spaces
+ |30.6| Formatting comments
+
+|usr_31.txt| Exploiting the GUI
+ |31.1| The file browser
+ |31.2| Confirmation
+ |31.3| Menu shortcuts
+ |31.4| Vim window position and size
+ |31.5| Various
+
+==============================================================================
+Tuning Vim ~
+
+Make Vim work as you like it.
+
+|usr_40.txt| Make new commands
+ |40.1| Key mapping
+ |40.2| Defining command-line commands
+ |40.3| Autocommands
+
+|usr_41.txt| Write a Vim script
+ |41.1| Introduction
+ |41.2| Variables
+ |41.3| Expressions
+ |41.4| Conditionals
+ |41.5| Executing an expression
+ |41.6| Using functions
+ |41.7| Defining a function
+ |41.8| Exceptions
+ |41.9| Various remarks
+ |41.10| Writing a plugin
+ |41.11| Writing a filetype plugin
+ |41.12| Writing a compiler plugin
+
+|usr_42.txt| Add new menus
+ |42.1| Introduction
+ |42.2| Menu commands
+ |42.3| Various
+ |42.4| Toolbar and popup menus
+
+|usr_43.txt| Using filetypes
+ |43.1| Plugins for a filetype
+ |43.2| Adding a filetype
+
+|usr_44.txt| Your own syntax highlighted
+ |44.1| Basic syntax commands
+ |44.2| Keywords
+ |44.3| Matches
+ |44.4| Regions
+ |44.5| Nested items
+ |44.6| Following groups
+ |44.7| Other arguments
+ |44.8| Clusters
+ |44.9| Including another syntax file
+ |44.10| Synchronizing
+ |44.11| Installing a syntax file
+ |44.12| Portable syntax file layout
+
+|usr_45.txt| Select your language
+ |45.1| Language for Messages
+ |45.2| Language for Menus
+ |45.3| Using another encoding
+ |45.4| Editing files with a different encoding
+ |45.5| Entering language text
+
+==============================================================================
+Making Vim Run ~
+
+Before you can use Vim.
+
+|usr_90.txt| Installing Vim
+ |90.1| Unix
+ |90.2| MS-Windows
+ |90.3| Upgrading
+ |90.4| Common installation issues
+ |90.5| Uninstalling Vim
+
+==============================================================================
+
+Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
new file mode 100644
index 000000000..252572d97
--- /dev/null
+++ b/runtime/doc/various.txt
@@ -0,0 +1,1098 @@
+*various.txt* For Vim version 7.0aa. Last change: 2004 May 01
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Various commands *various*
+
+1. Various commands |various-cmds|
+2. Online help |online-help|
+3. Printing |printing|
+4. Using Vim like less or more |less|
+
+==============================================================================
+1. Various commands *various-cmds*
+
+ *CTRL-L*
+CTRL-L Clear and redraw the screen (later).
+
+ *:redr* *:redraw*
+:redr[aw][!] Redraw the screen right now. When ! is included it is
+ cleared first.
+ Useful to update the screen halfway executing a script
+ or function. Also when halfway a mapping and
+ 'lazyredraw' is set.
+
+ *:redraws* *:redrawstatus*
+:redraws[tatus][!] Redraw the status line of the current window. When !
+ is included all status lines are redrawn.
+ Useful to update the status line(s) when 'statusline'
+ includes an item that doesn't cause automatic
+ updating.
+
+ *N<Del>*
+<Del> When entering a number: Remove the last digit.
+ Note: if you like to use <BS> for this, add this
+ mapping to your .vimrc: >
+ :map CTRL-V <BS> CTRL-V <Del>
+< See |:fixdel| if your <Del> key does not do what you
+ want.
+
+:as[cii] or *ga* *:as* *:ascii*
+ga Print the ascii value of the character under the
+ cursor in decimal, hexadecimal and octal. For
+ example, when the cursor is on a 'R':
+ <R> 82, Hex 52, Octal 122 ~
+ When the character is a non-standard ASCII character,
+ but printable according to the 'isprint' option, the
+ non-printable version is also given. When the
+ character is larger than 127, the <M-x> form is also
+ printed. For example:
+ <~A> <M-^A> 129, Hex 81, Octal 201 ~
+ <p> <|~> <M-~> 254, Hex fe, Octal 376 ~
+ (where <p> is a special character)
+ The <Nul> character in a file is stored internally as
+ <NL>, but it will be shown as:
+ <^@> 0, Hex 00, Octal 000 ~
+ Mnemonic: Get Ascii value. {not in Vi}
+
+ *g8*
+g8 Print the hex values of the bytes used in the
+ character under the cursor, assuming it is in |UTF-8|
+ encoding. This also shows composing characters.
+ Example of a character with three composing
+ characters:
+ e0 b8 81 + e0 b8 b9 + e0 b9 89 ~
+ {not in Vi}
+
+ *:p* *:pr* *:print*
+:[range]p[rint] Print [range] lines (default current line).
+ Note: If you are looking for a way to print your text
+ file, you need an external program for that. In the
+ GUI you can use the File.Print menu entry.
+ (For printing on paper see |:hardcopy|)
+
+:[range]p[rint] {count}
+ Print {count} lines, starting with [range] (default
+ current line |cmdline-ranges|).
+
+ *:P* *:Print*
+:[range]P[rint] [count]
+ Just as ":print". Was apparently added to Vi for
+ people that keep the shift key pressed too long...
+
+ *:l* *:list*
+:[range]l[ist] [count]
+ Same as :print, but display unprintable characters
+ with '^'.
+
+ *:nu* *:number*
+:[range]nu[mber] [count]
+ Same as :print, but precede each line with its line
+ number. (See also 'highlight' option).
+
+ *:#*
+:[range]# [count] synonym for :number.
+
+ *:z* *E144*
+:{range}z[+-^.=]{count} Display several lines of text surrounding the line
+ specified with {range}, or around the current line
+ if there is no {range}. If there is a {count}, that's
+ how many lines you'll see; otherwise, the current
+ window size is used.
+
+ :z can be used either alone or followed by any of
+ several punctuation marks. These have the following
+ effect:
+
+ mark first line last line new location ~
+ ---- ---------- --------- ------------
+ + current line 1 scr forward 1 scr forward
+ - 1 scr back current line current line
+ ^ 2 scr back 1 scr back 1 scr back
+ . 1/2 scr back 1/2 scr fwd 1/2 src fwd
+ = 1/2 src back 1/2 scr fwd current line
+
+ Specifying no mark at all is the same as "+".
+ If the mark is "=", a line of dashes is printed
+ around the current line.
+
+:{range}z#[+-^.=]{count} *:z#*
+ Like ":z", but number the lines.
+ {not in all versions of Vi, not with these arguments}
+
+ *:=*
+:= Print the last line number.
+
+:{range}= Prints the last line number in {range}. For example,
+ this prints the current line number: >
+ :.=
+
+:norm[al][!] {commands} *:norm* *:normal*
+ Execute Normal mode commands {commands}. This makes
+ it possible to execute Normal mode commands typed on
+ the command-line. {commands} is executed like it is
+ typed. For undo all commands are undone together.
+ If the [!] is given, mappings will not be used.
+ {commands} should be a complete command. If
+ {commands} does not finish a command, the last one
+ will be aborted as if <Esc> or <C-C> was typed.
+ The display isn't updated while ":normal" is busy.
+ This implies that an insert command must be completed
+ (to start Insert mode, see |:startinsert|). A ":"
+ command must be completed as well.
+ {commands} cannot start with a space. Put a 1 (one)
+ before it, 1 space is one space.
+ The 'insertmode' option is ignored for {commands}.
+ This command cannot be followed by another command,
+ since any '|' is considered part of the command.
+ This command can be used recursively, but the depth is
+ limited by 'maxmapdepth'.
+ When this command is called from a non-remappable
+ mapping |:noremap|, the argument can be mapped anyway.
+ An alternative is to use |:execute|, which uses an
+ expression as argument. This allows the use of
+ printable characters. Example: >
+ :exe "normal \<c-w>\<c-w>"
+< {not in Vi, of course}
+ {not available when the |+ex_extra| feature was
+ disabled at compile time}
+
+:{range}norm[al][!] {commands} *:normal-range*
+ Execute Normal mode commands {commands} for each line
+ in the {range}. Before executing the {commands}, the
+ cursor is positioned in the first column of the range,
+ for each line. Otherwise it's the same as the
+ ":normal" command without a range.
+ {not in Vi}
+ Not available when |+ex_extra| feature was disabled at
+ compile time.
+
+ *:sh* *:shell* *E371*
+:sh[ell] This command starts a shell. When the shell exits
+ (after the "exit" command) you return to Vim. The
+ name for the shell command comes from 'shell' option.
+ *E360*
+ Note: This doesn't work when Vim on the Amiga was
+ started in QuickFix mode from a compiler, because the
+ compiler will have set stdin to a non-interactive
+ mode.
+
+ *:!cmd* *:!* *E34*
+:!{cmd} Execute {cmd} with the shell. See also the 'shell'
+ and 'shelltype' option.
+ Any '!' in {cmd} is replaced with the previous
+ external command (see also 'cpoptions'). But not when
+ there is a backslash before the '!', then that
+ backslash is removed. Example: ":!ls" followed by
+ ":!echo ! \! \\!" executes "echo ls ! \!".
+ After the command has been executed, the timestamp of
+ the current file is checked |timestamp|.
+ There cannot be a '|' in {cmd}, see |:bar|.
+ A newline character ends {cmd}, what follows is
+ interpreted as a following ":" command. However, if
+ there is a backslash before the newline it is removed
+ and {cmd} continues. It doesn't matter how many
+ backslashes are before the newline, only one is
+ removed.
+ On Unix the command normally runs in a non-interactive
+ shell. If you want an interactive shell to be used
+ (to use aliases) set 'shellcmdflag' to "-ic".
+ For Win32 also see |:!start|.
+ Vim redraws the screen after the command is finished,
+ because it may have printed any text. This requires a
+ hit-enter prompt, so that you can read any messages.
+ To avoid this use: >
+ :silent !{cmd}
+< The screen is not redrawn then, thus you have to use
+ CTRL-L or ":redraw!" if the command did display
+ something.
+ Also see |shell-window|.
+
+ *:!!*
+:!! Repeat last ":!{cmd}".
+
+ *:ve* *:version*
+:ve[rsion] Print the version number of the editor. If the
+ compiler used understands "__DATE__" the compilation
+ date is mentioned. Otherwise a fixed release-date is
+ shown.
+ The following lines contain information about which
+ features were enabled when Vim was compiled. When
+ there is a preceding '+', the feature is included,
+ when there is a '-' it is excluded. To change this,
+ you have to edit feature.h and recompile Vim.
+ To check for this in an expression, see |has()|.
+ Here is an overview of the features.
+ The first column shows the smallest version in which
+ they are included:
+ T tiny
+ S small
+ N normal
+ B big
+ H huge
+ m manually enabled or depends on other features
+ (none) system dependent
+ Thus if a feature is marked with "N", it is included
+ in the normal, big and huge versions of Vim.
+
+ *+feature-list*
+ *+ARP* Amiga only: ARP support included
+B *+arabic* |Arabic| language support
+N *+autocmd* |:autocmd|, automatic commands
+m *+balloon_eval* |balloon-eval| support
+N *+browse* |:browse| command
+N *+builtin_terms* some terminals builtin |builtin-terms|
+B *++builtin_terms* maximal terminals builtin |builtin-terms|
+N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
+ and ":goto" commands.
+N *+cindent* |'cindent'|, C indenting
+N *+clientserver* Unix and Win32: Remote invocation |clientserver|
+ *+clipboard* |clipboard| support
+N *+cmdline_compl* command line completion |cmdline-completion|
+N *+cmdline_hist* command line history |cmdline-history|
+N *+cmdline_info* |'showcmd'| and |'ruler'|
+N *+comments* |'comments'| support
+N *+cryptv* encryption support |encryption|
+B *+cscope* |cscope| support
+N *+dialog_gui* Support for |:confirm| with GUI dialog.
+N *+dialog_con* Support for |:confirm| with console dialog.
+N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
+N *+diff* |vimdiff| and 'diff'
+N *+digraphs* |digraphs| *E196*
+ *+dnd* Support for DnD into the "~ register |quote_~|.
+B *+emacs_tags* |emacs-tags| files
+N *+eval* expression evaluation |eval.txt|
+N *+ex_extra* Vim's extra Ex commands: |:center|, |:left|,
+ |:normal|, |:retab| and |:right|
+N *+extra_search* |'hlsearch'| and |'incsearch'| options.
+B *+farsi* |farsi| language
+N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>|
+N *+find_in_path* include file searches: |[I|, |:isearch|,
+ |CTRL-W_CTRL-I|, |:checkpath|, etc.
+N *+folding* |folding|
+ *+footer* |gui-footer|
+ *+fork* Unix only: |fork| shell commands
+N *+gettext* message translations |multi-lang|
+ *+GUI_Athena* Unix only: Athena |GUI|
+ *+GUI_neXtaw* Unix only: neXtaw |GUI|
+ *+GUI_BeOS* BeOS only: BeOS |GUI|
+ *+GUI_GTK* Unix only: GTK+ |GUI|
+ *+GUI_Motif* Unix only: Motif |GUI|
+ *+GUI_Photon* QNX only: Photon |GUI|
+m *+hangul_input* Hangul input support |hangul|
+ *+iconv* Compiled with the |iconv()| function, may have |/dyn|
+N *+insert_expand* |insert_expand| Insert mode completion
+N *+jumplist* |jumplist|
+B *+keymap* |'keymap'|
+B *+langmap* |'langmap'|
+N *+libcall* |libcall()|
+N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'|
+N *+lispindent* |'lisp'|
+N *+listcmds* Vim commands for the list of buffers |buffer-hidden|
+ and argument list |:argdelete|
+N *+localmap* Support for mappings local to a buffer |:map-local|
+N *+menu* |:menu|
+N *+mksession* |:mksession|
+N *+modify_fname* |filename-modifiers|
+N *+mouse* Mouse handling |mouse-using|
+N *+mouseshape* |'mouseshape'|
+B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse|
+N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse|
+B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse|
+N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal|
+N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse|
+B *+multi_byte* Korean and other languages |multibyte|
+ *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
+N *+multi_lang* non-English language support |multi-lang|
+m *+netbeans_intg* |netbeans|
+m *+ole* Win32 GUI only: |ole-interface|
+ *+osfiletype* Support for the 'osfiletype' option and filetype
+ checking in automatic commands. |autocmd-osfiletypes|
+N *+path_extra* Up/downwards search in 'path' and 'tags'
+m *+perl* Perl interface |perl|, may have |/dyn|
+ *+postscript* |:hardcopy| writes a PostScript file
+N *+printer* |:hardcopy| command
+m *+python* Python interface |python|, may have |/dyn|
+N *+quickfix* |:make| and |quickfix| commands
+B *+rightleft* Right to left typing |'rightleft'|
+m *+ruby* Ruby interface |ruby|, may have |/dyn|
+N *+scrollbind* |'scrollbind'|
+B *+signs* |:sign|
+N *+smartindent* |'smartindent'|
+m *+sniff* SniFF interface |sniff|
+N *+statusline* Options 'statusline', 'rulerformat' and special
+ formats of 'titlestring' and 'iconstring'
+m *+sun_workshop* |workshop|
+N *+syntax* Syntax highlighting |syntax|
+ *+system()* Unix only: opposite of |+fork|
+N *+tag_binary* binary searching in tags file |tag-binary-search|
+N *+tag_old_static* old method for static tags |tag-old-static|
+m *+tag_any_white* any white space allowed in tags file |tag-any-white|
+m *+tcl* Tcl interface |tcl|, may have |/dyn|
+ *+terminfo* uses |terminfo| instead of termcap
+N *+termresponse* support for |t_RV| and |v:termresponse|
+N *+textobjects* |text-objects| selection
+ *+tgetent* non-Unix only: able to use external termcap
+N *+title* Setting the window title |'title'|
+N *+toolbar* |gui-toolbar|
+N *+user_commands* User-defined commands. |user-commands|
+N *+viminfo* |'viminfo'|
+N *+vertsplit* Vertically split windows |:vsplit|
+N *+virtualedit* |'virtualedit'|
+S *+visual* Visual mode |Visual-mode|
+N *+visualextra* extra Visual mode commands |blockwise-operators|
+N *+vreplace* |gR| and |gr|
+N *+wildignore* |'wildignore'|
+N *+wildmenu* |'wildmenu'|
+S *+windows* more than one window
+m *+writebackup* |'writebackup'| is default on
+m *+xim* X input method |xim|
+ *+xfontset* X fontset support |xfontset|
+ *+xsmp* XSMP (X session management) support
+ *+xsmp_interact* interactive XSMP (X session management) support
+N *+xterm_clipboard* Unix only: xterm clipboard handling
+m *+xterm_save* save and restore xterm screen |xterm-screens|
+N *+X11* Unix only: can restore window title |X11|
+
+ */dyn* *E370* *E448*
+ To some of the features "/dyn" is added when the
+ feature is only available when the related library can
+ be dynamically loaded.
+
+:ve[rsion] {nr} Is now ignored. This was previously used to check the
+ version number of a .vimrc file. It was removed,
+ because you can now use the ":if" command for
+ version-dependent behavior. {not in Vi}
+
+ *:redi* *:redir*
+:redi[r][!] > {file} Redirect messages to file {file}. The messages which
+ are the output of commands are written to that file,
+ until redirection ends. The messages are also still
+ shown on the screen. When [!] is included, an
+ existing file is overwritten. When [!] is omitted,
+ and {file} exists, this command fails.
+ Only one ":redir" can be active at a time. Calls to
+ ":redir" will close any active redirection before
+ starting redirection to the new target.
+ To stop the messages and commands from being echoed to
+ the screen, put the commands in a function and call it
+ with ":silent call Function()".
+ {not in Vi}
+
+:redi[r] >> {file} Redirect messages to file {file}. Append if {file}
+ already exists. {not in Vi}
+
+:redi[r] @{a-zA-Z} Redirect messages to register {a-z}. Append to the
+ contents of the register if its name is given
+ uppercase {A-Z}. {not in Vi}
+
+:redi[r] @* Redirect messages to the clipboard. {not in Vi}
+
+:redi[r] @" Redirect messages to the unnamed register. {not in Vi}
+
+:redi[r] END End redirecting messages. {not in Vi}
+
+ *:sil* *:silent*
+:sil[ent][!] {command} Execute {command} silently. Normal messages will not
+ be given or added to the message history.
+ When [!] is added, error messages will also be
+ skipped, and commands and mappings will not be aborted
+ when an error is detected. |v:errmsg| is still set.
+ When [!] is not used, an error message will cause
+ further messages to be displayed normally.
+ Redirection, started with |:redir|, will continue as
+ usual, although there might be small differences.
+ This will allow redirecting the output of a command
+ without seeing it on the screen. Example: >
+ :redir >/tmp/foobar
+ :silent g/Aap/p
+ :redir END
+< To execute a Normal mode command silently, use the
+ |:normal| command. For example, to search for a
+ string without messages: >
+ :silent exe "normal /path\<CR>"
+< ":silent!" is useful to execute a command that may
+ fail, but the failure is to be ignored. Example: >
+ :let v:errmsg = ""
+ :silent! /^begin
+ :if v:errmsg != ""
+ : ... pattern was not found
+< ":silent" will also avoid the hit-enter prompt. When
+ using this for an external command, this may cause the
+ screen to be messed up. Use |CTRL-L| to clean it up
+ then.
+ ":silent menu ..." defines a menu that will not echo a
+ Command-line command. The command will still produce
+ messages though. Use ":silent" in the command itself
+ to avoid that: ":silent menu .... :silent command".
+
+ *:verb* *:verbose*
+:[count]verb[ose] {command}
+ Execute {command} with 'verbose' set to [count]. If
+ [count] is omitted one is used.
+ The additional use of ":silent" makes messages
+ generated but not displayed.
+ The combination of ":silent" and ":verbose" can be
+ used to generate messages and check them with
+ |v:statusmsg| and friends. For example: >
+ :let v:statusmsg = ""
+ :silent verbose runtime foobar.vim
+ :if v:statusmsg != ""
+ : " foobar.vim could not be found
+ :endif
+< When concatenating another command, the ":verbose"
+ only applies to the first one: >
+ :4verbose set verbose | set verbose
+< verbose=4 ~
+ verbose=0 ~
+
+ *K*
+K Run a program to lookup the keyword under the
+ cursor. The name of the program is given with the
+ 'keywordprg' (kp) option (default is "man"). The
+ keyword is formed of letters, numbers and the
+ characters in 'iskeyword'. The keyword under or
+ right of the cursor is used. The same can be done
+ with the command >
+ :!{program} {keyword}
+< There is an example of a program to use in the tools
+ directory of Vim. It is called 'ref' and does a
+ simple spelling check.
+ Special cases:
+ - If 'keywordprg' is empty, the ":help" command is
+ used. It's a good idea to include more characters
+ in 'iskeyword' then, to be able to find more help.
+ - When 'keywordprg' is equal to "man", a count before
+ "K" is inserted after the "man" command and before
+ the keyword. For example, using "2K" while the
+ cursor is on "mkdir", results in: >
+ !man 2 mkdir
+< - When 'keywordprg' is equal to "man -s", a count
+ before "K" is inserted after the "-s". If there is
+ no count, the "-s" is removed.
+ {not in Vi}
+
+ *v_K*
+{Visual}K Like "K", but use the visually highlighted text for
+ the keyword. Only works when the highlighted text is
+ not more than one line. {not in Vi}
+
+[N]gs *gs* *:sl* *:sleep*
+:[N]sl[eep] [N] [m] Do nothing for [N] seconds. When [m] is included,
+ sleep for [N] milliseconds. The count for "gs" always
+ uses seconds. The default is one second. >
+ :sleep "sleep for one second
+ :5sleep "sleep for five seconds
+ :sleep 100m "sleep for a hundred milliseconds
+ 10gs "sleep for ten seconds
+< Can be interrupted with CTRL-C (CTRL-Break on MS-DOS).
+ "gs" stands for "goto sleep". While sleeping the
+ cursor is positioned in the text (if visible). {not
+ in Vi}
+
+ *g_CTRL-A*
+g CTRL-A Only when Vim was compiled with MEM_PROFILING defined
+ (which is very rare): print memory usage statistics.
+ Only useful for debugging Vim.
+
+==============================================================================
+2. Online help *online-help*
+
+ *help* *<Help>* *:h* *:help* *<F1>* *i_<F1>* *i_<Help>*
+<Help> or
+:h[elp] Open a window and display the help file in read-only
+ mode. If there is a help window open already, use
+ that one. Otherwise, if the current window uses the
+ full width of the screen or is at least 80 characters
+ wide, the help window will appear just above the
+ current window. Otherwise the new window is put at
+ the very top.
+ The 'helplang' option is used to select a language, if
+ the main help file is available in several languages.
+ {not in Vi}
+
+ *{subject}* *E149* *E661*
+:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
+ {subject} can include wildcards like "*", "?" and
+ "[a-z]":
+ :help z? jump to help for any "z" command
+ :help z. jump to the help for "z."
+ If there is no full match for the pattern, or there
+ are several matches, the "best" match will be used.
+ A sophisticated algorithm is used to decide which
+ match is better than another one. These items are
+ considered in the computation:
+ - A match with same case is much better than a match
+ with different case.
+ - A match that starts after a non-alphanumeric
+ character is better than a match in the middle of a
+ word.
+ - A match at or near the beginning of the tag is
+ better than a match further on.
+ - The more alphanumeric characters match, the better.
+ - The shorter the length of the match, the better.
+
+ The 'helplang' option is used to select a language, if
+ the {subject} is available in several languages.
+ To find a tag in a specific language, append "@ab",
+ where "ab" is the two-letter language code. See
+ |help-translated|.
+
+ Note that the longer the {subject} you give, the less
+ matches will be found. You can get an idea how this
+ all works by using commandline completion (type CTRL-D
+ after ":help subject").
+ If there are several matches, you can have them listed
+ by hitting CTRL-D. Example: >
+ :help cont<Ctrl-D>
+< To use a regexp |pattern|, first do ":help" and then
+ use ":tag {pattern}" in the help window. The
+ ":tnext" command can then be used to jump to other
+ matches, "tselect" to list matches and choose one. >
+ :help index| :tse z.
+< This command can be followed by '|' and another
+ command, but you don't need to escape the '|' inside a
+ help command. So these both work: >
+ :help |
+ :help k| only
+< Note that a space before the '|' is seen as part of
+ the ":help" argument.
+ You can also use <LF> or <CR> to separate the help
+ command from a following command. You need to type
+ CTRL-V first to insert the <LF> or <CR>. Example: >
+ :help so<C-V><CR>only
+< {not in Vi}
+
+:h[elp]! [subject] Like ":help", but in non-English help files prefer to
+ find a tag in a file with the same language as the
+ current file. See |help-translated|.
+
+ *:helpg* *:helpgrep*
+:helpg[rep] {pattern}
+ Search all help text files and make a list of lines
+ in which {pattern} matches. Jumps to the first match.
+ You can navigate through the matches with the
+ |quickfix| commands, e.g., |:cnext| to jump to the
+ next one. Or use |:cwindow| to get the list of
+ matches in the quickfix window.
+ {pattern} is used as a Vim regexp |pattern|.
+ 'ignorecase' is not used, add "\c" to ignore case.
+ Example for case sensitive search: >
+ :helpgrep Uganda
+< Example for case ignoring search: >
+ :helpgrep uganda\c
+< Cannot be followed by another command, everything is
+ used as part of the pattern. But you can use
+ |:execute| when needed.
+ Compressed help files will not be searched (Debian
+ compresses the help files).
+ {not in Vi}
+
+
+When no argument is given to |:help| the file given with the 'helpfile' option
+will be opened. Otherwise the specified tag is searched for in all "doc/tags"
+files in the directories specified in the 'runtimepath' option.
+
+The initial height of the help window can be set with the 'helpheight' option
+(default 20).
+
+Jump to specific subjects by using tags. This can be done in two ways:
+- Use the "CTRL-]" command while standing on the name of a command or option.
+ This only works when the tag is a keyword. "<C-Leftmouse>" and
+ "g<LeftMouse>" work just like "CTRL-]".
+- use the ":ta {subject}" command. This also works with non-keyword
+ characters.
+
+Use CTRL-T or CTRL-O to jump back.
+Use ":q" to close the help window.
+
+If there are several matches for an item you are looking for, this is how you
+can jump to each one of them:
+1. Open a help window
+2. Use the ":tag" command with a slash prepended to the tag. E.g.: >
+ :tag /min
+3. Use ":tnext" to jump to the next matching tag.
+
+It is possible to add help files for plugins and other items. You don't need
+to change the distributed help files for that. See |add-local-help|.
+
+To write a local help file, see |write-local-help|.
+
+Note that the title lines from the local help files are automagically added to
+the "LOCAL ADDITIONS" section in the "help.txt" help file |local-additions|.
+This is done when viewing the file in Vim, the file itself is not changed. It
+is done by going through all help files and obtaining the first line of each
+file. The files in $VIMRUNTIME/doc are skipped.
+
+ *help-xterm-window*
+If you want to have the help in another xterm window, you could use this
+command: >
+ :!xterm -e vim +help &
+<
+
+ *:helpfind* *:helpf*
+:helpf[ind] Like |:help|, but use a dialog to enter the argument.
+ Only for backwards compatibility. It now executes the
+ ToolBar.FindHelp menu entry instead of using a builtin
+ dialog. {only when compiled with |+GUI_GTK|}
+< {not in Vi}
+
+ *:helpt* *:helptags*
+ *E154* *E150* *E151* *E152* *E153* *E670*
+:helpt[ags] {dir} Generate the help tags file(s) for directory {dir}.
+ All "*.txt" and "*.??x" files in the directory are
+ scanned for a help tag definition in between stars.
+ The "*.??x" files are for translated docs, they
+ generate the "tags-??" file, see |help-translated|.
+ The generated tags files are sorted.
+ When there are duplicates an error message is given.
+ An existing tags file is silently overwritten.
+ To rebuild the help tags in the runtime directory
+ (requires write permission there): >
+ :helptags $VIMRUNTIME/doc
+< {not in Vi}
+
+
+TRANSLATED HELP *help-translated*
+
+It is possible to add translated help files, next to the original English help
+files. Vim will search for all help in "doc" directories in 'runtimepath'.
+This is only available when compiled with the |+multi_lang| feature.
+
+A set of translated help files consists of these files:
+
+ help.abx
+ howto.abx
+ ...
+ tags-ab
+
+"ab" is the two-letter language code. Thus for Italian the names are:
+
+ help.itx
+ howto.itx
+ ...
+ tags-it
+
+The 'helplang' option can be set to the preferred language(s). The default is
+set according to the environment. Vim will first try to find a matching tag
+in the preferred language(s). English is used when it cannot be found.
+
+To find a tag in a specific language, append "@ab" to a tag, where "ab" is the
+two-letter language code. Example: >
+ :he user-manual@it
+ :he user-manual@en
+The first one finds the Italian user manual, even when 'helplang' is empty.
+The second one finds the English user manual, even when 'helplang' is set to
+"it".
+
+When using command-line completion for the ":help" command, the "@en"
+extention is only shown when a tag exists for multiple languages. When the
+tag only exists for English "@en" is omitted.
+
+When using |CTRL-]| or ":help!" in a non-English help file Vim will try to
+find the tag in the same language. If not found then 'helplang' will be used
+to select a language.
+
+Help files must use latin1 or utf-8 encoding. Vim assumes the encoding is
+utf-8 when finding non-ASCII characters in the first line. Thus you must
+translate the header with "For Vim version".
+
+The same encoding must be used for the help files of one language in one
+directory. You can use a different encoding for different languages and use
+a different encoding for help files of the same language but in a different
+directory.
+
+Hints for translators:
+- Do not translate the tags. This makes it possible to use 'helplang' to
+ specify the preferred language. You may add new tags in your language.
+- When you do not translate a part of a file, add tags to the English version,
+ using the "tag@en" notation.
+- Make a package with all the files and the tags file available for download.
+ Users can drop it in one of the "doc" directories and start use it.
+ Report this to Bram, so that he can add a link on www.vim.org.
+- Use the |:helptags| command to generate the tags files. It will find all
+ languages in the specified directory.
+
+==============================================================================
+3. Printing *printing*
+
+On MS-Windows Vim can print your text on any installed printer. On other
+systems a PostScript file is produced. This can be directly sent to a
+PostScript printer. For other printers a program like ghostscript needs to be
+used.
+
+3.1 PostScript Printing |postscript-printing|
+3.2 PostScript Printing Encoding |postscript-print-encoding|
+3.3 PostScript Printing Troubleshooting |postscript-print-trouble|
+3.4 PostScript Utilities |postscript-print-util|
+3.5 Formfeed Characters |printing-formfeed|
+
+{not in Vi}
+{only available when compiled with |+printer| feature}
+
+ *:ha* *:hardcopy* *E237* *E238* *E324*
+:[range]ha[rdcopy][!] [arguments]
+ Send [range] lines (default whole file) to the
+ printer.
+
+ On MS-Windows a dialog is displayed to allow selection
+ of printer, paper size etc. To skip the dialog, use
+ the [!]. In this case the printer defined by
+ 'printdevice' is used, or, if 'printdevice' is empty,
+ the system default printer.
+
+ For systems other than MS-Windows, PostScript is
+ written in a temp file and 'printexpr' is used to
+ actually print it. Then [arguments] can be used by
+ 'printexpr' through |v:cmdarg|. Otherwise [arguments]
+ is ignored. 'printoptions' can be used to specify
+ paper size, duplex, etc.
+
+:[range]ha[rdcopy][!] >{filename}
+ As above, but write the resulting PostScript in file
+ {filename}.
+ Things like "%" are expanded |cmdline-special|
+ Careful: An existing file is silently overwritten.
+ {only available when compiled with the |+postscript|
+ feature}
+ On MS-Windows use the "print to file" feature of the
+ printer driver.
+
+Progress is displayed during printing as a page number and a percentage. To
+abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
+
+Printer output is controlled by the 'printfont' and 'printoptions' options.
+'printheader' specifies the format of a page header.
+
+The printed file is always limited to the selected margins, irrespective of
+the current window's 'wrap' or 'linebreak' settings. The "wrap" item in
+'printoptions' can be used to switch wrapping off.
+The current highlighting colors are used in the printout, with the following
+considerations:
+1) The normal background is always rendered as white (i.e. blank paper.)
+2) White text or the default foreground is rendered as black, so that it shows
+ up!
+3) If 'background' is "dark", then the colours are darkened to compensate for
+ the fact that otherwise they would be too bright to show up clearly on
+ white paper.
+
+
+3.1 PostScript Printing *postscript-printing*
+ *E455* *E456* *E457* *E624*
+Provided you have enough disk space there should be no problems generating a
+PostScript file. You need to have the runtime files correctly installed (if
+you can find the help files, they probably are).
+
+There are currently a number of limitations with PostScript printing:
+
+- 'printfont' - The font name is ignored (the Courier family is always used -
+ it should be available on all PostScript printers) but the font size is
+ used.
+
+- 'printoptions' - The duplex setting is used when generating PostScript
+ output, but it is up to the printer to take notice of the setting. If the
+ printer does not support duplex printing then it should be silently ignored.
+ Some printers, however, don't print at all.
+
+- 8-bit support - While a number of 8-bit print character encodings are
+ supported it is possible that some characters will not print. Whether a
+ character will print depends on the font in the printer knowing the
+ character. Missing characters will be replaced with an upside down question
+ mark, or a space if that character is also not known by the font. It may be
+ possible to get all the characters in an encoding to print by installing a
+ new version of the Courier font family.
+
+- Multi-byte support - Currently VIM will try to convert multi-byte characters
+ to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
+ empty). Any characters that are not successfully converted are shown as
+ unknown characters. Printing will fail if VIM cannot convert the multi-byte
+ to the 8-bit encoding.
+
+
+3.2 Custom 8-bit Print Character Encodings *postscript-print-encoding*
+ *E618* *E619*
+To use your own print character encoding when printing 8-bit character data
+you need to define your own PostScript font encoding vector. Details on how
+to to define a font encoding vector is beyond the scope of this help file, but
+you can find details in the PostScript Language Reference Manual, 3rd Edition,
+published by Addison-Wesley and available in PDF form at
+http://www.adobe.com/. The following describes what you need to do for VIM to
+locate and use your print character encoding.
+
+i. Decide on a unique name for your encoding vector, one that does not clash
+ with any of the recognized or standard encoding names that VIM uses (see
+ |encoding-names| for a list), and that no one else is likely to use.
+ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
+ 'runtimepath' and rename it with your unique name.
+iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
+ with your unique name (don't forget the line starting %%Title:), and
+ modify the array of glyph names to define your new encoding vector. The
+ array must have exactly 256 entries or you will not be able to print!
+iv. Within VIM, set 'printencoding' to your unique encoding name and then
+ print your file. VIM will now use your custom print character encoding.
+
+VIM will report an error with the resource file if you change the order or
+content of the first 3 lines, other than the name of the encoding on the line
+starting %%Title: or the version number on the line starting %%Version:.
+
+[Technical explanation for those that know PostScript - VIM looks for a file
+with the same name as the encoding it will use when printing. The file
+defines a new PostScript Encoding resource called /VIM-name, where name is the
+print character encoding VIM will use.]
+
+
+3.3 PostScript Printing Troubleshooting *postscript-print-trouble*
+ *E621*
+Usually the only sign of a problem when printing with PostScript is that your
+printout does not appear. If you are lucky you may get a printed page that
+tells you the PostScript operator that generated the error that prevented the
+print job completing.
+
+There are a number of possible causes as to why the printing may have failed:
+
+- Wrong version of the prolog resource file. The prolog resource file
+ contains some PostScript that VIM needs to be able to print. Each version
+ of VIM needs one particular version. Make sure you have correctly installed
+ the runtime files, and don't have any old versions of a file called prolog
+ in the print directory in your 'runtimepath' directory.
+
+- Paper size. Some PostScript printers will abort printing a file if they do
+ not support the requested paper size. By default VIM uses A4 paper. Find
+ out what size paper your printer normally uses and set the appropriate paper
+ size with 'printoptions'. If you cannot find the name of the paper used,
+ measure a sheet and compare it with the table of supported paper sizes listed
+ for 'printoptions', using the paper that is closest in both width AND height.
+ Note: The dimensions of actual paper may vary slightly from the ones listed.
+ If there is no paper listed close enough, then you may want to try psresize
+ from PSUtils, discussed below.
+
+- Two-sided printing (duplex). Normally a PostScript printer that does not
+ support two-sided printing will ignore any request to do it. However, some
+ printers may abort the job altogether. Try printing with duplex turned off.
+ Note: Duplex prints can be achieved manually using PS utils - see below.
+
+- Collated printing. As with Duplex printing, most PostScript printers that
+ do not support collating printouts will ignore a request to do so. Some may
+ not. Try printing with collation turned off.
+
+- Syntax highlighting. Some print management code may prevent the generated
+ PostScript file from being printed on a black and white printer when syntax
+ highlighting is turned on, even if solid black is the only color used. Try
+ printing with syntax highlighting turned off.
+
+A safe printoptions setting to try is: >
+
+ :set printoptions=paper:A4,duplex:off,collate:n,syntax:n
+
+Replace "A4" with the paper size that best matches your printer paper.
+
+
+3.4 PostScript Utilities *postscript-print-util*
+
+3.4.1 Ghostscript
+
+Ghostscript is a PostScript and PDF interpreter that can be used to display
+and print on non-PostScript printers PostScript and PDF files. It can also
+generate PDF files from PostScript.
+
+Ghostscript will run on a wide variety of platforms.
+
+There are three available versions:
+
+- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
+ non-commercial use. It can be obtained from:
+
+ http://www.cs.wisc.edu/~ghost/
+
+- GNU Ghostscript which is available under the GNU General Public License. It
+ can be obtained from:
+
+ ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
+
+- A commercial version for inclusion in commercial products.
+
+Additional information on Ghostscript can also be found at:
+
+ http://www.ghostscript.com/
+
+Support for a number of non PostScript printers is provided in the
+distribution as standard, but if you cannot find support for your printer
+check the Ghostscript site for other printers not included by default.
+
+
+3.4.2 Ghostscript Previewers.
+
+The interface to Ghostscript is very primitive so a number of graphical front
+ends have been created. These allow easier PostScript file selection,
+previewing at different zoom levels, and printing. Check supplied
+documentation for full details.
+
+X11
+
+- Ghostview. Obtainable from:
+
+ http://www.cs.wisc.edu/~ghost/gv/
+
+- gv. Derived from Ghostview. Obtainable from:
+
+ http://wwwthep.physik.uni-mainz.de/~plass/gv/
+
+ Copies (possibly not the most recent) can be found at:
+
+ http://www.cs.wisc.edu/~ghost/gv/
+
+OpenVMS
+
+- Is apparently supported in the main code now (untested). See:
+
+ http://wwwthep.physik.uni-mainz.de/~plass/gv/
+
+Windows and OS/2
+
+- GSview. Obtainable from:
+
+ http://www.cs.wisc.edu/~ghost/gsview/
+
+DOS
+
+- ps_view. Obtainable from:
+
+ ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
+ ftp://ftp.dante.de/tex-archive/support/ps_view/
+
+Linux
+
+- GSview. Linux version of the popular Windows and OS/2 previewer.
+ Obtainable from:
+
+ http://www.cs.wisc.edu/~ghost/gsview/
+
+- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
+ Obtainable from:
+
+ ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
+
+
+3.4.3 PSUtils
+
+PSUtils is a collection of utility programs for manipulating PostScript
+documents. Binary distributions are available for many platforms, as well as
+the full source. PSUtils can be found at:
+
+ http://knackered.org/angus/psutils
+
+The utilities of interest include:
+
+- psnup. Convert PS files for N-up printing.
+- psselect. Select page range and order of printing.
+- psresize. Change the page size.
+- psbook. Reorder and lay out pages ready for making a book.
+
+The output of one program can be used as the input to the next, allowing for
+complex print document creation.
+
+
+N-UP PRINTING
+
+The psnup utility takes an existing PostScript file generated from VIM and
+convert it to an n-up version. The simplest way to create a 2-up printout is
+to first create a PostScript file with: >
+
+ :hardcopy > test.ps
+
+Then on your command line execute: >
+
+ psnup -n 2 test.ps final.ps
+
+Note: You may get warnings from some Ghostscript previewers for files produced
+by psnup - these may safely be ignored.
+
+Finally print the file final.ps to your PostScript printer with your
+platform's print command. (You will need to delete the two PostScript files
+afterwards yourself.) 'printexpr' could be modified to perform this extra
+step before printing.
+
+
+ALTERNATE DUPLEX PRINTING
+
+It is possible to achieve a poor man's version of duplex printing using the PS
+utility psselect. This utility has options -e and -o for printing just the
+even or odd pages of a PS file respectively.
+
+First generate a PS file with the 'hardcopy' command, then generate a new
+files with all the odd and even numbered pages with: >
+
+ psselect -o test.ps odd.ps
+ psselect -e test.ps even.ps
+
+Next print odd.ps with your platform's normal print command. Then take the
+print output, turn it over and place it back in the paper feeder. Now print
+even.ps with your platform's print command. All the even pages should now
+appear on the back of the odd pages.
+
+There a couple of points to bear in mind:
+
+1. Position of the first page. If the first page is on top of the printout
+ when printing the odd pages then you need to reverse the order that the odd
+ pages are printed. This can be done with the -r option to psselect. This
+ will ensure page 2 is printed on the back of page 1.
+ Note: it is better to reverse the odd numbered pages rather than the even
+ numbered in case there are an odd number of pages in the original PS file.
+
+2. Paper flipping. When turning over the paper with the odd pages printed on
+ them you may have to either flip them horizontally (along the long edge) or
+ vertically (along the short edge), as well as possibly rotating them 180
+ degrees. All this depends on the printer - it will be more obvious for
+ desktop ink jets than for small office laser printers where the paper path
+ is hidden from view.
+
+
+3.5 Formfeed Characters *printing-formfeed*
+
+By default VIM does not do any special processing of |formfeed| control
+characters. Setting the 'printoptions' formfeed item will make VIM recognize
+formfeed characters and continue printing the current line at the beginning
+of the first line on a new page. The use of formfeed characters provides
+rudimentary print control but there are certain things to be aware of.
+
+VIM will always start printing a line (including a line number if enabled)
+containing a formfeed character, even if it is the first character on the
+line. This means if a line starting with a formfeed character is the first
+line of a page then VIM will print a blank page.
+
+Since the line number is printed at the start of printing the line containing
+the formfeed character, the remainder of the line printed on the new page
+will not have a line number printed for it (in the same way as the wrapped
+lines of a long line when wrap in 'printoptions' is enabled).
+
+If the formfeed character is the last character on a line, then printing will
+continue on the second line of the new page, not the first. This is due to
+VIM processing the end of the line after the formfeed character and moving
+down a line to continue printing.
+
+Due to the points made above it is recommended that when formfeed character
+processing is enabled, printing of line numbers is disabled, and that form
+feed characters are not the last character on a line. Even then you may need
+to adjust the number of lines before a formfeed character to prevent
+accidental blank pages.
+
+==============================================================================
+4. Using Vim like less or more *less*
+
+If you use the less or more program to view a file, you don't get syntax
+highlighting. Thus you would like to use Vim instead. You can do this by
+using the shell script "$VIMRUNTIME/macros/less.sh".
+
+This shell script uses the Vim script "$VIMRUNTIME/macros/less.vim". It sets
+up mappings to simulate the commands that less supports. Otherwise, you can
+still use the Vim commands.
+
+This isn't perfect. For example, when viewing a short file Vim will still use
+the whole screen. But it works good enough for most uses, and you get syntax
+highlighting.
+
+The "h" key will give you a short overview of the available commands.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/version4.txt b/runtime/doc/version4.txt
new file mode 100644
index 000000000..f3f760f9b
--- /dev/null
+++ b/runtime/doc/version4.txt
@@ -0,0 +1,355 @@
+*version4.txt* For Vim version 7.0aa. Last change: 2004 Mar 12
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+This document lists the incompatible differences between Vim 3.0 and Vim 4.0.
+Although 4.0 is mentioned here, this is also for version 4.1, 4.2, etc..
+
+This file is important for everybody upgrading from Vim 3.0. Read it
+carefully to avoid unexpected problems.
+
+'backup' option default changed |backup-changed|
+Extension for backup file changed |backup-extension|
+Structure of swap file changed |swapfile-changed|
+"-w scriptout" argument changed |scriptout-changed|
+Backspace and Delete keys |backspace-delete|
+Escape for | changed |escape-bar|
+Key codes changed |key-codes-changed|
+Terminal options changed |termcap-changed|
+'errorformat' option changed |errorformat-changed|
+'graphic' option gone |graphic-option-gone|
+'yankendofline' option gone |ye-option-gone|
+'icon' and 'title' default value changed |icon-changed|
+'highlight' option changed |highlight-changed|
+'tildeop' and 'weirdinvert' short names changed |short-name-changed|
+Use of "v", "V" and "CTRL-V" in Visual mode |use-visual-cmds|
+CTRL-B in Insert mode removed |toggle-revins|
+
+
+'backup' option default changed *backup-changed*
+-------------------------------
+
+The default value for 'backup' used to be on. This resulted in a backup file
+being made when the original file was overwritten.
+
+Now the default for 'backup' is off. As soon as the writing of the file has
+successfully finished, the backup file is deleted. If you want to keep the
+backup file, set 'backup' on in your vimrc. The reason for this change is
+that many people complained that leaving a backup file behind is not
+Vi-compatible. |'backup'|
+
+
+Extension for backup file changed *backup-extension*
+---------------------------------
+
+The extension for the backup file used to be ".bak". Since other programs
+also use this extension and some users make copies with this extension, it was
+changed to the less obvious "~". Another advantage is that this takes less
+space, which is useful when working on a system with short file names. For
+example, on MS-DOS the backup files for "longfile.c" and "longfile.h" would
+both become "longfile.bak"; now they will be "longfile.c~" and "longfile.h~".
+
+If you prefer to use ".bak", you can set the 'backupext' option: >
+ :set bex=.bak
+
+
+Structure of swap file changed *swapfile-changed*
+------------------------------
+
+The contents of the swap file were extended with several parameters. Vim
+stores the user name and other information about the edited file to make
+recovery more easy and to be able to know where the swap file comes from. The
+first part of the swap file can now be understood on a machine with a
+different byte order or sizeof(int). When you try to recover a file on such a
+machine, you will get an error message that this is not possible.
+
+Because of this change, swap files cannot be exchanged between 3.0 and 4.0.
+If you have a swap file from a crashed session with 3.0, use Vim 3.0 to
+recover the file---don't use 4.0. |swap-file|
+
+
+"-w scriptout" argument changed *scriptout-changed*
+-------------------------------
+
+"vim -w scriptout" used to append to the scriptout file. Since this was
+illogical, it now creates a new file. An existing file is not overwritten
+(to avoid destroying an existing file for those who rely on the appending).
+[This was removed again later] |-w|
+
+
+Backspace and Delete keys *backspace-delete*
+-------------------------
+
+In 3.0 both the delete key and the backspace key worked as a backspace in
+insert mode; they deleted the character to the left of the cursor. In 4.0 the
+delete key has a new function: it deletes the character under the cursor, just
+like it does on the command-line. If the cursor is after the end of the line
+and 'bs' is set, two lines are joined. |<Del>| |i_<Del>|
+
+In 3.0 the backspace key was always defined as CTRL-H and delete as CTRL-?.
+In 4.0 the code for the backspace and delete key is obtained from termcap or
+termlib, and adjusted for the "stty erase" value on Unix. This helps people
+who define the erase character according to the keyboard they are working on.
+ |<BS>| |i_<BS>|
+
+If you prefer backspace and delete in Insert mode to have the old behavior,
+put this line in your vimrc:
+
+ inoremap ^? ^H
+
+And you may also want to add these, to fix the values for <BS> and <Del>:
+
+ set t_kb=^H
+ set t_kD=^?
+
+(Enter ^H with CTRL-V CTRL-H and ^? with CTRL-V CTRL-? or <Del>.)
+
+If the value for t_kb is correct, but the t_kD value is not, use the ":fixdel"
+command. It will set t_kD according to the value of t_kb. This is useful if
+you are using several different terminals. |:fixdel|
+
+When ^H is not recognized as <BS> or <Del>, it is used like a backspace.
+
+
+Escape for | changed *escape-bar*
+--------------------
+
+When the 'b' flag is present in 'cpoptions', the backslash cannot be used to
+escape '|' in mapping and abbreviate commands, only CTRL-V can. This is
+Vi-compatible. If you work in Vi-compatible mode and had used "\|" to include
+a bar in a mapping, this needs to be replaced by "^V|". See |:bar|.
+
+
+Key codes changed *key-codes-changed*
+-----------------
+
+The internal representation of key codes has changed dramatically. In 3.0 a
+one-byte code was used to represent a key. This caused problems with
+different characters sets that also used these codes. In 4.0 a three-byte
+code is used that cannot be confused with a character. |key-notation|
+
+If you have used the single-byte key codes in your vimrc for mappings, you
+will have to replace them with the 4.0 codes. Instead of using the three-byte
+code directly, you should use the symbolic representation for this in <>. See
+the table below. The table also lists the old name, as it was used in the 3.0
+documentation.
+
+The key names in <> can be used in mappings directly. This makes it possible
+to copy/paste examples or type them literally. The <> notation has been
+introduced for this |<>|. The 'B' and '<' flags must not be present in
+'cpoptions' to enable this to work |'cpoptions'|.
+
+old name new name old code old MS-DOS code ~
+ hex dec hex dec ~
+<ESC> <Esc>
+<TAB> <Tab>
+<LF> <NL> <NewLine> <LineFeed>
+<SPACE> <Space>
+<NUL> <Nul>
+<BELL> <Bell>
+<BS> <BS> <BackSpace>
+<INSERT> <Insert>
+<DEL> <Del> <Delete>
+<HOME> <Home>
+<END> <End>
+<PAGE_UP> <PageUp>
+<PAGE_DOWN> <PageDown>
+
+<C_UP> <Up> 0x80 128 0xb0 176
+<C_DOWN> <Down> 0x81 129 0xb1 177
+<C_LEFT> <Left> 0x82 130 0xb2 178
+<C_RIGHT> <Right> 0x83 131 0xb3 179
+<SC_UP> <S-Up> 0x84 132 0xb4 180
+<SC_DOWN> <S-Down> 0x85 133 0xb5 181
+<SC_LEFT> <S-Left> 0x86 134 0xb6 182
+<SC_RIGHT> <S-Right> 0x87 135 0xb7 183
+
+<F1> <F1> 0x88 136 0xb8 184
+<F2> <F2> 0x89 137 0xb9 185
+<F3> <F3> 0x8a 138 0xba 186
+<F4> <F4> 0x8b 139 0xbb 187
+<F5> <F5> 0x8c 140 0xbc 188
+<F6> <F6> 0x8d 141 0xbd 189
+<F7> <F7> 0x8e 142 0xbe 190
+<F8> <F8> 0x8f 143 0xbf 191
+<F9> <F9> 0x90 144 0xc0 192
+<F10> <F10> 0x91 145 0xc1 193
+
+<SF1> <S-F1> 0x92 146 0xc2 194
+<SF2> <S-F2> 0x93 147 0xc3 195
+<SF3> <S-F3> 0x94 148 0xc4 196
+<SF4> <S-F4> 0x95 149 0xc5 197
+<SF5> <S-F5> 0x96 150 0xc6 198
+<SF6> <S-F6> 0x97 151 0xc7 199
+<SF7> <S-F7> 0x98 152 0xc8 200
+<SF8> <S-F8> 0x99 153 0xc9 201
+<SF9> <S-F9> 0x9a 154 0xca 202
+<SF10> <S-F10> 0x9b 155 0xcb 203
+
+<HELP> <Help> 0x9c 156 0xcc 204
+<UNDO> <Undo> 0x9d 157 0xcd 205
+
+ (not used) 0x9e 158 0xce 206
+ (not used) 0x9f 159 0xcf 207
+
+
+Terminal options changed *termcap-changed*
+------------------------
+
+The names of the terminal options have been changed to match the termcap names
+of these options. All terminal options now have the name t_xx, where xx is
+the termcap name. Normally these options are not used, unless you have a
+termcap entry that is wrong or incomplete, or you have set the highlight
+options to a different value. |terminal-options|
+
+Note that for some keys there is no termcap name. Use the <> type of name
+instead, which is a good idea anyway.
+
+Note that "t_ti" has become "t_mr" (invert/reverse output) and "t_ts" has
+become "t_ti" (init terminal mode). Be careful when you use "t_ti"!
+
+old name new name meaning ~
+t_cdl t_DL delete number of lines *t_cdl*
+t_ci t_vi cursor invisible *t_ci*
+t_cil t_AL insert number of lines *t_cil*
+t_cm t_cm move cursor
+t_cri t_RI cursor number of chars right *t_cri*
+t_cv t_ve cursor visible *t_cv*
+t_cvv t_vs cursor very visible *t_cvv*
+t_dl t_dl delete line
+t_cs t_cs scroll region
+t_ed t_cl clear display *t_ed*
+t_el t_ce clear line *t_el*
+t_il t_al insert line *t_il*
+ t_da display may be retained above the screen
+ t_db display may be retained below the screen
+t_ke t_ke put terminal out of keypad transmit mode
+t_ks t_ks put terminal in keypad transmit mode
+t_ms t_ms save to move cursor in highlight mode
+t_se t_se normal mode (undo t_so)
+t_so t_so shift out (standout) mode
+t_ti t_mr reverse highlight
+t_tb t_md bold mode *t_tb*
+t_tp t_me highlight end *t_tp*
+t_sr t_sr scroll reverse
+t_te t_te out of termcap mode
+t_ts t_ti into termcap mode *t_ts_old*
+t_vb t_vb visual bell
+t_csc t_CS cursor is relative to scroll region *t_csc*
+
+t_ku t_ku <Up> arrow up
+t_kd t_kd <Down> arrow down
+t_kr t_kr <Right> arrow right
+t_kl t_kl <Left> arrow left
+t_sku <S-Up> shifted arrow up *t_sku*
+t_skd <S-Down> shifted arrow down *t_skd*
+t_skr t_%i <S-Right> shifted arrow right *t_skr*
+t_skl t_#4 <S-Left> shifted arrow left *t_skl*
+t_f1 t_k1 <F1> function key 1 *t_f1*
+t_f2 t_k2 <F2> function key 2 *t_f2*
+t_f3 t_k3 <F3> function key 3 *t_f3*
+t_f4 t_k4 <F4> function key 4 *t_f4*
+t_f5 t_k5 <F5> function key 5 *t_f5*
+t_f6 t_k6 <F6> function key 6 *t_f6*
+t_f7 t_k7 <F7> function key 7 *t_f7*
+t_f8 t_k8 <F8> function key 8 *t_f8*
+t_f9 t_k9 <F9> function key 9 *t_f9*
+t_f10 t_k; <F10> function key 10 *t_f10*
+t_sf1 <S-F1> shifted function key 1 *t_sf1*
+t_sf2 <S-F2> shifted function key 2 *t_sf2*
+t_sf3 <S-F3> shifted function key 3 *t_sf3*
+t_sf4 <S-F4> shifted function key 4 *t_sf4*
+t_sf5 <S-F5> shifted function key 5 *t_sf5*
+t_sf6 <S-F6> shifted function key 6 *t_sf6*
+t_sf7 <S-F7> shifted function key 7 *t_sf7*
+t_sf8 <S-F8> shifted function key 8 *t_sf8*
+t_sf9 <S-F9> shifted function key 9 *t_sf9*
+t_sf10 <S-F10> shifted function key 10 *t_sf10*
+t_help t_%1 <Help> help key *t_help*
+t_undo t_&8 <Undo> undo key *t_undo*
+
+
+'errorformat' option changed *errorformat-changed*
+----------------------------
+
+'errorformat' can now contain several formats, separated by commas. The first
+format that matches is used. The default values have been adjusted to catch
+the most common formats. |errorformat|
+
+If you have a format that contains a comma, it needs to be preceded with a
+backslash. Type two backslashes, because the ":set" command will eat one.
+
+
+'graphic' option gone *graphic-option-gone*
+---------------------
+
+The 'graphic' option was used to make the characters between <~> and 0xa0
+display directly on the screen. Now the 'isprint' option takes care of this
+with many more possibilities. The default setting is the same; you only need
+to look into this if you previously set the 'graphic' option in your vimrc.
+ |'isprint'|
+
+
+'yankendofline' option gone *ye-option-gone*
+---------------------------
+
+The 'yankendofline' option has been removed. Instead you can just use
+ :map Y y$
+
+
+'icon' and 'title' default value changed *icon-changed*
+----------------------------------------
+
+The 'title' option is now only set by default if the original title can be
+restored. Avoids "Thanks for flying Vim" titles. If you want them anyway,
+put ":set title" in your vimrc. |'title'|
+
+The default for 'icon' now depends on the possibility of restoring the
+original value, just like 'title'. If you don't like your icon titles to be
+changed, add this line to your vimrc: |'icon'|
+ :set noicon
+
+
+'highlight' option changed *highlight-changed*
+--------------------------
+
+The 'i' flag now means italic highlighting, instead of invert. The 'r' flag
+is used for reverse highlighting, which is what 'i' used to be. Normally you
+won't see the difference, because italic mode is not supported on most
+terminals and reverse mode is used as a fallback. |'highlight'|
+
+When an occasion is not present in 'highlight', use the mode from the default
+value for 'highlight', instead of reverse mode.
+
+
+'tildeop' and 'weirdinvert' short names changed *short-name-changed*
+-----------------------------------------------
+
+Renamed 'to' (abbreviation for 'tildeop') to 'top'. |'tildeop'|
+Renamed 'wi' (abbreviation for 'weirdinvert') to 'wiv'. |'weirdinvert'|
+
+This was done because Vi uses 'wi' as the short name for 'window' and 'to' as
+the short name for 'timeout'. This means that if you try setting these
+options, you won't get an error message, but the effect will be different.
+
+
+Use of "v", "V" and "CTRL-V" in Visual mode *use-visual-cmds*
+-------------------------------------------
+
+In Visual mode, "v", "V", and "CTRL-V" used to end Visual mode. Now this
+happens only if the Visual mode was in the corresponding type. Otherwise the
+type of Visual mode is changed. Now only ESC can be used in all circumstances
+to end Visual mode without doing anything. |v_V|
+
+
+CTRL-B in Insert mode removed *toggle-revins*
+-----------------------------
+
+CTRL-B in Insert mode used to toggle the 'revins' option. If you don't know
+this and accidentally hit CTRL-B, it is very difficult to find out how to undo
+it. Since hardly anybody uses this feature, it is disabled by default. If
+you want to use it, define RIGHTLEFT in feature.h before compiling. |'revins'|
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/version5.txt b/runtime/doc/version5.txt
new file mode 100644
index 000000000..4f53463cb
--- /dev/null
+++ b/runtime/doc/version5.txt
@@ -0,0 +1,7813 @@
+*version5.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+Welcome to Vim Version 5.0!
+
+This document lists the differences between Vim 4.x and Vim 5.0.
+Although 5.0 is mentioned here, this is also for version 5.1, 5.2, etc..
+See |vi_diff.txt| for an overview of differences between Vi and Vim 5.0.
+See |version4.txt| for differences between Vim 3.0 and Vim 4.0.
+
+INCOMPATIBLE: |incompatible-5|
+
+Default value for 'compatible' changed |cp-default|
+Text formatting command "Q" changed |Q-command-changed|
+Command-line arguments changed |cmdline-changed|
+Autocommands are kept |autocmds-kept|
+Use of 'hidden' changed |hidden-changed|
+Text object commands changed |text-objects-changed|
+X-Windows Resources removed |x-resources|
+Use of $VIM |$VIM-use|
+Use of $HOME for MS-DOS and Win32 |$HOME-use|
+Tags file format changed |tags-file-changed|
+Options changed |options-changed|
+CTRL-B in Insert mode gone |i_CTRL-B-gone|
+
+NEW FEATURES: |new-5|
+
+Syntax highlighting |new-highlighting|
+Built-in script language |new-script|
+Perl and Python support |new-perl-python|
+Win32 GUI version |added-win32-GUI|
+VMS version |added-VMS|
+BeOS version |added-BeOS|
+Macintosh GUI version |added-Mac|
+More Vi compatible |more-compatible|
+Read input from stdin |read-stdin|
+Regular expression patterns |added-regexp|
+Overloaded tags |tag-overloaded|
+New commands |new-commands|
+New options |added-options|
+New command-line arguments |added-cmdline-args|
+Various additions |added-various|
+
+IMPROVEMENTS |improvements-5|
+
+COMPILE TIME CHANGES |compile-changes-5|
+
+BUG FIXES |bug-fixes-5|
+
+VERSION 5.1 |version-5.1|
+Changed |changed-5.1|
+Added |added-5.1|
+Fixed |fixed-5.1|
+
+VERSION 5.2 |version-5.2|
+Long lines editable |long-lines|
+File browser added |file-browser-5.2|
+Dialogs added |dialogs-added|
+Popup menu added |popup-menu-added|
+Select mode added |new-Select-mode|
+Session files added |new-session-files|
+User defined functions and commands |new-user-defined|
+New interfaces |interfaces-5.2|
+New ports |ports-5.2|
+Multi-byte support |new-multi-byte|
+New functions |new-functions-5.2|
+New options |new-options-5.2|
+New Ex commands |new-ex-commands-5.2|
+Changed |changed-5.2|
+Added |added-5.2|
+Fixed |fixed-5.2|
+
+VERSION 5.3 |version-5.3|
+Changed |changed-5.3|
+Added |added-5.3|
+Fixed |fixed-5.3|
+
+VERSION 5.4 |version-5.4|
+Runtime directory introduced |new-runtime-dir|
+Filetype introduced |new-filetype-5.4|
+Vim script line continuation |new-line-continuation|
+Improved session files |improved-sessions|
+Autocommands improved |improved-autocmds-5.4|
+Encryption |new-encryption|
+GTK GUI port |new-GTK-GUI|
+Menu changes |menu-changes-5.4|
+Viminfo improved |improved-viminfo|
+Various new commands |new-commands-5.4|
+Various new options |new-options-5.4|
+Vim scripts |new-script-5.4|
+Avoid hit-enter prompt |avoid-hit-enter|
+Improved quickfix |improved-quickfix|
+Regular expressions |regexp-changes-5.4|
+Changed |changed-5.4|
+Added |added-5.4|
+Fixed |fixed-5.4|
+
+VERSION 5.5 |version-5.5|
+Changed |changed-5.5|
+Added |added-5.5|
+Fixed |fixed-5.5|
+
+VERSION 5.6 |version-5.6|
+Changed |changed-5.6|
+Added |added-5.6|
+Fixed |fixed-5.6|
+
+VERSION 5.7 |version-5.7|
+Changed |changed-5.7|
+Added |added-5.7|
+Fixed |fixed-5.7|
+
+VERSION 5.8 |version-5.8|
+Changed |changed-5.8|
+Added |added-5.8|
+Fixed |fixed-5.8|
+
+==============================================================================
+ INCOMPATIBLE *incompatible-5*
+
+Default value for 'compatible' changed *cp-default*
+--------------------------------------
+
+Vim version 5.0 tries to be more Vi compatible. This helps people who use Vim
+as a drop-in replacement for Vi, but causes some things to be incompatible
+with version 4.x.
+
+In version 4.x the default value for the 'compatible' option was off. Now the
+default is on. The first thing you will notice is that the "u" command undoes
+itself. Other side effects will be that mappings may work differently or not
+work at all.
+
+Since a lot of people switching from Vim 4.x to 5.0 will find this annoying,
+the 'compatible' option is switched off if Vim finds a vimrc file. This is a
+bit of magic to make sure that 90% of the Vim users will not be bitten by
+this change.
+
+What does this mean?
+- If you prefer to run in 'compatible' mode and don't have a vimrc file, you
+ don't have to do anything.
+- If you prefer to run in 'nocompatible' mode and do have a vimrc file, you
+ don't have to do anything.
+- If you prefer to run in 'compatible' mode and do have a vimrc file, you
+ should put this line first in your vimrc file: >
+ :set compatible
+- If you prefer to run in 'nocompatible' mode and don't have a vimrc file,
+ you can do one of the following:
+ - Create an empty vimrc file (e.g.: "~/.vimrc" for Unix).
+ - Put this command in your .exrc file or $EXINIT: >
+ :set nocompatible
+< - Start Vim with the "-N" argument.
+
+If you are new to Vi and Vim, using 'nocompatible' is strongly recommended,
+because Vi has a lot of unexpected side effects, which are avoided by this
+setting. See 'compatible'.
+
+If you like some things from 'compatible' and some not, you can tune the
+compatibility with 'cpoptions'.
+
+When you invoke Vim as "ex" or "gex", Vim always starts in compatible mode.
+
+
+Text formatting command "Q" changed *Q-command-changed*
+-----------------------------------
+
+The "Q" command formerly formatted lines to the width the 'textwidth' option
+specifies. The command for this is now "gq" (see |gq| for more info). The
+reason for this change is that "Q" is the standard Vi command to enter "Ex"
+mode, and Vim now does in fact have an "Ex" mode (see |Q| for more info).
+
+If you still want to use "Q" for formatting, use this mapping: >
+ :noremap Q gq
+And if you also want to use the functionality of "Q": >
+ :noremap gQ Q
+
+
+Command-line arguments changed *cmdline-changed*
+------------------------------
+
+Command-line file-arguments and option-arguments can now be mixed. You can
+give options after the file names. Example: >
+ vim main.c -g
+
+This is not possible when editing a file that starts with a '-'. Use the "--"
+argument then |---|: >
+ vim -g -- -main.c
+
+"-v" now means to start Ex in Vi mode, use "-R" for read-only mode.
+old: "vim -v file" |-v|
+new: "vim -R file" |-R|
+
+"-e" now means to start Vi in Ex mode, use "-q" for quickfix.
+old: "vim -e errorfile" |-e|
+new: "vim -q errorfile" |-q|
+
+"-s" in Ex mode now means to run in silent (batch) mode. |-s-ex|
+
+"-x" reserved for crypt, use "-f" to avoid starting a new CLI (Amiga).
+old: "vim -x file" |-x|
+new: "vim -f file" |-f|
+
+Vim allows up to ten "+cmd" and "-c cmd" arguments. Previously Vim executed
+only the last one.
+
+"-n" now overrides any setting for 'updatecount' in a vimrc file, but not in
+a gvimrc file.
+
+
+Autocommands are kept *autocmds-kept*
+---------------------
+
+Before version 5.0, autocommands with the same event, file name pattern, and
+command could appear only once. This was fine for simple autocommands (like
+setting option values), but for more complicated autocommands, where the same
+command might appear twice, this restriction caused problems. Therefore
+Vim stores all autocommands and keeps them in the order that they are defined.
+
+The most obvious side effect of this change is that when you source a vimrc
+file twice, the autocommands in it will be defined twice. To avoid this, do
+one of these:
+
+- Remove any autocommands that might potentially defined twice before
+ defining them. Example: >
+ :au! * *.ext
+ :au BufEnter *.ext ...
+
+- Put the autocommands inside an ":if" command. Example: >
+ if !exists("did_ext_autocmds")
+ let did_ext_autocmds = 1
+ autocmd BufEnter *.ext ...
+ endif
+
+- Put your autocommands in a different autocommand group so you can remove
+ them before defining them |:augroup|: >
+ augroup uncompress
+ au!
+ au BufReadPost *.gz ...
+ augroup END
+
+
+Use of 'hidden' changed *hidden-changed*
+-----------------------
+
+In version 4.x, only some commands used the 'hidden' option. Now all commands
+uses it whenever a buffer disappears from a window.
+
+Previously you could do ":buf xxx" in a changed buffer and that buffer would
+then become hidden. Now you must set the 'hidden' option for this to work.
+
+The new behavior is simpler: whether Vim hides buffers no longer depends on
+the specific command that you use.
+- with 'hidden' not set, you never get hidden buffers. Exceptions are the
+ ":hide" and ":close!" commands and, in rare cases, where you would otherwise
+ lose changes to the buffer.
+- With 'hidden' set, you almost never unload a buffer. Exceptions are the
+ ":bunload" or ":bdel" commands.
+
+":buffer" now supports a "!": abandon changes in current buffer. So do
+":bnext", ":brewind", etc.
+
+
+Text object commands changed *text-objects-changed*
+----------------------------
+
+Text object commands have new names. This allows more text objects and makes
+characters available for other Visual mode commands. Since no more single
+characters were available, text objects names now require two characters.
+The first one is always 'i' or 'a'.
+ OLD NEW ~
+ a aw a word |v_aw|
+ A aW a WORD |v_aW|
+ s as a sentence |v_as|
+ p ap a paragraph |v_ap|
+ S ab a () block |v_ab|
+ P aB a {} block |v_aB|
+
+There is another set of text objects that starts with "i", for "inner". These
+select the same objects, but exclude white space.
+
+
+X-Windows Resources removed *x-resources*
+--------------------------
+
+Vim no longer supports the following X resources:
+- boldColor
+- italicColor
+- underlineColor
+- cursorColor
+
+Vim now uses highlight groups to set colors. This avoids the confusion of
+using a bold Font, which would imply a certain color. See |:highlight| and
+|gui-resources|.
+
+
+Use of $VIM *$VIM-use*
+-----------
+
+Vim now uses the VIM environment variable to find all Vim system files. This
+includes the global vimrc, gvimrc, and menu.vim files and all on-line help
+and syntax files. See |$VIM|. Starting with version 5.4, |$VIMRUNTIME| can
+also be used.
+For Unix, Vim sets a default value for $VIM when doing "make install".
+When $VIM is not set, its default value is the directory from 'helpfile',
+excluding "/doc/help.txt".
+
+
+Use of $HOME for MS-DOS and Win32 *$HOME-use*
+---------------------------------
+
+The MS-DOS and Win32 versions of Vim now first check $HOME when searching for
+a vimrc or exrc file and for reading/storing the viminfo file. Previously Vim
+used $VIM for these systems, but this causes trouble on a system with several
+users. Now Vim uses $VIM only when $HOME is not set or the file is not found
+in $HOME. See |_vimrc|.
+
+
+Tags file format changed *tags-file-changed*
+------------------------
+
+Only Tabs are allowed to separate fields in a tags file. This allows for
+spaces in a file name and is still Vi compatible. In previous versions of
+Vim, any white space was allowed to separate the fields. If you have a file
+which doesn't use a single Tab between fields, edit the tags file and execute
+this command: >
+ :%s/\(\S*\)\s\+\(\S*\)\s\+\(.*\)/\1\t\2\t\3/
+
+
+Options changed *options-changed*
+---------------
+
+The default value of 'errorfile' has changed from "errors.vim" to "errors.err".
+The reason is that only Vim scripts should have the ".vim" extensions.
+
+The ":make" command no longer uses the 'errorfile' option. This prevents the
+output of the ":make" command from overwriting a manually saved error file.
+":make" uses the 'makeef' option instead. This also allows for generating a
+unique name, to prevent concurrently running ":make" commands from overwriting
+each other's files.
+
+With 'insertmode' set, a few more things change:
+- <Esc> in Normal mode goes to Insert mode.
+- <Esc> in Insert mode doesn't leave Insert mode.
+- When doing ":set im", go to Insert mode immediately.
+
+Vim considers a buffer to be changed when the 'fileformat' (formerly the
+'textmode' option) is different from the buffer's initial format.
+
+
+CTRL-B in Insert mode gone *i_CTRL-B-gone*
+--------------------------
+
+When Vim was compiled with the |+rightleft| feature, you could use CTRL-B to
+toggle the 'revins' option. Unfortunately, some people hit the 'B' key
+accidentally when trying to type CTRL-V or CTRL-N and then didn't know how to
+undo this. Since toggling the 'revins' option can easily be done with the
+mapping below, this use of the CTRL-B key is disabled. You can still use the
+CTRL-_ key for this |i_CTRL-_|. >
+ :imap <C-B> <C-O>:set revins!<CR>
+
+==============================================================================
+ NEW FEATURES *new-5*
+
+Syntax highlighting *new-highlighting*
+-------------------
+
+Vim now has a very flexible way to highlighting just about any type of file.
+See |syntax|. Summary: >
+ :syntax on
+
+Colors and attributes can be set for the syntax highlighting, and also for
+other highlighted items with the ':' flag in the 'highlight' option. All
+highlighted items are assigned a highlight group which specifies their
+highlighting. See |:highlight|. The default colors have been improved.
+
+You can use the "Normal" group to set the default fore/background colors for a
+color terminal. For the GUI, you can use this group to specify the font, too.
+
+The "2html.vim" script can be used to convert any file that has syntax
+highlighting to HTML. The colors will be exactly the same as how you see them
+in Vim. With a HTML viewer you can also print the file with colors.
+
+
+Built-in script language *new-script*
+------------------------
+
+A few extra commands and an expression evaluator enable you to write simple
+but powerful scripts. Commands include ":if" and ":while". Expressions can
+manipulate numbers and strings. You can use the '=' register to insert
+directly the result of an expression. See |expression|.
+
+
+Perl and Python support *new-perl-python*
+-----------------------
+
+Vim can call Perl commands with ":perldo", ":perl", etc. See |perl|.
+Patches made by Sven Verdoolaege and Matt Gerassimoff.
+
+Vim can call Python commands with ":python" and ":pyfile". See |python|.
+
+Both of these are only available when enabled at compile time.
+
+
+Win32 GUI version *added-win32-GUI*
+-----------------
+
+The GUI has been ported to MS Windows 95 and NT. All the features of the X11
+GUI are available to Windows users now. |gui-w32|
+This also fixes problems with running the Win32 console version under Windows
+95, where console support has always been bad.
+There is also a version that supports OLE automation interface. |if_ole.txt|
+Vim can be integrated with Microsoft Developer Studio using the VisVim DLL.
+It is possible to produce a DLL version of gvim with Borland C++ (Aaron).
+
+
+VMS version *added-VMS*
+-----------
+
+Vim can now also be used on VMS systems. Port done by Henk Elbers.
+This has not been tested much, but it should work.
+Sorry, no documentation!
+
+
+BeOS version *added-BeOS*
+------------
+
+Vim can be used on BeOS systems (including the BeBox). (Olaf Seibert)
+See |os_beos.txt|.
+
+
+Macintosh GUI version *added-Mac*
+---------------------
+
+Vim can now be used on the Macintosh. (Dany St-Amant)
+It has not been tested much yet, be careful!
+See |os_mac.txt|.
+
+
+More Vi compatible *more-compatible*
+------------------
+
+There is now a real Ex mode. Started with the "Q" command, or by calling the
+executable "ex" or "gex". |Ex-mode|
+
+Always allow multi-level undo, also in Vi compatible mode. When the 'u' flag
+in 'cpoptions' is included, CTRL-R is used for repeating the undo or redo
+(like "." in Nvi).
+
+
+Read input from stdin *read-stdin*
+---------------------
+
+When using the "-" command-line argument, Vim reads its text input from stdin.
+This can be used for putting Vim at the end of a pipe: >
+ grep "^a.*" *.c | vim -
+See |--|.
+
+
+Regular expression patterns *added-regexp*
+---------------------------
+
+Added specifying a range for the number of matches of a atom: "\{a,b}". |/\{|
+Added the "shortest match" regexp "\{-}" (Webb).
+Added "\s", matches a white character. Can replace "[ \t]". |/\s|
+Added "\S", matches a non-white character. Can replace "[^ \t]". |/\S|
+
+
+Overloaded tags *tag-overloaded*
+---------------
+
+When using a language like C++, there can be several tags for the same
+tagname. Commands have been added to be able to jump to any of these
+overloaded tags:
+|:tselect| List matching tags, and jump to one of them.
+|:stselect| Idem, and split window.
+|g_CTRL-]| Do ":tselect" with the word under the cursor.
+
+ After ":ta {tagname}" with multiple matches:
+|:tnext| Go to next matching tag.
+|:tprevious| Go to previous matching tag.
+|:trewind| Go to first matching tag.
+|:tlast| Go to last matching tag.
+
+The ":tag" command now also accepts wildcards. When doing command-line
+completion on tags, case-insensitive matching is also available (at the end).
+
+
+New commands *new-commands*
+------------
+
+|:amenu| Define menus for all modes, inserting a CTRL-O for Insert
+ mode, ESC for Visual and CTRL-C for Cmdline mode. "amenu" is
+ used for the default menus and the Syntax menu.
+
+|:augroup| Set group to be used for following autocommands. Allows the
+ grouping of autocommands to enable deletion of a specific
+ group.
+
+|:crewind| Go to first error.
+|:clast| Go to last error.
+
+|:doautoall| Execute autocommands for all loaded buffers.
+
+|:echo| Echo its argument, which is an expression. Can be used to
+ display messages which include variables.
+
+|:execute| Execute its argument, which is an expression. Can be used to
+ built up an Ex command with anything.
+
+|:hide| Works like ":close".
+
+|:if| Conditional execution, for built-in script language.
+
+|:intro| Show introductory message. This is always executed when Vim
+ is started without file arguments.
+
+|:let| Assign a value to an internal variable.
+
+|:omap| Map only in operator-pending mode. Makes it possible to map
+ text-object commands.
+
+|:redir| Redirect output of messages to a file.
+
+|:update| Write when buffer has changed.
+
+|:while| While-loop for built-in script language.
+
+Visual mode:
+|v_O| "O" in Visual block mode, moves the cursor to the other corner
+ horizontally.
+|v_D| "D" in Visual block mode deletes till end of line.
+
+Insert mode:
+|i_CTRL-]| Triggers abbreviation, without inserting any character.
+
+
+New options *added-options*
+-----------
+
+'background' Used for selecting highlight color defaults. Also used in
+ "syntax.vim" for selecting the syntax colors. Often set
+ automatically, depending on the terminal used.
+
+'complete' Specifies how Insert mode completion works.
+
+'eventignore' Makes it possible to ignore autocommands temporarily.
+
+'fileformat' Current file format. Replaces 'textmode'.
+'fileformats' Possible file formats. Replaces 'textauto'.
+ New is that this also supports Macintosh format: A single <CR>
+ separates lines.
+ The default for 'fileformats' for MS-DOS, Win32 and OS/2 is
+ "dos,unix", also when 'compatible' set. Unix type files
+ didn't work anyway when 'fileformats' was empty.
+
+'guicursor' Set the cursor shape and blinking in various modes.
+ Default is to adjust the cursor for Insert and Replace mode,
+ and when an operator is pending. Blinking is default on.
+
+'fkmap' Farsi key mapping.
+
+'hlsearch' Highlight all matches with the last used search pattern.
+
+'hkmapp' Phonetic Hebrew mapping (Ilya Dogolazky).
+
+'iconstring' Define the name of the icon, when not empty. (version 5.2: the
+ string is used literally, a newline can be used to make two
+ lines).
+
+'lazyredraw' Don't redraw the screen while executing macros, registers or
+ other not typed commands.
+
+'makeef' Errorfile to be used for ":make". "##" is replaced with a
+ unique number. Avoids that two Vim sessions overwrite each
+ others errorfile. The Unix default is "/tmp/vim##.err"; for
+ Amiga "t:vim##.Err, for others "vim##.err".
+
+'matchtime' 1/10s of a second to show a matching paren, when 'showmatch'
+ is set. Like Nvi.
+
+'mousehide' Hide mouse pointer in GUI when typing text.
+
+'nrformats' Defines what bases Vim will consider for numbers when using
+ the CTRL-A and CTRL-X commands. Default: "hex,octal".
+
+'shellxquote' Add extra quotes around the whole shell command, including
+ redirection.
+
+'softtabstop' Make typing behave like tabstop is set at this value, without
+ changing the value of 'tabstop'. Makes it more easy to keep
+ 'ts' at 8, while still getting four spaces for a <Tab>.
+
+'titlestring' String for the window title, when not empty. (version 5.2:
+ this string is used literally, a newline can be used to make
+ two lines).
+
+'verbose' Level of verbosity. Makes it possible to show which .vimrc,
+ .exrc, .viminfo files etc. are used for initializing. Also
+ to show autocommands that are being executed. Can also be set
+ by using the "-V" command-line argument.
+
+
+New command-line arguments *added-cmdline-args*
+--------------------------
+
+|-U| Set the gvimrc file to be used. Like "-u" for the vimrc.
+
+|-V| Set the 'verbose' option. E.g. "vim -V10".
+
+|-N| Start in non-compatible mode.
+
+|-C| Start in compatible mode.
+
+|-Z| Start in restricted mode, disallow shell commands. Can also
+ be done by calling the executable "rvim".
+
+|-h| Show usage information and exit.
+
+
+Various additions *added-various*
+-----------------
+
+Added support for SNiFF+ connection (submitted by Toni Leherbauer). Vim can
+be used as an editor for SNiFF. No documentation available...
+
+For producing a bug report, the bugreport.vim script has been included.
+Can be used with ":so $VIMRUNTIME/bugreport.vim", which creates the file
+"bugreport.txt" in the current directory. |bugs|
+
+Added range to ":normal" command. Now you can repeat the same command for
+each line in the range. |:normal-range|
+
+Included support for the Farsi language (Shiran). Only when enabled at
+compile time. See |farsi|.
+
+==============================================================================
+ IMPROVEMENTS *improvements-5*
+
+Performance:
+- When 'showcmd' was set, mappings would execute much more slowly because the
+ output would be flushed very often. Helps a lot when executing the "life"
+ macros with 'showcmd' set.
+- Included patches for binary searching in tags file (David O'Neill).
+ Can be disabled by resetting the 'tagbsearch' option.
+- Don't update the ruler when repeating insert (slowed it down a lot).
+- For Unix, file name expansion is now done internally instead of starting a
+ shell for it.
+- Expand environment variables with expand_env(), instead of calling the
+ shell. Makes ":so $VIMRUNTIME/syntax/syntax.vim" a LOT faster.
+- Reduced output for cursor positioning: Use CR-LF for moving to first few
+ columns in next few lines; Don't output CR twice when using termios.
+- Optimized cursor positioning. Use CR, BS and NL when it's shorter than
+ absolute cursor positioning.
+- Disable redrawing while repeating insert "1000ii<Esc>".
+- Made "d$" or "D" for long lines a lot faster (delete all characters at once,
+ instead of one by one).
+- Access option table by first letter, instead of searching from start.
+- Made setting special highlighting attributes a lot faster by using
+ highlight_attr[], instead of searching in the 'highlight' string.
+- Don't show the mode when redrawing is disabled.
+- When setting an option, only redraw the screen when required.
+- Improved performance of Ex commands by using a lookup table for the first
+ character.
+
+Options:
+'cinoptions' Added 'g' flag, for C++ scope declarations.
+'cpoptions' Added 'E' flag: Disallow yanking, deleting, etc. empty text
+ area. Default is to allow empty yanks. When 'E' is included,
+ "y$" in an empty line now is handled as an error (Vi
+ compatible).
+ Added 'j' flag: Only add two spaces for a join after a '.',
+ not after a '?' or '!'.
+ Added 'A' flag: don't give ATTENTION message.
+ Added 'L' flag: When not included, and 'list' is set,
+ 'textwidth' formatting works like 'list' is not set.
+ Added 'W' flag: Let ":w!" behave like Vi: don't overwrite
+ readonly files, or a file owned by someone else.
+'highlight' Added '@' flag, for '@' characters after the last line on the
+ screen, and '$' at the end of the line when 'list' is set.
+ Added 'i' flag: Set highlighting for 'incsearch'. Default
+ uses "IncSearch" highlight group, which is linked to "Visual".
+ Disallow 'h' flag in 'highlight' (wasn't used anymore since
+ 3.0).
+'guifont' Win32 GUI only: When set to "*" brings up a font requester.
+'guipty' Default on, because so many people need it.
+'path' Can contain wildcards, and "**" for searching a whole tree.
+'shortmess' Added 'I' flag to avoid the intro message.
+'viminfo' Added '%' flag: Store buffer list in viminfo file.
+
+- Increased defaults for 'maxmem' and 'maxmemtot' for Unix and Win32. Most
+ machines have much more RAM now that prices have dropped.
+- Implemented ":set all&", set all options to their default value. |:set|
+
+Swap file:
+- Don't create a swap file for a readonly file. Then create one on the first
+ change. Also create a swapfile when the amount of memory used is getting
+ too high. |swap-file|
+- Make swap file "hidden", if possible. On Unix this is done by prepending a
+ dot to the swap file name. When long file names are used, the DJGPP and
+ Win32 versions also prepend a dot, in case a file on a mounted Unix file
+ system is edited. |:swapname| On MSDOS the hidden file attribute is NOT
+ set, because this causes problems with share.exe.
+- 'updatecount' always defaults to non-zero, also for Vi compatible mode.
+ This means there is a swap file, which can be used for recovery.
+
+Tags:
+- Included ctags 2.0 (Darren Hiebert). The syntax for static tags changed
+ from
+ {tag}:{fname} {fname} {command}
+ to
+ {tag} {fname} {command};" file:
+ Which is both faster to parse, shorter and Vi compatible. The old format is
+ also still accepted, unless disabled in src/feature.h (see OLD_STATIC_TAGS).
+ |tags-file-format|
+- Completion of tags now also includes static tags for other files, at the
+ end.
+- Included "shtags" from Stephen Riehm.
+- When finding a matching tag, but the file doesn't exist, continue searching
+ for another match. Helps when using the same tags file (with links) for
+ different versions of source code.
+- Give a tag with a global match in the current file a higher priority than a
+ global match in another file.
+
+Included xxd version V1.8 (Juergen Weigert).
+
+Autocommands:
+- VimLeave autocommands are executed after writing the viminfo file, instead
+ of before. |VimLeave|
+- Allow changing autocommands while executing them. This allows for
+ self-modifying autocommands. (idea from Goldberg)
+- When using autocommands with two or more patterns, could not split
+ ":if/:endif" over two lines. Now all matching autocommands are executed in
+ one do_cmdline().
+- Autocommands no longer change the command repeated with ".".
+- Search patterns are restored after executing autocommands. This avoids
+ that the 'hlsearch' highlighting is messed up by autocommands.
+- When trying to execute an autocommand, also try matching the pattern with
+ the short file name. Helps when short file name is different from full
+ file name (expanded symbolic links). |autocmd-patterns|
+- Made the output of ":autocmd" shorter and look better.
+- Expand <sfile> in an ":autocmd" when it is defined. |<sfile>|
+- Added "nested" flag to ":autocmd", allows nesting. |autocmd-nested|
+- Added [group] argument to ":autocmd". Overrides the currently set group.
+ |autocmd-groups|
+- new events:
+ |BufUnload| before a buffer is unloaded
+ |BufDelete| before a buffer is deleted from the buffer list
+ |FileChangedShell| when a file's modification time has changed after
+ executing a shell command
+ |User| user-defined autocommand
+- When 'modified' was set by a BufRead* autocommand, it was reset again
+ afterwards. Now the ":set modified" is remembered.
+
+GUI:
+- Improved GUI scrollbar handling when redrawing is slower than the scrollbar
+ events are generated.
+- "vim -u NONE" now also stops loading the .gvimrc and other GUI inits. |-u|
+ Use "-U" to use another gvimrc file. |-U|
+- Handle CTRL-C for external command, also for systems where "setsid()" is
+ supported.
+- When starting the GUI, restrict the window size to the screen size.
+- The default menus are read from $VIMRUNTIME/menu.vim. This allows for a
+ customized default menu. |menu.vim|
+- Improved the default menus. Added File/Print, a Window menu, Syntax menu,
+ etc.
+- Added priority to the ":menu" command. Now each menu can be put in a place
+ where you want it, independent of the order in which the menus are defined.
+ |menu-priority|
+
+Give a warning in the intro screen when running the Win32 console version on
+Windows 95 because there are problems using this version under Windows 95.
+|win32-problems|
+
+Added 'e' flag for ":substitute" command: Don't complain when not finding a
+match (Campbell). |:s|
+
+When using search commands in a mapping, only the last one is kept in the
+history. Avoids that the history is trashed by long mappings.
+
+Ignore characters after "ex", "view" and "gvim" when checking startup mode.
+Allows the use of "gvim5" et. al. |gvim| "gview" starts the GUI in readonly
+mode. |gview|
+
+When resizing windows, the cursor is kept in the same relative position, if
+possible. (Webb)
+
+":all" and ":ball" no longer close and then open a window for the same buffer.
+Avoids losing options, jumplist, and other info.
+
+"-f" command-line argument is now ignored if Vim was compiled without GUI.
+|-f|
+
+In Visual block mode, the right mouse button picks up the nearest corner.
+
+Changed default mappings for DOS et al. Removed the DOS-specific mappings,
+only use the Windows ones. Added Shift-Insert, Ctrl-Insert, Ctrl-Del and
+Shift-Del.
+
+Changed the numbers in the output of ":jumps", so you can see where {count}
+CTRL-O takes you. |:jumps|
+
+Using "~" for $HOME now works for all systems. |$HOME|
+
+Unix: Besides using CTRL-C, also use the INTR character from the tty settings.
+Somebody has INTR set to DEL.
+
+Allow a <LF> in a ":help" command argument to end the help command, so another
+command can follow.
+
+Doing "%" on a line that starts with " #if" didn't jump to matching "#else".
+Don't recognize "#if", "#else" etc. for '%' when 'cpo' contains the '%' flag.
+|%|
+
+Insert mode expansion with "CTRL-N", "CTRL-P" and "CTRL-X" improved
+|ins-completion|:
+- 'complete' option added.
+- When 'nowrapscan' is set, and no match found, report the searched direction
+ in the error message.
+- Repeating CTRL-X commands adds following words/lines after the match.
+- When adding-expansions, accept single character matches.
+- Made repeated CTRL-X CTRL-N not break undo, and "." repeats the whole
+ insertion. Also fixes not being able to backspace over a word that has been
+ inserted with CTRL-N.
+
+When copying characters in Insert mode from previous/next line, with CTRL-E or
+CTRL-Y, 'textwidth' is no longer used. |i_CTRL-E|
+
+Commands that move in the arglist, like ":n" and ":rew", keep the old cursor
+position of the file (this is mostly Vi compatible).
+
+Vim now remembers the '< and '> marks for each buffer. This fixes a problem
+that a line-delete in one buffer invalidated the '< and '> marks in another
+buffer. |'<|
+
+For MSDOS, Unix and OS/2: When $VIM not set, use the path from the executable.
+When using the executable path for $VIM, remove "src/" when present. Should
+make Vim find the docs and syntax files when it is run directly after
+compiling. |$VIM|
+
+When quitting Visual mode with <Esc>, the cursor is put at start of the Visual
+area (like after executing an operator).
+
+Win32 and Unix version: Removed 1100 character limit on external commands.
+
+Added possibility to include a space in a ":edit +command" argument, by
+putting a backslash before it. |+cmd|
+
+After recovery, BufReadPost autocommands are applied. |:recover|
+
+Added color support for "os2ansi", OS/2 console. (Slootman) |os2ansi|
+
+Allow "%:p:h" when % is empty. |:_%|
+
+Included "<sfile>": file name from the ":source" command. |<sfile>|
+
+Added "<Bslash>" special character. Helps for avoiding multiple backslashes
+in mappings and menus.
+
+In a help window, a double-click jumps to the tag under the cursor (like
+CTRL-]).
+
+<C-Left> and <C-Right> now work like <S-Left> and <S-Right>, move a word
+forward/backward (Windows compatible). |<C-Left>|
+
+Removed the requirement for a ":version" command in a .vimrc file. It wasn't
+used for anything. You can use ":if" to handle differences between versions.
+|:version|
+
+For MS-DOS, Win32 and OS/2: When comparing file names for autocommands, don't
+make a difference between '/' and '\' for path separator.
+
+New termcap options:
+"mb": blink. Can only be used by assigning it to one of the other highlight
+ options. |t_mb|
+"bc": backspace character. |t_bc|
+"nd": Used for moving the cursor right in the GUI, to avoid removing one line
+ of pixels from the last bold character. |t_nd|
+"xs": highlighting not erased by overwriting, for hpterm. Combined with
+ 'weirdinvert'. Visual mode works on hpterm now. |t_xs|
+
+Unix: Set time of patch and backup file same as original file. (Hiebert).
+
+Amiga: In QuickFix mode no longer opens another window. Shell commands can be
+used now.
+
+Added decmouse patches from David Binette. Can now use Dec and Netterm mouse.
+But only when enabled at compile time.
+
+Added '#' register: Alternate file name |quote#|. Display '#' register with
+":dis" command. |:display|
+
+Removed ':' from 'isfname' default for Unix. Check for "://" in a file name
+anyway. Also check for ":\\", for MS-DOS.
+
+Added count to "K"eyword command, when 'keywordprg' is "man", is inserted in
+the man command. "2K" results in "!man 2 <cword>". |K|
+
+When using "gf" on a relative path name, remove "../" from the file name, like
+it's done for file names in the tags file. |gf|
+
+When finishing recording, don't make the recorded register the default put
+register.
+
+When using "!!", don't put ":5,5!" on the command-line, but ":.!". And some
+other enhancements to replace the line number with "." or "$" when possible.
+
+MSDOS et al.: Renamed $VIM/viminfo to $VIM/_viminfo. It's more consistent:
+.vimrc/_vimrc and .viminfo/_viminfo
+
+For systems where case doesn't matter in file names (MSDOS, Amiga), ignore
+case while sorting file names. For buffer names too.
+
+When reading from stdin doesn't work, read from stderr (helps for "foo | xargs
+vim").
+
+32 bit MS-DOS version: Replaced csdpmi3 by csdpmi4.
+
+Changed <C-Left> and <C-Right> to skip a WORD instead of a word.
+
+Warning for changed modified time when overwriting a file now also works on
+other systems than Unix.
+
+Unix: Changed the defaults for configure to be the same as the defaults for
+Makefile: include GUI, Perl, and Python.
+
+Some versions of Motif require "-lXpm". Added check for this in configure.
+
+Don't add "-L/usr/lib" to the link line, causes problems on a few systems.
+
+==============================================================================
+ COMPILE TIME CHANGES *compile-changes-5*
+
+When compiling, allow a choice for minimal, normal or maximal features in an
+easy way, by changing a single line in src/feature.h.
+The DOS16 version has been compiled with minimal features to avoid running
+out of memory too quickly. |dos16|
+The Win32, DJGPP, and OS/2 versions use maximal features, because they have
+enough memory.
+The Amiga version is available with normal and maximal features.
+
+Added "make test" to Unix version Makefile. Allows for a quick check if most
+"normal" commands work properly. Also tests a few specific commands.
+
+Added setlocale() with codepage support for DJGPP version.
+
+autoconf:
+- Added autoconf check for -lXdmcp.
+- Included check for -lXmu, no longer needed to edit the Makefile for this.
+- Switched to autoconf 2.12.
+- Added configure check for <poll.h>. Seems to be needed when including
+ Perl on Linux?
+- termlib is now checked before termcap.
+- Added configure check for strncasecmp(), stricmp() and strnicmp(). Added
+ vim_stricmp() for when there's no library function for stricmp().
+- Use "datadir" in configure, instead of our own check for HELPDIR.
+
+Removed "make proto" from Makefile.manx. Could not make it work without a lot
+of #ifdefs.
+
+Removed "proto/" from paths in proto.h. Needed for the Mac port.
+
+Drastically changed Makefile.mint. Now it includes the Unix Makefile.
+
+Added support for Dos16 in Makefile.b32 (renamed Makefile.b32 to Makefile.bor)
+
+All source files are now edited with a tabstop of 8 instead of 4, which is
+better when debugging and using other tools. 'softtabstop' is set to 4, to
+make editing easier.
+
+Unix: Added "link.sh" script, which removes a few unnecessary libraries from
+the link command.
+
+Don't use HPUX digraphs by default, but only when HPUX_DIGRAPHS is defined.
+|digraphs-default|
+
+==============================================================================
+ BUG FIXES *bug-fixes-5*
+
+Note: Some of these fixes may only apply to test versions which were
+ created after version 4.6, but before 5.0.
+
+
+When doing ":bdel", try going to the next loaded buffer. Don't rewind to the
+start of the buffer list.
+
+mch_isdir() for Unix returned TRUE for "" on some systems.
+
+Win32: 'shell' set to "mksnt/sh.exe" breaks ":!" commands. Don't use
+backslashes in the temp file names.
+
+On linux, with a FAT file system, could get spurious "file xxx changed since
+editing started" messages, because the time is rounded off to two seconds
+unexpectedly.
+
+Crash in GUI, when selecting a word (double click) and then extend until an
+empty line.
+
+For systems where isdigit() can't handle characters > 255, get_number() caused
+a crash when moving the mouse during the prompt for recovery.
+
+In Insert mode, "CTRL-O P" left the cursor on the last inserted character.
+Now the cursor is left after the last putted character.
+
+When quickfix found an error type other than 'e' or 'w', it was never printed.
+
+A setting for 'errorfile' in a .vimrc overruled the "-q errorfile" argument.
+
+Some systems create a file when generating a temp file name. Filtering would
+then create a backup file for this, which was never deleted. Now no backup
+file is made when filtering.
+
+simplify_filename() could remove a ".." after a link, resulting in the wrong
+file name. Made simplify_filename also work for MSDOS. Don't use it for
+Amiga, since it doesn't have "../".
+
+otherfile() was unreliable when using links. Could think that reading/writing
+was for a different file, when it was the same.
+
+Pasting with mouse in Replace mode didn't replace anything.
+
+Window height computed wrong when resizing a window with an autocommand (could
+cause a crash).
+
+":s!foo!bar!" wasn't possible (Vi compatible).
+
+do_bang() freed memory twice when called recursively, because of autocommands
+(test11). Thanks to Electric Fence!
+
+"v$d" on an empty line didn't remove the "-- VISUAL --" mode message from the
+command-line, and inverted the cursor.
+
+":mkexrc" didn't check for failure to open the file, causing a crash.
+(Felderhoff).
+
+Win32 mch_write() wrote past fixed buffer, causing terminal keys no longer to
+be recognized. Both console and GUI version.
+
+Athena GUI: Crash when removing a menu item. Now Vim doesn't crash, but the
+reversing of the menu item is still wrong.
+
+Always reset 'list' option for the help window.
+
+When 'scrolloff' is non-zero, a 'showmatch' could cause the shown match to be
+in the wrong line and the window to be scrolled (Acevedo).
+
+After ":set all&", 'lines' and 'ttytype' were still non-default, because the
+defaults never got set. Now the defaults for 'lines' and 'columns' are set
+after detecting the window size. 'term' and 'ttytype' defaults are set when
+detecting the terminal type.
+
+For (most) non-Unix systems, don't add file names with illegal characters when
+expanding. Fixes "cannot open swapfile" error when doing ":e *.burp", when
+there is no match.
+
+In X11 GUI, drawing part of the cursor obscured the text. Now the text is
+drawn over the cursor, like when it fills the block. (Seibert)
+
+when started with "-c cmd -q errfile", the cursor would be left in line 1.
+Now a ":cc" is done after executing "cmd".
+
+":ilist" never ignored case, even when 'ignorecase' set.
+
+"vim -r file" for a readonly file, then making a change, got ATTENTION message
+in insert mode, display mixed up until <Esc> typed. Also don't give ATTENTION
+message after recovering a file.
+
+The abbreviation ":ab #i #include" could not be removed.
+
+CTRL-L completion (longest common match) on command-line didn't work properly
+for case-insensitive systems (MS-DOS, Windows, etc.). (suggested by Richard
+Kilgore).
+
+For terminals that can hide the cursor ("vi" termcap entry), resizing the
+window caused the cursor to disappear.
+
+Using an invalid mark in an Ex address didn't abort the command.
+
+When 'smarttab' set, would use 'shiftround' when inserting a TAB after a
+space. Now it always rounds to a tabstop.
+
+Set '[ and '] marks for ":copy", ":move", ":append", ":insert", ":substitute"
+and ":change". (Acevedo).
+
+"d$" in an empty line still caused an error, even when 'E' is not in
+'cpoptions'.
+
+Help files were stored in the viminfo buffer list without a path.
+
+GUI: Displaying cursor was not synchronized with other displaying. Caused
+several display errors. For example, when the last two lines in the file
+start with spaces, "dd" on the last line copied text to the (then) last line.
+
+Win32: Needed to type CTRL-SHIFT-- to get CTRL-_.
+
+GUI: Moving the cursor forwards over bold text would remove one column of bold
+pixels.
+
+X11 GUI: When a bold character in the last column was scrolled up or down, one
+column of pixels would not be copied.
+
+Using <BS> to move the cursor left can sometimes erase a character. Now use
+"le" termcap entry for this.
+
+Keyword completion with regexp didn't work. e.g., for "b.*crat".
+
+Fixed: With CTRL-O that jumps to another file, cursor could end up just after
+the line.
+
+Amiga: '$' was missing from character recognized as wildcards, causing $VIM
+sometimes not to be expanded.
+
+":change" didn't adjust marks for deleted lines.
+
+":help [range]" didn't work. Also for [pattern], [count] and [quotex].
+
+For 'cindent'ing, typing "class::method" doesn't align like a label when the
+second ':' is typed.
+When inserting a CR with 'cindent' set (and a bunch of other conditions) the
+cursor went to a wrong location.
+'cindent' was wrong for a line that ends in '}'.
+'cindent' was wrong after "else {".
+
+While editing the cmdline in the GUI, could not use the mouse to select text
+from the command-line itself.
+
+When deleting lines, marks in tag stack were only adjusted for the current
+window, not for other windows on the same buffer.
+
+Tag guessing could find a function "some_func" instead of the "func" we were
+looking for.
+
+Tags file name relative to the current file didn't work.
+
+":g/pat2/s//pat2/g", causing the number of subs to be reported, used to cause
+a scroll up. Now you no longer have to hit <CR>.
+
+X11 GUI: Selecting text could cause a crash.
+
+32 bit DOS version: CTRL-C in external command killed Vim. When SHELL is set
+to "sh.exe", external commands didn't work. Removed using of command.com, no
+longer need to set 'shellquote'.
+
+Fixed crash when using ":g/pat/i".
+
+Fixed (potential) crash for X11 GUI, when using an X selection. Was giving a
+pointer on the stack to a callback function, now it's static.
+
+Using "#" and "*" with an operator didn't work. E.g. "c#".
+
+Command-line expansion didn't work properly after ":*". (Acevedo)
+
+Setting 'weirdinvert' caused highlighting to be wrong in the GUI.
+
+":e +4 #" didn't work, because the "4" was in unallocated memory (could cause
+a crash).
+
+Cursor position was wrong for ":e #", after ":e #" failed, because of changes
+to the buffer.
+
+When doing ":buf N", going to a buffer that was edited with ":view", the
+readonly flag was reset. Now make a difference between ":e file" and ":buf
+file": Only set/reset 'ro' for the first one.
+
+Avoid |hit-enter| prompt when not able to write viminfo on exit.
+
+When giving error messages in the terminal where the GUI was started, GUI
+escape codes would be written to the terminal. In an xterm this could be seen
+as a '$' after the message.
+
+Mouse would not work directly after ":gui", because full_screen isn't set,
+which causes starttermcap() not to do its work.
+
+'incsearch' did not scroll the window in the same way as the actual search.
+When 'nowrap' set, incsearch didn't show a match when it was off the side of
+the screen. Now it also shows the whole match, instead of just the cursor
+position (if possible).
+
+":unmap", ":unab" and ":unmenu" did not accept a double quote, it was seen as
+the start of a comment. Now it's Vi compatible.
+
+Using <Up><Left><Left><Up> in the command-line, when there is no previous
+cmdline in the history, inserted a NUL on the command-line.
+
+"i<Esc>" when on a <Tab> in column 0 left the cursor in the wrong place.
+
+GUI Motif: When adding a lot of menu items, the menu bar goes into two rows.
+Deleting menu items, reducing the number of rows, now also works.
+
+With ":g/pat/s//foo/c", a match in the first line was scrolled off of the
+screen, so you could not see it.
+When using ":s//c", with 'nowrap' set, a match could be off the side of the
+screen, so you could not see it.
+
+When 'helpfile' was set to a fixed, non-absolute path in feature.h, Vim would
+crash. mch_Fullname can now handle file names in read-only memory. (Lottem)
+
+When using CTRL-A or CTRL-@ in Insert mode, there could be strange effects
+when using CTRL-D next. Also, when repeating inserted text that included "0
+CTRL-D" or "^ CTRL-D" this didn't work. (Acevedo)
+Using CTRL-D after using CTRL-E or CTRL-Y in Insert mode that inserted a '0'
+or '^', removed the '0' or '^' and more indent.
+
+The command "2".p" caused the last inserted text to be executed as commands.
+(Acevedo)
+
+Repeating the insert of "CTRL-V 048" resulted in "^@" to be inserted.
+
+Repeating Insert completion could fail if there are special characters in the
+text. (Acevedo)
+
+":normal /string<CR>" caused the window to scroll. Now all ":normal" commands
+are executed without scrolling messages.
+
+Redo of CTRL-E or CTRL-Y in Insert mode interpreted special characters as
+commands.
+
+Line wrapping for 'tw' was done one character off for insert expansion
+inserts.
+
+buffer_exists() function didn't work properly for buffer names with a symbolic
+link in them (e.g. when using buffer_exists(#)).
+
+Removed the "MOTIF_COMMENT" construction from Makefile. It now works with
+FreeBSD make, and probably with NeXT make too.
+
+Matching the 'define' and 'include' arguments now honor the settings for
+'ignorecase'. (Acevedo)
+
+When one file shown in two windows, Visual selection mixed up cursor position
+in current window and other window.
+
+When doing ":e file" from a help file, the 'isk' option wasn't reset properly,
+because of a modeline in the help file.
+
+When doing ":e!", a cursor in another window on the same buffer could become
+invalid, leading to "ml_get: invalid lnum" errors.
+
+Matching buffer name for when expanded name has a different path from not
+expanded name (Brugnara).
+
+Normal mappings didn't work after an operator. For example, with ":map Q gq",
+"QQ" didn't work.
+
+When ":make" resulted in zero errors, a "No Errors" error message was given
+(which breaks mappings).
+
+When ":sourcing" a file, line length was limited to 1024 characters. CTRL-V
+before <EOL> was not handled Vi compatible. (Acevedo)
+
+Unexpected exit for X11 GUI, caused by SAVE_YOURSELF event. (Heimann)
+
+CTRL-X CTRL-I only found one match per line. (Acevedo)
+When using an illegal CTRL-X key in Insert mode, the CTRL-X mode message
+was stuck.
+
+Finally managed to ignore the "Quit" menu entry of the Window manager! Now
+Vim only exists when there are no changed buffers.
+
+Trying to start the GUI when $DISPLAY is not set resulted in a crash.
+When $DISPLAY is not set and gvim starts vim, title was restored to "Thanks
+for flying Vim".
+When $DISPLAY not set, starting "gvim" (dropping back to vim) and then
+selecting text with the mouse caused a crash.
+
+"J", with 'joinspaces' set, on a line ending in ". ", caused one space too
+many to be added. (Acevedo)
+
+In insert mode, a CTRL-R {regname} which didn't insert anything left the '"'
+on the screen.
+
+":z10" didn't work. (Clapp)
+
+"Help "*" didn't work.
+
+Renamed a lot of functions, to avoid clashes with POSIX name space.
+
+When adding characters to a line, making it wrap, the following lines were
+sometimes not shifted down (e.g. after a tag jump).
+
+CTRL-E, with 'so' set and cursor on last line, now does not move cursor as
+long as the last line is on the screen.
+
+When there are two windows, doing "^W+^W-" in the bottom window could cause
+the status line to be doubled (not redrawn correctly).
+
+This command would hang: ":n `cat`". Now connect stdin of the external
+command to /dev/null, when expanding.
+
+Fixed lalloc(0,) error for ":echo %:e:r". (Acevedo)
+
+The "+command" argument to ":split" didn't work when there was no file name.
+
+When selecting text in the GUI, which is the output of a command-line command
+or an external command, the inversion would sometimes remain.
+
+GUI: "-mh 70" argument was broken. Now, when menuheight is specified, it is
+not changed anymore.
+
+GUI: When using the scrollbar or mouse while executing an external command,
+this caused garbage characters.
+
+Showmatch sometimes jumped to the wrong position. Was caused by a call to
+findmatch() when redrawing the display (when syntax highlighting is on).
+
+Search pattern "\(a *\)\{3} did not work correctly, also matched "a a".
+Problem with brace_count not being decremented.
+
+Wildcard expansion added too many non-matching file names.
+
+When 'iskeyword' contains characters like '~', "*" and "#" didn't work
+properly. (Acevedo)
+
+On Linux, on a FAT file system, modification time can change by one second.
+Avoid a "file has changed" warning for a one second difference.
+
+When using the page-switching in an xterm, Vim would position the cursor on
+the last line of the window on exit. Also removed the cursor positioning for
+":!" commands.
+
+":g/pat/p" command (partly) overwrote the command. Now the output is on a
+separate line.
+
+With 'ic' and 'scs' set, a search for "Keyword", ignore-case matches were
+highlighted too.
+
+"^" on a line with only white space, put cursor beyond the end of the line.
+
+When deleting characters before where insertion started ('bs' == 2), could not
+use abbreviations.
+
+CTRL-E at end of file puts cursor below the file, in Visual mode, when 'so' is
+non-zero. CTRL-E didn't work when 'so' is big and the line below the window
+wraps. CTRL-E, when 'so' is non-zero, at end of the file, caused jumping
+up-down.
+
+":retab" didn't work well when 'list' is set.
+
+Amiga: When inserting characters at the last line on the screen, causing it
+to wrap, messed up the display. It appears that a '\n' on the last line
+doesn't always cause a scroll up.
+
+In Insert mode "0<C-D><C-D>" deleted an extra character, because Vim thought
+that the "0" was still there. (Acevedo)
+
+"z{count}l" ignored the count. Also for "zh" et. al. (Acevedo)
+
+"S" when 'autoindent' is off didn't delete leading white space.
+
+"/<Tab>" landed on the wrong character when 'incsearch' is set.
+
+Asking a yes/no question could cause a |hit-enter| prompt.
+
+When the file consists of one long line (>4100 characters), making changes
+caused various errors and a crash.
+
+DJGPP version could not save long lines (>64000) for undo.
+
+"yw" on the last char in the file didn't work. Also fixed "6x" at the end of
+the line. "6X" at the start of a line fails, but does not break a mapping. In
+general, a movement for an operator doesn't beep or flush a mapping, but when
+there is nothing to operate on it beeps (this is Vi compatible).
+
+"m'" and "m`" now set the '' mark at the cursor position.
+
+Unix: Resetting of signals for external program didn't work, because SIG_DFL
+and NULL are the same! For "!!yes|dd count=1|, the yes command kept on
+running.
+
+Partly fixed: Unix GUI: Typeahead while executing an external command was lost.
+Now it's not lost while the command is producing output.
+
+Typing <S-Tab> in Insert mode, when it isn't mapped, inserted "<S-Tab>". Now
+it works like a normal <Tab>, just like <C-Tab> and <M-Tab>.
+
+Redrawing ruler didn't check for old value correctly (caused UMR warnings in
+Purify).
+
+Negative array index in finish_viminfo_history().
+
+":g/^/d|mo $" deleted all the lines. The ":move" command now removes the
+:global mark from the moved lines.
+
+Using "vG" while the last line in the window is a "@" line, didn't update
+correctly. Just the "v" showed "~" lines.
+
+"daw" on the last char of the file, when it's a space, moved the cursor beyond
+the end of the line.
+
+When 'hlsearch' was set or reset, only the current buffer was redrawn, while
+this affects all windows.
+
+CTRL-^, positioning the cursor somewhere from 1/2 to 1 1/2 screen down the
+file, put the cursor at the bottom of the window, instead of halfway.
+
+When scrolling up for ":append" command, not all windows were updated
+correctly.
+
+When 'hlsearch' is set, and an auto-indent is highlighted, pressing <Esc>
+didn't remove the highlighting, although the indent was deleted.
+
+When 'ru' set and 'nosc', using "$j" showed a wrong ruler.
+
+Under Xfree 3.2, Shift-Tab didn't work (wrong keysym is used).
+
+Mapping <S-Tab> didn't work. Changed the key translations to use the shortest
+key code possible. This makes the termcode translations and mappings more
+consistent. Now all modifiers work in all combinations, not only with <Tab>,
+but also with <Space>, <CR>, etc.
+
+For Unix, restore three more signals. And Vim catches SIGINT now, so CTRL-C
+in Ex mode doesn't make Vim exit.
+
+""a5Y" yanked 25 lines instead of 5.
+
+"vrxxx<Esc>" in an empty line could not be undone.
+
+A CTRL-C that breaks ":make" caused the errorfile not to be read (annoying
+when you want to handle what ":make" produced so far).
+
+":0;/pat" didn't find "pat" in line 1.
+
+Search for "/test/s+1" at first char of file gave bottom-top message, or
+didn't work at all with 'nowrapscan'.
+
+Bug in viminfo history. Could cause a crash on exit.
+
+":print" didn't put cursor on first non-blank in line.
+
+":0r !cat </dev/null" left cursor in line zero, with very strange effects.
+
+With 'showcmd' set and 'timeoutlen' set to a few seconds, trick to position
+the cursor leftwards didn't work.
+
+AIX stty settings were restored to cs5 instead of cs8 (Winn).
+
+File name completion didn't work for "zsh" versions that put spaces between
+file names, instead of NULs.
+
+Changed "XawChain*" to "XtChain*", should work for more systems.
+
+Included quite a few fixes for rightleft mode (Lottem).
+
+Didn't ask to |hit-enter| when GUI is started and error messages are printed.
+
+When trying to edit a file in a non-existent directory, ended up with editing
+"No file".
+
+"gqap" to format a paragraph did too much redrawing.
+
+When 'hlsearch' set, only the current window was updated for a new search
+pattern.
+
+Sometimes error messages on startup didn't cause a |hit-enter| prompt,
+because of autocommands containing an empty line.
+
+Was possible to select part of the window in the border, below the command
+line.
+
+'< and '> marks were not at the correct position after linewise Visual
+selection.
+
+When translating a help argument to "CTRL-x", prepend or append a '_', when
+applicable.
+
+Blockwise visual mode wasn't correct when moving vertically over a special
+character (displayed as two screen characters).
+
+Renamed "struct option" to "struct vimoption" to avoid name clash with GNU
+getopt().
+
+":abclear" didn't work (but ":iabclear" and ":cabclear" did work).
+
+When 'nowrap' used, screen wasn't always updated correctly.
+
+"vim -c split file" displayed extra lines.
+
+After starting the GUI, searched the termcap for a "gui" term.
+
+When 'hls' used, search for "^$" caused a hang.
+When 'hls' was set, an error in the last regexp caused trouble.
+
+Unix: Only output an extra <EOL> on exit when outputted something in the
+alternate screen, or when there is a message that needs to be cleared.
+
+"/a\{" did strange things, depending on previous search.
+
+"c}" only redrew one line (with -u NONE).
+
+For mappings, CTRL-META-A was shown as <M-^A> instead of <MC-A>, while :map
+only accepts <MC-A>. Now <M-C-A> is shown.
+
+Unix: When using full path name in a tags file, which contains a link, and
+'hidden' set and jumping to a tag in the current file, would get bogus
+ATTENTION message. Solved by always expanding file names, even when starting
+with '/'.
+
+'hlsearch' highlighting of special characters (e.g., a TAB) didn't highlight
+the whole thing.
+
+"r<CR>" didn't work correctly on the last char of a line.
+
+sometimes a window resize or other signal caused an endless loop, involving
+set_winsize().
+
+"vim -r" didn't work, it would just hang (using tgetent() while 'term' is
+empty).
+
+"gk" while 'nowrap' set moved two lines up.
+
+When windows are split, a message that causes a scroll-up messed up one of the
+windows, which required a CTRL-L to be typed.
+
+Possible endless loop when using shell command in the GUI.
+
+Menus defined in the .vimrc were removed when GUI started.
+
+Crash when pasting with the mouse in insert mode.
+
+Crash whith ":unmenu *" in .gvimrc for Athena.
+
+"5>>" shifted 5 lines 5 times, instead of 1 time.
+
+CTRL-C when getting a prompt in ":global" didn't interrupt.
+
+When 'so' is non-zero, and moving the scrollbar completely to the bottom,
+there was a lot of flashing.
+
+GUI: Scrollbar ident must be long for DEC Alpha.
+
+Some functions called vim_regcomp() without setting reg_magic, which could
+lead to unpredictable magicness.
+
+Crash when clicking around the status line, could get a selection with a
+backwards range.
+
+When deleting more than one line characterwise, the last character wasn't
+deleted.
+
+GUI: Status line could be overwritten when moving the scrollbar quickly (or
+when 'wd' is non-zero).
+
+An ESC at the end of a ":normal" command caused a wait for a terminal code to
+finish. Now, a terminal code is not recognized when its start comes from a
+mapping or ":normal" command.
+
+Included patches from Robert Webb for GUI. Layout of the windows is now done
+inside Vim, instead of letting the layout manager do this. Makes Vim work
+with Lesstif!
+
+UMR warning in set_expand_context().
+
+Memory leak: b_winlnum list was never freed.
+
+Removed TIOCLSET/TIOCLGET code from os_unix.c. Was changing some of the
+terminal settings, and looked like it wasn't doing anything good. (suggested
+by Juergen Weigert).
+
+Ruler overwrote "is a directory" message. When starting up, and 'cmdheight'
+set to > 1, first message could still be in the last line.
+
+Removed prototype for putenv() from proto.h, it's already in osdef2.h.in.
+
+In replace mode, when moving the cursor and then backspacing, wrong characters
+were inserted.
+
+Win32 GUI was checking for a CTRL-C too often, making it slow.
+
+Removed mappings for MS-DOS that were already covered by commands.
+
+When visually selecting all lines in a file, cursor at last line, then "J".
+Gave ml_get errors. Was a problem with scrolling down during redrawing.
+
+When doing a linewise operator, and then an operator with a mouse click, it
+was also linewise, instead of characterwise.
+
+When 'list' is set, the column of the ruler was wrong.
+
+Spurious error message for "/\(b\+\)*".
+
+When visually selected many lines, message from ":w file" disappeared when
+redrawing the screen.
+
+":set <M-b>=^[b", then insert "^[b", waited for another character. And then
+inserted "<M-b>" instead of the real <M-b> character. Was trying to insert
+K_SPECIAL x NUL.
+
+CTRL-W ] didn't use count to set window height.
+
+GUI: "-font" command-line argument didn't override 'guifont' setting from
+.gvimrc. (Acevedo)
+
+GUI: clipboard wasn't used for "*y". And some more Win32/X11 differences
+fixed for the clipboard (Webb).
+
+Jumping from one help file to another help file, with 'compatible' set,
+removed the 'help' flag from the buffer.
+
+File-writable bit could be reset when using ":w!" for a readonly file.
+
+There was a wait for CTRL-O n in Insert mode, because the search pattern was
+shown.
+Reduced wait, to allow reading a message, from 10 to 3 seconds. It seemed
+nothing was happening.
+
+":recover" found same swap file twice.
+
+GUI: "*yy only worked the second time (when pasting to an xterm)."
+
+DJGPP version (dos32): The system flags were cleared.
+
+Dos32 version: Underscores were sometimes replaced with y-umlaut (Levin).
+
+Version 4.1 of ncurses can't handle tputs("", ..). Avoid calling tputs() with
+an empty string.
+
+<S-Tab> in the command-line worked like CTRL-P when no completion started yet.
+Now it does completion, last match first.
+
+Unix: Could get annoying "can't write viminfo" message after doing "su". Now
+the viminfo file is overwritten, and the user set back to the original one.
+
+":set term=builtin_gui" started the GUI in a wrong way. Now it's not
+allowed anymore. But "vim -T gui" does start the GUI correctly now.
+
+GUI: Triple click after a line only put last char in selection, when it is a
+single character word.
+
+When the window is bigger than the screen, the scrolling up of messages was
+wrong (e.g. ":vers", ":hi"). Also when the bottom part of the window was
+obscured by another window.
+
+When using a wrong option only an error message is printed, to avoid that the
+usage information makes it scroll off the screen.
+
+When exiting because of not being able to read from stdin, didn't preserve the
+swap files properly.
+
+Visual selecting all chars in more than one line, then hit "x" didn't leave an
+empty line. For one line it did leave an empty line.
+
+Message for which autocommand is executing messed up file write message (for
+FileWritePost event).
+
+"vim -h" included "-U" even when GUI is not available, and "-l" when lisp is
+not available.
+
+Crash for ":he <C-A>" (command-line longer than screen).
+
+":s/this/that/gc", type "y" two times, then undo, did reset the modified
+option, even though the file is still modified.
+
+Empty lines in a tags file caused a ":tag" to be aborted.
+
+When hitting 'q' at the more prompt for ":menu", still scrolled a few lines.
+
+In an xterm that uses the bold trick a single row of characters could remain
+after an erased bold character. Now erase one extra char after the bold char,
+like for the GUI.
+
+":pop!" didn't work.
+
+When the reading a buffer was interrupted, ":w" should not be able to
+overwrite the file, ":w!" is required.
+
+":cf%" caused a crash.
+
+":gui longfilename", when forking is enabled, could leave part of the
+longfilename at the shell prompt.
+
+==============================================================================
+VERSION 5.1 *version-5.1*
+
+Improvements made between version 5.0 and 5.1.
+
+This was mostly a bug-fix release, not many new features.
+
+
+Changed *changed-5.1*
+-------
+
+The expand() function now separates file names with <NL> instead of a space.
+This avoids problems for file names with embedded spaces. To get the old
+result, use substitute(expand(foo), "\n", " ", "g").
+
+For Insert-expanding dictionaries allow a backslash to be used for
+wildchars. Allows expanding "ze\kra", when 'isk' includes a backslash.
+
+New icon for the Win32 GUI.
+
+":tag", ":tselect" etc. only use the argument as a regexp when it starts
+with '/'. Avoids that ":tag xx~" gives an error message: "No previous sub.
+regexp". Also, when the :tag argument contained wildcard characters, it was
+not Vi compatible.
+When using '/', the argument is taken literally too, with a higher priority,
+so it's found before wildcard matches.
+Only when the '/' is used are matches with different case found, even though
+'ignorecase' isn't set.
+Changed "g^]" to only do ":tselect" when there is more than on matching tag.
+
+Changed some of the default colors, because they were not very readable on a
+dark background.
+
+A character offset to a search pattern can move the cursor to the next or
+previous line. Also fixes that "/pattern/e+2" got stuck on "pattern" at the
+end of a line.
+
+Double-clicks in the status line do no longer start Visual mode. Dragging a
+status line no longer stops Visual mode.
+
+Perl interface: Buffers() and Windows() now use more logical arguments, like
+they are used in the rest of Vim (Moore).
+
+Init '" mark to the first character of the first line. Makes it possible to
+use '" in an autocommand without getting an error message.
+
+
+Added *added-5.1*
+-----
+
+"shell_error" internal variable: result of last shell command.
+
+":echohl" command: Set highlighting for ":echo".
+
+'S' flag in 'highlight' and StatusLineNC highlight group: highlighting for
+status line of not-current window. Default is to use bold for current
+window.
+
+Added buffer_name() and buffer_number() functions (Aaron).
+Added flags argument "g" to substitute() function (Aaron).
+Added winheight() function.
+
+Win32: When an external command starts with "start ", no console is opened
+for it (Aaron).
+
+Win32 console: Use termcap codes for bold/reverse based on the current
+console attributes.
+
+Configure check for "strip". (Napier)
+
+CTRL-R CTRL-R x in Insert mode: Insert the contents of a register literally,
+instead of as typed.
+
+Made a few "No match" error messages more informative by adding the pattern
+that didn't match.
+
+"make install" now also copies the macro files.
+
+tools/tcltags, a shell script to generate a tags file from a TCL file.
+
+"--with-tlib" setting for configure. Easy way to use termlib: "./configure
+--with-tlib=termlib".
+
+'u' flag in 'cino' for setting the indent for contained () parts.
+
+When Win32 OLE version can't load the registered type library, ask the user
+if he wants to register Vim now. (Erhardt)
+Win32 with OLE: When registered automatically, exit Vim.
+Included VisVim 1.1b, with a few enhancements and the new icon (Heiko
+Erhardt).
+
+Added patch from Vince Negri for Win32s support. Needs to be compiled with
+VC 4.1!
+
+Perl interface: Added $curbuf. Rationalized Buffers() and Windows().
+(Moore) Added "group" argument to Msg().
+
+Included Perl files in DOS source archive. Changed Makefile.bor and
+Makefile.w32 to support building a Win32 version with Perl included.
+
+Included new Makefile.w32 from Ken Scott. Now it's able to make all Win32
+versions, including OLE, Perl and Python.
+
+Added CTRL-W g ] and CTRL-W g ^]: split window and do g] or g^].
+
+Added "g]" to always do ":tselect" for the ident under the cursor.
+Added ":tjump" and ":stjump" commands.
+Improved listing of ":tselect" when tag names are a bit long.
+
+Included patches for the Macintosh version. Also for Python interface.
+(St-Amant)
+
+":buf foo" now also restores cursor column, when the buffer was used before.
+
+Adjusted the Makefile for different final destinations for the syntax files
+and scripts (for Debian Linux).
+
+Amiga: $VIM can be used everywhere. When $VIM is not defined, "VIM:" is
+used. This fixes that "VIM:" had to be assigned for the help files, and
+$VIM set for the syntax files. Now either of these work.
+
+Some xterms send vt100 compatible function keys F1-F4. Since it's not
+possible to detect this, recognize both type of keys and translate them to
+<F1> - <F4>.
+
+Added "VimEnter" autocommand. Executed after loading all the startup stuff.
+
+BeOS version now also runs on Intel CPUs (Seibert).
+
+
+Fixed *fixed-5.1*
+-----
+
+":ts" changed position in the tag stack when cancelled with <CR>.
+":ts" changed the cursor position for CTRL-T when cancelled with <CR>.
+":tn" would always jump to the second match. Was using the wrong entry in
+the tag stack.
+Doing "tag foo", then ":tselect", overwrote the original cursor position in
+the tag stack.
+
+"make install" changed the vim.1 manpage in a wrong way, causing "doc/doc"
+to appear for the documentation files.
+
+When compiled with MAX_FEAT, xterm mouse handling failed. Was caused by DEC
+mouse handling interfering.
+
+Was leaking memory when using selection in X11.
+
+CTRL-D halfway a command-line left some characters behind the first line(s)
+of the listing.
+
+When expanding directories for ":set path=", put two extra backslashes
+before a space in a directory name.
+
+When 'lisp' set, first line of a function would be indented. Now its indent
+is set to zero. And use the indent of the first previous line that is at
+the same () level. Added test33.
+
+"so<Esc>u" in an empty file didn't work.
+
+DOS: "seek error in swap file write" errors, when using DOS 6.2 share.exe,
+because the swap file was made hidden. It's no longer hidden.
+
+":global" command would sometimes not execute on a matching line. Happened
+when a data block is full in ml_replace().
+
+For AIX use a tgetent buffer of 2048 bytes, instead of 1024.
+
+Win32 gvim now only sets the console size for external commands to 25x80
+on Windows 95, not on NT.
+
+Win32 console: Dead key could cause a crash, because of a missing "WINAPI"
+(Deshpande).
+
+The right mouse button started Visual mode, even when 'mouse' is empty, and
+in the command-line, a left click moved the cursor when 'mouse' is empty.
+In Visual mode, 'n' in 'mouse' would be used instead of 'v'.
+
+A blinking cursor or focus change cleared a non-Visual selection.
+
+CTRL-Home and CTRL-End didn't work for MS-DOS versions.
+
+Could include NUL in 'iskeyword', causing a crash when doing insert mode
+completion.
+
+Use _dos_commit() to flush the swap file to disk for MSDOS 16 bit version.
+
+In mappings, CTRL-H was replaced by the backspace key code. This caused
+problems when it was used as text, e.g. ":map _U :%s/.^H//g<CR>".
+
+":set t_Co=0" was not handled like a normal term. Now it's translated into
+":set t_Co=", which works.
+
+For ":syntax keyword" the "transparent" option did work, although not
+mentioned in the help. But synID() returned wrong name.
+
+"gqG" in a file with one-word-per-line (e.g. a dictionary) was very slow and
+not interruptable.
+
+"gq" operator inserted screen lines in the wrong situation. Now screen
+lines are inserted or deleted when this speeds up displaying.
+
+cindent was wrong when an "if" contained "((".
+
+'r' flag in 'viminfo' was not used for '%'. Could get files in the buffer
+list from removable media.
+
+Win32 GUI with OLE: if_ole_vc.mak could not be converted into a project.
+Hand-edited to fix this...
+
+With 'nosol' set, doing "$kdw" below an empty line positioned the cursor at
+the end of the line.
+
+Dos32 version changed "\dir\file" into "/dir/file", to work around a DJGPP
+bug. That bug appears to have been fixed, therefore this translation has
+been removed.
+
+"/^*" didn't work (find '*' in first column).
+
+"<afile>" was not always set for autocommands. E.g., for ":au BufEnter *
+let &tags = expand("<afile>:p:h") . "/tags".
+
+In an xterm, the window may be a child of the outer xterm window. Use the
+parent window when getting the title and icon names. (Smith)
+
+When starting with "gvim -bg black -fg white", the value of 'background' is
+only set after reading the .gvimrc file. This causes a ":syntax on" to use
+the wrong colors. Now allow using ":gui" to open the GUI window and set the
+colors. Previously ":gui" in a gvimrc crashed Vim.
+
+tempname() returned the same name all the time, unless the file was actually
+created. Now there are at least 26 different names.
+
+File name used for <afile> was sometimes full path, sometimes file name
+relative to current directory.
+
+When 'background' was set after the GUI window was opened, it could change
+colors that were set by the user in the .gvimrc file. Now it only changes
+colors that have not been set by the user.
+
+Ignore special characters after a CSI in the GUI version. These could be
+interpreted as special characters in a wrong way. (St-Amant)
+
+Memory leak in farsi code, when using search or ":s" command.
+Farsi string reversing for a mapping was only done for new mappings. Now it
+also works for replacing a mapping.
+
+Crash in Win32 when using a file name longer than _MAX_PATH. (Aaron)
+
+When BufDelete autocommands were executed, some things for the buffer were
+already deleted (esp. Perl stuff).
+
+Perl interface: Buffer specific items were deleted too soon; fixes "screen
+no longer exists" messages. (Moore)
+
+The Perl functions didn't set the 'modified' flag.
+
+link.sh did not return an error on exit, which may cause Vim to start
+installing, even though there is no executable to install. (Riehm)
+
+Vi incompatibility: In Vi "." redoes the "y" command. Added the 'y' flag to
+'cpoptions'. Only for 'compatible' mode.
+
+":echohl" defined a new group, when the argument was not an existing group.
+
+"syn on" and ":syn off" could move the cursor, if there is a hidden buffer
+that is shorter that the current cursor position.
+
+The " mark was not set when doing ":b file".
+
+When a "nextgroup" is used with "skipwhite" in syntax highlighting, space at
+the end of the line made the nextgroup also be found in the next line.
+
+":he g<CTRL-D>", then ":" and backspace to the start didn't redraw.
+
+X11 GUI: "gvim -rv" reversed the colors twice on Sun. Now Vim checks if the
+result is really reverse video (background darker than foreground).
+
+"cat link.sh | vim -" didn't set syntax highlighting.
+
+Win32: Expanding "file.sw?" matched ".file.swp". This is an error of
+FindnextFile() that we need to work around. (Kilgore)
+
+"gqgq" gave an "Invalid lnum" error on the last line.
+Formatting with "gq" didn't format the first line after a change of comment
+leader.
+
+There was no check for out-of-memory in win_alloc().
+
+"vim -h" didn't mention "-register" and "-unregister" for the OLE version.
+
+Could not increase 'cmdheight' when the last window is only one line. Now
+other windows are also made smaller, when necessary.
+
+Added a few {} to avoid "suggest braces around" warnings from gcc 2.8.x.
+Changed return type of main() from void to int. (Nam)
+
+Using '~' twice in a substitute pattern caused a crash.
+
+"syn on" and ":syn off" could scroll the window, if there is a hidden buffer
+that is shorter that the current cursor position.
+
+":if 0 | if 1 | endif | endif" didn't work. Same for ":while" and "elseif".
+
+With two windows on modified files, with 'autowrite' set, cursor in second
+window, ":qa" gave a warning for the file in the first window, but then
+auto-wrote the file in the second window. (Webb)
+
+Win32 GUI scrollbar could only handle 32767 lines. Also makes the
+intellimouse wheel use the configurable number of scrolls. (Robinson)
+
+When using 'patchmode', and the backup file is on another partition, the file
+copying messed up the write-file message.
+
+GUI X11: Alt-Backspace and Alt-Delete didn't work.
+
+"`0" could put the cursor after the last character in the line, causing
+trouble for other commands, like "i".
+
+When completing tags in insert mode with ^X^], some matches were skipped,
+because the compare with other tags was wrong. E.g., when "mnuFileSave" was
+already there, "mnuFile" would be skipped. (Negri)
+
+When scrolling up/down, a syntax item with "keepend" didn't work properly.
+Now the flags are also stored for the syntax state a the start of each line.
+
+When 'ic' was changed while 'hlsearch' is on, there was no redraw to show the
+effect.
+
+Win32 GUI: Don't display "No write since last chance" in a message box, but in
+the Vim window.
+
+==============================================================================
+VERSION 5.2 *version-5.2*
+
+Improvements made between version 5.1 and 5.2.
+
+
+Long lines editable *long-lines*
+-------------------
+
+A single long line that doesn't fit in the window doesn't show a line of @@@
+anymore. Redrawing starts at a character further on in the line, such that
+the text around the cursor can be seen. This makes it possible to edit these
+long lines when wrapping is on.
+
+
+File browser added *file-browser-5.2*
+------------------
+
+The Win32, Athena and Motif GUI bring up a file requester if the user asks to
+":browse" for the ":e", ":w", ":r", ":so", ":redirect" and
+":mkexrc/vimrc/vsess" commands. ::browse e /foo/bar" opens the requester in
+the /foo/bar directory, so you can have nice mapping rhs's like ":browse so
+$vim/macros". If no initial dir specified for ":browse e", can be compiled to
+either begin in the current directory, or that of the current buffer. (Negri
+and Kahn)
+Added the 'browsedir' option, with value "current", "last" or "buffer". Tells
+wether a browse dialog starts in last used dir, dir of current buffer, or
+current dir. ":browse w" is unaffected.
+The default menus have been changed to use the ":browse" command.
+
+
+Dialogs added *dialogs-added*
+-------------
+
+Added the ":confirm" command. Works on ":e", ":q", ":w", ":cl". Win32,
+Athena and Motif GUI uses a window-dialog. All other platforms can use
+prompt in command-line. ":confirm qa" offers a choice to save all modified
+files.
+
+confirm() function: allows user access to the confirm engine.
+
+Added 'v' flag to 'guioptions'. When included, a vertical button layout is
+always used for the Win32 GUI dialog. Otherwise, a horizontal layout is
+preferred.
+
+Win32 GUI: ":promptfind" and ":promptrepl" pop up a dialog to find/replace.
+To be used from a menu entry. (Negri)
+
+
+Popup menu added *popup-menu-added*
+----------------
+
+When the 'mousemodel' option is set to "popup", the right mouse button
+displays the top level menu headed with "PopUp" as pop-up context menu. The
+"PopUp" menu is not displayed in the normal menu bar. This currently only
+works for Win32 and Athena GUI.
+
+
+Select mode added *new-Select-mode*
+-----------------
+
+A new mode has been added: "Select mode". It is like Visual mode, but typing
+a printable character replaces the selection.
+- CTRL-G can be used to toggle between Visual mode and Select mode.
+- CTRL-O can be used to switch from Select mode to Visual mode for one command.
+- Added 'selectmode' option: tells when to start Select mode instead of Visual
+ mode.
+- Added 'mousemodel' option: Change use of mouse buttons.
+- Added 'keymodel' option: tells to use shifted special keys to start a
+ Visual or Select mode selection.
+- Added ":behave". Can be used to quickly set 'selectmode', 'mousemodel'
+ and 'keymodel' for MS-Windows and xterm behavior.
+- The xterm-like selection is now called modeless selection.
+- Visual mode mappings and menus are used in Select mode. They automatically
+ switch to Visual mode first. Afterwards, reselect the area, unless it was
+ deleted. The "gV" command can be used in a mapping to skip the reselection.
+- Added the "gh", "gH" and "g^H" commands: start Select (highlight) mode.
+- Backspace in Select mode deletes the selected area.
+
+"mswin.vim" script. Sets behavior mostly like MS-Windows.
+
+
+Session files added *new-session-files*
+-------------------
+
+":mks[ession]" acts like "mkvimrc", but also writes the full filenames of the
+currently loaded buffers and current directory, so that :so'ing the file
+re-loads those files and cd's to that directory. Also stores and restores
+windows. File names are made relative to session file.
+The 'sessionoptions' option sets behavior of ":mksession". (Negri)
+
+
+User defined functions and commands *new-user-defined*
+-----------------------------------
+
+Added user defined functions. Defined with ":function" until ":endfunction".
+Called with "Func()". Allows the use of a variable number of arguments.
+Included support for local variables "l:name". Return a value with ":return".
+See |:function|.
+Call a function with ":call". When using a range, the function is called for
+each line in the range. |:call|
+"macros/justify.vim" is an example of using user defined functions.
+User functions do not change the last used search pattern or the command to be
+redone with ".".
+'maxfuncdepth' option. Restricts the depth of function calls. Avoids trouble
+(crash because of out-of-memory) when a function uses endless recursion.
+
+User definable Ex commands: ":command", ":delcommand" and ":comclear".
+(Moore) See |user-commands|.
+
+
+New interfaces *interfaces-5.2*
+--------------
+
+Tcl interface. (Wilken) See |tcl|.
+Uses the ":tcl", ":tcldo" and "tclfile" commands.
+
+Cscope support. (Kahn) (Sekera) See |cscope|.
+Uses the ":cscope" and ":cstag" commands. Uses the options 'cscopeprg',
+'cscopetag', 'cscopetagorder' and 'cscopeverbose'.
+
+
+New ports *ports-5.2*
+---------
+
+Amiga GUI port. (Nielsen) Not tested much yet!
+
+RISC OS version. (Thomas Leonard) See |riscos|.
+This version can run either with a GUI or in text mode, depending upon where
+it is invoked.
+Deleted the "os_archie" files, they were not working anyway.
+
+
+Multi-byte support *new-multi-byte*
+------------------
+
+MultiByte support for Win32 GUI. (Baek)
+The 'fileencoding' option decides how the text in the file is encoded.
+":ascii" works for multi-byte characters. Multi-byte characters work on
+Windows 95, even when using the US version. (Aaron)
+Needs to be enabled in feature.h.
+This has not been tested much yet!
+
+
+New functions *new-functions-5.2*
+-------------
+
+|browse()| puts up a file requester when available. (Negri)
+|escape()| escapes characters in a string with a backslash.
+|fnamemodify()| modifies a file name.
+|input()| asks the user to enter a line. (Aaron) There is a separate
+ history for lines typed for the input() function.
+|argc()|
+|argv()| can be used to access the argument list.
+|winbufnr()| buffer number of a window. (Aaron)
+|winnr()| window number. (Aaron)
+|matchstr()| Return matched string.
+|setline()| Set a line to a string value.
+
+
+New options *new-options-5.2*
+-----------
+
+'allowrevins' Enable the CTRL-_ command in Insert and Command-line mode.
+'browsedir' Tells in which directory a browse dialog starts.
+'confirm' when set, :q :w and :e commands always act as if ":confirm"
+ is used. (Negri)
+'cscopeprg'
+'cscopetag'
+'cscopetagorder'
+'cscopeverbose' Set the |cscope| behavior.
+'filetype' RISC-OS specific type of file.
+'grepformat'
+'grepprg' For the |:grep| command.
+'keymodel' Tells to use shifted special keys to start a Visual or Select
+ mode selection.
+'listchars' Set character to show in 'list' mode for end-of-line, tabs and
+ trailing spaces. (partly by Smith) Also sets character to
+ display if a line doesn't fit when 'nowrap' is set.
+'matchpairs' Allows matching '<' with '>', and other single character
+ pairs.
+'mousefocus' Window focus follows mouse (partly by Terhaar). Changing the
+ focus with a keyboard command moves the pointer to that
+ window. Also move the pointer when changing the window layout
+ (split window, change window height, etc.).
+'mousemodel' Change use of mouse buttons.
+'selection' When set to "inclusive" or "exclusive", the cursor can go one
+ character past the end of the line in Visual or Select mode.
+ When set to "old" the old behavior is used. When
+ "inclusive", the character under the cursor is included in the
+ operation. When using "exclusive", the new "ve" entry of
+ 'guicursor' is used. The default is a vertical bar.
+'selectmode' Tells when to start Select mode instead of Visual mode.
+'sessionoptions' Sets behavior of ":mksession". (Negri)
+'showfulltag' When completing a tag in Insert mode, show the tag search
+ pattern (tidied up) as a choice as well (if there is one).
+'swapfile' Whether to use a swap file for a buffer.
+'syntax' When it is set, the syntax by that name is loaded. Allows for
+ setting a specific syntax from a modeline.
+'ttymouse' Allows using xterm mouse codes for terminals which name
+ doesn't start with "xterm".
+'wildignore' List of patterns for files that should not be completed at
+ all.
+'wildmode' Can be used to set the type of expansion for 'wildchar'.
+ Replaces the CTRL-T command for command line completion.
+ Don't beep when listing all matches.
+'winaltkeys' Win32 and Motif GUI. When "yes", ALT keys are handled
+ entirely by the window system. When "no", ALT keys are never
+ used by the window system. When "menu" it depends on whether
+ a key is a menu shortcut.
+'winminheight' Minimal height for each window. Default is 1. Set to 0 if
+ you want zero-line windows. Scrollbar is removed for
+ zero-height windows. (Negri)
+
+
+
+New Ex commands *new-ex-commands-5.2*
+---------------
+
+|:badd| Add file name to buffer list without side effects. (Negri)
+|:behave| Quickly set MS-Windows or xterm behavior.
+|:browse| Use file selection dialog.
+|:call| Call a function, optionally with a range.
+|:cnewer|
+|:colder| To access a stack of quickfix error lists.
+|:comclear| Clear all user-defined commands.
+|:command| Define a user command.
+|:continue| Go back to ":while".
+|:confirm| Ask confirmation if something unexpected happens.
+|:cscope| Execute cscope command.
+|:cstag| Use cscope to jump to a tag.
+|:delcommand| Delete a user-defined command.
+|:delfunction| Delete a user-defined function.
+|:endfunction| End of user-defined function.
+|:function| Define a user function.
+|:grep| Works similar to ":make". (Negri)
+|:mksession| Create a session file.
+|:nohlsearch| Stop 'hlsearch' highlighting for a moment.
+|:Print| This is Vi compatible. Does the same as ":print".
+|:promptfind| Search dialog (Win32 GUI).
+|:promptrepl| Search/replace dialog (Win32 GUI).
+|:return| Return from a user-defined function.
+|:simalt| Win32 GUI: Simulate alt-key pressed. (Negri)
+|:smagic| Like ":substitute", but always use 'magic'.
+|:snomagic| Like ":substitute", but always use 'nomagic'.
+|:tcl| Execute TCL command.
+|:tcldo| Execute TCL command for a range of lines.
+|:tclfile| Execute a TCL script file.
+|:tearoff| Tear-off a menu (Win32 GUI).
+|:tmenu|
+|:tunmenu| Win32 GUI: menu tooltips. (Negri)
+|:star| :* Execute a register.
+
+
+Changed *changed-5.2*
+-------
+
+Renamed functions:
+ buffer_exists() -> bufexists()
+ buffer_name() -> bufname()
+ buffer_number() -> bufnr()
+ file_readable() -> filereadable()
+ highlight_exists() -> hlexists()
+ highlightID() -> hlID()
+ last_buffer_nr() -> bufnr("$")
+The old ones are still there, for backwards compatibility.
+
+The CTRL-_ command in Insert and Command-line mode is only available when the
+new 'allowrevins' option is set. Avoids that people who want to type SHIFT-_
+accidentally enter reverse Insert mode, and don't know how to get out.
+
+When a file name path in ":tselect" listing is too long, remove a part in the
+middle and put "..." there.
+
+Win32 GUI: Made font selector appear inside Vim window, not just any odd
+place. (Negri)
+
+":bn" skips help buffers, unless currently in a help buffer. (Negri)
+
+When there is a status line and only one window, don't show '^' in the status
+line of the current window.
+
+":*" used to be used for "'<,'>", the Visual area. But in Vi it's used as an
+alternative for ":@". When 'cpoptions' includes '*' this is Vi compatible.
+
+When 'insertmode' is set, using CTRL-O to execute a mapping will work like
+'insertmode' was not set. This allows "normal" mappings to be used even when
+'insertmode' is set.
+
+When 'mouse' was set already (e.g., in the .vimrc file), don't automatically
+set 'mouse' when the GUI starts.
+
+Removed the 'N', 'I' and 'A' flags from the 'mouse' option.
+
+Renamed "toggle option" to "boolean option". Some people thought that ":set
+xyz" would toggle 'xyz' on/off each time.
+
+The internal variable "shell_error" contains the error code from the shell,
+instead of just 0 or 1.
+
+When inserting or replacing, typing CTRL-V CTRL-<CR> used to insert "<C-CR>".
+That is not very useful. Now the CTRL key is ignored and a <CR> is inserted.
+Same for all other "normal" keys with modifiers. Mapping these modified key
+combinations is still possible.
+In Insert mode, <C-CR> and <S-Space> can be inserted by using CTRL-K and then
+the special character.
+
+Moved "quotes" file to doc/quotes.txt, and "todo" file to doc/todo.txt. They
+are now installed like other documentation files.
+
+winheight() function returns -1 for a non-existing window. It used to be
+zero, but that is a valid height now.
+
+The default for 'selection' is "inclusive", which makes a difference when
+using "$" or the mouse to move the cursor in Visual mode.
+
+":q!" does not exit when there are changed buffers which are hidden. Use
+":qa!" to exit anyway.
+
+Disabled the Perl/Python/Tcl interfaces by default. Not many people use them
+and they make the executable a lot bigger. The internal scripting language is
+now powerful enough for most tasks.
+
+The strings from the 'titlestring' and 'iconstring' options are used
+untranslated for the Window title and icon. This allows for including a <CR>.
+Previously a <CR> would be shown as "^M" (two characters).
+
+When a mapping is started in Visual or Select mode which was started from
+Insert mode (the mode shows "(insert) Visual"), don't return to Insert mode
+until the mapping has ended. Makes it possible to use a mapping in Visual
+mode that also works when the Visual mode was started from Select mode.
+
+Menus in $VIMRUNTIME/menu.vim no longer overrule existing menus. This helps
+when defining menus in the .vimrc file, or when sourcing mswin.vim.
+
+Unix: Use /var/tmp for .swp files, if it exists. Files there survive a
+reboot (at least on Linux).
+
+
+Added *added-5.2*
+-----
+
+--with-motif-lib configure argument. Allows for using a static Motif library.
+
+Support for mapping numeric keypad +,-,*,/ keys. (Negri)
+When not mapped, they produce the normal character.
+
+Win32 GUI: When directory dropped on Gvim, cd there and edit new buffer.
+(Negri)
+
+Win32 GUI: Made CTRL-Break work as interrupt, so that CTRL-C can be
+used for mappings.
+
+In the output of ":map", highlight the "*" to make clear it's not part of the
+rhs. (Roemer)
+
+When showing the Visual area, the cursor is not switched off, so that it can
+be located. The Visual area is now highlighted with a grey background in the
+GUI. This makes the cursor visible when it's also reversed.
+
+Win32: When started with single full pathname (e.g. via double-clicked file),
+cd to that file's directory. (Negri)
+
+Win32 GUI: Tear-off menus, with ":tearoff <menu-name>" command. (Negri)
+'t' option to 'guioptions': Add tearoff menu items for Win32 GUI and Motif.
+It's included by default.
+Win32 GUI: tearoff menu with submenus is indicated with a ">>". (Negri)
+
+Added ^Kaa and ^KAA digraphs.
+Added "euro" symbol to digraph.c. (Corry)
+
+Support for Motif menu shortcut keys, using '&' like MS-Windows (Ollis).
+Other GUIs ignore '&' in a menu name.
+
+DJGPP: Faster screen updating (John Lange).
+
+Clustering of syntax groups ":syntax cluster" (Bigham).
+Including syntax files: ":syntax include" (Bigham).
+
+Keep column when switching buffers, when 'nosol' is set (Radics).
+
+Number function for Perl interface.
+
+Support for Intellimouse in Athena GUI. (Jensen)
+
+":sleep" also accepts an argument in milliseconds, when "m" is used.
+
+Added 'p' flag in 'guioptions': Install callbacks for enter/leave window
+events. Makes cursor blinking work for Terhaar, breaks it for me.
+
+"--help" and "--version" command-line arguments.
+
+Non-text in ":list" output is highlighted with NonText.
+
+Added text objects: "i(" and "i)" as synonym for "ib". "i{" and "i}" as
+synonym for "iB". New: "i<" and "i>", to select <thing>. All this also for
+"a" objects.
+
+'O' flag in 'shortmess': message for reading a file overwrites any previous
+message. (Negri)
+
+Win32 GUI: 'T' flag in 'guioptions': switch toolbar on/off.
+Included a list with self-made toolbar bitmaps. (Negri)
+
+Added menu priority for sub-menus. Implemented for Win32 and Motif GUI.
+Display menu priority with ":menu" command.
+Default and Syntax menus now include priority for items. Allows inserting
+menu items in between the default ones.
+
+When the 'number' option is on, highlight line numbers with the LineNr group.
+
+"Ignore" highlight group: Text highlighted with this is made blank. It is
+used to hide special characters in the help text.
+
+Included Exuberant Ctags version 2.3, with C++ support, Java support and
+recurse into directories. (Hiebert)
+
+When a tags file is not sorted, and this is detected (in a simplistic way), an
+error message is given.
+
+":unlet" accepts a "!", to ignore non-existing variables, and accepts more
+than one argument. (Roemer)
+Completion of variable names for ":unlet". (Roemer)
+
+When there is an error in a function which is called by another function, show
+the call stack in the error message.
+
+New file name modifiers:
+":.": reduce file name to be relative to current dir.
+":~": reduce file name to be relative to home dir.
+":s?pat?sub?": substitute "pat" with "sub" once.
+":gs?pat?sub?": substitute "pat" with "sub" globally.
+
+New configure arguments: --enable-min-features and --enable-max-features.
+Easy way to switch to minimum or maximum features.
+
+New compile-time feature: modify_fname. For file name modifiers, e.g,
+"%:p:h". Can be disabled to save some code (16 bit DOS).
+
+When using whole-line completion in Insert mode, and 'cindent' is set, indent
+the line properly.
+
+MSDOS and Win32 console: 'guicursor' sets cursor thickness. (Negri)
+
+Included new set of Farsi fonts. (Shiran)
+
+Accelerator text now also works in Motif. All menus can be defined with & for
+mnemonic and TAB for accelerator text. They are ignored on systems that don't
+support them.
+When removing or replacing a menu, compare the menu name only up to the <Tab>
+before the mnemonic.
+
+'i' and 'I' flags after ":substitute": ignore case or not.
+
+"make install" complains if the runtime files are missing.
+
+Unix: When finding an existing swap file that can't be opened, mention the
+owner of the file in the ATTENTION message.
+
+The 'i', 't' and 'k' options in 'complete' now also print the place where they
+are looking for matches. (Acevedo)
+
+"gJ" command: Join lines without inserting a space.
+
+Setting 'keywordprg' to "man -s" is handled specifically. The "-s" is removed
+when no count given, the count is added otherwise. Configure checks if "man
+-s 2 read" works, and sets the default for 'keywordprg' accordingly.
+
+If you do a ":bd" and there is only one window open, Vim tries to move to a
+buffer of the same type (i.e. non-help to non-help, help to help), for
+consistent behavior to :bnext/:bprev. (Negri)
+
+Allow "<Nop>" to be used as the rhs of a mapping. ":map xx <Nop>", maps "xx"
+to nothing at all.
+
+In a ":menu" command, "<Tab>" can be used instead of a real tab, in the menu
+path. This makes it more easy to type, no backslash needed.
+
+POSIX compatible character classes for regexp patterns: [:alnum:], [:alpha:],
+[:blank:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:],
+[:space:], [:upper:] and [:xdigit:]. (Briscoe)
+
+regexp character classes (for fast syntax highlight matching):
+ digits: \d [0-9] \D not digit (Roemer)
+ hex: \x [0-9a-fA-F] \X not hex
+ octal: \o [0-7] \O not octal
+ word: \w [a-zA-Z0-9_] \W not word
+ head: \h [a-zA-Z_] \H not head
+ alphabetic: \a [a-zA-Z] \A not alphabetic
+ lowercase: \l [a-z] \L not lowercase
+ uppercase: \u [A-Z] \U not uppercase
+
+":set" now accepts "+=", |^=" and "-=": add or remove parts of a string
+option, add or subtract a number from a number option. A comma is
+automagically inserted or deleted for options that are a comma separated list.
+
+Filetype feature, for autocommands. Uses a file type instead of a pattern to
+match a file. Currently only used for RISC OS. (Leonard)
+
+In a pattern for an autocommand, environment variables can be used. They are
+expanded when the autocommand is defined.
+
+"BufFilePre" and "BufFilePost" autocommand evens: Before and after applying
+the ":file" command to change the name of a buffer.
+"VimLeavePre" autocommand event: before writing the .viminfo file.
+
+For autocommands argument: <abuf> is buffer number, like <afile>.
+
+Made syntax highlighting a bit faster when scrolling backwards, by keeping
+more syncing context.
+
+Win32 GUI: Made scrolling faster by avoiding a redraw when deleting or
+inserting screen lines.
+
+GUI: Made scrolling faster by not redrawing the scrollbar when the thumb moved
+less than a pixel.
+
+Included ":highlight" in bugreport.vim.
+
+Created install.exe program, for simplistic installation on DOS and
+MS-Windows.
+
+New register: '_', the black hole. When writing to it, nothing happens. When
+reading from it, it's always empty. Can be used to avoid a delete or change
+command to modify the registers, or reduce memory use for big changes.
+
+CTRL-V xff enters character by hex number. CTRL-V o123 enters character by
+octal number. (Aaron)
+
+Improved performance of syntax highlighting by skipping check for "keepend"
+when there isn't any.
+
+Moved the mode message ("-- INSERT --") to the last line of the screen. When
+'cmdheight' is more than one, messages will remain readable.
+
+When listing matching files, they are also sorted on 'suffixes', such that
+they are listed in the same order as CTRL-N retrieves them.
+
+synIDattr() takes a third argument (optionally), which tells for which
+terminal type to get the attributes for. This makes it possible to run
+2html.vim outside of gvim (using color names instead of #RRGGBB).
+
+Memory profiling, only for debugging. Prints at exit, and with "g^A" command.
+(Kahn)
+
+DOS: When using a file in the current drive, remove the drive name:
+"A:\dir\file" -> "\dir\file". This helps when moving a session file on a
+floppy from "A:\dir" to "B:\dir".
+
+Increased number of remembered jumps from 30 to 50 per window.
+
+Command to temporarily disable 'hls' highlighting until the next search:
+":nohlsearch".
+
+"gp" and "gP" commands: like "p" and "P", but leave the cursor just after the
+inserted text. Used for the CTRL-V command in MS-Windows mode.
+
+
+Fixed *fixed-5.2*
+-----
+
+Win32 GUI: Could draw text twice in one place, for fake-bold text. Removed
+this, Windows will handle the bold text anyway. (Negri)
+
+patch 5.1.1: Win32s GUI: pasting caused a crash (Negri)
+
+patch 5.1.2: When entering another window, where characters before the cursor
+have been deleted, could have a cursor beyond the end of the line.
+
+patch 5.1.3: Win32s GUI: Didn't wait for external command to finish. (Negri)
+
+patch 5.1.4: Makefile.w32 can now also be used to generate the OLE version
+(Scott).
+
+patch 5.1.5: Crashed when using syntax highlighting: cursor on a line that
+doesn't fit in the window, and splitting that line in two.
+
+patch 5.1.6: Visual highlighting bug: After ":set nowrap", go to end of line
+(so that the window scrolls horizontally), ":set wrap". Following Visual
+selection was wrong.
+
+patch 5.1.7: When 'tagbsearch' off, and 'ignorecase' off, still could do
+binary searching.
+
+patch 5.1.8: Win32 GUI: dragging the scrollbar didn't update the ruler.
+
+patch 5.1.9: Using ":gui" in .vimrc, caused xterm cursor to disappear.
+
+patch 5.1.10: A CTRL-N in Insert mode could cause a crash, when a buffer
+without a name exists.
+
+patch 5.1.11: "make test" didn't work in the shadow directory. Also adjusted
+"make shadow" for the links in the ctags directory.
+
+patch 5.1.12: "buf 123foo" used "123" as a count, instead as the start of a
+buffer name.
+
+patch 5.1.13: When completing file names on the command-line, reallocating the
+command-line may go wrong.
+
+patch 5.1.14: ":[nvci]unmenu" removed menu for all modes, when full menu patch
+specified.
+
+Graceful handling of NULLs in drag-dropped file list. Handle passing NULL to
+Fullname_save(). (Negri)
+
+Win32: ":!start" to invoke a program without opening a console, swapping
+screens, or waiting for completion in either console or gui version. e.g. you
+can type ":!start winfile". ALSO fixes "can't delete swapfile after spawning
+a shell" bug. (enhancement of Aaron patch) (Negri)
+
+Win32 GUI: Fix CTRL-X default keymapping to be more Windows-like. (Negri)
+
+Shorten filenames on startup. If in /foo/bar, entering "vim ../bar/bang.c"
+displays "bang.c" in status bar, not "/foo/bar/bang.c" (Negri)
+
+Win32 GUI: No copy to Windows clipboard when it's not desired.
+
+Win32s: Fix pasting from clipboard - made an assumption not valid under
+Win32s. (Negri)
+
+Win32 GUI: Speed up calls to gui_mch_draw_string() and cursor drawing
+functions. (Negri)
+
+Win32 GUI: Middle mouse button emulation now works in GUI! (Negri)
+
+Could skip messages when combining commands in one line, e.g.:
+":echo "hello" | write".
+
+Perl interpreter was disabled before executing VimLeave autocommands. Could
+not use ":perl" in them. (Aaron)
+
+Included patch for the Intellimouse (Aaron/Robinson).
+
+Could not set 'ls' to one, when last window has only one line. (Mitterand)
+
+Fixed a memory leak when removing menus.
+
+After ":only" the ruler could overwrite a message.
+
+Dos32: removed changing of __system_flags. It appears to work better when
+it's left at the default value.
+
+p_aleph was an int instead of along, caused trouble on systems where
+sizeof(int) != sizeof(long). (Schmidt)
+
+Fixed enum problems for Ultrix. (Seibert)
+
+Small redraw problem: "dd" on last line in file cleared wrong line.
+
+Didn't interpret "cmd | endif" when "cmd" starts with a range. E.g. "if 0 |
+.d | endif".
+
+Command "+|" on the last line of the file caused ml_get errors.
+
+Memory underrun in eval_vars(). (Aaron)
+
+Don't rename files in a difficult way, except on Windows 95 (was also done on
+Windows NT).
+
+Win32 GUI: An external command that produces an error code put the error
+message in a dialog box. had to close the window and close the dialog. Now
+the error code is displayed in the console. (Negri)
+
+"comctl32.lib" was missing from the GUI libraries in Makefile.w32. (Battle)
+
+In Insert mode, when entering a window in Insert mode, allow the cursor to be
+one char beyond the text.
+
+Renamed machine dependent rename() to mch_rename(). Define mch_rename() to
+rename() when it works properly.
+
+Rename vim_chdir() to mch_chdir(), because it's machine dependent.
+
+When using an arglist, and editing file 5 of 4, ":q" could cause "-1 more
+files to edit" error.
+
+In if_python.c, VimCommand() caused an assertion when a do_cmdline() failed.
+Moved the Python_Release_Vim() to before the VimErrorCheck(). (Harkins)
+
+Give an error message for an unknown argument after "--". E.g. for "vim
+--xyz".
+
+The FileChangedShell autocommand didn't set <afile> to the name of the changed
+file.
+
+When doing ":e file", causing the attention message, there sometimes was no
+hit-enter prompt. Caused by empty line or "endif" at end of sourced file.
+
+A large number of patches for the VMS version. (Hunsaker)
+
+When CTRL-L completion (find longest match) results in a shorter string, no
+completion is done (happens with ":help").
+
+Crash in Win32 GUI version, when using an Ex "@" command, because
+LinePointers[] was used while not initialized.
+
+Win32 GUI: allow mapping of Alt-Space.
+
+Output from "vim -h" was sent to stderr. Sending it to stdout is better, so
+one can use "vim -h | more".
+
+In command-line mode, ":vi[!]" should reload the file, just like ":e[!]".
+In Ex mode, ":vi" stops Ex mode, but doesn't reload the file. This is Vi
+compatible.
+
+When using a ":set ls=1" in the .gvimrc file, would get a status line for a
+single window. (Robinson)
+
+Didn't give an error message for ":set ai,xx". (Roemer)
+Didn't give an error message for ":set ai?xx", ":set ai&xx", ":set ai!xx".
+
+Non-Unix systems: That a file exists but is unreadable is recognized as "new
+file". Now check for existence when file can't be opened (like Unix).
+
+Unix: osdef.sh didn't handle declarations where the function name is at the
+first column of the line.
+
+DJGPP: Shortening of file names didn't work properly, because get_cwd()
+returned a path with backslashes. (Negri)
+
+When using a 'comments' part where a space is required after the middle part,
+always insert a space when starting a new line. Helps for C comments, below a
+line with "/****".
+
+Replacing path of home directory with "~/" could be wrong for file names
+with embedded spaces or commas.
+
+A few fixes for the Sniff interface. (Leherbauer)
+
+When asking to hit 'y' or 'n' (e.g. for ":3,1d"), using the mouse caused
+trouble. Same for ":s/x/y/c" prompt.
+
+With 'nowrap' and 'list', a Tab halfway on the screen was displayed as blanks,
+instead of the characters specified with 'listchars'. Also for other
+characters that take more than one screen character.
+
+When setting 'guifont' to an unknown font name, the previous font was lost and
+a default font would be used. (Steed)
+
+DOS: Filenames in the root directory didn't get shortened properly. (Negri)
+
+DJGPP: making a full path name out of a file name didn't work properly when
+there is no _fullpath() function. (Negri)
+
+Win32 console: ":sh" caused a crash. (Negri)
+
+Win32 console: Setting 'lines' and/or 'columns' in the _vimrc failed miserably
+(could hang Windows 95). (Negri)
+
+Win32: The change-drive function was not correct, went to the wrong drive.
+(Tsindlekht)
+
+GUI: When editing a command line in Ex mode, Tabs were sometimes not
+backspaced properly, and unprintable characters were displayed directly.
+non-GUI can still be wrong, because a system function is called for this.
+
+":set" didn't stop after an error. For example ":set no ai" gave an error for
+"no", but still set "ai". Now ":set" stops after the first error.
+
+When running configure for ctags, $LDFLAGS wasn't passed to it, causing
+trouble for IRIX.
+
+"@%" and "@#" when file name not set gave an error message. Now they just
+return an empty string. (Steed)
+
+CTRL-X and CTRL-A didn't work correctly with negative hex and octal numbers.
+(Steed)
+
+":echo" always started with a blank.
+
+Updating GUI cursor shape didn't always work (e.g., when blinking is off).
+
+In silent Ex mode ("ex -s" or "ex <file") ":s///p" didn't print a line. Also
+a few other commands that explicitly print a text line didn't work. Made this
+Vi compatible.
+
+Win32 version of _chdrive() didn't return correct value. (Tsindlekht)
+
+When using 't' in 'complete' option, no longer give an error message for a
+missing tags file.
+
+Unix: tgoto() can return NULL, which was not handled correctly in configure.
+
+When doing ":help" from a buffer where 'binary' is set, also edited the help
+file in binary mode. Caused extra ^Ms for DOS systems.
+
+Cursor position in a file was reset to 1 when closing a window.
+
+":!ls" in Ex mode switched off echo.
+
+When doing a double click in window A, while currently in window B, first
+click would reset double click time, had to click three times to select a
+word.
+
+When using <F11> in mappings, ":mkexrc" produced an exrc file that can't be
+used in Vi compatible mode. Added setting of 'cpo' to avoid this. Also, add
+a CTRL-V in front of a '<', to avoid a normal string to be interpreted as a
+special key name.
+
+Gave confusing error message for ":set guifont=-*-lucida-*": first "font is
+not fixed width", then "Unknown font".
+
+Some options were still completely left out, instead of included as hidden
+options.
+
+While running the X11 GUI, ignore SIGHUP signals. Avoids a crash after
+executing an external command (in rare cases).
+
+In os_unixx.h, signal() was defined to sigset(), while it already was.
+
+Memory leak when executing autocommands (was reported as a memory leak in
+syntax highlighting).
+
+Didn't print source of error sometimes, because pointers were the same,
+although names were different.
+
+Avoid a number of UMR errors from Purify (third argument to open()).
+
+A swap file could still be created just after setting 'updatecount' to zero,
+when there is an empty buffer and doing ":e file". (Kutschera)
+
+Test 35 failed on 64 bit machines. (Schild)
+
+With "p" and "P" commands, redrawing was slow.
+
+Awk script for html documentation didn't work correctly with AIX awk.
+Replaced "[ ,.);\] ]" with "[] ,.); ]". (Briscoe)
+The makehtml.awk script had a small problem, causing extra lines to be
+inserted. (Briscoe)
+
+"gqgq" could not be repeated. Repeating for "gugu" and "gUgU" worked in a
+wrong way. Also made "gqq" work to be consistent with "guu".
+
+C indent was wrong after "case ':':".
+
+":au BufReadPre *.c put": Line from put text was deleted, because the buffer
+was still assumed to be empty.
+
+Text pasted with the Edit/Paste menu was subject to 'textwidth' and
+'autoindent'. That was inconsistent with using the mouse to paste. Now "*p
+is used.
+
+When using CTRL-W CTRL-] on a word that's not a tag, and then CTRL-] on a tag,
+window was split.
+
+":ts" got stuck on a tags line that has two extra fields.
+
+In Insert mode, with 'showmode' on, <C-O><C-G> message was directly
+overwritten by mode message, if preceded with search command warning message.
+
+When putting the result of an expression with "=<expr>p, newlines were
+inserted like ^@ (NUL in the file). Now the string is split up in lines at
+the newline.
+
+putenv() was declared with "const char *" in pty.c, but with "char *" in
+osdef2.h.in. Made the last one also "const char *".
+
+":help {word}", where +{word} is a feature, jumped to the feature list instead
+of where the command was explained. E.g., ":help browse", ":help autocmd".
+
+Using the "\<xx>" form in an expression only got one byte, even when using a
+special character that uses several bytes (e.g., "\<F9>").
+Changed "\<BS>" to produce CTRL-H instead of the special key code for the
+backspace key. "\<Del>" produces 0x7f.
+
+":mkvimrc" didn't write a command to set 'compatible' or 'nocompatible'.
+
+The shell syntax didn't contain a "syn sync maxlines" setting. In a long file
+without recognizable items, syncing took so long it looked like Vim hangs.
+Added a maxlines setting, and made syncing interruptable.
+
+The "gs" command didn't flush output before waiting.
+
+Memory leaks for:
+ ":if 0 | let a = b . c | endif"
+ "let a = b[c]"
+ ":so {file}" where {file} contains a ":while"
+
+GUI: allocated fonts were never released. (Leonard)
+
+Makefile.bor:
+- Changed $(DEFINES) into a list of "-D" options, so that it can also be used
+ for the resource compiler. (not tested!)
+- "bcc.cfg" was used for all configurations. When building for another
+ configuration, the settings for the previous one would be used. Moved
+ "bcc.cfg" to the object directory. (Geddes)
+- Included targets for vimrun, install, ctags and xxd. Changed the default to
+ use the Borland DLL Runtime Library, makes Vim.exe a log smaller. (Aaron)
+
+"2*" search for the word under the cursor with "2" prepended. (Leonard)
+
+When deleting into a specific register, would still overwrite the non-Win32
+GUI selection. Now ""x"*P works.
+
+When deleting into the "" register, would write to the last used register.
+Now ""x always writes to the unnamed register.
+
+GUI Athena: A submenu with a '.' in it didn't work. E.g.,
+":amenu Syntax.XY\.Z.foo lll".
+
+When first doing ":tag foo" and then ":tnext" and/or ":tselect" the order of
+matching tags could change, because the current file is different. Now the
+existing matches are kept in the same order, newly found matches are added
+after them, not matter what the current file is.
+
+":ta" didn't find the second entry in a tags file, if the second entry was
+longer than the first one.
+
+When using ":set si tw=7" inserting "foo {^P}" made the "}" inserted at the
+wrong position. can_si was still TRUE when the cursor is not in the indent of
+the line.
+
+Running an external command in Win32 version had the problem that Vim exits
+when the X on the console is hit (and confirmed). Now use the "vimrun"
+command to start the external command indirectly. (Negri)
+
+Win32 GUI: When running an external filter, do it in a minimized DOS box.
+(Negri)
+
+":let" listed variables without translation into printable characters.
+
+Win32 console: When resizing the window, switching back to the old size
+(when exiting or executing an external command) sometimes failed. (Negri)
+This appears to also fix a "non fixable" problem:
+Win32 console in NT 4.0: When running Vim in a cmd window with a scrollbar,
+the scrollbar disappeared and was not restored when Vim exits. This does work
+under NT 3.51, it appears not to be a Vim problem.
+
+When executing BufDelete and BufUnload autocommands for a buffer without a
+name, the name of the current buffer was used for <afile>.
+
+When jumping to a tag it reported "tag 1 of >2", while in fact there could be
+only two matches. Changed to "tag 1 of 2 or more".
+
+":tjump tag" did a linear search in the tags file, which can be slow.
+
+Configure didn't find "LibXm.so.2.0", a Xm library with a version number.
+
+Win32 GUI: When using a shifted key with ALT, the shift modifier would remain
+set, even when it was already used by changing the used key. E.g., "<M-S-9>"
+resulted in "<M-S-(>", but it should be "<M-(>". (Negri)
+
+A call to ga_init() was often followed by setting growsize and itemsize.
+Created ga_init2() for this, which looks better. (Aaron)
+
+Function filereadable() could call fopen() with an empty string, which might
+be illegal.
+
+X Windows GUI: When executing an external command that outputs text, could
+write one character beyond the end of a buffer, which caused a crash. (Kohan)
+
+When using "*" or "#" on a string that includes '/' or '?' (when these are
+included in 'isk'), they were not escaped. (Parmelan)
+
+When adding a ToolBar menu in the Motif GUI, the submenu_id field was not
+cleared, causing random problems.
+
+When adding a menu, the check if this menu (or submenu) name already exists
+didn't compare with the simplified version (no mnemonic or accelerator) of the
+new menu. Could get two menus with the same name, e.g., "File" and "&File".
+
+Breaking a line because of 'textwidth' at the last line in the window caused a
+redraw of the whole window instead of a scroll. Speeds up normal typing with
+'textwidth' a lot for slow terminals.
+
+An invalid line number produced an "invalid range" error, even when it wasn't
+to be executed (inside "if 0").
+
+When the unnamed, first buffer is re-used, the "BufDelete" autocommand was
+not called. It would stick in a buffer list menu.
+
+When doing "%" on the NUL after the line, a "{" or "}" in the last character
+of the line was not found.
+
+The Insert mode menu was not used for the "s" command, the Operator-pending
+menu was used instead.
+
+With 'compatible' set, some syntax highlighting was not correct, because of
+using "[\t]" for a search pattern. Now use the regexps for syntax
+highlighting like the 'cpoptions' option is empty (as was documented already).
+
+When using "map <M-Space> ms" or "map <Space> sss" the output of ":map" didn't
+show any lhs for the mapping (if 'isprint' includes 160). Now always use
+<Space> and <M-Space>, even when they are printable.
+
+Adjusted the Syntax menu, so that the lowest entry fits on a small screen (for
+Athena, where menus don't wrap).
+
+When using CTRL-E or CTRL-Y in Insert mode for characters like 'o', 'x' and
+digits, repeating the insert didn't work.
+
+The file "tools/ccfilter.README.txt" could not be unpacked when using short
+file names, because of the two dots. Renamed it to
+"tools/ccfilter_README.txt".
+
+For a dark 'background', using Blue for Directory and SpecialKey highlight
+groups is not very readable. Use Cyan instead.
+
+In the function uc_scan_attr() in ex_docmd.c there was a goto that jumped into
+a block with a local variable. That's illegal for some compilers.
+
+Win32 GUI: There was a row of pixels at the bottom of the window which was not
+drawn. (Aaron)
+
+Under DOS, editing "filename/" created a swap file of "filename/.swp". Should
+be "filename/_swp".
+
+Win32 GUI: pointer was hidden when executing an external command.
+
+When 'so' is 999, "J" near the end of the file didn't redisplay correctly.
+
+":0a" inserted after the first line, instead of before the first line.
+
+Unix: Wildcard expansion didn't handle single quotes and {} patterns. Now
+":file 'window.c'" removes the quotes and ":e 'main*.c'" works (literal '*').
+":file {o}{n}{e}" now results in file name "one".
+
+Memory leak when setting a string option back to its default value.
+
+==============================================================================
+VERSION 5.3 *version-5.3*
+
+Version 5.3 was a bug-fix version of 5.2. There are not many changes.
+Improvements made between version 5.2 and 5.3:
+
+Changed *changed-5.3*
+-------
+
+Renamed "IDE" menu to "Tools" menu.
+
+
+Added *added-5.3*
+-----
+
+Win32 GUI: Give a warning when Vim is activated, and one of the files changed
+since editing started. (Negri)
+
+
+Fixed *fixed-5.3*
+-----
+
+5.2.1: Win32 GUI: space for external command was not properly allocated, could
+cause a crash. (Aaron) This was the reason to bring out 5.3 quickly after
+5.2.
+
+5.2.2: Some commands didn't complain when used without an argument, although
+they need one: ":badd", ":browse", ":call", ":confirm", ":behave",
+":delfunction", ":delcommand" and ":tearoff".
+":endfunction" outside of a function gave wrong error message: "Command not
+implemented". Should be ":endfunction not inside a function".
+
+5.2.3: Win32 GUI: When gvim was installed in "Program files", or another path
+with a space in it, executing external commands with vimrun didn't work.
+
+5.2.4: Pasting with the mouse in Insert mode left the cursor on the last
+pasted character, instead of behind it.
+
+5.2.5: In Insert mode, cursor after the end of the line, a shift-cursor-left
+didn't include the last character in the selection.
+
+5.2.6: When deleting text from Insert mode (with "<C-O>D" or the mouse), which
+includes the last character in the line, the cursor could be left on the last
+character in the line, instead of just after it.
+
+5.2.7: Win32 GUI: scrollbar was one pixel too big.
+
+5.2.8: Completion of "PopUp" menu showed the derivates "PopUpc", "PopUPi",
+etc. ":menu" also showed these.
+
+5.2.9: When using two input() functions on a row, the prompt would not be
+drawn in column 0.
+
+5.2.10: A loop with input() could not be broken with CTRL-C.
+
+5.2.11: ":call asdf" and ":call asdf(" didn't give an error message.
+
+5.2.12: Recursively using ":normal" crashes Vim after a while. E.g.:
+":map gq :normal gq<CR>"
+
+5.2.13: Syntax highlighting used 'iskeyword' from wrong buffer. When using
+":help", then "/\k*" in another window with 'hlsearch' set.
+
+5.2.14: When using ":source" from a function, global variables would not be
+available unless "g:" was used.
+
+5.2.15: XPM files can have the extension ".pm", which is the same as for Perl
+modules. Added "syntax/pmfile.vim" to handle this.
+
+5.2.16: On Win32 and Amiga, "echo expand("%:p:h")" removed one dirname in an
+empty buffer. mch_Fullname() didn't append a slash at the end of a directory
+name.
+
+Should include the character under the cursor in the Visual area when using
+'selection' "exclusive". This wasn't done for "%", "e", "E", "t" and "f".
+
+""p would always put register 0, instead of the unnamed (last used) register.
+Reverse the change that ""x doesn't write in the unnamed (last used) register.
+It would always write in register 0, which isn't very useful. Use "-x for the
+paste mappings in Visual mode.
+
+When there is one long line on the screen, and 'showcmd' is off, "0$" didn't
+redraw the screen.
+
+Win32 GUI: When using 'mousehide', the pointer would flicker when the cursor
+shape is changed. (Negri)
+
+When cancelling Visual mode, and the cursor moves to the start, the wanted
+column wasn't set, "k" or "j" moved to the wrong column.
+
+When using ":browse" or ":confirm", was checking for a comment and separating
+bar, which can break some commands.
+
+Included fixes for Macintosh. (Kielhorn)
+
+==============================================================================
+VERSION 5.4 *version-5.4*
+
+Version 5.4 adds new features, useful changes and a lot of bug fixes.
+
+
+Runtime directory introduced *new-runtime-dir*
+----------------------------
+
+The distributed runtime files are now in $VIMRUNTIME, the user files in $VIM.
+You normally don't set $VIMRUNTIME but let Vim find it, by using
+$VIM/vim{version}, or use $VIM when that doesn't exist. This allows for
+separating the user files from the distributed files and makes it more easy to
+upgrade to another version. It also makes it possible to keep two versions of
+Vim around, each with their own runtime files.
+
+In the Unix distribution the runtime files have been moved to the "runtime"
+directory. This makes it possible to copy all the runtime files at once,
+without the need to know what needs to be copied.
+
+The archives for DOS, Windows, Amiga and OS/2 now have an extra top-level
+"vim" directory. This is to make clear that user-modified files should be put
+here. The directory that contains the executables doesn't have '-' or '.'
+characters. This avoids strange extensions.
+
+The $VIM and $VIMRUNTIME variables are set when they are first used. This
+allows them to be used by Perl, for example.
+
+The runtime files are also found in a directory called "$VIM/runtime". This
+helps when running Vim after just unpacking the runtime archive. When using
+an executable in the "src" directory, Vim checks if "vim54" or "runtime" can
+be added after removing it. This make the runtime files be found just after
+compiling.
+
+A default for $VIMRUNTIME can be given in the Unix Makefile. This is useful
+if $VIM doesn't point to above the runtime directory but to e.g., "/etc/".
+
+
+Filetype introduced *new-filetype-5.4*
+-------------------
+
+Syntax files are now loaded with the new FileType autocommand. Old
+"mysyntaxfile" files will no longer work. |filetypes|
+
+The scripts for loading syntax highlighting have been changed to use the
+new Syntax autocommand event.
+
+This combination of Filetype and Syntax events allows tuning the syntax
+highlighting a bit more, also when selected from the Syntax menu. The
+FileType autocommand can also be used to set options and mappings specifically
+for that type of file.
+
+The "$VIMRUNTIME/filetype.vim" file is not loaded automatically. The
+":filetype on" command has been added for this. ":syntax on" also loads it.
+
+The 'filetype' option has been added. It is used to trigger the FileType
+autocommand event, like the 'syntax' option does for the Syntax event.
+
+":set syntax=OFF" and ":set syntax=ON" can be used (in a modeline) to switch
+syntax highlighting on/off for the current file.
+
+The Syntax menu commands have been moved to $VIMRUNTIME/menu.vim. The Syntax
+menu is included both when ":filetype on" and when ":syntax manual" is used.
+
+Renamed the old 'filetype' option to 'osfiletype'. It was only used for
+RISCOS. 'filetype' is now used for the common file type.
+
+Added the ":syntax manual" command. Allows manual selection of the syntax to
+be used, e.g., from a modeline.
+
+
+Vim script line continuation *new-line-continuation*
+----------------------------
+
+When an Ex line starts with a backslash, it is concatenated to the previous
+line. This avoids the need for long lines. |line-continuation| (Roemer)
+Example: >
+ if has("dialog_con") ||
+ \ has("dialog_gui")
+ :let result = confirm("Enter your choice",
+ \ "&Yes\n&No\n&Maybe",
+ \ 2)
+ endif
+
+
+Improved session files *improved-sessions*
+----------------------
+
+New words for 'sessionoptions':
+- "help" Restore the help window.
+- "blank" Restore empty windows.
+- "winpos" Restore the Vim window position. Uses the new ":winpos"
+ command
+- "buffers" Restore hidden and unloaded buffers. Without it only the
+ buffers in windows are restored.
+- "slash" Replace backward by forward slashes in file names.
+- "globals" Store global variables.
+- "unix" Use unix file format (<NL> instead of <CR><NL>)
+
+The ":mksession" and 'sessionoptions' are now in the +mksession feature.
+
+The top line of the window is also restored when using a session file.
+
+":mksession" and ":mkvimrc" don't store 'fileformat', it should be detected
+when loading a file.
+
+(Most of this was done by Vince Negri and Robert Webb)
+
+
+Autocommands improved *improved-autocmds-5.4*
+---------------------
+
+New events:
+|FileType| When the file type has been detected.
+|FocusGained| When Vim got input focus. (Negri)
+|FocusLost| When Vim lost input focus. (Negri)
+|BufCreate| Called just after a new buffer has been created or has been
+ renamed. (Madsen)
+|CursorHold| Triggered when no key has been typed for 'updatetime'. Can be
+ used to do something with the word under the cursor. (Negri)
+ Implemented CursorHold autocommand event for Unix. (Zellner)
+ Also for Amiga and MS-DOS.
+|GUIEnter| Can be used to do something with the GUI window after it has
+ been created (e.g., a ":winpos 100 50").
+|BufHidden| When a buffer becomes hidden. Used to delete the
+ option-window when it becomes hidden.
+
+Also trigger |BufDelete| just before a buffer is going to be renamed. (Madsen)
+
+The "<amatch>" pattern can be used like "<afile>" for autocommands, except
+that it is the matching value for the FileType and Syntax events.
+
+When ":let @/ = <string>" is used in an autocommand, this last search pattern
+will be used after the autocommand finishes.
+
+Made loading autocommands a bit faster. Avoid doing strlen() on each exiting
+pattern for each new pattern by remembering the length.
+
+
+Encryption *new-encryption*
+----------
+
+Files can be encrypted when writing and decrypted when reading. Added the
+'key' option, "-x" command line argument and ":X" command. |encryption| (based
+on patch from Mohsin Ahmed)
+
+When reading a file, there is an automatic detection whether it has been
+crypted. Vim will then prompt for the key.
+
+Note that the encryption method is not compatible with Vi. The encryption is
+not unbreakable. This allows it to be exported from the US.
+
+
+GTK GUI port *new-GTK-GUI*
+------------
+
+New GUI port for GTK+. Includes a toolbar, menu tearoffs, etc. |gui-gtk|
+Added the |:helpfind| command. (Kahn and Dalecki)
+
+
+Menu changes *menu-changes-5.4*
+------------
+
+Menus can now also be used in the console. It is enabled by the new
+'wildmenu' option. This shows matches for command-line completion like a
+menu. This works as a minimal file browser.
+
+The new |:emenu| command can be used to execute a menu item.
+
+Uses the last status line to list items, or inserts a line just above the
+command line. (Negri)
+
+The 'wildcharx' option can be used to trigger 'wildmenu' completion from a
+mapping.
+
+When compiled without menus, this can be detected with has("menu"). Also show
+this in the ":version" output. Allow compiling GUI versions without menu
+support. Only include toolbar support when there is menu support.
+
+Moved the "Window" menu all the way to the right (priority 70). Looks more
+familiar for people working with MS-Windows, shouldn't matter for others.
+
+Included "Buffers" menu. Works with existing autocommands and functions. It
+can be disabled by setting the "no_buffers_menu" variable. (Aaron and Madsen)
+
+Win32 supports separators in a menu: "-.*-". (Geddes)
+Menu separators for Motif now work too.
+
+Made Popup menu for Motif GUI work. (Madsen)
+
+'M' flag in 'guioptions': Don't source the system menu.
+
+All the menu code has been moved from gui.c to menu.c.
+
+
+Viminfo improved *improved-viminfo*
+----------------
+
+New flags for 'viminfo':
+'!' Store global variables in the viminfo file if they are in uppercase
+ letters. (Negri)
+'h' Do ":nohlsearch" when loading a viminfo file.
+
+Store search patterns in the viminfo file with their offset, magic, etc. Also
+store the flag whether 'hlsearch' highlighting is on or off (which is not used
+if the 'h' flag is in 'viminfo').
+
+Give an error message when setting 'viminfo' without commas.
+
+
+Various new commands *new-commands-5.4*
+--------------------
+
+Operator |g?|: rot13 encoding. (Negri)
+
+|zH| and |zL| commands: Horizontal scrolling by half a page.
+|gm| move cursor to middle of screen line. (Ideas by Campbell)
+
+Operations on Visual blocks: |v_b_I|, |v_b_A|, |v_b_c|, |v_b_C|, |v_b_r|,
+|v_b_<| and |v_b_>|. (Kelly)
+
+New command: CTRL-\ CTRL-N, which does nothing in Normal mode, and goes to
+Normal mode when in Insert or Command-line mode. Can be used by VisVim or
+other OLE programs to make sure Vim is in Normal mode, without causing a beep.
+|CTRL-\_CTRL-N|
+
+":cscope kill" command to use the connection filename. |:cscope| (Kahn)
+
+|:startinsert| command: Start Insert mode next.
+
+|:history| command, to show all four types of histories. (Roemer)
+
+|[m|, |[M|, |]m| and |]M| commands, for jumping backward/forward to start/end
+of method in a (Java) class.
+
+":@*" executes the * register. |:@| (Acevedo)
+
+|go| and |:goto| commands: Jump to byte offset in the file.
+
+|gR| and |gr| command: Virtual Replace mode. Replace characters without
+changing the layout. (Webb)
+
+":cd -" changes to the directory from before the previous ":cd" command.
+|:cd-| (Webb)
+
+Tag preview commands |:ptag|. Shows the result of a ":tag" in a dedicated
+window. Can be used to see the context of the tag (e.g., function arguments).
+(Negri)
+|:pclose| command, and CTRL-W CTRL-Z: Close preview window. (Moore)
+'previewheight' option, height for the preview window.
+Also |:ppop|, |:ptnext|, |:ptprevious|, |:ptNext|, |:ptrewind|, |:ptlast|.
+
+|:find| and |:sfind| commands: Find a file in 'path', (split window) and edit
+it.
+
+The |:options| command opens an option window that shows the current option
+values. Or use ":browse set" to open it. Options are grouped by function.
+Offers short help on each option. Hit <CR> to jump to more help. Edit the
+option value and hit <CR> on a "set" line to set a new value.
+
+
+Various new options *new-options-5.4*
+-------------------
+
+Scroll-binding: 'scrollbind' and 'scrollopt' options. Added |:syncbind|
+command. Makes windows scroll the same amount (horizontally and/or
+vertically). (Ralston)
+
+'conskey' option for MS-DOS. Use direct console I/O. This should work with
+telnet (untested!).
+
+'statusline' option: Configurable contents of the status line. Also allows
+showing the byte offset in the file. Highlighting with %1* to %9*, using the
+new highlight groups User1 to User9. (Madsen)
+
+'rulerformat' option: Configurable contents of the ruler, like 'statusline'.
+(Madsen)
+
+'write' option: When off, writing files is not allowed. Avoids overwriting a
+file even with ":w!". The |-m| command line option resets 'write'.
+
+'clipboard' option: How the clipboard is used. Value "unnamed": Use unnamed
+register like "*. (Cortopassi) Value "autoselect": Like what 'a' in
+'guioptions' does but works in the terminal.
+
+'guifontset' option: Specify fonts for the +fontset feature, for the X11 GUI
+versions. Allows using normal fonts when vim is compiled with this feature.
+(Nam)
+
+'guiheadroom' option: How much room to allow above/below the GUI window.
+Used for Motif, Athena and GTK.
+
+Implemented 'tagstack' option: When off, pushing tags onto the stack is
+disabled (Vi compatible). Useful for mappings.
+
+'shellslash' option. Only for systems that use a backslash as a file
+separator. This option will use a forward slash in file names when expanding
+it. Useful when 'shell' is sh or csh.
+
+'pastetoggle' option: Key sequence that toggles 'paste'. Works around the
+problem that mappings don't work in Insert mode when 'paste' is set.
+
+'display' option: When set to "lastline", the last line fills the window,
+instead of being replaced with "@" lines. Only the last three characters are
+replaced with "@@@", to indicate that the line has not finished yet.
+
+'switchbuf' option: Allows re-using existing windows on a buffer that is being
+jumped to, or split the window to open a new buffer. (Roemer)
+
+'titleold' option. Replaces the fixed string "Thanks for flying Vim", which
+is used to set the title when exiting. (Schild)
+
+
+Vim scripts *new-script-5.4*
+-----------
+
+The |exists()| function can also check for existence of a function. (Roemer)
+An internal function is now found with a binary search, should be a bit
+faster. (Roemer)
+
+New functions:
+- |getwinposx()| and |getwinposy()|: get Vim window position. (Webb)
+- |histnr()|, |histadd()|, |histget()| and |histdel()|: Make history
+ available. (Roemer)
+- |maparg()|: Returns rhs of a mapping. Based on a patch from Vikas.
+- |mapcheck()|: Check if a map name matches with an existing one.
+- |visualmode()|: Return type of last Visual mode. (Webb)
+- |libcall()|: Call a function in a library. Currently only for Win32. (Negri)
+- |bufwinnr()|: find window that contains the specified buffer. (Roemer)
+- |bufloaded()|: Whether a buffer exists and is loaded.
+- |localtime()| and |getftime()|: wall clock time and last modification time
+ of a file (Webb)
+- |glob()|: expand file name wildcards only.
+- |system()|: get the raw output of an external command. (based on a patch
+ from Aaron).
+- |strtrans()|: Translate String into printable characters. Used for
+ 2html.vim script.
+- |append()|: easy way to append a line of text in a buffer.
+
+Changed functions:
+- Optional argument to |strftime()| to give the time in seconds. (Webb)
+- |expand()| now also returns names for files that don't exist.
+
+Allow numbers in the name of a user command. (Webb)
+
+Use "v:" for internal Vim variables: "v:errmsg", "v:shell_error", etc. The
+ones from version 5.3 can be used without "v:" too, for backwards
+compatibility.
+
+New variables:
+"v:warningmsg" and "v:statusmsg" internal variables. Contain the last given
+warning and status message. |v:warningmsg| |v:statusmsg| (Madsen)
+"v:count1" variable: like "v:count", but defaults to one when no count is
+used. |v:count1|
+
+When compiling without expression evaluation, "if 1" can be used around the
+not supported commands to avoid it being executed. Works like in Vim 4.x.
+Some of the runtime scripts gave errors when used with a Vim that was compiled
+with minimal features. Now "if 1" is used around code that is not always
+supported.
+
+When evaluating an expression with && and ||, skip the parts that will not
+influence the outcome. This makes it faster and avoids error messages. (Webb)
+Also optimized the skipping of expressions inside an "if 0".
+
+
+Avoid hit-enter prompt *avoid-hit-enter*
+-----------------------
+
+Added 'T' flag to 'shortmess': Truncate all messages that would cause the
+hit-enter prompt (unless that would happen anyway).
+The 'O' flag in 'shortmess' now also applies to quickfix messages, e.g., from
+the ":cn" command.
+
+The default for 'shortmess' is now "filnxtToO", to make most messages fit on
+the command line, and not cause the hit-enter prompt.
+
+Previous messages can be viewed with the new |:messages| command.
+
+Some messages are shown fully, even when 'shortmess' tells to shorten
+messages, because the user is expected to want to see them in full: CTRL-G and
+some quickfix commands.
+
+
+Improved quickfix *improved-quickfix*
+-----------------
+
+Parse change-directory lines for gmake: "make[1]: Entering directory 'name'".
+Uses "%D" and "%X" in 'errorformat'.
+Also parse "Making {target} in {dir}" messages from make. Helps when not
+using GNU make. (Schandl)
+
+Use 'isfname' for "%f" in 'errorformat'.
+
+Parsing of multi-line messages. |errorformat-multi-line|
+
+Allow a range for the |:clist| command. (Roemer)
+
+Support for "global" file names, for error formats that output the file name
+once for several errors. (Roemer)
+
+|:cnfile| jumps to first error in next file.
+
+"$*" in 'makeprg' is replaced by arguments to ":make". (Roemer)
+
+
+Regular expressions *regexp-changes-5.4*
+-------------------
+
+In a regexp, a '$' before "\)" is also considered to be an end-of-line. |/$|
+In patterns "^" after "\|" or "\(" is a start-of-line. |/^| (Robinson)
+
+In a regexp, in front of "\)" and "\|" both "$" and "\$" were considered
+end-of-line. Now use "$" as end-of-line and "\$" for a literal dollar. Same
+for '^' after "\(" and "\|". |/\$| |/\^|
+
+Some search patterns can be extremely slow, even though they are not really
+illegal. For example: "\([^a-z]\+\)\+Q". Allow interrupting any regexp
+search with CTRL-C.
+
+Register "/: last search string (read-only). (Kohan) Changed to use last used
+search pattern (like what 'hlsearch' uses). Can set the search pattern with
+":let @/ = {expr}".
+
+Added character classes to search patterns, to avoid the need for removing the
+'l' flag from 'cpoptions': |[:tab:]|, |[:return:]|, |[:backspace:]| and
+|[:escape:]|.
+
+By adding a '?' after a comparative operator in an expression, the comparison
+is done by ignoring case. |expr-==?|
+
+
+Other improvements made between version 5.3 and 5.4
+---------------------------------------------------
+
+Changed *changed-5.4*
+-------
+
+Unix: Use $TMPDIR for temporary files, if it is set and exists.
+
+Removed "Empty buffer" message. It isn't useful and can cause a hit-enter
+prompt. (Negri)
+
+"ex -" now reads commands from stdin and works in silent mode. This is to be
+compatible with the original "ex" command that is used for scripts.
+
+Default range for ":tcldo" is the whole file.
+
+Cancelling Visual mode with ESC moved the cursor. There appears to be no
+reason for this. Now leave the cursor where it is.
+
+The ":grep" and ":make" commands see " as part of the arguments, instead of
+the start of a comment.
+
+In expressions the "=~" and "!~" operators no longer are affected by
+'ignorecase'.
+
+Renamed vimrc_example to vimrc_example.vim and gvimrc_example to
+gvimrc_example.vim. Makes them being recognized as vim scripts.
+
+"gd" no longer starts searching at the end of the previous function, but at
+the first blank line above the start of the current function. Avoids that
+using "gd" in the first function finds global a variable.
+
+Default for 'complete' changed from ".,b" to ".,w,b,u,t,i". Many more matches
+will be found, at the cost of time (the search can be interrupted).
+
+It is no longer possible to set 'shell*' options from a modeline. Previously
+only a warning message was given. This reduces security risks.
+
+The ordering of the index of documentation files was changed to make it more
+easy to find a subject.
+
+On MS-DOS and win32, when $VIM was not set, $HOME was used. This caused
+trouble if $HOME was set to e.g., "C:\" for some other tool, the runtime files
+would not be found. Now use $HOME only for _vimrc, _gvimrc, etc., not to find
+the runtime file.
+
+When 'tags' is "./{fname}" and there is no file name for the current buffer,
+just use it. Previously it was skipped, causing "vim -t {tag}" not to find
+many tags.
+
+When trying to select text in the 'scrolloff' area by mouse dragging, the
+resulting scrolling made this difficult. Now 'scrolloff' is temporarily set
+to 0 or 1 to avoid this. But still allow scrolling in the top line to extend
+to above the displayed text.
+
+Default for 'comments' now includes "sl:/*,mb: *,ex:*/", to make javadoc
+comments work. Also helps for C comments that start with "/*******".
+
+CTRL-X CTRL-] Insert mode tag expansion tried to expand to all tags when used
+after a non-ID character, which can take a very long time. Now limit this to
+200 matches. Also used for command-line tag completion.
+
+The OS/2 distribution has been split in two files. It was too big to fit on a
+floppy. The same runtime archive as for the PC is now used.
+
+In the documentation, items like <a-z> have been replaced with {a-z} for
+non-optional arguments. This avoids confusion with key names: <C-Z> is a
+CTRL-Z, not a character between C and Z, that is {C-Z}.
+
+
+Added *added-5.4*
+-----
+
+Color support for the iris-ansi builtin termcap entry. (Tubman)
+
+Included VisVim version 1.3a. (Erhardt)
+
+Win32 port for SNiFF+ interface. (Leherbauer)
+Documentation file for sniff interface: if_sniff.txt. (Leherbauer)
+
+Included the "SendToVim" and "OpenWithVim" programs in the OleVim directory.
+To be used with the OLE version of gvim under MS-Windows. (Schaller)
+
+Included Exuberant Ctags version 3.2.4 with Eiffel support. (Hiebert)
+
+When a file that is being edited is deleted, give a warning (like when the
+time stamp changed).
+
+Included newer versions of the HTML-generating Awk and Perl scripts. (Colombo)
+
+Linux console mouse support through "gpm". (Tsindlekht)
+
+Security fix: Disallow changing 'secure' and 'exrc' from a modeline. When
+'secure' is set, give a warning for changing options that contain a program
+name.
+
+Made the Perl interface work with Perl 5.005 and threads. (Verdoolaege)
+
+When giving an error message for an ambiguous mapping, include the offending
+mapping. (Roemer)
+
+Command line editing:
+- Command line completion of mappings. (Roemer)
+- Command line completion for ":function", ":delfunction", ":let", ":call",
+ ":if", etc. (Roemer)
+- When using CTRL-D completion for user commands that have
+ "-complete=tag_listfiles" also list the file names. (Madsen)
+- Complete the arguments of the ":command" command. (Webb)
+- CTRL-R . in command line inserts last inserted text. CTRL-F, CTRL-P, CTRL-W
+ and CTRL-A after CTRL-R are used to insert an object from under the cursor.
+ (Madsen)
+
+Made the text in uganda.txt about copying Vim a bit more clear.
+
+Updated the Vim tutor. Added the "vimtutor" command, which copies the tutor
+and starts Vim on it. "make install" now also copies the tutor.
+
+In the output of ":clist" the current entry is highlighted, with the 'i'
+highlighting (same as used for 'incsearch').
+
+For the ":clist" command, you can scroll backwards with "b" (one screenfull),
+"u" (half a screenfull) and "k" (one line).
+
+Multi-byte support:
+- X-input method for multi-byte characters. And various fixes for multi-byte
+ support. (Nam)
+- Hangul input method feature: |hangul|. (Nam)
+- Cleaned up configuration of multi-byte support, XIM, fontset and Hangul
+ input. Each is now configurable separately.
+- Changed check for GTK_KEYBOARD to HANGUL_KEYBOARD_TYPE. (Nam)
+- Added doc/hangulin.txt: Documentation for the Hangul input code. (Nam)
+- XIM support for GTK+. (Nam)
+- First attempt to include support for SJIS encoding. (Nagano)
+- When a double-byte character doesn't fit at the end of the line, put a "~"
+ there and print it on the next line.
+- Optimize output of multi-byte text. (Park)
+- Win32 IME: preedit style is like over-the-spot. (Nagano)
+- Win32 IME: IME mode change now done with ImmSetOpenStatus. (Nagano)
+- GUI Athena: file selection dialog can display multi-byte characters.
+ (Nagano)
+- Selection reply for XA_TEXT as XA_STRING. (Nagano)
+
+"runtime/macros/diffwin.vim". Mappings to make a diff window. (Campbell)
+
+Added ".obj" to the 'suffixes' option.
+
+Reduced size of syntax/synload.vim by using the ":SynAu" user command.
+Automated numbering of Syntax menu entries in menu.vim.
+In the Syntax menu, insert separators between syntax names that start with
+a different letter. (Geddes)
+
+Xterm:
+- Clipboard support when using the mouse in an xterm. (Madsen)
+- When using the xterm mouse, track dragging of the mouse. Use xterm escape
+ sequences when possible. It is more precise than other methods, but
+ requires a fairly recent xterm version. It is enabled with "xterm2" in
+ 'ttymouse'. (Madsen)
+- Check xterm patch level, to set the value of 'ttymouse'. Has only been
+ added to xterm recently (patch level > 95). Uses the new 't_RV' termcap
+ option. Set 'ttymouse' to "xterm2" when a correct response is recognized.
+ Will make xterm mouse dragging work better.
+- Support for shifted function keys on xterm. Changed codes for shifted
+ cursor keys to what the xterm actually produces. Added codes for shifted
+ <End> and <Home>.
+- Added 't_WP' to set the window position in pixels and 't_WS' to set the
+ window size in characters. Xterm can now move (used for ":winpos") and
+ resize (use for ":set lines=" and ":set columns=").
+
+X11:
+- When in Visual mode but not owning the selection, display the Visual area
+ with the VisualNOS group to show this. (Madsen)
+- Support for requesting the type of clipboard support. Used for AIX and
+ dtterm. (Wittig)
+- Support compound_text selection (even when compiled without multi-byte).
+
+Swap file:
+- New variation for naming swap files: Replace path separators into %, place
+ all swap files in one directory. Used when a name in 'dir' ends in two path
+ separators. (Madsen)
+- When a swap file is found, show whether it contains modifications or not in
+ the informative message. (Madsen)
+- When dialogs are supported, use a dialog to ask the user what to do when a
+ swapfile already exists.
+
+"popup_setpos" in 'mousemodel' option. Allows for moving the cursor when
+using the right mouse button.
+
+When a buffer is deleted, the selection for which buffer to display instead
+now uses the most recent entry from the jump list. (Madsen)
+
+When using CTRL-O/CTRL-I, skip deleted buffers.
+
+A percentage is shown in the ruler, when there is room.
+
+Used autoconf 1.13 to generate configure.
+
+Included get_lisp_indent() from Dirk van Deun. Does better Lisp indenting
+when 'p' flag in 'cpoptions' is not included.
+
+Made the 2html.vim script quite a bit faster. (based on ideas from Geddes)
+
+Unix:
+- Included the name of the user that compiled Vim and the system name it was
+ compiled on in the version message.
+- "make install" now also installs the "tools" directory. Makes them
+ available for everybody.
+- "make check" now does the same as "make test". "make test" checks for
+ Visual block mode shift, insert, replace and change.
+- Speed up comparing a file name with existing buffers by storing the
+ device/inode number with the buffer.
+- Added configure arguments "--disable-gtk", "--disable-motif" and
+ "--disable-athena", to be able to disable a specific GUI (when it doesn't
+ work).
+- Renamed the configure arguments for disabling the check for specific GUIs.
+ Should be clearer now. (Kahn)
+- On a Digital Unix system ("OSF1") check for the curses library before
+ termlib and termcap. (Schild)
+- "make uninstall_runtime" will only delete the version-specific files. Can
+ be used to delete the runtime files of a previous version.
+
+Macintosh: (St-Amant)
+- Dragging the scrollbar, like it's done for the Win32 GUI. Moved common code
+ from gui_w32.c to gui.c
+- Added dialogs and file browsing.
+- Resource fork preserved, warning when it will be lost.
+- Copy original file attributes to newly written file.
+- Set title/notitle bug solved.
+- Filename completion improved.
+- Grow box limit resize to a char by char size.
+- Use of rgb.txt for more colors (but give back bad color).
+- Apple menu works (beside the about...).
+- Internal border now vim compliant.
+- Removing a menu doesn't crash anymore.
+- Weak-linking of Python 1.5.1 (only on PPC). Python is supported when the
+ library is available.
+- If an error is encountered when sourcing the users .vimrc, the alert box now
+ shows right away with the OK button defaulted. There's no more "Delete"-key
+ sign at the start of each line
+- Better management of environment variables. Now $VIM is calculated only
+ once, not regenerated every time it is used.
+- No more CPU hog when in background.
+- In a sourced Vim script the Mac file format can be recognized, just like DOS
+ file format is.
+
+When both "unix" and "mac" are present in 'fileformats', prefer "mac" format
+when there are more CR than NL characters.
+When using "mac" fileformat, use CR instead of a NL, because NL is used for
+NUL. Will preserve all characters in a file. (Madsen)
+
+The DOS install.exe now contains checks for an existing installation. It
+avoids setting $VIM and $PATH again.
+The install program for Dos/Windows can now install Vim in the popup menu, by
+adding two registry keys.
+
+Port to EGCS/mingw32. New Makefile.ming. (Aaron)
+
+DOS 16 bit: Don't include cursor shape stuff. Save some bytes.
+
+TCL support to Makefile.w32. (Duperval)
+
+OS/2: Use argv[0] to find runtime files.
+
+When using "gf" to go to a buffer that has already been used, jump to the
+line where the cursor last was.
+
+Colored the output of ":tselect" a bit more. Different highlighting between
+tag name and file name. Highlight field name ("struct:") separately from
+argument.
+
+Backtick expansion for non-Unix systems. Based on a patch from Aaron.
+Allows the use of things like ":n `grep -l test *.c`" and
+"echo expand('`ls m*`')".
+
+Check for the 'complete' option when it is set. (Acevedo)
+'d' flag in 'complete' searches for defined names or macros.
+While searching for Insert mode completions in include files and tags files,
+check for typeahead, so that you can use matches early. (Webb)
+The '.' flag in 'complete' now scans the current buffer completely, ignoring
+'nowrapscan'. (Webb)
+
+Added '~' flag to 'whichwrap'. (Acevedo)
+
+When ending the Visual mode (e.g., with ESC) don't grab ownership of the
+selection.
+
+In a color terminal, "fg" and "bg" can be used as color names. They stand for
+the "Normal" colors.
+
+A few cscope cleanups. (Kahn)
+
+Included changed vimspell.sh from Schemenauer.
+
+Concatenation of strings in an expression with "." is a bit faster. (Roemer)
+
+The ":redir" command can now redirect to a register: ":redir @r". (Roemer)
+
+Made the output of ":marks" and ":jumps" look similar. When the mark is in
+the current file, show the text at the mark. Also for ":tags".
+
+When configure finds ftello() and fseeko(), they are used in tag.c (for when
+you have extremely big tags files).
+
+Configure check for "-FOlimit,2000" argument for the compiler. (Borsenkow)
+
+GUI:
+- When using ":gui" in a non-GUI Vim, give a clear error message.
+- "gvim -v" doesn't start the GUI (if console support is present).
+- When in Ex mode, use non-Visual selection for the whole screen.
+- When starting with "gvim -f" and using ":gui" in the .gvimrc file, Vim
+ forked anyway. Now the "-f" flag is remembered for ":gui". Added "gui -b"
+ to run gvim in the background anyway.
+
+Motif GUI:
+- Check for "-lXp" library in configure (but it doesn't work yet...).
+- Let configure check for Lesstif in "/usr/local/Lesstif/Motif*". Changed the
+ order to let a local Motif version override a system standard version.
+
+Win32 GUI:
+- When using "-register" or "-unregister" in the non-OLE version, give an
+ error message.
+- Use GTK toolbar icons. Make window border look better. Use sizing handles
+ on the lower left&right corners of the window. (Negri)
+- When starting an external command with ":!start" and the command can not be
+ executed, give an error message. (Webb)
+- Use sizing handles for the grey rectangles below the scrollbars. Can draw
+ toolbar in flat mode now, looks better. (Negri)
+- Preparations for MS-Windows 3.1 addition. Mostly changing WIN32 to MSWIN
+ and USE_GUI_WIN32 to USE_GUI_MSWIN. (Negri)
+
+Avoid allocating the same string four times in buflist_findpat(). (Williams)
+
+Set title and icon text with termcap options 't_ts', 't_fs', 't_IS' and
+'t_IE'. Allows doing this on any terminal that supports setting the title
+and/or icon text. (Schild)
+
+New 'x' flag in 'comments': Automatically insert the end part when its last
+character is typed. Helps to close a /* */ comment in C. (Webb)
+
+When expand() has a second argument which is non-zero, don't use 'suffixes'
+and 'wildignore', return all matches.
+
+'O' flag in 'cpoptions: When not included, Vim will not overwrite a file, if
+it didn't exist when editing started but it does exist when the buffer is
+written to the file. The file must have been created outside of Vim, possibly
+without the user knowing it. When this is detected after a shell command,
+give a warning message.
+
+When editing a new file, CTRL-G will show [New file]. When there were errors
+while reading the file, CTRL-G will show [Read errors].
+
+":wall" can now use a dialog and file-browsing when needed.
+
+Grouped functionality into new features, mainly to reduce the size of the
+minimal version:
++linebreak: 'showbreak', 'breakat' and 'linebreak'
++visualextra: "I"nsert and "A"ppend in Visual block mode, "c"hange all lines
+ in a block, ">" and "<": Shifting a block, "r": Replacing a
+ Visual area with one character.
++comments: 'comments'
++cmdline_info: 'ruler' and 'showcmd'. Replaces +showcmd.
+"+title" Don't add code to set title or icon for MSDOS, this was not
+ possible anyway.
++cmdline_compl Disable commandline completion at compile time, except for
+ files, directories and help items.
+
+Moved features from a list of function calls into an array. Should save a bit
+of space.
+
+While entering the body of a function, adjust indent according to "if" and
+"while" commands.
+
+VMS: Adjusted os_vms.mms a bit according to suggestions from Arpadffy.
+
+The flags in the 'comments' option can now include an offset. This makes it
+possible to align "/*****", "/* xxx" and "/*" comments with the same
+'comments' setting. The default value for 'comments' uses this.
+Added 'O' flag: Don't use this part for the "O" command. Useful for "set
+com=sO:*\ -,mO:*\ \ ,exO:*/"
+
+FileType autocommands recognize ".bak", ".orig" and "~" extensions and remove
+them to find the relevant extension.
+
+The tutorial for writing a Vim script file has been extended.
+
+Some more highlighting in help files, for items that are not typed literally.
+
+Can use "CTRL-W CTRL-G" like "CTRL-W g".
+
+"make test" for OS/2.
+
+Adjusted configure to automatically use the GUI for BeOS.
+
+
+Fixed *fixed-5.4*
+-----
+
+5.3.1: When using an autocommand for BufWritePre that changes the name of the
+buffer, freed memory would be used. (Geddes)
+
+Mac: Compiler didn't understand start of skip_class_name().
+
+Win32 GUI:
+- When cancelling the font requester, don't give an error message.
+- When a tearoff-menu is open and its menu is deleted, Vim could crash.
+ (Negri)
+- There was a problem on Windows 95 with (un)maximizing the window.
+ (Williams)
+- when 'mousehide' is set, the mouse would stay hidden when a menu is dropped
+ with the keyboard. (Ralston)
+- The tempname() function already created the file. Caused problems when
+ using ":w". Now the file is deleted.
+- Cursor disappeared when ending up in the top-left character on the screen
+ after scrolling. (Webb)
+- When adding a submenu for a torn-off menu, it was not updated.
+- Menu tooltip was using the toolbar tooltip. (Negri)
+- Setting 'notitle' didn't remove the title. (Steed)
+- Using ":!start cmd" scrolled the screen one line up, and didn't wait for
+ return when the command wasn't found.
+
+Cscope interface: Sorting of matches was wrong. Starting the interface could
+fail. (Kahn)
+
+Motif GUI: Could not compile with Motif 1.1, because some tear-off
+functionality was not in #ifdefs.
+
+Configure could sometimes not compile or link the test program for sizeof(int)
+properly. This caused alignment problems for the undo structure allocations.
+Added a safety check that SIZEOF_INT is not zero.
+
+Added configure check to test if strings.h can be included after string.h.
+Some systems can't handle it.
+Some systems need both string.h and strings.h included. Adjusted vim.h for
+that. Removed including string.h from os_unixx.h, since it's already in
+vim.h. (Savage)
+AIX: defining _NO_PROTO in os_unix.h causes a conflict between string.h and
+strings.h, but after the configure check said it was OK. Also define
+_NO_PROTO for AIX in the configure check. (Winn)
+
+When closing a window with CTRL-W c, the value of 'hidden' was not taken into
+account, the buffer was always unloaded. (Negri)
+
+Unix Makefile: "make install" always tried to rename an older executable and
+remove it. This caused an error message when it didn't exit. Added a check
+for the existence of an old executable.
+The command line for "make install" could get too long, because of the many
+syntax files. Now first do a "cd" to reduce the length.
+
+On RISCOS and MSDOS, reading a file could fail, because the short filename was
+used, which can be wrong after a ":!cd".
+
+In the DOS versions, the wrong install.exe was included (required Windows).
+Now the install.exe version is included that is the same as the Vim version.
+This also supports long file names where possible.
+
+When recording, and stopping while in Insert mode with CTRL-O q, the CTRL-O
+would also be recorded.
+
+32bit DOS version: "vim \file", while in a subdirectory, resulted in "new
+file" for "file" in the local directory, while "\file" did exist. When
+"file" in the current directory existed, this didn't happen.
+
+MSDOS: Mouse could not go beyond 80 columns in 132 columns mode. (Young)
+
+"make test" failed in the RedHat RPM, because compatible is off by default.
+
+In Insert mode <C-O><C-W><C-W> changes to other window, but the status bars
+were not updated until another character was typed.
+
+MSDOS: environment options in lowercase didn't work, although they did in the
+Win32 versions. (Negri)
+
+After ":nohlsearch", a tag command switched highlighting back on.
+
+When using "append" command as the last line in an autocommand, Vim would
+crash.
+
+RISCOS: The scroll bumpers (?) were not working properly. (Leonard)
+
+"zl" and "zh" could move the cursor, but this didn't set the column in which
+e.g., "k" would move the cursor.
+
+When doing ":set all&" the value of 'scroll' was not set correctly. This
+caused an error message when later setting any other number option.
+
+When 'hlsearch' highlighting has been disabled with ":nohlsearch",
+incremental searching would switch it back on too early.
+
+When listing tags for ":tselect", and using a non-search command, and the last
+character was equal to the first (e.g., "99"), the last char would not be
+shown.
+
+When searching for tags with ":tag" Vim would assume that all matches had been
+found when there were still more (e.g. from another tags file).
+
+Win32: Didn't recognize "c:\" (e.g., in tags file) as absolute path when
+upper/lowercase was different.
+
+Some xterms (Debian) send <Esc>OH for HOME and <Esc>OF for END. Added these
+to the builtin-xterm.
+
+In ex mode, any CR was seen as the end of the line. Only a NL should be
+handled that way. broke ":s/foo/some^Mtext/".
+
+In menu.vim, a vmenu was used to override an amenu. That didn't work, because
+the system menu file doesn't overwrite existing menus. Added explicit vunmenu
+to solve this.
+
+Configure check for terminal library could find a library that doesn't work at
+runtime (Solaris: shared library not found). Added a check that a program
+with tgoto() can run correctly.
+
+Unix: "echo -n" in the Makefile doesn't work on all systems, causing errors
+compiling pathdef.c. Replaced it with "tr".
+
+Perl: DO_JOIN was redefined by Perl. Undefined it in the perl files.
+
+Various XIM and multi-byte fixes:
+- Fix user cannot see his language while he is typing his language with
+ off-the-spot method. (Nagano)
+- Fix preedit position using text/edit area (using gui.wid). (Nagano)
+- remove 'fix dead key' codes. It was needed since XNFocusWindow was
+ "x11_window", XNFocusWindow is now gui.wid. (Nagano)
+- Remove some compile warnings and fix typos. (Namsh)
+- For status area, check the gtk+ version while Vim runs. I believe it is
+ better than compile time check. (Namsh)
+- Remove one FIXME for gtk+-xim. (Namsh)
+- XIM: Dead keys didn't work for Czech. (Vyskovsky)
+- Multibyte: If user input only 3byte such as mb1_mb2_eng or eng_mb1_mb2 VIM
+ could convert it to special character. (Nam)
+- Athena/Motif with XIM: fix preedit area. (Nam)
+- XIM: Composed strings were sometimes ignored. Vim crashed when compose
+ string was longer than 256 bytes. IM's geometry control is fixed. (Nam,
+ Nagano)
+- Win32 multi-byte: hollowed cursor width on a double byte char was wrong.
+ (Nagano)
+- When there is no GUI, selecting XIM caused compilation problems.
+ Automatically disable XIM when there is no GUI in configure.
+- Motif and Athena: When compiled with XIM, but the input method was not
+ enabled, there would still be a status line. Now the status line is gone if
+ the input method doesn't work. (Nam)
+
+Win32: tooltip was not removed when selecting a parent menu (it was when
+selecting a menu entry). (Negri)
+
+Unix with X: Some systems crash on exit, because of the XtCloseDisplay() call.
+Removed it, it should not be necessary when exiting.
+
+Win32: Crash on keypress when compiled with Borland C++. (Aaron)
+
+When checking for Motif library files, prefer the same location as the include
+files (with "include" replaced with "lib") above another entry.
+
+Athena GUI: Changed "XtOffset()" in gui_at_fs.c to "XtOffsetOf()", like it's
+used in gui_x11.c.
+
+Win32: When testing for a timestamp of a file on floppy, would get a dialog
+box when the floppy has been removed. Now return with an error. (Negri)
+
+Win32 OLE: When forced to come to the foreground, a minimized window was still
+minimized, now it's restored. (Zivkov)
+
+There was no check for a positive 'shiftwidth'. A negative value could cause
+a hangup, a zero value a crash.
+
+Athena GUI: horizontal scrollbar wasn't updated correctly when clicking right
+or left of the thumb.
+
+When making a Visual-block selection in one window, and trying to scroll
+another, could cause errors for accessing non-existent line numbers.
+
+When 'matchpairs' contains "`:'", jumping from the ` to the ' didn't work
+properly.
+
+Changed '\"' to '"' to make it compatible with old C compilers.
+
+The command line expansion for mappings caused a script with a TAB between lhs
+and rhs of a map command to fail. Assume the TAB is to separate lhs and rhs
+when there are no mappings to expand.
+
+When editing a file with very long lines with 'scrolloff' set, "j" would
+sometimes end up in a line which wasn't displayed.
+
+When editing a read-only file, it was completely read into memory, even when
+it would not fit. Now create a swap file for a read-only file when running
+out of memory while reading the file.
+
+When using ":set cino={s,e-s", a line after "} else {" was not indented
+properly. Also added a check for this in test3.in.
+
+The Hebrew mapping for the command line was remembered for the next command
+line. That isn't very useful, a command is not Hebrew. (Kol)
+
+When completing file names with embedded spaces, like "Program\ files", this
+didn't work. Also for user commands. Moved backslash_halve() down to
+mch_expandpath().
+
+When using "set mouse=a" in Ex mode, mouse events were handled like typed
+text. Then typing "quit" screwed up the mouse behavior of the xterm.
+
+When repeating an insert with "." that contains a CTRL-Y, a number 5 was
+inserted as "053".
+
+Yanking a Visual area, with the cursor past the line, didn't move the cursor
+back onto the line. Same for "~", "u", "U" and "g?"
+
+Win32: Default for 'grepprg' could be "findstr /n" even though there is no
+findstr.exe (Windows 95). Check if it exists, and fall back to "grep -n" if
+it doesn't.
+
+Because gui_mouse_moved() inserted a leftmouse click in the input buffer,
+remapping a leftmouse click caused strange effects. Now Insert another code
+in the input buffer. Also insert a leftmouse release, to avoid the problem
+with ":map <LeftMouse> l" that the next release is seen as the release for the
+focus click.
+
+With 'wrap' on, when using a line that doesn't fit on the screen, if the start
+of the Visual area is before the start of the screen, there was no
+highlighting. Also, 'showbreak' doesn't work properly.
+
+DOS, Win32: A pattern "[0-9]\+" didn't work in autocommands.
+
+When creating a swap file for a buffer which isn't the current buffer, could
+get a mixup of short file name, resulting in a long file name when a short
+file name was required. makeswapname() was calling modname() instead of
+buf_modname().
+
+When a function caused an error, and the error message was very long because
+of recursiveness, this would cause a crash.
+
+'suffixes' were always compared with matching case. For MS-DOS, Win32 and
+OS/2 case is now ignored.
+
+The use of CHARBITS in regexp.c didn't work on some Linux. Don't use it.
+
+When generating a script file, 'cpo' was made empty. This caused backslashes
+to disappear from mappings. Set it to "B" to avoid that.
+
+Lots of typos in the documentation. (Campbell)
+
+When editing an existing (hidden) buffer, jump to the last used cursor
+position. (Madsen)
+
+On a Sun the xterm screen was not restored properly when suspending. (Madsen)
+
+When $VIMINIT is processed, 'nocompatible' was only set after processing it.
+
+Unix: Polling for a character wasn't done for GPM, Sniff and Xterm clipboard
+all together. Cleaned up the code for using select() too.
+
+When executing external commands from the GUI, some typeahead was lost. Added
+some code to regain as much typeahead as possible.
+
+When the window height is 5 lines or fewer, <PageDown> didn't use a one-line
+overlap, while <PageUp> does. Made sure that <PageUp> uses the same overlap
+as <PageDown>, so that using them both always displays the same lines.
+
+Removed a few unused functions and variables (found with lint).
+
+Dictionary completion didn't use 'infercase'. (Raul)
+
+Configure tests failed when the Perl library was not in LD_LIBRARY_PATH.
+Don't use the Perl library for configure tests, add it to the linker line only
+when linking Vim.
+
+When using ncurses/terminfo, could get a 't_Sf' and 't_Sb' termcap entry that
+has "%d" instead of "%p1%d". The light background colors didn't work then.
+
+GTK GUI with ncurses: Crashed when starting up in tputs(). Don't use tputs()
+when the GUI is active.
+
+Could use the ":let" command to set the "count", "shell_error" and "version"
+variables, but that didn't work. Give an error message when trying to set
+them.
+
+On FreeBSD 3.0, tclsh is called tclsh8.0. Adjusted configure.in to find it.
+
+When Vim is linked with -lncurses, but python uses -ltermcap, this causes
+trouble: "OOPS". Configure now removes the -ltermcap.
+
+:@" and :*" didn't work properly, because the " was recognized as the start of
+a comment.
+
+Win32s GUI: Minimizing the console where a filter command runs in caused
+trouble for detecting that the filter command has finished. (Negri)
+
+After executing a filter command from an xterm, the mouse would be disabled.
+It would work again after changing the mode.
+
+Mac GUI: Crashed in newenv(). (St-Amant)
+
+The menus and mappings in mswin.vim didn't handle text ending in a NL
+correctly. (Acevedo)
+
+The ":k" command didn't check if it had a valid argument or extra characters.
+Now give a meaningful error message. (Webb)
+
+On SGI, the signal function doesn't always have three arguments. Check for
+struct sigcontext to find out. Might still be wrong...
+
+Could crash when using 'hlsearch' and search pattern is "^".
+
+When search patterns were saved and restored, status of no_hlsearch was not
+also saved and restored (from ":nohlsearch" command).
+
+When using setline() to make a line shorter, the cursor position was not
+adjusted.
+
+MS-DOS and Win95: When trying to edit a file and accidentally adding a slash
+or backslash at the end, the file was deleted. Probably when trying to create
+the swap file. Explicitly check for a trailing slash or backslash before
+trying to read a file.
+
+X11 GUI: When starting the GUI failed and received a deadly signal while
+setting the title, would lock up when trying to exit, because the title is
+reset again. Avoid using mch_settitle() recursively.
+
+X11 GUI: When starting the GUI fails, and then trying it again, would crash,
+because argv[] has been freed and x11_display was reset to NULL.
+
+Win32: When $HOME was set, would put "~user" in the swap file, which would
+never compare with a file name, and never cause the attention message. Put
+the full path in the swap file instead.
+
+Win32 console: There were funny characters at the end of the "vim -r" swap
+files message (direct output of CR CR LF).
+
+DOS 32 bit: "vim -r" put the text at the top of the window.
+
+GUI: With 'mousefocus' set, got mouse codes as text with "!sleep 100" or "Q".
+
+Motif and Win32 GUI: When changing 'guifont' to a font of the same size the
+screen wasn't redrawn.
+
+Unix: When using ":make", jumping to a file b.c, which is already open as a
+symbolic link a.c, opened a new buffer instead of using the existing one.
+
+Inserting text in the current buffer while sourcing the .vimrc file would
+cause a crash or hang. The memfile for the current buffer was never
+allocated. Now it's allocated as soon as something is written in the buffer.
+
+DOS 32 bit: "lightblue" background worked for text, but not drawn parts were
+black.
+
+DOS: Colors of console were not restored upon exiting.
+
+When recording, with 'cmdheight' set to 2 and typing Esc> in Insert mode
+caused the "recording" message to be doubled.
+
+Spurious "file changed" messages could happen on Windows. Now tolerate a one
+second difference, like for Linux.
+
+GUI: When returning from Ex mode, scrollbars were not updated.
+
+Win32: Copying text to the clipboard containing a <CR>, pasting it would
+replace it with a <NL> and drop the next character.
+
+Entering a double byte character didn't work if the second byte is in [xXoO].
+(Eric Lee)
+
+vim_realloc was both defined and had a prototype in proto/misc2.pro. Caused
+conflicts on Solaris.
+
+A pattern in an autocommand was treated differently on DOS et al. than on
+Unix. Now it's the same, also when using backslashes.
+
+When using <Tab> twice for command line completion, without a match, the <Tab>
+would be inserted. (Negri)
+
+Bug in MS-Visual C++ 6.0 when compiling ex_docmd.c with optimization. (Negri)
+
+Testing the result of mktemp() for failure was wrong. Could cause a crash.
+(Peters)
+
+GUI: When checking for a ".gvimrc" file in the current directory, didn't check
+for a "_gvimrc" file too.
+
+Motif GUI: When using the popup menu and then adding an item to the menu bar,
+the menu bar would get very high.
+
+Mouse clicks and special keys (e.g. cursor keys) quit the more prompt and
+dialogs. Now they are ignored.
+
+When at the more-prompt, xterm selection didn't work. Now use the 'r' flag in
+'mouse' also for the more-prompt.
+
+When selecting a Visual area of more than 1023 lines, with 'guioptions' set to
+"a", could mess up the display because of a message in free_yank(). Removed
+that message, except for the Amiga.
+
+Moved auto-selection from ui_write() to the screen update functions. Avoids
+unexpected behavior from a low-level function. Also makes the different
+feedback of owning the selection possible.
+
+Vi incompatibility: Using "i<CR>" in an indent, with 'ai' set, used the
+original indent instead of truncating it at the cursor. (Webb)
+
+":echo x" didn't stop at "q" for the more prompt.
+
+Various fixes for Macintosh. (St-Amant)
+
+When using 'selectmode' set to "exclusive", selecting a word and then using
+CTRL-] included the character under the cursor.
+
+Using ":let a:name" in a function caused a crash. (Webb)
+
+When using ":append", an empty line didn't scroll up.
+
+DOS etc.: A file name starting with '!' didn't work. Added '!' to default for
+'isfname'.
+
+BeOS: Compilation problem with prototype of skip_class_name(). (Price)
+
+When deleting more than one line, e.g., with "de", could still use "U"
+command, which didn't work properly then.
+
+Amiga: Could not compile ex_docmd.c, it was getting too big. Moved some
+functions to ex_cmds.c.
+
+The expand() function would add a trailing slash for directories.
+
+Didn't give an error message when trying to assign a value to an argument of a
+function. (Webb)
+
+Moved including sys/ptem.h to after termios.h. Needed for Sinix.
+
+OLE interface: Don't delete the object in CVimCF::Release() when the reference
+count becomes zero. (Cordell)
+VisVim could still crash on exit. (Erhardt)
+
+"case a: case b:" (two case statements in one line) aligned with the second
+case. Now it uses one 'sw' for indent. (Webb)
+
+Font initialisation wasn't right for Athena/Motif GUI. Moved the call to
+highlight_gui_started() gui_mch_init() to gui_mch_open(). (Nam)
+
+In Replace mode, backspacing over a TAB before where the replace mode started
+while 'sts' is different from 'ts', would delete the TAB.
+
+Win32 console: When executing external commands and switching between the two
+console screens, Vim would copy the text between the buffers. That caused the
+screen to be messed up for backtick expansion.
+
+":winpos -1" then ":winpos" gave wrong error message.
+
+Windows commander creates files called c:\tmp\$wc\abc.txt. Don't remove the
+backslash before the $. Environment variables were not expanded anyway,
+because of the backslash before the dollar.
+
+Using "-=" with ":set" could remove half a part when it contains a "\,".
+E.g., ":set path+=a\\,b" and then "set path-=b" removed ",b".
+
+When Visually selecting lines, with 'selection' set to "inclusive", including
+the last char of the line, "<<" moved an extra line. Also for other operators
+that always work on lines.
+
+link.sh changed "-lnsl_s" to "_s" when looking for "nsl" to be removed.
+Now it only remove whole words.
+
+When jumped to a mark or using "fz", and there is an error, the current column
+was lost. E.g. when using "$fzj".
+
+The "g CTRL-G" command could not be interrupted, even though it can take a
+long time.
+
+Some terminals do have <F4> and <xF4>. <xF4> was always interpreted as <F4>.
+Now map <xF4> to <F4>, so that the user can override this.
+
+When compiling os_win32.c with MIN_FEAT the apply_autocmds() should not be
+used. (Aaron)
+
+This autocommand looped forever: ":au FileChangedShell * nested e <afile>"
+Now FileChangeShell never nests. (Roemer)
+
+When evaluating an ":elseif" that was not going to matter anyway, ignore
+errors. (Roemer)
+
+GUI Lesstif: Tearoff bar was the last item, instead of the first.
+
+GUI Motif: Colors of tear-off widgets was wrong when 't' flag added to
+'guioptions' afterwards. When 't' flag in 'guioptions' is excluded, would
+still get a tearoff item in a new menu.
+
+An inode number can be "long long". Use ino_t instead of long. Added
+configure check for ino_t.
+
+Binary search for tags was using a file offset "long" instead of "off_t".
+
+Insert mode completion of tags was not using 'ignorecase' properly.
+
+In Insert mode, the <xFn> keys were not properly mapped to <Fn> for the
+default mappings. Also caused errors for ":mkvimrc" and ":mksession".
+
+When jumping to another window while in Insert mode, would get the "warning:
+changing readonly file" even when not making a change.
+
+A '(' or '{' inside a trailing "//" comment would disturb C-indenting.
+When using two labels below each other, the second one was not indented
+properly. Comments could mess up C-indenting in many places. (Roemer)
+
+Could delete or redefine a function while it was being used. Could cause a
+crash.
+In a function it's logical to prepend "g:" to a system variable, but this
+didn't work. (Roemer)
+
+Hangul input: Buffer would overflow when user inputs invalid key sequence.
+(Nam)
+
+When BufLoad or BufEnter autocommands change the topline of the buffer in the
+window, it was overruled and the cursor put halfway the window. Now only put
+the cursor halfway if the autocommands didn't change the topline.
+
+Calling exists("&option") always returned 1. (Roemer)
+
+Win32: Didn't take actually available memory into account. (Williams)
+
+White space after an automatically inserted comment leader was not removed
+when 'ai' is not set and <CR> hit just after inserting it. (Webb)
+
+A few menus had duplicated accelerators. (Roemer)
+
+Spelling errors in documentation, quite a few "the the". (Roemer)
+
+Missing prototypes for Macintosh. (Kielhorn)
+
+Win32: When using 'shellquote' or 'shellxquote', the "!start cmd" wasn't
+executed in a disconnected process.
+
+When resizing the window, causing a line before the cursor to wrap or unwrap,
+the cursor was displayed in the wrong position.
+
+There was quite a bit of dead code when compiling with minimal features.
+
+When doing a ":%s///" command that makes lines shorter, such that lines above
+the final cursor position no longer wrap, the cursor position was not updated.
+
+get_id_list() could allocate an array one too small, when a "contains=" item
+has a wildcard that matches a group name that is added just after it. E.g.:
+"contains=a.*b,axb". Give an error message for it.
+
+When yanking a Visual area and using the middle mouse button -> crash. When
+clipboard doesn't work, now make "* always use "".
+
+Win32: Using ":buf a\ b\file" didn't work, it was interpreted as "ab\file".
+
+Using ":ts ident", then hit <CR>, with 'cmdheight' set to 2: command line was
+not cleared, the tselect prompt was on the last but one line.
+
+mksession didn't restore the cursor column properly when it was after a tab.
+Could not get all windows back when using a smaller terminal screen. Didn't
+restore all windows when "winsize" was not in 'sessionoptions'. (Webb)
+
+Command line completion for ":buffer" depended on 'ignorecase' for Unix, but
+not for DOS et al.. Now don't use 'ignorecase', but let it depend on whether
+file names are case sensitive or not (like when expanding file names).
+
+Win32 GUI: (Negri)
+- Redrawing the background caused flicker when resizing the window. Removed
+ _OnEraseBG(). Removed CS_HREDRAW and CS_VREDRAW flags from the
+ sndclass.style.
+- Some parts of the window were drawn in grey, instead of using the color from
+ the user color scheme.
+- Dropping a file on gvim didn't activate the window.
+- When there is no menu ('guioptions' excludes 'm'), never use the ALT key for
+ it.
+
+GUI: When resizing the window, would make the window height a bit smaller.
+Now round off to the nearest char cell size. (Negri)
+
+In Vi the ")" and "(" commands don't stop at a single space after a dot.
+Added 'J' flag in 'cpoptions' to make this behave Vi compatible. (Roemer)
+
+When saving a session without any buffers loaded, there would be a ":normal"
+command without arguments in it. (Webb)
+
+Memory leaks fixed: (Madsen)
+- eval.c: forgot to release func structure when func deleted
+- ex_docmd.c: forgot to release string after "<sfile>"
+- misc1.c: leak when completion pattern had no matches.
+- os_unix.c: forgot to release regexp after file completions
+
+Could crash when using a buffer without a name. (Madsen)
+Could crash when doing file name completion, because of backslash_halve().
+(Madsen)
+
+":@a" would do mappings on register a, which is not Vi compatible. (Roemer)
+
+":g/foo.*()/s/foobar/_&/gc" worked fine, but then "n" searched for "foobar"
+and displayed "/foo.*()". (Roemer)
+
+OS/2: get_cmd_output() was not included. Didn't check for $VIM/.vimrc file.
+
+Command line completion of options didn't work after "+=" and "-=".
+
+Unix configure: Test for memmove()/bcopy()/memcpy() tried redefining these
+functions, which could fail if they are defined already. Use mch_memmove() to
+redefine.
+
+Unix: ":let a = expand("`xterm`&")" started an xterm asynchronously, but
+":let a = expand("`xterm&`")" generated an error message, because the
+redirection was put after the '&'.
+
+Win32 GUI: Dialog buttons could not be selected properly with cursor keys,
+when the default is not the first button. (Webb)
+
+The "File has changed since editing started" (when regaining focus) could not
+always be seen. (Webb)
+
+When starting with "ex filename", the file message was overwritten with
+the "entering Ex mode" message.
+
+Output of ":tselect" listed name of file directly from the tags file. Now it
+is corrected for the position of the tags file.
+
+When 'backspace' is 0, could backspace over autoindent. Now it is no longer
+allowed (Vi compatible).
+
+In Replace mode, when 'noexpandtab' and 'smarttab' were set, and inserting
+Tabs, backspacing didn't work correctly for Tabs inserted at the start of the
+line (unless 'sts' was set too). Also, when replacing the first non-blank
+after which is a space, rounding the indent was done on the first non-blank
+instead of on the character under the cursor.
+
+When 'sw' at 4, 'ts' at 8 and 'smarttab' set: When a tab was appended after
+four spaces (they are replaced with a tab) couldn't backspace over the tab.
+
+In Insert mode, with 'bs' set to 0, couldn't backspace to before autoindent,
+even when it was removed with CTRL-D.
+
+When repeating an insert command where a <BS>, <Left> or other key causes an
+error, would flush buffers and remain in Insert mode. No longer flush
+buffers, only beep and continue with the insert command.
+
+Dos and Win32 console: Setting t_me didn't work to get another color. Made
+this works backwards compatible.
+
+For turkish (LANG = "tr") uppercase 'i' is not an 'I'. Use ASCII uppercase
+translation in vim_strup() to avoid language problems. (Komur)
+
+Unix: Use usleep() or nanosleep() for mch_delay() when available. Hopefully
+this avoids a hangup in select(0, ..) for Solaris 2.6.
+
+Vim would crash when using a script file with 'let &sp = "| tee"', starting
+vim with "vim -u test", then doing ":set sp=". The P_WAS_SET flag wasn't set
+for a string option, could cause problems with any string option.
+
+When using "cmd | vim -", stdin is not a terminal. This gave problems with
+GPM (Linux console mouse) and when executing external commands. Now close
+stdin and re-open it as a copy of stderr.
+
+Syntax highlighting: A "nextgroup" item was not properly stored in the state
+list. This caused missing of next groups when not redrawing from start to
+end, but starting halfway.
+
+Didn't check for valid values of 'ttymouse'.
+
+When executing an external command from the GUI, waiting for the child to
+terminate might not work, causing a hang. (Parmelan)
+
+"make uninstall" didn't delete the vimrc_example.vim and gvimrc_example.vim
+files and the vimtutor.
+
+Win32: "expand("%:p:h")" with no buffer name removed the directory name.
+"fnamemodify("", ":p")" did not add a trailing slash, fname_case() removed it.
+
+Fixed: When 'hlsearch' was set and the 'c' flag was not in 'cpoptions':
+highlighting was not correct. Now overlapping matches are handled correctly.
+
+Athena, Motif and GTK GUI: When started without focus, cursor was shown as if
+with focus.
+
+Don't include 'shellpipe' when compiled without quickfix, it's not used.
+Don't include 'dictionary' option when compiled without the +insert_expand
+feature.
+Only include the 'shelltype' option for the Amiga.
+
+When making a change to a line, with 'hlsearch' on, causing it to wrap, while
+executing a register, the screen would not be updated correctly. This was a
+generic problem in update_screenline() being called while must_redraw is
+VALID.
+
+Using ":bdelete" in a BufUnload autocommand could cause a crash. The window
+height was added to another window twice in close_window().
+
+Win32 GUI: When removing a menu item, the tearoff wasn't updated. (Negri)
+
+Some performance bottlenecks removed. Allocating memory was not efficient.
+For Win32 checking for available memory was slow, don't check it every time
+now. On NT obtaining the user name takes a long time, cache the result (for
+all systems).
+
+fnamemodify() with an argument ":~:." or ":.:~" didn't work properly.
+
+When editing a new file and exiting, the marks for the buffer were not saved
+in the viminfo file.
+
+":confirm only" didn't put up a dialog.
+
+These text objects didn't work when 'selection' was "exclusive": va( vi( va{
+vi{ va< vi< vi[ va[.
+
+The dialog for writing a readonly file didn't have a valid default. (Negri)
+
+The line number used for error messages when sourcing a file was reset when
+modelines were inspected. It was wrong when executing a function.
+
+The file name and line number for an error message wasn't displayed when it
+was the same as for the last error, even when this was long ago. Now reset
+the name/lnum after a hit-enter prompt.
+
+In a session file, a "%" in a file name caused trouble, because fprintf() was
+used to write it to the file.
+
+When skipping statements, a mark in an address wasn't skipped correctly:
+"ka|if 0|'ad|else|echo|endif". (Roemer)
+
+":wall" could overwrite a not-edited file without asking.
+
+GUI: When $DISPLAY was not set or starting the GUI failed in another way, the
+console mode then started with wrong colors and skipped initializations. Now
+do an early check if the GUI can be started. Don't source the menu.vim or
+gvimrc when it will not. Also do normal terminal initializations if the GUI
+might not start.
+
+When using a BufEnter autocommand to position the cursor and scroll the
+window, the cursor was always put at the last used line and halfway the window
+anyhow.
+
+When 'wildmode' was set to "longest,list:full", ":e *.c<Tab><Tab>" didn't list
+the matches. Also avoid that listing after a "longest" lists the wrong
+matches when the first expansion changed the string in front of the cursor.
+
+When using ":insert", ":append" or ":change" inside a while loop, was not able
+to break out of it with a CTRL-C.
+
+Win32: ":e ." took an awful long time before an error message when used in
+"C:\". Was caused by adding another backslash and then trying to get the full
+name for "C:\\".
+
+":winpos -10 100" was working like ":winpos -10 -10", because a pointer was
+not advanced past the '-' sign.
+
+When obtaining the value of a hidden option, would give an error message. Now
+just use a zero value.
+
+OS/2: Was using argv[0], even though it was not a useful name. It could be
+just "vim", found in the search path.
+
+Xterm: ":set columns=78" didn't redraw properly (when lines wrap/unwrap) until
+after a delay of 'updatetime'. Didn't check for the size-changed signal.
+
+'scrollbind' didn't work in Insert mode.
+Horizontal scrollbinding didn't always work for "0" and "$" commands (e.g.,
+when 'showcmd' was off).
+
+When compiled with minimal features but with GUI, switching on the mouse in an
+xterm caused garbage, because the mouse codes were not recognized. Don't
+enable the mouse when it can't be recognized. In the GUI it also didn't work,
+the arguments to the mouse code were not interpreted.
+
+When 'showbreak' used, in Insert mode, when the cursor is just after the last
+character in the line, which is also the in the rightmost column, the cursor
+position would be like the 'showbreak' string is shown, but it wasn't.
+
+Autocommands could move the cursor in a new file, so that CTRL-W i didn't show
+the right line. Same for when using a filemark to jump to another file.
+
+When redefining the argument list, the title used for other windows could be
+showing the wrong info about the position in the argument list. Also update
+this for a ":split" command without arguments.
+
+When editing file 97 of 13, ":Next" didn't work. Now it goes to the last
+file in the argument list.
+
+Insert mode completion (for dictionaries or included files) could not be
+interrupted by typing an <Esc>. Could get hit-enter prompt after line
+completion, or whenever the informative message would get too long.
+
+When using the ":edit" command to re-edit the same file, an autocommand to
+jump to the last cursor position caused the cursor to move. Now set the last
+used cursor position to avoid this.
+
+When 'comments' has a part that starts with white space, formatting the
+comment didn't work.
+
+At the ":tselect" prompt Normal mode mappings were used. That has been
+disabled.
+
+When 'selection' is not "old", some commands still didn't allow the cursor
+past the end-of-line in Visual mode.
+
+Athena: When a menu was deleted, it would appear again (but not functional)
+when adding another menu. Now they don't reappear anymore (although they are
+not really deleted either).
+
+Borland C++ 4.x had an optimizer problem in fill_breakat_flags(). (Negri)
+
+"ze" didn't work when 'number' was on. (Davis)
+
+Win32 GUI: Intellimouse code didn't work properly on Windows 98. (Robinson)
+
+A few files were including proto.h a second time, after vim.h had already done
+that, which could cause problems with the vim_realloc() macro.
+
+Win32 console: <M-x> or ALT-x was not recognized. Also keypad '+', '-' and
+'*'. (Negri)
+MS-DOS: <M-x> didn't work, produced a two-byte code. Now the alphabetic and
+number keys work. (Negri)
+
+When finding a lot of matches for a tag completion, the check for avoiding
+double matches could take a lot of time. Add a line_breakcheck() to be able
+to interrupt this. (Deshpande)
+
+When the command line was getting longer than the screen, the more-prompt
+would be given regularly, and the cursor position would be wrong. Now only
+show the part of the command line that fits on the screen and force the cursor
+to be positioned on the visible part. There can be text after the cursor
+which isn't editable.
+
+At the more prompt and with the console dialog, a cursor key was interpreted
+as <Esc> and OA. Now recognize special keys in get_keystroke(). Ignore mouse
+and scrollbar events.
+
+When typing a BS after inserting a middle comment leader, typing the last char
+of the end comment leader still changed it into the end comment leader. (Webb)
+
+When a file system is full, writing to a swap file failed. Now first try to
+write one block to the file. Try next entry in 'dir' if it fails.
+
+When "~" is in 'whichwrap', doing "~" on last char of a line didn't update the
+display.
+
+Unix: Expanding wildcards for ":file {\\}" didn't work, because "\}" was
+translated to "}" before the shell got it. Now don't remove backslashes when
+wildcards are going to be expanded.
+
+Unix: ":e /tmp/$uid" didn't work. When expanding environment variables in a
+file name doesn't work, use the shell to expand the file name. ":e /tmp/$tty"
+still doesn't work though.
+
+"make test" didn't always work on DOS/Windows for test30, because it depended
+on the external "echo" command.
+
+The link.sh script used "make" instead of $MAKE from the Makefile. Caused
+problems for generating pathdef.c when "make" doesn't work properly.
+
+On versions that can do console and GUI: In the console a typed CSI code could
+cause trouble.
+
+The patterns in expression evaluation didn't ignore the 'l' flag in
+'cpoptions'. This broke the working of <CR> in the options window.
+
+When 'hls' off and 'ai' on, "O<Esc>" did remove the indent, but it was still
+highlighted red for trailing space.
+
+Win32 GUI: Dropping an encrypted file on a running gvim didn't work right. Vim
+would loop while outputting "*" characters. vgetc() was called recursively,
+thus it returns NUL. Added safe_vgetc(), which reads input directly from the
+user in this situation.
+
+While reading text from stdin, only an empty screen was shown. Now show that
+Vim is reading from stdin.
+
+The cursor shape wasn't set properly when returning to Insert mode, after
+using a CTRL-O /asdf command which fails. It would be OK after a few seconds.
+Now it's OK right away.
+
+The 'isfname' default for DOS/Windows didn't include the '@' character. File
+names that contained "dir\@file" could not be edited.
+
+Win32 console: <C-S-Left> could cause a crash when compiled with Borland or
+egcs. (Aaron)
+
+Unix and VMS: "#if HAVE_DIRENT_H" caused problems for some compilers. Use
+"#ifdef HAVE_DIRENT_H" instead. (Jones)
+
+When a matching tag is in the current file but has a search pattern that
+doesn't match, the cursor would jump to the first line.
+
+Unix: Dependencies for pty.c were not included in Makefile. Dependency of
+ctags/config.h was not included (only matters for parallel make).
+
+Removed a few Uninitialized Memory Reads (potential crashes). In do_call()
+calling clear_var() when not evaluating. In win32_expandpath() and
+dos_expandpath() calling backslash_halve() past the end of a file name.
+
+Removed memory leaks: Set_vim_var_string() never freed the value. The
+next_list for a syntax keyword was never freed.
+
+On non-Unix systems, using a file name with wildcards without a match would
+silently fail. E.g., ":e *.sh". Now give a "No match" error message.
+
+The life/life.mac, urm/urm.mac and hanoi/hanoi.mac files were not recognized
+as Vim scripts. Renamed them to *.vim.
+
+[Note: some numbered patches are not relevant when upgrading from version 5.3,
+they have been removed]
+
+Patch 5.4m.1
+Problem: When editing a file with a long name, would get the hit-enter
+ prompt, even though all settings are such that the name should be
+ truncated to avoid that. filemess() was printing the file name
+ without truncating it.
+Solution: Truncate the message in filemess(). Use the same code as for
+ msg_trunc_attr(), which is moved to the new function
+ msg_may_trunc().
+Files: src/message.c, src/proto/message.pro, src/fileio.c
+
+Patch 5.4m.3
+Problem: The Motif libraries were not found by configure for Digital Unix.
+Solution: Add "/usr/shlib" to the search path. (Andy Kahn)
+Files: src/configure.in, src/configure
+
+Patch 5.4m.5
+Problem: Win32 GUI: When using the Save-As menu entry and selecting an
+ existing file in the file browser, would get a dialog to confirm
+ overwriting twice. (Ed Krall)
+Solution: Removed the dialog from the file browser. It would be nicer to
+ set the "forceit" flag and skip Vim's ":confirm" dialog, but it
+ requires quite a few changes to do that.
+Files: src/gui_w32.c
+
+Patch 5.4m.6
+Problem: Win32 GUI: When reading text from stdin, e.g., "cat foo | gvim -",
+ a message box would pop up with "-stdin-" (when exiting). (Michael
+ Schaap)
+Solution: Don't switch off termcap mode for versions that are GUI-only.
+ They use another terminal to read from stdin.
+Files: src/main.c, src/fileio.c
+
+Patch 5.4m.7
+Problem: Unix: running configure with --enable-gtk-check,
+ --enable-motif-check, --enable-athena-check or --enable-gtktest
+ had the reverse effect. (Thomas Koehler)
+Solution: Use $enable_gtk_check variable correctly in AC_ARG_ENABLE().
+Files: src/configure.in, src/configure
+
+Patch 5.4m.9
+Problem: Multi-byte: With wrapping lines, the cursor was sometimes 2
+ characters to the left. Syntax highlighting was wrong when a
+ double-byte character was split for a wrapping line. When
+ 'showbreak' was on the splitting also didn't work.
+Solution: Adjust getvcol() and win_line(). (Chong-Dae Park)
+Files: src/charset.c, src/screen.c
+
+Patch 5.4m.11
+Problem: The ":call" command didn't check for illegal trailing characters.
+ (Stefan Roemer)
+Solution: Add the check in do_call().
+Files: src/eval.c
+
+Patch 5.4m.13
+Problem: With the ":s" command:
+ 1. When performing a substitute command, the mouse would be
+ disabled and enabled for every substitution.
+ 2. The cursor position could be beyond the end of the line.
+ Calling line_breakcheck() could try to position the cursor,
+ which causes a crash in the Win32 GUI.
+ 3. When using ":s" in a ":g" command, the cursor was not put on
+ the first non-white in the line.
+ 4. There was a hit-enter prompt when confirming the substitution
+ and the replacement was a bit longer.
+Solution: 1. Only disable/enable the mouse when asking for confirmation.
+ 2. Always put the cursor on the first character, it is going to be
+ moved to the first non-blank anyway.
+ Don't use the cursor position in gui_mch_draw_hollow_cursor(),
+ get the character from the screen buffer.
+ 3. Added global_need_beginline flag to call beginline() after ":g"
+ has finished all substitutions.
+ 4. Clear the need_wait_return flag after prompting the user.
+Files: src/ex_cmds.c, src/gui_w32.c
+
+Patch 5.4m.14
+Problem: When doing "vim xxx", ":opt", ":only" and then ":e xxx" we end
+ up with two swapfiles for "xxx". That is caused by the ":bdel"
+ command which is executed when unloading the option-window.
+ Also, there was no check if closing a buffer made the new one
+ invalid, this could cause a crash.
+Solution: When closing a buffer causes the current buffer to be deleted,
+ use the new buffer to replace it. Also detect that the new buffer
+ has become invalid as a side effect of closing the current one.
+ Make autocommand that calls ":bdel" in optwin.vim nested, so that
+ the buffer loading it triggers also executes autocommands.
+ Also added a test for this in test13.
+Files: runtime/optwin.vim, src/buffer.c, src/ex_cmds.c, src/globals.h
+ src/testdir/test13.in, src/testdir/test13.ok
+
+Patch 5.4m.15
+Problem: When using a BufEnter autocommand to reload the syntax file,
+ conversion to HTML caused a crash. (Sung-Hyun Nam)
+Solution: When using ":syntax clear" the current stack of syntax items was
+ not cleared. This will cause memory to be used that has already
+ been freed. Added call to invalidate_current_state() in
+ syntax_clear().
+Files: src/syntax.c
+
+Patch 5.4m.17
+Problem: When omitting a ')' in an expression it would not be seen as a
+ failure.
+ When detecting an error inside (), there would be an error message
+ for a missing ')' too.
+ When using ":echo 1+|echo 2" there was no error message. (Roemer)
+ When using ":exe 1+" there was no error message.
+ When using ":return 1+" there was no error message.
+Solution: Fix do_echo(), do_execute() and do_return() to give an error
+ message when eval1() returns FAIL.
+ Fix eval6() to handle trailing ')' correctly and return FAIL when
+ it's missing.
+Files: src/eval.c
+
+Patch 5.4m.18
+Problem: When using input() from inside an expression entered with
+ "CTRL-R =" on the command line, there could be a crash. And the
+ resulting command line was wrong.
+Solution: Added getcmdline_prompt(), which handles recursive use of
+ getcmdline() correctly. It also sets the command line prompt.
+ Removed cmdline_prompt(). Also use getcmdline_prompt() for
+ getting the crypt key in get_crypt_key().
+Files: src/proto/ex_getln.pro, src/ex_getln.c, src/eval.c, src/misc2.c
+
+Patch 5.4m.21
+Problem: When starting up, the screen structures were first allocated at
+ the minimal size, then initializations were done with Rows
+ possibly different from screen_Rows. Caused a crash in rare
+ situations (GTK with XIM and fontset).
+Solution: Call screenalloc() in main() only after calling ui_get_winsize().
+ Also avoids a potential delay because of calling screenclear()
+ while "starting" is non-zero.
+Files: src/main.c
+
+Patch 5.4m.22
+Problem: In the GUI it was possible that the screen was resized and the
+ screen structures re-allocated while redrawing the screen. This
+ could cause a crash (hard to reproduce). The call sequence goes
+ through update_screen() .. syntax_start() .. ui_breakcheck() ..
+ gui_resize_window() .. screenalloc().
+Solution: Set updating_screen while redrawing. If the window is resized
+ remember the new size and handle it only after redrawing is
+ finished.
+ This also fixes that resizing the screen while still redrawing
+ (slow syntax highlighting) would not work properly.
+ Also disable display_hint, it was never used.
+Files: src/globals.h, src/gui.c, src/screen.c, src/proto/gui.pro
+
+Patch 5.4m.23
+Problem: When using expand("<cword>") when there was no word under the
+ cursor, would get an error message. Same for <cWORD> and <cfile>.
+Solution: Don't give an error message, return an empty string.
+Files: src/eval.c
+
+Patch 5.4m.24
+Problem: ":help \|" didn't find anything. It was translated to "/\\|".
+Solution: Translate "\|" into "\\bar". First check the table for specific
+ translations before checking for "\x".
+Files: src/ex_cmds.c
+
+Patch 5.4m.25
+Problem: Unix: When using command line completion on files that contain
+ ''', '"' or '|' the file name could not be used.
+ Adding this file name to the Buffers menu caused an error message.
+Solution: Insert a backslash before these three characters.
+ Adjust Mungename() function to insert a backslash before '|'.
+Files: src/ex_getln.c, runtime/menu.vim
+
+Patch 5.4m.26
+Problem: When using a mapping of two function keys, e.g., <F1><F1>, and
+ only the first char of the second key has been read, the mapping
+ would not be recognized. Noticed on some Unix systems with xterm.
+Solution: Add 'K' flag to 'cpoptions' to wait for the whole key code, even
+ when halfway a mapping.
+Files: src/option.h, src/term.c
+
+Patch 5.4m.27
+Problem: When making test33 without the lisp feature it hangs. Interrupting
+ the execution of the script then might cause a crash.
+Solution: In inchar(), after closing a script, don't use buf[] anymore.
+ closescript() has freed typebuf[] and buf[] might be pointing
+ inside typebuf[].
+ Avoid that test33 hangs when the lisp feature is missing.
+Files: src/getchar.c src/testdir/test33.in
+
+"os2" was missing from the feature list. Useful for has("os2").
+
+BeOS:
+- Included patches from Richard Offer for BeOS R4.5.
+- menu code didn't work right. Crashed in the Buffers menu. The window title
+ wasn't set. (Offer)
+
+Patch 5.4n.3
+Problem: C-indenting was wrong after " } else". The white space was not
+ skipped. Visible when 'cino' has "+10".
+Solution: Skip white space before calling cin_iselse(). (Norbert Zeh)
+Files: src/misc1.c
+
+Patch 5.4n.4
+Problem: When the 't' flag in 'cpoptions' is included, after a
+ ":nohlsearch" the search highlighting would not be enabled again
+ after a tag search. (Norbert Zeh)
+Solution: When setting the new search pattern in jumpto_tag(), don't restore
+ no_hlsearch.
+Files: src/tag.c
+
+Patch 5.4n.5
+Problem: When using ":normal" from a CursorHold autocommand Vim hangs. The
+ autocommand is executed down from vgetc(). Calling vgetc()
+ recursively to execute the command doesn't work then.
+Solution: Forbid the use of ":normal" when vgetc_busy is set. Give an error
+ message when this happens.
+Files: src/ex_docmd.c, runtime/doc/autocmd.txt
+
+Patch 5.4n.6
+Problem: "gv" could reselect a Visual that starts and/or ends past the end
+ of a line. (Robert Webb)
+Solution: Check that the start and end of the Visual area are on a valid
+ character by calling adjust_cursor().
+Files: src/normal.c
+
+Patch 5.4n.8
+Problem: When a mark was on a non existing line (e.g., when the .viminfo
+ was edited), jumping to it caused ml_get errors. (Alexey
+ Marinichev).
+Solution: Added check_cursor_lnum() in nv_gomark().
+Files: src/normal.c
+
+Patch 5.4n.9
+Problem: ":-2" moved the cursor to a negative line number. (Ralf Schandl)
+Solution: Give an error message for a negative line number.
+Files: src/ex_docmd.c
+
+Patch 5.4n.10
+Problem: Win32 GUI: At the hit-enter prompt, it was possible to scroll the
+ text. This erased the prompt and made Vim look like it is in
+ Normal mode, while it is actually still waiting for a <CR>.
+Solution: Disallow scrolling at the hit-enter prompt for systems that use
+ on the fly scrolling.
+Files: src/message.c
+
+Patch 5.4n.14
+Problem: Win32 GUI: When using ":winsize 80 46" and the height is more than
+ what fits on the screen, the window size was made smaller than
+ asked for (that's OK) and Vim crashed (that's not OK)>
+Solution: Call check_winsize() from gui_set_winsize() to resize the windows.
+Files: src/gui.c
+
+Patch 5.4n.16
+Problem: Win32 GUI: The <F10> key both selected the menu and was handled as
+ a key hit.
+Solution: Apply 'winaltkeys' to <F10>, like it is used for Alt keys.
+Files: src/gui_w32.c
+
+Patch 5.4n.17
+Problem: Local buffer variables were freed when the buffer is unloaded.
+ That's not logical, since options are not freed. (Ron Aaron)
+Solution: Free local buffer variables only when deleting the buffer.
+Files: src/buffer.c
+
+Patch 5.4n.19
+Problem: Doing ":e" (without argument) in an option-window causes trouble.
+ The mappings for <CR> and <Space> are not removed. When there is
+ another buffer loaded, the swap file for it gets mixed up.
+ (Steve Mueller)
+Solution: Also remove the mappings at the BufUnload event, if they are still
+ present.
+ When re-editing the same file causes the current buffer to be
+ deleted, don't try editing it.
+ Also added a test for this situation.
+Files: runtime/optwin.vim, src/ex_cmds.c, src/testdir/test13.in,
+ src/testdir/test13.ok
+
+Patch 5.4n.24
+Problem: BeOS: configure never enabled the GUI, because $with_x was "no".
+ Unix prototypes caused problems, because Display and Widget are
+ undefined.
+ Freeing fonts on exit caused a crash.
+Solution: Only disable the GUI when $with_x is "no" and $BEOS is not "yes".
+ Add dummy defines for Display and Widget in proto.h.
+ Don't free the fonts in gui_exit() for BeOS.
+Files: src/configure.in, src/configure, src/proto.h, src/gui.c.
+
+
+The runtime/vim48x48.xpm icon didn't have a transparent background. (Schild)
+
+Some versions of the mingw32/egcs compiler didn't have WINBASEAPI defined.
+(Aaron)
+
+VMS:
+- mch_setenv() had two arguments instead of three.
+- The system vimrc and gvimrc files were called ".vimrc" and ".gvimrc".
+ Removed the dot.
+- call to RealWaitForChar() had one argument too many. (Campbell)
+- WaitForChar() is static, removed the prototype from proto/os_vms.pro.
+- Many file accesses failed, because Unix style file names were used.
+ Translate file names to VMS style by using vim_fopen().
+- Filtering didn't work, because the temporary file name was generated wrong.
+- There was an extra newline every 9192 characters when writing a file. Work
+ around it by writing line by line. (Campbell)
+- os_vms.c contained "# typedef int DESC". Should be "typedef int DESC;".
+ Only mattered for generating prototypes.
+- Added file name translation to many places. Made easy by defining macros
+ mch_access(), mch_fopen(), mch_fstat(), mch_lstat() and mch_stat().
+- Set default for 'tagbsearch' to off, because binary tag searching apparently
+ doesn't work for VMS.
+- make mch_get_host_name() work with /dec and /standard=vaxc. (Campbell)
+
+
+Patch 5.4o.2
+Problem: Crash when using "gf" on "file.c://comment here". (Scott Graham)
+Solution: Fix wrong use of pointers in get_file_name_in_path().
+Files: src/window.c
+
+Patch 5.4o.3
+Problem: The horizontal scrollbar was not sized correctly when 'number' is
+ set and 'wrap' not set.
+ Athena: Horizontal scrollbar wasn't updated when the cursor was
+ positioned with a mouse click just after dragging.
+Solution: Subtract 8 from the size when 'number' set and 'wrap' not set.
+ Reset gui.dragged_sb when a mouse click is received.
+Files: src/gui.c
+
+Patch 5.4o.4
+Problem: When running in an xterm and $WINDOWID is set to an illegal value,
+ Vim would exit with "Vim: Got X error".
+Solution: When using the display which was opened for the xterm clipboard,
+ check if x11_window is valid by trying to obtain the window title.
+ Also add a check in setup_xterm_clip(), for when using X calls to
+ get the pointer position in an xterm.
+Files: src/os_unix.c
+
+Patch 5.4o.5
+Problem: Motif version with Lesstif: When removing the menubar and then
+ using a menu shortcut key, Vim would crash. (raf)
+Solution: Disable the menu mnemonics when the menu bar is removed.
+Files: src/gui_motif.c
+
+Patch 5.4o.9
+Problem: The DOS install.exe program used the "move" program. That doesn't
+ work on Windows NT, where "move" is internal to cmd.exe.
+Solution: Don't use an external program for moving the executables. Use C
+ functions to copy the file and delete the original.
+Files: src/dosinst.c
+
+Motif and Athena obtained the status area height differently from GTK. Moved
+status_area_enabled from global.h to gui_x11.c and call
+xim_get_status_area_height() to get the status area height.
+
+Patch 5.4p.1
+Problem: When using auto-select, and the "gv" command is used, would not
+ always obtain ownership of the selection. Caused by the Visual
+ area still being the same, but ownership taken away by another
+ program.
+Solution: Reset the clipboard Visual mode to force updating the selection.
+Files: src/normal.c
+
+Patch 5.4p.2
+Problem: Motif and Athena with XIM: Typing 3-byte
+ <multibyte><multibyte><space> doesn't work correctly with Ami XIM.
+Solution: Avoid using key_sym XK_VoidSymbol. (Nam)
+Files: src/multbyte.c, src/gui_x11.c
+
+Patch 5.4p.4
+Problem: Win32 GUI: The scrollbar values were reduced for a file with more
+ than 32767 lines. But this info was kept global for all
+ scrollbars, causing a mixup between the windows.
+ Using the down arrow of a scrollbar in a large file didn't work.
+ Because of round-off errors there is no scroll at all.
+Solution: Give each scrollbar its own scroll_shift field. When the down
+ arrow is used, scroll several lines.
+Files: src/gui.h, src/gui_w32.c
+
+Patch 5.4p.5
+Problem: When changing buffers in a BufDelete autocommand, there could be
+ ml_line errors and/or a crash. (Schandl) Was caused by deleting
+ the current buffer.
+Solution: When the buffer to be deleted unexpectedly becomes the current
+ buffer, don't delete it.
+ Also added a check for this in test13.
+Files: src/buffer.c, src/testdir/test13.in, src/testdir/test13.ok
+
+Patch 5.4p.7
+Problem: Win32 GUI: When using 'mousemodel' set to "popup_setpos" and
+ clicking the right mouse button outside of the selected area, the
+ selected area wasn't removed until the popup menu has gone.
+ (Aaron)
+Solution: Set the cursor and update the display before showing the popup
+ menu.
+Files: src/normal.c
+
+Patch 5.4p.8
+Problem: The generated bugreport didn't contain information about
+ $VIMRUNTIME and whether runtime files actually exist.
+Solution: Added a few checks to the bugreport script.
+Files: runtime/bugreport.vim
+
+Patch 5.4p.9
+Problem: The windows install.exe created a wrong entry in the popup menu.
+ The "%1" was "". The full directory was included, even when the
+ executable had been moved elsewhere. (Ott)
+Solution: Double the '%' to get one from printf. Only include the path to
+ gvim.exe when it wasn't moved and it's not in $PATH.
+Files: src/dosinst.c
+
+Patch 5.4p.10
+Problem: Win32: On top of 5.4p.9: The "Edit with Vim" entry sometimes used
+ a short file name for a directory.
+Solution: Change the "%1" to "%L" in the registry entry.
+Files: src/dosinst.c
+
+Patch 5.4p.11
+Problem: Motif, Athena and GTK: When closing the GUI window when there is a
+ changed buffer, there was only an error message and Vim would not
+ exit.
+Solution: Put up a dialog, like for ":confirm qa". Uses the code that was
+ already used for MS-Windows.
+Files: src/gui.c, src/gui_w32.c
+
+Patch 5.4p.12
+Problem: Win32: Trying to expand a string that is longer than 256
+ characters could cause a crash. (Steed)
+Solution: For the buffer in win32_expandpath() don't use a fixed size array,
+ allocate it.
+Files: src/os_win32.c
+
+MSDOS: Added "-Wall" to Makefile.djg compile flags. Function prototypes for
+fname_case() and mch_update_cursor() were missing. "fd" was unused in
+mf_sync(). "puiLocation" was unused in myputch(). "newcmd" unused in
+mch_call_shell() for DJGPP version.
+
+==============================================================================
+VERSION 5.5 *version-5.5*
+
+Version 5.5 is a bug-fix version of 5.4.
+
+
+Changed *changed-5.5*
+-------
+
+The DJGPP version is now compiled with "-O2" instead of "-O4" to reduce the
+size of the executables.
+
+Moved the src/STYLE file to runtime/doc/develop.txt. Added the design goals
+to it.
+
+'backspace' is now a string option. See patch 5.4.15.
+
+
+Added *added-5.5*
+-----
+
+Included Exuberant Ctags version 3.3. (Darren Hiebert)
+
+In runtime/mswin.vim, map CTRL-Q to CTRL-V, so that CTRL-Q can be used
+everywhere to do what CTRL-V used to do.
+
+Support for decompression of bzip2 files in vimrc_example.vim.
+
+When a patch is included, the patch number is entered in a table in version.c.
+This allows skipping a patch without breaking a next one.
+
+Support for mouse scroll wheel in X11. See patch 5.5a.14.
+
+line2byte() can be used to get the size of the buffer. See patch 5.4.35.
+
+The CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert mode are used to
+insert a register literally. See patch 5.4.48.
+
+Uninstall program for MS-Windows. To be able to remove the registry entries
+for "Edit with Vim". It is registered to be run from the "Add/Remove
+programs" application. See patch 5.4.x7.
+
+
+Fixed *fixed-5.5*
+-----
+
+When using vimrc_example.vim: An error message when the cursor is on a line
+higher than the number of lines in the compressed file. Move the autocommand
+for jumping to the last known cursor position to after the decompressing
+autocommands.
+
+":mkexrc" and ":mksession" wrote the current value of 'textmode'. That may
+mark a file as modified, which causes problems. This is a buffer-specific
+setting, it should not affect all files.
+
+"vim --version" wrote two empty lines.
+
+Unix: The alarm signal could kill Vim. It is generated by the Perl alarm()
+function. Ignore SIGALRM.
+
+Win32 GUI: Toolbar still had the yellow bitmap for running a Vim script.
+
+BeOS: "tmo" must be bigtime_t, instead of double. (Seibert)
+
+Patch 5.4.1
+Problem: Test11 fails when $GZIP is set to "-v". (Matthew Jackson)
+Solution: Set $GZIP to an empty string.
+Files: src/testdir/test11.in
+
+Patch 5.4.2
+Problem: Typing <Esc> at the crypt key prompt caused a crash. (Kallingal)
+Solution: Check for a NULL pointer returned from get_crypt_key().
+Files: src/fileio.c
+
+Patch 5.4.3
+Problem: Python: Trying to use the name of an unnamed buffer caused a
+ crash. (Daniel Burrows)
+Solution: Check for b_fname being a NULL pointer.
+Files: src/if_python.c
+
+Patch 5.4.4
+Problem: Win32: When compiled without toolbar, but the 'T' flag is in
+ 'guioptions', there would be an empty space for the toolbar.
+Solution: Add two #ifdefs where checking for the 'T' flag. (Vince Negri)
+Files: src/gui.c
+
+Patch 5.4.5
+Problem: Athena GUI: Using the Buffers.Refresh menu entry caused a crash.
+ Looks like any ":unmenu" command may cause trouble.
+Solution: Disallow ":unmenu" in the Athena version. Disable the Buffers
+ menu, because the Refresh item would not work.
+Files: src/menu.c, runtime/menu.vim
+
+Patch 5.4.6
+Problem: GTK GUI: Using ":gui" in the .gvimrc file caused an error. Only
+ happens when the GUI forks.
+Solution: Don't fork in a recursive call of gui_start().
+Files: src/gui.c
+
+Patch 5.4.7
+Problem: Typing 'q' at the more prompt for the ATTENTION message causes the
+ file loading to be interrupted. (Will Day)
+Solution: Reset got_int after showing the ATTENTION message.
+Files: src/memline.c
+
+Patch 5.4.8
+Problem: Edit some file, ":he", ":opt": options from help window are shown,
+ but pressing space updates from the other window. (Phillipps)
+ Also: When there are changes in the option-window, ":q!" gives an
+ error message.
+Solution: Before creating the option-window, go to a non-help window.
+ Use ":bdel!" to delete the buffer.
+Files: runtime/optwin.vim
+
+Patch 5.4.9
+ Just updates version.h. The real patch has been moved to 5.4.x1.
+ This patch is just to keep the version number correct.
+
+Patch 5.4.10
+Problem: GTK GUI: When $DISPLAY is invalid, "gvim -f" just exits. It
+ should run in the terminal.
+Solution: Use gtk_init_check() instead of gtk_init().
+Files: src/gui_gtk_x11.c
+
+Patch 5.4.11
+Problem: When using the 'S' flag in 'cpoptions', 'tabstop' is not copied to
+ the next buffer for some commands, e.g., ":buffer".
+Solution: When the BCO_NOHELP flag is given to buf_copy_options(), still
+ copy the options used by do_help() when neither the "from" or "to"
+ buffer is a help buffer.
+Files: src/option.c
+
+Patch 5.4.12
+Problem: When using 'smartindent', there would be no extra indent if the
+ current line did not have any indent already. (Hanus Adler)
+Solution: There was a wrongly placed "else", that previously matched with
+ the "if" that set trunc_line. Removed the "else" and added a
+ check for trunc_line to be false.
+Files: src/misc1.c
+
+Patch 5.4.13
+Problem: New SGI C compilers need another option for optimisation.
+Solution: Add a check in configure for "-OPT:Olimit". (Chin A Young)
+Files: src/configure.in, src/configure
+
+Patch 5.4.14
+Problem: Motif GUI: When the popup menu is present, a tiny window appears
+ on the desktop for some users.
+Solution: Set the menu widget ID for a popup menu to 0. (Thomas Koehler)
+Files: src/gui_motif.c
+
+Patch 5.4.15
+Problem: Since 'backspace' set to 0 has been made Vi compatible, it is no
+ longer possible to only allow deleting autoindent.
+Solution: Make 'backspace' a list of parts, to allow each kind of
+ backspacing separately.
+Files: src/edit.c, src/option.c, src/option.h, src/proto/option.pro,
+ runtime/doc/option.txt, runtime/doc/insert.txt
+
+Patch 5.4.16
+Problem: Multibyte: Locale zh_TW.Big5 was not checked for in configure.
+Solution: Add zh_TW.Big5 to configure check. (Chih-Tsun Huang)
+Files: src/configure.in, src/configure
+
+Patch 5.4.17
+Problem: GUI: When started from inside gvim with ":!gvim", Vim would not
+ start. ":!gvim -f" works fine.
+Solution: After forking, wait a moment in the parent process, to give the
+ child a chance to set its process group.
+Files: src/gui.c
+
+Patch 5.4.18
+Problem: Python: The clear_history() function also exists in a library.
+Solution: Rename clear_history() to clear_hist().
+Files: src/ex_getln.c, src/eval.c, src/proto/ex_getln.pro
+
+Patch 5.4.19
+Problem: In a terminal with 25 lines, there is a more prompt after the
+ ATTENTION message. When hitting 'q' here the dialog prompt
+ doesn't appear and file loading is interrupted. (Will Day)
+Solution: Don't allow quitting the printing of a message for the dialog
+ prompt. Added the msg_noquit_more flag for this.
+Files: src/message.c
+
+Patch 5.4.20
+Problem: GTK: When starting gvim, would send escape sequences to the
+ terminal to switch the cursor off and on.
+Solution: Don't call msg_start() if the GUI is expected to start.
+Files: src/main.c
+
+Patch 5.4.21
+Problem: Motif: Toplevel menu ordering was wrong when using tear-off items.
+Solution: Don't add one to the index for a toplevel menu.
+Files: src/gui_motif.c
+
+Patch 5.4.22
+Problem: In Insert mode, <C-Left>, <S-Left>, <C-Right> and <S-Right> didn't
+ update the column used for vertical movement.
+Solution: Set curwin->w_set_curswant for those commands.
+Files: src/edit.c
+
+Patch 5.4.23
+Problem: When a Visual selection is lost to another program, and then the
+ same text is Visually selected again, the clipboard ownership
+ wasn't regained.
+Solution: Set clipboard.vmode to NUL to force regaining the clipboard.
+Files: src/normal.c
+
+Patch 5.4.24
+Problem: Encryption: When using ":r file" while 'key' has already entered,
+ the 'key' option would be messed up. When writing the file it
+ would be encrypted with an unknown key and lost! (Brad Despres)
+Solution: Don't free cryptkey when it is equal to the 'key' option.
+Files: src/fileio.c
+
+Patch 5.4.25
+Problem: When 'cindent' is set, but 'autoindent' isn't, comments are not
+ properly indented when starting a new line. (Mitterand)
+Solution: When there is a comment leader for the new line, but 'autoindent'
+ isn't set, do C-indenting.
+Files: src/misc1.c
+
+Patch 5.4.26
+Problem: Multi-byte: a multi-byte character is never recognized in a file
+ name, causing a backslash before it to be removed on Windows.
+Solution: Assume that a leading-byte character is a file name character in
+ vim_isfilec().
+Files: src/charset.c
+
+Patch 5.4.27
+Problem: Entries in the PopUp[nvic] menus were added for several modes, but
+ only deleted for the mode they were used for. This resulted in
+ the entry remaining in the PopUp menu.
+ When removing a PopUp[nvic] menu, the name had been truncated,
+ could result in greying-out the whole PopUp menu.
+Solution: Remove entries for all modes from the PopUp[nvic] menus. Remove
+ the PopUp[nvic] menu entries first, before the name is changed.
+Files: src/menu.c
+
+Patch 5.4.28
+Problem: When using a BufWritePre autocommand to change 'fileformat', the
+ new value would not be used for writing the file.
+Solution: Check 'fileformat' after executing the autocommands instead of
+ before.
+Files: src/fileio.c
+
+Patch 5.4.29
+Problem: Athena GUI: When removing the 'g' flag from 'guioptions', using a
+ menu can result in a crash.
+Solution: Always grey-out menus for Athena, don't hide them.
+Files: src/menu.c
+
+Patch 5.4.30
+Problem: BeOS: Suspending Vim with CTRL-Z didn't work (killed Vim). The
+ first character typed after ":sh" goes to Vim, instead of the
+ started shell.
+Solution: Don't suspend Vim, start a new shell. Kill the async read thread
+ when starting a new shell. It will be restarted later. (Will Day)
+Files: src/os_unix.c, src/ui.c
+
+Patch 5.4.31
+Problem: GUI: When 'mousefocus' is set, moving the mouse over where a
+ window boundary was, causes a hit-enter prompt to be finished.
+ (Jeff Walker)
+Solution: Don't use 'mousefocus' at the hit-enter prompt. Also ignore it
+ for the more prompt and a few other situations. When an operator
+ is pending, abort it first.
+Files: src/gui.c
+
+Patch 5.4.32
+Problem: Unix: $LDFLAGS was not passed to configure.
+Solution: Pass $LDFLAGS to configure just like $CFLAGS. (Jon Miner)
+Files: src/Makefile
+
+Patch 5.4.33
+Problem: Unix: After expanding an environment variable with the shell, the
+ next expansion would also use the shell, even though it is not
+ needed.
+Solution: Reset "recursive" before returning from gen_expand_wildcards().
+Files: src/misc1.c
+
+Patch 5.4.34 (also see 5.4.x5)
+Problem: When editing a file, and the file name is relative to a directory
+ above the current directory, the file name was made absolute.
+ (Gregory Margo)
+Solution: Add an argument to shorten_fnames() which indicates if all file
+ names should be shortened, or only absolute names. In main() only
+ use shorten_fnames() to shorten absolute names.
+Files: src/ex_docmd.c, src/fileio.c, src/main.c, src/proto/fileio.pro
+
+Patch 5.4.35
+Problem: There is no function to get the current file size.
+Solution: Allow using line2byte() with the number of lines in the file plus
+ one. This returns the offset of the line past the end of the
+ file, which is the file size plus one.
+Files: src/eval.c, runtime/doc/eval.txt
+
+Patch 5.4.36
+Problem: Comparing strings while ignoring case didn't work correctly for
+ some machines. (Mide Steed)
+Solution: vim_stricmp() and vim_strnicmp() only returned 0 or 1. Changed
+ them to return -1 when the first argument is smaller.
+Files: src/misc2.c
+
+Patch 5.4.37 (also see 5.4.40 and 5.4.43)
+Problem: Long strings from the viminfo file are truncated.
+Solution: When writing a long string to the viminfo file, first write a line
+ with the length, then the string itself in a second line.
+Files: src/eval.c, src/ex_cmds.c, src/ex_getln.c, src/mark.c, src/ops.c,
+ src/search.c, src/proto/ex_cmds.pro, runtime/syntax/viminfo.vim
+
+Patch 5.4.38
+Problem: In the option-window, ":set go&" resulted in 'go' being handled
+ like a boolean option.
+ Mappings for <Space> and <CR> were overruled by the option-window.
+Solution: When the value of an option isn't 0 or 1, don't handle it like a
+ boolean option.
+ Save and restore mappings for <Space> and <CR> when entering and
+ leaving the option-window.
+Files: runtime/optwin.vim
+
+Patch 5.4.39
+Problem: When setting a hidden option, spaces before the equal sign were
+ not skipped and cause an error message. E.g., ":set csprg =cmd".
+Solution: When skipping over a hidden option, check for a following "=val"
+ and skip it too.
+Files: src/option.c
+
+Patch 5.4.40 (depends on 5.4.37)
+Problem: Compiler error for "atol(p + 1)". (Axel Kielhorn)
+Solution: Add a typecast: "atol((char *)p + 1)".
+Files: src/ex_cmds.c
+
+Patch 5.4.41
+Problem: Some commands that were not included would give an error message,
+ even when after "if 0".
+Solution: Don't give an error message for an unsupported command when not
+ executing the command.
+Files: src/ex_docmd.c
+
+Patch 5.4.42
+Problem: ":w" would also cause a truncated message to appear in the message
+ history.
+Solution: Don't put a kept message in the message history when it starts
+ with "<".
+Files: src/message.c
+
+Patch 5.4.43 (depends on 5.4.37)
+Problem: Mixing long lines with multiple lines in a register causes errors
+ when writing the viminfo file. (Robinson)
+Solution: When reading the viminfo file to skip register contents, skip
+ lines that start with "<".
+Files: src/ops.c
+
+Patch 5.4.44
+Problem: When 'whichwrap' includes '~', a "~" command that goes on to the
+ next line cannot be properly undone. (Zellner)
+Solution: Save each line for undo in n_swapchar().
+Files: src/normal.c
+
+Patch 5.4.45 (also see 5.4.x8)
+Problem: When expand("$ASDF") fails, there is an error message.
+Solution: Remove the global expand_interactively. Pass a flag down to skip
+ the error message.
+ Also: expand("$ASDF") returns an empty string if $ASDF isn't set.
+ Previously it returned "$ASDF" when 'shell' is "sh".
+ Also: system() doesn't print an error when the command returns an
+ error code.
+Files: many
+
+Patch 5.4.46
+Problem: Backspacing did not always use 'softtabstop' after hitting <CR>,
+ inserting a register, moving the cursor, etc.
+Solution: Reset inserted_space much more often in edit().
+Files: src/edit.c
+
+Patch 5.4.47
+Problem: When executing BufWritePre or BufWritePost autocommands for a
+ hidden buffer, the cursor could be moved to a non-existing
+ position. (Vince Negri)
+Solution: Save and restore the cursor and topline for the current window
+ when it is going to be used to execute autocommands for a hidden
+ buffer. Use an existing window for the buffer when it's not
+ hidden.
+Files: src/fileio.c
+
+Patch 5.4.48
+Problem: A paste with the mouse in Insert mode was not repeated exactly the
+ same with ".". For example, when 'autoindent' is set and pasting
+ text with leading indent. (Perry)
+Solution: Add the CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert
+ mode, which insert the contents of a register literally.
+Files: src/edit.c, src/normal.c, runtime/doc/insert.txt
+
+Patch 5.4.49
+Problem: When pasting text with [ <MiddleMouse>, the cursor could end up
+ after the last character of the line.
+Solution: Correct the cursor position for the change in indent.
+Files: src/ops.c
+
+Patch 5.4.x1 (note: Replaces patch 5.4.9)
+Problem: Win32 GUI: menu hints were never used, because WANT_MENU is not
+ defined until vim.h is included.
+Solution: Move the #ifdef WANT_MENU from where MENUHINTS is defined to where
+ it is used.
+Files: src/gui_w32.c
+
+Patch 5.4.x2
+Problem: BeOS: When pasting text, one character was moved to the end.
+Solution: Re-enable the BeOS code in fill_input_buf(), and fix timing out
+ with acquire_sem_etc(). (Will Day)
+Files: src/os_beos.c, src/ui.c
+
+Patch 5.4.x3
+Problem: Win32 GUI: When dropping a directory on a running gvim it crashes.
+Solution: Avoid using a NULL file name. Also display a message to indicate
+ that the current directory was changed.
+Files: src/gui_w32.c
+
+Patch 5.4.x4
+Problem: Win32 GUI: Removing an item from the popup menu doesn't work.
+Solution: Don't remove the item from the menubar, but from the parent popup
+ menu.
+Files: src/gui_w32.c
+
+Patch 5.4.x5 (addition to 5.4.34)
+Files: src/gui_w32.c
+
+Patch 5.4.x6
+Problem: Win32: Expanding (dir)name starting with a dot doesn't work.
+ (McCormack) Only when there is a path before it.
+Solution: Fix the check, done before expansion, if the file name pattern
+ starts with a dot.
+Files: src/os_win32.c
+
+Patch 5.4.x7
+Problem: Win32 GUI: Removing "Edit with Vim" from registry is difficult.
+Solution: Add uninstall program to remove the registry keys. It is installed
+ in the "Add/Remove programs" list for ease of use.
+ Also: don't set $VIM when the executable is with the runtime files.
+ Also: Add a text file with a step-by-step description of how to
+ uninstall Vim for DOS and Windows.
+Files: src/uninstal.c, src/dosinst.c, src/Makefile.w32, uninstal.txt
+
+Patch 5.4.x8 (addition to 5.4.45)
+Files: many
+
+Patch 5.4.x9
+Problem: Win32 GUI: After executing an external command, focus is not
+ always regained (when using focus-follows-mouse).
+Solution: Add SetFocus() in mch_system(). (Mike Steed)
+Files: src/os_win32.c
+
+
+Patch 5.5a.1
+Problem: ":let @* = @:" did not work. The text was not put on the
+ I clipboard. (Fisher)
+Solution: Own the clipboard and put the text on it.
+Files: src/ops.c
+
+Patch 5.5a.2
+Problem: append() did not mark the buffer modified. Marks below the
+ new line were not adjusted.
+Solution: Fix the f_append() function.
+Files: src/eval.c
+
+Patch 5.5a.3
+Problem: Editing compressed ".gz" files doesn't work on non-Unix systems,
+ because there is no "mv" command.
+Solution: Add the rename() function and use it instead of ":!mv".
+ Also: Disable the automatic jump to the last position, because it
+ changes the jumplist.
+Files: src/eval.c, runtime/doc/eval.txt, runtime/vimrc_example.vim
+
+Patch 5.5a.4
+Problem: When using whole-line completion in insert mode while the cursor
+ is in the indent, get "out of memory" error. (Stekrt)
+Solution: Don't allocate a negative amount of memory in ins_complete().
+Files: src/edit.c
+
+Patch 5.5a.5
+Problem: Win32: The 'path' option can hold only up to 256 characters,
+ because _MAX_PATH is 256. (Robert Webb)
+Solution: Use a fixed path length of 1024.
+Files: src/os_win32.h
+
+Patch 5.5a.6
+Problem: Compiling with gcc on Win32, using the Unix Makefile, didn't work.
+Solution: Add $(SUFFIX) to all places where an executable is used. Also
+ pass it to ctags. (Reynolds)
+Files: src/Makefile
+
+Patch 5.5a.7
+Problem: When using "cat | vim -" in an xterm, the xterm version reply
+ would end up in the file.
+Solution: Read the file from stdin before switching the terminal to RAW
+ mode. Should also avoid problems with programs that use a
+ specific terminal setting.
+ Also: when using the GUI, print "Reading from stdin..." in the GUI
+ window, to give a hint why it doesn't do anything.
+Files: src/main.c, src/fileio.c
+
+Patch 5.5a.8
+Problem: On multi-threaded Solaris, suspending doesn't work.
+Solution: Call pause() when the SIGCONT signal was not received after
+ sending the SIGTSTP signal. (Nagano)
+Files: src/os_unix.c
+
+Patch 5.5a.9
+Problem: 'winaltkeys' could be set to an empty argument, which is illegal.
+Solution: Give an error message when doing ":set winaltkeys=".
+Files: src/option.c
+
+Patch 5.5a.10
+Problem: Win32 console: Using ALTGR on a German keyboard to produce "}"
+ doesn't work, because the 8th bit is set when ALT is pressed.
+Solution: Don't set the 8th bit when ALT and CTRL are used. (Leipert)
+Files: src/os_win32.c
+
+Patch 5.5a.11
+Problem: Tcl: Configure always uses tclsh8.0.
+ Also: Loading a library doesn't work.
+Solution: Add "--with-tclsh" configure argument to allow specifying another
+ name for the tcl shell.
+ Call Tcl_Init() in tclinit() to make loading libraries work.
+ (Johannes Zellner)
+Files: src/configure.in, src/configure, src/if_tcl.c
+
+Patch 5.5a.12
+Problem: The "user_commands" feature is called "user-commands".
+Solution: Replace "user-commands" with "user_commands". (Kim Sung-bom)
+ Keep "user-commands" for the has() function, to remain backwards
+ compatible with 5.4.
+Files: src/eval.c, src/version.c
+
+Patch 5.5a.13
+Problem: OS/2: When $HOME is not defined, "C:/" is used for the viminfo
+ file. That is very wrong when OS/2 is on another partition.
+Solution: Use $VIM for the viminfo file when it is defined, like for MSDOS.
+ Also: Makefile.os2 didn't depend on os_unix.h.
+Files: src/os_unix.h, src/Makefile.os2
+
+Patch 5.5a.14
+Problem: Athena, Motif and GTK: The Mouse scroll wheel doesn't work.
+Solution: Interpret a click of the wheel as a key press of the <MouseDown>
+ or <MouseUp> keys. Default behavior is to scroll three lines, or
+ a full page when Shift is used.
+Files: src/edit.c, src/ex_getln.c, src/gui.c, src/gui_gtk_x11.c,
+ src/gui_x11.c, src/keymap.h, src/message.c, src/misc1.c,
+ src/misc2.c, src/normal.c, src/proto/normal.pro, src/vim.h,
+ runtime/doc/scroll.txt
+
+Patch 5.5a.15
+Problem: Using CTRL-A in Insert mode doesn't work correctly when the insert
+ started with the <Insert> key. (Andreas Rohrschneider)
+Solution: Replace <Insert> with "i" before setting up the redo buffer.
+Files: src/normal.c
+
+Patch 5.5a.16
+Problem: VMS: GUI does not compile and run.
+Solution: Various fixes. (Zoltan Arpadffy)
+ Moved functions from os_unix.c to ui.c, so that VMS can use them
+ too: open_app_context(), x11_setup_atoms() and clip_x11* functions.
+ Made xterm_dpy global, it's now used by ui.c and os_unix.c.
+ Use gethostname() always, sys_hostname doesn't exist.
+Files: src/globals.h, src/gui_x11.c, src/os_vms.mms, src/os_unix.c,
+ src/os_vms.c, src/ui.c, src/proto/os_unix.pro, src/proto/ui.pro
+
+Renamed AdjustCursorForMultiByteCharacter() to AdjustCursorForMultiByteChar()
+to avoid symbol length limit of 31 characters. (Steve P. Wall)
+
+Patch 5.5b.1
+Problem: SASC complains about dead assignments and implicit type casts.
+Solution: Removed the dead assignments. Added explicit type casts.
+Files: src/buffer.c, src/edit.c, src/eval.c, src/ex_cmds.c,
+ src/ex_getln.c, src/fileio.c, src/getchar.c, src/memline.c,
+ src/menu.c, src/misc1.c, src/normal.c, src/ops.c, src/quickfix.c,
+ src/screen.c
+
+Patch 5.5b.2
+Problem: When using "CTRL-O O" in Insert mode, hit <Esc> and then "o" in
+ another line truncates that line. (Devin Weaver)
+Solution: When using a command that starts Insert mode from CTRL-O, reset
+ "restart_edit" first. This avoids that edit() is called with a
+ mix of starting a new edit command and restarting a previous one.
+Files: src/normal.c
+
+==============================================================================
+VERSION 5.6 *version-5.6*
+
+Version 5.6 is a bug-fix version of 5.5.
+
+
+Changed *changed-5.6*
+-------
+
+Small changes to OleVim files. (Christian Schaller)
+
+Inserted "/**/" between patch numbers in src/version.c. This allows for one
+line of context, which some versions of patch need.
+
+Reordered the Syntax menu to avoid long submenus. Removed keyboard shortcuts
+for alphabetical items to avoid a clash with fixed items.
+
+
+Added *added-5.6*
+-----
+
+Included Exuberant Ctags version 3.4. (Darren Hiebert)
+
+OpenWithVim in Python. (Christian Schaller)
+
+Win32 GUI: gvimext.dll, for the context menu "Edit with Vim" entry. Avoids
+the reported problems with the MS Office taskbar. Now it's a Shell Extension.
+(Tianmiao Hu)
+
+New syntax files:
+abel Abel (John Cook)
+aml Arc Macro Language (Nikki Knuit)
+apachestyle Apache-style config file (Christian Hammers)
+cf Cold Fusion (Jeff Lanzarotta)
+ctrlh files with CTRL-H sequences (Bram Moolenaar)
+cupl CUPL (John Cook)
+cuplsim CUPL simulation (John Cook)
+erlang Erlang (Kresimir Marzic)
+gedcom Gedcom (Paul Johnson)
+icon Icon (Wendell Turner)
+ist MakeIndex style (Peter Meszaros)
+jsp Java Server Pages (Rafael Garcia-Suarez)
+rcslog Rcslog (Joe Karthauser)
+remind Remind (Davide Alberani)
+sqr Structured Query Report Writer (Paul Moore)
+tads TADS (Amir Karger)
+texinfo Texinfo (Sandor Kopanyi)
+xpm2 X Pixmap v2 (Steve Wall)
+
+The 'C' flag in 'cpoptions' can be used to switch off concatenation for
+sourced lines. See patch 5.5.013 below. |line-continuation|
+
+"excludenl" argument for the ":syntax" command. See patch 5.5.032 below.
+|:syn-excludenl|
+
+Implemented |z+| and |z^| commands. See patch 5.5.050 below.
+
+Vim logo in Corel Draw format. Can be scaled to any resolution.
+
+
+Fixed *fixed-5.6*
+-----
+
+Using this mapping in Select mode, terminated completion:
+":vnoremap <C-N> <Esc>a<C-N>" (Benji Fisher)
+Ignore K_SELECT in ins_compl_prep().
+
+VMS (Zoltan Arpadffy, David Elins):
+- ioctl() in pty.c caused trouble, #ifndef VMS added.
+- Cut & paste mismatch corrected.
+- Popup menu line crash corrected. (Patch 5.5.047)
+- Motif directories during open and save as corrected.
+- Handle full file names with version numbers. (Patch 5.5.046)
+- Directory handling (CD command etc.)
+- Corrected file name conversion VMS to Unix and v.v.
+- Recovery was not working.
+- Terminal and signal handling was outdated compared to os_unix.c.
+- Improved os_vms.txt.
+
+Configure used fprintf() instead of printf() to check for __DATE__ and
+__TIME__. (John Card II)
+
+BeOS: Adjust computing the char_height and char_ascent. Round them up
+separately, avoids redrawing artifacts. (Mike Steed)
+
+Fix a few multi-byte problems in menu_name_skip(), set_reg_ic(), searchc() and
+findmatchlimit(). (Taro Muraoka)
+
+GTK GUI:
+- With GTK 1.2.5 and later the scrollbars were not redrawn correctly.
+- Adjusted the gtk_form_draw() function.
+- SNiFF connection didn't work.
+- 'mousefocus' was not working. (Dalecki)
+- Some keys were not working with modifiers: Shift-Tab, Ctrl-Space and CTRL-@.
+
+
+Patch 5.5.001
+Problem: Configure in the top directory did not pass on an argument with a
+ space correctly. For example "./configure --previs="/My home".
+ (Stephane Chazelas)
+Solution: Use '"$@"' instead of '$*' to pass on the arguments.
+Files: configure
+
+Patch 5.5.002
+Problem: Compilation error for using "fds[] & POLLIN". (Jeff Walker)
+Solution: Use "fds[].revents & POLLIN".
+Files: src/os_unix.c
+
+Patch 5.5.003
+Problem: The autoconf check for sizeof(int) is wrong on machines where
+ sizeof(size_t) != sizeof(int).
+Solution: Use our own configure check. Also fixes the warning for
+ cross-compiling.
+Files: src/configure.in, src/configure
+
+Patch 5.5.004
+Problem: On Unix it's not possible to interrupt ":sleep 100".
+Solution: Switch terminal to cooked mode while asleep, to allow a SIGINT to
+ wake us up. But switch off echo, added TMODE_SLEEP.
+Files: src/term.h, src/os_unix.c
+
+Patch 5.5.005
+Problem: When using <f-args> with a user command, an empty argument to the
+ command resulted in one empty string, while no string was
+ expected.
+Solution: Catch an empty argument and pass no argument to the function.
+ (Paul Moore)
+Files: src/ex_docmd.c
+
+Patch 5.5.006
+Problem: Python: When platform-dependent files are in another directory
+ than the platform-independent files it doesn't work.
+Solution: Also check the executable directory, and add it to CFLAGS. (Tessa
+ Lau)
+Files: src/configure.in, src/configure
+
+Patch 5.5.007 (extra)
+Problem: Win32 OLE: Occasional crash when exiting while still being used
+ via OLE.
+Solution: Move OleUninitialize() to before deleting the application object.
+ (Vince Negri)
+Files: src/if_ole.cpp
+
+Patch 5.5.008
+Problem: 10000@@ takes a long time and cannot be interrupted.
+Solution: Check for CTRL-C typed while in the loop to push the register.
+Files: src/normal.c
+
+Patch 5.5.009
+Problem: Recent Sequent machines don't link with "-linet". (Kurtis Rader)
+Solution: Remove configure check for Sequent.
+Files: src/configure.in, src/configure
+
+Patch 5.5.010
+Problem: Ctags freed a memory block twice when exiting. When out of
+ memory, a misleading error message was given.
+Solution: Update to ctags 3.3.2. Also fixes a few other problems. (Darren
+ Hiebert)
+Files: src/ctags/*
+
+Patch 5.5.011
+Problem: After "CTRL-V s", the cursor jumps back to the start, while all
+ other operators leave the cursor on the last changed character.
+ (Xiangjiang Ma)
+Solution: Position cursor on last changed character, if possible.
+Files: src/ops.c
+
+Patch 5.5.012
+Problem: Using CTRL-] in Visual mode doesn't work when the text includes a
+ space (just where it's useful). (Stefan Bittner)
+Solution: Don't escape special characters in a tag name with a backslash.
+Files: src/normal.c
+
+Patch 5.5.013
+Problem: The ":append" and ":insert" commands allow using a leading
+ backslash in a line. The ":source" command concatenates those
+ lines. (Heinlein)
+Solution: Add the 'C' flag in 'cpoptions' to switch off concatenation.
+Files: src/ex_docmd.c, src/option.h, runtime/doc/options.txt,
+ runtime/filetype.vim, runtime/scripts.vim
+
+Patch 5.5.014
+Problem: When executing a register with ":@", the ":append" command would
+ get text lines with a ':' prepended. (Heinlein)
+Solution: Remove the ':' characters.
+Files: src/ex_docmd.c, src/ex_getln.c, src/globals.h
+
+Patch 5.5.015
+Problem: When using ":g/pat/p", it's hard to see where the output starts,
+ the ":g" command is overwritten. Vi keeps the ":g" command.
+Solution: Keep the ":g" command, but allow overwriting it with the report
+ for the number of changes.
+Files: src/ex_cmds.c
+
+Patch 5.5.016 (extra)
+Problem: Win32: Using regedit to install Vim in the popup menu requires the
+ user to confirm this in a dialog.
+Solution: Use "regedit /s" to avoid the dialog
+Files: src/dosinst.c
+
+Patch 5.5.017
+Problem: If an error occurs when closing the current window, Vim could get
+ stuck in the error handling.
+Solution: Don't set curwin to NULL when closing the current window.
+Files: src/window.c
+
+Patch 5.5.018
+Problem: Absolute paths in shell scripts do not always work.
+Solution: Use /usr/bin/env to find out the path.
+Files: runtime/doc/vim2html.pl, runtime/tools/efm_filter.pl,
+ runtime/tools/shtags.pl
+
+Patch 5.5.019
+Problem: A function call in 'statusline' stops using ":q" twice from
+ exiting, when the last argument hasn't been edited.
+Solution: Don't decrement quitmore when executing a function. (Madsen)
+Files: src/ex_docmd.c
+
+Patch 5.5.020
+Problem: When the output of CTRL-D completion in the commandline goes all
+ the way to the last column, there is an empty line.
+Solution: Don't add a newline when the cursor wrapped already. (Madsen)
+Files: src/ex_getln.c
+
+Patch 5.5.021
+Problem: When checking if a file name in the tags file is relative,
+ environment variables were not expanded.
+Solution: Expand the file name before checking if it is relative. (Madsen)
+Files: src/tag.c
+
+Patch 5.5.022
+Problem: When setting or resetting 'paste' the ruler wasn't updated.
+Solution: Update the status lines when 'ruler' changes because of 'paste'.
+Files: src/option.c
+
+Patch 5.5.023
+Problem: When editing a new file and autocommands change the cursor
+ position, the cursor was moved back to the first non-white, unless
+ 'startofline' was reset.
+Solution: Keep the new column, just like the line number.
+Files: src/ex_cmds.c
+
+Patch 5.5.024 (extra)
+Problem: Win32 GUI: When using confirm() to put up a dialog without a
+ default button, the dialog would not have keyboard focus.
+ (Krishna)
+Solution: Always set focus to the dialog window. Only set focus to a button
+ when a default one is specified.
+Files: src/gui_w32.c
+
+Patch 5.5.025
+Problem: When using "keepend" in a syntax region, a contained match that
+ includes the end-of-line could still force that region to
+ continue, if there is another contained match in between.
+Solution: Check the keepend_level in check_state_ends().
+Files: src/syntax.c
+
+Patch 5.5.026
+Problem: When starting Vim in a white-on-black xterm, with 'bg' set to
+ "dark", and then starting the GUI with ":gui", setting 'bg' to
+ "light" in the gvimrc, the highlighting isn't set. (Tsjokwing)
+Solution: Set the highlighting when 'bg' is changed in the gvimrc, even
+ though full_screen isn't set.
+Files: src/option.c
+
+Patch 5.5.027
+Problem: Unix: os_unix.c doesn't compile when XTERM_CLIP is used but
+ WANT_TITLE isn't. (Barnum)
+Solution: Move a few functions that are used by the X11 title and clipboard
+ and put another "#if" around it.
+Files: src/os_unix.c
+
+Patch 5.5.028 (extra)
+Problem: Win32 GUI: When a file is dropped on Win32 gvim while at the ":"
+ prompt, the file is edited but the command line is actually still
+ there, the cursor goes back to command line on the next command.
+ (Krishna)
+Solution: When dropping a file or directory on gvim while at the ":" prompt,
+ insert the name of the file/directory. Allows using the
+ file/directory name for any Ex command.
+Files: src/gui_w32.c
+
+Patch 5.5.029
+Problem: "das" at the end of the file didn't delete the last character of
+ the sentence.
+Solution: When there is no character after the sentence, make the operation
+ inclusive in current_sent().
+Files: src/search.c
+
+Patch 5.5.030
+Problem: Unix: in os_unix.c, "term_str" is used, which is also defined in
+ vim.h as a macro. (wuxin)
+Solution: Renamed "term_str" to "buf" in do_xterm_trace().
+Files: src/os_unix.c
+
+Patch 5.5.031 (extra)
+Problem: Win32 GUI: When exiting Windows, gvim will leave swap files behind
+ and will be killed ungracefully. (Krishna)
+Solution: Catch the WM_QUERYENDSESSION and WM_ENDSESSION messages and try to
+ exit gracefully. Allow the user to cancel the shutdown if there
+ is a changed buffer.
+Files: src/gui_w32.c
+
+Patch 5.5.032
+Problem: Patch 5.5.025 wasn't right. And C highlighting was still not
+ working correctly for a #define.
+Solution: Added "excludenl" argument to ":syntax", to be able not to extend
+ a containing item when there is a match with the end-of-line.
+Files: src/syntax.c, runtime/doc/syntax.txt, runtime/syntax/c.vim
+
+Patch 5.5.033
+Problem: When reading from stdin, a long line in viminfo would mess up the
+ file message. readfile() uses IObuff for keep_msg, which could be
+ overwritten by anyone.
+Solution: Copy the message from IObuff to msg_buf and set keep_msg to that.
+ Also change vim_fgets() to not use IObuff any longer.
+Files: src/fileio.c
+
+Patch 5.5.034
+Problem: "gvim -rv" caused a crash. Using 't_Co' before it's set.
+Solution: Don't try to initialize the highlighting before it has been
+ initialized from main().
+Files: src/syntax.c
+
+Patch 5.5.035
+Problem: GTK with XIM: Resizing with status area was messy, and
+ ":set guioptions+=b" didn't work.
+Solution: Make status area a separate widget, but not a separate window.
+ (Chi-Deok Hwang)
+Files: src/gui_gtk_f.c, src/gui_gtk_x11.c, src/multbyte.c
+
+Patch 5.5.036
+Problem: The GZIP_read() function in $VIMRUNTIME/vimrc_example.vim to
+ uncompress a file did not do detection for 'fileformat'. This is
+ because the filtering is done with 'binary' set.
+Solution: Split the filtering into separate write, filter and read commands.
+Files: runtime/vimrc_example.vim
+
+Patch 5.5.037
+Problem: The "U" command didn't mark the buffer as changed. (McCormack)
+Solution: Set the 'modified' flag when using "U".
+Files: src/undo.c
+
+Patch 5.5.038
+Problem: When typing a long ":" command, so that the screen scrolls up,
+ causes the hit-enter prompt, even though the user just typed
+ return to execute the command.
+Solution: Reset need_wait_return if (part of) the command was typed in
+ getcmdline().
+Files: src/ex_getln.c
+
+Patch 5.5.039
+Problem: When using a custom status line, "%a" (file # of #) reports the
+ index of the current window for all windows.
+Solution: Pass a window pointer to append_arg_number(), and pass the window
+ being updated from build_stl_str_hl(). (Stephen P. Wall)
+Files: src/buffer.c, src/screen.c, src/proto/buffer.pro
+
+Patch 5.5.040
+Problem: Multi-byte: When there is some error in xim_real_init(), it can
+ close XIM and return. After this there can be a segv.
+Solution: Test "xic" for being non-NULL, don't set "xim" to NULL. Also try
+ to find more matches for supported styles. (Sung-Hyun Nam)
+Files: src/multbyte.c
+
+Patch 5.5.041
+Problem: X11 GUI: CTRL-_ requires the SHIFT key only on some machines.
+Solution: Translate CTRL-- to CTRL-_. (Robert Webb)
+Files: src/gui_x11.c
+
+Patch 5.5.042
+Problem: X11 GUI: keys with ALT were assumed to be used for the menu, even
+ when the menu has been disabled by removing 'm' from 'guioptions'.
+Solution: Ignore keys with ALT only when gui.menu_is_active is set. (Raf)
+Files: src/gui_x11.c
+
+Patch 5.5.043
+Problem: GTK: Handling of fontset fonts was not right when 'guifontset'
+ contains exactly 14 times '-'.
+Solution: Avoid setting fonts when working with a fontset. (Sung-Hyun Nam)
+Files: src/gui_gtk_x11.c
+
+Patch 5.5.044
+Problem: pltags.pl contains an absolute path "/usr/local/bin/perl". That
+ might not work everywhere.
+Solution: Use "/usr/bin/env perl" instead.
+Files: runtime/tools/pltags.pl
+
+Patch 5.5.045
+Problem: Using "this_session" variable does not work, requires preceding it
+ with "v:". Default filename for ":mksession" isn't mentioned
+ in the docs. (Fisher)
+Solution: Support using "this_session" to be backwards compatible.
+Files: src/eval.c, runtime/doc/options.txt
+
+Patch 5.5.046 (extra)
+Problem: VMS: problems with path and filename.
+Solution: Truncate file name at last ';', etc. (Zoltan Arpadffy)
+Files: src/buffer.c, src/fileio.c, src/gui_motif.c, src/os_vms.c,
+ src/proto/os_vms.pro
+
+Patch 5.5.047
+Problem: VMS: Crash when using the popup menu
+Solution: Turn the #define MENU_MODE_CHARS into an array. (Arpadffy)
+Files: src/structs.h, src/menu.c
+
+Patch 5.5.048
+Problem: HP-UX 11: Compiling doesn't work, because both string.h and
+ strings.h are included. (Squassabia)
+Solution: The configure test for including both string.h and strings.h
+ must include <Xm/Xm.h> first, because it causes problems.
+Files: src/configure.in, src/configure, src/config.h.in
+
+Patch 5.5.049
+Problem: Unix: When installing Vim, the protection bits of files might be
+ influenced by the umask.
+Solution: Add $(FILEMOD) to Makefile. (Shetye)
+Files: src/Makefile
+
+Patch 5.5.050
+Problem: "z+" and "z^" commands are missing.
+Solution: Implemented "z+" and "z^".
+Files: src/normal.c, runtime/doc/scroll.txt, runtime/doc/index.txt
+
+Patch 5.5.051
+Problem: Several Unix systems have a problem with the optimization limits
+ check in configure.
+Solution: Removed the configure check, let the user add it manually in
+ Makefile or the environment.
+Files: src/configure.in, src/configure, src/Makefile
+
+Patch 5.5.052
+Problem: Crash when using a cursor key at the ATTENTION prompt. (Alberani)
+Solution: Ignore special keys at the console dialog. Also ignore characters
+ > 255 for other uses of tolower() and toupper().
+Files: src/menu.c, src/message.c, src/misc2.c
+
+Patch 5.5.053
+Problem: Indenting is wrong after a function when 'cino' has "fs". Another
+ problem when 'cino' has "{s".
+Solution: Put line after closing "}" of a function at the left margin.
+ Apply ind_open_extra in the right way after a '{'.
+Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
+
+Patch 5.5.054
+Problem: Unix: ":e #" doesn't work if the alternate file name contains a
+ space or backslash. (Hudacek)
+Solution: When replacing "#", "%" or other items that stand for a file name,
+ prepend a backslash before special characters.
+Files: src/ex_docmd.c
+
+Patch 5.5.055
+Problem: Using "<C-V>$r-" in blockwise Visual mode replaces one character
+ beyond the end of the line. (Zivkov)
+Solution: Only replace existing characters.
+Files: src/ops.c
+
+Patch 5.5.056
+Problem: After "z20<CR>" messages were printed at the old command line
+ position once. (Veselinovic)
+Solution: Set msg_row and msg_col when changing cmdline_row in
+ win_setheight().
+Files: src/window.c
+
+Patch 5.5.057
+Problem: After "S<Esc>" it should be possible to restore the line with "U".
+ (Veselinovic)
+Solution: Don't call u_clearline() in op_delete() when changing only one
+ line.
+Files: src/ops.c
+
+Patch 5.5.058
+Problem: Using a long search pattern and then "n" causes the hit-enter
+ prompt. (Krishna)
+Solution: Truncate the echoed pattern, like other messages. Moved code for
+ truncating from msg_attr() to msg_strtrunc().
+Files: src/message.c, src/proto/message.pro, src/search.c
+
+Patch 5.5.059
+Problem: GTK GUI: When $term is invalid, using "gvim" gives an error
+ message, even though $term isn't really used. (Robbins)
+Solution: When the GUI is about to start, skip the error messages for a
+ wrong $term.
+Files: src/term.c
+
+Patch 5.5.060 (extra)
+Problem: Dos 32 bit: When a directory in 'backupdir' doesn't exist, ":w"
+ causes the file to be renamed to "axlqwqhy.ba~". (Matzdorf)
+Solution: The code to work around a LFN bug in Windows 95 doesn't handle a
+ non-existing target name correctly. When renaming fails, make
+ sure the file has its original name. Also do this for the Win32
+ version, although it's unlikely that it runs into this problem.
+Files: src/os_msdos.c, src/os_win32.c
+
+Patch 5.5.061
+Problem: When using "\:" in a modeline, the backslash is included in the
+ option value. (Mohsin)
+Solution: Remove one backslash before the ':' in a modeline.
+Files: src/buffer.c, runtime/doc/options.txt
+
+Patch 5.5.062 (extra)
+Problem: Win32 console: Temp files are created in the root of the current
+ drive, which may be read-only. (Peterson)
+Solution: Use the same mechanism of the GUI version: Use $TMP, $TEMP or the
+ current directory. Cleaned up vim_tempname() a bit.
+Files: src/fileio.c, src/os_win32.h, runtime/doc/os_dos.txt
+
+Patch 5.5.063
+Problem: When using whole-line completion in Insert mode, 'cindent' is
+ applied, even after changing the indent of the line.
+Solution: Don't reindent the completed line after inserting/removing indent.
+ (Robert Webb)
+Files: src/edit.c
+
+Patch 5.5.064
+Problem: has("sniff") doesn't work correctly.
+Solution: Return 1 when Vim was compiled with the +sniff feature. (Pruemmer)
+Files: src/eval.c
+
+Patch 5.5.065
+Problem: When dropping a file on Vim, the 'shellslash' option is not
+ effective. (Krishna)
+Solution: Fix the slashes in the dropped file names according to
+ 'shellslash'.
+Files: src/ex_docmd.c, runtime/doc/options.txt
+
+Patch 5.5.066
+Problem: For systems with backslash in file name: Setting a file name
+ option to a value starting with "\\machine" removed a backslash.
+Solution: Keep the double backslash for "\\machine", but do change
+ "\\\\machine" to "\\machine" for backwards compatibility.
+Files: src/option.c, runtime/doc/options.txt
+
+Patch 5.5.067
+Problem: With 'hlsearch' set, the pattern "\>" doesn't highlight the first
+ match in a line. (Benji Fisher)
+Solution: Fix highlighting an empty match. Also highlight the first
+ character in an empty line for "$".
+Files: src/screen.c
+
+Patch 5.5.068
+Problem: Crash when a ":while" is used with an argument that has an error.
+ (Sylvain Viart)
+Solution: Was using an uninitialized index in the cs_line[] array. The
+ crash only happened when the index was far off. Made sure the
+ uninitialized index isn't used.
+Files: src/ex_docmd.c
+
+Patch 5.5.069
+Problem: Shifting lines in blockwise Visual mode didn't set the 'modified'
+ flag.
+Solution: Do set the 'modified' flag.
+Files: src/ops.c
+
+Patch 5.5.070
+Problem: When editing a new file, creating that file outside of Vim, then
+ editing it again, ":w" still warns for overwriting an existing
+ file. (Nam)
+Solution: The BF_NEW flag in the "b_flags" field wasn't cleared properly.
+Files: src/buffer.c, src/fileio.c
+
+Patch 5.5.071
+Problem: Using a matchgroup in a ":syn region", which is the same syntax
+ group as the region, didn't stop a contained item from matching in
+ the start pattern.
+Solution: Also push an item on the stack when the syntax ID of the
+ matchgroup is the same as the syntax ID of the region.
+Files: src/syntax.c
+
+Patch 5.5.072 (extra)
+Problem: Dos 32 bit: When setting 'columns' to a too large value, Vim may
+ crash, and the DOS console too.
+Solution: Check that the value of 'columns' isn't larger than the number of
+ columns that the BIOS reports.
+Files: src/os_msdos.c, src/proto/os_msdos.pro, src/option.c
+
+Patch 5.5.073 (extra)
+Problem: Win 32 GUI: The Find and Find/Replace dialogs didn't show the
+ "match case" checkbox. The Find/Replace dialog didn't handle the
+ "match whole word" checkbox.
+Solution: Support the "match case" and "match whole word" checkboxes.
+Files: src/gui_w32.c
+
+Patch 5.6a.001
+Problem: Using <C-End> with a count doesn't work like it does with "G".
+ (Benji Fisher)
+Solution: Accept a count for <C-End> and <C-Home>.
+Files: src/normal.c
+
+Patch 5.6a.002
+Problem: The script for conversion to HTML was an older version.
+Solution: Add support for running 2html.vim on a color terminal.
+Files: runtime/syntax/2html.vim
+
+Patch 5.6a.003
+Problem: Defining a function inside a function didn't give an error
+ message. A missing ":endfunction" doesn't give an error message.
+Solution: Allow defining a function inside a function.
+Files: src/eval.c, runtime/doc/eval.txt
+
+Patch 5.6a.004
+Problem: A missing ":endwhile" or ":endif" doesn't give an error message.
+ (Johannes Zellner)
+Solution: Check for missing ":endwhile" and ":endif" in sourced files.
+ Add missing ":endif" in file selection macros.
+Files: src/ex_docmd.c, runtime/macros/file_select.vim
+
+Patch 5.6a.005
+Problem: 'hlsearch' was not listed alphabetically. The value of 'toolbar'
+ was changed when 'compatible' is set.
+Solution: Moved entry of 'hlsearch' in options[] table down.
+ Don't reset 'toolbar' option to the default value when
+ 'compatible' is set.
+Files: src/option.c
+
+Patch 5.6a.006
+Problem: Using a backwards range inside ":if 0" gave an error message.
+Solution: Don't complain about a range when it is not going to be used.
+ (Stefan Roemer)
+Files: src/ex_docmd.c
+
+Patch 5.6a.007
+Problem: ":let" didn't show internal Vim variables. (Ron Aaron)
+Solution: Do show ":v" variables for ":let" and ":let v:name".
+Files: src/eval.c
+
+Patch 5.6a.008
+Problem: Selecting a syntax from the Syntax menu gives an error message.
+Solution: Replace "else if" in SetSyn() with "elseif". (Ronald Schild)
+Files: runtime/menu.vim
+
+Patch 5.6a.009
+Problem: When compiling with +extra_search but without +syntax, there is a
+ compilation error in screen.c. (Axel Kielhorn)
+Solution: Adjust the #ifdef for declaring and initializing "line" in
+ win_line(). Also solve compilation problem when +statusline is
+ used without +eval. Another one when +cmdline_compl is used
+ without +eval.
+Files: src/screen.c, src/misc2.c
+
+Patch 5.6a.010
+Problem: In a function, ":startinsert!" does not append to the end of the
+ line if a ":normal" command was used to move the cursor. (Fisher)
+Solution: Reset "w_set_curswant" to avoid that w_curswant is changed again.
+Files: src/ex_docmd.c
+
+Patch 5.6a.011 (depends on 5.6a.004)
+Problem: A missing ":endif" or ":endwhile" in a function doesn't give an
+ error message.
+Solution: Give that error message.
+Files: src/ex_docmd.c
+
+Patch 5.6a.012 (depends on 5.6a.008)
+Problem: Some Syntax menu entries caused a hit-enter prompt.
+Solution: Call a function to make the command shorter. Also rename a few
+ functions to avoid name clashes.
+Files: runtime/menu.vim
+
+Patch 5.6a.013
+Problem: Command line completion works different when another completion
+ was done earlier. (Johannes Zellner)
+Solution: Reset wim_index when starting a new completion.
+Files: src/ex_getln.c
+
+Patch 5.6a.014
+Problem: Various warning messages when compiling and running lint with
+ different combinations of features.
+Solution: Fix the warning messages.
+Files: src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/gui_gtk_x11.c,
+ src/option.c, src/screen.c, src/search.c, src/syntax.c,
+ src/feature.h, src/globals.h
+
+Patch 5.6a.015
+Problem: The vimtutor command doesn't always know the value of $VIMRUNTIME.
+Solution: Let Vim expand $VIMRUNTIME, instead of the shell.
+Files: src/vimtutor
+
+Patch 5.6a.016 (extra)
+Problem: Mac: Window size is restricted when starting. Cannot drag the
+ window all over the desktop.
+Solution: Get real screen size instead of assuming 640x400. Do not use a
+ fixed number for the drag limits. (Axel Kielhorn)
+Files: src/gui_mac.c
+
+Patch 5.6a.017
+Problem: The "Paste" entry in popup menu for Visual, Insert and Cmdline
+ mode is in the wrong position. (Stol)
+Solution: Add priority numbers for all Paste menu entries.
+Files: runtime/menu.vim
+
+Patch 5.6a.018
+Problem: GTK GUI: submenu priority doesn't work.
+ Help dialog could be destroyed too soon.
+ When closing a dialog window (e.g. the "ATTENTION" one), Vim would
+ just hang.
+ When GTK theme is changed, Vim doesn't adjust to the new colors.
+ Argument for ":promptfind" isn't used.
+Solution: Fixed the mentioned problems.
+ Made the dialogs look&feel nicer.
+ Moved functions to avoid the need for a forward declaration.
+ Fixed reentrancy of the file browser dialog.
+ Added drag&drop support for GNOME.
+ Init the text for the Find/replace dialog from the last used
+ search string. Set "match whole word" toggle button correctly.
+ Made repeat rate for drag outside of window depend on the
+ distance from the window. (Marcin Dalecki)
+ Made the drag in Visual mode actually work.
+ Removed recursiveness protection from gui_mch_get_rgb(), it might
+ cause more trouble than it solves.
+Files: src/ex_docmd.c, src/gui_gtk.c, src/gui_gtk_x11.c, src/ui.c,
+ src/proto/ui.pro, src/misc2.c
+
+Patch 5.6a.019
+Problem: When trying to recover through NFS, which uses a large block size,
+ Vim might think the swap file is empty, because mf_blocknr_max is
+ zero. (Scott McDermott)
+Solution: When computing the number of blocks of the file in mf_open(),
+ round up instead of down.
+Files: src/memfile.c
+
+Patch 5.6a.020
+Problem: GUI GTK: Could not set display for gvim.
+Solution: Add "-display" and "--display" arguments. (Marcin Dalecki)
+Files: src/gui_gtk_x11.c
+
+Patch 5.6a.021
+Problem: Recovering still may not work when the block size of the device
+ where the swap file is located is larger than 4096.
+Solution: Read block 0 with the minimal block size.
+Files: src/memline.c, src/memfile.c, src/vim.h
+
+Patch 5.6a.022 (extra)
+Problem: Win32 GUI: When an error in the vimrc causes a dialog to pop up
+ (e.g., for an existing swap file), Vim crashes. (David Elins)
+Solution: Before showing a dialog, open the main window.
+Files: src/gui_w32.c
+
+Patch 5.6a.023
+Problem: Using expand("%:gs??/?") causes a crash. (Ron Aaron)
+Solution: Check for running into the end of the string in do_string_sub().
+Files: src/eval.c
+
+Patch 5.6a.024
+Problem: Using an autocommand to delete a buffer when leaving it can cause
+ a crash when jumping to a tag. (Franz Gorkotte)
+Solution: In do_tag(), store tagstacklen before jumping to another buffer.
+ Check tagstackidx after jumping to another buffer.
+ Add extra check in win_split() if tagname isn't NULL.
+Files: src/tag.c, src/window.c
+
+Patch 5.6a.025 (extra)
+Problem: Win32 GUI: The tables for toupper() and tolower() are initialized
+ too late. (Mike Steed)
+Solution: Move the initialization to win32_init() and call it from main().
+Files: src/main.c, src/os_w32.c, src/proto/os_w32.pro
+
+Patch 5.6a.026
+Problem: When the SNiFF connection is open, shell commands hang. (Pruemmer)
+Solution: Skip a second wait() call if waitpid() already detected that the
+ child has exited.
+Files: src/os_unix.c
+
+Patch 5.6a.027 (extra)
+Problem: Win32 GUI: The "Edit with Vim" popup menu entry causes problems
+ for the Office toolbar.
+Solution: Use a shell extension dll. (Tianmiao Hu)
+ Added it to the install and uninstal programs, replaces the old
+ "Edit with Vim" menu registry entries.
+Files: src/dosinst.c, src/uninstal.c, gvimext/*, runtime/doc/gui_w32.txt
+
+Patch 5.6a.028 (extra)
+Problem: Win32 GUI: Dialogs and tear-off menus can't handle multi-byte
+ characters.
+Solution: Adjust nCopyAnsiToWideChar() to handle multi-byte characters
+ correctly.
+Files: src/gui_w32.c
+
+==============================================================================
+VERSION 5.7 *version-5.7*
+
+Version 5.7 is a bug-fix version of 5.6.
+
+Changed *changed-5.7*
+-------
+
+Renamed src/INSTALL.mac to INSTALL_mac.txt to avoid it being recognized with a
+wrong file type. Also renamed src/INSTALL.amiga to INSTALL_ami.txt.
+
+
+Added *added-5.7*
+-----
+
+New syntax files:
+stp Stored Procedures (Jeff Lanzarotta)
+snnsnet, snnspat, snnsres SNNS (Davide Alberani)
+mel MEL (Robert Minsk)
+ruby Ruby (Mirko Nasato)
+tli TealInfo (Kurt W. Andrews)
+ora Oracle config file (Sandor Kopanyi)
+abaqus Abaqus (Carl Osterwisch)
+jproperties Java Properties (Simon Baldwin)
+apache Apache config (Allan Kelly)
+csp CSP (Jan Bredereke)
+samba Samba config (Rafael Garcia-Suarez)
+kscript KDE script (Thomas Capricelli)
+hb Hyper Builder (Alejandro Forero Cuervo)
+fortran Fortran (rewritten) (Ajit J. Thakkar)
+sml SML (Fabrizio Zeno Cornelli)
+cvs CVS commit (Matt Dunford)
+aspperl ASP Perl (Aaron Hope)
+bc BC calculator (Vladimir Scholtz)
+latte Latte (Nick Moffitt)
+wml WML (Gerfried Fuchs)
+
+Included Exuberant ctags 3.5.1. (Darren Hiebert)
+
+"display" and "fold" arguments for syntax items. For future extension, they
+are ignored now.
+
+strftime() function for the Macintosh.
+
+macros/explorer.vim: A file browser script (M A Aziz Ahmed)
+
+
+Fixed *fixed-5.7*
+-----
+
+The 16 bit MS-DOS version is now compiled with Bcc 3.1 instead of 4.0. The
+executable is smaller.
+
+When a "make test" failed, the output file was lost. Rename it to
+test99.failed to be able to see what went wrong.
+
+After sourcing bugreport.vim, it's not clear that bugreport.txt has been
+written in the current directory. Edit bugreport.txt to avoid that.
+
+Adding IME support when using Makefile.w32 didn't work. (Taro Muraoka)
+
+Win32 console: Mouse drags were passed on even when the mouse didn't move.
+
+Perl interface: In Buffers(), type of argument to SvPV() was int, should be
+STRLEN. (Tony Leneis)
+
+Problem with prototype for index() on AIX 4.3.0. Added check for _AIX43 in
+os_unix.h. (Jake Hamby)
+
+Mappings in mswin.vim could break when some commands are mapped. Add "nore"
+to most mappings to avoid re-mapping.
+
+modify_fname() made a copy of a file name for ":p" when it already was a full
+path name, which is a bit slow.
+
+Win32 with Borland C++ 5.5: Pass the path to the compiler on to xxd and ctags,
+to avoid depending on $PATH. Fixed "make clean".
+
+Many fixes to Macintosh specific parts: (mostly by Dany StAmant)
+- Only one Help menu.
+- No more crash when removing a menu item.
+- Support as External Editor for Codewarrior (still some little glitches).
+- Popup menu support.
+- Fixed crash when pasting after application switch.
+- Color from rgb.txt properly displayed.
+- 'isprint' default includes all chars above '~'. (Axel Kielhorn)
+- mac_expandpath() was leaking memory.
+- Add digraphs table. (Axel Kielhorn)
+- Multi-byte support: (Kenichi Asai)
+ Switch keyscript when going in/out of Insert mode.
+ Draw multi-byte character correctly.
+ Don't use mblen() but highest bit of char to detect multi-byte char.
+ Display value of multi-byte in statusline (also for other systems).
+- mouse button was not initialized properly to MOUSE_LEFT when
+ USE_CTRLCLICKMENU not defined.
+- With Japanese SJIS characters: Make "w", "b", and "e" work
+ properly. (Kenichi Asai)
+- Replaced old CodeWarrior file os_mac.CW9.hqx with os_mac.cw5.sit.hqx.
+
+Fixes for VMS: (Zoltan Arpadffy) (also see patch 5.6.045 below)
+- Added Makefile_vms.mms and vimrc.vms to src/testdir to be able to run the
+ tests.
+- Various fixes.
+- Set 'undolevels' to 1000 by default.
+- Made mch_settitle() equivalent to the one in os_unix.c.
+
+RiscOS: A few prototypes for os_riscos.c were outdated. Generate prototypes
+automatically.
+
+
+Previously released patches:
+
+Patch 5.6.001
+Problem: When using "set bs=0 si cin", Inserting "#<BS>" or "}<BS>" which
+ reduces the indent doesn't delete the "#" or "}". (Lorton)
+Solution: Adjust ai_col in ins_try_si().
+Files: src/edit.c
+
+Patch 5.6.002
+Problem: When using the vim.vim syntax file, a comment with all uppercase
+ characters causes a hang.
+Solution: Adjust pattern for vimCommentTitle (Charles Campbell)
+Files: runtime/syntax/vim.vim
+
+Patch 5.6.003
+Problem: GTK GUI: Loading a user defined toolbar bitmap gives a warning
+ about the colormap. Probably because the window has not been
+ opened yet.
+Solution: Use gdk_pixmap_colormap_create_from_xpm() to convert the xpm file.
+ (Keith Radebaugh)
+Files: src/gui_gtk.c
+
+Patch 5.6.004 (extra)
+Problem: Win32 GUI with IME: When setting 'guifont' to "*", the font
+ requester appears twice.
+Solution: In gui_mch_init_font() don't call get_logfont() but copy
+ norm_logfont from fh. (Yasuhiro Matsumoto)
+Files: src/gui_w32.c
+
+Patch 5.6.005
+Problem: When 'winminheight' is zero, CTRL-W - with a big number causes a
+ crash. (David Kotchan)
+Solution: Check for negative window height in win_setheight().
+Files: src/window.c
+
+Patch 5.6.006
+Problem: GTK GUI: Bold font cannot always be used. Memory is freed too
+ early in gui_mch_init_font().
+Solution: Move call to g_free() to after where sdup is used. (Artem Hodyush)
+Files: src/gui_gtk_x11.c
+
+Patch 5.6.007 (extra)
+Problem: Win32 IME: Font is not changed when screen font is changed. And
+ IME composition window does not trace the cursor.
+Solution: Initialize IME font. When cursor is moved, set IME composition
+ window with ImeSetCompositionWindow(). Add call to
+ ImmReleaseContext() in several places. (Taro Muraoka)
+Files: src/gui.c, src/gui_w32.c, src/proto/gui_w32.pro
+
+Patch 5.6.008 (extra)
+Problem: Win32: When two files exist with the same name but different case
+ (through NFS or Samba), fixing the file name case could cause the
+ wrong one to be edited.
+Solution: Prefer a perfect match above a match while ignoring case in
+ fname_case(). (Flemming Madsen)
+Files: src/os_win32.c
+
+Patch 5.6.009 (extra)
+Problem: Win32 GUI: Garbage in Windows Explorer help line when selecting
+ "Edit with Vim" popup menu entry.
+Solution: Only return the help line when called with the GCS_HELPTEXT flag.
+ (Tianmiao Hu)
+Files: GvimExt/gvimext.cpp
+
+Patch 5.6.010
+Problem: A file name which contains a TAB was not read correctly from the
+ viminfo file and the ":ls" listing was not aligned properly.
+Solution: Parse the buffer list lines in the viminfo file from the end
+ backwards. Count a Tab for two characters to align the ":ls" list.
+Files: src/buffer.c
+
+Patch 5.6.011
+Problem: When 'columns' is huge (using a tiny font) and 'statusline' is
+ used, Vim can crash.
+Solution: Limit maxlen to MAXPATHL in win_redr_custom(). (John Mullin)
+Files: src/screen.c
+
+Patch 5.6.012
+Problem: When using "zsh" for /bin/sh, toolcheck may hang until "exit" is
+ typed. (Kuratczyk)
+Solution: Add "-c exit" when checking for the shell version.
+Files: src/toolcheck
+
+Patch 5.6.013
+Problem: Multibyte char in tooltip is broken.
+Solution: Consider multibyte char in replace_termcodes(). (Taro Muraoka)
+Files: src/term.c
+
+Patch 5.6.014
+Problem: When cursor is at the end of line and the character under cursor
+ is a multibyte character, "yl" doesn't yank 1 multibyte-char.
+ (Takuhiro Nishioka)
+Solution: Recognize a multibyte-char at end-of-line correctly in oneright().
+ (Taro Muraoka)
+ Also: make "+quickfix" in ":version" output appear alphabetically.
+Files: src/edit.c
+
+Patch 5.6.015
+Problem: New xterm delete key sends <Esc>[3~ by default.
+Solution: Added <kDel> and <kIns> to make the set of keypad keys complete.
+Files: src/edit.c, src/ex_getln.c, src/keymap.h, src/misc1.c,
+ src/misc2.c, src/normal.c, src/os_unix.c, src/term.c
+
+Patch 5.6.016
+Problem: When deleting a search string from history from inside a mapping,
+ another entry is deleted too. (Benji Fisher)
+Solution: Reset last_maptick when deleting the last entry of the search
+ history. Also: Increment maptick when starting a mapping from
+ typed characters to avoid a just added search string being
+ overwritten or removed from history.
+Files: src/ex_getln.c, src/getchar.c
+
+Patch 5.6.017
+Problem: ":s/e/\^M/" should replace an "e" with a CTRL-M, not split the
+ line. (Calder)
+Solution: Replace the backslash with a CTRL-V internally. (Stephen P. Wall)
+Files: src/ex_cmds.c
+
+Patch 5.6.018
+Problem: ":help [:digit:]" takes a long time to jump to the wrong place.
+Solution: Insert a backslash to avoid the special meaning of '[]'.
+Files: src/ex_cmds.c
+
+Patch 5.6.019
+Problem: "snd.c", "snd.java", etc. were recognized as "mail" filetype.
+Solution: Make pattern for mail filetype more strict.
+Files: runtime/filetype.vim
+
+Patch 5.6.020 (extra)
+Problem: The DJGPP version eats processor time (Walter Briscoe).
+Solution: Call __dpmi_yield() in the busy-wait loop.
+Files: src/os_msdos.c
+
+Patch 5.6.021
+Problem: When 'selection' is "exclusive", a double mouse click in Insert
+ mode doesn't select last char in line. (Lutz)
+Solution: Allow leaving the cursor on the NUL past the line in this case.
+Files: src/edit.c
+
+Patch 5.6.022
+Problem: ":e \~<Tab>" expands to ":e ~\$ceelen", which doesn't work.
+Solution: Re-insert the backslash before the '~'.
+Files: src/ex_getln.c
+
+Patch 5.6.023 (extra)
+Problem: Various warnings for the Ming compiler.
+Solution: Changes to avoid the warnings. (Bill McCarthy)
+Files: src/ex_cmds.c, src/gui_w32.c, src/os_w32exe.c, src/os_win32.c,
+ src/syntax.c, src/vim.rc
+
+Patch 5.6.024 (extra)
+Problem: Win32 console: Entering CTRL-_ requires the shift key. (Kotchan)
+Solution: Specifically catch keycode 0xBD, like the GUI.
+Files: src/os_win32.c
+
+Patch 5.6.025
+Problem: GTK GUI: Starting the GUI could be interrupted by a SIGWINCH.
+ (Nils Lohner)
+Solution: Repeat the read() call to get the gui_in_use value when
+ interrupted by a signal.
+Files: src/gui.c
+
+Patch 5.6.026 (extra)
+Problem: Win32 GUI: Toolbar bitmaps are searched for in
+ $VIMRUNTIME/bitmaps, while GTK looks in $VIM/bitmaps. (Keith
+ Radebaugh)
+Solution: Use $VIM/bitmaps for both, because these are not part of the
+ distribution but defined by the user.
+Files: src/gui_w32.c, runtime/doc/gui.txt
+
+Patch 5.6.027
+Problem: TCL: Crash when using a Tcl script (reported for Win32).
+Solution: Call Tcl_FindExecutable() in main(). (Brent Fulgham)
+Files: src/main.c
+
+Patch 5.6.028
+Problem: Xterm patch level 126 sends codes for mouse scroll wheel.
+ Fully works with xterm patch level 131.
+Solution: Recognize the codes for button 4 (0x60) and button 5 (0x61).
+Files: src/term.c
+
+Patch 5.6.029
+Problem: GTK GUI: Shortcut keys cannot be used for a dialog. (Johannes
+ Zellner)
+Solution: Add support for shortcut keys. (Marcin Dalecki)
+Files: src/gui_gtk.c
+
+Patch 5.6.030
+Problem: When closing a window and 'ea' is set, Vim can crash. (Yasuhiro
+ Matsumoto)
+Solution: Set "curbuf" to a valid value in win_close().
+Files: src/window.c
+
+Patch 5.6.031
+Problem: Multi-byte: When a double-byte character ends in CSI, Vim waits
+ for another character to be typed.
+Solution: Recognize the CSI as the second byte of a character and don't wait
+ for another one. (Yasuhiro Matsumoto)
+Files: src/getchar.c
+
+Patch 5.6.032
+Problem: Functions with an argument that is a line number don't all accept
+ ".", "$", etc. (Ralf Arens)
+Solution: Add get_art_lnum() and use it for setline(), line2byte() and
+ synID().
+Files: src/eval.c
+
+Patch 5.6.033
+Problem: Multi-byte: "f " sometimes skips to the second space. (Sung-Hyun
+ Nam)
+Solution: Change logic in searchc() to skip trailing byte of a double-byte
+ character.
+ Also: Ask for second byte when searching for double-byte
+ character. (Park Chong-Dae)
+Files: src/search.c
+
+Patch 5.6.034 (extra)
+Problem: Compiling with Borland C++ 5.5 fails on tolower() and toupper().
+Solution: Use TO_LOWER() and TO_UPPER() instead. Also adjust the Makefile
+ to make using bcc 5.5 easier.
+Files: src/edit.c, src/ex_docmd.c, src/misc1.c, src/Makefile.bor
+
+Patch 5.6.035
+Problem: Listing the"+comments" feature in the ":version" output depended
+ on the wrong ID. (Stephen P. Wall)
+Solution: Change "CRYPTV" to "COMMENTS".
+Files: src/version.c
+
+Patch 5.6.036
+Problem: GTK GUI: Copy/paste text doesn't work between gvim and Eterm.
+Solution: Support TEXT and COMPOUND_TEXT selection targets. (ChiDeok Hwang)
+Files: src/gui_gtk_x11.c
+
+Patch 5.6.037
+Problem: Multi-byte: Can't use "f" command with multi-byte character in GUI.
+Solution: Enable XIM in Normal mode for the GUI. (Sung-Hyun Nam)
+Files: src/gui_gtk_x11.c, src/multbyte.c
+
+Patch 5.6.038
+Problem: Multi-clicks in GUI are interpreted as a mouse wheel click. When
+ 'ttymouse' is "xterm" a mouse click is interpreted as a mouse
+ wheel click.
+Solution: Don't recognize the mouse wheel in check_termcode() in the GUI.
+ Use 0x43 for a mouse drag in do_xterm_trace(), not 0x63.
+Files: src/term.c, src/os_unix.c
+
+Patch 5.6.039
+Problem: Motif GUI under KDE: When trying to logout, Vim hangs up the
+ system. (Hermann Rochholz)
+Solution: When handling the WM_SAVE_YOURSELF event, set the WM_COMMAND
+ property of the window to let the session manager know we finished
+ saving ourselves.
+Files: src/gui_x11.c
+
+Patch 5.6.040
+Problem: When using ":s" command, matching the regexp is done twice.
+Solution: After copying the matched line, adjust the pointers instead of
+ finding the match again. (Loic Grenie) Added vim_regnewptr().
+Files: src/ex_cmds.c, src/regexp.c, src/proto/regexp.pro
+
+Patch 5.6.041
+Problem: GUI: Athena, Motif and GTK don't give more than 10 dialog buttons.
+Solution: Remove the limit on the number of buttons.
+ Also support the 'v' flag in 'guioptions'.
+ For GTK: Center the buttons.
+Files: src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c
+
+Patch 5.6.042
+Problem: When doing "vim -u vimrc" and vimrc contains ":q", the cursor in
+ the terminal can remain off.
+Solution: Call cursor_on() in mch_windexit().
+Files: src/os_unix.c
+
+Patch 5.6.043 (extra)
+Problem: Win32 GUI: When selecting guifont with the dialog, 'guifont'
+ doesn't include the bold or italic attributes.
+Solution: Append ":i" and/or ":b" to 'guifont' in gui_mch_init_font().
+Files: src/gui_w32.c
+
+Patch 5.6.044 (extra)
+Problem: MS-DOS and Windows: The line that dosinst.exe appends to
+ autoexec.bat to set PATH is wrong when Vim is in a directory with
+ an embedded space.
+Solution: Use double quotes for the value when there is an embedded space.
+Files: src/dosinst.c
+
+Patch 5.6.045 (extra) (fixed version)
+Problem: VMS: Various small problems.
+Solution: Many small changes. (Zoltan Arpadffy)
+ File name modifier ":h" keeps the path separator.
+ File name modifier ":e" also removes version.
+ Compile with MAX_FEAT by default.
+ When checking for autocommands ignore version in file name.
+ Be aware of file names being case insensitive.
+ Added vt320 builtin termcap.
+ Be prepared for an empty default_vim_dir.
+Files: runtime/gvimrc_example.vim, runtime/vimrc_example.vim,
+ runtime/doc/os_vms.txt, src/eval.c, src/feature.h, src/fileio.c,
+ src/gui_motif.c, src/gui_vms_conf.h, src/main.c, src/memline.c,
+ src/misc1.c, src/option.c, src/os_vms_conf.h, src/os_vms.c,
+ src/os_vms.h, src/os_vms.mms, src/tag.c, src/term.c, src/version.c
+
+Patch 5.6.046
+Problem: Systems with backslash in file name: With 'shellslash' set, "vim
+ */*.c" only uses a slash for the first file name. (Har'El)
+Solution: Fix slashes in file name arguments after reading the vimrc file.
+Files: src/option.c
+
+Patch 5.6.047
+Problem: $CPPFLAGS is not passed on to ctags configure.
+Solution: Add it. (Walter Briscoe)
+Files: src/config.mk.in, src/Makefile
+
+Patch 5.6.048
+Problem: CTRL-R in Command-line mode is documented to insert text as typed,
+ but inserts text literally.
+Solution: Make CTRL-R insert text as typed, use CTRL-R CTRL-R to insert
+ literally. This is consistent with Insert mode. But characters
+ that end Command-line mode are inserted literally.
+Files: runtime/doc/index.txt, runtime/doc/cmdline.txt, src/ex_getln.c,
+ src/ops.c, src/proto/ops.pro
+
+Patch 5.6.049
+Problem: Documentation for [!] after ":ijump" is wrong way around. (Benji
+ Fisher)
+Solution: Fix the documentation. Also improve the code to check for a match
+ after a /* */ comment.
+Files: runtime/doc/tagsearch.txt, src/search.c
+
+Patch 5.6.050
+Problem: Replacing is wrong when replacing a single-byte char with
+ double-byte char or the other way around.
+Solution: Shift the text after the character when it is replaced.
+ (Yasuhiro Matsumoto)
+Files: src/normal.c, src/misc1.c
+
+Patch 5.6.051
+Problem: ":tprev" and ":tnext" don't give an error message when trying to
+ go before the first or beyond the last tag. (Robert Webb)
+Solution: Added error messages. Also: Delay a second when a file-read
+ message is going to overwrite an error message, otherwise it won't
+ be seen.
+Files: src/fileio.c, src/tag.c
+
+Patch 5.6.052
+Problem: Multi-byte: When an Ex command has a '|' or '"' as a second byte,
+ it terminates the command.
+Solution: Skip second byte of multi-byte char when checking for '|' and '"'.
+ (Asai Kenichi)
+Files: src/ex_docmd.c
+
+Patch 5.6.053
+Problem: CTRL-] doesn't work on a tag that contains a '|'. (Cesar Crusius)
+Solution: Escape '|', '"' and '\' in tag names when using CTRL-] and also
+ for command-line completion.
+Files: src/ex_getln.c, src/normal.c
+
+Patch 5.6.054
+Problem: When using ":e" and ":e #" the cursor is put in the first column
+ when 'startofline' is set. (Cordell)
+Solution: Use the last known column when 'startofline' is set.
+ Also, use ECMD_LAST more often to simplify the code.
+Files: src/buffer.c, src/ex_cmds.c, src/ex_docmd.c, src/proto/buffer.pro
+
+Patch 5.6.055
+Problem: When 'statusline' only contains a text without "%" and doesn't fit
+ in the window, Vim crashes. (Ron Aaron)
+Solution: Don't use the pointer for the first item if there is no item.
+Files: src/screen.c
+
+Patch 5.6.056 (extra)
+Problem: MS-DOS: F11 and F12 don't work when 'bioskey' is set.
+Solution: Use enhanced keyboard functions. (Vince Negri)
+ Detect presence of enhanced keyboard and set bioskey_read and
+ bioskey_ready.
+Files: src/os_msdos.c
+
+Patch 5.6.057 (extra)
+Problem: Win32 GUI: Multi-byte characters are wrong in dialogs and tear-off
+ menus.
+Solution: Use system font instead of a fixed font. (Matsumoto, Muraoka)
+Files: src/gui_w32.c
+
+Patch 5.6.058
+Problem: When the 'a' flag is not in 'guioptions', non-Windows systems
+ copy Visually selected text to the clipboard/selection on a yank
+ or delete command anyway. On Windows it isn't done even when the
+ 'a' flag is included.
+Solution: Respect the 'a' flag in 'guioptions' on all systems.
+Files: src/normal.c
+
+Patch 5.6.059 (extra)
+Problem: When moving the cursor over italic text and the characters spill
+ over to the cell on the right, that spill-over is deleted.
+ Noticed in the Win32 GUI, can happen on other systems too.
+Solution: Redraw italic text starting from a blank, like this is already
+ done for bold text. (Vince Negri)
+Files: src/gui.c, src/gui.h, src/gui_w32.c
+
+Patch 5.6.060
+Problem: Some bold characters spill over to the cell on the left, that
+ spill-over can remain sometimes.
+Solution: Redraw a characters when the next character was bold and needs
+ redrawing. (Robert Webb)
+Files: src/screen.c
+
+Patch 5.6.061
+Problem: When xterm sends 8-bit controls, recognizing the version response
+ doesn't work.
+ When using CSI instead of <Esc>[ for the termcap color codes,
+ using 16 colors doesn't work. (Neil Bird)
+Solution: Also accept CSI in place of <Esc>[ for the version string.
+ Also check for CSI when handling colors 8-15 in term_color().
+ Use CSI for builtin xterm termcap entries when 'term' contains
+ "8bit".
+Files: runtime/doc/term.txt, src/ex_cmds.c, src/option.c, src/term.c,
+ src/os_unix.c, src/proto/option.pro, src/proto/term.pro
+
+Patch 5.6.062
+Problem: The documentation says that setting 'smartindent' doesn't have an
+ effect when 'cindent' is set, but it does make a difference for
+ lines starting with "#". (Neil Bird)
+Solution: Really ignore 'smartindent' when 'cindent' is set.
+Files: src/misc1.c, src/ops.c
+
+Patch 5.6.063
+Problem: Using "I" in Visual-block mode doesn't accept a count. (Johannes
+ Zellner)
+Solution: Pass the count on to do_insert() and edit(). (Allan Kelly)
+Files: src/normal.c, src/ops.c, src/proto/ops.pro
+
+Patch 5.6.064
+Problem: MS-DOS and Win32 console: Mouse doesn't work correctly after
+ including patch 5.6.28. (Vince Negri)
+Solution: Don't check for mouse scroll wheel when the mouse code contains
+ the number of clicks.
+Files: src/term.c
+
+Patch 5.6.065
+Problem: After moving the cursor around in Insert mode, typing a space can
+ still trigger an abbreviation. (Benji Fisher)
+Solution: Don't check for an abbreviation after moving around in Insert mode.
+Files: src/edit.c
+
+Patch 5.6.066
+Problem: Still a few bold character spill-over remains after patch 60.
+Solution: Clear character just in front of blanking out rest of the line.
+ (Robert Webb)
+Files: src/screen.c
+
+Patch 5.6.067
+Problem: When a file name contains a NL, the viminfo file is corrupted.
+Solution: Use viminfo_writestring() to convert the NL to CTRL-V n.
+ Also fix the Buffers menu and listing a menu name with a newline.
+Files: runtime/menu.vim, src/buffer.c, src/mark.c, src/menu.c
+
+Patch 5.6.068
+Problem: Compiling the Perl interface doesn't work with Perl 5.6.0.
+ (Bernhard Rosenkraenzer)
+Solution: Also check xs_apiversion for the version number when prepending
+ defines for PL_*.
+Files: src/Makefile
+
+Patch 5.6.069
+Problem: "go" doesn't always end up at the right character when
+ 'fileformat' is "dos". (Bruce DeVisser)
+Solution: Correct computations in ml_find_line_or_offset().
+Files: src/memline.
+
+Patch 5.6.070 (depends on 5.6.068)
+Problem: Compiling the Perl interface doesn't work with Perl 5.6.0.
+ (Bernhard Rosenkraenzer)
+Solution: Simpler check instead of the one from patch 68.
+Files: src/Makefile
+
+Patch 5.6.071
+Problem: "A" in Visual block mode on a Tab positions the cursor one char to
+ the right. (Michael Haumann)
+Solution: Correct the column computation in op_insert().
+Files: src/ops.c
+
+Patch 5.6.072
+Problem: When starting Vim with "vim +startinsert", it enters Insert mode
+ only after typing the first command. (Andrew Pimlott)
+Solution: Insert a dummy command in the stuff buffer.
+Files: src/main.c
+
+Patch 5.6.073 (extra) (depends on 5.6.034)
+Problem: Win32 GUI: When compiled with Bcc 5.5 menus don't work.
+ In dosinst.c toupper() and tolower() give an "internal compiler
+ error" for Bcc 5.5.
+Solution: Define WINVER to 4 to avoid compiling for Windows 2000. (Dan
+ Sharp) Also cleaned up compilation arguments.
+ Use our own implementation of toupper() in dosinst.c. Use
+ mytoupper() instead of tolower().
+Files: src/Makefile.bor, src/dosinst.c
+
+Patch 5.6.074 (extra)
+Problem: Entering CSI directly doesn't always work, because it's recognized
+ as the start of a special key. Mostly a problem with multi-byte
+ in the GUI.
+Solution: Use K_CSI for a typed CSI character. Use <CSI> for a normal CSI,
+ <xCSI> for a CSI typed in the GUI.
+Files: runtime/doc/intro.txt, src/getchar.c, src/gui_amiga.c,
+ src/gui_gtk_x11.c, src/gui_mac.c, src/gui_riscos.c, src/gui_w32.c,
+ src/keymap.h, src/misc2.c
+
+Patch 5.6.075
+Problem: When using "I" or "A" in Visual block mode while 'sts' is set may
+ change spaces to a Tab the inserted text is not correct. (Mike
+ Steed) And some other problems when using "A" to append after the
+ end of the line.
+Solution: Check for change in spaces/tabs after inserting the text. Append
+ spaces to fill the gap between the end-of-line and the right edge
+ of the block.
+Files: src/ops.c
+
+Patch 5.6.076
+Problem: GTK GUI: Mapping <M-Space> doesn't work.
+Solution: Don't use the "Alt" modifier twice in key_press_event().
+Files: src/gui_gtk_x11.c
+
+Patch 5.6.077
+Problem: GUI: When interrupting an external program with CTRL-C, gvim might
+ crash. (Benjamin Korvemaker)
+Solution: Avoid using a NULL pointer in ui_inchar_undo().
+Files: src/ui.c
+
+Patch 5.6.078
+Problem: Locale doesn't always work on FreeBSD. (David O'Brien)
+Solution: Link with the "xpg4" library when available.
+Files: src/configure.in, src/configure
+
+Patch 5.6.079
+Problem: Vim could crash when several Tcl interpreters are created and
+ destroyed.
+Solution: handle the "exit" command and nested ":tcl" commands better. (Ingo
+ Wilken)
+Files: runtime/doc/if_tcl.txt, src/if_tcl.c
+
+Patch 5.6.080
+Problem: When jumping to a tag, generating the tags file and jumping to the
+ same tag again uses the old search pattern. (Sung-Hyun Nam)
+Solution: Flush cached tag matches when executing an external command.
+Files: src/misc2.c, src/proto/tag.pro, src/tag.c
+
+Patch 5.6.081
+Problem: ":syn include" uses a level for the included file, this confuses
+ contained items included at the same level.
+Solution: Use a unique tag for each included file. Changed sp_syn_inc_lvl
+ to sp_syn_inc_tag. (Scott Bigham)
+Files: src/syntax.c, src/structs.h
+
+Patch 5.6.082
+Problem: When using cscope, Vim can crash.
+Solution: Initialize tag_fname in find_tags(). (Anton Blanchard)
+Files: src/tag.c
+
+Patch 5.6.083 (extra)
+Problem: Win32: The visual beep can't be seen. (Eric Roesinger)
+Solution: Flush the output before waiting with GdiFlush(). (Maurice S. Barnum)
+ Also: Allow specifying the delay in t_vb for the GUI.
+Files: src/gui.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c,
+ src/gui_riscos.c, src/gui_w32.c, src/gui_x11.c, src/gui_beos.cc,
+ src/proto/gui_amiga.pro, src/proto/gui_gtk_x11.pro,
+ src/proto/gui_mac.pro, src/proto/gui_riscos.pro,
+ src/proto/gui_w32.pro, src/proto/gui_x11.pro,
+ src/proto/gui_beos.pro
+
+Patch 5.6.084 (depends on 5.6.074)
+Problem: GUI: Entering CSI doesn't always work for Athena and Motif.
+Solution: Handle typed CSI as <xCSI> (forgot this bit in 5.6.074).
+Files: src/gui_x11.c
+
+Patch 5.6.085
+Problem: Multi-byte: Using "r" to replace a double-byte char with a
+ single-byte char moved the cursor one character. (Matsumoto)
+ Also, using a count when replacing a single-byte char with a
+ double-byte char didn't work.
+Solution: Don't use del_char() to delete the second byte.
+ Get "ptr" again after calling ins_char().
+Files: src/normal.c
+
+Patch 5.6.086 (extra)
+Problem: Win32: When using libcall() and the returned value is not a valid
+ pointer, Vim crashes.
+Solution: Use IsBadStringPtr() to check if the pointer is valid.
+Files: src/os_win32.c
+
+Patch 5.6.087
+Problem: Multi-byte: Commands and messages with multi-byte characters are
+ displayed wrong.
+Solution: Detect double-byte characters. (Yasuhiro Matsumoto)
+Files: src/ex_getln.c, src/message.c, src/misc2.c, src/screen.c
+
+Patch 5.6.088
+Problem: Multi-byte with Motif or Athena: The message "XIM requires
+ fontset" is annoying when Vim was compiled with XIM support but it
+ is not being used.
+Solution: Remove that message.
+Files: src/multbyte.c
+
+Patch 5.6.089
+Problem: On non-Unix systems it's possible to overwrite a read-only file
+ without using "!".
+Solution: Check if the file permissions allow overwriting before moving the
+ file to become the backup file.
+Files: src/fileio.c
+
+Patch 5.6.090
+Problem: When editing a file in "/home/dir/home/dir" this was replaced with
+ "~~". (Andreas Jellinghaus)
+Solution: Replace the home directory only once in home_replace().
+Files: src/misc1.c
+
+Patch 5.6.091
+Problem: When editing many "no file" files, can't create swap file, because
+ .sw[a-p] have all been used. (Neil Bird)
+Solution: Also use ".sv[a-z]", ".su[a-z]", etc.
+Files: src/memline.c
+
+Patch 5.6.092
+Problem: FreeBSD: When setting $TERM to a non-valid terminal name, Vim
+ hangs in tputs().
+Solution: After tgetent() returns an error code, call it again with the
+ terminal name "dumb". This apparently creates an environment in
+ which tputs() doesn't fail.
+Files: src/term.c
+
+Patch 5.6.093 (extra)
+Problem: Win32 GUI: "ls | gvim -" will show a message box about reading
+ stdin when Vim exits. (Donohue)
+Solution: Don't write a message about the file read from stdin until the GUI
+ has started.
+Files: src/fileio.c
+
+Patch 5.6.094
+Problem: Problem with multi-byte string for ":echo var".
+Solution: Check for length in msg_outtrans_len_attr(). (Sung-Hyun Nam)
+ Also make do_echo() aware of multi-byte characters.
+Files: src/eval.c, src/message.c
+
+Patch 5.6.095
+Problem: With an Emacs TAGS file that include another a relative path
+ doesn't always work.
+Solution: Use expand_tag_fname() on the name of the included file.
+ (Utz-Uwe Haus)
+Files: src/tag.c
+
+Patch 5.6.096
+Problem: Unix: When editing many files, startup can be slow. (Paul
+ Ackersviller)
+Solution: Halve the number of stat() calls used to add a file to the buffer
+ list.
+Files: src/buffer.c
+
+Patch 5.7a.001
+Problem: GTK doesn't respond on drag&drop from ROX-Filer.
+Solution: Add "text/uri-list" target. (Thomas Leonard)
+ Also: fix problem with checking for trash arguments.
+Files: src/gui_gtk_x11.c
+
+Patch 5.7a.002
+Problem: Multi-byte: 'showmatch' is performed when second byte of an
+ inserted double-byte char is a paren or brace.
+Solution: Check IsTrailByte() before calling showmatch(). (Taro Muraoka)
+Files: src/misc1.c
+
+Patch 5.7a.003
+Problem: Multi-byte: After using CTRL-O in Insert mode with the cursor at
+ the end of the line on a multi-byte character the cursor moves to
+ the left.
+Solution: Check for multi-byte character at end-of-line. (Taro Muraoka)
+ Also: fix cls() to detect a double-byte character. (Chong-Dae Park)
+Files: src/edit.c, src/search.c
+
+Patch 5.7a.004
+Problem: When reporting the search pattern offset, the string could be
+ unterminated, which may cause a crash.
+Solution: Terminate the string for the search offset. (Stephen P. Wall)
+Files: src/search.c
+
+Patch 5.7a.005
+Problem: When ":s//~/" doesn't find a match it reports "[NULL]" for the
+ pattern.
+Solution: Use get_search_pat() to obtain the actually used pattern.
+Files: src/ex_cmds.c, src/proto/search.pro, src/search.c
+
+Patch 5.7a.006 (extra)
+Problem: VMS: Various problems, also with the VAXC compiler.
+Solution: In many places use the Unix code for VMS too.
+ Added time, date and compiler version to version message.
+ (Zoltan Arpadffy)
+Files: src/ex_cmds.c, src/ex_docmd.c, src/globals.h, src/gui_vms_conf.h,
+ src/main.c, src/message.c, src/misc1.c, src/os_vms.c,
+ src/os_vms.h, src/os_vms.mms, src/os_vms_conf.h,
+ src/proto/os_vms.pro, src/proto/version.pro, src/term.c,
+ src/version.c, src/xxd/os_vms.mms, src/xxd/xxd.c
+
+Patch 5.7a.007
+Problem: Motif and Athena GUI: CTRL-@ is interpreted as CTRL-C.
+Solution: Only use "intr_char" when it has been set.
+Files: src/gui_x11.c
+
+Patch 5.7a.008
+Problem: GTK GUI: When using CTRL-L the screen is redrawn twice, causing
+ trouble for bold characters. Also happens when moving with the
+ scrollbar. Best seen when 'writedelay' is non-zero.
+ When starting the GUI with ":gui" the screen is redrawn once with
+ the wrong colors.
+Solution: Only set the geometry hints when the window size really changed.
+ This avoids setting it each time the scrollbar is forcefully
+ redrawn.
+ Don't redraw in expose_event() when gui.starting is still set.
+Files: src/gui_gtk_x11.c
+
+
+==============================================================================
+VERSION 5.8 *version-5.8*
+
+Version 5.8 is a bug-fix version of 5.7.
+
+
+Changed *changed-5.8*
+-------
+
+Ctags is no longer included with Vim. It has grown into a project of its own.
+You can find it here: http://ctags.sf.net. It is highly recommended as a Vim
+companion when you are writing programs.
+
+
+Added *added-5.8*
+-----
+
+New syntax files:
+acedb AceDB (Stewart Morris)
+aflex Aflex (Mathieu Clabaut)
+antlr Antlr (Mathieu Clabaut)
+asm68k 68000 Assembly (Steve Wall)
+automake Automake (John Williams)
+ayacc Ayacc (Mathieu Clabaut)
+b B (Mathieu Clabaut)
+bindzone BIND zone (glory hump)
+blank Blank (Rafal Sulejman)
+cfg Configure files (Igor Prischepoff)
+changelog ChangeLog (Gediminas Paulauskas)
+cl Clever (Phil Uren)
+crontab Crontab (John Hoelzel)
+csc Essbase script (Raul Segura Acevedo)
+cynlib Cynlib(C++) (Phil Derrick)
+cynpp Cyn++ (Phil Derrick)
+debchangelog Debian Changelog (Wichert Akkerman)
+debcontrol Debian Control (Wichert Akkerman)
+dns DNS zone file (Jehsom)
+dtml Zope's DTML (Jean Jordaan)
+dylan Dylan, Dylan-intr and Dylan-lid (Brent Fulgham)
+ecd Embedix Component Description (John Beppu)
+fgl Informix 4GL (Rafal Sulejman)
+foxpro FoxPro (Powing Tse)
+gsp GNU Server Pages (Nathaniel Harward)
+gtkrc GTK rc (David Necas)
+hercules Hercules (Avant! Corporation) (Dana Edwards)
+htmlos HTML/OS by Aestiva (Jason Rust)
+inittab SysV process control (David Necas)
+iss Inno Setup (Dominique Stephan)
+jam Jam (Ralf Lemke)
+jess Jess (Paul Baleme)
+lprolog LambdaProlog (Markus Mottl)
+ia64 Intel Itanium (parth malwankar)
+kix Kixtart (Nigel Gibbs)
+mgp MaGic Point (Gerfried Fuchs)
+mason Mason (HTML with Perl) (Andrew Smith)
+mma Mathematica (Wolfgang Waltenberger)
+nqc Not Quite C (Stefan Scherer)
+omnimark Omnimark (Paul Terray)
+openroad OpenROAD (Luis Moreno Serrano)
+named BIND configuration (glory hump)
+papp PApp (Marc Lehmann)
+pfmain Postfix main config (Peter Kelemen)
+pic PIC assembly (Aleksandar Veselinovic)
+ppwiz PPWizard (Stefan Schwarzer)
+progress Progress (Phil Uren)
+psf Product Specification File (Rex Barzee)
+r R (Tom Payne)
+registry MS-Windows registry (Dominique Stephan)
+robots Robots.txt (Dominique Stephan)
+rtf Rich Text Format (Dominique Stephan)
+setl SETL (Alex Poylisher)
+sgmldecl SGML Declarations (Daniel A. Molina W.)
+sinda Sinda input (Adrian Nagle)
+sindacmp Sinda compare (Adrian Nagle)
+sindaout Sinda output (Adrian Nagle)
+smith SMITH (Rafal Sulejman)
+snobol4 Snobol 4 (Rafal Sulejman)
+strace Strace (David Necas)
+tak TAK input (Adrian Nagle)
+takcmp TAK compare (Adrian Nagle)
+takout TAK output (Adrian Nagle)
+tasm Turbo assembly (FooLman)
+texmf TeX configuration (David Necas)
+trasys Trasys input (Adrian Nagle)
+tssgm TSS Geometry (Adrian Nagle)
+tssop TSS Optics (Adrian Nagle)
+tsscl TSS Command line (Adrian Nagle)
+virata Virata Configuration Script (Manuel M.H. Stol)
+vsejcl VSE JCL (David Ondrejko)
+wdiff Wordwise diff (Gerfried Fuchs)
+wsh Windows Scripting Host (Paul Moore)
+xkb X Keyboard Extension (David Necas)
+
+Renamed php3 to php, it now also supports php4 (Lutz Eymers)
+
+Patch 5.7.015
+Problem: Syntax files for Vim 6.0 can't be used with 5.x.
+Solution: Add the "default" argument to the ":highlight" command: Ignore the
+ command if highlighting was already specified.
+Files: src/syntax.c
+
+Generate the Syntax menu with makemenu.vim, so that it doesn't have to be done
+when Vim is starting up. Reduces the startup time of the GUI.
+
+
+Fixed *fixed-5.8*
+-----
+
+Conversion of docs to HTML didn't convert "|tag|s" to a hyperlink.
+
+Fixed compiling under NeXT. (Jeroen C.M. Goudswaard)
+
+optwin.vim gave an error when used in Vi compatible mode ('cpo' contains 'C').
+
+Tcl interpreter: "buffer" command didn't check for precense of an argument.
+(Dave Bodenstab)
+
+dosinst.c: Added checks for too long file name.
+
+Amiga: a file name starting with a colon was considered absolute but it isn't.
+Amiga: ":pwd" added a slash when in the root of a drive.
+
+Macintosh: Warnings for unused variables. (Bernhard Pruemmer)
+
+Unix: When catching a deadly signal, handle it in such a way that it's
+unlikely that Vim will hang. Call _exit() instead of exit() in case of a
+severe problem.
+
+Setting the window title from nothing to something didn't work after patch 29.
+
+Check for ownership of .exrc and .vimrc was done with stat(). Use lstat() as
+well for extra security.
+
+Win32 GUI: Printing a file with 'fileformat' "unix" didn't work. Set
+'fileformat' to "dos" before writing the temp file.
+
+Unix: Could start waiting for a character when checking for a CTRL-C typed
+when an X event is received.
+
+Could not use Perl and Python at the same time on FreeBSD, because Perl used
+"-lc" and Python used the threaded C library.
+
+Win32: The Mingw compiler gave a few warning messages.
+
+When using "ZZ" and an autocommand for writing uses an abbreviation it didn't
+work. Don't stuff the ":x" command but execute it directly. (Mikael Berthe)
+
+VMS doesn't always have lstat(), added an #ifdef around it.
+
+Added a few corrections for the Macintosh. (Axel Kielhorn)
+
+Win32: Gvimext could not edit more than a few files at once, the length of the
+argument was fixed.
+
+
+Previously released patches for Vim 5.7:
+
+Patch 5.7.001
+Problem: When the current buffer is crypted, and another modified buffer
+ isn't, ":wall" will encrypt the other buffer.
+Solution: In buf_write() use "buf" instead of "curbuf" to check for the
+ crypt key.
+Files: src/fileio.c
+
+Patch 5.7.002
+Problem: When 'showmode' is set, using "CTRL-O :r file" waits three seconds
+ before displaying the read text. (Wichert Akkerman)
+Solution: Set "keep_msg" to the file message so that the screen is redrawn
+ before the three seconds wait for displaying the mode message.
+Files: src/fileio.c
+
+Patch 5.7.003
+Problem: Searching for "[[:cntrl:]]" doesn't work.
+Solution: Exclude NUL from the matching characters, it terminates the list.
+Files: src/regexp.c
+
+Patch 5.7.004
+Problem: GTK: When selecting a new font, Vim can crash.
+Solution: In gui_mch_init_font() unreference the old font, not the new one.
+Files: src/gui_gtk_x11.c
+
+Patch 5.7.005
+Problem: Multibyte: Inserting a wrapped line corrupts kterm screen.
+ Pasting TEXT/COMPOUND_TEXT into Vim does not work.
+ On Motif no XIM status line is displayed even though it is
+ available.
+Solution: Don't use xterm trick for wrapping lines for multibyte mode.
+ Correct a missing "break", added TEXT/COMPOUND_TEXT selection
+ request.
+ Add XIMStatusArea fallback code.
+ (Katsuhito Nagano)
+Files: src/gui_gtk_x11.c, src/multbyte.c, src/screen.c, src/ui.c
+
+Patch 5.7.006
+Problem: GUI: redrawing the non-Visual selection is wrong when the window
+ is unobscured. (Jean-Pierre Etienne)
+Solution: Redraw the selection properly and don't clear it. Added "len"
+ argument to clip_may_redraw_selection().
+Files: src/gui.c, src/ui.c, src/proto/ui.pro
+
+Patch 5.7.007
+Problem: Python: Crash when using the current buffer twice.
+Solution: Increase the reference count for buffer and window objects.
+ (Johannes Zellner)
+Files: src/if_python.c
+
+Patch 5.7.008
+Problem: In Ex mode, backspacing over the first TAB doesn't work properly.
+ (Wichert Akkerman)
+Solution: Switch the cursor on before printing the newline.
+Files: src/ex_getln.c
+
+Patch 5.7.009 (extra)
+Problem: Mac: Crash when using a long file.
+Solution: Don't redefine malloc() and free(), because it will break using
+ realloc().
+Files: src/os_mac.h
+
+Patch 5.7.010
+Problem: When using CTRL-A on a very long number Vim can crash. (Michael
+ Naumann)
+Solution: Truncate the length of the new number to avoid a buffer overflow.
+Files: src/ops.c
+
+Patch 5.7.011 (extra)
+Problem: Win32 GUI on NT 5 and Win98: Displaying Hebrew is reversed.
+Solution: Output each character separately, to avoid that Windows reverses
+ the text for some fonts. (Ron Aaron)
+Files: src/gui_w32.c
+
+Patch 5.7.012
+Problem: When using "-complete=buffer" for ":command" the user command
+ fails.
+Solution: In a user command don't replace the buffer name with a count for
+ the buffer number.
+Files: src/ex_docmd.c
+
+Patch 5.7.013
+Problem: "gD" didn't always find a match in the first line, depending on
+ the column the search started at.
+Solution: Reset the column to zero before starting to search.
+Files: src/normal.c
+
+Patch 5.7.014
+Problem: Rot13 encoding was done on characters with accents, which is
+ wrong. (Sven Gottwald)
+Solution: Only do rot13 encoding on ASCII characters.
+Files: src/ops.c
+
+Patch 5.7.016
+Problem: When hitting 'n' for a ":s///c" command, the ignore-case flag was
+ not restored, some matches were skipped. (Daniel Blaustein)
+Solution: Restore the reg_ic variable when 'n' was hit.
+Files: src/ex_cmds.c
+
+Patch 5.7.017
+Problem: When using a Vim script for Vim 6.0 with <SID> before a function
+ name, it produces an error message even when inside an "if version
+ >= 600". (Charles Campbell)
+Solution: Ignore errors in the function name when the function is not going
+ to be defined.
+Files: src/eval.c
+
+Patch 5.7.018
+Problem: When running "rvim" or "vim -Z" it was still possible to execute a
+ shell command with system() and backtick-expansion. (Antonios A.
+ Kavarnos)
+Solution: Disallow executing a shell command in get_cmd_output() and
+ mch_expand_wildcards().
+Files: src/misc1.c, src/os_unix.c
+
+Patch 5.7.019
+Problem: Multibyte: In a substitute string, a multi-byte character isn't
+ skipped properly, can be a problem when the second byte is a
+ backslash.
+Solution: Skip an extra byte for a double-byte character. (Muraoka Taro)
+Files: src/ex_cmds.c
+
+Patch 5.7.020
+Problem: Compilation doesn't work on MacOS-X.
+Solution: Add a couple of #ifdefs. (Jamie Curmi)
+Files: src/regexp.c, src/ctags/general.h
+
+Patch 5.7.021
+Problem: Vim sometimes produces a beep when started in an xterm. Only
+ happens when compiled without mouse support.
+Solution: Requesting the xterm version results in a K_IGNORE. This wasn't
+ handled when mouse support is disabled. Accept K_IGNORE always.
+Files: src/normal.c
+
+Patch 5.7.022
+Problem: %v in 'statusline' is not displayed when it's equal to %c.
+Solution: Check if %V or %v is used and handle them differently.
+Files: src/screen.c
+
+Patch 5.7.023
+Problem: Crash when a WinLeave autocommand deletes the buffer in the other
+ window.
+Solution: Check that after executing the WinLeave autocommands there still
+ is a window to be closed. Also update the test that was supposed
+ to check for this problem.
+Files: src/window.c, testdir/test13.in, testdir/test13.ok
+
+Patch 5.7.024
+Problem: Evaluating an expression for 'statusline' can have side effects.
+Solution: Evaluate the expression in a sandbox.
+Files: src/edit.c, src/eval.c, src/proto/eval.pro, src/ex_cmds.c,
+ src/ex_cmds.h, src/ex_docmd.c, src/globals.h, src/option.c,
+ src/screen.c, src/undo.c
+
+Patch 5.7.025 (fixed)
+Problem: Creating a temp file has a race condition.
+Solution: Create a private directory to write the temp files in.
+Files: src/fileio.c, src/misc1.c, src/proto/misc1.pro,
+ src/proto/fileio.pro, src/memline.c, src/os_unix.h
+
+Patch 5.7.026 (extra)
+Problem: Creating a temp file has a race condition.
+Solution: Create a private directory to write the temp files in.
+ This is the extra part of patch 5.7.025.
+Files: src/os_msdos.h
+
+Patch 5.7.027
+Problem: Starting to edit a file can cause a crash. For example when in
+ Insert mode, using CTRL-O :help abbr<Tab> to scroll the screen and
+ then <CR>, which edits a help file. (Robert Bogomip)
+Solution: Check if keep_msg is NULL before copying it.
+Files: src/fileio.c
+
+Patch 5.7.028
+Problem: Creating a backup or swap file could fail in rare situations.
+Solution: Use O_EXCL for open().
+Files: src/fileio.c, src/memfile.c
+
+Patch 5.7.029
+Problem: Editing a file with an extremely long name crashed Vim.
+Solution: Check for length of the name when setting the window title.
+Files: src/buffer.c
+
+Patch 5.7.030
+Problem: A ":make" or ":grep" command with a very long argument could cause
+ a crash.
+Solution: Allocate the buffer for the shell command.
+Files: src/ex_docmd.c
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
new file mode 100644
index 000000000..d97cf92a8
--- /dev/null
+++ b/runtime/doc/version6.txt
@@ -0,0 +1,13846 @@
+*version6.txt* For Vim version 7.0aa. Last change: 2004 Jun 07
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Welcome to Vim Version 6.0! A large number of features has been added. This
+file mentions all the new items that have been added, changes to existing
+features and bug fixes compared to Vim 5.x.
+
+See |vi_diff.txt| for an overview of differences between Vi and Vim 6.0.
+See |version4.txt| for differences between Vim 3.0 and Vim 4.0.
+See |version5.txt| for differences between Vim 4.0 and Vim 5.0.
+
+INCOMPATIBLE CHANGES |incompatible-6|
+
+Cursor position in Visual mode |curpos-visual|
+substitute command Vi compatible |substitute-CR|
+global option values introduced |new-global-values|
+'fileencoding' changed |fileencoding-changed|
+Digraphs changed |digraphs-changed|
+Filetype detection changed |filetypedetect-changed|
+Unlisted buffers introduced |new-unlisted-buffers|
+CTRL-U in Command-line mode changed |CTRL-U-changed|
+Ctags gone |ctags-gone|
+Documentation reorganized |documentation-6|
+Modeless selection and clipboard |modeless-and-clipboard|
+Small incompatibilities |incomp-small-6|
+
+NEW FEATURES |new-6|
+
+Folding |new-folding|
+Vertically split windows |new-vertsplit|
+Diff mode |new-diff-mode|
+Easy Vim: click-and-type |new-evim|
+User manual |new-user-manual|
+Flexible indenting |new-indent-flex|
+Extended search patterns |new-searchpat|
+UTF-8 support |new-utf-8|
+Multi-language support |new-multi-lang|
+Plugin support |new-plugins|
+Filetype plugins |new-filetype-plugins|
+File browser |new-file-browser|
+Editing files over a network |new-network-files|
+Window for command-line editing |new-cmdwin|
+Debugging mode |new-debug-mode|
+Cursor in virtual position |new-virtedit|
+Debugger interface |new-debug-itf|
+Communication between Vims |new-vim-server|
+Buffer type options |new-buftype|
+Printing |new-printing|
+Ports |ports-6|
+Quickfix extended |quickfix-6|
+Operator modifiers |new-operator-mod|
+Search Path |new-search-path|
+Writing files improved |new-file-writing|
+Argument list |new-argument-list|
+Restore a View |new-View|
+Color schemes |new-color-schemes|
+Various new items |new-items-6|
+
+IMPROVEMENTS |improvements-6|
+
+COMPILE TIME CHANGES |compile-changes-6|
+
+BUG FIXES |bug-fixes-6|
+
+VERSION 6.1 |version-6.1|
+Changed |changed-6.1|
+Added |added-6.1|
+Fixed |fixed-6.1|
+
+VERSION 6.2 |version-6.2|
+Changed |changed-6.2|
+Added |added-6.2|
+Fixed |fixed-6.2|
+
+VERSION 6.3 |version-6.3|
+Changed |changed-6.3|
+Added |added-6.3|
+Fixed |fixed-6.3|
+
+==============================================================================
+INCOMPATIBLE CHANGES *incompatible-6*
+
+These changes are incompatible with previous releases. Check this list if you
+run into a problem when upgrading from Vim 5.x to 6.0
+
+
+Cursor position in Visual mode *curpos-visual*
+------------------------------
+
+When going from one window to another window on the same buffer while in
+Visual mode, the cursor position of the other window is adjusted to keep the
+same Visual area. This can be used to set the start of the Visual area in one
+window and the end in another. In vim 5.x the cursor position of the other
+window would be used, which could be anywhere and was not very useful.
+
+
+Substitute command Vi compatible *substitute-CR*
+--------------------------------
+
+The substitute string (the "to" part of the substitute command) has been made
+Vi compatible. Previously a CTRL-V had a special meaning and could be used to
+prevent a <CR> to insert a line break. This made it impossible to insert a
+CTRL-V before a line break. Now a backslash is used to prevent a <CR> to
+cause a line break. Since the number of backslashes is halved, it is still
+possible to insert a line break at the end of the line. This now works just
+like Vi, but it's not compatible with Vim versions before 6.0.
+
+When a ":s" command doesn't make any substitutions, it no longer sets the '[
+and '] marks. This is not related to Vi, since it doesn't have these marks.
+
+
+Global option values introduced *new-global-values*
+-------------------------------
+
+There are now global values for options which are local to a buffer or window.
+Previously the local options were copied from one buffer to another. When
+editing another file this could cause option values from a modeline to be used
+for the wrong file. Now the global values are used when entering a buffer
+that has not been used before. Also, when editing another buffer in a window,
+the local window options are reset to their global values. The ":set" command
+sets both the local and global values, this is still compatible. But a
+modeline only sets the local value, this is not backwards compatible.
+
+":let &opt = val" now sets the local and global values, like ":set". New
+commands have been added to set the global or local value:
+ :let &opt = val like ":set"
+ :let &g:opt = val like ":setglobal"
+ :let &l:opt = val like ":setlocal"
+
+
+'fileencoding' changed *fileencoding-changed*
+----------------------
+
+'fileencoding' was used in Vim 5.x to set the encoding used inside all of Vim.
+This was a bit strange, because it was local to a buffer and worked for all
+buffers. It could never be different between buffers, because it changed the
+way text in all buffers was interpreted.
+It is now used for the encoding of the file related to the buffer. If you
+still set 'fileencoding' it is likely to be overwritten by the detected
+encoding from 'fileencodings', thus it is "mostly harmless".
+The old FileEncoding autocommand now does the same as the new EncodingChanged
+event.
+
+
+Digraphs changed *digraphs-changed*
+----------------
+
+The default digraphs now correspond to RFC1345. This is very different from
+what was used in Vim 5.x. |digraphs|
+
+
+Filetype detection changed *filetypedetect-changed*
+--------------------------
+
+The filetype detection previously was using the "filetype" autocommand group.
+This caused confusion with the FileType event name (case is ignored). The
+group is now called "filetypedetect". It still works, but if the "filetype"
+group is used the autocommands will not be removed by ":filetype off".
+ The support for 'runtimepath' has made the "myfiletypefile" and
+"mysyntaxfile" mechanism obsolete. They are still used for backwards
+compatibility.
+
+The connection between the FileType event and setting the 'syntax' option was
+previously in the "syntax" autocommand group. That caused confusion with the
+Syntax event name. The group is now called "syntaxset".
+
+The distributed syntax files no longer contain "syntax clear". That makes it
+possible to include one in the other without tricks. The syntax is now
+cleared when the 'syntax' option is set (by an autocommand added from
+synload.vim). This makes the syntax cleared when the value of 'syntax' does
+not correspond to a syntax file. Previously the existing highlighting was
+kept.
+
+
+Unlisted buffers introduced *new-unlisted-buffers*
+---------------------------
+
+There is now a difference between buffers which don't appear in the buffer
+list and buffers which are really not in the buffer list. Commands like
+":ls", ":bnext", ":blast" and the Buffers menu will skip buffers not in the
+buffer list. |unlisted-buffer|
+The 'buflisted' option can be used to make a buffer appear in the buffer list
+or not.
+
+Several commands that previously added a buffer to the buffer list now create
+an unlisted buffer. This means that a ":bnext" and ":ball" will not find these
+files until they have actually been edited. For example, buffers used for the
+alternative file by ":write file" and ":read file".
+ Other commands previously completely deleted a buffer and now only remove
+the buffer from the buffer list. Commands relying on a buffer not to be
+present might fail. For example, a ":bdelete" command in an autocommand that
+relied on something following to fail (was used in the automatic tests).
+|:bwipeout| can be used for the old meaning of ":bdelete".
+
+The BufDelete autocommand event is now triggered when a buffer is removed from
+the buffer list. The BufCreate event is only triggered when a buffer is
+created that is added to the buffer list, or when an existing buffer is added
+to the buffer list. BufAdd is a new name for BufCreate.
+The new BufNew event is for creating any buffer and BufWipeout for really
+deleting a buffer.
+
+When doing Insert mode completion, only buffers in the buffer list are
+scanned. Added the 'U' flag to 'complete' to do completion from unlisted
+buffers.
+
+Unlisted buffers are not stored in a viminfo file.
+
+
+CTRL-U in Command-line mode changed *CTRL-U-changed*
+-----------------------------------
+
+Using CTRL-U when editing the command line cleared the whole line. Most
+shells only delete the characters before the cursor. Made it work like that.
+(Steve Wall)
+
+You can get the old behavior with CTRL-E CTRL-U: >
+ :cnoremap <C-U> <C-E><C-U>
+
+
+Ctags gone *ctags-gone*
+----------
+
+Ctags is no longer part of the Vim distribution. It's now a grown-up program
+by itself, it deserves to be distributed separately.
+Ctags can be found here: http://ctags.sf.net/.
+
+
+Documentation reorganized *documentation-6*
+-------------------------
+
+The documentation has been reorganized, an item may not be where you found it
+in Vim 5.x.
+- The user manual was added, some items have been moved to it from the
+ reference manual.
+- The quick reference is now in a separate file (so that it can be printed).
+
+The examples in the documentation were previously marked with a ">" in the
+first column. This made it difficult to copy/paste them. There is now a
+single ">" before the example and it ends at a "<" or a non-blank in the first
+column. This also looks better without highlighting.
+
+'helpfile' is no longer used to find the help tags file. This allows a user
+to add its own help files (e.g., for plugins).
+
+
+Modeless selection and clipboard *modeless-and-clipboard*
+--------------------------------
+
+The modeless selection is used to select text when Visual mode can't be used,
+for example when editing the command line or at the more prompt.
+In Vim 5.x the modeless selection was always used. On MS-Windows this caused
+the clipboard to be overwritten, with no way to avoid that. The modeless
+selection now obeys the 'a' and 'A' flags in 'guioptions' and "autoselect" and
+"autoselectml" in 'clipboard'. By default there is no automatic copy on
+MS-Windows. Use the |c_CTRL-Y| command to manually copy the selection.
+
+To get the old behavior back, do this: >
+
+ :set clipboard^=autoselectml guioptions+=A
+
+
+Small incompatibilities *incomp-small-6*
+-----------------------
+
+'backupdir', 'cdpath', 'directory', 'equalprg', 'errorfile', 'formatprg',
+'grepprg', 'helpfile', 'makeef', 'makeprg', 'keywordprg', 'cscopeprg',
+'viminfo' and 'runtimepath' can no longer be set from a modeline, for better
+security.
+
+Removed '_' from the 'breakat' default: It's commonly used in keywords.
+
+The default for 'mousehide' is on, because this works well for most people.
+
+The Amiga binary is now always compiled with "big" features. The "big" binary
+archive no longer exists.
+
+The items "[RO]", "[+]", "[help]", "[Preview]" and "[filetype]" in
+'statusline' no longer have a leading space.
+
+Non-Unix systems: When expanding wildcards for the Vim arguments, don't use
+'suffixes'. It now works as if the shell had expanded the arguments.
+
+The 'lisp', 'smartindent' and 'cindent' options are not switched off when
+'paste' is set. The auto-indenting is disabled when 'paste' is set, but
+manual indenting with "=" still works.
+
+When formatting with "=" uses 'cindent' or 'indentexpr' indenting, and there
+is no change in indent, this is not counted as a change ('modified' isn't set
+and there is nothing to undo).
+
+Report 'modified' as changed when 'fileencoding' or 'fileformat' was set.
+Thus it reflects the possibility to abandon the buffer without losing changes.
+
+The "Save As" menu entry now edits the saved file. Most people expect it to
+work like this.
+
+A buffer for a directory is no longer added to the Buffers menu.
+
+Renamed <Return> to <Enter>, since that's what it's called on most keyboards.
+Thus it's now the hit-enter prompt instead of the hit-return prompt.
+Can map <Enter> just like <CR> or <Return>.
+
+The default for the 'viminfo' option is now '20,"50,h when 'compatible' isn't
+set. Most people will want to use it, including beginners, but it required
+setting the option, which isn't that easy.
+
+After using ":colder" the newer error lists are overwritten. This makes it
+possible to use ":grep" to browse in a tree-like way. Must use ":cnewer 99"
+to get the old behavior.
+
+The patterns in 'errorformat' would sometimes ignore case (MS-Windows) and
+sometimes not (Unix). Now case is always ignored. Add "\C" to the pattern to
+match case.
+
+The 16 bit MS-DOS version is now compiled without the +listcmds feature
+(buffer list manipulation commands). They are not often needed and this
+executable needs to be smaller.
+
+'sessionoptions' now includes "curdir" by default. This means that restoring
+a session will result in the current directory being restored, instead of
+going to the directory where the session file is located.
+
+A session deleted all buffers, deleting all marks. Now keep the buffer list,
+it shouldn't hurt for some existing buffers to remain present.
+When the argument list is empty ":argdel *" caused an error message.
+
+No longer put the search pattern from a tag jump in the history.
+
+Use "SpecialKey" highlighting for unprintable characters instead of "NonText".
+The idea is that unprintable text or any text that's displayed differently
+from the characters in the file is using "SpecialKey", and "NonText" is used
+for text that doesn't really exist in the file.
+
+Motif now uses the system default colors for the menu and scrollbar. Used to
+be grey. It's still possible to set the colors with ":highlight" commands and
+resources.
+
+Formatting text with "gq" breaks a paragraph at a non-empty blank line.
+Previously the line would be removed, which wasn't very useful.
+
+":normal" does no longer hang when the argument ends in half a command.
+Previously Vim would wait for more characters to be typed, without updating
+the screen. Now it pretends an <Esc> was typed.
+
+Bitmaps for the toolbar are no longer searched for in "$VIM/bitmaps" but in
+the "bitmaps" directories in 'runtimepath'.
+
+Now use the Cmdline-mode menus for the hit-enter prompt instead of the Normal
+mode menus. This generally works better and allows using the "Copy" menu to
+produce CTRL-Y to copy the modeless selection.
+
+Moved the font selection from the Window to the Edit menu, together with the
+other settings.
+
+The default values for 'isfname' include more characters to make "gf" work
+better.
+
+Changed the license for the documentation to the Open Publication License.
+This seemed fair, considering the inclusion of parts of the Vim book, which is
+also published under the OPL. The downside is that we can't force someone who
+would sell copies of the manual to contribute to Uganda.
+
+After "ayy don't let ""yy or :let @" = val overwrite the "a register.
+Use the unnamed register instead.
+
+MSDOS: A pattern "*.*" previously also matched a file name without a dot.
+This was inconsistent with other versions.
+
+In Insert mode, CTRL-O CTRL-\ CTRL-N {cmd} remains in Normal mode. Previously
+it would go back to Insert mode, thus confusing the meaning of CTRL-\ CTRL-N,
+which is supposed to take us to Normal mode (especially in ":amenu").
+
+Allow using ":" commands after an operator. Could be used to implement a new
+movement command. Thus it no longer aborts a pending operator.
+
+For the Amiga the "-d {device}" argument was possible. When compiled with the
+diff feature, this no longer works. Use "-dev {device}" instead. |-dev|
+
+Made the default mappings for <S-Insert> in Insert mode insert the text
+literally, avoids that special characters like BS cause side effects.
+
+Using ":confirm" applied to the rest of the line. Now it applies only to the
+command right after it. Thus ":confirm if x | edit | endif" no longer works,
+use ":if x | confirm edit | endif". This was the original intention, that it
+worked differently was a bug.
+
+==============================================================================
+NEW FEATURES *new-6*
+
+Folding *new-folding*
+-------
+
+Vim can now display a buffer with text folded. This allows overviewing the
+structure of a file quickly. It is also possible to yank, delete and put
+folded text, for example to move a function to another position.
+
+There is a whole bunch of new commands and options related to folding.
+See |folding|.
+
+
+Vertically split windows *new-vertsplit*
+------------------------
+
+Windows can also be split vertically. This makes it possible to have windows
+side by side. One nice use for this is to compare two similar files (see
+|new-diff-mode|). The 'scrollbind' option can be used to synchronize
+scrolling.
+
+A vertical split can be created with the commands:
+ :vsplit or CTRL-W v or CTRL-W CTRL-V |:vsplit|
+ :vnew |:vnew|
+ :vertical {cmd} |:vertical|
+The last one is a modifier, which has a meaning for any command that splits a
+window. For example: >
+ :vertical stag main
+Will vertically split the window and jump to the tag "main" in the new window.
+
+Moving from window to window horizontally can be done with the |CTRL-W_h| and
+|CTRL-W_l| commands. The |CTRL-W_k| and |CTRL-W_j| commands have been changed
+to jump to the window above or below the cursor position.
+
+The vertical and horizontal splits can be mixed as you like. Resizing windows
+is easy when using the mouse, just position the pointer on a status line or
+vertical separator and drag it. In the GUI a special mouse pointer shape
+indicates where you can drag a status or separator line.
+
+To resize vertically split windows use the |CTRL-W_<| and |CTRL-W_>| commands.
+To make a window the maximum width use the CTRL-W | command |CTRL-W_bar|.
+
+To force a new window to use the full width or height of the Vim window,
+these two modifiers are available:
+ :topleft {cmd} New window appears at the top with full
+ width or at the left with full height.
+ :botright {cmd} New window appears at the bottom with full
+ width or at the right with full height.
+This can be combined with ":vertical" to force a vertical split: >
+ :vert bot dsplit DEBUG
+This will open a window at the far right, occupying the full height of the Vim
+window, with the cursor on the first definition of "DEBUG".
+The help window is opened at the top, like ":topleft" was used, if the current
+window is fewer than 80 characters wide.
+
+A few options can be used to set the preferences for vertically split windows.
+They work similar to their existing horizontal equivalents:
+ horizontal vertical ~
+ 'splitbelow' 'splitright'
+ 'winheight' 'winwidth'
+ 'winminheight' 'winminwidth'
+It's possible to set 'winminwidth' to zero, so that temporarily unused windows
+hardly take up space without closing them.
+
+The new 'eadirection' option tells where 'equalalways' applies:
+ :set eadirection=both both directions
+ :set eadirection=ver equalize window heights
+ :set eadirection=hor equalize windows widths
+This can be used to avoid changing window sizes when you want to keep them.
+
+Since windows can become quite narrow with vertical splits, text lines will
+often not fit. The 'sidescrolloff' has been added to keep some context left
+and right of the cursor. The 'listchars' option has been extended with the
+"precedes" item, to show a "<" for example, when there is text left off the
+screen. (Utz-Uwe Haus)
+
+"-O" command line argument: Like "-o" but split windows vertically. (Scott
+Urban)
+
+Added commands to move the current window to the very top (CTRL-W K), bottom
+(CTRL-W J), left (CTRL-W H) and right (CTRL-W L). In the new position the
+window uses the full width/height of the screen.
+
+When there is not enough room in the status line for both the file name and
+the ruler, use up to half the width for the ruler. Useful for narrow windows.
+
+
+Diff mode *new-diff-mode*
+---------
+
+In diff mode Vim shows the differences between two, three or four files.
+Folding is used to hide the parts of the file that are equal.
+Highlighting is used to show deleted and changed lines.
+See |diff-mode|.
+
+An easy way to start in diff mode is to start Vim as "vimdiff file1 file2".
+Added the vimdiff manpage.
+
+In a running Vim the |:diffsplit| command starts diff mode for the current
+file and another file. The |:diffpatch| command starts diff mode using the
+current file and a patch file. The |:diffthis| command starts diff mode for
+the current window.
+
+Differences can be removed with the |:diffget| and |:diffput| commands.
+
+- The 'diff' option switches diff mode on in a window.
+- The |:diffupdate| command refreshes the diffs.
+- The 'diffopt' option changes how diffs are displayed.
+- The 'diffexpr' option can be set how a diff is to be created.
+- The 'patchexpr' option can be set how patch is applied to a file.
+- Added the "diff" folding method. When opening a window for diff-mode, set
+ 'foldlevel' to zero and 'foldenable' on, to close the folds.
+- Added the DiffAdd, DiffChange, DiffDelete and DiffText highlight groups to
+ specify the highlighting for differences. The defaults are ugly...
+- Unix: make a vimdiff symbolic link for "make install".
+- Removed the now obsolete "vimdiff.vim" script from the distribution.
+- Added the "[c" and "]c" commands to move to the next/previous change in diff
+ mode.
+
+
+Easy Vim: click-and-type *new-evim*
+------------------------
+
+eVim stands for "Easy Vim". This is a separate program, but can also be
+started as "vim -y".
+
+This starts Vim with 'insertmode' set to allow click-and-type editing. The
+$VIMRUNTIME/evim.vim script is used to add mappings and set options to be able
+to do most things like Notepad. This is only for people who can't stand two
+modes.
+
+eView does the same but in readonly mode.
+
+In the GUI a CTRL-C now only interrupts when busy with something, not when
+waiting for a character. Allows using CTRL-C to copy text to the clipboard.
+
+
+User manual *new-user-manual*
+-----------
+
+The user manual has been added. It is organised around editing tasks. It
+reads like a book, from start to end. It should allow beginners to start
+learning Vim. It helps everybody to learn using the most useful Vim features.
+It is much easier to read than the reference manual, but omits details. See
+|user-manual|.
+
+The user manual includes parts of the Vim book by Steve Oualline |frombook|.
+It is published under the OPL |manual-copyright|.
+
+When syntax highlighting is not enabled, the characters in the help file which
+mark examples ('>' and '<') and header lines ('~') are replaced with a space.
+
+When closing the help window, the window layout is restored from before
+opening it, if the window layout didn't change since then.
+When opening the help window, put it at the top of the Vim window if the
+current window is fewer than 80 characters and not full width.
+
+
+Flexible indenting *new-indent-flex*
+------------------
+
+Automatic indenting is now possible for any language. It works with a Vim
+script, which makes it very flexible to compute the indent.
+
+The ":filetype indent on" command enables using the provided indent scripts.
+This is explained in the user manual: |30.3|.
+
+The 'indentexpr' option is evaluated to get the indent for a line. The
+'indentkeys' option tells when to trigger re-indenting. Normally these
+options are set from an indent script. Like Syntax files, indent scripts will
+be created and maintained by many people.
+
+
+Extended search patterns *new-searchpat*
+------------------------
+
+Added the possibility to match more than one line with a pattern. (partly by
+Loic Grenie)
+New items in a search pattern for multi-line matches:
+\n match end-of-line, also in []
+\_[] match characters in range and end-of-line
+\_x match character class and end-of-line
+\_. match any character or end-of-line
+\_^ match start-of-line, can be used anywhere in the regexp
+\_$ match end-of-line, can be used anywhere in the regexp
+
+Various other new items in search patterns:
+\c ignore case for the whole pattern
+\C match case for the whole pattern
+\m magic on for the following
+\M magic off for the following
+\v make following characters "very magic"
+\V make following characters "very nomagic"
+
+\@! don't match atom before this.
+ Example: "foo\(bar\)\@!" matches "foo " but not "foobar".
+\@= match atom, resulting in zero-width match
+ Example: "foo\(bar\)\@=" matches "foo" in "foobar".
+\@<! don't match preceding atom before the current position
+\@<= match preceding atom before the current position
+\@> match preceding atom as a subexpression
+
+\& match only when branch before and after it match
+
+\%[] optionally match a list of atoms; "end\%[if]" matches "end",
+ "endi" and "endif"
+\%(\) like \(\), but without creating a back-reference; there can be
+ any number of these, overcomes the limit of nine \( \) pairs
+\%^ match start-of-file (Chase Tingley)
+\%$ match end-of-file (Chase Tingley)
+\%# Match with the cursor position. (Chase Tingley)
+\? Just like "\=" but can't be used in a "?" command.
+
+\%23l match in line 23
+\%<23l match before line 23
+\%>23l match after line 23
+\%23c, \%<23c, \%>23c match in/before/after column 23
+\%23v, \%<23v, \%>23v match in/before/after virtual column 23
+
+
+For syntax items:
+\z(...\) external reference match set (in region start pattern)
+\z1 - \z9 external reference match use (in region skip or end pattern)
+ (Scott Bigham)
+
+\zs use position as start of match
+\ze use position as end of match
+
+Removed limit of matching only up to 32767 times with *, \+, etc.
+
+Added support to match multi-byte characters. (partly by Muraoka Taro)
+Made "\<" and "\>" work for UTF-8. (Muraoka Taro)
+
+
+UTF-8 support *new-utf-8*
+-------------
+
+Vim can now edit files in UTF-8 encoding. Up to 31 bit characters can be
+used, but only 16 bit characters are displayed. Up to two combining
+characters are supported, they overprint the preceding character.
+Double-wide characters are also supported. See |UTF-8|.
+
+UCS-2, UCS-4 and UTF-16 encodings are supported too, they are converted to
+UTF-8 internally. There is also support for editing Unicode files in a Latin1
+environment. Other encodings are converted with iconv() or an external
+converter specified with 'charconvert'.
+
+Many new items for Multi-byte support:
+- Added 'encoding' option: specifies character encoding used inside Vim. It
+ can be any 8-bit encoding, some double-byte encodings or Unicode.
+ It is initialized from the environment when a supported value is found.
+- Added 'fileencoding' and 'fileencodings': specify character coding in a
+ file, similar to 'fileformat' and 'fileformats'.
+ When 'encoding' is "utf-8" and 'fileencodings' is "utf-8,latin1" this will
+ automatically switch to latin1 if a file does not contain valid UTF-8.
+- Added 'bomb' option and detection of a BOM at the start of a file. Can be
+ used with "ucs-bom" in 'fileencodings' to automatically detect a Unicode
+ file if it starts with a BOM. Especially useful on MS-Windows (NT and
+ 2000), which uses ucs-2le files with a BOM (e.g., when exporting the
+ registry).
+- Added the 'termencoding' option: Specifies the encoding used for the
+ terminal. Useful to put Vim in utf-8 mode while in a non-Unicode locale: >
+ :let &termencoding = &encoding
+ :set encoding=utf-8
+- When 'viminfo' contains the 'c' flag, the viminfo file is converted from the
+ 'encoding' it was written with to the current 'encoding'.
+- Added ":scriptencoding" command: convert lines in a sourced script to
+ 'encoding'. Useful for menu files.
+- Added 'guifontwide' to specify a font for double-wide characters.
+- Added Korean support for character class detection. Also fix cls() in
+ search.c. (Chong-Dae Park)
+- Win32: Typing multi-byte characters without IME. (Alexander Smishlajev)
+- Win32 with Mingw: compile with iconv library. (Ron Aaron)
+- Win32 with MSVC: dynamically load iconv.dll library. (Muraoka Taro)
+- Make it possible to build a version with multi-byte and iconv support with
+ Borland 5.5. (Yasuhiro Matsumoto)
+- Added 'delcombine' option: Delete combining character separately. (Ron
+ Aaron)
+- The "xfontset" feature isn't required for "xim". These are now two
+ independent features.
+- XIM: enable XIM when typing a language character (Insert mode, Search
+ pattern, "f" or "r" command). Disable XIM when typing a Normal mode
+ command.
+- When the XIM is active, show "XIM" in the 'showmode' message. (Nam SungHyun)
+- Support "CursorIM" for XIM. (Nam SungHyun)
+- Added 'm' flag to 'formatoptions': When wrapping words, allow splitting at
+ each multibyte character, not only at a space.
+- Made ":syntax keyword" work with multi-byte characters.
+- Added support for Unicode upper/lowercase flipping and comparing. (based on
+ patch by Raphael Finkel)
+ Let "~" on multi-byte characters that have a third case ("title case")
+ switch between the three cases. (Raphael Finkel)
+
+Allow defining digraphs for multi-byte characters.
+Added RFC1345 digraphs for Unicode.
+Most Normal mode commands that accept a character argument, like "r", "t" and
+"f" now accept a digraph. The 'D' flag in 'cpoptions' disables this to remain
+Vi compatible.
+
+Added Language mapping and 'keymap' to be able to type multi-byte characters:
+- Added the ":lmap" command and friends: Define mappings that are used when
+ typing characters in the language of the text. Also for "r", "t", etc. In
+ Insert and Command-line mode CTRL-^ switches the use of the mappings on/off.
+ CTRL-^ also toggles the use of an input method when no language mappings are
+ present. Allows switching the IM back on halfway typing.
+- "<char-123>" argument to ":map", allows to specify the decimal, octal or
+ hexadecimal value of a character.
+- Implemented the 'keymap' option: Load a keymap file. Uses ":lnoremap" to
+ define mappings for the keymap. The new ":loadkeymap" command is used in
+ the keymap file.
+- Added 'k' flag in 'statusline': Value of "b:keymap_name" or 'keymap' when
+ it's being used. Uses "<lang>" when no keymap is loaded and ":lmap"s are
+ active. Show this text in the default statusline too.
+- Added the 'iminsert' and 'imsearch' options: Specify use of langmap mappings
+ and Input Method with an option. (Muraoka Taro)
+ Added 'imcmdline' option: When set the input method is always enabled when
+ starting to edit a command line. Useful for a XIM that uses dead keys to
+ type accented characters.
+ Added 'imactivatekey' option to better control XIM. (Muraoka Taro)
+- When typing a mapping that's not finished yet, display the last character
+ under the cursor in Insert mode and Command-line mode. Looks good for dead
+ characters.
+- Made the 'langmap' option recognize multi-byte characters. But mapping only
+ works for 8-bit characters. Helps when using UTF-8.
+- Use a different cursor for when ":lmap" mappings are active. Can specify
+ two highlight groups for an item in 'guicursor'. By default "lCursor" and
+ "Cursor" are equal, the user must set a color he likes.
+ Use the cursor color for hangul input as well. (Sung-Hyun Nam)
+- Show "(lang)" for 'showmode' when language mapping is enabled.
+- UTF-8: Made "r" work with a ":lmap" that includes a composing character.
+ Also works for "f", which now works to find a character that includes a
+ composing character.
+
+Other multi-byte character additions:
+- Support double-byte single-width characters for euc-jp: Characters starting
+ with 0x8E. Added ScreenLines2[] to store the second byte.
+
+
+Multi-language support *new-multi-lang*
+----------------------
+
+The messages used in Vim can be translated. Several translations are
+available. This uses the gettext mechanism. It allows adding a translation
+without recompiling Vim. |multi-lang| (partly by Marcin Dalecki)
+
+The translation files are in the src/po directory. The src/po/README.txt file
+explains a few things about doing a translation.
+
+Menu translations are available as well. This uses the new |:menutranslate|
+command. The translations are found in the runtime directory "lang". This
+allows a user to add a translation.
+
+Added |:language| command to set the language (locale) for messages, time and
+character type. This allows switching languages in Vim without changing the
+locale outside of Vim.
+
+Made it possible to have vimtutor use different languages. (Eduardo Fernandez)
+Spanish (Eduardo Fernandez), Italian (Antonio Colombo), Japanese (Yasuhiro
+Matsumoto) and French (Adrien Beau) translations are included.
+Added "vimtutor.bat": script to start Vim on a copy of the tutor file for
+MS-Windows. (Dan Sharp)
+
+- Added v:lang variable to be able to get current language setting.
+ (Marcin Dalecki) Also v:lc_time and v:ctype.
+- Make it possible to translate the dialogs used by the menus. Uses global
+ "menutrans_" variables. ":menutrans clear" deletes them.
+- removed "broken locale" (Marcin Dalecki).
+- Don't use color names in icons, use RGB values. The names could be
+ translated.
+- Win32: Added global IME support (Muraoka)
+- Win32: Added dynamic loading of IME support.
+- ":messages" prints a message about who maintains the messages or the
+ translations. Useful to find out where to make a remark about a wrong
+ translation.
+- --disable-nls argument for configure: Disable use of gettext(). (Sung-Hyun
+ Nam)
+- Added NLS support for Win32 with the MingW compiler. (Eduardo Fernandez)
+- When available, call bind_textdomain_codeset() to have gettext() translate
+ messages to 'encoding'. This requires GNU gettext 0.10.36 or later.
+- Added gettext support for Win32. This means messages will be translated
+ when the locale is set and libintl.dll can be found. (Muraoka Taro)
+ Also made it work with MingW compiler. (Eduardo Fernandez)
+ Detect the language and set $LANG to get the appropriate translated messages
+ (if supported). Also use $LANG to select a language, v:lang is a very
+ different kind of name.
+- Made gvimext.dll use translated messages, if possible. (Yasuhiro Matsumoto)
+
+
+Plugin support *new-plugins*
+--------------
+
+To make it really easy to load a Vim script when starting Vim, the "plugin"
+runtime directory can be used. All "*.vim" files in it will be automatically
+loaded. For Unix, the directory "~/.vim/plugin" is used by default. The
+'runtimepath' option can be set to look in other directories for plugins.
+|load-plugins| |add-plugin|
+
+The |:runtime| command has been added to load one or more files in
+'runtimepath'.
+
+Standard plugins:
+netrw.vim - Edit files over a network |new-network-files|
+gzip.vim - Edit compressed files
+explorer.vim - Browse directories |new-file-browser|
+
+Added support for local help files. |add-local-help|.
+When searching for help tags, all "doc/tags" files in 'runtimepath' are used.
+Added the ":helptags" command: Generate a tags file for a help directory.
+The first line of each help file is automagically added to the "LOCAL
+ADDITIONS" section in doc/help.txt.
+
+Added the <unique> argument to ":map": only add a mapping when it wasn't
+defined before.
+
+When displaying an option value with 'verbose' set will give a message about
+where the option was last set. Very useful to find out which script did set
+the value.
+
+The new |:scriptnames| command displays a list of all scripts that have been
+sourced.
+
+GUI: For Athena, Motif and GTK look for a toolbar bitmap in the "bitmaps"
+directories in 'runtimepath'. Allows adding your own bitmaps.
+
+
+Filetype plugins *new-filetype-plugins*
+-----------------
+
+A new group of files has been added to do settings for specific file types.
+These can be options and mappings which are specifically used for one value of
+'filetype'.
+
+The files are located in "$VIMRUNTIME/ftplugin". The 'runtimepath' option
+makes it possible to use several sets of plugins: Your own, system-wide,
+included in the Vim distribution, etc.
+
+To be able to make this work, several features were added:
+- Added the "s:" variables, local to a script. Avoids name conflicts with
+ global variables. They can be used in the script and in functions,
+ autocommands and user commands defined in the script. They are kept between
+ invocations of the same script. |s:var|
+- Added the global value for local options. This value is used when opening
+ a new buffer or editing another file. The option value specified in a
+ modeline or filetype setting is not carried over to another buffer.
+ ":set" sets both the local and the global value.
+ ":setlocal" sets the local option value only.
+ ":setglobal" sets or displays the global value for a local option.
+ ":setlocal name<" sets a local option to its global value.
+- Added the buffer-local value for some global options: 'equalprg', 'makeprg',
+ 'errorformat', 'grepprg', 'path', 'dictionary', 'thesaurus', 'tags',
+ 'include' and 'define'. This allows setting a local value for these global
+ options, without making it incompatible.
+- Added mappings and abbreviations local to a buffer: ":map <buffer>".
+- In a mapping "<Leader>" can be used to get the value of the "mapleader"
+ variable. This simplifies mappings that use "mapleader". "<Leader>"
+ defaults to "\". "<LocalLeader>" does the same with "maplocalleader". This
+ is to be used for mappings local to a buffer.
+- Added <SID> Script ID to define functions and mappings local to a script.
+- Added <script> argument to ":noremap" and ":noremenu": Only remap
+ script-local mappings. Avoids that mappings from other scripts get in the
+ way, but does allow using mappings defined in the script.
+- User commands can be local to a buffer: ":command -buffer".
+
+The new ":setfiletype" command is used in the filetype detection autocommands,
+to avoid that 'filetype' is set twice.
+
+
+File browser *new-file-browser*
+------------
+
+When editing a directory, the explorer plugin will list the files in the
+directory. Pressing <Enter> on a file name edits that file. Pressing <Enter>
+on a directory moves the browser to that directory.
+
+There are several other possibilities, such as opening a file in the preview
+window, renaming files and deleting files.
+
+See |file-explorer|.
+
+
+Editing files over a network *new-network-files*
+----------------------------
+
+Files starting with scp://, rcp://, ftp:// and http:// are recognized as
+remote files. An attempt is made to access these files with the indicated
+method. For http:// only reading is possible, for the others writing is also
+supported. Uses the netrw.vim script as a standard "plugin". |netrw|
+
+Made "gf" work on a URL. It no longer assumes the file is local on the
+computer (mostly didn't work anyway, because the full path was required).
+Adjusted test2 for this.
+
+Allow using a URL in 'path'. Makes ":find index.html" work.
+
+GTK: Allow dropping a http:// and ftp:// URL on Vim. The netrw plugin takes
+care of downloading the file. (MiKael Berthe)
+
+
+Window for command-line editing *new-cmdwin*
+-------------------------------
+
+The Command-line window can be used to edit a command-line with Normal and
+Insert mode commands. When it is opened it contains the history. This allows
+copying parts of previous command lines. |cmdwin|
+
+The command-line window can be opened from the command-line with the key
+specified by the 'cedit' option (like Nvi). It can also be opened directly
+from Normal mode with "q:", "q/" and "q?".
+
+The 'cmdwinheight' is used to specify the initial height of the window.
+
+In Insert mode CTRL-X CTRL-V can be used to complete an Ex command line, like
+it's done on the command-line. This is also useful for writing Vim scripts!
+
+Additionally, there is "improved Ex mode". Entered when Vim is started as
+"exim" or "vim -E", and with the "gQ" command. Works like repeated use of
+":", with full command-line editing and completion. (Ulf Carlsson)
+
+
+Debugging mode *new-debug-mode*
+--------------
+
+In debugging mode sourced scripts and user functions can be executed line by
+line. There are commands to step over a command or step into it. |debug-mode|
+
+Breakpoints can be set to run until a certain line in a script or user
+function is executed. |:breakadd|
+
+Debugging can be started with ":debug {cmd}" to debug what happens when a
+command executes. The |-D| argument can be used to debug while starting up.
+
+
+Cursor in virtual position *new-virtedit*
+--------------------------
+
+Added the 'virtualedit' option: Allow positioning the cursor where there is no
+actual character in Insert mode, Visual mode or always. (Matthias Kramm)
+This is especially useful in Visual-block mode. It allows positioning a
+corner of the area where there is no text character. (Many improvements by
+Chase Tingley)
+
+
+Debugger interface *new-debug-itf*
+------------------
+
+This was originally made to work with Sun Visual Workshop. (Gordon Prieur)
+See |debugger.txt|, |sign.txt| and |workshop.txt|.
+
+Added the ":sign" command to define and place signs. They can be displayed
+with two ASCII characters or an icon. The line after it can be highlighted.
+Useful to display breakpoints and the current PC position.
+
+Added the |:wsverb| command to execute debugger commands.
+
+Added balloon stuff: 'balloondelay' and 'ballooneval' options.
+
+Added "icon=" argument for ":menu". Allows defining a specific icon for a
+ToolBar item.
+
+
+Communication between Vims *new-vim-server*
+--------------------------
+
+Added communication between two Vims. Makes it possible to send commands from
+one Vim to another. Works for X-Windows and MS-Windows |clientserver|.
+
+Use "--remote" to have files be edited in an already running Vim.
+Use "--remote-wait" to do the same and wait for the editing to finish.
+Use "--remote-send" to send commands from one Vim to another.
+Use "--remote-expr" to have an expression evaluated in another Vim.
+Use "--serverlist" to list the currently available Vim servers. (X only)
+There are also functions to communicate between the server and the client.
+|remote_send()| |remote_expr()|
+
+(X-windows version implemented by Flemming Madsen, MS-Windows version by Paul
+Moore)
+
+Added the command server name to the window title, so you can see which server
+name belongs to which Vim.
+
+Removed the OleVim directory and SendToVim.exe and EditWithVim.exe from the
+distribution. Can now use "gvim --remote" and "gvim --remote-send", which is
+portable.
+
+GTK+: Support running Vim inside another window. Uses the --socketid argument
+(Neil Bird)
+
+
+Buffer type options *new-buftype*
+-------------------
+
+The 'buftype' and 'bufhidden' options have been added. They can be set to
+have different kinds of buffers. For example:
+- 'buftype' = "quickfix": buffer with error list
+- 'buftype' = "nofile" and 'bufhidden' = "delete": scratch buffer that will be
+ deleted as soon as there is no window displaying it.
+
+'bufhidden' can be used to overrule the 'hidden' option for one buffer.
+
+In combination with 'buflisted' and 'swapfile' this offers the possibility to
+use various kinds of special buffers. See |special-buffers|.
+
+
+Printing *new-printing*
+--------
+
+Included first implementation of the ":hardcopy" command for printing
+to paper. For MS-Windows any installed printer can be used. For other
+systems a PostScript file is generated, which can be printed with the
+'printexpr' option.
+(MS-Windows part by Vince Negri, Vipin Aravind, PostScript by Vince Negri and
+Mike Williams)
+
+Made ":hardcopy" work with multi-byte characters. (Muraoka Taro, Yasuhiro
+Matsumoto)
+
+Added options to tune the way printing works: (Vince Negri)
+- 'printoptions' defines various things.
+- 'printheader' specifies the header format. Added "N" field to 'statusline'
+ for the page number.
+- 'printfont' specifies the font name and attributes.
+- 'printdevice' defines the default printer for ":hardcopy!".
+
+
+Ports *ports-6*
+-----
+
+Port to OS/390 Unix (Ralf Schandl)
+- A lot of changes to handle EBCDIC encoding.
+- Changed Ctrl('x') to Ctrl_x define.
+
+Included jsbmouse support. (Darren Garth)
+Support for dec mouse in Unix. (Steve Wall)
+
+Port to 16-bit MS Windows (Windows 3.1x) (Vince Negri)
+
+Port to QNX. Supports the Photon GUI, mouse, etc. (Julian Kinraid)
+
+Allow cross-compiling the Win32 version with Make_ming.mak. (Ron Aaron)
+Added Python support for compiling with Mingw. (Ron Aaron)
+
+Dos 32 bit: Added support the Windows clipboard. (David Kotchan)
+
+Win32: Dynamically load Perl and Python. Allows compiling Vim with these
+interfaces and will try to find the DLLs at runtime. (Muraoka Taro)
+
+Compiling the Win32 GUI with Cygwin. Also compile vimrun, dosinst and
+uninstall. (Gerfried)
+
+Mac: Make Vim compile with the free MPW compiler supplied by Apple. And
+updates for CodeWarrior. (Axel Kielhorn)
+
+Added typecasts and ifdefs as a start to make Vim work on Win64 (George
+Reilly)
+
+
+Quickfix extended *quickfix-6*
+-----------------
+
+Added the "error window". It contains all the errors of the current error
+list. Pressing <Enter> in a line makes Vim jump to that line (in another
+window). This makes it easy to navigate through the error list.
+|quickfix-window|.
+
+- |:copen| opens the quickfix window.
+- |:cclose| closes the quickfix window.
+- |:cwindow| takes care that there is a quickfix window only when there are
+ recognized errors. (Dan Sharp)
+
+- Quickfix also knows "info", next to "warning" and "error" types. "%I" can be
+ used for the start of a multi-line informational message. (Tony Leneis)
+- The "%p" argument can be used in 'errorformat' to get the column number from
+ a line where "^" points to the column. (Stefan Roemer)
+- When using "%f" in 'errorformat' on a DOS/Windows system, also include "c:"
+ in the filename, even when using "%f:".
+
+
+Operator modifiers *new-operator-mod*
+------------------
+
+Insert "v", "V" or CTRL-V between an operator and a motion command to force
+the operator to work characterwise, linewise or blockwise. |o_v|
+
+
+Search Path *new-search-path*
+-----------
+
+Vim can search in a directory tree not only in downwards but also upwards.
+Works for the 'path', 'cdpath' and 'tags' options. (Ralf Schandl)
+
+Also use "**" for 'tags' option. (Ralf Schandl)
+
+Added 'includeexpr', can be used to modify file name found by 'include'
+option.
+Also use 'includeexpr' for "gf" and "<cfile>" when the file can't be found
+without modification. Useful for doing "gf" on the name after an include or
+import statement.
+
+Added the 'cdpath' option: Locations to find a ":cd" argument. (Raf)
+
+Added the 'suffixesadd' option: Suffixes to be added to a file name when
+searching for a file for the "gf", "[I", etc. commands.
+
+
+Writing files improved *new-file-writing*
+----------------------
+
+Added the 'backupcopy' option: Select whether a file is to be copied or
+renamed to make a backup file. Useful on Unix to speed up writing an ordinary
+file. Useful on other systems to preserve file attributes and when editing a
+file on a Unix filesystem.
+
+Added the 'autowriteall' option. Works like 'autowrite' but for more
+commands.
+
+Added the 'backupskip' option: A list of file patterns to skip making a backup
+file when it matches. The default for Unix includes "/tmp/*", this makes
+"crontab -e" work.
+
+Added support for Access Control Lists (ACL) for FreeBSD and Win32. The ACL
+is copied from the original file to the new file (or the backup if it's
+copied).
+ACL is also supported for AIX, Solaris and generic POSIX. (Tomas Ogren)
+And on SGI.
+
+
+Argument list *new-argument-list*
+-------------
+
+The support for the argument list has been extended. It can now be
+manipulated to contain the files you want it to contain.
+
+The argument list can now be local to a window. It is created with the
+|:arglocal| command. The |:argglobal| command can be used to go back to the
+global argument list.
+
+The |:argdo| command executes a command on all files in the argument list.
+
+File names can be added to the argument list with |:argadd|. File names can
+be removed with |:argdelete|.
+
+"##" can be used like "#", it is replaced by all the names in the argument
+list concatenated. Useful for ":grep foo ##".
+
+The |:argedit| adds a file to the argument list and edits it. Like ":argadd"
+and then ":edit".
+
+
+Restore a View *new-View*
+--------------
+
+The ":mkview" command writes a Vim script with the settings and mappings for
+one window. When the created file is sourced, the view of the window is
+restored. It's like ":mksession" for one window.
+The View also contains the local argument list and manually created, opened
+and closed folds.
+
+Added the ":loadview" command and the 'viewdir' option: Allows for saving and
+restoring views of a file with simple commands. ":mkview 1" saves view 1 for
+the current file, ":loadview 1" loads it again. Also allows quickly switching
+between two views on one file. And saving and restoring manual folds and the
+folding state.
+
+Added 'viewoptions' to specify how ":mkview" works.
+
+":mksession" now also works fine with vertical splits. It has been further
+improved and restores the view of each window. It also works properly with
+preview and quickfix windows.
+
+'sessionoptions' is used for ":mkview" as well.
+Added "curdir" and "sesdir" to 'sessionoptions'. Allows selection of what
+the current directory will be restored to.
+
+The session file now also contains the argument list(s).
+
+
+Color schemes *new-color-schemes*
+-------------
+
+Support for loading a color scheme. Added the ":colorscheme" command.
+Automatically add menu entries for available schemes.
+Should now properly reset the colors when 'background' or 't_Co' is changed.
+":highlight clear" sets the default colors again.
+":syntax reset" sets the syntax highlight colors back to the defaults.
+For ":set bg&" guess the value. This allows a color scheme to switch back to
+the default colors.
+When syntax highlighting is switched on and a color scheme was defined, reload
+the color scheme to define the colors.
+
+
+Various new items *new-items-6*
+-----------------
+
+Normal mode commands: ~
+
+"gi" Jump to the ^ mark and start Insert mode. Also works when the
+ mark is just after the line. |gi|
+
+"g'm" and "g`m"
+ Jump to a mark without changing the jumplist. Now you can use
+ g`" to jump to the last known position in a file without side
+ effects. Also useful in mappings.
+
+[', [`, ]' and ]`
+ move the cursor to the next/previous lowercase mark.
+
+g_ Go to last non-blank in line. (Steve Wall)
+
+
+Options: ~
+
+'autoread' When detected that a file changed outside of Vim,
+ automatically read a buffer again when it's not changed.
+ It has a global and a local value. Use ":setlocal autoread<"
+ to go back to using the global value for 'autoread'.
+
+'debug' When set to "msg" it will print error messages that would
+ otherwise be omitted. Useful for debugging 'indentexpr' and
+ 'foldexpr'.
+
+'lispwords' List of words used for lisp indenting. It was previously hard
+ coded. Added a number of Lisp names to the default.
+
+'fold...' Many new options for folding.
+
+'modifiable' When off, it is impossible to make changes to a buffer.
+ The %m and %M items in 'statusline' show a '-'.
+
+'previewwindow' Set in the preview window. Used in a session file to mark a
+ window as the preview window.
+
+'printfont'
+'printexpr'
+'printheader'
+'printdevice'
+'printoptions' for ":hardcopy".
+
+'buflisted' Makes a buffer appear in the buffer list or not.
+
+Use "vim{version}:" for modelines, only to be executed when the version is
+>= {version}. Also "vim>{version}", "vim<{version}" and "vim={version}".
+
+
+Ex commands: ~
+
+:sav[eas][!] {file}
+ Works like ":w file" and ":e #", but without loading the file
+ again and avoiding other side effects. |:saveas|
+
+:silent[!] {cmd}
+ Execute a command silently. Also don't use a delay that would
+ come after the message. And don't do 'showmatch'.
+ RISCOS: Removed that "!~cmd" didn't output anything, and
+ didn't wait for <Enter> afterwards. Can use ":silent !cmd"
+ now.
+:menu <silent> Add a menu that won't echo Ex commands.
+:map <silent> Add a mapping that won't echo Ex commands.
+
+:checktime Check for changed buffers.
+
+:verbose {cmd} Set 'verbose' for one command.
+
+:echomsg {expr}
+:echoerr {expr} Like ":echo" but store the message in the history. (Mark
+ Waggoner)
+
+:grepadd Works just like ":grep" but adds to the current error list
+ instead of defining a new list. |:grepadd|
+
+:finish Finish sourcing a file. Can be used to skip the rest of a Vim
+ script. |:finish|
+
+:leftabove
+:aboveleft Split left/above current window.
+
+:rightbelow
+:belowright Split right/below current window.
+
+:first, :bfirst, :ptfirst, etc.
+ Alias for ":rewind". It's more logical compared to ":last".
+
+:enew Edit a new, unnamed buffer. This is needed, because ":edit"
+ re-edits the same file. (Wall)
+
+:quitall Same as ":qall".
+
+:match Define match highlighting local to a window. Allows
+ highlighting an item in the current window without interfering
+ with syntax highlighting.
+
+:menu enable
+:menu disable Commands to enable/disable menu entries without removing them.
+ (Monish Shah)
+
+:windo Execute a command in all windows.
+:bufdo Execute a command in all buffers.
+
+:wincmd Window (CTRL-W) command. Useful when a Normal mode command
+ can't be used (e.g., for a CursorHold autocommand). See
+ |CursorHold-example| for a nice application with it.
+
+:lcd and :lchdir
+ Set local directory for a window. (Benjie Chen)
+
+:hide {command}
+ Execute {command} with 'hidden' set.
+
+:emenu in Visual mode to execute a ":vmenu" entry.
+
+:popup Pop up a popup menu.
+
+:redraw Redraw the screen even when busy with a script or function.
+
+:hardcopy Print to paper.
+
+:compiler Load a Vim script to do settings for a specific compiler.
+
+:z# List numbered lines. (Bohdan Vlasyuk)
+
+
+New marks: ~
+
+'( and ') Begin or end of current sentence. Useful in Ex commands.
+'{ and '} Begin or end of current paragraph. Useful in Ex commands.
+'. Position of the last change in the current buffer.
+'^ Position where Insert mode was stopped.
+
+Store the ^ and . marks in the viminfo file. Makes it possible to jump to the
+last insert position or changed text.
+
+
+New functions: ~
+argidx() Current index in argument list.
+buflisted() Checks if the buffer exists and has 'buflisted' set.
+cindent() Get indent according to 'cindent'.
+eventhandler() Returns 1 when inside an event handler and interactive
+ commands can't be used.
+executable() Checks if a program or batch script can be executed.
+filewritable() Checks if a file can be written. (Ron Aaron)
+foldclosed() Find out if there is a closed fold. (Johannes Zellner).
+foldcloseend() Find the end of a closed fold.
+foldlevel() Find out the foldlevel. (Johannes Zellner)
+foreground() Move the GUI window to the foreground.
+getchar() Get one character from the user. Can be used to define a
+ mapping that takes an argument.
+getcharmod() Get last used key modifier.
+getbufvar() gets the value of an option or local variable in a buffer (Ron
+ Aaron)
+getfsize() Return the size of a file.
+getwinvar() gets the value of an option or local variable in a window (Ron
+ Aaron)
+globpath() Find matching files in a list of directories.
+hasmapto() Detect if a mapping to a string is already present.
+iconv() Convert a string from one encoding to another.
+indent() gets the indent of a line (Ron Aaron)
+inputdialog() Like input() but use a GUI dialog when possible. Currently
+ only works for Win32, Motif, Athena and GTK.
+ Use inputdialog() for the Edit/Settings/Text Width menu. Also
+ for the Help/Find.. and Toolbar FindHelp items.
+ (Win32 support by Thore B. Karlsen)
+ (Win16 support by Vince Negri)
+inputsecret() Ask the user to type a string without showing the typed keys.
+ (Charles Campbell)
+libcall() for Unix (Neil Bird, Johannes Zellner, Stephen Wall)
+libcallnr() for Win32 and Unix
+lispindent() Get indent according to 'lisp'.
+mode() Return a string that indicates the current mode.
+nextnonblank() Skip blank lines forwards.
+prevnonblank() Skip blank lines backwards. Useful to for indent scripts.
+resolve() MS-Windows: resolve a shortcut to the file it points to.
+ Unix: resolve a symbolic link.
+search() Search for a pattern.
+searchpair() Search for matching pair. Can be used in indent files to find
+ the "if" matching an endif.
+setbufvar() sets an option or variable local to a buffer (Ron Aaron)
+setwinvar() sets an option or variable local to a window (Ron Aaron)
+stridx() Search for first occurrence of one string in another.
+strridx() Search for last occurrence of one string in another.
+tolower() Convert string to all-lowercase.
+toupper() Convert string to all-uppercase.
+type() Check the type of an expression.
+wincol() window column of the cursor
+winwidth() Width of a window. (Johannes Zellner)
+winline() window line of the cursor
+
+
+Added expansion of curly braces in variable and function names. This can be
+used for variable names that include the value of an option. Or a primitive
+form of arrays. (Vince Negri)
+
+
+New autocommand events: ~
+BufWinEnter Triggered when a buffer is displayed in a window, after using
+ the modelines. Can be used to load a view.
+BufWinLeave Triggered when a buffer is no longer in a window. Also
+ triggered when exiting Vim. Can be used to save views.
+FileChangedRO Triggered before making the first change to a read-only file.
+ Can be used to check-out the file. (Scott Graham)
+TermResponse Triggered when the terminal replies to the version-request.
+ The v:termresponse internal variable holds the result. Can be
+ used to react to the version of the terminal. (Ronald Schild)
+FileReadCmd Triggered before reading a file.
+BufReadCmd Triggered before reading a file into a buffer.
+FileWriteCmd Triggered before writing a file.
+BufWriteCmd Triggered before writing a buffer into a file.
+FileAppendCmd Triggered before appending to a file.
+FuncUndefined Triggered when a user function is not defined. (Ron Aaron)
+
+The autocommands for the *Cmd events read or write the file instead of normal
+file read/write. Use this in netrw.vim to be able to edit files on a remote
+system. (Charles Campbell)
+
+
+New Syntax files: ~
+
+bdf BDF font definition (Nikolai Weibull)
+catalog SGML catalog (Johannes Zellner)
+debchangelog Debian Changelog (Wichert Akkerman)
+debcontrol Debian Control (Wichert Akkerman)
+dot dot (Markus Mottl)
+dsl DSSSL syntax (Johannes Zellner)
+eterm Eterm configuration (Nikolai Weibull)
+indent Indent profile (Nikolai Weibull)
+lftp LFTP (Nikolai Weibull)
+lynx Lynx config (Doug Kearns)
+mush mush sourcecode (Bek Oberin)
+natural Natural (Marko Leipert)
+pilrc Pal resource compiler (Brian Schau)
+plm PL/M (Philippe Coulonges)
+povini Povray configuration (David Necas)
+ratpoison Ratpoison config/command (Doug Kearns)
+readline readline config (Nikolai Weibull)
+screen Screen RC (Nikolai Weibull)
+specman Specman (Or Freund)
+sqlforms SQL*Forms (Austin Ziegler)
+terminfo terminfo (Nikolai Weibull)
+tidy Tidy configuration (Doug Kearns)
+wget Wget configuration (Doug Kearns)
+
+
+Updated many syntax files to work both with Vim 5.7 and 6.0.
+
+Interface to Ruby. (Shugo Maeda)
+Support dynamic loading of the Ruby interface on MS-Windows. (Muraoka Taro)
+Support this for Mingw too. (Benoit Cerrina)
+
+Win32: Added possibility to load TCL dynamically. (Muraoka Taro)
+Also for Borland 5.5. (Dan Sharp)
+
+Win32: When editing a file that is a shortcut (*.lnk file), edit the file it
+links to. Unless 'binary' is set, then edit the shortcut file itself.
+(Yasuhiro Matsumoto)
+
+The ":command" command now accepts a "-bar" argument. This allows the user
+command to be followed by "| command".
+
+The preview window is now also used by these commands:
+- |:pedit| edits the specified file in the preview window
+- |:psearch| searches for a word in included files, like |:ijump|, and
+ displays the found text in the preview window.
+Added the CTRL-W P command: go to preview window.
+
+MS-DOS and MS-Windows also read the system-wide vimrc file $VIM/vimrc. Mostly
+for NT systems with multiple users.
+
+A double-click of the mouse on a character that has a "%" match selects from
+that character to the match. Similar to "v%".
+
+"-S session.vim" argument: Source a script file when starting up. Convenient
+way to start Vim with a session file.
+
+Added "--cmd {command}" Vim argument to execute a command before a vimrc file
+is loaded. (Vince Negri)
+
+Added the "-M" Vim argument: reset 'modifiable' and 'write', thus disallow
+making changes and writing files.
+
+Added runtime/delmenu.vim. Source this to remove all menus and prepare for
+loading new menus. Useful when changing 'langmenu'.
+
+Perl script to filter Perl error messages to quickfix usable format. (Joerg
+Ziefle)
+
+Added runtime/macros/less.vim: Vim script to simulate less, but with syntax
+highlighting.
+
+MS-Windows install program: (Jon Merz)
+- The Win32 program can now create shortcuts on the desktop and install Vim in
+ the Start menu.
+- Possibly remove old "Edit with Vim" entries.
+- The Vim executable is never moved or $PATH changed. A small batch file is
+ created in a directory in $PATH. Fewer choices to be made.
+- Detect already installed Vim versions and offer to uninstall them first.
+
+Improved the MS-Windows uninstal program. It now also deletes the entries in
+the Start menu, icons from the desktop and the created batch files. (Jon Merz)
+Also made it possible to delete only some of these. Also unregister gvim for
+OLE.
+
+Generate a self-installing Vim package for MS-Windows. This uses NSIS. (Jon
+Merz et al.)
+
+Added ":filetype detect". Try detecting the filetype again. Helps when
+writing a new shell script, after adding "#!/bin/csh".
+
+Added ":augroup! name" to delete an autocommand group. Needed for the
+client-server "--remote-wait".
+
+Add the Vim version number to the viminfo file, useful for debugging.
+
+==============================================================================
+IMPROVEMENTS *improvements-6*
+
+Added the 'n' flag in 'cpoptions': When omitted text of wrapped lines is not
+put between line numbers from 'number' option. Makes it a lot easier to read
+wrapped lines.
+
+When there is a format error in a tags file, the byte position is reported so
+that the error can be located.
+
+"gf" works in Visual mode: Use the selected text as the file name. (Chase
+Tingley)
+
+Allow ambiguous mappings. Thus "aa" and "aaa" can both be mapped, the longest
+matching one is used. Especially useful for ":lmap" and 'keymap'.
+
+Encryption: Ask the key to be typed twice when crypting the first time.
+Otherwise a typo might cause the text to be lost forever. (Chase Tingley)
+
+The window title now has "VIM" on the end. The file name comes first, useful
+in the taskbar. A "+" is added when the file is modified. "=" is added for
+a read-only file. "-" is added for a file with 'modifiable' off.
+
+In Visual mode, mention the size of the selected area in the 'showcmd'
+position.
+
+Added the "b:changedtick" variable. Incremented at each change, also for
+undo. Can be used to take action only if the buffer has been changed.
+
+In the replacement string of a ":s" command "\=" can be used to replace with
+the result of an expression. From this expression the submatch() function can
+be used to access submatches.
+
+When doing ":qall" and there is a change in a buffer that is being edited in
+another window, jump to that window, instead of editing that buffer in the
+current window.
+
+Added the "++enc=" and "++ff=" arguments to file read/write commands to force
+using the given 'encoding' or 'fileformat'. And added the "v:cmdarg"
+variable, to be used for FileReadCmd autocommands that read/write the file
+themselves.
+
+When reading stdin, first read the text in binary mode and then re-read it
+with automatic selection of 'fileformat' and 'fileencoding'. This avoids
+problems with not being able to rewind the file (e.g., when a line near the
+end of the file ends in LF instead of CR-LF).
+When reading text from stdin and the buffer is empty, don't mark it changed.
+Allows exiting without trouble.
+
+Added an ID to many error messages. This will make it easier to find help for
+a message.
+
+Insert mode:
+- "CTRL-G j" and "CTRL-G k" can be used to insert in another line in the same
+ column. Useful for editing a table.
+- Added Thesaurus completion with CTRL-X CTRL-T. (Vince Negri)
+- Added the 'thesaurus' option, to use instead of 'dictionary' for thesaurus
+ completion. Added the 's' flag in 'complete'.
+- Made CTRL-X CTRL-L in Insert mode use the 'complete' option. It now also
+ scans other loaded buffers for matching lines.
+- CTRL-R now also works in Insert mode while doing completion with CTRL-X or
+ CTRL-N. (Neil Bird)
+- When doing Insert mode completion, when completion is finished check for a
+ match with words from 'cinkeys' or 'indentkeys'.
+
+Performance:
+- Made display updating more efficient. Insert/delete lines may be used for
+ all changes, also for undo/redo.
+- The display is not redrawn when there is typeahead in Insert mode. Speeds
+ up CTRL-R a lot.
+- Improved speed of screen output for 32 bit DOS version. (Vince Negri)
+- When dragging with the mouse, there is a lookahead to skip mouse codes when
+ there is another one next. Makes dragging with the mouse a lot faster.
+- Also a memory usage improvement: When calling u_save with a single line,
+ don't save it if the line was recently saved for the same undo already.
+- When using a script that appends one character at a time, the amount of
+ allocated memory was growing steadily. Also when 'undolevels' is -1.
+ Caused by the line saved for "U" never to be freed. Now free an undo block
+ when it becomes empty.
+- GUI and Dos32: Use a vertical scroll region, to make scrolling in a
+ vertically split window faster. No need to redraw the whole window.
+- When scrolling isn't possible with terminal codes (e.g., for a vertically
+ split window) redraw from ScreenLines[]. That should be faster than going
+ through the lines with win_line(), especially when using syntax
+ highlighting.
+- The Syntax menu is now pre-generated by a separate script. Makes loading
+ the menu 70% faster. This can halve the startup time of gvim.
+- When doing ":help tag", don't open help.txt first, jump directly to the help
+ tag. It's faster and avoids an extra message.
+- Win32: When a file name doesn't end in ".lnk" don't try resolving a
+ shortcut, it takes quite a bit of time.
+- Don't update the mouse pointer shape while there are typeahead characters.
+- Change META[] from a string into an array, avoids using strchr() on it.
+- Don't clear the command line when adding characters, avoids that screen_fill
+ is called but doesn't do anything.
+
+Robustness:
+- Unix: Check for running out of stack space when executing a regexp. Avoids
+ a nasty crash. Only works when the system supports running the signal
+ function on another stack.
+- Disallow ":source <dirname>". On unix it's possible to read a directory,
+ does not make sense to use it as Vim commands.
+
+Security:
+- When reading from or writing to a temporary file, check that it isn't a
+ symbolic link. Gives some protection against symlink attacks.
+- When creating a backup file copy or a swap file, check for it already
+ existing to avoid a symlink attack. (Colin Phipps)
+- Evaluating options which are an expression is done in a |sandbox|. If the
+ option was set by a modeline, it cannot cause damage.
+- Use a secure way to generate temp file names: Create a private directory for
+ temp files. Used for Unix, MS-DOS and OS/2.
+- 'makeef' can be empty, which means that an internally generated file name is
+ used. The old default was "/tmp/file", which is a security risk.
+ Writing 'makeef' in the current directory fails in a read-only directory and
+ causes trouble when using ":grep" on all files. Made the default empty for
+ all systems, so that a temp file is used.
+- The command from a tags file is executed in the sandbox for better security.
+- The Ruby, Tcl and Python interfaces cannot be used from the sandbox. They
+ might do dangerous things. Perl is still possible, but limited to the Safe
+ environment. (Donnie Smith)
+
+Syntax highlighting:
+- Optimized the speed by caching the state stack all over the file, not just
+ the part being displayed. Required for folding.
+- Added ":syntax sync fromstart": Always parse from the start of the file.
+- Added the "display" argument for syntax items: use the item only when
+ displaying the result. Can make parsing faster for text that isn't going to
+ be displayed.
+- When using CTRL-L, the cached states are deleted, to force parsing the text
+ again.
+- Use elfhash algorithm for table of keywords. This should give a better
+ distribution and speedup keyword lookup. (Campbell)
+- Also allow the "lc" leading context for skip and end patterns. (Scott
+ Bigham)
+- Syntax items can have the "extend" argument to undo the effect of a
+ "keepend" argument of an item it is contained in. Makes it possible to have
+ some contained items extend a region while others don't.
+- ":syntax clear" now deletes the b:current_syntax variable. That's logical,
+ since no syntax is defined after this command.
+- Added ":syntax enable": switch on syntax highlighting without changing the
+ colors. This allows specifying the colors in the .vimrc file without the
+ need for a mysyntaxfile.
+- Added ":syntax reset": reset the colors to their defaults.
+- Added the "contains=TOP" and "contains=CONTAINED" arguments. Makes it
+ possible to define a transparent item that doesn't contain itself.
+- Added a "containedin" argument to syntax items. Allows adding a contained
+ item to an existing item (e.g., to highlight a name in a comment).
+
+Modeless selection:
+- When in the command-line window, use modeless selection in the other
+ windows. Makes it possible to copy visible text to the command-line window.
+- Support modeless selection on the cmdline in a terminal. Previously it was
+ only possible for the GUI.
+- Make double-right-click in modeless selection select a whole word. Single
+ right click doesn't use the word selection started by a double-left-click.
+ Makes it work like in Visual mode.
+- The modeless selection no longer has an implied automatic copy to the
+ clipboard. It now obeys the 'a' and 'A' flags in 'guioptions' or
+ "autoselect" and "autoselectml" in 'clipboard'.
+- Added the CTRL-Y command in Cmdline-mode to copy the modeless selection to
+ the clipboard. Also works at the hit-enter prompt and the more prompt.
+ Removed the mappings in runtime/mswin.vim for CTRL-Y and CTRL-Z in
+ cmdline-mode to be able to use CTRL-Y in the new way.
+
+Reduced the amount of stack space used by regmatch() to allow it to handle
+complicated patterns on a longer text.
+
+'isfname' now includes '%' and '#'. Makes "vim dir\#file" work for MS-DOS.
+
+Added keypad special keys <kEnter>, <k0> - <k9>. When not mapped they behave
+like the ASCII equivalent. (Ivan Wellesz and Vince Negri)
+Recognize a few more xterm keys: <C-Right>, <C-Left>, <C-End>, <C-Home>
+
+Also trigger the BufUnload event when Vim is going to exit. Perhaps a script
+needs to do some cleaning up.
+
+Expand expression in backticks: `={expr}`. Can be used where backtick
+expansion is done. (Vince Negri)
+
+GUI:
+- Added 'L' and 'R' flags in 'guioptions': Add a left or right scrollbar only
+ when there is a vertically split window.
+- X11: When a color can't be allocated, use the nearest match from the
+ colormap. This avoids that black is used for many things. (Monish Shah)
+ Also do this for the menu and scrollbar, to avoid that they become black.
+- Win32 and X11: Added 'mouseshape' option: Adjust the mouse pointer shape to
+ the current mode. (Vince Negri)
+- Added the 'linespace' option: Insert a pixel line between lines. (Nam)
+- Allow modeless selection (without moving the cursor) by keeping CTRL and
+ SHIFT pressed. (Ivan Wellesz)
+- Motif: added toolbar. (Gordon Prieur) Also added tooltips.
+- Athena: added toolbar and tooltips. (David Harrison -- based on Gordon
+ Prieur's work)
+- Made the 'toolbar' option work for Athena and Motif. Can now switch between
+ text and icons on the fly. (David Harrison)
+- Support menu separator lines for Athena. (David Harrison)
+- Athena: Adjust the arrow pixmap used in a pullright menu to the size of the
+ font. (David Harrison)
+- Win32: Added "c" flag to 'guifont' to be able to specify the charset. (Artem
+ Khodush)
+- When no --enable-xim argument is given, automatically enable it when a X GUI
+ is used. Required for dead key support (and multi-byte input).
+- After a file selection dialog, check that the edited files were not changed
+ or deleted. The Win32 dialog allows deleting and renaming files.
+- Motif and Athena: Added support for "editres". (Martin Dalecki)
+- Motif and Athena: Added "menuFont" to be able to specify a font or fontset
+ for the menus. Can also be set with the "Menu" highlight group. Useful
+ when the locale is different from 'encoding'. (David Harrison)
+ When FONTSET_ALWAYS is defined, always use a fontset for the menus. Should
+ avoid trouble with changing from a font to a fontset. (David Harrison)
+- Highlighting and font for the tooltips can be specified with the "Tooltip"
+ highlight group. (David Harrison)
+- The Cmdline-mode menus can be used at the more-prompt. This mostly works
+ fine, because they start with a CTRL-C. The "Copy" menu works to copy the
+ modeless selection. Allows copying the output of ":set all" or ":intro"
+ without auto-selection.
+- When starting the GUI when there is no terminal connected to stdout and
+ stderr, display error messages in a dialog. Previously they wouldn't be
+ displayed at all.
+- Allow setting 'browsedir' to the name of a directory, to be used for the
+ file dialog. (Dan Sharp)
+- b:browsefilter and g:browsefilter can be set to the filters used for the
+ file dialog. Supported for Win32 and Motif GUI. (Dan Sharp)
+
+X11:
+- Support for the clipboard selection as register "+. When exiting or
+ suspending copy the selection to cut buffer 0. Should allow copy/paste with
+ more applications in a X11-standard way. (Neil Bird)
+- Use the X clipboard in any terminal, not just in an xterm.
+ Added "exclude:" in 'clipboard': Specify a pattern to match against terminal
+ names for which no connection should be made to the X server. The default
+ currently work for FreeBSD and Linux consoles.
+- Added a few messages for when 'verbose' is non-zero to show what happens
+ when trying to connect to the X server. Should help when trying to find out
+ why startup is slow.
+
+GTK GUI: (partly by Marcin Dalecki)
+- With some fonts the characters can be taller than ascent + descent. E.g.,
+ "-misc-fixed-*-*-*-*-18-*-*-*-*-*-iso10646-1". Add one to the character
+ cell height.
+- Implement "no" value for 'winaltkeys': don't use Alt-Key as a menu shortcut,
+ when 'wak' changed after creating the menus.
+- Setting 'wak' after the GUI started works.
+- recycle text GC's to reduce communication.
+- Adjust icon size to window manager.
+- Cleanup in font handling.
+- Replace XQueryColor with GDK calls.
+- Gnome support. Detects Gnome in configure and uses different widgets.
+ Otherwise it's much like GTK. (Andy Kahn)
+ It is disabled by default, because it causes a few problems.
+- Removed the special code to fork first and then start the GUI. Now use
+ _exit() instead of exit(), this works fine without special tricks.
+- Dialogs sometimes appeared a bit far away. Position the dialogs inside
+ the gvim window. (Brent Verner)
+- When dropping a file on Vim, remove extra slashes from the start of the
+ path. Also shorten the file name if possible.
+
+Motif: (Martin Dalecki)
+- Made the dialog layout better.
+- Added find and find/replace dialogs.
+- For the menus, change "iso-8859" to "iso_8859", Linux appears to need this.
+- Added icon to dialogs, like for GTK.
+- Use XPM bitmaps for the icon when possible. Use the Solaris XpmP.h include
+ file when it's available.
+- Change the shadow of the toolbar items to get a visual feedback of it being
+ pressed on non-LessTiff.
+- Use gadgets instead of windows for some items for speed.
+
+Command line completion:
+- Complete environment variable names. (Mike Steed)
+- For ":command", added a few completion methods: "mapping", "function",
+ "expression" and "environment".
+- When a function doesn't take arguments, let completion add () instead of (.
+
+For MS-DOS, MS-Windows and OS/2: Expand %VAR% environment variables like $VAR.
+(Walter Briscoe)
+
+Redirect messages to the clipboard ":redir @*" and to the unnamed register
+":redir @"". (Wall)
+
+":let @/ = ''" clears the search pattern, instead of setting it to an empty
+string.
+
+Expression evaluation:
+- "? :" can be used like in C.
+- col("$") returns the length of the cursor line plus one. (Stephen P. Wall)
+- Optional extra argument for match(), matchend() and matchstr(): Offset to
+ start looking for a match.
+- Made third argument to strpart() optional. (Paul Moore, Zdenek Sekera)
+- exists() can also be used to check for Ex commands and defined autocommands.
+- Added extra argument to input(): Default text.
+- Also set "v:errmsg" when using ":silent! cmd".
+- Added the v:prevcount variable: v:count for the previous command.
+- Added "v:progname", name with which Vim was started. (Vince Negri)
+- In the verbose message about returning from a function, also show the return
+ value.
+
+Cscope:
+- Added the cscope_connection() function. (Andy Kahn)
+- ":cscope kill -1" kills all cscope connections. (Andy Kahn)
+- Added the 'cscopepathcomp' option. (Scott Hauck)
+- Added ":scscope" command, split window and execute Cscope command. (Jason
+ Duell)
+
+VMS:
+- Command line arguments are always uppercase. Interpret a "-X" argument as
+ "-x" and "-/X" as "-X".
+- Set 'makeprg' and 'grepprg' to meaningful defaults. (Zoltan Arpadffy)
+- Use the X-clipboard feature and the X command server. (Zoltan Arpadffy)
+
+Macintosh: (Dany St-Amant)
+- Allow a tags file to have CR, CR-LF or LF line separator. (Axel Kielhorn)
+- Carbonized (while keeping non Carbon code)
+ (Some work "stolen" from Ammon Skidmore)
+- Improved the menu item index handling (should be faster)
+- Runtime commands now handle / in file name (MacOS 9 version)
+- Added ":winpos" support.
+- Support using "~" in file names for home directory.
+
+Options:
+- When using set += or ^= , check for items used twice. Duplicates are
+ removed. (Vince Negri)
+- When setting an option that is a list of flags, remove duplicate flags.
+- If possible, use getrlimit() to set 'maxmemtot' and 'maxmem'. (Pina)
+- Added "alpha" to 'nrformats': increment or decrement an alphabetic character
+ with CTRL-A and CTRL-X.
+- ":set opt&vi" sets an option to its Vi default, ":set opt&vim" to its Vim
+ default. Useful to set 'cpo' to its Vim default without knowing what flags
+ that includes.
+- 'scrolloff' now also applies to a long, wrapped line that doesn't fit in the
+ window.
+- Added more option settings to the default menus.
+- Updated the option window with new options. Made it a bit easier to read.
+
+Internal changes:
+- Split line pointers in text part and attributes part. Allows for future
+ change to make attribute more than one byte.
+- Provide a qsort() function for systems that don't have it.
+- Changed the big switch for Normal mode commands into a table. This cleans
+ up the code considerably and avoids trouble for some optimizing compilers.
+- Assigned a negative value to special keys, to avoid them being mixed up with
+ Unicode characters.
+- Global variables expand_context and expand_pattern were not supposed to be
+ global. Pass them to ExpandOne() and all functions called by it.
+- No longer use the global reg_ic flag. It caused trouble and in a few places
+ it was not set.
+- Removed the use of the stuff buffer for "*", "K", CTRL-], etc. Avoids
+ problem with autocommands.
+- Moved some code from ex_docmd.c to ex_cmds2.c. The file was getting too
+ big. Also moved some code from screen.c to move.c.
+- Don't include the CRC table for encryption, generate it. Saves quite a bit
+ of space in the source code. (Matthias Kramm)
+- Renamed multibyte.c to mbyte.c to avoid a problem with 8.3 filesystems.
+- Removed the GTK implementation of ":findhelp", it now uses the
+ ToolBar.FindHelp menu entry.
+- Renamed mch_windexit() to mch_exit(), mch_init() to mch_early_init() and
+ mch_shellinit() to mch_init().
+
+Highlighting:
+- In a ":highlight" listing, show "xxx" with the highlight color.
+- Added support for xterm with 88 or 256 colors. The right color numbers will
+ be used for the name used in a ":highlight" command. (Steve Wall)
+- Added "default" argument for ":highlight". When included, the command is
+ ignored if highlighting for the group was already defined.
+ All syntax files now use ":hi default ..." to allow the user to specify
+ colors in his vimrc file. Also, the "if did_xxx_syntax_inits" is not needed
+ anymore. This greatly simplifies using non-default colors for a specific
+ language.
+- Adjusted colortest.vim: Included colors on normal background and reduced the
+ size by using a while loop. (Rafael Garcia-Suarez)
+- Added the "DarkYellow" color name. Just to make the list of standard colors
+ consistent, it's not really a nice color to use.
+
+When an xterm is in 8-bit mode this is detected by the code returned for
+|t_RV|. All key codes are automatically converted to their 8-bit versions.
+
+The OPT_TCAP_QUERY in xterm patch level 141 and later is used to obtain the
+actual key codes used and the number of colors for t_Co. Only when |t_RV| is
+also used.
+
+":browse set" now also works in the console mode. ":browse edit" will give an
+error message.
+
+":bdelete" and ":bunload" only report the number of deleted/unloaded buffers
+when more than 'report'. The message was annoying when deleting a buffer in a
+script.
+
+Jump list:
+- The number of marks kept in the jumplist has been increased from 50 to 100.
+- The jumplist is now stored in the viminfo file. CTRL-O can be used to jump
+ to positions from a previous edit session.
+- When doing ":split" copy the jumplist to the new window.
+
+Also set the '[ and '] marks for the "~" and "r" commands. These marks are
+now always set when making a change with a Normal mode command.
+
+Python interface: Allow setting the width of a vertically split window. (John
+Cook)
+
+Added "=word" and "=~word" to 'cinkeys' (also used in 'indentkeys').
+
+Added "j1" argument in 'cinoptions': indent {} inside () for Java. (Johannes
+Zellner)
+Added the "l" flag in 'cinoptions'. (Anduin Withers)
+Added 'C', 'U', 'w' and 'm' flags to 'cinoptions'. (Servatius Brandt)
+
+When doing ":wall" or ":wqall" and a modified buffer doesn't have a name,
+mention its buffer number in the error message.
+
+":function Name" lists the function with line numbers. Makes it easier to
+find out where an error happened.
+
+In non-blockwise Visual mode, "r" replaces all selected characters with the
+typed one, like in blockwise Visual mode.
+
+When editing the last file in the argument list in any way, allow exiting.
+Previously this was only possible when getting to that file with ":next" or
+":last".
+
+Added the '1' flag to 'formatoptions'. (Vit Stradal)
+Added 'n' flag in 'formatoptions': format a numbered list.
+
+Swap file:
+- When a swap file already exists, and the user selects "Delete" at the
+ ATTENTION prompt, use the same ".swp" swapfile, to avoid creating a ".swo"
+ file which won't always be found.
+- When giving the ATTENTION message and the date of the file is newer than the
+ date of swap file, give a warning about this.
+- Made the info for an existing swap file a bit shorter, so that it still fits
+ on a 24 line screen.
+- It was possible to make a symlink with the name of a swap file, linking to a
+ file that doesn't exist. Vim would then silently use another file (if open
+ with O_EXCL refuses a symlink). Now check for a symlink to exist. Also do
+ another check for an existing swap file just before creating it to catch a
+ symlink attack.
+
+The g CTRL-G command also works in Visual mode and counts the number of words.
+(Chase Tingley)
+
+Give an error message when using 'shell' and it's empty.
+
+Added the possibility to include "%s" in 'shellpipe'.
+
+Added "uhex" value for 'display': show non-printable characters as <xx>.
+Show unprintable characters with NonText highlighting, also in the command
+line.
+
+When asked to display the value of a hidden option, tell it's not supported.
+
+Win32:
+- When dropping a shortcut on gvim (.lnk file) edit the target, not the
+ shortcut itself. (Yasuhiro Matsumoto)
+- Added C versions of the OpenWithVim and SendToVim programs. (Walter Briscoe)
+- When 'shell' is "cmd" or "cmd.exe", set 'shellredir' to redirect stderr too.
+ Also check for the Unix shell names.
+- When $HOMEDRIVE and $HOMEPATH are defined, use them to define $HOME. (Craig
+ Barkhouse)
+
+Win32 console version:
+- Includes the user and system name in the ":version" message, when available.
+ It generates a pathdef.c file for this. (Jon Miner)
+- Set the window icon to Vim's icon (only for Windows 2000). While executing
+ a shell command, modify the window title to show this. When exiting,
+ restore the cursor position too. (Craig Barkhouse)
+- The Win32 console version can be compiled with OLE support. It can only
+ function as a client, not as an OLE server.
+
+Errorformat:
+- Let "%p" in 'errorformat' (column of error indicated by a row of characters)
+ also accept a line of dots.
+- Added "%v" item in 'errorformat': Virtual column number. (Dan Sharp)
+- Added a default 'errorformat' value for VMS. (Jim Bush)
+
+The "p" command can now be used in Visual mode. It overwrites the selected
+text with the contents of a register.
+
+Highlight the <> items in the intro message to make clear they are special.
+
+When using the "c" flag for ":substitute", allow typing "l" for replacing this
+item and then stop: "last".
+
+When printing a verbose message about sourcing another file, print the line
+number.
+
+When resizing the Vim window, don't use 'equalalways'. Avoids that making the
+Vim window smaller makes split windows bigger. And it's what the docs say.
+
+When typing CTRL-D in Insert mode, just after an autoindent, then hitting CR
+kept the remaining white space. Now made it work like BS: delete the
+autoindent to avoid a blank non-empty line results.
+
+Added a GetHwnd() call to the OLE interface. (Vince Negri)
+
+Made ":normal" work in an event handler. Useful when dropping a file on Vim
+and for CursorHold autocommands.
+
+For the MS-Windows version, don't change to the directory of the file when a
+slash is used instead of a backslash. Explorer should always use a backslash,
+the user can use a slash when typing the command.
+
+Timestamps:
+- When a buffer was changed outside of Vim and regaining focus, give a dialog
+ to allow the user to reload the file. Now also for other GUIs than
+ MS-Windows. And also used in the console, when compiled with dialog
+ support.
+- Inspect the file contents to find out if it really changed, ignore
+ situations where only the time stamp changed (e.g., checking the file out
+ from CVS).
+- When checking the timestamp, first check if the file size changed, to avoid
+ a file compare then. Makes it quicker for large (log) files that are
+ appended to.
+- Don't give a warning for a changed or deleted file when 'buftype' is set.
+- No longer warn for a changed directory. This avoids that the file explorer
+ produces warnings.
+- Checking timestamps is only done for buffers that are not hidden. These
+ will be checked when they become unhidden.
+- When checking for a file being changed outside of Vim, also check if the
+ file permissions changed. When the file contents didn't change but the
+ permissions did, give a warning.
+- Avoid checking too often, otherwise the dialog keeps popping up for a log
+ file that steadily grows.
+
+Mapping <M-A> when 'encoding' is "latin1" and then setting 'encoding' to
+"utf-8" causes the first byte of a multi-byte to be mapped. Can cause very
+hard to find problems. Disallow mapping part of a multi-byte character.
+
+For ":python" and ":tcl" accept an in-line script. (Johannes Zellner)
+Also for ":ruby" and ":perl". (Benoit Cerrina)
+
+Made ":syn include" use 'runtimepath' when the file name is not a full path.
+
+When 'switchbuf' contains "split" and the current window is empty, don't split
+the window.
+
+Unix: Catch SIGPWR to preserve files when the power is about to go down.
+
+Sniff interface: (Anton Leherbauer)
+- fixed windows code, esp. the event handling stuff
+- adaptations for sniff 4.x ($SNIFF_DIR4)
+- support for adding sniff requests at runtime
+
+Support the notation <A-x> as an alias for <M-x>. This logical, since the Alt
+key is used.
+
+":find" accepts a count, which means that the count'th match in 'path' is
+used.
+
+":ls" and ":buffers" output shows modified/readonly/modifiable flag. When a
+buffer is active show "a" instead of nothing. When a buffer isn't loaded
+show nothing instead of "-".
+
+Unix install:
+- When installing the tools, set absolute paths in tools scripts efm_perl.pl
+ and mve.awk. Avoids that the user has to edit these files.
+- Install Icons for KDE when the directories exist and the icons do not exist
+ yet.
+
+Added has("win95"), to be able to distinguish between MS-Windows 95/98/ME and
+NT/2000/XP in a Vim script.
+
+When a ":cd" command was typed, echo the new current directory. (Dan Sharp)
+
+When using ":winpos" before the GUI window has been opened, remember the
+values until it is opened.
+
+In the ":version" output, add "/dyn" for features that are dynamically loaded.
+This indicates the feature may not always work.
+
+On Windows NT it is possible that a directory is read-only, but a file can be
+deleted. When making a backup by renaming the file and 'backupdir' doesn't
+use the current directory, this causes the original file to be deleted,
+without the possibility to create a new file. Give an extra error message
+then to warn to user about this.
+
+Made CTRL-R CTRL-O at the command line work like CTRL-R CTRL-R, so that it's
+consistent with Insert mode.
+
+==============================================================================
+COMPILE TIME CHANGES *compile-changes-6*
+
+All generated files have been moved out of the "src" directory. This makes it
+easy to see which files are not edited by hand. The files generated by
+configure are now in the "src/auto" directory. For Unix, compiled object
+files go in the objects directory.
+
+The source archive was over the 1.4M floppy limit. The archives are now split
+up into two runtime and two source archives. Also provide a bzip2 compressed
+archive that contains all the sources and runtime files.
+
+Added "reconfig" as a target for make. Useful when changing some of the
+arguments that require flushing the cache, such as switching from GTK to
+Motif. Adjusted the meaning of GUI_INC_LOC and GUI_LIB_LOC to be consistent
+over different GUIs.
+
+Added src/README.txt to give an overview of the main parts of the source code.
+
+The Unix Makefile now fully supports using $(DESTDIR) to install to a specific
+location. Replaces the manual setting of *ENDLOC variables.
+
+Added the possibility for a maintainer of a binary version to include his
+e-mail address with the --with-compiledby configure argument.
+
+Included features are now grouped in "tiny", "small", "normal", "big" and
+"huge". This replaces "min-features" and "max-features". Using "tiny"
+disables multiple windows for a really small Vim.
+
+For the tiny version or when FEAT_WINDOWS is not defined: Firstwin and lastwin
+are equal to curwin and don't use w_next and w_prev.
+
+Added the +listcmds feature. Can be used to compile without the Vim commands
+that manipulate the buffer list and argument list (the buffer list itself is
+still there, can't do without it).
+
+Added the +vreplace feature. It is disabled in the "small" version to avoid
+that the 16 bit DOS version runs out of memory.
+
+Removed GTK+ support for versions older than 1.1.16.
+
+The configure checks for using PTYs have been improved. Code taken from a
+recent version of screen.
+
+Added configure options to install Vim, Ex and View under another name (e.g.,
+vim6, ex6 and view6).
+
+Added "--with-global-runtime" configure argument. Allows specifying the
+global directory used in the 'runtimepath' default.
+
+Made enabling the SNiFF+ interface possible with a configure argument.
+
+Configure now always checks /usr/local/lib for libraries and
+/usr/local/include for include files. Helps finding the stuff for iconv() and
+gettext().
+
+Moved the command line history stuff into the +cmdline_hist feature, to
+exclude the command line history from the tiny version.
+
+MS-Windows: Moved common functions from Win16 and Win32 to os_mswin.c. Avoids
+having to change two files for one problem. (Vince Negri)
+
+Moved common code from gui_w16.c and gui_w32.c to gui_w48.c (Vince Negri)
+
+The jumplist is now a separate feature. It is disabled for the "small"
+version (16 bit MS-DOS).
+
+Renamed all types ending in _t to end in _T. Avoids potential problems with
+system types.
+
+Added a configure check for X11 header files that implicitly define the return
+type to int. (Steve Wall)
+
+"make doslang" in the top directory makes an archive with the menu and .mo
+files for Windows. This uses the files generated on Unix, these should work
+on MS-Windows as well.
+
+Merged a large part of os_vms.c with os_unix.c. The code was duplicated in
+the past which made maintenance more work. (Zoltan Arpadffy)
+
+Updated the Borland C version 5 Makefile: (Dan Sharp)
+- Fixed the Perl build
+- Added python and tcl builds
+- Added dynamic perl and dynamic python builds
+- Added uninstal.exe build
+- Use "yes" and "no" for the options, like in Make_mvc.mak.
+
+Win32: Merged Make_gvc.mak and Make_ovc.mak into one file: Make_ivc.mak. It's
+much smaller, many unnecessary text has been removed. (Walter Briscoe)
+Added Make_dvc.mak to be able to debug exe generated with Make_mvc.mak in
+MS-Devstudio. (Walter Briscoe)
+
+MS-Windows: The big gvim.exe, which includes OLE, now also includes
+dynamically loaded Tcl, Perl and Python. This uses ActivePerl 5.6.1,
+ActivePython 2.1.1 and ActiveTCL 8.3.3
+
+Added AC_EXEEXT to configure.in, to check if the executable needs ".exe" for
+Cygwin or MingW. Renamed SUFFIX to EXEEXT in Makefile.
+
+Win32: Load comdlg32.dll delayed for faster startup. Only when using VC 6.
+(Vipin Aravind)
+
+Win32: When compiling with Borland, allow using IME. (Yasuhiro Matsumoto)
+
+Win32: Added Makefile for Borland 5 to compile gvimext.dll. (Yasuhiro
+Matsumoto)
+
+==============================================================================
+BUG FIXES *bug-fixes-6*
+
+When checking the command name for "gvim", "ex", etc. ignore case. Required
+for systems where case is ignored in command names.
+
+Search pattern "[a-c-e]" also matched a 'd' and didn't match a '-'.
+
+When double-clicking in another window, wasn't recognized as double click,
+because topline is different. Added set_mouse_topline().
+
+The BROKEN_LOCALE check was broken. (Marcin Dalecki)
+
+When "t_Co" is set, the default colors remain the same, thus wrong. Reset the
+colors after changing "t_Co". (Steve Wall)
+
+When exiting with ":wqall" the messages about writing files could overwrite
+each other and be lost forever.
+
+When starting Vim with an extremely long file name (around 1024 characters) it
+would crash. Added a few checks to avoid buffer overflows.
+
+CTRL-E could get stuck in a file with very long lines.
+
+":au syntax<Tab>" expanded event names while it should expand groups starting
+with "syntax".
+
+When expanding a file name caused an error (e.g., for <amatch>) it was
+produced even when inside an "if 0".
+
+'cindent' formatted C comments differently from what the 'comments' option
+specified. (Steve Wall)
+
+Default for 'grepprg' didn't include the file name when only grepping in one
+file. Now /dev/null has been added for Unix.
+
+Opening the option window twice caused trouble. Now the cursor goes to the
+existing option window.
+
+":sview" and ":view" didn't set 'readonly' for an existing buffer. Now do set
+'readonly', unless the buffer is also edited in another window.
+
+GTK GUI: When 'guioptions' excluded 'g', the more prompt caused the toolbar
+and menubar to disappear and resize the window (which clears the text).
+Now always grey-out the toplevel menus to avoid that the menubar changes size
+or disappears.
+
+When re-using the current buffer for a new buffer, buffer-local variables were
+not deleted.
+
+GUI: when 'scrolloff' is 0 dragging the mouse above the window didn't cause a
+down scroll. Now pass on a mouse event with mouse_row set to -1.
+
+Win32: Console version didn't work on telnet, because of switching between two
+console screens. Now use one console screen and save/restore the contents
+when needed. (Craig Barkhouse)
+
+When reading a file the magic number for encryption was included in the file
+length. (Antonio Colombo)
+
+The quickfix window contained leading whitespace and NULs for multi-line
+messages. (David Harrison)
+
+When using cscope, redundant tags were removed. This caused a numbering
+problem, because they were all listed. Don't remove redundant cscope tags.
+(David Bustos).
+
+Cscope: Test for which matches are in the current buffer sometimes failed,
+causing a jump to another match than selected. (David Bustos)
+
+Win32: Buffer overflow when adding a charset name in a font.
+
+'titlestring' and 'iconstring' were evaluating an expression in the current
+context, which could be a user function, which is a problem for local
+variables vs global variables.
+
+Win32 GUI: Mapping <M-F> didn't work. Now handle SHIFT and CTRL in
+_OnSysChar().
+
+Win32 GUI: (on no file), :vs<CR>:q<CR> left a trail of pixels down the middle.
+Could also happen for the ruler. screen_puts() didn't clear the right char in
+ScreenLines[] for the bold trick.
+
+Win32: ":%!sort|uniq" didn't work, because the input file name touches the
+"|". Insert a space before the "|".
+
+OS/2: Expanding wildcards included non-existing files. Caused ":runtime" to
+fail, which caused syntax highlighting to fail.
+
+Pasting a register containing CTRL-R on the command line could cause an
+endless loop that can't be interrupted. Now it can be stopped with CTRL-C.
+
+When 'verbose' is set, a message for file read/write could overwrite the
+previous message.
+When 'verbose' is set, the header from ":select" was put after the last
+message. Now start a new line.
+
+The hit-enter prompt reacted to the response of the t_RV string, causing
+messages at startup to disappear.
+
+When t_Co was set to 1, colors were still used. Now only use color when t_Co
+> 1.
+
+Listing functions with ":function" didn't quit when 'q' or ':' was typed at
+the more prompt.
+
+Use mkstemp() instead of mktemp() when it's available, avoids a warning for
+linking on FreeBSD.
+
+When doing Insert mode completion it's possible that b_sfname is NULL. Don't
+give it to printf() for the "Scanning" message.
+
+":set runtimepath-=$VIMRUNTIME" didn't work, because expansion of wildcards
+was done after trying to remove the string. Now for ":set opt+=val" and ":set
+opt-=val" the expansion of wildcards is done before adding or removing "val".
+
+Using CTRL-V with the "r" command with a blockwise Visual selection inserted a
+CTRL-V instead of getting a special character.
+
+Unix: Changed the order of libraries: Put -lXdmcp after -lX11 and -lSM -lICE
+after -lXdmcp. Should fix link problem on HP-UX 10.20.
+
+Don't remove the last "-lm" from the link line. Vim may link but fail later
+when the GUI starts.
+
+When the shell returns with an error when trying to expand wildcards, do
+include the pattern when the "EW_NOTFOUND" flag was set.
+When expanding wildcards with the shell fails, give a clear error message
+instead of just "1 returned".
+
+Selecting a Visual block, with the start partly on a Tab, deleting it leaves
+the cursor too far to the left. Causes "s" to work in the wrong position.
+
+Pound sign in normal.c caused trouble on some compilers. Use 0xA3 instead.
+
+Warning for changing a read-only file wasn't given when 'insertmode' was set.
+
+Win32: When 'shellxquote' is set to a double quote (e.g., using csh), ":!start
+notepad file" doesn't work. Remove the double quotes added by 'shellxquote'
+when using ":!start". (Pavol Juhas)
+
+The "<f-args>" argument of ":command" didn't accept Tabs for white space.
+Also, don't add an empty argument when there are trailing blanks.
+
+":e test\\je" edited "test\je", but ":next test\\je" edited "testje".
+Backslashes were removed one time too many for ":next".
+
+VMS: "gf" didn't work properly. Use vms_fixfilename() to translate the file
+name. (Zoltan Arpadffy)
+
+After ":hi Normal ctermbg=black ctermfg=white" and suspending Vim not all
+characters are redrawn with the right background.
+
+When doing "make test" without +eval or +windows feature, many tests failed.
+Now have test1 generate a script to copy the correct output, so that a test
+that doesn't work is skipped.
+
+On FreeBSD the Perl interface added "-lc" to the link command and Python added
+"-pthread". These two don't work together, because the libc_r library should
+be used. Removed "-lc" from Perl, it should not be needed.
+Also: Add "-pthread" to $LIBS, so that the checks for functions is done with
+libc_r. Sigaltstack() appears to be missing from libc_r.
+
+The Syntax sub-menus were getting too long, reorganized them and added another
+level for some languages.
+
+Visual block "r"eplace didn't work well when a Tab is partly included.
+(Matthias Kramm)
+
+When yanking a Visual block, where some lines end halfway the block, putting
+the text somewhere else doesn't insert a block. Padd with spaces for missing
+characters. Added "y_width" to struct yankreg. (Matthias Kramm)
+
+If a substitute string has a multibyte character after a backslash only the
+first byte of it was skipped. (Muraoka Taro)
+
+Win32: Numeric keypad keys were missing from the builtin termcap entry.
+
+When a file was read-only ":wa!" didn't force it to be written. (Vince Negri)
+
+Amiga: A file name starting with a colon was considered absolute but it isn't.
+Amiga: ":pwd" added a slash when in the root of a drive.
+
+Don't let 'ttymouse' default to "dec" when compiled with dec mouse support.
+It breaks the gpm mouse (Linux console).
+
+The prototypes for the Perl interface didn't work for threaded Perl. Added a
+sed command to remove the prototypes from proto/if_perl.pro and added them
+manually to if_perl.xs.
+
+When ":w!" resets the 'readonly' option the title and status lines were not
+updated.
+
+":args" showed the current file when the argument list was empty. Made this
+work like Vi: display nothing.
+
+"99:<C-U>echo v:count" echoed "99" in Normal mode, but 0 in Visual mode.
+Don't set v:count when executing a stuffed command.
+
+Amiga: Got a requester for "home:" because it's in the default runtime path.
+Don't bring up a requester when searching for a file in 'path', sourcing the
+.vimrc file or using ":runtime".
+
+Win16 and Win32: Considered a file "\path\file" absolute. Can cause the same
+file to appear as two different buffers.
+
+Win32: Renaming a file to an empty string crashed Vim. Happened when using
+explorer.vim and hitting ESC at the rename prompt.
+
+Win32: strftime() crashed when called with a "-1" value for the time.
+
+Win32 with Borland compiler: mch_FullName() didn't work, caused tag file not
+to be found.
+
+Cscope sometimes jumped to the wrong tag. (David Bustos)
+
+OS/2: Could not find the tags file. mch_expand_wildcards() added another
+slash to a directory name.
+
+When using ">>" the `] mark was not in the last column.
+
+When Vim was compiled without menu support, filetype.vim was still trying to
+source the menu.vim script. (Rafael Garcia-Suarez)
+
+":ptag" added an item to the tag stack.
+
+Win32 IME: "gr" didn't use IME mode.
+
+In the "vim --help" message the term "options" was used for arguments. That's
+confusing, call them "arguments".
+
+When there are two windows, and a BufUnload autocommand for closing window #1
+closed window #2, Vim would crash.
+
+When there is a preview window and only one other window, ":q" wouldn't exit.
+
+In Insert mode, when cancelling a digraph with ESC, the '?' wasn't removed.
+
+On Unix glob(".*") returned "." and "..", on Windows it didn't. On Windows
+glob("*") also returned files starting with a dot. Made this work like Unix
+on all systems.
+
+Win32: Removed old code to open a console. Vimrun is now used and works fine.
+
+Compute the room needed by the intro message accurately, so that it also fits
+on a 25 line console. (Craig Barkhouse)
+
+":ptnext" was broken. Now remember the last tag used in the preview window
+separately from the tagstack.
+
+Didn't check for "-display" being the last argument. (Wichert Akkerman)
+
+GTK GUI: When starting "gvim" under some conditions there would be an X error.
+Don't replace the error handler when creating the xterm clipboard. (Wichert
+Akkerman)
+
+Adding a space after a help tag caused the tag not to be found. E.g., ":he
+autoindent ".
+
+Was trying to expand a URL into a full path name. On Windows this resulted in
+the current directory to be prepended to the URL. Added vim_isAbsName() and
+vim_FullName() to avoid that various machine specific functions do it
+differently.
+
+":n *.c" ":cd .." ":n" didn't use the original directory of the file. Vi only
+does it for the current file (looks like a bug). Now remember the buffer used
+for the entry in the argument list and use it's name (adjusted when doing
+":cd"), unless it's deleted.
+
+When inserting a special key as its name ("<F8>" as four characters) after
+moving around in Insert mode, undo didn't work properly.
+
+Motif GUI: When using the right mouse button, for some people gvim froze for
+a couple of seconds (Motif 1.2?). This doesn't happen when there is no Popup
+menu. Solved by only creating a popup menu when 'mousemodel' is "popup" or
+"popup_setpos". (David Harrison)
+
+Motif: When adding many menu items, the "Help" menu disappeared but the
+menubar didn't wrap. Now manually set the menubar height.
+
+When using <BS> in Insert mode to remove a line break, or using "J" to join
+lines, the cursor could end up halfway a multi-byte character. (Muraoka Taro)
+
+Removed defining SVR4 in configure. It causes problems for some X header
+files and doesn't appear to be used anywhere.
+
+When 'wildignore' is used, 'ignorecase' for a tag match was not working.
+
+When 'wildignore' contains "*~" it was impossible to edit a file ending in a
+"~". Now don't recognize a file ending in "~" as containing wildcards.
+
+Disabled the mouse code for OS/2. It was not really used.
+
+":mksession" always used the full path name for a buffer, also when the short
+name could be used.
+":mkvimrc" and ":mksession" didn't save 'wildchar' and 'pastetoggle' in such a
+way that they would be restored. Now use the key name if possible, this is
+portable.
+
+After recovering a file and abandoning it, an ":edit" command didn't give the
+ATTENTION prompt again. Would be useful to be able to delete the file in an
+easy way. Reset the BF_RECOVERED flag when unloading the buffer.
+
+histdel() could match or ignore case, depending on what happened before it.
+Now always match case.
+
+When a window size was specified when splitting a window, it would still get
+the size from 'winheight' or 'winwidth' if it's larger.
+
+When using "append" or "insert" inside a function definition, a line starting
+with "function" or "endfunction" caused confusion. Now recognize the commands
+and skip lines until a ".".
+
+At the end of any function or sourced file need_wait_return could be reset,
+causing messages to disappear when redrawing.
+
+When in a while loop the line number for error messages stayed fixed. Now the
+line number is remembered in the while loop.
+
+"cd c:/" didn't work on MS-DOS. mch_isdir() removed a trailing slash.
+
+MS-Windows: getftime() didn't work when a directory had a trailing slash or
+backslash. Didn't show the time in the explorer because of this.
+
+When doing wildcard completion, a directory "a/" sorted after "a-b". Now
+recognize path separators when sorting files.
+
+Non-Unix systems: When editing "c:/dir/../file" and "c:/file" they were
+created as different buffers, although it's the same file. Expand to a full
+file name also when an absolute name contains "..".
+
+"g&" didn't repeat the last substitute properly.
+
+When 'clipboard' was set to "unnamed", a "Y" command would not write to "0.
+Now make a copy of register 0 to the clipboard register.
+
+When the search pattern matches in many ways, it could not always be
+interrupted with a CTRL-C. And CTRL-C would have to be hit once for every
+line when 'hlsearch' is on.
+When 'incsearch' is on and interrupting the search for a match, don't abandon
+the command line.
+
+When turning a directory name into a full path, e.g., with fnamemodify(),
+sometimes a slash was added. Make this consistent: Don't add a slash.
+
+When a file name contains a "!", using it in a shell command will cause
+trouble: ":!cat %". Escape the "!" to avoid that. Escape it another time
+when 'shell' contains "sh".
+
+Completing a file name that has a tail that starts with a "~" didn't work:
+":e view/~<Tab>".
+
+Using a ":command" argument that contains < and > but not for a special
+argument was not skipped properly.
+
+The DOS install program: On Win2000 the check for a vim.exe or gvim.exe in
+$PATH didn't work, it always found it in the current directory.
+Rename the vim.exe in the current dir to avoid this. (Walter Briscoe)
+
+In the MS-DOS/Windows install program, use %VIM% instead of an absolute path,
+so that moving Vim requires only one change in the batch file.
+
+Mac: mch_FullName() changed the "fname" argument and didn't always initialize
+the buffer.
+
+MS-DOS: mch_FullName() didn't fix forward/backward slashes in an absolute file
+name.
+
+"echo expand("%:p:h")" with an empty file name removed one directory name on
+MS-DOS. For Unix, when the file name is a directory, the directory name was
+removed. Now make it consistent: "%:p" adds a path separator for all systems,
+but no path separator is added in other situations.
+
+Unix: When checking for a CTRL-C (could happen any time) and there is an X
+event (e.g., clipboard updated) and there is typeahead, Vim would hang until a
+character was typed.
+
+MS-DOS, MS-Windows and Amiga: expanding "$ENV/foo" when $ENV ends in a colon,
+had the slash removed.
+
+":he \^=" gave an error for using \_. ":he ^=" didn't find tag :set^=. Even
+"he :set^=" didn't find it.
+
+A tags file name "D:/tags" was used as file "tags" in "D:". That doesn't work
+when the current path for D: isn't the root of the drive.
+
+Removed calls to XtInitializeWidgetClass(), they shouldn't be necessary.
+
+When using a dtterm or various other color terminals, and the Normal group has
+been set to use a different background color, the background wouldn't always
+be displayed with that color. Added check for "ut" termcap entry: If it's
+missing, clearing the screen won't give us the current background color. Need
+to draw each character instead. Vim now also works when the "cl" (clear
+screen) termcap entry is missing.
+
+When repeating a "/" search command with a line offset, the "n" did use the
+offset but didn't make the motion linewise. Made "d/pat/+2" and "dn" do the
+same.
+
+Win32: Trying to use ":tearoff" for a menu that doesn't exist caused a crash.
+
+OpenPTY() didn't work on Sequent. Add a configure check for getpseudotty().
+
+C-indenting: Indented a line starting with ")" with the matching "(", but not
+a line starting with "x)" looks strange. Also compute the indent for aligning
+with items inside the () and use the lowest indent.
+
+MS-DOS and Windows: ":n *.vim" also matched files ending in "~".
+Moved mch_expandpath() from os_win16.c and os_msdos.c to misc1.c, they are
+equal.
+
+Macintosh: (Dany St-Amant)
+- In Vi-compatible mode didn't read files with CR line separators.
+- Fixed a bug in the handling of Activate/Deactivate Event
+- Fixed a bug in gui_mch_dialog (using wrong pointer)
+
+Multibyte GDK XIM: While composing a multibyte-word, if user presses a
+mouse button, then the word is removed. It should remain and composing end.
+(Sung-Hyun Nam)
+
+MS-DOS, MS-Windows and OS/2: When reading from stdin, automatic CR-LF
+conversion by the C library got in the way of detecting a "dos" 'fileformat'.
+
+When 'smartcase' is set, patterns with "\S" would also make 'ignorecase'
+reset.
+
+When clicking the mouse in a column larger than 222, it moved to the first
+column. Can't encode a larger number in a character. Now limit the number to
+222, don't jump back to the first column.
+
+GUI: In some versions CSI would cause trouble, either when typed directly or
+when part of a multi-byte sequence.
+
+When using multibyte characters in a ":normal" command, a trailing byte that
+is CSI or K_SPECIAL caused problems.
+
+Wildmenu didn't handle multi-byte characters.
+
+":sleep 10" could not be interrupted on Windows, while "gs" could. Made them
+both work the same.
+
+Unix: When waiting for a character is interrupted by an X-windows event (e.g.,
+to obtain the contents of the selection), the wait time would not be honored.
+A message could be overwritten quickly. Now compute the remaining waiting
+time.
+
+Windows: Completing "\\share\c$\S" inserted a backslash before the $ and then
+the name is invalid. Don't insert the backslash.
+
+When doing an auto-write before ":make", IObuff was overwritten and the wrong
+text displayed later.
+
+On the Mac the directories "c:/tmp" and "c:/temp" were used in the defaults
+for 'backupdir' and 'directory', they don't exist.
+
+The check for a new file not to be on an MS-DOS filesystem created the file
+temporarily, which can be slow. Don't do this if there is another check for
+the swap file being on an MS-DOS filesystem.
+
+Don't give the "Changing a readonly file" warning when reading from stdin.
+
+When using the "Save As" menu entry and not entering a file name, would get an
+error message for the trailing ":edit #". Now only do that when the
+alternate file name was changed.
+
+When Vim owns the X11 selection and is being suspended, an application that
+tries to use the selection hangs. When Vim continues it could no longer
+obtain the selection. Now give up the selection when suspending.
+
+option.h and globals.h were included in some files, while they were already
+included in vim.h. Moved the definition of EXTERN to vim.h to avoid doing it
+twice.
+
+When repeating an operator that used a search pattern and the search pattern
+contained characters that have a special meaning on the cmdline (e.g., CTRL-U)
+it didn't work.
+
+Fixed various problems with using K_SPECIAL (0x80) and CSI (0x9b) as a byte in
+a (multibyte) character. For example, the "r" command could not be repeated.
+
+The DOS/Windows install program didn't always work from a directory with a
+long filename, because $VIM and the executable name would not have the same
+path.
+
+Multi-byte:
+- Using an any-but character range [^x] in a regexp didn't work for UTF-8.
+ (Muraoka Taro)
+- When backspacing over inserted characters in Replace mode multi-byte
+ characters were not handled correctly. (Muraoka Taro)
+- Search commands "#" and "*" didn't work with multibyte characters. (Muraoka
+ Taro)
+- Word completion in Insert mode didn't work with multibyte characters.
+ (Muraoka Taro)
+- Athena/Motif GUI: when 'linespace' is non-zero the cursor would be drawn too
+ wide (number of bytes instead of cell width).
+- When changing 'encoding' to "euc-jp" and inserting a character Vim would
+ crash.
+- For euc-jp characters positioning the cursor would sometimes be wrong.
+ Also, with two characters with 0x8e leading byte only the first one would be
+ displayed.
+- When using DYNAMIC_ICONV on Win32 conversion might fail because of using the
+ wrong error number. (Muraoka Taro)
+- Using Alt-x in the GUI while 'encoding' was set to "utf-8" didn't produce
+ the right character.
+- When using Visual block selection and only the left halve of a double-wide
+ character is selected, the highlighting continued to the end of the line.
+- Visual-block delete didn't work properly when deleting the right halve of a
+ double-wide character.
+- Overstrike mode for the cmdline replaced only the first byte of a multibyte
+ character.
+- The cursor in Replace mode (also in the cmdline) was to small on a
+ double-wide character.
+- When a multibyte character contained a 0x80 byte, it didn't work (was using
+ a CSI byte instead). (Muraoka Taro)
+- Wordwise selection with the mouse didn't work.
+- Yanking a modeless selection of multi-byte characters didn't work.
+- When 'selection' is "exclusive", selecting a word that ends in a multi-byte
+ character used wrong highlighting for the following character.
+
+Win32 with Make_mvc.mak: Didn't compile for debugging. (Craig Barkhouse)
+
+Win32 GUI: When "vimrun.exe" is used to execute an external command, don't
+give a message box with the return value, it was already printed by vimrun.
+Also avoid printing the return value of the shell when ":silent!" is used.
+
+Win32: selecting a lot of text and using the "find/replace" dialog caused a
+crash.
+
+X11 GUI: When typing a character with the 8th bit set and the Meta/Alt
+modifier, the modifier was removed without changing the character.
+
+Truncating a message to make it fit on the command line, using "..." for the
+middle, didn't always compute the space correctly.
+
+Could not imap <C-@>. Now it works like <Nul>.
+
+VMS:
+- Fixed a few things for VAXC. os_vms_fix.com had some strange CTRL-M
+ characters. (Zoltan Arpadffy and John W. Hamill)
+- Added VMS-specific defaults for the 'isfname' and 'isprint' options.
+ (Zoltan Arpadffy)
+- Removed os_vms_osdef.h, it's no longer used.
+
+The gzip plugin used a ":normal" command, this doesn't work when dropping a
+compressed file on Vim.
+
+In very rare situations a binary search for a tag would fail, because an
+uninitialized value happens to be half the size of the tag file. (Narendran)
+
+When using BufEnter and BufLeave autocommands to enable/disable a menu, it
+wasn't updated right away.
+
+When doing a replace with the "c"onfirm flag, the cursor was positioned after
+the ruler, instead of after the question. With a long replacement string the
+screen could scroll up and cause a "more" prompt. Now the message is
+truncated to make it fit.
+
+Motif: The autoconf check for the Xp library didn't work.
+
+When 'verbose' is set to list lines of a sourced file, defining a function
+would reset the counter used for the "more" prompt.
+
+In the Win32 find/replace dialog, a '/' character caused problems. Escape it
+with a backslash.
+
+Starting a shell with ":sh" was different from starting a shell for CTRL-Z
+when suspending doesn't work. They now work the same way.
+
+Jumping to a file mark while in a changed buffer gave a "mark not set" error.
+
+":execute histget("cmd")" causes an endless loop and crashed Vim. Now catch
+all commands that cause too much recursiveness.
+
+Removed "Failed to open input method" error message, too many people got this
+when they didn't want to use a XIM.
+
+GUI: When compiled without the +windows feature, the scrollbar would start
+below line one.
+
+Removed the trick with redefining character class functions from regexp.c.
+
+Win32 GUI: Find dialog gives focus back to main window, when typing a
+character mouse pointer is blanked, it didn't reappear when moving it in the
+dialog window. (Vince Negri)
+
+When recording and typing a CTRL-C, no character was recorded. When in Insert
+mode or cancelling half a command, playing back the recorded sequence wouldn't
+work. Now record the CTRL-C.
+
+When the GUI was started, mouse codes for DEC and netterm were still checked
+for.
+
+GUI: When scrolling and 'writedelay' is non-zero, the character under the
+cursor was displayed in the wrong position (one line above/below with
+CTRL-E/CTRL-Y).
+
+A ":normal" command would reset the 'scrollbind' info. Causes problems when
+using a ":normal" command in an autocommand for opening a file.
+
+Windows GUI: a point size with a dot, like "7.5", wasn't recognized. (Muraoka
+Taro)
+
+When 'scrollbind' wasn't set would still remember the current position,
+wasting time.
+
+GTK: Crash when 'shell' doesn't exist and doing":!ls". Use _exit() instead of
+exit() when the child couldn't execute the shell.
+
+Multi-byte:
+- GUI with double-byte encoding: a mouse click in left halve of double-wide
+ character put the cursor in previous char.
+- Using double-byte encoding and 'selection' is "exclusive": "vey" and "^Vey"
+ included the character after the word.
+- When using a double-byte encoding and there is a lead byte at the end of the
+ line, the preceding line would be displayed. "ga" also showed wrong info.
+- "gf" didn't include multi-byte characters before the cursor properly.
+ (Muraoka Taro)
+
+GUI: The cursor was sometimes not removed when scrolling. Changed the policy
+from redrawing the cursor after each call to gui_write() to only update it at
+the end of update_screen() or when setting the cursor position. Also only
+update the scrollbars at the end of update_screen(), that's the only place
+where the window text may have been scrolled.
+
+Formatting "/*<Tab>long text", produced "* <Tab>" in the next line. Now
+remove the space before the Tab.
+Formatting "/*<Tab> long text", produced "* <Tab> long text" in the next
+line. Now keep the space after the Tab.
+
+In some places non-ASCII alphabetical characters were accepted, which could
+cause problems. For example, ":X" (X being such a character).
+
+When a pattern matches the end of the line, the last character in the line was
+highlighted for 'hlsearch'. That looks wrong for "/\%3c". Now highlight the
+character just after the line.
+
+Motif: If a dialog was closed by clicking on the "X" of the window frame Vim
+would no longer respond.
+
+When using CTRL-X or CTRL-A on a number with many leading zeros, Vim would
+crash. (Matsumoto)
+
+When 'insertmode' is set, the mapping in mswin.vim for CTRL-V didn't work in
+Select mode. Insert mode wasn't restarted after overwriting the text.
+Now allow nesting Insert mode with insert and change commands. CTRL-O
+cwfoo<Esc> now also works.
+
+Clicking with the right mouse button in another window started Visual mode,
+but used the start position of the current window. Caused ml_get errors when
+the line number was invalid. Now stay in the same window.
+
+When 'selection' is "exclusive", "gv" sometimes selected one character fewer.
+
+When 'comments' contains more than one start/middle/end triplet, the optional
+flags could be mixed up. Also didn't align the end with the middle part.
+
+Double-right-click in Visual mode didn't update the shown mode.
+
+When the Normal group has a font name, it was never used when starting up.
+Now use it when 'guifont' and 'guifontset' are empty.
+Setting a font name to a highlight group before the GUI was started didn't
+work.
+
+"make test" didn't use the name of the generated Vim executable.
+
+'cindent' problems:
+- Aligned with an "else" inside a do-while loop for a line below that loop.
+ (Meikel Brandmeyer)
+- A line before a function would be indented even when terminated with a
+ semicolon. (Meikel Brandmeyer)
+- 'cindent' gave too much indent to a line after a "};" that ends an array
+ init.
+- Support declaration lines ending in "," and "\". (Meikel Brandmeyer)
+- A case statement inside a do-while loop was used for indenting a line after
+ the do-while loop. (Meikel Brandmeyer)
+- When skipping a string in a line with one double quote it could continue in
+ the previous line. (Meikel Brandmeyer)
+
+When 'list' is set, 'hlsearch' didn't highlight a match at the end of the
+line. Now highlight the '$'.
+
+The Paste menu item in the menu bar, the popup menu and the toolbar were all
+different. Now made them all equal to how it was done in mswin.vim.
+
+st_dev can be smaller than "unsigned". The compiler may give an overflow
+warning. Added a configure check for dev_t.
+
+Athena: closing a confirm() dialog killed Vim.
+
+Various typos in the documentation. (Matt Dunford)
+
+Python interface: The definition of _DEBUG could cause trouble, undefine it.
+The error message for not being able to load the shared library wasn't
+translated. (Muraoka Taro)
+
+Mac: (Dany St-Amant and Axel Kielhorn)
+- Several fixes.
+- Vim was eating 80% of the CPU time.
+- The project os_mac.pbxproj didn't work, Moved it to a subdirectory.
+- Made the menu priority work for the menubar.
+- Fixed a problem with dragging the scrollbar.
+- Cleaned up the various #ifdefs.
+
+Unix: When catching a deadly signal and we keep getting one use _exit() to
+exit in a quick and dirty way.
+
+Athena menu ordering didn't work correctly. (David Harrison)
+
+A ":make" or ":grep" command with a long argument could cause a crash.
+
+Doing ":new file" and using "Quit" for the ATTENTION dialog still opened a new
+window.
+
+GTK: When starting the GUI and there is an error in the .vimrc file, don't
+present the wait-return prompt, since the message was given in the terminal.
+
+When there was an error in a .vimrc file the terminal where gvim was started
+could be cleared. Set msg_row in main.c before writing any messages.
+
+GTK and X11 GUI: When trying to read characters from the user (e.g. with
+input()) before the Vim window was opened caused Vim to hang when it was
+started from the desktop.
+
+OS/390 uses 31 bit pointers. That broke some computations with MAX_COL.
+Reduce MAX_COL by one bit for OS/390. (Ralf Schandl)
+
+When defining a function and it already exists, Vim didn't say it existed
+until after typing it. Now do this right away when typing it.
+
+The message remembered for displaying later (keep_msg) was sometimes pointing
+into a generic buffer, which might be changed by the time the message is
+displayed. Now make a copy of the message.
+
+When using multi-byte characters in a menu and a trailing byte is a backslash,
+the menu would not be created correctly. (Muraoka Taro)
+Using a multibyte character in the substitute string where a trail byte is a
+backslash didn't work. (Muraoka Taro)
+
+When setting "t_Co" in a vimrc file, then setting it automatically from an
+xterm termresponse and then setting it again manually caused a crash.
+
+When getting the value of a string option that is not supported, the number
+zero was returned. This breaks a check like "&enc == "asdf". Now an empty
+string is returned for string options.
+
+Crashed when starting the GTK GUI while using 'notitle' in the vimrc, setting
+'title' in the gvimrc and starting the GUI with ":gui". Closed the connection
+to the X server accidentally.
+
+Had to hit return after selecting an entry for ":ts".
+
+The message from ":cn" message was sometimes cleared. Now display it after
+redrawing if it doesn't cause a scroll (truncated when necessary).
+
+hangulin.c didn't compile when the GUI was disabled. Disable it when it won't
+work.
+
+When setting a termcap option like "t_CO", the value could be displayed as
+being for a normal key with a modifier, like "<M-=>".
+
+When expanding the argument list, entries which are a directory name did not
+get included. This stopped "vim c:/" from opening the file explorer.
+
+":syn match sd "^" nextgroup=asdf" skipped the first column and matched the
+nextgroup in the second column.
+
+GUI: When 'lazyredraw' is set, 'showmatch' didn't work. Required flushing
+the output.
+
+Don't define the <NetMouse> termcode in an xterm, reduces the problem when
+someone types <Esc> } in Insert mode.
+
+Made slash_adjust() work correctly for multi-byte characters. (Yasuhiro
+Matsumoto)
+Using a filename in Big5 encoding for autocommands didn't work (backslash in
+trailbyte). (Yasuhiro Matsumoto)
+
+DOS and Windows: Expanding *.vim also matched file.vimfoo. Expand path like
+Unix to avoid problems with Windows dir functions. Merged the DOS and Win32
+functions.
+
+Win32: Gvimext could not edit more than a few files at once, the length of the
+argument was fixed.
+
+"ls -1 * | xargs vim" worked, but the input was in cooked mode. Now switch to
+raw mode when needed. Use dup() to copy the stderr file descriptor to stdin
+to make shell commands work. No longer requires an external program to do
+this.
+
+When using ":filetype off", ftplugin and indent usage would be switched off at
+the same time. Don't do this, setting 'filetype' manually can still use them.
+
+GUI: When writing a double-byte character, it could be split up in two calls
+to gui_write(), which doesn't work. Now flush before the output buffer
+becomes full.
+
+When 'laststatus' is set and 'cmdheight' is two or bigger, the intro message
+would be written over the status line.
+The ":intro" command didn't work when there wasn't enough room.
+
+Configuring for Ruby failed with a recent version of Ruby. (Akinori Musha)
+
+Athena: When deleting the directory in which Vim was started, using the file
+browser made Vim exit. Removed the use of XtAppError().
+
+When using autoconf 2.50, UNIX was not defined. Moved the comment for "#undef
+UNIX" to a separate line.
+
+Win32: Disabled _OnWindowPosChanging() to make maximize work better.
+
+Win32: Compiling with VC 4.0 didn't work. (Walter Briscoe)
+
+Athena:
+- Finally fixed the problems with deleting a menu. (David Harrison)
+- Athena: When closing the confirm() dialog, worked like OK was pressed,
+ instead of Cancel.
+
+The file explorer didn't work in compatible mode, because of line
+continuation.
+
+Didn't give an error message for ":digraph a".
+
+When using Ex mode in the GUI and typing a special key, <BS> didn't delete it
+correctly. Now display '?' for a special key.
+
+When an operator is pending, clicking in another window made it apply to that
+window, even though the line numbers could be beyond the end of the buffer.
+
+When a function call doesn't have a terminating ")" Vim could crash.
+
+Perl interface: could crash on exit with perl 5.6.1. (Anduin Withers)
+
+Using %P in 'errorformat' wasn't handled correctly. (Tomas Zellerin)
+
+Using a syntax cluster that includes itself made Vim crash.
+
+GUI: With 'ls' set to 2, dragging the status line all the way up, then making
+the Vim window smaller: Could not the drag status line anymore.
+
+"vim -c startinsert! file" placed cursor on last char of a line, instead of
+after it. A ":set" command in the buffer menu set w_set_curswant. Now don't
+do this when w_curswant is MAXCOL.
+
+Win32: When the gvim window was maximized and selecting another font, the
+window would no longer fill the screen.
+
+The line with 'pastetoggle' in ":options" didn't show the right value when it
+is a special key. Hitting <CR> didn't work either.
+
+Formatting text, resulting in a % landing in the first line, repeated the % in
+the following lines, like it's the start of a comment.
+
+GTK: When adding a toolbar item while gvim is already running, it wasn't
+possible to use the tooltip. Now it works by adding the tooltip first.
+
+The output of "g CTRL-G" mentioned "Char" but it's actually bytes.
+
+Searching for the end of a oneline region didn't work correctly when there is
+an offset for the highlighting.
+
+Syntax highlighting: When synchronizing on C-comments, //*/ was seen as the
+start of a comment.
+
+Win32: Without scrollbars present, the MS mouse scroll wheel didn't work.
+Also handle the scrollbars when they are not visible.
+
+Motif: When there is no right scrollbar, the bottom scrollbar would still
+leave room for it. (Martin Dalecki)
+
+When changing 'guicursor' and the value is invalid, some of the effects would
+still take place. Now first check for errors and only make the new value
+effective when it's OK.
+
+Using "A" In Visual block mode, appending to lines that don't extend into the
+block, padding was wrong.
+
+When pasting a block of text, a character that occupies more than one screen
+column could be deleted and spaces inserted instead. Now only do that with a
+tab.
+
+Fixed conversion of documentation to HTML using Perl. (Dan Sharp)
+
+Give an error message when a menu name starts with a dot.
+
+Avoid a hang when executing a shell from the GUI on HP-UX by pushing "ptem"
+even when sys/ptem.h isn't present.
+
+When creating the temp directory, make sure umask is 077, otherwise the
+directory is not accessible when it was set to 0177.
+
+Unix: When resizing the window and a redraw is a bit slow, could get a window
+resize event while redrawing, resulting in a messed up window. Any input
+(e.g., a mouse click) would redraw.
+
+The "%B" item in the status line became zero in Insert mode (that's normal)
+for another than the current window.
+
+The menu entries to convert to xxd and back didn't work in Insert mode.
+
+When ":vglobal" didn't find a line where the pattern doesn't match, the error
+message would be the wrong way around.
+
+When ignoring a multi-line error message with "%-A", the continuation lines
+would be used anyway. (Servatius Brandt)
+
+"grx" on a double-wide character inserted "x", instead of replacing the
+character with "x ". "gR" on <xx> ('display' set the "uhex") didn't replace
+at all. When doing "gRxx" on a control character the first "x" would be
+inserted, breaking the alignment.
+
+Added "0)" to 'cinkeys', so that when typing a ) it is put in the same place
+as where "==" would put it.
+
+Win32: When maximized, adding/removing toolbar didn't resize the text area.
+
+When using <C-RightMouse> a count was discarded.
+
+When typing CTRL-V and <RightMouse> in the command line, would insert
+<LeftMouse>.
+
+Using "vis" or "vas" when 'selection' is exclusive didn't include the last
+character.
+
+When adding to an option like 'grepprg', leading space would be lost. Don't
+expand environment variables when there is no comma separating the items.
+
+GUI: When using a bold-italic font, would still use the bold trick and
+underlining.
+
+Motif: The default button didn't work in dialogs, the first one was always
+used. Had to give input focus to the default button.
+
+When using CTRL-T to jump within the same file, the '' mark wasn't set.
+
+Undo wasn't Vi compatible when using the 'c' flag for ":s". Now it undoes the
+whole ":s" command instead of each confirmed replacement.
+
+The Buffers menu, when torn-off, disappeared when being refreshed. Add a
+dummy item to avoid this.
+
+Removed calling msg_start() in main(), it should not be needed.
+
+vim_strpbrk() did not support multibyte characters. (Muraoka Taro)
+
+The Amiga version didn't compile, the code was too big for relative jumps.
+Moved a few files from ex_docmd.c to ex_cmds2.c
+
+When evaluating the "= register resulted in the "= register being changed, Vim
+would crash.
+
+When doing ":view file" and it fails, the current buffer was made read-only.
+
+Motif: For some people the separators in the toolbar disappeared when resizing
+the Vim window. (Martin Dalecki)
+
+Win32 GUI: when setting 'lines' to a huge number, would not compute the
+available space correctly. Was counting the menu height twice.
+
+Conversion of the docs to HTML didn't handle the line with the +quickfix tag
+correctly. (Antonio Colombo)
+
+Win32: fname_case() didn't handle multi-byte characters correctly. (Yasuhiro
+Matsumoto)
+
+The Cygwin version had trouble with fchdir(). Don't use that function for
+Cygwin.
+
+The generic check in scripts.vim for "conf" syntax was done before some checks
+in filetype.vim, resulting in "conf" syntax too often.
+
+Dos32: Typing lagged behind. Would wait for one biostick when checking if a
+character is available.
+
+GTK: When setting 'columns' while starting up "gvim", would set the width of
+the terminal it was started in.
+
+When using ESC in Insert mode, an autoindent that wraps to the next line
+caused the cursor to move to the end of the line temporarily. When the
+character before the cursor was a double-wide multi-byte character the cursor
+would be on the right halve, which causes problems with some terminals.
+
+Didn't handle multi-byte characters correctly when expanding a file name.
+(Yasuhiro Matsumoto)
+
+Win32 GUI: Errors generated before the GUI is decided to start were not
+reported.
+
+globpath() didn't reserve enough room for concatenated results. (Anduin
+Withers)
+
+When expanding an option that is very long already, don't do the expansion, it
+would be truncated to MAXPATHL. (Anduin Withers)
+
+When 'selection' is "exclusive", using "Fx" in Visual mode only moved until
+just after the character.
+
+When using IME on the console to enter a file name, the screen may scroll up.
+Redraw the screen then. (Yasuhiro Matsumoto)
+
+Motif: In the find/replace dialog the "Replace" button didn't work first time,
+second time it replaced all matches. Removed the use of ":s///c".
+GTK: Similar problems with the find/replace dialog, moved the code to a common
+function.
+
+X11: Use shared GC's for text. (Martin Dalecki)
+
+"]i" found the match under the cursor, instead of the first one below it.
+Same for "]I", "] CTRL-I", "]d", "]D" and "] CTRL-D".
+
+Win16: When maximized and the font is changed, don't change the window size.
+(Vince Negri)
+
+When 'lbr' is set, deleting a block of text could leave the cursor in the
+wrong position.
+
+Win32: When opening a file with the "Edit with Vim" popup menu entry,
+wildcards would cause trouble. Added the "--literal" argument to avoid
+expanding file names.
+
+When using "gv", it didn't restore that "$" was used in Visual block mode.
+
+Win32 GUI: While waiting for a shell command to finish, the window wasn't
+redrawn at all. (Yasuhiro Matsumoto)
+
+Syntax highlighting: A match that continues on a next line because of a
+contained region didn't end when that region ended.
+
+The ":s" command didn't allow flags like 'e' and 'i' right after it.
+
+When using ":s" to split a line, marks were moved to the next line. Vi keeps
+them in the first line.
+
+When using ":n" ":rew", the previous context mark was at the top of the file,
+while Vi puts it in the same place as the cursor. Made it Vi compatible.
+
+Fixed Vi incompatibility: Text was not put in register 1 when using "c" and
+"d" with a motion character, when deleting within one line with one of the
+commands: % ( ) `<character> / ? N n { }
+
+Win32 GUI: The tooltip for tear-off items remained when the tear-off item was
+no longer selected.
+
+GUI: When typing ":" at the more prompt, would return to Normal mode and not
+redraw the screen.
+
+When starting Vim with an argument "-c g/at/p" the printed lines would
+overwrite each other.
+
+BeOS: Didn't compile. Configure didn't add the os_beos files, the QNX check
+removed them. Various changes to os_beos.cc. (Joshua Haberman)
+Removed the check for the hardware platform, the BeBox has not been produced
+for a long time now.
+
+Win32 GUI: don't use a message box when the shell returns an error code,
+display the message in the Vim window.
+
+Make_mvc.mak always included "/debug" for linking. "GUI=no" argument didn't
+work. Use "DEBUG=yes" instead of "DEBUG=1" to make it consistent. (Dan Sharp)
+
+When a line in the tags file ended in ;" (no TAB following) the command would
+not be recognized as a search command.
+
+X11: The inputMethod resource never worked. Don't use the "none" input method
+for SGI, it apparently makes the first character in Input method dropped.
+
+Fixed incorrect tests in os_mac.h. (Axel Kielhorn)
+
+Win32 console: When the console where Vim runs in is closed, Vim could hang in
+trying to restore the window icon. (Yasuhiro Matsumoto)
+
+When using ":3call func()" or ":3,3call func() the line number was ignored.
+
+When 'showbreak' and 'linebreak' were both set, Visual highlighting sometimes
+continued until the end of the line.
+
+GTK GUI: Tearoff items were added even when 'guioptions' didn't contain 't'
+when starting up.
+
+MS-Windows: When the current directory includes a "~", searching files with
+"gf" or ":find" didn't work. A "$" in the directory had the same problem.
+Added mch_has_exp_wildcard() functions.
+
+When reducing the Vim window height while starting up, would get an
+out-of-memory error message.
+
+When editing a very long search pattern, 'incsearch' caused the redraw of the
+command line to fail.
+
+Motif GUI: On some systems the "Help" menu would not be on the far right, as
+it should be. On some other systems (esp. IRIX) the command line would not
+completely show. Solution is to only resize the menubar for Lesstif.
+
+Using "%" in a line that contains "\\" twice didn't take care of the quotes
+properly. Now make a difference between \" and \\".
+
+For non-Unix systems a dummy file is created when finding a swap name to
+detect a 8.3 filesystem. When there is an existing swap file, would get a
+warning for the file being created outside of Vim. Also, when closing the Vim
+window the file would remain.
+
+Motif: The menu height was always computed, using a "-menuheight" argument
+was setting the room for the command line. Now make clear the argument is not
+supported.
+
+For some (EBCDIC) systems, POUND was equal to '#'. Added an #if for that to
+avoid a duplicate case in a switch.
+
+The GUI may have problems when forking. Always call _exit() instead of exit()
+in the parent, the child will call exit().
+
+Win32 GUI: Accented characters were often wrong in dialogs and tearoff menus.
+Now use CP_ACP instead of CP_OEMCP. (Vince Negri)
+
+When displaying text with syntax highlighting causes an error (e.g., running
+out of stack) the syntax highlighting is disabled to avoid further messages.
+
+When a command in a .vimrc or .gvimrc causes an ATTENTION prompt, and Vim was
+started from the desktop (no place to display messages) it would hang. Now
+open the GUI window early to be able to display the messages and pop up the
+dialog.
+
+"r<CR>" on a multi-byte character deleted only the first byte of the
+character. "3r<CR>" deleted three bytes instead of three characters.
+
+When interrupting reading a file, Vi considers the buffer modified. Added the
+'i' flag in 'cpoptions' flag for this (we don't want it modified to be able to
+do ":q").
+
+When using an item in 'guicursor' that starts with a colon, Vim would get
+stuck or crash.
+
+When putting a file mark in a help file and later jumping back to it, the
+options would not be set. Extended the modeline in all help files to make
+this work better.
+
+When a modeline contained "::" the local option values would be printed. Now
+ignore it.
+
+Some help files did not use a 8.3 names, which causes problems when using
+MS-DOS unzip. Renamed "multibyte.txt" to "mbyte.txt", "rightleft.txt" to
+"rileft.txt", "tagsearch.txt" to "tagsrch.txt", "os_riscos.txt" to
+"os_risc.txt".
+
+When Visual mode is blockwise, using "iw" or "aw" made it characterwise. That
+doesn't seem right, only do this when in linewise mode. But then do it
+always, not only when start and end of Visual mode are equal.
+
+When using "viw" on a single-letter word and 'selection' is exclusive, would
+not include the word.
+
+When formatting text from Insert mode, using CTRL-O, could mess up undo
+information.
+
+While writing a file (also for the backup file) there was no check for an
+interrupt (hitting CTRL-C). Vim could hang when writing a large file over a
+slow network, and moving the mouse didn't make it appear (when 'mousehide' is
+set) and the screen wasn't updated in the GUI. Also allow interrupting when
+syncing the swap file, it can take a long time.
+
+When using ":mksession" while there is help window, it would later be restored
+to the right file but not marked as a help buffer. ":help" would then open
+another window. Now use the value "help" for 'buftype' to mark a help buffer.
+
+The session file contained absolute path names in option values, that doesn't
+work when the home directory depends on the situation. Replace the home
+directory with ~/ when possible.
+
+When using 'showbreak' a TAB just after the shown break would not be counted
+correctly, the cursor would be positioned wrong.
+
+With 'showbreak' set to "--->" or "------->" and 'sts' set to 4, inserting
+tabs did not work right. Could cause a crash. Backspacing was also wrong,
+could get stuck at a line break.
+
+Win32: crashed when tearing off a menu with over 300 items.
+
+GUI: A menu or toolbar item would appear when only a tooltip was defined for
+it.
+
+When 'scrolloff' is non-zero and "$" is in 'cpoptions', using "s" while the
+last line of the file is the first line on screen, the text wasn't displayed.
+
+When running "autoconf", delete the configure cache to force starting cleanly
+when configure is run again.
+
+When changing the Normal colors for cterm, the value of 'background' was
+changed even when the GUI was used.
+
+The warning for a missing vimrun.exe was always given on startup, but some
+people just editing a file don't need to be bothered by it. Only show it when
+vimrun would be used.
+
+When using "%" in a multibyte text it could get confused by trailbytes that
+match. (Muraoka Taro)
+
+Termcap entry for RiscOS was wrong, using 7 and 8 in octal codes.
+
+Athena: The title of a dialog window and the file selector window were not
+set. (David Harrison)
+
+The "htmlLink" highlight group specified colors, which gives problems when
+using a color scheme. Added the "Underlined" highlight group for this.
+
+After using ":insert" or ":change" the '[ mark would be one line too low.
+
+When looking for the file name after a match with 'include' one character was
+skipped. Same for 'define'.
+
+Win32 and DJGPP: When editing a file with a short name in a directory, and
+editing the same file but using the long name, would end up with two buffers
+on the same file.
+
+"gf" on a filename that starts with "../" only worked when the file being
+edited is in the current directory. An include file search didn't work
+properly for files starting with "../" or ".". Now search both relative to
+the file and to the current directory.
+
+When 'printheader', 'titlestring', 'iconstring', 'rulerformat' or 'statusline'
+contained "%{" but no following "}" memory was corrupted and a crash could
+happen.
+
+":0append" and then inserting two lines did not redraw the blank lines that
+were scrolled back down.
+
+When using insert mode completion in a narrow window, the message caused a
+scroll up. Now shorten the message if it doesn't fit and avoid writing the
+ruler over the message.
+
+XIM still didn't work correctly on some systems, especially SGI/IRIX. Added
+the 'imdisable' option, which is set by default for that system.
+
+Patch 6.0aw.008
+Problem: When the first character of a file name is over 127, the Buffers
+ menu entry would get a negative priority and cause problems.
+Solution: Reduce the multiplier for the first character when computing
+ the hash value for a Buffers menu entry.
+Files: runtime/menu.vim
+
+Patch 6.0aw.010
+Problem: Win32: ":browse edit dir/dir" didn't work. (Vikas)
+Solution: Change slashes to backslashes in the directory passed to the file
+ browser.
+Files: src/gui_w48.c
+
+Athena file browser: On some systems wcstombs() can't be used to get the
+length of a multi-byte string. Use the maximum length then. (Yasuhiro
+Matsumoto)
+
+Patch 6.0ax.001
+Problem: When 'patchmode' is set, appending to a file gives an empty
+ original file. (Ed Ralston)
+Solution: Also make a backup copy when appending and 'patchmode' is set.
+Files: src/fileio.c
+
+Patch 6.0ax.002
+Problem: When 'patchmode' is set, appending to a compressed file gives an
+ uncompressed original file. (Ed Ralston)
+Solution: Create the original file before decompressing.
+Files: runtime/plugin/gzip.vim
+
+Patch 6.0ax.005
+Problem: Athena file selector keeps the title of the first invocation.
+Solution: Set the title each time the file selector is opened. (David
+ Harrison)
+Files: src/gui_at_fs.c
+
+Patch 6.0ax.007
+Problem: When using GPM (mouse driver in a Linux console) a double click is
+ interpreted as a scroll wheel click.
+Solution: Check if GPM is being used when deciding if a mouse event is for
+ the scroll wheel.
+Files: src/term.c
+
+Patch 6.0ax.010
+Problem: The Edit.Save menu and the Save toolbar button didn't work when
+ the buffer has no file name.
+Solution: Use a file browser to ask for a file name. Also fix the toolbar
+ Find item in Visual mode.
+Files: runtime/menu.vim
+
+Patch 6.0ax.012
+Problem: When 'cpoptions' contains "$", breaking a line for 'textwidth'
+ doesn't redraw properly. (Stefan Schulze)
+Solution: Remove the dollar before breaking the line.
+Files: src/edit.c
+
+Patch 6.0ax.014
+Problem: Win32: On Windows 98 ":make -f file" doesn't work when 'shell' is
+ "command.com" and 'makeprg' is "nmake". The environment isn't
+ passed on to "nmake".
+Solution: Also use vimrun.exe when redirecting the output of a command.
+Files: src/os_win32.c
+
+Patch 6.0ax.016
+Problem: The version number was reported wrong in the intro screen.
+Solution: Check for a version number with two additional letters.
+Files: src/version.c
+
+Patch 6.0ax.019
+Problem: When scrolling a window with folds upwards, switching to another
+ vertically split window and back may not update the scrollbar.
+Solution: Limit w_botline to the number of lines in the buffer plus one.
+Files: src/move.c
+
+
+==============================================================================
+VERSION 6.1 *version-6.1*
+
+This section is about improvements made between version 6.0 and 6.1.
+
+This is a bug-fix release, there are not really any new features.
+
+
+Changed *changed-6.1*
+-------
+
+'iminsert' and 'imsearch' are no longer set as a side effect of defining a
+language-mapping using ":lmap".
+
+
+Added *added-6.1*
+-----
+
+Syntax files:
+ampl AMPL (David Krief)
+ant Ant (Johannes Zellner)
+baan Baan (Her van de Vliert)
+cs C# (Johannes Zellner)
+lifelines Lifelines (Patrick Texier)
+lscript LotusScript (Taryn East)
+moo MOO (Timo Frenay)
+nsis NSIS (Alex Jakushev)
+ppd Postscript Printer Description (Bjoern Jacke)
+rpl RPL/2 (Joel Bertrand)
+scilab Scilab (Benoit Hamelin)
+splint Splint (Ralf Wildenhues)
+sqlj SQLJ (Andreas Fischbach)
+wvdial WvDial (Prahlad Vaidyanathan)
+xf86conf XFree86 config (Nikolai Weibull)
+xmodmap Xmodmap (Nikolai Weibull)
+xslt Xslt (Johannes Zellner)
+monk Monk (Mike Litherland)
+xsd Xsd (Johannes Zellner)
+cdl CDL (Raul Segura Acevedo)
+sendpr Send-pr (Hendrik Scholz)
+
+Added indent file for Scheme. (Dorai Sitaram)
+Added indent file for Prolog. (Kontra Gergely)
+Added indent file for Povray (David Necas)
+Added indent file for IDL (Aleksandar Jelenak)
+Added C# indent and ftplugin scripts.
+
+Added Ukrainian menu translations. (Bohdan Vlasyuk)
+Added ASCII version of the Czech menus. (Jiri Brezina)
+
+Added Simplified Chinese translation of the tutor. (Mendel L Chan)
+
+Added Russian keymap for yawerty keyboard.
+
+Added an explanation of using the vimrc file in the tutor.
+Changed tutor.vim to get the right encoding for the Taiwainese tutor.
+
+Added Russian tutor. (Andrey Kiselev)
+Added Polish tutor. (Mikolaj Machowski)
+
+Added darkblue color scheme. (Bohdan Vlasyuk)
+
+When packing the dos language archive automatically generate the .mo files
+that are required.
+
+Improved NSIS script to support NSIS 180. Added icons for the
+enabled/disabled status. (Mirek Pruchnik)
+
+cp1250 version of the Slovak message translations.
+
+Compiler plugins for IRIX compilers. (David Harrison)
+
+
+Fixed *fixed-6.1*
+-----
+
+The license text was updated to make the meaning clearer and make it
+compatible with the GNU GPL. Otherwise distributors have a problem when
+linking Vim with a GPL'ed library.
+
+When installing the "less.sh" script it was not made executable. (Chuck Berg)
+
+Win32: The "9" key on the numpad wasn't working. (Julian Kinraid)
+
+The NSIS install script didn't work with NSIS 1.80 or later. Also add
+Vim-specific icons. (Pruchnik)
+
+The script for conversion to HTML contained an "if" in the wrong place.
+(Michael Geddes)
+
+Allow using ":ascii" in the sandbox, it's harmless.
+
+Removed creat() from osdef2.h.in, it wasn't used and may cause a problem when
+it's redefined to creat64().
+
+The text files in the VisVim directory were in "dos" format. This caused
+problems when applying a patch. Now keep them in "unix" format and convert
+them to "dos" format only for the PC archives.
+
+Add ruby files to the dos source archive, they can be used by Make_mvc.mak.
+(Mirek Pruchnik)
+
+"cp -f" doesn't work on all systems. Change "cp -f" in the Makefile to "rm
+-f" and "cp".
+
+Didn't compile on a Compaq Tandem Himalaya OSS. (Michael A. Benzinger)
+
+The GTK file selection dialog didn't include the "Create Dir", "Delete File"
+and "Rename File" buttons.
+
+When doing ":browse source" the dialog has the title "Run Macro". Better
+would be "Source Vim script". (Yegappan Lakshmanan)
+
+Win32: Don't use the printer font as default for the font dialog.
+
+"make doslang" didn't work when configure didn't run (yet). Set $MAKEMO to
+"yes". (Mirek Pruchnik)
+
+The ToolBar TagJump item used "g]", which prompts for a selection even when
+there is only one matching tag. Use "g<C-]>" instead.
+
+The ming makefile for message translations didn't have the right list of
+files.
+
+The MS-Windows 3.1 version complains about LIBINTL.DLL not found. Compile
+this version without message translations.
+
+The Borland 5 makefile contained a check for Ruby which is no longer needed.
+The URLs for the TCL library was outdated. (Dan Sharp)
+
+The eviso.ps file was missing from the DOS runtime archive, it's needed for
+printing PostScript in the 32bit DOS version.
+
+In menu files ":scriptencoding" was used in a wrong way after patch 6.1a.032
+Now use ":scriptencoding" in the file where the translations are given. Do
+the same for all menus in latin1 encoding.
+
+Included a lot of fixes for the Macintosh, mostly to make it work with Carbon.
+(Dany StAmant, Axel Kielhorn, Benji Fisher)
+
+Improved the vimtutor shell script to use $TMPDIR when it exists, and delete
+the copied file when exiting in an abnormal way. (Max Ischenko)
+
+When "iconv.dll" can't be found, try using "libiconv.dll".
+
+When encryption is used, filtering with a shell command wasn't possible.
+
+DJGPP: ":cd c:" always failed, can't get permissions for "c:".
+Win32: ":cd c:/" failed if the previous current directory on c: had become
+invalid.
+
+DJGPP: Shift-Del and Del both produce \316\123. Default mapping for Del is
+wrong. Disabled it.
+
+Dependencies on header files in MingW makefile was wrong.
+
+Win32: Don't use ACL stuff for MSVC 4.2, it's not supported. (Walter Briscoe)
+
+Win32 with Borland: bcc.cfg was caching the value for $(BOR), but providing a
+different argument to make didn't regenerate it.
+
+Win32 with MSVC: Make_ivc.mak generates a new if_ole.h in a different
+directory, the if_ole.h in the src directory may be used instead. Delete the
+distributed file.
+
+When a window is vertically split and then ":ball" is used, the window layout
+is messed up, can cause a crash. (Muraoka Taro)
+
+When 'insertmode' is set, using File/New menu and then double clicking, "i" is
+soon inserted. (Merlin Hansen)
+
+When Select mode is active and using the Buffers menu to switch to another
+buffer, an old selection comes back. Reset VIsual_reselect for a ":buffer"
+command.
+
+When Select mode is active and 'insertmode' is set, using the Buffers menu to
+switch to another buffer, did not return to Insert mode. Make sure
+"restart_edit" is set.
+
+When double clicking on the first character of a word while 'selection' is
+"exclusive" didn't select that word.
+
+
+Patch 6.0.001
+Problem: Loading the sh.vim syntax file causes error messages . (Corinna
+ Vinschen)
+Solution: Add an "if". (Charles Campbell)
+Files: runtime/syntax/sh.vim
+
+Patch 6.0.002
+Problem: Using a '@' item in 'viminfo' doesn't work. (Marko Leipert)
+Solution: Add '@' to the list of accepted items.
+Files: src/option.c
+
+Patch 6.0.003
+Problem: The configure check for ACLs on AIX doesn't work.
+Solution: Fix the test program so that it compiles. (Tomas Ogren)
+Files: src/configure.in, src/auto/configure
+
+Patch 6.0.004
+Problem: The find/replace dialog doesn't reuse a previous argument
+ properly.
+Solution: After removing a "\V" terminate the string. (Zwane Mwaikambo)
+Files: src/gui.c
+
+Patch 6.0.005
+Problem: In Insert mode, "CTRL-O :ls" has a delay before redrawing.
+Solution: Don't delay just after wait_return() was called. Added the
+ did_wait_return flag.
+Files: src/globals.h, src/message.c, src/normal.c, src/screen.c
+
+Patch 6.0.006
+Problem: With a vertical split, 'number' set and 'scrolloff' non-zero,
+ making the window width very small causes a crash. (Niklas
+ Lindstrom)
+Solution: Check for a zero width.
+Files: src/move.c
+
+Patch 6.0.007
+Problem: When setting 'filetype' while there is no FileType autocommand, a
+ following ":setfiletype" would set 'filetype' again. (Kobus
+ Retief)
+Solution: Set did_filetype always when 'filetype' has been set.
+Files: src/option.c
+
+Patch 6.0.008
+Problem: 'imdisable' is missing from the options window. (Michael Naumann)
+Solution: Add an entry for it.
+Files: runtime/optwin.vim
+
+Patch 6.0.009
+Problem: Nextstep doesn't have S_ISBLK. (John Beppu)
+Solution: Define S_ISBLK using S_IFBLK.
+Files: src/os_unix.h
+
+Patch 6.0.010
+Problem: Using "gf" on a file name starting with "./" or "../" in a buffer
+ without a name causes a crash. (Roy Lewis)
+Solution: Check for a NULL file name.
+Files: src/misc2.c
+
+Patch 6.0.011
+Problem: Python: After replacing or deleting lines get an ml_get error.
+ (Leo Lipelis)
+Solution: Adjust the cursor position for deleted or added lines.
+Files: src/if_python.c
+
+Patch 6.0.012
+Problem: Polish translations contain printf format errors, this can result
+ in a crash when using one of them.
+Solution: Fix for translated messages. (Michal Politowski)
+Files: src/po/pl.po
+
+Patch 6.0.013
+Problem: Using ":silent! cmd" still gives some error messages, like for an
+ invalid range. (Salman Halim)
+Solution: Reset emsg_silent after calling emsg() in do_one_cmd().
+Files: src/ex_docmd.c
+
+Patch 6.0.014
+Problem: When 'modifiable' is off and 'virtualedit' is "all", "rx" on a TAB
+ still changes the buffer. (Muraoka Taro)
+Solution: Check if saving the line for undo fails.
+Files: src/normal.c
+
+Patch 6.0.015
+Problem: When 'cpoptions' includes "S" and "filetype plugin on" has been
+ used, can get an error for deleting the b:did_ftplugin variable.
+ (Ralph Henderson)
+Solution: Only delete the variable when it exists.
+Files: runtime/ftplugin.vim
+
+Patch 6.0.016
+Problem: bufnr(), bufname() and bufwinnr() don't find unlisted buffers when
+ the argument is a string. (Hari Krishna Dara)
+ Also for setbufvar() and getbufvar().
+Solution: Also find unlisted buffers.
+Files: src/eval.c
+
+Patch 6.0.017
+Problem: When 'ttybuiltin' is set and a builtin termcap entry defines t_Co
+ and the external one doesn't, it gets reset to empty. (David
+ Harrison)
+Solution: Only set t_Co when it wasn't set yet.
+Files: src/term.c
+
+Patch 6.0.018
+Problem: Initializing 'encoding' may cause a crash when setlocale() is not
+ used. (Dany St-Amant)
+Solution: Check for a NULL pointer.
+Files: src/mbyte.c
+
+Patch 6.0.019
+Problem: Converting a string with multi-byte characters to a printable
+ string, e.g., with strtrans(), may cause a crash. (Tomas Zellerin)
+Solution: Correctly compute the length of the result in transstr().
+Files: src/charset.c
+
+Patch 6.0.020
+Problem: When obtaining the value of a global variable internally, could
+ get the function-local value instead. Applies to using <Leader>
+ and <LocalLeader> and resetting highlighting in a function.
+Solution: Prepend "g:" to the variable name. (Aric Blumer)
+Files: src/syntax.c, src/term.c
+
+Patch 6.0.021
+Problem: The 'cscopepathcomp' option didn't work.
+Solution: Change USE_CSCOPE to FEAT_CSCOPE. (Mark Feng)
+Files: src/option.c
+
+Patch 6.0.022
+Problem: When using the 'langmap' option, the second character of a command
+ starting with "g" isn't adjusted.
+Solution: Apply 'langmap' to the second character. (Alex Kapranoff)
+Files: src/normal.c
+
+Patch 6.0.023
+Problem: Loading the lhaskell syntax doesn't work. (Thore B. Karlsen)
+Solution: Use ":runtime" instead of "source" to load haskell.vim.
+Files: runtime/syntax/lhaskell.vim
+
+Patch 6.0.024
+Problem: Using "CTRL-V u 9900" in Insert mode may cause a crash. (Noah
+ Levitt)
+Solution: Don't insert a NUL byte in the text, use a newline.
+Files: src/misc1.c
+
+Patch 6.0.025
+Problem: The pattern "\vx(.|$)" doesn't match "x" at the end of a line.
+ (Preben Peppe Guldberg)
+Solution: Always see a "$" as end-of-line after "\v". Do the same for "^".
+Files: src/regexp.c
+
+Patch 6.0.026
+Problem: GTK: When using arrow keys to navigate through the menus, the
+ separators are selected.
+Solution: Set the separators "insensitive". (Pavel Kankovsky)
+Files: src/gui_gtk.c, src/gui_gtk_x11.c
+
+Patch 6.0.027
+Problem: VMS: Printing doesn't work, the file is deleted too quickly.
+ No longer need the VMS specific printing menu.
+ gethostname() is not available with VAXC.
+ The makefile was lacking selection of the tiny-huge feature set.
+Solution: Adjust the 'printexpr' option default. Fix the other problems and
+ update the documentation. (Zoltan Arpadffy)
+Files: runtime/doc/os_vms.txt, runtime/menu.vim, src/INSTALLvms.txt,
+ src/Make_vms.mms, src/option.c, src/os_unix.c, src/os_vms_conf.h
+
+Patch 6.0.028
+Problem: Can't compile without +virtualedit and with +visualextra. (Geza
+ Lakner)
+Solution: Add an #ifdef for +virtualedit.
+Files: src/ops.c
+
+Patch 6.0.029
+Problem: When making a change in line 1, then in line 2 and then deleting
+ line 1, undo info could be wrong. Only when the changes are undone
+ at once. (Gerhard Hochholzer)
+Solution: When not saving a line for undo because it was already done
+ before, remember for which entry the last line must be computed.
+ Added ue_getbot_entry pointer for this. When the number of lines
+ changes, adjust the position of newer undo entries.
+Files: src/structs.h, src/undo.c
+
+Patch 6.0.030
+Problem: Using ":source! file" doesn't work inside a loop or after
+ ":argdo". (Pavol Juhas)
+Solution: Execute the commands in the file right away, do not let the main
+ loop do it.
+Files: src/ex_cmds2.c, src/ex_docmd.c, src/getchar.c, src/globals.h,
+ src/proto/ex_docmd.pro, src/proto/getchar.pro
+
+Patch 6.0.031
+Problem: Nextstep doesn't have setenv() or putenv(). (John Beppu)
+Solution: Move putenv() from pty.c to misc2.c
+Files: src/misc2.c, src/pty.c
+
+Patch 6.0.032
+Problem: When changing a setting that affects all folds, they are not
+ displayed immediately.
+Solution: Set the redraw flag in foldUpdateAll().
+Files: src/fold.c
+
+Patch 6.0.033
+Problem: Using 'wildmenu' on MS-Windows, file names that include a space
+ are only displayed starting with that space. (Xie Yuheng)
+Solution: Don't recognize a backslash before a space as a path separator.
+Files: src/screen.c
+
+Patch 6.0.034
+Problem: Calling searchpair() with three arguments could result in a crash
+ or strange error message. (Kalle Bjorklid)
+Solution: Don't use the fifth argument when there is no fourth argument.
+Files: src/eval.c
+
+Patch 6.0.035
+Problem: The menu item Edit/Global_Settings/Toggle_Toolbar doesn't work
+ when 'ignorecase' is set. (Allen Castaban)
+Solution: Always match case when checking if a flag is already present in
+ 'guioptions'.
+Files: runtime/menu.vim
+
+Patch 6.0.036
+Problem: OS/2, MS-DOS and MS-Windows: Using a path that starts with a
+ slash in 'tags' doesn't work as expected. (Mathias Koehrer
+Solution: Only use the drive, not the whole path to the current directory.
+ Also make it work for "c:dir/file".
+Files: src/misc2.c
+
+Patch 6.0.037
+Problem: When the user has set "did_install_syntax_menu" to avoid the
+ default Syntax menu it still appears. (Virgilio)
+Solution: Don't add the three default items when "did_install_syntax_menu"
+ is set.
+Files: runtime/menu.vim
+
+Patch 6.0.038
+Problem: When 'selection' is "exclusive", deleting a block of text at the
+ end of a line can leave the cursor beyond the end of the line.
+Solution: Correct the cursor position.
+Files: src/ops.c
+
+Patch 6.0.039
+Problem: "gP" leaves the cursor in the wrong position when 'virtualedit' is
+ used. Using "c" in blockwise Visual mode leaves the cursor in a
+ strange position.
+Solution: For "gP" reset the "coladd" field for the '] mark. For "c" leave
+ the cursor on the last inserted character.
+Files: src/ops.c
+
+Patch 6.0.040
+Problem: When 'fileencoding' is invalid and writing fails because of
+ this, the original file is gone. (Eric Carlier)
+Solution: Restore the original file from the backup.
+Files: src/fileio.c
+
+Patch 6.0.041
+Problem: Using ":language messages en" when LC_MESSAGES is undefined
+ results in setting LC_CTYPE. (Eric Carlier)
+Solution: Set $LC_MESSAGES instead.
+Files: src/ex_cmds2.c
+
+Patch 6.0.042
+Problem: ":mksession" can't handle file names with a space.
+Solution: Escape special characters in file names with a backslash.
+Files: src/ex_docmd.c
+
+Patch 6.0.043
+Problem: Patch 6.0.041 was wrong.
+Solution: Use mch_getenv() instead of vim_getenv().
+Files: src/ex_cmds2.c
+
+Patch 6.0.044
+Problem: Using a "containedin" list for a syntax item doesn't work for an
+ item that doesn't have a "contains" argument. Also, "containedin"
+ doesn't ignore a transparent item. (Timo Frenay)
+Solution: When there is a "containedin" argument somewhere, always check for
+ contained items. Don't check for the transparent item but the
+ item it's contained in.
+Files: src/structs.h, src/syntax.c
+
+Patch 6.0.045
+Problem: After creating a fold with a Visual selection, another window
+ with the same buffer still has inverted text. (Sami Salonen)
+Solution: Redraw the inverted text.
+Files: src/normal.c
+
+Patch 6.0.046
+Problem: When getrlimit() returns an 8 byte number the check for running
+ out of stack may fail. (Anthony Meijer)
+Solution: Skip the stack check if the limit doesn't fit in a long.
+Files: src/auto/configure, src/config.h.in, src/configure.in,
+ src/os_unix.c
+
+Patch 6.0.047
+Problem: Using a regexp with "\(\)" inside a "\%[]" item causes a crash.
+ (Samuel Lacas)
+Solution: Don't allow nested atoms inside "\%[]".
+Files: src/regexp.c
+
+Patch 6.0.048
+Problem: Win32: In the console the mouse doesn't always work correctly.
+ Sometimes after getting focus a mouse movement is interpreted like
+ a button click.
+Solution: Use a different function to obtain the number of mouse buttons.
+ Avoid recognizing a button press from undefined bits. (Vince Negri)
+Files: src/os_win32.c
+
+Patch 6.0.049
+Problem: When using evim the intro screen is misleading. (Adrian Nagle)
+Solution: Mention whether 'insertmode' is set and the menus to be used.
+Files: runtime/menu.vim, src/version.c
+
+Patch 6.0.050
+Problem: UTF-8: "viw" doesn't include non-ASCII characters before the
+ cursor. (Bertilo Wennergren)
+Solution: Use dec_cursor() instead of decrementing the column number.
+Files: src/search.c
+
+Patch 6.0.051
+Problem: UTF-8: Using CTRL-R on the command line doesn't insert composing
+ characters. (Ron Aaron)
+Solution: Also include the composing characters and fix redrawing them.
+Files: src/ex_getln.c, src/ops.c
+
+Patch 6.0.052
+Problem: The check for rlim_t in patch 6.0.046 does not work on some
+ systems. (Zdenek Sekera)
+Solution: Also look in sys/resource.h for rlim_t.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.0.053 (extra)
+Problem: Various problems with QNX.
+Solution: Minor fix for configure. Switch on terminal clipboard support in
+ main.c. Fix "pterm" mouse support. os_qnx.c didn't build without
+ photon. (Julian Kinraid)
+Files: src/auto/configure, src/configure.in, src/gui_photon.c,
+ src/main.c, src/misc2.c, src/option.h, src/os_qnx.c, src/os_qnx.h,
+ src/syntax.c
+
+Patch 6.0.054
+Problem: When using mswin.vim, CTRL-V pastes a block of text like it is
+ normal text. Using CTRL-V in blockwise Visual mode leaves "x"
+ characters behind.
+Solution: Make CTRL-V work as it should. Do the same for the Paste menu
+ entries.
+Files: runtime/menu.vim, runtime/mswin.vim
+
+Patch 6.0.055
+Problem: GTK: The selection isn't copied the first time.
+Solution: Own the selection at the right moment.
+Files: src/gui_gtk_x11.c
+
+Patch 6.0.056
+Problem: Using "CTRL-O cw" in Insert mode results in a nested Insert mode.
+ <Esc> doesn't leave Insert mode then.
+Solution: Only use nested Insert mode when 'insertmode' is set or when a
+ mapping is used.
+Files: src/normal.c
+
+Patch 6.0.057
+Problem: Using ":wincmd g}" in a function doesn't work. (Gary Holloway)
+Solution: Execute the command directly, instead of putting it in the
+ typeahead buffer.
+Files: src/normal.c, src/proto/normal.pro, src/window.c
+
+Patch 6.0.058
+Problem: When a Cursorhold autocommand moved the cursor, the ruler wasn't
+ updated. (Bohdan Vlasyuk)
+Solution: Update the ruler after executing the autocommands.
+Files: src/gui.c
+
+Patch 6.0.059
+Problem: Highlighting for 'hlsearch' isn't visible in lines that are
+ highlighted for diff highlighting. (Gary Holloway)
+Solution: Let 'hlsearch' highlighting overrule diff highlighting.
+Files: src/screen.c
+
+Patch 6.0.060
+Problem: Motif: When the tooltip is to be popped up, Vim crashes.
+ (Gary Holloway)
+Solution: Check for a NULL return value from gui_motif_fontset2fontlist().
+Files: src/gui_beval.c
+
+Patch 6.0.061
+Problem: The toolbar buttons to load and save a session do not correctly
+ use v:this_session.
+Solution: Check for v:this_session to be empty instead of existing.
+Files: runtime/menu.vim
+
+Patch 6.0.062
+Problem: Crash when 'verbose' is > 3 and using ":shell". (Yegappan
+ Lakshmanan)
+Solution: Avoid giving a NULL pointer to printf(). Also output a newline
+ and switch the cursor on.
+Files: src/misc2.c
+
+Patch 6.0.063
+Problem: When 'cpoptions' includes "$", using "cw" to type a ')' on top of
+ the "$" doesn't update syntax highlighting after it.
+Solution: Stop displaying the "$" when typing a ')' in its position.
+Files: src/search.c
+
+Patch 6.0.064 (extra)
+Problem: The NSIS install script doesn't work with newer versions of NSIS.
+ The diff feature doesn't work when there isn't a good diff.exe on
+ the system.
+Solution: Replace the GetParentDir instruction by a user function.
+ Fix a few cosmetic problems. Use defined constants for the
+ version number, so that it's defined in one place only.
+ Only accept the install directory when it ends in "vim".
+ (Eduardo Fernandez)
+ Add a diff.exe and use it from the default _vimrc.
+Files: nsis/gvim.nsi, nsis/README.txt, src/dosinst.c
+
+Patch 6.0.065
+Problem: When using ":normal" in 'indentexpr' it may use redo characters
+ before its argument. (Neil Bird)
+Solution: Save and restore the stuff buffer in ex_normal().
+Files: src/ex_docmd.c, src/getchar.c, src/globals.h, src/structs.h
+
+Patch 6.0.066
+Problem: Sometimes undo for one command is split into two undo actions.
+ (Halim Salman)
+Solution: Don't set the undo-synced flag when reusing a line that was
+ already saved for undo.
+Files: src/undo.c
+
+Patch 6.0.067
+Problem: if_xcmdsrv.c doesn't compile on systems where fd_set isn't defined
+ in the usual header file (e.g., AIX). (Mark Waggoner)
+Solution: Include sys/select.h in if_xcmdsrv.c for systems that have it.
+Files: src/if_xcmdsrv.c
+
+Patch 6.0.068
+Problem: When formatting a Visually selected area with "gq" and the number
+ of lines increases the last line may not be redrawn correctly.
+ (Yegappan Lakshmanan)
+Solution: Correct the area to be redrawn for inserted/deleted lines.
+Files: src/ops.c
+
+Patch 6.0.069
+Problem: Using "K" on a word that includes a "!" causes a "No previous
+ command" error, because the "!" is expanded. (Craig Jeffries)
+Solution: Put a backslash before the "!".
+Files: src/normal.c
+
+Patch 6.0.070
+Problem: Win32: The error message for a failed dynamic linking of a Perl,
+ Ruby, Tcl and Python library is unclear about what went wrong.
+Solution: Give the name of the library or function that could not be loaded.
+ Also for the iconv and gettext libraries when 'verbose' is set.
+Files: src/eval.c, src/if_perl.xs, src/if_python.c, src/if_ruby.c,
+ src/if_tcl.c, src/mbyte.c, src/os_win32.c, src/proto/if_perl.pro,
+ src/proto/if_python.pro, src/proto/if_ruby.pro,
+ src/proto/if_tcl.pro, src/proto/mbyte.pro
+
+Patch 6.0.071
+Problem: The "iris-ansi" builtin termcap isn't very good.
+Solution: Fix the wrong entries. (David Harrison)
+Files: src/term.c
+
+Patch 6.0.072
+Problem: When 'lazyredraw' is set, a mapping that stops Visual mode, moves
+ the cursor and starts Visual mode again causes a redraw problem.
+ (Brian Silverman)
+Solution: Redraw both the old and the new Visual area when necessary.
+Files: src/normal.c, src/screen.c
+
+Patch 6.0.073 (extra)
+Problem: DJGPP: When using CTRL-Z to start a shell, the prompt is halfway
+ the text. (Volker Kiefel)
+Solution: Position the system cursor before starting the shell.
+Files: src/os_msdos.c
+
+Patch 6.0.074
+Problem: When using "&" in a substitute string a multi-byte character with
+ a trailbyte 0x5c is not handled correctly.
+Solution: Recognize multi-byte characters inside the "&" part. (Muraoka Taro)
+Files: src/regexp.c
+
+Patch 6.0.075
+Problem: When closing a horizontally split window while 'eadirection' is
+ "hor" another horizontally split window is still resized. (Aron
+ Griffis)
+Solution: Only resize windows in the same top frame as the window that is
+ split or closed.
+Files: src/main.c, src/proto/window.pro, src/window.c
+
+Patch 6.0.076
+Problem: Warning for wrong pointer type when compiling.
+Solution: Use char instead of char_u pointer.
+Files: src/version.c
+
+Patch 6.0.077
+Problem: Patch 6.0.075 was incomplete.
+Solution: Fix another call to win_equal().
+Files: src/option.c
+
+Patch 6.0.078
+Problem: Using "daw" at the end of a line on a single-character word didn't
+ include the white space before it. At the end of the file it
+ didn't work at all. (Gavin Sinclair)
+Solution: Include the white space before the word.
+Files: src/search.c
+
+Patch 6.0.079
+Problem: When "W" is in 'cpoptions' and 'backupcopy' is "no" or "auto", can
+ still overwrite a read-only file, because it's renamed. (Gary
+ Holloway)
+Solution: Add a check for a read-only file before renaming the file to
+ become the backup.
+Files: src/fileio.c
+
+Patch 6.0.080
+Problem: When using a session file that has the same file in two windows,
+ the fileinfo() call in do_ecmd() causes a scroll and a hit-enter
+ prompt. (Robert Webb)
+Solution: Don't scroll this message when 'shortmess' contains 'O'.
+Files: src/ex_cmds.c
+
+Patch 6.0.081
+Problem: After using ":saveas" the new buffer name is added to the Buffers
+ menu with a wrong number. (Chauk-Mean Proum)
+Solution: Trigger BufFilePre and BufFilePost events for the renamed buffer
+ and BufAdd for the old name (which is with a new buffer).
+Files: src/ex_cmds.c
+
+Patch 6.0.082
+Problem: When swapping screens in an xterm and there is an (error) message
+ from the vimrc script, the shell prompt is after the message.
+Solution: Output a newline when there was output on the alternate screen.
+ Also when starting the GUI.
+Files: src/main.c
+
+Patch 6.0.083
+Problem: GTK: When compiled without menu support the buttons in a dialog
+ don't have any text. (Erik Edelmann)
+Solution: Add the text also when GTK_USE_ACCEL isn't defined. And define
+ GTK_USE_ACCEL also when not using menus.
+Files: src/gui_gtk.c
+
+Patch 6.0.084
+Problem: UTF-8: a "r" command with an argument that is a keymap for a
+ character with a composing character can't be repeated with ".".
+ (Raphael Finkel)
+Solution: Add the composing characters to the redo buffer.
+Files: src/normal.c
+
+Patch 6.0.085
+Problem: When 'mousefocus' is set, using "s" to go to Insert mode and then
+ moving the mouse pointer to another window stops Insert mode,
+ while this doesn't happen with "a" or "i". (Robert Webb)
+Solution: Reset finish_op before calling edit().
+Files: src/normal.c
+
+Patch 6.0.086
+Problem: When using "gu" the message says "~ed".
+Solution: Make the message say "changed".
+Files: src/ops.c
+
+Patch 6.0.087 (lang)
+Problem: Message translations are incorrect, which may cause a crash.
+ (Peter Figura)
+ The Turkish translations needed more work and the maintainer
+ didn't have time.
+Solution: Fix order of printf arguments. Remove %2$d constructs.
+ Add "-v" to msgfmt to get a warning for wrong translations.
+ Don't install the Turkish translations for now.
+ Update a few more translations.
+Files: src/po/Makefile, src/po/af.po, src/po/cs.po, src/po/cs.cp1250.po,
+ src/po/de.po, src/po/es.po, src/po/fr.po, src/po/it.po,
+ src/po/ja.po, src/po/ja.sjis.po, src/po/ko.po, src/po/pl.po,
+ src/po/sk.po, src/po/uk.po, src/po/zh_CN.UTF-8.po,
+ src/po/zh_CN.cp936.po, src/po/zh_CN.po, src/po/zh_TW.po
+
+Patch 6.0.088
+Problem: "." doesn't work after using "rx" in Visual mode. (Charles
+ Campbell)
+Solution: Also store the replacement character in the redo buffer.
+Files: src/normal.c
+
+Patch 6.0.089
+Problem: In a C file, using "==" to align a line starting with "* " after
+ a line with "* -" indents one space too few. (Piet Delport)
+Solution: Align with the previous line if the comment-start-string matches
+ there.
+Files: src/misc1.c
+
+Patch 6.0.090
+Problem: When a wrapping line does not fit in a window and 'scrolloff' is
+ bigger than half the window height, moving the cursor left or
+ right causes the screen to flash badly. (Lubomir Host)
+Solution: When there is not enough room to show 'scrolloff' screen lines and
+ near the end of the line, show the end of the line.
+Files: src/move.c
+
+Patch 6.0.091
+Problem: Using CTRL-O in Insert mode, while 'virtualedit' is "all" and the
+ cursor is after the end-of-line, moves the cursor left. (Yegappan
+ Lakshmanan)
+Solution: Keep the cursor in the same position.
+Files: src/edit.c
+
+Patch 6.0.092
+Problem: The explorer plugin doesn't ignore case of 'suffixes' on
+ MS-Windows. (Mike Williams)
+Solution: Match or ignore case as appropriate for the OS.
+Files: runtime/plugin/explorer.vim
+
+Patch 6.0.093
+Problem: When the Tcl library couldn't be loaded dynamically, get an error
+ message when closing a buffer or window. (Muraoka Taro)
+Solution: Only free structures if already using the Tcl interpreter.
+Files: src/if_tcl.c
+
+Patch 6.0.094
+Problem: Athena: When clicking in the horizontal scrollbar Vim crashes.
+ (Paul Ackersviller)
+Solution: Use the thumb size instead of the window pointer of the scrollbar
+ (which is NULL). (David Harrison)
+ Also avoid that scrolling goes the wrong way in a narrow window.
+Files: src/gui_athena.c
+
+Patch 6.0.095
+Problem: Perl: Deleting lines may leave the cursor beyond the end of the
+ file.
+Solution: Check the cursor position after deleting a line. (Serguei)
+Files: src/if_perl.xs
+
+Patch 6.0.096
+Problem: When ":saveas fname" fails because the file already exists, the
+ file name is changed anyway and a following ":w" will overwrite
+ the file. (Eric Carlier)
+Solution: Don't change the file name if the file already exists.
+Files: src/ex_cmds.c
+
+Patch 6.0.097
+Problem: Re-indenting in Insert mode with CTRL-F may cause a crash with a
+ multi-byte encoding.
+Solution: Avoid using a character before the start of a line. (Sergey
+ Vlasov)
+Files: src/edit.c
+
+Patch 6.0.098
+Problem: GTK: When using Gnome the "Search" and "Search and Replace" dialog
+ boxes are not translated.
+Solution: Define ENABLE_NLS before including gnome.h. (Eduardo Fernandez)
+Files: src/gui_gtk.c, src/gui_gtk_x11.c
+
+Patch 6.0.099
+Problem: Cygwin: When running Vi compatible MS-DOS line endings cause
+ trouble.
+Solution: Make the default for 'fileformats' "unix,dos" in Vi compatible
+ mode. (Michael Schaap)
+Files: src/option.h
+
+Patch 6.0.100
+Problem: ":badd +0 test%file" causes a crash.
+Solution: Take into account that the "+0" is NUL terminated when allocating
+ room for replacing the "%".
+Files: src/ex_docmd.c
+
+Patch 6.0.101
+Problem: ":mksession" doesn't restore editing a file that has a '#' or '%'
+ in its name. (Wolfgang Blankenburg)
+Solution: Put a backslash before the '#' and '%'.
+Files: src/ex_docmd.c
+
+Patch 6.0.102
+Problem: When changing folds the cursor may appear halfway a closed fold.
+ (Nam SungHyun)
+Solution: Set w_cline_folded correctly. (Yasuhiro Matsumoto)
+Files: src/move.c
+
+Patch 6.0.103
+Problem: When using 'scrollbind' a large value of 'scrolloff' will make the
+ scroll binding stop near the end of the file. (Coen Engelbarts)
+Solution: Don't use 'scrolloff' when limiting the topline for scroll
+ binding. (Dany StAmant)
+Files: src/normal.c
+
+Patch 6.0.104
+Problem: Multi-byte: When '$' is in 'cpoptions', typing a double-wide
+ character that overwrites the left halve of an old double-wide
+ character causes a redraw problem and the cursor stops blinking.
+Solution: Clear the right half of the old character. (Yasuhiro Matsumoto)
+Files: src/edit.c, src/screen.c
+
+Patch 6.0.105
+Problem: Multi-byte: In a window of one column wide, with syntax
+ highlighting enabled a crash might happen.
+Solution: Skip getting the syntax attribute when the character doesn't fit
+ anyway. (Yasuhiro Matsumoto)
+Files: src/screen.c
+
+Patch 6.0.106 (extra)
+Problem: Win32: When the printer font is wrong, there is no error message.
+Solution: Give an appropriate error message. (Yasuhiro Matsumoto)
+Files: src/os_mswin.c
+
+Patch 6.0.107 (extra)
+Problem: VisVim: When editing another file, a modified file may be written
+ unexpectedly and without warning.
+Solution: Split the window if a file was modified.
+Files: VisVim/Commands.cpp
+
+Patch 6.0.108
+Problem: When using folding could try displaying line zero, resulting in an
+ error for a NULL pointer.
+Solution: Stop decrementing w_topline when the first line of a window is in
+ a closed fold.
+Files: src/window.c
+
+Patch 6.0.109
+Problem: XIM: When the input method is enabled, repeating an insertion with
+ "." disables it. (Marcel Svitalsky)
+Solution: Don't store the input method status when a command comes from the
+ stuff buffer.
+Files: src/ui.c
+
+Patch 6.0.110
+Problem: Using undo after executing "OxjAxkdd" from a register in
+ an empty buffer gives an error message. (Gerhard Hochholzer)
+Solution: Don't adjust the bottom line number of an undo block when it's
+ zero. Add a test for this problem.
+Files: src/undo.c, src/testdir/test20.in, src/testdir/test20.ok
+
+Patch 6.0.111
+Problem: The virtcol() function doesn't take care of 'virtualedit'.
+Solution: Add the column offset when needed. (Yegappan Lakshmanan)
+Files: src/eval.c
+
+Patch 6.0.112
+Problem: The explorer plugin doesn't sort directories with a space or
+ special character after a directory with a shorter name.
+Solution: Ignore the trailing slash when comparing directory names. (Mike
+ Williams)
+Files: runtime/plugin/explorer.vim
+
+Patch 6.0.113
+Problem: ":edit ~/fname" doesn't work if $HOME includes a space. Also,
+ expanding wildcards with the shell may fail. (John Daniel)
+Solution: Escape spaces with a backslash when needed.
+Files: src/ex_docmd.c, src/misc1.c, src/proto/misc1.pro, src/os_unix.c
+
+Patch 6.0.114
+Problem: Using ":p" with fnamemodify() didn't expand "~/" or "~user/" to a
+ full path. For Win32 the current directory was prepended.
+ (Michael Geddes)
+Solution: Expand the home directory.
+Files: src/eval.c
+
+Patch 6.0.115 (extra)
+Problem: Win32: When using a dialog with a textfield it cannot scroll the
+ text.
+Solution: Add ES_AUTOHSCROLL to the textfield style. (Pedro Gomes)
+Files: src/gui_w32.c
+
+Patch 6.0.116 (extra)
+Problem: MS-Windows NT/2000/XP: filewritable() doesn't work correctly for
+ filesystems that use ACLs.
+Solution: Use ACL functions to check if a file is writable. (Mike Williams)
+Files: src/eval.c, src/macros.h, src/os_win32.c, src/proto/os_win32.pro
+
+Patch 6.0.117 (extra)
+Problem: Win32: when disabling the menu, "set lines=999" doesn't use all
+ the available screen space.
+Solution: Don't subtract the fixed caption height but the real menu height
+ from the available screen space. Also: Avoid recursion in
+ gui_mswin_get_menu_height().
+Files: src/gui_w32.c, src/gui_w48.c
+
+Patch 6.0.118
+Problem: When $TMPDIR is a relative path, the temp directory is missing a
+ trailing slash and isn't deleted when Vim exits. (Peter Holm)
+Solution: Add the slash after expanding the directory to an absolute path.
+Files: src/fileio.c
+
+Patch 6.0.119 (depends on patch 6.0.116)
+Problem: VMS: filewritable() doesn't work properly.
+Solution: Use the same method as for Unix. (Zoltan Arpadffy)
+Files: src/eval.c
+
+Patch 6.0.120
+Problem: The conversion to html isn't compatible with XHTML.
+Solution: Quote the values. (Jess Thrysoee)
+Files: runtime/syntax/2html.vim
+
+Patch 6.0.121 (extra) (depends on patch 6.0.116)
+Problem: Win32: After patch 6.0.116 Vim doesn't compile with mingw32.
+Solution: Add an #ifdef HAVE_ACL.
+Files: src/os_win32.c
+
+Patch 6.0.122 (extra)
+Problem: Win16: Same resize problems as patch 6.0.117 fixed for Win32. And
+ dialog textfield problem from patch 6.0.115.
+Solution: Set old_menu_height only when used. Add ES_AUTOHSCROLL flag.
+ (Vince Negri)
+Files: src/gui_w16.c
+
+Patch 6.0.123 (depends on patch 6.0.119)
+Problem: Win16: Compilation problems.
+Solution: Move "&&" to other lines. (Vince Negri)
+Files: src/eval.c
+
+Patch 6.0.124
+Problem: When using a ":substitute" command that starts with "\="
+ (evaluated as an expression), "~" was still replaced with the
+ previous substitute string.
+Solution: Skip the replacement when the substitute string starts with "\=".
+ Also adjust the documentation about doubling backslashes.
+Files: src/ex_cmds.c, runtime/doc/change.txt
+
+Patch 6.0.125 (extra)
+Problem: Win32: When using the multi_byte_ime feature pressing the shift
+ key would be handled as if a character was entered, thus mappings
+ with a shifted key didn't work. (Charles Campbell)
+Solution: Ignore pressing the shift, control and alt keys.
+Files: src/os_win32.c
+
+Patch 6.0.126
+Problem: The python library was always statically linked.
+Solution: Link the python library dynamically. (Matthias Klose)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.0.127
+Problem: When using a terminal that swaps screens and the Normal background
+ color has a different background, using an external command may
+ cause the color of the wrong screen to be changed. (Mark Waggoner)
+Solution: Don't call screen_stop_highlight() in stoptermcap().
+Files: src/term.c
+
+Patch 6.0.128
+Problem: When moving a vertically split window to the far left or right,
+ the scrollbars are not adjusted. (Scott E Lee) When 'mousefocus'
+ is set the mouse pointer wasn't adjusted.
+Solution: Adjust the scrollbars and the mouse pointer.
+Files: src/window.c
+
+Patch 6.0.129
+Problem: When using a very long file name, ":ls" (repeated a few times)
+ causes a crash. Test with "vim `perl -e 'print "A"x1000'`".
+ (Tejeda)
+Solution: Terminate a string before getting its length in buflist_list().
+Files: src/buffer.c
+
+Patch 6.0.130
+Problem: When using ":cprev" while the error window is open, and the new
+ line at the top wraps, the window isn't correctly drawn.
+ (Yegappan Lakshmanan)
+Solution: When redrawing the topline don't scroll twice.
+Files: src/screen.c
+
+Patch 6.0.131
+Problem: When using bufname() and there are two matches for listed buffers
+ and one match for an unlisted buffer, the unlisted buffer is used.
+ (Aric Blumer)
+Solution: When there is a match with a listed buffer, don't check for
+ unlisted buffers.
+Files: src/buffer.c
+
+Patch 6.0.132
+Problem: When setting 'iminsert' in the vimrc and using an xterm with two
+ screens the ruler is drawn in the wrong screen. (Igor Goldenberg)
+Solution: Only draw the ruler when using the right screen.
+Files: src/option.c
+
+Patch 6.0.133
+Problem: When opening another buffer while 'keymap' is set and 'iminsert'
+ is zero, 'iminsert' is set to one unexpectedly. (Igor Goldenberg)
+Solution: Don't set 'iminsert' as a side effect of defining a ":lmap"
+ mapping. Only do that when 'keymap' is set.
+Files: src/getchar.c, src/option.c
+
+Patch 6.0.134
+Problem: When completing ":set tags=" a path with an embedded space causes
+ the completion to stop. (Sektor van Skijlen)
+Solution: Escape spaces with backslashes, like for ":set path=". Also take
+ backslashes into account when searching for the start of the path
+ to complete (e.g., for 'backupdir' and 'cscopeprg').
+Files: src/ex_docmd.c, src/ex_getln.c, src/option.c, src/structs.h
+
+Patch 6.0.135
+Problem: Menus that are not supposed to do anything used "<Nul>", which
+ still produced an error beep.
+ When CTRL-O is mapped for Insert mode, ":amenu" commands didn't
+ work in Insert mode.
+ Menu language falls back to English when $LANG ends in "@euro".
+Solution: Use "<Nop>" for a menu item that doesn't do anything, just like
+ mappings.
+ Use ":anoremenu" instead of ":amenu".
+ Ignore "@euro" in the locale name.
+Files: runtime/makemenu.vim, runtime/menu.vim, src/menu.c
+
+Patch 6.0.136
+Problem: When completing in Insert mode, a mapping could be unexpectedly
+ applied.
+Solution: Don't use mappings when checking for a typed character.
+Files: src/edit.c
+
+Patch 6.0.137
+Problem: GUI: When using the find or find/replace dialog from Insert mode,
+ the input mode is stopped.
+Solution: Don't use the input method status when the main window doesn't
+ have focus.
+Files: src/ui.c
+
+Patch 6.0.138
+Problem: GUI: When using the find or find/replace dialog from Insert mode,
+ the text is inserted when CTRL-O is mapped. (Andre Pang)
+ When opening the dialog again, a whole word search isn't
+ recognized.
+ When doing "replace all" a whole word search was never done.
+Solution: Don't put a search or replace command in the input buffer,
+ execute it directly.
+ Recognize "\<" and "\>" after removing "\V".
+ Add "\<" and "\>" also for "replace all".
+Files: src/gui.c
+
+Patch 6.0.139
+Problem: When stopping 'wildmenu' completion, the statusline of the
+ bottom-left vertically split window isn't redrawn. (Yegappan
+ Lakshmanan)
+Solution: Redraw all the bottom statuslines.
+Files: src/ex_getln.c, src/proto/screen.pro, src/screen.c
+
+Patch 6.0.140
+Problem: Memory allocated for local mappings and abbreviations is leaked
+ when the buffer is wiped out.
+Solution: Clear the local mappings when deleting a buffer.
+Files: src/buffer.c, src/getchar.c, src/proto/getchar.pro, src/vim.h
+
+Patch 6.0.141
+Problem: When using ":enew" in an empty buffer, some buffer-local things
+ are not cleared. b:keymap_name is not set.
+Solution: Clear user commands and mappings local to the buffer when re-using
+ the current buffer. Reload the keymap.
+Files: src/buffer.c
+
+Patch 6.0.142
+Problem: When Python is linked statically, loading dynamic extensions might
+ fail.
+Solution: Add an extra linking flag when needed. (Andrew Rodionoff)
+Files: src/configure.in, src/auto/configure
+
+Patch 6.0.143
+Problem: When a syntax item includes a line break in a pattern, the syntax
+ may not be updated properly when making a change.
+Solution: Add the "linebreaks" argument to ":syn sync".
+Files: runtime/doc/syntax.txt, src/screen.c, src/structs.h, src/syntax.c
+
+Patch 6.0.144
+Problem: After patch 6.0.088 redoing "veU" doesn't work.
+Solution: Don't add the "U" to the redo buffer, it will be used as an undo
+ command.
+Files: src/normal.c
+
+Patch 6.0.145
+Problem: When Vim can't read any input it might get stuck. When
+ redirecting stdin and stderr Vim would not read commands from a
+ file. (Servatius Brandt)
+Solution: When repeatedly trying to read a character when it's not possible,
+ exit Vim. When stdin and stderr are not a tty, still try reading
+ from them, but don't do a blocking wait.
+Files: src/ui.c
+
+Patch 6.0.146
+Problem: When 'statusline' contains "%{'-'}" this results in a zero.
+ (Milan Vancura)
+Solution: Don't handle numbers with a minus as a number, they were not
+ displayed anyway.
+Files: src/buffer.c
+
+Patch 6.0.147
+Problem: It's not easy to mark a Vim version as being modified. The new
+ license requires this.
+Solution: Add the --modified-by argument to configure and the MODIFIED_BY
+ define. I's used in the intro screen and the ":version" output.
+Files: src/auto/configure, src/configure.in, src/config.h.in,
+ src/feature.h, src/version.c
+
+Patch 6.0.148
+Problem: After "p" in an empty line, `[ goes to the second character.
+ (Kontra Gergely)
+Solution: Don't increment the column number in an empty line.
+Files: src/ops.c
+
+Patch 6.0.149
+Problem: The pattern "\(.\{-}\)*" causes a hang. When using a search
+ pattern that causes a stack overflow to be detected Vim could
+ still hang.
+Solution: Correctly report "operand could be empty" when using "\{-}".
+ Check for "out_of_stack" inside loops to avoid a hang.
+Files: src/regexp.c
+
+Patch 6.0.150
+Problem: When using a multi-byte encoding, patch 6.0.148 causes "p" to work
+ like "P". (Sung-Hyun Nam)
+Solution: Compute the byte length of a multi-byte character.
+Files: src/ops.c
+
+Patch 6.0.151
+Problem: Redrawing the status line and ruler can be wrong when it contains
+ multi-byte characters.
+Solution: Use character width and byte length correctly. (Yasuhiro Matsumoto)
+Files: src/screen.c
+
+Patch 6.0.152
+Problem: strtrans() could hang on an illegal UTF-8 byte sequence.
+Solution: Skip over illegal bytes. (Yasuhiro Matsumoto)
+Files: src/charset.c
+
+Patch 6.0.153
+Problem: When using (illegal) double-byte characters and Vim syntax
+ highlighting Vim can crash. (Yasuhiro Matsumoto)
+Solution: Increase a pointer over a character instead of a byte.
+Files: src/regexp.c
+
+Patch 6.0.154
+Problem: MS-DOS and MS-Windows: The menu entries for xxd don't work when
+ there is no xxd in the path.
+ When converting back from Hex the filetype may remain "xxd" if it
+ is not detected.
+Solution: When xxd is not in the path use the one in the runtime directory,
+ where the install program has put it.
+ Clear the 'filetype' option before detecting the new value.
+Files: runtime/menu.vim
+
+Patch 6.0.155
+Problem: Mac: compilation problems in ui.c after patch 6.0.145. (Axel
+ Kielhorn)
+Solution: Don't call mch_inchar() when NO_CONSOLE is defined.
+Files: src/ui.c
+
+Patch 6.0.156
+Problem: Starting Vim with the -b argument and two files, ":next" doesn't
+ set 'binary' in the second file, like Vim 5.7. (Norman Diamond)
+Solution: Set the global value for 'binary'.
+Files: src/option.c
+
+Patch 6.0.157
+Problem: When defining a user command with "-complete=dir" files will also
+ be expanded. Also, "-complete=mapping" doesn't appear to work.
+ (Michael Naumann)
+Solution: Use the expansion flags defined with the user command.
+ Handle expanding mappings specifically.
+Files: src/ex_docmd.c
+
+Patch 6.0.158
+Problem: When getting the warning for a file being changed outside of Vim
+ and reloading the file, the 'readonly' option is reset, even when
+ the permissions didn't change. (Marcel Svitalsky)
+Solution: Keep 'readonly' set when reloading a file and the permissions
+ didn't change.
+Files: src/fileio.c
+
+Patch 6.0.159
+Problem: Wildcard expansion for ":emenu" also shows separators.
+Solution: Skip menu separators for ":emenu", ":popup" and ":tearoff".
+ Also, don't handle ":tmenu" as if it was ":tearoff". And leave
+ out the alternatives with "&" included.
+Files: src/menu.c
+
+Patch 6.0.160
+Problem: When compiling with GCC 3.0.2 and using the "-O2" argument, the
+ optimizer causes a problem that makes Vim crash.
+Solution: Add a configure check to avoid "-O2" for this version of gcc.
+Files: src/configure.in, src/auto/configure
+
+Patch 6.0.161 (extra)
+Problem: Win32: Bitmaps don't work with signs.
+Solution: Make it possible to use bitmaps with signs. (Muraoka Taro)
+Files: src/ex_cmds.c, src/feature.h, src/gui_w32.c, src/gui_x11.c,
+ src/proto/gui_w32.pro, src/proto/gui_x11.pro
+
+Patch 6.0.162
+Problem: Client-server: An error message for a wrong expression appears in
+ the server instead of the client.
+Solution: Pass the error message from the server to the client. Also
+ adjust the example code. (Flemming Madsen)
+Files: src/globals.h, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c,
+ src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro,
+ runtime/doc/eval.txt, runtime/tools/xcmdsrv_client.c
+
+Patch 6.0.163
+Problem: When using a GUI dialog, a file name is sometimes used like it was
+ a directory.
+Solution: Separate path and file name properly.
+ For GTK, Motif and Athena concatenate directory and file name for
+ the default selection.
+Files: src/diff.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
+ src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c, src/message.c
+
+Patch 6.0.164
+Problem: After patch 6.0.135 the menu entries for pasting don't work in
+ Insert and Visual mode. (Muraoka Taro)
+Solution: Add <script> to allow script-local mappings.
+Files: runtime/menu.vim
+
+Patch 6.0.165
+Problem: Using --remote and executing locally gives unavoidable error
+ messages.
+Solution: Add --remote-silent and --remote-wait-silent to silently execute
+ locally.
+ For Win32 there was no error message when a server didn't exist.
+Files: src/eval.c, src/if_xcmdsrv.c, src/main.c, src/os_mswin.c,
+ src/proto/if_xcmdsrv.pro, src/proto/os_mswin.pro
+
+Patch 6.0.166
+Problem: GUI: There is no way to avoid dialogs to pop up.
+Solution: Add the 'c' flag to 'guioptions': Use console dialogs. (Yegappan
+ Lakshmanan)
+Files: runtime/doc/options.txt, src/option.h, src/message.c
+
+Patch 6.0.167
+Problem: When 'fileencodings' is "latin2" some characters in the help files
+ are displayed wrong.
+Solution: Force the 'fileencoding' for the help files to be "latin1".
+Files: src/fileio.c
+
+Patch 6.0.168
+Problem: ":%s/\n/#/" doesn't replace at an empty line. (Bruce DeVisser)
+Solution: Don't skip matches after joining two lines.
+Files: src/ex_cmds.c
+
+Patch 6.0.169
+Problem: When run as evim and the GUI can't be started we get stuck in a
+ terminal without menus in Insert mode.
+Solution: Exit when using "evim" and "gvim -y" when the GUI can't be
+ started.
+Files: src/main.c
+
+Patch 6.0.170
+Problem: When printing double-width characters the size of tabs after them
+ is wrong. (Muraoka Taro)
+Solution: Correctly compute the column after a double-width character.
+Files: src/ex_cmds2.c
+
+Patch 6.0.171
+Problem: With 'keymodel' including "startsel", in Insert mode after the end
+ of a line, shift-Left does not move the cursor. (Steve Hall)
+Solution: CTRL-O doesn't move the cursor left, need to do that explicitly.
+Files: src/edit.c
+
+Patch 6.0.172
+Problem: CTRL-Q doesn't replace CTRL-V after CTRL-X in Insert mode while it
+ does in most other situations.
+Solution: Make CTRL-X CTRL-Q work like CTRL-X CTRL-V in Insert mode.
+Files: src/edit.c
+
+Patch 6.0.173
+Problem: When using "P" to insert a line break the cursor remains past the
+ end of the line.
+Solution: Check for the cursor being beyond the end of the line.
+Files: src/ops.c
+
+Patch 6.0.174
+Problem: After using "gd" or "gD" the search direction for "n" may still be
+ backwards. (Servatius Brandt)
+Solution: Reset the search direction to forward.
+Files: src/normal.c, src/search.c, src/proto/search.pro
+
+Patch 6.0.175
+Problem: ":help /\z(\)" doesn't work. (Thomas Koehler)
+Solution: Double the backslashes.
+Files: src/ex_cmds.c
+
+Patch 6.0.176
+Problem: When killed by a signal autocommands are still triggered as if
+ nothing happened.
+Solution: Add the v:dying variable to allow autocommands to work differently
+ when a deadly signal has been trapped.
+Files: src/eval.c, src/os_unix.c, src/vim.h
+
+Patch 6.0.177
+Problem: When 'commentstring' is empty and 'foldmethod' is "marker", "zf"
+ doesn't work. (Thomas S. Urban)
+Solution: Add the marker even when 'commentstring' is empty.
+Files: src/fold.c, src/normal.c
+
+Patch 6.0.178
+Problem: Uninitialized memory read from xp_backslash field.
+Solution: Initialize xp_backslash field properly.
+Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/misc1.c, src/tag.c
+
+Patch 6.0.179
+Problem: Win32: When displaying UTF-8 characters may read uninitialized
+ memory.
+Solution: Add utfc_ptr2len_check_len() to avoid reading past the end of a
+ string.
+Files: src/mbyte.c, src/proto/mbyte.pro, src/gui_w32.c
+
+Patch 6.0.180
+Problem: Expanding environment variables in a string that ends in a
+ backslash could go past the end of the string.
+Solution: Detect the trailing backslash.
+Files: src/misc1.c
+
+Patch 6.0.181
+Problem: When using ":cd dir" memory was leaked.
+Solution: Free the allocated memory. Also avoid an uninitialized memory
+ read.
+Files: src/misc2.c
+
+Patch 6.0.182
+Problem: When using a regexp on multi-byte characters, could try to read a
+ character before the start of the line.
+Solution: Don't decrement a pointer to before the start of the line.
+Files: src/regexp.c
+
+Patch 6.0.183
+Problem: Leaking memory when ":func!" redefines a function.
+Solution: Free the function name when it's not used.
+Files: src/eval.c
+
+Patch 6.0.184
+Problem: Leaking memory when expanding option values.
+Solution: Don't always copy the expanded option into allocated memory.
+Files: src/option.c
+
+Patch 6.0.185
+Problem: Crash in Vim when pasting a selection in another application, on a
+ 64 bit machine.
+Solution: Fix the format for an Atom to 32 bits. (Peter Derr)
+Files: src/ui.c
+
+Patch 6.0.186
+Problem: X11: Three warnings when compiling the client-server code.
+Solution: Add a typecast to unsigned char.
+Files: src/if_xcmdsrv.c
+
+Patch 6.0.187
+Problem: "I" in Visual mode and then "u" reports too many changes. (Andrew
+ Stryker)
+ "I" in Visual linewise mode adjusts the indent for no apparent
+ reason.
+Solution: Only save those lines for undo that are changed.
+ Don't change the indent after inserting in Visual linewise mode.
+Files: src/ops.c
+
+Patch 6.0.188
+Problem: Win32: After patch 6.0.161 signs defined in the vimrc file don't
+ work.
+Solution: Initialize the sign icons after initializing the GUI. (Vince
+ Negri)
+Files: src/gui.c, src/gui_x11.c
+
+Patch 6.0.189
+Problem: The size of the Visual area isn't always displayed when scrolling
+ ('ruler' off, 'showcmd' on). Also not when using a search
+ command. (Sylvain Hitier)
+Solution: Redisplay the size of the selection after showing the mode.
+Files: src/screen.c
+
+Patch 6.0.190
+Problem: GUI: when 'mouse' is empty a click with the middle button still
+ moves the cursor.
+Solution: Paste at the cursor position instead of the mouse position.
+Files: src/normal.c
+
+Patch 6.0.191
+Problem: When no servers are available serverlist() gives an error instead
+ of returning an empty string. (Hari Krishna)
+Solution: Don't give an error message.
+Files: src/eval.c
+
+Patch 6.0.192
+Problem: When 'virtualedit' is set, "ylj" goes to the wrong column. (Andrew
+ Nikitin)
+Solution: Reset the flag that w_virtcol is valid when moving the cursor back
+ to the start of the operated area.
+Files: src/normal.c
+
+Patch 6.0.193
+Problem: When 'virtualedit' is set, col(".") after the end of the line
+ should return one extra.
+Solution: Add one to the column.
+Files: src/eval.c
+
+Patch 6.0.194
+Problem: "--remote-silent" tries to send a reply to the client, like it was
+ "--remote-wait".
+Solution: Properly check for the argument.
+Files: src/main.c
+
+Patch 6.0.195
+Problem: When 'virtualedit' is set and a search starts in virtual space
+ ":call search('x')" goes to the wrong position. (Eric Long)
+Solution: Reset coladd when finding a match.
+Files: src/search.c
+
+Patch 6.0.196
+Problem: When 'virtualedit' is set, 'selection' is "exclusive" and visually
+ selecting part of a tab at the start of a line, "x" joins it with
+ the previous line. Also, when the selection spans more than one
+ line the whole tab is deleted.
+Solution: Take coladd into account when adjusting for 'selection' being
+ "exclusive". Also expand a tab into spaces when deleting more
+ than one line.
+Files: src/normal.c, src/ops.c
+
+Patch 6.0.197
+Problem: When 'virtualedit' is set and 'selection' is "exclusive", "v$x"
+ doesn't delete the last character in the line. (Eric Long)
+Solution: Don't reset the inclusive flag. (Helmut Stiegler)
+Files: src/normal.c
+
+Patch 6.0.198
+Problem: When 'virtualedit' is set and 'showbreak' is not empty, moving the
+ cursor over the line break doesn't work properly. (Eric Long)
+Solution: Make getviscol() and getviscol2() use getvvcol() to obtain the
+ virtual cursor position. Adjust coladvance() and oneleft() to
+ skip over the 'showbreak' characters.
+Files: src/edit.c, src/misc2.c
+
+Patch 6.0.199
+Problem: Multi-byte: could use iconv() after calling iconv_end().
+ (Yasuhiro Matsumoto)
+Solution: Stop converting input and output stream after calling iconv_end().
+Files: src/mbyte.c
+
+Patch 6.0.200
+Problem: A script that starts with "#!perl" isn't recognized as a Perl
+ filetype.
+Solution: Ignore a missing path in a script header. Also, speed up
+ recognizing scripts by simplifying the patterns used.
+Files: runtime/scripts.vim
+
+Patch 6.0.201
+Problem: When scrollbinding and doing a long jump, switching windows jumps
+ to another position in the file. Scrolling a few lines at a time
+ is OK. (Johannes Zellner)
+Solution: When setting w_topline reset the flag that indicates w_botline is
+ valid.
+Files: src/diff.c
+
+Patch 6.0.202
+Problem: The "icon=" argument for the menu command to define a toolbar icon
+ with a file didn't work for GTK. (Christian J. Robinson)
+ For Motif and Athena a full path was required.
+Solution: Search the icon file using the specified path. Expand environment
+ variables in the file name.
+Files: src/gui_gtk.c, src/gui_x11.c
+
+Patch 6.0.203
+Problem: Can change 'fileformat' even though 'modifiable' is off.
+ (Servatius Brandt)
+Solution: Correct check for kind of set command.
+Files: src/option.c
+
+Patch 6.0.204
+Problem: ":unlet" doesn't work for variables with curly braces. (Thomas
+ Scott Urban)
+Solution: Handle variable names with curly braces properly. (Vince Negri)
+Files: src/eval.c
+
+Patch 6.0.205 (extra)
+Problem: "gvim -f" still forks when using the batch script to start Vim.
+Solution: Add an argument to "start" to use a foreground session (Michael
+ Geddes)
+Files: src/dosinst.c
+
+Patch 6.0.206
+Problem: Unix: if expanding a wildcard in a file name results in a
+ wildcard character and there are more parts in the path with a
+ wildcard, it is expanded again.
+ Windows: ":edit \[abc]" could never edit the file "[abc]".
+Solution: Don't expand wildcards in already expanded parts.
+ Don't remove backslashes used to escape the special meaning of a
+ wildcard; can edit "[abc]" if '[' is removed from 'isfname'.
+Files: src/misc1.c, src/os_unix.c
+
+Patch 6.0.207 (extra)
+Problem: Win32: The shortcuts and start menu entries let Vim startup in the
+ desktop directory, which is not very useful.
+Solution: Let shortcuts start Vim in $HOME or $HOMEDIR$HOMEPATH.
+Files: src/dosinst.c
+
+Patch 6.0.208
+Problem: GUI: When using a keymap and the cursor is not blinking, CTRL-^ in
+ Insert mode doesn't directly change the cursor color. (Alex
+ Solow)
+Solution: Force a redraw of the cursor after CTRL-^.
+Files: src/edit.c
+
+Patch 6.0.209
+Problem: GUI GTK: After selecting a 'guifont' with the font dialog there
+ are redraw problems for multi-byte characters.
+Solution: Separate the font dialog from setting the new font name to avoid
+ that "*" is used to find wide and bold fonts.
+ When redrawing extra characters for the bold trick, take care of
+ UTF-8 characters.
+Files: src/gui.c, src/gui_gtk_x11.c, src/option.c, src/proto/gui.pro,
+ src/proto/gui_gtk_x11.pro
+
+Patch 6.0.210
+Problem: After patch 6.0.167 it's no longer possible to edit a help file in
+ another encoding than latin1.
+Solution: Let the "++enc=" argument overrule the encoding.
+Files: src/fileio.c
+
+Patch 6.0.211
+Problem: When reading a file fails, the buffer is empty, but it might still
+ be possible to write it with ":w" later. The original file is
+ lost then. (Steve Amerige)
+Solution: Set the 'readonly' option for the buffer.
+Files: src/fileio.c
+
+Patch 6.0.212
+Problem: GUI GTK: confirm("foo", "") causes a crash.
+Solution: Don't make a non-existing button the default. Add a default "OK"
+ button if none is specified.
+Files: src/eval.c, src/gui_gtk.c
+
+Patch 6.0.213
+Problem: When a file name contains unprintable characters, CTRL-G and other
+ commands don't work well.
+Solution: Turn unprintable into printable characters. (Yasuhiro Matsumoto)
+Files: src/buffer.c, src/charset.c
+
+Patch 6.0.214
+Problem: When there is a buffer without a name, empty entries appear in the
+ jumplist saved in the viminfo file.
+Solution: Don't write jumplist entries without a file name.
+Files: src/mark.c
+
+Patch 6.0.215
+Problem: After using "/" from Visual mode the Paste menu and Toolbar
+ entries don't work. Pasting with the middle mouse doesn't work
+ and modeless selection doesn't work.
+Solution: Use the command line mode menus and use the mouse like in the
+ command line.
+Files: src/gui.c, src/menu.c, src/ui.c
+
+Patch 6.0.216
+Problem: After reloading a file, displayed in another window than the
+ current one, which was changed outside of Vim the part of the file
+ around the cursor set by autocommands may be displayed, but
+ jumping back to the original cursor position when entering the
+ window again.
+Solution: Restore the topline of the window.
+Files: src/fileio.c
+
+Patch 6.0.217
+Problem: When getting help from a help file that was used before, an empty
+ unlisted buffer remains in the buffer list. (Eric Long)
+Solution: Wipe out the buffer used to do the tag jump from.
+Files: src/buffer.c, src/ex_cmds.c, src/proto/buffer.pro
+
+Patch 6.0.218
+Problem: With explorer plugin: "vim -o filename dirname" doesn't load the
+ explorer window until entering the window.
+Solution: Call s:EditDir() for each window after starting up.
+Files: runtime/plugin/explorer.vim
+
+Patch 6.0.219
+Problem: ":setlocal" and ":setglobal", without arguments, display terminal
+ options. (Zdenek Sekera)
+Solution: Skip terminal options for these two commands.
+Files: src/option.c
+
+Patch 6.0.220
+Problem: After patch 6.0.218 get a beep on startup. (Muraoka Taro)
+Solution: Don't try going to another window when there isn't one.
+Files: runtime/plugin/explorer.vim
+
+Patch 6.0.221
+Problem: When using ":bdel" and all other buffers are unloaded the lowest
+ numbered buffer is jumped to instead of the most recent one. (Dave
+ Cecil)
+Solution: Prefer an unloaded buffer from the jumplist.
+Files: src/buffer.c
+
+Patch 6.0.222
+Problem: When 'virtualedit' is set and using autoindent, pressing Esc after
+ starting a new line leaves behind part of the autoindent. (Helmut
+ Stiegler)
+Solution: After deleting the last char in the line adjust the cursor
+ position in del_bytes().
+Files: src/misc1.c, src/ops.c
+
+Patch 6.0.223
+Problem: When splitting a window that contains the explorer, hitting CR on
+ a file name gives error messages.
+Solution: Set the window variables after splitting the window.
+Files: runtime/plugin/explorer.vim
+
+Patch 6.0.224
+Problem: When 'sidescroll' and 'sidescrolloff' are set in a narrow window
+ the text may jump left-right and the cursor is displayed in the
+ wrong position. (Aric Blumer)
+Solution: When there is not enough room, compute the left column for the
+ window to put the cursor in the middle.
+Files: src/move.c
+
+Patch 6.0.225
+Problem: In Visual mode "gk" gets stuck in a closed fold. (Srinath
+ Avadhanula)
+Solution: Behave differently in a closed fold.
+Files: src/normal.c
+
+Patch 6.0.226
+Problem: When doing ":recover file" get the ATTENTION prompt.
+ After recovering the same file five times get a read error or a
+ crash. (Alex Davis)
+Solution: Set the recoverymode flag before setting the file name.
+ Correct the amount of used memory for the size of block zero.
+Files: src/ex_docmd.c
+
+Patch 6.0.227 (extra)
+Problem: The RISC OS port has several problems.
+Solution: Update the makefile and fix some of the problems. (Andy Wingate)
+Files: src/Make_ro.mak, src/os_riscos.c, src/os_riscos.h,
+ src/proto/os_riscos.pro, src/search.c
+
+Patch 6.0.228
+Problem: After putting text in Visual mode the '] mark is not at the end of
+ the put text.
+ Undo doesn't work properly when putting a word into a Visual
+ selection that spans more than one line.
+Solution: Correct the '] mark for the deleting the Visually selected text.
+ #ifdef code that depends on FEAT_VISUAL properly.
+ Also fix that "d" crossing line boundary puts '[ just before
+ deleted text.
+ Fix undo by saving all deleted lines at once.
+Files: src/ex_docmd.c, src/globals.h, src/normal.c, src/ops.c,
+ src/structs.h, src/vim.h
+
+Patch 6.0.229
+Problem: Multi-byte: With 'm' in 'formatoptions', formatting doesn't break
+ at a multi-byte char followed by an ASCII char, and the other way
+ around. (Muraoka Taro)
+ When joining lines a space is inserted between multi-byte
+ characters, which is not always wanted.
+Solution: Check for multi-byte character before and after the breakpoint.
+ Don't insert a space before or after a multi-byte character when
+ joining lines and the 'M' flag is in 'formatoptions'. Don't
+ insert a space between multi-byte characters when the 'B' flag is
+ in 'formatoptions'.
+Files: src/edit.c, src/ops.c, src/option.h
+
+Patch 6.0.230
+Problem: The ":" used as a motion after an operator is exclusive, but
+ sometimes it should be inclusive.
+Solution: Make the "v" in between an operator and motion toggle
+ inclusive/exclusive. (Servatius Brandt)
+Files: runtime/doc/motion.txt, src/normal.c
+
+Patch 6.0.231
+Problem: "gd" and "gD" don't work when the variable matches in a comment
+ just above the match to be found. (Servatius Brandt)
+Solution: Continue searching in the first column below the comment.
+Files: src/normal.c
+
+Patch 6.0.232
+Problem: "vim --version" prints on stderr while "vim --help" prints on
+ stdout.
+Solution: Make "vim --version" use stdout.
+Files: runtime/doc/starting.txt, src/globals.h, src/main.c, src/message.c
+
+Patch 6.0.233
+Problem: "\1\{,8}" in a regexp is not allowed, but it should work, because
+ there is an upper limit. (Jim Battle)
+Solution: Allow using "\{min,max}" after an atom that can be empty if there
+ is an upper limit.
+Files: src/regexp.c
+
+Patch 6.0.234
+Problem: It's not easy to set the cursor position without modifying marks.
+Solution: Add the cursor() function. (Yegappan Lakshmanan)
+Files: runtime/doc/eval.txt, src/eval.c
+
+Patch 6.0.235
+Problem: When writing a file and renaming the original file to make the
+ backup, permissions could change when setting the owner.
+Solution: Only set the owner when it's needed and set the permissions again
+ afterwards.
+ When 'backupcopy' is "auto" check that the owner and permissions
+ of a newly created file can be set properly.
+Files: src/fileio.c
+
+Patch 6.0.236
+Problem: ":edit" without argument should move cursor to line 1 in Vi
+ compatible mode.
+Solution: Add 'g' flag to 'cpoptions'.
+Files: runtime/doc/options.txt, src/ex_docmd.c, src/option.h
+
+Patch 6.0.237
+Problem: In a C file, using the filetype plugin, re-indenting a comment
+ with two spaces after the middle "*" doesn't align properly.
+Solution: Don't use a middle entry from a start/middle/end to line up with
+ the start of the comment when the start part doesn't match with
+ the actual comment start.
+Files: src/misc1.c
+
+Patch 6.0.238
+Problem: Using a ":substitute" command with a substitute() call in the
+ substitution expression causes errors. (Srinath Avadhanula)
+Solution: Save and restore pointers when doing substitution recursively.
+Files: src/regexp.c
+
+Patch 6.0.239
+Problem: Using "A" to append after a Visually selected block which is after
+ the end of the line, spaces are inserted in the wrong line and
+ other unexpected effects. (Michael Naumann)
+Solution: Don't advance the cursor to the next line.
+Files: src/ops.c
+
+Patch 6.0.240
+Problem: Win32: building with Python 2.2 doesn't work.
+Solution: Add support for Python 2.2 with dynamic linking. (Paul Moore)
+Files: src/if_python.c
+
+Patch 6.0.241
+Problem: Win32: Expanding the old value of an option that is a path that
+ starts with a backslash, an extra backslash is inserted.
+Solution: Only insert backslashes where needed.
+ Also handle multi-byte characters properly when removing
+ backslashes.
+Files: src/option.c
+
+Patch 6.0.242
+Problem: GUI: On a system with an Exceed X server sometimes get a "Bad
+ Window" error. (Tommi Maekitalo)
+Solution: When forking, use a pipe to wait in the parent for the child to
+ have done the setsid() call.
+Files: src/gui.c
+
+Patch 6.0.243
+Problem: Unix: "vim --version" outputs a NL before the last line instead of
+ after it. (Charles Campbell)
+Solution: Send the NL to the same output stream as the text.
+Files: src/message.c, src/os_unix.c, src/proto/message.pro
+
+Patch 6.0.244
+Problem: Multi-byte: Problems with (illegal) UTF-8 characters in menu and
+ file name (e.g., icon text, status line).
+Solution: Correctly handle unprintable characters. Catch illegal UTF-8
+ characters and replace them with <xx>. Truncating the status line
+ wasn't done correctly at a multi-byte character. (Yasuhiro
+ Matsumoto)
+ Added correct_cmdspos() and transchar_byte().
+Files: src/buffer.c, src/charset.c, src/ex_getln.c, src/gui.c,
+ src/message.c, src/screen.c, src/vim.h
+
+Patch 6.0.245
+Problem: After using a color scheme, setting the 'background' option might
+ not work. (Peter Horst)
+Solution: Disable the color scheme if it switches 'background' back to the
+ wrong value.
+Files: src/option.c
+
+Patch 6.0.246
+Problem: ":echomsg" didn't use the highlighting set by ":echohl". (Gary
+ Holloway)
+Solution: Use the specified attributes for the message. (Yegappan
+ Lakshmanan)
+Files: src/eval.c
+
+Patch 6.0.247
+Problem: GTK GUI: Can't use gvim in a kpart widget.
+Solution: Add the "--echo-wid" argument to let Vim echo the window ID on
+ stdout. (Philippe Fremy)
+Files: runtime/doc/starting.txt, src/globals.h, src/gui_gtk_x11.c,
+ src/main.c
+
+Patch 6.0.248
+Problem: When using compressed help files and 'encoding' isn't "latin1",
+ Vim converts the help file before decompressing. (David Reviejo)
+Solution: Don't convert a help file when 'binary' is set.
+Files: src/fileio.c
+
+Patch 6.0.249
+Problem: "vim -t edit -c 'sta ex_help'" doesn't move cursor to edit().
+Solution: Don't set the cursor on the first line for "-c" arguments when
+ there also is a "-t" argument.
+Files: src/main.c
+
+Patch 6.0.250 (extra)
+Problem: Macintosh: Various problems when compiling.
+Solution: Various fixes, mostly #ifdefs. (Dany St. Amant)
+Files: src/gui_mac.c, src/main.c, src/misc2.c, src/os_mac.h,
+ src/os_mac.pbproj/project.pbxproj, src/os_unix.c
+
+Patch 6.0.251 (extra)
+Problem: Macintosh: menu shortcuts are not very clear.
+Solution: Show the shortcut with the Mac clover symbol. (raindog)
+Files: src/gui_mac.c
+
+Patch 6.0.252
+Problem: When a user function was defined with "abort", an error that is
+ not inside if/endif or while/endwhile doesn't abort the function.
+ (Servatius Brandt)
+Solution: Don't reset did_emsg when the function is to be aborted.
+Files: src/ex_docmd.c
+
+Patch 6.0.253
+Problem: When 'insertmode' is set, after "<C-O>:edit file" the next <C-O>
+ doesn't work. (Benji Fisher) <C-L> has the same problem.
+Solution: Reset need_start_insertmode once in edit().
+Files: src/edit.c
+
+Patch 6.0.254 (extra)
+Problem: Borland C++ 5.5: Checking for stack overflow doesn't work
+ correctly. Matters when using a complicated regexp.
+Solution: Remove -N- from Make_bc5.mak. (Yasuhiro Matsumoto)
+Files: src/Make_bc5.mak
+
+Patch 6.0.255 (extra) (depends on patch 6.0.116 and 6.0.121)
+Problem: Win32: ACL support doesn't work well on Samba drives.
+Solution: Add a check for working ACL support. (Mike Williams)
+Files: src/os_win32.c
+
+Patch 6.0.256 (extra)
+Problem: Win32: ":highlight Comment guifg=asdf" does not give an error
+ message. (Randall W. Morris) Also for other systems.
+Solution: Add gui_get_color() to give one error message for all systems.
+Files: src/gui.c, src/gui_amiga.c, src/gui_athena.c, src/gui_motif.c,
+ src/gui_riscos.c, src/gui_x11.c, src/gui_gtk_x11.c,
+ src/proto/gui.pro, src/syntax.c
+
+Patch 6.0.257
+Problem: Win32: When 'mousefocus' is set and there is a BufRead
+ autocommand, after the dialog for permissions changed outside of
+ Vim: 'mousefocus' stops working. (Robert Webb)
+Solution: Reset need_mouse_correct after checking timestamps.
+Files: src/fileio.c
+
+Patch 6.0.258
+Problem: When 'scrolloff' is 999 and there are folds, the text can jump up
+ and down when moving the cursor down near the end of the file.
+ (Lubomir Host)
+Solution: When putting the cursor halfway the window start counting lines at
+ the end of a fold.
+Files: src/move.c
+
+Patch 6.0.259
+Problem: MS-DOS: after editing the command line the cursor shape may remain
+ like in Insert mode. (Volker Kiefel)
+Solution: Reset the cursor shape after editing the command line.
+Files: src/ex_getln.c
+
+Patch 6.0.260
+Problem: GUI: May crash while starting up when giving an error message for
+ missing color. (Servatius Brandt)
+Solution: Don't call gui_write() when still starting up. Don't give error
+ message for empty color name. Don't use 't_vb' while the GUI is
+ still starting up.
+Files: src/fileio.c, src/gui.c, src/misc1.c, src/ui.c
+
+Patch 6.0.261
+Problem: nr2char() and char2nr() don't work with multi-byte characters.
+Solution: Use 'encoding' for these functions. (Yasuhiro Matsumoto)
+Files: runtime/doc/eval.txt, src/eval.c
+
+Patch 6.0.262 (extra)
+Problem: Win32: IME doesn't work properly. OnImeComposition() isn't used
+ at all.
+Solution: Adjust various things for IME.
+Files: src/globals.h, src/gui_w32.c, src/mbyte.c, src/proto/ui.pro,
+ src/structs.h, src/ui.c
+
+Patch 6.0.263
+Problem: GTK: When a dialog is closed by the window manager, Vim hangs.
+ (Christian J. Robinson)
+Solution: Use GTK_WIDGET_DRAWABLE() instead of GTK_WIDGET_VISIBLE().
+Files: src/gui_gtk.c, src/gui_gtk_x11.c
+
+Patch 6.0.264
+Problem: The amount of virtual memory is used to initialize 'maxmemtot',
+ which may be much more than the amount of physical memory,
+ resulting in a lot of swapping.
+Solution: Get the amount of physical memory with sysctl(), sysconf() or
+ sysinfo() when possible.
+Files: src/auto/configure, src/configure.in, src/config.h.in,
+ src/os_unix.c, src/os_unix.h
+
+Patch 6.0.265
+Problem: Win32: Using backspace while 'fkmap' is set causes a crash.
+ (Jamshid Oasjmoha)
+Solution: Don't try mapping special keys.
+Files: src/farsi.c
+
+Patch 6.0.266
+Problem: The rename() function deletes the file if the old and the new name
+ are the same. (Volker Kiefel)
+Solution: Don't do anything if the names are equal.
+Files: src/fileio.c
+
+Patch 6.0.267
+Problem: UTF-8: Although 'isprint' says a character is printable,
+ utf_char2cells() still considers it unprintable.
+Solution: Use vim_isprintc() for characters upto 0x100. (Yasuhiro Matsumoto)
+Files: src/mbyte.c
+
+Patch 6.0.268 (extra) (depends on patch 6.0.255)
+Problem: Win32: ACL check crashes when using forward slash in file name.
+Solution: Improve the check for the path in the file name.
+Files: src/os_win32.c
+
+Patch 6.0.269
+Problem: Unprintable characters in a file name may cause problems when
+ using the 'statusline' option or when 'buftype' is "nofile".
+Solution: call trans_characters() for the resulting statusline. (Yasuhiro
+ Matsumoto)
+Files: src/buffer.c, src/screen.c, src/charset.c
+
+Patch 6.0.270 (depends on patch 6.0.267)
+Problem: A tab causes UTF-8 text to be displayed in the wrong position.
+ (Ron Aaron)
+Solution: Correct utf_char2cells() again.
+Files: src/mbyte.c
+
+Patch 6.1a.001 (extra)
+Problem: 32bit DOS: copying text to the clipboard may cause a crash.
+ (Jonathan D Johnston)
+Solution: Don't copy one byte too much in SetClipboardData().
+Files: src/os_msdos.c
+
+Patch 6.1a.002
+Problem: GTK: On some configurations, when closing a dialog from the window
+ manager, Vim hangs.
+Solution: Catch the "destroy" signal. (Aric Blumer)
+Files: src/gui_gtk.c
+
+Patch 6.1a.003
+Problem: Multi-byte: With UTF-8 double-wide char and 'virtualedit' set:
+ yanking in Visual mode doesn't include the last byte. (Eric Long)
+Solution: Don't add a space for a double-wide character.
+Files: src/ops.c
+
+Patch 6.1a.004 (extra)
+Problem: MINGW: undefined type. (Ron Aaron)
+Solution: Make GetCompositionString_inUCS2() static.
+Files: src/gui_w32.c, src/gui_w48.c, src/proto/gui_w32.pro
+
+Patch 6.1a.005 (extra)
+Problem: Win32: ":hardcopy" doesn't work after ":hardcopy!". (Jonathan
+ Johnston)
+Solution: Don't keep the driver context when using ":hardcopy!". (Vince
+ Negri)
+Files: src/os_mswin.c
+
+Patch 6.1a.006
+Problem: multi-byte: after setting 'encoding' the window title might be
+ wrong.
+Solution: Force resetting the title. (Yasuhiro Matsumoto)
+Files: src/option.c
+
+Patch 6.1a.007
+Problem: Filetype detection for "*.inc" doesn't work.
+Solution: Use a ":let" command. (David Schweikert)
+Files: runtime/filetype.vim
+
+Patch 6.1a.008 (extra)
+Problem: Win32: ACL detection for network shares doesn't work.
+Solution: Include the trailing (back)slash in the root path. (Mike Williams)
+Files: src/os_win32.c
+
+Patch 6.1a.009
+Problem: When using "\@<=" or "\@<!" in a pattern, a "\1" may refer to a ()
+ part that follows, but it generates an error message.
+Solution: Allow a forward reference when there is a following "\@<=" or
+ "\@<!".
+Files: runtime/doc/pattern.txt, src/regexp.c
+
+Patch 6.1a.010
+Problem: When using ":help" and opening a new window, the alternate file
+ isn't set.
+Solution: Set the alternate file to the previously edited file.
+Files: src/ex_cmds.c
+
+Patch 6.1a.011
+Problem: GTK: ":set co=77", change width with the mouse, ":set co=77"
+ doesn't resize the window. (Darren Hiebert)
+Solution: Set the form size after handling a resize event.
+Files: src/gui_gtk_x11.c
+
+Patch 6.1a.012
+Problem: GTK: The file browser always returns a full path. (Lohner)
+Solution: Shorten the file name if possible.
+Files: src/gui_gtk.c
+
+Patch 6.1a.013
+Problem: When using "=~word" in 'cinkeys' or 'indentkeys', the case of the
+ last character of the word isn't ignored. (Raul Segura Acevedo)
+Solution: Ignore case when checking the last typed character.
+Files: src/edit.c
+
+Patch 6.1a.014
+Problem: After patch 6.1a.006 can't compile without the title feature.
+Solution: Add an #ifdef.
+Files: src/option.c
+
+Patch 6.1a.015
+Problem: MS-Windows: When expanding a file name that contains a '[' or '{'
+ an extra backslash is inserted. (Raul Segura Acevedo)
+Solution: Avoid adding the backslash.
+Files: src/ex_getln.c
+
+Patch 6.1a.016
+Problem: Completion after ":language" doesn't include "time". (Raul Segura
+ Acevedo)
+Solution: Add the alternative to the completions.
+Files: src/ex_cmds2.c
+
+Patch 6.1a.017
+Problem: Clicking the mouse in the top row of a window where the first line
+ doesn't fit moves the cursor to the wrong column.
+Solution: Add the skipcol also for the top row of a window.
+Files: src/ui.c
+
+Patch 6.1a.018
+Problem: When 'scrolloff' is one and the window height is one, "gj" can put
+ the cursor above the window. (Raul Segura Acevedo)
+Solution: Don't let skipcol become bigger than the cursor column.
+Files: src/move.c
+
+Patch 6.1a.019
+Problem: When using a composing character on top of an ASCII character, the
+ "l" command clears the composing character. Only when 'ruler' and
+ 'showcmd' are off. (Raphael Finkel)
+Solution: Don't move the cursor by displaying characters when there are
+ composing characters.
+Files: src/screen.c
+
+Patch 6.1a.020
+Problem: GTK: after patch 6.1a.011 resizing with the mouse doesn't always
+ work well for small sizes. (Adrien Beau)
+Solution: Use another way to avoid the problem with ":set co=77".
+Files: src/gui_gtk_x11.c
+
+Patch 6.1a.021
+Problem: Several Syntax menu entries are wrong or confusing.
+Solution: Rephrase and correct the menu entries. (Adrien Beau)
+Files: runtime/makemenu.vim, runtime/menu.vim
+
+Patch 6.1a.022
+Problem: A tags file might be used twice on case insensitive systems.
+ (Rick Swanton)
+Solution: Don't use the same file name twice in the default for the 'tags'
+ option. Ignore case when comparing names of already visited
+ files.
+Files: src/misc2.c, src/option.c
+
+Patch 6.1a.023
+Problem: When starting the GUI get "C" characters echoed in the terminal.
+Solution: Don't try sending a clear-screen command while the GUI is starting
+ up.
+Files: src/screen.c
+
+Patch 6.1a.024
+Problem: In other editors CTRL-F is often used for a find dialog.
+Solution: In evim use CTRL-F for the find dialog.
+Files: runtime/evim.vim
+
+Patch 6.1a.025
+Problem: The choices for the fileformat dialog can't be translated.
+Solution: Add g:menutrans_fileformat_choices. (Adrien Beau)
+Files: runtime/menu.vim
+
+Patch 6.1a.026
+Problem: Indenting Java files is wrong with "throws", "extends" and
+ "implements" clauses.
+Solution: Update the Java indent script.
+Files: runtime/indent/java.vim
+
+Patch 6.1a.027
+Problem: A few Syntax menu entries missing or incorrect.
+Solution: Add and correct the menu entries. (Adrien Beau)
+ Shorten a few menus to avoid they become too long.
+Files: runtime/makemenu.vim, runtime/menu.vim
+
+Patch 6.1a.028
+Problem: XIM: problems with feedback and some input methods.
+Solution: Use iconv for calculating the cells. Remove the queue for
+ key_press_event only when text was changed. (Yasuhiro Matsumoto)
+Files: src/globals.h, src/mbyte.c, src/screen.c
+
+Patch 6.1a.029
+Problem: After patch 6.1a.028 can't compile GTK version with XIM but
+ without multi-byte chars.
+Solution: Add an #ifdef. (Aschwin Marsman)
+Files: src/mbyte.c
+
+Patch 6.1a.030
+Problem: With double-byte encodings toupper() and tolower() may have wrong
+ results.
+Solution: Skip double-byte characters. (Eric Long)
+Files: src/eval.c
+
+Patch 6.1a.031
+Problem: Accessing the 'balloondelay' variable may cause a crash.
+Solution: Make the variable for 'balloondelay' a long. (Olaf Seibert)
+Files: src/option.h
+
+Patch 6.1a.032 (extra)
+Problem: Some menu files used a wrong encoding name for "scriptencoding".
+Solution: Move the translations to a separate file, which is sourced after
+ setting "scriptencoding".
+ Also add Czech menu translations in ASCII and update the other
+ encodings.
+Files: runtime/lang/menu_cs_cz.iso_8859-1.vim,
+ runtime/lang/menu_cs_cz.iso_8859-2.vim,
+ runtime/lang/menu_czech_czech_republic.1250.vim,
+ runtime/lang/menu_czech_czech_republic.1252.vim,
+ runtime/lang/menu_czech_czech_republic.ascii.vim,
+ runtime/lang/menu_de_de.iso_8859-1.vim,
+ runtime/lang/menu_de_de.latin1.vim,
+ runtime/lang/menu_fr_fr.iso_8859-1.vim,
+ runtime/lang/menu_fr_fr.latin1.vim,
+ runtime/lang/menu_french_france.1252.vim,
+ runtime/lang/menu_german_germany.1252.vim,
+ runtime/lang/menu_ja_jp.euc-jp.vim,
+ runtime/lang/menu_ja_jp.utf-8.vim,
+ runtime/lang/menu_japanese_japan.932.vim
+
+Patch 6.1a.033
+Problem: XIM: doesn't reset input context.
+Solution: call xim_reset() with im_set_active(FALSE). (Takuhiro Nishioka)
+Files: src/mbyte.c
+
+Patch 6.1a.034 (extra)
+Problem: Win32: The ACL checks for a readonly file still don't work well.
+Solution: Remove the ACL checks, go back to how it worked in Vim 6.0.
+Files: src/os_win32.c
+
+Patch 6.1a.035
+Problem: multi-byte: When using ":sh" in the GUI, typed and displayed
+ multi-byte characters are not handled correctly.
+Solution: Deal with multi-byte characters to and from the shell. (Yasuhiro
+ Matsumoto) Also handle UTF-8 composing characters.
+Files: src/os_unix.c
+
+Patch 6.1a.036
+Problem: GTK: the save-yourself event was not handled.
+Solution: Catch the save-yourself event and preserve swap files. (Neil Bird)
+Files: src/gui_gtk_x11.c
+
+Patch 6.1a.037
+Problem: The MS-Windows key mapping doesn't include CTRL-S for saving.
+ (Vlad Sandrini)
+Solution: Map CTRL-S to ":update".
+Files: runtime/mswin.vim
+
+Patch 6.1a.038
+Problem: Solaris: Including both sys/sysctl.h and sys/sysinfo.h doesn't
+ work. (Antonio Colombo)
+Solution: Don't include sys/sysinfo.h when not calling sysinfo().
+Files: src/os_unix.c
+
+Patch 6.1a.039
+Problem: Not all visual basic files are recognized.
+Solution: Add checks to catch *.ctl files. (Raul Segura Acevedo)
+Files: runtime/filetype.vim
+
+Patch 6.1a.040
+Problem: A *.pl file is recognized as Perl, but it could be a prolog file.
+Solution: Check the first non-empty line. (Kontra Gergely)
+Files: runtime/filetype.vim
+
+Patch 6.1a.041
+Problem: When pressing the left mouse button in the command line and them
+ moving the mouse upwards, nearly all the text is selected.
+Solution: Don't try extending a modeless selection when there isn't one.
+Files: src/ui.c
+
+Patch 6.1a.042
+Problem: When merging files, ":diffput" and ":diffget" are used a lot, but
+ they require a lot of typing.
+Solution: Add "dp" for ":diffput" and "do" for ":diffget".
+Files: runtime/doc/diff.txt, src/diff.c, src/normal.c, src/proto/diff.pro
+
+
+Patch 6.1b.001 (extra)
+Problem: Checking for wildcards in a path does not handle multi-byte
+ characters with a trail byte which is a wildcard.
+Solution: Handle multi-byte characters correctly. (Muraoka Taro)
+Files: src/os_amiga.c, src/os_mac.c, src/os_msdos.c, src/os_mswin.c,
+ src/os_unix.c
+
+Patch 6.1b.002
+Problem: A regexp that ends in "\{" is not flagged as an error. May cause
+ a stack overflow when 'incsearch' is set. (Gerhard Hochholzer)
+Solution: Handle a missing "}" as an error.
+Files: src/regexp.c
+
+Patch 6.1b.003 (extra)
+Problem: The RISC OS GUI doesn't compile.
+Solution: Include changes since Vim 5.7. (Andy Wingate)
+Files: src/Make_ro.mak, src/gui_riscos.c, src/os_riscos.c,
+ src/os_riscos.h, src/proto/gui_riscos.pro
+
+Patch 6.1b.004
+Problem: col("'>") returns a negative number for linewise selection. (Neil
+ Bird)
+Solution: Don't add one to MAXCOL.
+Files: src/eval.c
+
+Patch 6.1b.005
+Problem: Using a search pattern that causes an out-of-stack error while
+ 'hlsearch' is set keeps giving the hit-Enter prompt.
+ A search pattern that takes a long time delays typing when
+ 'incsearch' is set.
+Solution: Stop 'hlsearch' highlighting when the regexp causes an error.
+ Stop searching for 'incsearch' when a character is typed.
+Files: src/globals.h, src/message.c, src/screen.c, src/search.c,
+ src/vim.h
+
+Patch 6.1b.006
+Problem: When entering a composing character on the command line with
+ CTRL-V, the text isn't redrawn correctly.
+Solution: Redraw the text under and after the cursor.
+Files: src/ex_getln.c
+
+Patch 6.1b.007
+Problem: When the cursor is in the white space between two sentences, "dis"
+ deletes the first character of the following sentence, "das"
+ deletes a space after the sentence.
+Solution: Backup the cursor one character in these situations.
+Files: src/search.c
+
+Patch 6.1b.008
+Problem: *.xsl files are not recognized as xslt but xml.
+ Monk files are not recognized.
+Solution: Delete the duplicate line for *.xsl. (Johannes Zellner)
+ Recognize monk files.
+Files: runtime/filetype.vim
+
+Patch 6.1b.009
+Problem: Can't always compile small features and then adding eval feature,
+ "sandbox" is undefined. (Axel Kielhorn)
+Solution: Always define "sandbox" when the eval feature is used.
+Files: src/globals.h
+
+Patch 6.1b.010 (extra)
+Problem: When compiling gvimext.cpp with MSVC 4.2 get a number of warnings.
+Solution: Change "true" to "TRUE". (Walter Briscoe)
+Files: GvimExt/gvimext.cpp
+
+Patch 6.1b.011
+Problem: When using a very long string for confirm(), can't quit the
+ displaying at the more prompt. (Hari Krishna Dara)
+Solution: Jump to the end of the message to show the choices.
+Files: src/message.c
+
+Patch 6.1b.012
+Problem: Multi-byte: When 'showbreak' is set and a double-wide character
+ doesn't fit at the right window edge the cursor gets stuck there.
+ Using cursor-left gets stuck when 'virtualedit' is set. (Eric
+ Long)
+Solution: Fix the way the extra ">" character is counted when 'showbreak' is
+ set. Don't correct cursor for virtual editing on a double-wide
+ character.
+Files: src/charset.c, src/edit.c
+
+Patch 6.1b.013
+Problem: A user command that partly matches with a buffer-local user
+ command and matches full with a global user command unnecessarily
+ gives an 'ambiguous command' error.
+Solution: Find the full global match even after a partly local match.
+Files: src/ex_docmd.c
+
+Patch 6.1b.014
+Problem: EBCDIC: switching mouse events off causes garbage on screen.
+ Positioning the cursor in the GUI causes garbage.
+Solution: Insert an ESC in the terminal code. (Ralf Schandl)
+ Use "\b" instead of "\010" for KS_LE.
+Files: src/os_unix.c, src/term.c
+
+Patch 6.1b.015
+Problem: Vimtutor has a typo. Get a warning for "tempfile" if it
+ doesn't exist.
+Solution: Move a quote to the end of a line. (Max Ischenko)
+ Use "mktemp" first, more systems have it.
+Files: src/vimtutor
+
+Patch 6.1b.016
+Problem: GTK: loading a fontset that works partly, Vim might hang or crash.
+Solution: Avoid that char_width becomes zero. (Yasuhiro Matsumoto)
+Files: src/gui_gtk_x11.c
+
+Patch 6.1b.017
+Problem: GUI: When using ":shell" and there is a beep, nothing happens.
+Solution: Call vim_beep() to produce the beep from the shell. (Yasuhiro
+ Matsumoto)
+Files: src/message.c
+
+Patch 6.1b.018 (depends on 6.1b.006)
+Problem: When entering the encryption key, special keys may still reveal
+ the typed characters.
+Solution: Make sure stars are used or nothing is shown in all cases.
+Files: src/digraph.c, src/getchar.c, src/ex_getln.c
+
+Patch 6.1b.019 (depends on 6.1b.005)
+Problem: A search pattern that takes a long time slows down typing when
+ 'incsearch' is set.
+Solution: Pass SEARCH_PEEK to dosearch().
+Files: src/ex_getln.c
+
+Patch 6.1b.020
+Problem: When using the matchit plugin, "%" finds a match on the "end" of a
+ ":syntax region" command in Vim scripts.
+Solution: Skip over ":syntax region" commands by setting b:match_skip.
+Files: runtime/ftplugin/vim.vim
+
+Patch 6.1b.021
+Problem: when 'mousefocus' is set, CTRL-W CTRL-] sometimes doesn't warp the
+ pointer to the new window. (Robert Webb)
+Solution: Don't reset need_mouse_correct when checking the timestamp of a
+ file.
+Files: src/fileio.c
+
+Patch 6.1b.022
+Problem: With lots of folds "j" does not obey 'scrolloff' properly.
+ (Srinath Avadhanula)
+Solution: Go to end of the fold before counting context lines.
+Files: src/move.c
+
+Patch 6.1b.023
+Problem: On MS-Windows system() may cause checking timestamps, because Vim
+ looses and gains input focus, while this doesn't happen on Unix.
+Solution: Don't check timestamps while system() is busy.
+Files: src/ex_cmds2.c, src/fileio.c, src/globals.h, src/misc1.c
+
+Patch 6.1b.024 (extra)
+Problem: Gettext 0.11 complains that "sjis" is not a standard name.
+Solution: Use "cp932" instead.
+Files: src/po/sjiscorr.c
+
+Patch 6.1b.025 (extra)
+Problem: Win32: When closing gvim while it is minimized and has a changed
+ file, the file-changed dialog pops up in a corner of the screen.
+Solution: Put the dialog in the middle of the screen.
+Files: src/gui_w48.c
+
+Patch 6.1b.026
+Problem: When 'diffopt' contains 'iwhite' but not 'icase': differences in
+ case are not highlighted properly. (Gerhard Hochholzer)
+Solution: Don't ignore case when ignoring white space differences.
+Files: src/diff.c
+
+Patch 6.1b.027
+Problem: "vim --remote +" may cause a crash.
+Solution: Check for missing file name argument. (Martin Kahlert)
+Files: src/main.c
+
+Patch 6.1b.028 (extra)
+Problem: Win16: Can't compile after patch 6.1b.025.
+Solution: Add code specifically for Win16. (Vince Negri)
+Files: src/gui_w48.c
+
+Patch 6.1b.029
+Problem: Win32: When a directory on an NTFS partition is read/execute (no
+ delete,modify,write) and the file has modify rights, trying to
+ write the file deletes it. Making the file read/write/execute
+ (not delete) solves it. (Mark Canup)
+Solution: Use the Unix code to check for a writable directory. If not, then
+ make a backup copy and overwrite the file.
+Files: src/fileio.c
+
+Patch 6.1b.030 (extra)
+Problem: Mac: small mistake in the build script and prototypes.
+Solution: Fix the build script and add the prototypes. (Axel Kielhorn)
+Files: src/os_mac.build, src/gui_mac.c
+
+Patch 6.1b.031 (extra)
+Problem: Win32 GUI: ":set guifont=*" doesn't set 'guifont' to the resulting
+ font name. (Vlad Sandrini)
+Solution: Put the code back in gui_mch_init_font() to form the font name out
+ of the logfont.
+Files: src/gui_w48.c
+
+Patch 6.1b.032
+Problem: Athena: Setting a color scheme before the GUI has started causes a
+ crash. (Todd Blumer)
+Solution: Don't try using color names that haven't been set yet.
+Files: src/gui_athena.c
+
+Patch 6.1b.033
+Problem: When using a count after a ":s" command may get ml_get errors.
+ (Dietmar Lang)
+Solution: Check that the resulting range does not go past the end of the
+ buffer.
+Files: src/ex_cmds.c
+
+Patch 6.1b.034
+Problem: After sourcing mswin.vim, when using <C-S-Right> after
+ auto-indenting and then <Del>, get warning for allocating
+ ridiculous amount of memory. (Dave Delgreco)
+Solution: Adjust the start of the Visual area when deleting the auto-indent.
+Files: src/edit.c
+
+Patch 6.1b.035
+Problem: When using evim, dropping a file on Vim and then double clicking
+ on a word, it is changed to "i". (Merlin Hansen)
+Solution: Reset need_start_insertmode after editing the file.
+Files: src/ex_docmd.c
+
+
+==============================================================================
+VERSION 6.2 *version-6.2*
+
+This section is about improvements made between version 6.1 and 6.2.
+
+This is mainly a bug-fix release. There are also a few new features.
+
+Main new features:
+- Support for GTK 2. (Daniel Elstner)
+- Support for editing Arabic text. (Nadim Shaikli & Isam Bayazidi)
+- ":try" command and exception handling. (Servatius Brandt)
+- Support for the neXtaw GUI toolkit (mostly like Athena). (Alexey Froloff)
+- Cscope support for Win32. (Khorev Sergey)
+- Support for PostScript printing in various 8-bit encodings. (Mike Williams)
+
+
+Changed *changed-6.2*
+-------
+
+Removed the scheme indent file, the internal Lisp indenting works well now.
+
+Moved the GvimEXt, OleVim and VisVim directories into the "src" directory.
+This is more consistent with how xxd is handled.
+
+The VisVim.dll file is installed in the top directory, next to gvimext.dll,
+instead of in a subdirectory "VisVim". Fixes that NSIS was uninstalling it
+from the wrong directory.
+
+Removed the art indent file, it didn't do anything.
+
+submatch() returned line breaks with CR instead of LF.
+
+Changed the Win32 Makefiles to become more uniform and compile gvimext.dll.
+(Dan Sharp)
+
+'cindent': Align a "//" comment with a "//" comment in a previous line.
+(Helmut Stiegler)
+
+Previously only for xterm-like terminals parent widgets were followed to find
+the title and icon label. Now do this for all terminal emulators.
+
+Made it possible to recognize backslashes for "%" matching. The 'M' flag in
+'cpoptions' disables it. (Haakon Riiser)
+
+Removed the Make_tcc.mak makefile for Turbo C. It didn't work and we probably
+can't make it work (the compiler runs out of memory).
+
+Even though the documentation refers to keywords, "[ CTRL-D" was using
+'isident' to find matches. Changed it to use 'iskeyword'. Also applies to
+other commands that search for defined words in included files such as
+":dsearch", "[D" and "[d".
+
+Made 'keywordprg' global-local. (Christian Robinson)
+
+Enabled the Netbeans interface by default. Reversed the configure argument
+from "--enable-netbeans" to "--disable-netbeans".
+
+
+Added *added-6.2*
+-----
+
+New options:
+ 'arabic'
+ 'arabicshape'
+ 'ambiwidth'
+ 'autochdir'
+ 'casemap'
+ 'copyindent'
+ 'cscopequickfix'
+ 'preserveindent'
+ 'printencoding'
+ 'rightleftcmd'
+ 'termbidi'
+ 'toolbariconsize'
+ 'winfixheight'
+
+New keymaps:
+ Serbian (Aleksandar Veselinovic)
+ Chinese Pinyin (Fredrik Roubert)
+ Esperanto (Antoine J. Mechelynck)
+
+New syntax files:
+ Valgrind (Roger Luethi)
+ Smarty template (Manfred Stienstra)
+ MySQL (Kenneth Pronovici)
+ RockLinux package description (Piotr Esden-Tempski)
+ MMIX (Dirk Huesken)
+ gkrellmrc (David Necas)
+ Tilde (Tobias Rundtrom)
+ Logtalk (Paulo Moura)
+ PLP (Juerd Waalboer)
+ fvwm2m4 (David Necas)
+ IPfilter (Hendrik Scholz)
+ fstab (Radu Dineiu)
+ Quake (Nikolai Weibull)
+ Occam (Mario Schweigler)
+ lpc (Shizhu Pan)
+ Exim conf (David Necas)
+ EDIF (Artem Zankovich)
+ .cvsrc (Nikolai Weibull)
+ .fetchmailrc (Nikolai Weibull)
+ GNU gpg (Nikolai Weibull)
+ Grub (Nikolai Weibull)
+ Modconf (Nikolai Weibull)
+ RCS (Dmitry Vasiliev)
+ Art (Dorai Sitaram)
+ Renderman Interface Bytestream (Andrew J Bromage)
+ Mailcap (Doug Kearns)
+ Subversion commit file (Dmitry Vasiliev)
+ Microsoft IDL (Vadim Zeitlin)
+ WildPackets EtherPeek Decoder (Christopher Shinn)
+ Spyce (Rimon Barr)
+ Resolv.conf (Radu Dineiu)
+ A65 (Clemens Kirchgatterer)
+ sshconfig and sshdconfig (David Necas)
+ Cheetah and HTMLCheetah (Max Ischenko)
+ Packet filter (Camiel Dobbelaar)
+
+New indent files:
+ Eiffel (David Clarke)
+ Tilde (Tobias Rundtrom)
+ Occam (Mario Schweigler)
+ Art (Dorai Sitaram)
+ PHP (Miles Lott)
+ Dylan (Brent Fulgham)
+
+New tutor translations:
+ Slovak (Lubos Celko)
+ Greek (Christos Kontas)
+ German (Joachim Hofmann)
+ Norwegian (Øyvind Holm)
+
+New filetype plugins:
+ Occam (Mario Schweigler)
+ Art (Dorai Sitaram)
+ ant.vim, aspvbs.vim, config.vim, csc.vim, csh.vim, dtd.vim, html.vim,
+ jsp.vim, pascal.vim, php.vim, sgml.vim, sh.vim, svg.vim, tcsh.vim,
+ xhtml.vim, xml.vim, xsd.vim. (Dan Sharp)
+
+New compiler plugins:
+ Checkstyle (Doug Kearns)
+ g77 (Ralf Wildenhues)
+ fortran (Johann-Guenter Simon)
+ Xmllint (Doug Kearns)
+ Ruby (Tim Hammerquist)
+ Modelsim vcom (Paul Baleme)
+
+New menu translations:
+ Brazilian (José de Paula)
+ British (Mike Williams)
+ Korean in UTF-8. (Nam SungHyun)
+ Norwegian (Øyvind Holm)
+ Serbian (Aleksandar Jelenak)
+
+New message translation for Norwegian. (Øyvind Holm)
+
+New color scheme:
+ desert (Hans Fugal)
+
+Arabic specific features. 'arabicshape', 'termbidi', 'arabic' and
+'rightleftcmd' options. (Nadim Shaikli & Isam Bayazidi)
+
+Support for neXtaw GUI toolkit, mostly like Athena. (Alexey Froloff)
+
+Win32: cscope support. (Khorev Sergey)
+
+VMS: various improvements to documentation and makefiles. (Zoltan Arpadffy)
+
+Added "x" key to the explorer plugin: execute the default action. (Yasuhiro
+Matsumoto)
+
+Compile gvimext.dll with MingW. (Rene de Zwart)
+
+Add the "tohtml.vim" plugin. It defines the ":TOhtml" user command, an easy
+way to convert text to HTML.
+
+Added ":try" / ":catch" / ":finally" / ":endtry" commands. Add E999 numbers
+to all error messages, so that they can be caught by the number.
+(Servatius Brandt)
+Moved part of ex_docmd.c to the new ex_eval.c source file.
+
+Include support for GTK+ 2.2.x (Daniel Elstner)
+Adds the "~" register: drag & drop text.
+Adds the 'toolbariconsize' option.
+Add -Dalloca when running lint to work around a problem with alloca()
+prototype.
+
+When selecting an item in the error window to jump to, take some effort to
+find an ordinary window to show the file in (not a preview window).
+
+Support for PostScript printing of various 8-bit encodings. (Mike Williams)
+
+inputdialog() accepts a third argument that is used when the dialog is
+cancelled. Makes it possible to see a difference between cancelling and
+entering nothing.
+
+Included Aap recipes. Can be used to update Vim to the latest version,
+building and installing.
+
+"/" option in 'cinoptions': extra indent for comment lines. (Helmut Stiegler)
+
+Vim variable "v:register" and functions setreg(), getreg() and getregtype().
+(Michael Geddes)
+
+"v" flag in 'cpoptions': Leave text on screen with backspace in Insert mode.
+(Phillip Vandry)
+
+Dosinst.exe also finds gvimext.dll in the "GvimExt" directory. Useful when
+running install in the "src" directory for testing.
+
+Support tag files that were sorted with case ignored. (Flemming Madsen)
+
+When completing a wildcard in a leading path element, as in "../*/Makefile",
+only the last part ("Makefile") was listed. Support custom defined
+command line completion. (Flemming Madsen)
+
+Also recognize "rxvt" as an xterm-like terminal. (Tomas Styblo)
+
+Proper X11 session management. Fixes that the WM_SAVE_YOURSELF event was not
+used by popular desktops. (Neil Bird)
+Not used for Gnome 2, it has its own handling.
+
+Support BOR, DEBUG and SPAWNO arguments for the Borland 3 Makefile. (Walter
+Briscoe)
+
+Support page breaks for printing. Adds the "formfeed" field in
+'printoptions'. (Mike Williams)
+
+Mac OSX: multi-language support: iconv and gettext. (Muraoka Taro, Axel
+Kielhorn)
+
+"\Z" flag in patterns: ignore differences in combining characters. (Ron Aaron)
+
+Added 'preserveindent' and 'copyindent' options. They use existing white
+space characters instead of using Tabs as much as possible. (Chris Leishman)
+
+Updated Unicode tables to Unicode 4.0. (Raphael Finkel)
+
+Support for the mouse wheel in rxvt. (AIDA Shinra)
+
+Win32: Added ":8" file modifier to get short filename. Test50 tests the ":8"
+expansion on Win32 systems. (Michael Geddes)
+
+'cscopequickfix' option: Open quickfix window for Cscope commands. Also
+cleanup the code for giving messages. (Khorev Sergey)
+
+GUI: Support more than 222 columns for mouse positions.
+
+":stopinsert" command: Don't return to Insert mode.
+
+"interrupt" command for debug mode. Useful for simulating CTRL-C. (Servatius
+Brandt)
+
+
+Fixed *fixed-6.2*
+-----
+
+Removed a few unused #defines from config.h.in, os_os2_cfg.h and os_vms_conf.h.
+
+The Vim icons in PNG format didn't have a transparent background. (Greg
+Roelofs)
+
+Fixed a large number of spelling mistakes in the docs. (Adri Verhoef)
+
+The #defines for prototype generation were causing trouble. Changed them to
+typedefs.
+
+A new version of libintl.h uses __asm__, which confuses cproto. Define a
+dummy __asm__ macro.
+
+When 'virtualedit' is set can't move to halfway an unprintable character.
+Cripples CTRL-V selection. (Taro Muraoka)
+Allow moving to halfway an unprintable character. Don't let getvvcol() change
+the pos->coladd argument.
+
+When a tab wraps to the next line, 'listchars' is set and 'foldcolumn' is
+non-zero, only one character of the foldcolumn is highlighted. (Muraoka Taro)
+
+When using ":catch" without an argument Vim crashes. (Yasuhiro Matsumoto)
+When no argument given use the ".*" pattern.
+
+Win32: When gvim.exe is started from a shortcut with the window style property
+set to maximize Vim doesn't start with a maximized window. (Yasuhiro
+Matsumoto) Open the window with the default size and don't call ShowWindow()
+again when it's already visible. (Helmut Stiegler)
+
+gui_gtk.c used MAX, but it's undefined to avoid a conflict with system header
+files.
+
+Win32: When closing a window from a mapping some pixels remain on the
+statusline. (Yasuhiro Matsumoto)
+
+A column number in an errorformat that goes beyond the end of the line may
+cause a crash.
+
+":throw 'test'" crashes Vim. (Yasuhiro Matsumoto)
+
+The file selector's scrollbar colors are not set after doing a ":hi Scrollbar
+guifg=color". And the file selector's colors are not changed by the
+colorscheme command. (David Harrison)
+
+Motif: When compiling with FEAT_FOOTER defined, the text area gets a few
+pixels extra space on the right. Remove the special case in
+gui_get_base_width(). (David Harrison)
+
+Using CTRL-R CTRL-P in Insert mode puts the '] mark in the wrong position.
+(Helmut Stiegler)
+
+When 'formatoptions' includes "awct" a non-comment wasn't auto-formatted.
+
+Using a "--cmd" argument more than 10 times caused a crash.
+
+DEC style mouse support didn't work if the page field is not empty.
+(Uribarri)
+
+"vim -l one two" did only set 'lisp' in the first file. Vi does it for every
+file.
+
+":set tw<" didn't work. Was checking for '^' instead of '<'.
+
+In ":hardcopy > %.ps" the "%" was not expanded to the current filename.
+
+Made ":redraw" also update the Visual area.
+
+When a not implemented command, such as ":perl", has wrong arguments the less
+important error was reported, giving the user the idea the command could work.
+
+On non-Unix systems autocommands for writing did not attempt a match with the
+short file name, causing a pattern like "a/b" to fail.
+
+VMS: e_screenmode was not defined and a few other fixes for VMS. (Zoltan
+Arpadffy)
+
+redraw_msg() depended on FEAT_ARABIC instead of FEAT_RIGHTLEFT. (Walter
+Briscoe)
+
+Various changes for the PC Makefiles. (Walter Briscoe)
+
+Use _truename() instead of our own code to expand a file name into a full
+path. (Walter Briscoe)
+
+Error in filetype check for /etc/modutils. (Lubomir Host)
+
+Cscope interface: allocated a buffer too small.
+
+Win16: remove a trailing backslash from a path when obtaining the permission
+flags. (Vince Negri)
+
+When searching for tags with case ignored Vim could hang.
+
+When searching directories with a stopdir could get a crash. Did not
+re-allocate enough memory. (Vince Negri)
+
+A user command may cause a crash. Don't use the command index when it's
+negative. (Vince Negri)
+
+putenv() didn't work for MingW and Cygwin. (Dan Sharp)
+
+Many functions were common between os_msdos.c and os_win16.c. Use os_msdos.c
+for compiling the Win16 version and remove the functions from os_win16.c.
+(Vince Negri)
+
+For terminals that behave like an xterm but didn't have a name that is
+recognized, the window title would not always be set.
+
+When syntax highlighting is off ":hardcopy" could still attempt printing
+colors.
+
+Crash when using ":catch" without an argument. (Servatius Brandt)
+
+Win32: ":n #" doubled the backslashes.
+
+Fixed Arabic shaping for the command line. (Nadim Shaikli)
+
+Avoid splitting up a string displayed on the command line into individual
+characters, it breaks Arabic shaping.
+
+Updated Cygwin and MingW makefiles to use more dependencies. (Dan Sharp)
+
+2html.vim didn't work with 'nomagic' set.
+
+When a local argument list is used and doing ":only" Vim could crash later.
+(Muraoka Taro)
+
+When using "%P" in 'statusline' and the fillchar is "-", a percentage of 3%
+could result in "-3%". Also avoid changing a space inside a filename to the
+fill character.
+
+MSwin: Handling of backslashes and double quotes for command line arguments
+was not like what other applications do. (Walter Briscoe)
+
+Test32 sometimes didn't work, because test11.out was written as TEST11.OUT.
+
+Avoid pointer conversions warnings for Borland C 5.5 in dosinst.c and
+uninstal.c.
+
+More improvements for Make_bc3.mak file. (Walter Briscoe)
+
+When ":syn sync linebreaks=1" is used, editing the first line caused a redraw
+of the whole screen.
+
+Making translated messages didn't work, if_perl.xs wasn't found. (Vlad
+Sandrini)
+
+Motif and Athena: moving Vim to the foreground didn't uniconify it. Use
+XMapRaised() instead of XRaiseWindow(). (Srikanth Sankaran)
+
+When using ":ptag" in a window where 'scrollbind' is set the preview window
+would also have 'scrollbind' set. Also reset 'foldcolumn' and 'diff'.
+
+Various commands that split a window took over 'scrollbind', which is hardly
+ever desired. Esp. for "q:" and ":copen". Mostly reset 'scrollbind' when
+splitting a window.
+
+When 'shellslash' is set in the vimrc file the first entry of ":scriptnames"
+would still have backslashes. Entries in the quickfix list could also have
+wrong (back)slashes.
+
+Win32: printer dialog texts were not translated. (Yasuhiro Matsumoto)
+
+When using a multi-byte character with a K_SPECIAL byte or a special key code
+with "--remote-send" the received byte sequence was mangled. Put it in the
+typeahead buffer instead of the input buffer.
+
+Win32: The cursor position was incorrect after changing cursor shape.
+(Yasuhiro Matsumoto).
+
+Win32: When 'encoding' is not the current codepage the title could not be set
+to non-ascii characters.
+
+"vim -d scp://machine/file1 scp://machine/file2" did not work, there was only
+one window. Fixed the netrw plugin not to wipe out the buffer if it is
+displayed in other windows.
+
+"/$" caused "e" in last column of screen to disappear, a highlighted blank was
+displayed instead.
+
+":s/ *\ze\n//e" removed the line break and introduced arbitrary text. Was
+using the line count including what matched after the "\ze".
+
+Using the "c" flag with ":s" changed the behavior when a line break is
+replaced and "\@<=" is used. Without "c" a following match was not found.
+
+":%s/\vA@<=\nB@=//gce" got stuck on "A\nB" when entering "n".
+
+VMS: add HAVE_STRFTIME in the config file. (Zoltan Arpadffy)
+
+When a delete prompts if a delete should continue when yanking is not
+possible, restore msg_silent afterwards.
+
+":sign" did not complain about a missing argument.
+
+When adding or deleting a sign 'hlsearch' highlighting could disappear.
+Use the generic functions for updating signs.
+
+On MS-Windows NT, 2K and XP don't use command.com but cmd.exe for testing.
+Makes the tests work on more systems.
+
+In the DOS tests don't create "/tmp" to avoid an error.
+
+Mac classic: Problems with reading files with CR vs CR/LF. Rely on the
+library version of fgets() to work correctly for Metrowerks 2.2. (Axel
+Kielhorn)
+
+When typing a password a "*" was shown for each byte instead of for each
+character. Added multi-byte handling to displaying the stars. (Yasuhiro
+Matsumoto)
+
+When using Perl 5.6 accessing $curbuf doesn't work. Add an #ifdef to use
+different code for 5.6 and 5.8. (Dan Sharp)
+
+MingW and Cygwin: Don't strip the debug executable. (Dan Sharp)
+
+An assignment to a variable with curlies that includes "==" doesn't work.
+Skip over the curlies before searching for an "=". (Vince Negri)
+
+When cancelling the selection of alternate matching tags the tag stack index
+could be advanced too far, resulting in an error message when using CTRL-T.
+
+
+Patch 6.1.001
+Problem: When formatting UTF-8 text it might be wrapped at a space that is
+ followed by a composing character. (Raphael Finkel)
+ Also correct a display error for removing a composing char on top
+ of a space.
+Solution: Check for a composing character on a space.
+Files: src/edit.c, src/misc1.c, src/screen.c
+
+Patch 6.1.002 (extra)
+Problem: Win32: after a ":popup" command the mouse pointer stays hidden.
+Solution: Unhide the mouse pointer before showing the menu.
+Files: src/gui_w48.c
+
+Patch 6.1.003
+Problem: When 'laststatus' is zero and there is a vertical split, the
+ vertical separator is drawn in the command line. (Srikant
+ Sankaran)
+Solution: Don't draw the vertical separator where there is no statusline.
+Files: src/screen.c
+
+Patch 6.1.004
+Problem: Unicode 3.2 changes width and composing of a few characters.
+ (Markus Kuhn)
+Solution: Adjust the Unicode functions for the character width and composing
+ characters.
+Files: src/mbyte.c
+
+Patch 6.1.005
+Problem: When using more than 50 items in 'statusline' Vim might crash.
+ (Steve Hall)
+Solution: Increment itemcnt in check_stl_option(). (Flemming Madsen)
+Files: src/option.c
+
+Patch 6.1.006
+Problem: When using "P" in Visual mode to put linewise selected text, the
+ wrong text is deleted. (Jakub Turski)
+Solution: Put the text before the Visual area and correct the text to be
+ deleted for the inserted lines.
+ Also fix that "p" of linewise text in Visual block mode doesn't
+ work correctly.
+Files: src/normal.c, src/ops.c
+
+Patch 6.1.007
+Problem: Using ":filetype plugin off" when filetype plugins were never
+ enabled causes an error message. (Yiu Wing)
+Solution: Use ":silent!" to avoid the error message.
+Files: runtime/ftplugof.vim
+
+Patch 6.1.008
+Problem: The "%" command doesn't ignore \" inside a string, it's seen as
+ the end of the string. (Ken Clark)
+Solution: Skip a double quote preceded by an odd number of backslashes.
+Files: src/search.c
+
+Patch 6.1.009
+Problem: Vim crashes when using a huge number for the maxwid value in a
+ statusline. (Robert M. Nowotniak)
+Solution: Check for an overflow that makes maxwid negative.
+Files: src/buffer.c
+
+Patch 6.1.010
+Problem: Searching backwards for a question mark with "?\?" doesn't work.
+ (Alan Isaac) Same problem in ":s?\??" and ":g?\??".
+Solution: Change the "\?" in a pattern to "?" when using "?" as delimiter.
+Files: src/ex_cmds.c, src/ex_docmd.c, src/proto/regexp.pro, src/regexp.c,
+ src/search.c, src/syntax.c, src/tag.c
+
+Patch 6.1.011
+Problem: XIM: doesn't work correctly when 'number' is set. Also, a focus
+ problem when selecting candidates.
+Solution: Fix the XIM problems. (Yasuhiro Matsumoto)
+Files: src/mbyte.c, src/screen.c
+
+Patch 6.1.012
+Problem: A system() call might fail if fread() does CR-LF to LF
+ translation.
+Solution: Open the output file in binary mode. (Pavol Huhas)
+Files: src/misc1.c
+
+Patch 6.1.013
+Problem: Win32: The default for 'printexpr' doesn't work when there are
+ special characters in 'printdevice'.
+Solution: Add double quotes around the device name. (Mike Williams)
+Files: runtime/doc/option.txt, src/option.c
+
+Patch 6.1.014
+Problem: An operator like "r" used in Visual block mode doesn't use
+ 'virtualedit' when it's set to "block".
+Solution: Check for 'virtualedit' being active in Visual block mode when the
+ operator was started.
+Files: src/ex_docmd.c, src/globals.h, src/misc2.c, src/normal.c,
+ src/ops.c, src/undo.c
+
+Patch 6.1.015
+Problem: After patch 6.1.014 can't compile with tiny features. (Christian
+ J. Robinson)
+Solution: Add the missing define of virtual_op.
+Files: src/vim.h
+
+Patch 6.1.016 (extra)
+Problem: Win32: Outputting Hebrew or Arabic text might have a problem with
+ reversing.
+Solution: Replace the RevOut() function with ETO_IGNORELANGUAGE. (Ron Aaron)
+Files: src/gui_w32.c
+
+Patch 6.1.017
+Problem: Cygwin: After patch 6.1.012 Still doesn't do binary file I/O.
+ (Pavol Juhas)
+Solution: Define BINARY_FILE_IO for Cygwin.
+Files: src/os_unix.h
+
+Patch 6.1.018
+Problem: Error message when using cterm highlighting. (Leonardo Di Lella)
+Solution: Remove a backslash before a question mark.
+Files: runtime/syntax/cterm.vim
+
+Patch 6.1.019 (extra)
+Problem: Win32: File name is messed up when editing just a drive name.
+ (Walter Briscoe)
+Solution: Append a NUL after the drive name. (Vince Negri)
+Files: src/os_win32.c
+
+Patch 6.1.020
+Problem: col("'>") returns a huge number after using Visual line mode.
+Solution: Return the length of the line instead.
+Files: src/eval.c
+
+Patch 6.1.021 (depends on patch 6.1.009)
+Problem: Vim crashes when using a huge number for the minwid value in a
+ statusline. (Robert M. Nowotniak)
+Solution: Check for an overflow that makes minwid negative.
+Files: src/buffer.c
+
+Patch 6.1.022
+Problem: Grabbing the status line above the command-line window works like
+ the bottom status line was grabbed. (Jim Battle)
+Solution: Make it possible to grab the status line above the command-line
+ window, so that it can be resized.
+Files: src/ui.c
+
+Patch 6.1.023 (extra)
+Problem: VMS: running tests doesn't work properly.
+Solution: Adjust the makefile. (Zoltan Arpadffy)
+Files: src/testdir/Make_vms.mms
+
+Patch 6.1.024
+Problem: When header files use a new syntax for declaring functions, Vim
+ can't figure out missing prototypes properly.
+Solution: Accept braces around a function name. (M. Warner Losh)
+Files: src/osdef.sh
+
+Patch 6.1.025
+Problem: Five messages for "vim --help" don't start with a capital. (Vlad
+ Sandrini)
+Solution: Make the messages consistent.
+Files: src/main.c
+
+Patch 6.1.026
+Problem: *.patch files are not recognized as diff files. In a script a
+ "VAR=val" argument after "env" isn't ignored. PHP scripts are not
+ recognized.
+Solution: Add *.patch for diff filetypes. Ignore "VAR=val". Recognize PHP
+ scripts. (Roman Neuhauser)
+Files: runtime/filetype.vim, runtime/scripts.vim
+
+Patch 6.1.027
+Problem: When 'foldcolumn' is non-zero, a special character that wraps to
+ the next line disturbs the foldcolumn highlighting. (Yasuhiro
+ Matsumoto)
+Solution: Only use the special highlighting when drawing text characters.
+Files: src/screen.c
+
+Patch 6.1.028
+Problem: Client-server: When a --remote-expr fails, Vim still exits with
+ status zero.
+Solution: Exit Vim with a non-zero status to indicate the --remote-expr
+ failed. (Thomas Scott Urban)
+Files: src/main.c
+
+Patch 6.1.029
+Problem: When 'encoding' is an 8-bit encoding other than "latin1", editing
+ a utf-8 or other Unicode file uses the wrong conversion. (Jan
+ Fedak)
+Solution: Don't use Unicode to latin1 conversion for 8-bit encodings other
+ than "latin1".
+Files: src/fileio.c
+
+Patch 6.1.030
+Problem: When CTRL-N is mapped in Insert mode, it is also mapped after
+ CTRL-X CTRL-N, while it is not mapped after CTRL-X CTRL-F.
+ (Kontra Gergely)
+Solution: Don't map CTRL-N after CTRL-X CTRL-N. Same for CTRL-P.
+Files: src/getchar.c
+
+Patch 6.1.031
+Problem: Cygwin: Xxd could read a file in text mode intead of binary mode.
+Solution: Use "rb" or "rt" when needed. (Pavol Juhas)
+Files: src/xxd/xxd.c
+
+Patch 6.1.032
+Problem: Can't specify a quickfix file without jumping to the first error.
+Solution: Add the ":cgetfile" command. (Yegappan Lakshmanan)
+Files: runtime/doc/index.txt, runtime/doc/quickfix.txt, src/ex_cmds.h,
+ src/quickfix.c
+
+Patch 6.1.033
+Problem: GUI: When the selection is lost and the Visual highlighting is
+ changed to underlining, the cursor is left in a different
+ position. (Christian Michon)
+Solution: Update the cursor position after redrawing the selection.
+Files: src/ui.c
+
+Patch 6.1.034
+Problem: A CVS diff file isn't recognized as diff filetype.
+Solution: Skip lines starting with "? " before checking for an "Index:" line.
+Files: runtime/scripts.vim
+
+Patch 6.1.035 (extra, depends on 6.1.016)
+Problem: Win32: Outputting Hebrew or Arabic text might have a problem with
+ reversing on MS-Windows 95/98/ME.
+Solution: Restore the RevOut() function and use it in specific situations
+ only. (Ron Aaron)
+Files: src/gui_w32.c
+
+Patch 6.1.036
+Problem: This command may cause a crash: ":v/./,//-j". (Ralf Arens)
+Solution: Compute the right length of the regexp when it's empty.
+Files: src/search.c
+
+Patch 6.1.037
+Problem: When 'lazyredraw' is set, pressing "q" at the hit-enter prompt
+ causes an incomplete redraw and the cursor isn't positioned.
+ (Lubomir Host)
+Solution: Overrule 'lazyredraw' when do_redraw is set.
+Files: src/main.c, src/screen.c
+
+Patch 6.1.038
+Problem: Multi-byte: When a ":s" command contains a multi-byte character
+ where the trail byte is '~' the text is messed up.
+Solution: Properly skip multi-byte characters in regtilde() (Muraoka Taro)
+Files: src/regexp.c
+
+Patch 6.1.039
+Problem: When folds are defined and the file is changed outside of Vim,
+ reloading the file doesn't update the folds. (Anders
+ Schack-Nielsen)
+Solution: Recompute the folds after reloading the file.
+Files: src/fileio.c
+
+Patch 6.1.040
+Problem: When changing directory for expanding a file name fails there is
+ no error message.
+Solution: Give an error message for this situation. Don't change directory
+ if we can't return to the original directory.
+Files: src/diff.c, src/ex_docmd.c, src/globals.h, src/misc1.c,
+ src/os_unix.c
+
+Patch 6.1.041
+Problem: ":mkvimrc" doesn't handle a mapping that has a leading space in
+ the rhs. (Davyd Ondrejko)
+Solution: Insert a CTRL-V before the leading space. Also display leading
+ and trailing white space in <> form.
+Files: src/getchar.c, src/message.c
+
+Patch 6.1.042
+Problem: "vim -r" doesn't show all matches when 'wildignore' removes swap
+ files. (Steve Talley)
+Solution: Keep all matching swap file names.
+Files: src/memline.c
+
+Patch 6.1.043
+Problem: After patch 6.1.040 a few warnings are produced.
+Solution: Add a type cast to "char *" for mch_chdir(). (Axel Kielhorn)
+Files: src/diff.c, src/ex_docmd.c.c, src/misc1.c, src/os_unix.c
+
+Patch 6.1.044 (extra)
+Problem: GUI: When using the find/replace dialog with text that contains a
+ slash, an invalid substitute command is generated.
+ On Win32 a find doesn't work when 'insertmode' is set.
+Solution: Escape slashes with a backslash.
+ Make the Win32, Motif and GTK gui use common code for the
+ find/replace dialog.
+ Add the "match case" option for Motif and GTK.
+Files: src/feature.h, src/proto/gui.pro, src/gui.c, src/gui.h,
+ src/gui_motif.c, src/gui_gtk.c, src/gui_w48.c
+
+Patch 6.1.045
+Problem: In Visual mode, with lots of folds and 'scrolloff' set to 999,
+ moving the cursor down near the end of the file causes the text to
+ jump up and down. (Lubomir Host)
+Solution: Take into account that the cursor may be on the last line of a
+ closed fold.
+Files: src/move.c
+
+Patch 6.1.046
+Problem: X11 GUI: ":set lsp=2 gcr=n-v-i:hor1-blinkon0" draws a black
+ rectangle. ":set lsp=2 gcr=n-v-i:hor10-blinkon0" makes the cursor
+ disappear. (Nam SungHyun)
+Solution: Correctly compute the height of the horizontal cursor.
+Files: src/gui_gtk_x11.c, src/gui_x11.c
+
+Patch 6.1.047
+Problem: When skipping commands after an error was encountered, expressions
+ for ":if", ";elseif" and ":while" are still evaluated.
+Solution: Skip the expression after an error. (Servatius Brandt)
+Files: src/ex_docmd.c
+
+Patch 6.1.048
+Problem: Unicode 3.2 changes were missing a few Hangul Jamo characters.
+Solution: Recognize more characters as composing characters. (Jungshik Shin)
+Files: src/mbyte.c
+
+Patch 6.1.049 (extra)
+Problem: On a 32 bit display a valid color may cause an error message,
+ because its pixel value is negative. (Chris Paulson-Ellis)
+Solution: Check for -11111 instead of the color being negative.
+ Don't add one to the pixel value, -1 may be used for white.
+Files: src/globals.h, src/gui.c, src/gui.h, src/gui_amiga.c,
+ src/gui_athena.c, src/gui_beos.cc, src/gui_gtk_x11.c,
+ src/gui_mac.c, src/gui_motif.c, src/gui_photon.c,
+ src/gui_riscos.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c,
+ src/gui_x11.c, src/mbyte.c, src/syntax.c
+
+Patch 6.1.050 (depends on 6.1.049)
+Problem: After patch 6.1.049 the non-GUI version doesn't compile.
+Solution: Add an #ifdef FEAT_GUI. (Robert Stanton)
+Files: src/syntax.c
+
+Patch 6.1.051 (depends on 6.1.044)
+Problem: Doesn't compile with GUI and small features.
+Solution: Adjust the #if for ga_append().
+Files: src/misc2.c
+
+Patch 6.1.052
+Problem: Unix: The executable() function doesn't work when the "which"
+ command isn't available.
+Solution: Go through $PATH manually. Also makes it work for VMS.
+Files: src/os_unix.c
+
+Patch 6.1.053
+Problem: When 'sessionoptions' contains "globals", or "localoptions" and an
+ option value contains a line break, the resulting script is wrong.
+Solution: Use "\n" and "\r" for a line break. (Srinath Avadhanula)
+Files: src/eval.c
+
+Patch 6.1.054
+Problem: GUI: A mouse click is not recognized at the more prompt, even when
+ 'mouse' includes 'r'.
+Solution: Recognize a mouse click at the more prompt.
+ Also accept a mouse click in the last line in the GUI.
+ Add "ml" entry in 'mouseshape'.
+Files: src/gui.c, src/message.c, src/misc1.c, src/misc2.c, src/option.c,
+ src/structs.h
+
+Patch 6.1.055
+Problem: When editing a compressed file, Vim will inspect the contents to
+ guess the filetype.
+Solution: Don't source scripts.vim for .Z, .gz, .bz2, .zip and .tgz files.
+Files: runtime/filetype.vim, runtime/plugin/gzip.vim
+
+Patch 6.1.056
+Problem: Loading the Syntax menu can take quite a bit of time.
+Solution: Add the "skip_syntax_sel_menu" variable. When its defined the
+ available syntax files are not in the Syntax menu.
+Files: runtime/doc/gui.txt, runtime/menu.vim
+
+Patch 6.1.057
+Problem: An ESC inside a mapping doesn't work as documented when
+ 'insertmode' is set, it does go from Visual or Normal mode to
+ Insert mode. (Benji Fisher)
+Solution: Make it work as documented.
+Files: src/normal.c
+
+Patch 6.1.058
+Problem: When there is a closed fold just above the first line in the
+ window, using CTRL-X CTRL-Y in Insert mode will show only one line
+ of the fold. (Alexey Marinichev)
+Solution: Correct the topline by putting it at the start of the fold.
+Files: src/move.c
+
+Patch 6.1.059
+Problem: ":redir > ~/file" doesn't work. (Stephen Rasku)
+Solution: Expand environment variables in the ":redir >" argument.
+Files: src/ex_docmd.c
+
+Patch 6.1.060
+Problem: When 'virtualedit' is set and 'selection' is "exclusive", deleting
+ a character just before a tab changes the tab into spaces. Undo
+ doesn't restore the tab. (Helmut Stiegler)
+Solution: Don't replace the tab by spaces when it's not needed. Correctly
+ save the line before it's changed.
+Files: src/ops.c
+
+Patch 6.1.061
+Problem: When 'virtualedit' is set and 'selection' is "exclusive", a Visual
+ selection that ends just after a tab doesn't include that tab in
+ the highlighting. (Helmut Stiegler)
+Solution: Use a different way to exclude the character under the cursor.
+Files: src/screen.c
+
+Patch 6.1.062
+Problem: The "man" filetype plugin doesn't work properly on Solaris 5.
+Solution: Use a different way to detect that "man -s" should be used. (Hugh
+ Sasse)
+Files: runtime/ftplugin/man.vim
+
+Patch 6.1.063
+Problem: Java indenting doesn't work properly.
+Solution: Ignore comments when checking if the indent doesn't increase after
+ a "}".
+Files: runtime/indent/java.vim
+
+Patch 6.1.064
+Problem: The URLs that the netrw plugin recognized for ftp and rcp did not
+ conform to the standard method://[user@]host[:port]/path.
+Solution: Use ftp://[user@]host[[:#]port]/path, which supports both the new
+ and the previous style. Also added a bit of dav/cadaver support.
+ (Charles Campbell)
+Files: runtime/plugin/netrw.vim
+
+Patch 6.1.065
+Problem: VMS: The colorscheme, keymap and compiler menus are not filled in.
+Solution: Ignore case when looking for ".vim" files. (Coen Engelbarts)
+Files: runtime/menu.vim
+
+Patch 6.1.066 (extra)
+Problem: When calling system() in a plugin reading stdin hangs.
+Solution: Don't set the terminal to RAW mode when it wasn't in RAW mode
+ before the system() call.
+Files: src/os_amiga.c, src/os_msdos.c, src/os_riscos.c, src/os_unix.c,
+ src/os_win16.c, src/os_win32.c
+
+Patch 6.1.067
+Problem: ":set viminfo+=f0" is not working. (Benji Fisher)
+Solution: Check the "f" flag instead of "'" in 'viminfo'.
+Files: src/mark.c
+
+Patch 6.1.068
+Problem: When a file is reloaded after it was changed outside of Vim, diff
+ mode isn't updated. (Michael Naumann)
+Solution: Invalidate the diff info so that it's updated when needed.
+Files: src/fileio.c
+
+Patch 6.1.069
+Problem: When 'showmatch' is set and "$" is in 'cpoptions', using
+ "C}<Esc>" may forget to remove the "$". (Preben Guldberg)
+Solution: Restore dollar_vcol after displaying the matching cursor position.
+Files: src/search.c
+
+Patch 6.1.070 (depends on 6.1.060)
+Problem: Compiler warning for signed/unsigned mismatch. (Mike Williams)
+Solution: Add a typecast to int.
+Files: src/ops.c
+
+Patch 6.1.071
+Problem: When 'selection' is exclusive, g CTRL-G in Visual mode counts one
+ character too much. (David Necas)
+Solution: Subtract one from the end position.
+Files: src/ops.c
+
+Patch 6.1.072
+Problem: When a file name in a tags file starts with http:// or something
+ else for which there is a BufReadCmd autocommand, the file isn't
+ opened anyway.
+Solution: Check if there is a matching BufReadCmd autocommand and try to
+ open the file.
+Files: src/fileio.c, src/proto/fileio.pro, src/tag.c
+
+Patch 6.1.073 (extra)
+Problem: BC5: Can't easily specify a tiny, small, normal, big or huge
+ version.
+Solution: Allow selecting the version with the FEATURES variable. (Ajit
+ Thakkar)
+Files: src/Make_bc5.mak
+
+Patch 6.1.074
+Problem: When 'cdpath' includes "../..", changing to a directory in which
+ we currently already are doesn't work. ff_check_visited() adds
+ the directory both when using it as the root for searching and for
+ the actual matches. (Stephen Rasku)
+Solution: Use a separate list for the already searched directories.
+Files: src/misc2.c
+
+Patch 6.1.075 (depends on 6.1.072)
+Problem: Can't compile fileio.c on MS-Windows.
+Solution: Add a declaration for the "p" pointer. (Madoka Machitani)
+Files: src/fileio.c
+
+Patch 6.1.076 (extra)
+Problem: Macintosh: explorer plugin doesn't work on Mac Classic.
+ IME doesn't work. Dialog boxes don't work on Mac OS X
+Solution: Fix explorer plugin and key modifiers. (Axel Kielhorn)
+ Fix IME support. (Muraoka Taro)
+ Disable dialog boxes. (Benji Fisher)
+Files: src/edit.c, src/feature.h, src/gui_mac.c, src/os_mac.c
+
+Patch 6.1.077
+Problem: On a Debian systEm wht ACL linking fails. (Lubomir Host)
+Solution: When the "acl" library is used, check if the "attr" library is
+ present and use it.
+Files: src/auto/configure, src/configure.in, src/link.sh
+
+Patch 6.1.078
+Problem: When using 'foldmethod' "marker" and the end marker appears before
+ the start marker in the file, no fold is found. (Nazri Ramliy)
+Solution: Don't let the fold depth go negative.
+Files: src/fold.c
+
+Patch 6.1.079
+Problem: When using "s" in Visual block mode with 'virtualedit' set, when
+ the selected block is after the end of some lines the wrong text
+ is inserted and some lines are skipped. (Servatius Brandt)
+Solution: Insert the right text and extend short lines.
+Files: src/ops.c
+
+Patch 6.1.080
+Problem: When using gcc with /usr/local already in the search path, adding
+ it again causes problems.
+Solution: Adjust configure.in to avoid adding /usr/local/include and
+ /usr/local/lib when using GCC and they are already used. (Johannes
+ Zellner)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.081
+Problem: ":help CTRL-\_CTRL-N" doesn't work. (Christian J. Robinson)
+Solution: Double the backslash to avoid the special meaning of "\_".
+Files: src/ex_cmds.c
+
+Patch 6.1.082
+Problem: On MS-Windows the vimrc_example.vim script is sourced and then
+ mswin.vim. This enables using select mode, but since "p" is
+ mapped it doesn't replace the selection.
+Solution: Remove the mapping of "p" from vimrc_example.vim, it's obsolete.
+ (Vlad Sandrini)
+Files: runtime/vimrc_example.vim
+
+Patch 6.1.083
+Problem: When $LANG is "sk" or "sk_sk", the Slovak menu file isn't found.
+ (Martin Lacko)
+Solution: Guess the right menu file based on the system.
+Files: runtime/lang/menu_sk_sk.vim
+
+Patch 6.1.084 (depends on 6.1.080)
+Problem: "include" and "lib" are mixed up when checking the directories gcc
+ already searches.
+Solution: Swap the variable names. (SunHo Kim)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.085
+Problem: When using CTRL-O CTRL-\ CTRL-N from Insert mode, the displayed
+ mode "(insert)" isn't removed. (Benji Fisher)
+Solution: Clear the command line.
+Files: src/normal.c
+
+Patch 6.1.086 (depends on 6.1.049)
+Problem: The guifg color for CursorIM doesn't take effect.
+Solution: Use the foreground color when it's defined. (Muraoka Taro)
+Files: src/gui.c
+
+Patch 6.1.087
+Problem: A thesaurus with Japanese characters has problems with characters
+ in different word classes.
+Solution: Only separate words with single-byte non-word characters.
+ (Muraoka Taro)
+Files: src/edit.c
+
+Patch 6.1.088 (extra)
+Problem: Win32: no debugging info is generated. Tags file excludes .cpp
+ files.
+Solution: Add "/map" to compiler flags. Add "*.cpp" to ctags command.
+ (Muraoka Taro)
+Files: src/Make_mvc.mak
+
+Patch 6.1.089
+Problem: On BSDI systems there is no ss_sp field in stack_t. (Robert Jan)
+Solution: Use ss_base instead.
+Files: src/auto/configure, src/configure.in, src/config.h.in,
+ src/os_unix.c
+
+Patch 6.1.090
+Problem: CTRL-F gets stuck when 'scrolloff' is non-zero and there is a mix
+ of long wrapping lines and a non-wrapping line.
+Solution: Check that CTRL-F scrolls at least one line.
+Files: src/move.c
+
+Patch 6.1.091
+Problem: GTK: Can't change preeditstate without setting 'imactivatekey'.
+Solution: Add some code to change preeditstate for OnTheSpot. (Yasuhiro
+ Matsumoto)
+Files: src/mbyte.c
+
+Patch 6.1.092
+Problem: ":mapclear <buffer>" doesn't work. (Srikanth Adayapalam)
+Solution: Allow an argument for ":mapclear".
+Files: src/ex_cmds.h
+
+Patch 6.1.093 (extra)
+Problem: Mac and MS-Windows GUI: when scrolling while ":s" is working the
+ results can be messed up, because the cursor is moved.
+Solution: Disallow direct scrolling when not waiting for a character.
+Files: src/gui_mac.c, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c
+
+Patch 6.1.094
+Problem: Cygwin: Passing a file name that has backslashes isn't handled
+ very well.
+Solution: Convert file name arguments to Posix. (Chris Metcalf)
+Files: src/main.c
+
+Patch 6.1.095
+Problem: When using signs can free an item on the stack.
+ Overruling sign colors doesn't work. (Srikanth Sankaran)
+Solution: Don't free the item on the stack. Use NULL instead of "none" for
+ the value of the color.
+Files: src/gui_x11.c
+
+Patch 6.1.096
+Problem: When erasing the right halve of a double-byte character, it may
+ cause further characters to be erased. (Yasuhiro Matsumoto)
+Solution: Make sure only one character is erased.
+Files: src/screen.c
+
+Patch 6.1.097 (depends on 6.1.090)
+Problem: When 'scrolloff' is set to a huge value, CTRL-F at the end of the
+ file scrolls one line. (Lubomir Host)
+Solution: Don't scroll when CTRL-F detects the end-of-file.
+Files: src/move.c
+
+Patch 6.1.098
+Problem: MS-Windows: When the xxd program is under "c:\program files" the
+ "Convert to Hex" menu doesn't work. (Brian Mathis)
+Solution: Put the path to xxd in double quotes.
+Files: runtime/menu.vim
+
+Patch 6.1.099
+Problem: Memory corrupted when closing a fold with more than 99999 lines.
+Solution: Allocate more space for the fold text. (Walter Briscoe)
+Files: src/eval.c
+
+Patch 6.1.100 (extra, depends on 6.1.088)
+Problem: Win32: VC5 and earlier don't support the /mapinfo option.
+Solution: Add "/mapinfo" only when "MAP=lines" is specified. (Muraoka Taro)
+Files: src/Make_mvc.mak
+
+Patch 6.1.101
+Problem: After using ":options" the tabstop of a new window is 15. Entry
+ in ":options" window for 'autowriteall' is wrong. (Antoine J
+ Mechelynck) Can't insert a space in an option value.
+Solution: Use ":setlocal" instead of ":set". Change "aw" to "awa".
+ Don't map space in Insert mode.
+Files: runtime/optwin.vim
+
+Patch 6.1.102
+Problem: Unprintable and multi-byte characters in a statusline item are not
+ truncated correctly. (Yasuhiro Matsumoto)
+Solution: Count the width of characters instead of the number of bytes.
+Files: src/buffer.c
+
+Patch 6.1.103
+Problem: A function returning from a while loop, with 'verbose' set to 12
+ or higher, doesn't mention the return value. A function with the
+ 'abort' attribute may return -1 while the verbose message says
+ something else.
+Solution: Move the verbose message about returning from a function to
+ call_func(). (Servatius Brandt)
+Files: src/eval.c
+
+Patch 6.1.104
+Problem: GCC 3.1 appears to have an optimizer problem that makes test 3
+ crash.
+Solution: For GCC 3.1 add -fno-strength-reduce to avoid the optimizer bug.
+ Filter out extra info from "gcc --version".
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.105
+Problem: Win32: The default for 'shellpipe' doesn't redirect stderr. (Dion
+ Nicolaas)
+Solution: Redirect stderr, depending on the shell (like for 'shellredir').
+Files: src/option.c
+
+Patch 6.1.106
+Problem: The maze program crashes.
+Solution: Change "11" to "27" and it works. (Greg Roelofs)
+Files: runtime/macros/maze/mazeansi.c
+
+Patch 6.1.107
+Problem: When 'list' is set the current line in the error window may be
+ displayed wrong. (Muraoka Taro)
+Solution: Don't continue the line after the $ has been displayed and the
+ rightmost column is reached.
+Files: src/screen.c
+
+Patch 6.1.108
+Problem: When interrupting a filter command such as "!!sleep 20" the file
+ becomes read-only. (Mark Brader)
+Solution: Only set the read-only flag when opening a buffer is interrupted.
+ When the shell command was interrupted, read the output that was
+ produced so far.
+Files: src/ex_cmds.c, src/fileio.c
+
+Patch 6.1.109
+Problem: When 'eadirection' is "hor", using CTRL-W = doesn't equalize the
+ window heights. (Roman Neuhauser)
+Solution: Ignore 'eadirection' for CTRL-W =
+Files: src/window.c
+
+Patch 6.1.110
+Problem: When using ":badd file" when "file" is already present but not
+ listed, it stays unlisted. (David Frey)
+Solution: Set 'buflisted'.
+Files: src/buffer.c
+
+Patch 6.1.111
+Problem: It's not possible to detect using the Unix sources on Win32 or Mac.
+Solution: Add has("macunix") and has("win32unix").
+Files: runtime/doc/eval.txt, src/eval.c
+
+Patch 6.1.112
+Problem: When using ":argdo", ":bufdo" or ":windo", CTRL-O doesn't go to
+ the cursor position from before this command but every position
+ where the argument was executed.
+Solution: Only remember the cursor position from before the ":argdo",
+ ":bufdo" and ":windo".
+Files: src/ex_cmds2.c, src/mark.c
+
+Patch 6.1.113
+Problem: ":bufdo bwipe" only wipes out half the buffers. (Roman Neuhauser)
+Solution: Decide what buffer to go to next before executing the command.
+Files: src/ex_cmds2.c
+
+Patch 6.1.114
+Problem: ":python import vim", ":python vim.current.buffer[0:0] = []" gives
+ a lalloc(0) error. (Chris Southern)
+Solution: Don't allocate an array when it's size is zero.
+Files: src/if_python.c
+
+Patch 6.1.115
+Problem: "das" on the white space at the end of a paragraph does not delete
+ the "." the sentence ends with.
+Solution: Don't exclude the last character when it is not white space.
+Files: src/search.c
+
+Patch 6.1.116
+Problem: When 'endofline' is changed while 'binary' is set a file should be
+ considered modified. (Olaf Buddenhagen)
+Solution: Remember the 'eol' value when editing started and consider the
+ file changed when the current value is different and 'binary' is
+ set. Also fix that the window title isn't updated when 'ff' or
+ 'bin' changes.
+Files: src/option.c, src/structs.h
+
+Patch 6.1.117
+Problem: Small problem with editing a file over ftp: and with Cygwin.
+Solution: Remove a dot from a ":normal" command. Use "cygdrive" where
+ appropriate. (Charles Campbell)
+Files: runtime/plugin/netrw.vim
+
+Patch 6.1.118
+Problem: When a file in diff mode is reloaded because it changed outside
+ of Vim, other windows in diff mode are not always updated.
+ (Michael Naumann)
+Solution: After reloading a file in diff mode mark all windows in diff mode
+ for redraw.
+Files: src/diff.c
+
+Patch 6.1.119 (extra)
+Problem: With the Sniff interface, using Sniff 4.0.X on HP-UX, there may be
+ a crash when connecting to Sniff.
+Solution: Initialize sniff_rq_sep such that its value can be changed.
+ (Martin Egloff)
+Files: src/if_sniff.c
+
+Patch 6.1.120 (depends on 6.1.097)
+Problem: When 'scrolloff' is non-zero and there are folds, CTRL-F at the
+ end of the file scrolls part of a closed fold. (Lubomir Host)
+Solution: Adjust the first line to the start of a fold.
+Files: src/move.c
+
+Patch 6.1.121 (depends on 6.1.098)
+Problem: When starting Select mode from Insert mode, then using the Paste
+ menu entry, the cursor is left before the laste pasted character.
+ (Mario Schweigler)
+Solution: Set the cursor for Insert mode one character to the right.
+Files: runtime/menu.vim
+
+Patch 6.1.122
+Problem: ":file name" creates a new buffer to hold the old buffer name,
+ which becomes the alternate file. This buffer is unexpectedly
+ listed.
+Solution: Create the buffer for the alternate name unlisted.
+Files: src/ex_cmds.c
+
+Patch 6.1.123
+Problem: A ":match" command with more than one argument doesn't report an
+ error.
+Solution: Check for extra characters. (Servatius Brandt)
+Files: src/ex_docmd.c
+
+Patch 6.1.124
+Problem: When trying to exit and there is a hidden buffer that had 'eol'
+ off and 'bin' set exiting isn't possible. (John McGowan)
+Solution: Set b_start_eol when clearing the buffer.
+Files: src/buffer.c
+
+Patch 6.1.125
+Problem: Explorer plugin asks for saving a modified buffer even when it's
+ open in another window as well.
+Solution: Count the number of windows using the buffer.
+Files: runtime/plugin/explorer.vim
+
+Patch 6.1.126
+Problem: Adding the choices in the syntax menu is consuming much of the
+ startup time of the GUI while it's not often used.
+Solution: Only add the choices when the user wants to use them.
+Files: Makefile, runtime/makemenu.vim, runtime/menu.vim,
+ runtime/synmenu.vim, src/Makefile
+
+Patch 6.1.127
+Problem: When using "--remote file" and the server has 'insertmode' set,
+ commands are inserted instead of being executed. (Niklas Volbers)
+Solution: Go to Normal mode again after the ":drop" command.
+Files: src/main.c
+
+Patch 6.1.128
+Problem: The expression "input('very long prompt')" puts the cursor in the
+ wrong line (column is OK).
+Solution: Add the wrapped lines to the indent. (Yasuhiro Matsumoto)
+Files: src/ex_getln.c
+
+Patch 6.1.129
+Problem: On Solaris editing "file/" and then "file" results in using the
+ same buffer. (Jim Battle)
+Solution: Before using stat(), check that there is no illegal trailing
+ slash.
+Files: src/auto/configure, src/config.h.in, src/configure.in,
+ src/macros.h src/misc2.c, src/proto/misc2.pro
+
+Patch 6.1.130
+Problem: The documentation for some of the 'errorformat' items is unclear.
+Solution: Add more examples and explain hard to understand items. (Stefan
+ Roemer)
+Files: runtime/doc/quickfix.txt
+
+Patch 6.1.131
+Problem: X11 GUI: when expanding a CSI byte in the input stream to K_CSI,
+ the CSI byte itself isn't copied.
+Solution: Copy the CSI byte.
+Files: src/gui_x11.c
+
+Patch 6.1.132
+Problem: Executing a register in Ex mode may cause commands to be skipped.
+ (John McGowan)
+Solution: In Ex mode use an extra check if the register contents was
+ consumed, to avoid input goes into the typeahead buffer.
+Files: src/ex_docmd.c
+
+Patch 6.1.133
+Problem: When drawing double-wide characters in the statusline, may clear
+ half of a character. (Yasuhiro Matsumoto)
+Solution: Force redraw of the next character by setting the attributes
+ instead of putting a NUL in ScreenLines[]. Do put a NUL in
+ ScreenLines[] when overwriting half of a double-wide character.
+Files: src/screen.c
+
+Patch 6.1.134
+Problem: An error for a trailing argument of ":match" should not be given
+ after ":if 0". (Servatius Brandt)
+Solution: Only do the check when executing commands.
+Files: src/ex_docmd.c
+
+Patch 6.1.135
+Problem: Passing a command to the shell that includes a newline always has
+ a backslash before the newline.
+Solution: Remove one backslash before the newline. (Servatius Brandt)
+Files: src/ex_docmd.c
+
+Patch 6.1.136
+Problem: When $TERM is "linux" the default for 'background' is "dark", even
+ though the GUI uses a light background. (Hugh Allen)
+Solution: Don't mark the option as set when defaulting to "dark" for the
+ linux console. Also reset 'background' to "light" when the GUI
+ has a light background.
+Files: src/option.c
+
+Patch 6.1.137
+Problem: Converting to HTML has a clumsy way of dealing with tabs which may
+ change the highlighting.
+Solution: Replace tabs with spaces after converting a line to HTML. (Preben
+ Guldberg)
+Files: runtime/syntax/2html.vim
+
+Patch 6.1.138 (depends on 6.1.126)
+Problem: Adding extra items to the Syntax menu can't be done when the "Show
+ individual choices" menu is used.
+Solution: Use ":runtime!" instead of ":source", so that all synmenu.vim
+ files in the runtime path are loaded. (Servatius Brandt)
+ Also fix that a translated menu can't be removed.
+Files: runtime/menu.vim
+
+Patch 6.1.139
+Problem: Cygwin: PATH_MAX is not defined.
+Solution: Include limits.h. (Dan Sharp)
+Files: src/main.c
+
+Patch 6.1.140
+Problem: Cygwin: ":args `ls *.c`" does not work if the shell command
+ produces CR NL line separators.
+Solution: Remove the CR characters ourselves. (Pavol Juhas)
+Files: src/os_unix.c
+
+Patch 6.1.141
+Problem: ":wincmd gx" may cause problems when mixed with other commands.
+ ":wincmd c" doesn't close the window immediately. (Benji Fisher)
+Solution: Pass the extra command character directly instead of using the
+ stuff buffer and call ex_close() directly.
+Files: src/ex_docmd.c, src/normal.c, src/proto/normal.pro,
+ src/proto/window.pro, src/window.c
+
+Patch 6.1.142
+Problem: Defining paragraphs without a separating blank line isn't
+ possible. Paragraphs can't be formatted automatically.
+Solution: Allow defining paragraphs with lines that end in white space.
+ Added the 'w' and 'a' flags in 'formatoptions'.
+Files: runtime/doc/change.txt, src/edit.c, src/misc1.c, src/normal.c,
+ src/option.h, src/ops.c, src/proto/edit.pro, src/proto/ops.pro,
+ src/vim.h
+
+Patch 6.1.143 (depends on 6.1.142)
+Problem: Auto formatting near the end of the file moves the cursor to a
+ wrong position. In Insert mode some lines are made one char too
+ narrow. When deleting a line undo might not always work properly.
+Solution: Don't always move to the end of the line in the last line. Don't
+ position the cursor past the end of the line in Insert mode.
+ After deleting a line save the cursor line for undo.
+Files: src/edit.c, src/ops.c, src/normal.c
+
+Patch 6.1.144
+Problem: Obtaining the size of a line in screen characters can be wrong.
+ A pointer may wrap around zero.
+Solution: In win_linetabsize() check for a MAXCOL length argument. (Jim
+ Dunleavy)
+Files: src/charset.c
+
+Patch 6.1.145
+Problem: GTK: Drag&drop with more than 3 files may cause a crash. (Mickael
+ Marchand)
+Solution: Rewrite the code that parses the received list of files to be more
+ robust.
+Files: src/charset.c, src/gui_gtk_x11.c
+
+Patch 6.1.146
+Problem: MS-Windows: When $HOME is constructed from $HOMEDRIVE and
+ $HOMEPATH, it is not used for storing the _viminfo file. (Normal
+ Diamond)
+Solution: Set $HOME with the value obtained from $HOMEDRIVE and $HOMEPATH.
+Files: src/misc1.c
+
+Patch 6.1.147 (extra)
+Problem: MS-Windows: When a dialog has no default button, pressing Enter
+ ends it anyway and all buttons are selected.
+Solution: Don't end a dialog when there is no default button. Don't select
+ all button when there is no default. (Vince Negri)
+Files: src/gui_w32.c
+
+Patch 6.1.148 (extra)
+Problem: MS-Windows: ACL is not properly supported.
+Solution: Add an access() replacement that also works for ACL. (Mike
+ Williams)
+Files: runtime/doc/editing.txt, src/os_win32.c
+
+Patch 6.1.149 (extra)
+Problem: MS-Windows: Can't use diff mode from the file explorer.
+Solution: Add a "diff with Vim" context menu entry. (Dan Sharp)
+Files: GvimExt/gvimext.cpp, GvimExt/gvimext.h
+
+Patch 6.1.150
+Problem: OS/2, MS-Windows and MS-DOS: When 'shellslash' is set getcwd()
+ still uses backslash. (Yegappan Lakshmanan)
+Solution: Adjust slashes in getcwd().
+Files: src/eval.c
+
+Patch 6.1.151 (extra)
+Problem: Win32: The NTFS substream isn't copied.
+Solution: Copy the substream when making a backup copy. (Muraoka Taro)
+Files: src/fileio.c, src/os_win32.c, src/proto/os_win32.pro
+
+Patch 6.1.152
+Problem: When $LANG is iso8859-1 translated menus are not used.
+Solution: Change iso8859 to iso_8859.
+Files: runtime/menu.vim
+
+Patch 6.1.153
+Problem: Searching in included files may search recursively when the path
+ starts with "../". (Sven Berkvens-Matthijsse)
+Solution: Compare full file names, use inode/device when possible.
+Files: src/search.c
+
+Patch 6.1.154 (extra)
+Problem: DJGPP: "vim -h" leaves the cursor in a wrong position.
+Solution: Don't position the cursor using uninitialized variables. (Jim
+ Dunleavy)
+Files: src/os_msdos.c
+
+Patch 6.1.155
+Problem: Win32: Cursor may sometimes disappear in Insert mode.
+Solution: Change "hor10" in 'guicursor' to "hor15". (Walter Briscoe)
+Files: src/option.c
+
+Patch 6.1.156
+Problem: Conversion between DBCS and UCS-2 isn't implemented cleanly.
+Solution: Clean up a few things.
+Files: src/mbyte.c, src/structs.h
+
+Patch 6.1.157
+Problem: 'hlsearch' highlights only the second comma in ",,,,," with
+ "/,\@<=[^,]*". (Preben Guldberg)
+Solution: Also check for an empty match to start just after a previous
+ match.
+Files: src/screen.c
+
+Patch 6.1.158
+Problem: "zs" and "ze" don't work correctly with ":set nowrap siso=1".
+ (Preben Guldberg)
+Solution: Take 'siso' into account when computing the horizontal scroll
+ position for "zs" and "ze".
+Files: src/normal.c
+
+Patch 6.1.159
+Problem: When expanding an abbreviation that includes a multi-byte
+ character too many characters are deleted. (Andrey Urazov)
+Solution: Delete the abbreviation counting characters instead of bytes.
+Files: src/getchar.c
+
+Patch 6.1.160
+Problem: ":$read file.gz" doesn't work. (Preben Guldberg)
+Solution: Don't use the '[ mark after it has become invalid.
+Files: runtime/plugin/gzip.vim
+
+Patch 6.1.161 (depends on 6.1.158)
+Problem: Warning for signed/unsigned compare. Can set 'siso' to a negative
+ value. (Mike Williams)
+Solution: Add a typecast. Add a check for 'siso' being negative.
+Files: src/normal.c, src/option.c
+
+Patch 6.1.162
+Problem: Python interface: Didn't initialize threads properly.
+Solution: Call PyEval_InitThreads() when starting up.
+Files: src/if_python.c
+
+Patch 6.1.163
+Problem: Win32: Can't compile with Python after 6.1.162.
+Solution: Dynamically load PyEval_InitThreads(). (Dan Sharp)
+Files: src/if_python.c
+
+Patch 6.1.164
+Problem: If 'modifiable' is off, converting to xxd fails and 'filetype' is
+ changed to "xxd" anyway.
+Solution: Don't change 'filetype' when conversion failed.
+Files: runtime/menu.vim
+
+Patch 6.1.165
+Problem: Making changes in several lines and then a change in one of these
+ lines that splits it in two or more lines, undo information was
+ corrupted. May cause a crash. (Dave Fishburn)
+Solution: When skipping to save a line for undo because it was already
+ saved, move it to become the last saved line, so that when the
+ command changes the line count other saved lines are not involved.
+Files: src/undo.c
+
+Patch 6.1.166
+Problem: When 'autoindent' is set and mswin.vim has been sourced, pasting
+ with CTRL-V just after auto-indenting removes the indent. (Shlomi
+ Fish)
+Solution: First insert an "x" and delete it again, so that the auto-indent
+ remains.
+Files: runtime/mswin.vim
+
+Patch 6.1.167
+Problem: When giving a negative argument to ":retab" strange things start
+ happening. (Hans Ginzel)
+Solution: Check for a negative value.
+Files: src/ex_cmds.c
+
+Patch 6.1.168
+Problem: Pressing CTRL-C at the hit-enter prompt doesn't end the prompt.
+Solution: Make CTRL-C stop the hit-enter prompt.
+Files: src/message.c
+
+Patch 6.1.169
+Problem: bufexists() finds a buffer by using the name of a symbolic link to
+ it, but bufnr() doesn't. (Yegappan Lakshmanan)
+Solution: When bufnr() can't find a buffer, try using the same method as
+ bufexists().
+Files: src/eval.c
+
+Patch 6.1.170
+Problem: Using ":mksession" uses the default session file name, but "vim
+ -S" doesn't. (Hans Ginzel)
+Solution: Use the default session file name if "-S" is the last command
+ line argument or another option follows.
+Files: runtime/doc/starting.txt, src/main.c
+
+Patch 6.1.171
+Problem: When opening a line just above a closed fold with "O" and the
+ comment leader is automatically inserted, the cursor is displayed
+ in the first column. (Sung-Hyun Nam)
+Solution: Update the flag that indicates the cursor is in a closed fold.
+Files: src/misc1.c
+
+Patch 6.1.172
+Problem: Command line completion of ":tag /pat" does not show the same
+ results as the tags the command actually finds. (Gilles Roy)
+Solution: Don't modify the pattern to make it a regexp.
+Files: src/ex_getln.c, src/tag.c
+
+Patch 6.1.173
+Problem: When using remote control to edit a position in a file and this
+ file is the current buffer and it's modified, the window is split
+ and the ":drop" command fails.
+Solution: Don't split the window, keep editing the same buffer.
+ Use the ":drop" command in VisVim to avoid the problem there.
+Files: src/ex_cmds.c, src/ex_cmds2.c, src/proto/ex_cmds2.pro,
+ VisVim/Commands.cpp
+
+Patch 6.1.174
+Problem: It is difficult to know in a script whether an option not only
+ exists but really works.
+Solution: Add "exists('+option')".
+Files: runtime/doc/eval.txt, src/eval.c
+
+Patch 6.1.175
+Problem: When reading commands from a pipe and a CTRL-C is pressed, Vim
+ will hang. (Piet Delport)
+Solution: Don't keep reading characters to clear typeahead when an interrupt
+ was detected, stop when a single CTRL-C is read.
+Files: src/getchar.c, src/ui.c
+
+Patch 6.1.176
+Problem: When the stack limit is very big a false out-of-stack error may
+ be detected.
+Solution: Add a check for overflow of the stack limit computation. (Jim
+ Dunleavy)
+Files: src/os_unix.c
+
+Patch 6.1.177 (depends on 6.1.141)
+Problem: ":wincmd" does not allow a following command. (Gary Johnson)
+Solution: Check for a following " | cmd". Also give an error for trailing
+ characters.
+Files: src/ex_docmd.c
+
+Patch 6.1.178
+Problem: When 'expandtab' is set "r<C-V><Tab>" still expands the Tab.
+ (Bruce deVisser)
+Solution: Replace with a literal Tab.
+Files: src/normal.c
+
+Patch 6.1.179 (depends on 6.1.091)
+Problem: When using X11R5 XIMPreserveState is undefined. (Albert Chin)
+Solution: Include the missing definitions.
+Files: src/mbyte.c
+
+Patch 6.1.180
+Problem: Use of the GUI code for forking is inconsistent.
+Solution: Define MAY_FORK and use it for later #ifdefs. (Ben Fowlwer)
+Files: src/gui.c
+
+Patch 6.1.181
+Problem: If the terminal doesn't wrap from the last char in a line to the
+ next line, the last column is blanked out. (Peter Karp)
+Solution: Don't output a space to mark the wrap, but the same character
+ again.
+Files: src/screen.c
+
+Patch 6.1.182 (depends on 6.1.142)
+Problem: It is not possible to auto-format comments only. (Moshe Kaminsky)
+Solution: When the 'a' and 'c' flags are in 'formatoptions' only auto-format
+ comments.
+Files: runtime/doc/change.txt, src/edit.c
+
+Patch 6.1.183
+Problem: When 'fencs' is empty and 'enc' is utf-8, reading a file with
+ illegal bytes gives "CONVERSION ERROR" even though no conversion
+ is done. 'readonly' is set, even though writing the file results
+ in an unmodified file.
+Solution: For this specific error use "ILLEGAL BYTE" and don't set
+ 'readonly'.
+Files: src/fileio.c
+
+Patch 6.1.184 (extra)
+Problem: The extra mouse buttons found on some mice don't work.
+Solution: Support two extra buttons for MS-Windows. (Michael Geddes)
+Files: runtime/doc/term.txt, src/edit.c, src/ex_getln.c, src/gui.c,
+ src/gui_w32.c, src/gui_w48.c, src/keymap.h, src/message.c,
+ src/misc1.c, src/misc2.c, src/normal.c. src/vim.h
+
+Patch 6.1.185 (depends on 6.1.182)
+Problem: Can't compile without +comments feature.
+Solution: Add #ifdef FEAT_COMMENTS. (Christian J. Robinson)
+Files: src/edit.c
+
+Patch 6.1.186 (depends on 6.1.177)
+Problem: ":wincmd" does not allow a following comment. (Aric Blumer)
+Solution: Check for a following double quote.
+Files: src/ex_docmd.c
+
+Patch 6.1.187
+Problem: Using ":doarg" with 'hidden' set and the current file is the only
+ argument and was modified gives an error message. (Preben
+ Guldberg)
+Solution: Don't try re-editing the same file.
+Files: src/ex_cmds2.c
+
+Patch 6.1.188 (depends on 6.1.173)
+Problem: Unused variable in the small version.
+Solution: Move the declaration for "p" inside #ifdef FEAT_LISTCMDS.
+Files: src/ex_cmds2.c
+
+Patch 6.1.189
+Problem: inputdialog() doesn't work when 'c' is in 'guioptions'. (Aric
+ Blumer)
+Solution: Fall back to the input() function in this situation.
+Files: src/eval.c
+
+Patch 6.1.190 (extra)
+Problem: VMS: doesn't build with GTK GUI. Various other problems.
+Solution: Fix building for GTK. Improved Perl, Python and TCL support.
+ Improved VMS documentation. (Zoltan Arpadffy)
+ Added Vimtutor for VMS (T. R. Wyant)
+Files: runtime/doc/os_vms.txt, src/INSTALLvms.txt, src/gui_gtk_f.h,
+ src/if_tcl.c, src/main.c, src/gui_gtk_vms.h, src/Make_vms.mms,
+ src/os_vms.opt, src/proto/if_tcl.pro, vimtutor.com,
+ src/testdir/Make_vms.mms
+
+Patch 6.1.191
+Problem: When using "vim -s script" and redirecting the output, the delay
+ for the "Output is not to a terminal" warning slows Vim down too
+ much.
+Solution: Don't delay when reading commands from a script.
+Files: src/main.c
+
+Patch 6.1.192
+Problem: ":diffsplit" doesn't add "hor" to 'scrollopt'. (Gary Johnson)
+Solution: Add "hor" to 'scrollopt' each time ":diffsplit" is used.
+Files: src/diff.c, src/main.c
+
+Patch 6.1.193
+Problem: Crash in in_id_list() for an item with a "containedin" list. (Dave
+ Fishburn)
+Solution: Check for a negative syntax id, used for keywords.
+Files: src/syntax.c
+
+Patch 6.1.194
+Problem: When "t_ti" is set but it doesn't cause swapping terminal pages,
+ "ZZ" may cause the shell prompt to appear on top of the file-write
+ message.
+Solution: Scroll the text up in the Vim page before swapping to the terminal
+ page. (Michael Schroeder)
+Files: src/os_unix.c
+
+Patch 6.1.195
+Problem: The quickfix and preview windows always keep their height, while
+ other windows can't fix their height.
+Solution: Add the 'winfixheight' option, so that a fixed height can be
+ specified for any window. Also fix that the wildmenu may resize a
+ one-line window to a two-line window if 'ls' is zero.
+Files: runtime/doc/options.txt, runtime/optwin.vim, src/ex_cmds.c,
+ src/ex_getln.c, src/globals.h, src/option.c, src/quickfix.c,
+ src/screen.c, src/structs.h, src/window.c
+
+Patch 6.1.196 (depends on 6.1.084)
+Problem: On Mac OS X 10.2 generating osdef.h fails.
+Solution: Add -no-cpp-precomp to avoid using precompiled header files, which
+ disables printing the search path. (Ben Fowler)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.197
+Problem: ":help <C-V><C-\><C-V><C-N>" (resulting in <1c><0e>) gives an
+ error message. (Servatius Brandt)
+Solution: Double the backslash in "CTRL-\".
+Files: src/ex_cmds.c
+
+Patch 6.1.198 (extra) (depends on 6.1.076)
+Problem: Mac OS X: Dialogues don't work.
+Solution: Fix a crashing problem for some GUI dialogues. Fix a problem when
+ saving to a new file from the GUI. (Peter Cucka)
+Files: src/feature.h, src/gui_mac.c
+
+Patch 6.1.199
+Problem: 'guifontwide' doesn't work on Win32.
+Solution: Output each wide character separately. (Michael Geddes)
+Files: src/gui.c
+
+Patch 6.1.200
+Problem: ":syn sync fromstart" is not skipped after ":if 0". This can make
+ syntax highlighting very slow.
+Solution: Check "eap->skip" appropriately. (Rob West)
+Files: src/syntax.c
+
+Patch 6.1.201 (depends on 6.1.192)
+Problem: Warning for illegal pointer combination. (Zoltan Arpadffy)
+Solution: Add a typecast.
+Files: src/diff.c
+
+Patch 6.1.202 (extra)(depends on 6.1.148)
+Problem: Win32: filewritable() doesn't work properly on directories.
+Solution: fix filewritable(). (Mike Williams)
+Files: src/os_win32.c
+
+Patch 6.1.203
+Problem: ":%s/~//" causes a crash after ":%s/x//". (Gary Holloway)
+Solution: Avoid reading past the end of a line when "~" is empty.
+Files: src/regexp.c
+
+Patch 6.1.204 (depends on 6.1.129)
+Problem: Warning for an illegal pointer on Solaris.
+Solution: Add a typecast. (Derek Wyatt)
+Files: src/misc2.c
+
+Patch 6.1.205
+Problem: The gzip plugin changes the alternate file when editing a
+ compressed file. (Oliver Fuchs)
+Solution: Temporarily remove the 'a' and 'A' flags from 'cpo'.
+Files: runtime/plugin/gzip.vim
+
+Patch 6.1.206
+Problem: The script generated with ":mksession" doesn't work properly when
+ some commands are mapped.
+Solution: Use ":normal!" instead of ":normal". And use ":wincmd" where
+ possible. (Muraoka Taro)
+Files: src/ex_docmd.c, src/fold.c
+
+Patch 6.1.207
+Problem: Indenting a Java file hangs below a line with a comment after a
+ command.
+Solution: Break out of a loop. (Andre Pang)
+ Also line up } with matching {.
+Files: runtime/indent/java.vim
+
+Patch 6.1.208
+Problem: Can't use the buffer number from the Python interface.
+Solution: Add buffer.number. (Michal Vitecek)
+Files: src/if_python.c
+
+Patch 6.1.209
+Problem: Printing doesn't work on Mac OS classic.
+Solution: Use a ":" for path separator when opening the resource file. (Axel
+ Kielhorn)
+Files: src/ex_cmds2.c
+
+Patch 6.1.210
+Problem: When there is an iconv() conversion error when reading a file
+ there can be an error the next time iconv() is used.
+Solution: Reset the state of the iconv() descriptor. (Yasuhiro Matsumoto)
+Files: src/fileio.c
+
+Patch 6.1.211
+Problem: The message "use ! to override" is confusing.
+Solution: Make it "add ! to override".
+Files: src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c,
+ src/globals.h
+
+Patch 6.1.212
+Problem: When Vim was started with "-R" ":new" creates a buffer
+ 'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg)
+Solution: Don't set 'readonly in a new empty buffer for ":enew".
+Files: src/ex_docmd.c
+
+Patch 6.1.213
+Problem: Using CTRL-W H may cause a big gap to appear below the last
+ window. (Aric Blumer)
+Solution: Don't set the window height when there is a vertical split.
+ (Yasuhiro Matsumoto)
+Files: src/window.c
+
+Patch 6.1.214
+Problem: When installing Vim and the runtime files were checked out from
+ CVS the CVS directories will also be installed.
+Solution: Avoid installing the CVS dirs and their contents.
+Files: src/Makefile
+
+Patch 6.1.215
+Problem: Win32: ":pwd" uses backslashes even when 'shellslash' is set.
+ (Xiangjiang Ma)
+Solution: Adjust backslashes before printing the message.
+Files: src/ex_docmd.c
+
+Patch 6.1.216
+Problem: When dynamically loading the iconv library, the error codes may be
+ confused.
+Solution: Use specific error codes for iconv and redefine them for dynamic
+ loading. (Yasuhiro Matsumoto)
+Files: src/fileio.c, src/mbyte.c, src/vim.h
+
+Patch 6.1.217
+Problem: When sourcing the same Vim script using a different name (symbolic
+ link or MS-Windows 8.3 name) it is listed twice with
+ ":scriptnames". (Tony Mechelynck)
+Solution: Turn the script name into a full path before using it. On Unix
+ compare inode/device numbers.
+Files: src/ex_cmds2.c
+
+Patch 6.1.218
+Problem: No error message for using the function argument "5+". (Servatius
+ Brandt)
+Solution: Give an error message if a function or variable is expected but is
+ not found.
+Files: src/eval.c
+
+Patch 6.1.219
+Problem: When using ":amenu :b 1<CR>" with a Visual selection and
+ 'insertmode' is set, Vim does not return to Insert mode. (Mickael
+ Marchand)
+Solution: Add the command CTRL-\ CTRL-G that goes to Insert mode if
+ 'insertmode' is set and to Normal mode otherwise. Append this to
+ menus defined with ":amenu".
+Files: src/edit.c, src/ex_getln.c, src/normal.c
+
+Patch 6.1.220
+Problem: When using a BufReadPost autocommand that changes the line count,
+ e.g., "$-1join", reloading a file that was changed outside Vim
+ does not work properly. (Alan G Isaac)
+Solution: Make the buffer empty before reading the new version of the file.
+ Save the lines in a dummy buffer, so that they can be put back
+ when reading the file fails.
+Files: src/buffer.c, src/ex_cmds.c, src/fileio.c, src/globals.h,
+ src/proto/buffer.pro
+
+Patch 6.1.221
+Problem: Changing case may not work properly, depending on the current
+ locale.
+Solution: Add the 'casemap' option to let the user chose how changing case
+ is to be done.
+ Also fix lowering case when an UTF-8 character doesn't keep the
+ same byte length.
+Files: runtime/doc/options.txt, src/ascii.h, src/auto/configure,
+ src/buffer.c, src/charset.c, src/config.h.in, src/configure.in,
+ src/diff.c, src/edit.c, src/eval.c, src/ex_cmds2.c,
+ src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/gui_amiga.c
+ src/gui_mac.c, src/gui_photon.c, src/gui_w48.c, src/gui_beos.cc,
+ src/macros.h, src/main.c, src/mbyte.c, src/menu.c, src/message.c,
+ src/misc1.c, src/misc2.c, src/option.c, src/os_msdos.c,
+ src/os_mswin.c, src/proto/charset.pro, src/regexp.c, src/option.h,
+ src/syntax.c
+
+Patch 6.1.222 (depends on 6.1.219)
+Problem: Patch 6.1.219 was incomplete.
+Solution: Add the changes for ":amenu".
+Files: src/menu.c
+
+Patch 6.1.223 (extra)
+Problem: Win32: When IME is activated 'iminsert' is set, but it might never
+ be reset when IME is disabled. (Muraoka Taro)
+ All systems: 'iminsert' is set to 2 when leaving Insert mode, even
+ when langmap is being used. (Peter Valach)
+Solution: Don't set "b_p_iminsert" in _OnImeNotify(). (Muraoka Taro)
+ Don't store the status of the input method in 'iminsert' when
+ 'iminsert' is one. Also for editing the command line and for
+ arguments to Normal mode commands.
+Files: src/edit.c, src/ex_getln.c, src/gui_w32.c, src/normal.c
+
+Patch 6.1.224
+Problem: "expand('$VAR')" returns an empty string when the expanded $VAR
+ is not an existing file. (Aric Blumer)
+Solution: Included non-existing files, as documented.
+Files: src/eval.c
+
+Patch 6.1.225
+Problem: Using <C-O><C-^> in Insert mode has a delay when starting "vim -u
+ NONE" and ":set nocp hidden". (Emmanuel) do_ecmd() uses
+ fileinfo(), the redraw is done after a delay to give the user time
+ to read the message.
+Solution: Put the message from fileio() in "keep_msg", so that the redraw is
+ done before the delay (still needed to avoid the mode message
+ overwrites the fileinfo() message).
+Files: src/buffer.c
+
+Patch 6.1.226
+Problem: Using ":debug" with a ":normal" command may cause a hang. (Colin
+ Keith)
+Solution: Save the typeahead buffer when obtaining a debug command.
+Files: src/ex_cmds2.c, src/getchar.c, src/proto/getchar.pro
+
+Patch 6.1.227
+Problem: It is possible to use a variable name "asdf:asdf" and ":let j:asdf
+ = 5" does not give an error message. (Mikolaj Machowski)
+Solution: Check for a ":" inside the variable name.
+Files: src/eval.c
+
+Patch 6.1.228 (extra)
+Problem: Win32: The special output function for Hangul is used too often,
+ causing special handling for other situations to be skipped.
+ bInComposition is always FALSE, causing ImeGetTempComposition()
+ always to return NULL.
+Solution: Remove HanExtTextOut(). Delete the dead code around
+ bInComposition and ImeGetTempComposition().
+Files: src/gui_w16.c, src/gui_w32.c, src/gui_w48.c
+
+Patch 6.1.229
+Problem: Win32: Conversion to/from often used codepages requires the iconv
+ library, which is not always available.
+Solution: Use standard MS-Windows functions for the conversion when
+ possible. (mostly by Glenn Maynard)
+ Also fixes missing declaration for patch 6.1.220.
+Files: src/fileio.c
+
+Patch 6.1.230 (extra)
+Problem: Win16: building doesn't work.
+Solution: Exclude the XBUTTON handling. (Vince Negri)
+Files: src/gui_w48.c
+
+Patch 6.1.231
+Problem: Double clicking with the mouse to select a word does not work for
+ multi-byte characters.
+Solution: Use vim_iswordc() instead of vim_isIDc(). This means 'iskeyword'
+ is used intead of 'isident'. Also fix that mixing ASCII with
+ multi-byte word characters doesn't work, the mouse class for
+ punctuation and word characters was mixed up.
+Files: src/normal.c
+
+Patch 6.1.232 (depends on 6.1.226)
+Problem: Using ex_normal_busy while it might not be available. (Axel
+ Kielhorn)
+Solution: Only use ex_normal_busy when FEAT_EX_EXTRA is defined.
+Files: src/ex_cmds2.c
+
+Patch 6.1.233
+Problem: ":help expr-||" does not work.
+Solution: Don't use the '|' as a command separator
+Files: src/ex_cmds.c
+
+Patch 6.1.234 (depends on 6.1.217)
+Problem: Get a warning for using a negative value for st_dev.
+Solution: Don't assign a negative value to st_dev.
+Files: src/ex_cmds2.c
+
+Patch 6.1.235 (depends on 6.1.223)
+Problem: 'iminsert' is changed from 1 to 2 when leaving Insert mode. (Peter
+ Valach)
+Solution: Check "State" before resetting it to NORMAL.
+Files: src/edit.c
+
+Patch 6.1.236
+Problem: Memory leaks when appending lines for ":diffget" or ":diffput" and
+ when reloading a changed buffer.
+Solution: Free a line after calling ml_append().
+Files: src/diff.c, src/fileio.c
+
+Patch 6.1.237
+Problem: Putting in Visual block mode does not work correctly when "$" was
+ used or when the first line is short. (Christian Michon)
+Solution: First delete the selected text and then put the new text. Save
+ and restore registers as necessary.
+Files: src/globals.h, src/normal.c, src/ops.c, src/proto/ops.pro,
+ src/vim.h
+
+Patch 6.1.238 (extra)
+Problem: Win32: The "icon=" argument for the ":menu" command does not
+ search for the bitmap file.
+Solution: Expand environment variables and search for the bitmap file.
+ (Vince Negri)
+ Make it consistent, use the same mechanism for X11 and GTK.
+Files: src/gui.c src/gui_gtk.c, src/gui_w32.c, src/gui_x11.c,
+ src/proto/gui.pro
+
+Patch 6.1.239
+Problem: Giving an error for missing :endif or :endwhile when being
+ interrupted.
+Solution: Don't give these messages when interrupted.
+Files: src/ex_docmd.c, src/os_unix.c
+
+Patch 6.1.240 (extra)
+Problem: Win32 with BCC 5: CPU may be defined in the environment, which
+ causes a wrong argument for the compiler. (Walter Briscoe)
+Solution: Use CPUNR instead of CPU.
+Files: src/Make_bc5.mak
+
+Patch 6.1.241
+Problem: Something goes wrong when drawing or undrawing the cursor.
+Solution: Remember when the cursor invalid in a better way.
+Files: src/gui.c
+
+Patch 6.1.242
+Problem: When pasting a large number of lines on the command line it is not
+ possible to interrupt. (Jean Jordaan)
+Solution: Check for an interrupt after each pasted line.
+Files: src/ops.c
+
+Patch 6.1.243 (extra)
+Problem: Win32: When the OLE version is started and wasn't registered, a
+ message pops up to suggest registering, even when this isn't
+ possible (when the registry is not writable).
+Solution: Check if registering is possible before asking whether it should
+ be done. (Walter Briscoe)
+ Also avoid restarting Vim after registering.
+Files: src/if_ole.cpp
+
+Patch 6.1.244
+Problem: Patch 6.1.237 was missing the diff for vim.h. (Igor Goldenberg)
+Solution: Include it here.
+Files: src/vim.h
+
+Patch 6.1.245
+Problem: Comparing with ignored case does not work properly for Unicode
+ with a locale where case folding an ASCII character results in a
+ multi-byte character. (Glenn Maynard)
+Solution: Handle ignore-case compare for Unicode differently.
+Files: src/mbyte.c
+
+Patch 6.1.246
+Problem: ":blast" goes to the first buffer if the last one is unlisted.
+ (Andrew Stryker)
+Solution: From the last buffer search backwards for the first listed buffer
+ instead of forwards.
+Files: src/ex_docmd.c
+
+Patch 6.1.247
+Problem: ACL support doesn't always work properly.
+Solution: Add a configure argument to disable ACL "--disable-acl". (Thierry
+ Vignaud)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.248
+Problem: Typing 'q' at the more-prompt for ":let" does not quit the
+ listing. (Hari Krishna Dara)
+Solution: Quit the listing when got_int is set.
+Files: src/eval.c
+
+Patch 6.1.249
+Problem: Can't expand a path on the command line if it includes a "|" as a
+ trail byte of a multi-byte character.
+Solution: Check for multi-byte characters. (Yasuhiro Matsumoto)
+Files: src/ex_docmd.c
+
+Patch 6.1.250
+Problem: When changing the value of 'lines' inside the expression set with
+ 'diffexpr' Vim might crash. (Dave Fishburn)
+Solution: Don't allow changing the screen size while updating the screen.
+Files: src/globals.h, src/option.c, src/screen.c
+
+Patch 6.1.251
+Problem: Can't use completion for ":lcd" and ":lchdir" like ":cd".
+Solution: Expand directory names for these commands. (Servatius Brandt)
+Files: src/ex_docmd.c
+
+Patch 6.1.252
+Problem: "vi}" does not include a line break when the "}" is at the start
+ of a following line. (Kamil Burzynski)
+Solution: Include the line break.
+Files: src/search.c
+
+Patch 6.1.253 (extra)
+Problem: Win32 with Cygwin: Changes the path of arguments in a wrong way.
+ (Xiangjiang Ma)
+Solution: Don't use cygwin_conv_to_posix_path() for the Win32 version.
+ Update the Cygwin makefile to support more features. (Dan Sharp)
+Files: src/Make_cyg.mak, src/if_ole.cpp, src/main.c
+
+Patch 6.1.254
+Problem: exists("foo{bar}") does not work. ':unlet v{"a"}r' does not work.
+ ":let v{a}r1 v{a}r2" does not work. ":func F{(1)}" does not work.
+ ":delfunc F{" does not give an error message. ':delfunc F{"F"}'
+ does not work.
+Solution: Support magic braces for the exists() argument. (Vince Negri)
+ Check for trailing comments explicitly for ":unlet". Add support
+ for magic braces in further arguments of ":let". Look for a
+ parenthesis only after the function name. (Servatius Brandt)
+ Also expand magic braces for "exists('*expr')". Give an error
+ message for an invalid ":delfunc" argument. Allow quotes in the
+ ":delfunc" argument.
+Files: src/eval.c, src/ex_cmds.h, src/ex_docmd.c
+
+Patch 6.1.255 (depends on 6.1.254)
+Problem: Crash when loading menu.vim a second time. (Christian Robinson)
+ ":unlet garbage foo" tries unletting "foo" after an error message.
+ (Servatius Brandt)
+ Very long function arguments cause very long messages when
+ 'verbose' is 14 or higher.
+Solution: Avoid reading from uninitialized memory.
+ Break out of a loop after an invalid argument for ":unlet".
+ Truncate long function arguments to 80 characters.
+Files: src/eval.c
+
+Patch 6.1.256 (depends on 6.1.255)
+Problem: Defining a function after ":if 0" could still cause an error
+ message for an existing function.
+ Leaking memory when there are trailing characters for ":delfunc".
+Solution: Check the "skip" flag. Free the memory. (Servatius Brandt)
+Files: src/eval.c
+
+Patch 6.1.257
+Problem: ":cwindow" always sets the previous window to the last but one
+ window. (Benji Fisher)
+Solution: Set the previous window properly.
+Files: src/globals.c, src/quickfix.c, src/window.c
+
+Patch 6.1.258
+Problem: Buffers menu doesn't work properly for multibyte buffer names.
+Solution: Use a pattern to get the left and right part of the name.
+ (Yasuhiro Matsumoto)
+Files: runtime/menu.vim
+
+Patch 6.1.259 (extra)
+Problem: Mac: with 'patchmode' is used filenames are truncated.
+Solution: Increase the BASENAMELEN for Mac OS X. (Ed Ralston)
+Files: src/os_mac.h
+
+Patch 6.1.260 (depends on 6.1.104)
+Problem: GCC 3.2 still seems to have an optimizer problem. (Zvi Har'El)
+Solution: Use the same configure check as used for GCC 3.1.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.261
+Problem: When deleting a line in a buffer which is not the current buffer,
+ using the Perl interface Delete(), the cursor in the current
+ window may move. (Chris Houser)
+Solution: Don't adjust the cursor position when changing another buffer.
+Files: src/if_perl.xs
+
+Patch 6.1.262
+Problem: When jumping over folds with "z[", "zj" and "zk" the previous
+ position is not remembered. (Hari Krishna Dara)
+Solution: Set the previous context mark before jumping.
+Files: src/fold.c
+
+Patch 6.1.263
+Problem: When typing a multi-byte character that triggers an abbreviation
+ it is not inserted properly.
+Solution: Handle adding the typed multi-byte character. (Yasuhiro Matsumoto)
+Files: src/getchar.c
+
+Patch 6.1.264 (depends on patch 6.1.254)
+Problem: exists() does not work for built-in functions. (Steve Wall)
+Solution: Don't check for the function name to start with a capital.
+Files: src/eval.c
+
+Patch 6.1.265
+Problem: libcall() can be used in 'foldexpr' to call any system function.
+ rename(), delete() and remote_send() can also be used in
+ 'foldexpr'. These are security problems. (Georgi Guninski)
+Solution: Don't allow using libcall(), rename(), delete(), remote_send() and
+ similar functions in the sandbox.
+Files: src/eval.c
+
+Patch 6.1.266 (depends on 6.1.265)
+Problem: Win32: compile error in eval.c. (Bill McCarthy)
+Solution: Move a variable declaration.
+Files: src/eval.c
+
+Patch 6.1.267
+Problem: Using "p" to paste into a Visual selected area may cause a crash.
+Solution: Allocate enough memory for saving the register contents. (Muraoka
+ Taro)
+Files: src/ops.c
+
+Patch 6.1.268
+Problem: When triggering an abbreviation with a multi-byte character, this
+ character is not correctly inserted after expanding the
+ abbreviation. (Taro Muraoka)
+Solution: Add ABBR_OFF to all characters above 0xff.
+Files: src/edit.c, src/ex_getln.c, src/getchar.c
+
+Patch 6.1.269
+Problem: After using input() text written with ":redir" gets extra indent.
+ (David Fishburn)
+Solution: Restore msg_col after using input().
+Files: src/ex_getln.c
+
+Patch 6.1.270 (depends on 6.1.260)
+Problem: GCC 3.2.1 still seems to have an optimizer problem.
+Solution: Use the same configure check as used for GCC 3.1.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.271
+Problem: When compiling without the +syntax feature there are errors.
+Solution: Don't use some code for syntax highlighting. (Roger Cornelius)
+ Make test 45 work without syntax highlighting.
+ Also fix an error in a pattern matching: "\%(" was not supported.
+Files: src/ex_cmds2.c, src/regexp.c, src/testdir/test45.in
+
+Patch 6.1.272
+Problem: After using ":set define<" a crash may happen. (Christian Robinson)
+Solution: Make a copy of the option value in allocated memory.
+Files: src/option.c
+
+Patch 6.1.273
+Problem: When the cursor doesn't blink, redrawing an exposed area may hide
+ the cursor.
+Solution: Always draw the cursor, also when it didn't move. (Muraoka Taro)
+Files: src/gui.c
+
+Patch 6.1.274 (depends on 6.1.210)
+Problem: Resetting the iconv() state after each error is wrong for an
+ incomplete sequence.
+Solution: Don't reset the iconv() state.
+Files: src/fileio.c
+
+Patch 6.1.275
+Problem: When using "v" in a startup script, get warning message that
+ terminal cannot highlight. (Charles Campbell)
+Solution: Only give the message after the terminal has been initialized.
+Files: src/normal.c
+
+Patch 6.1.276
+Problem: "gvim --remote file" doesn't prompt for an encryption key.
+Solution: The further characters the client sends to the server are used.
+ Added inputsave() and inputrestore() to allow prompting the
+ user directly and not using typeahead.
+ Also fix possible memory leak for ":normal".
+Files: src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/getchar.c,
+ src/main.c, src/proto/getchar.pro, src/proto/ui.pro,
+ src/runtime/doc/eval.txt, src/structs.h, src/ui.c, src/vim.h
+
+Patch 6.1.277 (depends on 6.1.276)
+Problem: Compilation error when building with small features.
+Solution: Define trash_input_buf() when needed. (Kelvin Lee)
+Files: src/ui.c
+
+Patch 6.1.278
+Problem: When using signs the line number of a closed fold doesn't line up
+ with the other line numbers. (Kamil Burzynski)
+Solution: Insert two spaces for the sign column.
+Files: src/screen.c
+
+Patch 6.1.279
+Problem: The prototype for smsg() and smsg_attr() do not match the function
+ definition. This may cause trouble for some compilers. (Nix)
+Solution: Use va_list for systems that have stdarg.h. Use "int" instead of
+ "void" for the return type.
+Files: src/auto/configure, src/config.h.in, src/configure.in,
+ src/proto.h, src/message.c
+
+Patch 6.1.280
+Problem: It's possible to use an argument "firstline" or "lastline" for a
+ function but using "a:firstline" or "a:lastline" in the function
+ won't work. (Benji Fisher)
+Solution: Give an error message for these arguments.
+ Also avoid that the following function body causes a whole row of
+ errors, skip over it after an error in the first line.
+Files: src/eval.c
+
+Patch 6.1.281
+Problem: In Insert mode CTRL-X CTRL-G leaves the cursor after the ruler.
+Solution: Set the cursor position before waiting for the argument of CTRL-G.
+ (Yasuhiro Matsumoto)
+Files: src/edit.c
+
+Patch 6.1.282
+Problem: Elvis uses "se" in a modeline, Vim doesn't recognize this.
+Solution: Also accept "se " where "set " is accepted in a modeline.
+ (Yasuhiro Matsumoto)
+Files: src/buffer.c
+
+Patch 6.1.283
+Problem: For ":sign" the icon file name cannot contain a space.
+Solution: Handle backslashes in the file name. (Yasuhiro Matsumoto)
+Files: src/ex_cmds.c
+
+Patch 6.1.284
+Problem: On Solaris there is a warning for "struct utimbuf".
+Solution: Move including "utime.h" to outside the function. (Derek Wyatt)
+Files: src/fileio.c
+
+Patch 6.1.285
+Problem: Can't wipe out a buffer with 'bufhide' option.
+Solution: Add "wipe" value to 'bufhide'. (Yegappan Lakshmanan)
+Files: runtime/doc/options.txt, src/buffer.c, src/option.c,
+ src/quickfix.c
+
+Patch 6.1.286
+Problem: 'showbreak' cannot contain multi-byte characters.
+Solution: Allow using all printable characters for 'showbreak'.
+Files: src/charset.c, src/move.c, src/option.c
+
+Patch 6.1.287 (depends on 6.1.285)
+Problem: Effect of "delete" and "wipe" in 'bufhide' were mixed up.
+Solution: Wipe out when wiping out is asked for.
+Files: src/buffer.c
+
+Patch 6.1.288
+Problem: ":silent function F" hangs. (Hari Krishna Dara)
+Solution: Don't use msg_col, it is not incremented when using ":silent".
+ Also made the function output look a bit better. Don't translate
+ "function".
+Files: src/eval.c
+
+Patch 6.1.289 (depends on 6.1.278)
+Problem: Compiler warning for pointer. (Axel Kielhorn)
+Solution: Add a typecast for " ".
+Files: src/screen.c
+
+Patch 6.1.290 (extra)
+Problem: Truncating long text for message box may break multi-byte
+ character.
+Solution: Adjust to start of multi-byte character. (Yasuhiro Matsumoto)
+Files: src/os_mswin.c
+
+Patch 6.1.291 (extra)
+Problem: Win32: CTRL-@ doesn't work. Don't even get a message for it.
+Solution: Recognize the keycode for CTRL-@. (Yasuhiro Matsumoto)
+Files: src/gui_w48.c
+
+Patch 6.1.292 (extra, depends on 6.1.253)
+Problem: Win32: Can't compile with new MingW compiler.
+ Borland 5 makefile doesn't generate pathdef.c.
+Solution: Remove -wwide-multiply argument. (Rene de Zwart)
+ Various fixes for other problems in Win32 makefiles. (Dan Sharp)
+Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak,
+ src/Make_mvc.mak
+
+Patch 6.1.293
+Problem: byte2line() returns a wrong result for some values.
+Solution: Change ">=" to ">" in ml_find_line_or_offset(). (Bradford C Smith)
+ Add one to the line number when at the end of a block.
+Files: src/memline.c
+
+Patch 6.1.294
+Problem: Can't include a multi-byte character in a string by its hex value.
+ (Benji Fisher)
+Solution: Add "\u....": a character specified with up to four hex numbers
+ and stored according to the value of 'encoding'.
+Files: src/eval.c
+
+Patch 6.1.295 (extra)
+Problem: Processing the cs.po file generates an error. (Rahul Agrawal)
+Solution: Fix the printf format characters in the translation.
+Files: src/po/cs.po
+
+Patch 6.1.296
+Problem: Win32: When cancelling the font dialog 'guifont' remains set to
+ "*".
+Solution: Restore the old value of 'guifont' (Yasuhiro Matsumoto)
+Files: src/option.c
+
+Patch 6.1.297
+Problem: "make test" fails in test6 in an UTF-8 environment. (Benji Fisher)
+Solution: Before executing the BufReadPost autocommands save the current
+ fileencoding, so that the file isn't marked changed.
+Files: src/fileio.c
+
+Patch 6.1.298
+Problem: When using signs and the first line of a closed fold has a sign
+ it can be redrawn as if the fold was open. (Kamil Burzynski)
+Solution: Don't redraw a sign inside a closed fold.
+Files: src/screen.c
+
+Patch 6.1.299
+Problem: ":edit +set\ ro file" doesn't work.
+Solution: Halve the number of backslashes in the "+cmd" argument.
+Files: src/ex_docmd.c
+
+Patch 6.1.300 (extra)
+Problem: Handling of ETO_IGNORELANGUAGE is confusing.
+Solution: Clean up the handling of ETO_IGNORELANGUAGE. (Glenn Maynard)
+Files: src/gui_w32.c
+
+Patch 6.1.301 (extra)
+Problem: French translation of file-save dialog doesn't show file name.
+Solution: Insert a star in the printf string. (Francois Terrot)
+Files: src/po/fr.po
+
+Patch 6.1.302
+Problem: Counting lines of the Visual area is incorrect for closed folds.
+ (Mikolaj Machowski)
+Solution: Correct the start and end for the closed fold.
+Files: src/normal.c
+
+Patch 6.1.303 (extra)
+Problem: The Top/Bottom/All text does not always fit in the ruler when
+ translated to Japanese. Problem with a character being wider when
+ in a bold font.
+Solution: Use ETO_PDY to specify the width of each character. (Yasuhiro
+ Matsumoto)
+Files: src/gui_w32.c
+
+Patch 6.1.304 (extra, depends on 6.1.292)
+Problem: Win32: Postscript is always enabled in the MingW Makefile.
+ Pathdef.c isn't generated properly with Make_bc5.mak. (Yasuhiro
+ Matsumoto)
+Solution: Change an ifdef to an ifeq. (Madoka Machitani)
+ Use the Borland make redirection to generate pathdef.c. (Maurice
+ Barnum)
+Files: src/Make_bc5.mak, src/Make_ming.mak
+
+Patch 6.1.305
+Problem: When 'verbose' is 14 or higher, a function call may cause reading
+ uninitialized data. (Walter Briscoe)
+Solution: Check for end-of-string in trunc_string().
+Files: src/message.c
+
+Patch 6.1.306
+Problem: The AIX VisualAge cc compiler doesn't define __STDC__.
+Solution: Use __EXTENDED__ like __STDC__. (Jess Thrysoee)
+Files: src/os_unix.h
+
+Patch 6.1.307
+Problem: When a double-byte character has an illegal tail byte the display
+ is messed up. (Yasuhiro Matsumoto)
+Solution: Draw "XX" instead of the wrong character.
+Files: src/screen.c
+
+Patch 6.1.308
+Problem: Can't reset the Visual mode returned by visualmode().
+Solution: Use an optional argument to visualmode(). (Charles Campbell)
+Files: runtime/doc/eval.txt, src/eval.c, src/normal.c,
+ src/structs.h
+
+Patch 6.1.309
+Problem: The tutor doesn't select German if the locale name is
+ "German_Germany.1252". (Joachim Hofmann)
+Solution: Check for "German" in the locale name. Also check for
+ ".ge". And include the German and Greek tutors.
+Files: runtime/tutor/tutor.de, runtime/tutor/tutor.vim,
+ runtime/tutor/tutor.gr, runtime/tutor/tutor.gr.cp737
+
+Patch 6.1.310 (depends on 6.1.307)
+Problem: All double-byte characters are displayed as "XX".
+Solution: Use ">= 32" instead of "< 32". (Yasuhiro Matsumoto)
+Files: src/screen.c
+
+Patch 6.1.311 (extra)
+Problem: VMS: path in window title doesn't include necessary separator.
+ file version doesn't always work properly with Unix.
+ Crashes because of memory overwrite in GUI.
+ Didn't always handle files with lowercase and correct path.
+Solution: Fix the problems. Remove unnecessary file name translations.
+ (Zoltan Arpadffy)
+Files: src/buffer.c, src/ex_cmds2.c, src/fileio.c, src/memline.c,
+ src/misc1.c, src/misc2.c, src/os_unix.c, src/os_vms.c, src/tag.c
+
+Patch 6.1.312
+Problem: When using ":silent" debugging is also done silently.
+Solution: Disable silence while at the debug prompt.
+Files: src/ex_cmds2.c
+
+Patch 6.1.313
+Problem: When a ":drop fname" command is used and "fname" is open in
+ another window, it is also opened in the current window.
+Solution: Change to the window with "fname" instead.
+ Don't redefine the argument list when dropping only one file.
+Files: runtime/doc/windows.txt, src/ex_cmds2.c, src/ex_cmds.c,
+ src/ex_docmd.c, src/proto/ex_cmds2.pro, src/proto/ex_docmd.pro
+
+Patch 6.1.314 (depends on 6.1.126)
+Problem: Missing backslash in "Generic Config file" syntax menu.
+Solution: Insert the backslash. (Zak Beck)
+Files: runtime/makemenu.vim, runtime/synmenu.vim
+
+Patch 6.1.315 (extra)
+Problem: A very long hostname may lead to an unterminated string. Failing
+ to obtain a hostname may result in garbage. (Walter Briscoe)
+Solution: Add a NUL at the end of the hostname buffer.
+Files: src/os_mac.c, src/os_msdos.c, src/os_unix.c, src/os_win16.c,
+ src/os_win32.c
+
+Patch 6.1.316
+Problem: When exiting with "wq" and there is a hidden buffer, after the
+ "file changed" dialog there is a warning for a changed buffer.
+ (Ajit Thakkar)
+Solution: Do update the buffer timestamps when exiting.
+Files: src/fileio.c
+
+Patch 6.1.317
+Problem: Closing a window may cause some of the remaining windows to be
+ positioned wrong if there is a mix of horizontal and vertical
+ splits. (Stefan Ingi Valdimarsson)
+Solution: Update the frame sizes before updating the window positions.
+Files: src/window.c
+
+Patch 6.1.318
+Problem: auto/pathdef.c can include wrong quotes when a compiler flag
+ includes quotes.
+Solution: Put a backslash before the quotes in compiler flags. (Shinra Aida)
+Files: src/Makefile
+
+Patch 6.1.319 (depends on 6.1.276)
+Problem: Using "--remote +cmd file" does not execute "cmd".
+Solution: Call inputrestore() in the same command line as inputsave(),
+ otherwise it will never get executed.
+Files: src/main.c
+
+Patch 6.1.320 (depends on 6.1.313)
+Problem: When a ":drop one\ file" command is used the file "one\ file" is
+ opened, the backslash is not removed. (Taro Muraoka)
+Solution: Handle backslashes correctly. Always set the argument list to
+ keep it simple.
+Files: runtime/doc/windows.txt, src/ex_cmds.c
+
+Patch 6.1.321
+Problem: When 'mouse' includes 'n' but not 'v', don't allow starting Visual
+ mode with the mouse.
+Solution: Don't use MOUSE_MAY_VIS when there is no 'v' in 'mouse'. (Flemming
+ Madsen)
+Files: src/normal.c
+
+Patch 6.1.322 (extra, depends on 6.1.315)
+Problem: Win32: The host name is always "PC " plus the real host name.
+Solution: Don't insert "PC " before the host name.
+Files: src/os_win32.c
+
+Patch 6.1.323
+Problem: ":registers" doesn't stop listing for a "q" at the more prompt.
+ (Hari Krishna Dara)
+Solution: Check for interrupt and got_int.
+Files: src/ops.c, src/proto/ops.pro
+
+Patch 6.1.324
+Problem: Crash when dragging a vertical separator when <LeftMouse> is
+ remapped to jump to another window.
+Solution: Pass the window pointer to the function doing the dragging instead
+ of always using the current window. (Daniel Elstner)
+ Also fix that starting a drag changes window focus.
+Files: src/normal.c, src/proto/window.pro, src/ui.c, src/vim.h,
+ src/window.c
+
+Patch 6.1.325
+Problem: Shift-Tab is not automatically recognized in an xterm.
+Solution: Add <Esc>[Z as the termcap code. (Andrew Pimlott)
+Files: src/term.c
+
+Patch 6.1.326
+Problem: Using a search pattern may read from uninitialized data (Yasuhiro
+ Matsumoto)
+Solution: Initialize pointers to NULL.
+Files: src/regexp.c
+
+Patch 6.1.327
+Problem: When opening the "mbyte.txt" help file the utf-8 characters are
+ unreadable, because the fileencoding is forced to be latin1.
+Solution: Check for utf-8 encoding first in help files. (Daniel Elstner)
+Files: runtime/doc/mbyte.txt, src/fileio.c
+
+Patch 6.1.328
+Problem: Prototype for enc_canon_search() is missing.
+Solution: Add the prototype. (Walter Briscoe)
+Files: src/mbyte.c
+
+Patch 6.1.329
+Problem: When editing a file "a b c" replacing "%" in ":Cmd %" or ":next %"
+ does not work properly. (Hari Krishna Dara)
+Solution: Always escape spaces when expanding "%". Don't split argument for
+ <f-args> in a user command when only one argument is used.
+Files: src/ex_docmd.c
+
+Patch 6.1.330
+Problem: GTK, Motif and Athena: Keypad keys produce the same code as
+ non-keypad keys, making it impossible to map them separately.
+Solution: Use different termcap codes for the keypad keys. (Neil Bird)
+Files: src/gui_gtk_x11.c, src/gui_x11.c
+
+Patch 6.1.331
+Problem: When translating the help files, "LOCAL ADDITIONS" no longer marks
+ the spot where help files from plugins are to be listed.
+Solution: Add a "local-additions" tag and use that to find the right spot.
+Files: runtime/doc/help.txt, src/ex_cmds.c
+
+Patch 6.1.332 (extra)
+Problem: Win32: Loading Perl dynamically doesn't work with Perl 5.8.
+ Perl 5.8 also does not work with Cygwin and Ming.
+Solution: Adjust the function calls. (Taro Muraoka)
+ Adjust the cyg and ming makefiles. (Dan Sharp)
+Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak,
+ src/if_perl.xs
+
+Patch 6.1.333 (extra)
+Problem: Win32: Can't handle Unicode text on the clipboard.
+ Can't pass NUL byte, it becomes a line break. (Bruce DeVisser)
+Solution: Support Unicode for the clipboard (Ron Aaron and Glenn Maynard)
+ Also support copy/paste of NUL bytes.
+Files: src/os_mswin.c, src/os_win16.c src/os_win32.c
+
+Patch 6.1.334 (extra, depends on 6.1.303)
+Problem: Problem with drawing Hebrew characters.
+Solution: Only use ETO_PDY for Windows NT and the like. (Yasuhiro Matsumoto)
+Files: src/gui_w32.c
+
+Patch 6.1.335 (extra)
+Problem: Failure of obtaining the cursor position and window size is
+ ignored.
+Solution: Remove a semicolon after an "if". (Walter Briscoe)
+Files: src/gui_w32.c
+
+Patch 6.1.336 (extra)
+Problem: Warning for use of function prototypes of smsg().
+Solution: Define HAVE_STDARG_H. (Walter Briscoe)
+Files: src/os_win32.h
+
+Patch 6.1.337
+Problem: When using "finish" in debug mode in function B() for ":call
+ A(B())" does not stop after B() is finished.
+Solution: Increase debug_level while evaluating a function.
+Files: src/ex_docmd.c
+
+Patch 6.1.338
+Problem: When using a menu that checks out the current file from Insert
+ mode, there is no warning for the changed file until exiting
+ Insert mode. (Srikanth Sankaran)
+Solution: Add a check for need_check_timestamps in the Insert mode loop.
+Files: src/edit.c
+
+Patch 6.1.339
+Problem: Completion doesn't allow "g:" in ":let g:did_<Tab>". (Benji
+ Fisher)
+Solution: Return "g:var" for global variables when that is what is being
+ expanded. (Flemming Madsen)
+Files: src/eval.c
+
+Patch 6.1.340 (extra, depends on 6.1.332)
+Problem: Win32: Can't compile the Perl interface with nmake.
+Solution: Don't compare the version number as a string but as a number.
+ (Juergen Kraemer)
+Files: src/Make_mvc.mak
+
+Patch 6.1.341
+Problem: In Insert mode with 'rightleft' set the cursor is drawn halfway a
+ double-wide character. For CTRL-R and CTRL-K in Insert mode the "
+ or ? is not displayed.
+Solution: Draw the cursor in the next character cell. Display the " or ?
+ over the right half of the double-wide character. (Yasuhiro
+ Matsumoto) Also fix that cancelling a digraph doesn't redraw
+ a double-byte character correctly.
+Files: src/edit.c, src/gui.c, src/mbyte.c
+
+Patch 6.1.342 (depends on 6.1.341)
+Problem: With 'rightleft' set typing "c" on a double-wide character causes
+ the cursor to be displayed one cell to the left.
+Solution: Draw the cursor in the next character cell. (Yasuhiro Matsumoto)
+Files: src/gui.c
+
+Patch 6.1.343 (depends on 6.1.342)
+Problem: Cannot compile with the +multi_byte feature but without +rightleft.
+ Cannot compile without the GUI.
+Solution: Fix the #ifdefs. (partly by Nam SungHyun)
+Files: src/gui.c, src/mbyte.c, src/ui.c
+
+Patch 6.1.344
+Problem: When using ":silent filetype" the output is still put in the
+ message history. (Hari Krishna Dara)
+Solution: Don't add messages in the history when ":silent" is used.
+Files: src/message.c
+
+Patch 6.1.345 (extra)
+Problem: Win32: 'imdisable' doesn't work.
+Solution: Make 'imdisable' work. (Yasuhiro Matsumoto)
+Files: src/gui_w32.c
+
+Patch 6.1.346
+Problem: The scroll wheel can only scroll the current window.
+Solution: Make the scroll wheel scroll the window that the mouse points to.
+ (Daniel Elstner)
+Files: src/edit.c, src/gui.c, src/normal.c, src/term.c
+
+Patch 6.1.347
+Problem: When using cscope to list matching tags, the listed number is
+ sometimes not equal to what cscope uses. (Vihren Milev)
+Solution: For cscope tags use only one table, don't give tags in the current
+ file a higher priority.
+Files: src/tag.c
+
+Patch 6.1.348
+Problem: Wildmode with wildmenu: ":set wildmode=list,full", ":colorscheme
+ <tab>" results in "zellner" instead of the first entry. (Anand
+ Hariharan)
+Solution: Don't call ExpandOne() from globpath(). (Flemming Madsen)
+Files: src/ex_getln.c
+
+Patch 6.1.349
+Problem: "vim --serverlist" when no server was ever started gives an error
+ message without "\n".
+ "vim --serverlist" doesn't exit when the X server can't be
+ contacted, it starts Vim unexpectedly. (Ricardo Signes)
+Solution: Don't give an error when no Vim server was ever started.
+ Treat failing of opening the display equal to errors inside the
+ remote*() functions. (Flemming Madsen)
+Files: src/if_xcmdsrv.c, src/main.c
+
+Patch 6.1.350
+Problem: When entering a buffer with ":bnext" for the first time, using an
+ autocommand to restore the last used cursor position doesn't work.
+ (Paolo Giarusso)
+Solution: Don't use the last known cursor position of the current Vim
+ invocation if an autocommand changed the position.
+Files: src/buffer.c
+
+Patch 6.1.351 (depends on 6.1.349)
+Problem: Crash when starting Vim the first time in an X server. (John
+ McGowan)
+Solution: Don't call xFree() with a fixed string.
+Files: src/if_xcmdsrv.c
+
+Patch 6.1.352 (extra, depends on 6.1.345)
+Problem: Win32: Crash when setting "imdisable" in _vimrc.
+Solution: Don't call IME functions when imm32.dll was not loaded (yet).
+ Also add typecasts to avoid Compiler warnings for
+ ImmAssociateContext() argument.
+Files: src/gui_w32.c
+
+Patch 6.1.353 (extra, depends on 6.1.334)
+Problem: Problem with drawing Arabic characters.
+Solution: Don't use ETO_PDY, do use padding.
+Files: src/gui_w32.c
+
+Patch 6.1.354 (extra, depends on 6.1.333)
+Problem: MS-Windows 98: Notepad can't paste text copied from Vim when
+ 'encoding' is "utf-8".
+Solution: Also make CF_TEXT available on the clipboard. (Ron Aaron)
+Files: src/os_mswin.c
+
+Patch 6.1.355
+Problem: In a regexp '\n' will never match anything in a string.
+Solution: Make '\n' match a newline character.
+Files: src/buffer.c, src/edit.c, src/eval.c, src/ex_cmds2.c,
+ src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/misc1.c,
+ src/option.c, src/os_mac.c, src/os_unix.c, src/quickfix.c,
+ src/regexp.c, src/search.c, src/syntax.c, src/tag.c, src/vim.h
+
+Patch 6.1.356 (extra, depends on, well, eh, several others)
+Problem: Compiler warnings for using convert_setup() and a few other
+ things.
+Solution: Add typecasts.
+Files: src/mbyte.c, src/os_mswin.c, src/proto/os_win32.pro, src/os_win32.c
+
+Patch 6.1.357
+Problem: CR in the quickfix window jumps to the error under the cursor, but
+ this doesn't work in Insert mode. (Srikanth Sankaran)
+Solution: Handle CR in Insert mode in the quickfix window.
+Files: src/edit.c
+
+Patch 6.1.358
+Problem: The tutor doesn't select another locale version properly.
+Solution: Insert the "let" command. (Yasuhiro Matsumoto)
+Files: runtime/tutor/tutor.vim
+
+Patch 6.1.359 (extra)
+Problem: Mac Carbon: Vim doesn't get focus when started from the command
+ line. Crash when using horizontal scroll bar.
+Solution: Set Vim as the frontprocess. Fix scrolling. (Peter Cucka)
+Files: src/gui_mac.c
+
+Patch 6.1.360 (depends on 6.1.341)
+Problem: In Insert mode CTRL-K ESC messes up a multi-byte character.
+ (Anders Helmersson)
+Solution: Save all bytes of a character when displaying a character
+ temporarily.
+Files: src/edit.c, src/proto/screen.pro, src/screen.c
+
+Patch 6.1.361
+Problem: Cannot jump to a file mark with ":'M".
+Solution: Allow jumping to another file for a mark in an Ex address when it
+ is the only thing in the command line.
+Files: src/ex_docmd.c
+
+Patch 6.1.362
+Problem: tgetent() may return zero for success. tgetflag() may return -1
+ for an error.
+Solution: Check tgetflag() for returning a positive value. Add an autoconf
+ check for the value that tgetent() returns.
+Files: src/auto/configure, src/config.h.in, src/configure.in, src/term.c
+
+Patch 6.1.363
+Problem: byte2line() can return one more than the number of lines.
+Solution: Return -1 if the offset is one byte past the end.
+Files: src/memline.c
+
+Patch 6.1.364
+Problem: That the FileChangedShell autocommand event never nests makes it
+ difficult to reload a file in a normal way.
+Solution: Allow nesting for the FileChangedShell event but do not allow
+ triggering itself again.
+ Also avoid autocommands for the cmdline window in rare cases.
+Files: src/ex_getln.c, src/fileio.c, src/window.c
+
+Patch 6.1.365 (depends on 6.1.217)
+Problem: Setting a breakpoint in a sourced file with a relative path name
+ doesn't work. (Servatius Brandt)
+Solution: Expand the file name to a full path.
+Files: src/ex_cmds2.c
+
+Patch 6.1.366
+Problem: Can't use Vim with Netbeans.
+Solution: Add the Netbeans interface. Includes support for sign icons and
+ "-fg" and "-bg" arguments for GTK. Add the 'autochdir'
+ option. (Gordon Prieur, George Hernandez, Dave Weatherford)
+ Make it possible to display both a sign with a text and one with
+ line highlighting in the same line.
+ Add support for Agide, interface version 2.1.
+ Also fix that when 'iskeyword' includes '?' the "*" command
+ doesn't work properly on a word that includes "?" (Bill McCarthy):
+ Don't escape "?" to "\?" when searching forward.
+Files: runtime/doc/Makefile, runtime/doc/netbeans.txt,
+ runtime/doc/options.txt, runtime/doc/various.txt,
+ src/Makefile, src/auto/configure, src/buffer.c, src/config.h.in,
+ src/config.mk.in, src/configure.in, src/edit.c, src/ex_cmds.c,
+ src/ex_docmd.c, src/feature.h, src/fileio.c, src/globals.h,
+ src/gui.c, src/gui_beval.c, src/gui_gtk_x11.c, src/gui_x11.c,
+ src/main.c, src/memline.c, src/misc1.c, src/misc2.c, src/move.c,
+ src/nbdebug.c, src/nbdebug.h, src/netbeans.c, src/normal.c,
+ src/ops.c, src/option.c, src/option.h, src/proto/buffer.pro,
+ src/proto/gui_beval.pro, src/proto/gui_gtk_x11.pro,
+ src/proto/gui_x11.pro, src/proto/misc2.pro,
+ src/proto/netbeans.pro, src/proto/normal.pro, src/proto/ui.pro,
+ src/proto.h, src/screen.c, src/structs.h, src/ui.c, src/undo.c,
+ src/vim.h, src/window.c, src/workshop.c
+
+Patch 6.1.367 (depends on 6.1.365)
+Problem: Setting a breakpoint in a function doesn't work. For a sourced
+ file it doesn't work when symbolic links are involved. (Servatius
+ Brandt)
+Solution: Expand the file name in the same way as do_source() does. Don't
+ prepend the path to a function name.
+Files: src/ex_cmds2.c
+
+Patch 6.1.368
+Problem: Completion for ":map" does not include <silent> and <script>.
+ ":mkexrc" do not save the <silent> attribute of mappings.
+Solution: Add "<silent>" to the generated map commands when appropriate.
+ (David Elstner)
+ Add <silent> and <script> to command line completion.
+Files: src/getchar.c
+
+Patch 6.1.369 (extra)
+Problem: VMS: Vim hangs when attempting to edit a read-only file in the
+ terminal. Problem with VMS filenames for quickfix.
+Solution: Rewrite low level input. Remove version number from file name in
+ a couple more places. Fix crash after patch 6.1.362. Correct
+ return code for system(). (Zoltan Arpadffy, Tomas Stehlik)
+Files: src/misc1.c, src/os_unix.c, src/os_vms.c, src/proto/os_vms.pro,
+ src/os_vms_conf.h, src/quickfix.c, src/ui.c
+
+Patch 6.1.370
+Problem: #ifdef nesting is unclear.
+Solution: Insert spaces to indicate the nesting.
+Files: src/os_unix.c
+
+Patch 6.1.371
+Problem: "%V" in 'statusline' doesn't show "0-1" in an empty line.
+Solution: Add one to the column when comparing with virtual column (Andrew
+ Pimlott)
+Files: src/buffer.c
+
+Patch 6.1.372
+Problem: With 16 bit ints there are compiler warnings. (Walter Briscoe)
+Solution: Change int into long.
+Files: src/structs.h, src/syntax.c
+
+Patch 6.1.373
+Problem: The default page header for printing is not translated.
+Solution: Add _() around the two places where "Page" is used. (Mike
+ Williams) Translate the default value of the 'titleold' and
+ 'printheader' options.
+Files: src/ex_cmds2.c, src/option.c
+
+Patch 6.1.374 (extra)
+Problem: MS-Windows: Cannot build GvimExt with MingW or Cygwin.
+Solution: Add makefile and modified resource files. (Rene de Zwart)
+ Also support Cygwin. (Alejandro Lopez_Valencia)
+Files: GvimExt/Make_cyg.mak, GvimExt/Make_ming.mak, GvimExt/Makefile,
+ GvimExt/gvimext_ming.def, GvimExt/gvimext_ming.rc
+
+Patch 6.1.375
+Problem: MS-Windows: ':!dir "%"' does not work for a file name with spaces.
+ (Xiangjiang Ma)
+Solution: Don't insert backslashes for spaces in a shell command.
+Files: src/ex_docmd.c
+
+Patch 6.1.376
+Problem: "vim --version" and "vim --help" have a non-zero exit code.
+ That is unusual. (Petesea)
+Solution: Use a zero exit code.
+Files: src/main.c
+
+Patch 6.1.377
+Problem: Can't add words to 'lispwords' option.
+Solution: Add P_COMMA and P_NODUP flags. (Haakon Riiser)
+Files: src/option.c
+
+Patch 6.1.378
+Problem: When two buffer-local user commands are ambiguous, a full match
+ with a global user command isn't found. (Hari Krishna Dara)
+Solution: Detect this situation and accept the global command.
+Files: src/ex_docmd.c
+
+Patch 6.1.379
+Problem: Linux with kernel 2.2 can't use the alternate stack in combination
+ with threading, causes an infinite loop.
+Solution: Don't use the alternate stack in this situation.
+Files: src/os_unix.c
+
+Patch 6.1.380
+Problem: When 'winminheight' is zero and the quickfix window is zero lines,
+ entering the window doesn't make it higher. (Christian J.
+ Robinson)
+Solution: Make sure the current window is at least one line high.
+Files: src/window.c
+
+Patch 6.1.381
+Problem: When a BufWriteCmd is used and it leaves the buffer modified, the
+ window may still be closed. (Hari Krishna Dara)
+Solution: Return FAIL from buf_write() when the buffer is still modified
+ after a BufWriteCmd autocommand was used.
+Files: src/fileio.c
+
+Patch 6.1.382 (extra)
+Problem: Win32 GUI: When using two monitors, the code that checks/fixes the
+ window size and position (e.g. when a font changes) doesn't work
+ properly. (George Reilly)
+Solution: Handle a double monitor situation. (Helmut Stiegler)
+Files: src/gui_w32.c
+
+Patch 6.1.383
+Problem: The filling of the status line doesn't work properly for
+ multi-byte characters. (Nam SungHyun)
+ There is no check for going past the end of the buffer.
+Solution: Properly distinguish characters and bytes. Properly check for
+ running out of buffer space.
+Files: src/buffer.c, src/ex_cmds2.c, src/proto/buffer.pro, src/screen.c
+
+Patch 6.1.384
+Problem: It is not possible to find if a certain patch has been included.
+ (Lubomir Host)
+Solution: Support using has() to check if a patch was included.
+Files: runtime/doc/eval.txt, src/eval.c, src/proto/version.pro,
+ src/version.c
+
+Patch 6.1.385 (depends on 6.1.383)
+Problem: Can't compile without the multi-byte feature.
+Solution: Move an #ifdef. (Christian J. Robinson)
+Files: src/buffer.c
+
+Patch 6.1.386
+Problem: Get duplicate tags when running ":helptags".
+Solution: Do the other halve of moving a section to another help file.
+Files: runtime/tagsrch.txt
+
+Patch 6.1.387 (depends on 6.1.373)
+Problem: Compiler warning for pointer cast.
+Solution: Add (char_u *).
+Files: src/option.c
+
+Patch 6.1.388 (depends on 6.1.384)
+Problem: Compiler warning for pointer cast.
+Solution: Add (char *). Only include has_patch() when used.
+Files: src/eval.c, src/version.c
+
+Patch 6.1.389 (depends on 6.1.366)
+Problem: Balloon evaluation doesn't work for GTK.
+ has("balloon_eval") doesn't work.
+Solution: Add balloon evaluation for GTK. Also improve displaying of signs.
+ (Daniel Elstner)
+ Also make ":gui" start the netbeans connection and avoid using
+ netbeans functions when the connection is not open.
+Files: src/Makefile, src/feature.h, src/gui.c, src/gui.h,
+ src/gui_beval.c, src/gui_beval.h, src/gui_gtk.c,
+ src/gui_gtk_x11.c, src/eval.c, src/memline.c, src/menu.c,
+ src/netbeans.c, src/proto/gui_beval.pro, src/proto/gui_gtk.pro,
+ src/structs.h, src/syntax.c, src/ui.c, src/workshop.c
+
+Patch 6.1.390 (depends on 6.1.389)
+Problem: It's not possible to tell Vim to save and exit through the
+ Netbeans interface. Would still try to send balloon eval text
+ after the connection is closed.
+ Can't use Unicode characters for sign text.
+Solution: Add functions "saveAndExit" and "getModified". Check for a
+ working connection before sending a balloonText event.
+ various other cleanups.
+ Support any character for sign text. (Daniel Elstner)
+Files: runtime/doc/netbeans.txt, runtime/doc/sign.txt, src/ex_cmds.c,
+ src/netbeans.c, src/screen.c
+
+Patch 6.1.391
+Problem: ml_get() error when using virtualedit. (Charles Campbell)
+Solution: Get a line from a specific window, not the current one.
+Files: src/charset.c
+
+Patch 6.1.392 (depends on 6.1.383)
+Problem: Highlighting in the 'statusline' is in the wrong position when an
+ item is truncated. (Zak Beck)
+Solution: Correct the start of 'statusline' items properly for a truncated
+ item.
+Files: src/buffer.c
+
+Patch 6.1.393
+Problem: When compiled with Python and threads, detaching the terminal may
+ cause Vim to loop forever.
+Solution: Add -pthread to $CFLAGS when using Python and gcc. (Daniel
+ Elstner)
+Files: src/auto/configure,, src/configure.in
+
+Patch 6.1.394 (depends on 6.1.390)
+Problem: The netbeans interface doesn't recognize multibyte glyph names.
+Solution: Check the number of cells rather than bytes to decide
+ whether a glyph name is not a filename. (Daniel Elstner)
+Files: src/netbeans.c
+
+Patch 6.1.395 (extra, depends on 6.1.369)
+Problem: VMS: OLD_VMS is never defined. Missing function prototype.
+Solution: Define OLD_VMS in Make_vms.mms. Add vms_sys_status() to
+ os_vms.pro. (Zoltan Arpadffy)
+Files: src/Make_vms.mms, src/proto/os_vms.pro
+
+Patch 6.1.396 (depends on 6.1.330)
+Problem: Compiler warnings for using enum.
+Solution: Add typecast to char_u.
+Files: src/gui_gtk_x11.c, src/gui_x11.c
+
+Patch 6.1.397 (extra)
+Problem: The install program may use a wrong path for the diff command if
+ there is a space in the install directory path.
+Solution: Use double quotes around the path if necessary. (Alejandro
+ Lopez-Valencia) Also use double quotes around the file name
+ arguments.
+Files: src/dosinst.c
+
+Patch 6.1.398
+Problem: Saving the typeahead for debug mode causes trouble for a test
+ script. (Servatius Brandt)
+Solution: Add the ":debuggreedy" command to avoid saving the typeahead.
+Files: runtime/doc/repeat.txt, src/ex_cmds.h, src/ex_cmds2.c,
+ src/ex_docmd.c, src/proto/ex_cmds2.pro
+
+Patch 6.1.399
+Problem: Warning for unused variable.
+Solution: Remove the variable two_or_more.
+Files: src/ex_cmds.c
+
+Patch 6.1.400 (depends on 6.1.381)
+Problem: When a BufWriteCmd wipes out the buffer it may still be accessed.
+Solution: Don't try accessing a buffer that has been wiped out.
+Files: src/fileio.c
+
+Patch 6.1.401 (extra)
+Problem: Building the Win16 version with Borland 5.01 doesn't work.
+ "make test" doesn't work with Make_dos.mak. (Walter Briscoe)
+Solution: Various fixes to the w16 makefile. (Walter Briscoe)
+ Don't use deltree. Use "mkdir \tmp" instead of "mkdir /tmp".
+Files: src/Make_w16.mak, src/testdir/Make_dos.mak
+
+Patch 6.1.402
+Problem: When evaluating a function name with curly braces, an error
+ is not handled consistently.
+Solution: Accept the result of an curly braces expression when an
+ error was encountered. Skip evaluating an expression in curly
+ braces when skipping. (Servatius Brandt)
+Files: src/eval.c
+
+Patch 6.1.403 (extra)
+Problem: MS-Windows 16 bit: compiler warnings.
+Solution: Add typecasts. (Walter Briscoe)
+Files: src/ex_cmds2.c, src/gui_w48.c, src/os_mswin.c, src/os_win16.c,
+ src/syntax.c
+
+Patch 6.1.404 (extra)
+Problem: Various small problems.
+Solution: Fix comments. Various small additions, changes in indent, removal
+ of unused items and fixes.
+Files: Makefile, README.txt, runtime/menu.vim, runtime/vimrc_example.vim,
+ src/INSTALL, src/INSTALLole.txt, src/Make_bc5.mak,
+ src/Make_cyg.mak, src/Make_ming.mak, src/Makefile,
+ src/config.h.in, src/edit.c, src/eval.c, src/ex_cmds2.c,
+ src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/getchar.c,
+ src/gui.c, src/gui_gtk.c, src/gui_photon.c, src/if_cscope.c,
+ src/if_python.c, src/keymap.h, src/mark.c, src/mbyte.c,
+ src/message.c, src/misc1.c, src/misc2.c, src/normal.c,
+ src/option.c, src/os_os2_cfg.h, src/os_win32.c,
+ src/proto/getchar.pro, src/proto/message.pro,
+ src/proto/regexp.pro, src/screen.c, src/structs.h, src/syntax.c,
+ src/term.c, src/testdir/test15.in, src/testdir/test15.ok,
+ src/vim.rc, src/xxd/Make_cyg.mak, src/xxd/Makefile
+
+Patch 6.1.405
+Problem: A few files are missing from the toplevel Makefile.
+Solution: Add the missing files.
+Files: Makefile
+
+Patch 6.1.406 (depends on 6.1.392)
+Problem: When a statusline item doesn't fit arbitrary text appears.
+ (Christian J. Robinson)
+Solution: When there is just enough room but not for the "<" truncate the
+ statusline item like there is no room.
+Files: src/buffer.c
+
+Patch 6.1.407
+Problem: ":set scrollbind | help" scrollbinds the help window. (Andrew
+ Pimlott)
+Solution: Reset 'scrollbind' when opening a help window.
+Files: src/ex_cmds.c
+
+Patch 6.1.408
+Problem: When 'rightleft' is set unprintable character 0x0c is displayed as
+ ">c0<".
+Solution: Reverse the text of the hex character.
+Files: src/screen.c
+
+Patch 6.1.409
+Problem: Generating tags for the help doesn't work for some locales.
+Solution: Set LANG=C LC_ALL=C in the environment for "sort". (Daniel
+ Elstner)
+Files: runtime/doc/Makefile
+
+Patch 6.1.410 (depends on 6.1.390)
+Problem: Linking error when compiling with Netbeans but without sign icons.
+ (Malte Neumann)
+Solution: Don't define buf_signcount() when sign icons are unavailable.
+Files: src/buffer.c
+
+Patch 6.1.411
+Problem: When 'virtualedit' is set, highlighting a Visual block beyond the
+ end of a line may be wrong.
+Solution: Correct the virtual column when the end of the line is before the
+ displayed part of the line. (Muraoka Taro)
+Files: src/screen.c
+
+Patch 6.1.412
+Problem: When swapping terminal screens and using ":gui" to start the GUI,
+ the shell prompt may be after a hit-enter prompt.
+Solution: Output a newline in the terminal when starting the GUI and there
+ was a hit-enter prompt..
+Files: src/gui.c
+
+Patch 6.1.413
+Problem: When 'clipboard' contains "unnamed", "p" in Visual mode doesn't
+ work correctly.
+Solution: Save the register before overwriting it and put the resulting text
+ on the clipboard afterwards. (Muraoka Taro)
+Files: src/normal.c, src/ops.c
+
+Patch 6.1.414 (extra, depends on 6.1.369)
+Problem: VMS: Vim busy waits when waiting for input.
+Solution: Delay for a short while before getting another character. (Zoltan
+ Arpadffy)
+Files: src/os_vms.c
+
+Patch 6.1.415
+Problem: When there is a vertical split and a quickfix window, reducing the
+ size of the Vim window may result in a wrong window layout and a
+ crash.
+Solution: When reducing the window size and there is not enough space for
+ 'winfixheight' set the frame height to the larger height, so that
+ there is a retry while ignoring 'winfixheight'. (Yasuhiro
+ Matsumoto)
+Files: src/window.c
+
+Patch 6.1.416 (depends on 6.1.366)
+Problem: When using the Netbeans interface, a line with a sign cannot be
+ changed.
+Solution: Respect the GUARDEDOFFSET for sign IDs when checking for a guarded
+ area.
+Files: src/netbeans.c
+
+Patch 6.1.417
+Problem: Unprintable multi-byte characters are not handled correctly.
+ Multi-byte characters above 0xffff are displayed as another
+ character.
+Solution: Handle unprintable multi-byte characters. Display multi-byte
+ characters above 0xffff with a marker. Recognize UTF-16 words and
+ BOM words as unprintable. (Daniel Elstner)
+Files: src/charset.c, src/mbyte.c, src/screen.c
+
+Patch 6.1.418
+Problem: The result of strftime() is in the current locals. Need to
+ convert it to 'encoding'.
+Solution: Obtain the current locale and convert the argument for strftime()
+ to it and the result back to 'encoding'. (Daniel Elstner)
+Files: src/eval.c, src/ex_cmds.c, src/ex_cmds2.c, src/mbyte.c,
+ src/proto/mbyte.pro, src/option.c, src/os_mswin.c
+
+Patch 6.1.419
+Problem: Vim doesn't compile on AIX 5.1.
+Solution: Don't define _NO_PROTO on this system. (Uribarri)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.420 (extra)
+Problem: convert_input() has an unnecessary STRLEN().
+ Conversion from UCS-2 to a codepage uses word count instead of
+ byte count.
+Solution: Remove the STRLEN() call. (Daniel Elstner)
+ Always use byte count for string_convert().
+Files: src/gui_w32.c, src/mbyte.c
+
+Patch 6.1.421 (extra, depends on 6.1.354)
+Problem: MS-Windows 9x: When putting text on the clipboard it can be in
+ the wrong encoding.
+Solution: Convert text to the active codepage for CF_TEXT. (Glenn Maynard)
+Files: src/os_mswin.c
+
+Patch 6.1.422
+Problem: Error in .vimrc doesn't cause hit-enter prompt when swapping
+ screens. (Neil Bird)
+Solution: Set msg_didany also when sending a message to the terminal
+ directly.
+Files: src/message.c
+
+Patch 6.1.423
+Problem: Can't find arbitrary text in help files.
+Solution: Added the ":helpgrep" command.
+Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c,
+ src/proto/quickfix.pro, src/quickfix.c
+
+Patch 6.1.424 (extra)
+Problem: Win32: Gvim compiled with VC++ 7.0 run on Windows 95 does not show
+ menu items.
+Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO.
+ (Muraoka Taro)
+Files: src/Make_mvc.mak
+
+Patch 6.1.425
+Problem: ":helptags $VIMRUNTIME/doc" does not add the "help-tags" tag.
+Solution: Do add the "help-tags" tag for that specific directory.
+Files: src/ex_cmds.c
+
+Patch 6.1.426
+Problem: "--remote-wait +cmd file" waits forever. (Valery Kondakoff)
+Solution: Don't wait for the "+cmd" argument to have been edited.
+Files: src/main.c
+
+Patch 6.1.427
+Problem: Several error messages for regexp patterns are not translated.
+Solution: Use _() properly. (Muraoka Taro)
+Files: src/regexp.c
+
+Patch 6.1.428
+Problem: FreeBSD: wait() may hang when compiled with Python support and
+ doing a system() call in a startup script.
+Solution: Use waitpid() instead of wait() and poll every 10 msec, just like
+ what is done in the GUI.
+Files: src/os_unix.c
+
+Patch 6.1.429 (depends on 6.1.390)
+Problem: Crash when using showmarks.vim plugin. (Charles Campbell)
+Solution: Check for sign_get_text() returning a NULL pointer.
+Files: src/screen.c
+
+Patch 6.1.430
+Problem: In Lisp code backslashed parens should be ignored for "%". (Dorai)
+Solution: Skip over backslashed parens.
+Files: src/search.c
+
+Patch 6.1.431
+Problem: Debug commands end up in redirected text.
+Solution: Disable redirection while handling debug commands.
+Files: src/ex_cmds2.c
+
+Patch 6.1.432 (depends on 6.1.375)
+Problem: MS-Windows: ":make %:p" inserts extra backslashes. (David Rennalls)
+Solution: Don't add backslashes, handle it like ":!cmd".
+Files: src/ex_docmd.c
+
+Patch 6.1.433
+Problem: ":popup" only works for Win32.
+Solution: Add ":popup" support for GTK. (Daniel Elstner)
+Files: runtime/doc/gui.txt, src/ex_docmd.c, src/gui_gtk.c, src/menu.c,
+ src/proto/gui_gtk.pro
+
+Patch 6.1.434 (extra)
+Problem: Win32: When there are more than 32767 lines, the scrollbar has a
+ roundoff error.
+Solution: Make a click on an arrow move one line. Also move the code to
+ gui_w48.c, there is hardly any difference between the 16 bit and
+ 32 bit versions. (Walter Briscoe)
+Files: src/gui_w16.c, src/gui_w32.c, src/gui_w48.c
+
+Patch 6.1.435
+Problem: ":winsize x" resizes the Vim window to the minimal size. (Andrew
+ Pimlott)
+Solution: Give an error message for wrong arguments of ":winsize" and
+ ":winpos".
+Files: src/ex_docmd.c
+
+Patch 6.1.436
+Problem: When a long UTF-8 file contains an illegal byte it's hard to find
+ out where it is. (Ron Aaron)
+Solution: Add the line number to the error message.
+Files: src/fileio.c
+
+Patch 6.1.437 (extra, depends on 6.1.421)
+Problem: Using multi-byte functions when they are not available.
+Solution: Put the clipboard conversion inside an #ifdef. (Vince Negri)
+ Also fix a pointer type mistake. (Walter Briscoe)
+Files: src/os_mswin.c
+
+Patch 6.1.438
+Problem: When Perl has thread support Vim cannot use the Perl interface.
+Solution: Add a configure check and disable Perl when it will not work.
+ (Aron Griffis)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.1.439
+Problem: Netbeans: A "create" function doesn't actually create a buffer,
+ following functions may fail.
+Solution: Create a Vim buffer without a name when "create" is called.
+ (Gordon Prieur)
+Files: runtime/doc/netbeans.txt, src/netbeans.c
+
+Patch 6.1.440
+Problem: The "@*" command doesn't obtain the actual contents of the
+ clipboard. (Hari Krishna Dara)
+Solution: Obtain the clipboard text before executing the command.
+Files: src/ops.c
+
+Patch 6.1.441
+Problem: "zj" and "zk" cannot be used as a motion command after an
+ operator. (Ralf Hetzel)
+Solution: Accept these commands as motion commands.
+Files: src/normal.c
+
+Patch 6.1.442
+Problem: Unicode 3.2 defines more space and punctuation characters.
+Solution: Add the new characters to the Unicode tables. (Raphael Finkel)
+Files: src/mbyte.c
+
+Patch 6.1.443 (extra)
+Problem: Win32: The gvimext.dll build with Borland 5.5 requires another
+ DLL.
+Solution: Build a statically linked version by default. (Dan Sharp)
+Files: GvimExt/Make_bc5.mak
+
+Patch 6.1.444 (extra)
+Problem: Win32: Enabling a build with gettext support is not consistent.
+Solution: Use "GETTEXT" for Borland and msvc makefiles. (Dan Sharp)
+Files: src/Make_bc5.mak, src/Make_mvc.mak
+
+Patch 6.1.445 (extra)
+Problem: DJGPP: get warning for argument of putenv()
+Solution: Define HAVE_PUTENV to use DJGPP's putenv(). (Walter Briscoe)
+Files: src/os_msdos.h
+
+Patch 6.1.446 (extra)
+Problem: Win32: The MingW makefile uses a different style of arguments than
+ other makefiles.
+ Dynamic IME is not supported for Cygwin.
+Solution: Use "no" and "yes" style arguments. Remove the use of the
+ dyn-ming.h include file. (Dan Sharp)
+ Do not include the ime.h file and adjust the makefile. (Alejandro
+ Lopez-Valencia)
+Files: src/Make_cyg.mak, src/Make_ming.mak, src/gui_w32.c,
+ src/if_perl.xs, src/if_python.c, src/if_ruby.c, src/os_win32.c
+
+Patch 6.1.447
+Problem: "make install" uses "make" directly for generating help tags.
+Solution: Use $(MAKE) instead of "make". (Tim Mooney)
+Files: src/Makefile
+
+Patch 6.1.448
+Problem: 'titlestring' has a default maximum width of 50 chars per item.
+Solution: Remove the default maximum (also for 'statusline').
+Files: src/buffer.c
+
+Patch 6.1.449
+Problem: When "1" and "a" are in 'formatoptions', auto-formatting always
+ moves a newly added character to the next line. (Servatius Brandt)
+Solution: Don't move a single character to the next line when it was just
+ typed.
+Files: src/edit.c
+
+Patch 6.1.450
+Problem: Termcap entry "kB" for back-tab is not recognized.
+Solution: Use back-tab as the shift-tab code.
+Files: src/keymap.h, src/misc2.c, src/term.c
+
+Patch 6.1.451
+Problem: GUI: When text in the find dialog contains a slash, a backslash is
+ inserted the next time it is opened. (Mezz)
+Solution: Remove escaped backslashes and question marks. (Daniel Elstner)
+Files: src/gui.c
+
+Patch 6.1.452 (extra, after 6.1.446)
+Problem: Win32: IME support doesn't work for MSVC.
+Solution: Use _MSC_VER instead of __MSVC. (Alejandro Lopez-Valencia)
+Files: src/gui_w32.c
+
+Patch 6.1.453 (after 6.1.429)
+Problem: When compiled without sign icons but with sign support, adding a
+ sign may cause a crash.
+Solution: Check for the text sign to exist before using it. (Kamil
+ Burzynski)
+Files: src/screen.c
+
+Patch 6.1.454 (extra)
+Problem: Win32: pasting Russian text in Vim with 'enc' set to cp1251
+ results in utf-8 bytes. (Perelyubskiy)
+ Conversion from DBCS to UCS2 does not work when 'encoding' is not
+ the active codepage.
+Solution: Introduce enc_codepage and use it for conversion to 'encoding'
+ (Glenn Maynard)
+ Use MultiByteToWideChar() and WideCharToMultiByte() instead of
+ iconv(). Should do most needed conversions without iconv.dll.
+Files: src/globals.h, src/gui_w32.c, src/mbyte.c, src/os_mswin.c,
+ src/proto/mbyte.pro, src/proto/os_mswin.pro, src/structs.h
+
+Patch 6.1.455
+Problem: Some Unicode characters can be one or two character cells wide.
+Solution: Add the 'ambiwidth' option to tell Vim how to display these
+ characters. (Jungshik Shin)
+ Also reset the script ID when setting an option to its default
+ value, so that ":verbose set" won't give wrong info.
+Files: runtime/doc/options.txt, src/mbyte.c, src/option.c, src/option.h
+
+Patch 6.1.456 (extra, after 6.1.454)
+Problem: Win32: IME doesn't work.
+Solution: ImmGetCompositionStringW() returns the size in bytes, not words.
+ (Yasuhiro Matsumoto) Also fix typecast problem.
+Files: src/gui_w32.c, src/os_mswin.c
+
+Patch 6.1.457
+Problem: An empty register in viminfo causes conversion to fail.
+Solution: Don't convert an empty string. (Yasuhiro Matsumoto)
+Files: src/ex_cmds.c, src/mbyte.c
+
+Patch 6.1.458
+Problem: Compiler warning for pointer.
+Solution: Add a typecast.
+Files: src/ex_cmds.c
+
+Patch 6.1.459 (extra)
+Problem: Win32: libcall() may return an invalid pointer and cause Vim to
+ crash.
+Solution: Add a strict check for the returned pointer. (Bruce Mellows)
+Files: src/os_mswin.c
+
+Patch 6.1.460
+Problem: GTK: after scrolling the text one line with a key, clicking the
+ arrow of the scrollbar does not always work. (Nam SungHyun)
+Solution: Always update the scrollbar thumb when the value changed, even
+ when it would not move, like for RISCOS. (Daniel Elstner)
+Files: src/gui.c, src/gui.h
+
+Patch 6.1.461
+Problem: When a keymap is active, typing a character in Select mode does
+ not use it. (Benji Fisher)
+Solution: Apply Insert mode mapping to the character typed in Select mode.
+Files: src/normal.c
+
+Patch 6.1.462
+Problem: When autocommands wipe out a buffer, a crash may happen. (Hari
+ Krishna Dara)
+Solution: Don't decrement the window count of a buffer before calling the
+ autocommands for it. When re-using the current buffer, watch out
+ for autocommands changing the current buffer.
+Files: src/buffer.c, src/ex_cmds.c, src/proto/buffer.pro
+
+Patch 6.1.463
+Problem: When writing a compressed file, the file name that gzip stores in
+ the file is the weird temporary file name. (David Rennalls)
+Solution: Use the real file name when possible.
+Files: runtime/plugin/gzip.vim
+
+Patch 6.1.464
+Problem: Crash when using C++ syntax highlighting. (Gerhard Hochholzer)
+Solution: Check for a negative index.
+Files: src/syntax.c
+
+Patch 6.1.465 (after 6.1.454)
+Problem: Compile error when using cygwin.
+Solution: Change #ifdef WIN32 to #ifdef WIN3264. (Alejandro Lopez-Valencia)
+ Undefine WIN32 after including windows.h
+Files: src/mbyte.c
+
+Patch 6.1.466
+Problem: The "-f" argument is a bit obscure.
+Solution: Add the "--nofork" argument. Improve the help text a bit.
+Files: runtime/doc/starting.txt, src/main.c
+
+Patch 6.1.467
+Problem: Setting the window title doesn't work for Chinese.
+Solution: Use an X11 function to convert text to a text property. (Kentaro
+ Nakazawa)
+Files: src/os_unix.c
+
+Patch 6.1.468
+Problem: ":mksession" also stores folds for buffers which will not be
+ restored.
+Solution: Only store folds for a buffer with 'buftype' empty and help files.
+Files: src/ex_docmd.c
+
+Patch 6.1.469
+Problem: 'listchars' cannot contain multi-byte characters.
+Solution: Handle multi-byte UTF-8 list characters. (Matthew Samsonoff)
+Files: src/message.c, src/option.c, src/screen.c
+
+Patch 6.1.470 (lang)
+Problem: Polish messages don't show up correctly on MS-Windows.
+Solution: Convert messages to cp1250. (Mikolaj Machowski)
+ Also add English message translations, because it got in the way
+ of the patch.
+Files: Makefile, src/po/Makefile, src/po/en_gb.po, src/po/pl.po
+
+Patch 6.1.471
+Problem: ":jumps" output continues after pressing "q" at the more-prompt.
+ (Hari Krishna Dara)
+Solution: Check for "got_int" being set.
+Files: src/mark.c
+
+Patch 6.1.472
+Problem: When there is an authentication error when connecting to the X
+ server Vim exits.
+Solution: Use XSetIOErrorHandler() to catch the error and longjmp() to avoid
+ the exit. Also do this in the main loop, so that when the X
+ server exits a Vim running in a console isn't killed.
+Files: src/globals.h, src/main.c, src/os_unix.c
+
+Patch 6.1.473
+Problem: Referring to $curwin or $curbuf in Perl 5.6 causes a crash.
+Solution: Add "pTHX_" to cur_val(). (Yasuhiro Matsumoto)
+Files: src/if_perl.xs
+
+Patch 6.1.474
+Problem: When opening the command-line window in Ex mode it's impossible to
+ go back. (Pavol Juhas)
+Solution: Reset "exmode_active" and restore it when the command-line window
+ is closed.
+Files: src/ex_getln.c
+
+
+Patch 6.2f.001
+Problem: The configure check for Ruby didn't work properly for Ruby 1.8.0.
+Solution: Change the way the Ruby check is done. (Aron Griffis)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2f.002
+Problem: The output of ":ls" doesn't show whether a buffer had read errors.
+Solution: Add the "x" flag in the ":ls" output.
+Files: runtime/doc/windows.txt, src/buffer.c
+
+Patch 6.2f.003
+Problem: Test49 doesn't properly test the behavior of ":catch" without an
+ argument.
+Solution: Update test49. (Servatius Brandt)
+Files: src/testdir/test49.ok, src/testdir/test49.vim
+
+Patch 6.2f.004
+Problem: "vim --version" always uses CR/LF in the output.
+Solution: Omit the CR.
+Files: src/message.c, src/os_unix.c
+
+Patch 6.2f.005
+Problem: Two error messages without a colon after the number.
+Solution: Add the colon. (Taro Muraoka)
+Files: src/if_cscope.c
+
+Patch 6.2f.006
+Problem: When saving a file takes a while and Vim regains focus this can
+ result in a "file changed outside of Vim" warning and ml_get()
+ errors. (Mike Williams)
+Solution: Add the "b_saving" flag to avoid checking the timestamp while the
+ buffer is being saved. (Michael Schaap)
+Files: src/fileio.c, src/structs.h
+
+Patch 6.2f.007
+Problem: Irix compiler complains about multiple defined symbols.
+ vsnprintf() is not available. (Charles Campbell)
+Solution: Insert EXTERN for variables in globals.h. Change the configure
+ check for vsnprintf() from compiling to linking.
+Files: src/auto/configure, src/configure.in, src/globals.h
+
+Patch 6.2f.008
+Problem: The Aap recipe doesn't work with Aap 0.149.
+Solution: Change targetarg to TARGETARG. Update the mysign file.
+Files: src/main.aap, src/mysign
+
+Patch 6.2f.009 (extra)
+Problem: Small problem when building with Borland 5.01.
+Solution: Use mkdir() instead of _mkdir(). (Walter Briscoe)
+Files: src/dosinst.h
+
+Patch 6.2f.010
+Problem: Warning for missing prototypes.
+Solution: Add missing prototypes. (Walter Briscoe)
+Files: src/if_cscope.c
+
+Patch 6.2f.011
+Problem: The configure script doesn't work with autoconf 2.5x.
+Solution: Add square brackets around a header check. (Aron Griffis)
+ Note: touch src/auto/configure after applying this patch.
+Files: src/configure.in
+
+Patch 6.2f.012
+Problem: ":echoerr" doesn't work correctly inside try/endtry.
+Solution: Don't reset did_emsg inside a try/endtry. (Servatius Brandt)
+Files: src/eval.c
+
+Patch 6.2f.013 (extra)
+Problem: Macintosh: Compiler warning for a trigraph.
+Solution: Insert a backslash before each question mark. (Peter Cucka)
+Files: src/os_mac.h
+
+Patch 6.2f.014 (extra)
+Problem: Macintosh: ex_eval is not included in the project file.
+Solution: Add ex_eval. (Dany St-Amant)
+Files: src/os_mac.pbproj/project.pbxproj
+
+Patch 6.2f.015 (extra)
+Problem: Win32: When changing header files not all source files involved
+ are recompiled.
+Solution: Improve the dependency rules. (Dan Sharp)
+Files: src/Make_cyg.mak, src/Make_ming.mak
+
+Patch 6.2f.016
+Problem: "vim --version > ff" on non-Unix systems results in a file with a
+ missing line break at the end. (Bill McCArthy)
+Solution: Add a line break.
+Files: src/main.c
+
+Patch 6.2f.017
+Problem: Unix: starting Vim in the background and then bringing it to the
+ foreground may cause the terminal settings to be wrong.
+Solution: Check for tcsetattr() to return an error, retry when it does.
+ (Paul Tapper)
+Files: src/os_unix.c
+
+Patch 6.2f.018
+Problem: Mac OS X 10.2: OK is defined to zero in cursus.h while Vim uses
+ one. Redefining it causes a warning message.
+Solution: Undefine OK before defining it to one. (Taro Muraoka)
+Files: src/vim.h
+
+Patch 6.2f.019
+Problem: Mac OS X 10.2: COLOR_BLACK and COLOR_WHITE are defined in
+ curses.h.
+Solution: Rename them to PRCOLOR_BLACK and PRCOLOR_WHITE.
+Files: src/ex_cmds2.c
+
+Patch 6.2f.020
+Problem: Win32: test50 produces beeps and fails with some versions of diff.
+Solution: Remove empty lines and convert the output to dos fileformat.
+Files: src/testdir/test50.in
+
+Patch 6.2f.021
+Problem: Running configure with "--enable-netbeans" disables Netbeans.
+ (Gordon Prieur)
+Solution: Fix the tests in configure.in where the default is to enable a
+ feature. Fix that "--enable-acl" reported "yes" confusingly.
+Files: src/auto/configure, src/configure.in, src/mysign
+
+Patch 6.2f.022
+Problem: A bogus value for 'foldmarker' is not rejected, possibly causing a
+ hang. (Derek Wyatt)
+Solution: Check for a non-empty string before and after the comma.
+Files: src/option.c
+
+Patch 6.2f.023
+Problem: When the help files are not in $VIMRUNTIME but 'helpfile' is
+ correct Vim still can't find the help files.
+Solution: Also look for a tags file in the directory of 'helpfile'.
+Files: src/tag.c
+
+Patch 6.2f.024
+Problem: When 'delcombine' is set and a character has more than two
+ composing characters "x" deletes them all.
+Solution: Always delete only the last composing character.
+Files: src/misc1.c
+
+Patch 6.2f.025
+Problem: When reading a file from stdin that has DOS line endings but a
+ missing end-of-line for the last line 'fileformat' becomes "unix".
+ (Bill McCarthy)
+Solution: Don't add the missing line break when re-reading the text from the
+ buffer.
+Files: src/fileio.c
+
+Patch 6.2f.026
+Problem: When typing new text at the command line, old composing characters
+ may be displayed.
+Solution: Don't read composing characters from after the end of the
+ text to be displayed.
+Files: src/ex_getln.c, src/mbyte.c, src/message.c, src/proto/mbyte.pro,
+ src/screen.c
+
+Patch 6.2f.027
+Problem: Compiler warnings for unsigned char pointers. (Tony Leneis)
+Solution: Add typecasts to char pointer.
+Files: src/quickfix.c
+
+Patch 6.2f.028
+Problem: GTK: When 'imactivatekey' is empty and XIM is inactive it can't be
+ made active again. Cursor isn't updated immediately when changing
+ XIM activation. Japanese XIM may hang when using 'imactivatekey'.
+ Can't activate XIM after typing fFtT command or ":sh".
+Solution: Properly set the flag that indicates the IM is active. Update the
+ cursor right away. Do not send a key-release event. Handle
+ Normal mode and running an external command differently.
+ (Yasuhiro Matsumoto)
+Files: src/mbyte.c
+
+Patch 6.2f.029
+Problem: Mixing use of int and enum.
+Solution: Adjust argument type of cs_usage_msg(). Fix wrong typedef.
+Files: src/if_cscope.c, src/if_cscope.h
+
+Patch 6.2f.030 (after 6.2f.028)
+Problem: Cursor moves up when using XIM.
+Solution: Reset im_preedit_cursor. (Yasuhiro Matsumoto)
+Files: src/mbyte.c
+
+Patch 6.2f.031
+Problem: Crash when listing a function argument in the debugger. (Ron Aaron)
+Solution: Init the name field of an argument to NULL.
+Files: src/eval.c
+
+Patch 6.2f.032
+Problem: When a write fails for a ":silent!" while inside try/endtry the
+ BufWritePost autocommands are not triggered.
+Solution: Check the emsg_silent flag in should_abort(). (Servatius Brandt)
+Files: src/ex_eval.c, src/testdir/test49.ok, src/testdir/test49.vim
+
+Patch 6.2f.033
+Problem: Cscope: re-entrance problem for ":cscope" command. Checking for
+ duplicate database didn't work well for Win95. Didn't check for
+ duplicate databases after an empty entry.
+Solution: Don't set postponed_split too early. Remember first empty
+ database entry. (Sergey Khorev)
+Files: src/if_cscope.c
+
+Patch 6.2f.034
+Problem: The netbeans interface cannot be used on systems without
+ vsnprintf(). (Tony Leneis)
+Solution: Use EMSG(), EMSGN() and EMSG2() instead.
+Files: src/auto/configure, src/configure.in, src/netbeans.c
+
+Patch 6.2f.035
+Problem: The configure check for the netbeans interface doesn't work if the
+ socket and nsl libraries are required.
+Solution: Check for the socket and nsl libraries before the netbeans check.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2f.036
+Problem: Moving leftwards over text with an illegal UTF-8 byte moves one
+ byte instead of one character.
+Solution: Ignore an illegal byte after the cursor position.
+Files: src/mbyte.c
+
+Patch 6.2f.037
+Problem: When receiving a Netbeans command at the hit-enter or more prompt
+ the screen is redrawn but Vim is still waiting at the prompt.
+Solution: Quit the prompt like a CTRL-C was typed.
+Files: src/netbeans.c
+
+Patch 6.2f.038
+Problem: The dependency to run autoconf causes a patch for configure.in
+ to run autoconf, even though the configure script was updated as
+ well.
+Solution: Only run autoconf with "make autoconf".
+Files: src/Makefile
+
+Patch 6.2f.039
+Problem: CTRL-W K makes the new top window very high.
+Solution: When 'equalalways' is set equalize the window heights.
+Files: src/window.c
+
+
+==============================================================================
+VERSION 6.3 *version-6.3*
+
+This section is about improvements made between version 6.2 and 6.3.
+
+This is mainly a bug-fix release. There are also a few new features.
+The major number of new items is in the runtime files and translations.
+
+
+Changed *changed-6.3*
+-------
+
+The intro message also displays a note about sponsoring Vim, mixed randomly
+with the message about helping children in Uganda.
+
+Included the translated menus, keymaps and tutors with the normal runtime
+files. The separate "lang" archive now only contains translated messages.
+
+Made the translated menu file names a bit more consistent. Use "latin1" for
+"iso_8859-1" and "iso_8859-15".
+
+Removed the "file_select.vim" script from the distribution. It's not more
+useful than other scripts that can be downloaded from www.vim.org.
+
+The "runtime/doc/tags" file is now always in unix fileformat. On MS-Windows
+it used to be dos fileformat, but ":helptags" generates a unix format file.
+
+
+Added *added-6.3*
+-----
+
+New commands:
+ :cNfile go to last error in previous file
+ :cpfile idem
+ :changes print the change list
+ :keepmarks following command keeps marks where they are
+ :keepjumps following command keeps jumplist and marks
+ :lockmarks following command keeps marks where they are
+ :redrawstatus force a redraw of the status line(s)
+
+New options:
+ 'antialias' Mac OS X: use smooth, antialiased fonts
+ 'helplang' preferred help languages
+
+Syntax files:
+ Arch inventory (Nikolai Weibull)
+ Calendar (Nikolai Weibull)
+ Ch (Wayne Cheng)
+ Controllable Regex Mutilator (Nikolai Weibull)
+ D (Jason Mills)
+ Desktop (Mikolaj Machowski)
+ Dircolors (Nikolai Weibull)
+ Elinks configuration (Nikolai Weibull)
+ FASM (Ron Aaron)
+ GrADS scripts (Stefan Fronzek)
+ Icewm menu (James Mahler)
+ LDIF (Zak Johnson)
+ Locale input, fdcc. (Dwayne Bailey)
+ Pinfo config (Nikolai Weibull)
+ Pyrex (Marco Barisione)
+ Relax NG Compact (Nikolai Weibull)
+ Slice (Morel Bodin)
+ VAX Macro Assembly (Tom Uijldert)
+ grads (Stefan Fronzek)
+ libao (Nikolai Weibull)
+ mplayer (Nikolai Weibull)
+ rst (Nikolai Weibull)
+ tcsh (Gautam Iyer)
+ yaml (Nikolai Weibull)
+
+Compiler plugins:
+ ATT dot (Marcos Macedo)
+ Apple Project Builder (Alexander von Below)
+ Intel (David Harrison)
+ bdf (Nikolai Weibull)
+ icc (Peter Puck)
+ javac (Doug Kearns)
+ neato (Marcos Macedo)
+ onsgmls (Robert B. Rowsome)
+ perl (Christian J. Robinson)
+ rst (Nikolai Weibull)
+ se (SmartEiffel) (Doug Kearns)
+ tcl (Doug Kearns)
+ xmlwf (Robert B. Rowsome)
+
+Filetype plugins:
+ Aap (Bram Moolenaar)
+ Ch (Wayne Cheng)
+ Css (Nikolai Weibull)
+ Pyrex (Marco Barisione)
+ Rst (Nikolai Weibull)
+
+Indent scripts:
+ Aap (Bram Moolenaar)
+ Ch (Wayne Cheng)
+ DocBook (Nikolai Weibull)
+ MetaPost (Eugene Minkovskii)
+ Objective-C (Kazunobu Kuriyama)
+ Pyrex (Marco Barisione)
+ Rst (Nikolai Weibull)
+ Tcsh (Gautam Iyer)
+ XFree86 configuration file (Nikolai Weibull)
+ Zsh (Nikolai Weibull)
+
+Keymaps:
+ Greek for cp1253 (Panagiotis Louridas)
+ Hungarian (Magyar) (Laszlo Zavaleta)
+ Persian-Iranian (Behnam Esfahbod)
+
+Message translations:
+ Catalan (Ernest Adrogue)
+ Russian (Vassily Ragosin)
+ Swedish (Johan Svedberg)
+
+Menu translations:
+ Catalan (Ernest Adrogue)
+ Russian (Tim Alexeevsky)
+ Swedish (Johan Svedberg)
+
+Tutor translations:
+ Catalan (Ernest Adrogue)
+ Russian in cp1251 (Alexey Froloff)
+ Slovak in cp1251 and iso8859-2 (Lubos Celko)
+ Swedish (Johan Svedberg)
+ Korean (Kee-Won Seo)
+ UTF-8 version of the Japanese tutor (Yasuhiro Matsumoto) Use this as
+ the original, create the other Japanese tutor by conversion.
+
+Included "russian.txt" help file. (Vassily Ragosin)
+
+Include Encapsulated PostScript and PDF versions of the Vim logo in the extra
+archive.
+
+The help highlighting finds the highlight groups and shows them in the color
+that is actually being used. (idea from Yakov Lerner)
+
+The big Win32 version is now compiled with Ruby interface, version 1.8. For
+Python version 2.3 is used. For Perl version 5.8 is used.
+
+The "ftdetect" directory is mentioned in the documentation. The DOS install
+program creates it.
+
+
+Fixed *fixed-6.3*
+-----
+
+Test 42 failed on MS-Windows. Set and reset 'fileformat' and 'binary' options
+here and there. (Walter Briscoe)
+
+The explorer plugin didn't work for double-byte 'encoding's.
+
+Use "copy /y" in Make_bc5.mak to avoid a prompt for overwriting.
+
+Patch 6.2.001
+Problem: The ":stopinsert" command doesn't have a help tag.
+Solution: Add the tag. (Antoine J. Mechelynck)
+Files: runtime/doc/insert.txt, runtime/doc/tags
+
+Patch 6.2.002
+Problem: When compiled with the +multi_byte feature but without +eval,
+ displaying UTF-8 characters may cause a crash. (Karsten Hopp)
+Solution: Also set the default for 'ambiwidth' when compiled without the
+ +eval feature.
+Files: src/option.c
+
+Patch 6.2.003
+Problem: GTK 2: double-wide characters below 256 are not displayed
+ correctly.
+Solution: Check the cell width for characters above 127. (Yasuhiro
+ Matsumoto)
+Files: src/gui_gtk_x11.c
+
+Patch 6.2.004
+Problem: With a line-Visual selection at the end of the file a "p" command
+ puts the text one line upwards.
+Solution: Detect that the last line was deleted and put forward. (Taro
+ Muraoka)
+Files: src/normal.c
+
+Patch 6.2.005
+Problem: GTK: the "Find" and "Find and Replace" tools don't work. (Aschwin
+ Marsman)
+Solution: Show the dialog after creating it. (David Necas)
+Files: src/gui_gtk.c
+
+Patch 6.2.006
+Problem: The Netbeans code contains an obsolete function that uses "vim61"
+ and sets the fall-back value for $VIMRUNTIME.
+Solution: Delete the obsolete function.
+Files: src/main.c, src/netbeans.c, src/proto/netbeans.pro
+
+Patch 6.2.007
+Problem: Listing tags for Cscope doesn't always work.
+Solution: Avoid using smgs_attr(). (Sergey Khorev)
+Files: src/if_cscope.c
+
+Patch 6.2.008
+Problem: XIM with GTK 2: After backspacing preedit characters are wrong.
+Solution: Reset the cursor position. (Yasuhiro Matsumoto)
+Files: src/mbyte.c
+
+Patch 6.2.009
+Problem: Win32: The self-installing executable "Full" selection only
+ selects some of the items to install. (Salman Mohsin)
+Solution: Change commas to spaces in between section numbers.
+Files: nsis/gvim.nsi
+
+Patch 6.2.010
+Problem: When 'virtualedit' is effective and a line starts with a
+ multi-byte character, moving the cursor right doesn't work.
+Solution: Obtain the right character to compute the column offset. (Taro
+ Muraoka)
+Files: src/charset.c
+
+Patch 6.2.011
+Problem: Alpha OSF1: stat() is a macro and doesn't allow an #ifdef halfway.
+ (Moshe Kaminsky)
+Solution: Move the #ifdef outside of stat().
+Files: src/os_unix.c
+
+Patch 6.2.012
+Problem: May hang when polling for a character.
+Solution: Break the wait loop when not waiting for a character.
+Files: src/os_unix.c
+
+Patch 6.2.013 (extra)
+Problem: Win32: The registry key for uninstalling GvimExt still uses "6.1".
+Solution: Change the version number to "6.2". (Ajit Thakkar)
+Files: src/GvimExt/GvimExt.reg
+
+Patch 6.2.014 (after 6.2.012)
+Problem: XSMP doesn't work when using poll().
+Solution: Use xsmp_idx instead of gpm_idx. (Neil Bird)
+Files: src/os_unix.c
+
+Patch 6.2.015
+Problem: The +xsmp feature is never enabled.
+Solution: Move the #define for USE_XSMP to below where WANT_X11 is defined.
+ (Alexey Froloff)
+Files: src/feature.h
+
+Patch 6.2.016
+Problem: Using ":scscope find" with 'cscopequickfix' does not always split
+ the window. (Gary Johnson)
+ Win32: ":cscope add" could make the script that contains it
+ read-only until the corresponding ":cscope kill".
+ Errors during ":cscope add" may not be handled properly.
+Solution: When using the quickfix window may need to split the window.
+ Avoid file handle inheritance for the script.
+ Check for a failed connection and/or process. (Sergey Khorev)
+Files: src/ex_cmds2.c, src/if_cscope.c
+
+Patch 6.2.017
+Problem: Test11 sometimes prompts the user, because a file would have been
+ changed outside of Vim. (Antonio Colombo)
+Solution: Add a FileChangedShell autocommand to avoid the prompt.
+Files: src/testdir/test11.in
+
+Patch 6.2.018
+Problem: When using the XSMP protocol and reading from stdin Vim may wait
+ for a key to be pressed.
+Solution: Avoid that RealWaitForChar() is used recursively.
+Files: src/os_unix.c
+
+Patch 6.2.019 (lang)
+Problem: Loading the Portuguese menu causes an error message.
+Solution: Join two lines. (Jose Pedro Oliveira, José de Paula)
+Files: runtime/lang/menu_pt_br.vim
+
+Patch 6.2.020
+Problem: The "Syntax/Set syntax only" menu item causes an error message.
+ (Oyvind Holm)
+Solution: Set the script-local variable in a function. (Benji Fisher)
+Files: runtime/synmenu.vim
+
+Patch 6.2.021
+Problem: The user manual section on exceptions contains small mistakes.
+Solution: Give a good example of an error that could be missed and other
+ improvements. (Servatius Brandt)
+Files: runtime/doc/usr_41.txt
+
+Patch 6.2.022 (extra)
+Problem: Win32: After deleting a menu item it still appears in a tear-off
+ window.
+Solution: Set the mode to zero for the deleted item. (Yasuhiro Matsumoto)
+Files: src/gui_w32.c
+
+Patch 6.2.023 (extra)
+Problem: Win32: Make_ivc.mak does not clean everything.
+Solution: Delete more files in the clean rule. (Walter Briscoe)
+Files: src/Make_ivc.mak
+
+Patch 6.2.024 (extra)
+Problem: Win32: Compiler warnings for typecasts.
+Solution: Use DWORD instead of WORD. (Walter Briscoe)
+Files: src/gui_w32.c
+
+Patch 6.2.025
+Problem: Missing prototype for sigaltstack().
+Solution: Add the prototype when it is not found in a header file.
+Files: src/os_unix.c
+
+Patch 6.2.026
+Problem: Warning for utimes() argument.
+Solution: Add a typecast.
+Files: src/fileio.c
+
+Patch 6.2.027
+Problem: Warning for uninitialized variable.
+Solution: Set mb_l to one when not using multi-byte characters.
+Files: src/message.c
+
+Patch 6.2.028
+Problem: Cscope connection may kill Vim process and others.
+Solution: Check for pid being larger than one. (Khorev Sergey)
+Files: src/if_cscope.c
+
+Patch 6.2.029
+Problem: When using the remote server functionality Vim may leak memory.
+ (Srikanth Sankaran)
+Solution: Free the result of XListProperties().
+Files: src/if_xcmdsrv.c
+
+Patch 6.2.030
+Problem: Mac: Warning for not being able to use precompiled header files.
+Solution: Don't redefine select. Use -no-cpp-precomp for compiling, so that
+ function prototypes are still found.
+Files: src/os_unix.c, src/osdef.sh
+
+Patch 6.2.031
+Problem: The langmenu entry in the options window doesn't work. (Rodolfo
+ Lima)
+ With GTK 1 the ":options" command causes an error message.
+ (Michael Naumann)
+Solution: Change "lmenu" to "langmenu". Only display the 'tbis' option for
+ GTK 2.
+Files: runtime/optwin.vim
+
+Patch 6.2.032
+Problem: The lpc filetype is never recognized. (Shizhu Pan)
+Solution: Check for g:lpc_syntax_for_c instead of the local variable
+ lpc_syntax_for_c. (Benji Fisher)
+Files: runtime/filetype.vim
+
+Patch 6.2.033 (extra)
+Problem: Mac: Various compiler warnings.
+Solution: Don't include Classic-only headers in Unix version.
+ Remove references to several unused variables. (Ben Fowler)
+ Fix double definition of DEFAULT_TERM.
+ Use int instead of unsigned short for pixel values, so that the
+ negative error values are recognized.
+Files: src/gui_mac.c, src/term.c
+
+Patch 6.2.034
+Problem: Mac: Compiler warning for redefining DEFAULT_TERM.
+Solution: Fix double definition of DEFAULT_TERM.
+Files: src/term.c
+
+Patch 6.2.035
+Problem: Mac: Compiler warnings in Python interface.
+Solution: Make a difference between pure Mac and Unix-Mac. (Peter Cucka)
+Files: src/if_python.c
+
+Patch 6.2.036 (extra)
+Problem: Mac Unix version: If foo is a directory, then ":e f<Tab>" should
+ expand to ":e foo/" instead of ":e foo" . (Vadim Zeitlin)
+Solution: Define DONT_ADD_PATHSEP_TO_DIR only for pure Mac. (Benji Fisher)
+Files: src/os_mac.h
+
+Patch 6.2.037
+Problem: Win32: converting an encoding name to a codepage could result in
+ an arbitrary number.
+Solution: make encname2codepage() return zero if the encoding name doesn't
+ contain a codepage number.
+Files: src/mbyte.c
+
+Patch 6.2.038 (extra)
+Problem: Warning messages when using the MingW compiler. (Bill McCarthy)
+ Can't compile console version without +mouse feature.
+Solution: Initialize variables, add parenthesis.
+ Add an #ifdef around g_nMouseClick. (Ajit Thakkar)
+Files: src/eval.c, src/os_win32.c, src/gui_w32.c, src/dosinst.c
+
+Patch 6.2.039 (extra)
+Problem: More warning messages when using the MingW compiler.
+Solution: Initialize variables. (Bill McCarthy)
+Files: src/os_mswin.c
+
+Patch 6.2.040
+Problem: FreeBSD: Crash while starting up when compiled with +xsmp feature.
+Solution: Pass a non-NULL argument to IceAddConnectionWatch().
+Files: src/os_unix.c
+
+Patch 6.2.041 (extra, after 6.2.033)
+Problem: Mac: Compiler warnings for conversion types, missing prototype,
+ missing return type.
+Solution: Change sscanf "%hd" to "%d", the argument is an int now. Add
+ gui_mch_init_check() prototype. Add "int" to termlib functions.
+Files: src/gui_mac.c, src/proto/gui_mac.pro, src/termlib.c.
+
+Patch 6.2.042 (extra)
+Problem: Cygwin: gcc 3.2 has an optimizer problem, sometimes causing a
+ crash.
+Solution: Add -fno-strength-reduce to the compiler arguments. (Dan Sharp)
+Files: src/Make_cyg.mak
+
+Patch 6.2.043
+Problem: Compiling with both netbeans and workshop doesn't work.
+Solution: Move the shellRectangle() function to gui_x11.c. (Gordon Prieur)
+Files: src/gui_x11.c, src/integration.c, src/netbeans.c,
+ src/proto/netbeans.pro
+
+Patch 6.2.044
+Problem: ":au filetypedetect" gives an error for a non-existing event name,
+ but it's actually a non-existing group name. (Antoine Mechelynck)
+Solution: Make the error message clearer.
+Files: src/fileio.c
+
+Patch 6.2.045
+Problem: Obtaining the '( mark changes the '' mark. (Gary Holloway)
+Solution: Don't set the '' mark when searching for the start/end of the
+ current sentence/paragraph.
+Files: src/mark.c
+
+Patch 6.2.046
+Problem: When evaluating an argument of a function throws an exception the
+ function is still called. (Hari Krishna Dara)
+Solution: Don't call the function when an exception was thrown.
+Files: src/eval.c
+
+Patch 6.2.047 (extra)
+Problem: Compiler warnings when using MingW. (Bill McCarthy)
+Solution: Give the s_dwLastClickTime variable a type. Initialize dwEndTime.
+Files: src/os_win32.c
+
+Patch 6.2.048
+Problem: The Python interface doesn't compile with Python 2.3 when
+ dynamically loaded.
+Solution: Use dll_PyObject_Malloc and dll_PyObject_Free. (Paul Moore)
+Files: src/if_python.c
+
+Patch 6.2.049
+Problem: Using a "-range=" argument with ":command" doesn't work and
+ doesn't generate an error message.
+Solution: Generate an error message.
+Files: src/ex_docmd.c
+
+Patch 6.2.050
+Problem: Test 32 didn't work on MS-Windows.
+Solution: Write the temp file in Unix fileformat. (Walter Briscoe)
+Files: src/testdir/test32.in
+
+Patch 6.2.051
+Problem: When using "\=submatch(0)" in a ":s" command, line breaks become
+ NUL characters.
+Solution: Change NL to CR characters, so that they become line breaks.
+Files: src/regexp.c
+
+Patch 6.2.052
+Problem: A few messages are not translated.
+Solution: Add _() to the messages. (Muraoka Taro)
+Files: src/ex_cmds.c
+
+Patch 6.2.053
+Problem: Prototype for bzero() doesn't match most systems.
+Solution: Use "void *" instead of "char *" and "size_t" intead of "int".
+Files: src/osdef1.h.in
+
+Patch 6.2.054
+Problem: A double-byte character with a second byte that is a backslash
+ causes problems inside a string.
+Solution: Skip over multi-byte characters in a string properly. (Yasuhiro
+ Matsumoto)
+Files: src/eval.c
+
+Patch 6.2.055
+Problem: Using col('.') from CTRL-O in Insert mode does not return the
+ correct value for multi-byte characters.
+Solution: Correct the cursor position when it is necessary, move to the
+ first byte of a multi-byte character. (Yasuhiro Matsumoto)
+Files: src/edit.c
+
+Patch 6.2.056 (extra)
+Problem: Building with Sniff++ doesn't work.
+Solution: Use the multi-threaded libc when needed. (Holger Ditting)
+Files: src/Make_mvc.mak
+
+Patch 6.2.057 (extra)
+Problem: Mac: With -DMACOS_X putenv() is defined twice, it is in a system
+ library. Get a warning for redefining OK. Unused variables in
+ os_mac.c
+Solution: Define HAVE_PUTENV. Undefine OK after including curses.h.
+ Remove declarations for unused variables.
+Files: src/os_mac.c, src/os_mac.h, src/vim.h
+
+Patch 6.2.058
+Problem: When 'autochdir' is set ":bnext" to a buffer without a name causes
+ a crash.
+Solution: Don't call vim_chdirfile() when the file name is NULL. (Taro
+ Muraoka)
+Files: src/buffer.c
+
+Patch 6.2.059
+Problem: When 'scrolloff' is a large number and listing completion results
+ on the command line, then executing a command that jumps close to
+ where the cursor was before, part of the screen is not updated.
+ (Yakov Lerner)
+Solution: Don't skip redrawing part of the window when it was scrolled.
+Files: src/screen.c
+
+Patch 6.2.060 (extra)
+Problem: Win32: When 'encoding' is set to "iso-8859-7" copy/paste to/from
+ the clipboard gives a lalloc(0) error. (Kriton Kyrimis)
+Solution: When the string length is zero allocate one byte. Also fix that
+ when the length of the Unicode text is zero (conversion from
+ 'encoding' to UCS-2 was not possible) the normal text is used.
+Files: src/os_mswin.c
+
+Patch 6.2.061
+Problem: GUI: Using the left mouse button with the shift key should work
+ like "*" but it scrolls instead. (Martin Beller)
+Solution: Don't recognize an rxvt scroll wheel event when using the GUI.
+Files: src/term.c
+
+Patch 6.2.062
+Problem: When one buffer uses a syntax with "containedin" and another
+ buffer does not, redrawing depends on what the current buffer is.
+ (Brett Pershing Stahlman)
+Solution: Use "syn_buf" instead of "curbuf" to get the b_syn_containedin
+ flag.
+Files: src/syntax.c
+
+Patch 6.2.063
+Problem: When using custom completion end up with no matches.
+Solution: Make cmd_numfiles and cmd_files local to completion to avoid that
+ they are overwritten when ExpandOne() is called recursively by
+ f_glob().
+Files: src/eval.c, src/ex_docmd.c, src/ex_getln.c, src/proto/ex_getln.pro,
+ src/misc1.c, src/structs.h, src/tag.c
+
+Patch 6.2.064
+Problem: resolve() only handles one symbolic link, need to repeat it to
+ resolve all of them. Then need to simplify the file name.
+Solution: Make resolve() resolve all symbolic links and simplify the result.
+ Add simplify() to just simplify a file name. Fix that test49
+ doesn't work if /tmp is a symbolic link. (Servatius Brandt)
+Files: runtime/doc/eval.txt, src/eval.c, src/tag.c,
+ src/testdir/test49.vim
+
+Patch 6.2.065
+Problem: ":windo 123" only updates other windows when entering them.
+ (Walter Briscoe)
+Solution: Update the topline before going to the next window.
+Files: src/ex_cmds2.c
+
+Patch 6.2.066 (extra)
+Problem: Ruby interface doesn't work with Ruby 1.8.0.
+Solution: Change "defout" to "stdout". (Aron Grifis)
+ Change dynamic loading. (Taro Muraoka)
+Files: src/if_ruby.c, src/Make_mvc.mak
+
+Patch 6.2.067
+Problem: When searching for a string that starts with a composing character
+ the command line isn't drawn properly.
+Solution: Don't count the space to draw the composing character on and
+ adjust the cursor column after drawing the string.
+Files: src/message.c
+
+Patch 6.2.068
+Problem: Events for the netbeans interface that include a file name with
+ special characters don't work properly.
+Solution: Use nb_quote() on the file name. (Sergey Khorev)
+Files: src/netbeans.c
+
+Patch 6.2.069 (after 6.2.064)
+Problem: Unused variables "limit" and "new_st" and unused label "fail" in
+ some situation. (Bill McCarthy)
+Solution: Put the declarations inside an #ifdef. (Servatius Brandt)
+Files: src/eval.c, src/tag.c
+
+Patch 6.2.070 (after 6.2.069)
+Problem: Still unused variable "new_st". (Bill McCarthy)
+Solution: Move the declaration to the right block this time.
+Files: src/tag.c
+
+Patch 6.2.071
+Problem: 'statusline' can only contain 50 % items. (Antony Scriven)
+Solution: Allow 80 items and mention it in the docs.
+Files: runtime/doc/option.txt, src/vim.h
+
+Patch 6.2.072
+Problem: When using expression folding, foldexpr() mostly returns -1 for
+ the previous line, which makes it difficult to write a fold
+ expression.
+Solution: Make the level of the previous line available while still looking
+ for the end of a fold.
+Files: src/fold.c
+
+Patch 6.2.073
+Problem: When adding detection of a specific filetype for a plugin you need
+ to edit "filetype.vim".
+Solution: Source files from the "ftdetect" directory, so that a filetype
+ detection plugin only needs to be dropped in a directory.
+Files: runtime/doc/filetype.txt, runtime/doc/usr_05.txt,
+ runtime/doc/usr_41.txt, runtime/filetype.vim
+
+Patch 6.2.074
+Problem: Warnings when compiling the Python interface. (Ajit Thakkar)
+Solution: Use ANSI function declarations.
+Files: src/if_python.c
+
+Patch 6.2.075
+Problem: When the temp file for writing viminfo can't be used "NULL"
+ appears in the error message. (Ben Lavender)
+Solution: Print the original file name when there is no temp file name.
+Files: src/ex_cmds.c
+
+Patch 6.2.076
+Problem: The tags listed for cscope are in the wrong order. (Johannes
+ Stezenbach)
+Solution: Remove the reordering of tags for the current file. (Sergey
+ Khorev)
+Files: src/if_cscope.c
+
+Patch 6.2.077
+Problem: When a user function specifies custom completion, the function
+ gets a zero argument instead of an empty string when there is no
+ word before the cursor. (Preben Guldberg)
+Solution: Don't convert an empty string to a zero.
+Files: src/eval.c
+
+Patch 6.2.078
+Problem: "make test" doesn't work if Vim wasn't compiled yet. (Ed Avis)
+Solution: Build Vim before running the tests.
+Files: src/Makefile
+
+Patch 6.2.079
+Problem: ":w ++enc=utf-8 !cmd" doesn't work.
+Solution: Check for the "++" argument before the "!".
+Files: src/ex_docmd.c
+
+Patch 6.2.080
+Problem: When 't_ti' is not empty but doesn't swap screens, using "ZZ" in
+ an unmodified file doesn't clear the last line.
+Solution: Call msg_clr_eos() when needed. (Michael Schroeder)
+Files: src/os_unix.c
+
+Patch 6.2.081
+Problem: Problem when using a long multibyte string for the statusline.
+Solution: Use the right pointer to get the cell size. (Taro Muraoka)
+Files: src/buffer.c
+
+Patch 6.2.082
+Problem: Can't compile with Perl 5.8.1.
+Solution: Rename "e_number" to "e_number_exp". (Sascha Blank)
+Files: src/digraph.c, src/globals.h
+
+Patch 6.2.083
+Problem: When a compiler uses ^^^^ to mark a word the information is not
+ visible in the quickfix window. (Srikanth Sankaran)
+Solution: Don't remove the indent for a line that is not recognized as an
+ error message.
+Files: src/quickfix.c
+
+Patch 6.2.084
+Problem: "g_" in Visual mode always goes to the character after the line.
+ (Jean-Rene David)
+Solution: Ignore the NUL at the end of the line.
+Files: src/normal.c
+
+Patch 6.2.085
+Problem: ":verbose set ts" doesn't say an option was set with a "-c" or
+ "--cmd" argument.
+Solution: Remember the option was set from a Vim argument.
+Files: src/main.c, src/ex_cmds2.c, src/vim.h
+
+Patch 6.2.086
+Problem: "{" and "}" stop inside a closed fold.
+Solution: Only stop once inside a closed fold. (Stephen Riehm)
+Files: src/search.c
+
+Patch 6.2.087
+Problem: CTRL-^ doesn't use the 'confirm' option. Same problem with
+ ":bnext". (Yakov Lerner)
+Solution: Put up a dialog for a changed file when 'confirm' is set in more
+ situations.
+Files: src/buffer.c, src/ex_cmds.c
+
+Patch 6.2.088
+Problem: When 'sidescrolloff' is set 'showmatch' doesn't work correctly if
+ the match is less than 'sidescrolloff' off from the side of the
+ window. (Roland Stahn)
+Solution: Set 'sidescrolloff' to zero while displaying the match.
+Files: src/search.c
+
+Patch 6.2.089
+Problem: ":set isk+=" adds a comma. (Mark Waggoner)
+Solution: Don't add a comma when the added value is empty.
+Files: src/option.c
+
+Patch 6.2.090 (extra)
+Problem: Win32: MingW compiler complains about #pragmas. (Bill McCarthy)
+Solution: Put an #ifdef around the #pragmas.
+Files: src/os_win32.c
+
+Patch 6.2.091
+Problem: When an autocommand is triggered when a file is dropped on Vim and
+ it produces output, messages from a following command may be
+ scrolled unexpectedly. (David Rennalls)
+Solution: Save and restore msg_scroll in handle_drop().
+Files: src/ex_docmd.c
+
+Patch 6.2.092
+Problem: Invalid items appear in the help file tags. (Antonio Colombo)
+Solution: Only accept tags with white space before the first "*".
+Files: runtime/doc/doctags.c, src/ex_cmds.c
+
+Patch 6.2.093
+Problem: ":nnoremenu" also defines menu for Visual mode. (Klaus Bosau)
+Solution: Check the second command character for an "o", not the third.
+Files: src/menu.c
+
+Patch 6.2.094
+Problem: Can't compile with GTK and tiny features.
+Solution: Include handle_drop() and vim_chdirfile() when FEAT_DND is defined.
+ Do not try to split the window.
+Files: src/ex_docmd.c, src/misc2.c
+
+Patch 6.2.095
+Problem: The message "Cannot go to buffer x" is confusing for ":buf 6".
+ (Frans Englich)
+Solution: Make it "Buffer x does not exist".
+Files: src/buffer.c
+
+Patch 6.2.096
+Problem: Win32: ":let @* = ''" put a newline on the clipboard. (Klaus
+ Bosau)
+Solution: Put zero bytes on the clibpoard for an empty string.
+Files: src/ops.c
+
+Patch 6.2.097
+Problem: Setting or resetting 'insertmode' in a BufEnter autocommand
+ doesn't always have immediate effect. (Nagger)
+Solution: When 'insertmode' is set, set need_start_insertmode, when it's
+ reset set stop_insert_mode.
+Files: src/option.c
+
+Patch 6.2.098 (after 6.2.097)
+Problem: Can't build Vim with tiny features. (Christian J. Robinson)
+Solution: Declare stop_insert_mode always.
+Files: src/edit.c, src/globals.h
+
+Patch 6.2.099 (extra)
+Problem: Test 49 fails. (Mikolaj Machowski)
+Solution: The Polish translation must not change "E116" to "R116".
+Files: src/po/pl.po
+
+Patch 6.2.100
+Problem: "make proto" fails when compiled with the Perl interface.
+Solution: Remove "-fno.*" from PERL_CFLAGS, cproto sees it as its option.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2.101
+Problem: When using syntax folding, opening a file slows down a lot when
+ it's size increases by only 20%. (Gary Johnson)
+Solution: The array with cached syntax states is leaking entries. After
+ cleaning up the list obtain the current entry again.
+Files: src/syntax.c
+
+Patch 6.2.102
+Problem: The macros equal() and CR conflict with a Carbon header file.
+Solution: Rename equal() to equalpos(). Rename CR to CAR.
+ Do this in the non-extra files only.
+Files: src/ascii.h, src/buffer.c, src/charset.c, src/edit.c, src/eval.c,
+ src/ex_cmds.c, src/ex_cmds2.c, src/ex_getln.c, src/fileio.c,
+ src/getchar.c, src/gui.c, src/gui_athena.c, src/gui_gtk_x11.c,
+ src/gui_motif.c, src/macros.h, src/mark.c, src/message.c,
+ src/misc1.c, src/misc2.c, src/normal.c, src/ops.c, src/os_unix.c,
+ src/regexp.c, src/search.c, src/ui.c, src/workshop.c
+
+Patch 6.2.103 (extra)
+Problem: The macros equal() and CR conflict with a Carbon header file.
+Solution: Rename equal() to equalpos(). Rename CR to CAR.
+ Do this in the extra files only.
+Files: src/gui_photon.c, src/gui_w48.c
+
+Patch 6.2.104
+Problem: Unmatched braces in the table with options.
+Solution: Move the "}," outside of the #ifdef. (Yakov Lerner)
+Files: src/option.c
+
+Patch 6.2.105
+Problem: When the cursor is past the end of the line when calling
+ get_c_indent() a crash might occur.
+Solution: Don't look past the end of the line. (NJ Verenini)
+Files: src/misc1.c
+
+Patch 6.2.106
+Problem: Tag searching gets stuck on a very long line in the tags file.
+Solution: When skipping back to search the first matching tag remember the
+ offset where searching started looking for a line break.
+Files: src/tag.c
+
+Patch 6.2.107 (extra)
+Problem: The NetBeans interface cannot be used on Win32.
+Solution: Add support for the NetBeans for Win32. Add support for reading
+ XPM files on Win32. Also fixes that a sign icon with a space in
+ the file name did not work through the NetBeans interface.
+ (Sergey Khorev)
+ Also: avoid repeating error messages when the connection is lost.
+Files: Makefile, runtime/doc/netbeans.txt, src/Make_bc5.mak,
+ src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak,
+ src/bigvim.bat, src/feature.h, src/gui_beval.c, src/gui_beval.h,
+ src/gui_w32.c, src/gui_w48.c, src/menu.c, src/nbdebug.c,
+ src/nbdebug.h, src/netbeans.c, src/os_mswin.c, src/os_win32.h,
+ src/proto/gui_beval.pro, src/proto/gui_w32.pro,
+ src/proto/netbeans.pro, src/proto.h, src/version.c, src/vim.h,
+ src/xpm_w32.c, src/xpm_w32.h
+
+Patch 6.2.108
+Problem: Crash when giving a message about ignoring case in a tag. (Manfred
+ Kuehn)
+Solution: Use a longer buffer for the message.
+Files: src/tag.c
+
+Patch 6.2.109
+Problem: Compiler warnings with various Amiga compilers.
+Solution: Add typecast, prototypes, et al. that are also useful for other
+ systems. (Flavio Stanchina)
+Files: src/eval.c, src/ops.c
+
+Patch 6.2.110
+Problem: When $LANG includes the encoding, a menu without an encoding name
+ is not found.
+Solution: Also look for a menu file without any encoding.
+Files: runtime/menu.vim
+
+Patch 6.2.111
+Problem: Encoding "cp1251" is not recognized.
+Solution: Add "cp1251" to the table of encocings. (Alexey Froloff)
+Files: src/mbyte.c
+
+Patch 6.2.112
+Problem: After applying patches test32 fails. (Antonio Colombo)
+Solution: Have "make clean" in the testdir delete *.rej and *.orig files.
+ Use this when doing "make clean" in the src directory.
+Files: src/Makefile, src/testdir/Makefile
+
+Patch 6.2.113
+Problem: Using ":startinsert" after "$" works like "a" instead of "i".
+ (Ajit Thakkar)
+Solution: Reset "w_curswant" for ":startinsert" and reset o_eol in edit().
+Files: src/edit.c, src/ex_docmd.c
+
+Patch 6.2.114
+Problem: When stdout is piped through "tee", the size of the screen may not
+ be correct.
+Solution: Use stdin instead of stdout for ioctl() when stdin is a tty and
+ stdout isn't.
+Files: src/os_unix.c
+
+Patch 6.2.115 (extra)
+Problem: Compiler warnings with various Amiga compilers.
+Solution: Add typecast, prototypes, et al. Those changes that are
+ Amiga-specific. (Flavio Stanchina)
+Files: src/fileio.c, src/memfile.c, src/os_amiga.c, src/os_amiga.h,
+ src/vim.h
+
+Patch 6.2.116 (extra)
+Problem: German keyboard with Numlock set different from system startup
+ causes problems.
+Solution: Ignore keys with code 0xff. (Helmut Stiegler)
+Files: src/gui_w48.c
+
+Patch 6.2.117
+Problem: Breakpoints in loops of sourced files and functions are not
+ detected. (Hari Krishna Dara)
+Solution: Check for breakpoints when using lines that were previously read.
+ (Servatius Brandt)
+Files: src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/proto/eval.pro,
+ src/proto/ex_cmds2.pro
+
+Patch 6.2.118 (extra)
+Problem: Mac: Compiling is done in a non-standard way.
+Solution: Use the Unix method for Mac OS X, with autoconf. Add "CARBONGUI"
+ to Makefile and configure. (Eric Kow)
+ Move a few prototypes from os_mac.pro to gui_mac.pro.
+Files: src/Makefile, src/auto/configure, src/configure.in,
+ src/config.mk.in, src/gui_mac.c, src/os_mac.h, src/os_macosx.c,
+ src/proto/gui_mac.pro, src/proto/os_mac.pro,
+ src/infplist.xml, src/vim.h
+
+Patch 6.2.119 (after 6.2.107)
+Problem: When packing the MS-Windows archives a few files are missing.
+ (Guopeng Wen)
+Solution: Add gui_beval.* to the list of generic source files.
+Files: Makefile
+
+Patch 6.2.120
+Problem: Win32 GUI: The console dialogs are not supported on MS-Windows,
+ disabling the 'c' flag of 'guioptions'. (Servatius Brandt)
+Solution: Define FEAT_CON_DIALOG also for GUI-only builds.
+Files: src/feature.h
+
+Patch 6.2.121 (after 6.2.118)
+Problem: Not all make programs support "+=". (Charles Campbell)
+Solution: Use a normal assignment.
+Files: src/Makefile
+
+Patch 6.2.122 (after 6.2.119)
+Problem: Not all shells can expand [^~]. File missing. (Guopeng Wen)
+Solution: Use a simpler pattern. Add the Aap recipe for the maze program
+ and a clean version of the source code.
+Files: Makefile, runtime/macros/maze/Makefile,
+ runtime/macros/maze/README.txt, runtime/macros/maze/main.aap,
+ runtime/macros/maze/mazeclean.c
+
+Patch 6.2.123 (after 6.2.118)
+Problem: Running configure fails. (Tony Leneis)
+Solution: Change "==" to "=" for a test.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2.124 (after 6.2.121)(extra)
+Problem: Mac: Recursive use of M4FLAGS causes problems. When running Vim
+ directly it can't find the runtime files. (Emily Jackson)
+ Using GNU constructs causes warnings with other make programs.
+ (Ronald Schild)
+Solution: Use another name for the M4FLAGS variable.
+ Don't remove "Vim.app" from the path.
+ Update the explanation for compiling on the Mac. (Eric Kow)
+ Don't use $(shell ) and $(addprefix ).
+Files: src/INSTALLmac.txt, src/Makefile, src/misc1.c
+
+Patch 6.2.125 (after 6.2.107)
+Problem: The "winsock2.h" file isn't always available.
+Solution: Don't include this header file.
+Files: src/netbeans.c
+
+Patch 6.2.126
+Problem: Typing CTRL-C at a confirm() prompt doesn't throw an exception.
+Solution: Reset "mapped_ctrl_c" in get_keystroke(), so that "got_int" is set
+ in _OnChar().
+Files: src/misc1.c
+
+Patch 6.2.127 (extra)
+Problem: Win32 console: Typing CTRL-C doesn't throw an exception.
+Solution: Set got_int immediately when CTRL-C is typed, don't wait for
+ mch_breakcheck() being called.
+Files: src/os_win32.c
+
+Patch 6.2.128 (after 6.2.118)
+Problem: src/auto/configure is not consistent with src/configure.in.
+Solution: Use the newly generated configure script.
+Files: src/auto/configure
+
+Patch 6.2.129
+Problem: When 'number' is set 'wrapmargin' does not work Vi-compatible.
+ (Yasuhiro Matsumoto)
+Solution: Reduce the textwidth when 'number' is set. Also for 'foldcolumn'
+ and similar things.
+Files: src/edit.c
+
+Patch 6.2.130 (extra)
+Problem: Win32 console: When 'restorescreen' is not set exiting Vim causes
+ the screen to be cleared. (Michael A. Mangino)
+Solution: Don't clear the screen when exiting and 'restorescreen' isn't set.
+Files: src/os_win32.c
+
+Patch 6.2.131 (extra)
+Problem: Win32: Font handles are leaked.
+Solution: Free italic, bold and bold-italic handles before overwriting them.
+ (Michael Wookey)
+Files: src/gui_w48.c
+
+Patch 6.2.132 (extra)
+Problem: Win32: console version doesn't work on latest Windows Server 2003.
+Solution: Copy 12000 instead of 15000 cells at a time to avoid running out
+ of memory.
+Files: src/os_win32.c
+
+Patch 6.2.133
+Problem: When starting the GUI a bogus error message about 'imactivatekey'
+ may be given.
+Solution: Only check the value of 'imactivatekey' when the GUI is running.
+Files: src/gui.c, src/option.c
+
+Patch 6.2.134 (extra)
+Problem: Win32: When scrolling parts of the window are redrawn when this
+ isn't necessary.
+Solution: Only invalidate parts of the window when they are obscured by
+ other windows. (Michael Wookey)
+Files: src/gui_w48.c
+
+Patch 6.2.135
+Problem: An item <> in the ":command" argument is interpreted as <args>.
+Solution: Avoid that <> is recognized as <args>.
+Files: src/ex_docmd.c
+
+Patch 6.2.136
+Problem: ":e ++enc=latin1 newfile" doesn't set 'fenc' when the file doesn't
+ exist. (Miroslaw Dobrzanski-Neumann)
+Solution: Set 'fileencoding' to the specified encoding when editing a file
+ that does not exist.
+Files: src/fileio.c
+
+Patch 6.2.137
+Problem: "d:cmd<CR>" cannot be repeated with ".". Breaks repeating "d%"
+ when using the matchit plugin.
+Solution: Store the command to be repeated. This is restricted to
+ single-line commands.
+Files: src/ex_docmd.c, src/globals.h, src/normal.c, src/vim.h
+
+Patch 6.2.138 (extra)
+Problem: Compilation problem on VMS with dynamic buffer on the stack.
+Solution: Read one byte less than the size of the buffer, so that we can
+ check for the string length without an extra buffer.
+Files: src/os_vms.c
+
+Patch 6.2.139
+Problem: Code is repeated in the two Perl files.
+Solution: Move common code from if_perl.xs and if_perlsfio.c to vim.h.
+ Also fix a problem with generating prototypes.
+Files: src/if_perl.xs, src/if_perlsfio.c, src/vim.h
+
+Patch 6.2.140 (after 6.2.121)
+Problem: Mac: Compiling with Python and Perl doesn't work.
+Solution: Adjust the configure check for Python to use "-framework Python"
+ for Python 2.3 on Mac OS/X.
+ Move "-ldl" after "DynaLoader.a" in the link command.
+ Change "perllibs" to "PERL_LIBS".
+Files: src/auto/configure, src/configure.in, src/config.mk.in
+
+Patch 6.2.141 (extra)
+Problem: Mac: The b_FSSpec field is sometimes unused.
+Solution: Change the #ifdef to FEAT_CW_EDITOR and defined it in feature.h
+Files: src/fileio.c, src/gui_mac.c, src/structs.h, src/feature.h
+
+Patch 6.2.142 (after 6.2.124)
+Problem: Mac: building without GUI through configure doesn't work.
+ When the system is slow, unpacking the resource file takes too
+ long.
+Solution: Don't always define FEAT_GUI_MAC when MACOS is defined, define it
+ in the Makefile.
+ Add a configure option to skip Darwin detection.
+ Use a Python script to unpack the resources to avoid a race
+ condition. (Taro Muraoka)
+Files: Makefile, src/Makefile, src/auto/configure, src/configure.in,
+ src/dehqx.py, src/vim.h
+
+Patch 6.2.143
+Problem: Using "K" on Visually selected text doesn't work if it ends in
+ a multi-byte character.
+Solution: Include all the bytes of the last character. (Taro Muraoka)
+Files: src/normal.c
+
+Patch 6.2.144
+Problem: When "g:html_use_css" is set the HTML header generated by the
+ 2html script is wrong.
+Solution: Add the header after adding HREF for links.
+ Also use ":normal!" instead of ":normal" to avoid mappings
+ getting in the way.
+Files: runtime/syntax/2html.vim
+
+Patch 6.2.145 (after 6.2.139)
+Problem: Undefining "bool" doesn't work for older systems. (Wojtek Pilorz)
+Solution: Only undefine "bool" on Mac OS.
+Files: src/vim.h
+
+Patch 6.2.146
+Problem: On some systems the prototype for iconv() is wrong, causing a
+ warning message.
+Solution: Use a cast (void *) to avoid the warning. (Charles Campbell)
+Files: src/fileio.c, src/mbyte.c
+
+Patch 6.2.147
+Problem: ":s/pat/\=col('.')" always replaces with "1".
+Solution: Set the cursor to the start of the match before substituting.
+ (Helmut Stiegler)
+Files: src/ex_cmds.c
+
+Patch 6.2.148
+Problem: Can't break an Insert into several undoable parts.
+Solution: Add the CTRL-G u command.
+Files: runtime/doc/insert.txt, src/edit.c
+
+Patch 6.2.149
+Problem: When the cursor is on a line past 21,474,748 the indicated
+ percentage of the position is invalid. With that many lines
+ "100%" causes a negative cursor line number, resulting in a crash.
+ (Daniel Goujot)
+Solution: Divide by 100 instead of multiplying. Avoid overflow when
+ computing the line number for "100%".
+Files: src/buffer.c, src/ex_cmds2.c, src/normal.c
+
+Patch 6.2.150
+Problem: When doing "vim - < file" lines are broken at NUL chars.
+ (Daniel Goujot)
+Solution: Change NL characters back to NUL when reading from the temp
+ buffer.
+Files: src/fileio.c
+
+Patch 6.2.151
+Problem: When doing "vim --remote +startinsert file" some commands are
+ inserted as text. (Klaus Bosau)
+Solution: Put all the init commands in one Ex line, not using a <CR>, so
+ that Insert mode isn't started too early.
+Files: src/main.c
+
+Patch 6.2.152
+Problem: The cursor() function doesn't reset the column offset for
+ 'virtualedit'.
+Solution: Reset the offset to zero. (Helmut Stiegler)
+Files: src/eval.c
+
+Patch 6.2.153
+Problem: Win32: ":lang german" doesn't use German messages.
+Solution: Add a table to translate the Win32 language names to two-letter
+ language codes.
+Files: src/ex_cmds2.c
+
+Patch 6.2.154
+Problem: Python bails out when giving a warning message. (Eugene
+ Minkovskii)
+Solution: Set sys.argv[] to an empty string.
+Files: src/if_python.c
+
+Patch 6.2.155
+Problem: Win32: Using ":tjump www" in a help file gives two results.
+ (Dave Roberts)
+Solution: Ignore differences between slashes and backslashes when checking
+ for identical tag matches.
+Files: src/tag.c
+
+Patch 6.2.156 (after 6.2.125)
+Problem: Win32: Netbeans fails to build, EINTR is not defined.
+Solution: Redefine EINTR to WSAEINTR. (Mike Williams)
+Files: src/netbeans.c
+
+Patch 6.2.157
+Problem: Using "%p" in 'errorformat' gives a column number that is too
+ high.
+Solution: Set the flag to use the number as a virtual column. (Lefteris
+ Koutsoloukas)
+Files: src/quickfix.c
+
+Patch 6.2.158
+Problem: The sed command on Solaris and HPUX doesn't work for a line that
+ doesn't end in a newline.
+Solution: Add a newline when feeding text to sed. (Mark Waggoner)
+Files: src/configure.in, src/auto/configure
+
+Patch 6.2.159
+Problem: When using expression folding and 'foldopen' is "undo" an undo
+ command doesn't always open the fold.
+Solution: Save and restore the KeyTyped variable when evaluating 'foldexpr'.
+ (Taro Muraoka)
+Files: src/fold.c
+
+Patch 6.2.160
+Problem: When 'virtualedit' is "all" and 'selection is "exclusive",
+ selecting a double-width character below a single-width character
+ may cause a crash.
+Solution: Avoid overflow on unsigned integer decrement. (Taro Muraoka)
+Files: src/normal.c
+
+Patch 6.2.161 (extra)
+Problem: VMS: Missing header file. Reading input busy loops.
+Solution: Include termdef.h. Avoid the use of a wait function in
+ vms_read(). (Frank Ries)
+Files: src/os_unix.h, src/os_vms.c
+
+Patch 6.2.162
+Problem: ":redraw" doesn't always display the text that includes the cursor
+ position, e.g. after ":call cursor(1, 0)". (Eugene Minkovskii)
+Solution: Call update_topline() before redrawing.
+Files: src/ex_docmd.c
+
+Patch 6.2.163
+Problem: "make install" may also copy AAPDIR directories.
+Solution: Delete AAPDIR directories, just like CVS directories.
+Files: src/Makefile
+
+Patch 6.2.164 (after 6.2.144)
+Problem: When "g:html_use_css" is set the HTML header generated by the
+ 2html script is still wrong.
+Solution: Search for a string instead of jumping to a fixed line number.
+ Go to the start of the line before inserting the header.
+ (Jess Thrysoee)
+Files: runtime/syntax/2html.vim
+
+Patch 6.2.165
+Problem: The configure checks hang when using autoconf 2.57.
+Solution: Invoke AC_PROGRAM_EGREP to set $EGREP. (Aron Griffis)
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2.166
+Problem: When $GZIP contains "-N" editing compressed files doesn't work
+ properly.
+Solution: Add "-n" to "gzip -d" to avoid restoring the file name. (Oyvind
+ Holm)
+Files: runtime/plugin/gzip.vim
+
+Patch 6.2.167
+Problem: The Python interface leaks memory when assigning lines to a
+ buffer. (Sergey Khorev)
+Solution: Do not copy the line when calling ml_replace().
+Files: src/if_python.c
+
+Patch 6.2.168
+Problem: Python interface: There is no way to get the indices from a range
+ object.
+Solution: Add the "start" and "end" attributes. (Maurice S. Barnum)
+Files: src/if_python.c, runtime/doc/if_pyth.txt
+
+Patch 6.2.169
+Problem: The prototype for _Xmblen() appears in a recent XFree86 header
+ file, causing a warning for our prototype. (Hisashi T Fujinaka)
+Solution: Move the prototype to an osdef file, so that it's filtered out.
+Files: src/mbyte.c, src/osdef2.h.in
+
+Patch 6.2.170
+Problem: When using Sun WorkShop the current directory isn't changed to
+ where the file is.
+Solution: Set the 'autochdir' option when using WorkShop. And avoid using
+ the basename when 'autochdir' is not set.
+Files: src/gui_x11.c, src/ex_cmds.c
+
+Patch 6.2.171 (after 6.2.163)
+Problem: The "-or" argument of "find" doesn't work for SysV systems.
+Solution: Use "-o" instead. (Gordon Prieur)
+Files: src/Makefile
+
+Patch 6.2.172 (after 6.2.169)
+Problem: The prototype for _Xmblen() still causes trouble.
+Solution: Include the X11 header file that defines the prototype.
+Files: src/osdef2.h.in, src/osdef.sh
+
+Patch 6.2.173 (extra)
+Problem: Win32: Ruby interface doesn't work with Ruby 1.8.0 for other
+ compilers than MSVC.
+Solution: Fix the BC5, Cygwin and Mingw makefiles. (Dan Sharp)
+Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak
+
+Patch 6.2.174
+Problem: After the ":intro" message only a mouse click in the last line
+ gets past the hit-return prompt.
+Solution: Accept a click at or below the hit-return prompt.
+Files: src/gui.c, src/message.c
+
+Patch 6.2.175
+Problem: Changing 'backupext' in a *WritePre autocommand doesn't work.
+ (William Natter)
+Solution: Move the use of p_bex to after executing the *WritePre
+ autocommands. Also avoids reading allocated memory after freeing.
+Files: src/fileio.c
+
+Patch 6.2.176
+Problem: Accented characters in translated help files are not handled
+ correctly. (Fabien Vayssiere)
+Solution: Include "192-255" in 'iskeyword' for the help window.
+Files: src/ex_cmds.c
+
+Patch 6.2.177 (extra)
+Problem: VisVim: Opening a file with a space in the name doesn't work. (Rob
+ Retter) Arbitrary commands are being executed. (Neil Bird)
+Solution: Put a backslash in front of every space in the file name.
+ (Gerard Blais) Terminate the CTRL-\ CTRL-N command with a NUL.
+Files: src/VisVim/Commands.cpp, src/VisVim/VisVim.rc
+
+Patch 6.2.178
+Problem: People who don't know how to exit Vim try pressing CTRL-C.
+Solution: Give a message how to exit Vim when CTRL-C is pressed and it
+ doesn't cancel anything.
+Files: src/normal.c
+
+Patch 6.2.179 (extra)
+Problem: The en_gb messages file isn't found on case sensitive systems.
+Solution: Rename en_gb to en_GB. (Mike Williams)
+Files: src/po/en_gb.po, src/po/en_GB.po, src/po/Make_ming.mak,
+ src/po/Make_mvc.mak, src/po/Makefile, src/po/README_mvc.txt
+
+Patch 6.2.180
+Problem: Compiling with GTK2 on Win32 doesn't work.
+Solution: Include gdkwin32.h instead of gdkx.h. (Srinath Avadhanula)
+Files: src/gui_gtk.c, src/gui_gtk_f.c, src/gui_gtk_x11.c, src/mbyte.c
+
+Patch 6.2.181 (after 6.2.171)
+Problem: The "-o" argument of "find" has lower priority than the implied
+ "and" with "-print".
+Solution: Add parenthesis around the "-o" expression. (Gordon Prieur)
+Files: src/Makefile
+
+Patch 6.2.182 (after 6.2.094)
+Problem: Compilation with tiny features fails because of missing
+ get_past_head() function.
+Solution: Adjust the #ifdef for get_past_head().
+Files: src/misc1.c
+
+Patch 6.2.183 (after 6.2.178)
+Problem: Warning for char/unsigned char mixup.
+Solution: Use MSG() instead of msg(). (Tony Leneis)
+Files: src/normal.c
+
+Patch 6.2.184
+Problem: With 'formatoptions' set to "1aw" inserting text may cause the
+ paragraph to be ended. (Alan Schmitt)
+Solution: Temporarily add an extra space to make the paragraph continue
+ after moving the word after the cursor to the next line.
+ Also format when pressing Esc.
+Files: src/edit.c, src/normal.c, src/proto/edit.pro
+
+Patch 6.2.185
+Problem: Restoring a session with zero-height windows does not work
+ properly. (Charles Campbell)
+Solution: Accept a zero argument to ":resize" as intended. Add a window
+ number argument to ":resize" to be able to set the size of other
+ windows, because the current window cannot be zero-height.
+ Fix the explorer plugin to avoid changing the window sizes. Add
+ the winrestcmd() function for this.
+Files: runtime/doc/eval.txt, runtime/plugin/explorer.vim, src/eval.c,
+ src/ex_cmds.h, src/ex_docmd.c, src/proto/window.pro, src/window.c
+
+Patch 6.2.186 (after 6.2.185)
+Problem: Documentation file eval.txt contains examples without indent.
+Solution: Insert the indent. Also fix other mistakes.
+Files: runtime/doc/eval.txt
+
+Patch 6.2.187
+Problem: Using Insure++ reveals a number of bugs. (Dominuque Pelle)
+Solution: Initialize variables where needed. Free allocated memory to avoid
+ leaks. Fix comparing tags to avoid reading past allocated memory.
+Files: src/buffer.c, src/diff.c, src/fileio.c, src/mark.c, src/misc1.c,
+ src/misc2.c, src/ops.c, src/option.c, src/tag.c, src/ui.c
+
+Patch 6.2.188 (extra)
+Problem: MS-Windows: Multi-byte characters in a filename cause trouble for
+ the window title.
+Solution: Return when the wide function for setting the title did its work.
+Files: src/gui_w48.c
+
+Patch 6.2.189
+Problem: When setting 'viminfo' after editing a new buffer its marks are
+ not stored. (Keith Roberts)
+Solution: Set the "b_marks_read" flag when skipping to read marks from the
+ viminfo file.
+Files: src/fileio.c
+
+Patch 6.2.190
+Problem: When editing a compressed files, marks are lost.
+Solution: Add the ":lockmarks" modifier and use it in the gzip plugin.
+ Make exists() also check for command modifiers, so that the
+ existence of ":lockmarks" can be checked for.
+ Also add ":keepmarks" to avoid that marks are deleted when
+ filtering text.
+ When deleting lines put marks 'A - 'Z and '0 - '9 at the first
+ deleted line instead of clearing the mark. They were kept in the
+ viminfo file anyway.
+ Avoid that the gzip plugin puts deleted text in registers.
+Files: runtime/doc/motion.txt, runtime/plugin/gzip.vim, src/ex_cmds.c,
+ src/ex_docmd.c, src/mark.c, src/structs.h
+
+Patch 6.2.191
+Problem: The intro message is outdated. Information about sponsoring and
+ registering is missing.
+Solution: Show info about sponsoring and registering Vim in the intro
+ message now and then. Add help file about sponsoring.
+Files: runtime/doc/help.txt, runtime/doc/sponsor.txt, runtime/doc/tags,
+ runtime/menu.vim, src/version.c
+
+Patch 6.2.192
+Problem: Using CTRL-T and CTRL-D with "gR" messes up the text. (Jonahtan
+ Hankins)
+Solution: Avoid calling change_indent() recursively.
+Files: src/edit.c
+
+Patch 6.2.193
+Problem: When recalling a search pattern from the history from a ":s,a/c,"
+ command the '/' ends the search string. (JC van Winkel)
+Solution: Store the separator character with the history entries. Escape
+ characters when needed, replace the old separator with the new one.
+ Also fixes that recalling a "/" search for a "?" command messes up
+ trailing flags.
+Files: src/eval.c, src/ex_getln.c, src/normal.c, src/proto/ex_getln.pro,
+ src/search.c, src/tag.c
+
+Patch 6.2.194 (after 6.2.068)
+Problem: For NetBeans, instead of writing the file and sending an event
+ about it, tell NetBeans to write the file.
+Solution: Add the "save" command, "netbeansBuffer" command and
+ "buttonRelease" event to the netbeans protocol. Updated the
+ interface to version 2.2. (Gordon Prieur)
+ Also: open a fold when the cursor has been positioned.
+ Also: fix memory leak, free result of nb_quote().
+Files: runtime/doc/netbeans.txt, src/fileio.c, src/netbeans.c,
+ src/normal.c, src/proto/netbeans.pro, src/structs.h
+
+Patch 6.2.195 (after 6.2.190)
+Problem: Compiling fails for missing CPO_REMMARK symbol.
+Solution: Add the patch I forgot to include...
+Files: src/option.h
+
+Patch 6.2.196 (after 6.2.191)
+Problem: Rebuilding the documentation doesn't use the sponsor.txt file.
+Solution: Add sponsor.txt to the Makefile. (Christian J. Robinson)
+Files: runtime/doc/Makefile
+
+Patch 6.2.197
+Problem: It is not possible to force a redraw of status lines. (Gary
+ Johnson)
+Solution: Add the ":redrawstatus" command.
+Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c,
+ src/screen.c
+
+Patch 6.2.198
+Problem: A few messages are not translated. (Ernest Adrogue)
+Solution: Mark the messages to be translated.
+Files: src/ex_cmds.c
+
+Patch 6.2.199 (after 6.2.194)
+Problem: Vim doesn't work perfectly well with NetBeans.
+Solution: When NetBeans saves the file, reset the timestamp to avoid "file
+ changed" warnings. Close a buffer in a proper way. Don't try
+ giving a debug message with an invalid pointer. Send a
+ newDotAndMark message when needed. Report a change by the "r"
+ command to NetBeans. (Gordon Prieur)
+Files: src/netbeans.c, src/normal.c
+
+Patch 6.2.200
+Problem: When recovering a file, 'fileformat' is always the default, thus
+ writing the file may result in differences. (Penelope Fudd)
+Solution: Before recovering the file try reading the original file to obtain
+ the values of 'fileformat', 'fileencoding', etc.
+Files: src/memline.c
+
+Patch 6.2.201
+Problem: When 'autowriteall' is set ":qall" still refuses to exit if there
+ is a modified buffer. (Antoine Mechelynck)
+Solution: Attempt writing modified buffers as intended.
+Files: src/ex_cmds2.c
+
+Patch 6.2.202
+Problem: Filetype names of CHILL and ch script are confusing.
+Solution: Rename "ch" to "chill" and "chscript" to "ch".
+Files: runtime/filetype.vim, runtime/makemenu.vim, runtime/synmenu.vim
+ runtime/syntax/ch.vim, runtime/syntax/chill.vim
+
+Patch 6.2.203
+Problem: With characterwise text that has more than one line, "3P" works
+ wrong. "3p" has the same problem. There also is a display
+ problem. (Daniel Goujot)
+Solution: Perform characterwise puts with a count in the right position.
+Files: src/ops.c
+
+Patch 6.2.204 (after 6.2.086)
+Problem: "]]" in a file with closed folds moves to the end of the file.
+ (Nam SungHyun)
+Solution: Find one position in each closed fold, then move to after the fold.
+Files: src/search.c
+
+Patch 6.2.205 (extra)
+Problem: MS-Windows: When the taskbar is at the left or top of the screen,
+ the Vim window placement is wrong.
+Solution: Compute the size and position of the window correctly. (Taro
+ Muraoka)
+Files: src/gui_w32.c, src/gui_w48.c
+
+Patch 6.2.206
+Problem: Multi-byte characters cannot be used as hotkeys in a console
+ dialog. (Mattias Erkisson)
+Solution: Handle multi-byte characters properly. Also put () or [] around
+ default hotkeys.
+Files: src/message.c, src/macros.h
+
+Patch 6.2.207
+Problem: When 'encoding' is a multi-byte encoding, expanding an
+ abbreviation that starts where insertion started results in
+ characters before the insertion to be deleted. (Xiangjiang Ma)
+Solution: Stop searching leftwards for the start of the word at the position
+ where insertion started.
+Files: src/getchar.c
+
+Patch 6.2.208
+Problem: When using fold markers, three lines in a row have the start
+ marker and deleting the first one with "dd", a nested fold is not
+ deleted. (Kamil Burzynski)
+ Using marker folding, a level 1 fold doesn't stop when it is
+ followed by "{{{2", starting a level 2 fold.
+Solution: Don't stop updating folds at the end of a change when the nesting
+ level of folds is larger than the fold level.
+ Correctly compute the number of folds that start at "{{{2".
+ Also avoid a crash for a NULL pointer.
+Files: src/fold.c
+
+Patch 6.2.209
+Problem: A bogus fold is created when using "P" while the cursor is in the
+ middle of a closed fold. (Kamil Burzynski)
+Solution: Correct the line number where marks are modified for closed folds.
+Files: src/ops.c
+
+Patch 6.2.210 (extra)
+Problem: Mac OSX: antialiased fonts are not supported.
+Solution: Add the 'antialias' option to switch on antialiasing on Mac OSX
+ 10.2 and later. (Peter Cucka)
+Files: runtime/doc/options.txt, src/gui_mac.c, src/option.h, src/option.c
+
+Patch 6.2.211 (extra)
+Problem: Code for handling file dropped on Vim is duplicated.
+Solution: Move the common code to gui_handle_drop().
+ Add code to drop the files in the window under the cursor.
+ Support drag&drop on the Macintosh. (Taro Muraoka)
+ When dropping a directory name edit that directory (using the
+ explorer plugin)
+ Fix that changing directory with Shift pressed didn't work for
+ relative path names.
+Files: src/fileio.c, src/gui.c, src/gui_gtk_x11.c, src/gui_mac.c,
+ src/gui_w48.c, src/proto/fileio.pro, src/proto/gui.pro
+
+Patch 6.2.212 (after 6.2.199)
+Problem: NetBeans: Replacing with a count is not handled correctly.
+Solution: Move reporting the change outside of the loop for the count.
+ (Gordon Prieur)
+Files: src/normal.c
+
+Patch 6.2.213 (after 6.2.208)
+Problem: Using marker folding, "{{{1" doesn't start a new fold when already
+ at fold level 1. (Servatius Brandt)
+Solution: Correctly compute the number of folds that start at "{{{1".
+Files: src/fold.c
+
+Patch 6.2.214 (after 6.2.211) (extra)
+Problem: Warning for an unused variable.
+Solution: Delete the declaration. (Bill McCarthy)
+Files: src/gui_w48.c
+
+Patch 6.2.215
+Problem: NetBeans: problems saving an unmodified file.
+Solution: Add isNetbeansModified() function. Disable netbeans_unmodified().
+ (Gordon Prieur)
+Files: src/fileio.c, src/netbeans.c, src/proto/netbeans.pro,
+ runtime/doc/netbeans.txt, runtime/doc/tags
+
+Patch 6.2.216 (after 6.2.206)
+Problem: Multi-byte characters stil cannot be used as hotkeys in a console
+ dialog. (Mattias Erkisson)
+Solution: Make get_keystroke() handle multi-byte characters.
+Files: src/misc1.c
+
+Patch 6.2.217
+Problem: GTK: setting the title doesn't always work correctly.
+Solution: Invoke gui_mch_settitle(). (Tomas Stehlik)
+Files: src/os_unix.c
+
+Patch 6.2.218
+Problem: Warning for function without prototype.
+Solution: Add argument types to the msgCB field of the BalloonEval struct.
+Files: src/gui_beval.h
+
+Patch 6.2.219
+Problem: Syntax highlighting hangs on an empty match of an item with a
+ nextgroup. (Charles Campbell)
+Solution: Remember that the item has already matched and don't match it
+ again at the same position.
+Files: src/syntax.c
+
+Patch 6.2.220
+Problem: When a Vim server runs in a console a remote command isn't handled
+ before a key is typed. (Joshua Neuheisel)
+Solution: Don't try reading more input when a client-server command has been
+ received.
+Files: src/os_unix.c
+
+Patch 6.2.221
+Problem: No file name completion for ":cscope add".
+Solution: Add the XFILE flag to ":cscope". (Gary Johnson)
+Files: src/ex_cmds.h
+
+Patch 6.2.222
+Problem: Using "--remote" several times on a row only opens some of the
+ files. (Dany St-Amant)
+Solution: Don't delete all typehead when the server receives a command from
+ a client, only delete typed characters.
+Files: src/main.c
+
+Patch 6.2.223
+Problem: Cscope: Avoid a hang when cscope waits for a response while Vim
+ waits for a prompt.
+ Error messages from Cscope mess up the display.
+Solution: Detect the hit-enter message and respond by sending a return
+ character to cscope. (Gary Johnson)
+ Use EMSG() and strerror() when possible. Replace perror() with
+ PERROR() everywhere, add emsg3().
+Files: src/diff.c, src/if_cscope.c, src/integration.c, src/message.c,
+ src/proto/message.pro, src/misc2.c, src/netbeans.c, src/vim.h
+
+Patch 6.2.224
+Problem: Mac: Can't compile with small features. (Axel Kielhorn)
+Solution: Also include vim_chdirfile() when compiling for the Mac.
+Files: src/misc2.c
+
+Patch 6.2.225
+Problem: NetBeans: Reported modified state isn't exactly right.
+Solution: Report a file being modified in the NetBeans way.
+Files: src/netbeans.c
+
+Patch 6.2.226 (after 6.2.107) (extra)
+Problem: The "ws2-32.lib" file isn't always available.
+Solution: Use "WSock32.lib" instead. (Taro Muraoka, Dan Sharp)
+Files: src/Make_cyg.mak, src/Make_ming.mak, src/Make_mvc.mak
+
+Patch 6.2.227 (extra)
+Problem: The "PC" symbol is defined but not used anywhere.
+Solution: Remove "-DPC" from the makefiles.
+Files: src/Make_bc3.mak, src/Make_bc5.mak, src/Make_cyg.mak,
+ src/Make_ming.mak
+
+Patch 6.2.228
+Problem: Receiving CTRL-\ CTRL-N after typing "f" or "m" doesn't switch Vim
+ back to Normal mode. Same for CTRL-\ CTRL-G.
+Solution: Check if the character typed after a command is CTRL-\ and obtain
+ another character to check for CTRL-N or CTRL-G, waiting up to
+ 'ttimeoutlen' msec.
+Files: src/normal.c
+
+Patch 6.2.229
+Problem: ":function" with a name that uses magic curlies does not work
+ inside a function. (Servatius Brandt)
+Solution: Skip over the function name properly.
+Files: src/eval.c
+
+Patch 6.2.230 (extra)
+Problem: Win32: a complex pattern may cause a crash.
+Solution: Use __try and __except to catch the exception and handle it
+ gracefully, when possible. Add myresetstkoflw() to reset the
+ stack overflow. (Benjamin Peterson)
+Files: src/Make_bc5.mak, src/os_mswin.c src/os_win32.c, src/os_win32.h,
+ src/proto/os_win32.pro, src/regexp.c
+
+Patch 6.2.231 (after 6.2.046)
+Problem: Various problems when an error exception is raised from within a
+ builtin function. When it is invoked while evaluating arguments
+ to a function following arguments are still evaluated. When
+ invoked with a line range it will be called for remaining lines.
+Solution: Update "force_abort" also after calling a builtin function, so
+ that aborting() always returns the correct value. (Servatius
+ Brandt)
+Files: src/eval.c, src/ex_eval.c, src/proto/ex_eval.pro,
+ src/testdir/test49.ok, src/testdir/test49.vim
+
+Patch 6.2.232
+Problem: ":python vim.command('python print 2*2')" crashes Vim. (Eugene
+ Minkovskii)
+Solution: Disallow executing a Python command recursively and give an error
+ message.
+Files: src/if_python.c
+
+Patch 6.2.233
+Problem: On Mac OSX adding -pthread for Python only generates a warning.
+ The test for Perl threads rejects Perl while it's OK.
+ Tcl doesn't work at all.
+ The test for Ruby fails if ruby exists but there are no header
+ files. The Ruby library isn't detected properly
+Solution: Avoid adding -pthread on Mac OSX. Accept Perl threads when it's
+ not the 5.5 threads.
+ Use the Tcl framework for header files. For Ruby rename cWindow
+ to cVimWindow to avoid a name clash. (Ken Scott)
+ Only enable Ruby when the header files can be found. Use "-lruby"
+ instead of "libruby.a" when it can't be found.
+Files: src/auto/configure, src/configure.in, src/if_ruby.c
+
+Patch 6.2.234
+Problem: GTK 2 GUI: ":sp" and the ":q" leaves the cursor on the command
+ line.
+Solution: Flush output before removing scrollbars. Also do this in other
+ places where gui_mch_*() functions are invoked.
+Files: src/ex_cmds.c, src/option.c, src/window.c
+
+Patch 6.2.235 (extra)
+Problem: Win32: Cursor isn't removed with a 25x80 window and doing:
+ "1830ia<Esc>400a-<Esc>0w0". (Yasuhiro Matsumoto)
+Solution: Remove the call to gui_undraw_cursor() from gui_mch_insert_lines().
+Files: src/gui_w48.c
+
+Patch 6.2.236
+Problem: Using gvim with Agide gives "connection lost" error messages.
+Solution: Only give the "connection lost" message when the buffer was once
+ owned by NetBeans.
+Files: src/netbeans.c, src/structs.h
+
+Patch 6.2.237
+Problem: GTK 2: Thai text is drawn wrong. It changes when moving the
+ cursor over it.
+Solution: Disable the shaping engine, it moves combining characters to a
+ wrong position and combines characters, while drawing the cursor
+ doesn't combine characters.
+Files: src/gui_gtk_x11.c
+
+Patch 6.2.238 (after 6.2.231)
+Problem: ":function" does not work inside a while loop. (Servatius Brandt)
+Solution: Add get_while_line() and pass it to do_one_cmd() when in a while
+ loop, so that all lines are stored and can be used again when
+ repeating the loop.
+ Adjust test 49 so that it checks for the fixed problems.
+ (Servatius Brandt)
+Files: src/digraph.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c,
+ src/proto/ex_cmds2.pro, src/proto/ex_docmd.pro,
+ src/testdir/test49.in, src/testdir/test49.ok,
+ src/testdir/test49.vim
+
+Patch 6.2.239
+Problem: GTK 2: With closed folds the arrow buttons of a vertical scrollbar
+ often doesn't scroll. (Moshe Kaminsky)
+Solution: Hackish solution: Detect that the button was pressed from the
+ mouse pointer position.
+Files: src/gui_gtk.c, src/gui.c
+
+Patch 6.2.240
+Problem: GTK 2: Searching for bitmaps for the toolbar doesn't work as with
+ other systems. Need to explicitly use "icon=name". (Ned Konz,
+ Christian J. Robinson)
+Solution: Search for icons like done for Motif.
+Files: src/gui_gtk.c
+
+Patch 6.2.241
+Problem: GTK 2: Search and Search/Replace dialogs are synced, that makes no
+ sense. Buttons are sometimes greyed-out. (Jeremy Messenger)
+Solution: Remove the code to sync the two dialogs. Adjust the code to react
+ to an empty search string to also work for GTK2. (David Necas)
+Files: src/gui_gtk.c
+
+Patch 6.2.242
+Problem: Gnome: "vim --help" only shows the Gnome arguments, not the Vim
+ arguments.
+Solution: Don't let the Gnome code remove the "--help" argument and don't
+ exit at the end of usage().
+Files: src/gui_gtk_x11.c, src/main.c
+
+Patch 6.2.243 (extra)
+Problem: Mac: Dropping a file on a Vim icon causes a hit-enter prompt.
+Solution: Move the dropped files to the global argument list, instead of the
+ usual drop handling. (Eckehard Berns)
+Files: src/main.c, src/gui_mac.c
+
+Patch 6.2.244
+Problem: ':echo "\xf7"' displays the illegal byte as if it was a character
+ and leaves "cho" after it.
+Solution: When checking the length of a UTF-8 byte sequence and it's shorter
+ than the number of bytes available, assume it's an illegal byte.
+Files: src/mbyte.c
+
+Patch 6.2.245
+Problem: Completion doesn't work for ":keepmarks" and ":lockmarks".
+Solution: Add the command modifiers to the table of commands. (Madoka
+ Machitani)
+Files: src/ex_cmds.h, src/ex_docmd.c
+
+Patch 6.2.246
+Problem: Mac: Starting Vim from Finder doesn't show error messages.
+Solution: Recognize that output is being displayed by stderr being
+ "/dev/console". (Eckehard Berns)
+Files: src/main.c, src/message.c
+
+Patch 6.2.247 (after 6.2.193)
+Problem: When using a search pattern from the viminfo file the last
+ character is replaced with a '/'.
+Solution: Store the separator character in the right place. (Kelvin Lee)
+Files: src/ex_getln.c
+
+Patch 6.2.248
+Problem: GTK: When XIM is enabled normal "2" and keypad "2" cannot be
+ distinguished.
+Solution: Detect that XIM changes the keypad key to the expected ASCII
+ character and fall back to the non-XIM code. (Neil Bird)
+Files: src/gui_gtk_x11.c, src/mbyte.c, src/proto/mbyte.pro
+
+Patch 6.2.249
+Problem: ":cnext" moves to the error in the next file, but there is no
+ method to go back.
+Solution: Add ":cpfile" and ":cNfile".
+Files: src/ex_cmds.h, src/quickfix.c, src/vim.h, runtime/doc/quickfix.txt
+
+Patch 6.2.250
+Problem: Memory leaks when using signs. (Xavier de Gaye)
+Solution: Delete the list of signs when unloading a buffer.
+Files: src/buffer.c
+
+Patch 6.2.251
+Problem: GTK: The 'v' flag in 'guioptions' doesn't work. (Steve Hall)
+ Order of buttons is reversed for GTK 2.2.4. Don't always get
+ focus back after handling a dialog.
+Solution: Make buttons appear vertically when desired. Reverse the order in
+ which buttons are added to a dialog. Move mouse pointer around
+ when the dialog is done and we don't have focus.
+Files: src/gui_gtk.c
+
+Patch 6.2.252 (extra, after 6.2.243)
+Problem: Mac: Dropping a file on a Vim icon causes a hit-enter prompt for
+ Mac OS classic.
+Solution: Remove the #ifdef from the code that fixes it for Mac OSX.
+Files: src/gui_mac.c
+
+Patch 6.2.253
+Problem: When 'tagstack' is not set a ":tag id" command does not work after
+ a ":tjump" command.
+Solution: Set "new_tag" when 'tagstack' isn't set. (G. Narendran)
+Files: src/tag.c
+
+Patch 6.2.254
+Problem: May run out of space for error messages.
+Solution: Keep room for two more bytes.
+Files: src/quickfix.c
+
+Patch 6.2.255
+Problem: GTK: A new item in the popup menu is put just after instead of
+ just before the right item. (Gabriel Zachmann)
+Solution: Don't increment the menu item index.
+Files: src/gui_gtk.c
+
+Patch 6.2.256
+Problem: Mac: "macroman" encoding isn't recognized, need to use
+ "8bit-macroman.
+Solution: Recognize "macroman" with an alias "mac". (Eckehard Berns)
+Files: src/mbyte.c
+
+Patch 6.2.257 (after 6.2.250)
+Problem: Signs are deleted for ":bdel", but they could still be useful.
+Solution: Delete signs only for ":bwipe".
+Files: src/buffer.c
+
+Patch 6.2.258
+Problem: GUI: can't disable (grey-out) a popup menu item. (Ajit Thakkar)
+Solution: Loop over the popup menus for all modes.
+Files: src/menu.c
+
+Patch 6.2.259
+Problem: If there are messages when exiting, on the console there is a
+ hit-enter prompt while the message can be read; in the GUI the
+ message may not be visible.
+Solution: Use the hit-enter prompt when there is an error message from
+ writing the viminfo file or autocommands, or when there is any
+ output in the GUI and 'verbose' is set. Don't use a hit-enter
+ prompt for the non-GUI version unless there is an error message.
+Files: src/main.c
+
+Patch 6.2.260
+Problem: GTK 2: Can't quit a dialog with <Esc>.
+ GTK 1 and 2: <Enter> always gives a result, even when the default
+ button has been disabled.
+Solution: Handle these keys explicitly. When no default button is specified
+ use the first one (works mostly like it was before).
+Files: src/gui_gtk.c
+
+Patch 6.2.261
+Problem: When 'autoindent' and 'cindent' are set and a line is recognized
+ as a comment, starting a new line won't do 'cindent' formatting.
+Solution: Also use 'cindent' formatting for lines that are used as a
+ comment. (Servatius Brandt)
+Files: src/misc1.c
+
+Patch 6.2.262
+Problem: 1 CTRL-W w beeps, even though going to the first window is
+ possible. (Charles Campbell)
+Solution: Don't beep.
+Files: src/window.c
+
+Patch 6.2.263
+Problem: Lint warnings: Duplicate function prototypes, duplicate macros,
+ use of a zero character instead of a zero pointer, unused
+ variable. Clearing allocated memory in a complicated way.
+Solution: Remove the function prototypes from farsi.h. Remove the
+ duplicated lines in keymap.h. Change getvcol() argument from NUL
+ to NULL. Remove the "col" variable in regmatch(). Use
+ lalloc_clear() instead of lalloc(). (Walter Briscoe)
+Files: src/farsi.h, src/keymap.h, src/ops.c, src/regexp.c, src/search.c
+
+Patch 6.2.264 (after 6.2.247)
+Problem: Writing past allocated memory when using a command line from the
+ viminfo file.
+Solution: Store the NUL in the right place.
+Files: src/ex_getln.c
+
+Patch 6.2.265
+Problem: Although ":set" is not allowed in the sandbox, ":let &opt = val"
+ works.
+Solution: Do allow changing options in the sandbox, but not the ones that
+ can't be changed from a modeline.
+Files: src/ex_cmds.h, src/options.c
+
+Patch 6.2.266
+Problem: When redirecting output and using ":silent", line breaks are
+ missing from output of ":map" and ":tselect". Alignment of
+ columns is wrong.
+Solution: Insert a line break where "msg_didout" was tested. Update msg_col
+ when redirecting and using ":silent".
+Files: src/getchar.c, src/message.c
+
+Patch 6.2.267 (extra)
+Problem: Win32: "&&" in a tearoff menu is not shown. (Luc Hermitte)
+Solution: Use the "name" item from the menu instead of the "dname" item.
+Files: src/gui_w32.c, src/menu.c
+
+Patch 6.2.268
+Problem: GUI: When changing 'guioptions' part of the window may be off
+ screen. (Randall Morris)
+Solution: Adjust the size of the window when changing 'guioptions', but only
+ when adding something.
+Files: src/gui.c
+
+Patch 6.2.269
+Problem: Diff mode does not highlight a change in a combining character.
+ (Raphael Finkel)
+Solution: Make diff_find_change() multi-byte aware: find the start byte of
+ a character that contains a change.
+Files: src/diff.c
+
+Patch 6.2.270
+Problem: Completion in Insert mode, then repeating with ".", doesn't handle
+ composing characters in the completed text. (Raphael Finkel)
+Solution: Don't skip over composing chars when adding completed text to the
+ redo buffer.
+Files: src/getchar.c
+
+Patch 6.2.271
+Problem: NetBeans: Can't do "tail -f" on the log. Passing socket info with
+ an argument or environment variable is not secure.
+Solution: Wait after initializing the log. Allow passing the socket info
+ through a file. (Gordon Prieur)
+Files: runtime/doc/netbeans.txt, src/main.c, src/netbeans.c
+
+Patch 6.2.272
+Problem: When the "po" directory exists, but "po/Makefile" doesn't,
+ building fails. Make loops when the "po" directory has been
+ deleted after running configure.
+Solution: Check for the "po/Makefile" instead of just the "po" directory.
+ Check this again before trying to run make with that Makefile.
+Files: src/auto/configure, src/configure.in, src/Makefile
+
+Patch 6.2.273
+Problem: Changing the sort order in an explorer window for an empty
+ directory produces error messages. (Doug Kearns)
+Solution: When an invalid range is used for a function that is not going to
+ be executed, skip over the arguments anyway.
+Files: src/eval.c
+
+Patch 6.2.274
+Problem: ":print" skips empty lines when 'list' is set and there is no
+ "eol" in 'listchars'. (Yakov Lerner)
+Solution: Skip outputting a space for an empty line only when 'list' is set
+ and the end-of-line character is not empty.
+Files: src/message.c
+
+Patch 6.2.275 (extra, after 6.2.267)
+Problem: Warning for uninitialized variable when using gcc.
+Solution: Initialize "acLen" to zero. (Bill McCarthy)
+Files: src/gui_w32.c
+
+Patch 6.2.276
+Problem: ":echo X()" does not put a line break between the message that X()
+ displays and the text that X() returns. (Yakov Lerner)
+Solution: Invoke msg_start() after evaluating the argument.
+Files: src/eval.c
+
+Patch 6.2.277
+Problem: Vim crashes when a ":runtime ftplugin/ada.vim" causes a recursive
+ loop. (Robert Nowotniak)
+Solution: Restore "msg_list" before returning from do_cmdline().
+Files: src/ex_docmd.c
+
+Patch 6.2.278
+Problem: Using "much" instead of "many".
+Solution: Correct the error message.
+Files: src/eval.c
+
+Patch 6.2.279
+Problem: There is no default choice for a confirm() dialog, now that it is
+ possible not to have a default choice.
+Solution: Make the first choice the default choice.
+Files: runtime/doc/eval.txt, src/eval.c
+
+Patch 6.2.280
+Problem: "do" and ":diffget" don't work in the first line and the last line
+ of a buffer. (Aron Griffis)
+Solution: Find a difference above the first line and below the last line.
+ Also fix a few display updating bugs.
+Files: src/diff.c, src/fold.c, src/move.c
+
+Patch 6.2.281
+Problem: PostScript printing doesn't work on Mac OS X 10.3.2.
+Solution: Adjust the header file. (Mike Williams)
+Files: runtime/print/prolog.ps
+
+Patch 6.2.282
+Problem: When using CTRL-O to go back to a help file, it becomes listed.
+ (Andrew Nesbit)
+ Using ":tag" or ":tjump" in a help file doesn't keep the help file
+ settings (e.g. for 'iskeyword').
+Solution: Don't mark a buffer as listed when its help flag is set. Put all
+ the option settings for a help buffer together in do_ecmd().
+Files: src/ex_cmds.c
+
+Patch 6.2.283
+Problem: The "local additions" in help.txt are used without conversion,
+ causing latin1 characters showing up wrong when 'enc' is utf-8.
+ (Antoine J. Mechelynck)
+Solution: Convert the text to 'encoding'.
+Files: src/ex_cmds.c
+
+Patch 6.2.284
+Problem: Listing a function puts "endfunction" in the message history.
+ Typing "q" at the more prompt isn't handled correctly when listing
+ variables and functions. (Hara Krishna Dara)
+Solution: Don't use msg() for "endfunction". Check "got_int" regularly.
+Files: src/eval.c
+
+Patch 6.2.285
+Problem: GUI: In a single wrapped line that fills the window, "gj" in the
+ last screen line leaves the cursor behind. (Ivan Tarasov)
+Solution: Undraw the cursor before scrolling the text up.
+Files: src/gui.c
+
+Patch 6.2.286
+Problem: When trying to rename a file and it doesn't exist, the destination
+ file is deleted anyway. (Luc Deux)
+Solution: Don't delete the destination when the source doesn't exist. (Taro
+ Muraoka)
+Files: src/fileio.c
+
+Patch 6.2.287 (after 6.2.264)
+Problem: Duplicate lines are added to the viminfo file.
+Solution: Compare with existing entries without an offset. Also fixes
+ reading very long history lines from viminfo.
+Files: src/ex_getln.c
+
+Patch 6.2.288 (extra)
+Problem: Mac: An external program can't be interrupted.
+Solution: Don't use the 'c' key for backspace. (Eckehard Berns)
+Files: src/gui_mac.c
+
+Patch 6.2.289
+Problem: Compiling the Tcl interface with thread support causes ":make" to
+ fail. (Juergen Salk)
+Solution: Use $TCL_DEFS from the Tcl config script to obtain the required
+ compile flags for using the thread library.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2.290 (extra)
+Problem: Mac: The mousewheel doesn't work.
+Solution: Add mousewheel support. Also fix updating the thumb after a drag
+ and then using another way to scroll. (Eckehard Berns)
+Files: src/gui_mac.c
+
+Patch 6.2.291 (extra)
+Problem: Mac: the plus button and close button don't do anything.
+Solution: Make the plus button maximize the window and the close button
+ close Vim. (Eckehard Berns)
+Files: src/gui.c, src/gui_mac.c
+
+Patch 6.2.292
+Problem: Motif: When removing GUI arguments from argv[] a "ps -ef" shows
+ the last argument repeated.
+Solution: Set argv[argc] to NULL. (Michael Jarvis)
+Files: src/gui_x11.c
+
+Patch 6.2.293 (after 6.2.255)
+Problem: GTK: A new item in a menu is put before the tearoff item.
+Solution: Do increment the menu item index for non-popup menu items.
+Files: src/gui_gtk.c
+
+Patch 6.2.294 (extra)
+Problem: Mac: Cannot use modifiers with Space, Tab, Enter and Escape.
+Solution: Handle all modifiers for these keys. (Eckehard Berns)
+Files: src/gui_mac.c
+
+Patch 6.2.295
+Problem: When in debug mode, receiving a message from a remote client
+ causes a crash. Evaluating an expression causes Vim to wait for
+ "cont" to be typed, without a prompt. (Hari Krishna Dara)
+Solution: Disable debugging when evaluating an expression for a client.
+ (Michael Geddes) Don't try reading into the typehead buffer when
+ it may have been filled in another way.
+Files: src/ex_getln.c, src/getchar.c, src/if_xcmdsrv.c, src/main.c,
+ src/misc1.c, src/proto/getchar.pro, src/proto/main.pro,
+ src/proto/os_unix.pro, src/proto/ui.pro, src/structs.h,
+ src/os_unix.c, src/ui.c
+
+Patch 6.2.296 (extra)
+Problem: Same as 6.2.295.
+Solution: Extra files for patch 6.2.295.
+Files: src/os_amiga.c, src/os_msdos.c, src/os_riscos.c, src/os_win32.c,
+ src/proto/os_amiga.pro, src/proto/os_msdos.pro,
+ src/proto/os_riscos.pro, src/proto/os_win32.pro
+
+Patch 6.2.297 (after 6.2.232)
+Problem: Cannot invoke Python commands recursively.
+Solution: With Python 2.3 and later use the available mechanisms to invoke
+ Python recursively. (Matthew Mueller)
+Files: src/if_python.c
+
+Patch 6.2.298
+Problem: A change always sets the '. mark and an insert always sets the '^
+ mark, even when this is not wanted.
+ Cannot go back to the position of older changes without undoing
+ those changes.
+Solution: Add the ":keepjumps" command modifier.
+ Add the "g," and "g;" commands.
+Files: runtime/doc/motion.txt, src/ex_cmds.h, src/ex_docmd.c, src/edit.c,
+ src/mark.c, src/misc1.c, src/normal.c, src/proto/mark.pro,
+ src/structs.h, src/undo.c
+
+Patch 6.2.299
+Problem: Can only use one language for help files.
+Solution: Add the 'helplang' option to select the preferred language(s).
+ Make ":helptags" generate tags files for all languages.
+Files: runtime/doc/options.txt, runtime/doc/various.txt, src/Makefile,
+ src/ex_cmds.c, src/ex_cmds2.c, src/ex_cmds.h, src/ex_getln.c,
+ src/normal.c, src/option.c, src/option.h, src/proto/ex_cmds.pro,
+ src/proto/ex_cmds2.pro, src/proto/option.pro, src/structs.h,
+ src/tag.c, src/vim.h
+
+Patch 6.2.300 (after 6.2.297)
+Problem: Cannot build Python interface with Python 2.2 or earlier.
+Solution: Add a semicolon.
+Files: src/if_python.c
+
+Patch 6.2.301
+Problem: The "select all" item from the popup menu doesn't work for Select
+ mode.
+Solution: Use the same commands as for the "Edit.select all" menu.
+ (Benji Fisher)
+Files: runtime/menu.vim
+
+Patch 6.2.302
+Problem: Using "CTRL-O ." in Insert mode doesn't work properly. (Benji
+ Fisher)
+Solution: Restore "restart_edit" after an insert command that was not typed.
+ Avoid waiting with displaying the mode when there is no text to be
+ overwritten.
+ Fix that "CTRL-O ." sometimes doesn't put the cursor back after
+ the end-of-line. Only reset the flag that CTRL-O was used past
+ the end of the line when restarting editing. Update "o_lnum"
+ number when inserting text and "o_eol" is set.
+Files: src/edit.c, src/normal.c
+
+Patch 6.2.303
+Problem: Cannot use Unicode digraphs while 'encoding' is not Unicode.
+Solution: Convert the character from Unicode to 'encoding' when needed.
+ Use the Unicode digraphs for the Macintosh. (Eckehard Berns)
+Files: src/digraph.c
+
+Patch 6.2.304 (extra, after 6.2.256)
+Problem: Mac: No proper support for 'encoding'. Conversion without iconv()
+ is not possible.
+Solution: Convert input from 'termencoding' to 'encoding'. Add
+ mac_string_convert(). Convert text for the clipboard when needed.
+ (Eckehard Berns)
+Files: src/gui_mac.c, src/mbyte.c, src/structs.h, src/vim.h
+
+Patch 6.2.305 (after 6.2.300)
+Problem: Win32: Cannot build Python interface with Python 2.3. (Ajit
+ Thakkar)
+Solution: Add two functions to the dynamic loading feature.
+Files: src/if_python.c
+
+Patch 6.2.306 (extra)
+Problem: Win32: Building console version with BCC 5.5 gives a warning for
+ get_cmd_args() prototype missing. (Ajit Thakkar)
+Solution: Don't build os_w32exe.c for the console version.
+Files: src/Make_bc5.mak
+
+Patch 6.2.307 (after 6.2.299)
+Problem: Installing help files fails.
+Solution: Expand wildcards for translated help files separately.
+Files: src/Makefile
+
+Patch 6.2.308
+Problem: Not all systems have "whoami", resulting in an empty user name.
+Solution: Use "logname" when possible, "whoami" otherwise. (David Boyce)
+Files: src/Makefile
+
+Patch 6.2.309
+Problem: "3grx" waits for two ESC to be typed. (Jens Paulus)
+Solution: Append the ESC to the stuff buffer when redoing the "gr" insert.
+Files: src/edit.c
+
+Patch 6.2.310
+Problem: When setting 'undolevels' to -1, making a change and setting
+ 'undolevels' to a positive value an "undo list corrupt" error
+ occurs. (Madoka Machitani)
+Solution: Sync undo before changing 'undolevels'.
+Files: src/option.c
+
+Patch 6.2.311 (after 6.2.298)
+Problem: When making several changes in one line the changelist grows
+ quickly. There is no error message for reaching the end of the
+ changelist. Reading changelist marks from viminfo doesn't work
+ properly.
+Solution: Only make a new entry in the changelist when making a change in
+ another line or 'textwidth' columns away. Add E662, E663 and E664
+ error messages. Put a changelist mark from viminfo one position
+ before the end.
+Files: runtime/doc/motion.txt, src/mark.c, src/misc1.c, src/normal.c
+
+Patch 6.2.312 (after 6.2.299)
+Problem: "make install" clears the screen when installing the docs.
+Solution: Execute ":helptags" in silent mode.
+Files: runtime/doc/Makefile
+
+Patch 6.2.313
+Problem: When opening folds in a diff window, other diff windows no longer
+ show the same text.
+Solution: Sync the folds in diff windows.
+Files: src/diff.c, src/fold.c, src/move.c, src/proto/diff.pro,
+ src/proto/move.pro
+
+Patch 6.2.314
+Problem: When 'virtualedit' is set "rx" may cause a crash with a blockwise
+ selection and using "$". (Moritz Orbach)
+Solution: Don't try replacing chars in a line that has no characters in the
+ block.
+Files: src/ops.c
+
+Patch 6.2.315
+Problem: Using CTRL-C in a Visual mode mapping while 'insertmode' is set
+ stops Vim from returning to Insert mode.
+Solution: Don't reset "restart_edit" when a CTRL-C is found and 'insertmode'
+ is set.
+Files: src/normal.c
+
+Patch 6.2.316 (after 6.2.312)
+Problem: "make install" tries connecting to the X server when installing
+ the docs. (Stephen Thomas)
+Solution: Add the "-X" argument.
+Files: runtime/doc/Makefile
+
+Patch 6.2.317 (after 6.2.313)
+Problem: When using "zi" in a diff window, other diff windows are not
+ adjusted. (Richard Curnow)
+Solution: Distribute a change in 'foldenable' to other diff windows.
+Files: src/normal.c
+
+Patch 6.2.318
+Problem: When compiling with _THREAD_SAFE external commands don't echo
+ typed characters.
+Solution: Don't set the terminal mode to TMODE_SLEEP when it's already at
+ TMODE_COOK.
+Files: src/os_unix.c
+
+Patch 6.2.319 (extra)
+Problem: Building gvimext.dll with Mingw doesn't work properly.
+Solution: Use gcc instead of dllwrap. Use long option names. (Alejandro
+ Lopez-Valencia)
+Files: src/GvimExt/Make_ming.mak
+
+Patch 6.2.320
+Problem: Win32: Adding and removing the menubar resizes the Vim window.
+ (Jonathon Merz)
+Solution: Don't let a resize event change 'lines' unexpectedly.
+Files: src/gui.c
+
+Patch 6.2.321
+Problem: When using modeless selection, wrapping lines are not recognized,
+ a line break is always inserted.
+Solution: Add LineWraps[] to remember whether a line wrapped or not.
+Files: src/globals.h, src/screen.c, src/ui.c
+
+Patch 6.2.322
+Problem: With 'showcmd' set, after typing "dd" the next "d" may not be
+ displayed. (Jens Paulus)
+Solution: Redraw the command line after updating the screen, scrolling may
+ have set "clear_cmdline".
+Files: src/screen.c
+
+Patch 6.2.323
+Problem: Win32: expanding "~/file" in an autocommand pattern results in
+ backslashes, while this pattern should only have forward slashes.
+Solution: Make expanding environment variables respect 'shellslash' and set
+ p_ssl when expanding the autocommand pattern.
+Files: src/fileio.c, src/misc1.c, src/proto/fileio.pro
+
+Patch 6.2.324 (extra)
+Problem: Win32: when "vimrun.exe" has a path with white space, such as
+ "Program Files", executing external commands may fail.
+Solution: Put double quotes around the path to "vimrun".
+Files: src/os_win32.c
+
+Patch 6.2.325
+Problem: When $HOME includes a space, doing ":set tags=~/tags" doesn't
+ work, the space is used to separate file names. (Brett Stahlman)
+Solution: Escape the space with a backslash.
+Files: src/option.c
+
+Patch 6.2.326
+Problem: ":windo set syntax=foo" doesn't work. (Tim Chase)
+Solution: Don't change 'eventignore' for ":windo".
+Files: src/ex_cmds2.c
+
+Patch 6.2.327
+Problem: When formatting text all marks in the formatted lines are lost.
+ A word is not joined to a previous line when this would be
+ possible. (Mikolaj Machowski)
+Solution: Try to keep marks in the same position as much as possible.
+ Also keep mark positions when joining lines.
+ Start auto-formatting in the previous line when appropriate.
+ Add the "gw" operator: Like "gq" but keep the cursor where it is.
+Files: runtime/doc/change.txt, src/edit.c, src/globals.h, src/mark.c,
+ src/misc1.c, src/normal.c, src/ops.c, src/proto/edit.pro,
+ src/proto/mark.pro, src/proto/ops.pro, src/structs.h, src/vim.h
+
+Patch 6.2.328
+Problem: XIM with GTK: It is hard to understand what XIM is doing.
+Solution: Add xim_log() to log XIM events and help with debugging.
+Files: src/mbyte.c
+
+Patch 6.2.329
+Problem: ":=" does not work Vi compatible. (Antony Scriven)
+Solution: Print the last line number instead of the current line. Don't
+ print "line".
+Files: src/ex_cmds.h, src/ex_docmd.c
+
+Patch 6.2.330 (extra, after 6.2.267)
+Problem: Win32: Crash when tearing off a menu.
+Solution: Terminate a string with a NUL. (Yasuhiro Matsumoto)
+Files: src/gui_w32.c
+
+Patch 6.2.331 (after 6.2.327)
+Problem: "gwap" leaves cursor in the wrong line.
+Solution: Remember the cursor position before finding the ends of the
+ paragraph.
+Files: src/normal.c, src/ops.c, src/structs.h
+
+Patch 6.2.332 (extra)
+Problem: Amiga: Compile error for string array. Compiling the Amiga GUI
+ doesn't work.
+Solution: Use a char pointer instead. Move including "gui_amiga.h" to after
+ including "vim.h". Add a semicolon. (Ali Akcaagac)
+Files: src/gui_amiga.c, src/os_amiga.c
+
+Patch 6.2.333 (extra)
+Problem: Win32: printing doesn't work with specified font charset.
+Solution: Use the specified font charset. (Mike Williams)
+Files: src/os_mswin.c
+
+Patch 6.2.334 (extra, after 6.2.296)
+Problem: Win32: evaluating client expression in debug mode requires typing
+ "cont".
+Solution: Use eval_client_expr_to_string().
+Files: src/os_mswin.c
+
+Patch 6.2.335
+Problem: The ":sign" command cannot be followed by another command.
+Solution: Add TRLBAR to the command flags.
+Files: src/ex_cmds.h
+
+Patch 6.2.336 (after 6.2.327)
+Problem: Mixup of items in an expression.
+Solution: Move "== NUL" to the right spot.
+Files: src/edit.c
+
+Patch 6.2.337 (extra, after 6.2.319)
+Problem: Building gvimext.dll with Mingw doesn't work properly.
+Solution: Fix white space and other details. (Alejandro Lopez-Valencia)
+Files: src/GvimExt/Make_ming.mak
+
+Patch 6.2.338 (after 6.2.331)
+Problem: When undoing "gwap" the cursor is always put at the start of the
+ paragraph. When undoing auto-formatting the cursor may be above
+ the change.
+Solution: Try to move the cursor back to where it was or to the first line
+ that actually changed.
+Files: src/normal.c, src/ops.c, src/undo.c
+
+Patch 6.2.339
+Problem: Crash when using many different highlight groups and a User
+ highlight group. (Juergen Kraemer)
+Solution: Do not use the sg_name_u pointer when it is NULL. Also simplify
+ use of the highlight group table.
+Files: src/syntax.c
+
+Patch 6.2.340
+Problem: ":reg" doesn't show the actual contents of the clipboard if it was
+ filled outside of Vim. (Stuart MacDonald)
+Solution: Obtain the clipboard contents before displaying it.
+Files: src/ops.c
+
+Patch 6.2.341 (extra)
+Problem: Win32: When the path to diff.exe contains a space and using the
+ vimrc generated by the install program, diff mode does not work.
+Solution: Put the first double quote just before the space instead of before
+ the path.
+Files: src/dosinst.c
+
+Patch 6.2.342 (extra)
+Problem: Win32: macros are not always used as expected.
+Solution: Define WINVER to 0x0400 instead of 0x400. (Alejandro
+ Lopez-Valencia)
+Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_mvc.mak
+
+Patch 6.2.343
+Problem: Title doesn't work with some window managers. X11: Setting the
+ text property for the window title is hard coded.
+Solution: Use STRING format when possible. Use the UTF-8 function when
+ it's available and 'encoding' is utf-8. Use
+ XStringListToTextProperty(). Do the same for the icon name.
+ (David Harrison)
+Files: src/os_unix.c
+
+Patch 6.2.344 (extra, after 6.2.337)
+Problem: Cannot build gvimext.dll with MingW on Linux.
+Solution: Add support for cross compiling. (Ronald Hoellwarth)
+Files: src/GvimExt/Make_ming.mak
+
+Patch 6.2.345 (extra)
+Problem: Win32: Copy/paste between two Vims fails if 'encoding' is not set
+ properly or there are illegal bytes.
+Solution: Use a raw byte format. Always set it when copying. When pasting
+ use the raw format if 'encoding' is the same.
+Files: src/os_mswin.c, src/os_win16.c, src/os_win32.c, src/vim.h
+
+Patch 6.2.346
+Problem: Win32 console: After using "chcp" Vim does not detect the
+ different codepage.
+Solution: Use GetConsoleCP() and when it is different from GetACP() set
+ 'termencoding'.
+Files: src/option.c
+
+Patch 6.2.347 (extra)
+Problem: Win32: XP theme support is missing.
+Solution: Add a manifest and refer to it from the resource file. (Michael
+ Wookey)
+Files: Makefile, src/gvim.exe.mnf, src/vim.rc
+
+Patch 6.2.348
+Problem: Win32: "vim c:\dir\(test)" doesn't work, because the 'isfname'
+ default value doesn't contain parenthesis.
+Solution: Temporarily add '(' and ')' to 'isfname' when expanding file name
+ arguments.
+Files: src/main.c
+
+Patch 6.2.349
+Problem: Finding a match using 'matchpairs' may cause a crash.
+ 'matchpairs' is not used for 'showmatch'.
+Solution: Don't look past the NUL in 'matchpairs'. Use 'matchpairs' for
+ 'showmatch'. (Dave Olszewkski)
+Files: src/misc1.c, src/normal.c, src/proto/search.pro, src/search.c
+
+Patch 6.2.350
+Problem: Not enough info about startup timing.
+Solution: Add a few more TIME_MSG() calls.
+Files: src/main.c
+
+Patch 6.2.351
+Problem: Win32: $HOME may be set to %USERPROFILE%.
+Solution: Expand %VAR% at the start of $HOME.
+Files: src/misc1.c
+
+Patch 6.2.352 (after 6.2.335)
+Problem: ":sign texthl=||" does not work.
+Solution: Remove the check for a following command. Give an error for extra
+ arguments after "buff=1".
+Files: src/ex_cmds.c, src/ex_cmds.h
+
+Patch 6.2.353 (extra)
+Problem: Win32: Supported server name length is limited. (Paul Bossi)
+Solution: Use MAX_PATH instead of 25.
+Files: src/os_mswin.c
+
+Patch 6.2.354 (extra)
+Problem: Win32: When the mouse pointer is on a tear-off menu it is hidden
+ when typing but is not redisplayed when moved. (Markx Hackmann)
+Solution: Handle the pointer move event for the tear-off menu window.
+Files: src/gui_w32.c
+
+Patch 6.2.355 (after 6.2.303)
+Problem: When 'encoding' is a double-byte encoding different from the
+ current locale, the width of characters is not correct.
+ Possible failure and memory leak when using iconv, Unicode
+ digraphs and 'encoding' is not "utf-8".
+Solution: Use iconv() to discover the actual width of characters.
+ Add the "vc_fail" field to vimconv_T.
+ When converting a digraph, init the conversion type to NONE and
+ cleanup afterwards.
+Files: src/digraph.c, src/mbyte.c, src/structs.h
+
+Patch 6.2.356
+Problem: When using a double-byte 'encoding' and 'selection' is
+ "exclusive", "vy" only yanks the first byte of a double-byte
+ character. (Xiangjiang Ma)
+Solution: Correct the column in unadjust_for_sel() to position on the first
+ byte, always include the trailing byte of the selected text.
+Files: src/normal.c
+
+Patch 6.2.357 (after 6.2.321)
+Problem: Memory leak when resizing the Vim window.
+Solution: Free the LineWraps array.
+Files: src/screen.c
+
+Patch 6.2.358 (after 6.2.299)
+Problem: Memory leak when using ":help" and the language doesn't match.
+Solution: Free the array with matching tags.
+Files: src/ex_cmds.c
+
+Patch 6.2.359 (after 6.2.352)
+Problem: Compiler warning for long to int type cast.
+Solution: Add explicit type cast.
+Files: src/ex_cmds.c
+
+Patch 6.2.360
+Problem: "100|" in an empty line results in a ruler "1,0-100". (Pavol
+ Juhas)
+Solution: Recompute w_virtcol if the target column was not reached.
+Files: src/misc2.c
+
+Patch 6.2.361 (extra)
+Problem: Win32: Run gvim, ":set go-=m", use Alt-Tab, keep Alt pressed while
+ pressing Esc, then release Alt: Cursor disappears and typing a key
+ causes a beep. (Hari Krishna Dara)
+Solution: Don't ignore the WM_SYSKEYUP event when the menu is disabled.
+Files: src/gui_w32.c
+
+Patch 6.2.362 (extra, after 6.2.347)
+Problem: Win32: The manifest causes Gvim not to work. (Dave Roberts)
+Solution: Change "x86" to "X86". (Serge Pirotte)
+Files: src/gvim.exe.mnf
+
+Patch 6.2.363
+Problem: In an empty file with 'showmode' off, "i" doesn't change the ruler
+ from "0-1" to "1". Typing "x<BS>" does show "1", but then <Esc>
+ doesn't make it "0-1" again. Same problem for ruler in
+ statusline. (Andrew Pimlott)
+Solution: Remember the "empty line" flag with Insert mode and'ed to it.
+Files: src/screen.c
+
+Patch 6.2.364
+Problem: HTML version of the documentation doesn't mention the encoding,
+ which is a problem for mbyte.txt.
+Solution: Adjust the awk script. (Ilya Sher)
+Files: runtime/doc/makehtml.awk
+
+Patch 6.2.365
+Problem: The configure checks for Perl and Python may add compile and link
+ arguments that break building Vim.
+Solution: Do a sanity check: try building with the arguments.
+Files: src/auto/configure, src/configure.in
+
+Patch 6.2.366
+Problem: When the GUI can't start because no valid font is found, there is
+ no error message. (Ugen)
+Solution: Add an error message.
+Files: src/gui.c
+
+Patch 6.2.367
+Problem: Building the help tags file while installing may fail if there is
+ another Vim in $PATH.
+Solution: Specify the just installed Vim executable. (Gordon Prieur)
+Files: src/Makefile
+
+Patch 6.2.368
+Problem: When 'autochdir' is set, closing a window doesn't change to the
+ directory of the new current window. (Salman Halim)
+Solution: Handle 'autochdir' always when a window becomes the current one.
+Files: src/window.c
+
+Patch 6.2.369
+Problem: Various memory leaks: when using globpath(), when searching for
+ help tags files, when defining a function inside a function, when
+ giving an error message through an exception, for the final "."
+ line in ":append", in expression "cond ? a : b" that fails and for
+ missing ")" in an expression. Using NULL pointer when adding
+ first user command and for pointer computations with regexp.
+ (tests by Dominique Pelle)
+Solution: Fix the leaks by freeing the allocated memory. Don't use the
+ array of user commands when there are no entries. Use a macro
+ instead of a function call for saving and restoring regexp states.
+Files: src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c,
+ src/misc2.c, src/regexp.c, src/screen.c, src/tag.c
+
+Patch 6.2.370 (extra, after6.2.341)
+Problem: Win32: When the path to diff.exe contains a space and using the
+ vimrc generated by the install program, diff mode may not work.
+ (Alejandro Lopez-Valencia)
+Solution: Do not use double quotes for arguments that do not have a space.
+Files: src/dosinst.c
+
+Patch 6.2.371
+Problem: When 'virtualedit' is set and there is a Tab before the next "x",
+ "dtx" does not delete the whole Tab. (Ken Hashishi)
+Solution: Move the cursor to the last position of the Tab. Also for
+ "df<Tab>".
+Files: src/normal.c
+
+Patch 6.2.372
+Problem: When using balloon evaluation, no value is displayed for members
+ of structures and items of an array.
+Solution: Include "->", "." and "[*]" in the expression.
+Files: src/gui_beval.c, src/normal.c, src/vim.h
+
+Patch 6.2.373
+Problem: When 'winminheight' is zero and a window is reduced to zero
+ height, the ruler always says "Top" instead of the cursor
+ position. (Antoine J. Mechelynck)
+Solution: Don't recompute w_topline for a zero-height window.
+Files: src/window.c
+
+Patch 6.2.374
+Problem: ":echo "hello" | silent normal n" removes the "hello" message.
+ (Servatius Brandt)
+Solution: Don't echo the search string when ":silent" was used. Also don't
+ show the mode. In general: don't clear to the end of the screen.
+Files: src/gui.c, src/message.c, src/os_unix.c, src/proto/message.pro,
+ src/screen.c, src/search.c, src/window.c
+
+Patch 6.2.375
+Problem: When changing 'guioptions' the hit-enter prompt may be below the
+ end of the Vim window.
+Solution: Call screen_alloc() before showing the prompt.
+Files: src/message.c
+
+Patch 6.2.376
+Problem: Win32: Ruby interface cannot be dynamically linked with Ruby 1.6.
+Solution: Add #ifdefs around use of rb_w32_snprintf(). (Benoît Cerrina)
+Files: src/if_ruby.c
+
+Patch 6.2.377 (after 6.2.372)
+Problem: Compiler warnings for signed/unsigned compare. (Michael Wookey)
+Solution: Add type cast.
+Files: src/normal.c
+
+Patch 6.2.378 (extra, after 6.2.118)
+Problem: Mac: cannot build with Project Builder.
+Solution: Add remove_tail_with_ext() to locate and remove the "build"
+ directory from the runtime path. Include os_unix.c when needed.
+ (Dany St Amant)
+Files: src/misc1.c, src/os_macosx.c, src/vim.h
+
+Patch 6.2.379
+Problem: Using ":mkvimrc" in the ":options" window sets 'bufhidden' to
+ "delete". (Michael Naumann)
+Solution: Do not add buffer-specific option values to a global vimrc file.
+Files: src/option.c
+
+Patch 6.2.380 (extra)
+Problem: DOS: "make test" fails when running it again. Can't "make test"
+ with Borland C.
+Solution: Make sure ".out" files are deleted when they get in the way. Add
+ a "test" target to the Borland C Makefile.
+Files: src/Make_bc5.mak, src/testdir/Make_dos.mak
+
+Patch 6.2.381
+Problem: Setting 'fileencoding' to a comma separated list (confusing it
+ with 'fileencodings') does not result in an error message.
+ Setting 'fileencoding' in an empty file marks it as modified.
+ There is no "+" in the title after setting 'fileencoding'.
+Solution: Check for a comma in 'fileencoding'. Only consider a non-empty
+ file modified by changing 'fileencoding'. Update the title after
+ changing 'fileencoding'.
+Files: src/option.c
+
+Patch 6.2.382
+Problem: Running "make test" puts marks from test files in viminfo.
+Solution: Specify a different viminfo file to use.
+Files: src/testdir/test15.in, src/testdir/test49.in
+
+Patch 6.2.383
+Problem: ":hi foo term='bla" crashes Vim. (Antony Scriven)
+Solution: Check that the closing ' is there.
+Files: src/syntax.c
+
+Patch 6.2.384
+Problem: ":menu a.&b" ":unmenu a.b" only works if "&b" isn't translated.
+Solution: Also compare the names without '&' characters.
+Files: src/menu.c
+
+Patch 6.2.385 (extra)
+Problem: Win32: forward_slash() and trash_input_buf() are undefined when
+ compiling with small features. (Ajit Thakkar)
+Solution: Change the #ifdefs for forward_slash(). Don't call
+ trash_input_buf() if the input buffer isn't used.
+Files: src/fileio.c, src/os_win32.c
+
+Patch 6.2.386
+Problem: Wasting time trying to read marks from the viminfo file for a
+ buffer without a name.
+Solution: Skip reading marks when the buffer has no name.
+Files: src/fileio.c
+
+Patch 6.2.387
+Problem: There is no highlighting of translated items in help files.
+Solution: Search for a "help_ab.vim" syntax file when the help file is
+ called "*.abx". Also improve the help highlighting a bit.
+Files: runtime/syntax/help.vim
+
+Patch 6.2.388
+Problem: GTK: When displaying some double-width characters they are drawn
+ as single-width, because of conversion to UTF-8.
+Solution: Check the width that GTK uses and add a space if it's one instead
+ of two.
+Files: src/gui_gtk_x11.c
+
+Patch 6.2.389
+Problem: When working over a slow connection, it's very annoying that the
+ last line is partly drawn and then cleared for every change.
+Solution: Don't redraw the bottom line if no rows were inserted or deleted.
+ Don't draw the line if we know "@" lines will be used.
+Files: src/screen.c
+
+Patch 6.2.390
+Problem: Using "r*" in Visual mode on multi-byte characters only replaces
+ every other character. (Tyson Roberts)
+Solution: Correct the cursor position after replacing each character.
+Files: src/ops.c
+
+Patch 6.2.391 (extra)
+Problem: The ":highlight" command is not tested.
+Solution: Add a test script for ":highlight".
+Files: src/testdir/Makefile, src/testdir/Make_amiga.mak,
+ src/testdir/Make_dos.mak, src/testdir/Make_os2.mak,
+ src/testdir/Make_vms.mms, src/testdir/test51.in,
+ src/testdir/test51.ok
+
+Patch 6.2.392 (after 6.2.384)
+Problem: Unused variable.
+Solution: Remove "dlen".
+Files: src/menu.c
+
+Patch 6.2.393
+Problem: When using very long lines the viminfo file can become very big.
+Solution: Add the "s" flag to 'viminfo': skip registers with more than the
+ specified Kbyte of text.
+Files: runtime/doc/options.txt, src/ops.c, src/option.c
+
+Patch 6.2.394 (after 6.2.391)
+Problem: Test 51 fails on a terminal with 8 colors. (Tony Leneis)
+Solution: Use "DarkBlue" instead of "Blue" to avoid the "bold" attribute.
+Files: src/testdir/test51.in
+
+Patch 6.2.395
+Problem: When using ":tag" or ":pop" the previous matching tag is used.
+ But since the current file is different, the ordering of the tags
+ may change.
+Solution: Remember what the current buffer was for when re-using cur_match.
+Files: src/edit.c, src/ex_cmds.c, src/proto/tag.pro, src/structs.h,
+ src/tag.c
+
+Patch 6.2.396
+Problem: When CTRL-T jumps to another file and an autocommand moves the
+ cursor to the '" mark, don't end up on the right line. (Michal
+ Malecki)
+Solution: Set the line number after loading the file.
+Files: src/tag.c
+
+Patch 6.2.397
+Problem: When using a double-byte 'encoding' mapping <M-x> doesn't work.
+ (Yasuhiro Matsumoto)
+Solution: Do not set the 8th bit of the character but use a modifier.
+Files: src/gui_gtk_x11.c, src/gui_x11.c, src/misc2.c
+
+Patch 6.2.398 (extra)
+Problem: Win32 console: no extra key modifiers are supported.
+Solution: Encode the modifiers into the input stream. Also fix that special
+ keys are converted and stop working when 'tenc' is set. Also fix
+ that when 'tenc' is intialized the input and output conversion is
+ not setup properly until 'enc' or 'tenc' is set.
+Files: src/getchar.c, src/option.c, src/os_win32.c
+
+Patch 6.2.399
+Problem: A ":set" command that fails still writes a message when it is
+ inside a try/catch block.
+Solution: Include all the text of the message in the error message.
+Files: src/charset.c, src/option.c
+
+Patch 6.2.400
+Problem: Can't compile if_xcmdsrv.c on HP-UX 11.0.
+Solution: Include header file poll.h. (Malte Neumann)
+Files: src/if_xcmdsrv.c
+
+Patch 6.2.401
+Problem: When opening a buffer that was previously opened, Vim does not
+ restore the cursor position if the first line starts with white
+ space. (Gregory Margo)
+Solution: Don't skip restoring the cursor position if it is past the blanks
+ in the first line.
+Files: src/buffer.c
+
+Patch 6.2.402
+Problem: Mac: "make install" doesn't generate help tags. (Benji Fisher)
+Solution: Generate help tags before copying the runtime files.
+Files: src/Makefile
+
+Patch 6.2.403
+Problem: ":@y" checks stdin if there are more commands to execute. This
+ fails if stdin is not connected, e.g., when starting the GUI from
+ KDE. (Ned Konz)
+Solution: Only check for a next command if there still is typeahead.
+Files: src/ex_docmd.c
+
+Patch 6.2.404
+Problem: Our own function to determine width of Unicode characters may get
+ outdated. (Markus Kuhn)
+Solution: Use wcwidth() when it is available. Also use iswprint().
+Files: src/auto/configure, src/configure.in, src/config.h.in, src/mbyte.c
+
+Patch 6.2.405
+Problem: Cannot map zero without breaking the count before a command.
+ (Benji Fisher)
+Solution: Disable mapping zero when entering a count.
+Files: src/getchar.c, src/globals.h, src/normal.c
+
+Patch 6.2.406
+Problem: ":help \zs", ":help \@=" and similar don't find useful help.
+Solution: Prepend "/\" to the arguments to find the desired help tag.
+Files: src/ex_cmds.c
+
+Patch 6.2.407 (after 6.2.299)
+Problem: ":help \@<=" doesn't find help.
+Solution: Avoid that ":help \@<=" searches for the "<=" language.
+Files: src/tag.c
+
+Patch 6.2.408
+Problem: ":compiler" is not consistent: Sets local options and a global
+ variable. (Douglas Potts) There is no error message when a
+ compiler is not supported.
+Solution: Use ":compiler!" to set a compiler globally, otherwise it's local
+ to the buffer and "b:current_compiler" is used. Give an error
+ when no compiler script could be found.
+ Note: updated compiler plugins can be found at
+ ftp://ftp.vim.org/pub/vim/runtime/compiler/
+Files: runtime/compiler/msvc.vim, runtime/doc/quickfix.txt, src/eval.c,
+ src/ex_cmds2.c
+
+Patch 6.2.409
+Problem: The cursor ends up in the last column instead of after the line
+ when doing "i//<Esc>o" with 'indentexpr' set to "cindent(v:lnum)".
+ (Toby Allsopp)
+Solution: Adjust the cursor as if in Insert mode.
+Files: src/misc1.c
+
+Patch 6.2.410 (after 6.2.389)
+Problem: In diff mode, when there are more filler lines than fit in the
+ window, they are not drawn.
+Solution: Check for filler lines when skipping to draw a line that doesn't
+ fit.
+Files: src/screen.c
+
+Patch 6.2.411
+Problem: A "\n" inside a string is not seen as a line break by the regular
+ expression matching. (Hari Krishna Dara)
+Solution: Add the vim_regexec_nl() function for strings where "\n" is to be
+ matched with a line break.
+Files: src/eval.c, src/ex_eval.c, src/proto/regexp.c, src/regexp.c
+
+Patch 6.2.412
+Problem: Ruby: "ruby << EOF" inside a function doesn't always work. Also
+ for ":python", ":tcl" and ":perl".
+Solution: Check for "<< marker" and skip until "marker" before checking for
+ "endfunction".
+Files: src/eval.c
+
+Patch 6.2.413 (after 6.2.411)
+Problem: Missing prototype for vim_regexec_nl(). (Marcel Svitalsky)
+Solution: Now really include the prototype.
+Files: src/proto/regexp.pro
+
+Patch 6.2.414
+Problem: The function used for custom completion of user commands cannot
+ have <SID> to make it local. (Hari Krishna Dara)
+Solution: Pass the SID of the script where the user command was defined on
+ to the completion. Also clean up #ifdefs.
+Files: src/ex_docmd.c, src/eval.c, src/ex_getln.c, src/structs.h
+
+Patch 6.2.415
+Problem: Vim may crash after a sequence of events that change the window
+ size. The window layout assumes a larger window than is actually
+ available. (Servatius Brandt)
+Solution: Invoke win_new_shellsize() from screenalloc() instead of from
+ set_shellsize().
+Files: src/screen.c, src/term.c
+
+Patch 6.2.416
+Problem: Compiler warning for incompatible pointer.
+Solution: Remove the "&" in the call to poll(). (Xavier de Gaye)
+Files: src/os_unix.c
+
+Patch 6.2.417 (after 6.2.393)
+Problem: Many people forget that the '"' item in 'viminfo' needs to be
+ preceded with a backslash,
+Solution: Add '<' as an alias for the '"' item.
+Files: runtime/doc/options.txt, src/ops.c, src/option.c
+
+Patch 6.2.418
+Problem: Using ":nnoremap <F12> :echo "cheese" and ":cabbr cheese xxx":
+ when pressing <F12> still uses the abbreviation. (Hari Krishna)
+Solution: Also apply "noremap" to abbreviations.
+Files: src/getchar.c
+
+Patch 6.2.419 (extra)
+Problem: Win32: Cannot open the Vim window inside another application.
+Solution: Add the "-P" argument to specify the window title of the
+ application to run inside. (Zibo Zhao)
+Files: runtime/doc/starting.txt, src/main.c, src/gui_w32.c,
+ src/gui_w48.c, src/if_ole.cpp, src/os_mswin.c,
+ src/proto/gui_w32.pro
+
+Patch 6.2.420
+Problem: Cannot specify a file to be edited in binary mode without setting
+ the global value of the 'binary' option.
+Solution: Support ":edit ++bin file".
+Files: runtime/doc/editing.txt, src/buffer.c, src/eval.c, src/ex_cmds.h,
+ src/ex_docmd.c, src/fileio.c, src/misc2.c
+
+Patch 6.2.421
+Problem: Cannot set the '[ and '] mark, which may be necessary when an
+ autocommand simulates reading a file.
+Solution: Allow using "m[" and "m]".
+Files: runtime/doc/motion.txt, src/mark.c
+
+Patch 6.2.422
+Problem: In CTRL-X completion messages the "/" makes them less readable.
+Solution: Remove the slashes. (Antony Scriven)
+Files: src/edit.c
+
+Patch 6.2.423
+Problem: ":vertical wincmd ]" does not split vertically.
+Solution: Add "postponed_split_flags".
+Files: src/ex_docmd.c, src/globals.h, src/if_cscope.c, src/tag.c
+
+Patch 6.2.424
+Problem: A BufEnter autocommand that sets an option stops 'mousefocus' from
+ working in Insert mode (Normal mode is OK). (Gregory Seidman)
+Solution: In the Insert mode loop invoke gui_mouse_correct() when needed.
+Files: src/edit.c
+
+Patch 6.2.425
+Problem: Vertical split and command line window: can only drag status line
+ above the cmdline window on the righthand side, not lefthand side.
+Solution: Check the status line row instead of the window pointer.
+Files: src/ui.c
+
+Patch 6.2.426
+Problem: A syntax region end match with a matchgroup that includes a line
+ break only highlights the last line with matchgroup. (Gary
+ Holloway)
+Solution: Also use the line number of the position where the region
+ highlighting ends.
+Files: src/syntax.c
+
+Patch 6.2.427 (extra)
+Problem: When pasting a lot of text in a multi-byte encoding, conversion
+ from 'termencoding' to 'encoding' may fail for some characters.
+ (Kuang-che Wu)
+Solution: When there is an incomplete byte sequence at the end of the read
+ text keep it for the next time.
+Files: src/mbyte.c, src/os_amiga.c, src/os_mswin.c, src/proto/mbyte.pro,
+ src/proto/os_mswin.pro, src/ui.c
+
+Patch 6.2.428
+Problem: The X11 clipboard supports the Vim selection for char/line/block
+ mode, but since the encoding is not included can't copy/paste
+ between two Vims with a different 'encoding'.
+Solution: Add a new selection format that includes the 'encoding'. Perform
+ conversion when necessary.
+Files: src/gui_gtk_x11.c, src/ui.c, src/vim.h
+
+Patch 6.2.429
+Problem: Unix: glob() doesn't work for a directory with a single quote in
+ the name. (Nazri Ramliy)
+Solution: When using the shell to expand, only put double quotes around
+ spaces and single quotes, not the whole thing.
+Files: src/os_unix.c
+
+Patch 6.2.430
+Problem: BOM at start of a vim script file is not recognized and causes an
+ error message.
+Solution: Detect the BOM and skip over it. Also fix that after using
+ ":scriptencoding" the iconv() file descriptor was not closed
+ (memory leak).
+Files: src/ex_cmds2.c
+
+Patch 6.2.431
+Problem: When using the horizontal scrollbar, the scrolling is limited to
+ the length of the cursor line.
+Solution: Make the scroll limit depend on the longest visible line. The
+ cursor is moved when necessary. Including the 'h' flag in
+ 'guioptions' disables this.
+Files: runtime/doc/gui.txt, runtime/doc/options.txt, src/gui.c,
+ src/misc2.c, src/option.h
+
+Patch 6.2.432 (after 6.2.430 and 6.2.431)
+Problem: Lint warnings.
+Solution: Add type casts.
+Files: src/ex_cmds2.c, src/gui.c
+
+Patch 6.2.433
+Problem: Translating "VISUAL" and "BLOCK" separately doesn't give a good
+ result. (Alejandro Lopez Valencia)
+Solution: Use a string for each combination.
+Files: src/screen.c
+
+Patch 6.2.434 (after 6.2.431)
+Problem: Compiler warning. (Salman Halim)
+Solution: Add type casts.
+Files: src/gui.c
+
+Patch 6.2.435
+Problem: When there are vertically split windows the minimal Vim window
+ height is computed wrong.
+Solution: Use frame_minheight() to correctly compute the minimal height.
+Files: src/window.c
+
+Patch 6.2.436
+Problem: Running the tests changes the user's viminfo file.
+Solution: In test 49 tell the extra Vim to use the test viminfo file.
+Files: src/testdir/test49.vim
+
+Patch 6.2.437
+Problem: ":mksession" always puts "set nocompatible" in the session file.
+ This changes option settings. (Ron Aaron)
+Solution: Add an "if" to only change 'compatible' when needed.
+Files: src/ex_docmd.c
+
+Patch 6.2.438
+Problem: When the 'v' flag is present in 'cpoptions', backspacing and then
+ typing text again: one character too much is overtyped before
+ inserting is done again.
+Solution: Set "dollar_vcol" to the right column.
+Files: src/edit.c
+
+Patch 6.2.439
+Problem: GTK 2: Changing 'lines' may cause a mismatch between the window
+ layout and the size of the window.
+Solution: Disable the hack with force_shell_resize_idle().
+Files: src/gui_gtk_x11.c
+
+Patch 6.2.440
+Problem: When 'lazyredraw' is set the window title is still updated.
+ The size of the Visual area and the ruler are displayed too often.
+Solution: Postpone redrawing the window title. Only show the Visual area
+ size when waiting for a character. Don't draw the ruler
+ unnecessary.
+Files: src/buffer.c, src/normal.c, src/screen.c
+
+Patch 6.2.441
+Problem: ":unabbreviate foo " doesn't work, because of the trailing space,
+ while an abbreviation with a trailing space is not possible. (Paul
+ Jolly)
+Solution: Accept a match with the lhs of an abbreviation without the
+ trailing space.
+Files: src/getchar.c
+
+Patch 6.2.442
+Problem: Cannot manipulate the command line from a function.
+Solution: Add getcmdline(), getcmdpos() and setcmdpos() functions and the
+ CTRL-\ e command.
+Files: runtime/doc/cmdline.txt, runtime/doc/eval.txt, src/eval.c
+ src/ex_getln.c, src/ops.c, src/proto/ex_getln.pro,
+ src/proto/ops.pro
+
+Patch 6.2.443
+Problem: With ":silent! echoerr something" you don't get the position of
+ the error. emsg() only writes the message itself and returns.
+Solution: Also redirect the position of the error.
+Files: src/message.c
+
+Patch 6.2.444
+Problem: When adding the 'c' flag to a ":substitute" command it may replace
+ more times than without the 'c' flag. Happens for a match that
+ starts with "\ze" (Marcel Svitalsk) and when using "\@<=" (Klaus
+ Bosau).
+Solution: Correct "prev_matchcol" when replacing the line. Don't replace
+ the line when the pattern uses look-behind matching.
+Files: src/ex_cmds.c, src/proto/regexp.pro, src/regexp.c
+
+Patch 6.2.445
+Problem: Copying vimtutor to /tmp/something is not secure, a symlink may
+ cause trouble.
+Solution: Create a directory and create the file in it. Use "umask" to
+ create the directory with mode 700. (Stefan Nordhausen)
+Files: src/vimtutor
+
+Patch 6.2.446 (after 6.2.404)
+Problem: Using library functions wcwidth() and iswprint() results in
+ display problems for Hebrew characters. (Ron Aaron)
+Solution: Disable the code to use the library functions, use our own.
+Files: src/mbyte.c
+
+Patch 6.2.447 (after 6.2.440)
+Problem: Now that the title is only updated when redrawing, it is no longer
+ possible to show it while executing a function. (Madoka Machitani)
+Solution: Make ":redraw" also update the title.
+Files: src/ex_docmd.c
+
+Patch 6.2.448 (after 6.2.427)
+Problem: Mac: conversion done when 'termencoding' differs from 'encoding'
+ fails when pasting a longer text.
+Solution: Check for an incomplete sequence at the end of the chunk to be
+ converted. (Eckehard Berns)
+Files: src/mbyte.c
+
+Patch 6.2.449 (after 6.2.431)
+Problem: Get error messages when switching files.
+Solution: Check for a valid line number when calculating the width of the
+ horizontal scrollbar. (Helmut Stiegler)
+Files: src/gui.c
+
+Patch 6.2.450
+Problem: " #include" and " #define" are not recognized with the default
+ option values for 'include' and 'defined'. (RG Kiran)
+Solution: Adjust the default values to allow white space before the #.
+Files: runtime/doc/options.txt, src/option.c
+
+Patch 6.2.451
+Problem: GTK: when using XIM there are various problems, including setting
+ 'modified' and breaking undo at the wrong moment.
+Solution: Add "xim_changed_while_preediting", "preedit_end_col" and
+ im_is_preediting(). (Yasuhiro Matsumoto)
+Files: src/ex_getln.c, src/globals.h, src/gui_gtk.c, src/gui_gtk_x11.c,
+ src/mbyte.c, src/misc1.c, src/proto/mbyte.pro, src/screen.c,
+ src/undo.c
+
+Patch 6.2.452
+Problem: In diff mode, when DiffAdd and DiffText highlight settings are
+ equal, an added line is highlighted with DiffChange. (Tom Schumm)
+Solution: Remember the diff highlight type instead of the attributes.
+Files: src/screen.c
+
+Patch 6.2.453
+Problem: ":s/foo\|\nbar/x/g" does not replace two times in "foo\nbar".
+ (Pavel Papushev)
+Solution: When the pattern can match a line break also try matching at the
+ NUL at the end of a line.
+Files: src/ex_cmds.c, src/regexp.c
+
+Patch 6.2.454
+Problem: ":let b:changedtick" doesn't work. (Alan Schmitt) ":let
+ b:changedtick = 99" does not give an error message.
+Solution: Add code to recognize ":let b:changedtick".
+Files: src/eval.c
+
+Patch 6.2.455 (after 6.2.297)
+Problem: In Python commands the current locale changes how certain Python
+ functions work. (Eugene M. Minkovskii)
+Solution: Set the LC_NUMERIC locale to "C" while executing a Python command.
+Files: src/if_python.c
+
+Patch 6.2.456 (extra)
+Problem: Win32: Editing a file by its Unicode name (dropping it on Vim or
+ using the file selection dialog) doesn't work. (Yakov Lerner, Alex
+ Jakushev)
+Solution: Use wide character functions when file names are involved and
+ convert from/to 'encoding' where needed.
+Files: src/gui_w48.c, src/macros.h, src/memfile.c, src/memline.c,
+ src/os_mswin.c, src/os_win32.c
+
+Patch 6.2.457 (after 6.2.244)
+Problem: When 'encoding' is "utf-8" and writing text with chars above 0x80
+ in latin1, conversion is wrong every 8200 bytes. (Oyvind Holm)
+Solution: Correct the utf_ptr2len_check_len() function and fix the problem
+ of displaying 0xf7 in utfc_ptr2len_check_len().
+Files: src/mbyte.c
+
+Patch 6.2.458
+Problem: When 'virtualedit' is set "$" doesn't move to the end of an
+ unprintable character, causing "y$" not to include that character.
+ (Fred Ma)
+Solution: Set "coladd" to move the cursor to the end of the character.
+Files: src/misc2.c
+
+Patch 6.2.459 (after 6.2.454)
+Problem: Variable "b" cannot be written. (Salman Halim)
+Solution: Compare strings properly.
+Files: src/eval.c
+
+Patch 6.2.460 (extra, after 6.2.456)
+Problem: Compiler warnings for missing prototypes.
+Solution: Include the missing prototypes.
+Files: src/proto/os_win32.pro
+
+Patch 6.2.461
+Problem: After using a search command "x" starts putting single characters
+ in the numbered registers.
+Solution: Reset "use_reg_one" at the right moment.
+Files: src/normal.c
+
+Patch 6.2.462
+Problem: Finding a matching parenthesis does not correctly handle a
+ backslash in a trailing byte.
+Solution: Handle multi-byte characters correctly. (Taro Muraoka)
+Files: src/search.c
+
+Patch 6.2.463 (extra)
+Problem: Win32: An NTFS file system may contain files with extra info
+ streams. The current method to copy them creates one and then
+ deletes it again. (Peter Toennies) Also, only three streams with
+ hard coded names are copied.
+Solution: Use BackupRead() to check which info streams the original file
+ contains and only copy these streams.
+Files: src/os_win32.c
+
+Patch 6.2.464 (extra, after 6.2.427)
+Problem: Amiga: Compilation error with gcc. (Ali Akcaagac)
+Solution: Move the #ifdef outside of Read().
+Files: src/os_amiga.c
+
+Patch 6.2.465
+Problem: When resizing the GUI window the window manager sometimes moves it
+ left of or above the screen. (Michael McCarty)
+Solution: Check the window position after resizing it and move it onto the
+ screen when it isn't.
+Files: src/gui.c
+
+Patch 6.2.466 (extra, after 6.2.456)
+Problem: Win32: Compiling with Borland C fails, and an un/signed warning.
+Solution: Redefine wcsicmp() to wcscmpi() and add type casts. (Yasuhiro
+ Matsumoto)
+Files: src/os_win32.c
+
+Patch 6.2.467 (extra, after 6.2.463)
+Problem: Win32: can't compile without multi-byte feature. (Ajit Thakkar)
+Solution: Add #ifdefs around the info stream code.
+Files: src/os_win32.c
+
+Patch 6.2.468
+Problem: Compiler warnings for shadowed variables. (Matthias Mohr)
+Solution: Delete superfluous variables and rename others.
+Files: src/eval.c, src/ex_docmd.c, src/ex_eval.c, src/if_cscope.c,
+ src/fold.c, src/option.c, src/os_unix.c, src/quickfix.c,
+ src/regexp.c
+
+Patch 6.2.469 (extra, after 6.2.456)
+Problem: Win32: Can't create swap file when 'encoding' differs from the
+ active code page. (Kriton Kyrimis)
+Solution: In enc_to_ucs2() terminate the converted string with a NUL
+Files: src/os_mswin.c
+
+Patch 6.2.470
+Problem: The name returned by tempname() may be equal to the file used for
+ shell output when ignoring case.
+Solution: Skip 'O' and 'I' in tempname().
+Files: src/eval.c
+
+Patch 6.2.471
+Problem: "-L/usr/lib" is used in the link command, even though it's
+ supposed to be filtered out. "-lw" and "-ldl" are not
+ automatically added when needed for "-lXmu". (Antonio Colombo)
+Solution: Check for a space after the argument instead of before. Also
+ remove "-R/usr/lib" if it's there. Check for "-lw" and "-ldl"
+ before trying "-lXmu".
+Files: src/auto/configure, src/configure.in, src/link.sh
+
+Patch 6.2.472
+Problem: When using a FileChangedShell autocommand that changes the current
+ buffer, a buffer exists that can't be wiped out.
+ Also, Vim sometimes crashes when executing an external command
+ that changes the buffer and a FileChangedShell autocommand is
+ used. (Hari Krishna Dara)
+ Users are confused by the warning for a file being changed outside
+ of Vim.
+Solution: Avoid that the window counter for a buffer is incremented twice.
+ Avoid that buf_check_timestamp() is used recursively.
+ Add a hint to look in the help for more info.
+Files: src/ex_cmds.c, src/fileio.c
+
+Patch 6.2.473
+Problem: Using CTRL-] in a help buffer without a name causes a crash.
+Solution: Check for name to be present before using it. (Taro Muraoka)
+Files: src/tag.c
+
+Patch 6.2.474 (extra, after 6.2.456)
+Problem: When Vim is starting up conversion is done unnecessarily. Failure
+ to find the runtime files on Windows 98. (Randall W. Morris)
+Solution: Init enc_codepage negative, only use it when not negative.
+ Don't use GetFileAttributesW() on Windows 98 or earlier.
+Files: src/globals.h, src/gui_w32.c, src/gui_w48.c, src/os_mswin.c,
+ src/os_win32.c
+
+Patch 6.2.475
+Problem: Commands after "perl <<EOF" are parsed as Vim commands when they
+ are not executed.
+Solution: Properly skip over the perl commands.
+Files: src/ex_docmd.c, src/ex_getln.c, src/if_perl.xs, src/if_python.c,
+ src/if_ruby.c, src/if_tcl.c, src/misc2.c
+
+Patch 6.2.476
+Problem: When reloading a hidden buffer changed outside of Vim and the
+ current buffer is read-only, the reloaded buffer becomes
+ read-only. (Hari Krishna Dara)
+Solution: Save the 'readonly' flag of the realoaded buffer instead of the
+ current buffer.
+Files: src/fileio.c
+
+Patch 6.2.477
+Problem: Using remote_send(v:servername, "\<C-V>") causes Vim to hang.
+ (Yakov Lerner)
+Solution: When the resulting string is empty don't set received_from_client.
+Files: src/main.c
+
+Patch 6.2.478
+Problem: Win32: "--remote file" fails changing directory if the current
+ directory name starts with a single quote. (Iestyn Walters)
+Solution: Add a backslash where it will be removed later.
+Files: src/main.c, src/misc2.c, src/proto/misc2.pro
+
+Patch 6.2.479
+Problem: The error message for errors during recovery goes unnoticed.
+Solution: Avoid that the hit-enter prompt overwrites the message. Add a few
+ lines to make the error stand out.
+Files: src/main.c, src/message.c, src/memline.c
+
+Patch 6.2.480
+Problem: NetBeans: Using negative index in array. backslash at end of
+ message may cause Vim to crash. (Xavier de Gaye)
+Solution: Initialize buf_list_used to zero. Check for trailing backslash.
+Files: src/netbeans.c
+
+Patch 6.2.481
+Problem: When writing a file it is not possible to specify that hard and/or
+ symlinks are to be broken instead of preserved.
+Solution: Add the "breaksymlink" and "breakhardlink" values to 'backupcopy'.
+ (Simon Ekstrand)
+Files: runtime/doc/options.txt, src/fileio.c, src/option.c, src/option.h
+
+Patch 6.2.482
+Problem: Repeating insert of CTRL-K 1 S doesn't work. The superscript 1 is
+ considered to be a digit. (Juergen Kraemer)
+Solution: In vim_isdigit() only accept '0' to '9'. Use VIM_ISDIGIT() for
+ speed where possible. Also add vim_isxdigit().
+Files: src/buffer.c, src/charset.c, src/diff.c, src/digraph.c,
+ src/edit.c, src/eval.c,, src/ex_cmds.c, src/ex_cmds2.c,
+ src/ex_docmd.c, src/ex_eval.c, src/ex_getln.c,
+ src/if_xcmdsrv.c, src/farsi.c, src/fileio.c, src/fold.c,
+ src/getchar.c, src/gui.c, src/if_cscope.c, src/macros.h,
+ src/main.c, src/mark.c, src/mbyte.c, src/menu.c, src/misc1.c,
+ src/misc2.c, src/normal.c, src/ops.c, src/option.c,
+ src/proto/charset.pro, src/regexp.c, src/screen.c, src/search.c,
+ src/syntax.c, src/tag.c, src/term.c, src/termlib.c
+
+Patch 6.2.483 (extra, after 6.2.482)
+Problem: See 6.2.482.
+Solution: Extra part of patch 6.2.482.
+Files: src/gui_photon.c, src/gui_w48.c, src/os_msdos.c, src/os_mswin.c
+
+Patch 6.2.484
+Problem: MS-Windows: With the included diff.exe, differences after a CTRL-Z
+ are not recognized. (Peter Keresztes)
+Solution: Write the files with unix fileformat and invoke diff with --binary
+ if possible.
+Files: src/diff.c
+
+Patch 6.2.485
+Problem: A BufWriteCmd autocommand cannot know if "!" was used or not.
+ (Hari Krishna Dara)
+Solution: Add the v:cmdbang variable.
+Files: runtime/doc/eval.txt, src/eval.c, src/proto/eval.pro,
+ src/fileio.c, src/vim.h
+
+Patch 6.2.486 (6.2.482)
+Problem: Diff for eval.c is missing.
+Solution: Addition to patch 6.2.482.
+Files: src/eval.c
+
+Patch 6.2.487 (extra, after 6.2.456)
+Problem: Compiler warnings for wrong prototype. (Alejandro Lopez Valencia)
+Solution: Delete the prototype for Handle_WM_Notify().
+Files: src/proto/gui_w32.pro
+
+Patch 6.2.488
+Problem: Missing ")" in *.ch filetype detection.
+Solution: Add the ")". (Ciaran McCreesh)
+Files: runtime/filetype.vim
+
+Patch 6.2.489
+Problem: When accidentally opening a session in Vim which has already been
+ opened in another Vim there is a long row of ATTENTION prompts.
+ Need to quit each of them to get out. (Robert Webb)
+Solution: Add the "Abort" alternative to the dialog.
+Files: src/memline.c
+
+Patch 6.2.490
+Problem: With 'paragraph' it is not possible to use a single dot as a
+ paragraph boundary. (Dorai Sitaram)
+Solution: Allow using " " (two spaces) in 'paragraph' to match ".$" or
+ ". $"
+Files: src/search.c
+
+Patch 6.2.491
+Problem: Decrementing a position doesn't take care of multi-byte chars.
+Solution: Adjust the column for multi-byte characters. Remove mb_dec().
+ (Yasuhiro Matsumoto)
+Files: src/mbyte.c, src/misc2.c, src/proto/mbyte.pro
+
+Patch 6.2.492
+Problem: When using ":redraw" while there is a message, the next ":echo"
+ still causes text to scroll. (Yasuhiro Matsumoto)
+Solution: Reset msg_didout and msg_col, so that after ":redraw" the next
+ message overwrites an existing one.
+Files: src/ex_docmd.c
+
+Patch 6.2.493
+Problem: "@x" doesn't work when 'insertmode' is set. (Benji Fisher)
+Solution: Put "restart_edit" in the typeahead buffer, so that it's used
+ after executing the register contents.
+Files: src/ops.c
+
+Patch 6.2.494
+Problem: Using diff mode with two windows, when moving horizontally in
+ inserted lines, a fold in the other window may open.
+Solution: Compute the line number in the other window correctly.
+Files: src/diff.c
+
+Patch 6.2.495 (extra, after 6.2.456)
+Problem: Win32: The file dialog doesn't work on Windows 95.
+Solution: Put the wide code of gui_mch_browse() in gui_mch_browseW() and use
+ it only on Windows NT/2000/XP.
+Files: src/gui_w32.c, src/gui_w48.c
+
+Patch 6.2.496
+Problem: FreeBSD 4.x: When compiled with the pthread library (Python) a
+ complicated pattern may cause Vim to crash. Catching the signal
+ doesn't work.
+Solution: When compiled with threads, instead of using the normal stacksize
+ limit, use the size of the initial stack.
+Files: src/auto/configure, src/config.h.in, src/configure.in,
+ src/os_unix.c
+
+Patch 6.2.497 (extra)
+Problem: Russian messages are only available in one encoding.
+Solution: Convert the messages to MS-Windows codepages. (Vassily Ragosin)
+Files: src/po/Makefile
+
+Patch 6.2.498
+Problem: Non-latin1 help files are not properly supported.
+Solution: Support utf-8 help files and convert them to 'encoding' when
+ needed.
+Files: src/fileio.c
+
+Patch 6.2.499
+Problem: When writing a file and halting the system, the file might be lost
+ when using a journalling file system.
+Solution: Use fsync() to flush the file data to disk after writing a file.
+ (Radim Kolar)
+Files: src/fileio.c
+
+Patch 6.2.500 (extra)
+Problem: The DOS/MS-Windows the installer doesn't use the --binary flag for
+ diff.
+Solution: Add --binary to the diff argument in MyDiff(). (Alejandro Lopez-
+ Valencia)
+Files: src/dosinst.c
+
+Patch 6.2.501
+Problem: Vim does not compile with MorphOS.
+Solution: Add a Makefile and a few changes to make Vim work with MorphOS.
+ (Ali Akcaagac)
+Files: runtime/doc/os_amiga.txt, src/INSTALLami.txt,
+ src/Make_morphos.mak, src/memfile.c, src/term.c
+
+Patch 6.2.502
+Problem: Building fails for generating message files.
+Solution: Add dummy message files.
+Files: src/po/ca.po, src/po/ru.po, src/po/sv.po
+
+Patch 6.2.503
+Problem: Mac: Can't compile MacRoman conversions without the GUI.
+Solution: Also link with the Carbon framework for the terminal version, for
+ the MacRoman conversion functions. (Eckehard Berns)
+ Remove -ltermcap from the GUI link command, it is not needed.
+Files: src/auto/configure, src/Makefile, src/configure.in
+
+Patch 6.2.504
+Problem: Various problems with 'cindent', among which that a
+ list of variable declarations is not indented properly.
+Solution: Fix the wrong indenting. Improve indenting of C++ methods.
+ Add the 'i', 'b' and 'W' options to 'cinoptions'. (mostly by
+ Helmut Stiegler)
+ Improve indenting of preprocessor-continuation lines.
+Files: runtime/doc/indent.txt, src/misc1.c, src/testdir/test3.in,
+ src/testdir/test3.ok
+
+Patch 6.2.505
+Problem: Help for -P argument is missing. (Ronald Hoellwarth)
+Solution: Add the patch that was missing in 6.2.419.
+Files: runtime/doc/starting.txt
+
+Patch 6.2.506 (extra)
+Problem: Win32: When 'encoding' is a codepage then reading a utf-8 file
+ only works when iconv is available. Writing a file in another
+ codepage uses the wrong kind of conversion.
+Solution: Use internal conversion functions. Enable reading and writing
+ files with 'fileencoding' different from 'encoding' for all valid
+ codepages and utf-8 without the need for iconv.
+Files: src/fileio.c, src/testdir/Make_dos.mak, src/testdir/test52.in,
+ src/testdir/test52.ok
+
+Patch 6.2.507
+Problem: The ownership of the file with the password for the NetBeans
+ connection is not checked. "-nb={file}" doesn't work for GTK.
+Solution: Only accept the file when owned by the user and not accessible by
+ others. Detect "-nb=" for GTK.
+Files: src/netbeans.c, src/gui_gtk_x11.c
+
+Patch 6.2.508
+Problem: Win32: "v:lang" does not show the current language for messages if
+ it differs from the other locale settings.
+Solution: Use the value of the $LC_MESSAGES environment variable.
+Files: src/ex_cmds2.c
+
+Patch 6.2.509 (after 6.2.508)
+Problem: Crash when $LANG is not set.
+Solution: Add check for NULL pointer. (Ron Aaron)
+Files: src/ex_cmds2.c
+
+Patch 6.2.510 (after 6.2.507)
+Problem: Warning for pointer conversion.
+Solution: Add a type cast.
+Files: src/gui_gtk_x11.c
+
+Patch 6.2.511
+Problem: Tags in Russian help files are in utf-8 encoding, which may be
+ different from 'encoding'.
+Solution: Use the "TAG_FILE_ENCODING" field in the tags file to specify the
+ encoding of the tags. Convert help tags from 'encoding' to the
+ tag file encoding when searching for matches, do the reverse when
+ listing help tags.
+Files: runtime/doc/tagsrch.txt, src/ex_cmds.c, src/tag.c
+
+Patch 6.2.512
+Problem: Translating "\"\n" is useless. (Gerfried Fuchs)
+Solution: Remove the _() around it.
+Files: src/main.c, src/memline.c
+
+Patch 6.2.513 (after 6.2.507)
+Problem: NetBeans: the check for owning the connection info file can be
+ simplified. (Nikolay Molchanov)
+Solution: Only check if the access mode is right.
+Files: src/netbeans.c
+
+Patch 6.2.514
+Problem: When a highlight/syntax group name contains invalid characters
+ there is no warning.
+Solution: Add an error for unprintable characters and a warning for other
+ invalid characters.
+Files: src/syntax.c
+
+Patch 6.2.515
+Problem: When using the options window 'swapfile' is reset.
+Solution: Use ":setlocal" instead of ":set".
+Files: runtime/optwin.vim
+
+Patch 6.2.516
+Problem: The sign column cannot be seen, looks like there are two spaces
+ before the text. (Rob Retter)
+Solution: Add the SignColumn highlight group.
+Files: runtime/doc/options.txt, runtime/doc/sign.txt, src/option.c,
+ src/screen.c, src/syntax.c, src/vim.h
+
+Patch 6.2.517
+Problem: Using "r*" in Visual mode on multi-byte characters replaces
+ too many characters. In Visual Block mode replacing with a
+ multi-byte character doesn't work.
+Solution: Adjust the operator end for the difference in byte length of the
+ original and the replaced character. Insert all bytes of a
+ multi-byte character, take care of double-wide characters.
+Files: src/ops.c
+
+Patch 6.2.518
+Problem: Last line of a window is not updated after using "J" and then "D".
+ (Adri Verhoef)
+Solution: When no line is found below a change that doesn't need updating,
+ update all lines below the change.
+Files: src/screen.c
+
+Patch 6.2.519
+Problem: Mac: cannot read/write files in MacRoman format.
+Solution: Do internal conversion from/to MacRoman to/from utf-8 and latin1.
+ (Eckehard Berns)
+Files: src/fileio.c
+
+Patch 6.2.520 (extra)
+Problem: The NSIS installer is outdated.
+Solution: Make it work with NSIS 2.0. Also include console executables for
+ Win 95/98/ME and Win NT/2000/XP. Use LZWA compression. Use
+ "/oname" to avoid having to rename files before running NSIS.
+Files: Makefile, nsis/gvim.nsi
+
+Patch 6.2.521
+Problem: When using silent Ex mode the "changing a readonly file" warning
+ is omitted but the one second wait isn't. (Yakov Lerner)
+Solution: Skip the delay when "silent_mode" is set.
+Files: src/misc1.c
+
+Patch 6.2.522
+Problem: GUI: when changing 'cmdheight' in the gvimrc file the window
+ layout is messed up. (Keith Dart)
+Solution: Skip updating the window layout when changing 'cmdheight' while
+ still starting up.
+Files: src/option.c
+
+Patch 6.2.523
+Problem: When loading a session and aborting when a swap file already
+ exists, the user is left with useless windows. (Robert Webb)
+Solution: Load one file before creating the windows.
+Files: src/ex_docmd.c
+
+Patch 6.2.524 (extra, after 6.2.520)
+Problem: Win32: (un)installing gvimext.dll may fail if it was used.
+ The desktop and start menu links are created for the current user
+ instead of all users.
+ Using the home directory as working directory for the links is a
+ bad idea for multi-user systems.
+ Cannot use Vim from the "Open With..." menu.
+Solution: Force a reboot if necessary. (Alejandro Lopez-Valencia) Also use
+ macros for the directory of the source and runtime files. Use
+ "CSIDL_COMMON_*" instead of "CSIDL_*" when possible.
+ Do not specify a working directory in the links.
+ Add Vim to the "Open With..." menu. (Giuseppe Bilotta)
+Files: nsis/gvim.nsi, src/dosinst.c, src/dosinst.h, src/uninstal.c
+
+Patch 6.2.525
+Problem: When the history contains a very long line ":history" causes a
+ crash. (Volker Kiefel)
+Solution: Shorten the history entry to fit it in one line.
+Files: src/ex_getln.c
+
+Patch 6.2.526
+Problem: When s:lang is "ja" the Japanese menus are not used.
+Solution: Add 'encoding' to the language when there is no charset.
+Files: runtime/menu.vim
+
+Patch 6.2.527
+Problem: The 2html script uses ":wincmd p", which breaks when using some
+ autocommands.
+Solution: Remember the window numbers and jump to them with ":wincmd w".
+ Also add XHTML support. (Panagiotis Issaris)
+Files: runtime/syntax/2html.vim
+
+Patch 6.2.528
+Problem: NetBeans: Changes of the "~" command are not reported.
+Solution: Call netbeans_inserted() after performing "~". (Gordon Prieur)
+ Also change NetBeans debugging to append to the log file.
+ Also fix that "~" in Visual block mode changes too much if there
+ are multi-byte characters.
+Files: src/nbdebug.c, src/normal.c, src/ops.c
+
+Patch 6.2.529 (extra)
+Problem: VisVim only works for Admin. Doing it for one user doesn't work.
+ (Alexandre Gouraud)
+Solution: When registering the module fails, simply continue.
+Files: src/VisVim/VisVim.cpp
+
+Patch 6.2.530
+Problem: Warning for missing prototype on the Amiga.
+Solution: Include time.h
+Files: src/version.c
+
+Patch 6.2.531
+Problem: In silent ex mode no messages are given, which makes debugging
+ very difficult.
+Solution: Do output messages when 'verbose' is set.
+Files: src/message.c, src/ui.c
+
+Patch 6.2.532 (extra)
+Problem: Compiling for Win32s with VC 4.1 doesn't work.
+Solution: Don't use CP_UTF8 if it's not defined. Don't use CSIDL_COMMON*
+ when not defined.
+Files: src/dosinst.h, src/fileio.c
+
+Win32 console: After patch 6.2.398 Ex mode did not work. (Yasuhiro Matsumoto)
+
+Patch 6.3a.001
+Problem: Win32: if testing for the "--binary" option fails, diff isn't used
+ at all.
+Solution: Handle the "ok" flag properly. (Yasuhiro Matsumoto)
+Files: src/diff.c
+
+Patch 6.3a.002
+Problem: NetBeans: An insert command from NetBeans beyond the end of a
+ buffer crashes Vim. (Xavier de Gaye)
+Solution: Use a local pos_T structure for the position.
+Files: src/netbeans.c
+
+Patch 6.3a.003
+Problem: E315 error with auto-formatting comments. (Henry Van Roessel)
+Solution: Pass the line number to same_leader().
+Files: src/ops.c
+
+Patch 6.3a.004
+Problem: Test32 fails on Windows XP for the DJGPP version. Renaming
+ test11.out fails.
+Solution: Don't try renaming, create new files to use for the test.
+Files: src/testdir/test32.in, src/testdir/test32.ok
+
+Patch 6.3a.005
+Problem: ":checkpath!" does not use 'includeexpr'.
+Solution: Use a file name that was found directly. When a file was not
+ found and the located name is empty, use the rest of the line.
+Files: src/search.c
+
+Patch 6.3a.006
+Problem: "yip" moves the cursor to the first yanked line, but not to the
+ first column. Looks like not all text was yanked. (Jens Paulus)
+Solution: Move the cursor to the first column.
+Files: src/search.c
+
+Patch 6.3a.007
+Problem: 'cindent' recognizes "enum" but not "typedef enum".
+Solution: Skip over "typedef" before checking for "enum". (Helmut Stiegler)
+ Also avoid that searching for this item goes too far back.
+Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
+
+Patch 6.3a.008 (extra)
+Problem: Windows 98: Some of the wide functions are not implemented,
+ resulting in file I/O to fail. This depends on what Unicode
+ support is installed.
+Solution: Handle the failure and fall back to non-wide functions.
+Files: src/os_win32.c
+
+Patch 6.3a.009
+Problem: Win32: Completion of filenames does not work properly when
+ 'encoding' differs from the active code page.
+Solution: Use wide functions for expanding wildcards when appropriate.
+Files: src/misc1.c
+
+Patch 6.3a.010 (extra)
+Problem: Win32: Characters in the window title that do not appear in the
+ active codepage are replaced by a question mark.
+Solution: Use DefWindowProcW() instead of DefWindowProc() when possible.
+Files: src/glbl_ime.cpp, src/globals.h, src/proto/gui_w16.pro,
+ src/proto/gui_w32.pro, src/gui_w16.c, src/gui_w32.c, src/gui_w48.c
+
+Patch 6.3a.011
+Problem: Using the explorer plugin changes a local directory to the global
+ directory.
+Solution: Don't use ":chdir" to restore the current directory. Make
+ "expand('%:p')" remove "/../" and "/./" items from the path.
+Files: runtime/plugin/explorer.vim, src/eval.c, src/os_unix.c
+
+Patch 6.3a.012 (extra)
+Problem: On Windows 98 the installer doesn't work, don't even get the "I
+ agree" button. The check for the path ending in "vim" makes the
+ browse dialog hard to use. The default path when no previous Vim
+ is installed is "c:\vim" instead of "c:\Program Files\Vim".
+Solution: Remove the background gradient command. Change the
+ .onVerifyInstDir function to a leave function for the directory
+ page. Don't let the install program default to c:\vim when no
+ path could be found.
+Files: nsis/gvim.nsi, src/dosinst.c
+
+Patch 6.3a.013 (extra)
+Problem: Win32: Characters in the menu that are not in the active codepage
+ are garbled.
+Solution: Convert menu strings from 'encoding' to the active codepage.
+Files: src/gui_w32.c, src/gui_w48.c
+
+Patch 6.3a.014
+Problem: Using multi-byte text and highlighting in a statusline causes gaps
+ to appear. (Helmut Stiegler)
+Solution: Advance the column by text width instead of number of bytes. Add
+ the vim_strnsize() function.
+Files: src/charset.c, src/proto/charset.pro, src/screen.c
+
+Patch 6.3a.015
+Problem: Using the "select all" menu item when 'insertmode' is set and
+ clicking the mouse button doesn't return to Insert mode. The
+ Buffers/Delete menu doesn't offer a choice to abandon a changed
+ buffer. (Jens Paulus)
+Solution: Don't use CTRL-\ CTRL-N. Add ":confirm" for the Buffers menu
+ items.
+Files: runtime/menu.vim
+
+Patch 6.3a.016
+Problem: After cancelling the ":confirm" dialog the error message and
+ hit-enter prompt may not be displayed properly.
+Solution: Flush output after showing the dialog.
+Files: src/message.c
+
+Patch 6.3a.017
+Problem: servername() doesn't work when Vim was started with the "-X"
+ argument or when the "exclude" in 'clipboard' matches the terminal
+ name. (Robert Nowotniak)
+Solution: Force connecting to the X server when using client-server
+ commands.
+Files: src/eval.c, src/globals.h, src/os_unix.c
+
+Patch 6.3a.018 (after 6.3a.017)
+Problem: Compiler warning for return value of make_connection().
+Solution: Use void return type.
+Files: src/eval.c
+
+Patch 6.3a.019 (extra)
+Problem: Win32: typing non-latin1 characters doesn't work.
+Solution: Invoke _OnChar() directly to avoid that the argument is truncated
+ to a byte. Convert the UTF-16 character to bytes according to
+ 'encoding' and ignore 'termencoding'. Same for _OnSysChar().
+Files: src/gui_w32.c, src/gui_w48.c
+
+Patch 6.3a.020 (extra)
+Problem: Missing support for AROS (AmigaOS reimplementation). Amiga GUI
+ doesn't work.
+Solution: Add AROS support. (Adam Chodorowski)
+ Fix Amiga GUI problems. (Georg Steger, Ali Akcaagac)
+Files: Makefile, src/Make_aros.mak, src/gui_amiga.c, src/gui_amiga.h,
+ src/memfile.c, src/os_amiga.c, src/term.c
+
+Patch 6.3a.021 (after 6.3a.017)
+Problem: Can't compile with X11 but without GUI.
+Solution: Put use of "gui.in_use" inside an #ifdef.
+Files: src/eval.c
+
+Patch 6.3a.022
+Problem: When typing Tabs when 'softtabstop' is used and 'list' is set a
+ tab is counted for two spaces.
+Solution: Use the "L" flag in 'cpoptions' to tell whether a tab is counted
+ as two spaces or as 'tabstop'. (Antony Scriven)
+Files: runtime/doc/options.txt, src/edit.c
+
+Patch 6.3a.023
+Problem: Completion on the command line doesn't handle backslashes
+ properly. Only the tail of matches is shown, even when not
+ completing filenames.
+Solution: When turning the string into a pattern double backslashes. Don't
+ omit the path when not expanding files or directories.
+Files: src/ex_getln.c
+
+Patch 6.3a.024
+Problem: The "save all" toolbar item fails for buffers that don't have a
+ name. When using ":wa" or closing the Vim window and there are
+ nameless buffers, browsing for a name may cause the name being
+ given to the wrong buffer or not stored properly. ":browse" only
+ worked for one file.
+Solution: Use ":confirm browse" for "save all".
+ Pass buffer argument to setfname(). Restore "browse" flag and
+ "forceit" after doing the work for one file.
+Files: runtime/menu.vim, src/buffer.c, src/ex_cmds.c, src/ex_cmds2.c,
+ src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/memline.c,
+ src/message.c, src/window.c, src/proto/buffer.pro,
+ src/proto/ex_cmds2.pro, src/proto/memline.pro
+
+Patch 6.3a.025
+Problem: Setting 'virtualedit' moves the cursor. (Benji Fisher)
+Solution: Update the virtual column before using it.
+Files: src/option.c
+
+Patch 6.3a.026 (extra, after 6.3a.008)
+Problem: Editing files on Windows 98 doesn't work when 'encoding' is
+ "utf-8" (Antoine Mechelynck)
+ Warning for missing function prototype.
+Solution: For all wide functions check if it failed because it is not
+ implemented. Use ANSI function declaration for char_to_string().
+Files: src/gui_w48.c, src/os_mswin.c, src/os_win32.c
+
+Patch 6.3a.027 (extra, after 6.3a.026)
+Problem: Compiler warning for function argument.
+Solution: Declare both char and WCHAR arrays.
+Files: src/gui_w48.c
+
+Patch 6.3a.028
+Problem: ":normal ." doesn't work inside a function, because redo is saved
+ and restored. (Benji Fisher)
+Solution: Make a copy of the redo buffer when executing a function.
+Files: src/getchar.c
+
+Patch 6.3b.001 (extra)
+Problem: Bcc 5: The generated auto/pathdef can't be compiled.
+Solution: Fix the way quotes and backslashes are escaped.
+Files: src/Make_bc5.mak
+
+Patch 6.3b.002
+Problem: Win32: conversion during file write fails when a double-byte
+ character is split over two writes.
+Solution: Fix the conversion retry without a trailing byte. (Taro Muraoka)
+Files: src/fileio.c
+
+Patch 6.3b.003 (extra)
+Problem: Win32: When compiling with Borland C 5.5 and 'encoding' is "utf-8"
+ then Vim can't open files under MS-Windows 98. (Antoine J.
+ Mechelynck)
+Solution: Don't use _wstat(), _wopen() and _wfopen() in this situation.
+Files: src/os_mswin.c, src/os_win32.c
+
+Patch 6.3b.004
+Problem: ":helpgrep" includes a trailing CR in the text line.
+Solution: Remove the CR.
+Files: src/quickfix.c
+
+Patch 6.3b.005
+Problem: ":echo &g:ai" results in the local option value. (Salman Halim)
+Solution: Pass the flags from find_option_end() to get_option_value().
+Files: src/eval.c
+
+Patch 6.3b.006
+Problem: When using "mswin.vim", CTRL-V in Insert mode leaves cursor before
+ last pasted character. (Mathew Davis)
+Solution: Use the same Paste() function as in menu.vim.
+Files: runtime/mswin.vim
+
+Patch 6.3b.007
+Problem: Session file doesn't restore view on windows properly. (Robert
+ Webb)
+Solution: Restore window sizes both before and after restoring the view, so
+ that the view, cursor position and size are restored properly.
+Files: src/ex_docmd.c
+
+Patch 6.3b.008
+Problem: Using ":finally" in a user command doesn't always work. (Hari
+ Krishna Dara)
+Solution: Don't assume that using getexline() means the command was typed.
+Files: src/ex_docmd.c
+
+Patch 6.3b.009 (extra)
+Problem: Win32: When the -P argument is not found in a window title, there
+ is no error message.
+Solution: When the window can't be found give an error message and exit.
+ Also use try/except to catch failing to open the MDI window.
+ (Michael Wookey)
+Files: src/gui_w32.c
+
+Patch 6.3b.010
+Problem: Win32: Using the "-D" argument and expanding arguments may cause a
+ hang, because the terminal isn't initialized yet. (Vince Negri)
+Solution: Don't go into debug mode before the terminal is initialized.
+Files: src/main.c
+
+Patch 6.3b.011
+Problem: Using CTRL-\ e while obtaining an expression aborts the command
+ line. (Hari Krishna Dara)
+Solution: Insert the CTRL-\ e as typed.
+Files: src/ex_getln.c
+
+Patch 6.3b.012 (after 6.3b.010)
+Problem: Can't compile with tiny features. (Norbert Tretkowski)
+Solution: Add #ifdefs.
+Files: src/main.c
+
+Patch 6.3b.013
+Problem: Loading a session file results in editing the wrong file in the
+ first window when this is not the file at the current position in
+ the argument list. (Robert Webb)
+Solution: Check w_arg_idx_invalid to decide whether to edit a file.
+Files: src/ex_docmd.c
+
+Patch 6.3b.014
+Problem: ":runtime! foo*.vim" may using freed memory when a sourced script
+ changes the value of 'runtimepath'.
+Solution: Make a copy of 'runtimepath' when looping over the matches.
+Files: src/ex_cmds2.c
+
+Patch 6.3b.015
+Problem: Get lalloc(0) error when using "p" in Visual mode while
+ 'clipboard' contains "autoselect,unnamed". (Mark Wagonner)
+Solution: Avoid allocating zero bytes. Obtain the clipboard when necessary.
+Files: src/ops.c
+
+Patch 6.3b.016
+Problem: When 'virtualedit' is used "x" doesn't delete the last character
+ of a line that has as many characters as 'columns'. (Yakov Lerner)
+Solution: When the cursor isn't moved let oneright() return FAIL.
+Files: src/edit.c
+
+Patch 6.3b.017
+Problem: Win32: "vim --remote-wait" doesn't exit when the server finished
+ editing the file. (David Fishburn)
+Solution: In the rrhelper plugin change backslashes to forward slashes and
+ escape special characters.
+Files: runtime/plugin/rrhelper.vim
+
+Patch 6.3b.018
+Problem: The list of help files in the "local additions" table doesn't
+ recognize utf-8 encoding. (Yasuhiro Matsumoto)
+Solution: Recognize utf-8 characters.
+Files: src/ex_cmds.c
+
+Patch 6.3b.019
+Problem: When $VIMRUNTIME is not a full path name the "local additions"
+ table lists all the help files.
+Solution: Use fullpathcmp() instead of fnamecmp() to compare the directory
+ names.
+Files: src/ex_cmds.c
+
+Patch 6.3b.020
+Problem: When using CTRL-^ when entering a search string, the item in the
+ statusline that indicates the keymap is not updated. (Ilya
+ Dogolazky)
+Solution: Mark the statuslines for updating.
+Files: src/ex_getln.c
+
+Patch 6.3b.021
+Problem: The swapfile is not readable for others, the ATTENTION prompt does
+ not show all info when someone else is editing the same file.
+ (Marcel Svitalsky)
+Solution: Use the protection of original file for the swapfile and set it
+ after creating the swapfile.
+Files: src/fileio.c
+
+Patch 6.3b.022
+Problem: Using "4v" to select four times the old Visual area may put the
+ cursor beyond the end of the line. (Jens Paulus)
+Solution: Correct the cursor column.
+Files: src/normal.c
+
+Patch 6.3b.023
+Problem: When "3dip" starts in an empty line, white lines after the
+ non-white lines are not deleted. (Jens Paulus)
+Solution: Include the white lines.
+Files: src/search.c
+
+Patch 6.3b.024
+Problem: "2daw" does not delete leading white space like "daw" does. (Jens
+ Paulus)
+Solution: Include the white space when a count is used.
+Files: src/search.c
+
+Patch 6.3b.025
+Problem: Percentage in ruler isn't updated when a line is deleted. (Jens
+ Paulus)
+Solution: Check for a change in line count when deciding to update the ruler.
+Files: src/screen.c, src/structs.h
+
+Patch 6.3b.026
+Problem: When selecting "abort" at the ATTENTION prompt for a file that is
+ already being edited Vim crashes.
+Solution: Don't abort creating a new buffer when we really need it.
+Files: src/buffer.c, src/vim.h
+
+Patch 6.3b.027
+Problem: Win32: When enabling the menu in a maximized window, Vim uses more
+ lines than what is room for. (Shizhu Pan)
+Solution: When deciding to call shell_resized(), also compare the text area
+ size with Rows and Columns, not just with screen_Rows and
+ screen_Columns.
+Files: src/gui.c
+
+Patch 6.3b.028
+Problem: When in diff mode, setting 'rightleft' causes a crash. (Eddine)
+Solution: Check for last column differently when 'rightleft' is set.
+Files: src/screen.c
+
+Patch 6.3b.029
+Problem: Win32: warning for uninitialized variable.
+Solution: Initialize to zero.
+Files: src/misc1.c
+
+Patch 6.3b.030
+Problem: After Visually selecting four characters, changing it to other
+ text, Visually selecting and yanking two characters: "." changes
+ four characters, another "." changes two characters. (Robert Webb)
+Solution: Don't store the size of the Visual area when redo is active.
+Files: src/normal.c
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
new file mode 100644
index 000000000..46bff9a7c
--- /dev/null
+++ b/runtime/doc/version7.txt
@@ -0,0 +1,84 @@
+*version7.txt* For Vim version 7.0aa. Last change: 2004 Jun 07
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Welcome to Vim 7! A large number of features has been added. This file
+mentions all the new items, changes to existing features and bug fixes
+compared to Vim 6.x.
+
+See |vi_diff.txt| for an overview of differences between Vi and Vim 7.0.
+See |version4.txt| for differences between Vim 3.x and Vim 4.x.
+See |version5.txt| for differences between Vim 4.x and Vim 5.x.
+See |version6.txt| for differences between Vim 5.x and Vim 6.x.
+
+INCOMPATIBLE CHANGES |incompatible-7|
+
+NEW FEATURES |new-7|
+
+New data types |new-data-types|
+Various new items |new-items-7|
+
+IMPROVEMENTS |improvements-7|
+
+COMPILE TIME CHANGES |compile-changes-7|
+
+BUG FIXES |bug-fixes-7|
+
+==============================================================================
+INCOMPATIBLE CHANGES *incompatible-7*
+
+These changes are incompatible with previous releases. Check this list if you
+run into a problem when upgrading from Vim 6.x to 7.0
+
+
+==============================================================================
+NEW FEATURES *new-7*
+
+New data types *new-data-types*
+--------------
+
+In Vim scripts the following types have been added:
+
+ list ordered list of items
+ dictionary associative array of items
+ function reference to a function
+
+Many functions and commands have been added to support the new types.
+
+
+Various new items *new-items-7*
+-----------------
+
+Normal mode commands: ~
+
+
+Options: ~
+
+
+Ex commands: ~
+
+
+New functions: ~
+
+
+New autocommand events: ~
+
+
+New Syntax files: ~
+
+
+==============================================================================
+IMPROVEMENTS *improvements-7*
+
+
+==============================================================================
+COMPILE TIME CHANGES *compile-changes-7*
+
+
+==============================================================================
+BUG FIXES *bug-fixes-7*
+
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
new file mode 100644
index 000000000..7d47db4c5
--- /dev/null
+++ b/runtime/doc/vi_diff.txt
@@ -0,0 +1,884 @@
+*vi_diff.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Differences between Vim and Vi *vi-differences*
+
+Throughout the help files differences between Vim and Vi/Ex are given in
+curly braces, like "{not in Vi}". This file only lists what has not been
+mentioned in other files and gives an overview.
+
+Vim is mostly POSIX 1003.2-1 compliant. The only command known to be missing
+is ":open". There are probably a lot of small differences (either because Vim
+is missing something or because Posix is beside the mark).
+
+1. Missing commands |missing-commands|
+2. Missing options |missing-options|
+3. Limits |limits|
+4. The most interesting additions |vim-additions|
+5. Other vim features |other-features|
+6. Command-line arguments |cmdline-arguments|
+
+==============================================================================
+1. Missing commands *missing-commands*
+
+This command is in Vi, but not in Vim:
+
+:o[pen] {Vi: start editing in open mode} *:o* *:op* *:open*
+
+==============================================================================
+2. Missing options *missing-options*
+
+These options are in the Unix Vi, but not in Vim. If you try to set one of
+them you won't get an error message, but the value is not used and cannot be
+printed.
+
+autoprint (ap) boolean (default on) *'autoprint'* *'ap'*
+beautify (bf) boolean (default off) *'beautify'* *'bf'*
+flash (fl) boolean (default ??) *'flash'* *'fl'*
+graphic (gr) boolean (default off) *'graphic'* *'gr'*
+hardtabs (ht) number (default 8) *'hardtabs'* *'ht'*
+ number of spaces that a <Tab> moves on the display
+mesg boolean (default on) *'mesg'*
+novice boolean (default off) *'novice'*
+open boolean (default on) *'open'*
+optimize (op) boolean (default off) *'optimize'* *'op'*
+prompt boolean (default on) *'prompt'*
+redraw boolean (default off) *'redraw'*
+slowopen (slow) boolean (default off) *'slowopen'* *'slow'*
+sourceany boolean (default off) *'sourceany'*
+window (wi) number (default 23) *'window'* *'wi'*
+w300 number (default 23) *'w300'*
+w1200 number (default 23) *'w1200'*
+w9600 number (default 23) *'w9600'*
+
+==============================================================================
+3. Limits *limits*
+
+Vim has only a few limits for the files that can be edited {Vi: can not handle
+<Nul> characters and characters above 128, has limited line length, many other
+limits}.
+ *E340*
+Maximum line length On machines with 16-bit ints (Amiga and MS-DOS real
+ mode): 32767, otherwise 2147483647 characters.
+ Longer lines are split.
+Maximum number of lines 2147483647 lines.
+Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is
+ 32 bits. Much more for 64 bit longs. Also limited
+ by available disk space for the |swap-file|.
+ *E75*
+Length of a file path Unix and Win32: 1024 characters, otherwise 256
+ characters (or as much as the system supports).
+Length of an expanded string option
+ Unix and Win32: 1024 characters, otherwise 256
+ characters
+Maximum display width Unix and Win32: 1024 characters, otherwise 255
+ characters
+Maximum lhs of a mapping 50 characters.
+Number of highlighting different types: 223
+
+Information for undo and text in registers is kept in memory, thus when making
+(big) changes the amount of (virtual) memory available limits the number of
+undo levels and the text that can be kept in registers. Other things are also
+kept in memory: Command-line history, error messages for Quickfix mode, etc.
+
+Memory usage limits
+-------------------
+
+The option 'maxmem' ('mm') is used to set the maximum memory used for one
+buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for
+all buffers (in kilobytes). The defaults depend on the system used. For the
+Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
+available. If you don't like Vim to swap to a file, set 'maxmem' and
+'maxmemtot' to a very large value. The swap file will then only be used for
+recovery. If you don't want a swap file at all, set 'updatecount' to 0, or
+use the "-n" argument when starting Vim. Note that the 'maxmem' option is
+only used when a buffer is created. Changing this option does not affect
+buffers that have already been loaded. Thus you can set it to different
+values for different files. 'maxmemtot' works always.
+
+==============================================================================
+4. The most interesting additions *vim-additions*
+
+Vi compatibility. |'compatible'|
+ Although Vim is 99% Vi compatible, some things in Vi can be
+ considered to be a bug, or at least need improvement. But still, Vim
+ starts in a mode which behaves like the "real" Vi as much as possible.
+ To make Vim behave a little bit better, try resetting the 'compatible'
+ option:
+ :set nocompatible
+ Or start Vim with the "-N" argument:
+ vim -N
+ This is done automatically if you have a .vimrc file. See |startup|.
+ The 'cpoptions' option can be used to set Vi compatibility on/off for
+ a number of specific items.
+
+Support for different systems.
+ Vim can be used on:
+ - All Unix systems (it works on all systems it was tested on, although
+ the GUI and Perl interface may not work everywhere).
+ - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
+ - MS-DOS in real-mode (no additional drivers required).
+ - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
+ - Windows 95 and Windows NT, with support for long file names.
+ - OS/2 (needs emx.dll)
+ - Atari MiNT
+ - VMS
+ - BeOS
+ - Macintosh
+ - Risc OS
+ - IBM OS/390
+
+Multi level undo. |undo|
+ 'u' goes backward in time, 'CTRL-R' goes forward again. Set option
+ 'undolevels' to the number of changes to be remembered (default 1000).
+ Set 'undolevels' to 0 for a vi-compatible one level undo. Set it to
+ -1 for no undo at all.
+
+ When all changes in a buffer have been undone, the buffer is not
+ considered changed anymore. You can exit it with :q, without <!>.
+
+Graphical User Interface (GUI) |gui|
+ Included support for GUI: menu's, mouse, scrollbars, etc. You can
+ define your own menus. Better support for CTRL/SHIFT/ALT keys in
+ combination with special keys and mouse. Supported for various
+ platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32
+ (Windows 95 and later), BeOS, Amiga and Macintosh.
+
+Multiple windows and buffers. |windows.txt|
+ Vim can split the screen into several windows, each editing a
+ different buffer or the same buffer at a different location. Buffers
+ can still be loaded (and changed) but not displayed in a window. This
+ is called a hidden buffer. Many commands and options have been added
+ for this facility.
+
+Syntax highlighting. |:syntax|
+ Vim can highlight keywords, patterns and other things. This is
+ defined by a number of ":syntax" commands, and can be made to
+ highlight most languages and file types. A number of files are
+ included for highlighting the most common languages, like C, C++,
+ Java, Pascal, Makefiles, shell scripts, etc. The colors used for
+ highlighting can be defined for ordinary terminals, color terminals
+ and the GUI with the ":highlight" command.
+
+Folding |folding|
+ A range of lines can be shown as one "folded" line. This allows
+ overviewing a file and moving blocks of text around quickly.
+ Folds can be created manually, from the syntax of the file, by indent,
+ etc.
+
+Plugins |add-plugin|
+ The functionality can be extended by dropping a plugin file in the
+ right directory. That's an easy way to start using Vim scripts
+ written by others. Plugins can be for all kind of files, or
+ specifically for a filetype.
+
+Repeat a series of commands. |q|
+ "q{c}" starts recording typed characters into named register {c}
+ (append to the register if register name is uppercase). A subsequent
+ "q" stops recording. The register can then be executed with the
+ "@{c}" command. This is very useful to repeat a complex action.
+
+Flexible insert mode. |ins-special-special|
+ The arrow keys can be used in insert mode to move around in the file.
+ This breaks the insert in two parts as far as undo and redo is
+ concerned.
+
+ CTRL-O can be used to execute a single command-mode command. This is
+ almost the same as hitting <Esc>, typing the command and doing "a".
+
+Visual mode. |Visual-mode|
+ Visual can be used to first highlight a piece of text and then give a
+ command to do something with it. This is an (easy to use) alternative
+ to first giving the operator and then moving to the end of the text
+ to be operated upon. "v" and "V" are used to start Visual mode. "v"
+ works on characters and 'V' on lines. Move the cursor to extend the
+ Visual part. It is shown highlighted on the screen. By typing "o"
+ the other end of the Visual text can be moved. The Visual text can
+ be affected by an operator:
+ d delete
+ c change
+ y yank
+ > or < insert or delete indent
+ ! filter through external program
+ = filter through indent
+ : start ":" command for the Visual lines.
+ gq format text to 'textwidth' columns
+ J join lines
+ ~ swap case
+ u make lowercase
+ U make uppercase
+
+Block operators. |visual-block|
+ With Visual a rectangular block of text can be selected. Start Visual
+ with CTRL-V. The block can be deleted ("d"), yanked ("y") or its case
+ can be changed ("~", "u" and "U"). A deleted or yanked block can be
+ put into the text with the "p" and "P" commands.
+
+Online help system. |:help|
+ Help is displayed in a window. The usual commands can be used to
+ move around, search for a string, etc. Tags can be used to jump
+ around in the help files, just like hypertext links. The ":help"
+ command takes an argument to quickly jump to the info on a subject.
+ <F1> is the quick access to the help system. The name of the help
+ index file can be set with the 'helpfile' option.
+
+Command-line editing and history. |cmdline-editing|
+ You can insert or delete at any place in the command-line using the
+ cursor keys. The right/left cursor keys can be used to move
+ forward/backward one character. The shifted right/left cursor keys
+ can be used to move forward/backward one word. CTRL-B/CTRL-E can be
+ used to go to the begin/end of the command-line.
+
+ |cmdline-history|
+ The command-lines are remembered. The up/down cursor keys can be used
+ to recall previous command-lines. The 'history' option can be set to
+ the number of lines that will be remembered. There is a separate
+ history for commands and for search patterns.
+
+Command-line completion. |cmdline-completion|
+ While entering a command-line (on the bottom line of the screen)
+ <Tab> can be typed to complete
+ what example ~
+ - command :e<Tab>
+ - tag :ta scr<Tab>
+ - option :set sc<Tab>
+ - option value :set hf=<Tab>
+ - file name :e ve<Tab>
+ - etc.
+
+ If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
+ will walk through the matches. <Tab> works like CTRL-N, but wraps
+ around to the first match.
+
+ The 'wildchar' option can be set to the character for command-line
+ completion, <Tab> is the default. CTRL-D can be typed after an
+ (incomplete) wildcard; all matches will be listed. CTRL-A will insert
+ all matches. CTRL-L will insert the longest common part of the
+ matches.
+
+Insert-mode completion |ins-completion|
+ In insert mode the CTRL-N and CTRL-P keys can be used to complete a
+ word that has previously been used. |i_CTRL-N|
+ With CTRL-X another mode is entered, through which completion can be
+ done for:
+ |i_CTRL-X_CTRL-F| file names
+ |i_CTRL-X_CTRL-K| words from 'dictionary' files
+ |i_CTRL-X_CTRL-T| words from 'thesaurus' files
+ |i_CTRL-X_CTRL-I| words from included files
+ |i_CTRL-X_CTRL-L| whole lines
+ |i_CTRL-X_CTRL-]| words from the tags file
+ |i_CTRL-X_CTRL-D| definitions or macros
+
+Long line support |'wrap'| |'linebreak'|
+ If the 'wrap' option is off, long lines will not wrap and only part
+ of them will be shown. When the cursor is moved to a part that is not
+ shown, the screen will scroll horizontally. The minimum number of
+ columns to scroll can be set with the 'sidescroll' option. The "zh"
+ and "zl" commands can be used to scroll sideways.
+ Alternatively, long lines are broken in between words when the
+ 'linebreak' option is set. This allows editing a single-line
+ paragraph conveniently (e.g. when the text is later read into a DTP
+ program). Move the cursor up/down with the "gk" and "gj" commands.
+
+Text formatting. |formatting|
+ The 'textwidth' option can be used to automatically limit the line
+ length. This supplements the 'wrapmargin' option of Vi, which was not
+ very useful. The "gq" operator can be used to format a piece of text
+ (for example, "gqap" formats the current paragraph). Commands for
+ text alignment: ":center", ":left" and ":right".
+
+Extended search patterns |pattern|
+ There are many extra items to match various text items. Examples:
+ A "\n" can be used in a search pattern to match a line break.
+ "x\{2,4}" matches "x" 2 to 4 times.
+ "\s" matches a white space character.
+
+Edit-compile-edit speedup. |quickfix|
+ The ":make" command can be used to run the compilation and jump to
+ the first error. Alternatively Vim can be started with the "-q"
+ option from the compiler. A file with compiler error messages is
+ interpreted. Vim starts editing at the first error.
+
+ Each line in the error file is scanned for the name of a file, line
+ number and error message. The 'errorformat' option can be set to a
+ list of scanf-like strings to handle output from many compilers.
+
+ The ":cn" command can be used to jump to the next error.
+ ":cl" lists all the error messages. Other commands are available
+ (almost the same as with Manx's Z editor on the Amiga).
+ The 'makeef' option has the name of the file with error messages.
+ The 'makeprg' option contains the name of the program to be executed
+ with the ":make" command.
+ The 'shellpipe' option contains the string to be used to put the
+ output of the compiler into the errorfile.
+
+Improved indenting for C programs |'cindent'|
+ When the 'cindent' option is on the indent of each line is
+ automatically adjusted. C syntax is mostly recognized. The indent
+ for various styles can be set with 'cinoptions'. The keys to trigger
+ indenting can be set with 'cinkeys'.
+
+ Comments can be automatically formatted. The 'comments' option can be
+ set to the characters that start and end a comment. This works best
+ for C code, but also works for e-mail (">" at start of the line) and
+ other types of text. The "=" operator can be used to re-indent
+ lines.
+
+Searching for words in include files |include-search|
+ The "[i" command can be used to search for a match of the word under
+ the cursor in the current and included files. The 'include' option
+ can be set the a pattern that describes a command to include a file
+ (the default is for C programs).
+ The "[I" command lists all matches, the "[ CTRL-I" command jumps to
+ a match.
+ The "[d", "[D" and "[ CTRL-D" commands do the same, but only for
+ lines where the pattern given with the 'define' option matches.
+
+Automatic commands |autocommand|
+ Commands can be automatically executed when reading a file, writing a
+ file, jumping to another buffer, etc., depending on the file name.
+ This is useful to set options and mappings for C programs,
+ documentation, plain text, e-mail, etc. This also makes it possible
+ to edit compressed files.
+
+Scripts and Expressions |expression|
+ Commands have been added to form up a simple but powerful script
+ language.
+ |:if| Conditional execution, which can be used for example
+ to set options depending on the value of $TERM.
+ |:while| Repeat a number of commands.
+ |:echo| Print the result of an expression.
+ |:let| Assign a value to an internal variable, option, etc.
+ |:execute| Execute a command formed by an expression.
+ etc.
+
+Viminfo |viminfo-file|
+ The command-line history, marks and registers can be stored in a file
+ that is read on startup. This can be used to repeat a search command
+ or command-line command after exiting and restarting Vim. It is also
+ possible to jump right back to where the last edit stopped with "'0".
+ The 'viminfo' option can be set to select which items to store in the
+ .viminfo file. This is off by default.
+
+Mouse support |mouse-using|
+ The mouse is supported in the GUI version, in an xterm for Unix, for
+ Linux with gpm, for MS-DOS, and Win32. It can be used to position the
+ cursor, select the visual area, paste a register, etc.
+
+Usage of key names |<>| |key-notation|
+ Special keys now all have a name like <Up>, <End>, etc.
+ This name can be used in mappings, to make it easy to edit them.
+
+Editing binary files |edit-binary|
+ Vim can edit binary files. You can change a few characters in an
+ executable file, without corrupting it. Vim doesn't remove NUL
+ characters (they are represented as <NL> internally).
+ |-b| command-line argument to start editing a binary file
+ |'binary'| Option set by "-b". Prevents adding an <EOL> for the
+ last line in the file.
+
+Multi-language support |multi-lang|
+ Files in double-byte or multi-byte encodings can be edited. There is
+ UTF-8 support to be able to edit various languages at the same time,
+ without switching fonts. |UTF-8|
+ Messages and menus are available in different languages.
+
+==============================================================================
+5. Other vim features *other-features*
+
+A random collection of nice extra features.
+
+
+When Vim is started with "-s scriptfile", the characters read from
+"scriptfile" are treated as if you typed them. If end of file is reached
+before the editor exits, further characters are read from the console.
+
+The "-w" option can be used to record all typed characters in a script file.
+This file can then be used to redo the editing, possibly on another file or
+after changing some commands in the script file.
+
+The "-o" option opens a window for each argument. "-o4" opens four windows.
+
+Vi requires several termcap entries to be able to work full-screen. Vim only
+requires the "cm" entry (cursor motion).
+
+
+In command mode:
+
+When the 'showcmd' option is set, the command characters are shown in the last
+line of the screen. They are removed when the command is finished.
+
+If the 'ruler' option is set, the current cursor position is shown in the
+last line of the screen.
+
+"U" still works after having moved off the last changed line and after "u".
+
+Characters with the 8th bit set are displayed. The characters between '~' and
+0xa0 are displayed as "~?", "~@", "~A", etc., unless they are included in the
+'isprint' option.
+
+"][" goes to the next ending of a C function ('}' in column 1).
+"[]" goes to the previous ending of a C function ('}' in column 1).
+
+"]f", "[f" and "gf" start editing the file whose name is under the cursor.
+CTRL-W f splits the window and starts editing the file whose name is under
+the cursor.
+
+"*" searches forward for the identifier under the cursor, "#" backward.
+"K" runs the program defined by the 'keywordprg' option, with the identifier
+under the cursor as argument.
+
+"%" can be preceded with a count. The cursor jumps to the line that
+percentage down in the file. The normal "%" function to jump to the matching
+brace skips braces inside quotes.
+
+With the CTRL-] command, the cursor may be in the middle of the identifier.
+
+The used tags are remembered. Commands that can be used with the tag stack
+are CTRL-T, ":pop" and ":tag". ":tags" lists the tag stack.
+
+The 'tags' option can be set to a list of tag file names. Thus multiple
+tag files can be used. For file names that start with "./", the "./" is
+replaced with the path of the current file. This makes it possible to use a
+tags file in the same directory as the file being edited.
+
+Previously used file names are remembered in the alternate file name list.
+CTRL-^ accepts a count, which is an index in this list.
+":files" command shows the list of alternate file names.
+"#<N>" is replaced with the <N>th alternate file name in the list.
+"#<" is replaced with the current file name without extension.
+
+Search patterns have more features. The <NL> character is seen as part of the
+search pattern and the substitute string of ":s". Vi sees it as the end of
+the command.
+
+Searches can put the cursor on the end of a match and may include a character
+offset.
+
+Count added to "~", ":next", ":Next", "n" and "N".
+
+The command ":next!" with 'autowrite' set does not write the file. In vi the
+file was written, but this is considered to be a bug, because one does not
+expect it and the file is not written with ":rewind!".
+
+In Vi when entering a <CR> in replace mode deletes a character only when 'ai'
+is set (but does not show it until you hit <Esc>). Vim always deletes a
+character (and shows it immediately).
+
+Added :wnext command. Same as ":write" followed by ":next".
+
+The ":w!" command always writes, also when the file is write protected. In Vi
+you would have to do ":!chmod +w %" and ":set noro".
+
+When 'tildeop' has been set, "~" is an operator (must be followed by a
+movement command).
+
+With the "J" (join) command you can reset the 'joinspaces' option to have only
+one space after a period (Vi inserts two spaces).
+
+"cw" can be used to change white space formed by several characters (Vi is
+confusing: "cw" only changes one space, while "dw" deletes all white space).
+
+"o" and "O" accept a count for repeating the insert (Vi clears a part of
+display).
+
+Flags after Ex commands not supported (no plans to include it).
+
+On non-UNIX systems ":cd" command shows current directory instead of going to
+the home directory (there isn't one). ":pwd" prints the current directory on
+all systems.
+
+After a ":cd" command the file names (in the argument list, opened files)
+still point to the same files. In Vi ":cd" is not allowed in a changed file;
+otherwise the meaning of file names change.
+
+":source!" command reads Vi commands from a file.
+
+":mkexrc" command writes current modified options and mappings to a ".exrc"
+file. ":mkvimrc" writes to a ".vimrc" file.
+
+No check for "tail recursion" with mappings. This allows things like
+":map! foo ^]foo".
+
+When a mapping starts with number, vi loses the count typed before it (e.g.
+when using the mapping ":map g 4G" the command "7g" goes to line 4). This is
+considered a vi bug. Vim concatenates the counts (in the example it becomes
+"74G"), as most people would expect.
+
+The :put! command inserts the contents of a register above the current line.
+
+The "p" and "P" commands of vi cannot be repeated with "." when the putted
+text is less than a line. In Vim they can always be repeated.
+
+":noremap" command can be used to enter a mapping that will not be remapped.
+This is useful to exchange the meaning of two keys. ":cmap", ":cunmap" and
+":cnoremap" can be used for mapping in command-line editing only. ":imap",
+":iunmap" and ":inoremap" can be used for mapping in insert mode only.
+Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"
+":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".
+
+In Vi the command ":map foo bar" would remove a previous mapping
+":map bug foo". This is considered a bug, so it is not included in Vim.
+":unmap! foo" does remove ":map! bug foo", because unmapping would be very
+difficult otherwise (this is vi compatible).
+
+The ':' register contains the last command-line.
+The '%' register contains the current file name.
+The '.' register contains the last inserted text.
+
+":dis" command shows the contents of the yank registers.
+
+CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the
+same positions as used with the '' command, but may be in another file. The
+":jumps" command lists the older positions.
+
+If the 'shiftround' option is set, an indent is rounded to a multiple of
+'shiftwidth' with ">" and "<" commands.
+
+The 'scrolljump' option can be set to the minimum number of lines to scroll
+when the cursor gets off the screen. Use this when scrolling is slow.
+
+The 'scrolloff' option can be set to the minimum number of lines to keep
+above and below the cursor. This gives some context to where you are
+editing. When set to a large number the cursor line is always in the middle
+of the window.
+
+Uppercase marks can be used to jump between files. The ":marks" command lists
+all currently set marks. The commands "']" and "`]" jump to the end of the
+previous operator or end of the text inserted with the put command. "'[" and
+"`[" do jump to the start.
+
+The 'shelltype' option can be set to reflect the type of shell used on the
+Amiga.
+
+The 'highlight' option can be set for the highlight mode to be used for
+several commands.
+
+The CTRL-A (add) and CTRL-X (subtract) commands are new. The count to the
+command (default 1) is added to/subtracted from the number at or after the
+cursor. That number may be decimal, octal (starts with a '0') or hexadecimal
+(starts with '0x'). Very useful in macros.
+
+With the :set command the prefix "inv" can be used to invert boolean options.
+
+In both Vi and Vim you can create a line break with the ":substitute" command
+by using a CTRL-M. For Vi this means you cannot insert a real CTRL-M in the
+text. With Vim you can put a real CTRL-M in the text by preceding it with a
+CTRL-V.
+
+
+In Insert mode:
+
+If the 'revins' option is set, insert happens backwards. This is for typing
+Hebrew. When inserting normal characters the cursor will not be shifted and
+the text moves rightwards. Backspace, CTRL-W and CTRL-U will also work in
+the opposite direction. CTRL-B toggles the 'revins' option. In replace mode
+'revins' has no effect. Only when enabled at compile time.
+
+The backspace key can be used just like CTRL-D to remove auto-indents.
+
+You can backspace, CTRL-U and CTRL-W over line breaks if the 'backspace' (bs)
+option includes "eol". You can backspace over the start of insert if the
+'backspace' option includes "start".
+
+When the 'paste' option is set, a few option are reset and mapping in insert
+mode and abbreviation are disabled. This allows for pasting text in windowing
+systems without unexpected results. When the 'paste' option is reset, the old
+option values are restored.
+
+CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter
+what column the cursor is in.
+
+CTRL-@ (insert previously inserted text) works always (Vi: only when typed as
+first character).
+
+CTRL-A works like CTRL-@ but does not leave insert mode.
+
+CTRL-R {0-9a-z..} can be used to insert the contents of a register.
+
+When the 'smartindent' option is set, C programs will be better auto-indented.
+With 'cindent' even more.
+
+CTRL-Y and CTRL-E can be used to copy a character from above/below the
+current cursor position.
+
+After CTRL-V you can enter a three digit decimal number. This byte value is
+inserted in the text as a single character. Useful for international
+characters that are not on your keyboard.
+
+When the 'expandtab' (et) option is set, a <Tab> is expanded to the
+appropriate number of spaces.
+
+The window always reflects the contents of the buffer (Vi does not do this
+when changing text and in some other cases).
+
+If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of
+normal digraphs is included. They are shown with the ":digraph" command.
+More can be added with ":digraph {char1}{char2} {number}". A digraph is
+entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when
+'digraph' option is set).
+
+When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin
+for the first insert. Vim does it for all.
+
+A count to the "i" or "a" command is used for all the text. Vi uses the count
+only for one line. "3iabc<NL>def<Esc>" would insert "abcabcabc<NL>def" in Vi
+but "abc<NL>defabc<NL>defabc<NL>def" in Vim.
+
+
+In Command-line mode:
+
+<Esc> terminates the command-line without executing it. In vi the command
+line would be executed, which is not what most people expect (hitting <Esc>
+should always get you back to command mode). To avoid problems with some
+obscure macros, an <Esc> in a macro will execute the command. If you want a
+typed <Esc> to execute the command like vi does you can fix this with
+ ":cmap ^V<Esc> ^V<CR>"
+
+General:
+
+The 'ttimeout' option is like 'timeout', but only works for cursor and
+function keys, not for ordinary mapped characters. The 'timeoutlen' option
+gives the number of milliseconds that is waited for. If the 'esckeys' option
+is not set, cursor and function keys that start with <Esc> are not recognized
+in insert mode.
+
+There is an option for each terminal string. Can be used when termcap is not
+supported or to change individual strings.
+
+The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix"
+<NL> or "mac" <CR>.
+When the 'fileformats' option is not empty, Vim tries to detect the type of
+<EOL> automatically. The 'fileformat' option is set accordingly.
+
+On systems that have no job control (older Unix systems and non-Unix systems)
+the CTRL-Z, ":stop" or ":suspend" command starts a new shell.
+
+If Vim is started on the Amiga without an interactive window for output, a
+window is opened (and :sh still works). You can give a device to use for
+editing with the |-d| argument, e.g. "-d con:20/20/600/150".
+
+The 'columns' and 'lines' options are used to set or get the width and height
+of the display.
+
+Option settings are read from the first and last few lines of the file.
+Option 'modelines' determines how many lines are tried (default is 5). Note
+that this is different from the Vi versions that can execute any Ex command
+in a modeline (a major security problem). |trojan-horse|
+
+If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
+And it comes back there, when pressing <Esc>.
+
+Undo information is kept in memory. Available memory limits the number and
+size of change that can be undone. This may be a problem with MS-DOS, is
+hardly a problem on the Amiga and almost never with Unix and Win32.
+
+If the 'backup' or 'writebackup' option is set: Before a file is overwritten,
+a backup file (.bak) is made. If the "backup" option is set it is left
+behind.
+
+Vim creates a file ending in ".swp" to store parts of the file that have been
+changed or that do not fit in memory. This file can be used to recover from
+an aborted editing session with "vim -r file". Using the swap file can be
+switched off by setting the 'updatecount' option to 0 or starting Vim with
+the "-n" option. Use the 'directory' option for placing the .swp file
+somewhere else.
+
+Vim is able to work correctly on filesystems with 8.3 file names, also when
+using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted
+filesystem under Unix. See |'shortname'|.
+
+Error messages are shown at least one second (Vi overwrites error messages).
+
+If Vim gives the |hit-enter| prompt, you can hit any key. Characters other
+than <CR>, <NL> and <Space> are interpreted as the (start of) a command. (Vi
+only accepts a command starting with ':').
+
+The contents of the numbered and unnamed registers is remembered when
+changing files.
+
+The "No lines in buffer" message is a normal message instead of an error
+message, since that may cause a mapping to be aborted.
+
+The AUX: device of the Amiga is supported.
+
+==============================================================================
+6. Command-line arguments *cmdline-arguments*
+
+Different versions of Vi have different command-line arguments. This can be
+confusing. To help you, this section gives an overview of the differences.
+
+Five variants of Vi will be considered here:
+ Elvis Elvis version 2.1b
+ Nvi Nvi version 1.79
+ Posix Posix 1003.2
+ Vi Vi version 3.7 (for Sun 4.1.x)
+ Vile Vile version 7.4 (incomplete)
+ Vim Vim version 5.2
+
+Only Vim is able to accept options in between and after the file names.
+
++{command} Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}".
+
+- Nvi, Posix, Vi: Run Ex in batch mode.
+ Vim: Read file from stdin (use -s for batch mode).
+
+-- Vim: End of options, only file names are following.
+
+--cmd {command} Vim: execute {command} before sourcing vimrc files.
+
+--echo-wid Vim: GTK+ echoes the Window ID on stdout
+
+--help Vim: show help message and exit.
+
+--literal Vim: take file names literally, don't expand wildcards.
+
+--nofork Vim: same as |-f|
+
+--noplugin[s] Vim: Skip loading plugins.
+
+--remote Vim: edit the files in another Vim server
+
+--remote-expr {expr} Vim: evaluate {expr} in another Vim server
+
+--remote-send {keys} Vim: send {keys} to a Vim server and exit
+
+--remote-silent {file} Vim: edit the files in another Vim server if possible
+
+--remote-wait Vim: edit the files in another Vim server and wait for it
+
+--remote-wait-silent Vim: like --remote-wait, no complaints if not possible
+
+--role {role} Vim: GTK+ 2: set role of main window
+
+--serverlist Vim: Output a list of Vim servers and exit
+
+--servername {name} Vim: Specify Vim server name
+
+--socketid {id} Vim: GTK window socket to run Vim in
+
+--version Vim: show version message and exit.
+
+-? Vile: print usage summary and exit.
+
+-a Elvis: Load all specified file names into a window (use -o for
+ Vim).
+
+-A Vim: Start in Arabic mode (when compiled with Arabic).
+
+-b {blksize} Elvis: Use {blksize} blocksize for the session file.
+-b Vim: set 'binary' mode.
+
+-C Vim: Compatible mode.
+
+-c {command} Elvis, Nvi, Posix, Vim: run {command} as an Ex command after
+ loading the edit buffer.
+ Vim: allow up to 10 "-c" arguments
+
+-d {device} Vim: Use {device} for I/O (Amiga only). {only when compiled
+ without the |+diff| feature}
+-d Vim: start with 'diff' set. |vimdiff|
+
+-dev {device} Vim: Use {device} for I/O (Amiga only).
+
+-D Vim: debug mode.
+
+-e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is
+ called "ex".
+
+-E Vim: Start in improved Ex mode |gQ|, like "exim".
+
+-f Vim: Run GUI in foreground (Amiga: don't open new window).
+-f {session} Elvis: Use {session} as the session file.
+
+-F Vim: Start in Farsi mode (when compiled with Farsi).
+ Nvi: Fast start, don't read the entire file when editing
+ starts.
+
+-G {gui} Elvis: Use the {gui} as user interface.
+
+-g Vim: Start GUI.
+-g N Vile: start editing at line N
+
+-h Vim: Give help message.
+ Vile: edit the help file
+
+-H Vim: start Hebrew mode (when compiled with it).
+
+-i Elvis: Start each window in Insert mode.
+-i {viminfo} Vim: Use {viminfo} for viminfo file.
+
+-L Vim: Same as "-r" (also in some versions of Vi).
+
+-l Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options.
+
+-m Vim: Modifications not allowed to be written, resets 'write'
+ option.
+
+-M Vim: Modifications not allowed, resets 'modifiable' and the
+ 'write' option.
+
+-N Vim: No-compatible mode.
+
+-n Vim: No swap file used.
+
+-nb[args] Vim: open a NetBeans interface connection
+
+-O[N] Vim: Like -o, but use vertically split windows.
+
+-o[N] Vim: Open [N] windows, or one for each file.
+
+-P {parent-title} Win32 Vim: open Vim inside a parent application window
+
+-q {name} Vim: Use {name} for quickfix error file.
+-q{name} Vim: Idem.
+
+-R Elvis, Nvi, Posix, Vile, Vim: Set the 'readonly' option.
+
+-r Elvis, Nvi, Posix, Vi, Vim: Recovery mode.
+
+-S Nvi: Set 'secure' option.
+-S {script} Vim: source script after starting up.
+
+-s Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode.
+ Elvis: Sets the 'safer' option.
+-s {scriptin} Vim: Read from script file {scriptin}; only when not in Ex
+ mode.
+-s {pattern} Vile: search for {pattern}
+
+-t {tag} Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}.
+-t{tag} Vim: Idem.
+
+-T {term} Vim: Set terminal name to {term}.
+
+-u {vimrc} Vim: Read initializations from {vimrc} file.
+
+-U {gvimrc} Vim: Read GUI initializations from {gvimrc} file.
+
+-v Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi
+ terms).
+ Vile: View mode, no changes possible.
+
+-V Elvis, Vim: Verbose mode.
+-V{nr} Vim: Verbose mode with specified level.
+
+-w {size} Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}.
+-w{size} Nvi, Vi: Same as "-w {size}".
+-w {name} Vim: Write to script file {name} (must start with non-digit).
+
+-W {name} Vim: Append to script file {name}.
+
+-x Vi, Vim: Ask for encryption key. See |encryption|.
+
+-X Vim: Don't connect to the X server.
+
+-y Vim: Start in easy mode, like |evim|.
+
+-Z Vim: restricted mode
+
+@{cmdfile} Vile: use {cmdfile} as startup file.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/vim.1 b/runtime/doc/vim.1
new file mode 100644
index 000000000..d1fa54ad7
--- /dev/null
+++ b/runtime/doc/vim.1
@@ -0,0 +1,541 @@
+.TH VIM 1 "2002 Feb 22"
+.SH NAME
+vim \- Vi IMproved, a programmers text editor
+.SH SYNOPSIS
+.br
+.B vim
+[options] [file ..]
+.br
+.B vim
+[options] -
+.br
+.B vim
+[options] \-t tag
+.br
+.B vim
+[options] \-q [errorfile]
+.PP
+.br
+.B ex
+.br
+.B view
+.br
+.B gvim
+.B gview
+.B evim
+.B eview
+.br
+.B rvim
+.B rview
+.B rgvim
+.B rgview
+.SH DESCRIPTION
+.B Vim
+is a text editor that is upwards compatible to Vi.
+It can be used to edit all kinds of plain text.
+It is especially useful for editing programs.
+.PP
+There are a lot of enhancements above Vi: multi level undo,
+multi windows and buffers, syntax highlighting, command line
+editing, filename completion, on-line help, visual selection, etc..
+See ":help vi_diff.txt" for a summary of the differences between
+.B Vim
+and Vi.
+.PP
+While running
+.B Vim
+a lot of help can be obtained from the on-line help system, with the ":help"
+command.
+See the ON-LINE HELP section below.
+.PP
+Most often
+.B Vim
+is started to edit a single file with the command
+.PP
+ vim file
+.PP
+More generally
+.B Vim
+is started with:
+.PP
+ vim [options] [filelist]
+.PP
+If the filelist is missing, the editor will start with an empty buffer.
+Otherwise exactly one out of the following four may be used to choose one or
+more files to be edited.
+.TP 12
+file ..
+A list of filenames.
+The first one will be the current file and read into the buffer.
+The cursor will be positioned on the first line of the buffer.
+You can get to the other files with the ":next" command.
+To edit a file that starts with a dash, precede the filelist with "--".
+.TP
+-
+The file to edit is read from stdin. Commands are read from stderr, which
+should be a tty.
+.TP
+-t {tag}
+The file to edit and the initial cursor position depends on a "tag", a sort
+of goto label.
+{tag} is looked up in the tags file, the associated file becomes the current
+file and the associated command is executed.
+Mostly this is used for C programs, in which case {tag} could be a function
+name.
+The effect is that the file containing that function becomes the current file
+and the cursor is positioned on the start of the function.
+See ":help tag-commands".
+.TP
+-q [errorfile]
+Start in quickFix mode.
+The file [errorfile] is read and the first error is displayed.
+If [errorfile] is omitted, the filename is obtained from the 'errorfile'
+option (defaults to "AztecC.Err" for the Amiga, "errors.err" on other
+systems).
+Further errors can be jumped to with the ":cn" command.
+See ":help quickfix".
+.PP
+.B Vim
+behaves differently, depending on the name of the command (the executable may
+still be the same file).
+.TP 10
+vim
+The "normal" way, everything is default.
+.TP
+ex
+Start in Ex mode.
+Go to Normal mode with the ":vi" command.
+Can also be done with the "-e" argument.
+.TP
+view
+Start in read-only mode. You will be protected from writing the files. Can
+also be done with the "-R" argument.
+.TP
+gvim gview
+The GUI version.
+Starts a new window.
+Can also be done with the "-g" argument.
+.TP
+evim eview
+The GUI version in easy mode.
+Starts a new window.
+Can also be done with the "-y" argument.
+.TP
+rvim rview rgvim rgview
+Like the above, but with restrictions. It will not be possible to start shell
+commands, or suspend
+.B Vim.
+Can also be done with the "-Z" argument.
+.SH OPTIONS
+The options may be given in any order, before or after filenames.
+Options without an argument can be combined after a single dash.
+.TP 12
++[num]
+For the first file the cursor will be positioned on line "num".
+If "num" is missing, the cursor will be positioned on the last line.
+.TP
++/{pat}
+For the first file the cursor will be positioned on the
+first occurrence of {pat}.
+See ":help search-pattern" for the available search patterns.
+.TP
++{command}
+.TP
+-c {command}
+{command} will be executed after the
+first file has been read.
+{command} is interpreted as an Ex command.
+If the {command} contains spaces it must be enclosed in double quotes (this
+depends on the shell that is used).
+Example: Vim "+set si" main.c
+.br
+Note: You can use up to 10 "+" or "-c" commands.
+.TP
+-S {file}
+{file} will be sourced after the first file has been read.
+This is equivalent to -c "source {file}".
+{file} cannot start with '-'.
+If {file} is omitted "Session.vim" is used (only works when -S is the last
+argument).
+.TP
+--cmd {command}
+Like using "-c", but the command is executed just before
+processing any vimrc file.
+You can use up to 10 of these commands, independently from "-c" commands.
+.TP
+-A
+If
+.B Vim
+has been compiled with ARABIC support for editing right-to-left
+oriented files and Arabic keyboard mapping, this option starts
+.B Vim
+in Arabic mode, i.e. 'arabic' is set. Otherwise an error
+message is given and
+.B Vim
+aborts.
+.TP
+-b
+Binary mode.
+A few options will be set that makes it possible to edit a binary or
+executable file.
+.TP
+-C
+Compatible. Set the 'compatible' option.
+This will make
+.B Vim
+behave mostly like Vi, even though a .vimrc file exists.
+.TP
+-d
+Start in diff mode.
+There should be two or three file name arguments.
+.B Vim
+will open all the files and show differences between them.
+Works like vimdiff(1).
+.TP
+-d {device}
+Open {device} for use as a terminal.
+Only on the Amiga.
+Example:
+"\-d con:20/30/600/150".
+.TP
+-D
+Debugging. Go to debugging mode when executing the first command from a
+script.
+.TP
+-e
+Start
+.B Vim
+in Ex mode, just like the executable was called "ex".
+.TP
+-E
+Start
+.B Vim
+in improved Ex mode, just like the executable was called "exim".
+.TP
+-f
+Foreground. For the GUI version,
+.B Vim
+will not fork and detach from the shell it was started in.
+On the Amiga,
+.B Vim
+is not restarted to open a new window.
+This option should be used when
+.B Vim
+is executed by a program that will wait for the edit
+session to finish (e.g. mail).
+On the Amiga the ":sh" and ":!" commands will not work.
+.TP
+--nofork
+Foreground. For the GUI version,
+.B Vim
+will not fork and detach from the shell it was started in.
+.TP
+-F
+If
+.B Vim
+has been compiled with FKMAP support for editing right-to-left
+oriented files and Farsi keyboard mapping, this option starts
+.B Vim
+in Farsi mode, i.e. 'fkmap' and 'rightleft' are set.
+Otherwise an error message is given and
+.B Vim
+aborts.
+.TP
+-g
+If
+.B Vim
+has been compiled with GUI support, this option enables the GUI.
+If no GUI support was compiled in, an error message is given and
+.B Vim
+aborts.
+.TP
+-h
+Give a bit of help about the command line arguments and options.
+After this
+.B Vim
+exits.
+.TP
+-H
+If
+.B Vim
+has been compiled with RIGHTLEFT support for editing right-to-left
+oriented files and Hebrew keyboard mapping, this option starts
+.B Vim
+in Hebrew mode, i.e. 'hkmap' and 'rightleft' are set.
+Otherwise an error message is given and
+.B Vim
+aborts.
+.TP
+-i {viminfo}
+When using the viminfo file is enabled, this option sets the filename to use,
+instead of the default "~/.viminfo".
+This can also be used to skip the use of the .viminfo file, by giving the name
+"NONE".
+.TP
+-L
+Same as -r.
+.TP
+-l
+Lisp mode.
+Sets the 'lisp' and 'showmatch' options on.
+.TP
+-m
+Modifying files is disabled.
+Resets the 'write' option.
+You can still modify the buffer, but writing a file is not possible.
+.TP
+-M
+Modifications not allowed. The 'modifiable' and 'write' options will be unset,
+so that changes are not allowed and files can not be written. Note that these
+options can be set to enable making modifications.
+.TP
+-N
+No-compatible mode. Reset the 'compatible' option.
+This will make
+.B Vim
+behave a bit better, but less Vi compatible, even though a .vimrc file does
+not exist.
+.TP
+-n
+No swap file will be used.
+Recovery after a crash will be impossible.
+Handy if you want to edit a file on a very slow medium (e.g. floppy).
+Can also be done with ":set uc=0".
+Can be undone with ":set uc=200".
+.TP
+-nb
+Become an editor server for NetBeans. See the docs for details.
+.TP
+-o[N]
+Open N windows stacked.
+When N is omitted, open one window for each file.
+.TP
+-O[N]
+Open N windows side by side.
+When N is omitted, open one window for each file.
+.TP
+-R
+Read-only mode.
+The 'readonly' option will be set.
+You can still edit the buffer, but will be prevented from accidently
+overwriting a file.
+If you do want to overwrite a file, add an exclamation mark to the Ex command,
+as in ":w!".
+The -R option also implies the -n option (see below).
+The 'readonly' option can be reset with ":set noro".
+See ":help 'readonly'".
+.TP
+-r
+List swap files, with information about using them for recovery.
+.TP
+-r {file}
+Recovery mode.
+The swap file is used to recover a crashed editing session.
+The swap file is a file with the same filename as the text file with ".swp"
+appended.
+See ":help recovery".
+.TP
+-s
+Silent mode. Only when started as "Ex" or when the "-e" option was given
+before the "-s" option.
+.TP
+-s {scriptin}
+The script file {scriptin} is read.
+The characters in the file are interpreted as if you had typed them.
+The same can be done with the command ":source! {scriptin}".
+If the end of the file is reached before the editor exits, further characters
+are read from the keyboard.
+.TP
+-T {terminal}
+Tells
+.B Vim
+the name of the terminal you are using.
+Only required when the automatic way doesn't work.
+Should be a terminal known
+to
+.B Vim
+(builtin) or defined in the termcap or terminfo file.
+.TP
+-u {vimrc}
+Use the commands in the file {vimrc} for initializations.
+All the other initializations are skipped.
+Use this to edit a special kind of files.
+It can also be used to skip all initializations by giving the name "NONE".
+See ":help initialization" within vim for more details.
+.TP
+-U {gvimrc}
+Use the commands in the file {gvimrc} for GUI initializations.
+All the other GUI initializations are skipped.
+It can also be used to skip all GUI initializations by giving the name "NONE".
+See ":help gui-init" within vim for more details.
+.TP
+-V[N]
+Verbose. Give messages about which files are sourced and for reading and
+writing a viminfo file. The optional number N is the value for 'verbose'.
+Default is 10.
+.TP
+-v
+Start
+.B Vim
+in Vi mode, just like the executable was called "vi". This only has effect
+when the executable is called "ex".
+.TP
+-w {scriptout}
+All the characters that you type are recorded in the file
+{scriptout}, until you exit
+.B Vim.
+This is useful if you want to create a script file to be used with "vim -s" or
+":source!".
+If the {scriptout} file exists, characters are appended.
+.TP
+-W {scriptout}
+Like -w, but an existing file is overwritten.
+.TP
+-x
+Use encryption when writing files. Will prompt for a crypt key.
+.TP
+-X
+Don't connect to the X server. Shortens startup time in a terminal, but the
+window title and clipboard will not be used.
+.TP
+-y
+Start
+.B Vim
+in easy mode, just like the executable was called "evim" or "eview".
+Makes
+.B Vim
+behave like a click-and-type editor.
+.TP
+-Z
+Restricted mode. Works like the executable starts with "r".
+.TP
+--
+Denotes the end of the options.
+Arguments after this will be handled as a file name.
+This can be used to edit a filename that starts with a '-'.
+.TP
+--echo-wid
+GTK GUI only: Echo the Window ID on stdout
+.TP
+--help
+Give a help message and exit, just like "-h".
+.TP
+--literal
+Take file name arguments literally, do not expand wildcards. Not needed on
+Unix, the shell expand wildcards.
+.TP
+--noplugin
+Skip loading plugins. Implied by -u NONE.
+.TP
+--remote
+Connect to a Vim server and make it edit the files given in the rest of the
+arguments. If no server is found a warning is given and the files are edited
+in the current Vim.
+.TP
+--remote-expr {expr}
+Connect to a Vim server, evaluate {expr} in it and print the result on stdout.
+.TP
+--remote-send {keys}
+Connect to a Vim server and send {keys} to it.
+.TP
+--remote-silent
+As --remote, but without the warning when no server is found.
+.TP
+--remote-wait
+As --remote, but Vim does not exit until the files have been edited.
+.TP
+--remote-wait-silent
+As --remote-wait, but without the warning when no server is found.
+.TP
+--serverlist
+List the names of all Vim servers that can be found.
+.TP
+--servername {name}
+Use {name} as the server name. Used for the current Vim, unless used with a
+--remote argument, then it's the name of the server to connect to.
+.TP
+--socketid {id}
+GTK GUI only: Use the GtkPlug mechanism to run gvim in another window.
+.TP
+--version
+Print version information and exit.
+.SH ON-LINE HELP
+Type ":help" in
+.B Vim
+to get started.
+Type ":help subject" to get help on a specific subject.
+For example: ":help ZZ" to get help for the "ZZ" command.
+Use <Tab> and CTRL-D to complete subjects (":help cmdline-completion").
+Tags are present to jump from one place to another (sort of hypertext links,
+see ":help").
+All documentation files can be viewed in this way, for example
+":help syntax.txt".
+.SH FILES
+.TP 15
+/usr/local/lib/vim/doc/*.txt
+The
+.B Vim
+documentation files.
+Use ":help doc-file-list" to get the complete list.
+.TP
+/usr/local/lib/vim/doc/tags
+The tags file used for finding information in the documentation files.
+.TP
+/usr/local/lib/vim/syntax/syntax.vim
+System wide syntax initializations.
+.TP
+/usr/local/lib/vim/syntax/*.vim
+Syntax files for various languages.
+.TP
+/usr/local/lib/vim/vimrc
+System wide
+.B Vim
+initializations.
+.TP
+/usr/local/lib/vim/gvimrc
+System wide gvim initializations.
+.TP
+/usr/local/lib/vim/optwin.vim
+Script used for the ":options" command, a nice way to view and set options.
+.TP
+/usr/local/lib/vim/menu.vim
+System wide menu initializations for gvim.
+.TP
+/usr/local/lib/vim/bugreport.vim
+Script to generate a bug report. See ":help bugs".
+.TP
+/usr/local/lib/vim/filetype.vim
+Script to detect the type of a file by its name. See ":help 'filetype'".
+.TP
+/usr/local/lib/vim/scripts.vim
+Script to detect the type of a file by its contents. See ":help 'filetype'".
+.TP
+/usr/local/lib/vim/*.ps
+Files used for PostScript printing.
+.PP
+For recent info read the VIM home page:
+.br
+<URL:http://www.vim.org/>
+.SH SEE ALSO
+vimtutor(1)
+.SH AUTHOR
+Most of
+.B Vim
+was made by Bram Moolenaar, with a lot of help from others.
+See ":help credits" in
+.B Vim.
+.br
+.B Vim
+is based on Stevie, worked on by: Tim Thompson,
+Tony Andrews and G.R. (Fred) Walter.
+Although hardly any of the original code remains.
+.SH BUGS
+Probably.
+See ":help todo" for a list of known problems.
+.PP
+Note that a number of things that may be regarded as bugs by some, are in fact
+caused by a too-faithful reproduction of Vi's behaviour.
+And if you think other things are bugs "because Vi does it differently",
+you should take a closer look at the vi_diff.txt file (or type :help
+vi_diff.txt when in Vim).
+Also have a look at the 'compatible' and 'cpoptions' options.
diff --git a/runtime/doc/vim.man b/runtime/doc/vim.man
new file mode 100644
index 000000000..593926d51
--- /dev/null
+++ b/runtime/doc/vim.man
@@ -0,0 +1,420 @@
+VIM(1) VIM(1)
+
+
+
+NAME
+ vim - Vi IMproved, a programmers text editor
+
+SYNOPSIS
+ vim [options] [file ..]
+ vim [options] -
+ vim [options] -t tag
+ vim [options] -q [errorfile]
+
+ ex
+ view
+ gvim gview evim eview
+ rvim rview rgvim rgview
+
+DESCRIPTION
+ Vim is a text editor that is upwards compatible to Vi. It can be used
+ to edit all kinds of plain text. It is especially useful for editing
+ programs.
+
+ There are a lot of enhancements above Vi: multi level undo, multi win-
+ dows and buffers, syntax highlighting, command line editing, filename
+ completion, on-line help, visual selection, etc.. See ":help
+ vi_diff.txt" for a summary of the differences between Vim and Vi.
+
+ While running Vim a lot of help can be obtained from the on-line help
+ system, with the ":help" command. See the ON-LINE HELP section below.
+
+ Most often Vim is started to edit a single file with the command
+
+ vim file
+
+ More generally Vim is started with:
+
+ vim [options] [filelist]
+
+ If the filelist is missing, the editor will start with an empty buffer.
+ Otherwise exactly one out of the following four may be used to choose
+ one or more files to be edited.
+
+ file .. A list of filenames. The first one will be the current
+ file and read into the buffer. The cursor will be posi-
+ tioned on the first line of the buffer. You can get to the
+ other files with the ":next" command. To edit a file that
+ starts with a dash, precede the filelist with "--".
+
+ - The file to edit is read from stdin. Commands are read
+ from stderr, which should be a tty.
+
+ -t {tag} The file to edit and the initial cursor position depends on
+ a "tag", a sort of goto label. {tag} is looked up in the
+ tags file, the associated file becomes the current file and
+ the associated command is executed. Mostly this is used
+ for C programs, in which case {tag} could be a function
+ name. The effect is that the file containing that function
+ becomes the current file and the cursor is positioned on
+ the start of the function. See ":help tag-commands".
+
+ -q [errorfile]
+ Start in quickFix mode. The file [errorfile] is read and
+ the first error is displayed. If [errorfile] is omitted,
+ the filename is obtained from the 'errorfile' option
+ (defaults to "AztecC.Err" for the Amiga, "errors.err" on
+ other systems). Further errors can be jumped to with the
+ ":cn" command. See ":help quickfix".
+
+ Vim behaves differently, depending on the name of the command (the exe-
+ cutable may still be the same file).
+
+ vim The "normal" way, everything is default.
+
+ ex Start in Ex mode. Go to Normal mode with the ":vi" command.
+ Can also be done with the "-e" argument.
+
+ view Start in read-only mode. You will be protected from writing
+ the files. Can also be done with the "-R" argument.
+
+ gvim gview
+ The GUI version. Starts a new window. Can also be done with
+ the "-g" argument.
+
+ evim eview
+ The GUI version in easy mode. Starts a new window. Can also
+ be done with the "-y" argument.
+
+ rvim rview rgvim rgview
+ Like the above, but with restrictions. It will not be possi-
+ ble to start shell commands, or suspend Vim. Can also be
+ done with the "-Z" argument.
+
+OPTIONS
+ The options may be given in any order, before or after filenames.
+ Options without an argument can be combined after a single dash.
+
+ +[num] For the first file the cursor will be positioned on line
+ "num". If "num" is missing, the cursor will be positioned
+ on the last line.
+
+ +/{pat} For the first file the cursor will be positioned on the
+ first occurrence of {pat}. See ":help search-pattern" for
+ the available search patterns.
+
+ +{command}
+
+ -c {command}
+ {command} will be executed after the first file has been
+ read. {command} is interpreted as an Ex command. If the
+ {command} contains spaces it must be enclosed in double
+ quotes (this depends on the shell that is used). Example:
+ Vim "+set si" main.c
+ Note: You can use up to 10 "+" or "-c" commands.
+
+ -S {file} {file} will be sourced after the first file has been read.
+ This is equivalent to -c "source {file}". {file} cannot
+ start with '-'. If {file} is omitted "Session.vim" is used
+ (only works when -S is the last argument).
+
+ --cmd {command}
+ Like using "-c", but the command is executed just before
+ processing any vimrc file. You can use up to 10 of these
+ commands, independently from "-c" commands.
+
+ -A If Vim has been compiled with ARABIC support for editing
+ right-to-left oriented files and Arabic keyboard mapping,
+ this option starts Vim in Arabic mode, i.e. 'arabic' is
+ set. Otherwise an error message is given and Vim aborts.
+
+ -b Binary mode. A few options will be set that makes it pos-
+ sible to edit a binary or executable file.
+
+ -C Compatible. Set the 'compatible' option. This will make
+ Vim behave mostly like Vi, even though a .vimrc file
+ exists.
+
+ -d Start in diff mode. There should be two or three file name
+ arguments. Vim will open all the files and show differ-
+ ences between them. Works like vimdiff(1).
+
+ -d {device} Open {device} for use as a terminal. Only on the Amiga.
+ Example: "-d con:20/30/600/150".
+
+ -D Debugging. Go to debugging mode when executing the first
+ command from a script.
+
+ -e Start Vim in Ex mode, just like the executable was called
+ "ex".
+
+ -E Start Vim in improved Ex mode, just like the executable was
+ called "exim".
+
+ -f Foreground. For the GUI version, Vim will not fork and
+ detach from the shell it was started in. On the Amiga, Vim
+ is not restarted to open a new window. This option should
+ be used when Vim is executed by a program that will wait
+ for the edit session to finish (e.g. mail). On the Amiga
+ the ":sh" and ":!" commands will not work.
+
+ --nofork Foreground. For the GUI version, Vim will not fork and
+ detach from the shell it was started in.
+
+ -F If Vim has been compiled with FKMAP support for editing
+ right-to-left oriented files and Farsi keyboard mapping,
+ this option starts Vim in Farsi mode, i.e. 'fkmap' and
+ 'rightleft' are set. Otherwise an error message is given
+ and Vim aborts.
+
+ -g If Vim has been compiled with GUI support, this option
+ enables the GUI. If no GUI support was compiled in, an
+ error message is given and Vim aborts.
+
+ -h Give a bit of help about the command line arguments and
+ options. After this Vim exits.
+
+ -H If Vim has been compiled with RIGHTLEFT support for editing
+ right-to-left oriented files and Hebrew keyboard mapping,
+ this option starts Vim in Hebrew mode, i.e. 'hkmap' and
+ 'rightleft' are set. Otherwise an error message is given
+ and Vim aborts.
+
+ -i {viminfo}
+ When using the viminfo file is enabled, this option sets
+ the filename to use, instead of the default "~/.viminfo".
+ This can also be used to skip the use of the .viminfo file,
+ by giving the name "NONE".
+
+ -L Same as -r.
+
+ -l Lisp mode. Sets the 'lisp' and 'showmatch' options on.
+
+ -m Modifying files is disabled. Resets the 'write' option.
+ You can still modify the buffer, but writing a file is not
+ possible.
+
+ -M Modifications not allowed. The 'modifiable' and 'write'
+ options will be unset, so that changes are not allowed and
+ files can not be written. Note that these options can be
+ set to enable making modifications.
+
+ -N No-compatible mode. Reset the 'compatible' option. This
+ will make Vim behave a bit better, but less Vi compatible,
+ even though a .vimrc file does not exist.
+
+ -n No swap file will be used. Recovery after a crash will be
+ impossible. Handy if you want to edit a file on a very
+ slow medium (e.g. floppy). Can also be done with ":set
+ uc=0". Can be undone with ":set uc=200".
+
+ -nb Become an editor server for NetBeans. See the docs for
+ details.
+
+ -o[N] Open N windows stacked. When N is omitted, open one window
+ for each file.
+
+ -O[N] Open N windows side by side. When N is omitted, open one
+ window for each file.
+
+ -R Read-only mode. The 'readonly' option will be set. You
+ can still edit the buffer, but will be prevented from acci-
+ dently overwriting a file. If you do want to overwrite a
+ file, add an exclamation mark to the Ex command, as in
+ ":w!". The -R option also implies the -n option (see
+ below). The 'readonly' option can be reset with ":set
+ noro". See ":help 'readonly'".
+
+ -r List swap files, with information about using them for
+ recovery.
+
+ -r {file} Recovery mode. The swap file is used to recover a crashed
+ editing session. The swap file is a file with the same
+ filename as the text file with ".swp" appended. See ":help
+ recovery".
+
+ -s Silent mode. Only when started as "Ex" or when the "-e"
+ option was given before the "-s" option.
+
+ -s {scriptin}
+ The script file {scriptin} is read. The characters in the
+ file are interpreted as if you had typed them. The same
+ can be done with the command ":source! {scriptin}". If the
+ end of the file is reached before the editor exits, further
+ characters are read from the keyboard.
+
+ -T {terminal}
+ Tells Vim the name of the terminal you are using. Only
+ required when the automatic way doesn't work. Should be a
+ terminal known to Vim (builtin) or defined in the termcap
+ or terminfo file.
+
+ -u {vimrc} Use the commands in the file {vimrc} for initializations.
+ All the other initializations are skipped. Use this to
+ edit a special kind of files. It can also be used to skip
+ all initializations by giving the name "NONE". See ":help
+ initialization" within vim for more details.
+
+ -U {gvimrc} Use the commands in the file {gvimrc} for GUI initializa-
+ tions. All the other GUI initializations are skipped. It
+ can also be used to skip all GUI initializations by giving
+ the name "NONE". See ":help gui-init" within vim for more
+ details.
+
+ -V[N] Verbose. Give messages about which files are sourced and
+ for reading and writing a viminfo file. The optional num-
+ ber N is the value for 'verbose'. Default is 10.
+
+ -v Start Vim in Vi mode, just like the executable was called
+ "vi". This only has effect when the executable is called
+ "ex".
+
+ -w {scriptout}
+ All the characters that you type are recorded in the file
+ {scriptout}, until you exit Vim. This is useful if you
+ want to create a script file to be used with "vim -s" or
+ ":source!". If the {scriptout} file exists, characters are
+ appended.
+
+ -W {scriptout}
+ Like -w, but an existing file is overwritten.
+
+ -x Use encryption when writing files. Will prompt for a
+ crypt key.
+
+ -X Don't connect to the X server. Shortens startup time in a
+ terminal, but the window title and clipboard will not be
+ used.
+
+ -y Start Vim in easy mode, just like the executable was called
+ "evim" or "eview". Makes Vim behave like a click-and-type
+ editor.
+
+ -Z Restricted mode. Works like the executable starts with
+ "r".
+
+ -- Denotes the end of the options. Arguments after this will
+ be handled as a file name. This can be used to edit a
+ filename that starts with a '-'.
+
+ --echo-wid GTK GUI only: Echo the Window ID on stdout
+
+ --help Give a help message and exit, just like "-h".
+
+ --literal Take file name arguments literally, do not expand wild-
+ cards. Not needed on Unix, the shell expand wildcards.
+
+ --noplugin Skip loading plugins. Implied by -u NONE.
+
+ --remote Connect to a Vim server and make it edit the files given in
+ the rest of the arguments. If no server is found a warning
+ is given and the files are edited in the current Vim.
+
+ --remote-expr {expr}
+ Connect to a Vim server, evaluate {expr} in it and print
+ the result on stdout.
+
+ --remote-send {keys}
+ Connect to a Vim server and send {keys} to it.
+
+ --remote-silent
+ As --remote, but without the warning when no server is
+ found.
+
+ --remote-wait
+ As --remote, but Vim does not exit until the files have
+ been edited.
+
+ --remote-wait-silent
+ As --remote-wait, but without the warning when no server is
+ found.
+
+ --serverlist
+ List the names of all Vim servers that can be found.
+
+ --servername {name}
+ Use {name} as the server name. Used for the current Vim,
+ unless used with a --remote argument, then it's the name of
+ the server to connect to.
+
+ --socketid {id}
+ GTK GUI only: Use the GtkPlug mechanism to run gvim in
+ another window.
+
+ --version Print version information and exit.
+
+ON-LINE HELP
+ Type ":help" in Vim to get started. Type ":help subject" to get help
+ on a specific subject. For example: ":help ZZ" to get help for the
+ "ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmd-
+ line-completion"). Tags are present to jump from one place to another
+ (sort of hypertext links, see ":help"). All documentation files can be
+ viewed in this way, for example ":help syntax.txt".
+
+FILES
+ /usr/local/lib/vim/doc/*.txt
+ The Vim documentation files. Use ":help doc-file-list"
+ to get the complete list.
+
+ /usr/local/lib/vim/doc/tags
+ The tags file used for finding information in the docu-
+ mentation files.
+
+ /usr/local/lib/vim/syntax/syntax.vim
+ System wide syntax initializations.
+
+ /usr/local/lib/vim/syntax/*.vim
+ Syntax files for various languages.
+
+ /usr/local/lib/vim/vimrc
+ System wide Vim initializations.
+
+ /usr/local/lib/vim/gvimrc
+ System wide gvim initializations.
+
+ /usr/local/lib/vim/optwin.vim
+ Script used for the ":options" command, a nice way to
+ view and set options.
+
+ /usr/local/lib/vim/menu.vim
+ System wide menu initializations for gvim.
+
+ /usr/local/lib/vim/bugreport.vim
+ Script to generate a bug report. See ":help bugs".
+
+ /usr/local/lib/vim/filetype.vim
+ Script to detect the type of a file by its name. See
+ ":help 'filetype'".
+
+ /usr/local/lib/vim/scripts.vim
+ Script to detect the type of a file by its contents.
+ See ":help 'filetype'".
+
+ /usr/local/lib/vim/*.ps
+ Files used for PostScript printing.
+
+ For recent info read the VIM home page:
+ <URL:http://www.vim.org/>
+
+SEE ALSO
+ vimtutor(1)
+
+AUTHOR
+ Most of Vim was made by Bram Moolenaar, with a lot of help from others.
+ See ":help credits" in Vim.
+ Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and
+ G.R. (Fred) Walter. Although hardly any of the original code remains.
+
+BUGS
+ Probably. See ":help todo" for a list of known problems.
+
+ Note that a number of things that may be regarded as bugs by some, are
+ in fact caused by a too-faithful reproduction of Vi's behaviour. And
+ if you think other things are bugs "because Vi does it differently",
+ you should take a closer look at the vi_diff.txt file (or type :help
+ vi_diff.txt when in Vim). Also have a look at the 'compatible' and
+ 'cpoptions' options.
+
+
+
+ 2002 Feb 22 VIM(1)
diff --git a/runtime/doc/vim.man.info b/runtime/doc/vim.man.info
new file mode 100755
index 000000000..133f9a0be
--- /dev/null
+++ b/runtime/doc/vim.man.info
Binary files differ
diff --git a/runtime/doc/vim2html.pl b/runtime/doc/vim2html.pl
new file mode 100644
index 000000000..ddb1c4623
--- /dev/null
+++ b/runtime/doc/vim2html.pl
@@ -0,0 +1,229 @@
+#!/usr/bin/env perl
+
+# converts vim documentation to simple html
+# Sirtaj Singh Kang (taj@kde.org)
+
+# Sun Feb 24 14:49:17 CET 2002
+
+use strict;
+use vars qw/%url $date/;
+
+%url = ();
+$date = `date`;
+chop $date;
+
+sub maplink
+{
+ my $tag = shift;
+ if( exists $url{ $tag } ){
+ return $url{ $tag };
+ } else {
+ #warn "Unknown hyperlink target: $tag\n";
+ $tag =~ s/\.txt//;
+ $tag =~ s/</&lt;/g;
+ $tag =~ s/>/&gt;/g;
+ return "<code class=\"badlink\">$tag</code>";
+ }
+}
+
+sub readTagFile
+{
+ my($tagfile) = @_;
+ my( $tag, $file, $name );
+
+ open(TAGS,"$tagfile") || die "can't read tags\n";
+
+ while( <TAGS> ) {
+ next unless /^(\S+)\s+(\S+)\s+/;
+
+ $tag = $1;
+ my $label = $tag;
+ ($file= $2) =~ s/.txt$/.html/g;
+ $label =~ s/\.txt//;
+
+ $url{ $tag } = "<a href=\"$file#".escurl($tag)."\">".esctext($label)."</a>";
+ }
+ close( TAGS );
+}
+
+sub esctext
+{
+ my $text = shift;
+ $text =~ s/&/&amp;/g;
+ $text =~ s/</&lt;/g;
+ $text =~ s/>/&gt;/g;
+ return $text;
+}
+
+sub escurl
+{
+ my $url = shift;
+ $url =~ s/"/%22/g;
+ $url =~ s/~/%7E/g;
+ $url =~ s/</%3C/g;
+ $url =~ s/>/%3E/g;
+ $url =~ s/=/%20/g;
+ $url =~ s/#/%23/g;
+ $url =~ s/\//%2F/g;
+
+ return $url;
+}
+
+sub vim2html
+{
+ my( $infile ) = @_;
+ my( $outfile );
+
+ open(IN, "$infile" ) || die "Couldn't read from $infile: $!.\n";
+
+ ($outfile = $infile) =~ s:.*/::g;
+ $outfile =~ s/\.txt$//g;
+
+ open( OUT, ">$outfile.html" )
+ || die "Couldn't write to $outfile.html: $!.\n";
+ my $head = uc( $outfile );
+
+ print OUT<<EOF;
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>VIM: $outfile</title>
+<link rel="stylesheet" href="vim-stylesheet.css" type="text/css">
+</head>
+<body>
+<h2>$head</h2>
+<pre>
+EOF
+
+ my $inexample = 0;
+ while( <IN> ) {
+ chop;
+ if ( /^\s*[-=]+\s*$/ ) {
+ print OUT "</pre><hr><pre>";
+ next;
+ }
+
+ # examples
+ elsif( /^>$/ || /\s>$/ ) {
+ $inexample = 1;
+ chop;
+ }
+ elsif ( $inexample && /^([<\S])/ ) {
+ $inexample = 0;
+ $_ = $' if $1 eq "<";
+ }
+
+ s/\s+$//g;
+
+ # Various vim highlights. note that < and > have already been escaped
+ # so that HTML doesn't get screwed up.
+
+ my @out = ();
+ # print "Text: $_\n";
+ LOOP:
+ foreach my $token ( split /((?:\|[^\|]+\|)|(?:\*[^\*]+\*))/ ) {
+ if ( $token =~ /^\|([^\|]+)\|/ ) {
+ # link
+ push( @out, "|".maplink( $1 )."|" );
+ next LOOP;
+ }
+ elsif ( $token =~ /^\*([^\*]+)\*/ ) {
+ # target
+ push( @out,
+ "<b class=\"vimtag\">\*<a name=\"".escurl($1)."\">".esctext($1)."<\/a>\*<\/b>");
+ next LOOP;
+ }
+
+ $_ = esctext($token);
+ s/CTRL-(\w+)/<code class="keystroke">CTRL-$1<\/code>/g;
+ # parameter <...>
+ s/&lt;(.*?)&gt;/<code class="special">&lt;$1&gt;<\/code>/g;
+
+ # parameter {...}
+ s/\{([^}]*)\}/<code class="special">{$1}<\/code>/g;
+
+ # parameter [...]
+ s/\[(range|line|count|offset|cmd|[-+]?num)\]/<code class="special">\[$1\]<\/code>/g;
+ # note
+ s/(Note:?)/<code class="note">$1<\/code>/gi;
+
+ # local heading
+ s/^(.*)\~$/<code class="section">$1<\/code>/g;
+ push( @out, $_ );
+ }
+
+ $_ = join( "", @out );
+
+ if( $inexample == 2 ) {
+ print OUT "<code class=\"example\">$_</code>\n";
+ } else {
+ print OUT $_,"\n";
+ }
+
+ $inexample = 2 if $inexample == 1;
+ }
+ print OUT<<EOF;
+</pre>
+<p><i>Generated by vim2html on $date</i></p>
+</body>
+</html>
+EOF
+
+}
+
+sub usage
+{
+die<<EOF;
+vim2html.pl: converts vim documentation to HTML.
+usage:
+
+ vim2html.pl <tag file> <text files>
+EOF
+}
+
+
+
+sub writeCSS
+{
+ open( CSS, ">vim-stylesheet.css" ) || die "Couldn't write stylesheet: $!\n";
+ print CSS<<EOF;
+body { background-color: white; color: black;}
+:link { color: rgb(0,137,139); }
+:visited { color: rgb(0,100,100);
+ background-color: white; /* should be inherit */ }
+:active { color: rgb(0,200,200);
+ background-color: white; /* should be inherit */ }
+
+B.vimtag { color : rgb(250,0,250); }
+
+h1, h2 { color: rgb(82,80,82); text-align: center; }
+h3, h4, h5, h6 { color: rgb(82,80,82); }
+.headline { color: rgb(0,137,139); }
+.header { color: rgb(164, 32, 246); }
+.section { color: rgb(164, 32, 246); }
+.keystroke { color: rgb(106, 89, 205); }
+.vim { }
+.example { color: rgb(0, 0, 255); }
+.option { }
+.notvi { }
+.special { color: rgb(106, 89, 205); }
+.note { color: blue; background-color: yellow; }
+.sub {}
+.badlink { color: rgb(0,37,39); }
+EOF
+
+}
+
+# main
+usage() if $#ARGV < 2;
+
+print "Processing tags...\n";
+readTagFile( $ARGV[ 0 ] );
+
+foreach my $file ( 1..$#ARGV ) {
+ print "Processing ".$ARGV[ $file ]."...\n";
+ vim2html( $ARGV[ $file ] );
+}
+print "Writing stylesheet...\n";
+writeCSS();
+print "done.\n"
diff --git a/runtime/doc/vimdiff.1 b/runtime/doc/vimdiff.1
new file mode 100644
index 000000000..e48728412
--- /dev/null
+++ b/runtime/doc/vimdiff.1
@@ -0,0 +1,46 @@
+.TH VIMDIFF 1 "2001 March 30"
+.SH NAME
+vimdiff \- edit two or three versions of a file with Vim and show differences
+.SH SYNOPSIS
+.br
+.B vimdiff
+[options] file1 file2 [file3]
+.PP
+.B gvimdiff
+.SH DESCRIPTION
+.B Vimdiff
+starts
+.B Vim
+on two (or three) files.
+Each file gets its own window.
+The differences between the files are highlighted.
+This is a nice way to inspect changes and to move changes from one version
+to another version of the same file.
+.PP
+See vim(1) for details about Vim itself.
+.PP
+When started as
+.B gvimdiff
+the GUI will be started, if available.
+.PP
+In each window the 'diff' option will be set, which causes the differences
+to be highlighted.
+.br
+The 'wrap' and 'scrollbind' options are set to make the text look good.
+.br
+The 'foldmethod' option is set to "diff", which puts ranges of lines without
+changes in a fold. 'foldcolumn' is set to two to make it easy to spot the
+folds and open or close them.
+.SH OPTIONS
+Vertical splits are used to align the lines, as if the "-O" argument was used.
+To use horizontal splits intead, use the "-o" argument.
+.PP
+For all other arguments see vim(1).
+.SH SEE ALSO
+vim(1)
+.SH AUTHOR
+Most of
+.B Vim
+was made by Bram Moolenaar, with a lot of help from others.
+See ":help credits" in
+.B Vim.
diff --git a/runtime/doc/vimdiff.man b/runtime/doc/vimdiff.man
new file mode 100644
index 000000000..771ce9d0e
--- /dev/null
+++ b/runtime/doc/vimdiff.man
@@ -0,0 +1,66 @@
+
+
+
+VIMDIFF(1) VIMDIFF(1)
+
+
+NAME
+ vimdiff - edit two or three versions of a file with Vim
+ and show differences
+
+SYNOPSIS
+ vimdiff [options] file1 file2 [file3]
+
+ gvimdiff
+
+DESCRIPTION
+ Vimdiff starts Vim on two (or three) files. Each file
+ gets its own window. The differences between the files
+ are highlighted. This is a nice way to inspect changes
+ and to move changes from one version to another version of
+ the same file.
+
+ See vim(1) for details about Vim itself.
+
+ When started as gvimdiff the GUI will be started, if
+ available.
+
+ In each window the 'diff' option will be set, which causes
+ the differences to be highlighted.
+ The 'wrap' and 'scrollbind' options are set to make the
+ text look good.
+ The 'foldmethod' option is set to "diff", which puts
+ ranges of lines without changes in a fold. 'foldcolumn'
+ is set to two to make it easy to spot the folds and open
+ or close them.
+
+OPTIONS
+ Vertical splits are used to align the lines, as if the
+ "-O" argument was used. To use horizontal splits intead,
+ use the "-o" argument.
+
+ For all other arguments see vim(1).
+
+SEE ALSO
+ vim(1)
+
+AUTHOR
+ Most of Vim was made by Bram Moolenaar, with a lot of help
+ from others. See ":help credits" in Vim.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2001 March 30 1
+
+
diff --git a/runtime/doc/vimtutor.1 b/runtime/doc/vimtutor.1
new file mode 100644
index 000000000..4b5aea64d
--- /dev/null
+++ b/runtime/doc/vimtutor.1
@@ -0,0 +1,54 @@
+.TH VIMTUTOR 1 "2001 April 2"
+.SH NAME
+vimtutor \- the Vim tutor
+.SH SYNOPSIS
+.br
+.B vimtutor [language]
+.SH DESCRIPTION
+.B Vimtutor
+starts the
+.B Vim
+tutor.
+It copies the tutor file first, so that it can be modified without changing
+the original file.
+.PP
+The
+.B Vimtutor
+is useful for people that want to learn their first
+.B Vim
+commands.
+.PP
+The optional [language] argument is the two-letter name of a language, like
+"it" or "es".
+If the [language] argument is missing, the language of the current locale will
+be used.
+If a tutor in this language is available, it will be used.
+Otherwise the English version will be used.
+.PP
+.B Vim
+is always started in Vi compatible mode.
+.SH FILES
+.TP 15
+/usr/local/lib/vim/tutor/tutor[.language]
+The
+.B Vimtutor
+text file(s).
+.TP 15
+/usr/local/lib/vim/tutor/tutor.vim
+The Vim script used to copy the
+.B Vimtutor
+text file.
+.SH AUTHOR
+The
+.B Vimtutor
+was originally written for Vi by Michael C. Pierce and Robert K. Ware,
+Colorado School of Mines using ideas supplied by Charles Smith,
+Colorado State University.
+E-mail: bware@mines.colorado.edu.
+.br
+It was modified for
+.B Vim
+by Bram Moolenaar.
+For the names of the translators see the tutor files.
+.SH SEE ALSO
+vim(1)
diff --git a/runtime/doc/vimtutor.man b/runtime/doc/vimtutor.man
new file mode 100644
index 000000000..c36b1c185
--- /dev/null
+++ b/runtime/doc/vimtutor.man
@@ -0,0 +1,66 @@
+
+
+
+VIMTUTOR(1) VIMTUTOR(1)
+
+
+NAME
+ vimtutor - the Vim tutor
+
+SYNOPSIS
+ vimtutor [language]
+
+DESCRIPTION
+ Vimtutor starts the Vim tutor. It copies the tutor file
+ first, so that it can be modified without changing the
+ original file.
+
+ The Vimtutor is useful for people that want to learn their
+ first Vim commands.
+
+ The optional [language] argument is the two-letter name of
+ a language, like "it" or "es". If the [language] argument
+ is missing, the language of the current locale will be
+ used. If a tutor in this language is available, it will
+ be used. Otherwise the English version will be used.
+
+ Vim is always started in Vi compatible mode.
+
+FILES
+ /usr/local/lib/vim/tutor/tutor[.language]
+ The Vimtutor text file(s).
+
+ /usr/local/lib/vim/tutor/tutor.vim
+ The Vim script used to copy the Vimtutor
+ text file.
+
+AUTHOR
+ The Vimtutor was originally written for Vi by Michael C.
+ Pierce and Robert K. Ware, Colorado School of Mines using
+ ideas supplied by Charles Smith, Colorado State Univer-
+ sity. E-mail: bware@mines.colorado.edu.
+ It was modified for Vim by Bram Moolenaar. For the names
+ of the translators see the tutor files.
+
+SEE ALSO
+ vim(1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2001 April 2 1
+
+
diff --git a/runtime/doc/visual.txt b/runtime/doc/visual.txt
new file mode 100644
index 000000000..410057838
--- /dev/null
+++ b/runtime/doc/visual.txt
@@ -0,0 +1,487 @@
+*visual.txt* For Vim version 7.0aa. Last change: 2004 Jun 08
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Visual mode *Visual* *Visual-mode* *visual-mode*
+
+Visual mode is a flexible and easy way to select a piece of text for an
+operator. It is the only way to select a block of text.
+
+This is introduced in section |04.4| of the user manual.
+
+1. Using Visual mode |visual-use|
+2. Starting and stopping Visual mode |visual-start|
+3. Changing the Visual area |visual-change|
+4. Operating on the Visual area |visual-operators|
+5. Blockwise operators |blockwise-operators|
+6. Repeating |visual-repeat|
+7. Examples |visual-examples|
+8. Select mode |Select-mode|
+
+{Vi has no Visual mode, the name "visual" is used for Normal mode, to
+distinguish it from Ex mode}
+{not available when the |+visual| feature was disabled when compiling}
+
+==============================================================================
+1. Using Visual mode *visual-use*
+
+Using Visual mode consists of three parts:
+1. Mark the start of the text with "v", "V" or CTRL-V.
+ The character under the cursor will be used as the start.
+2. Move to the end of the text.
+ The text from the start of the Visual mode up to and including the
+ character under the cursor is highlighted.
+3. Type an operator command.
+ The highlighted characters will be operated upon.
+
+The 'highlight' option can be used to set the display mode to use for
+highlighting in Visual mode.
+The 'virtualedit' option can be used to allow positioning the cursor to
+positions where there is no actual character.
+
+The highlighted text normally includes the character under the cursor.
+However, when the 'selection' option is set to "exclusive" and the cursor is
+after the Visual area, the character under the cursor is not included.
+
+With "v" the text before the start position and after the end position will
+not be highlighted. However, All uppercase and non-alpha operators, except
+"~" and "U", will work on whole lines anyway. See the list of operators
+below.
+
+ *visual-block*
+With CTRL-V (blockwise Visual mode) the highlighted text will be a rectangle
+between start position and the cursor. However, some operators work on whole
+lines anyway (see the list below). The change and substitute operators will
+delete the highlighted text and then start insertion at the top left
+position.
+
+==============================================================================
+2. Starting and stopping Visual mode *visual-start*
+
+ *v* *characterwise-visual*
+v start Visual mode per character.
+
+ *V* *linewise-visual*
+V start Visual mode linewise.
+
+ *CTRL-V* *blockwise-visual*
+CTRL-V start Visual mode blockwise. Note: Under Windows
+ CTRL-V could be mapped to paste text, it doesn't work
+ to start Visual mode then, see |CTRL-V-alternative|.
+
+If you use <Esc>, click the left mouse button or use any command that
+does a jump to another buffer while in Visual mode, the highlighting stops
+and no text is affected. Also when you hit "v" in characterwise Visual mode,
+"CTRL-V" in blockwise Visual mode or "V" in linewise Visual mode. If you hit
+CTRL-Z the highlighting stops and the editor is suspended or a new shell is
+started |CTRL-Z|.
+
+ new mode after typing: *v_v* *v_CTRL-V* *v_V*
+old mode "v" "CTRL-V" "V" ~
+
+Normal Visual blockwise Visual linewise Visual
+Visual Normal blockwise Visual linewise Visual
+blockwise Visual Visual Normal linewise Visual
+linewise Visual Visual blockwise Visual Normal
+
+ *gv* *v_gv*
+gv Start Visual mode with the same area as the previous
+ area and the same mode. In Visual mode the current and
+ the previous Visual area are exchanged.
+
+ *<LeftMouse>*
+<LeftMouse> Set the current cursor position. If Visual mode is
+ active it is stopped. Only when 'mouse' option is
+ contains 'n' or 'a'. If the position is within 'so'
+ lines from the last line on the screen the text is
+ scrolled up. If the position is within 'so' lines from
+ the first line on the screen the text is scrolled
+ down.
+
+ *<RightMouse>*
+<RightMouse> Start Visual mode if it is not active. The text from
+ the cursor position to the position of the click is
+ highlighted. If Visual mode was already active move
+ the start or end of the highlighted text, which ever
+ is closest, to the position of the click. Only when
+ 'mouse' option contains 'n' or 'a'.
+
+ Note: when 'mousemodel' is set to "popup",
+ <S-LeftMouse> has to be used instead of <RightMouse>.
+
+ *<LeftRelease>*
+<LeftRelease> This works like a <LeftMouse>, if it is not at
+ the same position as <LeftMouse>. In an older version
+ of xterm you won't see the selected area until the
+ button is released, unless there is access to the
+ display where the xterm is running (via the DISPLAY
+ environment variable or the -display argument). Only
+ when 'mouse' option contains 'n' or 'a'.
+
+If Visual mode is not active and the "v", "V" or CTRL-V is preceded with a
+count, the size of the previously highlighted area is used for a start. You
+can then move the end of the highlighted area and give an operator. The type
+of the old area is used (character, line or blockwise).
+- Linewise Visual mode: The number of lines is multiplied with the count.
+- Blockwise Visual mode: The number of lines and columns is multiplied with
+ the count.
+- Normal Visual mode within one line: The number of characters is multiplied
+ with the count.
+- Normal Visual mode with several lines: The number of lines is multiplied
+ with the count, in the last line the same number of characters is used as
+ in the last line in the previously highlighted area.
+The start of the text is the Cursor position. If the "$" command was used as
+one of the last commands to extend the highlighted text, the area will be
+extended to the rightmost column of the longest line.
+
+If you want to highlight exactly the same area as the last time, you can use
+"gv" |gv| |v_gv|.
+
+ *v_CTRL-C*
+CTRL-C In Visual mode: Stop Visual mode. When insert mode is
+ pending (the mode message shows
+ "-- (insert) VISUAL --"), it is also stopped.
+
+==============================================================================
+3. Changing the Visual area *visual-change*
+
+ *v_o*
+o Go to Other end of highlighted text: The current
+ cursor position becomes the start of the highlighted
+ text and the cursor is moved to the other end of the
+ highlighted text. The highlighted area remains the
+ same.
+
+ *v_O*
+O Go to Other end of highlighted text. This is like
+ "o", but in Visual block mode the cursor moves to the
+ other corner in the same line. When the corner is at
+ a character that occupies more than one position on
+ the screen (e.g., a <Tab>), the highlighted text may
+ change.
+
+ *v_$*
+When the "$" command is used with blockwise Visual mode, the right end of the
+highlighted text will be determined by the longest highlighted line. This
+stops when a motion command is used that does not move straight up or down.
+
+For moving the end of the block many commands can be used, but you cannot
+use Ex commands, commands that make changes or abandon the file. Commands
+(starting with) ".pPiIaAO&", CTRL-^, "Z", CTRL-], CTRL-T, CTRL-R, CTRL-I
+and CTRL-O cause a beep and Visual mode continues.
+
+When switching to another window on the same buffer, the cursor position in
+that window is adjusted, so that the same Visual area is still selected. This
+is especially useful to view the start of the Visual area in one window, and
+the end in another. You can then use <RightMouse> (or <S-LeftMouse> when
+'mousemodel' is "popup") to move either end of the Visual area.
+
+==============================================================================
+4. Operating on the Visual area *visual-operators*
+
+The operators that can be used are:
+ ~ switch case |v_~|
+ d delete |v_d|
+ c change (4) |v_c|
+ y yank |v_y|
+ > shift right (4) |v_>|
+ < shift left (4) |v_<|
+ ! filter through external command (1) |v_!|
+ = filter through 'equalprg' option command (1) |v_=|
+ gq format lines to 'textwidth' length (1) |v_gq|
+
+The objects that can be used are:
+ aw a word (with white space) |v_aw|
+ iw inner word |v_iw|
+ aW a WORD (with white space) |v_aW|
+ iW inner WORD |v_iW|
+ as a sentence (with white space) |v_as|
+ is inner sentence |v_is|
+ ap a paragraph (with white space) |v_ap|
+ ip inner paragraph |v_ip|
+ ab a () block (with parenthesis) |v_ab|
+ ib inner () block |v_ib|
+ aB a {} block (with braces) |v_aB|
+ iB inner {} block |v_iB|
+ a< a <> block (with <>) |v_a<|
+ i< inner <> block |v_i<|
+ a[ a [] block (with []) |v_a[|
+ i[ inner [] block |v_i[|
+
+Additionally the following commands can be used:
+ : start ex command for highlighted lines (1) |v_:|
+ r change (4) |v_r|
+ s change |v_s|
+ C change (2)(4) |v_C|
+ S change (2) |v_S|
+ R change (2) |v_R|
+ x delete |v_x|
+ D delete (3) |v_D|
+ X delete (2) |v_X|
+ Y yank (2) |v_Y|
+ p put |v_p|
+ J join (1) |v_J|
+ U make uppercase |v_U|
+ u make lowercase |v_u|
+ ^] find tag |v_CTRL-]|
+ I block insert |v_b_I|
+ A block append |v_b_A|
+
+(1): Always whole lines, see |:visual_example|.
+(2): Whole lines when not using CTRL-V.
+(3): Whole lines when not using CTRL-V, delete until the end of the line when
+ using CTRL-V.
+(4): When using CTRL-V operates on the block only.
+
+Note that the ":vmap" command can be used to specifically map keys in Visual
+mode. For example, if you would like the "/" command not to extend the Visual
+area, but instead take the highlighted text and search for that: >
+ :vmap / y/<C-R>"<CR>
+(In the <> notation |<>|, when typing it you should type it literally; you
+need to remove the 'B' and '<' flags from 'cpoptions'.)
+
+If you want to give a register name using the """ command, do this just before
+typing the operator character: "v{move-around}"xd".
+
+If you want to give a count to the command, do this just before typing the
+operator character: "v{move-around}3>" (move lines 3 indents to the right).
+
+ *{move-around}*
+The {move-around} is any sequence of movement commands. Note the difference
+with {motion}, which is only ONE movement command.
+
+==============================================================================
+5. Blockwise operators *blockwise-operators*
+
+{not available when compiled without the |+visualextra| feature}
+
+Reminder: Use 'virtualedit' to be able to select blocks that start or end
+after the end of a line or halfway a tab.
+
+Visual-block Insert *v_b_I*
+With a blockwise selection, I{string}<ESC> will insert {string} at the start
+of block on every line of the block, provided that the line extends into the
+block. Thus lines that are short will remain unmodified. TABs are split to
+retain visual columns.
+See |v_b_I_example|.
+
+Visual-block Append *v_b_A*
+With a blockwise selection, A{string}<ESC> will append {string} to the end of
+block on every line of the block. There is some differing behavior where the
+block RHS is not straight, due to different line lengths:
+
+1. Block was created with <C-v>$
+ In this case the string is appended to the end of each line.
+2. Block was created with <C-v>{move-around}
+ In this case the string is appended to the end of the block on each line,
+ and whitespace is inserted to pad to the end-of-block column.
+See |v_b_A_example|.
+Note: "I" and "A" behave differently for lines that don't extend into the
+selected block. This was done intentionally, so that you can do it the way
+you want.
+
+Visual-block change *v_b_c*
+All selected text in the block will be replaced by the same text string. When
+using "c" the selected text is deleted and Insert mode started. You can then
+enter text (without a line break). When you hit <Esc>, the same string is
+inserted in all previously selected lines.
+
+Visual-block Change *v_b_C*
+Like using "c", but the selection is extended until the end of the line for
+all lines.
+
+ *v_b_<*
+Visual-block Shift *v_b_>*
+The block is shifted by 'shiftwidth'. The RHS of the block is irrelevant. The
+LHS of the block determines the point from which to apply a right shift, and
+padding includes TABs optimally according to 'ts' and 'et'. The LHS of the
+block determines the point upto which to shift left.
+ Note: v_< padding is buggy if the Visual Block starts and ends in the same
+ TAB. (Vim 5.4c).
+See |v_b_>_example|.
+See |v_b_<_example|.
+
+Visual-block Replace *v_b_r*
+Every screen char in the highlighted region is replaced with the same char, ie
+TABs are split and the virtual whitespace is replaced, maintaining screen
+layout.
+See |v_b_r_example|.
+
+
+==============================================================================
+6. Repeating *visual-repeat*
+
+When repeating a Visual mode operator, the operator will be applied to the
+same amount of text as the last time:
+- Linewise Visual mode: The same number of lines.
+- Blockwise Visual mode: The same number of lines and columns.
+- Normal Visual mode within one line: The same number of characters.
+- Normal Visual mode with several lines: The same number of lines, in the
+ last line the same number of characters as in the last line the last time.
+The start of the text is the Cursor position. If the "$" command was used as
+one of the last commands to extend the highlighted text, the repeating will
+be applied up to the rightmost column of the longest line.
+
+
+==============================================================================
+7. Examples *visual-examples*
+
+ *:visual_example*
+Currently the ":" command works on whole lines only. When you select part of
+a line, doing something like ":!date" will replace the whole line. If you
+want only part of the line to be replaced you will have to make a mapping for
+it. In a future release ":" may work on partial lines.
+
+Here is an example, to replace the selected text with the output of "date": >
+ :vmap _a <Esc>`>a<CR><Esc>`<i<CR><Esc>!!date<CR>kJJ
+
+(In the <> notation |<>|, when typing it you should type it literally; you
+need to remove the 'B' and '<' flags from 'cpoptions')
+
+What this does is:
+<Esc> stop Visual mode
+`> go to the end of the Visual area
+a<CR><Esc> break the line after the Visual area
+`< jump to the start of the Visual area
+i<CR><Esc> break the line before the Visual area
+!!date<CR> filter the Visual text through date
+kJJ Join the lines back together
+
+ *visual-search*
+Here is an idea for a mapping that makes it possible to do a search for the
+selected text: >
+ :vmap X y/<C-R>"<CR>
+
+(In the <> notation |<>|, when typing it you should type it literally; you
+need to remove the 'B' and '<' flags from 'cpoptions')
+
+Note that special characters (like '.' and '*') will cause problems.
+
+Visual-block Examples *blockwise-examples*
+With the following text, I will indicate the commands to produce the block and
+the results below. In all cases, the cursor begins on the 'a' in the first
+line if the test text.
+The following modeline settings are assumed ":ts=8:sw=4:".
+
+It will be helpful to
+:set hls
+/<TAB>
+where <TAB> is a real TAB. This helps visualise the operations.
+
+The test text is:
+
+abcdefghijklmnopqrstuvwxyz
+abc defghijklmnopqrstuvwxyz
+abcdef ghi jklmnopqrstuvwxyz
+abcdefghijklmnopqrstuvwxyz
+
+1. fo<C-v>3jISTRING<ESC> *v_b_I_example*
+
+abcdefghijklmnSTRINGopqrstuvwxyz
+abc STRING defghijklmnopqrstuvwxyz
+abcdef ghi STRING jklmnopqrstuvwxyz
+abcdefghijklmnSTRINGopqrstuvwxyz
+
+2. fo<C-v>3j$ASTRING<ESC> *v_b_A_example*
+
+abcdefghijklmnopqrstuvwxyzSTRING
+abc defghijklmnopqrstuvwxyzSTRING
+abcdef ghi jklmnopqrstuvwxyzSTRING
+abcdefghijklmnopqrstuvwxyzSTRING
+
+3. fo<C-v>3j3l<.. *v_b_<_example*
+
+abcdefghijklmnopqrstuvwxyz
+abc defghijklmnopqrstuvwxyz
+abcdef ghi jklmnopqrstuvwxyz
+abcdefghijklmnopqrstuvwxyz
+
+4. fo<C-v>3j>.. *v_b_>_example*
+
+abcdefghijklmn opqrstuvwxyz
+abc defghijklmnopqrstuvwxyz
+abcdef ghi jklmnopqrstuvwxyz
+abcdefghijklmn opqrstuvwxyz
+
+5. fo<C-v>5l3jrX *v_b_r_example*
+
+abcdefghijklmnXXXXXXuvwxyz
+abc XXXXXXhijklmnopqrstuvwxyz
+abcdef ghi XXXXXX jklmnopqrstuvwxyz
+abcdefghijklmnXXXXXXuvwxyz
+
+==============================================================================
+8. Select mode *Select* *Select-mode*
+
+Select mode looks like Visual mode, but the commands accepted are quite
+different. This resembles the selection mode in Microsoft Windows.
+When the 'showmode' option is set, "-- SELECT --" is shown in the last line.
+
+Entering Select mode:
+- Using the mouse to select an area, and 'selectmode' contains "mouse".
+ 'mouse' must also contain a flag for the current mode.
+- Using a non-printable movement command, with the Shift key pressed, and
+ 'selectmode' contains "key". For example: <S-Left> and <S-End>. 'keymodel'
+ must also contain "startsel".
+- Using "v", "V" or CTRL-V command, and 'selectmode' contains "cmd".
+- Using "gh", "gH" or "g_CTRL-H" command in Normal mode.
+- From Visual mode, press CTRL-G. *v_CTRL-G*
+
+Commands in Select mode:
+- Printable characters, <NL> and <CR> cause the selection to be deleted, and
+ Vim enters Insert mode. The typed character is inserted.
+- Non-printable movement commands, with the Shift key pressed, extend the
+ selection. 'keymodel' must include "startsel".
+- Non-printable movement commands, with the Shift key NOT pressed, stop Select
+ mode. 'keymodel' must include "stopsel".
+- ESC stops Select mode.
+- CTRL-O switches to Visual mode for the duration of one command. *v_CTRL-O*
+- CTRL-G switches to Visual mode.
+
+Otherwise, typed characters are handled as in Visual mode.
+
+When using an operator in Select mode, and the selection is linewise, the
+selected lines are operated upon, but like in characterwise selection. For
+example, when a whole line is deleted, it can later be pasted halfway a line.
+
+
+Mappings and menus in Select mode. *Select-mode-mapping*
+
+In Select mode the mappings and menus of Visual mode are used. Before it is
+executed, Vim automatically switches to Visual mode, so that the same
+behavior as in Visual mode is effective.
+
+After the mapping or menu finishes, the selection is enabled again and Select
+mode entered, unless the selected area was deleted, another buffer became
+the current one or the window layout was changed.
+
+When a character was typed that causes the selection to be deleted and Insert
+mode started, Insert mode mappings are applied to this character. This may
+cause some confusion, because it means Insert mode mappings apply to a
+character typed in Select mode. Language mappings apply as well.
+
+ *gV* *v_gV*
+gV Avoid the automatic reselection of the Visual area
+ after a Select mode mapping or menu has finished.
+ Put this just before the end of the mapping or menu.
+ At least it should be after any operations on the
+ selection.
+
+ *gh*
+gh Start Select mode, characterwise. This is like "v",
+ but starts Select mode instead of Visual mode.
+ Mnemonic: "get highlighted".
+
+ *gH*
+gH Start Select mode, linewise. This is like "V",
+ but starts Select mode instead of Visual mode.
+ Mnemonic: "get Highlighted".
+
+ *g_CTRL-H*
+g CTRL-H Start Select mode, blockwise. This is like CTRL-V,
+ but starts Select mode instead of Visual mode.
+ Mnemonic: "get Highlighted".
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
new file mode 100644
index 000000000..69f37c943
--- /dev/null
+++ b/runtime/doc/windows.txt
@@ -0,0 +1,1123 @@
+*windows.txt* For Vim version 7.0aa. Last change: 2004 Apr 29
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+
+
+Editing with multiple windows and buffers. *windows* *buffers*
+
+The commands which have been added to use multiple windows and buffers are
+explained here. Additionally, there are explanations for commands that work
+differently when used in combination with more than one window.
+
+The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt|
+|usr_08.txt|.
+
+1. Introduction |windows-intro|
+2. Starting Vim |windows-starting|
+3. Opening and closing a window |opening-window|
+4. Moving cursor to other windows |window-move-cursor|
+5. Moving windows around |window-moving|
+6. Window resizing |window-resize|
+7. Argument and buffer list commands |buffer-list|
+8. Do a command in all buffers or windows |list-repeat|
+9. Tag or file name under the cursor |window-tag|
+10. The preview window |preview-window|
+11. Using hidden buffers |buffer-hidden|
+12. Special kinds of buffers |special-buffers|
+
+{Vi does not have any of these commands}
+{not able to use multiple windows when the |+windows| feature was disabled at
+compile time}
+{not able to use vertically split windows when the |+vertsplit| feature was
+disabled at compile time}
+
+==============================================================================
+1. Introduction *windows-intro*
+
+A window is a viewport onto a buffer. You can use multiple windows on one
+buffer, or several windows on different buffers.
+
+A buffer is a file loaded into memory for editing. The original file remains
+unchanged until you write the buffer to the file.
+
+A buffer can be in one of three states:
+
+ *active-buffer*
+active: The buffer is displayed in a window. If there is a file for this
+ buffer, it has been read into the buffer. The buffer may have been
+ modified since then and thus be different from the file.
+ *hidden-buffer*
+hidden: The buffer is not displayed. If there is a file for this buffer, it
+ has been read into the buffer. Otherwise it's the same as an active
+ buffer, you just can't see it.
+ *inactive-buffer*
+inactive: The buffer is not displayed and does not contain anything. Options
+ for the buffer are remembered if the file was once loaded. It can
+ contain marks from the |viminfo| file. But the buffer doesn't
+ contain text.
+
+In a table:
+
+state displayed loaded ":buffers" ~
+ in window shows ~
+active yes yes 'a'
+hidden no yes 'h'
+inactive no no ' '
+
+Note: All CTRL-W commands can also be executed with |:wincmd|, for those
+places where a Normal mode command can't be used or is inconvenient.
+
+==============================================================================
+2. Starting Vim *windows-starting*
+
+By default, Vim starts with one window, just like Vi.
+
+The "-o" and "-O" arguments to Vim can be used to open a window for each file
+in the argument list. The "-o" argument will split the windows horizontally;
+the "-O" argument will split the windows vertically. If both "-o" and "-O"
+are given, the last one encountered will be used to determine the split
+orientation. For example, this will open three windows, split horizontally: >
+ vim -o file1 file2 file3
+
+"-oN", where N is a decimal number, opens N windows split horizontally. If
+there are more file names than windows, only N windows are opened and some
+files do not get a window. If there are more windows than file names, the
+last few windows will be editing empty buffers. Similarly, "-ON" opens N
+windows split vertically, with the same restrictions.
+
+If there are many file names, the windows will become very small. You might
+want to set the 'winheight' and/or 'winwidth' options to create a workable
+situation.
+
+Buf/Win Enter/Leave |autocommand|s are not executed when opening the new
+windows and reading the files, that's only done when they are really entered.
+
+ *status-line*
+A status line will be used to separate windows. The 'laststatus' option tells
+when the last window also has a status line:
+ 'laststatus' = 0 never a status line
+ 'laststatus' = 1 status line if there is more than one window
+ 'laststatus' = 2 always a status line
+
+You can change the contents of the status line with the 'statusline' option.
+
+Normally, inversion is used to display the status line. This can be changed
+with the 's' character in the 'highlight' option. For example, "sb" sets it to
+bold characters. If no highlighting is used for the status line ("sn"), the
+'^' character is used for the current window, and '=' for other windows. If
+the mouse is supported and enabled with the 'mouse' option, a status line can
+be dragged to resize windows.
+
+Note: If you expect your status line to be in reverse video and it isn't,
+check if the 'highlight' option contains "si". In version 3.0, this meant to
+invert the status line. Now it should be "sr", reverse the status line, as
+"si" now stands for italic! If italic is not available on your terminal, the
+status line is inverted anyway; you will only see this problem on terminals
+that have termcap codes for italics.
+
+==============================================================================
+3. Opening and closing a window *opening-window* *E36*
+
+CTRL-W s *CTRL-W_s*
+CTRL-W S *CTRL-W_S*
+CTRL-W CTRL-S *CTRL-W_CTRL-S*
+:[N]sp[lit] [++opt] [+cmd] *:sp* *:split*
+ Split current window in two. The result is two viewports on
+ the same file. Make new window N high (default is to use half
+ the height of the current window). Reduces the current window
+ height to create room (and others, if the 'equalalways' option
+ is set and 'eadirection' isn't "hor").
+ Note: CTRL-S does not work on all terminals and might block
+ further input, use CTRL-Q to get going again.
+ Also see |++opt| and |+cmd|.
+
+CTRL-W CTRL-V *CTRL-W_CTRL-V*
+CTRL-W v *CTRL-W_v*
+:[N]vs[plit] [++opt] [+cmd] [file] *:vs* *:vsplit*
+ Like |:split|, but split vertically. If 'equalalways' is set
+ and 'eadirection' isn't "ver" the windows will be spread out
+ horizontally, unless a width was specified.
+ Note: In other places CTRL-Q does the same as CTRL-V, but here
+ it doesn't!
+
+CTRL-W n *CTRL-W_n*
+CTRL-W CTRL_N *CTRL-W_CTRL-N*
+:[N]new [++opt] [+cmd] *:new*
+ Create a new window and start editing an empty file in it.
+ Make new window N high (default is to use half the existing
+ height). Reduces the current window height to create room (and
+ others, if the 'equalalways' option is set and 'eadirection'
+ isn't "hor").
+ Also see |++opt| and |+cmd|.
+ If 'fileformats' is not empty, the first format given will be
+ used for the new buffer. If 'fileformats' is empty, the
+ 'fileformat' of the current buffer is used. This can be
+ overridden with the |++opt| argument.
+ Autocommands are executed in this order:
+ 1. WinLeave for the current window
+ 2. WinEnter for the new window
+ 3. BufLeave for the current buffer
+ 4. BufEnter for the new buffer
+ This behaves like a ":split" first, and then a ":e" command.
+
+:[N]vne[w] [++opt] [+cmd] [file] *:vne* *:vnew*
+ Like |:new|, but split vertically. If 'equalalways' is set
+ and 'eadirection' isn't "ver" the windows will be spread out
+ horizontally, unless a width was specified.
+
+:[N]new [++opt] [+cmd] {file}
+:[N]sp[lit] [++opt] [+cmd] {file} *:split_f*
+ Create a new window and start editing file {file} in it.
+ If [+cmd] is given, execute the command when the file has been
+ loaded |+cmd|.
+ Also see |++opt|.
+ Make new window N high (default is to use half the existing
+ height). Reduces the current window height to create room
+ (and others, if the 'equalalways' option is set).
+
+:[N]sv[iew] [++opt] [+cmd] {file} *:sv* *:sview* *splitview*
+ Same as ":split", but set 'readonly' option for this buffer.
+
+:[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfind* *splitfind*
+ Same as ":split", but search for {file} in 'path'. Doesn't
+ split if {file} is not found.
+
+CTRL-W CTRL-^ *CTRL-W_CTRL-^* *CTRL-W_^*
+CTRL-W ^ Does ":split #", split window in two and edit alternate file.
+ When a count is given, it becomes ":split #N", split window
+ and edit buffer N.
+
+Note that the 'splitbelow' and 'splitright' options influence where a new
+window will appear.
+
+ *:vert* *:vertical*
+:vert[ical] {cmd}
+ Execute {cmd}. If it contains a command that splits a window,
+ it will be split vertically.
+
+:lefta[bove] {cmd} *:lefta* *:leftabove*
+:abo[veleft] {cmd} *:abo* *:aboveleft*
+ Execute {cmd}. If it contains a command that splits a window,
+ it will be opened left (vertical split) or above (horizontal
+ split) the current window. Overrules 'splitbelow' and
+ 'splitright'.
+
+:rightb[elow] {cmd} *:rightb* *:rightbelow*
+:bel[owright] {cmd} *:bel* *:belowright*
+ Execute {cmd}. If it contains a command that splits a window,
+ it will be opened right (vertical split) or below (horizontal
+ split) the current window. Overrules 'splitbelow' and
+ 'splitright'.
+
+ *:topleft* *E442*
+:to[pleft] {cmd}
+ Execute {cmd}. If it contains a command that splits a window,
+ it will appear at the top and occupy the full width of the Vim
+ window. When the split is vertical the window appears at the
+ far left and occupies the full height of the Vim window.
+
+ *:botright*
+:bo[tright] {cmd}
+ Execute {cmd}. If it contains a command that splits a window,
+ it will appear at the bottom and occupy the full width of the
+ Vim window. When the split is vertical the window appears at
+ the far right and occupies the full height of the Vim window.
+
+These command modifiers can be combined to make a vertically split window
+occupy the full height. Example: >
+ :vertical topleft edit tags
+Opens a vertically split, full-height window on the "tags" file at the far
+left of the Vim window.
+
+
+Closing a window
+----------------
+
+CTRL-W q *CTRL-W_q*
+CTRL-W CTRL-Q *CTRL-W_CTRL-Q*
+:q[uit] Quit current window. When quitting the last window (not
+ counting a help window), exit Vim.
+ When 'hidden' is set, and there is only one window for the
+ current buffer, it becomes hidden.
+ When 'hidden' is not set, and there is only one window for the
+ current buffer, and the buffer was changed, the command fails.
+ (Note: CTRL-Q does not work on all terminals)
+
+:q[uit]! Quit current window. If this was the last window for a buffer,
+ any changes to that buffer are lost. When quitting the last
+ window (not counting help windows), exit Vim. The contents of
+ the buffer are lost, even when 'hidden' is set.
+
+CTRL-W c *CTRL-W_c* *:clo* *:close*
+:clo[se][!] Close current window. When the 'hidden' option is set, or
+ when the buffer was changed and the [!] is used, the buffer
+ becomes hidden (unless there is another window editing it).
+ This command fails when: *E444*
+ - There is only one window on the screen.
+ - When 'hidden' is not set, [!] is not used, the buffer has
+ changes, and there is no other window on this buffer.
+ Changes to the buffer are not written and won't get lost, so
+ this is a "safe" command.
+
+CTRL-W CTRL-C *CTRL-W_CTRL-C*
+ You might have expected that CTRL-W CTRL-C closes the current
+ window, but that does not work, because the CTRL-C cancels the
+ command.
+
+ *:hide*
+:hid[e] Quit current window, unless it is the last window on the
+ screen. The buffer becomes hidden (unless there is another
+ window editing it or 'bufhidden' is "unload" or "delete").
+ The value of 'hidden' is irrelevant for this command.
+ Changes to the buffer are not written and won't get lost, so
+ this is a "safe" command.
+
+:hid[e] {cmd} Execute {cmd} with 'hidden' is set. The previous value of
+ 'hidden' is restored after {cmd} has been executed.
+ Example: >
+ :hide edit Makefile
+< This will edit "Makefile", and hide the current buffer if it
+ has any changes.
+
+CTRL-W o *CTRL-W_o* *E445*
+CTRL-W CTRL-O *CTRL-W_CTRL-O* *:on* *:only*
+:on[ly][!] Make the current window the only one on the screen. All other
+ windows are closed.
+ When the 'hidden' option is set, all buffers in closed windows
+ become hidden.
+ When 'hidden' is not set, and the 'autowrite' option is set,
+ modified buffers are written. Otherwise, windows that have
+ buffers that are modified are not removed, unless the [!] is
+ given, then they become hidden. But modified buffers are
+ never abandoned, so changes cannot get lost.
+
+==============================================================================
+4. Moving cursor to other windows *window-move-cursor*
+
+CTRL-W <Down> *CTRL-W_<Down>*
+CTRL-W CTRL-J *CTRL-W_CTRL-J* *CTRL-W_j*
+CTRL-W j Move cursor to Nth window below current one. Uses the cursor
+ position to select between alternatives.
+
+CTRL-W <Up> *CTRL-W_<Up>*
+CTRL-W CTRL-K *CTRL-W_CTRL-K* *CTRL-W_k*
+CTRL-W k Move cursor to Nth window above current one. Uses the cursor
+ position to select between alternatives.
+
+CTRL-W <Left> *CTRL-W_<Left>*
+CTRL-W CTRL-H *CTRL-W_CTRL-H*
+CTRL-W <BS> *CTRL-W_<BS>* *CTRL-W_h*
+CTRL-W h Move cursor to Nth window left of current one. Uses the
+ cursor position to select between alternatives.
+
+CTRL-W <Right> *CTRL-W_<Right>*
+CTRL-W CTRL-L *CTRL-W_CTRL-L* *CTRL-W_l*
+CTRL-W l Move cursor to Nth window right of current one. Uses the
+ cursor position to select between alternatives.
+
+CTRL-W w *CTRL-W_w* *CTRL-W_CTRL-W*
+CTRL-W CTRL-W Without count: move cursor to window below/right of the
+ current one. If there is no window below or right, go to
+ top-left window.
+ With count: go to Nth window (windows are numbered from
+ top-left to bottom-right). To obtain the window number see
+ |bufwinnr()| and |winnr()|.
+
+ *CTRL-W_W*
+CTRL-W W Without count: move cursor to window above/left of current
+ one. If there is no window above or left, go to bottom-right
+ window. With count: go to Nth window (windows are numbered
+ from top-left to bottom-right).
+
+CTRL-W t *CTRL-W_t* *CTRL-W_CTRL-T*
+CTRL-W CTRL-T Move cursor to top-left window.
+
+CTRL-W b *CTRL-W_b* *CTRL-W_CTRL-B*
+CTRL-W CTRL-B Move cursor to bottom-right window.
+
+CTRL-W p *CTRL-W_p* *CTRL-W_CTRL-P*
+CTRL-W CTRL-P Go to previous (last accessed) window.
+
+ *CTRL-W_P* *E441*
+CTRL-W P Go to preview window. When there is no preview window this is
+ an error.
+ {not available when compiled without the |+quickfix| feature}
+
+If Visual mode is active and the new window is not for the same buffer, the
+Visual mode is ended. If the window is on the same buffer, the cursor
+position is set to keep the same Visual area selected.
+
+ *:winc* *:wincmd*
+These commands can also be executed with ":wincmd":
+
+:[count]winc[md] {arg}
+ Like executing CTRL-W [count] {arg}. Example: >
+ :wincmd j
+< Moves to the window below the current one.
+ This command is useful when a Normal mode cannot be used (for
+ the |CursorHold| autocommand event). Or when a Normal mode
+ command is inconvenient.
+ The count can also be a window number. Example: >
+ :exe nr . "wincmd w"
+< This goes to window "nr".
+
+==============================================================================
+5. Moving windows around *window-moving*
+
+CTRL-W r *CTRL-W_r* *CTRL-W_CTRL-R* *E443*
+CTRL-W CTRL-R Rotate windows downwards/rightwards. The first window becomes
+ the second one, the second one becomes the third one, etc.
+ The last window becomes the first window. The cursor remains
+ in the same window.
+ This only works within the row or column of windows that the
+ current window is in.
+
+ *CTRL-W_R*
+CTRL-W R Rotate windows upwards/leftwards. The second window becomes
+ the first one, the third one becomes the second one, etc. The
+ first window becomes the last window. The cursor remains in
+ the same window.
+ This only works within the row or column of windows that the
+ current window is in.
+
+CTRL-W x *CTRL-W_x* *CTRL-W_CTRL-X*
+CTRL-W CTRL-X Without count: Exchange current window with next one. If there
+ is no next window, exchange with previous window.
+ With count: Exchange current window with Nth window (first
+ window is 1). The cursor is put in the other window.
+ When vertical and horizontal window splits are mixed, the
+ exchange is only done in the row or column of windows that the
+ current window is in.
+
+The following commands can be used to change the window layout. For example,
+when there are two vertically split windows, CTRL-W K will change that in
+horizontally split windows. CTRL-W H does it the other way around.
+
+ *CTRL-W_K*
+CTRL-W K Move the current window to be at the very top, using the full
+ width of the screen. This works like closing the current
+ window and then creating another one with ":topleft split",
+ except that the current window contents is used for the new
+ window.
+
+ *CTRL-W_J*
+CTRL-W J Move the current window to be at the very bottom, using the
+ full width of the screen. This works like closing the current
+ window and then creating another one with ":botright split",
+ except that the current window contents is used for the new
+ window.
+
+ *CTRL-W_H*
+CTRL-W H Move the current window to be at the far left, using the
+ full height of the screen. This works like closing the
+ current window and then creating another one with
+ ":vert topleft split", except that the current window contents
+ is used for the new window.
+ {not available when compiled without the +vertsplit feature}
+
+ *CTRL-W_L*
+CTRL-W L Move the current window to be at the far right, using the full
+ height of the screen. This works like closing the
+ current window and then creating another one with
+ ":vert botright split", except that the current window
+ contents is used for the new window.
+ {not available when compiled without the +vertsplit feature}
+
+==============================================================================
+6. Window resizing *window-resize*
+
+ *CTRL-W_=*
+CTRL-W = Make all windows (almost) equally high and wide, but use
+ 'winheight' and 'winwidth' for the current window.
+
+:res[ize] -N *:res* *:resize* *CTRL-W_-*
+CTRL-W - Decrease current window height by N (default 1).
+ If used after 'vertical': decrease width by N.
+
+:res[ize] +N *CTRL-W_+*
+CTRL-W + Increase current window height by N (default 1).
+ If used after 'vertical': increase width by N.
+
+:res[ize] [N]
+CTRL-W CTRL-_ *CTRL-W_CTRL-_* *CTRL-W__*
+CTRL-W _ Set current window height to N (default: highest possible).
+
+z{nr}<CR> Set current window height to {nr}.
+
+ *CTRL-W_<*
+CTRL-W < Decrease current window width by N (default 1).
+
+ *CTRL-W_>*
+CTRL-W > Increase current window width by N (default 1).
+
+:vertical res[ize] [N] *:vertical-resize* *CTRL-W_bar*
+CTRL-W | Set current window width to N (default: widest possible).
+
+You can also resize a window by dragging a status line up or down with the
+mouse. Or by dragging a vertical separator line left or right. This only
+works if the version of Vim that is being used supports the mouse and the
+'mouse' option has been set to enable it.
+
+The option 'winheight' ('wh') is used to set the minimal window height of the
+current window. This option is used each time another window becomes the
+current window. If the option is '0', it is disabled. Set 'winheight' to a
+very large value, e.g., '9999', to make the current window always fill all
+available space. Set it to a reasonable value, e.g., '10', to make editing in
+the current window comfortable.
+
+The equivalent 'winwidth' ('wiw') option is used to set the minimal width of
+the current window.
+
+When the option 'equalalways' ('ea') is set, all the windows are automatically
+made the same size after splitting or closing a window. If you don't set this
+option, splitting a window will reduce the size of the current window and
+leave the other windows the same. When closing a window, the extra lines are
+given to the window above it.
+
+The 'eadirection' option limits the direction in which the 'equalalways'
+option is applied. The default "both" resizes in both directions. When the
+value is "ver" only the heights of windows are equalized. Use this when you
+have manually resized a vertically split window and want to keep this width.
+Likewise, "hor" causes only the widths of windows to be equalized.
+
+The option 'cmdheight' ('ch') is used to set the height of the command-line.
+If you are annoyed by the |hit-enter| prompt for long messages, set this
+option to 2 or 3.
+
+If there is only one window, resizing that window will also change the command
+line height. If there are several windows, resizing the current window will
+also change the height of the window below it (and sometimes the window above
+it).
+
+The minimal height and width of a window is set with 'winminheight' and
+'winminwidth'. These are hard values, a window will never become smaller.
+
+==============================================================================
+7. Argument and buffer list commands *buffer-list*
+
+ args list buffer list meaning ~
+1. :[N]argument [N] 11. :[N]buffer [N] to arg/buf N
+2. :[N]next [file ..] 12. :[N]bnext [N] to Nth next arg/buf
+3. :[N]Next [N] 13. :[N]bNext [N] to Nth previous arg/buf
+4. :[N]previous [N] 14. :[N]bprevious [N] to Nth previous arg/buf
+5. :rewind / :first 15. :brewind / :bfirst to first arg/buf
+6. :last 16. :blast to last arg/buf
+7. :all 17. :ball edit all args/buffers
+ 18. :unhide edit all loaded buffers
+ 19. :[N]bmod [N] to Nth modified buf
+
+ split & args list split & buffer list meaning ~
+21. :[N]sargument [N] 31. :[N]sbuffer [N] split + to arg/buf N
+22. :[N]snext [file ..] 32. :[N]sbnext [N] split + to Nth next arg/buf
+23. :[N]sNext [N] 33. :[N]sbNext [N] split + to Nth previous arg/buf
+24. :[N]sprevious [N] 34. :[N]sbprevious [N] split + to Nth previous arg/buf
+25. :srewind / :sfirst 35. :sbrewind / :sbfirst split + to first arg/buf
+26. :slast 36. :sblast split + to last arg/buf
+27. :sall 37: :sball edit all args/buffers
+ 38. :sunhide edit all loaded buffers
+ 39. :[N]sbmod [N] split + to Nth modified buf
+
+40. :args list of arguments
+41. :buffers list of buffers
+
+The meaning of [N] depends on the command:
+ [N] is number of buffers to go forward/backward on ?2, ?3, and ?4
+ [N] is an argument number, defaulting to current argument, for 1 and 21
+ [N] is a buffer number, defaulting to current buffer, for 11 and 31
+ [N] is a count for 19 and 39
+
+Note: ":next" is an exception, because it must accept a list of file names
+for compatibility with Vi.
+
+
+The argument list and multiple windows
+--------------------------------------
+
+The current position in the argument list can be different for each window.
+Remember that when doing ":e file", the position in the argument list stays
+the same, but you are not editing the file at that position. To indicate
+this, the file message (and the title, if you have one) shows
+"(file (N) of M)", where "(N)" is the current position in the file list, and
+"M" the number of files in the file list.
+
+All the entries in the argument list are added to the buffer list. Thus, you
+can also get to them with the buffer list commands, like ":bnext".
+
+:[N]al[l][!] [N] *:al* *:all* *:sal* *:sall*
+:[N]sal[l][!] [N]
+ Rearrange the screen to open one window for each argument.
+ All other windows are closed. When a count is given, this is
+ the maximum number of windows to open.
+ When the 'hidden' option is set, all buffers in closed windows
+ become hidden.
+ When 'hidden' is not set, and the 'autowrite' option is set,
+ modified buffers are written. Otherwise, windows that have
+ buffers that are modified are not removed, unless the [!] is
+ given, then they become hidden. But modified buffers are
+ never abandoned, so changes cannot get lost.
+ [N] is the maximum number of windows to open. 'winheight'
+ also limits the number of windows opened ('winwidth' if
+ |:vertical| was prepended).
+ Buf/Win Enter/Leave autocommands are not executed for the new
+ windows here, that's only done when they are really entered.
+
+:[N]sa[rgument][!] [++opt] [+cmd] [N] *:sa* *:sargument*
+ Short for ":split | argument [N]": split window and go to Nth
+ argument. But when there is no such argument, the window is
+ not split. Also see |++opt| and |+cmd|.
+
+:[N]sn[ext][!] [++opt] [+cmd] [file ..] *:sn* *:snext*
+ Short for ":split | [N]next": split window and go to Nth next
+ argument. But when there is no next file, the window is not
+ split. Also see |++opt| and |+cmd|.
+
+:[N]spr[evious][!] [++opt] [+cmd] [N] *:spr* *:sprevious*
+:[N]sN[ext][!] [++opt] [+cmd] [N] *:sN* *:sNext*
+ Short for ":split | [N]Next": split window and go to Nth
+ previous argument. But when there is no previous file, the
+ window is not split. Also see |++opt| and |+cmd|.
+
+ *:sre* *:srewind*
+:sre[wind][!] [++opt] [+cmd]
+ Short for ":split | rewind": split window and go to first
+ argument. But when there is no argument list, the window is
+ not split. Also see |++opt| and |+cmd|.
+
+ *:sfir* *:sfirst*
+:sfir[st [++opt] [+cmd]
+ Same as ":srewind".
+
+ *:sla* *:slast*
+:sla[st][!] [++opt] [+cmd]
+ Short for ":split | last": split window and go to last
+ argument. But when there is no argument list, the window is
+ not split. Also see |++opt| and |+cmd|.
+
+ *:dr* *:drop*
+:dr[op] {file} ..
+ Edit the first {file} in a window.
+ - If the file is already open in a window change to that
+ window.
+ - If the file is not open in a window edit the file in the
+ current window. If the current buffer can't be |abandon|ed,
+ the window is split first.
+ The |argument-list| is set, like with the |:next| command.
+ The purpose of this command is that it can be used from a
+ program that wants Vim to edit another file, e.g., a debugger.
+ {only available when compiled with the +gui feature}
+
+==============================================================================
+8. Do a command in all buffers or windows *list-repeat*
+
+ *:windo*
+:windo[!] {cmd} Execute {cmd} in each window.
+ It works like doing this: >
+ CTRL-W t
+ :{cmd}
+ CTRL-W w
+ :{cmd}
+ etc.
+< When an error is detected on one window, further
+ windows will not be visited.
+ The last window (or where an error occurred) becomes
+ the current window.
+ {cmd} can contain '|' to concatenate several commands.
+ {cmd} must not open or close windows or reorder them.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+ Also see |:argdo| and |:bufdo|.
+
+ *:bufdo*
+:bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list.
+ It works like doing this: >
+ :bfirst
+ :{cmd}
+ :bnext
+ :{cmd}
+ etc.
+< When the current file can't be |abandon|ed and the [!]
+ is not present, the command fails.
+ When an error is detected on one buffer, further
+ buffers will not be visited.
+ Unlisted buffers are skipped.
+ The last buffer (or where an error occurred) becomes
+ the current buffer.
+ {cmd} can contain '|' to concatenate several commands.
+ {cmd} must not delete buffers or add buffers to the
+ buffer list.
+ Note: While this command is executing, the Syntax
+ autocommand event is disabled by adding it to
+ 'eventignore'. This considerably speeds up editing
+ each buffer.
+ {not in Vi} {not available when compiled without the
+ |+listcmds| feature}
+ Also see |:argdo| and |:windo|.
+
+Examples: >
+
+ :windo set nolist nofoldcolumn | normal zn
+
+This resets the 'list' option and disables folding in all windows. >
+
+ :bufdo set fileencoding= | update
+
+This resets the 'fileencoding' in each buffer and writes it if this changed
+the buffer. The result is that all buffers will use the 'encoding' encoding
+(if conversion works properly).
+
+==============================================================================
+9. Tag or file name under the cursor *window-tag*
+
+ *:sta* *:stag*
+:sta[g][!] [tagname]
+ Does ":tag[!] [tagname]" and splits the window for the found
+ tag. See also |:tag|.
+
+CTRL-W ] *CTRL-W_]* *CTRL-W_CTRL-]*
+CTRL-W CTRL-] Split current window in two. Use identifier under cursor as a
+ tag and jump to it in the new upper window. Make new window N
+ high.
+
+ *CTRL-W_g]*
+CTRL-W g ] Split current window in two. Use identifier under cursor as a
+ tag and perform ":tselect" on it in the new upper window.
+ Make new window N high.
+
+ *CTRL-W_g_CTRL-]*
+CTRL-W g CTRL-] Split current window in two. Use identifier under cursor as a
+ tag and perform ":tjump" on it in the new upper window. Make
+ new window N high.
+
+CTRL-W f *CTRL-W_f* *CTRL-W_CTRL-F*
+CTRL-W CTRL-F Split current window in two. Edit file name under cursor.
+ Like ":split ]f", but window isn't split if the file does not
+ exist.
+ Uses the 'path' variable as a list of directory names where to
+ look for the file. Also the path for current file is
+ used to search for the file name.
+ If the name is a hypertext link that looks like
+ "type://machine/path", only "/path" is used.
+ If a count is given, the count'th matching file is edited.
+ {not available when the |+file_in_path| feature was disabled
+ at compile time}
+
+Also see |CTRL-W_CTRL-I|: open window for an included file that includes
+the keyword under the cursor.
+
+==============================================================================
+10. The preview window *preview-window*
+
+The preview window is a special window to show (preview) another file. It is
+normally a small window used to show an include file or definition of a
+function.
+{not available when compiled without the |+quickfix| feature}
+
+There can be only one preview window. It is created with one of the commands
+below. The 'previewheight' option can be set to specify the height of the
+preview window when it's opened. The 'previewwindow' option is set in the
+preview window to be able to recognize it. The 'winfixheight' option is set
+to have it keep the same height when opening/closing other windows.
+
+ *:pta* *:ptag*
+:pta[g][!] [tagname]
+ Does ":tag[!] [tagname]" and shows the found tag in a
+ "Preview" window without changing the current buffer or cursor
+ position. If a "Preview" window already exists, it is re-used
+ (like a help window is). If a new one is opened,
+ 'previewheight' is used for the height of the window. See
+ also |:tag|.
+ See below for an example. |CursorHold-example|
+ Small difference from |:tag|: When [tagname] is equal to the
+ already displayed tag, the position in the matching tag list
+ is not reset. This makes the CursorHold example work after a
+ |:ptnext|.
+
+CTRL-W z *CTRL-W_z*
+CTRL-W CTRL-Z *CTRL-W_CTRL-Z* *:pc* *:pclose*
+:pc[lose][!] Close any "Preview" window currently open. When the 'hidden'
+ option is set, or when the buffer was changed and the [!] is
+ used, the buffer becomes hidden (unless there is another
+ window editing it). The command fails if any "Preview" buffer
+ cannot be closed. See also |:close|.
+
+ *:pp* *:ppop*
+:[count]pp[op][!]
+ Does ":[count]pop[!]" in the preview window. See |:pop| and
+ |:ptag|. {not in Vi}
+
+CTRL-W } *CTRL-W_}*
+ Use identifier under cursor as a tag and perform a :ptag on
+ it. Make the new Preview window (if required) N high. If N is
+ not given, 'previewheight' is used.
+
+CTRL-W g } *CTRL-W_g}*
+ Use identifier under cursor as a tag and perform a :ptjump on
+ it. Make the new Preview window (if required) N high. If N is
+ not given, 'previewheight' is used.
+
+ *:ped* *:pedit*
+:ped[it][!] [++opt] [+cmd] {file}
+ Edit {file} in the preview window. The preview window is
+ opened like with |:ptag|. The current window and cursor
+ position isn't changed. Useful example: >
+ :pedit +/fputc /usr/include/stdio.h
+<
+ *:ps* *:psearch*
+:[range]ps[earch][!] [count] [/]pattern[/]
+ Works like |:ijump| but shows the found match in the preview
+ window. The preview window is opened like with |:ptag|. The
+ current window and cursor position isn't changed. Useful
+ example: >
+ :psearch popen
+< Like with the |:ptag| command, you can use this to
+ automatically show information about the word under the
+ cursor. This is less clever than using |:ptag|, but you don't
+ need a tags file and it will also find matches in system
+ include files. Example: >
+ :au! CursorHold *.[ch] nested exe "silent! psearch " . expand("<cword>")
+< Warning: This can be slow.
+
+Example *CursorHold-example* >
+
+ :au! CursorHold *.[ch] nested exe "silent! ptag " . expand("<cword>")
+
+This will cause a ":ptag" to be executed for the keyword under the cursor,
+when the cursor hasn't moved for the time set with 'updatetime'. The "nested"
+makes other autocommands be executed, so that syntax highlighting works in the
+preview window. The "silent!" avoids an error message when the tag could not
+be found. Also see |CursorHold|. To disable this again: >
+
+ :au! CursorHold
+
+A nice addition is to highlight the found tag, avoid the ":ptag" when there
+is no word under the cursor, and a few other things: >
+
+ :au! CursorHold *.[ch] nested call PreviewWord()
+ :func PreviewWord()
+ : if &previewwindow " don't do this in the preview window
+ : return
+ : endif
+ : let w = expand("<cword>") " get the word under cursor
+ : if w =~ '\a' " if the word contains a letter
+ :
+ : " Delete any existing highlight before showing another tag
+ : silent! wincmd P " jump to preview window
+ : if &previewwindow " if we really get there...
+ : match none " delete existing highlight
+ : wincmd p " back to old window
+ : endif
+ :
+ : " Try displaying a matching tag for the word under the cursor
+ : try
+ : exe "ptag " . w
+ : catch
+ : return
+ : endtry
+ :
+ : silent! wincmd P " jump to preview window
+ : if &previewwindow " if we really get there...
+ : if has("folding")
+ : silent! .foldopen " don't want a closed fold
+ : endif
+ : call search("$", "b") " to end of previous line
+ : let w = substitute(w, '\\', '\\\\', "")
+ : call search('\<\V' . w . '\>') " position cursor on match
+ : " Add a match highlight to the word at this position
+ : hi previewWord term=bold ctermbg=green guibg=green
+ : exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"'
+ : wincmd p " back to old window
+ : endif
+ : endif
+ :endfun
+
+==============================================================================
+11. Using hidden buffers *buffer-hidden*
+
+A hidden buffer is not displayed in a window, but is still loaded into memory.
+This makes it possible to jump from file to file, without the need to read or
+write the file every time you get another buffer in a window.
+{not available when compiled without the |+listcmds| feature}
+
+ *:buffer-!*
+If the option 'hidden' ('hid') is set, abandoned buffers are kept for all
+commands that start editing another file: ":edit", ":next", ":tag", etc. The
+commands that move through the buffer list sometimes make the current buffer
+hidden although the 'hidden' option is not set. This happens when a buffer is
+modified, but is forced (with '!') to be removed from a window, and
+'autowrite' is off or the buffer can't be written.
+
+You can make a hidden buffer not hidden by starting to edit it with any
+command. Or by deleting it with the ":bdelete" command.
+
+The 'hidden' is global, it is used for all buffers. The 'bufhidden' option
+can be used to make an exception for a specific buffer. It can take these
+values:
+ <empty> Use the value of 'hidden'.
+ hide Hide this buffer, also when 'hidden' is not set.
+ unload Don't hide but unload this buffer, also when 'hidden'
+ is set.
+ delete Delete the buffer.
+
+ *hidden-quit*
+When you try to quit Vim while there is a hidden, modified buffer, you will
+get an error message and Vim will make that buffer the current buffer. You
+can then decide to write this buffer (":wq") or quit without writing (":q!").
+Be careful: there may be more hidden, modified buffers!
+
+A buffer can also be unlisted. This means it exists, but it is not in the
+list of buffers. |unlisted-buffer|
+
+
+:files[!] *:files*
+:buffers[!] *:buffers* *:ls*
+:ls[!] Show all buffers. Example:
+
+ 1 #h "/test/text" line 1 ~
+ 2u "asdf" line 0 ~
+ 3 %l+ "version.c" line 1 ~
+
+ When the [!] is included the list will show unlisted buffers
+ (the term "unlisted" is a bit confusing then...).
+
+ Each buffer has a unique number. That number will not change,
+ so you can always go to a specific buffer with ":buffer N" or
+ "N CTRL-^", where N is the buffer number.
+
+ Indicators (chars in the same column are mutually exclusive):
+ u an unlisted buffer (only displayed when [!] is used)
+ |unlisted-buffer|
+ % the buffer in the current window
+ # the alternate buffer for ":e #" and CTRL-^
+ a an active buffer: it is loaded and visible
+ h a hidden buffer: It is loaded, but currently not
+ displayed in a window |hidden-buffer|
+ - a buffer with 'modifiable' off
+ = a readonly buffer
+ + a modified buffer
+ x a buffer with read errors
+
+ *:bad* *:badd*
+:bad[d] [+lnum] {fname}
+ Add file name {fname} to the buffer list, without loading it.
+ If "lnum" is specified, the cursor will be positioned at that
+ line when the buffer is first entered. Note that other
+ commands after the + will be ignored.
+
+:[N]bd[elete][!] *:bd* *:bdel* *:bdelete* *E516*
+:bd[elete][!] [N]
+ Unload buffer [N] (default: current buffer) and delete it from
+ the buffer list. If the buffer was changed, this fails,
+ unless when [!] is specified, in which case changes are lost.
+ The file remains unaffected. Any windows for this buffer are
+ closed. If buffer [N] is the current buffer, another buffer
+ will be displayed instead. This is the most recent entry in
+ the jump list that points into a loaded buffer.
+ Actually, the buffer isn't completely deleted, it is removed
+ from the buffer list |unlisted-buffer| and option values,
+ variables and mappings/abbreviations for the buffer are
+ cleared.
+
+:bdelete[!] {bufname} *E93* *E94*
+ Like ":bdelete[!] [N]", but buffer given by name. Note that a
+ buffer whose name is a number cannot be referenced by that
+ name; use the buffer number instead. Insert a backslash
+ before a space in a buffer name.
+
+:bdelete[!] N1 N2 ...
+ Do ":bdelete[!]" for buffer N1, N2, etc. The arguments can be
+ buffer numbers or buffer names (but not buffer names that are
+ a number). Insert a backslash before a space in a buffer
+ name.
+
+:N,Mbdelete[!] Do ":bdelete[!]" for all buffers in the range N to M
+ |inclusive|.
+
+:[N]bw[ipeout][!] *:bw* *:bwipe* *:bwipeout* *E517*
+:bw[ipeout][!] {bufname}
+:N,Mbw[ipeout][!]
+:bw[ipeout][!] N1 N2 ...
+ Like |:bdelete|, but really delete the buffer. All marks in
+ this buffer become invalid, option settings are lost, etc.
+ Don't use this unless you know what you are doing.
+
+:[N]bun[load][!] *:bun* *:bunload* *E515*
+:bun[load][!] [N]
+ Unload buffer [N] (default: current buffer). The memory
+ allocated for this buffer will be freed. The buffer remains
+ in the buffer list.
+ If the buffer was changed, this fails, unless when [!] is
+ specified, in which case the changes are lost.
+ Any windows for this buffer are closed. If buffer [N] is the
+ current buffer, another buffer will be displayed instead.
+ This is the most recent entry in the jump list that points
+ into a loaded buffer.
+
+:bunload[!] {bufname}
+ Like ":bunload[!] [N]", but buffer given by name. Note that a
+ buffer whose name is a number cannot be referenced by that
+ name; use the buffer number instead. Insert a backslash
+ before a space in a buffer name.
+
+:N,Mbunload[!] Do ":bunload[!]" for all buffers in the range N to M
+ |inclusive|.
+
+:bunload[!] N1 N2 ...
+ Do ":bunload[!]" for buffer N1, N2, etc. The arguments can be
+ buffer numbers or buffer names (but not buffer names that are
+ a number). Insert a backslash before a space in a buffer
+ name.
+
+:[N]b[uffer][!] [N] *:b* *:bu* *:buf* *:buffer* *E86*
+ Edit buffer [N] from the buffer list. If [N] is not given,
+ the current buffer remains being edited. See |:buffer-!| for
+ [!]. This will also edit a buffer that is not in the buffer
+ list, without setting the 'buflisted' flag.
+
+:[N]b[uffer][!] {filename}
+ Edit buffer for {filename} from the buffer list. See
+ |:buffer-!| for [!]. This will also edit a buffer that is not
+ in the buffer list, without setting the 'buflisted' flag.
+
+:[N]sb[uffer] [N] *:sb* *:sbuffer*
+ Split window and edit buffer [N] from the buffer list. If [N]
+ is not given, the current buffer is edited. Respects the
+ "useopen" setting of 'switchbuf' when splitting. This will
+ also edit a buffer that is not in the buffer list, without
+ setting the 'buflisted' flag.
+
+:[N]sb[uffer] {filename}
+ Split window and edit buffer for {filename} from the buffer
+ list. This will also edit a buffer that is not in the buffer
+ list, without setting the 'buflisted' flag.
+
+ *:bn* *:bnext* *E87*
+:[N]bn[ext][!] [N]
+ Go to [N]th next buffer in buffer list. [N] defaults to one.
+ Wraps around the end of the buffer list.
+ See |:buffer-!| for [!].
+ If you are in a help buffer, this takes you to the next help
+ buffer (if there is one). Similarly, if you are in a normal
+ (non-help) buffer, this takes you to the next normal buffer.
+ This is so that if you have invoked help, it doesn't get in
+ the way when you're browsing code/text buffers. The next three
+ commands also work like this.
+
+ *:sbn* *:sbnext*
+:[N]sbn[ext] [N]
+ Split window and go to [N]th next buffer in buffer list.
+ Wraps around the end of the buffer list. Uses 'switchbuf'
+
+:[N]bN[ext][!] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
+:[N]bp[revious][!] [N]
+ Go to [N]th previous buffer in buffer list. [N] defaults to
+ one. Wraps around the start of the buffer list.
+ See |:buffer-!| for [!] and 'switchbuf'.
+
+:[N]sbN[ext] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
+:[N]sbp[revious] [N]
+ Split window and go to [N]th previous buffer in buffer list.
+ Wraps around the start of the buffer list.
+ Uses 'switchbuf'.
+
+ *:br* *:brewind*
+:br[ewind][!] Go to first buffer in buffer list. If the buffer list is
+ empty, go to the first unlisted buffer.
+ See |:buffer-!| for [!].
+
+ *:bf* *:bfirst*
+:bf[irst] Same as ":brewind".
+
+ *:sbr* *:sbrewind*
+:sbr[ewind] Split window and go to first buffer in buffer list. If the
+ buffer list is empty, go to the first unlisted buffer.
+ Respects the 'switchbuf' option.
+
+ *:sbf* *:sbfirst*
+:sbf[irst] Same as ":sbrewind".
+
+ *:bl* *:blast*
+:bl[ast][!] Go to last buffer in buffer list. If the buffer list is
+ empty, go to the last unlisted buffer.
+ See |:buffer-!| for [!].
+
+ *:sbl* *:sblast*
+:sbl[ast] Split window and go to last buffer in buffer list. If the
+ buffer list is empty, go to the last unlisted buffer.
+ Respects 'switchbuf' option.
+
+:[N]bm[odified][!] [N] *:bm* *:bmodified* *E84*
+ Go to [N]th next modified buffer. Note: this command also
+ finds unlisted buffers. If there is no modified buffer the
+ command fails.
+
+:[N]sbm[odified] [N] *:sbm* *:sbmodified*
+ Split window and go to [N]th next modified buffer.
+ Respects 'switchbuf' option.
+ Note: this command also finds buffers not in the buffer list.
+
+:[N]unh[ide] [N] *:unh* *:unhide* *:sun* *:sunhide*
+:[N]sun[hide] [N]
+ Rearrange the screen to open one window for each loaded buffer
+ in the buffer list. When a count is given, this is the
+ maximum number of windows to open.
+
+:[N]ba[ll] [N] *:ba* *:ball* *:sba* *:sball*
+:[N]sba[ll] [N] Rearrange the screen to open one window for each buffer in
+ the buffer list. When a count is given, this is the maximum
+ number of windows to open. 'winheight' also limits the number
+ of windows opened ('winwidth' if |:vertical| was prepended).
+ Buf/Win Enter/Leave autocommands are not executed for the new
+ windows here, that's only done when they are really entered.
+
+Note: All the commands above that start editing another buffer, keep the
+'readonly' flag as it was. This differs from the ":edit" command, which sets
+the 'readonly' flag each time the file is read.
+
+==============================================================================
+12. Special kinds of buffers *special-buffers*
+
+Instead of containing the text of a file, buffers can also be used for other
+purposes. A few options can be set to change the behavior of a buffer:
+ 'bufhidden' what happens when the buffer is no longer displayed
+ in a window.
+ 'buftype' what kind of a buffer this is
+ 'swapfile' whether the buffer will have a swap file
+ 'buflisted' buffer shows up in the buffer list
+
+A few useful kinds of a buffer:
+
+quickfix Used to contain the error list. See |:cwindow|. This command
+ sets the 'buftype' option to "quickfix". You are not supposed
+ to change this! 'swapfile' is off.
+
+help Contains a help file. Will only be created with the |:help|
+ command. The flag that indicates a help buffer is internal
+ and can't be changed. The 'buflisted' option will be reset
+ for a help buffer.
+
+directory Displays directory contents. Used by the |file-explorer|
+ plugin. The buffer is created with these settings: >
+ :set buftype=nowrite
+ :set bufhidden=delete
+ :set noswapfile
+< The buffer name is the name of the directory and is adjusted
+ when using the |:cd| command.
+
+scratch Contains text that can be discarded at any time. It is kept
+ when closing the window, it must be deleted explicitly.
+ Settings: >
+ :set buftype=nofile
+ :set bufhidden=hide
+ :set noswapfile
+< The buffer name can be used to identify the buffer.
+
+ *unlisted-buffer*
+unlisted The buffer is not in the buffer list. It is not used for
+ normal editing, but to show a help file, remember a file name
+ or marks. The ":bdelete" command will also set this option,
+ thus it doesn't completely delete the buffer. Settings: >
+ :set nobuflisted
+<
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/workshop.txt b/runtime/doc/workshop.txt
new file mode 100644
index 000000000..7168c7515
--- /dev/null
+++ b/runtime/doc/workshop.txt
@@ -0,0 +1,98 @@
+*workshop.txt* For Vim version 7.0aa. Last change: 2004 Jan 08
+
+
+ VIM REFERENCE MANUAL by Gordon Prieur
+
+
+Sun Visual WorkShop Features *workshop* *workshop-support*
+
+1. Introduction |workshop-intro|
+2. Commands |workshop-commands|
+3. Compiling vim/gvim for WorkShop |workshop-compiling|
+4. Configuring gvim for a WorkShop release tree |workshop-configure|
+5. Obtaining the latest version of the XPM library |workshop-xpm|
+
+{Vi does not have any of these features}
+{only available when compiled with the |+sun_workshop| feature}
+
+==============================================================================
+1. Introduction *workshop-intro*
+
+Sun Visual WorkShop has an "Editor of Choice" feature designed to let users
+debug using their favorite editors. For the 6.0 release we have added support
+for gvim. A workshop debug session will have a debugging window and an editor
+window (possibly others as well). The user can do many debugging operations
+from the editor window, minimizing the need to switch from window to window.
+
+The version of vim shipped with Sun Visual WorkShop 6 (also called Forte
+Developer 6) is vim 5.3. The features in this release are much more reliable
+than the vim/gvim shipped with Visual WorkShop. VWS users wishing to use vim
+as their editor should compile these sources and install them in their
+workshop release tree.
+
+==============================================================================
+2. Commands *workshop-commands*
+
+ *:ws* *:wsverb*
+:ws[verb] verb Pass the verb to the verb executor
+
+Pass the verb to a workshop function which gathers some arguments and
+sends the verb and data to workshop over an IPC connection.
+
+==============================================================================
+3. Compiling vim/gvim for WorkShop *workshop-compiling*
+
+Compiling vim with FEAT_SUN_WORKSHOP turns on all compile time flags necessary
+for building a vim to work with Visual WorkShop. The features required for VWS
+have been built and tested using the Sun compilers from the VWS release. They
+have not been built or tested using Gnu compilers. This does not mean the
+features won't build and run if compiled with gcc, just that nothing is
+guaranteed with gcc!
+
+==============================================================================
+4. Configuring gvim for a WorkShop release tree *workshop-configure*
+
+There are several assumptions which must be met in order to compile a gvim for
+use with Sun Visual WorkShop 6.
+
+ o You should use the compiler in VWS rather than gcc. We have neither
+ built nor tested with gcc and cannot guarantee it will build properly.
+
+ o You must supply your own XPM library. See |workshop-xpm| below for
+ details on obtaining the latest version of XPM.
+
+ o Edit the Makefile in the src directory and uncomment the lines for Sun
+ Visual WorkShop. You can easily find these by searching for the string
+ FEAT_SUN_WORKSHOP
+
+ o We also suggest you use Motif for your gui. This will provide gvim with
+ the same look-and-feel as the rest of Sun Visual WorkShop.
+
+The following configuration line can be used to configure vim to build for use
+with Sun Visual WorkShop:
+
+ $ CC=cc configure --enable-workshop --enable-gui=motif \
+ -prefix=<VWS-install-dir>/contrib/contrib6/<vim-version>
+
+The VWS-install-dir should be the base directory where your Sun Visual WorkShop
+was installed. By default this is /opt/SUNWspro. It will normally require
+root permissions to install the vim release. You will also need to change the
+symlink <VWS-install-dir>/bin/gvim to point to the vim in your newly installed
+directory. The <vim-version> should be a unique version string. I use "vim"
+concatenated with the equivalent of version.h's VIM_VERSION_SHORT.
+
+==============================================================================
+5. Obtaining the latest version of the XPM library *workshop-xpm*
+
+The XPM library is required to show images within Vim with Motif or Athena.
+Without it the toolbar and signs will be disabled.
+
+The XPM library is provide by Arnaud Le Hors of the French National Institute
+for Research in Computer Science and Control. It can be downloaded from
+http://koala.ilog.fr/ftp/pub/xpm. The current release, as of this writing, is
+xpm-3.4k-solaris.tgz, which is a gzip'ed tar file. If you create the directory
+/usr/local/xpm and untar the file there you can use the uncommented lines in
+the Makefile without changing them. If you use another xpm directory you will
+need to change the XPM_DIR in src/Makefile.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/xxd.1 b/runtime/doc/xxd.1
new file mode 100644
index 000000000..fba0521d6
--- /dev/null
+++ b/runtime/doc/xxd.1
@@ -0,0 +1,373 @@
+.TH XXD 1 "August 1996" "Manual page for xxd"
+.\"
+.\" 21st May 1996
+.\" Man page author:
+.\" Tony Nugent <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
+.\" Changes by Bram Moolenaar <Bram@vim.org>
+.SH NAME
+.I xxd
+\- make a hexdump or do the reverse.
+.SH SYNOPSIS
+.B xxd
+\-h[elp]
+.br
+.B xxd
+[options] [infile [outfile]]
+.br
+.B xxd
+\-r[evert] [options] [infile [outfile]]
+.SH DESCRIPTION
+.I xxd
+creates a hex dump of a given file or standard input.
+It can also convert a hex dump back to its original binary form.
+Like
+.BR uuencode(1)
+and
+.BR uudecode(1)
+it allows the transmission of binary data in a `mail-safe' ASCII representation,
+but has the advantage of decoding to standard output.
+Moreover, it can be used to perform binary file patching.
+.SH OPTIONS
+If no
+.I infile
+is given, standard input is read.
+If
+.I infile
+is specified as a
+.RB \` \- '
+character, then input is taken from standard input.
+If no
+.I outfile
+is given (or a
+.RB \` \- '
+character is in its place), results are sent to standard output.
+.PP
+Note that a "lazy" parser is used which does not check for more than the first
+option letter, unless the option is followed by a parameter.
+Spaces between a single option letter and its parameter are optional.
+Parameters to options can be specified in decimal, hexadecimal or octal
+notation.
+Thus
+.BR \-c8 ,
+.BR "\-c 8" ,
+.B \-c 010
+and
+.B \-cols 8
+are all equivalent.
+.PP
+.TP
+.IR \-a " | " \-autoskip
+toggle autoskip: A single '*' replaces nul-lines. Default off.
+.TP
+.IR \-b " | " \-bits
+Switch to bits (binary digits) dump, rather than hexdump.
+This option writes octets as eight digits "1"s and "0"s instead of a normal
+hexacecimal dump. Each line is preceded by a line number in hexadecimal and
+followed by an ascii (or ebcdic) representation. The command line switches
+\-r, \-p, \-i do not work with this mode.
+.TP
+.IR "\-c cols " | " \-cols cols"
+.IR "\-c cols " | " \-cols cols"
+format
+.RI < cols >
+octets per line. Default 16 (\-i: 12, \-ps: 30, \-b: 6). Max 256.
+.TP
+.IR \-E " | " \-EBCDIC
+Change the character encoding in the righthand column from ASCII to EBCDIC.
+This does not change the hexadecimal representation. The option is
+meaningless in combinations with \-r, \-p or \-i.
+.TP
+.IR "\-g bytes " | " \-groupsize bytes"
+seperate the output of every
+.RI < bytes >
+bytes (two hex characters or eight bit-digits each) by a whitespace.
+Specify
+.I \-g 0
+to suppress grouping.
+.RI < Bytes "> defaults to " 2
+in normal mode and \fI1\fP in bits mode.
+Grouping does not apply to postscript or include style.
+.TP
+.IR \-h " | " \-help
+print a summary of available commands and exit. No hex dumping is performed.
+.TP
+.IR \-i " | " \-include
+output in C include file style. A complete static array definition is written
+(named after the input file), unless xxd reads from stdin.
+.TP
+.IR "\-l len " | " \-len len"
+stop after writing
+.RI < len >
+octets.
+.TP
+.IR \-p " | " \-ps " | " \-postscript " | " \-plain
+output in postscript continuous hexdump style. Also known as plain hexdump
+style.
+.TP
+.IR \-r " | " \-revert
+reverse operation: convert (or patch) hexdump into binary.
+If not writing to stdout, xxd writes into its output file without truncating
+it. Use the combination
+.I \-r \-p
+to read plain hexadecimal dumps without line number information and without a
+particular column layout. Additional Whitespace and line-breaks are allowed
+anywhere.
+.TP
+.I \-seek offset
+When used after
+.I \-r
+: revert with
+.RI < offset >
+added to file positions found in hexdump.
+.TP
+.I \-s [\+][\-]seek
+start at
+.RI < seek >
+bytes abs. (or rel.) infile offset.
+\fI\+ \fRindicates that the seek is relative to the current stdin file position
+(meaningless when not reading from stdin). \fI\- \fRindicates that the seek
+should be that many characters from the end of the input (or if combined with
+\fI \+ \fR: before the current stdin file position).
+Without \-s option, xxd starts at the current file position.
+.TP
+.I \-u
+use upper case hex letters. Default is lower case.
+.TP
+.IR \-v " | " \-version
+show version string.
+.SH CAVEATS
+.PP
+.I xxd \-r
+has some builtin magic while evaluating line number information.
+If the ouput file is seekable, then the linenumbers at the start of each
+hexdump line may be out of order, lines may be missing, or overlapping. In
+these cases xxd will lseek(2) to the next position. If the output file is not
+seekable, only gaps are allowed, which will be filled by null-bytes.
+.PP
+.I xxd \-r
+never generates parse errors. Garbage is silently skipped.
+.PP
+When editing hexdumps, please note that
+.I xxd \-r
+skips everything on the input line after reading enough columns of hexadecimal
+data (see option \-c). This also means, that changes to the printable ascii (or
+ebcdic) columns are always ignored. Reverting a plain (or postscript) style
+hexdump with xxd \-r \-p does not depend on the correct number of columns. Here an thing that looks like a pair of hex-digits is interpreted.
+.PP
+Note the difference between
+.br
+\fI% xxd \-i file\fR
+.br
+and
+.br
+\fI% xxd \-i \< file\fR
+.PP
+.I xxd \-s \+seek
+may be different from
+.I xxd \-s seek
+, as lseek(2) is used to "rewind" input. A '+'
+makes a difference if the input source is stdin, and if stdin's file position
+is not at the start of the file by the time xxd is started and given its input.
+The following examples may help to clarify (or further confuse!)...
+.PP
+Rewind stdin before reading; needed because the `cat' has already read to the
+end of stdin.
+.br
+\fI% sh \-c 'cat > plain_copy; xxd \-s 0 > hex_copy' < file
+.PP
+Hexdump from file position 0x480 (=1024+128) onwards.
+The `+' sign means "relative to the current position", thus the `128' adds to
+the 1k where dd left off.
+.br
+\fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +128 > hex_snippet' < file
+.PP
+Hexdump from file position 0x100 ( = 1024-768) on.
+.br
+\fI% sh \-c 'dd of=plain_snippet bs=1k count=1; xxd \-s +-768 > hex_snippet' < file
+.PP
+However, this is a rare situation and the use of `+' is rarely needed.
+the author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever \-s is used.
+.SH EXAMPLES
+.PP
+.br
+Print everything but the first three lines (hex 0x30 bytes) of
+.B file
+\.
+.br
+\fI% xxd \-s 0x30 file
+.PP
+.br
+Print 3 lines (hex 0x30 bytes) from the end of
+.B file
+\.
+.br
+\fI% xxd \-s \-0x30 file
+.PP
+.br
+Print 120 bytes as continuous hexdump with 40 octets per line.
+.br
+\fI% xxd \-l 120 \-ps \-c 20 xxd.1\fR
+.br
+2e544820585844203120224d616e75616c207061
+.br
+676520666f7220787864220a2e5c220a2e5c2220
+.br
+32317374204d617920313939360a2e5c22204d61
+.br
+6e207061676520617574686f723a0a2e5c222020
+.br
+2020546f6e79204e7567656e74203c746f6e7940
+.br
+7363746e7567656e2e7070702e67752e6564752e
+.br
+
+.br
+Hexdump the first 120 bytes of this man page with 12 octets per line.
+.br
+\fI% xxd \-l 120 \-c 12 xxd.1\fR
+.br
+0000000: 2e54 4820 5858 4420 3120 224d .TH XXD 1 "M
+.br
+000000c: 616e 7561 6c20 7061 6765 2066 anual page f
+.br
+0000018: 6f72 2078 7864 220a 2e5c 220a or xxd"..\\".
+.br
+0000024: 2e5c 2220 3231 7374 204d 6179 .\\" 21st May
+.br
+0000030: 2031 3939 360a 2e5c 2220 4d61 1996..\\" Ma
+.br
+000003c: 6e20 7061 6765 2061 7574 686f n page autho
+.br
+0000048: 723a 0a2e 5c22 2020 2020 546f r:..\\" To
+.br
+0000054: 6e79 204e 7567 656e 7420 3c74 ny Nugent <t
+.br
+0000060: 6f6e 7940 7363 746e 7567 656e ony@sctnugen
+.br
+000006c: 2e70 7070 2e67 752e 6564 752e .ppp.gu.edu.
+.PP
+.br
+Display just the date from the file xxd.1
+.br
+\fI% xxd \-s 0x28 \-l 12 \-c 12 xxd.1\fR
+.br
+0000028: 3231 7374 204d 6179 2031 3939 21st May 199
+.PP
+.br
+Copy
+.B input_file
+to
+.B output_file
+and prepend 100 bytes of value 0x00.
+.br
+\fI% xxd input_file | xxd \-r \-s 100 \> output_file\fR
+.br
+
+.br
+Patch the date in the file xxd.1
+.br
+\fI% echo '0000029: 3574 68' | xxd \-r \- xxd.1\fR
+.br
+\fI% xxd \-s 0x28 \-l 12 \-c 12 xxd.1\fR
+.br
+0000028: 3235 7468 204d 6179 2031 3939 25th May 199
+.PP
+.br
+Create a 65537 byte file with all bytes 0x00,
+except for the last one which is 'A' (hex 0x41).
+.br
+\fI% echo '010000: 41' | xxd \-r \> file\fR
+.PP
+.br
+Hexdump this file with autoskip.
+.br
+\fI% xxd \-a \-c 12 file\fR
+.br
+0000000: 0000 0000 0000 0000 0000 0000 ............
+.br
+*
+.br
+000fffc: 0000 0000 40 ....A
+.PP
+Create a 1 byte file containing a single 'A' character.
+The number after '\-r \-s' adds to the linenumbers found in the file;
+in effect, the leading bytes are suppressed.
+.br
+\fI% echo '010000: 41' | xxd \-r \-s \-0x10000 \> file\fR
+.PP
+Use xxd as a filter within an editor such as
+.B vim(1)
+to hexdump a region marked between `a' and `z'.
+.br
+\fI:'a,'z!xxd\fR
+.PP
+Use xxd as a filter within an editor such as
+.B vim(1)
+to recover a binary hexdump marked between `a' and `z'.
+.br
+\fI:'a,'z!xxd \-r\fR
+.PP
+Use xxd as a filter within an editor such as
+.B vim(1)
+to recover one line of a hexdump. Move the cursor over the line and type:
+.br
+\fI!!xxd \-r\fR
+.PP
+Read single characters from a serial line
+.br
+\fI% xxd \-c1 < /dev/term/b &\fR
+.br
+\fI% stty < /dev/term/b \-echo \-opost \-isig \-icanon min 1\fR
+.br
+\fI% echo \-n foo > /dev/term/b\fR
+.PP
+.SH "RETURN VALUES"
+The following error values are returned:
+.TP
+0
+no errors encountered.
+.TP
+\-1
+operation not supported (
+.I xxd \-r \-i
+still impossible).
+.TP
+1
+error while parsing options.
+.TP
+2
+problems with input file.
+.TP
+3
+problems with output file.
+.TP
+4,5
+desired seek position is unreachable.
+.SH "SEE ALSO"
+uuencode(1), uudecode(1), patch(1)
+.br
+.SH WARNINGS
+The tools weirdness matches its creators brain.
+Use entirely at your own risk. Copy files. Trace it. Become a wizard.
+.br
+.SH VERSION
+This manual page documents xxd version 1.7
+.SH AUTHOR
+.br
+(c) 1990-1997 by Juergen Weigert
+.br
+<jnweiger@informatik.uni-erlangen.de>
+.LP
+Distribute freely and credit me,
+.br
+make money and share with me,
+.br
+lose money and don't ask me.
+.PP
+Manual page started by Tony Nugent
+.br
+<tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
+.br
+Small changes by Bram Moolenaar.
+Edited by Juergen Weigert.
+.PP
diff --git a/runtime/doc/xxd.man b/runtime/doc/xxd.man
new file mode 100644
index 000000000..37b22d6d9
--- /dev/null
+++ b/runtime/doc/xxd.man
@@ -0,0 +1,396 @@
+
+
+
+XXD(1) XXD(1)
+
+
+NAME
+ xxd - make a hexdump or do the reverse.
+
+SYNOPSIS
+ xxd -h[elp]
+ xxd [options] [infile [outfile]]
+ xxd -r[evert] [options] [infile [outfile]]
+
+DESCRIPTION
+ xxd creates a hex dump of a given file or standard input.
+ It can also convert a hex dump back to its original binary
+ form. Like uuencode(1) and uudecode(1) it allows the
+ transmission of binary data in a `mail-safe' ASCII repre-
+ sentation, but has the advantage of decoding to standard
+ output. Moreover, it can be used to perform binary file
+ patching.
+
+OPTIONS
+ If no infile is given, standard input is read. If infile
+ is specified as a `-' character, then input is taken from
+ standard input. If no outfile is given (or a `-' charac-
+ ter is in its place), results are sent to standard output.
+
+ Note that a "lazy" parser is used which does not check for
+ more than the first option letter, unless the option is
+ followed by a parameter. Spaces between a single option
+ letter and its parameter are optional. Parameters to
+ options can be specified in decimal, hexadecimal or octal
+ notation. Thus -c8, -c 8, -c 010 and -cols 8 are all
+ equivalent.
+
+
+ -a | -autoskip
+ toggle autoskip: A single '*' replaces nul-lines.
+ Default off.
+
+ -b | -bits
+ Switch to bits (binary digits) dump, rather than
+ hexdump. This option writes octets as eight digits
+ "1"s and "0"s instead of a normal hexacecimal dump.
+ Each line is preceded by a line number in hexadeci-
+ mal and followed by an ascii (or ebcdic) represen-
+ tation. The command line switches -r, -p, -i do not
+ work with this mode.
+
+ -c cols | -cols cols
+ -c cols | -cols cols format <cols> octets per line.
+ Default 16 (-i: 12, -ps: 30, -b: 6). Max 256.
+
+ -E | -EBCDIC
+ Change the character encoding in the righthand col-
+ umn from ASCII to EBCDIC. This does not change the
+ hexadecimal representation. The option is meaning-
+ less in combinations with -r, -p or -i.
+
+
+
+Manual page for xxd August 1996 1
+
+
+
+
+
+XXD(1) XXD(1)
+
+
+ -g bytes | -groupsize bytes
+ seperate the output of every <bytes> bytes (two hex
+ characters or eight bit-digits each) by a whites-
+ pace. Specify -g 0 to suppress grouping. <Bytes>
+ defaults to 2 in normal mode and 1 in bits mode.
+ Grouping does not apply to postscript or include
+ style.
+
+ -h | -help
+ print a summary of available commands and exit. No
+ hex dumping is performed.
+
+ -i | -include
+ output in C include file style. A complete static
+ array definition is written (named after the input
+ file), unless xxd reads from stdin.
+
+ -l len | -len len
+ stop after writing <len> octets.
+
+ -p | -ps | -postscript | -plain
+ output in postscript continuous hexdump style. Also
+ known as plain hexdump style.
+
+ -r | -revert
+ reverse operation: convert (or patch) hexdump into
+ binary. If not writing to stdout, xxd writes into
+ its output file without truncating it. Use the com-
+ bination -r -p to read plain hexadecimal dumps
+ without line number information and without a par-
+ ticular column layout. Additional Whitespace and
+ line-breaks are allowed anywhere.
+
+ -seek offset
+ When used after -r : revert with <offset> added to
+ file positions found in hexdump.
+
+ -s [+][-]seek
+ start at <seek> bytes abs. (or rel.) infile offset.
+ + indicates that the seek is relative to the cur-
+ rent stdin file position (meaningless when not
+ reading from stdin). - indicates that the seek
+ should be that many characters from the end of the
+ input (or if combined with
+ + : before the current stdin file position).
+ Without -s option, xxd starts at the current file
+ position.
+
+ -u use upper case hex letters. Default is lower case.
+
+ -v | -version
+ show version string.
+
+
+
+
+
+Manual page for xxd August 1996 2
+
+
+
+
+
+XXD(1) XXD(1)
+
+
+CAVEATS
+ xxd -r has some builtin magic while evaluating line number
+ information. If the ouput file is seekable, then the
+ linenumbers at the start of each hexdump line may be out
+ of order, lines may be missing, or overlapping. In these
+ cases xxd will lseek(2) to the next position. If the out-
+ put file is not seekable, only gaps are allowed, which
+ will be filled by null-bytes.
+
+ xxd -r never generates parse errors. Garbage is silently
+ skipped.
+
+ When editing hexdumps, please note that xxd -r skips
+ everything on the input line after reading enough columns
+ of hexadecimal data (see option -c). This also means, that
+ changes to the printable ascii (or ebcdic) columns are
+ always ignored. Reverting a plain (or postscript) style
+ hexdump with xxd -r -p does not depend on the correct num-
+ ber of columns. Here an thing that looks like a pair of
+ hex-digits is interpreted.
+
+ Note the difference between
+ % xxd -i file
+ and
+ % xxd -i < file
+
+ xxd -s +seek may be different from xxd -s seek , as
+ lseek(2) is used to "rewind" input. A '+' makes a differ-
+ ence if the input source is stdin, and if stdin's file
+ position is not at the start of the file by the time xxd
+ is started and given its input. The following examples
+ may help to clarify (or further confuse!)...
+
+ Rewind stdin before reading; needed because the `cat' has
+ already read to the end of stdin.
+ % sh -c 'cat > plain_copy; xxd -s 0 > hex_copy' < file
+
+ Hexdump from file position 0x480 (=1024+128) onwards. The
+ `+' sign means "relative to the current position", thus
+ the `128' adds to the 1k where dd left off.
+ % sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +128 >
+ hex_snippet' < file
+
+ Hexdump from file position 0x100 ( = 1024-768) on.
+ % sh -c 'dd of=plain_snippet bs=1k count=1; xxd -s +-768 >
+ hex_snippet' < file
+
+ However, this is a rare situation and the use of `+' is
+ rarely needed. the author prefers to monitor the effect
+ of xxd with strace(1) or truss(1), whenever -s is used.
+
+EXAMPLES
+ Print everything but the first three lines (hex 0x30
+ bytes) of file
+
+
+
+Manual page for xxd August 1996 3
+
+
+
+
+
+XXD(1) XXD(1)
+
+
+ % xxd -s 0x30 file
+
+ Print 3 lines (hex 0x30 bytes) from the end of file
+ % xxd -s -0x30 file
+
+ Print 120 bytes as continuous hexdump with 40 octets per
+ line.
+ % xxd -l 120 -ps -c 20 xxd.1
+ 2e544820585844203120224d616e75616c207061
+ 676520666f7220787864220a2e5c220a2e5c2220
+ 32317374204d617920313939360a2e5c22204d61
+ 6e207061676520617574686f723a0a2e5c222020
+ 2020546f6e79204e7567656e74203c746f6e7940
+ 7363746e7567656e2e7070702e67752e6564752e
+
+ Hexdump the first 120 bytes of this man page with 12
+ octets per line.
+ % xxd -l 120 -c 12 xxd.1
+ 0000000: 2e54 4820 5858 4420 3120 224d .TH XXD 1 "M
+ 000000c: 616e 7561 6c20 7061 6765 2066 anual page f
+ 0000018: 6f72 2078 7864 220a 2e5c 220a or xxd"..\".
+ 0000024: 2e5c 2220 3231 7374 204d 6179 .\" 21st May
+ 0000030: 2031 3939 360a 2e5c 2220 4d61 1996..\" Ma
+ 000003c: 6e20 7061 6765 2061 7574 686f n page autho
+ 0000048: 723a 0a2e 5c22 2020 2020 546f r:..\" To
+ 0000054: 6e79 204e 7567 656e 7420 3c74 ny Nugent <t
+ 0000060: 6f6e 7940 7363 746e 7567 656e ony@sctnugen
+ 000006c: 2e70 7070 2e67 752e 6564 752e .ppp.gu.edu.
+
+ Display just the date from the file xxd.1
+ % xxd -s 0x28 -l 12 -c 12 xxd.1
+ 0000028: 3231 7374 204d 6179 2031 3939 21st May 199
+
+ Copy input_file to output_file and prepend 100 bytes of
+ value 0x00.
+ % xxd input_file | xxd -r -s 100 > output_file
+
+ Patch the date in the file xxd.1
+ % echo '0000029: 3574 68' | xxd -r - xxd.1
+ % xxd -s 0x28 -l 12 -c 12 xxd.1
+ 0000028: 3235 7468 204d 6179 2031 3939 25th May 199
+
+ Create a 65537 byte file with all bytes 0x00, except for
+ the last one which is 'A' (hex 0x41).
+ % echo '010000: 41' | xxd -r > file
+
+ Hexdump this file with autoskip.
+ % xxd -a -c 12 file
+ 0000000: 0000 0000 0000 0000 0000 0000 ............
+ *
+ 000fffc: 0000 0000 40 ....A
+
+ Create a 1 byte file containing a single 'A' character.
+ The number after '-r -s' adds to the linenumbers found in
+
+
+
+Manual page for xxd August 1996 4
+
+
+
+
+
+XXD(1) XXD(1)
+
+
+ the file; in effect, the leading bytes are suppressed.
+ % echo '010000: 41' | xxd -r -s -0x10000 > file
+
+ Use xxd as a filter within an editor such as vim(1) to
+ hexdump a region marked between `a' and `z'.
+ :'a,'z!xxd
+
+ Use xxd as a filter within an editor such as vim(1) to
+ recover a binary hexdump marked between `a' and `z'.
+ :'a,'z!xxd -r
+
+ Use xxd as a filter within an editor such as vim(1) to
+ recover one line of a hexdump. Move the cursor over the
+ line and type:
+ !!xxd -r
+
+ Read single characters from a serial line
+ % xxd -c1 < /dev/term/b &
+ % stty < /dev/term/b -echo -opost -isig -icanon min 1
+ % echo -n foo > /dev/term/b
+
+
+RETURN VALUES
+ The following error values are returned:
+
+ 0 no errors encountered.
+
+ -1 operation not supported ( xxd -r -i still impossi-
+ ble).
+
+ 1 error while parsing options.
+
+ 2 problems with input file.
+
+ 3 problems with output file.
+
+ 4,5 desired seek position is unreachable.
+
+SEE ALSO
+ uuencode(1), uudecode(1), patch(1)
+
+WARNINGS
+ The tools weirdness matches its creators brain. Use
+ entirely at your own risk. Copy files. Trace it. Become a
+ wizard.
+
+VERSION
+ This manual page documents xxd version 1.7
+
+AUTHOR
+ (c) 1990-1997 by Juergen Weigert
+ <jnweiger@informatik.uni-erlangen.de>
+
+ Distribute freely and credit me,
+
+
+
+Manual page for xxd August 1996 5
+
+
+
+
+
+XXD(1) XXD(1)
+
+
+ make money and share with me,
+ lose money and don't ask me.
+
+ Manual page started by Tony Nugent
+ <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
+ Small changes by Bram Moolenaar. Edited by Juergen
+ Weigert.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Manual page for xxd August 1996 6
+
+
diff --git a/runtime/evim.vim b/runtime/evim.vim
new file mode 100644
index 000000000..c289e20fd
--- /dev/null
+++ b/runtime/evim.vim
@@ -0,0 +1,66 @@
+" Vim script for Evim key bindings
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2002 Mar 04
+
+" Don't use Vi-compatible mode.
+set nocompatible
+
+" Use the mswin.vim script for most mappings
+source <sfile>:p:h/mswin.vim
+
+" Vim is in Insert mode by default
+set insertmode
+
+" Make a buffer hidden when editing another one
+set hidden
+
+" Make cursor keys ignore wrapping
+inoremap <Down> <C-O>gj
+inoremap <Up> <C-O>gk
+
+" CTRL-F does Find dialog instead of page forward
+noremap <C-F> :promptfind<CR>
+vnoremap <C-F> y:promptfind <C-R>"<CR>
+onoremap <C-F> <C-C>:promptfind<CR>
+inoremap <C-F> <C-O>:promptfind<CR>
+cnoremap <C-F> <C-C>:promptfind<CR>
+
+
+set backspace=2 " allow backspacing over everything in insert mode
+set autoindent " always set autoindenting on
+if has("vms")
+ set nobackup " do not keep a backup file, use versions instead
+else
+ set backup " keep a backup file
+endif
+set history=50 " keep 50 lines of command line history
+set ruler " show the cursor position all the time
+set incsearch " do incremental searching
+set mouse=a " always use the mouse
+
+" Don't use Ex mode, use Q for formatting
+map Q gq
+
+" Switch syntax highlighting on, when the terminal has colors
+" Highlight the last used search pattern on the next search command.
+if &t_Co > 2 || has("gui_running")
+ syntax on
+ set hlsearch
+ nohlsearch
+endif
+
+" Only do this part when compiled with support for autocommands.
+if has("autocmd")
+
+ " Enable file type detection.
+ " Use the default filetype settings, so that mail gets 'tw' set to 72,
+ " 'cindent' is on in C files, etc.
+ " Also load indent files, to automatically do language-dependent indenting.
+ filetype plugin indent on
+
+ " For all text files set 'textwidth' to 78 characters.
+ au FileType text setlocal tw=78
+
+endif " has("autocmd")
+
+" vim: set sw=2 :
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
new file mode 100644
index 000000000..eba1c19c3
--- /dev/null
+++ b/runtime/filetype.vim
@@ -0,0 +1,1737 @@
+" Vim support file to detect file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Jun 10
+
+" Listen very carefully, I will say this only once
+if exists("did_load_filetypes")
+ finish
+endif
+let did_load_filetypes = 1
+
+" Line continuation is used here, remove 'C' from 'cpoptions'
+let s:cpo_save = &cpo
+set cpo&vim
+
+augroup filetypedetect
+
+" Ignored extensions
+au BufNewFile,BufRead *.orig,*.bak,*.old,*.new,*.rpmsave,*.rpmnew
+ \ exe "doau filetypedetect BufRead " . expand("<afile>:r")
+au BufNewFile,BufRead *~
+ \ let s:name = expand("<afile>") |
+ \ let s:short = substitute(s:name, '\~$', '', '') |
+ \ if s:name != s:short && s:short != "" |
+ \ exe "doau filetypedetect BufRead " . s:short |
+ \ endif |
+ \ unlet s:name |
+ \ unlet s:short
+au BufNewFile,BufRead *.in
+ \ if expand("<afile>:t") != "configure.in" |
+ \ exe "doau filetypedetect BufRead " . expand("<afile>:r") |
+ \ endif
+
+" Pattern used to match file names which should not be inspected.
+" Currently finds compressed files.
+if !exists("g:ft_ignore_pat")
+ let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
+endif
+
+" Abaqus or Trasys
+au BufNewFile,BufRead *.inp call FTCheck_inp()
+
+fun! FTCheck_inp()
+ if getline(1) =~ '^\*'
+ setf abaqus
+ else
+ let n = 1
+ if line("$") > 500
+ let nmax = 500
+ else
+ let nmax = line("$")
+ endif
+ while n <= nmax
+ if getline(n) =~? "^header surface data"
+ setf trasys
+ break
+ endif
+ let n = n + 1
+ endwhile
+ endif
+endfun
+
+" A-A-P recipe
+au BufNewFile,BufRead *.aap setf aap
+
+" ABC music notation
+au BufNewFile,BufRead *.abc setf abc
+
+" ABEL
+au BufNewFile,BufRead *.abl setf abel
+
+" AceDB
+au BufNewFile,BufRead *.wrm setf acedb
+
+" Ada (83, 9X, 95)
+au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada
+
+" AHDL
+au BufNewFile,BufRead *.tdf setf ahdl
+
+" AMPL
+au BufNewFile,BufRead *.run setf ampl
+
+" Ant
+au BufNewFile,BufRead build.xml setf ant
+
+" Apache style config file
+au BufNewFile,BufRead proftpd.conf* setf apachestyle
+
+" Apache config file
+au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,.htaccess,apache.conf* setf apache
+
+" XA65 MOS6510 cross assembler
+au BufNewFile,BufRead *.a65 setf a65
+
+" Applix ELF
+au BufNewFile,BufRead *.am
+ \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
+
+" Arc Macro Language
+au BufNewFile,BufRead *.aml setf aml
+
+" Arch Inventory file
+au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
+
+" ART*Enterprise (formerly ART-IM)
+au BufNewFile,BufRead *.art setf art
+
+" ASN.1
+au BufNewFile,BufRead *.asn,*.asn1 setf asn
+
+" Active Server Pages (with Visual Basic Script)
+au BufNewFile,BufRead *.asa
+ \ if exists("g:filetype_asa") |
+ \ exe "setf " . g:filetype_asa |
+ \ else |
+ \ setf aspvbs |
+ \ endif
+
+" Active Server Pages (with Perl or Visual Basic Script)
+au BufNewFile,BufRead *.asp
+ \ if exists("g:filetype_asp") |
+ \ exe "setf " . g:filetype_asp |
+ \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
+ \ setf aspperl |
+ \ else |
+ \ setf aspvbs |
+ \ endif
+
+" Grub (must be before catch *.lst)
+au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf setf grub
+
+" Assembly (all kinds)
+" *.lst is not pure assembly, it has two extra columns (address, byte codes)
+au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call <SID>FTasm()
+
+" This function checks for the kind of assembly that is wanted by the user, or
+" can be detected from the first five lines of the file.
+fun! <SID>FTasm()
+ " make sure b:asmsyntax exists
+ if !exists("b:asmsyntax")
+ let b:asmsyntax = ""
+ endif
+
+ if b:asmsyntax == ""
+ call FTCheck_asmsyntax()
+ endif
+
+ " if b:asmsyntax still isn't set, default to asmsyntax or GNU
+ if b:asmsyntax == ""
+ if exists("g:asmsyntax")
+ let b:asmsyntax = g:asmsyntax
+ else
+ let b:asmsyntax = "asm"
+ endif
+ endif
+
+ exe "setf " . b:asmsyntax
+endfun
+
+fun! FTCheck_asmsyntax()
+ " see if file contains any asmsyntax=foo overrides. If so, change
+ " b:asmsyntax appropriately
+ let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4).
+ \" ".getline(5)." "
+ if head =~ '\sasmsyntax=\S\+\s'
+ let b:asmsyntax = substitute(head, '.*\sasmsyntax=\(\S\+\)\s.*','\1', "")
+ elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
+ let b:asmsyntax = "vmasm"
+ endif
+endfun
+
+" Macro (VAX)
+au BufNewFile,BufRead *.mar setf vmasm
+
+" Atlas
+au BufNewFile,BufRead *.atl,*.as setf atlas
+
+" Automake
+au BufNewFile,BufRead [mM]akefile.am setf automake
+
+" Avenue
+au BufNewFile,BufRead *.ave setf ave
+
+" Awk
+au BufNewFile,BufRead *.awk setf awk
+
+" B
+au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
+
+" BASIC or Visual Basic
+au BufNewFile,BufRead *.bas call <SID>FTVB("basic")
+
+" Check if one of the first five lines contains "VB_Name". In that case it is
+" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
+fun! <SID>FTVB(alt)
+ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
+ setf vb
+ else
+ exe "setf " . a:alt
+ endif
+endfun
+
+" Visual Basic Script (close to Visual Basic)
+au BufNewFile,BufRead *.vbs,*.dsm,*.ctl setf vb
+
+" Batch file for MSDOS.
+au BufNewFile,BufRead *.bat,*.btm,*.sys setf dosbatch
+" *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd.
+au BufNewFile,BufRead *.cmd
+ \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
+
+" Batch file for 4DOS
+au BufNewFile,BufRead *.btm setf btm
+
+" BC calculator
+au BufNewFile,BufRead *.bc setf bc
+
+" BDF font
+au BufNewFile,BufRead *.bdf setf bdf
+
+" BibTeX bibliography database file
+au BufNewFile,BufRead *.bib setf bib
+
+" BIND configuration
+au BufNewFile,BufRead named.conf setf named
+
+" BIND zone
+au BufNewFile,BufRead named.root setf bindzone
+
+" Blank
+au BufNewFile,BufRead *.bl setf blank
+
+" C or lpc
+au BufNewFile,BufRead *.c call <SID>FTlpc()
+
+fun! <SID>FTlpc()
+ if exists("g:lpc_syntax_for_c")
+ let lnum = 1
+ while lnum <= 12
+ if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)'
+ setf lpc
+ return
+ endif
+ let lnum = lnum + 1
+ endwhile
+ endif
+ setf c
+endfun
+
+" Calendar
+au BufNewFile,BufRead calendar,*/.calendar/*,
+ \*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
+ \ setf calendar
+
+" C#
+au BufNewFile,BufRead *.cs setf cs
+
+" Comshare Dimension Definition Language
+au BufNewFile,BufRead *.cdl setf cdl
+
+" Controllable Regex Mutilator
+au BufNewFile,BufRead *.crm setf crm
+
+" Cyn++
+au BufNewFile,BufRead *.cyn setf cynpp
+
+" Cynlib
+" .cc and .cpp files can be C++ or Cynlib.
+au BufNewFile,BufRead *.cc
+ \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif
+au BufNewFile,BufRead *.cpp
+ \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
+
+" C++
+if has("fname_case")
+ au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
+else
+ au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
+endif
+
+" .h files can be C, Ch or C++, set c_syntax_for_h if you want C,
+" ch_syntax_for_h if you want Ch.
+au BufNewFile,BufRead *.h
+ \ if exists("c_syntax_for_h") | setf c |
+ \ elseif exists("ch_syntax_for_h") | setf ch |
+ \ else | setf cpp | endif
+
+" Ch (CHscript)
+au BufNewFile,BufRead *.chf setf ch
+
+" TLH files are C++ headers generated by Visual C++'s #import from typelibs
+au BufNewFile,BufRead *.tlh setf cpp
+
+" Cascading Style Sheets
+au BufNewFile,BufRead *.css setf css
+
+" Century Term Command Scripts (*.cmd too)
+au BufNewFile,BufRead *.con setf cterm
+
+" Changelog
+au BufNewFile,BufRead changelog.Debian,changelog.dch setf debchangelog
+au BufNewFile,BufRead [cC]hange[lL]og if getline(1) =~ '; urgency='
+ \| setf debchangelog | else | setf changelog | endif
+
+" CHILL
+au BufNewFile,BufRead *..ch setf chill
+
+" Changes for WEB and CWEB or CHILL
+au BufNewFile,BufRead *.ch call <SID>FTchange()
+
+" This function checks if one of the first ten lines start with a '@'. In
+" that case it is probably a change file.
+" If the first line starts with # or ! it's probably a ch file.
+" If a line has "main", "include", "//" ir "/*" it's probably ch.
+" Otherwise CHILL is assumed.
+fun! <SID>FTchange()
+ let lnum = 1
+ while lnum <= 10
+ if getline(lnum)[0] == '@'
+ setf change
+ return
+ endif
+ if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!')
+ setf ch
+ return
+ endif
+ if getline(lnum) =~ "MODULE"
+ setf chill
+ return
+ endif
+ if getline(lnum) =~ 'main\s*(\|#\s*include\|//'
+ setf ch
+ return
+ endif
+ let lnum = lnum + 1
+ endwhile
+ setf chill
+endfun
+
+" Clean
+au BufNewFile,BufRead *.dcl,*.icl setf clean
+
+" Clever
+au BufNewFile,BufRead *.eni setf cl
+
+" Clever or dtd
+au BufNewFile,BufRead *.ent call <SID>FTent()
+
+fun! <SID>FTent()
+ " This function checks for valid cl syntax in the first five lines.
+ " Look for either an opening comment, '#', or a block start, '{".
+ " If not found, assume SGML.
+ let lnum = 1
+ while lnum < 6
+ let line = getline(lnum)
+ if line =~ '^\s*[#{]'
+ setf cl
+ return
+ elseif line !~ '^\s*$'
+ " Not a blank line, not a comment, and not a block start,
+ " so doesn't look like valid cl code.
+ break
+ endif
+ let lnum = lnum + 1
+ endw
+ setf dtd
+endfun
+
+" Clipper (or FoxPro)
+au BufNewFile,BufRead *.prg
+ \ if exists("g:filetype_prg") |
+ \ exe "setf " . g:filetype_prg |
+ \ else |
+ \ setf clipper |
+ \ endif
+
+" Cobol
+au BufNewFile,BufRead *.cbl,*.cob,*.cpy,*.lib setf cobol
+
+" Cold Fusion
+au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
+
+" Configure scripts
+au BufNewFile,BufRead configure.in,configure.ac setf config
+
+" WildPackets EtherPeek Decoder
+au BufNewFile,BufRead *.dcd setf dcd
+
+" Enlightenment configuration files
+au BufNewFile,BufRead *enlightenment/*.cfg setf c
+
+" Eterm
+au BufNewFile,BufRead *Eterm/*.cfg setf eterm
+
+" Lynx config files
+au BufNewFile,BufRead lynx.cfg setf lynx
+
+" Quake
+au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
+au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
+
+" Quake C
+au BufNewFile,BufRead *.qc setf c
+
+" Configure files
+au BufNewFile,BufRead *.cfg setf cfg
+
+" Communicating Sequential Processes
+au BufNewFile,BufRead *.csp,*.fdr setf csp
+
+" CUPL logic description and simulation
+au BufNewFile,BufRead *.pld setf cupl
+au BufNewFile,BufRead *.si setf cuplsim
+
+" Debian Control
+au BufNewFile,BufRead */debian/control setf debcontrol
+
+" ROCKLinux package description
+au BufNewFile,BufRead *.desc setf desc
+
+" the D language
+au BufNewFile,BufRead *.d setf d
+
+" Desktop files
+au BufNewFile,BufRead *.desktop,.directory setf desktop
+
+" Diff files
+au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff
+
+" Dircolors
+au BufNewFile,BufRead .dir_colors,/etc/DIR_COLORS setf dircolors
+
+" Diva (with Skill) or InstallShield
+au BufNewFile,BufRead *.rul
+ \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' |
+ \ setf ishd |
+ \ else |
+ \ setf diva |
+ \ endif
+
+" DCL (Digital Command Language - vms) or DNS zone file
+au BufNewFile,BufRead *.com
+ \ if getline(1).getline(2) =~ '$ORIGIN\|$TTL\|IN\s*SOA'
+ \ || getline(1).getline(2).getline(3).getline(4) =~ 'BIND.*named'
+ \ | setf dns | else | setf dcl | endif
+
+" DOT
+au BufNewFile,BufRead *.dot setf dot
+
+" Dylan - lid files
+au BufNewFile,BufRead *.lid setf dylanlid
+
+" Dylan - intr files (melange)
+au BufNewFile,BufRead *.intr setf dylanintr
+
+" Dylan
+au BufNewFile,BufRead *.dylan setf dylan
+
+" Microsoft Module Definition
+au BufNewFile,BufRead *.def setf def
+
+" Dracula
+au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula
+
+" dsl
+au BufNewFile,BufRead *.dsl setf dsl
+
+" DTD (Document Type Definition for XML)
+au BufNewFile,BufRead *.dtd setf dtd
+
+" EDIF (*.edf,*.edif,*.edn,*.edo)
+au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
+
+" Embedix Component Description
+au BufNewFile,BufRead *.ecd setf ecd
+
+" Eiffel or Specman
+au BufNewFile,BufRead *.e,*.E call FTCheck_e()
+
+" Elinks configuration
+au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks
+
+fun! FTCheck_e()
+ let n = 1
+ while n < 100 && n < line("$")
+ if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
+ setf specman
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf eiffel
+endfun
+
+" ERicsson LANGuage
+au BufNewFile,BufRead *.erl setf erlang
+
+" Elm Filter Rules file
+au BufNewFile,BufRead filter-rules setf elmfilt
+
+" ESQL-C
+au BufNewFile,BufRead *.ec,*.EC setf esqlc
+
+" Essbase script
+au BufNewFile,BufRead *.csc setf csc
+
+" Exim
+au BufNewFile,BufRead exim.conf setf exim
+
+" Expect
+au BufNewFile,BufRead *.exp setf expect
+
+" Exports
+au BufNewFile,BufRead exports setf exports
+
+" Fetchmail RC file
+au BufNewFile,BufRead .fetchmailrc setf fetchmail
+
+" Focus Executable
+au BufNewFile,BufRead *.fex,*.focexec setf focexec
+
+" Focus Master file (but not for auto.master)
+au BufNewFile,BufRead auto.master setf conf
+au BufNewFile,BufRead *.mas,*.master setf master
+
+" Forth
+au BufNewFile,BufRead *.fs,*.ft setf forth
+
+" Fortran
+au BufNewFile,BufRead *.f,*.F,*.for,*.fpp,*.ftn,*.f77,*.F77,*.f90,*.F90,*.f95,*.F95 setf fortran
+
+" FStab
+au BufNewFile,BufRead fstab setf fstab
+
+" GDB command files
+au BufNewFile,BufRead .gdbinit setf gdb
+
+" GDMO
+au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
+
+" Gedcom
+au BufNewFile,BufRead *.ged setf gedcom
+
+" Gkrellmrc
+au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
+
+" GP scripts (2.0 and onward)
+au BufNewFile,BufRead *.gp setf gp
+
+" GPG
+au BufNewFile,BufRead */.gnupg/options setf gpg
+au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
+au BufNewFile,BufRead /usr/**/gnupg/options.skel setf gpg
+
+" Gnuplot scripts
+au BufNewFile,BufRead *.gpi setf gnuplot
+
+" GrADS scripts
+au BufNewFile,BufRead *.gs setf grads
+
+" Groovy
+au BufNewFile,BufRead *.groovy setf groovy
+
+" GNU Server Pages
+au BufNewFile,BufRead *.gsp setf gsp
+
+" GTK RC
+au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
+
+" Haskell
+au BufNewFile,BufRead *.hs setf haskell
+au BufNewFile,BufRead *.lhs setf lhaskell
+au BufNewFile,BufRead *.chs setf chaskell
+
+" Hercules
+au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules
+
+" HEX (Intel)
+au BufNewFile,BufRead *.hex,*.h32 setf hex
+
+" Tilde (must be before HTML)
+au BufNewFile,BufRead *.t.html setf tilde
+
+" HTML (.shtml and .stm for server side)
+au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call <SID>FTCheck_html()
+
+" Distinguish between HTML and XHTML
+fun! <SID>FTCheck_html()
+ let n = 1
+ while n < 10 && n < line("$")
+ if getline(n) =~ '\<DTD\s\+XHTML\s'
+ setf xhtml
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf html
+endfun
+
+
+" HTML with M4
+au BufNewFile,BufRead *.html.m4 setf htmlm4
+
+" HTML Cheetah template
+au BufNewFile,BufRead *.tmpl setf htmlcheetah
+
+" Hyper Builder
+au BufNewFile,BufRead *.hb setf hb
+
+" Icon
+au BufNewFile,BufRead *.icn setf icon
+
+" IDL (Interface Description Language)
+au BufNewFile,BufRead *.idl call <SID>FTCheck_idl()
+
+" Distinguish between standard IDL and MS-IDL
+fun! <SID>FTCheck_idl()
+ let n = 1
+ while n < 50 && n < line("$")
+ if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
+ setf msidl
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf idl
+endfun
+
+" Microsoft IDL (Interface Description Language) Also *.idl
+" MOF = WMI (Windows Management Instrumentation) Managed Object Format
+au BufNewFile,BufRead *.odl,*.mof setf msidl
+
+" Icewm menu
+au BufNewFile,BufRead */.icewm/menu setf icemenu
+
+" Inform
+au BufNewFile,BufRead .indent.pro setf indent
+
+" IDL (Interactive Data Language)
+au BufNewFile,BufRead *.pro setf idlang
+
+" Inform
+au BufNewFile,BufRead *.inf,*.INF setf inform
+
+" Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
+au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
+
+" .INI file for MSDOS
+au BufNewFile,BufRead *.ini setf dosini
+
+" SysV Inittab
+au BufNewFile,BufRead inittab setf inittab
+
+" Inno Setup
+au BufNewFile,BufRead *.iss setf iss
+
+" JAL
+au BufNewFile,BufRead *.jal,*.JAL setf jal
+
+" Jam
+au BufNewFile,BufRead *.jpl,*.jpr setf jam
+
+" Java
+au BufNewFile,BufRead *.java,*.jav setf java
+
+" JavaCC
+au BufNewFile,BufRead *.jj,*.jjt setf javacc
+
+" JavaScript
+au BufNewFile,BufRead *.js,*.javascript setf javascript
+
+" Java Server Pages
+au BufNewFile,BufRead *.jsp setf jsp
+
+" Java Properties resource file (note: doesn't catch font.properties.pl)
+au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_??,*.properties_??_??_* setf jproperties
+
+" Jess
+au BufNewFile,BufRead *.clp setf jess
+
+" Jgraph
+au BufNewFile,BufRead *.jgr setf jgraph
+
+" Kixtart
+au BufNewFile,BufRead *.kix setf kix
+
+" Kimwitu[++]
+au BufNewFile,BufRead *.k setf kwt
+
+" KDE script
+au BufNewFile,BufRead *.ks setf kscript
+
+" Lace (ISE)
+au BufNewFile,BufRead *.ace,*.ACE setf lace
+
+" Latte
+au BufNewFile,BufRead *.latte,*.lte setf latte
+
+" LambdaProlog (*.mod too, see Modsim)
+au BufNewFile,BufRead *.sig setf lprolog
+
+" LDAP LDIF
+au BufNewFile,BufRead *.ldif setf ldif
+
+" Lex
+au BufNewFile,BufRead *.lex,*.l setf lex
+
+" Libao
+au BufNewFile,BufRead /etc/libao.conf,*/.libao setf libao
+
+" LFTP
+au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
+
+" Lifelines (or Lex for C++!)
+au BufNewFile,BufRead *.ll setf lifelines
+
+" Lilo: Linux loader
+au BufNewFile,BufRead lilo.conf* setf lilo
+
+" Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp)
+if has("fname_case")
+ au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp
+else
+ au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp
+endif
+
+" Lite
+au BufNewFile,BufRead *.lite,*.lt setf lite
+
+" Logtalk
+au BufNewFile,BufRead *.lgt setf logtalk
+
+" LOTOS
+au BufNewFile,BufRead *.lot,*.lotos setf lotos
+
+" Lout (also: *.lt)
+au BufNewFile,BufRead *.lou,*.lout setf lout
+
+" Lua
+au BufNewFile,BufRead *.lua setf lua
+
+" Lynx style file (or LotusScript!)
+au BufNewFile,BufRead *.lss setf lss
+
+" M4
+au BufNewFile,BufRead *.m4
+ \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif
+
+" MaGic Point
+au BufNewFile,BufRead *.mgp setf mgp
+
+" Mail (for Elm, trn, mutt, rn, slrn)
+au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
+
+" Mailcap configuration file
+au BufNewFile,BufRead .mailcap,mailcap setf mailcap
+
+" Makefile
+au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
+
+" MakeIndex
+au BufNewFile,BufRead *.ist,*.mst setf ist
+
+" Manpage
+au BufNewFile,BufRead *.man setf man
+
+" Maple V
+au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
+
+" Mason
+au BufNewFile,BufRead *.mason,*.mhtml setf mason
+
+" Matlab or Objective C
+au BufNewFile,BufRead *.m call FTCheck_m()
+
+fun! FTCheck_m()
+ let n = 1
+ while n < 10
+ let line = getline(n)
+ if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
+ setf objc
+ return
+ endif
+ if line =~ '^\s*%'
+ setf matlab
+ return
+ endif
+ if line =~ '^\s*(\*'
+ setf mma
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf matlab
+endfun
+
+" Maya Extension Language
+au BufNewFile,BufRead *.mel setf mel
+
+" Metafont
+au BufNewFile,BufRead *.mf setf mf
+
+" MetaPost
+au BufNewFile,BufRead *.mp setf mp
+
+" MMIX or VMS makefile
+au BufNewFile,BufRead *.mms call FTCheck_mms()
+
+fun! FTCheck_mms()
+ let n = 1
+ while n < 10
+ let line = getline(n)
+ if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
+ setf mmix
+ return
+ endif
+ if line =~ '^\s*#'
+ setf make
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf mmix
+endfun
+
+
+" Modsim III (or LambdaProlog)
+au BufNewFile,BufRead *.mod
+ \ if getline(1) =~ '\<module\>' |
+ \ setf lprolog |
+ \ else |
+ \ setf modsim3 |
+ \ endif
+
+" Modula 2
+au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2
+
+" Modula 3 (.m3, .i3, .mg, .ig)
+au BufNewFile,BufRead *.[mi][3g] setf modula3
+
+" Monk
+au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
+
+" MOO
+au BufNewFile,BufRead *.moo setf moo
+
+" Modconf
+au BufNewFile,BufRead /etc/modules.conf,/etc/conf.modules setf modconf
+au BufNewFile,BufRead /etc/modutils/*
+ \ if executable(expand("<afile>")) != 1 | setf modconf | endif
+
+" Mplayer config
+au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf
+
+" Moterola S record
+au BufNewFile,BufRead *.s19,*.s28,*.s37 setf srec
+
+" Msql
+au BufNewFile,BufRead *.msql setf msql
+
+" Mysql
+au BufNewFile,BufRead *.mysql setf mysql
+
+" M$ Resource files
+au BufNewFile,BufRead *.rc setf rc
+
+" Mush
+au BufNewFile,BufRead *.mush setf mush
+
+" Mutt setup file
+au BufNewFile,BufRead .muttrc*,*/.mutt/muttrc*,Muttrc setf muttrc
+
+" Nastran input/DMAP
+"au BufNewFile,BufRead *.dat setf nastran
+
+" Natural
+au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural
+
+" Novell netware batch files
+au BufNewFile,BufRead *.ncf setf ncf
+
+" Nroff/Troff (*.ms and *.t are checked below)
+au BufNewFile,BufRead *.me
+ \ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" |
+ \ setf nroff |
+ \ endif
+au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff
+au BufNewFile,BufRead *.[1-9] call <SID>FTnroff()
+
+" This function checks if one of the first five lines start with a dot. In
+" that case it is probably an nroff file: 'filetype' is set and 1 is returned.
+fun! <SID>FTnroff()
+ if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.'
+ setf nroff
+ return 1
+ endif
+ return 0
+endfun
+
+" Nroff or Objective C++
+au BufNewFile,BufRead *.mm call <SID>FTcheck_mm()
+
+fun! <SID>FTcheck_mm()
+ let n = 1
+ while n < 10
+ let line = getline(n)
+ if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
+ setf objcpp
+ return
+ endif
+ let n = n + 1
+ endwhile
+ setf nroff
+endfun
+
+" Not Quite C
+au BufNewFile,BufRead *.nqc setf nqc
+
+" NSIS
+au BufNewFile,BufRead *.nsi setf nsis
+
+" OCAML
+au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly setf ocaml
+
+" Occam
+au BufNewFile,BufRead *.occ setf occam
+
+" Omnimark
+au BufNewFile,BufRead *.xom,*.xin setf omnimark
+
+" OpenROAD
+au BufNewFile,BufRead *.or setf openroad
+
+" OPL
+au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
+
+" Oracle config file
+au BufNewFile,BufRead *.ora setf ora
+
+" Packet filter conf
+au BufNewFile,BufRead pf.conf setf pf
+
+" PApp
+au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
+
+" Pascal (also *.p)
+au BufNewFile,BufRead *.pas setf pascal
+
+" Delphi project file
+au BufNewFile,BufRead *.dpr setf pascal
+
+" Perl
+if has("fname_case")
+ au BufNewFile,BufRead *.pl,*.PL call FTCheck_pl()
+else
+ au BufNewFile,BufRead *.pl call FTCheck_pl()
+endif
+
+fun! FTCheck_pl()
+ if exists("g:filetype_pl")
+ exe "setf " . g:filetype_pl
+ else
+ " recognize Prolog by specific text in the first non-empty line
+ " require a blank after the '%' because Perl uses "%list" and "%translate"
+ let l = getline(nextnonblank(1))
+ if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
+ setf prolog
+ else
+ setf perl
+ endif
+ endif
+endfun
+
+" Perl, XPM or XPM2
+au BufNewFile,BufRead *.pm
+ \ if getline(1) =~ "XPM2" |
+ \ setf xpm2 |
+ \ elseif getline(1) =~ "XPM" |
+ \ setf xpm |
+ \ else |
+ \ setf perl |
+ \ endif
+
+" Perl POD
+au BufNewFile,BufRead *.pod setf pod
+
+" Php3
+au BufNewFile,BufRead *.php,*.php3 setf php
+
+" Phtml
+au BufNewFile,BufRead *.phtml setf phtml
+
+" Pike
+au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike
+
+" Pinfo config
+au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo
+
+" Palm Resource compiler
+au BufNewFile,BufRead *.rcp setf pilrc
+
+" Pine config
+au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine
+
+" PL/M (also: *.inp)
+au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm
+
+" PL/SQL
+au BufNewFile,BufRead *.pls,*.plsql setf plsql
+
+" PLP
+au BufNewFile,BufRead *.plp setf plp
+
+" PO and PO template (GNU gettext)
+au BufNewFile,BufRead *.po,*.pot setf po
+
+" Postfix main config
+au BufNewFile,BufRead main.cf setf pfmain
+
+" PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
+au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr
+
+" PostScript Printer Description
+au BufNewFile,BufRead *.ppd setf ppd
+
+" Povray
+au BufNewFile,BufRead *.pov setf pov
+
+" Povray configuration
+au BufNewFile,BufRead .povrayrc setf povini
+
+" Povray, PHP or assembly
+au BufNewFile,BufRead *.inc call FTCheck_inc()
+
+fun! FTCheck_inc()
+ if exists("g:filetype_inc")
+ exe "setf " . g:filetype_inc
+ else
+ let lines = getline(1).getline(2).getline(3)
+ if lines =~? "perlscript"
+ setf aspperl
+ elseif lines =~ "<%"
+ setf aspvbs
+ elseif lines =~ "<?"
+ setf php
+ else
+ call FTCheck_asmsyntax()
+ if exists("b:asmsyntax")
+ exe "setf " . b:asmsyntax
+ else
+ setf pov
+ endif
+ endif
+ endif
+endfun
+
+" Printcap and Termcap
+au BufNewFile,BufRead *printcap
+ \ let b:ptcap_type = "print" | setf ptcap
+au BufNewFile,BufRead *termcap
+ \ let b:ptcap_type = "term" | setf ptcap
+
+" PCCTS / ANTRL
+"au BufNewFile,BufRead *.g setf antrl
+au BufNewFile,BufRead *.g setf pccts
+
+" PPWizard
+au BufNewFile,BufRead *.it,*.ih setf ppwiz
+
+" Oracle Pro*C/C++
+au BufNewFile,BufRead .pc setf proc
+
+" Procmail
+au BufNewFile,BufRead .procmail,.procmailrc setf procmail
+
+" Progress or CWEB
+au BufNewFile,BufRead *.w call <SID>FTprogress_cweb()
+
+function! <SID>FTprogress_cweb()
+ if exists("g:filetype_w")
+ exe "setf " . g:filetype_w
+ return
+ endif
+ if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE'
+ setf progress
+ else
+ setf cweb
+ endif
+endfun
+
+" Progress or assembly
+au BufNewFile,BufRead *.i call <SID>FTprogress_asm()
+
+function! <SID>FTprogress_asm()
+ if exists("g:filetype_i")
+ exe "setf " . g:filetype_i
+ return
+ endif
+ " This function checks for an assembly comment the first ten lines.
+ " If not found, assume Progress.
+ let lnum = 1
+ while lnum <= 10
+ let line = getline(lnum)
+ if line =~ '^\s*;' || line =~ '^\*'
+ call FTCheck_asm()
+ return
+ elseif line !~ '^\s*$' || line =~ '^/\*'
+ " Not an empty line: Doesn't look like valid assembly code.
+ " Or it looks like a Progress /* comment
+ break
+ endif
+ let lnum = lnum + 1
+ endw
+ setf progress
+endfun
+
+" Progress or Pascal
+au BufNewFile,BufRead *.p call <SID>FTprogress_pascal()
+
+function! <SID>FTprogress_pascal()
+ if exists("g:filetype_p")
+ exe "setf " . g:filetype_p
+ return
+ endif
+ " This function checks for valid Pascal syntax in the first ten lines.
+ " Look for either an opening comment or a program start.
+ " If not found, assume Progress.
+ let lnum = 1
+ while lnum <= 10
+ let line = getline(lnum)
+ if line =~ '^\s*\(program\|procedure\|function\|const\|type\|var\)\>'
+ \ || line =~ '^\s*{' || line =~ '^\s*(\*'
+ setf pascal
+ return
+ elseif line !~ '^\s*$' || line =~ '^/\*'
+ " Not an empty line: Doesn't look like valid Pascal code.
+ " Or it looks like a Progress /* comment
+ break
+ endif
+ let lnum = lnum + 1
+ endw
+ setf progress
+endfun
+
+
+" Software Distributor Product Specification File (POSIX 1387.2-1995)
+au BufNewFile,BufRead *.psf setf psf
+au BufNewFile,BufRead INDEX,INFO
+ \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
+ \ setf psf |
+ \ endif
+
+" Prolog
+au BufNewFile,BufRead *.pdb setf prolog
+
+" Pyrex
+au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
+
+" Python
+au BufNewFile,BufRead *.py,*.pyw setf python
+
+" Radiance
+au BufNewFile,BufRead *.rad,*.mat setf radiance
+
+" Ratpoison config/command files
+au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison
+
+" RCS file
+au BufNewFile,BufRead *\,v setf rcs
+
+" Readline
+au BufNewFile,BufRead .inputrc setf readline
+
+" Registry for MS-Windows
+au BufNewFile,BufRead *.reg
+ \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
+
+" Renderman Interface Bytestream
+au BufNewFile,BufRead *.rib setf rib
+
+" Rexx
+au BufNewFile,BufRead *.rexx,*.rex setf rexx
+
+" R (Splus)
+au BufNewFile,BufRead *.s,*.S setf r
+
+" Rexx, Rebol or R
+au BufNewFile,BufRead *.r,*.R call <SID>FTCheck_r()
+
+fun! <SID>FTCheck_r()
+ if getline(1) =~ '^REBOL'
+ setf rebol
+ else
+ let n = 1
+ let max = line("$")
+ if max > 50
+ let max = 50
+ endif
+ while n < max
+ " R has # comments
+ if getline(n) =~ '^\s*#'
+ setf r
+ break
+ endif
+ " Rexx has /* comments */
+ if getline(n) =~ '^\s*/\*'
+ setf rexx
+ break
+ endif
+ let n = n + 1
+ endwhile
+ if n >= max
+ setf rexx
+ endif
+ endif
+endfun
+
+" Remind
+au BufNewFile,BufRead .reminders* setf remind
+
+" Resolv.conf
+au BufNewFile,BufRead resolv.conf setf resolv
+
+" Relax NG Compact
+au BufNewFile,BufRead *.rnc setf rnc
+
+" RPL/2
+au BufNewFile,BufRead *.rpl setf rpl
+
+" Robots.txt
+au BufNewFile,BufRead robots.txt setf robots
+
+" Rpcgen
+au BufNewFile,BufRead *.x setf rpcgen
+
+" reStructuredText Documentation Format
+au BufNewFile,BufRead *.rst setf rst
+
+" RTF
+au BufNewFile,BufRead *.rtf setf rtf
+
+" Ruby
+au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec setf ruby
+
+" S-lang (or shader language!)
+au BufNewFile,BufRead *.sl setf slang
+
+" Samba config
+au BufNewFile,BufRead smb.conf setf samba
+
+" SAS script
+au BufNewFile,BufRead *.sas setf sas
+
+" Sather
+au BufNewFile,BufRead *.sa setf sather
+
+" Scilab
+au BufNewFile,BufRead *.sci setf scilab
+
+" SDL
+au BufNewFile,BufRead *.sdl,*.pr setf sdl
+
+" sed
+au BufNewFile,BufRead *.sed setf sed
+
+" Sendmail
+au BufNewFile,BufRead sendmail.cf setf sm
+
+" Sendmail .mc files are actually m4
+au BufNewFile,BufRead *.mc setf m4
+
+" SGML
+au BufNewFile,BufRead *.sgm,*.sgml
+ \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
+ \ setf sgmllnx |
+ \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
+ \ let b:docbk_type="sgml" |
+ \ setf docbk |
+ \ else |
+ \ setf sgml |
+ \ endif
+
+" SGMLDECL
+au BufNewFile,BufRead *.decl,*.dcl,*.dec
+ \ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
+ \ setf sgmldecl |
+ \ endif
+
+" SGML catalog file
+au BufNewFile,BufRead sgml.catalog*,catalog setf catalog
+
+" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
+" Gentoo ebuilds are actually bash scripts
+au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,*.bash,*.ebuild call SetFileTypeSH("bash")
+au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
+au BufNewFile,BufRead /etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
+
+fun! SetFileTypeSH(name)
+ if a:name =~ '\<ksh\>'
+ let b:is_kornshell = 1
+ if exists("b:is_bash")
+ unlet b:is_bash
+ endif
+ if exists("b:is_sh")
+ unlet b:is_sh
+ endif
+ elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>'
+ let b:is_bash = 1
+ if exists("b:is_kornshell")
+ unlet b:is_kornshell
+ endif
+ if exists("b:is_sh")
+ unlet b:is_sh
+ endif
+ elseif a:name =~ '\<sh\>'
+ let b:is_sh = 1
+ if exists("b:is_kornshell")
+ unlet b:is_kornshell
+ endif
+ if exists("b:is_bash")
+ unlet b:is_bash
+ endif
+ endif
+ setf sh
+endfun
+
+" tcsh scripts
+au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login setf tcsh
+
+" csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
+au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call SetFileTypeCSH()
+
+fun! SetFileTypeCSH()
+ if exists("g:filetype_csh")
+ exe "setf " . g:filetype_csh
+ elseif &shell =~ "tcsh"
+ setf tcsh
+ else
+ setf csh
+ endif
+endfun
+
+" Z-Shell script
+au BufNewFile,BufRead .zsh*,.zlog*,.zprofile,/etc/zprofile,.zfbfmarks,.zcompdump* setf zsh
+
+" Scheme
+au BufNewFile,BufRead *.scm,*.ss setf scheme
+
+" Screen RC
+au BufNewFile,BufRead .screenrc,screenrc setf screen
+
+" Simula
+au BufNewFile,BufRead *.sim setf simula
+
+" SINDA
+au BufNewFile,BufRead *.sin,*.s85 setf sinda
+
+" SKILL
+au BufNewFile,BufRead *.il setf skill
+
+" SLRN
+au BufNewFile,BufRead .slrnrc setf slrnrc
+au BufNewFile,BufRead *.score setf slrnsc
+
+" Smalltalk
+au BufNewFile,BufRead *.st,*.cls setf st
+
+" Smarty templates
+au BufNewFile,BufRead *.tpl setf smarty
+
+" SMIL or XML
+au BufNewFile,BufRead *.smil
+ \ if getline(1) =~ '<?\s*xml.*?>' |
+ \ setf xml |
+ \ else |
+ \ setf smil |
+ \ endif
+
+" SMIL or SNMP MIB file
+au BufNewFile,BufRead *.smi
+ \ if getline(1) =~ '\<smil\>' |
+ \ setf smil |
+ \ else |
+ \ setf mib |
+ \ endif
+
+" SMITH
+au BufNewFile,BufRead *.smt,*.smith setf smith
+
+" Snobol4
+au BufNewFile,BufRead *.sno setf snobol4
+
+" SNMP MIB files
+au BufNewFile,BufRead *.mib,*.my setf mib
+
+" Snort Configuration
+au BufNewFile,BufRead *.hog,snort.conf,vision.conf,*.rules setf hog
+
+" Spec (Linux RPM)
+au BufNewFile,BufRead *.spec setf spec
+
+" Speedup (AspenTech plant simulator)
+au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup
+
+" Slice
+au BufNewFile,BufRead *.ice setf slice
+
+" Spice
+au BufNewFile,BufRead *.sp,*.spice setf spice
+
+" Spyce
+au BufNewFile,BufRead *.spy,*.spi setf spyce
+
+" Squid
+au BufNewFile,BufRead squid.conf setf squid
+
+" SQL (all but the first one for Oracle Designer)
+au BufNewFile,BufRead *.sql,*.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql
+
+" SQLJ
+au BufNewFile,BufRead *.sqlj setf sqlj
+
+" SQR
+au BufNewFile,BufRead *.sqr,*.sqi setf sqr
+
+" OpenSSH configuration
+au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
+
+" OpenSSH server configuration
+au BufNewFile,BufRead sshd_config setf sshdconfig
+
+" Stored Procedures
+au BufNewFile,BufRead *.stp setf stp
+
+" Standard ML
+au BufNewFile,BufRead *.sml setf sml
+
+" Tads (or Nroff)
+au BufNewFile,BufRead *.t
+ \ if !<SID>FTnroff() | setf tads | endif
+
+" Tags
+au BufNewFile,BufRead tags setf tags
+
+" TAK
+au BufNewFile,BufRead *.tak setf tak
+
+" Tcl
+au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk setf tcl
+
+" TealInfo
+au BufNewFile,BufRead *.tli setf tli
+
+" Telix Salt
+au BufNewFile,BufRead *.slt setf tsalt
+
+" Terminfo
+au BufNewFile,BufRead *.ti setf terminfo
+
+" TeX
+au BufNewFile,BufRead *.tex,*.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
+
+" Texinfo
+au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
+
+" TeX configuration
+au BufNewFile,BufRead texmf.cnf setf texmf
+
+" Tidy config
+au BufNewFile,BufRead .tidyrc,tidyrc setf tidy
+
+" TF mud client
+au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
+
+" TSS - Geometry
+au BufNewFile,BufReadPost *.tssgm setf tssgm
+
+" TSS - Optics
+au BufNewFile,BufReadPost *.tssop setf tssop
+
+" TSS - Command Line (temporary)
+au BufNewFile,BufReadPost *.tsscl setf tsscl
+
+" Motif UIT/UIL files
+au BufNewFile,BufRead *.uit,*.uil setf uil
+
+" UnrealScript
+au BufNewFile,BufRead *.uc setf uc
+
+" Verilog HDL
+au BufNewFile,BufRead *.v setf verilog
+
+" VHDL
+au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vhdl_[0-9]*,*.vbe,*.vst setf vhdl
+
+" Vim script
+au BufNewFile,BufRead *.vim,.exrc,_exrc setf vim
+
+" Viminfo file
+au BufNewFile,BufRead .viminfo,_viminfo setf viminfo
+
+" Virata Config Script File
+au BufRead,BufNewFile *.hw,*.module,*.pkg setf virata
+
+" Visual Basic (also uses *.bas) or FORM
+au BufNewFile,BufRead *.frm call <SID>FTVB("form")
+
+" SaxBasic is close to Visual Basic
+au BufNewFile,BufRead *.sba setf vb
+
+" Vgrindefs file
+au BufNewFile,BufRead vgrindefs setf vgrindefs
+
+" VRML V1.0c
+au BufNewFile,BufRead *.wrl setf vrml
+
+" Webmacro
+au BufNewFile,BufRead *.wm setf webmacro
+
+" Wget config
+au BufNewFile,BufRead .wgetrc,wgetrc setf wget
+
+" Website MetaLanguage
+au BufNewFile,BufRead *.wml setf wml
+
+" Winbatch
+au BufNewFile,BufRead *.wbt setf winbatch
+
+" WvDial
+au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial
+
+" CVS RC file
+au BufNewFile,BufRead .cvsrc setf cvsrc
+
+" CVS commit file
+au BufNewFile,BufRead cvs\d\+ setf cvs
+
+" WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
+" lines in a WEB file).
+au BufNewFile,BufRead *.web
+ \ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
+ \ setf web |
+ \ else |
+ \ setf winbatch |
+ \ endif
+
+" Windows Scripting Host and Windows Script Component
+au BufNewFile,BufRead *.ws[fc] setf wsh
+
+" X Pixmap (dynamically sets colors, use BufEnter to make it work better)
+au BufEnter *.xpm
+ \ if getline(1) =~ "XPM2" |
+ \ setf xpm2 |
+ \ else |
+ \ setf xpm |
+ \ endif
+au BufEnter *.xpm2 setf xpm2
+
+" XFree86 config
+au BufNewFile,BufRead XF86Config
+ \ if getline(1) =~ '\<XConfigurator\>' |
+ \ let b:xf86c_xfree86_version = 3 |
+ \ endif |
+ \ setf xf86conf
+
+" Xorg config
+au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86c_xfree86_version = 4 | setf xf86conf
+
+" XS Perl extension interface language
+au BufNewFile,BufRead *.xs setf xs
+
+" X resources file
+au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
+
+" Xmath
+au BufNewFile,BufRead *.msc,*.msf setf xmath
+au BufNewFile,BufRead *.ms
+ \ if !<SID>FTnroff() | setf xmath | endif
+
+" XML
+au BufNewFile,BufRead *.xml
+ \ if getline(1) . getline(2) . getline(3) =~ '<!DOCTYPE.*DocBook' |
+ \ let b:docbk_type="xml" |
+ \ setf docbk |
+ \ else |
+ \ setf xml |
+ \ endif
+
+" XMI (holding UML models) is also XML
+au BufNewFile,BufRead *.xmi setf xml
+
+" CSPROJ files are Visual Studio.NET's XML-based project config files
+au BufNewFile,BufRead *.csproj,*.csproj.user setf xml
+
+" Qt Linguist translation source and Qt User Interface Files are XML
+au BufNewFile,BufRead *.ts,*.ui setf xml
+
+" XSD
+au BufNewFile,BufRead *.xsd setf xsd
+
+" Xslt
+au BufNewFile,BufRead *.xsl,*.xslt setf xslt
+
+" Yacc
+au BufNewFile,BufRead *.y,*.yy setf yacc
+
+" Yaml
+au BufNewFile,BufRead *.yaml,*.yml setf yaml
+
+" Z80 assembler asz80
+au BufNewFile,BufRead *.z8a setf z8a
+
+augroup END
+
+
+" Source the user-specified filetype file, for backwards compatibility with
+" Vim 5.x.
+if exists("myfiletypefile") && file_readable(expand(myfiletypefile))
+ execute "source " . myfiletypefile
+endif
+
+
+" Check for "*" after loading myfiletypefile, so that scripts.vim is only used
+" when there are no matching file name extensions.
+" Don't do this for compressed files.
+augroup filetypedetect
+au BufNewFile,BufRead *
+ \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
+ \ | runtime! scripts.vim | endif
+au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
+
+
+" Extra checks for when no filetype has been detected now. Mostly used for
+" patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim
+" script file.
+
+" BIND zone
+au BufNewFile,BufRead /var/named/* setf bindzone
+
+" Changelog
+au BufNewFile,BufRead [cC]hange[lL]og* if getline(1) =~ '; urgency='
+ \| setf debchangelog | else | setf changelog | endif
+
+" Crontab
+au BufNewFile,BufRead crontab,crontab.* setf crontab
+
+" Dracula
+au BufNewFile,BufRead drac.* setf dracula
+
+" Fvwm
+au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
+ \ let b:fvwm_version = 1 | setf fvwm
+au BufNewFile,BufRead *fvwm2rc*
+ \ if expand("<afile>:e") == "m4" | setf fvwm2m4 | else |
+ \ let b:fvwm_version = 2 | setf fvwm | endif
+
+" GTK RC
+au BufNewFile,BufRead .gtkrc*,gtkrc* setf gtkrc
+
+" Jam
+au BufNewFile,BufRead Prl*.*,JAM*.* setf jam
+
+" Jargon
+au! BufNewFile,BufRead *jarg*
+ \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE' |
+ \ setf jargon |
+ \ endif
+
+" Makefile
+au BufNewFile,BufRead [mM]akefile* setf make
+
+" Ruby Makefile
+au BufNewFile,BufRead [rR]akefile* setf ruby
+
+" Mutt setup file
+au BufNewFile,BufRead muttrc*,Muttrc* setf muttrc
+
+" Nroff macros
+au BufNewFile,BufRead tmac.* setf nroff
+
+" Printcap and Termcap
+au BufNewFile,BufRead *printcap*
+ \ if !did_filetype() | let b:ptcap_type = "print" | setf ptcap | endif
+au BufNewFile,BufRead *termcap*
+ \ if !did_filetype() | let b:ptcap_type = "term" | setf ptcap | endif
+
+" Vim script
+au BufNewFile,BufRead *vimrc* setf vim
+
+" Subversion commit file
+au BufNewFile,BufRead svn-commit.*.tmp setf svn
+
+" X resources file
+au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* setf xdefaults
+
+" XFree86 config
+au BufNewFile,BufRead XF86Config-4*
+ \ let b:xf86c_xfree86_version = 4 | setf xf86conf
+au BufNewFile,BufRead XF86Config*
+ \ if getline(1) =~ '\<XConfigurator\>' |
+ \ let b:xf86c_xfree86_version = 3 |
+ \ endif |
+ \ setf xf86conf
+
+" X11 xmodmap
+au BufNewFile,BufRead *xmodmap* setf xmodmap
+
+" Z-Shell script
+au BufNewFile,BufRead zsh*,zlog* setf zsh
+
+
+" Generic configuration file (check this last, it's just guessing!)
+au BufNewFile,BufRead,StdinReadPost *
+ \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
+ \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
+ \ || getline(4) =~ '^#' || getline(5) =~ '^#') |
+ \ setf conf |
+ \ endif
+
+" Use the plugin-filetype checks last, they may overrule any of the previously
+" detected filetypes.
+runtime! ftdetect/*.vim
+
+augroup END
+
+
+" If the GUI is already running, may still need to install the Syntax menu.
+" Don't do it when the 'M' flag is included in 'guioptions'.
+if has("menu") && has("gui_running")
+ \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
+ source <sfile>:p:h/menu.vim
+endif
+
+" Restore 'cpoptions'
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftoff.vim b/runtime/ftoff.vim
new file mode 100644
index 000000000..377c6ef82
--- /dev/null
+++ b/runtime/ftoff.vim
@@ -0,0 +1,11 @@
+" Vim support file to switch off detection of file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2001 Jun 11
+
+if exists("did_load_filetypes")
+ unlet did_load_filetypes
+endif
+
+" Remove all autocommands in the filetypedetect group
+silent! au! filetypedetect *
diff --git a/runtime/ftplugin.vim b/runtime/ftplugin.vim
new file mode 100644
index 000000000..2c6455088
--- /dev/null
+++ b/runtime/ftplugin.vim
@@ -0,0 +1,27 @@
+" Vim support file to switch on loading plugins for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2003 May 10
+
+if exists("did_load_ftplugin")
+ finish
+endif
+let did_load_ftplugin = 1
+
+augroup filetypeplugin
+ au FileType * call s:LoadFTPlugin()
+ func! s:LoadFTPlugin()
+ if expand("<amatch>") != ""
+ if exists("b:undo_ftplugin")
+ exe b:undo_ftplugin
+ unlet b:undo_ftplugin b:did_ftplugin
+ endif
+ if &cpo =~# "S" && exists("b:did_ftplugin")
+ " In compatible mode options are reset to the global values, need to
+ " set the local values also when a plugin was already used.
+ unlet b:did_ftplugin
+ endif
+ runtime! ftplugin/<amatch>.vim ftplugin/<amatch>_*.vim ftplugin/<amatch>/*.vim
+ endif
+ endfunc
+augroup END
diff --git a/runtime/ftplugin/README.txt b/runtime/ftplugin/README.txt
new file mode 100644
index 000000000..19ad58bdd
--- /dev/null
+++ b/runtime/ftplugin/README.txt
@@ -0,0 +1,24 @@
+The ftplugin directory is for Vim plugin scripts that are only used for a
+specific filetype.
+
+All files ending in .vim in this directory and subdirectories will be sourced
+by Vim when it detects the filetype that matches the name of the file or
+subdirectory.
+For example, these are all loaded for the "c" filetype:
+
+ c.vim
+ c_extra.vim
+ c/settings.vim
+
+Note that the "_" in "c_extra.vim" is required to separate the filetype name
+from the following arbitrary name.
+
+The filetype plugins are only loaded when the ":filetype plugin" command has
+been used.
+
+The default filetype plugin files contain settings that 95% of the users will
+want to use. They do not contain personal preferences, like the value of
+'shiftwidth'.
+
+If you want to do additional settings, or overrule the default filetype
+plugin, you can create your own plugin file. See ":help ftplugin" in Vim.
diff --git a/runtime/ftplugin/aap.vim b/runtime/ftplugin/aap.vim
new file mode 100644
index 000000000..90d404fa6
--- /dev/null
+++ b/runtime/ftplugin/aap.vim
@@ -0,0 +1,25 @@
+" Vim filetype plugin file
+" Language: Aap recipe
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Nov 04
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Reset 'formatoptions', 'comments' and 'expandtab' to undo this plugin.
+let b:undo_ftplugin = "setl fo< com< et<"
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=s:#\ -,m:#\ \,e:#,n:#,fb:-
+
+" Expand tabs to spaces to avoid trouble.
+setlocal expandtab
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim
new file mode 100644
index 000000000..f63962f81
--- /dev/null
+++ b/runtime/ftplugin/abaqus.vim
@@ -0,0 +1,75 @@
+" Vim filetype plugin file
+" Language: Abaqus finite element input file (www.abaqus.com)
+" Maintainer: Carl Osterwisch <osterwischc@asme.org>
+" Last Change: 2004 May
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin") | finish | endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Save the compatibility options and temporarily switch to vim defaults
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+" Folding
+if version >= 600
+ " Fold all lines that do not begin with *
+ setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
+ setlocal foldmethod=expr
+endif
+
+" Set the format of the include file specification for Abaqus
+" Used in :check gf ^wf [i and other commands
+setlocal include=\\<\\cINPUT\\s*=
+
+" Remove characters up to the first = when evaluating filenames
+setlocal includeexpr=substitute(v:fname,'.\\{-}=','','')
+
+" Define format of comment lines (see 'formatoptions' for uses)
+setlocal comments=:**
+setlocal commentstring=**%s
+
+" Definitions start with a * and assign a NAME, NSET, or ELSET
+" Used in [d ^wd and other commands
+setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
+
+" Abaqus keywords and identifiers may include a - character
+setlocal iskeyword+=-
+
+" Set the file browse filter (currently only supported under Win32 gui)
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
+ \ "Abaqus Results (*.dat)\t*.dat\n" .
+ \ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Define keys used to move [count] sections backward or forward.
+" TODO: Make this do something intelligent in visual mode.
+nnoremap <silent> <buffer> [[ :call <SID>Abaqus_Jump('?^\*\a?')<CR>
+nnoremap <silent> <buffer> ]] :call <SID>Abaqus_Jump('/^\*\a/')<CR>
+function! <SID>Abaqus_Jump(motion) range
+ let s:count = v:count1
+ mark '
+ while s:count > 0
+ silent! execute a:motion
+ let s:count = s:count - 1
+ endwhile
+endfunction
+
+" Define key to toggle commenting of the current line or range
+noremap <silent> <buffer> <m-c> :call <SID>Abaqus_ToggleComment()<CR>j
+function! <SID>Abaqus_ToggleComment() range
+ if strpart(getline(a:firstline), 0, 2) == "**"
+ " Un-comment all lines in range
+ silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
+ else
+ " Comment all lines in range
+ silent execute a:firstline . ',' . a:lastline . 's/^/**/'
+ endif
+endfunction
+
+" Restore saved compatibility options
+let &cpoptions = s:cpo_save
diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim
new file mode 100644
index 000000000..06c057fc8
--- /dev/null
+++ b/runtime/ftplugin/ada.vim
@@ -0,0 +1,226 @@
+" Vim Ada plugin file
+" Language: Ada
+" Maintainer: Neil Bird <neil@fnxweb.com>
+" Last Change: 2003 May 11
+" Version: $Id$
+" Look for the latest version at http://vim.sourceforge.net/
+"
+" Perform Ada specific completion & tagging.
+"
+"
+" Provides mapping overrides for tag jumping that figure out the current
+" Ada object and tag jump to that, not the 'simple' vim word.
+" Similarly allows <Ctrl-N> matching of full-length ada entities from tags.
+" Exports 'AdaWord()' function to return full name of Ada entity under the
+" cursor( or at given line/column), stripping whitespace/newlines as necessary.
+
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Temporarily set cpoptions to ensure the script loads OK
+let s:cpoptions = &cpoptions
+set cpo-=C
+
+
+" Ada comments
+setlocal comments+=O:--
+
+
+" Make local tag mappings for this buffer (if not already set)
+if mapcheck('<C-]>','n') == ''
+ nnoremap <unique> <buffer> <C-]> :call JumpToTag_ada('')<cr>
+endif
+if mapcheck('g<C-]>','n') == ''
+ nnoremap <unique> <buffer> g<C-]> :call JumpToTag_ada('','stj')<cr>
+endif
+
+if mapcheck('<C-N>','i') == ''
+ inoremap <unique> <buffer> <C-N> <C-R>=<SID>AdaCompletion("\<lt>C-N>")<cr>
+endif
+if mapcheck('<C-P>','i') == ''
+ inoremap <unique> <buffer> <C-P> <C-R>=<SID>AdaCompletion("\<lt>C-P>")<cr>
+endif
+if mapcheck('<C-X><C-]>','i') == ''
+ inoremap <unique> <buffer> <C-X><C-]> <C-R>=<SID>AdaCompletion("\<lt>C-X>\<lt>C-]>")<cr>
+endif
+if mapcheck('<bs>','i') == ''
+ inoremap <silent> <unique> <buffer> <bs> <C-R>=<SID>AdaInsertBackspace()<cr>
+endif
+
+
+" Only do this when not done yet for this buffer & matchit is used
+if ! exists("b:match_words") && exists("loaded_matchit")
+ " The following lines enable the macros/matchit.vim plugin for
+ " Ada-specific extended matching with the % key.
+ let s:notend = '\%(\<end\s\+\)\@<!'
+ let b:match_words=
+ \ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
+ \ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
+ \ '\%(\<while\>.*\|\<for\>.*\|'.s:notend.'\)\<loop\>:\<end\>\s\+\<loop\>,' .
+ \ '\%(\<do\>\|\<begin\>\):\<exception\>:\<end\>\s*\%($\|[;A-Z]\),' .
+ \ s:notend . '\<record\>:\<end\>\s\+\<record\>'
+endif
+
+
+" Prevent re-load of functions
+if exists('s:id')
+ finish
+endif
+
+" Get this script's unique id
+map <script> <SID>?? <SID>??
+let s:id = substitute( maparg('<SID>??'), '^<SNR>\(.*\)_??$', '\1', '' )
+unmap <script> <SID>??
+
+
+" Extract current Ada word across multiple lines
+" AdaWord( [line, column] )\
+let s:AdaWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
+let s:AdaComment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
+
+function! AdaWord(...)
+ if a:0 > 1
+ let linenr = a:1
+ let colnr = a:2 - 1
+ else
+ let linenr = line('.')
+ let colnr = col('.') - 1
+ endif
+ let line = substitute( getline(linenr), s:AdaComment, '', '' )
+ " Cope with tag searching for items in comments; if we are, don't loop
+ " backards looking for previous lines
+ if colnr > strlen(line)
+ " We were in a comment
+ let line = getline(linenr)
+ let search_prev_lines = 0
+ else
+ let search_prev_lines = 1
+ endif
+
+ " Go backwards until we find a match (Ada ID) that *doesn't* include our
+ " location - i.e., the previous ID. This is because the current 'correct'
+ " match will toggle matching/not matching as we traverse characters
+ " backwards. Thus, we have to find the previous unrelated match, exclude
+ " it, then use the next full match (ours).
+ " Remember to convert vim column 'colnr' [1..n] to string offset [0..(n-1)]
+ " ... but start, here, one after the required char.
+ let newcol = colnr + 1
+ while 1
+ let newcol = newcol - 1
+ if newcol < 0
+ " Have to include previous line from file
+ let linenr = linenr - 1
+ if linenr < 1 || !search_prev_lines
+ " Start of file or matching in a comment
+ let linenr = 1
+ let newcol = 0
+ let ourmatch = match( line, s:AdaWordRegex )
+ break
+ endif
+ " Get previous line, and prepend it to our search string
+ let newline = substitute( getline(linenr), s:AdaComment, '', '' )
+ let newcol = strlen(newline) - 1
+ let colnr = colnr + newcol
+ let line = newline . line
+ endif
+ " Check to see if this is a match excluding 'us'
+ let mend = newcol + matchend( strpart(line,newcol), s:AdaWordRegex ) - 1
+ if mend >= newcol && mend < colnr
+ " Yes
+ let ourmatch = mend+1 + match( strpart(line,mend+1), s:AdaWordRegex )
+ break
+ endif
+ endwhile
+
+ " Got anything?
+ if ourmatch < 0
+ return ''
+ else
+ let line = strpart( line, ourmatch)
+ endif
+
+ " Now simply add further lines until the match gets no bigger
+ let matchstr = matchstr( line, s:AdaWordRegex )
+ let lastline = line('$')
+ let linenr = line('.') + 1
+ while linenr <= lastline
+ let lastmatch = matchstr
+ let line = line . substitute( getline(linenr), s:AdaComment, '', '' )
+ let matchstr = matchstr( line, s:AdaWordRegex )
+ if matchstr == lastmatch
+ break
+ endif
+ endwhile
+
+ " Strip whitespace & return
+ return substitute( matchstr, '\s\+', '', 'g' )
+endfunction
+
+
+" Word tag - include '.' and if Ada make uppercase
+" Name allows a common JumpToTag() to look for an ft specific JumpToTag_ft().
+function! JumpToTag_ada(word,...)
+ if a:word == ''
+ " Get current word
+ let word = AdaWord()
+ if word == ''
+ return
+ endif
+ else
+ let word = a:word
+ endif
+ if a:0 > 0
+ let mode = a:1
+ else
+ let mode = 'tj'
+ endif
+
+ let v:errmsg = ''
+ execute 'silent!' mode word
+ if v:errmsg != ''
+ if v:errmsg =~ '^E426:' " Tag not found
+ let ignorecase = &ignorecase
+ set ignorecase
+ execute mode word
+ let &ignorecase = ignorecase
+ else
+ " Repeat to give error
+ execute mode word
+ endif
+ endif
+endfunction
+
+
+" Word completion (^N/^R/^X^]) - force '.' inclusion
+function! s:AdaCompletion(cmd)
+ set iskeyword+=46
+ return a:cmd . "\<C-R>=<SNR>" . s:id . "_AdaCompletionEnd()\<CR>"
+endfunction
+function! s:AdaCompletionEnd()
+ set iskeyword-=46
+ return ''
+endfunction
+
+
+" Backspace at end of line after auto-inserted commentstring '-- ' wipes it
+function! s:AdaInsertBackspace()
+ let line = getline('.')
+ if col('.') > strlen(line) && match(line,'-- $') != -1 && match(&comments,'--') != -1
+ return "\<bs>\<bs>\<bs>"
+ else
+ return "\<bs>"
+ endif
+endfunction
+
+
+" Reset cpoptions
+let &cpoptions = s:cpoptions
+unlet s:cpoptions
+
+" vim: sts=2 sw=2 :
diff --git a/runtime/ftplugin/ant.vim b/runtime/ftplugin/ant.vim
new file mode 100644
index 000000000..d45ef3bb2
--- /dev/null
+++ b/runtime/ftplugin/ant.vim
@@ -0,0 +1,43 @@
+" Vim filetype plugin file
+" Language: ant
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show Ant-related files.
+if has("gui_win32")
+ let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" .
+ \ "Java Files (*.java)\t*.java\n" .
+ \ "Properties Files (*.prop*)\t*.prop*\n" .
+ \ "Manifest Files (*.mf)\t*.mf\n" .
+ \ s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/art.vim b/runtime/ftplugin/art.vim
new file mode 100644
index 000000000..cb95e6bf8
--- /dev/null
+++ b/runtime/ftplugin/art.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin
+" Language: ART-IM and ART*Enterprise
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: Apr 2, 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+run ftplugin/lisp.vim
+
+setl lw-=if
+setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,
+ \for,schema,while
diff --git a/runtime/ftplugin/aspvbs.vim b/runtime/ftplugin/aspvbs.vim
new file mode 100644
index 000000000..006e3ce20
--- /dev/null
+++ b/runtime/ftplugin/aspvbs.vim
@@ -0,0 +1,58 @@
+" Vim filetype plugin file
+" Language: aspvbs
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" .
+ \ "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words
+endif
+
+" ASP: Active Server Pages (with Visual Basic Script)
+" thanks to Gontran BAERTS
+if exists("loaded_matchit")
+ let s:notend = '\%(\<end\s\+\)\@<!'
+ let b:match_words =
+ \ s:notend . '\<If\>:^\s\+\<Else\>:\<ElseIf\>:\<end\s\+\<if\>,' .
+ \ s:notend . '\<Select\s\+\<Case\>:\<Case\>:\<Case\s\+\<Else\>:\<End\s\+\<Select\>,' .
+ \ '^\s*\<Sub\>:\<End\s\+\<Sub\>,' .
+ \ '^\s*\<Function\>:\<End\s\+\<Function\>,' .
+ \ '\<Class\>:\<End\s\+\<Class\>,' .
+ \ '^\s*\<Do\>:\<Loop\>,' .
+ \ '^\s*\<For\>:\<Next\>,' .
+ \ '\<While\>:\<Wend\>,' .
+ \ s:match_words
+endif
+
+" Change the :browse e filter to primarily show ASP-related files.
+if has("gui_win32")
+ let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter
+endif
+
+let b:undo_ftplugin = "unlet! b:match_words b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/automake.vim b/runtime/ftplugin/automake.vim
new file mode 100644
index 000000000..f25770c34
--- /dev/null
+++ b/runtime/ftplugin/automake.vim
@@ -0,0 +1,11 @@
+" Vim filetype plugin file
+" Langugage: Automake
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/ftplugin/pcp/automake/
+" Latest Revision: 2004-05-22
+" arch-tag: 3a78b0cd-27b2-410a-8e7b-51a1717c2a5b
+
+" Same as makefile filetype plugin for now.
+runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/ftplugin/bib.vim b/runtime/ftplugin/bib.vim
new file mode 100644
index 000000000..b4cd20fa5
--- /dev/null
+++ b/runtime/ftplugin/bib.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin
+" Language: BibTeX
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: May 21, 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setl cindent
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
new file mode 100644
index 000000000..3d507581f
--- /dev/null
+++ b/runtime/ftplugin/c.vim
@@ -0,0 +1,52 @@
+" Vim filetype plugin file
+" Language: C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 May 16
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+set cpo-=C
+
+let b:undo_ftplugin = "setl cin< fo< com<"
+ \ . "| if has('vms') | setl isk< | endif"
+
+setlocal cindent
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+
+" In VMS C keywords contain '$' characters.
+if has("vms")
+ setlocal iskeyword+=$
+endif
+
+" Win32 can filter files in the browse dialog
+if has("gui_win32") && !exists("b:browsefilter")
+ if &ft == "cpp"
+ let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
+ \ "C Header Files (*.h)\t*.h\n" .
+ \ "C Source Files (*.c)\t*.c\n" .
+ \ "All Files (*.*)\t*.*\n"
+ elseif &ft == "chscript"
+ let b:browsefilter = "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
+ \ "C Header Files (*.h)\t*.h\n" .
+ \ "C Source Files (*.c)\t*.c\n" .
+ \ "All Files (*.*)\t*.*\n"
+ else
+ let b:browsefilter = "C Source Files (*.c)\t*.c\n" .
+ \ "C Header Files (*.h)\t*.h\n" .
+ \ "Ch Source Files (*.ch *.chf)\t*.ch;*.chf\n" .
+ \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
+ \ "All Files (*.*)\t*.*\n"
+ endif
+endif
diff --git a/runtime/ftplugin/ch.vim b/runtime/ftplugin/ch.vim
new file mode 100644
index 000000000..ed09003b1
--- /dev/null
+++ b/runtime/ftplugin/ch.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin file
+" Language: Ch
+" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
+" URL: http://www.softintegration.com/download/vim/ftplugin/ch.vim
+" Last change: 2004 May 16
+" Created based on cpp.vim
+"
+" Ch is a C/C++ interpreter with many high level extensions
+"
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Behaves just like C
+runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim
new file mode 100644
index 000000000..47d58ccb9
--- /dev/null
+++ b/runtime/ftplugin/changelog.vim
@@ -0,0 +1,256 @@
+" Vim filetype plugin file
+" Language: generic Changelog file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/ftplugin/pcp/changelog/
+" Latest Revision: 2004-04-25
+" arch-tag: b00e2974-c559-4477-b7b2-3ef3f4061bdb
+" Variables:
+" g:changelog_timeformat -
+" description: the timeformat used in ChangeLog entries.
+" default: "%Y-%m-%d".
+" g:changelog_username -
+" description: the username to use in ChangeLog entries
+" default: try to deduce it from environment variables and system files.
+" Local Mappings:
+" <Leader>o -
+" adds a new changelog entry for the current user for the current date.
+" Global Mappings:
+" <Leader>o -
+" switches to the ChangeLog buffer opened for the current directory, or
+" opens it in a new buffer if it exists in the current directory. Then
+" it does the same as the local <Leader>o described above.
+" Notes:
+" run 'runtime ftplugin/changelog.vim' to enable the global mapping for
+" changelog files.
+" TODO:
+" should we perhaps open the ChangeLog file even if it doesn't exist already?
+" Problem is that you might end up with ChangeLog files all over the place.
+
+" If 'filetype' isn't "changelog", we must have been to add ChangeLog opener
+if &filetype == "changelog"
+ " Only do this when not done yet for this buffer
+ if exists("b:did_ftplugin")
+ finish
+ endif
+
+ " Don't load another plugin for this buffer
+ let b:did_ftplugin = 1
+
+ let cpo_save = &cpo
+ set cpo-=C
+
+ " The format of the date-time field (should have been called dateformat)
+ if !exists("g:changelog_timeformat")
+ let g:changelog_timeformat = "%Y-%m-%d"
+ endif
+
+ " Try to figure out a reasonable username of the form:
+ " Full Name <user@host>
+ if !exists("g:changelog_username")
+ if exists("$EMAIL_ADDRESS")
+ let g:changelog_username = $EMAIL_ADDRESS
+ elseif exists("$EMAIL")
+ let g:changelog_username = $EMAIL
+ else
+ " Get the users login name
+ let login = system('whoami')
+ if v:shell_error
+ let login = 'unknown'
+ else
+ let newline = stridx(login, "\n")
+ if newline != -1
+ let login = strpart(login, 0, newline)
+ endif
+ endif
+
+ " Try to full name from gecos field in /etc/passwd
+ if filereadable('/etc/passwd')
+ let name = substitute(
+ \system('cat /etc/passwd | grep ^`whoami`'),
+ \'^\%([^:]*:\)\{4}\([^:]*\):.*$', '\1', '')
+ endif
+
+ " If there is no such file, or there was some other problem try
+ " others
+ if !filereadable('/etc/passwd') || v:shell_error
+ " Maybe the environment has something of interest
+ if exists("$NAME")
+ let name = $NAME
+ else
+ " No? well, use the login name and capitalize first
+ " character
+ let name = toupper(login[0]) . strpart(login, 1)
+ endif
+ endif
+
+ " Only keep stuff before the first comma
+ let comma = stridx(name, ',')
+ if comma != -1
+ let name = strpart(name, 0, comma)
+ endif
+
+ " And substitute & in the real name with the login of our user
+ let amp = stridx(name, '&')
+ if amp != -1
+ let name = strpart(name, 0, amp) . toupper(login[0]) .
+ \strpart(login, 1) . strpart(name, amp + 1)
+ endif
+
+ " Get our hostname
+ let hostname = system("hostname")
+ if v:shell_error
+ let hostname = 'unknownhost'
+ else
+ let newline = stridx(hostname, "\n")
+ if newline != -1
+ let hostname = strpart(hostname, 0, newline)
+ endif
+ endif
+
+ " And finally set the username
+ let g:changelog_username = name.' <'.login.'@'.hostname.'>'
+ endif
+ endif
+
+ " Format used for new date-entries
+ if !exists("g:changelog_new_date_format")
+ let g:changelog_new_date_format = "%d %u\n\n\t* %c\n\n"
+ endif
+
+ " Format used for new entries to current date-entry
+ if !exists("g:changelog_new_entry_format")
+ let g:changelog_new_entry_format = "\t* %c"
+ endif
+
+ if !exists("g:changelog_date_entry_search")
+ let g:changelog_date_entry_search = '^\s*%d\_s*%u'
+ endif
+
+ " Substitutes specific items in new date-entry formats and search strings
+ " Can be done with substitute of course, but unclean, and need \@! then
+ function! s:substitute_items(str, date, user)
+ let str = a:str
+ let i = stridx(str, '%')
+ while i != -1
+ let char = str[i + 1]
+ if char == '%'
+ let middle = '%'
+ elseif char == 'd'
+ let middle = a:date
+ elseif char == 'u'
+ let middle = a:user
+ elseif char == 'c'
+ let middle = '{cursor}'
+ else
+ let middle = char
+ endif
+ let str = strpart(str, 0, i) . middle . strpart(str, i + 2)
+ let i = stridx(str, '%')
+ endwhile
+ return str
+ endfunction
+
+ function! s:position_cursor()
+ if search('{cursor}') > 0
+ let pos = line('.')
+ let line = getline(pos)
+ let cursor = stridx(line, '{cursor}')
+ call setline(pos, substitute(line, '{cursor}', '', ''))
+ endif
+ startinsert!
+ endfunction
+
+ " Internal function to create a new entry in the ChangeLog
+ function! s:new_changelog_entry()
+ " Deal with 'paste' option
+ let save_paste = &paste
+ let &paste = 1
+ 1
+ " Look for an entry for today by our user
+ let date = strftime(g:changelog_timeformat)
+ let search = s:substitute_items(g:changelog_date_entry_search, date,
+ \g:changelog_username)
+ if search(search) > 0
+ " Ok, now we look for the end of the date-entry, and add an entry
+ let pos = nextnonblank(line('.') + 1)
+ let line = getline(pos)
+ while line =~ '^\s\+\S\+'
+ let pos = pos + 1
+ let line = getline(pos)
+ endwhile
+ let insert = s:substitute_items(g:changelog_new_entry_format,
+ \'', '')
+ execute "normal! ".(pos - 1)."Go".insert
+ execute pos
+ else
+ " Flag for removing empty lines at end of new ChangeLogs
+ let remove_empty = line('$') == 1
+
+ " No entry today, so create a date-user header and insert an entry
+ let todays_entry = s:substitute_items(g:changelog_new_date_format,
+ \date, g:changelog_username)
+ " Make sure we have a cursor positioning
+ if stridx(todays_entry, '{cursor}') == -1
+ let todays_entry = todays_entry.'{cursor}'
+ endif
+
+ " Now do the work
+ execute "normal! i".todays_entry
+ if remove_empty
+ while getline('$') == ''
+ $delete
+ endwhile
+ endif
+
+ 1
+ endif
+
+ call s:position_cursor()
+
+ " And reset 'paste' option
+ let &paste = save_paste
+ endfunction
+
+ if exists(":NewChangelogEntry") != 2
+ map <buffer> <silent> <Leader>o <Esc>:call <SID>new_changelog_entry()<CR>
+ command! -nargs=0 NewChangelogEntry call s:new_changelog_entry()
+ endif
+
+ let b:undo_ftplugin = "setl com< tw< fo< et< ai<"
+
+ if &textwidth == 0
+ setlocal textwidth=78
+ endif
+ setlocal comments=
+ setlocal formatoptions+=t
+ setlocal noexpandtab
+ setlocal autoindent
+
+ let &cpo = cpo_save
+else
+ " Add the Changelog opening mapping
+ nmap <silent> <Leader>o :call <SID>open_changelog()<CR>
+
+ function! s:open_changelog()
+ if filereadable('ChangeLog')
+ if bufloaded('ChangeLog')
+ let buf = bufnr('ChangeLog')
+ execute "normal! \<C-W>t"
+ while winbufnr(winnr()) != buf
+ execute "normal! \<C-W>w"
+ endwhile
+ else
+ split ChangeLog
+ endif
+
+ if exists("g:mapleader")
+ execute "normal " . g:mapleader . "o"
+ else
+ execute "normal \\o"
+ endif
+ startinsert!
+ endif
+ endfunction
+endif
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/ftplugin/config.vim b/runtime/ftplugin/config.vim
new file mode 100644
index 000000000..e4e1a412f
--- /dev/null
+++ b/runtime/ftplugin/config.vim
@@ -0,0 +1,41 @@
+" Vim filetype plugin file
+" Language: config
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "Bourne Shell Files (*.sh)\t*.sh\n" .
+ \ "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/sh.vim ftplugin/sh_*.vim ftplugin/sh/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show configure-related files.
+if has("gui_win32")
+ let b:browsefilter="Configure Scripts (configure.*)\tconfigure.*\n" .
+ \ s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter | " . b:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/cpp.vim b/runtime/ftplugin/cpp.vim
new file mode 100644
index 000000000..8c3f211da
--- /dev/null
+++ b/runtime/ftplugin/cpp.vim
@@ -0,0 +1,12 @@
+" Vim filetype plugin file
+" Language: C++
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jan 15
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Behaves just like C
+runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
diff --git a/runtime/ftplugin/cs.vim b/runtime/ftplugin/cs.vim
new file mode 100644
index 000000000..7f45098a4
--- /dev/null
+++ b/runtime/ftplugin/cs.vim
@@ -0,0 +1,26 @@
+" Vim filetype plugin file
+" Language: C#
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 09 Mar 2004 14:09:33 CET
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setlocal cindent
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
+
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "C# Source Files (*.cs)\t*.cs\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/csc.vim b/runtime/ftplugin/csc.vim
new file mode 100644
index 000000000..d9f901086
--- /dev/null
+++ b/runtime/ftplugin/csc.vim
@@ -0,0 +1,26 @@
+" Vim filetype plugin file
+" Language: csc
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+if exists("loaded_matchit")
+ let b:match_words=
+ \ '\<fix\>:\<endfix\>,' .
+ \ '\<if\>:\<else\%(if\)\=\>:\<endif\>,' .
+ \ '\<!loopondimensions\>\|\<!looponselected\>:\<!endloop\>'
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:match_words"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/csh.vim b/runtime/ftplugin/csh.vim
new file mode 100644
index 000000000..d053cbbde
--- /dev/null
+++ b/runtime/ftplugin/csh.vim
@@ -0,0 +1,47 @@
+" Vim filetype plugin file
+" Language: csh
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal commentstring=#%s
+setlocal formatoptions-=t
+setlocal formatoptions+=crql
+
+" Csh: thanks to Johannes Zellner
+" - Both foreach and end must appear alone on separate lines.
+" - The words else and endif must appear at the beginning of input lines;
+" the if must appear alone on its input line or after an else.
+" - Each case label and the default label must appear at the start of a
+" line.
+" - while and end must appear alone on their input lines.
+if exists("loaded_matchit")
+ let b:match_words =
+ \ '^\s*\<if\>.*(.*).*\<then\>:'.
+ \ '^\s*\<else\>\s\+\<if\>.*(.*).*\<then\>:^\s*\<else\>:'.
+ \ '^\s*\<endif\>,'.
+ \ '\%(^\s*\<foreach\>\s\+\S\+\|^s*\<while\>\).*(.*):'.
+ \ '\<break\>:\<continue\>:^\s*\<end\>,'.
+ \ '^\s*\<switch\>.*(.*):^\s*\<case\>\s\+:^\s*\<default\>:^\s*\<endsw\>'
+endif
+
+" Change the :browse e filter to primarily show csh-related files.
+if has("gui_win32")
+ let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal commentstring< formatoptions<" .
+ \ " | unlet! b:match_words b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/css.vim b/runtime/ftplugin/css.vim
new file mode 100644
index 000000000..05eb9fff0
--- /dev/null
+++ b/runtime/ftplugin/css.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin file
+" Language: CSS
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/ftplugin/pcp/css/
+" Latest Revision: 2004-04-25
+" arch-tag: 5fa7c74f-bf1a-47c4-b06f-6efe8f48db3b
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl com<"
+
+setlocal comments=s1:/*,mb:*,ex:*/
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim
new file mode 100644
index 000000000..32db5a73d
--- /dev/null
+++ b/runtime/ftplugin/debchangelog.vim
@@ -0,0 +1,206 @@
+" Vim filetype plugin file
+" Language: Debian Changelog
+" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
+" Last Change: 23 March 2004
+
+if exists("g:did_changelog_ftplugin")
+ finish
+endif
+
+" Don't load another plugin (this is global)
+let g:did_changelog_ftplugin = 1
+
+" Helper functions returning various data.
+" Returns full name, either from $DEBFULLNAME or debianfullname.
+" TODO Is there a way to determine name from anywhere else?
+function <SID>FullName()
+ if exists("$DEBFULLNAME")
+ return $DEBFULLNAME
+ elseif exists("g:debianfullname")
+ return g:debianfullname
+ else
+ return "Your Name"
+ endif
+endfunction
+
+" Returns email address, from $DEBEMAIL, $EMAIL or debianemail.
+function <SID>Email()
+ if exists("$DEBEMAIL")
+ return $DEBEMAIL
+ elseif exists("$EMAIL")
+ return $EMAIL
+ elseif exists("g:debianemail")
+ return g:debianfullemail
+ else
+ return "your@email.address"
+ endif
+endfunction
+
+" Returns date in RFC822 format.
+function <SID>Date()
+ let savelang = v:lc_time
+ execute "language time C"
+ let dateandtime = strftime("%a, %d %b %Y %X %z")
+ execute "language time " . savelang
+ return dateandtime
+endfunction
+
+function <SID>WarnIfNotUnfinalised()
+ if match(getline("."), " -- [[:alpha:]][[:alnum:].]")!=-1
+ echohl WarningMsg
+ echo "The entry has not been unfinalised before editing."
+ echohl None
+ return 1
+ endif
+ return 0
+endfunction
+
+function <SID>Finalised()
+ let savelinenum = line(".")
+ normal 1G
+ call search("^ -- ")
+ if match(getline("."), " -- [[:alpha:]][[:alnum:].]")!=-1
+ let returnvalue = 1
+ else
+ let returnvalue = 0
+ endif
+ execute savelinenum
+ return returnvalue
+endfunction
+
+" These functions implement the menus
+function NewVersion()
+ " The new entry is unfinalised and shall be changed
+ amenu disable Changelog.New\ Version
+ amenu enable Changelog.Add\ Entry
+ amenu enable Changelog.Close\ Bug
+ amenu enable Changelog.Set\ Distribution
+ amenu enable Changelog.Set\ Urgency
+ amenu disable Changelog.Unfinalise
+ amenu enable Changelog.Finalise
+ call append(0, substitute(getline(1),'-\([[:digit:]]\+\))', '-Ü\1)', ''))
+ call append(1, "")
+ call append(2, "")
+ call append(3, " -- ")
+ call append(4, "")
+ call Distribution("unstable")
+ call Urgency("low")
+ normal 1G
+ call search(")")
+ normal h
+ normal 
+ call setline(1, substitute(getline(1),'-Ü\([[:digit:]]\+\))', '-\1)', ''))
+ call AddEntry()
+endfunction
+
+function AddEntry()
+ normal 1G
+ call search("^ -- ")
+ normal kk
+ call append(".", " * ")
+ normal jjj
+ let warn=<SID>WarnIfNotUnfinalised()
+ normal kk
+ if warn
+ echohl MoreMsg
+ call input("Hit ENTER")
+ echohl None
+ endif
+ startinsert!
+endfunction
+
+function CloseBug()
+ normal 1G
+ call search("^ -- ")
+ let warn=<SID>WarnIfNotUnfinalised()
+ normal kk
+ call append(".", " * (closes: #" . input("Bug number to close: ") . ")")
+ normal j^ll
+ startinsert
+endfunction
+
+function Distribution(dist)
+ call setline(1, substitute(getline(1), ") [[:lower:] ]*;", ") " . a:dist . ";", ""))
+endfunction
+
+function Urgency(urg)
+ call setline(1, substitute(getline(1), "urgency=.*$", "urgency=" . a:urg, ""))
+endfunction
+
+function <SID>UnfinaliseMenu()
+ " This means the entry shall be changed
+ amenu disable Changelog.New\ Version
+ amenu enable Changelog.Add\ Entry
+ amenu enable Changelog.Close\ Bug
+ amenu enable Changelog.Set\ Distribution
+ amenu enable Changelog.Set\ Urgency
+ amenu disable Changelog.Unfinalise
+ amenu enable Changelog.Finalise
+endfunction
+
+function Unfinalise()
+ call <SID>UnfinaliseMenu()
+ normal 1G
+ call search("^ -- ")
+ call setline(".", " -- ")
+endfunction
+
+function <SID>FinaliseMenu()
+ " This means the entry should not be changed anymore
+ amenu enable Changelog.New\ Version
+ amenu disable Changelog.Add\ Entry
+ amenu disable Changelog.Close\ Bug
+ amenu disable Changelog.Set\ Distribution
+ amenu disable Changelog.Set\ Urgency
+ amenu enable Changelog.Unfinalise
+ amenu disable Changelog.Finalise
+endfunction
+
+function Finalise()
+ call <SID>FinaliseMenu()
+ normal 1G
+ call search("^ -- ")
+ call setline(".", " -- " . <SID>FullName() . " <" . <SID>Email() . "> " . <SID>Date())
+endfunction
+
+
+function <SID>MakeMenu()
+ amenu &Changelog.&New\ Version :call NewVersion()<CR>
+ amenu Changelog.&Add\ Entry :call AddEntry()<CR>
+ amenu Changelog.&Close\ Bug :call CloseBug()<CR>
+ menu Changelog.-sep- <nul>
+
+ amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR>
+ amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR>
+ amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR>
+ menu Changelog.Set\ Distribution.-sep- <nul>
+ amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR>
+ amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR>
+ amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR>
+ amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR>
+
+ amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR>
+ amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR>
+ amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR>
+
+ menu Changelog.-sep- <nul>
+ amenu Changelog.U&nfinalise :call Unfinalise()<CR>
+ amenu Changelog.&Finalise :call Finalise()<CR>
+
+ if <SID>Finalised()
+ call <SID>FinaliseMenu()
+ else
+ call <SID>UnfinaliseMenu()
+ endif
+endfunction
+
+augroup changelogMenu
+au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif
+au BufLeave * if &filetype == "debchangelog" | aunmenu Changelog | endif
+augroup END
+
+" Debian changelogs are not supposed to have any other text width,
+" so the user cannot override this setting
+setlocal tw=78
+setlocal comments=f:*
+let b:undo_ftplugin = "setlocal tw< comments<"
diff --git a/runtime/ftplugin/dosbatch.vim b/runtime/ftplugin/dosbatch.vim
new file mode 100644
index 000000000..39a83c411
--- /dev/null
+++ b/runtime/ftplugin/dosbatch.vim
@@ -0,0 +1,21 @@
+" Vim filetype plugin file
+" Language: MS-DOS .bat files
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Last Change: 5th February 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" BAT comment formatting
+setlocal comments=b:rem,b:@rem,b:REM,b:@REM,b:::
+setlocal formatoptions-=t formatoptions+=rol
+
+" Define patterns for the browse file filter
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/dtd.vim b/runtime/ftplugin/dtd.vim
new file mode 100644
index 000000000..991118779
--- /dev/null
+++ b/runtime/ftplugin/dtd.vim
@@ -0,0 +1,33 @@
+" Vim filetype plugin file
+" Language: dtd
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal commentstring=<!--%s-->
+
+if exists("loaded_matchit")
+ let b:match_words = '<!--:-->,<!:>'
+endif
+
+" Change the :browse e filter to primarily show Java-related files.
+if has("gui_win32")
+ let b:browsefilter="DTD Files (*.dtd)\t*.dtd\n" .
+ \ "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal commentstring<" .
+ \ " | unlet! b:matchwords b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
new file mode 100644
index 000000000..d189bf465
--- /dev/null
+++ b/runtime/ftplugin/fortran.vim
@@ -0,0 +1,114 @@
+" Vim settings file
+" Language: Fortran90 (and Fortran95, Fortran77, F and elf90)
+" Version: 0.44
+" Last Change: 2003 May 18
+" URL: http://www.unb.ca/chem/ajit/ftplugin/fortran.vim
+" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
+" Usage: Do :help fortran-plugin from Vim
+
+" Only do these settings when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't do other file type settings for this buffer
+let b:did_ftplugin = 1
+
+" Determine whether this is a fixed or free format source file
+" if this hasn't been done yet
+if !exists("b:fortran_fixed_source")
+ if exists("fortran_free_source")
+ " User guarantees free source form
+ let b:fortran_fixed_source = 0
+ elseif exists("fortran_fixed_source")
+ " User guarantees fixed source form
+ let b:fortran_fixed_source = 1
+ else
+ " f90 and f95 allow both fixed and free source form
+ " assume fixed source form unless signs of free source form
+ " are detected in the first five columns of the first 25 lines
+ " Detection becomes more accurate and time-consuming if more lines
+ " are checked. Increase the limit below if you keep lots of comments at
+ " the very top of each file and you have a fast computer
+ let s:lmax = 25
+ if ( s:lmax > line("$") )
+ let s:lmax = line("$")
+ endif
+ let b:fortran_fixed_source = 1
+ let s:ln=1
+ while s:ln <= s:lmax
+ let s:test = strpart(getline(s:ln),0,5)
+ if s:test[0] !~ '[Cc*!#]' && s:test !~ '^ \+[!#]' && s:test =~ '[^ 0-9\t]'
+ let b:fortran_fixed_source = 0
+ break
+ endif
+ let s:ln = s:ln + 1
+ endwhile
+ endif
+endif
+
+" Set comments and textwidth according to source type
+if (b:fortran_fixed_source == 1)
+ setlocal comments=:!,:*,:C
+ " Fixed format requires a textwidth of 72 for code
+ setlocal tw=72
+ " If you need to add "&" on continued lines so that the code is
+ " compatible with both free and fixed format, then you should do so
+ " in column 73 and uncomment the next line
+ " setlocal tw=73
+else
+ setlocal comments=:!
+ " Free format allows a textwidth of 132 for code but 80 is more usual
+ setlocal tw=80
+endif
+
+" Set commentstring for foldmethod=marker
+setlocal cms=!%s
+
+" Tabs are not a good idea in Fortran so the default is to expand tabs
+if !exists("fortran_have_tabs")
+ setlocal expandtab
+endif
+
+" Set 'formatoptions' to break comment and text lines but allow long lines
+setlocal fo+=tcql
+
+setlocal include=^#\\=\\s*include\\s\\+
+
+let s:cposet=&cpoptions
+set cpoptions-=C
+
+" Define patterns for the matchit plugin
+if !exists("b:match_words")
+ let s:notend = '\%(\<end\s\+\)\@<!'
+ let s:notselect = '\%(\<select\s\+\)\@<!'
+ let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!'
+ let b:match_ignorecase = 1
+ let b:match_words =
+ \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' .
+ \ s:notelse . '\<if\s*(.\+)\s*then\>:' .
+ \ '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:\<end\s*if\>,'.
+ \ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'.
+ \ s:notend . '\<do\>:\<end\s*do\>,'.
+ \ s:notelse . '\<where\>:\<elsewhere\>:\<end\s*where\>,'.
+ \ s:notend . '\<type\s*[^(]:\<end\s*type\>,'.
+ \ s:notend . '\<interface\>:\<end\s*interface\>,'.
+ \ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'.
+ \ s:notend . '\<function\>:\<end\s*function\>,'.
+ \ s:notend . '\<module\>:\<end\s*module\>,'.
+ \ s:notend . '\<program\>:\<end\s*program\>'
+endif
+
+" File filters for :browse e
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Fortran Files (*.f;*.F;*.for;*.f77;*.f90;*.f95;*.fpp;*.ftn)\t*.f;*.F;*.for;*.f77;*.f90;*.f95;*.fpp;*.ftn\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+let b:undo_ftplugin = "setl fo< com< tw< cms< et< inc<"
+ \ . "| unlet! b:match_ignorecase b:match_words b:browsefilter"
+
+let &cpoptions=s:cposet
+unlet s:cposet
+
+" vim:sw=2
diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim
new file mode 100644
index 000000000..7334b1584
--- /dev/null
+++ b/runtime/ftplugin/html.vim
@@ -0,0 +1,40 @@
+" Vim filetype plugin file
+" Language: html
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2004 May 11
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal commentstring=<!--%s-->
+
+" HTML: thanks to Johannes Zellner and Benji Fisher.
+if exists("loaded_matchit")
+ let b:match_ignorecase = 1
+ let b:match_skip = 's:Comment'
+ let b:match_words = '<:>,' .
+ \ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
+ \ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
+ \ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
+endif
+
+" Change the :browse e filter to primarily show HTML-related files.
+if has("gui_win32")
+ let b:browsefilter="HTML Files (*.html,*.htm)\t*.htm*\n" .
+ \ "JavaScript Files (*.js)\t*.js\n" .
+ \ "Cascading StyleSheets (*.css)\t*.css\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal commentstring<"
+ \ " | unlet! b:match_ignorecase b:match_skip b:match_words b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/ishd.vim b/runtime/ftplugin/ishd.vim
new file mode 100644
index 000000000..63e1a747e
--- /dev/null
+++ b/runtime/ftplugin/ishd.vim
@@ -0,0 +1,30 @@
+" Vim filetype plugin file
+" Language: InstallShield (ft=ishd)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Sat, 24 May 2003 11:55:36 CEST
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+setlocal nocindent
+setlocal autoindent
+setlocal foldmethod=syntax
+
+set cpo-=C
+
+" matchit support
+if exists("loaded_matchit")
+ let b:match_ignorecase=0
+ let b:match_words=
+ \ '\%(^\s*\)\@<=\<function\>\s\+[^()]\+\s*(:\%(^\s*\)\@<=\<begin\>\s*$:\%(^\s*\)\@<=\<return\>:\%(^\s*\)\@<=\<end\>\s*;\s*$,' .
+ \ '\%(^\s*\)\@<=\<repeat\>\s*$:\%(^\s*\)\@<=\<until\>\s\+.\{-}\s*;\s*$,' .
+ \ '\%(^\s*\)\@<=\<switch\>\s*(.\{-}):\%(^\s*\)\@<=\<\%(case\|default\)\>:\%(^\s*\)\@<=\<endswitch\>\s*;\s*$,' .
+ \ '\%(^\s*\)\@<=\<while\>\s*(.\{-}):\%(^\s*\)\@<=\<endwhile\>\s*;\s*$,' .
+ \ '\%(^\s*\)\@<=\<for\>.\{-}\<\%(to\|downto\)\>:\%(^\s*\)\@<=\<endfor\>\s*;\s*$,' .
+ \ '\%(^\s*\)\@<=\<if\>\s*(.\{-})\s*then:\%(^\s*\)\@<=\<else\s*if\>\s*([^)]*)\s*then:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<endif\>\s*;\s*$'
+endif
+
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "InstallShield Files (*.rul)\t*.rul\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/java.vim b/runtime/ftplugin/java.vim
new file mode 100644
index 000000000..ba0bf3310
--- /dev/null
+++ b/runtime/ftplugin/java.vim
@@ -0,0 +1,63 @@
+" Vim filetype plugin file
+" Language: Java
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Change: 2004 May 16
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Go ahead and set this to get decent indenting even if the indent files
+" aren't being used. For people who really don't want any indentation,
+" let them turn it off.
+if !exists("g:ftplugin_java_no_indent")
+ setlocal cindent
+
+ "---------------------
+ " Correctly indent anonymous classes
+ " From Johannes Zellner <johannes@zellner.org>
+ setlocal cinoptions+=j1
+ "---------------------
+endif
+
+" For filename completion, prefer the .java extension over the .class
+" extension.
+set suffixes+=.class
+
+" Enable gf on import statements. Convert . in the package
+" name to / and append .java to the name, then search the path.
+setlocal includeexpr=substitute(v:fname,'\\.','/','g')
+setlocal suffixesadd=.java
+if exists("g:ftplugin_java_source_path")
+ let &l:path=g:ftplugin_java_source_path . ',' . &l:path
+endif
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal formatoptions-=t formatoptions+=croql
+
+" Set 'comments' to format dashed lists in comments. Behaves just like C.
+setlocal comments& comments^=sO:*\ -,mO:*\ \ ,exO:*/
+
+setlocal commentstring=//%s
+
+" Change the :browse e filter to primarily show Java-related files.
+if has("gui_win32")
+ let b:browsefilter="Java Files (*.java)\t*.java\n" .
+ \ "Properties Files (*.prop*)\t*.prop*\n" .
+ \ "Manifest Files (*.mf)\t*.mf\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal cindent< cinoptions< suffixes< suffixesadd<" .
+ \ " formatoptions< comments< commentstring< path< includeexpr<" .
+ \ " | unlet! b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/jsp.vim b/runtime/ftplugin/jsp.vim
new file mode 100644
index 000000000..7c6ac84ef
--- /dev/null
+++ b/runtime/ftplugin/jsp.vim
@@ -0,0 +1,66 @@
+" Vim filetype plugin file
+" Language: jsp
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "Java Files (*.java)\t*.java\n" .
+ \ "HTML Files (*.html, *.htm)\t*.htm*\n" .
+ \ "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+unlet b:did_ftplugin
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+ unlet b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+ unlet b:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words
+ unlet b:match_words
+endif
+
+runtime! ftplugin/java.vim ftplugin/java_*.vim ftplugin/java/*.vim
+let b:did_ftplugin = 1
+
+" Combine the new set of values with those previously included.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+endif
+if exists ("b:browsefilter")
+ let s:browsefilter = b:browsefilter . s:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words . ',' . s:matchwords
+endif
+
+" Load the combined list of match_words for matchit.vim
+if exists("loaded_matchit")
+ let b:match_words = s:match_words
+endif
+
+" Change the :browse e filter to primarily show JSP-related files.
+if has("gui_win32")
+ let b:browsefilter="JSP Files (*.jsp)\t*.jsp\n" . s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/kwt.vim b/runtime/ftplugin/kwt.vim
new file mode 100644
index 000000000..7be64229c
--- /dev/null
+++ b/runtime/ftplugin/kwt.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin file
+" Language: Kimwitu++
+" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
+" Last Change: 16 August 2001
+
+" Behaves almost like C++
+runtime! ftplugin/cpp.vim ftplugin/cpp_*.vim ftplugin/cpp/*.vim
+
+set cpo-=C
+
+" Limit the browser to related files
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Kimwitu/Kimwitu++ Files (*.k)\t*.k\n" .
+ \ "Lex/Flex Files (*.l)\t*.l\n" .
+ \ "Yacc/Bison Files (*.y)\t*.y\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Set the errorformat for the Kimwitu++ compiler
+set efm+=kc%.%#:\ error\ at\ %f:%l:\ %m
diff --git a/runtime/ftplugin/lisp.vim b/runtime/ftplugin/lisp.vim
new file mode 100644
index 000000000..5bc25af87
--- /dev/null
+++ b/runtime/ftplugin/lisp.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin
+" Language: Lisp
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: May 15, 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setl autoindent
+setl comments=:;
+setl define=^\\s*(def\\k*
+setl formatoptions-=t
+setl iskeyword+=+,-,*,/,%,<,=,>,:,$,?,!,@-@,94
+setl lisp
diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim
new file mode 100644
index 000000000..1e73f0c2d
--- /dev/null
+++ b/runtime/ftplugin/lprolog.vim
@@ -0,0 +1,37 @@
+" Vim settings file
+" Language: LambdaProlog (Teyjus)
+" Maintainer: Markus Mottl <markus@oefai.at>
+" URL: http://www.ai.univie.ac.at/~markus/vim/ftplugin/lprolog.vim
+" Last Change: 2003 May 11
+" 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
+" 2001 Sep 02 - initial release (MM)
+
+" Only do these settings when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't do other file type settings for this buffer
+let b:did_ftplugin = 1
+
+" Error format
+setlocal efm=%+A./%f:%l.%c:\ %m formatprg=fmt\ -w75\ -p\\%
+
+" Formatting of comments
+setlocal formatprg=fmt\ -w75\ -p\\%
+
+" Add mappings, unless the user didn't want this.
+if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
+ " Uncommenting
+ if !hasmapto('<Plug>Comment')
+ nmap <buffer> <LocalLeader>c <Plug>LUncomOn
+ vmap <buffer> <LocalLeader>c <Plug>BUncomOn
+ nmap <buffer> <LocalLeader>C <Plug>LUncomOff
+ vmap <buffer> <LocalLeader>C <Plug>BUncomOff
+ endif
+
+ nnoremap <buffer> <Plug>LUncomOn mz0i/* <ESC>$A */<ESC>`z
+ nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^\/\* \(.*\) \*\//\1/<CR>
+ vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i/*<ESC>`>o<ESC>0i*/<ESC>`<
+ vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
+endif
diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim
new file mode 100644
index 000000000..3bc640f3f
--- /dev/null
+++ b/runtime/ftplugin/lua.vim
@@ -0,0 +1,36 @@
+" Vim filetype plugin file.
+" Language: Lua 4.0+
+" Maintainer: Max Ischenko <mfi@ukr.net>
+" Last Change: 2001 Sep 17
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Set 'formatoptions' to break comment lines but not other lines, and insert
+" the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+setlocal com=:--
+setlocal cms="--%s"
+setlocal suffixesadd=.lua
+
+
+" The following lines enable the macros/matchit.vim plugin for
+" extended matching with the % key.
+
+set cpo-=C
+if exists("loaded_matchit")
+
+ let b:match_ignorecase = 0
+ let b:match_words =
+ \ '\<\%(do\|function\|if\)\>:' .
+ \ '\<\%(return\|else\|elseif\)\>:' .
+ \ '\<end\>,' .
+ \ '\<repeat\>:\<until\>'
+
+endif " exists("loaded_matchit")
diff --git a/runtime/ftplugin/mail.vim b/runtime/ftplugin/mail.vim
new file mode 100644
index 000000000..16bf19758
--- /dev/null
+++ b/runtime/ftplugin/mail.vim
@@ -0,0 +1,34 @@
+" Vim filetype plugin file
+" Language: Mail
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Feb 20
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl modeline< tw< fo<"
+
+" Don't use modelines in e-mail messages, avoid trojan horses
+setlocal nomodeline
+
+" many people recommend keeping e-mail messages 72 chars wide
+if &tw == 0
+ setlocal tw=72
+endif
+
+" Set 'formatoptions' to break text lines and keep the comment leader ">".
+setlocal fo+=tcql
+
+" Add mappings, unless the user didn't want this.
+if !exists("no_plugin_maps") && !exists("no_mail_maps")
+ " Quote text by inserting "> "
+ if !hasmapto('<Plug>MailQuote')
+ vmap <buffer> <LocalLeader>q <Plug>MailQuote
+ nmap <buffer> <LocalLeader>q <Plug>MailQuote
+ endif
+ vnoremap <buffer> <Plug>MailQuote :s/^/> /<CR>:noh<CR>``
+ nnoremap <buffer> <Plug>MailQuote :.,$s/^/> /<CR>:noh<CR>``
+endif
diff --git a/runtime/ftplugin/make.vim b/runtime/ftplugin/make.vim
new file mode 100644
index 000000000..c7397da7a
--- /dev/null
+++ b/runtime/ftplugin/make.vim
@@ -0,0 +1,25 @@
+" Vim filetype plugin file
+" Language: Make
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 May 04
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl et< fo< com< commentstring<"
+
+" Make sure a hard tab is used, required for most make programs
+setlocal noexpandtab softtabstop=0
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments
+setlocal com=sO:#\ -,mO:#\ \ ,b:#
+
+" Set 'commentstring' to put the marker after a #.
+setlocal commentstring=#\ %s
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
new file mode 100644
index 000000000..869ae9ab7
--- /dev/null
+++ b/runtime/ftplugin/man.vim
@@ -0,0 +1,177 @@
+" Vim filetype plugin file
+" Language: man
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2003 Dec 24
+
+" To make the ":Man" command available before editing a manual page, source
+" this script from your startup vimrc file.
+
+" If 'filetype' isn't "man", we must have been called to only define ":Man".
+if &filetype == "man"
+
+ " Only do this when not done yet for this buffer
+ if exists("b:did_ftplugin")
+ finish
+ endif
+ let b:did_ftplugin = 1
+
+ " allow dot and dash in manual page name.
+ setlocal iskeyword+=\.,-
+
+ " Add mappings, unless the user didn't want this.
+ if !exists("no_plugin_maps") && !exists("no_man_maps")
+ if !hasmapto('<Plug>ManBS')
+ nmap <buffer> <LocalLeader>h <Plug>ManBS
+ endif
+ nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:set nomod<CR>''
+
+ nnoremap <buffer> <c-]> :call <SID>PreGetPage(v:count)<CR>
+ nnoremap <buffer> <c-t> :call <SID>PopPage()<CR>
+ endif
+
+endif
+
+if exists(":Man") != 2
+ com -nargs=+ Man call s:GetPage(<f-args>)
+ nmap <Leader>K :call <SID>PreGetPage(0)<CR>
+endif
+
+" Define functions only once.
+if !exists("s:man_tag_depth")
+
+let s:man_tag_depth = 0
+
+if !has("win32") && $OSTYPE !~ 'cygwin\|linux' && system('uname -s') =~ "SunOS" && system('uname -r') =~ "^5"
+ let s:man_sect_arg = "-s"
+ let s:man_find_arg = "-l"
+else
+ let s:man_sect_arg = ""
+ let s:man_find_arg = "-w"
+endif
+
+func <SID>PreGetPage(cnt)
+ if a:cnt == 0
+ let old_isk = &iskeyword
+ setl iskeyword+=(,)
+ let str = expand("<cword>")
+ let &l:iskeyword = old_isk
+ let page = substitute(str, '(*\(\k\+\).*', '\1', '')
+ let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
+ if match(sect, '^[0-9 ]\+$') == -1
+ let sect = ""
+ endif
+ if sect == page
+ let sect = ""
+ endif
+ else
+ let sect = a:cnt
+ let page = expand("<cword>")
+ endif
+ call s:GetPage(sect, page)
+endfunc
+
+func <SID>GetCmdArg(sect, page)
+ if a:sect == ''
+ return a:page
+ endif
+ return s:man_sect_arg.' '.a:sect.' '.a:page
+endfunc
+
+func <SID>FindPage(sect, page)
+ let where = system("/usr/bin/man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
+ if where !~ "^/"
+ if matchstr(where, " [^ ]*$") !~ "^ /"
+ return 0
+ endif
+ endif
+ return 1
+endfunc
+
+func <SID>GetPage(...)
+ if a:0 >= 2
+ let sect = a:1
+ let page = a:2
+ elseif a:0 >= 1
+ let sect = ""
+ let page = a:1
+ else
+ return
+ endif
+
+ " To support: nmap K :Man <cword>
+ if page == '<cword>'
+ let page = expand('<cword>')
+ endif
+
+ if sect != "" && s:FindPage(sect, page) == 0
+ let sect = ""
+ endif
+ if s:FindPage(sect, page) == 0
+ echo "\nCannot find a '".page."'."
+ return
+ endif
+ exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")
+ exec "let s:man_tag_lin_".s:man_tag_depth." = ".line(".")
+ exec "let s:man_tag_col_".s:man_tag_depth." = ".col(".")
+ let s:man_tag_depth = s:man_tag_depth + 1
+
+ " Use an existing "man" window if it exists, otherwise open a new one.
+ if &filetype != "man"
+ let thiswin = winnr()
+ exe "norm! \<C-W>b"
+ if winnr() == 1
+ new
+ else
+ exe "norm! " . thiswin . "\<C-W>w"
+ while 1
+ if &filetype == "man"
+ break
+ endif
+ exe "norm! \<C-W>w"
+ if thiswin == winnr()
+ new
+ break
+ endif
+ endwhile
+ endif
+ endif
+ silent exec "edit $HOME/".page.".".sect."~"
+ " Avoid warning for editing the dummy file twice
+ set buftype=nofile noswapfile
+
+ set ma
+ silent exec "norm 1GdG"
+ let $MANWIDTH = winwidth(0)
+ silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
+ " Remove blank lines from top and bottom.
+ while getline(1) =~ '^\s*$'
+ silent norm ggdd
+ endwhile
+ while getline('$') =~ '^\s*$'
+ silent norm Gdd
+ endwhile
+ 1
+ setl ft=man nomod
+ setl bufhidden=hide
+ setl nobuflisted
+endfunc
+
+func <SID>PopPage()
+ if s:man_tag_depth > 0
+ let s:man_tag_depth = s:man_tag_depth - 1
+ exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
+ exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
+ exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
+ exec s:man_tag_buf."b"
+ exec s:man_tag_lin
+ exec "norm ".s:man_tag_col."|"
+ exec "unlet s:man_tag_buf_".s:man_tag_depth
+ exec "unlet s:man_tag_lin_".s:man_tag_depth
+ exec "unlet s:man_tag_col_".s:man_tag_depth
+ unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
+ endif
+endfunc
+
+endif
+
+" vim: set sw=2:
diff --git a/runtime/ftplugin/mf.vim b/runtime/ftplugin/mf.vim
new file mode 100644
index 000000000..b066d531e
--- /dev/null
+++ b/runtime/ftplugin/mf.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin
+" Language: METAFONT
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: May 27, 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setl com=:%
+setl fo-=t
diff --git a/runtime/ftplugin/mp.vim b/runtime/ftplugin/mp.vim
new file mode 100644
index 000000000..3385565b3
--- /dev/null
+++ b/runtime/ftplugin/mp.vim
@@ -0,0 +1,7 @@
+" Vim filetype plugin
+" Language: MetaPost
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: May 27, 2003
+
+runtime! ftplugin/mf.vim ftplugin/mf_*.vim ftplugin/mf/*.vim
diff --git a/runtime/ftplugin/objc.vim b/runtime/ftplugin/objc.vim
new file mode 100644
index 000000000..e41beb5da
--- /dev/null
+++ b/runtime/ftplugin/objc.vim
@@ -0,0 +1,12 @@
+" Vim filetype plugin file
+" Language: Objective C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Jan 15
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Behaves just like C
+runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
diff --git a/runtime/ftplugin/ocaml.vim b/runtime/ftplugin/ocaml.vim
new file mode 100644
index 000000000..96f2c0c78
--- /dev/null
+++ b/runtime/ftplugin/ocaml.vim
@@ -0,0 +1,49 @@
+" Vim settings file
+" Language: OCaml
+" Maintainers: Mike Leary <leary@nwlink.com>
+" Markus Mottl <markus@oefai.at>
+" URL: http://www.ai.univie.ac.at/~markus/vim/ftplugin/ocaml.vim
+" Last Change: 2003 May 11
+" 2001 Nov 01 - added local bindings for inserting
+" type holes using 'assert false' (MM)
+" 2001 Oct 02 - insert spaces in line comments (MM)
+
+" Only do these settings when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't do other file type settings for this buffer
+let b:did_ftplugin = 1
+
+set cpo-=C
+
+" Error formats
+setlocal efm=
+ \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
+ \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
+ \%+EReference\ to\ unbound\ regexp\ name\ %m,
+ \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
+ \%Wocamlyacc:\ w\ -\ %m,
+ \%-Zmake%.%#,
+ \%C%m
+
+" Add mappings, unless the user didn't want this.
+if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
+ " Uncommenting
+ if !hasmapto('<Plug>Comment')
+ nmap <buffer> <LocalLeader>c <Plug>LUncomOn
+ vmap <buffer> <LocalLeader>c <Plug>BUncomOn
+ nmap <buffer> <LocalLeader>C <Plug>LUncomOff
+ vmap <buffer> <LocalLeader>C <Plug>BUncomOff
+ endif
+
+ nnoremap <buffer> <Plug>LUncomOn mz0i(* <ESC>$A *)<ESC>`z
+ nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^(\* \(.*\) \*)/\1/<CR>
+ vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i(*<ESC>`>o<ESC>0i*)<ESC>`<
+ vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
+
+ if !hasmapto('<Plug>Abbrev')
+ iabbrev <buffer> ASS (assert false)
+ endif
+endif
diff --git a/runtime/ftplugin/occam.vim b/runtime/ftplugin/occam.vim
new file mode 100644
index 000000000..ed2c4f4ea
--- /dev/null
+++ b/runtime/ftplugin/occam.vim
@@ -0,0 +1,39 @@
+" Vim filetype plugin file
+" Language: occam
+" Copyright: Christian Jacobsen <clj3@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
+" Maintainer: Mario Schweigler <ms44@kent.ac.uk>
+" Last Change: 23 April 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+"{{{ Indent settings
+" Set shift width for indent
+setlocal shiftwidth=2
+" Set the tab key size to two spaces
+setlocal softtabstop=2
+" Let tab keys always be expanded to spaces
+setlocal expandtab
+"}}}
+
+"{{{ Formatting
+" Break comment lines and insert comment leader in this case
+setlocal formatoptions-=t formatoptions+=cql
+setlocal comments+=:--
+" Maximum length of comments is 78
+setlocal textwidth=78
+"}}}
+
+"{{{ File browsing filters
+" Win32 can filter files in the browse dialog
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "All Occam Files (*.occ *.inc)\t*.occ;*.inc\n" .
+ \ "Occam Include Files (*.inc)\t*.inc\n" .
+ \ "Occam Source Files (*.occ)\t*.occ\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+"}}}
+
diff --git a/runtime/ftplugin/pascal.vim b/runtime/ftplugin/pascal.vim
new file mode 100644
index 000000000..a3e8f8160
--- /dev/null
+++ b/runtime/ftplugin/pascal.vim
@@ -0,0 +1,15 @@
+" Vim filetype plugin file
+" Language: pascal
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+if exists("loaded_matchit")
+ let b:match_words='\<begin\>:\<end\>'
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:match_words"
diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim
new file mode 100644
index 000000000..9f714a9fe
--- /dev/null
+++ b/runtime/ftplugin/perl.vim
@@ -0,0 +1,66 @@
+" Vim filetype plugin file
+" Language: Perl
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Change: 2004 May 16
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal formatoptions+=crq
+
+setlocal comments=:#
+setlocal commentstring=#%s
+
+" Change the browse dialog on Win32 to show mainly Perl-related files
+if has("gui_win32")
+ let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
+ \ "Perl Modules (*.pm)\t*.pm\n" .
+ \ "Perl Documentation Files (*.pod)\t*.pod\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Provided by Ned Konz <ned at bike-nomad dot com>
+"---------------------------------------------
+setlocal include=\\<\\(use\|require\\)\\>
+setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
+setlocal define=[^A-Za-z_]
+
+" The following line changes a global variable but is necessary to make
+" gf and similar commands work. The change to iskeyword was incorrect.
+" Thanks to Andrew Pimlott for pointing out the problem. If this causes a
+" problem for you, add an after/ftplugin/perl.vim file that contains
+" set isfname-=:
+set isfname+=:
+"setlocal iskeyword=48-57,_,A-Z,a-z,:
+
+" Set this once, globally.
+if !exists("perlpath")
+ if executable("perl")
+ if &shellxquote != '"'
+ let perlpath = system('perl -e "print join(q/,/,@INC)"')
+ else
+ let perlpath = system("perl -e 'print join(q/,/,@INC)'")
+ endif
+ let perlpath = substitute(perlpath,',.$',',,','')
+ else
+ " If we can't call perl to get its path, just default to using the
+ " current directory and the directory of the current file.
+ let perlpath = ".,,"
+ endif
+endif
+
+let &l:path=perlpath
+"---------------------------------------------
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf<" .
+ \ " | unlet! b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/php.vim b/runtime/ftplugin/php.vim
new file mode 100644
index 000000000..a1c732979
--- /dev/null
+++ b/runtime/ftplugin/php.vim
@@ -0,0 +1,62 @@
+" Vim filetype plugin file
+" Language: php
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" .
+ \ "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words
+endif
+
+" Change the :browse e filter to primarily show PHP-related files.
+if has("gui_win32")
+ let b:browsefilter="PHP Files (*.php)\t*.php\n" . s:browsefilter
+endif
+
+" ###
+" Provided by Mikolaj Machowski <mikmach at wp dot pl>
+setlocal include=\\\(require\\\|include\\\)\\\(_once\\\)\\\?
+setlocal iskeyword+=$
+if exists("loaded_matchit")
+ let b:match_words = '\<switch\>:\<endswitch\>,' .
+ \ '\<if\>:\<elseif\>:\<else\>:\<endif\>,' .
+ \ '\<while\>:\<endwhile\>,' .
+ \ '\<do\>:\<while\>,' .
+ \ '\<for\>:\<endfor\>,' .
+ \ '\<foreach\>:\<endforeach\>,' .
+ \ s:match_words
+endif
+" ###
+
+setlocal commentstring=/*%s*/
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal cms< inc< isk<" .
+ \ " | unlet! b:browsefilter b:match_words | " .
+ \ s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/postscr.vim b/runtime/ftplugin/postscr.vim
new file mode 100644
index 000000000..56f4e249c
--- /dev/null
+++ b/runtime/ftplugin/postscr.vim
@@ -0,0 +1,31 @@
+" Vim filetype plugin file
+" Language: PostScript
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Last Change: 27th June 2002
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" PS comment formatting
+setlocal comments=b:%
+setlocal formatoptions-=t formatoptions+=rol
+
+" Define patterns for the matchit macro
+if !exists("b:match_words")
+ let b:match_ignorecase = 0
+ let b:match_words = '<<:>>,\<begin\>:\<end\>,\<save\>:\<restore\>,\<gsave\>:\<grestore\>'
+endif
+
+set cpo-=C
+
+" Define patterns for the browse file filter
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "PostScript Files (*.ps)\t*.ps\n" .
+ \ "EPS Files (*.eps)\t*.eps\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/pyrex.vim b/runtime/ftplugin/pyrex.vim
new file mode 100644
index 000000000..69bd93dd1
--- /dev/null
+++ b/runtime/ftplugin/pyrex.vim
@@ -0,0 +1,22 @@
+" Vim filetype plugin file
+" Language: Pyrex
+" Maintainer: Marco Barisione <marco.bari@people.it>
+" URL: http://marcobari.altervista.org/pyrex_vim.html
+" Last Change: 2004 May 16
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Behaves just like Python
+runtime! ftplugin/python.vim ftplugin/python_*.vim ftplugin/python/*.vim
+
+if has("gui_win32") && exists("b:browsefilter")
+ let b:browsefilter = "Pyrex files (*.pyx,*.pxd)\t*.pyx;*.pxd\n" .
+ \ "Python Files (*.py)\t*.py\n" .
+ \ "C Source Files (*.c)\t*.c\n" .
+ \ "C Header Files (*.h)\t*.h\n" .
+ \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim
new file mode 100644
index 000000000..4834b40ce
--- /dev/null
+++ b/runtime/ftplugin/python.vim
@@ -0,0 +1,41 @@
+" Vim filetype plugin file
+" Language: python
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Wed, 21 Apr 2004 13:13:08 CEST
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+setlocal cinkeys-=0#
+setlocal indentkeys-=0#
+setlocal include=\s*\\(from\\\|import\\)
+setlocal includeexpr=substitute(v:fname,'\\.','/','g')
+setlocal suffixesadd=.py
+setlocal comments-=:%
+setlocal commentstring=#%s
+
+set wildignore+=*.pyc
+
+nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>
+nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr>
+nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
+nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
+
+if exists('*<SID>Python_jump') | finish | endif
+
+fun! <SID>Python_jump(motion) range
+ let cnt = v:count1
+ let save = @/ " save last search pattern
+ mark '
+ while cnt > 0
+ silent! exe a:motion
+ let cnt = cnt - 1
+ endwhile
+ call histdel('/', -1)
+ let @/ = save " restore last search pattern
+endfun
+
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Python Files (*.py)\t*.py\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
diff --git a/runtime/ftplugin/rpl.vim b/runtime/ftplugin/rpl.vim
new file mode 100644
index 000000000..2b26ef1fa
--- /dev/null
+++ b/runtime/ftplugin/rpl.vim
@@ -0,0 +1,22 @@
+" Vim filetype plugin file
+" Language: RPL/2
+" Maintainer: Joël BERTRAND <rpl2@free.fr>
+" Last Change: 2002 Feb 07
+" Version: 0.1
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setlocal autoindent
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim
new file mode 100644
index 000000000..98dd5a07b
--- /dev/null
+++ b/runtime/ftplugin/rst.vim
@@ -0,0 +1,23 @@
+" Vim filetype plugin file
+" Language: reStructuredText Documentation Format
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/ftplugin/pcp/rst/
+" Latest Revision: 2004-04-25
+" arch-tag: 618bf504-81ba-4518-bad2-43ba2b844a26
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl com< cms<"
+
+setlocal comments=fb:..
+setlocal commentstring=..\ %s
+setlocal expandtab
+setlocal sts=2 sw=2
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim
new file mode 100644
index 000000000..e21afeee5
--- /dev/null
+++ b/runtime/ftplugin/ruby.vim
@@ -0,0 +1,14 @@
+" Vim filetype plugin
+" Language: Ruby
+" Maintainer: Gavin Sinclair <gsinclair@soyabean.com.au>
+" Last Change: 2002/08/12
+" URL: www.soyabean.com.au/gavin/vim/index.html
+
+" Only do this when not done yet for this buffer
+if (exists("b:did_ftplugin"))
+ finish
+endif
+let b:did_ftplugin = 1
+
+" There are no known setting particularly appropriate for Ruby. Please
+" contact the maintainer if you think of some.
diff --git a/runtime/ftplugin/scheme.vim b/runtime/ftplugin/scheme.vim
new file mode 100644
index 000000000..7d34f7217
--- /dev/null
+++ b/runtime/ftplugin/scheme.vim
@@ -0,0 +1,7 @@
+" Vim filetype plugin
+" Language: Scheme
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: Apr 2, 2003
+
+run ftplugin/lisp.vim
diff --git a/runtime/ftplugin/sgml.vim b/runtime/ftplugin/sgml.vim
new file mode 100644
index 000000000..4a19ddae7
--- /dev/null
+++ b/runtime/ftplugin/sgml.vim
@@ -0,0 +1,39 @@
+" Vim filetype plugin file
+" Language: sgml
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 30
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show xml-related files.
+if has("gui_win32")
+ let b:browsefilter="SGML Files (*.sgml,*.sgm)\t*.sgm*\n" . s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim
new file mode 100644
index 000000000..183215a12
--- /dev/null
+++ b/runtime/ftplugin/sh.vim
@@ -0,0 +1,38 @@
+" Vim filetype plugin file
+" Language: sh
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal commentstring=#%s
+
+" Shell: thanks to Johannes Zellner
+if exists("loaded_matchit")
+ let s:sol = '\%(;\s*\|^\s*\)\@<=' " start of line
+ let b:match_words =
+ \ s:sol.'if\>:' . s:sol.'elif\>:' . s:sol.'else\>:' . s:sol. 'fi\>,' .
+ \ s:sol.'\%(for\|while\)\>:' . s:sol. 'done\>,' .
+ \ s:sol.'case\>:' . s:sol. 'esac\>'
+endif
+
+" Change the :browse e filter to primarily show shell-related files.
+if has("gui_win32")
+ let b:browsefilter="Bourne Shell Scripts (*.sh)\t*.sh\n" .
+ \ "Korn Shell Scripts (*.ksh)\t*.ksh\n" .
+ \ "Bash Shell Scripts (*.bash)\t*.bash\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal cms< | unlet! b:browsefilter b:match_words"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim
new file mode 100644
index 000000000..3b1d70a48
--- /dev/null
+++ b/runtime/ftplugin/spec.vim
@@ -0,0 +1,168 @@
+" Plugin to update the %changelog section of RPM spec files
+" Filename: spec.vim
+" Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com>
+" Last Change: Wed, 10 Apr 2002 16:28:52 -0300
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+if !exists("no_plugin_maps") && !exists("no_spec_maps")
+ if !hasmapto("<Plug>SpecChangelog")
+ map <buffer> <LocalLeader>c <Plug>SpecChangelog
+ endif
+endif
+
+noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
+
+if !exists("*s:SpecChangelog")
+ function s:SpecChangelog(format)
+ if strlen(a:format) == 0
+ if !exists("g:spec_chglog_format")
+ let email = input("Email address: ")
+ let g:spec_chglog_format = "%a %b %d %Y " . l:email
+ echo "\r"
+ endif
+ let format = g:spec_chglog_format
+ else
+ if !exists("g:spec_chglog_format")
+ let g:spec_chglog_format = a:format
+ endif
+ let format = a:format
+ endif
+ let line = 0
+ let name = ""
+ let ver = ""
+ let rel = ""
+ let nameline = -1
+ let verline = -1
+ let relline = -1
+ let chgline = -1
+ while (line <= line("$"))
+ let linestr = getline(line)
+ if (name == "" && linestr =~? '^Name:')
+ let nameline = line
+ let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
+ elseif (ver == "" && linestr =~? '^Version:')
+ let verline = line
+ let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
+ elseif (rel == "" && linestr =~? '^Release:')
+ let relline = line
+ let rel = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
+ elseif (linestr =~? '^%changelog')
+ let chgline = line
+ execute line
+ break
+ endif
+ let line = line+1
+ endwhile
+ if (nameline != -1 && verline != -1 && relline != -1)
+ let include_release_info = exists("g:spec_chglog_release_info")
+ let name = s:ParseRpmVars(name, nameline)
+ let ver = s:ParseRpmVars(ver, verline)
+ let rel = s:ParseRpmVars(rel, relline)
+ else
+ let include_release_info = 0
+ endif
+ if (chgline == -1)
+ let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3)
+ if (option == 1)
+ call append(line("$"),"")
+ call append(line("$"),"%changelog")
+ execute line("$")
+ let chgline = line(".")
+ elseif (option == 2)
+ call append(line("."),"%changelog")
+ normal j
+ chgline = line(".")
+ endif
+ endif
+ if (chgline != -1)
+ let parsed_format = "* ".strftime(format)
+ let release_info = "+ ".name."-".ver."-".rel
+ let wrong_format = 0
+ let wrong_release = 0
+ let insert_line = 0
+ if (getline(chgline+1) != parsed_format)
+ let wrong_format = 1
+ endif
+ if (include_release_info && getline(chgline+2) != release_info)
+ let wrong_release = 1
+ endif
+ if (wrong_format || wrong_release)
+ if (include_release_info && !wrong_release && !exists("g:spec_chglog_never_increase_release"))
+ let option = confirm("Increase release? ","&Yes\n&No",1)
+ if (option == 1)
+ execute relline
+ normal 
+ let rel = substitute(strpart(getline(relline),8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
+ let release_info = "+ ".name."-".ver."-".rel
+ endif
+ endif
+ let n = 0
+ call append(chgline+n, parsed_format)
+ if include_release_info
+ let n = n + 1
+ call append(chgline+n, release_info)
+ endif
+ let n = n + 1
+ call append(chgline+n,"- ")
+ let n = n + 1
+ call append(chgline+n,"")
+ let insert_line = chgline+n
+ else
+ let line = chgline
+ if !exists("g:spec_chglog_prepend")
+ while !(getline(line+2) =~ '^\( *\|\*.*\)$')
+ let line = line+1
+ endwhile
+ endif
+ call append(line+1,"- ")
+ let insert_line = line+2
+ endif
+ execute insert_line
+ startinsert!
+ endif
+ endfunction
+endif
+
+if !exists("*s:ParseRpmVars")
+ function s:ParseRpmVars(str, strline)
+ let end = -1
+ let ret = ""
+ while (1)
+ let start = match(a:str, "\%{", end+1)
+ if (start == -1)
+ let ret = ret . strpart(a:str, end+1)
+ break
+ endif
+ let ret = ret . strpart(a:str, end+1, start-(end+1))
+ let end = match(a:str, "}", start)
+ if (end == -1)
+ let ret = ret . strpart(a:str, start)
+ break
+ endif
+ let varname = strpart(a:str, start+2, end-(start+2))
+ execute a:strline
+ let definestr = "^[ \t]*%define[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$"
+ let linenum = search(definestr, "bW")
+ if (linenum != -1)
+ let ret = ret . substitute(getline(linenum), definestr, "\\1", "")
+ else
+ let ret = ret . strpart(str, start, end+1-start)
+ endif
+ endwhile
+ return ret
+ endfunction
+endif
+
+" The following lines, along with the macros/matchit.vim plugin,
+" make it easy to navigate the different sections of a spec file
+" with the % key (thanks to Max Ischenko).
+
+let b:match_ignorecase = 0
+let b:match_words =
+ \ '^Name:^%description:^%clean:^%setup:^%build:^%install:^%files:' .
+ \ '^%package:^%preun:^%postun:^%changelog'
+
diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim
new file mode 100644
index 000000000..afbdf555c
--- /dev/null
+++ b/runtime/ftplugin/sql.vim
@@ -0,0 +1,35 @@
+" Vim filetype plugin file
+" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
+" Version: 0.02
+" Maintainer: David Fishburn <fishburn@ianywhere.com>
+" Last Change: Tue May 27 2003 09:33:31
+
+" This file should only contain values that are common to all SQL languages
+" Oracle, Microsoft SQL Server, Sybase ASA/ASE, MySQL, and so on
+" If additional features are required create:
+" vimfiles/after/ftplugin/sql.vim
+" to override and add any of your own settings
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Define patterns for the matchit macro
+if !exists("b:match_words")
+ " SQL is generally case insensitive
+ let b:match_ignorecase = 1
+ let b:match_words =
+ \ '\<begin\>:\<end\>\(;\)\?$,'.
+ \ '\<if\>:\<elsif\>:\<elseif\>:\<else\>:'.
+ \ '\%(\<end\s\+\)\@<!' . '\<if\>:\<end\s\+if\>,'.
+ \ '\<loop\>:\<break\>:\<continue\>:'.
+ \ '\%(\<end\s\+\)\@<!' . '\<loop\>:\<end\s\+loop\>,'.
+ \ '\<for\>:\<break\>:\<continue\>:'.
+ \ '\%(\<end\s\+\)\@<!' . '\<for\>:\<end\s\+for\>,'.
+ \ '\<case\>:\<when\>:\<default\>:'.
+ \ '\%(\<end\s\+\)\@<!' . '\<case\>:\<end\s\+case\>'
+endif
diff --git a/runtime/ftplugin/svg.vim b/runtime/ftplugin/svg.vim
new file mode 100644
index 000000000..4544172d0
--- /dev/null
+++ b/runtime/ftplugin/svg.vim
@@ -0,0 +1,39 @@
+" Vim filetype plugin file
+" Language: svg
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show xml-related files.
+if has("gui_win32")
+ let b:browsefilter="SVG Files (*.svg)\t*.svg\n" . s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/tcsh.vim b/runtime/ftplugin/tcsh.vim
new file mode 100644
index 000000000..4c724e68b
--- /dev/null
+++ b/runtime/ftplugin/tcsh.vim
@@ -0,0 +1,39 @@
+" Vim filetype plugin file
+" Language: tcsh
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "csh Files (*.csh)\t*.csh\n" .
+ \ "All Files (*.*)\t*.*\n"
+
+runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show tcsh-related files.
+if has("gui_win32")
+ let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" . s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/tex.vim b/runtime/ftplugin/tex.vim
new file mode 100644
index 000000000..1871e8fd5
--- /dev/null
+++ b/runtime/ftplugin/tex.vim
@@ -0,0 +1,112 @@
+" LaTeX filetype plugin
+" Language: LaTeX (ft=tex)
+" Maintainer: Benji Fisher, Ph.D. <benji@member.AMS.org>
+" Version: 1.2
+" Last Change: Tue 11 May 2004 04:49:20 PM EDT
+" URL: http://www.vim.org/script.php?script_id=411
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" This may be used to set b:tex_flavor. A more complete version can be found
+" in foo.vim (see http://www.vim.org/script.php?script_id=72).
+if !exists("*s:GetModelines")
+ fun! s:GetModelines(pat, ...)
+ " Long but simple: set start line and finish line.
+ let EOF = line("$")
+ if a:0 > 1
+ let start = a:1 | let finish = a:2
+ elseif a:0 == 1
+ if a:1 > 0
+ let finish = a:1
+ else
+ let start = EOF + a:1 + 1
+ endif
+ endif
+ if !exists("start") || start < 1
+ let start = 1
+ endif
+ if !exists("finish") || finish > EOF
+ let finish = EOF
+ endif
+ let n = 0
+ silent! execute start .",". finish
+ \ 'g/' . escape(a:pat, "/") . "/let n=line('.')"
+ if n
+ execute "normal!\<C-O>"
+ endif
+ return n . ":"
+ endfun
+endif " !exists("*GetModelines")
+
+" Define the buffer-local variable b:tex_flavor to "tex" (for plain) or
+" "latex".
+" 1. Check the first line of the file for "%&<format>".
+" 2. Check the first 1000 lines for "\begin{document}".
+" 3. Check for a global variable g:tex_flavor, can be set in user's vimrc.
+" 4. Default to "latex".
+" 5. Strip "pdf" and change "plain" to "tex".
+if getline(1) =~ '^%&\s*\k\+'
+ let b:tex_flavor = matchstr(getline(1), '%&\s*\zs\k\+')
+elseif s:GetModelines('\\begin\s*{\s*document\s*}', 1000) != "0:"
+ let b:tex_flavor = "latex"
+elseif exists("g:tex_flavor")
+ let b:tex_flavor = g:tex_flavor
+else
+ let b:tex_flavor = "latex"
+endif
+let b:tex_flavor = substitute(b:tex_flavor, 'pdf', '', '')
+if b:tex_flavor == "plain"
+ let b:tex_flavor = "tex"
+endif
+
+" Set 'comments' to format dashed lists in comments
+setlocal com=sO:%\ -,mO:%\ \ ,eO:%%,:%
+
+" Set 'commentstring' to recognize the % comment character:
+" (Thanks to Ajit Thakkar.)
+setlocal cms=%%s
+
+" Allow "[d" to be used to find a macro definition:
+" Recognize plain TeX \def as well as LaTeX \newcommand and \renewcommand .
+" I may as well add the AMS-LaTeX DeclareMathOperator as well.
+let &l:define='\\\([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\='
+ \ . 'def\|\\font\|\\\(future\)\=let'
+ \ . '\|\\new\(count\|dimen\|skip\|muskip\|box\|toks\|read\|write'
+ \ . '\|fam\|insert\)'
+ \ . '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'
+ \ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\='
+ \ . '\|DeclareMathOperator\s*{\=\s*'
+
+" Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :
+setlocal include=\\\\input\\\\|\\\\include{
+setlocal suffixesadd=.tex
+" On some file systems, "{" and "}" are inluded in 'isfname'. In case the
+" TeX file has \include{fname} (LaTeX only), strip everything except "fname".
+let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"
+" fun! TexIncludeExpr()
+" let fname = substitute(v:fname, '}.*', '', '')
+" return fname
+" endfun
+
+" The following lines enable the macros/matchit.vim plugin for
+" extended matching with the % key.
+" TODO: Customize this based on b:tex_flavor .
+if exists("loaded_matchit")
+ let b:match_ignorecase = 0
+ \ | let b:match_skip = 'r:\\\@<!\%(\\\\\)*%'
+ \ | let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' .
+ \ '\\begin\s*\({\a\+\*\=}\):\\end\s*\1'
+endif " exists("loaded_matchit")
+
+let &cpo = s:save_cpo
+
+" vim:sts=2:sw=2:
diff --git a/runtime/ftplugin/vb.vim b/runtime/ftplugin/vb.vim
new file mode 100644
index 000000000..bb4c23a2c
--- /dev/null
+++ b/runtime/ftplugin/vb.vim
@@ -0,0 +1,47 @@
+" Vim filetype plugin file
+" Language: VisualBasic (ft=vb)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+setlocal nocindent
+setlocal autoindent
+setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
+
+" we need this wrapper, as call doesn't allow a count
+fun! <SID>VbSearch(pattern, flags)
+ let cnt = v:count1
+ while cnt > 0
+ call search(a:pattern, a:flags)
+ let cnt = cnt - 1
+ endwhile
+endfun
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" NOTE the double escaping \\|
+nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr>
+nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr>
+nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
+nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
+
+" matchit support
+if exists("loaded_matchit")
+ let b:match_ignorecase=1
+ let b:match_words=
+ \ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
+ \ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
+ \ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
+ \ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
+ \ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
+ \ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
+ \ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
+ \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
+ \ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/verilog.vim b/runtime/ftplugin/verilog.vim
new file mode 100644
index 000000000..8a8cfbe6b
--- /dev/null
+++ b/runtime/ftplugin/verilog.vim
@@ -0,0 +1,45 @@
+" Vim filetype plugin file
+" Language: Verilog HDL
+" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
+" Last Change: Wed Oct 31 16:16:19 CST 2001
+" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croqlm1
+
+" Set 'comments' to format dashed lists in comments.
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+
+" Format comments to be up to 78 characters long
+setlocal tw=75
+
+set cpo-=C
+
+" Win32 can filter files in the browse dialog
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Let the matchit plugin know what items can be matched.
+if exists("loaded_matchit")
+ let b:match_ignorecase=0
+ let b:match_words=
+ \ '\<begin\>:\<end\>,' .
+ \ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
+ \ '\<module\>:\<endmodule\>,' .
+ \ '\<if\>:\<else\>,' .
+ \ '\<function\>:\<endfunction\>,' .
+ \ '`ifdef\>:`else\>:`endif\>,' .
+ \ '\<task\>:\<endtask\>,' .
+ \ '\<specify\>:\<endspecify\>'
+endif
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
new file mode 100644
index 000000000..85e74f3f1
--- /dev/null
+++ b/runtime/ftplugin/vim.vim
@@ -0,0 +1,61 @@
+" Vim filetype plugin
+" Language: Vim
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Feb 20
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let cpo_save = &cpo
+set cpo-=C
+
+let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
+ \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
+
+" Set 'formatoptions' to break comment lines but not other lines,
+" and insert the comment leader when hitting <CR> or using "o".
+setlocal fo-=t fo+=croql
+
+" Set 'comments' to format dashed lists in comments
+setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
+
+" Format comments to be up to 78 characters long
+if &tw == 0
+ setlocal tw=78
+endif
+
+" Comments start with a double quote
+setlocal commentstring=\"%s
+
+" Move around functions.
+noremap <silent><buffer> [[ :call search('^\s*fu\%[nction]\>', "bW")<CR>
+noremap <silent><buffer> ]] :call search('^\s*fu\%[nction]\>', "W")<CR>
+noremap <silent><buffer> [] :call search('^\s*endf*\%[unction]\>', "bW")<CR>
+noremap <silent><buffer> ][ :call search('^\s*endf*\%[unction]\>', "W")<CR>
+
+" Move around comments
+noremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
+noremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
+
+" Let the matchit plugin know what items can be matched.
+if exists("loaded_matchit")
+ let b:match_ignorecase = 0
+ let b:match_words =
+ \ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
+ \ '\<wh\%[ile]\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endw\%[hile]\>,' .
+ \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
+ \ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
+ \ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
+ \ '(:)'
+ " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
+ let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
+ \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
+endif
+
+let &cpo = cpo_save
+setlocal cpo+=M " makes \%( match \)
diff --git a/runtime/ftplugin/xhtml.vim b/runtime/ftplugin/xhtml.vim
new file mode 100644
index 000000000..8011529c5
--- /dev/null
+++ b/runtime/ftplugin/xhtml.vim
@@ -0,0 +1,66 @@
+" Vim filetype plugin file
+" Language: xhtml
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2004 May 11
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" .
+ \ "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+unlet b:did_ftplugin
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+ unlet b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+ unlet b:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words
+ unlet b:match_words
+endif
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+let b:did_ftplugin = 1
+
+" Combine the new set of values with those previously included.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter . s:browsefilter
+endif
+if exists("b:match_words")
+ let s:match_words = b:match_words . "," . s:match_words
+endif
+
+" Load the combined list of match_words for matchit.vim
+if exists("loaded_matchit")
+ let b:match_words = s:match_words
+endif
+
+" Change the :browse e filter to primarily show tcsh-related files.
+if has("gui_win32")
+ let b:browsefilter=s:browsefilter
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/xml.vim b/runtime/ftplugin/xml.vim
new file mode 100644
index 000000000..7bde8e724
--- /dev/null
+++ b/runtime/ftplugin/xml.vim
@@ -0,0 +1,47 @@
+" Vim filetype plugin file
+" Language: xml
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+setlocal commentstring=<!--%s-->
+
+" XML: thanks to Johannes Zellner and Akbar Ibrahim
+" - case sensitive
+" - don't match empty tags <fred/>
+" - match <!--, --> style comments (but not --, --)
+" - match <!, > inlined dtd's. This is not perfect, as it
+" gets confused for example by
+" <!ENTITY gt ">">
+if exists("loaded_matchit")
+ let b:match_ignorecase=0
+ let b:match_words =
+ \ '<:>,' .
+ \ '<\@<=!\[CDATA\[:]]>,'.
+ \ '<\@<=!--:-->,'.
+ \ '<\@<=?\k\+:?>,'.
+ \ '<\@<=\([^ \t>/]\+\)\%(\s\+[^>]*\%([^/]>\|$\)\|>\|$\):<\@<=/\1>,'.
+ \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>'
+endif
+
+" Change the :browse e filter to primarily show xml-related files.
+if has("gui_win32")
+ let b:browsefilter="XML Files (*.xml)\t*.xml\n" .
+ \ "DTD Files (*.dtd)\t*.dtd\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Undo the stuff we changed.
+let b:undo_ftplugin = "setlocal cms<" .
+ \ " | unlet! b:match_ignorecase b:match_words b:browsefilter"
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/xs.vim b/runtime/ftplugin/xs.vim
new file mode 100644
index 000000000..cf3318258
--- /dev/null
+++ b/runtime/ftplugin/xs.vim
@@ -0,0 +1,12 @@
+" Vim filetype plugin file
+" Language: XS (Perl extension interface language)
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Sep 18
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Just use the C plugin for now.
+runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim
diff --git a/runtime/ftplugin/xsd.vim b/runtime/ftplugin/xsd.vim
new file mode 100644
index 000000000..1cd7adc76
--- /dev/null
+++ b/runtime/ftplugin/xsd.vim
@@ -0,0 +1,38 @@
+" Vim filetype plugin file
+" Language: xsd
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2003 Sep 29
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+" Make sure the continuation lines below do not cause problems in
+" compatibility mode.
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
+ \ "All Files (*.*)\t*.*\n"
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+let b:did_ftplugin = 1
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+ let s:undo_ftplugin = b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+ let s:browsefilter = b:browsefilter
+endif
+
+" Change the :browse e filter to primarily show xsd-related files.
+if has("gui_win32")
+ let b:browsefilter="XSD Files (*.xsd)\t*.xsd\n" . s:browsefilter
+endif
+
+let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
+
+" Restore the saved compatibility options.
+let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/xslt.vim b/runtime/ftplugin/xslt.vim
new file mode 100644
index 000000000..a4b80a614
--- /dev/null
+++ b/runtime/ftplugin/xslt.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin file
+" Language: xslt
+" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
+" Last Changed: 2002 Nov 26
+" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
+
+if exists("b:did_ftplugin") | finish | endif
+
+runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
+
+let b:did_ftplugin = 1
+
+" Change the :browse e filter to primarily show xsd-related files.
+if has("gui_win32") && exists("b:browsefilter")
+ let b:browsefilter="XSLT Files (*.xsl,*.xslt)\t*.xsl,*.xslt\n" . b:browsefilter
+endif
diff --git a/runtime/ftplugof.vim b/runtime/ftplugof.vim
new file mode 100644
index 000000000..cd99ce05a
--- /dev/null
+++ b/runtime/ftplugof.vim
@@ -0,0 +1,11 @@
+" Vim support file to switch off loading plugins for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2002 Apr 04
+
+if exists("did_load_ftplugin")
+ unlet did_load_ftplugin
+endif
+
+" Remove all autocommands in the filetypeplugin group
+silent! au! filetypeplugin *
diff --git a/runtime/gvimrc_example.vim b/runtime/gvimrc_example.vim
new file mode 100644
index 000000000..5a5197e99
--- /dev/null
+++ b/runtime/gvimrc_example.vim
@@ -0,0 +1,59 @@
+" An example for a gvimrc file.
+" The commands in this are executed when the GUI is started.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2001 Sep 02
+"
+" To use it, copy it to
+" for Unix and OS/2: ~/.gvimrc
+" for Amiga: s:.gvimrc
+" for MS-DOS and Win32: $VIM\_gvimrc
+" for OpenVMS: sys$login:.gvimrc
+
+" Make external commands work through a pipe instead of a pseudo-tty
+"set noguipty
+
+" set the X11 font to use
+" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
+
+set ch=2 " Make command line two lines high
+
+set mousehide " Hide the mouse when typing text
+
+" Make shift-insert work like in Xterm
+map <S-Insert> <MiddleMouse>
+map! <S-Insert> <MiddleMouse>
+
+" Only do this for Vim version 5.0 and later.
+if version >= 500
+
+ " I like highlighting strings inside C comments
+ let c_comment_strings=1
+
+ " Switch on syntax highlighting if it wasn't on yet.
+ if !exists("syntax_on")
+ syntax on
+ endif
+
+ " Switch on search pattern highlighting.
+ set hlsearch
+
+ " For Win32 version, have "K" lookup the keyword in a help file
+ "if has("win32")
+ " let winhelpfile='windows.hlp'
+ " map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR>
+ "endif
+
+ " Set nice colors
+ " background for normal text is light grey
+ " Text below the last line is darker grey
+ " Cursor is green, Cyan when ":lmap" mappings are active
+ " Constants are not underlined but have a slightly lighter background
+ highlight Normal guibg=grey90
+ highlight Cursor guibg=Green guifg=NONE
+ highlight lCursor guibg=Cyan guifg=NONE
+ highlight NonText guibg=grey80
+ highlight Constant gui=NONE guibg=grey95
+ highlight Special gui=NONE guibg=grey95
+
+endif
diff --git a/runtime/icons.info b/runtime/icons.info
new file mode 100644
index 000000000..566bc5663
--- /dev/null
+++ b/runtime/icons.info
Binary files differ
diff --git a/runtime/indent.vim b/runtime/indent.vim
new file mode 100644
index 000000000..78fb9d0f4
--- /dev/null
+++ b/runtime/indent.vim
@@ -0,0 +1,13 @@
+" Vim support file to switch on loading indent files for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Sep 12
+
+if exists("did_indent_on")
+ finish
+endif
+let did_indent_on = 1
+
+augroup filetypeindent
+ au FileType * if expand("<amatch>") != "" | if exists("b:did_indent") | unlet b:did_indent | endif | runtime! indent/<amatch>.vim | endif
+augroup END
diff --git a/runtime/indent/README.txt b/runtime/indent/README.txt
new file mode 100644
index 000000000..a424b4f8c
--- /dev/null
+++ b/runtime/indent/README.txt
@@ -0,0 +1,45 @@
+This directory contains files to automatically compute the indent for a
+type of file.
+
+If you want to add your own indent file for your personal use, read the docs
+at ":help indent-expression". Looking at the existing files should give you
+inspiration.
+
+If you make a new indent file which would be useful for others, please send it
+to Bram@vim.org. Include instructions for detecting the file type for this
+language, by file name extension or by checking a few lines in the file.
+And please stick to the rules below.
+
+If you have remarks about an existing file, send them to the maintainer of
+that file. Only when you get no response send a message to Bram@vim.org.
+
+If you are the maintainer of an indent file and make improvements, e-mail the
+new version to Bram@vim.org.
+
+
+Rules for making an indent file:
+
+You should use this check for "b:did_indent":
+
+ " Only load this indent file when no other was loaded yet.
+ if exists("b:did_indent")
+ finish
+ endif
+ let b:did_indent = 1
+
+Always use ":setlocal" to set 'indentexpr'. This avoids it being carried over
+to other buffers.
+
+To trigger the indenting after typing a word like "endif", add the word to the
+'cinkeys' option with "+=".
+
+You normally set 'indentexpr' to evaluate a function and then define that
+function. That function only needs to be defined once for as long as Vim is
+running. Add a test if the function exists and use ":finish", like this:
+ if exists("*GetMyIndent")
+ finish
+ endif
+
+The user may have several options set unlike you, try to write the file such
+that it works with any option settings. Also be aware of certain features not
+being compiled in.
diff --git a/runtime/indent/aap.vim b/runtime/indent/aap.vim
new file mode 100644
index 000000000..78ac0336d
--- /dev/null
+++ b/runtime/indent/aap.vim
@@ -0,0 +1,7 @@
+" Vim indent file
+" Language: Aap recipe
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Sep 08
+
+" Works mostly like Python.
+runtime! indent/python.vim
diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim
new file mode 100644
index 000000000..72e2e80e5
--- /dev/null
+++ b/runtime/indent/ada.vim
@@ -0,0 +1,264 @@
+" Vim indent file
+" Language: Ada
+" Maintainer: Neil Bird <neil@fnxweb.com>
+" Last Change: 2003 May 20
+" Version: $Id$
+" Look for the latest version at http://vim.sourceforge.net/
+"
+" ToDo:
+" Verify handling of multi-line exprs. and recovery upon the final ';'.
+" Correctly find comments given '"' and "" ==> " syntax.
+" Combine the two large block-indent functions into one?
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetAdaIndent()
+setlocal indentkeys-=0{,0}
+setlocal indentkeys+=0=~then,0=~end,0=~elsif,0=~when,0=~exception,0=~begin,0=~is,0=~record
+
+" Only define the functions once.
+if exists("*GetAdaIndent")
+ finish
+endif
+
+let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<loop\>\|declare\>\|begin\>\|type\>.*\<is\s*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|then\>\|when\>\|is\>\)'
+let s:AdaComment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
+
+
+" Try to find indent of the block we're in (and about to complete)
+" prev_indent = the previous line's indent
+" prev_lnum = previous line (to start looking on)
+" blockstart = expr. that indicates a possible start of this block
+" stop_at = if non-null, if a matching line is found, gives up!
+" No recursive previous block analysis: simply look for a valid line
+" with a lesser or equal indent than we currently (on prev_lnum) have.
+" This shouldn't work as well as it appears to with lines that are currently
+" nowhere near the correct indent (e.g., start of line)!
+" Seems to work OK as it 'starts' with the indent of the /previous/ line.
+function s:MainBlockIndent( prev_indent, prev_lnum, blockstart, stop_at )
+ let lnum = a:prev_lnum
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ while lnum > 1
+ if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent
+ return -1
+ elseif line =~ '^\s*' . a:blockstart
+ let ind = indent(lnum)
+ if ind < a:prev_indent
+ return ind
+ endif
+ endif
+
+ let lnum = prevnonblank(lnum - 1)
+ " Get previous non-blank/non-comment-only line
+ while 1
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ if line !~ '^\s*$' && line !~ '^\s*#'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return a:prev_indent
+ endif
+ endwhile
+ endwhile
+ " Fallback - just move back one
+ return a:prev_indent - &sw
+endfunction
+
+" Try to find indent of the block we're in (and about to complete),
+" including handling of nested blocks. Works on the 'end' of a block.
+" prev_indent = the previous line's indent
+" prev_lnum = previous line (to start looking on)
+" blockstart = expr. that indicates a possible start of this block
+" blockend = expr. that indicates a possible end of this block
+function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
+ let lnum = a:prev_lnum
+ let line = getline(lnum)
+ let ends = 0
+ while lnum > 1
+ if getline(lnum) =~ '^\s*' . a:blockstart
+ let ind = indent(lnum)
+ if ends <= 0
+ if ind < a:prev_indent
+ return ind
+ endif
+ else
+ let ends = ends - 1
+ endif
+ elseif getline(lnum) =~ '^\s*' . a:blockend
+ let ends = ends + 1
+ endif
+
+ let lnum = prevnonblank(lnum - 1)
+ " Get previous non-blank/non-comment-only line
+ while 1
+ let line = getline(lnum)
+ let line = substitute( line, s:AdaComment, '', '' )
+ if line !~ '^\s*$'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return a:prev_indent
+ endif
+ endwhile
+ endwhile
+ " Fallback - just move back one
+ return a:prev_indent - &sw
+endfunction
+
+" As per MainBlockIndent, but return indent of previous statement-start
+" (after we've indented due to multi-line statements).
+" This time, we start searching on the line *before* the one given (which is
+" the end of a statement - we want the previous beginning).
+function s:StatementIndent( current_indent, prev_lnum )
+ let lnum = a:prev_lnum
+ while lnum > 0
+ let prev_lnum = lnum
+ let lnum = prevnonblank(lnum - 1)
+ " Get previous non-blank/non-comment-only line
+ while 1
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ if line !~ '^\s*$' && line !~ '^\s*#'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return a:current_indent
+ endif
+ endwhile
+ " Leave indent alone if our ';' line is part of a ';'-delineated
+ " aggregate (e.g., procedure args.) or first line after a block start.
+ if line =~ s:AdaBlockStart || line =~ '(\s*$'
+ return a:current_indent
+ endif
+ if line !~ '[.=(]\s*$'
+ let ind = indent(prev_lnum)
+ if ind < a:current_indent
+ return ind
+ endif
+ endif
+ endwhile
+ " Fallback - just use current one
+ return a:current_indent
+endfunction
+
+
+" Find correct indent of a new line based upon what went before
+function GetAdaIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+ let ind = indent(lnum)
+ let package_line = 0
+
+ " Get previous non-blank/non-comment-only/non-cpp line
+ while 1
+ let line = substitute( getline(lnum), s:AdaComment, '', '' )
+ if line !~ '^\s*$' && line !~ '^\s*#'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ if lnum <= 0
+ return ind
+ endif
+ endwhile
+
+ " Get default indent (from prev. line)
+ let ind = indent(lnum)
+
+ " Now check what's on the previous line
+ if line =~ s:AdaBlockStart || line =~ '(\s*$'
+ " Check for false matches to AdaBlockStart
+ let false_match = 0
+ if line =~ '^\s*\(procedure\|function\|package\)\>.*\<is\s*new\>'
+ " Generic instantiation
+ let false_match = 1
+ elseif line =~ ')\s*;\s*$' || line =~ '^\([^(]*([^)]*)\)*[^(]*;\s*$'
+ " forward declaration
+ let false_match = 1
+ endif
+ " Move indent in
+ if ! false_match
+ let ind = ind + &sw
+ endif
+ elseif line =~ '^\s*\(case\|exception\)\>'
+ " Move indent in twice (next 'when' will move back)
+ let ind = ind + 2 * &sw
+ elseif line =~ '^\s*end\s*record\>'
+ " Move indent back to tallying 'type' preceeding the 'record'.
+ " Allow indent to be equal to 'end record's.
+ let ind = s:MainBlockIndent( ind+&sw, lnum, 'type\>', '' )
+ elseif line =~ '\(^\s*new\>.*\)\@<!)\s*[;,]\s*$'
+ " Revert to indent of line that started this parenthesis pair
+ exe lnum
+ exe 'normal! $F)%'
+ if getline('.') =~ '^\s*('
+ " Dire layout - use previous indent (could check for AdaComment here)
+ let ind = indent( prevnonblank( line('.')-1 ) )
+ else
+ let ind = indent('.')
+ endif
+ exe v:lnum
+ elseif line =~ '[.=(]\s*$'
+ " A statement continuation - move in one
+ let ind = ind + &sw
+ elseif line =~ '^\s*new\>'
+ " Multiple line generic instantiation ('package blah is\nnew thingy')
+ let ind = s:StatementIndent( ind - &sw, lnum )
+ elseif line =~ ';\s*$'
+ " Statement end - try to find current statement-start indent
+ let ind = s:StatementIndent( ind, lnum )
+ endif
+
+ " Check for potential argument list on next line
+ let continuation = (line =~ '[A-Za-z0-9_]\s*$')
+
+
+ " Check current line; search for simplistic matching start-of-block
+ let line = getline(v:lnum)
+ if line =~ '^\s*#'
+ " Start of line for ada-pp
+ let ind = 0
+ elseif continuation && line =~ '^\s*('
+ let ind = ind + &sw
+ elseif line =~ '^\s*\(begin\|is\)\>'
+ let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
+ elseif line =~ '^\s*record\>'
+ let ind = s:MainBlockIndent( ind, lnum, 'type\>', '' ) + &sw
+ elseif line =~ '^\s*\(else\|elsif\)\>'
+ let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
+ elseif line =~ '^\s*when\>'
+ " Align 'when' one /in/ from matching block start
+ let ind = s:MainBlockIndent( ind, lnum, '\(case\|exception\)\>', '' ) + &sw
+ elseif line =~ '^\s*end\>\s*\<if\>'
+ " End of if statements
+ let ind = s:EndBlockIndent( ind, lnum, 'if\>', 'end\>\s*\<if\>' )
+ elseif line =~ '^\s*end\>\s*\<loop\>'
+ " End of loops
+ let ind = s:EndBlockIndent( ind, lnum, '\(\(while\|for\)\>.*\)\?\<loop\>', 'end\>\s*\<loop\>' )
+ elseif line =~ '^\s*end\>\s*\<record\>'
+ " End of records
+ let ind = s:EndBlockIndent( ind, lnum, '\(type\>.*\)\=\<record\>', 'end\>\s*\<record\>' )
+ elseif line =~ '^\s*end\>\s*\<procedure\>'
+ " End of procedures
+ let ind = s:EndBlockIndent( ind, lnum, 'procedure\>.*\<is\>', 'end\>\s*\<procedure\>' )
+ elseif line =~ '^\s*end\>\s*\<case\>'
+ " End of case statement
+ let ind = s:EndBlockIndent( ind, lnum, 'case\>.*\<is\>', 'end\>\s*\<case\>' )
+ elseif line =~ '^\s*end\>'
+ " General case for end
+ let ind = s:MainBlockIndent( ind, lnum, '\(if\|while\|for\|loop\|accept\|begin\|record\|case\|exception\)\>', '' )
+ elseif line =~ '^\s*exception\>'
+ let ind = s:MainBlockIndent( ind, lnum, 'begin\>', '' )
+ elseif line =~ '^\s*then\>'
+ let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
+ endif
+
+ return ind
+endfunction
+
+" vim: set sw=3 sts=3 :
diff --git a/runtime/indent/ant.vim b/runtime/indent/ant.vim
new file mode 100644
index 000000000..067f27213
--- /dev/null
+++ b/runtime/indent/ant.vim
@@ -0,0 +1,12 @@
+" Vim indent file
+" Language: ANT files
+" Maintainer: David Fishburn <fishburn@ianywhere.com>
+" Last Change: Thu May 15 2003 10:02:54 PM
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+" Use XML formatting rules
+runtime! indent/xml.vim
diff --git a/runtime/indent/automake.vim b/runtime/indent/automake.vim
new file mode 100644
index 000000000..60eff0750
--- /dev/null
+++ b/runtime/indent/automake.vim
@@ -0,0 +1,11 @@
+" Vim indent file
+" Language: automake
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/automake/
+" Latest Revision: 2004-04-25
+" arch-tag: 9a2af48c-48d4-4bae-82c3-c801bc9d1976
+
+" same as makefile indenting for now.
+source <sfile>:p:h/make.vim
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/awk.vim b/runtime/indent/awk.vim
new file mode 100644
index 000000000..726a5ddbe
--- /dev/null
+++ b/runtime/indent/awk.vim
@@ -0,0 +1,228 @@
+" vim: set sw=3 sts=3:
+
+" Awk indent script. It can handle multi-line statements and expressions.
+" It works up to the point where the distinction between correct/incorrect
+" and personal taste gets fuzzy. Drop me an e-mail for bug reports and
+" reasonable style suggestions.
+"
+" Bugs:
+" =====
+" - Some syntax errors may cause erratic indentation.
+" - Same for very unusual but syntacticly correct use of { }
+" - In some cases it's confused by the use of ( and { in strings constants
+" - This version likes the closing brace of a multiline pattern-action be on
+" character position 1 before the following pattern-action combination is
+" formatted
+
+" Author:
+" =======
+" Erik Janssen, ejanssen@itmatters.nl
+"
+" History:
+" ========
+" 26-04-2002 Got initial version working reasonably well
+" 29-04-2002 Fixed problems in function headers and max line width
+" Added support for two-line if's without curly braces
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetAwkIndent()
+" Mmm, copied from the tcl indent program. Is this okay?
+setlocal indentkeys-=:,0#
+
+" Only define the function once.
+if exists("*GetAwkIndent")
+ finish
+endif
+
+" This function contains a lot of exit points. It checks for simple cases
+" first to get out of the function as soon as possible, thereby reducing the
+" number of possibilities later on in the difficult parts
+
+function! GetAwkIndent()
+
+ " Find previous line and get it's indentation
+ let prev_lineno = s:Get_prev_line( v:lnum )
+ if prev_lineno == 0
+ return 0
+ endif
+ let prev_data = getline( prev_lineno )
+ let ind = indent( prev_lineno )
+
+ " Increase indent if the previous line contains an opening brace. Search
+ " for this brace the hard way to prevent errors if the previous line is a
+ " 'pattern { action }' (simple check match on /{/ increases the indent then)
+
+ if s:Get_brace_balance( prev_data, '{', '}' ) > 0
+ return ind + &sw
+ endif
+
+ let brace_balance = s:Get_brace_balance( prev_data, '(', ')' )
+
+ " If prev line has positive brace_balance and starts with a word (keyword
+ " or function name), align the current line on the first '(' of the prev
+ " line
+
+ if brace_balance > 0 && s:Starts_with_word( prev_data )
+ return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
+ endif
+
+ " If this line starts with an open brace bail out now before the line
+ " continuation checks.
+
+ if getline( v:lnum ) =~ '^\s*{'
+ return ind
+ endif
+
+ " If prev line seems to be part of multiline statement:
+ " 1. Prev line is first line of a multiline statement
+ " -> attempt to indent on first ' ' or '(' of prev line, just like we
+ " indented the positive brace balance case above
+ " 2. Prev line is not first line of a multiline statement
+ " -> copy indent of prev line
+
+ let continue_mode = s:Seems_continuing( prev_data )
+ if continue_mode > 0
+ if s:Seems_continuing( getline(s:Get_prev_line( prev_lineno )) )
+ " Case 2
+ return ind
+ else
+ " Case 1
+ if continue_mode == 1
+ " Need continuation due to comma, backslash, etc
+ return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
+ else
+ " if/for/while without '{'
+ return ind + &sw
+ endif
+ endif
+ endif
+
+ " If the previous line doesn't need continuation on the current line we are
+ " on the start of a new statement. We have to make sure we align with the
+ " previous statement instead of just the previous line. This is a bit
+ " complicated because the previous statement might be multi-line.
+ "
+ " The start of a multiline statement can be found by:
+ "
+ " 1 If the previous line contains closing braces and has negative brace
+ " balance, search backwards until cumulative brace balance becomes zero,
+ " take indent of that line
+ " 2 If the line before the previous needs continuation search backward
+ " until that's not the case anymore. Take indent of one line down.
+
+ " Case 1
+ if prev_data =~ ')' && brace_balance < 0
+ while brace_balance != 0
+ let prev_lineno = s:Get_prev_line( prev_lineno )
+ let prev_data = getline( prev_lineno )
+ let brace_balance=brace_balance+s:Get_brace_balance(prev_data,'(',')' )
+ endwhile
+ let ind = indent( prev_lineno )
+ else
+ " Case 2
+ if s:Seems_continuing( getline( prev_lineno - 1 ) )
+ let prev_lineno = prev_lineno - 2
+ let prev_data = getline( prev_lineno )
+ while prev_lineno > 0 && (s:Seems_continuing( prev_data ) > 0)
+ let prev_lineno = s:Get_prev_line( prev_lineno )
+ let prev_data = getline( prev_lineno )
+ endwhile
+ let ind = indent( prev_lineno + 1 )
+ endif
+ endif
+
+ " Decrease indent if this line contains a '}'.
+ if getline(v:lnum) =~ '^\s*}'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" Find the open and close braces in this line and return how many more open-
+" than close braces there are. It's also used to determine cumulative balance
+" across multiple lines.
+
+function! s:Get_brace_balance( line, b_open, b_close )
+ let line2 = substitute( a:line, a:b_open, "", "g" )
+ let openb = strlen( a:line ) - strlen( line2 )
+ let line3 = substitute( line2, a:b_close, "", "g" )
+ let closeb = strlen( line2 ) - strlen( line3 )
+ return openb - closeb
+endfunction
+
+" Find out whether the line starts with a word (i.e. keyword or function
+" call). Might need enhancements here.
+
+function! s:Starts_with_word( line )
+ if a:line =~ '^\s*[a-zA-Z_0-9]\+\s*('
+ return 1
+ endif
+ return 0
+endfunction
+
+" Find the length of the first word in a line. This is used to be able to
+" align a line relative to the 'print ' or 'if (' on the previous line in case
+" such a statement spans multiple lines.
+" Precondition: only to be used on lines where 'Starts_with_word' returns 1.
+
+function! s:First_word_len( line )
+ let white_end = matchend( a:line, '^\s*' )
+ if match( a:line, '^\s*func' ) != -1
+ let word_end = matchend( a:line, '[a-z]\+\s\+[a-zA-Z_0-9]\+[ (]*' )
+ else
+ let word_end = matchend( a:line, '[a-zA-Z_0-9]\+[ (]*' )
+ endif
+ return word_end - white_end
+endfunction
+
+" Determine if 'line' completes a statement or is continued on the next line.
+" This one is far from complete and accepts illegal code. Not important for
+" indenting, however.
+
+function! s:Seems_continuing( line )
+ " Unfinished lines
+ if a:line =~ '[\\,\|\&\+\-\*\%\^]\s*$'
+ return 1
+ endif
+ " if/for/while (cond) eol
+ if a:line =~ '^\s*\(if\|while\|for\)\s*(.*)\s*$' || a:line =~ '^\s*else\s*'
+ return 2
+ endif
+ return 0
+endfunction
+
+" Get previous relevant line. Search back until a line is that is no
+" comment or blank and return the line number
+
+function! s:Get_prev_line( lineno )
+ let lnum = a:lineno - 1
+ let data = getline( lnum )
+ while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
+ let lnum = lnum - 1
+ let data = getline( lnum )
+ endwhile
+ return lnum
+endfunction
+
+" This function checks whether an indented line exceeds a maximum linewidth
+" (hardcoded 80). If so and it is possible to stay within 80 positions (or
+" limit num of characters beyond linewidth) by decreasing the indent (keeping
+" it > base_indent), do so.
+
+function! s:Safe_indent( base, wordlen, this_line )
+ let line_base = matchend( a:this_line, '^\s*' )
+ let line_len = strlen( a:this_line ) - line_base
+ let indent = a:base
+ if (indent + a:wordlen + line_len) > 80
+ " Simple implementation good enough for the time being
+ let indent = indent + 3
+ endif
+ return indent + a:wordlen
+endfunction
diff --git a/runtime/indent/c.vim b/runtime/indent/c.vim
new file mode 100644
index 000000000..135251dca
--- /dev/null
+++ b/runtime/indent/c.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jun 12
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" C indenting is built-in, thus this is very simple
+setlocal cindent
diff --git a/runtime/indent/cdl.vim b/runtime/indent/cdl.vim
new file mode 100644
index 000000000..db2b9052b
--- /dev/null
+++ b/runtime/indent/cdl.vim
@@ -0,0 +1,129 @@
+" Description: Comshare Dimension Definition Language (CDL)
+" Author: Raul Segura Acevedo <raulseguraaceved@netscape.net>
+" Last Change: Fri Nov 30 13:35:48 2001 CST
+
+if exists("b:did_indent")
+ "finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=CdlGetIndent(v:lnum)
+setlocal indentkeys&
+setlocal indentkeys+==~else,=~endif,=~then,;,),=
+
+" Only define the function once.
+if exists("*CdlGetIndent")
+ "finish
+endif
+
+" find out if an "...=..." expresion its an asignment (or a conditional)
+" it scans 'line' first, and then the previos lines
+fun! CdlAsignment(lnum, line)
+ let f = -1
+ let lnum = a:lnum
+ let line = a:line
+ while lnum > 0 && f == -1
+ " line without members [a] of [b]:[c]...
+ let inicio = 0
+ while 1
+ " keywords that help to decide
+ let inicio = matchend(line, '\c\<\(expr\|\a*if\|and\|or\|not\|else\|then\|memberis\|\k\+of\)\>\|[<>;]', inicio)
+ if inicio < 0
+ break
+ endif
+ " it's formula if there's a ';', 'elsE', 'theN', 'enDif' or 'expr'
+ " conditional if there's a '<', '>', 'elseif', 'if', 'and', 'or', 'not',
+ " 'memberis', 'childrenof' and other \k\+of funcions
+ let f = line[inicio-1] =~? '[en;]' || strpart(line, inicio-4, 4) =~? 'ndif\|expr'
+ endw
+ let lnum = prevnonblank(lnum-1)
+ let line = substitute(getline(lnum), '\c\(\[[^]]*]\(\s*of\s*\|:\)*\)\+', ' ', 'g')
+ endw
+ " if we hit the start of the file then f = -1, return 1 (formula)
+ return f != 0
+endf
+
+fun! CdlGetIndent(lnum)
+ let thisline = getline(a:lnum)
+ if match(thisline, '^\s*\(\k\+\|\[[^]]*]\)\s*\(,\|;\s*$\)') >= 0
+ " it's an attributes line
+ return &sw
+ elseif match(thisline, '^\c\s*\([{}]\|\/[*/]\|dimension\|schedule\|group\|hierarchy\|class\)') >= 0
+ " it's a header or '{' or '}' or a comment
+ return 0
+ end
+
+ let lnum = prevnonblank(a:lnum-1)
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " PREVIOUS LINE
+ let ind = indent(lnum)
+ let line = getline(lnum)
+ let f = -1 " wether a '=' is a conditional or a asignment, -1 means we don't know yet
+ " one 'closing' element at the beginning of the line has already reduced the
+ " indent, but 'else', 'elseif' & 'then' increment it for the next line
+ " '=' at the beginning has already de right indent (increased for asignments)
+ let inicio = matchend(line, '^\c\s*\(else\a*\|then\|endif\|/[*/]\|[);={]\)')
+ if inicio > 0
+ let c = line[inicio-1]
+ " ')' and '=' don't change indent and are useless to set 'f'
+ if c == '{'
+ return &sw
+ elseif c != ')' && c != '='
+ let f = 1 " all but 'elseif' are followed by a formula
+ if c ==? 'n' || c ==? 'e' " 'then', 'else'
+ let ind = ind + &sw
+ elseif strpart(line, inicio-6, 6) ==? 'elseif' " elseif, set f to conditional
+ let ind = ind + &sw
+ let f = 0
+ end
+ end
+ end
+
+ " remove members [a] of [b]:[c]... (inicio remainds valid)
+ let line = substitute(line, '\c\(\[[^]]*]\(\s*of\s*\|:\)*\)\+', ' ', 'g')
+ while 1
+ " search for the next interesting element
+ let inicio=matchend(line, '\c\<if\|endif\|[()=;]', inicio)
+ if inicio < 0
+ break
+ end
+
+ let c = line[inicio-1]
+ " 'expr(...)' containing the formula
+ if strpart(line, inicio-5, 5) ==? 'expr('
+ let ind = 0
+ let f = 1
+ elseif c == ')' || c== ';' || strpart(line, inicio-5, 5) ==? 'endif'
+ let ind = ind - &sw
+ elseif c == '(' || c ==? 'f' " '(' or 'if'
+ let ind = ind + &sw
+ else " c == '='
+ " if it is an asignment increase indent
+ if f == -1 " we don't know yet, find out
+ let f = CdlAsignment(lnum, strpart(line, 0, inicio))
+ end
+ if f == 1 " formula increase it
+ let ind = ind + &sw
+ end
+ end
+ endw
+
+ " CURRENT LINE, if it starts with a closing element, decrease indent
+ " or if it starts with '=' (asignment), increase indent
+ if match(thisline, '^\c\s*\(else\|then\|endif\|[);]\)') >= 0
+ let ind = ind - &sw
+ elseif match(thisline, '^\s*=') >= 0
+ if f == -1 " we don't know yet if is an asignment, find out
+ let f = CdlAsignment(lnum, "")
+ end
+ if f == 1 " formula increase it
+ let ind = ind + &sw
+ end
+ end
+
+ return ind
+endfun
diff --git a/runtime/indent/ch.vim b/runtime/indent/ch.vim
new file mode 100644
index 000000000..12d583d06
--- /dev/null
+++ b/runtime/indent/ch.vim
@@ -0,0 +1,18 @@
+" Vim indent file
+" Language: Ch
+" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
+" URL: http://www.softintegration.com/download/vim/indent/ch.vim
+" Last change: 2003 Aug 05
+" Created based on cpp.vim
+"
+" Ch is a C/C++ interpreter with many high level extensions
+
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Ch indenting is built-in, thus this is very simple
+setlocal cindent
diff --git a/runtime/indent/config.vim b/runtime/indent/config.vim
new file mode 100644
index 000000000..5a803ed8a
--- /dev/null
+++ b/runtime/indent/config.vim
@@ -0,0 +1,85 @@
+" Vim indent file
+" Language: Autoconf configure.{ac,in} file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/config/
+" Latest Revision: 2004-04-25
+" arch-tag: 7779c341-796f-408e-80e4-a55c26b519a4
+" TODO: how about nested [()]'s in one line
+" what's wrong with '\\\@!'?
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+source <sfile>:p:h/sh.vim " will set b:did_indent
+
+setlocal indentexpr=GetConfigIndent()
+setlocal indentkeys=!^F,o,O,=then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done
+
+" Only define the function once.
+if exists("*GetConfigIndent")
+ finish
+endif
+
+" get the offset (indent) of the end of the match of 'regexp' in 'line'
+function s:GetOffsetOf(line, regexp)
+ let end = matchend(a:line, a:regexp)
+ let width = 0
+ let i = 0
+ while i < end
+ if a:line[i] != "\t"
+ let width = width + 1
+ else
+ let width = width + &ts - (width % &ts)
+ endif
+ let i = i + 1
+ endwhile
+ return width
+endfunction
+
+function GetConfigIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " where to put this
+ let ind = GetShIndent()
+ let line = getline(lnum)
+
+ " if previous line has unmatched, unescaped opening parentheses,
+ " indent to its position. TODO: not failsafe if multiple ('s
+ if line =~ '\\\@<!([^)]*$'
+ let ind = s:GetOffsetOf(line, '\\\@!(')
+ endif
+
+ " if previous line has unmatched opening bracket,
+ " indent to its position. TODO: same as above
+ if line =~ '\[[^]]*$'
+ let ind = s:GetOffsetOf(line, '\[')
+ endif
+
+ " if previous line had an unmatched closing parantheses,
+ " indent to the matching opening parantheses
+ if line =~ '[^(]*\\\@<!)$'
+ call search(')', 'bW')
+ let lnum = searchpair('\\\@<!(', '', ')', 'bWn')
+ let ind = indent(lnum)
+ endif
+
+ " if previous line had an unmatched closing bracket,
+ " indent to the matching opening bracket
+ if line =~ '[^[]*]$'
+ call search(']', 'bW')
+ let lnum = searchpair('\[', '', ']', 'bWn')
+ let ind = indent(lnum)
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/cpp.vim b/runtime/indent/cpp.vim
new file mode 100644
index 000000000..9ae126ac4
--- /dev/null
+++ b/runtime/indent/cpp.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: C++
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jun 12
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" C++ indenting is built-in, thus this is very simple
+setlocal cindent
diff --git a/runtime/indent/cs.vim b/runtime/indent/cs.vim
new file mode 100644
index 000000000..064ab0069
--- /dev/null
+++ b/runtime/indent/cs.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: C#
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Fri, 15 Mar 2002 07:53:54 CET
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" C# is like indenting C
+setlocal cindent
diff --git a/runtime/indent/css.vim b/runtime/indent/css.vim
new file mode 100644
index 000000000..610c725c6
--- /dev/null
+++ b/runtime/indent/css.vim
@@ -0,0 +1,79 @@
+" Vim indent file
+" Language: CSS
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/css/
+" Latest Revision: 2004-04-25
+" arch-tag: ccfd77a0-1c9a-43f7-a407-bbe704541442
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetCSSIndent()
+setlocal indentkeys-=:,0# indentkeys-=e
+
+" Only define the function once.
+if exists("*GetCSSIndent")
+ finish
+endif
+
+function! s:LookupLine(lnum)
+ " find a non-blank line above the current line
+ let lnum = prevnonblank(a:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ let line = getline(lnum)
+
+ " if the line has an end comment sequence we need to find a line
+ " that isn't affected by the comment.
+ if line =~ '\*/'
+ while line !~ '/\*'
+ let lnum = lnum - 1
+ let line = getline(lnum)
+ endwhile
+ endif
+
+ " if the line we found only contained the comment and whitespace
+ " we need to find another line to use...
+ if line =~ '^\s*/\*'
+ return s:LookupLine(lnum)
+ else
+ return lnum
+ endif
+endfunction
+
+function GetCSSIndent()
+ let lnum = s:LookupLine(v:lnum)
+
+ if lnum == 0
+ return 0
+ endif
+
+ " remove commented stuff from line
+ let line = substitute(getline(lnum), '/\*.\*/', '', 'eg')
+
+ let ind = indent(lnum)
+
+ " check for opening brace on the previous line
+ " skip if it also contains a closing brace...
+ if line =~ '{\(.*}\)\@!'
+ let ind = ind + &sw
+ endif
+
+ let line = getline(v:lnum)
+
+ " check for closing brace first on current line
+ if line =~ '^\s*}'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/docbk.vim b/runtime/indent/docbk.vim
new file mode 100644
index 000000000..6b807bbf3
--- /dev/null
+++ b/runtime/indent/docbk.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: DocBook Documentation Format
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/docbk/
+" Latest Revision: 2004-05-22
+" arch-tag: 3d073af7-1d69-42a2-99ad-9a49a21eb28f
+
+" Same as XML indenting for now.
+runtime! indent/xml.vim
+
+setlocal indentexpr=XmlIndentGet(v:lnum,0)
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/dylan.vim b/runtime/indent/dylan.vim
new file mode 100644
index 000000000..0afcbeada
--- /dev/null
+++ b/runtime/indent/dylan.vim
@@ -0,0 +1,90 @@
+" Vim indent file
+" Language: Dylan
+" Version: 0.01
+" Last Change: 2003 Feb 04
+" Maintainer: Brent A. Fulgham <bfulgham@debian.org>
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentkeys+==~begin,=~block,=~case,=~cleanup,=~define,=~end,=~else,=~elseif,=~exception,=~for,=~finally,=~if,=~otherwise,=~select,=~unless,=~while
+
+" Define the appropriate indent function but only once
+setlocal indentexpr=DylanGetIndent()
+if exists("*DylanGetIndent")
+ finish
+endif
+
+function DylanGetIndent()
+ " Get the line to be indented
+ let cline = getline(v:lnum)
+
+ " Don't reindent comments on first column
+ if cline =~ '^/\[/\*]'
+ return 0
+ endif
+
+ "Find the previous non-blank line
+ let lnum = prevnonblank(v:lnum - 1)
+ "Use zero indent at the top of the file
+ if lnum == 0
+ return 0
+ endif
+
+ let prevline=getline(lnum)
+ let ind = indent(lnum)
+ let chg = 0
+
+ " If previous line was a comment, use its indent
+ if prevline =~ '^\s*//'
+ return ind
+ endif
+
+ " If previous line was a 'define', indent
+ if prevline =~? '\(^\s*\(begin\|block\|case\|define\|else\|elseif\|for\|finally\|if\|select\|unless\|while\)\|\s*\S*\s*=>$\)'
+ let chg = &sw
+ " local methods indent the shift-width, plus 6 for the 'local'
+ elseif prevline =~? '^\s*local'
+ let chg = &sw + 6
+ " If previous line was a let with no closing semicolon, indent
+ elseif prevline =~? '^\s*let.*[^;]\s*$'
+ let chg = &sw
+ " If previous line opened a parenthesis, and did not close it, indent
+ elseif prevline =~ '^.*(\s*[^)]*\((.*)\)*[^)]*$'
+ return = match( prevline, '(.*\((.*)\|[^)]\)*.*$') + 1
+ "elseif prevline =~ '^.*(\s*[^)]*\((.*)\)*[^)]*$'
+ elseif prevline =~ '^[^(]*)\s*$'
+ " This line closes a parenthesis. Find opening
+ let curr_line = prevnonblank(lnum - 1)
+ while curr_line >= 0
+ let str = getline(curr_line)
+ if str !~ '^.*(\s*[^)]*\((.*)\)*[^)]*$'
+ let curr_line = prevnonblank(curr_line - 1)
+ else
+ break
+ endif
+ endwhile
+ if curr_line < 0
+ return -1
+ endif
+ let ind = indent(curr_line)
+ " Although we found the closing parenthesis, make sure this
+ " line doesn't start with an indentable command:
+ let curr_str = getline(curr_line)
+ if curr_str =~? '^\s*\(begin\|block\|case\|define\|else\|elseif\|for\|finally\|if\|select\|unless\|while\)'
+ let chg = &sw
+ endif
+ endif
+
+ " If a line starts with end, un-indent (even if we just indented!)
+ if cline =~? '^\s*\(cleanup\|end\|else\|elseif\|exception\|finally\|otherwise\)'
+ let chg = chg - &sw
+ endif
+
+ return ind + chg
+endfunction
+
+" vim:sw=2 tw=130
diff --git a/runtime/indent/eiffel.vim b/runtime/indent/eiffel.vim
new file mode 100644
index 000000000..ac31d1043
--- /dev/null
+++ b/runtime/indent/eiffel.vim
@@ -0,0 +1,106 @@
+" Vim indent file
+" Language: Eiffel
+" Maintainer: David Clarke <gadicath@dishevelled.net>
+" $Date$
+" $Revision$
+" URL: http://gadicath.webhop.net/other/eiffel.vim
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetEiffelIndent()
+setlocal nolisp
+setlocal nosmartindent
+setlocal nocindent
+setlocal autoindent
+setlocal comments=:--
+setlocal indentkeys+==end,=else,=ensure,=require,=check,=loop,=until
+setlocal indentkeys+==creation,=feature,=inherit,=class,=is,=redefine,=rename,=variant
+setlocal indentkeys+==invariant,=do,=local,=export
+setlocal sw=3
+setlocal tw=78
+
+" Define some stuff
+" keywords grouped by indenting
+let s:trust_user_indent = '\(+\)\(\s*\(--\).*\)\=$'
+let s:relative_indent = '^\s*\(deferred\|class\|feature\|creation\|inherit\|loop\|from\|until\|if\|else\|elseif\|ensure\|require\|check\|do\|local\|invariant\|variant\|rename\|redefine\|do\|export\)\>'
+let s:outdent = '^\s*\(else\|invariant\|variant\|do\|require\|until\|loop\|local\)\>'
+let s:no_indent = '^\s*\(class\|feature\|creation\|inherit\)\>'
+let s:single_dent = '^[^-]\+[[:alnum:]]\+ is\(\s*\(--\).*\)\=$'
+let s:inheritance_dent = '\s*\(redefine\|rename\|export\)\>'
+
+
+" Only define the function once.
+if exists("*GetEiffelIndent")
+ finish
+endif
+
+function GetEiffelIndent()
+
+ " Eiffel Class indenting
+ "
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " trust the user's indenting
+ if getline(lnum) =~ s:trust_user_indent
+ return -1
+ endif
+
+ " Add a 'shiftwidth' after lines that start with an indent word
+ let ind = indent(lnum)
+ if getline(lnum) =~ s:relative_indent
+ let ind = ind + &sw
+ endif
+
+ " Indent to single indent
+ if getline(v:lnum) =~ s:single_dent && getline(v:lnum) !~ s:relative_indent
+ \ && getline(v:lnum) !~ '\s*\<\(and\|or\|implies\)\>'
+ let ind = &sw
+ endif
+
+ " Indent to double indent
+ if getline(v:lnum) =~ s:inheritance_dent
+ let ind = 2 * &sw
+ endif
+
+ " Indent line after the first line of the function definition
+ if getline(lnum) =~ s:single_dent
+ let ind = ind + &sw
+ endif
+
+ " The following should always be at the start of a line, no indenting
+ if getline(v:lnum) =~ s:no_indent
+ let ind = 0
+ endif
+
+ " Subtract a 'shiftwidth', if this isn't the first thing after the 'is'
+ " or first thing after the 'do'
+ if getline(v:lnum) =~ s:outdent && getline(v:lnum - 1) !~ s:single_dent
+ \ && getline(v:lnum - 1) !~ '^\s*do\>'
+ let ind = ind - &sw
+ endif
+
+ " Subtract a shiftwidth for end statements
+ if getline(v:lnum) =~ '^\s*end\>'
+ let ind = ind - &sw
+ endif
+
+ " set indent of zero end statements that are at an indent of 3, this should
+ " only ever be the class's end.
+ if getline(v:lnum) =~ '^\s*end\>' && ind == 3
+ let ind = 0
+ endif
+
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/eterm.vim b/runtime/indent/eterm.vim
new file mode 100644
index 000000000..2e7ba1858
--- /dev/null
+++ b/runtime/indent/eterm.vim
@@ -0,0 +1,49 @@
+" Vim indent file
+" Language: Eterm configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/eterm/
+" Latest Revision: 2004-04-25
+" arch-tag: a22a92b1-c59f-4f47-8207-b21db6549b21
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetEtermIndent()
+setlocal indentkeys=!^F,o,O,=end
+
+" Only define the function once.
+if exists("*GetEtermIndent")
+ finish
+endif
+
+function GetEtermIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let line = getline(lnum)
+ let ind = indent(lnum)
+
+ if line =~ '^\s*begin\>'
+ let ind = ind + &sw
+ endif
+
+ let line = getline(v:lnum)
+
+ " Check for closing brace on current line
+ if line =~ '^\s*end\>'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
new file mode 100644
index 000000000..b14273aa3
--- /dev/null
+++ b/runtime/indent/fortran.vim
@@ -0,0 +1,161 @@
+" Vim indent file
+" Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
+" Version: 0.36
+" URL: http://www.unb.ca/chem/ajit/indent/fortran.vim
+" Last Change: 2004 Apr. 05
+" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
+" Usage: Do :help fortran-indent from Vim
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+let s:cposet=&cpoptions
+set cpoptions-=C
+
+setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select
+setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect
+
+" Determine whether this is a fixed or free format source file
+" if this hasn't been done yet
+if !exists("b:fortran_fixed_source")
+ if exists("fortran_free_source")
+ " User guarantees free source form
+ let b:fortran_fixed_source = 0
+ elseif exists("fortran_fixed_source")
+ " User guarantees fixed source form
+ let b:fortran_fixed_source = 1
+ else
+ " f90 and f95 allow both fixed and free source form
+ " assume fixed source form unless signs of free source form
+ " are detected in the first five columns of the first 25 lines
+ " Detection becomes more accurate and time-consuming if more lines
+ " are checked. Increase the limit below if you keep lots of comments at
+ " the very top of each file and you have a fast computer
+ let s:lmax = 25
+ if ( s:lmax > line("$") )
+ let s:lmax = line("$")
+ endif
+ let b:fortran_fixed_source = 1
+ let s:ln=1
+ while s:ln <= s:lmax
+ let s:test = strpart(getline(s:ln),0,5)
+ if s:test[0] !~ '[Cc*!#]' && s:test !~ '^ \+[!#]' && s:test =~ '[^ 0-9\t]'
+ let b:fortran_fixed_source = 0
+ break
+ endif
+ let s:ln = s:ln + 1
+ endwhile
+ endif
+endif
+
+" Define the appropriate indent function but only once
+if (b:fortran_fixed_source == 1)
+ setlocal indentexpr=FortranGetFixedIndent()
+ if exists("*FortranGetFixedIndent")
+ finish
+ endif
+else
+ setlocal indentexpr=FortranGetFreeIndent()
+ if exists("*FortranGetFreeIndent")
+ finish
+ endif
+endif
+
+function FortranGetIndent(lnum)
+ let ind = indent(a:lnum)
+ let prevline=getline(a:lnum)
+ " Strip tail comment
+ let prevstat=substitute(prevline, '!.*$', '', '')
+
+ "Indent do loops only if they are all guaranteed to be of do/end do type
+ if exists("b:fortran_do_enddo") || exists("fortran_do_enddo")
+ if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*do\>'
+ let ind = ind + &sw
+ endif
+ if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*end\s*do\>'
+ let ind = ind - &sw
+ endif
+ endif
+
+ "Add a shiftwidth to statements following if, else, case,
+ "where and elsewhere statements
+ if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(else\|case\|where\|elsewhere\)\>'
+ \ || prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*if\>'
+ let ind = ind + &sw
+ " Remove unwanted indent after logical and arithmetic ifs
+ if prevstat =~? '\<if\>' && prevstat !~? '\<then\>'
+ let ind = ind - &sw
+ endif
+ endif
+
+ "Subtract a shiftwidth from else, elsewhere, case, end if,
+ " end where and end select statements
+ if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*'
+ \. '\(else\|elsewhere\|case\|end\s*\(if\|where\|select\)\)\>'
+ let ind = ind - &sw
+ " Fix indent for case statement immediately after select
+ if prevstat =~? '\<select\>'
+ let ind = ind + &sw
+ endif
+ endif
+
+ return ind
+endfunction
+
+function FortranGetFreeIndent()
+ "Find the previous non-blank line
+ let lnum = prevnonblank(v:lnum - 1)
+
+ "Use zero indent at the top of the file
+ if lnum == 0
+ return 0
+ endif
+
+ let ind=FortranGetIndent(lnum)
+ return ind
+endfunction
+
+function FortranGetFixedIndent()
+ let currline=getline(v:lnum)
+ "Don't indent comments, continuation lines and labelled lines
+ if strpart(currline,0,6) =~ '[^ \t]'
+ let ind = indent(v:lnum)
+ return ind
+ endif
+
+ "Find the previous line which is not blank, not a comment,
+ "not a continuation line, and does not have a label
+ let lnum = v:lnum - 1
+ while lnum > 0
+ let prevline=getline(lnum)
+ if (prevline =~ "^[C*!]") || (prevline =~ "^\s*$")
+ \ || (strpart(prevline,5,1) !~ "[ 0]")
+ " Skip comments, blank lines and continuation lines
+ let lnum = lnum - 1
+ else
+ let test=strpart(prevline,0,5)
+ if test =~ "[0-9]"
+ " Skip lines with statement numbers
+ let lnum = lnum - 1
+ else
+ break
+ endif
+ endif
+ endwhile
+
+ "First line must begin at column 7
+ if lnum == 0
+ return 6
+ endif
+
+ let ind=FortranGetIndent(lnum)
+ return ind
+endfunction
+
+let &cpoptions=s:cposet
+unlet s:cposet
+
+" vim:sw=2 tw=130
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
new file mode 100644
index 000000000..d78da193b
--- /dev/null
+++ b/runtime/indent/html.vim
@@ -0,0 +1,219 @@
+" Description: html indenter
+" Author: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 10:28:39 CEST
+" Globals: g:html_indent_tags -- indenting tags
+" g:html_indent_strict -- inhibit 'O O' elements
+" g:html_indent_strict_table -- inhibit 'O -' elements
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+
+" [-- local settings (must come before aborting the script) --]
+setlocal indentexpr=HtmlIndentGet(v:lnum)
+setlocal indentkeys=o,O,*<Return>,<>>,<bs>,{,}
+
+
+if exists('g:html_indent_tags')
+ unlet g:html_indent_tags
+endif
+
+" [-- helper function to assemble tag list --]
+fun! <SID>HtmlIndentPush(tag)
+ if exists('g:html_indent_tags')
+ let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag
+ else
+ let g:html_indent_tags = a:tag
+ endif
+endfun
+
+
+" [-- <ELEMENT ? - - ...> --]
+call <SID>HtmlIndentPush('a')
+call <SID>HtmlIndentPush('abbr')
+call <SID>HtmlIndentPush('acronym')
+call <SID>HtmlIndentPush('address')
+call <SID>HtmlIndentPush('b')
+call <SID>HtmlIndentPush('bdo')
+call <SID>HtmlIndentPush('big')
+call <SID>HtmlIndentPush('blockquote')
+call <SID>HtmlIndentPush('button')
+call <SID>HtmlIndentPush('caption')
+call <SID>HtmlIndentPush('center')
+call <SID>HtmlIndentPush('cite')
+call <SID>HtmlIndentPush('code')
+call <SID>HtmlIndentPush('colgroup')
+call <SID>HtmlIndentPush('del')
+call <SID>HtmlIndentPush('dfn')
+call <SID>HtmlIndentPush('dir')
+call <SID>HtmlIndentPush('div')
+call <SID>HtmlIndentPush('dl')
+call <SID>HtmlIndentPush('em')
+call <SID>HtmlIndentPush('fieldset')
+call <SID>HtmlIndentPush('font')
+call <SID>HtmlIndentPush('form')
+call <SID>HtmlIndentPush('frameset')
+call <SID>HtmlIndentPush('h1')
+call <SID>HtmlIndentPush('h2')
+call <SID>HtmlIndentPush('h3')
+call <SID>HtmlIndentPush('h4')
+call <SID>HtmlIndentPush('h5')
+call <SID>HtmlIndentPush('h6')
+call <SID>HtmlIndentPush('i')
+call <SID>HtmlIndentPush('iframe')
+call <SID>HtmlIndentPush('ins')
+call <SID>HtmlIndentPush('kbd')
+call <SID>HtmlIndentPush('label')
+call <SID>HtmlIndentPush('legend')
+call <SID>HtmlIndentPush('map')
+call <SID>HtmlIndentPush('menu')
+call <SID>HtmlIndentPush('noframes')
+call <SID>HtmlIndentPush('noscript')
+call <SID>HtmlIndentPush('object')
+call <SID>HtmlIndentPush('ol')
+call <SID>HtmlIndentPush('optgroup')
+" call <SID>HtmlIndentPush('pre')
+call <SID>HtmlIndentPush('q')
+call <SID>HtmlIndentPush('s')
+call <SID>HtmlIndentPush('samp')
+call <SID>HtmlIndentPush('script')
+call <SID>HtmlIndentPush('select')
+call <SID>HtmlIndentPush('small')
+call <SID>HtmlIndentPush('span')
+call <SID>HtmlIndentPush('strong')
+call <SID>HtmlIndentPush('style')
+call <SID>HtmlIndentPush('sub')
+call <SID>HtmlIndentPush('sup')
+call <SID>HtmlIndentPush('table')
+call <SID>HtmlIndentPush('textarea')
+call <SID>HtmlIndentPush('title')
+call <SID>HtmlIndentPush('tt')
+call <SID>HtmlIndentPush('u')
+call <SID>HtmlIndentPush('ul')
+call <SID>HtmlIndentPush('var')
+
+
+" [-- <ELEMENT ? O O ...> --]
+if !exists('g:html_indent_strict')
+ call <SID>HtmlIndentPush('body')
+ call <SID>HtmlIndentPush('head')
+ call <SID>HtmlIndentPush('html')
+ call <SID>HtmlIndentPush('tbody')
+endif
+
+
+" [-- <ELEMENT ? O - ...> --]
+if !exists('g:html_indent_strict_table')
+ call <SID>HtmlIndentPush('th')
+ call <SID>HtmlIndentPush('td')
+ call <SID>HtmlIndentPush('tr')
+ call <SID>HtmlIndentPush('tfoot')
+ call <SID>HtmlIndentPush('thead')
+endif
+
+delfun <SID>HtmlIndentPush
+
+set cpo-=C
+
+" [-- count indent-increasing tags of line a:lnum --]
+fun! <SID>HtmlIndentOpen(lnum, pattern)
+ let s = substitute('x'.getline(a:lnum),
+ \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g')
+ let s = substitute(s, "[^\1].*$", '', '')
+ return strlen(s)
+endfun
+
+" [-- count indent-decreasing tags of line a:lnum --]
+fun! <SID>HtmlIndentClose(lnum, pattern)
+ let s = substitute('x'.getline(a:lnum),
+ \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g')
+ let s = substitute(s, "[^\1].*$", '', '')
+ return strlen(s)
+endfun
+
+" [-- count indent-increasing '{' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentOpenAlt(lnum)
+ return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g'))
+endfun
+
+" [-- count indent-decreasing '}' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentCloseAlt(lnum)
+ return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g'))
+endfun
+
+" [-- return the sum of indents respecting the syntax of a:lnum --]
+fun! <SID>HtmlIndentSum(lnum, style)
+ if a:style == match(getline(a:lnum), '^\s*</')
+ if a:style == match(getline(a:lnum), '^\s*</\<\('.g:html_indent_tags.'\)\>')
+ let open = <SID>HtmlIndentOpen(a:lnum, g:html_indent_tags)
+ let close = <SID>HtmlIndentClose(a:lnum, g:html_indent_tags)
+ if 0 != open || 0 != close
+ return open - close
+ endif
+ endif
+ endif
+ if '' != &syntax &&
+ \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' &&
+ \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name')
+ \ =~ '\(css\|java\).*'
+ if a:style == match(getline(a:lnum), '^\s*}')
+ return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum)
+ endif
+ endif
+ return 0
+endfun
+
+fun! HtmlIndentGet(lnum)
+ " Find a non-empty line above the current line.
+ let lnum = prevnonblank(a:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let restore_ic = &ic
+ setlocal ic " ignore case
+
+ " [-- special handling for <pre>: no indenting --]
+ if getline(a:lnum) =~ '\c</pre>'
+ \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb')
+ \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW')
+ " we're in a line with </pre> or inside <pre> ... </pre>
+ return -1
+ endif
+
+ " [-- special handling for <javascript>: use cindent --]
+ let js = '<script.*type\s*=\s*.*java'
+ if 0 < searchpair(js, '', '</script>', 'nWb')
+ \ || 0 < searchpair(js, '', '</script>', 'nW')
+ " we're inside javascript
+ if getline(lnum) !~ js && getline(a:lnum) != '</script>'
+ return cindent(a:lnum)
+ endif
+ endif
+
+ if getline(lnum) =~ '\c</pre>'
+ " line before the current line a:lnum contains
+ " a closing </pre>. --> search for line before
+ " starting <pre> to restore the indent.
+ let preline = prevnonblank(search('\c<pre>', 'bW') - 1)
+ if preline > 0
+ return indent(preline)
+ endif
+ endif
+
+ let ind = <SID>HtmlIndentSum(lnum, -1)
+ let ind = ind + <SID>HtmlIndentSum(a:lnum, 0)
+
+ if restore_ic == 0
+ setlocal noic
+ endif
+
+ return indent(lnum) + (&sw * ind)
+endfun
+
+" [-- EOF <runtime>/indent/html.vim --]
diff --git a/runtime/indent/idlang.vim b/runtime/indent/idlang.vim
new file mode 100644
index 000000000..97c31ada5
--- /dev/null
+++ b/runtime/indent/idlang.vim
@@ -0,0 +1,63 @@
+" IDL (Interactive Data Language) indent file.
+" Language: IDL (ft=idlang)
+" Last change: 2002 Sep 23
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentkeys=o,O,0=endif,0=ENDIF,0=endelse,0=ENDELSE,0=endwhile,
+ \0=ENDWHILE,0=endfor,0=ENDFOR,0=endrep,0=ENDREP
+
+setlocal indentexpr=GetIdlangIndent(v:lnum)
+
+" Only define the function once.
+if exists("*GetIdlangIndent")
+ finish
+endif
+
+function GetIdlangIndent(lnum)
+ " First non-empty line above the current line.
+ let pnum = prevnonblank(v:lnum-1)
+ " v:lnum is the first non-empty line -- zero indent.
+ if pnum == 0
+ return 0
+ endif
+ " Second non-empty line above the current line.
+ let pnum2 = prevnonblank(pnum-1)
+
+ " Current indent.
+ let curind = indent(pnum)
+
+ " Indenting of continued lines.
+ if getline(pnum) =~ '\$\s*\(;.*\)\=$'
+ if getline(pnum2) !~ '\$\s*\(;.*\)\=$'
+ let curind = curind+&sw
+ endif
+ else
+ if getline(pnum2) =~ '\$\s*\(;.*\)\=$'
+ let curind = curind-&sw
+ endif
+ endif
+
+ " Indenting blocks of statements.
+ if getline(v:lnum) =~? '^\s*\(endif\|endelse\|endwhile\|endfor\|endrep\)\>'
+ if getline(pnum) =~? 'begin\>'
+ elseif indent(v:lnum) > curind-&sw
+ let curind = curind-&sw
+ else
+ return -1
+ endif
+ elseif getline(pnum) =~? 'begin\>'
+ if indent(v:lnum) < curind+&sw
+ let curind = curind+&sw
+ else
+ return -1
+ endif
+ endif
+ return curind
+endfunction
+
diff --git a/runtime/indent/ishd.vim b/runtime/indent/ishd.vim
new file mode 100644
index 000000000..9b4d7ff0d
--- /dev/null
+++ b/runtime/indent/ishd.vim
@@ -0,0 +1,65 @@
+" Description: InstallShield indenter
+" Author: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetIshdIndent(v:lnum)
+setlocal indentkeys&
+setlocal indentkeys+==else,=elseif,=endif,=end,=begin,<:>
+" setlocal indentkeys-=0#
+
+" Only define the function once.
+if exists("*GetIshdIndent")
+ finish
+endif
+
+fun! GetIshdIndent(lnum)
+ " labels and preprocessor get zero indent immediately
+ let this_line = getline(a:lnum)
+ let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)'
+ let LABELS_OR_PREPROC_EXCEPT = '^\s*\<default\+\>:'
+ if this_line =~ LABELS_OR_PREPROC && this_line !~ LABELS_OR_PREPROC_EXCEPT
+ return 0
+ endif
+
+ " Find a non-blank line above the current line.
+ " Skip over labels and preprocessor directives.
+ let lnum = a:lnum
+ while lnum > 0
+ let lnum = prevnonblank(lnum - 1)
+ let previous_line = getline(lnum)
+ if previous_line !~ LABELS_OR_PREPROC || previous_line =~ LABELS_OR_PREPROC_EXCEPT
+ break
+ endif
+ endwhile
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+
+ " Add
+ if previous_line =~ '^\s*\<\(function\|begin\|switch\|case\|default\|if.\{-}then\|else\|elseif\|while\|repeat\)\>'
+ let ind = ind + &sw
+ endif
+
+ " Subtract
+ if this_line =~ '^\s*\<endswitch\>'
+ let ind = ind - 2 * &sw
+ elseif this_line =~ '^\s*\<\(begin\|end\|endif\|endwhile\|else\|elseif\|until\)\>'
+ let ind = ind - &sw
+ elseif this_line =~ '^\s*\<\(case\|default\)\>'
+ if previous_line !~ '^\s*\<switch\>'
+ let ind = ind - &sw
+ endif
+ endif
+
+ return ind
+endfun
diff --git a/runtime/indent/java.vim b/runtime/indent/java.vim
new file mode 100644
index 000000000..a600c4bf3
--- /dev/null
+++ b/runtime/indent/java.vim
@@ -0,0 +1,128 @@
+" Vim indent file
+" Language: Java
+" Maintainer: Toby Allsopp <toby.allsopp@peace.com>
+" Last Change: 2003 Oct 21
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Indent Java anonymous classes correctly.
+setlocal cinoptions& cinoptions+=j1
+
+" The "extends" and "implements" lines start off with the wrong indent.
+setlocal indentkeys& indentkeys+=0=extends indentkeys+=0=implements
+
+" Set the function to do the work.
+setlocal indentexpr=GetJavaIndent()
+
+" Only define the function once.
+if exists("*GetJavaIndent")
+ finish
+endif
+
+function! SkipJavaBlanksAndComments(startline)
+ let lnum = a:startline
+ while lnum > 1
+ let lnum = prevnonblank(lnum)
+ if getline(lnum) =~ '\*/\s*$'
+ while getline(lnum) !~ '/\*' && lnum > 1
+ let lnum = lnum - 1
+ endwhile
+ if getline(lnum) =~ '^\s*/\*'
+ let lnum = lnum - 1
+ else
+ break
+ endif
+ elseif getline(lnum) =~ '^\s*//'
+ let lnum = lnum - 1
+ else
+ break
+ endif
+ endwhile
+ return lnum
+endfunction
+
+function GetJavaIndent()
+
+ " Java is just like C; use the built-in C indenting and then correct a few
+ " specific cases.
+ let theIndent = cindent(v:lnum)
+
+ " If we're in the middle of a comment then just trust cindent
+ if getline(v:lnum) =~ '^\s*\*'
+ return theIndent
+ endif
+
+ " find start of previous line, in case it was a continuation line
+ let lnum = SkipJavaBlanksAndComments(v:lnum - 1)
+ let prev = lnum
+ while prev > 1
+ let next_prev = SkipJavaBlanksAndComments(prev - 1)
+ if getline(next_prev) !~ ',\s*$'
+ break
+ endif
+ let prev = next_prev
+ endwhile
+
+ " Try to align "throws" lines for methods and "extends" and "implements" for
+ " classes.
+ if getline(v:lnum) =~ '^\s*\(extends\|implements\)\>'
+ \ && getline(lnum) !~ '^\s*\(extends\|implements\)\>'
+ let theIndent = theIndent + &sw
+ endif
+
+ " correct for continuation lines of "throws", "implements" and "extends"
+ let cont_kw = matchstr(getline(prev),
+ \ '^\s*\zs\(throws\|implements\|extends\)\>\ze.*,\s*$')
+ if strlen(cont_kw) > 0
+ let amount = strlen(cont_kw) + 1
+ if getline(lnum) !~ ',\s*$'
+ let theIndent = theIndent - (amount + &sw)
+ if theIndent < 0
+ let theIndent = 0
+ endif
+ elseif prev == lnum
+ let theIndent = theIndent + amount
+ if cont_kw ==# 'throws'
+ let theIndent = theIndent + &sw
+ endif
+ endif
+ elseif getline(prev) =~ '^\s*\(throws\|implements\|extends\)\>'
+ \ && (getline(prev) =~ '{\s*$'
+ \ || getline(v:lnum) =~ '^\s*{\s*$')
+ let theIndent = theIndent - &sw
+ endif
+
+ " When the line starts with a }, try aligning it with the matching {,
+ " skipping over "throws", "extends" and "implements" clauses.
+ if getline(v:lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$'
+ call cursor(v:lnum, 1)
+ silent normal %
+ let lnum = line('.')
+ if lnum < v:lnum
+ while lnum > 1
+ let next_lnum = SkipJavaBlanksAndComments(lnum - 1)
+ if getline(lnum) !~ '^\s*\(throws\|extends\|implements\)\>'
+ \ && getline(next_lnum) !~ ',\s*$'
+ break
+ endif
+ let lnum = prevnonblank(next_lnum)
+ endwhile
+ return indent(lnum)
+ endif
+ endif
+
+ " Below a line starting with "}" never indent more. Needed for a method
+ " below a method with an indented "throws" clause.
+ let lnum = SkipJavaBlanksAndComments(v:lnum - 1)
+ if getline(lnum) =~ '^\s*}\s*\(//.*\|/\*.*\)\=$' && indent(lnum) < theIndent
+ let theIndent = indent(lnum)
+ endif
+
+ return theIndent
+endfunction
+
+" vi: sw=2 et
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
new file mode 100644
index 000000000..37e397e37
--- /dev/null
+++ b/runtime/indent/lua.vim
@@ -0,0 +1,49 @@
+" Vim indent file
+" Language: Lua script
+" Maintainer: Marcus Aurelius Farias <marcuscf@vant.com.br>
+" First Author: Max Ischenko <mfi@ukr.net>
+" Last Change: 2003 Jan 20
+
+" Only define the function once.
+if exists("*GetLuaIndent") | finish | endif
+
+setlocal indentexpr=GetLuaIndent()
+
+" To make Vim call GetLuaIndent() when it finds '\s*end' or '\s*until'
+" on the current line (else is default).
+setlocal indentkeys+=0=end,0=until
+
+setlocal autoindent
+
+function! GetLuaIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " Add a 'shiftwidth' after lines beginning with:
+ " function, if, for, while, repeat, else, elseif, '{'
+ let ind = indent(lnum)
+ let flag = 0
+ if getline(lnum) =~ '^\s*\(function\>\|if\>\|for\>\|while\>\|repeat\>\|else\>\|elseif\>\|do\>\)' || getline(lnum) =~ '{\s*$' || getline(lnum) =~ '\s*=\s*function'
+ let ind = ind + &sw
+ let flag = 1
+ endif
+
+ " Subtract a 'shiftwidth' after lines ending with
+ " 'end' when they begin with while, if, for, etc.
+ if flag == 1 && getline(lnum) =~ '\<end\>\|\<until\>'
+ let ind = ind - &sw
+ endif
+
+ " Subtract a 'shiftwidth' on end, else (and elseif), until and '}'
+ " This is the part that requires 'indentkeys'.
+ if getline(v:lnum) =~ '^\s*\(end\|else\|until\|}\)'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
diff --git a/runtime/indent/make.vim b/runtime/indent/make.vim
new file mode 100644
index 000000000..f376424ad
--- /dev/null
+++ b/runtime/indent/make.vim
@@ -0,0 +1,57 @@
+" Vim indent file
+" Language: Makefile
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/make/
+" Latest Revision: 2004-04-25
+" arch-tag: b539e147-a05c-4860-98af-1d2436db2f4b
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetMakeIndent()
+setlocal indentkeys=!^F,o,O
+
+" Only define the function once.
+if exists("*GetMakeIndent")
+ finish
+endif
+
+function s:GetStringWidth(line, str)
+ let end = matchend(a:line, a:str)
+ let width = 0
+ let i = 0
+ while i < end
+ if a:line[i] != "\t"
+ let width = width + 1
+ else
+ let width = width + &ts - (width % &ts)
+ endif
+ let i = i + 1
+ endwhile
+ return width
+endfunction
+
+function GetMakeIndent()
+ if v:lnum == 1
+ return 0
+ endif
+
+ let ind = indent(v:lnum - 1)
+ let line = getline(v:lnum - 1)
+
+ if line == ''
+ let ind = 0
+ elseif line =~ '^[^ \t#:][^#:]*:\{1,2}\([^=:]\|$\)'
+ let ind = ind + &ts
+ elseif line =~ '^\s*\h\w*\s*=\s*.\+\\$'
+ let ind = s:GetStringWidth(line, '=\s*')
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/matlab.vim b/runtime/indent/matlab.vim
new file mode 100644
index 000000000..7bccc7c0a
--- /dev/null
+++ b/runtime/indent/matlab.vim
@@ -0,0 +1,74 @@
+" Matlab indent file
+" Language: Matlab
+" Maintainer: Christophe Poucet <christophe.poucet@pandora.be>
+" Last Change: 6 January, 2001
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Some preliminary setting
+setlocal indentkeys=!,o,O=end,=case,=else,=elseif,=otherwise,=catch
+
+
+setlocal indentexpr=GetMatlabIndent(v:lnum)
+
+" Only define the function once.
+if exists("*GetMatlabIndent")
+ finish
+endif
+
+function GetMatlabIndent(lnum)
+ " Give up if this line is explicitly joined.
+ if getline(a:lnum - 1) =~ '\\$'
+ return -1
+ endif
+
+ " Search backwards for the first non-empty line.
+ let plnum = a:lnum - 1
+ while plnum > 0 && getline(plnum) =~ '^\s*$'
+ let plnum = plnum - 1
+ endwhile
+
+ if plnum == 0
+ " This is the first non-empty line, use zero indent.
+ return 0
+ endif
+
+ let curind = indent(plnum)
+
+ " If the current line is a stop-block statement...
+ if getline(v:lnum) =~ '^\s*\(end\|else\|elseif\|case\|otherwise\|catch\)\>'
+ " See if this line does not follow the line right after an openblock
+ if getline(plnum) =~ '^\s*\(for\|if\|else\|elseif\|case\|while\|switch\|try\|otherwise\|catch\)\>'
+ " See if the user has already dedented
+ elseif indent(v:lnum) > curind - &sw
+ " If not, recommend one dedent
+ let curind = curind - &sw
+ else
+ " Otherwise, trust the user
+ return -1
+ endif
+" endif
+
+ " If the previous line opened a block
+ elseif getline(plnum) =~ '^\s*\(for\|if\|else\|elseif\|case\|while\|switch\|try\|otherwise\|catch\)\>'
+ " See if the user has already indented
+ if indent(v:lnum) < curind + &sw
+ "If not, recommend indent
+ let curind = curind + &sw
+ else
+ " Otherwise, trust the user
+ return -1
+ endif
+ endif
+
+
+
+ " If we got to here, it means that the user takes the standardversion, so we return it
+ return curind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/mp.vim b/runtime/indent/mp.vim
new file mode 100644
index 000000000..1aea4f809
--- /dev/null
+++ b/runtime/indent/mp.vim
@@ -0,0 +1,206 @@
+" MetaPost indent file
+" Language: MetaPost
+" Maintainer: Eugene Minkovskii <emin@mccme.ru>
+" Last Change: 2003 Nov 21
+" Version: 0.1
+" ==========================================================================
+
+" Identation Rules: {{{1
+" First of all, MetaPost language don't expect any identation rules.
+" This screept need for you only if you (not MetaPost) need to do
+" exactly code. If you don't need to use indentation, see
+" :help filetype-indent-off
+"
+" Note: Every rules of identation in MetaPost or TeX languages (and in some
+" other of course) is very subjective. I can release only my vision of this
+" promlem.
+"
+" ..........................................................................
+" Example of correct (by me) identation {{{2
+" shiftwidth=4
+" ==========================================================================
+" for i=0 upto 99:
+" z[i] = (0,1u) rotated (i*360/100);
+" endfor
+" draw z0 -- z10 -- z20
+" withpen ... % <- 2sw because breaked line
+" withcolor ...; % <- same as previous
+" draw z0 for i=1 upto 99:
+" -- z[i] % <- 1sw from left end of 'for' satement
+" endfor withpen ... % <- 0sw from left end of 'for' satement
+" withcolor ...; % <- 2sw because breaked line
+" draw if One: % <- This is internal if (like 'for' above)
+" one
+" elsif Other:
+" other
+" fi withpen ...;
+" if one: % <- This is external if
+" draw one;
+" elseif other:
+" draw other;
+" fi
+" draw z0; draw z1;
+" }}}
+" }}}
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetMetaPostIndent()
+setlocal indentkeys+=;,<:>,=if,=for,=def,=end,=else,=fi
+
+" Only define the function once.
+if exists("*GetMetaPostIndent")
+ finish
+endif
+
+" Auxiliary Definitions: {{{1
+function! MetaNextNonblankNoncomment(pos)
+ " Like nextnonblank() but ignore comment lines
+ let tmp = nextnonblank(a:pos)
+ while tmp && getline(tmp) =~ '^\s*%'
+ let tmp = nextnonblank(tmp+1)
+ endwhile
+ return tmp
+endfunction
+
+function! MetaPrevNonblankNoncomment(pos)
+ " Like prevnonblank() but ignore comment lines
+ let tmp = prevnonblank(a:pos)
+ while tmp && getline(tmp) =~ '^\s*%'
+ let tmp = prevnonblank(tmp-1)
+ endwhile
+ return tmp
+endfunction
+
+function! MetaSearchNoncomment(pattern, ...)
+ " Like search() but ignore commented areas
+ if a:0
+ let flags = a:1
+ elseif &wrapscan
+ let flags = "w"
+ else
+ let flags = "W"
+ endif
+ let cl = line(".")
+ let cc = col(".")
+ let tmp = search(a:pattern, flags)
+ while tmp && synIDattr(synID(line("."), col("."), 1), "name") =~
+ \ 'm[fp]\(Comment\|TeXinsert\|String\)'
+ let tmp = search(a:pattern, flags)
+ endwhile
+ if !tmp
+ call cursor(cl,cc)
+ endif
+ return tmp
+endfunction
+" }}}
+
+function! GetMetaPostIndent()
+ " not indent in comment ???
+ if synIDattr(synID(line("."), col("."), 1), "name") =~
+ \ 'm[fp]\(Comment\|TeXinsert\|String\)'
+ return -1
+ endif
+ " Some RegExps: {{{1
+ " end_of_item: all of end by ';'
+ " + all of end by :endfor, :enddef, :endfig, :endgroup, :fi
+ " + all of start by :beginfig(num), :begingroup
+ " + all of start by :for, :if, :else, :elseif and end by ':'
+ " + all of start by :def, :vardef and end by '='
+ let end_of_item = '\(' .
+ \ ';\|' .
+ \ '\<\(end\(for\|def\|fig\|group\)\|fi\)\>\|' .
+ \ '\<begin\(group\>\|fig\s*(\s*\d\+\s*)\)\|' .
+ \ '\<\(for\|if\|else\(if\)\=\)\>.\+:\|' .
+ \ '\<\(var\)\=def\>.\+=' . '\)'
+ " }}}
+ " Save: current position {{{1
+ let cl = line (".")
+ let cc = col (".")
+ let cs = getline(".")
+ " if it is :beginfig or :endfig use zero indent
+ if cs =~ '^\s*\(begin\|end\)fig\>'
+ return 0
+ endif
+ " }}}
+ " Initialise: ind variable {{{1
+ " search previous item not in current line
+ let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
+ while p_semicol_l == cl
+ let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
+ endwhile
+ " if this is first item in program use zero indent
+ if !p_semicol_l
+ return 0
+ endif
+ " if this is multiline item, remember first indent
+ if MetaNextNonblankNoncomment(p_semicol_l+1) < cl
+ let ind = indent(MetaNextNonblankNoncomment(p_semicol_l+1))
+ " else --- search pre-previous item for search first line in previous item
+ else
+ " search pre-previous item not in current line
+ let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
+ while pp_semicol_l == p_semicol_l
+ let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
+ endwhile
+ " if we find pre-previous item, remember indent of previous item
+ " else --- remember zero
+ if pp_semicol_l
+ let ind = indent(MetaNextNonblankNoncomment(line(".")+1))
+ else
+ let ind = 0
+ endif
+ endif
+ " }}}
+ " Increase Indent: {{{1
+ " if it is an internal/external :for or :if statements {{{2
+ let pnn_s = getline(MetaPrevNonblankNoncomment(cl-1))
+ if pnn_s =~ '\<\(for\|if\)\>.\+:\s*\($\|%\)'
+ let ind = match(pnn_s, '\<\(for\|if\)\>.\+:\s*\($\|%\)') + &sw
+ " }}}
+ " if it is a :def, :vardef, :beginfig, :begingroup, :else, :elseif {{{2
+ elseif pnn_s =~ '^\s*\(' .
+ \ '\(var\)\=def\|' .
+ \ 'begin\(group\|fig\s*(\s*\d\+\s*)\)\|' .
+ \ 'else\(if\)\=' . '\)\>'
+ let ind = ind + &sw
+ " }}}
+ " if it is a broken line {{{2
+ elseif pnn_s !~ end_of_item.'\s*\($\|%\)'
+ let ind = ind + (2 * &sw)
+ endif
+ " }}}
+ " }}}
+ " Decrease Indent: {{{1
+ " if this is :endfor or :enddef statements {{{2
+ " this is correct because :def cannot be inside :for
+ if cs =~ '\<end\(for\|def\)\=\>'
+ call MetaSearchNoncomment('\<for\>.\+:\s*\($\|%\)' . '\|' .
+ \ '^\s*\(var\)\=def\>',"bW")
+ if col(".") > 1
+ let ind = col(".") - 1
+ else
+ let ind = indent(".")
+ endif
+ " }}}
+ " if this is :fi, :else, :elseif statements {{{2
+ elseif cs =~ '\<\(else\(if\)\=\|fi\)\>'
+ call MetaSearchNoncomment('\<if\>.\+:\s*\($\|%\)',"bW")
+ let ind = col(".") - 1
+ " }}}
+ " if this is :endgroup statement {{{2
+ elseif cs =~ '^\s*endgroup\>'
+ let ind = ind - &sw
+ endif
+ " }}}
+ " }}}
+
+ return ind
+endfunction
+"
+
+" vim:sw=2:fdm=marker
diff --git a/runtime/indent/objc.vim b/runtime/indent/objc.vim
new file mode 100644
index 000000000..beadca9fa
--- /dev/null
+++ b/runtime/indent/objc.vim
@@ -0,0 +1,79 @@
+" Vim indent file
+" Language: Objective-C
+" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
+" Last Change: 2004 May 16
+"
+
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+setlocal cindent
+
+" Set the function to do the work.
+setlocal indentexpr=GetObjCIndent()
+
+" To make a colon (:) suggest an indentation other than a goto/swich label,
+setlocal indentkeys-=:
+setlocal indentkeys+=<:>
+
+" Only define the function once.
+if exists("*GetObjCIndent")
+ finish
+endif
+
+function s:GetWidth(line, regexp)
+ let end = matchend(a:line, a:regexp)
+ let width = 0
+ let i = 0
+ while i < end
+ if a:line[i] != "\t"
+ let width = width + 1
+ else
+ let width = width + &ts - (width % &ts)
+ endif
+ let i = i + 1
+ endwhile
+ return width
+endfunction
+
+function s:LeadingWhiteSpace(line)
+ let end = strlen(a:line)
+ let width = 0
+ let i = 0
+ while i < end
+ let char = a:line[i]
+ if char != " " && char != "\t"
+ break
+ endif
+ if char != "\t"
+ let width = width + 1
+ else
+ let width = width + &ts - (width % &ts)
+ endif
+ let i = i + 1
+ endwhile
+ return width
+endfunction
+
+
+function GetObjCIndent()
+ let theIndent = cindent(v:lnum)
+
+ let prev_line = getline(v:lnum - 1)
+ let cur_line = getline(v:lnum)
+
+ if prev_line !~# ":" || cur_line !~# ":"
+ return theIndent
+ endif
+
+ if prev_line !~# ";"
+ let prev_colon_pos = s:GetWidth(prev_line, ":")
+ let delta = s:GetWidth(cur_line, ":") - s:LeadingWhiteSpace(cur_line)
+ let theIndent = prev_colon_pos - delta
+ endif
+
+ return theIndent
+endfunction
diff --git a/runtime/indent/ocaml.vim b/runtime/indent/ocaml.vim
new file mode 100644
index 000000000..a26b4bc22
--- /dev/null
+++ b/runtime/indent/ocaml.vim
@@ -0,0 +1,311 @@
+" Vim indent file
+" Language: OCaml
+" Maintainers: Jean-Francois Yuen <jfyuen@ifrance.com>
+" Mike Leary <leary@nwlink.com>
+" Markus Mottl <markus@oefai.at>
+" URL: http://www.oefai.at/~markus/vim/indent/ocaml.vim
+" Last Change: 2003 Apr 14
+" 2003 Mar 05 - Added '{<' and some fixes (JY)
+" 2002 Nov 06 - Some fixes (JY)
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal expandtab
+setlocal indentexpr=GetOCamlIndent()
+setlocal indentkeys+=0=and,0=constraint,0=done,0=else,0=end,0=exception,0=external,0=if,0=in,0=include,0=inherit,0=initializer,0=let,0=method,0=open,0=then,0=type,0=val,0=with,0=;;,0=>\],0=\|\],0=\|,0=*),0=>},0},0\],0)
+setlocal nolisp
+setlocal nosmartindent
+setlocal textwidth=80
+
+" Comment formatting
+if (has("comments"))
+ setlocal comments=sr:(*,mb:*,ex:*)
+ setlocal fo=cqort
+endif
+
+" Only define the function once.
+if exists("*GetOCamlIndent")
+ finish
+endif
+
+" Define some patterns:
+let s:beflet = '^\s*\(initializer\|method\|try\)\|\(\<\(begin\|do\|else\|in\|then\|try\)\|->\|;\|(\)\s*$'
+let s:letpat = '^\s*\(let\|type\|module\|class\|open\|exception\|val\|include\|external\)\>'
+let s:letlim = '\(\<\(sig\|struct\)\|;;\)\s*$'
+let s:lim = '^\s*\(exception\|external\|include\|let\|module\|open\|type\|val\)\>'
+let s:module = '\<\%(begin\|sig\|struct\|object\)\>'
+let s:obj = '^\s*\(constraint\|inherit\|initializer\|method\|val\)\>\|\<\(object\|object\s*(.*)\)\s*$'
+let s:type = '^\s*\%(let\|type\)\>.*='
+let s:val = '^\s*\(val\|external\)\>.*:'
+
+" Skipping pattern, for comments
+function s:SkipPattern(lnum, pat)
+ let def = prevnonblank(a:lnum - 1)
+ while def > 0 && getline(def) =~ a:pat
+ let def = prevnonblank(def - 1)
+ endwhile
+ return def
+endfunction
+
+" Indent for ';;' to match multiple 'let'
+function s:GetInd(lnum, pat, lim)
+ let llet = search(a:pat, 'bW')
+ let old = indent(a:lnum)
+ while llet > 0
+ let old = indent(llet)
+ let nb = s:SkipPattern(llet, '^\s*(\*.*\*)\s*$')
+ if getline(nb) =~ a:lim
+ return old
+ endif
+ let llet = search(a:pat, 'bW')
+ endwhile
+ return old
+endfunction
+
+" Indent pairs
+function s:FindPair(pstart, pmid, pend)
+ call search(a:pend, 'bW')
+ return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
+endfunction
+
+" Indent 'let'
+function s:FindLet(pstart, pmid, pend)
+ call search(a:pend, 'bW')
+ return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "^\\s*let\\>.*=.*\\<in\\s*$" || getline(prevnonblank(".") - 1) =~ "^\\s*let\\>.*=\\s*$\\|" . s:beflet'))
+endfunction
+
+function GetOCamlIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+ let lline = getline(lnum)
+
+ " Return double 'shiftwidth' after lines matching:
+ if lline =~ '^\s*|.*->\s*$'
+ return ind + &sw + &sw
+ endif
+
+ let line = getline(v:lnum)
+
+ " Indent if current line begins with 'end'
+ " for 'sig', 'struct', 'object' and 'begin':
+ if line =~ '^\s*end\>'
+ return s:FindPair(s:module, '','\<end\>')
+
+ " Indent if current line begins with 'done' for 'do':
+ elseif line =~ '^\s*done\>'
+ return s:FindPair('\<do\>', '','\<done\>')
+
+ " Indent if current line begins with '}' or '>}':
+ elseif line =~ '^\s*\(\|>\)}'
+ return s:FindPair('{', '','}')
+
+ " Indent if current line begins with ']', '|]' or '>]':
+ elseif line =~ '^\s*\(\||\|>\)\]'
+ return s:FindPair('\[', '','\]')
+
+ " Indent if current line begins with ')':
+ elseif line =~ '^\s*)'
+ return s:FindPair('(', '',')')
+
+ " Indent if current line begins with 'let'
+ " and last line does not begin with 'let' or end with 'in' or ';;':
+ elseif line =~ '^\s*let\>'
+ if lline !~ s:lim . '\|' . s:letlim . '\|' . s:beflet
+ return s:FindLet(s:type, '','\<let\s*$')
+ else return ind
+ endif
+
+ " Indent if current line begins with 'type'
+ " and last line does not end with 'and' or ';;':
+ elseif line =~ '^\s*type\>'
+ if lline !~ s:lim . '\|\<and\s*$\|' . s:letlim
+ return s:FindLet(s:type, '','\<type\s*$')
+ else return ind
+ endif
+
+ " Indent for pattern matching:
+ elseif line =~ '^\s*|'
+ if lline !~ '^\s*\(|\|\(match\|with\|type\)\>\)\|\<\(function\|parser\|with\)\s*$'
+ call search('|', 'bW')
+ return indent(searchpair('^\s*\(type\|match\)\>\|\<\(with\|function\|parser\)\s*$', '', '|', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "\\[|\\||\\]" && getline(".") !~ "^\\s*|.*->"'))
+ else return ind
+ endif
+
+ " Indent if current line begins with ';;':
+ elseif line =~ '^\s*;;'
+ if lline !~ ';;\s*$'
+ return s:GetInd(v:lnum, s:letpat, s:letlim)
+ else return ind
+ endif
+
+ " Indent if current line begins with 'in' and previous
+ " line does not start with 'let' or 'and':
+ elseif line =~ '^\s*in\>'
+ if lline !~ '^\s*\(let\|and\)\>'
+ return s:FindPair('\<let\>', '', '\<in\>')
+ else return ind
+ endif
+
+ " Indent if current line begins with 'else'
+ " and previous line does not start with 'if', 'then' or 'else':
+ elseif line =~ '^\s*else\>'
+ if lline !~ '^\s*\(if\|else\|then\)\>'
+ return s:FindPair('\<if\>', '', '\<else\>')
+ else return ind
+ endif
+
+ " Indent if current line begins with 'then'
+ " and previous line does not start with 'if', 'then' or 'else':
+ elseif line =~ '^\s*then\>'
+ if lline !~ '^\s*\(if\|else\|then\)\>'
+ return s:FindPair('\<if\>', '', '\<then\>')
+ else return ind
+ endif
+
+ " Subtract a 'shiftwidth' if current line begins with 'and' and previous
+ " line does not start with 'let', 'and' or 'type' or end with 'end'
+ " (for classes):
+ elseif line =~ '^\s*and\>'
+ if lline !~ '^\s*\(and\|let\|type\)\>\|\<end\s*$'
+ return ind - &sw
+ else return ind
+ endif
+
+ " Indent if current line begins with 'with'
+ " and previous line does not start with 'match' or 'try':
+ elseif line =~ '^\s*with\>'
+ if lline !~ '^\s*\(match\|try\)\>'
+ return s:FindPair('\<\%(match\|try\)\>', '','\<with\>')
+ else return ind
+ endif
+
+ " Indent if current line begins with 'exception':
+ elseif line =~ '^\s*exception\>'
+ if lline !~ s:lim . '\|' . s:letlim
+ return indent(search(s:val . '\|^\s*\(external\|include\|open\|type\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'external':
+ elseif line =~ '^\s*external\>'
+ if lline !~ s:lim . '\|' . s:letlim
+ return indent(search(s:val . '\|^\s*\(exception\|include\|open\|type\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'include':
+ elseif line =~ '^\s*include\>'
+ if lline !~ s:lim . '\|' . s:letlim
+ return indent(search(s:val . '\|^\s*\(exception\|external\|open\|type\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'open':
+ elseif line =~ '^\s*open\>'
+ if lline !~ s:lim . '\|' . s:letlim
+ return indent(search(s:val . '\|^\s*\(exception\|external\|include\|type\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'val':
+ elseif line =~ '^\s*val\>'
+ if lline !~ '^\s*\(exception\|external\|include\|open\)\>\|' . s:obj . '\|' . s:letlim
+ return indent(search(s:val . '\|^\s*\(exception\|include\|initializer\|method\|open\|type\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'constraint':
+ elseif line =~ '^\s*constraint\>'
+ if lline !~ s:obj
+ return indent(search('^\s*\(inherit\|initializer\|method\|val\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'inherit':
+ elseif line =~ '^\s*inherit\>'
+ if lline !~ s:obj
+ return indent(search('^\s*\(constraint\|initializer\|method\|val\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'inherit':
+ elseif line =~ '^\s*initializer\>'
+ if lline !~ s:obj
+ return indent(search('^\s*\(constraint\|inherit\|method\|val\)\>', 'bW'))
+ else return ind
+ endif
+
+ " Indent if current line begins with 'method':
+ elseif line =~ '^\s*method\>'
+ if lline !~ s:obj
+ return indent(search('^\s*\(\(constraint\|inherit\|initializer\|val\)\>\|method\>.*\(:\|=\)\)', 'bW'))
+ else return ind
+ endif
+
+ " Indent back to normal after comments:
+ elseif line =~ '^\s*\*)'
+ call search('\*)', 'bW')
+ return indent(searchpair('(\*', '', '\*)', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
+
+ endif
+
+ " Add a 'shiftwidth' after lines ending with:
+ if lline =~ '\(:\|=\|->\|<-\|(\|\[\|{\|{<\|\[|\|\[<\|\<\(begin\|struct\|sig\|functor\|initializer\|object\|try\|do\|if\|then\|else\|fun\|function\|parser\)\|\<object\s*(.*)\)\s*$'
+ let ind = ind + &sw
+
+ " Back to normal indent after lines ending with ';;':
+ elseif lline =~ ';;\s*$' && lline !~ '^\s*;;'
+ let ind = s:GetInd(v:lnum, s:letpat, s:letlim)
+
+ " Back to normal indent after lines ending with 'end':
+ elseif lline =~ '\<end\s*$'
+ let ind = s:FindPair(s:module, '','\<end\>')
+
+ " Back to normal indent after lines ending with 'in':
+ elseif lline =~ '\<in\s*$' && lline !~ '^\s*in\>'
+ let ind = s:FindPair('\<let\>', '', '\<in\>')
+
+ " Back to normal indent after lines ending with 'done':
+ elseif lline =~ '\<done\s*$'
+ let ind = s:FindPair('\<do\>', '','\<done\>')
+
+ " Back to normal indent after lines ending with '}' or '>}':
+ elseif lline =~ '\(\|>\)}\s*$'
+ let ind = s:FindPair('{', '','}')
+
+ " Back to normal indent after lines ending with ']', '|]' or '>]':
+ elseif lline =~ '\(\||\|>\)\]\s*$'
+ let ind = s:FindPair('\[', '','\]')
+
+ " Back to normal indent after comments:
+ elseif lline =~ '\*)\s*$'
+ call search('\*)', 'bW')
+ let ind = indent(searchpair('(\*', '', '\*)', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
+
+ " Back to normal indent after lines ending with ')':
+ elseif lline =~ ')\s*$'
+ let ind = s:FindPair('(', '',')')
+
+ endif
+
+ " Subtract a 'shiftwidth' after lines matching 'match ... with parser':
+ if lline =~ '^\s*match\>.*\<with\>\s*\<parser\s*$'
+ let ind = ind - &sw
+ endif
+
+ return ind
+
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/occam.vim b/runtime/indent/occam.vim
new file mode 100644
index 000000000..ba978e006
--- /dev/null
+++ b/runtime/indent/occam.vim
@@ -0,0 +1,182 @@
+" Vim indent file
+" Language: occam
+" Maintainer: Mario Schweigler <ms44@kent.ac.uk>
+" Last Change: 23 April 2003
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+"{{{ Settings
+" Set the occam indent function
+setlocal indentexpr=GetOccamIndent()
+" Indent after new line and after initial colon
+setlocal indentkeys=o,O,0=:
+"}}}
+
+" Only define the function once
+if exists("*GetOccamIndent")
+ finish
+endif
+
+"{{{ Indent definitions
+" Define carriage return indent
+let s:FirstLevelIndent = '^\C\s*\(IF\|ALT\|PRI\s\+ALT\|PAR\|SEQ\|PRI\s\+PAR\|WHILE\|VALOF\|CLAIM\|FORKING\)\>\|\(--.*\)\@<!\(\<PROC\>\|??\|\<CASE\>\s*\(--.*\)\=\_$\)'
+let s:FirstLevelNonColonEndIndent = '^\C\s*PROTOCOL\>\|\(--.*\)\@<!\<\(\(CHAN\|DATA\)\s\+TYPE\|FUNCTION\)\>'
+let s:SecondLevelIndent = '^\C\s*\(IF\|ALT\|PRI\s\+ALT\)\>\|\(--.*\)\@<!?\s*\<CASE\>\s*\(--.*\)\=\_$'
+let s:SecondLevelNonColonEndIndent = '\(--.*\)\@<!\<\(CHAN\|DATA\)\s\+TYPE\>'
+
+" Define colon indent
+let s:ColonIndent = '\(--.*\)\@<!\<PROC\>'
+let s:ColonNonColonEndIndent = '^\C\s*PROTOCOL\>\|\(--.*\)\@<!\<\(\(CHAN\|DATA\)\s\+TYPE\|FUNCTION\)\>'
+
+let s:ColonEnd = '\(--.*\)\@<!:\s*\(--.*\)\=$'
+let s:ColonStart = '^\s*:\s*\(--.*\)\=$'
+
+" Define comment
+let s:CommentLine = '^\s*--'
+"}}}
+
+"{{{ function GetOccamIndent()
+" Auxiliary function to get the correct indent for a line of occam code
+function GetOccamIndent()
+
+ " Ensure magic is on
+ let save_magic = &magic
+ setlocal magic
+
+ " Get reference line number
+ let linenum = prevnonblank(v:lnum - 1)
+ while linenum > 0 && getline(linenum) =~ s:CommentLine
+ let linenum = prevnonblank(linenum - 1)
+ endwhile
+
+ " Get current indent
+ let curindent = indent(linenum)
+
+ " Get current line
+ let line = getline(linenum)
+
+ " Get previous line number
+ let prevlinenum = prevnonblank(linenum - 1)
+ while prevlinenum > 0 && getline(prevlinenum) =~ s:CommentLine
+ let prevlinenum = prevnonblank(prevlinenum - 1)
+ endwhile
+
+ " Get previous line
+ let prevline = getline(prevlinenum)
+
+ " Colon indent
+ if getline(v:lnum) =~ s:ColonStart
+
+ let found = 0
+
+ while found < 1
+
+ if line =~ s:ColonStart
+ let found = found - 1
+ elseif line =~ s:ColonIndent || (line =~ s:ColonNonColonEndIndent && line !~ s:ColonEnd)
+ let found = found + 1
+ endif
+
+ if found < 1
+ let linenum = prevnonblank(linenum - 1)
+ if linenum > 0
+ let line = getline(linenum)
+ else
+ let found = 1
+ endif
+ endif
+
+ endwhile
+
+ if linenum > 0
+ let curindent = indent(linenum)
+ else
+ let colonline = getline(v:lnum)
+ let tabstr = ''
+ while strlen(tabstr) < &tabstop
+ let tabstr = ' ' . tabstr
+ endwhile
+ let colonline = substitute(colonline, '\t', tabstr, 'g')
+ let curindent = match(colonline, ':')
+ endif
+
+ " Restore magic
+ if !save_magic|setlocal nomagic|endif
+
+ return curindent
+ endif
+
+ if getline(v:lnum) =~ '^\s*:'
+ let colonline = getline(v:lnum)
+ let tabstr = ''
+ while strlen(tabstr) < &tabstop
+ let tabstr = ' ' . tabstr
+ endwhile
+ let colonline = substitute(colonline, '\t', tabstr, 'g')
+ let curindent = match(colonline, ':')
+
+ " Restore magic
+ if !save_magic|setlocal nomagic|endif
+
+ return curindent
+ endif
+
+ " Carriage return indenat
+ if line =~ s:FirstLevelIndent || (line =~ s:FirstLevelNonColonEndIndent && line !~ s:ColonEnd)
+ \ || (line !~ s:ColonStart && (prevline =~ s:SecondLevelIndent
+ \ || (prevline =~ s:SecondLevelNonColonEndIndent && prevline !~ s:ColonEnd)))
+ let curindent = curindent + &shiftwidth
+
+ " Restore magic
+ if !save_magic|setlocal nomagic|endif
+
+ return curindent
+ endif
+
+ " Commented line
+ if getline(prevnonblank(v:lnum - 1)) =~ s:CommentLine
+
+ " Restore magic
+ if !save_magic|setlocal nomagic|endif
+
+ return indent(prevnonblank(v:lnum - 1))
+ endif
+
+ " Look for previous second level IF / ALT / PRI ALT
+ let found = 0
+
+ while !found
+
+ if indent(prevlinenum) == curindent - &shiftwidth
+ let found = 1
+ endif
+
+ if !found
+ let prevlinenum = prevnonblank(prevlinenum - 1)
+ while prevlinenum > 0 && getline(prevlinenum) =~ s:CommentLine
+ let prevlinenum = prevnonblank(prevlinenum - 1)
+ endwhile
+ if prevlinenum == 0
+ let found = 1
+ endif
+ endif
+
+ endwhile
+
+ if prevlinenum > 0
+ if getline(prevlinenum) =~ s:SecondLevelIndent
+ let curindent = curindent + &shiftwidth
+ endif
+ endif
+
+ " Restore magic
+ if !save_magic|setlocal nomagic|endif
+
+ return curindent
+
+endfunction
+"}}}
diff --git a/runtime/indent/perl.vim b/runtime/indent/perl.vim
new file mode 100644
index 000000000..1af058043
--- /dev/null
+++ b/runtime/indent/perl.vim
@@ -0,0 +1,180 @@
+" Vim indent file
+" Language: Perl
+" Author: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
+" URL: http://rgarciasuarez.free.fr/vim/indent/perl.vim
+" Last Change: 2003 Apr 25
+
+" Suggestions and improvements by :
+" Aaron J. Sherman (use syntax for hints)
+" Artem Chuprina (play nice with folding)
+
+" TODO things that are not or not properly indented (yet) :
+" - Continued statements
+" print "foo",
+" "bar";
+" print "foo"
+" if bar();
+" - Multiline regular expressions (m//x)
+" (The following probably needs modifying the perl syntax file)
+" - qw() lists
+" - Heredocs with terminators that don't match \I\i*
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Is syntax highlighting active ?
+let b:indent_use_syntax = has("syntax") && &syntax == "perl"
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+setlocal indentexpr=GetPerlIndent()
+setlocal indentkeys+=0=,0),0=or,0=and
+if !b:indent_use_syntax
+ setlocal indentkeys+=0=EO
+endif
+
+" Only define the function once.
+if exists("*GetPerlIndent")
+ finish
+endif
+
+function GetPerlIndent()
+
+ " Get the line to be indented
+ let cline = getline(v:lnum)
+
+ " Indent POD markers to column 0
+ if cline =~ '^\s*=\L\@!'
+ return 0
+ endif
+
+ " Don't reindent coments on first column
+ if cline =~ '^#.'
+ return 0
+ endif
+
+ " Get current syntax item at the line's first char
+ let csynid = ''
+ if b:indent_use_syntax
+ let csynid = synIDattr(synID(v:lnum,1,0),"name")
+ endif
+
+ " Don't reindent POD and heredocs
+ if csynid == "perlPOD" || csynid == "perlHereDoc" || csynid =~ "^pod"
+ return indent(v:lnum)
+ endif
+
+ " Indent end-of-heredocs markers to column 0
+ if b:indent_use_syntax
+ " Assumes that an end-of-heredoc marker matches \I\i* to avoid
+ " confusion with other types of strings
+ if csynid == "perlStringStartEnd" && cline =~ '^\I\i*$'
+ return 0
+ endif
+ else
+ " Without syntax hints, assume that end-of-heredocs markers begin with EO
+ if cline =~ '^\s*EO'
+ return 0
+ endif
+ endif
+
+ " Now get the indent of the previous perl line.
+
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+ let line = getline(lnum)
+ let ind = indent(lnum)
+ " Skip heredocs, POD, and comments on 1st column
+ if b:indent_use_syntax
+ let skippin = 2
+ while skippin
+ let synid = synIDattr(synID(lnum,1,0),"name")
+ if (synid == "perlStringStartEnd" && line =~ '^\I\i*$')
+ \ || (skippin != 2 && synid == "perlPOD")
+ \ || (skippin != 2 && synid == "perlHereDoc")
+ \ || synid == "perlComment"
+ \ || synid =~ "^pod"
+ let lnum = prevnonblank(lnum - 1)
+ if lnum == 0
+ return 0
+ endif
+ let line = getline(lnum)
+ let ind = indent(lnum)
+ let skippin = 1
+ else
+ let skippin = 0
+ endif
+ endwhile
+ else
+ if line =~ "^EO"
+ let lnum = search("<<[\"']\\=EO", "bW")
+ let line = getline(lnum)
+ let ind = indent(lnum)
+ endif
+ endif
+
+ " Indent blocks enclosed by {} or ()
+ if b:indent_use_syntax
+ " Find a real opening brace
+ let bracepos = match(line, '[(){}]', matchend(line, '^\s*[)}]'))
+ while bracepos != -1
+ let synid = synIDattr(synID(lnum, bracepos + 1, 0), "name")
+ " If the brace is highlighted in one of those groups, indent it.
+ " 'perlHereDoc' is here only to handle the case '&foo(<<EOF)'.
+ if synid == ""
+ \ || synid == "perlMatchStartEnd"
+ \ || synid == "perlHereDoc"
+ \ || synid =~ "^perlFiledescStatement"
+ \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold'
+ let brace = strpart(line, bracepos, 1)
+ if brace == '(' || brace == '{'
+ let ind = ind + &sw
+ else
+ let ind = ind - &sw
+ endif
+ endif
+ let bracepos = match(line, '[(){}]', bracepos + 1)
+ endwhile
+ let bracepos = matchend(cline, '^\s*[)}]')
+ if bracepos != -1
+ let synid = synIDattr(synID(v:lnum, bracepos, 0), "name")
+ if synid == ""
+ \ || synid == "perlMatchStartEnd"
+ \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold'
+ let ind = ind - &sw
+ endif
+ endif
+ else
+ if line =~ '[{(]\s*\(#[^)}]*\)\=$'
+ let ind = ind + &sw
+ endif
+ if cline =~ '^\s*[)}]'
+ let ind = ind - &sw
+ endif
+ endif
+
+ " Indent lines that begin with 'or' or 'and'
+ if cline =~ '^\s*\(or\|and\)\>'
+ if line !~ '^\s*\(or\|and\)\>'
+ let ind = ind + &sw
+ endif
+ elseif line =~ '^\s*\(or\|and\)\>'
+ let ind = ind - &sw
+ endif
+
+ return ind
+
+endfunction
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:ts=8:sts=2:sw=2
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
new file mode 100644
index 000000000..208df3ab0
--- /dev/null
+++ b/runtime/indent/php.vim
@@ -0,0 +1,118 @@
+" Vim indent file
+" Language: PHP
+" Author: Miles Lott <milos@groupwhere.org>
+" URL: http://milosch.dyndns.org/php.vim
+" Last Change: 2004 May 18
+" Version: 0.5
+" Notes: Close all switches with default:\nbreak; and it will look better.
+" Also, open and close brackets should be alone on a line.
+" This is my preference, and the only way this will look nice.
+" Try an older version if you care less about the formatting of
+" switch/case. It is nearly perfect for anyone regardless of your
+" stance on brackets.
+"
+" Changes: 0.5 - fix duplicate indent on open tag, and empty bracketed
+" statements.
+" 0.4 - Fixes for closing php tag, switch statement closure, and php_indent_shortopentags
+" option from Steffen Bruentjen <vim@kontraphon.de>
+"
+" Options: php_noindent_switch=1 -- do not try to indent switch/case statements (version 0.1 behavior)
+" php_indent_shortopentags=1 -- indent after short php open tags, too
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetPhpIndent()
+"setlocal indentkeys+=0=,0),=EO
+setlocal indentkeys+=0=,0),=EO,=>
+
+" Only define the function once.
+if exists("*GetPhpIndent")
+ finish
+endif
+
+" Handle option(s)
+if exists("php_noindent_switch")
+ let b:php_noindent_switch=1
+endif
+
+function GetPhpIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+ let line = getline(lnum) " last line
+ let cline = getline(v:lnum) " current line
+ let pline = getline(lnum - 1) " previous to last line
+ let ind = indent(lnum)
+
+ " Indent after php open tag
+ if line =~ '<?php'
+ let ind = ind + &sw
+ elseif exists('g:php_indent_shortopentags')
+ " indent after short open tag
+ if line =~ '<?'
+ let ind = ind + &sw
+ endif
+ endif
+ " indent after php closing tag
+ if cline =~ '\M?>'
+ let ind = ind - &sw
+ endif
+
+ if exists("b:php_noindent_switch") " version 1 behavior, diy switch/case,etc
+ " Indent blocks enclosed by {} or ()
+ if line =~ '[{(]\s*\(#[^)}]*\)\=$'
+ let ind = ind + &sw
+ endif
+ if cline =~ '^\s*[)}]'
+ let ind = ind - &sw
+ endif
+ return ind
+ else
+ " Search the matching bracket (with searchpair()) and set the indent of
+ " to the indent of the matching line.
+ if cline =~ '^\s*}'
+ call cursor(line('.'), 1)
+ let ind = indent(searchpair('{', '', '}',
+ 'bW', 'synIDattr(synID(line("."), col("."),
+ 0), "name") =~? "string"'))
+ return ind
+ endif
+ " Try to indent switch/case statements as well
+ " Indent blocks enclosed by {} or () or case statements, with some anal requirements
+ if line =~ 'case.*:\|[{(]\s*\(#[^)}]*\)\=$'
+ let ind = ind + &sw
+ " return if the current line is not another case statement of the previous line is a bracket open
+ if cline !~ '.*case.*:\|default:' || line =~ '[{(]\s*\(#[^)}]*\)\=$'
+ return ind
+ endif
+ endif
+ if cline =~ '^\s*case.*:\|^\s*default:\|^\s*[)}]'
+ let ind = ind - &sw
+ " if the last line is a break or return, or the current line is a close bracket,
+ " or if the previous line is a default statement, subtract another
+ if line =~ '^\s*break;\|^\s*return\|' && cline =~ '^\s*[)}]' && pline =~ 'default:'
+ let ind = ind - &sw
+ endif
+ endif
+ " Search the matching bracket (with searchpair()) and set the indent of cline
+ " to the indent of the matching line.
+ if cline =~ '^\s*}'
+ call cursor(line('. '), 1)
+ let ind = indent(searchpair('{', '', '}', 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
+ return ind
+ endif
+
+ if line =~ 'default:'
+ let ind = ind + &sw
+ endif
+ return ind
+ endif
+endfunction
+" vim: set ts=4 sw=4:
diff --git a/runtime/indent/postscr.vim b/runtime/indent/postscr.vim
new file mode 100644
index 000000000..b0ff48e68
--- /dev/null
+++ b/runtime/indent/postscr.vim
@@ -0,0 +1,68 @@
+" PostScript indent file
+" Language: PostScript
+" Maintainer: Mike Williams <mrw@netcomuk.co.uk>
+" Last Change: 2nd July 2001
+"
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=PostscrIndentGet(v:lnum)
+setlocal indentkeys+=0],0=>>,0=%%,0=end,0=restore,0=grestore indentkeys-=:,0#,e
+
+" Catch multiple instantiations
+if exists("*PostscrIndentGet")
+ finish
+endif
+
+function! PostscrIndentGet(lnum)
+ " Find a non-empty non-comment line above the current line.
+ " Note: ignores DSC comments as well!
+ let lnum = a:lnum - 1
+ while lnum != 0
+ let lnum = prevnonblank(lnum)
+ if getline(lnum) !~ '^\s*%.*$'
+ break
+ endif
+ let lnum = lnum - 1
+ endwhile
+
+ " Hit the start of the file, use user indent.
+ if lnum == 0
+ return -1
+ endif
+
+ " Start with the indent of the previous line
+ let ind = indent(lnum)
+ let pline = getline(lnum)
+
+ " Indent for dicts, arrays, and saves with possible trailing comment
+ if pline =~ '\(begin\|<<\|g\=save\|{\|[\)\s*\(%.*\)\=$'
+ let ind = ind + &sw
+ endif
+
+ " Remove indent for popped dicts, and restores.
+ if pline =~ '\(end\|g\=restore\)\s*$'
+ let ind = ind - &sw
+
+ " Else handle immediate dedents of dicts, restores, and arrays.
+ elseif getline(a:lnum) =~ '\(end\|>>\|g\=restore\|}\|]\)'
+ let ind = ind - &sw
+
+ " Else handle DSC comments - always start of line.
+ elseif getline(a:lnum) =~ '^\s*%%'
+ let ind = 0
+ endif
+
+ " For now catch excessive left indents if they occur.
+ if ind < 0
+ let ind = -1
+ endif
+
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/pov.vim b/runtime/indent/pov.vim
new file mode 100644
index 000000000..2b197635a
--- /dev/null
+++ b/runtime/indent/pov.vim
@@ -0,0 +1,84 @@
+" Vim indent file
+" Language: PoV-Ray Scene Description Language
+" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-10-20
+" URI: http://trific.ath.cx/Ftp/vim/indent/pov.vim
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Some preliminary settings.
+setlocal nolisp " Make sure lisp indenting doesn't supersede us.
+
+setlocal indentexpr=GetPoVRayIndent()
+setlocal indentkeys+==else,=end,0]
+
+" Only define the function once.
+if exists("*GetPoVRayIndent")
+ finish
+endif
+
+" Counts matches of a regexp <rexp> in line number <line>.
+" Doesn't count matches inside strings and comments (as defined by current
+" syntax).
+function! s:MatchCount(line, rexp)
+ let str = getline(a:line)
+ let i = 0
+ let n = 0
+ while i >= 0
+ let i = matchend(str, a:rexp, i)
+ if i >= 0 && synIDattr(synID(a:line, i, 0), "name") !~? "string\|comment"
+ let n = n + 1
+ endif
+ endwhile
+ return n
+endfunction
+
+" The main function. Returns indent amount.
+function GetPoVRayIndent()
+ " If we are inside a comment (may be nested in obscure ways), give up
+ if synIDattr(synID(v:lnum, indent(v:lnum)+1, 0), "name") =~? "string\|comment"
+ return -1
+ endif
+
+ " Search backwards for the frist non-empty, non-comment line.
+ let plnum = prevnonblank(v:lnum - 1)
+ let plind = indent(plnum)
+ while plnum > 0 && synIDattr(synID(plnum, plind+1, 0), "name") =~? "comment"
+ let plnum = prevnonblank(plnum - 1)
+ let plind = indent(plnum)
+ endwhile
+
+ " Start indenting from zero
+ if plnum == 0
+ return 0
+ endif
+
+ " Analyse previous nonempty line.
+ let chg = 0
+ let chg = chg + s:MatchCount(plnum, '[[{(]')
+ let chg = chg + s:MatchCount(plnum, '#\s*\%(if\|ifdef\|ifndef\|switch\|while\|macro\|else\)\>')
+ let chg = chg - s:MatchCount(plnum, '#\s*end\>')
+ let chg = chg - s:MatchCount(plnum, '[]})]')
+ " Dirty hack for people writing #if and #else on the same line.
+ let chg = chg - s:MatchCount(plnum, '#\s*\%(if\|ifdef\|ifndef\|switch\)\>.*#\s*else\>')
+ " When chg > 0, then we opened groups and we should indent more, but when
+ " chg < 0, we closed groups and this already affected the previous line,
+ " so we should not dedent. And when everything else fails, scream.
+ let chg = chg > 0 ? chg : 0
+
+ " Analyse current line
+ " FIXME: If we have to dedent, we should try to find the indentation of the
+ " opening line.
+ let cur = s:MatchCount(v:lnum, '^\s*\%(#\s*\%(end\|else\)\>\|[]})]\)')
+ if cur > 0
+ let final = plind + (chg - cur) * &sw
+ else
+ let final = plind + chg * &sw
+ endif
+
+ return final < 0 ? 0 : final
+endfunction
diff --git a/runtime/indent/prolog.vim b/runtime/indent/prolog.vim
new file mode 100644
index 000000000..afe448e8f
--- /dev/null
+++ b/runtime/indent/prolog.vim
@@ -0,0 +1,58 @@
+" vim: set sw=4 sts=4:
+" Maintainer : Gergely Kontra <kgergely@mcl.hu>
+" Revised on : 2002.02.18. 23:34:05
+" Language : Prolog
+
+" TODO:
+" checking with respect to syntax highlighting
+" ignoring multiline comments
+" detecting multiline strings
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetPrologIndent()
+setlocal indentkeys-=:,0#
+setlocal indentkeys+=0%,-,0;,>,0)
+
+" Only define the function once.
+"if exists("*GetPrologIndent")
+" finish
+"endif
+
+function! GetPrologIndent()
+ " Find a non-blank line above the current line.
+ let pnum = prevnonblank(v:lnum - 1)
+ " Hit the start of the file, use zero indent.
+ if pnum == 0
+ return 0
+ endif
+ let line = getline(v:lnum)
+ let pline = getline(pnum)
+
+ let ind = indent(pnum)
+ " Previous line was comment -> use previous line's indent
+ if pline =~ '^\s*%'
+ retu ind
+ endif
+ " Check for clause head on previous line
+ if pline =~ ':-\s*\(%.*\)\?$'
+ let ind = ind + &sw
+ " Check for end of clause on previous line
+ elseif pline =~ '\.\s*\(%.*\)\?$'
+ let ind = ind - &sw
+ endif
+ " Check for opening conditional on previous line
+ if pline =~ '^\s*\([(;]\|->\)'
+ let ind = ind + &sw
+ endif
+ " Check for closing an unclosed paren, or middle ; or ->
+ if line =~ '^\s*\([);]\|->\)'
+ let ind = ind - &sw
+ endif
+ return ind
+endfunction
diff --git a/runtime/indent/pyrex.vim b/runtime/indent/pyrex.vim
new file mode 100644
index 000000000..e7771264e
--- /dev/null
+++ b/runtime/indent/pyrex.vim
@@ -0,0 +1,8 @@
+" Vim indent file
+" Language: Pyrex
+" Maintainer: Marco Barisione <marco.bari@people.it>
+" URL: http://marcobari.altervista.org/pyrex_vim.html
+" Last Change: 2004 May 16
+
+" Use Python formatting rules
+runtime! indent/python.vim
diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim
new file mode 100644
index 000000000..3dbbe10a6
--- /dev/null
+++ b/runtime/indent/python.vim
@@ -0,0 +1,175 @@
+" Vim indent file
+" Language: Python
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Original Author: David Bustos <bustos@caltech.edu>
+" Last Change: 2003 Sep 08
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Some preliminary settings
+setlocal nolisp " Make sure lisp indenting doesn't supersede us
+setlocal autoindent " indentexpr isn't much help otherwise
+
+setlocal indentexpr=GetPythonIndent(v:lnum)
+setlocal indentkeys+=<:>,=elif,=except
+
+" Only define the function once.
+if exists("*GetPythonIndent")
+ finish
+endif
+
+let s:maxoff = 50 " maximum number of lines to look backwards for ()
+
+function GetPythonIndent(lnum)
+ " If this line is explicitly joined: If the previous line was also joined,
+ " line it up with that one, otherwise add two 'shiftwidth'
+ if getline(a:lnum - 1) =~ '\\$'
+ if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$'
+ return indent(a:lnum - 1)
+ endif
+ return indent(a:lnum - 1) + (&sw * 2)
+ endif
+
+ " If the start of the line is in a string don't change the indent.
+ if has('syntax_items')
+ \ && synIDattr(synID(a:lnum, 1, 1), "name") == "pythonString"
+ return -1
+ endif
+
+ " Search backwards for the previous non-empty line.
+ let plnum = prevnonblank(v:lnum - 1)
+
+ if plnum == 0
+ " This is the first non-empty line, use zero indent.
+ return 0
+ endif
+
+ " If the previous line is inside parenthesis, use the indent of the starting
+ " line.
+ " Trick: use the non-existing "dummy" variable to break out of the loop when
+ " going too far back.
+ call cursor(plnum, 1)
+ let parlnum = searchpair('(', '', ')', 'nbW',
+ \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ 'python\\(Comment\\|String\\)'")
+ if parlnum > 0
+ let plindent = indent(parlnum)
+ let plnumstart = parlnum
+ else
+ let plindent = indent(plnum)
+ let plnumstart = plnum
+ endif
+
+
+ " When inside parenthesis: If at the first line below the parenthesis add
+ " two 'shiftwidth', otherwise same as previous line.
+ " i = (a
+ " + b
+ " + c)
+ call cursor(a:lnum, 1)
+ let p = searchpair('(', '', ')', 'bW',
+ \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ 'python\\(Comment\\|String\\)'")
+ if p > 0
+ if p == plnum
+ " When the start is inside parenthesis, only indent one 'shiftwidth'.
+ let pp = searchpair('(', '', ')', 'bW',
+ \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
+ \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
+ \ . " =~ 'python\\(Comment\\|String\\)'")
+ if pp > 0
+ return indent(plnum) + &sw
+ endif
+ return indent(plnum) + (&sw * 2)
+ endif
+ if plnumstart == p
+ return indent(plnum)
+ endif
+ return plindent
+ endif
+
+
+ " Get the line and remove a trailing comment.
+ " Use syntax highlighting attributes when possible.
+ let pline = getline(plnum)
+ let pline_len = strlen(pline)
+ let col = 0
+ while col < pline_len
+ if pline[col] == '#' && (!has('syntax_items')
+ \ || synIDattr(synID(plnum, col + 1, 1), "name") == "pythonComment")
+ let pline = strpart(pline, 0, col)
+ break
+ endif
+ let col = col + 1
+ endwhile
+
+ " If the previous line ended with a colon, indent this line
+ if pline =~ ':\s*$'
+ return plindent + &sw
+ endif
+
+ " If the previous line was a stop-execution statement...
+ if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\)\>'
+ " See if the user has already dedented
+ if indent(a:lnum) > indent(plnum) - &sw
+ " If not, recommend one dedent
+ return indent(plnum) - &sw
+ endif
+ " Otherwise, trust the user
+ return -1
+ endif
+
+ " If the current line begins with a keyword that lines up with "try"
+ if getline(a:lnum) =~ '^\s*\(except\|finally\)\>'
+ let lnum = a:lnum - 1
+ while lnum >= 1
+ echomsg 'got here'
+ if getline(lnum) =~ '^\s*\(try\|except\)\>'
+ let ind = indent(lnum)
+ echomsg 'got here, indent is ' . ind
+ if ind >= indent(a:lnum)
+ return -1 " indent is already less than this
+ endif
+ return ind " line up with previous try or except
+ endif
+ let lnum = lnum - 1
+ endwhile
+ echomsg 'got to the end'
+ return -1 " no matching "try"!
+ endif
+
+ " If the current line begins with a header keyword, dedent
+ if getline(a:lnum) =~ '^\s*\(elif\|else\)\>'
+
+ " Unless the previous line was a one-liner
+ if getline(plnumstart) =~ '^\s*\(for\|if\|try\)\>'
+ return plindent
+ endif
+
+ " Or the user has already dedented
+ if indent(a:lnum) <= plindent - &sw
+ return -1
+ endif
+
+ return plindent - &sw
+ endif
+
+ " When after a () construct we probably want to go back to the start line.
+ " a = (b
+ " + c)
+ " here
+ if parlnum > 0
+ return plindent
+ endif
+
+ return -1
+
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/readline.vim b/runtime/indent/readline.vim
new file mode 100644
index 000000000..b2640f1f2
--- /dev/null
+++ b/runtime/indent/readline.vim
@@ -0,0 +1,48 @@
+" Vim indent file
+" Language: readline configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/readline/
+" Latest Revision: 2004-04-25
+" arch-tag: ee681235-3abf-4a42-8587-edabd409a980
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetReadlineIndent()
+setlocal indentkeys=!^F,o,O,=$else,=$endif
+
+" Only define the function once.
+if exists("*GetReadlineIndent")
+ finish
+endif
+
+function GetReadlineIndent()
+ let lnum = prevnonblank(v:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ let line = getline(lnum)
+ let ind = indent(lnum)
+
+ " increase indent if previous line started with $if or $else
+ if line =~ '^\s*$\(if\|else\)\>'
+ let ind = ind + &sw
+ endif
+
+ let line = getline(v:lnum)
+
+ " decrease indent if this line starts with $else or $endif
+ if line =~ '^\s*$\(else\|endif\)\>'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/rpl.vim b/runtime/indent/rpl.vim
new file mode 100644
index 000000000..341f5f950
--- /dev/null
+++ b/runtime/indent/rpl.vim
@@ -0,0 +1,60 @@
+" Vim indent file
+" Language: RPL/2
+" Version: 0.2
+" Last Change: 2002 August 16
+" Maintainer: BERTRAND Joël <rpl2@free.fr>
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentkeys+==~end,=~case,=~if,=~then,=~else,=~do,=~until,=~while,=~repeat,=~select,=~default,=~for,=~start,=~next,=~step,<<>,<>>
+
+" Define the appropriate indent function but only once
+setlocal indentexpr=RplGetFreeIndent()
+if exists("*RplGetFreeIndent")
+ finish
+endif
+
+function RplGetIndent(lnum)
+ let ind = indent(a:lnum)
+ let prevline=getline(a:lnum)
+ " Strip tail comment
+ let prevstat=substitute(prevline, '!.*$', '', '')
+
+ " Add a shiftwidth to statements following if, iferr, then, else, elseif,
+ " case, select, default, do, until, while, repeat, for, start
+ if prevstat =~? '\<\(if\|iferr\|do\|while\)\>' && prevstat =~? '\<end\>'
+ elseif prevstat =~? '\(^\|\s\+\)<<\($\|\s\+\)' && prevstat =~? '\s\+>>\($\|\s\+\)'
+ elseif prevstat =~? '\<\(if\|iferr\|then\|else\|elseif\|select\|case\|do\|until\|while\|repeat\|for\|start\|default\)\>' || prevstat =~? '\(^\|\s\+\)<<\($\|\s\+\)'
+ let ind = ind + &sw
+ endif
+
+ " Subtract a shiftwidth from then, else, elseif, end, until, repeat, next,
+ " step
+ let line = getline(v:lnum)
+ if line =~? '^\s*\(then\|else\|elseif\|until\|repeat\|next\|step\|default\|end\)\>'
+ let ind = ind - &sw
+ elseif line =~? '^\s*>>\($\|\s\+\)'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+function RplGetFreeIndent()
+ " Find the previous non-blank line
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Use zero indent at the top of the file
+ if lnum == 0
+ return 0
+ endif
+
+ let ind=RplGetIndent(lnum)
+ return ind
+endfunction
+
+" vim:sw=2 tw=130
diff --git a/runtime/indent/rst.vim b/runtime/indent/rst.vim
new file mode 100644
index 000000000..c6269ec6a
--- /dev/null
+++ b/runtime/indent/rst.vim
@@ -0,0 +1,60 @@
+" Vim indent file
+" Language: reStructuredText Documentation Format
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/rst/
+" Latest Revision: 2004-04-25
+" arch-tag: 3fe10f75-24d0-4d94-a924-0ce945958104
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetRSTIndent()
+setlocal indentkeys-=:,0# indentkeys-=e
+
+" Only define the function once.
+if exists("*GetRSTIndent")
+ finish
+endif
+
+function GetRSTIndent()
+ let lnum = prevnonblank(v:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+ let line = getline(lnum)
+
+ if line =~ '^\s*[-*+]\s'
+ let ind = ind + 2
+ elseif line =~ '^\s*\d\+.\s'
+ let ind = ind + matchend(substitute(line, '^\s*', '', ''), '\d\+.\s\+')
+ endif
+
+ let line = getline(v:lnum - 1)
+
+ if line =~ '^\s*$'
+ execute lnum
+ call search('^\s*\%([-*+]\s\|\d\+.\s\|\.\.\|$\)', 'bW')
+ let line = getline('.')
+ if line =~ '^\s*[-*+]'
+ let ind = ind - 2
+ elseif line =~ '^\s*\d\+\.\s'
+ let ind = ind - matchend(substitute(line, '^\s*', '', ''),
+ \ '\d\+\.\s\+')
+ elseif line =~ '^\s*\.\.'
+ let ind = ind - 3
+ else
+ let ind = ind
+ endif
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim
new file mode 100644
index 000000000..ce078f2a0
--- /dev/null
+++ b/runtime/indent/ruby.vim
@@ -0,0 +1,67 @@
+" Vim indent file
+" Language: Ruby
+" Maintainer: Gavin Sinclair <gsinclair@soyabean.com.au>
+" Last Change: 2003 May 11
+" URL: www.soyabean.com.au/gavin/vim/index.html
+" Changes: (since vim 6.1)
+" - indentation after a line ending in comma, etc, (even in a comment) was
+" broken, now fixed (2002/08/14)
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetRubyIndent()
+setlocal nolisp
+setlocal nosmartindent
+setlocal autoindent
+setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue
+
+" Only define the function once.
+if exists("*GetRubyIndent")
+ finish
+endif
+
+function GetRubyIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " If the line trailed with [*+,.(] - but not in a comment - trust the user
+ if getline(lnum) =~ '\(\[^#\].*\)?\(\*\|\.\|+\|,\|(\)\(\s*#.*\)\=$'
+ return -1
+ endif
+
+ " Add a 'shiftwidth' after lines beginning with:
+ " module, class, dev, if, for, while, until, else, elsif, case, when, {
+ let ind = indent(lnum)
+ let flag = 0
+ if getline(lnum) =~ '^\s*\(module\>\|class\>\|def\>\|if\>\|for\>\|while\>\|until\>\|else\>\|elsif\>\|case\>\|when\>\|unless\|begin\|ensure\>\|rescue\>\)'
+ \ || getline(lnum) =~ '{\s*$'
+ \ || getline(lnum) =~ '\({\|\<do\>\).*|.*|\s*$'
+ \ || getline(lnum) =~ '\<do\>\(\s*#.*\)\=$'
+ let ind = ind + &sw
+ let flag = 1
+ endif
+
+ " Subtract a 'shiftwidth' after lines ending with
+ " "end" when they begin with while, if, for, until
+ if flag == 1 && getline(lnum) =~ '\<end\>\(\s*#.*\)\=$'
+ let ind = ind - &sw
+ endif
+
+ " Subtract a 'shiftwidth' on end, else and, elsif, when and }
+ if getline(v:lnum) =~ '^\s*\(end\>\|else\>\|elsif\>\|when\>\|ensure\>\|rescue\>\|}\)'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/sdl.vim b/runtime/indent/sdl.vim
new file mode 100644
index 000000000..9dde2c3f5
--- /dev/null
+++ b/runtime/indent/sdl.vim
@@ -0,0 +1,89 @@
+" Vim indent file
+" Language: SDL
+" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
+" Last Change: 2001 Sep 17
+
+" Shamelessly stolen from the Vim-Script indent file
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetSDLIndent()
+setlocal indentkeys+==~end,=~state,*<Return>
+
+" Only define the function once.
+if exists("*GetSDLIndent")
+" finish
+endif
+
+set cpo-=C
+
+function! GetSDLIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+ let virtuality = '^\s*\(\(virtual\|redefined\|finalized\)\s\+\)\=\s*'
+
+ " Add a single space to comments which use asterisks
+ if getline(lnum) =~ '^\s*\*'
+ let ind = ind - 1
+ endif
+ if getline(v:lnum) =~ '^\s*\*'
+ let ind = ind + 1
+ endif
+
+ " Add a 'shiftwidth' after states, different blocks, decision (and alternatives), inputs
+ if (getline(lnum) =~? '^\s*\(start\|state\|system\|package\|connection\|channel\|alternative\|macro\|operator\|newtype\|select\|substructure\|decision\|generator\|refinement\|service\|method\|exceptionhandler\|asntype\|syntype\|value\|(.*):\|\(priority\s\+\)\=input\|provided\)'
+ \ || getline(lnum) =~? virtuality . '\(process\|procedure\|block\|object\)')
+ \ && getline(lnum) !~? 'end[[:alpha:]]\+;$'
+ let ind = ind + &sw
+ endif
+
+ " Subtract a 'shiftwidth' after states
+ if getline(lnum) =~? '^\s*\(stop\|return\>\|nextstate\)'
+ let ind = ind - &sw
+ endif
+
+ " Subtract a 'shiftwidth' on on end (uncompleted line)
+ if getline(v:lnum) =~? '^\s*end\>'
+ let ind = ind - &sw
+ endif
+
+ " Put each alternatives where the corresponding decision was
+ if getline(v:lnum) =~? '^\s*\((.*)\|else\):'
+ normal k
+ let ind = indent(searchpair('^\s*decision', '', '^\s*enddecision', 'bW',
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "sdlString"'))
+ endif
+
+ " Put each state where the preceding state was
+ if getline(v:lnum) =~? '^\s*state\>'
+ let ind = indent(search('^\s*start', 'bW'))
+ endif
+
+ " Systems and packages are always in column 0
+ if getline(v:lnum) =~? '^\s*\(\(end\)\=system\|\(end\)\=package\)'
+ return 0;
+ endif
+
+ " Put each end* where the corresponding begin was
+ if getline(v:lnum) =~? '^\s*end[[:alpha:]]'
+ normal k
+ let partner=matchstr(getline(v:lnum), '\(' . virtuality . 'end\)\@<=[[:alpha:]]\+')
+ let ind = indent(searchpair(virtuality . partner, '', '^\s*end' . partner, 'bW',
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "sdlString"'))
+ endif
+
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
new file mode 100644
index 000000000..880ad12ce
--- /dev/null
+++ b/runtime/indent/sh.vim
@@ -0,0 +1,58 @@
+" Vim indent file
+" Language: Shell Script
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/sh/
+" Latest Revision: 2004-04-25
+" arch-tag: 431c7fc1-12a6-4d71-9636-1498ef56b038
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetShIndent()
+setlocal indentkeys+==then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done
+setlocal indentkeys-=:,0#
+
+" Only define the function once.
+if exists("*GetShIndent")
+ finish
+endif
+
+set cpoptions-=C
+
+function GetShIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " Add a 'shiftwidth' after if, while, else, case, until, for, function()
+ " Skip if the line also contains the closure for the above
+ let ind = indent(lnum)
+ let line = getline(lnum)
+ if line =~ '^\s*\(if\|then\|do\|else\|elif\|case\|while\|until\|for\)\>'
+ \ || line =~ '^\s*\<\h\w*\>\s*()\s*{'
+ \ || line =~ '^\s*{'
+ if line !~ '\(esac\|fi\|done\)\>\s*$' && line !~ '}\s*$'
+ let ind = ind + &sw
+ endif
+ endif
+
+ " Subtract a 'shiftwidth' on a then, do, else, esac, fi, done
+ " Retain the indentation level if line matches fin (for find)
+ let line = getline(v:lnum)
+ if (line =~ '^\s*\(then\|do\|else\|elif\|esac\|fi\|done\)\>' || line =~ '^\s*}')
+ \ && line !~ '^\s*fi[ln]\>'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/tcl.vim b/runtime/indent/tcl.vim
new file mode 100644
index 000000000..326575e8f
--- /dev/null
+++ b/runtime/indent/tcl.vim
@@ -0,0 +1,123 @@
+" Vim indent file
+" Language: Tcl
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/tcl/
+" Latest Revision: 2004-05-21
+" arch-tag: 64fab1fa-d670-40ab-a191-55678f20ceb0
+
+" only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetTclIndent()
+setlocal indentkeys-=:,0#
+setlocal indentkeys+=0]
+
+" only define the function once.
+if exists("*GetTclIndent")
+ finish
+endif
+
+function s:PrevNonBlankNonComment(lnum)
+ let lnum = prevnonblank(a:lnum)
+ while lnum > 0
+ let line = getline(lnum)
+ if line !~ '^\s*\(#\|$\)'
+ break
+ endif
+ let lnum = prevnonblank(lnum - 1)
+ endwhile
+ return lnum
+endfunction
+
+function! GetTclIndent()
+ let lnum = s:PrevNonBlankNonComment(v:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ let line = getline(lnum)
+ let ind = indent(lnum)
+
+ " TODO: Possible improvement, check that 'begin' and 'end' aren't inside a
+ " comment or string. This will mess it up. As I am pressed for time and
+ " stuff like this is unlikely to happen I won't deal with it in this
+ " version.
+ let open = 0
+ let begin = match(line, '{', 0)
+ while begin > -1
+ let end = match(line, '}', begin + 1)
+ if end < 0
+ let open = open + 1
+ else
+ let tmp = match(line, '{', begin + 1)
+ if tmp != -1 && tmp < end
+ let open = open + 1
+ endif
+ endif
+ let begin = match(line, '{', begin + 1)
+ endwhile
+
+ let begin = match(line, '[', 0)
+ while begin > -1
+ let end = match(line, ']', begin + 1)
+ if end < 0
+ let open = open + 1
+ else
+ let tmp = match(line, '{', begin + 1)
+ if tmp != -1 && tmp < end
+ let open = open + 1
+ endif
+ endif
+ let begin = match(line, '{', begin + 1)
+ endwhile
+
+ let close = 0
+ let prev = 0
+ let end = matchend(line, '^\s*}.*}', prev)
+ while end > -1
+ let begin = match(line, '{', prev + 1)
+ if begin < 0 || begin > prev
+ let close = close + 1
+ endif
+ let prev = end
+ let end = match(line, '}', prev + 1)
+ endwhile
+
+ let prev = 0
+ let end = match(line, ']', prev)
+ while end > -1
+ let begin = match(line, '[', prev + 1)
+ if begin < 0 || begin > prev
+ let close = close + 1
+ endif
+ let prev = end
+ let end = match(line, ']', prev + 1)
+ endwhile
+
+ let ind = ind + (open - close) * &sw
+
+ let line = getline(v:lnum)
+
+ let close = 0
+ let prev = 0
+ let end = match(line, '}', prev)
+ while end > -1
+ let begin = match(line, '{', prev + 1)
+ if begin < 0 || begin > prev
+ let close = close + 1
+ endif
+ let prev = end
+ let end = match(line, '}', prev + 1)
+ endwhile
+
+ let ind = ind - close * &sw
+
+ return ind >= 0 ? ind : 0
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/tcsh.vim b/runtime/indent/tcsh.vim
new file mode 100644
index 000000000..89403c9c9
--- /dev/null
+++ b/runtime/indent/tcsh.vim
@@ -0,0 +1,51 @@
+" Vim indent file
+" Language: C-shell (tcsh)
+" Maintainor: Gautam Iyer <gautam@math.uchicago.edu>
+" Last Modified: Wed 04 Feb 2004 04:36:07 PM CST
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=TcshGetIndent()
+setlocal indentkeys+=e,0=end,0=endsw,*<return> indentkeys-=0{,0},0),:,0#
+
+" Only define the function once.
+if exists("*TcshGetIndent")
+ finish
+endif
+
+set cpoptions-=C
+
+function TcshGetIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " Add indent if previous line begins with while or foreach
+ " OR line ends with case <str>:, default:, else, then or \
+ let ind = indent(lnum)
+ let line = getline(lnum)
+ if line =~ '\v^\s*%(while|foreach)>|^\s*%(case\s.*:|default:|else)\s*$|%(<then|\\)$'
+ let ind = ind + &sw
+ endif
+
+ if line =~ '\v^\s*breaksw>'
+ let ind = ind - &sw
+ endif
+
+ " Subtract indent if current line has on end, endif, case commands
+ let line = getline(v:lnum)
+ if line =~ '\v^\s*%(else|end|endif)\s*$'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
diff --git a/runtime/indent/tilde.vim b/runtime/indent/tilde.vim
new file mode 100644
index 000000000..5fdcfe071
--- /dev/null
+++ b/runtime/indent/tilde.vim
@@ -0,0 +1,36 @@
+"Description: Indent scheme for the tilde weblanguage
+"Author: Tobias Rundström <tobi@tobi.nu>
+"URL: http://tilde.tildesoftware.net
+"Last Change: May 8 09:15:09 CEST 2002
+
+if exists ("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal autoindent
+setlocal indentexpr=GetTildeIndent(v:lnum)
+setlocal indentkeys=o,O,)
+
+if exists("*GetTildeIndent")
+ finish
+endif
+
+function GetTildeIndent(lnum)
+ let plnum = prevnonblank(v:lnum-1)
+
+ if plnum == 0
+ return 0
+ endif
+
+ if getline(v:lnum) =~ '^\s*\~\(endif\|else\|elseif\|end\)\>'
+ return indent(v:lnum) - &sw
+ endif
+
+ if getline(plnum) =~ '^\s*\~\(if\|foreach\|foreach_row\|xml_loop\|file_loop\|file_write\|file_append\|imap_loopsections\|imap_index\|imap_list\|ldap_search\|post_loopall\|post_loop\|file_loop\|sql_loop_num\|sql_dbmsselect\|search\|sql_loop\|post\|for\|function_define\|silent\|while\|setvalbig\|mail_create\|systempipe\|mail_send\|dual\|elseif\|else\)\>'
+ return indent(plnum) + &sw
+ else
+ return -1
+ endif
+endfunction
diff --git a/runtime/indent/vb.vim b/runtime/indent/vb.vim
new file mode 100644
index 000000000..515e4dc6b
--- /dev/null
+++ b/runtime/indent/vb.vim
@@ -0,0 +1,72 @@
+" Vim indent file
+" Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb)
+" Author: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=VbGetIndent(v:lnum)
+setlocal indentkeys&
+setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,~=loop,<:>
+
+" Only define the function once.
+if exists("*VbGetIndent")
+ finish
+endif
+
+fun! VbGetIndent(lnum)
+ " labels and preprocessor get zero indent immediately
+ let this_line = getline(a:lnum)
+ let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)'
+ if this_line =~? LABELS_OR_PREPROC
+ return 0
+ endif
+
+ " Find a non-blank line above the current line.
+ " Skip over labels and preprocessor directives.
+ let lnum = a:lnum
+ while lnum > 0
+ let lnum = prevnonblank(lnum - 1)
+ let previous_line = getline(lnum)
+ if previous_line !~? LABELS_OR_PREPROC
+ break
+ endif
+ endwhile
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+
+ " Add
+ if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\>.\{-}\<then\>\s*$\|else\|elseif\|do\|for\|while\|enum\|with\)\>'
+ let ind = ind + &sw
+ endif
+
+ " Subtract
+ if this_line =~? '^\s*\<end\>\s\+\<select\>'
+ if previous_line !~? '^\s*\<select\>'
+ let ind = ind - 2 * &sw
+ else
+ " this case is for an empty 'select' -- 'end select'
+ " (w/o any case statements) like:
+ "
+ " select case readwrite
+ " end select
+ let ind = ind - &sw
+ endif
+ elseif this_line =~? '^\s*\<\(end\|else\|until\|loop\|next\|wend\)\>'
+ let ind = ind - &sw
+ elseif this_line =~? '^\s*\<\(case\|default\)\>'
+ if previous_line !~? '^\s*\<select\>'
+ let ind = ind - &sw
+ endif
+ endif
+
+ return ind
+endfun
diff --git a/runtime/indent/verilog.vim b/runtime/indent/verilog.vim
new file mode 100644
index 000000000..74c8c5f6d
--- /dev/null
+++ b/runtime/indent/verilog.vim
@@ -0,0 +1,219 @@
+" Language: Verilog HDL
+" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
+" Last Change: Wed Oct 31 16:13:11 CST 2001
+" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/indent/verilog.vim
+"
+" Credits:
+" Suggestions for improvement, bug reports by
+" Leo Butlero <lbutler@brocade.com>
+"
+" Buffer Variables:
+" b:verilog_indent_modules : indenting after the declaration
+" of module blocks
+" b:verilog_indent_width : indenting width
+" b:verilog_indent_verbose : verbose to each indenting
+"
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetVerilogIndent()
+setlocal indentkeys=!^F,o,O,0),=begin,=end,=join,=endcase
+setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify
+setlocal indentkeys+==`else,=`endif
+
+" Only define the function once.
+if exists("*GetVerilogIndent")
+ finish
+endif
+
+set cpo-=C
+
+function GetVerilogIndent()
+
+ if exists('b:verilog_indent_width')
+ let offset = b:verilog_indent_width
+ else
+ let offset = &sw
+ endif
+ if exists('b:verilog_indent_modules')
+ let indent_modules = offset
+ else
+ let indent_modules = 0
+ endif
+
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let lnum2 = prevnonblank(lnum - 1)
+ let curr_line = getline(v:lnum)
+ let last_line = getline(lnum)
+ let last_line2 = getline(lnum2)
+ let ind = indent(lnum)
+ let ind2 = indent(lnum - 1)
+ let offset_comment1 = 1
+ " Define the condition of an open statement
+ " Exclude the match of //, /* or */
+ let vlog_openstat = '\(\<or\>\|\([*/]\)\@<![*(,{><+-/%^&|!=?:]\([*/]\)\@!\)'
+ " Define the condition when the statement ends with a one-line comment
+ let vlog_comment = '\(//.*\|/\*.*\*/\s*\)'
+ if exists('b:verilog_indent_verbose')
+ let vverb_str = 'INDENT VERBOSE:'
+ let vverb = 1
+ else
+ let vverb = 0
+ endif
+
+ " Indent accoding to last line
+ " End of multiple-line comment
+ if last_line =~ '\*/\s*$' && last_line !~ '/\*.\{-}\*/'
+ let ind = ind - offset_comment1
+ if vverb
+ echo vverb_str "De-indent after a multiple-line comment."
+ endif
+
+ " Indent after if/else/for/case/always/initial/specify/fork blocks
+ elseif last_line =~ '`\@<!\<\(if\|else\)\>' ||
+ \ last_line =~ '^\s*\<\(for\|case\%[[zx]]\)\>' ||
+ \ last_line =~ '^\s*\<\(always\|initial\)\>' ||
+ \ last_line =~ '^\s*\<\(specify\|fork\)\>'
+ if last_line !~ '\(;\|\<end\>\)\s*' . vlog_comment . '*$' ||
+ \ last_line =~ '\(//\|/\*\).*\(;\|\<end\>\)\s*' . vlog_comment . '*$'
+ let ind = ind + offset
+ if vverb | echo vverb_str "Indent after a block statement." | endif
+ endif
+ " Indent after function/task blocks
+ elseif last_line =~ '^\s*\<\(function\|task\)\>'
+ if last_line !~ '\<end\>\s*' . vlog_comment . '*$' ||
+ \ last_line =~ '\(//\|/\*\).*\(;\|\<end\>\)\s*' . vlog_comment . '*$'
+ let ind = ind + offset
+ if vverb
+ echo vverb_str "Indent after function/task block statement."
+ endif
+ endif
+
+ " Indent after module/function/task/specify/fork blocks
+ elseif last_line =~ '^\s*\<module\>'
+ let ind = ind + indent_modules
+ if vverb && indent_modules
+ echo vverb_str "Indent after module statement."
+ endif
+ if last_line =~ '[(,]\s*' . vlog_comment . '*$' &&
+ \ last_line !~ '\(//\|/\*\).*[(,]\s*' . vlog_comment . '*$'
+ let ind = ind + offset
+ if vverb
+ echo vverb_str "Indent after a multiple-line module statement."
+ endif
+ endif
+
+ " Indent after a 'begin' statement
+ elseif last_line =~ '\(\<begin\>\)\(\s*:\s*\w\+\)*' . vlog_comment . '*$' &&
+ \ last_line !~ '\(//\|/\*\).*\(\<begin\>\)' &&
+ \ ( last_line2 !~ vlog_openstat . '\s*' . vlog_comment . '*$' ||
+ \ last_line2 =~ '^\s*[^=!]\+\s*:\s*' . vlog_comment . '*$' )
+ let ind = ind + offset
+ if vverb | echo vverb_str "Indent after begin statement." | endif
+
+ " De-indent for the end of one-line block
+ elseif ( last_line !~ '\<begin\>' ||
+ \ last_line =~ '\(//\|/\*\).*\<begin\>' ) &&
+ \ last_line2 =~ '\<\(`\@<!if\|`\@<!else\|for\|always\|initial\)\>.*' .
+ \ vlog_comment . '*$' &&
+ \ last_line2 !~
+ \ '\(//\|/\*\).*\<\(`\@<!if\|`\@<!else\|for\|always\|initial\)\>' &&
+ \ last_line2 !~ vlog_openstat . '\s*' . vlog_comment . '*$' &&
+ \ ( last_line2 !~ '\<begin\>' ||
+ \ last_line2 =~ '\(//\|/\*\).*\<begin\>' )
+ let ind = ind - offset
+ if vverb
+ echo vverb_str "De-indent after the end of one-line statement."
+ endif
+
+ " Multiple-line statement (including case statement)
+ " Open statement
+ " Ident the first open line
+ elseif last_line =~ vlog_openstat . '\s*' . vlog_comment . '*$' &&
+ \ last_line !~ '\(//\|/\*\).*' . vlog_openstat . '\s*$' &&
+ \ last_line2 !~ vlog_openstat . '\s*' . vlog_comment . '*$'
+ let ind = ind + offset
+ if vverb | echo vverb_str "Indent after an open statement." | endif
+
+ " Close statement
+ " De-indent for an optional close parenthesis and a semicolon, and only
+ " if there exists precedent non-whitespace char
+ elseif last_line =~ ')*\s*;\s*' . vlog_comment . '*$' &&
+ \ last_line !~ '^\s*)*\s*;\s*' . vlog_comment . '*$' &&
+ \ last_line !~ '\(//\|/\*\).*\S)*\s*;\s*' . vlog_comment . '*$' &&
+ \ ( last_line2 =~ vlog_openstat . '\s*' . vlog_comment . '*$' &&
+ \ last_line2 !~ ';\s*//.*$') &&
+ \ last_line2 !~ '^\s*' . vlog_comment . '$'
+ let ind = ind - offset
+ if vverb | echo vverb_str "De-indent after a close statement." | endif
+
+ " `ifdef and `else
+ elseif last_line =~ '^\s*`\<\(ifdef\|else\)\>'
+ let ind = ind + offset
+ if vverb
+ echo vverb_str "Indent after a `ifdef or `else statement."
+ endif
+
+ endif
+
+ " Re-indent current line
+
+ " De-indent on the end of the block
+ " join/end/endcase/endfunction/endtask/endspecify
+ if curr_line =~ '^\s*\<\(join\|end\|endcase\)\>' ||
+ \ curr_line =~ '^\s*\<\(endfunction\|endtask\|endspecify\)\>'
+ let ind = ind - offset
+ if vverb | echo vverb_str "De-indent the end of a block." | endif
+ elseif curr_line =~ '^\s*\<endmodule\>'
+ let ind = ind - indent_modules
+ if vverb && indent_modules
+ echo vverb_str "De-indent the end of a module."
+ endif
+
+ " De-indent on a stand-alone 'begin'
+ elseif curr_line =~ '^\s*\<begin\>'
+ if last_line !~ '^\s*\<\(function\|task\|specify\|module\)\>' &&
+ \ last_line !~ '^\s*\()*\s*;\|)\+\)\s*' . vlog_comment . '*$' &&
+ \ ( last_line =~
+ \ '\<\(`\@<!if\|`\@<!else\|for\|case\%[[zx]]\|always\|initial\)\>' ||
+ \ last_line =~ ')\s*' . vlog_comment . '*$' ||
+ \ last_line =~ vlog_openstat . '\s*' . vlog_comment . '*$' )
+ let ind = ind - offset
+ if vverb
+ echo vverb_str "De-indent a stand alone begin statement."
+ endif
+ endif
+
+ " De-indent after the end of multiple-line statement
+ elseif curr_line =~ '^\s*)' &&
+ \ ( last_line =~ vlog_openstat . '\s*' . vlog_comment . '*$' ||
+ \ last_line !~ vlog_openstat . '\s*' . vlog_comment . '*$' &&
+ \ last_line2 =~ vlog_openstat . '\s*' . vlog_comment . '*$' )
+ let ind = ind - offset
+ if vverb
+ echo vverb_str "De-indent the end of a multiple statement."
+ endif
+
+ " De-indent `else and `endif
+ elseif curr_line =~ '^\s*`\<\(else\|endif\)\>'
+ let ind = ind - offset
+ if vverb | echo vverb_str "De-indent `else and `endif statement." | endif
+
+ endif
+
+ " Return the indention
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim
new file mode 100644
index 000000000..0de77748c
--- /dev/null
+++ b/runtime/indent/vim.vim
@@ -0,0 +1,65 @@
+" Vim indent file
+" Language: Vim script
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 May 25
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetVimIndent()
+setlocal indentkeys+==end,=else,=cat,=fina,=END,0\\
+
+" Only define the function once.
+if exists("*GetVimIndent")
+ finish
+endif
+
+function GetVimIndent()
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " If the current line doesn't start with '\' and below a line that starts
+ " with '\', use the indent of the line above it.
+ if getline(v:lnum) !~ '^\s*\\'
+ while lnum > 0 && getline(lnum) =~ '^\s*\\'
+ let lnum = lnum - 1
+ endwhile
+ endif
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ " Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
+ " and :else. Add it three times for a line that starts with '\' after
+ " a line that doesn't.
+ let ind = indent(lnum)
+ if getline(v:lnum) =~ '^\s*\\' && v:lnum > 1 && getline(lnum) !~ '^\s*\\'
+ let ind = ind + &sw * 3
+ elseif getline(lnum) =~ '\(^\||\)\s*\(if\|wh\%[ile]\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>'
+ let ind = ind + &sw
+ elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END'
+ let ind = ind + &sw
+ endif
+
+ " If the previous line contains an "end" after a pipe, but not in an ":au"
+ " command.
+ if getline(lnum) =~ '|\s*\(ene\@!\)' && getline(lnum) !~ '^\s*au\%[tocmd]'
+ let ind = ind - &sw
+ endif
+
+
+ " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
+ " :endfun, :else and :augroup END.
+ if getline(v:lnum) =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim:sw=2
diff --git a/runtime/indent/xf86conf.vim b/runtime/indent/xf86conf.vim
new file mode 100644
index 000000000..f9db1ba96
--- /dev/null
+++ b/runtime/indent/xf86conf.vim
@@ -0,0 +1,42 @@
+" Vim indent file
+" Language: XFree86 Configuration File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/xf86conf/
+" Latest Revision: 2004-04-25
+" arch-tag: 8a42f7b6-5088-49cf-b15b-07696a91c015
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetXF86ConfIndent()
+setlocal indentkeys=!^F,o,O,=End
+
+" Only define the function once.
+if exists("*GetXF86ConfIndent")
+ finish
+endif
+
+function GetXF86ConfIndent()
+ let lnum = prevnonblank(v:lnum - 1)
+
+ if lnum == 0
+ return 0
+ endif
+
+ let ind = indent(lnum)
+ let line = getline(lnum)
+
+ if line =~? '^\s*\(Sub\)\=Section'
+ let ind = ind + &sw
+ elseif getline(v:lnum) =~? '^\s*End'
+ let ind = ind - &sw
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/xhtml.vim b/runtime/indent/xhtml.vim
new file mode 100644
index 000000000..1abf6b75f
--- /dev/null
+++ b/runtime/indent/xhtml.vim
@@ -0,0 +1,7 @@
+" Vim indent file
+" Language: XHTML
+" Maintainer: Bram Moolenaar <Bram@vim.org> (for now)
+" Last Change: 2003 Feb 04
+
+" Handled like HTML for now.
+runtime! indent/html.vim
diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim
new file mode 100644
index 000000000..340981b3d
--- /dev/null
+++ b/runtime/indent/xml.vim
@@ -0,0 +1,88 @@
+" Language: xml
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
+" 2) will be confused by unbalanced tags in comments
+" or CDATA sections.
+" TODO: implement pre-like tags, see xml_indent_open / xml_indent_close
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" [-- local settings (must come before aborting the script) --]
+setlocal indentexpr=XmlIndentGet(v:lnum,1)
+setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,}
+
+set cpo-=C
+
+if !exists('b:xml_indent_open')
+ let b:xml_indent_open = '.\{-}<\a'
+ " pre tag, e.g. <address>
+ " let b:xml_indent_open = '.\{-}<[/]\@!\(address\)\@!'
+endif
+
+if !exists('b:xml_indent_close')
+ let b:xml_indent_close = '.\{-}</'
+ " end pre tag, e.g. </address>
+ " let b:xml_indent_close = '.\{-}</\(address\)\@!'
+endif
+
+" [-- finish, if the function already exists --]
+if exists('*XmlIndentGet') | finish | endif
+
+fun! <SID>XmlIndentWithPattern(line, pat)
+ let s = substitute('x'.a:line, a:pat, "\1", 'g')
+ return strlen(substitute(s, "[^\1].*$", '', ''))
+endfun
+
+" [-- check if it's xml --]
+fun! <SID>XmlIndentSynCheck(lnum)
+ if '' != &syntax
+ let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name')
+ let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
+ if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
+ " don't indent pure non-xml code
+ return 0
+ endif
+ endif
+ return 1
+endfun
+
+" [-- return the sum of indents of a:lnum --]
+fun! <SID>XmlIndentSum(lnum, style, add)
+ let line = getline(a:lnum)
+ if a:style == match(line, '^\s*</')
+ return (&sw *
+ \ (<SID>XmlIndentWithPattern(line, b:xml_indent_open)
+ \ - <SID>XmlIndentWithPattern(line, b:xml_indent_close)
+ \ - <SID>XmlIndentWithPattern(line, '.\{-}/>'))) + a:add
+ else
+ return a:add
+ endif
+endfun
+
+fun! XmlIndentGet(lnum, use_syntax_check)
+ " Find a non-empty line above the current line.
+ let lnum = prevnonblank(a:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ if a:use_syntax_check
+ if 0 == <SID>XmlIndentSynCheck(lnum) || 0 == <SID>XmlIndentSynCheck(a:lnum)
+ return indent(a:lnum)
+ endif
+ endif
+
+ let ind = <SID>XmlIndentSum(lnum, -1, indent(lnum))
+ let ind = <SID>XmlIndentSum(a:lnum, 0, ind)
+
+ return ind
+endfun
+
+" vim:ts=8
diff --git a/runtime/indent/xslt.vim b/runtime/indent/xslt.vim
new file mode 100644
index 000000000..ff93d69d7
--- /dev/null
+++ b/runtime/indent/xslt.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language: XSLT .xslt files
+" Maintainer: David Fishburn <fishburn@ianywhere.com>
+" Last Change: Wed May 14 2003 8:48:41 PM
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+" Use XML formatting rules
+runtime! indent/xml.vim
+
diff --git a/runtime/indent/yacc.vim b/runtime/indent/yacc.vim
new file mode 100644
index 000000000..4ea8f6a2d
--- /dev/null
+++ b/runtime/indent/yacc.vim
@@ -0,0 +1,44 @@
+" Vim indent file
+" Language: YACC input file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/yacc/
+" Latest Revision: 2004-04-25
+" arch-tag: 629aa719-8fe4-4787-adb7-ae94ca801610
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetYaccIndent()
+setlocal indentkeys=!^F,o,O
+
+" Only define the function once.
+if exists("*GetYaccIndent")
+ finish
+endif
+
+function GetYaccIndent()
+ if v:lnum == 1
+ return 0
+ endif
+
+ let ind = indent(v:lnum - 1)
+ let line = getline(v:lnum - 1)
+
+ if line == ''
+ let ind = 0
+ elseif line =~ '^\w\+\s*:'
+ let ind = ind + matchend(line, '^\w\+\s*')
+ elseif line =~ '^\s*;'
+ let ind = 0
+ else
+ let ind = indent(v:lnum)
+ endif
+
+ return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indent/zsh.vim b/runtime/indent/zsh.vim
new file mode 100644
index 000000000..ff28d99d7
--- /dev/null
+++ b/runtime/indent/zsh.vim
@@ -0,0 +1,11 @@
+" Vim indent file
+" Language: Zsh Shell Script
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/indent/pcp/zsh/
+" Latest Revision: 2004-05-22
+" arch-tag: e566f55f-d8c0-4c60-b4b3-60c0dbd6dea1
+
+" Same as sh indenting for now.
+runtime! indent/sh.vim
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/indoff.vim b/runtime/indoff.vim
new file mode 100644
index 000000000..0d930352b
--- /dev/null
+++ b/runtime/indoff.vim
@@ -0,0 +1,11 @@
+" Vim support file to switch off loading indent files for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jun 11
+
+if exists("did_indent_on")
+ unlet did_indent_on
+endif
+
+" Remove all autocommands in the filetypeindent group
+silent! au! filetypeindent *
diff --git a/runtime/keymap/README.txt b/runtime/keymap/README.txt
new file mode 100644
index 000000000..d42e02693
--- /dev/null
+++ b/runtime/keymap/README.txt
@@ -0,0 +1,26 @@
+keymap files for Vim
+
+One of these files is loaded when the 'keymap' option is set.
+
+The name of the file consists of these parts:
+
+ {language}[-{layout}][_{encoding}].vim
+
+{language} Name of the language (e.g., "hebrew", "greek")
+
+{layout} Optional: name of the keyboard layout (e.g., "spanish",
+ "russian3"). When omitted the layout of the standard
+ US-english keyboard is assumed.
+
+{encoding} Optional: character encoding for which this keymap works.
+ When omitted the "normal" encoding for the language is
+ assumed.
+ Use the value the 'encoding' option: lower case only, use '-'
+ instead of '_'.
+
+Each file starts with a header, naming the maintainer and the date when it was
+last changed. If you find a problem in a keymap file, check if you have the
+most recent version. If necessary, report a problem to the maintainer.
+
+The format of the keymap lines below "loadkeymap" is explained in the Vim help
+files, see ":help keymap-file-format".
diff --git a/runtime/keymap/accents.vim b/runtime/keymap/accents.vim
new file mode 100644
index 000000000..fae465e93
--- /dev/null
+++ b/runtime/keymap/accents.vim
@@ -0,0 +1,71 @@
+" Vim Keymap file for latin1 accents through dead characters
+" Maintainer: Bram Moolenaar
+" Last Change: 2001 Jul 22
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding latin1
+
+" Use this short name in the status line.
+let b:keymap_name = "acc"
+
+loadkeymap
+`A À
+'A Á
+´A Á
+^A Â
+~A Ã
+'C Ç
+´C Ç
+`E È
+'E É
+´E É
+^E Ê
+`I Ì
+'I Í
+´I Í
+^I Î
+~N Ñ
+`O Ò
+'O Ó
+´O Ó
+^O Ô
+~O Õ
+`U Ù
+'U Ú
+´U Ú
+^U Û
+'Y Ý
+´Y Ý
+`a à
+'a á
+´a á
+^a â
+~a ã
+'c ç
+´c ç
+`e è
+'e é
+´e é
+^e ê
+`i ì
+'i í
+´i í
+^i î
+~n ñ
+`o ò
+'o ó
+´o ó
+^o ô
+~o õ
+`u ù
+'u ú
+´u ú
+^u û
+'y ý
+´y ý
+'' '
+´´ ´
+`` `
+^^ ^
+~~ ~
diff --git a/runtime/keymap/arabic.vim b/runtime/keymap/arabic.vim
new file mode 100644
index 000000000..7eb9a17dd
--- /dev/null
+++ b/runtime/keymap/arabic.vim
@@ -0,0 +1,2 @@
+" Assume 'encoding' is set to "latin1" while actually iso-8859-6 is used
+source <sfile>:p:h/arabic_utf-8.vim
diff --git a/runtime/keymap/arabic_utf-8.vim b/runtime/keymap/arabic_utf-8.vim
new file mode 100644
index 000000000..aeb4a4f39
--- /dev/null
+++ b/runtime/keymap/arabic_utf-8.vim
@@ -0,0 +1,86 @@
+" Vim Keymap file for Arabic
+" Maintainer : Arabic Support group <support-at-arabeyes.org>
+" Created by : Nadim Shaikli <nadim-at-arabeyes.org>
+" Last Updated : 2003 Apr 26
+" This is for a standard Microsoft Arabic keyboard layout.
+
+" Use this short name in the status line.
+let b:keymap_name = "arab"
+
+loadkeymap
+q <char-0x0636> " (1590) - DAD
+w <char-0x0635> " (1589) - SAD
+e <char-0x062b> " (1579) - THEH
+r <char-0x0642> " (1602) - QAF
+t <char-0x0641> " (1601) - FEH
+y <char-0x063a> " (1594) - GHAIN
+u <char-0x0639> " (1593) - AIN
+i <char-0x0647> " (1607) - HEH
+o <char-0x062e> " (1582) - KHAH
+p <char-0x062d> " (1581) - HAH
+[ <char-0x062c> " (1580) - JEEM
+] <char-0x062f> " (1583) - DAL
+a <char-0x0634> " (1588) - SHEEN
+s <char-0x0633> " (1587) - SEEN
+d <char-0x064a> " (1610) - YEH
+f <char-0x0628> " (1576) - BEH
+g <char-0x0644> " (1604) - LAM
+h <char-0x0627> " (1575) - ALEF
+j <char-0x062a> " (1578) - TEH
+k <char-0x0646> " (1606) - NOON
+l <char-0x0645> " (1605) - MEEM
+; <char-0x0643> " (1603) - KAF
+' <char-0x0637> " (1591) - TAH
+z <char-0x0626> " (1574) - YEH with HAMZA ABOVE
+x <char-0x0621> " (1569) - HAMZA
+c <char-0x0624> " (1572) - WAW with HAMZA ABOVE
+v <char-0x0631> " (1585) - REH
+b <char-0x0644><char-0x0627> " (1604/1575) - LAA (lam alef)
+n <char-0x0649> " (1609) - ALEF MAKSURA
+m <char-0x0629> " (1577) - TEH MARBUTA
+, <char-0x0648> " (1608) - WAW
+. <char-0x0632> " (1586) - ZAIN
+/ <char-0x0638> " (1592) - ZAH
+0 <char-0x0660> " (1632) - Arabic 0
+1 <char-0x0661> " (1633) - Arabic 1
+2 <char-0x0662> " (1634) - Arabic 2
+3 <char-0x0663> " (1635) - Arabic 3
+4 <char-0x0664> " (1636) - Arabic 4
+5 <char-0x0665> " (1637) - Arabic 5
+6 <char-0x0666> " (1638) - Arabic 6
+7 <char-0x0667> " (1639) - Arabic 7
+8 <char-0x0668> " (1640) - Arabic 8
+9 <char-0x0669> " (1641) - Arabic 9
+` <char-0x0630> " (1584) - THAL
+~ <char-0x0651> " (1617) - Tanween -- SHADDA
+Q <char-0x064e> " (1614) - Tanween -- FATHA
+W <char-0x064b> " (1611) - Tanween -- FATHATAN
+E <char-0x064f> " (1615) - Tanween -- DAMMA
+R <char-0x064c> " (1612) - Tanween -- DAMMATAN
+T <char-0x0644><char-0x0625> " (1604/1573) - LAA with HAMZA BELOW
+Y <char-0x0625> " (1573) - ALEF with HAMZA BELOW
+U <char-0x0060> " (96) - ASCII -- `
+I <char-0x00f7> " (247) - ASCII suppl -- div
+O <char-0x00d7> " (215) - ASCII suppl -- mul
+P <char-0x061b> " (1563) - Arabic Semicolon
+{ <char-0x003c> " (60) - ASCII -- <
+} <char-0x003e> " (62) - ASCII -- >
+A <char-0x0650> " (1616) - Tanween -- KASRA
+S <char-0x064d> " (1613) - Tanween -- KASRATAN
+D <char-0x005b> " (91) - ASCII -- [
+F <char-0x005d> " (93) - ASCII -- ]
+G <char-0x0644><char-0x0623> " (1604/1571) - LAA with HAMZA ABOVE
+H <char-0x0623> " (1571) - ALEF with HAMZA ABOVE
+J <char-0x0640> " (1600) - TATWEEL
+K <char-0x060c> " (1548) - Arabic Comma
+L <char-0x002f> " (47) - ASCII -- /
+Z <char-0x007e> " (126) - ASCII -- ~
+X <char-0x0652> " (1618) - Tanween -- SUKUN
+C <char-0x007b> " (123) - ASCII -- {
+V <char-0x007d> " (125) - ASCII -- }
+B <char-0x0644><char-0x0622> " (1604/1570) - LAA with MADDA ABOVE
+N <char-0x0622> " (1570) - ALEF with MADDA ABOVE
+M <char-0x0027> " (39) - ASCII -- '
+< <char-0x002c> " (44) - ASCII -- ,
+> <char-0x002e> " (46) - ASCII -- .
+? <char-0x061f> " (1567) - Arabic Question Mark
diff --git a/runtime/keymap/czech.vim b/runtime/keymap/czech.vim
new file mode 100644
index 000000000..ffca531c0
--- /dev/null
+++ b/runtime/keymap/czech.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/czech_utf-8.vim
diff --git a/runtime/keymap/czech_utf-8.vim b/runtime/keymap/czech_utf-8.vim
new file mode 100644
index 000000000..227f80bef
--- /dev/null
+++ b/runtime/keymap/czech_utf-8.vim
@@ -0,0 +1,78 @@
+" Maintainer: Jiri Tobisek <tobich@yahoo.com>
+" Last Changed: 2001 Sep 30
+
+let b:keymap = "czech"
+
+loadkey
+0 é
+9 í
+8 ÷
+7 ý
+6 ŵ
+5 Å™
+4 Ä«
+3 Å·
+2 Ä›
+1 +
+` ;
+) 0
+( 9
+* 8
+& 7
+^ 6
+% 5
+$ 4
+# 3
+@ 2
+! 1
+] )
+} (
+[ ú
+{ /
+' §
+" !
+; ů
+: "
+/ -
+? _
+> :
+< ?
+| '
+~u ů
+~U Å®
+\\a ä
+\\e ë
+\\i ï
+\\o ö
+\\u å
+\\y ÿ
+\\A Ä
+\\E Ë
+\\I ì
+\\O Ö
+\\U ö
+\\Y Ÿ
+=a ÷
+=e é
+=i í
+=o ó
+=u ú
+=y ý
+=A Ã
+=E É
+=I ë
+=O Ó
+=U ù
+=Y û
++c Ä«
++d Ĭ
++e Ä›
++n ň
++r Å™
++s Å·
++t Å¡
++z ŵ
+"y z If you prefere 'quertz' keyboard
+"Y Z instead of 'querty',
+"z y just uncomment these
+"Z Y four last lines
diff --git a/runtime/keymap/esperanto.vim b/runtime/keymap/esperanto.vim
new file mode 100644
index 000000000..42b3987bb
--- /dev/null
+++ b/runtime/keymap/esperanto.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/esperanto_utf-8.vim
diff --git a/runtime/keymap/esperanto_utf-8.vim b/runtime/keymap/esperanto_utf-8.vim
new file mode 100644
index 000000000..3d335cb24
--- /dev/null
+++ b/runtime/keymap/esperanto_utf-8.vim
@@ -0,0 +1,58 @@
+" Esperanto keymap for utf-8
+" Maintainer: A.J.Mechelynck <antoine.mechelynck@skynet.be>
+" Last Changed: Sat 2003 Mar 15 05:23
+
+" This keymap adds the special consonants of Esperanto to an existing Latin
+" keyboard.
+"
+" All keys same as usual, except:
+" ^ followed by any of CcGgHhJjSs adds a circumflex on top of the letter
+" ù and Ù replaces the grave accent by a breve
+" any of CcGgHhJjSsUu followed by X or x maps to consonant with ^ or Uu with
+" breve.
+
+" short keymap name for statusline
+let b:keymap_name = "Eo"
+
+" make cursor bright green when keymap is active
+"highlight lCursor guifg=NONE guibg=#00E000
+
+" The following digraphs are already defined
+" digraph C> 0x0108 c> 0x0109 G> 0x011C g> 0x011D H> 0x0124 h> 0x0125
+" digraph J> 0x0134 j> 0x0135 S> 0x015C s> 0x015D U( 0x016C u( 0x016D
+
+scriptencoding latin1
+
+loadkeymap
+
+^C <Char-0x0108> " (264) UPPERCASE C WITH CIRCUMFLEX
+^c <Char-0x0109> " (265) LOWERCASE c WITH CIRCUMFLEX
+^G <Char-0x011C> " (284) UPPERCASE G WITH CIRCUMFLEX
+^g <Char-0x011D> " (285) LOWERCASE g WITH CIRCUMFLEX
+^H <Char-0x0124> " (292) UPPERCASE H WITH CIRCUMFLEX
+^h <Char-0x0125> " (293) LOWERCASE h WITH CIRCUMFLEX
+^J <Char-0x0134> " (308) UPPERCASE J WITH CIRCUMFLEX
+^j <Char-0x0135> " (309) LOWERCASE j WITH CIRCUMFLEX
+^S <Char-0x015C> " (348) UPPERCASE S WITH CIRCUMFLEX
+^s <Char-0x015D> " (349) LOWERCASE s WITH CIRCUMFLEX
+Ù <Char-0x016C> " (364) UPPERCASE U WITH BREVE
+ù <Char-0x016D> " (365) LOWERCASE u WITH BREVE
+
+CX <Char-0x0108> " (264) UPPERCASE C WITH CIRCUMFLEX
+Cx <Char-0x0108> " (264) UPPERCASE C WITH CIRCUMFLEX
+cx <Char-0x0109> " (265) LOWERCASE c WITH CIRCUMFLEX
+GX <Char-0x011C> " (284) UPPERCASE G WITH CIRCUMFLEX
+Gx <Char-0x011C> " (284) UPPERCASE G WITH CIRCUMFLEX
+gx <Char-0x011D> " (285) LOWERCASE g WITH CIRCUMFLEX
+HX <Char-0x0124> " (292) UPPERCASE H WITH CIRCUMFLEX
+Hx <Char-0x0124> " (292) UPPERCASE H WITH CIRCUMFLEX
+hx <Char-0x0125> " (293) LOWERCASE h WITH CIRCUMFLEX
+JX <Char-0x0134> " (308) UPPERCASE J WITH CIRCUMFLEX
+Jx <Char-0x0134> " (308) UPPERCASE J WITH CIRCUMFLEX
+jx <Char-0x0135> " (309) LOWERCASE j WITH CIRCUMFLEX
+SX <Char-0x015C> " (348) UPPERCASE S WITH CIRCUMFLEX
+Sx <Char-0x015C> " (348) UPPERCASE S WITH CIRCUMFLEX
+sx <Char-0x015D> " (349) LOWERCASE s WITH CIRCUMFLEX
+UX <Char-0x016C> " (364) UPPERCASE U WITH BREVE
+Ux <Char-0x016C> " (364) UPPERCASE U WITH BREVE
+ux <Char-0x016D> " (365) LOWERCASE u WITH BREVE
diff --git a/runtime/keymap/greek.vim b/runtime/keymap/greek.vim
new file mode 100644
index 000000000..eb2c1dedc
--- /dev/null
+++ b/runtime/keymap/greek.vim
@@ -0,0 +1,7 @@
+" Assume 'encoding' is set to "latin1" while actually cp1253 or iso-8859-7 is
+" being used
+if has("win16") || has("win32") || has("win32unix")
+ source <sfile>:p:h/greek_cp1253.vim
+else
+ source <sfile>:p:h/greek_iso-8859-7.vim
+endif
diff --git a/runtime/keymap/greek_cp1253.vim b/runtime/keymap/greek_cp1253.vim
new file mode 100644
index 000000000..a146477da
--- /dev/null
+++ b/runtime/keymap/greek_cp1253.vim
@@ -0,0 +1,119 @@
+" Vim Keymap file for greek
+" Maintainer: Grigorios Magklis <maglis@cs.rochester.edu>
+" Patched for MS-Windows CP1253: Panagiotis Louridas <louridas@acm.org>
+" Last Updated: Fri 13 Feb 2004 13:01:33
+"
+" This keyboard layout allows all Greek symbols to be typed,
+" including accented capitals, diaeresis & accent on the same
+" vowel, and the Greek semicolon sign.
+"
+" accent ";" + letter
+" diaeresis ":" + letter
+" diaeresis + accent ";" + ":" (or ":" + ";") + letter
+" semicolon "q"
+" colon "Q"
+" greek semicolon "W"
+" sigma at end of word "w"
+" greek left double-quote "<" twice
+" greek right double-quote ">" twice
+
+" Use this short name in the status line.
+let b:keymap_name = "greek"
+
+loadkeymap
+" capital
+A <char-193> " Á
+B <char-194> " Â
+G <char-195> " Ã
+D <char-196> " Ä
+E <char-197> " Å
+Z <char-198> " Æ
+H <char-199> " Ç
+U <char-200> " È
+I <char-201> " É
+K <char-202> " Ê
+L <char-203> " Ë
+M <char-204> " Ì
+N <char-205> " Í
+J <char-206> " Î
+O <char-207> " Ï
+P <char-208> " Ð
+R <char-209> " Ñ
+S <char-211> " Ó
+T <char-212> " Ô
+Y <char-213> " Õ
+F <char-214> " Ö
+X <char-215> " ×
+C <char-216> " Ø
+V <char-217> " Ù
+
+" small
+a <char-225> " á
+b <char-226> " â
+g <char-227> " ã
+d <char-228> " ä
+e <char-229> " å
+z <char-230> " æ
+h <char-231> " ç
+u <char-232> " è
+i <char-233> " é
+k <char-234> " ê
+l <char-235> " ë
+m <char-236> " ì
+n <char-237> " í
+j <char-238> " î
+o <char-239> " ï
+p <char-240> " ð
+r <char-241> " ñ
+w <char-242> " ò
+s <char-243> " ó
+t <char-244> " ô
+y <char-245> " õ
+f <char-246> " ö
+x <char-247> " ÷
+c <char-248> " ø
+v <char-249> " ù
+
+" accented capital
+;A <char-162> " ¢
+;E <char-184> " ¸
+;H <char-185> " ¹
+;I <char-186> " º
+;Y <char-190> " ¾
+;O <char-188> " ¼
+;V <char-191> " ¿
+"
+:I <char-218> " Ú
+:Y <char-219> " Û
+
+" accented small
+;a <char-220> " Ü
+;e <char-221> " Ý
+;h <char-222> " Þ
+;i <char-223> " ß
+;y <char-253> " ý
+;o <char-252> " ü
+;v <char-254> " þ
+"
+:i <char-250> " ú
+:y <char-251> " û
+"
+;:i <char-192> " À
+:;i <char-192> " À
+;:y <char-224> " à
+:;y <char-224> " à
+
+" symbols
+q ; " ;
+Q : " :
+W <char-183> " ·
+; <char-180> " ´
+: <char-168> " ¨
+;: <char-181> " µ
+:; <char-181> " µ
+
+" quotes
+<< <char-171> " «
+>> <char-187> " »
+" <char-161> " ¡
+" <char-162> " ¢
diff --git a/runtime/keymap/greek_iso-8859-7.vim b/runtime/keymap/greek_iso-8859-7.vim
new file mode 100644
index 000000000..5cfd936b3
--- /dev/null
+++ b/runtime/keymap/greek_iso-8859-7.vim
@@ -0,0 +1,118 @@
+" Vim Keymap file for greek
+" Maintainer: Grigorios Magklis <maglis@cs.rochester.edu>
+" Last Updated: Tue 10 Jul 2001 16:50:50
+"
+" This keyboard layout allows all Greek symbols to be typed,
+" including accented capitals, diaeresis & accent on the same
+" vowel, and the Greek semicolon sign.
+"
+" accent ";" + letter
+" diaeresis ":" + letter
+" diaeresis + accent ";" + ":" (or ":" + ";") + letter
+" semicolon "q"
+" colon "Q"
+" greek semicolon "W"
+" sigma at end of word "w"
+" greek left double-quote "<" twice
+" greek right double-quote ">" twice
+
+" Use this short name in the status line.
+let b:keymap_name = "greek"
+
+loadkeymap
+" capital
+A <char-193> " Á
+B <char-194> " Â
+G <char-195> " Ã
+D <char-196> " Ä
+E <char-197> " Å
+Z <char-198> " Æ
+H <char-199> " Ç
+U <char-200> " È
+I <char-201> " É
+K <char-202> " Ê
+L <char-203> " Ë
+M <char-204> " Ì
+N <char-205> " Í
+J <char-206> " Î
+O <char-207> " Ï
+P <char-208> " Ð
+R <char-209> " Ñ
+S <char-211> " Ó
+T <char-212> " Ô
+Y <char-213> " Õ
+F <char-214> " Ö
+X <char-215> " ×
+C <char-216> " Ø
+V <char-217> " Ù
+
+" small
+a <char-225> " á
+b <char-226> " â
+g <char-227> " ã
+d <char-228> " ä
+e <char-229> " å
+z <char-230> " æ
+h <char-231> " ç
+u <char-232> " è
+i <char-233> " é
+k <char-234> " ê
+l <char-235> " ë
+m <char-236> " ì
+n <char-237> " í
+j <char-238> " î
+o <char-239> " ï
+p <char-240> " ð
+r <char-241> " ñ
+w <char-242> " ò
+s <char-243> " ó
+t <char-244> " ô
+y <char-245> " õ
+f <char-246> " ö
+x <char-247> " ÷
+c <char-248> " ø
+v <char-249> " ù
+
+" accented capital
+;A <char-182> " ¶
+;E <char-184> " ¸
+;H <char-185> " ¹
+;I <char-186> " º
+;Y <char-190> " ¾
+;O <char-188> " ¼
+;V <char-191> " ¿
+"
+:I <char-218> " Ú
+:Y <char-219> " Û
+
+" accented small
+;a <char-220> " Ü
+;e <char-221> " Ý
+;h <char-222> " Þ
+;i <char-223> " ß
+;y <char-253> " ý
+;o <char-252> " ü
+;v <char-254> " þ
+"
+:i <char-250> " ú
+:y <char-251> " û
+"
+;:i <char-192> " À
+:;i <char-192> " À
+;:y <char-224> " à
+:;y <char-224> " à
+
+" symbols
+q ; " ;
+Q : " :
+W <char-183> " ·
+; <char-180> " ´
+: <char-168> " ¨
+;: <char-181> " µ
+:; <char-181> " µ
+
+" quotes
+<< <char-171> " «
+>> <char-187> " »
+" <char-161> " ¡
+" <char-162> " ¢
diff --git a/runtime/keymap/greek_utf-8.vim b/runtime/keymap/greek_utf-8.vim
new file mode 100644
index 000000000..7eb67cfe9
--- /dev/null
+++ b/runtime/keymap/greek_utf-8.vim
@@ -0,0 +1,600 @@
+" This file was adapted for Vim 6 from the yudit distribution by
+" Robert Goulding <goulding@princeton.edu>
+"
+" The monotonic part of this kmap was made by Constantine Stathopoulos
+" <cstath@irismedia.gr>.
+" The polytonic part was made by <birger.langkjer@image.dk> 04/11-1999,
+" Aarhus, Denmark.
+" It was modified and completed by A. Tsolomitis <atsol@aegean.gr>
+" The licence allows modifications but redistribution of modifications
+" should be with an other name.
+" Any comments can be sent to A. Tsolomitis <atsol@aegean.gr>
+
+" The keymap now conforms with the
+" LaTeX's-Babel Standard by A. Syropoulos <apostolo@ocean1.ee.duth.gr>
+
+" The conventions are as follows:
+" EURO SIGN is E$ (0x20AC),
+" Drachma sign is D$ (0x20AF)
+
+" RIGHT an LEFT QUOTATION MARKS (0x00BB), (0x00AB),
+" follow the kikbd conventions (;< abd ;>) AND << and >>
+
+" Apostrofos is corrected in order to agree with the Greek grammar rules
+" of Triantafilidis who requires the PSILI (or Koronis) symbol for an
+" apostrophe.
+
+" The Greek ANO TELEIA (0x0387), follows again the kikbd conventions as
+" well as the Emacs conventions. So it is produced by both ;. and W
+
+" All greek accents are added so they can be produced by scholars
+" without having to combine them with letters (usufull for grammarians
+" in particular) (especially for dasia and psiln we use ' for psili
+" (that is apostrophe) and ;' for dasia. This is done in order to
+" preserve the posibility to write a plain < or >.
+
+" Ypogegrammeni is | following the character (the originally proposed
+" i after the character is problematic: can't write easily ai or vi) :
+
+" > dasia " an oxia or baria *always* should follow dasia
+" < psili " an oxia or baria *always* should follow psili
+" ; oxia
+" ` varia
+" ~ perispomeni
+" : dialytika
+" :; or ;: dialytika oxia
+" :` or `: dialytika baria
+" || a single ypogegrammeni
+" vowel followed by | gives ypogegrammeni to the vowel
+" -vowel gives vowel with macron
+" ^vowel gives vowel with braxy
+" -- endash
+" --- emdash
+" ;b ;p ;f ;u ;r ;k give alternative forms
+" && give the Greek kai symbol
+" #Q and #q give archaic Qoppa and qoppa
+" ;U is capital Theta symbol
+" !e and !E are lunate epsilon and Epsilon
+" #ST stigma
+" #SP sampi
+" #G digamma
+" #Q qoppa
+" ;# avw tovos (for numerals)
+" ;## katw tovos (for numerals)
+
+
+" All accents are supported. Even rho with < and > and Rho with <
+" Also :~i and :~u and macron and braxy a,i,u and their capitals.
+let b:keymap_name = "grk"
+loadkeymap
+" PUNCTUATION MARKS - SYMBOLS (GREEK SPECIFIC)
+"
+E$ <char-0x20AC> " EURO SIGN
+>> <char-0x00BB> " RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK [GREEK
+ " EISAGOGIKA/OMOIOMATIKA - DEFINITION
+ " MISSING FROM UNICODE]
+;> <char-0x00BB> "
+<< <char-0x00AB> " LEFT-POINTING DOUBLE ANGLE QUOTATION MARK [GREEK
+ " EISAGOGIKA - DEFINITION MISSING FROM UNICODE]
+;< <char-0x00AB> "
+Q <char-0x003A> " COLON [GREEK EPEXIGIMATIKA OR ANO & KATO TELEIA -
+ " DEFINITION MISSING FROM UNICODE]
+q <char-0x037E> " GREEK QUESTION MARK (EROTIMATIKO)
+;. <char-0x0387> " GREEK ANO TELEIA (KDE/kikbd/Xinput standard)
+W <char-0x0387> " GREEK ANO TELEIA (Emacs standard)
+' <char-0x1FBD> " GREEK APOSTROFOS
+-- <char-0x2013> " endash
+--- <char-0x2014> " emdash
+"
+" GREEK DIACRITICS
+"
+: <char-0x00A8> " DIAERESIS [GREEK DIALYTIKA - DEFINITION MISSING FROM
+ " UNICODE]
+; <char-0x0384> " GREEK TONOS
+:; <char-0x0385> " GREEK DIALYTIKA Oxia
+;: <char-0x0385> " GREEK DIALYTIKA Oxia
+:` <char-0x1FED> " GREEK DIALYTIKA VARIA
+`: <char-0x1FED> " GREEK DIALYTIKA VARIA
+` <char-0x1FEF> " Greek Varia
+~ <char-0x1FC0> " Perispomeni
+>` <char-0x1FCD> " Psili Varia
+<` <char-0x1FDD> " Dasia Varia
+>; <char-0x1FCE> " Psili Oxia
+<; <char-0x1FDE> " Dasia Oxia
+<~ <char-0x1FDF> " Dasia Perispomeni
+>~ <char-0x1FCF> " Psili Perispomeni
+"For plain psili use apostrophe
+;' <char-0x1FFE> " (Plain) dasia
+
+
+"
+" GREEK LETTERS
+"
+A <char-0x0391> " GREEK CAPITAL LETTER ALPHA
+B <char-0x0392> " GREEK CAPITAL LETTER BETA
+G <char-0x0393> " GREEK CAPITAL LETTER GAMMA
+D <char-0x0394> " GREEK CAPITAL LETTER DELTA
+E <char-0x0395> " GREEK CAPITAL LETTER EPSILON
+Z <char-0x0396> " GREEK CAPITAL LETTER ZETA
+H <char-0x0397> " GREEK CAPITAL LETTER ETA
+U <char-0x0398> " GREEK CAPITAL LETTER THETA
+I <char-0x0399> " GREEK CAPITAL LETTER IOTA
+K <char-0x039A> " GREEK CAPITAL LETTER KAPPA
+L <char-0x039B> " GREEK CAPITAL LETTER LAMDA
+M <char-0x039C> " GREEK CAPITAL LETTER MU
+N <char-0x039D> " GREEK CAPITAL LETTER NU
+J <char-0x039E> " GREEK CAPITAL LETTER XI
+O <char-0x039F> " GREEK CAPITAL LETTER OMIKRON
+P <char-0x03A0> " GREEK CAPITAL LETTER PI
+R <char-0x03A1> " GREEK CAPITAL LETTER RHO
+"W <char-0x03A3> " GREEK CAPITAL LETTER SIGMA [CAPITAL ANALOGUE FOR
+ " SMALL LETTER FINAL SIGMA]
+S <char-0x03A3> " GREEK CAPITAL LETTER SIGMA
+T <char-0x03A4> " GREEK CAPITAL LETTER TAU
+Y <char-0x03A5> " GREEK CAPITAL LETTER UPSILON
+F <char-0x03A6> " GREEK CAPITAL LETTER PHI
+X <char-0x03A7> " GREEK CAPITAL LETTER CHI
+C <char-0x03A8> " GREEK CAPITAL LETTER PSI
+V <char-0x03A9> " GREEK CAPITAL LETTER OMEGA
+a <char-0x03B1> " GREEK SMALL LETTER ALPHA
+b <char-0x03B2> " GREEK SMALL LETTER BETA
+g <char-0x03B3> " GREEK SMALL LETTER GAMMA
+d <char-0x03B4> " GREEK SMALL LETTER DELTA
+e <char-0x03B5> " GREEK SMALL LETTER EPSILON
+z <char-0x03B6> " GREEK SMALL LETTER ZETA
+h <char-0x03B7> " GREEK SMALL LETTER ETA
+u <char-0x03B8> " GREEK SMALL LETTER THETA
+i <char-0x03B9> " GREEK SMALL LETTER IOTA
+k <char-0x03BA> " GREEK SMALL LETTER KAPPA
+l <char-0x03BB> " GREEK SMALL LETTER LAMDA
+m <char-0x03BC> " GREEK SMALL LETTER MU
+n <char-0x03BD> " GREEK SMALL LETTER NU
+j <char-0x03BE> " GREEK SMALL LETTER XI
+o <char-0x03BF> " GREEK SMALL LETTER OMICRON
+p <char-0x03C0> " GREEK SMALL LETTER PI
+r <char-0x03C1> " GREEK SMALL LETTER RHO
+w <char-0x03C2> " GREEK SMALL LETTER FINAL SIGMA
+s <char-0x03C3> " GREEK SMALL LETTER SIGMA
+t <char-0x03C4> " GREEK SMALL LETTER TAU
+y <char-0x03C5> " GREEK SMALL LETTER UPSILON
+f <char-0x03C6> " GREEK SMALL LETTER PHI
+x <char-0x03C7> " GREEK SMALL LETTER CHI
+c <char-0x03C8> " GREEK SMALL LETTER PSI
+v <char-0x03C9> " GREEK SMALL LETTER OMEGA
+"
+"COMBINED GREEK LETTERS WITH DIACRITICS
+"
+;A <char-0x0386> " GREEK CAPITAL LETTER ALPHA WITH TONOS
+;E <char-0x0388> " GREEK CAPITAL LETTER EPSILON WITH TONOS
+;H <char-0x0389> " GREEK CAPITAL LETTER ETA WITH TONOS
+;I <char-0x038A> " GREEK CAPITAL LETTER IOTA WITH TONOS
+;O <char-0x038C> " GREEK CAPITAL LETTER OMICRON WITH TONOS
+;Y <char-0x038E> " GREEK CAPITAL LETTER UPSILON WITH TONOS
+;V <char-0x038F> " GREEK CAPITAL LETTER OMEGA WITH TONOS
+:;i <char-0x0390> " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+;:i <char-0x0390> " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+:`i <char-0x1FD2> " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND baria
+`:i <char-0x1FD2> " GREEK SMALL LETTER IOTA WITH DIALYTIKA AND baria
+:I <char-0x03AA> " GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+:Y <char-0x03AB> " GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+;a <char-0x03AC> " GREEK SMALL LETTER ALPHA WITH TONOS
+;e <char-0x03AD> " GREEK SMALL LETTER EPSILON WITH TONOS
+;h <char-0x03AE> " GREEK SMALL LETTER ETA WITH TONOS
+;i <char-0x03AF> " GREEK SMALL LETTER IOTA WITH TONOS
+:;y <char-0x03B0> " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+;:y <char-0x03B0> " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+:`y <char-0x1FE2> " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND baria
+`:y <char-0x1FE2> " GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND baria
+:i <char-0x03CA> " GREEK SMALL LETTER IOTA WITH DIALYTIKA
+:y <char-0x03CB> " GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+;o <char-0x03CC> " GREEK SMALL LETTER OMICRON WITH TONOS
+;y <char-0x03CD> " GREEK SMALL LETTER UPSILON WITH TONOS
+;v <char-0x03CE> " GREEK SMALL LETTER OMEGA WITH TONOS
+
+
+
+"
+" letters with Varia:
+"
+`A <char-0x1FBA> " GREEK CAPITAL LETTER ALPHA WITH VARIA
+`E <char-0x1FC8> " GREEK CAPITAL LETTER ALPHA WITH VARIA
+`H <char-0x1FCA> " GREEK CAPITAL LETTER ETA WITH VARIA
+`I <char-0x1FDA> " GREEK CAPITAL LETTER IOTA WITH VARIA
+`O <char-0x1FF8> " GREEK CAPITAL LETTER ALPHA WITH VARIA
+`Y <char-0x1FEA> " GREEK CAPITAL LETTER ALPHA WITH VARIA
+`V <char-0x1FFA> " GREEK CAPITAL LETTER OMEGA WITH VARIA
+`a <char-0x1F70> " GREEK SMALL LETTER ALPHA WITH VARIA
+`e <char-0x1F72> " GREEK SMALL LETTER ALPHA WITH VARIA
+`h <char-0x1F74> " GREEK SMALL LETTER ETA WITH VARIA
+`i <char-0x1F76> " GREEK SMALL LETTER IOTA WITH VARIA
+`o <char-0x1F78> " GREEK SMALL LETTER ALPHA WITH VARIA
+`y <char-0x1F7A> " GREEK SMALL LETTER ALPHA WITH VARIA
+`v <char-0x1F7C> " GREEK SMALL LETTER OMEGA WITH VARIA
+"
+" letters with Oxia:
+"
+;A <char-0x1FBB> " GREEK CAPITAL LETTER ALPHA WITH OXIA
+;E <char-0x1FC9> " GREEK CAPITAL LETTER EPSILON WITH OXIA
+;H <char-0x1FCB> " GREEK CAPITAL LETTER ETA WITH OXIA
+;I <char-0x1FDB> " GREEK CAPITAL LETTER IOTA WITH OXIA
+;O <char-0x1FF9> " GREEK CAPITAL LETTER OMICRON WITH OXIA
+;Y <char-0x1FEB> " GREEK CAPITAL LETTER UPSILON WITH OXIA
+;V <char-0x1FFB> " GREEK CAPITAL LETTER OMEGA WITH OXIA
+;a <char-0x1F71> " GREEK SMALL LETTER ALPHA WITH OXIA
+;e <char-0x1F73> " GREEK SMALL LETTER EPSILON WITH OXIA
+;h <char-0x1F75> " GREEK SMALL LETTER ETA WITH OXIA
+;i <char-0x1F77> " GREEK SMALL LETTER IOTA WITH OXIA
+;o <char-0x1F79> " GREEK SMALL LETTER OMICRON WITH OXIA
+;y <char-0x1F7B> " GREEK SMALL LETTER UPSILON WITH OXIA
+;v <char-0x1F7D> " GREEK SMALL LETTER OMEGA WITH OXIA
+"
+"
+" This area covers 0x1F00-0x1F6F
+"
+" letters with Psili:
+"
+>A <char-0x1F08> " GREEK CAPITAL LETTER ALPHA WITH PSILI
+>E <char-0x1F18> " GREEK CAPITAL LETTER EPSILON WITH PSILI
+>H <char-0x1F28> " GREEK CAPITAL LETTER ETA WITH PSILI
+>I <char-0x1F38> " GREEK CAPITAL LETTER IOTA WITH PSILI
+>O <char-0x1F48> " GREEK CAPITAL LETTER OMICRON WITH PSILI
+>Y <char-0x1F58> " GREEK CAPITAL LETTER UPSILON WITH PSILI
+>V <char-0x1F68> " GREEK CAPITAL LETTER OMEGA WITH PSILI
+>a <char-0x1F00> " GREEK SMALL LETTER ALPHA WITH PSILI
+>e <char-0x1F10> " GREEK SMALL LETTER EPSILON WITH PSILI
+>h <char-0x1F20> " GREEK SMALL LETTER ETA WITH PSILI
+>i <char-0x1F30> " GREEK SMALL LETTER IOTA WITH PSILI
+>o <char-0x1F40> " GREEK SMALL LETTER OMICRON WITH PSILI
+>y <char-0x1F50> " GREEK SMALL LETTER UPSILON WITH PSILI
+>v <char-0x1F60> " GREEK SMALL LETTER OMEGA WITH PSILI
+
+"
+" Letters with Dasia:
+"
+<A <char-0x1F09> " GREEK CAPITAL LETTER ALPHA WITH DASIA
+<E <char-0x1F19> " GREEK CAPITAL LETTER EPSILON WITH DASIA
+<H <char-0x1F29> " GREEK CAPITAL LETTER ETA WITH DASIA
+<I <char-0x1F39> " GREEK CAPITAL LETTER IOTA WITH DASIA
+<O <char-0x1F49> " GREEK CAPITAL LETTER OMICRON WITH DASIA
+<Y <char-0x1F59> " GREEK CAPITAL LETTER UPSILON WITH DASIA
+<V <char-0x1F69> " GREEK CAPITAL LETTER OMEGA WITH DASIA
+<a <char-0x1F01> " GREEK SMALL LETTER ALPHA WITH DASIA
+<e <char-0x1F11> " GREEK SMALL LETTER EPSILON WITH DASIA
+<h <char-0x1F21> " GREEK SMALL LETTER ETA WITH DASIA
+<i <char-0x1F31> " GREEK SMALL LETTER IOTA WITH DASIA
+<o <char-0x1F41> " GREEK SMALL LETTER OMICRON WITH DASIA
+<y <char-0x1F51> " GREEK SMALL LETTER UPSILON WITH DASIA
+<v <char-0x1F61> " GREEK SMALL LETTER OMEGA WITH DASIA
+"
+" letters with Psili and Varia:
+"
+>`A <char-0x1F0A> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+>`E <char-0x1F1A> " GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+>`H <char-0x1F2A> " GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+>`I <char-0x1F3A> " GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+>`O <char-0x1F4A> " GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+>`Y <char-0x1F5A> " GREEK CAPITAL LETTER UPSILON WITH PSILI AND VARIA
+>`V <char-0x1F6A> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+>`a <char-0x1F02> " GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+>`e <char-0x1F12> " GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+>`h <char-0x1F22> " GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+>`i <char-0x1F32> " GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+>`o <char-0x1F42> " GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+>`y <char-0x1F52> " GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+>`v <char-0x1F62> " GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+"
+" Letters with Dasia and Varia:
+"
+<`A <char-0x1F0B> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<`E <char-0x1F1B> " GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<`H <char-0x1F2B> " GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<`I <char-0x1F3B> " GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<`O <char-0x1F4B> " GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<`Y <char-0x1F5B> " GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<`V <char-0x1F6B> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<`a <char-0x1F03> " GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<`e <char-0x1F13> " GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<`h <char-0x1F23> " GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<`i <char-0x1F33> " GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<`o <char-0x1F43> " GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<`y <char-0x1F53> " GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<`v <char-0x1F63> " GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+"
+" letters with Psili and Oxia:
+"
+>;A <char-0x1F0C> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+>;E <char-0x1F1C> " GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+>;H <char-0x1F2C> " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+>;I <char-0x1F3C> " GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+>;O <char-0x1F4C> " GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+>;Y <char-0x1F5C> " GREEK CAPITAL LETTER UPSILON WITH PSILI AND OXIA
+>;V <char-0x1F6C> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+>;a <char-0x1F04> " GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+>;e <char-0x1F14> " GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+>;h <char-0x1F24> " GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+>;i <char-0x1F34> " GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+>;o <char-0x1F44> " GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+>;y <char-0x1F54> " GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+>;v <char-0x1F64> " GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+"
+" Letters with Dasia and Oxia:
+"
+<;A <char-0x1F0D> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<;E <char-0x1F1D> " GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<;H <char-0x1F2D> " GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<;I <char-0x1F3D> " GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<;O <char-0x1F4D> " GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<;Y <char-0x1F5D> " GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<;V <char-0x1F6D> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<;a <char-0x1F05> " GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<;e <char-0x1F15> " GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<;h <char-0x1F25> " GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<;i <char-0x1F35> " GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<;o <char-0x1F45> " GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<;y <char-0x1F55> " GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<;v <char-0x1F65> " GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+"
+" letters with Psili and Perispomeni:
+"
+>~A <char-0x1F0E> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+>~E <char-0x1F1E> " GREEK CAPITAL LETTER EPSILON WITH PSILI AND PERISPOMENI
+>~H <char-0x1F2E> " GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+>~I <char-0x1F3E> " GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+>~O <char-0x1F4E> " GREEK CAPITAL LETTER OMICRON WITH PSILI AND PERISPOMENI
+>~Y <char-0x1F5E> " GREEK CAPITAL LETTER UPSILON WITH PSILI AND PERISPOMENI
+>~V <char-0x1F6E> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+>~a <char-0x1F06> " GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+>~e <char-0x1F16> " GREEK SMALL LETTER EPSILON WITH PSILI AND PERISPOMENI
+>~h <char-0x1F26> " GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+>~i <char-0x1F36> " GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+>~o <char-0x1F46> " GREEK SMALL LETTER OMICRON WITH PSILI AND PERISPOMENI
+>~y <char-0x1F56> " GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+>~v <char-0x1F66> " GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+"
+" Letters with Dasia and Perispomeni:
+"
+<~A <char-0x1F0F> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<~E <char-0x1F1F> " GREEK CAPITAL LETTER EPSILON WITH DASIA AND PERISPOMENI
+<~H <char-0x1F2F> " GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<~I <char-0x1F3F> " GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<~O <char-0x1F4F> " GREEK CAPITAL LETTER OMICRON WITH DASIA AND PERISPOMENI
+<~Y <char-0x1F5F> " GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<~V <char-0x1F6F> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<~a <char-0x1F07> " GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<~e <char-0x1F17> " GREEK SMALL LETTER EPSILON WITH DASIA AND PERISPOMENI
+<~h <char-0x1F27> " GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<~i <char-0x1F37> " GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<~o <char-0x1F47> " GREEK SMALL LETTER OMICRON WITH DASIA AND PERISPOMENI
+<~y <char-0x1F57> " GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<~v <char-0x1F67> " GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+"
+"
+"
+" letters with Ypogegrammeni/Prosgegrammeni:
+"
+A| <char-0x1FBC> " GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+H| <char-0x1FCC> " GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+V| <char-0x1FFC> " GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+a| <char-0x1FB3> " GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+h| <char-0x1FC3> " GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+v| <char-0x1FF3> " GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+"
+"
+" This area covers 0x1F80-0x1FAF
+"
+" letters with Psili and Ypogegrammeni/Prosgegrammeni:
+"
+>A| <char-0x1F88> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND
+ " PROSGEGRAMMENI
+>H| <char-0x1F98> " GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+>V| <char-0x1FA8> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND
+ " PROSGEGRAMMENI
+>a| <char-0x1F80> " GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+>h| <char-0x1F90> " GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+>v| <char-0x1FA0> " GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+"
+" letters with Dasia and Ypogegrammeni/Prosgegrammeni:
+"
+<A| <char-0x1F89> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND
+ " PROSGEGRAMMENI
+<H| <char-0x1F99> " GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<V| <char-0x1FA9> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND
+ " PROSGEGRAMMENI
+<a| <char-0x1F81> " GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<h| <char-0x1F91> " GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<v| <char-0x1FA1> " GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+"
+" letters with Psili and Varia and Ypogegrammeni/Prosgegrammeni:
+"
+>`A| <char-0x1F8A> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND
+ " PROSGEGRAMMENI
+>`H| <char-0x1F9A> " GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND
+ " PROSGEGRAMMENI
+>`V| <char-0x1FAA> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND
+ " PROSGEGRAMMENI
+>`a| <char-0x1F82> " GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND
+ " YPOGEGRAMMENI
+>`h| <char-0x1F92> " GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND
+ " YPOGEGRAMMENI
+>`v| <char-0x1FA2> " GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND
+ " YPOGEGRAMMENI
+"
+" letters with Dasia and Varia and Ypogegrammeni/Prosgegrammeni:
+"
+<`A| <char-0x1F8B> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND
+ " PROSGEGRAMMENI
+<`H| <char-0x1F9B> " GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND
+ " PROSGEGRAMMENI
+<`V| <char-0x1FAB> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND
+ " PROSGEGRAMMENI
+<`a| <char-0x1F83> " GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND
+ " YPOGEGRAMMENI
+<`h| <char-0x1F93> " GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND
+ " YPOGEGRAMMENI
+<`v| <char-0x1FA3> " GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND
+ " YPOGEGRAMMENI
+"
+" letters with Psili and Oxia and Ypogegrammeni/Prosgegrammeni:
+"
+>;A| <char-0x1F8C> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND
+ " PROSGEGRAMMENI
+>;H| <char-0x1F9C> " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND
+ " PROSGEGRAMMENI
+>;V| <char-0x1FAC> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND
+ " PROSGEGRAMMENI
+>;a| <char-0x1F84> " GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND
+ " YPOGEGRAMMENI
+>;h| <char-0x1F94> " GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND
+ " YPOGEGRAMMENI
+>;v| <char-0x1FA4> " GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND
+ " YPOGEGRAMMENI
+"
+" letters with Dasia and Oxia and Ypogegrammeni/Prosgegrammeni:
+"
+<;A| <char-0x1F8D> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND
+ " PROSGEGRAMMENI
+<;H| <char-0x1F9D> " GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND
+ " PROSGEGRAMMENI
+<;V| <char-0x1FAD> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND
+ " PROSGEGRAMMENI
+<;a| <char-0x1F85> " GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND
+ " YPOGEGRAMMENI
+<;h| <char-0x1F95> " GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND
+ " YPOGEGRAMMENI
+<;v| <char-0x1FA5> " GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND
+ " YPOGEGRAMMENI
+"
+" letters with Psili and Perispomeni and Ypogegrammeni/Prosgegrammeni:
+"
+>~A| <char-0x1F8E> " GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+ " AND PROSGEGRAMMENI
+>~H| <char-0x1F9E> " GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+ " PERISPOMENI PROSGEGRAMMENI
+>~V| <char-0x1FAE> " GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+ " AND PROSGEGRAMMENI
+>~a| <char-0x1F86> " GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+ " AND YPOGEGRAMMENI
+>~h| <char-0x1F96> " GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND
+ " YPOGEGRAMMENI
+>~v| <char-0x1FA6> " GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+ " AND YPOGEGRAMMENI
+"
+" letters with Dasia and Perispomeni and Ypogegrammeni/Prosgegrammeni:
+"
+<~A| <char-0x1F8F> " GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+ " AND PROSGEGRAMMENI
+<~H| <char-0x1F9F> " GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+ " AND PROSGEGRAMMENI
+<~V| <char-0x1FAF> " GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+ " AND PROSGEGRAMMENI
+<~a| <char-0x1F87> " GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+ " AND YPOGEGRAMMENI
+<~h| <char-0x1F97> " GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND
+ " YPOGEGRAMMENI
+<~v| <char-0x1FA7> " GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+ " AND YPOGEGRAMMENI
+"
+" letters with Perispomeni:
+"
+~a <char-0x1FB6> " GREEK SMALL LETTER ALPHA WITH PERISPOMENI
+~h <char-0x1FC6> " GREEK SMALL LETTER ETA WITH PERISPOMENI
+~i <char-0x1FD6> " GREEK SMALL LETTER IOTA WITH PERISPOMENI
+~y <char-0x1FE6> " GREEK SMALL LETTER UPSILON WITH PERISPOMENI
+~v <char-0x1FF6> " GREEK SMALL LETTER OMEGA WITH PERISPOMENI
+"
+" letters with Perispomeni and Ypogegrammeni:
+"
+~a| <char-0x1FB7> " GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND
+ " YPOGEGRAMMENI
+~h| <char-0x1FC7> " GREEK SMALL LETTER ETA WITH PERISPOMENI AND
+ " YPOGEGRAMMENI
+~v| <char-0x1FF7> " GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND
+ " YPOGEGRAMMENI
+"
+"
+" letters with Varia and Ypogegrammeni:
+"
+`a| <char-0x1FB2> " GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+`h| <char-0x1FC2> " GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+`v| <char-0x1FF2> " GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+"
+" letters with Oxia and Ypogegrammeni:
+"
+;a| <char-0x1FB4> " GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+;h| <char-0x1FC4> " GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+;v| <char-0x1FF4> " GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+"
+"
+" Combining/Nonspacing comma above (0x0313) instead of Psili:
+"
+>, <char-0x0313> " COMBINING COMMA ABOVE
+"
+" Combining/Nonspacing reversed comma above (0x0314) instead of Dasia:
+"
+<, <char-0x0314> " COMBINING REVERSED COMMA ABOVE
+"
+"
+" Greek Quotes if your keyboard supports them
+´ <char-0x201C> " QUOTEDBLLEFT
+ª <char-0x201D> " QUOTEDBLRIGHT
+"
+"
+"
+
+
+" APPENDIX A - Additional characters
+"
+"
+;# <char-0x0374> " GREEK NUMERAL SIGN
+;## <char-0x0375> " GREEK LOWER NUMERAL SIGN
+|| <char-0x037A> " GREEK YPOGEGRAMMENI
+;b <char-0x03D0> " GREEK BETA SYMBOL
+;u <char-0x03D1> " GREEK THETA SYMBOL
+" <char-0x03D2> " GREEK UPSILON WITH HOOK SYMBOL
+" <char-0x03D3> " GREEK UPSILON WITH ACUTE AND HOOK SYMBOL
+" <char-0x03D4> " GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
+;f <char-0x03D5> " GREEK PHI SYMBOL
+;p <char-0x03D6> " GREEK PI SYMBOL
+#ST <char-0x03DA> " GREEK LETTER STIGMA
+#G <char-0x03DC> " GREEK LETTER DIGAMMA
+#Q <char-0x03DE> " GREEK LETTER KOPPA
+#SP <char-0x03E0> " GREEK LETTER SAMPI
+;k <char-0x03F0> " GREEK KAPPA SYMBOL
+;r <char-0x03F1> " GREEK RHO SYMBOL
+" <char-0x03F2> " GREEK LUNATE SIGMA SYMBOL
+" <char-0x03F3> " GREEK LETTER YOT
+
+:~ <char-0x1FC1> "dialytika peripswmevn
+~: <char-0x1FC1> "dialytika peripswmevn
+
+:~i <char-0x1FD7> "iota dialytika perispomeni
+~:i <char-0x1FD7> "iota dialytika perispomeni
+
+:~y <char-0x1FE7> "upsilon dialytika perispomeni
+~:y <char-0x1FE7> "upsilon dialytika perispomeni
+
+-a <char-0x1FB1> "alpha macron
+-i <char-0x1FD1> "iota macron
+-y <char-0x1FE1> "upsilon macron
+-A <char-0x1FB9> "Alpha macron
+-I <char-0x1FD9> "Iota macron
+-Y <char-0x1FE9> "Upsilon macron
+^a <char-0x1FB0> "alpha braxy
+^i <char-0x1FD0> "iota braxy
+^y <char-0x1FE0> "upsilon braxy
+^A <char-0x1FB8> "alpha braxy
+^I <char-0x1FD8> "iota braxy
+^Y <char-0x1FE8> "upsilon braxy
+>r <char-0x1FE4> "rho psili
+<r <char-0x1FE5> "rho dasia
+
+<R <char-0x1FEC> "Rho dasia
+
+" More Symbols
+&& <char-0x03D7> "Greek kai
+D$ <char-0x20AF> "Drachma symbol
+#Q <char-0x03D8> "Archaic Qoppa
+#q <char-0x03D9> "Archaic qoppa
+;U <char-0x03F4> "Capital Theta symbol
+"!e <char-0x03F5> "Lunate epsilon
+"!E <char-0x03F6> "Lunate Epsilon
diff --git a/runtime/keymap/hebrew.vim b/runtime/keymap/hebrew.vim
new file mode 100644
index 000000000..0928fca48
--- /dev/null
+++ b/runtime/keymap/hebrew.vim
@@ -0,0 +1,16 @@
+let encoding = &enc
+if encoding == 'latin1'
+ if has("unix")
+ let encoding = 'iso-8859-8'
+ else
+ let encoding = 'cp1255'
+ endif
+endif
+
+if encoding == 'utf-8'
+ source <sfile>:p:h/hebrew_utf-8.vim
+elseif encoding == 'cp1255'
+ source <sfile>:p:h/hebrew_cp1255.vim
+else
+ source <sfile>:p:h/hebrew_iso-8859-8.vim
+endif
diff --git a/runtime/keymap/hebrew_cp1255.vim b/runtime/keymap/hebrew_cp1255.vim
new file mode 100644
index 000000000..67a8ca773
--- /dev/null
+++ b/runtime/keymap/hebrew_cp1255.vim
@@ -0,0 +1,62 @@
+" add in the vowel points, known as 'niqud', which are present in
+" CP1255: Note: there are several 'standards' for placement of the vowel
+" points, and I ignored all of them. Since we can input English by simply
+" pressing Ctrl-^ and eliminating this map, I saw no reason to try to use
+" exotic key locations. If you don't like it, that's just too bad :-)
+let b:keymap_name = "heb"
+loadkeymap
+a <char-249> " ש - shin
+b <char-240> " ×  - nun
+c <char-225> " ב - bet
+d <char-226> " ×’ - gimel
+e <char-247> " ק - qof
+f <char-235> " ×› - kaf
+g <char-242> " ×¢ - ayin
+h <char-233> " ×™ - yod
+i <char-239> " ן - final nun
+j <char-231> " ×— - het
+k <char-236> " ל - lamed
+l <char-234> " ך - final kaf
+m <char-246> " צ - tsadi
+n <char-238> " מ - mem
+o <char-237> " × - final mem
+p <char-244> " פ - pe
+q / " / - slash
+r <char-248> " ר - resh
+s <char-227> " ד - dalet
+t <char-224> " × - alef
+u <char-229> " ו - vav
+v <char-228> " ×” - he
+w ' " ' - single-quote
+x <char-241> " ס - samekh
+y <char-232> " ט - tet
+z <char-230> " ×– - zayin
+, <char-250> " ת - tav
+. <char-245> " ×¥ - final tsadi
+; <char-243> " ×£ - final pe
+' , " , - comma
+/ . " . - period
+` ; " ; - semicolon
+" vowels:
+A: <Char-192> " sheva
+HE <Char-193> " hataf segol
+HA <Char-194> " hataf patah
+HO <Char-195> " hataf qamats
+I <Char-196> " hiriq
+AY <Char-197> " tsere
+E <Char-198> " segol
+AA <Char-199> " patah
+AO <Char-200> " qamats
+O <Char-201> " holam
+U <Char-203> " qubuts
+D <Char-204> " dagesh
+]T <Char-205> " meteg
+]Q <Char-206> " maqaf
+]R <Ö¼Char-207> " rafe
+]p <Char-208> " paseq
+SR <Char-209> " shin-dot
+SL <Char-210> " sin-dot
+]P <Char-211> " sof-pasuq
+VV <Char-212> " double-vav
+VY <Char-213> " vav-yod
+YY <Char-214> " yod-yod
diff --git a/runtime/keymap/hebrew_iso-8859-8.vim b/runtime/keymap/hebrew_iso-8859-8.vim
new file mode 100644
index 000000000..eab3084d5
--- /dev/null
+++ b/runtime/keymap/hebrew_iso-8859-8.vim
@@ -0,0 +1,41 @@
+" Vim Keymap file for hebrew
+" Maintainer : Ron Aaron <ron@ronware.org>
+" Last Updated: Wed 28 Feb 2001 21:28:51
+" This is the standard Israeli keyboard layout
+
+" Use this short name in the status line.
+let b:keymap_name = "heb"
+
+loadkeymap
+a <char-249> " ù - shin
+b <char-240> " ð - nun
+c <char-225> " á - bet
+d <char-226> " â - gimel
+e <char-247> " ÷ - qof
+f <char-235> " ë - kaf
+g <char-242> " ò - ayin
+h <char-233> " é - yod
+i <char-239> " ï - final nun
+j <char-231> " ç - het
+k <char-236> " ì - lamed
+l <char-234> " ê - final kaf
+m <char-246> " ö - tsadi
+n <char-238> " î - mem
+o <char-237> " í - final mem
+p <char-244> " ô - pe
+q / " / - slash
+r <char-248> " ø - resh
+s <char-227> " ã - dalet
+t <char-224> " à - alef
+u <char-229> " å - vav
+v <char-228> " ä - he
+w ' " ' - single-quote
+x <char-241> " ñ - samekh
+y <char-232> " è - tet
+z <char-230> " æ - zayin
+, <char-250> " ú - tav
+. <char-245> " õ - final tsadi
+; <char-243> " ó - final pe
+' , " , - comma
+/ . " . - period
+` ; " ; - semicolon
diff --git a/runtime/keymap/hebrew_utf-8.vim b/runtime/keymap/hebrew_utf-8.vim
new file mode 100644
index 000000000..63438845a
--- /dev/null
+++ b/runtime/keymap/hebrew_utf-8.vim
@@ -0,0 +1,128 @@
+" Vim Keymap file for hebrew
+" Maintainer : Ron Aaron <ron@ronware.org>
+" Last Updated: Wed 28 Feb 2001 21:28:51
+" This is the standard Israeli keyboard layout with (my nonstandard locations
+" for) niqud, for utf:
+
+" Use this short name in the status line.
+let b:keymap_name = "heb"
+loadkeymap
+a <char-0x5e9> " ש - shin
+b <char-0x5e0> " ×  - nun
+c <char-0x5d1> " ב - bet
+d <char-0x5d2> " ×’ - gimel
+e <char-0x5e7> " ק - qof
+f <char-0x5db> " ×› - kaf
+g <char-0x5e2> " ×¢ - ayin
+h <char-0x5d9> " ×™ - yod
+i <char-0x5df> " ן - final nun
+j <char-0x5d7> " ×— - het
+k <char-0x5dc> " ל - lamed
+l <char-0x5da> " ך - final kaf
+m <char-0x5e6> " צ - tsadi
+n <char-0x5de> " מ - mem
+o <char-0x5dd> " × - final mem
+p <char-0x5e4> " פ - pe
+q / " / - slash
+r <char-0x5e8> " ר - resh
+s <char-0x5d3> " ד - dalet
+t <char-0x5d0> " × - alef
+u <char-0x5d5> " ו - vav
+v <char-0x5d4> " ×” - he
+w ' " ' - single-quote
+x <char-0x5e1> " ס - samekh
+y <char-0x5d8> " ט - tet
+z <char-0x5d6> " ×– - zayin
+, <char-0x5ea> " ת - tav
+. <char-0x5e5> " ×¥ - final tsadi
+; <char-0x5e3> " ×£ - final pe
+' , " , - comma
+/ . " . - period
+` ; " ; - semicolon
+A: <Char-0x5b0> " sheva
+HE <Char-0x5b1> " hataf segol
+HA <Char-0x5b2> " hataf patah
+HO <Char-0x5b3> " hataf qamats
+I <Char-0x5b4> " hiriq
+AY <Char-0x5b5> " tsere
+E <Char-0x5b6> " segol
+AA <Char-0x5b7> " patah
+AO <Char-0x5b8> " qamats
+O <Char-0x5b9> " holam
+U <Char-0x5bb> " qubuts
+D <Char-0x5bc> " dagesh
+]T <Char-0x5bd> " meteg
+]Q <Char-0x5be> " maqaf
+]R <Char-0x5bf> " rafe
+]p <Char-0x5c0> " paseq
+SR <Char-0x5c1> " shin-dot
+SL <Char-0x5c2> " sin-dot
+]P <Char-0x5c3> " sof-pasuq
+VV <Char-0x5f0> " double-vav
+VY <Char-0x5f1> " vav-yod
+YY <Char-0x5f2> " yod-yod
+" cantillation:
+C: <Char-0x591> " etnahta
+Cs <Char-0x592> " segol
+CS <Char-0x593> " shalshelet
+Cz <Char-0x594> " zaqef qatan
+CZ <Char-0x595> " zaqef gadol
+Ct <Char-0x596> " tipeha
+Cr <Char-0x597> " revia
+Cq <Char-0x598> " zarqa
+Cp <Char-0x599> " pashta
+C! <Char-0x59a> " yetiv
+Cv <Char-0x59b> " tevir
+Cg <Char-0x59c> " geresh
+C* <Char-0x59d> " geresh qadim
+CG <Char-0x59e> " gershayim
+CP <Char-0x59f> " qarnei-parah
+Cy <Char-0x5aa> " yerach-ben-yomo
+Co <Char-0x5ab> " ole
+Ci <Char-0x5ac> " iluy
+Cd <Char-0x5ad> " dehi
+Cn <Char-0x5ae> " zinor
+CC <Char-0x5af> " masora circle
+X` <Char-0xfb20> " Alternative `ayin
+X' <Char-0xfb21> " Alternative 'alef
+X-d <Char-0xfb22> " Alternative dalet
+X-h <Char-0xfb23> " Alternative he
+X-k <Char-0xfb24> " Alternative kaf
+X-l <Char-0xfb25> " Alternative lamed
+X-m <Char-0xfb26> " Alternative mem-sofit
+X-r <Char-0xfb27> " Alternative resh
+X-t <Char-0xfb28> " Alternative tav
+X-+ <Char-0xfb29> " Alternative plus
+XW <Char-0xfb2a> " shin+shin-dot
+Xw <Char-0xfb2b> " shin+sin-dot
+X..W <Char-0xfb2c> " shin+shin-dot+dagesh
+X..w <Char-0xfb2d> " shin+sin-dot+dagesh
+XA <Char-0xfb2e> " alef+patah
+XO <Char-0xfb2f> " alef+qamats
+XI <Char-0xfb30> " alef+hiriq (mapiq)
+X.b <Char-0xfb31> " bet+dagesh
+X.g <Char-0xfb32> " gimel+dagesh
+X.d <Char-0xfb33> " dalet+dagesh
+X.h <Char-0xfb34> " he+dagesh
+Xu <Char-0xfb35> " vav+dagesh
+X.z <Char-0xfb36> " zayin+dagesh
+X.T <Char-0xfb38> " tet+dagesh
+X.y <Char-0xfb39> " yud+dagesh
+X.K <Char-0xfb3a> " kaf sofit+dagesh
+X.k <Char-0xfb3b> " kaf+dagesh
+X.l <Char-0xfb3c> " lamed+dagesh
+X.m <Char-0xfb3e> " mem+dagesh
+X.n <Char-0xfb40> " nun+dagesh
+X.s <Char-0xfb41> " samech+dagesh
+X.P <Char-0xfb43> " pe sofit+dagesh
+X.p <Char-0xfb44> " pe+dagesh
+X.x <Char-0xfb46> " tsadi+dagesh
+X.q <Char-0xfb47> " qof+dagesh
+X.r <Char-0xfb48> " resh+dagesh
+X.w <Char-0xfb49> " shin+dagesh
+X.t <Char-0xfb4a> " tav+dagesh
+Xo <Char-0xfb4b> " vav+holam
+XRb <Char-0xfb4c> " bet+rafe
+XRk <Char-0xfb4d> " kaf+rafe
+XRp <Char-0xfb4e> " pe+rafe
+Xal <Char-0xfb4f> " alef-lamed
diff --git a/runtime/keymap/hebrewp.vim b/runtime/keymap/hebrewp.vim
new file mode 100644
index 000000000..a87cdc735
--- /dev/null
+++ b/runtime/keymap/hebrewp.vim
@@ -0,0 +1,16 @@
+let encoding = &enc
+if encoding == 'latin1'
+ if has("unix")
+ let encoding = 'iso-8859-8'
+ else
+ let encoding = 'cp1255'
+ endif
+endif
+
+if encoding == 'utf-8'
+ source <sfile>:p:h/hebrewp_utf-8.vim
+elseif encoding == 'cp1255'
+ source <sfile>:p:h/hebrewp_cp1255.vim
+else
+ source <sfile>:p:h/hebrewp_iso-8859-8.vim
+endif
diff --git a/runtime/keymap/hebrewp_cp1255.vim b/runtime/keymap/hebrewp_cp1255.vim
new file mode 100644
index 000000000..990f90859
--- /dev/null
+++ b/runtime/keymap/hebrewp_cp1255.vim
@@ -0,0 +1,58 @@
+" codepage 1255 on Windows is equal to ISO 8859-8 but it
+" adds in the vowel points, known as 'niqud', which are present in
+" CP1255: Note: there are several 'standards' for placement of the vowel
+" points, and I ignored all of them. Since we can input English by simply
+" pressing Ctrl-^ and eliminating this map, I saw no reason to try to use
+" exotic key locations. If you don't like it, that's just too bad :-)
+let b:keymap_name = "hebp"
+loadkeymap
+K <char-234> " final kaf
+M <char-237> " final mem
+N <char-239> " final nun
+P <char-243> " final pe
+T <char-232> " tet
+X <char-245> " final tsadi
+a <char-224> " alef
+b <char-225> " bet
+d <char-227> " dalet
+g <char-226> " gimel
+h <char-228> " he
+j <char-231> " het
+k <char-235> " kaf
+l <char-236> " lamed
+m <char-238> " mem
+n <char-240> " nun
+s <char-241> " samekh
+p <char-244> " pe
+q <char-247> " qof
+r <char-248> " resh
+t <char-250> " tav
+u <char-242> " ayin
+v <char-229> " vav
+w <char-249> " shin
+x <char-246> " tsadi
+y <char-233> " yod
+z <char-230> " zayin
+" vowels:
+A: <Char-192> " sheva
+HE <Char-193> " hataf segol
+HA <Char-194> " hataf patah
+HO <Char-195> " hataf qamats
+I <Char-196> " hiriq
+AY <Char-197> " tsere
+E <Char-198> " segol
+AA <Char-199> " patah
+AO <Char-200> " qamats
+O <Char-201> " holam
+U <Char-203> " qubuts
+D <Char-204> " dagesh
+]T <Char-205> " meteg
+]Q <Char-206> " maqaf
+]R <ÌChar-207> " rafe
+]p <Char-208> " paseq
+SR <Char-209> " shin-dot
+SL <Char-210> " sin-dot
+]P <Char-211> " sof-pasuq
+VV <Char-212> " double-vav
+VY <Char-213> " vav-yod
+YY <Char-214> " yod-yod
diff --git a/runtime/keymap/hebrewp_iso-8859-8.vim b/runtime/keymap/hebrewp_iso-8859-8.vim
new file mode 100644
index 000000000..d4b9714d2
--- /dev/null
+++ b/runtime/keymap/hebrewp_iso-8859-8.vim
@@ -0,0 +1,36 @@
+" Vim Keymap file for hebrew
+" Maintainer : Ron Aaron <ron@ronware.org>
+" Last Updated: Sun 10 Feb 2002 11:50:56
+" This is my version of a phonetic Hebrew
+
+" Use this short name in the status line.
+let b:keymap_name = "hebp"
+
+loadkeymap
+K <char-234> " final kaf
+M <char-237> " final mem
+N <char-239> " final nun
+P <char-243> " final pe
+T <char-232> " tet
+X <char-245> " final tsadi
+a <char-224> " alef
+b <char-225> " bet
+d <char-227> " dalet
+g <char-226> " gimel
+h <char-228> " he
+j <char-231> " het
+k <char-235> " kaf
+l <char-236> " lamed
+m <char-238> " mem
+n <char-240> " nun
+s <char-241> " samekh
+p <char-244> " pe
+q <char-247> " qof
+r <char-248> " resh
+t <char-250> " tav
+u <char-242> " ayin
+v <char-229> " vav
+w <char-249> " shin
+x <char-246> " tsadi
+y <char-233> " yod
+z <char-230> " zayin
diff --git a/runtime/keymap/hebrewp_utf-8.vim b/runtime/keymap/hebrewp_utf-8.vim
new file mode 100644
index 000000000..dded60e36
--- /dev/null
+++ b/runtime/keymap/hebrewp_utf-8.vim
@@ -0,0 +1,122 @@
+" Vim Keymap file for hebrew
+" Maintainer : Ron Aaron <ron@ronware.org>
+" Last Updated: Thu 08 Mar 2001 13:49:01
+" This is my version of a phonetic Hebrew
+
+" Use this short name in the status line.
+let b:keymap_name = "hebp"
+loadkeymap
+w <char-0x5e9> " ù - shin
+n <char-0x5e0> " ð - nun
+b <char-0x5d1> " á - bet
+g <char-0x5d2> " â - gimel
+q <char-0x5e7> " ÷ - qof
+k <char-0x5db> " ë - kaf
+g <char-0x5e2> " ò - ayin
+y <char-0x5d9> " é - yod
+N <char-0x5df> " ï - final nun
+j <char-0x5d7> " ç - het
+l <char-0x5dc> " ì - lamed
+K <char-0x5da> " ê - final kaf
+x <char-0x5e6> " ö - tsadi
+m <char-0x5de> " î - mem
+M <char-0x5dd> " í - final mem
+p <char-0x5e4> " ô - pe
+r <char-0x5e8> " ø - resh
+d <char-0x5d3> " ã - dalet
+a <char-0x5d0> " à - alef
+v <char-0x5d5> " å - vav
+h <char-0x5d4> " ä - he
+s <char-0x5e1> " ñ - samekh
+T <char-0x5d8> " è - tet
+z <char-0x5d6> " æ - zayin
+t <char-0x5ea> " ú - tav
+X <char-0x5e5> " õ - final tsadi
+P <char-0x5e3> " ó - final pe
+A: <Char-0x5b0> " sheva
+HE <Char-0x5b1> " hataf segol
+HA <Char-0x5b2> " hataf patah
+HO <Char-0x5b3> " hataf qamats
+I <Char-0x5b4> " hiriq
+AY <Char-0x5b5> " tsere
+E <Char-0x5b6> " segol
+AA <Char-0x5b7> " patah
+AO <Char-0x5b8> " qamats
+O <Char-0x5b9> " holam
+U <Char-0x5bb> " qubuts
+D <Char-0x5bc> " dagesh
+]T <Char-0x5bd> " meteg
+]Q <Char-0x5be> " maqaf
+]R <ÌChar-0x5bf> " rafe
+]p <Char-0x5c0> " paseq
+SR <Char-0x5c1> " shin-dot
+SL <Char-0x5c2> " sin-dot
+]P <Char-0x5c3> " sof-pasuq
+VV <Char-0x5f0> " double-vav
+VY <Char-0x5f1> " vav-yod
+YY <Char-0x5f2> " yod-yod
+" cantillation:
+C: <Char-0x591> " etnahta
+Cs <Char-0x592> " segol
+CS <Char-0x593> " shalshelet
+Cz <Char-0x594> " zaqef qatan
+CZ <Char-0x595> " zaqef gadol
+Ct <Char-0x596> " tipeha
+Cr <Char-0x597> " revia
+Cq <Char-0x598> " zarqa
+Cp <Char-0x599> " pashta
+C! <Char-0x59a> " yetiv
+Cv <Char-0x59b> " tevir
+Cg <Char-0x59c> " geresh
+C* <Char-0x59d> " geresh qadim
+CG <Char-0x59e> " gershayim
+CP <Char-0x59f> " qarnei-parah
+Cy <Char-0x5aa> " yerach-ben-yomo
+Co <Char-0x5ab> " ole
+Ci <Char-0x5ac> " iluy
+Cd <Char-0x5ad> " dehi
+Cn <Char-0x5ae> " zinor
+CC <Char-0x5af> " masora circle
+X` <Char-0xfb20> " Alternative `ayin
+X' <Char-0xfb21> " Alternative 'alef
+X-d <Char-0xfb22> " Alternative dalet
+X-h <Char-0xfb23> " Alternative he
+X-k <Char-0xfb24> " Alternative kaf
+X-l <Char-0xfb25> " Alternative lamed
+X-m <Char-0xfb26> " Alternative mem-sofit
+X-r <Char-0xfb27> " Alternative resh
+X-t <Char-0xfb28> " Alternative tav
+X-+ <Char-0xfb29> " Alternative plus
+XW <Char-0xfb2a> " shin+shin-dot
+Xw <Char-0xfb2b> " shin+sin-dot
+X..W <Char-0xfb2c> " shin+shin-dot+dagesh
+X..w <Char-0xfb2d> " shin+sin-dot+dagesh
+XA <Char-0xfb2e> " alef+patah
+XO <Char-0xfb2f> " alef+qamats
+XI <Char-0xfb30> " alef+hiriq (mapiq)
+X.b <Char-0xfb31> " bet+dagesh
+X.g <Char-0xfb32> " gimel+dagesh
+X.d <Char-0xfb33> " dalet+dagesh
+X.h <Char-0xfb34> " he+dagesh
+Xu <Char-0xfb35> " vav+dagesh
+X.z <Char-0xfb36> " zayin+dagesh
+X.T <Char-0xfb38> " tet+dagesh
+X.y <Char-0xfb39> " yud+dagesh
+X.K <Char-0xfb3a> " kaf sofit+dagesh
+X.k <Char-0xfb3b> " kaf+dagesh
+X.l <Char-0xfb3c> " lamed+dagesh
+X.m <Char-0xfb3e> " mem+dagesh
+X.n <Char-0xfb40> " nun+dagesh
+X.s <Char-0xfb41> " samech+dagesh
+X.P <Char-0xfb43> " pe sofit+dagesh
+X.p <Char-0xfb44> " pe+dagesh
+X.x <Char-0xfb46> " tsadi+dagesh
+X.q <Char-0xfb47> " qof+dagesh
+X.r <Char-0xfb48> " resh+dagesh
+X.w <Char-0xfb49> " shin+dagesh
+X.t <Char-0xfb4a> " tav+dagesh
+Xo <Char-0xfb4b> " vav+holam
+XRb <Char-0xfb4c> " bet+rafe
+XRk <Char-0xfb4d> " kaf+rafe
+XRp <Char-0xfb4e> " pe+rafe
+Xal <Char-0xfb4f> " alef-lamed
diff --git a/runtime/keymap/lithuanian-baltic.vim b/runtime/keymap/lithuanian-baltic.vim
new file mode 100644
index 000000000..b888db6e7
--- /dev/null
+++ b/runtime/keymap/lithuanian-baltic.vim
@@ -0,0 +1,31 @@
+" Vim Keymap file for lithuanian characters, phonetic layout 'Baltic'
+" Useful mainly with utf-8 but may work with other encodings
+
+" Maintainer: Alex Jakushev <Alex.Jakushev@kemek.lt>
+" Last Changed: 2002 Apr 12
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+let b:keymap_name = "lt"
+
+loadkeymap
+! Ä„ LITHUANIAN CAPITAL A NOSINE
+@ Č LITHUANIAN CAPITAL CH
+# Ę LITHUANIAN CAPITAL E NOSINE
+$ Ä– LITHUANIAN CAPITAL E SU TASKU
+% Ä® LITHUANIAN CAPITAL I NOSINE
+^ Å  LITHUANIAN CAPITAL SH
+& Ų LITHUANIAN CAPITAL U NOSINE
+* Ū LITHUANIAN CAPITAL U SU BRUKSNIU
++ Ž LITHUANIAN CAPITAL ZH
+1 Ä… LITHUANIAN LOWERCASE A NOSINE
+2 Ä LITHUANIAN LOWERCASE CH
+3 Ä™ LITHUANIAN LOWERCASE E NOSINE
+4 Ä— LITHUANIAN LOWERCASE E SU TASKU
+5 į LITHUANIAN LOWERCASE I NOSINE
+6 Å¡ LITHUANIAN LOWERCASE SH
+7 ų LITHUANIAN LOWERCASE U NOSINE
+8 Å« LITHUANIAN LOWERCASE U SU BRUKSNIU
+= ž LITHUANIAN LOWERCASE ZH
diff --git a/runtime/keymap/magyar_utf-8.vim b/runtime/keymap/magyar_utf-8.vim
new file mode 100644
index 000000000..729771768
--- /dev/null
+++ b/runtime/keymap/magyar_utf-8.vim
@@ -0,0 +1,37 @@
+" Maintainer: Laszlo Zavaleta <zavaleta@smartchat.net.au>
+" Last Changed: 2003 Aug 08
+" it has all the accents and a few of the character alterations
+
+let b:keymap = "magyar"
+
+loadkey
+` í
+~ Ã
+! '
+@ "
+# +
+$ !
+^ /
+& =
+* (
+( )
+0 ö
+) Ö
+- ü
+_ Ü
+= ó
++ Ó
+\\ ű
+| Å°
+[ Å‘
+{ Å
+] ú
+} Ú
+; é
+: É
+' á
+\" Ã
+/ -
+< ?
+> :
+? _
diff --git a/runtime/keymap/persian-iranian_utf-8.vim b/runtime/keymap/persian-iranian_utf-8.vim
new file mode 100644
index 000000000..c4f396003
--- /dev/null
+++ b/runtime/keymap/persian-iranian_utf-8.vim
@@ -0,0 +1,115 @@
+" Vim Keymap file for Persian Standard Keyboard Layout
+" Maintainers: Behnam Esfahbod <behnam@bamdad.org>,
+" Amir Hedayaty <amir@bamdad.org>
+" Last Change: 2004 May 16
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+" Use this short name in the status line.
+let b:keymap_name = "per"
+
+loadkeymap
+` â€
+1 Û±
+2 Û²
+3 Û³
+4 Û´
+5 Ûµ
+6 Û¶
+7 Û·
+8 Û¸
+9 Û¹
+0 Û°
+- -
+= =
+
+q ض
+w ص
+e Ø«
+r Ù‚
+t Ù
+y غ
+u ع
+i Ù‡
+o Ø®
+p Ø­
+[ ج
+] Ú†
+
+a Ø´
+s س
+d ی
+f ب
+g Ù„
+h ا
+j ت
+k Ù†
+l Ù…
+; Ú©
+' Ú¯
+
+z ظ
+x Ø·
+c ز
+v ر
+b Ø°
+n د
+m Ù¾
+, Ùˆ
+. .
+/ /
+\ \
+
+~ ÷
+! !
+@ Ù¬
+# Ù«
+$ ï·¼
+% Ùª
+^ ×
+& ،
+* *
+( )
+) (
+_ Ù€
++ +
+
+Q Ù’
+W ٌ
+E Ù
+R Ù‹
+T Ù
+Y Ù
+U ÙŽ
+I Ù‘
+O ]
+P [
+{ }
+} {
+
+A ؤ
+S ئ
+D ÙŠ
+F إ
+G أ
+H آ
+J Ø©
+K »
+L «
+: :
+\" Ø›
+
+Z Ùƒ
+X Ù“
+C Ú˜
+V Ù°
+B ‌
+N Ù”
+M Ø¡
+< >
+> <
+? ØŸ
+| |
+
diff --git a/runtime/keymap/persian.vim b/runtime/keymap/persian.vim
new file mode 100644
index 000000000..7bf5cd61a
--- /dev/null
+++ b/runtime/keymap/persian.vim
@@ -0,0 +1,8 @@
+let encoding = &enc
+if encoding == ''
+ let encoding = 'utf-8'
+endif
+
+if encoding == 'utf-8'
+ source <sfile>:p:h/persian-iranian_utf-8.vim
+endif
diff --git a/runtime/keymap/pinyin.vim b/runtime/keymap/pinyin.vim
new file mode 100644
index 000000000..757850b83
--- /dev/null
+++ b/runtime/keymap/pinyin.vim
@@ -0,0 +1,54 @@
+" Vim Keymap file for Hanyu Pinyin tone marks through numbers.
+" Maintainer: Fredrik Roubert <roubert@df.lth.se>
+" Last Changed: February 15, 2004
+
+" All characters are given literally.
+scriptencoding utf-8
+
+" Use this short name in the status line.
+let b:keymap_name = "py"
+
+loadkeymap
+a0 a
+a1 Ä
+a2 á
+a3 ÇŽ
+a4 à
+a5 a
+e0 e
+e1 Ä“
+e2 é
+e3 Ä›
+e4 è
+e5 e
+i0 i
+i1 Ä«
+i2 í
+i3 Ç
+i4 ì
+i5 i
+o0 o
+o1 Å
+o2 ó
+o3 Ç’
+o4 ò
+o5 o
+u0 u
+u1 Å«
+u2 ú
+u3 Ç”
+u4 ù
+u5 u
+ü0 ü
+ü1 ǖ
+ü2 ǘ
+ü3 ǚ
+ü4 ǜ
+ü5 ü
+v0 ü
+v1 Ç–
+v2 ǘ
+v3 Çš
+v4 ǜ
+v5 ü
+
diff --git a/runtime/keymap/russian-jcuken.vim b/runtime/keymap/russian-jcuken.vim
new file mode 100644
index 000000000..840ec8c4e
--- /dev/null
+++ b/runtime/keymap/russian-jcuken.vim
@@ -0,0 +1,87 @@
+" Vim Keymap file for russian characters, layout 'jcuken', classical variant
+" (compatible with XFree86 'ru' keymap)
+" Useful mainly with utf-8 but may work with other encodings
+
+" Maintainer: Artem Chuprina <ran@ran.pp.ru>
+" Last Changed: 2001 Jun 23
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+let b:keymap_name = "ru"
+
+loadkeymap
+~ Ð CYRILLIC CAPITAL LETTER IO
+` Ñ‘ CYRILLIC SMALL LETTER IO
+F Ð CYRILLIC CAPITAL LETTER A
+< Б CYRILLIC CAPITAL LETTER BE
+D Ð’ CYRILLIC CAPITAL LETTER VE
+U Г CYRILLIC CAPITAL LETTER GHE
+L Д CYRILLIC CAPITAL LETTER DE
+T Е CYRILLIC CAPITAL LETTER IE
+: Ж CYRILLIC CAPITAL LETTER ZHE
+P З CYRILLIC CAPITAL LETTER ZE
+B И CYRILLIC CAPITAL LETTER I
+Q Й CYRILLIC CAPITAL LETTER SHORT I
+R К CYRILLIC CAPITAL LETTER KA
+K Л CYRILLIC CAPITAL LETTER EL
+V М CYRILLIC CAPITAL LETTER EM
+Y Ð CYRILLIC CAPITAL LETTER EN
+J О CYRILLIC CAPITAL LETTER O
+G П CYRILLIC CAPITAL LETTER PE
+H Р CYRILLIC CAPITAL LETTER ER
+C С CYRILLIC CAPITAL LETTER ES
+N Т CYRILLIC CAPITAL LETTER TE
+E У CYRILLIC CAPITAL LETTER U
+A Ф CYRILLIC CAPITAL LETTER EF
+{ Х CYRILLIC CAPITAL LETTER HA
+W Ц CYRILLIC CAPITAL LETTER TSE
+X Ч CYRILLIC CAPITAL LETTER CHE
+I Ш CYRILLIC CAPITAL LETTER SHA
+O Щ CYRILLIC CAPITAL LETTER SHCHA
+} Ъ CYRILLIC CAPITAL LETTER HARD SIGN
+S Ы CYRILLIC CAPITAL LETTER YERU
+M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
+\" Э CYRILLIC CAPITAL LETTER E
+> Ю CYRILLIC CAPITAL LETTER YU
+Z Я CYRILLIC CAPITAL LETTER YA
+f а CYRILLIC SMALL LETTER A
+, б CYRILLIC SMALL LETTER BE
+d в CYRILLIC SMALL LETTER VE
+u г CYRILLIC SMALL LETTER GHE
+l д CYRILLIC SMALL LETTER DE
+t е CYRILLIC SMALL LETTER IE
+; ж CYRILLIC SMALL LETTER ZHE
+p з CYRILLIC SMALL LETTER ZE
+b и CYRILLIC SMALL LETTER I
+q й CYRILLIC SMALL LETTER SHORT I
+r к CYRILLIC SMALL LETTER KA
+k л CYRILLIC SMALL LETTER EL
+v м CYRILLIC SMALL LETTER EM
+y н CYRILLIC SMALL LETTER EN
+j о CYRILLIC SMALL LETTER O
+g п CYRILLIC SMALL LETTER PE
+h р CYRILLIC SMALL LETTER ER
+c Ñ CYRILLIC SMALL LETTER ES
+n Ñ‚ CYRILLIC SMALL LETTER TE
+e у CYRILLIC SMALL LETTER U
+a Ñ„ CYRILLIC SMALL LETTER EF
+[ Ñ… CYRILLIC SMALL LETTER HA
+w ц CYRILLIC SMALL LETTER TSE
+x ч CYRILLIC SMALL LETTER CHE
+i ш CYRILLIC SMALL LETTER SHA
+o щ CYRILLIC SMALL LETTER SHCHA
+] ÑŠ CYRILLIC SMALL LETTER HARD SIGN
+s Ñ‹ CYRILLIC SMALL LETTER YERU
+m ь CYRILLIC SMALL LETTER SOFT SIGN
+' Ñ CYRILLIC SMALL LETTER E
+. ÑŽ CYRILLIC SMALL LETTER YU
+z Ñ CYRILLIC SMALL LETTER YA
+@ "
+# '
+$ *
+% :
+^ ,
+& .
+* ;
diff --git a/runtime/keymap/russian-jcukenwin.vim b/runtime/keymap/russian-jcukenwin.vim
new file mode 100644
index 000000000..d56470f11
--- /dev/null
+++ b/runtime/keymap/russian-jcukenwin.vim
@@ -0,0 +1,87 @@
+" Vim Keymap file for russian characters, layout 'jcuken', MS Windows variant
+" (slightly incompatible with XFree86 'ru' keymap - makes use of NUMERO SIGN)
+" Useful mainly with utf-8 but may work with other encodings
+
+" Maintainer: Artem Chuprina <ran@ran.pp.ru>
+" Last Changed: 2001 Jun 23
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+let b:keymap_name = "ru"
+
+loadkeymap
+~ Ð CYRILLIC CAPITAL LETTER IO
+` Ñ‘ CYRILLIC SMALL LETTER IO
+F Ð CYRILLIC CAPITAL LETTER A
+< Б CYRILLIC CAPITAL LETTER BE
+D Ð’ CYRILLIC CAPITAL LETTER VE
+U Г CYRILLIC CAPITAL LETTER GHE
+L Д CYRILLIC CAPITAL LETTER DE
+T Е CYRILLIC CAPITAL LETTER IE
+: Ж CYRILLIC CAPITAL LETTER ZHE
+P З CYRILLIC CAPITAL LETTER ZE
+B И CYRILLIC CAPITAL LETTER I
+Q Й CYRILLIC CAPITAL LETTER SHORT I
+R К CYRILLIC CAPITAL LETTER KA
+K Л CYRILLIC CAPITAL LETTER EL
+V М CYRILLIC CAPITAL LETTER EM
+Y Ð CYRILLIC CAPITAL LETTER EN
+J О CYRILLIC CAPITAL LETTER O
+G П CYRILLIC CAPITAL LETTER PE
+H Р CYRILLIC CAPITAL LETTER ER
+C С CYRILLIC CAPITAL LETTER ES
+N Т CYRILLIC CAPITAL LETTER TE
+E У CYRILLIC CAPITAL LETTER U
+A Ф CYRILLIC CAPITAL LETTER EF
+{ Х CYRILLIC CAPITAL LETTER HA
+W Ц CYRILLIC CAPITAL LETTER TSE
+X Ч CYRILLIC CAPITAL LETTER CHE
+I Ш CYRILLIC CAPITAL LETTER SHA
+O Щ CYRILLIC CAPITAL LETTER SHCHA
+} Ъ CYRILLIC CAPITAL LETTER HARD SIGN
+S Ы CYRILLIC CAPITAL LETTER YERU
+M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
+\" Э CYRILLIC CAPITAL LETTER E
+> Ю CYRILLIC CAPITAL LETTER YU
+Z Я CYRILLIC CAPITAL LETTER YA
+f а CYRILLIC SMALL LETTER A
+, б CYRILLIC SMALL LETTER BE
+d в CYRILLIC SMALL LETTER VE
+u г CYRILLIC SMALL LETTER GHE
+l д CYRILLIC SMALL LETTER DE
+t е CYRILLIC SMALL LETTER IE
+; ж CYRILLIC SMALL LETTER ZHE
+p з CYRILLIC SMALL LETTER ZE
+b и CYRILLIC SMALL LETTER I
+q й CYRILLIC SMALL LETTER SHORT I
+r к CYRILLIC SMALL LETTER KA
+k л CYRILLIC SMALL LETTER EL
+v м CYRILLIC SMALL LETTER EM
+y н CYRILLIC SMALL LETTER EN
+j о CYRILLIC SMALL LETTER O
+g п CYRILLIC SMALL LETTER PE
+h р CYRILLIC SMALL LETTER ER
+c Ñ CYRILLIC SMALL LETTER ES
+n Ñ‚ CYRILLIC SMALL LETTER TE
+e у CYRILLIC SMALL LETTER U
+a Ñ„ CYRILLIC SMALL LETTER EF
+[ Ñ… CYRILLIC SMALL LETTER HA
+w ц CYRILLIC SMALL LETTER TSE
+x ч CYRILLIC SMALL LETTER CHE
+i ш CYRILLIC SMALL LETTER SHA
+o щ CYRILLIC SMALL LETTER SHCHA
+] ÑŠ CYRILLIC SMALL LETTER HARD SIGN
+s Ñ‹ CYRILLIC SMALL LETTER YERU
+m ь CYRILLIC SMALL LETTER SOFT SIGN
+' Ñ CYRILLIC SMALL LETTER E
+. ÑŽ CYRILLIC SMALL LETTER YU
+z Ñ CYRILLIC SMALL LETTER YA
+@ "
+# â„– NUMERO SIGN
+$ ;
+^ :
+& ?
+/ .
+? ,
diff --git a/runtime/keymap/russian-yawerty.vim b/runtime/keymap/russian-yawerty.vim
new file mode 100644
index 000000000..165d7ec9b
--- /dev/null
+++ b/runtime/keymap/russian-yawerty.vim
@@ -0,0 +1,79 @@
+" Vim Keymap file for russian characters, phonetic layout 'yawerty'
+" Useful mainly with utf-8 but may work with other encodings
+
+" Maintainer: Igor Goldenberg <igold@igold.pp.ru>
+" Last Changed: 2002 Jan 14
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding utf-8
+
+let b:keymap_name = "ru"
+
+loadkeymap
+A Ð CYRILLIC CAPITAL LETTER A
+B Б CYRILLIC CAPITAL LETTER BE
+W Ð’ CYRILLIC CAPITAL LETTER VE
+G Г CYRILLIC CAPITAL LETTER GHE
+D Д CYRILLIC CAPITAL LETTER DE
+E Е CYRILLIC CAPITAL LETTER IE
+& Ð CYRILLIC CAPITAL LETTER IO
+V Ж CYRILLIC CAPITAL LETTER ZHE
+Z З CYRILLIC CAPITAL LETTER ZE
+I И CYRILLIC CAPITAL LETTER I
+J Й CYRILLIC CAPITAL LETTER SHORT I
+K К CYRILLIC CAPITAL LETTER KA
+L Л CYRILLIC CAPITAL LETTER EL
+M М CYRILLIC CAPITAL LETTER EM
+N Ð CYRILLIC CAPITAL LETTER EN
+O О CYRILLIC CAPITAL LETTER O
+P П CYRILLIC CAPITAL LETTER PE
+R Р CYRILLIC CAPITAL LETTER ER
+S С CYRILLIC CAPITAL LETTER ES
+T Т CYRILLIC CAPITAL LETTER TE
+U У CYRILLIC CAPITAL LETTER U
+F Ф CYRILLIC CAPITAL LETTER EF
+H Х CYRILLIC CAPITAL LETTER HA
+C Ц CYRILLIC CAPITAL LETTER TSE
++ Ч CYRILLIC CAPITAL LETTER CHE
+{ Ш CYRILLIC CAPITAL LETTER SHA
+} Щ CYRILLIC CAPITAL LETTER SHCHA
+$ Ъ CYRILLIC CAPITAL LETTER HARD SIGN
+Y Ы CYRILLIC CAPITAL LETTER YERU
+X Ь CYRILLIC CAPITAL LETTER SOFT SIGN
+| Э CYRILLIC CAPITAL LETTER E
+~ Ю CYRILLIC CAPITAL LETTER YU
+Q Я CYRILLIC CAPITAL LETTER YA
+a а CYRILLIC SMALL LETTER A
+b б CYRILLIC SMALL LETTER BE
+w в CYRILLIC SMALL LETTER VE
+g г CYRILLIC SMALL LETTER GHE
+d д CYRILLIC SMALL LETTER DE
+e е CYRILLIC SMALL LETTER IE
+^ Ñ‘ CYRILLIC SMALL LETTER IO
+v ж CYRILLIC SMALL LETTER ZHE
+z з CYRILLIC SMALL LETTER ZE
+i и CYRILLIC SMALL LETTER I
+j й CYRILLIC SMALL LETTER SHORT I
+k к CYRILLIC SMALL LETTER KA
+l л CYRILLIC SMALL LETTER EL
+m м CYRILLIC SMALL LETTER EM
+n н CYRILLIC SMALL LETTER EN
+o о CYRILLIC SMALL LETTER O
+p п CYRILLIC SMALL LETTER PE
+r р CYRILLIC SMALL LETTER ER
+s Ñ CYRILLIC SMALL LETTER ES
+t Ñ‚ CYRILLIC SMALL LETTER TE
+u у CYRILLIC SMALL LETTER U
+f Ñ„ CYRILLIC SMALL LETTER EF
+h Ñ… CYRILLIC SMALL LETTER HA
+c ц CYRILLIC SMALL LETTER TSE
+= ч CYRILLIC SMALL LETTER CHE
+[ ш CYRILLIC SMALL LETTER SHA
+] щ CYRILLIC SMALL LETTER SHCHA
+# ÑŠ CYRILLIC SMALL LETTER HARD SIGN
+y Ñ‹ CYRILLIC SMALL LETTER YERU
+x ь CYRILLIC SMALL LETTER SOFT SIGN
+\\ Ñ CYRILLIC SMALL LETTER E
+` ÑŽ CYRILLIC SMALL LETTER YU
+q Ñ CYRILLIC SMALL LETTER YA
diff --git a/runtime/keymap/serbian-latin.vim b/runtime/keymap/serbian-latin.vim
new file mode 100644
index 000000000..0d2de15d0
--- /dev/null
+++ b/runtime/keymap/serbian-latin.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/serbian-latin_utf-8.vim
diff --git a/runtime/keymap/serbian-latin_utf-8.vim b/runtime/keymap/serbian-latin_utf-8.vim
new file mode 100644
index 000000000..a1b577a11
--- /dev/null
+++ b/runtime/keymap/serbian-latin_utf-8.vim
@@ -0,0 +1,44 @@
+" Vim Keymap file for Serbian characters, classical variant, UTF-8 encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://www.cs.cmu.edu/~aleksa/personal/vim/keymap/serbian-latin-UTF-8.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding UTF-8
+
+let b:keymap_name = "serbian-UTF-8"
+
+loadkeymap
+Y Z
+{ Å 
+} Ä
+y z
+[ Å¡
+] Ä‘
+: Č
+\" Ć
+\| Ž
+; Ä
+' ć
+\\ ž
+"Z Y
+"z y
+< ;
+> :
+/ -
+_ ?
+,, „
+'' â€
+
+E$ <char-0x20AC> " EURO SIGN
+-- <char-0x2013> " endash
+--- <char-0x2014> " emdash
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" &amp; .
+" * ;
+
diff --git a/runtime/keymap/serbian.vim b/runtime/keymap/serbian.vim
new file mode 100644
index 000000000..56d247cf4
--- /dev/null
+++ b/runtime/keymap/serbian.vim
@@ -0,0 +1,20 @@
+let encoding = &enc
+if encoding == 'latin1'
+ if has("unix")
+ let encoding = 'iso-8859-2'
+ else
+ let encoding = 'cp1250'
+ endif
+endif
+
+if encoding == 'utf-8'
+ source <sfile>:p:h/serbian_utf-8.vim
+elseif encoding == 'cp1250'
+ source <sfile>:p:h/serbian_cp1250.vim
+elseif encoding == 'cp1251'
+ source <sfile>:p:h/serbian_cp1251.vim
+elseif encoding == 'iso-8859-2'
+ source <sfile>:p:h/serbian_iso-8859-2.vim
+else
+ source <sfile>:p:h/serbian_iso-8859-5.vim
+endif
diff --git a/runtime/keymap/serbian_cp1250.vim b/runtime/keymap/serbian_cp1250.vim
new file mode 100644
index 000000000..30f80adf9
--- /dev/null
+++ b/runtime/keymap/serbian_cp1250.vim
@@ -0,0 +1,40 @@
+" Vim Keymap file for Serbian characters, classical variant, cp1250 encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://galeb.etf.bg.ac.yu/~alexa/vim/keymap/serbian-cp1250.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding cp1250
+
+let b:keymap_name = "serbian-cp1250"
+
+loadkeymap
+Y Z
+{ Š
+} Ð
+y z
+[ š
+] ð
+: È
+\" Æ
+\| Ž
+; è
+' æ
+\\ ž
+"Z Y
+"z y
+< ;
+> :
+/ -
+_ ?
+,, „
+'' ”
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" &amp; .
+" * ;
+
diff --git a/runtime/keymap/serbian_cp1251.vim b/runtime/keymap/serbian_cp1251.vim
new file mode 100644
index 000000000..0b1ce96ff
--- /dev/null
+++ b/runtime/keymap/serbian_cp1251.vim
@@ -0,0 +1,90 @@
+" Vim Keymap file for Serbian characters, classical variant, win cp1251
+" encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://www.cs.cmu.edu/~aleksa/personal/vim/keymap/serbian-cp1251.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding cp1251
+
+let b:keymap_name = "serbian-cp1251"
+
+loadkeymap
+Q Š
+W Œ
+E Å
+R Ð
+T Ò
+Y Ç
+U Ó
+I È
+O Î
+P Ï
+{ Ø
+} €
+q š
+w œ
+e å
+r ð
+t ò
+y ç
+u ó
+i è
+o î
+p ï
+[ ø
+]
+A À
+S Ñ
+D Ä
+F Ô
+G Ã
+H Õ
+J £
+K Ê
+L Ë
+: ×
+\" Ž
+\| Æ
+a à
+s ñ
+d ä
+f ô
+g ã
+h õ
+j ¼
+k ê
+l ë
+; ÷
+' ž
+\\ æ
+"Z Ç
+X
+C Ö
+V Â
+B Á
+N Í
+M Ì
+"z ç
+x Ÿ
+c ö
+v â
+b á
+n í
+m ì
+
+< ;
+> :
+/ -
+_ ?
+,, „
+'' ”
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" &amp; .
+" * ;
+
diff --git a/runtime/keymap/serbian_iso-8859-2.vim b/runtime/keymap/serbian_iso-8859-2.vim
new file mode 100644
index 000000000..d3be35eec
--- /dev/null
+++ b/runtime/keymap/serbian_iso-8859-2.vim
@@ -0,0 +1,40 @@
+" Vim Keymap file for Serbian characters, classical variant, iso-8859-2 encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://www.cs.cmu.edu/~aleksa/personal/vim/keymap/serbian-iso-8859-2.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding iso-8859-2
+
+let b:keymap_name = "serbian-iso-8859-2"
+
+loadkeymap
+Y Z
+{ ©
+} Ð
+y z
+[ ¹
+] ð
+: È
+\" Æ
+\| ®
+; è
+' æ
+\\ ¾
+"Z Y
+"z y
+< ;
+> :
+/ -
+_ ?
+,, ?
+'' ?
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" &amp; .
+" * ;
+
diff --git a/runtime/keymap/serbian_iso-8859-5.vim b/runtime/keymap/serbian_iso-8859-5.vim
new file mode 100644
index 000000000..113383cdf
--- /dev/null
+++ b/runtime/keymap/serbian_iso-8859-5.vim
@@ -0,0 +1,89 @@
+" Vim Keymap file for Serbian characters, classical variant, iso-8859-5 encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://www.cs.cmu.edu/~aleksa/personal/vim/keymap/serbian-iso-8859-5.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding iso-8859-5
+
+let b:keymap_name = "serbian-iso-8859-5"
+
+loadkeymap
+Q ©
+W ª
+E µ
+R À
+T Â
+Y ·
+U Ã
+I ¸
+O ¾
+P ¿
+{ È
+} ¢
+q ù
+w ú
+e Õ
+r à
+t â
+y ×
+u ã
+i Ø
+o Þ
+p ß
+[ è
+] ò
+A °
+S Á
+D ´
+F Ä
+G ³
+H Å
+J ¨
+K º
+L »
+: Ç
+\" «
+\| ¶
+a Ð
+s á
+d Ô
+f ä
+g Ó
+h å
+j ø
+k Ú
+l Û
+; ç
+' û
+\\ Ö
+"Z ·
+X ¯
+C Æ
+V ²
+B ±
+N ½
+M ¼
+"z ×
+x ÿ
+c æ
+v Ò
+b Ñ
+n Ý
+m Ü
+
+< ;
+> :
+/ -
+_ ?
+,, ?
+'' ?
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" & .
+" * ;
+
diff --git a/runtime/keymap/serbian_utf-8.vim b/runtime/keymap/serbian_utf-8.vim
new file mode 100644
index 000000000..3388bfd28
--- /dev/null
+++ b/runtime/keymap/serbian_utf-8.vim
@@ -0,0 +1,93 @@
+" Vim Keymap file for Serbian characters, classical variant, UTF-8 encoding
+"
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.edu>
+" URL: http://www.cs.cmu.edu/~aleksa/personal/vim/keymap/serbian-UTF-8.vim
+" Last Changed: 2002 Mar 29
+
+scriptencoding UTF-8
+
+let b:keymap_name = "serbian-UTF-8"
+
+loadkeymap
+Q Љ
+W Њ
+E Е
+R Р
+T Т
+Y З
+U У
+I И
+O О
+P П
+{ Ш
+} Ђ
+q Ñ™
+w Ñš
+e е
+r р
+t Ñ‚
+y з
+u у
+i и
+o о
+p п
+[ ш
+] Ñ’
+A Ð
+S С
+D Д
+F Ф
+G Г
+H Х
+J Ј
+K К
+L Л
+: Ч
+\" Ћ
+\| Ж
+a а
+s Ñ
+d д
+f Ñ„
+g г
+h Ñ…
+j ј
+k к
+l л
+; ч
+' Ñ›
+\\ ж
+"Z З
+X Ð
+C Ц
+V Ð’
+B Б
+N Ð
+M М
+"z з
+x ÑŸ
+c ц
+v в
+b б
+n н
+m м
+
+< ;
+> :
+/ -
+_ ?
+,, „
+'' â€
+
+E$ <char-0x20AC> " EURO SIGN
+-- <char-0x2013> " endash
+--- <char-0x2014> " emdash
+
+" @ "
+" # '
+" $ *
+" % :
+" ^ ,
+" &amp; .
+" * ;
+
diff --git a/runtime/keymap/slovak.vim b/runtime/keymap/slovak.vim
new file mode 100644
index 000000000..f9fd6d62a
--- /dev/null
+++ b/runtime/keymap/slovak.vim
@@ -0,0 +1,16 @@
+let encoding = &enc
+if encoding == 'latin1'
+ if has("unix")
+ let encoding = 'iso-8859-2'
+ else
+ let encoding = 'cp1250'
+ endif
+endif
+
+if encoding == 'utf-8'
+ source <sfile>:p:h/slovak_utf-8.vim
+elseif encoding == 'cp1250'
+ source <sfile>:p:h/slovak_cp1250.vim
+else
+ source <sfile>:p:h/slovak_iso-8859-2.vim
+endif
diff --git a/runtime/keymap/slovak_cp1250.vim b/runtime/keymap/slovak_cp1250.vim
new file mode 100644
index 000000000..73234cb37
--- /dev/null
+++ b/runtime/keymap/slovak_cp1250.vim
@@ -0,0 +1,100 @@
+" Maintainer: Peter Valach <pvalach@gmx.net>
+" Last Changed: 2002 Feb 3
+" URL: http://www.pv2c.sk/free/sk_vimkeymap/
+
+let b:keymap_name = "sk"
+
+loadkeymap
+" Z a Y - ak chcete slovensku qwerty, zakomentujte tieto styri riadky
+y z
+z y
+Y Z
+Z Y
+
+" Horny riadok
+` ;
+1 +
+! 1
+2 ¾
+@ 2
+3 š
+# 3
+4 è
+$ 4
+5
+% 5
+6 ž
+^ 6
+7 ý
+& 7
+8 á
+* 8
+9 í
+( 9
+0 é
+) 0
+- =
+_ %
+
+" Klavesy okolo Enteru :)
+[ ú
+{ /
+] ä
+} (
+\\ ò
+<Bar> )
+; ô
+: "
+' §
+\" !
+", , ;-)
+< ?
+". . ;-)
+> :
+/ -
+? _
+
+" Dlzne
+=a á
+=A Á
+=e é
+=E É
+=i í
+=I Í
+=l å
+=L Å
+=o ó
+=O Ó
+=r à
+=R À
+=u ú
+=U Ú
+=z ý
+=Z Ý
+" pre pripad omylu :) alebo slovenskej QWERTY
+=y ý
+=Y Ý
+
+" Makcene
++a ä
++A Ä
++c è
++C È
++d ï
++D Ï
++l ¾
++L ¼
++n ò
++N Ò
++o ô
++O Ô
++s š
++S Š
++t
++T
++y ž
++Y Ž
+" pre pripad omylu :) alebo slovenskej QWERTY
++z ž
++Z Ž
+
diff --git a/runtime/keymap/slovak_iso-8859-2.vim b/runtime/keymap/slovak_iso-8859-2.vim
new file mode 100644
index 000000000..8c43fb112
--- /dev/null
+++ b/runtime/keymap/slovak_iso-8859-2.vim
@@ -0,0 +1,100 @@
+" Maintainer: Peter Valach <pvalach@gmx.net>
+" Last Changed: 2002 Feb 3
+" URL: http://www.pv2c.sk/free/sk_vimkeymap/
+
+let b:keymap_name = "sk"
+
+loadkeymap
+" Z a Y - ak chcete slovensku qwerty, zakomentujte tieto styri riadky
+y z
+z y
+Y Z
+Z Y
+
+" Horny riadok
+` ;
+1 +
+! 1
+2 µ
+@ 2
+3 ¹
+# 3
+4 è
+$ 4
+5 »
+% 5
+6 ¾
+^ 6
+7 ý
+& 7
+8 á
+* 8
+9 í
+( 9
+0 é
+) 0
+- =
+_ %
+
+" Klavesy okolo Enteru :)
+[ ú
+{ /
+] ä
+} (
+\\ ò
+<Bar> )
+; ô
+: "
+' §
+\" !
+", , ;-)
+< ?
+". . ;-)
+> :
+/ -
+? _
+
+" Dlzne
+=a á
+=A Á
+=e é
+=E É
+=i í
+=I Í
+=l å
+=L Å
+=o ó
+=O Ó
+=r à
+=R À
+=u ú
+=U Ú
+=z ý
+=Z Ý
+" pre pripad omylu :) alebo slovenskej QWERTY
+=y ý
+=Y Ý
+
+" Makcene
++a ä
++A Ä
++c è
++C È
++d ï
++D Ï
++l µ
++L ¥
++n ò
++N Ò
++o ô
++O Ô
++s ¹
++S ©
++t »
++T «
++y ¾
++Y ®
+" pre pripad omylu :) alebo slovenskej QWERTY
++z ¾
++Z ®
+
diff --git a/runtime/keymap/slovak_utf-8.vim b/runtime/keymap/slovak_utf-8.vim
new file mode 100644
index 000000000..8e3e0838e
--- /dev/null
+++ b/runtime/keymap/slovak_utf-8.vim
@@ -0,0 +1,100 @@
+" Maintainer: Peter Valach <pvalach@gmx.net>
+" Last Changed: 2002 Nov 5
+" URL: http://www.pv2c.sk/free/sk_vimkeymap/
+
+let b:keymap_name = "sk"
+
+loadkeymap
+" Z a Y - ak chcete slovensku qwerty, zakomentujte tieto styri riadky
+y z
+z y
+Y Z
+Z Y
+
+" Horny riadok
+` ;
+1 +
+! 1
+2 ľ
+@ 2
+3 Å¡
+# 3
+4 Ä
+$ 4
+5 ť
+% 5
+6 ž
+^ 6
+7 ý
+& 7
+8 á
+* 8
+9 í
+( 9
+0 é
+) 0
+- =
+_ %
+
+" Klavesy okolo Enteru :)
+[ ú
+{ /
+] ä
+} (
+\\ ň
+<Bar> )
+; ô
+: "
+' §
+\" !
+", , ;-)
+< ?
+". . ;-)
+> :
+/ -
+? _
+
+" Dlzne
+=a á
+=A Ã
+=e é
+=E É
+=i í
+=I Ã
+=l ĺ
+=L Ĺ
+=o ó
+=O Ó
+=r Å•
+=R Å”
+=u ú
+=U Ú
+=z ý
+=Z Ã
+" pre pripad omylu :) alebo slovenskej QWERTY
+=y ý
+=Y Ã
+
+" Makcene
++a ä
++A Ä
++c Ä
++C Č
++d Ä
++D ÄŽ
++l ľ
++L Ľ
++n ň
++N Ň
++o ô
++O Ô
++s Å¡
++S Å 
++t ť
++T Ť
++y ž
++Y Ž
+" pre pripad omylu :) alebo slovenskej QWERTY
++z ž
++Z Ž
+
diff --git a/runtime/lang/README.txt b/runtime/lang/README.txt
new file mode 100644
index 000000000..3b10b4f3a
--- /dev/null
+++ b/runtime/lang/README.txt
@@ -0,0 +1,64 @@
+Language files for Vim
+
+Translated menus
+----------------
+
+The contents of each menu file is a sequence of lines with "menutrans"
+commands. Read one of the existing files to get an idea of how this works.
+
+More information in the on-line help:
+
+ :help multilang-menus
+ :help :menutrans
+ :help 'langmenu'
+ :help :language
+
+The "$VIMRUNTIME/menu.vim" file will search for a menu translation file. This
+depends on the value of the "v:lang" variable.
+
+ "menu_" . v:lang . ".vim"
+
+When the 'menutrans' option is set, its value will be used instead of v:lang.
+
+The file name is always lower case. It is the full name as the ":language"
+command shows (the LC_MESSAGES value).
+
+For example, to use the Big5 (Taiwan) menus on MS-Windows the $LANG will be
+
+ Chinese(Taiwan)_Taiwan.950
+
+and use the menu translation file:
+
+ $VIMRUNTIME/lang/menu_chinese(taiwan)_taiwan.950.vim
+
+On Unix you should set $LANG, depending on your shell:
+
+ csh/tcsh: setenv LANG "zh_TW.Big5"
+ sh/bash/ksh: export LANG="zh_TW.Big5"
+
+and the menu translation file is:
+
+ $VIMRUNTIME/lang/menu_zh_tw.big5.vim
+
+The menu translation file should set the "did_menu_trans" variable so that Vim
+will not load another file.
+
+
+AUTOMATIC CONVERSION
+
+When Vim was compiled with multi-byte support, conversion between latin1 and
+UTF-8 will always be possible. Other conversions depend on the iconv
+library, which is not always available.
+For UTF-8 menu files which only use latin1 characters, you can rely on Vim
+doing the conversion. Let the UTF-8 menu file source the latin1 menu file,
+and put "scriptencoding latin1" in that one.
+Other conversions may not always be available (e.g., between iso-8859-# and
+MS-Windows codepages), thus the converted menu file must be available.
+
+
+Translated messages
+-------------------
+
+This requires doing "make install" in the "src" directory. It will compile
+the portable files "src/po/*.po" into binary ".mo" files and place them in the
+right directory.
diff --git a/runtime/lang/menu_af.latin1.vim b/runtime/lang/menu_af.latin1.vim
new file mode 100644
index 000000000..aac2e72d0
--- /dev/null
+++ b/runtime/lang/menu_af.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Afrikaans
+
+source <sfile>:p:h/menu_af_af.latin1.vim
diff --git a/runtime/lang/menu_af.utf-8.vim b/runtime/lang/menu_af.utf-8.vim
new file mode 100644
index 000000000..be39b59a7
--- /dev/null
+++ b/runtime/lang/menu_af.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Afrikaans for UTF-8 encoding
+
+source <sfile>:p:h/menu_af_af.latin1.vim
diff --git a/runtime/lang/menu_af_af.latin1.vim b/runtime/lang/menu_af_af.latin1.vim
new file mode 100644
index 000000000..b32e8e989
--- /dev/null
+++ b/runtime/lang/menu_af_af.latin1.vim
@@ -0,0 +1,152 @@
+" Menu Translations: Afrikaas
+" Maintainer: Danie Roux <droux@tuks.co.za>
+" Last Change: 2003 Mar 30
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252 and
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+
+" Help menu
+menutrans &Help &Hulp
+menutrans &Overview<Tab><F1> &Oorsig<Tab><F1>
+menutrans &How-to\ links &How-to\ Indeks
+"menutrans &GUI &GUI
+menutrans &Credits &Met\ dank\ aan
+menutrans Co&pying &Kopiereg
+menutrans &Find\.\.\. &Soek\.\.\.
+menutrans &Version &Weergawe
+menutrans &About &Inleiding\ skerm
+
+" File menu
+menutrans &File &Lêer
+menutrans &Open\.\.\.<Tab>:e &Open\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Maak\ oop\ in\ nuwe\ &venster\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nuut<Tab>:enew
+menutrans &Close<Tab>:close Maak\ &Toe<Tab>:close
+menutrans &Save<Tab>:w &Skryf<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:w Skryf\ &as\.\.\.<Tab>:w
+menutrans &Print &Druk
+menutrans Sa&ve-Exit<Tab>:wqa Skryf\ en\ verlaat<Tab>:wqa
+menutrans E&xit<Tab>:qa &Verlaat<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Wysig
+menutrans &Undo<Tab>u Terug<Tab>u
+menutrans &Redo<Tab>^R Voo&ruit<Tab>^R
+menutrans Rep&eat<Tab>\. &Herhaal<Tab>\.
+menutrans Cu&t<Tab>"+x &Knip<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiëer<Tab>"+y
+menutrans &Paste<Tab>"+gP Plak<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Voeg\ &Voor\ in<Tab>[p
+menutrans Put\ &After<Tab>]p Voeg\ A&gter\ in<Tab>]p
+menutrans &Select\ all<Tab>ggVG Kies\ &Alles<Tab>ggVG
+menutrans &Find\.\.\. &Soek\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Soek\ en\ Vervang\.\.\.
+menutrans Options\.\.\. Opsies\.\.\.
+
+" Programming menu
+menutrans &Tools &Gereedskap
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Spring\ na\ Etiket<Tab>g^]
+menutrans Jump\ &back<Tab>^T Spring\ &Terug<Tab>^T
+menutrans Build\ &Tags\ File Genereer\ &Etiket\ Leêr
+menutrans &Make<Tab>:make Voer\ &Make\ uit<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Foutlys<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! &Boodskaplys<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Volgende\ Fout<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Vorige\ Fout<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Ouer\ Lys<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Nuwer\ Lys<Tab>:cnew
+menutrans Error\ &Window<Tab>:cwin Foute\ Venster<Tab>:cwin
+menutrans Convert\ to\ HEX<Tab>:%!xxd Verwissel\ na\ HEX<Tab>:%!xxd
+menutrans Convert\ back<Tab>:%!xxd\ -r Verwissel\ terug<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &Buffers
+menutrans Refresh Verfris
+menutrans Delete Verwyder
+menutrans Alternate Vorige
+menutrans [No\ File] [Geen\ Leêr]
+
+" Window menu
+menutrans &Window &Venster
+menutrans &New<Tab>^Wn &Nuut<Tab>^Wn
+menutrans S&plit<Tab>^Ws Ver&deel<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Verdeel\ N&a\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Verdeel\ Vertikaal<Tab>^Wv
+menutrans &Close<Tab>^Wc &Maak\ toe<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Maak\ &Ander\ Toe<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww Volgende<Tab>^Ww
+menutrans P&revious<Tab>^WW &Vorige<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Gelyke\ hoogte<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maksimale\ hoogte<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Mi&nimale\ hoogte<Tab>^W1_
+menutrans Max\ Width<Tab>^W\| Maksimale\ breedte<Tab>^W\|
+menutrans Min\ Width<Tab>^W1\| Minimale\ breedte<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Roteer\ na\ &bo<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Roteer\ na\ &onder<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Kies\ font\.\.\.
+
+" The popup menu
+menutrans &Undo &Terug
+menutrans Cu&t Knip
+menutrans &Copy &Kopiëer
+menutrans &Paste &Plak
+menutrans &Delete &Verwyder
+menutrans Select\ Blockwise Kies\ per\ Blok
+menutrans Select\ &Word Kies\ een\ &Woord
+menutrans Select\ &Line Kies\ een\ &Reël
+menutrans Select\ &Block Kies\ een\ &Blok
+menutrans Select\ &All Kies\ &Alles
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Maak leêr oop
+ tmenu ToolBar.Save Skryf leêr
+ tmenu ToolBar.SaveAll Skryf alle leêrs
+ tmenu ToolBar.Print Druk
+ tmenu ToolBar.Undo Terug
+ tmenu ToolBar.Redo Vooruit
+ tmenu ToolBar.Cut Knip
+ tmenu ToolBar.Copy Kopiëer
+ tmenu ToolBar.Paste Plak
+ tmenu ToolBar.Find Soek...
+ tmenu ToolBar.FindNext Soek volgende
+ tmenu ToolBar.FindPrev Soek vorige
+ tmenu ToolBar.Replace Soek en vervang...
+ tmenu ToolBar.LoadSesn Laai sessie
+ tmenu ToolBar.SaveSesn Stoor sessie
+ tmenu ToolBar.RunScript Voer vim skrip uit
+ tmenu ToolBar.Make Voer make uit
+ tmenu ToolBar.Shell Begin dop
+ tmenu ToolBar.RunCtags Genereer etikette
+ tmenu ToolBar.TagJump Spring na etiket
+ tmenu ToolBar.Help Hulp
+ tmenu ToolBar.FindHelp Soek hulp...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaks
+menutrans Set\ 'syntax'\ only Stel\ slegs\ 'syntax'
+menutrans Set\ 'filetype'\ too Verander\ 'filetype'\ ook
+menutrans &Off &Af
+menutrans &Manual &Met\ die\ hand
+menutrans A&utomatic O&utomaties
+menutrans o&n\ (this\ file) Aa&n\ (die\ leêr)
+menutrans o&ff\ (this\ file) &Af\ (die\ leêr)
+menutrans Co&lor\ test Toets\ die\ &kleure
+menutrans &Highlight\ test Toets\ die\ verligting
+menutrans &Convert\ to\ HTML Verwissel\ na\ HTML
diff --git a/runtime/lang/menu_af_af.utf-8.vim b/runtime/lang/menu_af_af.utf-8.vim
new file mode 100644
index 000000000..be39b59a7
--- /dev/null
+++ b/runtime/lang/menu_af_af.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Afrikaans for UTF-8 encoding
+
+source <sfile>:p:h/menu_af_af.latin1.vim
diff --git a/runtime/lang/menu_ca.latin1.vim b/runtime/lang/menu_ca.latin1.vim
new file mode 100644
index 000000000..9eedfd80c
--- /dev/null
+++ b/runtime/lang/menu_ca.latin1.vim
@@ -0,0 +1,3 @@
+" Menu translations for Catalan
+"
+source <sfile>:p:h/menu_ca_es.latin1.vim
diff --git a/runtime/lang/menu_ca.utf-8.vim b/runtime/lang/menu_ca.utf-8.vim
new file mode 100644
index 000000000..23ee10da9
--- /dev/null
+++ b/runtime/lang/menu_ca.utf-8.vim
@@ -0,0 +1,7 @@
+" Menu translations for Catalan
+"
+" Maintainer: Ernest Adrogué <eadrogue@gmx.net>
+" Last Change: 29 Dec 2003
+"
+source <sfile>:p:h/menu_ca_es.latin1.vim
+
diff --git a/runtime/lang/menu_ca_es.latin1.vim b/runtime/lang/menu_ca_es.latin1.vim
new file mode 100644
index 000000000..a71c60ef7
--- /dev/null
+++ b/runtime/lang/menu_ca_es.latin1.vim
@@ -0,0 +1,293 @@
+" Menu translations for Catalan
+"
+" Maintainer: Ernest Adrogué <eadrogue@gmx.net>
+" Last Change: 18 Jan 2004
+"
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252,
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+
+" menú Ajuda
+menutrans &Help &Ajuda
+menutrans &Overview<Tab><F1> &Introducció<Tab><F1>
+menutrans &User\ Manual &Manual\ de\ l'usuari
+menutrans &How-to\ links Com\ &fer\.\.\.?
+menutrans &Find\.\.\. &Cerca\.\.\.
+menutrans &Credits &Autors
+menutrans Co&pying Con&dicions
+menutrans O&rphans &Orfes
+menutrans &Version &Versió
+menutrans &About &Quant\ a\.\.\.
+" text del diàleg Ajuda/Cerca...
+let g:menutrans_help_dialog = "Introduïu el terme sobre el qual necessiteu ajuda.\n\nUseu el prefix i_ per ordres d'entrada (p.ex.: i_CTRL-X)\nUseu el prefix c_ per ordres de la línia d'ordres (p.ex.: c_<Del>)\nUseu el prefix ' per noms d'opcions (p.ex.: 'shiftwidth')"
+
+
+" menú Fitxer
+menutrans &File &Fitxer
+menutrans &Open\.\.\.<Tab>:e &Obre\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Obre\ en\ una\ &finestra\ nova\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nou<Tab>:enew
+menutrans &Close<Tab>:close &Tanca<Tab>:close
+menutrans &Save<Tab>:w &Desa<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav &Anomena\ i\ desa\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. &Mostra\ les\ diferències\ respecte\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Aplica\ les\ modificacions\ de\.\.\.
+menutrans &Print &Imprimeix
+menutrans Sa&ve-Exit<Tab>:wqa Desa\ i\ s&urt<Tab>:wqa
+menutrans E&xit<Tab>:qa &Surt<Tab>:qa
+
+
+" menú Edita
+menutrans &Edit &Edita
+menutrans &Undo<Tab>u &Desfés<Tab>u
+menutrans &Redo<Tab>^R &Refés<Tab>^R
+menutrans Rep&eat<Tab>\. Re&peteix<Tab>\.
+menutrans Cu&t<Tab>"+x Re&talla<Tab>"+x
+menutrans &Copy<Tab>"+y &Copia<Tab>"+y
+menutrans &Paste<Tab>"+gP Engan&xa<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Posa\ &abans<Tab>[p
+menutrans Put\ &After<Tab>]p P&osa\ després<Tab>]p
+menutrans &Delete<Tab>x Suprimeix<Tab>x
+menutrans &Select\ all<Tab>ggVG &Selecciona-ho\ tot<Tab>ggVG
+menutrans &Find\.\.\. &Cerca\.\.\.
+menutrans &Find<Tab>/ &Cerca<Tab>/
+menutrans Find\ and\ Rep&lace Cerca\ i\ s&ubstitueix
+menutrans Find\ and\ Rep&lace\.\.\. Cerca\ i\ s&ubstitueix\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Cerca\ i\ s&ubstitueix<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s Cerca\ i\ s&ubstitueix<Tab>:s
+menutrans Settings\ &Window &Finestra\ d'opcions
+menutrans &Global\ Settings Opcions\ &globals
+" submenú Edita/Opcions Globals
+ menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressalt\ de\ &patrons<Tab>:set\ hls!
+ menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Sensibilitat\ a\ les\ ma&júscules<Tab>:set\ ic!
+ menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressalt\ de\ coincidències<Tab>:set\ sm!
+ menutrans &Context\ lines Línies\ de\ co&ntext
+ menutrans &Virtual\ Edit Edició\ &virtual
+" submenú Edita/Opcions Globals/Edició virtual
+ menutrans Never &Mai
+ menutrans Block\ Selection &Selecció\ de\ blocs
+ menutrans Insert\ mode Mode\ d'&inserció
+ menutrans Block\ and\ Insert &Blocs i inserció
+ menutrans Always S&empre
+ menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Mode\ d'&inserció<Tab>:set\ im!
+ menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Co&mpatible\ amb\ Vi<Tab>:set\ cp!
+ menutrans Search\ &Path\.\.\. &Ubicacions\.\.\.
+ menutrans Ta&g\ Files\.\.\. Fitxers\ d'&etiquetes\.\.\.
+ menutrans Toggle\ &Toolbar &Barra\ d'eines
+ menutrans Toggle\ &Bottom\ Scrollbar Barra\ de\ &desplaçament\ inferior
+ menutrans Toggle\ &Left\ Scrollbar Barra\ de\ desplaçament\ e&squerra
+ menutrans Toggle\ &Right\ Scrollbar Barra\ de\ desplaçament\ dre&ta
+menutrans F&ile\ Settings Opcions\ del\ f&itxer
+" submenú Edita/Opcions del fitxer
+ menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Ennumera\ les\ línies<Tab>:set\ nu!
+ menutrans Toggle\ &List\ Mode<Tab>:set\ list! Mode\ &llista<Tab>:set\ list!
+ menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! A&justa\ les\ línies\ llargues<Tab>:set\ wrap!
+ menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Ajusta\ sense\ partir\ &paraules<Tab>:set\ lbr!
+ menutrans Toggle\ &expand-tab<Tab>:set\ et! Estén\ les\ ta&bulacions<Tab>:set\ et!
+ menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Sagnia\ automàtica<Tab>:set\ ai!
+ menutrans Toggle\ &C-indenting<Tab>:set\ cin! Sagnia\ estil\ &C<Tab>:set\ cin!
+ menutrans &Shiftwidth Sa&gnia
+ menutrans Soft\ &Tabstop Amplada\ de\ &tabulació
+ menutrans Te&xt\ Width\.\.\. &Amplada\ del\ text\.\.\.
+ menutrans &File\ Format\.\.\. &Format\ del\ fitxer\.\.\.
+menutrans Select\ Fo&nt\.\.\. Tipus\ de\ &lletra\.\.\.
+menutrans C&olor\ Scheme Es&quema\ de\ colors
+" submenú Edita/Esquema de colors
+ menutrans blue blau
+ menutrans darkblue blau\ fosc
+ menutrans default normal
+ menutrans desert desert
+ menutrans evening vesprada
+ menutrans morning matinada
+ menutrans peachpuff préssec
+ menutrans shine brillant
+menutrans &Keymap &Mapa\ de\ tecles
+" submenú Edita/Mapa de tecles
+ menutrans None Cap
+ menutrans accents Accents
+ menutrans arabic Àrab
+ menutrans czech Txec
+ menutrans esperanto Esperanto
+ menutrans greek Grec
+ menutrans hebrew Hebreu
+ menutrans hebrewp Hebreu\ (fonètic)
+ menutrans lithuanian-baltic Lituà\ (bàltic)
+ menutrans pinyin Mandarí\ (fonètic)
+ menutrans russian-jcuken Rus\ (jcuken)
+ menutrans russian-jcukenwin Rus\ (jcukenwin)
+ menutrans russian-yawerty Rus\ (yawerty)
+ menutrans serbian Serbi
+ menutrans serbian-latin Serbi\ (llatí)
+ menutrans slovak Eslovac
+" text del diàleg Edita/Opcions globals/Ubicacions...
+let g:menutrans_path_dialog = "Introduïu les ubicacions on cercar fitxers.\nSepareu els noms dels directoris amb una coma."
+" text del diàleg Edita/Opcions globals/Fitxers d'etiquetes...
+let g:menutrans_tags_dialog = "Introduïu els noms dels fitxers d'etiquetes.\nSepareu els noms amb una coma."
+" text del diàleg Edita/Opcions del fitxer/Amplada del text...
+let g:menutrans_textwidth_dialog = "Introduïu la nova amplada del text (0 per infinit): "
+" text del diàleg Edita/Opcions del fitxer/Format del fitxer...
+let g:menutrans_fileformat_dialog = "Seleccioneu el format per escriure el fitxer."
+
+
+" menú Eines
+menutrans &Tools Ei&nes
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Salta\ a\ aquesta\ etiqueta<Tab>g^]
+menutrans Jump\ &back<Tab>^T Salta\ en&rere<Tab>^T
+menutrans Build\ &Tags\ File Crea\ un\ fitxer\ d'eti&quetes
+menutrans &Folding &Plecs
+" submenú Eines/Plecs
+ menutrans &Enable/Disable\ folds<Tab>zi &Habilita/Deshabilita\ els\ plecs<Tab>zi
+ menutrans &View\ Cursor\ Line<Tab>zv &Línia\ del\ cursor\ visible<Tab>zv
+ menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Només\ visible\ la\ línia\ del\ cursor<Tab>zMzx
+ menutrans C&lose\ more\ folds<Tab>zm &Tanca\ més\ plecs<Tab>zm
+ menutrans &Close\ all\ folds<Tab>zM Tanca\ t&ots\ els\ plecs<Tab>zM
+ menutrans O&pen\ more\ folds<Tab>zr Obre\ &més\ plecs<Tab>zr
+ menutrans &Open\ all\ folds<Tab>zR O&bre\ tots\ els\ plecs<Tab>zR
+ menutrans Fold\ Met&hod Mèto&de
+" submenú Eines/Plècs/Mètode
+ menutrans M&anual M&anual
+ menutrans I&ndent &Sagnia
+ menutrans E&xpression E&xpressió
+ menutrans S&yntax S&intaxi
+ menutrans &Diff &Diferències
+ menutrans Ma&rker &Marques
+ menutrans Create\ &Fold<Tab>zf &Crea\ un\ plec<Tab>zf
+ menutrans &Delete\ Fold<Tab>zd &Elimina\ un\ plec<Tab>zd
+ menutrans Delete\ &All\ Folds<Tab>zD Elimina\ tot&s\ els\ plecs<Tab>zD
+ menutrans Fold\ col&umn\ width &Amplada\ de\ la\ columna\ de\ plecs
+menutrans &Diff &Diferències
+" submenú Eines/Diferències
+ menutrans &Update &Actualitza
+ menutrans &Get\ Block &Obtingues\ un\ bloc
+ menutrans &Put\ Block &Posa\ un\ bloc
+menutrans &Make<Tab>:make Crida\ a\ &make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Llista\ d'&errors<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! &Llista\ de\ missatges<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Error\ se&güent<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Error\ an&terior<Tab>:cp
+menutrans &Older\ List<Tab>:cold Llista\ &antiga<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Llista\ no&va<Tab>:cnew
+menutrans Error\ &Window F&inestra\ d'errors
+" submenú Eines/Finestra d'errors
+ menutrans &Update<Tab>:cwin &Actualitza<Tab>:cwin
+ menutrans &Open<Tab>:copen &Obre<Tab>:copen
+ menutrans &Close<Tab>:cclose &Tanca<Tab>:cclose
+menutrans &Set\ Compiler &Compilador
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Converteix\ a\ &HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Torna\ al\ format\ &original<Tab>:%!xxd\ -r
+
+
+" menú Buffers
+menutrans &Buffers &Buffers
+menutrans &Refresh\ menu &Refresca\ el\ menú
+menutrans &Delete &Elimina
+menutrans &Alternate &Alterna
+menutrans &Next &Següent
+menutrans &Previous A&nterior
+let g:menutrans_no_file = "[Cap fitxer]"
+
+
+" menú Finestra
+menutrans &Window F&inestra
+menutrans &New<Tab>^Wn &Nova<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Divideix<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Divideix\ &en\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Divideix\ &verticalment<Tab>^Wv
+menutrans Split\ File\ E&xplorer E&xplorador\ de\ fitxers
+menutrans &Close<Tab>^Wc &Tanca<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Tanca\ les\ altre&s<Tab>^Wo
+menutrans Move\ &To M&ou\ a
+" submenú Finestra/Mou
+ menutrans &Top<Tab>^WK &Dalt\ de\ tot<Tab>^WK
+ menutrans &Bottom<Tab>^WJ &Baix\ de\ tot<Tab>^WJ
+ menutrans &Left\ side<Tab>^WH Costat\ &esquerra<Tab>^WH
+ menutrans &Right\ side<Tab>^WL Costat\ d&ret<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Alterna\ cap\ am&unt<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Alte&rna\ cap\ avall<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= &Iguala<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Màxima\ &alçada<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Mínima\ a&lçada<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Màxima\ a&mplada<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Mínima\ am&plada<Tab>^W1\|
+
+
+" menú emergent
+menutrans &Undo &Desfés
+menutrans Cu&t &Retalla
+menutrans &Copy &Copia
+menutrans &Paste &Enganxa
+menutrans &Delete &Suprimeix
+menutrans Select\ Blockwise Se&lecció
+menutrans Select\ &Word Selecció\ de\ &paraules
+menutrans Select\ &Line Selecció\ de\ &línies
+menutrans Select\ &Block Selecció\ de\ bl&ocs
+menutrans Select\ &All Selecciona-ho\ &tot
+
+
+" barra d'eines
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Obre un fitxer
+ tmenu ToolBar.Save Desa el fitxer
+ tmenu ToolBar.SaveAll Desa tots els fitxers
+ tmenu ToolBar.Print Imprimeix
+ tmenu ToolBar.Undo Desfés
+ tmenu ToolBar.Redo Refés
+ tmenu ToolBar.Cut Retalla
+ tmenu ToolBar.Copy Copia
+ tmenu ToolBar.Paste Enganxa
+ tmenu ToolBar.Find Cerca
+ tmenu ToolBar.FindNext Cerca el següent
+ tmenu ToolBar.FindPrev Cerca l'anterior
+ tmenu ToolBar.Replace Cerca i substitueix
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Finestra nova
+ tmenu ToolBar.WinSplit Divideix la finestra
+ tmenu ToolBar.WinMax Alçada màxima
+ tmenu ToolBar.WinMin Alçada mínima
+ tmenu ToolBar.WinVSplit Divideix la finestra verticalment
+ tmenu ToolBar.WinMaxWidth Amplada màxima
+ tmenu ToolBar.WinMinWidth Amplada mínima
+ tmenu ToolBar.WinClose Tanca la finestra
+ endif
+ tmenu ToolBar.LoadSesn Carrega una sessió
+ tmenu ToolBar.SaveSesn Desa la sessió
+ tmenu ToolBar.RunScript Executa un script
+ tmenu ToolBar.Make Crida a make
+ tmenu ToolBar.Shell Obre l'intèrpret d'ordres
+ tmenu ToolBar.RunCtags Crea un fitxer d'etiquetes
+ tmenu ToolBar.TagJump Salta a una etiqueta
+ tmenu ToolBar.Help Ajuda
+ tmenu ToolBar.FindHelp Cerca a l'ajuda
+ endfun
+endif
+
+
+" menú Sintaxi
+menutrans &Syntax &Sintaxi
+menutrans &Manual &Manual
+menutrans A&utomatic A&utomàtica
+menutrans on/off\ for\ &This\ file Activa/Desactiva\ en\ &aquest\ fitxer
+menutrans &Show\ filetypes\ in\ menu Mostra\ tots\ els\ &tipus\ al\ menú
+menutrans &Off &Desactiva
+menutrans Co&lor\ test Prova\ dels\ &colors
+menutrans &Highlight\ test Prova\ del\ &ressalt
+menutrans &Convert\ to\ HTML Converteix\ a\ &HTML
+menutrans Assembly Ensamblador
+menutrans Config Configuració
+menutrans Set\ '&syntax'\ only Només\ el\ ressalt\ de\ sintaxi
+menutrans Set\ '&filetype'\ too Carrega\ també\ els\ plugins
+
diff --git a/runtime/lang/menu_ca_es.utf-8.vim b/runtime/lang/menu_ca_es.utf-8.vim
new file mode 100644
index 000000000..23ee10da9
--- /dev/null
+++ b/runtime/lang/menu_ca_es.utf-8.vim
@@ -0,0 +1,7 @@
+" Menu translations for Catalan
+"
+" Maintainer: Ernest Adrogué <eadrogue@gmx.net>
+" Last Change: 29 Dec 2003
+"
+source <sfile>:p:h/menu_ca_es.latin1.vim
+
diff --git a/runtime/lang/menu_chinese_gb.936.vim b/runtime/lang/menu_chinese_gb.936.vim
new file mode 100644
index 000000000..9c3bf6dcd
--- /dev/null
+++ b/runtime/lang/menu_chinese_gb.936.vim
@@ -0,0 +1,230 @@
+" Menu Translations: Simplified Chinese (Windows)
+" Translated By: Wang Jun <junw@turbolinux.com.cn>
+" Last Change: Tue Sep 4 11:26:52 CST 2001
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding cp936
+
+" Help menu
+menutrans &Help °ïÖú(&H)
+menutrans &Overview<Tab><F1> Ô¤ÀÀ(&O)<Tab><F1>
+menutrans &User\ Manual Óû§ÊÖ²á(&U)
+menutrans &GUI ͼÐνçÃæ(&G)
+menutrans &How-to\ links HOWTOÎĵµ\.\.\.(&H)
+menutrans &Credits ×÷Õß(&C)
+menutrans Co&pying °æȨ(&P)
+menutrans &Version °æ±¾(&V)
+menutrans &About ¹ØÓÚ\ Vim(&A)
+
+" File menu
+menutrans &File Îļþ(&F)
+menutrans &Open\.\.\.<Tab>:e ´ò¿ª(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ·Ö¸î´°¿Ú²¢´ò¿ª(&L)<Tab>:sp
+menutrans &New<Tab>:enew н¨(&N)<Tab>:enew
+menutrans &Close<Tab>:close ¹Ø±Õ(&C)<Tab>:close
+menutrans &Save<Tab>:w ±£´æ(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Áí´æΪ(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. ·Ö¸î±È½Ï(&Diff)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. ·Ö¸î´ò²¹¶¡(&Patch)\.\.\.
+menutrans &Print ´òÓ¡(&P)
+menutrans Sa&ve-Exit<Tab>:wqa ±£´æ²¢Í˳ö(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa Í˳ö(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit ±à¼­(&E)
+menutrans &Undo<Tab>u »Ö¸´(&U)<Tab>u
+menutrans &Redo<Tab>^R ÖØ×ö(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. Öظ´Éϴζ¯×÷(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x ¼ôÇÐ(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y ¸´ÖÆ(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP Õ³Ìû(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Ìùµ½¹â±êÇ°(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p Ìùµ½¹â±êºó(&A)<Tab>]p
+menutrans &Delete<Tab>x ɾ³ý(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG È«Ñ¡(&S)<Tab>ggvG
+menutrans &Find\.\.\. ²éÕÒ(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. ²éÕÒÌæ»»(&L)\.\.\.
+menutrans Settings\ &Window É趨´°¿Ú(&W)
+menutrans &Global\ Settings È«¾ÖÉ趨(&G)
+
+" Build boolean options
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ¿ª/¹ØÔöÁ¿²éÕÒģʽ<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ¿ª/¹ØºöÂÔ´óСдģʽ<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! ¿ª/¹ØÆ¥ÅäÏÔʾ<Tab>:set sm!
+menutrans &Context\ lines ÉÏÏÂÎÄÐÐÊý(&C)
+
+menutrans &Virtual\ Edit ¿ÉÊÓ»¯±à¼­Ä£Ê½(&V)
+menutrans Never ´Ó²»
+menutrans Block\ Selection ¿éÑ¡Ôñ
+menutrans Insert\ mode ²åÈëģʽ
+menutrans Block\ and\ Insert ¿éÑ¡ÔñÓë²åÈëģʽ
+menutrans Always ËùÓÐģʽ
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ¿ª/¹Ø²åÈëģʽ<Tab>:set\ im!
+
+menutrans Search\ &Path\.\.\. ²éÕÒ·¾¶\.\.\.(&P)
+
+menutrans Ta&g\ Files\.\.\. ±êÇ©Îļþ\.\.\.(&g)
+
+" GUI options
+menutrans Toggle\ &Toolbar ¿ª/¹Ø¹¤¾ßÌõ(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ¿ª/¹Øµ×²¿¹ö¶¯Ìõ(&B)
+menutrans Toggle\ &Left\ Scrollbar ¿ª/¹Ø×ó¶Ë¹ö¶¯Ìõ(&L)
+menutrans Toggle\ &Right\ Scrollbar ¿ª/¹ØÓҶ˹ö¶¯Ìõ(&R)
+
+
+" Edit/File Settings
+menutrans F&ile\ Settings ÎļþÉ趨(&i)
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ¿ª/¹ØÏÔʾÐкÅ<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ¿ª/¹ØÏÔʾTab<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ¿ª/¹Ø×Ô¶¯ÕÛÐÐ<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ¿ª/¹Ø´ÊβÕÛÐÐ<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ¿ª/¹Øexpand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ¿ª/¹Øauto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! ¿ª/¹ØC-indent<Tab>:set\ cin!
+
+
+" other options
+menutrans &Shiftwidth ËõÅÅ¿í¶È(&S)
+menutrans Soft\ &Tabstop αTab¿í¶È(&T)
+menutrans Te&xt\ Width\.\.\. Ò³Ãæ¿í¶È(&x)\.\.\.
+menutrans &File\ Format\.\.\. Îļþ¸ñʽ(&F)\.\.\.
+
+menutrans C&olor\ Scheme µ÷É«°å(&o)
+menutrans Select\ Fo&nt\.\.\. Ñ¡Ôñ×ÖÌå(&n)\.\.\.
+
+
+" Programming menu
+menutrans &Tools ¹¤¾ß(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ¼ìË÷¹â±ê´¦µÄ±êÇ©¹Ø¼ü×Ö(tag)(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T Ìø»Ø¼ìË÷Ç°µÄλÖÃ(&B)<Tab>^T
+menutrans Build\ &Tags\ File ½¨Á¢±êÇ©Ë÷ÒýÎļþ\ Tags(&T)
+menutrans &Folding FoldingÉ趨(&F)
+menutrans &Diff ±È½Ï(&D)
+menutrans &Make<Tab>:make Ö´ÐÐ\ Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl Áгö±àÒë´íÎó(&E)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ÁгöËùÓÐÐÅÏ¢(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ÏÂÒ»¸ö±àÒë´íÎó´¦(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ÉÏÒ»¸ö±àÒë´íÎó´¦(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold ¾É´íÎóÁбí(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew дíÎóÁбí(&E)<Tab>:cnew
+menutrans Error\ &Window ´íÎóÐÅÏ¢´°¿Ú(&W)
+menutrans &Set\ Compiler ÉèÖñàÒëÆ÷(&S)
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ת»»³É16½øÖÆ<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ´Ó16½øÖÆת»»»ØÎÄ×Ö<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi ʹÓÃ/²»Ê¹ÓÃFolding(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv ²é¿´´ËÐÐ(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ö»²é¿´´ËÐÐ(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm ¹Ø±ÕFolds(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM ¹Ø±ÕËùÓÐFolds(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Õ¹¿ªFolds(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Õ¹¿ªËùÓÐFolds(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod Fold·½Ê½(&H)
+menutrans Create\ &Fold<Tab>zf ½¨Á¢Fold(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd ɾ³ýFold(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ɾ³ýËùÓÐFold(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ column\ &width É趨FoldÀ¸¿í(&W)
+
+" Tools.Diff Menu
+menutrans &Update ¸üÐÂ(&U)
+menutrans &Get\ Block È¡µÃ²»Í¬²¿·Ö(&G)
+menutrans &Put\ Block ½«²»Í¬²¿·ÖÓ¦Óõ½¶Ô·½(&P)
+
+
+" Names for buffer menu.
+menutrans &Buffers »º³åÇø(&B)
+menutrans &Refresh\ menu ¸üÐÂ(&R)
+menutrans &Delete ɾ³ý(&D)
+menutrans &Alternate ÐÞ¸Ä(&L)
+menutrans &Next ÏÂÒ»¸ö(&N)
+menutrans &Previous Ç°Ò»¸ö(&P)
+
+" Window menu
+menutrans &Window ´°¿Ú(&W)
+menutrans &New<Tab>^Wn н¨´°¿Ú(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws ·Ö¸î´°¿Ú(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ·Ö¸îµ½#(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ´¹Ö±·Ö¸î(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer Îļþä¯ÀÀÆ÷ʽ·Ö¸î(&X)
+menutrans &Close<Tab>^Wc ¹Ø±Õ´°¿Ú(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo ¹Ø±ÕÆäËü´°¿Ú(&O)<Tab>^Wo
+menutrans Move\ &To Òƶ¯µ½(&T)
+menutrans &Top<Tab>^WK ¶¥¶Ë(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ µ×¶Ë(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH ×ó±ß(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL ÓÒ±ß(&R)<Tab>^WL
+" menutrans Ne&xt<Tab>^Ww ÏÂÒ»¸ö(&X)<Tab>^Ww
+" menutrans P&revious<Tab>^WW ÉÏÒ»¸ö(&R)<Tab>^WW
+menutrans Rotate\ &Up<Tab>^WR ÉÏÒÆ´°¿Ú(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ÏÂÒÆ´°¿Ú(&D)<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= ËùÓд°¿ÚµÈ¸ß(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ×î´ó¸ß¶È(&M)<Tab>^W
+menutrans M&in\ Height<Tab>^W1_ ×îС¸ß¶È(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ×î´ó¿í¶È(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ×îС¿í¶È(&h)<Tab>^W1\|
+"
+" The popup menu
+menutrans &Undo ³·Ïú(&U)
+menutrans Cu&t ¼ôÇÐ(&T)
+menutrans &Copy ¸´ÖÆ(&C)
+menutrans &Paste Õ³Ìû(&P)
+menutrans &Delete ɾ³ý(&D)
+menutrans Select\ Blockwise BlockwiseÑ¡Ôñ
+menutrans Select\ &Word Ñ¡Ôñµ¥´Ê(&W)
+menutrans Select\ &Line Ñ¡ÔñÐÐ(&L)
+menutrans Select\ &Block Ñ¡Ôñ¿é(&B)
+menutrans Select\ &All È«Ñ¡(&A)
+"
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ´ò¿ªÎļþ
+ tmenu ToolBar.Save ±£´æµ±Ç°Îļþ
+ tmenu ToolBar.SaveAll ±£´æÈ«²¿Îļþ
+ tmenu ToolBar.Print ´òÓ¡
+ tmenu ToolBar.Undo ³·ÏúÉÏ´ÎÐÞ¸Ä
+ tmenu ToolBar.Redo ÖØ×öÉϴγ·ÏúµÄ¶¯×÷
+ tmenu ToolBar.Cut ¼ôÇÐÖÁ¼ôÌù°å
+ tmenu ToolBar.Copy ¸´ÖƵ½¼ôÌù°å
+ tmenu ToolBar.Paste ÓɼôÌù°åÕ³Ìû
+ tmenu ToolBar.Find ²éÕÒ...
+ tmenu ToolBar.FindNext ²éÕÒÏÂÒ»¸ö
+ tmenu ToolBar.FindPrev ²éÕÒÉÏÒ»¸ö
+ tmenu ToolBar.Replace Ìæ»»...
+ tmenu ToolBar.LoadSesn ¼ÓÔػỰ
+ tmenu ToolBar.SaveSesn ±£´æµ±Ç°µÄ»á»°
+ tmenu ToolBar.RunScript ÔËÐÐVim½Å±¾
+ tmenu ToolBar.Make Ö´ÐÐ Make
+ tmenu ToolBar.Shell ´ò¿ªÒ»¸öÃüÁî´°¿Ú
+ tmenu ToolBar.RunCtags Ö´ÐÐ ctags
+ tmenu ToolBar.TagJump Ìøµ½µ±Ç°¹â±êλÖõıêÇ©
+ tmenu ToolBar.Help Vim °ïÖú
+ tmenu ToolBar.FindHelp ²éÕÒ Vim °ïÖú
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax Óï·¨(&S)
+menutrans Set\ '&syntax'\ only Ö»É趨\ 'syntax'(&s)
+menutrans Set\ '&filetype'\ too Ò²É趨\ 'filetype'(&f)
+menutrans &Off ¹Ø±Õ(&O)
+menutrans &Manual ÊÖ¶¯É趨(&M)
+menutrans A&utomatic ×Ô¶¯É趨(&U)
+menutrans on/off\ for\ &This\ file Ö»¶ÔÕâ¸öÎļþ´ò¿ª/¹Ø±Õ(&T)
+menutrans Co&lor\ test É«²ÊÏÔʾ²âÊÔ(&L)
+menutrans &Highlight\ test Ó﷨Ч¹û²âÊÔ(&H)
+menutrans &Convert\ to\ HTML ת»»³É\ HTML\ ¸ñʽ(&C)
diff --git a/runtime/lang/menu_chinese_taiwan.950.vim b/runtime/lang/menu_chinese_taiwan.950.vim
new file mode 100644
index 000000000..f3b285913
--- /dev/null
+++ b/runtime/lang/menu_chinese_taiwan.950.vim
@@ -0,0 +1,284 @@
+" Menu Translations: Traditional Chinese (for Big5 UNIX/Windows)
+" Translated By: Hung-Teh, Lin <piaip@csie.ntu.edu.tw>
+" Last Change: Thu Apr 24 17:34:50 CST 2003
+
+" {{{ Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+" }}}
+
+scriptencoding cp950
+
+" {{{ Help menu: complete
+menutrans &Help »²§U»¡©ú(&H)
+" ------------------------------------------------------------------------
+menutrans &Overview<Tab><F1> »¡©ú¤å¥óÁ`Äý(&O)<Tab><F1>
+menutrans &User\ Manual ¨Ï¥ÎªÌ¤â¥U(&U)
+menutrans &How-to\ links ¦p¦ó§@\.\.\.(&H)
+menutrans &GUI ¹Ï«¬¬É­±(&G)
+menutrans &Credits ·PÁÂ(&C)
+menutrans Co&pying ª©Åv«Å§i(&P)
+menutrans O&rphans ¬@±Ï©t¨à(&R)
+" ------------------------------------------------------------------------
+menutrans &Version µ{¦¡ª©¥»¸ê°T(&V)
+menutrans &About Ãö©ó\ Vim(&A)
+" }}}
+
+" {{{ File menu: complete
+menutrans &File ÀÉ®×(&F)
+" ------------------------------------------------------------------------
+menutrans &Open\.\.\.<Tab>:e ¶}±Ò(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ¤À³Îµøµ¡¨Ã¶}±Ò(&L)<Tab>:sp
+menutrans &New<Tab>:enew ½s¿è·sÀÉ®×(&N)<Tab>:enew
+menutrans &Close<Tab>:close Ãö³¬ÀÉ®×(&C)<Tab>:close
+" ------------------------------------------------------------------------
+menutrans &Save<Tab>:w Àx¦s(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav ¥t¦s·sÀÉ(&A)\.\.\.<Tab>:sav
+" ------------------------------------------------------------------------
+menutrans Split\ &Diff\ with\.\.\. ¤ñ¸û(&Diff)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. °õ¦æPatch(&B)\.\.\.
+" ------------------------------------------------------------------------
+menutrans &Print ¦C¦L(&P)
+" ------------------------------------------------------------------------
+menutrans Sa&ve-Exit<Tab>:wqa Àx¦s¨ÃÂ÷¶}(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa Â÷¶}(&X)<Tab>:qa
+" }}}
+
+" {{{ Edit menu
+menutrans &Edit ½s¿è(&E)
+" ------------------------------------------------------------------------
+menutrans &Undo<Tab>u ´_­ì(&U)<Tab>u
+menutrans &Redo<Tab>^R ¨ú®ø¤W¦¸´_­ì(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. ­«½Æ¤W¦¸°Ê§@(&E)<Tab>\.
+" ------------------------------------------------------------------------
+menutrans Cu&t<Tab>"+x °Å¤U(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y ½Æ»s(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP ¶K¤W(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ¶K¨ì´å¼Ð«e(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p ¶K¨ì´å¼Ð«á(&A)<Tab>]p
+menutrans &Delete<Tab>x §R°£(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG ¥þ¿ï(&S)<Tab>ggvG
+" ------------------------------------------------------------------------
+menutrans &Find\.\.\. ´M§ä(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. ´M§ä¨Ã¨ú¥N(&L)\.\.\.
+" ------------------------------------------------------------------------
+menutrans Settings\ &Window ³]©wµøµ¡(&W)
+menutrans &Global\ Settings ¥þ°ì³]©w(&G)
+menutrans F&ile\ Settings ³]©w¦¹ÀÉ®×(&I)
+menutrans C&olor\ Scheme °t¦â³]©w(&O)
+menutrans &Keymap Áä½L¹ïÀ³(&K)
+ " "{{{ Keymap:
+ menutrans None µL
+ " }}}
+menutrans Select\ Fo&nt\.\.\. ³]©w¦r«¬(&N)\.\.\.
+" }}}
+
+" {{{ Edit.FileSettings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ¤Á´«Åã¥Ü¦æ¸¹(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ¤Á´«Åã¥Ü¦æ§À¤ÎTAB(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ¤Á´«¦Û°Ê§é¦æÅã¥Ü(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ¤Á´«§é¦æÅã¥Ü¥i¥ô·NÂ_¥y(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ¤Á´«®i¶}TAB(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ¤Á´«¦Û°ÊÁY±Æ(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! ¤Á´«¢Ñ»y¨¥ÁY±Æ(&C)<Tab>:set\ cin!
+" ------------------------------------------------------------------------
+menutrans &Shiftwidth ÁY±Æ¼e«×(shiftwidth)(&S)
+menutrans Soft\ &Tabstop ³nÅé¼ÒÀÀTAB(softtabstop)(&T)
+menutrans Te&xt\ Width\.\.\. ¤å¦r­¶­±¼e«×(textwidth)(&X)\.\.\.
+menutrans &File\ Format\.\.\. ³]©wÀɮ׮榡(¹ïÀ³§@·~¨t²Î)(&F)\.\.\.
+" }}}
+
+" {{{ Edit.GlobalSettings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ¤Á´«°ª«G«×·j´M¦r¦ê(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ¤Á´«©¿²¤¤j¤p¼g(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! ¤Á´«Åã¥Ü¹ïÀ³¬A¸¹(&S)<Tab>:set\ sm!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! ¤Á´«¶Ç²ÎVi¬Û®e¼Ò¦¡(&O)<Tab>:set\ cp!
+menutrans &Context\ lines ¥»¤å«e«á«O¯d¦æ¼Æ(scrolloff)(&C)
+menutrans &Virtual\ Edit ´å¼Ð¥ô·N²¾°Ê(virtualedit)(&V)
+ " {{{ Edit.GlobalSettings.VirtualEdit
+ menutrans Never ¤£¨Ï¥Î
+ menutrans Block\ Selection °Ï¶ô¿ï¾Ü®É
+ menutrans Insert\ mode ´¡¤J¼Ò¦¡®É
+ menutrans Block\ and\ Insert °Ï¶ô»P´¡¤J¼Ò¦¡
+ menutrans Always ¤@ª½¶}±Ò
+ " }}}
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ¤Á´«´¡¤J¼Ò¦¡(&M)<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. ·j´M¸ô®|(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. Tag\ ¼ÐÅÒ¯Á¤ÞÀÉ®×(&G)\.\.\.
+" ------------------------------------------------------------------------
+menutrans Toggle\ &Toolbar ¤Á´«¨Ï¥Î¤u¨ã¦C(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ¤Á´«¨Ï¥Î©³ºÝ±²°Ê¶b(&B)
+menutrans Toggle\ &Left\ Scrollbar ¤Á´«¨Ï¥Î¥ªºÝ±²°Ê¶b(&L)
+menutrans Toggle\ &Right\ Scrollbar ¤Á´«¨Ï¥Î¥kºÝ±²°Ê¶b(&R)
+" }}}
+
+" {{{ Tools menu: complete
+menutrans &Tools ¤u¨ã(&T)
+" ------------------------------------------------------------------------
+menutrans &Jump\ to\ this\ tag<Tab>g^] À˯Á´å¼Ð³Bªº¼ÐÅÒÃöÁä¦r(tag)(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T ¸õ¦^À˯Á«eªº¦ì¸m(&B)<Tab>^T
+menutrans Build\ &Tags\ File «Ø¥ß¼ÐÅÒ¯Á¤ÞÀÉ\ Tags(&T)
+" ------------------------------------------------------------------------
+menutrans &Folding ÂÐÅ|(Fold)³]©w(&F)
+ " {{{ Tools.Fold
+ menutrans &Enable/Disable\ folds<Tab>zi ¤Á´«¨Ï¥Î\ Folding(&E)<Tab>zi
+ menutrans &View\ Cursor\ Line<Tab>zv À˵ø¦¹¼h\ Fold(&V)<Tab>zv
+ menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx ¥uÀ˵ø¦¹\ Fold(&W)<Tab>zMzx
+ menutrans C&lose\ more\ folds<Tab>zm ¦¬°_¤@¼h\ Folds(&L)<Tab>zm
+ menutrans &Close\ all\ folds<Tab>zM ¦¬°_©Ò¦³\ Folds(&C)<Tab>zM
+ menutrans O&pen\ more\ folds<Tab>zr ¥´¶}¤@¼h\ Folds(&P)<Tab>zr
+ menutrans &Open\ all\ folds<Tab>zR ¥´¶}©Ò¦³\ Folds(&O)<Tab>zR
+ menutrans Fold\ Met&hod Folding\ ¤è¦¡(&H)
+ " {{{ Tools.Fold.Method
+ menutrans M&anual ¤â°Ê«Ø¥ß(&A)
+ menutrans I&ndent ¨Ì·ÓÁY±Æ(&N)
+ menutrans E&xpression ¦Û­q¹Bºâ¦¡(&X)
+ menutrans S&yntax ¨Ì·Ó»yªk³]©w(&Y)
+ menutrans &Diff Diff(&D)
+ menutrans Ma&rker ¼Ð°O(Marker)(&R)
+ " }}}
+ " ------------------------------------------------------------------------
+ menutrans Create\ &Fold<Tab>zf «Ø¥ß\ Fold(&F)<Tab>zf
+ menutrans &Delete\ Fold<Tab>zd §R°£\ Fold(&D)<Tab>zd
+ menutrans Delete\ &All\ Folds<Tab>zD §R°£©Ò¦³\ Fold(&A)<Tab>zD
+ " ------------------------------------------------------------------------
+ menutrans Fold\ column\ &width ³]©w\ FoldÄæ¼e(&W)
+ " }}}
+menutrans &Diff Diff(&D)
+ " {{{ Tools.Diff
+ menutrans &Update §ó·s(&U)
+ menutrans &Get\ Block ¨ú±o°Ï¶ô(&G)
+ menutrans &Put\ Block ¶K¤W°Ï¶ô(&P)
+ " }}}
+" ------------------------------------------------------------------------
+menutrans &Make<Tab>:make °õ¦æ\ Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl ¦C¥X½sĶ¿ù»~(&E)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ¦C¥X©Ò¦³°T®§(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ¤U¤@­Ó½sĶ¿ù»~³B(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ¤W¤@­Ó½sĶ¿ù»~³B(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold À˵ø¿ù»~¦Cªí(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew À˵ø·s¿ù»~¦Cªí(&E)<Tab>:cnew
+menutrans Error\ &Window ¿ù»~°T®§µøµ¡(&W)
+ " {{{ Tools.ErrorWindow
+ menutrans &Update<Tab>:cwin §ó·s(&U)<Tab>:cwin
+ menutrans &Open<Tab>:copen ¶}±Ò(&O)<Tab>:copen
+ menutrans &Close<Tab>:cclose Ãö³¬(&C)<Tab>:cclose
+ " }}}
+menutrans &Set\ Compiler ³]©w½sĶ¾¹Compiler(&S)
+" ------------------------------------------------------------------------
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Âà´«¦¨16¶i¦ì½X(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ±q16¶i¦ì½XÂà´«¦^¤å¦r(&R)<Tab>:%!xxd\ -r
+" }}}
+
+" {{{ Syntax menu: compete
+menutrans &Syntax »yªk®ÄªG(&S)
+" ------------------------------------------------------------------------
+menutrans &Show\ filetypes\ in\ menu Åã¥Ü©Ò¦³¥i¥ÎÀɮ׮榡(&S)
+menutrans Set\ '&syntax'\ only ¥u¨Ï¥Î\ 'syntax'(&S)
+menutrans Set\ '&filetype'\ too ¨Ï¥Î\ 'syntax'+'filetype'(&F)
+menutrans &Off Ãö³¬®ÄªG(&O)
+menutrans &Manual ¤â°Ê³]©w(&M)
+menutrans A&utomatic ¦Û°Ê³]©w(&U)
+menutrans on/off\ for\ &This\ file ¥u¤Á´«¦¹Àɪº®ÄªG³]©w(&T)
+" ------------------------------------------------------------------------
+menutrans Co&lor\ test ¦â±mÅã¥Ü´ú¸Õ(&L)
+menutrans &Highlight\ test »yªk®ÄªG´ú¸Õ(&H)
+menutrans &Convert\ to\ HTML Âà´«¦¨\ HTML\ ®æ¦¡(&C)
+" }}}
+
+" {{{ Buffers menu: complete
+menutrans &Buffers ½w½Ä°Ï(&B)
+" ------------------------------------------------------------------------
+menutrans &Refresh\ menu §ó·s(&R)
+menutrans &Delete §R°£(&D)
+menutrans &Alternate ¤Á´«¤W¦¸½s¿è½w½Ä°Ï(&A)
+menutrans &Next ¤U¤@­Ó(&N)
+menutrans &Previous «e¤@­Ó(&P)
+" ------------------------------------------------------------------------
+" menutrans [No\ file] [µLÀÉ®×]
+" }}}
+
+" {{{ Window menu: complete
+menutrans &Window µøµ¡(&W)
+" ------------------------------------------------------------------------
+menutrans &New<Tab>^Wn ¶}·sµøµ¡(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws ¤À³Îµøµ¡(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ¤À³Î¨ì#(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ««ª½¤À³Î(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer ÀÉ®×Á`ºÞ¦¡¤À³Î(&X)
+" ------------------------------------------------------------------------
+menutrans &Close<Tab>^Wc Ãö³¬µøµ¡(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Ãö³¬¨ä¥¦µøµ¡(&O)<Tab>^Wo
+" ------------------------------------------------------------------------
+menutrans Move\ &To ²¾¦Ü(&T)
+ " {{{ Window.MoveTo
+ menutrans &Top<Tab>^WK ³»ºÝ(&T)<Tab>^WK
+ menutrans &Bottom<Tab>^WJ ©³ºÝ(&B)<Tab>^WJ
+ menutrans &Left\ side<Tab>^WH ¥ªÃä(&L)<Tab>^WH
+ menutrans &Right\ side<Tab>^WL ¥kÃä(&R)<Tab>^WL
+ " }}}
+menutrans Rotate\ &Up<Tab>^WR ¤W²¾µøµ¡(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ¤U²¾µøµ¡(&D)<Tab>^Wr
+" ------------------------------------------------------------------------
+menutrans &Equal\ Size<Tab>^W= ©Ò¦³µøµ¡µ¥°ª(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ³Ì¤j°ª«×(&M)<Tab>^W
+menutrans M&in\ Height<Tab>^W1_ ³Ì¤p°ª«×(&I)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ³Ì¤j¼e«×(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ³Ì¤p¼e«×(&H)<Tab>^W1\|
+" }}}
+
+" {{{ The popup menu: complete
+menutrans &Undo ´_­ì(&U)
+" ------------------------------------------------------------------------
+menutrans Cu&t °Å¤U(&T)
+menutrans &Copy ½Æ»s(&C)
+menutrans &Paste ¶K¤W(&P)
+menutrans &Delete §R°£(&D)
+" ------------------------------------------------------------------------
+menutrans Select\ Blockwise Blockwise¦¡¿ï¾Ü
+menutrans Select\ &Word ¿ï¾Ü³æ¦r(&W)
+menutrans Select\ &Line ¿ï¾Ü¦æ(&L)
+menutrans Select\ &Block ¿ï¾Ü°Ï¶ô(&B)
+menutrans Select\ &All ¥þ¿ï(&A)
+" }}}
+
+" {{{ The GUI toolbar: complete
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ¶}±ÒÀÉ®×
+ tmenu ToolBar.Save Àx¦s¥Ø«e½s¿è¤¤ªºÀÉ®×
+ tmenu ToolBar.SaveAll Àx¦s¥þ³¡ÀÉ®×
+ tmenu ToolBar.Print ¦C¦L
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Undo ´_­ì¤W¦¸ÅÜ°Ê
+ tmenu ToolBar.Redo ¨ú®ø¤W¦¸´_­ì°Ê§@
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Cut °Å¤U¦Ü°Å¶Kï
+ tmenu ToolBar.Copy ½Æ»s¨ì°Å¶Kï
+ tmenu ToolBar.Paste ¥Ñ°Å¶Kï¶K¤W
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Find ´M§ä...
+ tmenu ToolBar.FindNext §ä¤U¤@­Ó
+ tmenu ToolBar.FindPrev §ä¤W¤@­Ó
+ tmenu ToolBar.Replace ¨ú¥N...
+" ------------------------------------------------------------------------
+ tmenu ToolBar.LoadSesn ¸ü¤J Session
+ tmenu ToolBar.SaveSesn Àx¦s¥Ø«eªº Session
+ tmenu ToolBar.RunScript °õ¦æ Vim µ{¦¡ÀÉ
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Make °õ¦æ Make
+ tmenu ToolBar.Shell ¶}±Ò¤@­Ó©R¥O¦Cµøµ¡ DosBox
+ tmenu ToolBar.RunCtags °õ¦æ ctags
+ tmenu ToolBar.TagJump ¸õ¨ì¥Ø«e´å¼Ð¦ì¸mªº tag
+ tmenu ToolBar.Help Vim »²§U»¡©ú
+ tmenu ToolBar.FindHelp ·j´M Vim »¡©ú¤å¥ó
+ endfun
+endif
+" }}}
+
+" vim:foldmethod=marker:nowrap:foldcolumn=2:foldlevel=1
diff --git a/runtime/lang/menu_cs.cp1250.vim b/runtime/lang/menu_cs.cp1250.vim
new file mode 100644
index 000000000..becbd93b7
--- /dev/null
+++ b/runtime/lang/menu_cs.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Czech
+
+source <sfile>:p:h/menu_czech_czech_republic.1250.vim
diff --git a/runtime/lang/menu_cs.latin1.vim b/runtime/lang/menu_cs.latin1.vim
new file mode 100644
index 000000000..efb28a003
--- /dev/null
+++ b/runtime/lang/menu_cs.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Czech
+
+source <sfile>:p:h/menu_czech_czech_republic.1252.vim
diff --git a/runtime/lang/menu_cs_cz.cp1250.vim b/runtime/lang/menu_cs_cz.cp1250.vim
new file mode 100644
index 000000000..becbd93b7
--- /dev/null
+++ b/runtime/lang/menu_cs_cz.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Czech
+
+source <sfile>:p:h/menu_czech_czech_republic.1250.vim
diff --git a/runtime/lang/menu_cs_cz.iso_8859-2.vim b/runtime/lang/menu_cs_cz.iso_8859-2.vim
new file mode 100644
index 000000000..e4aeb4f14
--- /dev/null
+++ b/runtime/lang/menu_cs_cz.iso_8859-2.vim
@@ -0,0 +1,245 @@
+" Menu Translations: Czech for ISO-8859-2
+" Maintainer: Jiri Brezina <brzj@seznam.cz>
+" vim:set foldmethod=marker:
+" $Revision$
+" $Date$
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding ISO-8859-2
+
+" {{{ File menu
+menutrans &File &Soubor
+menutrans &Open\.\.\.<Tab>:e &Otevøít\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Otevøít\ v\ no&vém\ oknì\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nový<Tab>:enew
+menutrans &Close<Tab>:close &Zavøít<Tab>:close
+menutrans &Save<Tab>:w &Ulo¾it<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Ulo¾it\ &jako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Rozdìlit\ okno\ -\ &Diff\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Rozdìlit\ okno\ -\ &Patch\.\.\.
+menutrans &Print &Tisk
+menutrans Sa&ve-Exit<Tab>:wqa U&lo¾it\ -\ Konec<Tab>:wqa
+menutrans E&xit<Tab>:qa &Konec<Tab>:qa
+" }}}
+
+" {{{ Edit menu
+menutrans &Edit Úpr&avy
+menutrans &Undo<Tab>u &Zpìt<Tab>u
+menutrans &Redo<Tab>^R Z&ru¹it\ vrácení<Tab>^R
+menutrans Rep&eat<Tab>\. &Opakovat<Tab>\.
+menutrans Cu&t<Tab>"+x &Vyøíznout<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopírovat<Tab>"+y
+menutrans &Paste<Tab>"+gP V&lo¾it<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Vlo¾it\ &pøed<Tab>[p
+menutrans Put\ &After<Tab>]p Vlo¾i&t\ za<Tab>]p
+menutrans &Delete<Tab>x &Smazat<Tab>x
+menutrans &Select\ all<Tab>ggVG Vy&brat\ v¹e<Tab>ggVG
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\.
+menutrans Options\.\.\. Volb&y\.\.\.
+menutrans Settings\ &Window Nastav&ení\ okna
+ " {{{2 Edit -1
+menutrans &Global\ Settings &Globální\ nastavení
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Pøepnout\ zvýraznìní\ vzoru<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Pøepnout\ ignorování\ &VERZÁLEK<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Pøepnout\ &Showmatch\ \{\(\[\])\}<Tab>:set\ sm!
+menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru
+menutrans &Virtual\ Edit Virtuální\ p&ozice\ kurzoru
+ menutrans Never Nikdy
+ menutrans Block\ Selection Výbìr\ Bloku
+ menutrans Insert\ mode Insert\ mód
+ menutrans Block\ and\ Insert Blok\ a\ Insert
+ menutrans Always V¾dycky
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Pøepnout\ Insert\ mó&d<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Pøepnout\ kompatibilní\ re¾im\ s\ 'vi'<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledávání\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\.
+menutrans Toggle\ &Toolbar Pøepnout\ &Toolbar
+menutrans Toggle\ &Bottom\ Scrollbar Pø&epnout\ dolní\ rolovací\ li¹tu
+menutrans Toggle\ &Left\ Scrollbar Pøepnout\ &levou\ rolovací\ li¹tu
+menutrans Toggle\ &Right\ Scrollbar Pøepnout\ p&ravou\ rolovací\ li¹tu
+ " {{{2 Edit -2
+menutrans F&ile\ Settings Nastavení\ so&uboru
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Pøepnout\ èíslování\ øá&dkù<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Pøepnout\ &List\ mód<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Pøepnout\ zala&mování\ øádkù<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Pøepnout\ zl&om\ ve\ slovì<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Pøepnout\ &expand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Pøepnout\ &auto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Pøepnout\ &C-indenting<Tab>:set\ cin!
+menutrans &Shiftwidth Nastav&it\ ¹íøku\ od&sazení
+menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop
+menutrans Te&xt\ Width\.\.\. ©íøka\ te&xtu\.\.\.
+menutrans &File\ Format\.\.\. &Formát\ souboru\.\.\.
+ " {{{2 Edit -3
+menutrans C&olor\ Scheme Barevné\ s&chéma
+menutrans &Keymap Klávesová\ m&apa
+menutrans Select\ Fo&nt\.\.\. Vybrat\ pís&mo\.\.\.
+" }}}1
+
+" {{{ Programming menu
+menutrans &Tools Nást&roje
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèit\ na\ tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skoèit\ &zpìt<Tab>^T
+menutrans Build\ &Tags\ File &Vytvoøit\ soubor\ tagù
+
+menutrans &Folding &Foldy
+menutrans &Enable/Disable\ folds<Tab>zi &Ano/Ne<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Zobrazit\ øádek\ kurzoru<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Zo&brazit\ pouze\ øádek\ kurzoru\ <Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Vyjmout\ jednu\ úroveò\ foldù<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zavøí&t\ v¹echny\ foldy<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Pøidat\ jedn&u\ úroveò\ foldù<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Otevøít\ v¹echny\ foldy<Tab>zR
+menutrans Fold\ Met&hod Metoda\ &skládání
+ "menutrans M&anual &Ruènì
+ "menutrans I&ndent &Odsazení
+ "menutrans E&xpression &Výraz
+ "menutrans S&yntax &Syntax
+ "menutrans &Diff &Diff
+ "menutrans Ma&rker Ma&rker
+menutrans Create\ &Fold<Tab>zf Vytvoøit\ &fold<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Vymazat\ fol&d<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD V&ymazat\ v¹echny\ foldy<Tab>zD
+menutrans Fold\ col&umn\ width Sloupec\ zob&razení\ foldù
+
+menutrans &Update &Obnovit
+menutrans &Get\ Block &Sejmout\ Blok
+menutrans &Put\ Block &Vlo¾it\ Blok
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Výpis\ &chyb<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Výp&is\ zpráv<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Dal¹í\ ch&yba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Pøedchozí\ chyba<Tab>:cp
+menutrans &Older\ List<Tab>:cold Sta&r¹í\ seznam<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew N&ovìj¹í\ seznam<Tab>:cnew
+menutrans Error\ &Window Chybové\ o&kno
+menutrans &Update<Tab>:cwin O&bnovit<Tab>:cwin
+menutrans &Open<Tab>:copen &Otevøít<Tab>:copen
+menutrans &Close<Tab>:cclose &Zavøít<Tab>:cclose
+menutrans &Set\ Compiler N&astavit\ kompilátor
+
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Pøevést\ do\ ¹estnáctkového\ formát&u<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pø&evést\ zpìt<Tab>:%!xxd\ -r
+" }}}
+
+" {{{ Syntax menu
+menutrans &Syntax Synta&xe
+menutrans Set\ '&syntax'\ only Nastavit\ pouze\ 'synta&x'
+menutrans Set\ '&filetype'\ too Nastavit\ také\ '&filetype'
+menutrans &Off &Vypnout
+menutrans &Manual &Ruènì
+menutrans A&utomatic A&utomaticky
+menutrans on/off\ for\ &This\ file &Pøepnout\ (pro\ tento\ soubor)
+menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor)
+menutrans Co&lor\ test Test\ &barev
+menutrans &Highlight\ test &Test\ zvýrazòování
+menutrans &Convert\ to\ HTML Pøevést\ &do\ HTML
+menutrans &Show\ filetypes\ in\ menu &Zobrazit\ výbìr\ mo¾ností
+" }}}
+
+" {{{ Menu Buffers
+menutrans &Buffers &Buffery
+menutrans &Refresh\ menu &Obnovit\ menu
+menutrans &Delete Z&ru¹it
+menutrans &Alternate &Zmìnit
+menutrans &Next &Dal¹í
+menutrans &Previous &Pøedchozí
+menutrans [No\ File] [®ádný\ soubor]
+" }}}
+
+" {{{ Menu Window
+menutrans &Window &Okna
+menutrans &New<Tab>^Wn &Nové<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Rozdìlit<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Ro&zdìlit\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Rozdìlit\ &vertikálnì<Tab>^Wv
+menutrans Split\ File\ E&xplorer Rozdìlit\ -\ File\ E&xplorer
+menutrans Move\ &To &Pøesun
+menutrans &Top<Tab>^WK &Nahoru<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Dolu<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Vlevo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Vp&ravo<Tab>^WL
+
+menutrans &Close<Tab>^Wc Zavøí&t<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zavøít\ &ostatní<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Dal¹í<Tab>^Ww
+menutrans P&revious<Tab>^WW &Pøedchozí<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Stejná\ vý¹ka<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Maximální\ vý¹&ka<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ M&inimální\ vý¹ka<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| &Maximální\ ¹íøka<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimální\ ¹íøk&a<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Rotovat\ na&horu<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotovat\ &dolù<Tab>^Wr
+
+" {{{ Help menu
+menutrans &Help &Nápovìda
+menutrans &Overview<Tab><F1> &Pøehled<Tab><F1>
+menutrans &User\ Manual &U¾ivatelský\ Manuál
+menutrans &How-to\ links Ho&wto
+menutrans &GUI &Grafické\ rozhraní
+menutrans &Credits &Autoøi
+menutrans Co&pying &Licenèní\ politika
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans O&rphans O&siøelé\ dìti
+menutrans &Version &Verze
+menutrans &About &O\ aplikaci
+" }}}
+
+" {{{ The popup menu
+menutrans &Undo &Zpìt
+menutrans Cu&t &Vyøíznout
+menutrans &Copy &Kopírovat
+menutrans &Paste &Vlo¾it
+menutrans &Delete &Smazat
+menutrans Select\ Blockwise Vybrat\ blokovì
+menutrans Select\ &Word Vybrat\ &slovo
+menutrans Select\ &Line Vybrat\ &øádek
+menutrans Select\ &Block Vybrat\ &blok
+menutrans Select\ &All Vybrat\ &v¹e
+" }}}
+
+" {{{ The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otevøít soubor
+ tmenu ToolBar.Save Ulo¾it soubor
+ tmenu ToolBar.SaveAll Ulo¾it v¹echny soubory
+ tmenu ToolBar.Print Tisk
+ tmenu ToolBar.Undo Zpìt
+ tmenu ToolBar.Redo Zru¹it vrácení
+ tmenu ToolBar.Cut Vyøíznout
+ tmenu ToolBar.Copy Kopírovat
+ tmenu ToolBar.Paste Vlo¾it
+ tmenu ToolBar.Find Hledat...
+ tmenu ToolBar.FindNext Hledat dal¹í
+ tmenu ToolBar.FindPrev Hledat pøedchozí
+ tmenu ToolBar.Replace Nahradit...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nové okno
+ tmenu ToolBar.WinSplit Rozdìlit okno
+ tmenu ToolBar.WinMax Maximalizovat okno
+ tmenu ToolBar.WinMin Minimalizovat okno
+ tmenu ToolBar.WinClose Zavøít okno
+ endif
+ tmenu ToolBar.LoadSesn Naèíst sezení
+ tmenu ToolBar.SaveSesn Ulo¾it sezení
+ tmenu ToolBar.RunScript Spustit skript
+ tmenu ToolBar.Make Spustit make
+ tmenu ToolBar.Shell Spustit shell
+ tmenu ToolBar.RunCtags Spustit ctags
+ tmenu ToolBar.TagJump Skoèit na tag pod kurzorem
+ tmenu ToolBar.Help Nápovìda
+ tmenu ToolBar.FindHelp Hledat nápovìdu k...
+ endfun
+endif
+" }}}
diff --git a/runtime/lang/menu_cs_cz.latin1.vim b/runtime/lang/menu_cs_cz.latin1.vim
new file mode 100644
index 000000000..efb28a003
--- /dev/null
+++ b/runtime/lang/menu_cs_cz.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Czech
+
+source <sfile>:p:h/menu_czech_czech_republic.1252.vim
diff --git a/runtime/lang/menu_czech_czech_republic.1250.vim b/runtime/lang/menu_czech_czech_republic.1250.vim
new file mode 100644
index 000000000..2bff9e277
--- /dev/null
+++ b/runtime/lang/menu_czech_czech_republic.1250.vim
@@ -0,0 +1,245 @@
+" Menu Translations: Czech for MS-Windows
+" Maintainer: Jiri Brezina <brzj@seznam.cz>
+" vim:set foldmethod=marker:
+" $Revision$
+" $Date$
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding cp1250
+
+" {{{ File menu
+menutrans &File &Soubor
+menutrans &Open\.\.\.<Tab>:e &Otevøít\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Otevøít\ v\ no&vém\ oknì\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nový<Tab>:enew
+menutrans &Close<Tab>:close &Zavøít<Tab>:close
+menutrans &Save<Tab>:w &Uložit<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Uložit\ &jako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Rozdìlit\ okno\ -\ &Diff\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Rozdìlit\ okno\ -\ &Patch\.\.\.
+menutrans &Print &Tisk
+menutrans Sa&ve-Exit<Tab>:wqa U&ložit\ -\ Konec<Tab>:wqa
+menutrans E&xit<Tab>:qa &Konec<Tab>:qa
+" }}}
+
+" {{{ Edit menu
+menutrans &Edit Úpr&avy
+menutrans &Undo<Tab>u &Zpìt<Tab>u
+menutrans &Redo<Tab>^R Z&rušit\ vrácení<Tab>^R
+menutrans Rep&eat<Tab>\. &Opakovat<Tab>\.
+menutrans Cu&t<Tab>"+x &Vyøíznout<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopírovat<Tab>"+y
+menutrans &Paste<Tab>"+gP V&ložit<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Vložit\ &pøed<Tab>[p
+menutrans Put\ &After<Tab>]p Vloži&t\ za<Tab>]p
+menutrans &Delete<Tab>x &Smazat<Tab>x
+menutrans &Select\ all<Tab>ggVG Vy&brat\ vše<Tab>ggVG
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\.
+menutrans Options\.\.\. Volb&y\.\.\.
+menutrans Settings\ &Window Nastav&ení\ okna
+ " {{{2 Edit -1
+menutrans &Global\ Settings &Globální\ nastavení
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Pøepnout\ zvýraznìní\ vzoru<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Pøepnout\ ignorování\ &VERZÁLEK<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Pøepnout\ &Showmatch\ \{\(\[\])\}<Tab>:set\ sm!
+menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru
+menutrans &Virtual\ Edit Virtuální\ p&ozice\ kurzoru
+ menutrans Never Nikdy
+ menutrans Block\ Selection Výbìr\ Bloku
+ menutrans Insert\ mode Insert\ mód
+ menutrans Block\ and\ Insert Blok\ a\ Insert
+ menutrans Always Vždycky
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Pøepnout\ Insert\ mó&d<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Pøepnout\ kompatibilní\ režim\ s\ 'vi'<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledávání\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\.
+menutrans Toggle\ &Toolbar Pøepnout\ &Toolbar
+menutrans Toggle\ &Bottom\ Scrollbar Pø&epnout\ dolní\ rolovací\ lištu
+menutrans Toggle\ &Left\ Scrollbar Pøepnout\ &levou\ rolovací\ lištu
+menutrans Toggle\ &Right\ Scrollbar Pøepnout\ p&ravou\ rolovací\ lištu
+ " {{{2 Edit -2
+menutrans F&ile\ Settings Nastavení\ so&uboru
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Pøepnout\ èíslování\ øá&dkù<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Pøepnout\ &List\ mód<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Pøepnout\ zala&mování\ øádkù<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Pøepnout\ zl&om\ ve\ slovì<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Pøepnout\ &expand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Pøepnout\ &auto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Pøepnout\ &C-indenting<Tab>:set\ cin!
+menutrans &Shiftwidth Nastav&it\ šíøku\ od&sazení
+menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop
+menutrans Te&xt\ Width\.\.\. Šíøka\ te&xtu\.\.\.
+menutrans &File\ Format\.\.\. &Formát\ souboru\.\.\.
+ " {{{2 Edit -3
+menutrans C&olor\ Scheme Barevné\ s&chéma
+menutrans &Keymap Klávesová\ m&apa
+menutrans Select\ Fo&nt\.\.\. Vybrat\ pís&mo\.\.\.
+" }}}1
+
+" {{{ Programming menu
+menutrans &Tools Nást&roje
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèit\ na\ tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skoèit\ &zpìt<Tab>^T
+menutrans Build\ &Tags\ File &Vytvoøit\ soubor\ tagù
+
+menutrans &Folding &Foldy
+menutrans &Enable/Disable\ folds<Tab>zi &Ano/Ne<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Zobrazit\ øádek\ kurzoru<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Zo&brazit\ pouze\ øádek\ kurzoru\ <Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Vyjmout\ jednu\ úroveò\ foldù<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zavøí&t\ všechny\ foldy<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Pøidat\ jedn&u\ úroveò\ foldù<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Otevøít\ všechny\ foldy<Tab>zR
+menutrans Fold\ Met&hod Metoda\ &skládání
+ "menutrans M&anual &Ruènì
+ "menutrans I&ndent &Odsazení
+ "menutrans E&xpression &Výraz
+ "menutrans S&yntax &Syntax
+ "menutrans &Diff &Diff
+ "menutrans Ma&rker Ma&rker
+menutrans Create\ &Fold<Tab>zf Vytvoøit\ &fold<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Vymazat\ fol&d<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD V&ymazat\ všechny\ foldy<Tab>zD
+menutrans Fold\ col&umn\ width Sloupec\ zob&razení\ foldù
+
+menutrans &Update &Obnovit
+menutrans &Get\ Block &Sejmout\ Blok
+menutrans &Put\ Block &Vložit\ Blok
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Výpis\ &chyb<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Výp&is\ zpráv<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Další\ ch&yba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Pøedchozí\ chyba<Tab>:cp
+menutrans &Older\ List<Tab>:cold Sta&rší\ seznam<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew N&ovìjší\ seznam<Tab>:cnew
+menutrans Error\ &Window Chybové\ o&kno
+menutrans &Update<Tab>:cwin O&bnovit<Tab>:cwin
+menutrans &Open<Tab>:copen &Otevøít<Tab>:copen
+menutrans &Close<Tab>:cclose &Zavøít<Tab>:cclose
+menutrans &Set\ Compiler N&astavit\ kompilátor
+
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Pøevést\ do\ šestnáctkového\ formát&u<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pø&evést\ zpìt<Tab>:%!xxd\ -r
+" }}}
+
+" {{{ Syntax menu
+menutrans &Syntax Synta&xe
+menutrans Set\ '&syntax'\ only Nastavit\ pouze\ 'synta&x'
+menutrans Set\ '&filetype'\ too Nastavit\ také\ '&filetype'
+menutrans &Off &Vypnout
+menutrans &Manual &Ruènì
+menutrans A&utomatic A&utomaticky
+menutrans on/off\ for\ &This\ file &Pøepnout\ (pro\ tento\ soubor)
+menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor)
+menutrans Co&lor\ test Test\ &barev
+menutrans &Highlight\ test &Test\ zvýrazòování
+menutrans &Convert\ to\ HTML Pøevést\ &do\ HTML
+menutrans &Show\ filetypes\ in\ menu &Zobrazit\ výbìr\ možností
+" }}}
+
+" {{{ Menu Buffers
+menutrans &Buffers &Buffery
+menutrans &Refresh\ menu &Obnovit\ menu
+menutrans &Delete Z&rušit
+menutrans &Alternate &Zmìnit
+menutrans &Next &Další
+menutrans &Previous &Pøedchozí
+menutrans [No\ File] [Žádný\ soubor]
+" }}}
+
+" {{{ Menu Window
+menutrans &Window &Okna
+menutrans &New<Tab>^Wn &Nové<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Rozdìlit<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Ro&zdìlit\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Rozdìlit\ &vertikálnì<Tab>^Wv
+menutrans Split\ File\ E&xplorer Rozdìlit\ -\ File\ E&xplorer
+menutrans Move\ &To &Pøesun
+menutrans &Top<Tab>^WK &Nahoru<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Dolu<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Vlevo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Vp&ravo<Tab>^WL
+
+menutrans &Close<Tab>^Wc Zavøí&t<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zavøít\ &ostatní<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Další<Tab>^Ww
+menutrans P&revious<Tab>^WW &Pøedchozí<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Stejná\ výška<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Maximální\ výš&ka<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ M&inimální\ výška<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| &Maximální\ šíøka<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimální\ šíøk&a<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Rotovat\ na&horu<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotovat\ &dolù<Tab>^Wr
+
+" {{{ Help menu
+menutrans &Help &Nápovìda
+menutrans &Overview<Tab><F1> &Pøehled<Tab><F1>
+menutrans &User\ Manual &Uživatelský\ Manuál
+menutrans &How-to\ links Ho&wto
+menutrans &GUI &Grafické\ rozhraní
+menutrans &Credits &Autoøi
+menutrans Co&pying &Licenèní\ politika
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans O&rphans O&siøelé\ dìti
+menutrans &Version &Verze
+menutrans &About &O\ aplikaci
+" }}}
+
+" {{{ The popup menu
+menutrans &Undo &Zpìt
+menutrans Cu&t &Vyøíznout
+menutrans &Copy &Kopírovat
+menutrans &Paste &Vložit
+menutrans &Delete &Smazat
+menutrans Select\ Blockwise Vybrat\ blokovì
+menutrans Select\ &Word Vybrat\ &slovo
+menutrans Select\ &Line Vybrat\ &øádek
+menutrans Select\ &Block Vybrat\ &blok
+menutrans Select\ &All Vybrat\ &vše
+" }}}
+
+" {{{ The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otevøít soubor
+ tmenu ToolBar.Save Uložit soubor
+ tmenu ToolBar.SaveAll Uložit všechny soubory
+ tmenu ToolBar.Print Tisk
+ tmenu ToolBar.Undo Zpìt
+ tmenu ToolBar.Redo Zrušit vrácení
+ tmenu ToolBar.Cut Vyøíznout
+ tmenu ToolBar.Copy Kopírovat
+ tmenu ToolBar.Paste Vložit
+ tmenu ToolBar.Find Hledat...
+ tmenu ToolBar.FindNext Hledat další
+ tmenu ToolBar.FindPrev Hledat pøedchozí
+ tmenu ToolBar.Replace Nahradit...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nové okno
+ tmenu ToolBar.WinSplit Rozdìlit okno
+ tmenu ToolBar.WinMax Maximalizovat okno
+ tmenu ToolBar.WinMin Minimalizovat okno
+ tmenu ToolBar.WinClose Zavøít okno
+ endif
+ tmenu ToolBar.LoadSesn Naèíst sezení
+ tmenu ToolBar.SaveSesn Uložit sezení
+ tmenu ToolBar.RunScript Spustit skript
+ tmenu ToolBar.Make Spustit make
+ tmenu ToolBar.Shell Spustit shell
+ tmenu ToolBar.RunCtags Spustit ctags
+ tmenu ToolBar.TagJump Skoèit na tag pod kurzorem
+ tmenu ToolBar.Help Nápovìda
+ tmenu ToolBar.FindHelp Hledat nápovìdu k...
+ endfun
+endif
+" }}}
diff --git a/runtime/lang/menu_czech_czech_republic.1252.vim b/runtime/lang/menu_czech_czech_republic.1252.vim
new file mode 100644
index 000000000..27e1fb4f2
--- /dev/null
+++ b/runtime/lang/menu_czech_czech_republic.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Czech for Windows in ASCII encoding
+
+source <sfile>:p:h/menu_czech_czech_republic.ascii.vim
diff --git a/runtime/lang/menu_czech_czech_republic.ascii.vim b/runtime/lang/menu_czech_czech_republic.ascii.vim
new file mode 100644
index 000000000..1f2e96e9b
--- /dev/null
+++ b/runtime/lang/menu_czech_czech_republic.ascii.vim
@@ -0,0 +1,245 @@
+" Menu Translations: Czech for systems without localization
+" Maintainer: Jiri Brezina <brzj@seznam.cz>
+" vim:set foldmethod=marker:
+" $Revision$
+" $Date$
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+
+
+" {{{ File menu
+menutrans &File &Soubor
+menutrans &Open\.\.\.<Tab>:e &Otevrit\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Otevrit\ v\ no&vem\ okne\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Novy<Tab>:enew
+menutrans &Close<Tab>:close &Zavrit<Tab>:close
+menutrans &Save<Tab>:w &Ulozit<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Ulozit\ &jako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Rozdelit\ okno\ -\ &Diff\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Rozdelit\ okno\ -\ &Patch\.\.\.
+menutrans &Print &Tisk
+menutrans Sa&ve-Exit<Tab>:wqa U&lozit\ -\ Konec<Tab>:wqa
+menutrans E&xit<Tab>:qa &Konec<Tab>:qa
+" }}}
+
+" {{{ Edit menu
+menutrans &Edit Upr&avy
+menutrans &Undo<Tab>u &Zpet<Tab>u
+menutrans &Redo<Tab>^R Z&rusit\ vraceni<Tab>^R
+menutrans Rep&eat<Tab>\. &Opakovat<Tab>\.
+menutrans Cu&t<Tab>"+x &Vyriznout<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopirovat<Tab>"+y
+menutrans &Paste<Tab>"+gP V&lozit<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Vlozit\ &pred<Tab>[p
+menutrans Put\ &After<Tab>]p Vlozi&t\ za<Tab>]p
+menutrans &Delete<Tab>x &Smazat<Tab>x
+menutrans &Select\ all<Tab>ggVG Vy&brat\ vse<Tab>ggVG
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. &Nahradit\.\.\.
+menutrans Options\.\.\. Volb&y\.\.\.
+menutrans Settings\ &Window Nastav&eni\ okna
+ " {{{2 Edit -1
+menutrans &Global\ Settings &Globalni\ nastaveni
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Prepnout\ zvyrazneni\ vzoru<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Prepnout\ ignorovani\ &VERZALEK<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Prepnout\ &Showmatch\ \{\(\[\])\}<Tab>:set\ sm!
+menutrans &Context\ lines Zobrazit\ konte&xt\ kurzoru
+menutrans &Virtual\ Edit Virtualni\ p&ozice\ kurzoru
+ menutrans Never Nikdy
+ menutrans Block\ Selection Vyber\ Bloku
+ menutrans Insert\ mode Insert\ mod
+ menutrans Block\ and\ Insert Blok\ a\ Insert
+ menutrans Always Vzdycky
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Prepnout\ Insert\ mo&d<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Prepnout\ kompatibilni\ rezim\ s\ 'vi'<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Nastavit\ &cestu\ k\ prohledavani\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&g\ soubory\.\.\.
+menutrans Toggle\ &Toolbar Prepnout\ &Toolbar
+menutrans Toggle\ &Bottom\ Scrollbar Pr&epnout\ dolni\ rolovaci\ listu
+menutrans Toggle\ &Left\ Scrollbar Prepnout\ &levou\ rolovaci\ listu
+menutrans Toggle\ &Right\ Scrollbar Prepnout\ p&ravou\ rolovaci\ listu
+ " {{{2 Edit -2
+menutrans F&ile\ Settings Nastaveni\ so&uboru
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Prepnout\ cislovani\ ra&dku<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Prepnout\ &List\ mod<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Prepnout\ zala&movani\ radku<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prepnout\ zl&om\ ve\ slove<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Prepnout\ &expand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Prepnout\ &auto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Prepnout\ &C-indenting<Tab>:set\ cin!
+menutrans &Shiftwidth Nastav&it\ sirku\ od&sazeni
+menutrans Soft\ &Tabstop Nastavit\ Soft\ &Tabstop
+menutrans Te&xt\ Width\.\.\. Sirka\ te&xtu\.\.\.
+menutrans &File\ Format\.\.\. &Format\ souboru\.\.\.
+ " {{{2 Edit -3
+menutrans C&olor\ Scheme Barevne\ s&chema
+menutrans &Keymap Klavesova\ m&apa
+menutrans Select\ Fo&nt\.\.\. Vybrat\ pis&mo\.\.\.
+" }}}1
+
+" {{{ Programming menu
+menutrans &Tools Nast&roje
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skocit\ na\ tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skocit\ &zpet<Tab>^T
+menutrans Build\ &Tags\ File &Vytvorit\ soubor\ tagu
+
+menutrans &Folding &Foldy
+menutrans &Enable/Disable\ folds<Tab>zi &Ano/Ne<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Zobrazit\ radek\ kurzoru<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Zo&brazit\ pouze\ radek\ kurzoru\ <Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Vyjmout\ jednu\ uroven\ foldu<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zavri&t\ vsechny\ foldy<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Pridat\ jedn&u\ uroven\ foldu<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Otevrit\ vsechny\ foldy<Tab>zR
+menutrans Fold\ Met&hod Metoda\ &skladani
+ "menutrans M&anual &Rucne
+ "menutrans I&ndent &Odsazeni
+ "menutrans E&xpression &Vyraz
+ "menutrans S&yntax &Syntax
+ "menutrans &Diff &Diff
+ "menutrans Ma&rker Ma&rker
+menutrans Create\ &Fold<Tab>zf Vytvorit\ &fold<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Vymazat\ fol&d<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD V&ymazat\ vsechny\ foldy<Tab>zD
+menutrans Fold\ col&umn\ width Sloupec\ zob&razeni\ foldu
+
+menutrans &Update &Obnovit
+menutrans &Get\ Block &Sejmout\ Blok
+menutrans &Put\ Block &Vlozit\ Blok
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Vypis\ &chyb<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Vyp&is\ zprav<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Dalsi\ ch&yba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Predchozi\ chyba<Tab>:cp
+menutrans &Older\ List<Tab>:cold Sta&rsi\ seznam<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew N&ovejsi\ seznam<Tab>:cnew
+menutrans Error\ &Window Chybove\ o&kno
+menutrans &Update<Tab>:cwin O&bnovit<Tab>:cwin
+menutrans &Open<Tab>:copen &Otevrit<Tab>:copen
+menutrans &Close<Tab>:cclose &Zavrit<Tab>:cclose
+menutrans &Set\ Compiler N&astavit\ kompilator
+
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Prevest\ do\ sestnactkoveho\ format&u<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pr&evest\ zpet<Tab>:%!xxd\ -r
+" }}}
+
+" {{{ Syntax menu
+menutrans &Syntax Synta&xe
+menutrans Set\ '&syntax'\ only Nastavit\ pouze\ 'synta&x'
+menutrans Set\ '&filetype'\ too Nastavit\ take\ '&filetype'
+menutrans &Off &Vypnout
+menutrans &Manual &Rucne
+menutrans A&utomatic A&utomaticky
+menutrans on/off\ for\ &This\ file &Prepnout\ (pro\ tento\ soubor)
+menutrans o&ff\ (this\ file) vyp&nout\ (pro\ tento\ soubor)
+menutrans Co&lor\ test Test\ &barev
+menutrans &Highlight\ test &Test\ zvyraznovani
+menutrans &Convert\ to\ HTML Prevest\ &do\ HTML
+menutrans &Show\ filetypes\ in\ menu &Zobrazit\ vyber\ moznosti
+" }}}
+
+" {{{ Menu Buffers
+menutrans &Buffers &Buffery
+menutrans &Refresh\ menu &Obnovit\ menu
+menutrans &Delete Z&rusit
+menutrans &Alternate &Zmenit
+menutrans &Next &Dalsi
+menutrans &Previous &Predchozi
+menutrans [No\ File] [Zadny\ soubor]
+" }}}
+
+" {{{ Menu Window
+menutrans &Window &Okna
+menutrans &New<Tab>^Wn &Nove<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Rozdelit<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Ro&zdelit\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Rozdelit\ &vertikalne<Tab>^Wv
+menutrans Split\ File\ E&xplorer Rozdelit\ -\ File\ E&xplorer
+menutrans Move\ &To &Presun
+menutrans &Top<Tab>^WK &Nahoru<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Dolu<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Vlevo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Vp&ravo<Tab>^WL
+
+menutrans &Close<Tab>^Wc Zavri&t<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zavrit\ &ostatni<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Dalsi<Tab>^Ww
+menutrans P&revious<Tab>^WW &Predchozi<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Stejna\ vyska<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Maximalni\ vys&ka<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ M&inimalni\ vyska<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| &Maximalni\ sirka<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimalni\ sirk&a<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Rotovat\ na&horu<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotovat\ &dolu<Tab>^Wr
+
+" {{{ Help menu
+menutrans &Help &Napoveda
+menutrans &Overview<Tab><F1> &Prehled<Tab><F1>
+menutrans &User\ Manual &Uzivatelsky\ Manual
+menutrans &How-to\ links Ho&wto
+menutrans &GUI &Graficke\ rozhrani
+menutrans &Credits &Autori
+menutrans Co&pying &Licencni\ politika
+menutrans &Find\.\.\. &Hledat\.\.\.
+menutrans O&rphans O&sirele\ deti
+menutrans &Version &Verze
+menutrans &About &O\ aplikaci
+" }}}
+
+" {{{ The popup menu
+menutrans &Undo &Zpet
+menutrans Cu&t &Vyriznout
+menutrans &Copy &Kopirovat
+menutrans &Paste &Vlozit
+menutrans &Delete &Smazat
+menutrans Select\ Blockwise Vybrat\ blokove
+menutrans Select\ &Word Vybrat\ &slovo
+menutrans Select\ &Line Vybrat\ &radek
+menutrans Select\ &Block Vybrat\ &blok
+menutrans Select\ &All Vybrat\ &vse
+" }}}
+
+" {{{ The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otevrit soubor
+ tmenu ToolBar.Save Ulozit soubor
+ tmenu ToolBar.SaveAll Ulozit vsechny soubory
+ tmenu ToolBar.Print Tisk
+ tmenu ToolBar.Undo Zpet
+ tmenu ToolBar.Redo Zrusit vraceni
+ tmenu ToolBar.Cut Vyriznout
+ tmenu ToolBar.Copy Kopirovat
+ tmenu ToolBar.Paste Vlozit
+ tmenu ToolBar.Find Hledat...
+ tmenu ToolBar.FindNext Hledat dalsi
+ tmenu ToolBar.FindPrev Hledat predchozi
+ tmenu ToolBar.Replace Nahradit...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nove okno
+ tmenu ToolBar.WinSplit Rozdelit okno
+ tmenu ToolBar.WinMax Maximalizovat okno
+ tmenu ToolBar.WinMin Minimalizovat okno
+ tmenu ToolBar.WinClose Zavrit okno
+ endif
+ tmenu ToolBar.LoadSesn Nacist sezeni
+ tmenu ToolBar.SaveSesn Ulozit sezeni
+ tmenu ToolBar.RunScript Spustit skript
+ tmenu ToolBar.Make Spustit make
+ tmenu ToolBar.Shell Spustit shell
+ tmenu ToolBar.RunCtags Spustit ctags
+ tmenu ToolBar.TagJump Skocit na tag pod kurzorem
+ tmenu ToolBar.Help Napoveda
+ tmenu ToolBar.FindHelp Hledat napovedu k...
+ endfun
+endif
+" }}}
diff --git a/runtime/lang/menu_de.latin1.vim b/runtime/lang/menu_de.latin1.vim
new file mode 100644
index 000000000..07fee4b0a
--- /dev/null
+++ b/runtime/lang/menu_de.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: German for iso-8859-1 encoding
+
+source <sfile>:p:h/menu_de_de.latin1.vim
diff --git a/runtime/lang/menu_de.utf-8.vim b/runtime/lang/menu_de.utf-8.vim
new file mode 100644
index 000000000..a64bdd0fe
--- /dev/null
+++ b/runtime/lang/menu_de.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: German for UTF-8 encoding
+
+source <sfile>:p:h/menu_de_de.latin1.vim
diff --git a/runtime/lang/menu_de_de.latin1.vim b/runtime/lang/menu_de_de.latin1.vim
new file mode 100644
index 000000000..15ecf53d3
--- /dev/null
+++ b/runtime/lang/menu_de_de.latin1.vim
@@ -0,0 +1,279 @@
+" Menu Translations: German / Deutsch
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Originally By: Marcin Dalecki <dalecki@cs.net.pl>
+" Last Change: Sat, 20 Apr 2002 19:02:42 CEST
+" vim:set foldmethod=marker tabstop=8:
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252 and
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+" {{{ FILE / DATEI
+menutrans &File &Datei
+menutrans &Open\.\.\.<Tab>:e &Öffnen\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp In\ geteiltem\ &Fenster\ Öffnen\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Neue\ Datei<Tab>:enew
+menutrans &Close<Tab>:close S&chließen<Tab>:close
+menutrans &Save<Tab>:w &Speichern<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Speichern\ &Als\.\.\.<Tab>:sav
+menutrans &Print &Drucken
+menutrans Sa&ve-Exit<Tab>:wqa Speichern\ und\ Be&enden<Tab>:wqa
+menutrans E&xit<Tab>:qa &Beenden<Tab>:qa
+
+if has("diff")
+ menutrans Split\ &Diff\ with\.\.\. D&ifferenz\ in\ geteiltem\ Fenster\ mit\.\.\.
+ menutrans Split\ Patched\ &By\.\.\. &Patch\ in\ geteiltem\ Fenster\ mit\.\.\.
+endif
+" }}} FILE / DATEI
+
+" {{{ EDIT / EDITIEREN
+menutrans &Edit &Editieren
+menutrans &Undo<Tab>u Z&urück<Tab>u
+menutrans &Redo<Tab>^R Vo&r<Tab>^R
+menutrans Rep&eat<Tab>\. &Wiederholen<Tab>\.
+menutrans Cu&t<Tab>"+x &Ausschneiden<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopieren<Tab>"+y
+menutrans &Paste<Tab>"+gP Ein&fügen<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Da&vor\ Einfügen<Tab>[p
+menutrans Put\ &After<Tab>]p Da&nach\ Einfügen<Tab>]p
+menutrans &Select\ all<Tab>ggVG Alles\ &Markieren<Tab>ggVG
+menutrans &Find\.\.\. &Suchen\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Suchen\ und\ &Ersetzen\.\.\.
+
+" [-- SETTINGS --]
+" XXX &E would conflict with 'Suchen\ und\ &Ersetzen', see above
+menutrans Settings\ &Window E&instellungen\.\.\.
+menutrans &Global\ Settings &Globale\ Einstellungen
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Hervorhebungen\ ein-\ und\ ausschalten<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Großschreibung\ &ignorieren\ oder\ benutzen<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Anzeige\ des\ passenden\ &Symbols\ ein-\ und\ ausschalten<Tab>:set\ sm!
+
+menutrans &Context\ lines &Zusammenhang
+
+menutrans &Virtual\ Edit &Virtueller\ Editier-Modus
+menutrans Never Nie
+menutrans Block\ Selection Block-Auswahl
+menutrans Insert\ mode Einfüge-Modus
+menutrans Block\ and\ Insert Block-\ und\ Einfüge-Modus
+menutrans Always Immer
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Einfüge-&Modus\ ein-\ und\ ausschalten<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Vi-Kompatibilität\ ein-\ und\ ausschalten<Tab>:set\ cp!
+
+menutrans Search\ &Path\.\.\. Such-&Pfad\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&g-Dateien\.\.\.
+
+menutrans Toggle\ &Toolbar Werkzeugleiste\ ein-\ und\ ausschalten
+menutrans Toggle\ &Bottom\ Scrollbar Unteren\ Rollbalken\ ein-\ und\ ausschalten
+menutrans Toggle\ &Left\ Scrollbar Linken\ Rollbalken\ ein-\ und\ ausschalten
+menutrans Toggle\ &Right\ Scrollbar Rechten\ Rollbalken\ ein-\ und\ ausschalten
+
+" Edit/File Settings
+menutrans F&ile\ Settings &Datei-Einstellungen
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Anzeige\ der\ Zeilen&nummer\ ein-\ und\ ausschalten<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! &List-Modus\ ein-\ und\ ausschalten<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! &Zeilenumbruch\ ein-\ und\ ausschalten<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Umbruch\ an\ &Wortgrenzen\ ein-\ und\ ausschalten<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! &Erweiterung\ von\ Tabulatoren\ ein-\ und\ ausschalten<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Automatische\ Einrückung\ ein-\ und\ ausschalten<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &C-Einrückung\ ein-\ und\ ausschalten<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth &Schiebeweite
+menutrans Soft\ &Tabstop &Tabulator
+menutrans Te&xt\ Width\.\.\. Te&xt\ Breite\.\.\.
+menutrans &File\ Format\.\.\. &Datei\ Format\.\.\.
+menutrans C&olor\ Scheme F&arbschema\.\.\.
+menutrans &Keymap &Tastatur-Belegung
+" }}} EDIT / EDITIEREN
+
+" {{{ TOOLS / WERKZEUGE
+if has("folding")
+ menutrans &Folding Fa&ltung
+ " open close folds
+ menutrans &Enable/Disable\ folds<Tab>zi &Ein-\ und\ ausschalten<Tab>zi
+ menutrans &View\ Cursor\ Line<Tab>zv Momentane\ &Position\ anzeigen<Tab>zv
+ menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Ausschließlich\ momentane\ Position\ anzeigen<Tab>zMzx
+ menutrans C&lose\ more\ folds<Tab>zm Faltungen\ &schließen<Tab>zm
+ menutrans &Close\ all\ folds<Tab>zM Alle\ Faltungen\ schließen<Tab>zM
+ menutrans O&pen\ more\ folds<Tab>zr Faltungen\ &öffnen<Tab>zr
+ menutrans &Open\ all\ folds<Tab>zR Alle\ Faltungen\ öffnen<Tab>zR
+ " fold method
+ menutrans Fold\ Met&hod Faltungs-&Methode
+ menutrans M&anual &Manuell
+ menutrans I&ndent &Einrückungen
+ menutrans E&xpression &Ausdruck
+ menutrans S&yntax &Syntax
+ menutrans &Diff &Differenz
+ menutrans Ma&rker Ma&rkierungen
+ " create and delete folds
+ " TODO accelerators
+ menutrans Create\ &Fold<Tab>zf Faltung\ Erzeugen<Tab>zf
+ menutrans &Delete\ Fold<Tab>zd Faltung\ Löschen<Tab>zd
+ menutrans Delete\ &All\ Folds<Tab>zD Alle\ Faltungen\ Löschen<Tab>zD
+ " moving around in folds
+ menutrans Fold\ column\ &width &Breite\ der\ Faltungs-Spalte
+endif " has folding
+
+if has("diff")
+ menutrans &Diff &Differenz
+ menutrans &Update &Aktualisieren
+ menutrans &Get\ Block Block\ &Einfügen
+ menutrans &Put\ Block Block\ &Übertragen
+endif
+
+menutrans &Tools &Werkzeuge
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Springe\ zum\ Tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T Springe\ &Zurück<Tab>^T
+menutrans Build\ &Tags\ File Erstelle\ &Tags\ Datei
+menutrans &Make<Tab>:make &Erstellen<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Fehler\ Anzeigen<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! &Hinweise\ Anzeigen<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Zum\ &Nächsten\ Fehler<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Zum\ &Vorherigen\ Fehler<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Ältere\ Liste<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Neuere\ Liste<Tab>:cnew
+
+menutrans Error\ &Window Feh&ler-Fenster
+menutrans &Set\ Compiler &Compiler
+menutrans &Update<Tab>:cwin &Aktualisieren<Tab>:cwin
+menutrans &Open<Tab>:copen &Öffnen<Tab>:copen
+menutrans &Close<Tab>:cclose &Schließen<Tab>:cclose
+
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Nach\ HE&X\ konvertieren<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Zurück\ konvertieren<Tab>:%!xxd\ -r
+" }}} TOOLS / WERKZEUGE
+
+" {{{ SYNTAX / SYNTAX
+menutrans &Syntax &Syntax
+menutrans Set\ '&syntax'\ only Nur\ '&syntax'\ Setzen
+menutrans Set\ '&filetype'\ too Auch\ '&filetype'\ Setzen
+menutrans &Off &Aus
+menutrans &Manual &Manuell
+menutrans A&utomatic A&utomatisch
+menutrans on/off\ for\ &This\ file An/Aus (diese\ &Datei)
+menutrans Co&lor\ test Test\ der\ Farben
+menutrans &Highlight\ test Test\ der\ Un&terstreichungen
+menutrans &Convert\ to\ HTML Konvertieren\ nach\ &HTML
+" }}} SYNTAX / SYNTAX
+
+" {{{ BUFFERS / PUFFER
+menutrans &Buffers &Puffer
+menutrans &Refresh\ menu &Aktualisieren
+menutrans Delete Löschen
+menutrans &Alternate &Wechseln
+menutrans &Next &Nächster
+menutrans &Previous &Vorheriger
+menutrans [No\ File] [Keine\ Datei]
+" }}} BUFFERS / PUFFER
+
+" {{{ WINDOW / ANSICHT
+menutrans &Window &Ansicht
+menutrans &New<Tab>^Wn &Neu<Tab>^Wn
+menutrans S&plit<Tab>^Ws Aufs&palten<Tab>^Ws
+menutrans Split\ &Vertically<Tab>^Wv &Vertikal\ Aufspalten<Tab>^Ws
+menutrans Split\ File\ E&xplorer Ver&zeichnis
+menutrans Sp&lit\ To\ #<Tab>^W^^ Aufspa&lten\ in\ #<Tab>^W^^
+menutrans &Close<Tab>^Wc &Schließen<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo &Andere\ Schließen<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww N&ächstes<Tab>^Ww
+menutrans P&revious<Tab>^WW Vor&heriges<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Gleiche\ Höhen<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maximale\ Höhe<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ M&inimale\ Höhe<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maximale\ &Breite<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimale\ Brei&te<Tab>^W1\|
+menutrans Move\ &To V&erschiebe\ nach
+menutrans &Top<Tab>^WK &Oben<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Unten<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Links<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Rechts<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Rotiere\ nach\ &oben<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotiere\ nach\ &unten<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Auswahl\ der\ Schriftart\.\.\.
+" }}} WINDOW / ANSICHT
+
+" {{{ HELP / HILFE
+menutrans &Help &Hilfe
+menutrans &Overview<Tab><F1> &Überblick<Tab><F1>
+menutrans &User\ Manual &Handbuch
+menutrans &How-to\ links How-to\ &Index
+menutrans &GUI &Graphische\ Oberfläche
+menutrans &Credits &Autoren
+menutrans Co&pying &Urheberrecht
+menutrans O&rphans &Waisen
+menutrans &Find\.\.\. &Suchen\.\.\. " conflicts with Edit.Find
+menutrans &Version &Version
+menutrans &About &Titelseite
+" }}} HELP / HILFE
+
+" {{{ POPUP
+menutrans &Undo &Zurück
+menutrans Cu&t Aus&schneiden
+menutrans &Copy &Kopieren
+menutrans &Paste &Einfügen
+menutrans &Delete &Löschen
+menutrans Select\ Blockwise Auswahl\ Blockartig
+menutrans Select\ &Word Auswahl\ des\ &Wortes
+menutrans Select\ &Line Auswahl\ der\ &Zeile
+menutrans Select\ &Block Auswahl\ des\ &Blocks
+menutrans Select\ &All &Alles\ Auswählen
+" }}} POPUP
+
+" {{{ TOOLBAR
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Datei Öffnen
+ tmenu ToolBar.Save Datei Speichern
+ tmenu ToolBar.SaveAll Alle Dateien Speichern
+ tmenu ToolBar.Print Drucken
+ tmenu ToolBar.Undo Zurück
+ tmenu ToolBar.Redo Wiederholen
+ tmenu ToolBar.Cut Ausschneiden
+ tmenu ToolBar.Copy Kopieren
+ tmenu ToolBar.Paste Einfügen
+ tmenu ToolBar.Find Suchen...
+ tmenu ToolBar.FindNext Suche Nächsten
+ tmenu ToolBar.FindPrev Suche Vorherigen
+ tmenu ToolBar.Replace Suchen und Ersetzen...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Neue Ansicht
+ tmenu ToolBar.WinSplit Ansicht Aufspalten
+ tmenu ToolBar.WinMax Ansicht Maximale Höhen
+ tmenu ToolBar.WinMin Ansicht Minimale Höhen
+ tmenu ToolBar.WinClose Ansicht Schließen
+ endif
+ tmenu ToolBar.LoadSesn Sitzung Laden
+ tmenu ToolBar.SaveSesn Sitzung Speichern
+ tmenu ToolBar.RunScript Vim-Skript Ausführen
+ tmenu ToolBar.Make Erstellen
+ tmenu ToolBar.Shell Shell Starten
+ tmenu ToolBar.RunCtags Erstelle Tags Datei
+ tmenu ToolBar.TagJump Springe zum Tag
+ tmenu ToolBar.Help Hilfe!
+ tmenu ToolBar.FindHelp Hilfe Durchsuchen...
+ endfun
+endif
+" }}} TOOLBAR
+
+" {{{ DIALOG TEXTS
+let g:menutrans_no_file = "[Keine Datei]"
+let g:menutrans_help_dialog = "Geben Sie einen Befehl oder ein Wort ein, für das Sie Hilfe benötigen:\n\nVerwenden Sie i_ für Eingabe ('input') Befehle (z.B.: i_CTRL-X)\nVerwenden Sie c_ für Befehls-Zeilen ('command-line') Befehle (z.B.: c_<Del>)\nVerwenden Sie ' für Options-Namen (z.B.: 'shiftwidth')"
+let g:menutrans_path_dialog = "Geben Sie Such-Pfade für Dateien ein.\nTrennen Sie die Verzeichnis-Namen durch Kommata."
+let g:menutrans_tags_dialog = "Geben Sie die Namen der 'tag'-Dateien ein.\nTrennen Sie die Namen durch Kommata."
+let g:menutrans_textwidth_dialog = "Geben Sie eine neue Text-Breite ein (oder 0, um die Formatierung abzuschalten)"
+let g:menutrans_fileformat_dialog = "Wählen Sie ein Datei-Format aus"
+" }}}
diff --git a/runtime/lang/menu_de_de.utf-8.vim b/runtime/lang/menu_de_de.utf-8.vim
new file mode 100644
index 000000000..a64bdd0fe
--- /dev/null
+++ b/runtime/lang/menu_de_de.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: German for UTF-8 encoding
+
+source <sfile>:p:h/menu_de_de.latin1.vim
diff --git a/runtime/lang/menu_en_gb.latin1.vim b/runtime/lang/menu_en_gb.latin1.vim
new file mode 100644
index 000000000..7fbcf72b9
--- /dev/null
+++ b/runtime/lang/menu_en_gb.latin1.vim
@@ -0,0 +1,16 @@
+" Menu Translations: UK English
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Last Change: 2003 Feb 10
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" Note: there is no "scriptencoding" command here, all encodings should be
+" able to handle ascii characters without conversion.
+
+" Convert from American to UK spellings.
+menutrans C&olor\ Scheme C&olour\ Scheme
+menutrans Co&lor\ test Co&lour\ test
diff --git a/runtime/lang/menu_en_gb.utf-8.vim b/runtime/lang/menu_en_gb.utf-8.vim
new file mode 100644
index 000000000..b22b3bb3e
--- /dev/null
+++ b/runtime/lang/menu_en_gb.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: UK English
+
+source <sfile>:p:h/menu_en_gb.latin1.vim
diff --git a/runtime/lang/menu_english_united_kingdom.1252.vim b/runtime/lang/menu_english_united_kingdom.1252.vim
new file mode 100644
index 000000000..fe73f1651
--- /dev/null
+++ b/runtime/lang/menu_english_united_kingdom.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: UK English for ASCII
+
+source <sfile>:p:h/menu_en_gb.latin1.vim
diff --git a/runtime/lang/menu_english_united_kingdom.ascii.vim b/runtime/lang/menu_english_united_kingdom.ascii.vim
new file mode 100644
index 000000000..fe73f1651
--- /dev/null
+++ b/runtime/lang/menu_english_united_kingdom.ascii.vim
@@ -0,0 +1,3 @@
+" Menu Translations: UK English for ASCII
+
+source <sfile>:p:h/menu_en_gb.latin1.vim
diff --git a/runtime/lang/menu_es.latin1.vim b/runtime/lang/menu_es.latin1.vim
new file mode 100644
index 000000000..b8efe51c7
--- /dev/null
+++ b/runtime/lang/menu_es.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Spanish
+
+source <sfile>:p:h/menu_es_es.latin1.vim
diff --git a/runtime/lang/menu_es.utf-8.vim b/runtime/lang/menu_es.utf-8.vim
new file mode 100644
index 000000000..ca6f75492
--- /dev/null
+++ b/runtime/lang/menu_es.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Spanish for UTF-8 encoding
+
+source <sfile>:p:h/menu_es_es.latin1.vim
diff --git a/runtime/lang/menu_es_es.latin1.vim b/runtime/lang/menu_es_es.latin1.vim
new file mode 100644
index 000000000..b3e667a0f
--- /dev/null
+++ b/runtime/lang/menu_es_es.latin1.vim
@@ -0,0 +1,296 @@
+" Menu Translations: Español
+" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
+" Last Change: 2004 May 12
+"
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252,
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+
+" Help menu
+menutrans &Help Ay&uda
+menutrans &Overview<Tab><F1> Tabla\ de\ &contenidos<Tab><F1>
+menutrans &User\ Manual &Manual\ del\ usuario
+menutrans &How-to\ links &Enlaces\ a\ ¿Cómo\ hago\.\.\.?
+menutrans &Find\.\.\. &Buscar\ en\ la\ ayuda
+menutrans &Credits &Reconocimientos
+menutrans O&rphans Ayude\ a\ los\ niños\ &huérfanos
+menutrans Co&pying &Términos\ de\ Licencia
+menutrans Sponsor/Register Benefactor/Regístrese
+menutrans &Version &Versión\ e\ \información\ de\ configuración
+menutrans &About &Acerca\ de\ Vim.
+
+" File menu
+menutrans &File &Archivo
+menutrans &Open\.\.\.<Tab>:e &Abrir\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp A&brir\ en\ otra\ ventana\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nuevo<Tab>:enew
+menutrans &Close<Tab>:close &Cerrar<Tab>:close
+menutrans &Save<Tab>:w &Guardar<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Guardar\ &como\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. &Mostrar\ diferencias\ con\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Mostrar\ &parcheado\ por\.\.\.
+menutrans &Print &Imprimir
+menutrans Sa&ve-Exit<Tab>:wqa Gua&rdar\ y\ salir<Tab>:wqa
+menutrans E&xit<Tab>:qa &Salir<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Editar
+menutrans &Undo<Tab>u &Deshacer<Tab>u
+menutrans &Redo<Tab>^R &Rehacer<Tab>^R
+menutrans Rep&eat<Tab>\. Repe&tir<Tab>\.
+menutrans Cu&t<Tab>"+x Cor&tar<Tab>"+x
+menutrans &Copy<Tab>"+y &Copiar<Tab>"+y
+menutrans &Paste<Tab>"+gP &Pegar<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Poner\ &antes<Tab>[p
+menutrans Put\ &After<Tab>]p Poner\ &después<Tab>]p
+if has("win32") || has("win16")
+ menutrans &Delete<Tab>x S&uprimir<Tab>x
+endif
+menutrans &Select\ all<Tab>ggVG &Seleccionar\ todo<Tab>ggVG
+menutrans &Find\.\.\. &Buscar\.\.\.
+menutrans &Find<Tab>/ &Buscar<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. Buscar\ y\ R&eemplazar\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Buscar\ y\ R&eemplazar<Tab>:%s
+menutrans Find\ and\ Rep&lace Buscar\ y\ R&eemplazar
+menutrans Find\ and\ Rep&lace<Tab>:s Buscar\ y\ R&eemplazar<Tab>:s
+menutrans Settings\ &Window &Ventana\ de\ opciones
+
+" Edit/Global Settings
+menutrans &Global\ Settings Opciones\ &globales
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Activar/Desactivar\ &realzado\ de\ sintaxis<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Activar/Desactivar\ &ignorar\ mayúsculas\ y\ minúsculas<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Activar/Desactivar\ &mostrar\ coincidencias<Tab>:set\ sm!
+
+menutrans &Context\ lines Líneas\ de\ &contexto
+
+menutrans &Virtual\ Edit Edición\ &virtual
+menutrans Never Nunca
+menutrans Block\ Selection Selección\ de\ bloque
+menutrans Insert\ mode Modo\ de\ inserción
+menutrans Block\ and\ Insert Bloque\ e\ inserción
+menutrans Always Siempre
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Activar/Desactivar\ modo\ de\ in&serción<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Activar/Desactivar\ compatiblidad\ con\ Vi<Tab>:set\ cp!
+
+menutrans Search\ &Path\.\.\. Ruta\ de\ &búsqueda\.\.\.
+
+menutrans Ta&g\ Files\.\.\. Ficheros\ de\ «ta&gs»\.\.\.
+
+" GUI options
+menutrans Toggle\ &Toolbar Ocultar/Mostrar\ barra\ de\ &herramientas
+menutrans Toggle\ &Bottom\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\ &inferior
+menutrans Toggle\ &Left\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\ i&zquierda
+menutrans Toggle\ &Right\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\ &derecha
+
+let g:menutrans_path_dialog = "Introduzca la ruta de búsqueda para los ficheros.\nSepare los nombres de los directorios con una coma."
+let g:menutrans_tags_dialog = "Introduzca los nombres de los fichero de tags.\nSepare los nombres con una coma."
+
+" Edit/File Settings
+menutrans F&ile\ Settings Opciones\ del\ &fichero
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Activar/Desactivar\ &numeración\ de\ líneas<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Activar/Desactivar\ modo\ «&list»<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Activar/Desactivar\ &quiebre\ de\ líneas<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Activar/Desactivar\ quiebre\ entre\ &palabras<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Activar/Desactivar\ &expansión\ de\ marcas\ de\ \tabulado<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Activar/Desactivar\ &auto-sangrado<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Activar/Desactivar\ sangrado\ &C<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth Anchura\ del\ &sangrado
+
+menutrans Soft\ &Tabstop &Tabulado\ «blando»
+
+menutrans Te&xt\ Width\.\.\. Anchura\ del\ te&xto\.\.\.
+let g:menutrans_textwidth_dialog = "Introduzca el nuevo ancho del texto (0 para desactivar el quiebre de línea): "
+
+menutrans &File\ Format\.\.\. &Formato\ del\ fichero\.\.\.
+let g:menutrans_fileformat_dialog = "Seleccione el formato para escribir el fichero"
+
+menutrans C&olor\ Scheme Esquema\ de\ c&olores
+menutrans blue azul
+menutrans darkblue azul\ oscuro
+menutrans default original
+menutrans desert desierto
+menutrans evening vespertino
+menutrans morning matutino
+menutrans peachpuff melocotón
+menutrans shine brillante
+
+menutrans Select\ Fo&nt\.\.\. Seleccionar\ fue&nte\.\.\.
+
+menutrans &Keymap Asociación\ de\ teclados
+menutrans None Ninguna
+menutrans accents acentos
+menutrans arabic árabe
+menutrans czech checo
+menutrans greek griego
+menutrans hebrew hebreo
+menutrans hebrewp hebreo\ fonético
+menutrans lithuanian-baltic lituano-báltico
+menutrans russian-jcuken ruso-«jcuken»
+menutrans russian-jcukenwin ruso-«jcuken»\ Windows
+menutrans russian-yawerty ruso-«yawerty»
+menutrans serbian-latin serbio-latino
+menutrans serbian serbio
+menutrans slovak eslovaco
+
+
+" Programming menu
+menutrans &Tools &Herramientas
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Saltar\ a\ este\ «tag»<Tab>g^]
+menutrans Jump\ &back<Tab>^T Saltar\ &atrás<Tab>^T
+menutrans Build\ &Tags\ File Crear\ fichero\ de\ «&tags»\
+menutrans &Diff Modo\ de\ &diferencias
+menutrans &Folding &Plegado
+menutrans &Make<Tab>:make Ejecutar\ «&Make»<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Lista\ de\ errores<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! L&ista\ de\ mensajes<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &Error\ siguiente<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Error\ p&revio<Tab>:cp
+menutrans &Older\ List<Tab>:cold Lista\ de\ &viejos\ a\ nuevos<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Lista\ de\ &nuevos\ a\ viejos<Tab>:cnew
+menutrans Error\ &Window Ven&tana\ de\ errores
+menutrans &Set\ Compiler Esco&ger\ el\ compilador\ a\ usar
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Convertir\ a\ formato\ &hexadecimal<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r &Convertir\ al\ formato\ original<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi &Activar/Desactivar\ pliegues<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Ver\ línea\ del\ cursor<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ve&r\ sólo\ la\ línea\ del\ cursor<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm C&errar\ más\ pliegues<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM &Cerrar\ todos\ los\ pliegues<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Abrir\ &más\ pliegues<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Abrir\ todos\ los\ pliegues<Tab>zR
+" fold method
+menutrans Fold\ Met&hod &Método\ de\ plegado
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf Crear\ &pliegue<Tab>zf
+menutrans &Delete\ Fold<Tab>zd &Suprimir\ pliegue<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Suprimir\ &todos\ los\ pligues<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width A&nchura\ de\ columna\ del\ pliegue
+
+" Tools.Diff Menu
+menutrans &Update &Actualizar
+menutrans &Get\ Block &Obtener\ bloque
+menutrans &Put\ Block &Poner\ bloque
+
+"Tools.Error Menu
+menutrans &Update<Tab>:cwin &Actualizar
+menutrans &Open<Tab>:copen A&brir
+menutrans &Close<Tab>:cclose &Cerrar
+
+" Names for buffer menu.
+menutrans &Buffers &Buffers
+menutrans &Refresh\ menu &Refrescar\ menú
+menutrans &Delete &Suprimir
+menutrans &Alternate &Alternar
+menutrans &Next Si&guiente
+menutrans &Previous &Previo
+let g:menutrans_no_file = "[Sin fichero]"
+
+" Window menu
+menutrans &Window &Ventana
+menutrans &New<Tab>^Wn Ventana\ &nueva<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Dividir\ la\ ventana<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ D&ividir\ en\ el\ marcador\ (#)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Dividir\ &verticalmente<Tab>^Wv
+menutrans Split\ File\ E&xplorer &Abrir\ el\ «Explorador\ de\ ficheros»
+menutrans &Close<Tab>^Wc &Cerrar\ esta\ ventana<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Cerrar\ &otra(s)\ ventana(s)<Tab>^Wo
+menutrans Move\ &To Mov&er\ a
+menutrans &Top<Tab>^WK &Arriba<Tab>^WK
+menutrans &Bottom<Tab>^WJ A&bajo<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Lado\ &izquierdo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Lado\ &derecho<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR &Rotar\ hacia\ arriba<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotar\ hacia\ a&bajo<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= Mismo\ &tamaño<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Altura\ &máxima<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Altura\ mí&nima<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Anchura\ má&xima<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Anc&hura\ mínima<Tab>^W1\|
+
+" The popup menu
+menutrans &Undo &Deshacer
+menutrans Cu&t Cor&tar
+menutrans &Copy &Copiar
+menutrans &Paste &Pegar
+menutrans &Delete &Borrar
+menutrans Select\ Blockwise Seleccionar\ por\ bloque
+menutrans Select\ &Word Seleccionar\ &palabra
+menutrans Select\ &Line Seleccionar\ una\ &línea
+menutrans Select\ &Block Seleccionar\ un\ &bloque
+menutrans Select\ &All Seleccionar\ &todo
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Abrir fichero
+ tmenu ToolBar.Save Guardar fichero
+ tmenu ToolBar.SaveAll Guardar todos los ficheros
+ tmenu ToolBar.Print Imprimir
+ tmenu ToolBar.Undo Deshacer
+ tmenu ToolBar.Redo Rehacer
+ tmenu ToolBar.Cut Cortar
+ tmenu ToolBar.Copy Copiar
+ tmenu ToolBar.Paste Pegar
+ tmenu ToolBar.Find Buscar...
+ tmenu ToolBar.FindNext Buscar siguiente
+ tmenu ToolBar.FindPrev Buscar precedente
+ tmenu ToolBar.Replace Buscar y reemplazar
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Ventana nueva
+ tmenu ToolBar.WinSplit Dividir ventana
+ tmenu ToolBar.WinMax Ventana máxima
+ tmenu ToolBar.WinMin Ventana mínima
+ tmenu ToolBar.WinVSplit Dividir verticalmente
+ tmenu ToolBar.WinMaxWidth Anchura máxima
+ tmenu ToolBar.WinMinWidth Anchura mínima
+ tmenu ToolBar.WinClose Cerrar ventana
+ endif
+ tmenu ToolBar.LoadSesn Cargar sesión
+ tmenu ToolBar.SaveSesn Guardar sesión
+ tmenu ToolBar.RunScript Ejecutar un «script»
+ tmenu ToolBar.Make Ejecutar «Make»
+ tmenu ToolBar.Shell Abrir una «Shell»
+ tmenu ToolBar.RunCtags Generar un fichero de «tags»
+ tmenu ToolBar.TagJump Saltar a un «tag»
+ tmenu ToolBar.Help Ayuda
+ tmenu ToolBar.FindHelp Buscar en la ayuda...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaxis
+menutrans &Show\ filetypes\ in\ menu &Mostrar\ listas\ de\ «tipo\ de\ fichero»
+menutrans Set\ '&syntax'\ only Activar\ sólo\ «sintaxis»
+menutrans Set\ '&filetype'\ too Activar\ también\ «tipo\ de\ fichero»
+menutrans &Off &Desactivar\ «sintaxis»
+menutrans &Manual «sintaxis»\ &manual
+menutrans A&utomatic «sintaxis»\ a&utomática
+menutrans on/off\ for\ &This\ file Activar/Desactivar\ en\ es&te\ fichero
+menutrans Co&lor\ test &Prueba\ de\ colores
+menutrans &Highlight\ test Prueba\ de\ &realzado
+menutrans &Convert\ to\ HTML &Convertir\ en\ HTML
+
+" Find Help dialog text
+let g:menutrans_help_dialog = "Introduzca un nombre de comando o palabra para obtener ayuda;\n\nAnteponga i_ para comandos de entrada (e.g.: i_CTRL-X)\nAnteponga c_ para comandos de la línea de comandos (e.g.: c_<Del>)\nAnteponga ` para un nombre de opción (e.g.: `shiftwidth`)"
diff --git a/runtime/lang/menu_es_es.utf-8.vim b/runtime/lang/menu_es_es.utf-8.vim
new file mode 100644
index 000000000..ca6f75492
--- /dev/null
+++ b/runtime/lang/menu_es_es.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Spanish for UTF-8 encoding
+
+source <sfile>:p:h/menu_es_es.latin1.vim
diff --git a/runtime/lang/menu_fr.latin1.vim b/runtime/lang/menu_fr.latin1.vim
new file mode 100644
index 000000000..064680b95
--- /dev/null
+++ b/runtime/lang/menu_fr.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: French for ISO 8859-1 encoding
+
+source <sfile>:p:h/menu_fr_fr.latin1.vim
diff --git a/runtime/lang/menu_fr.utf-8.vim b/runtime/lang/menu_fr.utf-8.vim
new file mode 100644
index 000000000..5e4190649
--- /dev/null
+++ b/runtime/lang/menu_fr.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: French for UTF-8 encoding
+
+source <sfile>:p:h/menu_fr_fr.latin1.vim
diff --git a/runtime/lang/menu_fr_fr.latin1.vim b/runtime/lang/menu_fr_fr.latin1.vim
new file mode 100644
index 000000000..efca71bee
--- /dev/null
+++ b/runtime/lang/menu_fr_fr.latin1.vim
@@ -0,0 +1,444 @@
+" Menu Translations: Francais
+" Maintainer: Adrien Beau <version.francaise@free.fr>
+" First Version: Francois Thunus <thunus@systran.fr>
+" Last Change: 2003 May 29
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252 and
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15" && &enc != "iso-8859-1"
+ scriptencoding latin1
+endif
+
+menutrans &Help &Aide
+
+menutrans &Overview<Tab><F1> &Sommaire<Tab><F1>
+menutrans &User\ Manual &Manuel\ utilisateur
+menutrans &How-to\ links &Tâches\ courantes
+menutrans &Find\.\.\. Rec&hercher\.\.\.
+" -sep1-
+menutrans &Credits &Remerciements
+menutrans Co&pying &License
+menutrans O&rphans &Orphelins
+" -sep2-
+menutrans &Version &Version
+menutrans &About À\ &propos\ de\ Vim
+
+let g:menutrans_help_dialog = "Entrez une commande ou un mot à rechercher dans l'aide.\n\nAjoutez i_ pour les commandes du mode Insertion (ex: i_CTRL-X)\nAjoutez c_ pour l'édition de la ligne de commande (ex: c_<Del>)\nEntourez les options avec des apostrophes (ex: 'shiftwidth')"
+
+
+menutrans &File &Fichier
+
+menutrans &Open\.\.\.<Tab>:e &Ouvrir\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Ouvrir\ à\ p&art\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nouveau<Tab>:enew
+menutrans &Close<Tab>:close &Fermer<Tab>:close
+" -SEP1-
+menutrans &Save<Tab>:w &Enregistrer<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Enregistrer\ &sous\.\.\.<Tab>:sav
+" -SEP2-
+menutrans Split\ &Diff\ with\.\.\. &Difference\ avec\.\.\.
+"menutrans Split\ Patched\ &By\.\.\. &Patcher\ avec\.\.\.
+menutrans Split\ Patched\ &By\.\.\. &Tester\ un\ patch\.\.\.
+" -SEP3-
+menutrans &Print &Imprimer
+" -SEP4-
+menutrans Sa&ve-Exit<Tab>:wqa En&registrer\ et\ quitter<Tab>:wqa
+menutrans E&xit<Tab>:qa &Quitter<Tab>:qa
+
+
+menutrans &Edit &Edition
+
+menutrans &Undo<Tab>u &Annuler<Tab>u
+menutrans &Redo<Tab>^R Re&faire<Tab>^R
+menutrans Rep&eat<Tab>\. R&épéter<Tab>\.
+" -SEP1-
+menutrans Cu&t<Tab>"+x Co&uper<Tab>"+x
+menutrans &Copy<Tab>"+y Cop&ier<Tab>"+y
+menutrans &Paste<Tab>"+gP C&oller<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Placer\ a&vant<Tab>[p
+menutrans Put\ &After<Tab>]p Placer\ apr&ès<Tab>]p
+menutrans &Delete<Tab>x Effa&cer<Tab>x
+menutrans &Select\ all<Tab>ggVG &Sélectionner\ tout<Tab>ggVG
+" -SEP2-
+menutrans &Find\.\.\. Rec&hercher\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Re&mplacer\.\.\.
+menutrans &Find<Tab>/ Rec&hercher<Tab>/
+menutrans Find\ and\ Rep&lace<Tab>:%s Re&mplacer<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s Re&mplacer<Tab>:s
+" -SEP3-
+menutrans Settings\ &Window Fe&nêtre\ des\ réglages
+menutrans &Global\ Settings Réglages\ globau&x
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Surligner\ recherche\ on/off<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Ignorer\ casse\ on/off<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Vérifier\ parenth&èses\ on/off<Tab>:set\ sm!
+
+menutrans &Context\ lines Lignes\ &autour\ du\ curseur
+
+menutrans &Virtual\ Edit Édition\ &virtuelle
+menutrans Never &Jamais
+menutrans Block\ Selection &Sélection\ en\ bloc
+menutrans Insert\ mode &Mode\ insertion
+menutrans Block\ and\ Insert &Bloc\ et\ insertion
+menutrans Always &Toujours
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! I&nsertion\ permanente\ on/off<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &Compatibilité\ Vi\ on/off<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Chemin\ de\ rec&herche\ des\ fichiers\.\.\.
+menutrans Ta&g\ Files\.\.\. Fichiers\ d'&étiquettes\.\.\.
+" -SEP1-
+menutrans Toggle\ &Toolbar Barre\ d'&outils\ on/off
+menutrans Toggle\ &Bottom\ Scrollbar Ascenseur\ &horizontal\ on/off
+menutrans Toggle\ &Left\ Scrollbar Ascenseur\ à\ ga&uche\ on/off
+menutrans Toggle\ &Right\ Scrollbar Ascenseur\ à\ &droite\ on/off
+
+let g:menutrans_path_dialog = "Entrez le chemin de recherche des fichiers.\nSéparez les répertoires par des virgules."
+let g:menutrans_tags_dialog = "Entrez les noms des fichiers d'étiquettes.\nSéparez les noms par des virgules."
+
+menutrans F&ile\ Settings Réglages\ fichie&r
+
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numérotation\ on/off<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Mode\ &listing\ on/off<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! &Retour\ à\ la\ ligne\ on/off<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Retour\ sur\ &mot\ on/off<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! &Tab\.\ en\ espaces\ on/off<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Indentation\ &auto\.\ on/off<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Indent\.\ langage\ &C\ on/off<Tab>:set\ cin!
+" -SEP2-
+menutrans &Shiftwidth Largeur\ des\ in&dentations
+menutrans Soft\ &Tabstop &Pseudo-tabulations
+menutrans Te&xt\ Width\.\.\. Largeur\ du\ te&xte\.\.\.
+menutrans &File\ Format\.\.\. Format\ du\ &fichier\.\.\.
+
+let g:menutrans_textwidth_dialog = "Entrez la nouvelle largeur du texte\n(0 pour désactiver le formattage)."
+let g:menutrans_fileformat_dialog = "Choisissez le format dans lequel écrire le fichier."
+let g:menutrans_fileformat_choices = " &Unix \n &Dos \n &Mac \n &Annuler "
+
+menutrans C&olor\ Scheme &Jeu\ de\ couleurs
+menutrans &Keymap &Type\ de\ clavier
+menutrans None (aucun)
+menutrans Select\ Fo&nt\.\.\. Sélectionner\ &police\.\.\.
+
+
+menutrans &Tools &Outils
+
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Atteindre\ cette\ étiquette<Tab>g^]
+menutrans Jump\ &back<Tab>^T Repartir\ en\ arri&ère<Tab>^T
+menutrans Build\ &Tags\ File &Générer\ fichier\ d'étiquettes
+
+" -SEP1-
+menutrans &Folding &Replis
+
+menutrans &Enable/Disable\ folds<Tab>zi &Replis\ on/off<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv D&éplier\ ligne\ curseur<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Tout\ plier\ &sauf\ ligne\ curseur<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Fermer\ &plus\ de\ replis<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM F&ermer\ tous\ les\ replis<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Ouvrir\ pl&us\ de\ replis<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Ouvrir\ tous\ les\ replis<Tab>zR
+" -SEP1-
+menutrans Fold\ Met&hod &Méthode\ de\ repli
+
+menutrans M&anual &Manuelle
+menutrans I&ndent &Indentation
+menutrans E&xpression &Expression
+menutrans S&yntax &Syntaxe
+menutrans &Diff &Différence
+menutrans Ma&rker Ma&rqueurs
+
+menutrans Create\ &Fold<Tab>zf &Créer\ repli<Tab>zf
+menutrans &Delete\ Fold<Tab>zd E&ffacer\ repli<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Effacer\ &tous\ les\ replis<Tab>zD
+" -SEP2-
+menutrans Fold\ col&umn\ width &Largeur\ colonne\ replis
+
+menutrans &Diff &Différence
+
+menutrans &Update &Mettre\ à\ jour
+menutrans &Get\ Block Corriger\ &ce\ tampon
+menutrans &Put\ Block Corriger\ l'&autre\ tampon
+
+" -SEP2-
+menutrans &Make<Tab>:make Lancer\ ma&ke<Tab>:make
+menutrans &List\ Errors<Tab>:cl Lister\ &erreurs<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Lister\ &messages<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Erreur\ &suivante<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Erreur\ pr&écédente<Tab>:cp
+"menutrans &Older\ List<Tab>:cold A&ncienne\ liste<Tab>:cold
+menutrans &Older\ List<Tab>:cold Liste\ &précédente<Tab>:cold
+"menutrans N&ewer\ List<Tab>:cnew No&uvelle\ liste<Tab>:cnew
+menutrans N&ewer\ List<Tab>:cnew Liste\ suivan&te<Tab>:cnew
+
+menutrans Error\ &Window &Fenêtre\ d'erreurs
+
+menutrans &Update<Tab>:cwin &Mettre\ à\ jour<Tab>:cwin
+menutrans &Open<Tab>:copen &Ouvrir<Tab>:copen
+menutrans &Close<Tab>:cclose &Fermer<Tab>:cclose
+
+" -SEP3-
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Convertir\ en\ he&xa<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Décon&vertir<Tab>:%!xxd\ -r
+
+menutrans &Set\ Compiler Type\ de\ &compilateur
+
+
+menutrans &Buffers &Tampons
+
+menutrans Dummy Factice
+menutrans &Refresh\ menu &Mettre\ ce\ menu\ à\ jour
+menutrans &Delete &Effacer
+menutrans &Alternate &Alterner
+menutrans &Next &Suivant
+menutrans &Previous &Précédent
+" -SEP-
+
+menutrans &others au&tres
+menutrans &u-z &uvwxyz
+let g:menutrans_no_file = "[Aucun fichier]"
+
+
+menutrans &Window Fe&nêtre
+
+menutrans &New<Tab>^Wn &Nouvelle\ fenêtre<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Fractionner<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Fractionner\ p&our\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Fractionner\ &verticalement<Tab>^Wv
+menutrans Split\ File\ E&xplorer Fractionner\ &explorateur
+" -SEP1-
+menutrans &Close<Tab>^Wc Fer&mer<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Fermer\ les\ &autres<Tab>^Wo
+" -SEP2-
+menutrans Move\ &To &Déplacer\ vers\ le
+
+menutrans &Top<Tab>^WK &Haut<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Bas<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Côté\ &gauche<Tab>^WH
+menutrans &Right\ side<Tab>^WL Côté\ &droit<Tab>^WL
+
+menutrans Rotate\ &Up<Tab>^WR Rotation\ vers\ le\ &haut<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotation\ vers\ le\ &bas<Tab>^Wr
+" -SEP3-
+menutrans &Equal\ Size<Tab>^W= Égaliser\ ta&illes<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Hau&teur\ maximale<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Ha&uteur\ minimale<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| &Largeur\ maximale<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| La&rgeur\ minimale<Tab>^W1\|
+
+
+" PopUp
+
+menutrans &Undo &Annuler
+" -SEP1-
+menutrans Cu&t Co&uper
+menutrans &Copy Cop&ier
+menutrans &Paste C&oller
+" &Buffers.&Delete overwrites this one
+menutrans &Delete &Effacer
+" -SEP2-
+menutrans Select\ Blockwise Sélectionner\ &bloc
+menutrans Select\ &Word Sélectionner\ &mot
+menutrans Select\ &Line Sélectionner\ &ligne
+menutrans Select\ &Block Sélectionner\ &bloc
+menutrans Select\ &All Sélectionner\ &tout
+
+
+" ToolBar
+
+menutrans Open Ouvrir
+menutrans Save Enreg
+menutrans SaveAll EnregTout
+menutrans Print Imprimer
+" -sep1-
+menutrans Undo Annuler
+menutrans Redo Refaire
+" -sep2-
+menutrans Cut Couper
+menutrans Copy Copier
+menutrans Paste Coller
+" -sep3-
+menutrans Find Chercher
+menutrans FindNext CherchSuiv
+menutrans FindPrev CherchPrec
+menutrans Replace Remplacer
+" -sep4-
+menutrans New Nouvelle
+menutrans WinSplit FenFract
+menutrans WinMax FenMax
+menutrans WinMin FenMin
+menutrans WinVSplit FenVFract
+menutrans WinMaxWidth FenMaxLarg
+menutrans WinMinWidth FenMinLarg
+menutrans WinClose FenFerme
+" -sep5-
+menutrans LoadSesn OuvrirSess
+menutrans SaveSesn EnregSess
+menutrans RunScript LancScript
+" -sep6-
+menutrans Make Make
+menutrans RunCtags CréerEtiqu
+menutrans TagJump AllerEtiqu
+" -sep7-
+menutrans Help Aide
+menutrans FindHelp CherchAide
+
+fun! Do_toolbar_tmenu()
+ let did_toolbar_tmenu = 1
+ tmenu ToolBar.Open Ouvrir fichier
+ tmenu ToolBar.Save Enregistrer fichier courant
+ tmenu ToolBar.SaveAll Enregistrer tous les fichiers
+ tmenu ToolBar.Print Imprimer
+ tmenu ToolBar.Undo Annuler
+ tmenu ToolBar.Redo Refaire
+ tmenu ToolBar.Cut Couper
+ tmenu ToolBar.Copy Copier
+ tmenu ToolBar.Paste Coller
+ if !has("gui_athena")
+ tmenu ToolBar.Find Rechercher
+ tmenu ToolBar.FindNext Chercher suivant
+ tmenu ToolBar.FindPrev Chercher précédent
+ tmenu ToolBar.Replace Remplacer
+ endif
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nouvelle fenêtre
+ tmenu ToolBar.WinSplit Fractionner fenêtre
+ tmenu ToolBar.WinMax Maximiser fenêtre
+ tmenu ToolBar.WinMin Minimiser fenêtre
+ tmenu ToolBar.WinVSplit Fractionner verticalement
+ tmenu ToolBar.WinMaxWidth Maximiser largeur fenêtre
+ tmenu ToolBar.WinMinWidth Minimiser largeur fenêtre
+ tmenu ToolBar.WinClose Fermer fenêtre
+ endif
+ tmenu ToolBar.LoadSesn Ouvrir session
+ tmenu ToolBar.SaveSesn Enregister session courante
+ tmenu ToolBar.RunScript Lancer un script Vim
+ tmenu ToolBar.Make Lancer make
+ tmenu ToolBar.RunCtags Créer les étiquettes
+ tmenu ToolBar.TagJump Atteindre cette étiquette
+ tmenu ToolBar.Help Aide de Vim
+ tmenu ToolBar.FindHelp Rechercher dans l'aide
+endfun
+
+
+menutrans &Syntax &Syntaxe
+
+menutrans &Manual &Manuelle
+menutrans A&utomatic &Automatique
+menutrans on/off\ for\ &This\ file On/off\ pour\ &ce\ fichier
+
+" The Start Of The Syntax Menu
+menutrans ABC\ music\ notation ABC\ (notation\ musicale)
+menutrans AceDB\ model Modèle\ AceDB
+menutrans Apache\ config Config\.\ Apache
+menutrans Apache-style\ config Config\.\ style\ Apache
+menutrans ASP\ with\ VBScript ASP\ avec\ VBScript
+menutrans ASP\ with\ Perl ASP\ avec\ Perl
+menutrans Assembly Assembleur
+menutrans BC\ calculator Calculateur\ BC
+menutrans BDF\ font Fonte\ BDF
+menutrans BIND\ config Config\.\ BIND
+menutrans BIND\ zone Zone\ BIND
+menutrans Cascading\ Style\ Sheets Feuilles\ de\ style\ en\ cascade
+menutrans Cfg\ Config\ file Fichier\ de\ config\.\ \.cfg
+menutrans Cheetah\ template Patron\ Cheetah
+menutrans commit\ file Fichier\ commit
+menutrans Generic\ Config\ file Fichier\ de\ config\.\ générique
+menutrans Digital\ Command\ Lang DCL
+menutrans DNS/BIND\ zone Zone\ BIND/DNS
+menutrans Dylan\ interface Interface
+menutrans Dylan\ lid LID
+menutrans Elm\ filter\ rules Règles\ de\ filtrage\ Elm
+menutrans ERicsson\ LANGuage Erlang\ (langage\ Ericsson)
+menutrans Essbase\ script Script\ Essbase
+menutrans Eterm\ config Config\.\ Eterm
+menutrans Exim\ conf Config\.\ Exim
+menutrans Fvwm\ configuration Config\.\ Fvwm
+menutrans Fvwm2\ configuration Config\.\ Fvwm2
+menutrans Fvwm2\ configuration\ with\ M4 Config\.\ Fvwm2\ avec\ M4
+menutrans GDB\ command\ file Fichier\ de\ commandes\ GDB
+menutrans HTML\ with\ M4 HTML\ avec\ M4
+menutrans Cheetah\ HTML\ template Patron\ Cheetah\ pour\ HTML
+menutrans IDL\Generic\ IDL IDL\IDL\ générique
+menutrans IDL\Microsoft\ IDL IDL\IDL\ Microsoft
+menutrans Indent\ profile Profil\ Indent
+menutrans Inno\ setup Config\.\ Inno
+menutrans InstallShield\ script Script\ InstallShield
+menutrans KDE\ script Script\ KDE
+menutrans LFTP\ config Config\.\ LFTP
+menutrans LifeLines\ script Script\ LifeLines
+menutrans Lynx\ Style Style\ Lynx
+menutrans Lynx\ config Config\.\ Lynx
+menutrans Man\ page Page\ Man
+menutrans MEL\ (for\ Maya) MEL\ (pour\ Maya)
+menutrans 4DOS\ \.bat\ file Fichier\ \.bat\ 4DOS
+menutrans \.bat\/\.cmd\ file Fichier\ \.bat\ /\ \.cmd
+menutrans \.ini\ file Fichier\ \.ini
+menutrans Module\ Definition Définition\ de\ module
+menutrans Registry Extrait\ du\ registre
+menutrans Resource\ file Fichier\ de\ ressources
+menutrans Novell\ NCF\ batch Batch\ Novell\ NCF
+menutrans NSIS\ script Script\ NSIS
+menutrans Oracle\ config Config\.\ Oracle
+menutrans Palm\ resource\ compiler Compil\.\ de\ resources\ Palm
+menutrans PHP\ 3-4 PHP\ 3\ et\ 4
+menutrans Postfix\ main\ config Config\.\ Postfix
+menutrans Povray\ scene\ descr Scène\ Povray
+menutrans Povray\ configuration Config\.\ Povray
+menutrans Purify\ log Log\ Purify
+menutrans Readline\ config Config\.\ Readline
+menutrans RCS\ log\ output Log\ RCS
+menutrans RCS\ file Fichier\ RCS
+menutrans RockLinux\ package\ desc\. Desc\.\ pkg\.\ RockLinux
+menutrans Samba\ config Config\.\ Samba
+menutrans SGML\ catalog Catalogue\ SGML
+menutrans SGML\ DTD DTD\ SGML
+menutrans SGML\ Declaration Déclaration\ SGML
+menutrans Shell\ script Script\ shell
+menutrans sh\ and\ ksh sh\ et\ ksh
+menutrans Sinda\ compare Comparaison\ Sinda
+menutrans Sinda\ input Entrée\ Sinda
+menutrans Sinda\ output Sortie\ Sinda
+menutrans SKILL\ for\ Diva SKILL\ pour\ Diva
+menutrans Smarty\ Templates Patrons\ Smarty
+menutrans SNNS\ network Réseau\ SNNS
+menutrans SNNS\ pattern Motif\ SNNS
+menutrans SNNS\ result Résultat\ SNNS
+menutrans Snort\ Configuration Config\.\ Snort
+menutrans Squid\ config Config\.\ Squid
+menutrans Subversion\ commit Commit\ Subversion
+menutrans TAK\ compare Comparaison\ TAK
+menutrans TAK\ input Entrée\ TAK
+menutrans TAK\ output Sortie\ TAK
+menutrans TeX\ configuration Config\.\ TeX
+menutrans TF\ mud\ client TF\ (client\ MUD)
+menutrans Tidy\ configuration Config\.\ Tidy
+menutrans Trasys\ input Entrée\ Trasys
+menutrans Command\ Line Ligne\ de\ commande
+menutrans Geometry Géométrie
+menutrans Optics Optiques
+menutrans Vim\ help\ file Fichier\ d'aide\ Vim
+menutrans Vim\ script Script\ Vim
+menutrans Viminfo\ file Fichier\ Viminfo
+menutrans Virata\ config Config\.\ Virata
+menutrans Wget\ config Config\.\ wget
+menutrans Whitespace\ (add) Espaces\ et\ tabulations
+menutrans WildPackets\ EtherPeek\ Decoder Décodeur\ WildPackets\ EtherPeek
+menutrans X\ resources Resources\ X
+menutrans XXD\ hex\ dump Sortie\ hexa\.\ de\ xxd
+menutrans XFree86\ Config Config\.\ XFree86
+" The End Of The Syntax Menu
+
+menutrans &Show\ filetypes\ in\ menu &Afficher\ tout\ le\ menu
+" -SEP1-
+menutrans Set\ '&syntax'\ only Changer\ '&syntax'\ seulement
+menutrans Set\ '&filetype'\ too Changer\ '&filetype'\ aussi
+menutrans &Off &Off
+" -SEP3-
+menutrans Co&lor\ test Tester\ les\ co&uleurs
+menutrans &Highlight\ test Tester\ les\ g&roupes\ de\ surlignage
+menutrans &Convert\ to\ HTML Con&vertir\ en\ HTML
diff --git a/runtime/lang/menu_fr_fr.utf-8.vim b/runtime/lang/menu_fr_fr.utf-8.vim
new file mode 100644
index 000000000..5e4190649
--- /dev/null
+++ b/runtime/lang/menu_fr_fr.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: French for UTF-8 encoding
+
+source <sfile>:p:h/menu_fr_fr.latin1.vim
diff --git a/runtime/lang/menu_french_france.1252.vim b/runtime/lang/menu_french_france.1252.vim
new file mode 100644
index 000000000..2c5ddb51a
--- /dev/null
+++ b/runtime/lang/menu_french_france.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: French for Windows CodePage 1252 encoding
+
+source <sfile>:p:h/menu_fr_fr.latin1.vim
diff --git a/runtime/lang/menu_german_germany.1252.vim b/runtime/lang/menu_german_germany.1252.vim
new file mode 100644
index 000000000..f40d6b517
--- /dev/null
+++ b/runtime/lang/menu_german_germany.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: German for Windows CodePage 1252 encoding
+
+source <sfile>:p:h/menu_de_de.latin1.vim
diff --git a/runtime/lang/menu_hu.iso_8859-2.vim b/runtime/lang/menu_hu.iso_8859-2.vim
new file mode 100644
index 000000000..cd21d101f
--- /dev/null
+++ b/runtime/lang/menu_hu.iso_8859-2.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian for UTF-8 encoding
+
+source <sfile>:p:h/menu_hu_hu.iso_8859-2.vim
diff --git a/runtime/lang/menu_hu.utf-8.vim b/runtime/lang/menu_hu.utf-8.vim
new file mode 100644
index 000000000..2dd35ef4d
--- /dev/null
+++ b/runtime/lang/menu_hu.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian for UTF-8 encoding
+
+source <sfile>:p:h/menu_hu_hu.utf-8.vim
diff --git a/runtime/lang/menu_hu_hu.iso_8859-2.vim b/runtime/lang/menu_hu_hu.iso_8859-2.vim
new file mode 100644
index 000000000..d3fafce10
--- /dev/null
+++ b/runtime/lang/menu_hu_hu.iso_8859-2.vim
@@ -0,0 +1,258 @@
+" Menu Translations: Hungarian (Magyar)
+" Original Translation: Zoltán Árpádffy
+" Maintained By: Kontra Gergely <kgergely@mcl.hu>
+" Last Change: 2003 May 31
+" I'm working on defining (unaccented) hotkeys for everything.
+" I want to remove y and z hotkeys, because on the hungarian keymap they're at
+" a differrent place.
+" I also want to avoid g and j shortcuts, because you cannot see, wheter
+" they're underlined or not.
+" If the hotkeys are not uniq (pressing the hotkey doesn't executes the menu,
+" just one menupoint is selected), or you find any other undesired behaviour,
+" please report it to me.
+" All kind of feedback is welcome.
+"
+" Igyekeztem mindenhez gyorsbillentyût rendelni, lehetõleg nem ékezeteset.
+" További tennivaló az y és z gyorsbillentyûk kiirtása, ezenkívül a g, j
+" billentyûk irtása is, mivel ez utóbbiak aláhúzott változatát nem könnyû
+" felismerni.
+" Amennyiben valahol nem egyértelmûk a gyorsbillentyûk (a gyorsbillentyût
+" leütve nem hajtódik végre a kiszemelt menüpont, hanem csak kiválasztódik,
+" vagy másik menüpont választódik ki), vagy egyéb hibát találsz, kérlek jelezd
+" nekem a fenti email címen.
+" Mindennemû visszajelzést szívesen fogadok.
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding iso-8859-2
+
+" Help menu
+menutrans &Help &Súgó
+menutrans &Overview<Tab><F1> Á&ttekintés<Tab><F1>
+menutrans &How-to\ links &HOGYAN\ linkek
+menutrans &User\ Manual &Kézikönyv
+menutrans &Credits &Szerzõk,\ köszönetek
+menutrans Co&pying &Védjegy
+menutrans O&rphans Árvá&k
+menutrans &Find\.\.\. Ke&resés\.\.\.
+menutrans &Version &Verzió
+menutrans &About &Névjegy
+" File menu
+menutrans &File &Fájl
+menutrans &Open\.\.\.<Tab>:e Meg&nyitás\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Megnyitás\ új\ a&blakba\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew Új\ dok&umentum<Tab>:enew
+menutrans &Close<Tab>:close Be&zárás<Tab>:close
+menutrans &Save<Tab>:w &Mentés<Tab>:w
+menutrans Split\ &Diff\ with\.\.\. Össze&hasonlítás\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Összehasonlítás\ &patch\ -el\.\.\.
+menutrans Save\ &As\.\.\.<Tab>:sav Menté&s\ másként\.\.\.<Tab>:w
+menutrans &Print Nyomt&atás
+menutrans Sa&ve-Exit<Tab>:wqa Mentés\ és\ k&ilépés<Tab>:wqa
+menutrans E&xit<Tab>:qa &Kilépés<Tab>:qa
+
+" Edit menu
+menutrans &Edit S&zerkesztés
+menutrans &Undo<Tab>u &Visszavonás<Tab>u
+menutrans &Redo<Tab>^R Mé&gis<Tab>^R
+menutrans Rep&eat<Tab>\. &Ismét<Tab>\.
+menutrans Cu&t<Tab>"+x &Kivágás<Tab>"+x
+menutrans &Copy<Tab>"+y &Másolás<Tab>"+y
+menutrans &Paste<Tab>"+gP &Beillesztés<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Berakás\ e&lé<Tab>[p
+menutrans Put\ &After<Tab>]p Berakás\ &mögé<Tab>]p
+menutrans &Delete<Tab>x &Törlés<Tab>x
+menutrans &Select\ all<Tab>ggVG A&z\ összes kijelölése<Tab>ggvG
+menutrans &Find\.\.\. Ke&resés\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Keresés\ és\ c&sere\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Keresés\ és\ c&sere<Tab>:%s
+menutrans Find\ and\ Rep&lace Keresés\ és\ c&sere
+menutrans Find\ and\ Rep&lace<Tab>:s Keresés\ és\ c&sere<Tab>:s
+menutrans Settings\ &Window &Ablak\ beállításai
+menutrans &Global\ Settings Ál&talános\ beállítások
+menutrans F&ile\ Settings &Fájl\ beállítások
+menutrans C&olor\ Scheme &Színek
+menutrans &Keymap Billent&yûzetkiosztás
+
+" Edit.Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Minta\ kiemelés\ BE/KI<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Kis/nagybetû\ azonos/különbözõ<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Zárójelpár\ mutatása\ BE/KI<Tab>:set\ sm!
+menutrans &Context\ lines &Kurzor\ ablak\ szélétõl
+menutrans &Virtual\ Edit &Virtuális\ szerkesztés
+menutrans Never &Soha
+menutrans Block\ Selection &Blokk\ kijelölésekor
+menutrans Insert\ mode S&zöveg\ bevitelekor
+menutrans Block\ and\ Insert Bl&okk\ kijelölésekor\ és\ szöveg\ bevitelekor
+menutrans Always &Mindig
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! &Szövegbeviteli\ mód\ BE/KI<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &Vi\ kompatíbilis\ mód\ BE/Ki<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Ke&resési\ útvonal\.\.\.
+menutrans Ta&g\ Files\.\.\. &Tag\ fájl\.\.\.
+menutrans Toggle\ &Toolbar &Eszköztár\ BE/KI
+menutrans Toggle\ &Bottom\ Scrollbar &Vízszintes\ Görgetõsáv\ BE/KI
+menutrans Toggle\ &Left\ Scrollbar &Bal\ görgetõsáv\ BE/KI
+menutrans Toggle\ &Right\ Scrollbar &Jobb\ görgetõsáv\ BE/KI
+menutrans None Nincs
+
+" Edit.File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Sorszá&mozás\ BE/KI<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! &Lista\ mód\ BE/KI<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Sor&törés\ BE/KI<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Sortörés\ s&zóvégeknél\ BE/KI<tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! &Tab\ kifejtés\ BE/KI<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Automatikus\ behúzás\ BE/KI<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &C-behúzás\ BE/KI<Tab>:set\ cin!
+menutrans &Shiftwidth &Behúzás\ mértéke\ ('sw')
+menutrans Soft\ &Tabstop T&abulálás\ mértéke\ ('sts')
+menutrans Te&xt\ Width\.\.\. &Szöveg\ szélessége\.\.\.
+menutrans &File\ Format\.\.\. &Fájlformátum\.\.\.
+
+" Tools menu
+menutrans &Tools &Eszközök
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Ugrás\ a\ taghoz<Tab>g^]
+menutrans Jump\ &back<Tab>^T Ugrás\ &vissza<Tab>^T
+menutrans Build\ &Tags\ File &Tag\ fájl\ készítése
+menutrans &Folding &Behajtások
+menutrans &Make<Tab>:make &Fordítás<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Hibák\ listája<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Ü&zenetek\ listája<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &Következõ\ &hiba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Elõzõ\ hiba<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Régebbi\ lista<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Újabb\ lista<Tab>:cnew
+menutrans Error\ &Window Hibaablak
+menutrans &Update<Tab>:cwin &Frissítés<Tab>:cwin
+menutrans &Open<Tab>:copen M&egnyitás<Tab>:copen
+menutrans &Close<Tab>:cclose Be&zárás<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Normál->HEX\ nézet<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX->Normál\ nézet<Tab>:%!xxd\ -r
+menutrans &Set\ Compiler Fordító\ &megadása
+
+" Tools.Folding
+menutrans &Enable/Disable\ folds<Tab>zi Behajtások\ BE&/KI<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Aktuális\ sor\ látszik<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Csak\ aktuális\ sor\ látszik<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Következõ\ szint\ be&zárása<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Összes\ hajtás\ &bezárása<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Következõ\ szint\ ki&nyitása<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Összes\ hajtás\ &kinyitása<Tab>zR
+menutrans Fold\ Met&hod Behajtások\ &létrehozása
+menutrans M&anual &Kézi
+menutrans I&ndent Be&húzás
+menutrans E&xpression Ki&fejezés
+menutrans S&yntax &Szintaxis
+menutrans &Diff &Diff-különbség
+menutrans Ma&rker &Jelölés
+menutrans Create\ &Fold<Tab>zf Ú&j\ behajtás<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Behajtás\ &törlése<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Öss&zes\ behajtás\ törlése<Tab>zD
+menutrans Fold\ col&umn\ width Behajtások\ a\ &margón\ x\ oszlopban
+
+" Tools.Diff
+menutrans &Update &Frissítés
+menutrans &Get\ Block Block\ &BE
+menutrans &Put\ Block Block\ &KI
+
+
+
+" Names for buffer menu.
+menutrans &Buffers &Pufferok
+menutrans &Refresh\ menu &Frissítés
+menutrans Delete &Törlés
+menutrans &Alternate &Csere
+menutrans &Next &Következõ
+menutrans &Previous &Elõzõ
+
+" Window menu
+menutrans &Window &Ablak
+menutrans &New<Tab>^Wn Ú&j<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Felosztás<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Felosztás\ &#-val<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Felosztás\ Fü&ggõlegesen<Tab>^Wv
+menutrans Split\ File\ E&xplorer Új\ &intézõ
+menutrans &Close<Tab>^Wc Be&zárás<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo &Többi\ bezárása<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Következõ<Tab>^Ww
+menutrans P&revious<Tab>^WW &Elõzõ<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Azonos\ magasság<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Ma&x\ magasság<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ &Min\ magasság<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Max\ &szélesség<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Mi&n\ szélesség<Tab>^W1\|
+menutrans Move\ &To &Elmozdítás
+menutrans &Top<Tab>^WK &Fel<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Le<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Balra<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Jobbra<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Gördítés\ &felfelé<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Gördítés\ &lefelé<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. &Betûtípus\.\.\.
+
+" The popup menu
+menutrans &Undo &Visszavonás
+menutrans Cu&t &Kivágás
+menutrans &Copy &Másolás
+menutrans &Paste &Beillesztés
+menutrans &Delete &Törlés
+menutrans Select\ Blockwise Kijelölés\ blo&kként
+menutrans Select\ &Word S&zó\ kijelölése
+menutrans Select\ &Line &Sor\ kijelölése
+menutrans Select\ &Block B&lokk\ kijelölése
+menutrans Select\ &All A&z\ összes\ kijelölése
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Megnyitás
+ tmenu ToolBar.Save Mentés
+ tmenu ToolBar.SaveAll Mindet menti
+ tmenu ToolBar.Print Nyomtatás
+ tmenu ToolBar.Undo Visszavonás
+ tmenu ToolBar.Redo Mégis
+ tmenu ToolBar.Cut Kivágás
+ tmenu ToolBar.Copy Másolás
+ tmenu ToolBar.Paste Beillesztés
+ tmenu ToolBar.Find Keresés
+ tmenu ToolBar.FindNext Tovább keresés
+ tmenu ToolBar.FindPrev Keresés visszafelé
+ tmenu ToolBar.Replace Keresés/csere
+ tmenu ToolBar.LoadSesn Munkamenet beolvasás
+ tmenu ToolBar.SaveSesn Munkamenet mentés
+ tmenu ToolBar.RunScript Vim program indítás
+ tmenu ToolBar.Make Projekt építés
+ tmenu ToolBar.Shell Shell indítás
+ tmenu ToolBar.RunCtags Tag építés
+ tmenu ToolBar.TagJump Ugrás a kurzor alatti tagra
+ tmenu ToolBar.Help Vim súgó
+ tmenu ToolBar.FindHelp Keresés a Vim súgóban
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax Sz&intaxis
+menutrans &Show\ filetypes\ in\ menu Fájl&típusok\ menü
+menutrans Set\ '&syntax'\ only Csak\ '&syntax'
+menutrans Set\ '&filetype'\ too '&filetype'\ is
+menutrans &Off &Ki
+menutrans &Manual Ké&zi
+menutrans A&utomatic A&utomatikus
+menutrans on/off\ for\ &This\ file &BE/KI\ ennél\ a\ fájlnál
+menutrans Co&lor\ test &Színteszt
+menutrans &Highlight\ test Kiemelés\ &teszt
+menutrans &Convert\ to\ HTML &HTML\ oldal\ készítése
+
+" dialog texts
+let menutrans_no_file = "[Nincs file]"
+let menutrans_help_dialog = "Írd be a kívánt szót vagy parancsot:\n\n A szövegbeviteli parancsok elé írj i_-t (pl.: i_CTRL-X)\nA sorszerkeszõ parancsok elé c_-t (pl.: c_<Del>)\nA változókat a ' jellel vedd körül (pl.: 'shiftwidth')"
+let g:menutrans_path_dialog = "Írd be a keresett fájl lehetséges elérési útjait, vesszõvel elválasztva"
+let g:menutrans_tags_dialog = "Írd be a tag fájl lehetséges elérési útjait, vesszõvel elválasztva"
+let g:menutrans_textwidth_dialog = "Írd be a szöveg szélességét (0 = formázás kikapcsolva)"
+let g:menutrans_fileformat_dialog = "Válaszd ki a fájl formátumát"
diff --git a/runtime/lang/menu_hu_hu.utf-8.vim b/runtime/lang/menu_hu_hu.utf-8.vim
new file mode 100644
index 000000000..83a4dca40
--- /dev/null
+++ b/runtime/lang/menu_hu_hu.utf-8.vim
@@ -0,0 +1,242 @@
+" Menu Translations: Hungarian (Magyar)
+" Original Translation: Zoltán Ãrpádffy
+" Maintained By: Kontra Gergely <kgergely@mcl.hu>
+" Last Change: 2004 Jun 10
+"
+" This file was converted from menu_hu_hu.iso_8859-2.vim. See there for
+" remarks.
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+" Help menu
+menutrans &Help &Súgó
+menutrans &Overview<Tab><F1> Ã&ttekintés<Tab><F1>
+menutrans &How-to\ links &HOGYAN\ linkek
+menutrans &User\ Manual &Kézikönyv
+menutrans &Credits &Szerzők,\ köszönetek
+menutrans Co&pying &Védjegy
+menutrans O&rphans Ãrvá&k
+menutrans &Find\.\.\. Ke&resés\.\.\.
+menutrans &Version &Verzió
+menutrans &About &Névjegy
+" File menu
+menutrans &File &Fájl
+menutrans &Open\.\.\.<Tab>:e Meg&nyitás\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Megnyitás\ új\ a&blakba\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew Új\ dok&umentum<Tab>:enew
+menutrans &Close<Tab>:close Be&zárás<Tab>:close
+menutrans &Save<Tab>:w &Mentés<Tab>:w
+menutrans Split\ &Diff\ with\.\.\. Össze&hasonlítás\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Összehasonlítás\ &patch\ -el\.\.\.
+menutrans Save\ &As\.\.\.<Tab>:sav Menté&s\ másként\.\.\.<Tab>:w
+menutrans &Print Nyomt&atás
+menutrans Sa&ve-Exit<Tab>:wqa Mentés\ és\ k&ilépés<Tab>:wqa
+menutrans E&xit<Tab>:qa &Kilépés<Tab>:qa
+
+" Edit menu
+menutrans &Edit S&zerkesztés
+menutrans &Undo<Tab>u &Visszavonás<Tab>u
+menutrans &Redo<Tab>^R Mé&gis<Tab>^R
+menutrans Rep&eat<Tab>\. &Ismét<Tab>\.
+menutrans Cu&t<Tab>"+x &Kivágás<Tab>"+x
+menutrans &Copy<Tab>"+y &Másolás<Tab>"+y
+menutrans &Paste<Tab>"+gP &Beillesztés<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Berakás\ e&lé<Tab>[p
+menutrans Put\ &After<Tab>]p Berakás\ &mögé<Tab>]p
+menutrans &Delete<Tab>x &Törlés<Tab>x
+menutrans &Select\ all<Tab>ggVG A&z\ összes kijelölése<Tab>ggvG
+menutrans &Find\.\.\. Ke&resés\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Keresés\ és\ c&sere\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Keresés\ és\ c&sere<Tab>:%s
+menutrans Find\ and\ Rep&lace Keresés\ és\ c&sere
+menutrans Find\ and\ Rep&lace<Tab>:s Keresés\ és\ c&sere<Tab>:s
+menutrans Settings\ &Window &Ablak\ beállításai
+menutrans &Global\ Settings Ãl&talános\ beállítások
+menutrans F&ile\ Settings &Fájl\ beállítások
+menutrans C&olor\ Scheme &Színek
+menutrans &Keymap Billent&yűzetkiosztás
+
+" Edit.Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Minta\ kiemelés\ BE/KI<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Kis/nagybetű\ azonos/különböző<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Zárójelpár\ mutatása\ BE/KI<Tab>:set\ sm!
+menutrans &Context\ lines &Kurzor\ ablak\ szélétől
+menutrans &Virtual\ Edit &Virtuális\ szerkesztés
+menutrans Never &Soha
+menutrans Block\ Selection &Blokk\ kijelölésekor
+menutrans Insert\ mode S&zöveg\ bevitelekor
+menutrans Block\ and\ Insert Bl&okk\ kijelölésekor\ és\ szöveg\ bevitelekor
+menutrans Always &Mindig
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! &Szövegbeviteli\ mód\ BE/KI<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &Vi\ kompatíbilis\ mód\ BE/Ki<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Ke&resési\ útvonal\.\.\.
+menutrans Ta&g\ Files\.\.\. &Tag\ fájl\.\.\.
+menutrans Toggle\ &Toolbar &Eszköztár\ BE/KI
+menutrans Toggle\ &Bottom\ Scrollbar &Vízszintes\ Görgetősáv\ BE/KI
+menutrans Toggle\ &Left\ Scrollbar &Bal\ görgetősáv\ BE/KI
+menutrans Toggle\ &Right\ Scrollbar &Jobb\ görgetősáv\ BE/KI
+menutrans None Nincs
+
+" Edit.File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Sorszá&mozás\ BE/KI<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! &Lista\ mód\ BE/KI<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Sor&törés\ BE/KI<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Sortörés\ s&zóvégeknél\ BE/KI<tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! &Tab\ kifejtés\ BE/KI<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Automatikus\ behúzás\ BE/KI<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &C-behúzás\ BE/KI<Tab>:set\ cin!
+menutrans &Shiftwidth &Behúzás\ mértéke\ ('sw')
+menutrans Soft\ &Tabstop T&abulálás\ mértéke\ ('sts')
+menutrans Te&xt\ Width\.\.\. &Szöveg\ szélessége\.\.\.
+menutrans &File\ Format\.\.\. &Fájlformátum\.\.\.
+
+" Tools menu
+menutrans &Tools &Eszközök
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Ugrás\ a\ taghoz<Tab>g^]
+menutrans Jump\ &back<Tab>^T Ugrás\ &vissza<Tab>^T
+menutrans Build\ &Tags\ File &Tag\ fájl\ készítése
+menutrans &Folding &Behajtások
+menutrans &Make<Tab>:make &Fordítás<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Hibák\ listája<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Ü&zenetek\ listája<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &Következő\ &hiba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Előző\ hiba<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Régebbi\ lista<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Újabb\ lista<Tab>:cnew
+menutrans Error\ &Window Hibaablak
+menutrans &Update<Tab>:cwin &Frissítés<Tab>:cwin
+menutrans &Open<Tab>:copen M&egnyitás<Tab>:copen
+menutrans &Close<Tab>:cclose Be&zárás<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Normál->HEX\ nézet<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX->Normál\ nézet<Tab>:%!xxd\ -r
+menutrans &Set\ Compiler Fordító\ &megadása
+
+" Tools.Folding
+menutrans &Enable/Disable\ folds<Tab>zi Behajtások\ BE&/KI<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Aktuális\ sor\ látszik<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Csak\ aktuális\ sor\ látszik<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Következő\ szint\ be&zárása<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Összes\ hajtás\ &bezárása<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Következő\ szint\ ki&nyitása<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Összes\ hajtás\ &kinyitása<Tab>zR
+menutrans Fold\ Met&hod Behajtások\ &létrehozása
+menutrans M&anual &Kézi
+menutrans I&ndent Be&húzás
+menutrans E&xpression Ki&fejezés
+menutrans S&yntax &Szintaxis
+menutrans &Diff &Diff-különbség
+menutrans Ma&rker &Jelölés
+menutrans Create\ &Fold<Tab>zf Ú&j\ behajtás<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Behajtás\ &törlése<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Öss&zes\ behajtás\ törlése<Tab>zD
+menutrans Fold\ col&umn\ width Behajtások\ a\ &margón\ x\ oszlopban
+
+" Tools.Diff
+menutrans &Update &Frissítés
+menutrans &Get\ Block Block\ &BE
+menutrans &Put\ Block Block\ &KI
+
+
+
+" Names for buffer menu.
+menutrans &Buffers &Pufferok
+menutrans &Refresh\ menu &Frissítés
+menutrans Delete &Törlés
+menutrans &Alternate &Csere
+menutrans &Next &Következő
+menutrans &Previous &Előző
+
+" Window menu
+menutrans &Window &Ablak
+menutrans &New<Tab>^Wn Ú&j<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Felosztás<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Felosztás\ &#-val<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Felosztás\ Fü&ggőlegesen<Tab>^Wv
+menutrans Split\ File\ E&xplorer Új\ &intéző
+menutrans &Close<Tab>^Wc Be&zárás<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo &Többi\ bezárása<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Következő<Tab>^Ww
+menutrans P&revious<Tab>^WW &Előző<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Azonos\ magasság<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Ma&x\ magasság<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ &Min\ magasság<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Max\ &szélesség<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Mi&n\ szélesség<Tab>^W1\|
+menutrans Move\ &To &Elmozdítás
+menutrans &Top<Tab>^WK &Fel<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Le<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Balra<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Jobbra<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Gördítés\ &felfelé<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Gördítés\ &lefelé<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. &Betűtípus\.\.\.
+
+" The popup menu
+menutrans &Undo &Visszavonás
+menutrans Cu&t &Kivágás
+menutrans &Copy &Másolás
+menutrans &Paste &Beillesztés
+menutrans &Delete &Törlés
+menutrans Select\ Blockwise Kijelölés\ blo&kként
+menutrans Select\ &Word S&zó\ kijelölése
+menutrans Select\ &Line &Sor\ kijelölése
+menutrans Select\ &Block B&lokk\ kijelölése
+menutrans Select\ &All A&z\ összes\ kijelölése
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Megnyitás
+ tmenu ToolBar.Save Mentés
+ tmenu ToolBar.SaveAll Mindet menti
+ tmenu ToolBar.Print Nyomtatás
+ tmenu ToolBar.Undo Visszavonás
+ tmenu ToolBar.Redo Mégis
+ tmenu ToolBar.Cut Kivágás
+ tmenu ToolBar.Copy Másolás
+ tmenu ToolBar.Paste Beillesztés
+ tmenu ToolBar.Find Keresés
+ tmenu ToolBar.FindNext Tovább keresés
+ tmenu ToolBar.FindPrev Keresés visszafelé
+ tmenu ToolBar.Replace Keresés/csere
+ tmenu ToolBar.LoadSesn Munkamenet beolvasás
+ tmenu ToolBar.SaveSesn Munkamenet mentés
+ tmenu ToolBar.RunScript Vim program indítás
+ tmenu ToolBar.Make Projekt építés
+ tmenu ToolBar.Shell Shell indítás
+ tmenu ToolBar.RunCtags Tag építés
+ tmenu ToolBar.TagJump Ugrás a kurzor alatti tagra
+ tmenu ToolBar.Help Vim súgó
+ tmenu ToolBar.FindHelp Keresés a Vim súgóban
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax Sz&intaxis
+menutrans &Show\ filetypes\ in\ menu Fájl&típusok\ menü
+menutrans Set\ '&syntax'\ only Csak\ '&syntax'
+menutrans Set\ '&filetype'\ too '&filetype'\ is
+menutrans &Off &Ki
+menutrans &Manual Ké&zi
+menutrans A&utomatic A&utomatikus
+menutrans on/off\ for\ &This\ file &BE/KI\ ennél\ a\ fájlnál
+menutrans Co&lor\ test &Színteszt
+menutrans &Highlight\ test Kiemelés\ &teszt
+menutrans &Convert\ to\ HTML &HTML\ oldal\ készítése
+
+" dialog texts
+let menutrans_no_file = "[Nincs file]"
+let menutrans_help_dialog = "Ãrd be a kívánt szót vagy parancsot:\n\n A szövegbeviteli parancsok elé írj i_-t (pl.: i_CTRL-X)\nA sorszerkeszÅ‘ parancsok elé c_-t (pl.: c_<Del>)\nA változókat a ' jellel vedd körül (pl.: 'shiftwidth')"
+let g:menutrans_path_dialog = "Ãrd be a keresett fájl lehetséges elérési útjait, vesszÅ‘vel elválasztva"
+let g:menutrans_tags_dialog = "Ãrd be a tag fájl lehetséges elérési útjait, vesszÅ‘vel elválasztva"
+let g:menutrans_textwidth_dialog = "Ãrd be a szöveg szélességét (0 = formázás kikapcsolva)"
+let g:menutrans_fileformat_dialog = "Válaszd ki a fájl formátumát"
diff --git a/runtime/lang/menu_it.latin1.vim b/runtime/lang/menu_it.latin1.vim
new file mode 100644
index 000000000..333bb4166
--- /dev/null
+++ b/runtime/lang/menu_it.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian
+
+source <sfile>:p:h/menu_it_it.latin1.vim
diff --git a/runtime/lang/menu_it.utf-8.vim b/runtime/lang/menu_it.utf-8.vim
new file mode 100644
index 000000000..1770445ab
--- /dev/null
+++ b/runtime/lang/menu_it.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian for UTF-8 encoding
+
+source <sfile>:p:h/menu_it_it.latin1.vim
diff --git a/runtime/lang/menu_it_it.latin1.vim b/runtime/lang/menu_it_it.latin1.vim
new file mode 100644
index 000000000..7da58e1b9
--- /dev/null
+++ b/runtime/lang/menu_it_it.latin1.vim
@@ -0,0 +1,327 @@
+" Menu Translations: Italian / Italiano
+" Maintainer: Antonio Colombo <antonio.colombo@jrc.it>
+" Vlad Sandrini <sator72@libero.it>
+" Last Change: 2004 Mar 3
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding iso-8859-1
+
+" Help / Aiuto
+menut &Help &Aiuto
+menut &Overview<Tab><F1> &Panoramica<Tab><F1>
+menut &User\ Manual Manuale\ &Utente
+menut &How-to\ links Co&me\.\.\.
+"menut &GUI &GUI
+menut &Credits Cr&editi
+menut Co&pying C&opie
+menut &Sponsor/Register &Sponsor/Registrazione
+menut O&rphans O&rfani
+"menut &Find\.\.\. &Cerca\.\.\.
+"NOTA: fa conflitto con 'cerca' nel menu 'modifica'
+menut &Version &Versione
+menut &About &Intro
+
+let g:menutrans_help_dialog = "Batti un comando o una parola per cercare aiuto:\n\nPremetti i_ per comandi in modalità Input (ad.es.: i_CTRL-X)\nPremetti c_ per comandi che editano la linea-comandi (ad.es.: c_<Del>)\nPremetti ' per un nome di opzione (ad.es.: 'shiftwidth')"
+
+" File menu
+"menut &File &File
+"
+menut &Open\.\.\.<Tab>:e &Apri\.\.\.<Tab>:e
+menut Sp&lit-Open\.\.\.<Tab>:sp A&pri\ nuova\ Finestra\.\.\.<Tab>:sp
+menut &New<Tab>:enew &Nuovo<Tab>:enew
+menut &Close<Tab>:close &Chiudi<Tab>:close
+menut &Save<Tab>:w &Salva<Tab>:w
+menut Save\ &As\.\.\.<Tab>:sav Salva\ &con\ nome\.\.\.<Tab>:sav
+
+if has("diff")
+ menut Split\ &Diff\ with\.\.\. Finestra\ &Differenza\ con\.\.\.
+ menut Split\ Patched\ &By\.\.\. Finestra\ Patc&h\ da\.\.\.
+endif
+
+menut &Print S&tampa
+menut Sa&ve-Exit<Tab>:wqa Sa&lva\ ed\ esci<Tab>:wqa
+menut E&xit<Tab>:qa &Esci<Tab>:qa
+
+" Edit / Modifica
+
+menut &Edit &Modifica
+menut &Undo<Tab>u &Annulla<Tab>u
+menut &Redo<Tab>^R &Ripristina<Tab>^R
+menut Rep&eat<Tab>\. Ri&peti<Tab>\.
+menut Cu&t<Tab>"+x &Taglia<Tab>"+x
+menut &Copy<Tab>"+y &Copia<Tab>"+y
+menut &Paste<Tab>"+gP &Incolla<Tab>"+gP
+menut Put\ &Before<Tab>[p &Metti\ davanti<Tab>[p
+menut Put\ &After<Tab>]p M&etti\ dietro<Tab>]p
+menut &Delete<Tab>x Cance&lla<Tab>x
+menut &Select\ all<Tab>ggVG Seleziona\ &tutto<Tab>ggVG
+menut &Select\ All<Tab>ggVG Seleziona\ &tutto<Tab>ggVG
+menut &Find\.\.\. &Cerca\.\.\.
+menut Find\ and\ Rep&lace\.\.\. &Sostituisci\.\.\.
+menut Settings\ &Window &Finestra\ Impostazioni
+menut &Global\ Settings Impostazioni\ &globali
+menut Question Domanda
+
+" Edit / Modifica Impostazioni Globali
+menut &Global\ Settings Impostazioni\ &Globali
+menut Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Evidenzia\ ricerche\ Sì/No<Tab>:set\ hls!
+menut Toggle\ &Ignore-case<Tab>:set\ ic! &Ignora\ maiusc\.-minusc\.\ Sì/No<Tab>:set\ ic!
+menut Toggle\ &Showmatch<Tab>:set\ sm! Indica\ &Corrispondente\ Sì/No<Tab>:set\ sm!
+
+menut &Context\ lines &Linee\ di\ contesto
+menut &Virtual\ Edit &Edit\ Virtuale
+
+menut Never Mai
+menut Block\ Selection Selezione\ Blocco
+menut Insert\ mode Modalità\ Inserimento
+menut Block\ and\ Insert Selezione\ Blocco+Inserimento
+menut Always Sempre
+
+menut Toggle\ Insert\ &Mode<Tab>:set\ im! &Modalità\ Inserimento\ Sì/No<Tab>:set\ im!
+menut Toggle\ Vi\ C&ompatible<Tab>:set\ cp! C&ompatibile\ Vi\ Sì/No<Tab>:set\ cp!
+menut Search\ &Path\.\.\. Ca&mmino\ di\ ricerca\.\.\.
+menut Ta&g\ Files\.\.\. File\ Ta&g\.\.\.
+"
+" Opzioni GUI
+menut Toggle\ &Toolbar Barra\ S&trumenti\ Sì/No
+menut Toggle\ &Bottom\ Scrollbar Barra\ Scorrimento\ in\ &fondo\ Sì/No
+menut Toggle\ &Left\ Scrollbar Barra\ Scorrimento\ a\ &sinistra\ Sì/No
+menut Toggle\ &Right\ Scrollbar Barra\ Scorrimento\ a\ &destra\ Sì/No
+
+let g:menutrans_path_dialog = "Batti percorso di ricerca per i file.\nSepara fra loro i nomi di directory con una virgola."
+let g:menutrans_tags_dialog = "Batti nome dei file di tag.\nSepara fra loro i nomi di directory con una virgola."
+
+" Edit / Impostazioni File
+menut F&ile\ Settings &Impostazioni\ File
+
+" Boolean options
+menut Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numerazione\ \ Sì/No<Tab>:set\ nu!
+menut Toggle\ &List\ Mode<Tab>:set\ list! Modalità\ &Lista\ Sì/No<Tab>:set\ list!
+menut Toggle\ Line\ &Wrap<Tab>:set\ wrap! Linee\ &Continuate\ Sì/No<Tab>:set\ wrap!
+menut Toggle\ W&rap\ at\ word<Tab>:set\ lbr! A\ capo\ alla\ &parola\ Sì/No<Tab>:set\ lbr!
+menut Toggle\ &expand-tab<Tab>:set\ et! &Espandi\ Tabulazione\ Sì/No<Tab>:set\ et!
+menut Toggle\ &auto-indent<Tab>:set\ ai! Indentazione\ &automatica\ Sì/No<Tab>:set ai!
+menut Toggle\ &C-indenting<Tab>:set\ cin! Indentazione\ stile\ &C\ Sì/No<Tab>:set cin!
+
+" altre opzioni
+menut &Shiftwidth &Spazi\ Rientranza
+menut Soft\ &Tabstop &Tabulazione\ Software
+menut Te&xt\ Width\.\.\. Lunghe&zza\ Riga\.\.\.
+menut &File\ Format\.\.\. Formato\ &File\.\.\.
+
+let g:menutrans_textwidth_dialog = "Batti nuova lunghezza linea (0 per inibire la formattazione): "
+
+let g:menutrans_fileformat_dialog = "Scegli formato con cui scrivere il file"
+
+menut C&olor\ Scheme Schema\ C&olori
+
+menut default normale
+menut DEFAULT NORMALE
+menut evening notturno
+menut EVENING NOTTURNO
+menut morning diurno
+menut MORNING DIURNO
+menut shine brillante
+menut SHINE BRILLANTE
+menut peachpuff pesca
+menut PEACHPUF PESCA
+
+menut &Keymap &Mappa\ tastiera
+
+menut None nessuna
+menut accents accenti
+menut ACCENTS ACCENTI
+menut hebrew ebraico
+menut HEBREW EBRAICO
+menut hebrew_iso-8859-8 ebraico_iso-8859-8
+menut hebrew_cp1255 ebraico_cp1255
+menut hebrew_utf-8 ebraico_utf-8
+menut hebrewp_iso-8859-8 ebraico_p_iso-8859-8
+menut HEBREW- EBRAICO+
+menut hebrewp EBRAICOP
+menut HEBREWP EBRAICOP
+menut russian-jcuken cirillico-jcuken
+menut russian-jcukenwin cirillico-jcuken-win
+menut RUSSIAN CIRILLICO
+menut RUSSIAN- CIRILLICO-
+
+menut Select\ Fo&nt\.\.\. Scegli\ &Font\.\.\.
+
+" Menu strumenti programmazione
+menut &Tools &Strumenti
+
+menut &Jump\ to\ this\ tag<Tab>g^] &Vai\ a\ questa\ Tag<Tab>g^]
+menut Jump\ &back<Tab>^T Torna\ &indietro<Tab>^T
+menut Build\ &Tags\ File Costruisci\ File\ &Tags\
+
+" Menu piegature / Fold
+if has("folding")
+ menut &Folding &Piegature
+ " apri e chiudi piegature
+ menut &Enable/Disable\ folds<Tab>zi Pi&egature\ Sì/No<Tab>zi
+ menut &View\ Cursor\ Line<Tab>zv &Vedi\ linea\ col\ Cursore<Tab>zv
+ menut Vie&w\ Cursor\ Line\ only<Tab>zMzx Vedi\ &solo\ linea\ col\ Cursore<Tab>zMzx
+ menut C&lose\ more\ folds<Tab>zm C&hiudi\ più\ Piegature<Tab>zm
+ menut &Close\ all\ folds<Tab>zM &Chiudi\ tutte\ le\ Piegature<Tab>zM
+ menut O&pen\ more\ folds<Tab>zr A&pri\ più\ Piegature<Tab>zr
+ menut &Open\ all\ folds<Tab>zR &Apri\ tutte\ le\ Piegature<Tab>zR
+ " metodo piegatura
+ menut Fold\ Met&hod Meto&do\ Piegatura
+ menut M&anual &Manuale
+ menut I&ndent &Nidificazione
+ menut E&xpression &Espressione\ Reg\.
+ menut S&yntax &Sintassi
+ menut &Diff &Differenza
+ menut Ma&rker Mar&catura
+ " crea e cancella piegature
+ menut Create\ &Fold<Tab>zf Crea\ &Piegatura<Tab>zf
+ menut &Delete\ Fold<Tab>zd &Leva\ Piegatura<Tab>zd
+ menut Delete\ &All\ Folds<Tab>zD Leva\ &tutte\ le\ Piegature<Tab>zD
+ " movimenti all'interno delle piegature
+ menut Fold\ col&umn\ width Larghezza\ piegat&ure\ in\ colonne
+endif " has folding
+
+if has("diff")
+ menut &Diff &Differenza
+ "
+ menut &Update &Aggiorna
+ menut &Get\ Block &Importa\ Differenze
+ menut &Put\ Block &Esporta\ Differenze
+endif " has diff
+
+menut &Make<Tab>:make Esegui\ &Make<Tab>:make
+
+menut &List\ Errors<Tab>:cl Lista\ &Errori<Tab>:cl
+menut L&ist\ Messages<Tab>:cl! Lista\ &Messaggi<Tab>:cl!
+menut &Next\ Error<Tab>:cn Errore\ S&uccessivo<Tab>:cn
+menut &Previous\ Error<Tab>:cp Errore\ &Precedente<Tab>:cp
+menut &Older\ List<Tab>:cold Lista\ men&o\ recente<Tab>:cold
+menut N&ewer\ List<Tab>:cnew Lista\ più\ rece&nte<Tab>:cnew
+
+menut Error\ &Window &Finestra\ errori
+
+menut &Update<Tab>:cwin A&ggiorna<Tab>:cwin
+menut &Open<Tab>:copen &Apri<Tab>:copen
+menut &Close<Tab>:cclose &Chiudi<Tab>:cclose
+
+menut &Convert\ to\ HEX<Tab>:%!xxd &Converti\ a\ Esadecimale<Tab>:%!xxd
+menut Conve&rt\ back<Tab>:%!xxd\ -r Conve&rti\ da\ Esadecimale<Tab>:%!xxd\ -r
+
+menut &Set\ Compiler Impo&sta\ Compilatore
+
+" Buffers / Buffer
+menut &Buffers &Buffer
+
+menut &Refresh\ menu A&ggiorna\ menu
+menut &Delete &Elimina
+menut &Alternate &Alternato
+menut &Next &Successivo
+menut &Previous &Precedente
+menut [No\ File] [Nessun\ File]
+" Syntax / Sintassi
+menut &Syntax &Sintassi
+menut &Show\ filetypes\ in\ menu Mo&stra\ tipi\ di\ file\ nel\ menu
+menut Set\ '&syntax'\ only Attiva\ solo\ \ '&syntax'
+menut Set\ '&filetype'\ too Attiva\ anche\ '&filetype'
+menut &Off &Disattiva
+menut &Manual &Manuale
+menut A&utomatic A&utomatico
+menut on/off\ for\ &This\ file Attiva\ Sì/No\ su\ ques&to\ file
+menut Co&lor\ test Test\ &Colori
+menut &Highlight\ test Test\ &Evidenziamento
+menut &Convert\ to\ HTML Converti\ ad\ &HTML
+
+let g:menutrans_no_file = "[Senza nome]"
+
+" Window / Finestra
+menut &Window &Finestra
+
+menut &New<Tab>^Wn &Nuova<Tab>^Wn
+menut S&plit<Tab>^Ws &Dividi\ lo\ schermo<Tab>^Ws
+menut Sp&lit\ To\ #<Tab>^W^^ D&ividi\ verso\ #<Tab>^W^^
+menut Split\ &Vertically<Tab>^Wv Di&vidi\ verticalmente<Tab>^Wv
+menut Split\ File\ E&xplorer Aggiungi\ finestra\ E&xplorer
+
+menut &Close<Tab>^Wc &Chiudi<Tab>^Wc
+menut Close\ &Other(s)<Tab>^Wo C&hiudi\ altra(e)<Tab>^Wo
+
+menut Move\ &To &Muovi\ verso
+
+menut &Top<Tab>^WK &Cima<Tab>^WK
+menut &Bottom<Tab>^WJ &Fondo<Tab>^WJ
+menut &Left\ side<Tab>^WH Lato\ &Sinistro<Tab>^WH
+menut &Right\ side<Tab>^WL Lato\ &Destro<Tab>^WL
+menut Rotate\ &Up<Tab>^WR Ruota\ verso\ l'&alto<Tab>^WR
+menut Rotate\ &Down<Tab>^Wr Ruota\ verso\ il\ &basso<Tab>^Wr
+
+menut &Equal\ Size<Tab>^W= &Uguale\ ampiezza<Tab>^W=
+menut &Max\ Height<Tab>^W_ &Altezza\ massima<Tab>^W_
+menut M&in\ Height<Tab>^W1_ A&ltezza\ minima<Tab>^W1_
+menut Max\ &Width<Tab>^W\| Larghezza\ massima<Tab>^W\|
+menut Min\ Widt&h<Tab>^W1\| Larghezza\ minima<Tab>^W1\|
+
+" The popup menu
+menut &Undo &Annulla
+menut Cu&t &Taglia
+menut &Copy &Copia
+menut &Paste &Incolla
+menut &Delete &Elimina
+
+menut Select\ Blockwise Seleziona\ in\ blocco
+menut Select\ &Word Seleziona\ &Parola
+menut Select\ &Line Seleziona\ &Linea
+menut Select\ &Block Seleziona\ &Blocco
+menut Select\ &All Seleziona\ T&utto
+
+" The GUI Toolbar / Barra Strumenti
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Apri
+ tmenu ToolBar.Save Salva
+ tmenu ToolBar.SaveAll Salva Tutto
+ tmenu ToolBar.Print Stampa
+ tmenu ToolBar.Undo Annulla
+ tmenu ToolBar.Redo Ripristina
+ tmenu ToolBar.Cut Taglia
+ tmenu ToolBar.Copy Copia
+ tmenu ToolBar.Paste Incolla
+
+ if !has("gui_athena")
+ tmenu ToolBar.Find Cerca
+ tmenu ToolBar.FindNext Cerca Successivo
+ tmenu ToolBar.FindPrev Cerca Precedente
+ tmenu ToolBar.Replace Sostituisci
+ endif
+
+if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nuova finestra
+ tmenu ToolBar.WinSplit Dividi finestra
+ tmenu ToolBar.WinMax Massima ampiezza
+ tmenu ToolBar.WinMin Minima ampiezza
+ tmenu ToolBar.WinVSplit Dividi verticalmente
+ tmenu ToolBar.WinMaxWidth Massima larghezza
+ tmenu ToolBar.WinMinWidth Minima larghezza
+ tmenu ToolBar.WinClose Chiudi finestra
+endif
+
+ tmenu ToolBar.LoadSesn Carica Sessione
+ tmenu ToolBar.SaveSesn Salva Sessione
+ tmenu ToolBar.RunScript Esegui Script
+ tmenu ToolBar.Make Make
+ tmenu ToolBar.Shell Shell
+ tmenu ToolBar.RunCtags Esegui Ctags
+ tmenu ToolBar.TagJump Vai a Tag
+ tmenu ToolBar.Help Aiuto
+ tmenu ToolBar.FindHelp Cerca in Aiuto
+ endfun
+endif
+
+" vim: set sw=2 :
diff --git a/runtime/lang/menu_it_it.utf-8.vim b/runtime/lang/menu_it_it.utf-8.vim
new file mode 100644
index 000000000..1770445ab
--- /dev/null
+++ b/runtime/lang/menu_it_it.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian for UTF-8 encoding
+
+source <sfile>:p:h/menu_it_it.latin1.vim
diff --git a/runtime/lang/menu_italian_italy.1252.vim b/runtime/lang/menu_italian_italy.1252.vim
new file mode 100644
index 000000000..b336fcb2a
--- /dev/null
+++ b/runtime/lang/menu_italian_italy.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Italian for Latin1
+
+source <sfile>:p:h/menu_it_it.latin1.vim
diff --git a/runtime/lang/menu_ja.cp932.vim b/runtime/lang/menu_ja.cp932.vim
new file mode 100644
index 000000000..c761b0811
--- /dev/null
+++ b/runtime/lang/menu_ja.cp932.vim
@@ -0,0 +1,5 @@
+" Menu Translations: Japanese (for Windows)
+" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change: 29-Apr-2004.
+
+source <sfile>:p:h/menu_japanese_japan.932.vim
diff --git a/runtime/lang/menu_ja.utf-8.vim b/runtime/lang/menu_ja.utf-8.vim
new file mode 100644
index 000000000..105a19941
--- /dev/null
+++ b/runtime/lang/menu_ja.utf-8.vim
@@ -0,0 +1,4 @@
+" Menu Translations: Japanese
+
+" eucjp is the same as euc-jp. Source the other one from here.
+source <sfile>:p:h/menu_ja_jp.utf-8.vim
diff --git a/runtime/lang/menu_ja_jp.cp932.vim b/runtime/lang/menu_ja_jp.cp932.vim
new file mode 100644
index 000000000..c761b0811
--- /dev/null
+++ b/runtime/lang/menu_ja_jp.cp932.vim
@@ -0,0 +1,5 @@
+" Menu Translations: Japanese (for Windows)
+" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change: 29-Apr-2004.
+
+source <sfile>:p:h/menu_japanese_japan.932.vim
diff --git a/runtime/lang/menu_ja_jp.euc-jp.vim b/runtime/lang/menu_ja_jp.euc-jp.vim
new file mode 100644
index 000000000..06be3ff42
--- /dev/null
+++ b/runtime/lang/menu_ja_jp.euc-jp.vim
@@ -0,0 +1,315 @@
+" vi:set ts=8 sts=8 sw=8 tw=0:
+"
+" Menu Translations: Japanese (EUC-JP)
+" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change: 29-Apr-2004.
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding euc-jp
+
+" Help menu
+menutrans &Help ¥Ø¥ë¥×(&H)
+menutrans &Overview<Tab><F1> ³µÎ¬(&O)<Tab><F1>
+menutrans &User\ Manual ¥æ¡¼¥¶¥Þ¥Ë¥å¥¢¥ë(&U)
+menutrans &How-to\ links &How-to¥ê¥ó¥¯
+menutrans &Credits ¥¯¥ì¥¸¥Ã¥È(&C)
+menutrans Co&pying Ãøºî¸¢¾ðÊó(&P)
+menutrans &Sponsor/Register ¥¹¥Ý¥ó¥µ¡¼/ÅÐÏ¿(&S)
+menutrans O&rphans ¸É»ù(&R)
+menutrans &Version ¥Ð¡¼¥¸¥ç¥ó¾ðÊó(&V)
+menutrans &About Vim¤Ë¤Ä¤¤¤Æ(&A)
+
+let g:menutrans_help_dialog = "¥Ø¥ë¥×¤ò¸¡º÷¤·¤¿¤¤¥³¥Þ¥ó¥É¤â¤·¤¯¤Ïñ¸ì¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:\n\nÁÞÆþ¥â¡¼¥É¤Î¥³¥Þ¥ó¥É¤Ë¤Ï i_ ¤òÀèƬ¤ËÉղä·¤Þ¤¹. (Îã: i_CTRL-X)\n¥³¥Þ¥ó¥É¥é¥¤¥óÊÔ½¸¥³¥Þ¥ó¥É¤Ë¤Ï c_ ¤òÀèƬ¤ËÉղä·¤Þ¤¹. (Îã: c_<Del>)\n¥ª¥×¥·¥ç¥ó¤Î̾Á°¤Ë¤Ï ' ¤òÉղä·¤Þ¤¹. (Îã: 'shiftwidth')"
+
+" File menu
+menutrans &File ¥Õ¥¡¥¤¥ë(&F)
+menutrans &Open\.\.\.<Tab>:e ³«¤¯(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ʬ³ä¤·¤Æ³«¤¯(&L)\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew ¿·µ¬ºîÀ®(&N)<Tab>:enew
+menutrans &Close<Tab>:close ÊĤ¸¤ë(&C)<Tab>:close
+menutrans &Save<Tab>:w Êݸ(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav ̾Á°¤òÉÕ¤±¤ÆÊݸ(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. º¹Ê¬É½¼¨(&D)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. ¥Ñ¥Ã¥Á·ë²Ì¤òɽ¼¨(&B)\.\.\.
+menutrans &Print °õºþ(&P)
+menutrans Sa&ve-Exit<Tab>:wqa Êݸ¤·¤Æ½ªÎ»(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa ½ªÎ»(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit ÊÔ½¸(&E)
+menutrans &Undo<Tab>u ¼è¤ê¾Ã¤¹(&U)<Tab>u
+menutrans &Redo<Tab>^R ¤â¤¦°ìÅÙ¤ä¤ë(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. ·«¤êÊÖ¤¹(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x ÀÚ¤ê¼è¤ê(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y ¥³¥Ô¡¼(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP Ž¤êÉÕ¤±(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Á°¤ËŽ¤ë(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p ¸å¤ËŽ¤ë(&A)<Tab>]p
+menutrans &Delete<Tab>x ¾Ã¤¹(&D)<Tab>x
+menutrans &Select\ All<Tab>ggVG Á´¤ÆÁªÂò(&S)<Tab>ggvG
+menutrans &Find\.\.\. ¸¡º÷(&F)\.\.\.
+menutrans &Find<Tab>/ ¸¡º÷(&F)<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. ÃÖ´¹(&L)\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s ÃÖ´¹(&L)<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s ÃÖ´¹(&L)<Tab>:s
+"menutrans Options\.\.\. ¥ª¥×¥·¥ç¥ó(&O)\.\.\.
+menutrans Settings\ &Window ÀßÄꥦ¥£¥ó¥É¥¦(&W)
+
+" Edit/Global Settings
+menutrans &Global\ Settings Á´ÂÎÀßÄê(&G)
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls!
+ \ ¥Ñ¥¿¡¼¥ó¶¯Ä´ÀÚÂØ(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic!
+ \ Â羮ʸ»ú¶èÊÌÀÚÂØ(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm!
+ \ ¥Þ¥Ã¥Áɽ¼¨ÀÚÂØ(&S)<Tab>:set\ sm!
+menutrans &Context\ lines ¥«¡¼¥½¥ë¼þÊÕ¹Ô¿ô(&C)
+menutrans &Virtual\ Edit ²¾ÁÛÊÔ½¸(&V)
+menutrans Never ̵¸ú
+menutrans Block\ Selection ¥Ö¥í¥Ã¥¯ÁªÂò»þ
+menutrans Insert\ mode ÁÞÆþ¥â¡¼¥É»þ
+menutrans Block\ and\ Insert ¥Ö¥í¥Ã¥¯/ÁÞÆþ¥â¡¼¥É»þ
+menutrans Always ¾ï»þ
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im!
+ \ ÁÞÆþ(½é¿´¼Ô)¥â¡¼¥ÉÀÚÂØ(&M)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp!
+ \ Vi¸ß´¹¥â¡¼¥ÉÀÚÂØ(&O)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. ¸¡º÷¥Ñ¥¹(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. ¥¿¥°¥Õ¥¡¥¤¥ë(&G)\.\.\.
+"
+" GUI options
+menutrans Toggle\ &Toolbar ¥Ä¡¼¥ë¥Ð¡¼É½¼¨ÀÚÂØ(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ¥¹¥¯¥í¡¼¥ë¥Ð¡¼(²¼)ɽ¼¨ÀÚÂØ(&B)
+menutrans Toggle\ &Left\ Scrollbar ¥¹¥¯¥í¡¼¥ë¥Ð¡¼(º¸)ɽ¼¨ÀÚÂØ(&L)
+menutrans Toggle\ &Right\ Scrollbar ¥¹¥¯¥í¡¼¥ë¥Ð¡¼(±¦)ɽ¼¨ÀÚÂØ(&R)
+
+let g:menutrans_path_dialog = "¥Õ¥¡¥¤¥ë¤Î¸¡º÷¥Ñ¥¹¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:\n¥Ç¥£¥ì¥¯¥È¥ê̾¤Ï¥«¥ó¥Þ ( , ) ¤Ç¶èÀڤäƤ¯¤À¤µ¤¤."
+let g:menutrans_tags_dialog = "¥¿¥°¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:\n̾Á°¤Ï¥«¥ó¥Þ ( , ) ¤Ç¶èÀڤäƤ¯¤À¤µ¤¤."
+
+" Edit/File Settings
+
+" Boolean options
+menutrans F&ile\ Settings ¥Õ¥¡¥¤¥ëÀßÄê(&I)
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!
+ \ ¹ÔÈÖ¹æɽ¼¨ÀÚÂØ(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list!
+ \ ¥ê¥¹¥È¥â¡¼¥ÉÀÚÂØ(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!
+ \ ¹ÔÀÞÊÖ¤·ÀÚÂØ(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!
+ \ ñ¸ìÀÞÊÖ¤·ÀÚÂØ(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et!
+ \ ¥¿¥ÖŸ³«ÀÚÂØ(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai!
+ \ ¼«Æ°»ú²¼¤²ÀÚÂØ(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin!
+ \ C¸À¸ì»ú²¼¤²ÀÚÂØ(&C)<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth ¥·¥Õ¥ÈÉý(&S)
+menutrans Soft\ &Tabstop ¥½¥Õ¥È¥¦¥§¥¢¥¿¥ÖÉý(&T)
+menutrans Te&xt\ Width\.\.\. ¥Æ¥­¥¹¥ÈÉý(&X)\.\.\.
+menutrans &File\ Format\.\.\. ²þ¹Ôµ­¹æÁªÂò(&F)\.\.\.
+
+let g:menutrans_textwidth_dialog = "¥Æ¥­¥¹¥È¤ÎÉý('textwidth')¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤ (0¤ÇÀ°·Á¤ò̵¸ú²½):"
+let g:menutrans_fileformat_dialog = "¥Õ¥¡¥¤¥ë½ÐÎϤκݤβþ¹Ôµ­¹æ¤Î·Á¼°¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤."
+let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n¥­¥ã¥ó¥»¥ë(&C)"
+
+menutrans C&olor\ Scheme ¿§¥Æ¡¼¥ÞÁªÂò(&O)
+menutrans &Keymap ¥­¡¼¥Þ¥Ã¥×(&K)
+menutrans None ¤Ê¤·
+
+" Programming menu
+menutrans &Tools ¥Ä¡¼¥ë(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ¥¿¥°¥¸¥ã¥ó¥×(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T Ìá¤ë(&B)<Tab>^T
+menutrans Build\ &Tags\ File ¥¿¥°¥Õ¥¡¥¤¥ëºîÀ®(&T)
+menutrans &Make<Tab>:make ¥á¥¤¥¯(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl ¥¨¥é¡¼¥ê¥¹¥È(&L)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ¥á¥Ã¥»¡¼¥¸¥ê¥¹¥È(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ¼¡¤Î¥¨¥é¡¼¤Ø(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Á°¤Î¥¨¥é¡¼¤Ø(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold ¸Å¤¤¥ê¥¹¥È(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew ¿·¤·¤¤¥ê¥¹¥È(&E)<Tab>:cnew
+menutrans Error\ &Window ¥¨¥é¡¼¥¦¥£¥ó¥É¥¦(&W)
+menutrans &Update<Tab>:cwin ¹¹¿·(&U)<Tab>:cwin
+menutrans &Open<Tab>:copen ³«¤¯(&O)<Tab>:copen
+menutrans &Close<Tab>:cclose ÊĤ¸¤ë(&C)<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX¤ØÊÑ´¹(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX¤«¤éµÕÊÑ´¹(&R)<Tab>%!xxd\ -r
+menutrans &Set\ Compiler ¥³¥ó¥Ñ¥¤¥éÀßÄê(&S)
+
+" Tools.Fold Menu
+menutrans &Folding ÀÞ¾ö¤ß(&F)
+" open close folds
+menutrans &Enable/Disable\ folds<Tab>zi Í­¸ú/̵¸úÀÚÂØ(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv ¥«¡¼¥½¥ë¹Ô¤òɽ¼¨(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx ¥«¡¼¥½¥ë¹Ô¤À¤±¤òɽ¼¨(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm ÀÞ¾ö¤ß¤òÊĤ¸¤ë(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Á´ÀÞ¾ö¤ß¤òÊĤ¸¤ë(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr ÀÞ¾ö¤ß¤ò³«¤¯(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Á´ÀÞ¾ö¤ß¤ò³«¤¯(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod ÀÞ¾ö¤ßÊýË¡(&H)
+menutrans M&anual ¼êÆ°(&A)
+menutrans I&ndent ¥¤¥ó¥Ç¥ó¥È(&N)
+menutrans E&xpression ¼°É¾²Á(&X)
+menutrans S&yntax ¥·¥ó¥¿¥Ã¥¯¥¹(&Y)
+menutrans &Diff º¹Ê¬(&D)
+menutrans Ma&rker ¥Þ¡¼¥«¡¼(&R)
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf ÀÞ¾ö¤ßºîÀ®(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd ÀÞ¾ö¤ßºï½ü(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Á´ÀÞ¾ö¤ßºï½ü(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width ÀÞ¾ö¤ß¥«¥é¥àÉý(&U)
+
+menutrans &Update ¹¹¿·(&U)
+menutrans &Get\ Block ¥Ö¥í¥Ã¥¯Ãê½Ð(&G)
+menutrans &Put\ Block ¥Ö¥í¥Ã¥¯Å¬ÍÑ(&P)
+
+" Names for buffer menu.
+menutrans &Buffers ¥Ð¥Ã¥Õ¥¡(&B)
+menutrans &Refresh\ menu ¥á¥Ë¥å¡¼ºÆÆɹþ(&R)
+menutrans &Delete ºï½ü(&D)
+menutrans &Alternate ΢¤ØÀÚÂØ(&A)
+menutrans &Next ¼¡¤Î¥Ð¥Ã¥Õ¥¡(&N)
+menutrans &Previous Á°¤Î¥Ð¥Ã¥Õ¥¡(&P)
+menutrans [No\ File] [̵Âê]
+let g:menutrans_no_file = "[̵Âê]"
+
+" Window menu
+menutrans &Window ¥¦¥£¥ó¥É¥¦(&W)
+menutrans &New<Tab>^Wn ¿·µ¬ºîÀ®(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws ʬ³ä(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ΢¥Ð¥Ã¥Õ¥¡¤Øʬ³ä(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ¿âľʬ³ä(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer ¥Õ¥¡¥¤¥ë¥¨¥¯¥¹¥×¥í¡¼¥é(&X)
+menutrans &Close<Tab>^Wc ÊĤ¸¤ë(&C)<Tab>^Wc
+menutrans Move\ &To °ÜÆ°(&T)
+menutrans &Top<Tab>^WK ¾å(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ ²¼(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH º¸(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL ±¦(&R)<Tab>^WL
+menutrans Close\ &Other(s)<Tab>^Wo ¾¤òÊĤ¸¤ë(&O)<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww ¼¡¤Ø(&X)<Tab>^Ww
+menutrans P&revious<Tab>^WW Á°¤Ø(&R)<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= Ʊ¤¸¹â¤µ¤Ë(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ºÇÂç¹â¤Ë(&M)<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ ºÇ¾®¹â¤Ë(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ºÇÂçÉý¤Ë(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ºÇ¾®Éý¤Ë(&H)<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR ¾å¤Ë¥í¡¼¥Æ¡¼¥·¥ç¥ó(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ²¼¤Ë¥í¡¼¥Æ¡¼¥·¥ç¥ó(&D)<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. ¥Õ¥©¥ó¥ÈÀßÄê(&N)\.\.\.
+
+" The popup menu
+menutrans &Undo ¼è¤ê¾Ã¤¹(&U)
+menutrans Cu&t ÀÚ¤ê¼è¤ê(&T)
+menutrans &Copy ¥³¥Ô¡¼(&C)
+menutrans &Paste Ž¤êÉÕ¤±(&P)
+menutrans &Delete ºï½ü(&D)
+menutrans Select\ Blockwise ¶ë·Á¥Ö¥í¥Ã¥¯ÁªÂò
+menutrans Select\ &Word ñ¸ìÁªÂò(&W)
+menutrans Select\ &Line ¹ÔÁªÂò(&L)
+menutrans Select\ &Block ¥Ö¥í¥Ã¥¯ÁªÂò(&B)
+menutrans Select\ &All ¤¹¤Ù¤ÆÁªÂò(&A)
+
+" The GUI toolbar (for Win32 or GTK)
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ¥Õ¥¡¥¤¥ë¤ò³«¤¯
+ tmenu ToolBar.Save ¸½ºß¤Î¥Õ¥¡¥¤¥ë¤òÊݸ
+ tmenu ToolBar.SaveAll ¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¤òÊݸ
+ tmenu ToolBar.Print °õºþ
+ tmenu ToolBar.Undo ¼è¤ê¾Ã¤·
+ tmenu ToolBar.Redo ¤â¤¦°ìÅÙ¤ä¤ë
+ tmenu ToolBar.Cut ¥¯¥ê¥Ã¥×¥Ü¡¼¥É¤ØÀÚ¤ê¼è¤ê
+ tmenu ToolBar.Copy ¥¯¥ê¥Ã¥×¥Ü¡¼¥É¤Ø¥³¥Ô¡¼
+ tmenu ToolBar.Paste ¥¯¥ê¥Ã¥×¥Ü¡¼¥É¤«¤éŽ¤êÉÕ¤±
+ tmenu ToolBar.Find ¸¡º÷...
+ tmenu ToolBar.FindNext ¼¡¤ò¸¡º÷
+ tmenu ToolBar.FindPrev Á°¤ò¸¡º÷
+ tmenu ToolBar.Replace ÃÖ´¹...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New ¿·µ¬¥¦¥£¥ó¥É¥¦ºîÀ®
+ tmenu ToolBar.WinSplit ¥¦¥£¥ó¥É¥¦Ê¬³ä
+ tmenu ToolBar.WinMax ¥¦¥£¥ó¥É¥¦ºÇÂç²½
+ tmenu ToolBar.WinMin ¥¦¥£¥ó¥É¥¦ºÇ¾®²½
+ tmenu ToolBar.WinClose ¥¦¥£¥ó¥É¥¦¤òÊĤ¸¤ë
+ endif
+ tmenu ToolBar.LoadSesn ¥»¥Ã¥·¥ç¥óÆɹþ
+ tmenu ToolBar.SaveSesn ¥»¥Ã¥·¥ç¥óÊݸ
+ tmenu ToolBar.RunScript Vim¥¹¥¯¥ê¥×¥È¼Â¹Ô
+ tmenu ToolBar.Make ¥×¥í¥¸¥§¥¯¥È¤òMake
+ tmenu ToolBar.Shell ¥·¥§¥ë¤ò³«¤¯
+ tmenu ToolBar.RunCtags tagsºîÀ®
+ tmenu ToolBar.TagJump ¥¿¥°¥¸¥ã¥ó¥×
+ tmenu ToolBar.Help Vim¥Ø¥ë¥×
+ tmenu ToolBar.FindHelp Vim¥Ø¥ë¥×¸¡º÷
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax ¥·¥ó¥¿¥Ã¥¯¥¹(&S)
+menutrans &Show\ filetypes\ in\ menu Âбþ·Á¼°¤ò¥á¥Ë¥å¡¼¤Ëɽ¼¨(&S)
+menutrans Set\ '&syntax'\ only 'syntax'¤À¤±ÀßÄê(&S)
+menutrans Set\ '&filetype'\ too 'filetype'¤âÀßÄê(&F)
+menutrans &Off ̵¸ú²½(&O)
+menutrans &Manual ¼êÆ°ÀßÄê(&M)
+menutrans A&utomatic ¼«Æ°ÀßÄê(&U)
+menutrans on/off\ for\ &This\ file
+ \ ¥ª¥ó/¥ª¥ÕÀÚÂØ(&T)
+menutrans Co&lor\ test ¥«¥é¡¼¥Æ¥¹¥È(&L)
+menutrans &Highlight\ test ¥Ï¥¤¥é¥¤¥È¥Æ¥¹¥È(&H)
+menutrans &Convert\ to\ HTML HTML¤Ø¥³¥ó¥Ð¡¼¥È(&C)
+
+" Japanese specific menu
+" À®ÈݤÏiconv¼¡Â衢ɬ¤º¤·¤â»ØÄꤷ¤¿¥¨¥ó¥³¡¼¥É¤Ë¤Ê¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ
+if has('iconv')
+ " iconv¤Î¥Ð¡¼¥¸¥ç¥óȽÄê
+ let support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
+ "
+ " Æɤ߹þ¤ß
+ an 10.395 ¥Õ¥¡¥¤¥ë(&F).-SEPICONV- <Nop>
+ an 10.396.100.100 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.100.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
+ an 10.396.100.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.100.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
+ an 10.396.100.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.100.130 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..³«¤¯(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
+
+ " ºÆÆɹþ
+ an 10.396.110.100 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.110.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
+ an 10.396.110.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.110.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
+ an 10.396.110.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.110.130 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..ºÆÆɹþ(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
+
+ " Êݸ
+ an 10.396.115 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..-SEP1- <Nop>
+ an 10.396.120.100 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
+ if !support_jisx0213
+ an 10.396.120.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
+ an 10.396.120.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
+ else
+ an 10.396.120.110 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
+ an 10.396.120.120 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
+ endif
+ an 10.396.120.130 ¥Õ¥¡¥¤¥ë(&F).¥¨¥ó¥³¡¼¥É»ØÄê(&E)\.\.\..Êݸ(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
+endif
diff --git a/runtime/lang/menu_ja_jp.eucjp.vim b/runtime/lang/menu_ja_jp.eucjp.vim
new file mode 100644
index 000000000..0861315eb
--- /dev/null
+++ b/runtime/lang/menu_ja_jp.eucjp.vim
@@ -0,0 +1,6 @@
+" Menu Translations: Japanese (for UNIX)
+" Translated By: Muraoka Taro <koron@tka.att.ne.jp>
+" Last Change: 08:50:47 25-Mar-2001.
+
+" eucjp is the same as euc-jp. Source the other one from here.
+source <sfile>:p:h/menu_ja_jp.euc-jp.vim
diff --git a/runtime/lang/menu_ja_jp.ujis.vim b/runtime/lang/menu_ja_jp.ujis.vim
new file mode 100644
index 000000000..49248fc74
--- /dev/null
+++ b/runtime/lang/menu_ja_jp.ujis.vim
@@ -0,0 +1,6 @@
+" Menu Translations: Japanese (for UNIX)
+" Translated By: Muraoka Taro <koron@tka.att.ne.jp>
+" Last Change: 08:50:47 25-Mar-2001.
+
+" ujis is the same as euc-jp. Source the other one from here.
+source <sfile>:p:h/menu_ja_jp.euc-jp.vim
diff --git a/runtime/lang/menu_ja_jp.utf-8.vim b/runtime/lang/menu_ja_jp.utf-8.vim
new file mode 100644
index 000000000..7b7f8bfeb
--- /dev/null
+++ b/runtime/lang/menu_ja_jp.utf-8.vim
@@ -0,0 +1,315 @@
+" vi:set ts=8 sts=8 sw=8 tw=0:
+"
+" Menu Translations: Japanese (UTF-8)
+" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change: 29-Apr-2004.
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+" Help menu
+menutrans &Help ヘルプ(&H)
+menutrans &Overview<Tab><F1> 概略(&O)<Tab><F1>
+menutrans &User\ Manual ユーザマニュアル(&U)
+menutrans &How-to\ links &How-toリンク
+menutrans &Credits クレジット(&C)
+menutrans Co&pying 著作権情報(&P)
+menutrans &Sponsor/Register スãƒãƒ³ã‚µãƒ¼/登録(&S)
+menutrans O&rphans å­¤å…(&R)
+menutrans &Version ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ±(&V)
+menutrans &About Vimã«ã¤ã„ã¦(&A)
+
+let g:menutrans_help_dialog = "ヘルプを検索ã—ãŸã„コマンドもã—ãã¯å˜èªžã‚’入力ã—ã¦ãã ã•ã„:\n\n挿入モードã®ã‚³ãƒžãƒ³ãƒ‰ã«ã¯ i_ を先頭ã«ä»˜åŠ ã—ã¾ã™. (例: i_CTRL-X)\nコマンドライン編集コマンドã«ã¯ c_ を先頭ã«ä»˜åŠ ã—ã¾ã™. (例: c_<Del>)\nオプションã®åå‰ã«ã¯ ' を付加ã—ã¾ã™. (例: 'shiftwidth')"
+
+" File menu
+menutrans &File ファイル(&F)
+menutrans &Open\.\.\.<Tab>:e é–‹ã(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp 分割ã—ã¦é–‹ã(&L)\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew æ–°è¦ä½œæˆ(&N)<Tab>:enew
+menutrans &Close<Tab>:close é–‰ã˜ã‚‹(&C)<Tab>:close
+menutrans &Save<Tab>:w ä¿å­˜(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav åå‰ã‚’付ã‘ã¦ä¿å­˜(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. 差分表示(&D)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. パッãƒçµæžœã‚’表示(&B)\.\.\.
+menutrans &Print å°åˆ·(&P)
+menutrans Sa&ve-Exit<Tab>:wqa ä¿å­˜ã—ã¦çµ‚了(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa 終了(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit 編集(&E)
+menutrans &Undo<Tab>u å–り消ã™(&U)<Tab>u
+menutrans &Redo<Tab>^R ã‚‚ã†ä¸€åº¦ã‚„ã‚‹(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. ç¹°ã‚Šè¿”ã™(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x 切りå–ã‚Š(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y コピー(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP 貼り付ã‘(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p å‰ã«è²¼ã‚‹(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p 後ã«è²¼ã‚‹(&A)<Tab>]p
+menutrans &Delete<Tab>x 消ã™(&D)<Tab>x
+menutrans &Select\ All<Tab>ggVG å…¨ã¦é¸æŠž(&S)<Tab>ggvG
+menutrans &Find\.\.\. 検索(&F)\.\.\.
+menutrans &Find<Tab>/ 検索(&F)<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. ç½®æ›(&L)\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s ç½®æ›(&L)<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s ç½®æ›(&L)<Tab>:s
+"menutrans Options\.\.\. オプション(&O)\.\.\.
+menutrans Settings\ &Window 設定ウィンドウ(&W)
+
+" Edit/Global Settings
+menutrans &Global\ Settings 全体設定(&G)
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls!
+ \ パターン強調切替(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic!
+ \ 大å°æ–‡å­—区別切替(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm!
+ \ マッãƒè¡¨ç¤ºåˆ‡æ›¿(&S)<Tab>:set\ sm!
+menutrans &Context\ lines カーソル周辺行数(&C)
+menutrans &Virtual\ Edit 仮想編集(&V)
+menutrans Never 無効
+menutrans Block\ Selection ブロックé¸æŠžæ™‚
+menutrans Insert\ mode 挿入モード時
+menutrans Block\ and\ Insert ブロック/挿入モード時
+menutrans Always 常時
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im!
+ \ 挿入(åˆå¿ƒè€…)モード切替(&M)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp!
+ \ Vi互æ›ãƒ¢ãƒ¼ãƒ‰åˆ‡æ›¿(&O)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. 検索パス(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. タグファイル(&G)\.\.\.
+"
+" GUI options
+menutrans Toggle\ &Toolbar ツールãƒãƒ¼è¡¨ç¤ºåˆ‡æ›¿(&T)
+menutrans Toggle\ &Bottom\ Scrollbar スクロールãƒãƒ¼(下)表示切替(&B)
+menutrans Toggle\ &Left\ Scrollbar スクロールãƒãƒ¼(å·¦)表示切替(&L)
+menutrans Toggle\ &Right\ Scrollbar スクロールãƒãƒ¼(å³)表示切替(&R)
+
+let g:menutrans_path_dialog = "ファイルã®æ¤œç´¢ãƒ‘スを入力ã—ã¦ãã ã•ã„:\nディレクトリåã¯ã‚«ãƒ³ãƒž ( , ) ã§åŒºåˆ‡ã£ã¦ãã ã•ã„."
+let g:menutrans_tags_dialog = "タグファイルã®åå‰ã‚’入力ã—ã¦ãã ã•ã„:\nåå‰ã¯ã‚«ãƒ³ãƒž ( , ) ã§åŒºåˆ‡ã£ã¦ãã ã•ã„."
+
+" Edit/File Settings
+
+" Boolean options
+menutrans F&ile\ Settings ファイル設定(&I)
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!
+ \ 行番å·è¡¨ç¤ºåˆ‡æ›¿(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list!
+ \ リストモード切替(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!
+ \ 行折返ã—切替(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!
+ \ å˜èªžæŠ˜è¿”ã—切替(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et!
+ \ タブ展開切替(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai!
+ \ 自動字下ã’切替(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin!
+ \ C言語字下ã’切替(&C)<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth シフト幅(&S)
+menutrans Soft\ &Tabstop ソフトウェアタブ幅(&T)
+menutrans Te&xt\ Width\.\.\. テキスト幅(&X)\.\.\.
+menutrans &File\ Format\.\.\. 改行記å·é¸æŠž(&F)\.\.\.
+
+let g:menutrans_textwidth_dialog = "テキストã®å¹…('textwidth')を設定ã—ã¦ãã ã•ã„ (0ã§æ•´å½¢ã‚’無効化):"
+let g:menutrans_fileformat_dialog = "ファイル出力ã®éš›ã®æ”¹è¡Œè¨˜å·ã®å½¢å¼ã‚’é¸ã‚“ã§ãã ã•ã„."
+let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\nキャンセル(&C)"
+
+menutrans C&olor\ Scheme 色テーマé¸æŠž(&O)
+menutrans &Keymap キーマップ(&K)
+menutrans None ãªã—
+
+" Programming menu
+menutrans &Tools ツール(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] タグジャンプ(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T 戻る(&B)<Tab>^T
+menutrans Build\ &Tags\ File タグファイル作æˆ(&T)
+menutrans &Make<Tab>:make メイク(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl エラーリスト(&L)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! メッセージリスト(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn 次ã®ã‚¨ãƒ©ãƒ¼ã¸(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp å‰ã®ã‚¨ãƒ©ãƒ¼ã¸(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold å¤ã„リスト(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew æ–°ã—ã„リスト(&E)<Tab>:cnew
+menutrans Error\ &Window エラーウィンドウ(&W)
+menutrans &Update<Tab>:cwin æ›´æ–°(&U)<Tab>:cwin
+menutrans &Open<Tab>:copen é–‹ã(&O)<Tab>:copen
+menutrans &Close<Tab>:cclose é–‰ã˜ã‚‹(&C)<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd HEXã¸å¤‰æ›(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEXã‹ã‚‰é€†å¤‰æ›(&R)<Tab>%!xxd\ -r
+menutrans &Set\ Compiler コンパイラ設定(&S)
+
+" Tools.Fold Menu
+menutrans &Folding 折畳ã¿(&F)
+" open close folds
+menutrans &Enable/Disable\ folds<Tab>zi 有効/無効切替(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv カーソル行を表示(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx カーソル行ã ã‘を表示(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm 折畳ã¿ã‚’é–‰ã˜ã‚‹(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM 全折畳ã¿ã‚’é–‰ã˜ã‚‹(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr 折畳ã¿ã‚’é–‹ã(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR 全折畳ã¿ã‚’é–‹ã(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod 折畳ã¿æ–¹æ³•(&H)
+menutrans M&anual 手動(&A)
+menutrans I&ndent インデント(&N)
+menutrans E&xpression å¼è©•ä¾¡(&X)
+menutrans S&yntax シンタックス(&Y)
+menutrans &Diff 差分(&D)
+menutrans Ma&rker マーカー(&R)
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf 折畳ã¿ä½œæˆ(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd 折畳ã¿å‰Šé™¤(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD 全折畳ã¿å‰Šé™¤(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width 折畳ã¿ã‚«ãƒ©ãƒ å¹…(&U)
+
+menutrans &Update æ›´æ–°(&U)
+menutrans &Get\ Block ブロック抽出(&G)
+menutrans &Put\ Block ブロックé©ç”¨(&P)
+
+" Names for buffer menu.
+menutrans &Buffers ãƒãƒƒãƒ•ã‚¡(&B)
+menutrans &Refresh\ menu メニューå†èª­è¾¼(&R)
+menutrans &Delete 削除(&D)
+menutrans &Alternate è£ã¸åˆ‡æ›¿(&A)
+menutrans &Next 次ã®ãƒãƒƒãƒ•ã‚¡(&N)
+menutrans &Previous å‰ã®ãƒãƒƒãƒ•ã‚¡(&P)
+menutrans [No\ File] [無題]
+let g:menutrans_no_file = "[無題]"
+
+" Window menu
+menutrans &Window ウィンドウ(&W)
+menutrans &New<Tab>^Wn æ–°è¦ä½œæˆ(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws 分割(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ è£ãƒãƒƒãƒ•ã‚¡ã¸åˆ†å‰²(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv 垂直分割(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer ファイルエクスプローラ(&X)
+menutrans &Close<Tab>^Wc é–‰ã˜ã‚‹(&C)<Tab>^Wc
+menutrans Move\ &To 移動(&T)
+menutrans &Top<Tab>^WK 上(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ 下(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH å·¦(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL å³(&R)<Tab>^WL
+menutrans Close\ &Other(s)<Tab>^Wo ä»–ã‚’é–‰ã˜ã‚‹(&O)<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww 次ã¸(&X)<Tab>^Ww
+menutrans P&revious<Tab>^WW å‰ã¸(&R)<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= åŒã˜é«˜ã•ã«(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ 最大高ã«(&M)<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ 最å°é«˜ã«(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| 最大幅ã«(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| 最å°å¹…ã«(&H)<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR 上ã«ãƒ­ãƒ¼ãƒ†ãƒ¼ã‚·ãƒ§ãƒ³(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr 下ã«ãƒ­ãƒ¼ãƒ†ãƒ¼ã‚·ãƒ§ãƒ³(&D)<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. フォント設定(&N)\.\.\.
+
+" The popup menu
+menutrans &Undo å–り消ã™(&U)
+menutrans Cu&t 切りå–ã‚Š(&T)
+menutrans &Copy コピー(&C)
+menutrans &Paste 貼り付ã‘(&P)
+menutrans &Delete 削除(&D)
+menutrans Select\ Blockwise 矩形ブロックé¸æŠž
+menutrans Select\ &Word å˜èªžé¸æŠž(&W)
+menutrans Select\ &Line è¡Œé¸æŠž(&L)
+menutrans Select\ &Block ブロックé¸æŠž(&B)
+menutrans Select\ &All ã™ã¹ã¦é¸æŠž(&A)
+
+" The GUI toolbar (for Win32 or GTK)
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ファイルを開ã
+ tmenu ToolBar.Save ç¾åœ¨ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ä¿å­˜
+ tmenu ToolBar.SaveAll ã™ã¹ã¦ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ä¿å­˜
+ tmenu ToolBar.Print å°åˆ·
+ tmenu ToolBar.Undo å–り消ã—
+ tmenu ToolBar.Redo ã‚‚ã†ä¸€åº¦ã‚„ã‚‹
+ tmenu ToolBar.Cut クリップボードã¸åˆ‡ã‚Šå–ã‚Š
+ tmenu ToolBar.Copy クリップボードã¸ã‚³ãƒ”ー
+ tmenu ToolBar.Paste クリップボードã‹ã‚‰è²¼ã‚Šä»˜ã‘
+ tmenu ToolBar.Find 検索...
+ tmenu ToolBar.FindNext 次を検索
+ tmenu ToolBar.FindPrev å‰ã‚’検索
+ tmenu ToolBar.Replace ç½®æ›...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New æ–°è¦ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ä½œæˆ
+ tmenu ToolBar.WinSplit ウィンドウ分割
+ tmenu ToolBar.WinMax ウィンドウ最大化
+ tmenu ToolBar.WinMin ウィンドウ最å°åŒ–
+ tmenu ToolBar.WinClose ウィンドウを閉ã˜ã‚‹
+ endif
+ tmenu ToolBar.LoadSesn セッション読込
+ tmenu ToolBar.SaveSesn セッションä¿å­˜
+ tmenu ToolBar.RunScript Vimスクリプト実行
+ tmenu ToolBar.Make プロジェクトをMake
+ tmenu ToolBar.Shell シェルを開ã
+ tmenu ToolBar.RunCtags tags作æˆ
+ tmenu ToolBar.TagJump タグジャンプ
+ tmenu ToolBar.Help Vimヘルプ
+ tmenu ToolBar.FindHelp Vimヘルプ検索
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax シンタックス(&S)
+menutrans &Show\ filetypes\ in\ menu 対応形å¼ã‚’メニューã«è¡¨ç¤º(&S)
+menutrans Set\ '&syntax'\ only 'syntax'ã ã‘設定(&S)
+menutrans Set\ '&filetype'\ too 'filetype'も設定(&F)
+menutrans &Off 無効化(&O)
+menutrans &Manual 手動設定(&M)
+menutrans A&utomatic 自動設定(&U)
+menutrans on/off\ for\ &This\ file
+ \ オン/オフ切替(&T)
+menutrans Co&lor\ test カラーテスト(&L)
+menutrans &Highlight\ test ãƒã‚¤ãƒ©ã‚¤ãƒˆãƒ†ã‚¹ãƒˆ(&H)
+menutrans &Convert\ to\ HTML HTMLã¸ã‚³ãƒ³ãƒãƒ¼ãƒˆ(&C)
+
+" Japanese specific menu
+" æˆå¦ã¯iconv次第ã€å¿…ãšã—も指定ã—ãŸã‚¨ãƒ³ã‚³ãƒ¼ãƒ‰ã«ãªã‚‹ã‚ã‘ã§ã¯ãªã„ã“ã¨ã«æ³¨æ„
+if has('iconv')
+ " iconvã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³åˆ¤å®š
+ let support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
+ "
+ " 読ã¿è¾¼ã¿
+ an 10.395 ファイル(&F).-SEPICONV- <Nop>
+ an 10.396.100.100 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.100.110 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
+ an 10.396.100.120 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.100.110 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
+ an 10.396.100.120 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.100.130 ファイル(&F).エンコード指定(&E)\.\.\..é–‹ã(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
+
+ " å†èª­è¾¼
+ an 10.396.110.100 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.110.110 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
+ an 10.396.110.120 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.110.110 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
+ an 10.396.110.120 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.110.130 ファイル(&F).エンコード指定(&E)\.\.\..å†èª­è¾¼(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
+
+ " ä¿å­˜
+ an 10.396.115 ファイル(&F).エンコード指定(&E)\.\.\..-SEP1- <Nop>
+ an 10.396.120.100 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
+ if !support_jisx0213
+ an 10.396.120.110 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
+ an 10.396.120.120 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
+ else
+ an 10.396.120.110 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
+ an 10.396.120.120 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
+ endif
+ an 10.396.120.130 ファイル(&F).エンコード指定(&E)\.\.\..ä¿å­˜(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
+endif
diff --git a/runtime/lang/menu_japanese_japan.932.vim b/runtime/lang/menu_japanese_japan.932.vim
new file mode 100644
index 000000000..3fa21b6a5
--- /dev/null
+++ b/runtime/lang/menu_japanese_japan.932.vim
@@ -0,0 +1,315 @@
+" vi:set ts=8 sts=8 sw=8 tw=0:
+"
+" Menu Translations: Japanese (CP932)
+" Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
+" Last Change: 29-Apr-2004.
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding cp932
+
+" Help menu
+menutrans &Help ƒwƒ‹ƒv(&H)
+menutrans &Overview<Tab><F1> ŠT—ª(&O)<Tab><F1>
+menutrans &User\ Manual ƒ†[ƒUƒ}ƒjƒ…ƒAƒ‹(&U)
+menutrans &How-to\ links &How-toƒŠƒ“ƒN
+menutrans &Credits ƒNƒŒƒWƒbƒg(&C)
+menutrans Co&pying ’˜ìŒ î•ñ(&P)
+menutrans &Sponsor/Register ƒXƒ|ƒ“ƒT[/“o˜^(&S)
+menutrans O&rphans ŒÇŽ™(&R)
+menutrans &Version ƒo[ƒWƒ‡ƒ“î•ñ(&V)
+menutrans &About Vim‚ɂ‚¢‚Ä(&A)
+
+let g:menutrans_help_dialog = "ƒwƒ‹ƒv‚ðŒŸõ‚µ‚½‚¢ƒRƒ}ƒ“ƒh‚à‚µ‚­‚Í’PŒê‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:\n\n‘}“üƒ‚[ƒh‚̃Rƒ}ƒ“ƒh‚É‚Í i_ ‚ð擪‚É•t‰Á‚µ‚Ü‚·. (—á: i_CTRL-X)\nƒRƒ}ƒ“ƒhƒ‰ƒCƒ“•ÒWƒRƒ}ƒ“ƒh‚É‚Í c_ ‚ð擪‚É•t‰Á‚µ‚Ü‚·. (—á: c_<Del>)\nƒIƒvƒVƒ‡ƒ“‚Ì–¼‘O‚É‚Í ' ‚ð•t‰Á‚µ‚Ü‚·. (—á: 'shiftwidth')"
+
+" File menu
+menutrans &File ƒtƒ@ƒCƒ‹(&F)
+menutrans &Open\.\.\.<Tab>:e ŠJ‚­(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp •ªŠ„‚µ‚ÄŠJ‚­(&L)\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew V‹Kì¬(&N)<Tab>:enew
+menutrans &Close<Tab>:close •Â‚¶‚é(&C)<Tab>:close
+menutrans &Save<Tab>:w •Û‘¶(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav –¼‘O‚ð•t‚¯‚Ä•Û‘¶(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. ·•ª•\Ž¦(&D)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. ƒpƒbƒ`Œ‹‰Ê‚ð•\Ž¦(&B)\.\.\.
+menutrans &Print ˆóü(&P)
+menutrans Sa&ve-Exit<Tab>:wqa •Û‘¶‚µ‚ÄI—¹(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa I—¹(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit •ÒW(&E)
+menutrans &Undo<Tab>u Žæ‚èÁ‚·(&U)<Tab>u
+menutrans &Redo<Tab>^R ‚à‚¤ˆê“x‚â‚é(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. ŒJ‚è•Ô‚·(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x Ø‚èŽæ‚è(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y ƒRƒs[(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP “\‚è•t‚¯(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ‘O‚É“\‚é(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p Œã‚É“\‚é(&A)<Tab>]p
+menutrans &Delete<Tab>x Á‚·(&D)<Tab>x
+menutrans &Select\ All<Tab>ggVG ‘S‚Ä‘I‘ð(&S)<Tab>ggvG
+menutrans &Find\.\.\. ŒŸõ(&F)\.\.\.
+menutrans &Find<Tab>/ ŒŸõ(&F)<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. ’uŠ·(&L)\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s ’uŠ·(&L)<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s ’uŠ·(&L)<Tab>:s
+"menutrans Options\.\.\. ƒIƒvƒVƒ‡ƒ“(&O)\.\.\.
+menutrans Settings\ &Window Ý’èƒEƒBƒ“ƒhƒE(&W)
+
+" Edit/Global Settings
+menutrans &Global\ Settings ‘S‘ÌÝ’è(&G)
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls!
+ \ ƒpƒ^[ƒ“‹­’²Ø‘Ö(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic!
+ \ ‘嬕¶Žš‹æ•ÊØ‘Ö(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm!
+ \ ƒ}ƒbƒ`•\Ž¦Ø‘Ö(&S)<Tab>:set\ sm!
+menutrans &Context\ lines ƒJ[ƒ\ƒ‹Žü•Ós”(&C)
+menutrans &Virtual\ Edit ‰¼‘z•ÒW(&V)
+menutrans Never –³Œø
+menutrans Block\ Selection ƒuƒƒbƒN‘I‘ðŽž
+menutrans Insert\ mode ‘}“üƒ‚[ƒhŽž
+menutrans Block\ and\ Insert ƒuƒƒbƒN/‘}“üƒ‚[ƒhŽž
+menutrans Always 펞
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im!
+ \ ‘}“ü(‰SŽÒ)ƒ‚[ƒhØ‘Ö(&M)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp!
+ \ ViŒÝŠ·ƒ‚[ƒhØ‘Ö(&O)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. ŒŸõƒpƒX(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. ƒ^ƒOƒtƒ@ƒCƒ‹(&G)\.\.\.
+"
+" GUI options
+menutrans Toggle\ &Toolbar ƒc[ƒ‹ƒo[•\Ž¦Ø‘Ö(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ƒXƒNƒ[ƒ‹ƒo[(‰º)•\Ž¦Ø‘Ö(&B)
+menutrans Toggle\ &Left\ Scrollbar ƒXƒNƒ[ƒ‹ƒo[(¶)•\Ž¦Ø‘Ö(&L)
+menutrans Toggle\ &Right\ Scrollbar ƒXƒNƒ[ƒ‹ƒo[(‰E)•\Ž¦Ø‘Ö(&R)
+
+let g:menutrans_path_dialog = "ƒtƒ@ƒCƒ‹‚ÌŒŸõƒpƒX‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:\nƒfƒBƒŒƒNƒgƒŠ–¼‚̓Jƒ“ƒ} ( , ) ‚Å‹æØ‚Á‚Ä‚­‚¾‚³‚¢."
+let g:menutrans_tags_dialog = "ƒ^ƒOƒtƒ@ƒCƒ‹‚Ì–¼‘O‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢:\n–¼‘O‚̓Jƒ“ƒ} ( , ) ‚Å‹æØ‚Á‚Ä‚­‚¾‚³‚¢."
+
+" Edit/File Settings
+
+" Boolean options
+menutrans F&ile\ Settings ƒtƒ@ƒCƒ‹Ý’è(&I)
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!
+ \ s”Ô†•\Ž¦Ø‘Ö(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list!
+ \ ƒŠƒXƒgƒ‚[ƒhØ‘Ö(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!
+ \ sÜ•Ô‚µØ‘Ö(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!
+ \ ’PŒêÜ•Ô‚µØ‘Ö(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et!
+ \ ƒ^ƒu“WŠJØ‘Ö(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai!
+ \ Ž©“®Žš‰º‚°Ø‘Ö(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin!
+ \ CŒ¾ŒêŽš‰º‚°Ø‘Ö(&C)<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth ƒVƒtƒg•(&S)
+menutrans Soft\ &Tabstop ƒ\ƒtƒgƒEƒFƒAƒ^ƒu•(&T)
+menutrans Te&xt\ Width\.\.\. ƒeƒLƒXƒg•(&X)\.\.\.
+menutrans &File\ Format\.\.\. ‰üs‹L†‘I‘ð(&F)\.\.\.
+
+let g:menutrans_textwidth_dialog = "ƒeƒLƒXƒg‚Ì•('textwidth')‚ðݒ肵‚Ä‚­‚¾‚³‚¢ (0‚Å®Œ`‚𖳌ø‰»):"
+let g:menutrans_fileformat_dialog = "ƒtƒ@ƒCƒ‹o—Í‚Ìۂ̉üs‹L†‚ÌŒ`Ž®‚ð‘I‚ñ‚Å‚­‚¾‚³‚¢."
+let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\nƒLƒƒƒ“ƒZƒ‹(&C)"
+
+menutrans C&olor\ Scheme Fƒe[ƒ}‘I‘ð(&O)
+menutrans &Keymap ƒL[ƒ}ƒbƒv(&K)
+menutrans None ‚È‚µ
+
+" Programming menu
+menutrans &Tools ƒc[ƒ‹(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ƒ^ƒOƒWƒƒƒ“ƒv(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T –ß‚é(&B)<Tab>^T
+menutrans Build\ &Tags\ File ƒ^ƒOƒtƒ@ƒCƒ‹ì¬(&T)
+menutrans &Make<Tab>:make ƒƒCƒN(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl ƒGƒ‰[ƒŠƒXƒg(&L)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ƒƒbƒZ[ƒWƒŠƒXƒg(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ŽŸ‚̃Gƒ‰[‚Ö(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ‘O‚̃Gƒ‰[‚Ö(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold ŒÃ‚¢ƒŠƒXƒg(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew V‚µ‚¢ƒŠƒXƒg(&E)<Tab>:cnew
+menutrans Error\ &Window ƒGƒ‰[ƒEƒBƒ“ƒhƒE(&W)
+menutrans &Update<Tab>:cwin XV(&U)<Tab>:cwin
+menutrans &Open<Tab>:copen ŠJ‚­(&O)<Tab>:copen
+menutrans &Close<Tab>:cclose •Â‚¶‚é(&C)<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX‚Ö•ÏŠ·(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX‚©‚ç‹t•ÏŠ·(&R)<Tab>%!xxd\ -r
+menutrans &Set\ Compiler ƒRƒ“ƒpƒCƒ‰Ý’è(&S)
+
+" Tools.Fold Menu
+menutrans &Folding Üô‚Ý(&F)
+" open close folds
+menutrans &Enable/Disable\ folds<Tab>zi —LŒø/–³ŒøØ‘Ö(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv ƒJ[ƒ\ƒ‹s‚ð•\Ž¦(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx ƒJ[ƒ\ƒ‹s‚¾‚¯‚ð•\Ž¦(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Üô‚Ý‚ð•Â‚¶‚é(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM ‘SÜô‚Ý‚ð•Â‚¶‚é(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Üô‚Ý‚ðŠJ‚­(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR ‘SÜô‚Ý‚ðŠJ‚­(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod Üô‚Ý•û–@(&H)
+menutrans M&anual Žè“®(&A)
+menutrans I&ndent ƒCƒ“ƒfƒ“ƒg(&N)
+menutrans E&xpression Ž®•]‰¿(&X)
+menutrans S&yntax ƒVƒ“ƒ^ƒbƒNƒX(&Y)
+menutrans &Diff ᥻(&D)
+menutrans Ma&rker ƒ}[ƒJ[(&R)
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf Üô‚Ýì¬(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Üô‚Ýíœ(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ‘SÜô‚Ýíœ(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width Üô‚݃Jƒ‰ƒ€•(&U)
+
+menutrans &Update XV(&U)
+menutrans &Get\ Block ƒuƒƒbƒN’Šo(&G)
+menutrans &Put\ Block ƒuƒƒbƒN“K—p(&P)
+
+" Names for buffer menu.
+menutrans &Buffers ƒoƒbƒtƒ@(&B)
+menutrans &Refresh\ menu ƒƒjƒ…[Ä“Çž(&R)
+menutrans &Delete íœ(&D)
+menutrans &Alternate — ‚ÖØ‘Ö(&A)
+menutrans &Next ŽŸ‚̃oƒbƒtƒ@(&N)
+menutrans &Previous ‘O‚̃oƒbƒtƒ@(&P)
+menutrans [No\ File] [–³‘è]
+let g:menutrans_no_file = "[–³‘è]"
+
+" Window menu
+menutrans &Window ƒEƒBƒ“ƒhƒE(&W)
+menutrans &New<Tab>^Wn V‹Kì¬(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws •ªŠ„(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ — ƒoƒbƒtƒ@‚Ö•ªŠ„(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ‚’¼•ªŠ„(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer ƒtƒ@ƒCƒ‹ƒGƒNƒXƒvƒ[ƒ‰(&X)
+menutrans &Close<Tab>^Wc •Â‚¶‚é(&C)<Tab>^Wc
+menutrans Move\ &To ˆÚ“®(&T)
+menutrans &Top<Tab>^WK ã(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ ‰º(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH ¶(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL ‰E(&R)<Tab>^WL
+menutrans Close\ &Other(s)<Tab>^Wo ‘¼‚ð•Â‚¶‚é(&O)<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww ŽŸ‚Ö(&X)<Tab>^Ww
+menutrans P&revious<Tab>^WW ‘O‚Ö(&R)<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= “¯‚¶‚‚³‚É(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Å‘å‚‚É(&M)<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Ŭ‚‚É(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Å‘å•‚É(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Ŭ•‚É(&H)<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR ã‚Ƀ[ƒe[ƒVƒ‡ƒ“(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ‰º‚Ƀ[ƒe[ƒVƒ‡ƒ“(&D)<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. ƒtƒHƒ“ƒgÝ’è(&N)\.\.\.
+
+" The popup menu
+menutrans &Undo Žæ‚èÁ‚·(&U)
+menutrans Cu&t Ø‚èŽæ‚è(&T)
+menutrans &Copy ƒRƒs[(&C)
+menutrans &Paste “\‚è•t‚¯(&P)
+menutrans &Delete íœ(&D)
+menutrans Select\ Blockwise ‹éŒ`ƒuƒƒbƒN‘I‘ð
+menutrans Select\ &Word ’PŒê‘I‘ð(&W)
+menutrans Select\ &Line s‘I‘ð(&L)
+menutrans Select\ &Block ƒuƒƒbƒN‘I‘ð(&B)
+menutrans Select\ &All ‚·‚ׂđI‘ð(&A)
+
+" The GUI toolbar (for Win32 or GTK)
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ƒtƒ@ƒCƒ‹‚ðŠJ‚­
+ tmenu ToolBar.Save Œ»Ý‚̃tƒ@ƒCƒ‹‚ð•Û‘¶
+ tmenu ToolBar.SaveAll ‚·‚ׂẴtƒ@ƒCƒ‹‚ð•Û‘¶
+ tmenu ToolBar.Print ˆóü
+ tmenu ToolBar.Undo Žæ‚èÁ‚µ
+ tmenu ToolBar.Redo ‚à‚¤ˆê“x‚â‚é
+ tmenu ToolBar.Cut ƒNƒŠƒbƒvƒ{[ƒh‚ÖØ‚èŽæ‚è
+ tmenu ToolBar.Copy ƒNƒŠƒbƒvƒ{[ƒh‚ÖƒRƒs[
+ tmenu ToolBar.Paste ƒNƒŠƒbƒvƒ{[ƒh‚©‚ç“\‚è•t‚¯
+ tmenu ToolBar.Find ŒŸõ...
+ tmenu ToolBar.FindNext ŽŸ‚ðŒŸõ
+ tmenu ToolBar.FindPrev ‘O‚ðŒŸõ
+ tmenu ToolBar.Replace ’uŠ·...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New V‹KƒEƒBƒ“ƒhƒEì¬
+ tmenu ToolBar.WinSplit ƒEƒBƒ“ƒhƒE•ªŠ„
+ tmenu ToolBar.WinMax ƒEƒBƒ“ƒhƒEő剻
+ tmenu ToolBar.WinMin ƒEƒBƒ“ƒhƒEŬ‰»
+ tmenu ToolBar.WinClose ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é
+ endif
+ tmenu ToolBar.LoadSesn ƒZƒbƒVƒ‡ƒ““Çž
+ tmenu ToolBar.SaveSesn ƒZƒbƒVƒ‡ƒ“•Û‘¶
+ tmenu ToolBar.RunScript VimƒXƒNƒŠƒvƒgŽÀs
+ tmenu ToolBar.Make ƒvƒƒWƒFƒNƒg‚ðMake
+ tmenu ToolBar.Shell ƒVƒFƒ‹‚ðŠJ‚­
+ tmenu ToolBar.RunCtags tagsì¬
+ tmenu ToolBar.TagJump ƒ^ƒOƒWƒƒƒ“ƒv
+ tmenu ToolBar.Help Vimƒwƒ‹ƒv
+ tmenu ToolBar.FindHelp Vimƒwƒ‹ƒvŒŸõ
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax ƒVƒ“ƒ^ƒbƒNƒX(&S)
+menutrans &Show\ filetypes\ in\ menu ‘ΉžŒ`Ž®‚ðƒƒjƒ…[‚É•\Ž¦(&S)
+menutrans Set\ '&syntax'\ only 'syntax'‚¾‚¯Ý’è(&S)
+menutrans Set\ '&filetype'\ too 'filetype'‚àÝ’è(&F)
+menutrans &Off –³Œø‰»(&O)
+menutrans &Manual Žè“®Ý’è(&M)
+menutrans A&utomatic Ž©“®Ý’è(&U)
+menutrans on/off\ for\ &This\ file
+ \ ƒIƒ“/ƒIƒtØ‘Ö(&T)
+menutrans Co&lor\ test ƒJƒ‰[ƒeƒXƒg(&L)
+menutrans &Highlight\ test ƒnƒCƒ‰ƒCƒgƒeƒXƒg(&H)
+menutrans &Convert\ to\ HTML HTML‚ÖƒRƒ“ƒo[ƒg(&C)
+
+" Japanese specific menu
+" ¬”Û‚ÍiconvŽŸ‘æA•K‚¸‚µ‚àŽw’肵‚½ƒGƒ“ƒR[ƒh‚É‚È‚é‚킯‚Å‚Í‚È‚¢‚±‚Æ‚É’ˆÓ
+if has('iconv')
+ " iconv‚̃o[ƒWƒ‡ƒ“”»’è
+ let support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
+ "
+ " “Ç‚Ýž‚Ý
+ an 10.395 ƒtƒ@ƒCƒ‹(&F).-SEPICONV- <Nop>
+ an 10.396.100.100 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.100.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
+ an 10.396.100.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.100.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
+ an 10.396.100.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.100.130 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..ŠJ‚­(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
+
+ " Ä“Çž
+ an 10.396.110.100 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
+ if !support_jisx0213
+ an 10.396.110.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
+ an 10.396.110.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
+ else
+ an 10.396.110.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
+ an 10.396.110.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
+ endif
+ an 10.396.110.130 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..Ä“Çž(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
+
+ " •Û‘¶
+ an 10.396.115 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..-SEP1- <Nop>
+ an 10.396.120.100 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
+ if !support_jisx0213
+ an 10.396.120.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
+ an 10.396.120.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
+ else
+ an 10.396.120.110 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
+ an 10.396.120.120 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
+ endif
+ an 10.396.120.130 ƒtƒ@ƒCƒ‹(&F).ƒGƒ“ƒR[ƒhŽw’è(&E)\.\.\..•Û‘¶(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
+endif
diff --git a/runtime/lang/menu_ko.utf-8.vim b/runtime/lang/menu_ko.utf-8.vim
new file mode 100644
index 000000000..52efddcc3
--- /dev/null
+++ b/runtime/lang/menu_ko.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Korean
+
+source <sfile>:p:h/menu_ko_kr.utf-8.vim
diff --git a/runtime/lang/menu_ko_kr.euckr.vim b/runtime/lang/menu_ko_kr.euckr.vim
new file mode 100644
index 000000000..180a4987e
--- /dev/null
+++ b/runtime/lang/menu_ko_kr.euckr.vim
@@ -0,0 +1,243 @@
+" Menu Translations: Korean
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2003 Apr 25
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding euc-kr
+
+" Help menu
+menutrans &Help µµ¿ò¸»(&H)
+menutrans &Overview<Tab><F1> °³°ü(&O)<Tab><F1>
+menutrans &User\ Manual »ç¿ëÀÚ\ ¸Å´º¾ó(&U)
+menutrans &How-to\ links ¾îÂîÇϳª\ ¸ñ·Ï(&H)
+menutrans &GUI ±¸ÀÌ(&G)
+menutrans &Find\.\.\. ã±â(&F)\.\.\.
+menutrans &Credits °í¸¶¿î\ ºÐ(&C)
+menutrans Co&pying ÀúÀÛ±Ç(&p)
+menutrans O&rphans °í¾Æ(&r)
+menutrans &Version ¹öÀü(&V)
+menutrans &About ÀÌ\ ÇÁ·Î±×·¥Àº(&A)
+
+" File menu
+menutrans &File ÆÄÀÏ(&F)
+menutrans &Open\.\.\.<Tab>:e ¿­±â(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ³ª´²¼­\ ¿­±â(&l)\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew »õ·Î¿î(&N)<Tab>:enew
+menutrans &Close<Tab>:close ´Ý±â(&C)<Tab>:close
+menutrans &Save<Tab>:w ÀúÀå(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav ´Ù¸¥\ À̸§À¸·Î\ ÀúÀå(&A)\.\.\.<Tab>:sav
+"menutrans Split\ &Diff\ with\.\.\. Split\ &Diff\ with\.\.\.
+"menutrans Split\ Patched\ &By\.\.\. Split\ Patched\ &By\.\.\.
+menutrans &Print Àμâ(&P)
+menutrans Sa&ve-Exit<Tab>:wqa ÀúÀåÇÏ°í\ ³¡³»±â(&v)<Tab>:wqa
+menutrans E&xit<Tab>:qa ³¡³»±â(&x)<Tab>:qa
+
+" Edit menu
+menutrans &Edit ÆíÁý(&E)
+menutrans &Undo<Tab>u Ãë¼Ò(&U)<Tab>u
+menutrans &Redo<Tab>^R ´Ù½Ã ½ÇÇà(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. µÇÇ®ÀÌ(&e)<Tab>\.
+menutrans Cu&t<Tab>"+x ÀÚ¸£±â(&t)<Tab>"+x
+menutrans &Copy<Tab>"+y º¹»ç(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP ºÙÀ̱â(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ¾Õ¿¡\ ºÙÀ̱â(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p µÚ¿¡\ ºÙÀ̱â(&A)<Tab>]p
+menutrans &Delete<Tab>x Áö¿ì±â(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG ¸ðµÎ\ °í¸£±â(&S)<Tab>ggVG
+menutrans &Find\.\.\. ã±â(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. ã¾Æ¼­\ ¹Ù²Ù±â(&l)\.\.\.
+menutrans Settings\ &Window ¼³Á¤\ â(&W)
+
+" Edit/Global Settings
+menutrans &Global\ Settings Àü¿ª\ ¼³Á¤(&G)
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ÆÐÅÏ\ ÇÏÀ̶óÀÌÆ®\ Åä±Û(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ´ë¼Ò¹®ÀÚ\ ±¸ºÐ\ Åä±Û(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Showmatch\ Åä±Û(&S)<Tab>:set\ sm!
+menutrans &Context\ lines ÄÜÅؽºÆ®\ ÁÙ(&C)
+menutrans &Virtual\ Edit °¡»ó\ ÆíÁý(&V)
+menutrans Never »ç¿ë ¾È ÇÔ
+menutrans Block\ Selection ºí·°\ °í¸£±â
+menutrans Insert\ mode »ðÀÔ\ ¸ðµå
+menutrans Block\ and\ Insert ºí·°°ú\ »ðÀÔ
+menutrans Always Ç×»ó\ »ç¿ë
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! »ðÀÔ\ ¸ðµå\ Åä±Û(&M)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Vi\ ȣȯ\ Åä±Û(&o)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. ã±â\ °æ·Î(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. ²¿¸®Ç¥\ ÆÄÀÏ(&g)\.\.\.
+
+" GUI options
+menutrans Toggle\ &Toolbar µµ±¸¸·´ë\ Åä±Û(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ¹Ù´Ú\ ½ºÅ©·Ñ¹Ù\ Åä±Û(&B)
+menutrans Toggle\ &Left\ Scrollbar ¿ÞÂÊ\ ½ºÅ©·Ñ¹Ù\ Åä±Û(&L)
+menutrans Toggle\ &Right\ Scrollbar ¿À¸¥ÂÊ\ ½ºÅ©·Ñ¹Ù\ Åä±Û(&R)
+
+" Edit/File Settings
+menutrans F&ile\ Settings ÆÄÀÏ\ ¼³Á¤(&i)
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ÁÙ\ ¹øÈ£ºÙÀ̱â\ Åä±Û(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ¸ñ·Ï\ ¸ðµå\ Åä±Û(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ÁÙ\ Wrap\ Åä±Û(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ³¹¸»¿¡¼­\ Wrap\ Åä±Û(&r)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ÅÇ\ È®Àå\ Åä±Û(&e)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ÀÚµ¿Àε§Æ®\ Åä±Û(&a)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! C-Àε§ÆÃ\ Åä±Û(&C)<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth ½¬ÇÁÆ® ³Êºñ(&S)
+menutrans Soft\ &Tabstop ¼ÒÇÁÆ®\ ÅǽºÅé(&T)
+menutrans Te&xt\ Width\.\.\. ÅؽºÆ®\ ³Êºñ(&x)\.\.\.
+menutrans &File\ Format\.\.\. ÆÄÀÏ\ Çü½Ä(&F)\.\.\.
+menutrans C&olor\ Scheme Ä÷¯\ ½ºÅ´(&o)
+menutrans &Keymap Å°¸Ê(&K)
+
+menutrans Select\ Fo&nt\.\.\. ±Û²Ã\ °í¸£±â(&F)\.\.\.
+
+" Programming menu
+menutrans &Tools µµ±¸(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ÀÌ\ ²¿¸®Ç¥·Î\ °¡±â(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T µÚ·Î\ °¡±â(&b)<Tab>^T
+menutrans Build\ &Tags\ File ²¿¸®Ç¥\ ÆÄÀÏ\ ¸¸µé±â(&T)
+
+" Tools.Fold Menu
+menutrans &Folding Á¢±â(&F)
+" open close folds
+menutrans &Enable/Disable\ folds<Tab>zi Á¢´Â\ ±â´É\ »ç¿ë\ Åä±Û(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Ä¿¼­\ ÁÙ\ º¸±â(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ä¿¼­\ ÁÙ¸¸\ º¸±â(&w)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm ´õ\ ¸¹Àº\ Á¢±â\ ´Ý±â(&l)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Á¢Èù\ ºÎºÐ\ ¸ðµÎ\ Á¢±â(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr ´õ ¸¹Àº\ Á¢±â\ ¿­±â(&p)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Á¢Èù\ ºÎºÐ\ ¸ðµÎ\ Æì±â(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod Á¢´Â\ ¹æ¹ý(&h)
+menutrans M&anual ¼öµ¿(&a)
+menutrans I&ndent µé¿©¾²±â(&n)
+menutrans E&xpression Ç¥Çö½Ä(&x)
+menutrans S&yntax ½ÅÅýº(&y)
+"menutrans &Diff &Diff
+menutrans Ma&rker ²¿¸®Ç¥(&r)
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf »õ·Î Á¢±â(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd ¿ÏÀüÈ÷ Æì±â(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ¸ðµÎ\ Æì±â(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ column\ &width Á¢À»\ Ä­\ ³Êºñ(&w)
+
+"menutrans &Diff &Diff
+menutrans &Update °»½Å(&U)
+menutrans &Get\ Block ºí·°\ °¡Á®¿À±â(&G)
+menutrans &Put\ Block ºí·°\ Áý¾î³Ö±â(&P)
+
+menutrans &Make<Tab>:make Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl ¿¡·¯\ ¸ñ·Ï\ º¸±â(&L)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ¸Þ½ÃÁö\ ¸ñ·Ï\ º¸±â(&i)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ´ÙÀ½\ ¿¡·¯(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ÀÌÀü\ ¿¡·¯(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold ¿À·¡µÈ\ ¸ñ·Ï(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew »õ·Î¿î\ ¸ñ·Ï(&e)<Tab>:cnew
+menutrans Error\ &Window ¿¡·¯\ â(&W)
+menutrans &Update<Tab>:cwin °»½Å(&U)<Tab>:cwin
+menutrans &Open<Tab>:copen ¿­±â(&O)<Tab>:copen
+menutrans &Close<Tab>:cclose ´Ý±â(&C)<Tab>:cclose
+menutrans &Set\ Compiler ÄÄÆÄÀÏ·¯\ ¼³Á¤(&S)
+menutrans &Convert\ to\ HEX<Tab>:%!mc\ vim:xxd ½ÊÀ°ÁøÀ¸·Î\ º¯È¯<Tab>:%!mc\ vim:xxd
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ½ÊÀ°ÁøÀ¸·Î\ º¯È¯(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!mc\ vim:xxd\ -r ¿ø·¡´ë·Î\ º¯È¯(&r)<Tab>:%!mc\ vim:xxd\ -r
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ¿ø·¡´ë·Î\ º¯È¯(&r)<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers ¹öÆÛ(&B)
+menutrans &Refresh\ menu Â÷¸²Ç¥\ ´Ù½Ã±×¸®±â(&R)
+menutrans &Delete Áö¿ì±â(&D)
+menutrans &Alternate ±³Ã¼(&A)
+menutrans &Next ´ÙÀ½(&N)
+menutrans &Previous ÀÌÀü(&P)
+
+" Window menu
+menutrans &Window â(&W)
+menutrans &New<Tab>^Wn ț\ ̢(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws ³ª´©±â(&p)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ #À¸·Î\ ³ª´©±â(&l)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ¼¼·Î·Î\ ³ª´©±â(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer ÆÄÀÏ\ ÀͽºÇ÷η¯\ ³ª´©±â
+
+menutrans &Close<Tab>^Wc ´Ý±â(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo ´Ù¸¥\ â\ ´Ý±â(&O)<Tab>^Wo
+
+menutrans Move\ &To À̵¿(&T)
+menutrans &Top<Tab>^WK ²À´ë±â(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ ¹Ù´Ú(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH ¿ÞÂÊ(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL ¿À¸¥ÂÊ(&R)<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR À§·Î\ ȸÀü(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ¾Æ·¡·Î\ ȸÀü(&D)<Tab>^Wr
+
+menutrans &Equal\ Size<Tab>^W= °°Àº\ ³ôÀÌ·Î(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ÃÖ´ë\ ³ôÀÌ·Î(&M)<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ ÃÖ¼Ò\ ³ôÀÌ·Î(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ÃÖ´ë\ ³ÐÀÌ·Î(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ÃÖ¼Ò\ ³ÐÀÌ·Î(&h)<Tab>^W1\|
+
+" The popup menu
+menutrans &Undo Ãë¼Ò(&U)
+menutrans Cu&t ÀÚ¸£±â(&t)
+menutrans &Copy º¹»ç(&C)
+menutrans &Paste ºÙÀ̱â(&P)
+menutrans &Delete Áö¿ì±â(&D)
+menutrans Select\ Blockwise »ç°¢Çü\ °í¸£±â
+menutrans Select\ &Word ³¹¸»\ °í¸£±â(&W)
+menutrans Select\ &Line ÁÙ\ °í¸£±â(&L)
+menutrans Select\ &Block ±¸È¹\ °í¸£±â(&B)
+menutrans Select\ &All ¸ðµÎ\ °í¸£±â(&A)
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ÆÄÀÏ ¿­±â
+ tmenu ToolBar.Save ÇöÀç ÆÄÀÏ ÀúÀå
+ tmenu ToolBar.SaveAll ¸ðµÎ ÀúÀå
+ tmenu ToolBar.Print Àμâ
+ tmenu ToolBar.Undo Ãë¼Ò
+ tmenu ToolBar.Redo ´Ù½Ã ½ÇÇà
+ tmenu ToolBar.Cut ÀÚ¸£±â
+ tmenu ToolBar.Copy º¹»ç
+ tmenu ToolBar.Paste ºÙÀ̱â
+ tmenu ToolBar.Find ã±â...
+ tmenu ToolBar.FindNext ´ÙÀ½ ã±â
+ tmenu ToolBar.FindPrev ÀÌÀü ã±â
+ tmenu ToolBar.Replace ¹Ù²Ù±â
+ tmenu ToolBar.LoadSesn ¼¼¼Ç Àоî¿À±â
+ tmenu ToolBar.SaveSesn ¼¼¼Ç ÀúÀå
+ tmenu ToolBar.RunScript ½ºÅ©¸³Æ® ½ÇÇà
+ tmenu ToolBar.Make Make
+ tmenu ToolBar.Shell ½©
+ tmenu ToolBar.RunCtags ²¿¸®Ç¥ ¸¸µé±â
+ tmenu ToolBar.TagJump ²¿¸®Ç¥·Î °¡±â
+ tmenu ToolBar.Help µµ¿ò¸»
+ tmenu ToolBar.FindHelp µµ¿ò¸» ã±â...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax ¹®¹ý(&S)
+menutrans &Show\ individual\ choices ¸ðµç\ ¼±Åð¡´ÉÇÑ\ Ç׸ñ\ º¸±â(&S)
+menutrans Set\ '&syntax'\ only 'syntax'¸¸\ ¼³Á¤(&s)
+menutrans Set\ '&filetype'\ too 'filetype'µµ\ ¼³Á¤(&f)
+menutrans &Off ²ô±â(&O)
+menutrans &Manual ¼öµ¿(&M)
+menutrans A&utomatic ÀÚµ¿(&u)
+menutrans on/off\ for\ &This\ file ÀÌ\ ÆÄÀϸ¸\ Äѱâ/²ô±â(&T)
+
+menutrans Co&lor\ test »ö\ ½ÃÇè(&l)
+menutrans &Highlight\ test Highlight\ ½ÃÇè(&H)
+menutrans &Convert\ to\ HTML HTML·Î\ º¯È¯(&C)
+
diff --git a/runtime/lang/menu_ko_kr.utf-8.vim b/runtime/lang/menu_ko_kr.utf-8.vim
new file mode 100644
index 000000000..e08d9ba93
--- /dev/null
+++ b/runtime/lang/menu_ko_kr.utf-8.vim
@@ -0,0 +1,243 @@
+" Menu Translations: Korean
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2003 Apr 25
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+" Help menu
+menutrans &Help ë„움ë§(&H)
+menutrans &Overview<Tab><F1> 개관(&O)<Tab><F1>
+menutrans &User\ Manual 사용ìž\ 매뉴얼(&U)
+menutrans &How-to\ links 어찌하나\ 목ë¡(&H)
+menutrans &GUI 구ì´(&G)
+menutrans &Find\.\.\. 찾기(&F)\.\.\.
+menutrans &Credits 고마운\ 분(&C)
+menutrans Co&pying 저작권(&p)
+menutrans O&rphans ê³ ì•„(&r)
+menutrans &Version 버전(&V)
+menutrans &About ì´\ 프로그램ì€(&A)
+
+" File menu
+menutrans &File 파ì¼(&F)
+menutrans &Open\.\.\.<Tab>:e 열기(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp 나눠서\ 열기(&l)\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew 새로운(&N)<Tab>:enew
+menutrans &Close<Tab>:close 닫기(&C)<Tab>:close
+menutrans &Save<Tab>:w 저장(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav 다른\ ì´ë¦„으로\ 저장(&A)\.\.\.<Tab>:sav
+"menutrans Split\ &Diff\ with\.\.\. Split\ &Diff\ with\.\.\.
+"menutrans Split\ Patched\ &By\.\.\. Split\ Patched\ &By\.\.\.
+menutrans &Print ì¸ì‡„(&P)
+menutrans Sa&ve-Exit<Tab>:wqa 저장하고\ ë내기(&v)<Tab>:wqa
+menutrans E&xit<Tab>:qa ë내기(&x)<Tab>:qa
+
+" Edit menu
+menutrans &Edit 편집(&E)
+menutrans &Undo<Tab>u 취소(&U)<Tab>u
+menutrans &Redo<Tab>^R 다시 실행(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. ë˜í’€ì´(&e)<Tab>\.
+menutrans Cu&t<Tab>"+x ìžë¥´ê¸°(&t)<Tab>"+x
+menutrans &Copy<Tab>"+y 복사(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP 붙ì´ê¸°(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ì•žì—\ 붙ì´ê¸°(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p ë’¤ì—\ 붙ì´ê¸°(&A)<Tab>]p
+menutrans &Delete<Tab>x 지우기(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG 모ë‘\ 고르기(&S)<Tab>ggVG
+menutrans &Find\.\.\. 찾기(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. 찾아서\ 바꾸기(&l)\.\.\.
+menutrans Settings\ &Window 설정\ 창(&W)
+
+" Edit/Global Settings
+menutrans &Global\ Settings 전역\ 설정(&G)
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! 패턴\ 하ì´ë¼ì´íŠ¸\ 토글(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! 대소문ìž\ 구분\ 토글(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Showmatch\ 토글(&S)<Tab>:set\ sm!
+menutrans &Context\ lines 콘í…스트\ 줄(&C)
+menutrans &Virtual\ Edit ê°€ìƒ\ 편집(&V)
+menutrans Never 사용 안 함
+menutrans Block\ Selection 블럭\ 고르기
+menutrans Insert\ mode 삽입\ 모드
+menutrans Block\ and\ Insert 블럭과\ 삽입
+menutrans Always í•­ìƒ\ 사용
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! 삽입\ 모드\ 토글(&M)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Vi\ 호환\ 토글(&o)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. 찾기\ 경로(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. 꼬리표\ 파ì¼(&g)\.\.\.
+
+" GUI options
+menutrans Toggle\ &Toolbar ë„구막대\ 토글(&T)
+menutrans Toggle\ &Bottom\ Scrollbar 바닥\ 스í¬ë¡¤ë°”\ 토글(&B)
+menutrans Toggle\ &Left\ Scrollbar 왼쪽\ 스í¬ë¡¤ë°”\ 토글(&L)
+menutrans Toggle\ &Right\ Scrollbar 오른쪽\ 스í¬ë¡¤ë°”\ 토글(&R)
+
+" Edit/File Settings
+menutrans F&ile\ Settings 파ì¼\ 설정(&i)
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! 줄\ 번호붙ì´ê¸°\ 토글(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! 목ë¡\ 모드\ 토글(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! 줄\ Wrap\ 토글(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! 낱ë§ì—ì„œ\ Wrap\ 토글(&r)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! 탭\ 확장\ 토글(&e)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ìžë™ì¸ë´íŠ¸\ 토글(&a)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! C-ì¸ë´íŒ…\ 토글(&C)<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth 쉬프트 너비(&S)
+menutrans Soft\ &Tabstop 소프트\ 탭스톱(&T)
+menutrans Te&xt\ Width\.\.\. í…스트\ 너비(&x)\.\.\.
+menutrans &File\ Format\.\.\. 파ì¼\ 형ì‹(&F)\.\.\.
+menutrans C&olor\ Scheme 컬러\ 스킴(&o)
+menutrans &Keymap 키맵(&K)
+
+menutrans Select\ Fo&nt\.\.\. 글꼴\ 고르기(&F)\.\.\.
+
+" Programming menu
+menutrans &Tools ë„구(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ì´\ 꼬리표로\ 가기(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T 뒤로\ 가기(&b)<Tab>^T
+menutrans Build\ &Tags\ File 꼬리표\ 파ì¼\ 만들기(&T)
+
+" Tools.Fold Menu
+menutrans &Folding 접기(&F)
+" open close folds
+menutrans &Enable/Disable\ folds<Tab>zi 접는\ 기능\ 사용\ 토글(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv 커서\ 줄\ 보기(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx 커서\ 줄만\ 보기(&w)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm ë”\ 많ì€\ 접기\ 닫기(&l)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM 접힌\ 부분\ 모ë‘\ 접기(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr ë” ë§Žì€\ 접기\ 열기(&p)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR 접힌\ 부분\ 모ë‘\ 펴기(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod 접는\ 방법(&h)
+menutrans M&anual 수ë™(&a)
+menutrans I&ndent 들여쓰기(&n)
+menutrans E&xpression 표현ì‹(&x)
+menutrans S&yntax ì‹ íƒìŠ¤(&y)
+"menutrans &Diff &Diff
+menutrans Ma&rker 꼬리표(&r)
+" create and delete folds
+menutrans Create\ &Fold<Tab>zf 새로 접기(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd 완전히 펴기(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD 모ë‘\ 펴기(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ column\ &width ì ‘ì„\ 칸\ 너비(&w)
+
+"menutrans &Diff &Diff
+menutrans &Update 갱신(&U)
+menutrans &Get\ Block 블럭\ 가져오기(&G)
+menutrans &Put\ Block 블럭\ 집어넣기(&P)
+
+menutrans &Make<Tab>:make Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl ì—러\ 목ë¡\ 보기(&L)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! 메시지\ 목ë¡\ 보기(&i)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn 다ìŒ\ ì—러(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ì´ì „\ ì—러(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold 오래ëœ\ 목ë¡(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew 새로운\ 목ë¡(&e)<Tab>:cnew
+menutrans Error\ &Window ì—러\ ì°½(&W)
+menutrans &Update<Tab>:cwin 갱신(&U)<Tab>:cwin
+menutrans &Open<Tab>:copen 열기(&O)<Tab>:copen
+menutrans &Close<Tab>:cclose 닫기(&C)<Tab>:cclose
+menutrans &Set\ Compiler 컴파ì¼ëŸ¬\ 설정(&S)
+menutrans &Convert\ to\ HEX<Tab>:%!mc\ vim:xxd 십육진으로\ 변환<Tab>:%!mc\ vim:xxd
+menutrans &Convert\ to\ HEX<Tab>:%!xxd 십육진으로\ 변환(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!mc\ vim:xxd\ -r ì›ëž˜ëŒ€ë¡œ\ 변환(&r)<Tab>:%!mc\ vim:xxd\ -r
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ì›ëž˜ëŒ€ë¡œ\ 변환(&r)<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers 버í¼(&B)
+menutrans &Refresh\ menu 차림표\ 다시그리기(&R)
+menutrans &Delete 지우기(&D)
+menutrans &Alternate êµì²´(&A)
+menutrans &Next 다ìŒ(&N)
+menutrans &Previous ì´ì „(&P)
+
+" Window menu
+menutrans &Window ì°½(&W)
+menutrans &New<Tab>^Wn 새\ 창(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws 나누기(&p)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ #으로\ 나누기(&l)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv 세로로\ 나누기(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer 파ì¼\ ìµìŠ¤í”Œë¡œëŸ¬\ 나누기
+
+menutrans &Close<Tab>^Wc 닫기(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo 다른\ 창\ 닫기(&O)<Tab>^Wo
+
+menutrans Move\ &To ì´ë™(&T)
+menutrans &Top<Tab>^WK 꼭대기(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ 바닥(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH 왼쪽(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL 오른쪽(&R)<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR 위로\ 회전(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr 아래로\ 회전(&D)<Tab>^Wr
+
+menutrans &Equal\ Size<Tab>^W= ê°™ì€\ 높ì´ë¡œ(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ 최대\ 높ì´ë¡œ(&M)<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ 최소\ 높ì´ë¡œ(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| 최대\ ë„“ì´ë¡œ(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| 최소\ ë„“ì´ë¡œ(&h)<Tab>^W1\|
+
+" The popup menu
+menutrans &Undo 취소(&U)
+menutrans Cu&t ìžë¥´ê¸°(&t)
+menutrans &Copy 복사(&C)
+menutrans &Paste 붙ì´ê¸°(&P)
+menutrans &Delete 지우기(&D)
+menutrans Select\ Blockwise 사ê°í˜•\ 고르기
+menutrans Select\ &Word 낱ë§\ 고르기(&W)
+menutrans Select\ &Line 줄\ 고르기(&L)
+menutrans Select\ &Block 구íš\ 고르기(&B)
+menutrans Select\ &All 모ë‘\ 고르기(&A)
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open íŒŒì¼ ì—´ê¸°
+ tmenu ToolBar.Save 현재 íŒŒì¼ ì €ìž¥
+ tmenu ToolBar.SaveAll ëª¨ë‘ ì €ìž¥
+ tmenu ToolBar.Print ì¸ì‡„
+ tmenu ToolBar.Undo 취소
+ tmenu ToolBar.Redo 다시 실행
+ tmenu ToolBar.Cut ìžë¥´ê¸°
+ tmenu ToolBar.Copy 복사
+ tmenu ToolBar.Paste 붙ì´ê¸°
+ tmenu ToolBar.Find 찾기...
+ tmenu ToolBar.FindNext ë‹¤ìŒ ì°¾ê¸°
+ tmenu ToolBar.FindPrev ì´ì „ 찾기
+ tmenu ToolBar.Replace 바꾸기
+ tmenu ToolBar.LoadSesn 세션 ì½ì–´ì˜¤ê¸°
+ tmenu ToolBar.SaveSesn 세션 저장
+ tmenu ToolBar.RunScript 스í¬ë¦½íŠ¸ 실행
+ tmenu ToolBar.Make Make
+ tmenu ToolBar.Shell 쉘
+ tmenu ToolBar.RunCtags 꼬리표 만들기
+ tmenu ToolBar.TagJump 꼬리표로 가기
+ tmenu ToolBar.Help ë„움ë§
+ tmenu ToolBar.FindHelp ë„ì›€ë§ ì°¾ê¸°...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax 문법(&S)
+menutrans &Show\ individual\ choices 모든\ ì„ íƒê°€ëŠ¥í•œ\ 항목\ 보기(&S)
+menutrans Set\ '&syntax'\ only 'syntax'만\ 설정(&s)
+menutrans Set\ '&filetype'\ too 'filetype'ë„\ 설정(&f)
+menutrans &Off ë„기(&O)
+menutrans &Manual 수ë™(&M)
+menutrans A&utomatic ìžë™(&u)
+menutrans on/off\ for\ &This\ file ì´\ 파ì¼ë§Œ\ 켜기/ë„기(&T)
+
+menutrans Co&lor\ test 색\ 시험(&l)
+menutrans &Highlight\ test Highlight\ 시험(&H)
+menutrans &Convert\ to\ HTML HTML로\ 변환(&C)
+
diff --git a/runtime/lang/menu_ko_kr.vim b/runtime/lang/menu_ko_kr.vim
new file mode 100644
index 000000000..26a959a94
--- /dev/null
+++ b/runtime/lang/menu_ko_kr.vim
@@ -0,0 +1,5 @@
+" Menu Translations: Korean
+" Translated By: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2003 Feb 24
+
+source <sfile>:p:h/menu_ko_kr.euckr.vim
diff --git a/runtime/lang/menu_nl.latin1.vim b/runtime/lang/menu_nl.latin1.vim
new file mode 100644
index 000000000..f10ec44a8
--- /dev/null
+++ b/runtime/lang/menu_nl.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Nederlands
+
+source <sfile>:p:h/menu_nl_nl.latin1.vim
diff --git a/runtime/lang/menu_nl.utf-8.vim b/runtime/lang/menu_nl.utf-8.vim
new file mode 100644
index 000000000..8e87d9607
--- /dev/null
+++ b/runtime/lang/menu_nl.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Nederlands for UTF-8 encoding
+
+source <sfile>:p:h/menu_nl_nl.latin1.vim
diff --git a/runtime/lang/menu_nl_nl.latin1.vim b/runtime/lang/menu_nl_nl.latin1.vim
new file mode 100644
index 000000000..d7f75f2fe
--- /dev/null
+++ b/runtime/lang/menu_nl_nl.latin1.vim
@@ -0,0 +1,240 @@
+" Menu Translations: Nederlands
+" Maintainer: Bram Moolenaar
+" Last Change: 2004 May 05
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252 and
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+" Help menu
+menutrans &Help &Help
+menutrans &Overview<Tab><F1> &Overzicht<Tab><F1>
+menutrans &User\ Manual Gebruikershandleiding
+menutrans &How-to\ links &Hoe-doe-ik\ lijst
+"menutrans &GUI &GUI
+menutrans &Credits &Met\ dank\ aan
+menutrans Co&pying &Copyright
+menutrans &Sponsor/Register &Sponsor/Registreer
+menutrans O&rphans &Weeskinderen
+menutrans &Version &Versie
+menutrans &About &Introductiescherm
+
+" File menu
+menutrans &File &Bestand
+menutrans &Open\.\.\.<Tab>:e &Openen\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp In\ nieuw\ &Venster\ openen\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nieuw<Tab>:enew
+menutrans &Close<Tab>:close &Sluiten<Tab>:close
+menutrans &Save<Tab>:w &Bewaren<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Bewaren\ als\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Toon\ diff\ met\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Toon\ gewijzigd\ door\.\.\.
+menutrans &Print Af&drukken
+menutrans Sa&ve-Exit<Tab>:wqa Bewaren\ en\ Afsluiten<Tab>:wqa
+menutrans E&xit<Tab>:qa &Afsluiten<Tab>:qa
+
+" Edit menu
+menutrans &Edit Be&werken
+menutrans &Undo<Tab>u Terug<Tab>u
+menutrans &Redo<Tab>^R Voo&ruit<Tab>^R
+menutrans Rep&eat<Tab>\. &Herhalen<Tab>\.
+menutrans Cu&t<Tab>"+x &Knippen<Tab>"+x
+menutrans &Copy<Tab>"+y K&opiëeren<Tab>"+y
+menutrans &Paste<Tab>"+gP Plakken<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Ervoor\ invoegen<Tab>[p
+menutrans Put\ &After<Tab>]p Erachter\ invoegen<Tab>]p
+menutrans &Select\ all<Tab>ggVG Alles\ &Markeren<Tab>ggVG
+menutrans &Find\.\.\. &Zoeken\.\.\.
+menutrans &Find<Tab>/ &Zoeken<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. Zoeken\ en\ &Vervangen\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Zoeken\ en\ &Vervangen<Tab>:%s
+menutrans Find\ and\ Rep&lace Zoeken\ en\ &Vervangen
+menutrans Find\ and\ Rep&lace<Tab>:s Zoeken\ en\ &Vervangen<Tab>:s
+menutrans Settings\ &Window Optievenster
+menutrans &Global\ Settings Globale\ Opties
+menutrans F&ile\ Settings Bestandopties
+menutrans C&olor\ Scheme Kleurenschema
+menutrans &Keymap Toetsenbordindeling
+
+" Edit.Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Flip\ Patroonkleuring<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Flip\ Negeren\ hoofd/kleine\ letters<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Flip\ Showmatch<Tab>:set\ sm!
+menutrans &Context\ lines Contextregels
+menutrans &Virtual\ Edit Virtueel\ positioneren
+menutrans Never Nooit
+menutrans Block\ Selection Bij\ Blokselectie
+menutrans Insert\ mode In\ Invoegmode
+menutrans Block\ and\ Insert Bij\ Blokselectie\ en\ Invoegmode
+menutrans Always Altijd
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Flip\ Invoegmode<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Flip\ Vi\ Compatibiliteit<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Zoekpad\.\.\.
+menutrans Ta&g\ Files\.\.\. Tag\ Bestanden\.\.\.
+menutrans Toggle\ &Toolbar Toon/verberg\ Knoppenbalk
+menutrans Toggle\ &Bottom\ Scrollbar Toon/verberg\ onderste\ schuifbalk
+menutrans Toggle\ &Left\ Scrollbar Toon/verberg\ linker\ schuifbalk
+menutrans Toggle\ &Right\ Scrollbar Toon/verberg\ rechter\ schuifbalk
+menutrans None Geen
+
+" Edit.File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Flip\ regelnummers<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Flip\ list\ mode<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Flip\ regelafbreken<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Flip\ afbreken\ op\ woordgrens<tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Flip\ tabexpansie<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Flip\ automatisch\ indenteren<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Flip\ C-indenteren<Tab>:set\ cin!
+menutrans Te&xt\ Width\.\.\. Tekstbreedte\.\.\.
+menutrans &File\ Format\.\.\. Bestandsformaat\.\.\.
+
+" Tools menu
+menutrans &Tools &Gereedschap
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Spring\ naar\ Tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T Spring\ &Terug<Tab>^T
+menutrans Build\ &Tags\ File Genereer\ &Tagsbestand
+menutrans &Make<Tab>:make &Make\ uitvoeren<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Foutenlijst<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! &Berichtenlijst<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Volgende\ Fout<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Vorige\ Fout<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Oudere\ Lijst<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Nieuwere\ Lijst<Tab>:cnew
+menutrans Error\ &Window Foutenvenster
+menutrans &Update<Tab>:cwin &Aanpassen<Tab>:cwin
+menutrans &Open<Tab>:copen &Openen<Tab>:copen
+menutrans &Close<Tab>:cclose &Sluiten<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Converteer\ naar\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Converteer\ terug<Tab>:%!xxd\ -r
+menutrans &Set\ Compiler Kies\ Compiler
+
+" Tools.Folding
+menutrans &Enable/Disable\ folds<Tab>zi Flip\ tonen\ folds<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Toon\ cursorregel<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Toon\ alleen\ cursorregel<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Sluit\ meer\ folds<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Sluit\ alle\ folds<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Open\ meer\ folds<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Open\ alle\ folds<Tab>zR
+menutrans Fold\ Met&hod Foldwijze
+menutrans M&anual Handmatig
+menutrans I&ndent Inspringing
+menutrans E&xpression Expressie
+menutrans S&yntax Syntax
+menutrans &Diff Verschillen
+menutrans Ma&rker Markeringen
+menutrans Create\ &Fold<Tab>zf maak\ Fold<Tab>zf
+menutrans &Delete\ Fold<Tab>zd verwijder\ Fold<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD verwijder\ alle\ Folds<Tab>zD
+menutrans Fold\ column\ &width Fold\ kolom\ breedte
+
+" Tools.Diff
+menutrans &Update Verversen
+menutrans &Get\ Block Blok\ ophalen\ van\ ander\ venster
+menutrans &Put\ Block Blok\ naar\ ander\ venster
+
+" Names for buffer menu.
+menutrans &Buffers &Buffer
+menutrans &Refresh\ menu Ververs\ menu
+menutrans &Delete Wissen
+menutrans &Alternate Vorige
+menutrans &Next Vooruit
+menutrans &Previous Achteruit
+
+" Window menu
+menutrans &Window &Venster
+menutrans &New<Tab>^Wn &Nieuw<Tab>^Wn
+menutrans S&plit<Tab>^Ws Splitsen<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Splits\ naar\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Splits\ &Vertikaal<Tab>^Wv
+menutrans Split\ File\ E&xplorer Splits\ Bestandverkenner
+menutrans &Close<Tab>^Wc &Sluiten<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo &Sluit\ alle\ andere<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww Volgende<Tab>^Ww
+menutrans P&revious<Tab>^WW &Vorige<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Gelijke\ afmetingen<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maximale\ hoogte<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Mi&nimale\ hoogte<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maximale\ breedte<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimale\ breedte<Tab>^W1\|
+menutrans Move\ &To Verplaats\ naar
+menutrans &Top<Tab>^WK Bovenkant<Tab>^WK
+menutrans &Bottom<Tab>^WJ Onderkant<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Linkerkant<Tab>^WH
+menutrans &Right\ side<Tab>^WL Rechterkant<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Roteren\ naar\ &boven<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Roteren\ naar\ &onder<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Selecteer\ font\.\.\.
+
+" The popup menu
+menutrans &Undo &Terug
+menutrans Cu&t Knip
+menutrans &Copy &Kopiëer
+menutrans &Paste &Plak
+menutrans &Delete &Wissen
+menutrans Select\ Blockwise Selecteer\ per\ Rechthoek
+menutrans Select\ &Word Selecteer\ een\ &Woord
+menutrans Select\ &Line Selecteer\ een\ &Regel
+menutrans Select\ &Block Selecteer\ een\ Recht&hoek
+menutrans Select\ &All Selecteer\ &Alles
+
+" The GUI toolbar (for Win32 or GTK)
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Bestand openen
+ tmenu ToolBar.Save Bestand opslaan
+ tmenu ToolBar.SaveAll Alle bestanden opslaan
+ tmenu ToolBar.Print afdrukken
+ tmenu ToolBar.Undo terug
+ tmenu ToolBar.Redo vooruit
+ tmenu ToolBar.Cut knippen
+ tmenu ToolBar.Copy Kopiëren
+ tmenu ToolBar.Paste Plakken
+ tmenu ToolBar.Find Zoeken...
+ tmenu ToolBar.FindNext Zoek volgende
+ tmenu ToolBar.FindPrev Zoek vorige
+ tmenu ToolBar.Replace Zoek en vervang...
+ tmenu ToolBar.LoadSesn Sessie Laden
+ tmenu ToolBar.SaveSesn Sessie opslaan
+ tmenu ToolBar.RunScript Vim script uitvoeren
+ tmenu ToolBar.Make Make uitvoeren
+ tmenu ToolBar.Shell Shell starten
+ tmenu ToolBar.RunCtags Tags bestand genereren
+ tmenu ToolBar.TagJump Spring naar tag
+ tmenu ToolBar.Help Help!
+ tmenu ToolBar.FindHelp Help vinden...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Syntax
+menutrans &Show\ filetypes\ in\ menu Toon\ filetypes\ in\ menu
+menutrans Set\ '&syntax'\ only Alleen\ 'syntax'\ wijzigen
+menutrans Set\ '&filetype'\ too Ook\ 'filetype'\ wijzigen
+menutrans &Off &Uit
+menutrans &Manual &Handmatig
+menutrans A&utomatic A&utomatisch
+menutrans on/off\ for\ &This\ file Aan/Uit\ voor\ dit\ Bestand
+menutrans Co&lor\ test Test\ de\ &Kleuren
+menutrans &Highlight\ test Test\ de\ Markeringen
+menutrans &Convert\ to\ HTML Converteren\ naar\ &HTML
+menutrans &Show\ individual\ choices Toon\ elke\ keuze
+
+" dialog texts
+let menutrans_no_file = "[Geen Bestand]"
+let menutrans_help_dialog = "Typ een commando of woord om help voor te vinden:\n\nVoeg i_ in voor Input mode commandos (bijv. i_CTRL-X)\nVoeg c_ in voor een commando-regel edit commando (bijv. c_<Del>)\nVoeg ' in \voor een optie naam (bijv. 'shiftwidth')"
+let g:menutrans_path_dialog = "Typ het zoekpad voor bestanden.\nGebruik commas tussen de padnamen."
+let g:menutrans_tags_dialog = "Typ namen van tag bestanden.\nGebruik commas tussen de namen."
+let g:menutrans_textwidth_dialog = "Typ de nieuwe tekst breedte (0 om formatteren uit the schakelen): "
+let g:menutrans_fileformat_dialog = "Selecteer formaat voor het schrijven van het bestand"
diff --git a/runtime/lang/menu_nl_nl.utf-8.vim b/runtime/lang/menu_nl_nl.utf-8.vim
new file mode 100644
index 000000000..8e87d9607
--- /dev/null
+++ b/runtime/lang/menu_nl_nl.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Nederlands for UTF-8 encoding
+
+source <sfile>:p:h/menu_nl_nl.latin1.vim
diff --git a/runtime/lang/menu_no.latin1.vim b/runtime/lang/menu_no.latin1.vim
new file mode 100644
index 000000000..fa71aedcd
--- /dev/null
+++ b/runtime/lang/menu_no.latin1.vim
@@ -0,0 +1,4 @@
+" Menu Translations: Norwegian
+" menu_no.latin1.vim 289 2004-05-16 18:00:52Z sunny
+
+source <sfile>:p:h/menu_no_no.latin1.vim
diff --git a/runtime/lang/menu_no.utf-8.vim b/runtime/lang/menu_no.utf-8.vim
new file mode 100644
index 000000000..42ce8681b
--- /dev/null
+++ b/runtime/lang/menu_no.utf-8.vim
@@ -0,0 +1,4 @@
+" Menu Translations: Norwegian for UTF-8 encoding
+" menu_no.utf-8.vim 289 2004-05-16 18:00:52Z sunny
+
+source <sfile>:p:h/menu_no_no.latin1.vim
diff --git a/runtime/lang/menu_no_no.latin1.vim b/runtime/lang/menu_no_no.latin1.vim
new file mode 100644
index 000000000..f27b05c71
--- /dev/null
+++ b/runtime/lang/menu_no_no.latin1.vim
@@ -0,0 +1,233 @@
+" Menu Translations: Norwegian / Norsk (Bokmål)
+" Maintainer: Øyvind A. Holm <sunny@sunbase.org>
+" Last Change: 2004-05-16 20:00:52 +0200
+" menu_no_no.latin1.vim 289 2004-05-16 18:00:52Z sunny
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in ISO-8859-1, but they work for ISO-8859-15 and
+" CP1252 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+menutrans &File &Fil
+ menutrans &Open\.\.\.<Tab>:e &Åpne \.\.\.<Tab>:e
+ menutrans Sp&lit-Open\.\.\.<Tab>:sp Åpne\ i\ nytt\ &vindu \.\.\.<Tab>:sp
+ menutrans &New<Tab>:enew &Ny\ fil<Tab>:enew
+ menutrans &Close<Tab>:close L&ukk<Tab>:close
+ menutrans &Save<Tab>:w &Lagre<Tab>:w
+ menutrans Save\ &As\.\.\.<Tab>:sav Lagre\ s&om \.\.\.<Tab>:sav
+ if has("diff")
+ menutrans Split\ &Diff\ with\.\.\. Sa&mmenlign\ med\ ny\ fil \.\.\.
+ menutrans Split\ Patched\ &By\.\.\. &Patch\ i\ nytt\ vindu \.\.\.
+ endif
+ menutrans &Print &Skriv\ ut
+ menutrans Sa&ve-Exit<Tab>:wqa Lagre\ o&g\ avslutt<Tab>:wqa
+ menutrans E&xit<Tab>:qa &Avslutt<Tab>:qa
+menutrans &Edit &Rediger
+ menutrans &Undo<Tab>u &Angre<Tab>u
+ menutrans &Redo<Tab>^R &Gjenopprett<Tab>^R
+ menutrans Rep&eat<Tab>\. &Repeter<Tab>\.
+ menutrans Cu&t<Tab>"+x &Klipp\ ut<Tab>"+x
+ menutrans &Copy<Tab>"+y K&opier<Tab>"+y
+ menutrans &Paste<Tab>"+gP &Lim\ inn<Tab>"+gP
+ menutrans Put\ &Before<Tab>[p Lim\ i&nn\ før\ markør<Tab>[p
+ menutrans Put\ &After<Tab>]p Lim\ inn\ &etter\ markør<Tab>]p
+ menutrans &Select\ All<Tab>ggVG &Merk\ alt<Tab>ggVG
+ menutrans &Find\.\.\. &Søk \.\.\.
+ menutrans Find\ and\ Rep&lace\.\.\. S&øk\ og\ erstatt \.\.\.
+ menutrans Settings\ &Window &Innstillinger
+ menutrans &Global\ Settings Glo&bale\ innstillinger
+ menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! &Utheving\ av\ søketekst\ av/på<Tab>:set\ hls!
+ menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Forskjell\ mellom\ store/små bokstaver\ av/på<Tab>:set\ ic!
+ menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Indikering\ av\ samsvarende\ parentes\ av/på<Tab>:set\ sm!
+ menutrans &Context\ lines &Kontekstlinjer
+ menutrans &Virtual\ Edit Vi&rtuell\ redigering
+ menutrans Never &Aldri
+ menutrans Block\ Selection I\ &blokkmodus
+ menutrans Insert\ mode I\ &Innsettingsmodus
+ menutrans Block\ and\ Insert I\ Blokk-\ &og\ innsettingsmodus
+ menutrans Always A&lltid
+ menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Innsettings&modus\ av/på<Tab>:set\ im!
+ menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &Vi-kompatiblitet\ av/på<Tab>:set\ cp!
+ menutrans Search\ &Path\.\.\. &Søkesti \.\.\.
+ menutrans Ta&g\ Files\.\.\. Ta&gfiler \.\.\.
+ menutrans Toggle\ &Toolbar Verkt&øylinje
+ menutrans Toggle\ &Bottom\ Scrollbar Ne&dre\ rullefelt\ av/på
+ menutrans Toggle\ &Left\ Scrollbar Ve&nstre\ rullefelt\ av/på
+ menutrans Toggle\ &Right\ Scrollbar &Høyre\ rullefelt\ av/på
+ menutrans F&ile\ Settings Filo&ppsett
+ menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Linjenummer\ av/på<Tab>:set\ nu!
+ menutrans Toggle\ &List\ Mode<Tab>:set\ list! L&istemodus\ av/på<Tab>:set\ list!
+ menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Li&njebryting\ av/på<Tab>:set\ wrap!
+ menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Linjebryting\ ved\ &ord\ av/på<Tab>:set\ lbr!
+ menutrans Toggle\ &expand-tab<Tab>:set\ et! Utvidelse\ av\ &tabulatorer\ av/på<Tab>:set\ et!
+ menutrans Toggle\ &auto-indent<Tab>:set\ ai! A&utomatisk\ innrykk\ av/på<Tab>:set\ ai!
+ menutrans Toggle\ &C-indenting<Tab>:set\ cin! &C-innrykk\ av/på<Tab>:set\ cin!
+ menutrans &Shiftwidth &Størrelse\ på\ innrykk
+ menutrans Soft\ &Tabstop &Myke\ tabulatorstopp
+ menutrans Te&xt\ Width\.\.\. Te&kstbredde \.\.\.
+ menutrans &File\ Format\.\.\. &Filformat \.\.\.
+ menutrans C&olor\ Scheme &Fargekart
+ menutrans &Keymap &Tastaturoppsett
+ menutrans Select\ Fo&nt\.\.\. Skriftt&ype \.\.\.
+menutrans &Tools &Verktøy
+ menutrans &Jump\ to\ this\ tag<Tab>g^] &Hopp\ til\ tag\ under\ markør<Tab>g^]
+ menutrans Jump\ &back<Tab>^T Hopp\ &tilbake<Tab>^T
+ menutrans Build\ &Tags\ File Lag\ ta&gfil
+ if has("folding")
+ menutrans &Folding Fol&der
+ menutrans &Enable/Disable\ folds<Tab>zi &Folder\ av/på<Tab>zi
+ menutrans &View\ Cursor\ Line<Tab>zv Se\ &markørlinje<Tab>zv
+ menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Se\ &bare\ markørlinjen<Tab>zMzx
+ menutrans C&lose\ more\ folds<Tab>zm L&ukk\ flere\ folder<Tab>zm
+ menutrans &Close\ all\ folds<Tab>zM Lukk\ &alle\ folder<Tab>zM
+ menutrans O&pen\ more\ folds<Tab>zr &Åpne\ flere\ folder<Tab>zr
+ menutrans &Open\ all\ folds<Tab>zR Å&pne\ alle\ folder<Tab>zR
+ menutrans Fold\ Met&hod Foldme&tode
+ menutrans M&anual &Manuell
+ menutrans I&ndent &Innrykk
+ menutrans E&xpression &Uttrykk
+ menutrans S&yntax &Syntaks
+ menutrans &Diff &Forskjeller
+ menutrans Ma&rker M&arkering
+ menutrans Create\ &Fold<Tab>zf La&g\ fold<Tab>zf
+ menutrans &Delete\ Fold<Tab>zd &Slett\ fold<Tab>zd
+ menutrans Delete\ &All\ Folds<Tab>zD Sl&ett\ alle\ folder<Tab>zD
+ menutrans Fold\ col&umn\ width Bredde\ på\ fold&kolonne
+ endif
+ if has("diff")
+ menutrans &Diff &Forskjeller
+ menutrans &Update &Oppdater
+ menutrans &Get\ Block &Hent\ blokk
+ menutrans &Put\ Block &Putt\ blokk
+ endif
+ menutrans &Make<Tab>:make &Kjør\ "make"<Tab>:make
+ menutrans &List\ Errors<Tab>:cl &List\ feil<Tab>:cl
+ menutrans L&ist\ Messages<Tab>:cl! List\ &meldinger<Tab>:cl!
+ menutrans &Next\ Error<Tab>:cn &Neste\ feil<Tab>:cn
+ menutrans &Previous\ Error<Tab>:cp Fo&rrige\ feil<Tab>:cp
+ menutrans &Older\ List<Tab>:cold &Eldre\ liste<Tab>:cold
+ menutrans N&ewer\ List<Tab>:cnew N&yere\ liste<Tab>:cnew
+ menutrans Error\ &Window Fe&ilvindu
+ menutrans &Update<Tab>:cwin &Oppdater<Tab>:cwin
+ menutrans &Open<Tab>:copen &Åpne<Tab>:copen
+ menutrans &Close<Tab>:cclose &Lukk<Tab>:cclose
+ menutrans &Set\ Compiler &Velg\ kompilator
+ menutrans &Convert\ to\ HEX<Tab>:%!xxd Konverter\ til\ hek&sadesimal<Tab>:%!xxd
+ menutrans Conve&rt\ back<Tab>:%!xxd\ -r K&onverter\ tilbake<Tab>:%!xxd\ -r
+menutrans &Syntax &Syntaks
+ menutrans &Show\ filetypes\ in\ menu &Vis\ filtyper\ i\ menyen
+ menutrans Set\ '&syntax'\ only Sett\ bare\ '&syntax'
+ menutrans Set\ '&filetype'\ too Sett\ '&filetype'\ også
+ menutrans &Off &Av
+ menutrans &Manual &Manuell
+ menutrans A&utomatic A&utomatisk
+ menutrans on/off\ for\ &This\ file Av/på\ for\ &denne\ filen
+ menutrans Co&lor\ test Far&getest
+ menutrans &Highlight\ test Uthevings&test
+ menutrans &Convert\ to\ HTML Konverter\ til\ &HTML
+menutrans &Buffers &Buffer
+ menutrans &Refresh\ menu &Oppdater
+ menutrans Delete &Slett
+ menutrans &Alternate &Veksle
+ menutrans &Next &Neste
+ menutrans &Previous &Forrige
+ menutrans [No\ File] [Uten\ navn]
+menutrans &Window Vi&ndu
+ menutrans &New<Tab>^Wn &Nytt<Tab>^Wn
+ menutrans S&plit<Tab>^Ws &Splitt<Tab>^Ws
+ menutrans Sp&lit\ To\ #<Tab>^W^^ Splitt\ &til\ #<Tab>^W^^
+ menutrans Split\ &Vertically<Tab>^Wv S&plitt\ loddrett<Tab>^Ws
+ menutrans Split\ File\ E&xplorer &Filbehandler
+ menutrans &Close<Tab>^Wc &Lukk<Tab>^Wc
+ menutrans Close\ &Other(s)<Tab>^Wo Lukk\ &andre<Tab>^Wo
+ menutrans Move\ &To Fl&ytt\ til
+ menutrans &Top<Tab>^WK &Toppen<Tab>^WK
+ menutrans &Bottom<Tab>^WJ &Bunnen<Tab>^WJ
+ menutrans &Left\ side<Tab>^WH &Venstre\ side<Tab>^WH
+ menutrans &Right\ side<Tab>^WL &Høyre\ side<Tab>^WL
+ menutrans Rotate\ &Up<Tab>^WR Roter\ &opp<Tab>^WR
+ menutrans Rotate\ &Down<Tab>^Wr &Roter\ ned<Tab>^Wr
+ menutrans &Equal\ Size<Tab>^W= Lik\ st&ørrelse<Tab>^W=
+ menutrans &Max\ Height<Tab>^W_ &Maksimal\ høyde<Tab>^W_
+ menutrans M&in\ Height<Tab>^W1_ M&inimal\ høyde<Tab>^W1_
+ menutrans Max\ &Width<Tab>^W\| Ma&ksimal\ bredde<Tab>^W\|
+ menutrans Min\ Widt&h<Tab>^W1\| Minimal\ &bredde<Tab>^W1\|
+menutrans &Help &Hjelp
+ menutrans &Overview<Tab><F1> &Oversikt<Tab><F1>
+ menutrans &User\ Manual &Brukerhåndbok
+ menutrans &How-to\ links &Førstehjelp
+ menutrans &Find\.\.\. &Søk \.\.\.
+ menutrans &Credits &Kreditering
+ menutrans Co&pying &Programlisens
+ menutrans &Sponsor/Register S&tøtte/Registrering
+ menutrans O&rphans Fo&reldreløse
+ menutrans &Version &Versjon
+ menutrans &About &Om\ Vim
+
+" Popup
+ menutrans &Undo &Angre
+ menutrans Cu&t Klipp\ &ut
+ menutrans &Copy &Kopier
+ menutrans &Paste &Lim\ inn
+ menutrans &Delete &Slett
+ menutrans Select\ Blockwise Marker\ blokk&vis
+ menutrans Select\ &Word Marker\ &ord
+ menutrans Select\ &Line Marker\ lin&je
+ menutrans Select\ &Block Marker\ &blokk
+ menutrans Select\ &All Marker\ al&t
+
+" Verktøylinje
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfunction Do_toolbar_tmenu
+ endif
+ function Do_toolbar_tmenu()
+ tmenu ToolBar.Open Åpne fil
+ tmenu ToolBar.Save Lagre fil
+ tmenu ToolBar.SaveAll Lagre alle filer
+ tmenu ToolBar.Print Skriv ut
+ tmenu ToolBar.Undo Angre
+ tmenu ToolBar.Redo Gjenopprett
+ tmenu ToolBar.Cut Klipp
+ tmenu ToolBar.Copy Kopier
+ tmenu ToolBar.Paste Lim inn
+ tmenu ToolBar.Find Søk ...
+ tmenu ToolBar.FindNext Finn neste
+ tmenu ToolBar.FindPrev Finn forrige
+ tmenu ToolBar.Replace Søk og erstatt ...
+ if 0 " Disabled, they are in the Windows menu
+ tmenu ToolBar.New Nytt vindu
+ tmenu ToolBar.WinSplit Splitt vindu
+ tmenu ToolBar.WinMax Maksimal vindushøyde
+ tmenu ToolBar.WinMin Minimal vindushøyde
+ tmenu ToolBar.WinClose Lukk vindu
+ endif
+ tmenu ToolBar.LoadSesn Åpne økt
+ tmenu ToolBar.SaveSesn Lagre økt
+ tmenu ToolBar.RunScript Kjør Vim-skript
+ tmenu ToolBar.Make Kjør "make"
+ tmenu ToolBar.Shell Start skall
+ tmenu ToolBar.RunCtags Oppdater tag-fil
+ tmenu ToolBar.TagJump Hopp til tag
+ tmenu ToolBar.Help Hjelp!
+ tmenu ToolBar.FindHelp Søk i hjelpen ...
+ endfunction
+endif
+
+" Dialogmeldinger
+ let g:menutrans_no_file = "[Uten navn]"
+ let g:menutrans_help_dialog = "Skriv en kommando eller ord du vil ha hjelp om:\n\nLegg til i_ i begynnelsen for inndatametoder (f.eks.: i_CTRL-X)\nLegg til c_ i begynnelsen for kommandoer som redigerer kommandolinjen (f.eks.: c_<Del>)\nLegg til ' i begynnelsen for et valgnavn (f.eks.: 'shiftwidth')"
+ let g:menutrans_path_dialog = "Skriv søkesti for filer.\nSkill katalognavn med komma."
+ let g:menutrans_tags_dialog = "Skriv navn på tagfiler.\nSkill navnene med komma."
+ let g:menutrans_textwidth_dialog = "Velg ny tekstbredde (0 for å forhindre formatering): "
+ let g:menutrans_fileformat_dialog = "Velg filformat som filen skal lagres med"
+
+" vim: set ts=8 sw=8 :
+" vim600: set fdm=indent :
diff --git a/runtime/lang/menu_no_no.utf-8.vim b/runtime/lang/menu_no_no.utf-8.vim
new file mode 100644
index 000000000..af39cc84a
--- /dev/null
+++ b/runtime/lang/menu_no_no.utf-8.vim
@@ -0,0 +1,4 @@
+" Menu Translations: Norwegian for UTF-8 encoding
+" menu_no_no.utf-8.vim 289 2004-05-16 18:00:52Z sunny
+
+source <sfile>:p:h/menu_no_no.latin1.vim
diff --git a/runtime/lang/menu_pl.cp1250.vim b/runtime/lang/menu_pl.cp1250.vim
new file mode 100644
index 000000000..0e0fdd087
--- /dev/null
+++ b/runtime/lang/menu_pl.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Polish
+
+source <sfile>:p:h/menu_polish_poland.1250.vim
diff --git a/runtime/lang/menu_pl_pl.cp1250.vim b/runtime/lang/menu_pl_pl.cp1250.vim
new file mode 100644
index 000000000..0e0fdd087
--- /dev/null
+++ b/runtime/lang/menu_pl_pl.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Polish
+
+source <sfile>:p:h/menu_polish_poland.1250.vim
diff --git a/runtime/lang/menu_pl_pl.iso_8859-2.vim b/runtime/lang/menu_pl_pl.iso_8859-2.vim
new file mode 100644
index 000000000..6ade1d7d9
--- /dev/null
+++ b/runtime/lang/menu_pl_pl.iso_8859-2.vim
@@ -0,0 +1,263 @@
+" Menu Translations: Polish
+" Maintainer: Rafal M. Sulejman <rms@poczta.onet.pl>
+" Initial Translation: Marcin Dalecki <dalecki@cs.net.pl>
+" Last Change: 5 May 2004
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding iso-8859-2
+
+" Help menu
+menutrans &Help Po&moc
+menutrans &Overview<Tab><F1> &Spis\ tre¶ci<Tab><F1>
+menutrans &How-to\ links &Odno¶niki\ JTZ
+menutrans &Credits Po&dziêkowania
+menutrans &User\ Manual Podrêcznik\ &u¿ytkownika
+menutrans Co&pying &Kopiowanie
+menutrans &Version &Wersja
+menutrans &About o\ &Aplikacji
+menutrans &Sponsor/Register &Sponsorowanie/Rejestracja
+menutrans O&rphans K&ibaale\ Children\'s\ Center
+
+" File menu
+menutrans &File &Plik
+menutrans &Open\.\.\.<Tab>:e &Otwórz\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Otwórz\ z\ &podzia³em\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nowy<Tab>:enew
+menutrans &Close<Tab>:close &Zamknij<Tab>:close
+menutrans &Save<Tab>:w Za&pisz<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Zapisz\ &jako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Podziel\ na\ diff-a\ miêdzy\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Podziel\ ³atane\ przez\.\.\.
+menutrans &Print &Drukuj
+menutrans Sa&ve-Exit<Tab>:wqa W&yj¶cie\ z\ zapisem<Tab>:wqa
+menutrans E&xit<Tab>:qa &Wyj¶cie<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Edycja
+menutrans &Undo<Tab>u &Cofnij<Tab>u
+menutrans &Redo<Tab>^R &Ponów<Tab>^R
+menutrans Rep&eat<Tab>\. P&owtórz<Tab>\.
+menutrans Cu&t<Tab>"+x W&ytnij<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiuj<Tab>"+y
+menutrans &Paste<Tab>"+gP &Wklej<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Wstaw\ p&rzed<Tab>[p
+menutrans Put\ &After<Tab>]p Wstaw\ p&o<Tab>]p
+menutrans &Select\ All<Tab>ggVG Z&aznacz\ ca³o¶æ<Tab>ggVG
+menutrans &Find\.\.\. &Szukaj\.\.\.
+menutrans &Find<Tab>/ &Szukaj<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. &Zamieñ\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s &Zamieñ<Tab>:%s
+menutrans Find\ and\ Rep&lace &Zamieñ
+menutrans Find\ and\ Rep&lace<Tab>:s &Zamieñ<Tab>:s
+menutrans Options\.\.\. Opcje\.\.\.
+menutrans Settings\ &Window Ustawienia
+menutrans &Global\ Settings Ustawienia\ &globalne
+menutrans F&ile\ Settings Ustawienia\ dla\ pliku
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numerowanie\ wierszy<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Tryb\ &listowania<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Za&wijanie\ wierszy<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! £amanie\ wie&rsza<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Rozwijani&e\ tabulatorów<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Automatyczne\ wciêcia<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Wciêcia\ &C<Tab>:set\ cin!
+menutrans &Shiftwidth &Szeroko¶æ\ wciêcia
+menutrans Te&xt\ Width\.\.\. D³ugo¶æ\ linii\.\.\.
+menutrans &File\ Format\.\.\. &Format\ pliku\.\.\.
+menutrans Soft\ &Tabstop Rozmiar\ &tabulacji
+menutrans C&olor\ Scheme Zestawy\ kolorów
+menutrans &Keymap Uk³ady\ klawiatury
+menutrans None ¿aden
+menutrans accents akcenty
+menutrans hebrew hebrajski
+menutrans hebrewp hebrajski\ p
+menutrans russian-jcuken rosyjski-jcuken
+menutrans russian-jcukenwin rosyjski-jcukenwin
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Podkre¶lanie\ &wzorców<Tab>:set\ hls!
+
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Ignorowanie\ wielko¶ci<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Pokazywanie\ pasuj±cych<Tab>:set\ sm!
+
+menutrans &Context\ lines Wiersze\ &kontekstowe
+menutrans &Virtual\ Edit Obróbka\ &wirtualna
+
+menutrans Never Nigdy
+menutrans Block\ Selection Zaznaczanie\ zakresu
+menutrans Insert\ mode Tryb\ wprowadzania
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Tryb\ zg&odno¶ci\ z\ Vi<Tab>:set\ cp!
+menutrans Block\ and\ Insert Zakres\ i\ wprowadzanie
+menutrans Always Zawsze
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Tryb\ wprowadzania<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. Scie¿ka\ poszukiwania\.\.\.
+menutrans Ta&g\ Files\.\.\. Pliki\ tagów\.\.\.
+
+
+"
+" GUI options
+menutrans Toggle\ &Toolbar Pasek\ narzêdzi
+menutrans Toggle\ &Bottom\ Scrollbar Dolny\ przewijacz
+menutrans Toggle\ &Left\ Scrollbar &Lewy\ przewijacz
+menutrans Toggle\ &Right\ Scrollbar P&rawy\ przewijacz
+
+" Programming menu
+menutrans &Tools &Narzêdzia
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skocz\ do\ taga<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skok\ w\ &ty³<Tab>^T
+menutrans Build\ &Tags\ File &Twórz\ plik\ tagów
+" Folding
+menutrans &Folding &Zwijanie
+menutrans &Enable/Disable\ folds<Tab>zi &Zwiñ/rozwiñ<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Linia\ kursora<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Tylko\ linia\ kursora<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Zwiñ\ wiêcej<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Z&wiñ\ wszystkie<Tab>zM
+menutrans &Open\ all\ folds<Tab>zR Rozwiñ\ wszystkie<Tab>zR
+menutrans O&pen\ more\ folds<Tab>zr R&ozwiñ\ wiêcej<Tab>zr
+
+menutrans Create\ &Fold<Tab>zf T&wórz\ zawiniêcie<Tab>zf
+menutrans &Delete\ Fold<Tab>zd U&suñ\ zawiniêcie<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD &Usuñ\ wszystkie\ zawiniêcia<Tab>zD
+menutrans Fold\ column\ &width Szeroko¶æ\ kolumny\ za&winiêæ
+menutrans Fold\ Met&hod Me&toda\ zawijania
+menutrans M&anual &Rêcznie
+menutrans I&ndent W&ciêcie
+menutrans E&xpression W&yrazenie
+menutrans S&yntax S&k³adnia
+menutrans Ma&rker Zn&acznik
+
+" Diff
+menutrans &Update &Od¶wie¿
+menutrans &Get\ Block &Pobierz\ blok
+menutrans &Put\ Block &Wstaw\ blok
+
+" Make and stuff...
+menutrans &Make<Tab>:make M&ake<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Poka¿\ b³êdy<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! W&ylicz\ powiadomienia<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &Nastêpny\ b³±d<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Poprzedni\ b³±d<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Starsza\ lista<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew N&owsza\ lista<Tab>:cnew
+menutrans Error\ &Window Okno\ komu&nikatów
+menutrans &Update<Tab>:cwin Akt&ualizuj<Tab>:cwin
+menutrans &Close<Tab>:cclose &Zamknij<Tab>:cclose
+menutrans &Open<Tab>:copen &Otwórz<Tab>:copen
+
+menutrans &Set\ Compiler U&staw\ kompilator
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Kody\ szesnastkowe<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Zwyk³y\ tekst<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &Bufory
+menutrans &Refresh\ menu Od¶wie¿
+menutrans Delete Skasuj
+menutrans &Alternate &Zmieñ
+menutrans &Next &Nastêpny
+menutrans &Previous &Poprzedni
+menutrans [No\ File] [Brak\ Pliku]
+
+" Window menu
+menutrans &Window &Widoki
+menutrans &New<Tab>^Wn &Nowy<Tab>^Wn
+menutrans S&plit<Tab>^Ws Po&dziel<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ P&odziel\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Podziel\ pionowo<Tab>^Wv
+menutrans Split\ File\ E&xplorer Otwórz\ mened¿er\ plików
+
+menutrans &Close<Tab>^Wc &Zamknij<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zamknij\ &inne<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Nastêpny<Tab>^Ww
+menutrans P&revious<Tab>^WW &Poprzedni<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Wyrównaj\ wysoko¶ci<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Z&maksymalizuj\ wysoko¶æ<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Zminim&alizuj\ wysoko¶æ<Tab>^W1_
+menutrans Max\ Width<Tab>^W\| Maksymalna\ szeroko¶æ<Tab>^W\|
+menutrans Min\ Width<Tab>^W1\| Minimalna\ szeroko¶æ<Tab>^W1\|
+menutrans Max\ &Width<Tab>^W\| Zmaksymalizuj\ szeroko¶æ<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Zminimalizuj\ szeroko¶æ<Tab>^W1\|
+menutrans Move\ &To &Id¼\ do
+menutrans &Top<Tab>^WK &Góra<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Dó³<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Lewa\ strona<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Prawa\ strona<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Obróæ\ w\ &górê<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Obróæ\ w\ &dó³<Tab>^Wr
+menutrans Split\ &Vertically<Tab>^Wv &Podziel\ w\ poziomie<Tab>^Wv
+menutrans Select\ Fo&nt\.\.\. Wybierz\ &czcionkê\.\.\.
+
+" The popup menu
+menutrans &Undo &Cofnij
+menutrans Cu&t W&ytnij
+menutrans &Copy &Kopiuj
+menutrans &Paste &Wklej
+menutrans &Delete &Skasuj
+menutrans Select\ Blockwise Zaznacz\ &blok
+menutrans Select\ &Word Zaznacz\ &s³owo
+menutrans Select\ &Line Zaznacz\ w&iersz
+menutrans Select\ &Block Zaznacz\ &blok
+menutrans Select\ &All Zaznacz\ c&a³o¶æ
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otwórz plik
+ tmenu ToolBar.Save Zapisz bie¿±cy plik
+ tmenu ToolBar.SaveAll Zapisz wszystkie pliki
+ tmenu ToolBar.Print Drukuj
+ tmenu ToolBar.Undo Cofnij
+ tmenu ToolBar.Redo Ponów
+ tmenu ToolBar.Cut Wytnij
+ tmenu ToolBar.Copy Skopiuj
+ tmenu ToolBar.Paste Wklej
+ tmenu ToolBar.Find Szukaj...
+ tmenu ToolBar.FindNext Szukaj nastêpnego
+ tmenu ToolBar.FindPrev Szukaj poprzedniego
+ tmenu ToolBar.Replace Szukaj i zamieniaj...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nowy widok
+ tmenu ToolBar.WinSplit Podziel widok
+ tmenu ToolBar.WinMax Zmaksymalizuj widok
+ tmenu ToolBar.WinMin Zminimalizuj widok
+ tmenu ToolBar.WinClose Zamknij widok
+ endif
+ tmenu ToolBar.LoadSesn Za³aduj sesjê
+ tmenu ToolBar.SaveSesn Zachowaj bie¿±c± sesjê
+ tmenu ToolBar.RunScript Uruchom skrypt Vima
+ tmenu ToolBar.Make Wykonaj bie¿±cy projekt
+ tmenu ToolBar.Shell Otwórz pow³okê
+ tmenu ToolBar.RunCtags Twórz tagi w bie¿±cym katalogu
+ tmenu ToolBar.TagJump Skok do taga pod kursorem
+ tmenu ToolBar.Help Pomoc Vima
+ tmenu ToolBar.FindHelp Przeszukuj pomoc Vim-a
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sk³adnia
+menutrans &Show\ filetypes\ in\ menu Poka¿\ typy\ &plików\ w\ menu
+menutrans Set\ '&syntax'\ only Ustaw\ tylko\ '&syntax'
+menutrans Set\ '&filetype'\ too Ustaw\ równie¿\ '&filetype'
+menutrans &Off &Wy³±cz
+menutrans &Manual &Rêcznie
+menutrans A&utomatic A&utomatyczne
+menutrans on/off\ for\ &This\ file w³±cz/w&y³±cz\ dla\ pliku
+menutrans Co&lor\ test Test\ &kolorów
+menutrans &Highlight\ test &Test\ pod¶wietlania
+menutrans &Convert\ to\ HTML Przetwórz\ na\ &HTML
+
+" dialog texts
+let menutrans_no_file = "[Brak pliku]"
+let menutrans_help_dialog = "Wprowad¼ komendê lub s³owo, aby otrzymaæ pomoc o:\n\nPrzedrostek i_ oznacza komendê trybu Wprowadzania (np. i_CTRL-X)\nPrzedrostek c_ oznacza komendê edycji wiersza komend (np. c_<Del>)\nPrzedrostek ' oznacza nazwê opcji (np. 'shiftwidth')"
+let g:menutrans_path_dialog = "Wprowad¼ ¶cie¿kê poszukiwania plików.\nProszê rozdzielaæ nazwy katalogów przecinkiem."
+let g:menutrans_tags_dialog = "Podaj nazwy plików tagów.\nProszê rozdzielaæ nazwy przecinkiem."
+let g:menutrans_textwidth_dialog = "Wprowad¼ now± szeroko¶æ tekstu (0 wy³±cza przewijanie): "
+let g:menutrans_fileformat_dialog = "Wybierz format w którym ten plik ma byæ zapisany"
diff --git a/runtime/lang/menu_polish_poland.1250.vim b/runtime/lang/menu_polish_poland.1250.vim
new file mode 100644
index 000000000..189445269
--- /dev/null
+++ b/runtime/lang/menu_polish_poland.1250.vim
@@ -0,0 +1,259 @@
+" Menu Translations: Polish
+" Maintainer: Rafal M. Sulejman <rms@poczta.onet.pl>
+" Initial Translation: Marcin Dalecki <dalecki@cs.net.pl>
+" Last Change: 06 Sep 2001
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding cp1250
+
+" Help menu
+menutrans &Help Po&moc
+menutrans &Overview<Tab><F1> &Spis\ Treœci<Tab><F1>
+menutrans &How-to\ links &Odnoœniki\ JTZ
+menutrans &Credits Po&dziêkowania
+menutrans &User\ Manual Podrêcznik\ &u¿ytkownika
+menutrans Co&pying &Kopiowanie
+menutrans &Version &Wersja
+menutrans &About o\ &Aplikacji
+
+" File menu
+menutrans &File &Plik
+menutrans &Open\.\.\.<Tab>:e &Otwórz\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Otwórz\ z\ &podzia³em\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nowy<Tab>:enew
+menutrans &Close<Tab>:close &Zamknij<Tab>:close
+menutrans &Save<Tab>:w Za&pisz<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Zapisz\ &jako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Podziel\ na\ diff-a\ miêdzy\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Podziel\ ³atane\ przez\.\.\.
+menutrans &Print &Drukuj
+menutrans Sa&ve-Exit<Tab>:wqa Zapisz\ i\ w&yjdŸ<Tab>:wqa
+menutrans E&xit<Tab>:qa &Wyjœcie<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Edycja
+menutrans &Undo<Tab>u &Cofnij<Tab>u
+menutrans &Redo<Tab>^R &Ponów<Tab>^R
+menutrans Rep&eat<Tab>\. P&owtórz<Tab>\.
+menutrans Cu&t<Tab>"+x W&ytnij<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiuj<Tab>"+y
+menutrans &Paste<Tab>"+gP &Wklej<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Wstaw\ p&rzed<Tab>[p
+menutrans Put\ &After<Tab>]p Wstaw\ p&o<Tab>]p
+menutrans &Select\ all<Tab>ggVG Z&aznacz\ ca³oœæ<Tab>ggVG
+menutrans &Find\.\.\. &Szukaj\.\.\.
+menutrans &Find<Tab>/ &Szukaj<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. &Zamieñ\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s &Zamieñ<Tab>:%s
+menutrans Find\ and\ Rep&lace &Zamieñ
+menutrans Find\ and\ Rep&lace<Tab>:s &Zamieñ<Tab>:s
+menutrans Options\.\.\. Opcje\.\.\.
+menutrans Settings\ &Window Ustawienia
+menutrans &Global\ Settings Ustawienia\ &globalne
+menutrans F&ile\ Settings Ustawienia\ dla\ pliku
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &Numerowanie\ wierszy<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Tryb\ &listowania<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Za&wijanie\ wierszy<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! £amanie\ wie&rsza<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Rozwijani&e\ tabulatorów<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! &Automatyczne\ wciêcia<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Wciêcia\ &C<Tab>:set\ cin!
+menutrans &Shiftwidth &Szerokoœæ\ wciêcia
+menutrans Te&xt\ Width\.\.\. D³ugoœæ\ linii\.\.\.
+menutrans &File\ Format\.\.\. &Format\ pliku\.\.\.
+menutrans Soft\ &Tabstop Rozmiar\ &tabulacji
+menutrans C&olor\ Scheme Zestawy\ kolorów
+menutrans &Keymap Uk³ady\ klawiatury
+menutrans None ¿aden
+menutrans accents akcenty
+menutrans hebrew hebrajski
+menutrans hebrewp hebrajski\ p
+menutrans russian-jcuken rosyjski-jcuken
+menutrans russian-jcukenwin rosyjski-jcukenwin
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Podkreœlanie\ &wzorców<Tab>:set\ hls!
+
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &Ignorowanie\ wielkoœci<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Pokazywanie\ pasuj¹cych<Tab>:set\ sm!
+
+menutrans &Context\ lines Wiersze\ &kontekstowe
+menutrans &Virtual\ Edit Obróbka\ &wirtualna
+
+menutrans Never Nigdy
+menutrans Block\ Selection Zaznaczanie\ zakresu
+menutrans Insert\ mode Tryb\ wprowadzania
+menutrans Block\ and\ Insert Zakres\ i\ wprowadzanie
+menutrans Always Zawsze
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Tryb\ wprowadzania<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. Scie¿ka\ poszukiwania\.\.\.
+menutrans Ta&g\ Files\.\.\. Pliki\ tagów\.\.\.
+
+
+"
+" GUI options
+menutrans Toggle\ &Toolbar Pasek\ narzêdzi
+menutrans Toggle\ &Bottom\ Scrollbar Dolny\ przewijacz
+menutrans Toggle\ &Left\ Scrollbar &Lewy\ przewijacz
+menutrans Toggle\ &Right\ Scrollbar P&rawy\ przewijacz
+
+" Programming menu
+menutrans &Tools &Narzêdzia
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skocz\ do\ taga<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skok\ w\ &ty³<Tab>^T
+menutrans Build\ &Tags\ File &Twórz\ plik\ tagów
+" Folding
+menutrans &Folding &Zwijanie
+menutrans &Enable/Disable\ folds<Tab>zi &Zwiñ/rozwiñ<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Linia\ kursora<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx &Tylko\ linia\ kursora<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Zwiñ\ wiêcej<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Z&wiñ\ wszystkie<Tab>zM
+menutrans &Open\ all\ folds<Tab>zR Rozwiñ\ wszystkie<Tab>zR
+menutrans O&pen\ more\ folds<Tab>zr R&ozwiñ\ wiêcej<Tab>zr
+
+menutrans Create\ &Fold<Tab>zf T&wórz\ zawiniêcie<Tab>zf
+menutrans &Delete\ Fold<Tab>zd U&suñ\ zawiniêcie<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD &Usuñ\ wszystkie\ zawiniêcia<Tab>zD
+menutrans Fold\ column\ &width Szerokoœæ\ kolumny\ za&winiêæ
+menutrans Fold\ Met&hod Me&toda\ zawijania
+menutrans M&anual &Rêcznie
+menutrans I&ndent W&ciêcie
+menutrans E&xpression W&yrazenie
+menutrans S&yntax S&k³adnia
+menutrans Ma&rker Zn&acznik
+
+" Diff
+menutrans &Update &Odœwie¿
+menutrans &Get\ Block &Pobierz\ blok
+menutrans &Put\ Block &Wstaw\ blok
+
+" Make and stuff...
+menutrans &Make<Tab>:make M&ake<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Poka¿\ b³êdy<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! W&ylicz\ powiadomienia<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &Nastêpny\ b³¹d<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Poprzedni\ b³¹d<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Starsza\ lista<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew N&owsza\ lista<Tab>:cnew
+menutrans Error\ &Window Okno\ komu&nikatów
+menutrans &Update<Tab>:cwin Akt&ualizuj<Tab>:cwin
+menutrans &Close<Tab>:cclose &Zamknij<Tab>:cclose
+menutrans &Open<Tab>:copen &Otwórz<Tab>:copen
+
+menutrans &Set\ Compiler U&staw\ kompilator
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Kody\ szesnastkowe<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Zwyk³y\ tekst<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &Bufory
+menutrans &Refresh\ menu Odœwie¿
+menutrans Delete Skasuj
+menutrans &Alternate &Zmieñ
+menutrans &Next &Nastêpny
+menutrans &Previous &Poprzedni
+menutrans [No\ File] [Brak\ Pliku]
+
+" Window menu
+menutrans &Window &Widoki
+menutrans &New<Tab>^Wn &Nowy<Tab>^Wn
+menutrans S&plit<Tab>^Ws Po&dziel<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ P&odziel\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Podziel\ pionowo<Tab>^Wv
+menutrans Split\ File\ E&xplorer Otwórz\ mened¿er\ plików
+
+menutrans &Close<Tab>^Wc &Zamknij<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zamknij\ &inne<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &Nastêpny<Tab>^Ww
+menutrans P&revious<Tab>^WW &Poprzedni<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Wyrównaj\ wysokoœci<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Z&maksymalizuj\ wysokoϾ<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Zminim&alizuj\ wysokoϾ<Tab>^W1_
+menutrans Max\ Width<Tab>^W\| Maksymalna\ szerokoϾ<Tab>^W\|
+menutrans Min\ Width<Tab>^W1\| Minimalna\ szerokoϾ<Tab>^W1\|
+menutrans Max\ &Width<Tab>^W\| Zmaksymalizuj\ szerokoϾ<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Zminimalizuj\ szerokoϾ<Tab>^W1\|
+menutrans Move\ &To &IdŸ\ do
+menutrans &Top<Tab>^WK &Góra<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Dó³<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Lewa\ strona<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Prawa\ strona<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Obróæ\ w\ &górê<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Obróæ\ w\ &dó³<Tab>^Wr
+menutrans Split\ &Vertically<Tab>^Wv &Podziel\ w\ poziomie<Tab>^Wv
+menutrans Select\ Fo&nt\.\.\. Wybierz\ &czcionkê\.\.\.
+
+" The popup menu
+menutrans &Undo &Cofnij
+menutrans Cu&t W&ytnij
+menutrans &Copy &Kopiuj
+menutrans &Paste &Wklej
+menutrans &Delete &Skasuj
+menutrans Select\ Blockwise Zaznacz\ &blok
+menutrans Select\ &Word Zaznacz\ &s³owo
+menutrans Select\ &Line Zaznacz\ w&iersz
+menutrans Select\ &Block Zaznacz\ &blok
+menutrans Select\ &All Zaznacz\ c&a³oœæ
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otwórz plik
+ tmenu ToolBar.Save Zapisz bie¿¹cy plik
+ tmenu ToolBar.SaveAll Zapisz wszystkie pliki
+ tmenu ToolBar.Print Drukuj
+ tmenu ToolBar.Undo Cofnij
+ tmenu ToolBar.Redo Ponów
+ tmenu ToolBar.Cut Wytnij
+ tmenu ToolBar.Copy Skopiuj
+ tmenu ToolBar.Paste Wklej
+ tmenu ToolBar.Find Szukaj...
+ tmenu ToolBar.FindNext Szukaj nastêpnego
+ tmenu ToolBar.FindPrev Szukaj poprzedniego
+ tmenu ToolBar.Replace Szukaj i zamieniaj...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nowy widok
+ tmenu ToolBar.WinSplit Podziel widok
+ tmenu ToolBar.WinMax Zmaksymalizuj widok
+ tmenu ToolBar.WinMin Zminimalizuj widok
+ tmenu ToolBar.WinClose Zamknij widok
+ endif
+ tmenu ToolBar.LoadSesn Za³aduj sesjê
+ tmenu ToolBar.SaveSesn Zachowaj bie¿¹c¹ sesjê
+ tmenu ToolBar.RunScript Uruchom skrypt Vima
+ tmenu ToolBar.Make Wykonaj bie¿¹cy projekt
+ tmenu ToolBar.Shell Otwórz pow³okê
+ tmenu ToolBar.RunCtags Twórz tagi w bie¿¹cym katalogu
+ tmenu ToolBar.TagJump Skok do taga pod kursorem
+ tmenu ToolBar.Help Pomoc Vima
+ tmenu ToolBar.FindHelp Przeszukuj pomoc Vim-a
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sk³adnia
+menutrans Set\ '&syntax'\ only Ustaw\ tylko\ '&syntax'
+menutrans Set\ '&filetype'\ too Ustaw\ równie¿\ '&filetype'
+menutrans &Off &Wy³¹cz
+menutrans &Manual &Rêcznie
+menutrans A&utomatic A&utomatyczne
+menutrans on/off\ for\ &This\ file w³¹cz/w&y³¹cz\ dla\ pliku
+menutrans Co&lor\ test Test\ &kolorów
+menutrans &Highlight\ test &Test\ podœwietlania
+menutrans &Convert\ to\ HTML Przetwórz\ na\ &HTML
+
+" dialog texts
+let menutrans_no_file = "[Brak pliku]"
+let menutrans_help_dialog = "WprowadŸ komendê lub s³owo, aby otrzymaæ pomoc o:\n\nPrzedrostek i_ oznacza komendê trybu Wprowadzania (np. i_CTRL-X)\nPrzedrostek c_ oznacza komendê edycji wiersza komend (np. c_<Del>)\nPrzedrostek ' oznacza nazwê opcji (np. 'shiftwidth')"
+let g:menutrans_path_dialog = "WprowadŸ œcie¿kê poszukiwania plików.\nProszê rozdzielaæ nazwy katalogów przecinkiem."
+let g:menutrans_tags_dialog = "Podaj nazwy plików tagów.\nProszê rozdzielaæ nazwy przecinkiem."
+let g:menutrans_textwidth_dialog = "WprowadŸ now¹ szerokoœæ tekstu (0 wy³¹cza przewijanie): "
+let g:menutrans_fileformat_dialog = "Wybierz format w którym ten plik ma byæ zapisany"
diff --git a/runtime/lang/menu_pt_br.latin1.vim b/runtime/lang/menu_pt_br.latin1.vim
new file mode 100644
index 000000000..bed948748
--- /dev/null
+++ b/runtime/lang/menu_pt_br.latin1.vim
@@ -0,0 +1,3 @@
+" Menu translations: Portuguese
+
+source <sfile>:p:h/menu_pt_br.vim
diff --git a/runtime/lang/menu_pt_br.utf-8.vim b/runtime/lang/menu_pt_br.utf-8.vim
new file mode 100644
index 000000000..4879c2414
--- /dev/null
+++ b/runtime/lang/menu_pt_br.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu translations: Portuguese for UTF-8 encoding
+
+source <sfile>:p:h/menu_pt_br.vim
diff --git a/runtime/lang/menu_pt_br.vim b/runtime/lang/menu_pt_br.vim
new file mode 100644
index 000000000..eaad26fb9
--- /dev/null
+++ b/runtime/lang/menu_pt_br.vim
@@ -0,0 +1,265 @@
+" Menu Translations: Português
+" Maintainer: José de Paula <jose_de_paula@ig.com.br>
+" Last Change: 2003 Jun 12
+"
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" Translations in latin1 (ISO-8859-1), and should work in
+" latin9 (ISO-8859-15)
+
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+" Help menu
+menutrans &Help A&juda
+menutrans &Overview<Tab><F1> &Conteúdo
+menutrans &User\ Manual &Manual\ do\ Usuário
+menutrans &How-to\ links &Como\ fazer?
+menutrans &Find\.\.\. &Procurar\.\.\.
+menutrans &Credits &Créditos
+menutrans O&rphans &Órfãos
+menutrans Co&pying &Licença
+menutrans &Version &Versão
+menutrans &About &Sobre
+
+" File menu
+menutrans &File &Arquivo
+menutrans &Open\.\.\.<Tab>:e A&brir\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Ab&rir\ em\ outra\ janela\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Novo<Tab>:enew
+menutrans &Close<Tab>:close &Fechar<Tab>:close
+menutrans &Save<Tab>:w &Salvar<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Sa&lvar\ como\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. &Exibir\ diferenças\ com\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Ex&ibir\ patcheado\ por\.\.\.
+menutrans &Print I&mprimir
+menutrans Sa&ve-Exit<Tab>:wqa Sal&var\ e\ sair<Tab>:wqa
+menutrans E&xit<Tab>:qa Sai&r<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Editar
+menutrans &Undo<Tab>u &Desfazer<Tab>u
+menutrans &Redo<Tab>^R &Refazer<Tab>u
+menutrans Rep&eat<Tab>\. Repe&tir<Tab>\.
+menutrans Cu&t<Tab>"+x Re&cortar<Tab>"+x
+menutrans &Copy<Tab>"+y Cop&iar<Tab>"+y
+menutrans &Paste<Tab>"+gP C&olar<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Colocar\ &antes<Tab>[p
+menutrans Put\ &After<Tab>]p Colocar\ &depois<Tab>]p
+menutrans &Select\ all<Tab>ggVG &Selecionar\ tudo<Tab>ggVG
+menutrans &Find\.\.\. &Procurar\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Procurar\ e\ substit&uir\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Procurar\ e\ substit&uir<Tab>:%s
+menutrans Find\ and\ Rep&lace Procurar\ e\ substit&uir
+menutrans Find\ and\ Rep&lace<Tab>:s Procurar\ e\ substituir<Tab>:s
+menutrans Settings\ &Window Op&ções
+
+" Edit/Global Settings
+menutrans &Global\ Settings Opções\ &Globais
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ativar/Desativar\ &Realce\ de\ Padrões<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Ativar/Desativar\ &Ignorar\ maiúsculas<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Ativar/Desativar\ &coincidências<Tab>:set\ sm!
+
+menutrans &Context\ lines Linhas\ de\ C&ontexto
+
+menutrans &Virtual\ Edit Edição\ &Virtual
+menutrans Never Nunca
+menutrans Block\ Selection Seleção\ de\ Bloco
+menutrans Insert\ mode Modo\ de\ inserção
+menutrans Block\ and\ Insert Bloco\ e\ inserção
+menutrans Always Sempre
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Ativar/Desativar\ Modo\ de\ In&serção<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Ativar/Desativar\ Co&mpatibilidade\ com\ Vi<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Camin&ho\ de\ Busca\.\.\.
+menutrans Ta&g\ Files\.\.\. Arquivos\ de\ Tags\.\.\.
+
+" GUI options
+menutrans Toggle\ &Toolbar Ocultar/Exibir\ Barra\ de\ &Ferramentas
+menutrans Toggle\ &Bottom\ Scrollbar Ocultar/Exibir\ Barra\ de\ &Rolagem\ Inferior
+menutrans Toggle\ &Left\ Scrollbar Ocultar/Exibir\ Barra\ de\ R&olagem\ Esquerda
+menutrans Toggle\ &Right\ Scrollbar Ocultar/Exibir\ Barra\ de\ Ro&lagem\ Direita
+let g:menutrans_path_dialog = "Indique um caminho de procura para os arquivos.\nSepare os nomes dos diretórios com uma vírgula."
+let g:menutrans_tags_dialog = "Indique os nomes dos arquivos de tags.\nSepare os nomes com uma vírgula."
+
+" Edit/File Settings
+menutrans F&ile\ Settings Opções\ do\ &Arquivo
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Ativar/Desativar\ &numeração\ de\ linhas<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Ativar/Desativar\ modo\ &list<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Ativar/Desativar\ &quebra\ de\ linhas<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Ativar/Desativar\ quebra\ na\ &palavra<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Ativar/Desativar\ expansão de tabs<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Ativar/Desativar\ &auto-indentação<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Ativar/Desativar\ indentação estilo &C<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth Largura\ da\ &indentação
+
+menutrans Soft\ &Tabstop &Tabulação\ com\ espaços
+
+menutrans Te&xt\ Width\.\.\. Largura\ do\ te&xto\.\.\.
+let g:menutrans_textwidth_dialog = "Digite a nova largura do texto (0 para desativar a formatação): "
+
+menutrans &File\ Format\.\.\. &Formato\ do\ arquivo\.\.\.
+let g:menutrans_fileformat_dialog = "Selecione o formato para gravar o arquivo"
+
+menutrans C&olor\ Scheme Esquema\ de\ c&ores
+menutrans default padrão
+
+menutrans Select\ Fo&nt\.\.\. Selecionar\ fo&nte\.\.\.
+
+menutrans &Keymap Mapa\ de\ teclado
+menutrans None Nenhum
+
+" Programming menu
+menutrans &Tools &Ferramentas
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Pular\ para\ este\ tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T &Voltar<Tab>^T
+menutrans Build\ &Tags\ File &Construir\ Arquivo\ de\ tags
+menutrans &Folding &Dobra
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Lista\ de\ erros<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Li&sta\ de\ mensagens<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn P&róximo\ erro<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Erro\ anterior<Tab>:cp
+menutrans &Older\ List<Tab>:cold Listar\ erros\ &antigos<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Listar\ erros\ &novos<Tab>:cnew
+menutrans Error\ &Window &Janela\ de\ erros
+menutrans &Set\ Compiler Def&inir\ Compilador
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Converter\ para\ hexadecimal<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Conver&ter\ de\ volta<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi &Ativar/Desativar\ dobras<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Ver\ linha\ do\ cursor<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ve&r\ somente\ linha\ do\ cursor<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Fechar\ mais\ dobras<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM F&echar\ todas\ as\ dobras<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr A&brir\ mais\ dobras<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Abr&ir\ todas\ as\ dobras<Tab>zR
+" fold method
+menutrans Fold\ Met&hod &Modo\ de\ dobras
+menutrans Create\ &Fold<Tab>zf Criar\ &dobras<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Remover\ d&obras<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Remover\ &todas\ as\ dobras<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width &Largura\ da\ coluna\ da\ dobra
+
+" Tools.Diff Menu
+menutrans &Update &Atualizar
+menutrans &Get\ Block &Obter\ Bloco
+menutrans &Put\ Block &Pôr\ Bloco
+
+" Tools.Error Menu
+menutrans &Update<Tab>:cwin &Atualizar<Tab>:cwin
+menutrans &Open<Tab>:copen A&brir<Tab>:copen
+menutrans &Close<Tab>:cclose &Fechar<Tab>:cclose
+
+" Names for buffer menu.
+menutrans &Buffers &Buffers
+menutrans &Refresh\ menu A&tualizar\ menu
+menutrans &Delete &Apagar
+menutrans &Alternate A&lternar
+menutrans &Next P&róximo
+menutrans &Previous A&nterior
+let g:menutrans_no_file = "[Sem arquivos]"
+
+" Window menu
+menutrans &Window &Janela
+menutrans &New<Tab>^Wn N&ova<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Dividir<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ D&ividir\ para\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Dividir\ &verticalmente<Tab>^Wv
+menutrans Split\ File\ E&xplorer &Abrir\ Gerenciador\ de\ arquivos
+menutrans &Close<Tab>^Wc &Fechar<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Fechar\ &outra(s)<Tab>^Wo
+menutrans Move\ &To Mover\ &para
+menutrans &Top<Tab>^WK A&cima<Tab>^WK
+menutrans &Bottom<Tab>^WJ A&baixo<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Lado\ &esquerdo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Lado\ di&reito<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR &Girar\ para\ cima<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Girar\ para\ bai&xo<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= Mesmo\ &Tamanho<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Altura\ &Máxima<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ A&ltura\ Mínima<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Larg&ura\ Máxima<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Largura\ Mí&nima<Tab>^W1\|
+
+" The popup menu
+menutrans &Undo &Desfazer
+menutrans Cu&t Recor&tar
+menutrans &Copy &Copiar
+menutrans &Paste Co&lar
+menutrans &Delete &Apagar
+menutrans Select\ Blockwise Seleção\ de\ bloco
+menutrans Select\ &Word Selecionar\ &Palavra
+menutrans Select\ &Line Selecionar\ L&inha
+menutrans Select\ &All Selecionar\ T&udo
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Abrir Arquivo
+ tmenu ToolBar.Save Salvar Arquivo
+ tmenu ToolBar.SaveAll Salvar Todos os arquivos
+ tmenu ToolBar.Print Imprimir
+ tmenu ToolBar.Undo Desfazer
+ tmenu ToolBar.Redo Refazer
+ tmenu ToolBar.Cut Recortar
+ tmenu ToolBar.Copy Copiar
+ tmenu ToolBar.Paste Colar
+ tmenu ToolBar.Find Procurar...
+ tmenu ToolBar.FindNext Procurar Próximo
+ tmenu ToolBar.FindPrev Procurar Anterior
+ tmenu ToolBar.Replace Procurar e Substituir
+ if 0 " disable; these are in the Windoze menu
+ tmenu ToolBar.New Nova Janela
+ tmenu ToolBar.WinSplit Dividir Janela
+ tmenu ToolBar.WinMax Janela Máxima
+ tmenu ToolBar.WinMin Janela Mínima
+ tmenu ToolBar.WinVSplit Dividir Verticalmente
+ tmenu ToolBar.WinMaxWidth Largura Máxima
+ tmenu ToolBar.WinMinWidth Largura Mínima
+ tmenu ToolBar.WinClose Fechar Janela
+ endif
+ tmenu ToolBar.LoadSesn Carregar Sessão
+ tmenu ToolBar.SaveSesn Salvar Sessão
+ tmenu ToolBar.RunScript Executar script
+ tmenu ToolBar.Make Make
+ tmenu ToolBar.Shell Abrir um shell
+ tmenu ToolBar.RunCtags Gerar um arquivo de tags
+ tmenu ToolBar.TagJump Saltar para um tag
+ tmenu ToolBar.Help Ajuda
+ tmenu ToolBar.FindHelp Procurar na Ajuda
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaxe
+"menutrans &Show\ individual\ choices E&xibir\ escolhas\ individuais
+menutrans &Show\ filetypes\ in\ menu E&xibir\ tipos\ de\ arquivos\ no\ menu
+menutrans Set\ '&syntax'\ only Ativar\ somente\ s&intaxe
+menutrans Set\ '&filetype'\ too Ativar\ também\ &tipo\ de\ arquivo
+menutrans &Off &Desativar
+menutrans &Manual &Manual
+menutrans A&utomatic A&utomática
+menutrans on/off\ for\ &This\ file Ativar/Desativar\ neste\ &arquivo
+menutrans Co&lor\ test T&este\ de\ cores
+menutrans &Highlight\ test Teste\ de\ &realce
+menutrans &Convert\ to\ HTML &Converter\ para\ HTML
+
+" Find Help dialog text
+let g:menutrans_help_dialog = "Digite um comando ou palavra para obter ajuda;\n\nAnteponha i_ para comandos de entrada (ex.: i_CTRL-X)\nAnteponha c_ para comandos da linha de comandos (ex.: c_<Del>)\nAnteponha ` para um nome de opção (ex.: `shiftwidth`)"
diff --git a/runtime/lang/menu_pt_pt.latin1.vim b/runtime/lang/menu_pt_pt.latin1.vim
new file mode 100644
index 000000000..7fc73d14e
--- /dev/null
+++ b/runtime/lang/menu_pt_pt.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Português
+
+source <sfile>:p:h/menu_pt_pt.vim
diff --git a/runtime/lang/menu_pt_pt.utf-8.vim b/runtime/lang/menu_pt_pt.utf-8.vim
new file mode 100644
index 000000000..7fc73d14e
--- /dev/null
+++ b/runtime/lang/menu_pt_pt.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Português
+
+source <sfile>:p:h/menu_pt_pt.vim
diff --git a/runtime/lang/menu_pt_pt.vim b/runtime/lang/menu_pt_pt.vim
new file mode 100644
index 000000000..28b9726ff
--- /dev/null
+++ b/runtime/lang/menu_pt_pt.vim
@@ -0,0 +1,264 @@
+" Menu Translations: Português
+" adaptado de pt_br.
+" Maintainer: Duarte Henriques <duarte_henriques@myrealbox.com>
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" Translations in latin1 (ISO-8859-1), and should work in
+" latin9 (ISO-8859-15)
+
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+" Help menu
+menutrans &Help A&juda
+menutrans &Overview<Tab><F1> &Conteúdo
+menutrans &User\ Manual &Manual\ do\ Utilizador
+menutrans &How-to\ links &Como\ fazer?
+menutrans &Find\.\.\. &Procurar\.\.\.
+menutrans &Credits &Créditos
+menutrans O&rphans &Órfãos
+menutrans Co&pying &Licença
+menutrans &Version &Versão
+menutrans &About &Sobre
+
+" File menu
+menutrans &File &Ficheiro
+menutrans &Open\.\.\.<Tab>:e A&brir\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Abrir\ noutra\ &janela\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Novo<Tab>:enew
+menutrans &Close<Tab>:close &Fechar<Tab>:close
+menutrans &Save<Tab>:w &Guardar<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Gu&ardar\ como\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. &Exibir\ diferenças\ com\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Ex&ibir\ patcheado\ por\.\.\.
+menutrans &Print Im&primir
+menutrans Sa&ve-Exit<Tab>:wqa Gua&rdar\ e\ sair<Tab>:wqa
+menutrans E&xit<Tab>:qa Sai&r<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Editar
+menutrans &Undo<Tab>u &Desfazer<Tab>u
+menutrans &Redo<Tab>^R &Refazer<Tab>u
+menutrans Rep&eat<Tab>\. Repe&tir<Tab>\.
+menutrans Cu&t<Tab>"+x &Cortar<Tab>"+x
+menutrans &Copy<Tab>"+y Cop&iar<Tab>"+y
+menutrans &Paste<Tab>"+gP C&olar<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Colocar\ &antes<Tab>[p
+menutrans Put\ &After<Tab>]p Colocar\ &depois<Tab>]p
+menutrans &Select\ all<Tab>ggVG &Seleccionar\ tudo<Tab>ggVG
+menutrans &Find\.\.\. &Procurar\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Procurar\ e\ substit&uir\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Procurar\ e\ substit&uir<Tab>:%s
+menutrans Find\ and\ Rep&lace Procurar\ e\ substit&uir
+menutrans Find\ and\ Rep&lace<Tab>:s Procurar\ e\ substituir<Tab>:s
+menutrans Settings\ &Window Op&ções
+
+" Edit/Global Settings
+menutrans &Global\ Settings Opções\ &Globais
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Activar/Desactivar\ &Realce\ de\ Padrões<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Activar/Desactivar\ &Ignorar\ maiúsculas<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Activar/Desactivar\ &coincidências<Tab>:set\ sm!
+
+menutrans &Context\ lines Linhas\ de\ C&ontexto
+
+menutrans &Virtual\ Edit Edição\ &Virtual
+menutrans Never Nunca
+menutrans Block\ Selection Seleção\ de\ Bloco
+menutrans Insert\ mode Modo\ de\ inserção
+menutrans Block\ and\ Insert Bloco\ e\ inserção
+menutrans Always Sempre
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Activar/Desactivar\ Modo\ de\ In&serção<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Activar/Desactivar\ Co&mpatibilidade\ com\ Vi<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Camin&ho\ de\ Busca\.\.\.
+menutrans Ta&g\ Files\.\.\. Arquivos\ de\ Tags\.\.\.
+
+" GUI options
+menutrans Toggle\ &Toolbar Ocultar/Exibir\ Barra\ de\ &Ferramentas
+menutrans Toggle\ &Bottom\ Scrollbar Ocultar/Exibir\ Barra\ de\ &Rolagem\ Inferior
+menutrans Toggle\ &Left\ Scrollbar Ocultar/Exibir\ Barra\ de\ R&olagem\ Esquerda
+menutrans Toggle\ &Right\ Scrollbar Ocultar/Exibir\ Barra\ de\ Ro&lagem\ Direita
+let g:menutrans_path_dialog = "Indique um caminho de procura para os arquivos.\nSepare os nomes dos diretórios com uma vírgula."
+let g:menutrans_tags_dialog = "Indique os nomes dos arquivos de tags.\nSepare os nomes com uma vírgula."
+
+" Edit/File Settings
+menutrans F&ile\ Settings Opções\ do\ &Arquivo
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Activar/Desactivar\ &numeração\ de\ linhas<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Activar/Desactivar\ modo\ &list<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Activar/Desactivar\ &quebra\ de\ linhas<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Activar/Desactivar\ quebra\ na\ &palavra<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Activar/Desactivar\ expansão de tabs<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Activar/Desactivar\ &auto-indentação<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Activar/Desactivar\ indentação estilo &C<Tab>:set\ cin!
+
+" other options
+menutrans &Shiftwidth Largura\ da\ &indentação
+
+menutrans Soft\ &Tabstop &Tabulação\ com\ espaços
+
+menutrans Te&xt\ Width\.\.\. Largura\ do\ te&xto\.\.\.
+let g:menutrans_textwidth_dialog = "Digite a nova largura do texto (0 para desativar a formatação): "
+
+menutrans &File\ Format\.\.\. &Formato\ do\ arquivo\.\.\.
+let g:menutrans_fileformat_dialog = "Selecione o formato para gravar o arquivo"
+
+menutrans C&olor\ Scheme Esquema\ de\ c&ores
+menutrans default padrão
+
+menutrans Select\ Fo&nt\.\.\. Seleccionar\ fo&nte\.\.\.
+
+menutrans &Keymap Mapa\ de\ teclado
+menutrans None Nenhum
+
+" Programming menu
+menutrans &Tools Fe&rramentas
+menutrans &Jump\ to\ this\ tag<Tab>g^] Saltar\ para\ esta\ &tag<Tab>g^]
+menutrans Jump\ &back<Tab>^T &Voltar<Tab>^T
+menutrans Build\ &Tags\ File &Construir\ Arquivo\ de\ tags
+menutrans &Folding &Dobra
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl &Lista\ de\ erros<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Li&sta\ de\ mensagens<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn P&róximo\ erro<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Erro\ anterior<Tab>:cp
+menutrans &Older\ List<Tab>:cold Listar\ erros\ &antigos<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Listar\ erros\ &novos<Tab>:cnew
+menutrans Error\ &Window &Janela\ de\ erros
+menutrans &Set\ Compiler Def&inir\ Compilador
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Converter\ para\ hexadecimal<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Conver&ter\ de\ volta<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi &Activar/Desactivar\ dobras<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Ver\ linha\ do\ cursor<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ve&r\ somente\ linha\ do\ cursor<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Fechar\ mais\ dobras<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM F&echar\ todas\ as\ dobras<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr A&brir\ mais\ dobras<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Abr&ir\ todas\ as\ dobras<Tab>zR
+" fold method
+menutrans Fold\ Met&hod &Modo\ de\ dobras
+menutrans Create\ &Fold<Tab>zf Criar\ &dobras<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Remover\ d&obras<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Remover\ &todas\ as\ dobras<Tab>zD
+" moving around in folds
+menutrans Fold\ col&umn\ width &Largura\ da\ coluna\ da\ dobra
+
+" Tools.Diff Menu
+menutrans &Update &Actualizar
+menutrans &Get\ Block &Obter\ Bloco
+menutrans &Put\ Block &Pôr\ Bloco
+
+" Tools.Error Menu
+menutrans &Update<Tab>:cwin &Actualizar<Tab>:cwin
+menutrans &Open<Tab>:copen A&brir<Tab>:copen
+menutrans &Close<Tab>:cclose &Fechar<Tab>:cclose
+
+" Names for buffer menu.
+menutrans &Buffers &Buffers
+menutrans &Refresh\ menu A&ctualizar\ menu
+menutrans &Delete &Apagar
+menutrans &Alternate A&lternar
+menutrans &Next P&róximo
+menutrans &Previous A&nterior
+let g:menutrans_no_file = "[Sem arquivos]"
+
+" Window menu
+menutrans &Window &Janela
+menutrans &New<Tab>^Wn N&ova<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Dividir<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ D&ividir\ para\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Dividir\ &verticalmente<Tab>^Wv
+menutrans Split\ File\ E&xplorer &Abrir\ Gerenciador\ de\ arquivos
+menutrans &Close<Tab>^Wc &Fechar<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Fechar\ &outra(s)<Tab>^Wo
+menutrans Move\ &To Mover\ &para
+menutrans &Top<Tab>^WK A&cima<Tab>^WK
+menutrans &Bottom<Tab>^WJ A&baixo<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Lado\ &esquerdo<Tab>^WH
+menutrans &Right\ side<Tab>^WL Lado\ di&reito<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR &Girar\ para\ cima<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Girar\ para\ bai&xo<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= Mesmo\ &Tamanho<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Altura\ &Máxima<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ A&ltura\ Mínima<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Larg&ura\ Máxima<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Largura\ Mí&nima<Tab>^W1\|
+
+" The popup menu
+menutrans &Undo &Desfazer
+menutrans Cu&t Recor&tar
+menutrans &Copy &Copiar
+menutrans &Paste Co&lar
+menutrans &Delete &Apagar
+menutrans Select\ Blockwise Seleção\ de\ bloco
+menutrans Select\ &Word Seleccionar\ &Palavra
+menutrans Select\ &Line Seleccionar\ L&inha
+menutrans Select\ &All Seleccionar\ T&udo
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Abrir Arquivo
+ tmenu ToolBar.Save Salvar Arquivo
+ tmenu ToolBar.SaveAll Salvar Todos os arquivos
+ tmenu ToolBar.Print Imprimir
+ tmenu ToolBar.Undo Desfazer
+ tmenu ToolBar.Redo Refazer
+ tmenu ToolBar.Cut Recortar
+ tmenu ToolBar.Copy Copiar
+ tmenu ToolBar.Paste Colar
+ tmenu ToolBar.Find Procurar...
+ tmenu ToolBar.FindNext Procurar Próximo
+ tmenu ToolBar.FindPrev Procurar Anterior
+ tmenu ToolBar.Replace Procurar e Substituir
+ if 0 " disable; these are in the Windoze menu
+ tmenu ToolBar.New Nova Janela
+ tmenu ToolBar.WinSplit Dividir Janela
+ tmenu ToolBar.WinMax Janela Máxima
+ tmenu ToolBar.WinMin Janela Mínima
+ tmenu ToolBar.WinVSplit Dividir Verticalmente
+ tmenu ToolBar.WinMaxWidth Largura Máxima
+ tmenu ToolBar.WinMinWidth Largura Mínima
+ tmenu ToolBar.WinClose Fechar Janela
+ endif
+ tmenu ToolBar.LoadSesn Carregar Sessão
+ tmenu ToolBar.SaveSesn Salvar Sessão
+ tmenu ToolBar.RunScript Executar script
+ tmenu ToolBar.Make Make
+ tmenu ToolBar.Shell Abrir um shell
+ tmenu ToolBar.RunCtags Gerar um arquivo de tags
+ tmenu ToolBar.TagJump Saltar para um tag
+ tmenu ToolBar.Help Ajuda
+ tmenu ToolBar.FindHelp Procurar na Ajuda
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaxe
+"menutrans &Show\ individual\ choices E&xibir\ escolhas\ individuais
+menutrans &Show\ filetypes\ in\ menu E&xibir\ tipos\ de\ arquivos\ no\ menu
+menutrans Set\ '&syntax'\ only Activar\ somente\ s&intaxe
+menutrans Set\ '&filetype'\ too Activar\ também\ &tipo\ de\ arquivo
+menutrans &Off &Desactivar
+menutrans &Manual &Manual
+menutrans A&utomatic A&utomática
+menutrans on/off\ for\ &This\ file Activar/Desactivar\ neste\ &arquivo
+menutrans Co&lor\ test T&este\ de\ cores
+menutrans &Highlight\ test Teste\ de\ &realce
+menutrans &Convert\ to\ HTML &Converter\ para\ HTML
+
+" Find Help dialog text
+let g:menutrans_help_dialog = "Digite um comando ou palavra para obter ajuda;\n\nAnteponha i_ para comandos de entrada (ex.: i_CTRL-X)\nAnteponha c_ para comandos da linha de comandos (ex.: c_<Del>)\nAnteponha ` para um nome de opção (ex.: `shiftwidth`)"
diff --git a/runtime/lang/menu_ru.utf-8.vim b/runtime/lang/menu_ru.utf-8.vim
new file mode 100644
index 000000000..20b0b2d5a
--- /dev/null
+++ b/runtime/lang/menu_ru.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Russian
+
+source <sfile>:p:h/menu_ru_ru.vim
diff --git a/runtime/lang/menu_ru_ru.koi8-r.vim b/runtime/lang/menu_ru_ru.koi8-r.vim
new file mode 100644
index 000000000..94d78a79a
--- /dev/null
+++ b/runtime/lang/menu_ru_ru.koi8-r.vim
@@ -0,0 +1,294 @@
+" Menu Translations: Russian
+" Maintainer: vassily ragosin <vrr[at]users.sourceforge.net>
+" Last Change: 26 Apr 2004
+" URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim
+"
+" $Id$
+"
+" Adopted for RuVim project by Vassily Ragosin.
+" First translation: Tim Alexeevsky <realtim [at] mail.ru>,
+" based on ukrainian translation by Bohdan Vlasyuk <bohdan@vstu.edu.ua>
+"
+"
+" Quit when menu translations have already been done.
+"
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding koi8-r
+
+" Top
+menutrans &File &æÁÊÌ
+menutrans &Edit ð&ÒÁ×ËÁ
+menutrans &Tools &éÎÓÔÒÕÍÅÎÔÙ
+menutrans &Syntax &óÉÎÔÁËÓÉÓ
+menutrans &Buffers &âÕÆÅÒÙ
+menutrans &Window &ïËÎÏ
+menutrans &Help ó&ÐÒÁ×ËÁ
+"
+"
+"
+" Help menu
+menutrans &Overview<Tab><F1> &ïÂÚÏÒ<Tab><F1>
+menutrans &User\ Manual òÕËÏ×Ï&ÄÓÔ×Ï\ ÐÏÌØÚÏ×ÁÔÅÌÑ
+menutrans &How-to\ links &ëÁË\ ÜÔÏ\ ÓÄÅÌÁÔØ\.\.\.
+menutrans &Find\.\.\. &ðÏÉÓË
+"--------------------
+menutrans &Credits &âÌÁÇÏÄÁÒÎÏÓÔÉ
+menutrans Co&pying &òÁÓÐÒÏÓÔÒÁÎÅÎÉÅ
+menutrans &Sponsor/Register ðÏÍÏ&ÝØ/òÅÇÉÓÔÒÁÃÉÑ
+menutrans O&rphans &óÉÒÏÔÙ
+"--------------------
+menutrans &Version &éÎÆÏÒÍÁÃÉÑ\ Ï\ ÐÒÏÇÒÁÍÍÅ
+menutrans &About &úÁÓÔÁ×ËÁ
+"
+"
+" File menu
+menutrans &Open\.\.\.<Tab>:e &ïÔËÒÙÔØ\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ðÏ&ÄÅÌÉÔØ\ ÏËÎÏ\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &îÏ×ÙÊ<Tab>:enew
+menutrans &Close<Tab>:close &úÁËÒÙÔØ<Tab>:close
+"--------------------
+menutrans &Save<Tab>:w &óÏÈÒÁÎÉÔØ<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav óÏÈÒÁÎÉÔØ\ &ËÁË\.\.\.<Tab>:sav
+"--------------------
+menutrans Split\ &Diff\ with\.\.\. óÒ&Á×ÎÉÔØ\ Ó\.\.\.
+menutrans Split\ Patched\ &By\.\.\. óÒÁ×ÎÉÔØ\ Ó\ ÐÒÉÍÅÎÅÎÉÅÍ\ ÚÁÐ&ÌÁÔËÉ\.\.\.
+"--------------------
+menutrans &Print îÁ&ÐÅÞÁÔÁÔØ
+menutrans Sa&ve-Exit<Tab>:wqa ÷Ù&ÈÏÄ\ Ó\ ÓÏÈÒÁÎÅÎÉÅÍ<Tab>:wqa
+menutrans E&xit<Tab>:qa &÷ÙÈÏÄ<Tab>:qa
+"
+"
+" Edit menu
+menutrans &Undo<Tab>u ï&ÔÍÅÎÉÔØ<Tab>u
+menutrans &Redo<Tab>^R ÷&ÅÒÎÕÔØ<Tab>^R
+menutrans Rep&eat<Tab>\. ðÏ×ÔÏÒÉÔ&Ø<Tab>\.
+"--------------------
+menutrans Cu&t<Tab>"+x &÷ÙÒÅÚÁÔØ<Tab>"+x
+menutrans &Copy<Tab>"+y &ëÏÐÉÒÏ×ÁÔØ<Tab>"+y
+menutrans &Paste<Tab>"+gP ÷Ë&ÌÅÉÔØ<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ÷ËÌÅÉÔØ\ ÐÅÒÅ&Ä<Tab>[p
+menutrans Put\ &After<Tab>]p ÷ËÌÅÉÔØ\ ÐÏ&ÓÌÅ<Tab>]p
+menutrans &Delete<Tab>x &õÄÁÌÉÔØ<Tab>x
+menutrans &Select\ All<Tab>ggVG ÷&ÙÄÅÌÉÔØ\ ×Ó£<Tab>ggVG
+"--------------------
+menutrans &Find\.\.\.<Tab>/ &ðÏÉÓË\.\.\.<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. ðÏÉÓË\ É\ &ÚÁÍÅÎÁ\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\.<Tab>:%s ðÏÉÓË\ É\ &ÚÁÍÅÎÁ\.\.\.<Tab>:%s
+menutrans Find\ and\ Rep&lace\.\.\.<Tab>:s ðÏÉÓË\ É\ &ÚÁÍÅÎÁ\.\.\.<Tab>:s
+"--------------------
+menutrans Settings\ &Window ïËÎÏ\ ÎÁÓÔÒÏÊËÉ\ &ÏÐÃÉÊ
+menutrans &Global\ Settings &çÌÏÂÁÌØÎÙÅ\ ÎÁÓÔÒÏÊËÉ
+menutrans F&ile\ Settings îÁÓÔÒÏÊËÉ\ &ÆÁÊÌÏ×
+menutrans C&olor\ Scheme &ã×ÅÔÏ×ÁÑ\ ÓÈÅÍÁ
+menutrans &Keymap òÁÓËÌÁÄËÁ\ ËÌ&Á×ÉÁÔÕÒÙ
+menutrans Select\ Fo&nt\.\.\. ÷ÙÂÏÒ\ &ÛÒÉÆÔÁ\.\.\.
+">>>----------------- Edit/Global settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ðÏÄÓ×ÅÔËÁ\ &ÎÁÊÄÅÎÎÙÈ\ ÓÏÏÔ×ÅÔÓÔ×ÉÊ<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &òÅÇÉÓÔÒÏÎÅÚÁ×ÉÓÉÍÙÊ\ ÐÏÉÓË<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! ðÏËÁÚÙ×ÁÔØ\ ÐÁÒÎÙÅ\ &ÜÌÅÍÅÎÔÙ<Tab>:set\ sm!
+menutrans &Context\ lines óÔÒ&ÏË\ ×ÏËÒÕÇ\ ËÕÒÓÏÒÁ
+menutrans &Virtual\ Edit ÷ÉÒ&ÔÕÁÌØÎÏÅ\ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! òÅÖÉÍ\ &÷ÓÔÁ×ËÉ<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &óÏ×ÍÅÓÔÉÍÏÓÔØ\ Ó\ Vi<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. &ðÕÔØ\ ÄÌÑ\ ÐÏÉÓËÁ\ ÆÁÊÌÏ×\.\.\.
+menutrans Ta&g\ Files\.\.\. æÁÊÌÙ\ &ÍÅÔÏË\.\.\.
+"
+menutrans Toggle\ &Toolbar &éÎÓÔÒÕÍÅÎÔÁÌØÎÁÑ\ ÐÁÎÅÌØ
+menutrans Toggle\ &Bottom\ Scrollbar ðÏÌÏÓÁ\ ÐÒÏËÒÕÔËÉ\ ×ÎÉ&ÚÕ
+menutrans Toggle\ &Left\ Scrollbar ðÏÌÏÓÁ\ ÐÒÏËÒÕÔËÉ\ Ó&ÌÅ×Á
+menutrans Toggle\ &Right\ Scrollbar ðÏÌÏÓÁ\ ÐÒÏËÒÕÔËÉ\ ÓÐÒ&Á×Á
+">>>->>>------------- Edit/Global settings/Virtual edit
+menutrans Never ÷ÙËÌÀÞÅÎÏ
+menutrans Block\ Selection ðÒÉ\ ×ÙÄÅÌÅÎÉÉ\ ÂÌÏËÁ
+menutrans Insert\ mode ÷\ ÒÅÖÉÍÅ\ ÷ÓÔÁ×ËÉ
+menutrans Block\ and\ Insert ðÒÉ\ ×ÙÄÅÌÅÎÉÉ\ ÂÌÏËÁ\ É\ ×\ ÒÅÖÉÍÅ\ ÷ÓÔÁ×ËÉ
+menutrans Always ÷ËÌÀÞÅÎÏ\ ×ÓÅÇÄÁ
+">>>----------------- Edit/File settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &îÕÍÅÒÁÃÉÑ\ ÓÔÒÏË<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ïÔÏÂÒÁ&ÖÅÎÉÅ\ ÎÅ×ÉÄÉÍÙÈ\ ÓÉÍ×ÏÌÏ×<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! &ðÅÒÅÎÏÓ\ ÄÌÉÎÎÙÈ\ ÓÔÒÏË<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ðÅÒÅÎÏÓ\ &ÃÅÌÙÈ\ ÓÌÏ×<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ðÒÏ&ÂÅÌÙ\ ×ÍÅÓÔÏ\ ÔÁÂÕÌÑÃÉÉ<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! á×ÔÏÍÁÔÉÞÅÓËÏÅ\ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÅ\ &ÏÔÓÔÕÐÏ×<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! æÏÒÍÁÔÉÒÏ×ÁÎÉÅ\ ÏÔÓÔÕÐÏ×\ ×\ &ÓÔÉÌÅ\ C<Tab>:set\ cin!
+">>>---
+menutrans &Shiftwidth ÷ÅÌÉ&ÞÉÎÁ\ ÏÔÓÔÕÐÁ
+menutrans Soft\ &Tabstop ûÉÒÉÎÁ\ &ÔÁÂÕÌÑÃÉÉ
+menutrans Te&xt\ Width\.\.\. &ûÉÒÉÎÁ\ ÔÅËÓÔÁ\.\.\.
+menutrans &File\ Format\.\.\. &æÏÒÍÁÔ\ ÆÁÊÌÁ\.\.\.
+"
+"
+"
+" Tools menu
+menutrans &Jump\ to\ this\ tag<Tab>g^] &ðÅÒÅÈÏÄ\ Ë\ ÍÅÔËÅ<Tab>g^]
+menutrans Jump\ &back<Tab>^T &÷ÅÒÎÕÔØÓÑ\ ÎÁÚÁÄ<Tab>^T
+menutrans Build\ &Tags\ File óÏÚÄÁÔØ\ &ÆÁÊÌ\ ÍÅÔÏË
+"-------------------
+menutrans &Folding òÁÂÏÔÁ\ ÓÏ\ &ÓËÌÁÄËÁÍÉ
+menutrans &Diff &ïÔÌÉÞÉÑ\ (diff)
+"-------------------
+menutrans &Make<Tab>:make ëÏ&ÍÐÉÌÑÃÉÑ<Tab>:make
+menutrans &List\ Errors<Tab>:cl óÐÉÓÏË\ Ï&ÛÉÂÏË<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! óÐÉÓÏË\ ×ÓÅ&È\ ÏÛÉÂÏË\ É\ ÐÒÅÄÕÐÒÅÖÄÅÎÉÊ<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn óÌÅÄÕ&ÀÝÁÑ\ ÏÛÉÂËÁ<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ð&ÒÅÄÙÄÕÝÁÑ\ ÏÛÉÂËÁ<Tab>:cp
+menutrans &Older\ List<Tab>:cold âÏÌÅÅ\ ÓÔÁÒ&ÙÊ\ ÓÐÉÓÏË\ ÏÛÉÂÏË<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew âÏÌÅÅ\ Ó×Å&ÖÉÊ\ ÓÐÉÓÏË\ ÏÛÉÂÏË<Tab>:cnew
+menutrans Error\ &Window ïË&ÎÏ\ ÏÛÉÂÏË
+menutrans &Set\ Compiler ÷ÙÂÏÒ\ &ËÏÍÐÉÌÑÔÏÒÁ
+"-------------------
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ð&ÅÒÅ×ÅÓÔÉ\ ×\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ðÅÒÅ×ÅÓÔÉ\ É&Ú\ HEX<Tab>:%!xxd\ -r
+">>>---------------- Folds
+menutrans &Enable/Disable\ folds<Tab>zi ÷ËÌ/×ÙËÌ\ &ÓËÌÁÄËÉ<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv ïÔËÒÙÔØ\ ÓÔÒÏËÕ\ Ó\ &ËÕÒÓÏÒÏÍ<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx ïÔËÒÙÔØ\ &ÔÏÌØËÏ\ ÓÔÒÏËÕ\ Ó\ ËÕÒÓÏÒÏÍ<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm úÁËÒÙÔØ\ &ÂÏÌØÛÅ\ ÓËÌÁÄÏË<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM úÁËÒÙÔØ\ &×ÓÅ\ ÓËÌÁÄËÉ<Tab>zM
+menutrans &Open\ all\ folds<Tab>zR ïÔËÒ&ÙÔØ\ ×ÓÅ\ ÓËÌÁÄËÉ<Tab>zR
+menutrans O&pen\ more\ folds<Tab>zr ïÔË&ÒÙÔØ\ ÂÏÌØÛÅ\ ÓËÌÁÄÏË<Tab>zr
+menutrans Fold\ Met&hod &íÅÔÏÄ\ ÓËÌÁÄÏË
+menutrans Create\ &Fold<Tab>zf óÏ&ÚÄÁÔØ\ ÓËÌÁÄËÕ<Tab>zf
+menutrans &Delete\ Fold<Tab>zd õ&ÄÁÌÉÔØ\ ÓËÌÁÄËÕ<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD õÄÁÌÉÔØ\ ×Ó&Å\ ÓËÌÁÄËÉ<Tab>zD
+menutrans Fold\ column\ &width &ûÉÒÉÎÁ\ ËÏÌÏÎËÉ\ ÓËÌÁÄÏË
+">>>->>>----------- Tools/Folds/Fold Method
+menutrans M&anual ÷ÒÕ&ÞÎÕÀ
+menutrans I&ndent ï&ÔÓÔÕÐ
+menutrans E&xpression &÷ÙÒÁÖÅÎÉÅ
+menutrans Ma&rker &íÁÒËÅÒÙ
+">>>--------------- Tools/Diff
+menutrans &Update ï&ÂÎÏ×ÉÔØ
+menutrans &Get\ Block éÚÍÅÎÉÔØ\ &ÜÔÏÔ\ ÂÕÆÅÒ
+menutrans &Put\ Block éÚÍÅÎÉÔØ\ &ÄÒÕÇÏÊ\ ÂÕÆÅÒ
+">>>--------------- Tools/Diff/Error window
+menutrans &Update<Tab>:cwin ï&ÂÎÏ×ÉÔØ<Tab>:cwin
+menutrans &Close<Tab>:cclose &úÁËÒÙÔØ<Tab>:cclose
+menutrans &Open<Tab>:copen &ïÔËÒÙÔØ<Tab>:copen
+"
+"
+" Syntax menu
+"
+menutrans &Show\ filetypes\ in\ menu ðÏËÁÚÁÔØ\ ÍÅÎÀ\ ÄÌÑ\ ×ÙÂÏÒÁ\ ÔÉÐÁ\ &ÆÁÊÌÁ
+menutrans Set\ '&syntax'\ only &éÚÍÅÎÑÔØ\ ÔÏÌØËÏ\ ÚÎÁÞÅÎÉÅ\ 'syntax'
+menutrans Set\ '&filetype'\ too éÚÍÅÎÑÔØ\ &ÔÁËÖÅ\ ÚÎÁÞÅÎÉÅ\ 'filetype'
+menutrans &Off &ïÔËÌÀÞÉÔØ
+menutrans A&utomatic &á×ÔÏÍÁÔÉÞÅÓËÉ
+menutrans on/off\ for\ &This\ file ÷ËÌ/×ÙËÌ\ ÄÌÑ\ &ÜÔÏÇÏ\ ÆÁÊÌÁ
+menutrans Co&lor\ test ðÒÏ×ÅÒËÁ\ &Ã×ÅÔÏ×
+menutrans &Highlight\ test ðÒÏ×ÅÒËÁ\ ÐÏÄ&Ó×ÅÔËÉ
+menutrans &Convert\ to\ HTML ó&ÄÅÌÁÔØ\ HTML\ Ó\ ÐÏÄÓ×ÅÔËÏÊ
+"
+"
+" Buffers menu
+"
+menutrans &Refresh\ menu ï&ÂÎÏ×ÉÔØ\ ÍÅÎÀ
+menutrans Delete õ&ÄÁÌÉÔØ
+menutrans &Alternate &óÏÓÅÄÎÉÊ
+menutrans &Next ó&ÌÅÄÕÀÝÉÊ
+menutrans &Previous &ðÒÅÄÙÄÕÝÉÊ
+menutrans [No\ File] [îÅÔ\ ÆÁÊÌÁ]
+"
+"
+" Window menu
+"
+menutrans &New<Tab>^Wn &îÏ×ÏÅ\ ÏËÎÏ<Tab>^Wn
+menutrans S&plit<Tab>^Ws &òÁÚÄÅÌÉÔØ\ ÏËÎÏ<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ïÔËÒÙÔØ\ &ÓÏÓÅÄÎÉÊ\ ÆÁÊÌ\ ×\ ÎÏ×ÏÍ\ ÏËÎÅ<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv òÁÚÄÅÌÉÔØ\ ÐÏ\ &×ÅÒÔÉËÁÌÉ<Tab>^Wv
+menutrans Split\ File\ E&xplorer ïÔËÒÙÔØ\ ÐÒÏ×ÏÄÎÉË\ ÐÏ\ &ÆÁÊÌÏ×ÏÊ\ ÓÉÓÔÅÍÅ
+"
+menutrans &Close<Tab>^Wc &úÁËÒÙÔØ\ ÜÔÏ\ ÏËÎÏ<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo úÁËÒÙÔØ\ &ÏÓÔÁÌØÎÙÅ\ ÏËÎÁ<Tab>^Wo
+"
+menutrans Move\ &To &ðÅÒÅÍÅÓÔÉÔØ
+menutrans Rotate\ &Up<Tab>^WR óÄ×ÉÎÕÔØ\ ××ÅÒ&È<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr óÄ×ÉÎÕÔØ\ ×&ÎÉÚ<Tab>^Wr
+"
+menutrans &Equal\ Size<Tab>^W= ï&ÄÉÎÁËÏ×ÙÊ\ ÒÁÚÍÅÒ<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ íÁËÓÉÍÁÌØÎÁÑ\ ×&ÙÓÏÔÁ<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ íÉÎÉÍÁÌØÎÁÑ\ ×ÙÓÏ&ÔÁ<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| íÁËÓÉÍÁÌØÎÁÑ\ &ÛÉÒÉÎÁ<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| íÉÎÉÍÁÌ&ØÎÁÑ\ ÛÉÒÉÎÁ<Tab>^W1\|
+">>>----------------- Window/Move To
+menutrans &Top<Tab>^WK îÁ&×ÅÒÈ<Tab>^WK
+menutrans &Bottom<Tab>^WJ ÷&ÎÉÚ<Tab>^WJ
+menutrans &Left\ side<Tab>^WH ÷&ÌÅ×Ï<Tab>^WH
+menutrans &Right\ side<Tab>^WL ÷&ÐÒÁ×Ï<Tab>^WL
+"
+"
+" The popup menu
+"
+"
+menutrans &Undo ï&ÔÍÅÎÉÔØ
+menutrans Cu&t &÷ÙÒÅÚÁÔØ
+menutrans &Copy &ëÏÐÉÒÏ×ÁÔØ
+menutrans &Paste ÷Ë&ÌÅÉÔØ
+menutrans &Delete &õÄÁÌÉÔØ
+menutrans Select\ Blockwise âÌÏËÏ×ÏÅ\ ×ÙÄÅÌÅÎÉÅ
+menutrans Select\ &Word ÷ÙÄÅÌÉÔØ\ &ÓÌÏ×Ï
+menutrans Select\ &Line ÷ÙÄÅÌÉÔØ\ ÓÔ&ÒÏËÕ
+menutrans Select\ &Block ÷ÙÄÅÌÉÔØ\ &ÂÌÏË
+menutrans Select\ &All ÷&ÙÄÅÌÉÔØ\ &×Ó£
+"
+" The GUI toolbar
+"
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ïÔËÒÙÔØ ÆÁÊÌ
+ tmenu ToolBar.Save óÏÈÒÁÎÉÔØ ÆÁÊÌ
+ tmenu ToolBar.SaveAll óÏÈÒÁÎÉÔØ ×ÓÅ ÆÁÊÌÙ
+ tmenu ToolBar.Print îÁÐÅÞÁÔÁÔØ
+ tmenu ToolBar.Undo ïÔÍÅÎÉÔØ
+ tmenu ToolBar.Redo ÷ÅÒÎÕÔØ
+ tmenu ToolBar.Cut ÷ÙÒÅÚÁÔØ
+ tmenu ToolBar.Copy ëÏÐÉÒÏ×ÁÔØ
+ tmenu ToolBar.Paste ÷ËÌÅÉÔØ
+ tmenu ToolBar.Find ðÏÉÓË...
+ tmenu ToolBar.FindNext ðÏÉÓË ÓÌÅÄÕÀÝÅÇÏ ÓÏÏÔ×ÅÔÓÔ×ÉÑ
+ tmenu ToolBar.FindPrev ðÏÉÓË ÐÒÅÄÙÄÕÝÅÇÏ ÓÏÏÔ×ÅÔÓÔ×ÉÑ
+ tmenu ToolBar.Replace úÁÍÅÎÉÔØ...
+ tmenu ToolBar.LoadSesn úÁÇÒÕÚÉÔØ ÓÅÁÎÓ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ
+ tmenu ToolBar.SaveSesn óÏÈÒÁÎÉÔØ ÓÅÁÎÓ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ
+ tmenu ToolBar.RunScript ÷ÙÐÏÌÎÉÔØ ÓÃÅÎÁÒÉÊ Vim
+ tmenu ToolBar.Make ëÏÍÐÉÌÑÃÉÑ
+ tmenu ToolBar.Shell ïÂÏÌÏÞËÁ
+ tmenu ToolBar.RunCtags óÏÚÄÁÔØ ÆÁÊÌ ÍÅÔÏË
+ tmenu ToolBar.TagJump ðÅÒÅÊÔÉ Ë ÍÅÔËÅ
+ tmenu ToolBar.Help óÐÒÁ×ËÁ
+ tmenu ToolBar.FindHelp îÁÊÔÉ ÓÐÒÁ×ËÕ
+ endfun
+endif
+"
+"
+" Dialog texts
+"
+" Find in help dialog
+"
+let g:menutrans_help_dialog = "÷×ÅÄÉÔÅ ËÏÍÁÎÄÕ ÉÌÉ ÓÌÏ×Ï ÄÌÑ ÐÏÉÓËÁ:\n\näÏÂÁ×ØÔÅ i_ ÄÌÑ ÐÏÉÓËÁ ËÏÍÁÎÄ ÒÅÖÉÍÁ ÷ÓÔÁ×ËÉ (ÎÁÐÒÉÍÅÒ, i_CTRL-X)\näÏÂÁ×ØÔÅ c_ ÄÌÑ ÐÏÉÓËÁ ËÏÍÁÎÄ ïÂÙÞÎÏÇÏ ÒÅÖÉÍÁ (ÎÁÐÒÉÍÅÒ, Ó_<Del>)\näÏÂÁ×ØÔÅ ' ÄÌÑ ÐÏÉÓËÁ ÓÐÒÁ×ËÉ ÐÏ ÏÐÃÉÉ (ÎÁÐÒÉÍÅÒ, 'shiftwidth')"
+"
+" Searh path dialog
+"
+let g:menutrans_path_dialog = "õËÁÖÉÔÅ ÐÕÔØ ÄÌÑ ÐÏÉÓËÁ ÆÁÊÌÏ×.\néÍÅÎÁ ËÁÔÁÌÏÇÏ× ÒÁÚÄÅÌÑÀÔÓÑ ÚÁÐÑÔÙÍÉ."
+"
+" Tag files dialog
+"
+let g:menutrans_tags_dialog = "÷×ÅÄÉÔÅ ÉÍÅÎÁ ÆÁÊÌÏ× ÍÅÔÏË (ÞÅÒÅÚ ÚÁÐÑÔÕÀ).\n"
+"
+" Text width dialog
+"
+let g:menutrans_textwidth_dialog = "÷×ÅÄÉÔÅ ÛÉÒÉÎÕ ÔÅËÓÔÁ ÄÌÑ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÑ.\näÌÑ ÏÔÍÅÎÙ ÆÏÒÍÁÔÉÒÏ×ÁÎÉÑ ××ÅÄÉÔÅ 0."
+"
+" File format dialog
+"
+let g:menutrans_fileformat_dialog = "÷ÙÂÅÒÉÔÅ ÆÏÒÍÁÔ ÆÁÊÌÁ."
+let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\nï&ÔÍÅÎÁ"
+"
+let menutrans_no_file = "[îÅÔ ÆÁÊÌÁ]"
diff --git a/runtime/lang/menu_ru_ru.utf-8.vim b/runtime/lang/menu_ru_ru.utf-8.vim
new file mode 100644
index 000000000..20b0b2d5a
--- /dev/null
+++ b/runtime/lang/menu_ru_ru.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Russian
+
+source <sfile>:p:h/menu_ru_ru.vim
diff --git a/runtime/lang/menu_ru_ru.vim b/runtime/lang/menu_ru_ru.vim
new file mode 100644
index 000000000..d471fd5ef
--- /dev/null
+++ b/runtime/lang/menu_ru_ru.vim
@@ -0,0 +1,296 @@
+" Menu Translations: Russian
+" Maintainer: vassily ragosin <vrr[at]users.sourceforge.net>
+" Last Change: 26 Apr 2004
+" URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim
+"
+" $Id$
+"
+" Adopted for RuVim project by Vassily Ragosin.
+" First translation: Tim Alexeevsky <realtim [at] mail.ru>,
+" based on ukrainian translation by Bohdan Vlasyuk <bohdan@vstu.edu.ua>
+"
+"
+" Quit when menu translations have already been done.
+"
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+" Top
+menutrans &File &Файл
+menutrans &Edit П&равка
+menutrans &Tools &ИнÑтрументы
+menutrans &Syntax &СинтакÑиÑ
+menutrans &Buffers &Буферы
+menutrans &Window &Окно
+menutrans &Help С&правка
+"
+"
+"
+" Help menu
+menutrans &Overview<Tab><F1> &Обзор<Tab><F1>
+menutrans &User\ Manual Руково&дÑтво\ пользователÑ
+menutrans &How-to\ links &Как\ Ñто\ Ñделать\.\.\.
+menutrans &Find\.\.\. &ПоиÑк
+"--------------------
+menutrans &Credits &БлагодарноÑти
+menutrans Co&pying &РаÑпроÑтранение
+menutrans &Sponsor/Register Помо&щь/РегиÑтрациÑ
+menutrans O&rphans &Сироты
+"--------------------
+menutrans &Version &ИнформациÑ\ о\ программе
+menutrans &About &ЗаÑтавка
+"
+"
+" File menu
+menutrans &Open\.\.\.<Tab>:e &Открыть\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp По&делить\ окно\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Ðовый<Tab>:enew
+menutrans &Close<Tab>:close &Закрыть<Tab>:close
+"--------------------
+menutrans &Save<Tab>:w &Сохранить<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Сохранить\ &как\.\.\.<Tab>:sav
+"--------------------
+menutrans Split\ &Diff\ with\.\.\. Ср&авнить\ Ñ\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Сравнить\ Ñ\ применением\ зап&латки\.\.\.
+"--------------------
+menutrans &Print Ðа&печатать
+menutrans Sa&ve-Exit<Tab>:wqa Ð’Ñ‹&ход\ Ñ\ Ñохранением<Tab>:wqa
+menutrans E&xit<Tab>:qa &Выход<Tab>:qa
+"
+"
+" Edit menu
+menutrans &Undo<Tab>u О&тменить<Tab>u
+menutrans &Redo<Tab>^R В&ернуть<Tab>^R
+menutrans Rep&eat<Tab>\. Повторит&ь<Tab>\.
+"--------------------
+menutrans Cu&t<Tab>"+x &Вырезать<Tab>"+x
+menutrans &Copy<Tab>"+y &Копировать<Tab>"+y
+menutrans &Paste<Tab>"+gP Вк&леить<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Вклеить\ пере&д<Tab>[p
+menutrans Put\ &After<Tab>]p Вклеить\ по&Ñле<Tab>]p
+menutrans &Delete<Tab>x &Удалить<Tab>x
+menutrans &Select\ All<Tab>ggVG Ð’&ыделить\ вÑÑ‘<Tab>ggVG
+"--------------------
+menutrans &Find\.\.\.<Tab>/ &ПоиÑк\.\.\.<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. ПоиÑк\ и\ &замена\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\.<Tab>:%s ПоиÑк\ и\ &замена\.\.\.<Tab>:%s
+menutrans Find\ and\ Rep&lace\.\.\.<Tab>:s ПоиÑк\ и\ &замена\.\.\.<Tab>:s
+"--------------------
+menutrans Settings\ &Window Окно\ наÑтройки\ &опций
+menutrans &Global\ Settings &Глобальные\ наÑтройки
+menutrans F&ile\ Settings ÐаÑтройки\ &файлов
+menutrans C&olor\ Scheme &ЦветоваÑ\ Ñхема
+menutrans &Keymap РаÑкладка\ кл&авиатуры
+menutrans Select\ Fo&nt\.\.\. Выбор\ &шрифта\.\.\.
+">>>----------------- Edit/Global settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ПодÑветка\ &найденных\ ÑоответÑтвий<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &РегиÑтронезавиÑимый\ поиÑк<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Показывать\ парные\ &Ñлементы<Tab>:set\ sm!
+menutrans &Context\ lines Стр&ок\ вокруг\ курÑора
+menutrans &Virtual\ Edit Вир&туальное\ редактирование
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Режим\ &Ð’Ñтавки<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! &СовмеÑтимоÑÑ‚ÑŒ\ Ñ\ Vi<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. &Путь\ длÑ\ поиÑка\ файлов\.\.\.
+menutrans Ta&g\ Files\.\.\. Файлы\ &меток\.\.\.
+"
+menutrans Toggle\ &Toolbar &ИнÑтрументальнаÑ\ панель
+menutrans Toggle\ &Bottom\ Scrollbar ПолоÑа\ прокрутки\ вни&зу
+menutrans Toggle\ &Left\ Scrollbar ПолоÑа\ прокрутки\ Ñ&лева
+menutrans Toggle\ &Right\ Scrollbar ПолоÑа\ прокрутки\ Ñпр&ава
+">>>->>>------------- Edit/Global settings/Virtual edit
+menutrans Never Выключено
+menutrans Block\ Selection При\ выделении\ блока
+menutrans Insert\ mode Ð’\ режиме\ Ð’Ñтавки
+menutrans Block\ and\ Insert При\ выделении\ блока\ и\ в\ режиме\ Ð’Ñтавки
+menutrans Always Включено\ вÑегда
+">>>----------------- Edit/File settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &ÐумерациÑ\ Ñтрок<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Отобра&жение\ невидимых\ Ñимволов<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! &ПереноÑ\ длинных\ Ñтрок<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ПереноÑ\ &целых\ Ñлов<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Про&белы\ вмеÑто\ табулÑции<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ÐвтоматичеÑкое\ форматирование\ &отÑтупов<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Форматирование\ отÑтупов\ в\ &Ñтиле\ C<Tab>:set\ cin!
+">>>---
+menutrans &Shiftwidth Вели&чина\ отÑтупа
+menutrans Soft\ &Tabstop Ширина\ &табулÑции
+menutrans Te&xt\ Width\.\.\. &Ширина\ текÑта\.\.\.
+menutrans &File\ Format\.\.\. &Формат\ файла\.\.\.
+"
+"
+"
+" Tools menu
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Переход\ к\ метке<Tab>g^]
+menutrans Jump\ &back<Tab>^T &ВернутьÑÑ\ назад<Tab>^T
+menutrans Build\ &Tags\ File Создать\ &файл\ меток
+"-------------------
+menutrans &Folding Работа\ Ñо\ &Ñкладками
+menutrans &Diff &ОтличиÑ\ (diff)
+"-------------------
+menutrans &Make<Tab>:make Ко&мпилÑциÑ<Tab>:make
+menutrans &List\ Errors<Tab>:cl СпиÑок\ о&шибок<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! СпиÑок\ вÑе&Ñ…\ ошибок\ и\ предупреждений<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Следу&ющаÑ\ ошибка<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp П&редыдущаÑ\ ошибка<Tab>:cp
+menutrans &Older\ List<Tab>:cold Более\ Ñтар&ый\ ÑпиÑок\ ошибок<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Более\ Ñве&жий\ ÑпиÑок\ ошибок<Tab>:cnew
+menutrans Error\ &Window Ок&но\ ошибок
+menutrans &Set\ Compiler Выбор\ &компилÑтора
+"-------------------
+menutrans &Convert\ to\ HEX<Tab>:%!xxd П&еревеÑти\ в\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ПеревеÑти\ и&з\ HEX<Tab>:%!xxd\ -r
+">>>---------------- Folds
+menutrans &Enable/Disable\ folds<Tab>zi Вкл/выкл\ &Ñкладки<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Открыть\ Ñтроку\ Ñ\ &курÑором<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Открыть\ &только\ Ñтроку\ Ñ\ курÑором<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Закрыть\ &больше\ Ñкладок<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Закрыть\ &вÑе\ Ñкладки<Tab>zM
+menutrans &Open\ all\ folds<Tab>zR Откр&Ñ‹Ñ‚ÑŒ\ вÑе\ Ñкладки<Tab>zR
+menutrans O&pen\ more\ folds<Tab>zr Отк&рыть\ больше\ Ñкладок<Tab>zr
+menutrans Fold\ Met&hod &Метод\ Ñкладок
+menutrans Create\ &Fold<Tab>zf Со&здать\ Ñкладку<Tab>zf
+menutrans &Delete\ Fold<Tab>zd У&далить\ Ñкладку<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Удалить\ вÑ&е\ Ñкладки<Tab>zD
+menutrans Fold\ col&umn\ width &Ширина\ колонки\ Ñкладок
+">>>->>>----------- Tools/Folds/Fold Method
+menutrans M&anual Вру&чную
+menutrans I&ndent О&Ñ‚Ñтуп
+menutrans E&xpression &Выражение
+menutrans S&yntax &СинтакÑиÑ
+menutrans Ma&rker &Маркеры
+">>>--------------- Tools/Diff
+menutrans &Update О&бновить
+menutrans &Get\ Block Изменить\ &Ñтот\ буфер
+menutrans &Put\ Block Изменить\ &другой\ буфер
+">>>--------------- Tools/Diff/Error window
+menutrans &Update<Tab>:cwin О&бновить<Tab>:cwin
+menutrans &Close<Tab>:cclose &Закрыть<Tab>:cclose
+menutrans &Open<Tab>:copen &Открыть<Tab>:copen
+"
+"
+" Syntax menu
+"
+menutrans &Show\ filetypes\ in\ menu Показать\ меню\ длÑ\ выбора\ типа\ &файла
+menutrans Set\ '&syntax'\ only &ИзменÑÑ‚ÑŒ\ только\ значение\ 'syntax'
+menutrans Set\ '&filetype'\ too ИзменÑÑ‚ÑŒ\ &также\ значение\ 'filetype'
+menutrans &Off &Отключить
+menutrans &Manual Вру&чную
+menutrans A&utomatic &ÐвтоматичеÑки
+menutrans on/off\ for\ &This\ file Вкл/выкл\ длÑ\ &Ñтого\ файла
+menutrans Co&lor\ test Проверка\ &цветов
+menutrans &Highlight\ test Проверка\ под&Ñветки
+menutrans &Convert\ to\ HTML С&делать\ HTML\ Ñ\ подÑветкой
+"
+"
+" Buffers menu
+"
+menutrans &Refresh\ menu О&бновить\ меню
+menutrans Delete У&далить
+menutrans &Alternate &СоÑедний
+menutrans &Next С&ледующий
+menutrans &Previous &Предыдущий
+menutrans [No\ File] [Ðет\ файла]
+"
+"
+" Window menu
+"
+menutrans &New<Tab>^Wn &Ðовое\ окно<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Разделить\ окно<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Открыть\ &ÑоÑедний\ файл\ в\ новом\ окне<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Разделить\ по\ &вертикали<Tab>^Wv
+menutrans Split\ File\ E&xplorer Открыть\ проводник\ по\ &файловой\ ÑиÑтеме
+"
+menutrans &Close<Tab>^Wc &Закрыть\ Ñто\ окно<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Закрыть\ &оÑтальные\ окна<Tab>^Wo
+"
+menutrans Move\ &To &ПеремеÑтить
+menutrans Rotate\ &Up<Tab>^WR Сдвинуть\ ввер&х<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Сдвинуть\ в&низ<Tab>^Wr
+"
+menutrans &Equal\ Size<Tab>^W= О&динаковый\ размер<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ МакÑимальнаÑ\ в&Ñ‹Ñота<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ МинимальнаÑ\ выÑо&та<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| МакÑимальнаÑ\ &ширина<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Минимал&ьнаÑ\ ширина<Tab>^W1\|
+">>>----------------- Window/Move To
+menutrans &Top<Tab>^WK Ðа&верх<Tab>^WK
+menutrans &Bottom<Tab>^WJ В&низ<Tab>^WJ
+menutrans &Left\ side<Tab>^WH В&лево<Tab>^WH
+menutrans &Right\ side<Tab>^WL В&право<Tab>^WL
+"
+"
+" The popup menu
+"
+"
+menutrans &Undo О&тменить
+menutrans Cu&t &Вырезать
+menutrans &Copy &Копировать
+menutrans &Paste Вк&леить
+menutrans &Delete &Удалить
+menutrans Select\ Blockwise Блоковое\ выделение
+menutrans Select\ &Word Выделить\ &Ñлово
+menutrans Select\ &Line Выделить\ ÑÑ‚&року
+menutrans Select\ &Block Выделить\ &блок
+menutrans Select\ &All Ð’&ыделить\ &вÑÑ‘
+"
+" The GUI toolbar
+"
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Открыть файл
+ tmenu ToolBar.Save Сохранить файл
+ tmenu ToolBar.SaveAll Сохранить вÑе файлы
+ tmenu ToolBar.Print Ðапечатать
+ tmenu ToolBar.Undo Отменить
+ tmenu ToolBar.Redo Вернуть
+ tmenu ToolBar.Cut Вырезать
+ tmenu ToolBar.Copy Копировать
+ tmenu ToolBar.Paste Вклеить
+ tmenu ToolBar.Find ПоиÑк...
+ tmenu ToolBar.FindNext ПоиÑк Ñледующего ÑоответÑтвиÑ
+ tmenu ToolBar.FindPrev ПоиÑк предыдущего ÑоответÑтвиÑ
+ tmenu ToolBar.Replace Заменить...
+ tmenu ToolBar.LoadSesn Загрузить ÑÐµÐ°Ð½Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ
+ tmenu ToolBar.SaveSesn Сохранить ÑÐµÐ°Ð½Ñ Ñ€ÐµÐ´Ð°ÐºÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ
+ tmenu ToolBar.RunScript Выполнить Ñценарий Vim
+ tmenu ToolBar.Make КомпилÑциÑ
+ tmenu ToolBar.Shell Оболочка
+ tmenu ToolBar.RunCtags Создать файл меток
+ tmenu ToolBar.TagJump Перейти к метке
+ tmenu ToolBar.Help Справка
+ tmenu ToolBar.FindHelp Ðайти Ñправку
+ endfun
+endif
+"
+"
+" Dialog texts
+"
+" Find in help dialog
+"
+let g:menutrans_help_dialog = "Введите команду или Ñлово Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка:\n\nДобавьте i_ Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка команд режима Ð’Ñтавки (например, i_CTRL-X)\nДобавьте c_ Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка команд Обычного режима (например, Ñ_<Del>)\nДобавьте ' Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка Ñправки по опции (например, 'shiftwidth')"
+"
+" Searh path dialog
+"
+let g:menutrans_path_dialog = "Укажите путь Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка файлов.\nИмена каталогов разделÑÑŽÑ‚ÑÑ Ð·Ð°Ð¿Ñтыми."
+"
+" Tag files dialog
+"
+let g:menutrans_tags_dialog = "Введите имена файлов меток (через запÑтую).\n"
+"
+" Text width dialog
+"
+let g:menutrans_textwidth_dialog = "Введите ширину текÑта Ð´Ð»Ñ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ.\nÐ”Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð²Ð²ÐµÐ´Ð¸Ñ‚Ðµ 0."
+"
+" File format dialog
+"
+let g:menutrans_fileformat_dialog = "Выберите формат файла."
+let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\nО&тмена"
+"
+let menutrans_no_file = "[Ðет файла]"
diff --git a/runtime/lang/menu_sk.cp1250.vim b/runtime/lang/menu_sk.cp1250.vim
new file mode 100644
index 000000000..51b49b84b
--- /dev/null
+++ b/runtime/lang/menu_sk.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Slovak
+
+source <sfile>:p:h/menu_slovak_slovak_republic.1250.vim
diff --git a/runtime/lang/menu_sk_sk.1250.vim b/runtime/lang/menu_sk_sk.1250.vim
new file mode 100644
index 000000000..5fe378d70
--- /dev/null
+++ b/runtime/lang/menu_sk_sk.1250.vim
@@ -0,0 +1,6 @@
+" Menu Translations: Slovak
+" Translated By: Martin Lacko <lacko@host.sk>
+" Last Change: 2003 May 11
+" This is redirection to slovak menu-translations file
+
+source <sfile>:p:h/menu_slovak_slovak_republic.1250.vim
diff --git a/runtime/lang/menu_sk_sk.cp1250.vim b/runtime/lang/menu_sk_sk.cp1250.vim
new file mode 100644
index 000000000..51b49b84b
--- /dev/null
+++ b/runtime/lang/menu_sk_sk.cp1250.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Slovak
+
+source <sfile>:p:h/menu_slovak_slovak_republic.1250.vim
diff --git a/runtime/lang/menu_sk_sk.iso_8859-2.vim b/runtime/lang/menu_sk_sk.iso_8859-2.vim
new file mode 100644
index 000000000..bace7d239
--- /dev/null
+++ b/runtime/lang/menu_sk_sk.iso_8859-2.vim
@@ -0,0 +1,232 @@
+" Menu Translations: Slovak
+" Translated By: Martin Lacko <lacko@host.sk>
+" Last Change: 2003 Mar 30
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding iso-8859-2
+
+" Help menu
+menutrans &Help &Pomocník
+menutrans &Overview<Tab><F1> &Prehµad<Tab><F1>
+menutrans &User\ Manual Po&u¾ívateµský\ manuál
+menutrans &How-to\ links &Tipy
+menutrans &Find\.\.\. &Nájs»\.\.\.
+menutrans &Credits Poï&akovanie
+menutrans O&rphans Si&roty
+menutrans Co&pying &Licencia
+menutrans &Version &Verzia
+menutrans &About &O\ programe
+
+" File menu
+menutrans &File &Súbor
+menutrans &Open\.\.\.<Tab>:e &Otvori»\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Ot&vori»\ v\ novom\ okne\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nový<Tab>:enew
+menutrans &Close<Tab>:close &Zatvori»<Tab>:close
+menutrans &Save<Tab>:w &Ulo¾i»<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Ulo¾i»\ &ako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Otvor&i»\ porovnanie\ v\ novom\ okne\ s\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Otvo&ri»\ aktualizované\ s\.\.\.
+menutrans &Print &Tlaè
+menutrans Sa&ve-Exit<Tab>:wqa U&lo¾i»-Koniec<Tab>:wqa
+menutrans E&xit<Tab>:qa &Koniec<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Úpravy
+menutrans &Undo<Tab>u &Spä»<Tab>u
+menutrans &Redo<Tab>^R Z&ru¹i»\ spä»<Tab>^R
+menutrans Rep&eat<Tab>\. &Opakova»<Tab>\.
+menutrans Cu&t<Tab>"+x &Vystrihnú»<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopírova»<Tab>"+y
+menutrans &Paste<Tab>"+gP V&lo¾i»<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Vlo¾i»\ &pred<Tab>[p
+menutrans Put\ &After<Tab>]p Vlo¾i»\ za<Tab>]p
+menutrans &Select\ all<Tab>ggVG Vy&bra»\ v¹etko<Tab>ggVG
+menutrans &Delete<Tab>x Vy&maza»<Tab>x
+menutrans &Find\.\.\. &Nájs»\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. N&ahradi»\.\.\.
+menutrans Settings\ &Window Mo&¾nosti
+menutrans &Global\ Settings &Globálne mo¾nosti
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Prepnú»\ paletu\ zvýrazòovania<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Prepnú»\ &ignorovanie veµkosti<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Prepnú»\ &ukáza»\ zhodu<Tab>:set\ sm!
+menutrans &Context\ lines &Kontextové\ riadky
+menutrans &Virtual\ Edit &Virtuálne úpravy
+menutrans Never Nikdy
+menutrans Block\ Selection Blokový\ výber
+menutrans Insert\ mode Re¾im\ vkladania
+menutrans Block\ and\ Insert Blok\ a\ vkladanie
+menutrans Always V¾dy
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Prepnú»\ re¾i&m\ vkladania<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Prepnú»\ vi\ kompatibilitu<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Cesta\ &hµadania\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&gové súbory\.\.\.
+menutrans Toggle\ &Toolbar Prepnú»\ &panel
+menutrans Toggle\ &Bottom\ Scrollbar Prepnú»\ spodný\ posuvník
+menutrans Toggle\ &Left\ Scrollbar Prepnú»\ µavý\ posuvník
+menutrans Toggle\ &Right\ Scrollbar Prepnú»\ pravý\ posuvník
+menutrans F&ile\ Settings Nastavenia\ súboru
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Prepnú»\ èíslova&nie\ riadkov<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Prepnú»\ re¾im\ &zoznamu<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Prepnú»\ z&alamovanie\ riadkov<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prepnú»\ za&lamovanie\ slov<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Prepnú»\ roz¹ír&ené\ tabulátory<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Prepnú»\ automatické\ &odsadzovanie<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Prepnú»\ &C-odsadzovanie<Tab>:set\ cin!
+menutrans &Shiftwidth &©írka\ ¹iftu
+menutrans Soft\ &Tabstop &Softvérový\ tabulátor
+menutrans Te&xt\ Width\.\.\. ©írka\ te&xtu\.\.\.
+menutrans &File\ Format\.\.\. &Formát\ súboru\.\.\.
+menutrans C&olor\ Scheme Far&ebná\ schéma
+
+" Programming menu
+menutrans &Tools &Nástroje
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèi»\ na\ znaèku<Tab>g^]
+menutrans Jump\ &back<Tab>^T Sk&oèi»\ spä»<Tab>^T
+menutrans Build\ &Tags\ File &Vytvori»\ súbor\ znaèiek
+menutrans &Folding &Vnáranie
+menutrans &Enable/Disable\ folds<Tab>zi Zapnú»/Vypnú»\ vnárani&e<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Zobrazi»\ kurzoro&vý\ riadok<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Zobrazi»\ iba\ kurzorový\ riadok<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Zatvori»\ viac \vnorení<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zatvor&i»\ v¹etky\ vnorenia<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr O&tvori»\ viac\ vnorení<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Otvori»\ v¹etky\ vnorenia<Tab>zR
+menutrans Fold\ Met&hod Metó&da\ vnárania
+menutrans M&anual M&anuálne
+menutrans I&ndent Odsade&nie
+menutrans E&xpression &Výraz
+menutrans S&yntax S&yntax
+menutrans &Diff Roz&diel
+menutrans Ma&rker Zna&èkovaè
+menutrans Create\ &Fold<Tab>zf Vyt&vori»\ vnorenie<Tab>zf
+menutrans &Delete\ Fold<Tab>zd V&ymaza»\ vnorenie<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Vymaza»\ v¹etky\ vnorenia<Tab>zD
+menutrans Fold\ column\ &width ©írka\ &vkladaného\ ståpca
+menutrans &Diff &Rozdiely
+menutrans &Update Akt&ualizova»
+menutrans &Get\ Block Zob&ra»\ blok
+menutrans &Put\ Block &Vlo¾i»\ blok
+menutrans Error\ &Window Chybové\ &okno
+menutrans &Update<Tab>:cwin Akt&ualizova»<Tab>:cwin
+menutrans &Open<Tab>:copen &Otvori»<Tab>:copen
+menutrans &Close<Tab>:cclose &Zatvori»<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd &Konvertova»\ do\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Konve&rtova»\ spä»<Tab>:%!xxd\ -r
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Výpis\ &chýb<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Výp&is\ správ<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Ïa&l¹ia\ chyba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Predchádzajúca\ chyba<Tab>:cp
+menutrans &Older\ List<Tab>:cold Sta&r¹í\ zoznam<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Nov¹í\ &zoznam<Tab>:cnew
+menutrans Error\ &Window<Tab>:cwin Chybové\ o&kno<Tab>:cwin
+menutrans &Set\ Compiler Vyberte\ k&ompilátor
+menutrans Convert\ to\ HEX<Tab>:%!xxd Prvies»\ do\ ¹es&tnástkového\ formátu<Tab>:%!xxd
+menutrans Convert\ back<Tab>:%!xxd\ -r Pr&evies»\ spä»<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &Vyrovnávacia\ pamä»
+menutrans &Refresh\ menu Obnovi»
+menutrans &Delete Vymaza»
+menutrans &Alternate Zmeni»
+menutrans &Next Ï&al¹ia
+menutrans &Previous &Predchádzajúca
+menutrans [No File] [®iadny\ súbor]
+
+" Window menu
+menutrans &Window &Okná
+menutrans &New<Tab>^Wn &Nové<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Rozdeli»<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Ro&zdeli»\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Rozdeli»\ &vertikálne<Tab>^Wv
+menutrans Split\ File\ E&xplorer Otvori»\ pri&eskumníka
+menutrans &Close<Tab>^Wc Zatvor&i»<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zatvori»\ i&né<Tab>^Wo
+menutrans Move\ &To Presunú&»
+menutrans &Top<Tab>^WK Na&hor<Tab>^WK
+menutrans &Bottom<Tab>^WJ Nado&l<Tab>^WJ
+menutrans &Left\ side<Tab>^WH V&µavo<Tab>^WJ
+menutrans &Right\ side<Tab>^WL Vprav&o<Tab>^WL
+menutrans Ne&xt<Tab>^Ww Ï&al¹ie<Tab>^Ww
+menutrans P&revious<Tab>^WW &Predchádzajúce<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= Rovnaká\ vý¹&ka<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maximálna\ vý¹ka<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Minimálna\ vý&¹ka<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maximálna\ ¹írka<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimálna ¹irka<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Rotova&»\ nahor<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotova»\ na&dol<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Vy&bra»\ písmo\.\.\.
+
+" The popup menu
+menutrans &Undo &Spä»
+menutrans Cu&t &Vystrihnú»
+menutrans &Copy &Kopírova»
+menutrans &Paste V&lo¾i»
+menutrans &Delete V&ymaza»
+menutrans Select\ Blockwise Vybra»\ blokovo
+menutrans Select\ &Word Vybra»\ sl&ovo
+menutrans Select\ &Line Vybra»\ &riadok
+menutrans Select\ &Block Vybra»\ &blok
+menutrans Select\ &All Vybra»\ v¹&etko
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otvori» súbor
+ tmenu ToolBar.Save Ulo¾i» súbor
+ tmenu ToolBar.SaveAll Ulo¾i» v¹etky
+ tmenu ToolBar.Print Tlaè
+ tmenu ToolBar.Undo Spä»
+ tmenu ToolBar.Redo Opakova»
+ tmenu ToolBar.Cut Vystrihnú»
+ tmenu ToolBar.Copy Kopírova»
+ tmenu ToolBar.Paste Vlo¾i»
+ tmenu ToolBar.Find Nájs»...
+ tmenu ToolBar.FindNext Nájs» ïal¹ie
+ tmenu ToolBar.FindPrev Nájs» predchádzajúce
+ tmenu ToolBar.Replace Nahradi»...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nové okno
+ tmenu ToolBar.WinSplit Rozdeli» okno
+ tmenu ToolBar.WinMax Maximalizova» okno
+ tmenu ToolBar.WinMin Minimalizova» okno
+ tmenu ToolBar.WinVSplit Rozdeli» okno vertikálne
+ tmenu ToolBar.WinMaxWidth Maximalizova» ¹írku okna
+ tmenu ToolBar.WinMinWidth Minimalizova» ¹írku okna
+ tmenu ToolBar.WinClose Zatvori» okno
+ endif
+ tmenu ToolBar.LoadSesn Naèíta» sedenie
+ tmenu ToolBar.SaveSesn Ulo¾i» sedenie
+ tmenu ToolBar.RunScript Spusti» skript
+ tmenu ToolBar.Make Spusti» make
+ tmenu ToolBar.Shell Spusti» ¹el
+ tmenu ToolBar.RunCtags Spusti» ctags
+ tmenu ToolBar.TagJump Skoèi» na tag pod kurzorom
+ tmenu ToolBar.Help Pomocník
+ tmenu ToolBar.FindHelp Nájs» pomocníka k...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Syntax
+menutrans Set\ '&syntax'\ only Nastavi»\ iba\ 'syntax'
+menutrans Set\ '&filetype'\ too Nastavi»\ aj\ 'filetype'
+menutrans &Off &Vypnú»
+menutrans &Manual &Ruène
+menutrans A&utomatic A&utomaticky
+" menutrans o&n\ (this\ file) &Zapnú»\ (pre\ tento\ súbor)
+" menutrans o&ff\ (this\ file) Vyp&nú»\ (pre\ tento\ súbor )
+menutrans on/off\ for\ &This\ file Zapnú»/vypnú»\ pre\ &tento\ súbor
+menutrans Co&lor\ test Test\ &farieb
+menutrans &Highlight\ test &Test\ zvýrazòovania
+menutrans &Convert\ to\ HTML &Previes»\ do\ HTML
diff --git a/runtime/lang/menu_sk_sk.vim b/runtime/lang/menu_sk_sk.vim
new file mode 100644
index 000000000..0a7504d3e
--- /dev/null
+++ b/runtime/lang/menu_sk_sk.vim
@@ -0,0 +1,9 @@
+" Menu Translations: Slovak
+" Translated By: Martin Lacko <lacko@host.sk>
+" Last Change: 2002 May 27
+
+if has("win32") || has("win16") || has("dos16") || has("dos32")
+ source <sfile>:p:h/menu_sk_sk.1250.vim
+else
+ source <sfile>:p:h/menu_sk_sk.iso_8859-2.vim
+endif
diff --git a/runtime/lang/menu_slovak_slovak_republic.1250.vim b/runtime/lang/menu_slovak_slovak_republic.1250.vim
new file mode 100644
index 000000000..950aea94d
--- /dev/null
+++ b/runtime/lang/menu_slovak_slovak_republic.1250.vim
@@ -0,0 +1,232 @@
+" Menu Translations: Slovak
+" Translated By: Martin Lacko <lacko@host.sk>
+" Last Change: 2003 Mar 30
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding cp1250
+
+" Help menu
+menutrans &Help &Pomocník
+menutrans &Overview<Tab><F1> &Preh¾ad<Tab><F1>
+menutrans &User\ Manual Po&užívate¾ský\ manuál
+menutrans &How-to\ links &Tipy
+menutrans &Find\.\.\. &Nájs\.\.\.
+menutrans &Credits Poï&akovanie
+menutrans O&rphans Si&roty
+menutrans Co&pying &Licencia
+menutrans &Version &Verzia
+menutrans &About &O\ programe
+
+" File menu
+menutrans &File &Súbor
+menutrans &Open\.\.\.<Tab>:e &Otvori\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Ot&vori\ v\ novom\ okne\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nový<Tab>:enew
+menutrans &Close<Tab>:close &Zatvori<Tab>:close
+menutrans &Save<Tab>:w &Uloži<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Uloži\ &ako\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Otvor&i\ porovnanie\ v\ novom\ okne\ s\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Otvo&ri\ aktualizované\ s\.\.\.
+menutrans &Print &Tlaè
+menutrans Sa&ve-Exit<Tab>:wqa U&loži-Koniec<Tab>:wqa
+menutrans E&xit<Tab>:qa &Koniec<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Úpravy
+menutrans &Undo<Tab>u &Spä<Tab>u
+menutrans &Redo<Tab>^R Z&ruši\ spä<Tab>^R
+menutrans Rep&eat<Tab>\. &Opakova<Tab>\.
+menutrans Cu&t<Tab>"+x &Vystrihnú<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopírova<Tab>"+y
+menutrans &Paste<Tab>"+gP V&loži<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Vloži\ &pred<Tab>[p
+menutrans Put\ &After<Tab>]p Vloži\ za<Tab>]p
+menutrans &Select\ all<Tab>ggVG Vy&bra\ všetko<Tab>ggVG
+menutrans &Delete<Tab>x Vy&maza<Tab>x
+menutrans &Find\.\.\. &Nájs\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. N&ahradi\.\.\.
+menutrans Settings\ &Window Mo&žnosti
+menutrans &Global\ Settings &Globálne možnosti
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Prepnú\ paletu\ zvýrazòovania<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Prepnú\ &ignorovanie ve¾kosti<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Prepnú\ &ukáza\ zhodu<Tab>:set\ sm!
+menutrans &Context\ lines &Kontextové\ riadky
+menutrans &Virtual\ Edit &Virtuálne úpravy
+menutrans Never Nikdy
+menutrans Block\ Selection Blokový\ výber
+menutrans Insert\ mode Režim\ vkladania
+menutrans Block\ and\ Insert Blok\ a\ vkladanie
+menutrans Always Vždy
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Prepnú\ reži&m\ vkladania<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Prepnú\ vi\ kompatibilitu<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Cesta\ &h¾adania\.\.\.
+menutrans Ta&g\ Files\.\.\. Ta&gové súbory\.\.\.
+menutrans Toggle\ &Toolbar Prepnú\ &panel
+menutrans Toggle\ &Bottom\ Scrollbar Prepnú\ spodný\ posuvník
+menutrans Toggle\ &Left\ Scrollbar Prepnú\ ¾avý\ posuvník
+menutrans Toggle\ &Right\ Scrollbar Prepnú\ pravý\ posuvník
+menutrans F&ile\ Settings Nastavenia\ súboru
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Prepnú\ èíslova&nie\ riadkov<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Prepnú\ režim\ &zoznamu<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Prepnú\ z&alamovanie\ riadkov<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prepnú\ za&lamovanie\ slov<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Prepnú\ rozšír&ené\ tabulátory<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Prepnú\ automatické\ &odsadzovanie<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Prepnú\ &C-odsadzovanie<Tab>:set\ cin!
+menutrans &Shiftwidth &Šírka\ šiftu
+menutrans Soft\ &Tabstop &Softvérový\ tabulátor
+menutrans Te&xt\ Width\.\.\. Šírka\ te&xtu\.\.\.
+menutrans &File\ Format\.\.\. &Formát\ súboru\.\.\.
+menutrans C&olor\ Scheme Far&ebná\ schéma
+
+" Programming menu
+menutrans &Tools &Nástroje
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèi\ na\ znaèku<Tab>g^]
+menutrans Jump\ &back<Tab>^T Sk&oèi\ spä<Tab>^T
+menutrans Build\ &Tags\ File &Vytvori\ súbor\ znaèiek
+menutrans &Folding &Vnáranie
+menutrans &Enable/Disable\ folds<Tab>zi Zapnú/Vypnú\ vnárani&e<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Zobrazi\ kurzoro&vý\ riadok<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Zobrazi\ iba\ kurzorový\ riadok<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Zatvori\ viac \vnorení<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zatvor&i\ všetky\ vnorenia<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr O&tvori\ viac\ vnorení<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR &Otvori\ všetky\ vnorenia<Tab>zR
+menutrans Fold\ Met&hod Metó&da\ vnárania
+menutrans M&anual M&anuálne
+menutrans I&ndent Odsade&nie
+menutrans E&xpression &Výraz
+menutrans S&yntax S&yntax
+menutrans &Diff Roz&diel
+menutrans Ma&rker Zna&èkovaè
+menutrans Create\ &Fold<Tab>zf Vyt&vori\ vnorenie<Tab>zf
+menutrans &Delete\ Fold<Tab>zd V&ymaza\ vnorenie<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Vymaza\ všetky\ vnorenia<Tab>zD
+menutrans Fold\ column\ &width Šírka\ &vkladaného\ ståpca
+menutrans &Diff &Rozdiely
+menutrans &Update Akt&ualizova
+menutrans &Get\ Block Zob&ra\ blok
+menutrans &Put\ Block &Vloži\ blok
+menutrans Error\ &Window Chybové\ &okno
+menutrans &Update<Tab>:cwin Akt&ualizova<Tab>:cwin
+menutrans &Open<Tab>:copen &Otvori<Tab>:copen
+menutrans &Close<Tab>:cclose &Zatvori<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd &Konvertova\ do\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Konve&rtova\ spä<Tab>:%!xxd\ -r
+menutrans &Make<Tab>:make &Make<Tab>:make
+menutrans &List\ Errors<Tab>:cl Výpis\ &chýb<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Výp&is\ správ<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Ïa&lšia\ chyba<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &Predchádzajúca\ chyba<Tab>:cp
+menutrans &Older\ List<Tab>:cold Sta&rší\ zoznam<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Novší\ &zoznam<Tab>:cnew
+menutrans Error\ &Window<Tab>:cwin Chybové\ o&kno<Tab>:cwin
+menutrans &Set\ Compiler Vyberte\ k&ompilátor
+menutrans Convert\ to\ HEX<Tab>:%!xxd Prvies\ do\ šes&tnástkového\ formátu<Tab>:%!xxd
+menutrans Convert\ back<Tab>:%!xxd\ -r Pr&evies\ spä<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &Vyrovnávacia\ pamä
+menutrans &Refresh\ menu Obnovi
+menutrans &Delete Vymaza
+menutrans &Alternate Zmeni
+menutrans &Next Ï&alšia
+menutrans &Previous &Predchádzajúca
+menutrans [No File] [Žiadny\ súbor]
+
+" Window menu
+menutrans &Window &Okná
+menutrans &New<Tab>^Wn &Nové<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Rozdeli<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Ro&zdeli\ na\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Rozdeli\ &vertikálne<Tab>^Wv
+menutrans Split\ File\ E&xplorer Otvori\ pri&eskumníka
+menutrans &Close<Tab>^Wc Zatvor&i<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zatvori\ i&né<Tab>^Wo
+menutrans Move\ &To Presunú&
+menutrans &Top<Tab>^WK Na&hor<Tab>^WK
+menutrans &Bottom<Tab>^WJ Nado&l<Tab>^WJ
+menutrans &Left\ side<Tab>^WH V&¾avo<Tab>^WJ
+menutrans &Right\ side<Tab>^WL Vprav&o<Tab>^WL
+menutrans Ne&xt<Tab>^Ww Ï&alšie<Tab>^Ww
+menutrans P&revious<Tab>^WW &Predchádzajúce<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= Rovnaká\ výš&ka<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maximálna\ výška<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Minimálna\ vý&ška<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maximálna\ šírka<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimálna širka<Tab>^W1\|
+menutrans Rotate\ &Up<Tab>^WR Rotova&\ nahor<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotova\ na&dol<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Vy&bra\ písmo\.\.\.
+
+" The popup menu
+menutrans &Undo &Spä
+menutrans Cu&t &Vystrihnú
+menutrans &Copy &Kopírova
+menutrans &Paste V&loži
+menutrans &Delete V&ymaza
+menutrans Select\ Blockwise Vybra\ blokovo
+menutrans Select\ &Word Vybra\ sl&ovo
+menutrans Select\ &Line Vybra\ &riadok
+menutrans Select\ &Block Vybra\ &blok
+menutrans Select\ &All Vybra\ vš&etko
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Otvori súbor
+ tmenu ToolBar.Save Uloži súbor
+ tmenu ToolBar.SaveAll Uloži všetky
+ tmenu ToolBar.Print Tlaè
+ tmenu ToolBar.Undo Spä
+ tmenu ToolBar.Redo Opakova
+ tmenu ToolBar.Cut Vystrihnú
+ tmenu ToolBar.Copy Kopírova
+ tmenu ToolBar.Paste Vloži
+ tmenu ToolBar.Find Nájs...
+ tmenu ToolBar.FindNext Nájs ïalšie
+ tmenu ToolBar.FindPrev Nájs predchádzajúce
+ tmenu ToolBar.Replace Nahradi...
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nové okno
+ tmenu ToolBar.WinSplit Rozdeli okno
+ tmenu ToolBar.WinMax Maximalizova okno
+ tmenu ToolBar.WinMin Minimalizova okno
+ tmenu ToolBar.WinVSplit Rozdeli okno vertikálne
+ tmenu ToolBar.WinMaxWidth Maximalizova šírku okna
+ tmenu ToolBar.WinMinWidth Minimalizova šírku okna
+ tmenu ToolBar.WinClose Zatvori okno
+ endif
+ tmenu ToolBar.LoadSesn Naèíta sedenie
+ tmenu ToolBar.SaveSesn Uloži sedenie
+ tmenu ToolBar.RunScript Spusti skript
+ tmenu ToolBar.Make Spusti make
+ tmenu ToolBar.Shell Spusti šel
+ tmenu ToolBar.RunCtags Spusti ctags
+ tmenu ToolBar.TagJump Skoèi na tag pod kurzorom
+ tmenu ToolBar.Help Pomocník
+ tmenu ToolBar.FindHelp Nájs pomocníka k...
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Syntax
+menutrans Set\ '&syntax'\ only Nastavi\ iba\ 'syntax'
+menutrans Set\ '&filetype'\ too Nastavi\ aj\ 'filetype'
+menutrans &Off &Vypnú
+menutrans &Manual &Ruène
+menutrans A&utomatic A&utomaticky
+" menutrans o&n\ (this\ file) &Zapnú\ (pre\ tento\ súbor)
+" menutrans o&ff\ (this\ file) Vyp&nú\ (pre\ tento\ súbor )
+menutrans on/off\ for\ &This\ file Zapnú/vypnú\ pre\ &tento\ súbor
+menutrans Co&lor\ test Test\ &farieb
+menutrans &Highlight\ test &Test\ zvýrazòovania
+menutrans &Convert\ to\ HTML &Previes\ do\ HTML
diff --git a/runtime/lang/menu_spanish_spain.850.vim b/runtime/lang/menu_spanish_spain.850.vim
new file mode 100644
index 000000000..4a96a397d
--- /dev/null
+++ b/runtime/lang/menu_spanish_spain.850.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/menu_es_es.latin1.vim
diff --git a/runtime/lang/menu_sr.utf-8.vim b/runtime/lang/menu_sr.utf-8.vim
new file mode 100644
index 000000000..915c31a58
--- /dev/null
+++ b/runtime/lang/menu_sr.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Serbian
+
+source <sfile>:p:h/menu_sr_yu.utf-8.vim
diff --git a/runtime/lang/menu_sr_yu.ascii.vim b/runtime/lang/menu_sr_yu.ascii.vim
new file mode 100644
index 000000000..14a902604
--- /dev/null
+++ b/runtime/lang/menu_sr_yu.ascii.vim
@@ -0,0 +1,258 @@
+" Menu Translations: Serbian
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+" Last Change: Fri, 30 May 2003 12:15:30 -0400
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" Help menu
+menutrans &Help Pomo&c
+menutrans &Overview<Tab><F1> &Pregled<Tab><F1>
+menutrans &User\ Manual &Uputstvo\ za\ korisnike
+menutrans &How-to\ links &Kako\ da\.\.\.
+menutrans &Find &Nadji
+menutrans &Credits &Zasluge
+menutrans Co&pying P&reuzimanje
+menutrans O&rphans &Sirocici
+menutrans &Version &Verzija
+menutrans &About &O\ programu
+
+" File menu
+menutrans &File &Datoteka
+menutrans &Open\.\.\.<Tab>:e &Otvori\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp &Podeli-otvori\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nova<Tab>:enew
+menutrans &Close<Tab>:close &Zatvori<Tab>:close
+menutrans &Save<Tab>:w &Sacuvaj<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Sacuvaj\ &kao\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Podeli\ i\ &uporedi\ sa\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Po&deli\ i\ prepravi\ sa\.\.\.
+menutrans &Print Sta&mpaj
+menutrans Sa&ve-Exit<Tab>:wqa Sacuvaj\ i\ za&vrsi<Tab>:wqa
+menutrans E&xit<Tab>:qa K&raj<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Uredjivanje
+menutrans &Undo<Tab>u &Vrati<Tab>u
+menutrans &Redo<Tab>^R &Povrati<Tab>^R
+menutrans Rep&eat<Tab>\. P&onovi<Tab>\.
+menutrans Cu&t<Tab>"+x Ise&ci<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiraj<Tab>"+y
+menutrans &Paste<Tab>"+gP &Ubaci<Tab>"+gP
+menutrans &Paste<Tab>"+P &Ubaci<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Stavi\ pre&d<Tab>[p
+menutrans Put\ &After<Tab>]p Stavi\ &iza<Tab>]p
+menutrans &Delete<Tab>x Iz&brisi<Tab>x
+menutrans &Select\ all<Tab>ggVG Izaberi\ sv&e<Tab>ggVG
+menutrans &Find\.\.\. &Nadji\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Nadji\ i\ &zameni\.\.\.
+menutrans Settings\ &Window P&rozor\ podesavanja
+menutrans &Global\ Settings Op&sta\ podesavanja
+menutrans F&ile\ Settings Podesavanja\ za\ da&toteke
+menutrans &Shiftwidth &Pomeraj
+menutrans Soft\ &Tabstop &Meka\ tabulacija
+menutrans Te&xt\ Width\.\.\. &Sirina\ teksta\.\.\.
+menutrans &File\ Format\.\.\. &Vrsta\ datoteke\.\.\.
+menutrans C&olor\ Scheme Bo&je
+menutrans &Keymap Pres&likavanje\ tastature
+menutrans Select\ Fo&nt\.\.\. Izbor\ &fonta\.\.\.
+
+" Edit/Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Naglasi\ &obrazce\ (da/ne)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Zanemari\ \velicinu\ &slova\ (da/ne)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Proveri\ pratecu\ &zagradu\ (da/ne)<Tab>:set\ sm!
+menutrans &Context\ lines Vidljivi\ &redovi
+menutrans &Virtual\ Edit Virtuelno\ &uredjivanje
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Rezim\ u&nosa\ (da/ne)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Putanja\ &pretrage\.\.\.
+menutrans Ta&g\ Files\.\.\. &Datoteke\ oznaka\.\.\.
+menutrans Toggle\ &Toolbar Linija\ sa\ &alatkama\ (da/ne)
+menutrans Toggle\ &Bottom\ Scrollbar Donja\ l&inija\ klizanja\ (da/ne)
+menutrans Toggle\ &Left\ Scrollbar &Leva\ linija\ klizanja\ (da/ne)
+menutrans Toggle\ &Right\ Scrollbar &Desna\ linija\ klizanja\ (da/ne)
+
+" Edit/Global Settings/Virtual Edit
+menutrans Never Nikad
+menutrans Block\ Selection Izbor\ bloka
+menutrans Insert\ mode Rezim\ unosa
+menutrans Block\ and\ Insert Blok\ i\ unos
+menutrans Always Uvek
+
+" Edit/File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Redni\ &brojevi\ (da/ne)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Rezim\ &liste\ (da/ne)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prelomi\ &na\ rec\ (da/ne)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Auto-&uvlacenje\ (da/ne)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Ce-uvlacenje\ (da/ne)<Tab>:set\ cin!
+
+" Edit/Keymap
+menutrans None Nijedan
+
+" Tools menu
+menutrans &Tools &Alatke
+menutrans &Jump\ to\ this\ tag<Tab>g^] Skoci\ na\ &ovu\ oznaku<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skoci\ &natrag<Tab>^T
+menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka
+menutrans &Folding &Podvijanje
+menutrans Create\ &Fold<Tab>zf S&tvori\ podvijutak<Tab>zf
+menutrans &Delete\ Fold<Tab>zd O&brisi\ podvijutak<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Obrisi\ sve\ po&dvijutke<Tab>zD
+menutrans Fold\ column\ &width Sirina\ &reda\ podvijutka
+menutrans &Diff &Uporedjivanje
+menutrans &Make<Tab>:make 'mak&e'<Tab>:make
+menutrans &List\ Errors<Tab>:cl Spisak\ &gresaka<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Sp&isak\ poruka<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn S&ledeca\ greska<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Pre&thodna\ greska<Tab>:cp
+menutrans &Older\ List<Tab>:cold Stari\ spisa&k<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew No&vi\ spisak<Tab>:cnew
+menutrans Error\ &Window Prozor\ sa\ g&reskama
+menutrans &Set\ Compiler I&zaberi\ prevodioca
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ u\ &HEKS<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik<Tab>:%!xxd\ -r
+
+" Tools/Folding
+menutrans &Enable/Disable\ folds<Tab>zi &Omoguci/prekini\ podvijanje<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Pokazi\ red\ sa\ kursorom<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Pokazi\ &samo\ red\ sa\ kursorom<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Zatvori\ vise\ podvijutaka<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zatvori\ s&ve\ podvijutke<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Otvori\ vis&e\ podvijutaka<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR O&tvori\ sve\ podvijutke<Tab>zR
+menutrans Fold\ Met&hod &Nacin\ podvijanja
+
+" Tools/Folding/Fold Method
+menutrans M&anual &Rucno
+menutrans I&ndent &Uvucenost
+menutrans E&xpression &Izraz
+menutrans S&yntax &Sintaksa
+"menutrans &Diff
+menutrans Ma&rker &Oznaka
+
+" Tools/Diff
+menutrans &Update &Azuriraj
+menutrans &Get\ Block &Prihvati\ izmenu
+menutrans &Put\ Block Pre&baci\ izmenu
+
+" Tools/Error Window
+menutrans &Update<Tab>:cwin &Azuriraj<Tab>:cwin
+menutrans &Open<Tab>:copen &Otvori<Tab>:copen
+menutrans &Close<Tab>:cclose &Zatvori<Tab>:cclose
+
+" Bufers menu
+menutrans &Buffers &Baferi
+menutrans &Refresh\ menu &Azuriraj
+menutrans Delete &Obrisi
+menutrans &Alternate A&lternativni
+menutrans &Next &Sledeci
+menutrans &Previous &Prethodni
+menutrans [No\ File] [Nema\ datoteke]
+
+" Window menu
+menutrans &Window &Prozor
+menutrans &New<Tab>^Wn &Novi<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Podeli<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Podeli\ sa\ &alternativnim<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Podeli\ &uspravno<Tab>^Wv
+menutrans Split\ File\ E&xplorer Podeli\ za\ pregled\ &datoteka
+menutrans &Close<Tab>^Wc &Zatvori<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zatvori\ &ostale<Tab>^Wo
+"menutrans Ne&xt<Tab>^Ww &Sledeci<Tab>^Ww
+"menutrans P&revious<Tab>^WW P&rethodni<Tab>^WW
+menutrans Move\ &To Pre&mesti
+menutrans Rotate\ &Up<Tab>^WR &Kruzno\ nagore<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Kruzno\ nadol&e<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= &Iste\ velicine<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Maksimalna\ &visina<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Minima&lna\ visina<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maksimalna\ &sirina<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimalna\ si&rina<Tab>^W1\|
+
+" Window/Move To
+menutrans &Top<Tab>^WK &Vrh<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Podnozje<Tab>^WJ
+menutrans &Left\ side<Tab>^WH U&levo<Tab>^WH
+menutrans &Right\ side<Tab>^WL U&desno<Tab>^WL
+
+" The popup menu
+menutrans &Undo &Vrati
+menutrans Cu&t &Iseci
+menutrans &Copy &Kopiraj
+menutrans &Paste &Ubaci
+menutrans &Delete I&zbrisi
+menutrans Select\ Blockwise Biraj\ &pravougaono
+menutrans Select\ &Word Izaberi\ &rec
+menutrans Select\ &Line Izaberi\ r&ed
+menutrans Select\ &Block Izaberi\ &blok
+menutrans Select\ &All Izaberi\ &sve
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Ucitaj
+ tmenu ToolBar.Save Sacuvaj
+ tmenu ToolBar.SaveAll Sacuvaj sve
+ tmenu ToolBar.Print Stampaj
+ tmenu ToolBar.Undo Vrati
+ tmenu ToolBar.Redo Povrati
+ tmenu ToolBar.Cut Iseci
+ tmenu ToolBar.Copy Kopiraj
+ tmenu ToolBar.Paste Ubaci
+ tmenu ToolBar.Find Nadji
+ tmenu ToolBar.FindNext Nadji sledeci
+ tmenu ToolBar.FindPrev Nadji prethodni
+ tmenu ToolBar.Replace Zameni
+ tmenu ToolBar.New Novi
+ tmenu ToolBar.WinSplit Podeli prozor
+ tmenu ToolBar.WinMax Maksimalna visina
+ tmenu ToolBar.WinMin Minimalna visina
+ tmenu ToolBar.WinVSplit Podeli uspravno
+ tmenu ToolBar.WinMaxWidth Maksimalna sirina
+ tmenu ToolBar.WinMinWidth Minimalna sirina
+ tmenu ToolBar.WinClose Zatvori prozor
+ tmenu ToolBar.LoadSesn Ucitaj seansu
+ tmenu ToolBar.SaveSesn Sacuvaj seansu
+ tmenu ToolBar.RunScript Izvrsi spis
+ tmenu ToolBar.Make 'make'
+ tmenu ToolBar.Shell Operativno okruzenje
+ tmenu ToolBar.RunCtags Napravi oznake
+ tmenu ToolBar.TagJump Idi na oznaku
+ tmenu ToolBar.Help Pomoc
+ tmenu ToolBar.FindHelp Nadji objasnjenje
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaksa
+menutrans &Show\ filetypes\ in\ menu Izbor\ 'filetype'\ iz\ &menija
+menutrans Set\ '&syntax'\ only Pode&si\ 'syntax'\ samo
+menutrans Set\ '&filetype'\ too Podesi\ 'filetype'\ &takodje
+menutrans &Off &Iskljuceno
+menutrans &Manual &Rucno
+menutrans A&utomatic &Automatski
+menutrans on/off\ for\ &This\ file Da/ne\ za\ ovu\ &datoteku
+menutrans Co&lor\ test Provera\ &boja
+menutrans &Highlight\ test Provera\ isti&canja
+menutrans &Convert\ to\ HTML Pretvori\ &u\ HTML
+
+" dialog texts
+let menutrans_help_dialog = "Unesite naredbu ili rec cije pojasnjenje trazite:\n\nDodajte i_ za naredbe unosa (npr. i_CTRL-X)\nDodajte c_ za naredbe komandnog rezima (npr. s_<Del>)\nDodajte ' za imena opcija (npr. 'shiftwidth')"
+
+let g:menutrans_path_dialog = "Unesite put pretrage za datoteke\nRazdvojite zarezima imena direktorijuma."
+
+let g:menutrans_tags_dialog = "Unesite imena datoteka sa oznakama\nRazdvojite zarezima imena."
+
+let g:menutrans_textwidth_dialog = "Unesite novu sirinu teksta (0 sprecava prelom)"
+
+let g:menutrans_fileformat_dialog = "Izaberite vrstu datoteke"
+
+let menutrans_no_file = "[Nema datoteke]"
diff --git a/runtime/lang/menu_sr_yu.iso_8859-2.vim b/runtime/lang/menu_sr_yu.iso_8859-2.vim
new file mode 100644
index 000000000..992124c84
--- /dev/null
+++ b/runtime/lang/menu_sr_yu.iso_8859-2.vim
@@ -0,0 +1,259 @@
+" Menu Translations: Serbian
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+" Last Change: Fri, 30 May 2003 12:04:48 -0400
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+scriptencoding iso8859-2
+
+" Help menu
+menutrans &Help Pomo&æ
+menutrans &Overview<Tab><F1> &Pregled<Tab><F1>
+menutrans &User\ Manual &Uputstvo\ za\ korisnike
+menutrans &How-to\ links &Kako\ da\.\.\.
+menutrans &Find &Naði
+menutrans &Credits &Zasluge
+menutrans Co&pying P&reuzimanje
+menutrans O&rphans &Siroèiæi
+menutrans &Version &Verzija
+menutrans &About &O\ programu
+
+" File menu
+menutrans &File &Datoteka
+menutrans &Open\.\.\.<Tab>:e &Otvori\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp &Podeli-otvori\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Nova<Tab>:enew
+menutrans &Close<Tab>:close &Zatvori<Tab>:close
+menutrans &Save<Tab>:w &Saèuvaj<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Saèuvaj\ &kao\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Podeli\ i\ &uporedi\ sa\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Po&deli\ i\ prepravi\ sa\.\.\.
+menutrans &Print ©ta&mpaj
+menutrans Sa&ve-Exit<Tab>:wqa Saèuvaj\ i\ za&vr¹i<Tab>:wqa
+menutrans E&xit<Tab>:qa K&raj<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Ureðivanje
+menutrans &Undo<Tab>u &Vrati<Tab>u
+menutrans &Redo<Tab>^R &Povrati<Tab>^R
+menutrans Rep&eat<Tab>\. P&onovi<Tab>\.
+menutrans Cu&t<Tab>"+x Ise&ci<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiraj<Tab>"+y
+menutrans &Paste<Tab>"+gP &Ubaci<Tab>"+gP
+menutrans &Paste<Tab>"+P &Ubaci<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Stavi\ pre&d<Tab>[p
+menutrans Put\ &After<Tab>]p Stavi\ &iza<Tab>]p
+menutrans &Delete<Tab>x Iz&bri¹i<Tab>x
+menutrans &Select\ all<Tab>ggVG Izaberi\ sv&e<Tab>ggVG
+menutrans &Find\.\.\. &Naði\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Naði\ i\ &zameni\.\.\.
+menutrans Settings\ &Window P&rozor\ pode¹avanja
+menutrans &Global\ Settings Op&¹ta\ pode¹avanja
+menutrans F&ile\ Settings Pode¹avanja\ za\ da&toteke
+menutrans &Shiftwidth &Pomeraj
+menutrans Soft\ &Tabstop &Meka\ tabulacija
+menutrans Te&xt\ Width\.\.\. &©irina\ teksta\.\.\.
+menutrans &File\ Format\.\.\. &Vrsta\ datoteke\.\.\.
+menutrans C&olor\ Scheme Bo&je
+menutrans &Keymap Pres&likavanje\ tastature
+menutrans Select\ Fo&nt\.\.\. Izbor\ &fonta\.\.\.
+
+" Edit/Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Naglasi\ &obrazce\ (da/ne)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Zanemari\ \velièinu\ &slova\ (da/ne)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Proveri\ prateæu\ &zagradu\ (da/ne)<Tab>:set\ sm!
+menutrans &Context\ lines Vidljivi\ &redovi
+menutrans &Virtual\ Edit Virtuelno\ &ureðivanje
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Re¾im\ u&nosa\ (da/ne)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ saglasno\ (da/ne)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Putanja\ &pretrage\.\.\.
+menutrans Ta&g\ Files\.\.\. &Datoteke\ oznaka\.\.\.
+menutrans Toggle\ &Toolbar Linija\ sa\ &alatkama\ (da/ne)
+menutrans Toggle\ &Bottom\ Scrollbar Donja\ l&inija\ klizanja\ (da/ne)
+menutrans Toggle\ &Left\ Scrollbar &Leva\ linija\ klizanja\ (da/ne)
+menutrans Toggle\ &Right\ Scrollbar &Desna\ linija\ klizanja\ (da/ne)
+
+" Edit/Global Settings/Virtual Edit
+menutrans Never Nikad
+menutrans Block\ Selection Izbor\ bloka
+menutrans Insert\ mode Re¾im\ unosa
+menutrans Block\ and\ Insert Blok\ i\ unos
+menutrans Always Uvek
+
+" Edit/File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Redni\ &brojevi\ (da/ne)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Re¾im\ &liste\ (da/ne)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Obavijanje\ &redova\ (da/ne)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Prelomi\ &na\ reè\ (da/ne)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Razmaci\ umesto\ &tabulacije\ (da/ne)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Auto-&uvlaèenje\ (da/ne)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Ce-uvlaèenje\ (da/ne)<Tab>:set\ cin!
+
+" Edit/Keymap
+menutrans None Nijedan
+
+" Tools menu
+menutrans &Tools &Alatke
+menutrans &Jump\ to\ this\ tag<Tab>g^] Skoèi\ na\ &ovu\ oznaku<Tab>g^]
+menutrans Jump\ &back<Tab>^T Skoèi\ &natrag<Tab>^T
+menutrans Build\ &Tags\ File Izgradi\ &datoteku\ oznaka
+menutrans &Folding &Podvijanje
+menutrans Create\ &Fold<Tab>zf S&tvori\ podvijutak<Tab>zf
+menutrans &Delete\ Fold<Tab>zd O&bri¹i\ podvijutak<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Obri¹i\ sve\ po&dvijutke<Tab>zD
+menutrans Fold\ column\ &width ©irina\ &reda\ podvijutka
+menutrans &Diff &Uporeðivanje
+menutrans &Make<Tab>:make 'mak&e'<Tab>:make
+menutrans &List\ Errors<Tab>:cl Spisak\ &gre¹aka<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Sp&isak\ poruka<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn S&ledeæa\ gre¹ka<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Pre&thodna\ gre¹ka<Tab>:cp
+menutrans &Older\ List<Tab>:cold Stari\ spisa&k<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew No&vi\ spisak<Tab>:cnew
+menutrans Error\ &Window Prozor\ sa\ g&re¹kama
+menutrans &Set\ Compiler I&zaberi\ prevodioca
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ u\ &HEKS<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Vr&ati\ u\ prvobitan\ oblik<Tab>:%!xxd\ -r
+
+" Tools/Folding
+menutrans &Enable/Disable\ folds<Tab>zi &Omoguæi/prekini\ podvijanje<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Poka¾i\ red\ sa\ kursorom<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Poka¾i\ &samo\ red\ sa\ kursorom<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Zatvori\ vi¹e\ podvijutaka<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Zatvori\ s&ve\ podvijutke<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Otvori\ vi¹&e\ podvijutaka<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR O&tvori\ sve\ podvijutke<Tab>zR
+menutrans Fold\ Met&hod &Naèin\ podvijanja
+
+" Tools/Folding/Fold Method
+menutrans M&anual &Ruèno
+menutrans I&ndent &Uvuèenost
+menutrans E&xpression &Izraz
+menutrans S&yntax &Sintaksa
+"menutrans &Diff
+menutrans Ma&rker &Oznaka
+
+" Tools/Diff
+menutrans &Update &A¾uriraj
+menutrans &Get\ Block &Prihvati\ izmenu
+menutrans &Put\ Block Pre&baci\ izmenu
+
+" Tools/Error Window
+menutrans &Update<Tab>:cwin &A¾uriraj<Tab>:cwin
+menutrans &Open<Tab>:copen &Otvori<Tab>:copen
+menutrans &Close<Tab>:cclose &Zatvori<Tab>:cclose
+
+" Bufers menu
+menutrans &Buffers &Baferi
+menutrans &Refresh\ menu &A¾uriraj
+menutrans Delete &Obri¹i
+menutrans &Alternate A&lternativni
+menutrans &Next &Sledeæi
+menutrans &Previous &Prethodni
+menutrans [No\ File] [Nema\ datoteke]
+
+" Window menu
+menutrans &Window &Prozor
+menutrans &New<Tab>^Wn &Novi<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Podeli<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Podeli\ sa\ &alternativnim<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Podeli\ &uspravno<Tab>^Wv
+menutrans Split\ File\ E&xplorer Podeli\ za\ pregled\ &datoteka
+menutrans &Close<Tab>^Wc &Zatvori<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Zatvori\ &ostale<Tab>^Wo
+"menutrans Ne&xt<Tab>^Ww &Sledeæi<Tab>^Ww
+"menutrans P&revious<Tab>^WW P&rethodni<Tab>^WW
+menutrans Move\ &To Pre&mesti
+menutrans Rotate\ &Up<Tab>^WR &Kru¾no\ nagore<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Kru¾no\ nadol&e<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= &Iste\ velièine<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Maksimalna\ &visina<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Minima&lna\ visina<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maksimalna\ &¹irina<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimalna\ ¹i&rina<Tab>^W1\|
+
+" Window/Move To
+menutrans &Top<Tab>^WK &Vrh<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Podno¾je<Tab>^WJ
+menutrans &Left\ side<Tab>^WH U&levo<Tab>^WH
+menutrans &Right\ side<Tab>^WL U&desno<Tab>^WL
+
+" The popup menu
+menutrans &Undo &Vrati
+menutrans Cu&t &Iseci
+menutrans &Copy &Kopiraj
+menutrans &Paste &Ubaci
+menutrans &Delete I&zbri¹i
+menutrans Select\ Blockwise Biraj\ &pravougaono
+menutrans Select\ &Word Izaberi\ &reè
+menutrans Select\ &Line Izaberi\ r&ed
+menutrans Select\ &Block Izaberi\ &blok
+menutrans Select\ &All Izaberi\ &sve
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Uèitaj
+ tmenu ToolBar.Save Saèuvaj
+ tmenu ToolBar.SaveAll Saèuvaj sve
+ tmenu ToolBar.Print ©tampaj
+ tmenu ToolBar.Undo Vrati
+ tmenu ToolBar.Redo Povrati
+ tmenu ToolBar.Cut Iseci
+ tmenu ToolBar.Copy Kopiraj
+ tmenu ToolBar.Paste Ubaci
+ tmenu ToolBar.Find Naði
+ tmenu ToolBar.FindNext Naði sledeæi
+ tmenu ToolBar.FindPrev Naði prethodni
+ tmenu ToolBar.Replace Zameni
+ tmenu ToolBar.New Novi
+ tmenu ToolBar.WinSplit Podeli prozor
+ tmenu ToolBar.WinMax Maksimalna visina
+ tmenu ToolBar.WinMin Minimalna visina
+ tmenu ToolBar.WinVSplit Podeli uspravno
+ tmenu ToolBar.WinMaxWidth Maksimalna ¹irina
+ tmenu ToolBar.WinMinWidth Minimalna ¹irina
+ tmenu ToolBar.WinClose Zatvori prozor
+ tmenu ToolBar.LoadSesn Uèitaj seansu
+ tmenu ToolBar.SaveSesn Saèuvaj seansu
+ tmenu ToolBar.RunScript Izvr¹i spis
+ tmenu ToolBar.Make 'make'
+ tmenu ToolBar.Shell Operativno okru¾enje
+ tmenu ToolBar.RunCtags Napravi oznake
+ tmenu ToolBar.TagJump Idi na oznaku
+ tmenu ToolBar.Help Pomoæ
+ tmenu ToolBar.FindHelp Naði obja¹njenje
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Sintaksa
+menutrans &Show\ filetypes\ in\ menu Izbor\ 'filetype'\ iz\ &menija
+menutrans Set\ '&syntax'\ only Pode&si\ 'syntax'\ samo
+menutrans Set\ '&filetype'\ too Podesi\ 'filetype'\ &takoðe
+menutrans &Off &Iskljuèeno
+menutrans &Manual &Ruèno
+menutrans A&utomatic &Automatski
+menutrans on/off\ for\ &This\ file Da/ne\ za\ ovu\ &datoteku
+menutrans Co&lor\ test Provera\ &boja
+menutrans &Highlight\ test Provera\ isti&canja
+menutrans &Convert\ to\ HTML Pretvori\ &u\ HTML
+
+" dialog texts
+let menutrans_help_dialog = "Unesite naredbu ili reè èije poja¹njenje tra¾ite:\n\nDodajte i_ za naredbe unosa (npr. i_CTRL-X)\nDodajte c_ za naredbe komandnog re¾ima (npr. s_<Del>)\nDodajte ' za imena opcija (npr. 'shiftwidth')"
+
+let g:menutrans_path_dialog = "Unesite put pretrage za datoteke\nRazdvojite zarezima imena direktorijuma."
+
+let g:menutrans_tags_dialog = "Unesite imena datoteka sa oznakama\nRazdvojite zarezima imena."
+
+let g:menutrans_textwidth_dialog = "Unesite novu ¹irinu teksta (0 spreèava prelom)"
+
+let g:menutrans_fileformat_dialog = "Izaberite vrstu datoteke"
+
+let menutrans_no_file = "[Nema datoteke]"
diff --git a/runtime/lang/menu_sr_yu.iso_8859-5.vim b/runtime/lang/menu_sr_yu.iso_8859-5.vim
new file mode 100644
index 000000000..e4d322dc6
--- /dev/null
+++ b/runtime/lang/menu_sr_yu.iso_8859-5.vim
@@ -0,0 +1,259 @@
+" Menu Translations: Serbian
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+" Last Change: Fri, 30 May 2003 12:02:07 -0400
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+scriptencoding iso8859-5
+
+" Help menu
+menutrans &Help ¿ÞÜÞ&û
+menutrans &Overview<Tab><F1> &¿àÕÓÛÕÔ<Tab><F1>
+menutrans &User\ Manual &ÃßãâáâÒÞ\ ×Ð\ ÚÞàØáÝØÚÕ
+menutrans &How-to\ links &ºÐÚÞ\ ÔÐ\.\.\.
+menutrans &Find &½ÐòØ
+menutrans &Credits &·ÐáÛãÓÕ
+menutrans Co&pying ¿&àÕã×ØÜÐúÕ
+menutrans O&rphans &ÁØàÞçØûØ
+menutrans &Version &²Õà×ØøÐ
+menutrans &About &¾\ ßàÞÓàÐÜã
+
+" File menu
+menutrans &File &´ÐâÞâÕÚÐ
+menutrans &Open\.\.\.<Tab>:e &¾âÒÞàØ\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp &¿ÞÔÕÛØ-ÞâÒÞàØ\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &½ÞÒÐ<Tab>:enew
+menutrans &Close<Tab>:close &·ÐâÒÞàØ<Tab>:close
+menutrans &Save<Tab>:w &ÁÐçãÒÐø<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav ÁÐçãÒÐø\ &ÚÐÞ\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. ¿ÞÔÕÛØ\ Ø\ &ãßÞàÕÔØ\ áÐ\.\.\.
+menutrans Split\ Patched\ &By\.\.\. ¿Þ&ÔÕÛØ\ Ø\ ßàÕßàÐÒØ\ áÐ\.\.\.
+menutrans &Print ÈâÐ&ÜßÐø
+menutrans Sa&ve-Exit<Tab>:wqa ÁÐçãÒÐø\ Ø\ ×Ð&ÒàèØ<Tab>:wqa
+menutrans E&xit<Tab>:qa º&àÐø<Tab>:qa
+
+" Edit menu
+menutrans &Edit &ÃàÕòØÒÐúÕ
+menutrans &Undo<Tab>u &²àÐâØ<Tab>u
+menutrans &Redo<Tab>^R &¿ÞÒàÐâØ<Tab>^R
+menutrans Rep&eat<Tab>\. ¿&ÞÝÞÒØ<Tab>\.
+menutrans Cu&t<Tab>"+x ¸áÕ&æØ<Tab>"+x
+menutrans &Copy<Tab>"+y &ºÞßØàÐø<Tab>"+y
+menutrans &Paste<Tab>"+gP &ÃÑÐæØ<Tab>"+gP
+menutrans &Paste<Tab>"+P &ÃÑÐæØ<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ÁâÐÒØ\ ßàÕ&Ô<Tab>[p
+menutrans Put\ &After<Tab>]p ÁâÐÒØ\ &Ø×Ð<Tab>]p
+menutrans &Delete<Tab>x ¸×&ÑàØèØ<Tab>x
+menutrans &Select\ all<Tab>ggVG ¸×ÐÑÕàØ\ áÒ&Õ<Tab>ggVG
+menutrans &Find\.\.\. &½ÐòØ\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. ½ÐòØ\ Ø\ &×ÐÜÕÝØ\.\.\.
+menutrans Settings\ &Window ¿&àÞ×Þà\ ßÞÔÕèÐÒÐúÐ
+menutrans &Global\ Settings ¾ß&èâÐ\ ßÞÔÕèÐÒÐúÐ
+menutrans F&ile\ Settings ¿ÞÔÕèÐÒÐúÐ\ ×Ð\ ÔÐ&âÞâÕÚÕ
+menutrans &Shiftwidth &¿ÞÜÕàÐø
+menutrans Soft\ &Tabstop &¼ÕÚÐ\ âÐÑãÛÐæØøÐ
+menutrans Te&xt\ Width\.\.\. &ÈØàØÝÐ\ âÕÚáâÐ\.\.\.
+menutrans &File\ Format\.\.\. &²àáâÐ\ ÔÐâÞâÕÚÕ\.\.\.
+menutrans C&olor\ Scheme ±Þ&øÕ
+menutrans &Keymap ¿àÕá&ÛØÚÐÒÐúÕ\ âÐáâÐâãàÕ
+menutrans Select\ Fo&nt\.\.\. ¸×ÑÞà\ &äÞÝâÐ\.\.\.
+
+" Edit/Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ½ÐÓÛÐáØ\ &ÞÑàÐ×æÕ\ (ÔÐ/ÝÕ)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ·ÐÝÕÜÐàØ\ \ÒÕÛØçØÝã\ &áÛÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! ¿àÞÒÕàØ\ ßàÐâÕûã\ &×ÐÓàÐÔã\ (ÔÐ/ÝÕ)<Tab>:set\ sm!
+menutrans &Context\ lines ²ØÔùØÒØ\ &àÕÔÞÒØ
+menutrans &Virtual\ Edit ²ØàâãÕÛÝÞ\ &ãàÕòØÒÐúÕ
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ÀÕÖØÜ\ ã&ÝÞáÐ\ (ÔÐ/ÝÕ)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ áÐÓÛÐáÝÞ\ (ÔÐ/ÝÕ)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. ¿ãâÐúÐ\ &ßàÕâàÐÓÕ\.\.\.
+menutrans Ta&g\ Files\.\.\. &´ÐâÞâÕÚÕ\ Þ×ÝÐÚÐ\.\.\.
+menutrans Toggle\ &Toolbar »ØÝØøÐ\ áÐ\ &ÐÛÐâÚÐÜÐ\ (ÔÐ/ÝÕ)
+menutrans Toggle\ &Bottom\ Scrollbar ´ÞúÐ\ Û&ØÝØøÐ\ ÚÛØ×ÐúÐ\ (ÔÐ/ÝÕ)
+menutrans Toggle\ &Left\ Scrollbar &»ÕÒÐ\ ÛØÝØøÐ\ ÚÛØ×ÐúÐ\ (ÔÐ/ÝÕ)
+menutrans Toggle\ &Right\ Scrollbar &´ÕáÝÐ\ ÛØÝØøÐ\ ÚÛØ×ÐúÐ\ (ÔÐ/ÝÕ)
+
+" Edit/Global Settings/Virtual Edit
+menutrans Never ½ØÚÐÔ
+menutrans Block\ Selection ¸×ÑÞà\ ÑÛÞÚÐ
+menutrans Insert\ mode ÀÕÖØÜ\ ãÝÞáÐ
+menutrans Block\ and\ Insert ±ÛÞÚ\ Ø\ ãÝÞá
+menutrans Always ÃÒÕÚ
+
+" Edit/File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ÀÕÔÝØ\ &ÑàÞøÕÒØ\ (ÔÐ/ÝÕ)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ÀÕÖØÜ\ &ÛØáâÕ\ (ÔÐ/ÝÕ)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ¾ÑÐÒØøÐúÕ\ &àÕÔÞÒÐ\ (ÔÐ/ÝÕ)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ¿àÕÛÞÜØ\ &ÝÐ\ àÕç\ (ÔÐ/ÝÕ)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ÀÐ×ÜÐæØ\ ãÜÕáâÞ\ &âÐÑãÛÐæØøÕ\ (ÔÐ/ÝÕ)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! °ãâÞ-&ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &ÆÕ-ãÒÛÐçÕúÕ\ (ÔÐ/ÝÕ)<Tab>:set\ cin!
+
+" Edit/Keymap
+menutrans None ½ØøÕÔÐÝ
+
+" Tools menu
+menutrans &Tools &°ÛÐâÚÕ
+menutrans &Jump\ to\ this\ tag<Tab>g^] ÁÚÞçØ\ ÝÐ\ &ÞÒã\ Þ×ÝÐÚã<Tab>g^]
+menutrans Jump\ &back<Tab>^T ÁÚÞçØ\ &ÝÐâàÐÓ<Tab>^T
+menutrans Build\ &Tags\ File ¸×ÓàÐÔØ\ &ÔÐâÞâÕÚã\ Þ×ÝÐÚÐ
+menutrans &Folding &¿ÞÔÒØøÐúÕ
+menutrans Create\ &Fold<Tab>zf Á&âÒÞàØ\ ßÞÔÒØøãâÐÚ<Tab>zf
+menutrans &Delete\ Fold<Tab>zd ¾&ÑàØèØ\ ßÞÔÒØøãâÐÚ<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ¾ÑàØèØ\ áÒÕ\ ßÞ&ÔÒØøãâÚÕ<Tab>zD
+menutrans Fold\ column\ &width ÈØàØÝÐ\ &àÕÔÐ\ ßÞÔÒØøãâÚÐ
+menutrans &Diff &ÃßÞàÕòØÒÐúÕ
+menutrans &Make<Tab>:make 'mak&Õ'<Tab>:make
+menutrans &List\ Errors<Tab>:cl ÁßØáÐÚ\ &ÓàÕèÐÚÐ<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Áß&ØáÐÚ\ ßÞàãÚÐ<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Á&ÛÕÔÕûÐ\ ÓàÕèÚÐ<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ¿àÕ&âåÞÔÝÐ\ ÓàÕèÚÐ<Tab>:cp
+menutrans &Older\ List<Tab>:cold ÁâÐàØ\ áßØáÐ&Ú<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew ½Þ&ÒØ\ áßØáÐÚ<Tab>:cnew
+menutrans Error\ &Window ¿àÞ×Þà\ áÐ\ Ó&àÕèÚÐÜÐ
+menutrans &Set\ Compiler ¸&×ÐÑÕàØ\ ßàÕÒÞÔØÞæÐ
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ¿àÕâÒÞàØ\ ã\ &ŵºÁ<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ²à&ÐâØ\ ã\ ßàÒÞÑØâÐÝ\ ÞÑÛØÚ<Tab>:%!xxd\ -r
+
+" Tools/Folding
+menutrans &Enable/Disable\ folds<Tab>zi &¾ÜÞÓãûØ/ßàÕÚØÝØ\ ßÞÔÒØøÐúÕ<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &¿ÞÚÐÖØ\ àÕÔ\ áÐ\ ÚãàáÞàÞÜ<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx ¿ÞÚÐÖØ\ &áÐÜÞ\ àÕÔ\ áÐ\ ÚãàáÞàÞÜ<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &·ÐâÒÞàØ\ ÒØèÕ\ ßÞÔÒØøãâÐÚÐ<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM ·ÐâÒÞàØ\ á&ÒÕ\ ßÞÔÒØøãâÚÕ<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr ¾âÒÞàØ\ ÒØè&Õ\ ßÞÔÒØøãâÐÚÐ<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR ¾&âÒÞàØ\ áÒÕ\ ßÞÔÒØøãâÚÕ<Tab>zR
+menutrans Fold\ Met&hod &½ÐçØÝ\ ßÞÔÒØøÐúÐ
+
+" Tools/Folding/Fold Method
+menutrans M&anual &ÀãçÝÞ
+menutrans I&ndent &ÃÒãçÕÝÞáâ
+menutrans E&xpression &¸×àÐ×
+menutrans S&yntax &ÁØÝâÐÚáÐ
+"menutrans &Diff
+menutrans Ma&rker &¾×ÝÐÚÐ
+
+" Tools/Diff
+menutrans &Update &°ÖãàØàÐø
+menutrans &Get\ Block &¿àØåÒÐâØ\ Ø×ÜÕÝã
+menutrans &Put\ Block ¿àÕ&ÑÐæØ\ Ø×ÜÕÝã
+
+" Tools/Error Window
+menutrans &Update<Tab>:cwin &°ÖãàØàÐø<Tab>:cwin
+menutrans &Open<Tab>:copen &¾âÒÞàØ<Tab>:copen
+menutrans &Close<Tab>:cclose &·ÐâÒÞàØ<Tab>:cclose
+
+" Bufers menu
+menutrans &Buffers &±ÐäÕàØ
+menutrans &Refresh\ menu &°ÖãàØàÐø
+menutrans Delete &¾ÑàØèØ
+menutrans &Alternate °&ÛâÕàÝÐâØÒÝØ
+menutrans &Next &ÁÛÕÔÕûØ
+menutrans &Previous &¿àÕâåÞÔÝØ
+menutrans [No\ File] [½ÕÜÐ\ ÔÐâÞâÕÚÕ]
+
+" Window menu
+menutrans &Window &¿àÞ×Þà
+menutrans &New<Tab>^Wn &½ÞÒØ<Tab>^Wn
+menutrans S&plit<Tab>^Ws &¿ÞÔÕÛØ<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ¿ÞÔÕÛØ\ áÐ\ &ÐÛâÕàÝÐâØÒÝØÜ<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ¿ÞÔÕÛØ\ &ãáßàÐÒÝÞ<Tab>^Wv
+menutrans Split\ File\ E&xplorer ¿ÞÔÕÛØ\ ×Ð\ ßàÕÓÛÕÔ\ &ÔÐâÞâÕÚÐ
+menutrans &Close<Tab>^Wc &·ÐâÒÞàØ<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo ·ÐâÒÞàØ\ &ÞáâÐÛÕ<Tab>^Wo
+"menutrans Ne&xt<Tab>^Ww &ÁÛÕÔÕûØ<Tab>^Ww
+"menutrans P&revious<Tab>^WW ¿&àÕâåÞÔÝØ<Tab>^WW
+menutrans Move\ &To ¿àÕ&ÜÕáâØ
+menutrans Rotate\ &Up<Tab>^WR &ºàãÖÝÞ\ ÝÐÓÞàÕ<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ºàãÖÝÞ\ ÝÐÔÞÛ&Õ<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= &¸áâÕ\ ÒÕÛØçØÝÕ<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ¼ÐÚáØÜÐÛÝÐ\ &ÒØáØÝÐ<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ ¼ØÝØÜÐ&ÛÝÐ\ ÒØáØÝÐ<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ¼ÐÚáØÜÐÛÝÐ\ &èØàØÝÐ<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ¼ØÝØÜÐÛÝÐ\ èØ&àØÝÐ<Tab>^W1\|
+
+" Window/Move To
+menutrans &Top<Tab>^WK &²àå<Tab>^WK
+menutrans &Bottom<Tab>^WJ &¿ÞÔÝÞÖøÕ<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Ã&ÛÕÒÞ<Tab>^WH
+menutrans &Right\ side<Tab>^WL Ã&ÔÕáÝÞ<Tab>^WL
+
+" The popup menu
+menutrans &Undo &²àÐâØ
+menutrans Cu&t &¸áÕæØ
+menutrans &Copy &ºÞßØàÐø
+menutrans &Paste &ÃÑÐæØ
+menutrans &Delete ¸&×ÑàØèØ
+menutrans Select\ Blockwise ±ØàÐø\ &ßàÐÒÞãÓÐÞÝÞ
+menutrans Select\ &Word ¸×ÐÑÕàØ\ &àÕç
+menutrans Select\ &Line ¸×ÐÑÕàØ\ à&ÕÔ
+menutrans Select\ &Block ¸×ÐÑÕàØ\ &ÑÛÞÚ
+menutrans Select\ &All ¸×ÐÑÕàØ\ &áÒÕ
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ÃçØâÐø
+ tmenu ToolBar.Save ÁÐçãÒÐø
+ tmenu ToolBar.SaveAll ÁÐçãÒÐø áÒÕ
+ tmenu ToolBar.Print ÈâÐÜßÐø
+ tmenu ToolBar.Undo ²àÐâØ
+ tmenu ToolBar.Redo ¿ÞÒàÐâØ
+ tmenu ToolBar.Cut ¸áÕæØ
+ tmenu ToolBar.Copy ºÞßØàÐø
+ tmenu ToolBar.Paste ÃÑÐæØ
+ tmenu ToolBar.Find ½ÐòØ
+ tmenu ToolBar.FindNext ½ÐòØ áÛÕÔÕûØ
+ tmenu ToolBar.FindPrev ½ÐòØ ßàÕâåÞÔÝØ
+ tmenu ToolBar.Replace ·ÐÜÕÝØ
+ tmenu ToolBar.New ½ÞÒØ
+ tmenu ToolBar.WinSplit ¿ÞÔÕÛØ ßàÞ×Þà
+ tmenu ToolBar.WinMax ¼ÐÚáØÜÐÛÝÐ ÒØáØÝÐ
+ tmenu ToolBar.WinMin ¼ØÝØÜÐÛÝÐ ÒØáØÝÐ
+ tmenu ToolBar.WinVSplit ¿ÞÔÕÛØ ãáßàÐÒÝÞ
+ tmenu ToolBar.WinMaxWidth ¼ÐÚáØÜÐÛÝÐ èØàØÝÐ
+ tmenu ToolBar.WinMinWidth ¼ØÝØÜÐÛÝÐ èØàØÝÐ
+ tmenu ToolBar.WinClose ·ÐâÒÞàØ ßàÞ×Þà
+ tmenu ToolBar.LoadSesn ÃçØâÐø áÕÐÝáã
+ tmenu ToolBar.SaveSesn ÁÐçãÒÐø áÕÐÝáã
+ tmenu ToolBar.RunScript ¸×ÒàèØ áßØá
+ tmenu ToolBar.Make 'make'
+ tmenu ToolBar.Shell ¾ßÕàÐâØÒÝÞ ÞÚàãÖÕúÕ
+ tmenu ToolBar.RunCtags ½ÐßàÐÒØ Þ×ÝÐÚÕ
+ tmenu ToolBar.TagJump ¸ÔØ ÝÐ Þ×ÝÐÚã
+ tmenu ToolBar.Help ¿ÞÜÞû
+ tmenu ToolBar.FindHelp ½ÐòØ ÞÑøÐèúÕúÕ
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &ÁØÝâÐÚáÐ
+menutrans &Show\ filetypes\ in\ menu ¸×ÑÞà\ 'filetype'\ Ø×\ &ÜÕÝØøÐ
+menutrans Set\ '&syntax'\ only ¿ÞÔÕ&áØ\ 'syntax'\ áÐÜÞ
+menutrans Set\ '&filetype'\ too ¿ÞÔÕáØ\ 'filetype'\ &âÐÚÞòÕ
+menutrans &Off &¸áÚùãçÕÝÞ
+menutrans &Manual &ÀãçÝÞ
+menutrans A&utomatic &°ãâÞÜÐâáÚØ
+menutrans on/off\ for\ &This\ file ´Ð/ÝÕ\ ×Ð\ ÞÒã\ &ÔÐâÞâÕÚã
+menutrans Co&lor\ test ¿àÞÒÕàÐ\ &ÑÞøÐ
+menutrans &Highlight\ test ¿àÞÒÕàÐ\ ØáâØ&æÐúÐ
+menutrans &Convert\ to\ HTML ¿àÕâÒÞàØ\ &ã\ HTML
+
+" dialog texts
+let menutrans_help_dialog = "ÃÝÕáØâÕ ÝÐàÕÔÑã ØÛØ àÕç çØøÕ ßÞøÐèúÕúÕ âàÐÖØâÕ:\n\n´ÞÔÐøâÕ i_ ×Ð ÝÐàÕÔÑÕ ãÝÞáÐ (Ýßà. i_CTRL-X)\n´ÞÔÐøâÕ c_ ×Ð ÝÐàÕÔÑÕ ÚÞÜÐÝÔÝÞÓ àÕÖØÜÐ (Ýßà. á_<Del>)\n´ÞÔÐøâÕ ' ×Ð ØÜÕÝÐ ÞßæØøÐ (Ýßà. 'shiftwidth')"
+
+let g:menutrans_path_dialog = "ÃÝÕáØâÕ ßãâ ßàÕâàÐÓÕ ×Ð ÔÐâÞâÕÚÕ\nÀÐ×ÔÒÞøØâÕ ×ÐàÕ×ØÜÐ ØÜÕÝÐ ÔØàÕÚâÞàØøãÜÐ."
+
+let g:menutrans_tags_dialog = "ÃÝÕáØâÕ ØÜÕÝÐ ÔÐâÞâÕÚÐ áÐ Þ×ÝÐÚÐÜÐ\nÀÐ×ÔÒÞøØâÕ ×ÐàÕ×ØÜÐ ØÜÕÝÐ."
+
+let g:menutrans_textwidth_dialog = "ÃÝÕáØâÕ ÝÞÒã èØàØÝã âÕÚáâÐ (0 áßàÕçÐÒÐ ßàÕÛÞÜ)"
+
+let g:menutrans_fileformat_dialog = "¸×ÐÑÕàØâÕ Òàáâã ÔÐâÞâÕÚÕ"
+
+let menutrans_no_file = "[½ÕÜÐ ÔÐâÞâÕÚÕ]"
diff --git a/runtime/lang/menu_sr_yu.utf-8.vim b/runtime/lang/menu_sr_yu.utf-8.vim
new file mode 100644
index 000000000..733566387
--- /dev/null
+++ b/runtime/lang/menu_sr_yu.utf-8.vim
@@ -0,0 +1,261 @@
+" Menu Translations: Serbian
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+" Last Change: Fri, 30 May 2003 10:17:39 Eastern Daylight Time
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+scriptencoding utf-8
+
+" Help menu
+menutrans &Help Помо&ћ
+menutrans &Overview<Tab><F1> &Преглед<Tab><F1>
+menutrans &User\ Manual &УпутÑтво\ за\ кориÑнике
+menutrans &How-to\ links &Како\ да\.\.\.
+menutrans &Find &Ðађи
+menutrans &Credits &ЗаÑлуге
+menutrans Co&pying П&реузимање
+menutrans O&rphans &Сирочићи
+menutrans &Version &Верзија
+menutrans &About &О\ програму
+
+" File menu
+menutrans &File &Датотека
+menutrans &Open\.\.\.<Tab>:e &Отвори\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp &Подели-отвори\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Ðова<Tab>:enew
+menutrans &Close<Tab>:close &Затвори<Tab>:close
+menutrans &Save<Tab>:w &Сачувај<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Сачувај\ &као\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Подели\ и\ &упореди\ Ñа\.\.\.
+menutrans Split\ Patched\ &By\.\.\. По&дели\ и\ преправи\ Ñа\.\.\.
+menutrans &Print Шта&мпај
+menutrans Sa&ve-Exit<Tab>:wqa Сачувај\ и\ за&врши<Tab>:wqa
+menutrans E&xit<Tab>:qa К&рај<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Уређивање
+menutrans &Undo<Tab>u &Врати<Tab>u
+menutrans &Redo<Tab>^R &Поврати<Tab>^R
+menutrans Rep&eat<Tab>\. П&онови<Tab>\.
+menutrans Cu&t<Tab>"+x ИÑе&ци<Tab>"+x
+menutrans &Copy<Tab>"+y &Копирај<Tab>"+y
+menutrans &Paste<Tab>"+gP &Убаци<Tab>"+gP
+menutrans &Paste<Tab>"+P &Убаци<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Стави\ пре&д<Tab>[p
+menutrans Put\ &After<Tab>]p Стави\ &иза<Tab>]p
+menutrans &Delete<Tab>x Из&бриши<Tab>x
+menutrans &Select\ all<Tab>ggVG Изабери\ Ñв&е<Tab>ggVG
+menutrans &Find\.\.\. &Ðађи\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Ðађи\ и\ &замени\.\.\.
+menutrans Settings\ &Window П&розор\ подешавања
+menutrans &Global\ Settings Оп&шта\ подешавања
+menutrans F&ile\ Settings Подешавања\ за\ да&тотеке
+menutrans &Shiftwidth &Померај
+menutrans Soft\ &Tabstop &Мека\ табулација
+menutrans Te&xt\ Width\.\.\. &Ширина\ текÑта\.\.\.
+menutrans &File\ Format\.\.\. &Ð’Ñ€Ñта\ датотеке\.\.\.
+menutrans C&olor\ Scheme Бо&је
+menutrans &Keymap ПреÑ&ликавање\ таÑтатуре
+menutrans Select\ Fo&nt\.\.\. Избор\ &фонта\.\.\.
+
+" Edit/Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ÐаглаÑи\ &образце\ (да/не)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Занемари\ \величину\ &Ñлова\ (да/не)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Провери\ пратећу\ &заграду\ (да/не)<Tab>:set\ sm!
+menutrans &Context\ lines Видљиви\ &редови
+menutrans &Virtual\ Edit Виртуелно\ &уређивање
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Режим\ у&ноÑа\ (да/не)<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! '&Vi'\ ÑаглаÑно\ (да/не)<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. Путања\ &претраге\.\.\.
+menutrans Ta&g\ Files\.\.\. &Датотеке\ ознака\.\.\.
+menutrans Toggle\ &Toolbar Линија\ Ñа\ &алаткама\ (да/не)
+menutrans Toggle\ &Bottom\ Scrollbar Доња\ л&инија\ клизања\ (да/не)
+menutrans Toggle\ &Left\ Scrollbar &Лева\ линија\ клизања\ (да/не)
+menutrans Toggle\ &Right\ Scrollbar &ДеÑна\ линија\ клизања\ (да/не)
+
+" Edit/Global Settings/Virtual Edit
+menutrans Never Ðикад
+menutrans Block\ Selection Избор\ блока
+menutrans Insert\ mode Режим\ уноÑа
+menutrans Block\ and\ Insert Блок\ и\ уноÑ
+menutrans Always Увек
+
+" Edit/File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Редни\ &бројеви\ (да/не)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Режим\ &лиÑте\ (да/не)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Обавијање\ &редова\ (да/не)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Преломи\ &на\ реч\ (да/не)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Размаци\ умеÑто\ &табулације\ (да/не)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Ðуто-&увлачење\ (да/не)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! &Це-увлачење\ (да/не)<Tab>:set\ cin!
+
+" Edit/Keymap
+menutrans None Ðиједан
+
+" Tools menu
+menutrans &Tools &Ðлатке
+menutrans &Jump\ to\ this\ tag<Tab>g^] Скочи\ на\ &ову\ ознаку<Tab>g^]
+menutrans Jump\ &back<Tab>^T Скочи\ &натраг<Tab>^T
+menutrans Build\ &Tags\ File Изгради\ &датотеку\ ознака
+menutrans &Folding &Подвијање
+menutrans Create\ &Fold<Tab>zf С&твори\ подвијутак<Tab>zf
+menutrans &Delete\ Fold<Tab>zd О&бриши\ подвијутак<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Обриши\ Ñве\ по&двијутке<Tab>zD
+menutrans Fold\ column\ &width Ширина\ &реда\ подвијутка
+menutrans &Diff &Упоређивање
+menutrans &Make<Tab>:make 'mak&е'<Tab>:make
+menutrans &List\ Errors<Tab>:cl СпиÑак\ &грешака<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Сп&иÑак\ порука<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn С&ледећа\ грешка<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Пре&тходна\ грешка<Tab>:cp
+menutrans &Older\ List<Tab>:cold Стари\ ÑпиÑа&к<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Ðо&ви\ ÑпиÑак<Tab>:cnew
+menutrans Error\ &Window Прозор\ Ñа\ г&решкама
+menutrans &Set\ Compiler И&забери\ преводиоца
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Претвори\ у\ &ХЕКС<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Вр&ати\ у\ првобитан\ облик<Tab>:%!xxd\ -r
+
+" Tools/Folding
+menutrans &Enable/Disable\ folds<Tab>zi &Омогући/прекини\ подвијање<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Покажи\ ред\ Ñа\ курÑором<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Покажи\ &Ñамо\ ред\ Ñа\ курÑором<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm &Затвори\ више\ подвијутака<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Затвори\ Ñ&ве\ подвијутке<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Отвори\ виш&е\ подвијутака<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR О&твори\ Ñве\ подвијутке<Tab>zR
+menutrans Fold\ Met&hod &Ðачин\ подвијања
+
+" Tools/Folding/Fold Method
+menutrans M&anual &Ручно
+menutrans I&ndent &УвученоÑÑ‚
+menutrans E&xpression &Израз
+menutrans S&yntax &СинтакÑа
+"menutrans &Diff
+menutrans Ma&rker &Ознака
+
+" Tools/Diff
+menutrans &Update &Ðжурирај
+menutrans &Get\ Block &Прихвати\ измену
+menutrans &Put\ Block Пре&баци\ измену
+
+" Tools/Error Window
+menutrans &Update<Tab>:cwin &Ðжурирај<Tab>:cwin
+menutrans &Open<Tab>:copen &Отвори<Tab>:copen
+menutrans &Close<Tab>:cclose &Затвори<Tab>:cclose
+
+" Bufers menu
+menutrans &Buffers &Бафери
+menutrans &Refresh\ menu &Ðжурирај
+menutrans Delete &Обриши
+menutrans &Alternate Ð&лтернативни
+menutrans &Next &Следећи
+menutrans &Previous &Претходни
+menutrans [No\ File] [Ðема\ датотеке]
+
+" Window menu
+menutrans &Window &Прозор
+menutrans &New<Tab>^Wn &Ðови<Tab>^Wn
+menutrans S&plit<Tab>^Ws &Подели<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Подели\ Ñа\ &алтернативним<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Подели\ &уÑправно<Tab>^Wv
+menutrans Split\ File\ E&xplorer Подели\ за\ преглед\ &датотека
+menutrans &Close<Tab>^Wc &Затвори<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Затвори\ &оÑтале<Tab>^Wo
+"menutrans Ne&xt<Tab>^Ww &Следећи<Tab>^Ww
+"menutrans P&revious<Tab>^WW П&ретходни<Tab>^WW
+menutrans Move\ &To Пре&меÑти
+menutrans Rotate\ &Up<Tab>^WR &Кружно\ нагоре<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Кружно\ надол&е<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= &ИÑте\ величине<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ МакÑимална\ &виÑина<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Минима&лна\ виÑина<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| МакÑимална\ &ширина<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Минимална\ ши&рина<Tab>^W1\|
+
+" Window/Move To
+menutrans &Top<Tab>^WK &Врх<Tab>^WK
+menutrans &Bottom<Tab>^WJ &Подножје<Tab>^WJ
+menutrans &Left\ side<Tab>^WH У&лево<Tab>^WH
+menutrans &Right\ side<Tab>^WL У&деÑно<Tab>^WL
+
+" The popup menu
+menutrans &Undo &Врати
+menutrans Cu&t &ИÑеци
+menutrans &Copy &Копирај
+menutrans &Paste &Убаци
+menutrans &Delete И&збриши
+menutrans Select\ Blockwise Бирај\ &правоугаоно
+menutrans Select\ &Word Изабери\ &реч
+menutrans Select\ &Line Изабери\ р&ед
+menutrans Select\ &Block Изабери\ &блок
+menutrans Select\ &All Изабери\ &Ñве
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Учитај
+ tmenu ToolBar.Save Сачувај
+ tmenu ToolBar.SaveAll Сачувај Ñве
+ tmenu ToolBar.Print Штампај
+ tmenu ToolBar.Undo Врати
+ tmenu ToolBar.Redo Поврати
+ tmenu ToolBar.Cut ИÑеци
+ tmenu ToolBar.Copy Копирај
+ tmenu ToolBar.Paste Убаци
+ tmenu ToolBar.Find Ðађи
+ tmenu ToolBar.FindNext Ðађи Ñледећи
+ tmenu ToolBar.FindPrev Ðађи претходни
+ tmenu ToolBar.Replace Замени
+ tmenu ToolBar.New Ðови
+ tmenu ToolBar.WinSplit Подели прозор
+ tmenu ToolBar.WinMax МакÑимална виÑина
+ tmenu ToolBar.WinMin Минимална виÑина
+ tmenu ToolBar.WinVSplit Подели уÑправно
+ tmenu ToolBar.WinMaxWidth МакÑимална ширина
+ tmenu ToolBar.WinMinWidth Минимална ширина
+ tmenu ToolBar.WinClose Затвори прозор
+ tmenu ToolBar.LoadSesn Учитај ÑеанÑу
+ tmenu ToolBar.SaveSesn Сачувај ÑеанÑу
+ tmenu ToolBar.RunScript Изврши ÑпиÑ
+ tmenu ToolBar.Make 'make'
+ tmenu ToolBar.Shell Оперативно окружење
+ tmenu ToolBar.RunCtags Ðаправи ознаке
+ tmenu ToolBar.TagJump Иди на ознаку
+ tmenu ToolBar.Help Помоћ
+ tmenu ToolBar.FindHelp Ðађи објашњење
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &СинтакÑа
+menutrans &Show\ filetypes\ in\ menu Избор\ 'filetype'\ из\ &менија
+menutrans Set\ '&syntax'\ only Поде&Ñи\ 'syntax'\ Ñамо
+menutrans Set\ '&filetype'\ too ПодеÑи\ 'filetype'\ &такође
+menutrans &Off &ИÑкључено
+menutrans &Manual &Ручно
+menutrans A&utomatic &ÐутоматÑки
+menutrans on/off\ for\ &This\ file Да/не\ за\ ову\ &датотеку
+menutrans Co&lor\ test Провера\ &боја
+menutrans &Highlight\ test Провера\ иÑти&цања
+menutrans &Convert\ to\ HTML Претвори\ &у\ HTML
+
+" dialog texts
+let menutrans_help_dialog = "УнеÑите наредбу или реч чије појашњење тражите:\n\nДодајте i_ за наредбе уноÑа (нпр. i_CTRL-X)\nДодајте c_ за наредбе командног режима (нпр. Ñ_<Del>)\nДодајте ' за имена опција (нпр. 'shiftwidth')"
+
+let g:menutrans_path_dialog = "УнеÑите пут претраге за датотеке\nРаздвојите зарезима имена директоријума."
+
+let g:menutrans_tags_dialog = "УнеÑите имена датотека Ñа ознакама\nРаздвојите зарезима имена."
+
+let g:menutrans_textwidth_dialog = "УнеÑите нову ширину текÑта (0 Ñпречава прелом)"
+
+let g:menutrans_fileformat_dialog = "Изаберите врÑту датотеке"
+
+let menutrans_no_file = "[Ðема датотеке]"
+
+" vim: tw=0 keymap=serbcyril-US
diff --git a/runtime/lang/menu_sv.latin1.vim b/runtime/lang/menu_sv.latin1.vim
new file mode 100644
index 000000000..c5c46714d
--- /dev/null
+++ b/runtime/lang/menu_sv.latin1.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Swedish
+
+source <sfile>:p:h/menu_sv_se.latin1.vim
diff --git a/runtime/lang/menu_sv.utf-8.vim b/runtime/lang/menu_sv.utf-8.vim
new file mode 100644
index 000000000..6b4f2949c
--- /dev/null
+++ b/runtime/lang/menu_sv.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Swedish for UTF-8 encoding
+
+source <sfile>:p:h/menu_sv_se.latin1.vim
diff --git a/runtime/lang/menu_sv_se.latin1.vim b/runtime/lang/menu_sv_se.latin1.vim
new file mode 100644
index 000000000..abeb562a2
--- /dev/null
+++ b/runtime/lang/menu_sv_se.latin1.vim
@@ -0,0 +1,238 @@
+" Menu Translations: Swedish
+" Maintainer: Johan Svedberg <johan@svedberg.pp.se>
+" Last Change: 2004 May 16
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+" The translations below are in latin1, but they work for cp1252 and
+" iso-8859-15 without conversion as well.
+if &enc != "cp1252" && &enc != "iso-8859-15"
+ scriptencoding latin1
+endif
+
+" Help menu
+menutrans &Help &Hjälp
+menutrans &Overview<Tab><F1> &Översikt<Tab><F1>
+menutrans &How-to\ links &Hur-göra-länkar
+menutrans &User\ Manual &Användarmanual
+"menutrans &GUI &GUI
+menutrans &Credits &Tack
+menutrans Co&pying &Kopieringsrättigheter
+menutrans &Find\.\.\. &Sök\.\.\.
+menutrans &Version &Version
+menutrans &About &Om
+
+" File menu
+menutrans &File &Arkiv
+menutrans &Open\.\.\.<Tab>:e &Öppna\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Öppna\ i\ splitt-vy\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &Ny<Tab>:enew
+menutrans &Close<Tab>:close S&täng<Tab>:close
+menutrans &Save<Tab>:w &Spara<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Spara\ som\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. Dela\ diff\ med\.\.\.
+menutrans Split\ Patched\ &By\.\.\. Dela\ lappad\ med\.\.\.
+menutrans &Print Skriv\ &ut
+menutrans Sa&ve-Exit<Tab>:wqa Spara\ &och\ avsluta<Tab>:wqa
+menutrans E&xit<Tab>:qa &Avsluta<Tab>:qa
+
+" Edit menu
+menutrans &Edit &Redigera
+menutrans &Undo<Tab>u &Ångra<Tab>u
+menutrans &Redo<Tab>^R &Gör\ om<Tab>^R
+menutrans Rep&eat<Tab>\. &Repetera<Tab>\.
+menutrans Cu&t<Tab>"+x Klipp\ &ut<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopiera<Tab>"+y
+menutrans &Paste<Tab>"+gP Klistra &in<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Sätt\ in\ &före<Tab>[p
+menutrans Put\ &After<Tab>]p Sätt\ in\ &efter<Tab>]p
+menutrans &Select\ all<Tab>ggVG &Markera\ allt<Tab>ggVG
+menutrans &Find\.\.\. &Sök\.\.\.
+menutrans &Find<Tab>/ &Sök<Tab>/
+menutrans Find\ and\ Rep&lace\.\.\. Sök\ och\ ersätt\.\.\.
+menutrans Find\ and\ Rep&lace<Tab>:%s Sök\ och\ ersätt<Tab>:%s
+menutrans Find\ and\ Rep&lace Sök\ och\ ersätt
+menutrans Find\ and\ Rep&lace<Tab>:s Sök\ och\ ersätt<Tab>:s
+menutrans Settings\ &Window In&ställningar
+menutrans &Global\ Settings Gl&obala\ inställningar
+menutrans F&ile\ Settings Fi&linställningar
+menutrans C&olor\ Scheme F&ärgschema
+menutrans &Keymap &Tangentbordsuppsättning
+
+" Edit.Global Settings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Växla\ mönsterframhävning<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Växla\ ignorering\ av\ storlek<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Växla\ matchningsvisning<Tab>:set\ sm!
+menutrans &Context\ lines Sammanhangsrader
+menutrans &Virtual\ Edit Virtuell\ redigering
+menutrans Never Aldrig
+menutrans Block\ Selection Blockval
+menutrans Insert\ mode Infogningsläge
+menutrans Block\ and\ Insert Block\ och\ infogning
+menutrans Always Alltid
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Växla\ infogningsläge<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. Sökväg\.\.\.
+menutrans Ta&g\ Files\.\.\. Taggfiler\.\.\.
+menutrans Toggle\ &Toolbar Växla\ verktygsrad
+menutrans Toggle\ &Bottom\ Scrollbar Växla\ rullningslista\ i\ botten
+menutrans Toggle\ &Left\ Scrollbar Växla\ vänster\ rullningslista
+menutrans Toggle\ &Right\ Scrollbar Växla\ höger\ rullningslista
+menutrans None Ingen
+
+" Edit.File Settings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Växla\ radnumrering<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Växla\ listläge<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Växla\ radbrytning<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Växla\ radbrytning\ vid\ ord<tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Växla\ tab-expandering<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Växla\ auto-indentering<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Växla\ C-indentering<Tab>:set\ cin!
+menutrans Te&xt\ Width\.\.\. Textbredd\.\.\.
+menutrans &File\ Format\.\.\. Filformat\.\.\.
+
+" Tools menu
+menutrans &Tools &Verktyg
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Hoppa\ till\ den\ här\ taggen<Tab>g^]
+menutrans Jump\ &back<Tab>^T Hoppa\ tillbaka<Tab>^T
+menutrans Build\ &Tags\ File Bygg\ taggfil
+menutrans &Make<Tab>:make &Bygg<Tab>:make
+menutrans &List\ Errors<Tab>:cl Listfel<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Listmeddelande<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Nästa\ fel<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp Tidigare\ fel<Tab>:cp
+menutrans &Older\ List<Tab>:cold &Äldre\ lista<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &Nyare\ lista<Tab>:cnew
+menutrans Error\ &Window Felfönster
+menutrans &Update<Tab>:cwin &Uppdatera<Tab>:cwin
+menutrans &Open<Tab>:copen &Öppna<Tab>:copen
+menutrans &Close<Tab>:cclose &Stäng<Tab>:cclose
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Konvertera\ till\ HEX<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Konvertera\ tillbaka<Tab>:%!xxd\ -r
+menutrans &Set\ Compiler Sätt\ kompilerare
+
+" Tools.Folding
+menutrans &Enable/Disable\ folds<Tab>zi Växla\ veck<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv Visa\ markörrad<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Visa\ bara\ markörrad<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm Stäng\ mer\ veck<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Stäng\ alla\ veck<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Öppna\ mer\ veck<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Öppna\ mer\ veck<Tab>zR
+menutrans Fold\ Met&hod Veckmetod
+menutrans M&anual Manual
+menutrans I&ndent Indentering
+menutrans E&xpression Uttryck
+menutrans S&yntax Syntax
+menutrans &Folding Vikning
+menutrans &Diff Differans
+menutrans Ma&rker Markering
+menutrans Create\ &Fold<Tab>zf Skapa\ veck<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Ta\ bort\ veck<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Ta\ bort\ alla\ veck<Tab>zD
+menutrans Fold\ col&umn\ width Veckcolumnsbredd
+
+" Tools.Diff
+menutrans &Update Uppdatera
+menutrans &Get\ Block Hämta\ block
+menutrans &Put\ Block Lämna\ block
+
+" Names for buffer menu.
+menutrans &Buffers &Buffertar
+menutrans &Refresh\ menu Uppdatera\ meny
+menutrans &Delete Ta\ bort
+menutrans &Alternate Alternativ
+menutrans &Next &Nästa
+menutrans &Previous &Tidigare
+
+" Window menu
+menutrans &Window &Fönster
+menutrans &New<Tab>^Wn &Nytt<Tab>^Wn
+menutrans S&plit<Tab>^Ws Dela<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Dela\ till\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Dela\ &vertikalt<Tab>^Wv
+menutrans Split\ File\ E&xplorer Dela\ filhanterare
+menutrans &Close<Tab>^Wc &Stäng<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo &Stäng\ alla\ andra<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww Nästa<Tab>^Ww
+menutrans P&revious<Tab>^WW &Tidigare<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &Samma\ storlek<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ &Maximal\ storlek<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ M&inimal\ storlek<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maximal\ bredd<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimal\ bredd<Tab>^W1\|
+menutrans Move\ &To Flytta\ till
+menutrans &Top<Tab>^WK Toppen<Tab>^WK
+menutrans &Bottom<Tab>^WJ Botten<Tab>^WJ
+menutrans &Left\ side<Tab>^WH &Vänstra\ sidan<Tab>^WH
+menutrans &Right\ side<Tab>^WL &Högra\ sidan<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR Rotera\ upp<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotera\ ned<Tab>^Wr
+menutrans Select\ Fo&nt\.\.\. Välj\ typsnitt\.\.\.
+
+" The popup menu
+menutrans &Undo &Ångra
+menutrans Cu&t Klipp\ ut
+menutrans &Copy &Kopiera
+menutrans &Paste &Klistra\ in
+menutrans &Delete &Ta\ bort
+menutrans Select\ Blockwise Markera\ blockvis
+menutrans Select\ &Word Markera\ ord
+menutrans Select\ &Line Markera\ rad
+menutrans Select\ &Block Markera\ block
+menutrans Select\ &All Markera\ allt
+
+" The GUI toolbar (for Win32 or GTK)
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open Öppna fil
+ tmenu ToolBar.Save Spara aktuell fil
+ tmenu ToolBar.SaveAll Spara alla filer
+ tmenu ToolBar.Print Skriv ut
+ tmenu ToolBar.Undo Ångra
+ tmenu ToolBar.Redo Gör om
+ tmenu ToolBar.Cut Klipp ut
+ tmenu ToolBar.Copy Kopiera
+ tmenu ToolBar.Paste Klistra in
+ tmenu ToolBar.Find Sök...
+ tmenu ToolBar.FindNext Sök nästa
+ tmenu ToolBar.FindPrev Sök tidigare
+ tmenu ToolBar.Replace Sök och ersätt...
+ tmenu ToolBar.LoadSesn Ladda session
+ tmenu ToolBar.SaveSesn Spara session
+ tmenu ToolBar.RunScript Kör ett Vim-skript
+ tmenu ToolBar.Make Bygg aktuellt projekt
+ tmenu ToolBar.Shell Öppna ett kommandoskal
+ tmenu ToolBar.RunCtags Kör Ctags
+ tmenu ToolBar.TagJump Hoppa till tagg under markör
+ tmenu ToolBar.Help Hjälp
+ tmenu ToolBar.FindHelp Sök i hjälp
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &Syntax
+menutrans Set\ '&syntax'\ only Sätt\ bara\ 'syntax'
+menutrans Set\ '&filetype'\ too Sätt\ 'filetype'\ också
+menutrans &Off &Av
+menutrans &Manual &Manual
+menutrans A&utomatic Automatiskt
+menutrans on/off\ for\ &This\ file Av/På\ för\ aktuell\ fil
+menutrans Co&lor\ test Färgtest
+menutrans &Highlight\ test Framhävningstest
+menutrans &Convert\ to\ HTML Konvertera\ till\ &HTML
+menutrans &Show\ individual\ choices Visa\ individuella\ val
+
+" dialog texts
+let menutrans_no_file = "[Ingen fil]"
+let menutrans_help_dialog = "Skriv in ett kommando eller ord som du vill söka hjälp på:\n\nBörja med i_ för infogninglägeskommandon (t.ex. i_CTRL-X)\nBörja med c_ för kommandoradredigeringskommandon (t.ex. c_<Del>)\nBörja med ' för ett inställningsnamn (t.ex. 'shiftwidth')"
+let g:menutrans_path_dialog = "Skriv in sökväg för filer.\nSeparera katalognamn med komma"
+let g:menutrans_tags_dialog = "Skriv in namn på taggfiler.\nSeparera namn med komma."
+let g:menutrans_textwidth_dialog = "Välj ny textbredd (0 för att förhindra formatering): "
+let g:menutrans_fileformat_dialog = "Välj filformat som filen ska sparas med"
diff --git a/runtime/lang/menu_sv_se.utf-8.vim b/runtime/lang/menu_sv_se.utf-8.vim
new file mode 100644
index 000000000..6b4f2949c
--- /dev/null
+++ b/runtime/lang/menu_sv_se.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Swedish for UTF-8 encoding
+
+source <sfile>:p:h/menu_sv_se.latin1.vim
diff --git a/runtime/lang/menu_uk_ua.koi8-u.vim b/runtime/lang/menu_uk_ua.koi8-u.vim
new file mode 100644
index 000000000..6284145d2
--- /dev/null
+++ b/runtime/lang/menu_uk_ua.koi8-u.vim
@@ -0,0 +1,246 @@
+" Menu Translations: Ukrainian
+" Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua>
+" Last Change: 11 Oct 2001
+
+"
+" Please, see readme at htpp://www.vstu.edu.ua/~bohdan/vim before any
+" complains, and even if you won't complain, read it anyway.
+"
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+scriptencoding koi8-u
+
+" Help menu
+menutrans &Help &äÏÐÏÍÏÇÁ
+menutrans &Overview<Tab><F1> &úÁÇÁÌØÎÁ\ ¶ÎÆÏÒÍÁæÑ<Tab><F1>
+menutrans &User\ Manual &ëÅÒ¦×ÎÉÃÔ×Ï\ ÄÌÑ\ ËÏÒÉÓÔÕ×ÁÞÁ
+menutrans &How-to\ links &ñË-úÒÏÂÉÔÉ?
+"menutrans &GUI &GIU
+menutrans &Credits &ðÏÄÑËÉ
+menutrans Co&pying &òÏÚÐÏ×ÓÀÄÖÅÎÎÑ
+menutrans O&rphans &äÏÐÏÍÏÇÁ\ ÓÉÒÏÔÁÍ
+menutrans &Version &÷ÅÒÓ¦Ñ
+menutrans &About ðÒÏ\ &ÐÒÏÇÒÁÍÕ
+
+" File menu
+menutrans &File &æÁÊÌ
+menutrans &Open\.\.\.<Tab>:e &÷¦ÄËÒÉÔÉ\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp &òÏÚĦÌÉÔÉ\ צËÎÏ\.\.\.<Tab>:sp
+menutrans &New<Tab>:enew &îÏ×ÉÊ<Tab>:enew
+menutrans &Close<Tab>:close &úÁËÒÉÔÉ<Tab>:close
+menutrans &Save<Tab>:w úÁ&ÐÁÍ'ÑÔÁÔÉ<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav úÁÐÁÍ'ÑÔÁÔÉ\ &ÑË\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. ðÏ&Ò¦×ÎÑÔÉ\ Ú\.\.\.
+menutrans Split\ Patched\ &By\.\.\. úÁ&ÌÁÔÁÔÉ\.\.\.
+menutrans &Print &äÒÕËÕ×ÁÔÉ
+menutrans Sa&ve-Exit<Tab>:wqa úÁÐÉÓÁÔÉ\ ¦\ ×É&ÊÔÉ<Tab>:wqa
+menutrans E&xit<Tab>:qa &÷ÉȦÄ<Tab>:qa
+
+" Edit menu
+menutrans &Edit &òÅÄÁÇÕ×ÁÔÉ
+menutrans &Undo<Tab>u &÷¦ÄͦÎÉÔÉ<Tab>u
+menutrans &Redo<Tab>^R &ðÏ×ÅÒÎÕÔÉ<Tab>^R
+menutrans Rep&eat<Tab>\. ð&Ï×ÔÏÒÉÔÉ<Tab>\.
+menutrans Cu&t<Tab>"+x ÷É&Ò¦ÚÁÔÉ<Tab>"+x
+menutrans &Copy<Tab>"+y &ëÏЦÀ×ÁÔÉ<Tab>"+y
+menutrans &Paste<Tab>"+gP ÷&ÓÔÁ×ÉÔÉ<Tab>"+gP
+menutrans Put\ &Before<Tab>[p ÷ÓÔÁ×ÉÔÉ\ ÐÏÐÅ&ÒÅÄÕ<Tab>[p
+menutrans Put\ &After<Tab>]p ÷ÓÔÁ×ÉÔÉ\ Ð&¦ÓÌÑ<Tab>]p
+menutrans &Select\ all<Tab>ggVG ÷É&ÂÒÁÔÉ\ ÕÓÅ<Tab>ggVG
+menutrans &Find\.\.\. &úÎÁÊÔÉ\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. úÁ&ͦÎÉÔÉ\.\.\.
+menutrans Settings\ &Window ÷¦ËÎÏ\ &ÎÁÌÁÛÔÕ×ÁÎØ
+menutrans &Global\ Settings úÁÇÁÌØΦ\ ÎÁ&ÌÁÛÔÕ×ÁÎÎÑ
+menutrans F&ile\ Settings îÁÌÁÛÔÕ×ÁÎÎÑ\ ÄÌÑ\ &ÆÁÊÌÕ
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! &îÕÍÅÒÁæÑ\ ÒÑÄ˦×<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! òÅÖÉÍ\ ÎÁ&ÄÌÉÛËÏ×ÏÇÏ\ צÄÏÂÒÁÖÅÎÎÑ<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! òÅÖÉÍ\ &ÐÅÒÅÎÏÓÕ<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ðÅÒÅÎÏÓÉÔÉ\ ÕÓÅ\ &ÓÌÏ×Ï<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ëÏÒÉÓÔÕ×ÁÔÉÓÑ\ ÓÉÍ×ÏÌÏÍ\ &ÔÁÂÕÌÑæ§<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! á×ÔÏÍÁÔÉÞÎÉÊ\ &צÄÓÔÕÐ<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! ÷¦ÄÓÔÕÐÉ\ ÄÌÑ\ ÍÏ×É\ &C<Tab>:set\ cin!
+menutrans &Shiftwidth &úÓÕ×
+menutrans Te&xt\ Width\.\.\. &ûÉÒÉÎÁ\ ÔÅËÓÔÕ\.\.\.
+menutrans &File\ Format\.\.\. &æÏÒÍÁÔ\ ÆÁÊÌÕ\.\.\.
+menutrans Soft\ &Tabstop ðÏÚÉæÑ\ &ÔÁÂÕÌÑæ§
+menutrans C&olor\ Scheme &ëÏÌØÏÒÉ
+menutrans Select\ Fo&nt\.\.\. ÷ÉÂÒÁÔÉ\ &ÛÒÉÆÔ\.\.\.
+
+
+menutrans &Keymap òÅÖÉÍ\ ËÌÁצÁÔÕÒÉ
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ÷ÉĦÌÑÔÉ\ &ÚÒÁÚÏË<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! &òÏÚÒ¦ÚÎÑÔÉ\ \×ÅÌÉ˦\ ÔÁ\ ÍÁ̦\ ̦ÔÅÒÉ<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! &îÅÇÁÊÎÉÊ\ ÐÏÛÕË<Tab>:set\ sm!
+menutrans &Context\ lines ë¦ÌØ˦ÓÔØ\ &×ÁÖÌÉ×ÉÈ\ ÒÑÄ˦×
+menutrans &Virtual\ Edit ëÕÒÓÏÒ\ &ÒÕÈÁ¤ÔØÓÑ\ ÂÅÚ\ ÍÅÖ
+
+menutrans Never î¦ËÏÌÉ
+menutrans Block\ Selection ÷ɦÒ\ âÌÏËÕ
+menutrans Insert\ mode òÅÖÉÍ\ ×ÓÔÁ×ËÉ
+menutrans Block\ and\ Insert ÷ɦÒ\ ¦\ ×ÓÔÁ×ËÁ
+menutrans Always úÁ×ÖÄÉ
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! òÅÖÉÍ\ &×ÓÔÁ×ËÉ<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. &ûÌÑÈ\ ÐÏÛÕËÕ\.\.\.
+menutrans Ta&g\ Files\.\.\. æÁÊÌÉ\ &ÐÏͦÔÏË\.\.\.
+
+
+"
+" GUI options
+menutrans Toggle\ &Toolbar ðÁÎÅÌØ\ &¦ÎÓÔÒÕÍÅÎÔ¦×
+menutrans Toggle\ &Bottom\ Scrollbar &îÉÖÎÑ\ ̦ΦÊËÁ\ ÚÓÕ×Õ
+menutrans Toggle\ &Left\ Scrollbar &ì¦×Á\ ̦ΦÊËÁ\ ÚÓÕ×Õ
+menutrans Toggle\ &Right\ Scrollbar &ðÒÁ×Á\ ̦ΦÊËÁ\ ÚÓÕ×Õ
+
+" Programming menu
+menutrans &Tools &¶ÎÓÔÒÕÍÅÎÔÉ
+menutrans &Jump\ to\ this\ tag<Tab>g^] &ðÅÒÅÊÔÉ\ ÄÏ\ ÐÏͦÔËÉ<Tab>g^]
+menutrans Jump\ &back<Tab>^T ðÏ&×ÅÒÎÕÔÉÓÑ<Tab>^T
+menutrans Build\ &Tags\ File &óÔ×ÏÒÉÔÉ\ ÆÁÊÌ\ ÐÏͦÔÏË
+" Folding
+menutrans &Folding &úÇÏÒÔËÉ
+menutrans &Enable/Disable\ folds<Tab>zi &äÏÚ×ÏÌÉÔÉ/ÚÁÂÏÒÏÎÉÔÉ\ ÚÇÏÒÔËÉ<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &âÁÞÉÔÉ\ ÒÑÄÏË\ Ú\ ËÕÒÓÏÒÏÍ<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx âÁÞÉÔÉ\ &ÌÉÛÅ\ ÒÑÄÏË\ Ú\ ËÕÒÓÏÒÏÍ<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm úÁËÒÉÔÉ\ &¦ÌØÛÅ\ ÚÇÏÒÔ˦×<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM úÁËÒÉÔÉ\ &ÕÓ¦\ ÚÇÏÒÔËÉ<Tab>zM
+menutrans &Open\ all\ folds<Tab>zR ÷¦ÄËÒÉÔÉ\ Õ&Ó¦\ ÚÇÏÒÔËÉ<Tab>zR
+menutrans O&pen\ more\ folds<Tab>zr ÷¦ÄËÒÉÔÉ\ Â&¦ÌØÛÅ\ ÚÇÏÒÔ˦×<Tab>zr
+
+menutrans Create\ &Fold<Tab>zf ó&Ô×ÏÒÉÔÉ\ ÚÇÏÒÔÏË<Tab>zf
+menutrans &Delete\ Fold<Tab>zd &÷ÉÄÁÌÉÔÉ\ ÚÇÏÒÔÏË<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ÷ÉÄÁÌÉÔ&É\ ÕÓ¦\ ÚÇÏÒÔËÉ<Tab>zD
+menutrans Fold\ column\ &width &ôÏ×ÝÉÎÁ\ ÒÑÄËÁ\ ÚÇÏÒÔ˦×
+menutrans Fold\ Met&hod &íÅÔÏÄ\ ÚÇÏÒÔÁÎÎÑ
+menutrans M&anual &òÕÞÎÉÊ
+menutrans I&ndent &÷¦ÄÓÔÕÐ
+menutrans E&xpression ÷&ÉÒÁÚ
+menutrans S&yntax &óÉÎÔÁËÓÉÞÎÏ
+menutrans Ma&rker ðÏ&ÚÎÁÞËÉ
+
+" Diff
+menutrans &Diff ðÏ&Ò¦×ÎÑÎÎÑ
+menutrans &Update &ðÏÎÏ×ÉÔÉ
+menutrans &Get\ Block &úÁÐÏÚÉÞÉÔÉ\ Ò¦ÚÎÉÃÀ
+menutrans &Put\ Block &÷ÐÒÏ×ÁÄÉÔÉ\ Ò¦ÚÎÉÃÀ
+
+" Make and stuff...
+menutrans &Make<Tab>:make &âÕÄÕ×ÁÔÉ(make)<Tab>:make
+menutrans &List\ Errors<Tab>:cl &óÐÉÓÏË\ ÐÏÍÉÌÏË<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! óÐ&ÉÓÏË\ ÐÏצÄÏÍÌÅÎØ<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn &îÁÓÔÕÐÎÁ\ ÐÏÍÉÌËÁ<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp &ðÏÐÅÒÅÄÎÑ\ ÐÏÍÉÌËÁ<Tab>:cp
+menutrans &Older\ List<Tab>:cold &âÕ×Û¦\ ÐÏÍÉÌËÉ<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew &íÁÊÂÕÔΦ\ ÐÏÍÉÌËÉ<Tab>:cnew
+menutrans Error\ &Window &÷¦ËÎÏ\ ÐÏÍÉÌÏË
+menutrans &Update<Tab>:cwin &ðÏÎÏ×ÉÔÉ<Tab>:cwin
+menutrans &Close<Tab>:cclose &úÁËÒÉÔÉ<Tab>:cclose
+menutrans &Open<Tab>:copen &÷¦ÄËÒÉÔÉ<Tab>:copen
+
+menutrans &Set\ Compiler ÷ÓÔÁÎÏ×ÉÔÉ\ &ËÏÍЦÌÑÔÏÒ
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ðÅÒÅ×ÅÓÔÉ\ ×\ Û¦ÓÔÎÁÄÃÑÔËÏצ\ ËÏÄÉ<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ðÏ×ÅÒÎÕÔÉ\ ×\ ÄצÊËÏ×Õ\ ÆÏÒÍÕ<Tab>:%!xxd\ -r
+
+" Names for buffer menu.
+menutrans &Buffers &âÕÆÅÒÉ
+menutrans &Refresh\ menu &ðÏÎÏ×ÉÔÉ
+menutrans Delete &÷ÉÄÁÌÉÔÉ
+menutrans &Alternate &÷ÔÏÒÉÎÎÉÊ
+menutrans &Next &ó̦ÄÕÀÞÉÊ
+menutrans &Previous &ðÏÐÅÒÅÄΦÊ
+menutrans [No\ File] [îÅÍÁ¤\ æÁÊÌÁ]
+
+" Window menu
+menutrans &Window &÷¦ËÎÏ
+menutrans &New<Tab>^Wn &îÏ×Å<Tab>^Wn
+menutrans S&plit<Tab>^Ws &òÏÚĦÌÉÔÉ<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ òÏÚĦÌÉÔÉ\ ÄÌÑ\ &×ÔÏÒÉÎÎÏÇÏ\ ÆÁÊÌÕ<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv òÏÚĦÌÉÔÉ\ &ÐÏÐÅÒÅË<Tab>^Wv
+"menutrans Split\ &Vertically<Tab>^Wv &òÏÚĦÌÉÔÉ\ ÐÏÐÅÒÅË<Tab>^Wv
+menutrans Split\ File\ E&xplorer òÏÚĦÌÉÔÉ\ ÄÌÑ\ &ÐÅÒÅÇÌÑÄÕ\ ÆÁÊ̦×
+
+menutrans &Close<Tab>^Wc &úÁËÒÉÔÉ<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo úÁËÒÉÔÉ\ ÕÓ¦\ &¦ÎÛ¦<Tab>^Wo
+menutrans Ne&xt<Tab>^Ww &îÁÓÔÕÐÎÅ<Tab>^Ww
+menutrans P&revious<Tab>^WW &ðÏÐÅÒÅÄΤ<Tab>^WW
+menutrans &Equal\ Size<Tab>^W= &÷ÉÒ¦×ÎÑÔÉ\ ÒÏÚͦÒ<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ îÁÊ&¦ÌØÛÁ\ ×ÉÓÏÔÁ<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ îÁÊ&ÍÅÎÛÁ\ ×ÉÓÏÔÁ<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| îÁʦ&ÌØÛÁ\ ÛÉÒÉÎÁ<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| îÁÊÍÅÎ&ÛÁ\ ÛÉÒÉÎÁ<Tab>^W1\|
+menutrans Move\ &To &úͦÓÔÉÔÉ
+menutrans &Top<Tab>^WK äÏ&ÇÏÒÉ<Tab>^WK
+menutrans &Bottom<Tab>^WJ äÏ&ÎÉÚÕ<Tab>^WJ
+menutrans &Left\ side<Tab>^WH õ&̦×Ï<Tab>^WH
+menutrans &Right\ side<Tab>^WL ÷&ÐÒÁ×Ï<Tab>^WL
+menutrans Rotate\ &Up<Tab>^WR &ãÉË̦ÞÎÏ\ ÄÏÇÏÒÉ<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ã&ÉË̦ÞÎÏ\ ÕÎÉÚ<Tab>^Wr
+
+" The popup menu
+menutrans &Undo &÷¦ÄͦÎÉÔÉ
+menutrans Cu&t ÷É&Ò¦ÚÁÔÉ
+menutrans &Copy &ëÏЦÀ×ÁÔÉ
+menutrans &Paste ÷&ÓÔÁ×ÉÔÉ
+menutrans &Delete ÷É&ÄÁÌÉÔÉ
+menutrans Select\ &Word ÷ÉÂÒÁÔÉ\ &ÓÌÏ×Ï
+menutrans Select\ &Line ÷ÉÂÒÁÔÉ\ &ÒÑÄÏË
+menutrans Select\ &Block ÷ÉÂÒÁÔÉ\ &ÂÌÏË
+menutrans Select\ &All ÷ÉÂÒÁÔÉ\ &ÕÓÅ
+
+
+
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ÷¦ÄËÒÉÔÉ ÆÁÊÌ
+ tmenu ToolBar.Save úÁÐÁÍ'ÑÔÁÔÉ ÆÁÊÌ
+ tmenu ToolBar.SaveAll úÁÐÁÍ'ÑÔÁÔÉ ÕÓ¦ ÆÁÊÌÉ
+ tmenu ToolBar.Print äÒÕËÕ×ÁÔÉ
+ tmenu ToolBar.Undo ÷¦ÄͦÎÉÔÉ
+ tmenu ToolBar.Redo ðÏ×ÅÒÎÕÔÉ
+ tmenu ToolBar.Cut ÷ÉÒ¦ÚÁÔÉ
+ tmenu ToolBar.Copy ëÏЦÀ×ÁÔÉ
+ tmenu ToolBar.Paste ÷ÓÔÁ×ÉÔÉ
+ tmenu ToolBar.Find úÎÁÊÔÉ...
+ tmenu ToolBar.FindNext úÎÁÊÔÉ ÎÁÓÔÕÐÎÉÊ
+ tmenu ToolBar.FindPrev úÎÁÊÔÉ ÐÏÐÅÒÅÄΦÊ
+ tmenu ToolBar.Replace úÁͦÎÉÔÉ...
+ tmenu ToolBar.LoadSesn úÁ×ÁÎÔÁÖÉÔÉ ÓÅÁÎÓ ÒÅÄÁÇÕ×ÁÎÎÑ
+ tmenu ToolBar.SaveSesn úÁÐÁÍ'ÑÔÁÔÉ ÓÅÁÎÓ ÒÅÄÁÇÕ×ÁÎÎÑ
+ tmenu ToolBar.RunScript ÷ÉËÏÎÁÔÉ ÆÁÊÌ ËÏÍÁÎÄ
+ tmenu ToolBar.Make úÂÕÄÕ×ÁÔÉ ÐÒÏÅËÔ
+ tmenu ToolBar.Shell Shell
+ tmenu ToolBar.RunCtags óÔ×ÏÒÉÔÉ ÆÁÊÌ ÐÏͦÔÏË
+ tmenu ToolBar.TagJump ðÅÒÅÊÔÉ ÄÏ ÐÏͦÔËÉ
+ tmenu ToolBar.Help äÏÐÏÍÏÇÁ
+ tmenu ToolBar.FindHelp ðÏÛÕË Õ ÄÏÐÏÍÏÚ¦
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax &óÉÎÔÁËÓÉÓ
+menutrans Set\ '&syntax'\ only ÷ÓÔÁÎÏ×ÌÀ×ÁÔÉ\ ÌÉÛÅ\ '&syntax'
+menutrans Set\ '&filetype'\ too ÷ÓÔÁÎÏ×ÌÀ×ÁÔÉ\ '&filetype'\ ÔÁËÏÖ
+menutrans &Off &÷ÉÍËÎÅÎÏ
+menutrans &Manual &òÕÞÎÉÊ
+menutrans A&utomatic &á×ÔÏÍÁÔÉÞÎÏ
+menutrans on/off\ for\ &This\ file ðÅÒÅÍËÎÕÔÉ\ ÄÌÑ\ ÃØÏÇÏ\ &ÆÁÊÌÁ
+menutrans Co&lor\ test ðÅÒÅצÒËÁ\ &ËÏÌØÏÒ¦×
+menutrans &Highlight\ test &ðÅÒÅצÒËÁ\ ×ÉĦÌÅÎÎÑ
+menutrans &Convert\ to\ HTML óÔ×ÏÒÉÔÉ\ &HTML
+
+" dialog texts
+let menutrans_no_file = "[îÅÍÁ¤\ æÁÊÌÁ]"
+let menutrans_help_dialog = "÷ËÁÖ¦ÔØ ËÏÍÁÎÄÕ ÁÂÏ ÓÌÏ×Ï ÄÌÑ ÐÏÛÕËÕ:\n\näÏÄÁÊÔÅ i_ ÄÌÑ ËÏÍÁÎÄ ÒÅÖÉÍÕ ×ÓÔÁ×ËÉ (ÎÁÐÒ. i_CTRL-X)\näÏÄÁÊÔÅ i_ ÄÌÑ ËÏÍÁÎÄÎÏÇÏ ÒÅÖÉÍÕ (ÎÁÐÒ. Ó_<Del>)\näÏÄÁÊÔÅ ' ÄÌÑ ÐÏÚÎÁÞÅÎÎÑ ÎÁÚ×É ÏÐæ§ (ÎÁÐÒ. 'shiftwidth')"
+let g:menutrans_path_dialog = "÷ËÁÖ¦ÔØ ÛÌÑÈ ÐÏÛÕËÕ ÆÁÊ̦×\nòÏÚĦÌÑÊÔÅ ÎÁÚ×É ÄÉÒÅËÔÏÒ¦Ê ËÏÍÁÍÉ."
+let g:menutrans_tags_dialog = "÷ËÁÖ¦ÔØ ÎÁÚ×É ÆÁÊÌ¦× ÐÏͦÔÏË\nòÏÚĦÌÑÊÔÅ ÎÁÚ×É ËÏÍÁÍÉ."
+let g:menutrans_textwidth_dialog = "÷ËÁÖ¦ÔØ ÎÏ×Õ ÛÉÒÉÎÕ ÔÅËÓÔÕ (0 ÄÌÑ ×¦ÄͦÎÉ ÆÏÍÁÔÕ×ÁÎÎÑ)"
+let g:menutrans_fileformat_dialog = "÷ÉÂÅÒ¦ÔØ ÆÏÒÍÁÔ ÆÁÊÌÕ"
+
diff --git a/runtime/lang/menu_zh.big5.vim b/runtime/lang/menu_zh.big5.vim
new file mode 100644
index 000000000..b07d8ef5f
--- /dev/null
+++ b/runtime/lang/menu_zh.big5.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
diff --git a/runtime/lang/menu_zh.cp936.vim b/runtime/lang/menu_zh.cp936.vim
new file mode 100644
index 000000000..e398582b8
--- /dev/null
+++ b/runtime/lang/menu_zh.cp936.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Simplified Chinese (for Windows)
+
+source <sfile>:p:h/menu_chinese_gb.936.vim
diff --git a/runtime/lang/menu_zh.cp950.vim b/runtime/lang/menu_zh.cp950.vim
new file mode 100644
index 000000000..f437ce7c2
--- /dev/null
+++ b/runtime/lang/menu_zh.cp950.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Traditional Chinese
+
+source <sfile>:p:h/menu_chinese_taiwan.950.vim
diff --git a/runtime/lang/menu_zh.gb2312.vim b/runtime/lang/menu_zh.gb2312.vim
new file mode 100644
index 000000000..5a16e18ea
--- /dev/null
+++ b/runtime/lang/menu_zh.gb2312.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Simplified Chinese (for Windows)
+
+source <sfile>:p:h/menu_zh_cn.gb2312.vim
diff --git a/runtime/lang/menu_zh_cn.18030.vim b/runtime/lang/menu_zh_cn.18030.vim
new file mode 100644
index 000000000..99da41a9a
--- /dev/null
+++ b/runtime/lang/menu_zh_cn.18030.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Simplified Chinese
+
+source <sfile>:p:h/menu_zh_cn.gb2312.vim
diff --git a/runtime/lang/menu_zh_cn.cp936.vim b/runtime/lang/menu_zh_cn.cp936.vim
new file mode 100644
index 000000000..e398582b8
--- /dev/null
+++ b/runtime/lang/menu_zh_cn.cp936.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Simplified Chinese (for Windows)
+
+source <sfile>:p:h/menu_chinese_gb.936.vim
diff --git a/runtime/lang/menu_zh_cn.gb2312.vim b/runtime/lang/menu_zh_cn.gb2312.vim
new file mode 100644
index 000000000..b0eac38e7
--- /dev/null
+++ b/runtime/lang/menu_zh_cn.gb2312.vim
@@ -0,0 +1,230 @@
+" Menu Translations: Simplified Chinese (UNIX)
+" Translated By: Wang Jun <junw@turbolinux.com.cn>
+" Last Change: Tue Sep 4 11:26:52 CST 2001
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding gb2312
+
+" Help menu
+menutrans &Help °ïÖú(&H)
+menutrans &Overview<Tab><F1> Ô¤ÀÀ(&O)<Tab><F1>
+menutrans &User\ Manual Óû§ÊÖ²á(&U)
+menutrans &GUI ͼÐνçÃæ(&G)
+menutrans &How-to\ links HOWTOÎĵµ\.\.\.(&H)
+menutrans &Credits ×÷Õß(&C)
+menutrans Co&pying °æȨ(&P)
+menutrans &Version °æ±¾(&V)
+menutrans &About ¹ØÓÚ\ Vim(&A)
+
+" File menu
+menutrans &File Îļþ(&F)
+menutrans &Open\.\.\.<Tab>:e ´ò¿ª(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp ·Ö¸î´°¿Ú²¢´ò¿ª(&L)<Tab>:sp
+menutrans &New<Tab>:enew н¨(&N)<Tab>:enew
+menutrans &Close<Tab>:close ¹Ø±Õ(&C)<Tab>:close
+menutrans &Save<Tab>:w ±£´æ(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Áí´æΪ(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. ·Ö¸î±È½Ï(&Diff)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. ·Ö¸î´ò²¹¶¡(&Patch)\.\.\.
+menutrans &Print ´òÓ¡(&P)
+menutrans Sa&ve-Exit<Tab>:wqa ±£´æ²¢Í˳ö(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa Í˳ö(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit ±à¼­(&E)
+menutrans &Undo<Tab>u »Ö¸´(&U)<Tab>u
+menutrans &Redo<Tab>^R ÖØ×ö(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. Öظ´Éϴζ¯×÷(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x ¼ôÇÐ(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y ¸´ÖÆ(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP Õ³Ìû(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Ìùµ½¹â±êÇ°(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p Ìùµ½¹â±êºó(&A)<Tab>]p
+menutrans &Delete<Tab>x ɾ³ý(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG È«Ñ¡(&S)<Tab>ggvG
+menutrans &Find\.\.\. ²éÕÒ(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. ²éÕÒÌæ»»(&L)\.\.\.
+menutrans Settings\ &Window É趨´°¿Ú(&W)
+menutrans &Global\ Settings È«¾ÖÉ趨(&G)
+
+" Build boolean options
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! ¿ª/¹ØÔöÁ¿²éÕÒģʽ<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! ¿ª/¹ØºöÂÔ´óСдģʽ<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! ¿ª/¹ØÆ¥ÅäÏÔʾ<Tab>:set sm!
+menutrans &Context\ lines ÉÏÏÂÎÄÐÐÊý(&C)
+
+menutrans &Virtual\ Edit ¿ÉÊÓ»¯±à¼­Ä£Ê½(&V)
+menutrans Never ´Ó²»
+menutrans Block\ Selection ¿éÑ¡Ôñ
+menutrans Insert\ mode ²åÈëģʽ
+menutrans Block\ and\ Insert ¿éÑ¡ÔñÓë²åÈëģʽ
+menutrans Always ËùÓÐģʽ
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! ¿ª/¹Ø²åÈëģʽ<Tab>:set\ im!
+
+menutrans Search\ &Path\.\.\. ²éÕÒ·¾¶\.\.\.(&P)
+
+menutrans Ta&g\ Files\.\.\. ±êÇ©Îļþ\.\.\.(&g)
+
+" GUI options
+menutrans Toggle\ &Toolbar ¿ª/¹Ø¹¤¾ßÌõ(&T)
+menutrans Toggle\ &Bottom\ Scrollbar ¿ª/¹Øµ×²¿¹ö¶¯Ìõ(&B)
+menutrans Toggle\ &Left\ Scrollbar ¿ª/¹Ø×ó¶Ë¹ö¶¯Ìõ(&L)
+menutrans Toggle\ &Right\ Scrollbar ¿ª/¹ØÓҶ˹ö¶¯Ìõ(&R)
+
+
+" Edit/File Settings
+menutrans F&ile\ Settings ÎļþÉ趨(&i)
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! ¿ª/¹ØÏÔʾÐкÅ<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! ¿ª/¹ØÏÔʾTab<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! ¿ª/¹Ø×Ô¶¯ÕÛÐÐ<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! ¿ª/¹Ø´ÊβÕÛÐÐ<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! ¿ª/¹Øexpand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! ¿ª/¹Øauto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! ¿ª/¹ØC-indent<Tab>:set\ cin!
+
+
+" other options
+menutrans &Shiftwidth ËõÅÅ¿í¶È(&S)
+menutrans Soft\ &Tabstop αTab¿í¶È(&T)
+menutrans Te&xt\ Width\.\.\. Ò³Ãæ¿í¶È(&x)\.\.\.
+menutrans &File\ Format\.\.\. Îļþ¸ñʽ(&F)\.\.\.
+
+menutrans C&olor\ Scheme µ÷É«°å(&o)
+menutrans Select\ Fo&nt\.\.\. Ñ¡Ôñ×ÖÌå(&n)\.\.\.
+
+
+" Programming menu
+menutrans &Tools ¹¤¾ß(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] ¼ìË÷¹â±ê´¦µÄ±êÇ©¹Ø¼ü×Ö(tag)(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T Ìø»Ø¼ìË÷Ç°µÄλÖÃ(&B)<Tab>^T
+menutrans Build\ &Tags\ File ½¨Á¢±êÇ©Ë÷ÒýÎļþ\ Tags(&T)
+menutrans &Folding FoldingÉ趨(&F)
+menutrans &Diff ±È½Ï(&D)
+menutrans &Make<Tab>:make Ö´ÐÐ\ Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl Áгö±àÒë´íÎó(&E)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! ÁгöËùÓÐÐÅÏ¢(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn ÏÂÒ»¸ö±àÒë´íÎó´¦(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp ÉÏÒ»¸ö±àÒë´íÎó´¦(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold ¾É´íÎóÁбí(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew дíÎóÁбí(&E)<Tab>:cnew
+menutrans Error\ &Window ´íÎóÐÅÏ¢´°¿Ú(&W)
+menutrans &Set\ Compiler ÉèÖñàÒëÆ÷(&S)
+menutrans &Convert\ to\ HEX<Tab>:%!xxd ת»»³É16½øÖÆ<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r ´Ó16½øÖÆת»»»ØÎÄ×Ö<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi ʹÓÃ/²»Ê¹ÓÃFolding(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv ²é¿´´ËÐÐ(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Ö»²é¿´´ËÐÐ(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm ¹Ø±ÕFolds(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM ¹Ø±ÕËùÓÐFolds(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr Õ¹¿ªFolds(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Õ¹¿ªËùÓÐFolds(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod Fold·½Ê½(&H)
+menutrans Create\ &Fold<Tab>zf ½¨Á¢Fold(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd ɾ³ýFold(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD ɾ³ýËùÓÐFold(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ column\ &width É趨FoldÀ¸¿í(&W)
+
+" Tools.Diff Menu
+menutrans &Update ¸üÐÂ(&U)
+menutrans &Get\ Block È¡µÃ²»Í¬²¿·Ö(&G)
+menutrans &Put\ Block ½«²»Í¬²¿·ÖÓ¦Óõ½¶Ô·½(&P)
+
+
+" Names for buffer menu.
+menutrans &Buffers »º³åÇø(&B)
+menutrans &Refresh\ menu ¸üÐÂ(&R)
+menutrans &Delete ɾ³ý(&D)
+menutrans &Alternate ÐÞ¸Ä(&L)
+menutrans &Next ÏÂÒ»¸ö(&N)
+menutrans &Previous Ç°Ò»¸ö(&P)
+
+" Window menu
+menutrans &Window ´°¿Ú(&W)
+menutrans &New<Tab>^Wn н¨´°¿Ú(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws ·Ö¸î´°¿Ú(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ ·Ö¸îµ½#(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv ´¹Ö±·Ö¸î(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer Îļþä¯ÀÀÆ÷ʽ·Ö¸î(&X)
+menutrans &Close<Tab>^Wc ¹Ø±Õ´°¿Ú(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo ¹Ø±ÕÆäËü´°¿Ú(&O)<Tab>^Wo
+menutrans Move\ &To Òƶ¯µ½(&T)
+menutrans &Top<Tab>^WK ¶¥¶Ë(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ µ×¶Ë(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH ×ó±ß(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL ÓÒ±ß(&R)<Tab>^WL
+" menutrans Ne&xt<Tab>^Ww ÏÂÒ»¸ö(&X)<Tab>^Ww
+" menutrans P&revious<Tab>^WW ÉÏÒ»¸ö(&R)<Tab>^WW
+menutrans Rotate\ &Up<Tab>^WR ÉÏÒÆ´°¿Ú(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr ÏÂÒÆ´°¿Ú(&D)<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= ËùÓд°¿ÚµÈ¸ß(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ ×î´ó¸ß¶È(&M)<Tab>^W
+menutrans M&in\ Height<Tab>^W1_ ×îС¸ß¶È(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| ×î´ó¿í¶È(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| ×îС¿í¶È(&h)<Tab>^W1\|
+"
+" The popup menu
+menutrans &Undo ³·Ïú(&U)
+menutrans Cu&t ¼ôÇÐ(&T)
+menutrans &Copy ¸´ÖÆ(&C)
+menutrans &Paste Õ³Ìû(&P)
+menutrans &Delete ɾ³ý(&D)
+menutrans Select\ Blockwise BlockwiseÑ¡Ôñ
+menutrans Select\ &Word Ñ¡Ôñµ¥´Ê(&W)
+menutrans Select\ &Line Ñ¡ÔñÐÐ(&L)
+menutrans Select\ &Block Ñ¡Ôñ¿é(&B)
+menutrans Select\ &All È«Ñ¡(&A)
+"
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open ´ò¿ªÎļþ
+ tmenu ToolBar.Save ±£´æµ±Ç°Îļþ
+ tmenu ToolBar.SaveAll ±£´æÈ«²¿Îļþ
+ tmenu ToolBar.Print ´òÓ¡
+ tmenu ToolBar.Undo ³·ÏúÉÏ´ÎÐÞ¸Ä
+ tmenu ToolBar.Redo ÖØ×öÉϴγ·ÏúµÄ¶¯×÷
+ tmenu ToolBar.Cut ¼ôÇÐÖÁ¼ôÌù°å
+ tmenu ToolBar.Copy ¸´ÖƵ½¼ôÌù°å
+ tmenu ToolBar.Paste ÓɼôÌù°åÕ³Ìû
+ tmenu ToolBar.Find ²éÕÒ...
+ tmenu ToolBar.FindNext ²éÕÒÏÂÒ»¸ö
+ tmenu ToolBar.FindPrev ²éÕÒÉÏÒ»¸ö
+ tmenu ToolBar.Replace Ìæ»»...
+ tmenu ToolBar.LoadSesn ¼ÓÔػỰ
+ tmenu ToolBar.SaveSesn ±£´æµ±Ç°µÄ»á»°
+ tmenu ToolBar.RunScript ÔËÐÐVim½Å±¾
+ tmenu ToolBar.Make Ö´ÐÐ Make
+ tmenu ToolBar.Shell ´ò¿ªÒ»¸öÃüÁî´°¿Ú
+ tmenu ToolBar.RunCtags Ö´ÐÐ ctags
+ tmenu ToolBar.TagJump Ìøµ½µ±Ç°¹â±êλÖõıêÇ©
+ tmenu ToolBar.Help Vim °ïÖú
+ tmenu ToolBar.FindHelp ²éÕÒ Vim °ïÖú
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax Óï·¨(&S)
+menutrans Set\ '&syntax'\ only Ö»É趨\ 'syntax'(&s)
+menutrans Set\ '&filetype'\ too Ò²É趨\ 'filetype'(&f)
+menutrans &Off ¹Ø±Õ(&O)
+menutrans &Manual ÊÖ¶¯É趨(&M)
+menutrans A&utomatic ×Ô¶¯É趨(&U)
+menutrans on/off\ for\ &This\ file Ö»¶ÔÕâ¸öÎļþ´ò¿ª/¹Ø±Õ(&T)
+menutrans Co&lor\ test É«²ÊÏÔʾ²âÊÔ(&L)
+menutrans &Highlight\ test Ó﷨Ч¹û²âÊÔ(&H)
+menutrans &Convert\ to\ HTML ת»»³É\ HTML\ ¸ñʽ(&C)
diff --git a/runtime/lang/menu_zh_cn.gbk.vim b/runtime/lang/menu_zh_cn.gbk.vim
new file mode 100644
index 000000000..99da41a9a
--- /dev/null
+++ b/runtime/lang/menu_zh_cn.gbk.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Simplified Chinese
+
+source <sfile>:p:h/menu_zh_cn.gb2312.vim
diff --git a/runtime/lang/menu_zh_cn.utf-8.vim b/runtime/lang/menu_zh_cn.utf-8.vim
new file mode 100644
index 000000000..0dd446e10
--- /dev/null
+++ b/runtime/lang/menu_zh_cn.utf-8.vim
@@ -0,0 +1,230 @@
+" Menu Translations: Simplified Chinese (UTF-8)
+" Translated By: Wang Jun <junw@turbolinux.com.cn>
+" Last Change: Tue Sep 4 11:26:52 CST 2001
+
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+" Help menu
+menutrans &Help 帮助(&H)
+menutrans &Overview<Tab><F1> 预览(&O)<Tab><F1>
+menutrans &User\ Manual 用户手册(&U)
+menutrans &GUI 图形界é¢(&G)
+menutrans &How-to\ links HOWTO文档\.\.\.(&H)
+menutrans &Credits 作者(&C)
+menutrans Co&pying 版æƒ(&P)
+menutrans &Version 版本(&V)
+menutrans &About 关于\ Vim(&A)
+
+" File menu
+menutrans &File 文件(&F)
+menutrans &Open\.\.\.<Tab>:e 打开(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp 分割窗å£å¹¶æ‰“å¼€(&L)<Tab>:sp
+menutrans &New<Tab>:enew 新建(&N)<Tab>:enew
+menutrans &Close<Tab>:close 关闭(&C)<Tab>:close
+menutrans &Save<Tab>:w ä¿å­˜(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav å¦å­˜ä¸º(&A)\.\.\.<Tab>:sav
+menutrans Split\ &Diff\ with\.\.\. 分割比较(&Diff)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. 分割打补ä¸(&Patch)\.\.\.
+menutrans &Print 打å°(&P)
+menutrans Sa&ve-Exit<Tab>:wqa ä¿å­˜å¹¶é€€å‡º(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa 退出(&X)<Tab>:qa
+
+" Edit menu
+menutrans &Edit 编辑(&E)
+menutrans &Undo<Tab>u æ¢å¤(&U)<Tab>u
+menutrans &Redo<Tab>^R é‡åš(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. é‡å¤ä¸Šæ¬¡åŠ¨ä½œ(&E)<Tab>\.
+menutrans Cu&t<Tab>"+x 剪切(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y å¤åˆ¶(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP 粘帖(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p 贴到光标å‰(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p 贴到光标åŽ(&A)<Tab>]p
+menutrans &Delete<Tab>x 删除(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG 全选(&S)<Tab>ggvG
+menutrans &Find\.\.\. 查找(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. 查找替æ¢(&L)\.\.\.
+menutrans Settings\ &Window 设定窗å£(&W)
+menutrans &Global\ Settings 全局设定(&G)
+
+" Build boolean options
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! å¼€/关增é‡æŸ¥æ‰¾æ¨¡å¼<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! å¼€/关忽略大å°å†™æ¨¡å¼<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! å¼€/关匹é…显示<Tab>:set sm!
+menutrans &Context\ lines 上下文行数(&C)
+
+menutrans &Virtual\ Edit å¯è§†åŒ–编辑模å¼(&V)
+menutrans Never 从ä¸
+menutrans Block\ Selection å—选择
+menutrans Insert\ mode æ’入模å¼
+menutrans Block\ and\ Insert å—选择与æ’入模å¼
+menutrans Always 所有模å¼
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! å¼€/å…³æ’入模å¼<Tab>:set\ im!
+
+menutrans Search\ &Path\.\.\. 查找路径\.\.\.(&P)
+
+menutrans Ta&g\ Files\.\.\. 标签文件\.\.\.(&g)
+
+" GUI options
+menutrans Toggle\ &Toolbar å¼€/关工具æ¡(&T)
+menutrans Toggle\ &Bottom\ Scrollbar å¼€/关底部滚动æ¡(&B)
+menutrans Toggle\ &Left\ Scrollbar å¼€/关左端滚动æ¡(&L)
+menutrans Toggle\ &Right\ Scrollbar å¼€/å…³å³ç«¯æ»šåŠ¨æ¡(&R)
+
+
+" Edit/File Settings
+menutrans F&ile\ Settings 文件设定(&i)
+
+" Boolean options
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! å¼€/关显示行å·<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! 开/关显示Tab<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! 开/关自动折行<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! å¼€/å…³è¯å°¾æŠ˜è¡Œ<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! å¼€/å…³expand-tab<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! å¼€/å…³auto-indent<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! å¼€/å…³C-indent<Tab>:set\ cin!
+
+
+" other options
+menutrans &Shiftwidth 缩排宽度(&S)
+menutrans Soft\ &Tabstop 伪Tab宽度(&T)
+menutrans Te&xt\ Width\.\.\. 页é¢å®½åº¦(&x)\.\.\.
+menutrans &File\ Format\.\.\. 文件格å¼(&F)\.\.\.
+
+menutrans C&olor\ Scheme 调色æ¿(&o)
+menutrans Select\ Fo&nt\.\.\. 选择字体(&n)\.\.\.
+
+
+" Programming menu
+menutrans &Tools 工具(&T)
+menutrans &Jump\ to\ this\ tag<Tab>g^] 检索光标处的标签关键字(tag)(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T 跳回检索å‰çš„ä½ç½®(&B)<Tab>^T
+menutrans Build\ &Tags\ File 建立标签索引文件\ Tags(&T)
+menutrans &Folding Folding设定(&F)
+menutrans &Diff 比较(&D)
+menutrans &Make<Tab>:make 执行\ Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl 列出编译错误(&E)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! 列出所有信æ¯(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn 下一个编译错误处(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp 上一个编译错误处(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold 旧错误列表(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew 新错误列表(&E)<Tab>:cnew
+menutrans Error\ &Window 错误信æ¯çª—å£(&W)
+menutrans &Set\ Compiler 设置编译器(&S)
+menutrans &Convert\ to\ HEX<Tab>:%!xxd 转æ¢æˆ16进制<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r 从16进制转æ¢å›žæ–‡å­—<Tab>:%!xxd\ -r
+
+" Tools.Fold Menu
+menutrans &Enable/Disable\ folds<Tab>zi 使用/ä¸ä½¿ç”¨Folding(&E)<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv 查看此行(&V)<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx åªæŸ¥çœ‹æ­¤è¡Œ(&W)<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm 关闭Folds(&L)<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM 关闭所有Folds(&C)<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr 展开Folds(&P)<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR 展开所有Folds(&O)<Tab>zR
+" fold method
+menutrans Fold\ Met&hod Foldæ–¹å¼(&H)
+menutrans Create\ &Fold<Tab>zf 建立Fold(&F)<Tab>zf
+menutrans &Delete\ Fold<Tab>zd 删除Fold(&D)<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD 删除所有Fold(&A)<Tab>zD
+" moving around in folds
+menutrans Fold\ column\ &width 设定Foldæ å®½(&W)
+
+" Tools.Diff Menu
+menutrans &Update æ›´æ–°(&U)
+menutrans &Get\ Block å–å¾—ä¸åŒéƒ¨åˆ†(&G)
+menutrans &Put\ Block å°†ä¸åŒéƒ¨åˆ†åº”用到对方(&P)
+
+
+" Names for buffer menu.
+menutrans &Buffers 缓冲区(&B)
+menutrans &Refresh\ menu æ›´æ–°(&R)
+menutrans &Delete 删除(&D)
+menutrans &Alternate 修改(&L)
+menutrans &Next 下一个(&N)
+menutrans &Previous å‰ä¸€ä¸ª(&P)
+
+" Window menu
+menutrans &Window 窗å£(&W)
+menutrans &New<Tab>^Wn 新建窗å£(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws 分割窗å£(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ 分割到#(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv 垂直分割(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer 文件æµè§ˆå™¨å¼åˆ†å‰²(&X)
+menutrans &Close<Tab>^Wc 关闭窗å£(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo 关闭其它窗å£(&O)<Tab>^Wo
+menutrans Move\ &To 移动到(&T)
+menutrans &Top<Tab>^WK 顶端(&T)<Tab>^WK
+menutrans &Bottom<Tab>^WJ 底端(&B)<Tab>^WJ
+menutrans &Left\ side<Tab>^WH 左边(&L)<Tab>^WH
+menutrans &Right\ side<Tab>^WL å³è¾¹(&R)<Tab>^WL
+" menutrans Ne&xt<Tab>^Ww 下一个(&X)<Tab>^Ww
+" menutrans P&revious<Tab>^WW 上一个(&R)<Tab>^WW
+menutrans Rotate\ &Up<Tab>^WR 上移窗å£(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr 下移窗å£(&D)<Tab>^Wr
+menutrans &Equal\ Size<Tab>^W= 所有窗å£ç­‰é«˜(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ 最大高度(&M)<Tab>^W
+menutrans M&in\ Height<Tab>^W1_ 最å°é«˜åº¦(&i)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| 最大宽度(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| 最å°å®½åº¦(&h)<Tab>^W1\|
+"
+" The popup menu
+menutrans &Undo 撤销(&U)
+menutrans Cu&t 剪切(&T)
+menutrans &Copy å¤åˆ¶(&C)
+menutrans &Paste 粘帖(&P)
+menutrans &Delete 删除(&D)
+menutrans Select\ Blockwise Blockwise选择
+menutrans Select\ &Word 选择å•è¯(&W)
+menutrans Select\ &Line 选择行(&L)
+menutrans Select\ &Block 选择å—(&B)
+menutrans Select\ &All 全选(&A)
+"
+" The GUI toolbar
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open 打开文件
+ tmenu ToolBar.Save ä¿å­˜å½“å‰æ–‡ä»¶
+ tmenu ToolBar.SaveAll ä¿å­˜å…¨éƒ¨æ–‡ä»¶
+ tmenu ToolBar.Print 打å°
+ tmenu ToolBar.Undo 撤销上次修改
+ tmenu ToolBar.Redo é‡åšä¸Šæ¬¡æ’¤é”€çš„动作
+ tmenu ToolBar.Cut 剪切至剪贴æ¿
+ tmenu ToolBar.Copy å¤åˆ¶åˆ°å‰ªè´´æ¿
+ tmenu ToolBar.Paste 由剪贴æ¿ç²˜å¸–
+ tmenu ToolBar.Find 查找...
+ tmenu ToolBar.FindNext 查找下一个
+ tmenu ToolBar.FindPrev 查找上一个
+ tmenu ToolBar.Replace 替æ¢...
+ tmenu ToolBar.LoadSesn 加载会è¯
+ tmenu ToolBar.SaveSesn ä¿å­˜å½“å‰çš„会è¯
+ tmenu ToolBar.RunScript è¿è¡ŒVim脚本
+ tmenu ToolBar.Make 执行 Make
+ tmenu ToolBar.Shell 打开一个命令窗å£
+ tmenu ToolBar.RunCtags 执行 ctags
+ tmenu ToolBar.TagJump 跳到当å‰å…‰æ ‡ä½ç½®çš„标签
+ tmenu ToolBar.Help Vim 帮助
+ tmenu ToolBar.FindHelp 查找 Vim 帮助
+ endfun
+endif
+
+" Syntax menu
+menutrans &Syntax 语法(&S)
+menutrans Set\ '&syntax'\ only åªè®¾å®š\ 'syntax'(&s)
+menutrans Set\ '&filetype'\ too 也设定\ 'filetype'(&f)
+menutrans &Off 关闭(&O)
+menutrans &Manual 手动设定(&M)
+menutrans A&utomatic 自动设定(&U)
+menutrans on/off\ for\ &This\ file åªå¯¹è¿™ä¸ªæ–‡ä»¶æ‰“å¼€/关闭(&T)
+menutrans Co&lor\ test 色彩显示测试(&L)
+menutrans &Highlight\ test 语法效果测试(&H)
+menutrans &Convert\ to\ HTML 转æ¢æˆ\ HTML\ æ ¼å¼(&C)
diff --git a/runtime/lang/menu_zh_tw.big5.vim b/runtime/lang/menu_zh_tw.big5.vim
new file mode 100644
index 000000000..b07d8ef5f
--- /dev/null
+++ b/runtime/lang/menu_zh_tw.big5.vim
@@ -0,0 +1 @@
+source <sfile>:p:h/menu_chinese(taiwan)_taiwan.950.vim
diff --git a/runtime/lang/menu_zh_tw.cp950.vim b/runtime/lang/menu_zh_tw.cp950.vim
new file mode 100644
index 000000000..f437ce7c2
--- /dev/null
+++ b/runtime/lang/menu_zh_tw.cp950.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Traditional Chinese
+
+source <sfile>:p:h/menu_chinese_taiwan.950.vim
diff --git a/runtime/lang/menu_zh_tw.utf-8.vim b/runtime/lang/menu_zh_tw.utf-8.vim
new file mode 100644
index 000000000..871cece9e
--- /dev/null
+++ b/runtime/lang/menu_zh_tw.utf-8.vim
@@ -0,0 +1,284 @@
+" Menu Translations: Traditional Chinese (for UTF-8)
+" Translated By: Hung-Teh, Lin <piaip@csie.ntu.edu.tw>
+" Last Change: Thu Apr 24 17:35:17 CST 2003
+
+" {{{ Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+" }}}
+
+scriptencoding utf-8
+
+" {{{ Help menu: complete
+menutrans &Help 輔助說明(&H)
+" ------------------------------------------------------------------------
+menutrans &Overview<Tab><F1> 說明文件總覽(&O)<Tab><F1>
+menutrans &User\ Manual 使用者手冊(&U)
+menutrans &How-to\ links 如何作\.\.\.(&H)
+menutrans &GUI 圖型界é¢(&G)
+menutrans &Credits æ„Ÿè¬(&C)
+menutrans Co&pying 版權宣告(&P)
+menutrans O&rphans 拯救孤兒(&R)
+" ------------------------------------------------------------------------
+menutrans &Version 程å¼ç‰ˆæœ¬è³‡è¨Š(&V)
+menutrans &About 關於\ Vim(&A)
+" }}}
+
+" {{{ File menu: complete
+menutrans &File 檔案(&F)
+" ------------------------------------------------------------------------
+menutrans &Open\.\.\.<Tab>:e é–‹å•Ÿ(&O)\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp 分割視窗並開啟(&L)<Tab>:sp
+menutrans &New<Tab>:enew 編輯新檔案(&N)<Tab>:enew
+menutrans &Close<Tab>:close 關閉檔案(&C)<Tab>:close
+" ------------------------------------------------------------------------
+menutrans &Save<Tab>:w 儲存(&S)<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav å¦å­˜æ–°æª”(&A)\.\.\.<Tab>:sav
+" ------------------------------------------------------------------------
+menutrans Split\ &Diff\ with\.\.\. 比較(&Diff)\.\.\.
+menutrans Split\ Patched\ &By\.\.\. 執行Patch(&B)\.\.\.
+" ------------------------------------------------------------------------
+menutrans &Print 列å°(&P)
+" ------------------------------------------------------------------------
+menutrans Sa&ve-Exit<Tab>:wqa 儲存並離開(&V)<Tab>:wqa
+menutrans E&xit<Tab>:qa 離開(&X)<Tab>:qa
+" }}}
+
+" {{{ Edit menu
+menutrans &Edit 編輯(&E)
+" ------------------------------------------------------------------------
+menutrans &Undo<Tab>u 復原(&U)<Tab>u
+menutrans &Redo<Tab>^R å–消上次復原(&R)<Tab>^R
+menutrans Rep&eat<Tab>\. é‡è¤‡ä¸Šæ¬¡å‹•ä½œ(&E)<Tab>\.
+" ------------------------------------------------------------------------
+menutrans Cu&t<Tab>"+x 剪下(&T)<Tab>"+x
+menutrans &Copy<Tab>"+y 複製(&C)<Tab>"+y
+menutrans &Paste<Tab>"+gP 貼上(&P)<Tab>"+gP
+menutrans Put\ &Before<Tab>[p 貼到游標å‰(&B)<Tab>[p
+menutrans Put\ &After<Tab>]p 貼到游標後(&A)<Tab>]p
+menutrans &Delete<Tab>x 刪除(&D)<Tab>x
+menutrans &Select\ all<Tab>ggVG å…¨é¸(&S)<Tab>ggvG
+" ------------------------------------------------------------------------
+menutrans &Find\.\.\. 尋找(&F)\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. 尋找並å–代(&L)\.\.\.
+" ------------------------------------------------------------------------
+menutrans Settings\ &Window 設定視窗(&W)
+menutrans &Global\ Settings 全域設定(&G)
+menutrans F&ile\ Settings 設定此檔案(&I)
+menutrans C&olor\ Scheme é…色設定(&O)
+menutrans &Keymap éµç›¤å°æ‡‰(&K)
+ " "{{{ Keymap:
+ menutrans None ç„¡
+ " }}}
+menutrans Select\ Fo&nt\.\.\. 設定字型(&N)\.\.\.
+" }}}
+
+" {{{ Edit.FileSettings
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! 切æ›é¡¯ç¤ºè¡Œè™Ÿ(&N)<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! 切æ›é¡¯ç¤ºè¡Œå°¾åŠTAB(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! 切æ›è‡ªå‹•æŠ˜è¡Œé¡¯ç¤º(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! 切æ›æŠ˜è¡Œé¡¯ç¤ºå¯ä»»æ„æ–·å¥(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! 切æ›å±•é–‹TAB(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! 切æ›è‡ªå‹•ç¸®æŽ’(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! 切æ›ï¼£èªžè¨€ç¸®æŽ’(&C)<Tab>:set\ cin!
+" ------------------------------------------------------------------------
+menutrans &Shiftwidth 縮排寬度(shiftwidth)(&S)
+menutrans Soft\ &Tabstop 軟體模擬TAB(softtabstop)(&T)
+menutrans Te&xt\ Width\.\.\. 文字é é¢å¯¬åº¦(textwidth)(&X)\.\.\.
+menutrans &File\ Format\.\.\. 設定檔案格å¼(å°æ‡‰ä½œæ¥­ç³»çµ±)(&F)\.\.\.
+" }}}
+
+" {{{ Edit.GlobalSettings
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! 切æ›é«˜äº®åº¦æœå°‹å­—串(&H)<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! 切æ›å¿½ç•¥å¤§å°å¯«(&I)<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! 切æ›é¡¯ç¤ºå°æ‡‰æ‹¬è™Ÿ(&S)<Tab>:set\ sm!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! 切æ›å‚³çµ±Vi相容模å¼(&O)<Tab>:set\ cp!
+menutrans &Context\ lines 本文å‰å¾Œä¿ç•™è¡Œæ•¸(scrolloff)(&C)
+menutrans &Virtual\ Edit 游標任æ„移動(virtualedit)(&V)
+ " {{{ Edit.GlobalSettings.VirtualEdit
+ menutrans Never ä¸ä½¿ç”¨
+ menutrans Block\ Selection å€å¡Šé¸æ“‡æ™‚
+ menutrans Insert\ mode æ’入模å¼æ™‚
+ menutrans Block\ and\ Insert å€å¡Šèˆ‡æ’入模å¼
+ menutrans Always 一直開啟
+ " }}}
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! 切æ›æ’入模å¼(&M)<Tab>:set\ im!
+menutrans Search\ &Path\.\.\. æœå°‹è·¯å¾‘(&P)\.\.\.
+menutrans Ta&g\ Files\.\.\. Tag\ 標籤索引檔案(&G)\.\.\.
+" ------------------------------------------------------------------------
+menutrans Toggle\ &Toolbar 切æ›ä½¿ç”¨å·¥å…·åˆ—(&T)
+menutrans Toggle\ &Bottom\ Scrollbar 切æ›ä½¿ç”¨åº•ç«¯æ²å‹•è»¸(&B)
+menutrans Toggle\ &Left\ Scrollbar 切æ›ä½¿ç”¨å·¦ç«¯æ²å‹•è»¸(&L)
+menutrans Toggle\ &Right\ Scrollbar 切æ›ä½¿ç”¨å³ç«¯æ²å‹•è»¸(&R)
+" }}}
+
+" {{{ Tools menu: complete
+menutrans &Tools 工具(&T)
+" ------------------------------------------------------------------------
+menutrans &Jump\ to\ this\ tag<Tab>g^] 檢索游標處的標籤關éµå­—(tag)(&J)<Tab>g^]
+menutrans Jump\ &back<Tab>^T 跳回檢索å‰çš„ä½ç½®(&B)<Tab>^T
+menutrans Build\ &Tags\ File 建立標籤索引檔\ Tags(&T)
+" ------------------------------------------------------------------------
+menutrans &Folding 覆疊(Fold)設定(&F)
+ " {{{ Tools.Fold
+ menutrans &Enable/Disable\ folds<Tab>zi 切æ›ä½¿ç”¨\ Folding(&E)<Tab>zi
+ menutrans &View\ Cursor\ Line<Tab>zv 檢視此層\ Fold(&V)<Tab>zv
+ menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx åªæª¢è¦–æ­¤\ Fold(&W)<Tab>zMzx
+ menutrans C&lose\ more\ folds<Tab>zm 收起一層\ Folds(&L)<Tab>zm
+ menutrans &Close\ all\ folds<Tab>zM 收起所有\ Folds(&C)<Tab>zM
+ menutrans O&pen\ more\ folds<Tab>zr 打開一層\ Folds(&P)<Tab>zr
+ menutrans &Open\ all\ folds<Tab>zR 打開所有\ Folds(&O)<Tab>zR
+ menutrans Fold\ Met&hod Folding\ æ–¹å¼(&H)
+ " {{{ Tools.Fold.Method
+ menutrans M&anual 手動建立(&A)
+ menutrans I&ndent ä¾ç…§ç¸®æŽ’(&N)
+ menutrans E&xpression 自訂é‹ç®—å¼(&X)
+ menutrans S&yntax ä¾ç…§èªžæ³•è¨­å®š(&Y)
+ menutrans &Diff Diff(&D)
+ menutrans Ma&rker 標記(Marker)(&R)
+ " }}}
+ " ------------------------------------------------------------------------
+ menutrans Create\ &Fold<Tab>zf 建立\ Fold(&F)<Tab>zf
+ menutrans &Delete\ Fold<Tab>zd 刪除\ Fold(&D)<Tab>zd
+ menutrans Delete\ &All\ Folds<Tab>zD 刪除所有\ Fold(&A)<Tab>zD
+ " ------------------------------------------------------------------------
+ menutrans Fold\ column\ &width 設定\ Fold欄寬(&W)
+ " }}}
+menutrans &Diff Diff(&D)
+ " {{{ Tools.Diff
+ menutrans &Update æ›´æ–°(&U)
+ menutrans &Get\ Block å–å¾—å€å¡Š(&G)
+ menutrans &Put\ Block 貼上å€å¡Š(&P)
+ " }}}
+" ------------------------------------------------------------------------
+menutrans &Make<Tab>:make 執行\ Make(&M)<Tab>:make
+menutrans &List\ Errors<Tab>:cl 列出編譯錯誤(&E)<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! 列出所有訊æ¯(&I)<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn 下一個編譯錯誤處(&N)<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp 上一個編譯錯誤處(&P)<Tab>:cp
+menutrans &Older\ List<Tab>:cold 檢視舊錯誤列表(&O)<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew 檢視新錯誤列表(&E)<Tab>:cnew
+menutrans Error\ &Window 錯誤訊æ¯è¦–窗(&W)
+ " {{{ Tools.ErrorWindow
+ menutrans &Update<Tab>:cwin æ›´æ–°(&U)<Tab>:cwin
+ menutrans &Open<Tab>:copen é–‹å•Ÿ(&O)<Tab>:copen
+ menutrans &Close<Tab>:cclose 關閉(&C)<Tab>:cclose
+ " }}}
+menutrans &Set\ Compiler 設定編譯器Compiler(&S)
+" ------------------------------------------------------------------------
+menutrans &Convert\ to\ HEX<Tab>:%!xxd 轉æ›æˆ16進ä½ç¢¼(&C)<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r 從16進ä½ç¢¼è½‰æ›å›žæ–‡å­—(&R)<Tab>:%!xxd\ -r
+" }}}
+
+" {{{ Syntax menu: compete
+menutrans &Syntax 語法效果(&S)
+" ------------------------------------------------------------------------
+menutrans &Show\ filetypes\ in\ menu 顯示所有å¯ç”¨æª”案格å¼(&S)
+menutrans Set\ '&syntax'\ only åªä½¿ç”¨\ 'syntax'(&S)
+menutrans Set\ '&filetype'\ too 使用\ 'syntax'+'filetype'(&F)
+menutrans &Off 關閉效果(&O)
+menutrans &Manual 手動設定(&M)
+menutrans A&utomatic 自動設定(&U)
+menutrans on/off\ for\ &This\ file åªåˆ‡æ›æ­¤æª”的效果設定(&T)
+" ------------------------------------------------------------------------
+menutrans Co&lor\ test 色彩顯示測試(&L)
+menutrans &Highlight\ test 語法效果測試(&H)
+menutrans &Convert\ to\ HTML 轉æ›æˆ\ HTML\ æ ¼å¼(&C)
+" }}}
+
+" {{{ Buffers menu: complete
+menutrans &Buffers ç·©è¡å€(&B)
+" ------------------------------------------------------------------------
+menutrans &Refresh\ menu æ›´æ–°(&R)
+menutrans &Delete 刪除(&D)
+menutrans &Alternate 切æ›ä¸Šæ¬¡ç·¨è¼¯ç·©è¡å€(&A)
+menutrans &Next 下一個(&N)
+menutrans &Previous å‰ä¸€å€‹(&P)
+" ------------------------------------------------------------------------
+" menutrans [No\ file] [無檔案]
+" }}}
+
+" {{{ Window menu: complete
+menutrans &Window 視窗(&W)
+" ------------------------------------------------------------------------
+menutrans &New<Tab>^Wn 開新視窗(&N)<Tab>^Wn
+menutrans S&plit<Tab>^Ws 分割視窗(&P)<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ 分割到#(&L)<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv 垂直分割(&V)<Tab>^Wv
+menutrans Split\ File\ E&xplorer 檔案總管å¼åˆ†å‰²(&X)
+" ------------------------------------------------------------------------
+menutrans &Close<Tab>^Wc 關閉視窗(&C)<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo 關閉其它視窗(&O)<Tab>^Wo
+" ------------------------------------------------------------------------
+menutrans Move\ &To 移至(&T)
+ " {{{ Window.MoveTo
+ menutrans &Top<Tab>^WK 頂端(&T)<Tab>^WK
+ menutrans &Bottom<Tab>^WJ 底端(&B)<Tab>^WJ
+ menutrans &Left\ side<Tab>^WH 左邊(&L)<Tab>^WH
+ menutrans &Right\ side<Tab>^WL å³é‚Š(&R)<Tab>^WL
+ " }}}
+menutrans Rotate\ &Up<Tab>^WR 上移視窗(&U)<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr 下移視窗(&D)<Tab>^Wr
+" ------------------------------------------------------------------------
+menutrans &Equal\ Size<Tab>^W= 所有視窗等高(&E)<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ 最大高度(&M)<Tab>^W
+menutrans M&in\ Height<Tab>^W1_ 最å°é«˜åº¦(&I)<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| 最大寬度(&W)<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| 最å°å¯¬åº¦(&H)<Tab>^W1\|
+" }}}
+
+" {{{ The popup menu: complete
+menutrans &Undo 復原(&U)
+" ------------------------------------------------------------------------
+menutrans Cu&t 剪下(&T)
+menutrans &Copy 複製(&C)
+menutrans &Paste 貼上(&P)
+menutrans &Delete 刪除(&D)
+" ------------------------------------------------------------------------
+menutrans Select\ Blockwise Blockwiseå¼é¸æ“‡
+menutrans Select\ &Word é¸æ“‡å–®å­—(&W)
+menutrans Select\ &Line é¸æ“‡è¡Œ(&L)
+menutrans Select\ &Block é¸æ“‡å€å¡Š(&B)
+menutrans Select\ &All å…¨é¸(&A)
+" }}}
+
+" {{{ The GUI toolbar: complete
+if has("toolbar")
+ if exists("*Do_toolbar_tmenu")
+ delfun Do_toolbar_tmenu
+ endif
+ fun Do_toolbar_tmenu()
+ tmenu ToolBar.Open 開啟檔案
+ tmenu ToolBar.Save 儲存目å‰ç·¨è¼¯ä¸­çš„檔案
+ tmenu ToolBar.SaveAll 儲存全部檔案
+ tmenu ToolBar.Print 列å°
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Undo 復原上次變動
+ tmenu ToolBar.Redo å–消上次復原動作
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Cut 剪下至剪貼簿
+ tmenu ToolBar.Copy 複製到剪貼簿
+ tmenu ToolBar.Paste 由剪貼簿貼上
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Find 尋找...
+ tmenu ToolBar.FindNext 找下一個
+ tmenu ToolBar.FindPrev 找上一個
+ tmenu ToolBar.Replace å–代...
+" ------------------------------------------------------------------------
+ tmenu ToolBar.LoadSesn 載入 Session
+ tmenu ToolBar.SaveSesn 儲存目å‰çš„ Session
+ tmenu ToolBar.RunScript 執行 Vim 程å¼æª”
+" ------------------------------------------------------------------------
+ tmenu ToolBar.Make 執行 Make
+ tmenu ToolBar.Shell 開啟一個命令列視窗 DosBox
+ tmenu ToolBar.RunCtags 執行 ctags
+ tmenu ToolBar.TagJump 跳到目å‰æ¸¸æ¨™ä½ç½®çš„ tag
+ tmenu ToolBar.Help Vim 輔助說明
+ tmenu ToolBar.FindHelp æœå°‹ Vim 說明文件
+ endfun
+endif
+" }}}
+
+" vim:foldmethod=marker:nowrap:foldcolumn=2:foldlevel=1
diff --git a/runtime/macros.info b/runtime/macros.info
new file mode 100755
index 000000000..bbb0b4f16
--- /dev/null
+++ b/runtime/macros.info
Binary files differ
diff --git a/runtime/macros/README.txt b/runtime/macros/README.txt
new file mode 100644
index 000000000..61066c5a5
--- /dev/null
+++ b/runtime/macros/README.txt
@@ -0,0 +1,22 @@
+The macros in the maze, hanoi and urm directories can be used to test Vim for
+vi compatibility. They have been written for vi to show its unlimited
+possibilities. The life macros can be used for performance comparisons.
+
+hanoi Macros that solve the tower of hanoi problem.
+life Macros that run Conway's game of life.
+maze Macros that solve a maze (amazing!).
+urm Macros that simulate a simple computer: "Universal Register Machine"
+
+
+The other files contain some handy utilities. They also serve as examples for
+how to use Vi and Vim functionality.
+
+dvorak for when you use a Dvorak keyboard
+justify.vim user function for justifying text
+matchit.vim + matchit.txt make % match if-fi, HTML tags, and much more
+less.sh + less.vim make Vim work like less (or more)
+shellmenu.vim menus for editing shell scripts in the GUI version
+swapmous.vim swap left and right mouse buttons
+
+This one is only for Unix. It can be found in the extra archive:
+file_select.vim macros that make a handy file selector
diff --git a/runtime/macros/README.txt.info b/runtime/macros/README.txt.info
new file mode 100644
index 000000000..d173e72e7
--- /dev/null
+++ b/runtime/macros/README.txt.info
Binary files differ
diff --git a/runtime/macros/dvorak b/runtime/macros/dvorak
new file mode 100644
index 000000000..0c7588870
--- /dev/null
+++ b/runtime/macros/dvorak
@@ -0,0 +1,164 @@
+When using a dvorak keyboard this file may be of help to you.
+These mappings have been made by Lawrence Kesteloot <kesteloo@cs.unc.edu>.
+What they do is that the most often used keys, like hjkl, are put in a more
+easy to use position.
+It may take some time to learn using this.
+
+Put these lines in your .vimrc:
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+" Key to go into dvorak mode:
+map ,d :source ~/.dvorak
+" Key to get out of dvorak mode:
+map ,q :source ~/.qwerty
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+write these lines into the file ~/.dvorak:
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+" Dvorak keyboard, only in insert mode and ex mode.
+" You may want to add a list of map's too.
+imap! a a
+imap! b x
+imap! c j
+imap! d e
+imap! e .
+imap! f u
+imap! g i
+imap! h d
+imap! i c
+imap! j h
+imap! k t
+imap! l n
+imap! m m
+imap! n b
+imap! o r
+imap! p l
+imap! q '
+imap! r p
+imap! s o
+imap! t y
+imap! u g
+imap! v k
+imap! w ,
+imap! x q
+imap! y f
+imap! z ;
+imap! ; s
+imap! ' -
+imap! " _
+imap! , w
+imap! . v
+imap! / z
+imap! A A
+imap! B X
+imap! C J
+imap! D E
+imap! E >
+imap! F U
+imap! G I
+imap! H D
+imap! I C
+imap! J H
+imap! K T
+imap! L N
+imap! M M
+imap! N B
+imap! O R
+imap! P L
+imap! Q "
+imap! R P
+imap! S O
+imap! T Y
+imap! U G
+imap! V K
+imap! W <
+imap! X Q
+imap! Y F
+imap! Z :
+imap! < W
+imap! > V
+imap! ? Z
+imap! : S
+imap! [ /
+imap! ] =
+imap! { ?
+imap! } +
+imap! - [
+imap! _ {
+imap! = ]
+imap! + }
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+write these lines into the file ~/.qwerty
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+" Qwerty keyboard
+unmap! a
+unmap! b
+unmap! c
+unmap! d
+unmap! e
+unmap! f
+unmap! g
+unmap! h
+unmap! i
+unmap! j
+unmap! k
+unmap! l
+unmap! m
+unmap! n
+unmap! o
+unmap! p
+unmap! q
+unmap! r
+unmap! s
+unmap! t
+unmap! u
+unmap! v
+unmap! w
+unmap! x
+unmap! y
+unmap! z
+unmap! ;
+unmap! '
+unmap! \"
+unmap! ,
+unmap! .
+unmap! /
+unmap! A
+unmap! B
+unmap! C
+unmap! D
+unmap! E
+unmap! F
+unmap! G
+unmap! H
+unmap! I
+unmap! J
+unmap! K
+unmap! L
+unmap! M
+unmap! N
+unmap! O
+unmap! P
+unmap! Q
+unmap! R
+unmap! S
+unmap! T
+unmap! U
+unmap! V
+unmap! W
+unmap! X
+unmap! Y
+unmap! Z
+unmap! <
+unmap! >
+unmap! ?
+unmap! :
+unmap! [
+unmap! ]
+unmap! {
+unmap! }
+unmap! -
+unmap! _
+unmap! =
+unmap! +
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/runtime/macros/hanoi.info b/runtime/macros/hanoi.info
new file mode 100644
index 000000000..8072e5678
--- /dev/null
+++ b/runtime/macros/hanoi.info
Binary files differ
diff --git a/runtime/macros/hanoi/click.me b/runtime/macros/hanoi/click.me
new file mode 100644
index 000000000..24f178bfe
--- /dev/null
+++ b/runtime/macros/hanoi/click.me
@@ -0,0 +1,14 @@
+
+
+See Vim solve the towers of Hanoi!
+
+Instructions:
+ type ":so hanoi.vim<RETURN>" to load the macros
+ type "g" to start it
+
+and watch it go.
+
+ to quit type ":q!<RETURN>"
+to interrupt type CTRL-C
+
+(This text will disappear as soon as you type "g")
diff --git a/runtime/macros/hanoi/click.me.info b/runtime/macros/hanoi/click.me.info
new file mode 100644
index 000000000..f38cb5a0a
--- /dev/null
+++ b/runtime/macros/hanoi/click.me.info
Binary files differ
diff --git a/runtime/macros/hanoi/hanoi.vim b/runtime/macros/hanoi/hanoi.vim
new file mode 100644
index 000000000..834d6f2c4
--- /dev/null
+++ b/runtime/macros/hanoi/hanoi.vim
@@ -0,0 +1,64 @@
+set remap
+set noterse
+set wrapscan
+" to set the height of the tower, change the digit in the following
+" two lines to the height you want (select from 1 to 9)
+map t 7
+map! t 7
+map L 1G/t X/^0 $P1GJ$An$BGC0e$X0E0F$X/T @f @h $A1GJ@f0l$Xn$PU
+map g IL
+
+map J /^0[^t]*$
+map X x
+map P p
+map U L
+map A "fyl
+map B "hyl
+map C "fp
+map e "fy2l
+map E "hp
+map F "hy2l
+
+" initialisations:
+" KM cleanup buffer
+" Y create tower of desired height
+" NOQ copy it and inster a T
+" NO copy this one
+" S change last char into a $
+" R change last char in previous line into a n
+" T insert two lines containing a zero
+" V add a last line containing a backslash
+map I KMYNOQNOSkRTV
+
+"create empty line
+map K 1Go
+
+"delete to end of file
+map M dG
+
+"yank one line
+map N yy
+
+"put
+map O p
+
+"delete more than height-of-tower characters
+map q tllD
+
+"create a tower of desired height
+map Y o0123456789Z0q
+
+"insert a T in column 1
+map Q 0iT
+
+"substitute last character with a n
+map R $rn
+
+"substitute last character with a $
+map S $r$
+
+"insert two lines containing a zero
+map T ko0 0 
+
+"add a backslash at the end
+map V Go/
diff --git a/runtime/macros/hanoi/poster b/runtime/macros/hanoi/poster
new file mode 100644
index 000000000..dd03b2613
--- /dev/null
+++ b/runtime/macros/hanoi/poster
@@ -0,0 +1,36 @@
+Article 2913 of alt.sources:
+Path: oce-rd1!hp4nl!mcsun!uunet!munnari.oz.au!metro!cluster!swift!softway!otc!gregm
+From: gregm@otc.otca.oz.au (Greg McFarlane)
+Newsgroups: comp.sources.d,alt.sources,comp.editors
+Subject: VI SOLVES HANOI
+Message-ID: <2323@otc.otca.oz>
+Date: 19 Feb 91 01:32:14 GMT
+Sender: news@otc.otca.oz
+Reply-To: gregm@otc.otca.oz.au (Greg McFarlane)
+Organization: OTC Development Unit, Australia
+Lines: 80
+Xref: oce-rd1 comp.sources.d:5702 alt.sources:2913 comp.editors:2313
+
+Submitted-by: gregm@otc.otca.oz.au
+Archive-name: hanoi.vi.macros/part01
+
+Everyone seems to be writing stupid Tower of Hanoi programs.
+Well, here is the stupidest of them all: the hanoi solving vi macros.
+
+Save this article, unshar it, and run uudecode on hanoi.vi.macros.uu.
+This will give you the macro file hanoi.vi.macros.
+Then run vi (with no file: just type "vi") and type:
+ :so hanoi.vi.macros
+ g
+and watch it go.
+
+The default height of the tower is 7 but can be easily changed by editing
+the macro file.
+
+The disks aren't actually shown in this version, only numbers representing
+each disk, but I believe it is possible to write some macros to show the
+disks moving about as well. Any takers?
+
+(For maze solving macros, see alt.sources or comp.editors)
+
+Greg
diff --git a/runtime/macros/hanoi/poster.info b/runtime/macros/hanoi/poster.info
new file mode 100644
index 000000000..780fa35ed
--- /dev/null
+++ b/runtime/macros/hanoi/poster.info
Binary files differ
diff --git a/runtime/macros/justify.vim b/runtime/macros/justify.vim
new file mode 100644
index 000000000..41d0591fe
--- /dev/null
+++ b/runtime/macros/justify.vim
@@ -0,0 +1,316 @@
+" Function to left and rigt align text.
+"
+" Written by: Preben "Peppe" Guldberg <c928400@student.dtu.dk>
+" Created: 980806 14:13 (or around that time anyway)
+" Revised: 001103 00:36 (See "Revisions" below)
+
+
+" function Justify( [ textwidth [, maxspaces [, indent] ] ] )
+"
+" Justify() will left and right align a line by filling in an
+" appropriate amount of spaces. Extra spaces are added to existing
+" spaces starting from the right side of the line. As an example, the
+" following documentation has been justified.
+"
+" The function takes the following arguments:
+
+" textwidth argument
+" ------------------
+" If not specified, the value of the 'textwidth' option is used. If
+" 'textwidth' is zero a value of 80 is used.
+"
+" Additionally the arguments 'tw' and '' are accepted. The value of
+" 'textwidth' will be used. These are handy, if you just want to specify
+" the maxspaces argument.
+
+" maxspaces argument
+" ------------------
+" If specified, alignment will only be done, if the longest space run
+" after alignment is no longer than maxspaces.
+"
+" An argument of '' is accepted, should the user like to specify all
+" arguments.
+"
+" To aid user defined commands, negative values are accepted aswell.
+" Using a negative value specifies the default behaviour: any length of
+" space runs will be used to justify the text.
+
+" indent argument
+" ---------------
+" This argument specifies how a line should be indented. The default is
+" to keep the current indentation.
+"
+" Negative values: Keep current amount of leading whitespace.
+" Positive values: Indent all lines with leading whitespace using this
+" amount of whitespace.
+"
+" Note that the value 0, needs to be quoted as a string. This value
+" leads to a left flushed text.
+"
+" Additionally units of 'shiftwidth'/'sw' and 'tabstop'/'ts' may be
+" added. In this case, if the value of indent is positive, the amount of
+" whitespace to be added will be multiplied by the value of the
+" 'shiftwidth' and 'tabstop' settings. If these units are used, the
+" argument must be given as a string, eg. Justify('','','2sw').
+"
+" If the values of 'sw' or 'tw' are negative, they are treated as if
+" they were 0, which means that the text is flushed left. There is no
+" check if a negative number prefix is used to change the sign of a
+" negative 'sw' or 'ts' value.
+"
+" As with the other arguments, '' may be used to get the default
+" behaviour.
+
+
+" Notes:
+"
+" If the line, adjusted for space runs and leading/trailing whitespace,
+" is wider than the used textwidth, the line will be left untouched (no
+" whitespace removed). This should be equivalent to the behaviour of
+" :left, :right and :center.
+"
+" If the resulting line is shorter than the used textwidth it is left
+" untouched.
+"
+" All space runs in the line are truncated before the alignment is
+" carried out.
+"
+" If you have set 'noexpandtab', :retab! is used to replace space runs
+" with whitespace using the value of 'tabstop'. This should be
+" conformant with :left, :right and :center.
+"
+" If joinspaces is set, an extra space is added after '.', '?' and '!'.
+" If 'cpooptions' include 'j', extra space is only added after '.'.
+" (This may on occasion conflict with maxspaces.)
+
+
+" Related mappings:
+"
+" Mappings that will align text using the current text width, using at
+" most four spaces in a space run and keeping current indentation.
+nmap _j :%call Justify('tw',4)<CR>
+vmap _j :call Justify('tw',4)<CR>
+"
+" Mappings that will remove space runs and format lines (might be useful
+" prior to aligning the text).
+nmap ,gq :%s/\s\+/ /g<CR>gq1G
+vmap ,gq :s/\s\+/ /g<CR>gvgq
+
+
+" User defined command:
+"
+" The following is an ex command that works as a shortcut to the Justify
+" function. Arguments to Justify() can be added after the command.
+com! -range -nargs=* Justify <line1>,<line2>call Justify(<f-args>)
+"
+" The following commands are all equivalent:
+"
+" 1. Simplest use of Justify():
+" :call Justify()
+" :Justify
+"
+" 2. The _j mapping above via the ex command:
+" :%Justify tw 4
+"
+" 3. Justify visualised text at 72nd column while indenting all
+" previously indented text two shiftwidths
+" :'<,'>call Justify(72,'','2sw')
+" :'<,'>Justify 72 -1 2sw
+"
+" This documentation has been justified using the following command:
+":se et|kz|1;/^" function Justify(/+,'z-g/^" /s/^" //|call Justify(70,3)|s/^/" /
+
+" Revisions:
+" 001103: If 'joinspaces' was set, calculations could be wrong.
+" Tabs at start of line could also lead to errors.
+" Use setline() instead of "exec 's/foo/bar/' - safer.
+" Cleaned up the code a bit.
+"
+" Todo: Convert maps to the new script specific form
+
+" Error function
+function! Justify_error(message)
+ echohl Error
+ echo "Justify([tw, [maxspaces [, indent]]]): " . a:message
+ echohl None
+endfunction
+
+
+" Now for the real thing
+function! Justify(...) range
+
+ if a:0 > 3
+ call Justify_error("Too many arguments (max 3)")
+ return 1
+ endif
+
+ " Set textwidth (accept 'tw' and '' as arguments)
+ if a:0 >= 1
+ if a:1 =~ '^\(tw\)\=$'
+ let tw = &tw
+ elseif a:1 =~ '^\d\+$'
+ let tw = a:1
+ else
+ call Justify_error("tw must be a number (>0), '' or 'tw'")
+ return 2
+ endif
+ else
+ let tw = &tw
+ endif
+ if tw == 0
+ let tw = 80
+ endif
+
+ " Set maximum number of spaces between WORDs
+ if a:0 >= 2
+ if a:2 == ''
+ let maxspaces = tw
+ elseif a:2 =~ '^-\d\+$'
+ let maxspaces = tw
+ elseif a:2 =~ '^\d\+$'
+ let maxspaces = a:2
+ else
+ call Justify_error("maxspaces must be a number or ''")
+ return 3
+ endif
+ else
+ let maxspaces = tw
+ endif
+ if maxspaces <= 1
+ call Justify_error("maxspaces should be larger than 1")
+ return 4
+ endif
+
+ " Set the indentation style (accept sw and ts units)
+ let indent_fix = ''
+ if a:0 >= 3
+ if (a:3 == '') || a:3 =~ '^-[1-9]\d*\(shiftwidth\|sw\|tabstop\|ts\)\=$'
+ let indent = -1
+ elseif a:3 =~ '^-\=0\(shiftwidth\|sw\|tabstop\|ts\)\=$'
+ let indent = 0
+ elseif a:3 =~ '^\d\+\(shiftwidth\|sw\|tabstop\|ts\)\=$'
+ let indent = substitute(a:3, '\D', '', 'g')
+ elseif a:3 =~ '^\(shiftwidth\|sw\|tabstop\|ts\)$'
+ let indent = 1
+ else
+ call Justify_error("indent: a number with 'sw'/'ts' unit")
+ return 5
+ endif
+ if indent >= 0
+ while indent > 0
+ let indent_fix = indent_fix . ' '
+ let indent = indent - 1
+ endwhile
+ let indent_sw = 0
+ if a:3 =~ '\(shiftwidth\|sw\)'
+ let indent_sw = &sw
+ elseif a:3 =~ '\(tabstop\|ts\)'
+ let indent_sw = &ts
+ endif
+ let indent_fix2 = ''
+ while indent_sw > 0
+ let indent_fix2 = indent_fix2 . indent_fix
+ let indent_sw = indent_sw - 1
+ endwhile
+ let indent_fix = indent_fix2
+ endif
+ else
+ let indent = -1
+ endif
+
+ " Avoid substitution reports
+ let save_report = &report
+ set report=1000000
+
+ " Check 'joinspaces' and 'cpo'
+ if &js == 1
+ if &cpo =~ 'j'
+ let join_str = '\(\. \)'
+ else
+ let join_str = '\([.!?!] \)'
+ endif
+ endif
+
+ let cur = a:firstline
+ while cur <= a:lastline
+
+ let str_orig = getline(cur)
+ let save_et = &et
+ set et
+ exec cur . "retab"
+ let &et = save_et
+ let str = getline(cur)
+
+ let indent_str = indent_fix
+ let indent_n = strlen(indent_str)
+ " Shall we remember the current indentation
+ if indent < 0
+ let indent_orig = matchstr(str_orig, '^\s*')
+ if strlen(indent_orig) > 0
+ let indent_str = indent_orig
+ let indent_n = strlen(matchstr(str, '^\s*'))
+ endif
+ endif
+
+ " Trim trailing, leading and running whitespace
+ let str = substitute(str, '\s\+$', '', '')
+ let str = substitute(str, '^\s\+', '', '')
+ let str = substitute(str, '\s\+', ' ', 'g')
+ let str_n = strlen(str)
+
+ " Possible addition of space after punctuation
+ if exists("join_str")
+ let str = substitute(str, join_str, '\1 ', 'g')
+ endif
+ let join_n = strlen(str) - str_n
+
+ " Can extraspaces be added?
+ " Note that str_n may be less than strlen(str) [joinspaces above]
+ if strlen(str) < tw - indent_n && str_n > 0
+ " How many spaces should be added
+ let s_add = tw - str_n - indent_n - join_n
+ let s_nr = strlen(substitute(str, '\S', '', 'g') ) - join_n
+ let s_dup = s_add / s_nr
+ let s_mod = s_add % s_nr
+
+ " Test if the changed line fits with tw
+ if 0 <= (str_n + (maxspaces - 1)*s_nr + indent_n) - tw
+
+ " Duplicate spaces
+ while s_dup > 0
+ let str = substitute(str, '\( \+\)', ' \1', 'g')
+ let s_dup = s_dup - 1
+ endwhile
+
+ " Add extra spaces from the end
+ while s_mod > 0
+ let str = substitute(str, '\(\(\s\+\S\+\)\{' . s_mod . '}\)$', ' \1', '')
+ let s_mod = s_mod - 1
+ endwhile
+
+ " Indent the line
+ if indent_n > 0
+ let str = substitute(str, '^', indent_str, '' )
+ endif
+
+ " Replace the line
+ call setline(cur, str)
+
+ " Convert to whitespace
+ if &et == 0
+ exec cur . 'retab!'
+ endif
+
+ endif " Change of line
+ endif " Possible change
+
+ let cur = cur + 1
+ endwhile
+
+ norm ^
+
+ let &report = save_report
+
+endfunction
+
+" EOF vim: tw=78 ts=8 sw=4 sts=4 noet ai
diff --git a/runtime/macros/less.sh b/runtime/macros/less.sh
new file mode 100755
index 000000000..256936b5e
--- /dev/null
+++ b/runtime/macros/less.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Shell script to start Vim with less.vim.
+# Read stdin if no arguments were given.
+
+if test $# = 0; then
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
+else
+ vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
+fi
diff --git a/runtime/macros/less.vim b/runtime/macros/less.vim
new file mode 100644
index 000000000..48ee7ab11
--- /dev/null
+++ b/runtime/macros/less.vim
@@ -0,0 +1,244 @@
+" Vim script to work like "less"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Feb 19
+
+" Avoid loading this file twice, allow the user to define his own script.
+if exists("loaded_less")
+ finish
+endif
+let loaded_less = 1
+
+" If not reading from stdin, skip files that can't be read.
+" Exit if there is no file at all.
+if argc() > 0
+ let s:i = 0
+ while 1
+ if filereadable(argv(s:i))
+ if s:i != 0
+ sleep 3
+ endif
+ break
+ endif
+ if isdirectory(argv(s:i))
+ echomsg "Skipping directory " . argv(s:i)
+ elseif getftime(argv(s:i)) < 0
+ echomsg "Skipping non-existing file " . argv(s:i)
+ else
+ echomsg "Skipping unreadable file " . argv(s:i)
+ endif
+ echo "\n"
+ let s:i = s:i + 1
+ if s:i == argc()
+ quit
+ endif
+ next
+ endwhile
+endif
+
+set nocp
+syntax on
+set so=0
+set hlsearch
+set incsearch
+nohlsearch
+" Don't remember file names and positions
+set viminfo=
+set nows
+" Inhibit screen updates while searching
+let s:lz = &lz
+set lz
+
+" Used after each command: put cursor at end and display position
+if &wrap
+ noremap <SID>L L0:redraw<CR>:file<CR>
+ au VimEnter * normal! L0
+else
+ noremap <SID>L Lg0:redraw<CR>:file<CR>
+ au VimEnter * normal! Lg0
+endif
+
+" When reading from stdin don't consider the file modified.
+au VimEnter * set nomod
+
+" Can't modify the text
+set noma
+
+" Give help
+noremap h :call <SID>Help()<CR>
+map H h
+fun! s:Help()
+ echo "<Space> One page forward b One page backward"
+ echo "d Half a page forward u Half a page backward"
+ echo "<Enter> One line forward k One line backward"
+ echo "G End of file g Start of file"
+ echo "N% percentage in file"
+ echo "\n"
+ echo "/pattern Search for pattern ?pattern Search backward for pattern"
+ echo "n next pattern match N Previous pattern match"
+ echo "\n"
+ echo ":n<Enter> Next file :p<Enter> Previous file"
+ echo "\n"
+ echo "q Quit v Edit file"
+ let i = input("Hit Enter to continue")
+endfun
+
+" Scroll one page forward
+noremap <script> <Space> :call <SID>NextPage()<CR><SID>L
+map <C-V> <Space>
+map f <Space>
+map <C-F> <Space>
+map z <Space>
+map <Esc><Space> <Space>
+fun! s:NextPage()
+ if line(".") == line("$")
+ if argidx() + 1 >= argc()
+ quit
+ endif
+ next
+ 1
+ else
+ exe "normal! \<C-F>"
+ endif
+endfun
+
+" Re-read file and page forward "tail -f"
+map F :e<CR>G<SID>L:sleep 1<CR>F
+
+" Scroll half a page forward
+noremap <script> d <C-D><SID>L
+map <C-D> d
+
+" Scroll one line forward
+noremap <script> <CR> <C-E><SID>L
+map <C-N> <CR>
+map e <CR>
+map <C-E> <CR>
+map j <CR>
+map <C-J> <CR>
+
+" Scroll one page backward
+noremap <script> b <C-B><SID>L
+map <C-B> b
+map w b
+map <Esc>v b
+
+" Scroll half a page backward
+noremap <script> u <C-U><SID>L
+noremap <script> <C-U> <C-U><SID>L
+
+" Scroll one line backward
+noremap <script> k <C-Y><SID>L
+map y k
+map <C-Y> k
+map <C-P> k
+map <C-K> k
+
+" Redraw
+noremap <script> r <C-L><SID>L
+noremap <script> <C-R> <C-L><SID>L
+noremap <script> R <C-L><SID>L
+
+" Start of file
+noremap <script> g gg<SID>L
+map < g
+map <Esc>< g
+
+" End of file
+noremap <script> G G<SID>L
+map > G
+map <Esc>> G
+
+" Go to percentage
+noremap <script> % %<SID>L
+map p %
+
+" Search
+noremap <script> / H$:call <SID>Forward()<CR>/
+if &wrap
+ noremap <script> ? H0:call <SID>Backward()<CR>?
+else
+ noremap <script> ? Hg0:call <SID>Backward()<CR>?
+endif
+
+fun! s:Forward()
+ " Searching forward
+ noremap <script> n H$nzt<SID>L
+ if &wrap
+ noremap <script> N H0Nzt<SID>L
+ else
+ noremap <script> N Hg0Nzt<SID>L
+ endif
+ cnoremap <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
+endfun
+
+fun! s:Backward()
+ " Searching backward
+ if &wrap
+ noremap <script> n H0nzt<SID>L
+ else
+ noremap <script> n Hg0nzt<SID>L
+ endif
+ noremap <script> N H$Nzt<SID>L
+ cnoremap <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
+endfun
+
+call s:Forward()
+
+" Quitting
+noremap q :q<CR>
+
+" Switch to editing (switch off less mode)
+map v :silent call <SID>End()<CR>
+fun! s:End()
+ set ma
+ if exists(s:lz)
+ let &lz = s:lz
+ endif
+ unmap h
+ unmap H
+ unmap <Space>
+ unmap <C-V>
+ unmap f
+ unmap <C-F>
+ unmap z
+ unmap <Esc><Space>
+ unmap F
+ unmap d
+ unmap <C-D>
+ unmap <CR>
+ unmap <C-N>
+ unmap e
+ unmap <C-E>
+ unmap j
+ unmap <C-J>
+ unmap b
+ unmap <C-B>
+ unmap w
+ unmap <Esc>v
+ unmap u
+ unmap <C-U>
+ unmap k
+ unmap y
+ unmap <C-Y>
+ unmap <C-P>
+ unmap <C-K>
+ unmap r
+ unmap <C-R>
+ unmap R
+ unmap g
+ unmap <
+ unmap <Esc><
+ unmap G
+ unmap >
+ unmap <Esc>>
+ unmap %
+ unmap p
+ unmap n
+ unmap N
+ unmap q
+ unmap v
+ unmap /
+ unmap ?
+endfun
+
+" vim: sw=2
diff --git a/runtime/macros/life/click.me b/runtime/macros/life/click.me
new file mode 100644
index 000000000..c2ed4691a
--- /dev/null
+++ b/runtime/macros/life/click.me
@@ -0,0 +1,9 @@
+
+To run the "Conway's game of life" macros:
+
+ 1. Type ":so life.vim". This loads the macros.
+ 2. Type "g" to run the macros.
+ 3. Type CTRL-C to interrupt.
+ 4. Type ":q!" to get out.
+
+See life.vim for more advanced usage.
diff --git a/runtime/macros/life/click.me.info b/runtime/macros/life/click.me.info
new file mode 100644
index 000000000..f5756501f
--- /dev/null
+++ b/runtime/macros/life/click.me.info
Binary files differ
diff --git a/runtime/macros/life/life.vim b/runtime/macros/life/life.vim
new file mode 100644
index 000000000..adf4e2081
--- /dev/null
+++ b/runtime/macros/life/life.vim
@@ -0,0 +1,260 @@
+" Macros to play Conway's Game of Life in vi
+" Version 1.0m: edges wrap
+" by Eli-the-Bearded (eli@netusa.net), Sept 1996
+" This file may be free distributed so long as these credits remain unchanged.
+"
+" Modified by Bram Moolenaar (Bram@vim.org), 1996 Sept 10
+" - Made it quite a bit faster, but now needs search patterns in the text
+" - Changed the order of mappings to top-down.
+" - Made "g" run the whole thing, "C" run one generation.
+" - Added support for any uppercase character instead of 'X'
+"
+" Rules:
+" If a germ has 0 or 1 live neighbors it dies of loneliness
+" If a germ has 2 or 3 live neighbors it survives
+" If a germ has 4 to 8 live neighbors it dies of starvation
+" If an empty box has 3 live neighbors a new germ is born
+"
+" A new born germ is an "A". Every generation it gets older: B, C, etc.
+" A germ dies of old age when it reaches "Z".
+"
+" Notice the rules do not mention edges. This version has the edges wrap
+" around. I have an earlier version that offers the option of live edges or
+" dead edges. Email me if you are interested. -Eli-
+"
+" Note: This is slow! One generation may take up to ten minutes (depends on
+" your computer and the vi version).
+"
+" Quite a lot of the messy stuff is to work around the vi error "Can't yank
+" inside global/macro". Still doesn't work for all versions of vi.
+"
+" To use these macros:
+"
+" vi start vi/vim
+"
+" :so life.mac Source this file
+"
+" g 'g'o! runs everything until interrupted: "IR".
+"
+" I Initialize everything. A board will be drawn at the end
+" of the current buffer. All line references in these macros
+" are relative to the end of the file and playing the game
+" can be done safely with any file as the current buffer.
+"
+" Change the left field with spaces and uppercase letters to suit
+" your taste.
+"
+" C 'C'ompute one generation.
+" + idem, time running one generation.
+" R 'R'un 'C'ompute until interrupted.
+" i<nr><Esc>z Make a number the only thing on the current line and use
+" 'z' to time that many generations.
+"
+" Time to run 30 generations on my 233 AMD K6 (FreeBSD 3.0):
+" vim 5.4 xterm 51 sec
+" gvim 5.4 Athena 42 sec
+" gvim 5.4 Motif 42 sec
+" gvim 5.4 GTK 50 sec
+" nvi 1.79 xterm 58 sec
+" vi 3.7 xterm 2 min 30 sec
+" Elvis 2.1 xterm 7 min 50 sec
+" Elvis 2.1 X11 6 min 31 sec
+"
+" Time to run 30 generations on my 850 AMD Duron (FreeBSD 4.2):
+" vim 5.8 xterm 21 sec
+" vim 6.0 xterm 24 sec
+" vim 6.0 Motif 32 sec
+" nvi 1.79 xterm 29 sec
+" vi 3.7 xterm 32 sec
+" elvis 2.1.4 xterm 34 sec
+"
+" And now the macros, more or less in top-down order.
+"
+" ----- macros that can be used by the human -----
+"
+" 'g'o: 'I'nitialize and then 'R'un 'C'ompute recursively (used by the human)
+map g IR
+"
+"
+" 'R'un 'C'ompute recursively (used by the human and 'g'o)
+map R CV
+" work around "tail recursion" problem in vi, "V" == "R".
+map V R
+"
+"
+" 'I'nitialize the board (used by the human and 'g'o)
+map I G)0)0)0)0)1)0)0)2)0)0)0)0,ok,-11k,-,R,IIN
+"
+"
+" 'C'ompute next generation (used by the human and others)
+map C T>>>>>>>>B&
+"
+"
+" Time running one generation (used by the human)
+map + <1C<2
+"
+"
+" Time running N generations, where N is the number on the current line.
+" (used by the human)
+map z ,^,&,*,&<1,*<2
+"
+" ----- END of macros that can be used by the human -----
+"
+" ----- Initialisation -----
+"
+map ,- :s/./-/g
+map ,o oPut 'X's in the left box, then hit 'C' or 'R'
+map ,R 03stop
+"
+" Write a new line (used by 'I'nitialize board)
+map )0 o- --....................--....................-
+map )1 o- VIM --....................--....................-
+map )2 o- LIVES --....................--....................-
+"
+"
+" Initialisation of the pattern/command to execute for working out a square.
+" Pattern is: "#<germ><count>"
+" where <germ> is " " if the current germ is dead, "X" when living.
+" <count> is the number of living neighbours (including current germ)
+" expressed in X's
+"
+map ,Il8 O#XXXXXXXXXX .`a22lr 
+map ,Id8 o# XXXXXXXX .`a22lr 
+map ,Il7 o#XXXXXXXXX .`a22lr 
+map ,Id7 o# XXXXXXX .`a22lr 
+map ,Il6 o#XXXXXXXX .`a22lr 
+map ,Id6 o# XXXXXX .`a22lr 
+map ,Il5 o#XXXXXXX .`a22lr 
+map ,Id5 o# XXXXX .`a22lr 
+map ,Il4 o#XXXXXX .`a22lr 
+map ,Id4 o# XXXX .`a22lr 
+map ,Il3 o#XXXXX .,a
+map ,Id3 o# XXX .`a22lrA
+map ,Il2 o#XXXX .,a
+map ,Id2 o# XX .`a22lr 
+map ,Il1 o#XXX .`a22lr 
+map ,Id1 o# X .`a22lr 
+map ,Il0 o#XX .`a22lr 
+map ,Id0 o# .`a22lr 
+"
+" Patterns used to replace a germ with it's next generation
+map ,Iaa o=AB =BC =CD =DE =EF =FG =GH =HI =IJ =JK =KL =LM =MN =NO =OP =PQ =QR
+map ,Iab o=RS =ST =TU =UV =VW =WX =XY =YZ =Z 
+"
+" Insert the searched patterns above the board
+map ,IIN G?^top ,Il8,Id8,Il7,Id7,Il6,Id6,Il5,Id5,Il4,Id4,Il3,Id3,Il2,Id2,Il1,Id1,Il0,Id0,Iaa,Iab
+"
+" ----- END of Initialisation -----
+"
+" ----- Work out one line -----
+"
+" Work out 'T'op line (used by show next)
+map T G,c2k,!9k,@,#j>2k,$j
+"
+" Work out 'B'ottom line (used by show next)
+map B ,%k>,$
+"
+" Work out a line (used by show next, work out top and bottom lines)
+map > 0 LWWWWWWWWWWWWWWWWWW,rj
+"
+" Refresh board (used by show next)
+map & :%s/^\(-[ A-Z]*-\)\(-[ A-Z]*-\)\(-[.]*-\)$/\2\3\3/
+"
+"
+" Work around vi multiple yank/put in a single macro limitation
+" (used by work out top and/or bottom line)
+map ,$ dd
+map ,% "cp
+map ,! "byy
+map ,@ "cyy
+map ,# "bP
+map ,c c$
+"
+" ----- END of Work out one line -----
+"
+" ----- Work out one square -----
+"
+" The next three work out a square: put all nine chars around the current
+" character on the bottom line (the bottom line must be empty when starting).
+"
+" 'W'ork out a center square (used by work out line)
+map W makh,3`ah,3`ajh,3(
+"
+"
+" Work out a 'L'eft square (used by work out line)
+map L makf-h,1`ak,2`af-h,1`a,2`ajf-h,1`aj,2(
+"
+"
+" Work out a 'R'ight square (used by work out line)
+map ,r makh,2`akF-l,1`ah,2`aF-l,1`ajh,2`ajF-l,1(
+"
+" 'M'ove a character to the end of the file (used by all work out square
+" macros)
+"
+map ,1 y G$p
+map ,2 2y G$p
+map ,3 3y G$p
+"
+"
+" ----- END of Work out one square -----
+"
+" ----- Work out one germ -----
+"
+" Generate an edit command that depends on the number of living in the last
+" line, and then run the edit command. (used by work out square).
+" Leaves the cursor on the next character to be processed.
+"
+map ( ,s,i,X0i?^#A  0,df.l,Y21h
+"
+" Delete 's'paces (deads);
+" The number of remaining characters is the number of living neighbours.
+map ,s :.g/ /s///g
+"
+" Insert current character in the last line
+map ,i `ay GP
+"
+" Replace any uppercase letter with 'X';
+map ,X :.g/[A-Z]/s//X/g
+"
+" Delete and execute the rest of the line
+map ,d "qd$@q
+"
+" Yank and execute the rest of the line
+map ,Y "qy$@q
+"
+" Yank the character under the cursor
+map ,j y
+"
+" Put the current cut buffer after the cursor
+map ,m p
+"
+" Delete the character under the cursor
+map ,n x
+"
+" Replace a character by it's next, A --> B, B --> C, etc.
+map ,a `a,jGi?=,ma 0,dll,j`a21l,ml,nh
+"
+" ----- END of Work out one germ -----
+"
+" ----- timing macros -----
+"
+" Get current date (used by time a generation)
+map << :r!date
+map <1 G?^top O<<
+map <2 G?^top k<<
+"
+"
+" Turn number on current line into edit command (used by time N generations)
+map ,^ AiC
+"
+"
+" Delete current line and save current line (used by time N generations)
+map ,& 0"gd$
+"
+"
+" Run saved line (used by time N generations)
+map ,* @g
+"
+" ----- END of timing macros -----
+"
+" End of the macros.
diff --git a/runtime/macros/matchit.txt b/runtime/macros/matchit.txt
new file mode 100644
index 000000000..8ea4de5f2
--- /dev/null
+++ b/runtime/macros/matchit.txt
@@ -0,0 +1,402 @@
+*matchit.txt* Extended "%" matching
+
+For instructions on installing this file, type
+ :help matchit-install
+inside Vim.
+
+For Vim version 6.3. Last change: 2004 May 12
+
+
+ VIM REFERENCE MANUAL by Benji Fisher
+
+*matchit* *matchit.vim*
+
+1. Extended matching with "%" |matchit-intro|
+2. Activation |matchit-activate|
+3. Configuration |matchit-configure|
+4. Supporting a New Language |matchit-newlang|
+5. Known Bugs and Limitations |matchit-bugs|
+
+The functionality mentioned here is a plugin, see |add-plugin|.
+This plugin is only available if 'compatible' is not set.
+You can avoid loading this plugin by setting the "loaded_matchit" variable
+in your |vimrc| file: >
+ :let loaded_matchit = 1
+
+{Vi does not have any of this}
+
+==============================================================================
+1. Extended matching with "%" *matchit-intro*
+
+ *matchit-%*
+% Cycle forward through matching groups, such as "if", "else", "endif",
+ as specified by |b:match_words|.
+
+ *g%* *v_g%* *o_g%*
+g% Cycle backwards through matching groups, as specified by
+ |b:match_words|. For example, go from "endif" to "else" to "if".
+
+ *[%* *v_[%* *o_[%*
+[% Go to [count] previous unmatched group, as specified by
+ |b:match_words|. Similar to |[{|.
+
+ *]%* *v_]%* *o_]%*
+]% Go to [count] next unmatched group, as specified by
+ |b:match_words|. Similar to |]}|.
+
+ *v_a%*
+a% In Visual mode, select the matching group, as specified by
+ |b:match_words|, containing the cursor. Similar to |v_a[|.
+ A [count] is ignored, and only the first character of the closing
+ pattern is selected.
+
+In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace,
+bracket, or paren to its match. This can be configured with the 'matchpairs'
+option. The matchit plugin extends this in several ways:
+
+ You can match whole words, such as "if" and "endif", not just
+ single characters. You can also specify a |regular-expression|.
+ You can define groups with more than two words, such as "if",
+ "else", "endif". Banging on the "%" key will cycle from the "if" to
+ the first "else", the next "else", ..., the closing "endif", and back
+ to the opening "if". Nested structures are skipped. Using |g%| goes
+ in the reverse direction.
+ By default, words inside comments and strings are ignored, unless
+ the cursor is inside a comment or string when you type "%". If the
+ only thing you want to do is modify the behavior of "%" so that it
+ behaves this way, you can >
+ :let b:match_words = &matchpairs
+<
+See |matchit-details| for details on what the script does, and |b:match_words|
+for how to specify matching patterns.
+
+MODES: *matchit-modes* *matchit-v_%* *matchit-o_%*
+
+Mostly, % and related motions (|g%| and |[%| and |]%|) work just like built-in
+|motion| commands in |Operator-pending| and |Visual| modes. However, you
+cannot make these motions |linewise| or |characterwise|, since the |:omap|s
+that define them start with "v" in order to make the default behavior
+inclusive. (See |o_v|.) In other words, "dV%" will not work. The
+work-around is to go through Visual mode: "V%d" will work.
+
+LANGUAGES: *matchit-languages*
+
+Currently, the following languages are supported: Ada, ASP with VBS, Csh,
+DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal,
+SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via
+|filetype-plugin|s.
+
+To support a new language, see |matchit-newlang| below.
+
+DETAILS: *matchit-details* *matchit-parse*
+
+Here is an outline of what matchit.vim does each time you hit the "%" key. If
+there are |backref|s in |b:match_words| then the first step is to produce a
+version in which these back references have been eliminated; if there are no
+|backref|s then this step is skipped. This step is called parsing. For
+example, "\(foo\|bar\):end\1" is parsed to yield
+"\(foo\|bar\):end\(foo\|bar\)". This can get tricky, especially if there are
+nested groups. If debugging is turned on, the parsed version is saved as
+|b:match_pat|.
+
+ *matchit-choose*
+Next, the script looks for a word on the current line that matches the pattern
+just constructed. It includes the patterns from the 'matchpairs' option.
+The goal is to do what you expect, which turns out to be a little complicated.
+The script follows these rules:
+
+ Insist on a match that ends on or after the cursor.
+ Prefer a match that includes the cursor position (that is, one that
+ starts on or before the cursor).
+ Prefer a match that starts as close to the cursor as possible.
+ Prefer a match in |b:match_words| to a match in 'matchpairs'.
+ If more than one pattern in |b:match_words| matches, choose the one
+ that is listed first.
+
+Examples:
+
+ Suppose you >
+ :let b:match_words = '<:>,<tag>:</tag>'
+< and hit "%" with the cursor on or before the "<" in "a <tag> is born".
+ The pattern '<' comes first, so it is preferred over '<tag>', which
+ also matches. If the cursor is on the "t", however, then '<tag>' is
+ preferred, because this matches a bit of text containing the cursor.
+ If the two groups of patterns were reversed then '<' would never be
+ preferred.
+
+ Suppose you >
+ :let b:match_words = 'if:end if'
+< (Note the space!) and hit "%" with the cursor at the end of "end if".
+ Then "if" matches, which is probably not what you want, but if the
+ cursor starts on the "end " then "end if" is chosen. (You can avoid
+ this problem by using a more complicated pattern.)
+
+If there is no match, the script falls back on the usual behavior of |%|. If
+debugging is turned on, the matched bit of text is saved as |b:match_match|
+and the cursor column of the start of the match is saved as |b:match_col|.
+
+Next, the script looks through |b:match_words| (original and parsed versions)
+for the group and pattern that match. If debugging is turned on, the group is
+saved as |b:match_ini| (the first pattern) and |b:match_tail| (the rest). If
+there are |backref|s then, in addition, the matching pattern is saved as
+|b:match_word| and a table of translations is saved as |b:match_table|. If
+there are |backref|s, these are determined from the matching pattern and
+|b:match_match| and substituted into each pattern in the matching group.
+
+The script decides whether to search forwards or backwards and chooses
+arguments for the |searchpair()| function. Then, the cursor is moved to the
+start of the match, and |searchpair()| is called. By default, matching
+structures inside strings and comments are ignored. This can be changed by
+setting |b:match_skip|.
+
+==============================================================================
+2. Activation *matchit-activate*
+
+You can use this script as a plugin, by copying it to your plugin directory.
+See |add-global-plugin| for instructions. You can also add a line to your
+|vimrc| file, such as >
+ :source $VIMRUNTIME/macros/matchit.vim
+or >
+ :runtime macros/matchit.vim
+Either way, the script should start working the next time you start up Vim.
+
+The script does nothing unless it finds a |buffer-variable| named
+|b:match_words|. The script contains autocommands that set this variable for
+various file types: see |matchit-languages| above. For a new language, you
+can add autocommands to the script or to your vimrc file, but the recommended
+method is to add a line such as >
+ let b:match_words = '\<foo\>:\<bar\>'
+to the |filetype-plugin| for your language. See |b:match_words| below for how
+this variable is interpreted.
+
+TROUBLESHOOTING *matchit-troubleshoot*
+
+The script should work in most installations of Vim. It may not work if Vim
+was compiled with a minimal feature set, for example if the |+syntax| option
+was not enabled. If your Vim has support for syntax compiled in, but you do
+not have |syntax| highlighting turned on, matchit.vim should work, but it may
+fail to skip matching groups in comments and strings. If the |filetype|
+mechanism is turned off, the |b:match_words| variable will probably not be
+defined automatically.
+
+==============================================================================
+3. Configuration *matchit-configure*
+
+There are several variables that govern the behavior of matchit.vim. Note
+that these are variables local to the buffer, not options, so use |:let| to
+define them, not |:set|. Some of these variables have values that matter; for
+others, it only matters whether the variable has been defined. All of these
+can be defined in the |filetype-plugin| or autocommand that defines
+|b:match_words| or "on the fly."
+
+The main variable is |b:match_words|. It is described in the section below on
+supporting a new language.
+
+ *MatchError* *matchit-hl* *matchit-highlight*
+MatchError is the highlight group for error messages from the script. By
+default, it is linked to WarningMsg. If you do not want to be bothered by
+error messages, you can define this to be something invisible. For example,
+if you use the GUI version of Vim and your command line is normally white, you
+can do >
+ :hi MatchError guifg=white guibg=white
+<
+ *b:match_ignorecase*
+If you >
+ :let b:match_ignorecase = 1
+then matchit.vim acts as if 'ignorecase' is set: for example, "end" and "END"
+are equivalent. If you >
+ :let b:match_ignorecase = 0
+then matchit.vim treats "end" and "END" differently. (There will be no
+b:match_infercase option unless someone requests it.)
+
+ *b:match_debug*
+Define b:match_debug if you want debugging information to be saved. See
+|matchit-debug|, below.
+
+ *b:match_skip*
+If b:match_skip is defined, it is passed as the skip argument to
+|searchpair()|. This controls when matching structures are skipped, or
+ignored. By default, they are ignored inside comments and strings, as
+determined by the |syntax| mechanism. (If syntax highlighting is turned off,
+nothing is skipped.) You can set b:match_skip to a string, which evaluates to
+a non-zero, numerical value if the match is to be skipped or zero if the match
+should not be skipped. In addition, the following special values are
+supported by matchit.vim:
+ s:foo becomes (current syntax item) =~ foo
+ S:foo becomes (current syntax item) !~ foo
+ r:foo becomes (line before cursor) =~ foo
+ R:foo becomes (line before cursor) !~ foo
+(The "s" is meant to suggest "syntax", and the "r" is meant to suggest
+"regular expression".)
+
+Examples:
+
+ You can get the default behavior with >
+ :let b:match_skip = 's:comment\|string'
+<
+ If you want to skip matching structures unless they are at the start
+ of the line (ignoring whitespace) then you can >
+ :let b:match_skip = 'R:^\s*'
+< Do not do this if strings or comments can span several lines, since
+ the normal syntax checking will not be done if you set b:match_skip.
+
+ In LaTeX, since "%" is used as the comment character, you can >
+ :let b:match_skip = 'r:%'
+< Unfortunately, this will skip anything after "\%", an escaped "%". To
+ allow for this, and also "\\%" (an excaped backslash followed by the
+ comment character) you can >
+ :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
+<
+ See the $VIMRUNTIME/syntax/vim.vim for an example that uses both
+ syntax and a regular expression.
+
+==============================================================================
+4. Supporting a New Language *matchit-newlang*
+ *b:match_words*
+In order for matchit.vim to support a new language, you must define a suitable
+pattern for |b:match_words|. You may also want to set some of the
+|matchit-configure| variables, as described above. If your language has a
+complicated syntax, or many keywords, you will need to know something about
+Vim's |regular-expression|s.
+
+The format for |b:match_words| is similar to that of the 'matchpairs' option:
+it is a comma (,)-separated list of groups; each group is a colon(:)-separated
+list of patterns (regular expressions). It is OK to have only one group; the
+effect is undefined if a group has only one pattern. A simple example is >
+ :let b:match_words = '\<if\>:\<endif\>,'
+ \ . '\<while\>:\<continue\>:\<break\>:\<endwhile\>'
+(In Vim regular expressions, |\<| and |\>| denote word boundaries. Thus "if"
+matches the end of "endif" but "\<if\>" does not.) Then banging on the "%"
+key will bounce the cursor between "if" and the matching "endif"; and from
+"while" to any matching "continue" or "break", then to the matching "endwhile"
+and back to the "while". It is almost always easier to use |literal-string|s
+(single quotes) as above: '\<if\>' rather than "\\<if\\>" and so on.
+
+Exception: If the ":" character does not appear in b:match_words, then it is
+treated as an expression to be evaluated. For example, >
+ :let b:match_words = 'GetMatchWords()'
+allows you to define a function. This can return a different string depending
+on the current syntax, for example.
+
+Once you have defined the appropriate value of |b:match_words|, you will
+probably want to have this set automatically each time you edit the
+appropriate file type. The recommended way to do this is by adding the
+definition to a |filetype-plugin| file.
+
+Tips: Be careful that your initial pattern does not match your final pattern.
+See the example above for the use of word-boundary expressions. It is usually
+better to use ".\{-}" (as many as necessary) instead of ".*" (as many as
+possible). See |\{-|. For example, in the string "<tag>label</tag>", "<.*>"
+matches the whole string whereas "<.\{-}>" and "<[^>]*>" match "<tag>" and
+"</tag>".
+
+ *matchit-spaces* *matchit-s:notend*
+If "if" is to be paired with "end if" (Note the space!) then word boundaries
+are not enough. Instead, define a regular expression s:notend that will match
+anything but "end" and use it as follows: >
+ :let s:notend = '\%(\<end\s\+\)\@<!'
+ :let b:match_words = s:notend . '\<if\>:\<end\s\+if\>'
+< *matchit-s:sol*
+This is a simplified version of what is done for Ada. The s:notend is a
+|script-variable|. Similarly, you may want to define a start-of-line regular
+expression >
+ :let s:sol = '\%(^\|;\)\s*'
+if keywords are only recognized after the start of a line or after a
+semicolon (;), with optional white space.
+
+ *matchit-backref* *matchit-\1*
+In any group, the expressions |\1|, |\2|, ..., |\9| refer to parts of the
+INITIAL pattern enclosed in |\(|escaped parentheses|\)|. These are referred
+to as back references, or backrefs. For example, >
+ :let b:match_words = '\<b\(o\+\)\>:\(h\)\1\>'
+means that "bo" pairs with "ho" and "boo" pairs with "hoo" and so on. Note
+that "\1" does not refer to the "\(h\)" in this example. If you have
+"\(nested \(parentheses\)\) then "\d" refers to the d-th "\(" and everything
+up to and including the matching "\)": in "\(nested\(parentheses\)\)", "\1"
+refers to everything and "\2" refers to "\(parentheses\)". If you use a
+variable such as |s:notend| or |s:sol| in the previous paragraph then remember
+to count any "\(" patterns in this variable. You do not have to count groups
+defined by |\%(\)|.
+
+It should be possible to resolve back references from any pattern in the
+group. For example, >
+ :let b:match_words = '\(foo\)\(bar\):more\1:and\2:end\1\2'
+would not work because "\2" cannot be determined from "morefoo" and "\1"
+cannot be determined from "andbar". On the other hand, >
+ :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
+should work (and have the same effect as "foobar:barfoo:endfoobar"), although
+this has not been thoroughly tested.
+
+You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has
+not been thouroughly tested in matchit.vim.) For example, if the keyword "if"
+must occur at the start of the line, with optional white space, you might use
+the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of
+at the start of the line. For another example, if HTML had only one tag then
+one could >
+ :let b:match_words = '<:>,<\@<=tag>:<\@<=/tag>'
+so that "%" can bounce between matching "<" and ">" pairs or (starting on
+"tag" or "/tag") between matching tags. Without the |\@<=|, the script would
+bounce from "tag" to the "<" in "</tag>", and another "%" would not take you
+back to where you started.
+
+DEBUGGING *matchit-debug* *:MatchDebug*
+
+If you are having trouble figuring out the appropriate definition of
+|b:match_words| then you can take advantage of the same information I use when
+debugging the script. This is especially true if you are not sure whether
+your patterns or my script are at fault! To make this more convenient, I have
+made the command :MatchDebug, which defines the variable |b:match_debug| and
+creates a Matchit menu. This menu makes it convenient to check the values of
+the variables described below. You will probably also want to read
+|matchit-details| above.
+
+Defining the variable |b:match_debug| causes the script to set the following
+variables, each time you hit the "%" key. Several of these are only defined
+if |b:match_words| includes |backref|s.
+
+ *b:match_pat*
+The b:match_pat variable is set to |b:match_words| with |backref|s parsed.
+ *b:match_match*
+The b:match_match variable is set to the bit of text that is recognized as a
+match.
+ *b:match_col*
+The b:match_col variable is set to the cursor column of the start of the
+matching text.
+ *b:match_wholeBR*
+The b:match_wholeBR variable is set to the comma-separated group of patterns
+that matches, with |backref|s unparsed.
+ *b:match_iniBR*
+The b:match_iniBR variable is set to the first pattern in |b:match_wholeBR|.
+ *b:match_ini*
+The b:match_ini variable is set to the first pattern in |b:match_wholeBR|,
+with |backref|s resolved from |b:match_match|.
+ *b:match_tail*
+The b:match_tail variable is set to the remaining patterns in
+|b:match_wholeBR|, with |backref|s resolved from |b:match_match|.
+ *b:match_word*
+The b:match_word variable is set to the pattern from |b:match_wholeBR| that
+matches |b:match_match|.
+ *b:match_table*
+The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
+|b:match_word|.
+
+==============================================================================
+5. Known Bugs and Limitations *matchit-bugs*
+
+Just because I know about a bug does not mean that it is on my todo list. I
+try to respond to reports of bugs that cause real problems. If it does not
+cause serious problems, or if there is a work-around, a bug may sit there for
+a while. Moral: if a bug (known or not) bothers you, let me know.
+
+The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
+have undesired effects in Select mode |Select-mode-mapping|. At least, if you
+want to replace the selection with any character in "ag%[]" there will be a
+pause of |'updatetime'| first.
+
+It would be nice if "\0" were recognized as the entire pattern. That is, it
+would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may
+try to implement this in a future version. (This is not so easy to arrange as
+you might think!)
+
+==============================================================================
+vim:tw=78:fo=tcq2:
diff --git a/runtime/macros/matchit.vim b/runtime/macros/matchit.vim
new file mode 100644
index 000000000..296099474
--- /dev/null
+++ b/runtime/macros/matchit.vim
@@ -0,0 +1,806 @@
+" matchit.vim: (global plugin) Extended "%" matching
+" Last Change: Sat May 15 11:00 AM 2004 EDT
+" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
+" Version: 1.9, for Vim 6.3
+" URL: http://www.vim.org/script.php?script_id=39
+
+" Documentation:
+" The documentation is in a separate file, matchit.txt .
+
+" Credits:
+" Vim editor by Bram Moolenaar (Thanks, Bram!)
+" Original script and design by Raul Segura Acevedo
+" Support for comments by Douglas Potts
+" Support for back references and other improvements by Benji Fisher
+" Support for many languages by Johannes Zellner
+" Suggestions for improvement, bug reports, and support for additional
+" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
+" Collett, Stephen Wall, Dany St-Amant, and Johannes Zellner.
+
+" Debugging:
+" If you'd like to try the built-in debugging commands...
+" :MatchDebug to activate debugging for the current buffer
+" This saves the values of several key script variables as buffer-local
+" variables. See the MatchDebug() function, below, for details.
+
+" TODO: I should think about multi-line patterns for b:match_words.
+" This would require an option: how many lines to scan (default 1).
+" This would be useful for Python, maybe also for *ML.
+" TODO: Maybe I should add a menu so that people will actually use some of
+" the features that I have implemented.
+" TODO: Eliminate the MultiMatch function. Add yet another argument to
+" Match_wrapper() instead.
+" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
+" TODO: Make backrefs safer by using '\V' (very no-magic).
+" TODO: Add a level of indirection, so that custom % scripts can use my
+" work but extend it.
+
+" allow user to prevent loading
+" and prevent duplicate loading
+if exists("loaded_matchit") || &cp
+ finish
+endif
+let loaded_matchit = 1
+let s:last_mps = ""
+let s:last_words = ""
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR>
+nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR>
+vnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv``
+vnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv``
+onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR>
+onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR>
+
+" Analogues of [{ and ]} using matching patterns:
+nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR>
+nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR>
+vmap [% <Esc>[%m'gv``
+vmap ]% <Esc>]%m'gv``
+" vnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv``
+" vnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv``
+onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR>
+onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR>
+
+" text object:
+vmap a% <Esc>[%v]%
+
+" Auto-complete mappings: (not yet "ready for prime time")
+" TODO Read :help write-plugin for the "right" way to let the user
+" specify a key binding.
+" let g:match_auto = '<C-]>'
+" let g:match_autoCR = '<C-CR>'
+" if exists("g:match_auto")
+" execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls'
+" endif
+" if exists("g:match_autoCR")
+" execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>'
+" endif
+" if exists("g:match_gthhoh")
+" execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>'
+" endif " gthhoh = "Get the heck out of here!"
+
+let s:notslash = '\\\@<!\%(\\\\\)*'
+
+function! s:Match_wrapper(word, forward, mode) range
+ " In s:CleanUp(), :execute "set" restore_options .
+ let restore_options = (&ic ? " " : " no") . "ignorecase"
+ if exists("b:match_ignorecase")
+ let &ignorecase = b:match_ignorecase
+ endif
+ let restore_options = " ve=" . &ve . restore_options
+ set ve=
+ " If this function was called from Visual mode, make sure that the cursor
+ " is at the correct end of the Visual range:
+ if a:mode == "v"
+ execute "normal! gv\<Esc>"
+ endif
+ " In s:CleanUp(), we may need to check whether the cursor moved forward.
+ let startline = line(".")
+ let startcol = col(".")
+ " Use default behavior if called with a count or if no patterns are defined.
+ if v:count
+ exe "normal! " . v:count . "%"
+ return s:CleanUp(restore_options, a:mode, startline, startcol)
+ elseif !exists("b:match_words") || b:match_words == ""
+ silent! normal! %
+ return s:CleanUp(restore_options, a:mode, startline, startcol)
+ end
+
+ " First step: if not already done, set the script variables
+ " s:do_BR flag for whether there are backrefs
+ " s:pat parsed version of b:match_words
+ " s:all regexp based on s:pat and the default groups
+ "
+ " Allow b:match_words = "GetVimMatchWords()" .
+ if b:match_words =~ ":"
+ let match_words = b:match_words
+ else
+ execute "let match_words =" b:match_words
+ endif
+" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion!
+ if (match_words != s:last_words) || (&mps != s:last_mps) ||
+ \ exists("b:match_debug")
+ let s:last_words = match_words
+ let s:last_mps = &mps
+ if match_words !~ s:notslash . '\\\d'
+ let s:do_BR = 0
+ let s:pat = match_words
+ else
+ let s:do_BR = 1
+ let s:pat = s:ParseWords(match_words)
+ endif
+ " The next several lines were here before
+ " BF started messing with this script.
+ " quote the special chars in 'matchpairs', replace [,:] with \| and then
+ " append the builtin pairs (/*, */, #if, #ifdef, #else, #elif, #endif)
+ " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+',
+ " \ '\\|', 'g').'\|\/\*\|\*\/\|#if\>\|#ifdef\>\|#else\>\|#elif\>\|#endif\>'
+ let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
+ \ '\/\*:\*\/,#if\%(def\)\=:#else\>:#elif\>:#endif\>'
+ " s:all = pattern with all the keywords
+ let s:all = s:pat . (strlen(s:pat) ? "," : "") . default
+ let s:all = substitute(s:all, s:notslash . '\zs[,:]\+', '\\|', 'g')
+ let s:all = '\%(' . s:all . '\)'
+ " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)'
+ if exists("b:match_debug")
+ let b:match_pat = s:pat
+ endif
+ endif
+
+ " Second step: set the following local variables:
+ " matchline = line on which the cursor started
+ " curcol = number of characters before match
+ " prefix = regexp for start of line to start of match
+ " suffix = regexp for end of match to end of line
+ " Require match to end on or after the cursor and prefer it to
+ " start on or before the cursor.
+ let matchline = getline(startline)
+ if a:word != ''
+ " word given
+ if a:word !~ s:all
+ echohl WarningMsg|echo 'Missing rule for word:"'.a:word.'"'|echohl NONE
+ return s:CleanUp(restore_options, a:mode, startline, startcol)
+ endif
+ let matchline = a:word
+ let curcol = 0
+ let prefix = '^\%('
+ let suffix = '\)$'
+ " Now the case when "word" is not given
+ else " Find the match that ends on or after the cursor and set curcol.
+ let regexp = s:Wholematch(matchline, s:all, startcol-1)
+ let curcol = match(matchline, regexp)
+ let suf = strlen(matchline) - matchend(matchline, regexp)
+ let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
+ let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
+ " If the match comes from the defaults, bail out.
+ if matchline !~ prefix .
+ \ substitute(s:pat, s:notslash.'\zs[,:]\+', '\\|', 'g') . suffix
+ silent! norm! %
+ return s:CleanUp(restore_options, a:mode, startline, startcol)
+ endif
+ endif
+ if exists("b:match_debug")
+ let b:match_match = matchstr(matchline, regexp)
+ let b:match_col = curcol+1
+ endif
+
+ " Third step: Find the group and single word that match, and the original
+ " (backref) versions of these. Then, resolve the backrefs.
+ " Set the following local variable:
+ " group = colon-separated list of patterns, one of which matches
+ " = ini:mid:fin or ini:fin
+ "
+ " Reconstruct the version with unresolved backrefs.
+ let patBR = substitute(match_words.',',
+ \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
+ let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g')
+ " Now, set group and groupBR to the matching group: 'if:endif' or
+ " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns
+ " group . "," . groupBR, and we pick it apart.
+ let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
+ let i = matchend(group, s:notslash . ",")
+ let groupBR = strpart(group, i)
+ let group = strpart(group, 0, i-1)
+ " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
+ if s:do_BR " Do the hard part: resolve those backrefs!
+ let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
+ endif
+ if exists("b:match_debug")
+ let b:match_wholeBR = groupBR
+ let i = matchend(groupBR, s:notslash . ":")
+ let b:match_iniBR = strpart(groupBR, 0, i-1)
+ endif
+
+ " Fourth step: Set the arguments for searchpair().
+ let i = matchend(group, s:notslash . ":")
+ let j = matchend(group, '.*' . s:notslash . ":")
+ let ini = strpart(group, 0, i-1)
+ let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g')
+ let fin = strpart(group, j)
+ " searchpair() requires that these patterns avoid \(\) groups.
+ let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g')
+ let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g')
+ let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g')
+ " Set mid. This is optimized for readability, not micro-efficiency!
+ if a:forward && matchline =~ prefix . fin . suffix
+ \ || !a:forward && matchline =~ prefix . ini . suffix
+ let mid = ""
+ endif
+ " Set flag. This is optimized for readability, not micro-efficiency!
+ if a:forward && matchline =~ prefix . fin . suffix
+ \ || !a:forward && matchline !~ prefix . ini . suffix
+ let flag = "bW"
+ else
+ let flag = "W"
+ endif
+ " Set skip.
+ if exists("b:match_skip")
+ let skip = b:match_skip
+ elseif exists("b:match_comment") " backwards compatibility and testing!
+ let skip = "r:" . b:match_comment
+ else
+ let skip = 's:comment\|string'
+ endif
+ let skip = s:ParseSkip(skip)
+ if exists("b:match_debug")
+ let b:match_ini = ini
+ let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin
+ endif
+
+ " Fifth step: actually start moving the cursor and call searchpair().
+ " Later, :execute restore_cursor to get to the original screen.
+ let restore_cursor = virtcol(".") . "|"
+ normal! g0
+ let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
+ normal! H
+ let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
+ execute restore_cursor
+ normal! 0
+ if curcol
+ execute "normal!" . curcol . "l"
+ endif
+ if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
+ let skip = "0"
+ else
+ execute "if " . skip . "| let skip = '0' | endif"
+ endif
+ let sp_return = searchpair(ini, mid, fin, flag, skip)
+ let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
+ " Restore cursor position and original screen.
+ execute restore_cursor
+ normal! m'
+ if sp_return > 0
+ execute final_position
+ endif
+ return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin)
+endfun
+
+" Restore options and do some special handling for Operator-pending mode.
+" The optional argument is the tail of the matching group.
+fun! s:CleanUp(options, mode, startline, startcol, ...)
+ execute "set" a:options
+ " Open folds, if appropriate.
+ if a:mode != "o"
+ if &foldopen =~ "percent"
+ normal! zv
+ endif
+ " In Operator-pending mode, we want to include the whole match
+ " (for example, d%).
+ " This is only a problem if we end up moving in the forward direction.
+ elseif (a:startline < line(".")) ||
+ \ (a:startline == line(".") && a:startcol < col("."))
+ if a:0
+ " Check whether the match is a single character. If not, move to the
+ " end of the match.
+ let matchline = getline(".")
+ let currcol = col(".")
+ let regexp = s:Wholematch(matchline, a:1, currcol-1)
+ let endcol = matchend(matchline, regexp)
+ if endcol > currcol " This is NOT off by one!
+ execute "normal!" . (endcol - currcol) . "l"
+ endif
+ endif " a:0
+ endif " a:mode != "o" && etc.
+ return 0
+endfun
+
+" Example (simplified HTML patterns): if
+" a:groupBR = '<\(\k\+\)>:</\1>'
+" a:prefix = '^.\{3}\('
+" a:group = '<\(\k\+\)>:</\(\k\+\)>'
+" a:suffix = '\).\{2}$'
+" a:matchline = "123<tag>12" or "123</tag>12"
+" then extract "tag" from a:matchline and return "<tag>:</tag>" .
+fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
+ if a:matchline !~ a:prefix .
+ \ substitute(a:group, s:notslash . '\zs:', '\\|', 'g') . a:suffix
+ return a:group
+ endif
+ let i = matchend(a:groupBR, s:notslash . ':')
+ let ini = strpart(a:groupBR, 0, i-1)
+ let tailBR = strpart(a:groupBR, i)
+ let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix,
+ \ a:groupBR)
+ let i = matchend(word, s:notslash . ":")
+ let wordBR = strpart(word, i)
+ let word = strpart(word, 0, i-1)
+ " Now, a:matchline =~ a:prefix . word . a:suffix
+ if wordBR != ini
+ let table = s:Resolve(ini, wordBR, "table")
+ else
+ " let table = "----------"
+ let table = ""
+ let d = 0
+ while d < 10
+ if tailBR =~ s:notslash . '\\' . d
+ " let table[d] = d
+ let table = table . d
+ else
+ let table = table . "-"
+ endif
+ let d = d + 1
+ endwhile
+ endif
+ let d = 9
+ while d
+ if table[d] != "-"
+ let backref = substitute(a:matchline, a:prefix.word.a:suffix,
+ \ '\'.table[d], "")
+ " Are there any other characters that should be escaped?
+ let backref = escape(backref, '*,:')
+ execute s:Ref(ini, d, "start", "len")
+ let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
+ let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
+ \ escape(backref, '\\'), 'g')
+ endif
+ let d = d-1
+ endwhile
+ if exists("b:match_debug")
+ if s:do_BR
+ let b:match_table = table
+ let b:match_word = word
+ else
+ let b:match_table = ""
+ let b:match_word = ""
+ endif
+ endif
+ return ini . ":" . tailBR
+endfun
+
+" Input a comma-separated list of groups with backrefs, such as
+" a:groups = '\(foo\):end\1,\(bar\):end\1'
+" and return a comma-separated list of groups with backrefs replaced:
+" return '\(foo\):end\(foo\),\(bar\):end\(bar\)'
+fun! s:ParseWords(groups)
+ let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
+ let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g')
+ let parsed = ""
+ while groups =~ '[^,:]'
+ let i = matchend(groups, s:notslash . ':')
+ let j = matchend(groups, s:notslash . ',')
+ let ini = strpart(groups, 0, i-1)
+ let tail = strpart(groups, i, j-i-1) . ":"
+ let groups = strpart(groups, j)
+ let parsed = parsed . ini
+ let i = matchend(tail, s:notslash . ':')
+ while i != -1
+ " In 'if:else:endif', ini='if' and word='else' and then word='endif'.
+ let word = strpart(tail, 0, i-1)
+ let tail = strpart(tail, i)
+ let i = matchend(tail, s:notslash . ':')
+ let parsed = parsed . ":" . s:Resolve(ini, word, "word")
+ endwhile " Now, tail has been used up.
+ let parsed = parsed . ","
+ endwhile " groups =~ '[^,:]'
+ return parsed
+endfun
+
+" TODO I think this can be simplified and/or made more efficient.
+" TODO What should I do if a:start is out of range?
+" Return a regexp that matches all of a:string, such that
+" matchstr(a:string, regexp) represents the match for a:pat that starts
+" as close to a:start as possible, before being preferred to after, and
+" ends after a:start .
+" Usage:
+" let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1)
+" let i = match(getline("."), regexp)
+" let j = matchend(getline("."), regexp)
+" let match = matchstr(getline("."), regexp)
+fun! s:Wholematch(string, pat, start)
+ let group = '\%(' . a:pat . '\)'
+ let prefix = (a:start ? '\(^.\{,' . a:start . '}\)\zs' : '^')
+ let len = strlen(a:string)
+ let suffix = (a:start+1 < len ? '\(.\{,'.(len-a:start-1).'}$\)\@=' : '$')
+ if a:string !~ prefix . group . suffix
+ let prefix = ''
+ endif
+ return prefix . group . suffix
+endfun
+
+" No extra arguments: s:Ref(string, d) will
+" find the d'th occurrence of '\(' and return it, along with everything up
+" to and including the matching '\)'.
+" One argument: s:Ref(string, d, "start") returns the index of the start
+" of the d'th '\(' and any other argument returns the length of the group.
+" Two arguments: s:Ref(string, d, "foo", "bar") returns a string to be
+" executed, having the effect of
+" :let foo = s:Ref(string, d, "start")
+" :let bar = s:Ref(string, d, "len")
+fun! s:Ref(string, d, ...)
+ let len = strlen(a:string)
+ if a:d == 0
+ let start = 0
+ else
+ let cnt = a:d
+ let match = a:string
+ while cnt
+ let cnt = cnt - 1
+ let index = matchend(match, s:notslash . '\\(')
+ if index == -1
+ return ""
+ endif
+ let match = strpart(match, index)
+ endwhile
+ let start = len - strlen(match)
+ if a:0 == 1 && a:1 == "start"
+ return start - 2
+ endif
+ let cnt = 1
+ while cnt
+ let index = matchend(match, s:notslash . '\\(\|\\)') - 1
+ if index == -2
+ return ""
+ endif
+ " Increment if an open, decrement if a ')':
+ let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')'
+ " let cnt = stridx('0(', match[index]) + cnt
+ let match = strpart(match, index+1)
+ endwhile
+ let start = start - 2
+ let len = len - start - strlen(match)
+ endif
+ if a:0 == 1
+ return len
+ elseif a:0 == 2
+ return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len
+ else
+ return strpart(a:string, start, len)
+ endif
+endfun
+
+" Count the number of disjoint copies of pattern in string.
+" If the pattern is a literal string and contains no '0' or '1' characters
+" then s:Count(string, pattern, '0', '1') should be faster than
+" s:Count(string, pattern).
+fun! s:Count(string, pattern, ...)
+ let pat = escape(a:pattern, '\\')
+ if a:0 > 1
+ let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g")
+ let foo = substitute(a:string, pat, a:2, "g")
+ let foo = substitute(foo, '[^' . a:2 . ']', "", "g")
+ return strlen(foo)
+ endif
+ let result = 0
+ let foo = a:string
+ let index = matchend(foo, pat)
+ while index != -1
+ let result = result + 1
+ let foo = strpart(foo, index)
+ let index = matchend(foo, pat)
+ endwhile
+ return result
+endfun
+
+" s:Resolve('\(a\)\(b\)', '\(c\)\2\1\1\2') should return table.word, where
+" word = '\(c\)\(b\)\(a\)\3\2' and table = '-32-------'. That is, the first
+" '\1' in target is replaced by '\(a\)' in word, table[1] = 3, and this
+" indicates that all other instances of '\1' in target are to be replaced
+" by '\3'. The hard part is dealing with nesting...
+" Note that ":" is an illegal character for source and target,
+" unless it is preceded by "\".
+fun! s:Resolve(source, target, output)
+ let word = a:target
+ let i = matchend(word, s:notslash . '\\\d') - 1
+ let table = "----------"
+ while i != -2 " There are back references to be replaced.
+ let d = word[i]
+ let backref = s:Ref(a:source, d)
+ " The idea is to replace '\d' with backref. Before we do this,
+ " replace any \(\) groups in backref with :1, :2, ... if they
+ " correspond to the first, second, ... group already inserted
+ " into backref. Later, replace :1 with \1 and so on. The group
+ " number w+b within backref corresponds to the group number
+ " s within a:source.
+ " w = number of '\(' in word before the current one
+ let w = s:Count(
+ \ substitute(strpart(word, 0, i-1), '\\\\', '', 'g'), '\(', '1')
+ let b = 1 " number of the current '\(' in backref
+ let s = d " number of the current '\(' in a:source
+ while b <= s:Count(substitute(backref, '\\\\', '', 'g'), '\(', '1')
+ \ && s < 10
+ if table[s] == "-"
+ if w + b < 10
+ " let table[s] = w + b
+ let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1)
+ endif
+ let b = b + 1
+ let s = s + 1
+ else
+ execute s:Ref(backref, b, "start", "len")
+ let ref = strpart(backref, start, len)
+ let backref = strpart(backref, 0, start) . ":". table[s]
+ \ . strpart(backref, start+len)
+ let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1')
+ endif
+ endwhile
+ let word = strpart(word, 0, i-1) . backref . strpart(word, i+1)
+ let i = matchend(word, s:notslash . '\\\d') - 1
+ endwhile
+ let word = substitute(word, s:notslash . '\zs:', '\\', 'g')
+ if a:output == "table"
+ return table
+ elseif a:output == "word"
+ return word
+ else
+ return table . word
+ endif
+endfun
+
+" Assume a:comma = ",". Then the format for a:patterns and a:1 is
+" a:patterns = "<pat1>,<pat2>,..."
+" a:1 = "<alt1>,<alt2>,..."
+" If <patn> is the first pattern that matches a:string then return <patn>
+" if no optional arguments are given; return <patn>,<altn> if a:1 is given.
+fun! s:Choose(patterns, string, comma, branch, prefix, suffix, ...)
+ let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma)
+ let i = matchend(tail, s:notslash . a:comma)
+ if a:0
+ let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma)
+ let j = matchend(alttail, s:notslash . a:comma)
+ endif
+ let current = strpart(tail, 0, i-1)
+ if a:branch == ""
+ let currpat = current
+ else
+ let currpat = substitute(current, a:branch, '\\|', 'g')
+ endif
+ while a:string !~ a:prefix . currpat . a:suffix
+ let tail = strpart(tail, i)
+ let i = matchend(tail, s:notslash . a:comma)
+ if i == -1
+ return -1
+ endif
+ let current = strpart(tail, 0, i-1)
+ if a:branch == ""
+ let currpat = current
+ else
+ let currpat = substitute(current, a:branch, '\\|', 'g')
+ endif
+ if a:0
+ let alttail = strpart(alttail, j)
+ let j = matchend(alttail, s:notslash . a:comma)
+ endif
+ endwhile
+ if a:0
+ let current = current . a:comma . strpart(alttail, 0, j-1)
+ endif
+ return current
+endfun
+
+" Call this function to turn on debugging information. Every time the main
+" script is run, buffer variables will be saved. These can be used directly
+" or viewed using the menu items below.
+if !exists(":MatchDebug")
+ command! -nargs=0 MatchDebug call s:Match_debug()
+endif
+
+fun! s:Match_debug()
+ let b:match_debug = 1 " Save debugging information.
+ " pat = all of b:match_words with backrefs parsed
+ amenu &Matchit.&pat :echo b:match_pat<CR>
+ " match = bit of text that is recognized as a match
+ amenu &Matchit.&match :echo b:match_match<CR>
+ " curcol = cursor column of the start of the matching text
+ amenu &Matchit.&curcol :echo b:match_col<CR>
+ " wholeBR = matching group, original version
+ amenu &Matchit.wh&oleBR :echo b:match_wholeBR<CR>
+ " iniBR = 'if' piece, original version
+ amenu &Matchit.ini&BR :echo b:match_iniBR<CR>
+ " ini = 'if' piece, with all backrefs resolved from match
+ amenu &Matchit.&ini :echo b:match_ini<CR>
+ " tail = 'else\|endif' piece, with all backrefs resolved from match
+ amenu &Matchit.&tail :echo b:match_tail<CR>
+ " fin = 'endif' piece, with all backrefs resolved from match
+ amenu &Matchit.&word :echo b:match_word<CR>
+ " '\'.d in ini refers to the same thing as '\'.table[d] in word.
+ amenu &Matchit.t&able :echo '0:' . b:match_table . ':9'<CR>
+endfun
+
+" Jump to the nearest unmatched "(" or "if" or "<tag>" if a:spflag == "bW"
+" or the nearest unmatched "</tag>" or "endif" or ")" if a:spflag == "W".
+" Return a "mark" for the original position, so that
+" let m = MultiMatch("bW", "n") ... execute m
+" will return to the original position. If there is a problem, do not
+" move the cursor and return "", unless a count is given, in which case
+" go up or down as many levels as possible and again return "".
+" TODO This relies on the same patterns as % matching. It might be a good
+" idea to give it its own matching patterns.
+fun! s:MultiMatch(spflag, mode)
+ if !exists("b:match_words") || b:match_words == ""
+ return ""
+ end
+ let restore_options = (&ic ? "" : "no") . "ignorecase"
+ if exists("b:match_ignorecase")
+ let &ignorecase = b:match_ignorecase
+ endif
+ let startline = line(".")
+ let startcol = col(".")
+
+ " First step: if not already done, set the script variables
+ " s:do_BR flag for whether there are backrefs
+ " s:pat parsed version of b:match_words
+ " s:all regexp based on s:pat and the default groups
+ " This part is copied and slightly modified from s:Match_wrapper().
+ let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
+ \ '\/\*:\*\/,#if\%(def\)\=:$else\>:#elif\>:#endif\>'
+ " Allow b:match_words = "GetVimMatchWords()" .
+ if b:match_words =~ ":"
+ let match_words = b:match_words
+ else
+ execute "let match_words =" b:match_words
+ endif
+ if (match_words != s:last_words) || (&mps != s:last_mps) ||
+ \ exists("b:match_debug")
+ let s:last_words = match_words
+ let s:last_mps = &mps
+ if match_words !~ s:notslash . '\\\d'
+ let s:do_BR = 0
+ let s:pat = match_words
+ else
+ let s:do_BR = 1
+ let s:pat = s:ParseWords(match_words)
+ endif
+ let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default,
+ \ '[,:]\+','\\|','g') . '\)'
+ if exists("b:match_debug")
+ let b:match_pat = s:pat
+ endif
+ endif
+
+ " Second step: figure out the patterns for searchpair()
+ " and save the screen, cursor position, and 'ignorecase'.
+ " - TODO: A lot of this is copied from s:Match_wrapper().
+ " - maybe even more functionality should be split off
+ " - into separate functions!
+ let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default
+ let open = substitute(s:pat . cdefault, ':[^,]*,', '\\),\\(', 'g')
+ let open = '\(' . substitute(open, ':[^,]*$', '\\)', '')
+ let close = substitute(s:pat . cdefault, ',[^,]*:', '\\),\\(', 'g')
+ let close = substitute(close, '[^,]*:', '\\(', '') . '\)'
+ if exists("b:match_skip")
+ let skip = b:match_skip
+ elseif exists("b:match_comment") " backwards compatibility and testing!
+ let skip = "r:" . b:match_comment
+ else
+ let skip = 's:comment\|string'
+ endif
+ let skip = s:ParseSkip(skip)
+ " let restore_cursor = line(".") . "G" . virtcol(".") . "|"
+ " normal! H
+ " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
+ let restore_cursor = virtcol(".") . "|"
+ normal! g0
+ let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
+ normal! H
+ let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
+ execute restore_cursor
+
+ " Third step: call searchpair().
+ " Replace '\('--but not '\\('--with '\%(' and ',' with '\|'.
+ let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
+ let openpat = substitute(openpat, ',', '\\|', 'g')
+ let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
+ let closepat = substitute(closepat, ',', '\\|', 'g')
+ if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
+ let skip = '0'
+ else
+ execute "if " . skip . "| let skip = '0' | endif"
+ endif
+ mark '
+ let level = v:count1
+ while level
+ if searchpair(openpat, '', closepat, a:spflag, skip) < 1
+ call s:CleanUp(restore_options, a:mode, startline, startcol)
+ return ""
+ endif
+ let level = level - 1
+ endwhile
+
+ " Restore options and return a string to restore the original position.
+ call s:CleanUp(restore_options, a:mode, startline, startcol)
+ return restore_cursor
+endfun
+
+" Search backwards for "if" or "while" or "<tag>" or ...
+" and return "endif" or "endwhile" or "</tag>" or ... .
+" For now, this uses b:match_words and the same script variables
+" as s:Match_wrapper() . Later, it may get its own patterns,
+" either from a buffer variable or passed as arguments.
+" fun! s:Autocomplete()
+" echo "autocomplete not yet implemented :-("
+" if !exists("b:match_words") || b:match_words == ""
+" return ""
+" end
+" let startpos = s:MultiMatch("bW")
+"
+" if startpos == ""
+" return ""
+" endif
+" " - TODO: figure out whether 'if' or '<tag>' matched, and construct
+" " - the appropriate closing.
+" let matchline = getline(".")
+" let curcol = col(".") - 1
+" " - TODO: Change the s:all argument if there is a new set of match pats.
+" let regexp = s:Wholematch(matchline, s:all, curcol)
+" let suf = strlen(matchline) - matchend(matchline, regexp)
+" let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
+" let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
+" " Reconstruct the version with unresolved backrefs.
+" let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g')
+" let patBR = substitute(patBR, ':\{2,}', ':', "g")
+" " Now, set group and groupBR to the matching group: 'if:endif' or
+" " 'while:endwhile' or whatever.
+" let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
+" let i = matchend(group, s:notslash . ",")
+" let groupBR = strpart(group, i)
+" let group = strpart(group, 0, i-1)
+" " Now, matchline =~ prefix . substitute(group,':','\|','g') . suffix
+" if s:do_BR
+" let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
+" endif
+" " let g:group = group
+"
+" " - TODO: Construct the closing from group.
+" let fake = "end" . expand("<cword>")
+" execute startpos
+" return fake
+" endfun
+
+" Close all open structures. "Get the heck out of here!"
+" fun! s:Gthhoh()
+" let close = s:Autocomplete()
+" while strlen(close)
+" put=close
+" let close = s:Autocomplete()
+" endwhile
+" endfun
+
+" Parse special strings as typical skip arguments for searchpair():
+" s:foo becomes (current syntax item) =~ foo
+" S:foo becomes (current syntax item) !~ foo
+" r:foo becomes (line before cursor) =~ foo
+" R:foo becomes (line before cursor) !~ foo
+fun! s:ParseSkip(str)
+ let skip = a:str
+ if skip[1] == ":"
+ if skip[0] == "s"
+ let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" .
+ \ strpart(skip,2) . "'"
+ elseif skip[0] == "S"
+ let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" .
+ \ strpart(skip,2) . "'"
+ elseif skip[0] == "r"
+ let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'"
+ elseif skip[0] == "R"
+ let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'"
+ endif
+ endif
+ return skip
+endfun
+
+let &cpo = s:save_cpo
+
+" vim:sts=2:sw=2:
diff --git a/runtime/macros/maze.info b/runtime/macros/maze.info
new file mode 100644
index 000000000..2ad27db5a
--- /dev/null
+++ b/runtime/macros/maze.info
Binary files differ
diff --git a/runtime/macros/maze/Makefile b/runtime/macros/maze/Makefile
new file mode 100644
index 000000000..c34e115d9
--- /dev/null
+++ b/runtime/macros/maze/Makefile
@@ -0,0 +1,7 @@
+# It's simple...
+
+maze: mazeansi.c
+ cc -o maze mazeansi.c
+
+mazeclean: mazeclean.c
+ cc -o mazeclean mazeclean.c
diff --git a/runtime/macros/maze/README.txt b/runtime/macros/maze/README.txt
new file mode 100644
index 000000000..be8e8ef20
--- /dev/null
+++ b/runtime/macros/maze/README.txt
@@ -0,0 +1,49 @@
+To run the maze macros with Vim:
+
+ vim -u maze_mac maze_5.78
+ press "g"
+
+The "-u maze.mac" loads the maze macros and skips loading your .vimrc, which
+may contain settings and mappings that get in the way.
+
+
+The original README:
+
+To prove that you can do anything in vi, I wrote a couple of macros that
+allows vi to solve mazes. It will solve any maze produced by maze.c
+that was posted to the net recently.
+
+Just follow this recipe and SEE FOR YOURSELF.
+ 1. run uudecode on the file "maze.vi.macros.uu" to
+ produce the file "maze.vi.macros"
+ (If you can't wait to see the action, jump to step 4)
+ 2. compile maze.c with "cc -o maze maze.c"
+ 3. run maze > maze.out and input a small number (for example 10 if
+ you are on a fast machine, 3-5 if slow) which
+ is the size of the maze to produce
+ 4. edit the maze (vi maze.out)
+ 5. include the macros with the vi command:
+ :so maze.vi.macros
+ 6. type the letter "g" (for "go") and watch vi solve the maze
+ 7. when vi solves the maze, you will see why it lies
+ 8. now look at maze.vi.macros and all will be revealed
+
+Tested on a sparc, a sun and a pyramid (although maze.c will not compile
+on the pyramid).
+
+Anyone who can't get the maze.c file to compile, get a new compiler,
+try maze.ansi.c which was also posted to the net.
+If you can get it to compile but the maze comes out looking like a fence
+and not a maze and you are using SysV or DOS replace the "27" on the
+last line of maze.c by "11"
+Thanks to John Tromp (tromp@piring.cwi.nl) for maze.c.
+Thanks to antonyc@nntp-server.caltech.edu (Bill T. Cat) for maze.ansi.c.
+
+Any donations should be in unmarked small denomination bills :^)=.
+
+ ACSnet: gregm@otc.otca.oz.au
+Greg McFarlane UUCP: {uunet,mcvax}!otc.otca.oz.au!gregm
+|||| OTC || Snail: OTC R&D GPO Box 7000, Sydney 2001, Australia
+ Phone: +61 2 287 3139 Fax: +61 2 287 3299
+
+
diff --git a/runtime/macros/maze/README.txt.info b/runtime/macros/maze/README.txt.info
new file mode 100644
index 000000000..263ddcd2c
--- /dev/null
+++ b/runtime/macros/maze/README.txt.info
Binary files differ
diff --git a/runtime/macros/maze/main.aap b/runtime/macros/maze/main.aap
new file mode 100644
index 000000000..ee9af21de
--- /dev/null
+++ b/runtime/macros/maze/main.aap
@@ -0,0 +1,4 @@
+# Aap recipe to build the maze program
+:program maze : mazeansi.c
+
+:program mazeclean : mazeclean.c
diff --git a/runtime/macros/maze/maze.c b/runtime/macros/maze/maze.c
new file mode 100644
index 000000000..b91745311
--- /dev/null
+++ b/runtime/macros/maze/maze.c
@@ -0,0 +1,7 @@
+char*M,A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(M="%d",&C);
+-- E; J[ E] =T
+[E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
+) , A = 39 ,C --
+) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C
+& A == T[ A]
+|6<<27<rand()||!C&!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z]=A,"_.":" |"];}
diff --git a/runtime/macros/maze/maze_5.78 b/runtime/macros/maze/maze_5.78
new file mode 100644
index 000000000..dbe3d278b
--- /dev/null
+++ b/runtime/macros/maze/maze_5.78
@@ -0,0 +1,16 @@
+._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
+| ._| . . ._| | |_._._. . ._|_._._._._. ._|_. ._|_._. ._| . ._|_. | . ._._. |
+| ._|_| |_. | | | | ._._|_._|_._. . |_. | | | ._._| |_._._| | ._. ._| . . |_|
+|_._._._. | ._|_. ._._._. | | ._. |_._. . | ._._| |_. | ._._._. |_. | |_|_| |
+| | . |_._| . ._._._| ._._. ._._| | | |_| . | |_. . ._|_| ._._. |_._|_| . | |
+|_._|_._._._|_._._._|_|_._._._|_._|_._._._|_._._._|_._._._|_._._._._._._|_._|
+
+See Vim solve a maze!
+
+ type ":so maze_mac<RETURN>" to load the macros
+
+ type "g" to start
+
+to interrupt type "<CTRL-C>"
+ to quit type ":q!<RETURN>"
+
diff --git a/runtime/macros/maze/maze_5.78.info b/runtime/macros/maze/maze_5.78.info
new file mode 100644
index 000000000..fd65cef72
--- /dev/null
+++ b/runtime/macros/maze/maze_5.78.info
Binary files differ
diff --git a/runtime/macros/maze/maze_mac b/runtime/macros/maze/maze_mac
new file mode 100644
index 000000000..621aeec2b
--- /dev/null
+++ b/runtime/macros/maze/maze_mac
@@ -0,0 +1,271 @@
+" These macros 'solve' any maze produced by the a-maze-ing maze.c program.
+"
+" First, a bit of maze theory.
+" If you were put into a maze, a guaranteed method of finding your way
+" out of the maze is to put your left hand onto a wall and just keep walking,
+" never taking your hand off the wall. This technique is only guaranteed to
+" work if the maze does not have any 'islands', or if the 'exit' is on the
+" same island as your starting point. These conditions hold for the mazes
+" under consideration.
+"
+" Assuming that the maze is made up of horizontal and vertical walls spaced
+" one step apart and that you can move either north, south, east or west,
+" then you can automate this procedure by carrying out the following steps.
+"
+" 1. Put yourself somewhere in the maze near a wall.
+" 2. Check if you have a wall on your left. If so, go to step 4.
+" 3. There is no wall on your left, so turn on the spot to your left and step
+" forward by one step and repeat step 2.
+" 4. Check what is directly in front of you. If it is a wall, turn on the
+" spot to your right by 90 degrees and repeat step 4.
+" 5. There is no wall in front of you, so step forward one step and
+" go to step 2.
+"
+" In this way you will cover all the corridors of the maze (until you get back
+" to where you started from, if you do not stop).
+"
+" By examining a maze produced by the maze.c program you will see that
+" each square of the maze is one character high and two characters wide.
+" To go north or south, you move by a one character step, but to move east or
+" west you move by a two character step. Also note that in any position
+" there are four places where walls could be put - to the north, to the south,
+" to the east and to the west.
+" A wall exists to the north of you if the character to the north of
+" you is a _ (otherwise it is a space).
+" A wall exists to the east of you if the character to the east of you
+" is a | (otherwise it is a .).
+" A wall exists to the west of you if the character to the west of you
+" is a | (otherwise it is a .).
+" A wall exists to the south of you if the character where you are
+" is a _ (otherwise it is a space).
+"
+" Note the difference for direction south, where we must examine the character
+" where the cursor is rather than an adjacent cell.
+"
+" If you were implementing the above procedure is a normal computer language
+" you could use a loop with if statements and continue statements,
+" However, these constructs are not available in vi macros so I have used
+" a state machine with 8 states. Each state signifies the direction you
+" are going in and whether or not you have checked if there is a wall on
+" your left.
+"
+" The transition from state to state and the actions taken on each transition
+" are given in the state table below.
+" The names of the states are N1, N2, S1, S2, E1, E2, W1, W2, where each letter
+" stands for a direction of the compass, the number 1 indicates that the we
+" have not yet checked to see if there is a wall on our left and the number 2
+" indicates that we have checked and there is a wall on our left.
+"
+" For each state we must consider the existence or not of a wall in a
+" particular direction. This direction is given in the following table.
+"
+" NextChar table:
+" state direction vi commands
+" N1 W hF
+" N2 N kF
+" S1 E lF
+" S2 S F
+" E1 N kF
+" E2 E lF
+" W1 S F
+" W2 W hF
+"
+" where F is a macro which yanks the character under the cursor into
+" the NextChar register (n).
+"
+" State table:
+" In the 'vi commands' column is given the actions to carry out when in
+" this state and the NextChar is as given. The commands k, j, ll, hh move
+" the current position north, south, east and west respectively. The
+" command mm is used as a no-op command.
+" In the 'next state' column is given the new state of the machine after
+" the action is carried out.
+"
+" current state NextChar vi commands next state
+" N1 . hh W1
+" N1 | mm N2
+" N2 _ mm E1
+" N2 space k N1
+" S1 . ll E1
+" S1 | mm S2
+" S2 _ mm W1
+" S2 space j S1
+" E1 space k N1
+" E1 _ mm E2
+" E2 | mm S1
+" E2 . ll E1
+" W1 space j S1
+" W1 _ mm W2
+" W2 | mm N1
+" W2 . hh W1
+"
+"
+" Complaint about vi macros:
+" It seems that you cannot have more than one 'undo-able' vi command
+" in the one macro, so you have to make lots of little macros and
+" put them together.
+"
+" I'll explain what I mean by an example. Edit a file and
+" type ':map Q rXY'. This should map the Q key to 'replace the
+" character under the cursor with X and yank the line'.
+" But when I type Q, vi tells me 'Can't yank inside global/macro' and
+" goes into ex mode. However if I type ':map Q rXT' and ':map T Y',
+" everything is OK. I`m doing all this on a Sparcstation.
+" If anyone reading this has an answer to this problem, the author would
+" love to find out. Mail to gregm@otc.otca.oz.au.
+"
+" The macros:
+" The macro to run the maze solver is 'g'. This simply calls two other
+" macros: I, to initialise everything, and L, to loop forever running
+" through the state table.
+" Both of these macros are long sequences of calls to other macros. All
+" of these other macros are quite simple and so to understand how this
+" works, all you need to do is examine macros I and L and learn what they
+" do (a simple sequence of vi actions) and how L loops (by calling U, which
+" simply calls L again).
+"
+" Macro I sets up the state table and NextChar table at the end of the file.
+" Macro L then searches these tables to find out what actions to perform and
+" what state changes to make.
+"
+" The entries in the state table all begin with a key consisting of the
+" letter 's', the current state and the NextChar. After this is the
+" action to take in this state and after this is the next state to change to.
+"
+" The entries in the NextChar table begin with a key consisting of the
+" letter 'n' and the current state. After this is the action to take to
+" obtain NextChar - the character that must be examined to change state.
+"
+" One way to see what each part of the macros is doing is to type in the
+" body of the macros I and L manually (instead of typing 'g') and see
+" what happens at each step.
+"
+" Good luck.
+"
+" Registers used by the macros:
+" s (State) - holds the state the machine is in
+" c (Char) - holds the character under the current position
+" m (Macro) - holds a vi command string to be executed later
+" n (NextChar) - holds the character we must examine to change state
+" r (Second Macro) - holds a second vi command string to be executed later
+"
+set remap
+set nomagic
+set noterse
+set wrapscan
+"
+"================================================================
+" g - go runs the whole show
+" I - initialise
+" L - then loop forever
+map g IL
+"
+"================================================================
+" I - initialise everything before running the loop
+" G$?.^M - find the last . in the maze
+" ^ - replace it with an X (the goal)
+" GYKeDP - print the state table and next char table at the end of the file
+" 0S - initialise the state of the machine to E1
+" 2Gl - move to the top left cell of the maze
+map I G$?. ^GYKeDP0S2Gl
+"
+"================================================================
+" L - the loop which is executed forever
+" Q - save the current character in the Char register
+" A - replace the current character with an 'O'
+" ma - mark the current position with mark 'a'
+" GNB - on bottom line, create a command to search the NextChar table
+" for the current state
+" 0M0E@m^M - yank the command into the Macro register and execute it
+" wX - we have now found the entry in the table, now yank the
+" following word into the Macro register
+" `a@m - go back to the current position and execute the macro, this will
+" yank the NextChar in register n
+" GT$B$R - on bottom line, create a command to search the state table
+" for the current state and NextChar
+" 0M0E@m^M - yank the command into the Macro register and execute it
+" 2WS - we have now found the entry in the table, now yank the
+" next state into the State macro
+" bX - and yank the action corresponding to this state table entry
+" into the Macro register
+" GVJ - on bottom line, create a command to restore the current character
+" 0H - and save the command into the second Macro register
+" `a@r - go back to the current position and exectute the macro to restore
+" the current character
+" @m - execute the action associated with this state
+" U - and repeat
+map L QAmaGNB0M0E@m wX`a@mGT$B$R0M0E@m 2WSbXGVJ0H`a@r@mU
+"
+"================================================================
+" U - no tail recursion allowed in vi macros so cheat and set U = L
+map U L
+"
+"================================================================
+" S - yank the next two characters into the State register
+map S "sy2l
+"
+"================================================================
+" Q - save the current character in the Char register
+map Q "cyl
+"
+"================================================================
+" A - replace the current character with an 'O'
+map A rO
+"
+"================================================================
+" N - replace this line with the string 'n'
+map N C/n
+"
+"================================================================
+" B - put the current state
+map B "sp
+"
+"================================================================
+" M - yank this line into the Macro register
+map M "my$
+"
+"================================================================
+" E - delete to the end of the line
+map E d$
+"
+"================================================================
+" X - yank this word into the Macro register
+map X "myt
+"
+"================================================================
+" T - replace this line with the string 's'
+map T C/s
+"
+"================================================================
+" R - put NextChar
+map R "np
+"
+"================================================================
+" V - add the letter 'r' (the replace vi command)
+map V ar
+"
+"================================================================
+" J - restore the current character
+map J "cp
+"
+"================================================================
+" H - yank this line into the second Macro register
+map H "ry$
+"
+"================================================================
+" F - yank NextChar (this macro is called from the Macro register)
+map F "nyl
+"
+"================================================================
+" ^ - replace the current character with an 'X'
+map ^ rX
+"
+"================================================================
+" YKeDP - create the state table, NextChar table and initial state
+" Note that you have to escape the bar character, since it is special to
+" the map command (it indicates a new line).
+map Y osE1 k N1 sE1_ mm E2 sE2| mm S1 sE2. ll E1
+map K osW1 j S1 sW1_ mm W2 sW2| mm N1 sW2. hh W1
+map e osN1. hh W1 sN1| mm N2 sN2 k N1 sN2_ mm E1
+map D osS1. ll E1 sS1| mm S2 sS2 j S1 sS2_ mm W1
+map P onE1 kF nE2 lF nW1 G$JF nW2 hF nN1 hF nN2 kF nS1 lF nS2 G$JF E1
diff --git a/runtime/macros/maze/mazeansi.c b/runtime/macros/maze/mazeansi.c
new file mode 100644
index 000000000..b8e5e796c
--- /dev/null
+++ b/runtime/macros/maze/mazeansi.c
@@ -0,0 +1,7 @@
+char*M,A,Z,E=40,J[80],T[3];main(C){for(M=J+E,*J=A=scanf("%d",&
+C) ;-- E;J [E ]=M
+[E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
+) , A = 39 ,C --
+) ; Z || printf (T ))T[Z]=Z[A-(E =A[J-Z])&&!C
+& A == M[ A]
+|6<<27<rand()||!C&!Z?J[M[E]=M[A]]=E,J[M[A]=A-Z]=A,"_.":" |"];}
diff --git a/runtime/macros/maze/mazeclean.c b/runtime/macros/maze/mazeclean.c
new file mode 100644
index 000000000..04dcebd22
--- /dev/null
+++ b/runtime/macros/maze/mazeclean.c
@@ -0,0 +1,22 @@
+/*
+ * Cleaned-up version of the maze program.
+ * Doesn't look as nice, but should work with all C compilers.
+ * Sascha Wilde, October 2003
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+char *M, A, Z, E = 40, line[80], T[3];
+int
+main (C)
+{
+ for (M = line + E, *line = A = scanf ("%d", &C); --E; line[E] = M[E] = E)
+ printf ("._");
+ for (; (A -= Z = !Z) || (printf ("\n|"), A = 39, C--); Z || printf (T))
+ T[Z] = Z[A - (E = A[line - Z]) && !C
+ & A == M[A]
+ | RAND_MAX/3 < rand ()
+ || !C & !Z ? line[M[E] = M[A]] = E, line[M[A] = A - Z] =
+ A, "_." : " |"];
+ return 0;
+}
diff --git a/runtime/macros/maze/poster b/runtime/macros/maze/poster
new file mode 100644
index 000000000..9114f598d
--- /dev/null
+++ b/runtime/macros/maze/poster
@@ -0,0 +1,37 @@
+Article 2846 of alt.sources:
+Path: oce-rd1!hp4nl!mcsun!uunet!munnari.oz.au!metro!otc!gregm
+From: gregm@otc.otca.oz.au (Greg McFarlane)
+Newsgroups: alt.sources
+Subject: VI SOLVES MAZE (commented macros)
+Message-ID: <2289@otc.otca.oz>
+Date: 10 Feb 91 23:31:02 GMT
+Sender: news@otc.otca.oz
+Reply-To: gregm@otc.otca.oz.au (Greg McFarlane)
+Organization: OTC Development Unit, Australia
+Lines: 464
+
+Submitted-by: gregm@otc.otca.oz.au
+Archive-name: maze_solving_vi_macros
+
+A real working model. See it walk the maze in front of your very own eyes.
+
+To prove that you can do anything in vi, I wrote a couple of macros that
+allows vi to solve mazes. It will solve any maze produced by maze.c
+that was posted to the alt.sources last month. (Maze.c is also included
+in this posting as well as an example of its output.)
+
+The uncommented version of the macros was sent to alt.sources last month.
+However, so many people mailed me requesting the commented version of the
+macros that I decided to post it. I have made some modifications to the
+original macros to make them easier to follow and also after I learnt
+that you can escape the special meaning of '|' in macros by using '^V|'.
+
+Save this article and unshar it. Then read maze.README.
+
+After studying these macros, anyone who cannot write an emacs emulator
+in vi macros should just curl up and :q!.
+
+Coming soon to a newsgroup near you: "Vi macros solve Tower of Hanoi",
+and a repost of the original "Turing Machine implemented in Vi macros"
+
+Anyone who has a version of these macros for edlin or nroff, please post.
diff --git a/runtime/macros/maze/poster.info b/runtime/macros/maze/poster.info
new file mode 100644
index 000000000..9a478d6a6
--- /dev/null
+++ b/runtime/macros/maze/poster.info
Binary files differ
diff --git a/runtime/macros/shellmenu.vim b/runtime/macros/shellmenu.vim
new file mode 100644
index 000000000..6175d1d9a
--- /dev/null
+++ b/runtime/macros/shellmenu.vim
@@ -0,0 +1,94 @@
+" When you're writing shell scripts and you are in doubt which test to use,
+" which shell environment variables are defined, what the syntax of the case
+" statement is, and you need to invoke 'man sh'?
+"
+" Your problems are over now!
+"
+" Attached is a Vim script file for turning gvim into a shell script editor.
+" It may also be used as an example how to use menus in Vim.
+"
+" Written by: Lennart Schultz <les@dmi.min.dk>
+
+imenu Stmts.for for in do doneki kk0elli
+imenu Stmts.case case in ) ;; esacbki k0elli
+imenu Stmts.if if then fiki kk0elli
+imenu Stmts.if-else if then else fiki kki kk0elli
+imenu Stmts.elif elif then ki kk0elli
+imenu Stmts.while while do doneki kk0elli
+imenu Stmts.break break
+imenu Stmts.continue continue
+imenu Stmts.function () { }ki k0i
+imenu Stmts.return return
+imenu Stmts.return-true return 0
+imenu Stmts.return-false return 1
+imenu Stmts.exit exit
+imenu Stmts.shift shift
+imenu Stmts.trap trap
+imenu Test.existence [ -e ]hi
+imenu Test.existence - file [ -f ]hi
+imenu Test.existence - file (not empty) [ -s ]hi
+imenu Test.existence - directory [ -d ]hi
+imenu Test.existence - executable [ -x ]hi
+imenu Test.existence - readable [ -r ]hi
+imenu Test.existence - writable [ -w ]hi
+imenu Test.String is empty [ x = "x$" ]hhi
+imenu Test.String is not empty [ x != "x$" ]hhi
+imenu Test.Strings is equal [ "" = "" ]hhhhhhhi
+imenu Test.Strings is not equal [ "" != "" ]hhhhhhhhi
+imenu Test.Values is greater than [ -gt ]hhhhhhi
+imenu Test.Values is greater equal [ -ge ]hhhhhhi
+imenu Test.Values is equal [ -eq ]hhhhhhi
+imenu Test.Values is not equal [ -ne ]hhhhhhi
+imenu Test.Values is less than [ -lt ]hhhhhhi
+imenu Test.Values is less equal [ -le ]hhhhhhi
+imenu ParmSub.Substitute word if parm not set ${:-}hhi
+imenu ParmSub.Set parm to word if not set ${:=}hhi
+imenu ParmSub.Substitute word if parm set else nothing ${:+}hhi
+imenu ParmSub.If parm not set print word and exit ${:?}hhi
+imenu SpShVars.Number of positional parameters ${#}
+imenu SpShVars.All positional parameters (quoted spaces) ${*}
+imenu SpShVars.All positional parameters (unquoted spaces) ${@}
+imenu SpShVars.Flags set ${-}
+imenu SpShVars.Return code of last command ${?}
+imenu SpShVars.Process number of this shell ${$}
+imenu SpShVars.Process number of last background command ${!}
+imenu Environ.HOME ${HOME}
+imenu Environ.PATH ${PATH}
+imenu Environ.CDPATH ${CDPATH}
+imenu Environ.MAIL ${MAIL}
+imenu Environ.MAILCHECK ${MAILCHECK}
+imenu Environ.PS1 ${PS1}
+imenu Environ.PS2 ${PS2}
+imenu Environ.IFS ${IFS}
+imenu Environ.SHACCT ${SHACCT}
+imenu Environ.SHELL ${SHELL}
+imenu Environ.LC_CTYPE ${LC_CTYPE}
+imenu Environ.LC_MESSAGES ${LC_MESSAGES}
+imenu Builtins.cd cd
+imenu Builtins.echo echo
+imenu Builtins.eval eval
+imenu Builtins.exec exec
+imenu Builtins.export export
+imenu Builtins.getopts getopts
+imenu Builtins.hash hash
+imenu Builtins.newgrp newgrp
+imenu Builtins.pwd pwd
+imenu Builtins.read read
+imenu Builtins.readonly readonly
+imenu Builtins.return return
+imenu Builtins.times times
+imenu Builtins.type type
+imenu Builtins.umask umask
+imenu Builtins.wait wait
+imenu Set.set set
+imenu Set.unset unset
+imenu Set.mark modified or modified variables set -a
+imenu Set.exit when command returns non-zero exit code set -e
+imenu Set.Disable file name generation set -f
+imenu Set.remember function commands set -h
+imenu Set.All keyword arguments are placed in the environment set -k
+imenu Set.Read commands but do not execute them set -n
+imenu Set.Exit after reading and executing one command set -t
+imenu Set.Treat unset variables as an error when substituting set -u
+imenu Set.Print shell input lines as they are read set -v
+imenu Set.Print commands and their arguments as they are executed set -x
diff --git a/runtime/macros/swapmous.vim b/runtime/macros/swapmous.vim
new file mode 100644
index 000000000..8b85be050
--- /dev/null
+++ b/runtime/macros/swapmous.vim
@@ -0,0 +1,22 @@
+" These macros swap the left and right mouse buttons (for left handed)
+" Don't forget to do ":set mouse=a" or the mouse won't work at all
+noremap <LeftMouse> <RightMouse>
+noremap <2-LeftMouse> <2-RightMouse>
+noremap <3-LeftMouse> <3-RightMouse>
+noremap <4-LeftMouse> <4-RightMouse>
+noremap <LeftDrag> <RightDrag>
+noremap <LeftRelease> <RightRelease>
+noremap <RightMouse> <LeftMouse>
+noremap <2-RightMouse> <2-LeftMouse>
+noremap <3-RightMouse> <3-LeftMouse>
+noremap <4-RightMouse> <4-LeftMouse>
+noremap <RightDrag> <LeftDrag>
+noremap <RightRelease> <LeftRelease>
+noremap g<LeftMouse> <C-RightMouse>
+noremap g<RightMouse> <C-LeftMouse>
+noremap! <LeftMouse> <RightMouse>
+noremap! <LeftDrag> <RightDrag>
+noremap! <LeftRelease> <RightRelease>
+noremap! <RightMouse> <LeftMouse>
+noremap! <RightDrag> <LeftDrag>
+noremap! <RightRelease> <LeftRelease>
diff --git a/runtime/macros/urm.info b/runtime/macros/urm.info
new file mode 100644
index 000000000..65e82348e
--- /dev/null
+++ b/runtime/macros/urm.info
Binary files differ
diff --git a/runtime/macros/urm/README.txt b/runtime/macros/urm/README.txt
new file mode 100644
index 000000000..a1ecc658c
--- /dev/null
+++ b/runtime/macros/urm/README.txt
@@ -0,0 +1,47 @@
+This is another proof that Vim is perfectly compatible with Vi.
+The URM macro package was written by Rudolf Koenig ("Rudi")
+(rudolf@koeniglich.de) for hpux-vi in August 1991.
+
+Getting started:
+
+type
+in your shell: vim urm<RETURN>
+in vim: :so urm.vim<RETURN>
+in vim: * (to load the registers and boot the URM-machine :-)
+in vim: g (for 'go') and watch the fun. Per default, 3 and 4
+ are multiplied. Watch the Program counter, it is
+ visible as a komma moving around.
+
+This is a "standard URM" (Universal register machine) interpreter. The URM
+concept is used in theoretical computer science to aid in theorem proving.
+Here it proves that vim is a general problem solver (if you bring enough
+patience).
+
+The interpreter begins with register 1 (not 0), without macros and more-lines
+capability. A dot marks the end of a program. (Bug: there must be a space
+after the dot.)
+
+The registers are the first few lines, beginning with a '>' .
+The program is the first line after the registers.
+You should always initialize the registers required by the program.
+
+Output register: line 2
+Input registers: line 2 to ...
+
+Commands:
+a<n> increment register <n>
+s<n> decrement register <n>
+<x>;<y> execute command <x> and then <y>
+(<x>)<n> execute command <x> while register <n> is nonzero
+. ("dot blank") halt the machine.
+
+Examples:
+
+Add register 2 to register 3:
+ (a2;s3)3.
+Multiply register 2 with register 3:
+ (a4;a5;s2)2; ((a2;s4)4; s3; (a1;a4;s5)5; (a5;s1)1)3.
+
+There are more (complicated) examples in the file examples.
+Note, undo may take a while after a division.
+
diff --git a/runtime/macros/urm/README.txt.info b/runtime/macros/urm/README.txt.info
new file mode 100644
index 000000000..1337937c9
--- /dev/null
+++ b/runtime/macros/urm/README.txt.info
Binary files differ
diff --git a/runtime/macros/urm/examples b/runtime/macros/urm/examples
new file mode 100644
index 000000000..9907d4aef
--- /dev/null
+++ b/runtime/macros/urm/examples
@@ -0,0 +1,16 @@
+Note that enough temporary registers should be provided for each example.
+All should be initialised to 0.
+
+Initial register values for benchmarking: 0,8,3,0,...
+
+Performed on a Xenix 386/16:
+Operation [sec, kbyte tmp space]: program
+
+Asym. Diff.[ 7, 4]: (s2;s3)3.
+Abs. Diff. [90,81]: (a1;a4;s2)2; (a2;s1)1; (a1;a5;s3)3; (a3;s1)1; (s2;s3)3; (s5;s4)4; (a2;s5)5.
+Add [ 7, 4]: (a2;s3)3.
+Mult [227, 161]: (a4;a5;s2)2; ((a2;s4)4; s3; (a1;a4;s5)5; (a5;s1)1)3.
+Copy [ 48, 25]: (a1;a3;s2)2; (a2;s1)1.
+sign [ 30, 17]: (a3;s2)2; (a2;(s3)3)3.
+!sign[ 36, 28]: (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3.
+Div [630,1522]: (a9;s2)2; (a2;a10;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a2)2;(a2;s9)9;(a3;s10)10; (a9;a10;s2)2; (a11;a12;s3)3; (a2;s12)12; (a3;s9)9; (s2;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a1;s2)2; (a2;s10)10; (a3;s11)11; ((a12;a13;s3)3; (a3;s13)13; (s2;s3)3; (a3;s12)12; a14; (s1)1; (a9;a10;s2)2; (a11;a12;s3)3; (a2;s12)12; (a3;s9)9; (s2;s3)3; (a3;s2)2; (a2;(s3)3)3; a3; (s3;s2)2; (s3;a2)3; (a1;s2)2; (a2;s10)10; (a3;s11)11)1; (s2)2; (a2;s14)14.
diff --git a/runtime/macros/urm/urm b/runtime/macros/urm/urm
new file mode 100644
index 000000000..9cbefb70a
--- /dev/null
+++ b/runtime/macros/urm/urm
@@ -0,0 +1,22 @@
+>0
+>3
+>4
+>0
+>0
+>0
+(a4;a5;s2)2; ((a2;s4)4; s3; (a1;a4;s5)5; (a5;s1)1)3.
+_________
+O ; =xp ( =x%hp ) @l a @db s @dt . =x0xkdd:ready _end_
+o 0 1 2 3 4 5 6 7 8 9 0
+_________
+INIT main(k), l, b, c, t, u, q, d
+ "kT "lT "bT "cT "tT "uT "qT "dT
+=lF'wa/O fpaw"zdt hp@z0"xD@x@k
+=2ldwhp'wiGT'wp0P0"yD@ya =xlwP >0 =x%p I k/>0 ww"ydt 0D@y
+'wa/o fwF'wpi`ar`aF'wffp0"vD@v0"vDp03x@v'wa @c 0 0 0I f0w"wdt 0D@w
+`ahmaF'wa 'aa1 > @b 0p0f>w"vdt 0D@v
+'wa/o wfbF'wpi`ar`aF'wffp0"vD@v0"vDp03x@v'wa @u 9 0 0I f9w"wdt 0D@w
+`ahmaF'wa `alr0 > @q 0p0f>w"vdt 0D@v
+`ahy2l'wa `ax >1 @t 0p0/>1 ww"idt 0D@i
+=xwhpbldwhp'wpaG$ma0"yD@y@
+
diff --git a/runtime/macros/urm/urm.vim b/runtime/macros/urm/urm.vim
new file mode 100644
index 000000000..310818078
--- /dev/null
+++ b/runtime/macros/urm/urm.vim
@@ -0,0 +1,5 @@
+map * 1G/INIT j"iT@i1G/INIT dG
+map g 1G/^[(as;.] i >,mkkmw@k
+map T y$
+map F yl
+map = 'kf,
diff --git a/runtime/makemenu.vim b/runtime/makemenu.vim
new file mode 100644
index 000000000..690c49485
--- /dev/null
+++ b/runtime/makemenu.vim
@@ -0,0 +1,468 @@
+" Script to define the syntax menu in synmenu.vim
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 May 22
+
+" This is used by "make menu" in the src directory.
+edit <sfile>:p:h/synmenu.vim
+
+/The Start Of The Syntax Menu/+1,/The End Of The Syntax Menu/-1d
+let s:lnum = line(".") - 1
+call append(s:lnum, "")
+let s:lnum = s:lnum + 1
+
+" Use the SynMenu command and function to define all menu entries
+command! -nargs=* SynMenu call <SID>Syn(<q-args>)
+
+let s:cur_menu_name = ""
+let s:cur_menu_nr = 0
+let s:cur_menu_item = 0
+let s:cur_menu_char = ""
+
+fun! <SID>Syn(arg)
+ " isolate menu name: until the first dot
+ let i = match(a:arg, '\.')
+ let menu_name = strpart(a:arg, 0, i)
+ let r = strpart(a:arg, i + 1, 999)
+ " isolate submenu name: until the colon
+ let i = match(r, ":")
+ let submenu_name = strpart(r, 0, i)
+ " after the colon is the syntax name
+ let syntax_name = strpart(r, i + 1, 999)
+
+ if s:cur_menu_name != menu_name
+ let s:cur_menu_name = menu_name
+ let s:cur_menu_nr = s:cur_menu_nr + 10
+ let s:cur_menu_item = 100
+ let s:cur_menu_char = submenu_name[0]
+ else
+ " When starting a new letter, insert a menu separator.
+ let c = submenu_name[0]
+ if c != s:cur_menu_char
+ exe 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' &Syntax.' . menu_name . ".-" . c . '- <nul>'
+ let s:cur_menu_item = s:cur_menu_item + 10
+ let s:cur_menu_char = c
+ endif
+ endif
+ call append(s:lnum, 'an 50.' . s:cur_menu_nr . '.' . s:cur_menu_item . ' &Syntax.' . menu_name . "." . submenu_name . ' :cal SetSyn("' . syntax_name . '")<CR>')
+ let s:cur_menu_item = s:cur_menu_item + 10
+ let s:lnum = s:lnum + 1
+endfun
+
+SynMenu AB.Aap:aap
+SynMenu AB.Abaqus:abaqus
+SynMenu AB.ABC\ music\ notation:abc
+SynMenu AB.ABEL:abel
+SynMenu AB.AceDB\ model:acedb
+SynMenu AB.Ada:ada
+SynMenu AB.AfLex:aflex
+SynMenu AB.Altera\ AHDL:ahdl
+SynMenu AB.Amiga\ DOS:amiga
+SynMenu AB.AMPL:ampl
+SynMenu AB.Ant\ build\ file:ant
+SynMenu AB.ANTLR:antlr
+SynMenu AB.Apache\ config:apache
+SynMenu AB.Apache-style\ config:apachestyle
+SynMenu AB.Applix\ ELF:elf
+SynMenu AB.Arc\ Macro\ Language:aml
+SynMenu AB.Arch\ inventory:arch
+SynMenu AB.ART:art
+SynMenu AB.ASP\ with\ VBScript:aspvbs
+SynMenu AB.ASP\ with\ Perl:aspperl
+SynMenu AB.Assembly.680x0:asm68k
+SynMenu AB.Assembly.Flat:fasm
+SynMenu AB.Assembly.GNU:asm
+SynMenu AB.Assembly.GNU\ H-8300:asmh8300
+SynMenu AB.Assembly.Intel\ IA-64:ia64
+SynMenu AB.Assembly.Microsoft:masm
+SynMenu AB.Assembly.Netwide:nasm
+SynMenu AB.Assembly.PIC:pic
+SynMenu AB.Assembly.Turbo:tasm
+SynMenu AB.Assembly.VAX\ Macro\ Assembly:vmasm
+SynMenu AB.Assembly.Z-80:z8a
+SynMenu AB.Assembly.xa\ 6502\ cross\ assember:a65
+SynMenu AB.ASN\.1:asn
+SynMenu AB.Atlas:atlas
+SynMenu AB.Automake:automake
+SynMenu AB.Avenue:ave
+SynMenu AB.Awk:awk
+SynMenu AB.AYacc:ayacc
+
+SynMenu AB.B:b
+SynMenu AB.Baan:baan
+SynMenu AB.BASIC:basic
+SynMenu AB.BC\ calculator:bc
+SynMenu AB.BDF\ font:bdf
+SynMenu AB.BibTeX:bib
+SynMenu AB.BIND.BIND\ config:named
+SynMenu AB.BIND.BIND\ zone:bindzone
+SynMenu AB.Blank:blank
+
+SynMenu C.C:c
+SynMenu C.C++:cpp
+SynMenu C.C#:cs
+SynMenu C.Calendar:calendar
+SynMenu C.CDL:cdl
+SynMenu C.Crontab:crontab
+SynMenu C.Cyn++:cynpp
+SynMenu C.Cynlib:cynlib
+SynMenu C.Cascading\ Style\ Sheets:css
+SynMenu C.Century\ Term:cterm
+SynMenu C.CH\ script:ch
+SynMenu C.ChangeLog:changelog
+SynMenu C.Cheetah\ template:cheetah
+SynMenu C.CHILL:chill
+SynMenu C.Clean:clean
+SynMenu C.Clever:cl
+SynMenu C.Clipper:clipper
+SynMenu C.Cold\ Fusion:cf
+SynMenu C.Config.Cfg\ Config\ file:cfg
+SynMenu C.Config.Generic\ Config\ file:conf
+SynMenu C.Config.Configure\.in:config
+SynMenu C.CRM114:crm
+SynMenu C.Ctrl-H:ctrlh
+SynMenu C.Cobol:cobol
+SynMenu C.CSP:csp
+SynMenu C.CUPL.CUPL:cupl
+SynMenu C.CUPL.Simulation:cuplsim
+SynMenu C.CVS.commit\ file:cvs
+SynMenu C.CVS.cvsrc:cvsrc
+
+SynMenu DE.D:d
+SynMenu DE.Debian.Debian\ ChangeLog:debchangelog
+SynMenu DE.Debian.Debian\ Control:debcontrol
+SynMenu DE.Desktop:desktop
+SynMenu DE.Diff:diff
+SynMenu DE.Digital\ Command\ Lang:dcl
+SynMenu DE.Dircolors:dircolors
+SynMenu DE.DNS/BIND\ zone:dns
+SynMenu DE.DocBook.auto-detect:docbk
+SynMenu DE.DocBook.SGML:docbksgml
+SynMenu DE.DocBook.XML:docbkxml
+SynMenu DE.Dot:dot
+SynMenu DE.Dracula:dracula
+SynMenu DE.DSSSL:dsl
+SynMenu DE.DTD:dtd
+SynMenu DE.DTML\ (Zope):dtml
+SynMenu DE.Dylan.Dylan:dylan
+SynMenu DE.Dylan.Dylan\ interface:dylanintr
+SynMenu DE.Dylan.Dylan\ lid:dylanlid
+
+SynMenu DE.EDIF:edif
+SynMenu DE.Eiffel:eiffel
+SynMenu DE.Elinks\ config:elinks
+SynMenu DE.Elm\ filter\ rules:elmfilt
+SynMenu DE.Embedix\ Component\ Description:ecd
+SynMenu DE.ERicsson\ LANGuage:erlang
+SynMenu DE.ESQL-C:esqlc
+SynMenu DE.Essbase\ script:csc
+SynMenu DE.Eterm\ config:eterm
+SynMenu DE.Exim\ conf:exim
+SynMenu DE.Expect:expect
+SynMenu DE.Exports:exports
+
+SynMenu FG.Fetchmail:fetchmail
+SynMenu FG.Focus\ Executable:focexec
+SynMenu FG.Focus\ Master:master
+SynMenu FG.FORM:form
+SynMenu FG.Forth:forth
+SynMenu FG.Fortran:fortran
+SynMenu FG.FoxPro:foxpro
+SynMenu FG.Fstab:fstab
+SynMenu FG.Fvwm.Fvwm\ configuration:fvwm1
+SynMenu FG.Fvwm.Fvwm2\ configuration:fvwm2
+SynMenu FG.Fvwm.Fvwm2\ configuration\ with\ M4:fvwm2m4
+
+SynMenu FG.GDB\ command\ file:gdb
+SynMenu FG.GDMO:gdmo
+SynMenu FG.Gedcom:gedcom
+SynMenu FG.Gkrellmrc:gkrellmrc
+SynMenu FG.GP:gp
+SynMenu FG.GPG:gpg
+SynMenu FG.Grub:grub
+SynMenu FG.GNU\ Server\ Pages:gsp
+SynMenu FG.GNUplot:gnuplot
+SynMenu FG.GrADS\ scripts:grads
+SynMenu FG.Groff:groff
+SynMenu FG.GTKrc:gtkrc
+
+SynMenu HIJK.Haskell.Haskell:haskell
+SynMenu HIJK.Haskell.Haskell-c2hs:chaskell
+SynMenu HIJK.Haskell.Haskell-literate:lhaskell
+SynMenu HIJK.Hercules:hercules
+SynMenu HIJK.Hex\ dump.XXD:xxd
+SynMenu HIJK.Hex\ dump.Intel\ MCS51:hex
+SynMenu HIJK.HTML.HTML:html
+SynMenu HIJK.HTML.HTML\ with\ M4:htmlm4
+SynMenu HIJK.HTML.Cheetah\ HTML\ template:htmlcheetah
+SynMenu HIJK.HTML.HTML/OS:htmlos
+SynMenu HIJK.HTML.XHTML:xhtml
+SynMenu HIJK.Hyper\ Builder:hb
+SynMenu HIJK.Icewm\ menu:icemenu
+SynMenu HIJK.Icon:icon
+SynMenu HIJK.IDL\Generic\ IDL:idl
+SynMenu HIJK.IDL\Microsoft\ IDL:msidl
+SynMenu HIJK.Indent\ profile:indent
+SynMenu HIJK.Inform:inform
+SynMenu HIJK.Informix\ 4GL:fgl
+SynMenu HIJK.Inittab:inittab
+SynMenu HIJK.Inno\ setup:iss
+SynMenu HIJK.InstallShield\ script:ishd
+SynMenu HIJK.Interactive\ Data\ Lang:idlang
+SynMenu HIJK.IPfilter:ipfilter
+SynMenu HIJK.JAL:jal
+SynMenu HIJK.JAM:jam
+SynMenu HIJK.Jargon:jargon
+SynMenu HIJK.Java.Java:java
+SynMenu HIJK.Java.JavaCC:javacc
+SynMenu HIJK.Java.Java\ Server\ Pages:jsp
+SynMenu HIJK.Java.Java\ Properties:jproperties
+SynMenu HIJK.JavaScript:javascript
+SynMenu HIJK.Jess:jess
+SynMenu HIJK.Jgraph:jgraph
+SynMenu HIJK.KDE\ script:kscript
+SynMenu HIJK.Kimwitu++:kwt
+SynMenu HIJK.KixTart:kix
+
+SynMenu L-Ma.Lace:lace
+SynMenu L-Ma.LamdaProlog:lprolog
+SynMenu L-Ma.Latte:latte
+SynMenu L-Ma.LDAP\ LDIF:ldif
+SynMenu L-Ma.Lex:lex
+SynMenu L-Ma.LFTP\ config:lftp
+SynMenu L-Ma.Libao:libao
+SynMenu L-Ma.LifeLines\ script:lifelines
+SynMenu L-Ma.Lilo:lilo
+SynMenu L-Ma.Lisp:lisp
+SynMenu L-Ma.Lite:lite
+SynMenu L-Ma.Locale\ Input:fdcc
+SynMenu L-Ma.Logtalk:logtalk
+SynMenu L-Ma.LOTOS:lotos
+SynMenu L-Ma.LotusScript:lscript
+SynMenu L-Ma.Lout:lout
+SynMenu L-Ma.LPC:lpc
+SynMenu L-Ma.Lua:lua
+SynMenu L-Ma.Lynx\ Style:lss
+SynMenu L-Ma.Lynx\ config:lynx
+SynMenu L-Ma.M4:m4
+SynMenu L-Ma.MaGic\ Point:mgp
+SynMenu L-Ma.Mail:mail
+SynMenu L-Ma.Mailcap:mailcap
+SynMenu L-Ma.Makefile:make
+SynMenu L-Ma.MakeIndex:ist
+SynMenu L-Ma.Man\ page:man
+SynMenu L-Ma.Maple\ V:maple
+SynMenu L-Ma.Mason:mason
+SynMenu L-Ma.Mathematica:mma
+SynMenu L-Ma.Matlab:matlab
+
+SynMenu Me-NO.MEL\ (for\ Maya):mel
+SynMenu Me-NO.Metafont:mf
+SynMenu Me-NO.MetaPost:mp
+SynMenu Me-NO.MMIX:mmix
+SynMenu Me-NO.Modconf:modconf
+SynMenu Me-NO.Model:model
+SynMenu Me-NO.Modsim\ III:modsim3
+SynMenu Me-NO.Modula\ 2:modula2
+SynMenu Me-NO.Modula\ 3:modula3
+SynMenu Me-NO.Monk:monk
+SynMenu Me-NO.Mplayer\ config:mplayerconf
+SynMenu Me-NO.MOO:moo
+SynMenu Me-NO.MS-DOS/Windows.4DOS\ \.bat\ file:btm
+SynMenu Me-NO.MS-DOS/Windows.\.bat\/\.cmd\ file:dosbatch
+SynMenu Me-NO.MS-DOS/Windows.\.ini\ file:dosini
+SynMenu Me-NO.MS-DOS/Windows.Module\ Definition:def
+SynMenu Me-NO.MS-DOS/Windows.Registry:registry
+SynMenu Me-NO.MS-DOS/Windows.Resource\ file:rc
+SynMenu Me-NO.Msql:msql
+SynMenu Me-NO.MUSHcode:mush
+SynMenu Me-NO.Muttrc:muttrc
+SynMenu Me-NO.Nastran\ input/DMAP:nastran
+SynMenu Me-NO.Natural:natural
+SynMenu Me-NO.Novell\ NCF\ batch:ncf
+SynMenu Me-NO.Not\ Quite\ C\ (LEGO):nqc
+SynMenu Me-NO.Nroff:nroff
+SynMenu Me-NO.NSIS\ script:nsis
+SynMenu Me-NO.Objective\ C:objc
+SynMenu Me-NO.Objective\ C++:objcpp
+SynMenu Me-NO.OCAML:ocaml
+SynMenu Me-NO.Occam:occam
+SynMenu Me-NO.Omnimark:omnimark
+SynMenu Me-NO.OpenROAD:openroad
+SynMenu Me-NO.Open\ Psion\ Lang:opl
+SynMenu Me-NO.Oracle\ config:ora
+
+SynMenu PQ.Palm\ resource\ compiler:pilrc
+SynMenu PQ.Packet\ filter\ conf:pf
+SynMenu PQ.PApp:papp
+SynMenu PQ.Pascal:pascal
+SynMenu PQ.PCCTS:pccts
+SynMenu PQ.PPWizard:ppwiz
+SynMenu PQ.Perl.Perl:perl
+SynMenu PQ.Perl.Perl\ POD:pod
+SynMenu PQ.Perl.Perl\ XS:xs
+SynMenu PQ.PHP.PHP\ 3-4:php
+SynMenu PQ.PHP.Phtml\ (PHP\ 2):phtml
+SynMenu PQ.Pike:pike
+SynMenu PQ.Pine\ RC:pine
+SynMenu PQ.Pinfo\ RC:pinfo
+SynMenu PQ.PL/M:plm
+SynMenu PQ.PL/SQL:plsql
+SynMenu PQ.PLP:plp
+SynMenu PQ.PO\ (GNU\ gettext):po
+SynMenu PQ.Postfix\ main\ config:pfmain
+SynMenu PQ.PostScript.PostScript:postscr
+SynMenu PQ.PostScript.PostScript\ Printer\ Description:ppd
+SynMenu PQ.Povray.Povray\ scene\ descr:pov
+SynMenu PQ.Povray.Povray\ configuration:povini
+SynMenu PQ.Printcap:pcap
+SynMenu PQ.Procmail:procmail
+SynMenu PQ.Product\ Spec\ File:psf
+SynMenu PQ.Progress:progress
+SynMenu PQ.Prolog:prolog
+SynMenu PQ.Purify\ log:purifylog
+SynMenu PQ.Pyrex:pyrex
+SynMenu PQ.Python:python
+SynMenu PQ.Quake:quake
+SynMenu PQ.Quickfix\ window:qf
+
+SynMenu R-Sg.R:r
+SynMenu R-Sg.Radiance:radiance
+SynMenu R-Sg.Ratpoison:ratpoison
+SynMenu R-Sg.RCS.RCS\ log\ output:rcslog
+SynMenu R-Sg.RCS.RCS\ file:rcs
+SynMenu R-Sg.Readline\ config:readline
+SynMenu R-Sg.Rebol:rebol
+SynMenu R-Sg.Remind:remind
+SynMenu R-Sg.Relax\ NG\ compact:rnc
+SynMenu R-Sg.Renderman.Renderman\ Shader\ Lang:sl
+SynMenu R-Sg.Renderman.Renderman\ Interface\ Bytestream:rib
+SynMenu R-Sg.Resolv\.conf:resolv
+SynMenu R-Sg.Rexx:rexx
+SynMenu R-Sg.Robots\.txt:robots
+SynMenu R-Sg.RockLinux\ package\ desc\.:desc
+SynMenu R-Sg.Rpcgen:rpcgen
+SynMenu R-Sg.RPL/2:rpl
+SynMenu R-Sg.ReStructuredText:rst
+SynMenu R-Sg.RTF:rtf
+SynMenu R-Sg.Ruby:ruby
+SynMenu R-Sg.S-Lang:slang
+SynMenu R-Sg.Samba\ config:samba
+SynMenu R-Sg.SAS:sas
+SynMenu R-Sg.Sather:sather
+SynMenu R-Sg.Scheme:scheme
+SynMenu R-Sg.Scilab:scilab
+SynMenu R-Sg.Screen\ RC:screen
+SynMenu R-Sg.SDL:sdl
+SynMenu R-Sg.Sed:sed
+SynMenu R-Sg.Sendmail\.cf:sm
+SynMenu R-Sg.Send-pr:sendpr
+SynMenu R-Sg.SGML.SGML\ catalog:catalog
+SynMenu R-Sg.SGML.SGML\ DTD:sgml
+SynMenu R-Sg.SGML.SGML\ Declaration:sgmldecl
+SynMenu R-Sg.SGML.SGML-linuxdoc:sgmllnx
+
+SynMenu Sh-S.Shell\ script.sh\ and\ ksh:sh
+SynMenu Sh-S.Shell\ script.csh:csh
+SynMenu Sh-S.Shell\ script.tcsh:tcsh
+SynMenu Sh-S.Shell\ script.zsh:zsh
+SynMenu Sh-S.SiCAD:sicad
+SynMenu Sh-S.Simula:simula
+SynMenu Sh-S.Sinda.Sinda\ compare:sindacmp
+SynMenu Sh-S.Sinda.Sinda\ input:sinda
+SynMenu Sh-S.Sinda.Sinda\ output:sindaout
+SynMenu Sh-S.SKILL.SKILL:skill
+SynMenu Sh-S.SKILL.SKILL\ for\ Diva:diva
+SynMenu Sh-S.Slice:slice
+SynMenu Sh-S.SLRN.Slrn\ rc:slrnrc
+SynMenu Sh-S.SLRN.Slrn\ score:slrnsc
+SynMenu Sh-S.SmallTalk:st
+SynMenu Sh-S.Smarty\ Templates:smarty
+SynMenu Sh-S.SMIL:smil
+SynMenu Sh-S.SMITH:smith
+SynMenu Sh-S.SNMP\ MIB:mib
+SynMenu Sh-S.SNNS.SNNS\ network:snnsnet
+SynMenu Sh-S.SNNS.SNNS\ pattern:snnspat
+SynMenu Sh-S.SNNS.SNNS\ result:snnsres
+SynMenu Sh-S.Snobol4:snobol4
+SynMenu Sh-S.Snort\ Configuration:hog
+SynMenu Sh-S.SPEC\ (Linux\ RPM):spec
+SynMenu Sh-S.Specman:specman
+SynMenu Sh-S.Spice:spice
+SynMenu Sh-S.Spyce:spyce
+SynMenu Sh-S.Speedup:spup
+SynMenu Sh-S.Splint:splint
+SynMenu Sh-S.Squid\ config:squid
+SynMenu Sh-S.SQL.MySQL:mysql
+SynMenu Sh-S.SQL.SQL:sql
+SynMenu Sh-S.SQL.SQL\ Forms:sqlforms
+SynMenu Sh-S.SQL.SQLJ:sqlj
+SynMenu Sh-S.SQR:sqr
+SynMenu Sh-S.Ssh.ssh_config:sshconfig
+SynMenu Sh-S.Ssh.sshd_config:sshdconfig
+SynMenu Sh-S.Standard\ ML:sml
+SynMenu Sh-S.Stored\ Procedures:stp
+SynMenu Sh-S.Strace:strace
+SynMenu Sh-S.Subversion\ commit:svn
+
+SynMenu TUV.TADS:tads
+SynMenu TUV.Tags:tags
+SynMenu TUV.TAK.TAK\ compare:takcmp
+SynMenu TUV.TAK.TAK\ input:tak
+SynMenu TUV.TAK.TAK\ output:takout
+SynMenu TUV.Tcl/Tk:tcl
+SynMenu TUV.TealInfo:tli
+SynMenu TUV.Telix\ Salt:tsalt
+SynMenu TUV.Termcap/Printcap:ptcap
+SynMenu TUV.Terminfo:terminfo
+SynMenu TUV.TeX.TeX:tex
+SynMenu TUV.TeX.TeX\ configuration:texmf
+SynMenu TUV.TeX.Texinfo:texinfo
+SynMenu TUV.TF\ mud\ client:tf
+SynMenu TUV.Tidy\ configuration:tidy
+SynMenu TUV.Tilde:tilde
+SynMenu TUV.Trasys\ input:trasys
+SynMenu TUV.TSS.Command\ Line:tsscl
+SynMenu TUV.TSS.Geometry:tssgm
+SynMenu TUV.TSS.Optics:tssop
+SynMenu TUV.UIT/UIL:uil
+SynMenu TUV.UnrealScript:uc
+SynMenu TUV.Valgrind:valgrind
+SynMenu TUV.Verilog\ HDL:verilog
+SynMenu TUV.Vgrindefs:vgrindefs
+SynMenu TUV.VHDL:vhdl
+SynMenu TUV.Vim.Vim\ help\ file:help
+SynMenu TUV.Vim.Vim\ script:vim
+SynMenu TUV.Vim.Viminfo\ file:viminfo
+SynMenu TUV.Virata\ config:virata
+SynMenu TUV.Visual\ Basic:vb
+SynMenu TUV.VRML:vrml
+SynMenu TUV.VSE\ JCL:vsejcl
+
+SynMenu WXYZ.WEB.CWEB:cweb
+SynMenu WXYZ.WEB.WEB:web
+SynMenu WXYZ.WEB.WEB\ Changes:change
+SynMenu WXYZ.Webmacro:webmacro
+SynMenu WXYZ.Website\ MetaLanguage:wml
+SynMenu WXYZ.wDiff:wdiff
+SynMenu WXYZ.Wget\ config:wget
+SynMenu WXYZ.Whitespace\ (add):whitespace
+SynMenu WXYZ.WildPackets\ EtherPeek\ Decoder:dcd
+SynMenu WXYZ.WinBatch/Webbatch:winbatch
+SynMenu WXYZ.Windows\ Scripting\ Host:wsh
+SynMenu WXYZ.WvDial:wvdial
+SynMenu WXYZ.X\ Keyboard\ Extension:xkb
+SynMenu WXYZ.X\ Pixmap:xpm
+SynMenu WXYZ.X\ Pixmap\ (2):xpm2
+SynMenu WXYZ.X\ resources:xdefaults
+SynMenu WXYZ.Xmodmap:xmodmap
+SynMenu WXYZ.Xmath:xmath
+SynMenu WXYZ.XML:xml
+SynMenu WXYZ.XML\ Schema\ (XSD):xsd
+SynMenu WXYZ.Xslt:xslt
+SynMenu WXYZ.XFree86\ Config:xf86conf
+SynMenu WXYZ.YAML:yaml
+SynMenu WXYZ.Yacc:yacc
+
+call append(s:lnum, "")
+
+wq
diff --git a/runtime/menu.vim b/runtime/menu.vim
new file mode 100644
index 000000000..db5dc9259
--- /dev/null
+++ b/runtime/menu.vim
@@ -0,0 +1,974 @@
+" Vim support file to define the default menus
+" You can also use this as a start for your own set of menus.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 May 26
+
+" Note that ":an" (short for ":anoremenu") is often used to make a menu work
+" in all modes and avoid side effects from mappings defined by the user.
+
+" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
+" <CR> would not be recognized. See ":help 'cpoptions'".
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Avoid installing the menus twice
+if !exists("did_install_default_menus")
+let did_install_default_menus = 1
+
+
+if exists("v:lang") || &langmenu != ""
+ " Try to find a menu translation file for the current language.
+ if &langmenu != ""
+ if &langmenu =~ "none"
+ let s:lang = ""
+ else
+ let s:lang = &langmenu
+ endif
+ else
+ let s:lang = v:lang
+ endif
+ " A language name must be at least two characters, don't accept "C"
+ if strlen(s:lang) > 1
+ " When the language does not include the charset add 'encoding'
+ if s:lang =~ '^\a\a$\|^\a\a_\a\a$'
+ let s:lang = s:lang . '.' . &enc
+ endif
+
+ " We always use a lowercase name.
+ " Change "iso-8859" to "iso_8859" and "iso8859" to "iso_8859", some
+ " systems appear to use this.
+ " Change spaces to underscores.
+ let s:lang = substitute(tolower(s:lang), '\.iso-', ".iso_", "")
+ let s:lang = substitute(s:lang, '\.iso8859', ".iso_8859", "")
+ let s:lang = substitute(s:lang, " ", "_", "g")
+ " Remove "@euro", otherwise "LC_ALL=de_DE@euro gvim" will show English menus
+ let s:lang = substitute(s:lang, "@euro", "", "")
+ " Change "iso_8859-1" and "iso_8859-15" to "latin1", we always use the
+ " same menu file for them.
+ let s:lang = substitute(s:lang, 'iso_8859-15\=$', "latin1", "")
+ menutrans clear
+ exe "runtime! lang/menu_" . s:lang . ".vim"
+
+ if !exists("did_menu_trans")
+ " There is no exact match, try matching with a wildcard added
+ " (e.g. find menu_de_de.iso_8859-1.vim if s:lang == de_DE).
+ let s:lang = substitute(s:lang, '\.[^.]*', "", "")
+ exe "runtime! lang/menu_" . s:lang . "*.vim"
+
+ if !exists("did_menu_trans") && strlen($LANG) > 1
+ " On windows locale names are complicated, try using $LANG, it might
+ " have been set by set_init_1().
+ exe "runtime! lang/menu_" . tolower($LANG) . "*.vim"
+ endif
+ endif
+ endif
+endif
+
+
+" Help menu
+an 9999.10 &Help.&Overview<Tab><F1> :help<CR>
+an 9999.20 &Help.&User\ Manual :help usr_toc<CR>
+an 9999.30 &Help.&How-to\ links :help how-to<CR>
+an <silent> 9999.40 &Help.&Find\.\.\. :call <SID>Helpfind()<CR>
+an 9999.45 &Help.-sep1- <Nop>
+an 9999.50 &Help.&Credits :help credits<CR>
+an 9999.60 &Help.Co&pying :help copying<CR>
+an 9999.70 &Help.&Sponsor/Register :help sponsor<CR>
+an 9999.70 &Help.O&rphans :help kcc<CR>
+an 9999.75 &Help.-sep2- <Nop>
+an 9999.80 &Help.&Version :version<CR>
+an 9999.90 &Help.&About :intro<CR>
+
+fun! s:Helpfind()
+ if !exists("g:menutrans_help_dialog")
+ let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_<Del>)\nPrepend ' for an option name (e.g.: 'shiftwidth')"
+ endif
+ let h = inputdialog(g:menutrans_help_dialog)
+ if h != ""
+ let v:errmsg = ""
+ silent! exe "help " . h
+ if v:errmsg != ""
+ echo v:errmsg
+ endif
+ endif
+endfun
+
+" File menu
+an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
+an 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
+an 10.325 &File.&New<Tab>:enew :confirm enew<CR>
+an <silent> 10.330 &File.&Close<Tab>:close
+ \ :if winheight(2) < 0 <Bar>
+ \ confirm enew <Bar>
+ \ else <Bar>
+ \ confirm close <Bar>
+ \ endif<CR>
+an 10.335 &File.-SEP1- <Nop>
+an <silent> 10.340 &File.&Save<Tab>:w :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
+an 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR>
+
+if has("diff")
+ an 10.400 &File.-SEP2- <Nop>
+ an 10.410 &File.Split\ &Diff\ with\.\.\. :browse vert diffsplit<CR>
+ an 10.420 &File.Split\ Patched\ &By\.\.\. :browse vert diffpatch<CR>
+endif
+
+if has("printer")
+ an 10.500 &File.-SEP3- <Nop>
+ an 10.510 &File.&Print :hardcopy<CR>
+ vunmenu &File.&Print
+ vnoremenu &File.&Print :hardcopy<CR>
+elseif has("unix")
+ an 10.500 &File.-SEP3- <Nop>
+ an 10.510 &File.&Print :w !lpr<CR>
+ vunmenu &File.&Print
+ vnoremenu &File.&Print :w !lpr<CR>
+endif
+an 10.600 &File.-SEP4- <Nop>
+an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR>
+an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
+
+" Pasting blockwise and linewise selections is not possible in Insert and
+" Visual mode without the +virtualedit feature. They are pasted as if they
+" were characterwise instead. Add to that some tricks to leave the cursor in
+" the right position, also for "gi".
+" Note: the same stuff appears in mswin.vim.
+if has("virtualedit")
+ nnoremap <silent> <script> <SID>Paste :call <SID>Paste()<CR>
+ func! <SID>Paste()
+ let ove = &ve
+ set ve=all
+ normal `^
+ if @+ != ''
+ normal "+gP
+ endif
+ let c = col(".")
+ normal i
+ if col(".") < c " compensate for i<ESC> moving the cursor left
+ normal l
+ endif
+ let &ve = ove
+ endfunc
+else
+ nnoremap <silent> <script> <SID>Paste "=@+.'xy'<CR>gPFx"_2x
+endif
+
+" Use maps for items that are present both in Edit, Popup and Toolbar menu.
+if has("virtualedit")
+ vnoremap <script> <SID>vPaste "-c<Esc><SID>Paste
+ inoremap <script> <SID>iPaste <Esc><SID>Pastegi
+else
+ vnoremap <script> <SID>vPaste "-c<Esc>gix<Esc><SID>Paste"_x
+ inoremap <script> <SID>iPaste x<Esc><SID>Paste"_s
+endif
+
+func! <SID>SelectAll()
+ exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
+endfunc
+
+
+" Edit menu
+an 20.310 &Edit.&Undo<Tab>u u
+an 20.320 &Edit.&Redo<Tab>^R <C-R>
+an 20.330 &Edit.Rep&eat<Tab>\. .
+
+an 20.335 &Edit.-SEP1- <Nop>
+vnoremenu 20.340 &Edit.Cu&t<Tab>"+x "+x
+vnoremenu 20.350 &Edit.&Copy<Tab>"+y "+y
+cnoremenu 20.350 &Edit.&Copy<Tab>"+y <C-Y>
+nnoremenu 20.360 &Edit.&Paste<Tab>"+gP "+gP
+cnoremenu &Edit.&Paste<Tab>"+gP <C-R>+
+vnoremenu <script> &Edit.&Paste<Tab>"+gP <SID>vPaste
+inoremenu <script> &Edit.&Paste<Tab>"+gP <SID>iPaste
+nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
+inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p
+nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p
+inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p
+if has("win32") || has("win16")
+ vnoremenu 20.390 &Edit.&Delete<Tab>x x
+endif
+noremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG :<C-U>call <SID>SelectAll()<CR>
+inoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-O>:call <SID>SelectAll()<CR>
+cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR>
+
+an 20.405 &Edit.-SEP2- <Nop>
+if has("win32") || has("win16") || has("gui_gtk") || has("gui_motif")
+ an 20.410 &Edit.&Find\.\.\. :promptfind<CR>
+ vunmenu &Edit.&Find\.\.\.
+ vnoremenu &Edit.&Find\.\.\. y:promptfind <C-R>"<CR>
+ an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR>
+ vunmenu &Edit.Find\ and\ Rep&lace\.\.\.
+ vnoremenu &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl <C-R>"<CR>
+else
+ an 20.410 &Edit.&Find<Tab>/ /
+ an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/
+ vunmenu &Edit.Find\ and\ Rep&lace<Tab>:%s
+ vnoremenu &Edit.Find\ and\ Rep&lace<Tab>:s :s/
+endif
+
+an 20.425 &Edit.-SEP3- <Nop>
+an 20.430 &Edit.Settings\ &Window :options<CR>
+
+" Edit/Global Settings
+an 20.440.100 &Edit.&Global\ Settings.Toggle\ Pattern\ &Highlight<Tab>:set\ hls! :set hls! hls?<CR>
+an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Ignore-case<Tab>:set\ ic! :set ic! ic?<CR>
+an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Showmatch<Tab>:set\ sm! :set sm! sm?<CR>
+
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 1\ :set so=1<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 2\ :set so=2<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 3\ :set so=3<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 4\ :set so=4<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 5\ :set so=5<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 7\ :set so=7<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 10\ :set so=10<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 100\ :set so=100<CR>
+
+an 20.440.130.40 &Edit.&Global\ Settings.&Virtual\ Edit.Never :set ve=<CR>
+an 20.440.130.50 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ Selection :set ve=block<CR>
+an 20.440.130.60 &Edit.&Global\ Settings.&Virtual\ Edit.Insert\ mode :set ve=insert<CR>
+an 20.440.130.70 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ and\ Insert :set ve=block,insert<CR>
+an 20.440.130.80 &Edit.&Global\ Settings.&Virtual\ Edit.Always :set ve=all<CR>
+an 20.440.140 &Edit.&Global\ Settings.Toggle\ Insert\ &Mode<Tab>:set\ im! :set im!<CR>
+an 20.440.145 &Edit.&Global\ Settings.Toggle\ Vi\ C&ompatible<Tab>:set\ cp! :set cp!<CR>
+an <silent> 20.440.150 &Edit.&Global\ Settings.Search\ &Path\.\.\. :call <SID>SearchP()<CR>
+an <silent> 20.440.160 &Edit.&Global\ Settings.Ta&g\ Files\.\.\. :call <SID>TagFiles()<CR>
+"
+" GUI options
+an 20.440.300 &Edit.&Global\ Settings.-SEP1- <Nop>
+an <silent> 20.440.310 &Edit.&Global\ Settings.Toggle\ &Toolbar :call <SID>ToggleGuiOption("T")<CR>
+an <silent> 20.440.320 &Edit.&Global\ Settings.Toggle\ &Bottom\ Scrollbar :call <SID>ToggleGuiOption("b")<CR>
+an <silent> 20.440.330 &Edit.&Global\ Settings.Toggle\ &Left\ Scrollbar :call <SID>ToggleGuiOption("l")<CR>
+an <silent> 20.440.340 &Edit.&Global\ Settings.Toggle\ &Right\ Scrollbar :call <SID>ToggleGuiOption("r")<CR>
+
+fun! s:SearchP()
+ if !exists("g:menutrans_path_dialog")
+ let g:menutrans_path_dialog = "Enter search path for files.\nSeparate directory names with a comma."
+ endif
+ let n = inputdialog(g:menutrans_path_dialog, substitute(&path, '\\ ', ' ', 'g'))
+ if n != ""
+ let &path = substitute(n, ' ', '\\ ', 'g')
+ endif
+endfun
+
+fun! s:TagFiles()
+ if !exists("g:menutrans_tags_dialog")
+ let g:menutrans_tags_dialog = "Enter names of tag files.\nSeparate the names with a comma."
+ endif
+ let n = inputdialog(g:menutrans_tags_dialog, substitute(&tags, '\\ ', ' ', 'g'))
+ if n != ""
+ let &tags = substitute(n, ' ', '\\ ', 'g')
+ endif
+endfun
+
+fun! s:ToggleGuiOption(option)
+ " If a:option is already set in guioptions, then we want to remove it
+ if match(&guioptions, "\\C" . a:option) > -1
+ exec "set go-=" . a:option
+ else
+ exec "set go+=" . a:option
+ endif
+endfun
+
+" Edit/File Settings
+
+" Boolean options
+an 20.440.100 &Edit.F&ile\ Settings.Toggle\ Line\ &Numbering<Tab>:set\ nu! :set nu! nu?<CR>
+an 20.440.110 &Edit.F&ile\ Settings.Toggle\ &List\ Mode<Tab>:set\ list! :set list! list?<CR>
+an 20.440.120 &Edit.F&ile\ Settings.Toggle\ Line\ &Wrap<Tab>:set\ wrap! :set wrap! wrap?<CR>
+an 20.440.130 &Edit.F&ile\ Settings.Toggle\ W&rap\ at\ word<Tab>:set\ lbr! :set lbr! lbr?<CR>
+an 20.440.160 &Edit.F&ile\ Settings.Toggle\ &expand-tab<Tab>:set\ et! :set et! et?<CR>
+an 20.440.170 &Edit.F&ile\ Settings.Toggle\ &auto-indent<Tab>:set\ ai! :set ai! ai?<CR>
+an 20.440.180 &Edit.F&ile\ Settings.Toggle\ &C-indenting<Tab>:set\ cin! :set cin! cin?<CR>
+
+" other options
+an 20.440.600 &Edit.F&ile\ Settings.-SEP2- <Nop>
+an 20.440.610.20 &Edit.F&ile\ Settings.&Shiftwidth.2 :set sw=2 sw?<CR>
+an 20.440.610.30 &Edit.F&ile\ Settings.&Shiftwidth.3 :set sw=3 sw?<CR>
+an 20.440.610.40 &Edit.F&ile\ Settings.&Shiftwidth.4 :set sw=4 sw?<CR>
+an 20.440.610.50 &Edit.F&ile\ Settings.&Shiftwidth.5 :set sw=5 sw?<CR>
+an 20.440.610.60 &Edit.F&ile\ Settings.&Shiftwidth.6 :set sw=6 sw?<CR>
+an 20.440.610.80 &Edit.F&ile\ Settings.&Shiftwidth.8 :set sw=8 sw?<CR>
+
+an 20.440.620.20 &Edit.F&ile\ Settings.Soft\ &Tabstop.2 :set sts=2 sts?<CR>
+an 20.440.620.30 &Edit.F&ile\ Settings.Soft\ &Tabstop.3 :set sts=3 sts?<CR>
+an 20.440.620.40 &Edit.F&ile\ Settings.Soft\ &Tabstop.4 :set sts=4 sts?<CR>
+an 20.440.620.50 &Edit.F&ile\ Settings.Soft\ &Tabstop.5 :set sts=5 sts?<CR>
+an 20.440.620.60 &Edit.F&ile\ Settings.Soft\ &Tabstop.6 :set sts=6 sts?<CR>
+an 20.440.620.80 &Edit.F&ile\ Settings.Soft\ &Tabstop.8 :set sts=8 sts?<CR>
+
+an <silent> 20.440.630 &Edit.F&ile\ Settings.Te&xt\ Width\.\.\. :call <SID>TextWidth()<CR>
+an <silent> 20.440.640 &Edit.F&ile\ Settings.&File\ Format\.\.\. :call <SID>FileFormat()<CR>
+fun! s:TextWidth()
+ if !exists("g:menutrans_textwidth_dialog")
+ let g:menutrans_textwidth_dialog = "Enter new text width (0 to disable formatting): "
+ endif
+ let n = inputdialog(g:menutrans_textwidth_dialog, &tw)
+ if n != ""
+ " remove leading zeros to avoid it being used as an octal number
+ let &tw = substitute(n, "^0*", "", "")
+ endif
+endfun
+
+fun! s:FileFormat()
+ if !exists("g:menutrans_fileformat_dialog")
+ let g:menutrans_fileformat_dialog = "Select format for writing the file"
+ endif
+ if !exists("g:menutrans_fileformat_choices")
+ let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Cancel"
+ endif
+ if &ff == "dos"
+ let def = 2
+ elseif &ff == "mac"
+ let def = 3
+ else
+ let def = 1
+ endif
+ let n = confirm(g:menutrans_fileformat_dialog, g:menutrans_fileformat_choices, def, "Question")
+ if n == 1
+ set ff=unix
+ elseif n == 2
+ set ff=dos
+ elseif n == 3
+ set ff=mac
+ endif
+endfun
+
+" Setup the Edit.Color Scheme submenu
+let s:n = globpath(&runtimepath, "colors/*.vim")
+let s:idx = 100
+while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
+ exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+endwhile
+unlet s:n
+unlet s:idx
+
+" Setup the Edit.Keymap submenu
+if has("keymap")
+ let s:n = globpath(&runtimepath, "keymap/*.vim")
+ if s:n != ""
+ let s:idx = 100
+ an 20.460.90 &Edit.&Keymap.None :set keymap=<CR>
+ while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
+ exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+ endwhile
+ unlet s:idx
+ endif
+ unlet s:n
+endif
+if has("win32") || has("win16") || has("gui_gtk") || has("gui_photon")
+ an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR>
+endif
+
+" Programming menu
+if !exists("g:ctags_command")
+ if has("vms")
+ let g:ctags_command = "mc vim:ctags ."
+ else
+ let g:ctags_command = "ctags -R ."
+ endif
+endif
+
+an 40.300 &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]>
+vunmenu &Tools.&Jump\ to\ this\ tag<Tab>g^]
+vnoremenu &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]>
+an 40.310 &Tools.Jump\ &back<Tab>^T <C-T>
+an 40.320 &Tools.Build\ &Tags\ File :exe "!" . g:ctags_command<CR>
+
+" Tools.Fold Menu
+if has("folding")
+ an 40.330 &Tools.-SEP1- <Nop>
+ " open close folds
+ an 40.340.110 &Tools.&Folding.&Enable/Disable\ folds<Tab>zi zi
+ an 40.340.120 &Tools.&Folding.&View\ Cursor\ Line<Tab>zv zv
+ an 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx zMzx
+ an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm
+ an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM
+ an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr
+ an 40.340.160 &Tools.&Folding.&Open\ all\ folds<Tab>zR zR
+ " fold method
+ an 40.340.200 &Tools.&Folding.-SEP1- <Nop>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.M&anual :set fdm=manual<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.I&ndent :set fdm=indent<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.E&xpression :set fdm=expr<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.S&yntax :set fdm=syntax<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.&Diff :set fdm=diff<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.Ma&rker :set fdm=marker<CR>
+ " create and delete folds
+ vnoremenu 40.340.220 &Tools.&Folding.Create\ &Fold<Tab>zf zf
+ an 40.340.230 &Tools.&Folding.&Delete\ Fold<Tab>zd zd
+ an 40.340.240 &Tools.&Folding.Delete\ &All\ Folds<Tab>zD zD
+ " moving around in folds
+ an 40.340.300 &Tools.&Folding.-SEP2- <Nop>
+ an 40.340.310.10 &Tools.&Folding.Fold\ col&umn\ width.\ &0\ :set fdc=0<CR>
+ an 40.340.310.20 &Tools.&Folding.Fold\ col&umn\ width.\ &2\ :set fdc=2<CR>
+ an 40.340.310.30 &Tools.&Folding.Fold\ col&umn\ width.\ &3\ :set fdc=3<CR>
+ an 40.340.310.40 &Tools.&Folding.Fold\ col&umn\ width.\ &4\ :set fdc=4<CR>
+ an 40.340.310.50 &Tools.&Folding.Fold\ col&umn\ width.\ &5\ :set fdc=5<CR>
+ an 40.340.310.60 &Tools.&Folding.Fold\ col&umn\ width.\ &6\ :set fdc=6<CR>
+ an 40.340.310.70 &Tools.&Folding.Fold\ col&umn\ width.\ &7\ :set fdc=7<CR>
+ an 40.340.310.80 &Tools.&Folding.Fold\ col&umn\ width.\ &8\ :set fdc=8<CR>
+endif " has folding
+
+if has("diff")
+ an 40.350.100 &Tools.&Diff.&Update :diffupdate<CR>
+ an 40.350.110 &Tools.&Diff.&Get\ Block :diffget<CR>
+ vunmenu &Tools.&Diff.&Get\ Block
+ vnoremenu &Tools.&Diff.&Get\ Block :diffget<CR>
+ an 40.350.120 &Tools.&Diff.&Put\ Block :diffput<CR>
+ vunmenu &Tools.&Diff.&Put\ Block
+ vnoremenu &Tools.&Diff.&Put\ Block :diffput<CR>
+endif
+
+an 40.358 &Tools.-SEP2- <Nop>
+an 40.360 &Tools.&Make<Tab>:make :make<CR>
+an 40.370 &Tools.&List\ Errors<Tab>:cl :cl<CR>
+an 40.380 &Tools.L&ist\ Messages<Tab>:cl! :cl!<CR>
+an 40.390 &Tools.&Next\ Error<Tab>:cn :cn<CR>
+an 40.400 &Tools.&Previous\ Error<Tab>:cp :cp<CR>
+an 40.410 &Tools.&Older\ List<Tab>:cold :colder<CR>
+an 40.420 &Tools.N&ewer\ List<Tab>:cnew :cnewer<CR>
+an 40.430.50 &Tools.Error\ &Window.&Update<Tab>:cwin :cwin<CR>
+an 40.430.60 &Tools.Error\ &Window.&Open<Tab>:copen :copen<CR>
+an 40.430.70 &Tools.Error\ &Window.&Close<Tab>:cclose :cclose<CR>
+
+an 40.520 &Tools.-SEP3- <Nop>
+an <silent> 40.530 &Tools.&Convert\ to\ HEX<Tab>:%!xxd
+ \ :call <SID>XxdConv()<CR>
+an <silent> 40.540 &Tools.Conve&rt\ back<Tab>:%!xxd\ -r
+ \ :call <SID>XxdBack()<CR>
+
+" Use a function to do the conversion, so that it also works with 'insertmode'
+" set.
+func! s:XxdConv()
+ let mod = &mod
+ if has("vms")
+ %!mc vim:xxd
+ else
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '"'
+ endif
+ if getline(1) =~ "^0000000:" " only if it worked
+ set ft=xxd
+ endif
+ let &mod = mod
+endfun
+
+func! s:XxdBack()
+ let mod = &mod
+ if has("vms")
+ %!mc vim:xxd -r
+ else
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '" -r'
+ endif
+ set ft=
+ doautocmd filetypedetect BufReadPost
+ let &mod = mod
+endfun
+
+func! s:XxdFind()
+ if !exists("g:xxdprogram")
+ " On the PC xxd may not be in the path but in the install directory
+ if (has("win32") || has("dos32")) && !executable("xxd")
+ let g:xxdprogram = $VIMRUNTIME . (&shellslash ? '/' : '\') . "xxd.exe"
+ else
+ let g:xxdprogram = "xxd"
+ endif
+ endif
+endfun
+
+" Setup the Tools.Compiler submenu
+let s:n = globpath(&runtimepath, "compiler/*.vim")
+let s:idx = 100
+while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
+ exe "an 30.440." . s:idx . ' &Tools.&Set\ Compiler.' . s:name . " :compiler " . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+endwhile
+unlet s:n
+unlet s:idx
+
+if !exists("no_buffers_menu")
+
+" Buffer list menu -- Setup functions & actions
+
+" wait with building the menu until after loading 'session' files. Makes
+" startup faster.
+let s:bmenu_wait = 1
+
+if !exists("bmenu_priority")
+ let bmenu_priority = 60
+endif
+
+func! s:BMAdd()
+ if s:bmenu_wait == 0
+ " when adding too many buffers, redraw in short format
+ if s:bmenu_count == &menuitems && s:bmenu_short == 0
+ call s:BMShow()
+ else
+ call <SID>BMFilename(expand("<afile>"), expand("<abuf>"))
+ let s:bmenu_count = s:bmenu_count + 1
+ endif
+ endif
+endfunc
+
+func! s:BMRemove()
+ if s:bmenu_wait == 0
+ let name = expand("<afile>")
+ if isdirectory(name)
+ return
+ endif
+ let munge = <SID>BMMunge(name, expand("<abuf>"))
+
+ if s:bmenu_short == 0
+ exe 'silent! aun &Buffers.' . munge
+ else
+ exe 'silent! aun &Buffers.' . <SID>BMHash2(munge) . munge
+ endif
+ let s:bmenu_count = s:bmenu_count - 1
+ endif
+endfunc
+
+" Create the buffer menu (delete an existing one first).
+func! s:BMShow(...)
+ let s:bmenu_wait = 1
+ let s:bmenu_short = 1
+ let s:bmenu_count = 0
+ "
+ " get new priority, if exists
+ if a:0 == 1
+ let g:bmenu_priority = a:1
+ endif
+
+ " remove old menu, if exists; keep one entry to avoid a torn off menu to
+ " disappear.
+ silent! unmenu &Buffers
+ exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l"
+ silent! unmenu! &Buffers
+
+ " create new menu; set 'cpo' to include the <CR>
+ let cpo_save = &cpo
+ set cpo&vim
+ exe 'an <silent> ' . g:bmenu_priority . ".2 &Buffers.&Refresh\\ menu :call <SID>BMShow()<CR>"
+ exe 'an ' . g:bmenu_priority . ".4 &Buffers.&Delete :confirm bd<CR>"
+ exe 'an ' . g:bmenu_priority . ".6 &Buffers.&Alternate :confirm b #<CR>"
+ exe 'an ' . g:bmenu_priority . ".7 &Buffers.&Next :confirm bnext<CR>"
+ exe 'an ' . g:bmenu_priority . ".8 &Buffers.&Previous :confirm bprev<CR>"
+ exe 'an ' . g:bmenu_priority . ".9 &Buffers.-SEP- :"
+ let &cpo = cpo_save
+ unmenu &Buffers.Dummy
+
+ " figure out how many buffers there are
+ let buf = 1
+ while buf <= bufnr('$')
+ if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
+ \ && !getbufvar(buf, "&bufsecret")
+ let s:bmenu_count = s:bmenu_count + 1
+ endif
+ let buf = buf + 1
+ endwhile
+ if s:bmenu_count <= &menuitems
+ let s:bmenu_short = 0
+ endif
+
+ " iterate through buffer list, adding each buffer to the menu:
+ let buf = 1
+ while buf <= bufnr('$')
+ if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
+ \ && !getbufvar(buf, "&bufsecret")
+ call <SID>BMFilename(bufname(buf), buf)
+ endif
+ let buf = buf + 1
+ endwhile
+ let s:bmenu_wait = 0
+ aug buffer_list
+ au!
+ au BufCreate,BufFilePost * call <SID>BMAdd()
+ au BufDelete,BufFilePre * call <SID>BMRemove()
+ aug END
+endfunc
+
+func! s:BMHash(name)
+ " Make name all upper case, so that chars are between 32 and 96
+ let nm = substitute(a:name, ".*", '\U\0', "")
+ if has("ebcdic")
+ " HACK: Replace all non alphabetics with 'Z'
+ " Just to make it work for now.
+ let nm = substitute(nm, "[^A-Z]", 'Z', "g")
+ let sp = char2nr('A') - 1
+ else
+ let sp = char2nr(' ')
+ endif
+ " convert first six chars into a number for sorting:
+ return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp)
+endfunc
+
+func! s:BMHash2(name)
+ let nm = substitute(a:name, ".", '\L\0', "")
+ " Not exactly right for EBCDIC...
+ if nm[0] < 'a' || nm[0] > 'z'
+ return '&others.'
+ elseif nm[0] <= 'd'
+ return '&abcd.'
+ elseif nm[0] <= 'h'
+ return '&efgh.'
+ elseif nm[0] <= 'l'
+ return '&ijkl.'
+ elseif nm[0] <= 'p'
+ return '&mnop.'
+ elseif nm[0] <= 't'
+ return '&qrst.'
+ else
+ return '&u-z.'
+ endif
+endfunc
+
+" insert a buffer name into the buffer menu:
+func! s:BMFilename(name, num)
+ if isdirectory(a:name)
+ return
+ endif
+ let munge = <SID>BMMunge(a:name, a:num)
+ let hash = <SID>BMHash(munge)
+ if s:bmenu_short == 0
+ let name = 'an ' . g:bmenu_priority . '.' . hash . ' &Buffers.' . munge
+ else
+ let name = 'an ' . g:bmenu_priority . '.' . hash . '.' . hash . ' &Buffers.' . <SID>BMHash2(munge) . munge
+ endif
+ " set 'cpo' to include the <CR>
+ let cpo_save = &cpo
+ set cpo&vim
+ exe name . ' :confirm b' . a:num . '<CR>'
+ let &cpo = cpo_save
+endfunc
+
+" Truncate a long path to fit it in a menu item.
+if !exists("g:bmenu_max_pathlen")
+ let g:bmenu_max_pathlen = 35
+endif
+func! s:BMTruncName(fname)
+ let name = a:fname
+ if g:bmenu_max_pathlen < 5
+ let name = ""
+ else
+ let len = strlen(name)
+ if len > g:bmenu_max_pathlen
+ let amountl = (g:bmenu_max_pathlen / 2) - 2
+ let amountr = g:bmenu_max_pathlen - amountl - 3
+ let pattern = '^\(.\{,' . amountl . '}\).\{-}\(.\{,' . amountr . '}\)$'
+ let left = substitute(name, pattern, '\1', '')
+ let right = substitute(name, pattern, '\2', '')
+ if strlen(left) + strlen(right) < len
+ let name = left . '...' . right
+ endif
+ endif
+ endif
+ return name
+endfunc
+
+func! s:BMMunge(fname, bnum)
+ let name = a:fname
+ if name == ''
+ if !exists("g:menutrans_no_file")
+ let g:menutrans_no_file = "[No file]"
+ endif
+ let name = g:menutrans_no_file
+ else
+ let name = fnamemodify(name, ':p:~')
+ endif
+ " detach file name and separate it out:
+ let name2 = fnamemodify(name, ':t')
+ if a:bnum >= 0
+ let name2 = name2 . ' (' . a:bnum . ')'
+ endif
+ let name = name2 . "\t" . <SID>BMTruncName(fnamemodify(name,':h'))
+ let name = escape(name, "\\. \t|")
+ let name = substitute(name, "&", "&&", "g")
+ let name = substitute(name, "\n", "^@", "g")
+ return name
+endfunc
+
+" When just starting Vim, load the buffer menu later
+if has("vim_starting")
+ augroup LoadBufferMenu
+ au! VimEnter * if !exists("no_buffers_menu") | call <SID>BMShow() | endif
+ au VimEnter * au! LoadBufferMenu
+ augroup END
+else
+ call <SID>BMShow()
+endif
+
+endif " !exists("no_buffers_menu")
+
+" Window menu
+an 70.300 &Window.&New<Tab>^Wn <C-W>n
+an 70.310 &Window.S&plit<Tab>^Ws <C-W>s
+an 70.320 &Window.Sp&lit\ To\ #<Tab>^W^^ <C-W><C-^>
+an 70.330 &Window.Split\ &Vertically<Tab>^Wv <C-W>v
+if has("vertsplit")
+ an <silent> 70.332 &Window.Split\ File\ E&xplorer :call MenuExplOpen()<CR>
+ if !exists("*MenuExplOpen")
+ fun MenuExplOpen()
+ if @% == ""
+ 20vsp .
+ else
+ exe "20vsp " . expand("%:p:h")
+ endif
+ endfun
+ endif
+endif
+an 70.335 &Window.-SEP1- <Nop>
+an 70.340 &Window.&Close<Tab>^Wc :confirm close<CR>
+an 70.345 &Window.Close\ &Other(s)<Tab>^Wo :confirm only<CR>
+an 70.350 &Window.-SEP2- <Nop>
+an 70.355 &Window.Move\ &To.&Top<Tab>^WK <C-W>K
+an 70.355 &Window.Move\ &To.&Bottom<Tab>^WJ <C-W>J
+an 70.355 &Window.Move\ &To.&Left\ side<Tab>^WH <C-W>H
+an 70.355 &Window.Move\ &To.&Right\ side<Tab>^WL <C-W>L
+an 70.360 &Window.Rotate\ &Up<Tab>^WR <C-W>R
+an 70.362 &Window.Rotate\ &Down<Tab>^Wr <C-W>r
+an 70.365 &Window.-SEP3- <Nop>
+an 70.370 &Window.&Equal\ Size<Tab>^W= <C-W>=
+an 70.380 &Window.&Max\ Height<Tab>^W_ <C-W>_
+an 70.390 &Window.M&in\ Height<Tab>^W1_ <C-W>1_
+an 70.400 &Window.Max\ &Width<Tab>^W\| <C-W>\|
+an 70.410 &Window.Min\ Widt&h<Tab>^W1\| <C-W>1\|
+
+" The popup menu
+an 1.10 PopUp.&Undo u
+an 1.15 PopUp.-SEP1- <Nop>
+vnoremenu 1.20 PopUp.Cu&t "+x
+vnoremenu 1.30 PopUp.&Copy "+y
+cnoremenu 1.30 PopUp.&Copy <C-Y>
+nnoremenu 1.40 PopUp.&Paste "+gP
+cnoremenu 1.40 PopUp.&Paste <C-R>+
+vnoremenu <script> 1.40 PopUp.&Paste <SID>vPaste
+inoremenu <script> 1.40 PopUp.&Paste <SID>iPaste
+vnoremenu 1.50 PopUp.&Delete x
+an 1.55 PopUp.-SEP2- <Nop>
+vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>
+an 1.70 PopUp.Select\ &Word vaw
+an 1.80 PopUp.Select\ &Line V
+an 1.90 PopUp.Select\ &Block <C-V>
+noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR>
+inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR>
+cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR>
+
+
+" The GUI toolbar (for MS-Windows and GTK)
+if has("toolbar")
+ an 1.10 ToolBar.Open :browse confirm e<CR>
+ an <silent> 1.20 ToolBar.Save :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
+ an 1.30 ToolBar.SaveAll :browse confirm wa<CR>
+
+ if has("printer")
+ an 1.40 ToolBar.Print :hardcopy<CR>
+ vunmenu ToolBar.Print
+ vnoremenu ToolBar.Print :hardcopy<CR>
+ elseif has("unix")
+ an 1.40 ToolBar.Print :w !lpr<CR>
+ vunmenu ToolBar.Print
+ vnoremenu ToolBar.Print :w !lpr<CR>
+ endif
+
+ an 1.45 ToolBar.-sep1- <Nop>
+ an 1.50 ToolBar.Undo u
+ an 1.60 ToolBar.Redo <C-R>
+
+ an 1.65 ToolBar.-sep2- <Nop>
+ vnoremenu 1.70 ToolBar.Cut "+x
+ vnoremenu 1.80 ToolBar.Copy "+y
+ cnoremenu 1.80 ToolBar.Copy <C-Y>
+ nnoremenu 1.90 ToolBar.Paste "+gP
+ cnoremenu ToolBar.Paste <C-R>+
+ vnoremenu <script> ToolBar.Paste <SID>vPaste
+ inoremenu <script> ToolBar.Paste <SID>iPaste
+
+ if !has("gui_athena")
+ an 1.95 ToolBar.-sep3- <Nop>
+ an 1.100 ToolBar.Find :promptfind<CR>
+ vunmenu ToolBar.Find
+ vnoremenu ToolBar.Find y:promptfind <C-R>"<CR>
+ an 1.110 ToolBar.FindNext n
+ an 1.120 ToolBar.FindPrev N
+ an 1.130 ToolBar.Replace :promptrepl<CR>
+ vunmenu ToolBar.Replace
+ vnoremenu ToolBar.Replace y:promptrepl <C-R>"<CR>
+ endif
+
+if 0 " disabled; These are in the Windows menu
+ an 1.135 ToolBar.-sep4- <Nop>
+ an 1.140 ToolBar.New <C-W>n
+ an 1.150 ToolBar.WinSplit <C-W>s
+ an 1.160 ToolBar.WinMax :resize 200<CR>
+ an 1.170 ToolBar.WinMin :resize 1<CR>
+ an 1.180 ToolBar.WinVSplit <C-W>v
+ an 1.190 ToolBar.WinMaxWidth <C-W>500>
+ an 1.200 ToolBar.WinMinWidth <C-W>1\|
+ an 1.210 ToolBar.WinClose :close<CR>
+endif
+
+ an 1.215 ToolBar.-sep5- <Nop>
+ an <silent> 1.220 ToolBar.LoadSesn :call <SID>LoadVimSesn()<CR>
+ an <silent> 1.230 ToolBar.SaveSesn :call <SID>SaveVimSesn()<CR>
+ an 1.240 ToolBar.RunScript :browse so<CR>
+
+ an 1.245 ToolBar.-sep6- <Nop>
+ an 1.250 ToolBar.Make :make<CR>
+ an 1.270 ToolBar.RunCtags :exe "!" . g:ctags_command<CR>
+ an 1.280 ToolBar.TagJump g<C-]>
+
+ an 1.295 ToolBar.-sep7- <Nop>
+ an 1.300 ToolBar.Help :help<CR>
+ an <silent> 1.310 ToolBar.FindHelp :call <SID>Helpfind()<CR>
+
+" Only set the tooltips here if not done in a language menu file
+if exists("*Do_toolbar_tmenu")
+ call Do_toolbar_tmenu()
+else
+ let did_toolbar_tmenu = 1
+ tmenu ToolBar.Open Open file
+ tmenu ToolBar.Save Save current file
+ tmenu ToolBar.SaveAll Save all files
+ tmenu ToolBar.Print Print
+ tmenu ToolBar.Undo Undo
+ tmenu ToolBar.Redo Redo
+ tmenu ToolBar.Cut Cut to clipboard
+ tmenu ToolBar.Copy Copy to clipboard
+ tmenu ToolBar.Paste Paste from Clipboard
+ if !has("gui_athena")
+ tmenu ToolBar.Find Find...
+ tmenu ToolBar.FindNext Find Next
+ tmenu ToolBar.FindPrev Find Previous
+ tmenu ToolBar.Replace Find / Replace...
+ endif
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New New Window
+ tmenu ToolBar.WinSplit Split Window
+ tmenu ToolBar.WinMax Maximise Window
+ tmenu ToolBar.WinMin Minimise Window
+ tmenu ToolBar.WinVSplit Split Window Vertically
+ tmenu ToolBar.WinMaxWidth Maximise Window Width
+ tmenu ToolBar.WinMinWidth Minimise Window Width
+ tmenu ToolBar.WinClose Close Window
+ endif
+ tmenu ToolBar.LoadSesn Load session
+ tmenu ToolBar.SaveSesn Save current session
+ tmenu ToolBar.RunScript Run a Vim Script
+ tmenu ToolBar.Make Make current project
+ tmenu ToolBar.RunCtags Build tags in current directory tree
+ tmenu ToolBar.TagJump Jump to tag under cursor
+ tmenu ToolBar.Help Vim Help
+ tmenu ToolBar.FindHelp Search Vim Help
+endif
+
+" Select a session to load; default to current session name if present
+fun! s:LoadVimSesn()
+ if strlen(v:this_session) > 0
+ let name = v:this_session
+ else
+ let name = "Session.vim"
+ endif
+ execute "browse so " . name
+endfun
+
+" Select a session to save; default to current session name if present
+fun! s:SaveVimSesn()
+ if strlen(v:this_session) == 0
+ let v:this_session = "Session.vim"
+ endif
+ execute "browse mksession! " . v:this_session
+endfun
+
+endif
+
+endif " !exists("did_install_default_menus")
+
+" Define these items always, so that syntax can be switched on when it wasn't.
+" But skip them when the Syntax menu was disabled by the user.
+if !exists("did_install_syntax_menu")
+ an 50.212 &Syntax.&Manual :syn manual<CR>
+ an 50.214 &Syntax.A&utomatic :syn on<CR>
+ an <silent> 50.216 &Syntax.on/off\ for\ &This\ file :call <SID>SynOnOff()<CR>
+ if !exists("*s:SynOnOff")
+ fun s:SynOnOff()
+ if has("syntax_items")
+ syn clear
+ else
+ if !exists("g:syntax_on")
+ syn manual
+ endif
+ set syn=ON
+ endif
+ endfun
+ endif
+endif
+
+
+" Install the Syntax menu only when filetype.vim has been loaded or when
+" manual syntax highlighting is enabled.
+" Avoid installing the Syntax menu twice.
+if (exists("did_load_filetypes") || exists("syntax_on"))
+ \ && !exists("did_install_syntax_menu")
+ let did_install_syntax_menu = 1
+
+" Skip setting up the individual syntax selection menus unless
+" do_syntax_sel_menu is defined (it takes quite a bit of time).
+if exists("do_syntax_sel_menu")
+ runtime! synmenu.vim
+else
+ an 50.10 &Syntax.&Show\ filetypes\ in\ menu :let do_syntax_sel_menu = 1<Bar>runtime! synmenu.vim<Bar>aunmenu &Syntax.&Show\ filetypes\ in\ menu<CR>
+ an 50.195 &Syntax.-SEP1- <Nop>
+endif
+
+an 50.210 &Syntax.&Off :syn off<CR>
+an 50.700 &Syntax.-SEP3- <Nop>
+an 50.710 &Syntax.Co&lor\ test :sp $VIMRUNTIME/syntax/colortest.vim<Bar>so %<CR>
+an 50.720 &Syntax.&Highlight\ test :runtime syntax/hitest.vim<CR>
+an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim<CR>
+
+endif " !exists("did_install_syntax_menu")
+
+" Restore the previous value of 'cpoptions'.
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: set sw=2 :
diff --git a/runtime/mswin.vim b/runtime/mswin.vim
new file mode 100644
index 000000000..4072af1c6
--- /dev/null
+++ b/runtime/mswin.vim
@@ -0,0 +1,115 @@
+" Set options and add mapping such that Vim behaves a lot like MS-Windows
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2004 May 26
+
+" set the 'cpoptions' to its Vim default
+if 1 " only do this when compiled with expression evaluation
+ let s:save_cpo = &cpoptions
+endif
+set cpo&vim
+
+" set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
+behave mswin
+
+" backspace and cursor keys wrap to previous/next line
+set backspace=indent,eol,start whichwrap+=<,>,[,]
+
+" backspace in Visual mode deletes selection
+vnoremap <BS> d
+
+" CTRL-X and SHIFT-Del are Cut
+vnoremap <C-X> "+x
+vnoremap <S-Del> "+x
+
+" CTRL-C and CTRL-Insert are Copy
+vnoremap <C-C> "+y
+vnoremap <C-Insert> "+y
+
+" CTRL-V and SHIFT-Insert are Paste
+map <C-V> "+gP
+map <S-Insert> "+gP
+
+cmap <C-V> <C-R>+
+cmap <S-Insert> <C-R>+
+
+" Pasting blockwise and linewise selections is not possible in Insert and
+" Visual mode without the +virtualedit feature. They are pasted as if they
+" were characterwise instead.
+" Note: the same stuff appears in menu.vim.
+if has("virtualedit")
+ nnoremap <silent> <SID>Paste :call <SID>Paste()<CR>
+ func! <SID>Paste()
+ let ove = &ve
+ set ve=all
+ normal `^
+ if @+ != ''
+ normal "+gP
+ endif
+ let c = col(".")
+ normal i
+ if col(".") < c " compensate for i<ESC> moving the cursor left
+ normal l
+ endif
+ let &ve = ove
+ endfunc
+ inoremap <script> <C-V> x<BS><Esc><SID>Pastegi
+ vnoremap <script> <C-V> "-c<Esc><SID>Paste
+else
+ nnoremap <silent> <SID>Paste "=@+.'xy'<CR>gPFx"_2x
+ inoremap <script> <C-V> x<Esc><SID>Paste"_s
+ vnoremap <script> <C-V> "-c<Esc>gix<Esc><SID>Paste"_x
+endif
+imap <S-Insert> <C-V>
+vmap <S-Insert> <C-V>
+
+" Use CTRL-Q to do what CTRL-V used to do
+noremap <C-Q> <C-V>
+
+" Use CTRL-S for saving, also in Insert mode
+noremap <C-S> :update<CR>
+vnoremap <C-S> <C-C>:update<CR>
+inoremap <C-S> <C-O>:update<CR>
+
+" For CTRL-V to work autoselect must be off.
+" On Unix we have two selections, autoselect can be used.
+if !has("unix")
+ set guioptions-=a
+endif
+
+" CTRL-Z is Undo; not in cmdline though
+noremap <C-Z> u
+inoremap <C-Z> <C-O>u
+
+" CTRL-Y is Redo (although not repeat); not in cmdline though
+noremap <C-Y> <C-R>
+inoremap <C-Y> <C-O><C-R>
+
+" Alt-Space is System menu
+if has("gui")
+ noremap <M-Space> :simalt ~<CR>
+ inoremap <M-Space> <C-O>:simalt ~<CR>
+ cnoremap <M-Space> <C-C>:simalt ~<CR>
+endif
+
+" CTRL-A is Select all
+noremap <C-A> gggH<C-O>G
+inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
+cnoremap <C-A> <C-C>gggH<C-O>G
+
+" CTRL-Tab is Next window
+noremap <C-Tab> <C-W>w
+inoremap <C-Tab> <C-O><C-W>w
+cnoremap <C-Tab> <C-C><C-W>w
+
+" CTRL-F4 is Close window
+noremap <C-F4> <C-W>c
+inoremap <C-F4> <C-O><C-W>c
+cnoremap <C-F4> <C-C><C-W>c
+
+" restore 'cpoptions'
+set cpo&
+if 1
+ let &cpoptions = s:save_cpo
+ unlet s:save_cpo
+endif
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
new file mode 100644
index 000000000..d5f45115d
--- /dev/null
+++ b/runtime/optwin.vim
@@ -0,0 +1,1193 @@
+" These commands create the option window.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 May 04
+
+" If there already is an option window, jump to that one.
+if bufwinnr("option-window") > 0
+ let s:thiswin = winnr()
+ while 1
+ if @% == "option-window"
+ finish
+ endif
+ exe "norm! \<C-W>w"
+ if s:thiswin == winnr()
+ break
+ endif
+ endwhile
+endif
+
+" Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would
+" not be recognized. See ":help 'cpoptions'".
+let s:cpo_save = &cpo
+set cpo&vim
+
+" function to be called when <CR> is hit in the option-window
+fun! <SID>CR()
+
+ " If on a continued comment line, go back to the first comment line
+ let lnum = line(".")
+ let line = getline(lnum)
+ while line[0] == "\t"
+ let lnum = lnum - 1
+ let line = getline(lnum)
+ endwhile
+
+ " <CR> on a "set" line executes the option line
+ if match(line, "^ \tset ") >= 0
+
+ " For a local option: go to the previous window
+ " If this is a help window, go to the window below it
+ let thiswin = winnr()
+ let local = <SID>Find(lnum)
+ if local >= 0
+ exe line
+ call <SID>Update(lnum, line, local, thiswin)
+ endif
+
+ " <CR> on a "option" line shows help for that option
+ elseif match(line, "^[a-z]") >= 0
+ let name = substitute(line, '\([^\t]*\).*', '\1', "")
+ exe "help '" . name . "'"
+
+ " <CR> on an index line jumps to the group
+ elseif match(line, '^ \=[0-9]') >= 0
+ exe "norm! /" . line . "\<CR>zt"
+ endif
+endfun
+
+" function to be called when <Space> is hit in the option-window
+fun! <SID>Space()
+
+ let lnum = line(".")
+ let line = getline(lnum)
+
+ " <Space> on a "set" line refreshes the option line
+ if match(line, "^ \tset ") >= 0
+
+ " For a local option: go to the previous window
+ " If this is a help window, go to the window below it
+ let thiswin = winnr()
+ let local = <SID>Find(lnum)
+ if local >= 0
+ call <SID>Update(lnum, line, local, thiswin)
+ endif
+
+ endif
+endfun
+
+" find the window in which the option applies
+" returns 0 for global option, 1 for local option, -1 for error
+fun! <SID>Find(lnum)
+ if getline(a:lnum - 1) =~ "(local to"
+ let local = 1
+ let thiswin = winnr()
+ exe "norm! \<C-W>p"
+ if exists("b:current_syntax") && b:current_syntax == "help"
+ exe "norm! \<C-W>j"
+ if winnr() == thiswin
+ exe "norm! \<C-W>j"
+ endif
+ endif
+ else
+ let local = 0
+ endif
+ if local && (winnr() == thiswin || (exists("b:current_syntax")
+ \ && b:current_syntax == "help"))
+ echo "Don't know in which window"
+ let local = -1
+ endif
+ return local
+endfun
+
+" Update a "set" line in the option window
+fun! <SID>Update(lnum, line, local, thiswin)
+ " get the new value of the option and update the option window line
+ if match(a:line, "=") >= 0
+ let name = substitute(a:line, '^ \tset \([^=]*\)=.*', '\1', "")
+ else
+ let name = substitute(a:line, '^ \tset \(no\)\=\([a-z]*\).*', '\2', "")
+ endif
+ if name == "pt" && &pt =~ "\x80"
+ let val = <SID>PTvalue()
+ else
+ exe "let val = substitute(&" . name . ', "[ \\t\\\\\"|]", "\\\\\\0", "g")'
+ endif
+ if a:local
+ exe "norm! " . a:thiswin . "\<C-W>w"
+ endif
+ if match(a:line, "=") >= 0 || (val != "0" && val != "1")
+ call setline(a:lnum, " \tset " . name . "=" . val)
+ else
+ if val
+ call setline(a:lnum, " \tset " . name . "\tno" . name)
+ else
+ call setline(a:lnum, " \tset no" . name . "\t" . name)
+ endif
+ endif
+ set nomodified
+endfun
+
+" Reset 'title' and 'icon' to make it work faster.
+let s:old_title = &title
+let s:old_icon = &icon
+let s:old_sc = &sc
+let s:old_ru = &ru
+set notitle noicon nosc noru
+
+" If the current window is a help window, try finding a non-help window.
+" Relies on syntax highlighting to be switched on.
+let s:thiswin = winnr()
+while exists("b:current_syntax") && b:current_syntax == "help"
+ exe "norm! \<C-W>w"
+ if s:thiswin == winnr()
+ break
+ endif
+endwhile
+
+" Open the window
+new option-window
+setlocal ts=15 tw=0
+
+" Insert help and a "set" command for each option.
+call append(0, '" Each "set" line shows the current value of an option (on the left).')
+call append(1, '" Hit <CR> on a "set" line to execute it.')
+call append(2, '" A boolean option will be toggled.')
+call append(3, '" For other options you can edit the value.')
+call append(4, '" Hit <CR> on a help line to open a help window on this option.')
+call append(5, '" Hit <CR> on an index line to jump there.')
+call append(6, '" Hit <Space> on a "set" line to refresh it.')
+
+" These functions are called often below. Keep them fast!
+
+" Init a local binary option
+fun! <SID>BinOptionL(name)
+ exe "norm! \<C-W>p"
+ exe "let val = &" . a:name
+ exe "norm! \<C-W>p"
+ call append("$", substitute(substitute(" \tset " . val . a:name . "\t" .
+ \!val . a:name, "0", "no", ""), "1", "", ""))
+endfun
+
+" Init a global binary option
+fun! <SID>BinOptionG(name, val)
+ call append("$", substitute(substitute(" \tset " . a:val . a:name . "\t" .
+ \!a:val . a:name, "0", "no", ""), "1", "", ""))
+endfun
+
+" Init a local string option
+fun! <SID>OptionL(name)
+ exe "norm! \<C-W>p"
+ exe "let val = substitute(&" . a:name . ', "[ \\t\\\\\"|]", "\\\\\\0", "g")'
+ exe "norm! \<C-W>p"
+ call append("$", " \tset " . a:name . "=" . val)
+endfun
+
+" Init a global string option
+fun! <SID>OptionG(name, val)
+ call append("$", " \tset " . a:name . "=" . substitute(a:val, '[ \t\\"|]',
+ \ '\\\0', "g"))
+endfun
+
+let s:idx = 1
+let s:lnum = line("$")
+call append("$", "")
+
+fun! <SID>Header(text)
+ let line = s:idx . " " . a:text
+ if s:idx < 10
+ let line = " " . line
+ endif
+ call append("$", "")
+ call append("$", line)
+ call append("$", "")
+ call append(s:lnum, line)
+ let s:idx = s:idx + 1
+ let s:lnum = s:lnum + 1
+endfun
+
+" Get the value of 'pastetoggle'. It could be a special key.
+fun! <SID>PTvalue()
+ redir @a
+ silent set pt
+ redir END
+ return substitute(@a, '[^=]*=\(.*\)', '\1', "")
+endfun
+
+" Restore the previous value of 'cpoptions' here, it's used below.
+let &cpo = s:cpo_save
+
+" List of all options, organized by function.
+" The text should be sufficient to know what the option is used for.
+
+call <SID>Header("important")
+call append("$", "compatible\tbehave very Vi compatible (not advisable)")
+call <SID>BinOptionG("cp", &cp)
+call append("$", "cpoptions\tlist of flags to specify Vi compatibility")
+call <SID>OptionG("cpo", &cpo)
+call append("$", "insertmode\tuse Insert mode as the default mode")
+call <SID>BinOptionG("im", &im)
+call append("$", "paste\tpaste mode, insert typed text literally")
+call <SID>BinOptionG("paste", &paste)
+call append("$", "pastetoggle\tkey sequence to toggle paste mode")
+if &pt =~ "\x80"
+ call append("$", " \tset pt=" . <SID>PTvalue())
+else
+ call <SID>OptionG("pt", &pt)
+endif
+call append("$", "runtimepath\tlist of directories used for runtime files and plugins")
+call <SID>OptionG("rtp", &rtp)
+call append("$", "helpfile\tname of the main help file")
+call <SID>OptionG("hf", &hf)
+
+
+call <SID>Header("moving around, searching and patterns")
+call append("$", "whichwrap\tlist of flags specifying which commands wrap to another line")
+call append("$", "\t(local to window)")
+call <SID>OptionL("ww")
+call append("$", "startofline\tmany jump commands move the cursor to the first non-blank")
+call append("$", "\tcharacter of a line")
+call <SID>BinOptionG("sol", &sol)
+call append("$", "paragraphs\tnroff macro names that separate paragraphs")
+call <SID>OptionG("para", &para)
+call append("$", "sections\tnroff macro names that separate sections")
+call <SID>OptionG("sect", &sect)
+call append("$", "path\tlist of directory names used for file searching")
+call append("$", "\t(global or local to buffer)")
+call <SID>OptionG("pa", &pa)
+call append("$", "cdpath\tlist of directory names used for :cd")
+call <SID>OptionG("cd", &cd)
+if has("netbeans_intg") || has("sun_workshop")
+ call append("$", "autochdir\tchange to directory of file in buffer")
+ call <SID>BinOptionG("acd", &acd)
+endif
+call append("$", "wrapscan\tsearch commands wrap around the end of the buffer")
+call <SID>BinOptionG("ws", &ws)
+call append("$", "incsearch\tshow match for partly typed search command")
+call <SID>BinOptionG("is", &is)
+call append("$", "magic\tchange the way backslashes are used in search patterns")
+call <SID>BinOptionG("magic", &magic)
+call append("$", "ignorecase\tignore case when using a search pattern")
+call <SID>BinOptionG("ic", &ic)
+call append("$", "smartcase\toverride 'ignorecase' when pattern has upper case characters")
+call <SID>BinOptionG("scs", &scs)
+call append("$", "casemap\tWhat method to use for changing case of letters")
+call <SID>OptionG("cmp", &cmp)
+call append("$", "define\tpattern for a macro definition line")
+call append("$", "\t(global or local to buffer)")
+call <SID>OptionG("def", &def)
+if has("find_in_path")
+ call append("$", "include\tpattern for an include-file line")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("inc")
+ call append("$", "includeexpr\texpression used to transform an include line to a file name")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("inex")
+endif
+
+
+call <SID>Header("tags")
+call append("$", "tagbsearch\tuse binary searching in tags files")
+call <SID>BinOptionG("tbs", &tbs)
+call append("$", "taglength\tnumber of significant characters in a tag name or zero")
+call append("$", " \tset tl=" . &tl)
+call append("$", "tags\tlist of file names to search for tags")
+call append("$", "\t(global or local to buffer)")
+call <SID>OptionG("tag", &tag)
+call append("$", "tagrelative\tfile names in a tags file are relative to the tags file")
+call <SID>BinOptionG("tr", &tr)
+call append("$", "tagstack\ta :tag command will use the tagstack")
+call <SID>BinOptionG("tgst", &tgst)
+call append("$", "showfulltag\twhen completing tags in Insert mode show more info")
+call <SID>BinOptionG("sft", &sft)
+if has("cscope")
+ call append("$", "cscopeprg\tcommand for executing cscope")
+ call <SID>OptionG("csprg", &csprg)
+ call append("$", "cscopetag\tuse cscope for tag commands")
+ call <SID>BinOptionG("cst", &cst)
+ call append("$", "cscopetagorder\t0 or 1; the order in which \":cstag\" performs a search")
+ call append("$", " \tset csto=" . &csto)
+ call append("$", "cscopeverbose\tgive messages when adding a cscope database")
+ call <SID>BinOptionG("csverb", &csverb)
+ call append("$", "cscopepathcomp\thow many components of the path to show")
+ call append("$", " \tset cspc=" . &cspc)
+ call append("$", "cscopequickfix\tWhen to open a quickfix window for cscope")
+ call <SID>OptionG("csqf", &csqf)
+endif
+
+
+call <SID>Header("displaying text")
+call append("$", "scroll\tnumber of lines to scroll for CTRL-U and CTRL-D")
+call append("$", "\t(local to window)")
+call <SID>OptionL("scr")
+call append("$", "scrolloff\tnumber of screen lines to show around the cursor")
+call append("$", " \tset so=" . &so)
+call append("$", "wrap\tlong lines wrap")
+call <SID>BinOptionG("wrap", &wrap)
+call append("$", "linebreak\twrap long lines at a character in 'breakat'")
+call append("$", "\t(local to window)")
+call <SID>BinOptionL("lbr")
+call append("$", "breakat\twhich characters might cause a line break")
+call <SID>OptionG("brk", &brk)
+call append("$", "showbreak\tstring to put before wrapped screen lines")
+call <SID>OptionG("sbr", &sbr)
+call append("$", "sidescroll\tminimal number of columns to scroll horizontally")
+call append("$", " \tset ss=" . &ss)
+call append("$", "sidescrolloff\tminimal number of columns to keep left and right of the cursor")
+call append("$", " \tset siso=" . &siso)
+call append("$", "display\tinclude \"lastline\" to show the last line even if it doesn't fit")
+call append("$", "\tinclude \"uhex\" to show unprintable characters as a hex number")
+call <SID>OptionG("dy", &dy)
+call append("$", "fillchars\tcharacters to use for the status line, folds and filler lines")
+call <SID>OptionG("fcs", &fcs)
+call append("$", "cmdheight\tnumber of lines used for the command-line")
+call append("$", " \tset ch=" . &ch)
+call append("$", "columns\twidth of the display")
+call append("$", " \tset co=" . &co)
+call append("$", "lines\tnumber of lines in the display")
+call append("$", " \tset lines=" . &lines)
+call append("$", "lazyredraw\tdon't redraw while executing macros")
+call <SID>BinOptionG("lz", &lz)
+call append("$", "writedelay\tdelay in msec for each char written to the display")
+call append("$", "\t(for debugging)")
+call append("$", " \tset wd=" . &wd)
+call append("$", "list\tshow <Tab> as ^I and end-of-line as $")
+call append("$", "\t(local to window)")
+call <SID>BinOptionL("list")
+call append("$", "listchars\tlist of strings used for list mode")
+call <SID>OptionG("lcs", &lcs)
+call append("$", "number\tshow the line number for each line")
+call append("$", "\t(local to window)")
+call <SID>BinOptionL("nu")
+
+
+call <SID>Header("syntax and highlighting")
+call append("$", "background\t\"dark\" or \"light\"; the background color brightness")
+call <SID>OptionG("bg", &bg)
+if has("autocmd")
+ call append("$", "filetype\ttype of file; triggers the FileType event when set")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("ft")
+endif
+if has("syntax")
+ call append("$", "syntax\tname of syntax highlighting used")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("syn")
+endif
+call append("$", "highlight\twhich highlighting to use for various occasions")
+call <SID>OptionG("hl", &hl)
+call append("$", "hlsearch\thighlight all matches for the last used search pattern")
+call <SID>BinOptionG("hls", &hls)
+
+
+call <SID>Header("multiple windows")
+call append("$", "laststatus\t0, 1 or 2; when to use a status line for the last window")
+call append("$", " \tset ls=" . &ls)
+if has("statusline")
+ call append("$", "statusline\talternate format to be used for a status line")
+ call <SID>OptionG("stl", &stl)
+endif
+call append("$", "equalalways\tmake all windows the same size when adding/removing windows")
+call <SID>BinOptionG("ea", &ea)
+if has("vertsplit")
+ call append("$", "eadirection\tin which direction 'equalalways' works: \"ver\", \"hor\" or \"both\"")
+ call <SID>OptionG("ead", &ead)
+endif
+call append("$", "winheight\tminimal number of lines used for the current window")
+call append("$", " \tset wh=" . &wh)
+call append("$", "winminheight\tminimal number of lines used for any window")
+call append("$", " \tset wmh=" . &wmh)
+call append("$", "winfixheight\tkeep the height of the window")
+call append("$", "\t(local to window)")
+call <SID>BinOptionL("wfh")
+if has("vertsplit")
+ call append("$", "winwidth\tminimal number of columns used for the current window")
+ call append("$", " \tset wiw=" . &wiw)
+ call append("$", "winminwidth\tminimal number of columns used for any window")
+ call append("$", " \tset wmw=" . &wmw)
+endif
+call append("$", "helpheight\tinitial height of the help window")
+call append("$", " \tset hh=" . &hh)
+if has("quickfix")
+ call append("$", "previewheight\tdefault height for the preview window")
+ call append("$", " \tset pvh=" . &pvh)
+ call append("$", "previewwindow\tidentifies the preview window")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("pvw")
+endif
+call append("$", "hidden\tdon't unload a buffer when no longer shown in a window")
+call <SID>BinOptionG("hid", &hid)
+call append("$", "switchbuf\t\"useopen\" and/or \"split\"; which window to use when jumping")
+call append("$", "\tto a buffer")
+call <SID>OptionG("swb", &swb)
+call append("$", "splitbelow\ta new window is put below the current one")
+call <SID>BinOptionG("sb", &sb)
+if has("vertsplit")
+ call append("$", "splitright\ta new window is put right of the current one")
+ call <SID>BinOptionG("spr", &spr)
+endif
+if has("scrollbind")
+ call append("$", "scrollbind\tthis window scrolls together with other bound windows")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("scb")
+ call append("$", "scrollopt\t\"ver\", \"hor\" and/or \"jump\"; list of options for 'scrollbind'")
+ call <SID>OptionG("sbo", &sbo)
+endif
+
+
+call <SID>Header("terminal")
+call append("$", "term\tname of the used terminal")
+call <SID>OptionG("term", &term)
+call append("$", "ttytype\talias for 'term'")
+call <SID>OptionG("tty", &tty)
+call append("$", "ttybuiltin\tcheck built-in termcaps first")
+call <SID>BinOptionG("tbi", &tbi)
+call append("$", "ttyfast\tterminal connection is fast")
+call <SID>BinOptionG("tf", &tf)
+call append("$", "weirdinvert\tterminal that requires extra redrawing")
+call <SID>BinOptionG("wiv", &wiv)
+call append("$", "esckeys\trecognize keys that start with <Esc> in Insert mode")
+call <SID>BinOptionG("ek", &ek)
+call append("$", "scrolljump\tminimal number of lines to scroll at a time")
+call append("$", " \tset sj=" . &sj)
+call append("$", "ttyscroll\tmaximum number of lines to use scrolling instead of redrawing")
+call append("$", " \tset tsl=" . &tsl)
+if has("gui") || has("msdos") || has("win32")
+ call append("$", "guicursor\tspecifies what the cursor looks like in different modes")
+ call <SID>OptionG("gcr", &gcr)
+endif
+if has("title")
+ let &title = s:old_title
+ call append("$", "title\tshow info in the window title")
+ call <SID>BinOptionG("title", &title)
+ set notitle
+ call append("$", "titlelen\tpercentage of 'columns' used for the window title")
+ call append("$", " \tset titlelen=" . &titlelen)
+ call append("$", "titlestring\twhen not empty, string to be used for the window title")
+ call <SID>OptionG("titlestring", &titlestring)
+ call append("$", "titleold\tstring to restore the title to when exiting Vim")
+ call <SID>OptionG("titleold", &titleold)
+ let &icon = s:old_icon
+ call append("$", "icon\tset the text of the icon for this window")
+ call <SID>BinOptionG("icon", &icon)
+ set noicon
+ call append("$", "iconstring\twhen not empty, text for the icon of this window")
+ call <SID>OptionG("iconstring", &iconstring)
+endif
+if has("win32")
+ call append("$", "restorescreen\trestore the screen contents when exiting Vim")
+ call <SID>BinOptionG("rs", &rs)
+endif
+
+
+call <SID>Header("using the mouse")
+call append("$", "mouse\tlist of flags for using the mouse")
+call <SID>OptionG("mouse", &mouse)
+if has("gui")
+ call append("$", "mousefocus\tthe window with the mouse pointer becomes the current one")
+ call <SID>BinOptionG("mousef", &mousef)
+ call append("$", "mousehide\thide the mouse pointer while typing")
+ call <SID>BinOptionG("mh", &mh)
+endif
+call append("$", "mousemodel\t\"extend\", \"popup\" or \"popup_setpos\"; what the right")
+call append("$", "\tmouse button is used for")
+call <SID>OptionG("mousem", &mousem)
+call append("$", "mousetime\tmaximum time in msec to recognize a double-click")
+call append("$", " \tset mouset=" . &mouset)
+call append("$", "ttymouse\t\"xterm\", \"xterm2\", \"dec\" or \"netterm\"; type of mouse")
+call <SID>OptionG("ttym", &ttym)
+if has("mouseshape")
+ call append("$", "mouseshape\twhat the mouse pointer looks like in different modes")
+ call <SID>OptionG("mouses", &mouses)
+endif
+
+
+if has("gui")
+ call <SID>Header("GUI")
+ call append("$", "guifont\tlist of font names to be used in the GUI")
+ call <SID>OptionG("gfn", &gfn)
+ if has("xfontset")
+ call append("$", "guifontset\tpair of fonts to be used, for multibyte editing")
+ call <SID>OptionG("gfs", &gfs)
+ endif
+ call append("$", "guifontwide\tlist of font names to be used for double-wide characters")
+ call <SID>OptionG("gfw", &gfw)
+ if has("mac")
+ call append("$", "antialias\tuse smooth, antialiased fonts")
+ call <SID>BinOptionG("anti", &anti)
+ endif
+ call append("$", "guioptions\tlist of flags that specify how the GUI works")
+ call <SID>OptionG("go", &go)
+ if has("gui_gtk")
+ call append("$", "toolbar\t\"icons\", \"text\" and/or \"tooltips\"; how to show the toolbar")
+ call <SID>OptionG("tb", &tb)
+ if has("gui_gtk2")
+ call append("$", "toolbariconsize\tSize of toolbar icons")
+ call <SID>OptionG("tbis", &tbis)
+ endif
+ call append("$", "guiheadroom\troom (in pixels) left above/below the window")
+ call append("$", " \tset ghr=" . &ghr)
+ endif
+ call append("$", "guipty\tuse a pseudo-tty for I/O to external commands")
+ call <SID>BinOptionG("guipty", &guipty)
+ if has("browse")
+ call append("$", "browsedir\t\"last\", \"buffer\" or \"current\": which directory used for the file browser")
+ call <SID>OptionG("bsdir", &bsdir)
+ endif
+ if has("multi_lang")
+ call append("$", "langmenu\tlanguage to be used for the menus")
+ call <SID>OptionG("langmenu", &lm)
+ endif
+ call append("$", "menuitems\tmaximum number of items in one menu")
+ call append("$", " \tset mis=" . &mis)
+ if has("winaltkeys")
+ call append("$", "winaltkeys\t\"no\", \"yes\" or \"menu\"; how to use the ALT key")
+ call <SID>OptionG("wak", &wak)
+ endif
+ call append("$", "linespace\tnumber of pixel lines to use between characters")
+ call append("$", " \tset lsp=" . &lsp)
+ if has("balloon_eval")
+ call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
+ call append("$", " \tset bdlay=" . &bdlay)
+ if has("sun_workshop")
+ call append("$", "ballooneval\twhether the balloon evaluation is to be used")
+ call <SID>BinOptionG("beval", &beval)
+ endif
+ endif
+endif
+
+if has("printer")
+ call <SID>Header("printing")
+ call append("$", "printdevice\tname of the printer to be used for :hardcopy")
+ call <SID>OptionG("pdev", &pdev)
+ call append("$", "printencoding\tencoding used to print the PostScript file for :hardcopy")
+ call <SID>OptionG("penc", &penc)
+ call append("$", "printexpr\texpression used to print the PostScript file for :hardcopy")
+ call <SID>OptionG("pexpr", &pexpr)
+ call append("$", "printfont\tname of the font to be used for :hardcopy")
+ call <SID>OptionG("pfn", &pfn)
+ call append("$", "printheader\tformat of the header used for :hardcopy")
+ call <SID>OptionG("pheader", &pheader)
+ call append("$", "printoptions\tlist of items that control the format of :hardcopy output")
+ call <SID>OptionG("popt", &popt)
+endif
+
+call <SID>Header("messages and info")
+call append("$", "terse\tadd 's' flag in 'shortmess' (don't show search message)")
+call <SID>BinOptionG("terse", &terse)
+call append("$", "shortmess\tlist of flags to make messages shorter")
+call <SID>OptionG("shm", &shm)
+call append("$", "showcmd\tshow (partial) command keys in the status line")
+let &sc = s:old_sc
+call <SID>BinOptionG("sc", &sc)
+set nosc
+call append("$", "showmode\tdisplay the current mode in the status line")
+call <SID>BinOptionG("smd", &smd)
+call append("$", "ruler\tshow cursor position below each window")
+let &ru = s:old_ru
+call <SID>BinOptionG("ru", &ru)
+set noru
+if has("statusline")
+ call append("$", "rulerformat\talternate format to be used for the ruler")
+ call <SID>OptionG("ruf", &ruf)
+endif
+call append("$", "report\tthreshold for reporting number of changed lines")
+call append("$", " \tset report=" . &report)
+call append("$", "verbose\tthe higher the more messages are given")
+call append("$", " \tset vbs=" . &vbs)
+call append("$", "more\tpause listings when the screen is full")
+call <SID>BinOptionG("more", &more)
+if has("dialog_con") || has("dialog_gui")
+ call append("$", "confirm\tstart a dialog when a command fails")
+ call <SID>BinOptionG("cf", &cf)
+endif
+call append("$", "errorbells\tring the bell for error messages")
+call <SID>BinOptionG("eb", &eb)
+call append("$", "visualbell\tuse a visual bell instead of beeping")
+call <SID>BinOptionG("vb", &vb)
+if has("multi_lang")
+ call append("$", "helplang\tlist of preferred languages for finding help")
+ call <SID>OptionG("hlg", &hlg)
+endif
+
+
+call <SID>Header("selecting text")
+call append("$", "selection\t\"old\", \"inclusive\" or \"exclusive\"; how selecting text behaves")
+call <SID>OptionG("sel", &sel)
+call append("$", "selectmode\t\"mouse\", \"key\" and/or \"cmd\"; when to start Select mode")
+call append("$", "\tinstead of Visual mode")
+call <SID>OptionG("slm", &slm)
+if has("clipboard")
+ call append("$", "clipboard\t\"unnamed\" to use the * register like unnamed register")
+ call append("$", "\t\"autoselect\" to always put selected text on the clipboard")
+ call <SID>OptionG("cb", &cb)
+endif
+call append("$", "keymodel\t\"startsel\" and/or \"stopsel\"; what special keys can do")
+call <SID>OptionG("km", &km)
+
+
+call <SID>Header("editing text")
+call append("$", "undolevels\tmaximum number of changes that can be undone")
+call append("$", " \tset ul=" . &ul)
+call append("$", "modified\tchanges have been made and not written to a file")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("mod")
+call append("$", "readonly\tbuffer is not to be written")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("ro")
+call append("$", "modifiable\tchanges to the text are not possible")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("ma")
+call append("$", "textwidth\tline length above which to break a line")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("tw")
+call append("$", "wrapmargin\tmargin from the right in which to break a line")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("wm")
+call append("$", "backspace\tspecifies what <BS>, CTRL-W, etc. can do in Insert mode")
+call append("$", " \tset bs=" . &bs)
+call append("$", "comments\tdefinition of what comment lines look like")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("com")
+call append("$", "formatoptions\tlist of flags that tell how automatic formatting works")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("fo")
+if has("insert_expand")
+ call append("$", "complete\tspecifies how Insert mode completion works")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("cpt")
+ call append("$", "dictionary\tlist of dictionary files for keyword completion")
+ call append("$", "\t(global or local to buffer)")
+ call <SID>OptionG("dict", &dict)
+ call append("$", "thesaurus\tlist of thesaurus files for keyword completion")
+ call append("$", "\t(global or local to buffer)")
+ call <SID>OptionG("tsr", &tsr)
+endif
+call append("$", "infercase\tadjust case of a keyword completion match")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("inf")
+if has("digraphs")
+ call append("$", "digraph\tenable entering digraps with c1 <BS> c2")
+ call <SID>BinOptionG("dg", &dg)
+endif
+call append("$", "tildeop\tthe \"~\" command behaves like an operator")
+call <SID>BinOptionG("top", &top)
+call append("$", "showmatch\tWhen inserting a bracket, briefly jump to its match")
+call <SID>BinOptionG("sm", &sm)
+call append("$", "matchtime\ttenth of a second to show a match for 'showmatch'")
+call append("$", " \tset mat=" . &mat)
+call append("$", "matchpairs\tlist of pairs that match for the \"%\" command")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("mps")
+call append("$", "joinspaces\tuse two spaces after '.' when joining a line")
+call <SID>BinOptionG("js", &js)
+call append("$", "nrformats\t\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for")
+call append("$", "\tCTRL-A and CTRL-X commands")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("nf")
+
+
+call <SID>Header("tabs and indenting")
+call append("$", "tabstop\tnumber of spaces a <Tab> in the text stands for")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("ts")
+call append("$", "shiftwidth\tnumber of spaces used for each step of (auto)indent")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("sw")
+call append("$", "smarttab\ta <Tab> in an indent inserts 'shiftwidth' spaces")
+call <SID>BinOptionG("sta", &sta)
+call append("$", "softtabstop\tif non-zero, number of spaces to insert for a <Tab>")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("sts")
+call append("$", "shiftround\tround to 'shiftwidth' for \"<<\" and \">>\"")
+call <SID>BinOptionG("sr", &sr)
+call append("$", "expandtab\texpand <Tab> to spaces in Insert mode")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("et")
+call append("$", "autoindent\tautomatically set the indent of a new line")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("ai")
+if has("smartindent")
+ call append("$", "smartindent\tdo clever autoindenting")
+ call append("$", "\t(local to buffer)")
+ call <SID>BinOptionL("si")
+endif
+if has("cindent")
+ call append("$", "cindent\tenable specific indenting for C code")
+ call append("$", "\t(local to buffer)")
+ call <SID>BinOptionL("cin")
+ call append("$", "cinoptions\toptions for C-indenting")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("cino")
+ call append("$", "cinkeys\tkeys that trigger C-indenting in Insert mode")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("cink")
+ call append("$", "cinwords\tlist of words that cause more C-indent")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("cinw")
+ call append("$", "indentexpr\texpression used to obtain the indent of a line")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("inde")
+ call append("$", "indentkeys\tkeys that trigger indenting with 'indentexpr' in Insert mode")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("indk")
+endif
+call append("$", "copyindent\tCopy whitespace for indenting from previous line")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("ci")
+call append("$", "preserveindent\tPreserve kind of whitespace when changing indent")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("pi")
+if has("lispindent")
+ call append("$", "lisp\tenable lisp mode")
+ call append("$", "\t(local to buffer)")
+ call <SID>BinOptionL("lisp")
+ call append("$", "lispwords\twords that change how lisp indenting works")
+ call <SID>OptionG("lw", &lw)
+endif
+
+
+if has("folding")
+ call <SID>Header("folding")
+ call append("$", "foldenable\tset to display all folds open")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("fen")
+ call append("$", "foldlevel\tfolds with a level higher than this number will be closed")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdl")
+ call append("$", "foldlevelstart\tvalue for 'foldlevel' when starting to edit a file")
+ call append("$", " \tset fdls=" . &fdls)
+ call append("$", "foldcolumn\twidth of the column used to indicate folds")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdc")
+ call append("$", "foldtext\texpression used to display the text of a closed fold")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdt")
+ call append("$", "foldclose\tset to \"all\" to close a fold when the cursor leaves it")
+ call <SID>OptionG("fcl", &fcl)
+ call append("$", "foldopen\tspecifies for which commands a fold will be opened")
+ call <SID>OptionG("fdo", &fdo)
+ call append("$", "foldminlines\tminimum number of screen lines for a fold to be closed")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fml")
+ call append("$", "commentstring\ttemplate for comments; used to put the marker in")
+ call <SID>OptionL("cms")
+ call append("$", "foldmethod\tfolding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\"")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdm")
+ call append("$", "foldexpr\texpression used when 'foldmethod' is \"expr\"")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fde")
+ call append("$", "foldignore\tused to ignore lines when 'foldmethod' is \"indent\"")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdi")
+ call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fmr")
+ call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod is \"indent\" or \"syntax\"")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("fdn")
+endif
+
+
+if has("diff")
+ call <SID>Header("diff mode")
+ call append("$", "diff\tuse diff mode for the current window")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("diff")
+ call append("$", "diffopt\toptions for using diff mode")
+ call <SID>OptionG("dip", &dip)
+ call append("$", "diffexpr\texpression used to obtain a diff file")
+ call <SID>OptionG("dex", &dex)
+ call append("$", "patchexpr\texpression used to patch a file")
+ call <SID>OptionG("pex", &pex)
+endif
+
+
+call <SID>Header("mapping")
+call append("$", "maxmapdepth\tmaximum depth of mapping")
+call append("$", " \tset mmd=" . &mmd)
+call append("$", "remap\trecognize mappings in mapped keys")
+call <SID>BinOptionG("remap", &remap)
+call append("$", "timeout\tallow timing out halfway into a mapping")
+call <SID>BinOptionG("to", &to)
+call append("$", "ttimeout\tallow timing out halfway into a key code")
+call <SID>BinOptionG("ttimeout", &ttimeout)
+call append("$", "timeoutlen\ttime in msec for 'timeout'")
+call append("$", " \tset tm=" . &tm)
+call append("$", "ttimeoutlen\ttime in msec for 'ttimeout'")
+call append("$", " \tset ttm=" . &ttm)
+
+
+call <SID>Header("reading and writing files")
+call append("$", "modeline\tenable using settings from modelines when reading a file")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("ml")
+call append("$", "modelines\tnumber of lines to check for modelines")
+call append("$", " \tset mls=" . &mls)
+call append("$", "binary\tbinary file editing")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("bin")
+call append("$", "endofline\tlast line in the file has an end-of-line")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("eol")
+if has("multi_byte")
+ call append("$", "bomb\tPrepend a Byte Order Mark to the file")
+ call append("$", "\t(local to buffer)")
+ call <SID>BinOptionL("bomb")
+endif
+call append("$", "fileformat\tend-of-line format: \"dos\", \"unix\" or \"mac\"")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("ff")
+call append("$", "fileformats\tlist of file formats to look for when editing a file")
+call <SID>OptionG("ffs", &ffs)
+call append("$", "textmode\tobsolete, use 'fileformat'")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("tx")
+call append("$", "textauto\tobsolete, use 'fileformats'")
+call <SID>BinOptionG("ta", &ta)
+call append("$", "write\twriting files is allowed")
+call <SID>BinOptionG("write", &write)
+call append("$", "writebackup\twrite a backup file before overwriting a file")
+call <SID>BinOptionG("wb", &wb)
+call append("$", "backup\tkeep a backup after overwriting a file")
+call <SID>BinOptionG("bk", &bk)
+call append("$", "backupskip\tpatterns that specify for which files a backup is not made")
+call append("$", " \tset bsk=" . &bsk)
+call append("$", "backupcopy\twhether to make the backup as a copy or rename the existing file")
+call append("$", " \tset bkc=" . &bkc)
+call append("$", "backupdir\tlist of directories to put backup files in")
+call <SID>OptionG("bdir", &bdir)
+call append("$", "backupext\tfile name extension for the backup file")
+call <SID>OptionG("bex", &bex)
+call append("$", "autowrite\tautomatically write a file when leaving a modified buffer")
+call <SID>BinOptionG("aw", &aw)
+call append("$", "autowriteall\tas 'autowrite', but works with more commands")
+call <SID>BinOptionG("awa", &awa)
+call append("$", "writeany\talways write without asking for confirmation")
+call <SID>BinOptionG("wa", &wa)
+call append("$", "autoread\tautomatically read a file when it was modified outside of Vim")
+call append("$", "\t(global or local to buffer)")
+call <SID>BinOptionG("ar", &ar)
+call append("$", "patchmode\tkeep oldest version of a file; specifies file name extension")
+call <SID>OptionG("pm", &pm)
+if !has("msdos")
+ call append("$", "shortname\tuse 8.3 file names")
+ call append("$", "\t(local to buffer)")
+ call <SID>BinOptionL("sn")
+endif
+
+
+call <SID>Header("the swap file")
+call append("$", "directory\tlist of directories for the swap file")
+call <SID>OptionG("dir", &dir)
+call append("$", "swapfile\tuse a swap file for this buffer")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("swf")
+call append("$", "swapsync\t\"sync\", \"fsync\" or empty; how to flush a swap file to disk")
+call <SID>OptionG("sws", &sws)
+call append("$", "updatecount\tnumber of characters typed to cause a swap file update")
+call append("$", " \tset uc=" . &uc)
+call append("$", "updatetime\ttime in msec after which the swap file will be updated")
+call append("$", " \tset ut=" . &ut)
+call append("$", "maxmem\tmaximum amount of memory in Kbyte used for one buffer")
+call append("$", " \tset mm=" . &mm)
+call append("$", "maxmemtot\tmaximum amount of memory in Kbyte used for all buffers")
+call append("$", " \tset mmt=" . &mmt)
+
+
+call <SID>Header("command line editing")
+call append("$", "history\thow many command lines are remembered ")
+call append("$", " \tset hi=" . &hi)
+call append("$", "wildchar\tkey that triggers command-line expansion")
+call append("$", " \tset wc=" . &wc)
+call append("$", "wildcharm\tlike 'wildchar' but can also be used in a mapping")
+call append("$", " \tset wcm=" . &wcm)
+call append("$", "wildmode\tspecifies how command line completion works")
+call <SID>OptionG("wim", &wim)
+call append("$", "suffixes\tlist of file name extensions that have a lower priority")
+call <SID>OptionG("su", &su)
+if has("file_in_path")
+ call append("$", "suffixesadd\tlist of file name extensions added when searching for a file")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("sua")
+endif
+if has("wildignore")
+ call append("$", "wildignore\tlist of patterns to ignore files for file name completion")
+ call <SID>OptionG("wig", &wig)
+endif
+if has("wildmenu")
+ call append("$", "wildmenu\tcommand-line completion shows a list of matches")
+ call <SID>BinOptionG("wmnu", &wmnu)
+endif
+if has("vertsplit")
+ call append("$", "cedit\tkey used to open the command-line window")
+ call <SID>OptionG("cedit", &cedit)
+ call append("$", "cmdwinheight\theight of the command-line window")
+ call <SID>OptionG("cwh", &cwh)
+endif
+
+
+call <SID>Header("executing external commands")
+call append("$", "shell\tname of the shell program used for external commands")
+call <SID>OptionG("sh", &sh)
+if has("amiga")
+ call append("$", "shelltype\twhen to use the shell or directly execute a command")
+ call append("$", " \tset st=" . &st)
+endif
+call append("$", "shellquote\tcharacter(s) to enclose a shell command in")
+call <SID>OptionG("shq", &shq)
+call append("$", "shellxquote\tlike 'shellquote' but include the redirection")
+call <SID>OptionG("sxq", &sxq)
+call append("$", "shellcmdflag\targument for 'shell' to execute a command")
+call <SID>OptionG("shcf", &shcf)
+call append("$", "shellredir\tused to redirect command output to a file")
+call <SID>OptionG("srr", &srr)
+call append("$", "equalprg\tprogram used for \"=\" command")
+call append("$", "\t(global or local to buffer)")
+call <SID>OptionG("ep", &ep)
+call append("$", "formatprg\tprogram used to format lines with \"gq\" command")
+call <SID>OptionG("fp", &fp)
+call append("$", "keywordprg\tprogram used for the \"K\" command")
+call <SID>OptionG("kp", &kp)
+call append("$", "warn\twarn when using a shell command and a buffer has changes")
+call <SID>BinOptionG("warn", &warn)
+
+
+if has("quickfix")
+ call <SID>Header("running make and jumping to errors")
+ call append("$", "errorfile\tname of the file that contains error messages")
+ call <SID>OptionG("ef", &ef)
+ call append("$", "errorformat\tlist of formats for error messages")
+ call append("$", "\t(global or local to buffer)")
+ call <SID>OptionG("efm", &efm)
+ call append("$", "makeprg\tprogram used for the \":make\" command")
+ call append("$", "\t(global or local to buffer)")
+ call <SID>OptionG("mp", &mp)
+ call append("$", "shellpipe\tstring used to put the output of \":make\" in the error file")
+ call <SID>OptionG("sp", &sp)
+ call append("$", "makeef\tname of the errorfile for the 'makeprg' command")
+ call <SID>OptionG("mef", &mef)
+ call append("$", "grepprg\tprogram used for the \":grep\" command")
+ call append("$", "\t(global or local to buffer)")
+ call <SID>OptionG("gp", &gp)
+ call append("$", "grepformat\tlist of formats for output of 'grepprg'")
+ call <SID>OptionG("gfm", &gfm)
+endif
+
+
+if has("msdos") || has("os2") || has("win16") || has("win32") || has("osfiletype")
+ call <SID>Header("system specific")
+ if has("msdos")
+ call append("$", "bioskey\tcall the BIOS to get a keyoard character")
+ call <SID>BinOptionG("biosk", &biosk)
+ call append("$", "conskey\tuse direct console I/O to get a keyboard character")
+ call <SID>BinOptionG("consk", &consk)
+ endif
+ if has("osfiletype")
+ call append("$", "osfiletype\tOS-specific information about the type of file")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("oft")
+ endif
+ if has("msdos") || has("os2") || has("win16") || has("win32")
+ call append("$", "shellslash\tuse forward slashes in file names; for Unix-like shells")
+ call <SID>BinOptionG("ssl", &ssl)
+ endif
+endif
+
+
+call <SID>Header("language specific")
+call append("$", "isfname\tspecifies the characters in a file name")
+call <SID>OptionG("isf", &isf)
+call append("$", "isident\tspecifies the characters in an identifier")
+call <SID>OptionG("isi", &isi)
+call append("$", "iskeyword\tspecifies the characters in a keyword")
+call append("$", "\t(local to buffer)")
+call <SID>OptionL("isk")
+call append("$", "isprint\tspecifies printable characters")
+call <SID>OptionG("isp", &isp)
+if has("rightleft")
+ call append("$", "rightleft\tdisplay the buffer right-to-left")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("rl")
+ call append("$", "rightleftcmd\tWhen to edit the command-line right-to-left")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("rlc")
+ call append("$", "revins\tInsert characters backwards")
+ call <SID>BinOptionG("ri", &ri)
+ call append("$", "allowrevins\tAllow CTRL-_ in Insert and Command-line mode to toggle 'revins'")
+ call <SID>BinOptionG("ari", &ari)
+ call append("$", "aleph\tthe ASCII code for the first letter of the Hebrew alphabet")
+ call append("$", " \tset al=" . &al)
+ call append("$", "hkmap\tuse Hebrew keyboard mapping")
+ call <SID>BinOptionG("hk", &hk)
+ call append("$", "hkmapp\tuse phonetic Hebrew keyboard mapping")
+ call <SID>BinOptionG("hkp", &hkp)
+endif
+if has("farsi")
+ call append("$", "altkeymap\tuse Farsi as the second language when 'revins' is set")
+ call <SID>BinOptionG("akm", &akm)
+ call append("$", "fkmap\tuse Farsi keyboard mapping")
+ call <SID>BinOptionG("fk", &fk)
+endif
+if has("arabic")
+ call append("$", "arabic\tPrepare for editing Arabic text")
+ call append("$", "\t(local to window)")
+ call <SID>BinOptionL("arab")
+ call append("$", "arabicshape\tPerform shaping of Arabic characters")
+ call <SID>BinOptionG("arshape", &arshape)
+ call append("$", "termbidi\tTerminal will perform bidi handling")
+ call <SID>BinOptionG("tbidi", &tbidi)
+endif
+if has("keymap")
+ call append("$", "keymap\tname of a keyboard mappping")
+ call <SID>OptionL("kmp")
+endif
+if has("langmap")
+ call append("$", "langmap\ttranslate characters for Normal mode")
+ call <SID>OptionG("lmap", &lmap)
+endif
+if has("xim")
+ call append("$", "imdisable\twhen set never use IM; overrules following IM options")
+ call <SID>BinOptionG("imd", &imd)
+endif
+call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
+call append("$", "\t(local to window)")
+call <SID>OptionL("imi")
+call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
+call append("$", "\t(local to window)")
+call <SID>OptionL("ims")
+if has("xim")
+ call append("$", "imcmdline\twhen set always use IM when starting to edit a command line")
+ call <SID>BinOptionG("imc", &imc)
+endif
+
+
+if has("multi_byte")
+ call <SID>Header("multi-byte characters")
+ call append("$", "encoding\tcharacter encoding used in Vim: \"latin1\", \"utf-8\"")
+ call append("$", "\t\"euc-jp\", \"big5\", etc.")
+ call <SID>OptionG("enc", &enc)
+ call append("$", "fileencoding\tcharacter encoding for the current file")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("fenc")
+ call append("$", "fileencodings\tautomatically detected character encodings")
+ call <SID>OptionG("fencs", &fencs)
+ call append("$", "termencoding\tcharacter encoding used by the terminal")
+ call <SID>OptionG("tenc", &tenc)
+ call append("$", "charconvert\texpression used for character encoding conversion")
+ call <SID>OptionG("ccv", &ccv)
+ call append("$", "delcombine\tDelete combining (composing) characters on their own")
+ call <SID>BinOptionG("deco", &deco)
+ if has("xim") && has("gui_gtk")
+ call append("$", "imactivatekey\tkey that activates the X input method")
+ call <SID>OptionG("imak", &imak)
+ endif
+ call append("$", "ambiwidth\tWidth of ambiguous width characters")
+ call <SID>OptionG("ambw", &ambw)
+endif
+
+
+call <SID>Header("various")
+if has("virtualedit")
+ call append("$", "virtualedit\twhen to use virtual editing: \"block\", \"insert\" and/or \"all\"")
+ call <SID>OptionG("ve", &ve)
+endif
+if has("autocmd")
+ call append("$", "eventignore\tlist of autocommand events which are to be ignored")
+ call <SID>OptionG("ei", &ei)
+endif
+call append("$", "loadplugins\tload plugin scripts when starting up")
+call <SID>BinOptionG("lpl", &lpl)
+call append("$", "exrc\tenable reading .vimrc/.exrc/.gvimrc in the current directory")
+call <SID>BinOptionG("ex", &ex)
+call append("$", "secure\tsafer working with script files in the current directory")
+call <SID>BinOptionG("secure", &secure)
+call append("$", "gdefault\tuse the 'g' flag for \":substitute\"")
+call <SID>BinOptionG("gd", &gd)
+call append("$", "edcompatible\t'g' and 'c' flags of \":substitute\" toggle")
+call <SID>BinOptionG("ed", &ed)
+ call append("$", "maxfuncdepth\tmaximum depth of function calls")
+ call append("$", " \tset mfd=" . &mfd)
+if has("mksession")
+ call append("$", "sessionoptions\tlist of words that specifies what to put in a session file")
+ call <SID>OptionG("ssop", &ssop)
+ call append("$", "viewoptions\tlist of words that specifies what to save for :mkview")
+ call <SID>OptionG("vop", &vop)
+ call append("$", "viewdir\tdirectory where to store files with :mkview")
+ call <SID>OptionG("vdir", &vdir)
+endif
+if has("viminfo")
+ call append("$", "viminfo\tlist that specifies what to write in the viminfo file")
+ call <SID>OptionG("vi", &vi)
+endif
+if has("quickfix")
+ call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("bh")
+ call append("$", "buftype\t\"\", \"nofile\", \"nowrite\" or \"quickfix\": type of buffer")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("bt")
+endif
+call append("$", "buflisted\twhether the buffer shows up in the buffer list")
+call append("$", "\t(local to buffer)")
+call <SID>BinOptionL("bl")
+call append("$", "debug\tset to \"msg\" to see all error messages")
+call append("$", " \tset debug=" . &debug)
+
+set cpo&vim
+
+" go to first line
+1
+
+" reset 'modified', so that ":q" can be used to close the window
+setlocal nomodified
+
+if has("syntax")
+ " Use Vim highlighting, with some additional stuff
+ setlocal ft=vim
+ syn match optwinHeader "^ \=[0-9].*"
+ syn match optwinName "^[a-z]*\t" nextgroup=optwinComment
+ syn match optwinComment ".*" contained
+ syn match optwinComment "^\t.*"
+ if !exists("did_optwin_syntax_inits")
+ let did_optwin_syntax_inits = 1
+ hi link optwinHeader Title
+ hi link optwinName Identifier
+ hi link optwinComment Comment
+ endif
+endif
+
+" Install autocommands to enable mappings in option-window
+noremap <silent> <buffer> <CR> <C-\><C-N>:call <SID>CR()<CR>
+inoremap <silent> <buffer> <CR> <Esc>:call <SID>CR()<CR>
+noremap <silent> <buffer> <Space> :call <SID>Space()<CR>
+
+" Make the buffer be deleted when the window is closed.
+setlocal buftype=nofile bufhidden=delete noswapfile
+
+augroup optwin
+ au! BufUnload,BufHidden option-window nested
+ \ call <SID>unload() | delfun <SID>unload
+augroup END
+
+fun! <SID>unload()
+ delfun <SID>CR
+ delfun <SID>Space
+ delfun <SID>Find
+ delfun <SID>Update
+ delfun <SID>OptionL
+ delfun <SID>OptionG
+ delfun <SID>BinOptionL
+ delfun <SID>BinOptionG
+ delfun <SID>Header
+ au! optwin
+endfun
+
+" Restore the previous value of 'title' and 'icon'.
+let &title = s:old_title
+let &icon = s:old_icon
+let &ru = s:old_ru
+let &sc = s:old_sc
+let &cpo = s:cpo_save
+unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum
diff --git a/runtime/plugin/README.txt b/runtime/plugin/README.txt
new file mode 100644
index 000000000..489ebf613
--- /dev/null
+++ b/runtime/plugin/README.txt
@@ -0,0 +1,9 @@
+The plugin directory is for standard Vim plugin scripts.
+
+All files here ending in .vim will be sourced by Vim when it starts up.
+
+Standard plugins:
+explorer.vim file browser
+gzip.vim edit compressed files
+netrw.vim edit files over a network
+rrhelper.vim used for --remote-wait editing
diff --git a/runtime/plugin/explorer.vim b/runtime/plugin/explorer.vim
new file mode 100644
index 000000000..4a5b6057f
--- /dev/null
+++ b/runtime/plugin/explorer.vim
@@ -0,0 +1,1326 @@
+"=============================================================================
+" File: explorer.vim
+" Author: M A Aziz Ahmed (aziz@acorn-networks.com - doesn't work)
+" Last Change: 2004 May 13
+" Version: 2.5 + changes
+" Additions by Mark Waggoner (waggoner@aracnet.com) et al.
+"-----------------------------------------------------------------------------
+" This file implements a file explorer.
+"-----------------------------------------------------------------------------
+" Normally, this file will reside in the plugins directory and be
+" automatically sourced. If not, you must manually source this file
+" using :source explorer.vim
+"
+" To use it, just edit a directory (vi dirname) or type :Explore to
+" launch the file explorer in the current window, or :Sexplore to split
+" the current window and launch explorer there.
+"
+" If the current buffer is modified, the window is always split.
+"
+" It is also possible to delete files and rename files within explorer.
+" See :help file-explorer for more details
+"
+"-----------------------------------------------------------------------------
+" Update history removed, it's not very interesting.
+" Contributors were: Doug Potts, Bram Moolenaar, Thomas Köhler
+"=============================================================================
+
+" Has this already been loaded?
+if exists("loaded_explorer")
+ finish
+endif
+let loaded_explorer=1
+
+" Line continuation used here
+let s:cpo_save = &cpo
+set cpo&vim
+
+"---
+" Default settings for global configuration variables
+
+" Split vertically instead of horizontally?
+if !exists("g:explVertical")
+ let g:explVertical=0
+endif
+
+" How big to make the window? Set to "" to avoid resizing
+if !exists("g:explWinSize")
+ let g:explWinSize=15
+endif
+
+" When opening a new file/directory, split below current window (or
+" above)? 1 = below, 0 = to above
+if !exists("g:explSplitBelow")
+ let g:explSplitBelow = &splitbelow
+endif
+
+" Split to right of current window (or to left)?
+" 1 = to right, 0 = to left
+if !exists("g:explSplitRight")
+ let g:explSplitRight = &splitright
+endif
+
+" Start the first explorer window...
+" Defaults to be the same as explSplitBelow
+if !exists("g:explStartBelow")
+ let g:explStartBelow = g:explSplitBelow
+endif
+
+" Start the first explorer window...
+" Defaults to be the same as explSplitRight
+if !exists("g:explStartRight")
+ let g:explStartRight = g:explSplitRight
+endif
+
+" Show detailed help?
+if !exists("g:explDetailedHelp")
+ let g:explDetailedHelp=0
+endif
+
+" Show file size and dates?
+if !exists("g:explDetailedList")
+ let g:explDetailedList=0
+endif
+
+" Format for the date
+if !exists("g:explDateFormat")
+ let g:explDateFormat="%d %b %Y %H:%M"
+endif
+
+" Files to hide
+if !exists("g:explHideFiles")
+ let g:explHideFiles=''
+endif
+
+" Field to sort by
+if !exists("g:explSortBy")
+ let g:explSortBy='name'
+endif
+
+" Segregate directories? 1, 0, or -1
+if !exists("g:explDirsFirst")
+ let g:explDirsFirst=1
+endif
+
+" Segregate items in suffixes option? 1, 0, or -1
+if !exists("g:explSuffixesLast")
+ let g:explSuffixesLast=1
+endif
+
+" Include separator lines between directories, files, and suffixes?
+if !exists("g:explUseSeparators")
+ let g:explUseSeparators=0
+endif
+
+" Execute file handler
+if !exists("g:explFileHandler")
+ if has("win32")
+ " for Win32 use rundll32
+ function! s:explFileHandlerWin32(fn)
+ exec 'silent !start rundll32 url.dll,FileProtocolHandler "'
+ \ . escape(a:fn, '%#') . '"'
+ endfunction
+ let g:explFileHandler = "<SID>explFileHandlerWin32"
+
+ elseif has("unix")
+ " for KDE use kfmclient, for GNUME use gnome-open
+ if executable("kfmclient")
+ let g:explFileHandlerCmd = "kfmclient exec"
+ elseif executable("gnome-open")
+ let g:explFileHandlerCmd = "gnome-open"
+ else
+ let g:explFileHandlerCmd = ""
+ endif
+ if g:explFileHandlerCmd != ""
+ function! s:explFileHandlerUnix(fn)
+ if &shellredir =~ "%s"
+ let redir = substitute(&shellredir, "%s", "/dev/null", "")
+ else
+ let redir = &shellredir . "/dev/null"
+ endif
+ " Need to escape % and # but not spaces.
+ exec "silent !" . g:explFileHandlerCmd . " '" . escape(a:fn, '%#') . "'" . redir
+ endfunction
+ let g:explFileHandler = "<SID>explFileHandlerUnix"
+ endif
+ endif
+endif
+
+"---
+" script variables - these are the same across all
+" explorer windows
+
+" characters that must be escaped for a regular expression
+let s:escregexp = '/*^$.~\'
+
+" characters that must be escaped for filenames
+if has("dos16") || has("dos32") || has("win16") || has("win32") || has("os2")
+ let s:escfilename = ' %#'
+else
+ let s:escfilename = ' \%#[]'
+endif
+
+
+" A line to use for separating sections
+let s:separator='"---------------------------------------------------'
+
+"---
+" Create commands
+
+if !exists(':Explore')
+ command -n=? -complete=dir Explore :call s:StartExplorer(0, '<a>')
+endif
+if !exists(':Sexplore')
+ command -n=? -complete=dir Sexplore :call s:StartExplorer(1, '<a>')
+endif
+
+"---
+" Start the explorer using the preferences from the global variables
+"
+function! s:StartExplorer(split, start_dir)
+ let startcmd = "edit"
+ if a:start_dir != ""
+ let fname=a:start_dir
+ else
+ let fname = expand("%:p:h")
+ endif
+ if fname == ""
+ let fname = getcwd()
+ endif
+
+ " Create a variable to use if splitting vertically
+ let splitMode = ""
+ if g:explVertical == 1
+ let splitMode = "vertical"
+ endif
+
+ " Save the user's settings for splitbelow and splitright
+ let savesplitbelow = &splitbelow
+ let savesplitright = &splitright
+
+ if a:split || &modified
+ let startcmd = splitMode . " " . g:explWinSize . "new " . fname
+ let &splitbelow = g:explStartBelow
+ let &splitright = g:explStartRight
+ else
+ let startcmd = "edit " . fname
+ endif
+ silent execute startcmd
+ let &splitbelow = savesplitbelow
+ let &splitright = savesplitright
+endfunction
+
+"---
+" This is the main entry for 'editing' a directory
+"
+function! s:EditDir()
+ " Get out of here right away if this isn't a directory!
+ let name = expand("%")
+ if name == ""
+ let name = expand("%:p")
+ endif
+ if !isdirectory(name)
+ return
+ endif
+
+ " Turn off the swapfile, set the buffer type so that it won't get
+ " written, and so that it will get deleted when it gets hidden.
+ setlocal noreadonly modifiable
+ setlocal noswapfile
+ setlocal buftype=nowrite
+ setlocal bufhidden=delete
+ " Don't wrap around long lines
+ setlocal nowrap
+
+ " No need for any insertmode abbreviations, since we don't allow
+ " insertions anyway!
+ iabc <buffer>
+
+ " Long or short listing? Use the global variable the first time
+ " explorer is called, after that use the script variable as set by
+ " the interactive user.
+ if exists("s:longlist")
+ let w:longlist = s:longlist
+ else
+ let w:longlist = g:explDetailedList
+ endif
+
+ " Show keyboard shortcuts?
+ if exists("s:longhelp")
+ let w:longhelp = s:longhelp
+ else
+ let w:longhelp = g:explDetailedHelp
+ endif
+
+ " Set the sort based on the global variables the first time. If you
+ " later change the sort order, it will be retained in the s:sortby
+ " variable for the next time you open explorer
+ let w:sortdirection=1
+ let w:sortdirlabel = ""
+ let w:sorttype = ""
+ if exists("s:sortby")
+ let sortby=s:sortby
+ else
+ let sortby=g:explSortBy
+ endif
+ if sortby =~ "reverse"
+ let w:sortdirection=-1
+ let w:sortdirlabel = "reverse "
+ endif
+ if sortby =~ "date"
+ let w:sorttype = "date"
+ elseif sortby =~ "size"
+ let w:sorttype = "size"
+ else
+ let w:sorttype = "name"
+ endif
+ call s:SetSuffixesLast()
+
+ " If directory is already loaded, don't open it again!
+ if line('$') > 1
+ setlocal readonly nomodifiable
+ return
+ endif
+
+ " Get the complete path to the directory to look at with a slash at
+ " the end. This also removes "/../" and "/./" things.
+ let b:completePath = s:Path(expand("%:p"))
+
+ " Add a slash at the end
+ if b:completePath !~ '/$'
+ let b:completePath = b:completePath . '/'
+ endif
+
+ " escape special characters for exec commands
+ let b:completePathEsc = escape(b:completePath, s:escfilename)
+ let b:parentDirEsc = substitute(b:completePathEsc, '/[^/]*/$', '/', 'g')
+
+ " Set up syntax highlighting
+ " Something wrong with the evaluation of the conditional though...
+ if has("syntax") && exists("g:syntax_on") && !has("syntax_items")
+ syn match browseSynopsis "^\"[ -].*"
+ syn match browseDirectory "[^\"].*/ "
+ syn match browseDirectory "[^\"].*/$"
+ syn match browseCurDir "^\"= .*$"
+ syn match browseSortBy "^\" Sorted by .*$" contains=browseSuffixInfo
+ syn match browseSuffixInfo "(.*)$" contained
+ syn match browseFilter "^\" Not Showing:.*$"
+ syn match browseFiletime "««\d\+$"
+ exec('syn match browseSuffixes "' . b:suffixesHighlight . '"')
+
+ "hi def link browseSynopsis PreProc
+ hi def link browseSynopsis Special
+ hi def link browseDirectory Directory
+ hi def link browseCurDir Statement
+ hi def link browseSortBy String
+ hi def link browseSuffixInfo Type
+ hi def link browseFilter String
+ hi def link browseFiletime Ignore
+ hi def link browseSuffixes Type
+ endif
+
+ " Set filter for hiding files
+ let b:filterFormula=substitute(g:explHideFiles, '\([^\\]\),', '\1\\|', 'g')
+ if b:filterFormula != ''
+ let b:filtering="\nNot showing: " . b:filterFormula
+ else
+ let b:filtering=""
+ endif
+
+ " Show the files
+ call s:ShowDirectory()
+
+ " Set up mappings for this buffer
+ let cpo_save = &cpo
+ set cpo&vim
+ nnoremap <buffer> <cr> :call <SID>EditEntry("","edit")<cr>
+ nnoremap <buffer> - :exec ("silent e " . b:parentDirEsc)<cr>
+ if exists("g:explFileHandler")
+ nnoremap <buffer> x :call <SID>ExecuteEntry()<cr>
+ endif
+ nnoremap <buffer> o :call <SID>OpenEntry()<cr>
+ nnoremap <buffer> O :call <SID>OpenEntryPrevWindow()<cr>
+ nnoremap <buffer> p :call <SID>EditEntry("","pedit")<cr>
+ nnoremap <buffer> ? :call <SID>ToggleHelp()<cr>
+ nnoremap <buffer> a :call <SID>ShowAllFiles()<cr>
+ nnoremap <buffer> R :call <SID>RenameFile()<cr>
+ nnoremap <buffer> D :. call <SID>DeleteFile()<cr>
+ vnoremap <buffer> D :call <SID>DeleteFile()<cr>
+ nnoremap <buffer> i :call <SID>ToggleLongList()<cr>
+ nnoremap <buffer> s :call <SID>SortSelect()<cr>
+ nnoremap <buffer> r :call <SID>SortReverse()<cr>
+ nnoremap <buffer> c :exec "cd ".b:completePathEsc<cr>
+ nnoremap <buffer> <2-leftmouse> :call <SID>DoubleClick()<cr>
+ if exists("*ExplorerCustomMap")
+ call ExplorerCustomMap()
+ endif
+ let &cpo = cpo_save
+
+ " prevent the buffer from being modified
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Determine the number of windows open to this buffer number.
+" Care of Yegappan Lakshman. Thanks!
+fun! s:BufInWindows(bnum)
+ let cnt = 0
+ let winnum = 1
+ while 1
+ let bufnum = winbufnr(winnum)
+ if bufnum < 0
+ break
+ endif
+ if bufnum == a:bnum
+ let cnt = cnt + 1
+ endif
+ let winnum = winnum + 1
+ endwhile
+
+ return cnt
+endfunction
+
+" If this is the only window, open file in a new window
+" Otherwise, open file in the most recently visited window
+"
+function! s:OpenEntryPrevWindow()
+ " Figure out if there are any other windows
+ let n = winnr()
+ wincmd p
+ " No other window? Then open a new one
+ if n == winnr()
+ call s:OpenEntry()
+ " Other windows exist
+ else
+ " Check if the previous buffer is modified - ask if they want to save!
+ " Was it modified, and is it the only window open to this file
+ if &modified && s:BufInWindows(winbufnr(winnr())) < 2
+ let bufname = bufname(winbufnr(winnr()))
+
+ let action=confirm("Save Changes in " . bufname . "?","&Yes\n&No\n&Cancel")
+ " Yes - try to save - if there is an error, cancel
+ if action == 1
+ let v:errmsg = ""
+ silent w
+ if v:errmsg != ""
+ echoerr "Unable to write buffer!"
+ wincmd p
+ return
+ endif
+ " No, abandon changes
+ elseif action == 2
+ set nomodified
+ echomsg "Warning, abandoning changes in " . bufname
+ " Cancel (or any other result), don't do the open
+ else
+ wincmd p
+ return
+ endif
+ endif
+ wincmd p
+ call s:EditEntry("wincmd p","edit")
+ endif
+endfunction
+
+
+"---
+" Open a file or directory in a new window.
+" Use g:explSplitBelow and g:explSplitRight to decide where to put the
+" split window, and resize the original explorer window if it is
+" larger than g:explWinSize
+"
+function! s:OpenEntry()
+ " Are we on a line with a file name?
+ let l = getline(".")
+ if l =~ '^"'
+ return
+ endif
+
+ " Copy window settings to script settings
+ let s:sortby=w:sortdirlabel . w:sorttype
+ let s:longhelp = w:longhelp
+ let s:longlist = w:longlist
+
+ " Get the window number of the explorer window
+ let n = winnr()
+
+ " Save the user's settings for splitbelow and splitright
+ let savesplitbelow=&splitbelow
+ let savesplitright=&splitright
+
+ " Figure out how to do the split based on the user's preferences.
+ " We want to split to the (left,right,top,bottom) of the explorer
+ " window, but we want to extract the screen real-estate from the
+ " window next to the explorer if possible.
+ "
+ " 'there' will be set to a command to move from the split window
+ " back to the explorer window
+ "
+ " 'back' will be set to a command to move from the explorer window
+ " back to the newly split window
+ "
+ " 'right' and 'below' will be set to the settings needed for
+ " splitbelow and splitright IF the explorer is the only window.
+ "
+ if g:explVertical
+ if g:explSplitRight
+ let there="wincmd h"
+ let back ="wincmd l"
+ let right=1
+ let below=0
+ else
+ let there="wincmd l"
+ let back ="wincmd h"
+ let right=0
+ let below=0
+ endif
+ else
+ if g:explSplitBelow
+ let there="wincmd k"
+ let back ="wincmd j"
+ let right=0
+ let below=1
+ else
+ let there="wincmd j"
+ let back ="wincmd k"
+ let right=0
+ let below=0
+ endif
+ endif
+
+ " Get the file name
+ let fn=s:GetFullFileName()
+
+ " Attempt to go to adjacent window
+ exec(back)
+ " If no adjacent window, set splitright and splitbelow appropriately
+ if n == winnr()
+ let &splitright=right
+ let &splitbelow=below
+ else
+ " found adjacent window - invert split direction
+ let &splitright=!right
+ let &splitbelow=!below
+ endif
+
+ " Create a variable to use if splitting vertically
+ let splitMode = ""
+ if g:explVertical == 1
+ let splitMode = "vertical"
+ endif
+
+ " Is it a directory? If so, get a real path to it instead of
+ " relative path. This also removes "/../" and "/./" things.
+ if isdirectory(fn)
+ let fn = fnamemodify(fn, ":p")
+ endif
+
+ " Open the new window
+ exec("silent " . splitMode." sp " . escape(fn,s:escfilename))
+
+ " resize the explorer window if it is larger than the requested size
+ exec(there)
+ if g:explWinSize =~ '[0-9]\+' && winheight("") > g:explWinSize
+ exec("silent ".splitMode." resize ".g:explWinSize)
+ endif
+ exec(back)
+
+ " Restore splitmode settings
+ let &splitbelow=savesplitbelow
+ let &splitright=savesplitright
+
+endfunction
+
+function! s:ExecuteEntry()
+ " Are we on a line with a file name?
+ let l = getline(".")
+ if l =~ '^"'
+ return
+ endif
+
+ " Get the file name
+ let fn = s:GetFullFileName()
+ if has("win32") && fn =~ '^//'
+ let fn = substitute(fn, '/', '\\', 'g')
+ endif
+ exec "call " . g:explFileHandler . "(fn)"
+endfunction
+
+"---
+" Double click with the mouse
+"
+function s:DoubleClick()
+ if expand("<cfile>") =~ '[\\/]$'
+ call s:EditEntry("","edit") " directory: open in this window
+ else
+ call s:OpenEntryPrevWindow() " file: open in another window
+ endif
+endfun
+
+"---
+" Open file or directory in the same window as the explorer is
+" currently in
+"
+function! s:EditEntry(movefirst,editcmd)
+ " Are we on a line with a file name?
+ let l = getline(".")
+ if l =~ '^"'
+ return
+ endif
+
+ " Copy window settings to script settings
+ let s:sortby=w:sortdirlabel . w:sorttype
+ let s:longhelp = w:longhelp
+ let s:longlist = w:longlist
+
+ " Get the file name
+ let fn = s:GetFullFileName()
+ if isdirectory(fn)
+ " This removes "/../" and "/./" things.
+ let fn = fnamemodify(fn, ":p")
+ endif
+
+ " Move to desired window if needed
+ exec(a:movefirst)
+ " Edit the file/dir
+ exec(a:editcmd . " " . escape(fn,s:escfilename))
+endfunction
+
+
+"---
+" Create a regular expression out of the suffixes option for sorting
+" and set a string to indicate whether we are sorting with the
+" suffixes at the end (or the beginning)
+"
+function! s:SetSuffixesLast()
+ let b:suffixesRegexp = '\(' . substitute(escape(&suffixes,s:escregexp),',','\\|','g') . '\)$'
+ let b:suffixesHighlight = '^[^"].*\(' . substitute(escape(&suffixes,s:escregexp),',','\\|','g') . '\)\( \|$\)'
+ if has("fname_case")
+ let b:suffixesRegexp = '\C' . b:suffixesRegexp
+ let b:suffixesHighlight = '\C' . b:suffixesHighlight
+ else
+ let b:suffixesRegexp = '\c' . b:suffixesRegexp
+ let b:suffixesHighlight = '\c' . b:suffixesHighlight
+ endif
+ if g:explSuffixesLast > 0 && &suffixes != ""
+ let b:suffixeslast=" (" . &suffixes . " at end of list)"
+ elseif g:explSuffixesLast < 0 && &suffixes != ""
+ let b:suffixeslast=" (" . &suffixes . " at start of list)"
+ else
+ let b:suffixeslast=" ('suffixes' mixed with files)"
+ endif
+endfunction
+
+"---
+" Show the header and contents of the directory
+"
+function! s:ShowDirectory()
+ "Delete all lines
+ 1,$d _
+ " Prevent a report of our actions from showing up
+ let oldRep=&report
+ let save_sc = &sc
+ set report=10000 nosc
+
+ " Add the header
+ call s:AddHeader()
+ $d _
+
+ " Display the files
+
+ " Get a list of all the files
+ let files = s:Path(glob(b:completePathEsc . "*"))
+ if files != "" && files !~ "\n$"
+ let files = files . "\n"
+ endif
+
+ " Add the dot files now, making sure "." is not included!
+ let files = files . substitute(s:Path(glob(b:completePathEsc . ".*")), "[^\n]*/./\\=\n", '' , '')
+ if files != "" && files !~ "\n$"
+ let files = files . "\n"
+ endif
+
+ " Are there any files left after filtering?
+ if files != ""
+ normal! mt
+ put =files
+ let b:maxFileLen = 0
+ 0
+ /^"=/+1,$g/^/call s:MarkDirs()
+ normal! `t
+ call s:AddFileInfo()
+ endif
+
+ normal! zz
+
+ " Move to first directory in the listing
+ 0
+ /^"=/+1
+
+ " Do the sort
+ call s:SortListing("Loaded contents of ".b:completePath.". ")
+
+ " Move to first directory in the listing
+ 0
+ /^"=/+1
+
+ let &report=oldRep
+ let &sc = save_sc
+
+endfunction
+
+"---
+" Mark which items are directories - called once for each file name
+" must be used only when size/date is not displayed
+"
+function! s:MarkDirs()
+ let oldRep=&report
+ set report=1000
+ "Remove slashes if added
+ s;/$;;e
+ "Removes all the leading slashes and adds slashes at the end of directories
+ s;^.*\\\([^\\]*\)$;\1;e
+ s;^.*/\([^/]*\)$;\1;e
+ "normal! ^
+ let currLine=getline(".")
+ if isdirectory(b:completePath . currLine)
+ s;$;/;
+ let fileLen=strlen(currLine)+1
+ else
+ let fileLen=strlen(currLine)
+ if (b:filterFormula!="") && (currLine =~ b:filterFormula)
+ " Don't show the file if it is to be filtered.
+ d _
+ endif
+ endif
+ if fileLen > b:maxFileLen
+ let b:maxFileLen=fileLen
+ endif
+ let &report=oldRep
+endfunction
+
+"---
+" Make sure a path has proper form
+"
+function! s:Path(p)
+ if has("dos16") || has("dos32") || has("win16") || has("win32") || has("os2")
+ return substitute(a:p,'\\','/','g')
+ else
+ return a:p
+ endif
+endfunction
+
+"---
+" Extract the file name from a line in several different forms
+"
+function! s:GetFullFileNameEsc()
+ return s:EscapeFilename(s:GetFullFileName())
+endfunction
+
+function! s:GetFileNameEsc()
+ return s:EscapeFilename(s:GetFileName())
+endfunction
+
+function! s:EscapeFilename(name)
+ return escape(a:name,s:escfilename)
+endfunction
+
+
+function! s:GetFullFileName()
+ return s:ExtractFullFileName(getline("."))
+endfunction
+
+function! s:GetFileName()
+ return s:ExtractFileName(getline("."))
+endfunction
+
+function! s:ExtractFullFileName(line)
+ let fn=s:ExtractFileName(a:line)
+ if fn == '/'
+ return b:completePath
+ else
+ return b:completePath . s:ExtractFileName(a:line)
+ endif
+endfunction
+
+function! s:ExtractFileName(line)
+ return substitute(strpart(a:line,0,b:maxFileLen),'\s\+$','','')
+endfunction
+
+"---
+" Get the size of the file
+function! s:ExtractFileSize(line)
+ if (w:longlist==0)
+ return getfsize(s:ExtractFileName(a:line))
+ else
+ return strpart(a:line,b:maxFileLen+2,b:maxFileSizeLen)
+ endif
+endfunction
+
+"---
+" Get the date of the file as a number
+function! s:ExtractFileDate(line)
+ if w:longlist==0
+ return getftime(s:ExtractFileName(a:line))
+ else
+ return strpart(matchstr(strpart(a:line,b:maxFileLen+b:maxFileSizeLen+4),"««.*"),2) + 0
+ endif
+endfunction
+
+
+"---
+" Add the header with help information
+"
+function! s:AddHeader()
+ let save_f=@f
+ 1
+ if w:longhelp==1
+ let @f="\" <enter> : open file or directory\n"
+ \."\" o : open new window for file/directory\n"
+ \."\" O : open file in previously visited window\n"
+ \."\" p : preview the file\n"
+ if exists("g:explFileHandler")
+ let @f=@f."\" x : execute file or directory\n"
+ endif
+ let @f=@f
+ \."\" i : toggle size/date listing\n"
+ \."\" s : select sort field r : reverse sort\n"
+ \."\" - : go up one level c : cd to this dir\n"
+ \."\" R : rename file D : delete file\n"
+ \."\" :help file-explorer for detailed help\n"
+ else
+ let @f="\" Press ? for keyboard shortcuts\n"
+ endif
+ let @f=@f."\" Sorted by ".w:sortdirlabel.w:sorttype.b:suffixeslast.b:filtering."\n"
+ let @f=@f."\"= ".b:completePath."\n"
+ put! f
+ let @f=save_f
+endfunction
+
+
+"---
+" Show the size and date for each file
+"
+function! s:AddFileInfo()
+ let save_sc = &sc
+ set nosc
+
+ " Mark our starting point
+ normal! mt
+
+ call s:RemoveSeparators()
+
+ " Remove all info
+ 0
+ /^"=/+1,$g/^/call setline(line("."),s:GetFileName())
+
+ " Add info if requested
+ if w:longlist==1
+ " Add file size and calculate maximum length of file size field
+ let b:maxFileSizeLen = 0
+ 0
+ /^"=/+1,$g/^/let fn=s:GetFullFileName() |
+ \let fileSize=getfsize(fn) |
+ \let fileSizeLen=strlen(fileSize) |
+ \if fileSizeLen > b:maxFileSizeLen |
+ \ let b:maxFileSizeLen = fileSizeLen |
+ \endif |
+ \exec "normal! ".(b:maxFileLen-strlen(getline("."))+2)."A \<esc>" |
+ \exec 's/$/'.fileSize.'/'
+
+ " Right justify the file sizes and
+ " add file modification date
+ 0
+ /^"=/+1,$g/^/let fn=s:GetFullFileName() |
+ \exec "normal! A \<esc>$b".(b:maxFileLen+b:maxFileSizeLen-strlen(getline("."))+3)."i \<esc>\"_x" |
+ \exec 's/$/ '.escape(s:FileModDate(fn), '/').'/'
+ setlocal nomodified
+ endif
+
+ call s:AddSeparators()
+
+ " return to start
+ normal! `t
+
+ let &sc = save_sc
+endfunction
+
+
+"----
+" Get the modification time for a file
+"
+function! s:FileModDate(name)
+ let filetime=getftime(a:name)
+ if filetime > 0
+ return strftime(g:explDateFormat,filetime) . " ««" . filetime
+ else
+ return ""
+ endif
+endfunction
+
+"---
+" Delete a file or files
+"
+function! s:DeleteFile() range
+ let oldRep = &report
+ let &report = 1000
+
+ let filesDeleted = 0
+ let stopDel = 0
+ let delAll = 0
+ let currLine = a:firstline
+ let lastLine = a:lastline
+ setlocal noreadonly modifiable
+
+ while ((currLine <= lastLine) && (stopDel==0))
+ exec(currLine)
+ let fileName=s:GetFullFileName()
+ if isdirectory(fileName)
+ echo fileName." : Directory deletion not supported yet"
+ let currLine = currLine + 1
+ else
+ if delAll == 0
+ let sure=input("Delete ".fileName." (y/n/a/q)? ")
+ if sure=="a"
+ let delAll = 1
+ endif
+ endif
+ if (sure=="y") || (sure=="a")
+ let success=delete(fileName)
+ if success!=0
+ exec (" ")
+ echo "\nCannot delete ".fileName
+ let currLine = currLine + 1
+ else
+ d _
+ let filesDeleted = filesDeleted + 1
+ let lastLine = lastLine - 1
+ endif
+ elseif sure=="q"
+ let stopDel = 1
+ elseif sure=="n"
+ let currLine = currLine + 1
+ endif
+ endif
+ endwhile
+ echo "\n".filesDeleted." files deleted"
+ let &report = oldRep
+ setlocal nomodified
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Rename a file
+"
+function! s:RenameFile()
+ let fileName=s:GetFullFileName()
+ setlocal noreadonly modifiable
+ if isdirectory(fileName)
+ echo "Directory renaming not supported yet"
+ elseif filereadable(fileName)
+ let altName=input("Rename ".fileName." to : ")
+ echo " "
+ if altName==""
+ setlocal readonly nomodifiable
+ return
+ endif
+ let success=rename(fileName, b:completePath.altName)
+ if success!=0
+ echo "Cannot rename ".fileName. " to ".altName
+ else
+ echo "Renamed ".fileName." to ".altName
+ let oldRep=&report
+ set report=1000
+ e!
+ let &report=oldRep
+ endif
+ endif
+ setlocal nomodified
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Toggle between short and long help
+"
+function! s:ToggleHelp()
+ if exists("w:longhelp") && w:longhelp==0
+ let w:longhelp=1
+ let s:longhelp=1
+ else
+ let w:longhelp=0
+ let s:longhelp=0
+ endif
+ " Allow modification
+ setlocal noreadonly modifiable
+ call s:UpdateHeader()
+ " Disallow modification
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Update the header
+"
+function! s:UpdateHeader()
+ let oldRep=&report
+ set report=10000
+ " Save position
+ normal! mt
+ " Remove old header
+ 0
+ 1,/^"=/ d _
+ " Add new header
+ call s:AddHeader()
+ " Go back where we came from if possible
+ 0
+ if line("'t") != 0
+ normal! `t
+ endif
+
+ let &report=oldRep
+ setlocal nomodified
+endfunction
+
+"---
+" Toggle long vs. short listing
+"
+function! s:ToggleLongList()
+ setlocal noreadonly modifiable
+ if exists("w:longlist") && w:longlist==1
+ let w:longlist=0
+ let s:longlist=0
+ else
+ let w:longlist=1
+ let s:longlist=1
+ endif
+ call s:AddFileInfo()
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Show all files - remove filtering
+"
+function! s:ShowAllFiles()
+ setlocal noreadonly modifiable
+ let b:filterFormula=""
+ let b:filtering=""
+ call s:ShowDirectory()
+ setlocal readonly nomodifiable
+endfunction
+
+"---
+" Figure out what section we are in
+"
+function! s:GetSection()
+ let fn=s:GetFileName()
+ let section="file"
+ if fn =~ '/$'
+ let section="directory"
+ elseif fn =~ b:suffixesRegexp
+ let section="suffixes"
+ endif
+ return section
+endfunction
+
+"---
+" Remove section separators
+"
+function! s:RemoveSeparators()
+ if !g:explUseSeparators
+ return
+ endif
+ 0
+ silent! exec '/^"=/+1,$g/^' . s:separator . "/d _"
+endfunction
+
+"---
+" Add section separators
+" between directories and files if they are separated
+" between files and 'suffixes' files if they are separated
+function! s:AddSeparators()
+ if !g:explUseSeparators
+ return
+ endif
+ 0
+ /^"=/+1
+ let lastsec=s:GetSection()
+ +1
+ .,$g/^/let sec=s:GetSection() |
+ \if g:explDirsFirst != 0 && sec != lastsec &&
+ \ (lastsec == "directory" || sec == "directory") |
+ \ exec "normal! I" . s:separator . "\n\<esc>" |
+ \elseif g:explSuffixesLast != 0 && sec != lastsec &&
+ \ (lastsec == "suffixes" || sec == "suffixes") |
+ \ exec "normal! I" . s:separator . "\n\<esc>" |
+ \endif |
+ \let lastsec=sec
+endfunction
+
+"---
+" General string comparison function
+"
+function! s:StrCmp(line1, line2, direction)
+ if a:line1 < a:line2
+ return -a:direction
+ elseif a:line1 > a:line2
+ return a:direction
+ else
+ return 0
+ endif
+endfunction
+
+"---
+" Function for use with Sort(), to compare the file names
+" Default sort is to put in alphabetical order, but with all directory
+" names before all file names
+"
+function! s:FileNameCmp(line1, line2, direction)
+ let f1=s:ExtractFileName(a:line1)
+ let f2=s:ExtractFileName(a:line2)
+
+ " Put directory names before file names
+ if (g:explDirsFirst != 0) && (f1 =~ '\/$') && (f2 !~ '\/$')
+ return -g:explDirsFirst
+ elseif (g:explDirsFirst != 0) && (f1 !~ '\/$') && (f2 =~ '\/$')
+ return g:explDirsFirst
+ elseif (g:explSuffixesLast != 0) && (f1 =~ b:suffixesRegexp) && (f2 !~ b:suffixesRegexp)
+ return g:explSuffixesLast
+ elseif (g:explSuffixesLast != 0) && (f1 !~ b:suffixesRegexp) && (f2 =~ b:suffixesRegexp)
+ return -g:explSuffixesLast
+ else
+ return s:StrCmp(substitute(f1, "/$", "", ""), substitute(f2, "/$", "", ""), a:direction)
+ endif
+
+endfunction
+
+"---
+" Function for use with Sort(), to compare the file modification dates
+" Default sort is to put NEWEST files first. Reverse will put oldest
+" files first
+"
+function! s:FileDateCmp(line1, line2, direction)
+ let f1=s:ExtractFileName(a:line1)
+ let f2=s:ExtractFileName(a:line2)
+ let t1=s:ExtractFileDate(a:line1)
+ let t2=s:ExtractFileDate(a:line2)
+
+ " Put directory names before file names
+ if (g:explDirsFirst != 0) && (f1 =~ '\/$') && (f2 !~ '\/$')
+ return -g:explDirsFirst
+ elseif (g:explDirsFirst != 0) && (f1 !~ '\/$') && (f2 =~ '\/$')
+ return g:explDirsFirst
+ elseif (g:explSuffixesLast != 0) && (f1 =~ b:suffixesRegexp) && (f2 !~ b:suffixesRegexp)
+ return g:explSuffixesLast
+ elseif (g:explSuffixesLast != 0) && (f1 !~ b:suffixesRegexp) && (f2 =~ b:suffixesRegexp)
+ return -g:explSuffixesLast
+ elseif t1 > t2
+ return -a:direction
+ elseif t1 < t2
+ return a:direction
+ else
+ return s:StrCmp(substitute(f1, "/$", "", ""), substitute(f2, "/$", "", ""), 1)
+ endif
+endfunction
+
+"---
+" Function for use with Sort(), to compare the file sizes
+" Default sort is to put largest files first. Reverse will put
+" smallest files first
+"
+function! s:FileSizeCmp(line1, line2, direction)
+ let f1=s:ExtractFileName(a:line1)
+ let f2=s:ExtractFileName(a:line2)
+ let s1=s:ExtractFileSize(a:line1)
+ let s2=s:ExtractFileSize(a:line2)
+
+ if (g:explDirsFirst != 0) && (f1 =~ '\/$') && (f2 !~ '\/$')
+ return -g:explDirsFirst
+ elseif (g:explDirsFirst != 0) && (f1 !~ '\/$') && (f2 =~ '\/$')
+ return g:explDirsFirst
+ elseif (g:explSuffixesLast != 0) && (f1 =~ b:suffixesRegexp) && (f2 !~ b:suffixesRegexp)
+ return g:explSuffixesLast
+ elseif (g:explSuffixesLast != 0) && (f1 !~ b:suffixesRegexp) && (f2 =~ b:suffixesRegexp)
+ return -g:explSuffixesLast
+ elseif s1 > s2
+ return -a:direction
+ elseif s1 < s2
+ return a:direction
+ else
+ return s:StrCmp(substitute(f1, "/$", "", ""), substitute(f2, "/$", "", ""), 1)
+ endif
+endfunction
+
+"---
+" Sort lines. SortR() is called recursively.
+"
+function! s:SortR(start, end, cmp, direction)
+
+ " Bottom of the recursion if start reaches end
+ if a:start >= a:end
+ return
+ endif
+ "
+ let partition = a:start - 1
+ let middle = partition
+ let partStr = getline((a:start + a:end) / 2)
+ let i = a:start
+ while (i <= a:end)
+ let str = getline(i)
+ exec "let result = " . a:cmp . "(str, partStr, " . a:direction . ")"
+ if result <= 0
+ " Need to put it before the partition. Swap lines i and partition.
+ let partition = partition + 1
+ if result == 0
+ let middle = partition
+ endif
+ if i != partition
+ let str2 = getline(partition)
+ call setline(i, str2)
+ call setline(partition, str)
+ endif
+ endif
+ let i = i + 1
+ endwhile
+
+ " Now we have a pointer to the "middle" element, as far as partitioning
+ " goes, which could be anywhere before the partition. Make sure it is at
+ " the end of the partition.
+ if middle != partition
+ let str = getline(middle)
+ let str2 = getline(partition)
+ call setline(middle, str2)
+ call setline(partition, str)
+ endif
+ call s:SortR(a:start, partition - 1, a:cmp,a:direction)
+ call s:SortR(partition + 1, a:end, a:cmp,a:direction)
+endfunction
+
+"---
+" To Sort a range of lines, pass the range to Sort() along with the name of a
+" function that will compare two lines.
+"
+function! s:Sort(cmp,direction) range
+ call s:SortR(a:firstline, a:lastline, a:cmp, a:direction)
+endfunction
+
+"---
+" Reverse the current sort order
+"
+function! s:SortReverse()
+ if exists("w:sortdirection") && w:sortdirection == -1
+ let w:sortdirection = 1
+ let w:sortdirlabel = ""
+ else
+ let w:sortdirection = -1
+ let w:sortdirlabel = "reverse "
+ endif
+ let s:sortby=w:sortdirlabel . w:sorttype
+ call s:SortListing("")
+endfunction
+
+"---
+" Toggle through the different sort orders
+"
+function! s:SortSelect()
+ " Select the next sort option
+ if !exists("w:sorttype")
+ let w:sorttype="name"
+ elseif w:sorttype == "name"
+ let w:sorttype="size"
+ elseif w:sorttype == "size"
+ let w:sorttype="date"
+ else
+ let w:sorttype="name"
+ endif
+ let s:sortby=w:sortdirlabel . w:sorttype
+ call s:SortListing("")
+endfunction
+
+"---
+" Sort the file listing
+"
+function! s:SortListing(msg)
+ " Save the line we start on so we can go back there when done
+ " sorting
+ let startline = getline(".")
+ let col=col(".")
+ let lin=line(".")
+
+ " Allow modification
+ setlocal noreadonly modifiable
+
+ " Send a message about what we're doing
+ " Don't really need this - it can cause hit return prompts
+" echo a:msg . "Sorting by" . w:sortdirlabel . w:sorttype
+
+ " Create a regular expression out of the suffixes option in case
+ " we need it.
+ call s:SetSuffixesLast()
+
+ " Remove section separators
+ call s:RemoveSeparators()
+
+ " Do the sort
+ 0
+ if w:sorttype == "size"
+ /^"=/+1,$call s:Sort("s:FileSizeCmp",w:sortdirection)
+ elseif w:sorttype == "date"
+ /^"=/+1,$call s:Sort("s:FileDateCmp",w:sortdirection)
+ else
+ /^"=/+1,$call s:Sort("s:FileNameCmp",w:sortdirection)
+ endif
+
+ " Replace the header with updated information
+ call s:UpdateHeader()
+
+ " Restore section separators
+ call s:AddSeparators()
+
+ " Return to the position we started on
+ 0
+ if search('\m^'.escape(startline,s:escregexp),'W') <= 0
+ execute lin
+ endif
+ execute "normal!" col . "|"
+
+ " Disallow modification
+ setlocal nomodified
+ setlocal readonly nomodifiable
+
+endfunction
+
+"---
+" Setup for editing directories after starting up by going to each window.
+" Required for "vim -o filename dirname"
+"
+function! s:EditAll()
+ if winbufnr(2) == -1
+ return
+ endif
+ let cmd = winrestcmd()
+ let curwin = winnr()
+ while 1
+ wincmd w
+ if winnr() == curwin
+ break
+ endif
+ call s:EditDir()
+ endwhile
+ exe cmd
+endfunction
+
+"---
+" Set up the autocommand to allow directories to be edited
+"
+augroup fileExplorer
+ au!
+ " Fill the window when entering the buffer; ":edit dir".
+ au BufEnter * call s:EditDir()
+ " Set the window variables after a split; ":split".
+ au WinEnter * if !exists("w:sortdirection") | call s:EditDir() | endif
+ " Fill the windows after Vim has started up.
+ au VimEnter * call s:EditAll()
+augroup end
+
+" restore 'cpo'
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/plugin/gzip.vim b/runtime/plugin/gzip.vim
new file mode 100644
index 000000000..39b0cbc36
--- /dev/null
+++ b/runtime/plugin/gzip.vim
@@ -0,0 +1,157 @@
+" Vim plugin for editing compressed files.
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Jan 12
+
+" Exit quickly when:
+" - this plugin was already loaded
+" - when 'compatible' is set
+" - some autocommands are already taking care of compressed files
+if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz")
+ finish
+endif
+let loaded_gzip = 1
+
+augroup gzip
+ " Remove all gzip autocommands
+ au!
+
+ " Enable editing of gzipped files
+ " set binary mode before reading the file
+ " use "gzip -d", gunzip isn't always available
+ autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z setlocal bin
+ autocmd BufReadPost,FileReadPost *.gz call s:read("gzip -dn")
+ autocmd BufReadPost,FileReadPost *.bz2 call s:read("bzip2 -d")
+ autocmd BufReadPost,FileReadPost *.Z call s:read("uncompress")
+ autocmd BufWritePost,FileWritePost *.gz call s:write("gzip")
+ autocmd BufWritePost,FileWritePost *.bz2 call s:write("bzip2")
+ autocmd BufWritePost,FileWritePost *.Z call s:write("compress -f")
+ autocmd FileAppendPre *.gz call s:appre("gzip -dn")
+ autocmd FileAppendPre *.bz2 call s:appre("bzip2 -d")
+ autocmd FileAppendPre *.Z call s:appre("uncompress")
+ autocmd FileAppendPost *.gz call s:write("gzip")
+ autocmd FileAppendPost *.bz2 call s:write("bzip2")
+ autocmd FileAppendPost *.Z call s:write("compress -f")
+augroup END
+
+" Function to check that executing "cmd [-f]" works.
+" The result is cached in s:have_"cmd" for speed.
+fun s:check(cmd)
+ let name = substitute(a:cmd, '\(\S*\).*', '\1', '')
+ if !exists("s:have_" . name)
+ let e = executable(name)
+ if e < 0
+ let r = system(name . " --version")
+ let e = (r !~ "not found" && r != "")
+ endif
+ exe "let s:have_" . name . "=" . e
+ endif
+ exe "return s:have_" . name
+endfun
+
+" After reading compressed file: Uncompress text in buffer with "cmd"
+fun s:read(cmd)
+ " don't do anything if the cmd is not supported
+ if !s:check(a:cmd)
+ return
+ endif
+ " make 'patchmode' empty, we don't want a copy of the written file
+ let pm_save = &pm
+ set pm=
+ " remove 'a' and 'A' from 'cpo' to avoid the alternate file changes
+ let cpo_save = &cpo
+ set cpo-=a cpo-=A
+ " set 'modifiable'
+ let ma_save = &ma
+ setlocal ma
+ " when filtering the whole buffer, it will become empty
+ let empty = line("'[") == 1 && line("']") == line("$")
+ let tmp = tempname()
+ let tmpe = tmp . "." . expand("<afile>:e")
+ " write the just read lines to a temp file "'[,']w tmp.gz"
+ execute "silent '[,']w " . tmpe
+ " uncompress the temp file: call system("gzip -dn tmp.gz")
+ call system(a:cmd . " " . tmpe)
+ " delete the compressed lines; remember the line number
+ let l = line("'[") - 1
+ if exists(":lockmarks")
+ lockmarks '[,']d _
+ else
+ '[,']d _
+ endif
+ " read in the uncompressed lines "'[-1r tmp"
+ setlocal nobin
+ if exists(":lockmarks")
+ execute "silent lockmarks " . l . "r " . tmp
+ else
+ execute "silent " . l . "r " . tmp
+ endif
+
+ " if buffer became empty, delete trailing blank line
+ if empty
+ silent $delete _
+ 1
+ endif
+ " delete the temp file and the used buffers
+ call delete(tmp)
+ silent! exe "bwipe " . tmp
+ silent! exe "bwipe " . tmpe
+ let &pm = pm_save
+ let &cpo = cpo_save
+ let &l:ma = ma_save
+ " When uncompressed the whole buffer, do autocommands
+ if empty
+ if &verbose >= 8
+ execute "doau BufReadPost " . expand("%:r")
+ else
+ execute "silent! doau BufReadPost " . expand("%:r")
+ endif
+ endif
+endfun
+
+" After writing compressed file: Compress written file with "cmd"
+fun s:write(cmd)
+ " don't do anything if the cmd is not supported
+ if s:check(a:cmd)
+ " Rename the file before compressing it.
+ let nm = expand("<afile>")
+ let nmt = s:tempname(nm)
+ if rename(nm, nmt) == 0
+ call system(a:cmd . " " . nmt)
+ call rename(nmt . "." . expand("<afile>:e"), nm)
+ endif
+ endif
+endfun
+
+" Before appending to compressed file: Uncompress file with "cmd"
+fun s:appre(cmd)
+ " don't do anything if the cmd is not supported
+ if s:check(a:cmd)
+ " Rename to a weird name to avoid the risk of overwriting another file
+ let nm = expand("<afile>")
+ let nmt = expand("<afile>:p:h") . "/X~=@l9q5"
+ let nmte = nmt . "." . expand("<afile>:e")
+ if rename(nm, nmte) == 0
+ if &patchmode != "" && getfsize(nm . &patchmode) == -1
+ " Create patchmode file by creating the decompressed file new
+ call system(a:cmd . " -c " . nmte . " > " . nmt)
+ call rename(nmte, nm . &patchmode)
+ else
+ call system(a:cmd . " " . nmte)
+ endif
+ call rename(nmt, nm)
+ endif
+ endif
+endfun
+
+" find a file name for the file to be compressed. Use "name" without an
+" extension if possible. Otherwise use a weird name to avoid overwriting an
+" existing file.
+fun s:tempname(name)
+ let fn = fnamemodify(a:name, ":r")
+ if !filereadable(fn) && !isdirectory(fn)
+ return fn
+ endif
+ return fnamemodify(a:name, ":p:h") . "/X~=@l9q5"
+endfun
+
+" vim: set sw=2 :
diff --git a/runtime/plugin/netrw.vim b/runtime/plugin/netrw.vim
new file mode 100644
index 000000000..d3058c55d
--- /dev/null
+++ b/runtime/plugin/netrw.vim
@@ -0,0 +1,1160 @@
+" netrw.vim: (global plugin) Handles file transfer across a network
+" Last Change: Jun 04, 2004
+" Maintainer: Charles E. Campbell, Jr. PhD <drchipNOSPAM at campbellfamily.biz>
+" Version: 44
+" License: Vim License (see vim's :help license)
+"
+" But be doers of the word, and not only hearers, deluding your own selves
+" (James 1:22 RSV)
+" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+" Exit quickly when already loaded or when 'compatible' is set.
+if exists("loaded_netrw") || &cp
+ finish
+endif
+let loaded_netrw = "v44"
+let s:save_cpo = &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Default values for global netrw variables {{{1
+if !exists("g:netrw_ftpmode")
+ let g:netrw_ftpmode= "binary"
+endif
+if !exists("g:netrw_win95ftp")
+ let g:netrw_win95ftp= 1
+endif
+if !exists("g:netrw_cygwin")
+ if has("win32")
+ let g:netrw_cygwin= 1
+ else
+ let g:netrw_cygwin= 0
+ endif
+endif
+
+" ---------------------------------------------------------------------
+" Default values for global protocol variables {{{1
+if !exists("g:netrw_rcp_cmd")
+ let g:netrw_rcp_cmd = "rcp"
+endif
+if !exists("g:netrw_ftp_cmd")
+ let g:netrw_ftp_cmd = "ftp"
+endif
+if !exists("g:netrw_scp_cmd")
+ let g:netrw_scp_cmd = "scp -q"
+endif
+if !exists("g:netrw_sftp_cmd")
+ let g:netrw_sftp_cmd = "sftp"
+endif
+if !exists("g:netrw_http_cmd")
+ if executable("wget")
+ let g:netrw_http_cmd = "wget -q -O"
+ elseif executable("fetch")
+ let g:netrw_http_cmd = "fetch -o"
+ else
+ let g:netrw_http_cmd = ""
+ endif
+endif
+if !exists("g:netrw_dav_cmd")
+ let g:netrw_dav_cmd = "cadaver"
+endif
+if !exists("g:netrw_rsync_cmd")
+ let g:netrw_rsync_cmd = "rsync"
+endif
+if !exists("g:netrw_fetch_cmd")
+ if executable("fetch")
+ let g:netrw_fetch_cmd = "fetch -o"
+ else
+ let g:netrw_fetch_cmd = ""
+ endif
+endif
+
+if has("win32")
+ \ && exists("g:netrw_use_nt_rcp")
+ \ && g:netrw_use_nt_rcp
+ \ && executable( $SystemRoot .'/system32/rcp.exe')
+ let s:netrw_has_nt_rcp = 1
+ let s:netrw_rcpmode = '-b'
+ else
+ let s:netrw_has_nt_rcp = 0
+ let s:netrw_rcpmode = ''
+endif
+
+" ---------------------------------------------------------------------
+" Transparency Support: {{{1
+" Auto-detection for ftp://*, rcp://*, scp://*, sftp://*, http://*, dav://*,
+" and rsync://*
+" Should make file transfers across networks transparent. Currently I haven't
+" supported appends. Hey, gotta leave something for a future <netrw.vim>!
+if version >= 600
+ augroup Network
+ au!
+ if has("win32")
+ au BufReadCmd file://* exe "doau BufReadPre ".expand("<afile>")|exe 'e '.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+ else
+ au BufReadCmd file:///* exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+ au BufReadCmd file://localhost/* exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+ endif
+ au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "doau BufReadPre ".expand("<afile>")|exe "Nread 0r ".expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+ au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "doau BufReadPre ".expand("<afile>")|exe "Nread " .expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+ au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "Nwrite " .expand("<afile>")|call <SID>NetRestorePosn()
+ augroup END
+endif
+
+" ------------------------------------------------------------------------
+" Commands: :Nread, :Nwrite, and :NetUserPass {{{1
+com! -nargs=* Nread call <SID>NetSavePosn()<bar>call <SID>NetRead(<f-args>)<bar>call <SID>NetRestorePosn()
+com! -range=% -nargs=* Nwrite call <SID>NetSavePosn()<bar><line1>,<line2>call <SID>NetWrite(<f-args>)<bar>call <SID>NetRestorePosn()
+com! -nargs=* NetUserPass call NetUserPass(<f-args>)
+
+" ------------------------------------------------------------------------
+" NetSavePosn: saves position of cursor on screen {{{1
+fun! s:NetSavePosn()
+" call Dfunc("NetSavePosn()")
+ " Save current line and column
+ let s:netrw_winnr= winnr()
+ let s:netrw_line = line(".")
+ let s:netrw_col = virtcol(".")
+
+ " Save top-of-screen line
+ norm! H0
+ let s:netrw_hline= line(".")
+
+ call s:NetRestorePosn()
+" call Dret("NetSavePosn : winnr=".s:netrw_winnr." line=".s:netrw_line." col=".s:netrw_col." hline=".s:netrw_hline)
+endfun
+
+" ------------------------------------------------------------------------
+" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{1
+fun! <SID>NetRestorePosn()
+" call Dfunc("NetRestorePosn() winnr=".s:netrw_winnr." line=".s:netrw_line." col=".s:netrw_col." hline=".s:netrw_hline)
+
+ exe "silent! ".s:netrw_winnr."wincmd w"
+ if v:shell_error == 0
+ " as suggested by Bram M: redraw on no error
+ " allows protocol error messages to remain visible
+ redraw!
+ endif
+ " restore top-of-screen line
+ exe "norm! ".s:netrw_hline."G0z\<CR>"
+ " restore position
+ exe "norm! ".s:netrw_line."G0".s:netrw_col."\<bar>"
+
+" call Dret("NetRestorePosn")
+endfun
+
+" ------------------------------------------------------------------------
+" NetRead: responsible for reading a file over the net {{{1
+fun! s:NetRead(...)
+" call Dfunc("NetRead(a:1<".a:1.">)")
+
+ " save options
+ call s:NetOptionSave()
+
+ " get name of a temporary file
+ let tmpfile= tempname()
+
+ " Special Exception: if a file is named "0r", then
+ " "0r" will be used to read the
+ " following files instead of "r"
+ if a:0 == 0
+ let readcmd= "r"
+ let ichoice= 0
+ elseif a:1 == "0r"
+ let readcmd = "0r"
+ let ichoice = 2
+ else
+ let readcmd = "r"
+ let ichoice = 1
+ endif
+
+ while ichoice <= a:0
+
+ " attempt to repeat with previous host-file-etc
+ if exists("b:netrw_lastfile") && a:0 == 0
+" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+ let choice = b:netrw_lastfile
+ let ichoice= ichoice + 1
+
+ else
+ exe "let choice= a:" . ichoice
+" call Decho("NetRead1: choice<" . choice . ">")
+
+ " Reconstruct Choice if choice starts with '"'
+ if match(choice,"?") == 0
+ echo 'NetRead Usage:'
+ echo ':Nread machine:path uses rcp'
+ echo ':Nread "machine path" uses ftp with <.netrc>'
+ echo ':Nread "machine id password path" uses ftp'
+ echo ':Nread dav://machine[:port]/path uses cadaver'
+ echo ':Nread fetch://machine/path uses fetch'
+ echo ':Nread ftp://[user@]machine[:port]/path uses ftp autodetects <.netrc>'
+ echo ':Nread http://[user@]machine/path uses http wget'
+ echo ':Nread rcp://[user@]machine/path uses rcp'
+ echo ':Nread rsync://machine[:port]/path uses rsync'
+ echo ':Nread scp://[user@]machine[[:#]port]/path uses scp'
+ echo ':Nread sftp://[user@]machine[[:#]port]/path uses sftp'
+ break
+ elseif match(choice,"^\"") != -1
+" call Decho("reconstructing choice")
+ if match(choice,"\"$") != -1
+ " case "..."
+ let choice=strpart(choice,1,strlen(choice)-2)
+ else
+ " case "... ... ..."
+ let choice = strpart(choice,1,strlen(choice)-1)
+ let wholechoice = ""
+
+ while match(choice,"\"$") == -1
+ let wholechoice = wholechoice . " " . choice
+ let ichoice = ichoice + 1
+ if ichoice > a:0
+ echoerr "Unbalanced string in filename '". wholechoice ."'"
+" call Dret("NetRead")
+ return
+ endif
+ let choice= a:{ichoice}
+ endwhile
+ let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+ endif
+ endif
+ endif
+" call Decho("NetRead2: choice<" . choice . ">")
+ let ichoice= ichoice + 1
+
+ " fix up windows urls
+ if has("win32")
+ let choice = substitute(choice,'\\','/','ge')
+" call Decho("fixing up windows url to <".choice.">")
+ exe 'lcd ' . fnamemodify(tmpfile,':h')
+ let tmpfile = fnamemodify(tmpfile,':t')
+ endif
+
+ " Determine method of read (ftp, rcp, etc)
+ call s:NetMethod(choice)
+
+ " ============
+ " Perform Read
+ " ============
+
+ ".........................................
+ " rcp: Method #1
+ if b:netrw_method == 1 " read with rcp
+" call Decho("read via rcp (method #1)")
+ " ER: noting done with g:netrw_uid yet?
+ " ER: on Win2K" rcp machine[.user]:file tmpfile
+ " ER: if machine contains '.' adding .user is required (use $USERNAME)
+ " ER: the tmpfile is full path: rcp sees C:\... as host C
+ if s:netrw_has_nt_rcp == 1
+ if exists("g:netrw_uid") && ( g:netrw_uid != "" )
+ let uid_machine = g:netrw_machine .'.'. g:netrw_uid
+ else
+ " Any way needed it machine contains a '.'
+ let uid_machine = g:netrw_machine .'.'. $USERNAME
+ endif
+ else
+ if exists("g:netrw_uid") && ( g:netrw_uid != "" )
+ let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+ else
+ let uid_machine = g:netrw_machine
+ endif
+ endif
+" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+ exe "!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " ftp + <.netrc>: Method #2
+ elseif b:netrw_method == 2 " read with ftp + <.netrc>
+" call Decho("read via ftp+.netrc (method #2)")
+ let netrw_fname= b:netrw_fname
+ new
+ set ff=unix
+ exe "put ='".g:netrw_ftpmode."'"
+ exe "put ='get ".netrw_fname." ".tmpfile."'"
+ if exists("g:netrw_port") && g:netrw_port != ""
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+ exe "%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ else
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+ exe "%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ endif
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$"
+ echoerr getline(1)
+ endif
+ bd!
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " ftp + machine,id,passwd,filename: Method #3
+ elseif b:netrw_method == 3 " read with ftp + machine, id, passwd, and fname
+ " Construct execution string (four lines) which will be passed through filter
+" call Decho("read via ftp+mipf (method #3)")
+ let netrw_fname= b:netrw_fname
+ new
+ set ff=unix
+ if exists("g:netrw_port") && g:netrw_port != ""
+ put ='open '.g:netrw_machine.' '.g:netrw_port
+ else
+ put ='open '.g:netrw_machine
+ endif
+
+ if exists("g:netrw_ftp") && g:netrw_ftp == 1
+ put =g:netrw_uid
+ put =g:netrw_passwd
+ else
+ put ='user '.g:netrw_uid.' '.g:netrw_passwd
+ endif
+
+ if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
+ put =g:netrw_ftpmode
+ endif
+ put ='get '.netrw_fname.' '.tmpfile
+
+ " perform ftp:
+ " -i : turns off interactive prompting from ftp
+ " -n unix : DON'T use <.netrc>, even though it exists
+ " -n win32: quit being obnoxious about password
+" call Decho('performing ftp -i -n')
+ norm 1Gdd
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
+ exe "%!".g:netrw_ftp_cmd." -i -n"
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$"
+ echoerr getline(1)
+ endif
+ bd!
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " scp: Method #4
+ elseif b:netrw_method == 4 " read with scp
+" call Decho("read via scp (method #4)")
+ if exists("g:netrw_port") && g:netrw_port != ""
+ let useport= " -P ".g:netrw_port
+ else
+ let useport= ""
+ endif
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+ exe "!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+ else
+" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+ exe "!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+ endif
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ elseif b:netrw_method == 5 " read with http (wget)
+" call Decho("read via http (method #5)")
+ if g:netrw_http_cmd == ""
+ echoerr "neither wget nor fetch command is available"
+ exit
+ endif
+
+ if match(b:netrw_fname,"#") == -1
+ " simple wget
+" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&')
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+
+ else
+ " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker)
+ let netrw_html= substitute(b:netrw_fname,"#.*$","","")
+ let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
+" call Decho("netrw_html<".netrw_html.">")
+" call Decho("netrw_tag <".netrw_tag.">")
+" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html)
+ exe "!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
+ exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
+ endif
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " cadaver: Method #6
+ elseif b:netrw_method == 6 " read with cadaver
+" call Decho("read via cadaver (method #6)")
+
+ " Construct execution string (four lines) which will be passed through filter
+ let netrw_fname= b:netrw_fname
+ new
+ set ff=unix
+ if exists("g:netrw_port") && g:netrw_port != ""
+ put ='open '.g:netrw_machine.' '.g:netrw_port
+ else
+ put ='open '.g:netrw_machine
+ endif
+ put ='user '.g:netrw_uid.' '.g:netrw_passwd
+
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+ put ='get '.netrw_fname.' '.cygtmpfile
+ else
+ put ='get '.netrw_fname.' '.tmpfile
+ endif
+
+ " perform cadaver operation:
+ norm 1Gdd
+" call Decho("executing: %!".g:netrw_dav_cmd)
+ exe "%!".g:netrw_dav_cmd
+ bd!
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " rsync: Method #7
+ elseif b:netrw_method == 7 " read with rsync
+" call Decho("read via rsync (method #7)")
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+ exe "!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+ else
+" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+ exe "!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+ endif
+ let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " fetch: Method #8
+ " fetch://[user@]host[:http]/path
+ elseif b:netrw_method == 8 " read with fetch
+ if g:netrw_fetch_cmd == ""
+ echoerr "fetch command not available"
+ exit
+ endif
+ if exists("g:netrw_option") && g:netrw_option == ":http"
+ let netrw_option= "http"
+ else
+ let netrw_option= "ftp"
+ endif
+" call Decho("read via fetch for ".netrw_option)
+
+ if exists("g:netrw_uid") && g:netrw_uid != "" && exists("g:netrw_passwd") && g:netrw_passwd != ""
+" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&')
+ else
+" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&')
+ endif
+
+ let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " sftp: Method #9
+ elseif b:netrw_method == 9 " read with sftp
+" call Decho("read via sftp (method #4)")
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+" call Decho("!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+ exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+ else
+" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+ exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+ endif
+ let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ else " Complain
+ echo "***warning*** unable to comply with your request<" . choice . ">"
+ endif
+ endwhile
+
+ " cleanup
+" call Decho("cleanup")
+ if exists("b:netrw_method")
+ unlet b:netrw_method
+ unlet g:netrw_machine
+ unlet b:netrw_fname
+ endif
+ call s:NetOptionRestore()
+
+" call Dret("NetRead")
+endfun
+" end of NetRead
+
+" ------------------------------------------------------------------------
+" NetGetFile: Function to read file "fname" with command "readcmd". {{{1
+fun! s:NetGetFile(readcmd, fname, method)
+" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,fname<".a:fname."> method<".a:method.">)")
+
+ if exists("*NetReadFixup")
+ " for the use of NetReadFixup (not otherwise used internally)
+ let line2= line("$")
+ endif
+
+ " transform paths from / to \ for Windows, unless the shell is bash
+ if &term == "win32"
+ if &shell == "bash"
+ let fname=a:fname
+" call Decho("(win32 && bash) fname<".fname.">")
+ else
+ let fname=substitute(a:fname,'/','\\\\','ge')
+" call Decho("(win32 && !bash) fname<".fname.">")
+ endif
+ else
+ let fname= a:fname
+" call Decho("(copied) fname<".fname.">")
+ endif
+
+ " get the file, but disable undo when reading a new buffer
+ if a:readcmd[0] == '0'
+ let use_e_cmd = 0 " 1 when using ':edit'
+ let delline = 0 " 1 when have to delete empty last line
+ if line("$") == 1 && getline(1) == ""
+ " Now being asked to 0r a file into an empty file.
+ " Safe to :e it instead, unless there is another window on the same buffer.
+ let curbufnr = bufnr("%")
+ let use_e_cmd = 1
+ let delline = 1
+ " Loop over all windows,
+ " reset use_e_cmd when another one is editing the current buffer.
+ let i = 1
+ while 1
+ if i != winnr() && winbufnr(i) == curbufnr
+ let use_e_cmd = 0
+ break
+ endif
+ let i = i + 1
+ if winbufnr(i) < 0
+ break
+ endif
+ endwhile
+ endif
+
+ if use_e_cmd > 0
+ " ':edit' the temp file, wipe out the old buffer and rename the buffer
+ let curfilename = expand("%")
+
+ let binlocal = &l:bin
+ let binglobal = &g:bin
+ if binlocal
+ setglobal bin " Need to set 'bin' globally for ":e" command.
+ endif
+ silent exe "e! ".v:cmdarg." ".fname
+ if binlocal && !binglobal
+ setglobal nobin
+ setlocal bin
+ endif
+
+ exe curbufnr . "bwipe!"
+ exe "f ".curfilename
+ " the ":f newname" apparently leaves the temporary file as the alternate
+ " file in the buffer list (see :ls!). The following command wipes it out.
+ exe bufnr("#")."bwipe!"
+ else
+ let oldul= &ul
+ set ul=-1
+ exe a:readcmd." ".v:cmdarg." ".fname
+ if delline > 0
+ " wipe out last line, which should be a blank line anyway
+ $del
+ endif
+ let &ul= oldul
+ endif
+ else
+ exe a:readcmd." ".v:cmdarg." ".fname
+ endif
+
+ " User-provided (ie. optional) fix-it-up command
+ if exists("*NetReadFixup")
+ let line1= line(".")
+ if a:readcmd == "r"
+ let line2= line("$") - line2 + line1
+ else
+ let line2= line("$") - line2
+ endif
+" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
+ call NetReadFixup(a:method, line1, line2)
+ endif
+" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> fname<".a:fname."> readable=".filereadable(a:fname))
+
+" insure that we have the right filetype and that its being displayed
+ filetype detect
+ redraw!
+" call Dret("NetGetFile")
+endfun
+
+" ------------------------------------------------------------------------
+" NetWrite: responsible for writing a file over the net {{{1
+fun! s:NetWrite(...) range
+" call Dfunc("NetWrite(a:0=".a:0.")")
+
+ " option handling
+ let mod= 0
+ call s:NetOptionSave()
+
+ " Get Temporary Filename
+ let tmpfile= tempname()
+
+ if a:0 == 0
+ let ichoice = 0
+ else
+ let ichoice = 1
+ endif
+
+ " write (selected portion of) file to temporary
+ silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile
+
+ while ichoice <= a:0
+
+ " attempt to repeat with previous host-file-etc
+ if exists("b:netrw_lastfile") && a:0 == 0
+" call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+ let choice = b:netrw_lastfile
+ let ichoice= ichoice + 1
+ else
+ exe "let choice= a:" . ichoice
+
+ " Reconstruct Choice if choice starts with '"'
+ if match(choice,"?") == 0
+ echo 'NetWrite Usage:"'
+ echo ':Nwrite machine:path uses rcp'
+ echo ':Nwrite "machine path" uses ftp with <.netrc>'
+ echo ':Nwrite "machine id password path" uses ftp'
+ echo ':Nwrite dav://[user@]machine/path uses cadaver'
+ echo ':Nwrite fetch://[user@]machine/path uses fetch'
+ echo ':Nwrite ftp://machine[#port]/path uses ftp (autodetects <.netrc>)'
+ echo ':Nwrite rcp://machine/path uses rcp'
+ echo ':Nwrite rsync://[user@]machine/path uses rsync'
+ echo ':Nwrite scp://[user@]machine[[:#]port]/path uses scp'
+ echo ':Nwrite sftp://[user@]machine/path uses sftp'
+ break
+
+ elseif match(choice,"^\"") != -1
+ if match(choice,"\"$") != -1
+ " case "..."
+ let choice=strpart(choice,1,strlen(choice)-2)
+ else
+ " case "... ... ..."
+ let choice = strpart(choice,1,strlen(choice)-1)
+ let wholechoice = ""
+
+ while match(choice,"\"$") == -1
+ let wholechoice= wholechoice . " " . choice
+ let ichoice = ichoice + 1
+ if choice > a:0
+ echoerr "Unbalanced string in filename '". wholechoice ."'"
+" call Dret("NetWrite")
+ return
+ endif
+ let choice= a:{ichoice}
+ endwhile
+ let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+ endif
+ endif
+ endif
+" call Decho("choice<" . choice . ">")
+ let ichoice= ichoice + 1
+
+ " fix up windows urls
+ if has("win32")
+ let choice= substitute(choice,'\\','/','ge')
+ "ER: see NetRead()
+ exe 'lcd ' . fnamemodify(tmpfile,':h')
+ let tmpfile = fnamemodify(tmpfile,':t')
+ endif
+
+ " Determine method of read (ftp, rcp, etc)
+ call s:NetMethod(choice)
+
+ " =============
+ " Perform Write
+ " =============
+
+ ".........................................
+ " rcp: Method #1
+ if b:netrw_method == 1 " write with rcp
+" Decho "write via rcp (method #1)"
+ if s:netrw_has_nt_rcp == 1
+ if exists("g:netrw_uid") && ( g:netrw_uid != "" )
+ let uid_machine = g:netrw_machine .'.'. g:netrw_uid
+ else
+ let uid_machine = g:netrw_machine .'.'. $USERNAME
+ endif
+ else
+ if exists("g:netrw_uid") && ( g:netrw_uid != "" )
+ let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+ else
+ let uid_machine = g:netrw_machine
+ endif
+ endif
+" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&')
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " ftp + <.netrc>: Method #2
+ elseif b:netrw_method == 2 " write with ftp + <.netrc>
+ let netrw_fname = b:netrw_fname
+ new
+ set ff=unix
+ exe "put ='".g:netrw_ftpmode."'"
+" call Decho(" NetWrite: put ='".g:netrw_ftpmode."'")
+ exe "put ='put ".tmpfile." ".netrw_fname."'"
+" call Decho("put ='put ".tmpfile." ".netrw_fname."'")
+ if exists("g:netrw_port") && g:netrw_port != ""
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+ exe "%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ else
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+ exe "%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ endif
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$"
+ echoerr getline(1)
+ let mod=1
+ endif
+ bd!
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " ftp + machine, id, passwd, filename: Method #3
+ elseif b:netrw_method == 3 " write with ftp + machine, id, passwd, and fname
+ let netrw_fname= b:netrw_fname
+ new
+ set ff=unix
+ if exists("g:netrw_port") && g:netrw_port != ""
+ put ='open '.g:netrw_machine.' '.g:netrw_port
+ else
+ put ='open '.g:netrw_machine
+ endif
+ if exists("g:netrw_ftp") && g:netrw_ftp == 1
+ put =g:netrw_uid
+ put =g:netrw_passwd
+ else
+ put ='user '.g:netrw_uid.' '.g:netrw_passwd
+ endif
+ put ='put '.tmpfile.' '.netrw_fname
+ " save choice/id/password for future use
+ let b:netrw_lastfile = choice
+
+ " perform ftp:
+ " -i : turns off interactive prompting from ftp
+ " -n unix : DON'T use <.netrc>, even though it exists
+ " -n win32: quit being obnoxious about password
+" call Decho('performing ftp -i -n')
+ norm 1Gdd
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
+ exe "%!".g:netrw_ftp_cmd." -i -n"
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$"
+ echoerr getline(1)
+ let mod=1
+ endif
+ bd!
+
+ ".........................................
+ " scp: Method #4
+ elseif b:netrw_method == 4 " write with scp
+ if exists("g:netrw_port") && g:netrw_port != ""
+ let useport= " -P ".g:netrw_port
+ else
+ let useport= ""
+ endif
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+" call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+ else
+" call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+ endif
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " http: Method #5
+ elseif b:netrw_method == 5
+ echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
+
+ ".........................................
+ " dav: Method #6
+ elseif b:netrw_method == 6 " write with cadaver
+" call Decho("write via cadaver (method #6)")
+
+ " Construct execution string (four lines) which will be passed through filter
+ let netrw_fname= b:netrw_fname
+ new
+ set ff=unix
+ if exists("g:netrw_port") && g:netrw_port != ""
+ put ='open '.g:netrw_machine.' '.g:netrw_port
+ else
+ put ='open '.g:netrw_machine
+ endif
+ put ='user '.g:netrw_uid.' '.g:netrw_passwd
+
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+ put ='put '.cygtmpfile.' '.netrw_fname
+ else
+ put ='put '.tmpfile.' '.netrw_fname
+ endif
+
+ " perform cadaver operation:
+ norm 1Gdd
+" call Decho("executing: %!".g:netrw_dav_cmd)
+ exe "%!".g:netrw_dav_cmd
+ bd!
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " rsync: Method #7
+ elseif b:netrw_method == 7 " write with rsync
+ if g:netrw_cygwin == 1
+ let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+" call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+ else
+" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+ exe "!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+ endif
+ let b:netrw_lastfile = choice
+
+ ".........................................
+ " scp: Method #9
+ elseif b:netrw_method == 9 " write with sftp
+ let netrw_fname= b:netrw_fname
+ if exists("g:netrw_uid") && ( g:netrw_uid != "" )
+ let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+ else
+ let uid_machine = g:netrw_machine
+ endif
+ new
+ set ff=unix
+ put ='put '.tmpfile.' '.netrw_fname
+ norm 1Gdd
+" call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine)
+ exe "%!".g:netrw_sftp_cmd.' '.uid_machine
+ bd!
+ let b:netrw_lastfile= choice
+
+ ".........................................
+ else " Complain
+ echo "***warning*** unable to comply with your request<" . choice . ">"
+ endif
+ endwhile
+
+ " cleanup
+" call Decho("cleanup")
+ let result=delete(tmpfile)
+ call s:NetOptionRestore()
+
+ if a:firstline == 1 && a:lastline == line("$")
+ let &mod= mod " usually equivalent to set nomod
+ endif
+
+" call Dret("NetWrite")
+endfun
+" end of NetWrite
+
+" ------------------------------------------------------------------------
+" NetMethod: determine method of transfer {{{1
+" method == 1: rcp
+" 2: ftp + <.netrc>
+" 3: ftp + machine, id, password, and [path]filename
+" 4: scp
+" 5: http (wget)
+" 6: cadaver
+" 7: rsync
+" 8: fetch
+" 9: sftp
+fun! s:NetMethod(choice) " globals: method machine id passwd fname
+" call Dfunc("NetMethod(a:choice<".a:choice.">)")
+
+ " initialization
+ let b:netrw_method = 0
+ let g:netrw_machine = ""
+ let b:netrw_fname = ""
+ let g:netrw_port = ""
+
+ " Patterns:
+ " mipf : a:machine a:id password filename Use ftp
+ " mf : a:machine filename Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
+ " ftpurm : ftp://[user@]host[[#:]port]/filename Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
+ " rcpurm : rcp://[user@]host/filename Use rcp
+ " rcphf : [user@]host:filename Use rcp
+ " scpurm : scp://[user@]host[[#:]port]/filename Use scp
+ " httpurm : http://[user@]host/filename Use wget
+ " davurm : dav://host[:port]/path Use cadaver
+ " rsyncurm : rsync://host[:port]/path Use rsync
+ " fetchurm : fetch://[user@]host[:http]/filename Use fetch (defaults to ftp, override for http)
+ " sftpurm : sftp://[user@]host/filename Use scp
+ let mipf = '\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)'
+ let mf = '\(\S\+\)\s\+\(\S\+\)'
+ let ftpurm = 'ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
+ let rcpurm = 'rcp://\(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$'
+ let rcphf = '\(\([^@]\{-}\)@\)\=\(\I\i*\):\(\S\+\)'
+ let scpurm = 'scp://\([^/]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
+ let httpurm = 'http://\([^/]\{-}\)\(/.*\)\=$'
+ let davurm = 'dav://\([^/]\{-}\)/\(.*\)\=$'
+ let rsyncurm = 'rsync://\([^/]\{-}\)/\(.*\)\=$'
+ let fetchurm = 'fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
+ let sftpurm = 'sftp://\([^/]\{-}\)/\(.*\)\=$'
+
+" call Decho("determine method:")
+ " Determine Method
+ " rcp://user@hostname/...path-to-file
+ if match(a:choice,rcpurm) == 0
+" call Decho("rcp://...")
+ let b:netrw_method = 1
+ let userid = substitute(a:choice,rcpurm,'\2',"")
+ let g:netrw_machine= substitute(a:choice,rcpurm,'\3',"")
+ let b:netrw_fname = substitute(a:choice,rcpurm,'\4',"")
+ if userid != ""
+ let g:netrw_uid= userid
+ endif
+
+ " scp://user@hostname/...path-to-file
+ elseif match(a:choice,scpurm) == 0
+" call Decho("scp://...")
+ let b:netrw_method = 4
+ let g:netrw_machine= substitute(a:choice,scpurm,'\1',"")
+ let b:netrw_port = substitute(a:choice,scpurm,'\2',"")
+ let b:netrw_fname = substitute(a:choice,scpurm,'\3',"")
+
+ " http://user@hostname/...path-to-file
+ elseif match(a:choice,httpurm) == 0
+" call Decho("http://...")
+ let b:netrw_method = 5
+ let g:netrw_machine= substitute(a:choice,httpurm,'\1',"")
+ let b:netrw_fname = substitute(a:choice,httpurm,'\2',"")
+
+ " dav://hostname[:port]/..path-to-file..
+ elseif match(a:choice,davurm) == 0
+" call Decho("dav://...")
+ let b:netrw_method= 6
+ let g:netrw_machine= substitute(a:choice,davurm,'\1',"")
+ let b:netrw_fname = substitute(a:choice,davurm,'\2',"")
+
+ " rsync://user@hostname/...path-to-file
+ elseif match(a:choice,rsyncurm) == 0
+" call Decho("rsync://...")
+ let b:netrw_method = 7
+ let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"")
+ let b:netrw_fname = substitute(a:choice,rsyncurm,'\2',"")
+
+ " ftp://[user@]hostname[[:#]port]/...path-to-file
+ elseif match(a:choice,ftpurm) == 0
+" call Decho("ftp://...")
+ let userid = substitute(a:choice,ftpurm,'\2',"")
+ let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
+ let g:netrw_port = substitute(a:choice,ftpurm,'\4',"")
+ let b:netrw_fname = substitute(a:choice,ftpurm,'\5',"")
+ if g:netrw_port != ""
+ let g:netrw_port = substitute(g:netrw_port,"[#:]","","")
+ endif
+ if userid != ""
+ let g:netrw_uid= userid
+ endif
+ if exists("g:netrw_uid") && exists("g:netrw_passwd")
+ let b:netrw_method = 3
+ else
+ if filereadable(expand("$HOME/.netrc")) && !exists("g:netrw_ignorenetrc")
+ let b:netrw_method= 2
+ else
+ if !exists("g:netrw_uid") || g:netrw_uid == ""
+ call NetUserPass()
+ elseif !exists("g:netrw_passwd") || g:netrw_passwd == ""
+ call NetUserPass(g:netrw_uid)
+ " else just use current g:netrw_uid and g:netrw_passwd
+ endif
+ let b:netrw_method= 3
+ endif
+ endif
+
+ elseif match(a:choice,fetchurm) == 0
+" call Decho("fetch://...")
+ let b:netrw_method = 8
+ let g:netrw_userid = substitute(a:choice,fetchurm,'\2',"")
+ let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"")
+ let b:netrw_option = substitute(a:choice,fetchurm,'\4',"")
+ let b:netrw_fname = substitute(a:choice,fetchurm,'\5',"")
+
+ " Issue an ftp : "machine id password [path/]filename"
+ elseif match(a:choice,mipf) == 0
+" call Decho("(ftp) host id pass file")
+ let b:netrw_method = 3
+ let g:netrw_machine = substitute(a:choice,mipf,'\1',"")
+ let g:netrw_uid = substitute(a:choice,mipf,'\2',"")
+ let g:netrw_passwd = substitute(a:choice,mipf,'\3',"")
+ let b:netrw_fname = substitute(a:choice,mipf,'\4',"")
+
+ " Issue an ftp: "hostname [path/]filename"
+ elseif match(a:choice,mf) == 0
+" call Decho("(ftp) host file")
+ if exists("g:netrw_uid") && exists("g:netrw_passwd")
+ let b:netrw_method = 3
+ let g:netrw_machine = substitute(a:choice,mf,'\1',"")
+ let b:netrw_fname = substitute(a:choice,mf,'\2',"")
+
+ elseif filereadable(expand("$HOME/.netrc"))
+ let b:netrw_method = 2
+ let g:netrw_machine = substitute(a:choice,mf,'\1',"")
+ let b:netrw_fname = substitute(a:choice,mf,'\2',"")
+ endif
+
+ " sftp://user@hostname/...path-to-file
+ elseif match(a:choice,sftpurm) == 0
+" call Decho("sftp://...")
+ let b:netrw_method = 9
+ let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"")
+ let b:netrw_fname = substitute(a:choice,sftpurm,'\2',"")
+
+ " Issue an rcp: hostname:filename" (this one should be last)
+ elseif match(a:choice,rcphf) == 0
+" call Decho("(rcp) host:file)")
+ let b:netrw_method = 1
+ let userid = substitute(a:choice,rcphf,'\2',"")
+ let g:netrw_machine= substitute(a:choice,rcphf,'\3',"")
+ let b:netrw_fname = substitute(a:choice,rcphf,'\4',"")
+ if userid != ""
+ let g:netrw_uid= userid
+ endif
+ if has("win32")
+ " don't let PCs try <.netrc>
+ let b:netrw_method = 3
+ endif
+
+ else
+ echoerr "***error*** cannot determine method"
+ let b:netrw_method = -1
+ endif
+
+" call Decho("a:choice <".a:choice.">")
+" call Decho("b:netrw_method <".b:netrw_method.">")
+" call Decho("g:netrw_machine<".g:netrw_machine.">")
+" call Decho("g:netrw_port <".g:netrw_port.">")
+" if exists("g:netrw_uid") "Decho
+" call Decho("g:netrw_uid <".g:netrw_uid.">")
+" endif "Decho
+" if exists("g:netrw_passwd") "Decho
+" call Decho("g:netrw_passwd <".g:netrw_passwd.">")
+" endif "Decho
+" call Decho("b:netrw_fname <".b:netrw_fname.">")
+" call Dret("NetMethod")
+endfun
+" end of NetMethod
+
+" ------------------------------------------------------------------------
+" NetUserPass: set username and password for subsequent ftp transfer {{{1
+" Usage: :call NetUserPass() -- will prompt for userid and password
+" :call NetUserPass("uid") -- will prompt for password
+" :call NetUserPass("uid","password") -- sets global userid and password
+fun! NetUserPass(...)
+
+ " get/set userid
+ if a:0 == 0
+" call Dfunc("NetUserPass(a:0<".a:0.">)")
+ if !exists("g:netrw_uid") || g:netrw_uid == ""
+ " via prompt
+ let g:netrw_uid= input('Enter username: ')
+ endif
+ else " from command line
+" call Dfunc("NetUserPass(a:1<".a:1.">) {")
+ let g:netrw_uid= a:1
+ endif
+
+ " get password
+ if a:0 <= 1 " via prompt
+" call Decho("a:0=".a:0." case <=1:")
+ let g:netrw_passwd= inputsecret("Enter Password: ")
+ else " from command line
+" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
+ let g:netrw_passwd=a:2
+ endif
+" call Dret("NetUserPass")
+endfun
+" end NetUserPass
+
+" ------------------------------------------------------------------------
+" NetOptionSave: save options and set to "standard" form {{{1
+fun!s:NetOptionSave()
+" call Dfunc("NetOptionSave()")
+
+ " Get Temporary Filename
+ let s:aikeep = &ai
+ let s:cinkeep = &cin
+ let s:cinokeep = &cino
+ let s:comkeep = &com
+ let s:cpokeep = &cpo
+ let s:dirkeep = getcwd()
+ let s:gdkeep = &gd
+ let s:twkeep = &tw
+ set cino =
+ set com =
+ set cpo -=aA
+ set nocin noai
+ set tw =0
+ if has("win32") && !has("win95")
+ let s:swfkeep= &swf
+ set noswf
+" call Decho("setting s:swfkeep to <".&swf.">")
+ endif
+
+" call Dret("NetOptionSave")
+endfun
+
+" ------------------------------------------------------------------------
+" NetOptionRestore: restore options {{{1
+fun! s:NetOptionRestore()
+" call Dfunc("NetOptionRestore()")
+
+ let &ai = s:aikeep
+ let &cin = s:cinkeep
+ let &cino = s:cinokeep
+ let &com = s:comkeep
+ let &cpo = s:cpokeep
+ exe "lcd ".s:dirkeep
+ let &gd = s:gdkeep
+ let &tw = s:twkeep
+ if exists("s:swfkeep")
+ let &swf= s:swfkeep
+ unlet s:swfkeep
+ endif
+ unlet s:aikeep
+ unlet s:cinkeep
+ unlet s:cinokeep
+ unlet s:comkeep
+ unlet s:cpokeep
+ unlet s:gdkeep
+ unlet s:twkeep
+ unlet s:dirkeep
+
+" call Dret("NetOptionRestore")
+endfun
+
+" ------------------------------------------------------------------------
+" NetReadFixup: this sort of function is typically written by the user {{{1
+" to handle extra junk that their system's ftp dumps
+" into the transfer. This function is provided as an
+" example and as a fix for a Windows 95 problem: in my
+" experience, win95's ftp always dumped four blank lines
+" at the end of the transfer.
+if has("win95") && g:netrw_win95ftp
+ fun! NetReadFixup(method, line1, line2)
+" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
+ if method == 3 " ftp (no <.netrc>)
+ let fourblanklines= line2 - 3
+ silent fourblanklines.",".line2."g/^\s*/d"
+ endif
+" call Dret("NetReadFixup")
+ endfun
+endif
+
+" ------------------------------------------------------------------------
+" Restore {{{1
+let &cpo= s:save_cpo
+unlet s:save_cpo
+" vim:ts=8 fdm=marker
diff --git a/runtime/plugin/rrhelper.vim b/runtime/plugin/rrhelper.vim
new file mode 100644
index 000000000..05090b59c
--- /dev/null
+++ b/runtime/plugin/rrhelper.vim
@@ -0,0 +1,47 @@
+" Vim plugin with helper function(s) for --remote-wait
+" Maintainer: Flemming Madsen <fma@cci.dk>
+" Last Change: 2004 May 30
+
+" Has this already been loaded?
+if exists("loaded_rrhelper")
+ finish
+endif
+let loaded_rrhelper = 1
+
+" Setup answers for a --remote-wait client who will assume
+" a SetupRemoteReplies() function in the command server
+
+if has("clientserver")
+ function SetupRemoteReplies()
+ let cnt = 0
+ let max = argc()
+
+ let id = expand("<client>")
+ if id == 0
+ return
+ endif
+ while cnt < max
+ " Handle same file from more clients and file being more than once
+ " on the command line by encoding this stuff in the group name
+ let uniqueGroup = "RemoteReply_".id."_".cnt
+
+ " Path separators are always forward slashes for the autocommand pattern.
+ " Escape special characters with a backslash.
+ let f = escape(substitute(argv(cnt), '\\', '/', "g"), ' *,?[{')
+ execute "augroup ".uniqueGroup
+ execute "autocmd ".uniqueGroup." BufUnload ". f ." call DoRemoteReply('".id."', '".cnt."', '".uniqueGroup."', '". f ."')"
+ let cnt = cnt + 1
+ endwhile
+ augroup END
+ endfunc
+
+ function DoRemoteReply(id, cnt, group, file)
+ call server2client(a:id, a:cnt)
+ execute 'autocmd! '.a:group.' BufUnload '.a:file
+ execute 'augroup! '.a:group
+ endfunc
+
+endif
+
+
+" vim: set sw=2 sts=2 :
diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim
new file mode 100644
index 000000000..9914bed6d
--- /dev/null
+++ b/runtime/plugin/tohtml.vim
@@ -0,0 +1,27 @@
+" Vim plugin for converting a syntax highlighted file to HTML.
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Apr 06
+
+" Don't do this when:
+" - when 'compatible' is set
+" - this plugin was already loaded
+" - user commands are not available.
+if !&cp && !exists(":TOhtml") && has("user_commands")
+ command -range=% TOhtml :call Convert2HTML(<line1>, <line2>)
+
+ func Convert2HTML(line1, line2)
+ if a:line2 >= a:line1
+ let g:html_start_line = a:line1
+ let g:html_end_line = a:line2
+ else
+ let g:html_start_line = a:line2
+ let g:html_end_line = a:line1
+ endif
+
+ runtime syntax/2html.vim
+
+ unlet g:html_start_line
+ unlet g:html_end_line
+ endfunc
+
+endif
diff --git a/runtime/print/cp1250.ps b/runtime/print/cp1250.ps
new file mode 100644
index 000000000..9e733cc76
--- /dev/null
+++ b/runtime/print/cp1250.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1250
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1250[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /tilde /.notdef
+/Euro /.notdef /quotesinglbase /.notdef /quotedblbase /ellipsis /dagger /daggerdbl
+/.notdef /perthousand /Scaron /guilsinglleft /Sacute /Tcaron /Zcaron /Zacute
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/.notdef /trademark /scaron /guilsinglright /sacute /tcaron /zcaron /zacute
+/space /caron /breve /Lslash /currency /Aogonek /brokenbar /section
+/dieresis /copyright /Scedilla /guillemotleft /logicalnot /hyphen /registered /Zdotaccent
+/degree /plusminus /ogonek /lslash /acute /mu /paragraph /periodcentered
+/cedilla /aogonek /scedilla /guillemotright /Lcaron /hungarumlaut /lcaron /zdotaccent
+/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla
+/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron
+/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply
+/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls
+/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla
+/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron
+/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide
+/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1251.ps b/runtime/print/cp1251.ps
new file mode 100644
index 000000000..7137504e7
--- /dev/null
+++ b/runtime/print/cp1251.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1251
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1251[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/afii10051 /afii10052 /quotesinglbase /afii10100 /quotedblbase /ellipsis /dagger /daggerdbl
+/Euro /perthousand /afii10058 /guilsinglleft /afii10059 /afii10061 /afii10060 /afii10145
+/afii10099 /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/.notdef /trademark /afii10106 /guilsinglright /afii10107 /afii10109 /afii10108 /afii10193
+/space /afii10062 /afii10110 /afii10057 /currency /afii10050 /brokenbar /section
+/afii10023 /copyright /afii10053 /guillemotleft /logicalnot /hyphen /registered /afii10056
+/degree /plusminus /afii10055 /afii10103 /afii10098 /mu /paragraph /periodcentered
+/afii10071 /afii61352 /afii10101 /guillemotright /afii10105 /afii10054 /afii10102 /afii10104
+/afii10017 /afii10018 /afii10019 /afii10020 /afii10021 /afii10022 /afii10024 /afii10025
+/afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 /afii10033
+/afii10034 /afii10035 /afii10036 /afii10037 /afii10038 /afii10039 /afii10040 /afii10041
+/afii10042 /afii10043 /afii10044 /afii10045 /afii10046 /afii10047 /afii10048 /afii10049
+/afii10065 /afii10066 /afii10067 /afii10068 /afii10069 /afii10070 /afii10072 /afii10073
+/afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 /afii10081
+/afii10082 /afii10083 /afii10084 /afii10085 /afii10086 /afii10087 /afii10088 /afii10089
+/afii10090 /afii10091 /afii10092 /afii10093 /afii10094 /afii10095 /afii10096 /afii10097]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1252.ps b/runtime/print/cp1252.ps
new file mode 100644
index 000000000..a4dd7e675
--- /dev/null
+++ b/runtime/print/cp1252.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1252
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1252[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/Euro /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl
+/circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef /Zcaron /.notdef
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/tilde /trademark /scaron /guilsinglright /oe /.notdef /zcaron /Ydieresis
+/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
+/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1253.ps b/runtime/print/cp1253.ps
new file mode 100644
index 000000000..0482232af
--- /dev/null
+++ b/runtime/print/cp1253.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1253
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1253[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl
+/.notdef /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/.notdef /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef
+/space /dieresistonos /Alphatonos /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /emdash
+/degree /plusminus /twosuperior /threesuperior /tonos /mu /paragraph /periodcentered
+/Epsilontonos /Etatonos /Iotatonos /guillemotright /Omicrontonos /onehalf /Upsilontonos /Omegatonos
+/iotadieresistonos /Alpha /Beta /Gamma /Delta /Epsilon /Zeta /Eta
+/Theta /Iota /Kappa /Lambda /Mu /Nu /Xi /Omicron
+/Pi /Rho /.notdef /Sigma /Tau /Upsilon /Phi /Chi
+/Psi /Omega /Iotadieresis /Upsilondieresis /alphatonos /epsilontonos /etatonos /iotatonos
+/upsilondieresistonos /alpha /beta /gamma /delta /epsilon /zeta /eta
+/theta /iota /kappa /lambda /mu /nu /xi /omicron
+/pi /rho /sigma1 /sigma /tau /upsilon /phi /chi
+/psi /omega /iotadieresis /upsilondieresis /omicrontonos /upsilontonos /omegatonos /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1254.ps b/runtime/print/cp1254.ps
new file mode 100644
index 000000000..9fe7e4771
--- /dev/null
+++ b/runtime/print/cp1254.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1254
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1254[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/Euro /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl
+/circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef /Zcaron /.notdef
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/tilde /trademark /scaron /guilsinglright /oe /.notdef /zcaron /Ydieresis
+/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Gbreve /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Idotaccent /Scedilla /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/gbreve /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
+/oslash /ugrave /uacute /ucircumflex /udieresis /dotlessi /scedilla /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1255.ps b/runtime/print/cp1255.ps
new file mode 100644
index 000000000..cd82f46a0
--- /dev/null
+++ b/runtime/print/cp1255.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1255
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1255[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl
+/circumflex /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/tilde /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef
+/space /.notdef /cent /sterling /newsheqelsign /yen /brokenbar /section
+/dieresis /copyright /.notdef /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/.notdef /onesuperior /.notdef /guillemotright /onequarter /onehalf /threequarters /.notdef
+/sheva /hatafsegol /hatafpatah /hatafqamats /hiriq /tsere /segol /patah
+/qamats /holam /.notdef /qubuts /dagesh /meteg /maqaf /rafe
+/paseq /shindot /sindot /sofpasuq /doublevav /vavyod /doubleyod /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/alef /bet /gimel /dalet /he /vav /zayin /het
+/tet /yod /finalkaf /kaf /lamed /finalmem /mem /finalnun
+/nun /samekh /ayin /finalpe /pe /finaltsadi /tsadi /qof
+/resh /shin /tav /.notdef /.notdef /.notdef /.notdef /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/cp1257.ps b/runtime/print/cp1257.ps
new file mode 100644
index 000000000..2e5d7a7b2
--- /dev/null
+++ b/runtime/print/cp1257.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-cp1257
+%%Version: 1.0 0
+%%EndComments
+/VIM-cp1257[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /quotesinglbase /.notdef /quotedblbase /ellipsis /dagger /daggerdbl
+/.notdef /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef
+/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash
+/.notdef /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef
+/space /caron /breve /sterling /currency /.notdef /brokenbar /section
+/dieresis /copyright /Rcedilla /guillemotleft /logicalnot /hyphen /registered /AE
+/degree /plusminus /ogonek /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /rcedilla /guillemotright /onequarter /onehalf /threequarters /ae
+/Aogonek /Iogonek /Amacron /Cacute /Adieresis /Aring /Eogonek /Emacron
+/Ccaron /Eacute /Zacute /Edot /Gcedilla /Kcedilla /Imacron /Lcedilla
+/Scaron /Nacute /Ncedilla /Oacute /Omacron /Otilde /Odieresis /multiply
+/Uogonek /Lslash /Sacute /Umacron /Udieresis /Zdotaccent /Zcaron /germandbls
+/aogonek /iogonek /amacron /cacute /adieresis /aring /eogonek /emacron
+/ccaron /eacute /zacute /edot /gcedilla /kcedilla /imacron /lcedilla
+/scaron /nacute /ncedilla /oacute /omacron /otilde /odieresis /divide
+/uogonek /lslash /sacute /umacron /udieresis /zdotaccent /zcaron /dotaccent]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/dec-mcs.ps b/runtime/print/dec-mcs.ps
new file mode 100644
index 000000000..34702b727
--- /dev/null
+++ b/runtime/print/dec-mcs.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-dec-mcs
+%%Version: 1.0 0
+%%EndComments
+/VIM-dec-mcs[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /exclamdown /cent /sterling /.notdef /yen /.notdef /section
+/currency /copyright /ordfeminine /guillemotleft /.notdef /.notdef /.notdef /.notdef
+/degree /plusminus /twosuperior /threesuperior /.notdef /mu /paragraph /periodcentered
+/.notdef /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /.notdef /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/.notdef /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /OE
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Ydieresis /.notdef /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/.notdef /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /oe
+/oslash /ugrave /uacute /ucircumflex /udieresis /ydieresis /.notdef /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/ebcdic-uk.ps b/runtime/print/ebcdic-uk.ps
new file mode 100644
index 000000000..1070074bf
--- /dev/null
+++ b/runtime/print/ebcdic-uk.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-ebcdic-uk
+%%Version: 1.0 0
+%%EndComments
+/VIM-ebcdic-uk[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /dollar /period /less /parenleft /plus /bar
+/ampersand /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /exclam /sterling /asterisk /parenright /semicolon /logicalnot
+/minus /slash /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /brokenbar /comma /percent /underscore /greater /question
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /quotereversed /colon /numbersign /at /quoteright /equal /quotedbl
+/.notdef /a /b /c /d /e /f /g
+/h /i /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /j /k /l /m /n /o /p
+/q /r /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /macron /s /t /u /v /w /x
+/y /z /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/braceleft /A /B /C /D /E /F /G
+/H /I /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/braceright /J /K /L /M /N /O /P
+/Q /R /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/backslash /.notdef /S /T /U /V /W /X
+/Y /Z /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/zero /one /two /three /four /five /six /seven
+/eight /nine /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/hp-roman8.ps b/runtime/print/hp-roman8.ps
new file mode 100644
index 000000000..d71b876db
--- /dev/null
+++ b/runtime/print/hp-roman8.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-hp-roman8
+%%Version: 1.0 0
+%%EndComments
+/VIM-hp-roman8[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /Agrave /Acircumflex /Egrave /Ecircumflex /Edieresis /Icircumflex /Idieresis
+/acute /grave /circumflex /dieresis /tilde /Ugrave /Ucircumflex /lira
+/macron /Yacute /yacute /degree /Ccedilla /ccedilla /Ntilde /ntilde
+/exclamdown /questiondown /currency /sterling /yen /section /florin /cent
+/acircumflex /ecircumflex /ocircumflex /ucircumflex /aacute /eacute /oacute /uacute
+/agrave /egrave /ograve /ugrave /adieresis /edieresis /odieresis /udieresis
+/Aring /icircumflex /Oslash /AE /aring /iacute /oslash /ae
+/Adieresis /igrave /Odieresis /Udieresis /Eacute /idieresis /germandbls /Ocircumflex
+/Aacute /Atilde /atilde /Eth /eth /Iacute /Igrave /Oacute
+/Ograve /Otilde /otilde /Scaron /scaron /Uacute /Ydieresis /ydieresis
+/Thorn /thorn /periodcentered /mu /paragraph /threequarters /hyphen /onequarter
+/onehalf /ordfeminine /ordmasculine /guillemotleft /filledbox /guillemotright /plusminus /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-10.ps b/runtime/print/iso-8859-10.ps
new file mode 100644
index 000000000..7d8e2a0f9
--- /dev/null
+++ b/runtime/print/iso-8859-10.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-10
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-10[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /Aogonek /Emacron /Gcedilla /Imacron /Itilde /Kcedilla /section
+/Lcedilla /Dcroat /Scaron /Tbar /Zcaron /endash /Umacron /Eng
+/degree /aogonek /emacron /gcedilla /imacron /itilde /kcedilla /periodcentered
+/lcedilla /dcroat /scaron /tbar /zcaron /emdash /umacron /eng
+/Amacron /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Iogonek
+/Ccaron /Eacute /Eogonek /Edieresis /Edot /Iacute /Icircumflex /Idieresis
+/Eth /Ncedilla /Omacron /Oacute /Ocircumflex /Otilde /Odieresis /Utilde
+/Oslash /Uogonek /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls
+/amacron /aacute /acircumflex /atilde /adieresis /aring /ae /iogonek
+/ccaron /eacute /eogonek /edieresis /edot /iacute /icircumflex /idieresis
+/eth /ncedilla /omacron /oacute /ocircumflex /otilde /odieresis /utilde
+/oslash /uogonek /uacute /ucircumflex /udieresis /yacute /thorn /kgreenlandic]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-11.ps b/runtime/print/iso-8859-11.ps
new file mode 100644
index 000000000..78f775bef
--- /dev/null
+++ b/runtime/print/iso-8859-11.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-11
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-11[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /uni0E01 /uni0E02 /uni0E03 /uni0E04 /uni0E05 /uni0E06 /uni0E07
+/uni0E08 /uni0E09 /uni0E0A /uni0E0B /uni0E0C /uni0E0D /uni0E0E /uni0E0F
+/uni0E10 /uni0E11 /uni0E12 /uni0E13 /uni0E14 /uni0E15 /uni0E16 /uni0E17
+/uni0E18 /uni0E19 /uni0E1A /uni0E1B /uni0E1C /uni0E1D /uni0E1E /uni0E1F
+/uni0E20 /uni0E21 /uni0E22 /uni0E23 /uni0E24 /uni0E25 /uni0E26 /uni0E27
+/uni0E28 /uni0E29 /uni0E2A /uni0E2B /uni0E2C /uni0E2D /uni0E2E /uni0E2F
+/uni0E30 /uni0E31 /uni0E32 /uni0E33 /uni0E34 /uni0E35 /uni0E36 /uni0E37
+/uni0E38 /uni0E39 /uni0E3A /.notdef /space /.notdef /.notdef /uni0E3F
+/uni0E40 /uni0E41 /uni0E42 /uni0E43 /uni0E44 /uni0E45 /uni0E46 /uni0E47
+/uni0E48 /uni0E49 /uni0E4A /uni0E4B /uni0E4C /uni0E4D /uni0E4E /uni0E4F
+/uni0E50 /uni0E51 /uni0E52 /uni0E53 /uni0E54 /uni0E55 /uni0E56 /uni0E57
+ /uni0E58 /uni0E59 /uni0E5A /.notdef /.notdef /.notdef /.notdef /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-13.ps b/runtime/print/iso-8859-13.ps
new file mode 100644
index 000000000..b4348f661
--- /dev/null
+++ b/runtime/print/iso-8859-13.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-13
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-13[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /quotedblright /cent /sterling /currency /quotedblbase /brokenbar /section
+/Oslash /copyright /Rcedilla /guillemotleft /logicalnot /hyphen /registered /AE
+/degree /plusminus /twosuperior /threesuperior /quotedblleft /mu /paragraph /periodcentered
+/oslash /onesuperior /rcedilla /guillemotright /onequarter /onehalf /threequarters /ae
+/Aogonek /Iogonek /Amacron /Cacute /Adieresis /Aring /Eogonek /Emacron
+/Ccaron /Eacute /Zacute /Edot /Gcedilla /Kcedilla /Imacron /Lcedilla
+/Scaron /Nacute /Ncedilla /Oacute /Omacron /Otilde /Odieresis /multiply
+/Uogonek /Lslash /Sacute /Umacron /Udieresis /Zdotaccent /Zcaron /germandbls
+/aogonek /iogonek /amacron /cacute /adieresis /aring /eogonek /emacron
+/ccaron /eacute /zacute /edot /gcedilla /kcedilla /imacron /lcedilla
+/scaron /nacute /ncedilla /oacute /omacron /otilde /odieresis /divide
+/uogonek /lslash /sacute /umacron /udieresis /zdotaccent /zcaron /quoteright]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-14.ps b/runtime/print/iso-8859-14.ps
new file mode 100644
index 000000000..cdfe04268
--- /dev/null
+++ b/runtime/print/iso-8859-14.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-14
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-14[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /uni1E02 /uni1E03 /sterling /Cdotaccent /cdotaccent /uni1E0A /section
+/Wgrave /copyright /Wacute /uni1E0B /Ygrave /hyphen /registered /Ydieresis
+/uni1E1E /uni1E1F /Gdotaccent /gdotaccent /uni1E40 /uni1E41 /paragraph /uni1E56
+/wgrave /uni1E57 /wacute /uni1E60 /ygrave /Wdieresis /wdieresis /uni1E61
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Wcircumflex /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /uni1E6A
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Ycircumflex /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/wcircumflex /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /uni1E6B
+/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /ycircumflex /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-15.ps b/runtime/print/iso-8859-15.ps
new file mode 100644
index 000000000..46ea691ff
--- /dev/null
+++ b/runtime/print/iso-8859-15.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-15
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-15[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclamdown /cent /sterling /Euro /yen /Scaron /section
+/scaron /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /Zcaron /mu /paragraph /periodcentered
+/zcaron /onesuperior /ordmasculine /guillemotright /OE /oe /Ydieresis /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
+/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-2.ps b/runtime/print/iso-8859-2.ps
new file mode 100644
index 000000000..f6e1933be
--- /dev/null
+++ b/runtime/print/iso-8859-2.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-2
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-2[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /Aogonek /breve /Lslash /currency /Lcaron /Sacute /section
+/dieresis /Scaron /Scedilla /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent
+/degree /aogonek /ogonek /lslash /acute /lcaron /sacute /caron
+/cedilla /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent
+/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla
+/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron
+/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply
+/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls
+/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla
+/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron
+/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide
+/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-3.ps b/runtime/print/iso-8859-3.ps
new file mode 100644
index 000000000..b5a3474fb
--- /dev/null
+++ b/runtime/print/iso-8859-3.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-3
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-3[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /Hbar /breve /sterling /currency /.notdef /Hcircumflex /section
+/dieresis /Idot /Scedilla /Gbreve /Jcircumflex /hyphen /.notdef /Zdotaccent
+/degree /hbar /twosuperior /threesuperior /acute /mu /hcircumflex /periodcentered
+/cedilla /dotlessi /scedilla /gbreve /jcircumflex /onehalf /.notdef /zdotaccent
+/Agrave /Aacute /Acircumflex /.notdef /Adieresis /Cdotaccent /Ccircumflex /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/.notdef /Ntilde /Ograve /Oacute /Ocircumflex /Gdotaccent /Odieresis /multiply
+/Gcircumflex /Ugrave /Uacute /Ucircumflex /Udieresis /Ubreve /Scircumflex /germandbls
+/agrave /aacute /acircumflex /.notdef /adieresis /cdotaccent /ccircumflex /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/.notdef /ntilde /ograve /oacute /ocircumflex /gdotaccent /odieresis /divide
+/gcircumflex /ugrave /uacute /ucircumflex /udieresis /ubreve /scircumflex /dotaccent]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-4.ps b/runtime/print/iso-8859-4.ps
new file mode 100644
index 000000000..c917d1ff3
--- /dev/null
+++ b/runtime/print/iso-8859-4.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-4
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-4[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /Aogonek /kgreenlandic /Rcedilla /currency /Itilde /Lcedilla /section
+/dieresis /Scaron /Emacron /Gcedilla /Tbar /.notdef /Zcaron /macron
+/degree /aogonek /ogonek /rcedilla /acute /itilde /lcedilla /caron
+/cedilla /scaron /emacron /gcedilla /tbar /Eng /zcaron /eng
+/Amacron /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Iogonek
+/Ccaron /Eacute /Eogonek /Edieresis /Edot /Iacute /Icircumflex /Imacron
+/Dcroat /Ncedilla /Omacron /Kcedilla /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Uogonek /Uacute /Ucircumflex /Udieresis /Utilde /Umacron /germandbls
+/amacron /aacute /acircumflex /atilde /adieresis /aring /ae /iogonek
+/ccaron /eacute /eogonek /edieresis /edot /iacute /icircumflex /imacron
+/dcroat /ncedilla /omacron /kcedilla /ocircumflex /otilde /odieresis /divide
+/oslash /uogonek /uacute /ucircumflex /udieresis /utilde /umacron /dotaccent]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-5.ps b/runtime/print/iso-8859-5.ps
new file mode 100644
index 000000000..dbe962890
--- /dev/null
+++ b/runtime/print/iso-8859-5.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-5
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-5[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /afii10023 /afii10051 /afii10052 /afii10053 /afii10054 /afii10055 /afii10056
+/afii10057 /afii10058 /afii10059 /afii10060 /afii10061 /.notdef /afii10062 /afii10145
+/afii10017 /afii10018 /afii10019 /afii10020 /afii10021 /afii10022 /afii10024 /afii10025
+/afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 /afii10033
+/afii10034 /afii10035 /afii10036 /afii10037 /afii10038 /afii10039 /afii10040 /afii10041
+/afii10042 /afii10043 /afii10044 /afii10045 /afii10046 /afii10047 /afii10048 /afii10049
+/afii10065 /afii10066 /afii10067 /afii10068 /afii10069 /afii10070 /afii10072 /afii10073
+/afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 /afii10081
+/afii10082 /afii10083 /afii10084 /afii10085 /afii10086 /afii10087 /afii10088 /afii10089
+/afii10090 /afii10091 /afii10092 /afii10093 /afii10094 /afii10095 /afii10096 /afii10097
+/afii61352 /afii10071 /afii10099 /afii10100 /afii10101 /afii10102 /afii10103 /afii10104
+/afii10105 /afii10106 /afii10107 /afii10108 /afii10109 /section /afii10110 /afii10193]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-7.ps b/runtime/print/iso-8859-7.ps
new file mode 100644
index 000000000..fc16bf1a6
--- /dev/null
+++ b/runtime/print/iso-8859-7.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-7
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-7[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /quotereversed /quoteright /sterling /.notdef /.notdef /brokenbar /section
+/dieresis /copyright /.notdef /guillemotleft /logicalnot /.notdef /.notdef /emdash
+/degree /plusminus /twosuperior /threesuperior /tonos /dieresistonos /Alphatonos /periodcentered
+/Epsilontonos /Etatonos /Iotatonos /guillemotright /Omicrontonos /onehalf /Upsilontonos /Omegatonos
+/iotadieresistonos /Alpha /Beta /Gamma /Delta /Epsilon /Zeta /Eta
+/Theta /Iota /Kappa /Lambda /Mu /Nu /Xi /Omicron
+/Pi /Rho /.notdef /Sigma /Tau /Upsilon /Phi /Chi
+/Psi /Omega /Iotadieresis /Upsilondieresis /alphatonos /epsilontonos /etatonos /iotatonos
+/upsilondieresistonos /alpha /beta /gamma /delta /epsilon /zeta /eta
+/theta /iota /kappa /lambda /mu /nu /xi /omicron
+/pi /rho /sigma1 /sigma /tau /upsilon /phi /chi
+/psi /omega /iotadieresis /upsilondieresis /omicrontonos /upsilontonos /omegatonos /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-8.ps b/runtime/print/iso-8859-8.ps
new file mode 100644
index 000000000..15193cc8e
--- /dev/null
+++ b/runtime/print/iso-8859-8.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-8
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-8[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /.notdef /cent /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /multiply /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /divide /guillemotright /onequarter /onehalf /threequarters /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /underscoredbl
+/alef /bet /gimel /dalet /he /vav /zayin /het
+/tet /yod /finalkaf /kaf /lamed /finalmem /mem /finalnun
+/nun /samekh /ayin /finalpe /pe /finaltsadi /tsadi /qof
+/resh /shin /tav /.notdef /.notdef /.notdef /.notdef /.notdef]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/iso-8859-9.ps b/runtime/print/iso-8859-9.ps
new file mode 100644
index 000000000..d40f6e986
--- /dev/null
+++ b/runtime/print/iso-8859-9.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-iso-8859-9
+%%Version: 1.0 0
+%%EndComments
+/VIM-iso-8859-9[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Gbreve /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Idotaccent /Scedilla /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/gbreve /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
+/oslash /ugrave /uacute /ucircumflex /udieresis /dotlessi /scedilla /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/koi8-r.ps b/runtime/print/koi8-r.ps
new file mode 100644
index 000000000..d42daabb4
--- /dev/null
+++ b/runtime/print/koi8-r.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-koi8-r
+%%Version: 1.0 0
+%%EndComments
+/VIM-koi8-r[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/SF100000 /SF110000 /SF010000 /SF030000 /SF020000 /SF040000 /SF080000 /SF090000
+/SF060000 /SF070000 /SF050000 /upblock /dnblock /block /lfblock /rtblock
+/ltshade /shade /dkshade /integraltp /filledbox /bullet /radical /approxequal
+/lessequal /greaterequal /space /integralbt /degree /twosuperior /periodcentered /divide
+/SF430000 /SF240000 /SF510000 /afii10071 /SF520000 /SF390000 /SF220000 /SF210000
+/SF250000 /SF500000 /SF490000 /SF380000 /SF280000 /SF270000 /SF260000 /SF360000
+/SF370000 /SF420000 /SF190000 /afii10023 /SF200000 /SF230000 /SF470000 /SF480000
+/SF410000 /SF450000 /SF460000 /SF400000 /SF540000 /SF530000 /SF440000 /copyright
+/afii10096 /afii10065 /afii10066 /afii10088 /afii10069 /afii10070 /afii10086 /afii10068
+/afii10087 /afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080
+/afii10081 /afii10097 /afii10082 /afii10083 /afii10084 /afii10085 /afii10072 /afii10067
+/afii10094 /afii10093 /afii10073 /afii10090 /afii10095 /afii10091 /afii10089 /afii10092
+/afii10048 /afii10017 /afii10018 /afii10040 /afii10021 /afii10022 /afii10038 /afii10020
+/afii10039 /afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032
+/afii10033 /afii10049 /afii10034 /afii10035 /afii10036 /afii10037 /afii10024 /afii10019
+/afii10046 /afii10045 /afii10025 /afii10042 /afii10047 /afii10043 /afii10041 /afii10044]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/koi8-u.ps b/runtime/print/koi8-u.ps
new file mode 100644
index 000000000..53631049f
--- /dev/null
+++ b/runtime/print/koi8-u.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-koi8-u
+%%Version: 1.0 0
+%%EndComments
+/VIM-koi8-u[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/SF100000 /SF110000 /SF010000 /SF030000 /SF020000 /SF040000 /SF080000 /SF090000
+/SF060000 /SF070000 /SF050000 /upblock /dnblock /block /lfblock /rtblock
+/ltshade /shade /dkshade /integraltp /filledbox /bullet /radical /approxequal
+/lessequal /greaterequal /space /integralbt /degree /twosuperior /periodcentered /divide
+/SF430000 /SF240000 /SF510000 /afii10071 /afii10101 /SF390000 /afii10103 /afii10104
+/SF250000 /SF500000 /SF490000 /SF380000 /SF280000 /afii10098 /SF260000 /SF360000
+/SF370000 /SF420000 /SF190000 /afii10023 /afii10053 /SF230000 /afii10055 /afii10056
+/SF410000 /SF450000 /SF460000 /SF400000 /SF540000 /afii10050 /SF440000 /copyright
+/afii10096 /afii10065 /afii10066 /afii10088 /afii10069 /afii10070 /afii10086 /afii10068
+/afii10087 /afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080
+/afii10081 /afii10097 /afii10082 /afii10083 /afii10084 /afii10085 /afii10072 /afii10067
+/afii10094 /afii10093 /afii10073 /afii10090 /afii10095 /afii10091 /afii10089 /afii10092
+/afii10048 /afii10017 /afii10018 /afii10040 /afii10021 /afii10022 /afii10038 /afii10020
+/afii10039 /afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032
+/afii10033 /afii10049 /afii10034 /afii10035 /afii10036 /afii10037 /afii10024 /afii10019
+/afii10046 /afii10045 /afii10025 /afii10042 /afii10047 /afii10043 /afii10041 /afii10044]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/latin1.ps b/runtime/print/latin1.ps
new file mode 100644
index 000000000..569db9bfe
--- /dev/null
+++ b/runtime/print/latin1.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-latin1
+%%Version: 1.0 0
+%%EndComments
+/VIM-latin1[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclamdown /cent /sterling /currency /yen /brokenbar /section
+/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron
+/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered
+/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown
+/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
+/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
+/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply
+/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls
+/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
+/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
+/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide
+/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/mac-roman.ps b/runtime/print/mac-roman.ps
new file mode 100644
index 000000000..b0941be65
--- /dev/null
+++ b/runtime/print/mac-roman.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-Encoding
+%%Title: VIM-mac-roman
+%%Version: 1.0 0
+%%EndComments
+/VIM-mac-roman[
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
+/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle
+/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/zero /one /two /three /four /five /six /seven
+/eight /nine /colon /semicolon /less /equal /greater /question
+/at /A /B /C /D /E /F /G
+/H /I /J /K /L /M /N /O
+/P /Q /R /S /T /U /V /W
+/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
+/grave /a /b /c /d /e /f /g
+/h /i /j /k /l /m /n /o
+/p /q /r /s /t /u /v /w
+/x /y /z /braceleft /bar /braceright /asciitilde /.notdef
+/Adieresis /Aring /Ccedilla /Eacute /Ntilde /Odieresis /Udieresis /aacute
+/agrave /acircumflex /adieresis /atilde /aring /ccedilla /eacute /egrave
+/ecircumflex /edieresis /iacute /igrave /icircumflex /idieresis /ntilde /oacute
+/ograve /ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex /udieresis
+/dagger /degree /cent /sterling /section /bullet /paragraph /germandbls
+/registered /copyright /trademark /acute /dieresis /notequal /AE /Oslash
+/infinity /plusminus /lessequal /greaterequal /yen /mu /partialdiff /summation
+/Pi /pi /integral /ordfeminine /ordmasculine /Omega /ae /oslash
+/questiondown /exclamdown /logicalnot /radical /florin /approxequal /delta /guillemotleft
+/guillemotright /ellipsis /space /Agrave /Atilde /Otilde /OE /oe
+/endash /emdash /quotedblleft /quotedblright /quoteleft /quoteright /divide /lozenge
+/ydieresis /Ydieresis /fraction /currency /guilsinglleft /guilsinglright /fi /fl
+/daggerdbl /periodcentered /quotesinglbase /quotedblbase /perthousand /Acircumflex /Ecircumflex /Aacute
+/Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute /Ocircumflex
+/heart /Ograve /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde
+/macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron]
+/Encoding defineresource pop
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/print/prolog.ps b/runtime/print/prolog.ps
new file mode 100644
index 000000000..0230999e6
--- /dev/null
+++ b/runtime/print/prolog.ps
@@ -0,0 +1,40 @@
+%!PS-Adobe-3.0 Resource-ProcSet
+%%Title: VIM-Prolog
+%%Version: 1.3 1
+%%EndComments
+% Editing of this file is NOT RECOMMENDED. You run a very good risk of causing
+% all PostScript printing from VIM failing if you do. PostScript is not called
+% a write-only language for nothing!
+/bd{bind def}bind def/ld{load def}bd/ed{exch def}bd/d/def ld
+/db{dict begin}bd/cde{currentdict end}bd
+/T true d/F false d
+/SO null d/sv{/SO save d}bd/re{SO restore}bd
+/L2 systemdict/languagelevel 2 copy known{get exec}{pop pop 1}ifelse 2 ge d
+/m{moveto}bd/s{show}bd/ms{m s}bd/g{setgray}bd/r{setrgbcolor}bd/sp{showpage}bd
+/gs{gsave}bd/gr{grestore}bd/cp{currentpoint}bd
+/ul{gs UW setlinewidth cp UO add 2 copy newpath m 3 1 roll add exch lineto
+stroke gr}bd
+/bg{gs r cp BO add 4 -2 roll rectfill gr}bd
+/sl{90 rotate 0 exch translate}bd
+L2{
+/sspd{mark exch{setpagedevice}stopped cleartomark}bd
+/nc{1 db/NumCopies ed cde sspd}bd
+/sps{3 db/Orientation ed[3 1 roll]/PageSize ed/ImagingBBox null d cde sspd}bd
+/dt{2 db/Tumble ed/Duplex ed cde sspd}bd
+/c{1 db/Collate ed cde sspd}bd
+}{
+/nc{/#copies ed}bd
+/sps{statusdict/setpage get exec}bd
+/dt{statusdict/settumble 2 copy known{get exec}{pop pop pop}ifelse
+statusdict/setduplexmode 2 copy known{get exec}{pop pop pop}ifelse}bd
+/c{pop}bd
+}ifelse
+/ffs{findfont exch scalefont d}bd/sf{setfont}bd
+/ref{1 db findfont dup maxlength dict/NFD ed{exch dup/FID ne{exch NFD 3 1 roll
+put}{pop pop}ifelse}forall/Encoding findresource dup length 256 eq{NFD/Encoding
+3 -1 roll put}{pop}ifelse NFD dup/FontType get 3 ne{/CharStrings}{/CharProcs}
+ifelse 2 copy known{2 copy get dup maxlength dict copy[/questiondown/space]{2
+copy known{2 copy get 2 index/.notdef 3 -1 roll put pop exit}if pop}forall put
+}{pop pop}ifelse dup NFD/FontName 3 -1 roll put NFD definefont pop end}bd
+% vim:ff=unix:
+%%EOF
diff --git a/runtime/rgb.txt b/runtime/rgb.txt
new file mode 100644
index 000000000..5bc2baa3d
--- /dev/null
+++ b/runtime/rgb.txt
@@ -0,0 +1,753 @@
+! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $
+255 250 250 snow
+248 248 255 ghost white
+248 248 255 GhostWhite
+245 245 245 white smoke
+245 245 245 WhiteSmoke
+220 220 220 gainsboro
+255 250 240 floral white
+255 250 240 FloralWhite
+253 245 230 old lace
+253 245 230 OldLace
+250 240 230 linen
+250 235 215 antique white
+250 235 215 AntiqueWhite
+255 239 213 papaya whip
+255 239 213 PapayaWhip
+255 235 205 blanched almond
+255 235 205 BlanchedAlmond
+255 228 196 bisque
+255 218 185 peach puff
+255 218 185 PeachPuff
+255 222 173 navajo white
+255 222 173 NavajoWhite
+255 228 181 moccasin
+255 248 220 cornsilk
+255 255 240 ivory
+255 250 205 lemon chiffon
+255 250 205 LemonChiffon
+255 245 238 seashell
+240 255 240 honeydew
+245 255 250 mint cream
+245 255 250 MintCream
+240 255 255 azure
+240 248 255 alice blue
+240 248 255 AliceBlue
+230 230 250 lavender
+255 240 245 lavender blush
+255 240 245 LavenderBlush
+255 228 225 misty rose
+255 228 225 MistyRose
+255 255 255 white
+ 0 0 0 black
+ 47 79 79 dark slate gray
+ 47 79 79 DarkSlateGray
+ 47 79 79 dark slate grey
+ 47 79 79 DarkSlateGrey
+105 105 105 dim gray
+105 105 105 DimGray
+105 105 105 dim grey
+105 105 105 DimGrey
+112 128 144 slate gray
+112 128 144 SlateGray
+112 128 144 slate grey
+112 128 144 SlateGrey
+119 136 153 light slate gray
+119 136 153 LightSlateGray
+119 136 153 light slate grey
+119 136 153 LightSlateGrey
+190 190 190 gray
+190 190 190 grey
+211 211 211 light grey
+211 211 211 LightGrey
+211 211 211 light gray
+211 211 211 LightGray
+ 25 25 112 midnight blue
+ 25 25 112 MidnightBlue
+ 0 0 128 navy
+ 0 0 128 navy blue
+ 0 0 128 NavyBlue
+100 149 237 cornflower blue
+100 149 237 CornflowerBlue
+ 72 61 139 dark slate blue
+ 72 61 139 DarkSlateBlue
+106 90 205 slate blue
+106 90 205 SlateBlue
+123 104 238 medium slate blue
+123 104 238 MediumSlateBlue
+132 112 255 light slate blue
+132 112 255 LightSlateBlue
+ 0 0 205 medium blue
+ 0 0 205 MediumBlue
+ 65 105 225 royal blue
+ 65 105 225 RoyalBlue
+ 0 0 255 blue
+ 30 144 255 dodger blue
+ 30 144 255 DodgerBlue
+ 0 191 255 deep sky blue
+ 0 191 255 DeepSkyBlue
+135 206 235 sky blue
+135 206 235 SkyBlue
+135 206 250 light sky blue
+135 206 250 LightSkyBlue
+ 70 130 180 steel blue
+ 70 130 180 SteelBlue
+176 196 222 light steel blue
+176 196 222 LightSteelBlue
+173 216 230 light blue
+173 216 230 LightBlue
+176 224 230 powder blue
+176 224 230 PowderBlue
+175 238 238 pale turquoise
+175 238 238 PaleTurquoise
+ 0 206 209 dark turquoise
+ 0 206 209 DarkTurquoise
+ 72 209 204 medium turquoise
+ 72 209 204 MediumTurquoise
+ 64 224 208 turquoise
+ 0 255 255 cyan
+224 255 255 light cyan
+224 255 255 LightCyan
+ 95 158 160 cadet blue
+ 95 158 160 CadetBlue
+102 205 170 medium aquamarine
+102 205 170 MediumAquamarine
+127 255 212 aquamarine
+ 0 100 0 dark green
+ 0 100 0 DarkGreen
+ 85 107 47 dark olive green
+ 85 107 47 DarkOliveGreen
+143 188 143 dark sea green
+143 188 143 DarkSeaGreen
+ 46 139 87 sea green
+ 46 139 87 SeaGreen
+ 60 179 113 medium sea green
+ 60 179 113 MediumSeaGreen
+ 32 178 170 light sea green
+ 32 178 170 LightSeaGreen
+152 251 152 pale green
+152 251 152 PaleGreen
+ 0 255 127 spring green
+ 0 255 127 SpringGreen
+124 252 0 lawn green
+124 252 0 LawnGreen
+ 0 255 0 green
+127 255 0 chartreuse
+ 0 250 154 medium spring green
+ 0 250 154 MediumSpringGreen
+173 255 47 green yellow
+173 255 47 GreenYellow
+ 50 205 50 lime green
+ 50 205 50 LimeGreen
+154 205 50 yellow green
+154 205 50 YellowGreen
+ 34 139 34 forest green
+ 34 139 34 ForestGreen
+107 142 35 olive drab
+107 142 35 OliveDrab
+189 183 107 dark khaki
+189 183 107 DarkKhaki
+240 230 140 khaki
+238 232 170 pale goldenrod
+238 232 170 PaleGoldenrod
+250 250 210 light goldenrod yellow
+250 250 210 LightGoldenrodYellow
+255 255 224 light yellow
+255 255 224 LightYellow
+255 255 0 yellow
+255 215 0 gold
+238 221 130 light goldenrod
+238 221 130 LightGoldenrod
+218 165 32 goldenrod
+184 134 11 dark goldenrod
+184 134 11 DarkGoldenrod
+188 143 143 rosy brown
+188 143 143 RosyBrown
+205 92 92 indian red
+205 92 92 IndianRed
+139 69 19 saddle brown
+139 69 19 SaddleBrown
+160 82 45 sienna
+205 133 63 peru
+222 184 135 burlywood
+245 245 220 beige
+245 222 179 wheat
+244 164 96 sandy brown
+244 164 96 SandyBrown
+210 180 140 tan
+210 105 30 chocolate
+178 34 34 firebrick
+165 42 42 brown
+233 150 122 dark salmon
+233 150 122 DarkSalmon
+250 128 114 salmon
+255 160 122 light salmon
+255 160 122 LightSalmon
+255 165 0 orange
+255 140 0 dark orange
+255 140 0 DarkOrange
+255 127 80 coral
+240 128 128 light coral
+240 128 128 LightCoral
+255 99 71 tomato
+255 69 0 orange red
+255 69 0 OrangeRed
+255 0 0 red
+255 105 180 hot pink
+255 105 180 HotPink
+255 20 147 deep pink
+255 20 147 DeepPink
+255 192 203 pink
+255 182 193 light pink
+255 182 193 LightPink
+219 112 147 pale violet red
+219 112 147 PaleVioletRed
+176 48 96 maroon
+199 21 133 medium violet red
+199 21 133 MediumVioletRed
+208 32 144 violet red
+208 32 144 VioletRed
+255 0 255 magenta
+238 130 238 violet
+221 160 221 plum
+218 112 214 orchid
+186 85 211 medium orchid
+186 85 211 MediumOrchid
+153 50 204 dark orchid
+153 50 204 DarkOrchid
+148 0 211 dark violet
+148 0 211 DarkViolet
+138 43 226 blue violet
+138 43 226 BlueViolet
+160 32 240 purple
+147 112 219 medium purple
+147 112 219 MediumPurple
+216 191 216 thistle
+255 250 250 snow1
+238 233 233 snow2
+205 201 201 snow3
+139 137 137 snow4
+255 245 238 seashell1
+238 229 222 seashell2
+205 197 191 seashell3
+139 134 130 seashell4
+255 239 219 AntiqueWhite1
+238 223 204 AntiqueWhite2
+205 192 176 AntiqueWhite3
+139 131 120 AntiqueWhite4
+255 228 196 bisque1
+238 213 183 bisque2
+205 183 158 bisque3
+139 125 107 bisque4
+255 218 185 PeachPuff1
+238 203 173 PeachPuff2
+205 175 149 PeachPuff3
+139 119 101 PeachPuff4
+255 222 173 NavajoWhite1
+238 207 161 NavajoWhite2
+205 179 139 NavajoWhite3
+139 121 94 NavajoWhite4
+255 250 205 LemonChiffon1
+238 233 191 LemonChiffon2
+205 201 165 LemonChiffon3
+139 137 112 LemonChiffon4
+255 248 220 cornsilk1
+238 232 205 cornsilk2
+205 200 177 cornsilk3
+139 136 120 cornsilk4
+255 255 240 ivory1
+238 238 224 ivory2
+205 205 193 ivory3
+139 139 131 ivory4
+240 255 240 honeydew1
+224 238 224 honeydew2
+193 205 193 honeydew3
+131 139 131 honeydew4
+255 240 245 LavenderBlush1
+238 224 229 LavenderBlush2
+205 193 197 LavenderBlush3
+139 131 134 LavenderBlush4
+255 228 225 MistyRose1
+238 213 210 MistyRose2
+205 183 181 MistyRose3
+139 125 123 MistyRose4
+240 255 255 azure1
+224 238 238 azure2
+193 205 205 azure3
+131 139 139 azure4
+131 111 255 SlateBlue1
+122 103 238 SlateBlue2
+105 89 205 SlateBlue3
+ 71 60 139 SlateBlue4
+ 72 118 255 RoyalBlue1
+ 67 110 238 RoyalBlue2
+ 58 95 205 RoyalBlue3
+ 39 64 139 RoyalBlue4
+ 0 0 255 blue1
+ 0 0 238 blue2
+ 0 0 205 blue3
+ 0 0 139 blue4
+ 30 144 255 DodgerBlue1
+ 28 134 238 DodgerBlue2
+ 24 116 205 DodgerBlue3
+ 16 78 139 DodgerBlue4
+ 99 184 255 SteelBlue1
+ 92 172 238 SteelBlue2
+ 79 148 205 SteelBlue3
+ 54 100 139 SteelBlue4
+ 0 191 255 DeepSkyBlue1
+ 0 178 238 DeepSkyBlue2
+ 0 154 205 DeepSkyBlue3
+ 0 104 139 DeepSkyBlue4
+135 206 255 SkyBlue1
+126 192 238 SkyBlue2
+108 166 205 SkyBlue3
+ 74 112 139 SkyBlue4
+176 226 255 LightSkyBlue1
+164 211 238 LightSkyBlue2
+141 182 205 LightSkyBlue3
+ 96 123 139 LightSkyBlue4
+198 226 255 SlateGray1
+185 211 238 SlateGray2
+159 182 205 SlateGray3
+108 123 139 SlateGray4
+202 225 255 LightSteelBlue1
+188 210 238 LightSteelBlue2
+162 181 205 LightSteelBlue3
+110 123 139 LightSteelBlue4
+191 239 255 LightBlue1
+178 223 238 LightBlue2
+154 192 205 LightBlue3
+104 131 139 LightBlue4
+224 255 255 LightCyan1
+209 238 238 LightCyan2
+180 205 205 LightCyan3
+122 139 139 LightCyan4
+187 255 255 PaleTurquoise1
+174 238 238 PaleTurquoise2
+150 205 205 PaleTurquoise3
+102 139 139 PaleTurquoise4
+152 245 255 CadetBlue1
+142 229 238 CadetBlue2
+122 197 205 CadetBlue3
+ 83 134 139 CadetBlue4
+ 0 245 255 turquoise1
+ 0 229 238 turquoise2
+ 0 197 205 turquoise3
+ 0 134 139 turquoise4
+ 0 255 255 cyan1
+ 0 238 238 cyan2
+ 0 205 205 cyan3
+ 0 139 139 cyan4
+151 255 255 DarkSlateGray1
+141 238 238 DarkSlateGray2
+121 205 205 DarkSlateGray3
+ 82 139 139 DarkSlateGray4
+127 255 212 aquamarine1
+118 238 198 aquamarine2
+102 205 170 aquamarine3
+ 69 139 116 aquamarine4
+193 255 193 DarkSeaGreen1
+180 238 180 DarkSeaGreen2
+155 205 155 DarkSeaGreen3
+105 139 105 DarkSeaGreen4
+ 84 255 159 SeaGreen1
+ 78 238 148 SeaGreen2
+ 67 205 128 SeaGreen3
+ 46 139 87 SeaGreen4
+154 255 154 PaleGreen1
+144 238 144 PaleGreen2
+124 205 124 PaleGreen3
+ 84 139 84 PaleGreen4
+ 0 255 127 SpringGreen1
+ 0 238 118 SpringGreen2
+ 0 205 102 SpringGreen3
+ 0 139 69 SpringGreen4
+ 0 255 0 green1
+ 0 238 0 green2
+ 0 205 0 green3
+ 0 139 0 green4
+127 255 0 chartreuse1
+118 238 0 chartreuse2
+102 205 0 chartreuse3
+ 69 139 0 chartreuse4
+192 255 62 OliveDrab1
+179 238 58 OliveDrab2
+154 205 50 OliveDrab3
+105 139 34 OliveDrab4
+202 255 112 DarkOliveGreen1
+188 238 104 DarkOliveGreen2
+162 205 90 DarkOliveGreen3
+110 139 61 DarkOliveGreen4
+255 246 143 khaki1
+238 230 133 khaki2
+205 198 115 khaki3
+139 134 78 khaki4
+255 236 139 LightGoldenrod1
+238 220 130 LightGoldenrod2
+205 190 112 LightGoldenrod3
+139 129 76 LightGoldenrod4
+255 255 224 LightYellow1
+238 238 209 LightYellow2
+205 205 180 LightYellow3
+139 139 122 LightYellow4
+255 255 0 yellow1
+238 238 0 yellow2
+205 205 0 yellow3
+139 139 0 yellow4
+255 215 0 gold1
+238 201 0 gold2
+205 173 0 gold3
+139 117 0 gold4
+255 193 37 goldenrod1
+238 180 34 goldenrod2
+205 155 29 goldenrod3
+139 105 20 goldenrod4
+255 185 15 DarkGoldenrod1
+238 173 14 DarkGoldenrod2
+205 149 12 DarkGoldenrod3
+139 101 8 DarkGoldenrod4
+255 193 193 RosyBrown1
+238 180 180 RosyBrown2
+205 155 155 RosyBrown3
+139 105 105 RosyBrown4
+255 106 106 IndianRed1
+238 99 99 IndianRed2
+205 85 85 IndianRed3
+139 58 58 IndianRed4
+255 130 71 sienna1
+238 121 66 sienna2
+205 104 57 sienna3
+139 71 38 sienna4
+255 211 155 burlywood1
+238 197 145 burlywood2
+205 170 125 burlywood3
+139 115 85 burlywood4
+255 231 186 wheat1
+238 216 174 wheat2
+205 186 150 wheat3
+139 126 102 wheat4
+255 165 79 tan1
+238 154 73 tan2
+205 133 63 tan3
+139 90 43 tan4
+255 127 36 chocolate1
+238 118 33 chocolate2
+205 102 29 chocolate3
+139 69 19 chocolate4
+255 48 48 firebrick1
+238 44 44 firebrick2
+205 38 38 firebrick3
+139 26 26 firebrick4
+255 64 64 brown1
+238 59 59 brown2
+205 51 51 brown3
+139 35 35 brown4
+255 140 105 salmon1
+238 130 98 salmon2
+205 112 84 salmon3
+139 76 57 salmon4
+255 160 122 LightSalmon1
+238 149 114 LightSalmon2
+205 129 98 LightSalmon3
+139 87 66 LightSalmon4
+255 165 0 orange1
+238 154 0 orange2
+205 133 0 orange3
+139 90 0 orange4
+255 127 0 DarkOrange1
+238 118 0 DarkOrange2
+205 102 0 DarkOrange3
+139 69 0 DarkOrange4
+255 114 86 coral1
+238 106 80 coral2
+205 91 69 coral3
+139 62 47 coral4
+255 99 71 tomato1
+238 92 66 tomato2
+205 79 57 tomato3
+139 54 38 tomato4
+255 69 0 OrangeRed1
+238 64 0 OrangeRed2
+205 55 0 OrangeRed3
+139 37 0 OrangeRed4
+255 0 0 red1
+238 0 0 red2
+205 0 0 red3
+139 0 0 red4
+255 20 147 DeepPink1
+238 18 137 DeepPink2
+205 16 118 DeepPink3
+139 10 80 DeepPink4
+255 110 180 HotPink1
+238 106 167 HotPink2
+205 96 144 HotPink3
+139 58 98 HotPink4
+255 181 197 pink1
+238 169 184 pink2
+205 145 158 pink3
+139 99 108 pink4
+255 174 185 LightPink1
+238 162 173 LightPink2
+205 140 149 LightPink3
+139 95 101 LightPink4
+255 130 171 PaleVioletRed1
+238 121 159 PaleVioletRed2
+205 104 137 PaleVioletRed3
+139 71 93 PaleVioletRed4
+255 52 179 maroon1
+238 48 167 maroon2
+205 41 144 maroon3
+139 28 98 maroon4
+255 62 150 VioletRed1
+238 58 140 VioletRed2
+205 50 120 VioletRed3
+139 34 82 VioletRed4
+255 0 255 magenta1
+238 0 238 magenta2
+205 0 205 magenta3
+139 0 139 magenta4
+255 131 250 orchid1
+238 122 233 orchid2
+205 105 201 orchid3
+139 71 137 orchid4
+255 187 255 plum1
+238 174 238 plum2
+205 150 205 plum3
+139 102 139 plum4
+224 102 255 MediumOrchid1
+209 95 238 MediumOrchid2
+180 82 205 MediumOrchid3
+122 55 139 MediumOrchid4
+191 62 255 DarkOrchid1
+178 58 238 DarkOrchid2
+154 50 205 DarkOrchid3
+104 34 139 DarkOrchid4
+155 48 255 purple1
+145 44 238 purple2
+125 38 205 purple3
+ 85 26 139 purple4
+171 130 255 MediumPurple1
+159 121 238 MediumPurple2
+137 104 205 MediumPurple3
+ 93 71 139 MediumPurple4
+255 225 255 thistle1
+238 210 238 thistle2
+205 181 205 thistle3
+139 123 139 thistle4
+ 0 0 0 gray0
+ 0 0 0 grey0
+ 3 3 3 gray1
+ 3 3 3 grey1
+ 5 5 5 gray2
+ 5 5 5 grey2
+ 8 8 8 gray3
+ 8 8 8 grey3
+ 10 10 10 gray4
+ 10 10 10 grey4
+ 13 13 13 gray5
+ 13 13 13 grey5
+ 15 15 15 gray6
+ 15 15 15 grey6
+ 18 18 18 gray7
+ 18 18 18 grey7
+ 20 20 20 gray8
+ 20 20 20 grey8
+ 23 23 23 gray9
+ 23 23 23 grey9
+ 26 26 26 gray10
+ 26 26 26 grey10
+ 28 28 28 gray11
+ 28 28 28 grey11
+ 31 31 31 gray12
+ 31 31 31 grey12
+ 33 33 33 gray13
+ 33 33 33 grey13
+ 36 36 36 gray14
+ 36 36 36 grey14
+ 38 38 38 gray15
+ 38 38 38 grey15
+ 41 41 41 gray16
+ 41 41 41 grey16
+ 43 43 43 gray17
+ 43 43 43 grey17
+ 46 46 46 gray18
+ 46 46 46 grey18
+ 48 48 48 gray19
+ 48 48 48 grey19
+ 51 51 51 gray20
+ 51 51 51 grey20
+ 54 54 54 gray21
+ 54 54 54 grey21
+ 56 56 56 gray22
+ 56 56 56 grey22
+ 59 59 59 gray23
+ 59 59 59 grey23
+ 61 61 61 gray24
+ 61 61 61 grey24
+ 64 64 64 gray25
+ 64 64 64 grey25
+ 66 66 66 gray26
+ 66 66 66 grey26
+ 69 69 69 gray27
+ 69 69 69 grey27
+ 71 71 71 gray28
+ 71 71 71 grey28
+ 74 74 74 gray29
+ 74 74 74 grey29
+ 77 77 77 gray30
+ 77 77 77 grey30
+ 79 79 79 gray31
+ 79 79 79 grey31
+ 82 82 82 gray32
+ 82 82 82 grey32
+ 84 84 84 gray33
+ 84 84 84 grey33
+ 87 87 87 gray34
+ 87 87 87 grey34
+ 89 89 89 gray35
+ 89 89 89 grey35
+ 92 92 92 gray36
+ 92 92 92 grey36
+ 94 94 94 gray37
+ 94 94 94 grey37
+ 97 97 97 gray38
+ 97 97 97 grey38
+ 99 99 99 gray39
+ 99 99 99 grey39
+102 102 102 gray40
+102 102 102 grey40
+105 105 105 gray41
+105 105 105 grey41
+107 107 107 gray42
+107 107 107 grey42
+110 110 110 gray43
+110 110 110 grey43
+112 112 112 gray44
+112 112 112 grey44
+115 115 115 gray45
+115 115 115 grey45
+117 117 117 gray46
+117 117 117 grey46
+120 120 120 gray47
+120 120 120 grey47
+122 122 122 gray48
+122 122 122 grey48
+125 125 125 gray49
+125 125 125 grey49
+127 127 127 gray50
+127 127 127 grey50
+130 130 130 gray51
+130 130 130 grey51
+133 133 133 gray52
+133 133 133 grey52
+135 135 135 gray53
+135 135 135 grey53
+138 138 138 gray54
+138 138 138 grey54
+140 140 140 gray55
+140 140 140 grey55
+143 143 143 gray56
+143 143 143 grey56
+145 145 145 gray57
+145 145 145 grey57
+148 148 148 gray58
+148 148 148 grey58
+150 150 150 gray59
+150 150 150 grey59
+153 153 153 gray60
+153 153 153 grey60
+156 156 156 gray61
+156 156 156 grey61
+158 158 158 gray62
+158 158 158 grey62
+161 161 161 gray63
+161 161 161 grey63
+163 163 163 gray64
+163 163 163 grey64
+166 166 166 gray65
+166 166 166 grey65
+168 168 168 gray66
+168 168 168 grey66
+171 171 171 gray67
+171 171 171 grey67
+173 173 173 gray68
+173 173 173 grey68
+176 176 176 gray69
+176 176 176 grey69
+179 179 179 gray70
+179 179 179 grey70
+181 181 181 gray71
+181 181 181 grey71
+184 184 184 gray72
+184 184 184 grey72
+186 186 186 gray73
+186 186 186 grey73
+189 189 189 gray74
+189 189 189 grey74
+191 191 191 gray75
+191 191 191 grey75
+194 194 194 gray76
+194 194 194 grey76
+196 196 196 gray77
+196 196 196 grey77
+199 199 199 gray78
+199 199 199 grey78
+201 201 201 gray79
+201 201 201 grey79
+204 204 204 gray80
+204 204 204 grey80
+207 207 207 gray81
+207 207 207 grey81
+209 209 209 gray82
+209 209 209 grey82
+212 212 212 gray83
+212 212 212 grey83
+214 214 214 gray84
+214 214 214 grey84
+217 217 217 gray85
+217 217 217 grey85
+219 219 219 gray86
+219 219 219 grey86
+222 222 222 gray87
+222 222 222 grey87
+224 224 224 gray88
+224 224 224 grey88
+227 227 227 gray89
+227 227 227 grey89
+229 229 229 gray90
+229 229 229 grey90
+232 232 232 gray91
+232 232 232 grey91
+235 235 235 gray92
+235 235 235 grey92
+237 237 237 gray93
+237 237 237 grey93
+240 240 240 gray94
+240 240 240 grey94
+242 242 242 gray95
+242 242 242 grey95
+245 245 245 gray96
+245 245 245 grey96
+247 247 247 gray97
+247 247 247 grey97
+250 250 250 gray98
+250 250 250 grey98
+252 252 252 gray99
+252 252 252 grey99
+255 255 255 gray100
+255 255 255 grey100
+169 169 169 dark grey
+169 169 169 DarkGrey
+169 169 169 dark gray
+169 169 169 DarkGray
+0 0 139 dark blue
+0 0 139 DarkBlue
+0 139 139 dark cyan
+0 139 139 DarkCyan
+139 0 139 dark magenta
+139 0 139 DarkMagenta
+139 0 0 dark red
+139 0 0 DarkRed
+144 238 144 light green
+144 238 144 LightGreen
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
new file mode 100644
index 000000000..1b506b3f6
--- /dev/null
+++ b/runtime/scripts.vim
@@ -0,0 +1,316 @@
+" Vim support file to detect file types in scripts
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2004 Apr 18
+
+" This file is called by an autocommand for every file that has just been
+" loaded into a buffer. It checks if the type of file can be recognized by
+" the file contents. The autocommand is in $VIMRUNTIME/filetype.vim.
+
+
+" Only do the rest when the FileType autocommand has not been triggered yet.
+if did_filetype()
+ finish
+endif
+
+" Load the user defined scripts file first
+" Only do this when the FileType autocommand has not been triggered yet
+if exists("myscriptsfile") && file_readable(expand(myscriptsfile))
+ execute "source " . myscriptsfile
+ if did_filetype()
+ finish
+ endif
+endif
+
+" Line continuation is used here, remove 'C' from 'cpoptions'
+let s:cpo_save = &cpo
+set cpo&vim
+
+let s:line1 = getline(1)
+
+if s:line1 =~ "^#!"
+ " A script that starts with "#!".
+
+ " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into
+ " "#!/usr/bin/bash" to make matching easier.
+ if s:line1 =~ '^#!\s*\S*\<env\s'
+ let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
+ let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
+ endif
+
+ " Get the program name.
+ " Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
+ " If there is no path use the first word: "#!perl [path/args]".
+ " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
+ if s:line1 =~ '^#!\s*\a:[/\\]'
+ let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
+ elseif s:line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
+ let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
+ else
+ let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
+ endif
+
+ " Bourne-like shell scripts: sh ksh bash bash2
+ if s:name =~ '^\(bash\|bash2\|ksh\|sh\)\>'
+ call SetFileTypeSH(s:line1) " defined in filetype.vim
+
+ " csh scripts
+ elseif s:name =~ '^csh\>'
+ if exists("g:filetype_csh")
+ let &ft = g:filetype_csh
+ else
+ set ft=csh
+ endif
+
+ " tcsh scripts
+ elseif s:name =~ '^tcsh\>'
+ set ft=tcsh
+
+ " Z shell scripts
+ elseif s:name =~ '^zsh\>'
+ set ft=zsh
+
+ " TCL scripts
+ elseif s:name =~ '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
+ set ft=tcl
+
+ " Expect scripts
+ elseif s:name =~ '^expect\>'
+ set ft=expect
+
+ " Gnuplot scripts
+ elseif s:name =~ '^gnuplot\>'
+ set ft=gnuplot
+
+ " Makefiles
+ elseif s:name =~ 'make\>'
+ set ft=make
+
+ " Perl
+ elseif s:name =~ 'perl'
+ set ft=perl
+
+ " PHP
+ elseif s:name =~ 'php'
+ set ft=php
+
+ " Python
+ elseif s:name =~ 'python'
+ set ft=python
+
+ " Groovy
+ elseif s:name =~ '^groovy\>'
+ set ft=groovy
+
+ " Ruby
+ elseif s:name =~ 'ruby'
+ set ft=ruby
+
+ " BC calculator
+ elseif s:name =~ '^bc\>'
+ set ft=bc
+
+ " sed
+ elseif s:name =~ 'sed\>'
+ set ft=sed
+
+ " OCaml-scripts
+ elseif s:name =~ 'ocaml'
+ set ft=ocaml
+
+ " Awk scripts
+ elseif s:name =~ 'awk\>'
+ set ft=awk
+
+ " Website MetaLanguage
+ elseif s:name =~ 'wml'
+ set ft=wml
+
+ " Scheme scripts
+ elseif s:name =~ 'scheme'
+ set ft=scheme
+
+ endif
+ unlet s:name
+
+else
+ " File does not start with "#!".
+
+ let s:line2 = getline(2)
+ let s:line3 = getline(3)
+ let s:line4 = getline(4)
+ let s:line5 = getline(5)
+
+ " Bourne-like shell scripts: sh ksh bash bash2
+ if s:line1 =~ '^:$'
+ call SetFileTypeSH(s:line1) " defined in filetype.vim
+
+ " Z shell scripts
+ elseif s:line1 =~ '^#compdef\>' || s:line1 =~ '^#autoload\>'
+ set ft=zsh
+
+ " ELM Mail files
+ elseif s:line1 =~ '^From [a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\= .*[12][09]\d\d$'
+ set ft=mail
+
+ " Mason
+ elseif s:line1 =~ '^<[%&].*>'
+ set ft=mason
+
+ " Vim scripts (must have '" vim' as the first line to trigger this)
+ elseif s:line1 =~ '^" *[vV]im$'
+ set ft=vim
+
+ " MOO
+ elseif s:line1 =~ '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
+ set ft=moo
+
+ " Diff file:
+ " - "diff" in first line (context diff)
+ " - "Only in " in first line
+ " - "--- " in first line and "+++ " in second line (unified diff).
+ " - "*** " in first line and "--- " in second line (context diff).
+ " - "# It was generated by makepatch " in the second line (makepatch diff).
+ " - "Index: <filename>" in the first line (CVS file)
+ elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\)'
+ \ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ')
+ \ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ')
+ set ft=diff
+
+ " PostScript Files (must have %!PS as the first line, like a2ps output)
+ elseif s:line1 =~ '^%![ \t]*PS'
+ set ft=postscr
+
+ " M4 scripts: Guess there is a line that starts with "dnl".
+ elseif s:line1 =~ '^\s*dnl\>'
+ \ || s:line2 =~ '^\s*dnl\>'
+ \ || s:line3 =~ '^\s*dnl\>'
+ \ || s:line4 =~ '^\s*dnl\>'
+ \ || s:line5 =~ '^\s*dnl\>'
+ set ft=m4
+
+ " AmigaDos scripts
+ elseif $TERM == "amiga"
+ \ && (s:line1 =~ "^;" || s:line1 =~ '^\.[bB][rR][aA]')
+ set ft=amiga
+
+ " SiCAD scripts (must have procn or procd as the first line to trigger this)
+ elseif s:line1 =~? '^ *proc[nd] *$'
+ set ft=sicad
+
+ " Purify log files start with "**** Purify"
+ elseif s:line1 =~ '^\*\*\*\* Purify'
+ set ft=purifylog
+
+ " XML
+ elseif s:line1 =~ '<?\s*xml.*?>'
+ set ft=xml
+
+ " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN")
+ elseif s:line1 =~ '\<DTD\s\+XHTML\s'
+ set ft=xhtml
+
+ " XXD output
+ elseif s:line1 =~ '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} '
+ set ft=xxd
+
+ " RCS/CVS log output
+ elseif s:line1 =~ '^RCS file:' || s:line2 =~ '^RCS file:'
+ set ft=rcslog
+
+ " CVS commit
+ elseif s:line2 =~ '^CVS:'
+ set ft=cvs
+
+ " Send-pr
+ elseif s:line1 =~ '^SEND-PR:'
+ set ft=sendpr
+
+ " SNNS files
+ elseif s:line1 =~ '^SNNS network definition file'
+ set ft=snnsnet
+ elseif s:line1 =~ '^SNNS pattern definition file'
+ set ft=snnspat
+ elseif s:line1 =~ '^SNNS result file'
+ set ft=snnsres
+
+ " Virata
+ elseif s:line1 =~ '^%.\{-}[Vv]irata'
+ \ || s:line2 =~ '^%.\{-}[Vv]irata'
+ \ || s:line3 =~ '^%.\{-}[Vv]irata'
+ \ || s:line4 =~ '^%.\{-}[Vv]irata'
+ \ || s:line5 =~ '^%.\{-}[Vv]irata'
+ set ft=virata
+
+ " Strace
+ elseif s:line1 =~ '^[0-9]* *execve('
+ set ft=strace
+
+ " VSE JCL
+ elseif s:line1 =~ '^\* $$ JOB\>' || s:line1 =~ '^// *JOB\>'
+ set ft=vsejcl
+
+ " TAK and SINDA
+ elseif s:line4 =~ 'K & K Associates' || s:line2 =~ 'TAK 2000'
+ set ft=takout
+ elseif s:line3 =~ 'S Y S T E M S I M P R O V E D '
+ set ft=sindaout
+ elseif getline(6) =~ 'Run Date: '
+ set ft=takcmp
+ elseif getline(9) =~ 'Node File 1'
+ set ft=sindacmp
+
+ " DNS zone files
+ elseif s:line1.s:line2 =~ '$ORIGIN\|$TTL\|IN\s*SOA'
+ \ || s:line1.s:line2.s:line3.s:line4 =~ 'BIND.*named'
+ set ft=dns
+
+ " BAAN
+ elseif s:line1 =~ '|\*\{1,80}' && s:line2 =~ 'VRC '
+ \ || s:line2 =~ '|\*\{1,80}' && s:line3 =~ 'VRC '
+ set ft=baan
+
+ " Valgrind
+ elseif s:line1 =~ '^==\d\+== valgrind'
+ set ft=valgrind
+
+ " Renderman Interface Bytestream
+ elseif s:line1 =~ '^##RenderMan'
+ set ft=rib
+
+ " Scheme scripts
+ elseif s:line1 =~ 'exec\s\+\S*scheme' || s:line2 =~ 'exec\s\+\S*scheme'
+ set ft=scheme
+
+ " CVS diff
+ else
+ let lnum = 1
+ while getline(lnum) =~ "^? " && lnum < line("$")
+ let lnum = lnum + 1
+ endwhile
+ if getline(lnum) =~ '^Index:\s\+\f\+$'
+ set ft=diff
+
+ " locale input files: Formal Definitions of Cultural Conventions
+ " filename must be like en_US, fr_FR@euro or en_US.UTF-8
+ elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
+ let lnum = 1
+ while lnum < 100 && lnum < line("$")
+ if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
+ setf fdcc
+ break
+ endif
+ let lnum = lnum + 1
+ endwhile
+ endif
+
+ endif
+
+ unlet s:line2 s:line3 s:line4 s:line5
+
+endif
+
+" Restore 'cpoptions'
+let &cpo = s:cpo_save
+
+unlet s:cpo_save s:line1
diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim
new file mode 100644
index 000000000..f6e5823b3
--- /dev/null
+++ b/runtime/synmenu.vim
@@ -0,0 +1,450 @@
+" Vim support file to define the syntax selection menu
+" This file is normally sourced from menu.vim.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Jun 22
+
+" Define the SetSyn function, used for the Syntax menu entries.
+" Set 'filetype' and also 'syntax' if it is manually selected.
+fun! SetSyn(name)
+ if a:name == "fvwm1"
+ let use_fvwm_1 = 1
+ let use_fvwm_2 = 0
+ let name = "fvwm"
+ elseif a:name == "fvwm2"
+ let use_fvwm_2 = 1
+ let use_fvwm_1 = 0
+ let name = "fvwm"
+ else
+ let name = a:name
+ endif
+ if !exists("s:syntax_menu_synonly")
+ exe "set ft=" . name
+ if exists("g:syntax_manual")
+ exe "set syn=" . name
+ endif
+ else
+ exe "set syn=" . name
+ endif
+endfun
+
+" The following menu items are generated by makemenu.vim.
+" The Start Of The Syntax Menu
+
+an 50.10.100 &Syntax.AB.Aap :cal SetSyn("aap")<CR>
+an 50.10.110 &Syntax.AB.Abaqus :cal SetSyn("abaqus")<CR>
+an 50.10.120 &Syntax.AB.ABC\ music\ notation :cal SetSyn("abc")<CR>
+an 50.10.130 &Syntax.AB.ABEL :cal SetSyn("abel")<CR>
+an 50.10.140 &Syntax.AB.AceDB\ model :cal SetSyn("acedb")<CR>
+an 50.10.150 &Syntax.AB.Ada :cal SetSyn("ada")<CR>
+an 50.10.160 &Syntax.AB.AfLex :cal SetSyn("aflex")<CR>
+an 50.10.170 &Syntax.AB.Altera\ AHDL :cal SetSyn("ahdl")<CR>
+an 50.10.180 &Syntax.AB.Amiga\ DOS :cal SetSyn("amiga")<CR>
+an 50.10.190 &Syntax.AB.AMPL :cal SetSyn("ampl")<CR>
+an 50.10.200 &Syntax.AB.Ant\ build\ file :cal SetSyn("ant")<CR>
+an 50.10.210 &Syntax.AB.ANTLR :cal SetSyn("antlr")<CR>
+an 50.10.220 &Syntax.AB.Apache\ config :cal SetSyn("apache")<CR>
+an 50.10.230 &Syntax.AB.Apache-style\ config :cal SetSyn("apachestyle")<CR>
+an 50.10.240 &Syntax.AB.Applix\ ELF :cal SetSyn("elf")<CR>
+an 50.10.250 &Syntax.AB.Arc\ Macro\ Language :cal SetSyn("aml")<CR>
+an 50.10.260 &Syntax.AB.Arch\ inventory :cal SetSyn("arch")<CR>
+an 50.10.270 &Syntax.AB.ART :cal SetSyn("art")<CR>
+an 50.10.280 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs")<CR>
+an 50.10.290 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl")<CR>
+an 50.10.300 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k")<CR>
+an 50.10.310 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm")<CR>
+an 50.10.320 &Syntax.AB.Assembly.GNU :cal SetSyn("asm")<CR>
+an 50.10.330 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300")<CR>
+an 50.10.340 &Syntax.AB.Assembly.Intel\ IA-64 :cal SetSyn("ia64")<CR>
+an 50.10.350 &Syntax.AB.Assembly.Microsoft :cal SetSyn("masm")<CR>
+an 50.10.360 &Syntax.AB.Assembly.Netwide :cal SetSyn("nasm")<CR>
+an 50.10.370 &Syntax.AB.Assembly.PIC :cal SetSyn("pic")<CR>
+an 50.10.380 &Syntax.AB.Assembly.Turbo :cal SetSyn("tasm")<CR>
+an 50.10.390 &Syntax.AB.Assembly.VAX\ Macro\ Assembly :cal SetSyn("vmasm")<CR>
+an 50.10.400 &Syntax.AB.Assembly.Z-80 :cal SetSyn("z8a")<CR>
+an 50.10.410 &Syntax.AB.Assembly.xa\ 6502\ cross\ assember :cal SetSyn("a65")<CR>
+an 50.10.420 &Syntax.AB.ASN\.1 :cal SetSyn("asn")<CR>
+an 50.10.430 &Syntax.AB.Atlas :cal SetSyn("atlas")<CR>
+an 50.10.440 &Syntax.AB.Automake :cal SetSyn("automake")<CR>
+an 50.10.450 &Syntax.AB.Avenue :cal SetSyn("ave")<CR>
+an 50.10.460 &Syntax.AB.Awk :cal SetSyn("awk")<CR>
+an 50.10.470 &Syntax.AB.AYacc :cal SetSyn("ayacc")<CR>
+an 50.10.490 &Syntax.AB.B :cal SetSyn("b")<CR>
+an 50.10.500 &Syntax.AB.Baan :cal SetSyn("baan")<CR>
+an 50.10.510 &Syntax.AB.BASIC :cal SetSyn("basic")<CR>
+an 50.10.520 &Syntax.AB.BC\ calculator :cal SetSyn("bc")<CR>
+an 50.10.530 &Syntax.AB.BDF\ font :cal SetSyn("bdf")<CR>
+an 50.10.540 &Syntax.AB.BibTeX :cal SetSyn("bib")<CR>
+an 50.10.550 &Syntax.AB.BIND.BIND\ config :cal SetSyn("named")<CR>
+an 50.10.560 &Syntax.AB.BIND.BIND\ zone :cal SetSyn("bindzone")<CR>
+an 50.10.570 &Syntax.AB.Blank :cal SetSyn("blank")<CR>
+an 50.20.100 &Syntax.C.C :cal SetSyn("c")<CR>
+an 50.20.110 &Syntax.C.C++ :cal SetSyn("cpp")<CR>
+an 50.20.120 &Syntax.C.C# :cal SetSyn("cs")<CR>
+an 50.20.130 &Syntax.C.Calendar :cal SetSyn("calendar")<CR>
+an 50.20.140 &Syntax.C.CDL :cal SetSyn("cdl")<CR>
+an 50.20.150 &Syntax.C.Crontab :cal SetSyn("crontab")<CR>
+an 50.20.160 &Syntax.C.Cyn++ :cal SetSyn("cynpp")<CR>
+an 50.20.170 &Syntax.C.Cynlib :cal SetSyn("cynlib")<CR>
+an 50.20.180 &Syntax.C.Cascading\ Style\ Sheets :cal SetSyn("css")<CR>
+an 50.20.190 &Syntax.C.Century\ Term :cal SetSyn("cterm")<CR>
+an 50.20.200 &Syntax.C.CH\ script :cal SetSyn("ch")<CR>
+an 50.20.210 &Syntax.C.ChangeLog :cal SetSyn("changelog")<CR>
+an 50.20.220 &Syntax.C.Cheetah\ template :cal SetSyn("cheetah")<CR>
+an 50.20.230 &Syntax.C.CHILL :cal SetSyn("chill")<CR>
+an 50.20.240 &Syntax.C.Clean :cal SetSyn("clean")<CR>
+an 50.20.250 &Syntax.C.Clever :cal SetSyn("cl")<CR>
+an 50.20.260 &Syntax.C.Clipper :cal SetSyn("clipper")<CR>
+an 50.20.270 &Syntax.C.Cold\ Fusion :cal SetSyn("cf")<CR>
+an 50.20.280 &Syntax.C.Config.Cfg\ Config\ file :cal SetSyn("cfg")<CR>
+an 50.20.290 &Syntax.C.Config.Generic\ Config\ file :cal SetSyn("conf")<CR>
+an 50.20.300 &Syntax.C.Config.Configure\.in :cal SetSyn("config")<CR>
+an 50.20.310 &Syntax.C.CRM114 :cal SetSyn("crm")<CR>
+an 50.20.320 &Syntax.C.Ctrl-H :cal SetSyn("ctrlh")<CR>
+an 50.20.330 &Syntax.C.Cobol :cal SetSyn("cobol")<CR>
+an 50.20.340 &Syntax.C.CSP :cal SetSyn("csp")<CR>
+an 50.20.350 &Syntax.C.CUPL.CUPL :cal SetSyn("cupl")<CR>
+an 50.20.360 &Syntax.C.CUPL.Simulation :cal SetSyn("cuplsim")<CR>
+an 50.20.370 &Syntax.C.CVS.commit\ file :cal SetSyn("cvs")<CR>
+an 50.20.380 &Syntax.C.CVS.cvsrc :cal SetSyn("cvsrc")<CR>
+an 50.30.100 &Syntax.DE.D :cal SetSyn("d")<CR>
+an 50.30.110 &Syntax.DE.Debian.Debian\ ChangeLog :cal SetSyn("debchangelog")<CR>
+an 50.30.120 &Syntax.DE.Debian.Debian\ Control :cal SetSyn("debcontrol")<CR>
+an 50.30.130 &Syntax.DE.Desktop :cal SetSyn("desktop")<CR>
+an 50.30.140 &Syntax.DE.Diff :cal SetSyn("diff")<CR>
+an 50.30.150 &Syntax.DE.Digital\ Command\ Lang :cal SetSyn("dcl")<CR>
+an 50.30.160 &Syntax.DE.Dircolors :cal SetSyn("dircolors")<CR>
+an 50.30.170 &Syntax.DE.DNS/BIND\ zone :cal SetSyn("dns")<CR>
+an 50.30.180 &Syntax.DE.DocBook.auto-detect :cal SetSyn("docbk")<CR>
+an 50.30.190 &Syntax.DE.DocBook.SGML :cal SetSyn("docbksgml")<CR>
+an 50.30.200 &Syntax.DE.DocBook.XML :cal SetSyn("docbkxml")<CR>
+an 50.30.210 &Syntax.DE.Dot :cal SetSyn("dot")<CR>
+an 50.30.220 &Syntax.DE.Dracula :cal SetSyn("dracula")<CR>
+an 50.30.230 &Syntax.DE.DSSSL :cal SetSyn("dsl")<CR>
+an 50.30.240 &Syntax.DE.DTD :cal SetSyn("dtd")<CR>
+an 50.30.250 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml")<CR>
+an 50.30.260 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan")<CR>
+an 50.30.270 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr")<CR>
+an 50.30.280 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid")<CR>
+an 50.30.300 &Syntax.DE.EDIF :cal SetSyn("edif")<CR>
+an 50.30.310 &Syntax.DE.Eiffel :cal SetSyn("eiffel")<CR>
+an 50.30.320 &Syntax.DE.Elinks\ config :cal SetSyn("elinks")<CR>
+an 50.30.330 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt")<CR>
+an 50.30.340 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd")<CR>
+an 50.30.350 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang")<CR>
+an 50.30.360 &Syntax.DE.ESQL-C :cal SetSyn("esqlc")<CR>
+an 50.30.370 &Syntax.DE.Essbase\ script :cal SetSyn("csc")<CR>
+an 50.30.380 &Syntax.DE.Eterm\ config :cal SetSyn("eterm")<CR>
+an 50.30.390 &Syntax.DE.Exim\ conf :cal SetSyn("exim")<CR>
+an 50.30.400 &Syntax.DE.Expect :cal SetSyn("expect")<CR>
+an 50.30.410 &Syntax.DE.Exports :cal SetSyn("exports")<CR>
+an 50.40.100 &Syntax.FG.Fetchmail :cal SetSyn("fetchmail")<CR>
+an 50.40.110 &Syntax.FG.Focus\ Executable :cal SetSyn("focexec")<CR>
+an 50.40.120 &Syntax.FG.Focus\ Master :cal SetSyn("master")<CR>
+an 50.40.130 &Syntax.FG.FORM :cal SetSyn("form")<CR>
+an 50.40.140 &Syntax.FG.Forth :cal SetSyn("forth")<CR>
+an 50.40.150 &Syntax.FG.Fortran :cal SetSyn("fortran")<CR>
+an 50.40.160 &Syntax.FG.FoxPro :cal SetSyn("foxpro")<CR>
+an 50.40.170 &Syntax.FG.Fstab :cal SetSyn("fstab")<CR>
+an 50.40.180 &Syntax.FG.Fvwm.Fvwm\ configuration :cal SetSyn("fvwm1")<CR>
+an 50.40.190 &Syntax.FG.Fvwm.Fvwm2\ configuration :cal SetSyn("fvwm2")<CR>
+an 50.40.200 &Syntax.FG.Fvwm.Fvwm2\ configuration\ with\ M4 :cal SetSyn("fvwm2m4")<CR>
+an 50.40.220 &Syntax.FG.GDB\ command\ file :cal SetSyn("gdb")<CR>
+an 50.40.230 &Syntax.FG.GDMO :cal SetSyn("gdmo")<CR>
+an 50.40.240 &Syntax.FG.Gedcom :cal SetSyn("gedcom")<CR>
+an 50.40.250 &Syntax.FG.Gkrellmrc :cal SetSyn("gkrellmrc")<CR>
+an 50.40.260 &Syntax.FG.GP :cal SetSyn("gp")<CR>
+an 50.40.270 &Syntax.FG.GPG :cal SetSyn("gpg")<CR>
+an 50.40.280 &Syntax.FG.Grub :cal SetSyn("grub")<CR>
+an 50.40.290 &Syntax.FG.GNU\ Server\ Pages :cal SetSyn("gsp")<CR>
+an 50.40.300 &Syntax.FG.GNUplot :cal SetSyn("gnuplot")<CR>
+an 50.40.310 &Syntax.FG.GrADS\ scripts :cal SetSyn("grads")<CR>
+an 50.40.320 &Syntax.FG.Groff :cal SetSyn("groff")<CR>
+an 50.40.330 &Syntax.FG.GTKrc :cal SetSyn("gtkrc")<CR>
+an 50.50.100 &Syntax.HIJK.Haskell.Haskell :cal SetSyn("haskell")<CR>
+an 50.50.110 &Syntax.HIJK.Haskell.Haskell-c2hs :cal SetSyn("chaskell")<CR>
+an 50.50.120 &Syntax.HIJK.Haskell.Haskell-literate :cal SetSyn("lhaskell")<CR>
+an 50.50.130 &Syntax.HIJK.Hercules :cal SetSyn("hercules")<CR>
+an 50.50.140 &Syntax.HIJK.Hex\ dump.XXD :cal SetSyn("xxd")<CR>
+an 50.50.150 &Syntax.HIJK.Hex\ dump.Intel\ MCS51 :cal SetSyn("hex")<CR>
+an 50.50.160 &Syntax.HIJK.HTML.HTML :cal SetSyn("html")<CR>
+an 50.50.170 &Syntax.HIJK.HTML.HTML\ with\ M4 :cal SetSyn("htmlm4")<CR>
+an 50.50.180 &Syntax.HIJK.HTML.Cheetah\ HTML\ template :cal SetSyn("htmlcheetah")<CR>
+an 50.50.190 &Syntax.HIJK.HTML.HTML/OS :cal SetSyn("htmlos")<CR>
+an 50.50.200 &Syntax.HIJK.HTML.XHTML :cal SetSyn("xhtml")<CR>
+an 50.50.210 &Syntax.HIJK.Hyper\ Builder :cal SetSyn("hb")<CR>
+an 50.50.230 &Syntax.HIJK.Icewm\ menu :cal SetSyn("icemenu")<CR>
+an 50.50.240 &Syntax.HIJK.Icon :cal SetSyn("icon")<CR>
+an 50.50.250 &Syntax.HIJK.IDL\Generic\ IDL :cal SetSyn("idl")<CR>
+an 50.50.260 &Syntax.HIJK.IDL\Microsoft\ IDL :cal SetSyn("msidl")<CR>
+an 50.50.270 &Syntax.HIJK.Indent\ profile :cal SetSyn("indent")<CR>
+an 50.50.280 &Syntax.HIJK.Inform :cal SetSyn("inform")<CR>
+an 50.50.290 &Syntax.HIJK.Informix\ 4GL :cal SetSyn("fgl")<CR>
+an 50.50.300 &Syntax.HIJK.Inittab :cal SetSyn("inittab")<CR>
+an 50.50.310 &Syntax.HIJK.Inno\ setup :cal SetSyn("iss")<CR>
+an 50.50.320 &Syntax.HIJK.InstallShield\ script :cal SetSyn("ishd")<CR>
+an 50.50.330 &Syntax.HIJK.Interactive\ Data\ Lang :cal SetSyn("idlang")<CR>
+an 50.50.340 &Syntax.HIJK.IPfilter :cal SetSyn("ipfilter")<CR>
+an 50.50.360 &Syntax.HIJK.JAL :cal SetSyn("jal")<CR>
+an 50.50.370 &Syntax.HIJK.JAM :cal SetSyn("jam")<CR>
+an 50.50.380 &Syntax.HIJK.Jargon :cal SetSyn("jargon")<CR>
+an 50.50.390 &Syntax.HIJK.Java.Java :cal SetSyn("java")<CR>
+an 50.50.400 &Syntax.HIJK.Java.JavaCC :cal SetSyn("javacc")<CR>
+an 50.50.410 &Syntax.HIJK.Java.Java\ Server\ Pages :cal SetSyn("jsp")<CR>
+an 50.50.420 &Syntax.HIJK.Java.Java\ Properties :cal SetSyn("jproperties")<CR>
+an 50.50.430 &Syntax.HIJK.JavaScript :cal SetSyn("javascript")<CR>
+an 50.50.440 &Syntax.HIJK.Jess :cal SetSyn("jess")<CR>
+an 50.50.450 &Syntax.HIJK.Jgraph :cal SetSyn("jgraph")<CR>
+an 50.50.470 &Syntax.HIJK.KDE\ script :cal SetSyn("kscript")<CR>
+an 50.50.480 &Syntax.HIJK.Kimwitu++ :cal SetSyn("kwt")<CR>
+an 50.50.490 &Syntax.HIJK.KixTart :cal SetSyn("kix")<CR>
+an 50.60.100 &Syntax.L-Ma.Lace :cal SetSyn("lace")<CR>
+an 50.60.110 &Syntax.L-Ma.LamdaProlog :cal SetSyn("lprolog")<CR>
+an 50.60.120 &Syntax.L-Ma.Latte :cal SetSyn("latte")<CR>
+an 50.60.130 &Syntax.L-Ma.LDAP\ LDIF :cal SetSyn("ldif")<CR>
+an 50.60.140 &Syntax.L-Ma.Lex :cal SetSyn("lex")<CR>
+an 50.60.150 &Syntax.L-Ma.LFTP\ config :cal SetSyn("lftp")<CR>
+an 50.60.160 &Syntax.L-Ma.Libao :cal SetSyn("libao")<CR>
+an 50.60.170 &Syntax.L-Ma.LifeLines\ script :cal SetSyn("lifelines")<CR>
+an 50.60.180 &Syntax.L-Ma.Lilo :cal SetSyn("lilo")<CR>
+an 50.60.190 &Syntax.L-Ma.Lisp :cal SetSyn("lisp")<CR>
+an 50.60.200 &Syntax.L-Ma.Lite :cal SetSyn("lite")<CR>
+an 50.60.210 &Syntax.L-Ma.Locale\ Input :cal SetSyn("fdcc")<CR>
+an 50.60.220 &Syntax.L-Ma.Logtalk :cal SetSyn("logtalk")<CR>
+an 50.60.230 &Syntax.L-Ma.LOTOS :cal SetSyn("lotos")<CR>
+an 50.60.240 &Syntax.L-Ma.LotusScript :cal SetSyn("lscript")<CR>
+an 50.60.250 &Syntax.L-Ma.Lout :cal SetSyn("lout")<CR>
+an 50.60.260 &Syntax.L-Ma.LPC :cal SetSyn("lpc")<CR>
+an 50.60.270 &Syntax.L-Ma.Lua :cal SetSyn("lua")<CR>
+an 50.60.280 &Syntax.L-Ma.Lynx\ Style :cal SetSyn("lss")<CR>
+an 50.60.290 &Syntax.L-Ma.Lynx\ config :cal SetSyn("lynx")<CR>
+an 50.60.310 &Syntax.L-Ma.M4 :cal SetSyn("m4")<CR>
+an 50.60.320 &Syntax.L-Ma.MaGic\ Point :cal SetSyn("mgp")<CR>
+an 50.60.330 &Syntax.L-Ma.Mail :cal SetSyn("mail")<CR>
+an 50.60.340 &Syntax.L-Ma.Mailcap :cal SetSyn("mailcap")<CR>
+an 50.60.350 &Syntax.L-Ma.Makefile :cal SetSyn("make")<CR>
+an 50.60.360 &Syntax.L-Ma.MakeIndex :cal SetSyn("ist")<CR>
+an 50.60.370 &Syntax.L-Ma.Man\ page :cal SetSyn("man")<CR>
+an 50.60.380 &Syntax.L-Ma.Maple\ V :cal SetSyn("maple")<CR>
+an 50.60.390 &Syntax.L-Ma.Mason :cal SetSyn("mason")<CR>
+an 50.60.400 &Syntax.L-Ma.Mathematica :cal SetSyn("mma")<CR>
+an 50.60.410 &Syntax.L-Ma.Matlab :cal SetSyn("matlab")<CR>
+an 50.70.100 &Syntax.Me-NO.MEL\ (for\ Maya) :cal SetSyn("mel")<CR>
+an 50.70.110 &Syntax.Me-NO.Metafont :cal SetSyn("mf")<CR>
+an 50.70.120 &Syntax.Me-NO.MetaPost :cal SetSyn("mp")<CR>
+an 50.70.130 &Syntax.Me-NO.MMIX :cal SetSyn("mmix")<CR>
+an 50.70.140 &Syntax.Me-NO.Modconf :cal SetSyn("modconf")<CR>
+an 50.70.150 &Syntax.Me-NO.Model :cal SetSyn("model")<CR>
+an 50.70.160 &Syntax.Me-NO.Modsim\ III :cal SetSyn("modsim3")<CR>
+an 50.70.170 &Syntax.Me-NO.Modula\ 2 :cal SetSyn("modula2")<CR>
+an 50.70.180 &Syntax.Me-NO.Modula\ 3 :cal SetSyn("modula3")<CR>
+an 50.70.190 &Syntax.Me-NO.Monk :cal SetSyn("monk")<CR>
+an 50.70.200 &Syntax.Me-NO.Mplayer\ config :cal SetSyn("mplayerconf")<CR>
+an 50.70.210 &Syntax.Me-NO.MOO :cal SetSyn("moo")<CR>
+an 50.70.220 &Syntax.Me-NO.MS-DOS/Windows.4DOS\ \.bat\ file :cal SetSyn("btm")<CR>
+an 50.70.230 &Syntax.Me-NO.MS-DOS/Windows.\.bat\/\.cmd\ file :cal SetSyn("dosbatch")<CR>
+an 50.70.240 &Syntax.Me-NO.MS-DOS/Windows.\.ini\ file :cal SetSyn("dosini")<CR>
+an 50.70.250 &Syntax.Me-NO.MS-DOS/Windows.Module\ Definition :cal SetSyn("def")<CR>
+an 50.70.260 &Syntax.Me-NO.MS-DOS/Windows.Registry :cal SetSyn("registry")<CR>
+an 50.70.270 &Syntax.Me-NO.MS-DOS/Windows.Resource\ file :cal SetSyn("rc")<CR>
+an 50.70.280 &Syntax.Me-NO.Msql :cal SetSyn("msql")<CR>
+an 50.70.290 &Syntax.Me-NO.MUSHcode :cal SetSyn("mush")<CR>
+an 50.70.300 &Syntax.Me-NO.Muttrc :cal SetSyn("muttrc")<CR>
+an 50.70.320 &Syntax.Me-NO.Nastran\ input/DMAP :cal SetSyn("nastran")<CR>
+an 50.70.330 &Syntax.Me-NO.Natural :cal SetSyn("natural")<CR>
+an 50.70.340 &Syntax.Me-NO.Novell\ NCF\ batch :cal SetSyn("ncf")<CR>
+an 50.70.350 &Syntax.Me-NO.Not\ Quite\ C\ (LEGO) :cal SetSyn("nqc")<CR>
+an 50.70.360 &Syntax.Me-NO.Nroff :cal SetSyn("nroff")<CR>
+an 50.70.370 &Syntax.Me-NO.NSIS\ script :cal SetSyn("nsis")<CR>
+an 50.70.390 &Syntax.Me-NO.Objective\ C :cal SetSyn("objc")<CR>
+an 50.70.400 &Syntax.Me-NO.Objective\ C++ :cal SetSyn("objcpp")<CR>
+an 50.70.410 &Syntax.Me-NO.OCAML :cal SetSyn("ocaml")<CR>
+an 50.70.420 &Syntax.Me-NO.Occam :cal SetSyn("occam")<CR>
+an 50.70.430 &Syntax.Me-NO.Omnimark :cal SetSyn("omnimark")<CR>
+an 50.70.440 &Syntax.Me-NO.OpenROAD :cal SetSyn("openroad")<CR>
+an 50.70.450 &Syntax.Me-NO.Open\ Psion\ Lang :cal SetSyn("opl")<CR>
+an 50.70.460 &Syntax.Me-NO.Oracle\ config :cal SetSyn("ora")<CR>
+an 50.80.100 &Syntax.PQ.Palm\ resource\ compiler :cal SetSyn("pilrc")<CR>
+an 50.80.110 &Syntax.PQ.Packet\ filter\ conf :cal SetSyn("pf")<CR>
+an 50.80.120 &Syntax.PQ.PApp :cal SetSyn("papp")<CR>
+an 50.80.130 &Syntax.PQ.Pascal :cal SetSyn("pascal")<CR>
+an 50.80.140 &Syntax.PQ.PCCTS :cal SetSyn("pccts")<CR>
+an 50.80.150 &Syntax.PQ.PPWizard :cal SetSyn("ppwiz")<CR>
+an 50.80.160 &Syntax.PQ.Perl.Perl :cal SetSyn("perl")<CR>
+an 50.80.170 &Syntax.PQ.Perl.Perl\ POD :cal SetSyn("pod")<CR>
+an 50.80.180 &Syntax.PQ.Perl.Perl\ XS :cal SetSyn("xs")<CR>
+an 50.80.190 &Syntax.PQ.PHP.PHP\ 3-4 :cal SetSyn("php")<CR>
+an 50.80.200 &Syntax.PQ.PHP.Phtml\ (PHP\ 2) :cal SetSyn("phtml")<CR>
+an 50.80.210 &Syntax.PQ.Pike :cal SetSyn("pike")<CR>
+an 50.80.220 &Syntax.PQ.Pine\ RC :cal SetSyn("pine")<CR>
+an 50.80.230 &Syntax.PQ.Pinfo\ RC :cal SetSyn("pinfo")<CR>
+an 50.80.240 &Syntax.PQ.PL/M :cal SetSyn("plm")<CR>
+an 50.80.250 &Syntax.PQ.PL/SQL :cal SetSyn("plsql")<CR>
+an 50.80.260 &Syntax.PQ.PLP :cal SetSyn("plp")<CR>
+an 50.80.270 &Syntax.PQ.PO\ (GNU\ gettext) :cal SetSyn("po")<CR>
+an 50.80.280 &Syntax.PQ.Postfix\ main\ config :cal SetSyn("pfmain")<CR>
+an 50.80.290 &Syntax.PQ.PostScript.PostScript :cal SetSyn("postscr")<CR>
+an 50.80.300 &Syntax.PQ.PostScript.PostScript\ Printer\ Description :cal SetSyn("ppd")<CR>
+an 50.80.310 &Syntax.PQ.Povray.Povray\ scene\ descr :cal SetSyn("pov")<CR>
+an 50.80.320 &Syntax.PQ.Povray.Povray\ configuration :cal SetSyn("povini")<CR>
+an 50.80.330 &Syntax.PQ.Printcap :cal SetSyn("pcap")<CR>
+an 50.80.340 &Syntax.PQ.Procmail :cal SetSyn("procmail")<CR>
+an 50.80.350 &Syntax.PQ.Product\ Spec\ File :cal SetSyn("psf")<CR>
+an 50.80.360 &Syntax.PQ.Progress :cal SetSyn("progress")<CR>
+an 50.80.370 &Syntax.PQ.Prolog :cal SetSyn("prolog")<CR>
+an 50.80.380 &Syntax.PQ.Purify\ log :cal SetSyn("purifylog")<CR>
+an 50.80.390 &Syntax.PQ.Pyrex :cal SetSyn("pyrex")<CR>
+an 50.80.400 &Syntax.PQ.Python :cal SetSyn("python")<CR>
+an 50.80.420 &Syntax.PQ.Quake :cal SetSyn("quake")<CR>
+an 50.80.430 &Syntax.PQ.Quickfix\ window :cal SetSyn("qf")<CR>
+an 50.90.100 &Syntax.R-Sg.R :cal SetSyn("r")<CR>
+an 50.90.110 &Syntax.R-Sg.Radiance :cal SetSyn("radiance")<CR>
+an 50.90.120 &Syntax.R-Sg.Ratpoison :cal SetSyn("ratpoison")<CR>
+an 50.90.130 &Syntax.R-Sg.RCS.RCS\ log\ output :cal SetSyn("rcslog")<CR>
+an 50.90.140 &Syntax.R-Sg.RCS.RCS\ file :cal SetSyn("rcs")<CR>
+an 50.90.150 &Syntax.R-Sg.Readline\ config :cal SetSyn("readline")<CR>
+an 50.90.160 &Syntax.R-Sg.Rebol :cal SetSyn("rebol")<CR>
+an 50.90.170 &Syntax.R-Sg.Remind :cal SetSyn("remind")<CR>
+an 50.90.180 &Syntax.R-Sg.Relax\ NG\ compact :cal SetSyn("rnc")<CR>
+an 50.90.190 &Syntax.R-Sg.Renderman.Renderman\ Shader\ Lang :cal SetSyn("sl")<CR>
+an 50.90.200 &Syntax.R-Sg.Renderman.Renderman\ Interface\ Bytestream :cal SetSyn("rib")<CR>
+an 50.90.210 &Syntax.R-Sg.Resolv\.conf :cal SetSyn("resolv")<CR>
+an 50.90.220 &Syntax.R-Sg.Rexx :cal SetSyn("rexx")<CR>
+an 50.90.230 &Syntax.R-Sg.Robots\.txt :cal SetSyn("robots")<CR>
+an 50.90.240 &Syntax.R-Sg.RockLinux\ package\ desc\. :cal SetSyn("desc")<CR>
+an 50.90.250 &Syntax.R-Sg.Rpcgen :cal SetSyn("rpcgen")<CR>
+an 50.90.260 &Syntax.R-Sg.RPL/2 :cal SetSyn("rpl")<CR>
+an 50.90.270 &Syntax.R-Sg.ReStructuredText :cal SetSyn("rst")<CR>
+an 50.90.280 &Syntax.R-Sg.RTF :cal SetSyn("rtf")<CR>
+an 50.90.290 &Syntax.R-Sg.Ruby :cal SetSyn("ruby")<CR>
+an 50.90.310 &Syntax.R-Sg.S-Lang :cal SetSyn("slang")<CR>
+an 50.90.320 &Syntax.R-Sg.Samba\ config :cal SetSyn("samba")<CR>
+an 50.90.330 &Syntax.R-Sg.SAS :cal SetSyn("sas")<CR>
+an 50.90.340 &Syntax.R-Sg.Sather :cal SetSyn("sather")<CR>
+an 50.90.350 &Syntax.R-Sg.Scheme :cal SetSyn("scheme")<CR>
+an 50.90.360 &Syntax.R-Sg.Scilab :cal SetSyn("scilab")<CR>
+an 50.90.370 &Syntax.R-Sg.Screen\ RC :cal SetSyn("screen")<CR>
+an 50.90.380 &Syntax.R-Sg.SDL :cal SetSyn("sdl")<CR>
+an 50.90.390 &Syntax.R-Sg.Sed :cal SetSyn("sed")<CR>
+an 50.90.400 &Syntax.R-Sg.Sendmail\.cf :cal SetSyn("sm")<CR>
+an 50.90.410 &Syntax.R-Sg.Send-pr :cal SetSyn("sendpr")<CR>
+an 50.90.420 &Syntax.R-Sg.SGML.SGML\ catalog :cal SetSyn("catalog")<CR>
+an 50.90.430 &Syntax.R-Sg.SGML.SGML\ DTD :cal SetSyn("sgml")<CR>
+an 50.90.440 &Syntax.R-Sg.SGML.SGML\ Declaration :cal SetSyn("sgmldecl")<CR>
+an 50.90.450 &Syntax.R-Sg.SGML.SGML-linuxdoc :cal SetSyn("sgmllnx")<CR>
+an 50.100.100 &Syntax.Sh-S.Shell\ script.sh\ and\ ksh :cal SetSyn("sh")<CR>
+an 50.100.110 &Syntax.Sh-S.Shell\ script.csh :cal SetSyn("csh")<CR>
+an 50.100.120 &Syntax.Sh-S.Shell\ script.tcsh :cal SetSyn("tcsh")<CR>
+an 50.100.130 &Syntax.Sh-S.Shell\ script.zsh :cal SetSyn("zsh")<CR>
+an 50.100.140 &Syntax.Sh-S.SiCAD :cal SetSyn("sicad")<CR>
+an 50.100.150 &Syntax.Sh-S.Simula :cal SetSyn("simula")<CR>
+an 50.100.160 &Syntax.Sh-S.Sinda.Sinda\ compare :cal SetSyn("sindacmp")<CR>
+an 50.100.170 &Syntax.Sh-S.Sinda.Sinda\ input :cal SetSyn("sinda")<CR>
+an 50.100.180 &Syntax.Sh-S.Sinda.Sinda\ output :cal SetSyn("sindaout")<CR>
+an 50.100.190 &Syntax.Sh-S.SKILL.SKILL :cal SetSyn("skill")<CR>
+an 50.100.200 &Syntax.Sh-S.SKILL.SKILL\ for\ Diva :cal SetSyn("diva")<CR>
+an 50.100.210 &Syntax.Sh-S.Slice :cal SetSyn("slice")<CR>
+an 50.100.220 &Syntax.Sh-S.SLRN.Slrn\ rc :cal SetSyn("slrnrc")<CR>
+an 50.100.230 &Syntax.Sh-S.SLRN.Slrn\ score :cal SetSyn("slrnsc")<CR>
+an 50.100.240 &Syntax.Sh-S.SmallTalk :cal SetSyn("st")<CR>
+an 50.100.250 &Syntax.Sh-S.Smarty\ Templates :cal SetSyn("smarty")<CR>
+an 50.100.260 &Syntax.Sh-S.SMIL :cal SetSyn("smil")<CR>
+an 50.100.270 &Syntax.Sh-S.SMITH :cal SetSyn("smith")<CR>
+an 50.100.280 &Syntax.Sh-S.SNMP\ MIB :cal SetSyn("mib")<CR>
+an 50.100.290 &Syntax.Sh-S.SNNS.SNNS\ network :cal SetSyn("snnsnet")<CR>
+an 50.100.300 &Syntax.Sh-S.SNNS.SNNS\ pattern :cal SetSyn("snnspat")<CR>
+an 50.100.310 &Syntax.Sh-S.SNNS.SNNS\ result :cal SetSyn("snnsres")<CR>
+an 50.100.320 &Syntax.Sh-S.Snobol4 :cal SetSyn("snobol4")<CR>
+an 50.100.330 &Syntax.Sh-S.Snort\ Configuration :cal SetSyn("hog")<CR>
+an 50.100.340 &Syntax.Sh-S.SPEC\ (Linux\ RPM) :cal SetSyn("spec")<CR>
+an 50.100.350 &Syntax.Sh-S.Specman :cal SetSyn("specman")<CR>
+an 50.100.360 &Syntax.Sh-S.Spice :cal SetSyn("spice")<CR>
+an 50.100.370 &Syntax.Sh-S.Spyce :cal SetSyn("spyce")<CR>
+an 50.100.380 &Syntax.Sh-S.Speedup :cal SetSyn("spup")<CR>
+an 50.100.390 &Syntax.Sh-S.Splint :cal SetSyn("splint")<CR>
+an 50.100.400 &Syntax.Sh-S.Squid\ config :cal SetSyn("squid")<CR>
+an 50.100.410 &Syntax.Sh-S.SQL.MySQL :cal SetSyn("mysql")<CR>
+an 50.100.420 &Syntax.Sh-S.SQL.SQL :cal SetSyn("sql")<CR>
+an 50.100.430 &Syntax.Sh-S.SQL.SQL\ Forms :cal SetSyn("sqlforms")<CR>
+an 50.100.440 &Syntax.Sh-S.SQL.SQLJ :cal SetSyn("sqlj")<CR>
+an 50.100.450 &Syntax.Sh-S.SQR :cal SetSyn("sqr")<CR>
+an 50.100.460 &Syntax.Sh-S.Ssh.ssh_config :cal SetSyn("sshconfig")<CR>
+an 50.100.470 &Syntax.Sh-S.Ssh.sshd_config :cal SetSyn("sshdconfig")<CR>
+an 50.100.480 &Syntax.Sh-S.Standard\ ML :cal SetSyn("sml")<CR>
+an 50.100.490 &Syntax.Sh-S.Stored\ Procedures :cal SetSyn("stp")<CR>
+an 50.100.500 &Syntax.Sh-S.Strace :cal SetSyn("strace")<CR>
+an 50.100.510 &Syntax.Sh-S.Subversion\ commit :cal SetSyn("svn")<CR>
+an 50.110.100 &Syntax.TUV.TADS :cal SetSyn("tads")<CR>
+an 50.110.110 &Syntax.TUV.Tags :cal SetSyn("tags")<CR>
+an 50.110.120 &Syntax.TUV.TAK.TAK\ compare :cal SetSyn("takcmp")<CR>
+an 50.110.130 &Syntax.TUV.TAK.TAK\ input :cal SetSyn("tak")<CR>
+an 50.110.140 &Syntax.TUV.TAK.TAK\ output :cal SetSyn("takout")<CR>
+an 50.110.150 &Syntax.TUV.Tcl/Tk :cal SetSyn("tcl")<CR>
+an 50.110.160 &Syntax.TUV.TealInfo :cal SetSyn("tli")<CR>
+an 50.110.170 &Syntax.TUV.Telix\ Salt :cal SetSyn("tsalt")<CR>
+an 50.110.180 &Syntax.TUV.Termcap/Printcap :cal SetSyn("ptcap")<CR>
+an 50.110.190 &Syntax.TUV.Terminfo :cal SetSyn("terminfo")<CR>
+an 50.110.200 &Syntax.TUV.TeX.TeX :cal SetSyn("tex")<CR>
+an 50.110.210 &Syntax.TUV.TeX.TeX\ configuration :cal SetSyn("texmf")<CR>
+an 50.110.220 &Syntax.TUV.TeX.Texinfo :cal SetSyn("texinfo")<CR>
+an 50.110.230 &Syntax.TUV.TF\ mud\ client :cal SetSyn("tf")<CR>
+an 50.110.240 &Syntax.TUV.Tidy\ configuration :cal SetSyn("tidy")<CR>
+an 50.110.250 &Syntax.TUV.Tilde :cal SetSyn("tilde")<CR>
+an 50.110.260 &Syntax.TUV.Trasys\ input :cal SetSyn("trasys")<CR>
+an 50.110.270 &Syntax.TUV.TSS.Command\ Line :cal SetSyn("tsscl")<CR>
+an 50.110.280 &Syntax.TUV.TSS.Geometry :cal SetSyn("tssgm")<CR>
+an 50.110.290 &Syntax.TUV.TSS.Optics :cal SetSyn("tssop")<CR>
+an 50.110.310 &Syntax.TUV.UIT/UIL :cal SetSyn("uil")<CR>
+an 50.110.320 &Syntax.TUV.UnrealScript :cal SetSyn("uc")<CR>
+an 50.110.340 &Syntax.TUV.Valgrind :cal SetSyn("valgrind")<CR>
+an 50.110.350 &Syntax.TUV.Verilog\ HDL :cal SetSyn("verilog")<CR>
+an 50.110.360 &Syntax.TUV.Vgrindefs :cal SetSyn("vgrindefs")<CR>
+an 50.110.370 &Syntax.TUV.VHDL :cal SetSyn("vhdl")<CR>
+an 50.110.380 &Syntax.TUV.Vim.Vim\ help\ file :cal SetSyn("help")<CR>
+an 50.110.390 &Syntax.TUV.Vim.Vim\ script :cal SetSyn("vim")<CR>
+an 50.110.400 &Syntax.TUV.Vim.Viminfo\ file :cal SetSyn("viminfo")<CR>
+an 50.110.410 &Syntax.TUV.Virata\ config :cal SetSyn("virata")<CR>
+an 50.110.420 &Syntax.TUV.Visual\ Basic :cal SetSyn("vb")<CR>
+an 50.110.430 &Syntax.TUV.VRML :cal SetSyn("vrml")<CR>
+an 50.110.440 &Syntax.TUV.VSE\ JCL :cal SetSyn("vsejcl")<CR>
+an 50.120.100 &Syntax.WXYZ.WEB.CWEB :cal SetSyn("cweb")<CR>
+an 50.120.110 &Syntax.WXYZ.WEB.WEB :cal SetSyn("web")<CR>
+an 50.120.120 &Syntax.WXYZ.WEB.WEB\ Changes :cal SetSyn("change")<CR>
+an 50.120.130 &Syntax.WXYZ.Webmacro :cal SetSyn("webmacro")<CR>
+an 50.120.140 &Syntax.WXYZ.Website\ MetaLanguage :cal SetSyn("wml")<CR>
+an 50.120.160 &Syntax.WXYZ.wDiff :cal SetSyn("wdiff")<CR>
+an 50.120.180 &Syntax.WXYZ.Wget\ config :cal SetSyn("wget")<CR>
+an 50.120.190 &Syntax.WXYZ.Whitespace\ (add) :cal SetSyn("whitespace")<CR>
+an 50.120.200 &Syntax.WXYZ.WildPackets\ EtherPeek\ Decoder :cal SetSyn("dcd")<CR>
+an 50.120.210 &Syntax.WXYZ.WinBatch/Webbatch :cal SetSyn("winbatch")<CR>
+an 50.120.220 &Syntax.WXYZ.Windows\ Scripting\ Host :cal SetSyn("wsh")<CR>
+an 50.120.230 &Syntax.WXYZ.WvDial :cal SetSyn("wvdial")<CR>
+an 50.120.250 &Syntax.WXYZ.X\ Keyboard\ Extension :cal SetSyn("xkb")<CR>
+an 50.120.260 &Syntax.WXYZ.X\ Pixmap :cal SetSyn("xpm")<CR>
+an 50.120.270 &Syntax.WXYZ.X\ Pixmap\ (2) :cal SetSyn("xpm2")<CR>
+an 50.120.280 &Syntax.WXYZ.X\ resources :cal SetSyn("xdefaults")<CR>
+an 50.120.290 &Syntax.WXYZ.Xmodmap :cal SetSyn("xmodmap")<CR>
+an 50.120.300 &Syntax.WXYZ.Xmath :cal SetSyn("xmath")<CR>
+an 50.120.310 &Syntax.WXYZ.XML :cal SetSyn("xml")<CR>
+an 50.120.320 &Syntax.WXYZ.XML\ Schema\ (XSD) :cal SetSyn("xsd")<CR>
+an 50.120.330 &Syntax.WXYZ.Xslt :cal SetSyn("xslt")<CR>
+an 50.120.340 &Syntax.WXYZ.XFree86\ Config :cal SetSyn("xf86conf")<CR>
+an 50.120.360 &Syntax.WXYZ.YAML :cal SetSyn("yaml")<CR>
+an 50.120.370 &Syntax.WXYZ.Yacc :cal SetSyn("yacc")<CR>
+
+" The End Of The Syntax Menu
+
+
+an 50.195 &Syntax.-SEP1- <Nop>
+
+an <silent> 50.200 &Syntax.Set\ '&syntax'\ only :call <SID>Setsynonly()<CR>
+fun! s:Setsynonly()
+ let s:syntax_menu_synonly = 1
+endfun
+an <silent> 50.202 &Syntax.Set\ '&filetype'\ too :call <SID>Nosynonly()<CR>
+fun! s:Nosynonly()
+ if exists("s:syntax_menu_synonly")
+ unlet s:syntax_menu_synonly
+ endif
+endfun
+
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
new file mode 100644
index 000000000..2afc09f93
--- /dev/null
+++ b/runtime/syntax/2html.vim
@@ -0,0 +1,411 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 May 31
+" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
+" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
+
+" Transform a file into HTML, using the current syntax highlighting.
+
+" Number lines when explicitely requested or when `number' is set
+if exists("html_number_lines")
+ let s:numblines = html_number_lines
+else
+ let s:numblines = &number
+endif
+
+" When not in gui we can only guess the colors.
+if has("gui_running")
+ let s:whatterm = "gui"
+else
+ let s:whatterm = "cterm"
+ if &t_Co == 8
+ let s:cterm_color0 = "#808080"
+ let s:cterm_color1 = "#ff6060"
+ let s:cterm_color2 = "#00ff00"
+ let s:cterm_color3 = "#ffff00"
+ let s:cterm_color4 = "#8080ff"
+ let s:cterm_color5 = "#ff40ff"
+ let s:cterm_color6 = "#00ffff"
+ let s:cterm_color7 = "#ffffff"
+ else
+ let s:cterm_color0 = "#000000"
+ let s:cterm_color1 = "#c00000"
+ let s:cterm_color2 = "#008000"
+ let s:cterm_color3 = "#804000"
+ let s:cterm_color4 = "#0000c0"
+ let s:cterm_color5 = "#c000c0"
+ let s:cterm_color6 = "#008080"
+ let s:cterm_color7 = "#c0c0c0"
+ let s:cterm_color8 = "#808080"
+ let s:cterm_color9 = "#ff6060"
+ let s:cterm_color10 = "#00ff00"
+ let s:cterm_color11 = "#ffff00"
+ let s:cterm_color12 = "#8080ff"
+ let s:cterm_color13 = "#ff40ff"
+ let s:cterm_color14 = "#00ffff"
+ let s:cterm_color15 = "#ffffff"
+ endif
+endif
+
+" Return good color specification: in GUI no transformation is done, in
+" terminal return RGB values of known colors and empty string on unknown
+if s:whatterm == "gui"
+ function! s:HtmlColor(color)
+ return a:color
+ endfun
+else
+ function! s:HtmlColor(color)
+ if exists("s:cterm_color" . a:color)
+ execute "return s:cterm_color" . a:color
+ else
+ return ""
+ endif
+ endfun
+endif
+
+if !exists("html_use_css")
+ " Return opening HTML tag for given highlight id
+ function! s:HtmlOpening(id)
+ let a = ""
+ if synIDattr(a:id, "inverse")
+ " For inverse, we always must set both colors (and exchange them)
+ let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
+ let a = a . '<span style="background-color: ' . ( x != "" ? x : s:fgc ) . '">'
+ let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
+ let a = a . '<font color="' . ( x != "" ? x : s:bgc ) . '">'
+ else
+ let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
+ if x != "" | let a = a . '<span style="background-color: ' . x . '">' | endif
+ let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
+ if x != "" | let a = a . '<font color="' . x . '">' | endif
+ endif
+ if synIDattr(a:id, "bold") | let a = a . "<b>" | endif
+ if synIDattr(a:id, "italic") | let a = a . "<i>" | endif
+ if synIDattr(a:id, "underline") | let a = a . "<u>" | endif
+ return a
+ endfun
+
+ " Return closing HTML tag for given highlight id
+ function s:HtmlClosing(id)
+ let a = ""
+ if synIDattr(a:id, "underline") | let a = a . "</u>" | endif
+ if synIDattr(a:id, "italic") | let a = a . "</i>" | endif
+ if synIDattr(a:id, "bold") | let a = a . "</b>" | endif
+ if synIDattr(a:id, "inverse")
+ let a = a . '</font></span>'
+ else
+ let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
+ if x != "" | let a = a . '</font>' | endif
+ let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
+ if x != "" | let a = a . '</span>' | endif
+ endif
+ return a
+ endfun
+endif
+
+" Return CSS style describing given highlight id (can be empty)
+function! s:CSS1(id)
+ let a = ""
+ if synIDattr(a:id, "inverse")
+ " For inverse, we always must set both colors (and exchange them)
+ let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
+ let a = a . "color: " . ( x != "" ? x : s:bgc ) . "; "
+ let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
+ let a = a . "background-color: " . ( x != "" ? x : s:fgc ) . "; "
+ else
+ let x = s:HtmlColor(synIDattr(a:id, "fg#", s:whatterm))
+ if x != "" | let a = a . "color: " . x . "; " | endif
+ let x = s:HtmlColor(synIDattr(a:id, "bg#", s:whatterm))
+ if x != "" | let a = a . "background-color: " . x . "; " | endif
+ endif
+ if synIDattr(a:id, "bold") | let a = a . "font-weight: bold; " | endif
+ if synIDattr(a:id, "italic") | let a = a . "font-style: italic; " | endif
+ if synIDattr(a:id, "underline") | let a = a . "text-decoration: underline; " | endif
+ return a
+endfun
+
+" Figure out proper MIME charset from the 'encoding' option.
+if exists("html_use_encoding")
+ let s:html_encoding = html_use_encoding
+else
+ let s:vim_encoding = &encoding
+ if s:vim_encoding =~ '^8bit\|^2byte'
+ let s:vim_encoding = substitute(s:vim_encoding, '^8bit-\|^2byte-', '', '')
+ endif
+ if s:vim_encoding == 'latin1'
+ let s:html_encoding = 'iso-8859-1'
+ elseif s:vim_encoding =~ "^cp12"
+ let s:html_encoding = substitute(s:vim_encoding, 'cp', 'windows-', '')
+ elseif s:vim_encoding == 'sjis'
+ let s:html_encoding = 'Shift_JIS'
+ elseif s:vim_encoding == 'euc-cn'
+ let s:html_encoding = 'GB_2312-80'
+ elseif s:vim_encoding == 'euc-tw'
+ let s:html_encoding = ""
+ elseif s:vim_encoding =~ '^euc\|^iso\|^koi'
+ let s:html_encoding = substitute(s:vim_encoding, '.*', '\U\0', '')
+ elseif s:vim_encoding == 'cp949'
+ let s:html_encoding = 'KS_C_5601-1987'
+ elseif s:vim_encoding == 'cp936'
+ let s:html_encoding = 'GBK'
+ elseif s:vim_encoding =~ '^ucs\|^utf'
+ let s:html_encoding = 'UTF-8'
+ else
+ let s:html_encoding = ""
+ endif
+endif
+
+
+" Set some options to make it work faster.
+" Expand tabs in original buffer to get 'tabstop' correctly used.
+" Don't report changes for :substitute, there will be many of them.
+let s:old_title = &title
+let s:old_icon = &icon
+let s:old_et = &l:et
+let s:old_report = &report
+let s:old_search = @/
+set notitle noicon
+setlocal et
+set report=1000000
+
+" Split window to create a buffer with the HTML file.
+let s:orgbufnr = winbufnr(0)
+if expand("%") == ""
+ new Untitled.html
+else
+ new %.html
+endif
+let s:newwin = winnr()
+let s:orgwin = bufwinnr(s:orgbufnr)
+
+set modifiable
+%d
+let s:old_paste = &paste
+set paste
+let s:old_magic = &magic
+set magic
+
+if exists("use_xhtml")
+ exe "normal! a<?xml version=\"1.0\"?>\n\e"
+ let tag_close = '/>'
+else
+ let tag_close = '>'
+endif
+
+" HTML header, with the title and generator ;-). Left free space for the CSS,
+" to be filled at the end.
+exe "normal! a<html>\n<head>\n<title>\e"
+exe "normal! a" . expand("%:p:~") . "</title>\n\e"
+exe "normal! a<meta name=\"Generator\" content=\"Vim/" . v:version/100 . "." . v:version %100 . '"' . tag_close . "\n\e"
+if s:html_encoding != ""
+ exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . tag_close . "\n\e"
+endif
+if exists("html_use_css")
+ exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
+endif
+if exists("html_no_pre")
+ exe "normal! a</head>\n<body>\n\e"
+else
+ exe "normal! a</head>\n<body>\n<pre>\n\e"
+endif
+
+exe s:orgwin . "wincmd w"
+
+" List of all id's
+let s:idlist = ","
+
+let s:expandedtab = ' '
+while strlen(s:expandedtab) < &ts
+ let s:expandedtab = s:expandedtab . ' '
+endwhile
+
+" Loop over all lines in the original text.
+" Use html_start_line and html_end_line if they are set.
+if exists("html_start_line")
+ let s:lnum = html_start_line
+ if s:lnum < 1 || s:lnum > line("$")
+ let s:lnum = 1
+ endif
+else
+ let s:lnum = 1
+endif
+if exists("html_end_line")
+ let s:end = html_end_line
+ if s:end < s:lnum || s:end > line("$")
+ let s:end = line("$")
+ endif
+else
+ let s:end = line("$")
+endif
+
+while s:lnum <= s:end
+
+ " Get the current line
+ let s:line = getline(s:lnum)
+ let s:len = strlen(s:line)
+ let s:new = ""
+
+ if s:numblines
+ let s:new = '<span class="lnr">' . strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . '</span> '
+ endif
+
+ " Loop over each character in the line
+ let s:col = 1
+ while s:col <= s:len
+ let s:startcol = s:col " The start column for processing text
+ let s:id = synID(s:lnum, s:col, 1)
+ let s:col = s:col + 1
+ " Speed loop (it's small - that's the trick)
+ " Go along till we find a change in synID
+ while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
+
+ " Output the text with the same synID, with class set to {s:id_name}
+ let s:id = synIDtrans(s:id)
+ let s:id_name = synIDattr(s:id, "name", s:whatterm)
+ let s:new = s:new . '<span class="' . s:id_name . '">' . substitute(substitute(substitute(substitute(substitute(strpart(s:line, s:startcol - 1, s:col - s:startcol), '&', '\&amp;', 'g'), '<', '\&lt;', 'g'), '>', '\&gt;', 'g'), '"', '\&quot;', 'g'), "\x0c", '<hr class="PAGE-BREAK">', 'g') . '</span>'
+ " Add the class to class list if it's not there yet
+ if stridx(s:idlist, "," . s:id . ",") == -1
+ let s:idlist = s:idlist . s:id . ","
+ endif
+
+ if s:col > s:len
+ break
+ endif
+ endwhile
+
+ " Expand tabs
+ let s:pad=0
+ let s:start = 0
+ let s:idx = stridx(s:line, "\t")
+ while s:idx >= 0
+ let s:i = &ts - ((s:start + s:pad + s:idx) % &ts)
+ let s:new = substitute(s:new, '\t', strpart(s:expandedtab, 0, s:i), '')
+ let s:pad = s:pad + s:i - 1
+ let s:start = s:start + s:idx + 1
+ let s:idx = stridx(strpart(s:line, s:start), "\t")
+ endwhile
+
+ if exists("html_no_pre")
+ if exists("use_xhtml")
+ let s:new = substitute(s:new, ' ', '\&#x20;\&#x20;', 'g') . '<br/>'
+ else
+ let s:new = substitute(s:new, ' ', '\&nbsp;\&nbsp;', 'g') . '<br>'
+ endif
+ endif
+ exe s:newwin . "wincmd w"
+ exe "normal! a" . strtrans(s:new) . "\n\e"
+ exe s:orgwin . "wincmd w"
+ let s:lnum = s:lnum + 1
+ +
+endwhile
+" Finish with the last line
+exe s:newwin . "wincmd w"
+if exists("html_no_pre")
+ exe "normal! a\n</body>\n</html>\e"
+else
+ exe "normal! a</pre>\n</body>\n</html>\e"
+endif
+
+
+" Now, when we finally know which, we define the colors and styles
+if exists("html_use_css")
+ 1;/<style type="text/+1
+endif
+
+" Find out the background and foreground color.
+let s:fgc = s:HtmlColor(synIDattr(hlID("Normal"), "fg#", s:whatterm))
+let s:bgc = s:HtmlColor(synIDattr(hlID("Normal"), "bg#", s:whatterm))
+if s:fgc == ""
+ let s:fgc = ( &background == "dark" ? "#ffffff" : "#000000" )
+endif
+if s:bgc == ""
+ let s:bgc = ( &background == "dark" ? "#000000" : "#ffffff" )
+endif
+
+" Normal/global attributes
+" For Netscape 4, set <body> attributes too, though, strictly speaking, it's
+" incorrect.
+if exists("html_use_css")
+ if exists("html_no_pre")
+ execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
+ else
+ execute "normal! A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
+ yank
+ put
+ execute "normal! ^cwbody\e"
+ endif
+else
+ if exists("html_no_pre")
+ execute '%s:<body>:<body ' . 'bgcolor="' . s:bgc . '" text="' . s:fgc . '" style="font-family\: Courier, monospace;">'
+ else
+ execute '%s:<body>:<body ' . 'bgcolor="' . s:bgc . '" text="' . s:fgc . '">'
+ endif
+endif
+
+" Line numbering attributes
+if s:numblines
+ if exists("html_use_css")
+ execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
+ else
+ execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
+ endif
+endif
+
+" Gather attributes for all other classes
+let s:idlist = strpart(s:idlist, 1)
+while s:idlist != ""
+ let s:attr = ""
+ let s:col = stridx(s:idlist, ",")
+ let s:id = strpart(s:idlist, 0, s:col)
+ let s:idlist = strpart(s:idlist, s:col + 1)
+ let s:attr = s:CSS1(s:id)
+ let s:id_name = synIDattr(s:id, "name", s:whatterm)
+ " If the class has some attributes, export the style, otherwise DELETE all
+ " its occurences to make the HTML shorter
+ if s:attr != ""
+ if exists("html_use_css")
+ execute "normal! A\n." . s:id_name . " { " . s:attr . "}"
+ else
+ execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
+ endif
+ else
+ execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+\1+g'
+ if exists("html_use_css")
+ 1;/<style type="text/+1
+ endif
+ endif
+endwhile
+
+" Add hyperlinks
+%s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|&gt;\|&lt;\)+<A HREF="\1">\1</A>\2+ge
+
+" The DTD
+if exists("html_use_css")
+ exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
+endif
+
+" Cleanup
+%s:\s\+$::e
+
+" Restore old settings
+let &report = s:old_report
+let &title = s:old_title
+let &icon = s:old_icon
+let &paste = s:old_paste
+let &magic = s:old_magic
+let @/ = s:old_search
+exe s:orgwin . "wincmd w"
+let &l:et = s:old_et
+exe s:newwin . "wincmd w"
+
+" Save a little bit of memory (worth doing?)
+unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
+unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
+unlet! s:col s:id s:attr s:len s:line s:new s:did_retab s:numblines
+unlet s:orgwin s:newwin s:orgbufnr
+delfunc s:HtmlColor
+delfunc s:CSS1
+if !exists("html_use_css")
+ delfunc s:HtmlOpening
+ delfunc s:HtmlClosing
+endif
diff --git a/runtime/syntax/README.txt b/runtime/syntax/README.txt
new file mode 100644
index 000000000..d88bd7ed5
--- /dev/null
+++ b/runtime/syntax/README.txt
@@ -0,0 +1,38 @@
+This directory contains Vim scripts for syntax highlighting.
+
+These scripts are not for a language, but are used by Vim itself:
+
+syntax.vim Used for the ":syntax on" command. Uses synload.vim.
+
+manual.vim Used for the ":syntax manual" command. Uses synload.vim.
+
+synload.vim Contains autocommands to load a language file when a certain
+ file name (extension) is used. And sets up the Syntax menu
+ for the GUI.
+
+nosyntax.vim Used for the ":syntax off" command. Undo the loading of
+ synload.vim.
+
+
+A few special files:
+
+2html.vim Converts any highlighted file to HTML (GUI only).
+colortest.vim Check for color names and actual color on screen.
+hitest.vim View the current highlight settings.
+whitespace.vim View Tabs and Spaces.
+
+
+If you want to write a syntax file, read the docs at ":help usr_44.txt".
+
+If you make a new syntax file which would be useful for others, please send it
+to Bram@vim.org. Include instructions for detecting the file type for this
+language, by file name extension or by checking a few lines in the file.
+And please write the file in a portable way, see ":help 44.12".
+
+If you have remarks about an existing file, send them to the maintainer of
+that file. Only when you get no response send a message to Bram@vim.org.
+
+If you are the maintainer of a syntax file and make improvements, send the new
+version to Bram@vim.org.
+
+For further info see ":help syntax" in Vim.
diff --git a/runtime/syntax/a65.vim b/runtime/syntax/a65.vim
new file mode 100644
index 000000000..dbf1cdb46
--- /dev/null
+++ b/runtime/syntax/a65.vim
@@ -0,0 +1,166 @@
+" Vim syntax file
+" Language: xa 6502 cross assembler
+" Maintainer: Clemens Kirchgatterer <clemens@thf.ath.cx>
+" Last Change: 2003 May 03
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Opcodes
+syn match a65Opcode "\<PHP\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PLA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PLX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PLY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<SEC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CLD\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<SED\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CLI\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BVC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BVS\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BCS\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BCC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<DEY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<DEC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CMP\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CPX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BIT\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<ROL\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<ROR\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<ASL\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TXA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TYA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TSX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TXS\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<LDA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<LDX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<LDY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<STA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PLP\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BRK\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<RTI\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<NOP\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<SEI\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CLV\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PHA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PHX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BRA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<JMP\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<JSR\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<RTS\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CPY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BNE\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BEQ\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BMI\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<LSR\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<INX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<INY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<INC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<ADC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<SBC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<AND\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<ORA\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<STX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<STY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<STZ\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<EOR\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<DEX\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BPL\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<CLC\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<PHY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TRB\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BBR\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<BBS\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<RMB\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<SMB\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TAY\($\|\s\)" nextgroup=a65Address
+syn match a65Opcode "\<TAX\($\|\s\)" nextgroup=a65Address
+
+" Addresses
+syn match a65Address "\s*!\=$[0-9A-F]\{2}\($\|\s\)"
+syn match a65Address "\s*!\=$[0-9A-F]\{4}\($\|\s\)"
+syn match a65Address "\s*!\=$[0-9A-F]\{2},X\($\|\s\)"
+syn match a65Address "\s*!\=$[0-9A-F]\{4},X\($\|\s\)"
+syn match a65Address "\s*!\=$[0-9A-F]\{2},Y\($\|\s\)"
+syn match a65Address "\s*!\=$[0-9A-F]\{4},Y\($\|\s\)"
+syn match a65Address "\s*($[0-9A-F]\{2})\($\|\s\)"
+syn match a65Address "\s*($[0-9A-F]\{4})\($\|\s\)"
+syn match a65Address "\s*($[0-9A-F]\{2},X)\($\|\s\)"
+syn match a65Address "\s*($[0-9A-F]\{2}),Y\($\|\s\)"
+
+" Numbers
+syn match a65Number "#\=[0-9]*\>"
+syn match a65Number "#\=$[0-9A-F]*\>"
+syn match a65Number "#\=&[0-7]*\>"
+syn match a65Number "#\=%[01]*\>"
+
+syn case match
+
+" Types
+syn match a65Type "\(^\|\s\)\.byt\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.word\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.asc\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.dsb\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.fopt\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.text\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.data\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.bss\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.zero\($\|\s\)"
+syn match a65Type "\(^\|\s\)\.align\($\|\s\)"
+
+" Blocks
+syn match a65Section "\(^\|\s\)\.(\($\|\s\)"
+syn match a65Section "\(^\|\s\)\.)\($\|\s\)"
+
+" Strings
+syn match a65String "\".*\""
+
+" Programm Counter
+syn region a65PC start="\*=" end="\>" keepend
+
+" HI/LO Byte
+syn region a65HiLo start="#[<>]" end="$\|\s" contains=a65Comment keepend
+
+" Comments
+syn keyword a65Todo TODO XXX FIXME BUG contained
+syn match a65Comment ";.*"hs=s+1 contains=a65Todo
+syn region a65Comment start="/\*" end="\*/" contains=a65Todo,a65Comment
+
+" Preprocessor
+syn region a65PreProc start="^#" end="$" contains=a65Comment,a65Continue
+syn match a65End excludenl /end$/ contained
+syn match a65Continue "\\$" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_a65_syntax_inits")
+ if version < 508
+ let did_a65_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink a65Section Special
+ HiLink a65Address Special
+ HiLink a65Comment Comment
+ HiLink a65PreProc PreProc
+ HiLink a65Number Number
+ HiLink a65String String
+ HiLink a65Type Statement
+ HiLink a65Opcode Type
+ HiLink a65PC Error
+ HiLink a65Todo Todo
+ HiLink a65HiLo Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "a65"
diff --git a/runtime/syntax/aap.vim b/runtime/syntax/aap.vim
new file mode 100644
index 000000000..8399a4d22
--- /dev/null
+++ b/runtime/syntax/aap.vim
@@ -0,0 +1,158 @@
+" Vim syntax file
+" Language: A-A-P recipe
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Jun 13
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+syn include @aapPythonScript syntax/python.vim
+
+syn match aapVariable /$[-+?*="'\\!]*[a-zA-Z0-9_.]*/
+syn match aapVariable /$[-+?*="'\\!]*([a-zA-Z0-9_.]*)/
+syn keyword aapTodo contained TODO Todo
+syn match aapString +'[^']\{-}'+
+syn match aapString +"[^"]\{-}"+
+
+syn match aapCommand '^\s*:action\>'
+syn match aapCommand '^\s*:add\>'
+syn match aapCommand '^\s*:addall\>'
+syn match aapCommand '^\s*:asroot\>'
+syn match aapCommand '^\s*:assertpkg\>'
+syn match aapCommand '^\s*:attr\>'
+syn match aapCommand '^\s*:attribute\>'
+syn match aapCommand '^\s*:autodepend\>'
+syn match aapCommand '^\s*:buildcheck\>'
+syn match aapCommand '^\s*:cd\>'
+syn match aapCommand '^\s*:chdir\>'
+syn match aapCommand '^\s*:checkin\>'
+syn match aapCommand '^\s*:checkout\>'
+syn match aapCommand '^\s*:child\>'
+syn match aapCommand '^\s*:chmod\>'
+syn match aapCommand '^\s*:commit\>'
+syn match aapCommand '^\s*:commitall\>'
+syn match aapCommand '^\s*:conf\>'
+syn match aapCommand '^\s*:copy\>'
+syn match aapCommand '^\s*:del\>'
+syn match aapCommand '^\s*:deldir\>'
+syn match aapCommand '^\s*:delete\>'
+syn match aapCommand '^\s*:delrule\>'
+syn match aapCommand '^\s*:dll\>'
+syn match aapCommand '^\s*:do\>'
+syn match aapCommand '^\s*:error\>'
+syn match aapCommand '^\s*:execute\>'
+syn match aapCommand '^\s*:exit\>'
+syn match aapCommand '^\s*:export\>'
+syn match aapCommand '^\s*:fetch\>'
+syn match aapCommand '^\s*:fetchall\>'
+syn match aapCommand '^\s*:filetype\>'
+syn match aapCommand '^\s*:finish\>'
+syn match aapCommand '^\s*:global\>'
+syn match aapCommand '^\s*:import\>'
+syn match aapCommand '^\s*:include\>'
+syn match aapCommand '^\s*:installpkg\>'
+syn match aapCommand '^\s*:lib\>'
+syn match aapCommand '^\s*:local\>'
+syn match aapCommand '^\s*:log\>'
+syn match aapCommand '^\s*:ltlib\>'
+syn match aapCommand '^\s*:mkdir\>'
+syn match aapCommand '^\s*:mkdownload\>'
+syn match aapCommand '^\s*:move\>'
+syn match aapCommand '^\s*:pass\>'
+syn match aapCommand '^\s*:popdir\>'
+syn match aapCommand '^\s*:produce\>'
+syn match aapCommand '^\s*:program\>'
+syn match aapCommand '^\s*:progsearch\>'
+syn match aapCommand '^\s*:publish\>'
+syn match aapCommand '^\s*:publishall\>'
+syn match aapCommand '^\s*:pushdir\>'
+syn match aapCommand '^\s*:quit\>'
+syn match aapCommand '^\s*:recipe\>'
+syn match aapCommand '^\s*:refresh\>'
+syn match aapCommand '^\s*:remove\>'
+syn match aapCommand '^\s*:removeall\>'
+syn match aapCommand '^\s*:require\>'
+syn match aapCommand '^\s*:revise\>'
+syn match aapCommand '^\s*:reviseall\>'
+syn match aapCommand '^\s*:route\>'
+syn match aapCommand '^\s*:rule\>'
+syn match aapCommand '^\s*:start\>'
+syn match aapCommand '^\s*:symlink\>'
+syn match aapCommand '^\s*:sys\>'
+syn match aapCommand '^\s*:sysdepend\>'
+syn match aapCommand '^\s*:syspath\>'
+syn match aapCommand '^\s*:system\>'
+syn match aapCommand '^\s*:tag\>'
+syn match aapCommand '^\s*:tagall\>'
+syn match aapCommand '^\s*:toolsearch\>'
+syn match aapCommand '^\s*:totype\>'
+syn match aapCommand '^\s*:touch\>'
+syn match aapCommand '^\s*:tree\>'
+syn match aapCommand '^\s*:unlock\>'
+syn match aapCommand '^\s*:update\>'
+syn match aapCommand '^\s*:usetool\>'
+syn match aapCommand '^\s*:variant\>'
+syn match aapCommand '^\s*:verscont\>'
+
+syn match aapCommand '^\s*:print\>' nextgroup=aapPipeEnd
+syn match aapPipeCmd '\s*:print\>' nextgroup=aapPipeEnd contained
+syn match aapCommand '^\s*:cat\>' nextgroup=aapPipeEnd
+syn match aapPipeCmd '\s*:cat\>' nextgroup=aapPipeEnd contained
+syn match aapCommand '^\s*:syseval\>' nextgroup=aapPipeEnd
+syn match aapPipeCmd '\s*:syseval\>' nextgroup=aapPipeEnd contained
+syn match aapPipeCmd '\s*:assign\>' contained
+syn match aapCommand '^\s*:eval\>' nextgroup=aapPipeEnd
+syn match aapPipeCmd '\s*:eval\>' nextgroup=aapPipeEndPy contained
+syn match aapPipeCmd '\s*:tee\>' nextgroup=aapPipeEnd contained
+syn match aapPipeCmd '\s*:log\>' nextgroup=aapPipeEnd contained
+syn match aapPipeEnd '[^|]*|' nextgroup=aapPipeCmd contained skipnl
+syn match aapPipeEndPy '[^|]*|' nextgroup=aapPipeCmd contained skipnl contains=@aapPythonScript
+syn match aapPipeStart '^\s*|' nextgroup=aapPipeCmd
+
+"
+" A Python line starts with @. Can be continued with a trailing backslash.
+syn region aapPythonRegion start="\s*@" skip='\\$' end=+$+ contains=@aapPythonScript keepend
+"
+" A Python block starts with ":python" and continues so long as the indent is
+" bigger.
+syn region aapPythonRegion matchgroup=aapCommand start="\z(\s*\):python" skip='\n\z1\s\|\n\s*\n' end=+$+ contains=@aapPythonScript
+
+" A Python expression is enclosed in backticks.
+syn region aapPythonRegion start="`" skip="``" end="`" contains=@aapPythonScript
+
+" TODO: There is something wrong with line continuation.
+syn match aapComment '#.*' contains=aapTodo
+syn match aapComment '#.*\(\\\n.*\)' contains=aapTodo
+
+syn match aapSpecial '$#'
+syn match aapSpecial '$\$'
+syn match aapSpecial '$(.)'
+
+" A heredoc assignment.
+syn region aapHeredoc start="^\s*\k\+\s*$\=+\=?\=<<\s*\z(\S*\)"hs=e+1 end="^\s*\z1\s*$"he=s-1
+
+" Syncing is needed for ":python" and "VAR << EOF". Don't use Python syncing
+syn sync clear
+syn sync fromstart
+
+" The default highlighting.
+hi def link aapTodo Todo
+hi def link aapString String
+hi def link aapComment Comment
+hi def link aapSpecial Special
+hi def link aapVariable Identifier
+hi def link aapPipeCmd aapCommand
+hi def link aapCommand Statement
+hi def link aapHeredoc Constant
+
+let b:current_syntax = "aap"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/abaqus.vim b/runtime/syntax/abaqus.vim
new file mode 100644
index 000000000..cf4b0828f
--- /dev/null
+++ b/runtime/syntax/abaqus.vim
@@ -0,0 +1,48 @@
+" Vim syntax file
+" Language: Abaqus finite element input file (www.hks.com)
+" Maintainer: Carl Osterwisch <osterwischc@asme.org>
+" Last Change: 2002 Feb 24
+" Remark: Huge improvement in folding performance--see filetype plugin
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Abaqus comment lines
+syn match abaqusComment "^\*\*.*$"
+
+" Abaqus keyword lines
+syn match abaqusKeywordLine "^\*\h.*" contains=abaqusKeyword,abaqusParameter,abaqusValue display
+syn match abaqusKeyword "^\*\h[^,]*" contained display
+syn match abaqusParameter ",[^,=]\+"lc=1 contained display
+syn match abaqusValue "=\s*[^,]*"lc=1 contained display
+
+" Illegal syntax
+syn match abaqusBadLine "^\s\+\*.*" display
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_abaqus_syn_inits")
+ if version < 508
+ let did_abaqus_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink abaqusComment Comment
+ HiLink abaqusKeyword Statement
+ HiLink abaqusParameter Identifier
+ HiLink abaqusValue Constant
+ HiLink abaqusBadLine Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "abaqus"
diff --git a/runtime/syntax/abc.vim b/runtime/syntax/abc.vim
new file mode 100644
index 000000000..3dc098e73
--- /dev/null
+++ b/runtime/syntax/abc.vim
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language: abc music notation language
+" Maintainer: James Allwright <J.R.Allwright@westminster.ac.uk>
+" URL: http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
+" Last Change: 27th April 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" tags
+syn region abcGuitarChord start=+"[A-G]+ end=+"+ contained
+syn match abcNote "z[1-9]*[0-9]*" contained
+syn match abcNote "z[1-9]*[0-9]*/[248]\=" contained
+syn match abcNote "[=_\^]\{,2}[A-G],*[1-9]*[0-9]*" contained
+syn match abcNote "[=_\^]\{,2}[A-G],*[1-9]*[0-9]*/[248]\=" contained
+syn match abcNote "[=_\^]\{,2}[a-g]'*[1-9]*[0-9]*" contained
+syn match abcNote "[=_\^]\{,2}[a-g]'*[1-9]*[0-9]*/[248]\=" contained
+syn match abcBar "|" contained
+syn match abcBar "[:|][:|]" contained
+syn match abcBar ":|2" contained
+syn match abcBar "|1" contained
+syn match abcBar "\[[12]" contained
+syn match abcTuple "([1-9]\+:\=[0-9]*:\=[0-9]*" contained
+syn match abcBroken "<\|<<\|<<<\|>\|>>\|>>>" contained
+syn match abcTie "-"
+syn match abcHeadField "^[A-EGHIK-TVWXZ]:.*$" contained
+syn match abcBodyField "^[KLMPQWVw]:.*$" contained
+syn region abcHeader start="^X:" end="^K:.*$" contained contains=abcHeadField,abcComment keepend
+syn region abcTune start="^X:" end="^ *$" contains=abcHeader,abcComment,abcBar,abcNote,abcBodyField,abcGuitarChord,abcTuple,abcBroken,abcTie
+syn match abcComment "%.*$"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_abc_syn_inits")
+ if version < 508
+ let did_abc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink abcComment Comment
+ HiLink abcHeadField Type
+ HiLink abcBodyField Special
+ HiLink abcBar Statement
+ HiLink abcTuple Statement
+ HiLink abcBroken Statement
+ HiLink abcTie Statement
+ HiLink abcGuitarChord Identifier
+ HiLink abcNote Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "abc"
+
+" vim: ts=4
diff --git a/runtime/syntax/abel.vim b/runtime/syntax/abel.vim
new file mode 100644
index 000000000..fde9be3dd
--- /dev/null
+++ b/runtime/syntax/abel.vim
@@ -0,0 +1,167 @@
+" Vim syntax file
+" Language: ABEL
+" Maintainer: John Cook <john.cook@kla-tencor.com>
+" Last Change: 2001 Sep 2
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" this language is oblivious to case
+syn case ignore
+
+" A bunch of keywords
+syn keyword abelHeader module title device options
+syn keyword abelSection declarations equations test_vectors end
+syn keyword abelDeclaration state truth_table state_diagram property
+syn keyword abelType pin node attribute constant macro library
+
+syn keyword abelTypeId com reg neg pos buffer dc reg_d reg_t contained
+syn keyword abelTypeId reg_sr reg_jk reg_g retain xor invert contained
+
+syn keyword abelStatement when then else if with endwith case endcase
+syn keyword abelStatement fuses expr trace
+
+" option to omit obsolete statements
+if exists("abel_obsolete_ok")
+ syn keyword abelStatement enable flag in
+else
+ syn keyword abelError enable flag in
+endif
+
+" directives
+syn match abelDirective "@alternate"
+syn match abelDirective "@standard"
+syn match abelDirective "@const"
+syn match abelDirective "@dcset"
+syn match abelDirective "@include"
+syn match abelDirective "@page"
+syn match abelDirective "@radix"
+syn match abelDirective "@repeat"
+syn match abelDirective "@irp"
+syn match abelDirective "@expr"
+syn match abelDirective "@if"
+syn match abelDirective "@ifb"
+syn match abelDirective "@ifnb"
+syn match abelDirective "@ifdef"
+syn match abelDirective "@ifndef"
+syn match abelDirective "@ifiden"
+syn match abelDirective "@ifniden"
+
+syn keyword abelTodo contained TODO XXX FIXME
+
+" wrap up type identifiers to differentiate them from normal strings
+syn region abelSpecifier start='istype' end=';' contains=abelTypeIdChar,abelTypeId,abelTypeIdEnd keepend
+syn match abelTypeIdChar "[,']" contained
+syn match abelTypeIdEnd ";" contained
+
+" string contstants and special characters within them
+syn match abelSpecial contained "\\['\\]"
+syn region abelString start=+'+ skip=+\\"+ end=+'+ contains=abelSpecial
+
+" valid integer number formats (decimal, binary, octal, hex)
+syn match abelNumber "\<[-+]\=[0-9]\+\>"
+syn match abelNumber "\^d[0-9]\+\>"
+syn match abelNumber "\^b[01]\+\>"
+syn match abelNumber "\^o[0-7]\+\>"
+syn match abelNumber "\^h[0-9a-f]\+\>"
+
+" special characters
+" (define these after abelOperator so ?= overrides ?)
+syn match abelSpecialChar "[\[\](){},;:?]"
+
+" operators
+syn match abelLogicalOperator "[!#&$]"
+syn match abelRangeOperator "\.\."
+syn match abelAlternateOperator "[/*+]"
+syn match abelAlternateOperator ":[+*]:"
+syn match abelArithmeticOperator "[-%]"
+syn match abelArithmeticOperator "<<"
+syn match abelArithmeticOperator ">>"
+syn match abelRelationalOperator "[<>!=]="
+syn match abelRelationalOperator "[<>]"
+syn match abelAssignmentOperator "[:?]\=="
+syn match abelAssignmentOperator "?:="
+syn match abelTruthTableOperator "->"
+
+" signal extensions
+syn match abelExtension "\.aclr\>"
+syn match abelExtension "\.aset\>"
+syn match abelExtension "\.clk\>"
+syn match abelExtension "\.clr\>"
+syn match abelExtension "\.com\>"
+syn match abelExtension "\.fb\>"
+syn match abelExtension "\.[co]e\>"
+syn match abelExtension "\.l[eh]\>"
+syn match abelExtension "\.fc\>"
+syn match abelExtension "\.pin\>"
+syn match abelExtension "\.set\>"
+syn match abelExtension "\.[djksrtq]\>"
+syn match abelExtension "\.pr\>"
+syn match abelExtension "\.re\>"
+syn match abelExtension "\.a[pr]\>"
+syn match abelExtension "\.s[pr]\>"
+
+" special constants
+syn match abelConstant "\.[ckudfpxz]\."
+syn match abelConstant "\.sv[2-9]\."
+
+" one-line comments
+syn region abelComment start=+"+ end=+"\|$+ contains=abelNumber,abelTodo
+" option to prevent C++ style comments
+if !exists("abel_cpp_comments_illegal")
+ syn region abelComment start=+//+ end=+$+ contains=abelNumber,abelTodo
+endif
+
+syn sync minlines=1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_abel_syn_inits")
+ if version < 508
+ let did_abel_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink abelHeader abelStatement
+ HiLink abelSection abelStatement
+ HiLink abelDeclaration abelStatement
+ HiLink abelLogicalOperator abelOperator
+ HiLink abelRangeOperator abelOperator
+ HiLink abelAlternateOperator abelOperator
+ HiLink abelArithmeticOperator abelOperator
+ HiLink abelRelationalOperator abelOperator
+ HiLink abelAssignmentOperator abelOperator
+ HiLink abelTruthTableOperator abelOperator
+ HiLink abelSpecifier abelStatement
+ HiLink abelOperator abelStatement
+ HiLink abelStatement Statement
+ HiLink abelIdentifier Identifier
+ HiLink abelTypeId abelType
+ HiLink abelTypeIdChar abelType
+ HiLink abelType Type
+ HiLink abelNumber abelString
+ HiLink abelString String
+ HiLink abelConstant Constant
+ HiLink abelComment Comment
+ HiLink abelExtension abelSpecial
+ HiLink abelSpecialChar abelSpecial
+ HiLink abelTypeIdEnd abelSpecial
+ HiLink abelSpecial Special
+ HiLink abelDirective PreProc
+ HiLink abelTodo Todo
+ HiLink abelError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "abel"
+" vim:ts=8
diff --git a/runtime/syntax/acedb.vim b/runtime/syntax/acedb.vim
new file mode 100644
index 000000000..114e4aba9
--- /dev/null
+++ b/runtime/syntax/acedb.vim
@@ -0,0 +1,123 @@
+" Vim syntax file
+" Language: AceDB model files
+" Maintainer: Stewart Morris (Stewart.Morris@ed.ac.uk)
+" Last change: Thu Apr 26 10:38:01 BST 2001
+" URL: http://www.ed.ac.uk/~swmorris/vim/acedb.vim
+
+" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
+" AceDB software is available from http://www.acedb.org
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword acedbXref XREF
+syn keyword acedbModifier UNIQUE REPEAT
+
+syn case ignore
+syn keyword acedbModifier Constraints
+syn keyword acedbType DateType Int Text Float
+
+" Magic tags from: http://genome.cornell.edu/acedocs/magic/summary.html
+syn keyword acedbMagic pick_me_to_call No_cache Non_graphic Title
+syn keyword acedbMagic Flipped Centre Extent View Default_view
+syn keyword acedbMagic From_map Minimal_view Main_Marker Map Includes
+syn keyword acedbMagic Mapping_data More_data Position Ends Left Right
+syn keyword acedbMagic Multi_Position Multi_Ends With Error Relative
+syn keyword acedbMagic Min Anchor Gmap Grid_map Grid Submenus Cambridge
+syn keyword acedbMagic No_buttons Columns Colour Surround_colour Tag
+syn keyword acedbMagic Scale_unit Cursor Cursor_on Cursor_unit
+syn keyword acedbMagic Locator Magnification Projection_lines_on
+syn keyword acedbMagic Marker_points Marker_intervals Contigs
+syn keyword acedbMagic Physical_genes Two_point Multi_point Likelihood
+syn keyword acedbMagic Point_query Point_yellow Point_width
+syn keyword acedbMagic Point_pne Point_pe Point_nne Point_ne
+syn keyword acedbMagic Derived_tags DT_query DT_width DT_no_duplicates
+syn keyword acedbMagic RH_data RH_query RH_spacing RH_show_all
+syn keyword acedbMagic Names_on Width Symbol Colours Pne Pe Nne pMap
+syn keyword acedbMagic Sequence Gridded FingerPrint In_Situ Cosmid_grid
+syn keyword acedbMagic Layout Lines_at Space_at No_stagger A1_labelling
+syn keyword acedbMagic DNA Structure From Source Source_Exons
+syn keyword acedbMagic Coding CDS Transcript Assembly_tags Allele
+syn keyword acedbMagic Display Colour Frame_sensitive Strand_sensitive
+syn keyword acedbMagic Score_bounds Percent Bumpable Width Symbol
+syn keyword acedbMagic Blixem_N Address E_mail Paper Reference Title
+syn keyword acedbMagic Point_1 Point_2 Calculation Full One_recombinant
+syn keyword acedbMagic Tested Selected_trans Backcross Back_one
+syn keyword acedbMagic Dom_semi Dom_let Direct Complex_mixed Calc
+syn keyword acedbMagic Calc_upper_conf Item_1 Item_2 Results A_non_B
+syn keyword acedbMagic Score Score_by_offset Score_by_width
+syn keyword acedbMagic Right_priority Blastn Blixem Blixem_X
+syn keyword acedbMagic Journal Year Volume Page Author
+syn keyword acedbMagic Selected One_all Recs_all One_let
+syn keyword acedbMagic Sex_full Sex_one Sex_cis Dom_one Dom_selected
+syn keyword acedbMagic Calc_distance Calc_lower_conf Canon_for_cosmid
+syn keyword acedbMagic Reversed_physical Points Positive Negative
+syn keyword acedbMagic Point_error_scale Point_segregate_ordered
+syn keyword acedbMagic Point_symbol Interval_JTM Interval_RD
+syn keyword acedbMagic EMBL_feature Homol Feature
+syn keyword acedbMagic DT_tag Spacer Spacer_colour Spacer_width
+syn keyword acedbMagic RH_positive RH_negative RH_contradictory Query
+syn keyword acedbMagic Clone Y_remark PCR_remark Hybridizes_to
+syn keyword acedbMagic Row Virtual_row Mixed In_pool Subpool B_non_A
+syn keyword acedbMagic Interval_SRK Point_show_marginal Subsequence
+syn keyword acedbMagic Visible Properties Transposon
+
+syn match acedbClass "^?\w\+\|^#\w\+"
+syn match acedbComment "//.*"
+syn region acedbComment start="/\*" end="\*/"
+syn match acedbComment "^#\W.*"
+syn match acedbHelp "^\*\*\w\+$"
+syn match acedbTag "[^^]?\w\+\|[^^]#\w\+"
+syn match acedbBlock "//#.\+#$"
+syn match acedbOption "^_[DVH]\S\+"
+syn match acedbFlag "\s\+-\h\+"
+syn match acedbSubclass "^Class"
+syn match acedbSubtag "^Visible\|^Is_a_subclass_of\|^Filter\|^Hidden"
+syn match acedbNumber "\<\d\+\>"
+syn match acedbNumber "\<\d\+\.\d\+\>"
+syn match acedbHyb "\<Positive_\w\+\>\|\<Negative\w\+\>"
+syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline
+
+" Rest of syntax highlighting rules start here
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_acedb_syn_inits")
+ if version < 508
+ let did_acedb_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink acedbMagic Special
+ HiLink acedbHyb Special
+ HiLink acedbType Type
+ HiLink acedbOption Type
+ HiLink acedbSubclass Type
+ HiLink acedbSubtag Include
+ HiLink acedbFlag Include
+ HiLink acedbTag Include
+ HiLink acedbClass Todo
+ HiLink acedbHelp Todo
+ HiLink acedbXref Identifier
+ HiLink acedbModifier Label
+ HiLink acedbComment Comment
+ HiLink acedbBlock ModeMsg
+ HiLink acedbNumber Number
+ HiLink acedbString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "acedb"
+
+" The structure of the model.wrm file is sensitive to mixed tab and space
+" indentation and assumes tabs are 8 so...
+se ts=8
diff --git a/runtime/syntax/ada.vim b/runtime/syntax/ada.vim
new file mode 100644
index 000000000..7a7b2a077
--- /dev/null
+++ b/runtime/syntax/ada.vim
@@ -0,0 +1,287 @@
+" Vim syntax file
+" Language: Ada (95)
+" Maintainer: David A. Wheeler <dwheeler@dwheeler.com>
+" URL: http://www.dwheeler.com/vim
+" Last Change: 2001-11-02
+
+" Former Maintainer: Simon Bradley <simon.bradley@pitechnology.com>
+" (was <sib93@aber.ac.uk>)
+" Other contributors: Preben Randhol.
+" The formal spec of Ada95 (ARM) is the "Ada95 Reference Manual".
+" For more Ada95 info, see http://www.gnuada.org and http://www.adapower.com.
+
+" This vim syntax file works on vim 5.6, 5.7, 5.8 and 6.x.
+" It implements Bram Moolenaar's April 25, 2001 recommendations to make
+" the syntax file maximally portable across different versions of vim.
+" If vim 6.0+ is available,
+" this syntax file takes advantage of the vim 6.0 advanced pattern-matching
+" functions to avoid highlighting uninteresting leading spaces in
+" some expressions containing "with" and "use".
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Ada is entirely case-insensitive.
+syn case ignore
+
+" We don't need to look backwards to highlight correctly;
+" this speeds things up greatly.
+syn sync minlines=1 maxlines=1
+
+" Highlighting commands. There are 69 reserved words in total in Ada95.
+" Some keywords are used in more than one way. For example:
+" 1. "end" is a general keyword, but "end if" ends a Conditional.
+" 2. "then" is a conditional, but "and then" is an operator.
+
+
+" Standard Exceptions (including I/O).
+" We'll highlight the standard exceptions, similar to vim's Python mode.
+" It's possible to redefine the standard exceptions as something else,
+" but doing so is very bad practice, so simply highlighting them makes sense.
+syn keyword adaException Constraint_Error Program_Error Storage_Error
+syn keyword adaException Tasking_Error
+syn keyword adaException Status_Error Mode_Error Name_Error Use_Error
+syn keyword adaException Device_Error End_Error Data_Error Layout_Error
+syn keyword adaException Length_Error Pattern_Error Index_Error
+syn keyword adaException Translation_Error
+syn keyword adaException Time_Error Argument_Error
+syn keyword adaException Tag_Error
+syn keyword adaException Picture_Error
+" Interfaces
+syn keyword adaException Terminator_Error Conversion_Error
+syn keyword adaException Pointer_Error Dereference_Error Update_Error
+" This isn't in the Ada spec, but a GNAT extension.
+syn keyword adaException Assert_Failure
+" We don't list ALL exceptions defined in particular compilers (e.g., GNAT),
+" because it's quite reasonable to define those phrases as non-exceptions.
+
+
+" We don't normally highlight types in package Standard
+" (Integer, Character, Float, etc.). I don't think it looks good
+" with the other type keywords, and many Ada programs define
+" so many of their own types that it looks inconsistent.
+" However, if you want this highlighting, turn on "ada_standard_types".
+" For package Standard's definition, see ARM section A.1.
+
+if exists("ada_standard_types")
+ syn keyword adaBuiltinType Boolean Integer Natural Positive Float
+ syn keyword adaBuiltinType Character Wide_Character
+ syn keyword adaBuiltinType String Wide_String
+ syn keyword adaBuiltinType Duration
+ " These aren't listed in ARM section A.1's code, but they're noted as
+ " options in ARM sections 3.5.4 and 3.5.7:
+ syn keyword adaBuiltinType Short_Integer Short_Short_Integer
+ syn keyword adaBuiltinType Long_Integer Long_Long_Integer
+ syn keyword adaBuiltinType Short_Float Short_Short_Float
+ syn keyword adaBuiltinType Long_Float Long_Long_Float
+endif
+
+" There are MANY other predefined types; they've not been added, because
+" determining when they're a type requires context in general.
+" One potential addition would be Unbounded_String.
+
+
+syn keyword adaLabel others
+
+syn keyword adaOperator abs mod not rem xor
+syn match adaOperator "\<and\>"
+syn match adaOperator "\<and\s\+then\>"
+syn match adaOperator "\<or\>"
+syn match adaOperator "\<or\s\+else\>"
+syn match adaOperator "[-+*/<>&]"
+syn keyword adaOperator **
+syn match adaOperator "[/<>]="
+syn keyword adaOperator =>
+syn match adaOperator "\.\."
+syn match adaOperator "="
+
+" We won't map "adaAssignment" by default, but we need to map ":=" to
+" something or the "=" inside it will be mislabelled as an operator.
+" Note that in Ada, assignment (:=) is not considered an operator.
+syn match adaAssignment ":="
+
+" Handle the box, <>, specially:
+syn keyword adaSpecial <>
+
+" Numbers, including floating point, exponents, and alternate bases.
+syn match adaNumber "\<\d[0-9_]*\(\.\d[0-9_]*\)\=\([Ee][+-]\=\d[0-9_]*\)\=\>"
+syn match adaNumber "\<\d\d\=#\x[0-9A-Fa-f_]*\(\.\x[0-9A-Fa-f_]*\)\=#\([Ee][+-]\=\d[0-9_]*\)\="
+
+" Identify leading numeric signs. In "A-5" the "-" is an operator,
+" but in "A:=-5" the "-" is a sign. This handles "A3+-5" (etc.) correctly.
+" This assumes that if you put a don't put a space after +/- when it's used
+" as an operator, you won't put a space before it either -- which is true
+" in code I've seen.
+syn match adaSign "[[:space:]<>=(,|:;&*/+-][+-]\d"lc=1,hs=s+1,he=e-1,me=e-1
+
+" Labels for the goto statement.
+syn region adaLabel start="<<" end=">>"
+
+" Boolean Constants.
+syn keyword adaBoolean true false
+
+" Warn people who try to use C/C++ notation erroneously:
+syn match adaError "//"
+syn match adaError "/\*"
+syn match adaError "=="
+
+
+if exists("ada_space_errors")
+ if !exists("ada_no_trail_space_error")
+ syn match adaSpaceError excludenl "\s\+$"
+ endif
+ if !exists("ada_no_tab_space_error")
+ syn match adaSpaceError " \+\t"me=e-1
+ endif
+endif
+
+" Unless special ("end loop", "end if", etc.), "end" marks the end of a
+" begin, package, task etc. Assiging it to adaEnd.
+syn match adaEnd "\<end\>"
+
+syn keyword adaPreproc pragma
+
+syn keyword adaRepeat exit for loop reverse while
+syn match adaRepeat "\<end\s\+loop\>"
+
+syn keyword adaStatement accept delay goto raise requeue return
+syn keyword adaStatement terminate
+syn match adaStatement "\<abort\>"
+
+" Handle Ada's record keywords.
+" 'record' usually starts a structure, but "with null record;" does not,
+" and 'end record;' ends a structure. The ordering here is critical -
+" 'record;' matches a "with null record", so make it a keyword (this can
+" match when the 'with' or 'null' is on a previous line).
+" We see the "end" in "end record" before the word record, so we match that
+" pattern as adaStructure (and it won't match the "record;" pattern).
+syn match adaStructure "\<record\>"
+syn match adaStructure "\<end\s\+record\>"
+syn match adaKeyword "\<record;"me=e-1
+
+syn keyword adaStorageClass abstract access aliased array at constant delta
+syn keyword adaStorageClass digits limited of private range tagged
+syn keyword adaTypedef subtype type
+
+" Conditionals. "abort" after "then" is a conditional of its own.
+syn match adaConditional "\<then\>"
+syn match adaConditional "\<then\s\+abort\>"
+syn match adaConditional "\<else\>"
+syn match adaConditional "\<end\s\+if\>"
+syn match adaConditional "\<end\s\+case\>"
+syn match adaConditional "\<end\s\+select\>"
+syn keyword adaConditional if case select
+syn keyword adaConditional elsif when
+
+syn keyword adaKeyword all do exception in is new null out
+syn keyword adaKeyword separate until
+
+" These keywords begin various constructs, and you _might_ want to
+" highlight them differently.
+syn keyword adaBegin begin body declare entry function generic
+syn keyword adaBegin package procedure protected renames task
+
+
+if exists("ada_withuse_ordinary")
+" Don't be fancy. Display "with" and "use" as ordinary keywords in all cases.
+ syn keyword adaKeyword with use
+else
+ " Highlight "with" and "use" clauses like C's "#include" when they're used
+ " to reference other compilation units; otherwise they're ordinary keywords.
+ " If we have vim 6.0 or later, we'll use its advanced pattern-matching
+ " capabilities so that we won't match leading spaces.
+ syn match adaKeyword "\<with\>"
+ syn match adaKeyword "\<use\>"
+ if version < 600
+ syn match adaBeginWith "^\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
+ syn match adaSemiWith ";\s*\(\(with\(\s\+type\)\=\)\|\(use\)\)\>"lc=1 contains=adaInc
+ else
+ syn match adaBeginWith "^\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
+ syn match adaSemiWith ";\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
+ endif
+ syn match adaInc "\<with\>" contained contains=NONE
+ syn match adaInc "\<with\s\+type\>" contained contains=NONE
+ syn match adaInc "\<use\>" contained contains=NONE
+ " Recognize "with null record" as a keyword (even the "record").
+ syn match adaKeyword "\<with\s\+null\s\+record\>"
+ " Consider generic formal parameters of subprograms and packages as keywords.
+ if version < 600
+ syn match adaKeyword ";\s*with\s\+\(function\|procedure\|package\)\>"
+ syn match adaKeyword "^\s*with\s\+\(function\|procedure\|package\)\>"
+ else
+ syn match adaKeyword ";\s*\zswith\s\+\(function\|procedure\|package\)\>"
+ syn match adaKeyword "^\s*\zswith\s\+\(function\|procedure\|package\)\>"
+ endif
+endif
+
+
+" String and character constants.
+syn region adaString start=+"+ skip=+""+ end=+"+
+syn match adaCharacter "'.'"
+
+" Todo (only highlighted in comments)
+syn keyword adaTodo contained TODO FIXME XXX
+
+" Comments.
+syn region adaComment oneline contains=adaTodo start="--" end="$"
+
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ada_syn_inits")
+ if version < 508
+ let did_ada_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later.
+ HiLink adaCharacter Character
+ HiLink adaComment Comment
+ HiLink adaConditional Conditional
+ HiLink adaKeyword Keyword
+ HiLink adaLabel Label
+ HiLink adaNumber Number
+ HiLink adaSign Number
+ HiLink adaOperator Operator
+ HiLink adaPreproc PreProc
+ HiLink adaRepeat Repeat
+ HiLink adaSpecial Special
+ HiLink adaStatement Statement
+ HiLink adaString String
+ HiLink adaStructure Structure
+ HiLink adaTodo Todo
+ HiLink adaType Type
+ HiLink adaTypedef Typedef
+ HiLink adaStorageClass StorageClass
+ HiLink adaBoolean Boolean
+ HiLink adaException Exception
+ HiLink adaInc Include
+ HiLink adaError Error
+ HiLink adaSpaceError Error
+ HiLink adaBuiltinType Type
+
+ if exists("ada_begin_preproc")
+ " This is the old default display:
+ HiLink adaBegin PreProc
+ HiLink adaEnd PreProc
+ else
+ " This is the new default display:
+ HiLink adaBegin Keyword
+ HiLink adaEnd Keyword
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ada"
+
+" vim: ts=8
diff --git a/runtime/syntax/aflex.vim b/runtime/syntax/aflex.vim
new file mode 100644
index 000000000..592c98e4f
--- /dev/null
+++ b/runtime/syntax/aflex.vim
@@ -0,0 +1,100 @@
+
+" Vim syntax file
+" Language: AfLex (from Lex syntax file)
+" Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
+" LastChange: 02 May 2001
+" Original: Lex, maintained by Dr. Charles E. Campbell, Jr.
+" Comment: Replaced sourcing c.vim file by ada.vim and rename lex*
+" in aflex*
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the Ada syntax to start with
+if version < 600
+ so <sfile>:p:h/ada.vim
+else
+ runtime! syntax/ada.vim
+ unlet b:current_syntax
+endif
+
+
+" --- AfLex stuff ---
+
+"I'd prefer to use aflex.* , but it doesn't handle forward definitions yet
+syn cluster aflexListGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatString,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,aflexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
+syn cluster aflexListPatCodeGroup contains=aflexAbbrvBlock,aflexAbbrv,aflexAbbrv,aflexAbbrvRegExp,aflexInclude,aflexPatBlock,aflexPat,aflexBrace,aflexPatTag,aflexPatTag,aflexPatComment,aflexPatCodeLine,aflexMorePat,aflexPatSep,aflexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2
+
+" Abbreviations Section
+syn region aflexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=aflexPatBlock contains=aflexAbbrv,aflexInclude,aflexAbbrvComment
+syn match aflexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=aflexAbbrvRegExp
+syn match aflexAbbrv "^%[sx]" contained
+syn match aflexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=aflexAbbrv,aflexInclude
+syn region aflexInclude matchgroup=aflexSep start="^%{" end="%}" contained contains=ALLBUT,@aflexListGroup
+syn region aflexAbbrvComment start="^\s\+/\*" end="\*/"
+
+"%% : Patterns {Actions}
+syn region aflexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=aflexPat,aflexPatTag,aflexPatComment
+syn region aflexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=aflexMorePat,aflexPatSep contains=aflexPatString,aflexSlashQuote,aflexBrace
+syn region aflexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
+syn region aflexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
+syn match aflexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
+syn match aflexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=aflexPat,aflexPatTag,aflexMorePat,aflexPatSep
+syn region aflexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=aflexPatComment,aflexPat,aflexPatString,aflexPatTag
+syn match aflexPatCodeLine ".*$" contained contains=ALLBUT,@aflexListGroup
+syn match aflexMorePat "\s*|\s*$" skipnl contained nextgroup=aflexPat,aflexPatTag,aflexPatComment
+syn match aflexPatSep "\s\+" contained nextgroup=aflexMorePat,aflexPatCode,aflexPatCodeLine
+syn match aflexSlashQuote +\(\\\\\)*\\"+ contained
+syn region aflexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@aflexListPatCodeGroup
+
+syn keyword aflexCFunctions BEGIN input unput woutput yyleng yylook yytext
+syn keyword aflexCFunctions ECHO output winput wunput yyless yymore yywrap
+
+" <c.vim> includes several ALLBUTs; these have to be treated so as to exclude aflex* groups
+syn cluster cParenGroup add=aflex.*
+syn cluster cDefineGroup add=aflex.*
+syn cluster cPreProcGroup add=aflex.*
+syn cluster cMultiGroup add=aflex.*
+
+" Synchronization
+syn sync clear
+syn sync minlines=300
+syn sync match aflexSyncPat grouphere aflexPatBlock "^%[a-zA-Z]"
+syn sync match aflexSyncPat groupthere aflexPatBlock "^<$"
+syn sync match aflexSyncPat groupthere aflexPatBlock "^%%$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+
+if version >= 508 || !exists("did_aflex_syntax_inits")
+ if version < 508
+ let did_aflex_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink aflexSlashQuote aflexPat
+ HiLink aflexBrace aflexPat
+ HiLink aflexAbbrvComment aflexPatComment
+
+ HiLink aflexAbbrv SpecialChar
+ HiLink aflexAbbrvRegExp Macro
+ HiLink aflexCFunctions Function
+ HiLink aflexMorePat SpecialChar
+ HiLink aflexPat Function
+ HiLink aflexPatComment Comment
+ HiLink aflexPatString Function
+ HiLink aflexPatTag Special
+ HiLink aflexSep Delimiter
+ delcommand HiLink
+endif
+
+let b:current_syntax = "aflex"
+
+" vim:ts=10
diff --git a/runtime/syntax/ahdl.vim b/runtime/syntax/ahdl.vim
new file mode 100644
index 000000000..b1417c374
--- /dev/null
+++ b/runtime/syntax/ahdl.vim
@@ -0,0 +1,94 @@
+" Vim syn file
+" Language: Altera AHDL
+" Maintainer: John Cook <john.cook@kla-tencor.com>
+" Last Change: 2001 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+"this language is oblivious to case.
+syn case ignore
+
+" a bunch of keywords
+syn keyword ahdlKeyword assert begin bidir bits buried case clique
+syn keyword ahdlKeyword connected_pins constant defaults define design
+syn keyword ahdlKeyword device else elsif end for function generate
+syn keyword ahdlKeyword gnd help_id if in include input is machine
+syn keyword ahdlKeyword node of options others output parameters
+syn keyword ahdlKeyword returns states subdesign table then title to
+syn keyword ahdlKeyword tri_state_node variable vcc when with
+
+" a bunch of types
+syn keyword ahdlIdentifier carry cascade dffe dff exp global
+syn keyword ahdlIdentifier jkffe jkff latch lcell mcell memory opendrn
+syn keyword ahdlIdentifier soft srffe srff tffe tff tri wire x
+
+syn keyword ahdlMegafunction lpm_and lpm_bustri lpm_clshift lpm_constant
+syn keyword ahdlMegafunction lpm_decode lpm_inv lpm_mux lpm_or lpm_xor
+syn keyword ahdlMegafunction busmux mux
+
+syn keyword ahdlMegafunction divide lpm_abs lpm_add_sub lpm_compare
+syn keyword ahdlMegafunction lpm_counter lpm_mult
+
+syn keyword ahdlMegafunction altdpram csfifo dcfifo scfifo csdpram lpm_ff
+syn keyword ahdlMegafunction lpm_latch lpm_shiftreg lpm_ram_dq lpm_ram_io
+syn keyword ahdlMegafunction lpm_rom lpm_dff lpm_tff clklock pll ntsc
+
+syn keyword ahdlTodo contained TODO
+
+" String contstants
+syn region ahdlString start=+"+ skip=+\\"+ end=+"+
+
+" valid integer number formats (decimal, binary, octal, hex)
+syn match ahdlNumber '\<\d\+\>'
+syn match ahdlNumber '\<b"\(0\|1\|x\)\+"'
+syn match ahdlNumber '\<\(o\|q\)"\o\+"'
+syn match ahdlNumber '\<\(h\|x\)"\x\+"'
+
+" operators
+syn match ahdlOperator "[!&#$+\-<>=?:\^]"
+syn keyword ahdlOperator not and nand or nor xor xnor
+syn keyword ahdlOperator mod div log2 used ceil floor
+
+" one line and multi-line comments
+" (define these after ahdlOperator so -- overrides -)
+syn match ahdlComment "--.*" contains=ahdlNumber,ahdlTodo
+syn region ahdlComment start="%" end="%" contains=ahdlNumber,ahdlTodo
+
+" other special characters
+syn match ahdlSpecialChar "[\[\]().,;]"
+
+syn sync minlines=1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ahdl_syn_inits")
+ if version < 508
+ let did_ahdl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink ahdlNumber ahdlString
+ HiLink ahdlMegafunction ahdlIdentifier
+ HiLink ahdlSpecialChar SpecialChar
+ HiLink ahdlKeyword Statement
+ HiLink ahdlString String
+ HiLink ahdlComment Comment
+ HiLink ahdlIdentifier Identifier
+ HiLink ahdlOperator Operator
+ HiLink ahdlTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ahdl"
+" vim:ts=8
diff --git a/runtime/syntax/amiga.vim b/runtime/syntax/amiga.vim
new file mode 100644
index 000000000..21e88aeab
--- /dev/null
+++ b/runtime/syntax/amiga.vim
@@ -0,0 +1,101 @@
+" Vim syntax file
+" Language: AmigaDos
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 4
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Amiga Devices
+syn match amiDev "\(par\|ser\|prt\|con\|nil\):"
+
+" Amiga aliases and paths
+syn match amiAlias "\<[a-zA-Z][a-zA-Z0-9]\+:"
+syn match amiAlias "\<[a-zA-Z][a-zA-Z0-9]\+:[a-zA-Z0-9/]*/"
+
+" strings
+syn region amiString start=+"+ end=+"+ oneline
+
+" numbers
+syn match amiNumber "\<\d\+\>"
+
+" Logic flow
+syn region amiFlow matchgroup=Statement start="if" matchgroup=Statement end="endif" contains=ALL
+syn keyword amiFlow skip endskip
+syn match amiError "else\|endif"
+syn keyword amiElse contained else
+
+syn keyword amiTest contained not warn error fail eq gt ge val exists
+
+" echo exception
+syn region amiEcho matchgroup=Statement start="\<echo\>" end="$" oneline contains=amiComment
+syn region amiEcho matchgroup=Statement start="^\.[bB][rR][aA]" end="$" oneline
+syn region amiEcho matchgroup=Statement start="^\.[kK][eE][tT]" end="$" oneline
+
+" commands
+syn keyword amiKey addbuffers copy fault join pointer setdate
+syn keyword amiKey addmonitor cpu filenote keyshow printer setenv
+syn keyword amiKey alias date fixfonts lab printergfx setfont
+syn keyword amiKey ask delete fkey list printfiles setmap
+syn keyword amiKey assign dir font loadwb prompt setpatch
+syn keyword amiKey autopoint diskchange format lock protect sort
+syn keyword amiKey avail diskcopy get magtape quit stack
+syn keyword amiKey binddrivers diskdoctor getenv makedir relabel status
+syn keyword amiKey bindmonitor display graphicdump makelink remrad time
+syn keyword amiKey blanker iconedit more rename type
+syn keyword amiKey break ed icontrol mount resident unalias
+syn keyword amiKey calculator edit iconx newcli run unset
+syn keyword amiKey cd endcli ihelp newshell say unsetenv
+syn keyword amiKey changetaskpri endshell info nocapslock screenmode version
+syn keyword amiKey clock eval initprinter nofastmem search wait
+syn keyword amiKey cmd exchange input overscan serial wbpattern
+syn keyword amiKey colors execute install palette set which
+syn keyword amiKey conclip failat iprefs path setclock why
+
+" comments
+syn cluster amiCommentGroup contains=amiTodo,@Spell
+syn case ignore
+syn keyword amiTodo contained todo
+syn case match
+syn match amiComment ";.*$" contains=amiCommentGroup
+
+" sync
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_amiga_syn_inits")
+ if version < 508
+ let did_amiga_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink amiAlias Type
+ HiLink amiComment Comment
+ HiLink amiDev Type
+ HiLink amiEcho String
+ HiLink amiElse Statement
+ HiLink amiError Error
+ HiLink amiKey Statement
+ HiLink amiNumber Number
+ HiLink amiString String
+ HiLink amiTest Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "amiga"
+
+" vim:ts=15
diff --git a/runtime/syntax/aml.vim b/runtime/syntax/aml.vim
new file mode 100644
index 000000000..7cb16f1c1
--- /dev/null
+++ b/runtime/syntax/aml.vim
@@ -0,0 +1,157 @@
+" Vim syntax file
+" Language: AML (ARC/INFO Arc Macro Language)
+" Written By: Nikki Knuit <Nikki.Knuit@gems3.gov.bc.ca>
+" Maintainer: Todd Glover <todd.glover@gems9.gov.bc.ca>
+" Last Change: 2001 May 10
+
+" FUTURE CODING: Bold application commands after &sys, &tty
+" Only highlight aml Functions at the beginning
+" of [], in order to avoid -read highlighted,
+" or [quote] strings highlighted
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" ARC, ARCEDIT, ARCPLOT, LIBRARIAN, GRID, SCHEMAEDIT reserved words,
+" defined as keywords.
+
+syn keyword amlArcCmd contained 2button abb abb[reviations] abs ac acos acosh add addc[ogoatt] addcogoatt addf[eatureclass] addh[istory] addi addim[age] addindexatt addit[em] additem addressb[uild] addressc[reate] addresse[rrors] addressedit addressm[atch] addressp[arse] addresst[est] addro[utemeasure] addroutemeasure addte[xt] addto[stack] addw[orktable] addx[y] adj[ust] adm[inlicense] adr[ggrid] ads adsa[rc] ae af ag[gregate] ai ai[request] airequest al alia[s] alig[n] alt[erarchive] am[sarc] and annoa[lignment] annoadd annocapture annocl[ip] annoco[verage] annocurve annoe[dit] annoedit annof annofeature annofit annoitem annola[yer] annole[vel] annolevel annoline annooffset annop[osition] annoplace annos[ize] annoselectfeatur annoset annosum annosymbol annot annot[ext] annotext annotype ao ap apm[ode] app[end] arc arcad[s] arcar[rows] arcc[ogo] arcdf[ad] arcdi[me] arcdl[g] arcdx[f] arced[it] arcedit arcen[dtext] arcf[ont] arcigd[s] arcige[s] arcla[bel] arcli[nes] arcma[rkers] arcmo[ss]
+syn keyword amlArcCmd contained arcpl[ot] arcplot arcpo[int] arcr[oute] arcs arcsc[itex] arcse[ction] arcsh[ape] arcsl[f] arcsn[ap] arcsp[ot] arcte[xt] arctig[er] arctin arcto[ols] arctools arcty[pe] area areaq[uery] arm arrow arrows[ize] arrowt[ype] as asc asciig[rid] asciih[elp] asciihelp asco[nnect] asconnect asd asda[tabase] asdi[sconnect] asdisconnect asel[ect] asex[ecute] asf asin asinh asp[ect] asr[eadlocks] ast[race] at atan atan2 atanh atusage aud[ittrail] autoi[ncrement] autol[ink] axis axish[atch] axisl[abels] axisr[uler] axist[ext] bac[klocksymbol] backcoverage backenvironment backnodeangleite backsymbolitem backtextitem base[select] basi[n] bat[ch] bc be be[lls] blackout blockmaj[ority] blockmax blockmea[n] blockmed[ian] blockmin blockmino[rity] blockr[ange] blockst[d] blocksu[m] blockv[ariety] bnai bou[ndaryclean] box br[ief] bsi bti buf[fer] bug[form] bugform build builds[ta] buildv[at] calco[mp] calcomp calcu[late] cali[brateroutes] calibrateroutes can[d] cartr[ead] cartread
+syn keyword amlArcCmd contained cartw[rite] cartwrite cei[l] cel[lvalue] cen[troidlabels] cgm cgme[scape] cha[nge] checkin checkinrel checkout checkoutrel chm[od] chown chownt[ransaction] chowntran chowntransaction ci ci[rcle] cir class classp[rob] classs[ig] classsample clean clear clears[elect] clip clipg[raphextent] clipm[apextent] clo[sedatabase] cntvrt co cod[efind] cog[oinverse] cogocom cogoenv cogomenu coll[ocate] color color2b[lue] color2g[reen] color2h[ue] color2r[ed] color2s[at] color2v[al] colorchart coloredit colorh[cbs] colorhcbs colu[mns] comb[ine] comm[ands] commands con connect connectu[ser] cons[ist] conto[ur] contr[olpoints] convertd[oc] convertdoc converti[mage] convertla[yer] convertli[brary] convertr[emap] convertw[orkspace] coo[rdinate] coordinate coordinates copy copyf[eatures] copyi[nfo] copyl[ayer] copyo copyo[ut] copyout copys[tack] copyw[orkspace] copyworkspace cor corr[idor] correlation cos cosh costa[llocation] costb[acklink] costd[istance] costp[ath] cou[ntvertices]
+syn keyword amlArcCmd contained countvertices cpw cr create create2[dindex] createa[ttributes] createca[talog] createco[go] createcogo createf[eature] createind[ex] createinf[otable] createlab[els] createlay[er] createli[brary] createn[etindex] creater[emap] creates[ystables] createta[blespace] createti[n] createw[orkspace] createworkspace cs culdesac curs[or] curv[ature] curve3pt cut[fill] cutoff cw cx[or] da dar[cyflow] dat[aset] dba[seinfo] dbmsc dbmsc[ursor] dbmscursor dbmse[xecute] dbmsi[nfo] dbmss[et] de delete deletea[rrows] deletet[ic] deletew[orkspace] deleteworkspace demg[rid] deml[attice] dend[rogram] densify densifya[rc] describe describea[rchive] describel[attice] describeti[n] describetr[ans] describetrans dev df[adarc] dg dif[f] digi[tizer] digt[est] dim[earc] dir dir[ectory] directory disa[blepanzoom] disconnect disconnectu[ser] disp disp[lay] display dissolve dissolvee[vents] dissolveevents dista[nce] distr[ibutebuild] div dl[garc] do doce[ll] docu[ment] document dogroup drag
+syn keyword amlArcCmd contained draw drawenvironment draworder draws[ig] drawselect drawt[raverses] drawz[oneshape] drop2[dindex] dropa[rchive] dropfeaturec[lass] dropfeatures dropfr[omstack] dropgroup droph[istory] dropind[ex] dropinf[otable] dropit[em] dropla[yer] droplib[rary] droplin[e] dropline dropn[etindex] dropt[ablespace] dropw[orktable] ds dt[edgrid] dtrans du[plicate] duplicatearcs dw dxf dxfa[rc] dxfi[nfo] dynamicpan dynpan ebe ec ed edg[esnap] edgematch editboundaryerro edit[coverage] editdistance editf editfeature editp[lot] editplot edits[ig] editsymbol ef el[iminate] em[f] en[d] envrst envsav ep[s] eq equ[alto] er[ase] es et et[akarc] euca[llocation] eucdir[ection] eucdis[tance] eval eventa[rc] evente[nds] eventh[atch] eventi[nfo] eventlinee[ndtext] eventlines eventlinet[ext] eventlis[t] eventma[rkers] eventme[nu] eventmenu eventpoint eventpointt[ext] eventse[ction] eventso[urce] eventt[ransform] eventtransform exi[t] exp exp1[0] exp2 expa[nd] expo[rt] exten[d] external externala[ll]
+syn keyword amlArcCmd contained fd[convert] featuregroup fg fie[lddata] file fill filt[er] fix[ownership] flip flipa[ngle] float floatg[rid] floo[r] flowa[ccumulation] flowd[irection] flowl[ength] fm[od] focalf[low] focalmaj[ority] focalmax focalmea[n] focalmed[ian] focalmin focalmino[rity] focalr[ange] focalst[d] focalsu[m] focalv[ariety] fonta[rc] fontco[py] fontcr[eate] fontd[elete] fontdump fontl[oad] fontload forc[e] form[edit] formedit forms fr[equency] ge geary general[ize] generat[e] gerbera[rc] gerberr[ead] gerberread gerberw[rite] gerberwrite get getz[factor] gi gi[rasarc] gnds grai[n] graphb[ar] graphe[xtent] graphi[cs] graphicimage graphicview graphlim[its] graphlin[e] graphp[oint] graphs[hade] gray[shade] gre[aterthan] grid grida[scii] gridcl[ip] gridclip gridco[mposite] griddesk[ew] griddesp[eckle] griddi[rection] gride[dit] gridfli[p] gridflo[at] gridim[age] gridin[sert] gridl[ine] gridma[jority] gridmi[rror] gridmo[ss] gridn[et] gridnodatasymbol gridpa[int] gridpoi[nt] gridpol[y]
+syn keyword amlArcCmd contained gridq[uery] gridr[otate] gridshad[es] gridshap[e] gridshi[ft] gridw[arp] group groupb[y] gt gv gv[tolerance] ha[rdcopy] he[lp] help hid[densymbol] hig[hlow] hil[lshade] his[togram] historicalview ho[ldadjust] hpgl hpgl2 hsv2b[lue] hsv2g[reen] hsv2r[ed] ht[ml] hview ia ided[it] identif[y] identit[y] idw if igdsa[rc] igdsi[nfo] ige[sarc] il[lustrator] illustrator image imageg[rid] imagep[lot] imageplot imageview imp[ort] in index indexi[tem] info infodba[se] infodbm[s] infof[ile] init90[00] init9100 init9100b init91[00] init95[00] int intersect intersectarcs intersecte[rr] isn[ull] iso[cluster] it[ems] iview j[oinitem] join keeps keepselect keyan[gle] keyar[ea] keyb[ox] keyf[orms] keyl[ine] keym keym[arker] keymap keyp[osition] keyse[paration] keysh[ade] keyspot kill killm[ap] kr[iging] la labela[ngle] labele[rrors] labelm[arkers] labels labelsc[ale] labelsp[ot] labelt[ext] lal latticecl[ip] latticeco[ntour] latticed[em] latticem[erge] latticemarkers latticeo[perate]
+syn keyword amlArcCmd contained latticep[oly] latticerep[lace] latticeres[ample] lattices[pot] latticet[in] latticetext layer layera[nno] layerca[lculate] layerco[lumns] layerde[lete] layerdo[ts] layerdr[aw] layere[xport] layerf[ilter] layerid[entify] layerim[port] layerio[mode] layerli[st] layerloc[k] layerlog[file] layerq[uery] layerse[arch] layersp[ot] layert[ext] lc ldbmst le leadera[rrows] leaders leadersy[mbol] leadert[olerance] len[gth] les[sthan] lf lg lh li lib librari[an] library limitadjust limitautolink line line2pt linea[djustment] linecl[osureangle] linecolor linecolorr[amp] linecopy linecopyl[ayer] linedelete linedeletel[ayer] lineden[sity] linedir[ection] linedis[t] lineedit lineg[rid] lineh[ollow] lineinf[o] lineint[erval] linel[ayer] linelist linem[iterangle] lineo[ffset] linepa[ttern] linepe[n] linepu[t] linesa[ve] linesc[ale] linese[t] linesi[ze] linest[ats] linesy[mbol] linete[mplate]
+syn keyword amlArcCmd contained linety[pe] link[s] linkfeatures list listarchives listatt listc[overages] listcoverages listdbmstables listg[rids] listgrids listhistory listi[mages] listimages listinfotables listlayers listlibraries listo[utput] listse[lect] listst[acks] liststacks listtablespaces listti[ns] listtins listtr[averses] listtran listtransactions listw[orkspaces] listworkspaces lit ll ll[sfit] lla lm ln load loada[djacent] loadcolormap locko[nly] locks[ymbol] log log1[0] log2 logf[ile] logg[ing] loo[kup] lot[area] lp[os] lstk lt lts lw madditem majority majorityf[ilter] makere[gion] makero[ute] makese[ction] makest[ack] mal[ign] map mapa[ngle] mape[xtent] mapextent mapi[nfo] mapj[oin] mapl[imits] mappo[sition] mappr[ojection] mapsc[ale] mapsh[ift] mapu[nits] mapw[arp] mapz[oom] marker markera[ngle] markercolor markercolorr[amp] markercopy markercopyl[ayer] markerdelete markerdeletel[aye] markeredit markerf[ont] markeri[nfo] markerl[ayer] markerlist markerm[ask] markero[ffset]
+syn keyword amlArcCmd contained markerpa[ttern] markerpe[n] markerpu[t] markersa[ve] markersc[ale] markerse[t] markersi[ze] markersy[mbol] mas[elect] matchc[over] matchn[ode] max mb[egin] mc[opy] md[elete] me mean measure measurer[oute] measureroute med mend menu[cover] menuedit menv[ironment] merge mergeh[istory] mergev[at] mfi[t] mfr[esh] mg[roup] miadsa[rc] miadsr[ead] miadsread min minf[o] mino[rity] mir[ror] mitems mjoin ml[classify] mma[sk] mmo[ve] mn[select] mod mor[der] moran mosa[ic] mossa[rc] mossg[rid] move movee[nd] movei[tem] mp[osition] mr mr[otate] msc[ale] mse[lect] mselect mt[olerance] mu[nselect] multcurve multinv multipleadditem multipleitems multiplejoin multipleselect multprop mw[ho] nai ne near neatline neatlineg[rid] neatlineh[atch] neatlinel[abels] neatlinet[ics] new next ni[bble] nodeangleitem nodec[olor] nodee[rrors] nodem[arkers] nodep[oint] nodes nodesi[ze] nodesn[ap] nodesp[ot] nodet[ext] nor[mal] not ns[elect] oe ogrid ogridt[ool] oldwindow oo[ps] op[endatabase] or
+syn keyword amlArcCmd contained osymbol over overflow overflowa[rea] overflowp[osition] overflows[eparati] overl[ayevents] overlapsymbol overlayevents overp[ost] pagee[xtent] pages[ize] pageu[nits] pal[info] pan panview par[ticletrack] patc[h] path[distance] pe[nsize] pi[ck] pli[st] plot plotcopy plotg[erber] ploti[con] plotmany plotpanel plotsc[itex] plotsi[f] pointde[nsity] pointdist pointdista[nce] pointdo[ts] pointg[rid] pointi[nterp] pointm[arkers] pointn[ode] points pointsp[ot] pointst[ats] pointt[ext] polygonb[ordertex] polygond[ots] polygone[vents] polygonevents polygonl[ines] polygons polygonsh[ades] polygonsi[zelimit] polygonsp[ot] polygont[ext] polygr[id] polyr[egion] pop[ularity] por[ouspuff] pos pos[tscript] positions postscript pow prec[ision] prep[are] princ[omp] print product producti[nfo] project projectcom[pare] projectcop[y] projectd[efine] pul[litems] pur[gehistory] put pv q q[uit] quit rand rang[e] rank rb rc re readg[raphic] reads[elect] reb[ox] recl[ass] recoverdb rect[ify]
+syn keyword amlArcCmd contained red[o] refreshview regionb[uffer] regioncla[ss] regioncle[an] regiondi[ssolve] regiondo[ts] regione[rrors] regiong[roup] regionj[oin] regionl[ines] regionpoly regionpolyc[ount] regionpolycount regionpolyl[ist] regionpolylist regionq[uery] regions regionse[lect] regionsh[ades] regionsp[ot] regiont[ext] regionxa[rea] regionxarea regionxt[ab] regionxtab register registerd[bms] regr[ession] reindex rej[ects] rela[te] rele[ase] rem remapgrid reme[asure] remo[vescalar] remove removeback removecover removeedit removesnap removetransfer rename renamew[orkspace] renameworkspace reno[de] rep[lace] reposition resa[mple] resel[ect] reset resh[ape] restore restorearce[dit] restorearch[ive] resu[me] rgb2h[ue] rgb2s[at] rgb2v[al] rotate rotatep[lot] routea[rc] routeends routeendt[ext] routeer[rors] routeev[entspot] routeh[atch] routel[ines] routes routesp[ot] routest[ats] routet[ext] rp rs rt rt[l] rtl rv rw sa sai sample samples[ig] sav[e] savecolormap sc scal[ar] scat[tergram]
+syn keyword amlArcCmd contained scenefog sceneformat scenehaze sceneoversample sceneroll scenesave scenesize scenesky scitexl[ine] scitexpoi[nt] scitexpol[y] scitexr[ead] scitexread scitexw[rite] scitexwrite sco screenr[estore] screens[ave] sd sds sdtse[xport] sdtsim[port] sdtsin[fo] sdtsl[ist] se sea[rchtolerance] sectiona[rc] sectionends sectionendt[ext] sectionh[atch] sectionl[ines] sections sectionsn[ap] sectionsp[ot] sectiont[ext] sel select selectb[ox] selectc[ircle] selectg[et] selectm[ask] selectmode selectpoi[nt] selectpol[ygon] selectpu[t] selectt[ype] selectw[ithin] semivariogram sep[arator] separator ser[verstatus] setan[gle] setar[row] setce[ll] setcoa[lesce] setcon[nectinfo] setd[bmscheckin] setdrawsymbol sete[ditmode] setincrement setm[ask] setn[ull] setools setreference setsymbol setturn setw[indow] sext sf sfmt sfo sha shade shadea[ngle] shadeb[ackcolor] shadecolor shadecolorr[amp] shadecopy shadecopyl[ayer] shadedelete shadedeletel[ayer] shadeedit shadegrid shadei[nfo] shadela[yer]
+syn keyword amlArcCmd contained shadeli[nepattern] shadelist shadeo[ffset] shadepa[ttern] shadepe[n] shadepu[t] shadesa[ve] shadesc[ale] shadesep[aration] shadeset shadesi[ze] shadesy[mbol] shadet[ype] shapea[rc] shapef[ile] shapeg[rid] shi[ft] show showconstants showe[ditmode] shr[ink] si sin sinfo sing[leuser] sinh sink sit[e] sl slf[arc] sli[ce] slo[pe] sm smartanno snap snapc[over] snapcover snapcoverage snapenvironment snapfeatures snapitems snapo[rder] snappi[ng] snappo[ur] so[rt] sobs sos spi[der] spiraltrans spline splinem[ethod] split spot spoto[ffset] spots[ize] sproj sqr sqrt sra sre srl ss ssc ssh ssi ssky ssz sta stackh[istogram] stackprofile stacksc[attergram] stackshade stackst[ats] stati[stics] statu[s] statuscogo std stra[ighten] streamline streamlink streamo[rder] stri[pmap] subm[it] subs[elect] sum surface surfaceabbrev surfacecontours surfacedefaults surfacedrape surfaceextent surfaceinfo surfacel[ength] surfacelimits surfacemarker surfacemenu surfaceobserver surfaceprofile
+syn keyword amlArcCmd contained surfaceprojectio surfacerange surfaceresolutio surfacesave surfacescene surfaceshade surfacesighting surfacetarget surfacevalue surfaceviewfield surfaceviewshed surfacevisibility surfacexsection surfacezoom surfacezscale sv svfd svs sxs symboldump symboli[tem] symbolsa[ve] symbolsc[ale] symbolse[t] symbolset sz tab[les] tal[ly] tan tanh tc te tes[t] text textal[ignment] textan[gle] textcolor textcolorr[amp] textcop[y] textde[lete] textdi[rection] textedit textfil[e] textfit textfo[nt] textin[fo] textit[em] textj[ustificatio] textlist textm[ask] texto[ffset] textpe[n] textpr[ecision] textpu[t] textq[uality] textsa[ve] textsc[ale] textse[t] textset textsi[ze] textsl[ant] textspa[cing] textspl[ine] textst[yle] textsy[mbol] tf th thie[ssen] thin ti tics tict[ext] tigera[rc] tigert[ool] tigertool til[es] timped tin tina[rc] tinc[ontour] tinerrors tinhull tinl[attice] tinlines tinmarkers tins[pot] tinshades tintext tinv[rml] tl tm tol[erance] top[ogrid] topogridtool
+syn keyword amlArcCmd contained transa[ction] transfe[r] transfercoverage transferfeature transferitems transfersymbol transfo[rm] travrst travsav tre[nd] ts tsy tt tur[ntable] turnimpedance tut[orial] una[ry] unde[lete] undo ungenerate ungeneratet[in] unio[n] unit[s] unr[egisterdbms] unse[lect] unsp[lit] update updatei[nfoschema] updatel[abels] upo[s] us[age] v va[riety] vcgl vcgl2 veri[fy] vers[ion] vertex viewrst viewsav vip visd[ecode] visdecode vise[ncode] visencode visi[bility] vo[lume] vpfe[xport] vpfi[mport] vpfl[ist] vpft[ile] w war[p] wat[ershed] weedd[raw] weedo[perator] weedt[olerance] weedtolerance whe[re] whi[le] who wi[ndows] wm[f] wo[rkspace] workspace writec[andidates] writeg[raphic] writes[elect] wt x[or] ze[ta] zeta zi zo zonala[rea] zonalc[entroid] zonalf[ill] zonalg[eometry] zonalmaj[ority] zonalmax zonalmea[n] zonalmed[ian] zonalmin zonalmino[rity] zonalp[erimeter] zonalr[ange] zonalsta[ts] zonalstd zonalsu[m] zonalt[hickness] zonalv[ariety] zoomview zv
+
+" FORMEDIT reserved words, defined as keywords.
+
+syn keyword amlFormedCmd contained button choice display help input slider text
+
+" TABLES reserved words, defined as keywords.
+
+syn keyword amlTabCmd contained add additem alter asciihelp aselect at calc calculate change commands commit copy define directory dropindex dropitem erase external get help indexitem items kill list move nselect purge quit redefine rename reselect rollback save select show sort statistics unload update usagecontained
+
+" INFO reserved words, defined as keywords.
+
+syn keyword amlInfoCmd contained accept add adir alter dialog alter alt directory aret arithmetic expressions aselect automatic return calculate cchr change options change comi cominput commands list como comoutput compile concatenate controlling defaults copy cursor data delete data entry data manipulate data retrieval data update date format datafile create datafile management decode define delimiter dfmt directory management directory display do doend documentation done end environment erase execute exiting expand export external fc files first format forms control get goto help import input form ipf internal item types items label lchar list logical expressions log merge modify options modify move next nselect output password prif print programming program protect purge query quit recase redefine relate relate release notes remark rename report options reporting report reselect reserved words restrictions run save security select set sleep sort special form spool stop items system variables take terminal types terminal time topics list type update upf
+
+" VTRACE reserved words, defined as keywords.
+
+syn keyword amlVtrCmd contained add al arcscan arrowlength arrowwidth as aw backtrack branch bt cj clearjunction commands cs dash endofline endofsession eol eos fan fg foreground gap generalizetolerance gtol help hole js junctionsensitivity linesymbol linevariation linewidth ls lv lw markersymbol mode ms raster regionofinterest reset restore retrace roi save searchradius skip sr sta status stc std str straightenangle straightencorner straightendistance straightenrange vt vtrace
+
+" The AML reserved words, defined as keywords.
+
+syn keyword amlFunction contained abs access acos after angrad asin atan before calc close copy cos cover coverage cvtdistance date delete dignum dir directory entryname exist[s] exp extract file filelist format formatdate full getchar getchoice getcover getdatabase getdeflayers getfile getgrid getimage getitem getlayercols getlibrary getstack getsymbol gettin getunique iacclose iacconnect iacdisconnect iacopen iacrequest index indexed info invangle invdistance iteminfo joinfile keyword length listfile listitem listunique locase log max menu min mod noecho null okangle okdistance open pathname prefix query quote quoteexists r radang random read rename response round scratchname search show sin sort sqrt subst substr suffix tan task token translate trim truncate type unquote upcase username value variable verify write
+
+syn keyword amlDir contained abbreviations above all aml amlpath append arc args atool brief by call canvas cc center cl codepage commands conv_watch_to_aml coordinates cr create current cursor cwta dalines data date_format delete delvar describe dfmt digitizer display do doend dv echo else enable encode encrypt end error expansion fail file flushpoints force form format frame fullscreen function getlastpoint getpoint goto iacreturn if ignore info inform key keypad label lc left lf lg list listchar listfiles listglobal listheader listlocal listprogram listvar ll lp lr lv map matrix menu menupath menutype mess message[s] modal mouse nopaging off on others page pause pinaction popup position pt pulldown push pushpoint r repeat return right routine run runwatch rw screen seconds select self setchar severity show sidebar single size staggered station stop stripe sys system tablet tb terminal test then thread to top translate tty ty type uc ul until ur usage w warning watch when while window workspace
+
+syn keyword amlDir2 contained delvar dv s set setvar sv
+
+syn keyword amlOutput contained inform warning error pause stop tty ty type
+
+
+" AML Directives:
+syn match amlDirSym "&"
+syn match amlDirective "&[a-zA-Z]*" contains=amlDir,amlDir2,amlDirSym
+
+" AML Functions
+syn region amlFunc start="\[ *[a-zA-Z]*" end="\]" contains=amlFunction,amlVar
+syn match amlFunc2 "\[.*\[.*\].*\]" contains=amlFunction,amlVar
+
+" Numbers:
+"syn match amlNumber "-\=\<[0-9]*\.\=[0-9_]\>"
+
+" Quoted Strings:
+syn region amlQuote start=+"+ skip=+\\"+ end=+"+ contains=amlVar
+syn region amlQuote start=+'+ skip=+\\'+ end=+'+
+
+" ARC Application Commands only selected at the beginning of the line,
+" or after a one line &if &then statement
+syn match amlAppCmd "^ *[a-zA-Z]*" contains=amlArcCmd,amlInfoCmd,amlTabCmd,amlVtrCmd,amlFormedCmd
+syn region amlAppCmd start="&then" end="$" contains=amlArcCmd,amlFormedCmd,amlInfoCmd,amlTabCmd,amlVtrCmd,amlFunction,amlDirective,amlVar2,amlSkip,amlVar,amlComment
+
+" Variables
+syn region amlVar start="%" end="%"
+syn region amlVar start="%" end="%" contained
+syn match amlVar2 "&s [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+syn match amlVar2 "&sv [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+syn match amlVar2 "&set [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+syn match amlVar2 "&setvar [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+syn match amlVar2 "&dv [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+syn match amlVar2 "&delvar [a-zA-Z_.0-9]*" contains=amlDir2,amlDirSym
+
+" Formedit 2 word commands
+syn match amlFormed "^ *check box"
+syn match amlFormed "^ *data list"
+syn match amlFormed "^ *symbol list"
+
+" Tables 2 word commands
+syn match amlTab "^ *q stop"
+syn match amlTab "^ *quit stop"
+
+" Comments:
+syn match amlComment "/\*.*"
+
+" Regions for skipping over (not highlighting) program output strings:
+syn region amlSkip matchgroup=amlOutput start="&call" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&routine" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&inform" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&return &inform" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&return &warning" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&return &error" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&pause" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&stop" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&tty" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&ty" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&typ" end="$" contains=amlVar
+syn region amlSkip matchgroup=amlOutput start="&type" end="$" contains=amlVar
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_aml_syntax_inits")
+ if version < 508
+ let did_aml_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink amlComment Comment
+ HiLink amlNumber Number
+ HiLink amlQuote String
+ HiLink amlVar Identifier
+ HiLink amlVar2 Identifier
+ HiLink amlFunction PreProc
+ HiLink amlDir Statement
+ HiLink amlDir2 Statement
+ HiLink amlDirSym Statement
+ HiLink amlOutput Statement
+ HiLink amlArcCmd ModeMsg
+ HiLink amlFormedCmd amlArcCmd
+ HiLink amlTabCmd amlArcCmd
+ HiLink amlInfoCmd amlArcCmd
+ HiLink amlVtrCmd amlArcCmd
+ HiLink amlFormed amlArcCmd
+ HiLink amlTab amlArcCmd
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "aml"
diff --git a/runtime/syntax/ampl.vim b/runtime/syntax/ampl.vim
new file mode 100644
index 000000000..7f4dfa994
--- /dev/null
+++ b/runtime/syntax/ampl.vim
@@ -0,0 +1,150 @@
+" Language: ampl (A Mathematical Programming Language)
+" Maintainer: Krief David <david.krief@etu.enseeiht.fr> or <david_krief@hotmail.com>
+" Last Change: 2003 May 11
+
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+
+"--
+syn match amplEntityKeyword "\(subject to\)\|\(subj to\)\|\(s\.t\.\)"
+syn keyword amplEntityKeyword minimize maximize objective
+
+syn keyword amplEntityKeyword coeff coef cover obj default
+syn keyword amplEntityKeyword from to to_come net_in net_out
+syn keyword amplEntityKeyword dimen dimension
+
+
+
+"--
+syn keyword amplType integer binary set param var
+syn keyword amplType node ordered circular reversed symbolic
+syn keyword amplType arc
+
+
+
+"--
+syn keyword amplStatement check close \display drop include
+syn keyword amplStatement print printf quit reset restore
+syn keyword amplStatement solve update write shell model
+syn keyword amplStatement data option let solution fix
+syn keyword amplStatement unfix end function pipe format
+
+
+
+"--
+syn keyword amplConditional if then else and or
+syn keyword amplConditional exists forall in not within
+
+
+
+"--
+syn keyword amplRepeat while repeat for
+
+
+
+"--
+syn keyword amplOperators union diff difference symdiff sum
+syn keyword amplOperators inter intersect intersection cross setof
+syn keyword amplOperators by less mod div product
+"syn keyword amplOperators min max
+"conflict between functions max, min and operators max, min
+
+syn match amplBasicOperators "||\|<=\|==\|\^\|<\|=\|!\|-\|\.\.\|:="
+syn match amplBasicOperators "&&\|>=\|!=\|\*\|>\|:\|/\|+\|\*\*"
+
+
+
+
+"--
+syn match amplComment "\#.*"
+syn region amplComment start=+\/\*+ end=+\*\/+
+
+syn region amplStrings start=+\'+ skip=+\\'+ end=+\'+
+syn region amplStrings start=+\"+ skip=+\\"+ end=+\"+
+
+syn match amplNumerics "[+-]\=\<\d\+\(\.\d\+\)\=\([dDeE][-+]\=\d\+\)\=\>"
+syn match amplNumerics "[+-]\=Infinity"
+
+
+"--
+syn keyword amplSetFunction card next nextw prev prevw
+syn keyword amplSetFunction first last member ord ord0
+
+syn keyword amplBuiltInFunction abs acos acosh alias asin
+syn keyword amplBuiltInFunction asinh atan atan2 atanh ceil
+syn keyword amplBuiltInFunction cos exp floor log log10
+syn keyword amplBuiltInFunction max min precision round sin
+syn keyword amplBuiltInFunction sinh sqrt tan tanh trunc
+
+syn keyword amplRandomGenerator Beta Cauchy Exponential Gamma Irand224
+syn keyword amplRandomGenerator Normal Poisson Uniform Uniform01
+
+
+
+"-- to highlight the 'dot-suffixes'
+syn match amplDotSuffix "\h\w*\.\(lb\|ub\)"hs=e-2
+syn match amplDotSuffix "\h\w*\.\(lb0\|lb1\|lb2\|lrc\|ub0\)"hs=e-3
+syn match amplDotSuffix "\h\w*\.\(ub1\|ub2\|urc\|val\|lbs\|ubs\)"hs=e-3
+syn match amplDotSuffix "\h\w*\.\(init\|body\|dinit\|dual\)"hs=e-4
+syn match amplDotSuffix "\h\w*\.\(init0\|ldual\|slack\|udual\)"hs=e-5
+syn match amplDotSuffix "\h\w*\.\(lslack\|uslack\|dinit0\)"hs=e-6
+
+
+
+"--
+syn match amplPiecewise "<<\|>>"
+
+
+
+"-- Todo.
+syn keyword amplTodo contained TODO FIXME XXX
+
+
+
+
+
+
+
+
+
+
+if version >= 508 || !exists("did_ampl_syntax_inits")
+ if version < 508
+ let did_ampl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later.
+ HiLink amplEntityKeyword Keyword
+ HiLink amplType Type
+ HiLink amplStatement Statement
+ HiLink amplOperators Operator
+ HiLink amplBasicOperators Operator
+ HiLink amplConditional Conditional
+ HiLink amplRepeat Repeat
+ HiLink amplStrings String
+ HiLink amplNumerics Number
+ HiLink amplSetFunction Function
+ HiLink amplBuiltInFunction Function
+ HiLink amplRandomGenerator Function
+ HiLink amplComment Comment
+ HiLink amplDotSuffix Special
+ HiLink amplPiecewise Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ampl"
+
+" vim: ts=8
+
+
diff --git a/runtime/syntax/ant.vim b/runtime/syntax/ant.vim
new file mode 100644
index 000000000..6846ec6bd
--- /dev/null
+++ b/runtime/syntax/ant.vim
@@ -0,0 +1,97 @@
+" Vim syntax file
+" Language: ANT build file (xml)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue Apr 27 13:05:59 CEST 2004
+" Filenames: build.xml
+" $Id$
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:ant_cpo_save = &cpo
+set cpo&vim
+
+runtime! syntax/xml.vim
+
+syn case ignore
+
+if !exists('*AntSyntaxScript')
+ fun AntSyntaxScript(tagname, synfilename)
+ unlet b:current_syntax
+ let s:include = expand("<sfile>:p:h").'/'.a:synfilename
+ if filereadable(s:include)
+ exe 'syn include @ant'.a:tagname.' '.s:include
+ else
+ exe 'syn include @ant'.a:tagname." $VIMRUNTIME/syntax/".a:synfilename
+ endif
+
+ exe 'syn region ant'.a:tagname
+ \." start=#<script[^>]\\{-}language\\s*=\\s*['\"]".a:tagname."['\"]\\(>\\|[^>]*[^/>]>\\)#"
+ \.' end=#</script>#'
+ \.' fold'
+ \.' contains=@ant'.a:tagname.',xmlCdataStart,xmlCdataEnd,xmlTag,xmlEndTag'
+ \.' keepend'
+ exe 'syn cluster xmlRegionHook add=ant'.a:tagname
+ endfun
+endif
+
+" TODO: add more script languages here ?
+call AntSyntaxScript('javascript', 'javascript.vim')
+call AntSyntaxScript('jpython', 'python.vim')
+
+
+syn cluster xmlTagHook add=antElement
+
+syn keyword antElement display WsdlToDotnet addfiles and ant antcall antstructure apply archives arg argument
+syn keyword antElement display assertions attrib attribute available basename bcc blgenclient bootclasspath
+syn keyword antElement display borland bottom buildnumber buildpath buildpathelement bunzip2 bzip2 cab
+syn keyword antElement display catalogpath cc cccheckin cccheckout cclock ccmcheckin ccmcheckintask ccmcheckout
+syn keyword antElement display ccmcreatetask ccmkattr ccmkbl ccmkdir ccmkelem ccmklabel ccmklbtype
+syn keyword antElement display ccmreconfigure ccrmtype ccuncheckout ccunlock ccupdate checksum chgrp chmod
+syn keyword antElement display chown classconstants classes classfileset classpath commandline comment
+syn keyword antElement display compilerarg compilerclasspath concat concatfilter condition copy copydir
+syn keyword antElement display copyfile coveragepath csc custom cvs cvschangelog cvspass cvstagdiff cvsversion
+syn keyword antElement display daemons date defaultexcludes define delete deletecharacters deltree depend
+syn keyword antElement display depends dependset depth description different dirname dirset disable dname
+syn keyword antElement display doclet doctitle dtd ear echo echoproperties ejbjar element enable entity entry
+syn keyword antElement display env equals escapeunicode exclude excludepackage excludesfile exec execon
+syn keyword antElement display existing expandproperties extdirs extension extensionSet extensionset factory
+syn keyword antElement display fail filelist filename filepath fileset filesmatch filetokenizer filter
+syn keyword antElement display filterchain filterreader filters filterset filtersfile fixcrlf footer format
+syn keyword antElement display from ftp generic genkey get gjdoc grant group gunzip gzip header headfilter http
+syn keyword antElement display ignoreblank ilasm ildasm import importtypelib include includesfile input iplanet
+syn keyword antElement display iplanet-ejbc isfalse isreference isset istrue jar jarlib-available
+syn keyword antElement display jarlib-manifest jarlib-resolve java javac javacc javadoc javadoc2 jboss jdepend
+syn keyword antElement display jjdoc jjtree jlink jonas jpcoverage jpcovmerge jpcovreport jsharpc jspc
+syn keyword antElement display junitreport jvmarg lib libfileset linetokenizer link loadfile loadproperties
+syn keyword antElement display location macrodef mail majority manifest map mapper marker mergefiles message
+syn keyword antElement display metainf method mimemail mkdir mmetrics modified move mparse none not options or
+syn keyword antElement display os outputproperty package packageset parallel param patch path pathconvert
+syn keyword antElement display pathelement patternset permissions prefixlines present presetdef project
+syn keyword antElement display property propertyfile propertyref propertyset pvcs pvcsproject record reference
+syn keyword antElement display regexp rename renameext replace replacefilter replaceregex replaceregexp
+syn keyword antElement display replacestring replacetoken replacetokens replacevalue replyto report resource
+syn keyword antElement display revoke rmic root rootfileset rpm scp section selector sequential serverdeploy
+syn keyword antElement display setproxy signjar size sleep socket soscheckin soscheckout sosget soslabel source
+syn keyword antElement display sourcepath sql src srcfile srcfilelist srcfiles srcfileset sshexec stcheckin
+syn keyword antElement display stcheckout stlabel stlist stringtokenizer stripjavacomments striplinebreaks
+syn keyword antElement display striplinecomments style subant substitution support symlink sync sysproperty
+syn keyword antElement display syspropertyset tabstospaces tag taglet tailfilter tar tarfileset target
+syn keyword antElement display targetfile targetfilelist targetfileset taskdef tempfile test testlet text title
+syn keyword antElement display to token tokenfilter touch transaction translate triggers trim tstamp type
+syn keyword antElement display typedef unjar untar unwar unzip uptodate url user vbc vssadd vsscheckin
+syn keyword antElement display vsscheckout vsscp vsscreate vssget vsshistory vsslabel waitfor war wasclasspath
+syn keyword antElement display webapp webinf weblogic weblogictoplink websphere whichresource wlclasspath
+syn keyword antElement display wljspc wsdltodotnet xmlcatalog xmlproperty xmlvalidate xslt zip zipfileset
+syn keyword antElement display zipgroupfileset
+
+hi def link antElement Statement
+
+let b:current_syntax = "ant"
+
+let &cpo = s:ant_cpo_save
+unlet s:ant_cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/antlr.vim b/runtime/syntax/antlr.vim
new file mode 100644
index 000000000..19000293f
--- /dev/null
+++ b/runtime/syntax/antlr.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Antlr: ANTLR, Another Tool For Language Recognition <www.antlr.org>
+" Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
+" LastChange: 02 May 2001
+" Original: Comes from JavaCC.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" This syntac file is a first attempt. It is far from perfect...
+
+" Uses java.vim, and adds a few special things for JavaCC Parser files.
+" Those files usually have the extension *.jj
+
+" source the java.vim file
+if version < 600
+ so <sfile>:p:h/java.vim
+else
+ runtime! syntax/java.vim
+ unlet b:current_syntax
+endif
+
+"remove catching errors caused by wrong parenthesis (does not work in antlr
+"files) (first define them in case they have not been defined in java)
+syn match javaParen "--"
+syn match javaParenError "--"
+syn match javaInParen "--"
+syn match javaError2 "--"
+syn clear javaParen
+syn clear javaParenError
+syn clear javaInParen
+syn clear javaError2
+
+" remove function definitions (they look different) (first define in
+" in case it was not defined in java.vim)
+"syn match javaFuncDef "--"
+"syn clear javaFuncDef
+"syn match javaFuncDef "[a-zA-Z][a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType
+" syn region javaFuncDef start=+t[a-zA-Z][a-zA-Z0-9_. \[\]]*([^-+*/()]*,[ ]*+ end=+)[ \t]*:+
+
+syn keyword antlrPackages options language buildAST
+syn match antlrPackages "PARSER_END([^)]*)"
+syn match antlrPackages "PARSER_BEGIN([^)]*)"
+syn match antlrSpecToken "<EOF>"
+" the dot is necessary as otherwise it will be matched as a keyword.
+syn match antlrSpecToken ".LOOKAHEAD("ms=s+1,me=e-1
+syn match antlrSep "[|:]\|\.\."
+syn keyword antlrActionToken TOKEN SKIP MORE SPECIAL_TOKEN
+syn keyword antlrError DEBUG IGNORE_IN_BNF
+
+if version >= 508 || !exists("did_antlr_syntax_inits")
+ if version < 508
+ let did_antlr_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink antlrSep Statement
+ HiLink antlrPackages Statement
+ delcommand HiLink
+endif
+
+let b:current_syntax = "antlr"
+
+" vim: ts=8
diff --git a/runtime/syntax/apache.vim b/runtime/syntax/apache.vim
new file mode 100644
index 000000000..4fe9e8e0b
--- /dev/null
+++ b/runtime/syntax/apache.vim
@@ -0,0 +1,275 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: Apache configuration (httpd.conf, srm.conf, access.conf, .htaccess)
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-10-15
+" URL: http://trific.ath.cx/Ftp/vim/syntax/apache.vim
+" Note: define apache_version to your Apache version, e.g. "1.3", "2", "2.0.39"
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if exists("apache_version")
+ let s:av = apache_version
+else
+ let s:av = "1.3"
+endif
+let s:av = substitute(s:av, "[^.0-9]", "", "g")
+let s:av = substitute(s:av, "^\\d\\+$", "\\0.999", "")
+let s:av = substitute(s:av, "^\\d\\+\\.\\d\\+$", "\\0.999", "")
+let s:av = substitute(s:av, "\\<\\d\\>", "0\\0", "g")
+let s:av = substitute(s:av, "\\<\\d\\d\\>", "0\\0", "g")
+let s:av = substitute(s:av, "[.]", "", "g")
+
+syn case ignore
+
+" Base constructs
+syn match apacheComment "^\s*#.*$" contains=apacheFixme
+if s:av >= "002000000"
+ syn match apacheUserID "#-\?\d\+\>"
+endif
+syn case match
+syn keyword apacheFixme FIXME TODO XXX NOT
+syn case ignore
+syn match apacheAnything "\s[^>]*" contained
+syn match apacheError "\w\+" contained
+syn region apacheString start=+"+ end=+"+ skip=+\\\\\|\\\"+
+
+" Core and mpm
+syn keyword apacheDeclaration AccessFileName AddDefaultCharset AllowOverride AuthName AuthType ContentDigest DefaultType DocumentRoot ErrorDocument ErrorLog HostNameLookups IdentityCheck Include KeepAlive KeepAliveTimeout LimitRequestBody LimitRequestFields LimitRequestFieldsize LimitRequestLine LogLevel MaxKeepAliveRequests NameVirtualHost Options Require RLimitCPU RLimitMEM RLimitNPROC Satisfy ScriptInterpreterSource ServerAdmin ServerAlias ServerName ServerPath ServerRoot ServerSignature ServerTokens TimeOut UseCanonicalName
+if s:av < "002000000"
+ syn keyword apacheDeclaration AccessConfig AddModule BindAddress BS2000Account ClearModuleList CoreDumpDirectory Group Listen ListenBacklog LockFile MaxClients MaxRequestsPerChild MaxSpareServers MinSpareServers PidFile Port ResourceConfig ScoreBoardFile SendBufferSize ServerType StartServers ThreadsPerChild ThreadStackSize User
+endif
+if s:av >= "002000000"
+ syn keyword apacheDeclaration AcceptPathInfo CGIMapExtension EnableMMAP FileETag ForceType LimitXMLRequestBody SetHandler SetInputFilter SetOutputFilter
+ syn keyword apacheOption INode MTime Size
+endif
+syn keyword apacheOption Any All On Off Double EMail DNS Min Minimal OS Prod ProductOnly Full
+syn keyword apacheOption emerg alert crit error warn notice info debug
+syn keyword apacheOption registry script inetd standalone
+syn match apacheOptionOption "[+-]\?\<\(ExecCGI\|FollowSymLinks\|Includes\|IncludesNoExec\|Indexes\|MultiViews\|SymLinksIfOwnerMatch\)\>"
+syn keyword apacheOption user group valid-user
+syn case match
+syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained
+syn case ignore
+syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)\+.*>" contains=apacheAnything
+syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)\+.*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError
+syn keyword apacheLimitSectionKeyword Limit LimitExcept contained
+syn match apacheAuthType "AuthType\s.*$" contains=apacheAuthTypeValue
+syn keyword apacheAuthTypeValue Basic Digest
+syn match apacheAllowOverride "AllowOverride\s.*$" contains=apacheAllowOverrideValue,apacheComment
+syn keyword apacheAllowOverrideValue AuthConfig FileInfo Indexes Limit Options contained
+if s:av >= "002000000"
+ syn keyword apacheDeclaration CoreDumpDirectory Group Listen ListenBacklog LockFile MaxClients MaxMemFree MaxRequestsPerChild MaxSpareThreads MaxSpareThreadsPerChild MinSpareThreads NumServers PidFile ScoreBoardFile SendBufferSize ServerLimit StartServers StartThreads ThreadLimit ThreadsPerChild User
+ syn keyword apacheDeclaration MaxThreads ThreadStackSize
+ syn keyword apacheDeclaration AssignUserId ChildPerUserId
+ syn keyword apacheDeclaration AcceptMutex MaxSpareServers MinSpareServers
+ syn keyword apacheOption flock fcntl sysvsem pthread
+endif
+
+" Modules
+syn match apacheAllowDeny "Allow\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
+syn match apacheAllowDeny "Deny\s\+from.*$" contains=apacheAllowDenyValue,apacheComment
+syn keyword apacheAllowDenyValue All None contained
+syn match apacheOrder "^\s*Order\s.*$" contains=apacheOrderValue,apacheComment
+syn keyword apacheOrderValue Deny Allow contained
+syn keyword apacheDeclaration Action Script
+syn keyword apacheDeclaration Alias AliasMatch Redirect RedirectMatch RedirectTemp RedirectPermanent ScriptAlias ScriptAliasMatch
+syn keyword apacheOption permanent temp seeother gone
+syn keyword apacheDeclaration AuthAuthoritative AuthGroupFile AuthUserFile
+syn keyword apacheDeclaration Anonymous Anonymous_Authoritative Anonymous_LogEmail Anonymous_MustGiveEmail Anonymous_NoUserID Anonymous_VerifyEmail
+if s:av < "002000000"
+ syn keyword apacheDeclaration AuthDBGroupFile AuthDBUserFile AuthDBAuthoritative
+endif
+syn keyword apacheDeclaration AuthDBMGroupFile AuthDBMUserFile AuthDBMAuthoritative
+if s:av >= "002000000"
+ syn keyword apacheDeclaration AuthDBMType
+ syn keyword apacheOption default SDBM GDBM NDBM DB
+endif
+syn keyword apacheDeclaration AuthDigestAlgorithm AuthDigestDomain AuthDigestFile AuthDigestGroupFile AuthDigestNcCheck AuthDigestNonceFormat AuthDigestNonceLifetime AuthDigestQop
+syn keyword apacheOption none auth auth-int MD5 MD5-sess
+if s:av >= "002000000"
+ syn keyword apacheDeclaration AuthLDAPAuthoritative AuthLDAPBindON AuthLDAPBindPassword AuthLDAPCompareDNOnServer AuthLDAPDereferenceAliases AuthLDAPEnabled AuthLDAPFrontPageHack AuthLDAPGroupAttribute AuthLDAPGroupAttributeIsDN AuthLDAPRemoteUserIsDN AuthLDAPStartTLS AuthLDAPUrl
+ syn keyword apacheOption always never searching finding
+endif
+if s:av < "002000000"
+ syn keyword apacheDeclaration FancyIndexing
+endif
+syn keyword apacheDeclaration AddAlt AddAltByEncoding AddAltByType AddDescription AddIcon AddIconByEncoding AddIconByType DefaultIcon HeaderName IndexIgnore IndexOptions IndexOrderDefault ReadmeName
+syn keyword apacheOption DescriptionWidth FancyIndexing FoldersFirst IconHeight IconsAreLinks IconWidth NameWidth ScanHTMLTitles SuppressColumnSorting SuppressDescription SuppressHTMLPreamble SuppressLastModified SuppressSize TrackModified
+syn keyword apacheOption Ascending Descending Name Date Size Description
+if s:av >= "002000000"
+ syn keyword apacheOption HTMLTable SupressIcon SupressRules VersionSort
+endif
+if s:av < "002000000"
+ syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase
+endif
+if s:av >= "002000000"
+ syn keyword apacheDeclaration CacheDefaultExpire CacheEnable CacheForceCompletion CacheIgnoreCacheControl CacheIgnoreNoLastMod CacheLastModifiedFactor CacheMaxExpire CacheMaxStreamingBuffer
+endif
+syn keyword apacheDeclaration MetaFiles MetaDir MetaSuffix
+syn keyword apacheDeclaration ScriptLog ScriptLogLength ScriptLogBuffer
+if s:av >= "002000000"
+ syn keyword apacheDeclaration ScriptStock
+ syn keyword apacheDeclaration CharsetDefault CharsetOptions CharsetSourceEnc
+ syn keyword apacheOption DebugLevel ImplicitAdd NoImplicitAdd
+endif
+syn keyword apacheDeclaration Dav DavDepthInfinity DavLockDB DavMinTimeout
+if s:av < "002000000"
+ syn keyword apacheDeclaration Define
+end
+if s:av >= "002000000"
+ syn keyword apacheDeclaration DeflateBufferSize DeflateFilterNote DeflateMemLevel DeflateWindowSize
+endif
+if s:av < "002000000"
+ syn keyword apacheDeclaration AuthDigestFile
+endif
+syn keyword apacheDeclaration DirectoryIndex
+if s:av >= "002000000"
+ syn keyword apacheDeclaration ProtocolEcho
+endif
+syn keyword apacheDeclaration PassEnv SetEnv UnsetEnv
+syn keyword apacheDeclaration Example
+syn keyword apacheDeclaration ExpiresActive ExpiresByType ExpiresDefault
+if s:av >= "002000000"
+ syn keyword apacheDeclaration ExtFilterDefine ExtFilterOptions
+ syn keyword apacheOption PreservesContentLength DebugLevel LogStderr NoLogStderr
+ syn keyword apacheDeclaration CacheFile MMapFile
+endif
+syn keyword apacheDeclaration Header
+if s:av >= "002000000"
+ syn keyword apacheDeclaration RequestHeader
+endif
+syn keyword apacheOption set unset append add
+syn keyword apacheDeclaration ImapMenu ImapDefault ImapBase
+syn keyword apacheOption none formatted semiformatted unformatted
+syn keyword apacheOption nocontent referer error map
+syn keyword apacheDeclaration XBitHack
+if s:av >= "002000000"
+ syn keyword apacheDeclaration SSIEndTag SSIErrorMsg SSIStartTag SSITimeFormat SSIUndefinedEcho
+endif
+syn keyword apacheOption on off full
+syn keyword apacheDeclaration AddModuleInfo
+syn keyword apacheDeclaration ISAPIReadAheadBuffer ISAPILogNotSupported ISAPIAppendLogToErrors ISAPIAppendLogToQuery
+if s:av >= "002000000"
+ syn keyword apacheDeclaration ISAPICacheFile ISAIPFakeAsync
+ syn keyword apacheDeclaration LDAPCacheEntries LDAPCacheTTL LDAPCertDBPath LDAPOpCacheEntries LDAPOpCacheTTL LDAPSharedCacheSize
+endif
+if s:av < "002000000"
+ syn keyword apacheDeclaration AgentLog
+endif
+syn keyword apacheDeclaration CookieLog CustomLog LogFormat TransferLog
+if s:av < "002000000"
+ syn keyword apacheDeclaration RefererIgnore RefererLog
+endif
+if s:av >= "002000000"
+endif
+syn keyword apacheDeclaration AddCharset AddEncoding AddHandler AddLanguage AddType DefaultLanguage RemoveEncoding RemoveHandler RemoveType TypesConfig
+if s:av < "002000000"
+ syn keyword apacheDeclaration ForceType SetHandler
+endif
+if s:av >= "002000000"
+ syn keyword apacheDeclaration AddInputFilter AddOutputFilter ModMimeUsePathInfo MultiviewsMatch RemoveInputFilter RemoveOutputFilter
+endif
+syn keyword apacheDeclaration MimeMagicFile
+syn keyword apacheDeclaration MMapFile
+syn keyword apacheDeclaration CacheNegotiatedDocs LanguagePriority
+if s:av >= "002000000"
+ syn keyword apacheDeclaration ForceLanguagePriority
+endif
+syn keyword apacheDeclaration PerlModule PerlRequire PerlTaintCheck PerlWarn
+syn keyword apacheDeclaration PerlSetVar PerlSetEnv PerlPassEnv PerlSetupEnv
+syn keyword apacheDeclaration PerlInitHandler PerlPostReadRequestHandler PerlHeaderParserHandler
+syn keyword apacheDeclaration PerlTransHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler
+syn keyword apacheDeclaration PerlTypeHandler PerlFixupHandler PerlHandler PerlLogHandler
+syn keyword apacheDeclaration PerlCleanupHandler PerlChildInitHandler PerlChildExitHandler
+syn keyword apacheDeclaration PerlRestartHandler PerlDispatchHandler
+syn keyword apacheDeclaration PerlFreshRestart PerlSendHeader
+syn keyword apacheDeclaration php_value php_flag php_admin_value php_admin_flag
+syn keyword apacheDeclaration AllowCONNECT NoProxy ProxyBlock ProxyDomain ProxyPass ProxyPassReverse ProxyReceiveBufferSize ProxyRemote ProxyRequests ProxyVia
+if s:av < "002000000"
+ syn keyword apacheDeclaration CacheRoot CacheSize CacheMaxExpire CacheDefaultExpire CacheLastModifiedFactor CacheGcInterval CacheDirLevels CacheDirLength CacheForceCompletion NoCache
+ syn keyword apacheOption block
+endif
+if s:av >= "002000000"
+ syn match apacheSection "<\/\=\(Proxy\|ProxyMatch\)\+.*>" contains=apacheAnything
+ syn keyword apacheDeclaration ProxyErrorOverride ProxyIOBufferSize ProxyMaxForwards ProxyPreserveHost ProxyRemoteMatch ProxyTimeout
+endif
+syn keyword apacheDeclaration RewriteEngine RewriteOptions RewriteLog RewriteLogLevel RewriteLock RewriteMap RewriteBase RewriteCond RewriteRule
+syn keyword apacheOption inherit
+if s:av < "002000000"
+ syn keyword apacheDeclaration RoamingAlias
+endif
+syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase
+syn keyword apacheDeclaration LoadFile LoadModule
+syn keyword apacheDeclaration CheckSpelling
+syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLEngine SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLRandomSeed SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLVerifyClient SSLVerifyDepth
+if s:av < "002000000"
+ syn keyword apacheDeclaration SSLLog SSLLogLevel
+endif
+if s:av >= "002000000"
+ syn keyword apacheDeclaration SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth
+endif
+syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>"
+syn keyword apacheOption builtin sem
+syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):"
+if s:av < "002000000"
+ syn match apacheOption "[+-]\?\<\(SSLv2\|SSLv3\|TLSv1\)\>"
+endif
+if s:av >= "002000000"
+ syn match apacheOption "[+-]\?\<\(SSLv2\|SSLv3\|TLSv1\|kRSA\|kHDr\|kDHd\|kEDH\|aNULL\|aRSA\|aDSS\|aRH\|eNULL\|DES\|3DES\|RC2\|RC4\|IDEA\|MD5\|SHA1\|SHA\|EXP\|EXPORT40\|EXPORT56\|LOW\|MEDIUM\|HIGH\|RSA\|DH\|EDH\|ADH\|DSS\|NULL\)\>"
+endif
+syn keyword apacheOption optional require optional_no_ca
+syn keyword apacheDeclaration ExtendedStatus
+if s:av >= "002000000"
+ syn keyword apacheDeclaration SuexecUserGroup
+endif
+syn keyword apacheDeclaration UserDir
+syn keyword apacheDeclaration CookieExpires CookieName CookieTracking
+if s:av >= "002000000"
+ syn keyword apacheDeclaration CookieDomain CookieStyle
+ syn keyword apacheOption Netscape Cookie Cookie2 RFC2109 RFC2965
+endif
+syn keyword apacheDeclaration VirtualDocumentRoot VirtualDocumentRootIP VirtualScriptAlias VirtualScriptAliasIP
+
+" Define the default highlighting
+if version >= 508 || !exists("did_apache_syntax_inits")
+ if version < 508
+ let did_apache_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink apacheAllowOverride apacheDeclaration
+ HiLink apacheAllowOverrideValue apacheOption
+ HiLink apacheAuthType apacheDeclaration
+ HiLink apacheAuthTypeValue apacheOption
+ HiLink apacheOptionOption apacheOption
+ HiLink apacheDeclaration Function
+ HiLink apacheAnything apacheOption
+ HiLink apacheOption Number
+ HiLink apacheComment Comment
+ HiLink apacheFixme Todo
+ HiLink apacheLimitSectionKeyword apacheLimitSection
+ HiLink apacheLimitSection apacheSection
+ HiLink apacheSection Label
+ HiLink apacheMethodOption Type
+ HiLink apacheAllowDeny Include
+ HiLink apacheAllowDenyValue Identifier
+ HiLink apacheOrder Special
+ HiLink apacheOrderValue String
+ HiLink apacheString String
+ HiLink apacheError Error
+ HiLink apacheUserID Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "apache"
diff --git a/runtime/syntax/apachestyle.vim b/runtime/syntax/apachestyle.vim
new file mode 100644
index 000000000..375fc70a9
--- /dev/null
+++ b/runtime/syntax/apachestyle.vim
@@ -0,0 +1,65 @@
+" Vim syntax file
+" Language: Apache-Style configuration files (proftpd.conf/apache.conf/..)
+" Maintainer: Christian Hammers <ch@westend.com>
+" URL: none
+" ChangeLog:
+" 2001-05-04,ch
+" adopted Vim 6.0 syntax style
+" 1999-10-28,ch
+" initial release
+
+" The following formats are recognised:
+" Apache-style .conf
+" # Comment
+" Option value
+" Option value1 value2
+" Option = value1 value2 #not apache but also allowed
+" <Section Name?>
+" Option value
+" <SubSection Name?>
+" </SubSection>
+" </Section>
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn match apComment /^\s*#.*$/
+syn match apOption /^\s*[^ \t#<=]*/
+"syn match apLastValue /[^ \t<=#]*$/ contains=apComment ugly
+
+" tags
+syn region apTag start=/</ end=/>/ contains=apTagOption,apTagError
+" the following should originally be " [^<>]+" but this didn't work :(
+syn match apTagOption contained / [-\/_\.:*a-zA-Z0-9]\+/ms=s+1
+syn match apTagError contained /[^>]</ms=s+1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_apachestyle_syn_inits")
+ if version < 508
+ let did_apachestyle_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink apComment Comment
+ HiLink apOption Keyword
+ "HiLink apLastValue Identifier ugly?
+ HiLink apTag Special
+ HiLink apTagOption Identifier
+ HiLink apTagError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "apachestyle"
+" vim: ts=8
diff --git a/runtime/syntax/arch.vim b/runtime/syntax/arch.vim
new file mode 100644
index 000000000..d2593fd7e
--- /dev/null
+++ b/runtime/syntax/arch.vim
@@ -0,0 +1,60 @@
+" Vim syntax file
+" Language: GNU Arch inventory file.
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/arch/
+" Latest Revision: 2004-05-22
+" arch-tag: 529d60c4-53d8-4d3a-80d6-54ada86d9932
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,_,-
+delcommand SetIsk
+
+" Todo
+syn keyword archTodo TODO FIXME XXX NOTE
+
+" Comment
+syn region archComment matchgroup=archComment start='^\%(#\|\s\)' end='$' contains=archTodo
+
+" Keywords
+syn keyword archKeyword implicit tagline explicit names
+syn keyword archKeyword untagged-source
+syn keyword archKeyword exclude junk backup precious unrecognized source skipwhite nextgroup=archRegex
+
+" Regexes
+syn match archRegex contained '\s*\zs.*'
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_arch_syn_inits")
+ if version < 508
+ let did_arch_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink archTodo Todo
+ HiLink archComment Comment
+ HiLink archKeyword Keyword
+ HiLink archRegex String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "arch"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/art.vim b/runtime/syntax/art.vim
new file mode 100644
index 000000000..c1faddb1e
--- /dev/null
+++ b/runtime/syntax/art.vim
@@ -0,0 +1,44 @@
+" Vim syntax file
+" Language: ART-IM and ART*Enterprise
+" Maintainer: Dorai Sitaram <ds26@gte.com>
+" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
+" Last Change: Nov 6, 2002
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn keyword artspform => and assert bind
+syn keyword artspform declare def-art-fun deffacts defglobal defrule defschema do
+syn keyword artspform else for if in$ not or
+syn keyword artspform progn retract salience schema test then while
+
+syn match artvariable "?[^ \t";()|&~]\+"
+
+syn match artglobalvar "?\*[^ \t";()|&~]\+\*"
+
+syn match artinstance "![^ \t";()|&~]\+"
+
+syn match delimiter "[()|&~]"
+
+syn region string start=/"/ skip=/\\[\\"]/ end=/"/
+
+syn match number "\<[-+]\=\([0-9]\+\(\.[0-9]*\)\=\|\.[0-9]\+\)\>"
+
+syn match comment ";.*$"
+
+syn match comment "#+:\=ignore" nextgroup=artignore skipwhite skipnl
+
+syn region artignore start="(" end=")" contained contains=artignore,comment
+
+syn region artignore start=/"/ skip=/\\[\\"]/ end=/"/ contained
+
+hi def link artinstance type
+hi def link artglobalvar preproc
+hi def link artignore comment
+hi def link artspform statement
+hi def link artvariable function
+
+let b:current_syntax = "art"
diff --git a/runtime/syntax/asm.vim b/runtime/syntax/asm.vim
new file mode 100644
index 000000000..09bfe4fac
--- /dev/null
+++ b/runtime/syntax/asm.vim
@@ -0,0 +1,103 @@
+" Vim syntax file
+" Language: GNU Assembler
+" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
+" Last Change: 2002 Sep 19
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+
+" storage types
+syn match asmType "\.long"
+syn match asmType "\.ascii"
+syn match asmType "\.asciz"
+syn match asmType "\.byte"
+syn match asmType "\.double"
+syn match asmType "\.float"
+syn match asmType "\.hword"
+syn match asmType "\.int"
+syn match asmType "\.octa"
+syn match asmType "\.quad"
+syn match asmType "\.short"
+syn match asmType "\.single"
+syn match asmType "\.space"
+syn match asmType "\.string"
+syn match asmType "\.word"
+
+syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
+syn match asmIdentifier "[a-z_][a-z0-9_]*"
+
+" Various #'s as defined by GAS ref manual sec 3.6.2.1
+" Technically, the first decNumber def is actually octal,
+" since the value of 0-7 octal is the same as 0-7 decimal,
+" I prefer to map it as decimal:
+syn match decNumber "0\+[1-7]\=[\t\n$,; ]"
+syn match decNumber "[1-9]\d*"
+syn match octNumber "0[0-7][0-7]\+"
+syn match hexNumber "0[xX][0-9a-fA-F]\+"
+syn match binNumber "0[bB][0-1]*"
+
+
+syn match asmSpecialComment ";\*\*\*.*"
+syn match asmComment ";.*"hs=s+1
+
+syn match asmInclude "\.include"
+syn match asmCond "\.if"
+syn match asmCond "\.else"
+syn match asmCond "\.endif"
+syn match asmMacro "\.macro"
+syn match asmMacro "\.endm"
+
+syn match asmDirective "\.[a-z][a-z]\+"
+
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_asm_syntax_inits")
+ if version < 508
+ let did_asm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink asmSection Special
+ HiLink asmLabel Label
+ HiLink asmComment Comment
+ HiLink asmDirective Statement
+
+ HiLink asmInclude Include
+ HiLink asmCond PreCondit
+ HiLink asmMacro Macro
+
+ HiLink hexNumber Number
+ HiLink decNumber Number
+ HiLink octNumber Number
+ HiLink binNumber Number
+
+ HiLink asmSpecialComment Comment
+ HiLink asmIdentifier Identifier
+ HiLink asmType Type
+
+ " My default color overrides:
+ " hi asmSpecialComment ctermfg=red
+ " hi asmIdentifier ctermfg=lightcyan
+ " hi asmType ctermbg=black ctermfg=brown
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "asm"
+
+" vim: ts=8
diff --git a/runtime/syntax/asm68k.vim b/runtime/syntax/asm68k.vim
new file mode 100644
index 000000000..8463e487e
--- /dev/null
+++ b/runtime/syntax/asm68k.vim
@@ -0,0 +1,391 @@
+" Vim syntax file
+" Language: Motorola 68000 Assembler
+" Maintainer: Steve Wall
+" Last change: 2001 May 01
+"
+" This is incomplete. In particular, support for 68020 and
+" up and 68851/68881 co-processors is partial or non-existant.
+" Feel free to contribute...
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Partial list of register symbols
+syn keyword asm68kReg a0 a1 a2 a3 a4 a5 a6 a7 d0 d1 d2 d3 d4 d5 d6 d7
+syn keyword asm68kReg pc sr ccr sp usp ssp
+
+" MC68010
+syn keyword asm68kReg vbr sfc sfcr dfc dfcr
+
+" MC68020
+syn keyword asm68kReg msp isp zpc cacr caar
+syn keyword asm68kReg za0 za1 za2 za3 za4 za5 za6 za7
+syn keyword asm68kReg zd0 zd1 zd2 zd3 zd4 zd5 zd6 zd7
+
+" MC68030
+syn keyword asm68kReg crp srp tc ac0 ac1 acusr tt0 tt1 mmusr
+
+" MC68040
+syn keyword asm68kReg dtt0 dtt1 itt0 itt1 urp
+
+" MC68851 registers
+syn keyword asm68kReg cal val scc crp srp drp tc ac psr pcsr
+syn keyword asm68kReg bac0 bac1 bac2 bac3 bac4 bac5 bac6 bac7
+syn keyword asm68kReg bad0 bad1 bad2 bad3 bad4 bad5 bad6 bad7
+
+" MC68881/82 registers
+syn keyword asm68kReg fp0 fp1 fp2 fp3 fp4 fp5 fp6 fp7
+syn keyword asm68kReg control status iaddr fpcr fpsr fpiar
+
+" M68000 opcodes - order is important!
+syn match asm68kOpcode "\<abcd\(\.b\)\=\s"
+syn match asm68kOpcode "\<adda\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<addi\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<addq\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<addx\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<add\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<andi\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<and\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<as[lr]\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<b[vc][cs]\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<beq\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bg[et]\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<b[hm]i\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bl[est]\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bne\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bpl\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bchg\(\.[bl]\)\=\s"
+syn match asm68kOpcode "\<bclr\(\.[bl]\)\=\s"
+syn match asm68kOpcode "\<bfchg\s"
+syn match asm68kOpcode "\<bfclr\s"
+syn match asm68kOpcode "\<bfexts\s"
+syn match asm68kOpcode "\<bfextu\s"
+syn match asm68kOpcode "\<bfffo\s"
+syn match asm68kOpcode "\<bfins\s"
+syn match asm68kOpcode "\<bfset\s"
+syn match asm68kOpcode "\<bftst\s"
+syn match asm68kOpcode "\<bkpt\s"
+syn match asm68kOpcode "\<bra\(\.[bwls]\)\=\s"
+syn match asm68kOpcode "\<bset\(\.[bl]\)\=\s"
+syn match asm68kOpcode "\<bsr\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<btst\(\.[bl]\)\=\s"
+syn match asm68kOpcode "\<callm\s"
+syn match asm68kOpcode "\<cas2\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<cas\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<chk2\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<chk\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<clr\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<cmpa\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<cmpi\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<cmpm\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<cmp2\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<cmp\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<db[cv][cs]\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbeq\(\.w\)\=\s"
+syn match asm68kOpcode "\<db[ft]\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbg[et]\(\.w\)\=\s"
+syn match asm68kOpcode "\<db[hm]i\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbl[est]\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbne\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbpl\(\.w\)\=\s"
+syn match asm68kOpcode "\<dbra\(\.w\)\=\s"
+syn match asm68kOpcode "\<div[su]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<div[su]l\(\.l\)\=\s"
+syn match asm68kOpcode "\<eori\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<eor\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<exg\(\.l\)\=\s"
+syn match asm68kOpcode "\<extb\(\.l\)\=\s"
+syn match asm68kOpcode "\<ext\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<illegal\>"
+syn match asm68kOpcode "\<jmp\(\.[ls]\)\=\s"
+syn match asm68kOpcode "\<jsr\(\.[ls]\)\=\s"
+syn match asm68kOpcode "\<lea\(\.l\)\=\s"
+syn match asm68kOpcode "\<link\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<ls[lr]\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<movea\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<movec\(\.l\)\=\s"
+syn match asm68kOpcode "\<movem\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<movep\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<moveq\(\.l\)\=\s"
+syn match asm68kOpcode "\<moves\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<move\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<mul[su]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<nbcd\(\.b\)\=\s"
+syn match asm68kOpcode "\<negx\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<neg\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<nop\>"
+syn match asm68kOpcode "\<not\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<ori\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<or\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<pack\s"
+syn match asm68kOpcode "\<pea\(\.l\)\=\s"
+syn match asm68kOpcode "\<reset\>"
+syn match asm68kOpcode "\<ro[lr]\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<rox[lr]\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<rt[dm]\s"
+syn match asm68kOpcode "\<rt[ers]\>"
+syn match asm68kOpcode "\<sbcd\(\.b\)\=\s"
+syn match asm68kOpcode "\<s[cv][cs]\(\.b\)\=\s"
+syn match asm68kOpcode "\<seq\(\.b\)\=\s"
+syn match asm68kOpcode "\<s[ft]\(\.b\)\=\s"
+syn match asm68kOpcode "\<sg[et]\(\.b\)\=\s"
+syn match asm68kOpcode "\<s[hm]i\(\.b\)\=\s"
+syn match asm68kOpcode "\<sl[est]\(\.b\)\=\s"
+syn match asm68kOpcode "\<sne\(\.b\)\=\s"
+syn match asm68kOpcode "\<spl\(\.b\)\=\s"
+syn match asm68kOpcode "\<suba\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<subi\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<subq\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<subx\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<sub\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<swap\(\.w\)\=\s"
+syn match asm68kOpcode "\<tas\(\.b\)\=\s"
+syn match asm68kOpcode "\<tdiv[su]\(\.l\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=[cv][cs]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=eq\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=[ft]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=g[et]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=[hm]i\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=l[est]\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=ne\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=pl\(\.[wl]\)\=\s"
+syn match asm68kOpcode "\<t\(rap\)\=v\>"
+syn match asm68kOpcode "\<t\(rap\)\=[cv][cs]\>"
+syn match asm68kOpcode "\<t\(rap\)\=eq\>"
+syn match asm68kOpcode "\<t\(rap\)\=[ft]\>"
+syn match asm68kOpcode "\<t\(rap\)\=g[et]\>"
+syn match asm68kOpcode "\<t\(rap\)\=[hm]i\>"
+syn match asm68kOpcode "\<t\(rap\)\=l[est]\>"
+syn match asm68kOpcode "\<t\(rap\)\=ne\>"
+syn match asm68kOpcode "\<t\(rap\)\=pl\>"
+syn match asm68kOpcode "\<trap\s"
+syn match asm68kOpcode "\<tst\(\.[bwl]\)\=\s"
+syn match asm68kOpcode "\<unlk\s"
+syn match asm68kOpcode "\<unpk\s"
+
+" Valid labels
+syn match asm68kLabel "^[a-z_?.][a-z0-9_?.$]*$"
+syn match asm68kLabel "^[a-z_?.][a-z0-9_?.$]*\s"he=e-1
+syn match asm68kLabel "^\s*[a-z_?.][a-z0-9_?.$]*:"he=e-1
+
+" Various number formats
+syn match hexNumber "\$[0-9a-fA-F]\+\>"
+syn match hexNumber "\<[0-9][0-9a-fA-F]*H\>"
+syn match octNumber "@[0-7]\+\>"
+syn match octNumber "\<[0-7]\+[QO]\>"
+syn match binNumber "%[01]\+\>"
+syn match binNumber "\<[01]\+B\>"
+syn match decNumber "\<[0-9]\+D\=\>"
+syn match floatE "_*E_*" contained
+syn match floatExponent "_*E_*[-+]\=[0-9]\+" contained contains=floatE
+syn match floatNumber "[-+]\=[0-9]\+_*E_*[-+]\=[0-9]\+" contains=floatExponent
+syn match floatNumber "[-+]\=[0-9]\+\.[0-9]\+\(E[-+]\=[0-9]\+\)\=" contains=floatExponent
+syn match floatNumber ":\([0-9a-f]\+_*\)\+"
+
+" Character string constants
+syn match asm68kStringError "'[ -~]*'"
+syn match asm68kStringError "'[ -~]*$"
+syn region asm68kString start="'" skip="''" end="'" oneline contains=asm68kCharError
+syn match asm68kCharError "[^ -~]" contained
+
+" Immediate data
+syn match asm68kImmediate "#\$[0-9a-fA-F]\+" contains=hexNumber
+syn match asm68kImmediate "#[0-9][0-9a-fA-F]*H" contains=hexNumber
+syn match asm68kImmediate "#@[0-7]\+" contains=octNumber
+syn match asm68kImmediate "#[0-7]\+[QO]" contains=octNumber
+syn match asm68kImmediate "#%[01]\+" contains=binNumber
+syn match asm68kImmediate "#[01]\+B" contains=binNumber
+syn match asm68kImmediate "#[0-9]\+D\=" contains=decNumber
+syn match asm68kSymbol "[a-z_?.][a-z0-9_?.$]*" contained
+syn match asm68kImmediate "#[a-z_?.][a-z0-9_?.]*" contains=asm68kSymbol
+
+" Special items for comments
+syn keyword asm68kTodo contained TODO
+
+" Operators
+syn match asm68kOperator "[-+*/]" " Must occur before Comments
+syn match asm68kOperator "\.SIZEOF\."
+syn match asm68kOperator "\.STARTOF\."
+syn match asm68kOperator "<<" " shift left
+syn match asm68kOperator ">>" " shift right
+syn match asm68kOperator "&" " bit-wise logical and
+syn match asm68kOperator "!" " bit-wise logical or
+syn match asm68kOperator "!!" " exclusive or
+syn match asm68kOperator "<>" " inequality
+syn match asm68kOperator "=" " must be before other ops containing '='
+syn match asm68kOperator ">="
+syn match asm68kOperator "<="
+syn match asm68kOperator "==" " operand existance - used in macro definitions
+
+" Condition code style operators
+syn match asm68kOperator "<[CV][CS]>"
+syn match asm68kOperator "<EQ>"
+syn match asm68kOperator "<G[TE]>"
+syn match asm68kOperator "<[HM]I>"
+syn match asm68kOperator "<L[SET]>"
+syn match asm68kOperator "<NE>"
+syn match asm68kOperator "<PL>"
+
+" Comments
+syn match asm68kComment ";.*" contains=asm68kTodo
+syn match asm68kComment "\s!.*"ms=s+1 contains=asm68kTodo
+syn match asm68kComment "^\s*[*!].*" contains=asm68kTodo
+
+" Include
+syn match asm68kInclude "\<INCLUDE\s"
+
+" Standard macros
+syn match asm68kCond "\<IF\(\.[BWL]\)\=\s"
+syn match asm68kCond "\<THEN\(\.[SL]\)\=\>"
+syn match asm68kCond "\<ELSE\(\.[SL]\)\=\>"
+syn match asm68kCond "\<ENDI\>"
+syn match asm68kCond "\<BREAK\(\.[SL]\)\=\>"
+syn match asm68kRepeat "\<FOR\(\.[BWL]\)\=\s"
+syn match asm68kRepeat "\<DOWNTO\s"
+syn match asm68kRepeat "\<TO\s"
+syn match asm68kRepeat "\<BY\s"
+syn match asm68kRepeat "\<DO\(\.[SL]\)\=\>"
+syn match asm68kRepeat "\<ENDF\>"
+syn match asm68kRepeat "\<NEXT\(\.[SL]\)\=\>"
+syn match asm68kRepeat "\<REPEAT\>"
+syn match asm68kRepeat "\<UNTIL\(\.[BWL]\)\=\s"
+syn match asm68kRepeat "\<WHILE\(\.[BWL]\)\=\s"
+syn match asm68kRepeat "\<ENDW\>"
+
+" Macro definition
+syn match asm68kMacro "\<MACRO\>"
+syn match asm68kMacro "\<LOCAL\s"
+syn match asm68kMacro "\<MEXIT\>"
+syn match asm68kMacro "\<ENDM\>"
+syn match asm68kMacroParam "\\[0-9]"
+
+" Conditional assembly
+syn match asm68kPreCond "\<IFC\s"
+syn match asm68kPreCond "\<IFDEF\s"
+syn match asm68kPreCond "\<IFEQ\s"
+syn match asm68kPreCond "\<IFGE\s"
+syn match asm68kPreCond "\<IFGT\s"
+syn match asm68kPreCond "\<IFLE\s"
+syn match asm68kPreCond "\<IFLT\s"
+syn match asm68kPreCond "\<IFNC\>"
+syn match asm68kPreCond "\<IFNDEF\s"
+syn match asm68kPreCond "\<IFNE\s"
+syn match asm68kPreCond "\<ELSEC\>"
+syn match asm68kPreCond "\<ENDC\>"
+
+" Loop control
+syn match asm68kPreCond "\<REPT\s"
+syn match asm68kPreCond "\<IRP\s"
+syn match asm68kPreCond "\<IRPC\s"
+syn match asm68kPreCond "\<ENDR\>"
+
+" Directives
+syn match asm68kDirective "\<ALIGN\s"
+syn match asm68kDirective "\<CHIP\s"
+syn match asm68kDirective "\<COMLINE\s"
+syn match asm68kDirective "\<COMMON\(\.S\)\=\s"
+syn match asm68kDirective "\<DC\(\.[BWLSDXP]\)\=\s"
+syn match asm68kDirective "\<DC\.\\[0-9]\s"me=e-3 " Special use in a macro def
+syn match asm68kDirective "\<DCB\(\.[BWLSDXP]\)\=\s"
+syn match asm68kDirective "\<DS\(\.[BWLSDXP]\)\=\s"
+syn match asm68kDirective "\<END\>"
+syn match asm68kDirective "\<EQU\s"
+syn match asm68kDirective "\<FEQU\(\.[SDXP]\)\=\s"
+syn match asm68kDirective "\<FAIL\>"
+syn match asm68kDirective "\<FOPT\s"
+syn match asm68kDirective "\<\(NO\)\=FORMAT\>"
+syn match asm68kDirective "\<IDNT\>"
+syn match asm68kDirective "\<\(NO\)\=LIST\>"
+syn match asm68kDirective "\<LLEN\s"
+syn match asm68kDirective "\<MASK2\>"
+syn match asm68kDirective "\<NAME\s"
+syn match asm68kDirective "\<NOOBJ\>"
+syn match asm68kDirective "\<OFFSET\s"
+syn match asm68kDirective "\<OPT\>"
+syn match asm68kDirective "\<ORG\(\.[SL]\)\=\>"
+syn match asm68kDirective "\<\(NO\)\=PAGE\>"
+syn match asm68kDirective "\<PLEN\s"
+syn match asm68kDirective "\<REG\s"
+syn match asm68kDirective "\<RESTORE\>"
+syn match asm68kDirective "\<SAVE\>"
+syn match asm68kDirective "\<SECT\(\.S\)\=\s"
+syn match asm68kDirective "\<SECTION\(\.S\)\=\s"
+syn match asm68kDirective "\<SET\s"
+syn match asm68kDirective "\<SPC\s"
+syn match asm68kDirective "\<TTL\s"
+syn match asm68kDirective "\<XCOM\s"
+syn match asm68kDirective "\<XDEF\s"
+syn match asm68kDirective "\<XREF\(\.S\)\=\s"
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_asm68k_syntax_inits")
+ if version < 508
+ let did_asm68k_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ " Comment Constant Error Identifier PreProc Special Statement Todo Type
+ "
+ " Constant Boolean Character Number String
+ " Identifier Function
+ " PreProc Define Include Macro PreCondit
+ " Special Debug Delimiter SpecialChar SpecialComment Tag
+ " Statement Conditional Exception Keyword Label Operator Repeat
+ " Type StorageClass Structure Typedef
+
+ HiLink asm68kComment Comment
+ HiLink asm68kTodo Todo
+
+ HiLink hexNumber Number " Constant
+ HiLink octNumber Number " Constant
+ HiLink binNumber Number " Constant
+ HiLink decNumber Number " Constant
+ HiLink floatNumber Number " Constant
+ HiLink floatExponent Number " Constant
+ HiLink floatE SpecialChar " Statement
+ "HiLink floatE Number " Constant
+
+ HiLink asm68kImmediate SpecialChar " Statement
+ "HiLink asm68kSymbol Constant
+
+ HiLink asm68kString String " Constant
+ HiLink asm68kCharError Error
+ HiLink asm68kStringError Error
+
+ HiLink asm68kReg Identifier
+ HiLink asm68kOperator Identifier
+
+ HiLink asm68kInclude Include " PreProc
+ HiLink asm68kMacro Macro " PreProc
+ HiLink asm68kMacroParam Keyword " Statement
+
+ HiLink asm68kDirective Special
+ HiLink asm68kPreCond Special
+
+
+ HiLink asm68kOpcode Statement
+ HiLink asm68kCond Conditional " Statement
+ HiLink asm68kRepeat Repeat " Statement
+
+ HiLink asm68kLabel Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "asm68k"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/asmh8300.vim b/runtime/syntax/asmh8300.vim
new file mode 100644
index 000000000..48699d89c
--- /dev/null
+++ b/runtime/syntax/asmh8300.vim
@@ -0,0 +1,85 @@
+" Vim syntax file
+" Language: Hitachi H-8300h specific syntax for GNU Assembler
+" Maintainer: Kevin Dahlhausen <kdahlhaus@yahoo.com>
+" Last Change: 2002 Sep 19
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn match asmDirective "\.h8300[h]*"
+
+"h8300[h] registers
+syn match asmReg "e\=r[0-7][lh]\="
+
+"h8300[h] opcodes - order is important!
+syn match asmOpcode "add\.[lbw]"
+syn match asmOpcode "add[sx :]"
+syn match asmOpcode "and\.[lbw]"
+syn match asmOpcode "bl[deots]"
+syn match asmOpcode "cmp\.[lbw]"
+syn match asmOpcode "dec\.[lbw]"
+syn match asmOpcode "divx[us].[bw]"
+syn match asmOpcode "ext[su]\.[lw]"
+syn match asmOpcode "inc\.[lw]"
+syn match asmOpcode "mov\.[lbw]"
+syn match asmOpcode "mulx[su]\.[bw]"
+syn match asmOpcode "neg\.[lbw]"
+syn match asmOpcode "not\.[lbw]"
+syn match asmOpcode "or\.[lbw]"
+syn match asmOpcode "pop\.[wl]"
+syn match asmOpcode "push\.[wl]"
+syn match asmOpcode "rotx\=[lr]\.[lbw]"
+syn match asmOpcode "sha[lr]\.[lbw]"
+syn match asmOpcode "shl[lr]\.[lbw]"
+syn match asmOpcode "sub\.[lbw]"
+syn match asmOpcode "xor\.[lbw]"
+syn keyword asmOpcode "andc" "band" "bcc" "bclr" "bcs" "beq" "bf" "bge" "bgt"
+syn keyword asmOpcode "bhi" "bhs" "biand" "bild" "bior" "bist" "bixor" "bmi"
+syn keyword asmOpcode "bne" "bnot" "bnp" "bor" "bpl" "bpt" "bra" "brn" "bset"
+syn keyword asmOpcode "bsr" "btst" "bst" "bt" "bvc" "bvs" "bxor" "cmp" "daa"
+syn keyword asmOpcode "das" "eepmov" "eepmovw" "inc" "jmp" "jsr" "ldc" "movfpe"
+syn keyword asmOpcode "movtpe" "mov" "nop" "orc" "rte" "rts" "sleep" "stc"
+syn keyword asmOpcode "sub" "trapa" "xorc"
+
+syn case match
+
+
+" Read the general asm syntax
+if version < 600
+ source <sfile>:p:h/asm.vim
+else
+ runtime! syntax/asm.vim
+endif
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_hitachi_syntax_inits")
+ if version < 508
+ let did_hitachi_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink asmOpcode Statement
+ HiLink asmRegister Identifier
+
+ " My default-color overrides:
+ "hi asmOpcode ctermfg=yellow
+ "hi asmReg ctermfg=lightmagenta
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "asmh8300"
+
+" vim: ts=8
diff --git a/runtime/syntax/asn.vim b/runtime/syntax/asn.vim
new file mode 100644
index 000000000..9fc3d2468
--- /dev/null
+++ b/runtime/syntax/asn.vim
@@ -0,0 +1,81 @@
+" Vim syntax file
+" Language: ASN.1
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/asn.vim
+" Last Change: 2001 Apr 26
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" keyword definitions
+syn keyword asnExternal DEFINITIONS BEGIN END IMPORTS EXPORTS FROM
+syn match asnExternal "\<IMPLICIT\s\+TAGS\>"
+syn match asnExternal "\<EXPLICIT\s\+TAGS\>"
+syn keyword asnFieldOption DEFAULT OPTIONAL
+syn keyword asnTagModifier IMPLICIT EXPLICIT
+syn keyword asnTypeInfo ABSENT PRESENT SIZE UNIVERSAL APPLICATION PRIVATE
+syn keyword asnBoolValue TRUE FALSE
+syn keyword asnNumber MIN MAX
+syn match asnNumber "\<PLUS-INFINITY\>"
+syn match asnNumber "\<MINUS-INFINITY\>"
+syn keyword asnType INTEGER REAL STRING BIT BOOLEAN OCTET NULL EMBEDDED PDV
+syn keyword asnType BMPString IA5String TeletexString GeneralString GraphicString ISO646String NumericString PrintableString T61String UniversalString VideotexString VisibleString
+syn keyword asnType ANY DEFINED
+syn match asnType "\.\.\."
+syn match asnType "OBJECT\s\+IDENTIFIER"
+syn match asnType "TYPE-IDENTIFIER"
+syn keyword asnType UTF8String
+syn keyword asnStructure CHOICE SEQUENCE SET OF ENUMERATED CONSTRAINED BY WITH COMPONENTS CLASS
+
+" Strings and constants
+syn match asnSpecial contained "\\\d\d\d\|\\."
+syn region asnString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=asnSpecial
+syn match asnCharacter "'[^\\]'"
+syn match asnSpecialCharacter "'\\.'"
+syn match asnNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn match asnLineComment "--.*"
+syn match asnLineComment "--.*--"
+
+syn match asnDefinition "^\s*[a-zA-Z][-a-zA-Z0-9_.\[\] \t{}]* *::="me=e-3 contains=asnType
+syn match asnBraces "[{}]"
+
+syn sync ccomment asnComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_asn_syn_inits")
+ if version < 508
+ let did_asn_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink asnDefinition Function
+ HiLink asnBraces Function
+ HiLink asnStructure Statement
+ HiLink asnBoolValue Boolean
+ HiLink asnSpecial Special
+ HiLink asnString String
+ HiLink asnCharacter Character
+ HiLink asnSpecialCharacter asnSpecial
+ HiLink asnNumber asnValue
+ HiLink asnComment Comment
+ HiLink asnLineComment asnComment
+ HiLink asnType Type
+ HiLink asnTypeInfo PreProc
+ HiLink asnValue Number
+ HiLink asnExternal Include
+ HiLink asnTagModifier Function
+ HiLink asnFieldOption Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "asn"
+
+" vim: ts=8
diff --git a/runtime/syntax/aspperl.vim b/runtime/syntax/aspperl.vim
new file mode 100644
index 000000000..0f7ef4687
--- /dev/null
+++ b/runtime/syntax/aspperl.vim
@@ -0,0 +1,33 @@
+" Vim syntax file
+" Language: Active State's PerlScript (ASP)
+" Maintainer: Aaron Hope <edh@brioforge.com>
+" URL: http://nim.dhs.org/~edh/aspperl.vim
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'perlscript'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+ syn include @AspPerlScript <sfile>:p:h/perl.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+ syn include @AspPerlScript syntax/perl.vim
+endif
+
+syn cluster htmlPreproc add=AspPerlScriptInsideHtmlTags
+
+syn region AspPerlScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%=\=+ skip=+".*%>.*"+ end=+%>+ contains=@AspPerlScript
+syn region AspPerlScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<script\s\+language="\=perlscript"\=[^>]*>+ end=+</script>+ contains=@AspPerlScript
+
+let b:current_syntax = "aspperl"
diff --git a/runtime/syntax/aspvbs.vim b/runtime/syntax/aspvbs.vim
new file mode 100644
index 000000000..502791c75
--- /dev/null
+++ b/runtime/syntax/aspvbs.vim
@@ -0,0 +1,196 @@
+" Vim syntax file
+" Language: Microsoft VBScript Web Content (ASP)
+" Maintainer: Devin Weaver <ktohg@tritarget.com>
+" URL: http://tritarget.com/pub/vim/syntax/aspvbs.vim
+" Last Change: 2003 Apr 25
+" Version: $Revision$
+" Thanks to Jay-Jay <vim@jay-jay.net> for a syntax sync hack, hungarian
+" notation, and extra highlighting.
+" Thanks to patrick dehne <patrick@steidle.net> for the folding code.
+" Thanks to Dean Hall <hall@apt7.com> for testing the use of classes in
+" VBScripts which I've been too scared to do.
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'aspvbs'
+endif
+
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+unlet b:current_syntax
+
+syn cluster htmlPreProc add=AspVBScriptInsideHtmlTags
+
+
+" Colored variable names, if written in hungarian notation
+hi def AspVBSVariableSimple term=standout ctermfg=3 guifg=#99ee99
+hi def AspVBSVariableComplex term=standout ctermfg=3 guifg=#ee9900
+syn match AspVBSVariableSimple contained "\<\(bln\|byt\|dtm\=\|dbl\|int\|str\)\u\w*"
+syn match AspVBSVariableComplex contained "\<\(arr\|obj\)\u\w*"
+
+
+" Functions and methods that are in VB but will cause errors in an ASP page
+" This is helpfull if your porting VB code to ASP
+" I removed (Count, Item) because these are common variable names in AspVBScript
+syn keyword AspVBSError contained Val Str CVar CVDate DoEvents GoSub Return GoTo
+syn keyword AspVBSError contained Stop LinkExecute Add Type LinkPoke
+syn keyword AspVBSError contained LinkRequest LinkSend Declare Optional Sleep
+syn keyword AspVBSError contained ParamArray Static Erl TypeOf Like LSet RSet Mid StrConv
+" It may seem that most of these can fit into a keyword clause but keyword takes
+" priority over all so I can't get the multi-word matches
+syn match AspVBSError contained "\<Def[a-zA-Z0-9_]\+\>"
+syn match AspVBSError contained "^\s*Open\s\+"
+syn match AspVBSError contained "Debug\.[a-zA-Z0-9_]*"
+syn match AspVBSError contained "^\s*[a-zA-Z0-9_]\+:"
+syn match AspVBSError contained "[a-zA-Z0-9_]\+![a-zA-Z0-9_]\+"
+syn match AspVBSError contained "^\s*#.*$"
+syn match AspVBSError contained "\<As\s\+[a-zA-Z0-9_]*"
+syn match AspVBSError contained "\<End\>\|\<Exit\>"
+syn match AspVBSError contained "\<On\s\+Error\>\|\<On\>\|\<Error\>\|\<Resume\s\+Next\>\|\<Resume\>"
+syn match AspVBSError contained "\<Option\s\+\(Base\|Compare\|Private\s\+Module\)\>"
+" This one I want 'cause I always seem to mis-spell it.
+syn match AspVBSError contained "Respon\?ce\.\S*"
+syn match AspVBSError contained "Respose\.\S*"
+" When I looked up the VBScript syntax it mentioned that Property Get/Set/Let
+" statements are illegal, however, I have recived reports that they do work.
+" So I commented it out for now.
+" syn match AspVBSError contained "\<Property\s\+\(Get\|Let\|Set\)\>"
+
+" AspVBScript Reserved Words.
+syn match AspVBSStatement contained "\<On\s\+Error\s\+\(Resume\s\+Next\|goto\s\+0\)\>\|\<Next\>"
+syn match AspVBSStatement contained "\<End\s\+\(If\|For\|Select\|Class\|Function\|Sub\|With\)\>"
+syn match AspVBSStatement contained "\<Exit\s\+\(Do\|For\|Sub\|Function\)\>"
+syn match AspVBSStatement contained "\<Option\s\+Explicit\>"
+syn match AspVBSStatement contained "\<For\s\+Each\>\|\<For\>"
+syn match AspVBSStatement contained "\<Set\>"
+syn keyword AspVBSStatement contained Call Class Const Default Dim Do Loop Erase And
+syn keyword AspVBSStatement contained Function If Then Else ElseIf Or
+syn keyword AspVBSStatement contained Private Public Randomize ReDim
+syn keyword AspVBSStatement contained Select Case Sub While With Wend Not
+
+" AspVBScript Functions
+syn keyword AspVBSFunction contained Abs Array Asc Atn CBool CByte CCur CDate CDbl
+syn keyword AspVBSFunction contained Chr CInt CLng Cos CreateObject CSng CStr Date
+syn keyword AspVBSFunction contained DateAdd DateDiff DatePart DateSerial DateValue
+syn keyword AspVBSFunction contained Date Day Exp Filter Fix FormatCurrency
+syn keyword AspVBSFunction contained FormatDateTime FormatNumber FormatPercent
+syn keyword AspVBSFunction contained GetObject Hex Hour InputBox InStr InStrRev Int
+syn keyword AspVBSFunction contained IsArray IsDate IsEmpty IsNull IsNumeric
+syn keyword AspVBSFunction contained IsObject Join LBound LCase Left Len LoadPicture
+syn keyword AspVBSFunction contained Log LTrim Mid Minute Month MonthName MsgBox Now
+syn keyword AspVBSFunction contained Oct Replace RGB Right Rnd Round RTrim
+syn keyword AspVBSFunction contained ScriptEngine ScriptEngineBuildVersion
+syn keyword AspVBSFunction contained ScriptEngineMajorVersion
+syn keyword AspVBSFunction contained ScriptEngineMinorVersion Second Sgn Sin Space
+syn keyword AspVBSFunction contained Split Sqr StrComp StrReverse String Tan Time Timer
+syn keyword AspVBSFunction contained TimeSerial TimeValue Trim TypeName UBound UCase
+syn keyword AspVBSFunction contained VarType Weekday WeekdayName Year
+
+" AspVBScript Methods
+syn keyword AspVBSMethods contained Add AddFolders BuildPath Clear Close Copy
+syn keyword AspVBSMethods contained CopyFile CopyFolder CreateFolder CreateTextFile
+syn keyword AspVBSMethods contained Delete DeleteFile DeleteFolder DriveExists
+syn keyword AspVBSMethods contained Exists FileExists FolderExists
+syn keyword AspVBSMethods contained GetAbsolutePathName GetBaseName GetDrive
+syn keyword AspVBSMethods contained GetDriveName GetExtensionName GetFile
+syn keyword AspVBSMethods contained GetFileName GetFolder GetParentFolderName
+syn keyword AspVBSMethods contained GetSpecialFolder GetTempName Items Keys Move
+syn keyword AspVBSMethods contained MoveFile MoveFolder OpenAsTextStream
+syn keyword AspVBSMethods contained OpenTextFile Raise Read ReadAll ReadLine Remove
+syn keyword AspVBSMethods contained RemoveAll Skip SkipLine Write WriteBlankLines
+syn keyword AspVBSMethods contained WriteLine
+syn match AspVBSMethods contained "Response\.\S*"
+" Colorize boolean constants:
+syn keyword AspVBSMethods contained true false
+
+" AspVBScript Number Contstants
+" Integer number, or floating point number without a dot.
+syn match AspVBSNumber contained "\<\d\+\>"
+" Floating point number, with dot
+syn match AspVBSNumber contained "\<\d\+\.\d*\>"
+" Floating point number, starting with a dot
+syn match AspVBSNumber contained "\.\d\+\>"
+
+" String and Character Contstants
+" removed (skip=+\\\\\|\\"+) because VB doesn't have backslash escaping in
+" strings (or does it?)
+syn region AspVBSString contained start=+"+ end=+"+ keepend
+
+" AspVBScript Comments
+syn region AspVBSComment contained start="^REM\s\|\sREM\s" end="$" contains=AspVBSTodo keepend
+syn region AspVBSComment contained start="^'\|\s'" end="$" contains=AspVBSTodo keepend
+" misc. Commenting Stuff
+syn keyword AspVBSTodo contained TODO FIXME
+
+" Cosmetic syntax errors commanly found in VB but not in AspVBScript
+" AspVBScript doesn't use line numbers
+syn region AspVBSError contained start="^\d" end="\s" keepend
+" AspVBScript also doesn't have type defining variables
+syn match AspVBSError contained "[a-zA-Z0-9_][\$&!#]"ms=s+1
+" Since 'a%' is a VB variable with a type and in AspVBScript you can have 'a%>'
+" I have to make a special case so 'a%>' won't show as an error.
+syn match AspVBSError contained "[a-zA-Z0-9_]%\($\|[^>]\)"ms=s+1
+
+" Top Cluster
+syn cluster AspVBScriptTop contains=AspVBSStatement,AspVBSFunction,AspVBSMethods,AspVBSNumber,AspVBSString,AspVBSComment,AspVBSError,AspVBSVariableSimple,AspVBSVariableComplex
+
+" Folding
+syn region AspVBSFold start="^\s*\(class\)\s\+.*$" end="^\s*end\s\+\(class\)\>.*$" fold contained transparent keepend
+syn region AspVBSFold start="^\s*\(private\|public\)\=\(\s\+default\)\=\s\+\(sub\|function\)\s\+.*$" end="^\s*end\s\+\(function\|sub\)\>.*$" fold contained transparent keepend
+
+" Define AspVBScript delimeters
+" <%= func("string_with_%>_in_it") %> This is illegal in ASP syntax.
+syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<%=\=+ end=+%>+ contains=@AspVBScriptTop, AspVBSFold
+syn region AspVBScriptInsideHtmlTags keepend matchgroup=Delimiter start=+<script\s\+language="\=vbscript"\=[^>]*\s\+runatserver[^>]*>+ end=+</script>+ contains=@AspVBScriptTop
+
+
+" Synchronization
+" syn sync match AspVBSSyncGroup grouphere AspVBScriptInsideHtmlTags "<%"
+" This is a kludge so the HTML will sync properly
+syn sync match htmlHighlight grouphere htmlTag "%>"
+
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_aspvbs_syn_inits")
+ if version < 508
+ let did_aspvbs_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ "HiLink AspVBScript Special
+ HiLink AspVBSLineNumber Comment
+ HiLink AspVBSNumber Number
+ HiLink AspVBSError Error
+ HiLink AspVBSStatement Statement
+ HiLink AspVBSString String
+ HiLink AspVBSComment Comment
+ HiLink AspVBSTodo Todo
+ HiLink AspVBSFunction Identifier
+ HiLink AspVBSMethods PreProc
+ HiLink AspVBSEvents Special
+ HiLink AspVBSTypeSpecifier Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "aspvbs"
+
+if main_syntax == 'aspvbs'
+ unlet main_syntax
+endif
+
+" vim: ts=8:sw=2:sts=0:noet
diff --git a/runtime/syntax/atlas.vim b/runtime/syntax/atlas.vim
new file mode 100644
index 000000000..b8fe4356b
--- /dev/null
+++ b/runtime/syntax/atlas.vim
@@ -0,0 +1,98 @@
+" Vim syntax file
+" Language: ATLAS
+" Maintainer: Inaki Saez <jisaez@sfe.indra.es>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn keyword atlasStatement begin terminate
+syn keyword atlasStatement fill calculate compare
+syn keyword atlasStatement setup connect close open disconnect reset
+syn keyword atlasStatement initiate read fetch
+syn keyword atlasStatement apply measure verify remove
+syn keyword atlasStatement perform leave finish output delay
+syn keyword atlasStatement prepare execute
+syn keyword atlasStatement do
+syn match atlasStatement "\<go[ ]\+to\>"
+syn match atlasStatement "\<wait[ ]\+for\>"
+
+syn keyword atlasInclude include
+syn keyword atlasDefine define require declare identify
+
+"syn keyword atlasReserved true false go nogo hi lo via
+syn keyword atlasReserved true false
+
+syn keyword atlasStorageClass external global
+
+syn keyword atlasConditional if then else end
+syn keyword atlasRepeat while for thru
+
+" Flags BEF and statement number
+syn match atlasSpecial "^[BE ][ 0-9]\{,6}\>"
+
+" Number formats
+syn match atlasHexNumber "\<X'[0-9A-F]\+'"
+syn match atlasOctalNumber "\<O'[0-7]\+'"
+syn match atlasBinNumber "\<B'[01]\+'"
+syn match atlasNumber "\<\d\+\>"
+"Floating point number part only
+syn match atlasDecimalNumber "\.\d\+\([eE][-+]\=\d\)\=\>"
+
+syn region atlasFormatString start=+((+ end=+\())\)\|\()[ ]*\$\)+me=e-1
+syn region atlasString start=+\<C'+ end=+'+ oneline
+
+syn region atlasComment start=+^C+ end=+\$+
+syn region atlasComment2 start=+\$.\++ms=s+1 end=+$+ oneline
+
+syn match atlasIdentifier "'[A-Za-z0-9 ._-]\+'"
+
+"Synchronization with Statement terminator $
+syn sync match atlasTerminator grouphere atlasComment "^C"
+syn sync match atlasTerminator groupthere NONE "\$"
+syn sync maxlines=100
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_atlas_syntax_inits")
+ if version < 508
+ let did_atlas_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink atlasConditional Conditional
+ HiLink atlasRepeat Repeat
+ HiLink atlasStatement Statement
+ HiLink atlasNumber Number
+ HiLink atlasHexNumber Number
+ HiLink atlasOctalNumber Number
+ HiLink atlasBinNumber Number
+ HiLink atlasDecimalNumber Float
+ HiLink atlasFormatString String
+ HiLink atlasString String
+ HiLink atlasComment Comment
+ HiLink atlasComment2 Comment
+ HiLink atlasInclude Include
+ HiLink atlasDefine Macro
+ HiLink atlasReserved PreCondit
+ HiLink atlasStorageClass StorageClass
+ HiLink atlasIdentifier NONE
+ HiLink atlasSpecial Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "atlas"
+
+" vim: ts=8
diff --git a/runtime/syntax/automake.vim b/runtime/syntax/automake.vim
new file mode 100644
index 000000000..ea09927e2
--- /dev/null
+++ b/runtime/syntax/automake.vim
@@ -0,0 +1,79 @@
+" Vim syntax file
+" Language: automake Makefile.am
+" Maintainer: John Williams <jrw@pobox.com>
+" Last change: 2001 May 09
+
+
+" This script adds support for automake's Makefile.am format. It highlights
+" Makefile variables significant to automake as well as highlighting
+" autoconf-style @variable@ substitutions . Subsitutions are marked as errors
+" when they are used in an inappropriate place, such as in defining
+" EXTRA_SOURCES.
+
+
+" Read the Makefile syntax to start with
+if version < 600
+ source <sfile>:p:h/make.vim
+else
+ runtime! syntax/make.vim
+endif
+
+syn match automakePrimary "^[A-Za-z0-9_]\+\(_PROGRAMS\|LIBRARIES\|_LIST\|_SCRIPTS\|_DATA\|_HEADERS\|_MANS\|_TEXINFOS\|_JAVA\|_LTLIBRARIES\)\s*="me=e-1
+syn match automakePrimary "^TESTS\s*="me=e-1
+syn match automakeSecondary "^[A-Za-z0-9_]\+\(_SOURCES\|_LDADD\|_LIBADD\|_LDFLAGS\|_DEPENDENCIES\)\s*="me=e-1
+syn match automakeSecondary "^OMIT_DEPENDENCIES\s*="me=e-1
+syn match automakeExtra "^EXTRA_[A-Za-z0-9_]\+\s*="me=e-1
+syn match automakeOptions "^\(AUTOMAKE_OPTIONS\|ETAGS_ARGS\|TAGS_DEPENDENCIES\)\s*="me=e-1
+syn match automakeClean "^\(MOSTLY\|DIST\|MAINTAINER\)\=CLEANFILES\s*="me=e-1
+syn match automakeSubdirs "^\(DIST_\)\=SUBDIRS\s*="me=e-1
+syn match automakeConditional "^\(if\s*[a-zA-Z0-9_]\+\|else\|endif\)\s*$"
+
+syn match automakeSubst "@[a-zA-Z0-9_]\+@"
+syn match automakeSubst "^\s*@[a-zA-Z0-9_]\+@"
+syn match automakeComment1 "#.*$" contains=automakeSubst
+syn match automakeComment2 "##.*$"
+
+syn match automakeMakeError "$[{(][^})]*[^a-zA-Z0-9_})][^})]*[})]" " GNU make function call
+
+syn region automakeNoSubst start="^EXTRA_[a-zA-Z0-9_]*\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent
+syn region automakeNoSubst start="^DIST_SUBDIRS\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent
+syn region automakeNoSubst start="^[a-zA-Z0-9_]*_SOURCES\s*=" end="$" contains=ALLBUT,automakeNoSubst transparent
+syn match automakeBadSubst "@\([a-zA-Z0-9_]*@\=\)\=" contained
+
+syn region automakeMakeDString start=+"+ skip=+\\"+ end=+"+ contains=makeIdent,automakeSubstitution
+syn region automakeMakeSString start=+'+ skip=+\\'+ end=+'+ contains=makeIdent,automakeSubstitution
+syn region automakeMakeBString start=+`+ skip=+\\`+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine,automakeSubstitution
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_automake_syntax_inits")
+ if version < 508
+ let did_automake_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink automakePrimary Statement
+ HiLink automakeSecondary Type
+ HiLink automakeExtra Special
+ HiLink automakeOptions Special
+ HiLink automakeClean Special
+ HiLink automakeSubdirs Statement
+ HiLink automakeConditional PreProc
+ HiLink automakeSubst PreProc
+ HiLink automakeComment1 makeComment
+ HiLink automakeComment2 makeComment
+ HiLink automakeMakeError makeError
+ HiLink automakeBadSubst makeError
+ HiLink automakeMakeDString makeDString
+ HiLink automakeMakeSString makeSString
+ HiLink automakeMakeBString makeBString
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "automake"
+
+" vi: ts=8 sw=4 sts=4
diff --git a/runtime/syntax/ave.vim b/runtime/syntax/ave.vim
new file mode 100644
index 000000000..2a0a9d85a
--- /dev/null
+++ b/runtime/syntax/ave.vim
@@ -0,0 +1,92 @@
+" Vim syntax file
+" Copyright by Jan-Oliver Wagner
+" Language: avenue
+" Maintainer: Jan-Oliver Wagner <Jan-Oliver.Wagner@intevation.de>
+" Last change: 2001 May 10
+
+" Avenue is the ArcView built-in language. ArcView is
+" a desktop GIS by ESRI. Though it is a built-in language
+" and a built-in editor is provided, the use of VIM increases
+" development speed.
+" I use some technologies to automatically load avenue scripts
+" into ArcView.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Avenue is entirely case-insensitive.
+syn case ignore
+
+" The keywords
+
+syn keyword aveStatement if then elseif else end break exit return
+syn keyword aveStatement for each in continue while
+
+" String
+
+syn region aveString start=+"+ end=+"+
+
+" Integer number
+syn match aveNumber "[+-]\=\<[0-9]\+\>"
+
+" Operator
+
+syn keyword aveOperator or and max min xor mod by
+" 'not' is a kind of a problem: Its an Operator as well as a method
+" 'not' is only marked as an Operator if not applied as method
+syn match aveOperator "[^\.]not[^a-zA-Z]"
+
+" Variables
+
+syn keyword aveFixVariables av nil self false true nl tab cr tab
+syn match globalVariables "_[a-zA-Z][a-zA-Z0-9]*"
+syn match aveVariables "[a-zA-Z][a-zA-Z0-9_]*"
+syn match aveConst "#[A-Z][A-Z_]+"
+
+" Comments
+
+syn match aveComment "'.*"
+
+" Typical Typos
+
+" for C programmers:
+syn match aveTypos "=="
+syn match aveTypos "!="
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting+yet
+if version >= 508 || !exists("did_ave_syn_inits")
+ if version < 508
+ let did_ave_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink aveStatement Statement
+
+ HiLink aveString String
+ HiLink aveNumber Number
+
+ HiLink aveFixVariables Special
+ HiLink aveVariables Identifier
+ HiLink globalVariables Special
+ HiLink aveConst Special
+
+ HiLink aveClassMethods Function
+
+ HiLink aveOperator Operator
+ HiLink aveComment Comment
+
+ HiLink aveTypos Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ave"
diff --git a/runtime/syntax/awk.vim b/runtime/syntax/awk.vim
new file mode 100644
index 000000000..00a689d46
--- /dev/null
+++ b/runtime/syntax/awk.vim
@@ -0,0 +1,216 @@
+" Vim syntax file
+" Language: awk, nawk, gawk, mawk
+" Maintainer: Antonio Colombo <antonio.colombo@jrc.it>
+" Last Change: 2002 Jun 23
+
+" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
+" The AWK Programming Language, Addison-Wesley, 1988
+
+" GAWK ref. is: Arnold D. Robbins
+" Effective AWK Programming, Third Edition, O'Reilly, 2001
+
+" MAWK is a "new awk" meaning it implements AWK ref.
+" mawk conforms to the Posix 1003.2 (draft 11.3)
+" definition of the AWK language which contains a few features
+" not described in the AWK book, and mawk provides a small number of extensions.
+
+" TODO:
+" Dig into the commented out syntax expressions below.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful Awk keywords
+" AWK ref. p. 188
+syn keyword awkStatement break continue delete exit
+syn keyword awkStatement function getline next
+syn keyword awkStatement print printf return
+" GAWK ref. p. 117
+syn keyword awkStatement nextfile
+" AWK ref. p. 42, GAWK ref. p. 142-166
+syn keyword awkFunction atan2 close cos exp fflush int log rand sin sqrt srand
+syn keyword awkFunction gsub index length match split sprintf sub
+syn keyword awkFunction substr system
+" GAWK ref. p. 142-166
+syn keyword awkFunction asort gensub mktime strftime strtonum systime
+syn keyword awkFunction tolower toupper
+syn keyword awkFunction and or xor compl lshift rshift
+syn keyword awkFunction dcgettext bindtextdomain
+
+syn keyword awkConditional if else
+syn keyword awkRepeat while for
+
+syn keyword awkTodo contained TODO
+
+syn keyword awkPatterns BEGIN END
+" AWK ref. p. 36
+syn keyword awkVariables ARGC ARGV FILENAME FNR FS NF NR
+syn keyword awkVariables OFMT OFS ORS RLENGTH RS RSTART SUBSEP
+" GAWK ref. p. 120-126
+syn keyword awkVariables ARGIND BINMODE CONVFMT ENVIRON ERRNO
+syn keyword awkVariables FIELDWIDTHS IGNORECASE LINT PROCINFO
+syn keyword awkVariables RT RLENGTH TEXTDOMAIN
+
+syn keyword awkRepeat do
+
+" Octal format character.
+syn match awkSpecialCharacter display contained "\\[0-7]\{1,3\}"
+syn keyword awkStatement func nextfile
+" Hex format character.
+syn match awkSpecialCharacter display contained "\\x[0-9A-Fa-f]\+"
+
+syn match awkFieldVars "\$\d\+"
+
+"catch errors caused by wrong parenthesis
+syn region awkParen transparent start="(" end=")" contains=ALLBUT,awkParenError,awkSpecialCharacter,awkArrayElement,awkArrayArray,awkTodo,awkRegExp,awkBrktRegExp,awkBrackets,awkCharClass
+syn match awkParenError display ")"
+syn match awkInParen display contained "[{}]"
+
+" 64 lines for complex &&'s, and ||'s in a big "if"
+syn sync ccomment awkParen maxlines=64
+
+" Search strings & Regular Expressions therein.
+syn region awkSearch oneline start="^[ \t]*/"ms=e start="\(,\|!\=\~\)[ \t]*/"ms=e skip="\\\\\|\\/" end="/" contains=awkBrackets,awkRegExp,awkSpecialCharacter
+syn region awkBrackets contained start="\[\^\]\="ms=s+2 start="\[[^\^]"ms=s+1 end="\]"me=e-1 contains=awkBrktRegExp,awkCharClass
+syn region awkSearch oneline start="[ \t]*/"hs=e skip="\\\\\|\\/" end="/" contains=awkBrackets,awkRegExp,awkSpecialCharacter
+
+syn match awkCharClass contained "\[:[^:\]]*:\]"
+syn match awkBrktRegExp contained "\\.\|.\-[^]]"
+syn match awkRegExp contained "/\^"ms=s+1
+syn match awkRegExp contained "\$/"me=e-1
+syn match awkRegExp contained "[?.*{}|+]"
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn region awkString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=awkSpecialCharacter,awkSpecialPrintf
+syn match awkSpecialCharacter contained "\\."
+
+" Some of these combinations may seem weird, but they work.
+syn match awkSpecialPrintf contained "%[-+ #]*\d*\.\=\d*[cdefgiosuxEGX%]"
+
+" Numbers, allowing signs (both -, and +)
+" Integer number.
+syn match awkNumber display "[+-]\=\<\d\+\>"
+" Floating point number.
+syn match awkFloat display "[+-]\=\<\d\+\.\d+\>"
+" Floating point number, starting with a dot.
+syn match awkFloat display "[+-]\=\<.\d+\>"
+syn case ignore
+"floating point number, with dot, optional exponent
+syn match awkFloat display "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match awkFloat display "\.\d\+\(e[-+]\=\d\+\)\=\>"
+"floating point number, without dot, with exponent
+syn match awkFloat display "\<\d\+e[-+]\=\d\+\>"
+syn case match
+
+"syn match awkIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
+
+" Arithmetic operators: +, and - take care of ++, and --
+"syn match awkOperator "+\|-\|\*\|/\|%\|="
+"syn match awkOperator "+=\|-=\|\*=\|/=\|%="
+"syn match awkOperator "^\|^="
+
+" Comparison expressions.
+"syn match awkExpression "==\|>=\|=>\|<=\|=<\|\!="
+"syn match awkExpression "\~\|\!\~"
+"syn match awkExpression "?\|:"
+"syn keyword awkExpression in
+
+" Boolean Logic (OR, AND, NOT)
+"syn match awkBoolLogic "||\|&&\|\!"
+
+" This is overridden by less-than & greater-than.
+" Put this above those to override them.
+" Put this in a 'match "\<printf\=\>.*;\="' to make it not override
+" less/greater than (most of the time), but it won't work yet because
+" keywords allways have precedence over match & region.
+" File I/O: (print foo, bar > "filename") & for nawk (getline < "filename")
+"syn match awkFileIO contained ">"
+"syn match awkFileIO contained "<"
+
+" Expression separators: ';' and ','
+syn match awkSemicolon ";"
+syn match awkComma ","
+
+syn match awkComment "#.*" contains=awkTodo
+
+syn match awkLineSkip "\\$"
+
+" Highlight array element's (recursive arrays allowed).
+" Keeps nested array names' separate from normal array elements.
+" Keeps numbers separate from normal array elements (variables).
+syn match awkArrayArray contained "[^][, \t]\+\["me=e-1
+syn match awkArrayElement contained "[^][, \t]\+"
+syn region awkArray transparent start="\[" end="\]" contains=awkArray,awkArrayElement,awkArrayArray,awkNumber,awkFloat
+
+" 10 should be enough.
+" (for the few instances where it would be more than "oneline")
+syn sync ccomment awkArray maxlines=10
+
+" define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlightling yet
+if version >= 508 || !exists("did_awk_syn_inits")
+ if version < 508
+ let did_awk_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink awkConditional Conditional
+ HiLink awkFunction Function
+ HiLink awkRepeat Repeat
+ HiLink awkStatement Statement
+
+ HiLink awkString String
+ HiLink awkSpecialPrintf Special
+ HiLink awkSpecialCharacter Special
+
+ HiLink awkSearch String
+ HiLink awkBrackets awkRegExp
+ HiLink awkBrktRegExp awkNestRegExp
+ HiLink awkCharClass awkNestRegExp
+ HiLink awkNestRegExp Keyword
+ HiLink awkRegExp Special
+
+ HiLink awkNumber Number
+ HiLink awkFloat Float
+
+ HiLink awkFileIO Special
+ "HiLink awkOperator Special
+ "HiLink awkExpression Special
+ HiLink awkBoolLogic Special
+
+ HiLink awkPatterns Special
+ HiLink awkVariables Special
+ HiLink awkFieldVars Special
+
+ HiLink awkLineSkip Special
+ HiLink awkSemicolon Special
+ HiLink awkComma Special
+ "HiLink awkIdentifier Identifier
+
+ HiLink awkComment Comment
+ HiLink awkTodo Todo
+
+ " Change this if you want nested array names to be highlighted.
+ HiLink awkArrayArray awkArray
+ HiLink awkArrayElement Special
+
+ HiLink awkParenError awkError
+ HiLink awkInParen awkError
+ HiLink awkError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "awk"
+
+" vim: ts=8
diff --git a/runtime/syntax/ayacc.vim b/runtime/syntax/ayacc.vim
new file mode 100644
index 000000000..be91e2f7e
--- /dev/null
+++ b/runtime/syntax/ayacc.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" Language: AYacc
+" Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
+" LastChange: 02 May 2001
+" Original: Yacc, maintained by Dr. Charles E. Campbell, Jr.
+" Comment: Replaced sourcing c.vim file by ada.vim and rename yacc*
+" in ayacc*
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the Ada syntax to start with
+if version < 600
+ so <sfile>:p:h/ada.vim
+else
+ runtime! syntax/ada.vim
+ unlet b:current_syntax
+endif
+
+" Clusters
+syn cluster ayaccActionGroup contains=ayaccDelim,cInParen,cTodo,cIncluded,ayaccDelim,ayaccCurlyError,ayaccUnionCurly,ayaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError
+syn cluster ayaccUnionGroup contains=ayaccKey,cComment,ayaccCurly,cType,cStructure,cStorageClass,ayaccUnionCurly
+
+" Yacc stuff
+syn match ayaccDelim "^[ \t]*[:|;]"
+syn match ayaccOper "@\d\+"
+
+syn match ayaccKey "^[ \t]*%\(token\|type\|left\|right\|start\|ident\)\>"
+syn match ayaccKey "[ \t]%\(prec\|expect\|nonassoc\)\>"
+syn match ayaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
+syn keyword ayaccKeyActn yyerrok yyclearin
+
+syn match ayaccUnionStart "^%union" skipwhite skipnl nextgroup=ayaccUnion
+syn region ayaccUnion contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
+syn region ayaccUnionCurly contained matchgroup=ayaccCurly start="{" matchgroup=ayaccCurly end="}" contains=@ayaccUnionGroup
+syn match ayaccBrkt contained "[<>]"
+syn match ayaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=ayaccBrkt
+syn match ayaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
+
+" special Yacc separators
+syn match ayaccSectionSep "^[ \t]*%%"
+syn match ayaccSep "^[ \t]*%{"
+syn match ayaccSep "^[ \t]*%}"
+
+" I'd really like to highlight just the outer {}. Any suggestions???
+syn match ayaccCurlyError "[{}]"
+syn region ayaccAction matchgroup=ayaccCurly start="{" end="}" contains=ALLBUT,@ayaccActionGroup
+
+if version >= 508 || !exists("did_ayacc_syntax_inits")
+ if version < 508
+ let did_ayacc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Internal ayacc highlighting links
+ HiLink ayaccBrkt ayaccStmt
+ HiLink ayaccKey ayaccStmt
+ HiLink ayaccOper ayaccStmt
+ HiLink ayaccUnionStart ayaccKey
+
+ " External ayacc highlighting links
+ HiLink ayaccCurly Delimiter
+ HiLink ayaccCurlyError Error
+ HiLink ayaccDefinition Function
+ HiLink ayaccDelim Function
+ HiLink ayaccKeyActn Special
+ HiLink ayaccSectionSep Todo
+ HiLink ayaccSep Delimiter
+ HiLink ayaccStmt Statement
+ HiLink ayaccType Type
+
+ " since Bram doesn't like my Delimiter :|
+ HiLink Delimiter Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ayacc"
+
+" vim: ts=15
diff --git a/runtime/syntax/b.vim b/runtime/syntax/b.vim
new file mode 100644
index 000000000..e97669175
--- /dev/null
+++ b/runtime/syntax/b.vim
@@ -0,0 +1,142 @@
+" Vim syntax file
+" Language: B (A Formal Method with refinement and mathematical proof)
+" Maintainer: Mathieu Clabaut <mathieu.clabaut@free.fr>
+" LastChange: 25 Apr 2001
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" A bunch of useful B keywords
+syn keyword bStatement MACHINE SEES OPERATIONS INCLUDES DEFINITIONS CONSTRAINTS CONSTANTS VARIABLES CONCRETE_CONSTANTS CONCRETE_VARIABLES ABSTRACT_CONSTANTS ABSTRACT_VARIABLES HIDDEN_CONSTANTS HIDDEN_VARIABLES ASSERT ASSERTIONS EXTENDS IMPLEMENTATION REFINEMENT IMPORTS USES INITIALISATION INVARIANT PROMOTES PROPERTIES REFINES SETS VALUES VARIANT VISIBLE_CONSTANTS VISIBLE_VARIABLES THEORY
+syn keyword bLabel CASE IN EITHER OR CHOICE DO OF
+syn keyword bConditional IF ELSE SELECT ELSIF THEN WHEN
+syn keyword bRepeat WHILE FOR
+syn keyword bOps bool card conc closure closure1 dom first fnc front not or id inter iseq iseq1 iterate last max min mod perm pred prj1 prj2 ran rel rev seq seq1 size skip succ tail union
+syn keyword bKeywords LET VAR BE IN BEGIN END POW POW1 FIN FIN1 PRE SIGMA STRING UNION IS ANY WHERE
+syn match bKeywords "||"
+
+syn keyword bBoolean TRUE FALSE bfalse btrue
+syn keyword bConstant PI MAXINT MININT User_Pass PatchProver PatchProverH0 PatchProverB0 FLAT ARI DED SUB RES
+syn keyword bGuard binhyp band bnot bguard bsearch bflat bfresh bguardi bget bgethyp barith bgetresult bresult bgoal bmatch bmodr bnewv bnum btest bpattern bprintf bwritef bsubfrm bvrb blvar bcall bappend bclose
+
+syn keyword bLogic or not
+syn match bLogic "\&\|=>\|<=>"
+
+syn keyword cTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match bSpecial contained "\\[0-7][0-7][0-7]\=\|\\."
+syn region bString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=bSpecial
+syn match bCharacter "'[^\\]'"
+syn match bSpecialCharacter "'\\.'"
+syn match bSpecialCharacter "'\\[0-7][0-7]'"
+syn match bSpecialCharacter "'\\[0-7][0-7][0-7]'"
+
+"catch errors caused by wrong parenthesis
+syn region bParen transparent start='(' end=')' contains=ALLBUT,bParenError,bIncluded,bSpecial,bTodo,bUserLabel,bBitField
+syn match bParenError ")"
+syn match bInParen contained "[{}]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match bNumber "\<[0-9]\+\>"
+"syn match bIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+
+if exists("b_comment_strings")
+ " A comment can contain bString, bCharacter and bNumber.
+ " But a "*/" inside a bString in a bComment DOES end the comment! So we
+ " need to use a special type of bString: bCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match bCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region bCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=bSpecial,bCommentSkip
+ syntax region bComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=bSpecial
+ syntax region bComment start="/\*" end="\*/" contains=bTodo,bCommentString,bCharacter,bNumber,bFloat
+ syntax region bComment start="/\?\*" end="\*\?/" contains=bTodo,bCommentString,bCharacter,bNumber,bFloat
+ syntax match bComment "//.*" contains=bTodo,bComment2String,bCharacter,bNumber
+else
+ syn region bComment start="/\*" end="\*/" contains=bTodo
+ syn region bComment start="/\?\*" end="\*\?/" contains=bTodo
+ syn match bComment "//.*" contains=bTodo
+endif
+syntax match bCommentError "\*/"
+
+syn keyword bType INT INTEGER BOOL NAT NATURAL NAT1 NATURAL1
+
+syn region bPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=bComment,bString,bCharacter,bNumber,bCommentError
+syn region bIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match bIncluded contained "<[^>]*>"
+syn match bInclude "^\s*#\s*include\>\s*["<]" contains=bIncluded
+
+syn region bDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,bPreCondit,bIncluded,bInclude,bDefine,bInParen
+syn region bPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,bPreCondit,bIncluded,bInclude,bDefine,bInParen
+
+
+syn sync ccomment bComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+
+if version >= 508 || !exists("did_b_syntax_inits")
+ if version < 508
+ let did_b_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink bLabel Label
+ HiLink bUserLabel Label
+ HiLink bConditional Conditional
+ HiLink bRepeat Repeat
+ HiLink bLogic Special
+ HiLink bCharacter Character
+ HiLink bSpecialCharacter bSpecial
+ HiLink bNumber Number
+ HiLink bFloat Float
+ HiLink bOctalError bError
+ HiLink bParenError bError
+" HiLink bInParen bError
+ HiLink bCommentError bError
+ HiLink bBoolean Identifier
+ HiLink bConstant Identifier
+ HiLink bGuard Identifier
+ HiLink bOperator Operator
+ HiLink bKeywords Operator
+ HiLink bOps Identifier
+ HiLink bStructure Structure
+ HiLink bStorageClass StorageClass
+ HiLink bInclude Include
+ HiLink bPreProc PreProc
+ HiLink bDefine Macro
+ HiLink bIncluded bString
+ HiLink bError Error
+ HiLink bStatement Statement
+ HiLink bPreCondit PreCondit
+ HiLink bType Type
+ HiLink bCommentError bError
+ HiLink bCommentString bString
+ HiLink bComment2String bString
+ HiLink bCommentSkip bComment
+ HiLink bString String
+ HiLink bComment Comment
+ HiLink bSpecial SpecialChar
+ HiLink bTodo Todo
+ "hi link bIdentifier Identifier
+ delcommand HiLink
+endif
+
+let current_syntax = "b"
+
+" vim: ts=8
diff --git a/runtime/syntax/baan.vim b/runtime/syntax/baan.vim
new file mode 100644
index 000000000..2efa8dea6
--- /dev/null
+++ b/runtime/syntax/baan.vim
@@ -0,0 +1,247 @@
+" Vim syntax file"
+" Language: Baan
+" Maintainer: Erwin Smit / Her van de Vliert
+" Last change: 30-10-2001"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+"************************************* 3GL ************************************"
+syn match baan3gl "#ident"
+syn match baan3gl "#include"
+syn match baan3gl "#define"
+syn match baan3gl "#undef"
+syn match baan3gl "#pragma"
+syn keyword baanConditional if then else case endif while endwhile endfor endcase
+syn keyword baan3gl at based break bset call common const continue default double
+syn keyword baan3gl empty extern fixed function ge global goto gt le lt mb
+syn keyword baan3gl multibyte ne ofr prompt ref repeat static step stop string
+syn keyword baan3gl true false until void wherebind
+syn keyword baan3gl and or to not in
+syn keyword baan3gl domain table eq input end long dim return at base print
+syn match baan3gl "\<for\>" contains=baansql
+syn match baan3gl "on case"
+syn match baan3gl "e\=n\=d\=dllusage"
+
+"************************************* SQL ************************************"
+syn keyword baansqlh where reference selecterror selectbind selectdo selectempty
+syn keyword baansqlh selecteos whereused endselect unref setunref clearunref
+syn keyword baansqlh from select clear skip rows
+syn keyword baansql between inrange having
+syn match baansql "as set with \d\+ rows"
+syn match baansql "as prepared set"
+syn match baansql "as prepared set with \d\+ rows"
+syn match baansql "refers to"
+syn match baansql "with retry"
+syn match baansql "with retry repeat last row"
+syn match baansql "for update"
+syn match baansql "order by"
+syn match baansql "group by"
+syn match baansql "commit\.transaction()"
+syn match baansql "abort\.transaction()"
+syn match baansql "db\.columns\.to\.record"
+syn match baansql "db\.record\.to\.columns"
+syn match baansql "db\.bind"
+syn match baansql "db\.change\.order"
+syn match baansql "\<db\.eq"
+syn match baansql "\<db\.first"
+syn match baansql "\<db\.gt"
+syn match baansql "\<db\.ge"
+syn match baansql "\<db\.le"
+syn match baansql "\<db\.next"
+syn match baansql "\<db\.prev"
+syn match baansql "\<db\.insert"
+syn match baansql "\<db\.delete"
+syn match baansql "\<db\.update"
+syn match baansql "\<db\.create\.table"
+syn match baansql "db\.set\.to\.default"
+syn match baansql "db\.retry"
+syn match baansql "DB\.RETRY"
+syn match baansql "db\.delayed\.lock"
+syn match baansql "db\.retry\.point()"
+syn match baansql "db\.retry\.hit()"
+syn match baansql "db\.return\.dupl"
+syn match baansql "db\.skip\.dupl"
+syn match baansql "db\.row\.length"
+
+"************************************* 4GL ************************************"
+" Program section
+syn match baan4glh "declaration:"
+syn match baan4glh "functions:"
+syn match baan4glh "before\.program:"
+syn match baan4glh "on\.error:"
+syn match baan4glh "after\.program:"
+syn match baan4glh "after\.update.db.commit:"
+syn match baan4glh "before\.display\.object:"
+
+" Form section
+syn match baan4glh "form\.\d\+:"
+syn match baan4glh "form\.all:"
+syn match baan4glh "form\.other:"
+syn match baan4gl "init\.form:"
+syn match baan4gl "before\.form:"
+syn match baan4gl "after\.form:"
+
+" Choice section
+syn match baan4glh "choice\.start\.set:"
+syn match baan4glh "choice\.first\.view:"
+syn match baan4glh "choice\.next\.view:"
+syn match baan4glh "choice\.prev\.view:"
+syn match baan4glh "choice\.last\.view:"
+syn match baan4glh "choice\.def\.find:"
+syn match baan4glh "choice\.find\.data:"
+syn match baan4glh "choice\.first\.set:"
+syn match baan4glh "choice\.next\.set:"
+syn match baan4glh "choice\.display\.set:"
+syn match baan4glh "choice\.prev\.set:"
+syn match baan4glh "choice\.rotate\.curr:"
+syn match baan4glh "choice\.last\.set:"
+syn match baan4glh "choice\.add\.set:"
+syn match baan4glh "choice\.update\.db:"
+syn match baan4glh "choice\.dupl\.occur:"
+syn match baan4glh "choice\.recover\.set:"
+syn match baan4glh "choice\.mark\.delete:"
+syn match baan4glh "choice\.mark\.occur:"
+syn match baan4glh "choice\.change\.order:"
+syn match baan4glh "choice\.modify\.set:"
+syn match baan4glh "choice\.restart\.input:"
+syn match baan4glh "choice\.print\.data:"
+syn match baan4glh "choice\.create\.job:"
+syn match baan4glh "choice\.form\.tab\.change:"
+syn match baan4glh "choice\.first\.frm:"
+syn match baan4glh "choice\.next\.frm:"
+syn match baan4glh "choice\.prev\.frm:"
+syn match baan4glh "choice\.last\.frm:"
+syn match baan4glh "choice\.resize\.frm:"
+syn match baan4glh "choice\.cmd\.options:"
+syn match baan4glh "choice\.zoom:"
+syn match baan4glh "choice\.interrupt:"
+syn match baan4glh "choice\.end\.program:"
+syn match baan4glh "choice\.abort\.program:"
+syn match baan4glh "choice\.cont\.process:"
+syn match baan4glh "choice\.text\.manager:"
+syn match baan4glh "choice\.run\.job:"
+syn match baan4glh "choice\.global\.delete:"
+syn match baan4glh "choice\.global\.copy:"
+syn match baan4glh "choice\.save\.defaults"
+syn match baan4glh "choice\.get\.defaults:"
+syn match baan4glh "choice\.start\.chart:"
+syn match baan4glh "choice\.start\.query:"
+syn match baan4glh "choice\.user\.\d:"
+syn match baan4glh "choice\.ask\.helpinfo:"
+syn match baan4glh "choice\.calculator:"
+syn match baan4glh "choice\.calendar:"
+syn match baan4glh "choice\.bms:"
+syn match baan4glh "choice\.cmd\.whats\.this:"
+syn match baan4glh "choice\.help\.index:"
+syn match baan4gl "before\.choice:"
+syn match baan4gl "on\.choice:"
+syn match baan4gl "after\.choice:"
+
+" Field section
+syn match baan4glh "field\.\l\{5}\d\{3}\.\l\{4}\.\=c\=:"
+syn match baan4glh "field\.e\..\+:"
+syn match baan4glh "field\.all:"
+syn match baan4glh "field\.other:"
+syn match baan4gl "init\.field:"
+syn match baan4gl "before\.field:"
+syn match baan4gl "before\.input:"
+syn match baan4gl "before\.display:"
+syn match baan4gl "before\.zoom:"
+syn match baan4gl "before\.checks:"
+syn match baan4gl "domain\.error:"
+syn match baan4gl "ref\.input:"
+syn match baan4gl "ref\.display:"
+syn match baan4gl "check\.input:"
+syn match baan4gl "on\.input:"
+syn match baan4gl "when\.field\.changes:"
+syn match baan4gl "after\.zoom:"
+syn match baan4gl "after\.input:"
+syn match baan4gl "after\.display:"
+syn match baan4gl "after\.field:"
+
+" Group section
+syn match baan4glh "group\.\d\+:"
+syn match baan4gl "init\.group:"
+syn match baan4gl "before\.group:"
+syn match baan4gl "after\.group:"
+
+" Zoom section
+syn match baan4glh "zoom\.from\..\+:"
+syn match baan4gl "on\.entry:"
+syn match baan4gl "on\.exit:"
+" Main table section
+syn match baan4glh "main\.table\.io:"
+syn match baan4gl "before\.read:"
+syn match baan4gl "after\.read:"
+syn match baan4gl "before\.write:"
+syn match baan4gl "after\.write:"
+syn match baan4gl "after\.skip\.write:"
+syn match baan4gl "before\.rewrite:"
+syn match baan4gl "after\.rewrite:"
+syn match baan4gl "after\.skip\.rewrite:"
+syn match baan4gl "before\.delete:"
+syn match baan4gl "after\.delete:"
+syn match baan4gl "after\.skip\.delete:"
+syn match baan4gl "read\.view:"
+
+"number without a dot."
+syn match baanNumber "\<\-\=\d\+\>"
+"number with dot"
+syn match baanNumber "\<\-\=\d\+\.\d*\>"
+"number starting with a dot"
+syn match baanNumber "\<\-\=\.\d\+\>"
+
+" String"
+syn region baanString start=+"+ skip=+""+ end=+"+
+" Comment"
+syn match baanComment "|$"
+syn match baanComment "|.$"
+syn match baanComment "|[^ ]"
+syn match baanComment "|[^#].*[^ ]"
+syn match baanCommenth "^|#lra.*$"
+syn match baanCommenth "^|#mdm.*$"
+syn match baanCommenth "^|#[0-9][0-9][0-9][0-9][0-9].*$"
+syn match baanCommenth "^|#N\=o\=Include.*$"
+syn region baanComment start="dllusage" end="enddllusage"
+" Oldcode"
+syn match baanUncommented "^|[^*#].*[^ ]"
+" SpaceError"
+syn match BaanSpaces " "
+syn match baanSpaceError "\s*$"
+syn match baanSpaceError " "
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_baan_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink baanConditional Conditional
+ HiLink baan3gl Statement
+ HiLink baan4gl Statement
+ HiLink baan4glh Statement
+ HiLink baansql Statement
+ HiLink baansqlh Statement
+ HiLink baanNumber Number
+ HiLink baanString String
+ HiLink baanComment Comment
+ HiLink baanCommenth Comment
+ HiLink baanUncommented Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "baan"
+
+" vim: ts=8
diff --git a/runtime/syntax/basic.vim b/runtime/syntax/basic.vim
new file mode 100644
index 000000000..ee500178c
--- /dev/null
+++ b/runtime/syntax/basic.vim
@@ -0,0 +1,174 @@
+" Vim syntax file
+" Language: BASIC
+" Maintainer: Allan Kelly <allan@fruitloaf.co.uk>
+" Last Change: Tue Sep 14 14:24:23 BST 1999
+
+" First version based on Micro$soft QBASIC circa 1989, as documented in
+" 'Learn BASIC Now' by Halvorson&Rygmyr. Microsoft Press 1989.
+" This syntax file not a complete implementation yet. Send suggestions to the
+" maintainer.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful BASIC keywords
+syn keyword basicStatement BEEP beep Beep BLOAD bload Bload BSAVE bsave Bsave
+syn keyword basicStatement CALL call Call ABSOLUTE absolute Absolute
+syn keyword basicStatement CHAIN chain Chain CHDIR chdir Chdir
+syn keyword basicStatement CIRCLE circle Circle CLEAR clear Clear
+syn keyword basicStatement CLOSE close Close CLS cls Cls COLOR color Color
+syn keyword basicStatement COM com Com COMMON common Common
+syn keyword basicStatement CONST const Const DATA data Data
+syn keyword basicStatement DECLARE declare Declare DEF def Def
+syn keyword basicStatement DEFDBL defdbl Defdbl DEFINT defint Defint
+syn keyword basicStatement DEFLNG deflng Deflng DEFSNG defsng Defsng
+syn keyword basicStatement DEFSTR defstr Defstr DIM dim Dim
+syn keyword basicStatement DO do Do LOOP loop Loop
+syn keyword basicStatement DRAW draw Draw END end End
+syn keyword basicStatement ENVIRON environ Environ ERASE erase Erase
+syn keyword basicStatement ERROR error Error EXIT exit Exit
+syn keyword basicStatement FIELD field Field FILES files Files
+syn keyword basicStatement FOR for For NEXT next Next
+syn keyword basicStatement FUNCTION function Function GET get Get
+syn keyword basicStatement GOSUB gosub Gosub GOTO goto Goto
+syn keyword basicStatement IF if If THEN then Then ELSE else Else
+syn keyword basicStatement INPUT input Input INPUT# input# Input#
+syn keyword basicStatement IOCTL ioctl Ioctl KEY key Key
+syn keyword basicStatement KILL kill Kill LET let Let
+syn keyword basicStatement LINE line Line LOCATE locate Locate
+syn keyword basicStatement LOCK lock Lock UNLOCK unlock Unlock
+syn keyword basicStatement LPRINT lprint Lprint USING using Using
+syn keyword basicStatement LSET lset Lset MKDIR mkdir Mkdir
+syn keyword basicStatement NAME name Name ON on On
+syn keyword basicStatement ERROR error Error OPEN open Open
+syn keyword basicStatement OPTION option Option BASE base Base
+syn keyword basicStatement OUT out Out PAINT paint Paint
+syn keyword basicStatement PALETTE palette Palette PCOPY pcopy Pcopy
+syn keyword basicStatement PEN pen Pen PLAY play Play
+syn keyword basicStatement PMAP pmap Pmap POKE poke Poke
+syn keyword basicStatement PRESET preset Preset PRINT print Print
+syn keyword basicStatement PRINT# print# Print# USING using Using
+syn keyword basicStatement PSET pset Pset PUT put Put
+syn keyword basicStatement RANDOMIZE randomize Randomize READ read Read
+syn keyword basicStatement REDIM redim Redim RESET reset Reset
+syn keyword basicStatement RESTORE restore Restore RESUME resume Resume
+syn keyword basicStatement RETURN return Return RMDIR rmdir Rmdir
+syn keyword basicStatement RSET rset Rset RUN run Run
+syn keyword basicStatement SEEK seek Seek SELECT select Select
+syn keyword basicStatement CASE case Case SHARED shared Shared
+syn keyword basicStatement SHELL shell Shell SLEEP sleep Sleep
+syn keyword basicStatement SOUND sound Sound STATIC static Static
+syn keyword basicStatement STOP stop Stop STRIG strig Strig
+syn keyword basicStatement SUB sub Sub SWAP swap Swap
+syn keyword basicStatement SYSTEM system System TIMER timer Timer
+syn keyword basicStatement TROFF troff Troff TRON tron Tron
+syn keyword basicStatement TYPE type Type UNLOCK unlock Unlock
+syn keyword basicStatement VIEW view View WAIT wait Wait
+syn keyword basicStatement WHILE while While WEND wend Wend
+syn keyword basicStatement WIDTH width Width WINDOW window Window
+syn keyword basicStatement WRITE write Write DATE$ date$ Date$
+syn keyword basicStatement MID$ mid$ Mid$ TIME$ time$ Time$
+
+syn keyword basicFunction ABS abs Abs ASC asc Asc
+syn keyword basicFunction ATN atn Atn CDBL cdbl Cdbl
+syn keyword basicFunction CINT cint Cint CLNG clng Clng
+syn keyword basicFunction COS cos Cos CSNG csng Csng
+syn keyword basicFunction CSRLIN csrlin Csrlin CVD cvd Cvd
+syn keyword basicFunction CVDMBF cvdmbf Cvdmbf CVI cvi Cvi
+syn keyword basicFunction CVL cvl Cvl CVS cvs Cvs
+syn keyword basicFunction CVSMBF cvsmbf Cvsmbf EOF eof Eof
+syn keyword basicFunction ERDEV erdev Erdev ERL erl Erl
+syn keyword basicFunction ERR err Err EXP exp Exp
+syn keyword basicFunction FILEATTR fileattr Fileattr FIX fix Fix
+syn keyword basicFunction FRE fre Fre FREEFILE freefile Freefile
+syn keyword basicFunction INP inp Inp INSTR instr Instr
+syn keyword basicFunction INT int Int LBOUND lbound Lbound
+syn keyword basicFunction LEN len Len LOC loc Loc
+syn keyword basicFunction LOF lof Lof LOG log Log
+syn keyword basicFunction LPOS lpos Lpos PEEK peek Peek
+syn keyword basicFunction PEN pen Pen POINT point Point
+syn keyword basicFunction POS pos Pos RND rnd Rnd
+syn keyword basicFunction SADD sadd Sadd SCREEN screen Screen
+syn keyword basicFunction SEEK seek Seek SETMEM setmem Setmem
+syn keyword basicFunction SGN sgn Sgn SIN sin Sin
+syn keyword basicFunction SPC spc Spc SQR sqr Sqr
+syn keyword basicFunction STICK stick Stick STRIG strig Strig
+syn keyword basicFunction TAB tab Tab TAN tan Tan
+syn keyword basicFunction UBOUND ubound Ubound VAL val Val
+syn keyword basicFunction VALPTR valptr Valptr VALSEG valseg Valseg
+syn keyword basicFunction VARPTR varptr Varptr VARSEG varseg Varseg
+syn keyword basicFunction CHR$ Chr$ chr$ COMMAND$ command$ Command$
+syn keyword basicFunction DATE$ date$ Date$ ENVIRON$ environ$ Environ$
+syn keyword basicFunction ERDEV$ erdev$ Erdev$ HEX$ hex$ Hex$
+syn keyword basicFunction INKEY$ inkey$ Inkey$ INPUT$ input$ Input$
+syn keyword basicFunction IOCTL$ ioctl$ Ioctl$ LCASES$ lcases$ Lcases$
+syn keyword basicFunction LAFT$ laft$ Laft$ LTRIM$ ltrim$ Ltrim$
+syn keyword basicFunction MID$ mid$ Mid$ MKDMBF$ mkdmbf$ Mkdmbf$
+syn keyword basicFunction MKD$ mkd$ Mkd$ MKI$ mki$ Mki$
+syn keyword basicFunction MKL$ mkl$ Mkl$ MKSMBF$ mksmbf$ Mksmbf$
+syn keyword basicFunction MKS$ mks$ Mks$ OCT$ oct$ Oct$
+syn keyword basicFunction RIGHT$ right$ Right$ RTRIM$ rtrim$ Rtrim$
+syn keyword basicFunction SPACE$ space$ Space$ STR$ str$ Str$
+syn keyword basicFunction STRING$ string$ String$ TIME$ time$ Time$
+syn keyword basicFunction UCASE$ ucase$ Ucase$ VARPTR$ varptr$ Varptr$
+syn keyword basicTodo contained TODO
+
+"integer number, or floating point number without a dot.
+syn match basicNumber "\<\d\+\>"
+"floating point number, with dot
+syn match basicNumber "\<\d\+\.\d*\>"
+"floating point number, starting with a dot
+syn match basicNumber "\.\d\+\>"
+
+" String and Character contstants
+syn match basicSpecial contained "\\\d\d\d\|\\."
+syn region basicString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=basicSpecial
+
+syn region basicComment start="REM" end="$" contains=basicTodo
+syn region basicComment start="^[ \t]*'" end="$" contains=basicTodo
+syn region basicLineNumber start="^\d" end="\s"
+syn match basicTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
+" Used with OPEN statement
+syn match basicFilenumber "#\d\+"
+"syn sync ccomment basicComment
+" syn match basicMathsOperator "[<>+\*^/\\=-]"
+syn match basicMathsOperator "-\|=\|[:<>+\*^/\\]\|AND\|OR"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_basic_syntax_inits")
+ if version < 508
+ let did_basic_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink basicLabel Label
+ HiLink basicConditional Conditional
+ HiLink basicRepeat Repeat
+ HiLink basicLineNumber Comment
+ HiLink basicNumber Number
+ HiLink basicError Error
+ HiLink basicStatement Statement
+ HiLink basicString String
+ HiLink basicComment Comment
+ HiLink basicSpecial Special
+ HiLink basicTodo Todo
+ HiLink basicFunction Identifier
+ HiLink basicTypeSpecifier Type
+ HiLink basicFilenumber basicTypeSpecifier
+ "hi basicMathsOperator term=bold cterm=bold gui=bold
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "basic"
+
+" vim: ts=8
diff --git a/runtime/syntax/bc.vim b/runtime/syntax/bc.vim
new file mode 100644
index 000000000..dcfaf486a
--- /dev/null
+++ b/runtime/syntax/bc.vim
@@ -0,0 +1,78 @@
+" Vim syntax file
+" Language: bc - An arbitrary precision calculator language
+" Maintainer: Vladimir Scholtz <vlado@gjh.sk>
+" Last change: 2001 Sep 02
+" Available on: www.gjh.sk/~vlado/bc.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Keywords
+syn keyword bcKeyword if else while for break continue return limits halt quit
+syn keyword bcKeyword define
+syn keyword bcKeyword length read sqrt print
+
+" Variable
+syn keyword bcType auto
+
+" Constant
+syn keyword bcConstant scale ibase obase last
+syn keyword bcConstant BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX BC_STRING_MAX
+syn keyword bcConstant BC_ENV_ARGS BC_LINE_LENGTH
+
+" Any other stuff
+syn match bcIdentifier "[a-z_][a-z0-9_]*"
+
+" String
+ syn match bcString "\"[^"]*\""
+
+" Number
+syn match bcNumber "[0-9]\+"
+
+" Comment
+syn match bcComment "\#.*"
+syn region bcComment start="/\*" end="\*/"
+
+" Parent ()
+syn cluster bcAll contains=bcList,bcIdentifier,bcNumber,bcKeyword,bcType,bcConstant,bcString,bcParentError
+syn region bcList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@bcAll
+syn region bcList matchgroup=Delimiter start="\[" skip="|.\{-}|" matchgroup=Delimiter end="\]" contains=@bcAll
+syn match bcParenError "]"
+syn match bcParenError ")"
+
+
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_bc_syntax_inits")
+ if version < 508
+ let did_bc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink bcKeyword Statement
+ HiLink bcType Type
+ HiLink bcConstant Constant
+ HiLink bcNumber Number
+ HiLink bcComment Comment
+ HiLink bcString String
+ HiLink bcSpecialChar SpecialChar
+ HiLink bcParenError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "bc"
+" vim: ts=8
diff --git a/runtime/syntax/bdf.vim b/runtime/syntax/bdf.vim
new file mode 100644
index 000000000..3fc404a86
--- /dev/null
+++ b/runtime/syntax/bdf.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" Language: BDF Font definition
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/bdf/
+" Latest Revision: 2004-05-06
+" arch-tag: b696b6ba-af24-41ba-b4eb-d248495eca68
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" numbers
+syn match bdfNumber display "\<\(\x\+\|\d\+\.\d\+\)\>"
+
+" comments
+syn region bdfComment start="^COMMENT\>" end="$" contains=bdfTodo
+
+" todo
+syn keyword bdfTodo contained TODO FIXME XXX NOTE
+
+" strings
+syn region bdfString start=+"+ skip=+""+ end=+"+
+
+" properties
+syn keyword bdfProperties contained FONT SIZE FONTBOUNDINGBOX CHARS
+
+" X11 properties
+syn keyword bdfXProperties contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
+syn keyword bdfXProperties contained FONTNAME_REGISTRY FOUNDRY FAMILY_NAME
+syn keyword bdfXProperties contained WEIGHT_NAME SLANT SETWIDTH_NAME PIXEL_SIZE
+syn keyword bdfXProperties contained POINT_SIZE RESOLUTION_X RESOLUTION_Y SPACING
+syn keyword bdfXProperties contained CHARSET_REGISTRY CHARSET_ENCODING COPYRIGHT
+syn keyword bdfXProperties contained ADD_STYLE_NAME WEIGHT RESOLUTION X_HEIGHT
+syn keyword bdfXProperties contained QUAD_WIDTH FONT AVERAGE_WIDTH
+
+syn region bdfDefinition transparent matchgroup=bdfDelim start="^STARTPROPERTIES\>" end="^ENDPROPERTIES\>" contains=bdfXProperties,bdfNumber,bdfString
+
+" characters
+syn keyword bdfCharProperties contained ENCODING SWIDTH DWIDTH BBX ATTRIBUTES BITMAP
+
+syn match bdfCharName contained display "\<[0-9a-zA-Z]\{1,14}\>"
+syn match bdfCharNameError contained display "\<[0-9a-zA-Z]\{15,}\>"
+
+syn region bdfStartChar transparent matchgroup=bdfDelim start="\<STARTCHAR\>" end="$" contains=bdfCharName,bdfCharNameError
+
+syn region bdfCharDefinition transparent start="^STARTCHAR\>" matchgroup=bdfDelim end="^ENDCHAR\>" contains=bdfCharProperties,bdfNumber,bdfStartChar
+
+" font
+syn region bdfFontDefinition transparent matchgroup=bdfDelim start="^STARTFONT\>" end="^ENDFONT\>" contains=bdfProperties,bdfDefinition,bdfCharDefinition,bdfNumber,bdfComment
+
+if exists("bdf_minlines")
+ let b:bdf_minlines = bdf_minlines
+else
+ let b:bdf_minlines = 50
+endif
+exec "syn sync minlines=" . b:bdf_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_bdf_syn_inits")
+ if version < 508
+ let did_bdf_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink bdfComment Comment
+ HiLink bdfTodo Todo
+ HiLink bdfNumber Number
+ HiLink bdfString String
+ HiLink bdfProperties Keyword
+ HiLink bdfXProperties Keyword
+ HiLink bdfCharProperties Structure
+ HiLink bdfDelim Delimiter
+ HiLink bdfCharName String
+ HiLink bdfCharNameError Error
+ delcommand HiLink
+endif
+
+let b:current_syntax = "bdf"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/bib.vim b/runtime/syntax/bib.vim
new file mode 100644
index 000000000..a98f281d3
--- /dev/null
+++ b/runtime/syntax/bib.vim
@@ -0,0 +1,92 @@
+" Vim syntax file
+" Language: BibTeX (bibliographic database format for (La)TeX)
+" Maintainer: Bernd Feige <Bernd.Feige@gmx.net>
+" Filenames: *.bib
+" Last Change: Apr 26, 2001
+" URL: http://home.t-online.de/home/Bernd.Feige/bib.vim
+
+" Thanks to those who pointed out problems with this file or supplied fixes!
+
+" Initialization
+" ==============
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Ignore case
+syn case ignore
+
+" Keywords
+" ========
+syn keyword bibType contained article book booklet conference inbook
+syn keyword bibType contained incollection inproceedings manual
+syn keyword bibType contained mastersthesis misc phdthesis
+syn keyword bibType contained proceedings techreport unpublished
+syn keyword bibType contained string
+
+syn keyword bibEntryKw contained address annote author booktitle chapter
+syn keyword bibEntryKw contained crossref edition editor howpublished
+syn keyword bibEntryKw contained institution journal key month note
+syn keyword bibEntryKw contained number organization pages publisher
+syn keyword bibEntryKw contained school series title type volume year
+" Non-standard:
+syn keyword bibNSEntryKw contained abstract isbn issn keywords url
+
+" Clusters
+" ========
+syn cluster bibVarContents contains=bibUnescapedSpecial,bibBrace,bibParen
+" This cluster is empty but things can be added externally:
+"syn cluster bibCommentContents
+
+" Matches
+" =======
+syn match bibUnescapedSpecial contained /[^\\][%&]/hs=s+1
+syn match bibKey contained /\s*[^ \t}="]\+,/hs=s,he=e-1 nextgroup=bibField
+syn match bibVariable contained /[^{}," \t=]/
+syn region bibComment start=/^/ end=/^\s*@/me=e-1 contains=@bibCommentContents nextgroup=bibEntry
+syn region bibQuote contained start=/"/ end=/"/ skip=/\(\\"\)/ contains=@bibVarContents
+syn region bibBrace contained start=/{/ end=/}/ skip=/\(\\[{}]\)/ contains=@bibVarContents
+syn region bibParen contained start=/(/ end=/)/ skip=/\(\\[()]\)/ contains=@bibVarContents
+syn region bibField contained start="\S\+\s*=\s*" end=/[}),]/me=e-1 contains=bibEntryKw,bibNSEntryKw,bibBrace,bibParen,bibQuote,bibVariable
+syn region bibEntryData contained start=/[{(]/ms=e+1 end=/[})]/me=e-1 contains=bibKey,bibField
+" Actually, 5.8 <= Vim < 6.0 would ignore the `fold' keyword anyway, but Vim<5.8 would produce
+" an error, so we explicitly distinguish versions with and without folding functionality:
+if version < 600
+ syn region bibEntry start=/@\S\+[{(]/ end=/^\s*[})]/ transparent contains=bibType,bibEntryData nextgroup=bibComment
+else
+ syn region bibEntry start=/@\S\+[{(]/ end=/^\s*[})]/ transparent fold contains=bibType,bibEntryData nextgroup=bibComment
+endif
+
+" Synchronization
+" ===============
+syn sync match All grouphere bibEntry /^\s*@/
+syn sync maxlines=200
+syn sync minlines=50
+
+" Highlighting defaults
+" =====================
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_bib_syn_inits")
+ if version < 508
+ let did_bib_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink bibType Identifier
+ HiLink bibEntryKw Statement
+ HiLink bibNSEntryKw PreProc
+ HiLink bibKey Special
+ HiLink bibVariable Constant
+ HiLink bibUnescapedSpecial Error
+ HiLink bibComment Comment
+ delcommand HiLink
+endif
+
+let b:current_syntax = "bib"
diff --git a/runtime/syntax/bindzone.vim b/runtime/syntax/bindzone.vim
new file mode 100644
index 000000000..3c23e219f
--- /dev/null
+++ b/runtime/syntax/bindzone.vim
@@ -0,0 +1,98 @@
+" Vim syntax file
+" Language: BIND 8.x zone files (RFC1035)
+" Maintainer: glory hump <rnd@web-drive.ru>
+" Last change: Thu Apr 26 02:16:18 SAMST 2001
+" Filenames: /var/named/*
+" URL: http://rnd.web-drive.ru/vim/syntax/bindzone.vim
+" $Id$
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+if version >= 600
+ setlocal iskeyword=.,-,48-58,A-Z,a-z,_
+else
+ set iskeyword=.,-,48-58,A-Z,a-z,_
+endif
+
+
+" Master File Format (rfc 1035)
+
+" directives
+syn region zoneRRecord start=+^+ end=+$+ contains=zoneLHSDomain,zoneLHSIP,zoneIllegalDom,zoneWhitespace,zoneComment,zoneParen,zoneSpecial
+syn match zoneDirective /\$ORIGIN\s\+/ nextgroup=zoneDomain,zoneIllegalDom
+syn match zoneDirective /\$TTL\s\+/ nextgroup=zoneTTL
+syn match zoneDirective /\$INCLUDE\s\+/
+syn match zoneDirective /\$GENERATE\s/
+
+syn match zoneWhitespace contained /^\s\+/ nextgroup=zoneTTL,zoneClass,zoneRRType
+syn match zoneError "\s\+$"
+syn match zoneSpecial contained /^[@.]\s\+/ nextgroup=zoneTTL,zoneClass,zoneRRType
+syn match zoneSpecial contained /@$/
+
+" domains and IPs
+syn match zoneLHSDomain contained /^[-0-9A-Za-z.]\+\s\+/ nextgroup=zoneTTL,zoneClass,zoneRRType
+syn match zoneLHSIP contained /^[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{,3}\s\+/ nextgroup=zoneTTL,zoneClass,zoneRRType
+syn match zoneIPaddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{,3}\>/
+syn match zoneDomain contained /\<[0-9A-Za-z][-0-9A-Za-z.]\+\>/
+
+syn match zoneIllegalDom contained /\S*[^-A-Za-z0-9.[:space:]]\S*\>/
+"syn match zoneIllegalDom contained /[0-9]\S*[-A-Za-z]\S*/
+
+" keywords
+syn keyword zoneClass IN CHAOS nextgroup=zoneRRType
+
+syn match zoneTTL contained /\<[0-9HhWwDd]\+\s\+/ nextgroup=zoneClass,zoneRRType
+syn match zoneRRType contained /\s*\<\(NS\|HINFO\)\s\+/ nextgroup=zoneSpecial,zoneDomain
+syn match zoneRRType contained /\s*\<CNAME\s\+/ nextgroup=zoneDomain,zoneSpecial
+syn match zoneRRType contained /\s*\<SOA\s\+/ nextgroup=zoneDomain,zoneIllegalDom
+syn match zoneRRType contained /\s*\<PTR\s\+/ nextgroup=zoneDomain,zoneIllegalDom
+syn match zoneRRType contained /\s*\<MX\s\+/ nextgroup=zoneMailPrio
+syn match zoneRRType contained /\s*\<A\s\+/ nextgroup=zoneIPaddr,zoneIllegalDom
+
+" FIXME: catchup serial number
+syn match zoneSerial contained /\<[0-9]\{9}\>/
+
+syn match zoneMailPrio contained /\<[0-9]\+\s*/ nextgroup=zoneDomain,zoneIllegalDom
+syn match zoneErrParen /)/
+syn region zoneParen contained start=+(+ end=+)+ contains=zoneSerial,zoneTTL,zoneComment
+syn match zoneComment ";.*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_bind_zone_syn_inits")
+ if version < 508
+ let did_bind_zone_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink zoneComment Comment
+ HiLink zoneDirective Macro
+ HiLink zoneLHSDomain Statement
+ HiLink zoneLHSIP Statement
+ HiLink zoneClass Include
+ HiLink zoneSpecial Special
+ HiLink zoneRRType Type
+ HiLink zoneError Error
+ HiLink zoneErrParen Error
+ HiLink zoneIllegalDom Error
+ HiLink zoneSerial Todo
+ HiLink zoneIPaddr Number
+ HiLink zoneDomain Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "bindzone"
+
+" vim: ts=17
diff --git a/runtime/syntax/blank.vim b/runtime/syntax/blank.vim
new file mode 100644
index 000000000..855433995
--- /dev/null
+++ b/runtime/syntax/blank.vim
@@ -0,0 +1,46 @@
+" Vim syntax file
+" Language: Blank 1.4.1
+" Maintainer: Rafal M. Sulejman <unefunge@friko2.onet.pl>
+" Last change: 21 Jul 2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Blank instructions
+syn match blankInstruction "{[:;,\.+\-*$#@/\\`'"!\|><{}\[\]()?xspo\^&\~=_%]}"
+
+" Common strings
+syn match blankString "\~[^}]"
+
+" Numbers
+syn match blankNumber "\[[0-9]\+\]"
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_blank_syntax_inits")
+ if version < 508
+ let did_blank_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink blankInstruction Statement
+ HiLink blankNumber Number
+ HiLink blankString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "blank"
+" vim: ts=8
diff --git a/runtime/syntax/btm.vim b/runtime/syntax/btm.vim
new file mode 100644
index 000000000..4fd5b2db9
--- /dev/null
+++ b/runtime/syntax/btm.vim
@@ -0,0 +1,229 @@
+" Vim syntax file
+" Language: 4Dos batch file
+" Maintainer: John Leo Spetz <jls11@po.cwru.edu>
+" Last Change: 2001 May 09
+
+"//Issues to resolve:
+"//- Boolean operators surrounded by period are recognized but the
+"// periods are not highlighted. The only way to do that would
+"// be separate synmatches for each possibility otherwise a more
+"// general \.\i\+\. will highlight anything delimited by dots.
+"//- After unary operators like "defined" can assume token type.
+"// Should there be more of these?
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn keyword btmStatement call off
+syn keyword btmConditional if iff endiff then else elseiff not errorlevel
+syn keyword btmConditional gt lt eq ne ge le
+syn match btmConditional transparent "\.\i\+\." contains=btmDotBoolOp
+syn keyword btmDotBoolOp contained and or xor
+syn match btmConditional "=="
+syn match btmConditional "!="
+syn keyword btmConditional defined errorlevel exist isalias
+syn keyword btmConditional isdir direxist isinternal islabel
+syn keyword btmRepeat for in do enddo
+
+syn keyword btmTodo contained TODO
+
+" String
+syn cluster btmVars contains=btmVariable,btmArgument,btmBIFMatch
+syn region btmString start=+"+ end=+"+ contains=@btmVars
+syn match btmNumber "\<\d\+\>"
+
+"syn match btmIdentifier "\<\h\w*\>"
+
+" If you don't like tabs
+"syn match btmShowTab "\t"
+"syn match btmShowTabc "\t"
+"syn match btmComment "^\ *rem.*$" contains=btmTodo,btmShowTabc
+
+" Some people use this as a comment line
+" In fact this is a Label
+"syn match btmComment "^\ *:\ \+.*$" contains=btmTodo
+
+syn match btmComment "^\ *rem.*$" contains=btmTodo
+syn match btmComment "^\ *::.*$" contains=btmTodo
+
+syn match btmLabelMark "^\ *:[0-9a-zA-Z_\-]\+\>"
+syn match btmLabelMark "goto [0-9a-zA-Z_\-]\+\>"lc=5
+syn match btmLabelMark "gosub [0-9a-zA-Z_\-]\+\>"lc=6
+
+" syn match btmCmdDivider ">[>&][>&]\="
+syn match btmCmdDivider ">[>&]*"
+syn match btmCmdDivider ">>&>"
+syn match btmCmdDivider "|&\="
+syn match btmCmdDivider "%+"
+syn match btmCmdDivider "\^"
+
+syn region btmEcho start="echo" skip="echo" matchgroup=btmCmdDivider end="%+" end="$" end="|&\=" end="\^" end=">[>&]*" contains=@btmEchos oneline
+syn cluster btmEchos contains=@btmVars,btmEchoCommand,btmEchoParam
+syn keyword btmEchoCommand contained echo echoerr echos echoserr
+syn keyword btmEchoParam contained on off
+
+" this is also a valid Label. I don't use it.
+"syn match btmLabelMark "^\ *:\ \+[0-9a-zA-Z_\-]\+\>"
+
+" //Environment variable can be expanded using notation %var in 4DOS
+syn match btmVariable "%[0-9a-z_\-]\+" contains=@btmSpecialVars
+" //Environment variable can be expanded using notation %var%
+syn match btmVariable "%[0-9a-z_\-]*%" contains=@btmSpecialVars
+" //The following are special variable in 4DOS
+syn match btmVariable "%[=#]" contains=@btmSpecialVars
+syn match btmVariable "%??\=" contains=@btmSpecialVars
+" //Environment variable can be expanded using notation %[var] in 4DOS
+syn match btmVariable "%\[[0-9a-z_\-]*\]"
+" //After some keywords next word should be an environment variable
+syn match btmVariable "defined\s\i\+"lc=8
+syn match btmVariable "set\s\i\+"lc=4
+" //Parameters to batchfiles take the format %<digit>
+syn match btmArgument "%\d\>"
+" //4DOS allows format %<digit>& meaning batchfile parameters digit and up
+syn match btmArgument "%\d\>&"
+" //Variable used by FOR loops sometimes use %%<letter> in batchfiles
+syn match btmArgument "%%\a\>"
+
+" //Show 4DOS built-in functions specially
+syn match btmBIFMatch "%@\w\+\["he=e-1 contains=btmBuiltInFunc
+syn keyword btmBuiltInFunc contained alias ascii attrib cdrom
+syn keyword btmBuiltInFunc contained char clip comma convert
+syn keyword btmBuiltInFunc contained date day dec descript
+syn keyword btmBuiltInFunc contained device diskfree disktotal
+syn keyword btmBuiltInFunc contained diskused dosmem dow dowi
+syn keyword btmBuiltInFunc contained doy ems eval exec execstr
+syn keyword btmBuiltInFunc contained expand ext extended
+syn keyword btmBuiltInFunc contained fileage fileclose filedate
+syn keyword btmBuiltInFunc contained filename fileopen fileread
+syn keyword btmBuiltInFunc contained files fileseek fileseekl
+syn keyword btmBuiltInFunc contained filesize filetime filewrite
+syn keyword btmBuiltInFunc contained filewriteb findclose
+syn keyword btmBuiltInFunc contained findfirst findnext format
+syn keyword btmBuiltInFunc contained full if inc index insert
+syn keyword btmBuiltInFunc contained instr int label left len
+syn keyword btmBuiltInFunc contained lfn line lines lower lpt
+syn keyword btmBuiltInFunc contained makeage makedate maketime
+syn keyword btmBuiltInFunc contained master month name numeric
+syn keyword btmBuiltInFunc contained path random readscr ready
+syn keyword btmBuiltInFunc contained remote removable repeat
+syn keyword btmBuiltInFunc contained replace right search
+syn keyword btmBuiltInFunc contained select sfn strip substr
+syn keyword btmBuiltInFunc contained time timer trim truename
+syn keyword btmBuiltInFunc contained unique upper wild word
+syn keyword btmBuiltInFunc contained words xms year
+
+syn cluster btmSpecialVars contains=btmBuiltInVar,btmSpecialVar
+
+" //Show specialized variables specially
+" syn match btmSpecialVar contained "+"
+syn match btmSpecialVar contained "="
+syn match btmSpecialVar contained "#"
+syn match btmSpecialVar contained "??\="
+syn keyword btmSpecialVar contained cmdline colordir comspec
+syn keyword btmSpecialVar contained copycmd dircmd temp temp4dos
+syn keyword btmSpecialVar contained filecompletion path prompt
+
+" //Show 4DOS built-in variables specially specially
+syn keyword btmBuiltInVar contained _4ver _alias _ansi
+syn keyword btmBuiltInVar contained _apbatt _aplife _apmac _batch
+syn keyword btmBuiltInVar contained _batchline _batchname _bg
+syn keyword btmBuiltInVar contained _boot _ci _cmdproc _co
+syn keyword btmBuiltInVar contained _codepage _column _columns
+syn keyword btmBuiltInVar contained _country _cpu _cwd _cwds _cwp
+syn keyword btmBuiltInVar contained _cwps _date _day _disk _dname
+syn keyword btmBuiltInVar contained _dos _dosver _dow _dowi _doy
+syn keyword btmBuiltInVar contained _dpmi _dv _env _fg _hlogfile
+syn keyword btmBuiltInVar contained _hour _kbhit _kstack _lastdisk
+syn keyword btmBuiltInVar contained _logfile _minute _monitor
+syn keyword btmBuiltInVar contained _month _mouse _ndp _row _rows
+syn keyword btmBuiltInVar contained _second _shell _swapping
+syn keyword btmBuiltInVar contained _syserr _time _transient
+syn keyword btmBuiltInVar contained _video _win _wintitle _year
+
+" //Commands in 4DOS and/or DOS
+syn match btmCommand "\s?"
+syn match btmCommand "^?"
+syn keyword btmCommand alias append assign attrib
+syn keyword btmCommand backup beep break cancel case
+syn keyword btmCommand cd cdd cdpath chcp chdir
+syn keyword btmCommand chkdsk cls color comp copy
+syn keyword btmCommand ctty date debug default defrag
+syn keyword btmCommand del delay describe dir
+syn keyword btmCommand dirhistory dirs diskcomp
+syn keyword btmCommand diskcopy doskey dosshell
+syn keyword btmCommand drawbox drawhline drawvline
+"syn keyword btmCommand echo echoerr echos echoserr
+syn keyword btmCommand edit edlin emm386 endlocal
+syn keyword btmCommand endswitch erase eset except
+syn keyword btmCommand exe2bin exit expand fastopen
+syn keyword btmCommand fc fdisk ffind find format
+syn keyword btmCommand free global gosub goto
+syn keyword btmCommand graftabl graphics help history
+syn keyword btmCommand inkey input join keyb keybd
+syn keyword btmCommand keystack label lh list loadbtm
+syn keyword btmCommand loadhigh lock log md mem
+syn keyword btmCommand memory mirror mkdir mode more
+syn keyword btmCommand move nlsfunc on option path
+syn keyword btmCommand pause popd print prompt pushd
+syn keyword btmCommand quit rd reboot recover ren
+syn keyword btmCommand rename replace restore return
+syn keyword btmCommand rmdir scandisk screen scrput
+syn keyword btmCommand select set setdos setlocal
+syn keyword btmCommand setver share shift sort subst
+syn keyword btmCommand swapping switch sys tee text
+syn keyword btmCommand time timer touch tree truename
+syn keyword btmCommand type unalias undelete unformat
+syn keyword btmCommand unlock unset ver verify vol
+syn keyword btmCommand vscrput y
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_btm_syntax_inits")
+ if version < 508
+ let did_btm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink btmLabel Special
+ HiLink btmLabelMark Special
+ HiLink btmCmdDivider Special
+ HiLink btmConditional btmStatement
+ HiLink btmDotBoolOp btmStatement
+ HiLink btmRepeat btmStatement
+ HiLink btmEchoCommand btmStatement
+ HiLink btmEchoParam btmStatement
+ HiLink btmStatement Statement
+ HiLink btmTodo Todo
+ HiLink btmString String
+ HiLink btmNumber Number
+ HiLink btmComment Comment
+ HiLink btmArgument Identifier
+ HiLink btmVariable Identifier
+ HiLink btmEcho String
+ HiLink btmBIFMatch btmStatement
+ HiLink btmBuiltInFunc btmStatement
+ HiLink btmBuiltInVar btmStatement
+ HiLink btmSpecialVar btmStatement
+ HiLink btmCommand btmStatement
+
+ "optional highlighting
+ "HiLink btmShowTab Error
+ "HiLink btmShowTabc Error
+ "hiLink btmIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "btm"
+
+" vim: ts=8
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
new file mode 100644
index 000000000..759bebb68
--- /dev/null
+++ b/runtime/syntax/c.vim
@@ -0,0 +1,345 @@
+" Vim syntax file
+" Language: C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2004 Feb 04
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful C keywords
+syn keyword cStatement goto break return continue asm
+syn keyword cLabel case default
+syn keyword cConditional if else switch
+syn keyword cRepeat while for do
+
+syn keyword cTodo contained TODO FIXME XXX
+
+" cCommentGroup allows adding matches for special things in comments
+syn cluster cCommentGroup contains=cTodo
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+if !exists("c_no_utf")
+ syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
+endif
+if exists("c_no_cformat")
+ syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell
+ " cCppString: same as cString, but ends at end of line
+ syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,@Spell
+else
+ syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
+ syn match cFormat display "%%" contained
+ syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell
+ " cCppString: same as cString, but ends at end of line
+ syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+endif
+
+syn match cCharacter "L\='[^\\]'"
+syn match cCharacter "L'[^']*'" contains=cSpecial
+if exists("c_gnu")
+ syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
+ syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
+else
+ syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
+ syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
+endif
+syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
+syn match cSpecialCharacter display "'\\x\x\{1,2}'"
+syn match cSpecialCharacter display "L'\\x\x\+'"
+
+"when wanted, highlight trailing white space
+if exists("c_space_errors")
+ if !exists("c_no_trail_space_error")
+ syn match cSpaceError display excludenl "\s\+$"
+ endif
+ if !exists("c_no_tab_space_error")
+ syn match cSpaceError display " \+\t"me=e-1
+ endif
+endif
+
+"catch errors caused by wrong parenthesis and brackets
+" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
+" But avoid matching <::.
+syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cCommentSkip,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
+if exists("c_no_bracket_error")
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+ syn match cParenError display ")"
+ syn match cErrInParen display contained "[{}]\|<%\|%>"
+else
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
+ syn match cParenError display "[\])]"
+ syn match cErrInParen display contained "[\]{}]\|<%\|%>"
+ syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+ " cCppBracket: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
+ syn match cErrInBracket display contained "[);{}]\|<%\|%>"
+endif
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
+" Same, but without octal error (for comments)
+syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal
+syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
+syn match cOctalZero display contained "\<0"
+syn match cFloat display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+if !exists("c_no_c99")
+ "hexadecimal floating point number, optional leading digits, with dot, with exponent
+ syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
+ "hexadecimal floating point number, with leading digits, optional dot, with exponent
+ syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
+endif
+
+" flag an octal number with wrong digits
+syn match cOctalError display contained "0\o*[89]\d*"
+syn case match
+
+if exists("c_comment_strings")
+ " A comment can contain cString, cCharacter and cNumber.
+ " But a "*/" inside a cString in a cComment DOES end the comment! So we
+ " need to use a special type of cString: cCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
+ syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
+ syntax region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
+ syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell
+else
+ syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
+endif
+" keep a // comment separately, it terminates a preproc. conditional
+syntax match cCommentError display "\*/"
+syntax match cCommentStartError display "/\*"me=e-1 contained
+
+syn keyword cOperator sizeof
+if exists("c_gnu")
+ syn keyword cStatement __asm__
+ syn keyword cOperator typeof __real__ __imag__
+endif
+syn keyword cType int long short char void
+syn keyword cType signed unsigned float double
+if !exists("c_no_ansi") || exists("c_ansi_typedefs")
+ syn keyword cType size_t ssize_t wchar_t ptrdiff_t sig_atomic_t fpos_t
+ syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
+ syn keyword cType mbstate_t wctrans_t wint_t wctype_t
+endif
+if !exists("c_no_c99") " ISO C99
+ syn keyword cType bool complex
+ syn keyword cType int8_t int16_t int32_t int64_t
+ syn keyword cType uint8_t uint16_t uint32_t uint64_t
+ syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
+ syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+ syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
+ syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
+ syn keyword cType intptr_t uintptr_t
+ syn keyword cType intmax_t uintmax_t
+endif
+if exists("c_gnu")
+ syn keyword cType __label__ __complex__ __volatile__
+endif
+
+syn keyword cStructure struct union enum typedef
+syn keyword cStorageClass static register auto volatile extern const
+if exists("c_gnu")
+ syn keyword cStorageClass inline __attribute__
+endif
+if !exists("c_no_c99")
+ syn keyword cStorageClass inline restrict
+endif
+
+if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
+ if exists("c_gnu")
+ syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__
+ endif
+ syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
+ syn keyword cConstant __STDC_VERSION__
+ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
+ syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
+ syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
+ syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
+ syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
+ syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
+ if !exists("c_no_c99")
+ syn keyword cConstant LLONG_MAX ULLONG_MAX
+ syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
+ syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
+ syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
+ syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
+ syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
+ syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
+ syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
+ syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
+ syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
+ syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
+ syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
+ syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
+ syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
+ endif
+ syn keyword cConstant FLT_RADIX FLT_ROUNDS
+ syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
+ syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
+ syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
+ syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
+ syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
+ syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
+ syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
+ syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
+ syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
+ syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
+ syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
+ syn keyword cConstant LC_NUMERIC LC_TIME
+ syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
+ syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
+ " Add POSIX signals as well...
+ syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
+ syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
+ syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
+ syn keyword cConstant SIGUSR1 SIGUSR2
+ syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
+ syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
+ syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
+ syn keyword cConstant TMP_MAX stderr stdin stdout
+ syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
+ " Add POSIX errors as well
+ syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
+ syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
+ syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
+ syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
+ syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
+ syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
+ syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
+ " math.h
+ syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
+ syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
+endif
+if !exists("c_no_c99") " ISO C99
+ syn keyword cConstant true false
+endif
+
+" Accept %: for # (C99)
+syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+if !exists("c_no_if0")
+ syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
+ syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
+ syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
+endif
+syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match cIncluded display contained "<[^>]*>"
+syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+"syn match cLineSkip "\\$"
+syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti
+syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@cPreProcGroup,@Spell
+syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+
+" Highlight User Labels
+syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
+syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+syn cluster cLabelGroup contains=cUserLabel
+syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+
+syn match cUserLabel display "\I\i*" contained
+
+" Avoid recognizing most bitfields as labels
+syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1
+syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1
+
+if exists("c_minlines")
+ let b:c_minlines = c_minlines
+else
+ if !exists("c_no_if0")
+ let b:c_minlines = 50 " #if 0 constructs can be long
+ else
+ let b:c_minlines = 15 " mostly for () constructs
+ endif
+endif
+exec "syn sync ccomment cComment minlines=" . b:c_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_c_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cFormat cSpecial
+ HiLink cCppString cString
+ HiLink cCommentL cComment
+ HiLink cCommentStart cComment
+ HiLink cLabel Label
+ HiLink cUserLabel Label
+ HiLink cConditional Conditional
+ HiLink cRepeat Repeat
+ HiLink cCharacter Character
+ HiLink cSpecialCharacter cSpecial
+ HiLink cNumber Number
+ HiLink cOctal Number
+ HiLink cOctalZero PreProc " link this to Error if you want
+ HiLink cFloat Float
+ HiLink cOctalError cError
+ HiLink cParenError cError
+ HiLink cErrInParen cError
+ HiLink cErrInBracket cError
+ HiLink cCommentError cError
+ HiLink cCommentStartError cError
+ HiLink cSpaceError cError
+ HiLink cSpecialError cError
+ HiLink cOperator Operator
+ HiLink cStructure Structure
+ HiLink cStorageClass StorageClass
+ HiLink cInclude Include
+ HiLink cPreProc PreProc
+ HiLink cDefine Macro
+ HiLink cIncluded cString
+ HiLink cError Error
+ HiLink cStatement Statement
+ HiLink cPreCondit PreCondit
+ HiLink cType Type
+ HiLink cConstant Constant
+ HiLink cCommentString cString
+ HiLink cComment2String cString
+ HiLink cCommentSkip cComment
+ HiLink cString String
+ HiLink cComment Comment
+ HiLink cSpecial SpecialChar
+ HiLink cTodo Todo
+ HiLink cCppSkip cCppOut
+ HiLink cCppOut2 cCppOut
+ HiLink cCppOut Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "c"
+
+" vim: ts=8
diff --git a/runtime/syntax/calendar.vim b/runtime/syntax/calendar.vim
new file mode 100644
index 000000000..9834267ae
--- /dev/null
+++ b/runtime/syntax/calendar.vim
@@ -0,0 +1,104 @@
+" Vim syntax file
+" Language: calendar(1) file.
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/calendar/
+" Latest Revision: 2004-05-06
+" arch-tag: d714127d-469d-43bd-9c79-c2a46ec54535
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Todo
+syn keyword calendarTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region calendarComment matchgroup=calendarComment start='/\*' end='\*/' contains=calendarTodo
+
+" Strings
+syn region calendarCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=calendarSpecial
+syn match calendarSpecial display contained '\\\%(x\x\+\|\o\{1,3}\|.\|$\)'
+syn match calendarSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
+
+" cpp(1) Preprocessor directives (adapted from syntax/c.vim)
+
+syn region calendarPreCondit start='^\s*#\s*\%(if\|ifdef\|ifndef\|elif\)\>' skip='\\$' end='$' contains=calendarComment,calendarCppString
+syn match calendarPreCondit display '^\s*#\s*\%(else\|endif\)\>'
+syn region calendarCppOut start='^\s*#\s*if\s\+0\+' end='.\@=\|$' contains=calendarCppOut2
+syn region calendarCppOut2 contained start='0' end='^\s*#\s*\%(endif\|else\|elif\)\>' contains=calendarSpaceError,calendarCppSkip
+syn region calendarCppSkip contained start='^\s*#\s*\%(if\|ifdef\|ifndef\)\>' skip='\\$' end='^\s*#\s*endif\>' contains=calendarSpaceError,calendarCppSkip
+syn region calendarIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match calendarIncluded display contained '<[^>]*>'
+syn match calendarInclude display '^\s*#\s*include\>\s*["<]' contains=calendarIncluded
+syn cluster calendarPreProcGroup contains=calendarPreCondit,calendarIncluded,calendarInclude,calendarDefine,calendarCppOut,calendarCppOut2,calendarCppSkip,calendarString,calendarSpecial,calendarTodo
+syn region calendarDefine start='^\s*#\s*\%(define\|undef\)\>' skip='\\$' end='$' contains=ALLBUT,@calendarPreProcGroup
+syn region calendarPreProc start='^\s*#\s*\%(pragma\|line\|warning\|warn\|error\)\>' skip='\\$' end='$' keepend contains=ALLBUT,@calendarPreProcGroup
+
+" Keywords
+syn keyword calendarKeyword CHARSET BODUN LANG
+syn case ignore
+syn keyword calendarKeyword Easter Pashka
+syn case match
+
+" Dates
+syn case ignore
+syn match calendarNumber '\<\d\+\>'
+syn keyword calendarMonth Jan[uary] Feb[ruary] Mar[ch] Apr[il] May Jun[e]
+syn keyword calendarMonth Jul[y] Aug[ust] Sep[tember] Oct[ober]
+syn keyword calendarMonth Nov[ember] Dec[ember]
+syn match calendarMonth '\<\%(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\.'
+syn keyword calendarWeekday Mon[day] Tue[sday] Wed[nesday] Thu[rsday]
+syn keyword calendarWeekday Fri[day] Sat[urday] Sun[day]
+syn match calendarWeekday '\<\%(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\)\.' nextgroup=calendarWeekdayMod
+syn match calendarWeekdayMod '[+-]\d\+\>'
+syn case match
+
+" Times
+syn match calendarTime '\<\%([01]\=\d\|2[0-3]\):[0-5]\d\%(:[0-5]\d\)\='
+syn match calendarTime '\<\%(0\=[1-9]\|1[0-2]\):[0-5]\d\%(:[0-5]\d\)\=\s*[AaPp][Mm]'
+
+" Variables
+syn match calendarVariable '\*'
+
+let b:c_minlines = 50 " #if 0 constructs can be long
+exec "syn sync ccomment calendarComment minlines=" . b:c_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_calendar_syn_inits")
+ if version < 508
+ let did_calendar_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink calendarTodo Todo
+ HiLink calendarComment Comment
+ HiLink calendarCppString String
+ HiLink calendarSpecial SpecialChar
+ HiLink calendarPreCondit PreCondit
+ HiLink calendarCppOut Comment
+ HiLink calendarCppOut2 calendarCppOut
+ HiLink calendarCppSkip calendarCppOut
+ HiLink calendarIncluded String
+ HiLink calendarInclude Include
+ HiLink calendarDefine Macro
+ HiLink calendarPreProc PreProc
+ HiLink calendarKeyword Keyword
+ HiLink calendarNumber Number
+ HiLink calendarMonth String
+ HiLink calendarWeekday String
+ HiLink calendarWeekdayMod Special
+ HiLink calendarTime Number
+ HiLink calendarVariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "calendar"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/catalog.vim b/runtime/syntax/catalog.vim
new file mode 100644
index 000000000..2f8e388eb
--- /dev/null
+++ b/runtime/syntax/catalog.vim
@@ -0,0 +1,30 @@
+" Vim syntax file
+" Language: sgml catalog file
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" Filenames: /etc/sgml.catalog
+" $Id$
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" strings
+syn region catalogString start=+"+ skip=+\\\\\|\\"+ end=+"+ keepend
+syn region catalogString start=+'+ skip=+\\\\\|\\'+ end=+'+ keepend
+
+syn region catalogComment start=+--+ end=+--+ contains=catalogTodo
+syn keyword catalogTodo TODO FIXME XXX contained display
+syn keyword catalogKeyword DOCTYPE OVERRIDE PUBLIC DTDDECL ENTITY display
+
+
+" The default highlighting.
+hi def link catalogString String
+hi def link catalogComment Comment
+hi def link catalogTodo Todo
+hi def link catalogKeyword Statement
+
+let b:current_syntax = "catalog"
diff --git a/runtime/syntax/cdl.vim b/runtime/syntax/cdl.vim
new file mode 100644
index 000000000..69f124bdd
--- /dev/null
+++ b/runtime/syntax/cdl.vim
Binary files differ
diff --git a/runtime/syntax/cf.vim b/runtime/syntax/cf.vim
new file mode 100644
index 000000000..6cf111d99
--- /dev/null
+++ b/runtime/syntax/cf.vim
@@ -0,0 +1,151 @@
+" Vim syntax file
+" Language: Cold Fusion
+" Maintainer: Jeff Lanzarotta (jefflanzarotta@yahoo.com)
+" URL: http://lanzarotta.tripod.com/vim/syntax/cf.vim.zip
+" Last Change: October 15, 2001
+" Usage: Since Cold Fusion has its own version of html comments,
+" make sure that you put
+" 'let html_wrong_comments=1' in your _vimrc file.
+
+" For version 5.x, clear all syntax items.
+" For version 6.x, quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Use all the stuff from the original html syntax file.
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+
+" Tag names.
+syn keyword cfTagName contained cfabort cfapplet cfapplication cfassociate
+syn keyword cfTagName contained cfauthenticate cfbreak cfcache cfcol
+syn keyword cfTagName contained cfcollection cfcontent cfcookie cfdirectory
+syn keyword cfTagName contained cferror cfexit cffile cfform cfftp cfgrid
+syn keyword cfTagName contained cfgridcolumn cfgridrow cfgridupdate cfheader
+syn keyword cfTagName contained cfhtmlhead cfhttp cfhttpparam
+syn keyword cfTagName contained cfif cfelseif cfelse
+syn keyword cfTagName contained cfinclude cfindex cfinput cfinsert
+syn keyword cfTagName contained cfldap cflocation cflock cfloop cfmail
+syn keyword cfTagName contained cfmodule cfobject cfoutput cfparam cfpop
+syn keyword cfTagName contained cfprocparam cfprocresult cfquery cfregistry
+syn keyword cfTagName contained cfreport cfschedule cfscript cfsearch cfselect
+syn keyword cfTagName contained cfset cfsetting cfslider cfstoredproc
+syn keyword cfTagName contained cfswitch cfcase cfdefaultcase
+syn keyword cfTagName contained cftable cftextinput cfthrow cftransaction
+syn keyword cfTagName contained cftree cftreeitem
+syn keyword cfTagName contained cftry cfcatch
+syn keyword cfTagName contained cfupdate cfwddx
+
+" Legal arguments.
+syn keyword cfArg contained accept action addnewline addtoken agentname align
+syn keyword cfArg contained appendkey applicationtimeout attachmentpath
+syn keyword cfArg contained attributecollection attributes basetag bgcolor
+syn keyword cfArg contained blockfactor body bold border branch cachedafter
+syn keyword cfArg contained cachedwithin cc cfsqltype checked class clientmanagement
+syn keyword cfArg contained clientstorage colheaderalign colheaderbold colheaderfont
+syn keyword cfArg contained colheaderfontsize colheaderitalic colheaders collection
+syn keyword cfArg contained colspacing columns completepath connection context
+syn keyword cfArg contained criteria custom1 custom2 data dataalign datacollection
+syn keyword cfArg contained datasource dbname dbserver dbtype dbvarname debug default
+syn keyword cfArg contained delete deletebutton deletefile delimiter destination detail
+syn keyword cfArg contained directory display dn domain enablecab enablecfoutputonly
+syn keyword cfArg contained enctype enddate endtime entry errorcode expand expires
+syn keyword cfArg contained expireurl expression extendedinfo extensions external
+syn keyword cfArg contained file filefield filter font fontsize formfields formula
+syn keyword cfArg contained from grid griddataalign gridlines groovecolor group header
+syn keyword cfArg contained headeralign headerbold headerfont headerfontsize headeritalic
+syn keyword cfArg contained headerlines height highlighthref href hrefkey hscroll hspace
+syn keyword cfArg contained htmltable img imgopen imgstyle index input insert insertbutton
+syn keyword cfArg contained interval isolation italic key keyonly label language mailerid
+syn keyword cfArg contained mailto maxlength maxrows message messagenumber method
+syn keyword cfArg contained mimeattach mode multiple name namecomplict newdirectory
+syn keyword cfArg contained notsupported null numberformat onerror onsubmit onvalidate
+syn keyword cfArg contained operation orderby output parrent passthrough password path
+syn keyword cfArg contained picturebar port procedure protocol provider providerdsn
+syn keyword cfArg contained proxybypass proxyserver publish query queryasroot range
+syn keyword cfArg contained recurse refreshlabel report requesttimeout required reset
+syn keyword cfArg contained resoleurl resultset retrycount returncode rowheaderalign
+syn keyword cfArg contained rowheaderbold rowheaderfont rowheaderfontsize rowheaderitalic
+syn keyword cfArg contained rowheaders rowheaderwidth rowheight scale scope secure
+syn keyword cfArg contained securitycontext select selectcolor selected selectmode server
+syn keyword cfArg contained sessionmanagement sessiontimeout setclientcookies setcookie
+syn keyword cfArg contained showdebugoutput showerror size sort sortascendingbutton
+syn keyword cfArg contained sortdescendingbutton source sql start startdate startrow starttime
+syn keyword cfArg contained step stoponerror subject tablename tableowner tablequalifier
+syn keyword cfArg contained target task template text textcolor textqualifier
+syn keyword cfArg contained throwonfailure throwontimeout timeout title to toplevelvariable
+syn keyword cfArg contained type url urlpath username usetimezoneinfo validate value
+syn keyword cfArg contained variable vscroll vspace width
+
+" Cold Fusion Functions.
+syn keyword cfFunctionName contained Abs ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt
+syn keyword cfFunctionName contained ArrayInsertAt ArrayIsEmpty ArrayLen ArrayMax
+syn keyword cfFunctionName contained ArrayMin ArrayNew ArrayPrepend ArrayResize ArraySet
+syn keyword cfFunctionName contained ArraySort ArraySum ArraySwap ArrayToList Asc Atn
+syn keyword cfFunctionName contained BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot
+syn keyword cfFunctionName contained BitOr BitSHLN BitSHRN BitXor CJustify Ceiling Chr
+syn keyword cfFunctionName contained Compare CompareNoCase Cos CreateDate CreateDateTime
+syn keyword cfFunctionName contained CreateODBCDate CreateODBCDateTime CreateODBCTime
+syn keyword cfFunctionName contained CreateTime CreateTimeSpan DE DateAdd DateCompare DateDiff
+syn keyword cfFunctionName contained DateFormat DatePart Day DayOfWeek DayOfWeekAsString
+syn keyword cfFunctionName contained DayOfYear DaysInMonth DaysInYear DecimalFormat DecrementValue
+syn keyword cfFunctionName contained Decrypt DeleteClientVariable DirectoryExists DollarFormat
+syn keyword cfFunctionName contained Encrypt Evaluate Exp ExpandPath FileExists Find FindNoCase
+syn keyword cfFunctionName contained FindOneOf FirstDayOfMonth Fix FormatBaseN GetBaseTagData
+syn keyword cfFunctionName contained GetBaseTagList GetClientVariablesList GetDirectoryFromPath
+syn keyword cfFunctionName contained GetFileFromPath GetLocale GetTempDirectory GetTempFile
+syn keyword cfFunctionName contained GetTemplatePath GetTickCount GetToken HTMLCodeFormat
+syn keyword cfFunctionName contained HTMLEditFormat Hour IIf IncrementValue InputBaseN Insert
+syn keyword cfFunctionName contained Int IsArray IsAuthenticated IsAuthorized IsBoolean IsDate
+syn keyword cfFunctionName contained IsDebugMode IsDefined IsLeapYear IsNumeric IsNumericDate
+syn keyword cfFunctionName contained IsQuery IsSimpleValue IsStruct LCase LJustify LSCurrencyFormat
+syn keyword cfFunctionName contained LSDateFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat
+syn keyword cfFunctionName contained LSParseCurrency LSParseDateTime LSParseNumber LSTimeFormat
+syn keyword cfFunctionName contained LTrim Left Len ListAppend ListChangeDelims ListContains
+syn keyword cfFunctionName contained ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst
+syn keyword cfFunctionName contained ListGetAt ListInsertAt ListLast ListLen ListPrepend ListRest
+syn keyword cfFunctionName contained ListSetAt ListToArray Log Log10 Max Mid Min Minute Month
+syn keyword cfFunctionName contained MonthAsString Now NumberFormat ParagraphFormat ParameterExists
+syn keyword cfFunctionName contained ParseDateTime Pi PreserveSingleQuotes Quarter QueryAddRow
+syn keyword cfFunctionName contained QueryNew QuerySetCell QuotedValueList REFind REFindNoCase
+syn keyword cfFunctionName contained REReplace REReplaceNoCase RJustify RTrim Rand RandRange
+syn keyword cfFunctionName contained Randomize RemoveChars RepeatString Replace ReplaceList
+syn keyword cfFunctionName contained ReplaceNoCase Reverse Right Round Second SetLocale SetVariable
+syn keyword cfFunctionName contained Sgn Sin SpanExcluding SpanIncluding Sqr StripCR StructClear
+syn keyword cfFunctionName contained StructCopy StructCount StructDelete StructFind StructInsert
+syn keyword cfFunctionName contained StructIsEmpty StructKeyExists StructNew StructUpdate Tan
+syn keyword cfFunctionName contained TimeFormat Trim UCase URLEncodedFormat Val ValueList Week
+syn keyword cfFunctionName contained WriteOutput Year YesNoFormat
+
+syn cluster htmlTagNameCluster add=cfTagName
+syn cluster htmlArgCluster add=cfArg,cfFunctionName
+
+syn region cfFunctionRegion start='#' end='#' contains=cfFunctionName
+
+" Define the default highlighting.
+" For version 5.x and earlier, only when not done already.
+" For version 5.8 and later, only when and item doesn't have highlighting yet.
+if version >= 508 || !exists("did_cf_syn_inits")
+ if version < 508
+ let did_cf_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cfTagName Statement
+ HiLink cfArg Type
+ HiLink cfFunctionName Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cf"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/cfg.vim b/runtime/syntax/cfg.vim
new file mode 100644
index 000000000..c6e8b2953
--- /dev/null
+++ b/runtime/syntax/cfg.vim
@@ -0,0 +1,60 @@
+" Vim syntax file
+" Language: Good old CFG files
+" Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
+" Last change: 2001 Sep 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists ("b:current_syntax")
+ finish
+endif
+
+" case off
+syn case ignore
+syn keyword CfgOnOff ON OFF YES NO TRUE FALSE contained
+syn match UncPath "\\\\\p*" contained
+"Dos Drive:\Path
+syn match CfgDirectory "[a-zA-Z]:\\\p*" contained
+"Parameters
+syn match CfgParams ".*="me=e-1 contains=CfgComment
+"... and their values (don't want to highlight '=' sign)
+syn match CfgValues "=.*"hs=s+1 contains=CfgDirectory,UncPath,CfgComment,CfgString,CfgOnOff
+
+" Sections
+syn match CfgSection "\[.*\]"
+syn match CfgSection "{.*}"
+
+" String
+syn match CfgString "\".*\"" contained
+syn match CfgString "'.*'" contained
+
+" Comments (Everything before '#' or '//' or ';')
+syn match CfgComment "#.*"
+syn match CfgComment ";.*"
+syn match CfgComment "\/\/.*"
+
+" Define the default hightlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cfg_syn_inits")
+ if version < 508
+ let did_cfg_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink CfgOnOff Label
+ HiLink CfgComment Comment
+ HiLink CfgSection Type
+ HiLink CfgString String
+ HiLink CfgParams Keyword
+ HiLink CfgValues Constant
+ HiLink CfgDirectory Directory
+ HiLink UncPath Directory
+
+ delcommand HiLink
+endif
+let b:current_syntax = "cfg"
+" vim:ts=8
diff --git a/runtime/syntax/ch.vim b/runtime/syntax/ch.vim
new file mode 100644
index 000000000..2e787c8cc
--- /dev/null
+++ b/runtime/syntax/ch.vim
@@ -0,0 +1,53 @@
+" Vim syntax file
+" Language: Ch
+" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
+" URL: http://www.softintegration.com/download/vim/syntax/ch.vim
+" Last change: 2004 May 16
+" Created based on cpp.vim
+"
+" Ch is a C/C++ interpreter with many high level extensions
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ so <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+ unlet b:current_syntax
+endif
+
+" Ch extentions
+
+syn keyword chStatement new delete this
+syn keyword chAccess public private
+syn keyword chStorageClass __declspec(global) __declspec(local)
+syn keyword chStructure class
+syn keyword chType string_t array
+
+" Default highlighting
+if version >= 508 || !exists("did_ch_syntax_inits")
+ if version < 508
+ let did_ch_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink chAccess chStatement
+ HiLink chExceptions Exception
+ HiLink chStatement Statement
+ HiLink chType Type
+ HiLink chStructure Structure
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ch"
+
+" vim: ts=8
diff --git a/runtime/syntax/change.vim b/runtime/syntax/change.vim
new file mode 100644
index 000000000..e9bf88b9d
--- /dev/null
+++ b/runtime/syntax/change.vim
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language: WEB Changes
+" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
+" Last Change: April 25, 2001
+
+" Details of the change mechanism of the WEB and CWEB languages can be found
+" in the articles by Donald E. Knuth and Silvio Levy cited in "web.vim" and
+" "cweb.vim" respectively.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" We distinguish two groups of material, (a) stuff between @x..@y, and
+" (b) stuff between @y..@z. WEB/CWEB ignore everything else in a change file.
+syn region changeFromMaterial start="^@x.*$"ms=e+1 end="^@y.*$"me=s-1
+syn region changeToMaterial start="^@y.*$"ms=e+1 end="^@z.*$"me=s-1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_change_syntax_inits")
+ if version < 508
+ let did_change_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink changeFromMaterial String
+ HiLink changeToMaterial Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "change"
+
+" vim: ts=8
diff --git a/runtime/syntax/changelog.vim b/runtime/syntax/changelog.vim
new file mode 100644
index 000000000..a3eddda5f
--- /dev/null
+++ b/runtime/syntax/changelog.vim
@@ -0,0 +1,78 @@
+" Vim syntax file
+" Language: generic ChangeLog file
+" Written By: Gediminas Paulauskas <menesis@delfi.lt>
+" Maintainer: Corinna Vinschen <vinschen@redhat.com>
+" Last Change: June 1, 2003
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+if exists('b:changelog_spacing_errors')
+ let s:spacing_errors = b:changelog_spacing_errors
+elseif exists('g:changelog_spacing_errors')
+ let s:spacing_errors = g:changelog_spacing_errors
+else
+ let s:spacing_errors = 1
+endif
+
+if s:spacing_errors
+ syn match changelogError "^ \+"
+endif
+
+syn match changelogText "^\s.*$" contains=changelogMail,changelogNumber,changelogMonth,changelogDay,changelogError
+syn match changelogHeader "^\S.*$" contains=changelogNumber,changelogMonth,changelogDay,changelogMail
+if version < 600
+ syn region changelogFiles start="^\s\+[+*]\s" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
+ syn region changelogFiles start="^\s\+[([]" end=":\s" end="^$" contains=changelogBullet,changelogColon,changelogError keepend
+ syn match changelogColon contained ":\s"
+else
+ syn region changelogFiles start="^\s\+[+*]\s" end=":" end="^$" contains=changelogBullet,changelogColon,changeLogFuncs,changelogError keepend
+ syn region changelogFiles start="^\s\+[([]" end=":" end="^$" contains=changelogBullet,changelogColon,changeLogFuncs,changelogError keepend
+ syn match changeLogFuncs contained "(.\{-})" extend
+ syn match changeLogFuncs contained "\[.\{-}]" extend
+ syn match changelogColon contained ":"
+endif
+syn match changelogBullet contained "^\s\+[+*]\s" contains=changelogError
+syn match changelogMail contained "<[A-Za-z0-9\._:+-]\+@[A-Za-z0-9\._-]\+>"
+syn keyword changelogMonth contained jan feb mar apr may jun jul aug sep oct nov dec
+syn keyword changelogDay contained mon tue wed thu fri sat sun
+syn match changelogNumber contained "[.-]*[0-9]\+"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_changelog_syntax_inits")
+ if version < 508
+ let did_changelog_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink changelogText Normal
+ HiLink changelogBullet Type
+ HiLink changelogColon Type
+ HiLink changelogFiles Comment
+ if version >= 600
+ HiLink changelogFuncs Comment
+ endif
+ HiLink changelogHeader Statement
+ HiLink changelogMail Special
+ HiLink changelogNumber Number
+ HiLink changelogMonth Number
+ HiLink changelogDay Number
+ HiLink changelogError Folded
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "changelog"
+
+" vim: ts=8
diff --git a/runtime/syntax/chaskell.vim b/runtime/syntax/chaskell.vim
new file mode 100644
index 000000000..3f764d0e8
--- /dev/null
+++ b/runtime/syntax/chaskell.vim
@@ -0,0 +1,18 @@
+" Vim syntax file
+" Language: Haskell supporting c2hs binding hooks
+" Maintainer: Armin Sander <armin@mindwalker.org>
+" Last Change: 2001 November 1
+"
+" 2001 November 1: Changed commands for sourcing haskell.vim
+
+" Enable binding hooks
+let b:hs_chs=1
+
+" Include standard Haskell highlighting
+if version < 600
+ source <sfile>:p:h/haskell.vim
+else
+ runtime! syntax/haskell.vim
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/cheetah.vim b/runtime/syntax/cheetah.vim
new file mode 100644
index 000000000..7eb17567c
--- /dev/null
+++ b/runtime/syntax/cheetah.vim
@@ -0,0 +1,60 @@
+" Vim syntax file
+" Language: Cheetah template engine
+" Maintainer: Max Ischenko <mfi@ukr.net>
+" Last Change: 2003-05-11
+"
+" Missing features:
+" match invalid syntax, like bad variable ref. or unmatched closing tag
+" PSP-style tags: <% .. %> (obsoleted feature)
+" doc-strings and header comments (rarely used feature)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case match
+
+syn keyword cheetahKeyword contained if else unless elif for in not
+syn keyword cheetahKeyword contained while repeat break continue pass end
+syn keyword cheetahKeyword contained set del attr def global include raw echo
+syn keyword cheetahKeyword contained import from extends implements
+syn keyword cheetahKeyword contained assert raise try catch finally
+syn keyword cheetahKeyword contained errorCatcher breakpoint silent cache filter
+syn match cheetahKeyword contained "\<compiler-settings\>"
+
+" Matches cached placeholders
+syn match cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?\h\w*\(\.\h\w*\)*" display
+syn match cheetahPlaceHolder "$\(\*[0-9.]\+[wdhms]\?\*\|\*\)\?{\h\w*\(\.\h\w*\)*}" display
+syn match cheetahDirective "^\s*#[^#].*$" contains=cheetahPlaceHolder,cheetahKeyword,cheetahComment display
+
+syn match cheetahContinuation "\\$"
+syn match cheetahComment "##.*$" display
+syn region cheetahMultiLineComment start="#\*" end="\*#"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cheetah_syn_inits")
+ if version < 508
+ let did_cheetah_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cheetahPlaceHolder Identifier
+ HiLink cheetahDirective PreCondit
+ HiLink cheetahKeyword Define
+ HiLink cheetahContinuation Special
+ HiLink cheetahComment Comment
+ HiLink cheetahMultiLineComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cheetah"
+
diff --git a/runtime/syntax/chill.vim b/runtime/syntax/chill.vim
new file mode 100644
index 000000000..ca00cd95e
--- /dev/null
+++ b/runtime/syntax/chill.vim
@@ -0,0 +1,191 @@
+" Vim syntax file
+" Language: CHILL
+" Maintainer: YoungSang Yoon <image@lgic.co.kr>
+" Last change: 2004 Jan 21
+"
+
+" first created by image@lgic.co.kr & modified by paris@lgic.co.kr
+
+" CHILL (CCITT High Level Programming Language) is used for
+" developing software of ATM switch at LGIC (LG Information
+" & Communications LTd.)
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful CHILL keywords
+syn keyword chillStatement goto GOTO return RETURN returns RETURNS
+syn keyword chillLabel CASE case ESAC esac
+syn keyword chillConditional if IF else ELSE elsif ELSIF switch SWITCH THEN then FI fi
+syn keyword chillLogical NOT not
+syn keyword chillRepeat while WHILE for FOR do DO od OD TO to
+syn keyword chillProcess START start STACKSIZE stacksize PRIORITY priority THIS this STOP stop
+syn keyword chillBlock PROC proc PROCESS process
+syn keyword chillSignal RECEIVE receive SEND send NONPERSISTENT nonpersistent PERSISTENT peristent SET set EVER ever
+
+syn keyword chillTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match chillSpecial contained "\\x\x\+\|\\\o\{1,3\}\|\\.\|\\$"
+syn region chillString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=chillSpecial
+syn match chillCharacter "'[^\\]'"
+syn match chillSpecialCharacter "'\\.'"
+syn match chillSpecialCharacter "'\\\o\{1,3\}'"
+
+"when wanted, highlight trailing white space
+if exists("chill_space_errors")
+ syn match chillSpaceError "\s*$"
+ syn match chillSpaceError " \+\t"me=e-1
+endif
+
+"catch errors caused by wrong parenthesis
+syn cluster chillParenGroup contains=chillParenError,chillIncluded,chillSpecial,chillTodo,chillUserCont,chillUserLabel,chillBitField
+syn region chillParen transparent start='(' end=')' contains=ALLBUT,@chillParenGroup
+syn match chillParenError ")"
+syn match chillInParen contained "[{}]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match chillNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match chillFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match chillFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match chillFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match chillNumber "\<0x\x\+\(u\=l\=\|lu\)\>"
+"syn match chillIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+" flag an octal number with wrong digits
+syn match chillOctalError "\<0\o*[89]"
+
+if exists("chill_comment_strings")
+ " A comment can contain chillString, chillCharacter and chillNumber.
+ " But a "*/" inside a chillString in a chillComment DOES end the comment! So we
+ " need to use a special type of chillString: chillCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match chillCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region chillCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=chillSpecial,chillCommentSkip
+ syntax region chillComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=chillSpecial
+ syntax region chillComment start="/\*" end="\*/" contains=chillTodo,chillCommentString,chillCharacter,chillNumber,chillFloat,chillSpaceError
+ syntax match chillComment "//.*" contains=chillTodo,chillComment2String,chillCharacter,chillNumber,chillSpaceError
+else
+ syn region chillComment start="/\*" end="\*/" contains=chillTodo,chillSpaceError
+ syn match chillComment "//.*" contains=chillTodo,chillSpaceError
+endif
+syntax match chillCommentError "\*/"
+
+syn keyword chillOperator SIZE size
+syn keyword chillType dcl DCL int INT char CHAR bool BOOL REF ref LOC loc INSTANCE instance
+syn keyword chillStructure struct STRUCT enum ENUM newmode NEWMODE synmode SYNMODE
+"syn keyword chillStorageClass
+syn keyword chillBlock PROC proc END end
+syn keyword chillScope GRANT grant SEIZE seize
+syn keyword chillEDML select SELECT delete DELETE update UPDATE in IN seq SEQ WHERE where INSERT insert include INCLUDE exclude EXCLUDE
+syn keyword chillBoolConst true TRUE false FALSE
+
+syn region chillPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=chillComment,chillString,chillCharacter,chillNumber,chillCommentError,chillSpaceError
+syn region chillIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match chillIncluded contained "<[^>]*>"
+syn match chillInclude "^\s*#\s*include\>\s*["<]" contains=chillIncluded
+"syn match chillLineSkip "\\$"
+syn cluster chillPreProcGroup contains=chillPreCondit,chillIncluded,chillInclude,chillDefine,chillInParen,chillUserLabel
+syn region chillDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,@chillPreProcGroup
+syn region chillPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,@chillPreProcGroup
+
+" Highlight User Labels
+syn cluster chillMultiGroup contains=chillIncluded,chillSpecial,chillTodo,chillUserCont,chillUserLabel,chillBitField
+syn region chillMulti transparent start='?' end=':' contains=ALLBUT,@chillMultiGroup
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+syn match chillUserCont "^\s*\I\i*\s*:$" contains=chillUserLabel
+syn match chillUserCont ";\s*\I\i*\s*:$" contains=chillUserLabel
+syn match chillUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=chillUserLabel
+syn match chillUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=chillUserLabel
+
+syn match chillUserLabel "\I\i*" contained
+
+" Avoid recognizing most bitfields as labels
+syn match chillBitField "^\s*\I\i*\s*:\s*[1-9]"me=e-1
+syn match chillBitField ";\s*\I\i*\s*:\s*[1-9]"me=e-1
+
+syn match chillBracket contained "[<>]"
+if !exists("chill_minlines")
+ let chill_minlines = 15
+endif
+exec "syn sync ccomment chillComment minlines=" . chill_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ch_syntax_inits")
+ if version < 508
+ let did_ch_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink chillLabel Label
+ HiLink chillUserLabel Label
+ HiLink chillConditional Conditional
+ " hi chillConditional term=bold ctermfg=red guifg=red gui=bold
+
+ HiLink chillRepeat Repeat
+ HiLink chillProcess Repeat
+ HiLink chillSignal Repeat
+ HiLink chillCharacter Character
+ HiLink chillSpecialCharacter chillSpecial
+ HiLink chillNumber Number
+ HiLink chillFloat Float
+ HiLink chillOctalError chillError
+ HiLink chillParenError chillError
+ HiLink chillInParen chillError
+ HiLink chillCommentError chillError
+ HiLink chillSpaceError chillError
+ HiLink chillOperator Operator
+ HiLink chillStructure Structure
+ HiLink chillBlock Operator
+ HiLink chillScope Operator
+ "hi chillEDML term=underline ctermfg=DarkRed guifg=Red
+ HiLink chillEDML PreProc
+ "hi chillBoolConst term=bold ctermfg=brown guifg=brown
+ HiLink chillBoolConst Constant
+ "hi chillLogical term=bold ctermfg=brown guifg=brown
+ HiLink chillLogical Constant
+ HiLink chillStorageClass StorageClass
+ HiLink chillInclude Include
+ HiLink chillPreProc PreProc
+ HiLink chillDefine Macro
+ HiLink chillIncluded chillString
+ HiLink chillError Error
+ HiLink chillStatement Statement
+ HiLink chillPreCondit PreCondit
+ HiLink chillType Type
+ HiLink chillCommentError chillError
+ HiLink chillCommentString chillString
+ HiLink chillComment2String chillString
+ HiLink chillCommentSkip chillComment
+ HiLink chillString String
+ HiLink chillComment Comment
+ " hi chillComment term=None ctermfg=lightblue guifg=lightblue
+ HiLink chillSpecial SpecialChar
+ HiLink chillTodo Todo
+ HiLink chillBlock Statement
+ "HiLink chillIdentifier Identifier
+ HiLink chillBracket Delimiter
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "chill"
+
+" vim: ts=8
diff --git a/runtime/syntax/cl.vim b/runtime/syntax/cl.vim
new file mode 100644
index 000000000..3c6f41ba8
--- /dev/null
+++ b/runtime/syntax/cl.vim
@@ -0,0 +1,105 @@
+" Vim syntax file
+" Language: cl ("Clever Language" by Multibase, http://www.mbase.com.au)
+" Filename extensions: *.ent, *.eni
+" Maintainer: Philip Uren <philu@system77.com>
+" Last update: Wed May 2 10:30:30 EST 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,-,
+else
+ set iskeyword=@,48-57,_,-,
+endif
+
+syn case ignore
+
+syn sync lines=300
+
+"If/else/elsif/endif and while/wend mismatch errors
+syn match clifError "\<wend\>"
+syn match clifError "\<elsif\>"
+syn match clifError "\<else\>"
+syn match clifError "\<endif\>"
+
+" If and while regions
+syn region clLoop transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
+syn region clIf transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>" contains=ALLBUT,clBreak,clProcedure
+
+" Make those TODO notes and debugging stand out!
+syn keyword clTodo contained TODO BUG DEBUG FIX
+syn keyword clDebug contained debug
+
+syn match clComment "#.*$" contains=clTodo,clNeedsWork
+syn region clProcedure oneline start="^\s*[{}]" end="$"
+syn match clInclude "^\s*include\s.*"
+
+" We don't put "debug" in the clSetOptions;
+" we contain it in clSet so we can make it stand out.
+syn keyword clSetOptions transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
+syn match clSet "^\s*set\s.*" contains=clSetOptions,clDebug
+
+syn match clPreProc "^\s*#P.*"
+
+syn keyword clConditional else elsif
+syn keyword clWhile continue endloop
+" 'break' needs to be a region so we can sync on it above.
+syn region clBreak oneline start="^\s*break" end="$"
+
+syn match clOperator "[!;|)(:.><+*=-]"
+
+syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+
+syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+
+syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+
+
+syn keyword clReserved ERROR EXIT INTERRUPT LOCKED LREPLY MODE MCOL MLINE MREPLY NULL REPLY V1 V2 V3 V4 V5 V6 V7 V8 V9 ZERO BYPASS GOING_BACK AAUTO ABORT ABORT ALIGN BIGE CONVERT FNUM GOBACK HANGUP JUSTIFY NEXIT OUTPUT RAUTO RAWDISPLAY RAWPRINT REPEAT SKIP TAB TRIM LCOUNT PCOUNT PLINES SLINES SCOLS MATCH LMATCH
+
+syn keyword clFunction asc asize chr name random slen srandom day getarg getcgi getenv lcase scat sconv sdel skey smult srep substr sword trim ucase match
+
+syn keyword clStatement clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cl_syntax_inits")
+ if version < 508
+ let did_cl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink clifError Error
+ HiLink clWhile Repeat
+ HiLink clConditional Conditional
+ HiLink clDebug Debug
+ HiLink clNeedsWork Todo
+ HiLink clTodo Todo
+ HiLink clComment Comment
+ HiLink clProcedure Procedure
+ HiLink clBreak Procedure
+ HiLink clInclude Include
+ HiLink clSetOption Statement
+ HiLink clSet Identifier
+ HiLink clPreProc PreProc
+ HiLink clOperator Operator
+ HiLink clNumber Number
+ HiLink clString String
+ HiLink clQuote Delimiter
+ HiLink clReserved Identifier
+ HiLink clFunction Function
+ HiLink clStatement Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cl"
+
+" vim: ts=4 sw=4
diff --git a/runtime/syntax/clean.vim b/runtime/syntax/clean.vim
new file mode 100644
index 000000000..233ecbda1
--- /dev/null
+++ b/runtime/syntax/clean.vim
@@ -0,0 +1,94 @@
+" Vim syntax file
+" Language: Clean
+" Author: Pieter van Engelen <pietere@sci.kun.nl>
+" Co-Author: Arthur van Leeuwen <arthurvl@sci.kun.nl>
+" Last Change: Fri Sep 29 11:35:34 CEST 2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Some Clean-keywords
+syn keyword cleanConditional if case
+syn keyword cleanLabel let! with where in of
+syn keyword cleanInclude from import
+syn keyword cleanSpecial Start
+syn keyword cleanKeyword infixl infixr infix
+syn keyword cleanBasicType Int Real Char Bool String
+syn keyword cleanSpecialType World ProcId Void Files File
+syn keyword cleanModuleSystem module implementation definition system
+syn keyword cleanTypeClass class instance export
+
+" To do some Denotation Highlighting
+syn keyword cleanBoolDenot True False
+syn region cleanStringDenot start=+"+ end=+"+
+syn match cleanCharDenot "'.'"
+syn match cleanCharsDenot "'[^'\\]*\(\\.[^'\\]\)*'" contained
+syn match cleanIntegerDenot "[+-~]\=\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>"
+syn match cleanRealDenot "[+-~]\=\<\d\+\.\d+\(E[+-~]\=\d+\)\="
+
+" To highlight the use of lists, tuples and arrays
+syn region cleanList start="\[" end="\]" contains=ALL
+syn region cleanRecord start="{" end="}" contains=ALL
+syn region cleanArray start="{:" end=":}" contains=ALL
+syn match cleanTuple "([^=]*,[^=]*)" contains=ALL
+
+" To do some Comment Highlighting
+syn region cleanComment start="/\*" end="\*/" contains=cleanComment
+syn match cleanComment "//.*"
+
+" Now for some useful typedefinitionrecognition
+syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)[ \t]*\(infix[lr]\=\)\=[ \t]*\d\=[ \t]*::.*->.*" contains=cleanSpecial
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_clean_syntax_init")
+ if version < 508
+ let did_clean_syntax_init = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Comments
+ HiLink cleanComment Comment
+ " Constants and denotations
+ HiLink cleanCharsDenot String
+ HiLink cleanStringDenot String
+ HiLink cleanCharDenot Character
+ HiLink cleanIntegerDenot Number
+ HiLink cleanBoolDenot Boolean
+ HiLink cleanRealDenot Float
+ " Identifiers
+ " Statements
+ HiLink cleanTypeClass Keyword
+ HiLink cleanConditional Conditional
+ HiLink cleanLabel Label
+ HiLink cleanKeyword Keyword
+ " Generic Preprocessing
+ HiLink cleanInclude Include
+ HiLink cleanModuleSystem PreProc
+ " Type
+ HiLink cleanBasicType Type
+ HiLink cleanSpecialType Type
+ HiLink cleanFuncTypeDef Typedef
+ " Special
+ HiLink cleanSpecial Special
+ HiLink cleanList Special
+ HiLink cleanArray Special
+ HiLink cleanRecord Special
+ HiLink cleanTuple Special
+ " Error
+ " Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "clean"
+
+" vim: ts=4
diff --git a/runtime/syntax/clipper.vim b/runtime/syntax/clipper.vim
new file mode 100644
index 000000000..989b257f7
--- /dev/null
+++ b/runtime/syntax/clipper.vim
@@ -0,0 +1,143 @@
+" Vim syntax file:
+" Language: Clipper 5.2 & FlagShip
+" Maintainer: C R Zamana <zamana@zip.net>
+" Some things based on c.vim by Bram Moolenaar and pascal.vim by Mario Eusebio
+" Last Change: Sat Sep 09 2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Exceptions for my "Very Own" (TM) user variables naming style.
+" If you don't like this, comment it
+syn match clipperUserVariable "\<[a,b,c,d,l,n,o,u,x][A-Z][A-Za-z0-9_]*\>"
+syn match clipperUserVariable "\<[a-z]\>"
+
+" Clipper is case insensitive ( see "exception" above )
+syn case ignore
+
+" Clipper keywords ( in no particular order )
+syn keyword clipperStatement ACCEPT APPEND BLANK FROM AVERAGE CALL CANCEL
+syn keyword clipperStatement CLEAR ALL GETS MEMORY TYPEAHEAD CLOSE
+syn keyword clipperStatement COMMIT CONTINUE SHARED NEW PICT
+syn keyword clipperStatement COPY FILE STRUCTURE STRU EXTE TO COUNT
+syn keyword clipperStatement CREATE FROM NIL
+syn keyword clipperStatement DELETE FILE DIR DISPLAY EJECT ERASE FIND GO
+syn keyword clipperStatement INDEX INPUT VALID WHEN
+syn keyword clipperStatement JOIN KEYBOARD LABEL FORM LIST LOCATE MENU TO
+syn keyword clipperStatement NOTE PACK QUIT READ
+syn keyword clipperStatement RECALL REINDEX RELEASE RENAME REPLACE REPORT
+syn keyword clipperStatement RETURN FORM RESTORE
+syn keyword clipperStatement RUN SAVE SEEK SELECT
+syn keyword clipperStatement SKIP SORT STORE SUM TEXT TOTAL TYPE UNLOCK
+syn keyword clipperStatement UPDATE USE WAIT ZAP
+syn keyword clipperStatement BEGIN SEQUENCE
+syn keyword clipperStatement SET ALTERNATE BELL CENTURY COLOR CONFIRM CONSOLE
+syn keyword clipperStatement CURSOR DATE DECIMALS DEFAULT DELETED DELIMITERS
+syn keyword clipperStatement DEVICE EPOCH ESCAPE EXACT EXCLUSIVE FILTER FIXED
+syn keyword clipperStatement FORMAT FUNCTION INTENSITY KEY MARGIN MESSAGE
+syn keyword clipperStatement ORDER PATH PRINTER PROCEDURE RELATION SCOREBOARD
+syn keyword clipperStatement SOFTSEEK TYPEAHEAD UNIQUE WRAP
+syn keyword clipperStatement BOX CLEAR GET PROMPT SAY ? ??
+syn keyword clipperStatement DELETE TAG GO RTLINKCMD TMP DBLOCKINFO
+syn keyword clipperStatement DBEVALINFO DBFIELDINFO DBFILTERINFO DBFUNCTABLE
+syn keyword clipperStatement DBOPENINFO DBORDERCONDINFO DBORDERCREATEINF
+syn keyword clipperStatement DBORDERINFO DBRELINFO DBSCOPEINFO DBSORTINFO
+syn keyword clipperStatement DBSORTITEM DBTRANSINFO DBTRANSITEM WORKAREA
+
+" Conditionals
+syn keyword clipperConditional CASE OTHERWISE ENDCASE
+syn keyword clipperConditional IF ELSE ENDIF IIF IFDEF IFNDEF
+
+" Loops
+syn keyword clipperRepeat DO WHILE ENDDO
+syn keyword clipperRepeat FOR TO NEXT STEP
+
+" Visibility
+syn keyword clipperStorageClass ANNOUNCE STATIC
+syn keyword clipperStorageClass DECLARE EXTERNAL LOCAL MEMVAR PARAMETERS
+syn keyword clipperStorageClass PRIVATE PROCEDURE PUBLIC REQUEST STATIC
+syn keyword clipperStorageClass FIELD FUNCTION
+syn keyword clipperStorageClass EXIT PROCEDURE INIT PROCEDURE
+
+" Operators
+syn match clipperOperator "$\|%\|&\|+\|-\|->\|!"
+syn match clipperOperator "\.AND\.\|\.NOT\.\|\.OR\."
+syn match clipperOperator ":=\|<\|<=\|<>\|!=\|#\|=\|==\|>\|>=\|@"
+syn match clipperOperator "*"
+
+" Numbers
+syn match clipperNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+
+" Includes
+syn region clipperIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match clipperIncluded contained "<[^>]*>"
+syn match clipperInclude "^\s*#\s*include\>\s*["<]" contains=clipperIncluded
+
+" String and Character constants
+syn region clipperString start=+"+ end=+"+
+syn region clipperString start=+'+ end=+'+
+
+" Delimiters
+syn match ClipperDelimiters "[()]\|[\[\]]\|[{}]\|[||]"
+
+" Special
+syn match clipperLineContinuation ";"
+
+" This is from Bram Moolenaar:
+if exists("c_comment_strings")
+ " A comment can contain cString, cCharacter and cNumber.
+ " But a "*/" inside a cString in a clipperComment DOES end the comment!
+ " So we need to use a special type of cString: clipperCommentString, which
+ " also ends on "*/", and sees a "*" at the start of the line as comment
+ " again. Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match clipperCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region clipperCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=clipperCommentSkip
+ syntax region clipperComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$"
+ syntax region clipperComment start="/\*" end="\*/" contains=clipperCommentString,clipperCharacter,clipperNumber,clipperString
+ syntax match clipperComment "//.*" contains=clipperComment2String,clipperCharacter,clipperNumber
+else
+ syn region clipperComment start="/\*" end="\*/"
+ syn match clipperComment "//.*"
+endif
+syntax match clipperCommentError "\*/"
+
+" Lines beggining with an "*" are comments too
+syntax match clipperComment "^\*.*"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_clipper_syntax_inits")
+ if version < 508
+ let did_clipper_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink clipperConditional Conditional
+ HiLink clipperRepeat Repeat
+ HiLink clipperNumber Number
+ HiLink clipperInclude Include
+ HiLink clipperComment Comment
+ HiLink clipperOperator Operator
+ HiLink clipperStorageClass StorageClass
+ HiLink clipperStatement Statement
+ HiLink clipperString String
+ HiLink clipperFunction Function
+ HiLink clipperLineContinuation Special
+ HiLink clipperDelimiters Delimiter
+ HiLink clipperUserVariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "clipper"
+
+" vim: ts=4
diff --git a/runtime/syntax/cobol.vim b/runtime/syntax/cobol.vim
new file mode 100644
index 000000000..0b59f720b
--- /dev/null
+++ b/runtime/syntax/cobol.vim
@@ -0,0 +1,177 @@
+" Vim syntax file
+" Language: COBOL
+" Maintainers: Davyd Ondrejko <vondraco@columbus.rr.com>
+" (formerly Sitaram Chamarty <sitaram@diac.com> and
+" James Mitchell <james_mitchell@acm.org>)
+" Last change: 2001 Sep 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" MOST important - else most of the keywords wont work!
+if version < 600
+ set isk=@,48-57,-
+else
+ setlocal isk=@,48-57,-
+endif
+
+syn case ignore
+
+syn match cobolKeys "^\a\{1,6\}" contains=cobolReserved
+syn keyword cobolReserved contained ACCEPT ACCESS ADD ADDRESS ADVANCING AFTER ALPHABET ALPHABETIC
+syn keyword cobolReserved contained ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALS
+syn keyword cobolReserved contained ALTERNATE AND ANY ARE AREA AREAS ASCENDING ASSIGN AT AUTHOR BEFORE BINARY
+syn keyword cobolReserved contained BLANK BLOCK BOTTOM BY CANCEL CBLL CD CF CH CHARACTER CHARACTERS CLASS
+syn keyword cobolReserved contained CLOCK-UNITS CLOSE COBOL CODE CODE-SET COLLATING COLUMN COMMA COMMON
+syn keyword cobolReserved contained COMMUNICATIONS COMPUTATIONAL COMPUTE CONFIGURATION CONTENT CONTINUE
+syn keyword cobolReserved contained CONTROL CONVERTING CORR CORRESPONDING COUNT CURRENCY DATA DATE DATE-COMPILED
+syn keyword cobolReserved contained DATE-WRITTEN DAY DAY-OF-WEEK DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE
+syn keyword cobolReserved contained DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT
+syn keyword cobolReserved contained DELARATIVES DELETE DELIMITED DELIMITER DEPENDING DESCENDING DESTINATION
+syn keyword cobolReserved contained DETAIL DISABLE DISPLAY DIVIDE DIVISION DOWN DUPLICATES DYNAMIC EGI ELSE EMI
+syn keyword cobolReserved contained ENABLE END-ADD END-COMPUTE END-DELETE END-DIVIDE END-EVALUATE END-IF
+syn keyword cobolReserved contained END-MULTIPLY END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN
+syn keyword cobolReserved contained END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING
+syn keyword cobolReserved contained END-WRITE ENVIRONMENT EQUAL ERROR ESI EVALUATE EVERY EXCEPTION EXIT
+syn keyword cobolReserved contained EXTEND EXTERNAL FALSE FD FILE FILE-CONTROL FILLER FINAL FIRST FOOTING FOR FROM
+syn keyword cobolReserved contained GENERATE GIVING GLOBAL GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES I-O
+syn keyword cobolReserved contained I-O-CONTROL IDENTIFICATION IN INDEX INDEXED INDICATE INITIAL INITIALIZE
+syn keyword cobolReserved contained INITIATE INPUT INPUT-OUTPUT INSPECT INSTALLATION INTO IS JUST
+syn keyword cobolReserved contained JUSTIFIED KEY LABEL LAST LEADING LEFT LENGTH LOCK MEMORY
+syn keyword cobolReserved contained MERGE MESSAGE MODE MODULES MOVE MULTIPLE MULTIPLY NATIVE NEGATIVE NEXT NO NOT
+syn keyword cobolReserved contained NUMBER NUMERIC NUMERIC-EDITED OBJECT-COMPUTER OCCURS OF OFF OMITTED ON OPEN
+syn keyword cobolReserved contained OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW PACKED-DECIMAL PADDING
+syn keyword cobolReserved contained PAGE PAGE-COUNTER PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE
+syn keyword cobolReserved contained PRINTING PROCEDURE PROCEDURES PROCEDD PROGRAM PROGRAM-ID PURGE QUEUE QUOTES
+syn keyword cobolReserved contained RANDOM RD READ RECEIVE RECORD RECORDS REDEFINES REEL REFERENCE REFERENCES
+syn keyword cobolReserved contained RELATIVE RELEASE REMAINDER REMOVAL REPLACE REPLACING REPORT REPORTING
+syn keyword cobolReserved contained REPORTS RERUN RESERVE RESET RETURN RETURNING REVERSED REWIND REWRITE RF RH
+syn keyword cobolReserved contained RIGHT ROUNDED RUN SAME SD SEARCH SECTION SECURITY SEGMENT SEGMENT-LIMITED
+syn keyword cobolReserved contained SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SIGN SIZE SORT
+syn keyword cobolReserved contained SORT-MERGE SOURCE SOURCE-COMPUTER SPECIAL-NAMES STANDARD
+syn keyword cobolReserved contained STANDARD-1 STANDARD-2 START STATUS STOP STRING SUB-QUEUE-1 SUB-QUEUE-2
+syn keyword cobolReserved contained SUB-QUEUE-3 SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED TABLE TALLYING
+syn keyword cobolReserved contained TAPE TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TO TOP
+syn keyword cobolReserved contained TRAILING TRUE TYPE UNIT UNSTRING UNTIL UP UPON USAGE USE USING VALUE VALUES
+syn keyword cobolReserved contained VARYING WHEN WITH WORDS WORKING-STORAGE WRITE
+syn match cobolReserved contained "\<CONTAINS\>"
+syn match cobolReserved contained "\<\(IF\|INVALID\|END\|EOP\)\>"
+syn match cobolReserved contained "\<ALL\>"
+
+syn keyword cobolConstant SPACE SPACES NULL ZERO ZEROES ZEROS LOW-VALUE LOW-VALUES
+
+syn match cobolMarker "^.\{6\}"
+syn match cobolBadLine "^.\{6\}[^ D\-*$/].*"hs=s+6
+
+" If comment mark somehow gets into column past Column 7.
+syn match cobolBadLine "^.\{6\}\s\+\*.*"
+
+syn match cobolNumber "\<-\=\d*\.\=\d\+\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<S*9\+\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<$*\.\=9\+\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<Z*\.\=9\+\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<V9\+\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<9\+V\>" contains=cobolMarker,cobolComment
+syn match cobolPic "\<-\+[Z9]\+\>" contains=cobolMarker,cobolComment
+syn match cobolTodo "todo" contained
+syn match cobolComment "^.\{6\}\*.*"hs=s+6 contains=cobolTodo,cobolMarker
+syn match cobolComment "^.\{6\}/.*"hs=s+6 contains=cobolTodo,cobolMarker
+syn match cobolComment "^.\{6\}C.*"hs=s+6 contains=cobolTodo,cobolMarker
+syn match cobolCompiler "^.\{6\}$.*"hs=s+6
+
+" For MicroFocus or other inline comments, include this line.
+" syn region cobolComment start="*>" end="$" contains=cobolTodo,cobolMarker
+
+syn keyword cobolGoTo GO GOTO
+syn keyword cobolCopy COPY
+
+" cobolBAD: things that are BAD NEWS!
+syn keyword cobolBAD ALTER ENTER RENAMES
+
+" cobolWatch: things that are important when trying to understand a program
+syn keyword cobolWatch OCCURS DEPENDING VARYING BINARY COMP REDEFINES
+syn keyword cobolWatch REPLACING RUN
+syn match cobolWatch "COMP-[123456XN]"
+
+syn keyword cobolEXECs EXEC END-EXEC
+
+
+syn match cobolDecl "^.\{6} \{1,4}\(0\=1\|77\|78\) "hs=s+7,he=e-1 contains=cobolMarker
+syn match cobolDecl "^.\{6} \+[1-4]\d "hs=s+7,he=e-1 contains=cobolMarker
+syn match cobolDecl "^.\{6} \+0\=[2-9] "hs=s+7,he=e-1 contains=cobolMarker
+syn match cobolDecl "^.\{6} \+66 "hs=s+7,he=e-1 contains=cobolMarker
+
+syn match cobolWatch "^.\{6} \+88 "hs=s+7,he=e-1 contains=cobolMarker
+
+syn match cobolBadID "\k\+-\($\|[^-A-Z0-9]\)"
+
+syn keyword cobolCALLs CALL CANCEL GOBACK PERFORM INVOKE
+syn match cobolCALLs "EXIT \+PROGRAM"
+syn match cobolExtras /\<VALUE \+\d\+\./hs=s+6,he=e-1
+
+syn match cobolString /"[^"]*\("\|$\)/
+syn match cobolString /'[^']*\('\|$\)/
+
+syn region cobolLine start="^.\{6} " end="$" contains=ALL
+
+if exists("cobol_legacy_code")
+syn region cobolCondFlow contains=ALLBUT,cobolLine start="\<\(IF\|INVALID\|END\|EOP\)\>" skip=/\('\|"\)[^"]\{-}\("\|'\|$\)/ end="\." keepend
+endif
+
+if ! exists("cobol_legacy_code")
+ " catch junk in columns 1-6 for modern code
+ syn match cobolBAD "^ \{0,5\}[^ ].*"
+endif
+
+" many legacy sources have junk in columns 1-6: must be before others
+" Stuff after column 72 is in error - must be after all other "match" entries
+if exists("cobol_legacy_code")
+ syn match cobolBadLine "^.\{6}[^*/].\{66,\}"
+else
+ syn match cobolBadLine "^.\{6}.\{67,\}"
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cobol_syntax_inits")
+ if version < 508
+ let did_cobol_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cobolBAD Error
+ HiLink cobolBadID Error
+ HiLink cobolBadLine Error
+ HiLink cobolMarker Comment
+ HiLink cobolCALLs Function
+ HiLink cobolComment Comment
+ HiLink cobolKeys Comment
+ HiLink cobolAreaB Special
+ HiLink cobolCompiler PreProc
+ HiLink cobolCondFlow Special
+ HiLink cobolCopy PreProc
+ HiLink cobolDecl Type
+ HiLink cobolExtras Special
+ HiLink cobolGoTo Special
+ HiLink cobolConstant Constant
+ HiLink cobolNumber Constant
+ HiLink cobolPic Constant
+ HiLink cobolReserved Statement
+ HiLink cobolString Constant
+ HiLink cobolTodo Todo
+ HiLink cobolWatch Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cobol"
+
+" vim: ts=6 nowrap
diff --git a/runtime/syntax/colortest.vim b/runtime/syntax/colortest.vim
new file mode 100644
index 000000000..b08b21f95
--- /dev/null
+++ b/runtime/syntax/colortest.vim
@@ -0,0 +1,65 @@
+" Vim script for testing colors
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Contributors: Rafael Garcia-Suarez, Charles Campbell
+" Last Change: 2001 Jul 28
+
+" edit this file, then do ":source %", and check if the colors match
+
+" black black_on_white white_on_black
+" black_on_black black_on_black
+" darkred darkred_on_white white_on_darkred
+" darkred_on_black black_on_darkred
+" darkgreen darkgreen_on_white white_on_darkgreen
+" darkgreen_on_black black_on_darkgreen
+" brown brown_on_white white_on_brown
+" brown_on_black black_on_brown
+" darkblue darkblue_on_white white_on_darkblue
+" darkblue_on_black black_on_darkblue
+" darkmagenta darkmagenta_on_white white_on_darkmagenta
+" darkmagenta_on_black black_on_darkmagenta
+" darkcyan darkcyan_on_white white_on_darkcyan
+" darkcyan_on_black black_on_darkcyan
+" lightgray lightgray_on_white white_on_lightgray
+" lightgray_on_black black_on_lightgray
+" darkgray darkgray_on_white white_on_darkgray
+" darkgray_on_black black_on_darkgray
+" red red_on_white white_on_red
+" red_on_black black_on_red
+" green green_on_white white_on_green
+" green_on_black black_on_green
+" yellow yellow_on_white white_on_yellow
+" yellow_on_black black_on_yellow
+" blue blue_on_white white_on_blue
+" blue_on_black black_on_blue
+" magenta magenta_on_white white_on_magenta
+" magenta_on_black black_on_magenta
+" cyan cyan_on_white white_on_cyan
+" cyan_on_black black_on_cyan
+" white white_on_white white_on_white
+" white_on_black black_on_white
+" grey grey_on_white white_on_grey
+" grey_on_black black_on_grey
+" lightred lightred_on_white white_on_lightred
+" lightred_on_black black_on_lightred
+" lightgreen lightgreen_on_white white_on_lightgreen
+" lightgreen_on_black black_on_lightgreen
+" lightyellow lightyellow_on_white white_on_lightyellow
+" lightyellow_on_black black_on_lightyellow
+" lightblue lightblue_on_white white_on_lightblue
+" lightblue_on_black black_on_lightblue
+" lightmagenta lightmagenta_on_white white_on_lightmagenta
+" lightmagenta_on_black black_on_lightmagenta
+" lightcyan lightcyan_on_white white_on_lightcyan
+" lightcyan_on_black black_on_lightcyan
+
+syn clear
+8
+while search("_on_", "W") < 55
+ let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "")
+ let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "")
+ exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
+ exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
+endwhile
+8,55g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")|
+ \ exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
+nohlsearch
diff --git a/runtime/syntax/conf.vim b/runtime/syntax/conf.vim
new file mode 100644
index 000000000..d08de4f76
--- /dev/null
+++ b/runtime/syntax/conf.vim
@@ -0,0 +1,41 @@
+" Vim syntax file
+" Language: generic configure file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword confTodo contained TODO FIXME XXX
+" Avoid matching "text#text", used in /etc/disktab and /etc/gettytab
+syn match confComment "^#.*" contains=confTodo
+syn match confComment "\s#.*"ms=s+1 contains=confTodo
+syn region confString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
+syn region confString start=+'+ skip=+\\\\\|\\'+ end=+'+ oneline
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_conf_syntax_inits")
+ if version < 508
+ let did_conf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink confComment Comment
+ HiLink confTodo Todo
+ HiLink confString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "conf"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/config.vim b/runtime/syntax/config.vim
new file mode 100644
index 000000000..c02799d32
--- /dev/null
+++ b/runtime/syntax/config.vim
@@ -0,0 +1,57 @@
+" Vim syntax file
+" Language: configure.in script: M4 with sh
+" Maintainer: Christian Hammesr <ch@lathspell.westend.com>
+" Last Change: 2001 May 09
+
+" Well, I actually even do not know much about m4. This explains why there
+" is probably very much missing here, yet !
+" But I missed a good hilighting when editing my GNU autoconf/automake
+" script, so I wrote this quick and dirty patch.
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" define the config syntax
+syn match configdelimiter "[()\[\];,]"
+syn match configoperator "[=|&\*\+\<\>]"
+syn match configcomment "\(dnl.*\)\|\(#.*\)"
+syn match configfunction "\<[A-Z_][A-Z0-9_]*\>"
+syn match confignumber "[-+]\=\<\d\+\(\.\d*\)\=\>"
+syn keyword configkeyword if then else fi test for in do done
+syn keyword configspecial cat rm eval
+syn region configstring start=+"+ skip=+\\"+ end=+"+
+syn region configstring start=+`+ skip=+\\'+ end=+'+
+syn region configstring start=+`+ skip=+\\'+ end=+`+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_config_syntax_inits")
+ if version < 508
+ let did_config_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink configdelimiter Delimiter
+ HiLink configoperator Operator
+ HiLink configcomment Comment
+ HiLink configfunction Function
+ HiLink confignumber Number
+ HiLink configkeyword Keyword
+ HiLink configspecial Special
+ HiLink configstring String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "config"
+
+" vim: ts=4
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim
new file mode 100644
index 000000000..feb89ee61
--- /dev/null
+++ b/runtime/syntax/cpp.vim
@@ -0,0 +1,62 @@
+" Vim syntax file
+" Language: C++
+" Maintainer: Ken Shan <ccshan@post.harvard.edu>
+" Last Change: 2002 Jul 15
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ so <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+ unlet b:current_syntax
+endif
+
+" C++ extentions
+syn keyword cppStatement new delete this friend using
+syn keyword cppAccess public protected private
+syn keyword cppType inline virtual explicit export bool wchar_t
+syn keyword cppExceptions throw try catch
+syn keyword cppOperator operator typeid
+syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
+syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
+syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
+syn keyword cppStorageClass mutable
+syn keyword cppStructure class typename template namespace
+syn keyword cppNumber NPOS
+syn keyword cppBoolean true false
+
+" The minimum and maximum operators in GNU C++
+syn match cppMinMax "[<>]?"
+
+" Default highlighting
+if version >= 508 || !exists("did_cpp_syntax_inits")
+ if version < 508
+ let did_cpp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink cppAccess cppStatement
+ HiLink cppCast cppStatement
+ HiLink cppExceptions Exception
+ HiLink cppOperator Operator
+ HiLink cppStatement Statement
+ HiLink cppType Type
+ HiLink cppStorageClass StorageClass
+ HiLink cppStructure Structure
+ HiLink cppNumber Number
+ HiLink cppBoolean Boolean
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cpp"
+
+" vim: ts=8
diff --git a/runtime/syntax/crm.vim b/runtime/syntax/crm.vim
new file mode 100644
index 000000000..4a1e3bc41
--- /dev/null
+++ b/runtime/syntax/crm.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language: CRM114
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/crm/
+" Latest Revision: 2004-05-22
+" arch-tag: a3d3eaaf-4700-44ff-b332-f6c42c036883
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Todo
+syn keyword crmTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region crmComment matchgroup=crmComment start='#' end='$' end='\\#' contains=crmTodo
+
+" Variables
+syn match crmVariable ':[*#@]:[^:]\{-1,}:'
+
+" Special Characters
+syn match crmSpecial '\\\%(x\x\x\|o\o\o\o\|[]nrtabvf0>)};/\\]\)'
+
+" Statements
+syn keyword crmStatement insert noop accept alius alter classify eval exit
+syn keyword crmStatement fail fault goto hash intersect isolate input learn
+syn keyword crmStatement liaf match output syscall trap union window
+
+" Regexes
+syn region crmRegex matchgroup=crmRegex start='/' skip='\\/' end='/' contains=crmVariable
+
+" Labels
+syn match crmLabel '^\s*:[[:graph:]]\+:'
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_crm_syn_inits")
+ if version < 508
+ let did_crm_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink crmTodo Todo
+ HiLink crmComment Comment
+ HiLink crmVariable Identifier
+ HiLink crmSpecial SpecialChar
+ HiLink crmStatement Statement
+ HiLink crmRegex String
+ HiLink crmLabel Label
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "crm"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/crontab.vim b/runtime/syntax/crontab.vim
new file mode 100644
index 000000000..b7b8ef6f1
--- /dev/null
+++ b/runtime/syntax/crontab.vim
@@ -0,0 +1,69 @@
+" Vim syntax file
+" Language: crontab 2.3.3
+" Maintainer: John Hoelzel johnh51@users.sourceforge.net
+" Last change: Mon Jun 9 2003
+" Filenames: /tmp/crontab.* used by "crontab -e"
+" URL: http://johnh51.get.to/vim/syntax/crontab.vim
+"
+" crontab line format:
+" Minutes Hours Days Months Days_of_Week Commands # comments
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax match crontabMin "\_^[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabHr skipwhite
+syntax match crontabHr "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDay skipwhite contained
+syntax match crontabDay "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabMnth skipwhite contained
+
+syntax match crontabMnth "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDow skipwhite contained
+syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
+
+syntax match crontabDow "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabCmd skipwhite contained
+syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
+
+" syntax region crontabCmd start="\<[a-z0-9\/\(]" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend
+
+syntax region crontabCmd start="\S" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend
+syntax match crontabCmnt /#.*/
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_crontab_syn_inits")
+ if version < 508
+ let did_crontab_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink crontabMin Number
+ HiLink crontabHr PreProc
+ HiLink crontabDay Type
+
+ HiLink crontabMnth Number
+ HiLink crontabMnth12 Number
+ HiLink crontabMnthS Number
+ HiLink crontabMnthN Number
+
+ HiLink crontabDow PreProc
+ HiLink crontabDow7 PreProc
+ HiLink crontabDowS PreProc
+ HiLink crontabDowN PreProc
+
+" comment out next line for to suppress unix commands coloring.
+ HiLink crontabCmd Type
+
+ HiLink crontabCmnt Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "crontab"
+
+" vim: ts=8
diff --git a/runtime/syntax/cs.vim b/runtime/syntax/cs.vim
new file mode 100644
index 000000000..99844b965
--- /dev/null
+++ b/runtime/syntax/cs.vim
@@ -0,0 +1,145 @@
+" Vim syntax file
+" Language: C#
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 09 Mar 2004 14:32:13 CET
+" Filenames: *.cs
+" $Id$
+"
+" REFERENCES:
+" [1] ECMA TC39: C# Language Specification (WD13Oct01.doc)
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cs_cpo_save = &cpo
+set cpo&vim
+
+
+" type
+syn keyword csType bool byte char decimal double float int long object sbyte short string uint ulong ushort void
+" storage
+syn keyword csStorage class delegate enum interface namespace struct
+" repeate / condition / label
+syn keyword csRepeat break continue do for foreach goto return while
+syn keyword csConditional else if switch
+syn keyword csLabel case default
+" there's no :: operator in C#
+syn match csOperatorError display +::+
+" user labels (see [1] 8.6 Statements)
+syn match csLabel display +^\s*\I\i*\s*:\([^:]\)\@=+
+" modifier
+syn keyword csModifier abstract const extern internal override private protected public readonly sealed static virtual volatile
+" constant
+syn keyword csConstant false null true
+" exception
+syn keyword csException try catch finally throw
+
+" TODO:
+syn keyword csUnspecifiedStatement as base checked event fixed in is lock new operator out params ref sizeof stackalloc this typeof unchecked unsafe using
+" TODO:
+syn keyword csUnsupportedStatement get set add remove value
+" TODO:
+syn keyword csUnspecifiedKeyword explicit implicit
+
+
+
+" Comments
+"
+" PROVIDES: @csCommentHook
+"
+" TODO: include strings ?
+"
+syn keyword csTodo contained TODO FIXME XXX NOTE
+syn region csComment start="/\*" end="\*/" contains=@csCommentHook,csTodo
+syn match csComment "//.*$" contains=@csCommentHook,csTodo
+
+" xml markup inside '///' comments
+syn cluster xmlRegionHook add=csXmlCommentLeader
+syn cluster xmlCdataHook add=csXmlCommentLeader
+syn cluster xmlStartTagHook add=csXmlCommentLeader
+syn keyword csXmlTag contained Libraries Packages Types Excluded ExcludedTypeName ExcludedLibraryName
+syn keyword csXmlTag contained ExcludedBucketName TypeExcluded Type TypeKind TypeSignature AssemblyInfo
+syn keyword csXmlTag contained AssemblyName AssemblyPublicKey AssemblyVersion AssemblyCulture Base
+syn keyword csXmlTag contained BaseTypeName Interfaces Interface InterfaceName Attributes Attribute
+syn keyword csXmlTag contained AttributeName Members Member MemberSignature MemberType MemberValue
+syn keyword csXmlTag contained ReturnValue ReturnType Parameters Parameter MemberOfPackage
+syn keyword csXmlTag contained ThreadingSafetyStatement Docs devdoc example overload remarks returns summary
+syn keyword csXmlTag contained threadsafe value internalonly nodoc exception param permission platnote
+syn keyword csXmlTag contained seealso b c i pre sub sup block code note paramref see subscript superscript
+syn keyword csXmlTag contained list listheader item term description altcompliant altmember
+
+syn cluster xmlTagHook add=csXmlTag
+
+syn match csXmlCommentLeader +\/\/\/+ contained
+syn match csXmlComment +\/\/\/.*$+ contains=csXmlCommentLeader,@csXml
+syntax include @csXml <sfile>:p:h/xml.vim
+hi def link xmlRegion Comment
+
+
+" [1] 9.5 Pre-processing directives
+syn region csPreCondit
+ \ start="^\s*#\s*\(define\|undef\|if\|elif\|else\|endif\|line\|error\|warning\|region\|endregion\)"
+ \ skip="\\$" end="$" contains=csComment keepend
+
+
+
+" Strings and constants
+syn match csSpecialError contained "\\."
+syn match csSpecialCharError contained "[^']"
+" [1] 9.4.4.4 Character literals
+syn match csSpecialChar contained +\\["\\'0abfnrtvx]+
+" unicode characters
+syn match csUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=csUnicodeSpecifier
+syn match csUnicodeSpecifier +\\[uU]+ contained
+syn region csVerbatimString start=+@"+ end=+"+ end=+$+ contains=csVerbatimSpec
+syn match csVerbatimSpec +@"+he=s+1 contained
+syn region csString start=+"+ end=+"+ end=+$+ contains=csSpecialChar,csSpecialError,csUnicodeNumber
+syn match csCharacter "'[^']*'" contains=csSpecialChar,csSpecialCharError
+syn match csCharacter "'\\''" contains=csSpecialChar
+syn match csCharacter "'[^\\]'"
+syn match csNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match csNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match csNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match csNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+" The default highlighting.
+hi def link csType Type
+hi def link csStorage StorageClass
+hi def link csRepeat Repeat
+hi def link csConditional Conditional
+hi def link csLabel Label
+hi def link csModifier StorageClass
+hi def link csConstant Constant
+hi def link csException Exception
+hi def link csUnspecifiedStatement Statement
+hi def link csUnsupportedStatement Statement
+hi def link csUnspecifiedKeyword Keyword
+hi def link csOperatorError Error
+
+hi def link csTodo Todo
+hi def link csComment Comment
+
+hi def link csSpecialError Error
+hi def link csSpecialCharError Error
+hi def link csString String
+hi def link csVerbatimString String
+hi def link csVerbatimSpec SpecialChar
+hi def link csPreCondit PreCondit
+hi def link csCharacter Character
+hi def link csSpecialChar SpecialChar
+hi def link csNumber Number
+hi def link csUnicodeNumber SpecialChar
+hi def link csUnicodeSpecifier SpecialChar
+
+" xml markup
+hi def link csXmlCommentLeader Comment
+hi def link csXmlComment Comment
+hi def link csXmlTag Statement
+
+let b:current_syntax = "cs"
+
+let &cpo = s:cs_cpo_save
+unlet s:cs_cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/csc.vim b/runtime/syntax/csc.vim
new file mode 100644
index 000000000..8d67334aa
--- /dev/null
+++ b/runtime/syntax/csc.vim
@@ -0,0 +1,199 @@
+" Vim syntax file
+" Language: Essbase script
+" Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net>
+" Last change: 2001 Sep 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" folds: fix/endfix and comments
+sy region EssFold start="\<Fix" end="EndFix" transparent fold
+
+sy keyword cscTodo contained TODO FIXME XXX
+
+" cscCommentGroup allows adding matches for special things in comments
+sy cluster cscCommentGroup contains=cscTodo
+
+" Strings in quotes
+sy match cscError '"'
+sy match cscString '"[^"]*"'
+
+"when wanted, highlight trailing white space
+if exists("csc_space_errors")
+ if !exists("csc_no_trail_space_error")
+ sy match cscSpaceE "\s\+$"
+ endif
+ if !exists("csc_no_tab_space_error")
+ sy match cscSpaceE " \+\t"me=e-1
+ endif
+endif
+
+"catch errors caused by wrong parenthesis and brackets
+sy cluster cscParenGroup contains=cscParenE,@cscCommentGroup,cscUserCont,cscBitField,cscFormat,cscNumber,cscFloat,cscOctal,cscNumbers,cscIfError,cscComW,cscCom,cscFormula,cscBPMacro
+sy region cscParen transparent start='(' end=')' contains=ALLBUT,@cscParenGroup
+sy match cscParenE ")"
+
+"integer number, or floating point number without a dot and with "f".
+sy case ignore
+sy match cscNumbers transparent "\<\d\|\.\d" contains=cscNumber,cscFloat,cscOctal
+sy match cscNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+sy match cscNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+sy match cscOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>"
+sy match cscFloat contained "\d\+f"
+"floating point number, with dot, optional exponent
+sy match cscFloat contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+sy match cscFloat contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+sy match cscFloat contained "\d\+e[-+]\=\d\+[fl]\=\>"
+
+sy region cscComment start="/\*" end="\*/" contains=@cscCommentGroup,cscSpaceE fold
+sy match cscCommentE "\*/"
+
+sy keyword cscIfError IF ELSE ENDIF ELSEIF
+sy keyword cscCondition contained IF ELSE ENDIF ELSEIF
+sy keyword cscFunction contained VARPER VAR UDA TRUNCATE SYD SUMRANGE SUM
+sy keyword cscFunction contained STDDEVRANGE STDDEV SPARENTVAL SLN SIBLINGS SHIFT
+sy keyword cscFunction contained SANCESTVAL RSIBLINGS ROUND REMAINDER RELATIVE PTD
+sy keyword cscFunction contained PRIOR POWER PARENTVAL NPV NEXT MOD MINRANGE MIN
+sy keyword cscFunction contained MDSHIFT MDPARENTVAL MDANCESTVAL MAXRANGE MAX MATCH
+sy keyword cscFunction contained LSIBLINGS LEVMBRS LEV
+sy keyword cscFunction contained ISUDA ISSIBLING ISSAMELEV ISSAMEGEN ISPARENT ISMBR
+sy keyword cscFunction contained ISLEV ISISIBLING ISIPARENT ISIDESC ISICHILD ISIBLINGS
+sy keyword cscFunction contained ISIANCEST ISGEN ISDESC ISCHILD ISANCEST ISACCTYPE
+sy keyword cscFunction contained IRSIBLINGS IRR INTEREST INT ILSIBLINGS IDESCENDANTS
+sy keyword cscFunction contained ICHILDREN IANCESTORS IALLANCESTORS
+sy keyword cscFunction contained GROWTH GENMBRS GEN FACTORIAL DISCOUNT DESCENDANTS
+sy keyword cscFunction contained DECLINE CHILDREN CURRMBRRANGE CURLEV CURGEN
+sy keyword cscFunction contained COMPOUNDGROWTH COMPOUND AVGRANGE AVG ANCESTVAL
+sy keyword cscFunction contained ANCESTORS ALLANCESTORS ACCUM ABS
+sy keyword cscFunction contained @VARPER @VAR @UDA @TRUNCATE @SYD @SUMRANGE @SUM
+sy keyword cscFunction contained @STDDEVRANGE @STDDEV @SPARENTVAL @SLN @SIBLINGS @SHIFT
+sy keyword cscFunction contained @SANCESTVAL @RSIBLINGS @ROUND @REMAINDER @RELATIVE @PTD
+sy keyword cscFunction contained @PRIOR @POWER @PARENTVAL @NPV @NEXT @MOD @MINRANGE @MIN
+sy keyword cscFunction contained @MDSHIFT @MDPARENTVAL @MDANCESTVAL @MAXRANGE @MAX @MATCH
+sy keyword cscFunction contained @LSIBLINGS @LEVMBRS @LEV
+sy keyword cscFunction contained @ISUDA @ISSIBLING @ISSAMELEV @ISSAMEGEN @ISPARENT @ISMBR
+sy keyword cscFunction contained @ISLEV @ISISIBLING @ISIPARENT @ISIDESC @ISICHILD @ISIBLINGS
+sy keyword cscFunction contained @ISIANCEST @ISGEN @ISDESC @ISCHILD @ISANCEST @ISACCTYPE
+sy keyword cscFunction contained @IRSIBLINGS @IRR @INTEREST @INT @ILSIBLINGS @IDESCENDANTS
+sy keyword cscFunction contained @ICHILDREN @IANCESTORS @IALLANCESTORS
+sy keyword cscFunction contained @GROWTH @GENMBRS @GEN @FACTORIAL @DISCOUNT @DESCENDANTS
+sy keyword cscFunction contained @DECLINE @CHILDREN @CURRMBRRANGE @CURLEV @CURGEN
+sy keyword cscFunction contained @COMPOUNDGROWTH @COMPOUND @AVGRANGE @AVG @ANCESTVAL
+sy keyword cscFunction contained @ANCESTORS @ALLANCESTORS @ACCUM @ABS
+sy match cscFunction contained "@"
+sy match cscError "@\s*\a*" contains=cscFunction
+
+sy match cscStatement "&"
+sy keyword cscStatement AGG ARRAY VAR CCONV CLEARDATA DATACOPY
+
+sy match cscComE contained "^\s*CALC.*"
+sy match cscComE contained "^\s*CLEARBLOCK.*"
+sy match cscComE contained "^\s*SET.*"
+sy match cscComE contained "^\s*FIX"
+sy match cscComE contained "^\s*ENDFIX"
+sy match cscComE contained "^\s*ENDLOOP"
+sy match cscComE contained "^\s*LOOP"
+" sy keyword cscCom FIX ENDFIX LOOP ENDLOOP
+
+sy match cscComW "^\s*CALC.*"
+sy match cscCom "^\s*CALC\s*ALL"
+sy match cscCom "^\s*CALC\s*AVERAGE"
+sy match cscCom "^\s*CALC\s*DIM"
+sy match cscCom "^\s*CALC\s*FIRST"
+sy match cscCom "^\s*CALC\s*LAST"
+sy match cscCom "^\s*CALC\s*TWOPASS"
+
+sy match cscComW "^\s*CLEARBLOCK.*"
+sy match cscCom "^\s*CLEARBLOCK\s\+ALL"
+sy match cscCom "^\s*CLEARBLOCK\s\+UPPER"
+sy match cscCom "^\s*CLEARBLOCK\s\+NONINPUT"
+
+sy match cscComW "^\s*\<SET.*"
+sy match cscCom "^\s*\<SET\s\+Commands"
+sy match cscCom "^\s*\<SET\s\+AGGMISSG"
+sy match cscCom "^\s*\<SET\s\+CACHE"
+sy match cscCom "^\s*\<SET\s\+CALCHASHTBL"
+sy match cscCom "^\s*\<SET\s\+CLEARUPDATESTATUS"
+sy match cscCom "^\s*\<SET\s\+FRMLBOTTOMUP"
+sy match cscCom "^\s*\<SET\s\+LOCKBLOCK"
+sy match cscCom "^\s*\<SET\s\+MSG"
+sy match cscCom "^\s*\<SET\s\+NOTICE"
+sy match cscCom "^\s*\<SET\s\+UPDATECALC"
+sy match cscCom "^\s*\<SET\s\+UPTOLOCAL"
+
+sy keyword cscBPMacro contained !LoopOnAll !LoopOnLevel !LoopOnSelected
+sy keyword cscBPMacro contained !CurrentMember !LoopOnDimensions !CurrentDimension
+sy keyword cscBPMacro contained !CurrentOtherLoopDimension !LoopOnOtherLoopDimensions
+sy keyword cscBPMacro contained !EndLoop !AllMembers !SelectedMembers !If !Else !EndIf
+sy keyword cscBPMacro contained LoopOnAll LoopOnLevel LoopOnSelected
+sy keyword cscBPMacro contained CurrentMember LoopOnDimensions CurrentDimension
+sy keyword cscBPMacro contained CurrentOtherLoopDimension LoopOnOtherLoopDimensions
+sy keyword cscBPMacro contained EndLoop AllMembers SelectedMembers If Else EndIf
+sy match cscBPMacro contained "!"
+sy match cscBPW "!\s*\a*" contains=cscBPmacro
+
+" when wanted, highlighting lhs members or erros in asignments (may lag the editing)
+if version >= 600 && exists("csc_asignment")
+ sy match cscEqError '\("[^"]*"\s*\|[^][\t !%()*+,--/:;<=>{}~]\+\s*\|->\s*\)*=\([^=]\@=\|$\)'
+ sy region cscFormula transparent matchgroup=cscVarName start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\s*=\([^=]\@=\|\n\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition
+ sy region cscFormulaIn matchgroup=cscVarName transparent start='\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\(->\("[^"]*"\|[^][\t !%()*+,--/:;<=>{}~]\+\)\)*\s*=\([^=]\@=\|$\)' skip='"[^"]*"' end=';' contains=ALLBUT,cscFormula,cscFormulaIn,cscBPMacro,cscCondition contained
+ sy match cscEq "=="
+endif
+
+if !exists("csc_minlines")
+ let csc_minlines = 50 " mostly for () constructs
+endif
+exec "sy sync ccomment cscComment minlines=" . csc_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_csc_syntax_inits")
+ if version < 508
+ let did_csc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ hi cscVarName term=bold ctermfg=9 gui=bold guifg=blue
+
+ HiLink cscNumber Number
+ HiLink cscOctal Number
+ HiLink cscFloat Float
+ HiLink cscParenE Error
+ HiLink cscCommentE Error
+ HiLink cscSpaceE Error
+ HiLink cscError Error
+ HiLink cscString String
+ HiLink cscComment Comment
+ HiLink cscTodo Todo
+ HiLink cscStatement Statement
+ HiLink cscIfError Error
+ HiLink cscEqError Error
+ HiLink cscFunction Statement
+ HiLink cscCondition Statement
+ HiLink cscWarn WarningMsg
+
+ HiLink cscComE Error
+ HiLink cscCom Statement
+ HiLink cscComW WarningMsg
+
+ HiLink cscBPMacro Identifier
+ HiLink cscBPW WarningMsg
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "csc"
+
+" vim: ts=8
diff --git a/runtime/syntax/csh.vim b/runtime/syntax/csh.vim
new file mode 100644
index 000000000..de3d3e2c9
--- /dev/null
+++ b/runtime/syntax/csh.vim
@@ -0,0 +1,160 @@
+" Vim syntax file
+" Language: C-shell (csh)
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Version: 8
+" Last Change: Sep 02, 2003
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" clusters:
+syn cluster cshQuoteList contains=cshDblQuote,cshSnglQuote,cshBckQuote
+syn cluster cshVarList contains=cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst
+
+" Variables which affect the csh itself
+syn match cshSetVariables contained "argv\|histchars\|ignoreeof\|noglob\|prompt\|status"
+syn match cshSetVariables contained "cdpath\|history\|mail\|nonomatch\|savehist\|time"
+syn match cshSetVariables contained "cwd\|home\|noclobber\|path\|shell\|verbose"
+syn match cshSetVariables contained "echo"
+
+syn case ignore
+syn keyword cshTodo contained todo
+syn case match
+
+" Variable Name Expansion Modifiers
+syn match cshModifier contained ":\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
+
+" Strings and Comments
+syn match cshNoEndlineDQ contained "[^\"]\(\\\\\)*$"
+syn match cshNoEndlineSQ contained "[^\']\(\\\\\)*$"
+syn match cshNoEndlineBQ contained "[^\`]\(\\\\\)*$"
+
+syn region cshDblQuote start=+[^\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshShellVariables,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ,cshBckQuote
+syn region cshSnglQuote start=+[^\\]'+lc=1 skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ
+syn region cshBckQuote start=+[^\\]`+lc=1 skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ
+syn region cshDblQuote start=+^"+ skip=+\\\\\|\\"+ end=+"+ contains=cshSpecial,cshExtVar,cshSelector,cshQtyWord,cshArgv,cshSubst,cshNoEndlineDQ
+syn region cshSnglQuote start=+^'+ skip=+\\\\\|\\'+ end=+'+ contains=cshNoEndlineSQ
+syn region cshBckQuote start=+^`+ skip=+\\\\\|\\`+ end=+`+ contains=cshNoEndlineBQ
+syn cluster cshCommentGroup contains=cshTodo,@Spell
+syn match cshComment "#.*$" contains=@cshCommentGroup
+
+" A bunch of useful csh keywords
+syn keyword cshStatement alias end history onintr setenv unalias
+syn keyword cshStatement cd eval kill popd shift unhash
+syn keyword cshStatement chdir exec login pushd source
+syn keyword cshStatement continue exit logout rehash time unsetenv
+syn keyword cshStatement dirs glob nice repeat umask wait
+syn keyword cshStatement echo goto nohup
+
+syn keyword cshConditional break case else endsw switch
+syn keyword cshConditional breaksw default endif
+syn keyword cshRepeat foreach
+
+" Special environment variables
+syn keyword cshShellVariables HOME LOGNAME PATH TERM USER
+
+" Modifiable Variables without {}
+syn match cshExtVar "\$[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
+syn match cshSelector "\$[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
+syn match cshQtyWord "\$#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
+syn match cshArgv "\$\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
+syn match cshArgv "\$\*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=" contains=cshModifier
+
+" Modifiable Variables with {}
+syn match cshExtVar "\${[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
+syn match cshSelector "\${[a-zA-Z_][a-zA-Z0-9_]*\[[a-zA-Z_]\+\]\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
+syn match cshQtyWord "\${#[a-zA-Z_][a-zA-Z0-9_]*\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
+syn match cshArgv "\${\d\+\(:h\|:t\|:r\|:q\|:x\|:gh\|:gt\|:gr\)\=}" contains=cshModifier
+
+" UnModifiable Substitutions
+syn match cshSubstError "\$?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
+syn match cshSubstError "\${?[a-zA-Z_][a-zA-Z0-9_]*:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)}"
+syn match cshSubstError "\$?[0$<]:\(h\|t\|r\|q\|x\|gh\|gt\|gr\)"
+syn match cshSubst "\$?[a-zA-Z_][a-zA-Z0-9_]*"
+syn match cshSubst "\${?[a-zA-Z_][a-zA-Z0-9_]*}"
+syn match cshSubst "\$?[0$<]"
+
+" I/O redirection
+syn match cshRedir ">>&!\|>&!\|>>&\|>>!\|>&\|>!\|>>\|<<\|>\|<"
+
+" Handle set expressions
+syn region cshSetExpr matchgroup=cshSetStmt start="\<set\>\|\<unset\>" end="$\|;" contains=cshComment,cshSetStmt,cshSetVariables,@cshQuoteList
+
+" Operators and Expression-Using constructs
+"syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|\|%\|&\|+\|-\|/\|<\|>\||"
+syn match cshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||"
+syn match cshOperator contained "[(){}]"
+syn region cshTest matchgroup=cshStatement start="\<if\>\|\<while\>" skip="\\$" matchgroup=cshStatement end="\<then\>\|$" contains=cshComment,cshOperator,@cshQuoteList,@cshVarLIst
+
+" Highlight special characters (those which have a backslash) differently
+syn match cshSpecial contained "\\\d\d\d\|\\[abcfnrtv\\]"
+syn match cshNumber "-\=\<\d\+\>"
+
+" All other identifiers
+"syn match cshIdentifier "\<[a-zA-Z._][a-zA-Z0-9._]*\>"
+
+" Shell Input Redirection (Here Documents)
+if version < 600
+ syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**END[a-zA-Z_0-9]*\**" matchgroup=cshRedir end="^END[a-zA-Z_0-9]*$"
+ syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**EOF\**" matchgroup=cshRedir end="^EOF$"
+else
+ syn region cshHereDoc matchgroup=cshRedir start="<<-\=\s*\**\z(\h\w*\)\**" matchgroup=cshRedir end="^\z1$"
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_csh_syntax_inits")
+ if version < 508
+ let did_csh_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cshArgv cshVariables
+ HiLink cshBckQuote cshCommand
+ HiLink cshDblQuote cshString
+ HiLink cshExtVar cshVariables
+ HiLink cshHereDoc cshString
+ HiLink cshNoEndlineBQ cshNoEndline
+ HiLink cshNoEndlineDQ cshNoEndline
+ HiLink cshNoEndlineSQ cshNoEndline
+ HiLink cshQtyWord cshVariables
+ HiLink cshRedir cshOperator
+ HiLink cshSelector cshVariables
+ HiLink cshSetStmt cshStatement
+ HiLink cshSetVariables cshVariables
+ HiLink cshSnglQuote cshString
+ HiLink cshSubst cshVariables
+
+ HiLink cshCommand Statement
+ HiLink cshComment Comment
+ HiLink cshConditional Conditional
+ HiLink cshIdentifier Error
+ HiLink cshModifier Special
+ HiLink cshNoEndline Error
+ HiLink cshNumber Number
+ HiLink cshOperator Operator
+ HiLink cshRedir Statement
+ HiLink cshRepeat Repeat
+ HiLink cshShellVariables Special
+ HiLink cshSpecial Special
+ HiLink cshStatement Statement
+ HiLink cshString String
+ HiLink cshSubstError Error
+ HiLink cshTodo Todo
+ HiLink cshVariables Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "csh"
+
+" vim: ts=18
diff --git a/runtime/syntax/csp.vim b/runtime/syntax/csp.vim
new file mode 100644
index 000000000..bd6213efd
--- /dev/null
+++ b/runtime/syntax/csp.vim
@@ -0,0 +1,195 @@
+" Vim syntax file
+" Language: CSP (Communication Sequential Processes, using FDR input syntax)
+" Maintainer: Jan Bredereke <brederek@tzi.de>
+" Version: 0.6.0
+" Last change: Mon Mar 25, 2002
+" URL: http://www.tzi.de/~brederek/vim/
+" Copying: You may distribute and use this file freely, in the same
+" way as the vim editor itself.
+"
+" To Do: - Probably I missed some keywords or operators, please
+" fix them and notify me, the maintainer.
+" - Currently, we do lexical highlighting only. It would be
+" nice to have more actual syntax checks, including
+" highlighting of wrong syntax.
+" - The additional syntax for the RT-Tester (pseudo-comments)
+" should be optional.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" case is significant to FDR:
+syn case match
+
+" Block comments in CSP are between {- and -}
+syn region cspComment start="{-" end="-}" contains=cspTodo
+" Single-line comments start with --
+syn region cspComment start="--" end="$" contains=cspTodo,cspOldRttComment,cspSdlRttComment keepend
+
+" Numbers:
+syn match cspNumber "\<\d\+\>"
+
+" Conditionals:
+syn keyword cspConditional if then else
+
+" Operators on processes:
+" -> ? : ! ' ; /\ \ [] |~| [> & [[..<-..]] ||| [|..|] || [..<->..] ; : @ |||
+syn match cspOperator "->"
+syn match cspOperator "/\\"
+syn match cspOperator "[^/]\\"lc=1
+syn match cspOperator "\[\]"
+syn match cspOperator "|\~|"
+syn match cspOperator "\[>"
+syn match cspOperator "\[\["
+syn match cspOperator "\]\]"
+syn match cspOperator "<-"
+syn match cspOperator "|||"
+syn match cspOperator "[^|]||[^|]"lc=1,me=e-1
+syn match cspOperator "[^|{\~]|[^|}\~]"lc=1,me=e-1
+syn match cspOperator "\[|"
+syn match cspOperator "|\]"
+syn match cspOperator "\[[^>]"me=e-1
+syn match cspOperator "\]"
+syn match cspOperator "<->"
+syn match cspOperator "[?:!';@]"
+syn match cspOperator "&"
+syn match cspOperator "\."
+
+" (not on processes:)
+" syn match cspDelimiter "{|"
+" syn match cspDelimiter "|}"
+" syn match cspDelimiter "{[^-|]"me=e-1
+" syn match cspDelimiter "[^-|]}"lc=1
+
+" Keywords:
+syn keyword cspKeyword length null head tail concat elem
+syn keyword cspKeyword union inter diff Union Inter member card
+syn keyword cspKeyword empty set Set Seq
+syn keyword cspKeyword true false and or not within let
+syn keyword cspKeyword nametype datatype diamond normal
+syn keyword cspKeyword sbisim tau_loop_factor model_compress
+syn keyword cspKeyword explicate
+syn match cspKeyword "transparent"
+syn keyword cspKeyword external chase prioritize
+syn keyword cspKeyword channel Events
+syn keyword cspKeyword extensions productions
+syn keyword cspKeyword Bool Int
+
+" Reserved keywords:
+syn keyword cspReserved attribute embed module subtype
+
+" Include:
+syn region cspInclude matchgroup=cspIncludeKeyword start="^include" end="$" keepend contains=cspIncludeArg
+syn region cspIncludeArg start='\s\+\"' end= '\"\s*' contained
+
+" Assertions:
+syn keyword cspAssert assert deterministic divergence free deadlock
+syn keyword cspAssert livelock
+syn match cspAssert "\[T="
+syn match cspAssert "\[F="
+syn match cspAssert "\[FD="
+syn match cspAssert "\[FD\]"
+syn match cspAssert "\[F\]"
+
+" Types and Sets
+" (first char a capital, later at least one lower case, no trailing underscore):
+syn match cspType "\<_*[A-Z][A-Z_0-9]*[a-z]\(\|[A-Za-z_0-9]*[A-Za-z0-9]\)\>"
+
+" Processes (all upper case, no trailing underscore):
+" (For identifiers that could be types or sets, too, this second rule set
+" wins.)
+syn match cspProcess "\<[A-Z_][A-Z_0-9]*[A-Z0-9]\>"
+syn match cspProcess "\<[A-Z_]\>"
+
+" reserved identifiers for tool output (ending in underscore):
+syn match cspReservedIdentifier "\<[A-Za-z_][A-Za-z_0-9]*_\>"
+
+" ToDo markers:
+syn match cspTodo "FIXME" contained
+syn match cspTodo "TODO" contained
+syn match cspTodo "!!!" contained
+
+" RT-Tester pseudo comments:
+" (The now obsolete syntax:)
+syn match cspOldRttComment "^--\$\$AM_UNDEF"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_ERROR"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_WARNING"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_SET_TIMER"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_RESET_TIMER"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_ELAPSED_TIMER"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_OUTPUT"lc=2 contained
+syn match cspOldRttComment "^--\$\$AM_INPUT"lc=2 contained
+" (The current syntax:)
+syn region cspRttPragma matchgroup=cspRttPragmaKeyword start="^pragma\s\+" end="\s*$" oneline keepend contains=cspRttPragmaArg,cspRttPragmaSdl
+syn keyword cspRttPragmaArg AM_ERROR AM_WARNING AM_SET_TIMER contained
+syn keyword cspRttPragmaArg AM_RESET_TIMER AM_ELAPSED_TIMER contained
+syn keyword cspRttPragmaArg AM_OUTPUT AM_INPUT AM_INTERNAL contained
+" the "SDL_MATCH" extension:
+syn region cspRttPragmaSdl matchgroup=cspRttPragmaKeyword start="SDL_MATCH\s\+" end="\s*$" contains=cspRttPragmaSdlArg contained
+syn keyword cspRttPragmaSdlArg TRANSLATE nextgroup=cspRttPragmaSdlTransName contained
+syn keyword cspRttPragmaSdlArg PARAM SKIP OPTIONAL CHOICE ARRAY nextgroup=cspRttPragmaSdlName contained
+syn match cspRttPragmaSdlName "\s*\S\+\s*" nextgroup=cspRttPragmaSdlTail contained
+syn region cspRttPragmaSdlTail start="" end="\s*$" contains=cspRttPragmaSdlTailArg contained
+syn keyword cspRttPragmaSdlTailArg SUBSET_USED DEFAULT_VALUE Present contained
+syn match cspRttPragmaSdlTransName "\s*\w\+\s*" nextgroup=cspRttPragmaSdlTransTail contained
+syn region cspRttPragmaSdlTransTail start="" end="\s*$" contains=cspRttPragmaSdlTransTailArg contained
+syn keyword cspRttPragmaSdlTransTailArg sizeof contained
+syn match cspRttPragmaSdlTransTailArg "\*" contained
+syn match cspRttPragmaSdlTransTailArg "(" contained
+syn match cspRttPragmaSdlTransTailArg ")" contained
+
+" temporary syntax extension for commented-out "pragma SDL_MATCH":
+syn match cspSdlRttComment "pragma\s\+SDL_MATCH\s\+" nextgroup=cspRttPragmaSdlArg contained
+
+syn sync lines=250
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_csp_syn_inits")
+ if version < 508
+ let did_csp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ " (For vim version <=5.7, the command groups are defined in
+ " $VIMRUNTIME/syntax/synload.vim )
+ HiLink cspComment Comment
+ HiLink cspNumber Number
+ HiLink cspConditional Conditional
+ HiLink cspOperator Delimiter
+ HiLink cspKeyword Keyword
+ HiLink cspReserved SpecialChar
+ HiLink cspInclude Error
+ HiLink cspIncludeKeyword Include
+ HiLink cspIncludeArg Include
+ HiLink cspAssert PreCondit
+ HiLink cspType Type
+ HiLink cspProcess Function
+ HiLink cspTodo Todo
+ HiLink cspOldRttComment Define
+ HiLink cspRttPragmaKeyword Define
+ HiLink cspSdlRttComment Define
+ HiLink cspRttPragmaArg Define
+ HiLink cspRttPragmaSdlArg Define
+ HiLink cspRttPragmaSdlName Default
+ HiLink cspRttPragmaSdlTailArg Define
+ HiLink cspRttPragmaSdlTransName Default
+ HiLink cspRttPragmaSdlTransTailArg Define
+ HiLink cspReservedIdentifier Error
+ " (Currently unused vim method: Debug)
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "csp"
+
+" vim: ts=8
diff --git a/runtime/syntax/css.vim b/runtime/syntax/css.vim
new file mode 100644
index 000000000..953f224f3
--- /dev/null
+++ b/runtime/syntax/css.vim
@@ -0,0 +1,274 @@
+" Vim syntax file
+" Language: Cascading Style Sheets
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/css.vim
+" Last Change: 2002 Oct 19
+" CSS2 by Nikolai Weibull
+" Full CSS2, HTML4 support by Yeti
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+endif
+ let main_syntax = 'css'
+endif
+
+syn case ignore
+
+syn keyword cssTagName abbr acronym address applet area a b base
+syn keyword cssTagName basefont bdo big blockquote body br button
+syn keyword cssTagName caption center cite code col colgroup dd del
+syn keyword cssTagName dfn dir div dl dt em fieldset font form frame
+syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
+syn keyword cssTagName iframe img input ins isindex kbd label legend li
+syn keyword cssTagName link map menu meta noframes noscript ol optgroup
+syn keyword cssTagName option p param pre q s samp script select small
+syn keyword cssTagName span strike strong style sub sup tbody td
+syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
+syn match cssTagName "\<table\>"
+syn match cssTagName "\*"
+
+syn match cssTagName "@page\>" nextgroup=cssDefinition
+
+syn match cssSelectorOp "[+>.]"
+syn match cssSelectorOp2 "[~|]\?=" contained
+syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
+
+syn match cssIdentifier "#\i\+"
+
+syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl
+syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl
+syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl
+syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier
+
+syn match cssValueInteger contained "[-+]\=\d\+"
+syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\="
+syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)"
+syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)"
+syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)"
+syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)"
+
+syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
+syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr
+syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>"
+syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline
+syn keyword cssFontDescriptorAttr contained all
+syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
+syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
+syn match cssUnicodeRange contained "U+\x\+-\x\+"
+
+syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
+" FIXME: These are actually case-insentivie too, but (a) specs recommend using
+" mixed-case (b) it's hard to highlight the word `Background' correctly in
+" all situations
+syn case match
+syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background
+syn case ignore
+syn match cssColor contained "\<transparent\>"
+syn match cssColor contained "\<white\>"
+syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>"
+syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>"
+"syn match cssColor contained "\<rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
+syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" oneline keepend
+syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\)\s*(" end=")" oneline keepend
+
+syn match cssImportant contained "!\s*important\>"
+
+syn keyword cssCommonAttr contained auto none inherit
+syn keyword cssCommonAttr contained top bottom
+syn keyword cssCommonAttr contained medium normal
+
+syn match cssFontProp contained "\<font\>\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\>\)\="
+syn match cssFontAttr contained "\<\(sans-\)\=\<serif\>"
+syn match cssFontAttr contained "\<small\>\(-\(caps\|caption\)\>\)\="
+syn match cssFontAttr contained "\<x\{1,2\}-\(large\|small\)\>"
+syn match cssFontAttr contained "\<message-box\>"
+syn match cssFontAttr contained "\<status-bar\>"
+syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\|status-bar\)-\)\=\(condensed\|expanded\)\>"
+syn keyword cssFontAttr contained cursive fantasy monospace italic oblique
+syn keyword cssFontAttr contained bold bolder lighter larger smaller
+syn keyword cssFontAttr contained icon menu
+syn match cssFontAttr contained "\<caption\>"
+syn keyword cssFontAttr contained large smaller larger
+syn keyword cssFontAttr contained narrower wider
+
+syn keyword cssColorProp contained color
+syn match cssColorProp contained "\<background\(-\(color\|image\|attachment\|position\)\)\="
+syn keyword cssColorAttr contained center scroll fixed
+syn match cssColorAttr contained "\<repeat\(-[xy]\)\=\>"
+syn match cssColorAttr contained "\<no-repeat\>"
+
+syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
+syn match cssTextAttr contained "\<line-through\>"
+syn match cssTextAttr contained "\<text-indent\>"
+syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
+syn keyword cssTextAttr contained underline overline blink sub super middle
+syn keyword cssTextAttr contained capitalize uppercase lowercase center justify baseline sub super
+
+syn match cssBoxProp contained "\<\(margin\|padding\|border\)\(-\(top\|right\|bottom\|left\)\)\=\>"
+syn match cssBoxProp contained "\<border-\(\(\(top\|right\|bottom\|left\)-\)\=\(width\|color\|style\)\)\=\>"
+syn match cssBoxProp contained "\<\(width\|z-index\)\>"
+syn match cssBoxProp contained "\<\(min\|max\)-\(width\|height\)\>"
+syn keyword cssBoxProp contained width height float clear overflow clip visibility
+syn keyword cssBoxAttr contained thin thick both
+syn keyword cssBoxAttr contained dotted dashed solid double groove ridge inset outset
+syn keyword cssBoxAttr contained hidden visible scroll collapse
+
+syn keyword cssGeneratedContentProp contained content quotes
+syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
+syn match cssGeneratedContentProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
+syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
+syn match cssAuralAttr contained "\<lower\>"
+syn match cssGeneratedContentAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
+syn match cssGeneratedContentAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
+syn match cssGeneratedContentAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
+syn keyword cssGeneratedContentAttr contained disc circle square hebrew armenian georgian
+syn keyword cssGeneratedContentAttr contained inside outside
+
+syn match cssPagingProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
+syn keyword cssPagingProp contained size marks inside orphans widows
+syn keyword cssPagingAttr contained landscape portrait crop cross always avoid
+
+syn keyword cssUIProp contained cursor
+syn match cssUIProp contained "\<outline\(-\(width\|style\|color\)\)\=\>"
+syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>"
+syn keyword cssUIAttr contained default crosshair pointer move wait help
+syn keyword cssUIAttr contained thin thick
+syn keyword cssUIAttr contained dotted dashed solid double groove ridge inset outset
+syn keyword cssUIAttr contained invert
+
+syn match cssRenderAttr contained "\<marker\>"
+syn match cssRenderProp contained "\<\(display\|marker-offset\|unicode-bidi\|white-space\|list-item\|run-in\|inline-table\)\>"
+syn keyword cssRenderProp contained position top bottom direction
+syn match cssRenderProp contained "\<\(left\|right\)\>"
+syn keyword cssRenderAttr contained block inline compact
+syn match cssRenderAttr contained "\<table\(-\(row-gorup\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
+syn keyword cssRenderAttr contained static relative absolute fixed
+syn keyword cssRenderAttr contained ltr rtl embed bidi-override pre nowrap
+syn match cssRenderAttr contained "\<bidi-override\>"
+
+
+syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
+syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numerals\)\)\=\)\>"
+syn keyword cssAuralProp contained volume during azimuth elevation stress richness
+syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>"
+syn keyword cssAuralAttr contained silent
+syn match cssAuralAttr contained "\<spell-out\>"
+syn keyword cssAuralAttr contained non mix
+syn match cssAuralAttr contained "\<\(left\|right\)-side\>"
+syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>"
+syn keyword cssAuralAttr contained leftwards rightwards behind
+syn keyword cssAuralAttr contained below level above higher
+syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\)\>"
+syn keyword cssAuralAttr contained faster slower
+syn keyword cssAuralAttr contained male female child code digits continuous
+
+syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\|speak-header\)\>"
+syn keyword cssTableAttr contained fixed collapse separate show hide once always
+
+" FIXME: This allows cssMediaBlock before the semicolon, which is wrong.
+syn region cssInclude start="@import" end=";" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
+syn match cssBraces contained "[{}]"
+syn match cssError contained "{@<>"
+syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape
+syn match cssBraceError "}"
+
+syn match cssPseudoClass ":\S*" contains=cssPseudoClassId,cssUnicodeEscape
+syn keyword cssPseudoClassId contained link visited active hover focus before after left right
+syn match cssPseudoClassId contained "\<first\(-\(line\|letter\|child\)\)\=\>"
+syn region cssPseudoClassLang matchgroup=cssPseudoClassId start=":lang(" end=")" oneline
+
+syn region cssComment start="/\*" end="\*/"
+
+syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
+syn match cssSpecialCharQQ +\\"+ contained
+syn match cssSpecialCharQ +\\'+ contained
+syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
+syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
+
+if main_syntax == "css"
+ syn sync minlines=10
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_css_syn_inits")
+ if version < 508
+ let did_css_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cssComment Comment
+ HiLink cssTagName Statement
+ HiLink cssSelectorOp Special
+ HiLink cssSelectorOp2 Special
+ HiLink cssFontProp StorageClass
+ HiLink cssColorProp StorageClass
+ HiLink cssTextProp StorageClass
+ HiLink cssBoxProp StorageClass
+ HiLink cssRenderProp StorageClass
+ HiLink cssAuralProp StorageClass
+ HiLink cssRenderProp StorageClass
+ HiLink cssGeneratedContentProp StorageClass
+ HiLink cssPagingProp StorageClass
+ HiLink cssTableProp StorageClass
+ HiLink cssUIProp StorageClass
+ HiLink cssFontAttr Type
+ HiLink cssColorAttr Type
+ HiLink cssTextAttr Type
+ HiLink cssBoxAttr Type
+ HiLink cssRenderAttr Type
+ HiLink cssAuralAttr Type
+ HiLink cssGeneratedContentAttr Type
+ HiLink cssPagingAttr Type
+ HiLink cssTableAttr Type
+ HiLink cssUIAttr Type
+ HiLink cssCommonAttr Type
+ HiLink cssPseudoClassId PreProc
+ HiLink cssPseudoClassLang Constant
+ HiLink cssValueLength Number
+ HiLink cssValueInteger Number
+ HiLink cssValueNumber Number
+ HiLink cssValueAngle Number
+ HiLink cssValueTime Number
+ HiLink cssValueFrequency Number
+ HiLink cssFunction Constant
+ HiLink cssURL String
+ HiLink cssFunctionName Function
+ HiLink cssColor Constant
+ HiLink cssIdentifier Function
+ HiLink cssInclude Include
+ HiLink cssImportant Special
+ HiLink cssBraces Function
+ HiLink cssBraceError Error
+ HiLink cssError Error
+ HiLink cssInclude Include
+ HiLink cssUnicodeEscape Special
+ HiLink cssStringQQ String
+ HiLink cssStringQ String
+ HiLink cssMedia Special
+ HiLink cssMediaType Special
+ HiLink cssMediaComma Normal
+ HiLink cssFontDescriptor Special
+ HiLink cssFontDescriptorFunction Constant
+ HiLink cssFontDescriptorProp StorageClass
+ HiLink cssFontDescriptorAttr Type
+ HiLink cssUnicodeRange Constant
+ delcommand HiLink
+endif
+
+let b:current_syntax = "css"
+
+if main_syntax == 'css'
+ unlet main_syntax
+endif
+
+" vim: ts=8
+
diff --git a/runtime/syntax/cterm.vim b/runtime/syntax/cterm.vim
new file mode 100644
index 000000000..139a0d5e1
--- /dev/null
+++ b/runtime/syntax/cterm.vim
@@ -0,0 +1,190 @@
+" Vim syntax file
+" Language: Century Term Command Script
+" Maintainer: Sean M. McKee <mckee@misslink.net>
+" Last Change: 2002 Apr 13
+" Version Info: @(#)cterm.vim 1.7 97/12/15 09:23:14
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+"FUNCTIONS
+syn keyword ctermFunction abort addcr addlf answer at attr batch baud
+syn keyword ctermFunction break call capture cd cdelay charset cls color
+syn keyword ctermFunction combase config commect copy cread
+syn keyword ctermFunction creadint devprefix dialer dialog dimint
+syn keyword ctermFunction dimlog dimstr display dtimeout dwait edit
+syn keyword ctermFunction editor emulate erase escloop fcreate
+syn keyword ctermFunction fflush fillchar flags flush fopen fread
+syn keyword ctermFunction freadln fseek fwrite fwriteln get hangup
+syn keyword ctermFunction help hiwait htime ignore init itime
+syn keyword ctermFunction keyboard lchar ldelay learn lockfile
+syn keyword ctermFunction locktime log login logout lowait
+syn keyword ctermFunction lsend ltime memlist menu mkdir mode
+syn keyword ctermFunction modem netdialog netport noerror pages parity
+syn keyword ctermFunction pause portlist printer protocol quit rcv
+syn keyword ctermFunction read readint readn redial release
+syn keyword ctermFunction remote rename restart retries return
+syn keyword ctermFunction rmdir rtime run runx scrollback send
+syn keyword ctermFunction session set setcap setcolor setkey
+syn keyword ctermFunction setsym setvar startserver status
+syn keyword ctermFunction stime stopbits stopserver tdelay
+syn keyword ctermFunction terminal time trans type usend version
+syn keyword ctermFunction vi vidblink vidcard vidout vidunder wait
+syn keyword ctermFunction wildsize wclose wopen wordlen wru wruchar
+syn keyword ctermFunction xfer xmit xprot
+syn match ctermFunction "?"
+"syn keyword ctermFunction comment remark
+
+"END FUNCTIONS
+"INTEGER FUNCTIONS
+syn keyword ctermIntFunction asc atod eval filedate filemode filesize ftell
+syn keyword ctermIntFunction len termbits opsys pos sum time val mdmstat
+"END INTEGER FUNCTIONS
+
+"STRING FUNCTIONS
+syn keyword ctermStrFunction cdate ctime chr chrdy chrin comin getenv
+syn keyword ctermStrFunction gethomedir left midstr right str tolower
+syn keyword ctermStrFunction toupper uniq comst exists feof hascolor
+
+"END STRING FUNCTIONS
+
+"PREDEFINED TERM VARIABLES R/W
+syn keyword ctermPreVarRW f _escloop _filename _kermiteol _obufsiz
+syn keyword ctermPreVarRW _port _rcvsync _cbaud _reval _turnchar
+syn keyword ctermPreVarRW _txblksiz _txwindow _vmin _vtime _cparity
+syn keyword ctermPreVarRW _cnumber false t true _cwordlen _cstopbits
+syn keyword ctermPreVarRW _cmode _cemulate _cxprot _clogin _clogout
+syn keyword ctermPreVarRW _cstartsrv _cstopsrv _ccmdfile _cwru
+syn keyword ctermPreVarRW _cprotocol _captfile _cremark _combufsiz
+syn keyword ctermPreVarRW logfile
+"END PREDEFINED TERM VARIABLES R/W
+
+"PREDEFINED TERM VARIABLES R/O
+syn keyword ctermPreVarRO _1 _2 _3 _4 _5 _6 _7 _8 _9 _cursess
+syn keyword ctermPreVarRO _lockfile _baud _errno _retval _sernum
+syn keyword ctermPreVarRO _timeout _row _col _version
+"END PREDEFINED TERM VARIABLES R/O
+
+syn keyword ctermOperator not mod eq ne gt le lt ge xor and or shr not shl
+
+"SYMBOLS
+syn match CtermSymbols "|"
+"syn keyword ctermOperators + - * / % = != > < >= <= & | ^ ! << >>
+"END SYMBOLS
+
+"STATEMENT
+syn keyword ctermStatement off
+syn keyword ctermStatement disk overwrite append spool none
+syn keyword ctermStatement echo view wrap
+"END STATEMENT
+
+"TYPE
+"syn keyword ctermType
+"END TYPE
+
+"USERLIB FUNCTIONS
+"syn keyword ctermLibFunc
+"END USERLIB FUNCTIONS
+
+"LABEL
+syn keyword ctermLabel case default
+"END LABEL
+
+"CONDITIONAL
+syn keyword ctermConditional on endon
+syn keyword ctermConditional proc endproc
+syn keyword ctermConditional for in do endfor
+syn keyword ctermConditional if else elseif endif iferror
+syn keyword ctermConditional switch endswitch
+syn keyword ctermConditional repeat until
+"END CONDITIONAL
+
+"REPEAT
+syn keyword ctermRepeat while
+"END REPEAT
+
+" Function arguments (eg $1 $2 $3)
+syn match ctermFuncArg "\$[1-9]"
+
+syn keyword ctermTodo contained TODO
+
+syn match ctermNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match ctermNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match ctermNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match ctermNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match ctermNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+
+syn match ctermComment "![^=].*$" contains=ctermTodo
+syn match ctermComment "!$"
+syn match ctermComment "\*.*$" contains=ctermTodo
+syn region ctermComment start="comment" end="$" contains=ctermTodo
+syn region ctermComment start="remark" end="$" contains=ctermTodo
+
+syn region ctermVar start="\$(" end=")"
+
+" String and Character contstants
+" Highlight special characters (those which have a backslash) differently
+syn match ctermSpecial contained "\\\d\d\d\|\\."
+syn match ctermSpecial contained "\^."
+syn region ctermString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=ctermSpecial,ctermVar,ctermSymbols
+syn match ctermCharacter "'[^\\]'"
+syn match ctermSpecialCharacter "'\\.'"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cterm_syntax_inits")
+ if version < 508
+ let did_cterm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ctermStatement Statement
+ HiLink ctermFunction Statement
+ HiLink ctermStrFunction Statement
+ HiLink ctermIntFunction Statement
+ HiLink ctermLabel Statement
+ HiLink ctermConditional Statement
+ HiLink ctermRepeat Statement
+ HiLink ctermLibFunc UserDefFunc
+ HiLink ctermType Type
+ HiLink ctermFuncArg PreCondit
+
+ HiLink ctermPreVarRO PreCondit
+ HiLink ctermPreVarRW PreConditBold
+ HiLink ctermVar Type
+
+ HiLink ctermComment Comment
+
+ HiLink ctermCharacter SpecialChar
+ HiLink ctermSpecial Special
+ HiLink ctermSpecialCharacter SpecialChar
+ HiLink ctermSymbols Special
+ HiLink ctermString String
+ HiLink ctermTodo Todo
+ HiLink ctermOperator Statement
+ HiLink ctermNumber Number
+
+ " redefine the colors
+ "hi PreConditBold term=bold ctermfg=1 cterm=bold guifg=Purple gui=bold
+ "hi Special term=bold ctermfg=6 guifg=SlateBlue gui=underline
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cterm"
+
+" vim: ts=8
diff --git a/runtime/syntax/ctrlh.vim b/runtime/syntax/ctrlh.vim
new file mode 100644
index 000000000..715c2c00e
--- /dev/null
+++ b/runtime/syntax/ctrlh.vim
@@ -0,0 +1,33 @@
+" Vim syntax file
+" Language: CTRL-H (e.g., ASCII manpages)
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Apr 25
+
+" Existing syntax is kept, this file can be used as an addition
+
+" Recognize underlined text: _^Hx
+syntax match CtrlHUnderline /_\b./ contains=CtrlHHide
+
+" Recognize bold text: x^Hx
+syntax match CtrlHBold /\(.\)\b\1/ contains=CtrlHHide
+
+" Hide the CTRL-H (backspace)
+syntax match CtrlHHide /.\b/ contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ctrlh_syntax_inits")
+ if version < 508
+ let did_ctrlh_syntax_inits = 1
+ hi link CtrlHHide Ignore
+ hi CtrlHUnderline term=underline cterm=underline gui=underline
+ hi CtrlHBold term=bold cterm=bold gui=bold
+ else
+ hi def link CtrlHHide Ignore
+ hi def CtrlHUnderline term=underline cterm=underline gui=underline
+ hi def CtrlHBold term=bold cterm=bold gui=bold
+ endif
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/cupl.vim b/runtime/syntax/cupl.vim
new file mode 100644
index 000000000..9f804c76c
--- /dev/null
+++ b/runtime/syntax/cupl.vim
@@ -0,0 +1,130 @@
+" Vim syntax file
+" Language: CUPL
+" Maintainer: John Cook <john.cook@kla-tencor.com>
+" Last Change: 2001 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" this language is oblivious to case.
+syn case ignore
+
+" A bunch of keywords
+syn keyword cuplHeader name partno date revision rev designer company nextgroup=cuplHeaderContents
+syn keyword cuplHeader assembly assy location device nextgroup=cuplHeaderContents
+
+syn keyword cuplTodo contained TODO XXX FIXME
+
+" cuplHeaderContents uses default highlighting except for numbers
+syn match cuplHeaderContents ".\+;"me=e-1 contains=cuplNumber contained
+
+" String contstants
+syn region cuplString start=+'+ end=+'+
+syn region cuplString start=+"+ end=+"+
+
+syn keyword cuplStatement append condition
+syn keyword cuplStatement default else
+syn keyword cuplStatement field fld format function fuse
+syn keyword cuplStatement group if jump loc
+syn keyword cuplStatement macro min node out
+syn keyword cuplStatement pin pinnode present table
+syn keyword cuplStatement sequence sequenced sequencejk sequencers sequencet
+
+syn keyword cuplFunction log2 log8 log16 log
+
+" Valid integer number formats (decimal, binary, octal, hex)
+syn match cuplNumber "\<[-+]\=[0-9]\+\>"
+syn match cuplNumber "'d'[0-9]\+\>"
+syn match cuplNumber "'b'[01x]\+\>"
+syn match cuplNumber "'o'[0-7x]\+\>"
+syn match cuplNumber "'h'[0-9a-fx]\+\>"
+
+" operators
+syn match cuplLogicalOperator "[!#&$]"
+syn match cuplArithmeticOperator "[-+*/%]"
+syn match cuplArithmeticOperator "\*\*"
+syn match cuplAssignmentOperator ":\=="
+syn match cuplEqualityOperator ":"
+syn match cuplTruthTableOperator "=>"
+
+" Signal extensions
+syn match cuplExtension "\.[as][pr]\>"
+syn match cuplExtension "\.oe\>"
+syn match cuplExtension "\.oemux\>"
+syn match cuplExtension "\.[dlsrjk]\>"
+syn match cuplExtension "\.ck\>"
+syn match cuplExtension "\.dq\>"
+syn match cuplExtension "\.ckmux\>"
+syn match cuplExtension "\.tec\>"
+syn match cuplExtension "\.cnt\>"
+
+syn match cuplRangeOperator "\.\." contained
+
+" match ranges like memadr:[0000..1FFF]
+" and highlight both the numbers and the .. operator
+syn match cuplNumberRange "\<\x\+\.\.\x\+\>" contains=cuplRangeOperator
+
+" match vectors of type [name3..0] (decimal numbers only)
+" but assign them no special highlighting except for the .. operator
+syn match cuplBitVector "\<\a\+\d\+\.\.\d\+\>" contains=cuplRangeOperator
+
+" other special characters
+syn match cuplSpecialChar "[\[\](){},;]"
+
+" directives
+" (define these after cuplOperator so $xxx overrides $)
+syn match cuplDirective "\$msg"
+syn match cuplDirective "\$macro"
+syn match cuplDirective "\$mend"
+syn match cuplDirective "\$repeat"
+syn match cuplDirective "\$repend"
+syn match cuplDirective "\$define"
+syn match cuplDirective "\$include"
+
+" multi-line comments
+syn region cuplComment start=+/\*+ end=+\*/+ contains=cuplNumber,cuplTodo
+
+syn sync minlines=1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cupl_syn_inits")
+ if version < 508
+ let did_cupl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink cuplHeader cuplStatement
+ HiLink cuplLogicalOperator cuplOperator
+ HiLink cuplRangeOperator cuplOperator
+ HiLink cuplArithmeticOperator cuplOperator
+ HiLink cuplAssignmentOperator cuplOperator
+ HiLink cuplEqualityOperator cuplOperator
+ HiLink cuplTruthTableOperator cuplOperator
+ HiLink cuplOperator cuplStatement
+ HiLink cuplFunction cuplStatement
+ HiLink cuplStatement Statement
+ HiLink cuplNumberRange cuplNumber
+ HiLink cuplNumber cuplString
+ HiLink cuplString String
+ HiLink cuplComment Comment
+ HiLink cuplExtension cuplSpecial
+ HiLink cuplSpecialChar cuplSpecial
+ HiLink cuplSpecial Special
+ HiLink cuplDirective PreProc
+ HiLink cuplTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cupl"
+" vim:ts=8
diff --git a/runtime/syntax/cuplsim.vim b/runtime/syntax/cuplsim.vim
new file mode 100644
index 000000000..18a30ce25
--- /dev/null
+++ b/runtime/syntax/cuplsim.vim
@@ -0,0 +1,80 @@
+" Vim syntax file
+" Language: CUPL simulation
+" Maintainer: John Cook <john.cook@kla-tencor.com>
+" Last Change: 2001 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the CUPL syntax to start with
+if version < 600
+ source <sfile>:p:h/cupl.vim
+else
+ runtime! syntax/cupl.vim
+ unlet b:current_syntax
+endif
+
+" omit definition-specific stuff
+syn clear cuplStatement
+syn clear cuplFunction
+syn clear cuplLogicalOperator
+syn clear cuplArithmeticOperator
+syn clear cuplAssignmentOperator
+syn clear cuplEqualityOperator
+syn clear cuplTruthTableOperator
+syn clear cuplExtension
+
+" simulation order statement
+syn match cuplsimOrder "order:" nextgroup=cuplsimOrderSpec skipempty
+syn region cuplsimOrderSpec start="." end=";"me=e-1 contains=cuplComment,cuplsimOrderFormat,cuplBitVector,cuplSpecialChar,cuplLogicalOperator,cuplCommaOperator contained
+
+" simulation base statement
+syn match cuplsimBase "base:" nextgroup=cuplsimBaseSpec skipempty
+syn region cuplsimBaseSpec start="." end=";"me=e-1 contains=cuplComment,cuplsimBaseType contained
+syn keyword cuplsimBaseType octal decimal hex contained
+
+" simulation vectors statement
+syn match cuplsimVectors "vectors:"
+
+" simulator format control
+syn match cuplsimOrderFormat "%\d\+\>" contained
+
+" simulator control
+syn match cuplsimStimulus "[10ckpx]\+"
+syn match cuplsimStimulus +'\(\x\|x\)\+'+
+syn match cuplsimOutput "[lhznx*]\+"
+syn match cuplsimOutput +"\x\+"+
+
+syn sync minlines=1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cuplsim_syn_inits")
+ if version < 508
+ let did_cuplsim_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " append to the highlighting links in cupl.vim
+ " The default highlighting.
+ HiLink cuplsimOrder cuplStatement
+ HiLink cuplsimBase cuplStatement
+ HiLink cuplsimBaseType cuplStatement
+ HiLink cuplsimVectors cuplStatement
+ HiLink cuplsimStimulus cuplNumber
+ HiLink cuplsimOutput cuplNumber
+ HiLink cuplsimOrderFormat cuplNumber
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cuplsim"
+" vim:ts=8
diff --git a/runtime/syntax/cvs.vim b/runtime/syntax/cvs.vim
new file mode 100644
index 000000000..94b2a809e
--- /dev/null
+++ b/runtime/syntax/cvs.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: CVS commit file
+" Maintainer: Matt Dunford (zoot@zotikos.com)
+" URL: http://www.zotikos.com/downloads/cvs.vim
+" Last Change: Sat Nov 24 23:25:11 CET 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn region cvsLine start="^CVS: " end="$" contains=cvsFile,cvsCom,cvsFiles,cvsTag
+syn match cvsFile contained " \t\(\(\S\+\) \)\+"
+syn match cvsTag contained " Tag:"
+syn match cvsFiles contained "\(Added\|Modified\|Removed\) Files:"
+syn region cvsCom start="Committing in" end="$" contains=cvsDir contained extend keepend
+syn match cvsDir contained "\S\+$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cvs_syn_inits")
+ if version < 508
+ let did_cvs_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cvsLine Comment
+ HiLink cvsDir cvsFile
+ HiLink cvsFile Constant
+ HiLink cvsFiles cvsCom
+ HiLink cvsTag cvsCom
+ HiLink cvsCom Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cvs"
diff --git a/runtime/syntax/cvsrc.vim b/runtime/syntax/cvsrc.vim
new file mode 100644
index 000000000..d55197950
--- /dev/null
+++ b/runtime/syntax/cvsrc.vim
@@ -0,0 +1,49 @@
+" Vim syntax file
+" Language: CVS RC File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/syntax/pcp/cvsrc/
+" Latest Revision: 2004-05-06
+" arch-tag: 1910f2a8-66f4-4dde-9d1a-297566934535
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" strings
+syn region cvsrcString start=+"+ skip=+\\\\\|\\\\"+ end=+"\|$+
+syn region cvsrcString start=+'+ skip=+\\\\\|\\\\'+ end=+'\|$+
+
+" numbers
+syn match cvsrcNumber "\<\d\+\>"
+
+" commands
+syn match cvsrcBegin "^" nextgroup=cvsrcCommand skipwhite
+
+syn region cvsrcCommand contained transparent matchgroup=cvsrcCommand start="add\|admin\|checkout\|commit\|cvs\|diff\|export\|history\|import\|init\|log\|rdiff\|release\|remove\|rtag\|status\|tag\|update" end="$" contains=cvsrcOption,cvsrcString,cvsrcNumber keepend
+
+" options
+syn match cvsrcOption "-\a\+"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cvsrc_syn_inits")
+ if version < 508
+ let did_cvsrc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cvsrcString String
+ HiLink cvsrcNumber Number
+ HiLink cvsrcCommand Keyword
+ HiLink cvsrcOption Identifier
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cvsrc"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/cweb.vim b/runtime/syntax/cweb.vim
new file mode 100644
index 000000000..4062b0a4e
--- /dev/null
+++ b/runtime/syntax/cweb.vim
@@ -0,0 +1,80 @@
+" Vim syntax file
+" Language: CWEB
+" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
+" Last Change: April 30, 2001
+
+" Details of the CWEB language can be found in the article by Donald E. Knuth
+" and Silvio Levy, "The CWEB System of Structured Documentation", included as
+" file "cwebman.tex" in the standard CWEB distribution, available for
+" anonymous ftp at ftp://labrea.stanford.edu/pub/cweb/.
+
+" TODO: Section names and C/C++ comments should be treated as TeX material.
+" TODO: The current version switches syntax highlighting off for section
+" TODO: names, and leaves C/C++ comments as such. (On the other hand,
+" TODO: switching to TeX mode in C/C++ comments might be colour overkill.)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" For starters, read the TeX syntax; TeX syntax items are allowed at the top
+" level in the CWEB syntax, e.g., in the preamble. In general, a CWEB source
+" code can be seen as a normal TeX document with some C/C++ material
+" interspersed in certain defined regions.
+if version < 600
+ source <sfile>:p:h/tex.vim
+else
+ runtime! syntax/tex.vim
+ unlet b:current_syntax
+endif
+
+" Read the C/C++ syntax too; C/C++ syntax items are treated as such in the
+" C/C++ section of a CWEB chunk or in inner C/C++ context in "|...|" groups.
+syntax include @webIncludedC <sfile>:p:h/cpp.vim
+
+" Inner C/C++ context (ICC) should be quite simple as it's comprised of
+" material in "|...|"; however the naive definition for this region would
+" hickup at the innocious "\|" TeX macro. Note: For the time being we expect
+" that an ICC begins either at the start of a line or after some white space.
+syntax region webInnerCcontext start="\(^\|[ \t\~`(]\)|" end="|" contains=@webIncludedC,webSectionName,webRestrictedTeX,webIgnoredStuff
+
+" Genuine C/C++ material. This syntactic region covers both the definition
+" part and the C/C++ part of a CWEB section; it is ended by the TeX part of
+" the next section.
+syntax region webCpart start="@[dfscp<(]" end="@[ \*]" contains=@webIncludedC,webSectionName,webRestrictedTeX,webIgnoredStuff
+
+" Section names contain C/C++ material only in inner context.
+syntax region webSectionName start="@[<(]" end="@>" contains=webInnerCcontext contained
+
+" The contents of "control texts" is not treated as TeX material, because in
+" non-trivial cases this completely clobbers the syntax recognition. Instead,
+" we highlight these elements as "strings".
+syntax region webRestrictedTeX start="@[\^\.:t=q]" end="@>" oneline
+
+" Double-@ means single-@, anywhere in the CWEB source. (This allows e-mail
+" address <someone@@fsf.org> without going into C/C++ mode.)
+syntax match webIgnoredStuff "@@"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cweb_syntax_inits")
+ if version < 508
+ let did_cweb_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink webRestrictedTeX String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cweb"
+
+" vim: ts=8
diff --git a/runtime/syntax/cynlib.vim b/runtime/syntax/cynlib.vim
new file mode 100644
index 000000000..a9985074d
--- /dev/null
+++ b/runtime/syntax/cynlib.vim
@@ -0,0 +1,91 @@
+" Vim syntax file
+" Language: Cynlib(C++)
+" Maintainer: Phil Derrick <phild@forteds.com>
+" Last change: 2001 Sep 02
+" URL http://www.derrickp.freeserve.co.uk/vim/syntax/cynlib.vim
+"
+" Language Information
+"
+" Cynlib is a library of C++ classes to allow hardware
+" modelling in C++. Combined with a simulation kernel,
+" the compiled and linked executable forms a hardware
+" simulation of the described design.
+"
+" Further information can be found from www.forteds.com
+
+
+" Remove any old syntax stuff hanging around
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Read the C++ syntax to start with - this includes the C syntax
+if version < 600
+ source <sfile>:p:h/cpp.vim
+else
+ runtime! syntax/cpp.vim
+endif
+unlet b:current_syntax
+
+" Cynlib extensions
+
+syn keyword cynlibMacro Default CYNSCON
+syn keyword cynlibMacro Case CaseX EndCaseX
+syn keyword cynlibType CynData CynSignedData CynTime
+syn keyword cynlibType In Out InST OutST
+syn keyword cynlibType Struct
+syn keyword cynlibType Int Uint Const
+syn keyword cynlibType Long Ulong
+syn keyword cynlibType OneHot
+syn keyword cynlibType CynClock Cynclock0
+syn keyword cynlibFunction time configure my_name
+syn keyword cynlibFunction CynModule epilog execute_on
+syn keyword cynlibFunction my_name
+syn keyword cynlibFunction CynBind bind
+syn keyword cynlibFunction CynWait CynEvent
+syn keyword cynlibFunction CynSetName
+syn keyword cynlibFunction CynTick CynRun
+syn keyword cynlibFunction CynFinish
+syn keyword cynlibFunction Cynprintf CynSimTime
+syn keyword cynlibFunction CynVcdFile
+syn keyword cynlibFunction CynVcdAdd CynVcdRemove
+syn keyword cynlibFunction CynVcdOn CynVcdOff
+syn keyword cynlibFunction CynVcdScale
+syn keyword cynlibFunction CynBgnName CynEndName
+syn keyword cynlibFunction CynClock configure time
+syn keyword cynlibFunction CynRedAnd CynRedNand
+syn keyword cynlibFunction CynRedOr CynRedNor
+syn keyword cynlibFunction CynRedXor CynRedXnor
+syn keyword cynlibFunction CynVerify
+
+
+syn match cynlibOperator "<<="
+syn keyword cynlibType In Out InST OutST Int Uint Const Cynclock
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cynlib_syntax_inits")
+ if version < 508
+ let did_cynlib_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cynlibOperator Operator
+ HiLink cynlibMacro Statement
+ HiLink cynlibFunction Statement
+ HiLink cynlibppMacro Statement
+ HiLink cynlibType Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cynlib"
diff --git a/runtime/syntax/cynpp.vim b/runtime/syntax/cynpp.vim
new file mode 100644
index 000000000..b984bace3
--- /dev/null
+++ b/runtime/syntax/cynpp.vim
@@ -0,0 +1,68 @@
+" Vim syntax file
+" Language: Cyn++
+" Maintainer: Phil Derrick <phild@forteds.com>
+" Last change: 2001 Sep 02
+"
+" Language Information
+"
+" Cynpp (Cyn++) is a macro language to ease coding in Cynlib.
+" Cynlib is a library of C++ classes to allow hardware
+" modelling in C++. Combined with a simulation kernel,
+" the compiled and linked executable forms a hardware
+" simulation of the described design.
+"
+" Cyn++ is designed to be HDL-like.
+"
+" Further information can be found from www.forteds.com
+
+
+
+
+
+" Remove any old syntax stuff hanging around
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the Cynlib syntax to start with - this includes the C++ syntax
+if version < 600
+ source <sfile>:p:h/cynlib.vim
+else
+ runtime! syntax/cynlib.vim
+endif
+unlet b:current_syntax
+
+
+
+" Cyn++ extensions
+
+syn keyword cynppMacro Always EndAlways
+syn keyword cynppMacro Module EndModule
+syn keyword cynppMacro Initial EndInitial
+syn keyword cynppMacro Posedge Negedge Changed
+syn keyword cynppMacro At
+syn keyword cynppMacro Thread EndThread
+syn keyword cynppMacro Instantiate
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_cynpp_syntax_inits")
+ if version < 508
+ let did_cynpp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cLabel Label
+ HiLink cynppMacro Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "cynpp"
diff --git a/runtime/syntax/d.vim b/runtime/syntax/d.vim
new file mode 100644
index 000000000..51ecc43ae
--- /dev/null
+++ b/runtime/syntax/d.vim
@@ -0,0 +1,219 @@
+" Vim syntax file for the D programming language (version 0.90).
+"
+" Language: D
+" Maintainer: Jason Mills<jmills@cs.mun.ca>
+" URL:
+" Last Change: 2004 May 21
+" Version: 0.8
+"
+" Options:
+" d_comment_strings - set to highlight strings and numbers in comments
+"
+" d_hl_operator_overload - set to highlight D's specially named functions
+" that when overloaded implement unary and binary operators (e.g. cmp).
+"
+" Todo:
+" - Allow user to set sync minlines
+"
+" - Several keywords (namely, in and out) are both storage class and
+" statements, depending on their context. Must use some matching to figure
+" out which and highlight appropriately. For now I have made such keywords
+" statements.
+"
+" - Mark contents of the asm statement body as special
+"
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+" Keyword definitions
+"
+syn keyword dExternal import module extern
+syn keyword dConditional if else switch
+syn keyword dBranch goto break continue
+syn keyword dRepeat while for do foreach
+syn keyword dBoolean true false
+syn keyword dConstant null
+syn keyword dTypedef alias typedef
+syn keyword dStructure template interface class enum struct union
+syn keyword dOperator new delete typeof cast align is
+syn keyword dOperator this super
+if exists("d_hl_operator_overload")
+ syn keyword dOpOverload opNeg opCom opPostInc opPostDec opAdd opSub opSub_r
+ syn keyword dOpOverload opMul opDiv opDiv_r opMod opMod_r opAnd opOr opXor
+ syn keyword dOpOverload opShl opShl_r opShr opShr_r opUShr opUShr_r opCat
+ syn keyword dOpOverload opCat_r opEquals opEquals opCmp opCmp opCmp opCmp
+ syn keyword dOpOverload opAddAssign opSubAssign opMulAssign opDivAssign
+ syn keyword dOpOverload opModAssign opAndAssign opOrAssign opXorAssign
+ syn keyword dOpOverload opShlAssign opShrAssign opUShrAssign opCatAssign
+ syn keyword dOpOverload opIndex opCall opSlice
+endif
+syn keyword dType ushort int uint long ulong float
+syn keyword dType void byte ubyte double bit char wchar ucent cent
+syn keyword dType short bool dchar
+syn keyword dType real ireal ifloat idouble creal cfloat cdouble
+syn keyword dDebug deprecated unittest
+syn keyword dExceptions throw try catch finally
+syn keyword dScopeDecl public protected private export
+syn keyword dStatement version debug return with invariant body
+syn keyword dStatement in out inout asm mixin
+syn keyword dStatement function delegate
+syn keyword dStorageClass auto static override final const abstract volatile
+syn keyword dStorageClass synchronized
+syn keyword dPragma pragma
+
+
+" Assert is a statement and a module name.
+syn match dAssert "^assert\>"
+syn match dAssert "[^.]\s*\<assert\>"ms=s+1
+
+" Marks contents of the asm statment body as special
+"
+" TODO
+"syn match dAsmStatement "\<asm\>"
+"syn region dAsmBody start="asm[\n]*\s*{"hs=e+1 end="}"he=e-1 contains=dAsmStatement
+"
+"hi def link dAsmBody dUnicode
+"hi def link dAsmStatement dStatement
+
+" Labels
+"
+" We contain dScopeDecl so public: private: etc. are not highlighted like labels
+syn match dUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=dLabel,dScopeDecl
+syn keyword dLabel case default
+
+" Comments
+"
+syn keyword dTodo contained TODO FIXME TEMP XXX
+syn match dCommentStar contained "^\s*\*[^/]"me=e-1
+syn match dCommentStar contained "^\s*\*$"
+syn match dCommentPlus contained "^\s*+[^/]"me=e-1
+syn match dCommentPlus contained "^\s*+$"
+if exists("d_comment_strings")
+ syn region dBlockCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=dCommentStar,dUnicode,dEscSequence,@Spell
+ syn region dNestedCommentString contained start=+"+ end=+"+ end="+"me=s-1,he=s-1 contains=dCommentPlus,dUnicode,dEscSequence,@Spell
+ syn region dLineCommentString contained start=+"+ end=+$\|"+ contains=dUnicode,dEscSequence,@Spell
+ syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
+ syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
+ syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
+else
+ syn region dBlockComment start="/\*" end="\*/" contains=dBlockCommentString,dTodo,@Spell
+ syn region dNestedComment start="/+" end="+/" contains=dNestedComment,dNestedCommentString,dTodo,@Spell
+ syn match dLineComment "//.*" contains=dLineCommentString,dTodo,@Spell
+endif
+
+hi link dLineCommentString dBlockCommentString
+hi link dBlockCommentString dString
+hi link dNestedCommentString dString
+hi link dCommentStar dBlockComment
+hi link dCommentPlus dNestedComment
+
+syn sync minlines=25
+
+" Characters
+"
+syn match dSpecialCharError contained "[^']"
+
+" Escape sequences (oct,specal char,hex,wchar). These are not contained
+" because they are considered string litterals
+syn match dEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)"
+syn match dCharacter "'[^']*'" contains=dEscSequence,dSpecialCharError
+syn match dCharacter "'\\''" contains=dEscSequence
+syn match dCharacter "'[^\\]'"
+
+" Unicode characters
+"
+syn match dUnicode "\\u\d\{4\}"
+
+" String.
+"
+syn region dString start=+"+ end=+"+ contains=dEscSequence,@Spell
+syn region dRawString start=+`+ skip=+\\`+ end=+`+ contains=@Spell
+syn region dRawString start=+r"+ skip=+\\"+ end=+"+ contains=@Spell
+syn region dHexString start=+x"+ skip=+\\"+ end=+"+
+
+" Numbers
+"
+syn case ignore
+syn match dInt display "\<\d[0-9_]*\(u\=l\=\|l\=u\=\)\>"
+" Hex number
+syn match dHex display "\<0x[0-9a-f_]\+\(u\=l\=\|l\=u\=\)\>"
+syn match dHex display "\<\x[0-9a-f_]*h\(u\=l\=\|l\=u\=\)\>"
+" Flag the first zero of an octal number as something special
+syn match dOctal display "\<0[0-7_]\+\(u\=l\=\|l\=u\=\)\>" contains=cOctalZero
+syn match dOctalZero display contained "\<0"
+
+"floating point without the dot
+syn match dFloat display "\<\d[0-9_]*\(fi\=\|l\=i\)\>"
+"floating point number, with dot, optional exponent
+syn match dFloat display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\=[fl]\=i\="
+"floating point number, starting with a dot, optional exponent
+syn match dFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>"
+"floating point number, without dot, with exponent
+"syn match dFloat display "\<\d\+e[-+]\=\d\+[fl]\=\>"
+syn match dFloat display "\<\d[0-9_]*e[-+]\=[0-9_]\+[fl]\=\>"
+
+"floating point without the dot
+syn match dHexFloat display "\<0x\x\+\(fi\=\|l\=i\)\>"
+"floating point number, with dot, optional exponent
+syn match dHexFloat display "\<0x\x\+\.\x*\(p[-+]\=\x\+\)\=[fl]\=i\="
+"floating point number, without dot, with exponent
+syn match dHexFloat display "\<0x\x\+p[-+]\=\x\+[fl]\=\>"
+
+" binary numbers
+syn match dBinary display "\<0b[01_]\+\>"
+" flag an octal number with wrong digits
+syn match dOctalError display "0\o*[89]\d*"
+syn case match
+
+" Pragma (preprocessor) support
+" TODO: Highlight following Integer and optional Filespec.
+syn region dPragma start="#\s*\(line\>\)" skip="\\$" end="$"
+
+
+" The default highlighting.
+"
+hi def link dBinary Number
+hi def link dInt Number
+hi def link dHex Number
+hi def link dOctal Number
+hi def link dFloat Float
+hi def link dHexFloat Float
+hi def link dDebug Debug
+hi def link dBranch Conditional
+hi def link dConditional Conditional
+hi def link dLabel Label
+hi def link dUserLabel Label
+hi def link dRepeat Repeat
+hi def link dExceptions Exception
+hi def link dAssert Statement
+hi def link dStatement Statement
+hi def link dScopeDecl dStorageClass
+hi def link dStorageClass StorageClass
+hi def link dBoolean Boolean
+hi def link dUnicode Special
+hi def link dRawString String
+hi def link dString String
+hi def link dHexString String
+hi def link dCharacter Character
+hi def link dEscSequence SpecialChar
+hi def link dSpecialCharError Error
+hi def link dOctalError Error
+hi def link dOperator Operator
+hi def link dOpOverload Operator
+hi def link dConstant Constant
+hi def link dTypedef Typedef
+hi def link dStructure Structure
+hi def link dTodo Todo
+hi def link dType Type
+hi def link dLineComment Comment
+hi def link dBlockComment Comment
+hi def link dNestedComment Comment
+hi def link dExternal Include
+hi def link dPragma PreProc
+
+let b:current_syntax = "d"
+
+" vim: ts=8
diff --git a/runtime/syntax/dcd.vim b/runtime/syntax/dcd.vim
new file mode 100644
index 000000000..a566745fb
--- /dev/null
+++ b/runtime/syntax/dcd.vim
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language: WildPackets EtherPeek Decoder (.dcd) file
+" Maintainer: Christopher Shinn <christopher@lucent.com>
+" Last Change: 2003 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Keywords
+syn keyword dcdFunction DCod TRTS TNXT CRLF
+syn match dcdFunction display "\(STR\)\#"
+syn keyword dcdLabel LABL
+syn region dcdLabel start="[A-Z]" end=";"
+syn keyword dcdConditional CEQU CNEQ CGTE CLTE CBIT CLSE
+syn keyword dcdConditional LSTS LSTE LSTZ
+syn keyword dcdConditional TYPE TTST TEQU TNEQ TGTE TLTE TBIT TLSE TSUB SKIP
+syn keyword dcdConditional MARK WHOA
+syn keyword dcdConditional SEQU SNEQ SGTE SLTE SBIT
+syn match dcdConditional display "\(CST\)\#" "\(TST\)\#"
+syn keyword dcdDisplay HBIT DBIT BBIT
+syn keyword dcdDisplay HBYT DBYT BBYT
+syn keyword dcdDisplay HWRD DWRD BWRD
+syn keyword dcdDisplay HLNG DLNG BLNG
+syn keyword dcdDisplay D64B
+syn match dcdDisplay display "\(HEX\)\#" "\(CHR\)\#" "\(EBC\)\#"
+syn keyword dcdDisplay HGLB DGLB BGLB
+syn keyword dcdDisplay DUMP
+syn keyword dcdStatement IPLG IPV6 ATLG AT03 AT01 ETHR TRNG PRTO PORT
+syn keyword dcdStatement TIME OSTP PSTR CSTR NBNM DMPE FTPL CKSM FCSC
+syn keyword dcdStatement GBIT GBYT GWRD GLNG
+syn keyword dcdStatement MOVE ANDG ORRG NOTG ADDG SUBG MULG DIVG MODG INCR DECR
+syn keyword dcdSpecial PRV1 PRV2 PRV3 PRV4 PRV5 PRV6 PRV7 PRV8
+
+" Comment
+syn region dcdComment start="\*" end="\;"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dcd_syntax_inits")
+ if version < 508
+ let did_dcd_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dcdFunction Identifier
+ HiLink dcdLabel Constant
+ HiLink dcdConditional Conditional
+ HiLink dcdDisplay Type
+ HiLink dcdStatement Statement
+ HiLink dcdSpecial Special
+ HiLink dcdComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dcd"
diff --git a/runtime/syntax/dcl.vim b/runtime/syntax/dcl.vim
new file mode 100644
index 000000000..0d67a712c
--- /dev/null
+++ b/runtime/syntax/dcl.vim
@@ -0,0 +1,164 @@
+" Vim syntax file
+" Language: DCL (Digital Command Language - vms)
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 3
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version < 600
+ set iskeyword=$,@,48-57,_
+else
+ setlocal iskeyword=$,@,48-57,_
+endif
+
+syn case ignore
+syn keyword dclInstr accounting del[ete] gen[cat] mou[nt] run
+syn keyword dclInstr all[ocate] dep[osit] gen[eral] ncp run[off]
+syn keyword dclInstr ana[lyze] dia[gnose] gos[ub] ncs sca
+syn keyword dclInstr app[end] dif[ferences] got[o] on sea[rch]
+syn keyword dclInstr ass[ign] dir[ectory] hel[p] ope[n] set
+syn keyword dclInstr att[ach] dis[able] ico[nv] pas[cal] sho[w]
+syn keyword dclInstr aut[horize] dis[connect] if pas[sword] sor[t]
+syn keyword dclInstr aut[ogen] dis[mount] ini[tialize] pat[ch] spa[wn]
+syn keyword dclInstr bac[kup] dpm[l] inq[uire] pca sta[rt]
+syn keyword dclInstr cal[l] dqs ins[tall] pho[ne] sto[p]
+syn keyword dclInstr can[cel] dsr job pri[nt] sub[mit]
+syn keyword dclInstr cc dst[graph] lat[cp] pro[duct] sub[routine]
+syn keyword dclInstr clo[se] dtm lib[rary] psw[rap] swx[cr]
+syn keyword dclInstr cms dum[p] lic[ense] pur[ge] syn[chronize]
+syn keyword dclInstr con[nect] edi[t] lin[k] qde[lete] sys[gen]
+syn keyword dclInstr con[tinue] ena[ble] lmc[p] qse[t] sys[man]
+syn keyword dclInstr con[vert] end[subroutine] loc[ale] qsh[ow] tff
+syn keyword dclInstr cop[y] eod log[in] rea[d] then
+syn keyword dclInstr cre[ate] eoj log[out] rec[all] typ[e]
+syn keyword dclInstr cxx exa[mine] lse[dit] rec[over] uil
+syn keyword dclInstr cxx[l_help] exc[hange] mac[ro] ren[ame] unl[ock]
+syn keyword dclInstr dea[llocate] exi[t] mai[l] rep[ly] ves[t]
+syn keyword dclInstr dea[ssign] fdl mer[ge] req[uest] vie[w]
+syn keyword dclInstr deb[ug] flo[wgraph] mes[sage] ret[urn] wai[t]
+syn keyword dclInstr dec[k] fon[t] mms rms wri[te]
+syn keyword dclInstr def[ine] for[tran]
+
+syn keyword dclLexical f$context f$edit f$getjpi f$message f$setprv
+syn keyword dclLexical f$csid f$element f$getqui f$mode f$string
+syn keyword dclLexical f$cvsi f$environment f$getsyi f$parse f$time
+syn keyword dclLexical f$cvtime f$extract f$identifier f$pid f$trnlnm
+syn keyword dclLexical f$cvui f$fao f$integer f$privilege f$type
+syn keyword dclLexical f$device f$file_attributes f$length f$process f$user
+syn keyword dclLexical f$directory f$getdvi f$locate f$search f$verify
+
+syn match dclMdfy "/\I\i*" nextgroup=dclMdfySet,dclMdfySetString
+syn match dclMdfySet "=[^ \t"]*" contained
+syn region dclMdfySet matchgroup=dclMdfyBrkt start="=\[" matchgroup=dclMdfyBrkt end="]" contains=dclMdfySep
+syn region dclMdfySetString start='="' skip='""' end='"' contained
+syn match dclMdfySep "[:,]" contained
+
+" Numbers
+syn match dclNumber "\d\+"
+
+" Varname (mainly to prevent dclNumbers from being recognized when part of a dclVarname)
+syn match dclVarname "\I\i*"
+
+" Filenames (devices, paths)
+syn match dclDevice "\I\i*\(\$\I\i*\)\=:[^=]"me=e-1 nextgroup=dclDirPath,dclFilename
+syn match dclDirPath "\[\(\I\i*\.\)*\I\i*\]" contains=dclDirSep nextgroup=dclFilename
+syn match dclFilename "\I\i*\$\(\I\i*\)\=\.\(\I\i*\)*\(;\d\+\)\=" contains=dclDirSep
+syn match dclFilename "\I\i*\.\(\I\i*\)\=\(;\d\+\)\=" contains=dclDirSep contained
+syn match dclDirSep "[[\].;]"
+
+" Strings
+syn region dclString start='"' skip='""' end='"'
+
+" $ stuff and comments
+syn cluster dclCommentGroup contains=dclStart,dclTodo,@Spell
+syn match dclStart "^\$" skipwhite nextgroup=dclExe
+syn match dclContinue "-$"
+syn match dclComment "^\$!.*$" contains=@dclCommentGroup
+syn match dclExe "\I\i*" contained
+syn match dclTodo "DEBUG\|TODO" contained
+
+" Assignments and Operators
+syn match dclAssign ":==\="
+syn match dclAssign "="
+syn match dclOper "--\|+\|\*\|/"
+syn match dclLogOper "\.[a-zA-Z][a-zA-Z][a-zA-Z]\=\." contains=dclLogical,dclLogSep
+syn keyword dclLogical contained and ge gts lt nes
+syn keyword dclLogical contained eq ges le lts not
+syn keyword dclLogical contained eqs gt les ne or
+syn match dclLogSep "\." contained
+
+" @command procedures
+syn match dclCmdProcStart "@" nextgroup=dclCmdProc
+syn match dclCmdProc "\I\i*\(\.\I\i*\)\=" contained
+syn match dclCmdProc "\I\i*:" contained nextgroup=dclCmdDirPath,dclCmdProc
+syn match dclCmdDirPath "\[\(\I\i*\.\)*\I\i*\]" contained nextgroup=delCmdProc
+
+" labels
+syn match dclGotoLabel "^\$\s*\I\i*:\s*$" contains=dclStart
+
+" parameters
+syn match dclParam "'\I[a-zA-Z0-9_$]*'\="
+
+" () matching (the clusters are commented out until a vim/vms comes out for v5.2+)
+"syn cluster dclNextGroups contains=dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
+"syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,@dclNextGroups
+syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
+syn match dclError ")"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dcl_syntax_inits")
+ if version < 508
+ let did_dcl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dclLogOper dclError
+ HiLink dclLogical dclOper
+ HiLink dclLogSep dclSep
+
+ HiLink dclAssign Operator
+ HiLink dclCmdProc Special
+ HiLink dclCmdProcStart Operator
+ HiLink dclComment Comment
+ HiLink dclContinue Statement
+ HiLink dclDevice Identifier
+ HiLink dclDirPath Identifier
+ HiLink dclDirPath Identifier
+ HiLink dclDirSep Delimiter
+ HiLink dclError Error
+ HiLink dclExe Statement
+ HiLink dclFilename NONE
+ HiLink dclGotoLabel Label
+ HiLink dclInstr Statement
+ HiLink dclLexical Function
+ HiLink dclMdfy Type
+ HiLink dclMdfyBrkt Delimiter
+ HiLink dclMdfySep Delimiter
+ HiLink dclMdfySet Type
+ HiLink dclMdfySetString String
+ HiLink dclNumber Number
+ HiLink dclOper Operator
+ HiLink dclParam Special
+ HiLink dclSep Delimiter
+ HiLink dclStart Delimiter
+ HiLink dclString String
+ HiLink dclTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dcl"
+
+" vim: ts=16
diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim
new file mode 100644
index 000000000..577b48d3e
--- /dev/null
+++ b/runtime/syntax/debchangelog.vim
@@ -0,0 +1,54 @@
+" Vim syntax file
+" Language: Debian changelog files
+" Maintainer: Wichert Akkerman <wakkerma@debian.org>
+" Last Change: 30 April 2001
+
+" Standard syntax initialization
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Case doesn't matter for us
+syn case ignore
+
+" Define some common expressions we can use later on
+syn match debchangelogName contained "^[[:alpha:]][[:alnum:].+-]\+ "
+syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\)"
+syn match debchangelogTarget contained "\( stable\| frozen\| unstable\| experimental\)\+"
+syn match debchangelogVersion contained "(.\{-})"
+syn match debchangelogCloses contained "closes:\s*\(bug\)\=#\s\=\d\+\(,\s*\(bug\)\=#\s\=\d\+\)*"
+syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
+syn match debchangelogEmail contained "<.\{-}>"
+
+" Define the entries that make up the changelog
+syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline
+syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
+syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses oneline
+
+" Associate our matches and regions with pretty colours
+if version >= 508 || !exists("did_debchangelog_syn_inits")
+ if version < 508
+ let did_debchangelog_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink debchangelogHeader Error
+ HiLink debchangelogFooter Identifier
+ HiLink debchangelogEntry Normal
+ HiLink debchangelogCloses Statement
+ HiLink debchangelogUrgency Identifier
+ HiLink debchangelogName Comment
+ HiLink debchangelogVersion Identifier
+ HiLink debchangelogTarget Identifier
+ HiLink debchangelogEmail Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "debchangelog"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim
new file mode 100644
index 000000000..d580fdb93
--- /dev/null
+++ b/runtime/syntax/debcontrol.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: Debian control files
+" Maintainer: Wichert Akkerman <wakkerma@debian.org>
+" Last Change: October 28, 2001
+
+" Standard syntax initialization
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Everything that is not explicitly matched by the rules below
+syn match debcontrolElse "^.*$"
+
+" Common seperators
+syn match debControlComma ", *"
+syn match debControlSpace " "
+
+" Define some common expressions we can use later on
+syn match debcontrolArchitecture contained "\(all\|any\|alpha\|arm\|hppa\|ia64\|i386\|m68k\|mipsel\|mips\|powerpc\|sh\|sheb\|sparc\|hurd-i386\)"
+syn match debcontrolName contained "[a-z][a-z0-9+-]*"
+syn match debcontrolPriority contained "\(extra\|important\|optional\|required\|standard\)"
+syn match debcontrolSection contained "\(\(contrib\|non-free\|non-US/main\|non-US/contrib\|non-US/non-free\)/\)\=\(admin\|base\|comm\|devel\|doc\|editors\|electronics\|games\|graphics\|hamradio\|interpreters\|libs\|mail\|math\|misc\|net\|news\|oldlibs\|otherosfs\|science\|shells\|sound\|text\|tex\|utils\|web\|x11\|debian-installer\)"
+syn match debcontrolVariable contained "\${.\{-}}"
+
+" An email address
+syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
+syn match debcontrolEmail "<.\{-}>"
+
+" List of all legal keys
+syn match debcontrolKey contained "^\(Source\|Package\|Section\|Priority\|Maintainer\|Uploaders\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Architecture\|Description\|Bugs\|Origin\): *"
+
+" Fields for which we do strict syntax checking
+syn region debcontrolStrictField start="^Architecture" end="$" contains=debcontrolKey,debcontrolArchitecture,debcontrolSpace oneline
+syn region debcontrolStrictField start="^\(Package\|Source\)" end="$" contains=debcontrolKey,debcontrolName oneline
+syn region debcontrolStrictField start="^Priority" end="$" contains=debcontrolKey,debcontrolPriority oneline
+syn region debcontrolStrictField start="^Section" end="$" contains=debcontrolKey,debcontrolSection oneline
+
+" Catch-all for the other legal fields
+syn region debcontrolField start="^\(Maintainer\|Build-Depends\|Build-Conflicts\|Build-Depends-Indep\|Build-Conflicts-Indep\|Standards-Version\|Pre-Depends\|Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Essential\|Bugs\|Origin\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
+syn region debcontrolMultiField start="^\(Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ ]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable
+
+" Associate our matches and regions with pretty colours
+if version >= 508 || !exists("did_debcontrol_syn_inits")
+ if version < 508
+ let did_debcontrol_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink debcontrolKey Keyword
+ HiLink debcontrolField Normal
+ HiLink debcontrolStrictField Error
+ HiLink debcontrolMultiField Normal
+ HiLink debcontrolArchitecture Normal
+ HiLink debcontrolName Normal
+ HiLink debcontrolPriority Normal
+ HiLink debcontrolSection Normal
+ HiLink debcontrolVariable Identifier
+ HiLink debcontrolEmail Identifier
+ HiLink debcontrolElse Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "debcontrol"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/def.vim b/runtime/syntax/def.vim
new file mode 100644
index 000000000..a360022b2
--- /dev/null
+++ b/runtime/syntax/def.vim
@@ -0,0 +1,57 @@
+" Vim syntax file
+" Language: Microsoft Module-Definition (.def) File
+" Maintainer: Rob Brady <robb@datatone.com>
+" Last Change: $Date$
+" URL: http://www.datatone.com/~robb/vim/syntax/def.vim
+" $Revision$
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn match defComment ";.*"
+
+syn keyword defKeyword LIBRARY STUB EXETYPE DESCRIPTION CODE WINDOWS DOS
+syn keyword defKeyword RESIDENTNAME PRIVATE EXPORTS IMPORTS SEGMENTS
+syn keyword defKeyword HEAPSIZE DATA
+syn keyword defStorage LOADONCALL MOVEABLE DISCARDABLE SINGLE
+syn keyword defStorage FIXED PRELOAD
+
+syn match defOrdinal "@\d\+"
+
+syn region defString start=+'+ end=+'+
+
+syn match defNumber "\d+"
+syn match defNumber "0x\x\+"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_def_syntax_inits")
+ if version < 508
+ let did_def_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink defComment Comment
+ HiLink defKeyword Keyword
+ HiLink defStorage StorageClass
+ HiLink defString String
+ HiLink defNumber Number
+ HiLink defOrdinal Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "def"
+
+" vim: ts=8
diff --git a/runtime/syntax/desc.vim b/runtime/syntax/desc.vim
new file mode 100644
index 000000000..0d0dbbda4
--- /dev/null
+++ b/runtime/syntax/desc.vim
@@ -0,0 +1,100 @@
+" Vim syntax file
+" Language: ROCKLinux .desc
+" Maintainer: Piotr Esden-Tempski <esden@rocklinux.org>
+" Last Change: 2002 Apr 23
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" syntax definitions
+
+setl iskeyword+=-
+syn keyword descFlag DIETLIBC contained
+syn keyword descLicense Unknown GPL LGPL FDL MIT BSD OpenSource Free-to-use Commercial contained
+
+" tags
+syn match descTag /^\[\(I\|TITLE\)\]/
+syn match descTag /^\[\(T\|TEXT\)\]/ contained
+syn match descTag /^\[\(U\|URL\)\]/
+syn match descTag /^\[\(A\|AUTHOR\)\]/
+syn match descTag /^\[\(M\|MAINTAINER\)\]/
+syn match descTag /^\[\(C\|CATEGORY\)\]/ contained
+syn match descTag /^\[\(F\|FLAG\)\]/ contained
+syn match descTag /^\[\(E\|DEP\|DEPENDENCY\)\]/
+syn match descTag /^\[\(R\|ARCH\|ARCHITECTURE\)\]/
+syn match descTag /^\[\(L\|LICENSE\)\]/ contained
+syn match descTag /^\[\(S\|STATUS\)\]/
+syn match descTag /^\[\(V\|VER\|VERSION\)\]/
+syn match descTag /^\[\(P\|PRI\|PRIORITY\)\]/ nextgroup=descInstall skipwhite
+syn match descTag /^\[\(D\|DOWN\|DOWNLOAD\)\]/ nextgroup=descSum skipwhite
+
+" misc
+syn match descUrl /\w\+:\/\/\S\+/
+syn match descCategory /\w\+\/\w\+/ contained
+syn match descEmail /<\w\+@[\.A-Za-z0-9]\+>/
+
+" priority tag
+syn match descInstallX /X/ contained
+syn match descInstallO /O/ contained
+syn match descInstall /[OX]/ contained contains=descInstallX,descInstallO nextgroup=descStage skipwhite
+syn match descDash /-/ contained
+syn match descDigit /\d/ contained
+syn match descStage /[\-0][\-1][\-2][\-3][\-4][\-5][\-6][\-7][\-8][\-9]/ contained contains=descDash,descDigit nextgroup=descCompilePriority skipwhite
+syn match descCompilePriority /\d\{3}\.\d\{3}/ contained
+
+" download tag
+syn match descSum /\d\+/ contained nextgroup=descTarball skipwhite
+syn match descTarball /\S\+/ contained nextgroup=descUrl skipwhite
+
+
+" tag regions
+syn region descText start=/^\[\(T\|TEXT\)\]/ end=/$/ contains=descTag,descUrl,descEmail
+
+syn region descTagRegion start=/^\[\(C\|CATEGORY\)\]/ end=/$/ contains=descTag,descCategory
+
+syn region descTagRegion start=/^\[\(F\|FLAG\)\]/ end=/$/ contains=descTag,descFlag
+
+syn region descTagRegion start=/^\[\(L\|LICENSE\)\]/ end=/$/ contains=descTag,descLicense
+
+" For version 5.7 and earlier: only when not done already
+" Define the default highlighting.
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_desc_syntax_inits")
+ if version < 508
+ let did_desc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink descFlag Identifier
+ HiLink descLicense Identifier
+ HiLink descCategory Identifier
+
+ HiLink descTag Type
+ HiLink descUrl Underlined
+ HiLink descEmail Underlined
+
+ " priority tag colors
+ HiLink descInstallX Boolean
+ HiLink descInstallO Type
+ HiLink descDash Operator
+ HiLink descDigit Number
+ HiLink descCompilePriority Number
+
+ " download tag colors
+ HiLink descSum Number
+ HiLink descTarball Underlined
+
+ " tag region colors
+ HiLink descText Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "desc"
diff --git a/runtime/syntax/desktop.vim b/runtime/syntax/desktop.vim
new file mode 100644
index 000000000..5b71e5119
--- /dev/null
+++ b/runtime/syntax/desktop.vim
@@ -0,0 +1,119 @@
+" Vim syntax file
+" Language: .desktop, .directory files
+" according to freedesktop.org specification 0.9.4
+" http://pdx.freedesktop.org/Standards/desktop-entry-spec/desktop-entry-spec-0.9.4.html
+" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
+" Last Change: 2004 May 16
+" Version Info: desktop.vim 0.9.4-1.2
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" This syntax file can be used to all *nix configuration files similar to dos
+" ini format (eg. .xawtv, .radio, kde rc files) - this is default mode. But
+" you can also enforce strict following of freedesktop.org standard for
+" .desktop and .directory files . Set (eg. in vimrc)
+" let enforce_freedesktop_standard = 1
+" and nonstandard extensions not following X- notation will not be highlighted.
+if exists("enforce_freedesktop_standard")
+ let b:enforce_freedesktop_standard = 1
+else
+ let b:enforce_freedesktop_standard = 0
+endif
+
+" case on
+syn case match
+
+" General
+if b:enforce_freedesktop_standard == 0
+ syn match dtNotStLabel "^.\{-}=\@=" nextgroup=dtDelim
+endif
+
+syn match dtGroup /^\s*\[.*\]/
+syn match dtComment /^\s*#.*$/
+syn match dtDelim /=/ contained
+
+" Locale
+syn match dtLocale /^\s*\<\(Name\|GenericName\|Comment\|SwallowTitle\|Icon\|UnmountIcon\)\>.*/ contains=dtLocaleKey,dtLocaleName,dtDelim transparent
+syn keyword dtLocaleKey Name GenericName Comment SwallowTitle Icon UnmountIcon nextgroup=dtLocaleName containedin=dtLocale
+syn match dtLocaleName /\(\[.\{-}\]\s*=\@=\|\)/ nextgroup=dtDelim containedin=dtLocale contained
+
+" Numeric
+syn match dtNumeric /^\s*\<Version\>/ contains=dtNumericKey,dtDelim
+syn keyword dtNumericKey Version nextgroup=dtDelim containedin=dtNumeric contained
+
+" Boolean
+syn match dtBoolean /^\s*\<\(StartupNotify\|ReadOnly\|Terminal\|Hidden\|NoDisplay\)\>.*/ contains=dtBooleanKey,dtDelim,dtBooleanValue transparent
+syn keyword dtBooleanKey StartupNotify ReadOnly Terminal Hidden NoDisplay nextgroup=dtDelim containedin=dtBoolean contained
+syn keyword dtBooleanValue true false containedin=dtBoolean contained
+
+" String
+syn match dtString /^\s*\<\(Encoding\|Icon\|Path\|Actions\|FSType\|MountPoint\|UnmountIcon\|URL\|Categories\|OnlyShowIn\|NotShowIn\|StartupWMClass\|FilePattern\|MimeType\)\>.*/ contains=dtStringKey,dtDelim transparent
+syn keyword dtStringKey Type Encoding TryExec Exec Path Actions FSType MountPoint URL Categories OnlyShowIn NotShowIn StartupWMClass FilePattern MimeType nextgroup=dtDelim containedin=dtString contained
+
+" Exec
+syn match dtExec /^\s*\<\(Exec\|TryExec\|SwallowExec\)\>.*/ contains=dtExecKey,dtDelim,dtExecParam transparent
+syn keyword dtExecKey Exec TryExec SwallowExec nextgroup=dtDelim containedin=dtExec contained
+syn match dtExecParam /%[fFuUnNdDickv]/ containedin=dtExec contained
+
+" Type
+syn match dtType /^\s*\<Type\>.*/ contains=dtTypeKey,dtDelim,dtTypeValue transparent
+syn keyword dtTypeKey Type nextgroup=dtDelim containedin=dtType contained
+syn keyword dtTypeValue Application Link FSDevice Directory containedin=dtType contained
+
+" X-Addition
+syn match dtXAdd /^\s*X-.*/ contains=dtXAddKey,dtDelim transparent
+syn match dtXAddKey /^\s*X-.\{-}\s*=\@=/ nextgroup=dtDelim containedin=dtXAdd contains=dtXLocale contained
+
+" Locale for X-Addition
+syn match dtXLocale /\[.\{-}\]\s*=\@=/ containedin=dtXAddKey contained
+
+" Locale for all
+syn match dtALocale /\[.\{-}\]\s*=\@=/ containedin=ALL
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_desktop_syntax_inits")
+ if version < 508
+ let did_dosini_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dtGroup Special
+ HiLink dtComment Comment
+ HiLink dtDelim String
+
+ HiLink dtLocaleKey Type
+ HiLink dtLocaleName Identifier
+ HiLink dtXLocale Identifier
+ HiLink dtALocale Identifier
+
+ HiLink dtNumericKey Type
+
+ HiLink dtBooleanKey Type
+ HiLink dtBooleanValue Constant
+
+ HiLink dtStringKey Type
+
+ HiLink dtExecKey Type
+ HiLink dtExecParam Special
+ HiLink dtTypeKey Type
+ HiLink dtTypeValue Constant
+ HiLink dtNotStLabel Type
+ HiLink dtXAddKey Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "desktop"
+
+" vim:ts=8
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
new file mode 100644
index 000000000..2461abebb
--- /dev/null
+++ b/runtime/syntax/diff.vim
@@ -0,0 +1,78 @@
+" Vim syntax file
+" Language: Diff (context or unified)
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2003 Apr 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match diffOnly "^Only in .*"
+syn match diffIdentical "^Files .* and .* are identical$"
+syn match diffDiffer "^Files .* and .* differ$"
+syn match diffBDiffer "^Binary files .* and .* differ$"
+syn match diffIsA "^File .* is a .* while file .* is a .*"
+syn match diffNoEOL "^No newline at end of file .*"
+syn match diffCommon "^Common subdirectories: .*"
+
+syn match diffRemoved "^-.*"
+syn match diffRemoved "^<.*"
+syn match diffAdded "^+.*"
+syn match diffAdded "^>.*"
+syn match diffChanged "^! .*"
+
+syn match diffSubname " @@..*"ms=s+3 contained
+syn match diffLine "^@.*" contains=diffSubname
+syn match diffLine "^\<\d\+\>.*"
+syn match diffLine "^\*\*\*\*.*"
+
+"Some versions of diff have lines like "#c#" and "#d#" (where # is a number)
+syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*"
+
+syn match diffFile "^diff.*"
+syn match diffFile "^+++ .*"
+syn match diffFile "^Index: .*$"
+syn match diffFile "^==== .*$"
+syn match diffOldFile "^\*\*\* .*"
+syn match diffNewFile "^--- .*"
+
+syn match diffComment "^#.*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_diff_syntax_inits")
+ if version < 508
+ let did_diff_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink diffOldFile diffFile
+ HiLink diffNewFile diffFile
+ HiLink diffFile Type
+ HiLink diffOnly Constant
+ HiLink diffIdentical Constant
+ HiLink diffDiffer Constant
+ HiLink diffBDiffer Constant
+ HiLink diffIsA Constant
+ HiLink diffNoEOL Constant
+ HiLink diffCommon Constant
+ HiLink diffRemoved Special
+ HiLink diffChanged PreProc
+ HiLink diffAdded Identifier
+ HiLink diffLine Statement
+ HiLink diffSubname PreProc
+ HiLink diffComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "diff"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/dircolors.vim b/runtime/syntax/dircolors.vim
new file mode 100644
index 000000000..ade52fc6f
--- /dev/null
+++ b/runtime/syntax/dircolors.vim
@@ -0,0 +1,106 @@
+" Vim syntax file
+" Language: dircolors(1) input file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/dircolors/
+" Latest Revision: 2004-05-22
+" arch-tag: 995e2983-2a7a-4f1e-b00d-3fdf8e076b40
+" Color definition coloring implemented my Mikolaj Machowski <mikmach@wp.pl>
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" todo
+syn keyword dircolorsTodo contained FIXME TODO XXX NOTE
+
+" comments
+syn region dircolorsComment start="#" end="$" contains=dircolorsTodo
+
+" numbers
+syn match dircolorsNumber "\<\d\+\>"
+
+" keywords
+syn keyword dircolorsKeyword TERM NORMAL NORM FILE DIR LNK LINK SYMLINK
+syn keyword dircolorsKeyword ORPHAN MISSING FIFO PIPE SOCK BLK BLOCK CHR
+syn keyword dircolorsKeyword CHAR DOOR EXEC LEFT LEFTCODE RIGHT RIGHTCODE
+syn keyword dircolorsKeyword END ENDCODE
+if exists("dircolors_is_slackware")
+ syn keyword dircolorsKeyword COLOR OPTIONS EIGHTBIT
+endif
+
+" extensions
+syn match dircolorsExtension "^\s*\zs[.*]\S\+"
+
+" colors
+syn match dircolors01 "\<01\>"
+syn match dircolors04 "\<04\>"
+syn match dircolors05 "\<05\>"
+syn match dircolors07 "\<07\>"
+syn match dircolors08 "\<08\>"
+syn match dircolors30 "\<30\>"
+syn match dircolors31 "\<31\>"
+syn match dircolors32 "\<32\>"
+syn match dircolors33 "\<33\>"
+syn match dircolors34 "\<34\>"
+syn match dircolors35 "\<35\>"
+syn match dircolors36 "\<36\>"
+syn match dircolors37 "\<37\>"
+syn match dircolors40 "\<40\>"
+syn match dircolors41 "\<41\>"
+syn match dircolors42 "\<42\>"
+syn match dircolors43 "\<43\>"
+syn match dircolors44 "\<44\>"
+syn match dircolors45 "\<45\>"
+syn match dircolors46 "\<46\>"
+syn match dircolors47 "\<47\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dircolors_syn_inits")
+ if version < 508
+ let did_dircolors_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ HiDef hi <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ HiDef hi def <args>
+ endif
+
+ HiLink dircolorsTodo Todo
+ HiLink dircolorsComment Comment
+ HiLink dircolorsNumber Number
+ HiLink dircolorsKeyword Keyword
+ HiLink dircolorsExtension Keyword
+
+ HiDef dircolors01 term=bold cterm=bold gui=bold
+ HiDef dircolors04 term=underline cterm=underline gui=underline
+ " HiDef dircolors05
+ HiDef dircolors07 term=reverse cterm=reverse gui=reverse
+ HiLink dircolors08 Ignore
+ HiDef dircolors30 ctermfg=Black guifg=Black
+ HiDef dircolors31 ctermfg=Red guifg=Red
+ HiDef dircolors32 ctermfg=Green guifg=Green
+ HiDef dircolors33 ctermfg=Yellow guifg=Yellow
+ HiDef dircolors34 ctermfg=Blue guifg=Blue
+ HiDef dircolors35 ctermfg=Magenta guifg=Magenta
+ HiDef dircolors36 ctermfg=Cyan guifg=Cyan
+ HiDef dircolors37 ctermfg=White guifg=White
+ HiDef dircolors40 ctermbg=Black ctermfg=White guibg=Black guifg=White
+ HiDef dircolors41 ctermbg=DarkRed guibg=DarkRed
+ HiDef dircolors42 ctermbg=DarkGreen guibg=DarkGreen
+ HiDef dircolors43 ctermbg=DarkYellow guibg=DarkYellow
+ HiDef dircolors44 ctermbg=DarkBlue guibg=DarkBlue
+ HiDef dircolors45 ctermbg=DarkMagenta guibg=DarkMagenta
+ HiDef dircolors46 ctermbg=DarkCyan guibg=DarkCyan
+ HiDef dircolors47 ctermbg=White ctermfg=Black guibg=White guifg=Black
+
+ delcommand HiLink
+ delcommand HiDef
+endif
+
+let b:current_syntax = "dircolors"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/diva.vim b/runtime/syntax/diva.vim
new file mode 100644
index 000000000..78668fd85
--- /dev/null
+++ b/runtime/syntax/diva.vim
@@ -0,0 +1,110 @@
+" Vim syntax file
+" Language: SKILL for Diva
+" Maintainer: Toby Schaffer <jtschaff@eos.ncsu.edu>
+" Last Change: 2001 May 09
+" Comments: SKILL is a Lisp-like programming language for use in EDA
+" tools from Cadence Design Systems. It allows you to have
+" a programming environment within the Cadence environment
+" that gives you access to the complete tool set and design
+" database. These items are for Diva verification rules decks.
+
+" Don't remove any old syntax stuff hanging around! We need stuff
+" from skill.vim.
+if !exists("did_skill_syntax_inits")
+ if version < 600
+ so <sfile>:p:h/skill.vim
+ else
+ runtime! syntax/skill.vim
+ endif
+endif
+
+syn keyword divaDRCKeywords area enc notch ovlp sep width
+syn keyword divaDRCKeywords app diffNet length lengtha lengthb
+syn keyword divaDRCKeywords notParallel only_perp opposite parallel
+syn keyword divaDRCKeywords sameNet shielded with_perp
+syn keyword divaDRCKeywords edge edgea edgeb fig figa figb
+syn keyword divaDRCKeywords normalGrow squareGrow message raw
+syn keyword divaMeasKeywords perimeter length bends_all bends_full
+syn keyword divaMeasKeywords bends_part corners_all corners_full
+syn keyword divaMeasKeywords corners_part angles_all angles_full
+syn keyword divaMeasKeywords angles_part fig_count butting coincident
+syn keyword divaMeasKeywords over not_over outside inside enclosing
+syn keyword divaMeasKeywords figure one_net two_net three_net grounded
+syn keyword divaMeasKeywords polarized limit keep ignore
+syn match divaCtrlFunctions "(ivIf\>"hs=s+1
+syn match divaCtrlFunctions "\<ivIf("he=e-1
+syn match divaCtrlFunctions "(switch\>"hs=s+1
+syn match divaCtrlFunctions "\<switch("he=e-1
+syn match divaCtrlFunctions "(and\>"hs=s+1
+syn match divaCtrlFunctions "\<and("he=e-1
+syn match divaCtrlFunctions "(or\>"hs=s+1
+syn match divaCtrlFunctions "\<or("he=e-1
+syn match divaCtrlFunctions "(null\>"hs=s+1
+syn match divaCtrlFunctions "\<null("he=e-1
+syn match divaExtFunctions "(save\(Interconnect\|Property\|Parameter\|Recognition\)\>"hs=s+1
+syn match divaExtFunctions "\<save\(Interconnect\|Property\|Parameter\|Recognition\)("he=e-1
+syn match divaExtFunctions "(\(save\|measure\|attach\|multiLevel\|calculate\)Parasitic\>"hs=s+1
+syn match divaExtFunctions "\<\(save\|measure\|attach\|multiLevel\|calculate\)Parasitic("he=e-1
+syn match divaExtFunctions "(\(calculate\|measure\)Parameter\>"hs=s+1
+syn match divaExtFunctions "\<\(calculate\|measure\)Parameter("he=e-1
+syn match divaExtFunctions "(measure\(Resistance\|Fringe\)\>"hs=s+1
+syn match divaExtFunctions "\<measure\(Resistance\|Fringe\)("he=e-1
+syn match divaExtFunctions "(extract\(Device\|MOS\)\>"hs=s+1
+syn match divaExtFunctions "\<extract\(Device\|MOS\)("he=e-1
+syn match divaDRCFunctions "(checkAllLayers\>"hs=s+1
+syn match divaDRCFunctions "\<checkAllLayers("he=e-1
+syn match divaDRCFunctions "(checkLayer\>"hs=s+1
+syn match divaDRCFunctions "\<checkLayer("he=e-1
+syn match divaDRCFunctions "(drc\>"hs=s+1
+syn match divaDRCFunctions "\<drc("he=e-1
+syn match divaDRCFunctions "(drcAntenna\>"hs=s+1
+syn match divaDRCFunctions "\<drcAntenna("he=e-1
+syn match divaFunctions "(\(drcExtract\|lvs\)Rules\>"hs=s+1
+syn match divaFunctions "\<\(drcExtract\|lvs\)Rules("he=e-1
+syn match divaLayerFunctions "(saveDerived\>"hs=s+1
+syn match divaLayerFunctions "\<saveDerived("he=e-1
+syn match divaLayerFunctions "(copyGraphics\>"hs=s+1
+syn match divaLayerFunctions "\<copyGraphics("he=e-1
+syn match divaChkFunctions "(dubiousData\>"hs=s+1
+syn match divaChkFunctions "\<dubiousData("he=e-1
+syn match divaChkFunctions "(offGrid\>"hs=s+1
+syn match divaChkFunctions "\<offGrid("he=e-1
+syn match divaLVSFunctions "(compareDeviceProperty\>"hs=s+1
+syn match divaLVSFunctions "\<compareDeviceProperty("he=e-1
+syn match divaLVSFunctions "(ignoreTerminal\>"hs=s+1
+syn match divaLVSFunctions "\<ignoreTerminal("he=e-1
+syn match divaLVSFunctions "(parameterMatchType\>"hs=s+1
+syn match divaLVSFunctions "\<parameterMatchType("he=e-1
+syn match divaLVSFunctions "(\(permute\|prune\|remove\)Device\>"hs=s+1
+syn match divaLVSFunctions "\<\(permute\|prune\|remove\)Device("he=e-1
+syn match divaGeomFunctions "(geom\u\a\+\(45\|90\)\=\>"hs=s+1
+syn match divaGeomFunctions "\<geom\u\a\+\(45\|90\)\=("he=e-1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_diva_syntax_inits")
+ if version < 508
+ let did_diva_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink divaDRCKeywords Statement
+ HiLink divaMeasKeywords Statement
+ HiLink divaCtrlFunctions Conditional
+ HiLink divaExtFunctions Function
+ HiLink divaDRCFunctions Function
+ HiLink divaFunctions Function
+ HiLink divaLayerFunctions Function
+ HiLink divaChkFunctions Function
+ HiLink divaLVSFunctions Function
+ HiLink divaGeomFunctions Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "diva"
+
+" vim:ts=4
diff --git a/runtime/syntax/dns.vim b/runtime/syntax/dns.vim
new file mode 100644
index 000000000..844b96f4c
--- /dev/null
+++ b/runtime/syntax/dns.vim
@@ -0,0 +1,47 @@
+" Vim syntax file
+" Language: DNS/BIND Zone File
+" Maintainer: jehsom@jehsom.com
+" URL: http://scripts.jehsom.com
+" Last Change: 2001 Sep 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Last match is taken!
+syn match dnsKeyword "\<\(IN\|A\|SOA\|NS\|CNAME\|MX\|PTR\|SOA\|MB\|MG\|MR\|NULL\|WKS\|HINFO\|TXT\|CS\|CH\|CPU\|OS\)\>"
+syn match dnsRecordName "^[^ ]*"
+syn match dnsPreProc "^\$[^ ]*"
+syn match dnsComment ";.*$"
+syn match dnsDataFQDN "\<[^ ]*\.[ ]*$"
+syn match dnsConstant "\<\([0-9][0-9.]*\|[0-9.]*[0-9]\)\>"
+syn match dnsIPaddr "\<\(\([0-2]\)\{0,1}\([0-9]\)\{1,2}\.\)\{3}\([0-2]\)\{0,1}\([0-9]\)\{1,2}\>[ ]*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet.
+if version >= 508 || !exists("did_dns_syntax_inits")
+ if version < 508
+ let did_dns_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dnsComment Comment
+ HiLink dnsDataFQDN Identifier
+ HiLink dnsPreProc PreProc
+ HiLink dnsKeyword Keyword
+ HiLink dnsRecordName Type
+ HiLink dnsIPaddr Type
+ HiLink dnsIPerr Error
+ HiLink dnsConstant Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dns"
diff --git a/runtime/syntax/docbk.vim b/runtime/syntax/docbk.vim
new file mode 100644
index 000000000..9391ec1a8
--- /dev/null
+++ b/runtime/syntax/docbk.vim
@@ -0,0 +1,150 @@
+" Vim syntax file
+" Language: DocBook
+" Maintainer: Devin Weaver <vim@tritarget.com>
+" URL: http://tritarget.com/pub/vim/syntax/docbk.vim
+" Last Change: 2002 Sep 04
+" Version: $Revision$
+" Thanks to Johannes Zellner <johannes@zellner.org> for the default to XML
+" suggestion.
+
+" REFERENCES:
+" http://docbook.org/
+" http://www.open-oasis.org/docbook/
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Auto detect added by Bram Moolenaar
+if !exists('b:docbk_type')
+ if expand('%:e') == "sgml"
+ let b:docbk_type = 'sgml'
+ else
+ let b:docbk_type = 'xml'
+ endif
+endif
+if 'xml' == b:docbk_type
+ doau FileType xml
+ syn cluster xmlTagHook add=docbkKeyword
+ syn cluster xmlRegionHook add=docbkRegion,docbkTitle,docbkRemark,docbkCite
+ syn case match
+elseif 'sgml' == b:docbk_type
+ doau FileType sgml
+ syn cluster sgmlTagHook add=docbkKeyword
+ syn cluster sgmlRegionHook add=docbkRegion,docbkTitle,docbkRemark,docbkCite
+ syn case ignore
+endif
+
+" <comment> has been removed and replace with <remark> in DocBook 4.0
+" <comment> kept for backwards compatability.
+syn keyword docbkKeyword abbrev abstract accel ackno acronym action contained
+syn keyword docbkKeyword address affiliation alt anchor answer appendix contained
+syn keyword docbkKeyword application area areaset areaspec arg artheader contained
+syn keyword docbkKeyword article articleinfo artpagenums attribution audiodata contained
+syn keyword docbkKeyword audioobject author authorblurb authorgroup contained
+syn keyword docbkKeyword authorinitials beginpage bibliodiv biblioentry contained
+syn keyword docbkKeyword bibliography bibliomisc bibliomixed bibliomset contained
+syn keyword docbkKeyword biblioset blockquote book bookbiblio bookinfo contained
+syn keyword docbkKeyword bridgehead callout calloutlist caption caution contained
+syn keyword docbkKeyword chapter citation citerefentry citetitle city contained
+syn keyword docbkKeyword classname cmdsynopsis co collab collabname contained
+syn keyword docbkKeyword colophon colspec command comment computeroutput contained
+syn keyword docbkKeyword confdates confgroup confnum confsponsor conftitle contained
+syn keyword docbkKeyword constant contractnum contractsponsor contrib contained
+syn keyword docbkKeyword copyright corpauthor corpname country database contained
+syn keyword docbkKeyword date dedication docinfo edition editor email contained
+syn keyword docbkKeyword emphasis entry entrytbl envar epigraph equation contained
+syn keyword docbkKeyword errorcode errorname errortype example fax figure contained
+syn keyword docbkKeyword filename firstname firstterm footnote footnoteref contained
+syn keyword docbkKeyword foreignphrase formalpara funcdef funcparams contained
+syn keyword docbkKeyword funcprototype funcsynopsis funcsynopsisinfo contained
+syn keyword docbkKeyword function glossary glossdef glossdiv glossentry contained
+syn keyword docbkKeyword glosslist glosssee glossseealso glossterm graphic contained
+syn keyword docbkKeyword graphicco group guibutton guiicon guilabel contained
+syn keyword docbkKeyword guimenu guimenuitem guisubmenu hardware contained
+syn keyword docbkKeyword highlights holder honorific imagedata imageobject contained
+syn keyword docbkKeyword imageobjectco important index indexdiv indexentry contained
+syn keyword docbkKeyword indexterm informalequation informalexample contained
+syn keyword docbkKeyword informalfigure informaltable inlineequation contained
+syn keyword docbkKeyword inlinegraphic inlinemediaobject interface contained
+syn keyword docbkKeyword interfacedefinition invpartnumber isbn issn contained
+syn keyword docbkKeyword issuenum itemizedlist itermset jobtitle keycap contained
+syn keyword docbkKeyword keycode keycombo keysym keyword keywordset label contained
+syn keyword docbkKeyword legalnotice lineage lineannotation link listitem contained
+syn keyword docbkKeyword literal literallayout lot lotentry manvolnum contained
+syn keyword docbkKeyword markup medialabel mediaobject mediaobjectco contained
+syn keyword docbkKeyword member menuchoice modespec mousebutton msg msgaud contained
+syn keyword docbkKeyword msgentry msgexplan msginfo msglevel msgmain contained
+syn keyword docbkKeyword msgorig msgrel msgset msgsub msgtext note contained
+syn keyword docbkKeyword objectinfo olink option optional orderedlist contained
+syn keyword docbkKeyword orgdiv orgname otheraddr othercredit othername contained
+syn keyword docbkKeyword pagenums para paramdef parameter part partintro contained
+syn keyword docbkKeyword phone phrase pob postcode preface primary contained
+syn keyword docbkKeyword primaryie printhistory procedure productname contained
+syn keyword docbkKeyword productnumber programlisting programlistingco contained
+syn keyword docbkKeyword prompt property pubdate publisher publishername contained
+syn keyword docbkKeyword pubsnumber qandadiv qandaentry qandaset question contained
+syn keyword docbkKeyword quote refclass refdescriptor refentry contained
+syn keyword docbkKeyword refentrytitle reference refmeta refmiscinfo contained
+syn keyword docbkKeyword refname refnamediv refpurpose refsect1 contained
+syn keyword docbkKeyword refsect1info refsect2 refsect2info refsect3 contained
+syn keyword docbkKeyword refsect3info refsynopsisdiv refsynopsisdivinfo contained
+syn keyword docbkKeyword releaseinfo remark replaceable returnvalue revhistory contained
+syn keyword docbkKeyword revision revnumber revremark row sbr screen contained
+syn keyword docbkKeyword screenco screeninfo screenshot secondary contained
+syn keyword docbkKeyword secondaryie sect1 sect1info sect2 sect2info sect3 contained
+syn keyword docbkKeyword sect3info sect4 sect4info sect5 sect5info section contained
+syn keyword docbkKeyword sectioninfo see seealso seealsoie seeie seg contained
+syn keyword docbkKeyword seglistitem segmentedlist segtitle seriesinfo contained
+syn keyword docbkKeyword seriesvolnums set setindex setinfo sgmltag contained
+syn keyword docbkKeyword shortaffil shortcut sidebar simpara simplelist contained
+syn keyword docbkKeyword simplesect spanspec state step street structfield contained
+syn keyword docbkKeyword structname subject subjectset subjectterm contained
+syn keyword docbkKeyword subscript substeps subtitle superscript surname contained
+syn keyword docbkKeyword symbol synopfragment synopfragmentref synopsis contained
+syn keyword docbkKeyword systemitem table tbody term tertiary tertiaryie contained
+syn keyword docbkKeyword textobject tfoot tgroup thead tip title contained
+syn keyword docbkKeyword titleabbrev toc tocback tocchap tocentry tocfront contained
+syn keyword docbkKeyword toclevel1 toclevel2 toclevel3 toclevel4 toclevel5 contained
+syn keyword docbkKeyword tocpart token trademark type ulink userinput contained
+syn keyword docbkKeyword varargs variablelist varlistentry varname contained
+syn keyword docbkKeyword videodata videoobject void volumenum warning contained
+syn keyword docbkKeyword wordasword xref year contained
+
+" Add special emphasis on some regions. Thanks to Rory Hunter <roryh@dcs.ed.ac.uk> for these ideas.
+syn region docbkRegion start="<emphasis>"lc=10 end="</emphasis>"me=e-11 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend
+syn region docbkTitle start="<title>"lc=7 end="</title>"me=e-8 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend
+syn region docbkRemark start="<remark>"lc=8 end="</remark>"me=e-9 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend
+syn region docbkRemark start="<comment>"lc=9 end="</comment>"me=e-10 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend
+syn region docbkCite start="<citation>"lc=10 end="</citation>"me=e-11 contains=xmlRegion,xmlEntity,sgmlRegion,sgmlEntity keepend
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_docbk_syn_inits")
+ if version < 508
+ let did_docbk_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ hi DocbkBold term=bold cterm=bold gui=bold
+ else
+ command -nargs=+ HiLink hi def link <args>
+ hi def DocbkBold term=bold cterm=bold gui=bold
+ endif
+
+ HiLink docbkKeyword Statement
+ HiLink docbkRegion DocbkBold
+ HiLink docbkTitle Title
+ HiLink docbkRemark Comment
+ HiLink docbkCite Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "docbk"
+
+" vim: ts=8
diff --git a/runtime/syntax/docbksgml.vim b/runtime/syntax/docbksgml.vim
new file mode 100644
index 000000000..544f3d290
--- /dev/null
+++ b/runtime/syntax/docbksgml.vim
@@ -0,0 +1,7 @@
+" Vim syntax file
+" Language: DocBook SGML
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Sam, 07 Sep 2002 17:20:46 CEST
+
+let b:docbk_type="sgml"
+runtime syntax/docbk.vim
diff --git a/runtime/syntax/docbkxml.vim b/runtime/syntax/docbkxml.vim
new file mode 100644
index 000000000..181af2cc8
--- /dev/null
+++ b/runtime/syntax/docbkxml.vim
@@ -0,0 +1,7 @@
+" Vim syntax file
+" Language: DocBook XML
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Sam, 07 Sep 2002 17:20:12 CEST
+
+let b:docbk_type="xml"
+runtime syntax/docbk.vim
diff --git a/runtime/syntax/dosbatch.vim b/runtime/syntax/dosbatch.vim
new file mode 100644
index 000000000..e27310cc9
--- /dev/null
+++ b/runtime/syntax/dosbatch.vim
@@ -0,0 +1,158 @@
+" Vim syntax file
+" Language: MSDOS batch file (with NT command extensions)
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Filenames: *.bat
+" Last Change: 16th March 2004
+" Web Page: http://www.eandem.co.uk/mrw/vim
+"
+" Options Flags:
+" dosbatch_cmdextversion - 1 = Windows NT, 2 = Windows 2000 [default]
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set default highlighting to Win2k
+if !exists("dosbatch_cmdextversion")
+ let dosbatch_cmdextversion = 2
+endif
+
+" DOS bat files are case insensitive but case preserving!
+syn case ignore
+
+syn keyword dosbatchTodo contained TODO
+
+" Dosbat keywords
+syn keyword dosbatchStatement goto call exit
+syn keyword dosbatchConditional if else
+syn keyword dosbatchRepeat for
+
+" Some operators - first lot are case sensitive!
+syn case match
+syn keyword dosbatchOperator EQU NEQ LSS LEQ GTR GEQ
+syn case ignore
+syn match dosbatchOperator "\s[-+\*/%]\s"
+syn match dosbatchOperator "="
+syn match dosbatchOperator "[-+\*/%]="
+syn match dosbatchOperator "\s\(&\||\|^\|<<\|>>\)=\=\s"
+syn match dosbatchIfOperator "if\s\+\(\(not\)\=\s\+\)\=\(exist\|defined\|errorlevel\|cmdextversion\)\="lc=2
+
+" String - using "'s is a convenience rather than a requirement outside of FOR
+syn match dosbatchString "\"[^"]*\"" contains=dosbatchVariable,dosBatchArgument,@dosbatchNumber
+syn match dosbatchString "\<echo[^)>|]*"lc=4 contains=dosbatchVariable,dosbatchArgument,@dosbatchNumber
+syn match dosbatchEchoOperator "\<echo\s\+\(on\|off\)\s*$"lc=4
+
+" For embedded commands
+syn match dosbatchCmd "(\s*'[^']*'"lc=1 contains=dosbatchString,dosbatchVariable,dosBatchArgument,@dosbatchNumber,dosbatchImplicit,dosbatchStatement,dosbatchConditional,dosbatchRepeat,dosbatchOperator
+
+" Numbers - surround with ws to not include in dir and filenames
+syn match dosbatchInteger "[[:space:]=(/:]\d\+"lc=1
+syn match dosbatchHex "[[:space:]=(/:]0x\x\+"lc=1
+syn match dosbatchBinary "[[:space:]=(/:]0b[01]\+"lc=1
+syn match dosbatchOctal "[[:space:]=(/:]0\o\+"lc=1
+syn cluster dosbatchNumber contains=dosbatchInteger,dosbatchHex,dosbatchBinary,dosbatchOctal
+
+" Command line switches
+syn match dosbatchSwitch "/\(\a\+\|?\)"
+
+" Various special escaped char formats
+syn match dosbatchSpecialChar "\^[&|()<>^]"
+syn match dosbatchSpecialChar "\$[a-hl-npqstv_$+]"
+syn match dosbatchSpecialChar "%%"
+
+" Environment variables
+syn match dosbatchIdentifier contained "\s\h\w*\>"
+syn match dosbatchVariable "%\h\w*%"
+syn match dosbatchVariable "%\h\w*:\*\=[^=]*=[^%]*%"
+syn match dosbatchVariable "%\h\w*:\~\d\+,\d\+%" contains=dosbatchInteger
+syn match dosbatchVariable "!\h\w*!"
+syn match dosbatchVariable "!\h\w*:\*\=[^=]*=[^%]*!"
+syn match dosbatchVariable "!\h\w*:\~\d\+,\d\+!" contains=dosbatchInteger
+syn match dosbatchSet "\s\h\w*[+-]\==\{-1}" contains=dosbatchIdentifier,dosbatchOperator
+
+" Args to bat files and for loops, etc
+syn match dosbatchArgument "%\(\d\|\*\)"
+syn match dosbatchArgument "%%[a-z]\>"
+if dosbatch_cmdextversion == 1
+ syn match dosbatchArgument "%\~[fdpnxs]\+\(\($PATH:\)\=[a-z]\|\d\)\>"
+else
+ syn match dosbatchArgument "%\~[fdpnxsatz]\+\(\($PATH:\)\=[a-z]\|\d\)\>"
+endif
+
+" Line labels
+syn match dosbatchLabel "^\s*:\s*\h\w*\>"
+syn match dosbatchLabel "\<\(goto\|call\)\s\+:\h\w*\>"lc=4
+syn match dosbatchLabel "\<goto\s\+\h\w*\>"lc=4
+syn match dosbatchLabel ":\h\w*\>"
+
+" Comments - usual rem but also two colons as first non-space is an idiom
+syn match dosbatchComment "^rem\($\|\s.*$\)"lc=3 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument
+syn match dosbatchComment "\srem\($\|\s.*$\)"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument
+syn match dosbatchComment "\s*:\s*:.*$" contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument
+
+" Comments in ()'s - still to handle spaces before rem
+syn match dosbatchComment "(rem[^)]*"lc=4 contains=dosbatchTodo,@dosbatchNumber,dosbatchVariable,dosbatchArgument
+
+syn keyword dosbatchImplicit append assoc at attrib break cacls cd chcp chdir
+syn keyword dosbatchImplicit chkdsk chkntfs cls cmd color comp compact convert copy
+syn keyword dosbatchImplicit date del dir diskcomp diskcopy doskey echo endlocal
+syn keyword dosbatchImplicit erase fc find findstr format ftype
+syn keyword dosbatchImplicit graftabl help keyb label md mkdir mode more move
+syn keyword dosbatchImplicit path pause popd print prompt pushd rd recover rem
+syn keyword dosbatchImplicit ren rename replace restore rmdir set setlocal shift
+syn keyword dosbatchImplicit sort start subst time title tree type ver verify
+syn keyword dosbatchImplicit vol xcopy
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dosbatch_syntax_inits")
+ if version < 508
+ let did_dosbatch_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dosbatchTodo Todo
+
+ HiLink dosbatchStatement Statement
+ HiLink dosbatchCommands dosbatchStatement
+ HiLink dosbatchLabel Label
+ HiLink dosbatchConditional Conditional
+ HiLink dosbatchRepeat Repeat
+
+ HiLink dosbatchOperator Operator
+ HiLink dosbatchEchoOperator dosbatchOperator
+ HiLink dosbatchIfOperator dosbatchOperator
+
+ HiLink dosbatchArgument Identifier
+ HiLink dosbatchIdentifier Identifier
+ HiLink dosbatchVariable dosbatchIdentifier
+
+ HiLink dosbatchSpecialChar SpecialChar
+ HiLink dosbatchString String
+ HiLink dosbatchNumber Number
+ HiLink dosbatchInteger dosbatchNumber
+ HiLink dosbatchHex dosbatchNumber
+ HiLink dosbatchBinary dosbatchNumber
+ HiLink dosbatchOctal dosbatchNumber
+
+ HiLink dosbatchComment Comment
+ HiLink dosbatchImplicit Function
+
+ HiLink dosbatchSwitch Special
+
+ HiLink dosbatchCmd PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dosbatch"
+
+" vim: ts=8
diff --git a/runtime/syntax/dosini.vim b/runtime/syntax/dosini.vim
new file mode 100644
index 000000000..73744183a
--- /dev/null
+++ b/runtime/syntax/dosini.vim
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language: Configuration File (ini file) for MSDOS/MS Windows
+" Maintainer: Sean M. McKee <mckee@misslink.net>
+" Last Change: 2001 May 09
+" Version Info: @(#)dosini.vim 1.6 97/12/15 08:54:12
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" shut case off
+syn case ignore
+
+syn match dosiniLabel "^.\{-}="
+syn region dosiniHeader start="\[" end="\]"
+syn match dosiniComment "^;.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dosini_syntax_inits")
+ if version < 508
+ let did_dosini_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dosiniHeader Special
+ HiLink dosiniComment Comment
+ HiLink dosiniLabel Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dosini"
+
+" vim:ts=8
diff --git a/runtime/syntax/dot.vim b/runtime/syntax/dot.vim
new file mode 100644
index 000000000..a2947aad9
--- /dev/null
+++ b/runtime/syntax/dot.vim
@@ -0,0 +1,110 @@
+" Vim syntax file
+" Language: Dot
+" Filenames: *.dot
+" Maintainer: Markus Mottl <markus@oefai.at>
+" URL: http://www.ai.univie.ac.at/~markus/vim/syntax/dot.vim
+" Last Change: 2003 May 11
+" 2001 May 04 - initial version
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Errors
+syn match dotParErr ")"
+syn match dotBrackErr "]"
+syn match dotBraceErr "}"
+
+" Enclosing delimiters
+syn region dotEncl transparent matchgroup=dotParEncl start="(" matchgroup=dotParEncl end=")" contains=ALLBUT,dotParErr
+syn region dotEncl transparent matchgroup=dotBrackEncl start="\[" matchgroup=dotBrackEncl end="\]" contains=ALLBUT,dotBrackErr
+syn region dotEncl transparent matchgroup=dotBraceEncl start="{" matchgroup=dotBraceEncl end="}" contains=ALLBUT,dotBraceErr
+
+" Comments
+syn region dotComment start="//" end="$" contains=dotComment,dotTodo
+syn region dotComment start="/\*" end="\*/" contains=dotComment,dotTodo
+syn keyword dotTodo contained TODO FIXME XXX
+
+" Strings
+syn region dotString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+" General keywords
+syn keyword dotKeyword digraph node edge subgraph
+
+" Graph attributes
+syn keyword dotType center layers margin mclimit name nodesep nslimit
+syn keyword dotType ordering page pagedir rank rankdir ranksep ratio
+syn keyword dotType rotate size
+
+" Node attributes
+syn keyword dotType distortion fillcolor fontcolor fontname fontsize
+syn keyword dotType height layer orientation peripheries regular
+syn keyword dotType shape shapefile sides skew width
+
+" Edge attributes
+syn keyword dotType arrowhead arrowsize arrowtail constraint decorateP
+syn keyword dotType dir headclip headlabel labelangle labeldistance
+syn keyword dotType labelfontcolor labelfontname labelfontsize
+syn keyword dotType minlen port_label_distance samehead sametail
+syn keyword dotType tailclip taillabel weight
+
+" Shared attributes (graphs, nodes, edges)
+syn keyword dotType color
+
+" Shared attributes (graphs and edges)
+syn keyword dotType bgcolor label URL
+
+" Shared attributes (nodes and edges)
+syn keyword dotType fontcolor fontname fontsize layer style
+
+" Special chars
+syn match dotKeyChar "="
+syn match dotKeyChar ";"
+syn match dotKeyChar "->"
+
+" Identifier
+syn match dotIdentifier /\<\w\+\>/
+
+" Synchronization
+syn sync minlines=50
+syn sync maxlines=500
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dot_syntax_inits")
+ if version < 508
+ let did_dot_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dotParErr Error
+ HiLink dotBraceErr Error
+ HiLink dotBrackErr Error
+
+ HiLink dotComment Comment
+ HiLink dotTodo Todo
+
+ HiLink dotParEncl Keyword
+ HiLink dotBrackEncl Keyword
+ HiLink dotBraceEncl Keyword
+
+ HiLink dotKeyword Keyword
+ HiLink dotType Type
+ HiLink dotKeyChar Keyword
+
+ HiLink dotString String
+ HiLink dotIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dot"
+
+" vim: ts=8
diff --git a/runtime/syntax/dracula.vim b/runtime/syntax/dracula.vim
new file mode 100644
index 000000000..6a3806028
--- /dev/null
+++ b/runtime/syntax/dracula.vim
@@ -0,0 +1,85 @@
+" Vim syntax file
+" Language: Dracula
+" Maintainer: Scott Bordelon <slb@artisan.com>
+" Last change: Wed Apr 25 18:50:01 PDT 2001
+" Extensions: drac.*,*.drac,*.drc,*.lvs,*.lpe
+" Comment: Dracula is an industry-standard language created by CADENCE (a
+" company specializing in Electronics Design Automation), for
+" the purposes of Design Rule Checking, Layout vs. Schematic
+" verification, and Layout Parameter Extraction.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Ignore case
+syn case ignore
+
+" A bunch of useful Dracula keywords
+
+"syn match draculaIdentifier
+
+syn keyword draculaStatement indisk primary outdisk printfile system
+syn keyword draculaStatement mode scale resolution listerror keepdata
+syn keyword draculaStatement datatype by lt gt output label range touch
+syn keyword draculaStatement inside outside within overlap outlib
+syn keyword draculaStatement schematic model unit parset
+syn match draculaStatement "flag-\(non45\|acuteangle\|offgrid\)"
+syn match draculaStatement "text-pri-only"
+syn match draculaStatement "[=&]"
+syn match draculaStatement "\[[^,]*\]"
+syn match draculastatement "^ *\(sel\|width\|ext\|enc\|area\|shrink\|grow\|length\)"
+syn match draculastatement "^ *\(or\|not\|and\|select\|size\|connect\|sconnect\|int\)"
+syn match draculastatement "^ *\(softchk\|stamp\|element\|parasitic cap\|attribute cap\)"
+syn match draculastatement "^ *\(flagnon45\|lextract\|equation\|lpeselect\|lpechk\|attach\)"
+syn match draculaStatement "\(temporary\|connect\)-layer"
+syn match draculaStatement "program-dir"
+syn match draculaStatement "status-command"
+syn match draculaStatement "batch-queue"
+syn match draculaStatement "cnames-csen"
+syn match draculaStatement "filter-lay-opt"
+syn match draculaStatement "filter-sch-opt"
+syn match draculaStatement "power-node"
+syn match draculaStatement "ground-node"
+syn match draculaStatement "subckt-name"
+
+syn match draculaType "\*description"
+syn match draculaType "\*input-layer"
+syn match draculaType "\*operation"
+syn match draculaType "\*end"
+
+syn match draculaComment ";.*"
+
+syn match draculaPreProc "^#.*"
+
+"Modify the following as needed. The trade-off is performance versus
+"functionality.
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dracula_syn_inits")
+ if version < 508
+ let did_dracula_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink draculaIdentifier Identifier
+ HiLink draculaStatement Statement
+ HiLink draculaType Type
+ HiLink draculaComment Comment
+ HiLink draculaPreProc PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dracula"
+
+" vim: ts=8
diff --git a/runtime/syntax/dsl.vim b/runtime/syntax/dsl.vim
new file mode 100644
index 000000000..9b3cb56f5
--- /dev/null
+++ b/runtime/syntax/dsl.vim
@@ -0,0 +1,38 @@
+" Vim syntax file
+" Language: DSSSL
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" Filenames: *.dsl
+" $Id$
+
+if exists("b:current_syntax") | finish | endif
+
+runtime syntax/xml.vim
+syn cluster xmlRegionHook add=dslRegion,dslComment
+syn cluster xmlCommentHook add=dslCond
+
+" EXAMPLE:
+" <![ %output.html; [
+" <!-- some comment -->
+" (define html-manifest #f)
+" ]]>
+"
+" NOTE: 'contains' the same as xmlRegion, except xmlTag / xmlEndTag
+syn region dslCond matchgroup=dslCondDelim start="\[\_[^[]\+\[" end="]]" contains=xmlCdata,@xmlRegionCluster,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook
+
+" NOTE, that dslRegion and dslComment do both NOT have a 'contained'
+" argument, so this will also work in plain dsssl documents.
+
+syn region dslRegion matchgroup=Delimiter start=+(+ end=+)+ contains=dslRegion,dslString,dslComment
+syn match dslString +"\_[^"]*"+ contained
+syn match dslComment +;.*$+ contains=dslTodo
+syn keyword dslTodo contained TODO FIXME XXX display
+
+" The default highlighting.
+hi def link dslTodo Todo
+hi def link dslString String
+hi def link dslComment Comment
+" compare the following with xmlCdataStart / xmlCdataEnd
+hi def link dslCondDelim Type
+
+let b:current_syntax = "dsl"
diff --git a/runtime/syntax/dtd.vim b/runtime/syntax/dtd.vim
new file mode 100644
index 000000000..0f80e199c
--- /dev/null
+++ b/runtime/syntax/dtd.vim
@@ -0,0 +1,181 @@
+" Vim syntax file
+" Language: DTD (Document Type Definition for XML)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Author and previous maintainer:
+" Daniel Amyot <damyot@site.uottawa.ca>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" Filenames: *.dtd
+"
+" REFERENCES:
+" http://www.w3.org/TR/html40/
+" http://www.w3.org/TR/NOTE-html-970421
+"
+" TODO:
+" - improve synchronizing.
+
+if version < 600
+ syntax clear
+ let __dtd_cpo_save__ = &cpo
+ set cpo&
+else
+ if exists("b:current_syntax")
+ finish
+ endif
+ let s:dtd_cpo_save = &cpo
+ set cpo&vim
+endif
+
+if !exists("dtd_ignore_case")
+ " I prefer having the case takes into consideration.
+ syn case match
+else
+ syn case ignore
+endif
+
+
+" the following line makes the opening <! and
+" closing > highlighted using 'dtdFunction'.
+"
+" PROVIDES: @dtdTagHook
+"
+syn region dtdTag matchgroup=dtdFunction
+ \ start=+<!+ end=+>+ matchgroup=NONE
+ \ contains=dtdTag,dtdTagName,dtdError,dtdComment,dtdString,dtdAttrType,dtdAttrDef,dtdEnum,dtdParamEntityInst,dtdParamEntityDecl,dtdCard,@dtdTagHook
+
+if !exists("dtd_no_tag_errors")
+ " mark everything as an error which starts with a <!
+ " and is not overridden later. If this is annoying,
+ " it can be switched off by setting the variable
+ " dtd_no_tag_errors.
+ syn region dtdError contained start=+<!+lc=2 end=+>+
+endif
+
+" if this is a html like comment hightlight also
+" the opening <! and the closing > as Comment.
+syn region dtdComment start=+<![ \t]*--+ end=+-->+ contains=dtdTodo
+
+
+" proper DTD comment
+syn region dtdComment contained start=+--+ end=+--+ contains=dtdTodo
+
+
+" Start tags (keywords). This is contained in dtdFunction.
+" Note that everything not contained here will be marked
+" as error.
+syn match dtdTagName contained +<!\(ATTLIST\|DOCTYPE\|ELEMENT\|ENTITY\|NOTATION\|SHORTREF\|USEMAP\|\[\)+lc=2,hs=s+2
+
+
+" wildcards and operators
+syn match dtdCard contained "|"
+syn match dtdCard contained ","
+" evenutally overridden by dtdEntity
+syn match dtdCard contained "&"
+syn match dtdCard contained "?"
+syn match dtdCard contained "\*"
+syn match dtdCard contained "+"
+
+" ...and finally, special cases.
+syn match dtdCard "ANY"
+syn match dtdCard "EMPTY"
+
+if !exists("dtd_no_param_entities")
+
+ " highlight parameter entity declarations
+ " and instances. Note that the closing `;'
+ " is optional.
+
+ " instances
+ syn region dtdParamEntityInst oneline matchgroup=dtdParamEntityPunct
+ \ start="%[-_a-zA-Z0-9.]\+"he=s+1,rs=s+1
+ \ skip=+[-_a-zA-Z0-9.]+
+ \ end=";\|\>"
+ \ matchgroup=NONE contains=dtdParamEntityPunct
+ syn match dtdParamEntityPunct contained "\."
+
+ " declarations
+ " syn region dtdParamEntityDecl oneline matchgroup=dtdParamEntityDPunct start=+<!ENTITY % +lc=8 skip=+[-_a-zA-Z0-9.]+ matchgroup=NONE end="\>" contains=dtdParamEntityDPunct
+ syn match dtdParamEntityDecl +<!ENTITY % [-_a-zA-Z0-9.]*+lc=8 contains=dtdParamEntityDPunct
+ syn match dtdParamEntityDPunct contained "%\|\."
+
+endif
+
+" &entities; compare with xml
+syn match dtdEntity "&[^; \t]*;" contains=dtdEntityPunct
+syn match dtdEntityPunct contained "[&.;]"
+
+" Strings are between quotes
+syn region dtdString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard
+syn region dtdString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=dtdAttrDef,dtdAttrType,dtdEnum,dtdParamEntityInst,dtdEntity,dtdCard
+
+" Enumeration of elements or data between parenthesis
+"
+" PROVIDES: @dtdEnumHook
+"
+syn region dtdEnum matchgroup=dtdType start="(" end=")" matchgroup=NONE contains=dtdEnum,dtdParamEntityInst,dtdCard,@dtdEnumHook
+
+"Attribute types
+syn keyword dtdAttrType NMTOKEN ENTITIES NMTOKENS ID CDATA
+syn keyword dtdAttrType IDREF IDREFS
+" ENTITY has to treated special for not overriding <!ENTITY
+syn match dtdAttrType +[^!]\<ENTITY+
+
+"Attribute Definitions
+syn match dtdAttrDef "#REQUIRED"
+syn match dtdAttrDef "#IMPLIED"
+syn match dtdAttrDef "#FIXED"
+
+syn case match
+" define some common keywords to mark TODO
+" and important sections inside comments.
+syn keyword dtdTodo contained TODO FIXME XXX
+
+syn sync lines=250
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dtd_syn_inits")
+ if version < 508
+ let did_dtd_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink dtdFunction Function
+ HiLink dtdTag Normal
+ HiLink dtdType Type
+ HiLink dtdAttrType dtdType
+ HiLink dtdAttrDef dtdType
+ HiLink dtdConstant Constant
+ HiLink dtdString dtdConstant
+ HiLink dtdEnum dtdConstant
+ HiLink dtdCard dtdFunction
+
+ HiLink dtdEntity Statement
+ HiLink dtdEntityPunct dtdType
+ HiLink dtdParamEntityInst dtdConstant
+ HiLink dtdParamEntityPunct dtdType
+ HiLink dtdParamEntityDecl dtdType
+ HiLink dtdParamEntityDPunct dtdComment
+
+ HiLink dtdComment Comment
+ HiLink dtdTagName Statement
+ HiLink dtdError Error
+ HiLink dtdTodo Todo
+
+ delcommand HiLink
+endif
+
+if version < 600
+ let &cpo = __dtd_cpo_save__
+ unlet __dtd_cpo_save__
+else
+ let &cpo = s:dtd_cpo_save
+ unlet s:dtd_cpo_save
+endif
+
+let b:current_syntax = "dtd"
+
+" vim: ts=8
diff --git a/runtime/syntax/dtml.vim b/runtime/syntax/dtml.vim
new file mode 100644
index 000000000..7de722aab
--- /dev/null
+++ b/runtime/syntax/dtml.vim
@@ -0,0 +1,225 @@
+" DTML syntax file
+" Language: Zope's Dynamic Template Markup Language
+" Maintainer: Jean Jordaan <jean@upfrontsystems.co.za> (njj)
+" Last change: 2001 Sep 02
+
+" These are used with Claudio Fleiner's html.vim in the standard distribution.
+"
+" Still very hackish. The 'dtml attributes' and 'dtml methods' have been
+" hacked out of the Zope Quick Reference in case someone finds something
+" sensible to do with them. I certainly haven't.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" First load the HTML syntax
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+
+syn case match
+
+" This doesn't have any effect. Does it need to be moved to above/
+" if !exists("main_syntax")
+" let main_syntax = 'dtml'
+" endif
+
+" dtml attributes
+syn keyword dtmlAttribute ac_inherited_permissions access_debug_info contained
+syn keyword dtmlAttribute acquiredRolesAreUsedBy all_meta_types assume_children AUTH_TYPE contained
+syn keyword dtmlAttribute AUTHENTICATED_USER AUTHENTICATION_PATH BASE0 batch-end-index batch-size contained
+syn keyword dtmlAttribute batch-start-index bobobase_modification_time boundary branches contained
+syn keyword dtmlAttribute branches_expr capitalize cb_dataItems cb_dataValid cb_isCopyable contained
+syn keyword dtmlAttribute cb_isMoveable changeClassId classDefinedAndInheritedPermissions contained
+syn keyword dtmlAttribute classDefinedPermissions classInheritedPermissions collapse-all column contained
+syn keyword dtmlAttribute connected connectionIsValid CONTENT_LENGTH CONTENT_TYPE cook cookies contained
+syn keyword dtmlAttribute COPY count- createInObjectManager da_has_single_argument dav__allprop contained
+syn keyword dtmlAttribute dav__init dav__propnames dav__propstat dav__validate default contained
+syn keyword dtmlAttribute delClassAttr DELETE Destination DestinationURL digits discard contained
+syn keyword dtmlAttribute disposition document_src e encode enter etc expand-all expr File contained
+syn keyword dtmlAttribute filtered_manage_options filtered_meta_types first- fmt footer form contained
+syn keyword dtmlAttribute GATEWAY_INTERFACE get_local_roles get_local_roles_for_userid contained
+syn keyword dtmlAttribute get_request_var_or_attr get_size get_size get_valid_userids getAttribute contained
+syn keyword dtmlAttribute getAttributeNode getAttributes getChildNodes getClassAttr getContentType contained
+syn keyword dtmlAttribute getData getDocType getDocumentElement getElementsByTagName getFirstChild contained
+syn keyword dtmlAttribute getImplementation getLastChild getLength getName getNextSibling contained
+syn keyword dtmlAttribute getNodeName getNodeType getNodeValue getOwnerDocument getParentNode contained
+syn keyword dtmlAttribute getPreviousSibling getProperty getPropertyType getSize getSize getSize contained
+syn keyword dtmlAttribute get_size getTagName getUser getUserName getUserNames getUsers contained
+syn keyword dtmlAttribute has_local_roles hasChildNodes hasProperty HEAD header hexdigits HTML contained
+syn keyword dtmlAttribute html_quote HTMLFile id index_html index_objects indexes contained
+syn keyword dtmlAttribute inheritedAttribute items last- leave leave_another leaves letters LOCK contained
+syn keyword dtmlAttribute locked_in_version lower lowercase mailfrom mailhost mailhost_list mailto contained
+syn keyword dtmlAttribute manage manage_ methods manage_access manage_acquiredPermissions contained
+syn keyword dtmlAttribute manage_addConferaTopic manage_addDocument manage_addDTMLDocument contained
+syn keyword dtmlAttribute manage_addDTMLMethod manage_addFile manage_addFolder manage_addImage contained
+syn keyword dtmlAttribute manage_addLocalRoles manage_addMailHost manage_addPermission contained
+syn keyword dtmlAttribute manage_addPrincipiaFactory manage_addProduct manage_addProperty contained
+syn keyword dtmlAttribute manage_addUserFolder manage_addZClass manage_addZGadflyConnection contained
+syn keyword dtmlAttribute manage_addZGadflyConnectionForm manage_advanced manage_afterAdd contained
+syn keyword dtmlAttribute manage_afterClone manage_beforeDelete manage_changePermissions contained
+syn keyword dtmlAttribute manage_changeProperties manage_clone manage_CopyContainerFirstItem contained
+syn keyword dtmlAttribute manage_copyObjects manage_cutObjects manage_defined_roles contained
+syn keyword dtmlAttribute manage_delLocalRoles manage_delObjects manage_delProperties contained
+syn keyword dtmlAttribute manage_distribute manage_edit manage_editedDialog manage_editProperties contained
+syn keyword dtmlAttribute manage_editRoles manage_exportObject manage_FTPget manage_FTPlist contained
+syn keyword dtmlAttribute manage_FTPstat manage_get_product_readme__ manage_getPermissionMapping contained
+syn keyword dtmlAttribute manage_haveProxy manage_help manage_importObject manage_listLocalRoles contained
+syn keyword dtmlAttribute manage_options manage_pasteObjects manage_permission contained
+syn keyword dtmlAttribute manage_propertiesForm manage_proxy manage_renameObject manage_role contained
+syn keyword dtmlAttribute manage_setLocalRoles manage_setPermissionMapping contained
+syn keyword dtmlAttribute manage_subclassableClassNames manage_test manage_testForm contained
+syn keyword dtmlAttribute manage_undo_transactions manage_upload manage_users manage_workspace contained
+syn keyword dtmlAttribute management_interface mapping math max- mean- median- meta_type min- contained
+syn keyword dtmlAttribute MKCOL modified_in_version MOVE multiple name navigate_filter new_version contained
+syn keyword dtmlAttribute newline_to_br next next-batches next-sequence next-sequence-end-index contained
+syn keyword dtmlAttribute next-sequence-size next-sequence-start-index no manage_access None contained
+syn keyword dtmlAttribute nonempty normalize nowrap null Object Manager objectIds objectItems contained
+syn keyword dtmlAttribute objectMap objectValues octdigits only optional OPTIONS orphan overlap contained
+syn keyword dtmlAttribute PARENTS PATH_INFO PATH_TRANSLATED permission_settings contained
+syn keyword dtmlAttribute permissionMappingPossibleValues permissionsOfRole pi port contained
+syn keyword dtmlAttribute possible_permissions previous previous-batches previous-sequence contained
+syn keyword dtmlAttribute previous-sequence-end-index previous-sequence-size contained
+syn keyword dtmlAttribute previous-sequence-start-index PrincipiaFind PrincipiaSearchSource contained
+syn keyword dtmlAttribute propdict propertyIds propertyItems propertyLabel propertyMap propertyMap contained
+syn keyword dtmlAttribute propertyValues PROPFIND PROPPATCH PUT query_day query_month QUERY_STRING contained
+syn keyword dtmlAttribute query_year quoted_input quoted_report raise_standardErrorMessage random contained
+syn keyword dtmlAttribute read read_raw REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER REQUEST contained
+syn keyword dtmlAttribute REQUESTED_METHOD required RESPONSE reverse rolesOfPermission save schema contained
+syn keyword dtmlAttribute SCRIPT_NAME sequence-end sequence-even sequence-index contained
+syn keyword dtmlAttribute sequence-index-var- sequence-item sequence-key sequence-Letter contained
+syn keyword dtmlAttribute sequence-letter sequence-number sequence-odd sequence-query contained
+syn keyword dtmlAttribute sequence-roman sequence-Roman sequence-start sequence-step-end-index contained
+syn keyword dtmlAttribute sequence-step-size sequence-step-start-index sequence-var- SERVER_NAME contained
+syn keyword dtmlAttribute SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE setClassAttr setName single contained
+syn keyword dtmlAttribute size skip_unauthorized smtphost sort spacify sql_quote SQLConnectionIDs contained
+syn keyword dtmlAttribute standard-deviation- standard-deviation-n- standard_html_footer contained
+syn keyword dtmlAttribute standard_html_header start String string subject SubTemplate superValues contained
+syn keyword dtmlAttribute tabs_path_info tag test_url_ text_content this thousands_commas title contained
+syn keyword dtmlAttribute title_and_id title_or_id total- tpURL tpValues TRACE translate tree-c contained
+syn keyword dtmlAttribute tree-colspan tree-e tree-item-expanded tree-item-url tree-level contained
+syn keyword dtmlAttribute tree-root-url tree-s tree-state type undoable_transactions UNLOCK contained
+syn keyword dtmlAttribute update_data upper uppercase url url_quote URLn user_names contained
+syn keyword dtmlAttribute userdefined_roles valid_property_id valid_roles validate_roles contained
+syn keyword dtmlAttribute validClipData validRoles values variance- variance-n- view_image_or_file contained
+syn keyword dtmlAttribute where whitespace whrandom xml_namespace zclass_candidate_view_actions contained
+syn keyword dtmlAttribute ZClassBaseClassNames ziconImage ZopeFind ZQueryIds contained
+
+syn keyword dtmlMethod abs absolute_url ac_inherited_permissions aCommon contained
+syn keyword dtmlMethod aCommonZ acos acquiredRolesAreUsedBy aDay addPropertySheet aMonth AMPM contained
+syn keyword dtmlMethod ampm AMPMMinutes appendChild appendData appendHeader asin atan atan2 contained
+syn keyword dtmlMethod atof atoi betavariate capatilize capwords catalog_object ceil center contained
+syn keyword dtmlMethod choice chr cloneNode COPY cos cosh count createInObjectManager contained
+syn keyword dtmlMethod createSQLInput cunifvariate Date DateTime Day day dayOfYear dd default contained
+syn keyword dtmlMethod DELETE deleteData delPropertySheet divmod document_id document_title dow contained
+syn keyword dtmlMethod earliestTime enter equalTo exp expireCookie expovariate fabs fCommon contained
+syn keyword dtmlMethod fCommonZ filtered_manage_options filtered_meta_types find float floor contained
+syn keyword dtmlMethod fmod frexp gamma gauss get get_local_roles_for_userid get_size getattr contained
+syn keyword dtmlMethod getAttribute getAttributeNode getClassAttr getDomains contained
+syn keyword dtmlMethod getElementsByTagName getHeader getitem getNamedItem getobject contained
+syn keyword dtmlMethod getObjectsInfo getpath getProperty getRoles getStatus getUser contained
+syn keyword dtmlMethod getUserName greaterThan greaterThanEqualTo h_12 h_24 has_key contained
+syn keyword dtmlMethod has_permission has_role hasattr hasFeature hash hasProperty HEAD hex contained
+syn keyword dtmlMethod hour hypot index index_html inheritedAttribute insertBefore insertData contained
+syn keyword dtmlMethod int isCurrentDay isCurrentHour isCurrentMinute isCurrentMonth contained
+syn keyword dtmlMethod isCurrentYear isFuture isLeadYear isPast item join latestTime ldexp contained
+syn keyword dtmlMethod leave leave_another len lessThan lessThanEqualTo ljust log log10 contained
+syn keyword dtmlMethod lognormvariate lower lstrip maketrans manage manage_access contained
+syn keyword dtmlMethod manage_acquiredPermissions manage_addColumn manage_addDocument contained
+syn keyword dtmlMethod manage_addDTMLDocument manage_addDTMLMethod manage_addFile contained
+syn keyword dtmlMethod manage_addFolder manage_addImage manage_addIndex manage_addLocalRoles contained
+syn keyword dtmlMethod manage_addMailHost manage_addPermission manage_addPrincipiaFactory contained
+syn keyword dtmlMethod manage_addProduct manage_addProperty manage_addPropertySheet contained
+syn keyword dtmlMethod manage_addUserFolder manage_addZCatalog manage_addZClass contained
+syn keyword dtmlMethod manage_addZGadflyConnection manage_addZGadflyConnectionForm contained
+syn keyword dtmlMethod manage_advanced manage_catalogClear manage_catalogFoundItems contained
+syn keyword dtmlMethod manage_catalogObject manage_catalogReindex manage_changePermissions contained
+syn keyword dtmlMethod manage_changeProperties manage_clone manage_CopyContainerFirstItem contained
+syn keyword dtmlMethod manage_copyObjects manage_createEditor manage_createView contained
+syn keyword dtmlMethod manage_cutObjects manage_defined_roles manage_delColumns contained
+syn keyword dtmlMethod manage_delIndexes manage_delLocalRoles manage_delObjects contained
+syn keyword dtmlMethod manage_delProperties manage_Discard__draft__ manage_distribute contained
+syn keyword dtmlMethod manage_edit manage_edit manage_editedDialog manage_editProperties contained
+syn keyword dtmlMethod manage_editRoles manage_exportObject manage_importObject contained
+syn keyword dtmlMethod manage_makeChanges manage_pasteObjects manage_permission contained
+syn keyword dtmlMethod manage_propertiesForm manage_proxy manage_renameObject manage_role contained
+syn keyword dtmlMethod manage_Save__draft__ manage_setLocalRoles manage_setPermissionMapping contained
+syn keyword dtmlMethod manage_test manage_testForm manage_uncatalogObject contained
+syn keyword dtmlMethod manage_undo_transactions manage_upload manage_users manage_workspace contained
+syn keyword dtmlMethod mange_createWizard max min minute MKCOL mm modf month Month MOVE contained
+syn keyword dtmlMethod namespace new_version nextObject normalvariate notEqualTo objectIds contained
+syn keyword dtmlMethod objectItems objectValues oct OPTIONS ord paretovariate parts pCommon contained
+syn keyword dtmlMethod pCommonZ pDay permissionsOfRole pMonth pow PreciseAMPM PreciseTime contained
+syn keyword dtmlMethod previousObject propertyInfo propertyLabel PROPFIND PROPPATCH PUT quit contained
+syn keyword dtmlMethod raise_standardErrorMessage randint random read read_raw redirect contained
+syn keyword dtmlMethod removeAttribute removeAttributeNode removeChild replace replaceChild contained
+syn keyword dtmlMethod replaceData rfc822 rfind rindex rjust rolesOfPermission round rstrip contained
+syn keyword dtmlMethod save searchResults second seed set setAttribute setAttributeNode setBase contained
+syn keyword dtmlMethod setCookie setHeader setStatus sin sinh split splitText sqrt str strip contained
+syn keyword dtmlMethod substringData superValues swapcase tabs_path_info tan tanh Time contained
+syn keyword dtmlMethod TimeMinutes timeTime timezone title title_and_id title_or_id toXML contained
+syn keyword dtmlMethod toZone uncatalog_object undoable_transactions uniform uniqueValuesFor contained
+syn keyword dtmlMethod update_data upper valid_property_id validate_roles vonmisesvariate contained
+syn keyword dtmlMethod weibullvariate year yy zfill ZopeFind contained
+
+" DTML tags
+syn keyword dtmlTagName var if elif else unless in with let call raise try except tag comment tree sqlvar sqltest sqlgroup sendmail mime transparent contained
+
+syn keyword dtmlEndTagName if unless in with let raise try tree sendmail transparent contained
+
+" Own additions
+syn keyword dtmlTODO TODO FIXME contained
+
+syn region dtmlComment start=+<dtml-comment>+ end=+</dtml-comment>+ contains=dtmlTODO
+
+" All dtmlTagNames are contained by dtmlIsTag.
+syn match dtmlIsTag "dtml-[A-Za-z]\+" contains=dtmlTagName
+
+" 'var' tag entity syntax: &dtml-variableName;
+" - with attributes: &dtml.attribute1[.attribute2]...-variableName;
+syn match dtmlSpecialChar "&dtml[.0-9A-Za-z_]\{-}-[0-9A-Za-z_.]\+;"
+
+" Redefine to allow inclusion of DTML within HTML strings.
+syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,dtmlSpecialChar,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+syn region htmlLink start="<a\>[^>]*href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,dtmlSpecialChar,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,dtmlSpecialChar,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,dtmlSpecialChar,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+syn region htmlString contained start=+"+ end=+"+ contains=dtmlSpecialChar,htmlSpecialChar,javaScriptExpression,dtmlIsTag,dtmlAttribute,dtmlMethod,@htmlPreproc
+syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,dtmlIsTag,dtmlAttribute,dtmlMethod,@htmlTagNameCluster
+syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,dtmlIsTag,dtmlAttribute,dtmlMethod,@htmlTagNameCluster
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dtml_syntax_inits")
+ if version < 508
+ let did_dtml_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dtmlIsTag PreProc
+ HiLink dtmlAttribute Identifier
+ HiLink dtmlMethod Function
+ HiLink dtmlComment Comment
+ HiLink dtmlTODO Todo
+ HiLink dtmlSpecialChar Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dtml"
+
+" if main_syntax == 'dtml'
+" unlet main_syntax
+" endif
+
+" vim: ts=4
diff --git a/runtime/syntax/dylan.vim b/runtime/syntax/dylan.vim
new file mode 100644
index 000000000..14262d53d
--- /dev/null
+++ b/runtime/syntax/dylan.vim
@@ -0,0 +1,109 @@
+" Vim syntax file
+" Language: Dylan
+" Authors: Justus Pendleton <justus@acm.org>
+" Brent A. Fulgham <bfulgham@debian.org>
+" Last Change: Fri Sep 29 13:45:55 PDT 2000
+"
+" This syntax file is based on the Haskell, Perl, Scheme, and C
+" syntax files.
+
+" Part 1: Syntax definition
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+if version < 600
+ set lisp
+else
+ setlocal lisp
+endif
+
+" Highlight special characters (those that have backslashes) differently
+syn match dylanSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+
+" Keywords
+syn keyword dylanBlock afterwards begin block cleanup end
+syn keyword dylanClassMods abstract concrete primary inherited virtual
+syn keyword dylanException exception handler signal
+syn keyword dylanParamDefs method class function library macro interface
+syn keyword dylanSimpleDefs constant variable generic primary
+syn keyword dylanOther above below from by in instance local slot subclass then to
+syn keyword dylanConditional if when select case else elseif unless finally otherwise then
+syn keyword dylanRepeat begin for until while from to
+syn keyword dylanStatement define let
+syn keyword dylanImport use import export exclude rename create
+syn keyword dylanMiscMods open sealed domain singleton sideways inline functional
+
+" Matching rules for special forms
+syn match dylanOperator "\s[-!%&\*\+/=\?@\\^|~:]\+[-#!>%&:\*\+/=\?@\\^|~]*"
+syn match dylanOperator "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./=\?@\\^|~:]*"
+" Numbers
+syn match dylanNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
+syn match dylanNumber "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
+" Booleans
+syn match dylanBoolean "#t\|#f"
+" Comments
+syn match dylanComment "//.*"
+syn region dylanComment start="/\*" end="\*/"
+" Strings
+syn region dylanString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=dySpecial
+syn match dylanCharacter "'[^\\]'"
+" Constants, classes, and variables
+syn match dylanConstant "$\<[a-zA-Z0-9\-]\+\>"
+syn match dylanClass "<\<[a-zA-Z0-9\-]\+\>>"
+syn match dylanVariable "\*\<[a-zA-Z0-9\-]\+\>\*"
+" Preconditions
+syn region dylanPrecondit start="^\s*#\s*\(if\>\|else\>\|endif\>\)" skip="\\$" end="$"
+
+" These appear at the top of files (usually). I like to highlight the whole line
+" so that the definition stands out. They should probably really be keywords, but they
+" don't generally appear in the middle of a line of code.
+syn region dylanHeader start="^[Mm]odule:" end="^$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dylan_syntax_inits")
+ if version < 508
+ let did_dylan_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dylanBlock PreProc
+ HiLink dylanBoolean Boolean
+ HiLink dylanCharacter Character
+ HiLink dylanClass Structure
+ HiLink dylanClassMods StorageClass
+ HiLink dylanComment Comment
+ HiLink dylanConditional Conditional
+ HiLink dylanConstant Constant
+ HiLink dylanException Exception
+ HiLink dylanHeader Macro
+ HiLink dylanImport Include
+ HiLink dylanLabel Label
+ HiLink dylanMiscMods StorageClass
+ HiLink dylanNumber Number
+ HiLink dylanOther Keyword
+ HiLink dylanOperator Operator
+ HiLink dylanParamDefs Keyword
+ HiLink dylanPrecondit PreCondit
+ HiLink dylanRepeat Repeat
+ HiLink dylanSimpleDefs Keyword
+ HiLink dylanStatement Macro
+ HiLink dylanString String
+ HiLink dylanVariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dylan"
+
+" vim:ts=8
diff --git a/runtime/syntax/dylanintr.vim b/runtime/syntax/dylanintr.vim
new file mode 100644
index 000000000..11ef81668
--- /dev/null
+++ b/runtime/syntax/dylanintr.vim
@@ -0,0 +1,52 @@
+" Vim syntax file
+" Language: Dylan
+" Authors: Justus Pendleton <justus@acm.org>
+" Last Change: Fri Sep 29 13:53:27 PDT 2000
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn region dylanintrInfo matchgroup=Statement start="^" end=":" oneline
+syn match dylanintrInterface "define interface"
+syn match dylanintrClass "<.*>"
+syn region dylanintrType start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+syn region dylanintrIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match dylanintrIncluded contained "<[^>]*>"
+syn match dylanintrInclude "^\s*#\s*include\>\s*["<]" contains=intrIncluded
+
+"syn keyword intrMods pointer struct
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dylan_intr_syntax_inits")
+ if version < 508
+ let did_dylan_intr_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dylanintrInfo Special
+ HiLink dylanintrInterface Operator
+ HiLink dylanintrMods Type
+ HiLink dylanintrClass StorageClass
+ HiLink dylanintrType Type
+ HiLink dylanintrIncluded String
+ HiLink dylanintrInclude Include
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dylanintr"
+
+" vim:ts=8
diff --git a/runtime/syntax/dylanlid.vim b/runtime/syntax/dylanlid.vim
new file mode 100644
index 000000000..ec7b40114
--- /dev/null
+++ b/runtime/syntax/dylanlid.vim
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language: Dylan Library Interface Files
+" Authors: Justus Pendleton <justus@acm.org>
+" Brent Fulgham <bfulgham@debian.org>
+" Last Change: Fri Sep 29 13:50:20 PDT 2000
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn region dylanlidInfo matchgroup=Statement start="^" end=":" oneline
+syn region dylanlidEntry matchgroup=Statement start=":%" end="$" oneline
+
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dylan_lid_syntax_inits")
+ if version < 508
+ let did_dylan_lid_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink dylanlidInfo Type
+ HiLink dylanlidEntry String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "dylanlid"
+
+" vim:ts=8
diff --git a/runtime/syntax/ecd.vim b/runtime/syntax/ecd.vim
new file mode 100644
index 000000000..fff7a4b88
--- /dev/null
+++ b/runtime/syntax/ecd.vim
@@ -0,0 +1,56 @@
+" Vim syntax file
+" Language: ecd (Embedix Component Description) files
+" Maintainer: John Beppu <beppu@opensource.lineo.com>
+" URL: http://opensource.lineo.com/~beppu/prose/ecd_vim.html
+" Last Change: 2001 Sep 27
+
+" An ECD file contains meta-data for packages in the Embedix Linux distro.
+" This syntax file was derived from apachestyle.vim
+" by Christian Hammers <ch@westend.com>
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" specials
+syn match ecdComment "^\s*#.*"
+
+" options and values
+syn match ecdAttr "^\s*[a-zA-Z]\S*\s*[=].*$" contains=ecdAttrN,ecdAttrV
+syn match ecdAttrN contained "^.*="me=e-1
+syn match ecdAttrV contained "=.*$"ms=s+1
+
+" tags
+syn region ecdTag start=+<+ end=+>+ contains=ecdTagN,ecdTagError
+syn match ecdTagN contained +<[/\s]*[-a-zA-Z0-9_]\++ms=s+1
+syn match ecdTagError contained "[^>]<"ms=s+1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ecd_syn_inits")
+ if version < 508
+ let did_ecd_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ecdComment Comment
+ HiLink ecdAttr Type
+ HiLink ecdAttrN Statement
+ HiLink ecdAttrV Value
+ HiLink ecdTag Function
+ HiLink ecdTagN Statement
+ HiLink ecdTagError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ecd"
+" vim: ts=8
diff --git a/runtime/syntax/edif.vim b/runtime/syntax/edif.vim
new file mode 100644
index 000000000..0c1783494
--- /dev/null
+++ b/runtime/syntax/edif.vim
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language: EDIF (Electronic Design Interchange Format)
+" Maintainer: Artem Zankovich <z_artem@hotbox.ru>
+" Last Change: Oct 14, 2002
+"
+" Supported standarts are:
+" ANSI/EIA Standard 548-1988 (EDIF Version 2 0 0)
+" IEC 61690-1 (EDIF Version 3 0 0)
+" IEC 61690-2 (EDIF Version 4 0 0)
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=48-57,-,+,A-Z,a-z,_,&
+else
+ set iskeyword=A-Z,a-z,_,&
+endif
+
+syn region edifList matchgroup=Delimiter start="(" end=")" contains=edifList,edifKeyword,edifString,edifNumber
+
+" Strings
+syn match edifInStringError /%/ contained
+syn match edifInString /%\s*\d\+\s*%/ contained
+syn region edifString start=/"/ end=/"/ contains=edifInString,edifInStringError contained
+
+" Numbers
+syn match edifNumber "\<[-+]\=[0-9]\+\>"
+
+" Keywords
+syn match edifKeyword "(\@<=\s*[a-zA-Z&][a-zA-Z_0-9]*\>" contained
+
+syn match edifError ")"
+
+" synchronization
+if version < 600
+ syntax sync maxlines=250
+else
+ syntax sync fromstart
+endif
+
+" Define the default highlighting.
+if version >= 508 || !exists("did_edif_syntax_inits")
+ if version < 508
+ let did_edif_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink edifInString SpecialChar
+ HiLink edifKeyword Keyword
+ HiLink edifNumber Number
+ HiLink edifInStringError edifError
+ HiLink edifError Error
+ HiLink edifString String
+ delcommand HiLink
+endif
+
+let b:current_syntax = "edif"
diff --git a/runtime/syntax/eiffel.vim b/runtime/syntax/eiffel.vim
new file mode 100644
index 000000000..af6eee98a
--- /dev/null
+++ b/runtime/syntax/eiffel.vim
@@ -0,0 +1,196 @@
+" Eiffel syntax file
+" Language: Eiffel
+" Maintainer: Reimer Behrends <behrends@cse.msu.edu>
+" With much input from Jocelyn Fiat <fiat@eiffel.com>
+" See http://www.cse.msu.edu/~behrends/vim/ for the most current version.
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Option handling
+
+if exists("eiffel_ignore_case")
+ syn case ignore
+else
+ syn case match
+ if exists("eiffel_pedantic") || exists("eiffel_strict")
+ syn keyword eiffelError current void result precursor none
+ syn keyword eiffelError CURRENT VOID RESULT PRECURSOR None
+ syn keyword eiffelError TRUE FALSE
+ endif
+ if exists("eiffel_pedantic")
+ syn keyword eiffelError true false
+ syn match eiffelError "\<[a-z_]\+[A-Z][a-zA_Z_]*\>"
+ syn match eiffelError "\<[A-Z][a-z_]*[A-Z][a-zA-Z_]*\>"
+ endif
+ if exists("eiffel_lower_case_predef")
+ syn keyword eiffelPredefined current void result precursor
+ endif
+endif
+
+if exists("eiffel_hex_constants")
+ syn match eiffelNumber "\d[0-9a-fA-F]*[xX]"
+endif
+
+" Keyword definitions
+
+syn keyword eiffelTopStruct indexing feature creation inherit
+syn match eiffelTopStruct "\<class\>"
+syn match eiffelKeyword "\<end\>"
+syn match eiffelTopStruct "^end\>\(\s*--\s\+class\s\+\<[A-Z][A-Z0-9_]*\>\)\=" contains=eiffelClassName
+syn match eiffelBrackets "[[\]]"
+syn match eiffelBracketError "\]"
+syn region eiffelGeneric transparent matchgroup=eiffelBrackets start="\[" end="\]" contains=ALLBUT,eiffelBracketError,eiffelGenericDecl,eiffelStringError,eiffelStringEscape,eiffelGenericCreate,eiffelTopStruct
+if exists("eiffel_ise")
+ syn match eiffelCreate "\<create\>"
+ syn match eiffelTopStruct contained "\<create\>"
+ syn match eiffelGenericCreate contained "\<create\>"
+ syn match eiffelTopStruct "^create\>"
+ syn region eiffelGenericDecl transparent matchgroup=eiffelBrackets contained start="\[" end="\]" contains=ALLBUT,eiffelCreate,eiffelTopStruct,eiffelGeneric,eiffelBracketError,eiffelStringEscape,eiffelStringError,eiffelBrackets
+ syn region eiffelClassHeader start="^class\>" end="$" contains=ALLBUT,eiffelCreate,eiffelGenericCreate,eiffelGeneric,eiffelStringEscape,eiffelStringError,eiffelBrackets
+endif
+syn keyword eiffelDeclaration is do once deferred unique local
+syn keyword eiffelDeclaration Unique
+syn keyword eiffelProperty expanded obsolete separate frozen
+syn keyword eiffelProperty prefix infix
+syn keyword eiffelInheritClause rename redefine undefine select export as
+syn keyword eiffelAll all
+syn keyword eiffelKeyword external alias
+syn keyword eiffelStatement if else elseif inspect
+syn keyword eiffelStatement when then
+syn match eiffelAssertion "\<require\(\s\+else\)\=\>"
+syn match eiffelAssertion "\<ensure\(\s\+then\)\=\>"
+syn keyword eiffelAssertion check
+syn keyword eiffelDebug debug
+syn keyword eiffelStatement from until loop
+syn keyword eiffelAssertion variant
+syn match eiffelAssertion "\<invariant\>"
+syn match eiffelTopStruct "^invariant\>"
+syn keyword eiffelException rescue retry
+
+syn keyword eiffelPredefined Current Void Result Precursor
+
+" Operators
+syn match eiffelOperator "\<and\(\s\+then\)\=\>"
+syn match eiffelOperator "\<or\(\s\+else\)\=\>"
+syn keyword eiffelOperator xor implies not
+syn keyword eiffelOperator strip old
+syn keyword eiffelOperator Strip
+syn match eiffelOperator "\$"
+syn match eiffelCreation "!"
+syn match eiffelExport "[{}]"
+syn match eiffelArray "<<"
+syn match eiffelArray ">>"
+syn match eiffelConstraint "->"
+syn match eiffelOperator "[@#|&][^ \e\t\b%]*"
+
+" Special classes
+syn keyword eiffelAnchored like
+syn keyword eiffelBitType BIT
+
+" Constants
+if !exists("eiffel_pedantic")
+ syn keyword eiffelBool true false
+endif
+syn keyword eiffelBool True False
+syn region eiffelString start=+"+ skip=+%"+ end=+"+ contains=eiffelStringEscape,eiffelStringError
+syn match eiffelStringEscape contained "%[^/]"
+syn match eiffelStringEscape contained "%/\d\+/"
+syn match eiffelStringEscape contained "^[ \t]*%"
+syn match eiffelStringEscape contained "%[ \t]*$"
+syn match eiffelStringError contained "%/[^0-9]"
+syn match eiffelStringError contained "%/\d\+[^0-9/]"
+syn match eiffelBadConstant "'\(%[^/]\|%/\d\+/\|[^'%]\)\+'"
+syn match eiffelBadConstant "''"
+syn match eiffelCharacter "'\(%[^/]\|%/\d\+/\|[^'%]\)'" contains=eiffelStringEscape
+syn match eiffelNumber "-\=\<\d\+\(_\d\+\)*\>"
+syn match eiffelNumber "\<[01]\+[bB]\>"
+syn match eiffelNumber "-\=\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\)\=\([eE][-+]\=\d\+\(_\d\+\)*\)\="
+syn match eiffelNumber "-\=\.\d\+\(_\d\+\)*\([eE][-+]\=\d\+\(_\d\+\)*\)\="
+syn match eiffelComment "--.*" contains=eiffelTodo
+
+syn case match
+
+" Case sensitive stuff
+
+syn keyword eiffelTodo contained TODO XXX FIXME
+syn match eiffelClassName "\<[A-Z][A-Z0-9_]*\>"
+
+" Catch mismatched parentheses
+syn match eiffelParenError ")"
+syn region eiffelParen transparent start="(" end=")" contains=ALLBUT,eiffelParenError,eiffelStringError,eiffelStringEscape
+
+" Should suffice for even very long strings and expressions
+syn sync lines=40
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_eiffel_syntax_inits")
+ if version < 508
+ let did_eiffel_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink eiffelKeyword Statement
+ HiLink eiffelProperty Statement
+ HiLink eiffelInheritClause Statement
+ HiLink eiffelStatement Statement
+ HiLink eiffelDeclaration Statement
+ HiLink eiffelAssertion Statement
+ HiLink eiffelDebug Statement
+ HiLink eiffelException Statement
+ HiLink eiffelGenericCreate Statement
+
+
+ HiLink eiffelTopStruct PreProc
+
+ HiLink eiffelAll Special
+ HiLink eiffelAnchored Special
+ HiLink eiffelBitType Special
+
+
+ HiLink eiffelBool Boolean
+ HiLink eiffelString String
+ HiLink eiffelCharacter Character
+ HiLink eiffelClassName Type
+ HiLink eiffelNumber Number
+
+ HiLink eiffelStringEscape Special
+
+ HiLink eiffelOperator Special
+ HiLink eiffelArray Special
+ HiLink eiffelExport Special
+ HiLink eiffelCreation Special
+ HiLink eiffelBrackets Special
+ HiLink eiffelGeneric Special
+ HiLink eiffelGenericDecl Special
+ HiLink eiffelConstraint Special
+ HiLink eiffelCreate Special
+
+ HiLink eiffelPredefined Constant
+
+ HiLink eiffelComment Comment
+
+ HiLink eiffelError Error
+ HiLink eiffelBadConstant Error
+ HiLink eiffelStringError Error
+ HiLink eiffelParenError Error
+ HiLink eiffelBracketError Error
+
+ HiLink eiffelTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "eiffel"
+
+" vim: ts=8
diff --git a/runtime/syntax/elf.vim b/runtime/syntax/elf.vim
new file mode 100644
index 000000000..678048968
--- /dev/null
+++ b/runtime/syntax/elf.vim
@@ -0,0 +1,95 @@
+" Vim syntax file
+" Language: ELF
+" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
+" Last Change: Son 22 Jun 2003 20:43:14 CEST
+" Filenames: *.ab,*.am
+" URL: http://www.cvjb.de/comp/vim/elf.vim
+" $Id$
+"
+" ELF: Extensible Language Facility
+" This is the Applix Inc., Macro and Builder programming language.
+" It has nothing in common with the binary format called ELF.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Case does not matter
+syn case ignore
+
+" Environments
+syn region elfEnvironment transparent matchgroup=Special start="{" matchgroup=Special end="}" contains=ALLBUT,elfBraceError
+
+" Unmatched braces
+syn match elfBraceError "}"
+
+" All macros must have at least one of these definitions
+syn keyword elfSpecial endmacro
+syn region elfSpecial transparent matchgroup=Special start="^\(\(macro\)\|\(set\)\) \S\+$" matchgroup=Special end="^\(\(endmacro\)\|\(endset\)\)$" contains=ALLBUT,elfBraceError
+
+" Preprocessor Commands
+syn keyword elfPPCom define include
+
+" Some keywords
+syn keyword elfKeyword false true null
+syn keyword elfKeyword var format object function endfunction
+
+" Conditionals and loops
+syn keyword elfConditional if else case of endcase for to next while until return goto
+
+" All built-in elf macros end with an '@'
+syn match elfMacro "[0-9_A-Za-z]\+@"
+
+" Strings and characters
+syn region elfString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+" Numbers
+syn match elfNumber "-\=\<[0-9]*\.\=[0-9_]\>"
+
+" Comments
+syn region elfComment start="/\*" end="\*/"
+syn match elfComment "\'.*$"
+
+syn sync ccomment elfComment
+
+" Parenthesis
+syn match elfParens "[\[\]()]"
+
+" Punctuation
+syn match elfPunct "[,;]"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_elf_syn_inits")
+ if version < 508
+ let did_elf_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later.
+ HiLink elfComment Comment
+ HiLink elfPPCom Include
+ HiLink elfKeyword Keyword
+ HiLink elfSpecial Special
+ HiLink elfEnvironment Special
+ HiLink elfBraceError Error
+ HiLink elfConditional Conditional
+ HiLink elfMacro Function
+ HiLink elfNumber Number
+ HiLink elfString String
+ HiLink elfParens Delimiter
+ HiLink elfPunct Delimiter
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "elf"
+
+" vim:ts=8:sw=4:nocindent:smartindent:
diff --git a/runtime/syntax/elinks.vim b/runtime/syntax/elinks.vim
new file mode 100644
index 000000000..0392c0858
--- /dev/null
+++ b/runtime/syntax/elinks.vim
@@ -0,0 +1,207 @@
+" Vim syntax file
+" Language: elinks(1) configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/
+" Latest Revision: 2004-05-22
+" arch-tag: 74eaff55-cdb5-4d31-805b-9627eb6535f1
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,_,-
+delcommand SetIsk
+
+" Todo
+syn keyword elinksTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region elinksComment matchgroup=elinksComment start='#' end='$' contains=elinksTodo
+
+" Numbers
+syn match elinksNumber '\<\d\+\>'
+
+" Strings
+syn region elinksString matchgroup=elinksString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@elinksColor
+
+" Keywords
+syn keyword elinksKeyword set bind
+
+" Options
+syn keyword elinksPrefix bookmarks
+syn keyword elinksOptions file_format
+
+syn keyword elinksPrefix config
+syn keyword elinksOptions comments indentation saving_style i18n
+syn keyword elinksOptions saving_style_w show_template
+
+syn keyword elinksPrefix connection ssl client_cert
+syn keyword elinksOptions enable file cert_verify async_dns max_connections
+syn keyword elinksOptions max_connections_to_host receive_timeout retries
+syn keyword elinksOptions unrestartable_receive_timeout
+
+syn keyword elinksPrefix cookies
+syn keyword elinksOptions accept_policy max_age paranoid_security save resave
+
+syn keyword elinksPrefix document browse accesskey forms images links
+syn keyword elinksPrefix active_link colors search cache codepage colors
+syn keyword elinksPrefix format memory download dump history global html
+syn keyword elinksPrefix plain
+syn keyword elinksOptions auto_follow priority auto_submit confirm_submit
+syn keyword elinksOptions input_size show_formhist file_tags
+syn keyword elinksOptions image_link_tagging image_link_prefix
+syn keyword elinksOptions image_link_suffix show_as_links show_any_as_links
+syn keyword elinksOptions background text enable_color bold invert underline
+syn keyword elinksOptions color_dirs numbering use_tabindex
+syn keyword elinksOptions number_keys_select_link wraparound case regex
+syn keyword elinksOptions show_hit_top_bottom wraparound show_not_found
+syn keyword elinksOptions margin_width refresh minimum_refresh_time
+syn keyword elinksOptions scroll_margin scroll_step table_move_order size
+syn keyword elinksOptions size cache_redirects ignore_cache_control assume
+syn keyword elinksOptions force_assumed text background link vlink dirs
+syn keyword elinksOptions allow_dark_on_black ensure_contrast
+syn keyword elinksOptions use_document_colors directory set_original_time
+syn keyword elinksOptions overwrite notify_bell codepage width enable
+syn keyword elinksOptions max_items display_type write_interval
+syn keyword elinksOptions keep_unhistory display_frames display_tables
+syn keyword elinksOptions expand_table_columns display_subs display_sups
+syn keyword elinksOptions link_display underline_links wrap_nbsp
+syn keyword elinksOptions display_links compress_empty_lines
+
+syn keyword elinksPrefix mime extension handler mailcap mimetypes type
+syn keyword elinksOptions ask block program enable path ask description
+syn keyword elinksOptions prioritize enable path default_type
+
+syn keyword elinksPrefix protocol file cgi ftp proxy http bugs proxy
+syn keyword elinksPrefix referer https proxy rewrite dumb smart
+syn keyword elinksOptions path policy allow_special_files show_hidden_files
+syn keyword elinksOptions try_encoding_extensions host anon_passwd use_pasv
+syn keyword elinksOptions use_epsv accept_charset allow_blacklist
+syn keyword elinksOptions broken_302_redirect post_no_keepalive http10 host
+syn keyword elinksOptions user passwd policy fake accept_language
+syn keyword elinksOptions accept_ui_language trace user_agent host
+syn keyword elinksOptions enable-dumb enable-smart
+
+syn keyword elinksPrefix terminal
+syn keyword elinksOptions type m11_hack utf_8_io restrict_852 block_cursor
+syn keyword elinksOptions colors transparency underline charset
+
+syn keyword elinksPrefix ui colors color mainmenu normal selected hotkey
+syn keyword elinksPrefix menu marked hotkey frame dialog generic frame
+syn keyword elinksPrefix scrollbar scrollbar-selected title text checkbox
+syn keyword elinksPrefix checkbox-label button button-selected field
+syn keyword elinksPrefix field-text meter shadow title title-bar title-text
+syn keyword elinksPrefix status status-bar status-text tabs unvisited normal
+syn keyword elinksPrefix loading separator searched mono
+syn keyword elinksOptions text background
+
+syn keyword elinksPrefix ui dialogs leds sessions tabs timer
+syn keyword elinksOptions listbox_min_height shadows underline_hotkeys enable
+syn keyword elinksOptions auto_save auto_restore auto_save_foldername
+syn keyword elinksOptions homepage show_bar wraparound confirm_close enable
+syn keyword elinksOptions duration action language show_status_bar
+syn keyword elinksOptions show_title_bar startup_goto_dialog success_msgbox
+syn keyword elinksOptions window_title
+
+syn keyword elinksOptions secure_file_saving
+
+" Colors
+syn cluster elinksColor contains=elinksColorBlack,elinksColorDarkRed,elinksColorDarkGreen,elinksColorDarkYellow,elinksColorDarkBlue,elinksColorDarkMagenta,elinksColorDarkCyan,elinksColorGray,elinksColorDarkGray,elinksColorRed,elinksColorGreen,elinksColorYellow,elinksColorBlue,elinksColorMagenta,elinksColorCyan,elinksColorWhite
+
+syn keyword elinksColorBlack black contained
+syn keyword elinksColorDarkRed darkred sandybrown maroon crimson firebrick contained
+syn keyword elinksColorDarkGreen darkgreen darkolivegreen darkseagreen contained
+syn keyword elinksColorDarkGreen forestgreen mediumspringgreen seagreen contained
+syn keyword elinksColorDarkYellow brown blanchedalmond chocolate darkorange contained
+syn keyword elinksColorDarkYellow darkgoldenrod orange rosybrown saddlebrown contained
+syn keyword elinksColorDarkYellow peru olive olivedrab sienna contained
+syn keyword elinksColorDarkBlue darkblue cadetblue cornflowerblue contained
+syn keyword elinksColorDarkBlue darkslateblue deepskyblue midnightblue contained
+syn keyword elinksColorDarkBlue royalblue steelblue navy contained
+syn keyword elinksColorDarkMagenta darkmagenta mediumorchid mediumpurple contained
+syn keyword elinksColorDarkMagenta mediumslateblue slateblue deeppink hotpink contained
+syn keyword elinksColorDarkMagenta darkorchid orchid purple indigo contained
+syn keyword elinksColorDarkCyan darkcyan mediumaquamarine mediumturquoise contained
+syn keyword elinksColorDarkCyan darkturquoise teal contained
+syn keyword elinksColorGray silver dimgray lightslategray slategray contained
+syn keyword elinksColorGray lightgrey burlywood plum tan thistle contained
+
+syn keyword elinksColorDarkGray gray darkgray darkslategray darksalmon contained
+syn keyword elinksColorRed red indianred orangered tomato lightsalmon contained
+syn keyword elinksColorRed salmon coral lightcoral contained
+syn keyword elinksColorGreen green greenyellow lawngreen lightgreen contained
+syn keyword elinksColorGreen lightseagreen limegreen mediumseagreen contained
+syn keyword elinksColorGreen springgreen yellowgreen palegreen lime contained
+syn keyword elinksColorGreen chartreuse contained
+syn keyword elinksColorYellow yellow beige darkkhaki lightgoldenrodyellow contained
+syn keyword elinksColorYellow palegoldenrod gold goldenrod khaki contained
+syn keyword elinksColorYellow lightyellow contained
+syn keyword elinksColorBlue blue aliceblue aqua aquamarine azure contained
+syn keyword elinksColorBlue dodgerblue lightblue lightskyblue contained
+syn keyword elinksColorBlue lightsteelblue mediumblue contained
+syn keyword elinksColorMagenta magenta darkviolet blueviolet lightpink contained
+syn keyword elinksColorMagenta mediumvioletred palevioletred violet pink contained
+syn keyword elinksColorMagenta fuchsia contained
+syn keyword elinksColorCyan cyan lightcyan powderblue skyblue turquoise contained
+syn keyword elinksColorCyan paleturquoise contained
+syn keyword elinksColorWhite white antiquewhite floralwhite ghostwhite contained
+syn keyword elinksColorWhite navajowhite whitesmoke linen lemonchiffon contained
+syn keyword elinksColorWhite cornsilk lavender lavenderblush seashell contained
+syn keyword elinksColorWhite mistyrose ivory papayawhip bisque gainsboro contained
+syn keyword elinksColorWhite honeydew mintcream moccasin oldlace contained
+syn keyword elinksColorWhite peachpuff snow wheat contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_elinks_syn_inits")
+ if version < 508
+ let did_elinks_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ HiDef hi <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ HiDef hi def <args>
+ endif
+
+ HiLink elinksTodo Todo
+ HiLink elinksComment Comment
+ HiLink elinksNumber Number
+ HiLink elinksString String
+ HiLink elinksKeyword Keyword
+ HiLink elinksPrefix Identifier
+ HiLink elinksOptions Identifier
+ HiDef elinksColorBlack ctermfg=Black guifg=Black
+ HiDef elinksColorDarkRed ctermfg=DarkRed guifg=DarkRed
+ HiDef elinksColorDarkGreen ctermfg=DarkGreen guifg=DarkGreen
+ HiDef elinksColorDarkYellow ctermfg=DarkYellow guifg=DarkYellow
+ HiDef elinksColorDarkBlue ctermfg=DarkBlue guifg=DarkBlue
+ HiDef elinksColorDarkMagenta ctermfg=DarkMagenta guifg=DarkMagenta
+ HiDef elinksColorDarkCyan ctermfg=DarkCyan guifg=DarkCyan
+ HiDef elinksColorGray ctermfg=Gray guifg=Gray
+ HiDef elinksColorDarkGray ctermfg=DarkGray guifg=DarkGray
+ HiDef elinksColorRed ctermfg=Red guifg=Red
+ HiDef elinksColorGreen ctermfg=Green guifg=Green
+ HiDef elinksColorYellow ctermfg=Yellow guifg=Yellow
+ HiDef elinksColorBlue ctermfg=Blue guifg=Blue
+ HiDef elinksColorMagenta ctermfg=Magenta guifg=Magenta
+ HiDef elinksColorCyan ctermfg=Cyan guifg=Cyan
+ HiDef elinksColorWhite ctermfg=White guifg=White
+
+ delcommand HiLink
+ delcommand HiDef
+endif
+
+let b:current_syntax = "elinks"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/elmfilt.vim b/runtime/syntax/elmfilt.vim
new file mode 100644
index 000000000..20f22d39b
--- /dev/null
+++ b/runtime/syntax/elmfilt.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: Elm Filter rules
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 3
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn cluster elmfiltIfGroup contains=elmfiltCond,elmfiltOper,elmfiltOperKey,,elmfiltNumber,elmfiltOperKey
+
+syn match elmfiltParenError "[()]"
+syn match elmfiltMatchError "/"
+syn region elmfiltIf start="\<if\>" end="\<then\>" contains=elmfiltParen,elmfiltParenError skipnl skipwhite nextgroup=elmfiltAction
+syn region elmfiltParen contained matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=elmfiltParen,@elmfiltIfGroup,elmfiltThenError
+syn region elmfiltMatch contained matchgroup=Delimiter start="/" skip="\\/" matchgroup=Delimiter end="/" skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
+syn match elmfiltThenError "\<then.*$"
+syn match elmfiltComment "^#.*$" contains=@Spell
+
+syn keyword elmfiltAction contained delete execute executec forward forwardc leave save savecopy skipnl skipwhite nextgroup=elmfiltString
+syn match elmfiltArg contained "[^\\]%[&0-9dDhmrsSty&]"lc=1
+
+syn match elmfiltOperKey contained "\<contains\>" skipnl skipwhite nextgroup=elmfiltString
+syn match elmfiltOperKey contained "\<matches\s" nextgroup=elmfiltMatch,elmfiltSpaceError
+syn keyword elmfiltCond contained cc bcc lines always subject sender from to lines received skipnl skipwhite nextgroup=elmfiltString
+syn match elmfiltNumber contained "\d\+"
+syn keyword elmfiltOperKey contained and not skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey,elmfiltString
+syn match elmfiltOper contained "\~" skipnl skipwhite nextgroup=elmfiltMatch
+syn match elmfiltOper contained "<=\|>=\|!=\|<\|<\|=" skipnl skipwhite nextgroup=elmfiltString,elmfiltCond,elmfiltOperKey
+syn region elmfiltString contained start='"' skip='"\(\\\\\)*\\["%]' end='"' contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
+syn region elmfiltString contained start="'" skip="'\(\\\\\)*\\['%]" end="'" contains=elmfiltArg skipnl skipwhite nextgroup=elmfiltOper,elmfiltOperKey
+syn match elmfiltSpaceError contained "\s.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_elmfilt_syntax_inits")
+ if version < 508
+ let did_elmfilt_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink elmfiltAction Statement
+ HiLink elmfiltArg Special
+ HiLink elmfiltComment Comment
+ HiLink elmfiltCond Statement
+ HiLink elmfiltIf Statement
+ HiLink elmfiltMatch Special
+ HiLink elmfiltMatchError Error
+ HiLink elmfiltNumber Number
+ HiLink elmfiltOper Operator
+ HiLink elmfiltOperKey Type
+ HiLink elmfiltParenError Error
+ HiLink elmfiltSpaceError Error
+ HiLink elmfiltString String
+ HiLink elmfiltThenError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "elmfilt"
+" vim: ts=9
diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim
new file mode 100644
index 000000000..a8ffb3939
--- /dev/null
+++ b/runtime/syntax/erlang.vim
@@ -0,0 +1,224 @@
+" Vim syntax file
+" Language: erlang (ERicsson LANGuage)
+" http://www.erlang.se
+" http://www.erlang.org
+" Maintainer: Kre¹imir Mar¾iæ (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
+" Last update: Fri, 15-Feb-2002
+" Filenames: .erl
+" URL: http://www.srk.fer.hr/~kmarzic/vim/syntax/erlang.vim
+
+
+" There are three sets of highlighting in here:
+" One is "erlang_characters", second is "erlang_functions" and third
+" is "erlang_keywords".
+" If you want to disable keywords highlighting, put in your .vimrc:
+" let erlang_keywords=1
+" If you want to disable erlang BIF highlighting, put in your .vimrc
+" this:
+" let erlang_functions=1
+" If you want to disable special characters highlighting, put in
+" your .vimrc:
+" let erlang_characters=1
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists ("b:current_syntax")
+ finish
+endif
+
+
+" Case sensitive
+syn case match
+
+
+if ! exists ("erlang_characters")
+ " Basic elements
+ syn match erlangComment +%.*$+
+ syn match erlangModifier "\~\a\|\\\a" contained
+ syn match erlangSpecialCharacter ":\|_\|@\|\\\|\"\|\."
+ syn match erlangSeparator "(\|)\|{\|}\|\[\|]\||\|||\|;\|,\|?\|->\|#" contained
+ syn region erlangString start=+"+ skip=+\\"+ end=+"+ contains=erlangModifier
+ syn region erlangAtom start=+'+ skip=+\\'+ end=+'+
+
+ " Operators
+ syn match erlangOperator "+\|-\|\*\|\/"
+ syn keyword erlangOperator div rem or xor bor bxor bsl bsr
+ syn keyword erlangOperator and band not bnot
+ syn match erlangOperator "==\|/=\|=:=\|=/=\|<\|=<\|>\|>="
+ syn match erlangOperator "++\|--\|=\|!\|<-"
+
+ " Numbers
+ syn match erlangNumberInteger "[+-]\=\d\+" contains=erlangSeparator
+ syn match erlangNumberFloat1 "[+-]\=\d\+.\d\+" contains=erlangSeparator
+ syn match erlangNumberFloat2 "[+-]\=\d\+\(.\d\+\)\=[eE][+-]\=\d\+\(.\d\+\)\=" contains=erlangSeparator
+ syn match erlangNumberFloat3 "[+-]\=\d\+[#]\x\+" contains=erlangSeparator
+ syn match erlangNumberFloat4 "[+-]\=[eE][+-]\=\d\+" contains=erlangSeparator
+ syn match erlangNumberHex "$\x\+" contains=erlangSeparator
+
+ " Ignore '_' and '-' in words
+ syn match erlangWord "\w\+[_-]\+\w\+"
+
+ " Ignore numbers in words
+ syn match erlangWord "\w\+\d\+\(\(.\d\+\)\=\(\w\+\)\=\)\="
+endif
+
+if ! exists ("erlang_functions")
+ " Functions call
+ syn match erlangFCall "\w\+\(\s\+\)\=[:@]\(\s\+\)\=\w\+" contains=ALLBUT,erlangFunction,erlangBIF,erlangWord
+
+ " build-in-functions (BIFs)
+ syn keyword erlangBIF abs alive apply atom_to_list
+ syn keyword erlangBIF binary_to_list binary_to_term
+ syn keyword erlangBIF concat_binary
+ syn keyword erlangBIF date disconnect_node
+ syn keyword erlangBIF element erase exit
+ syn keyword erlangBIF float float_to_list
+ syn keyword erlangBIF get get_keys group_leader
+ syn keyword erlangBIF halt hd
+ syn keyword erlangBIF integer_to_list is_alive
+ syn keyword erlangBIF length link list_to_atom list_to_binary
+ syn keyword erlangBIF list_to_float list_to_integer list_to_pid
+ syn keyword erlangBIF list_to_tuple load_module
+ syn keyword erlangBIF make_ref monitor_node
+ syn keyword erlangBIF node nodes now
+ syn keyword erlangBIF open_port
+ syn keyword erlangBIF pid_to_list process_flag
+ syn keyword erlangBIF process_info process put
+ syn keyword erlangBIF register registered round
+ syn keyword erlangBIF self setelement size spawn
+ syn keyword erlangBIF spawn_link split_binary statistics
+ syn keyword erlangBIF term_to_binary throw time tl trunc
+ syn keyword erlangBIF tuple_to_list
+ syn keyword erlangBIF unlink unregister
+ syn keyword erlangBIF whereis
+
+ " Other BIFs
+ syn keyword erlangBIF atom binary constant function integer
+ syn keyword erlangBIF list number pid ports port_close port_info
+ syn keyword erlangBIF reference record
+
+ " erlang:BIFs
+ syn keyword erlangBIF check_process_code delete_module
+ syn keyword erlangBIF get_cookie hash math module_loaded
+ syn keyword erlangBIF preloaded processes purge_module set_cookie
+ syn keyword erlangBIF set_node
+
+ " functions of math library
+ syn keyword erlangFunction acos asin atan atan2 cos cosh exp
+ syn keyword erlangFunction log log10 pi pow power sin sinh sqrt
+ syn keyword erlangFunction tan tanh
+
+ " Other functions
+ syn keyword erlangFunction call module_info parse_transform
+ syn keyword erlangFunction undefined_function
+
+ " Modules
+ syn keyword erlangModule error_handler
+endif
+
+if ! exists ("erlang_keywords")
+ " Constants and Directives
+ syn match erlangDirective "-compile\|-define\|-else\|-endif\|-export\|-file"
+ syn match erlangDirective "-ifdef\|-ifndef\|-import\|-include\|-include_lib"
+ syn match erlangDirective "-module\|-record\|-undef"
+
+ syn match erlangConstant "-author\|-copyright\|-doc"
+
+ " Keywords
+ syn keyword erlangKeyword after begin case catch
+ syn keyword erlangKeyword cond end fun if
+ syn keyword erlangKeyword let of query receive
+ syn keyword erlangKeyword when
+
+ " Processes
+ syn keyword erlangProcess creation current_function dictionary
+ syn keyword erlangProcess group_leader heap_size high initial_call
+ syn keyword erlangProcess linked low memory_in_use message_queue
+ syn keyword erlangProcess net_kernel node normal priority
+ syn keyword erlangProcess reductions registered_name runnable
+ syn keyword erlangProcess running stack_trace status timer
+ syn keyword erlangProcess trap_exit waiting
+
+ " Ports
+ syn keyword erlangPort command count_in count_out creation in
+ syn keyword erlangPort in_format linked node out owner packeting
+
+ " Nodes
+ syn keyword erlangNode atom_tables communicating creation
+ syn keyword erlangNode current_gc current_reductions current_runtime
+ syn keyword erlangNode current_wall_clock distribution_port
+ syn keyword erlangNode entry_points error_handler friends
+ syn keyword erlangNode garbage_collection magic_cookie magic_cookies
+ syn keyword erlangNode module_table monitored_nodes name next_ref
+ syn keyword erlangNode ports preloaded processes reductions
+ syn keyword erlangNode ref_state registry runtime wall_clock
+
+ " Reserved
+ syn keyword erlangReserved apply_lambda module_info module_lambdas
+ syn keyword erlangReserved record record_index record_info
+
+ " Extras
+ syn keyword erlangExtra badarg nocookie false fun true
+
+ " Signals
+ syn keyword erlangSignal badsig kill killed exit normal
+endif
+
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists ("did_erlang_inits")
+ if version < 508
+ let did_erlang_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " erlang_characters
+ HiLink erlangComment Comment
+ HiLink erlangSpecialCharacter Special
+ HiLink erlangSeparator Normal
+ HiLink erlangModifier Special
+ HiLink erlangOperator Operator
+ HiLink erlangString String
+ HiLink erlangAtom Type
+
+ HiLink erlangNumberInteger Number
+ HiLink erlangNumberFloat1 Float
+ HiLink erlangNumberFloat2 Float
+ HiLink erlangNumberFloat3 Float
+ HiLink erlangNumberFloat4 Float
+ HiLink erlangNumberHex Number
+
+ HiLink erlangWord Normal
+
+ " erlang_functions
+ HiLink erlangFCall Function
+ HiLink erlangBIF Function
+ HiLink erlangFunction Function
+ HiLink erlangModuleFunction Function
+
+ " erlang_keywords
+ HiLink erlangDirective Type
+ HiLink erlangConstant Type
+ HiLink erlangKeyword Keyword
+ HiLink erlangProcess Special
+ HiLink erlangPort Special
+ HiLink erlangNode Special
+ HiLink erlangReserved Statement
+ HiLink erlangExtra Statement
+ HiLink erlangSignal Statement
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "erlang"
+
+" eof
diff --git a/runtime/syntax/esqlc.vim b/runtime/syntax/esqlc.vim
new file mode 100644
index 000000000..6ad167a7e
--- /dev/null
+++ b/runtime/syntax/esqlc.vim
@@ -0,0 +1,75 @@
+" Vim syntax file
+" Language: ESQL-C
+" Maintainer: Jonathan A. George <jageorge@tel.gte.com>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C++ syntax to start with
+if version < 600
+ source <sfile>:p:h/cpp.vim
+else
+ runtime! syntax/cpp.vim
+endif
+
+" ESQL-C extentions
+
+syntax keyword esqlcPreProc EXEC SQL INCLUDE
+
+syntax case ignore
+
+syntax keyword esqlcPreProc begin end declare section database open execute
+syntax keyword esqlcPreProc prepare fetch goto continue found sqlerror work
+
+syntax keyword esqlcKeyword access add as asc by check cluster column
+syntax keyword esqlcKeyword compress connect current decimal
+syntax keyword esqlcKeyword desc exclusive file from group
+syntax keyword esqlcKeyword having identified immediate increment index
+syntax keyword esqlcKeyword initial into is level maxextents mode modify
+syntax keyword esqlcKeyword nocompress nowait of offline on online start
+syntax keyword esqlcKeyword successful synonym table then to trigger uid
+syntax keyword esqlcKeyword unique user validate values view whenever
+syntax keyword esqlcKeyword where with option order pctfree privileges
+syntax keyword esqlcKeyword public resource row rowlabel rownum rows
+syntax keyword esqlcKeyword session share size smallint
+
+syntax keyword esqlcOperator not and or
+syntax keyword esqlcOperator in any some all between exists
+syntax keyword esqlcOperator like escape
+syntax keyword esqlcOperator intersect minus
+syntax keyword esqlcOperator prior distinct
+syntax keyword esqlcOperator sysdate
+
+syntax keyword esqlcStatement alter analyze audit comment commit create
+syntax keyword esqlcStatement delete drop explain grant insert lock noaudit
+syntax keyword esqlcStatement rename revoke rollback savepoint select set
+syntax keyword esqlcStatement truncate update
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_esqlc_syntax_inits")
+ if version < 508
+ let did_esqlc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink esqlcOperator Operator
+ HiLink esqlcStatement Statement
+ HiLink esqlcKeyword esqlcSpecial
+ HiLink esqlcSpecial Special
+ HiLink esqlcPreProc PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "esqlc"
+
diff --git a/runtime/syntax/eterm.vim b/runtime/syntax/eterm.vim
new file mode 100644
index 000000000..9cf38fe14
--- /dev/null
+++ b/runtime/syntax/eterm.vim
@@ -0,0 +1,200 @@
+" Vim syntax file
+" Language: Eterm configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/eterm/
+" Latest Revision: 2004-05-06
+" arch-tag: f4c58caf-2b91-4fc4-96af-e3cad7c70e6b
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" magic number
+syn match etermMagic display "^<Eterm-[0-9.]\+>$"
+
+" comments
+syn region etermComment matchgroup=etermComment start="^#" end="$" contains=etermTodo
+
+" todo
+syn keyword etermTodo contained TODO FIXME XXX NOTE
+
+" numbers
+syn match etermNumber contained display "\<\(\d\+\|0x\x\{1,2}\)\>"
+
+" strings
+syn region etermString contained display oneline start=+"+ skip=+\\"+ end=+"+
+
+" booleans
+syn keyword etermBoolean contained on off true false yes no
+
+" colors (not pretty, but can't figure out better way...)
+syn match etermColor contained display "\s\+#\x\{6}\>"
+syn keyword etermColor contained white black
+
+" preproc
+syn match etermPreProc contained "%\(appname\|exec\|get\|put\|random\|version\|include\|preproc\)("he=e-1
+
+" functions
+syn match etermFunctions contained "\<\(copy\|exit\|kill\|nop\|paste\|save\|scroll\|search\|spawn\)("
+
+" and make it easy to refer to the above...
+syn cluster etermGeneral contains=etermComment,etermNumber,etermString,etermBoolean,etermColor,etermFunction,etermPreProc
+
+" key modifiers
+syn keyword etermKeyMod contained ctrl shift lock mod1 mod2 mod3 mod4 mod5 alt meta anymod
+syn keyword etermKeyMod contained button1 button2 button3 button4 button5
+
+" color context
+syn region etermColorOptions contained oneline matchgroup=etermOption start="^\s*video\>" matchgroup=etermType end="\<\(normal\|reverse\)\>"
+syn region etermColorOptions contained oneline matchgroup=etermOption start="^\s*color\>" matchgroup=etermType end="\<\(bd\|ul\|[0-9]\|1[0-5]\)\>"
+syn keyword etermColorOptions contained foreground background cursor cursor_text pointer
+
+syn region etermColorContext fold transparent matchgroup=etermContext start="^\s*begin\s\+color\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermColorOptions
+
+" attributes context
+syn region etermAttrOptions contained oneline matchgroup=etermOption start="^\s*geometry\>" matchgroup=etermType end="\<\d\+x\d\++\d\++\d\+\>"
+syn region etermAttrOptions contained oneline matchgroup=etermOption start="^\s*scrollbar_type\>" matchgroup=etermType end="\<\(motif\|xterm\|next\)\>"
+syn region etermAttrOptions contained oneline matchgroup=etermOption start="^\s*font\>" matchgroup=etermType end="\<\(bold\|default\|proportional\|fx\|[0-5]\)\>"
+syn keyword etermAttrOptions contained title name iconname desktop scrollbar_width
+
+syn region etermAttrContext fold transparent matchgroup=etermContext start="^\s*begin\s\+attributes\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermAttrOptions
+
+" image context
+" image types
+syn keyword etermImageTypes contained background trough anchor up_arrow
+syn keyword etermImageTypes contained left_arrow right_arrow menu menuitem
+syn keyword etermImageTypes contained submenu button buttonbar down_arrow
+syn region etermImageOptions contained transparent oneline matchgroup=etermOption start="^\s*type\>" end="$" contains=etermImageTypes
+" image modes
+syn keyword etermImageModes contained image trans viewport auto solid
+syn keyword etermImageModesAllow contained allow
+syn region etermImageOptions contained transparent oneline matchgroup=etermOption start="^\s*mode\>" end="$" contains=etermImageModes,etermImageModesAllow
+" image states
+syn region etermImageOptions contained transparent oneline matchgroup=etermOption start="^\s*state\>" matchgroup=etermType end="\<\(normal\|selected\|clicked\|disabled\)\>"
+" image geometry
+syn region etermImageOptions contained transparent oneline matchgroup=etermOption start="^\s*geom\>" matchgroup=etermType end="\s\+\(\d\+x\d\++\d\++\d\+\)\=:\(\(tile\|scale\|hscale\|vscale\|propscale\)d\=\)\="
+" image color modification
+syn region etermImageOptions contained transparent oneline matchgroup=etermOption start="^\s*\(cmod\|colormod\)\>" matchgroup=etermType end="\<\(image\|red\|green\|blue\)\>"
+" other keywords
+syn keyword etermImageOptions contained file padding border bevel color
+
+syn region etermImageContext contained transparent fold matchgroup=etermContext start="^\s*begin\s\+image\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermImageOptions
+
+" imageclasses context
+syn keyword etermIClassOptions contained icon cache path anim
+
+syn region etermIClassContext fold transparent matchgroup=etermContext start="^\s*begin\s\+imageclasses\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermImageContext,etermIClassOptions
+
+" menuitem context
+syn region etermMenuItemOptions contained transparent oneline matchgroup=etermOption start="^\s*action\>" matchgroup=etermType end="\<string\|echo\|submenu\|script\|separator\>"
+syn keyword etermMenuItemOptions contained text rtext
+
+syn region etermMenuItemContext fold transparent matchgroup=etermContext start="^\s*begin\s\+menuitem\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermMenuItemOptions
+
+" menu context (should contain - as well, but no...)
+syn keyword etermMenuOptions contained title font_name sep
+
+syn region etermMenuContext fold transparent matchgroup=etermContext start="^\s*begin\s\+menu\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermMenuOptions,etermMenuItemContext
+
+" action context
+syn match etermActionDef contained "\<\(to\|string\|echo\|menu\|script\)\>"
+syn region etermActionsOptions contained transparent oneline matchgroup=etermOption start="^\s*bind\>" end="$" contains=etermActionDef,etermKeyMod
+
+syn region etermActionsContext fold transparent matchgroup=etermContext start="^\s*begin\s\+actions\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermActionsOptions
+
+" button bar context
+syn match etermButtonDef contained "\<\(action\|string\|echo\|menu\|scrupt\)\>"
+syn region etermButtonOptions contained transparent oneline matchgroup=etermOption start="^\s*button\>" end="$" contains=etermButtonDef
+syn keyword etermButtonOptions contained font visible dock
+
+syn region etermButtonContext fold transparent matchgroup=etermContext start="^\s*begin\s\+button_bar\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermButtonOptions
+
+" multichar context
+syn keyword etermMultiOptions contained encoding font
+
+syn region etermMultiContext fold transparent matchgroup=etermContext start="^\s*begin\s\+multichar\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermMultiOptions
+
+" xim context
+syn keyword etermXimOptions contained input_method preedit_type
+
+syn region etermXimContext fold transparent matchgroup=etermContext start="^\s*begin\s\+xim\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermXimOptions
+
+" toggles context
+syn keyword etermTogOptions contained map_alert visual_bell login_shell scrollbar utmp_logging meta8 iconic no_input
+syn keyword etermTogOptions contained home_on_output home_on_input scrollbar_floating scrollbar_right scrollbar_popup
+syn keyword etermTogOptions contained borderless double_buffer no_cursor pause xterm_select select_line
+syn keyword etermTogOptions contained select_trailing_spaces report_as_keysyms itrans immotile_trans buttonbar
+syn keyword etermTogOptions contained resize_gravity
+
+syn region etermTogContext fold transparent matchgroup=etermContext start="^\s*begin\s\+toggles\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermTogOptions
+
+" keyboard context
+syn keyword etermKeyboardOptions contained smallfont_key bigfont_key keysym meta_mod alt_mod
+syn keyword etermKeyboardOptions contained greek numlock_mod app_keypad app_cursor
+
+syn region etermKeyboardContext fold transparent matchgroup=etermContext start="^\s*begin\s\+keyboard\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermKeyboardOptions
+
+" misc context
+syn keyword etermMiscOptions contained print_pipe save_lines cut_chars min_anchor_size
+syn keyword etermMiscOptions contained border_width line_space finished_title term_name
+syn keyword etermMiscOptions contained finished_text exec
+
+syn region etermMiscContext fold transparent matchgroup=etermContext start="^\s*begin\s\+misc\s*$" end="^\s*end\>\(\s\+.\{-0,}\)\=$" contains=@etermGeneral,etermMiscOptions
+
+if exists("eterm_minlines")
+ let b:eterm_minlines = eterm_minlines
+else
+ let b:eterm_minlines = 30
+endif
+exec "syn sync minlines=" . b:eterm_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_eterm_syn_inits")
+ if version < 508
+ let did_eterm_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink etermMagic Special
+ HiLink etermComment Comment
+ HiLink etermTodo Todo
+ HiLink etermNumber Number
+ HiLink etermString String
+ HiLink etermBoolean Boolean
+ HiLink etermColor Number
+ HiLink etermPreProc PreProc
+ HiLink etermFunctions Function
+ HiLink etermKeyMod Special
+ HiLink etermContext Keyword
+ HiLink etermOption Keyword
+ HiLink etermType Type
+ HiLink etermColorOptions Keyword
+ HiLink etermAttrOptions Keyword
+ HiLink etermIClassOptions Keyword
+ HiLink etermImageTypes Type
+ HiLink etermImageModes Type
+ HiLink etermImageModesAllow Keyword
+ HiLink etermImageOptions Keyword
+ HiLink etermMenuOptions Keyword
+ HiLink etermMenuItemOptions Keyword
+ HiLink etermActionDef Type
+ HiLink etermActionsOptions Keyword
+ HiLink etermButtonDef Type
+ HiLink etermButtonOptions Keyword
+ HiLink etermMultiOptions Keyword
+ HiLink etermXimOptions Keyword
+ HiLink etermTogOptions Keyword
+ HiLink etermKeyboardOptions Keyword
+ HiLink etermMiscOptions Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "eterm"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/exim.vim b/runtime/syntax/exim.vim
new file mode 100644
index 000000000..ff8066f8a
--- /dev/null
+++ b/runtime/syntax/exim.vim
@@ -0,0 +1,117 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: Exim configuration file exim.conf
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-10-15
+" URL: http://trific.ath.cx/Ftp/vim/syntax/exim.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+syn case match
+
+" Base constructs
+syn match eximComment "^\s*#.*$" contains=eximFixme
+syn match eximComment "\s#.*$" contains=eximFixme
+syn keyword eximFixme FIXME TODO XXX NOT contained
+syn keyword eximConstant true false yes no
+syn match eximNumber "\<\d\+[KM]\?\>"
+syn match eximNumber "\<0[xX]\x\+\>"
+syn match eximNumber "\<\d\+\(\.\d\{,3}\)\?\>"
+syn match eximTime "\<\(\d\+[wdhms]\)\+\>"
+syn match eximSpecialChar "\\[\\nrt]\|\\\o\{1,3}\|\\x\x\{1,2}"
+syn region eximMacroDefinition matchgroup=eximMacroName start="^[A-Z]\i*\s*=" end="$" skip="\\\s*$" transparent
+
+syn match eximDriverName "\<\(aliasfile\|appendfile\|autoreply\|domainlist\|forwardfile\|ipliteral\|iplookup\|lmtp\|localuser\|lookuphost\|pipe\|queryprogram\|smartuser\|smtp\)\>"
+syn match eximTransport "^\s*\i\+:"
+
+" Options
+syn keyword eximEnd end
+syn keyword eximKeyword accept_8bitmime accept_timeout admin_groups allow_mx_to_ip always_bcc auth_always_advertise auth_hosts auth_over_tls_hosts auto_thaw bi_command check_log_inodes check_log_space check_spool_inodes check_spool_space collapse_source_routes daemon_smtp_port daemon_smtp_service debug_level delay_warning delay_warning_condition deliver_load_max deliver_queue_load_max delivery_date_remove dns_again_means_nonexist dns_check_names dns_check_names_pattern dns_retrans dns_ipv4_lookup dns_retry envelope_to_remove errmsg_text errmsg_file errors_address errors_copy errors_reply_to exim_group exim_path exim_user extract_addresses_remove_arguments finduser_retries forbid_domain_literals freeze_tell_mailmaster gecos_name gecos_pattern headers_check_syntax headers_checks_fail headers_sender_verify headers_sender_verify_errmsg helo_accept_junk_hosts helo_strict_syntax helo_verify hold_domains host_accept_relay host_auth_accept_relay host_lookup host_reject host_reject_recipients hosts_treat_as_local ignore_errmsg_errors ignore_errmsg_errors_after ignore_fromline_hosts ignore_fromline_local keep_malformed kill_ip_options ldap_default_servers local_domains local_domains_include_host local_domains_include_host_literals local_from_check local_from_prefix local_from_suffix local_interfaces localhost_number locally_caseless log_all_parents log_arguments log_file_path log_incoming_port log_ip_options log_level log_queue_run_level log_received_recipients log_received_sender log_refused_recipients log_rewrites log_sender_on_delivery log_smtp_confirmation log_smtp_connections log_smtp_syntax_errors log_subject lookup_open_max max_username_length message_body_visible message_filter message_filter_directory_transport message_filter_directory2_transport message_filter_file_transport message_filter_group message_filter_pipe_transport message_filter_reply_transport message_filter_user message_id_header_text message_size_limit message_size_limit_count_recipients move_frozen_messages mysql_servers never_users nobody_group nobody_user percent_hack_domains perl_at_start perl_startup pgsql_servers pid_file_path preserve_message_logs primary_hostname print_topbitchars prod_requires_admin prohibition_message qualify_domain qualify_recipient queue_list_requires_admin queue_only queue_only_file queue_only_load queue_remote_domains queue_run_in_order queue_run_max queue_smtp_domains rbl_domains rbl_hosts rbl_log_headers rbl_log_rcpt_count rbl_reject_recipients rbl_warn_header received_header_text received_headers_max receiver_try_verify receiver_unqualified_hosts receiver_verify receiver_verify_addresses receiver_verify_hosts receiver_verify_senders recipients_max recipients_max_reject recipients_reject_except recipients_reject_except_senders refuse_ip_options relay_domains relay_domains_include_local_mx relay_match_host_or_sender remote_max_parallel remote_sort retry_data_expire retry_interval_max return_path_remove return_size_limit rfc1413_hosts rfc1413_query_timeout security sender_address_relay sender_address_relay_hosts sender_reject sender_reject_recipients sender_try_verify sender_unqualified_hosts sender_verify sender_verify_batch sender_verify_callback_domains sender_verify_callback_timeout sender_verify_fixup sender_verify_hosts sender_verify_hosts_callback sender_verify_max_retry_rate sender_verify_reject smtp_accept_keepalive smtp_accept_max smtp_accept_max_per_host smtp_accept_queue smtp_accept_queue_per_connection smtp_accept_reserve smtp_banner smtp_check_spool_space smtp_connect_backlog smtp_etrn_command smtp_etrn_hosts smtp_etrn_serialize smtp_expn_hosts smtp_load_reserve smtp_receive_timeout smtp_reserve_hosts smtp_verify split_spool_directory spool_directory strip_excess_angle_brackets strip_trailing_dot syslog_timestamp timeout_frozen_after timestamps_utc timezone tls_advertise_hosts tls_certificate tls_dhparam tls_host_accept_relay tls_hosts tls_log_cipher tls_log_peerdn tls_privatekey tls_verify_certificates tls_verify_ciphers tls_verify_hosts trusted_groups trusted_users unknown_login unknown_username untrusted_set_sender uucp_from_pattern uucp_from_sender warnmsg_file
+syn keyword eximKeyword no_accept_8bitmime no_allow_mx_to_ip no_always_bcc no_auth_always_advertise no_collapse_source_routes no_delivery_date_remove no_dns_check_names no_envelope_to_remove no_extract_addresses_remove_arguments no_forbid_domain_literals no_freeze_tell_mailmaster no_headers_check_syntax no_headers_checks_fail no_headers_sender_verify no_headers_sender_verify_errmsg no_helo_strict_syntax no_ignore_errmsg_errors no_ignore_fromline_local no_kill_ip_options no_local_domains_include_host no_local_domains_include_host_literals no_local_from_check no_locally_caseless no_log_all_parents no_log_arguments no_log_incoming_port no_log_ip_options no_log_received_recipients no_log_received_sender no_log_refused_recipients no_log_rewrites no_log_sender_on_delivery no_log_smtp_confirmation no_log_smtp_connections no_log_smtp_syntax_errors no_log_subject no_message_size_limit_count_recipients no_move_frozen_messages no_preserve_message_logs no_print_topbitchars no_prod_requires_admin no_queue_list_requires_admin no_queue_only no_rbl_log_headers no_rbl_log_rcpt_count no_rbl_reject_recipients no_receiver_try_verify no_receiver_verify no_recipients_max_reject no_refuse_ip_options no_relay_domains_include_local_mx no_relay_match_host_or_sender no_return_path_remove no_sender_try_verify no_sender_verify no_sender_verify_batch no_sender_verify_fixup no_sender_verify_reject no_smtp_accept_keepalive no_smtp_check_spool_space no_smtp_etrn_serialize no_smtp_verify no_split_spool_directory no_strip_excess_angle_brackets no_strip_trailing_dot no_syslog_timestamp no_timestamps_utc no_tls_log_cipher no_tls_log_peerdn no_untrusted_set_sender
+syn keyword eximKeyword not_accept_8bitmime not_allow_mx_to_ip not_always_bcc not_auth_always_advertise not_collapse_source_routes not_delivery_date_remove not_dns_check_names not_envelope_to_remove not_extract_addresses_remove_arguments not_forbid_domain_literals not_freeze_tell_mailmaster not_headers_check_syntax not_headers_checks_fail not_headers_sender_verify not_headers_sender_verify_errmsg not_helo_strict_syntax not_ignore_errmsg_errors not_ignore_fromline_local not_kill_ip_options not_local_domains_include_host not_local_domains_include_host_literals not_local_from_check not_locally_caseless not_log_all_parents not_log_arguments not_log_incoming_port not_log_ip_options not_log_received_recipients not_log_received_sender not_log_refused_recipients not_log_rewrites not_log_sender_on_delivery not_log_smtp_confirmation not_log_smtp_connections not_log_smtp_syntax_errors not_log_subject not_message_size_limit_count_recipients not_move_frozen_messages not_preserve_message_logs not_print_topbitchars not_prod_requires_admin not_queue_list_requires_admin not_queue_only not_rbl_log_headers not_rbl_log_rcpt_count not_rbl_reject_recipients not_receiver_try_verify not_receiver_verify not_recipients_max_reject not_refuse_ip_options not_relay_domains_include_local_mx not_relay_match_host_or_sender not_return_path_remove not_sender_try_verify not_sender_verify not_sender_verify_batch not_sender_verify_fixup not_sender_verify_reject not_smtp_accept_keepalive not_smtp_check_spool_space not_smtp_etrn_serialize not_smtp_verify not_split_spool_directory not_strip_excess_angle_brackets not_strip_trailing_dot not_syslog_timestamp not_timestamps_utc not_tls_log_cipher not_tls_log_peerdn not_untrusted_set_sender
+syn keyword eximKeyword body_only debug_print delivery_date_add driver envelope_to_add headers_add headers_only headers_remove headers_rewrite message_size_limit return_path return_path_add shadow_condition shadow_transport transport_filter
+syn keyword eximKeyword no_body_only no_delivery_date_add no_envelope_to_add no_headers_only no_return_path_add
+syn keyword eximKeyword not_body_only not_delivery_date_add not_envelope_to_add not_headers_only not_return_path_add
+syn keyword eximKeyword allow_fifo allow_symlink batch batch_max bsmtp bsmtp_helo check_group check_owner check_string create_directory create_file current_directory directory directory_mode escape_string file file_format file_must_exist from_hack group lock_fcntl_timeout lock_interval lock_retries lockfile_mode lockfile_timeout maildir_format maildir_retries maildir_tag mailstore_format mailstore_prefix mailstore_suffix mbx_format mode mode_fail_narrower notify_comsat prefix quota quota_filecount quota_is_inclusive quota_size_regex quota_warn_message quota_warn_threshold require_lockfile retry_use_local_part suffix use_crlf use_fcntl_lock use_lockfile use_mbx_lock user
+syn keyword eximKeyword no_allow_fifo no_allow_symlink no_bsmtp_helo no_check_group no_check_owner no_create_directory no_file_must_exist no_from_hack no_maildir_format no_mailstore_format no_mbx_format no_mode_fail_narrower no_notify_comsat no_quota_is_inclusive no_require_lockfile no_retry_use_local_part no_use_crlf no_use_fcntl_lock no_use_lockfile no_use_mbx_lock
+syn keyword eximKeyword not_allow_fifo not_allow_symlink not_bsmtp_helo not_check_group not_check_owner not_create_directory not_file_must_exist not_from_hack not_maildir_format not_mailstore_format not_mbx_format not_mode_fail_narrower not_notify_comsat not_quota_is_inclusive not_require_lockfile not_retry_use_local_part not_use_crlf not_use_fcntl_lock not_use_lockfile not_use_mbx_lock
+syn keyword eximKeyword bcc cc file file_expand file_optional from group headers initgroups log mode once once_file_size once_repeat reply_to return_message subject text to user
+syn keyword eximKeyword no_file_expand no_file_optional no_initgroups no_return_message
+syn keyword eximKeyword not_file_expand not_file_optional not_initgroups not_return_message
+syn keyword eximKeyword batch batch_max command group initgroups retry_use_local_part timeout user
+syn keyword eximKeyword no_initgroups
+syn keyword eximKeyword not_initgroups
+syn keyword eximKeyword allow_commands batch batch_max bsmtp bsmtp_helo check_string command current_directory environment escape_string freeze_exec_fail from_hack group home_directory ignore_status initgroups log_defer_output log_fail_output log_output max_output path pipe_as_creator prefix restrict_to_path retry_use_local_part return_fail_output return_output suffix temp_errors timeout umask use_crlf use_shell user
+syn keyword eximKeyword no_bsmtp_helo no_freeze_exec_fail no_from_hack no_ignore_status no_log_defer_output no_log_fail_output no_log_output no_pipe_as_creator no_restrict_to_path no_return_fail_output no_return_output no_use_crlf no_use_shell
+syn keyword eximKeyword not_bsmtp_helo not_freeze_exec_fail not_from_hack not_ignore_status not_log_defer_output not_log_fail_output not_log_output not_pipe_as_creator not_restrict_to_path not_return_fail_output not_return_output not_use_crlf not_use_shell
+syn keyword eximKeyword allow_localhost authenticate_hosts batch_max command_timeout connect_timeout data_timeout delay_after_cutoff dns_qualify_single dns_search_parents fallback_hosts final_timeout gethostbyname helo_data hosts hosts_avoid_tls hosts_require_tls hosts_override hosts_max_try hosts_randomize interface keepalive max_rcpt multi_domain mx_domains port protocol retry_include_ip_address serialize_hosts service size_addition tls_certificate tls_privatekey tls_verify_certificates tls_verify_ciphers
+syn keyword eximKeyword no_allow_localhost no_delay_after_cutoff no_dns_qualify_single no_dns_search_parents no_gethostbyname no_hosts_override no_hosts_randomize no_keepalive no_multi_domain no_retry_include_ip_address
+syn keyword eximKeyword not_allow_localhost not_delay_after_cutoff not_dns_qualify_single not_dns_search_parents not_gethostbyname not_hosts_override not_hosts_randomize not_keepalive not_multi_domain not_retry_include_ip_address
+syn keyword eximKeyword condition debug_print domains driver errors_to fail_verify fail_verify_recipient fail_verify_sender fallback_hosts group headers_add headers_remove initgroups local_parts more require_files senders transport unseen user verify verify_only verify_recipient verify_sender
+syn keyword eximKeyword no_fail_verify no_fail_verify_recipient no_fail_verify_sender no_initgroups no_more no_unseen no_verify no_verify_only no_verify_recipient no_verify_sender
+syn keyword eximKeyword not_fail_verify not_fail_verify_recipient not_fail_verify_sender not_initgroups not_more not_unseen not_verify not_verify_only not_verify_recipient not_verify_sender
+syn keyword eximKeyword current_directory expn home_directory new_director prefix prefix_optional suffix suffix_optional
+syn keyword eximKeyword no_expn no_prefix_optional no_suffix_optional
+syn keyword eximKeyword not_expn not_prefix_optional not_suffix_optional
+syn keyword eximKeyword check_ancestor directory_transport directory2_transport file_transport forbid_file forbid_include forbid_pipe freeze_missing_include hide_child_in_errmsg modemask one_time owners owngroups pipe_transport qualify_preserve_domain rewrite skip_syntax_errors syntax_errors_text syntax_errors_to
+syn keyword eximKeyword no_check_ancestor no_forbid_file no_forbid_include no_forbid_pipe no_freeze_missing_include no_hide_child_in_errmsg no_one_time no_qualify_preserve_domain no_rewrite no_skip_syntax_errors
+syn keyword eximKeyword not_check_ancestor not_forbid_file not_forbid_include not_forbid_pipe not_freeze_missing_include not_hide_child_in_errmsg not_one_time not_qualify_preserve_domain not_rewrite not_skip_syntax_errors
+syn keyword eximKeyword expand file forbid_special include_domain optional queries query search_type
+syn keyword eximKeyword no_expand no_forbid_special no_include_domain no_optional
+syn keyword eximKeyword not_expand not_forbid_special not_include_domain not_optional
+syn keyword eximKeyword allow_system_actions check_group check_local_user data file file_directory filter forbid_filter_existstest forbid_filter_logwrite forbid_filter_lookup forbid_filter_perl forbid_filter_reply ignore_eacces ignore_enotdir match_directory reply_transport seteuid
+syn keyword eximKeyword no_allow_system_actions no_check_local_user no_forbid_filter_reply no_forbid_filter_existstest no_forbid_filter_logwrite no_forbid_filter_lookup no_forbid_filter_perl no_forbid_filter_reply no_ignore_eacces no_ignore_enotdir no_seteuid
+syn keyword eximKeyword not_allow_system_actions not_check_local_user not_forbid_filter_reply not_forbid_filter_existstest not_forbid_filter_logwrite not_forbid_filter_lookup not_forbid_filter_perl not_forbid_filter_reply not_ignore_eacces not_ignore_enotdir not_seteuid
+syn keyword eximKeyword match_directory
+syn keyword eximKeyword directory_transport directory2_transport file_transport forbid_file forbid_pipe hide_child_in_errmsg new_address panic_expansion_fail pipe_transport qualify_preserve_domain rewrite
+syn keyword eximKeyword no_forbid_file no_forbid_pipe no_hide_child_in_errmsg no_panic_expansion_fail no_qualify_preserve_domain no_rewrite
+syn keyword eximKeyword not_forbid_file not_forbid_pipe not_hide_child_in_errmsg not_panic_expansion_fail not_qualify_preserve_domain not_rewrite
+syn keyword eximKeyword ignore_target_hosts pass_on_timeout self translate_ip_address
+syn keyword eximKeyword no_pass_on_timeout
+syn keyword eximKeyword not_pass_on_timeout
+syn keyword eximKeyword host_find_failed hosts_randomize modemask owners owngroups qualify_single route_file route_list route_queries route_query search_parents search_type
+syn keyword eximKeyword no_hosts_randomize no_qualify_single no_search_parents
+syn keyword eximKeyword not_hosts_randomize not_qualify_single not_search_parents
+syn keyword eximKeyword hosts optional port protocol query reroute response_pattern service timeout
+syn keyword eximKeyword no_optional
+syn keyword eximKeyword not_optional
+syn keyword eximKeyword check_secondary_mx gethostbyname mx_domains qualify_single rewrite_headers search_parents widen_domains
+syn keyword eximKeyword no_check_secondary_mx no_gethostbyname no_qualify_single no_search_parents
+syn keyword eximKeyword not_check_secondary_mx not_gethostbyname not_qualify_single not_search_parents
+syn keyword eximKeyword command command_group command_user current_directory timeout
+syn keyword eximKeyword driver public_name server_set_id server_mail_auth_condition
+syn keyword eximKeyword server_prompts server_condition client_send
+syn keyword eximKeyword server_secret client_name client_secret
+
+" Define the default highlighting
+if version >= 508 || !exists("did_exim_syntax_inits")
+ if version < 508
+ let did_exim_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink eximComment Comment
+ HiLink eximFixme Todo
+ HiLink eximEnd Keyword
+ HiLink eximNumber Number
+ HiLink eximDriverName Constant
+ HiLink eximConstant Constant
+ HiLink eximTime Constant
+ HiLink eximKeyword Type
+ HiLink eximSpecialChar Special
+ HiLink eximMacroName Preproc
+ HiLink eximTransport Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "exim"
diff --git a/runtime/syntax/expect.vim b/runtime/syntax/expect.vim
new file mode 100644
index 000000000..1886e2b3e
--- /dev/null
+++ b/runtime/syntax/expect.vim
@@ -0,0 +1,113 @@
+" Vim syntax file
+" Language: Expect
+" Maintainer: Ralph Jennings <knowbudy@oro.net>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Reserved Expect variable prefixes.
+syn match expectVariables "\$exp[a-zA-Z0-9_]*\|\$inter[a-zA-Z0-9_]*"
+syn match expectVariables "\$spawn[a-zA-Z0-9_]*\|\$timeout[a-zA-Z0-9_]*"
+
+" Normal Expect variables.
+syn match expectVariables "\$env([^)]*)"
+syn match expectVariables "\$any_spawn_id\|\$argc\|\$argv\d*"
+syn match expectVariables "\$user_spawn_id\|\$spawn_id\|\$timeout"
+
+" Expect variable arrays.
+syn match expectVariables "\$\(expect\|interact\)_out([^)]*)" contains=expectOutVar
+
+" User defined variables.
+syn match expectVariables "\$[a-zA-Z_][a-zA-Z0-9_]*"
+
+" Reserved Expect command prefixes.
+syn match expectCommand "exp_[a-zA-Z0-9_]*"
+
+" Normal Expect commands.
+syn keyword expectStatement close debug disconnect
+syn keyword expectStatement exit exp_continue exp_internal exp_open
+syn keyword expectStatement exp_pid exp_version
+syn keyword expectStatement fork inter_return interpreter
+syn keyword expectStatement log_file log_user match_max overlay
+syn keyword expectStatement parity remove_nulls return
+syn keyword expectStatement send send_error send_log send_user
+syn keyword expectStatement sleep spawn strace stty system
+syn keyword expectStatement timestamp trace trap wait
+
+" Tcl commands recognized and used by Expect.
+syn keyword expectCommand proc
+syn keyword expectConditional if else
+syn keyword expectRepeat while for foreach
+
+" Expect commands with special arguments.
+syn keyword expectStatement expect expect_after expect_background nextgroup=expectExpectOpts
+syn keyword expectStatement expect_before expect_user interact nextgroup=expectExpectOpts
+
+syn match expectSpecial contained "\\."
+
+" Options for "expect", "expect_after", "expect_background",
+" "expect_before", "expect_user", and "interact".
+syn keyword expectExpectOpts default eof full_buffer null return timeout
+
+syn keyword expectOutVar contained spawn_id seconds seconds_total
+syn keyword expectOutVar contained string start end buffer
+
+" Numbers (Tcl style).
+syn case ignore
+ syn match expectNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+ "floating point number, with dot, optional exponent
+ syn match expectNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+ "floating point number, starting with a dot, optional exponent
+ syn match expectNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+ "floating point number, without dot, with exponent
+ syn match expectNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
+ "hex number
+ syn match expectNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+ "syn match expectIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+
+syn region expectString start=+"+ end=+"+ contains=expectVariables,expectSpecial
+
+" Are these really comments in Expect? (I never use it, so I'm just guessing).
+syn keyword expectTodo contained TODO
+syn match expectComment "#.*$" contains=expectTodo
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_expect_syntax_inits")
+ if version < 508
+ let did_expect_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink expectVariables Special
+ HiLink expectCommand Function
+ HiLink expectStatement Statement
+ HiLink expectConditional Conditional
+ HiLink expectRepeat Repeat
+ HiLink expectExpectOpts Keyword
+ HiLink expectOutVar Special
+ HiLink expectSpecial Special
+ HiLink expectNumber Number
+
+ HiLink expectString String
+
+ HiLink expectComment Comment
+ HiLink expectTodo Todo
+ "HiLink expectIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "expect"
+
+" vim: ts=8
diff --git a/runtime/syntax/exports.vim b/runtime/syntax/exports.vim
new file mode 100644
index 000000000..d44cc9f78
--- /dev/null
+++ b/runtime/syntax/exports.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: exports
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 3
+" Notes: This file includes both SysV and BSD 'isms
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Options: -word
+syn keyword exportsKeyOptions contained alldirs nohide ro wsync
+syn keyword exportsKeyOptions contained kerb o rw
+syn match exportsOptError contained "[a-z]\+"
+
+" Settings: word=
+syn keyword exportsKeySettings contained access anon root rw
+syn match exportsSetError contained "[a-z]\+"
+
+" OptSet: -word=
+syn keyword exportsKeyOptSet contained mapall maproot mask network
+syn match exportsOptSetError contained "[a-z]\+"
+
+" options and settings
+syn match exportsSettings "[a-z]\+=" contains=exportsKeySettings,exportsSetError
+syn match exportsOptions "-[a-z]\+" contains=exportsKeyOptions,exportsOptError
+syn match exportsOptSet "-[a-z]\+=" contains=exportsKeyOptSet,exportsOptSetError
+
+" Separators
+syn match exportsSeparator "[,:]"
+
+" comments
+syn match exportsComment "^\s*#.*$" contains=@Spell
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_exports_syntax_inits")
+ if version < 508
+ let did_exports_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink exportsKeyOptSet exportsKeySettings
+ HiLink exportsOptSet exportsSettings
+
+ HiLink exportsComment Comment
+ HiLink exportsKeyOptions Type
+ HiLink exportsKeySettings Keyword
+ HiLink exportsOptions Constant
+ HiLink exportsSeparator Constant
+ HiLink exportsSettings Constant
+
+ HiLink exportsOptError Error
+ HiLink exportsOptSetError Error
+ HiLink exportsSetError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "exports"
+" vim: ts=10
diff --git a/runtime/syntax/fasm.vim b/runtime/syntax/fasm.vim
new file mode 100644
index 000000000..01bdc8311
--- /dev/null
+++ b/runtime/syntax/fasm.vim
@@ -0,0 +1,145 @@
+" Vim syntax file
+" Language: Flat Assembler (FASM)
+" Maintainer: Ron Aaron <ron@ronware.org>
+" Last Change: 2004 May 16
+" Vim URL: http://www.vim.org/lang.html
+" FASM Home: http://flatassembler.net/
+" FASM Version: 1.52
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+setlocal iskeyword=a-z,A-Z,48-57,.,_
+setlocal isident=a-z,A-Z,48-57,.,_
+syn case ignore
+
+syn keyword fasmRegister ah al ax bh bl bp bx ch cl cr0 cr1 cr2 cr3 cr4 cr5 cr6
+syn keyword fasmRegister cr7 cs cx dh di dl dr0 dr1 dr2 dr3 dr4 dr5 dr6 dr7 ds dx
+syn keyword fasmRegister eax ebp ebx ecx edi edx es esi esp fs gs mm0 mm1 mm2 mm3
+syn keyword fasmRegister mm4 mm5 mm6 mm7 si sp ss st st0 st1 st2 st3 st4 st5 st6
+syn keyword fasmRegister st7 tr0 tr1 tr2 tr3 tr4 tr5 tr6 tr7 xmm0 xmm1 xmm2 xmm3
+syn keyword fasmRegister xmm4 xmm5 xmm6 xmm7
+syn keyword fasmAddressSizes byte dqword dword fword pword qword tword word
+syn keyword fasmDataDirectives db dd df dp dq dt du dw file rb rd rf rp rq rt rw
+syn keyword fasmInstr aaa aad aam aas adc add addpd addps addsd addss addsubpd
+syn keyword fasmInstr addsubps and andnpd andnps andpd andps arpl bound bsf bsr
+syn keyword fasmInstr bswap bt btc btr bts call cbw cdq clc cld clflush cli clts
+syn keyword fasmInstr cmc cmova cmovae cmovb cmovbe cmovc cmove cmovg cmovge cmovl
+syn keyword fasmInstr cmovle cmovna cmovnae cmovnb cmovnbe cmovnc cmovne cmovng
+syn keyword fasmInstr cmovnge cmovnl cmovnle cmovno cmovnp cmovns cmovnz cmovo cmovp
+syn keyword fasmInstr cmovpe cmovpo cmovs cmovz cmp cmpeqpd cmpeqps cmpeqsd cmpeqss
+syn keyword fasmInstr cmplepd cmpleps cmplesd cmpless cmpltpd cmpltps cmpltsd cmpltss
+syn keyword fasmInstr cmpneqpd cmpneqps cmpneqsd cmpneqss cmpnlepd cmpnleps cmpnlesd
+syn keyword fasmInstr cmpnless cmpnltpd cmpnltps cmpnltsd cmpnltss cmpordpd cmpordps
+syn keyword fasmInstr cmpordsd cmpordss cmppd cmpps cmps cmpsb cmpsd cmpss cmpsw
+syn keyword fasmInstr cmpunordpd cmpunordps cmpunordsd cmpunordss cmpxchg cmpxchg8b
+syn keyword fasmInstr comisd comiss cpuid cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps
+syn keyword fasmInstr cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi cvtsd2si cvtsd2ss
+syn keyword fasmInstr cvtsi2sd cvtsi2ss cvtss2sd cvtss2si cvttpd2dq cvttpd2pi cvttps2dq
+syn keyword fasmInstr cvttps2pi cvttsd2si cvttss2si cwd cwde daa das data dec div
+syn keyword fasmInstr divpd divps divsd divss else emms end enter extrn f2xm1 fabs
+syn keyword fasmInstr fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb
+syn keyword fasmInstr fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp
+syn keyword fasmInstr fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree
+syn keyword fasmInstr ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp
+syn keyword fasmInstr finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv
+syn keyword fasmInstr fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi
+syn keyword fasmInstr fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem
+syn keyword fasmInstr fprem1 fptan frndint frstor frstpm fsave fscale fsetpm fsin
+syn keyword fasmInstr fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr
+syn keyword fasmInstr fsubrp ftst fucom fucomi fucomip fucomp fucompp fwait fxam
+syn keyword fasmInstr fxch fxrstor fxsave fxtract fyl2x fyl2xp1 haddpd haddps heap
+syn keyword fasmInstr hlt hsubpd hsubps idiv if imul in inc ins insb insd insw int
+syn keyword fasmInstr int3 into invd invlpg iret iretd iretw ja jae jb jbe jc jcxz
+syn keyword fasmInstr je jecxz jg jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge
+syn keyword fasmInstr jnl jnle jno jnp jns jnz jo jp jpe jpo js jz lahf lar lddqu
+syn keyword fasmInstr ldmxcsr lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw
+syn keyword fasmInstr load loadall286 loadall386 lock lods lodsb lodsd lodsw loop
+syn keyword fasmInstr loopd loope looped loopew loopne loopned loopnew loopnz loopnzd
+syn keyword fasmInstr loopnzw loopw loopz loopzd loopzw lsl lss ltr maskmovdqu maskmovq
+syn keyword fasmInstr maxpd maxps maxsd maxss mfence minpd minps minsd minss monitor
+syn keyword fasmInstr mov movapd movaps movd movddup movdq2q movdqa movdqu movhlps
+syn keyword fasmInstr movhpd movhps movlhps movlpd movlps movmskpd movmskps movntdq
+syn keyword fasmInstr movnti movntpd movntps movntq movq movq2dq movs movsb movsd
+syn keyword fasmInstr movshdup movsldup movss movsw movsx movupd movups movzx mul
+syn keyword fasmInstr mulpd mulps mulsd mulss mwait neg nop not or org orpd orps
+syn keyword fasmInstr out outs outsb outsd outsw packssdw packsswb packuswb paddb
+syn keyword fasmInstr paddd paddq paddsb paddsw paddusb paddusw paddw pand pandn
+syn keyword fasmInstr pause pavgb pavgusb pavgw pcmpeqb pcmpeqd pcmpeqw pcmpgtb
+syn keyword fasmInstr pcmpgtd pcmpgtw pextrw pf2id pf2iw pfacc pfadd pfcmpeq pfcmpge
+syn keyword fasmInstr pfcmpgt pfmax pfmin pfmul pfnacc pfpnacc pfrcp pfrcpit1 pfrcpit2
+syn keyword fasmInstr pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pi2fw pinsrw pmaddwd pmaxsw
+syn keyword fasmInstr pmaxub pminsw pminub pmovmskb pmulhrw pmulhuw pmulhw pmullw
+syn keyword fasmInstr pmuludq pop popa popad popaw popd popf popfd popfw popw por
+syn keyword fasmInstr prefetch prefetchnta prefetcht0 prefetcht1 prefetcht2 prefetchw
+syn keyword fasmInstr psadbw pshufd pshufhw pshuflw pshufw pslld pslldq psllq psllw
+syn keyword fasmInstr psrad psraw psrld psrldq psrlq psrlw psubb psubd psubq psubsb
+syn keyword fasmInstr psubsw psubusb psubusw psubw pswapd punpckhbw punpckhdq punpckhqdq
+syn keyword fasmInstr punpckhwd punpcklbw punpckldq punpcklqdq punpcklwd push pusha
+syn keyword fasmInstr pushad pushaw pushd pushf pushfd pushfw pushw pxor rcl rcpps
+syn keyword fasmInstr rcpss rcr rdmsr rdpmc rdtsc rep repe repne repnz repz ret
+syn keyword fasmInstr retd retf retfd retfw retn retnd retnw retw rol ror rsm rsqrtps
+syn keyword fasmInstr rsqrtss sahf sal salc sar sbb scas scasb scasd scasw seta
+syn keyword fasmInstr setae setalc setb setbe setc sete setg setge setl setle setna
+syn keyword fasmInstr setnae setnb setnbe setnc setne setng setnge setnl setnle
+syn keyword fasmInstr setno setnp setns setnz seto setp setpe setpo sets setz sfence
+syn keyword fasmInstr sgdt shl shld shr shrd shufpd shufps sidt sldt smsw sqrtpd
+syn keyword fasmInstr sqrtps sqrtsd sqrtss stc std sti stmxcsr store stos stosb
+syn keyword fasmInstr stosd stosw str sub subpd subps subsd subss sysenter sysexit
+syn keyword fasmInstr test ucomisd ucomiss ud2 unpckhpd unpckhps unpcklpd unpcklps
+syn keyword fasmInstr verr verw wait wbinvd wrmsr xadd xchg xlat xlatb xor xorpd
+syn keyword fasmPreprocess common equ fix forward include local macro purge restore
+syn keyword fasmPreprocess reverse struc
+syn keyword fasmDirective align binary code coff console discardable display dll
+syn keyword fasmDirective elf entry executable export extern far fixups format gui
+syn keyword fasmDirective import label ms mz native near notpageable pe public readable
+syn keyword fasmDirective repeat resource section segment shareable stack times
+syn keyword fasmDirective use16 use32 virtual wdm writeable
+syn keyword fasmOperator as at defined eq eqtype from mod on ptr rva used
+
+syn match fasmNumericOperator "[+-/*]"
+syn match fasmLogicalOperator "[=|&~<>]\|<=\|>=\|<>"
+" numbers
+syn match fasmBinaryNumber "\<[01]\+b\>"
+syn match fasmHexNumber "\<\d\x*h\>"
+syn match fasmHexNumber "\<\(0x\|$\)\x*\>"
+syn match fasmFPUNumber "\<\d\+\(\.\d*\)\=\(e[-+]\=\d*\)\=\>"
+syn match fasmOctalNumber "\<\(0\o\+o\=\|\o\+o\)\>"
+syn match fasmDecimalNumber "\<\(0\|[1-9]\d*\)\>"
+syn region fasmComment start=";" end="$"
+syn region fasmString start="\"" end="\"\|$"
+syn region fasmString start="'" end="'\|$"
+syn match fasmSymbol "[()|\[\]:]"
+syn match fasmSpecial "[#?%$,]"
+syn match fasmLabel "^\s*[^; \t]\+:"
+
+hi def link fasmAddressSizes type
+hi def link fasmNumericOperator fasmOperator
+hi def link fasmLogicalOperator fasmOperator
+
+hi def link fasmBinaryNumber fasmNumber
+hi def link fasmHexNumber fasmNumber
+hi def link fasmFPUNumber fasmNumber
+hi def link fasmOctalNumber fasmNumber
+hi def link fasmDecimalNumber fasmNumber
+
+hi def link fasmSymbols fasmRegister
+hi def link fasmPreprocess fasmDirective
+
+" link to standard syn groups so the 'colorschemes' work:
+hi def link fasmOperator operator
+hi def link fasmComment comment
+hi def link fasmDirective preproc
+hi def link fasmRegister type
+hi def link fasmNumber constant
+hi def link fasmSymbol structure
+hi def link fasmString String
+hi def link fasmSpecial special
+hi def link fasmInstr keyword
+hi def link fasmLabel label
+hi def link fasmPrefix preproc
+let b:current_syntax = "fasm"
+" vim: ts=8 sw=8 :
diff --git a/runtime/syntax/fdcc.vim b/runtime/syntax/fdcc.vim
new file mode 100644
index 000000000..38717ebfb
--- /dev/null
+++ b/runtime/syntax/fdcc.vim
@@ -0,0 +1,114 @@
+" Vim syntax file
+" Language: fdcc or locale files
+" Maintainer: Dwayne Bailey <dwayne@translate.org.za>
+" Last Change: 2004 May 16
+" Remarks: FDCC (Formal Definitions of Cultural Conventions) see ISO TR 14652
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync minlines=150
+setlocal iskeyword+=-
+
+" Numbers
+syn match fdccNumber /[0-9]*/ contained
+
+" Unicode codings and strings
+syn match fdccUnicodeInValid /<[^<]*>/ contained
+syn match fdccUnicodeValid /<U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]>/ contained
+syn region fdccString start=/"/ end=/"/ contains=fdccUnicodeInValid,fdccUnicodeValid
+
+" Valid LC_ Keywords
+syn keyword fdccKeyword escape_char comment_char
+syn keyword fdccKeywordIdentification title source address contact email tel fax language territory revision date category
+syn keyword fdccKeywordCtype copy space translit_start include translit_end outdigit class
+syn keyword fdccKeywordCollate copy script order_start order_end collating-symbol reorder-after reorder-end collating-element symbol-equivalence
+syn keyword fdccKeywordMonetary copy int_curr_symbol currency_symbol mon_decimal_point mon_thousands_sep mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn int_p_cs_precedes int_p_sep_by_space int_n_cs_precedes int_n_sep_by_space int_p_sign_posn int_n_sign_posn
+syn keyword fdccKeywordNumeric copy decimal_point thousands_sep grouping
+syn keyword fdccKeywordTime copy abday day abmon mon d_t_fmt d_fmt t_fmt am_pm t_fmt_ampm date_fmt era_d_fmt first_weekday first_workday week cal_direction time_zone era alt_digits era_d_t_fmt
+syn keyword fdccKeywordMessages copy yesexpr noexpr yesstr nostr
+syn keyword fdccKeywordPaper copy height width
+syn keyword fdccKeywordTelephone copy tel_int_fmt int_prefix tel_dom_fmt int_select
+syn keyword fdccKeywordMeasurement copy measurement
+syn keyword fdccKeywordName copy name_fmt name_gen name_mr name_mrs name_miss name_ms
+syn keyword fdccKeywordAddress copy postal_fmt country_name country_post country_ab2 country_ab3 country_num country_car country_isbn lang_name lang_ab lang_term lang_lib
+
+" Comments
+syn keyword fdccTodo TODO FIXME contained
+syn match fdccVariable /%[a-zA-Z]/ contained
+syn match fdccComment /[#%].*/ contains=fdccTodo,fdccVariable
+
+" LC_ Groups
+syn region fdccBlank matchgroup=fdccLCIdentification start=/^LC_IDENTIFICATION$/ end=/^END LC_IDENTIFICATION$/ contains=fdccKeywordIdentification,fdccString,fdccComment
+syn region fdccBlank matchgroup=fdccLCCtype start=/^LC_CTYPE$/ end=/^END LC_CTYPE$/ contains=fdccKeywordCtype,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
+syn region fdccBlank matchgroup=fdccLCCollate start=/^LC_COLLATE$/ end=/^END LC_COLLATE$/ contains=fdccKeywordCollate,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
+syn region fdccBlank matchgroup=fdccLCMonetary start=/^LC_MONETARY$/ end=/^END LC_MONETARY$/ contains=fdccKeywordMonetary,fdccString,fdccComment,fdccNumber
+syn region fdccBlank matchgroup=fdccLCNumeric start=/^LC_NUMERIC$/ end=/^END LC_NUMERIC$/ contains=fdccKeywordNumeric,fdccString,fdccComment,fdccNumber
+syn region fdccBlank matchgroup=fdccLCTime start=/^LC_TIME$/ end=/^END LC_TIME$/ contains=fdccKeywordTime,fdccString,fdccComment,fdccNumber
+syn region fdccBlank matchgroup=fdccLCMessages start=/^LC_MESSAGES$/ end=/^END LC_MESSAGES$/ contains=fdccKeywordMessages,fdccString,fdccComment
+syn region fdccBlank matchgroup=fdccLCPaper start=/^LC_PAPER$/ end=/^END LC_PAPER$/ contains=fdccKeywordPaper,fdccString,fdccComment,fdccNumber
+syn region fdccBlank matchgroup=fdccLCTelephone start=/^LC_TELEPHONE$/ end=/^END LC_TELEPHONE$/ contains=fdccKeywordTelephone,fdccString,fdccComment
+syn region fdccBlank matchgroup=fdccLCMeasurement start=/^LC_MEASUREMENT$/ end=/^END LC_MEASUREMENT$/ contains=fdccKeywordMeasurement,fdccString,fdccComment,fdccNumber
+syn region fdccBlank matchgroup=fdccLCName start=/^LC_NAME$/ end=/^END LC_NAME$/ contains=fdccKeywordName,fdccString,fdccComment
+syn region fdccBlank matchgroup=fdccLCAddress start=/^LC_ADDRESS$/ end=/^END LC_ADDRESS$/ contains=fdccKeywordAddress,fdccString,fdccComment,fdccNumber
+
+
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_fdcc_syn_inits")
+ if version < 508
+ let did_fdcc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink fdccBlank Blank
+
+ HiLink fdccTodo Todo
+ HiLink fdccComment Comment
+ HiLink fdccVariable Type
+
+ HiLink fdccLCIdentification Statement
+ HiLink fdccLCCtype Statement
+ HiLink fdccLCCollate Statement
+ HiLink fdccLCMonetary Statement
+ HiLink fdccLCNumeric Statement
+ HiLink fdccLCTime Statement
+ HiLink fdccLCMessages Statement
+ HiLink fdccLCPaper Statement
+ HiLink fdccLCTelephone Statement
+ HiLink fdccLCMeasurement Statement
+ HiLink fdccLCName Statement
+ HiLink fdccLCAddress Statement
+
+ HiLink fdccUnicodeInValid Error
+ HiLink fdccUnicodeValid String
+ HiLink fdccString String
+ HiLink fdccNumber Blank
+
+ HiLink fdccKeywordIdentification fdccKeyword
+ HiLink fdccKeywordCtype fdccKeyword
+ HiLink fdccKeywordCollate fdccKeyword
+ HiLink fdccKeywordMonetary fdccKeyword
+ HiLink fdccKeywordNumeric fdccKeyword
+ HiLink fdccKeywordTime fdccKeyword
+ HiLink fdccKeywordMessages fdccKeyword
+ HiLink fdccKeywordPaper fdccKeyword
+ HiLink fdccKeywordTelephone fdccKeyword
+ HiLink fdccKeywordMeasurement fdccKeyword
+ HiLink fdccKeywordName fdccKeyword
+ HiLink fdccKeywordAddress fdccKeyword
+ HiLink fdccKeyword Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fdcc"
+
+" vim: ts=8
diff --git a/runtime/syntax/fetchmail.vim b/runtime/syntax/fetchmail.vim
new file mode 100644
index 000000000..c586ee7c5
--- /dev/null
+++ b/runtime/syntax/fetchmail.vim
@@ -0,0 +1,88 @@
+" Vim syntax file
+" Language: fetchmail(1) RC File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/fetchmail/
+" Latest Revision: 2004-05-06
+" arch-tag: 59d8adac-6e59-45f6-88cb-f9ba1e009c1f
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" todo
+syn keyword fetchmailTodo contained FIXME TODO XXX NOTE
+
+" comments
+syn region fetchmailComment start="#" end="$" contains=fetchmailTodo
+
+" numbers
+syn match fetchmailNumber "\<\d\+\>"
+
+" strings
+syn region fetchmailString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=fetchmailStringEsc
+syn region fetchmailString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=fetchmailStringEsc
+
+" escape characters in strings
+syn match fetchmailStringEsc "\\\([ntb]\|0\d*\|x\x\+\)"
+
+" server entries
+syn region fetchmailKeyword transparent matchgroup=fetchmailKeyword start="\<poll\|skip\|defaults\>" end="\<poll\|skip\|defaults\>" contains=ALLBUT,fetchmailOptions,fetchmailSet
+
+" server options
+syn keyword fetchmailServerOpts contained via proto[col] local[domains] port auth[enticate]
+syn keyword fetchmailServerOpts contained timeout envelope qvirtual aka interface monitor
+syn keyword fetchmailServerOpts contained plugin plugout dns checkalias uidl interval netsec
+syn keyword fetchmailServerOpts contained principal esmtpname esmtppassword
+syn match fetchmailServerOpts contained "\<no\_s\+\(envelope\|dns\|checkalias\|uidl\)"
+
+" user options
+syn keyword fetchmailUserOpts contained user[name] is to pass[word] ssl sslcert sslkey sslproto folder
+syn keyword fetchmailUserOpts contained smtphost fetchdomains smtpaddress smtpname antispam mda bsmtp
+syn keyword fetchmailUserOpts contained preconnect postconnect keep flush fetchall rewrite stripcr
+syn keyword fetchmailUserOpts contained forcecr pass8bits dropstatus dropdelivered mimedecode idle
+syn keyword fetchmailUserOpts contained limit warnings batchlimit fetchlimit expunge tracepolls properties
+syn match fetchmailUserOpts contained "\<no\_s\+\(keep\|flush\|fetchall\|rewrite\|stripcr\|forcecr\|pass8bits\|dropstatus\|dropdelivered\|mimedecode\|noidle\)"
+
+syn keyword fetchmailSpecial contained here there
+
+
+" noise keywords
+syn keyword fetchmailNoise and with has wants options
+syn match fetchmailNoise "[:;,]"
+
+" options
+syn keyword fetchmailSet nextgroup=fetchmailOptions skipwhite skipnl set
+
+syn keyword fetchmailOptions daemon postmaster bouncemail spambounce logfile idfile syslog nosyslog properties
+syn match fetchmailOptions "\<no\_s\+\(bouncemail\|spambounce\)"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_fetchmail_syn_inits")
+ if version < 508
+ let did_fetchmail_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink fetchmailComment Comment
+ HiLink fetchmailTodo Todo
+ HiLink fetchmailNumber Number
+ HiLink fetchmailString String
+ HiLink fetchmailStringEsc SpecialChar
+ HiLink fetchmailKeyword Keyword
+ HiLink fetchmailServerOpts Identifier
+ HiLink fetchmailUserOpts Identifier
+ HiLink fetchmailSpecial Special
+ HiLink fetchmailSet Keyword
+ HiLink fetchmailOptions Identifier
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fetchmail"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/fgl.vim b/runtime/syntax/fgl.vim
new file mode 100644
index 000000000..1b2fe19a8
--- /dev/null
+++ b/runtime/syntax/fgl.vim
@@ -0,0 +1,147 @@
+" Vim syntax file
+" Language: Informix 4GL
+" Maintainer: Rafal M. Sulejman <rms@poczta.onet.pl>
+" Update: 26 Sep 2002
+" Changes:
+" - Dynamic 4GL/FourJs/4GL 7.30 pseudo comment directives (Julian Bridle)
+" - Conditionally allow case insensitive keywords (Julian Bridle)
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if exists("fgl_ignore_case")
+ syntax case ignore
+else
+ syntax case match
+endif
+syn keyword fglKeyword ABORT ABS ABSOLUTE ACCEPT ACCESS ACOS ADD AFTER ALL
+syn keyword fglKeyword ALLOCATE ALTER AND ANSI ANY APPEND ARG_VAL ARRAY ARR_COUNT
+syn keyword fglKeyword ARR_CURR AS ASC ASCENDING ASCII ASIN AT ATAN ATAN2 ATTACH
+syn keyword fglKeyword ATTRIBUTE ATTRIBUTES AUDIT AUTHORIZATION AUTO AUTONEXT AVERAGE AVG
+syn keyword fglKeyword BEFORE BEGIN BETWEEN BLACK BLINK BLUE BOLD BORDER BOTH BOTTOM
+syn keyword fglKeyword BREAK BUFFERED BY BYTE
+syn keyword fglKeyword CALL CASCADE CASE CHAR CHARACTER CHARACTER_LENGTH CHAR_LENGTH
+syn keyword fglKeyword CHECK CLASS_ORIGIN CLEAR CLIPPED CLOSE CLUSTER COLOR
+syn keyword fglKeyword COLUMN COLUMNS COMMAND COMMENT COMMENTS COMMIT COMMITTED
+syn keyword fglKeyword COMPOSITES COMPRESS CONCURRENT CONNECT CONNECTION
+syn keyword fglKeyword CONNECTION_ALIAS CONSTRAINED CONSTRAINT CONSTRAINTS CONSTRUCT
+syn keyword fglKeyword CONTINUE CONTROL COS COUNT CREATE CURRENT CURSOR CYAN
+syn keyword fglKeyword DATA DATABASE DATASKIP DATE DATETIME DAY DBA DBINFO DBSERVERNAME
+syn keyword fglKeyword DEALLOCATE DEBUG DEC DECIMAL DECLARE DEFAULT DEFAULTS DEFER
+syn keyword fglKeyword DEFERRED DEFINE DELETE DELIMITER DELIMITERS DESC DESCENDING
+syn keyword fglKeyword DESCRIBE DESCRIPTOR DETACH DIAGNOSTICS DIM DIRTY DISABLED
+syn keyword fglKeyword DISCONNECT DISPLAY DISTINCT DISTRIBUTIONS DO DORMANT DOUBLE
+syn keyword fglKeyword DOWN DOWNSHIFT DROP
+syn keyword fglKeyword EACH ELIF ELSE ENABLED END ENTRY ERROR ERRORLOG ERR_GET
+syn keyword fglKeyword ERR_PRINT ERR_QUIT ESC ESCAPE EVERY EXCEPTION EXCLUSIVE
+syn keyword fglKeyword EXEC EXECUTE EXISTS EXIT EXP EXPLAIN EXPRESSION EXTEND EXTENT
+syn keyword fglKeyword EXTERN EXTERNAL
+syn keyword fglKeyword F1 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F2 F20 F21 F22 F23
+syn keyword fglKeyword F24 F25 F26 F27 F28 F29 F3 F30 F31 F32 F33 F34 F35 F36 F37 F38
+syn keyword fglKeyword F39 F4 F40 F41 F42 F43 F44 F45 F46 F47 F48 F49 F5 F50 F51 F52
+syn keyword fglKeyword F53 F54 F55 F56 F57 F58 F59 F6 F60 F61 F62 F63 F64 F7 F8 F9
+syn keyword fglKeyword FALSE FETCH FGL_GETENV FGL_KEYVAL FGL_LASTKEY FIELD FIELD_TOUCHED
+syn keyword fglKeyword FILE FILLFACTOR FILTERING FINISH FIRST FLOAT FLUSH FOR
+syn keyword fglKeyword FOREACH FOREIGN FORM FORMAT FORMONLY FORTRAN FOUND FRACTION
+syn keyword fglKeyword FRAGMENT FREE FROM FUNCTION GET_FLDBUF GLOBAL GLOBALS GO GOTO
+syn keyword fglKeyword GRANT GREEN GROUP HAVING HEADER HELP HEX HIDE HIGH HOLD HOUR
+syn keyword fglKeyword IDATA IF ILENGTH IMMEDIATE IN INCLUDE INDEX INDEXES INDICATOR
+syn keyword fglKeyword INFIELD INIT INITIALIZE INPUT INSERT INSTRUCTIONS INT INTEGER
+syn keyword fglKeyword INTERRUPT INTERVAL INTO INT_FLAG INVISIBLE IS ISAM ISOLATION
+syn keyword fglKeyword ITYPE
+syn keyword fglKeyword KEY LABEL
+syn keyword fglKeyword LANGUAGE LAST LEADING LEFT LENGTH LET LIKE LINE
+syn keyword fglKeyword LINENO LINES LOAD LOCATE LOCK LOG LOG10 LOGN LONG LOW
+syn keyword fglKeyword MAGENTA MAIN MARGIN MATCHES MAX MDY MEDIUM MEMORY MENU MESSAGE
+syn keyword fglKeyword MESSAGE_LENGTH MESSAGE_TEXT MIN MINUTE MOD MODE MODIFY MODULE
+syn keyword fglKeyword MONEY MONTH MORE
+syn keyword fglKeyword NAME NCHAR NEED NEW NEXT NEXTPAGE NO NOCR NOENTRY NONE NORMAL
+syn keyword fglKeyword NOT NOTFOUND NULL NULLABLE NUMBER NUMERIC NUM_ARGS NVARCHAR
+syn keyword fglKeyword OCTET_LENGTH OF OFF OLD ON ONLY OPEN OPTIMIZATION OPTION OPTIONS
+syn keyword fglKeyword OR ORDER OTHERWISE OUTER OUTPUT
+syn keyword fglKeyword PAGE PAGENO PAUSE PDQPRIORITY PERCENT PICTURE PIPE POW PRECISION
+syn keyword fglKeyword PREPARE PREVIOUS PREVPAGE PRIMARY PRINT PRINTER PRIOR PRIVATE
+syn keyword fglKeyword PRIVILEGES PROCEDURE PROGRAM PROMPT PUBLIC PUT
+syn keyword fglKeyword QUIT QUIT_FLAG
+syn keyword fglKeyword RAISE RANGE READ READONLY REAL RECORD RECOVER RED REFERENCES
+syn keyword fglKeyword REFERENCING REGISTER RELATIVE REMAINDER REMOVE RENAME REOPTIMIZATION
+syn keyword fglKeyword REPEATABLE REPORT REQUIRED RESOLUTION RESOURCE RESTRICT
+syn keyword fglKeyword RESUME RETURN RETURNED_SQLSTATE RETURNING REVERSE REVOKE RIGHT
+syn keyword fglKeyword ROBIN ROLE ROLLBACK ROLLFORWARD ROOT ROUND ROW ROWID ROWIDS
+syn keyword fglKeyword ROWS ROW_COUNT RUN
+syn keyword fglKeyword SCALE SCHEMA SCREEN SCROLL SCR_LINE SECOND SECTION SELECT
+syn keyword fglKeyword SERIAL SERIALIZABLE SERVER_NAME SESSION SET SET_COUNT SHARE
+syn keyword fglKeyword SHORT SHOW SITENAME SIZE SIZEOF SKIP SLEEP SMALLFLOAT SMALLINT
+syn keyword fglKeyword SOME SPACE SPACES SQL SQLAWARN SQLCA SQLCODE SQLERRD SQLERRM
+syn keyword fglKeyword SQLERROR SQLERRP SQLSTATE SQLWARNING SQRT STABILITY START
+syn keyword fglKeyword STARTLOG STATIC STATISTICS STATUS STDEV STEP STOP STRING STRUCT
+syn keyword fglKeyword SUBCLASS_ORIGIN SUM SWITCH SYNONYM SYSTEM
+syn keyword fglKeyword SysBlobs SysChecks SysColAuth SysColDepend SysColumns
+syn keyword fglKeyword SysConstraints SysDefaults SysDepend SysDistrib SysFragAuth
+syn keyword fglKeyword SysFragments SysIndexes SysObjState SysOpClstr SysProcAuth
+syn keyword fglKeyword SysProcBody SysProcPlan SysProcedures SysReferences SysRoleAuth
+syn keyword fglKeyword SysSynTable SysSynonyms SysTabAuth SysTables SysTrigBody
+syn keyword fglKeyword SysTriggers SysUsers SysViews SysViolations
+syn keyword fglKeyword TAB TABLE TABLES TAN TEMP TEXT THEN THROUGH THRU TIME TO
+syn keyword fglKeyword TODAY TOP TOTAL TRACE TRAILER TRAILING TRANSACTION TRIGGER
+syn keyword fglKeyword TRIGGERS TRIM TRUE TRUNC TYPE TYPEDEF
+syn keyword fglKeyword UNCOMMITTED UNCONSTRAINED UNDERLINE UNION UNIQUE UNITS UNLOAD
+syn keyword fglKeyword UNLOCK UNSIGNED UP UPDATE UPSHIFT USER USING
+syn keyword fglKeyword VALIDATE VALUE VALUES VARCHAR VARIABLES VARIANCE VARYING
+syn keyword fglKeyword VERIFY VIEW VIOLATIONS
+syn keyword fglKeyword WAIT WAITING WARNING WEEKDAY WHEN WHENEVER WHERE WHILE WHITE
+syn keyword fglKeyword WINDOW WITH WITHOUT WORDWRAP WORK WRAP WRITE
+syn keyword fglKeyword YEAR YELLOW
+syn keyword fglKeyword ZEROFILL
+
+" Strings and characters:
+syn region fglString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn region fglString start=+'+ skip=+\\\\\|\\"+ end=+'+
+
+" Numbers:
+syn match fglNumber "-\=\<[0-9]*\.\=[0-9_]\>"
+
+" Comments:
+syn region fglComment start="{" end="}"
+syn match fglComment "--.*"
+syn match fglComment "#.*"
+
+" Not a comment even though it looks like one (Dynamic 4GL/FourJs directive)
+syn match fglSpecial "--#"
+syn match fglSpecial "--@"
+
+syn sync ccomment fglComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_fgl_syntax_inits")
+ if version < 508
+ let did_fgl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink fglComment Comment
+ "HiLink fglKeyword fglSpecial
+ HiLink fglKeyword fglStatement
+ HiLink fglNumber Number
+ HiLink fglOperator fglStatement
+ HiLink fglSpecial Special
+ HiLink fglStatement Statement
+ HiLink fglString String
+ HiLink fglType Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fgl"
+
+" vim: ts=8
diff --git a/runtime/syntax/focexec.vim b/runtime/syntax/focexec.vim
new file mode 100644
index 000000000..884c37ebf
--- /dev/null
+++ b/runtime/syntax/focexec.vim
@@ -0,0 +1,101 @@
+" Vim syntax file
+" Language: Focus Executable
+" Maintainer: Rob Brady <robb@datatone.com>
+" Last Change: $Date$
+" URL: http://www.datatone.com/~robb/vim/syntax/focexec.vim
+" $Revision$
+
+" this is a very simple syntax file - I will be improving it
+" one thing is how to do computes
+" I don't like that &vars and FUSE() functions highlight to the same color
+" I think some of these things should get different hilights -
+" should MODIFY commands look different than TABLE?
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+" A bunch of useful keywords
+syn keyword focexecTable TABLE SUM BY ACROSS END PRINT HOLD LIST NOPRINT
+syn keyword focexecTable SUBFOOT SUBHEAD HEADING FOOTING PAGE-BREAK AS
+syn keyword focexecTable WHERE AND OR NOSPLIT FORMAT
+syn keyword focexecModify MODIFY DATA ON FIXFORM PROMPT MATCH COMPUTE
+syn keyword focexecModify GOTO CASE ENDCASE TYPE NOMATCH REJECT INCLUDE
+syn keyword focexecModify CONTINUE FROM
+syn keyword focexecNormal CHECK FILE CREATE EX SET IF FILEDEF DEFINE
+syn keyword focexecNormal REBUILD IF RECORDLIMIT FI EQ JOIN
+syn keyword focexecJoin IN TO
+syn keyword focexecFileDef DISK
+syn keyword focexecSet MSG ALL
+syn match focexecDash "-RUN"
+syn match focexecDash "-PROMPT"
+syn match focexecDash "-WINFORM"
+
+" String and Character constants
+syn region focexecString1 start=+"+ end=+"+
+syn region focexecString2 start=+'+ end=+'+
+
+"amper variables
+syn match focexecAmperVar "&&\=[A-Z_]\+"
+
+"fuse functions
+syn keyword focexecFuse GETUSER GETUSR WHOAMI FEXERR ASIS GETTOK UPCASE LOCASE
+syn keyword focexecFuse SUBSTR TODAY TODAYI POSIT HHMMSS BYTVAL EDAUT1 BITVAL
+syn keyword focexecFuse BITSON FGETENV FPUTENV HEXBYT SPAWN YM YMI JULDAT
+syn keyword focexecFuse JULDATI DOWK DOWKI DOWKLI CHGDAT CHGDATI FTOA ATODBL
+syn keyword focexecFuse SOUNDEX RJUST REVERSE PARAG OVRLAY LJUST CTRFLD CTRAN
+syn keyword focexecFuse CHKFMT ARGLEN GREGDT GREGDTI DTYMD DTYMDI DTDMY DTDMYI
+syn keyword focexecFuse DTYDM DTYDMI DTMYD DTMYDI DTDYM DTDYMI DAYMD DAYMDI
+syn keyword focexecFuse DAMDY DAMDYI DADMY DADMYI AYM AYMI AYMD AYMDI CHKPCK
+syn keyword focexecFuse IMOD FMOD DMOD PCKOUT EXP BAR SPELLNM SPELLNUM RTCIVP
+syn keyword focexecFuse PRDUNI PRDNOR RDNORM RDUNIF LCWORD ITOZ RLPHLD IBIPRO
+syn keyword focexecFuse IBIPRW IBIPRC IBIPRU IBIRCP PTHDAT ITOPACK ITONUM
+syn keyword focexecFuse DSMEXEC DSMEVAL DSMERRC MSMEXEC MSMEVAL MSMERRC EXTDXI
+syn keyword focexecFuse BAANHASH EDAYSI DTOG GTOD HSETPT HPART HTIME HNAME
+syn keyword focexecFuse HADD HDIFF HDATE HGETC HCNVRT HDTTM HMIDNT TEMPPATH
+syn keyword focexecFuse DATEADD DATEDIF DATEMOV DATECVT EURHLD EURXCH FINDFOC
+syn keyword focexecFuse FERRMES CNCTUSR CURRPATH USERPATH SYSTEM ASKYN
+syn keyword focexecFuse FUSEMENU POPEDIT POPFILE
+
+syn match focexecNumber "\<\d\+\>"
+syn match focexecNumber "\<\d\+\.\d*\>"
+
+syn match focexecComment "-\*.*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_focexec_syntax_inits")
+ if version < 508
+ let did_focexec_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink focexecString1 String
+ HiLink focexecString2 String
+ HiLink focexecNumber Number
+ HiLink focexecComment Comment
+ HiLink focexecTable Keyword
+ HiLink focexecModify Keyword
+ HiLink focexecNormal Keyword
+ HiLink focexecSet Keyword
+ HiLink focexecDash Keyword
+ HiLink focexecFileDef Keyword
+ HiLink focexecJoin Keyword
+ HiLink focexecAmperVar Identifier
+ HiLink focexecFuse Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "focexec"
+
+" vim: ts=8
diff --git a/runtime/syntax/form.vim b/runtime/syntax/form.vim
new file mode 100644
index 000000000..726bf4756
--- /dev/null
+++ b/runtime/syntax/form.vim
@@ -0,0 +1,101 @@
+" Vim syntax file
+" Language: FORM
+" Maintainer: Michael M. Tung <michael.tung@uni-mainz.de>
+" Last Change: 2001 May 10
+
+" First public release based on 'Symbolic Manipulation with FORM'
+" by J.A.M. Vermaseren, CAN, Netherlands, 1991.
+" This syntax file is still in development. Please send suggestions
+" to the maintainer.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" A bunch of useful FORM keywords
+syn keyword formType global local
+syn keyword formHeaderStatement symbol symbols cfunction cfunctions
+syn keyword formHeaderStatement function functions vector vectors
+syn keyword formHeaderStatement set sets index indices
+syn keyword formHeaderStatement dimension dimensions unittrace
+syn keyword formStatement id identify drop skip
+syn keyword formStatement write nwrite
+syn keyword formStatement format print nprint load save
+syn keyword formStatement bracket brackets
+syn keyword formStatement multiply count match only discard
+syn keyword formStatement trace4 traceN contract symmetrize antisymmetrize
+syn keyword formConditional if else endif while
+syn keyword formConditional repeat endrepeat label goto
+
+" some special functions
+syn keyword formStatement g_ gi_ g5_ g6_ g7_ 5_ 6_ 7_
+syn keyword formStatement e_ d_ delta_ theta_ sum_ sump_
+
+" pattern matching for keywords
+syn match formComment "^\ *\*.*$"
+syn match formComment "\;\ *\*.*$"
+syn region formString start=+"+ end=+"+
+syn region formString start=+'+ end=+'+
+syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
+syn match formNumber "\<\d\+\>"
+syn match formNumber "\<\d\+\.\d*\>"
+syn match formNumber "\.\d\+\>"
+syn match formNumber "-\d" contains=Number
+syn match formNumber "-\.\d" contains=Number
+syn match formNumber "i_\+\>"
+syn match formNumber "fac_\+\>"
+syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
+
+" hi User Labels
+syn sync ccomment formComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_form_syn_inits")
+ if version < 508
+ let did_form_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink formConditional Conditional
+ HiLink formNumber Number
+ HiLink formStatement Statement
+ HiLink formComment Comment
+ HiLink formPreProc PreProc
+ HiLink formDirective PreProc
+ HiLink formType Type
+ HiLink formString String
+
+ if !exists("form_enhanced_color")
+ HiLink formHeaderStatement Statement
+ else
+ " enhanced color mode
+ HiLink formHeaderStatement HeaderStatement
+ " dark and a light background for local types
+ if &background == "dark"
+ hi HeaderStatement term=underline ctermfg=LightGreen guifg=LightGreen gui=bold
+ else
+ hi HeaderStatement term=underline ctermfg=DarkGreen guifg=SeaGreen gui=bold
+ endif
+ " change slightly the default for dark gvim
+ if has("gui_running") && &background == "dark"
+ hi Conditional guifg=LightBlue gui=bold
+ hi Statement guifg=LightYellow
+ endif
+ endif
+
+ delcommand HiLink
+endif
+
+ let b:current_syntax = "form"
+
+" vim: ts=8
diff --git a/runtime/syntax/forth.vim b/runtime/syntax/forth.vim
new file mode 100644
index 000000000..6e737d319
--- /dev/null
+++ b/runtime/syntax/forth.vim
@@ -0,0 +1,235 @@
+" Vim syntax file
+" Language: FORTH
+" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
+" Last Change: Son 22 Jun 2003 20:42:55 CEST
+" Filenames: *.fs,*.ft
+" URL: http://www.cvjb.de/comp/vim/forth.vim
+
+" $Id$
+
+" The list of keywords is incomplete, compared with the offical ANS
+" wordlist. If you use this language, please improve it, and send me
+" the patches.
+
+" Many Thanks to...
+"
+" 2003-05-10:
+" Andrew Gaul <andrew at gaul.org> send me a patch for
+" forthOperators.
+"
+" 2003-04-03:
+" Ron Aaron <ron at ronware.org> made updates for an
+" improved Win32Forth support.
+"
+" 2002-04-22:
+" Charles Shattuck <charley at forth.org> helped me to settle up with the
+" binary and hex number highlighting.
+"
+" 2002-04-20:
+" Charles Shattuck <charley at forth.org> send me some code for correctly
+" highlighting char and [char] followed by an opening paren. He also added
+" some words for operators, conditionals, and definitions; and added the
+" highlighting for s" and c".
+"
+" 2000-03-28:
+" John Providenza <john at probo.com> made improvements for the
+" highlighting of strings, and added the code for highlighting hex numbers.
+"
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Synchronization method
+syn sync ccomment maxlines=200
+
+" I use gforth, so I set this to case ignore
+syn case ignore
+
+" Some special, non-FORTH keywords
+syn keyword forthTodo contained TODO FIXME XXX
+syn match forthTodo contained 'Copyright\(\s([Cc])\)\=\(\s[0-9]\{2,4}\)\='
+
+" Characters allowed in keywords
+" I don't know if 128-255 are allowed in ANS-FORHT
+if version >= 600
+ setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
+else
+ set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
+endif
+
+
+" Keywords
+
+" basic mathematical and logical operators
+syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX
+syn keyword forthOperators AND OR XOR NOT INVERT 2* 2/ 1+ 1- 2+ 2- 8*
+syn keyword forthOperators M+ */ */MOD M* UM* M*/ UM/MOD FM/MOD SM/REM
+syn keyword forthOperators D+ D- DNEGATE DABS DMIN DMAX
+syn keyword forthOperators F+ F- F* F/ FNEGATE FABS FMAX FMIN FLOOR FROUND
+syn keyword forthOperators F** FSQRT FEXP FEXPM1 FLN FLNP1 FLOG FALOG FSIN
+syn keyword forthOperators FCOS FSINCOS FTAN FASIN FACOS FATAN FATAN2 FSINH
+syn keyword forthOperators FCOSH FTANH FASINH FACOSH FATANH
+syn keyword forthOperators 0< 0<= 0<> 0= 0> 0>= < <= <> = > >=
+syn keyword forthOperators ?NEGATE ?DNEGATE
+
+" stack manipulations
+syn keyword forthStack DROP NIP DUP OVER TUCK SWAP ROT -ROT ?DUP PICK ROLL
+syn keyword forthStack 2DROP 2NIP 2DUP 2OVER 2TUCK 2SWAP 2ROT
+syn keyword forthStack 3DUP 4DUP
+syn keyword forthRStack >R R> R@ RDROP 2>R 2R> 2R@ 2RDROP
+syn keyword forthFStack FDROP FNIP FDUP FOVER FTUCK FSWAP FROT
+
+" stack pointer manipulations
+syn keyword forthSP SP@ SP! FP@ FP! RP@ RP! LP@ LP!
+
+" address operations
+syn keyword forthMemory @ ! +! C@ C! 2@ 2! F@ F! SF@ SF! DF@ DF!
+syn keyword forthAdrArith CHARS CHAR+ CELLS CELL+ CELL ALIGN ALIGNED FLOATS
+syn keyword forthAdrArith FLOAT+ FLOAT FALIGN FALIGNED SFLOATS SFLOAT+
+syn keyword forthAdrArith SFALIGN SFALIGNED DFLOATS DFLOAT+ DFALIGN DFALIGNED
+syn keyword forthAdrArith MAXALIGN MAXALIGNED CFALIGN CFALIGNED
+syn keyword forthAdrArith ADDRESS-UNIT-BITS ALLOT ALLOCATE HERE
+syn keyword forthMemBlks MOVE ERASE CMOVE CMOVE> FILL BLANK
+
+" conditionals
+syn keyword forthCond IF ELSE ENDIF THEN CASE OF ENDOF ENDCASE ?DUP-IF
+syn keyword forthCond ?DUP-0=-IF AHEAD CS-PICK CS-ROLL CATCH THROW WITHIN
+
+" iterations
+syn keyword forthLoop BEGIN WHILE REPEAT UNTIL AGAIN
+syn keyword forthLoop ?DO LOOP I J K +DO U+DO -DO U-DO DO +LOOP -LOOP
+syn keyword forthLoop UNLOOP LEAVE ?LEAVE EXIT DONE FOR NEXT
+
+" new words
+syn match forthColonDef '\<:m\?\s*[^ \t]\+\>'
+syn keyword forthEndOfColonDef ; ;M ;m
+syn keyword forthDefine CONSTANT 2CONSTANT FCONSTANT VARIABLE 2VARIABLE CREATE
+syn keyword forthDefine USER VALUE TO DEFER IS DOES> IMMEDIATE COMPILE-ONLY
+syn keyword forthDefine COMPILE RESTRICT INTERPRET POSTPONE EXECUTE LITERAL
+syn keyword forthDefine CREATE-INTERPRET/COMPILE INTERPRETATION> <INTERPRETATION
+syn keyword forthDefine COMPILATION> <COMPILATION ] LASTXT COMP' POSTPONE,
+syn keyword forthDefine FIND-NAME NAME>INT NAME?INT NAME>COMP NAME>STRING STATE
+syn keyword forthDefine C; CVARIABLE
+syn match forthDefine "\[COMP']"
+syn match forthDefine "'"
+syn match forthDefine '\<\[\>'
+syn match forthDefine "\[']"
+syn match forthDefine '\[COMPILE]'
+syn match forthClassDef '\<:class\s*[^ \t]\+\>'
+syn match forthObjectDef '\<:object\s*[^ \t]\+\>'
+syn keyword forthEndOfClassDef ';class'
+syn keyword forthEndOfObjectDef ';object'
+
+" debugging
+syn keyword forthDebug PRINTDEBUGDATA PRINTDEBUGLINE
+syn match forthDebug "\<\~\~\>"
+
+" Assembler
+syn keyword forthAssembler ASSEMBLER CODE END-CODE ;CODE FLUSH-ICACHE C,
+
+" basic character operations
+syn keyword forthCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY
+syn keyword forthCharOps KEY? TIB CR
+" recognize 'char (' or '[char] (' correctly, so it doesn't
+" highlight everything after the paren as a comment till a closing ')'
+syn match forthCharOps '\<char\s\S\s'
+syn match forthCharOps '\<\[char\]\s\S\s'
+syn region forthCharOps start=+."\s+ skip=+\\"+ end=+"+
+
+" char-number conversion
+syn keyword forthConversion <# # #> #S (NUMBER) (NUMBER?) CONVERT D>F D>S DIGIT
+syn keyword forthConversion DPL F>D HLD HOLD NUMBER S>D SIGN >NUMBER
+
+" interptreter, wordbook, compiler
+syn keyword forthForth (LOCAL) BYE COLD ABORT >BODY >NEXT >LINK CFA >VIEW HERE
+syn keyword forthForth PAD WORDS VIEW VIEW> N>LINK NAME> LINK> L>NAME FORGET
+syn keyword forthForth BODY>
+syn region forthForth start=+ABORT"\s+ skip=+\\"+ end=+"+
+
+" vocabularies
+syn keyword forthVocs ONLY FORTH ALSO ROOT SEAL VOCS ORDER CONTEXT #VOCS
+syn keyword forthVocs VOCABULARY DEFINITIONS
+
+" numbers
+syn keyword forthMath DECIMAL HEX BASE
+syn match forthInteger '\<-\=[0-9.]*[0-9.]\+\>'
+" recognize hex and binary numbers, the '$' and '%' notation is for gforth
+syn match forthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess
+syn match forthInteger '\<\x*\d\x*\>' " *2* --- this order!
+syn match forthInteger '\<%[0-1]*[0-1]\+\>'
+syn match forthFloat '\<-\=\d*[.]\=\d\+[Ee]\d\+\>'
+
+" Strings
+syn region forthString start=+\.*\"+ end=+"+ end=+$+
+" XXX
+syn region forthString start=+s\"+ end=+"+ end=+$+
+syn region forthString start=+c\"+ end=+"+ end=+$+
+
+" Comments
+syn match forthComment '\\\s.*$' contains=forthTodo
+syn region forthComment start='\\S\s' end='.*' contains=forthTodo
+syn match forthComment '\.(\s[^)]*)' contains=forthTodo
+syn region forthComment start='(\s' skip='\\)' end=')' contains=forthTodo
+syn region forthComment start='/\*' end='\*/' contains=forthTodo
+"syn match forthComment '(\s[^\-]*\-\-[^\-]*)' contains=forthTodo
+
+" Include files
+syn match forthInclude '^INCLUDE\s\+\k\+'
+syn match forthInclude '^fload\s\+'
+syn match forthInclude '^needs\s\+'
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_forth_syn_inits")
+ if version < 508
+ let did_forth_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overriden later.
+ HiLink forthTodo Todo
+ HiLink forthOperators Operator
+ HiLink forthMath Number
+ HiLink forthInteger Number
+ HiLink forthFloat Float
+ HiLink forthStack Special
+ HiLink forthRstack Special
+ HiLink forthFStack Special
+ HiLink forthSP Special
+ HiLink forthMemory Function
+ HiLink forthAdrArith Function
+ HiLink forthMemBlks Function
+ HiLink forthCond Conditional
+ HiLink forthLoop Repeat
+ HiLink forthColonDef Define
+ HiLink forthEndOfColonDef Define
+ HiLink forthDefine Define
+ HiLink forthDebug Debug
+ HiLink forthAssembler Include
+ HiLink forthCharOps Character
+ HiLink forthConversion String
+ HiLink forthForth Statement
+ HiLink forthVocs Statement
+ HiLink forthString String
+ HiLink forthComment Comment
+ HiLink forthClassDef Define
+ HiLink forthEndOfClassDef Define
+ HiLink forthObjectDef Define
+ HiLink forthEndOfObjectDef Define
+ HiLink forthInclude Include
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "forth"
+
+" vim:ts=8:sw=4:nocindent:smartindent:
diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim
new file mode 100644
index 000000000..ae1fa8b19
--- /dev/null
+++ b/runtime/syntax/fortran.vim
@@ -0,0 +1,526 @@
+" Vim syntax file
+" Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
+" Version: 0.86
+" URL: http://www.unb.ca/chem/ajit/syntax/fortran.vim
+" Last Change: 2003 Mar. 12
+" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Usage: Do :help fortran-syntax from Vim
+" Credits:
+" Version 0.1 was based on the fortran 77 syntax file by Mario Eusebio and
+" Preben Guldberg. Useful suggestions were made by: Andrej Panjkov,
+" Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
+" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
+" and Andrew Griffiths. For instructions on use, do :help fortran from vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit if a syntax file is already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" let b:fortran_dialect = fortran_dialect if set correctly by user
+if exists("fortran_dialect")
+ if fortran_dialect =~ '\<\(f\(9[05]\|77\)\|elf\|F\)\>'
+ let b:fortran_dialect = matchstr(fortran_dialect,'\<\(f\(9[05]\|77\)\|elf\|F\)\>')
+ else
+ echohl WarningMsg | echo "Unknown value of fortran_dialect" | echohl None
+ let b:fortran_dialect = "unknown"
+ endif
+else
+ let b:fortran_dialect = "unknown"
+endif
+
+" fortran_dialect not set or set incorrectly by user,
+if b:fortran_dialect == "unknown"
+ " set b:fortran_dialect from directive in first three lines of file
+ let b:fortran_retype = getline(1)." ".getline(2)." ".getline(3)
+ if b:fortran_retype =~ '\<fortran_dialect\s*=\s*F\>'
+ let b:fortran_dialect = "F"
+ elseif b:fortran_retype =~ '\<fortran_dialect\s*=\s*elf\>'
+ let b:fortran_dialect = "elf"
+ elseif b:fortran_retype =~ '\<fortran_dialect\s*=\s*f90\>'
+ let b:fortran_dialect = "f90"
+ elseif b:fortran_retype =~ '\<fortran_dialect\s*=\s*f95\>'
+ let b:fortran_dialect = "f95"
+ elseif b:fortran_retype =~ '\<fortran_dialect\s*=\s*f77\>'
+ let b:fortran_dialect = "f77"
+ else
+ " no directive found, so assume f95
+ let b:fortran_dialect = "f95"
+ endif
+ unlet b:fortran_retype
+endif
+
+" Choose between fixed and free source form if this hasn't been done yet
+if !exists("b:fortran_fixed_source")
+ if b:fortran_dialect == "elf" || b:fortran_dialect == "F"
+ " elf and F require free source form
+ let b:fortran_fixed_source = 0
+ elseif b:fortran_dialect == "f77"
+ " f77 requires fixed source form
+ let b:fortran_fixed_source = 1
+ elseif exists("fortran_free_source")
+ " User guarantees free source form for all f90 and f95 files
+ let b:fortran_fixed_source = 0
+ elseif exists("fortran_fixed_source")
+ " User guarantees fixed source form for all f90 and f95 files
+ let b:fortran_fixed_source = 1
+ else
+ " f90 and f95 allow both fixed and free source form.
+ " Assume fixed source form unless signs of free source form
+ " are detected in the first five columns of the first b:lmax lines.
+ " Detection becomes more accurate and time-consuming if more lines
+ " are checked. Increase the limit below if you keep lots of comments at
+ " the very top of each file and you have a fast computer.
+ let b:lmax = 25
+ if ( b:lmax > line("$") )
+ let b:lmax = line("$")
+ endif
+ let b:fortran_fixed_source = 1
+ let b:ln=1
+ while b:ln <= b:lmax
+ let b:test = strpart(getline(b:ln),0,5)
+ if b:test[0] !~ '[Cc*!#]' && b:test !~ '^ \+[!#]' && b:test =~ '[^ 0-9\t]'
+ let b:fortran_fixed_source = 0
+ break
+ endif
+ let b:ln = b:ln + 1
+ endwhile
+ unlet b:lmax b:ln b:test
+ endif
+endif
+
+syn case ignore
+
+if b:fortran_dialect == "f77"
+ syn match fortranIdentifier "\<\a\(\a\|\d\)*\>" contains=fortranSerialNumber
+else
+ syn match fortran90Identifier "\<\a\w*\>" contains=fortranSerialNumber
+ if version >= 600
+ if b:fortran_fixed_source == 1
+ syn match fortranConstructName "^\s\{6,}\zs\a\w*\ze\s*:"
+ else
+ syn match fortranConstructName "^\s*\zs\a\w*\ze\s*:"
+ endif
+ if exists("fortran_more_precise")
+ syn match fortranConstructName "\(\<end\s*do\s\+\)\@<=\a\w*"
+ syn match fortranConstructName "\(\<end\s*if\s\+\)\@<=\a\w*"
+ syn match fortranConstructName "\(\<end\s*select\s\+\)\@<=\a\w*"
+ endif
+ else
+ if b:fortran_fixed_source == 1
+ syn match fortranConstructName "^\s\{6,}\a\w*\s*:"
+ else
+ syn match fortranConstructName "^\s*\a\w*\s*:"
+ endif
+ endif
+endif
+
+syn match fortranUnitHeader "\<end\>"
+
+syn keyword fortranType character complex integer
+syn keyword fortranType intrinsic
+syn match fortranType "\<implicit\>"
+syn keyword fortranStructure dimension
+syn keyword fortranStorageClass parameter save
+syn match fortranUnitHeader "\<subroutine\>"
+syn keyword fortranCall call
+syn match fortranUnitHeader "\<function\>"
+syn match fortranUnitHeader "\<program\>"
+syn keyword fortranStatement return stop
+syn keyword fortranConditional else then
+syn match fortranConditional "\<if\>"
+syn match fortranRepeat "\<do\>"
+
+syn keyword fortranTodo contained todo fixme
+
+"Catch errors caused by too many right parentheses
+syn region fortranParen transparent start="(" end=")" contains=ALLBUT,fortranParenError,@fortranCommentGroup,cIncluded
+syn match fortranParenError ")"
+
+syn match fortranOperator "\.\s*n\=eqv\s*\."
+syn match fortranOperator "\.\s*\(and\|or\|not\)\s*\."
+syn match fortranOperator "\(+\|-\|/\|\*\)"
+
+syn match fortranBoolean "\.\s*\(true\|false\)\s*\."
+
+syn keyword fortranReadWrite backspace close inquire open rewind endfile
+syn keyword fortranReadWrite read write print
+
+"If tabs are allowed then the left margin checks do not work
+if exists("fortran_have_tabs")
+ syn match fortranTab "\t" transparent
+else
+ syn match fortranTab "\t"
+endif
+
+syn keyword fortranIO unit file iostat access blank fmt form
+syn keyword fortranIO recl status exist opened number named name
+syn keyword fortranIO sequential direct rec
+syn keyword fortranIO formatted unformatted nextrec
+
+syn keyword fortran66Intrinsic cabs ccos cexp clog csin csqrt
+syn keyword fortran66Intrinsic dacos dasin datan datan2 dcos dcosh
+syn keyword fortran66Intrinsic ddim dexp dint dlog dlog10 dmod dabs
+syn keyword fortran66Intrinsic dnint dsign dsin dsinh dsqrt dtan
+syn keyword fortran66Intrinsic dtanh iabs idim idnint isign idint ifix
+syn keyword fortran66Intrinsic amax0 amax1 dmax1 max0 max1
+syn keyword fortran66Intrinsic amin0 amin1 dmin1 min0 min1
+syn keyword fortran66Intrinsic amod float sngl alog alog10
+
+" Intrinsics provided by some vendors
+syn keyword fortranExtraIntrinsic cdabs cdcos cdexp cdlog cdsin cdsqrt
+syn keyword fortranExtraIntrinsic cqabs cqcos cqexp cqlog cqsin cqsqrt
+syn keyword fortranExtraIntrinsic qacos qasin qatan qatan2 qcos qcosh
+syn keyword fortranExtraIntrinsic qdim qexp iqint qlog qlog10 qmod qabs
+syn keyword fortranExtraIntrinsic qnint qsign qsin qsinh qsqrt qtan
+syn keyword fortranExtraIntrinsic qtanh qmax1 qmin1
+syn keyword fortranExtraIntrinsic dimag qimag dcmplx qcmplx dconjg qconjg
+syn keyword fortranExtraIntrinsic gamma dgamma qgamma algama dlgama qlgama
+syn keyword fortranExtraIntrinsic erf derf qerf erfc derfc qerfc
+syn keyword fortranExtraIntrinsic dfloat
+
+syn keyword fortran77Intrinsic abs acos aimag aint anint asin atan atan2
+syn keyword fortran77Intrinsic cos sin tan sinh cosh tanh exp log log10
+syn keyword fortran77Intrinsic sign sqrt int cmplx nint min max conjg
+syn keyword fortran77Intrinsic char ichar index
+syn match fortran77Intrinsic "\<len\s*[(,]"me=s+3
+syn match fortran77Intrinsic "\<real\s*("me=s+4
+syn match fortranType "\<implicit\s\+real"
+syn match fortranType "^\s*real\>"
+syn match fortran90Intrinsic "\<logical\s*("me=s+7
+syn match fortranType "\<implicit\s\+logical"
+syn match fortranType "^\s*logical\>"
+
+"Numbers of various sorts
+" Integers
+syn match fortranNumber display "\<\d\+\(_\a\w*\)\=\>"
+" floating point number, without a decimal point
+syn match fortranFloatNoDec display "\<\d\+[deq][-+]\=\d\+\(_\a\w*\)\=\>"
+" floating point number, starting with a decimal point
+syn match fortranFloatIniDec display "\.\d\+\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>"
+" floating point number, no digits after decimal
+syn match fortranFloatEndDec display "\<\d\+\.\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>"
+" floating point number, D or Q exponents
+syn match fortranFloatDExp display "\<\d\+\.\d\+\([dq][-+]\=\d\+\)\=\(_\a\w*\)\=\>"
+" floating point number
+syn match fortranFloat display "\<\d\+\.\d\+\(e[-+]\=\d\+\)\=\(_\a\w*\)\=\>"
+" Numbers in formats
+syn match fortranFormatSpec display "\d*f\d\+\.\d\+"
+syn match fortranFormatSpec display "\d*e[sn]\=\d\+\.\d\+\(e\d+\>\)\="
+syn match fortranFormatSpec display "\d*\(d\|q\|g\)\d\+\.\d\+\(e\d+\)\="
+syn match fortranFormatSpec display "\d\+x\>"
+" The next match cannot be used because it would pick up identifiers as well
+" syn match fortranFormatSpec display "\<\(a\|i\)\d\+"
+
+" Numbers as labels
+syn match fortranLabelNumber display "^\d\{1,5}\s"me=e-1
+syn match fortranLabelNumber display "^ \d\{1,4}\s"ms=s+1,me=e-1
+syn match fortranLabelNumber display "^ \d\{1,3}\s"ms=s+2,me=e-1
+syn match fortranLabelNumber display "^ \d\d\=\s"ms=s+3,me=e-1
+syn match fortranLabelNumber display "^ \d\s"ms=s+4,me=e-1
+
+if version >= 600 && exists("fortran_more_precise")
+ " Numbers as targets
+ syn match fortranTarget display "\(\<if\s*(.\+)\s*\)\@<=\(\d\+\s*,\s*\)\{2}\d\+\>"
+ syn match fortranTarget display "\(\<do\s\+\)\@<=\d\+\>"
+ syn match fortranTarget display "\(\<go\s*to\s*(\=\)\@<=\(\d\+\s*,\s*\)*\d\+\>"
+endif
+
+syn keyword fortranTypeEx external
+syn keyword fortranIOEx format
+syn keyword fortranStatementEx continue
+syn match fortranStatementEx "\<go\s*to\>"
+syn region fortranStringEx start=+'+ end=+'+ contains=fortranContinueMark,fortranLeftMargin,fortranSerialNumber
+syn keyword fortran77IntrinsicEx dim lge lgt lle llt mod
+syn keyword fortranStatementOb assign pause to
+
+if b:fortran_dialect != "f77"
+
+ syn keyword fortranType type none
+
+ syn keyword fortranStructure private public intent optional
+ syn keyword fortranStructure pointer target allocatable
+ syn keyword fortranStorageClass in out
+ syn match fortranStorageClass "\<kind\s*="me=s+4
+ syn match fortranStorageClass "\<len\s*="me=s+3
+
+ syn match fortranUnitHeader "\<module\>"
+ syn keyword fortranUnitHeader use only contains
+ syn keyword fortranUnitHeader result operator assignment
+ syn match fortranUnitHeader "\<interface\>"
+ syn match fortranUnitHeader "\<recursive\>"
+ syn keyword fortranStatement allocate deallocate nullify cycle exit
+ syn match fortranConditional "\<select\>"
+ syn keyword fortranConditional case default where elsewhere
+
+ syn match fortranOperator "\(\(>\|<\)=\=\|==\|/=\|=\)"
+ syn match fortranOperator "=>"
+
+ syn region fortranString start=+"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber
+ syn keyword fortranIO pad position action delim readwrite
+ syn keyword fortranIO eor advance nml
+
+ syn keyword fortran90Intrinsic adjustl adjustr all allocated any
+ syn keyword fortran90Intrinsic associated bit_size btest ceiling
+ syn keyword fortran90Intrinsic count cshift date_and_time
+ syn keyword fortran90Intrinsic digits dot_product eoshift epsilon exponent
+ syn keyword fortran90Intrinsic floor fraction huge iand ibclr ibits ibset ieor
+ syn keyword fortran90Intrinsic ior ishft ishftc lbound len_trim
+ syn keyword fortran90Intrinsic matmul maxexponent maxloc maxval merge
+ syn keyword fortran90Intrinsic minexponent minloc minval modulo mvbits nearest
+ syn keyword fortran90Intrinsic pack present product radix random_number
+ syn match fortran90Intrinsic "\<not\>\(\s*\.\)\@!"me=s+3
+ syn keyword fortran90Intrinsic random_seed range repeat reshape rrspacing scale
+ syn keyword fortran90Intrinsic selected_int_kind selected_real_kind scan
+ syn keyword fortran90Intrinsic shape size spacing spread set_exponent
+ syn keyword fortran90Intrinsic tiny transpose trim ubound unpack verify
+ syn keyword fortran90Intrinsic precision sum system_clock
+ syn match fortran90Intrinsic "\<kind\>\s*[(,]"me=s+4
+
+ syn match fortranUnitHeader "\<end\s*function"
+ syn match fortranUnitHeader "\<end\s*interface"
+ syn match fortranUnitHeader "\<end\s*module"
+ syn match fortranUnitHeader "\<end\s*program"
+ syn match fortranUnitHeader "\<end\s*subroutine"
+ syn match fortranRepeat "\<end\s*do"
+ syn match fortranConditional "\<end\s*where"
+ syn match fortranConditional "\<select\s*case"
+ syn match fortranConditional "\<end\s*select"
+ syn match fortranType "\<end\s*type"
+ syn match fortranType "\<in\s*out"
+
+ syn keyword fortranUnitHeaderEx procedure
+ syn keyword fortranIOEx namelist
+ syn keyword fortranConditionalEx while
+ syn keyword fortran90IntrinsicEx achar iachar transfer
+
+ syn keyword fortranInclude include
+ syn keyword fortran90StorageClassR sequence
+endif
+
+syn match fortranConditional "\<end\s*if"
+syn match fortranIO contains=fortranOperator "\<e\(nd\|rr\)\s*=\s*\d\+"
+syn match fortranConditional "\<else\s*if"
+
+syn keyword fortranUnitHeaderR entry
+syn match fortranTypeR display "double\s\+precision"
+syn match fortranTypeR display "double\s\+complex"
+syn match fortranUnitHeaderR display "block\s\+data"
+syn keyword fortranStorageClassR common equivalence data
+syn keyword fortran77IntrinsicR dble dprod
+syn match fortran77OperatorR "\.\s*[gl][et]\s*\."
+syn match fortran77OperatorR "\.\s*\(eq\|ne\)\s*\."
+
+if b:fortran_dialect == "f95"
+ syn keyword fortranRepeat forall
+ syn match fortranRepeat "\<end\s*forall"
+ syn keyword fortran95Intrinsic null cpu_time
+ syn match fortranType "\<elemental\>"
+ syn match fortranType "\<pure\>"
+ if exists("fortran_more_precise")
+ syn match fortranConstructName "\(\<end\s*forall\s\+\)\@<=\a\w*\>"
+ endif
+endif
+
+syn cluster fortranCommentGroup contains=fortranTodo
+
+if (b:fortran_fixed_source == 1)
+ if !exists("fortran_have_tabs")
+ "Flag items beyond column 72
+ syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72
+ "Flag left margin errors
+ syn match fortranLabelError "^.\{-,4}[^0-9 ]" contains=fortranTab
+ syn match fortranLabelError "^.\{4}\d\S"
+ endif
+ syn match fortranComment excludenl "^[!c*].*$" contains=@fortranCommentGroup
+ syn match fortranLeftMargin transparent "^ \{5}"
+ syn match fortranContinueMark display "^.\{5}\S"lc=5
+else
+ syn match fortranContinueMark display "&"
+endif
+
+if b:fortran_dialect != "f77"
+ syn match fortranComment excludenl "!.*$" contains=@fortranCommentGroup
+endif
+
+"cpp is often used with Fortran
+syn match cPreProc "^\s*#\s*\(define\|ifdef\)\>.*"
+syn match cPreProc "^\s*#\s*\(elif\|if\)\>.*"
+syn match cPreProc "^\s*#\s*\(ifndef\|undef\)\>.*"
+syn match cPreCondit "^\s*#\s*\(else\|endif\)\>.*"
+syn region cIncluded contained start=+"[^(]+ skip=+\\\\\|\\"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber
+syn match cIncluded contained "<[^>]*>"
+syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded
+
+"Synchronising limits assume that comment and continuation lines are not mixed
+if (b:fortran_fixed_source == 0)
+ syn sync linecont "&" maxlines=40
+else
+ syn sync minlines=20
+endif
+
+if version >= 600 && exists("fortran_fold")
+
+ syn sync fromstart
+ if (b:fortran_fixed_source == 1)
+ syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule
+ syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram
+ syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
+ syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
+ syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
+ syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
+ else
+ syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule
+ syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram
+ syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*function\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
+ syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
+ syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
+ syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\s*[!#].*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
+ endif
+
+ if exists("fortran_fold_conditionals")
+ if (b:fortran_fixed_source == 1)
+ syn region fortran77Loop transparent fold keepend start="\<do\s\+\z(\d\+\)" end="^\s*\z1\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortran90Loop transparent fold keepend extend start="\(\<end\s\+\)\@<!\<do\(\s\+\a\|\s*$\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*do\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortranIfBlock transparent fold keepend extend start="\(\<e\(nd\|lse\)\s\+\)\@<!\<if\s*(.\+)\s*then\>" skip="^\([!c*]\|\s*#\).*$" end="\<end\s*if\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortranCase transparent fold keepend extend start="\<select\s*case\>" skip="^\([!c*]\|\s*#\).*$" end="\<end\s*select\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ else
+ syn region fortran77Loop transparent fold keepend start="\<do\s\+\z(\d\+\)" end="^\s*\z1\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortran90Loop transparent fold keepend extend start="\(\<end\s\+\)\@<!\<do\(\s\+\a\|\s*$\)" skip="^\s*[!#].*$" excludenl end="\<end\s*do\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortranIfBlock transparent fold keepend extend start="\(\<e\(nd\|lse\)\s\+\)\@<!\<if\s*(.\+)\s*then\>" skip="^\s*[!#].*$" end="\<end\s*if\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ syn region fortranCase transparent fold keepend extend start="\<select\s*case\>" skip="^\s*[!#].*$" end="\<end\s*select\>" contains=ALLBUT,fortranUnitHeader,fortranStructure,fortranStorageClass,fortranType,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortranBlockData
+ endif
+ endif
+
+ if exists("fortran_fold_multilinecomments")
+ if (b:fortran_fixed_source == 1)
+ syn match fortranMultiLineComments transparent fold "\(^[!c*].*\(\n\|\%$\)\)\{4,}" contains=ALLBUT,fortranMultiCommentLines
+ else
+ syn match fortranMultiLineComments transparent fold "\(^\s*!.*\(\n\|\%$\)\)\{4,}" contains=ALLBUT,fortranMultiCommentLines
+ endif
+ endif
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_fortran_syn_inits")
+ if version < 508
+ let did_fortran_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting differs for each dialect.
+ " Transparent groups:
+ " fortranParen, fortranLeftMargin
+ " fortranProgram, fortranModule, fortranSubroutine, fortranFunction,
+ " fortranBlockData
+ " fortran77Loop, fortran90Loop, fortranIfBlock, fortranCase
+ " fortranMultiCommentLines
+ HiLink fortranStatement Statement
+ HiLink fortranConstructName Special
+ HiLink fortranConditional Conditional
+ HiLink fortranRepeat Repeat
+ HiLink fortranTodo Todo
+ HiLink fortranContinueMark Todo
+ HiLink fortranString String
+ HiLink fortranNumber Number
+ HiLink fortranOperator Operator
+ HiLink fortranBoolean Boolean
+ HiLink fortranLabelError Error
+ HiLink fortranObsolete Todo
+ HiLink fortranType Type
+ HiLink fortranStructure Type
+ HiLink fortranStorageClass StorageClass
+ HiLink fortranCall fortranUnitHeader
+ HiLink fortranUnitHeader fortranPreCondit
+ HiLink fortranReadWrite fortran90Intrinsic
+ HiLink fortranIO fortran90Intrinsic
+ HiLink fortran95Intrinsic fortran90Intrinsic
+ HiLink fortran77Intrinsic fortran90Intrinsic
+ HiLink fortran90Intrinsic Special
+
+ if ( b:fortran_dialect == "elf" || b:fortran_dialect == "F" )
+ HiLink fortranStatementOb fortranObsolete
+ HiLink fortran66Intrinsic fortranObsolete
+ HiLink fortran77IntrinsicR fortranObsolete
+ HiLink fortranUnitHeaderR fortranObsolete
+ HiLink fortranTypeR fortranObsolete
+ HiLink fortranStorageClassR fortranObsolete
+ HiLink fortran90StorageClassR fortranObsolete
+ HiLink fortran77OperatorR fortranObsolete
+ HiLink fortranInclude fortranObsolete
+ else
+ HiLink fortranStatementOb Statement
+ HiLink fortran66Intrinsic fortran90Intrinsic
+ HiLink fortran77IntrinsicR fortran90Intrinsic
+ HiLink fortranUnitHeaderR fortranPreCondit
+ HiLink fortranTypeR fortranType
+ HiLink fortranStorageClassR fortranStorageClass
+ HiLink fortran77OperatorR fortranOperator
+ HiLink fortranInclude Include
+ HiLink fortran90StorageClassR fortranStorageClass
+ endif
+
+ if ( b:fortran_dialect == "F" )
+ HiLink fortranLabelNumber fortranObsolete
+ HiLink fortranTarget fortranObsolete
+ HiLink fortranFormatSpec fortranObsolete
+ HiLink fortranFloatDExp fortranObsolete
+ HiLink fortranFloatNoDec fortranObsolete
+ HiLink fortranFloatIniDec fortranObsolete
+ HiLink fortranFloatEndDec fortranObsolete
+ HiLink fortranTypeEx fortranObsolete
+ HiLink fortranIOEx fortranObsolete
+ HiLink fortranStatementEx fortranObsolete
+ HiLink fortranStringEx fortranObsolete
+ HiLink fortran77IntrinsicEx fortranObsolete
+ HiLink fortranUnitHeaderEx fortranObsolete
+ HiLink fortranConditionalEx fortranObsolete
+ HiLink fortran90IntrinsicEx fortranObsolete
+ else
+ HiLink fortranLabelNumber Special
+ HiLink fortranTarget Special
+ HiLink fortranFormatSpec Identifier
+ HiLink fortranFloatDExp fortranFloat
+ HiLink fortranFloatNoDec fortranFloat
+ HiLink fortranFloatIniDec fortranFloat
+ HiLink fortranFloatEndDec fortranFloat
+ HiLink fortranTypeEx fortranType
+ HiLink fortranIOEx fortranIO
+ HiLink fortranStatementEx fortranStatement
+ HiLink fortranStringEx fortranString
+ HiLink fortran77IntrinsicEx fortran90Intrinsic
+ HiLink fortranUnitHeaderEx fortranUnitHeader
+ HiLink fortranConditionalEx fortranConditional
+ HiLink fortran90IntrinsicEx fortran90Intrinsic
+ endif
+
+ HiLink fortranFloat Float
+ HiLink fortran90Identifier fortranIdentifier
+ "Uncomment the next line if you want all fortran variables to be highlighted
+ "HiLink fortranIdentifier Identifier
+ HiLink fortranPreCondit PreCondit
+ HiLink fortranInclude Include
+ HiLink cIncluded fortranString
+ HiLink cInclude Include
+ HiLink cPreProc PreProc
+ HiLink cPreCondit PreCondit
+ HiLink fortranParenError Error
+ HiLink fortranComment Comment
+ HiLink fortranSerialNumber Todo
+ HiLink fortranTab Error
+ " Vendor extensions
+ HiLink fortranExtraIntrinsic Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fortran"
+
+" vim: ts=8 tw=132
diff --git a/runtime/syntax/foxpro.vim b/runtime/syntax/foxpro.vim
new file mode 100644
index 000000000..8fabd2325
--- /dev/null
+++ b/runtime/syntax/foxpro.vim
@@ -0,0 +1,692 @@
+" Vim syntax file
+" Language: FoxPro for DOS v2.x
+" Maintainer: Powing Tse <powing@hkem.com>
+" Last Change: 06 September 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+
+" Highlight special characters
+syn match foxproSpecial "^\s*!"
+syn match foxproSpecial "&"
+syn match foxproSpecial ";\s*$"
+syn match foxproSpecial "^\s*="
+syn match foxproSpecial "^\s*\\"
+syn match foxproSpecial "^\s*\\\\"
+syn match foxproSpecial "^\s*?"
+syn match foxproSpecial "^\s*??"
+syn match foxproSpecial "^\s*???"
+syn match foxproSpecial "\<m\>\."
+
+" @ Statements
+syn match foxproAtSymbol contained "^\s*@"
+syn match foxproAtCmd contained "\<say\>\|\<get\>\|\<edit\>\|\<box\>\|\<clea\%[r]\>\|\<fill\>\|\<menu\>\|\<prom\%[pt]\>\|\<scro\%[ll]\>\|\<to\>"
+syn match foxproAtStart transparent "^\s*@.*" contains=ALL
+
+" preprocessor directives
+syn match foxproPreProc "^\s*#\s*\(\<if\>\|\<elif\>\|\<else\>\|\<endi\%[f]\>\)"
+syn match foxproPreProc "^\s*#\s*\(\<defi\%[ne]\>\|\<unde\%[f]\>\)"
+syn match foxproPreProc "^\s*#\s*\<regi\%[on]\>"
+
+" Functions
+syn match foxproFunc "\<abs\>\s*("me=e-1
+syn match foxproFunc "\<acop\%[y]\>\s*("me=e-1
+syn match foxproFunc "\<acos\>\s*("me=e-1
+syn match foxproFunc "\<adel\>\s*("me=e-1
+syn match foxproFunc "\<adir\>\s*("me=e-1
+syn match foxproFunc "\<aele\%[ment]\>\s*("me=e-1
+syn match foxproFunc "\<afie\%[lds]\>\s*("me=e-1
+syn match foxproFunc "\<afon\%[t]\>\s*("me=e-1
+syn match foxproFunc "\<ains\>\s*("me=e-1
+syn match foxproFunc "\<alen\>\s*("me=e-1
+syn match foxproFunc "\<alia\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<allt\%[rim]\>\s*("me=e-1
+syn match foxproFunc "\<ansi\%[tooem]\>\s*("me=e-1
+syn match foxproFunc "\<asc\>\s*("me=e-1
+syn match foxproFunc "\<asca\%[n]\>\s*("me=e-1
+syn match foxproFunc "\<asin\>\s*("me=e-1
+syn match foxproFunc "\<asor\%[t]\>\s*("me=e-1
+syn match foxproFunc "\<asub\%[script]\>\s*("me=e-1
+syn match foxproFunc "\<at\>\s*("me=e-1
+syn match foxproFunc "\<atan\>\s*("me=e-1
+syn match foxproFunc "\<atc\>\s*("me=e-1
+syn match foxproFunc "\<atcl\%[ine]\>\s*("me=e-1
+syn match foxproFunc "\<atli\%[ne]\>\s*("me=e-1
+syn match foxproFunc "\<atn2\>\s*("me=e-1
+syn match foxproFunc "\<bar\>\s*("me=e-1
+syn match foxproFunc "\<barc\%[ount]\>\s*("me=e-1
+syn match foxproFunc "\<barp\%[rompt]\>\s*("me=e-1
+syn match foxproFunc "\<betw\%[een]\>\s*("me=e-1
+syn match foxproFunc "\<bof\>\s*("me=e-1
+syn match foxproFunc "\<caps\%[lock]\>\s*("me=e-1
+syn match foxproFunc "\<cdow\>\s*("me=e-1
+syn match foxproFunc "\<cdx\>\s*("me=e-1
+syn match foxproFunc "\<ceil\%[ing]\>\s*("me=e-1
+syn match foxproFunc "\<chr\>\s*("me=e-1
+syn match foxproFunc "\<chrs\%[aw]\>\s*("me=e-1
+syn match foxproFunc "\<chrt\%[ran]\>\s*("me=e-1
+syn match foxproFunc "\<cmon\%[th]\>\s*("me=e-1
+syn match foxproFunc "\<cntb\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<cntp\%[ad]\>\s*("me=e-1
+syn match foxproFunc "\<col\>\s*("me=e-1
+syn match foxproFunc "\<cos\>\s*("me=e-1
+syn match foxproFunc "\<cpco\%[nvert]\>\s*("me=e-1
+syn match foxproFunc "\<cpcu\%[rrent]\>\s*("me=e-1
+syn match foxproFunc "\<cpdb\%[f]\>\s*("me=e-1
+syn match foxproFunc "\<ctod\>\s*("me=e-1
+syn match foxproFunc "\<curd\%[ir]\>\s*("me=e-1
+syn match foxproFunc "\<date\>\s*("me=e-1
+syn match foxproFunc "\<day\>\s*("me=e-1
+syn match foxproFunc "\<dbf\>\s*("me=e-1
+syn match foxproFunc "\<ddea\%[borttrans]\>\s*("me=e-1
+syn match foxproFunc "\<ddea\%[dvise]\>\s*("me=e-1
+syn match foxproFunc "\<ddee\%[nabled]\>\s*("me=e-1
+syn match foxproFunc "\<ddee\%[xecute]\>\s*("me=e-1
+syn match foxproFunc "\<ddei\%[nitiate]\>\s*("me=e-1
+syn match foxproFunc "\<ddel\%[asterror]\>\s*("me=e-1
+syn match foxproFunc "\<ddep\%[oke]\>\s*("me=e-1
+syn match foxproFunc "\<dder\%[equest]\>\s*("me=e-1
+syn match foxproFunc "\<ddes\%[etoption]\>\s*("me=e-1
+syn match foxproFunc "\<ddes\%[etservice]\>\s*("me=e-1
+syn match foxproFunc "\<ddes\%[ettopic]\>\s*("me=e-1
+syn match foxproFunc "\<ddet\%[erminate]\>\s*("me=e-1
+syn match foxproFunc "\<dele\%[ted]\>\s*("me=e-1
+syn match foxproFunc "\<desc\%[ending]\>\s*("me=e-1
+syn match foxproFunc "\<diff\%[erence]\>\s*("me=e-1
+syn match foxproFunc "\<disk\%[space]\>\s*("me=e-1
+syn match foxproFunc "\<dmy\>\s*("me=e-1
+syn match foxproFunc "\<dow\>\s*("me=e-1
+syn match foxproFunc "\<dtoc\>\s*("me=e-1
+syn match foxproFunc "\<dtor\>\s*("me=e-1
+syn match foxproFunc "\<dtos\>\s*("me=e-1
+syn match foxproFunc "\<empt\%[y]\>\s*("me=e-1
+syn match foxproFunc "\<eof\>\s*("me=e-1
+syn match foxproFunc "\<erro\%[r]\>\s*("me=e-1
+syn match foxproFunc "\<eval\%[uate]\>\s*("me=e-1
+syn match foxproFunc "\<exp\>\s*("me=e-1
+syn match foxproFunc "\<fchs\%[ize]\>\s*("me=e-1
+syn match foxproFunc "\<fclo\%[se]\>\s*("me=e-1
+syn match foxproFunc "\<fcou\%[nt]\>\s*("me=e-1
+syn match foxproFunc "\<fcre\%[ate]\>\s*("me=e-1
+syn match foxproFunc "\<fdat\%[e]\>\s*("me=e-1
+syn match foxproFunc "\<feof\>\s*("me=e-1
+syn match foxproFunc "\<ferr\%[or]\>\s*("me=e-1
+syn match foxproFunc "\<fflu\%[sh]\>\s*("me=e-1
+syn match foxproFunc "\<fget\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<fiel\%[d]\>\s*("me=e-1
+syn match foxproFunc "\<file\>\s*("me=e-1
+syn match foxproFunc "\<filt\%[er]\>\s*("me=e-1
+syn match foxproFunc "\<fkla\%[bel]\>\s*("me=e-1
+syn match foxproFunc "\<fkma\%[x]\>\s*("me=e-1
+syn match foxproFunc "\<fldl\%[ist]\>\s*("me=e-1
+syn match foxproFunc "\<floc\%[k]\>\s*("me=e-1
+syn match foxproFunc "\<floo\%[r]\>\s*("me=e-1
+syn match foxproFunc "\<font\%[metric]\>\s*("me=e-1
+syn match foxproFunc "\<fope\%[n]\>\s*("me=e-1
+syn match foxproFunc "\<for\>\s*("me=e-1
+syn match foxproFunc "\<foun\%[d]\>\s*("me=e-1
+syn match foxproFunc "\<fput\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<frea\%[d]\>\s*("me=e-1
+syn match foxproFunc "\<fsee\%[k]\>\s*("me=e-1
+syn match foxproFunc "\<fsiz\%[e]\>\s*("me=e-1
+syn match foxproFunc "\<ftim\%[e]\>\s*("me=e-1
+syn match foxproFunc "\<full\%[path]\>\s*("me=e-1
+syn match foxproFunc "\<fv\>\s*("me=e-1
+syn match foxproFunc "\<fwri\%[te]\>\s*("me=e-1
+syn match foxproFunc "\<getb\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<getd\%[ir]\>\s*("me=e-1
+syn match foxproFunc "\<gete\%[nv]\>\s*("me=e-1
+syn match foxproFunc "\<getf\%[ile]\>\s*("me=e-1
+syn match foxproFunc "\<getf\%[ont]\>\s*("me=e-1
+syn match foxproFunc "\<getp\%[ad]\>\s*("me=e-1
+syn match foxproFunc "\<gomo\%[nth]\>\s*("me=e-1
+syn match foxproFunc "\<head\%[er]\>\s*("me=e-1
+syn match foxproFunc "\<home\>\s*("me=e-1
+syn match foxproFunc "\<idxc\%[ollate]\>\s*("me=e-1
+syn match foxproFunc "\<iif\>\s*("me=e-1
+syn match foxproFunc "\<inke\%[y]\>\s*("me=e-1
+syn match foxproFunc "\<inli\%[st]\>\s*("me=e-1
+syn match foxproFunc "\<insm\%[ode]\>\s*("me=e-1
+syn match foxproFunc "\<int\>\s*("me=e-1
+syn match foxproFunc "\<isal\%[pha]\>\s*("me=e-1
+syn match foxproFunc "\<isbl\%[ank]\>\s*("me=e-1
+syn match foxproFunc "\<isco\%[lor]\>\s*("me=e-1
+syn match foxproFunc "\<isdi\%[git]\>\s*("me=e-1
+syn match foxproFunc "\<islo\%[wer]\>\s*("me=e-1
+syn match foxproFunc "\<isre\%[adonly]\>\s*("me=e-1
+syn match foxproFunc "\<isup\%[per]\>\s*("me=e-1
+syn match foxproFunc "\<key\>\s*("me=e-1
+syn match foxproFunc "\<keym\%[atch]\>\s*("me=e-1
+syn match foxproFunc "\<last\%[key]\>\s*("me=e-1
+syn match foxproFunc "\<left\>\s*("me=e-1
+syn match foxproFunc "\<len\>\s*("me=e-1
+syn match foxproFunc "\<like\>\s*("me=e-1
+syn match foxproFunc "\<line\%[no]\>\s*("me=e-1
+syn match foxproFunc "\<locf\%[ile]\>\s*("me=e-1
+syn match foxproFunc "\<lock\>\s*("me=e-1
+syn match foxproFunc "\<log\>\s*("me=e-1
+syn match foxproFunc "\<log1\%[0]\>\s*("me=e-1
+syn match foxproFunc "\<look\%[up]\>\s*("me=e-1
+syn match foxproFunc "\<lowe\%[r]\>\s*("me=e-1
+syn match foxproFunc "\<ltri\%[m]\>\s*("me=e-1
+syn match foxproFunc "\<lupd\%[ate]\>\s*("me=e-1
+syn match foxproFunc "\<max\>\s*("me=e-1
+syn match foxproFunc "\<mcol\>\s*("me=e-1
+syn match foxproFunc "\<mdow\%[n]\>\s*("me=e-1
+syn match foxproFunc "\<mdx\>\s*("me=e-1
+syn match foxproFunc "\<mdy\>\s*("me=e-1
+syn match foxproFunc "\<meml\%[ines]\>\s*("me=e-1
+syn match foxproFunc "\<memo\%[ry]\>\s*("me=e-1
+syn match foxproFunc "\<menu\>\s*("me=e-1
+syn match foxproFunc "\<mess\%[age]\>\s*("me=e-1
+syn match foxproFunc "\<min\>\s*("me=e-1
+syn match foxproFunc "\<mlin\%[e]\>\s*("me=e-1
+syn match foxproFunc "\<mod\>\s*("me=e-1
+syn match foxproFunc "\<mont\%[h]\>\s*("me=e-1
+syn match foxproFunc "\<mrkb\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<mrkp\%[ad]\>\s*("me=e-1
+syn match foxproFunc "\<mrow\>\s*("me=e-1
+syn match foxproFunc "\<mwin\%[dow]\>\s*("me=e-1
+syn match foxproFunc "\<ndx\>\s*("me=e-1
+syn match foxproFunc "\<norm\%[alize]\>\s*("me=e-1
+syn match foxproFunc "\<numl\%[ock]\>\s*("me=e-1
+syn match foxproFunc "\<objn\%[um]\>\s*("me=e-1
+syn match foxproFunc "\<objv\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<occu\%[rs]\>\s*("me=e-1
+syn match foxproFunc "\<oemt\%[oansi]\>\s*("me=e-1
+syn match foxproFunc "\<on\>\s*("me=e-1
+syn match foxproFunc "\<orde\%[r]\>\s*("me=e-1
+syn match foxproFunc "\<os\>\s*("me=e-1
+syn match foxproFunc "\<pad\>\s*("me=e-1
+syn match foxproFunc "\<padc\>\s*("me=e-1
+syn match foxproFunc "\<padl\>\s*("me=e-1
+syn match foxproFunc "\<padr\>\s*("me=e-1
+syn match foxproFunc "\<para\%[meters]\>\s*("me=e-1
+syn match foxproFunc "\<paym\%[ent]\>\s*("me=e-1
+syn match foxproFunc "\<pcol\>\s*("me=e-1
+syn match foxproFunc "\<pi\>\s*("me=e-1
+syn match foxproFunc "\<popu\%[p]\>\s*("me=e-1
+syn match foxproFunc "\<prin\%[tstatus]\>\s*("me=e-1
+syn match foxproFunc "\<prmb\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<prmp\%[ad]\>\s*("me=e-1
+syn match foxproFunc "\<prog\%[ram]\>\s*("me=e-1
+syn match foxproFunc "\<prom\%[pt]\>\s*("me=e-1
+syn match foxproFunc "\<prop\%[er]\>\s*("me=e-1
+syn match foxproFunc "\<prow\>\s*("me=e-1
+syn match foxproFunc "\<prti\%[nfo]\>\s*("me=e-1
+syn match foxproFunc "\<putf\%[ile]\>\s*("me=e-1
+syn match foxproFunc "\<pv\>\s*("me=e-1
+syn match foxproFunc "\<rand\>\s*("me=e-1
+syn match foxproFunc "\<rat\>\s*("me=e-1
+syn match foxproFunc "\<ratl\%[ine]\>\s*("me=e-1
+syn match foxproFunc "\<rdle\%[vel]\>\s*("me=e-1
+syn match foxproFunc "\<read\%[key]\>\s*("me=e-1
+syn match foxproFunc "\<recc\%[ount]\>\s*("me=e-1
+syn match foxproFunc "\<recn\%[o]\>\s*("me=e-1
+syn match foxproFunc "\<recs\%[ize]\>\s*("me=e-1
+syn match foxproFunc "\<rela\%[tion]\>\s*("me=e-1
+syn match foxproFunc "\<repl\%[icate]\>\s*("me=e-1
+syn match foxproFunc "\<rgbs\%[cheme]\>\s*("me=e-1
+syn match foxproFunc "\<righ\%[t]\>\s*("me=e-1
+syn match foxproFunc "\<rloc\%[k]\>\s*("me=e-1
+syn match foxproFunc "\<roun\%[d]\>\s*("me=e-1
+syn match foxproFunc "\<row\>\s*("me=e-1
+syn match foxproFunc "\<rtod\>\s*("me=e-1
+syn match foxproFunc "\<rtri\%[m]\>\s*("me=e-1
+syn match foxproFunc "\<sche\%[me]\>\s*("me=e-1
+syn match foxproFunc "\<scol\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<seco\%[nds]\>\s*("me=e-1
+syn match foxproFunc "\<seek\>\s*("me=e-1
+syn match foxproFunc "\<sele\%[ct]\>\s*("me=e-1
+syn match foxproFunc "\<set\>\s*("me=e-1
+syn match foxproFunc "\<sign\>\s*("me=e-1
+syn match foxproFunc "\<sin\>\s*("me=e-1
+syn match foxproFunc "\<skpb\%[ar]\>\s*("me=e-1
+syn match foxproFunc "\<skpp\%[ad]\>\s*("me=e-1
+syn match foxproFunc "\<soun\%[dex]\>\s*("me=e-1
+syn match foxproFunc "\<spac\%[e]\>\s*("me=e-1
+syn match foxproFunc "\<sqrt\>\s*("me=e-1
+syn match foxproFunc "\<srow\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<str\>\s*("me=e-1
+syn match foxproFunc "\<strt\%[ran]\>\s*("me=e-1
+syn match foxproFunc "\<stuf\%[f]\>\s*("me=e-1
+syn match foxproFunc "\<subs\%[tr]\>\s*("me=e-1
+syn match foxproFunc "\<sysm\%[etric]\>\s*("me=e-1
+syn match foxproFunc "\<sys\>\s*("me=e-1
+syn match foxproFunc "\<tag\>\s*("me=e-1
+syn match foxproFunc "\<tagc\%[ount]\>\s*("me=e-1
+syn match foxproFunc "\<tagn\%[o]\>\s*("me=e-1
+syn match foxproFunc "\<tan\>\s*("me=e-1
+syn match foxproFunc "\<targ\%[et]\>\s*("me=e-1
+syn match foxproFunc "\<time\>\s*("me=e-1
+syn match foxproFunc "\<tran\%[sform]\>\s*("me=e-1
+syn match foxproFunc "\<trim\>\s*("me=e-1
+syn match foxproFunc "\<txtw\%[idth]\>\s*("me=e-1
+syn match foxproFunc "\<type\>\s*("me=e-1
+syn match foxproFunc "\<uniq\%[ue]\>\s*("me=e-1
+syn match foxproFunc "\<upda\%[ted]\>\s*("me=e-1
+syn match foxproFunc "\<uppe\%[r]\>\s*("me=e-1
+syn match foxproFunc "\<used\>\s*("me=e-1
+syn match foxproFunc "\<val\>\s*("me=e-1
+syn match foxproFunc "\<varr\%[ead]\>\s*("me=e-1
+syn match foxproFunc "\<vers\%[ion]\>\s*("me=e-1
+syn match foxproFunc "\<wbor\%[der]\>\s*("me=e-1
+syn match foxproFunc "\<wchi\%[ld]\>\s*("me=e-1
+syn match foxproFunc "\<wcol\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<wexi\%[st]\>\s*("me=e-1
+syn match foxproFunc "\<wfon\%[t]\>\s*("me=e-1
+syn match foxproFunc "\<wlas\%[t]\>\s*("me=e-1
+syn match foxproFunc "\<wlco\%[l]\>\s*("me=e-1
+syn match foxproFunc "\<wlro\%[w]\>\s*("me=e-1
+syn match foxproFunc "\<wmax\%[imum]\>\s*("me=e-1
+syn match foxproFunc "\<wmin\%[imum]\>\s*("me=e-1
+syn match foxproFunc "\<wont\%[op]\>\s*("me=e-1
+syn match foxproFunc "\<wout\%[put]\>\s*("me=e-1
+syn match foxproFunc "\<wpar\%[ent]\>\s*("me=e-1
+syn match foxproFunc "\<wrea\%[d]\>\s*("me=e-1
+syn match foxproFunc "\<wrow\%[s]\>\s*("me=e-1
+syn match foxproFunc "\<wtit\%[le]\>\s*("me=e-1
+syn match foxproFunc "\<wvis\%[ible]\>\s*("me=e-1
+syn match foxproFunc "\<year\>\s*("me=e-1
+
+" Commands
+syn match foxproCmd "^\s*\<acce\%[pt]\>"
+syn match foxproCmd "^\s*\<acti\%[vate]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<acti\%[vate]\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<acti\%[vate]\>\s*\<scre\%[en]\>"
+syn match foxproCmd "^\s*\<acti\%[vate]\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<appe\%[nd]\>"
+syn match foxproCmd "^\s*\<appe\%[nd]\>\s*\<from\>"
+syn match foxproCmd "^\s*\<appe\%[nd]\>\s*\<from\>\s*\<arra\%[y]\>"
+syn match foxproCmd "^\s*\<appe\%[nd]\>\s*\<gene\%[ral]\>"
+syn match foxproCmd "^\s*\<appe\%[nd]\>\s*\<memo\>"
+syn match foxproCmd "^\s*\<assi\%[st]\>"
+syn match foxproCmd "^\s*\<aver\%[age]\>"
+syn match foxproCmd "^\s*\<blan\%[k]\>"
+syn match foxproCmd "^\s*\<brow\%[se]\>"
+syn match foxproCmd "^\s*\<buil\%[d]\>\s*\<app\>"
+syn match foxproCmd "^\s*\<buil\%[d]\>\s*\<exe\>"
+syn match foxproCmd "^\s*\<buil\%[d]\>\s*\<proj\%[ect]\>"
+syn match foxproCmd "^\s*\<calc\%[ulate]\>"
+syn match foxproCmd "^\s*\<call\>"
+syn match foxproCmd "^\s*\<canc\%[el]\>"
+syn match foxproCmd "^\s*\<chan\%[ge]\>"
+syn match foxproCmd "^\s*\<clea\%[r]\>"
+syn match foxproCmd "^\s*\<clos\%[e]\>"
+syn match foxproCmd "^\s*\<clos\%[e]\>\s*\<memo\>"
+syn match foxproCmd "^\s*\<comp\%[ile]\>"
+syn match foxproCmd "^\s*\<cont\%[inue]\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<file\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<inde\%[xes]\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<memo\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<stru\%[cture]\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<stru\%[cture]\>\s*\<exte\%[nded]\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<tag\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<to\>"
+syn match foxproCmd "^\s*\<copy\>\s*\<to\>\s*\<arra\%[y]\>"
+syn match foxproCmd "^\s*\<coun\%[t]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<colo\%[r]\>\s*\<set\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<curs\%[or]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<from\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<labe\%[l]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<proj\%[ect]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<quer\%[y]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<repo\%[rt]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<scre\%[en]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<tabl\%[e]\>"
+syn match foxproCmd "^\s*\<crea\%[te]\>\s*\<view\>"
+syn match foxproCmd "^\s*\<dde\>"
+syn match foxproCmd "^\s*\<deac\%[tivate]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<deac\%[tivate]\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<deac\%[tivate]\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<decl\%[are]\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<bar\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<box\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<pad\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<defi\%[ne]\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<dele\%[te]\>"
+syn match foxproCmd "^\s*\<dele\%[te]\>\s*\<file\>"
+syn match foxproCmd "^\s*\<dele\%[te]\>\s*\<tag\>"
+syn match foxproCmd "^\s*\<dime\%[nsion]\>"
+syn match foxproCmd "^\s*\<dire\%[ctory]\>"
+syn match foxproCmd "^\s*\<disp\%[lay]\>"
+syn match foxproCmd "^\s*\<disp\%[lay]\>\s*\<file\%[s]\>"
+syn match foxproCmd "^\s*\<disp\%[lay]\>\s*\<memo\%[ry]\>"
+syn match foxproCmd "^\s*\<disp\%[lay]\>\s*\<stat\%[us]\>"
+syn match foxproCmd "^\s*\<disp\%[lay]\>\s*\<stru\%[cture]\>"
+syn match foxproCmd "^\s*\<do\>"
+syn match foxproCmd "^\s*\<edit\>"
+syn match foxproCmd "^\s*\<ejec\%[t]\>"
+syn match foxproCmd "^\s*\<ejec\%[t]\>\s*\<page\>"
+syn match foxproCmd "^\s*\<eras\%[e]\>"
+syn match foxproCmd "^\s*\<exit\>"
+syn match foxproCmd "^\s*\<expo\%[rt]\>"
+syn match foxproCmd "^\s*\<exte\%[rnal]\>"
+syn match foxproCmd "^\s*\<file\%[r]\>"
+syn match foxproCmd "^\s*\<find\>"
+syn match foxproCmd "^\s*\<flus\%[h]\>"
+syn match foxproCmd "^\s*\<func\%[tion]\>"
+syn match foxproCmd "^\s*\<gath\%[er]\>"
+syn match foxproCmd "^\s*\<gete\%[xpr]\>"
+syn match foxproCmd "^\s*\<go\>"
+syn match foxproCmd "^\s*\<goto\>"
+syn match foxproCmd "^\s*\<help\>"
+syn match foxproCmd "^\s*\<hide\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<hide\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<hide\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<impo\%[rt]\>"
+syn match foxproCmd "^\s*\<inde\%[x]\>"
+syn match foxproCmd "^\s*\<inpu\%[t]\>"
+syn match foxproCmd "^\s*\<inse\%[rt]\>"
+syn match foxproCmd "^\s*\<join\>"
+syn match foxproCmd "^\s*\<keyb\%[oard]\>"
+syn match foxproCmd "^\s*\<labe\%[l]\>"
+syn match foxproCmd "^\s*\<list\>"
+syn match foxproCmd "^\s*\<load\>"
+syn match foxproCmd "^\s*\<loca\%[te]\>"
+syn match foxproCmd "^\s*\<loop\>"
+syn match foxproCmd "^\s*\<menu\>"
+syn match foxproCmd "^\s*\<menu\>\s*\<to\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<comm\%[and]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<file\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<gene\%[ral]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<labe\%[l]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<memo\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<proj\%[ect]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<quer\%[y]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<repo\%[rt]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<scre\%[en]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<stru\%[cture]\>"
+syn match foxproCmd "^\s*\<modi\%[fy]\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<move\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<move\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<note\>"
+syn match foxproCmd "^\s*\<on\>\s*\<apla\%[bout]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<bar\>"
+syn match foxproCmd "^\s*\<on\>\s*\<erro\%[r]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<esca\%[pe]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<exit\>\s*\<bar\>"
+syn match foxproCmd "^\s*\<on\>\s*\<exit\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<on\>\s*\<exit\>\s*\<pad\>"
+syn match foxproCmd "^\s*\<on\>\s*\<exit\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<key\>"
+syn match foxproCmd "^\s*\<on\>\s*\<key\>\s*\<=\>"
+syn match foxproCmd "^\s*\<on\>\s*\<key\>\s*\<labe\%[l]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<mach\%[elp]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<pad\>"
+syn match foxproCmd "^\s*\<on\>\s*\<page\>"
+syn match foxproCmd "^\s*\<on\>\s*\<read\%[error]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<sele\%[ction]\>\s*\<bar\>"
+syn match foxproCmd "^\s*\<on\>\s*\<sele\%[ction]\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<on\>\s*\<sele\%[ction]\>\s*\<pad\>"
+syn match foxproCmd "^\s*\<on\>\s*\<sele\%[ction]\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<on\>\s*\<shut\%[down]\>"
+syn match foxproCmd "^\s*\<pack\>"
+syn match foxproCmd "^\s*\<para\%[meters]\>"
+syn match foxproCmd "^\s*\<play\>\s*\<macr\%[o]\>"
+syn match foxproCmd "^\s*\<pop\>\s*\<key\>"
+syn match foxproCmd "^\s*\<pop\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<pop\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<priv\%[ate]\>"
+syn match foxproCmd "^\s*\<proc\%[edure]\>"
+syn match foxproCmd "^\s*\<publ\%[ic]\>"
+syn match foxproCmd "^\s*\<push\>\s*\<key\>"
+syn match foxproCmd "^\s*\<push\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<push\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<quit\>"
+syn match foxproCmd "^\s*\<read\>"
+syn match foxproCmd "^\s*\<read\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<reca\%[ll]\>"
+syn match foxproCmd "^\s*\<rein\%[dex]\>"
+syn match foxproCmd "^\s*\<rele\%[ase]\>"
+syn match foxproCmd "^\s*\<rele\%[ase]\>\s*\<modu\%[le]\>"
+syn match foxproCmd "^\s*\<rena\%[me]\>"
+syn match foxproCmd "^\s*\<repl\%[ace]\>"
+syn match foxproCmd "^\s*\<repl\%[ace]\>\s*\<from\>\s*\<arra\%[y]\>"
+syn match foxproCmd "^\s*\<repo\%[rt]\>"
+syn match foxproCmd "^\s*\<rest\%[ore]\>\s*\<from\>"
+syn match foxproCmd "^\s*\<rest\%[ore]\>\s*\<macr\%[os]\>"
+syn match foxproCmd "^\s*\<rest\%[ore]\>\s*\<scre\%[en]\>"
+syn match foxproCmd "^\s*\<rest\%[ore]\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<resu\%[me]\>"
+syn match foxproCmd "^\s*\<retr\%[y]\>"
+syn match foxproCmd "^\s*\<retu\%[rn]\>"
+syn match foxproCmd "^\s*\<run\>"
+syn match foxproCmd "^\s*\<run\>\s*\/n"
+syn match foxproCmd "^\s*\<runs\%[cript]\>"
+syn match foxproCmd "^\s*\<save\>\s*\<macr\%[os]\>"
+syn match foxproCmd "^\s*\<save\>\s*\<scre\%[en]\>"
+syn match foxproCmd "^\s*\<save\>\s*\<to\>"
+syn match foxproCmd "^\s*\<save\>\s*\<wind\%[ows]\>"
+syn match foxproCmd "^\s*\<scat\%[ter]\>"
+syn match foxproCmd "^\s*\<scro\%[ll]\>"
+syn match foxproCmd "^\s*\<seek\>"
+syn match foxproCmd "^\s*\<sele\%[ct]\>"
+syn match foxproCmd "^\s*\<set\>"
+syn match foxproCmd "^\s*\<set\>\s*\<alte\%[rnate]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<ansi\>"
+syn match foxproCmd "^\s*\<set\>\s*\<apla\%[bout]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<auto\%[save]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<bell\>"
+syn match foxproCmd "^\s*\<set\>\s*\<blin\%[k]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<bloc\%[ksize]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<bord\%[er]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<brst\%[atus]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<carr\%[y]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<cent\%[ury]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<clea\%[r]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<cloc\%[k]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<coll\%[ate]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<colo\%[r]\>\s*\<of\>"
+syn match foxproCmd "^\s*\<set\>\s*\<colo\%[r]\>\s*\<of\>\s*\<sche\%[me]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<colo\%[r]\>\s*\<set\>"
+syn match foxproCmd "^\s*\<set\>\s*\<colo\%[r]\>\s*\<to\>"
+syn match foxproCmd "^\s*\<set\>\s*\<comp\%[atible]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<conf\%[irm]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<cons\%[ole]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<curr\%[ency]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<curs\%[or]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<date\>"
+syn match foxproCmd "^\s*\<set\>\s*\<debu\%[g]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<deci\%[mals]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<defa\%[ult]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<dele\%[ted]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<deli\%[miters]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<deve\%[lopment]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<devi\%[ce]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<disp\%[lay]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<dohi\%[story]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<echo\>"
+syn match foxproCmd "^\s*\<set\>\s*\<esca\%[pe]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<exac\%[t]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<excl\%[usive]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<fiel\%[ds]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<filt\%[er]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<fixe\%[d]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<form\%[at]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<full\%[path]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<func\%[tion]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<head\%[ings]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<help\>"
+syn match foxproCmd "^\s*\<set\>\s*\<help\%[filter]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<hour\%[s]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<inde\%[x]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<inte\%[nsity]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<key\>"
+syn match foxproCmd "^\s*\<set\>\s*\<keyc\%[omp]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<libr\%[ary]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<lock\>"
+syn match foxproCmd "^\s*\<set\>\s*\<loge\%[rrors]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<macd\%[esktop]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mach\%[elp]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mack\%[ey]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<marg\%[in]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mark\>\s*\<of\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mark\>\s*\<to\>"
+syn match foxproCmd "^\s*\<set\>\s*\<memo\%[width]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mess\%[age]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mous\%[e]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<mult\%[ilocks]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<near\>"
+syn match foxproCmd "^\s*\<set\>\s*\<nocp\%[trans]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<noti\%[fy]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<odom\%[eter]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<opti\%[mize]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<orde\%[r]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<pale\%[tte]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<path\>"
+syn match foxproCmd "^\s*\<set\>\s*\<pdse\%[tup]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<poin\%[t]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<prin\%[ter]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<proc\%[edure]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<read\%[border]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<refr\%[esh]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<rela\%[tion]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<rela\%[tion]\>\s*\<off\>"
+syn match foxproCmd "^\s*\<set\>\s*\<repr\%[ocess]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<reso\%[urce]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<safe\%[ty]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<scor\%[eboard]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<sepa\%[rator]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<shad\%[ows]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<skip\>"
+syn match foxproCmd "^\s*\<set\>\s*\<skip\>\s*\<of\>"
+syn match foxproCmd "^\s*\<set\>\s*\<spac\%[e]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<stat\%[us]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<stat\%[us]\>\s*\<bar\>"
+syn match foxproCmd "^\s*\<set\>\s*\<step\>"
+syn match foxproCmd "^\s*\<set\>\s*\<stic\%[ky]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<sysm\%[enu]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<talk\>"
+syn match foxproCmd "^\s*\<set\>\s*\<text\%[merge]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<text\%[merge]\>\s*\<deli\%[miters]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<topi\%[c]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<trbe\%[tween]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<type\%[ahead]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<udfp\%[arms]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<uniq\%[ue]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<view\>"
+syn match foxproCmd "^\s*\<set\>\s*\<volu\%[me]\>"
+syn match foxproCmd "^\s*\<set\>\s*\<wind\%[ow]\>\s*\<of\>\s*\<memo\>"
+syn match foxproCmd "^\s*\<set\>\s*\<xcmd\%[file]\>"
+syn match foxproCmd "^\s*\<show\>\s*\<get\>"
+syn match foxproCmd "^\s*\<show\>\s*\<gets\>"
+syn match foxproCmd "^\s*\<show\>\s*\<menu\>"
+syn match foxproCmd "^\s*\<show\>\s*\<obje\%[ct]\>"
+syn match foxproCmd "^\s*\<show\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<show\>\s*\<wind\%[ow]\>"
+syn match foxproCmd "^\s*\<size\>\s*\<popu\%[p]\>"
+syn match foxproCmd "^\s*\<skip\>"
+syn match foxproCmd "^\s*\<sort\>"
+syn match foxproCmd "^\s*\<stor\%[e]\>"
+syn match foxproCmd "^\s*\<sum\>"
+syn match foxproCmd "^\s*\<susp\%[end]\>"
+syn match foxproCmd "^\s*\<tota\%[l]\>"
+syn match foxproCmd "^\s*\<type\>"
+syn match foxproCmd "^\s*\<unlo\%[ck]\>"
+syn match foxproCmd "^\s*\<upda\%[te]\>"
+syn match foxproCmd "^\s*\<use\>"
+syn match foxproCmd "^\s*\<wait\>"
+syn match foxproCmd "^\s*\<zap\>"
+syn match foxproCmd "^\s*\<zoom\>\s*\<wind\%[ow]\>"
+
+" Enclosed Block
+syn match foxproEnBlk "^\s*\<do\>\s*\<case\>"
+syn match foxproEnBlk "^\s*\<case\>"
+syn match foxproEnBlk "^\s*\<othe\%[rwise]\>"
+syn match foxproEnBlk "^\s*\<endc\%[ase]\>"
+syn match foxproEnBlk "^\s*\<do\>\s*\<whil\%[e]\>"
+syn match foxproEnBlk "^\s*\<endd\%[o]\>"
+syn match foxproEnBlk "^\s*\<for\>"
+syn match foxproEnBlk "^\s*\<endf\%[or]\>"
+syn match foxproEnBlk "^\s*\<next\>"
+syn match foxproEnBlk "^\s*\<if\>"
+syn match foxproEnBlk "^\s*\<else\>"
+syn match foxproEnBlk "^\s*\<endi\%[f]\>"
+syn match foxproEnBlk "^\s*\<prin\%[tjob]\>"
+syn match foxproEnBlk "^\s*\<endp\%[rintjob]\>"
+syn match foxproEnBlk "^\s*\<scan\>"
+syn match foxproEnBlk "^\s*\<ends\%[can]\>"
+syn match foxproEnBlk "^\s*\<text\>"
+syn match foxproEnBlk "^\s*\<endt\%[ext]\>"
+
+" System Variables
+syn keyword foxproSysVar _alignment _assist _beautify _box _calcmem _calcvalue
+syn keyword foxproSysVar _cliptext _curobj _dblclick _diarydate _dos _foxdoc
+syn keyword foxproSysVar _foxgraph _gengraph _genmenu _genpd _genscrn _genxtab
+syn keyword foxproSysVar _indent _lmargin _mac _mline _padvance _pageno _pbpage
+syn keyword foxproSysVar _pcolno _pcopies _pdriver _pdsetup _pecode _peject _pepage
+syn keyword foxproSysVar _plength _plineno _ploffset _ppitch _pquality _pretext
+syn keyword foxproSysVar _pscode _pspacing _pwait _rmargin _shell _spellchk
+syn keyword foxproSysVar _startup _tabs _tally _text _throttle _transport _unix
+syn keyword foxproSysVar _windows _wrap
+
+" Strings
+syn region foxproString start=+"+ end=+"+ oneline
+syn region foxproString start=+'+ end=+'+ oneline
+syn region foxproString start=+\[+ end=+\]+ oneline
+
+" Constants
+syn match foxproConst "\.t\."
+syn match foxproConst "\.f\."
+
+"integer number, or floating point number without a dot and with "f".
+syn match foxproNumber "\<[0-9]\+\>"
+"floating point number, with dot, optional exponent
+syn match foxproFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match foxproFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>"
+"floating point number, without dot, with exponent
+syn match foxproFloat "\<[0-9]\+e[-+]\=[0-9]\+\>"
+
+syn match foxproComment "^\s*\*.*"
+syn match foxproComment "&&.*"
+
+"catch errors caused by wrong parenthesis
+syn region foxproParen transparent start='(' end=')' contains=ALLBUT,foxproParenErr
+syn match foxproParenErr ")"
+
+syn sync minlines=1 maxlines=3
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_foxpro_syn_inits")
+ if version < 508
+ let did_foxpro_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink foxproSpecial Special
+ HiLink foxproAtSymbol Special
+ HiLink foxproAtCmd Statement
+ HiLink foxproPreProc PreProc
+ HiLink foxproFunc Identifier
+ HiLink foxproCmd Statement
+ HiLink foxproEnBlk Type
+ HiLink foxproSysVar String
+ HiLink foxproString String
+ HiLink foxproConst Constant
+ HiLink foxproNumber Number
+ HiLink foxproFloat Float
+ HiLink foxproComment Comment
+ HiLink foxproParenErr Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "foxpro"
diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim
new file mode 100644
index 000000000..c765f33b3
--- /dev/null
+++ b/runtime/syntax/fstab.vim
@@ -0,0 +1,208 @@
+" Vim syntax file
+" Language: fstab file
+" Maintaner: Radu Dineiu <littledragon@altern.org>
+" URL: http://ld.yi.org/vim/fstab.vim
+" ChangeLog: http://ld.yi.org/vim/fstab.ChangeLog
+" Last Change: 2003 Apr 30
+" Version: 0.61
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" General
+syn cluster fsGeneralCluster contains=fsComment
+syn match fsComment /\s*#.*/
+syn match fsOperator /[,=]/
+
+" Device
+syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
+syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@]\|^\w\{-}\ze\W\)/ contained
+syn keyword fsDeviceKeyword contained none proc linproc tmpfs
+syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
+syn match fsDeviceLabel contained /=[^ \t]\+/hs=s+1 contains=fsOperator
+
+" Mount Point
+syn cluster fsMountPointCluster contains=fsMountPointKeyword,fsMountPointError
+syn match fsMountPointError /\%([^ \ta-zA-Z0-9_\/#@]\|\s\+\zs\w\{-}\ze\s\)/ contained
+syn keyword fsMountPointKeyword contained none swap
+
+" Type
+syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeError
+syn match fsTypeError /\s\+\zs\w\+/ contained
+syn keyword fsTypeKeyword contained adfs affs auto autofs cd9660 coda cramfs devfs devpts efs ext2 ext3 fdesc hfs hpfs iso9660 kernfs linprocfs mfs minix msdos ncpfs nfs ntfs nwfs null portal proc procfs qnx4 reiserfs romfs smbfs std sysv swap tmpfs udf ufs umap umsdos union vfat xfs
+
+" Options
+" -------
+" Options: General
+syn cluster fsOptionsCluster contains=fsOperator,fsOptionsGeneral,fsOptionsKeywords,fsTypeError
+syn match fsOptionsNumber /\d\+/
+syn match fsOptionsNumberOctal /[0-8]\+/
+syn match fsOptionsString /[a-zA-Z0-9_-]\+/
+syn keyword fsOptionsYesNo yes no
+syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck
+syn keyword fsOptionsSize 512 1024 2048
+syn keyword fsOptionsGeneral async atime auto current defaults dev exec force fstab noatime noauto noclusterr noclusterw nodev noexec nosuid nosymfollow nouser owner ro rdonly rw rq sw xx suid suiddir sync kudzu union update user supermount
+syn match fsOptionsGeneral /_netdev/
+
+" Options: adfs
+syn match fsOptionsKeywords contained /\%([ug]id\|o\%(wn\|th\)mask\)=/ nextgroup=fsOptionsNumber
+
+" Options: affs
+syn match fsOptionsKeywords contained /\%(set[ug]id\|mode\|reserved\)=/ nextgroup=fsOptionsNumber
+syn match fsOptionsKeywords contained /\%(prefix\|volume\|root\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /bs=/ nextgroup=fsOptionsSize
+syn keyword fsOptionsKeywords contained protect usemp verbose
+
+" Options: cd9660
+syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
+
+" Options: devpts
+" -- everything already defined
+
+" Options: ext2
+syn match fsOptionsKeywords contained /check=*/ nextgroup=@fsOptionsCheckCluster
+syn match fsOptionsKeywords contained /errors=/ nextgroup=fsOptionsExt2Errors
+syn match fsOptionsKeywords contained /\%(res[gu]id\|sb\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsExt2Check contained none normal strict
+syn keyword fsOptionsExt2Errors contained continue panic
+syn match fsOptionsExt2Errors contained /remount-ro/
+syn keyword fsOptionsKeywords contained bsddf minixdf debug grpid bsdgroups nocheck nogrpid sysvgroups nouid32
+
+" Options: ext3
+syn match fsOptionsKeywords contained /journal=/ nextgroup=fsOptionsExt3Journal
+syn match fsOptionsKeywords contained /data=/ nextgroup=fsOptionsExt3Data
+syn keyword fsOptionsExt3Journal contained update inum
+syn keyword fsOptionsExt3Data contained journal ordered writeback
+syn keyword fsOptionsKeywords contained noload
+
+" Options: fat
+syn match fsOptionsKeywords contained /blocksize=/ nextgroup=fsOptionsSize
+syn match fsOptionsKeywords contained /\%([dfu]mask\|codepage\)=/ nextgroup=fsOptionsNumberOctal
+syn match fsOptionsKeywords contained /\%(cvf_\%(format\|option\)\|iocharset\)=/ nextgroup=fsOptionsString
+syn match fsOptionsKeywords contained /check=/ nextgroup=@fsOptionsCheckCluster
+syn match fsOptionsKeywords contained /conv=*/ nextgroup=fsOptionsConv
+syn match fsOptionsKeywords contained /fat=/ nextgroup=fsOptionsFatType
+syn match fsOptionsKeywords contained /dotsOK=/ nextgroup=fsOptionsYesNo
+syn keyword fsOptionsFatCheck contained r n s relaxed normal strict
+syn keyword fsOptionsConv contained b t a binary text auto
+syn keyword fsOptionsFatType contained 12 16 32
+syn keyword fsOptionsKeywords contained quiet sys_immutable showexec dots nodots
+
+" Options: hpfs
+syn match fsOptionsKeywords contained /case=/ nextgroup=fsOptionsHpfsCase
+syn keyword fsOptionsHpfsCase contained lower asis
+
+" Options: iso9660
+syn match fsOptionsKeywords contained /map=/ nextgroup=fsOptionsIsoMap
+syn match fsOptionsKeywords contained /block=/ nextgroup=fsOptionsSize
+syn match fsOptionsKeywords contained /\%(session\|sbsector\)=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsIsoMap contained n o a normal off acorn
+syn keyword fsOptionsKeywords contained norock nojoilet unhide cruft
+syn keyword fsOptionsConv contained m mtext
+
+" Options: nfs
+syn match fsOptionsKeywords contained /\%(rsize\|wsize\|timeo\|retrans\|acregmin\|acregmax\|acdirmin\|acdirmax\|actimeo\|retry\|port\|mountport\|mounthost\|mountprog\|mountvers\|nfsprog\|nfsvers\|namelen\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained bg fg soft hard intr cto ac tcp udp lock nobg nofg nosoft nohard nointr noposix nocto noac notcp noudp nolock
+
+" Options: ntfs
+syn match fsOptionsKeywords contained /\%(posix=*\|uni_xlate=\)/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsKeywords contained utf8
+
+" Options: proc
+" -- everything already defined
+
+" Options: reiserfs
+syn match fsOptionsKeywords contained /hash=/ nextgroup=fsOptionsReiserHash
+syn match fsOptionsKeywords contained /resize=/ nextgroup=fsOptionsNumber
+syn keyword fsOptionsReiserHash contained rupasov tea r5 detect
+syn keyword fsOptionsKeywords contained hashed_relocation noborder nolog notail no_unhashed_relocation replayonly
+
+" Options: udf
+syn match fsOptionsKeywords contained /\%(anchor\|partition\|lastblock\|fileset\|rootdir\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained unhide undelete strict novrs
+
+" Options: ufs
+syn match fsOptionsKeywords contained /ufstype=/ nextgroup=fsOptionsUfsType
+syn match fsOptionsKeywords contained /onerror=/ nextgroup=fsOptionsUfsError
+syn keyword fsOptionsUfsType contained old 44bsd sun sunx86 nextstep openstep
+syn match fsOptionsUfsType contained /nextstep-cd/
+syn keyword fsOptionsUfsError contained panic lock umount repair
+
+" Options: vfat
+syn keyword fsOptionsKeywords contained nonumtail posix utf8
+syn match fsOptionsKeywords contained /shortname=/ nextgroup=fsOptionsVfatShortname
+syn keyword fsOptionsVfatShortname contained lower win95 winnt mixed
+
+" Options: xfs
+syn match fsOptionsKeywords contained /\%(biosize\|logbufs\|logbsize\|logdev\|rtdev\|sunit\|swidth\)=/ nextgroup=fsOptionsString
+syn keyword fsOptionsKeywords contained dmapi xdsm noalign noatime norecovery osyncisdsync quota usrquota uquoenforce grpquota gquoenforce
+
+" Frequency / Pass No.
+syn cluster fsFreqPassCluster contains=fsFreqPassNumber,fsFreqPassError
+syn match fsFreqPassError /\s\+\zs\%(\D.*\|\S.*\|\d\+\s\+[^012]\)\ze/ contained
+syn match fsFreqPassNumber /\d\+\s\+[012]\s*/ contained
+
+" Groups
+syn match fsDevice /^\s*\zs.\{-1,}\s/me=e-1 nextgroup=fsMountPoint contains=@fsDeviceCluster,@fsGeneralCluster
+syn match fsMountPoint /\s\+.\{-}\s/me=e-1 nextgroup=fsType contains=@fsMountPointCluster,@fsGeneralCluster contained
+syn match fsType /\s\+.\{-}\s/me=e-1 nextgroup=fsOptions contains=@fsTypeCluster,@fsGeneralCluster contained
+syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptionsCluster,@fsGeneralCluster contained
+syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
+
+" Whole line comments
+syn match fsCommentLine /^#.*$/
+
+if version >= 508 || !exists("did_config_syntax_inits")
+ if version < 508
+ let did_config_syntax_inits = 1
+ command! -nargs=+ HiLink hi link <args>
+ else
+ command! -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink fsOperator Operator
+ HiLink fsComment Comment
+ HiLink fsCommentLine Comment
+
+ HiLink fsTypeKeyword Type
+ HiLink fsDeviceKeyword Identifier
+ HiLink fsDeviceLabel String
+ HiLink fsFreqPassNumber Number
+
+ HiLink fsTypeError Error
+ HiLink fsDeviceError Error
+ HiLink fsMountPointError Error
+ HiLink fsMountPointKeyword Keyword
+ HiLink fsFreqPassError Error
+
+ HiLink fsOptionsGeneral Type
+ HiLink fsOptionsKeywords Keyword
+ HiLink fsOptionsNumber Number
+ HiLink fsOptionsNumberOctal Number
+ HiLink fsOptionsString String
+ HiLink fsOptionsSize Number
+ HiLink fsOptionsExt2Check String
+ HiLink fsOptionsExt2Errors String
+ HiLink fsOptionsExt3Journal String
+ HiLink fsOptionsExt3Data String
+ HiLink fsOptionsFatCheck String
+ HiLink fsOptionsConv String
+ HiLink fsOptionsFatType Number
+ HiLink fsOptionsYesNo String
+ HiLink fsOptionsHpfsCase String
+ HiLink fsOptionsIsoMap String
+ HiLink fsOptionsReiserHash String
+ HiLink fsOptionsUfsType String
+ HiLink fsOptionsUfsError String
+
+ HiLink fsOptionsVfatShortname String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fstab"
+
+" vim: ts=8 ft=vim
diff --git a/runtime/syntax/fvwm.vim b/runtime/syntax/fvwm.vim
new file mode 100644
index 000000000..ff1b78399
--- /dev/null
+++ b/runtime/syntax/fvwm.vim
@@ -0,0 +1,349 @@
+" Vim syntax file
+" Language: Fvwm{1,2} configuration file
+" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
+" Last Change: 2002 Jun 2
+"
+" Thanks to David Necas (Yeti) for adding Fvwm 2.4 support.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Fvwm configuration files are case insensitive
+syn case ignore
+
+" Identifiers in Fvwm can contain most characters, so we only
+" include the most common ones here.
+if version >= 600
+ setlocal iskeyword=_,-,+,.,a-z,A-Z,48-57
+else
+ set iskeyword=_,-,+,.,a-z,A-Z,48-57
+endif
+
+" Read system colors from the color database (rgb.txt)
+if exists("rgb_file")
+ " We don't want any hit-return prompts, so we make sure that
+ " &shortmess is set to `O'
+ let __fvwm_oldshm = &shortmess
+ set shortmess=O
+
+ " And we set &report to a huge number, so that no hit-return prompts
+ " will be given
+ let __fvwm_oldreport = &report
+ set report=10000
+
+ " Append the color database to the fvwm configuration, and read the
+ " colors from this buffer
+ let __fvwm_i = line("$") + 1
+ exe "$r" rgb_file
+ let __fvwm_lastline = line("$")
+ while __fvwm_i <= __fvwm_lastline
+ let __fvwm_s = matchstr(getline(__fvwm_i), '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\h.*$')
+ if __fvwm_s != ""
+ exe "syn keyword fvwmColors ".substitute(__fvwm_s, '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\h.*\)$', '\1', "")
+ endif
+ let __fvwm_i = __fvwm_i + 1
+ endwhile
+
+ " Remove the appended data
+ undo
+
+ " Goto first line again
+ 1
+
+ " and restore the old values of the variables
+ let &shortmess = __fvwm_oldshm
+ let &report = __fvwm_oldreport
+ unlet __fvwm_i __fvwm_s __fvwm_lastline __fvwm_oldshm __fvwm_oldreport
+endif
+" done reading colors
+
+syn match fvwmWhitespace "\s\+" contained
+syn match fvwmEnvVar "\$\w\+"
+syn match fvwmModConf "^\s*\*\a\+" contains=fvwmWhitespace
+syn match fvwmString '".\{-}"'
+syn match fvwmRGBValue "#\x\{3}"
+syn match fvwmRGBValue "#\x\{6}"
+syn match fvwmRGBValue "#\x\{9}"
+syn match fvwmRGBValue "#\x\{12}"
+syn match fvwmRGBValue "rgb:\x\{1,4}/\x\{1,4}/\x\{1,4}"
+syn match fvwmPath "\<IconPath\s.*$"lc=8 contains=fvwmEnvVar
+syn match fvwmPath "\<ModulePath\s.*$"lc=10 contains=fvwmEnvVar
+syn match fvwmPath "\<PixmapPath\s.*$"lc=10 contains=fvwmEnvVar
+syn match fvwmModule "\<Module\s\+\w\+"he=s+6
+syn match fvwmKey "\<Key\s\+\w\+"he=s+3
+syn keyword fvwmExec Exec
+syn match fvwmComment "^#.*$"
+
+if (exists("b:fvwm_version") && b:fvwm_version == 1) || (exists("use_fvwm_1") && use_fvwm_1)
+ syn match fvwmEnvVar "\$(\w\+)"
+ syn region fvwmStyle matchgroup=fvwmFunction start="^\s*Style\>"hs=e-5 end="$" oneline keepend contains=fvwmString,fvwmKeyword,fvwmWhiteSpace
+
+ syn keyword fvwmFunction AppsBackingStore AutoRaise BackingStore
+ syn keyword fvwmFunction Beep BoundaryWidth ButtonStyle
+ syn keyword fvwmFunction CenterOnCirculate CirculateDown
+ syn keyword fvwmFunction CirculateHit CirculateSkip
+ syn keyword fvwmFunction CirculateSkipIcons CirculateUp
+ syn keyword fvwmFunction ClickTime ClickToFocus Close Cursor
+ syn keyword fvwmFunction CursorMove DecorateTransients Delete
+ syn keyword fvwmFunction Desk DeskTopScale DeskTopSize Destroy
+ syn keyword fvwmFunction DontMoveOff EdgeResistance EdgeScroll
+ syn keyword fvwmFunction EndFunction EndMenu EndPopup Focus
+ syn keyword fvwmFunction Font Function GotoPage HiBackColor
+ syn keyword fvwmFunction HiForeColor Icon IconBox IconFont
+ syn keyword fvwmFunction Iconify IconPath Key Lenience Lower
+ syn keyword fvwmFunction Maximize MenuBackColor MenuForeColor
+ syn keyword fvwmFunction MenuStippleColor Module ModulePath Mouse
+ syn keyword fvwmFunction Move MWMBorders MWMButtons MWMDecorHints
+ syn keyword fvwmFunction MWMFunctionHints MWMHintOverride MWMMenus
+ syn keyword fvwmFunction NoBorder NoBoundaryWidth Nop NoPPosition
+ syn keyword fvwmFunction NoTitle OpaqueMove OpaqueResize Pager
+ syn keyword fvwmFunction PagerBackColor PagerFont PagerForeColor
+ syn keyword fvwmFunction PagingDefault PixmapPath Popup Quit Raise
+ syn keyword fvwmFunction RaiseLower RandomPlacement Refresh Resize
+ syn keyword fvwmFunction Restart SaveUnders Scroll SloppyFocus
+ syn keyword fvwmFunction SmartPlacement StartsOnDesk StaysOnTop
+ syn keyword fvwmFunction StdBackColor StdForeColor Stick Sticky
+ syn keyword fvwmFunction StickyBackColor StickyForeColor
+ syn keyword fvwmFunction StickyIcons StubbornIconPlacement
+ syn keyword fvwmFunction StubbornIcons StubbornPlacement
+ syn keyword fvwmFunction SuppressIcons Title TogglePage Wait Warp
+ syn keyword fvwmFunction WindowFont WindowList WindowListSkip
+ syn keyword fvwmFunction WindowsDesk WindowShade XORvalue
+
+ " These keywords are only used after the "Style" command. To avoid
+ " name collision with several commands, they are contained.
+ syn keyword fvwmKeyword BackColor BorderWidth BoundaryWidth contained
+ syn keyword fvwmKeyword Button CirculateHit CirculateSkip Color contained
+ syn keyword fvwmKeyword DoubleClick ForeColor Handles HandleWidth contained
+ syn keyword fvwmKeyword Icon IconTitle NoBorder NoBoundaryWidth contained
+ syn keyword fvwmKeyword NoButton NoHandles NoIcon NoIconTitle contained
+ syn keyword fvwmKeyword NoTitle Slippery StartIconic StartNormal contained
+ syn keyword fvwmKeyword StartsAnyWhere StartsOnDesk StaysOnTop contained
+ syn keyword fvwmKeyword StaysPut Sticky Title WindowListHit contained
+ syn keyword fvwmKeyword WindowListSkip contained
+elseif (exists("b:fvwm_version") && b:fvwm_version == 2) || (exists("use_fvwm_2") && use_fvwm_2)
+ syn match fvwmEnvVar "\${\w\+}"
+ syn match fvwmEnvVar "\$\[[^]]\+\]"
+ syn match fvwmEnvVar "\$[$0-9*]"
+ syn match fvwmDef '^\s*+\s*".\{-}"' contains=fvwmMenuString,fvwmWhitespace
+ syn match fvwmIcon '%.\{-}%' contained
+ syn match fvwmIcon '\*.\{-}\*' contained
+ syn match fvwmMenuString '".\{-}"' contains=fvwmIcon,fvwmShortcutKey contained
+ syn match fvwmShortcutKey "&." contained
+ syn match fvwmModule "\<KillModule\s\+\w\+"he=s+10 contains=fvwmModuleName
+ syn match fvwmModule "\<SendToModule\s\+\w\+"he=s+12 contains=fvwmModuleName
+ syn match fvwmModule "\<DestroyModuleConfig\s\+\w\+"he=s+19 contains=fvwmModuleName
+
+ syn keyword fvwmFunction AddButtonStyle AddTitleStyle AddToDecor AddToFunc
+ syn keyword fvwmFunction AddToMenu AnimatedMove Beep BorderStyle BugOpts
+ syn keyword fvwmFunction BusyCursor ButtonState ButtonStyle ChangeDecor
+ syn keyword fvwmFunction ChangeMenuStyle ClickTime Close ColorLimit
+ syn keyword fvwmFunction ColormapFocus CopyMenuStyle Current CursorMove
+ syn keyword fvwmFunction CursorStyle DefaultColors DefaultColorset
+ syn keyword fvwmFunction DefaultFont DefaultIcon DefaultLayers Delete Desk
+ syn keyword fvwmFunction DeskTopSize Destroy DestroyDecor DestroyFunc
+ syn keyword fvwmFunction DestroyMenu DestroyMenuStyle Direction Echo
+ syn keyword fvwmFunction EdgeResistance EdgeScroll EdgeThickness Emulate
+ syn keyword fvwmFunction EscapeFunc Exec ExecUseShell ExitFunction
+ syn keyword fvwmFunction FakeClick FlipFocus Focus Function GlobalOpts
+ syn keyword fvwmFunction GnomeButton GotoDesk GotoDeskAndPage GotoPage
+ syn keyword fvwmFunction HideGeometryWindow HilightColor HilightColorset
+ syn keyword fvwmFunction IconFont IconPath Iconify IgnoreModifiers
+ syn keyword fvwmFunction ImagePath Key Layer Lower Maximize Menu MenuStyle
+ syn keyword fvwmFunction ModulePath ModuleSynchronous ModuleTimeout
+ syn keyword fvwmFunction Mouse Move MoveThreshold MoveToDesk MoveToPage
+ syn keyword fvwmFunction MoveToScreen Next None Nop OpaqueMoveSize
+ syn keyword fvwmFunction PipeRead PixmapPath PlaceAgain PointerKey
+ syn keyword fvwmFunction Popup Prev Quit QuitScreen QuitSession Raise
+ syn keyword fvwmFunction RaiseLower Read Recapture RecaptureWindow
+ syn keyword fvwmFunction Refresh RefreshWindow Resize ResizeMove
+ syn keyword fvwmFunction Restart SaveQuitSession SaveSession Scroll
+ syn keyword fvwmFunction SetAnimation SetEnv SetMenuDelay SetMenuStyle
+ syn keyword fvwmFunction Silent SnapAttraction SnapGrid Stick Stroke
+ syn keyword fvwmFunction StrokeFunc Style Title TitleStyle UnsetEnv
+ syn keyword fvwmFunction UpdateDecor UpdateStyles Wait WarpToWindow
+ syn keyword fvwmFunction WindowFont WindowId WindowList WindowShade
+ syn keyword fvwmFunction WindowShadeAnimate WindowsDesk Xinerama
+ syn keyword fvwmFunction XineramaPrimaryScreen XineramaSls XineramaSlsSize
+ syn keyword fvwmFunction XorPixmap XorValue
+
+ syn keyword fvwmKeyword Active ActiveColorset ActiveDown
+ syn keyword fvwmKeyword ActiveFore ActiveForeOff ActivePlacement
+ syn keyword fvwmKeyword ActivePlacementHonorsStartsOnPage
+ syn keyword fvwmKeyword ActivePlacementIgnoresStartsOnPage ActiveUp All
+ syn keyword fvwmKeyword AllowRestack Alphabetic Anim Animated Animation
+ syn keyword fvwmKeyword AnimationOff AutomaticHotkeys AutomaticHotkeysOff
+ syn keyword fvwmKeyword BGradient BackColor Background BackingStore
+ syn keyword fvwmKeyword BackingStoreOff BorderColorset BorderWidth
+ syn keyword fvwmKeyword Bottom Button Button0 Button1 Button2 Button3
+ syn keyword fvwmKeyword Button4 Button5 Button6 Button7 Button8
+ syn keyword fvwmKeyword Button9 CGradient CaptureHonorsStartsOnPage
+ syn keyword fvwmKeyword CaptureIgnoresStartsOnPage CascadePlacement
+ syn keyword fvwmKeyword Centered CirculateHit CirculateHitIcon
+ syn keyword fvwmKeyword CirculateHitShaded CirculateSkip
+ syn keyword fvwmKeyword CirculateSkipIcon CirculateSkipShaded Clear
+ syn keyword fvwmKeyword ClickToFocus ClickToFocusDoesntPassClick
+ syn keyword fvwmKeyword ClickToFocusDoesntRaise ClickToFocusPassesClick
+ syn keyword fvwmKeyword ClickToFocusPassesClickOff ClickToFocusRaises
+ syn keyword fvwmKeyword ClickToFocusRaisesOff Color Colorset Context
+ syn keyword fvwmKeyword CurrentDesk CurrentPage CurrentPageAnyDesk
+ syn keyword fvwmKeyword DGradient DecorateTransient Default
+ syn keyword fvwmKeyword DepressableBorder Desk DontLowerTransient
+ syn keyword fvwmKeyword DontRaiseTransient DontStackTransientParent
+ syn keyword fvwmKeyword DoubleClickTime Down DumbPlacement DynamicMenu
+ syn keyword fvwmKeyword DynamicPopDownAction DynamicPopUpAction
+ syn keyword fvwmKeyword East Expect FVWM FirmBorder Fixed
+ syn keyword fvwmKeyword FixedPosition Flat FlickeringMoveWorkaround
+ syn keyword fvwmKeyword FlickeringQtDialogsWorkaround FocusFollowsMouse
+ syn keyword fvwmKeyword FollowsFocus FollowsMouse Font ForeColor
+ syn keyword fvwmKeyword Foreground Function Fvwm FvwmBorder
+ syn keyword fvwmKeyword FvwmButtons GNOMEIgnoreHints GNOMEUseHints
+ syn keyword fvwmKeyword GrabFocus GrabFocusOff GrabFocusTransient
+ syn keyword fvwmKeyword GrabFocusTransientOff Greyed GreyedColorset
+ syn keyword fvwmKeyword HGradient HandleWidth Handles Height
+ syn keyword fvwmKeyword HiddenHandles Hilight3DOff Hilight3DThick
+ syn keyword fvwmKeyword Hilight3DThickness Hilight3DThin HilightBack
+ syn keyword fvwmKeyword HilightBackOff HilightBorderColorset
+ syn keyword fvwmKeyword HilightColorset HilightFore HintOverride
+ syn keyword fvwmKeyword HoldSubmenus Icon IconBox IconFill IconFont
+ syn keyword fvwmKeyword IconGrid IconOverride IconTitle Iconic
+ syn keyword fvwmKeyword IconifyWindowGroups IconifyWindowGroupsOff
+ syn keyword fvwmKeyword Icons IgnoreRestack Inactive Interior Item
+ syn keyword fvwmKeyword ItemFormat KeepWindowGroupsOnDesk Layer Left
+ syn keyword fvwmKeyword LeftJustified Lenience LowerTransient MWM
+ syn keyword fvwmKeyword MWMBorder MWMButtons MWMDecor MWMDecorMax
+ syn keyword fvwmKeyword MWMDecorMenu MWMDecorMin MWMFunctions
+ syn keyword fvwmKeyword ManualPlacement ManualPlacementHonorsStartsOnPage
+ syn keyword fvwmKeyword ManualPlacementIgnoresStartsOnPage MaxWindowSize
+ syn keyword fvwmKeyword Maximized Menu MenuColorset MenuFace
+ syn keyword fvwmKeyword MinOverlapPercentPlacement MinOverlapPlacement
+ syn keyword fvwmKeyword MiniIcon MixedVisualWorkaround ModalityIsEvil
+ syn keyword fvwmKeyword ModuleSynchronous Mouse MouseFocus
+ syn keyword fvwmKeyword MouseFocusClickDoesntRaise MouseFocusClickRaises
+ syn keyword fvwmKeyword MouseFocusClickRaisesOff Move Mwm MwmBorder
+ syn keyword fvwmKeyword MwmButtons MwmDecor MwmFunctions NakedTransient
+ syn keyword fvwmKeyword Never NeverFocus NoActiveIconOverride NoButton
+ syn keyword fvwmKeyword NoDecorHint NoDeskSort NoFuncHint NoGeometry
+ syn keyword fvwmKeyword NoGeometryWithInfo NoHandles NoHotkeys NoIcon
+ syn keyword fvwmKeyword NoIconOverride NoIconPosition NoIconTitle
+ syn keyword fvwmKeyword NoIcons NoInset NoLenience NoNormal
+ syn keyword fvwmKeyword NoOLDecor NoOnBottom NoOnTop NoOverride
+ syn keyword fvwmKeyword NoPPosition NoResizeOverride NoSticky
+ syn keyword fvwmKeyword NoStipledTitles NoTitle NoTransientPPosition
+ syn keyword fvwmKeyword NoTransientUSPosition NoUSPosition
+ syn keyword fvwmKeyword NoWarp Normal North Northeast Northwest
+ syn keyword fvwmKeyword NotAlphabetic OLDecor OnBottom OnTop Once
+ syn keyword fvwmKeyword OnlyIcons OnlyListSkip OnlyNormal OnlyOnBottom
+ syn keyword fvwmKeyword OnlyOnTop OnlySticky Opacity ParentalRelativity
+ syn keyword fvwmKeyword Pixmap PopdownDelayed PopdownDelay PopupDelay
+ syn keyword fvwmKeyword PopupAsRootMenu PopupAsSubmenu PopdownImmediately
+ syn keyword fvwmKeyword PopupDelayed PopupImmediately PopupOffset
+ syn keyword fvwmKeyword Quiet RGradient RaiseOverNativeWindows
+ syn keyword fvwmKeyword RaiseOverUnmanaged RaiseTransient
+ syn keyword fvwmKeyword Raised Read RecaptureHonorsStartsOnPage
+ syn keyword fvwmKeyword RecaptureIgnoresStartsOnPage Rectangle
+ syn keyword fvwmKeyword RemoveSubmenus Reset Resize ResizeHintOverride
+ syn keyword fvwmKeyword ResizeOpaque ResizeOutline ReverseOrder
+ syn keyword fvwmKeyword Right RightJustified Root SGradient SameType
+ syn keyword fvwmKeyword SaveUnder SaveUnderOff ScatterWindowGroups
+ syn keyword fvwmKeyword Screen SelectInPlace SelectOnRelease
+ syn keyword fvwmKeyword SelectWarp SeparatorsLong SeparatorsShort
+ syn keyword fvwmKeyword ShowMapping SideColor SidePic Simple
+ syn keyword fvwmKeyword SkipMapping Slippery SlipperyIcon SloppyFocus
+ syn keyword fvwmKeyword SmartPlacement SmartPlacementIsNormal
+ syn keyword fvwmKeyword SmartPlacementIsReallySmart Solid South
+ syn keyword fvwmKeyword Southeast Southwest StackTransientParent
+ syn keyword fvwmKeyword StartIconic StartNormal StartsAnyWhere
+ syn keyword fvwmKeyword StartsLowered StartsOnDesk StartsOnPage
+ syn keyword fvwmKeyword StartsOnPageIgnoresTransients
+ syn keyword fvwmKeyword StartsOnPageIncludesTransients StartsOnScreen
+ syn keyword fvwmKeyword StartsRaised StaysOnBottom StaysOnTop StaysPut
+ syn keyword fvwmKeyword Sticky StickyIcon StipledTitles StippledTitle
+ syn keyword fvwmKeyword StippledTitleOff SubmenusLeft SubmenusRight Sunk
+ syn keyword fvwmKeyword This TileCascadePlacement TileManualPlacement
+ syn keyword fvwmKeyword TiledPixmap Timeout Title TitleAtBottom
+ syn keyword fvwmKeyword TitleAtTop TitleUnderlines0 TitleUnderlines1
+ syn keyword fvwmKeyword TitleUnderlines2 TitleWarp TitleWarpOff Top
+ syn keyword fvwmKeyword Transient TrianglesRelief TrianglesSolid
+ syn keyword fvwmKeyword Up UseBorderStyle UseDecor UseIconName
+ syn keyword fvwmKeyword UseIconPosition UseListSkip UsePPosition
+ syn keyword fvwmKeyword UseStyle UseTitleStyle UseTransientPPosition
+ syn keyword fvwmKeyword UseTransientUSPosition UseUSPosition VGradient
+ syn keyword fvwmKeyword VariablePosition Vector VerticalItemSpacing
+ syn keyword fvwmKeyword VerticalTitleSpacing WIN Wait Warp WarpTitle
+ syn keyword fvwmKeyword West Win Window WindowListHit WindowListSkip
+ syn keyword fvwmKeyword WindowShadeScrolls WindowShadeShrinks
+ syn keyword fvwmKeyword WindowShadeSteps Windows XineramaRoot YGradient
+ syn keyword fvwmKeyword bottomright default pointer prev quiet
+ syn keyword fvwmKeyword True False Toggle
+
+ syn keyword fvwmConditionName AcceptsFocus CurrentDesk CurrentGlobalPage
+ syn keyword fvwmConditionName CurrentGlobalPageAnyDesk CurrentPage
+ syn keyword fvwmConditionName CurrentPageAnyDesk CurrentScreen Iconic Layer
+ syn keyword fvwmConditionName Maximized PlacedByButton3 PlacedByFvwm Raised
+ syn keyword fvwmConditionName Shaded Sticky Transient Visible
+
+ syn keyword fvwmContextName BOTTOM BOTTOM_EDGE BOTTOM_LEFT BOTTOM_RIGHT
+ syn keyword fvwmContextName DEFAULT DESTROY LEFT LEFT_EDGE MENU MOVE
+ syn keyword fvwmContextName RESIZE RIGHT RIGHT_EDGE ROOT SELECT STROKE SYS
+ syn keyword fvwmContextName TITLE TOP TOP_EDGE TOP_LEFT TOP_RIGHT WAIT
+ syn keyword fvwmContextName POSITION
+
+ syn keyword fvwmFunctionName contained FvwmAnimate FvwmAudio FvwmAuto
+ syn keyword fvwmFunctionName contained FvwmBacker FvwmBanner FvwmButtons
+ syn keyword fvwmFunctionName contained FvwmCascade FvwmCommandS
+ syn keyword fvwmFunctionName contained FvwmConsole FvwmConsoleC FvwmCpp
+ syn keyword fvwmFunctionName contained FvwmDebug FvwmDragWell FvwmEvent
+ syn keyword fvwmFunctionName contained FvwmForm FvwmGtk FvwmIconBox
+ syn keyword fvwmFunctionName contained FvwmIconMan FvwmIdent FvwmM4
+ syn keyword fvwmFunctionName contained FvwmPager FvwmRearrange FvwmSave
+ syn keyword fvwmFunctionName contained FvwmSaveDesk FvwmScript FvwmScroll
+ syn keyword fvwmFunctionName contained FvwmTalk FvwmTaskBar FvwmTheme
+ syn keyword fvwmFunctionName contained FvwmTile FvwmWharf FvwmWinList
+
+ syn keyword fvwmFunctionName StartFunction InitFunction RestartFunction
+ syn keyword fvwmFunctionName ExitFunction SessionInitFunction
+ syn keyword fvwmFunctionName SessionRestartFunction SessionExitFunction
+ syn keyword fvwmFunctionName MissingSubmenuFunction
+endif
+
+if version >= 508 || !exists("did_fvwm_syntax_inits")
+ if version < 508
+ let did_fvwm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink fvwmComment Comment
+ HiLink fvwmEnvVar Macro
+ HiLink fvwmExec Function
+ HiLink fvwmFunction Function
+ HiLink fvwmFunctionName Special
+ HiLink fvwmContextName Function
+ HiLink fvwmConditionName Function
+ HiLink fvwmIcon Comment
+ HiLink fvwmKey Function
+ HiLink fvwmKeyword Keyword
+ HiLink fvwmMenuString String
+ HiLink fvwmModConf Macro
+ HiLink fvwmModule Function
+ HiLink fvwmModuleName Special
+ HiLink fvwmRGBValue Type
+ HiLink fvwmShortcutKey SpecialChar
+ HiLink fvwmString String
+
+ if exists("rgb_file")
+ HiLink fvwmColors Type
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "fvwm"
+" vim: sts=4 sw=4 ts=8
diff --git a/runtime/syntax/fvwm2m4.vim b/runtime/syntax/fvwm2m4.vim
new file mode 100644
index 000000000..243da18fa
--- /dev/null
+++ b/runtime/syntax/fvwm2m4.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: FvwmM4 preprocessed Fvwm2 configuration files
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-06-02
+" URI: http://physics.muni.cz/~yeti/download/syntax/fvwmm4.vim
+
+" Setup
+if version >= 600
+ if exists('b:current_syntax')
+ finish
+ endif
+else
+ syntax clear
+endif
+
+" Let included files know they are included
+if !exists('main_syntax')
+ let main_syntax = 'fvwm2m4'
+endif
+
+" Include M4 syntax
+if version >= 600
+ runtime! syntax/m4.vim
+else
+ so <sfile>:p:h/m4.vim
+endif
+unlet b:current_syntax
+
+" Include Fvwm2 syntax (Fvwm1 doesn't have M4 preprocessor)
+if version >= 600
+ runtime! syntax/fvwm.vim
+else
+ so <sfile>:p:h/fvwm.vim
+endif
+unlet b:current_syntax
+
+" That's all!
+let b:current_syntax = 'fvwm2m4'
+
+if main_syntax == 'fvwm2m4'
+ unlet main_syntax
+endif
+
diff --git a/runtime/syntax/gdb.vim b/runtime/syntax/gdb.vim
new file mode 100644
index 000000000..c874a0465
--- /dev/null
+++ b/runtime/syntax/gdb.vim
@@ -0,0 +1,111 @@
+" Vim syntax file
+" Language: GDB command files
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/gdb.vim
+" Last Change: 2003 Jan 04
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword gdbInfo contained address architecture args breakpoints catch common copying dcache
+syn keyword gdbInfo contained display files float frame functions handle line
+syn keyword gdbInfo contained locals program registers scope set sharedlibrary signals
+syn keyword gdbInfo contained source sources stack symbol target terminal threads
+syn keyword gdbInfo contained syn keyword tracepoints types udot variables warranty watchpoints
+syn match gdbInfo contained "all-registers"
+
+
+syn keyword gdbStatement contained actions apply attach awatch backtrace break bt call catch cd clear collect commands
+syn keyword gdbStatement contained complete condition continue delete detach directory disable disassemble display down
+syn keyword gdbStatement contained echo else enable end file finish frame handle hbreak help if ignore
+syn keyword gdbStatement contained inspect jump kill list load maintenance make next nexti ni output overlay
+syn keyword gdbStatement contained passcount path print printf ptype pwd quit rbreak remote return run rwatch
+syn keyword gdbStatement contained search section set sharedlibrary shell show si signal source step stepi stepping
+syn keyword gdbStatement contained stop target tbreak tdump tfind thbreak thread tp trace tstart tstatus tstop
+syn keyword gdbStatement contained tty undisplay unset until up watch whatis where while ws x
+syn match gdbFuncDef "\<define\>.*"
+syn match gdbStatmentContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef
+syn match gdbStatement "^\s*info" nextgroup=gdbInfo skipwhite skipempty
+
+" some commonly used abreviations
+syn keyword gdbStatement c disp undisp disas p
+
+syn region gdbDocument matchgroup=gdbFuncDef start="\<document\>.*$" matchgroup=gdbFuncDef end="^end$"
+
+syn match gdbStatement "\<add-shared-symbol-files\>"
+syn match gdbStatement "\<add-symbol-file\>"
+syn match gdbStatement "\<core-file\>"
+syn match gdbStatement "\<dont-repeat\>"
+syn match gdbStatement "\<down-silently\>"
+syn match gdbStatement "\<exec-file\>"
+syn match gdbStatement "\<forward-search\>"
+syn match gdbStatement "\<reverse-search\>"
+syn match gdbStatement "\<save-tracepoints\>"
+syn match gdbStatement "\<select-frame\>"
+syn match gdbStatement "\<symbol-file\>"
+syn match gdbStatement "\<up-silently\>"
+syn match gdbStatement "\<while-stepping\>"
+
+syn keyword gdbSet annotate architecture args check complaints confirm editing endian
+syn keyword gdbSet environment gnutarget height history language listsize print prompt
+syn keyword gdbSet radix remotebaud remotebreak remotecache remotedebug remotedevice remotelogbase
+syn keyword gdbSet remotelogfile remotetimeout remotewritesize targetdebug variable verbose
+syn keyword gdbSet watchdog width write
+syn match gdbSet "\<auto-solib-add\>"
+syn match gdbSet "\<solib-absolute-prefix\>"
+syn match gdbSet "\<solib-search-path\>"
+syn match gdbSet "\<stop-on-solib-events\>"
+syn match gdbSet "\<symbol-reloading\>"
+syn match gdbSet "\<input-radix\>"
+syn match gdbSet "\<demangle-style\>"
+syn match gdbSet "\<output-radix\>"
+
+syn match gdbComment "^\s*#.*"
+
+syn match gdbVariable "\$\K\k*"
+
+" Strings and constants
+syn region gdbString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match gdbCharacter "'[^']*'" contains=gdbSpecialChar,gdbSpecialCharError
+syn match gdbCharacter "'\\''" contains=gdbSpecialChar
+syn match gdbCharacter "'[^\\]'"
+syn match gdbNumber "\<[0-9_]\+\>"
+syn match gdbNumber "\<0x[0-9a-fA-F_]\+\>"
+
+
+if !exists("gdb_minlines")
+ let gdb_minlines = 10
+endif
+exec "syn sync ccomment gdbComment minlines=" . gdb_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_gdb_syn_inits")
+ if version < 508
+ let did_gdb_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink gdbFuncDef Function
+ HiLink gdbComment Comment
+ HiLink gdbStatement Statement
+ HiLink gdbString String
+ HiLink gdbCharacter Character
+ HiLink gdbVariable Identifier
+ HiLink gdbSet Constant
+ HiLink gdbInfo Type
+ HiLink gdbDocument Special
+ HiLink gdbNumber Number
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gdb"
+
+" vim: ts=8
diff --git a/runtime/syntax/gdmo.vim b/runtime/syntax/gdmo.vim
new file mode 100644
index 000000000..08a6b357f
--- /dev/null
+++ b/runtime/syntax/gdmo.vim
@@ -0,0 +1,96 @@
+" Vim syntax file
+" Language: GDMO
+" (ISO-10165-4; Guidelines for the Definition of Managed Object)
+" Maintainer: Gyuman Kim <violino@dooly.modacom.co.kr>
+" URL: http://dooly.modacom.co.kr/gdmo.vim
+" Last change: 2001 Sep 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" keyword definitions
+syn match gdmoCategory "MANAGED\s\+OBJECT\s\+CLASS"
+syn keyword gdmoCategory NOTIFICATION ATTRIBUTE BEHAVIOUR PACKAGE ACTION
+syn match gdmoCategory "NAME\s\+BINDING"
+syn match gdmoRelationship "DERIVED\s\+FROM"
+syn match gdmoRelationship "SUPERIOR\s\+OBJECT\s\+CLASS"
+syn match gdmoRelationship "SUBORDINATE\s\+OBJECT\s\+CLASS"
+syn match gdmoExtension "AND\s\+SUBCLASSES"
+syn match gdmoDefinition "DEFINED\s\+AS"
+syn match gdmoDefinition "REGISTERED\s\+AS"
+syn match gdmoExtension "ORDER\s\+BY"
+syn match gdmoReference "WITH\s\+ATTRIBUTE"
+syn match gdmoReference "WITH\s\+INFORMATION\s\+SYNTAX"
+syn match gdmoReference "WITH\s\+REPLY\s\+SYNTAX"
+syn match gdmoReference "WITH\s\+ATTRIBUTE\s\+SYNTAX"
+syn match gdmoExtension "AND\s\+ATTRIBUTE\s\+IDS"
+syn match gdmoExtension "MATCHES\s\+FOR"
+syn match gdmoReference "CHARACTERIZED\s\+BY"
+syn match gdmoReference "CONDITIONAL\s\+PACKAGES"
+syn match gdmoExtension "PRESENT\s\+IF"
+syn match gdmoExtension "DEFAULT\s\+VALUE"
+syn match gdmoExtension "PERMITTED\s\+VALUES"
+syn match gdmoExtension "REQUIRED\s\+VALUES"
+syn match gdmoExtension "NAMED\s\+BY"
+syn keyword gdmoReference ATTRIBUTES NOTIFICATIONS ACTIONS
+syn keyword gdmoExtension DELETE CREATE
+syn keyword gdmoExtension EQUALITY SUBSTRINGS ORDERING
+syn match gdmoExtension "REPLACE-WITH-DEFAULT"
+syn match gdmoExtension "GET"
+syn match gdmoExtension "GET-REPLACE"
+syn match gdmoExtension "ADD-REMOVE"
+syn match gdmoExtension "WITH-REFERENCE-OBJECT"
+syn match gdmoExtension "WITH-AUTOMATIC-INSTANCE-NAMING"
+syn match gdmoExtension "ONLY-IF-NO-CONTAINED-OBJECTS"
+
+
+" Strings and constants
+syn match gdmoSpecial contained "\\\d\d\d\|\\."
+syn region gdmoString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gdmoSpecial
+syn match gdmoCharacter "'[^\\]'"
+syn match gdmoSpecialCharacter "'\\.'"
+syn match gdmoNumber "0[xX][0-9a-fA-F]\+\>"
+syn match gdmoLineComment "--.*"
+syn match gdmoLineComment "--.*--"
+
+syn match gdmoDefinition "^\s*[a-zA-Z][-a-zA-Z0-9_.\[\] \t{}]* *::="me=e-3
+syn match gdmoBraces "[{}]"
+
+syn sync ccomment gdmoComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_gdmo_syntax_inits")
+ if version < 508
+ let did_gdmo_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gdmoCategory Structure
+ HiLink gdmoRelationship Macro
+ HiLink gdmoDefinition Statement
+ HiLink gdmoReference Type
+ HiLink gdmoExtension Operator
+ HiLink gdmoBraces Function
+ HiLink gdmoSpecial Special
+ HiLink gdmoString String
+ HiLink gdmoCharacter Character
+ HiLink gdmoSpecialCharacter gdmoSpecial
+ HiLink gdmoComment Comment
+ HiLink gdmoLineComment gdmoComment
+ HiLink gdmoType Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gdmo"
+
+" vim: ts=8
diff --git a/runtime/syntax/gedcom.vim b/runtime/syntax/gedcom.vim
new file mode 100644
index 000000000..98851cc94
--- /dev/null
+++ b/runtime/syntax/gedcom.vim
@@ -0,0 +1,66 @@
+" Vim syntax file
+" Language: Gedcom
+" Maintainer: Paul Johnson (pjcj@transeda.com)
+" Version 1.059 - 23rd December 1999
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case match
+
+syntax keyword gedcom_record ABBR ADDR ADOP ADR1 ADR2 AFN AGE AGNC ALIA ANCE
+syntax keyword gedcom_record ANCI ANUL ASSO AUTH BAPL BAPM BARM BASM BIRT BLES
+syntax keyword gedcom_record BLOB BURI CALN CAST CAUS CENS CHAN CHAR CHIL CHR
+syntax keyword gedcom_record CHRA CITY CONC CONF CONL CONT COPR CORP CREM CTRY
+syntax keyword gedcom_record DATA DEAT DESC DESI DEST DIV DIVF DSCR EDUC EMIG
+syntax keyword gedcom_record ENDL ENGA EVEN FAM FAMC FAMF FAMS FCOM FILE FORM
+syntax keyword gedcom_record GEDC GIVN GRAD HEAD HUSB IDNO IMMI INDI LANG MARB
+syntax keyword gedcom_record MARC MARL MARR MARS MEDI NATI NATU NCHI NICK NMR
+syntax keyword gedcom_record NOTE NPFX NSFX OBJE OCCU ORDI ORDN PAGE PEDI PHON
+syntax keyword gedcom_record PLAC POST PROB PROP PUBL QUAY REFN RELA RELI REPO
+syntax keyword gedcom_record RESI RESN RETI RFN RIN ROLE SEX SLGC SLGS SOUR
+syntax keyword gedcom_record SPFX SSN STAE STAT SUBM SUBN SURN TEMP TEXT TIME
+syntax keyword gedcom_record TITL TRLR TYPE VERS WIFE WILL
+syntax keyword gedcom_record DATE nextgroup=gedcom_date
+syntax keyword gedcom_record NAME nextgroup=gedcom_name
+
+syntax case ignore
+
+syntax region gedcom_id start="@" end="@" oneline contains=gedcom_ii, gedcom_in
+syntax match gedcom_ii "\I\+" contained nextgroup=gedcom_in
+syntax match gedcom_in "\d\+" contained
+syntax region gedcom_name start="" end="$" skipwhite oneline contains=gedcom_cname, gedcom_surname contained
+syntax match gedcom_cname "\i\+" contained
+syntax match gedcom_surname "/\(\i\|\s\)*/" contained
+syntax match gedcom_date "\d\{1,2}\s\+\(jan\|feb\|mar\|apr\|may\|jun\|jul\|aug\|sep\|oct\|nov\|dec\)\s\+\d\+"
+syntax match gedcom_date ".*" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_gedcom_syntax_inits")
+ if version < 508
+ let did_gedcom_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gedcom_record Statement
+ HiLink gedcom_id Comment
+ HiLink gedcom_ii PreProc
+ HiLink gedcom_in Type
+ HiLink gedcom_name PreProc
+ HiLink gedcom_cname Type
+ HiLink gedcom_surname Identifier
+ HiLink gedcom_date Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gedcom"
diff --git a/runtime/syntax/gkrellmrc.vim b/runtime/syntax/gkrellmrc.vim
new file mode 100644
index 000000000..6ce123841
--- /dev/null
+++ b/runtime/syntax/gkrellmrc.vim
@@ -0,0 +1,91 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: gkrellm theme files `gkrellmrc'
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-04-30
+" URL: http://trific.ath.cx/Ftp/vim/syntax/gkrellmrc.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if version >= 600
+ setlocal iskeyword=_,-,a-z,A-Z,48-57
+else
+ set iskeyword=_,-,a-z,A-Z,48-57
+endif
+
+syn case match
+
+" Base constructs
+syn match gkrellmrcComment "#.*$" contains=gkrellmrcFixme
+syn keyword gkrellmrcFixme FIXME TODO XXX NOT contained
+syn region gkrellmrcString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline
+syn match gkrellmrcNumber "^-\=\(\d\+\)\=\.\=\d\+"
+syn match gkrellmrcNumber "\W-\=\(\d\+\)\=\.\=\d\+"lc=1
+syn keyword gkrellmrcConstant none
+syn match gkrellmrcRGBColor "#\(\x\{12}\|\x\{9}\|\x\{6}\|\x\{3}\)\>"
+
+" Keywords
+syn keyword gkrellmrcBuiltinExt cpu_nice_color cpu_nice_grid_color krell_depth krell_expand krell_left_margin krell_right_margin krell_x_hot krell_yoff mem_krell_buffers_depth mem_krell_buffers_expand mem_krell_buffers_x_hot mem_krell_buffers_yoff mem_krell_cache_depth mem_krell_cache_expand mem_krell_cache_x_hot mem_krell_cache_yoff sensors_bg_volt timer_bg_timer
+syn keyword gkrellmrcGlobal allow_scaling author chart_width_ref theme_alternatives
+syn keyword gkrellmrcSetCmd set_image_border set_integer set_string
+syn keyword gkrellmrcGlobal bg_slider_meter_border bg_slider_panel_border
+syn keyword gkrellmrcGlobal frame_bottom_height frame_left_width frame_right_width frame_top_height frame_left_chart_overlap frame_right_chart_overlap frame_left_panel_overlap frame_right_panel_overlap frame_left_spacer_overlap frame_right_spacer_overlap spacer_overlap_off cap_images_off
+syn keyword gkrellmrcGlobal frame_bottom_border frame_left_border frame_right_border frame_top_border spacer_top_border spacer_bottom_border frame_left_chart_border frame_right_chart_border frame_left_panel_border frame_right_panel_border
+syn keyword gkrellmrcGlobal chart_in_color chart_in_color_grid chart_out_color chart_out_color_grid
+syn keyword gkrellmrcGlobal bg_separator_height bg_grid_mode
+syn keyword gkrellmrcGlobal rx_led_x rx_led_y tx_led_x tx_led_y
+syn keyword gkrellmrcGlobal decal_mail_frames decal_mail_delay
+syn keyword gkrellmrcGlobal decal_alarm_frames decal_warn_frames
+syn keyword gkrellmrcGlobal krell_slider_depth krell_slider_expand krell_slider_x_hot
+syn keyword gkrellmrcGlobal button_panel_border button_meter_border
+syn keyword gkrellmrcGlobal large_font normal_font small_font
+syn keyword gkrellmrcGlobal spacer_bottom_height spacer_top_height spacer_bottom_height_chart spacer_top_height_chart spacer_bottom_height_meter spacer_top_height_meter
+syn keyword gkrellmrcExpandMode left right bar-mode left-scaled right-scaled bar-mode-scaled
+syn keyword gkrellmrcMeterName apm cal clock fs host mail mem swap timer sensors uptime
+syn keyword gkrellmrcChartName cpu proc disk inet and net
+syn match gkrellmrcSpecialClassName "\*"
+syn keyword gkrellmrcStyleCmd StyleMeter StyleChart StylePanel
+syn keyword gkrellmrcStyleItem textcolor alt_textcolor font alt_font transparency border label_position margin margins left_margin right_margin top_margin bottom_margin krell_depth krell_yoff krell_x_hot krell_expand krell_left_margin krell_right_margin
+
+" Define the default highlighting
+if version >= 508 || !exists("did_gtkrc_syntax_inits")
+ if version < 508
+ let did_gtkrc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gkrellmrcComment Comment
+ HiLink gkrellmrcFixme Todo
+
+ HiLink gkrellmrcString gkrellmrcConstant
+ HiLink gkrellmrcNumber gkrellmrcConstant
+ HiLink gkrellmrcRGBColor gkrellmrcConstant
+ HiLink gkrellmrcExpandMode gkrellmrcConstant
+ HiLink gkrellmrcConstant Constant
+
+ HiLink gkrellmrcMeterName gkrellmrcClass
+ HiLink gkrellmrcChartName gkrellmrcClass
+ HiLink gkrellmrcSpecialClassName gkrellmrcClass
+ HiLink gkrellmrcClass Type
+
+ HiLink gkrellmrcGlobal gkrellmrcItem
+ HiLink gkrellmrcBuiltinExt gkrellmrcItem
+ HiLink gkrellmrcStyleItem gkrellmrcItem
+ HiLink gkrellmrcItem Function
+
+ HiLink gkrellmrcSetCmd Special
+ HiLink gkrellmrcStyleCmd Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gkrellmrc"
diff --git a/runtime/syntax/gnuplot.vim b/runtime/syntax/gnuplot.vim
new file mode 100644
index 000000000..a6fa716e2
--- /dev/null
+++ b/runtime/syntax/gnuplot.vim
@@ -0,0 +1,198 @@
+" Vim syntax file
+" Language: gnuplot 3.8i.0
+" Maintainer: John Hoelzel johnh51@users.sourceforge.net
+" Last Change: Mon May 26 02:33:33 UTC 2003
+" Filenames: *.gpi *.gih scripts: #!*gnuplot
+" URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
+"
+
+" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz> for heads up - working on more changes .
+" *.gpi = GnuPlot Input - what I use because there is no other guideline. jeh 11/2000
+" *.gih = makes using cut/pasting from gnuplot.gih easier ...
+" #!*gnuplot = for Linux bash shell scripts of gnuplot commands.
+" emacs used a suffix of '<gp?>'
+" gnuplot demo files show no preference.
+" I will post mail and newsgroup comments on a standard suffix in 'URL' directory.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" some shortened names to make demo files look clean... jeh. 11/2000
+" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
+
+" commands
+
+syn keyword gnuplotStatement cd call clear exit set unset plot splot help
+syn keyword gnuplotStatement load pause quit fit rep[lot] if
+syn keyword gnuplotStatement FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
+syn keyword gnuplotStatement FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
+syn keyword gnuplotStatement print pwd reread reset save show test ! functions var
+syn keyword gnuplotConditional if
+" if is cond + stmt - ok?
+
+" numbers fm c.vim
+
+" integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match gnuplotNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
+" floating point number, with dot, optional exponent
+syn match gnuplotFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
+" floating point number, starting with a dot, optional exponent
+syn match gnuplotFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
+" floating point number, without dot, with exponent
+syn match gnuplotFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
+" hex number
+syn match gnuplotNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+syn case match
+" flag an octal number with wrong digits by not hilighting
+syn match gnuplotOctalError "\<0[0-7]*[89]"
+
+" plot args
+
+syn keyword gnuplotType u[sing] tit[le] notit[le] wi[th] steps fs[teps]
+syn keyword gnuplotType title notitle t
+syn keyword gnuplotType with w
+syn keyword gnuplotType li[nes] l
+" t - too much? w - too much? l - too much?
+syn keyword gnuplotType linespoints via
+
+" funcs
+
+syn keyword gnuplotFunc abs acos acosh arg asin asinh atan atanh atan2
+syn keyword gnuplotFunc besj0 besj1 besy0 besy1
+syn keyword gnuplotFunc ceil column cos cosh erf erfc exp floor gamma
+syn keyword gnuplotFunc ibeta inverf igamma imag invnorm int lgamma
+syn keyword gnuplotFunc log log10 norm rand real sgn sin sinh sqrt tan
+syn keyword gnuplotFunc lambertw
+syn keyword gnuplotFunc tanh valid
+syn keyword gnuplotFunc tm_hour tm_mday tm_min tm_mon tm_sec
+syn keyword gnuplotFunc tm_wday tm_yday tm_year
+
+" set vars
+
+syn keyword gnuplotType xdata timefmt grid noytics ytics fs
+syn keyword gnuplotType logscale time notime mxtics nomxtics style mcbtics
+syn keyword gnuplotType nologscale
+syn keyword gnuplotType axes x1y2 unique acs[plines]
+syn keyword gnuplotType size origin multiplot xtics xr[ange] yr[ange] square nosquare ratio noratio
+syn keyword gnuplotType binary matrix index every thru sm[ooth]
+syn keyword gnuplotType all angles degrees radians
+syn keyword gnuplotType arrow noarrow autoscale noautoscale arrowstyle
+" autoscale args = x y xy z t ymin ... - too much?
+" needs code to: using title vs autoscale t
+syn keyword gnuplotType x y z zcb
+syn keyword gnuplotType linear cubicspline bspline order level[s]
+syn keyword gnuplotType auto disc[rete] incr[emental] from to head nohead
+syn keyword gnuplotType graph base both nosurface table out[put] data
+syn keyword gnuplotType bar border noborder boxwidth
+syn keyword gnuplotType clabel noclabel clip noclip cntrp[aram]
+syn keyword gnuplotType contour nocontour
+syn keyword gnuplotType dgrid3d nodgrid3d dummy encoding format
+" set encoding args not included - yet.
+syn keyword gnuplotType function grid nogrid hidden[3d] nohidden[3d] isosample[s] key nokey
+syn keyword gnuplotType historysize nohistorysize
+syn keyword gnuplotType defaults offset nooffset trianglepattern undefined noundefined altdiagonal bentover noaltdiagonal nobentover
+syn keyword gnuplotType left right top bottom outside below samplen spacing width height box nobox linestyle ls linetype lt linewidth lw
+syn keyword gnuplotType Left Right autotitles noautotitles enhanced noenhanced
+syn keyword gnuplotType isosamples
+syn keyword gnuplotType label nolabel logscale nolog[scale] missing center font locale
+syn keyword gnuplotType mapping margin bmargin lmargin rmargin tmargin spherical cylindrical cartesian
+syn keyword gnuplotType linestyle nolinestyle linetype lt linewidth lw pointtype pt pointsize ps
+syn keyword gnuplotType mouse nomouse
+syn keyword gnuplotType nooffsets data candlesticks financebars linespoints lp vector nosurface
+syn keyword gnuplotType term[inal] linux aed767 aed512 gpic
+syn keyword gnuplotType regis tek410x tek40 vttek kc-tek40xx
+syn keyword gnuplotType km-tek40xx selanar bitgraph xlib x11 X11
+" x11 args
+syn keyword gnuplotType aifm cgm dumb fig gif small large size nofontlist winword6 corel dxf emf
+syn keyword gnuplotType hpgl
+" syn keyword gnuplotType transparent hp2623a hp2648 hp500c pcl5 why jeh
+syn keyword gnuplotType hp2623a hp2648 hp500c pcl5
+syn match gnuplotType "\<transparent\>"
+syn keyword gnuplotType hpljii hpdj hppj imagen mif pbm png svg
+syn keyword gnuplotType postscript enhanced_postscript qms table
+" postscript editing values?
+syn keyword gnuplotType tgif tkcanvas epson-180dpi epson-60dpi
+syn keyword gnuplotType epson-lx800 nec-cp6 okidata starc
+syn keyword gnuplotType tandy-60dpi latex emtex pslatex pstex epslatex
+syn keyword gnuplotType eepic tpic pstricks texdraw mf metafont mpost mp
+syn keyword gnuplotType timestamp notimestamp
+syn keyword gnuplotType variables version
+syn keyword gnuplotType x2data y2data ydata zdata
+syn keyword gnuplotType reverse writeback noreverse nowriteback
+syn keyword gnuplotType axis mirror autofreq nomirror rotate autofreq norotate
+syn keyword gnuplotType update
+syn keyword gnuplotType multiplot nomultiplot mytics
+syn keyword gnuplotType nomytics mztics nomztics mx2tics nomx2tics
+syn keyword gnuplotType my2tics nomy2tics offsets origin output
+syn keyword gnuplotType para[metric] nopara[metric] pointsize polar nopolar
+syn keyword gnuplotType zrange x2range y2range rrange cbrange
+syn keyword gnuplotType trange urange vrange sample[s] size
+syn keyword gnuplotType bezier boxerrorbars boxes bargraph bar[s]
+syn keyword gnuplotType boxxy[errorbars] csplines dots fsteps histeps impulses
+syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps
+" w lt lw ls = optional
+syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
+syn keyword gnuplotType errorb[ars surface
+syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed
+syn keyword gnuplotType at pi front
+syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines
+syn keyword gnuplotType tics ticslevel ticscale time timefmt view
+syn keyword gnuplotType xdata xdtics noxdtics ydtics noydtics
+syn keyword gnuplotType zdtics nozdtics x2dtics nox2dtics y2dtics noy2dtics
+syn keyword gnuplotType xlab[el] ylab[el] zlab[el] cblab[el] x2label y2label xmtics
+syn keyword gnuplotType xmtics noxmtics ymtics noymtics zmtics nozmtics
+syn keyword gnuplotType x2mtics nox2mtics y2mtics noy2mtics
+syn keyword gnuplotType cbdtics nocbdtics cbmtics nocbmtics cbtics nocbtics
+syn keyword gnuplotType xtics noxtics ytics noytics
+syn keyword gnuplotType ztics noztics x2tics nox2tics
+syn keyword gnuplotType y2tics noy2tics zero nozero zeroaxis nozeroaxis
+syn keyword gnuplotType xzeroaxis noxzeroaxis yzeroaxis noyzeroaxis
+syn keyword gnuplotType x2zeroaxis nox2zeroaxis y2zeroaxis noy2zeroaxis
+syn keyword gnuplotType angles one two fill empty solid pattern
+syn keyword gnuplotType default
+syn keyword gnuplotType scansautomatic flush b[egin] noftriangles implicit
+" b too much? - used in demo
+syn keyword gnuplotType palette positive negative ps_allcF nops_allcF maxcolors
+syn keyword gnuplotType push fontfile pop
+syn keyword gnuplotType rgbformulae defined file color model gradient colornames
+syn keyword gnuplotType RGB HSV CMY YIQ XYZ
+syn keyword gnuplotType colorbox vertical horizontal user bdefault
+syn keyword gnuplotType loadpath fontpath decimalsign in out
+
+" comments + strings
+syn region gnuplotComment start="#" end="$"
+syn region gnuplotComment start=+"+ skip=+\\"+ end=+"+
+syn region gnuplotComment start=+'+ end=+'+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_gnuplot_syntax_inits")
+ if version < 508
+ let did_gnuplot_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gnuplotStatement Statement
+ HiLink gnuplotConditional Conditional
+ HiLink gnuplotNumber Number
+ HiLink gnuplotFloat Float
+ HiLink gnuplotOctalError Error
+ HiLink gnuplotFunc Type
+ HiLink gnuplotType Type
+ HiLink gnuplotComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gnuplot"
+
+" vim: ts=8
diff --git a/runtime/syntax/gp.vim b/runtime/syntax/gp.vim
new file mode 100644
index 000000000..1999749c0
--- /dev/null
+++ b/runtime/syntax/gp.vim
@@ -0,0 +1,79 @@
+" Vim syntax file
+" Language: gp (version 2.1)
+" Maintainer: Karim Belabas <Karim.Belabas@math.u-psud.fr>
+" Last change: 2001 Sep 02
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" some control statements
+syntax keyword gpStatement break return next
+syntax keyword gpConditional if
+syntax keyword gpRepeat until while for fordiv forprime forstep forvec
+syntax keyword gpScope local global
+
+syntax keyword gpInterfaceKey buffersize colors compatible debug debugmem
+syntax keyword gpInterfaceKey echo format help histsize log logfile output
+syntax keyword gpInterfaceKey parisize path primelimit prompt psfile
+syntax keyword gpInterfaceKey realprecision seriesprecision simplify
+syntax keyword gpInterfaceKey strictmatch timer
+
+syntax match gpInterface "^\s*\\[a-z].*"
+syntax keyword gpInterface default
+syntax keyword gpInput read input
+
+" functions
+syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*[^ \t=]"me=e-1 contains=gpFunction,gpArgs
+syntax match gpFunRegion "^\s*[a-zA-Z][_a-zA-Z0-9]*(.*)\s*=\s*$" contains=gpFunction,gpArgs
+syntax match gpArgs contained "[a-zA-Z][_a-zA-Z0-9]*"
+syntax match gpFunction contained "^\s*[a-zA-Z][_a-zA-Z0-9]*("me=e-1
+
+" String and Character constants
+" Highlight special (backslash'ed) characters differently
+syntax match gpSpecial contained "\\[ent\\]"
+syntax region gpString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gpSpecial
+
+"comments
+syntax region gpComment start="/\*" end="\*/" contains=gpTodo
+syntax match gpComment "\\\\.*" contains=gpTodo
+syntax keyword gpTodo contained TODO
+syntax sync ccomment gpComment minlines=10
+
+"catch errors caused by wrong parenthesis
+syntax region gpParen transparent start='(' end=')' contains=ALLBUT,gpParenError,gpTodo,gpFunction,gpArgs,gpSpecial
+syntax match gpParenError ")"
+syntax match gpInParen contained "[{}]"
+
+if version >= 508 || !exists("did_gp_syn_inits")
+ if version < 508
+ let did_gp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gpConditional Conditional
+ HiLink gpRepeat Repeat
+ HiLink gpError Error
+ HiLink gpParenError gpError
+ HiLink gpInParen gpError
+ HiLink gpStatement Statement
+ HiLink gpString String
+ HiLink gpComment Comment
+ HiLink gpInterface Type
+ HiLink gpInput Type
+ HiLink gpInterfaceKey Statement
+ HiLink gpFunction Function
+ HiLink gpScope Type
+ " contained ones
+ HiLink gpSpecial Special
+ HiLink gpTodo Todo
+ HiLink gpArgs Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gp"
+" vim: ts=8
diff --git a/runtime/syntax/gpg.vim b/runtime/syntax/gpg.vim
new file mode 100644
index 000000000..23401969a
--- /dev/null
+++ b/runtime/syntax/gpg.vim
@@ -0,0 +1,72 @@
+" Vim syntax file
+" Language: GnuPG Configuration File.
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/gpg/
+" Latest Revision: 2004-05-06
+" arch-tag: 602305f7-d8ae-48ef-a68f-4d54f12af70a
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk 48-57,65-90,97-122,-
+delcommand SetIsk
+
+" comments
+syn region gpgComment contained display oneline start="#" end="$" contains=gpgTodo,gpgID
+
+" todo
+syn keyword gpgTodo contained FIXME TODO XXX NOTE
+
+" ids
+syn match gpgID contained display "\<\(0x\)\=\x\{8,}\>"
+
+syn match gpgBegin "^" skipwhite nextgroup=gpgComment,gpgOption,gpgCommand
+
+" commands that take args
+syn keyword gpgCommand contained skipwhite nextgroup=gpgArg check-sigs decrypt decrypt-files delete-key delete-secret-and-public-key delete-secret-key edit-key encrypt-files export export-all export-ownertrust export-secret-keys export-secret-subkeys fast-import fingerprint gen-prime gen-random import import-ownertrust list-keys list-public-keys list-secret-keys list-sigs lsign-key nrsign-key print-md print-mds recv-keys search-keys send-keys sign-key verify verify-files
+" commands that take no args
+syn keyword gpgCommand contained skipwhite nextgroup=gpgArgError check-trustdb clearsign desig-revoke detach-sign encrypt gen-key gen-revoke help list-packets rebuild-keydb-caches sign store symmetric update-trustdb version warranty
+
+" options that take args
+syn keyword gpgOption contained skipwhite nextgroup=gpgArg attribute-fd cert-digest-algo charset cipher-algo command-fd comment completes-needed compress compress-algo debug default-cert-check-level default-key default-preference-list default-recipient digest-algo disable-cipher-algo disable-pubkey-algo encrypt-to exec-path export-options group homedir import-options keyring keyserver keyserver-options load-extension local-user logger-fd marginals-needed max-cert-depth notation-data options output override-session-key passphrase-fd personal-cipher-preferences personal-compress-preferences personal-digest-preferences photo-viewer recipient s2k-cipher-algo s2k-digest-algo s2k-mode secret-keyring set-filename set-policy-url status-fd trusted-key
+" options that take no args
+syn keyword gpgOption contained skipwhite nextgroup=gpgArgError allow-freeform-uid allow-non-selfsigned-uid allow-secret-key-import always-trust armor ask-cert-expire ask-sig-expire auto-check-trustdb batch debug-all default-comment default-recipient-self dry-run emit-version emulate-md-encode-bug enable-special-filenames escape-from-lines expert fast-list-mode fixed-list-mode for-your-eyes-only force-mdc force-v3-sigs force-v4-certs gpg-agent-info ignore-crc-error ignore-mdc-error ignore-time-conflict ignore-valid-from interactive list-only lock-multiple lock-never lock-once merge-only no no-allow-non-selfsigned-uid no-armor no-ask-cert-expire no-ask-sig-expire no-auto-check-trustdb no-batch no-comment no-default-keyring no-default-recipient no-encrypt-to no-expensive-trust-checks no-expert no-for-your-eyes-only no-force-v3-sigs no-force-v4-certs no-greeting no-literal no-mdc-warning no-options no-permission-warning no-pgp2 no-pgp6 no-pgp7 no-random-seed-file no-secmem-warning no-show-notation no-show-photos no-show-policy-url no-sig-cache no-sig-create-check no-sk-comments no-tty no-utf8-strings no-verbose no-version not-dash-escaped openpgp pgp2 pgp6 pgp7 preserve-permissions quiet rfc1991 set-filesize show-keyring show-notation show-photos show-policy-url show-session-key simple-sk-checksum sk-comments skip-verify textmode throw-keyid try-all-secrets use-agent use-embedded-filename utf8-strings verbose with-colons with-fingerprint with-key-data yes
+
+" arguments to commands and options
+syn match gpgArg contained display "\S\+\(\s\+\S\+\)*" contains=gpgID
+syn match gpgArgError contained display "\S\+\(\s\+\S\+\)*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_gpg_syn_inits")
+ if version < 508
+ let did_gpg_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gpgComment Comment
+ HiLink gpgTodo Todo
+ HiLink gpgID Number
+ HiLink gpgOption Keyword
+ HiLink gpgCommand Error
+ HiLink gpgArgError Error
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gpg"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/grads.vim b/runtime/syntax/grads.vim
new file mode 100644
index 000000000..0b88549d4
--- /dev/null
+++ b/runtime/syntax/grads.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" Language: grads (GrADS scripts)
+" Maintainer: Stefan Fronzek (sfronzek at gmx dot net)
+" Last change: 13 Feb 2004
+
+" Grid Analysis and Display System (GrADS); http://grads.iges.org/grads
+" This syntax file defines highlighting for only very few features of
+" the GrADS scripting language.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" GrADS is entirely case-insensitive.
+syn case ignore
+
+" The keywords
+
+syn keyword gradsStatement if else endif break exit return
+syn keyword gradsStatement while endwhile say prompt pull function
+syn keyword gradsStatement subwrd sublin substr read write close
+" String
+
+syn region gradsString start=+'+ end=+'+
+
+" Integer number
+syn match gradsNumber "[+-]\=\<[0-9]\+\>"
+
+" Operator
+
+"syn keyword gradsOperator | ! % & != >=
+"syn match gradsOperator "[^\.]not[^a-zA-Z]"
+
+" Variables
+
+syn keyword gradsFixVariables lat lon lev result rec rc
+syn match gradsglobalVariables "_[a-zA-Z][a-zA-Z0-9]*"
+syn match gradsVariables "[a-zA-Z][a-zA-Z0-9]*"
+syn match gradsConst "#[A-Z][A-Z_]+"
+
+" Comments
+
+syn match gradsComment "\*.*"
+
+" Typical Typos
+
+" for C programmers:
+" syn match gradsTypos "=="
+" syn match gradsTypos "!="
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't hgs highlighting+yet
+if version >= 508 || !exists("did_gs_syn_inits")
+ if version < 508
+ let did_gs_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gradsStatement Statement
+
+ HiLink gradsString String
+ HiLink gradsNumber Number
+
+ HiLink gradsFixVariables Special
+ HiLink gradsVariables Identifier
+ HiLink gradsglobalVariables Special
+ HiLink gradsConst Special
+
+ HiLink gradsClassMethods Function
+
+ HiLink gradsOperator Operator
+ HiLink gradsComment Comment
+
+ HiLink gradsTypos Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "grads"
diff --git a/runtime/syntax/groff.vim b/runtime/syntax/groff.vim
new file mode 100644
index 000000000..d4dc0cc4f
--- /dev/null
+++ b/runtime/syntax/groff.vim
@@ -0,0 +1,10 @@
+" VIM syntax file
+" Language: groff
+" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
+" URL: http://dradul.tripod.com/vim
+" Last Change: 2003-05-08-12:41:13 GMT-5.
+
+" This uses the nroff.vim syntax file.
+let b:main_syntax = "nroff"
+let b:nroff_is_groff = 1
+runtime! syntax/nroff.vim
diff --git a/runtime/syntax/grub.vim b/runtime/syntax/grub.vim
new file mode 100644
index 000000000..e87a8d93e
--- /dev/null
+++ b/runtime/syntax/grub.vim
@@ -0,0 +1,77 @@
+" Vim syntax file
+" Language: GRUB Configuration File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/grub/
+" Latest Revision: 2004-05-06
+" arch-tag: 7a56ddd0-e551-44bc-b8c0-235fedbdf3c0
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" comments
+syn region grubComment display oneline start="^#" end="$" contains=grubTodo
+
+" todo
+syn keyword grubTodo contained TODO FIXME XXX NOTE
+
+" devices
+syn match grubDevice display "(\([fh]d\d\|\d\+\|0x\x\+\)\(,\d\+\)\=\(,\l\)\=)"
+
+" block lists
+syn match grubBlock display "\(\d\+\)\=+\d\+\(,\(\d\+\)\=+\d\+\)*"
+
+" numbers
+syn match grubNumbers display "+\=\<\d\+\|0x\x\+\>"
+
+syn match grubBegin display "^" nextgroup=grubCommand,grubComment skipwhite
+
+" menu commands
+syn keyword grubCommand contained default fallback hiddenmenu timeout title
+
+" general commands
+syn keyword grubCommand contained bootp color device dhcp hide ifconfig pager
+syn keyword grubCommand contained partnew parttype password rarp serial setkey
+syn keyword grubCommand contained terminal tftpserver unhide blocklist boot cat
+syn keyword grubCommand contained chainloader cmp configfile debug displayapm
+syn keyword grubCommand contained displaymem embed find fstest geometry halt help
+syn keyword grubCommand contained impsprobe initrd install ioprobe kernel lock
+syn keyword grubCommand contained makeactive map md5crypt module modulenounzip pause
+syn keyword grubCommand contained quit reboot read root rootnoverify savedefault
+syn keyword grubCommand contained setup testload testvbe uppermem vbeprobe
+
+" colors
+syn match grubColor "\(blink-\)\=\(black\|blue\|green\|cyan\|red\|magenta\|brown\|yellow\|white\)"
+syn match grubColor "\<\(blink-\)\=light-\(gray\|blue\|green\|cyan\|red\|magenta\)"
+syn match grubColor "\<\(blink-\)\=dark-gray"
+
+" specials
+syn keyword grubSpecial saved
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_grub_syn_inits")
+ if version < 508
+ let did_grub_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink grubComment Comment
+ HiLink grubTodo Todo
+ HiLink grubNumbers Number
+ HiLink grubDevice Identifier
+ HiLink grubBlock Identifier
+ HiLink grubCommand Keyword
+ HiLink grubColor Identifier
+ HiLink grubSpecial Special
+ delcommand HiLink
+endif
+
+let b:current_syntax = "grub"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/gsp.vim b/runtime/syntax/gsp.vim
new file mode 100644
index 000000000..e7766c5b5
--- /dev/null
+++ b/runtime/syntax/gsp.vim
@@ -0,0 +1,59 @@
+" Vim syntax file
+" Language: GSP - GNU Server Pages (v. 0.86)
+" Created By: Nathaniel Harward nharward@yahoo.com
+" Last Changed: Dec. 12, 2000
+" Filenames: *.gsp
+" URL: http://www.constructicon.com/~nharward/vim/syntax/gsp.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'gsp'
+endif
+
+" Source HTML syntax
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+unlet b:current_syntax
+
+syn case match
+
+" Include Java syntax
+if version < 600
+ syn include @gspJava <sfile>:p:h/java.vim
+else
+ syn include @gspJava syntax/java.vim
+endif
+
+" Add <java> as an HTML tag name along with its args
+syn keyword htmlTagName contained java
+syn keyword htmlArg contained type file page
+
+" Redefine some HTML things to include (and highlight) gspInLine code in
+" places where it's likely to be found
+syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine
+syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,gspInLine
+syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc,gspInLine
+syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError,gspInLine
+syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,gspInLine
+syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine
+syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster,gspInLine
+
+" Define the GSP java code blocks
+syn region gspJavaBlock start="<java\>[^>]*\>" end="</java>"me=e-7 contains=@gspJava,htmlTag
+syn region gspInLine matchgroup=htmlError start="`" end="`" contains=@gspJava
+
+let b:current_syntax = "gsp"
+
+if main_syntax == 'gsp'
+ unlet main_syntax
+endif
diff --git a/runtime/syntax/gtkrc.vim b/runtime/syntax/gtkrc.vim
new file mode 100644
index 000000000..57054a21d
--- /dev/null
+++ b/runtime/syntax/gtkrc.vim
@@ -0,0 +1,142 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: Gtk+ theme files `gtkrc'
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-10-31
+" URL: http://trific.ath.cx/Ftp/vim/syntax/gtkrc.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if version >= 600
+ setlocal iskeyword=_,-,a-z,A-Z,48-57
+else
+ set iskeyword=_,-,a-z,A-Z,48-57
+endif
+
+syn case match
+
+" Base constructs
+syn match gtkrcComment "#.*$" contains=gtkrcFixme
+syn keyword gtkrcFixme FIXME TODO XXX NOT contained
+syn region gtkrcACString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=gtkrcWPathSpecial,gtkrcClassName,gtkrcClassNameGnome contained
+syn region gtkrcBString start=+"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=gtkrcKeyMod contained
+syn region gtkrcString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=gtkrcStockName,gtkrcPathSpecial,gtkrcRGBColor
+syn match gtkrcPathSpecial "<parent>" contained
+syn match gtkrcWPathSpecial "[*?.]" contained
+syn match gtkrcNumber "^\(\d\+\)\=\.\=\d\+"
+syn match gtkrcNumber "\W\(\d\+\)\=\.\=\d\+"lc=1
+syn match gtkrcRGBColor "#\(\x\{12}\|\x\{9}\|\x\{6}\|\x\{3}\)" contained
+syn cluster gtkrcPRIVATE add=gtkrcFixme,gtkrcPathSpecial,gtkrcWPathSpecial,gtkrcRGBColor,gtkrcACString
+
+" Keywords
+syn keyword gtkrcInclude include
+syn keyword gtkrcPathSet module_path pixmap_path
+syn keyword gtkrcTop binding style
+syn keyword gtkrcTop widget widget_class nextgroup=gtkrcACString skipwhite
+syn keyword gtkrcTop class nextgroup=gtkrcACString skipwhite
+syn keyword gtkrcBind bind nextgroup=gtkrcBString skipwhite
+syn keyword gtkrcStateName NORMAL INSENSITIVE PRELIGHT ACTIVE SELECTED
+syn keyword gtkrcPriorityName HIGHEST RC APPLICATION GTK LOWEST
+syn keyword gtkrcPriorityName highest rc application gtk lowest
+syn keyword gtkrcTextDirName LTR RTL
+syn keyword gtkrcStyleKeyword fg bg fg_pixmap bg_pixmap bg_text base font font_name fontset stock text
+syn match gtkrcKeyMod "<\(alt\|ctrl\|control\|mod[1-5]\|release\|shft\|shift\)>" contained
+syn cluster gtkrcPRIVATE add=gtkrcKeyMod
+
+" Enums and engine words
+syn keyword gtkrcKeyword engine image
+syn keyword gtkrcImage arrow_direction border detail file gap_border gap_end_border gap_end_file gap_file gap_side gap_side gap_start_border gap_start_file orientation overlay_border overlay_file overlay_stretch recolorable shadow state stretch thickness
+syn keyword gtkrcConstant TRUE FALSE NONE IN OUT LEFT RIGHT TOP BOTTOM UP DOWN VERTICAL HORIZONTAL ETCHED_IN ETCHED_OUT
+syn keyword gtkrcFunction function nextgroup=gtkrcFunctionEq skipwhite
+syn match gtkrcFunctionEq "=" nextgroup=gtkrcFunctionName contained skipwhite
+syn keyword gtkrcFunctionName ARROW BOX BOX_GAP CHECK CROSS DIAMOND EXTENSION FLAT_BOX FOCUS HANDLE HLINE OPTION OVAL POLYGON RAMP SHADOW SHADOW_GAP SLIDER STRING TAB VLINE contained
+syn cluster gtkrcPRIVATE add=gtkrcFunctionName,gtkrcFunctionEq
+
+" Class names
+syn keyword gtkrcClassName GtkAccelLabel GtkAdjustment GtkAlignment GtkArrow GtkAspectFrame GtkBin GtkBox GtkButton GtkButtonBox GtkCList GtkCTree GtkCalendar GtkCheckButton GtkCheckMenuItem GtkColorSelection GtkColorSelectionDialog GtkCombo GtkContainer GtkCurve GtkData GtkDialog GtkDrawingArea GtkEditable GtkEntry GtkEventBox GtkFileSelection GtkFixed GtkFontSelection GtkFontSelectionDialog GtkFrame GtkGammaCurve GtkHBox GtkHButtonBox GtkHPaned GtkHRuler GtkHScale GtkHScrollbar GtkHSeparator GtkHandleBox GtkImage GtkImageMenuItem GtkInputDialog GtkInvisible GtkItem GtkItemFactory GtkLabel GtkLayout GtkList GtkListItem GtkMenu GtkMenuBar GtkMenuItem GtkMenuShell GtkMessageDialog GtkMisc GtkNotebook GtkObject GtkOptionMenu GtkPacker GtkPaned GtkPixmap GtkPlug GtkPreview GtkProgress GtkProgressBar GtkRadioButton GtkRadioMenuItem GtkRange GtkRuler GtkScale GtkScrollbar GtkScrolledWindow GtkSeparatorMenuItem GtkSocket GtkSpinButton GtkStatusbar GtkTable GtkTearoffMenuItem GtkText GtkTextBuffer GtkTextMark GtkTextTag GtkTextView GtkTipsQuery GtkToggleButton GtkToolbar GtkTooltips GtkTree GtkTreeView GtkTreeItem GtkVBox GtkVButtonBox GtkVPaned GtkVRuler GtkVScale GtkVScrollbar GtkVSeparator GtkViewport GtkWidget GtkWindow GtkWindowGroup contained
+syn keyword gtkrcClassName AccelLabel Adjustment Alignment Arrow AspectFrame Bin Box Button ButtonBox CList CTree Calendar CheckButton CheckMenuItem ColorSelection ColorSelectionDialog Combo Container Curve Data Dialog DrawingArea Editable Entry EventBox FileSelection Fixed FontSelection FontSelectionDialog Frame GammaCurve HBox HButtonBox HPaned HRuler HScale HScrollbar HSeparator HandleBox Image ImageMenuItem InputDialog Invisible Item ItemFactory Label Layout List ListItem Menu MenuBar MenuItem MenuShell MessageDialog Misc Notebook Object OptionMenu Packer Paned Pixmap Plug Preview Progress ProgressBar RadioButton RadioMenuItem Range Ruler Scale Scrollbar ScrolledWindow SeparatorMenuItem Socket SpinButton Statusbar Table TearoffMenuItem Text TextBuffer TextMark TextTag TextView TipsQuery ToggleButton Toolbar Tooltips Tree TreeView TreeItem VBox VButtonBox VPaned VRuler VScale VScrollbar VSeparator Viewport Widget Window WindowGroup contained
+syn keyword gtkrcClassNameGnome GnomeAbout GnomeAnimator GnomeApp GnomeAppBar GnomeCalculator GnomeCanvas GnomeCanvasEllipse GnomeCanvasGroup GnomeCanvasImage GnomeCanvasItem GnomeCanvasLine GnomeCanvasPolygon GnomeCanvasRE GnomeCanvasRect GnomeCanvasText GnomeCanvasWidget GnomeClient GnomeColorPicker GnomeDEntryEdit GnomeDateEdit GnomeDialog GnomeDock GnomeDockBand GnomeDockItem GnomeDockLayout GnomeDruid GnomeDruidPage GnomeDruidPageFinish GnomeDruidPageStandard GnomeDruidPageStart GnomeEntry GnomeFileEntry GnomeFontPicker GnomeFontSelector GnomeHRef GnomeIconEntry GnomeIconList GnomeIconSelection GnomeIconTextItem GnomeLess GnomeMDI GnomeMDIChild GnomeMDIGenericChild GnomeMessageBox GnomeNumberEntry GnomePaperSelector GnomePixmap GnomePixmapEntry GnomeProcBar GnomePropertyBox GnomeScores GnomeSpell GnomeStock GtkClock GtkDial GtkPixmapMenuItem GtkTed contained
+syn cluster gtkrcPRIVATE add=gtkrcClassName,gtkrcClassNameGnome
+
+" Stock item names
+syn keyword gtkrcStockName gtk-add gtk-apply gtk-bold gtk-cancel gtk-cdrom gtk-clear gtk-close gtk-convert gtk-copy gtk-cut gtk-delete gtk-dialog-error gtk-dialog-info gtk-dialog-question gtk-dialog-warning gtk-dnd gtk-dnd-multiple gtk-execute gtk-find gtk-find-and-replace gtk-floppy gtk-goto-bottom gtk-goto-first gtk-goto-last gtk-goto-top gtk-go-back gtk-go-down gtk-go-forward gtk-go-up gtk-help gtk-home gtk-index gtk-italic gtk-jump-to gtk-justify-center gtk-justify-fill gtk-justify-left gtk-justify-right gtk-missing-image gtk-new gtk-no gtk-ok gtk-open gtk-paste gtk-preferences gtk-print gtk-print-preview gtk-properties gtk-quit gtk-redo gtk-refresh gtk-remove gtk-revert-to-saved gtk-save gtk-save-as gtk-select-color gtk-select-font gtk-sort-ascending gtk-sort-descending gtk-spell-check gtk-stop gtk-strikethrough gtk-undelete gtk-underline gtk-undo gtk-yes gtk-zoom-100 gtk-zoom-fit gtk-zoom-in gtk-zoom-out contained
+syn cluster gtkrcPRIVATE add=gtkrcStockName
+
+" Gtk Settings
+syn keyword gtkrcSettingsName gtk-double-click-time gtk-cursor-blink gtk-cursor-blink-time gtk-split-cursor gtk-theme-name gtk-key-theme-name gtk-menu-bar-accel gtk-dnd-drag-threshold gtk-font-name gtk-color-palette gtk-entry-select-on-focus gtk-can-change-accels gtk-toolbar-style gtk-toolbar-icon-size
+syn cluster gtkrcPRIVATE add=gtkrcSettingsName
+
+" Catch errors caused by wrong parenthesization
+syn region gtkrcParen start='(' end=')' transparent contains=ALLBUT,gtkrcParenError,@gtkrcPRIVATE
+syn match gtkrcParenError ")"
+syn region gtkrcBrace start='{' end='}' transparent contains=ALLBUT,gtkrcBraceError,@gtkrcPRIVATE
+syn match gtkrcBraceError "}"
+syn region gtkrcBracket start='\[' end=']' transparent contains=ALLBUT,gtkrcBracketError,@gtkrcPRIVATE
+syn match gtkrcBracketError "]"
+
+" Synchronization
+syn sync minlines=50
+syn sync match gtkrcSyncClass groupthere NONE "^\s*class\>"
+
+" Define the default highlighting
+if version >= 508 || !exists("did_gtkrc_syntax_inits")
+ if version < 508
+ let did_gtkrc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink gtkrcComment Comment
+ HiLink gtkrcFixme Todo
+
+ HiLink gtkrcInclude Preproc
+
+ HiLink gtkrcACString gtkrcString
+ HiLink gtkrcBString gtkrcString
+ HiLink gtkrcString String
+ HiLink gtkrcNumber Number
+ HiLink gtkrcStateName gtkrcConstant
+ HiLink gtkrcPriorityName gtkrcConstant
+ HiLink gtkrcTextDirName gtkrcConstant
+ HiLink gtkrcSettingsName Function
+ HiLink gtkrcStockName Function
+ HiLink gtkrcConstant Constant
+
+ HiLink gtkrcPathSpecial gtkrcSpecial
+ HiLink gtkrcWPathSpecial gtkrcSpecial
+ HiLink gtkrcRGBColor gtkrcSpecial
+ HiLink gtkrcKeyMod gtkrcSpecial
+ HiLink gtkrcSpecial Special
+
+ HiLink gtkrcTop gtkrcKeyword
+ HiLink gtkrcPathSet gtkrcKeyword
+ HiLink gtkrcStyleKeyword gtkrcKeyword
+ HiLink gtkrcFunction gtkrcKeyword
+ HiLink gtkrcBind gtkrcKeyword
+ HiLink gtkrcKeyword Keyword
+
+ HiLink gtkrcClassNameGnome gtkrcGtkClass
+ HiLink gtkrcClassName gtkrcGtkClass
+ HiLink gtkrcFunctionName gtkrcGtkClass
+ HiLink gtkrcGtkClass Type
+
+ HiLink gtkrcImage gtkrcOtherword
+ HiLink gtkrcOtherword Function
+
+ HiLink gtkrcParenError gtkrcError
+ HiLink gtkrcBraceError gtkrcError
+ HiLink gtkrcBracketError gtkrcError
+ HiLink gtkrcError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "gtkrc"
diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim
new file mode 100644
index 000000000..21fcf81f5
--- /dev/null
+++ b/runtime/syntax/haskell.vim
@@ -0,0 +1,193 @@
+" Vim syntax file
+" Language: Haskell
+" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
+" Last Change: 2004 Feb 23
+" Original Author: John Williams <jrw@pobox.com>
+"
+" Thanks to Ryan Crumley for suggestions and John Meacham for
+" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart
+" for providing the inspiration for the inclusion of the handling
+" of C preprocessor directives, and for pointing out a bug in the
+" end-of-line comment handling.
+"
+" Options-assign a value to these variables to turn the option on:
+"
+" hs_highlight_delimiters - Highlight delimiter characters--users
+" with a light-colored background will
+" probably want to turn this on.
+" hs_highlight_boolean - Treat True and False as keywords.
+" hs_highlight_types - Treat names of primitive types as keywords.
+" hs_highlight_more_types - Treat names of other common types as keywords.
+" hs_highlight_debug - Highlight names of debugging functions.
+" hs_allow_hash_operator - Don't highlight seemingly incorrect C
+" preprocessor directives but assume them to be
+" operators
+"
+" 2004 Feb 19: Added C preprocessor directive handling, corrected eol comments
+" cleaned away literate haskell support (should be entirely in
+" lhaskell.vim)
+" 2004 Feb 20: Cleaned up C preprocessor directive handling, fixed single \
+" in eol comment character class
+" 2004 Feb 23: Made the leading comments somewhat clearer where it comes
+" to attribution of work.
+
+" Remove any old syntax stuff hanging around
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" (Qualified) identifiers (no default highlighting)
+syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>"
+syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>"
+
+" Infix operators--most punctuation characters and any (qualified) identifier
+" enclosed in `backquotes`. An operator starting with : is a constructor,
+" others are variables (e.g. functions).
+syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*"
+syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*"
+syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`"
+syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`"
+
+" Reserved symbols--cannot be overloaded.
+syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}"
+
+" Strings and constants
+syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
+syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
+syn match hsSpecialCharError contained "\\&\|'''\+"
+syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar
+syn match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError
+syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError
+syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
+syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
+
+" Keyword definitions. These must be patters instead of keywords
+" because otherwise they would match as keywords at the start of a
+" "literate" comment (see lhs.vim).
+syn match hsModule "\<module\>"
+syn match hsImport "\<import\>.*"he=s+6 contains=hsImportMod
+syn match hsImportMod contained "\<\(as\|qualified\|hiding\)\>"
+syn match hsInfix "\<\(infix\|infixl\|infixr\)\>"
+syn match hsStructure "\<\(class\|data\|deriving\|instance\|default\|where\)\>"
+syn match hsTypedef "\<\(type\|newtype\)\>"
+syn match hsStatement "\<\(do\|case\|of\|let\|in\)\>"
+syn match hsConditional "\<\(if\|then\|else\)\>"
+
+" Not real keywords, but close.
+if exists("hs_highlight_boolean")
+ " Boolean constants from the standard prelude.
+ syn match hsBoolean "\<\(True\|False\)\>"
+endif
+if exists("hs_highlight_types")
+ " Primitive types from the standard prelude and libraries.
+ syn match hsType "\<\(Int\|Integer\|Char\|Bool\|Float\|Double\|IO\|Void\|Addr\|Array\|String\)\>"
+endif
+if exists("hs_highlight_more_types")
+ " Types from the standard prelude libraries.
+ syn match hsType "\<\(Maybe\|Either\|Ratio\|Complex\|Ordering\|IOError\|IOResult\|ExitCode\)\>"
+ syn match hsMaybe "\<Nothing\>"
+ syn match hsExitCode "\<\(ExitSuccess\)\>"
+ syn match hsOrdering "\<\(GT\|LT\|EQ\)\>"
+endif
+if exists("hs_highlight_debug")
+ " Debugging functions from the standard prelude.
+ syn match hsDebug "\<\(undefined\|error\|trace\)\>"
+endif
+
+
+" Comments
+syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
+syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment
+syn region hsPragma start="{-#" end="#-}"
+
+" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed
+" First, see whether to flag directive-like lines or not
+if (!exists("hs_allow_hash_operator"))
+ syn match cError display "^\s*\(%:\|#\).*$"
+endif
+" Accept %: for # (C99)
+syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError
+syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
+syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip
+syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip
+syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match cIncluded display contained "<[^>]*>"
+syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError
+syn region cDefine matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$"
+syn region cPreProc matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend
+
+syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained
+syntax match cCommentError display "\*/" contained
+syntax match cCommentStartError display "/\*"me=e-1 contained
+syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_hs_syntax_inits")
+ if version < 508
+ let did_hs_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink hsModule hsStructure
+ HiLink hsImport Include
+ HiLink hsImportMod hsImport
+ HiLink hsInfix PreProc
+ HiLink hsStructure Structure
+ HiLink hsStatement Statement
+ HiLink hsConditional Conditional
+ HiLink hsSpecialChar SpecialChar
+ HiLink hsTypedef Typedef
+ HiLink hsVarSym hsOperator
+ HiLink hsConSym hsOperator
+ HiLink hsOperator Operator
+ if exists("hs_highlight_delimiters")
+ " Some people find this highlighting distracting.
+ HiLink hsDelimiter Delimiter
+ endif
+ HiLink hsSpecialCharError Error
+ HiLink hsString String
+ HiLink hsCharacter Character
+ HiLink hsNumber Number
+ HiLink hsFloat Float
+ HiLink hsConditional Conditional
+ HiLink hsLiterateComment hsComment
+ HiLink hsBlockComment hsComment
+ HiLink hsLineComment hsComment
+ HiLink hsComment Comment
+ HiLink hsPragma SpecialComment
+ HiLink hsBoolean Boolean
+ HiLink hsType Type
+ HiLink hsMaybe hsEnumConst
+ HiLink hsOrdering hsEnumConst
+ HiLink hsEnumConst Constant
+ HiLink hsDebug Debug
+
+ HiLink cCppString hsString
+ HiLink cCommentStart hsComment
+ HiLink cCommentError hsError
+ HiLink cCommentStartError hsError
+ HiLink cInclude Include
+ HiLink cPreProc PreProc
+ HiLink cDefine Macro
+ HiLink cIncluded hsString
+ HiLink cError Error
+ HiLink cPreCondit PreCondit
+ HiLink cComment Comment
+ HiLink cCppSkip cCppOut
+ HiLink cCppOut2 cCppOut
+ HiLink cCppOut Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "haskell"
+
+" Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim
diff --git a/runtime/syntax/hb.vim b/runtime/syntax/hb.vim
new file mode 100644
index 000000000..6df30543b
--- /dev/null
+++ b/runtime/syntax/hb.vim
@@ -0,0 +1,97 @@
+" Vim syntax file
+" Language: Hyper Builder
+" Maintainer: Alejandro Forero Cuervo
+" URL: http://bachue.com/hb/vim/syntax/hb.vim
+" Last Change: 2001 Sep 02
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the HTML syntax to start with
+"syn include @HTMLStuff <sfile>:p:h/htmlhb.vim
+
+"this would be nice but we are supposed not to do it
+"set mps=<:>
+
+"syn region HBhtmlString contained start=+"+ end=+"+ contains=htmlSpecialChar
+"syn region HBhtmlString contained start=+'+ end=+'+ contains=htmlSpecialChar
+
+"syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"
+
+syn match htmlSpecialChar "&[^;]*;" contained
+
+syn match HBhtmlTagSk contained "[A-Za-z]*"
+
+syn match HBhtmlTagS contained "<\s*\(hb\s*\.\s*\(sec\|min\|hour\|day\|mon\|year\|input\|html\|time\|getcookie\|streql\|url-enc\)\|wall\s*\.\s*\(show\|info\|id\|new\|rm\|count\)\|auth\s*\.\s*\(chk\|add\|find\|user\)\|math\s*\.\s*exp\)\s*\([^.A-Za-z0-9]\|$\)" contains=HBhtmlTagSk transparent
+
+syn match HBhtmlTagN contained "[A-Za-z0-9\/\-]\+"
+
+syn match HBhtmlTagB contained "<\s*[A-Za-z0-9\/\-]\+\(\s*\.\s*[A-Za-z0-9\/\-]\+\)*" contains=HBhtmlTagS,HBhtmlTagN
+
+syn region HBhtmlTag contained start=+<+ end=+>+ contains=HBhtmlTagB,HBDirectiveError
+
+syn match HBFileName ".*" contained
+
+syn match HBDirectiveKeyword ":\s*\(include\|lib\|set\|out\)\s\+" contained
+
+syn match HBDirectiveError "^:.*$" contained
+
+"syn match HBDirectiveBlockEnd "^:\s*$" contained
+
+"syn match HBDirectiveOutHead "^:\s*out\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
+
+"syn match HBDirectiveSetHead "^:\s*set\s\+\S\+.*" contained contains=HBDirectiveKeyword,HBFileName
+
+syn match HBInvalidLine "^.*$"
+
+syn match HBDirectiveInclude "^:\s*include\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
+
+syn match HBDirectiveLib "^:\s*lib\s\+\S\+.*$" contains=HBFileName,HBDirectiveKeyword
+
+syn region HBText matchgroup=HBDirectiveKeyword start=/^:\(set\|out\)\s*\S\+.*$/ end=/^:\s*$/ contains=HBDirectiveError,htmlSpecialChar,HBhtmlTag keepend
+
+"syn match HBLine "^:.*$" contains=HBDirectiveInclude,HBDirectiveLib,HBDirectiveError,HBDirectiveSet,HBDirectiveOut
+
+syn match HBComment "^#.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_hb_syntax_inits")
+ if version < 508
+ let did_hb_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink HBhtmlString String
+ HiLink HBhtmlTagN Function
+ HiLink htmlSpecialChar String
+
+ HiLink HBInvalidLine Error
+ HiLink HBFoobar Comment
+ hi HBFileName guibg=lightgray guifg=black
+ HiLink HBDirectiveError Error
+ HiLink HBDirectiveBlockEnd HBDirectiveKeyword
+ hi HBDirectiveKeyword guibg=lightgray guifg=darkgreen
+ HiLink HBComment Comment
+ HiLink HBhtmlTagSk Statement
+
+ delcommand HiLink
+endif
+
+syn sync match Normal grouphere NONE "^:\s*$"
+syn sync match Normal grouphere NONE "^:\s*lib\s\+[^ \t]\+$"
+syn sync match Normal grouphere NONE "^:\s*include\s\+[^ \t]\+$"
+"syn sync match Block grouphere HBDirectiveSet "^#:\s*set\s\+[^ \t]\+"
+"syn sync match Block grouphere HBDirectiveOut "^#:\s*out\s\+[^ \t]\+"
+
+let b:current_syntax = "hb"
+
+" vim: ts=8
diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim
new file mode 100644
index 000000000..0e7a550d3
--- /dev/null
+++ b/runtime/syntax/help.vim
@@ -0,0 +1,187 @@
+" Vim syntax file
+" Language: Vim help file
+" Maintainer: Bram Moolenaar (Bram@vim.org)
+" Last Change: 2004 May 17
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match helpHeadline "^[A-Z ]\+[ ]\+\*"me=e-1
+syn match helpSectionDelim "^=\{3,}.*===$"
+syn match helpSectionDelim "^-\{3,}.*--$"
+syn region helpExample matchgroup=helpIgnore start=" >$" start="^>$" end="^[^ \t]"me=e-1 end="^<"
+if has("ebcdic")
+ syn match helpHyperTextJump "\\\@<!|[^"*|]\+|"
+ syn match helpHyperTextEntry "\*[^"*|]\+\*\s"he=e-1
+ syn match helpHyperTextEntry "\*[^"*|]\+\*$"
+else
+ syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|"
+ syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1
+ syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$"
+endif
+syn match helpNormal "|.*====*|"
+syn match helpNormal ":|vim:|" " for :help modeline
+syn match helpVim "Vim version [0-9.a-z]\+"
+syn match helpVim "VIM REFERENCE.*"
+syn match helpOption "'[a-z]\{2,\}'"
+syn match helpOption "'t_..'"
+syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
+syn match helpIgnore "." contained
+syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes:
+syn match helpSpecial "\<N\>"
+syn match helpSpecial "\<N\.$"me=e-1
+syn match helpSpecial "\<N\.\s"me=e-2
+syn match helpSpecial "(N\>"ms=s+1
+syn match helpSpecial "\[N]"
+" avoid highlighting N N in help.txt
+syn match helpSpecial "N N"he=s+1
+syn match helpSpecial "Nth"me=e-2
+syn match helpSpecial "N-1"me=e-2
+syn match helpSpecial "{[-a-zA-Z0-9'":%#=[\]<>.,]\+}"
+syn match helpSpecial "{[-a-zA-Z0-9'"*+/:%#=[\]<>.,]\+}"
+syn match helpSpecial "\s\[[-a-z^A-Z0-9_]\{2,}]"ms=s+1
+syn match helpSpecial "<[-a-zA-Z0-9_]\+>"
+syn match helpSpecial "<[SCM]-.>"
+syn match helpNormal "<---*>"
+syn match helpSpecial "\[range]"
+syn match helpSpecial "\[line]"
+syn match helpSpecial "\[count]"
+syn match helpSpecial "\[offset]"
+syn match helpSpecial "\[cmd]"
+syn match helpSpecial "\[num]"
+syn match helpSpecial "\[+num]"
+syn match helpSpecial "\[-num]"
+syn match helpSpecial "\[+cmd]"
+syn match helpSpecial "\[++opt]"
+syn match helpSpecial "\[arg]"
+syn match helpSpecial "\[arguments]"
+syn match helpSpecial "\[ident]"
+syn match helpSpecial "\[addr]"
+syn match helpSpecial "\[group]"
+syn match helpSpecial "CTRL-."
+syn match helpSpecial "CTRL-Break"
+syn match helpSpecial "CTRL-PageUp"
+syn match helpSpecial "CTRL-PageDown"
+syn match helpSpecial "CTRL-Insert"
+syn match helpSpecial "CTRL-Del"
+syn match helpSpecial "CTRL-{char}"
+syn region helpNotVi start="{Vi[: ]" start="{not" start="{only" end="}" contains=helpLeadBlank,helpHyperTextJump
+syn match helpLeadBlank "^\s\+" contained
+
+" Highlight group items in their own color.
+syn match helpComment "\t[* ]Comment\t\+[a-z].*"
+syn match helpConstant "\t[* ]Constant\t\+[a-z].*"
+syn match helpString "\t[* ]String\t\+[a-z].*"
+syn match helpCharacter "\t[* ]Character\t\+[a-z].*"
+syn match helpNumber "\t[* ]Number\t\+[a-z].*"
+syn match helpBoolean "\t[* ]Boolean\t\+[a-z].*"
+syn match helpFloat "\t[* ]Float\t\+[a-z].*"
+syn match helpIdentifier "\t[* ]Identifier\t\+[a-z].*"
+syn match helpFunction "\t[* ]Function\t\+[a-z].*"
+syn match helpStatement "\t[* ]Statement\t\+[a-z].*"
+syn match helpConditional "\t[* ]Conditional\t\+[a-z].*"
+syn match helpRepeat "\t[* ]Repeat\t\+[a-z].*"
+syn match helpLabel "\t[* ]Label\t\+[a-z].*"
+syn match helpOperator "\t[* ]Operator\t\+["a-z].*"
+syn match helpKeyword "\t[* ]Keyword\t\+[a-z].*"
+syn match helpException "\t[* ]Exception\t\+[a-z].*"
+syn match helpPreProc "\t[* ]PreProc\t\+[a-z].*"
+syn match helpInclude "\t[* ]Include\t\+[a-z].*"
+syn match helpDefine "\t[* ]Define\t\+[a-z].*"
+syn match helpMacro "\t[* ]Macro\t\+[a-z].*"
+syn match helpPreCondit "\t[* ]PreCondit\t\+[a-z].*"
+syn match helpType "\t[* ]Type\t\+[a-z].*"
+syn match helpStorageClass "\t[* ]StorageClass\t\+[a-z].*"
+syn match helpStructure "\t[* ]Structure\t\+[a-z].*"
+syn match helpTypedef "\t[* ]Typedef\t\+[Aa-z].*"
+syn match helpSpecial "\t[* ]Special\t\+[a-z].*"
+syn match helpSpecialChar "\t[* ]SpecialChar\t\+[a-z].*"
+syn match helpTag "\t[* ]Tag\t\+[a-z].*"
+syn match helpDelimiter "\t[* ]Delimiter\t\+[a-z].*"
+syn match helpSpecialComment "\t[* ]SpecialComment\t\+[a-z].*"
+syn match helpDebug "\t[* ]Debug\t\+[a-z].*"
+syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*"
+syn match helpError "\t[* ]Error\t\+[a-z].*"
+syn match helpTodo "\t[* ]Todo\t\+[a-z].*"
+
+
+" Additionally load a language-specific syntax file "help_ab.vim".
+let i = match(expand("%"), '\.\a\ax$')
+if i > 0
+ exe "runtime syntax/help_" . strpart(expand("%"), i + 1, 2) . ".vim"
+endif
+
+syn sync minlines=40
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_help_syntax_inits")
+ if version < 508
+ let did_help_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink helpExampleStart helpIgnore
+ HiLink helpIgnore Ignore
+ HiLink helpHyperTextJump Subtitle
+ HiLink helpHyperTextEntry String
+ HiLink helpHeadline Statement
+ HiLink helpHeader PreProc
+ HiLink helpSectionDelim PreProc
+ HiLink helpVim Identifier
+ HiLink helpExample Comment
+ HiLink helpOption Type
+ HiLink helpNotVi Special
+ HiLink helpSpecial Special
+ HiLink helpNote Todo
+ HiLink Subtitle Identifier
+
+ HiLink helpComment Comment
+ HiLink helpConstant Constant
+ HiLink helpString String
+ HiLink helpCharacter Character
+ HiLink helpNumber Number
+ HiLink helpBoolean Boolean
+ HiLink helpFloat Float
+ HiLink helpIdentifier Identifier
+ HiLink helpFunction Function
+ HiLink helpStatement Statement
+ HiLink helpConditional Conditional
+ HiLink helpRepeat Repeat
+ HiLink helpLabel Label
+ HiLink helpOperator Operator
+ HiLink helpKeyword Keyword
+ HiLink helpException Exception
+ HiLink helpPreProc PreProc
+ HiLink helpInclude Include
+ HiLink helpDefine Define
+ HiLink helpMacro Macro
+ HiLink helpPreCondit PreCondit
+ HiLink helpType Type
+ HiLink helpStorageClass StorageClass
+ HiLink helpStructure Structure
+ HiLink helpTypedef Typedef
+ HiLink helpSpecialChar SpecialChar
+ HiLink helpTag Tag
+ HiLink helpDelimiter Delimiter
+ HiLink helpSpecialComment SpecialComment
+ HiLink helpDebug Debug
+ HiLink helpUnderlined Underlined
+ HiLink helpError Error
+ HiLink helpTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "help"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/hercules.vim b/runtime/syntax/hercules.vim
new file mode 100644
index 000000000..02d8e9bb7
--- /dev/null
+++ b/runtime/syntax/hercules.vim
@@ -0,0 +1,133 @@
+" Vim syntax file
+" Language: Hercules
+" Maintainer: Dana Edwards <Dana_Edwards@avanticorp.com>
+" Extensions: *.vc,*.ev,*.rs
+" Last change: Nov. 9, 2001
+" Comment: Hercules physical IC design verification software ensures
+" that an IC's physical design matches its logical design and
+" satisfies manufacturing rules.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Ignore case
+syn case ignore
+
+" Hercules runset sections
+syn keyword herculesType header assign_property alias assign
+syn keyword herculesType options preprocess_options
+syn keyword herculesType explode_options technology_options
+syn keyword herculesType drc_options database_options
+syn keyword herculesType text_options lpe_options evaccess_options
+syn keyword herculesType check_point compare_group environment
+syn keyword herculesType grid_check include layer_stats load_group
+syn keyword herculesType restart run_only self_intersect set snap
+syn keyword herculesType system variable waiver
+
+" Hercules commands
+syn keyword herculesStatement attach_property boolean cell_extent
+syn keyword herculesStatement common_hierarchy connection_points
+syn keyword herculesStatement copy data_filter alternate delete
+syn keyword herculesStatement explode explode_all fill_pattern find_net
+syn keyword herculesStatement flatten
+syn keyword herculesStatement level negate polygon_features push
+syn keyword herculesStatement rectangles relocate remove_overlap reverse select
+syn keyword herculesStatement select_cell select_contains select_edge select_net size
+syn keyword herculesStatement text_polygon text_property vertex area cut
+syn keyword herculesStatement density enclose external inside_edge
+syn keyword herculesStatement internal notch vectorize center_to_center
+syn keyword herculesStatement length mask_align moscheck rescheck
+syn keyword herculesStatement analysis buildsub init_lpe_db capacitor
+syn keyword herculesStatement device gendev nmos pmos diode npn pnp
+syn keyword herculesStatement resistor set_param save_property
+syn keyword herculesStatement connect disconnect text text_boolean
+syn keyword herculesStatement replace_text create_ports label graphics
+syn keyword herculesStatement save_netlist_database lpe_stats netlist
+syn keyword herculesStatement spice graphics_property graphics_netlist
+syn keyword herculesStatement write_milkyway multi_rule_enclose
+syn keyword herculesStatement if error_property equate compare
+syn keyword herculesStatement antenna_fix c_thru dev_connect_check
+syn keyword herculesStatement dev_net_count device_count net_filter
+syn keyword herculesStatement net_path_check ratio process_text_opens
+
+" Hercules keywords
+syn keyword herculesStatement black_box_file block compare_dir equivalence
+syn keyword herculesStatement format gdsin_dir group_dir group_dir_usage
+syn keyword herculesStatement inlib layout_path outlib output_format
+syn keyword herculesStatement output_layout_path schematic schematic_format
+syn keyword herculesStatement scheme_file output_block else
+syn keyword herculesStatement and or not xor andoverlap inside outside by to
+syn keyword herculesStatement with connected connected_all texted_with texted
+syn keyword herculesStatement by_property cutting edge_touch enclosing inside
+syn keyword herculesStatement inside_hole interact touching vertex
+
+" Hercules comments
+syn region herculesComment start="/\*" skip="/\*" end="\*/" contains=herculesTodo
+syn match herculesComment "//.*" contains=herculesTodo
+
+" Preprocessor directives
+syn match herculesPreProc "^#.*"
+syn match herculesPreProc "^@.*"
+syn match herculesPreProc "macros"
+
+" Hercules COMMENT option
+syn match herculesCmdCmnt "comment.*=.*"
+
+" Spacings, Resolutions, Ranges, Ratios, etc.
+syn match herculesNumber "-\=\<[0-9]\+L\=\>\|0[xX][0-9]\+\>"
+
+" Parenthesis sanity checker
+syn region herculesZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,herculesError,herculesBraceError,herculesCurlyError
+syn region herculesZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,herculesError,herculesBraceError,herculesParenError
+syn region herculesZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,herculesError,herculesCurlyError,herculesParenError
+syn match herculesError "[)\]}]"
+syn match herculesBraceError "[)}]" contained
+syn match herculesCurlyError "[)\]]" contained
+syn match herculesParenError "[\]}]" contained
+
+" Hercules output format
+"syn match herculesOutput "([0-9].*)"
+"syn match herculesOutput "([0-9].*\;.*)"
+syn match herculesOutput "perm\s*=.*(.*)"
+syn match herculesOutput "temp\s*=\s*"
+syn match herculesOutput "error\s*=\s*(.*)"
+
+"Modify the following as needed. The trade-off is performance versus functionality.
+syn sync lines=100
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_hercules_syntax_inits")
+ if version < 508
+ let did_hercules_syntax_inits = 1
+ " Default methods for highlighting.
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink herculesStatement Statement
+ HiLink herculesType Type
+ HiLink herculesComment Comment
+ HiLink herculesPreProc PreProc
+ HiLink herculesTodo Todo
+ HiLink herculesOutput Include
+ HiLink herculesCmdCmnt Identifier
+ HiLink herculesNumber Number
+ HiLink herculesBraceError herculesError
+ HiLink herculesCurlyError herculesError
+ HiLink herculesParenError herculesError
+ HiLink herculesError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "hercules"
+
+" vim: ts=8
diff --git a/runtime/syntax/hex.vim b/runtime/syntax/hex.vim
new file mode 100644
index 000000000..40c655395
--- /dev/null
+++ b/runtime/syntax/hex.vim
@@ -0,0 +1,57 @@
+" Vim syntax file
+" Language: Intel hex MCS51
+" Maintainer: Sams Ricahrd <sams@ping.at>
+" Last Change: 2003 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" storage types
+
+syn match hexChecksum "[0-9a-fA-F]\{2}$"
+syn match hexAdress "^:[0-9a-fA-F]\{6}" contains=hexDataByteCount
+syn match hexRecType "^:[0-9a-fA-F]\{8}" contains=hexAdress
+syn match hexDataByteCount contained "^:[0-9a-fA-F]\{2}" contains=hexStart
+syn match hexStart contained "^:"
+syn match hexExtAdrRec "^:02000002[0-9a-fA-F]\{4}" contains=hexSpecRec
+syn match hexExtLinAdrRec "^:02000004[0-9a-fA-F]\{4}" contains=hexSpecRec
+syn match hexSpecRec contained "^:0[02]00000[124]" contains=hexStart
+syn match hexEOF "^:00000001" contains=hexStart
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_hex_syntax_inits")
+ if version < 508
+ let did_hex_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink hexStart SpecialKey
+ HiLink hexDataByteCount Constant
+ HiLink hexAdress Comment
+ HiLink hexRecType WarningMsg
+ HiLink hexChecksum Search
+ HiLink hexExtAdrRec hexAdress
+ HiLink hexEOF hexSpecRec
+ HiLink hexExtLinAdrRec hexAdress
+ HiLink hexSpecRec DiffAdd
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "hex"
+
+" vim: ts=8
diff --git a/runtime/syntax/hitest.vim b/runtime/syntax/hitest.vim
new file mode 100644
index 000000000..748910106
--- /dev/null
+++ b/runtime/syntax/hitest.vim
@@ -0,0 +1,149 @@
+" Vim syntax file
+" Language: none; used to see highlighting
+" Maintainer: Ronald Schild <rs@scutum.de>
+" Last Change: 2001 Sep 02
+" Version: 5.4n.1
+
+" To see your current highlight settings, do
+" :so $VIMRUNTIME/syntax/hitest.vim
+
+" save global options and registers
+let s:hidden = &hidden
+let s:lazyredraw = &lazyredraw
+let s:more = &more
+let s:report = &report
+let s:shortmess = &shortmess
+let s:wrapscan = &wrapscan
+let s:register_a = @a
+let s:register_se = @/
+
+" set global options
+set hidden lazyredraw nomore report=99999 shortmess=aoOstTW wrapscan
+
+" print current highlight settings into register a
+redir @a
+highlight
+redir END
+
+" Open a new window if the current one isn't empty
+if line("$") != 1 || getline(1) != ""
+ new
+endif
+
+" edit temporary file
+edit Highlight\ test
+
+" set local options
+setlocal autoindent noexpandtab formatoptions=t shiftwidth=16 noswapfile tabstop=16
+let &textwidth=&columns
+
+" insert highlight settings
+% delete
+put a
+
+" remove the colored xxx items
+g/xxx /s///e
+
+" remove color settings (not needed here)
+global! /links to/ substitute /\s.*$//e
+
+" move linked groups to the end of file
+global /links to/ move $
+
+" move linked group names to the matching preferred groups
+% substitute /^\(\w\+\)\s*\(links to\)\s*\(\w\+\)$/\3\t\2 \1/e
+global /links to/ normal mz3ElD0#$p'zdd
+
+" delete empty lines
+global /^ *$/ delete
+
+" precede syntax command
+% substitute /^[^ ]*/syn keyword &\t&/
+
+" execute syntax commands
+syntax clear
+% yank a
+@a
+
+" remove syntax commands again
+% substitute /^syn keyword //
+
+" pretty formatting
+global /^/ exe "normal Wi\<CR>\t\eAA\ex"
+global /^\S/ join
+
+" find out first syntax highlighting
+let b:various = &highlight.',:Normal,:Cursor,:,'
+let b:i = 1
+while b:various =~ ':'.substitute(getline(b:i), '\s.*$', ',', '')
+ let b:i = b:i + 1
+ if b:i > line("$") | break | endif
+endwhile
+
+" insert headlines
+call append(0, "Highlighting groups for various occasions")
+call append(1, "-----------------------------------------")
+
+if b:i < line("$")-1
+ let b:synhead = "Syntax highlighting groups"
+ if exists("hitest_filetypes")
+ redir @a
+ let
+ redir END
+ let @a = substitute(@a, 'did_\(\w\+\)_syn\w*_inits\s*#1', ', \1', 'g')
+ let @a = substitute(@a, "\n\\w[^\n]*", '', 'g')
+ let @a = substitute(@a, "\n", '', 'g')
+ let @a = substitute(@a, '^,', '', 'g')
+ if @a != ""
+ let b:synhead = b:synhead." - filetype"
+ if @a =~ ','
+ let b:synhead = b:synhead."s"
+ endif
+ let b:synhead = b:synhead.":".@a
+ endif
+ endif
+ call append(b:i+1, "")
+ call append(b:i+2, b:synhead)
+ call append(b:i+3, substitute(b:synhead, '.', '-', 'g'))
+endif
+
+" remove 'hls' highlighting
+nohlsearch
+normal 0
+
+" add autocommands to remove temporary file from buffer list
+aug highlighttest
+ au!
+ au BufUnload Highlight\ test if expand("<afile>") == "Highlight test"
+ au BufUnload Highlight\ test bdelete! Highlight\ test
+ au BufUnload Highlight\ test endif
+ au VimLeavePre * if bufexists("Highlight test")
+ au VimLeavePre * bdelete! Highlight\ test
+ au VimLeavePre * endif
+aug END
+
+" we don't want to save this temporary file
+set nomodified
+
+" the following trick avoids the "Press RETURN ..." prompt
+0 append
+.
+
+" restore global options and registers
+let &hidden = s:hidden
+let &lazyredraw = s:lazyredraw
+let &more = s:more
+let &report = s:report
+let &shortmess = s:shortmess
+let &wrapscan = s:wrapscan
+let @a = s:register_a
+
+" restore last search pattern
+call histdel("search", -1)
+let @/ = s:register_se
+
+" remove variables
+unlet s:hidden s:lazyredraw s:more s:report s:shortmess
+unlet s:wrapscan s:register_a s:register_se
+
+" vim: ts=8
diff --git a/runtime/syntax/hog.vim b/runtime/syntax/hog.vim
new file mode 100644
index 000000000..f39c171d3
--- /dev/null
+++ b/runtime/syntax/hog.vim
@@ -0,0 +1,350 @@
+" Snort syntax file
+" Language: Snort Configuration File (see: http://www.snort.org)
+" Maintainer: Phil Wood, cornett@arpa.net
+" Last Change: $Date$
+" Filenames: *.hog *.rules snort.conf vision.conf
+" URL: http://home.lanl.gov/cpw/vim/syntax/hog.vim
+" Snort Version: 1.8 By Martin Roesch (roesch@clark.net, www.snort.org)
+" TODO include all 1.8 syntax
+
+" For version 5.x: Clear all syntax items
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+" For version 6.x: Quit when a syntax file was already loaded
+ finish
+endif
+
+syn match hogComment +\s\#[^\-:.%#=*].*$+lc=1 contains=hogTodo,hogCommentString
+syn region hogCommentString contained oneline start='\S\s\+\#+'ms=s+1 end='\#'
+
+syn match hogJunk "\<\a\+|\s\+$"
+syn match hogNumber contained "\<\d\+\>"
+syn region hogText contained oneline start='\S' end=',' skipwhite
+syn region hogTexts contained oneline start='\S' end=';' skipwhite
+
+" Environment Variables
+" =====================
+"syn match hogEnvvar contained "[\!]\=\$\I\i*"
+"syn match hogEnvvar contained "[\!]\=\${\I\i*}"
+syn match hogEnvvar contained "\$\I\i*"
+syn match hogEnvvar contained "[\!]\=\${\I\i*}"
+
+
+" String handling lifted from vim.vim written by Dr. Charles E. Campbell, Jr.
+" Try to catch strings, if nothing else matches (therefore it must precede the others!)
+" vmEscapeBrace handles ["] []"] (ie. stays as string)
+syn region hogEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1
+syn match hogPatSep contained "\\[|()]"
+syn match hogNotPatSep contained "\\\\"
+syn region hogString oneline start=+[^:a-zA-Z\->!\\]"+hs=e+1 skip=+\\\\\|\\"+ end=+"\s*;+he=s-1 contains=hogEscapeBrace,hogPatSep,hogNotPatSep oneline
+""syn region hogString oneline start=+[^:a-zA-Z>!\\]'+lc=1 skip=+\\\\\|\\'+ end=+'+ contains=hogEscapeBrace,vimPatSep,hogNotPatSep
+"syn region hogString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=hogEscapeBrace,hogPatSep,hogNotPatSep
+"syn region hogString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=hogEscapeBrace,hogPatSep,hogNotPatSep
+"syn region hogString oneline start="[^\\]+\s*[^a-zA-Z0-9.]"lc=1 skip="\\\\\|\\+" end="+" contains=hogEscapeBrace,hogPatSep,hogNotPatSep
+"syn region hogString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=hogEscapeBrace,hogPatSep,hogNotPatSep
+"syn match hogString contained +"[^"]*\\$+ skipnl nextgroup=hogStringCont
+"syn match hogStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
+
+
+" Beginners - Patterns that involve ^
+"
+syn match hogLineComment +^[ \t]*#.*$+ contains=hogTodo,hogCommentString,hogCommentTitle
+syn match hogCommentTitle '#\s*\u\a*\(\s\+\u\a*\)*:'ms=s+1 contained
+syn keyword hogTodo contained TODO
+
+" Rule keywords
+syn match hogARPCOpt contained "\d\+,\*,\*"
+syn match hogARPCOpt contained "\d\+,\d\+,\*"
+syn match hogARPCOpt contained "\d\+,\*,\d\+"
+syn match hogARPCOpt contained "\d\+,\d\+,\d"
+syn match hogATAGOpt contained "session"
+syn match hogATAGOpt contained "host"
+syn match hogATAGOpt contained "dst"
+syn match hogATAGOpt contained "src"
+syn match hogATAGOpt contained "seconds"
+syn match hogATAGOpt contained "packets"
+syn match hogATAGOpt contained "bytes"
+syn keyword hogARespOpt contained rst_snd rst_rcv rst_all skipwhite
+syn keyword hogARespOpt contained icmp_net icmp_host icmp_port icmp_all skipwhite
+syn keyword hogAReactOpt contained block warn msg skipwhite
+syn match hogAReactOpt contained "proxy\d\+" skipwhite
+syn keyword hogAFOpt contained logto content_list skipwhite
+syn keyword hogAIPOptVal contained eol nop ts sec lsrr lsrre satid ssrr rr skipwhite
+syn keyword hogARefGrps contained arachnids skipwhite
+syn keyword hogARefGrps contained bugtraq skipwhite
+syn keyword hogARefGrps contained cve skipwhite
+syn keyword hogSessionVal contained printable all skipwhite
+syn match hogAFlagOpt contained "[0FSRPAUfsrpau21]\+" skipwhite
+syn match hogAFragOpt contained "[DRMdrm]\+" skipwhite
+"
+" Output syslog options
+" Facilities
+syn keyword hogSysFac contained LOG_AUTH LOG_AUTHPRIV LOG_DAEMON LOG_LOCAL0
+syn keyword hogSysFac contained LOG_LOCAL1 LOG_LOCAL2 LOG_LOCAL3 LOG_LOCAL4
+syn keyword hogSysFac contained LOG_LOCAL5 LOG_LOCAL6 LOG_LOCAL7 LOG_USER
+" Priorities
+syn keyword hogSysPri contained LOG_EMERG ALERT LOG_CRIT LOG_ERR
+syn keyword hogSysPri contained LOG_WARNING LOG_NOTICE LOG_INFO LOG_DEBUG
+" Options
+syn keyword hogSysOpt contained LOG_CONS LOG_NDELAY LOG_PERROR
+syn keyword hogSysOpt contained LOG_PID
+" RuleTypes
+syn keyword hogRuleType contained log pass alert activate dynamic
+
+" Output log_database arguments and parameters
+" Type of database followed by ,
+" syn keyword hogDBSQL contained mysql postgresql unixodbc
+" Parameters param=constant
+" are just various constants assigned to parameter names
+
+" Output log_database arguments and parameters
+" Type of database followed by ,
+syn keyword hogDBType contained alert log
+syn keyword hogDBSRV contained mysql postgresql unixodbc
+" Parameters param=constant
+" are just various constants assigned to parameter names
+syn keyword hogDBParam contained dbname host port user password sensor_name
+
+" Output xml arguments and parameters
+" xml args
+syn keyword hogXMLArg contained log alert
+syn keyword hogXMLParam contained file protocol host port cert key ca server sanitize encoding detail
+"
+" hog rule handler '(.*)'
+syn region hogAOpt contained oneline start="rpc" end=":"me=e-1 nextgroup=hogARPCOptGrp skipwhite
+syn region hogARPCOptGrp contained oneline start="."hs=s+1 end=";"me=e-1 contains=hogARPCOpt skipwhite
+
+syn region hogAOpt contained oneline start="tag" end=":"me=e-1 nextgroup=hogATAGOptGrp skipwhite
+syn region hogATAGOptGrp contained oneline start="."hs=s+1 skip="," end=";"me=e-1 contains=hogATAGOpt,hogNumber skipwhite
+"
+syn region hogAOpt contained oneline start="nocase\|sameip" end=";"me=e-1 skipwhite oneline keepend
+"
+syn region hogAOpt contained start="resp" end=":"me=e-1 nextgroup=hogARespOpts skipwhite
+syn region hogARespOpts contained oneline start="." end="[,;]" contains=hogARespOpt skipwhite nextgroup=hogARespOpts
+"
+syn region hogAOpt contained start="react" end=":"me=e-1 nextgroup=hogAReactOpts skipwhite
+syn region hogAReactOpts contained oneline start="." end="[,;]" contains=hogAReactOpt skipwhite nextgroup=hogAReactOpts
+
+syn region hogAOpt contained oneline start="depth\|seq\|ttl\|ack\|icmp_seq\|activates\|activated_by\|dsize\|icode\|icmp_id\|count\|itype\|tos\|id\|offset" end=":"me=e-1 nextgroup=hogANOptGrp skipwhite
+syn region hogANOptGrp contained oneline start="."hs=s+1 end=";"me=e-1 contains=hogNumber skipwhite oneline keepend
+
+syn region hogAOpt contained oneline start="classtype" end=":"me=e-1 nextgroup=hogAFileGrp skipwhite
+
+syn region hogAOpt contained oneline start="regex\|msg\|content" end=":"me=e-1 nextgroup=hogAStrGrp skipwhite
+"syn region hogAStrGrp contained oneline start=+:\s*"+hs=s+1 skip="\\;" end=+"\s*;+he=s-1 contains=hogString skipwhite oneline keepend
+syn region hogAStrGrp contained oneline start=+:\s*"\|:"+hs=s+1 skip="\\;" end=+"\s*;+he=s-1 contains=hogString skipwhite oneline keepend
+
+syn region hogAOpt contained oneline start="logto\|content-list" end=":"me=e-1 nextgroup=hogAFileGrp skipwhite
+syn region hogAFileGrp contained oneline start="."hs=s+1 end=";"me=e-1 contains=hogFileName skipwhite
+
+syn region hogAOpt contained oneline start="reference" end=":"me=e-1 nextgroup=hogARefGrp skipwhite
+syn region hogARefGrp contained oneline start="."hs=s+1 end=","me=e-1 contains=hogARefGrps nextgroup=hogARefName skipwhite
+syn region hogARefName contained oneline start="."hs=s+1 end=";"me=e-1 contains=hogString,hogFileName,hogNumber skipwhite
+
+syn region hogAOpt contained oneline start="flags" end=":"he=s-1 nextgroup=hogAFlagOpt skipwhite oneline keepend
+
+syn region hogAOpt contained oneline start="fragbits" end=":"he=s-1 nextgroup=hogAFlagOpt skipwhite oneline keepend
+
+syn region hogAOpt contained oneline start="ipopts" end=":"he=s-1 nextgroup=hogAIPOptVal skipwhite oneline keepend
+
+"syn region hogAOpt contained oneline start="." end=":"he=s-1 contains=hogAFOpt nextgroup=hogFileName skipwhite
+
+syn region hogAOpt contained oneline start="session" end=":"he=s-1 nextgroup=hogSessionVal skipwhite
+
+syn match nothing "$"
+syn region hogRules oneline contains=nothing start='$' end="$"
+syn region hogRules oneline contains=hogRule start='('ms=s+1 end=")\s*$" skipwhite
+syn region hogRule contained oneline start="." skip="\\;" end=";"he=s-1 contains=hogAOpts, skipwhite keepend
+"syn region hogAOpts contained oneline start="." end="[;]"he=s-1 contains=hogAOpt skipwhite
+syn region hogAOpts contained oneline start="." end="[;]"me=e-1 contains=hogAOpt skipwhite
+
+
+" ruletype command
+syn keyword hogRTypeStart skipwhite ruletype nextgroup=hogRuleName skipwhite
+syn region hogRuleName contained start="." end="\s" contains=hogFileName nextgroup=hogRTypeRegion
+" type ruletype sub type
+syn region hogRtypeRegion contained start="{" end="}" nextgroup=hogRTypeStart
+syn keyword hogRTypeStart skipwhite type nextgroup=hogRuleTypes skipwhite
+syn region hogRuleTypes contained start="." end="\s" contains=hogRuleType nextgroup=hogOutStart
+
+
+" var command
+syn keyword hogVarStart skipwhite var nextgroup=hogVarIdent skipwhite
+syn region hogVarIdent contained start="."hs=e+1 end="\s\+"he=s-1 contains=hogEnvvar nextgroup=hogVarRegion skipwhite
+syn region hogVarRegion contained oneline start="." contains=hogIPaddr,hogEnvvar,hogNumber,hogString,hogFileName end="$"he=s-1 keepend skipwhite
+
+" config command
+syn keyword hogConfigStart config skipwhite nextgroup=hogConfigType
+syn match hogConfigType contained "\<classification\>" nextgroup=hogConfigTypeRegion skipwhite
+syn region hogConfigTypeRegion contained oneline start=":"ms=s+1 end="$" contains=hogNumber,hogText keepend skipwhite
+
+
+" include command
+syn keyword hogIncStart include skipwhite nextgroup=hogIncRegion
+syn region hogIncRegion contained oneline start="\>" contains=hogFileName,hogEnvvar end="$" keepend
+
+" preprocessor command
+" http_decode, minfrag, portscan[-ignorehosts]
+syn keyword hogPPrStart preprocessor skipwhite nextgroup=hogPPr
+syn match hogPPr contained "\<spade\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-homenet\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-threshlearn\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-adapt\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-adapt2\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-adapt3\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<spade-survey\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<defrag\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<telnet_decode\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<rpc_decode\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<bo\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<stream\>" nextgroup=hogStreamRegion skipwhite
+syn match hogPPr contained "\<stream2\>" nextgroup=hogStreamRegion skipwhite
+syn match hogPPr contained "\<stream3\>" nextgroup=hogStreamRegion skipwhite
+syn match hogPPr contained "\<http_decode\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<minfrag\>" nextgroup=hogPPrRegion skipwhite
+syn match hogPPr contained "\<portscan[-ignorehosts]*\>" nextgroup=hogPPrRegion skipwhite
+syn region hogPPrRegion contained oneline start="$" end="$" keepend
+syn region hogPPrRegion contained oneline start=":" end="$" contains=hogNumber,hogIPaddr,hogEnvvar,hogFileName keepend
+syn keyword hogStreamArgs contained timeout ports maxbytes
+syn region hogStreamRegion contained oneline start=":" end="$" contains=hogStreamArgs,hogNumber
+
+" output command
+syn keyword hogOutStart output nextgroup=hogOut skipwhite
+"
+" alert_syslog
+syn match hogOut contained "\<alert_syslog\>" nextgroup=hogSyslogRegion skipwhite
+syn region hogSyslogRegion contained start=":" end="$" contains=hogSysFac,hogSysPri,hogSysOpt,hogEnvvar oneline skipwhite keepend
+"
+" alert_fast (full,smb,unixsock, and tcpdump)
+syn match hogOut contained "\<alert_fast\|alert_full\|alert_smb\|alert_unixsock\|log_tcpdump\>" nextgroup=hogLogFileRegion skipwhite
+syn region hogLogFileRegion contained start=":" end="$" contains=hogFileName,hogEnvvar oneline skipwhite keepend
+"
+" database
+syn match hogOut contained "\<database\>" nextgroup=hogDBTypes skipwhite
+syn region hogDBTypes contained start=":" end="," contains=hogDBType,hogEnvvar nextgroup=hogDBSRVs skipwhite
+syn region hogDBSRVs contained start="\s\+" end="," contains=hogDBSRV nextgroup=hogDBParams skipwhite
+syn region hogDBParams contained start="." end="="me=e-1 contains=hogDBParam nextgroup=hogDBValues
+syn region hogDBValues contained start="." end="\>" contains=hogNumber,hogEnvvar,hogAscii nextgroup=hogDBParams oneline skipwhite
+syn match hogAscii contained "\<\a\+"
+"
+" log_tcpdump
+syn match hogOut contained "\<log_tcpdump\>" nextgroup=hogLogRegion skipwhite
+syn region hogLogRegion oneline start=":" skipwhite end="$" contains=hogEnvvar,hogFileName keepend
+"
+" xml
+syn keyword hogXMLTrans contained http https tcp iap
+syn match hogOut contained "\<xml\>" nextgroup=hogXMLRegion skipwhite
+syn region hogXMLRegion contained start=":" end="," contains=hogXMLArg,hogEnvvar nextgroup=hogXMLParams skipwhite
+"syn region hogXMLParams contained start="." end="="me=e-1 contains=hogXMLProto nextgroup=hogXMLProtos
+"syn region hogXMLProtos contained start="." end="\>" contains=hogXMLTrans nextgroup=hogXMLParams
+syn region hogXMLParams contained start="." end="="me=e-1 contains=hogXMLParam nextgroup=hogXMLValue
+syn region hogXMLValue contained start="." end="\>" contains=hogNumber,hogIPaddr,hogEnvvar,hogAscii,hogFileName nextgroup=hogXMLParams oneline skipwhite keepend
+"
+" Filename
+syn match hogFileName contained "[-./[:alnum:]_~]\+"
+syn match hogFileName contained "[-./[:alnum:]_~]\+"
+" IP address
+syn match hogIPaddr "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>"
+syn match hogIPaddr "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,2}\>"
+
+syn keyword hogProto tcp TCP ICMP icmp udp UDP
+
+" hog alert address port pairs
+" hog IPaddresses
+syn match hogIPaddrAndPort contained "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>" skipwhite nextgroup=hogPort
+syn match hogIPaddrAndPort contained "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/\d\{1,2}\>" skipwhite nextgroup=hogPort
+syn match hogIPaddrAndPort contained "\<any\>" skipwhite nextgroup=hogPort
+syn match hogIPaddrAndPort contained "\$\I\i*" nextgroup=hogPort skipwhite
+syn match hogIPaddrAndPort contained "\${\I\i*}" nextgroup=hogPort skipwhite
+"syn match hogPort contained "[\!]\=[\:]\=\d\+L\=\>" skipwhite
+syn match hogPort contained "[\:]\=\d\+\>"
+syn match hogPort contained "[\!]\=\<any\>" skipwhite
+syn match hogPort contained "[\!]\=\d\+L\=:\d\+L\=\>" skipwhite
+
+" action commands
+syn keyword hog7Functions activate skipwhite nextgroup=hogActRegion
+syn keyword hog7Functions dynamic skipwhite nextgroup=hogActRegion
+syn keyword hogActStart alert skipwhite nextgroup=hogActRegion
+syn keyword hogActStart log skipwhite nextgroup=hogActRegion
+syn keyword hogActStart pass skipwhite nextgroup=hogActRegion
+
+syn region hogActRegion contained oneline start="tcp\|TCP\|udp\|UDP\|icmp\|ICMP" end="\s\+"me=s-1 nextgroup=hogActSource oneline keepend skipwhite
+syn region hogActSource contained oneline contains=hogIPaddrAndPort start="\s\+"ms=e+1 end="->\|<>"me=e-2 oneline keepend skipwhite nextgroup=hogActDest
+syn region hogActDest contained oneline contains=hogIPaddrAndPort start="->\|<>" end="$" oneline keepend
+syn region hogActDest contained oneline contains=hogIPaddrAndPort start="->\|<>" end="("me=e-1 oneline keepend skipwhite nextgroup=hogRules
+
+
+" ====================
+if version >= 508 || !exists("did_hog_syn_inits")
+ if version < 508
+ let did_hog_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+" The default methods for highlighting. Can be overridden later
+ HiLink hogComment Comment
+ HiLink hogLineComment Comment
+ HiLink hogAscii Constant
+ HiLink hogCommentString Constant
+ HiLink hogFileName Constant
+ HiLink hogIPaddr Constant
+ HiLink hogNotPatSep Constant
+ HiLink hogNumber Constant
+ HiLink hogText Constant
+ HiLink hogString Constant
+ HiLink hogSysFac Constant
+ HiLink hogSysOpt Constant
+ HiLink hogSysPri Constant
+" HiLink hogAStrGrp Error
+ HiLink hogJunk Error
+ HiLink hogEnvvar Identifier
+ HiLink hogIPaddrAndPort Identifier
+ HiLink hogVarIdent Identifier
+ HiLink hogATAGOpt PreProc
+ HiLink hogAIPOptVal PreProc
+ HiLink hogARespOpt PreProc
+ HiLink hogAReactOpt PreProc
+ HiLink hogAFlagOpt PreProc
+ HiLink hogAFragOpt PreProc
+ HiLink hogCommentTitle PreProc
+ HiLink hogDBType PreProc
+ HiLink hogDBSRV PreProc
+ HiLink hogPort PreProc
+ HiLink hogARefGrps PreProc
+ HiLink hogSessionVal PreProc
+ HiLink hogXMLArg PreProc
+ HiLink hogARPCOpt PreProc
+ HiLink hogPatSep Special
+ HiLink hog7Functions Statement
+ HiLink hogActStart Statement
+ HiLink hogIncStart Statement
+ HiLink hogConfigStart Statement
+ HiLink hogOutStart Statement
+ HiLink hogPPrStart Statement
+ HiLink hogVarStart Statement
+ HiLink hogRTypeStart Statement
+ HiLink hogTodo Todo
+ HiLink hogRuleType Type
+ HiLink hogAFOpt Type
+ HiLink hogANoVal Type
+ HiLink hogAStrOpt Type
+ HiLink hogANOpt Type
+ HiLink hogAOpt Type
+ HiLink hogDBParam Type
+ HiLink hogStreamArgs Type
+ HiLink hogOut Type
+ HiLink hogPPr Type
+ HiLink hogConfigType Type
+ HiLink hogActRegion Type
+ HiLink hogProto Type
+ HiLink hogXMLParam Type
+ HiLink resp Todo
+ HiLink cLabel Label
+ delcommand HiLink
+endif
+
+let b:current_syntax = "hog"
+
+" hog: cpw=59
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
new file mode 100644
index 000000000..772babe78
--- /dev/null
+++ b/runtime/syntax/html.vim
@@ -0,0 +1,291 @@
+" Vim syntax file
+" Language: HTML
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/html.vim
+" Last Change: 2004 May 16
+
+" Please check :help html.vim for some comments and a description of the options
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'html'
+endif
+
+" don't use standard HiLink, it will not work with included syntax files
+if version < 508
+ command! -nargs=+ HtmlHiLink hi link <args>
+else
+ command! -nargs=+ HtmlHiLink hi def link <args>
+endif
+
+
+syn case ignore
+
+" mark illegal characters
+syn match htmlError "[<>&]"
+
+
+" tags
+syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
+syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
+syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagError contained "[^>]<"ms=s+1
+
+
+" tag names
+syn keyword htmlTagName contained address applet area a base basefont
+syn keyword htmlTagName contained big blockquote br caption center
+syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
+syn keyword htmlTagName contained form hr html img
+syn keyword htmlTagName contained input isindex kbd li link map menu
+syn keyword htmlTagName contained meta ol option param pre p samp span
+syn keyword htmlTagName contained select small strike sub sup
+syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
+syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
+
+" new html 4.0 tags
+syn keyword htmlTagName contained abbr acronym bdo button col label
+syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
+syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
+
+" legal arg names
+syn keyword htmlArg contained action
+syn keyword htmlArg contained align alink alt archive background bgcolor
+syn keyword htmlArg contained border bordercolor cellpadding
+syn keyword htmlArg contained cellspacing checked class clear code codebase color
+syn keyword htmlArg contained cols colspan content coords enctype face
+syn keyword htmlArg contained gutter height hspace id
+syn keyword htmlArg contained link lowsrc marginheight
+syn keyword htmlArg contained marginwidth maxlength method name prompt
+syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
+syn keyword htmlArg contained size src start target text type url
+syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
+syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
+
+" Netscape extensions
+syn keyword htmlTagName contained frame noframes frameset nobr blink
+syn keyword htmlTagName contained layer ilayer nolayer spacer
+syn keyword htmlArg contained frameborder noresize pagex pagey above below
+syn keyword htmlArg contained left top visibility clip id noshade
+syn match htmlArg contained "\<z-index\>"
+
+" Microsoft extensions
+syn keyword htmlTagName contained marquee
+
+" html 4.0 arg names
+syn match htmlArg contained "\<\(accept-charset\|label\)\>"
+syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
+syn keyword htmlArg contained cite classid codetype compact data datetime
+syn keyword htmlArg contained declare defer dir disabled for frame
+syn keyword htmlArg contained headers hreflang lang language longdesc
+syn keyword htmlArg contained multiple nohref nowrap object profile readonly
+syn keyword htmlArg contained rules scheme scope span standby style
+syn keyword htmlArg contained summary tabindex valuetype version
+
+" special characters
+syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
+
+" Comments (the real ones or the old netscape ones)
+if exists("html_wrong_comments")
+ syn region htmlComment start=+<!--+ end=+--\s*>+
+else
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError
+ syn match htmlCommentError contained "[^><!]"
+ syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc
+endif
+syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
+
+" server-parsed commands
+syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
+syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
+syn match htmlPreError contained "<!--#\S*"ms=s+4
+syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
+syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
+syn match htmlPreProcAttrError contained "\w\+="he=e-1
+syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
+
+if !exists("html_no_rendering")
+ " rendering
+ syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+
+ syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+ syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+
+ syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
+ syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+
+ syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
+ syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold
+ syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+
+ syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+ syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
+ syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
+ syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
+ syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop
+ syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
+ syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
+ syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+ syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+endif
+
+syn keyword htmlTagName contained noscript
+syn keyword htmlSpecialTagName contained script style
+if main_syntax != 'java' || exists("java_javascript")
+ " JAVA SCRIPT
+ syn include @htmlJavaScript <sfile>:p:h/javascript.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ syn region htmlScriptTag contained start=+<script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
+ HtmlHiLink htmlScriptTag htmlTag
+
+ " html events (i.e. arguments that include javascript commands)
+ if exists("html_extended_events")
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ
+ else
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ
+ endif
+ syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript
+ syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript
+ HtmlHiLink htmlEventSQ htmlEvent
+ HtmlHiLink htmlEventDQ htmlEvent
+
+ " a javascript expression is used as an arg value
+ syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
+endif
+
+if main_syntax != 'java' || exists("java_vb")
+ " VB SCRIPT
+ syn include @htmlVbScript <sfile>:p:h/vb.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script [^>]*language *=[^>]*vbscript[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+endif
+
+syn cluster htmlJavaScript add=@htmlPreproc
+
+if main_syntax != 'java' || exists("java_css")
+ " embedded style sheets
+ syn keyword htmlArg contained media
+ syn include @htmlCss <sfile>:p:h/css.vim
+ unlet b:current_syntax
+ syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
+ syn match htmlCssStyleComment contained "\(<!--\|-->\)"
+ syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
+ HtmlHiLink htmlStyleArg htmlString
+endif
+
+if main_syntax == "html"
+ " synchronizing (does not always work if a comment includes legal
+ " html tags, but doing it right would mean to always start
+ " at the first line, which is too slow)
+ syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
+ syn sync match htmlHighlight groupthere javaScript "<script"
+ syn sync match htmlHighlightSkip "^.*['\"].*$"
+ syn sync minlines=10
+endif
+
+" The default highlighting.
+if version >= 508 || !exists("did_html_syn_inits")
+ if version < 508
+ let did_html_syn_inits = 1
+ endif
+ HtmlHiLink htmlTag Function
+ HtmlHiLink htmlEndTag Identifier
+ HtmlHiLink htmlArg Type
+ HtmlHiLink htmlTagName htmlStatement
+ HtmlHiLink htmlSpecialTagName Exception
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlSpecialChar Special
+
+ if !exists("html_no_rendering")
+ HtmlHiLink htmlH1 Title
+ HtmlHiLink htmlH2 htmlH1
+ HtmlHiLink htmlH3 htmlH2
+ HtmlHiLink htmlH4 htmlH3
+ HtmlHiLink htmlH5 htmlH4
+ HtmlHiLink htmlH6 htmlH5
+ HtmlHiLink htmlHead PreProc
+ HtmlHiLink htmlTitle Title
+ HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBold htmlBoldUnderline
+ HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderline htmlUnderlineItalic
+ HtmlHiLink htmlItalicBold htmlBoldItalic
+ HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlLink Underlined
+ if !exists("html_my_rendering")
+ hi def htmlBold term=bold cterm=bold gui=bold
+ hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
+ hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
+ hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
+ hi def htmlUnderline term=underline cterm=underline gui=underline
+ hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
+ hi def htmlItalic term=italic cterm=italic gui=italic
+ endif
+ endif
+
+ HtmlHiLink htmlPreStmt PreProc
+ HtmlHiLink htmlPreError Error
+ HtmlHiLink htmlPreProc PreProc
+ HtmlHiLink htmlPreAttr String
+ HtmlHiLink htmlPreProcAttrName PreProc
+ HtmlHiLink htmlPreProcAttrError Error
+ HtmlHiLink htmlSpecial Special
+ HtmlHiLink htmlSpecialChar Special
+ HtmlHiLink htmlString String
+ HtmlHiLink htmlStatement Statement
+ HtmlHiLink htmlComment Comment
+ HtmlHiLink htmlCommentPart Comment
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlCommentError htmlError
+ HtmlHiLink htmlTagError htmlError
+ HtmlHiLink htmlEvent javaScript
+ HtmlHiLink htmlError Error
+
+ HtmlHiLink javaScript Special
+ HtmlHiLink javaScriptExpression javaScript
+ HtmlHiLink htmlCssStyleComment Comment
+ HtmlHiLink htmlCssDefinition Special
+endif
+
+delcommand HtmlHiLink
+
+let b:current_syntax = "html"
+
+if main_syntax == 'html'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/htmlcheetah.vim b/runtime/syntax/htmlcheetah.vim
new file mode 100644
index 000000000..f57df90de
--- /dev/null
+++ b/runtime/syntax/htmlcheetah.vim
@@ -0,0 +1,32 @@
+" Vim syntax file
+" Language: HTML with Cheetah tags
+" Maintainer: Max Ischenko <mfi@ukr.net>
+" Last Change: 2003-05-11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'html'
+endif
+
+if version < 600
+ so <sfile>:p:h/cheetah.vim
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/cheetah.vim
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syntax cluster htmlPreproc add=cheetahPlaceHolder
+syntax cluster htmlString add=cheetahPlaceHolder
+
+let b:current_syntax = "htmlcheetah"
+
+
diff --git a/runtime/syntax/htmlm4.vim b/runtime/syntax/htmlm4.vim
new file mode 100644
index 000000000..3119d2d1a
--- /dev/null
+++ b/runtime/syntax/htmlm4.vim
@@ -0,0 +1,41 @@
+" Vim syntax file
+" Language: HTML and M4
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/htmlm4.vim
+" Last Change: 2001 Apr 30
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" we define it here so that included files can test for it
+if !exists("main_syntax")
+ let main_syntax='htmlm4'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+unlet b:current_syntax
+syn case match
+
+if version < 600
+ so <sfile>:p:h/m4.vim
+else
+ runtime! syntax/m4.vim
+endif
+unlet b:current_syntax
+syn cluster htmlPreproc add=@m4Top
+syn cluster m4StringContents add=htmlTag,htmlEndTag
+
+let b:current_syntax = "htmlm4"
+
+if main_syntax == 'htmlm4'
+ unlet main_syntax
+endif
diff --git a/runtime/syntax/htmlos.vim b/runtime/syntax/htmlos.vim
new file mode 100644
index 000000000..f31b9f654
--- /dev/null
+++ b/runtime/syntax/htmlos.vim
@@ -0,0 +1,166 @@
+" Vim syntax file
+" Language: HTML/OS by Aestiva
+" Maintainer: Jason Rust <jrust@westmont.edu>
+" URL: http://www.rustyparts.com/vim/syntax/htmlos.vim
+" Info: http://www.rustyparts.com/scripts.php
+" Last Change: 2003 May 11
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'htmlos'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syn cluster htmlPreproc add=htmlosRegion
+
+syn case ignore
+
+" Function names
+syn keyword htmlosFunctions expand sleep getlink version system ascii getascii syslock sysunlock cr lf clean postprep listtorow split listtocol coltolist rowtolist tabletolist contained
+syn keyword htmlosFunctions cut \display cutall cutx cutallx length reverse lower upper proper repeat left right middle trim trimleft trimright count countx locate locatex replace replacex replaceall replaceallx paste pasteleft pasteleftx pasteleftall pasteleftallx pasteright pasterightall pasterightallx chopleft chopleftx chopright choprightx format concat contained
+syn keyword htmlosFunctions goto exitgoto contained
+syn keyword htmlosFunctions layout cols rows row items getitem putitem switchitems gettable delrow delrows delcol delcols append merge fillcol fillrow filltable pastetable getcol getrow fillindexcol insindexcol dups nodups maxtable mintable maxcol mincol maxrow minrow avetable avecol averow mediantable mediancol medianrow producttable productcol productrow sumtable sumcol sumrow sumsqrtable sumsqrcol sumsqrrow reversecols reverserows switchcols switchrows inscols insrows insfillcol sortcol reversesortcol sortcoln reversesortcoln sortrow sortrown reversesortrow reversesortrown getcoleq getcoleqn getcolnoteq getcolany getcolbegin getcolnotany getcolnotbegin getcolge getcolgt getcolle getcollt getcolgen getcolgtn getcollen getcoltn getcolend getcolnotend getrowend getrownotend getcolin getcolnotin getcolinbegin getcolnotinbegin getcolinend getcolnotinend getrowin getrownotin getrowinbegin getrownotinbegin getrowinend getrownotinend contained
+syn keyword htmlosFunctions dbcreate dbadd dbedit dbdelete dbsearch dbsearchsort dbget dbgetsort dbstatus dbindex dbimport dbfill dbexport dbsort dbgetrec dbremove dbpurge dbfind dbfindsort dbunique dbcopy dbmove dbkill dbtransfer dbpoke dbsearchx dbgetx contained
+syn keyword htmlosFunctions syshtmlosname sysstartname sysfixfile fileinfo filelist fileindex domainname page browser regdomain username usernum getenv httpheader copy file ts row sysls syscp sysmv sysmd sysrd filepush filepushlink dirname contained
+syn keyword htmlosFunctions mail to address subject netmail netmailopen netmailclose mailfilelist netweb netwebresults webpush netsockopen netsockread netsockwrite netsockclose contained
+syn keyword htmlosFunctions today time systime now yesterday tomorrow getday getmonth getyear getminute getweekday getweeknum getyearday getdate gettime getamorpm gethour addhours addminutes adddays timebetween timetill timefrom datetill datefrom mixedtimebetween mixeddatetill mixedtimetill mixedtimefrom mixeddatefrom nextdaybyweekfromdate nextdaybyweekfromtoday nextdaybymonthfromdate nextdaybymonthfromtoday nextdaybyyearfromdate nextdaybyyearfromtoday offsetdaybyweekfromdate offsetdaybyweekfromtoday offsetdaybymonthfromdate offsetdaybymonthfromtoday contained
+syn keyword htmlosFunctions isprivate ispublic isfile isdir isblank iserror iserror iseven isodd istrue isfalse islogical istext istag isnumber isinteger isdate istableeq istableeqx istableeqn isfuture ispast istoday isweekday isweekend issamedate iseq isnoteq isge isle ismod10 isvalidstring contained
+syn keyword htmlosFunctions celtof celtokel ftocel ftokel keltocel keltof cmtoin intocm fttom mtoft fttomile miletoft kmtomile miletokm mtoyd ydtom galtoltr ltrtogal ltrtoqt qttoltr gtooz oztog kgtolb lbtokg mttoton tontomt contained
+syn keyword htmlosFunctions max min abs sign inverse square sqrt cube roundsig round ceiling roundup floor rounddown roundeven rounddowneven roundupeven roundodd roundupodd rounddownodd random factorial summand fibonacci remainder mod radians degrees cos sin tan cotan secant cosecant acos asin atan exp power power10 ln log10 log sinh cosh tanh contained
+syn keyword htmlosFunctions xmldelete xmldeletex xmldeleteattr xmldeleteattrx xmledit xmleditx xmleditvalue xmleditvaluex xmleditattr xmleditattrx xmlinsertbefore xmlinsertbeforex smlinsertafter xmlinsertafterx xmlinsertattr xmlinsertattrx smlget xmlgetx xmlgetvalue xmlgetvaluex xmlgetattrvalue xmlgetattrvaluex xmlgetrec xmlgetrecx xmlgetrecattrvalue xmlgetrecattrvaluex xmlchopleftbefore xmlchopleftbeforex xmlchoprightbefore xmlchoprightbeforex xmlchopleftafter xmlchopleftafterx xmlchoprightafter xmlchoprightafterx xmllocatebefore xmllocatebeforex xmllocateafter xmllocateafterx contained
+
+" Type
+syn keyword htmlosType int str dol flt dat grp contained
+
+" StorageClass
+syn keyword htmlosStorageClass locals contained
+
+" Operator
+syn match htmlosOperator "[-=+/\*!]" contained
+syn match htmlosRelation "[~]" contained
+syn match htmlosRelation "[=~][&!]" contained
+syn match htmlosRelation "[!=<>]=" contained
+syn match htmlosRelation "[<>]" contained
+
+" Comment
+syn region htmlosComment start="#" end="/#" contained
+
+" Conditional
+syn keyword htmlosConditional if then /if to else elif contained
+syn keyword htmlosConditional and or nand nor xor not contained
+" Repeat
+syn keyword htmlosRepeat while do /while for /for contained
+
+" Keyword
+syn keyword htmlosKeyword name value step do rowname colname rownum contained
+
+" Repeat
+syn keyword htmlosLabel case matched /case switch contained
+
+" Statement
+syn keyword htmlosStatement break exit return continue contained
+
+" Identifier
+syn match htmlosIdentifier "\h\w*[\.]*\w*" contained
+
+" Special identifier
+syn match htmlosSpecialIdentifier "[\$@]" contained
+
+" Define
+syn keyword htmlosDefine function overlay contained
+
+" Boolean
+syn keyword htmlosBoolean true false contained
+
+" String
+syn region htmlosStringDouble keepend matchgroup=None start=+"+ end=+"+ contained
+syn region htmlosStringSingle keepend matchgroup=None start=+'+ end=+'+ contained
+
+" Number
+syn match htmlosNumber "-\=\<\d\+\>" contained
+
+" Float
+syn match htmlosFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" contained
+
+" Error
+syn match htmlosError "ERROR" contained
+
+" Parent
+syn match htmlosParent "[({[\]})]" contained
+
+" Todo
+syn keyword htmlosTodo TODO Todo todo contained
+
+syn cluster htmlosInside contains=htmlosComment,htmlosFunctions,htmlosIdentifier,htmlosSpecialIdentifier,htmlosConditional,htmlosRepeat,htmlosLabel,htmlosStatement,htmlosOperator,htmlosRelation,htmlosStringSingle,htmlosStringDouble,htmlosNumber,htmlosFloat,htmlosError,htmlosKeyword,htmlosType,htmlosBoolean,htmlosParent
+
+syn cluster htmlosTop contains=@htmlosInside,htmlosDefine,htmlosError,htmlosStorageClass
+
+syn region htmlosRegion keepend matchgroup=Delimiter start="<<" skip=+".\{-}?>.\{-}"\|'.\{-}?>.\{-}'\|/\*.\{-}?>.\{-}\*/+ end=">>" contains=@htmlosTop
+syn region htmlosRegion keepend matchgroup=Delimiter start="\[\[" skip=+".\{-}?>.\{-}"\|'.\{-}?>.\{-}'\|/\*.\{-}?>.\{-}\*/+ end="\]\]" contains=@htmlosTop
+
+
+" sync
+if exists("htmlos_minlines")
+ exec "syn sync minlines=" . htmlos_minlines
+else
+ syn sync minlines=100
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_htmlos_syn_inits")
+ if version < 508
+ let did_htmlos_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink htmlosSpecialIdentifier Operator
+ HiLink htmlosIdentifier Identifier
+ HiLink htmlosStorageClass StorageClass
+ HiLink htmlosComment Comment
+ HiLink htmlosBoolean Boolean
+ HiLink htmlosStringSingle String
+ HiLink htmlosStringDouble String
+ HiLink htmlosNumber Number
+ HiLink htmlosFloat Float
+ HiLink htmlosFunctions Function
+ HiLink htmlosRepeat Repeat
+ HiLink htmlosConditional Conditional
+ HiLink htmlosLabel Label
+ HiLink htmlosStatement Statement
+ HiLink htmlosKeyword Statement
+ HiLink htmlosType Type
+ HiLink htmlosDefine Define
+ HiLink htmlosParent Delimiter
+ HiLink htmlosError Error
+ HiLink htmlosTodo Todo
+ HiLink htmlosOperator Operator
+ HiLink htmlosRelation Operator
+
+ delcommand HiLink
+endif
+let b:current_syntax = "htmlos"
+
+if main_syntax == 'htmlos'
+ unlet main_syntax
+endif
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/ia64.vim b/runtime/syntax/ia64.vim
new file mode 100644
index 000000000..d6292ce63
--- /dev/null
+++ b/runtime/syntax/ia64.vim
@@ -0,0 +1,312 @@
+" Vim syntax file
+" Language: IA-64 (Itanium) assembly language
+" Maintainer: Parth Malwankar <pmalwankar@yahoo.com>
+" URL: http://www.geocities.com/pmalwankar (Home Page with link to my Vim page)
+" http://www.geocities.com/pmalwankar/vim.htm (for VIM)
+" File Version: 0.7
+" Last Change: 2004 May 04
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+"ignore case for assembly
+syn case ignore
+
+" Identifier Keyword characters (defines \k)
+if version >= 600
+ setlocal iskeyword=@,48-57,#,$,.,:,?,@-@,_,~
+else
+ set iskeyword=@,48-57,#,$,.,:,?,@-@,_,~
+endif
+
+syn sync minlines=5
+
+" Read the MASM syntax to start with
+" This is needed as both IA-64 as well as IA-32 instructions are supported
+source <sfile>:p:h/masm.vim
+
+syn region ia64Comment start="//" end="$" contains=ia64Todo
+syn region ia64Comment start="/\*" end="\*/" contains=ia64Todo
+
+syn match ia64Identifier "[a-zA-Z_$][a-zA-Z0-9_$]*"
+syn match ia64Directive "\.[a-zA-Z_$][a-zA-Z_$.]\+"
+syn match ia64Label "[a-zA-Z_$.][a-zA-Z0-9_$.]*\s\=:\>"he=e-1
+syn match ia64Label "[a-zA-Z_$.][a-zA-Z0-9_$.]*\s\=::\>"he=e-2
+syn match ia64Label "[a-zA-Z_$.][a-zA-Z0-9_$.]*\s\=#\>"he=e-1
+syn region ia64string start=+L\="+ skip=+\\\\\|\\"+ end=+"+
+syn match ia64Octal "0[0-7_]*\>"
+syn match ia64Binary "0[bB][01_]*\>"
+syn match ia64Hex "0[xX][0-9a-fA-F_]*\>"
+syn match ia64Decimal "[1-9_][0-9_]*\>"
+syn match ia64Float "[0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*\)\=\>"
+
+"simple instructions
+syn keyword ia64opcode add adds addl addp4 alloc and andcm cover epc
+syn keyword ia64opcode fabs fand fandcm fc flushrs fneg fnegabs for
+syn keyword ia64opcode fpabs fpack fpneg fpnegabs fselect fand fabdcm
+syn keyword ia64opcode fc fwb fxor loadrs movl mux1 mux2 or padd4
+syn keyword ia64opcode pavgsub1 pavgsub2 popcnt psad1 pshl2 pshl4 pshladd2
+syn keyword ia64opcode pshradd2 psub4 rfi rsm rum shl shladd shladdp4
+syn keyword ia64opcode shrp ssm sub sum sync.i tak thash
+syn keyword ia64opcode tpa ttag xor
+
+"put to override these being recognized as floats. They are orignally from masm.vim
+"put here to avoid confusion with float
+syn match ia64Directive "\.186"
+syn match ia64Directive "\.286"
+syn match ia64Directive "\.286c"
+syn match ia64Directive "\.286p"
+syn match ia64Directive "\.287"
+syn match ia64Directive "\.386"
+syn match ia64Directive "\.386c"
+syn match ia64Directive "\.386p"
+syn match ia64Directive "\.387"
+syn match ia64Directive "\.486"
+syn match ia64Directive "\.486c"
+syn match ia64Directive "\.486p"
+syn match ia64Directive "\.8086"
+syn match ia64Directive "\.8087"
+
+
+
+"delimiters
+syn match ia64delimiter ";;"
+
+"operators
+syn match ia64operators "[\[\]()#,]"
+syn match ia64operators "\(+\|-\|=\)"
+
+"TODO
+syn match ia64Todo "\(TODO\|XXX\|FIXME\|NOTE\)"
+
+"What follows is a long list of regular expressions for parsing the
+"ia64 instructions that use many completers
+
+"br
+syn match ia64opcode "br\(\(\.\(cond\|call\|ret\|ia\|cloop\|ctop\|cexit\|wtop\|wexit\)\)\=\(\.\(spnt\|dpnt\|sptk\|dptk\)\)\=\(\.few\|\.many\)\=\(\.clr\)\=\)\=\>"
+"break
+syn match ia64opcode "break\(\.[ibmfx]\)\=\>"
+"brp
+syn match ia64opcode "brp\(\.\(sptk\|dptk\|loop\|exit\)\)\(\.imp\)\=\>"
+syn match ia64opcode "brp\.ret\(\.\(sptk\|dptk\)\)\{1}\(\.imp\)\=\>"
+"bsw
+syn match ia64opcode "bsw\.[01]\>"
+"chk
+syn match ia64opcode "chk\.\(s\(\.[im]\)\=\)\>"
+syn match ia64opcode "chk\.a\.\(clr\|nc\)\>"
+"clrrrb
+syn match ia64opcode "clrrrb\(\.pr\)\=\>"
+"cmp/cmp4
+syn match ia64opcode "cmp4\=\.\(eq\|ne\|l[te]\|g[te]\|[lg]tu\|[lg]eu\)\(\.unc\)\=\>"
+syn match ia64opcode "cmp4\=\.\(eq\|[lgn]e\|[lg]t\)\.\(\(or\(\.andcm\|cm\)\=\)\|\(and\(\(\.or\)\=cm\)\=\)\)\>"
+"cmpxchg
+syn match ia64opcode "cmpxchg[1248]\.\(acq\|rel\)\(\.nt1\|\.nta\)\=\>"
+"czx
+syn match ia64opcode "czx[12]\.[lr]\>"
+"dep
+syn match ia64opcode "dep\(\.z\)\=\>"
+"extr
+syn match ia64opcode "extr\(\.u\)\=\>"
+"fadd
+syn match ia64opcode "fadd\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
+"famax/famin
+syn match ia64opcode "fa\(max\|min\)\(\.s[0-3]\)\=\>"
+"fchkf/fmax/fmin
+syn match ia64opcode "f\(chkf\|max\|min\)\(\.s[0-3]\)\=\>"
+"fclass
+syn match ia64opcode "fclass\(\.n\=m\)\(\.unc\)\=\>"
+"fclrf/fpamax
+syn match ia64opcode "f\(clrf\|pamax\|pamin\)\(\.s[0-3]\)\=\>"
+"fcmp
+syn match ia64opcode "fcmp\.\(n\=[lg][te]\|n\=eq\|\(un\)\=ord\)\(\.unc\)\=\(\.s[0-3]\)\=\>"
+"fcvt/fcvt.xf/fcvt.xuf.pc.sf
+syn match ia64opcode "fcvt\.\(\(fxu\=\(\.trunc\)\=\(\.s[0-3]\)\=\)\|\(xf\|xuf\(\.[sd]\)\=\(\.s[0-3]\)\=\)\)\>"
+"fetchadd
+syn match ia64opcode "fetchadd[48]\.\(acq\|rel\)\(\.nt1\|\.nta\)\=\>"
+"fma/fmpy/fms
+syn match ia64opcode "fm\([as]\|py\)\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
+"fmerge/fpmerge
+syn match ia64opcode "fp\=merge\.\(ns\|se\=\)\>"
+"fmix
+syn match ia64opcode "fmix\.\(lr\|[lr]\)\>"
+"fnma/fnorm/fnmpy
+syn match ia64opcode "fn\(ma\|mpy\|orm\)\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
+"fpcmp
+syn match ia64opcode "fpcmp\.\(n\=[lg][te]\|n\=eq\|\(un\)\=ord\)\(\.s[0-3]\)\=\>"
+"fpcvt
+syn match ia64opcode "fpcvt\.fxu\=\(\(\.trunc\)\=\(\.s[0-3]\)\=\)\>"
+"fpma/fpmax/fpmin/fpmpy/fpms/fpnma/fpnmpy/fprcpa/fpsqrta
+syn match ia64opcode "fp\(max\=\|min\|n\=mpy\|ms\|nma\|rcpa\|sqrta\)\(\.s[0-3]\)\=\>"
+"frcpa/frsqrta
+syn match ia64opcode "fr\(cpa\|sqrta\)\(\.s[0-3]\)\=\>"
+"fsetc/famin/fchkf
+syn match ia64opcode "f\(setc\|amin\|chkf\)\(\.s[0-3]\)\=\>"
+"fsub
+syn match ia64opcode "fsub\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
+"fswap
+syn match ia64opcode "fswap\(\.n[lr]\=\)\=\>"
+"fsxt
+syn match ia64opcode "fsxt\.[lr]\>"
+"getf
+syn match ia64opcode "getf\.\([sd]\|exp\|sig\)\>"
+"invala
+syn match ia64opcode "invala\(\.[ae]\)\=\>"
+"itc/itr
+syn match ia64opcode "it[cr]\.[id]\>"
+"ld
+syn match ia64opcode "ld[1248]\>\|ld[1248]\(\.\(sa\=\|a\|c\.\(nc\|clr\(\.acq\)\=\)\|acq\|bias\)\)\=\(\.nt[1a]\)\=\>"
+syn match ia64opcode "ld8\.fill\(\.nt[1a]\)\=\>"
+"ldf
+syn match ia64opcode "ldf[sde8]\(\(\.\(sa\=\|a\|c\.\(nc\|clr\)\)\)\=\(\.nt[1a]\)\=\)\=\>"
+syn match ia64opcode "ldf\.fill\(\.nt[1a]\)\=\>"
+"ldfp
+syn match ia64opcode "ldfp[sd8]\(\(\.\(sa\=\|a\|c\.\(nc\|clr\)\)\)\=\(\.nt[1a]\)\=\)\=\>"
+"lfetch
+syn match ia64opcode "lfetch\(\.fault\(\.excl\)\=\|\.excl\)\=\(\.nt[12a]\)\=\>"
+"mf
+syn match ia64opcode "mf\(\.a\)\=\>"
+"mix
+syn match ia64opcode "mix[124]\.[lr]\>"
+"mov
+syn match ia64opcode "mov\(\.[im]\)\=\>"
+syn match ia64opcode "mov\(\.ret\)\=\(\(\.sptk\|\.dptk\)\=\(\.imp\)\=\)\=\>"
+"nop
+syn match ia64opcode "nop\(\.[ibmfx]\)\=\>"
+"pack
+syn match ia64opcode "pack\(2\.[su]ss\|4\.sss\)\>"
+"padd //padd4 added to keywords
+syn match ia64opcode "padd[12]\(\.\(sss\|uus\|uuu\)\)\=\>"
+"pavg
+syn match ia64opcode "pavg[12]\(\.raz\)\=\>"
+"pcmp
+syn match ia64opcode "pcmp[124]\.\(eq\|gt\)\>"
+"pmax/pmin
+syn match ia64opcode "pm\(ax\|in\)\(\(1\.u\)\|2\)\>"
+"pmpy
+syn match ia64opcode "pmpy2\.[rl]\>"
+"pmpyshr
+syn match ia64opcode "pmpyshr2\(\.u\)\=\>"
+"probe
+syn match ia64opcode "probe\.[rw]\>"
+syn match ia64opcode "probe\.\(\(r\|w\|rw\)\.fault\)\>"
+"pshr
+syn match ia64opcode "pshr[24]\(\.u\)\=\>"
+"psub
+syn match ia64opcode "psub[12]\(\.\(sss\|uu[su]\)\)\=\>"
+"ptc
+syn match ia64opcode "ptc\.\(l\|e\|ga\=\)\>"
+"ptr
+syn match ia64opcode "ptr\.\(d\|i\)\>"
+"setf
+syn match ia64opcode "setf\.\(s\|d\|exp\|sig\)\>"
+"shr
+syn match ia64opcode "shr\(\.u\)\=\>"
+"srlz
+syn match ia64opcode "srlz\(\.[id]\)\>"
+"st
+syn match ia64opcode "st[1248]\(\.rel\)\=\(\.nta\)\=\>"
+syn match ia64opcode "st8\.spill\(\.nta\)\=\>"
+"stf
+syn match ia64opcode "stf[1248]\(\.nta\)\=\>"
+syn match ia64opcode "stf\.spill\(\.nta\)\=\>"
+"sxt
+syn match ia64opcode "sxt[124]\>"
+"tbit/tnat
+syn match ia64opcode "t\(bit\|nat\)\(\.nz\|\.z\)\=\(\.\(unc\|or\(\.andcm\|cm\)\=\|and\(\.orcm\|cm\)\=\)\)\=\>"
+"unpack
+syn match ia64opcode "unpack[124]\.[lh]\>"
+"xchq
+syn match ia64opcode "xchg[1248]\(\.nt[1a]\)\=\>"
+"xma/xmpy
+syn match ia64opcode "xm\(a\|py\)\.[lh]u\=\>"
+"zxt
+syn match ia64opcode "zxt[124]\>"
+
+
+"The regex for different ia64 registers are given below
+
+"limits the rXXX and fXXX and cr suffix in the range 0-127
+syn match ia64registers "\([fr]\|cr\)\([0-9]\|[1-9][0-9]\|1[0-1][0-9]\|12[0-7]\)\{1}\>"
+"branch ia64registers
+syn match ia64registers "b[0-7]\>"
+"predicate ia64registers
+syn match ia64registers "p\([0-9]\|[1-5][0-9]\|6[0-3]\)\>"
+"application ia64registers
+syn match ia64registers "ar\.\(fpsr\|mat\|unat\|rnat\|pfs\|bsp\|bspstore\|rsc\|lc\|ec\|ccv\|itc\|k[0-7]\)\>"
+"ia32 AR's
+syn match ia64registers "ar\.\(eflag\|fcr\|csd\|ssd\|cflg\|fsr\|fir\|fdr\)\>"
+"sp/gp/pr/pr.rot/rp
+syn keyword ia64registers sp gp pr pr.rot rp ip tp
+"in/out/local
+syn match ia64registers "\(in\|out\|loc\)\([0-9]\|[1-8][0-9]\|9[0-5]\)\>"
+"argument ia64registers
+syn match ia64registers "farg[0-7]\>"
+"return value ia64registers
+syn match ia64registers "fret[0-7]\>"
+"psr
+syn match ia64registers "psr\(\.\(l\|um\)\)\=\>"
+"cr
+syn match ia64registers "cr\.\(dcr\|itm\|iva\|pta\|ipsr\|isr\|ifa\|iip\|itir\|iipa\|ifs\|iim\|iha\|lid\|ivr\|tpr\|eoi\|irr[0-3]\|itv\|pmv\|lrr[01]\|cmcv\)\>"
+"Indirect registers
+syn match ia64registers "\(cpuid\|dbr\|ibr\|pkr\|pmc\|pmd\|rr\|itr\|dtr\)\>"
+"MUX permutations for 8-bit elements
+syn match ia64registers "\(@rev\|@mix\|@shuf\|@alt\|@brcst\)\>"
+"floating point classes
+syn match ia64registers "\(@nat\|@qnan\|@snan\|@pos\|@neg\|@zero\|@unorm\|@norm\|@inf\)\>"
+"link relocation operators
+syn match ia64registers "\(@\(\(\(gp\|sec\|seg\|image\)rel\)\|ltoff\|fptr\|ptloff\|ltv\|section\)\)\>"
+
+"Data allocation syntax
+syn match ia64data "data[1248]\(\(\(\.ua\)\=\(\.msb\|\.lsb\)\=\)\|\(\(\.msb\|\.lsb\)\=\(\.ua\)\=\)\)\=\>"
+syn match ia64data "real\([48]\|1[06]\)\(\(\(\.ua\)\=\(\.msb\|\.lsb\)\=\)\|\(\(\.msb\|\.lsb\)\=\(\.ua\)\=\)\)\=\>"
+syn match ia64data "stringz\=\(\(\(\.ua\)\=\(\.msb\|\.lsb\)\=\)\|\(\(\.msb\|\.lsb\)\=\(\.ua\)\=\)\)\=\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ia64_syn_inits")
+ if version < 508
+ let did_ia64_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ "put masm groups with our groups
+ HiLink masmOperator ia64operator
+ HiLink masmDirective ia64Directive
+ HiLink masmOpcode ia64Opcode
+ HiLink masmIdentifier ia64Identifier
+ HiLink masmFloat ia64Float
+
+ "ia64 specific stuff
+ HiLink ia64Label Define
+ HiLink ia64Comment Comment
+ HiLink ia64Directive Type
+ HiLink ia64opcode Statement
+ HiLink ia64registers Operator
+ HiLink ia64string String
+ HiLink ia64Hex Number
+ HiLink ia64Binary Number
+ HiLink ia64Octal Number
+ HiLink ia64Float Float
+ HiLink ia64Decimal Number
+ HiLink ia64Identifier Identifier
+ HiLink ia64data Type
+ HiLink ia64delimiter Delimiter
+ HiLink ia64operator Operator
+ HiLink ia64Todo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ia64"
+
+" vim: ts=8 sw=2
+
diff --git a/runtime/syntax/icemenu.vim b/runtime/syntax/icemenu.vim
new file mode 100644
index 000000000..99109388a
--- /dev/null
+++ b/runtime/syntax/icemenu.vim
@@ -0,0 +1,36 @@
+" Vim syntax file
+" Language: Icewm Menu
+" Maintainer: James Mahler <jmahler@purdue.edu>
+" Last Change: Tue Dec 9 21:08:22 EST 2003
+" Extensions: ~/.icewm/menu
+" Comment: Icewm is a lightweight window manager. This adds syntax
+" highlighting when editing your user's menu file (~/.icewm/menu).
+
+" clear existing syntax
+if version < 600
+ syntax clear
+elseif exists("bLcurrent_syntax")
+ finish
+endif
+
+" not case sensitive
+syntax case ignore
+
+" icons .xpm .png and .gif
+syntax match _icon /"\=\/.*\.xpm"\=/
+syntax match _icon /"\=\/.*\.png"\=/
+syntax match _icon /"\=\/.*\.gif"\=/
+syntax match _icon /"\-"/
+
+" separator
+syntax keyword _rules separator
+
+" prog and menu
+syntax keyword _ids menu prog
+
+" highlights
+highlight link _rules Underlined
+highlight link _ids Type
+highlight link _icon Special
+
+let b:current_syntax = "IceMenu"
diff --git a/runtime/syntax/icon.vim b/runtime/syntax/icon.vim
new file mode 100644
index 000000000..1a73c43d8
--- /dev/null
+++ b/runtime/syntax/icon.vim
@@ -0,0 +1,212 @@
+" Vim syntax file
+" Language: Icon
+" Maintainer: Wendell Turner <wendell@adsi-m4.com>
+" URL: ftp://ftp.halcyon.com/pub/users/wturner/icon.vim
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword iconFunction abs acos any args asin atan bal
+syn keyword iconFunction callout center char chdir close collect copy
+syn keyword iconFunction cos cset delay delete detab display dtor
+syn keyword iconFunction entab errorclear exit exp find flush function
+syn keyword iconFunction get getch getche getenv iand icom image
+syn keyword iconFunction insert integer ior ishift ixor kbhit key
+syn keyword iconFunction left list loadfunc log many map match
+syn keyword iconFunction member move name numeric open ord pop
+syn keyword iconFunction pos proc pull push put read reads
+syn keyword iconFunction real remove rename repl reverse right rtod
+syn keyword iconFunction runerr save seek seq set sin sort
+syn keyword iconFunction sortf sqrt stop string system tab table
+syn keyword iconFunction tan trim type upto variable where write writes
+
+" Keywords
+syn match iconKeyword "&allocated"
+syn match iconKeyword "&ascii"
+syn match iconKeyword "&clock"
+syn match iconKeyword "&collections"
+syn match iconKeyword "&cset"
+syn match iconKeyword "&current"
+syn match iconKeyword "&date"
+syn match iconKeyword "&dateline"
+syn match iconKeyword "&digits"
+syn match iconKeyword "&dump"
+syn match iconKeyword "&e"
+syn match iconKeyword "&error"
+syn match iconKeyword "&errornumber"
+syn match iconKeyword "&errortext"
+syn match iconKeyword "&errorvalue"
+syn match iconKeyword "&errout"
+syn match iconKeyword "&fail"
+syn match iconKeyword "&features"
+syn match iconKeyword "&file"
+syn match iconKeyword "&host"
+syn match iconKeyword "&input"
+syn match iconKeyword "&lcase"
+syn match iconKeyword "&letters"
+syn match iconKeyword "&level"
+syn match iconKeyword "&line"
+syn match iconKeyword "&main"
+syn match iconKeyword "&null"
+syn match iconKeyword "&output"
+syn match iconKeyword "&phi"
+syn match iconKeyword "&pi"
+syn match iconKeyword "&pos"
+syn match iconKeyword "&progname"
+syn match iconKeyword "&random"
+syn match iconKeyword "&regions"
+syn match iconKeyword "&source"
+syn match iconKeyword "&storage"
+syn match iconKeyword "&subject"
+syn match iconKeyword "&time"
+syn match iconKeyword "&trace"
+syn match iconKeyword "&ucase"
+syn match iconKeyword "&version"
+
+" Reserved words
+syn keyword iconReserved break by case create default do
+syn keyword iconReserved else end every fail if
+syn keyword iconReserved initial link next not of
+syn keyword iconReserved procedure repeat return suspend
+syn keyword iconReserved then to until while
+
+" Storage class reserved words
+syn keyword iconStorageClass global static local record
+
+syn keyword iconTodo contained TODO FIXME XXX BUG
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match iconSpecial contained "\\x\x\{2}\|\\\o\{3\}\|\\[bdeflnrtv\"\'\\]\|\\^c[a-zA-Z0-9]\|\\$"
+syn region iconString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=iconSpecial
+syn region iconCset start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=iconSpecial
+syn match iconCharacter "'[^\\]'"
+
+" not sure about these
+"syn match iconSpecialCharacter "'\\[bdeflnrtv]'"
+"syn match iconSpecialCharacter "'\\\o\{3\}'"
+"syn match iconSpecialCharacter "'\\x\x\{2}'"
+"syn match iconSpecialCharacter "'\\^c\[a-zA-Z0-9]'"
+
+"when wanted, highlight trailing white space
+if exists("icon_space_errors")
+ syn match iconSpaceError "\s*$"
+ syn match iconSpaceError " \+\t"me=e-1
+endif
+
+"catch errors caused by wrong parenthesis
+syn cluster iconParenGroup contains=iconParenError,iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField
+
+syn region iconParen transparent start='(' end=')' contains=ALLBUT,@iconParenGroup
+syn match iconParenError ")"
+syn match iconInParen contained "[{}]"
+
+
+syn case ignore
+
+"integer number, or floating point number without a dot
+syn match iconNumber "\<\d\+\>"
+
+"floating point number, with dot, optional exponent
+syn match iconFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\>"
+
+"floating point number, starting with a dot, optional exponent
+syn match iconFloat "\.\d\+\(e[-+]\=\d\+\)\=\>"
+
+"floating point number, without dot, with exponent
+syn match iconFloat "\<\d\+e[-+]\=\d\+\>"
+
+"radix number
+syn match iconRadix "\<\d\{1,2}[rR][a-zA-Z0-9]\+\>"
+
+
+" syn match iconIdentifier "\<[a-z_][a-z0-9_]*\>"
+
+syn case match
+
+" Comment
+syn match iconComment "#.*" contains=iconTodo,iconSpaceError
+
+syn region iconPreCondit start="^\s*$\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=iconComment,iconString,iconCharacter,iconNumber,iconCommentError,iconSpaceError
+
+syn region iconIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match iconIncluded contained "<[^>]*>"
+syn match iconInclude "^\s*$\s*include\>\s*["<]" contains=iconIncluded
+"syn match iconLineSkip "\\$"
+
+syn cluster iconPreProcGroup contains=iconPreCondit,iconIncluded,iconInclude,iconDefine,iconInParen,iconUserLabel
+
+syn region iconDefine start="^\s*$\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,@iconPreProcGroup
+
+"wt:syn region iconPreProc "start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" "end="$" contains=ALLBUT,@iconPreProcGroup
+
+" Highlight User Labels
+
+" syn cluster iconMultiGroup contains=iconIncluded,iconSpecial,iconTodo,iconUserCont,iconUserLabel,iconBitField
+
+if !exists("icon_minlines")
+ let icon_minlines = 15
+endif
+exec "syn sync ccomment iconComment minlines=" . icon_minlines
+
+" Define the default highlighting.
+
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting
+if version >= 508 || !exists("did_icon_syn_inits")
+ if version < 508
+ let did_icon_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+
+ " HiLink iconSpecialCharacter iconSpecial
+
+ HiLink iconOctalError iconError
+ HiLink iconParenError iconError
+ HiLink iconInParen iconError
+ HiLink iconCommentError iconError
+ HiLink iconSpaceError iconError
+ HiLink iconCommentError iconError
+ HiLink iconIncluded iconString
+ HiLink iconCommentString iconString
+ HiLink iconComment2String iconString
+ HiLink iconCommentSkip iconComment
+
+ HiLink iconUserLabel Label
+ HiLink iconCharacter Character
+ HiLink iconNumber Number
+ HiLink iconRadix Number
+ HiLink iconFloat Float
+ HiLink iconInclude Include
+ HiLink iconPreProc PreProc
+ HiLink iconDefine Macro
+ HiLink iconError Error
+ HiLink iconStatement Statement
+ HiLink iconPreCondit PreCondit
+ HiLink iconString String
+ HiLink iconCset String
+ HiLink iconComment Comment
+ HiLink iconSpecial SpecialChar
+ HiLink iconTodo Todo
+ HiLink iconStorageClass StorageClass
+ HiLink iconFunction Statement
+ HiLink iconReserved Label
+ HiLink iconKeyword Operator
+
+ "HiLink iconIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "icon"
+
diff --git a/runtime/syntax/idl.vim b/runtime/syntax/idl.vim
new file mode 100644
index 000000000..84cf08b59
--- /dev/null
+++ b/runtime/syntax/idl.vim
@@ -0,0 +1,203 @@
+" Vim syntax file
+" Language: IDL (Interface Description Language)
+" Maintainer: Jody Goldberg <jgoldberg@home.com>
+" Last Change: 2001 May 09
+
+" This is an experiment. IDL's structure is simple enough to permit a full
+" grammar based approach to rather than using a few heuristics. The result
+" is large and somewhat repetative but seems to work.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Misc basic
+syn match idlId contained "[a-zA-Z][a-zA-Z0-9_]*"
+syn match idlSemiColon contained ";"
+syn match idlCommaArg contained "," skipempty skipwhite nextgroup=idlSimpDecl
+syn region idlArraySize1 contained start=:\[: end=:\]: skipempty skipwhite nextgroup=idlArraySize1,idlSemiColon,idlCommaArg contains=idlArraySize1,idlLiteral
+syn match idlSimpDecl contained "[a-zA-Z][a-zA-Z0-9_]*" skipempty skipwhite nextgroup=idlSemiColon,idlCommaArg,idlArraySize1
+syn region idlSting contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+
+syn match idlLiteral contained "[1-9]\d*\(\.\d*\)\="
+syn match idlLiteral contained "\.\d\+"
+syn keyword idlLiteral contained TRUE FALSE
+
+" Comments
+syn keyword idlTodo contained TODO FIXME XXX
+syn region idlComment start="/\*" end="\*/" contains=idlTodo
+syn match idlComment "//.*" contains=idlTodo
+syn match idlCommentError "\*/"
+
+" C style Preprocessor
+syn region idlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+
+syn match idlIncluded contained "<[^>]*>"
+syn match idlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=idlIncluded,idlString
+syn region idlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=idlComment,idlCommentError
+syn region idlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=idlLiteral, idlString
+
+" Constants
+syn keyword idlConst const skipempty skipwhite nextgroup=idlBaseType,idlBaseTypeInt
+
+" Attribute
+syn keyword idlROAttr readonly skipempty skipwhite nextgroup=idlAttr
+syn keyword idlAttr attribute skipempty skipwhite nextgroup=idlBaseTypeInt,idlBaseType
+
+" Types
+syn region idlD4 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlSeqType,idlBaseTypeInt,idlBaseType,idlLiteral
+syn keyword idlSeqType contained sequence skipempty skipwhite nextgroup=idlD4
+syn keyword idlBaseType contained float double char boolean octet any skipempty skipwhite nextgroup=idlSimpDecl
+syn keyword idlBaseTypeInt contained short long skipempty skipwhite nextgroup=idlSimpDecl
+syn keyword idlBaseType contained unsigned skipempty skipwhite nextgroup=idlBaseTypeInt
+syn region idlD1 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlString,idlLiteral
+syn keyword idlBaseType contained string skipempty skipwhite nextgroup=idlD1,idlSimpDecl
+syn match idlBaseType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlSimpDecl
+
+" Modules
+syn region idlModuleContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlInterface,idlComment,idlTypedef,idlConst,idlException,idlModule
+syn match idlModuleName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlModuleContent,idlSemiColon
+syn keyword idlModule module skipempty skipwhite nextgroup=idlModuleName
+
+" Interfaces
+syn region idlInterfaceContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlComment,idlROAttr,idlAttr,idlOp,idlOneWayOp,idlException,idlConst,idlTypedef
+syn match idlInheritFrom2 contained "," skipempty skipwhite nextgroup=idlInheritFrom
+syn match idlInheritFrom contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlInheritFrom2,idlInterfaceContent
+syn match idlInherit contained ":" skipempty skipwhite nextgroup=idlInheritFrom
+syn match idlInterfaceName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlInterfaceContent,idlInherit,idlSemiColon
+syn keyword idlInterface interface skipempty skipwhite nextgroup=idlInterfaceName
+
+
+" Raises
+syn keyword idlRaises contained raises skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon
+
+" Context
+syn keyword idlContext contained context skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon
+
+" Operation
+syn match idlParmList contained "," skipempty skipwhite nextgroup=idlOpParms
+syn region idlArraySize contained start="\[" end="\]" skipempty skipwhite nextgroup=idlArraySize,idlParmList contains=idlArraySize,idlLiteral
+syn match idlParmName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlParmList,idlArraySize
+syn keyword idlParmInt contained short long skipempty skipwhite nextgroup=idlParmName
+syn keyword idlParmType contained unsigned skipempty skipwhite nextgroup=idlParmInt
+syn region idlD3 contained start="<" end=">" skipempty skipwhite nextgroup=idlParmName contains=idlString,idlLiteral
+syn keyword idlParmType contained string skipempty skipwhite nextgroup=idlD3,idlParmName
+syn keyword idlParmType contained void float double char boolean octet any skipempty skipwhite nextgroup=idlParmName
+syn match idlParmType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlParmName
+syn keyword idlOpParms contained in out inout skipempty skipwhite nextgroup=idlParmType
+
+syn region idlOpContents contained start="(" end=")" skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon contains=idlOpParms
+syn match idlOpName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlOpContents
+syn keyword idlOpInt contained short long skipempty skipwhite nextgroup=idlOpName
+syn region idlD2 contained start="<" end=">" skipempty skipwhite nextgroup=idlOpName contains=idlString,idlLiteral
+syn keyword idlOp contained unsigned skipempty skipwhite nextgroup=idlOpInt
+syn keyword idlOp contained string skipempty skipwhite nextgroup=idlD2,idlOpName
+syn keyword idlOp contained void float double char boolean octet any skipempty skipwhite nextgroup=idlOpName
+syn match idlOp contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlOpName
+syn keyword idlOp contained void skipempty skipwhite nextgroup=idlOpName
+syn keyword idlOneWayOp contained oneway skipempty skipwhite nextgroup=idOp
+
+" Enum
+syn region idlEnumContents contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon, idlSimpDecl contains=idlId,idlComment
+syn match idlEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlEnumContents
+syn keyword idlEnum enum skipempty skipwhite nextgroup=idlEnumName
+
+" Typedef
+syn keyword idlTypedef typedef skipempty skipwhite nextgroup=idlBaseType, idlBaseTypeInt, idlSeqType
+
+" Struct
+syn region idlStructContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon, idlSimpDecl contains=idlBaseType, idlBaseTypeInt, idlSeqType,idlComment, idlEnum, idlUnion
+syn match idlStructName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlStructContent
+syn keyword idlStruct struct skipempty skipwhite nextgroup=idlStructName
+
+" Exception
+syn keyword idlException exception skipempty skipwhite nextgroup=idlStructName
+
+" Union
+syn match idlColon contained ":" skipempty skipwhite nextgroup=idlCase,idlSeqType,idlBaseType,idlBaseTypeInt
+syn region idlCaseLabel contained start="" skip="::" end=":"me=e-1 skipempty skipwhite nextgroup=idlColon contains=idlLiteral,idlString
+syn keyword idlCase contained case skipempty skipwhite nextgroup=idlCaseLabel
+syn keyword idlCase contained default skipempty skipwhite nextgroup=idlColon
+syn region idlUnionContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon,idlSimpDecl contains=idlCase
+syn region idlSwitchType contained start="(" end=")" skipempty skipwhite nextgroup=idlUnionContent
+syn keyword idlUnionSwitch contained switch skipempty skipwhite nextgroup=idlSwitchType
+syn match idlUnionName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlUnionSwitch
+syn keyword idlUnion union skipempty skipwhite nextgroup=idlUnionName
+
+syn sync lines=200
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_idl_syntax_inits")
+ if version < 508
+ let did_idl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink idlInclude Include
+ HiLink idlPreProc PreProc
+ HiLink idlPreCondit PreCondit
+ HiLink idlDefine Macro
+ HiLink idlIncluded String
+ HiLink idlString String
+ HiLink idlComment Comment
+ HiLink idlTodo Todo
+ HiLink idlLiteral Number
+
+ HiLink idlModule Keyword
+ HiLink idlInterface Keyword
+ HiLink idlEnum Keyword
+ HiLink idlStruct Keyword
+ HiLink idlUnion Keyword
+ HiLink idlTypedef Keyword
+ HiLink idlException Keyword
+
+ HiLink idlModuleName Typedef
+ HiLink idlInterfaceName Typedef
+ HiLink idlEnumName Typedef
+ HiLink idlStructName Typedef
+ HiLink idlUnionName Typedef
+
+ HiLink idlBaseTypeInt idlType
+ HiLink idlBaseType idlType
+ HiLink idlSeqType idlType
+ HiLink idlD1 Paren
+ HiLink idlD2 Paren
+ HiLink idlD3 Paren
+ HiLink idlD4 Paren
+ "HiLink idlArraySize Paren
+ "HiLink idlArraySize1 Paren
+ HiLink idlModuleContent Paren
+ HiLink idlUnionContent Paren
+ HiLink idlStructContent Paren
+ HiLink idlEnumContents Paren
+ HiLink idlInterfaceContent Paren
+
+ HiLink idlSimpDecl Identifier
+ HiLink idlROAttr StorageClass
+ HiLink idlAttr Keyword
+ HiLink idlConst StorageClass
+
+ HiLink idlOneWayOp StorageClass
+ HiLink idlOp idlType
+ HiLink idlParmType idlType
+ HiLink idlOpName Function
+ HiLink idlOpParms StorageClass
+ HiLink idlParmName Identifier
+ HiLink idlInheritFrom Identifier
+
+ HiLink idlId Constant
+ "HiLink idlCase Keyword
+ HiLink idlCaseLabel Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "idl"
+
+" vim: ts=8
diff --git a/runtime/syntax/idlang.vim b/runtime/syntax/idlang.vim
new file mode 100644
index 000000000..9d567e5f8
--- /dev/null
+++ b/runtime/syntax/idlang.vim
@@ -0,0 +1,253 @@
+" Interactive Data Language syntax file (IDL, too [:-)]
+" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
+" Last change: 2003 Apr 25
+" Created by: Hermann Rochholz <Hermann.Rochholz AT gmx.de>
+
+" Remove any old syntax stuff hanging around
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+
+syn match idlangStatement "^\s*pro\s"
+syn match idlangStatement "^\s*function\s"
+syn keyword idlangStatement return continue mod do break
+syn keyword idlangStatement compile_opt forward_function goto
+syn keyword idlangStatement begin common end of
+syn keyword idlangStatement inherits on_ioerror begin
+
+syn keyword idlangConditional if else then for while case switch
+syn keyword idlangConditional endcase endelse endfor endswitch
+syn keyword idlangConditional endif endrep endwhile repeat until
+
+syn match idlangOperator "\ and\ "
+syn match idlangOperator "\ eq\ "
+syn match idlangOperator "\ ge\ "
+syn match idlangOperator "\ gt\ "
+syn match idlangOperator "\ le\ "
+syn match idlangOperator "\ lt\ "
+syn match idlangOperator "\ ne\ "
+syn match idlangOperator /\(\ \|(\)not\ /hs=e-3
+syn match idlangOperator "\ or\ "
+syn match idlangOperator "\ xor\ "
+
+syn keyword idlangStop stop pause
+
+syn match idlangStrucvar "\h\w*\(\.\h\w*\)\+"
+syn match idlangStrucvar "[),\]]\(\.\h\w*\)\+"hs=s+1
+
+syn match idlangSystem "\!\a\w*\(\.\w*\)\="
+
+syn match idlangKeyword "\([(,]\s*\(\$\_s*\)\=\)\@<=/\h\w*"
+syn match idlangKeyword "\([(,]\s*\(\$\_s*\)\=\)\@<=\h\w*\s*="
+
+syn keyword idlangTodo contained TODO
+
+syn region idlangString start=+"+ end=+"+
+syn region idlangString start=+'+ end=+'+
+
+syn match idlangPreCondit "^\s*@\w*\(\.\a\{3}\)\="
+
+syn match idlangRealNumber "\<\d\+\(\.\=\d*e[+-]\=\d\+\|\.\d*d\|\.\d*\|d\)"
+syn match idlangRealNumber "\.\d\+\(d\|e[+-]\=\d\+\)\="
+
+syn match idlangNumber "\<\.\@!\d\+\.\@!\(b\|u\|us\|s\|l\|ul\|ll\|ull\)\=\>"
+
+syn match idlangComment "[\;].*$" contains=idlangTodo
+
+syn match idlangContinueLine "\$\s*\($\|;\)"he=s+1 contains=idlangComment
+syn match idlangContinueLine "&\s*\(\h\|;\)"he=s+1 contains=ALL
+
+syn match idlangDblCommaError "\,\s*\,"
+
+" List of standard routines as of IDL version 5.4.
+syn match idlangRoutine "EOS_\a*"
+syn match idlangRoutine "HDF_\a*"
+syn match idlangRoutine "CDF_\a*"
+syn match idlangRoutine "NCDF_\a*"
+syn match idlangRoutine "QUERY_\a*"
+syn match idlangRoutine "\<MAX\s*("he=e-1
+syn match idlangRoutine "\<MIN\s*("he=e-1
+
+syn keyword idlangRoutine A_CORRELATE ABS ACOS ADAPT_HIST_EQUAL ALOG ALOG10
+syn keyword idlangRoutine AMOEBA ANNOTATE ARG_PRESENT ARRAY_EQUAL ARROW
+syn keyword idlangRoutine ASCII_TEMPLATE ASIN ASSOC ATAN AXIS BAR_PLOT
+syn keyword idlangRoutine BESELI BESELJ BESELK BESELY BETA BILINEAR BIN_DATE
+syn keyword idlangRoutine BINARY_TEMPLATE BINDGEN BINOMIAL BLAS_AXPY BLK_CON
+syn keyword idlangRoutine BOX_CURSOR BREAK BREAKPOINT BROYDEN BYTARR BYTE
+syn keyword idlangRoutine BYTEORDER BYTSCL C_CORRELATE CALDAT CALENDAR
+syn keyword idlangRoutine CALL_EXTERNAL CALL_FUNCTION CALL_METHOD
+syn keyword idlangRoutine CALL_PROCEDURE CATCH CD CEIL CHEBYSHEV CHECK_MATH
+syn keyword idlangRoutine CHISQR_CVF CHISQR_PDF CHOLDC CHOLSOL CINDGEN
+syn keyword idlangRoutine CIR_3PNT CLOSE CLUST_WTS CLUSTER COLOR_CONVERT
+syn keyword idlangRoutine COLOR_QUAN COLORMAP_APPLICABLE COMFIT COMMON
+syn keyword idlangRoutine COMPLEX COMPLEXARR COMPLEXROUND
+syn keyword idlangRoutine COMPUTE_MESH_NORMALS COND CONGRID CONJ
+syn keyword idlangRoutine CONSTRAINED_MIN CONTOUR CONVERT_COORD CONVOL
+syn keyword idlangRoutine COORD2TO3 CORRELATE COS COSH CRAMER CREATE_STRUCT
+syn keyword idlangRoutine CREATE_VIEW CROSSP CRVLENGTH CT_LUMINANCE CTI_TEST
+syn keyword idlangRoutine CURSOR CURVEFIT CV_COORD CVTTOBM CW_ANIMATE
+syn keyword idlangRoutine CW_ANIMATE_GETP CW_ANIMATE_LOAD CW_ANIMATE_RUN
+syn keyword idlangRoutine CW_ARCBALL CW_BGROUP CW_CLR_INDEX CW_COLORSEL
+syn keyword idlangRoutine CW_DEFROI CW_FIELD CW_FILESEL CW_FORM CW_FSLIDER
+syn keyword idlangRoutine CW_LIGHT_EDITOR CW_LIGHT_EDITOR_GET
+syn keyword idlangRoutine CW_LIGHT_EDITOR_SET CW_ORIENT CW_PALETTE_EDITOR
+syn keyword idlangRoutine CW_PALETTE_EDITOR_GET CW_PALETTE_EDITOR_SET
+syn keyword idlangRoutine CW_PDMENU CW_RGBSLIDER CW_TMPL CW_ZOOM DBLARR
+syn keyword idlangRoutine DCINDGEN DCOMPLEX DCOMPLEXARR DEFINE_KEY DEFROI
+syn keyword idlangRoutine DEFSYSV DELETE_SYMBOL DELLOG DELVAR DERIV DERIVSIG
+syn keyword idlangRoutine DETERM DEVICE DFPMIN DIALOG_MESSAGE
+syn keyword idlangRoutine DIALOG_PICKFILE DIALOG_PRINTERSETUP
+syn keyword idlangRoutine DIALOG_PRINTJOB DIALOG_READ_IMAGE
+syn keyword idlangRoutine DIALOG_WRITE_IMAGE DIGITAL_FILTER DILATE DINDGEN
+syn keyword idlangRoutine DISSOLVE DIST DLM_LOAD DLM_REGISTER
+syn keyword idlangRoutine DO_APPLE_SCRIPT DOC_LIBRARY DOUBLE DRAW_ROI EFONT
+syn keyword idlangRoutine EIGENQL EIGENVEC ELMHES EMPTY ENABLE_SYSRTN EOF
+syn keyword idlangRoutine ERASE ERODE ERRORF ERRPLOT EXECUTE EXIT EXP EXPAND
+syn keyword idlangRoutine EXPAND_PATH EXPINT EXTRAC EXTRACT_SLICE F_CVF
+syn keyword idlangRoutine F_PDF FACTORIAL FFT FILE_CHMOD FILE_DELETE
+syn keyword idlangRoutine FILE_EXPAND_PATH FILE_MKDIR FILE_TEST FILE_WHICH
+syn keyword idlangRoutine FILEPATH FINDFILE FINDGEN FINITE FIX FLICK FLOAT
+syn keyword idlangRoutine FLOOR FLOW3 FLTARR FLUSH FOR FORMAT_AXIS_VALUES
+syn keyword idlangRoutine FORWARD_FUNCTION FREE_LUN FSTAT FULSTR FUNCT
+syn keyword idlangRoutine FV_TEST FX_ROOT FZ_ROOTS GAMMA GAMMA_CT
+syn keyword idlangRoutine GAUSS_CVF GAUSS_PDF GAUSS2DFIT GAUSSFIT GAUSSINT
+syn keyword idlangRoutine GET_DRIVE_LIST GET_KBRD GET_LUN GET_SCREEN_SIZE
+syn keyword idlangRoutine GET_SYMBOL GETENV GOTO GRID_TPS GRID3 GS_ITER
+syn keyword idlangRoutine H_EQ_CT H_EQ_INT HANNING HEAP_GC HELP HILBERT
+syn keyword idlangRoutine HIST_2D HIST_EQUAL HISTOGRAM HLS HOUGH HQR HSV
+syn keyword idlangRoutine IBETA IDENTITY IDL_Container IDLanROI
+syn keyword idlangRoutine IDLanROIGroup IDLffDICOM IDLffDXF IDLffLanguageCat
+syn keyword idlangRoutine IDLffShape IDLgrAxis IDLgrBuffer IDLgrClipboard
+syn keyword idlangRoutine IDLgrColorbar IDLgrContour IDLgrFont IDLgrImage
+syn keyword idlangRoutine IDLgrLegend IDLgrLight IDLgrModel IDLgrMPEG
+syn keyword idlangRoutine IDLgrPalette IDLgrPattern IDLgrPlot IDLgrPolygon
+syn keyword idlangRoutine IDLgrPolyline IDLgrPrinter IDLgrROI IDLgrROIGroup
+syn keyword idlangRoutine IDLgrScene IDLgrSurface IDLgrSymbol
+syn keyword idlangRoutine IDLgrTessellator IDLgrText IDLgrView
+syn keyword idlangRoutine IDLgrViewgroup IDLgrVolume IDLgrVRML IDLgrWindow
+syn keyword idlangRoutine IGAMMA IMAGE_CONT IMAGE_STATISTICS IMAGINARY
+syn keyword idlangRoutine INDGEN INT_2D INT_3D INT_TABULATED INTARR INTERPOL
+syn keyword idlangRoutine INTERPOLATE INVERT IOCTL ISHFT ISOCONTOUR
+syn keyword idlangRoutine ISOSURFACE JOURNAL JULDAY KEYWORD_SET KRIG2D
+syn keyword idlangRoutine KURTOSIS KW_TEST L64INDGEN LABEL_DATE LABEL_REGION
+syn keyword idlangRoutine LADFIT LAGUERRE LEEFILT LEGENDRE LINBCG LINDGEN
+syn keyword idlangRoutine LINFIT LINKIMAGE LIVE_CONTOUR LIVE_CONTROL
+syn keyword idlangRoutine LIVE_DESTROY LIVE_EXPORT LIVE_IMAGE LIVE_INFO
+syn keyword idlangRoutine LIVE_LINE LIVE_LOAD LIVE_OPLOT LIVE_PLOT
+syn keyword idlangRoutine LIVE_PRINT LIVE_RECT LIVE_STYLE LIVE_SURFACE
+syn keyword idlangRoutine LIVE_TEXT LJLCT LL_ARC_DISTANCE LMFIT LMGR LNGAMMA
+syn keyword idlangRoutine LNP_TEST LOADCT LOCALE_GET LON64ARR LONARR LONG
+syn keyword idlangRoutine LONG64 LSODE LU_COMPLEX LUDC LUMPROVE LUSOL
+syn keyword idlangRoutine M_CORRELATE MACHAR MAKE_ARRAY MAKE_DLL MAP_2POINTS
+syn keyword idlangRoutine MAP_CONTINENTS MAP_GRID MAP_IMAGE MAP_PATCH
+syn keyword idlangRoutine MAP_PROJ_INFO MAP_SET MATRIX_MULTIPLY MD_TEST MEAN
+syn keyword idlangRoutine MEANABSDEV MEDIAN MEMORY MESH_CLIP MESH_DECIMATE
+syn keyword idlangRoutine MESH_ISSOLID MESH_MERGE MESH_NUMTRIANGLES MESH_OBJ
+syn keyword idlangRoutine MESH_SMOOTH MESH_SURFACEAREA MESH_VALIDATE
+syn keyword idlangRoutine MESH_VOLUME MESSAGE MIN_CURVE_SURF MK_HTML_HELP
+syn keyword idlangRoutine MODIFYCT MOMENT MORPH_CLOSE MORPH_DISTANCE
+syn keyword idlangRoutine MORPH_GRADIENT MORPH_HITORMISS MORPH_OPEN
+syn keyword idlangRoutine MORPH_THIN MORPH_TOPHAT MPEG_CLOSE MPEG_OPEN
+syn keyword idlangRoutine MPEG_PUT MPEG_SAVE MSG_CAT_CLOSE MSG_CAT_COMPILE
+syn keyword idlangRoutine MSG_CAT_OPEN MULTI N_ELEMENTS N_PARAMS N_TAGS
+syn keyword idlangRoutine NEWTON NORM OBJ_CLASS OBJ_DESTROY OBJ_ISA OBJ_NEW
+syn keyword idlangRoutine OBJ_VALID OBJARR ON_ERROR ON_IOERROR ONLINE_HELP
+syn keyword idlangRoutine OPEN OPENR OPENW OPLOT OPLOTERR P_CORRELATE
+syn keyword idlangRoutine PARTICLE_TRACE PCOMP PLOT PLOT_3DBOX PLOT_FIELD
+syn keyword idlangRoutine PLOTERR PLOTS PNT_LINE POINT_LUN POLAR_CONTOUR
+syn keyword idlangRoutine POLAR_SURFACE POLY POLY_2D POLY_AREA POLY_FIT
+syn keyword idlangRoutine POLYFILL POLYFILLV POLYSHADE POLYWARP POPD POWELL
+syn keyword idlangRoutine PRIMES PRINT PRINTF PRINTD PROFILE PROFILER
+syn keyword idlangRoutine PROFILES PROJECT_VOL PS_SHOW_FONTS PSAFM PSEUDO
+syn keyword idlangRoutine PTR_FREE PTR_NEW PTR_VALID PTRARR PUSHD QROMB
+syn keyword idlangRoutine QROMO QSIMP R_CORRELATE R_TEST RADON RANDOMN
+syn keyword idlangRoutine RANDOMU RANKS RDPIX READ READF READ_ASCII
+syn keyword idlangRoutine READ_BINARY READ_BMP READ_DICOM READ_IMAGE
+syn keyword idlangRoutine READ_INTERFILE READ_JPEG READ_PICT READ_PNG
+syn keyword idlangRoutine READ_PPM READ_SPR READ_SRF READ_SYLK READ_TIFF
+syn keyword idlangRoutine READ_WAV READ_WAVE READ_X11_BITMAP READ_XWD READS
+syn keyword idlangRoutine READU REBIN RECALL_COMMANDS RECON3 REDUCE_COLORS
+syn keyword idlangRoutine REFORM REGRESS REPLICATE REPLICATE_INPLACE
+syn keyword idlangRoutine RESOLVE_ALL RESOLVE_ROUTINE RESTORE RETALL RETURN
+syn keyword idlangRoutine REVERSE REWIND RK4 ROBERTS ROT ROTATE ROUND
+syn keyword idlangRoutine ROUTINE_INFO RS_TEST S_TEST SAVE SAVGOL SCALE3
+syn keyword idlangRoutine SCALE3D SEARCH2D SEARCH3D SET_PLOT SET_SHADING
+syn keyword idlangRoutine SET_SYMBOL SETENV SETLOG SETUP_KEYS SFIT
+syn keyword idlangRoutine SHADE_SURF SHADE_SURF_IRR SHADE_VOLUME SHIFT SHOW3
+syn keyword idlangRoutine SHOWFONT SIN SINDGEN SINH SIZE SKEWNESS SKIPF
+syn keyword idlangRoutine SLICER3 SLIDE_IMAGE SMOOTH SOBEL SOCKET SORT SPAWN
+syn keyword idlangRoutine SPH_4PNT SPH_SCAT SPHER_HARM SPL_INIT SPL_INTERP
+syn keyword idlangRoutine SPLINE SPLINE_P SPRSAB SPRSAX SPRSIN SPRSTP SQRT
+syn keyword idlangRoutine STANDARDIZE STDDEV STOP STRARR STRCMP STRCOMPRESS
+syn keyword idlangRoutine STREAMLINE STREGEX STRETCH STRING STRJOIN STRLEN
+syn keyword idlangRoutine STRLOWCASE STRMATCH STRMESSAGE STRMID STRPOS
+syn keyword idlangRoutine STRPUT STRSPLIT STRTRIM STRUCT_ASSIGN STRUCT_HIDE
+syn keyword idlangRoutine STRUPCASE SURFACE SURFR SVDC SVDFIT SVSOL
+syn keyword idlangRoutine SWAP_ENDIAN SWITCH SYSTIME T_CVF T_PDF T3D
+syn keyword idlangRoutine TAG_NAMES TAN TANH TAPRD TAPWRT TEK_COLOR
+syn keyword idlangRoutine TEMPORARY TETRA_CLIP TETRA_SURFACE TETRA_VOLUME
+syn keyword idlangRoutine THIN THREED TIME_TEST2 TIMEGEN TM_TEST TOTAL TRACE
+syn keyword idlangRoutine TRANSPOSE TRI_SURF TRIANGULATE TRIGRID TRIQL
+syn keyword idlangRoutine TRIRED TRISOL TRNLOG TS_COEF TS_DIFF TS_FCAST
+syn keyword idlangRoutine TS_SMOOTH TV TVCRS TVLCT TVRD TVSCL UINDGEN UINT
+syn keyword idlangRoutine UINTARR UL64INDGEN ULINDGEN ULON64ARR ULONARR
+syn keyword idlangRoutine ULONG ULONG64 UNIQ USERSYM VALUE_LOCATE VARIANCE
+syn keyword idlangRoutine VAX_FLOAT VECTOR_FIELD VEL VELOVECT VERT_T3D VOIGT
+syn keyword idlangRoutine VORONOI VOXEL_PROJ WAIT WARP_TRI WATERSHED WDELETE
+syn keyword idlangRoutine WEOF WF_DRAW WHERE WIDGET_BASE WIDGET_BUTTON
+syn keyword idlangRoutine WIDGET_CONTROL WIDGET_DRAW WIDGET_DROPLIST
+syn keyword idlangRoutine WIDGET_EVENT WIDGET_INFO WIDGET_LABEL WIDGET_LIST
+syn keyword idlangRoutine WIDGET_SLIDER WIDGET_TABLE WIDGET_TEXT WINDOW
+syn keyword idlangRoutine WRITE_BMP WRITE_IMAGE WRITE_JPEG WRITE_NRIF
+syn keyword idlangRoutine WRITE_PICT WRITE_PNG WRITE_PPM WRITE_SPR WRITE_SRF
+syn keyword idlangRoutine WRITE_SYLK WRITE_TIFF WRITE_WAV WRITE_WAVE WRITEU
+syn keyword idlangRoutine WSET WSHOW WTN WV_APPLET WV_CW_WAVELET WV_CWT
+syn keyword idlangRoutine WV_DENOISE WV_DWT WV_FN_COIFLET WV_FN_DAUBECHIES
+syn keyword idlangRoutine WV_FN_GAUSSIAN WV_FN_HAAR WV_FN_MORLET WV_FN_PAUL
+syn keyword idlangRoutine WV_FN_SYMLET WV_IMPORT_DATA WV_IMPORT_WAVELET
+syn keyword idlangRoutine WV_PLOT3D_WPS WV_PLOT_MULTIRES WV_PWT
+syn keyword idlangRoutine WV_TOOL_DENOISE XBM_EDIT XDISPLAYFILE XDXF XFONT
+syn keyword idlangRoutine XINTERANIMATE XLOADCT XMANAGER XMNG_TMPL XMTOOL
+syn keyword idlangRoutine XOBJVIEW XPALETTE XPCOLOR XPLOT3D XREGISTERED XROI
+syn keyword idlangRoutine XSQ_TEST XSURFACE XVAREDIT XVOLUME XVOLUME_ROTATE
+syn keyword idlangRoutine XVOLUME_WRITE_IMAGE XYOUTS ZOOM ZOOM_24
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_idlang_syn_inits")
+ if version < 508
+ let did_idlang_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+else
+ command -nargs=+ HiLink hi def link <args>
+endif
+
+ HiLink idlangConditional Conditional
+ HiLink idlangRoutine Type
+ HiLink idlangStatement Statement
+ HiLink idlangContinueLine Todo
+ HiLink idlangRealNumber Float
+ HiLink idlangNumber Number
+ HiLink idlangString String
+ HiLink idlangOperator Operator
+ HiLink idlangComment Comment
+ HiLink idlangTodo Todo
+ HiLink idlangPreCondit Identifier
+ HiLink idlangDblCommaError Error
+ HiLink idlangStop Error
+ HiLink idlangStrucvar PreProc
+ HiLink idlangSystem Identifier
+ HiLink idlangKeyword Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "idlang"
+" vim: ts=18
diff --git a/runtime/syntax/indent.vim b/runtime/syntax/indent.vim
new file mode 100644
index 000000000..b9f3c7e7c
--- /dev/null
+++ b/runtime/syntax/indent.vim
@@ -0,0 +1,101 @@
+" Vim syntax file
+" Language: indent RC File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/indent/
+" Latest Revision: 2004-05-22
+" arch-tag: 23c11190-79fa-4493-9fc5-36435402a20d
+" TODO: is the deny-all (a la lilo.vim nice or no?)...
+" irritating to be wrong to the last char...
+" would be sweet if right until one char fails
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk 48-57,65-90,97-122,-,_
+delcommand SetIsk
+
+" errors
+syn match indentError "\S\+"
+
+" todo
+syn keyword indentTodo contained TODO FIXME XXX NOTE
+
+" comments
+syn region indentComment matchgroup=indentComment start="/\*" end="\*/" contains=indentTodo
+
+" keywords (command-line switches)
+syn match indentOptions "\<--\(no-\)\=blank-\(before-sizeof\|Bill-Shannon\|lines-\(after-\(commas\|declarations\|procedures\)\|before-block-comments\)\)\>"
+syn match indentOptions "\<--brace-indent\s*\d\+\>"
+syn match indentOptions "\<--braces-\(after\|on\)-\(if\|struct-decl\)-line\>"
+syn match indentOptions "\<--break-\(\(after\|before\)-boolean-operator\|function-decl-args\)\>"
+syn match indentOptions "\<--\(case\(-brace\)\=\|comment\|continuation\|declaration\|line-comments\|parameter\|paren\|struct-brace\)-indentation\s*\d\+\>"
+syn match indentOptions "\<--\(no-\)\=comment-delimiters-on-blank-lines\>"
+syn match indentOptions "\<--\(dont-\)\=cuddle-\(do-while\|else\)\>"
+syn match indentOptions "\<--\(declaration-comment\|else-endif\)-column\s*\d\+\>"
+syn match indentOptions "\<--dont-break-\(function-decl-args\|procedure-type\)\>"
+syn match indentOptions "\<--\(dont-\)\=\(format\(-first-column\)\=\|star\)-comments\>"
+syn match indentOptions "\<--\(honour\|ignore\)-newlines\>"
+syn match indentOptions "\<--\(indent-level\|\(comment-\)\=line-length\)\s*\d\+\>"
+syn match indentOptions "\<--\(leave\|remove\)-preprocessor-space\>"
+"not 100%, since casts\= should always be cast if no- isn't given
+syn match indentOptions "\<--\(no-\)\=space-after-\(parentheses\|casts\=\|for\|if\|while\)\>"
+syn match indentOptions "\<--\(dont-\)\=space-special-semicolon\>"
+syn match indentOptions "\<--\(leave\|swallow\)-optional-blank-lines\>"
+syn match indentOptions "\<--tab-size\s*\d\+\>"
+syn match indentOptions "\<--\(no\|use\)-tabs\>"
+syn keyword indentOptions --gnu-style --ignore-profile --k-and-r-style --original
+syn keyword indentOptions --preserve-mtime --no-verbosity --verbose --output-file
+syn keyword indentOptions --no-parameter-indentation --procnames-start-lines
+syn keyword indentOptions --standard-output --start-left-side-of-comments
+syn keyword indentOptions --space-after-procedure-calls
+" this also here since the gnu indent fellas aren't consistent. (ever read
+" the code to `indent'? you'll know what i mean if you have)
+syn match indentOptions "\<-\(bli\|cbi\|cd\|ci\|cli\|c\|cp\|di\|d\|i\|ip\|l\|lc\|pi\|sbi\|ts\)\s*\d\+\>"
+syn match indentOptions "\<-T\s\+\w\+\>"
+syn keyword indentOptions --format-all-comments --continue-at-parentheses --dont-line-up-parentheses
+syn keyword indentOptions --no-space-after-function-call-names
+syn keyword indentOptions -bad -bap -bbb -bbo -bc -bfda -bl -br -bs -nbs -cdb -cdw -ce -cs -dce -fc1 -fca
+syn keyword indentOptions -gnu -hnl -kr -lp -lps -nbad -nbap -nbbb -nbbo -nbc -nbfda -ncdb -ncdw -nprs
+syn keyword indentOptions -nce -ncs -nfc1 -nfca -nhnl -nip -nlp -nlps -npcs -npmt -npro -npsl -nsaf -nsai
+syn keyword indentOptions -nsaw -nsc -nsob -nss -nv -o -orig -pcs -pmt -prs -psl -saf -sai -saw -sc
+syn keyword indentOptions -sob -ss -st -v -version -bls -brs -ut -nut
+
+if exists("indent_minlines")
+ let b:indent_minlines = indent_minlines
+else
+ let b:indent_minlines = 50
+endif
+exec "syn sync minlines=" . b:indent_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_indent_syn_inits")
+ if version < 508
+ let did_indent_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink indentError Error
+ HiLink indentComment Comment
+ HiLink indentTodo Todo
+ HiLink indentOptions Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "indent"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/inform.vim b/runtime/syntax/inform.vim
new file mode 100644
index 000000000..11901639c
--- /dev/null
+++ b/runtime/syntax/inform.vim
@@ -0,0 +1,408 @@
+" Vim syntax file
+" Language: Inform
+" Maintainer: Stephen Thomas (informvim@stephenthomas.uklinux.net)
+" URL: http://www.stephenthomas.uklinux.net/informvim
+" Last Change: 2004 May 16
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful Inform keywords. First, case insensitive stuff
+
+syn case ignore
+
+syn keyword informDefine Constant
+
+syn keyword informType Array Attribute Class Nearby
+syn keyword informType Object Property String Routine
+syn match informType "\<Global\>"
+
+syn keyword informInclude Import Include Link Replace System_file
+
+syn keyword informPreCondit End Endif Ifdef Ifndef Iftrue Iffalse Ifv3 Ifv5
+syn keyword informPreCondit Ifnot
+
+syn keyword informPreProc Abbreviate Default Fake_action Lowstring
+syn keyword informPreProc Message Release Serial Statusline Stub Switches
+syn keyword informPreProc Trace Zcharacter
+
+syn region informGlobalRegion matchgroup=informType start="\<Global\>" matchgroup=NONE skip=+!.*$\|".*"\|'.*'+ end=";" contains=ALLBUT,informGramPreProc,informPredicate,informGrammar,informAsm,informAsmObsolete
+
+syn keyword informGramPreProc contained Verb Extend
+
+if !exists("inform_highlight_simple")
+ syn keyword informLibAttrib absent animate clothing concealed container
+ syn keyword informLibAttrib door edible enterable female general light
+ syn keyword informLibAttrib lockable locked male moved neuter on open
+ syn keyword informLibAttrib openable pluralname proper scenery scored
+ syn keyword informLibAttrib static supporter switchable talkable
+ syn keyword informLibAttrib visited workflag worn
+ syn match informLibAttrib "\<transparent\>"
+
+ syn keyword informLibProp e_to se_to s_to sw_to w_to nw_to n_to ne_to
+ syn keyword informLibProp u_to d_to in_to out_to before after life
+ syn keyword informLibProp door_to with_key door_dir invent plural
+ syn keyword informLibProp add_to_scope list_together react_before
+ syn keyword informLibProp react_after grammar orders initial when_open
+ syn keyword informLibProp when_closed when_on when_off description
+ syn keyword informLibProp describe article cant_go found_in time_left
+ syn keyword informLibProp number time_out daemon each_turn capacity
+ syn keyword informLibProp name short_name short_name_indef parse_name
+ syn keyword informLibProp articles inside_description
+ if !exists("inform_highlight_old")
+ syn keyword informLibProp compass_look before_implicit
+ syn keyword informLibProp ext_initialise ext_messages
+ endif
+
+ syn keyword informLibObj e_obj se_obj s_obj sw_obj w_obj nw_obj n_obj
+ syn keyword informLibObj ne_obj u_obj d_obj in_obj out_obj compass
+ syn keyword informLibObj thedark selfobj player location second actor
+ syn keyword informLibObj noun
+ if !exists("inform_highlight_old")
+ syn keyword informLibObj LibraryExtensions
+ endif
+
+ syn keyword informLibRoutine Achieved AfterRoutines AddToScope
+ syn keyword informLibRoutine AllowPushDir Banner ChangeDefault
+ syn keyword informLibRoutine ChangePlayer CommonAncestor DictionaryLookup
+ syn keyword informLibRoutine DisplayStatus DoMenu DrawStatusLine
+ syn keyword informLibRoutine EnglishNumber HasLightSource GetGNAOfObject
+ syn keyword informLibRoutine IndirectlyContains IsSeeThrough Locale
+ syn keyword informLibRoutine LoopOverScope LTI_Insert MoveFloatingObjects
+ syn keyword informLibRoutine NextWord NextWordStopped NounDomain
+ syn keyword informLibRoutine ObjectIsUntouchable OffersLight ParseToken
+ syn keyword informLibRoutine PlaceInScope PlayerTo PrintShortName
+ syn keyword informLibRoutine PronounNotice ScopeWithin SetPronoun SetTime
+ syn keyword informLibRoutine StartDaemon StartTimer StopDaemon StopTimer
+ syn keyword informLibRoutine TestScope TryNumber UnsignedCompare
+ syn keyword informLibRoutine WordAddress WordInProperty WordLength
+ syn keyword informLibRoutine WriteListFrom YesOrNo ZRegion RunRoutines
+ syn keyword informLibRoutine AfterLife AfterPrompt Amusing BeforeParsing
+ syn keyword informLibRoutine ChooseObjects DarkToDark DeathMessage
+ syn keyword informLibRoutine GamePostRoutine GamePreRoutine Initialise
+ syn keyword informLibRoutine InScope LookRoutine NewRoom ParseNoun
+ syn keyword informLibRoutine ParseNumber ParserError PrintRank PrintVerb
+ syn keyword informLibRoutine PrintTaskName TimePasses UnknownVerb
+ if exists("inform_highlight_glulx")
+ syn keyword informLibRoutine IdentifyGlkObject HandleGlkEvent
+ syn keyword informLibRoutine InitGlkWindow
+ endif
+ if !exists("inform_highlight_old")
+ syn keyword informLibRoutine KeyCharPrimitive KeyDelay ClearScreen
+ syn keyword informLibRoutine MoveCursor MainWindow StatusLineHeight
+ syn keyword informLibRoutine ScreenWidth ScreenHeight SetColour
+ syn keyword informLibRoutine DecimalNumber PrintToBuffer Length
+ syn keyword informLibRoutine UpperCase LowerCase PrintCapitalised
+ syn keyword informLibRoutine Cap Centre
+ if exists("inform_highlight_glulx")
+ syn keyword informLibRoutine PrintAnything PrintAnyToArray
+ endif
+ endif
+
+ syn keyword informLibAction Quit Restart Restore Verify Save
+ syn keyword informLibAction ScriptOn ScriptOff Pronouns Score
+ syn keyword informLibAction Fullscore LMode1 LMode2 LMode3
+ syn keyword informLibAction NotifyOn NotifyOff Version Places
+ syn keyword informLibAction Objects TraceOn TraceOff TraceLevel
+ syn keyword informLibAction ActionsOn ActionsOff RoutinesOn
+ syn keyword informLibAction RoutinesOff TimersOn TimersOff
+ syn keyword informLibAction CommandsOn CommandsOff CommandsRead
+ syn keyword informLibAction Predictable XPurloin XAbstract XTree
+ syn keyword informLibAction Scope Goto Gonear Inv InvTall InvWide
+ syn keyword informLibAction Take Drop Remove PutOn Insert Transfer
+ syn keyword informLibAction Empty Enter Exit GetOff Go Goin Look
+ syn keyword informLibAction Examine Search Give Show Unlock Lock
+ syn keyword informLibAction SwitchOn SwitchOff Open Close Disrobe
+ syn keyword informLibAction Wear Eat Yes No Burn Pray Wake
+ syn keyword informLibAction WakeOther Consult Kiss Think Smell
+ syn keyword informLibAction Listen Taste Touch Dig Cut Jump
+ syn keyword informLibAction JumpOver Tie Drink Fill Sorry Strong
+ syn keyword informLibAction Mild Attack Swim Swing Blow Rub Set
+ syn keyword informLibAction SetTo WaveHands Wave Pull Push PushDir
+ syn keyword informLibAction Turn Squeeze LookUnder ThrowAt Tell
+ syn keyword informLibAction Answer Buy Ask AskFor Sing Climb Wait
+ syn keyword informLibAction Sleep LetGo Receive ThrownAt Order
+ syn keyword informLibAction TheSame PluralFound Miscellany Prompt
+ syn keyword informLibAction ChangesOn ChangesOff Showverb Showobj
+ syn keyword informLibAction EmptyT VagueGo
+ if exists("inform_highlight_glulx")
+ syn keyword informLibAction GlkList
+ endif
+
+ syn keyword informLibVariable keep_silent deadflag action special_number
+ syn keyword informLibVariable consult_from consult_words etype verb_num
+ syn keyword informLibVariable verb_word the_time real_location c_style
+ syn keyword informLibVariable parser_one parser_two listing_together wn
+ syn keyword informLibVariable parser_action scope_stage scope_reason
+ syn keyword informLibVariable action_to_be menu_item item_name item_width
+ syn keyword informLibVariable lm_o lm_n inventory_style task_scores
+ syn keyword informLibVariable inventory_stage
+
+ syn keyword informLibConst AMUSING_PROVIDED DEBUG Headline MAX_CARRIED
+ syn keyword informLibConst MAX_SCORE MAX_TIMERS NO_PLACES NUMBER_TASKS
+ syn keyword informLibConst OBJECT_SCORE ROOM_SCORE SACK_OBJECT Story
+ syn keyword informLibConst TASKS_PROVIDED WITHOUT_DIRECTIONS
+ syn keyword informLibConst NEWLINE_BIT INDENT_BIT FULLINV_BIT ENGLISH_BIT
+ syn keyword informLibConst RECURSE_BIT ALWAYS_BIT TERSE_BIT PARTINV_BIT
+ syn keyword informLibConst DEFART_BIT WORKFLAG_BIT ISARE_BIT CONCEAL_BIT
+ syn keyword informLibConst PARSING_REASON TALKING_REASON EACHTURN_REASON
+ syn keyword informLibConst REACT_BEFORE_REASON REACT_AFTER_REASON
+ syn keyword informLibConst TESTSCOPE_REASON LOOPOVERSCOPE_REASON
+ syn keyword informLibConst STUCK_PE UPTO_PE NUMBER_PE CANTSEE_PE TOOLIT_PE
+ syn keyword informLibConst NOTHELD_PE MULTI_PE MMULTI_PE VAGUE_PE EXCEPT_PE
+ syn keyword informLibConst ANIMA_PE VERB_PE SCENERY_PE ITGONE_PE
+ syn keyword informLibConst JUNKAFTER_PE TOOFEW_PE NOTHING_PE ASKSCOPE_PE
+ if !exists("inform_highlight_old")
+ syn keyword informLibConst WORDSIZE TARGET_ZCODE TARGET_GLULX
+ syn keyword informLibConst LIBRARY_PARSER LIBRARY_VERBLIB LIBRARY_GRAMMAR
+ syn keyword informLibConst LIBRARY_ENGLISH NO_SCORE START_MOVE
+ syn keyword informLibConst CLR_DEFAULT CLR_BLACK CLR_RED CLR_GREEN
+ syn keyword informLibConst CLR_YELLOW CLR_BLUE CLR_MAGENTA CLR_CYAN
+ syn keyword informLibConst CLR_WHITE CLR_PURPLE CLR_AZURE
+ syn keyword informLibConst WIN_ALL WIN_MAIN WIN_STATUS
+ endif
+endif
+
+" Now the case sensitive stuff.
+
+syntax case match
+
+syn keyword informSysFunc child children elder indirect parent random
+syn keyword informSysFunc sibling younger youngest metaclass
+if exists("inform_highlight_glulx")
+ syn keyword informSysFunc glk
+endif
+
+syn keyword informSysConst adjectives_table actions_table classes_table
+syn keyword informSysConst identifiers_table preactions_table version_number
+syn keyword informSysConst largest_object strings_offset code_offset
+syn keyword informSysConst dict_par1 dict_par2 dict_par3
+syn keyword informSysConst actual_largest_object static_memory_offset
+syn keyword informSysConst array_names_offset readable_memory_offset
+syn keyword informSysConst cpv__start cpv__end ipv__start ipv__end
+syn keyword informSysConst array__start array__end lowest_attribute_number
+syn keyword informSysConst highest_attribute_number attribute_names_array
+syn keyword informSysConst lowest_property_number highest_property_number
+syn keyword informSysConst property_names_array lowest_action_number
+syn keyword informSysConst highest_action_number action_names_array
+syn keyword informSysConst lowest_fake_action_number highest_fake_action_number
+syn keyword informSysConst fake_action_names_array lowest_routine_number
+syn keyword informSysConst highest_routine_number routines_array
+syn keyword informSysConst routine_names_array routine_flags_array
+syn keyword informSysConst lowest_global_number highest_global_number globals_array
+syn keyword informSysConst global_names_array global_flags_array
+syn keyword informSysConst lowest_array_number highest_array_number arrays_array
+syn keyword informSysConst array_names_array array_flags_array lowest_constant_number
+syn keyword informSysConst highest_constant_number constants_array constant_names_array
+syn keyword informSysConst lowest_class_number highest_class_number class_objects_array
+syn keyword informSysConst lowest_object_number highest_object_number
+if !exists("inform_highlight_old")
+ syn keyword informSysConst sys_statusline_flag
+endif
+
+syn keyword informConditional default else if switch
+
+syn keyword informRepeat break continue do for objectloop until while
+
+syn keyword informStatement box font give inversion jump move new_line
+syn keyword informStatement print print_ret quit read remove restore return
+syn keyword informStatement rfalse rtrue save spaces string style
+
+syn keyword informOperator roman reverse bold underline fixed on off to
+syn keyword informOperator near from
+
+syn keyword informKeyword dictionary symbols objects verbs assembly
+syn keyword informKeyword expressions lines tokens linker on off alias long
+syn keyword informKeyword additive score time string table
+syn keyword informKeyword with private has class error fatalerror
+syn keyword informKeyword warning self
+if !exists("inform_highlight_old")
+ syn keyword informKeyword buffer
+endif
+
+syn keyword informMetaAttrib remaining create destroy recreate copy call
+syn keyword informMetaAttrib print_to_array
+
+syn keyword informPredicate has hasnt in notin ofclass or
+syn keyword informPredicate provides
+
+syn keyword informGrammar contained noun held multi multiheld multiexcept
+syn keyword informGrammar contained multiinside creature special number
+syn keyword informGrammar contained scope topic reverse meta only replace
+syn keyword informGrammar contained first last
+
+syn keyword informKeywordObsolete contained initial data initstr
+
+syn keyword informTodo contained TODO
+
+" Assembly language mnemonics must be preceded by a '@'.
+
+syn match informAsmContainer "@\s*\k*" contains=informAsm,informAsmObsolete
+
+if exists("inform_highlight_glulx")
+ syn keyword informAsm contained nop add sub mul div mod neg bitand bitor
+ syn keyword informAsm contained bitxor bitnot shiftl sshiftr ushiftr jump jz
+ syn keyword informAsm contained jnz jeq jne jlt jge jgt jle jltu jgeu jgtu
+ syn keyword informAsm contained jleu call return catch throw tailcall copy
+ syn keyword informAsm contained copys copyb sexs sexb aload aloads aloadb
+ syn keyword informAsm contained aloadbit astore astores astoreb astorebit
+ syn keyword informAsm contained stkcount stkpeek stkswap stkroll stkcopy
+ syn keyword informAsm contained streamchar streamnum streamstr gestalt
+ syn keyword informAsm contained debugtrap getmemsize setmemsize jumpabs
+ syn keyword informAsm contained random setrandom quit verify restart save
+ syn keyword informAsm contained restore saveundo restoreundo protect glk
+ syn keyword informAsm contained getstringtbl setstringtbl getiosys setiosys
+ syn keyword informAsm contained linearsearch binarysearch linkedsearch
+ syn keyword informAsm contained callf callfi callfii callfiii
+else
+ syn keyword informAsm contained je jl jg dec_chk inc_chk jin test or and
+ syn keyword informAsm contained test_attr set_attr clear_attr store
+ syn keyword informAsm contained insert_obj loadw loadb get_prop
+ syn keyword informAsm contained get_prop_addr get_next_prop add sub mul div
+ syn keyword informAsm contained mod call storew storeb put_prop sread
+ syn keyword informAsm contained print_num random push pull
+ syn keyword informAsm contained split_window set_window output_stream
+ syn keyword informAsm contained input_stream sound_effect jz get_sibling
+ syn keyword informAsm contained get_child get_parent get_prop_len inc dec
+ syn keyword informAsm contained remove_obj print_obj ret jump
+ syn keyword informAsm contained load not rtrue rfalse print
+ syn keyword informAsm contained print_ret nop save restore restart
+ syn keyword informAsm contained ret_popped pop quit new_line show_status
+ syn keyword informAsm contained verify call_2s call_vs aread call_vs2
+ syn keyword informAsm contained erase_window erase_line set_cursor get_cursor
+ syn keyword informAsm contained set_text_style buffer_mode read_char
+ syn keyword informAsm contained scan_table call_1s call_2n set_colour throw
+ syn keyword informAsm contained call_vn call_vn2 tokenise encode_text
+ syn keyword informAsm contained copy_table print_table check_arg_count
+ syn keyword informAsm contained call_1n catch piracy log_shift art_shift
+ syn keyword informAsm contained set_font save_undo restore_undo draw_picture
+ syn keyword informAsm contained picture_data erase_picture set_margins
+ syn keyword informAsm contained move_window window_size window_style
+ syn keyword informAsm contained get_wind_prop scroll_window pop_stack
+ syn keyword informAsm contained read_mouse mouse_window push_stack
+ syn keyword informAsm contained put_wind_prop print_form make_menu
+ syn keyword informAsm contained picture_table
+ if !exists("inform_highlight_old")
+ syn keyword informAsm contained check_unicode print_unicode
+ endif
+ syn keyword informAsmObsolete contained print_paddr print_addr print_char
+endif
+
+" Handling for different versions of VIM.
+
+if version >= 600
+ setlocal iskeyword+=$
+ command -nargs=+ SynDisplay syntax <args> display
+else
+ set iskeyword+=$
+ command -nargs=+ SynDisplay syntax <args>
+endif
+
+" Grammar sections.
+
+syn region informGrammarSection matchgroup=informGramPreProc start="\<Verb\|Extend\>" skip=+".*"+ end=";"he=e-1 contains=ALLBUT,informAsm
+
+" Special character forms.
+
+SynDisplay match informBadAccent contained "@[^{[:digit:]]\D"
+SynDisplay match informBadAccent contained "@{[^}]*}"
+SynDisplay match informAccent contained "@:[aouAOUeiyEI]"
+SynDisplay match informAccent contained "@'[aeiouyAEIOUY]"
+SynDisplay match informAccent contained "@`[aeiouAEIOU]"
+SynDisplay match informAccent contained "@\^[aeiouAEIOU]"
+SynDisplay match informAccent contained "@\~[anoANO]"
+SynDisplay match informAccent contained "@/[oO]"
+SynDisplay match informAccent contained "@ss\|@<<\|@>>\|@oa\|@oA\|@ae\|@AE\|@cc\|@cC"
+SynDisplay match informAccent contained "@th\|@et\|@Th\|@Et\|@LL\|@oe\|@OE\|@!!\|@??"
+SynDisplay match informAccent contained "@{\x\{1,4}}"
+SynDisplay match informBadStrUnicode contained "@@\D"
+SynDisplay match informStringUnicode contained "@@\d\+"
+SynDisplay match informStringCode contained "@\d\d"
+
+" String and Character constants. Ordering is important here.
+syn region informString start=+"+ skip=+\\\\+ end=+"+ contains=informAccent,informStringUnicode,informStringCode,informBadAccent,informBadStrUnicode
+syn region informDictString start="'" end="'" contains=informAccent,informBadAccent
+SynDisplay match informBadDictString "''"
+SynDisplay match informDictString "'''"
+
+" Integer numbers: decimal, hexadecimal and binary.
+SynDisplay match informNumber "\<\d\+\>"
+SynDisplay match informNumber "\<\$\x\+\>"
+SynDisplay match informNumber "\<\$\$[01]\+\>"
+
+" Comments
+syn match informComment "!.*" contains=informTodo
+
+" Syncronization
+syn sync match informSyncStringEnd grouphere NONE /"[;,]\s*$/
+syn sync match informSyncRoutineEnd grouphere NONE /][;,]\s*$/
+syn sync match informSyncCommentEnd grouphere NONE /^\s*!.*$/
+syn sync match informSyncRoutine groupthere informGrammarSection "\<Verb\|Extend\>"
+syn sync maxlines=500
+
+delcommand SynDisplay
+
+" The default highlighting.
+if version >= 508 || !exists("did_inform_syn_inits")
+ if version < 508
+ let did_inform_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink informDefine Define
+ HiLink informType Type
+ HiLink informInclude Include
+ HiLink informPreCondit PreCondit
+ HiLink informPreProc PreProc
+ HiLink informGramPreProc PreProc
+ HiLink informAsm Special
+ if !exists("inform_suppress_obsolete")
+ HiLink informAsmObsolete informError
+ HiLink informKeywordObsolete informError
+ else
+ HiLink informAsmObsolete Special
+ HiLink informKeywordObsolete Keyword
+ endif
+ HiLink informPredicate Operator
+ HiLink informSysFunc Identifier
+ HiLink informSysConst Identifier
+ HiLink informConditional Conditional
+ HiLink informRepeat Repeat
+ HiLink informStatement Statement
+ HiLink informOperator Operator
+ HiLink informKeyword Keyword
+ HiLink informGrammar Keyword
+ HiLink informDictString String
+ HiLink informNumber Number
+ HiLink informError Error
+ HiLink informString String
+ HiLink informComment Comment
+ HiLink informAccent Special
+ HiLink informStringUnicode Special
+ HiLink informStringCode Special
+ HiLink informTodo Todo
+ if !exists("inform_highlight_simple")
+ HiLink informLibAttrib Identifier
+ HiLink informLibProp Identifier
+ HiLink informLibObj Identifier
+ HiLink informLibRoutine Identifier
+ HiLink informLibVariable Identifier
+ HiLink informLibConst Identifier
+ HiLink informLibAction Identifier
+ endif
+ HiLink informBadDictString informError
+ HiLink informBadAccent informError
+ HiLink informBadStrUnicode informError
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "inform"
+
+" vim: ts=8
diff --git a/runtime/syntax/inittab.vim b/runtime/syntax/inittab.vim
new file mode 100644
index 000000000..b7472f9e0
--- /dev/null
+++ b/runtime/syntax/inittab.vim
@@ -0,0 +1,75 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: SysV-compatible init process control file `inittab'
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-09-13
+" URL: http://physics.muni.cz/~yeti/download/syntax/inittab.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+syn case match
+
+" Base constructs
+syn match inittabError "[^:]\+:"me=e-1 contained
+syn match inittabError "[^:]\+$" contained
+syn match inittabComment "^[#:].*$" contains=inittabFixme
+syn match inittabComment "#.*$" contained contains=inittabFixme
+syn keyword inittabFixme FIXME TODO XXX NOT
+
+" Shell
+syn region inittabShString start=+"+ end=+"+ skip=+\\\\\|\\\"+ contained
+syn region inittabShString start=+'+ end=+'+ contained
+syn match inittabShOption "\s[-+][[:alnum:]]\+"ms=s+1 contained
+syn match inittabShOption "\s--[:alnum:][-[:alnum:]]*"ms=s+1 contained
+syn match inittabShCommand "/\S\+" contained
+syn cluster inittabSh add=inittabShOption,inittabShString,inittabShCommand
+
+" Keywords
+syn keyword inittabActionName respawn wait once boot bootwait off ondemand sysinit powerwait powerfail powerokwait powerfailnow ctrlaltdel kbrequest initdefault contained
+
+" Line parser
+syn match inittabId "^[[:alnum:]~]\{1,4}" nextgroup=inittabColonRunLevels,inittabError
+syn match inittabColonRunLevels ":" contained nextgroup=inittabRunLevels,inittabColonAction,inittabError
+syn match inittabRunLevels "[0-6A-Ca-cSs]\+" contained nextgroup=inittabColonAction,inittabError
+syn match inittabColonAction ":" contained nextgroup=inittabAction,inittabError
+syn match inittabAction "\w\+" contained nextgroup=inittabColonProcess,inittabError contains=inittabActionName
+syn match inittabColonProcess ":" contained nextgroup=inittabProcessPlus,inittabProcess,inittabError
+syn match inittabProcessPlus "+" contained nextgroup=inittabProcess,inittabError
+syn region inittabProcess start="/" end="$" transparent oneline contained contains=@inittabSh,inittabComment
+
+" Define the default highlighting
+if version >= 508 || !exists("did_inittab_syntax_inits")
+ if version < 508
+ let did_inittab_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink inittabComment Comment
+ HiLink inittabFixme Todo
+ HiLink inittabActionName Type
+ HiLink inittabError Error
+ HiLink inittabId Identifier
+ HiLink inittabRunLevels Special
+
+ HiLink inittabColonProcess inittabColon
+ HiLink inittabColonAction inittabColon
+ HiLink inittabColonRunLevels inittabColon
+ HiLink inittabColon PreProc
+
+ HiLink inittabShString String
+ HiLink inittabShOption Special
+ HiLink inittabShCommand Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "inittab"
diff --git a/runtime/syntax/ipfilter.vim b/runtime/syntax/ipfilter.vim
new file mode 100644
index 000000000..e1e6fc412
--- /dev/null
+++ b/runtime/syntax/ipfilter.vim
@@ -0,0 +1,43 @@
+" ipfilter syntax file
+" Language: ipfilter configuration file
+" Maintainer: Hendrik Scholz <hendrik@scholz.net>
+" Last Change: 2003 May 11
+"
+" http://raisdorf.net/files/misc/ipfilter.vim
+"
+" This will also work for OpenBSD pf but there might be some tags that are
+" not correctly identified.
+" Please send comments to hendrik@scholz.net
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" comments
+syn match ipfComment /#/
+"syn match ipfComment /#.*/
+
+syn keyword ipfQuick quick log dup-to
+syn keyword ipfAny all any
+" rule Action type
+syn region ipfActionBlock start=/^block/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionPass start=/^pass/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionMisc start=/^log/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionMisc start=/^count/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionMisc start=/^skip/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionMisc start=/^auth/ end=/$/ contains=ipfQuick,ipfAny
+syn region ipfActionMisc start=/^call/ end=/$/ contains=ipfQuick,ipfAny
+
+hi def link ipfComment Comment
+hi def link ipfActionBlock String
+hi def link ipfActionPass Type
+hi def link ipfActionMisc Label
+"hi def link ipfQuick Error
+hi def link ipfQuick Special
+hi def link ipfAny Todo
+
+
diff --git a/runtime/syntax/ishd.vim b/runtime/syntax/ishd.vim
new file mode 100644
index 000000000..1c011f1b9
--- /dev/null
+++ b/runtime/syntax/ishd.vim
@@ -0,0 +1,422 @@
+" Vim syntax file
+" Language: InstallShield Script
+" Maintainer: Robert M. Cortopassi <cortopar@mindspring.com>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword ishdStatement abort begin case default downto else end
+syn keyword ishdStatement endif endfor endwhile endswitch endprogram exit elseif
+syn keyword ishdStatement error for function goto if
+syn keyword ishdStatement program prototype return repeat string step switch
+syn keyword ishdStatement struct then to typedef until while
+
+syn keyword ishdType BOOL BYREF CHAR GDI HWND INT KERNEL LIST LONG
+syn keyword ishdType NUMBER POINTER SHORT STRING USER
+
+syn keyword ishdConstant _MAX_LENGTH _MAX_STRING
+syn keyword ishdConstant AFTER ALLCONTENTS ALLCONTROLS APPEND ASKDESTPATH
+syn keyword ishdConstant ASKOPTIONS ASKPATH ASKTEXT BATCH_INSTALL BACK
+syn keyword ishdConstant BACKBUTTON BACKGROUND BACKGROUNDCAPTION BADPATH
+syn keyword ishdConstant BADTAGFILE BASEMEMORY BEFORE BILLBOARD BINARY
+syn keyword ishdConstant BITMAP256COLORS BITMAPFADE BITMAPICON BK_BLUE BK_GREEN
+syn keyword ishdConstant BK_MAGENTA BK_MAGENTA1 BK_ORANGE BK_PINK BK_RED
+syn keyword ishdConstant BK_SMOOTH BK_SOLIDBLACK BK_SOLIDBLUE BK_SOLIDGREEN
+syn keyword ishdConstant BK_SOLIDMAGENTA BK_SOLIDORANGE BK_SOLIDPINK BK_SOLIDRED
+syn keyword ishdConstant BK_SOLIDWHITE BK_SOLIDYELLOW BK_YELLOW BLACK BLUE
+syn keyword ishdConstant BOOTUPDRIVE BUTTON_CHECKED BUTTON_ENTER BUTTON_UNCHECKED
+syn keyword ishdConstant BUTTON_UNKNOWN CMDLINE COMMONFILES CANCEL CANCELBUTTON
+syn keyword ishdConstant CC_ERR_FILEFORMATERROR CC_ERR_FILEREADERROR
+syn keyword ishdConstant CC_ERR_NOCOMPONENTLIST CC_ERR_OUTOFMEMORY CDROM
+syn keyword ishdConstant CDROM_DRIVE CENTERED CHANGEDIR CHECKBOX CHECKBOX95
+syn keyword ishdConstant CHECKLINE CHECKMARK CMD_CLOSE CMD_MAXIMIZE CMD_MINIMIZE
+syn keyword ishdConstant CMD_PUSHDOWN CMD_RESTORE COLORMODE256 COLORS
+syn keyword ishdConstant COMBOBOX_ENTER COMBOBOX_SELECT COMMAND COMMANDEX
+syn keyword ishdConstant COMMON COMP_DONE COMP_ERR_CREATEDIR
+syn keyword ishdConstant COMP_ERR_DESTCONFLICT COMP_ERR_FILENOTINLIB
+syn keyword ishdConstant COMP_ERR_FILESIZE COMP_ERR_FILETOOLARGE
+syn keyword ishdConstant COMP_ERR_HEADER COMP_ERR_INCOMPATIBLE
+syn keyword ishdConstant COMP_ERR_INTPUTNOTCOMPRESSED COMP_ERR_INVALIDLIST
+syn keyword ishdConstant COMP_ERR_LAUNCHSERVER COMP_ERR_MEMORY
+syn keyword ishdConstant COMP_ERR_NODISKSPACE COMP_ERR_OPENINPUT
+syn keyword ishdConstant COMP_ERR_OPENOUTPUT COMP_ERR_OPTIONS
+syn keyword ishdConstant COMP_ERR_OUTPUTNOTCOMPRESSED COMP_ERR_SPLIT
+syn keyword ishdConstant COMP_ERR_TARGET COMP_ERR_TARGETREADONLY COMP_ERR_WRITE
+syn keyword ishdConstant COMP_INFO_ATTRIBUTE COMP_INFO_COMPSIZE COMP_INFO_DATE
+syn keyword ishdConstant COMP_INFO_INVALIDATEPASSWORD COMP_INFO_ORIGSIZE
+syn keyword ishdConstant COMP_INFO_SETPASSWORD COMP_INFO_TIME
+syn keyword ishdConstant COMP_INFO_VERSIONLS COMP_INFO_VERSIONMS COMP_NORMAL
+syn keyword ishdConstant COMP_UPDATE_DATE COMP_UPDATE_DATE_NEWER
+syn keyword ishdConstant COMP_UPDATE_SAME COMP_UPDATE_VERSION COMPACT
+syn keyword ishdConstant COMPARE_DATE COMPARE_SIZE COMPARE_VERSION
+syn keyword ishdConstant COMPONENT_FIELD_CDROM_FOLDER
+syn keyword ishdConstant COMPONENT_FIELD_DESCRIPTION COMPONENT_FIELD_DESTINATION
+syn keyword ishdConstant COMPONENT_FIELD_DISPLAYNAME COMPONENT_FIELD_FILENEED
+syn keyword ishdConstant COMPONENT_FIELD_FTPLOCATION
+syn keyword ishdConstant COMPONENT_FIELD_HTTPLOCATION COMPONENT_FIELD_MISC
+syn keyword ishdConstant COMPONENT_FIELD_OVERWRITE COMPONENT_FIELD_PASSWORD
+syn keyword ishdConstant COMPONENT_FIELD_SELECTED COMPONENT_FIELD_SIZE
+syn keyword ishdConstant COMPONENT_FIELD_STATUS COMPONENT_FIELD_VISIBLE
+syn keyword ishdConstant COMPONENT_FILEINFO_COMPRESSED
+syn keyword ishdConstant COMPONENT_FILEINFO_COMPRESSENGINE
+syn keyword ishdConstant COMPONENT_FILEINFO_LANGUAGECOMPONENT_FILEINFO_OS
+syn keyword ishdConstant COMPONENT_FILEINFO_POTENTIALLYLOCKED
+syn keyword ishdConstant COMPONENT_FILEINFO_SELFREGISTERING
+syn keyword ishdConstant COMPONENT_FILEINFO_SHARED COMPONENT_INFO_ATTRIBUTE
+syn keyword ishdConstant COMPONENT_INFO_COMPSIZE COMPONENT_INFO_DATE
+syn keyword ishdConstant COMPONENT_INFO_DATE_EX_EX COMPONENT_INFO_LANGUAGE
+syn keyword ishdConstant COMPONENT_INFO_ORIGSIZE COMPONENT_INFO_OS
+syn keyword ishdConstant COMPONENT_INFO_TIME COMPONENT_INFO_VERSIONLS
+syn keyword ishdConstant COMPONENT_INFO_VERSIONMS COMPONENT_INFO_VERSIONSTR
+syn keyword ishdConstant COMPONENT_VALUE_ALWAYSOVERWRITE
+syn keyword ishdConstant COMPONENT_VALUE_CRITICAL
+syn keyword ishdConstant COMPONENT_VALUE_HIGHLYRECOMMENDED
+syn keyword ishdConstant COMPONENT_FILEINFO_LANGUAGE COMPONENT_FILEINFO_OS
+syn keyword ishdConstant COMPONENT_VALUE_NEVEROVERWRITE
+syn keyword ishdConstant COMPONENT_VALUE_NEWERDATE COMPONENT_VALUE_NEWERVERSION
+syn keyword ishdConstant COMPONENT_VALUE_OLDERDATE COMPONENT_VALUE_OLDERVERSION
+syn keyword ishdConstant COMPONENT_VALUE_SAMEORNEWDATE
+syn keyword ishdConstant COMPONENT_VALUE_SAMEORNEWERVERSION
+syn keyword ishdConstant COMPONENT_VALUE_STANDARD COMPONENT_VIEW_CHANGE
+syn keyword ishdConstant COMPONENT_INFO_DATE_EX COMPONENT_VIEW_CHILDVIEW
+syn keyword ishdConstant COMPONENT_VIEW_COMPONENT COMPONENT_VIEW_DESCRIPTION
+syn keyword ishdConstant COMPONENT_VIEW_MEDIA COMPONENT_VIEW_PARENTVIEW
+syn keyword ishdConstant COMPONENT_VIEW_SIZEAVAIL COMPONENT_VIEW_SIZETOTAL
+syn keyword ishdConstant COMPONENT_VIEW_TARGETLOCATION COMPRESSHIGH COMPRESSLOW
+syn keyword ishdConstant COMPRESSMED COMPRESSNONE CONTIGUOUS CONTINUE
+syn keyword ishdConstant COPY_ERR_CREATEDIR COPY_ERR_NODISKSPACE
+syn keyword ishdConstant COPY_ERR_OPENINPUT COPY_ERR_OPENOUTPUT
+syn keyword ishdConstant COPY_ERR_TARGETREADONLY COPY_ERR_MEMORY
+syn keyword ishdConstant CORECOMPONENTHANDLING CPU CUSTOM DATA_COMPONENT
+syn keyword ishdConstant DATA_LIST DATA_NUMBER DATA_STRING DATE DEFAULT
+syn keyword ishdConstant DEFWINDOWMODE DELETE_EOF DIALOG DIALOGCACHE
+syn keyword ishdConstant DIALOGTHINFONT DIR_WRITEABLE DIRECTORY DISABLE DISK
+syn keyword ishdConstant DISK_FREESPACE DISK_TOTALSPACE DISKID DLG_ASK_OPTIONS
+syn keyword ishdConstant DLG_ASK_PATH DLG_ASK_TEXT DLG_ASK_YESNO DLG_CANCEL
+syn keyword ishdConstant DLG_CDIR DLG_CDIR_MSG DLG_CENTERED DLG_CLOSE
+syn keyword ishdConstant DLG_DIR_DIRECTORY DLG_DIR_FILE DLG_ENTER_DISK DLG_ERR
+syn keyword ishdConstant DLG_ERR_ALREADY_EXISTS DLG_ERR_ENDDLG DLG_INFO_ALTIMAGE
+syn keyword ishdConstant DLG_INFO_CHECKMETHOD DLG_INFO_CHECKSELECTION
+syn keyword ishdConstant DLG_INFO_ENABLEIMAGE DLG_INFO_KUNITS
+syn keyword ishdConstant DLG_INFO_USEDECIMAL DLG_INIT DLG_MSG_ALL
+syn keyword ishdConstant DLG_MSG_INFORMATION DLG_MSG_NOT_HAND DLG_MSG_SEVERE
+syn keyword ishdConstant DLG_MSG_STANDARD DLG_MSG_WARNING DLG_OK DLG_STATUS
+syn keyword ishdConstant DLG_USER_CAPTION DRIVE DRIVEOPEN DLG_DIR_DRIVE
+syn keyword ishdConstant EDITBOX_CHANGE EFF_BOXSTRIPE EFF_FADE EFF_HORZREVEAL
+syn keyword ishdConstant EFF_HORZSTRIPE EFF_NONE EFF_REVEAL EFF_VERTSTRIPE
+syn keyword ishdConstant ENABLE END_OF_FILE END_OF_LIST ENHANCED ENTERDISK
+syn keyword ishdConstant ENTERDISK_ERRMSG ENTERDISKBEEP ENVSPACE EQUALS
+syn keyword ishdConstant ERR_BADPATH ERR_BADTAGFILE ERR_BOX_BADPATH
+syn keyword ishdConstant ERR_BOX_BADTAGFILE ERR_BOX_DISKID ERR_BOX_DRIVEOPEN
+syn keyword ishdConstant ERR_BOX_EXIT ERR_BOX_HELP ERR_BOX_NOSPACE ERR_BOX_PAUSE
+syn keyword ishdConstant ERR_BOX_READONLY ERR_DISKID ERR_DRIVEOPEN
+syn keyword ishdConstant EXCLUDE_SUBDIR EXCLUSIVE EXISTS EXIT EXTENDEDMEMORY
+syn keyword ishdConstant EXTENSION_ONLY ERRORFILENAME FADE_IN FADE_OUT
+syn keyword ishdConstant FAILIFEXISTS FALSE FDRIVE_NUM FEEDBACK FEEDBACK_FULL
+syn keyword ishdConstant FEEDBACK_OPERATION FEEDBACK_SPACE FILE_ATTR_ARCHIVED
+syn keyword ishdConstant FILE_ATTR_DIRECTORY FILE_ATTR_HIDDEN FILE_ATTR_NORMAL
+syn keyword ishdConstant FILE_ATTR_READONLY FILE_ATTR_SYSTEM FILE_ATTRIBUTE
+syn keyword ishdConstant FILE_BIN_CUR FILE_BIN_END FILE_BIN_START FILE_DATE
+syn keyword ishdConstant FILE_EXISTS FILE_INSTALLED FILE_INVALID FILE_IS_LOCKED
+syn keyword ishdConstant FILE_LINE_LENGTH FILE_LOCKED FILE_MODE_APPEND
+syn keyword ishdConstant FILE_MODE_BINARY FILE_MODE_BINARYREADONLY
+syn keyword ishdConstant FILE_MODE_NORMAL FILE_NO_VERSION FILE_NOT_FOUND
+syn keyword ishdConstant FILE_RD_ONLY FILE_SIZE FILE_SRC_EQUAL FILE_SRC_OLD
+syn keyword ishdConstant FILE_TIME FILE_WRITEABLE FILENAME FILENAME_ONLY
+syn keyword ishdConstant FINISHBUTTON FIXED_DRIVE FONT_TITLE FREEENVSPACE
+syn keyword ishdConstant FS_CREATEDIR FS_DISKONEREQUIRED FS_DONE FS_FILENOTINLIB
+syn keyword ishdConstant FS_GENERROR FS_INCORRECTDISK FS_LAUNCHPROCESS
+syn keyword ishdConstant FS_OPERROR FS_OUTOFSPACE FS_PACKAGING FS_RESETREQUIRED
+syn keyword ishdConstant FS_TARGETREADONLY FS_TONEXTDISK FULL FULLSCREEN
+syn keyword ishdConstant FULLSCREENSIZE FULLWINDOWMODE FOLDER_DESKTOP
+syn keyword ishdConstant FOLDER_PROGRAMS FOLDER_STARTMENU FOLDER_STARTUP
+syn keyword ishdConstant GREATER_THAN GREEN HELP HKEY_CLASSES_ROOT
+syn keyword ishdConstant HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_DYN_DATA
+syn keyword ishdConstant HKEY_LOCAL_MACHINE HKEY_PERFORMANCE_DATA HKEY_USERS
+syn keyword ishdConstant HOURGLASS HWND_DESKTOP HWND_INSTALL IGNORE_READONLY
+syn keyword ishdConstant INCLUDE_SUBDIR INDVFILESTATUS INFO INFO_DESCRIPTION
+syn keyword ishdConstant INFO_IMAGE INFO_MISC INFO_SIZE INFO_SUBCOMPONENT
+syn keyword ishdConstant INFO_VISIBLE INFORMATION INVALID_LIST IS_186 IS_286
+syn keyword ishdConstant IS_386 IS_486 IS_8514A IS_86 IS_ALPHA IS_CDROM IS_CGA
+syn keyword ishdConstant IS_DOS IS_EGA IS_FIXED IS_FOLDER IS_ITEM ISLANG_ALL
+syn keyword ishdConstant ISLANG_ARABIC ISLANG_ARABIC_SAUDIARABIA
+syn keyword ishdConstant ISLANG_ARABIC_IRAQ ISLANG_ARABIC_EGYPT
+syn keyword ishdConstant ISLANG_ARABIC_LIBYA ISLANG_ARABIC_ALGERIA
+syn keyword ishdConstant ISLANG_ARABIC_MOROCCO ISLANG_ARABIC_TUNISIA
+syn keyword ishdConstant ISLANG_ARABIC_OMAN ISLANG_ARABIC_YEMEN
+syn keyword ishdConstant ISLANG_ARABIC_SYRIA ISLANG_ARABIC_JORDAN
+syn keyword ishdConstant ISLANG_ARABIC_LEBANON ISLANG_ARABIC_KUWAIT
+syn keyword ishdConstant ISLANG_ARABIC_UAE ISLANG_ARABIC_BAHRAIN
+syn keyword ishdConstant ISLANG_ARABIC_QATAR ISLANG_AFRIKAANS
+syn keyword ishdConstant ISLANG_AFRIKAANS_STANDARD ISLANG_ALBANIAN
+syn keyword ishdConstant ISLANG_ENGLISH_TRINIDAD ISLANG_ALBANIAN_STANDARD
+syn keyword ishdConstant ISLANG_BASQUE ISLANG_BASQUE_STANDARD ISLANG_BULGARIAN
+syn keyword ishdConstant ISLANG_BULGARIAN_STANDARD ISLANG_BELARUSIAN
+syn keyword ishdConstant ISLANG_BELARUSIAN_STANDARD ISLANG_CATALAN
+syn keyword ishdConstant ISLANG_CATALAN_STANDARD ISLANG_CHINESE
+syn keyword ishdConstant ISLANG_CHINESE_TAIWAN ISLANG_CHINESE_PRC
+syn keyword ishdConstant ISLANG_SPANISH_PUERTORICO ISLANG_CHINESE_HONGKONG
+syn keyword ishdConstant ISLANG_CHINESE_SINGAPORE ISLANG_CROATIAN
+syn keyword ishdConstant ISLANG_CROATIAN_STANDARD ISLANG_CZECH
+syn keyword ishdConstant ISLANG_CZECH_STANDARD ISLANG_DANISH
+syn keyword ishdConstant ISLANG_DANISH_STANDARD ISLANG_DUTCH
+syn keyword ishdConstant ISLANG_DUTCH_STANDARD ISLANG_DUTCH_BELGIAN
+syn keyword ishdConstant ISLANG_ENGLISH ISLANG_ENGLISH_BELIZE
+syn keyword ishdConstant ISLANG_ENGLISH_UNITEDSTATES
+syn keyword ishdConstant ISLANG_ENGLISH_UNITEDKINGDOM ISLANG_ENGLISH_AUSTRALIAN
+syn keyword ishdConstant ISLANG_ENGLISH_CANADIAN ISLANG_ENGLISH_NEWZEALAND
+syn keyword ishdConstant ISLANG_ENGLISH_IRELAND ISLANG_ENGLISH_SOUTHAFRICA
+syn keyword ishdConstant ISLANG_ENGLISH_JAMAICA ISLANG_ENGLISH_CARIBBEAN
+syn keyword ishdConstant ISLANG_ESTONIAN ISLANG_ESTONIAN_STANDARD
+syn keyword ishdConstant ISLANG_FAEROESE ISLANG_FAEROESE_STANDARD ISLANG_FARSI
+syn keyword ishdConstant ISLANG_FINNISH ISLANG_FINNISH_STANDARD ISLANG_FRENCH
+syn keyword ishdConstant ISLANG_FRENCH_STANDARD ISLANG_FRENCH_BELGIAN
+syn keyword ishdConstant ISLANG_FRENCH_CANADIAN ISLANG_FRENCH_SWISS
+syn keyword ishdConstant ISLANG_FRENCH_LUXEMBOURG ISLANG_FARSI_STANDARD
+syn keyword ishdConstant ISLANG_GERMAN ISLANG_GERMAN_STANDARD
+syn keyword ishdConstant ISLANG_GERMAN_SWISS ISLANG_GERMAN_AUSTRIAN
+syn keyword ishdConstant ISLANG_GERMAN_LUXEMBOURG ISLANG_GERMAN_LIECHTENSTEIN
+syn keyword ishdConstant ISLANG_GREEK ISLANG_GREEK_STANDARD ISLANG_HEBREW
+syn keyword ishdConstant ISLANG_HEBREW_STANDARD ISLANG_HUNGARIAN
+syn keyword ishdConstant ISLANG_HUNGARIAN_STANDARD ISLANG_ICELANDIC
+syn keyword ishdConstant ISLANG_ICELANDIC_STANDARD ISLANG_INDONESIAN
+syn keyword ishdConstant ISLANG_INDONESIAN_STANDARD ISLANG_ITALIAN
+syn keyword ishdConstant ISLANG_ITALIAN_STANDARD ISLANG_ITALIAN_SWISS
+syn keyword ishdConstant ISLANG_JAPANESE ISLANG_JAPANESE_STANDARD ISLANG_KOREAN
+syn keyword ishdConstant ISLANG_KOREAN_STANDARD ISLANG_KOREAN_JOHAB
+syn keyword ishdConstant ISLANG_LATVIAN ISLANG_LATVIAN_STANDARD
+syn keyword ishdConstant ISLANG_LITHUANIAN ISLANG_LITHUANIAN_STANDARD
+syn keyword ishdConstant ISLANG_NORWEGIAN ISLANG_NORWEGIAN_BOKMAL
+syn keyword ishdConstant ISLANG_NORWEGIAN_NYNORSK ISLANG_POLISH
+syn keyword ishdConstant ISLANG_POLISH_STANDARD ISLANG_PORTUGUESE
+syn keyword ishdConstant ISLANG_PORTUGUESE_BRAZILIAN ISLANG_PORTUGUESE_STANDARD
+syn keyword ishdConstant ISLANG_ROMANIAN ISLANG_ROMANIAN_STANDARD ISLANG_RUSSIAN
+syn keyword ishdConstant ISLANG_RUSSIAN_STANDARD ISLANG_SLOVAK
+syn keyword ishdConstant ISLANG_SLOVAK_STANDARD ISLANG_SLOVENIAN
+syn keyword ishdConstant ISLANG_SLOVENIAN_STANDARD ISLANG_SERBIAN
+syn keyword ishdConstant ISLANG_SERBIAN_LATIN ISLANG_SERBIAN_CYRILLIC
+syn keyword ishdConstant ISLANG_SPANISH ISLANG_SPANISH_ARGENTINA
+syn keyword ishdConstant ISLANG_SPANISH_BOLIVIA ISLANG_SPANISH_CHILE
+syn keyword ishdConstant ISLANG_SPANISH_COLOMBIA ISLANG_SPANISH_COSTARICA
+syn keyword ishdConstant ISLANG_SPANISH_DOMINICANREPUBLIC ISLANG_SPANISH_ECUADOR
+syn keyword ishdConstant ISLANG_SPANISH_ELSALVADOR ISLANG_SPANISH_GUATEMALA
+syn keyword ishdConstant ISLANG_SPANISH_HONDURAS ISLANG_SPANISH_MEXICAN
+syn keyword ishdConstant ISLANG_THAI_STANDARD ISLANG_SPANISH_MODERNSORT
+syn keyword ishdConstant ISLANG_SPANISH_NICARAGUA ISLANG_SPANISH_PANAMA
+syn keyword ishdConstant ISLANG_SPANISH_PARAGUAY ISLANG_SPANISH_PERU
+syn keyword ishdConstant IISLANG_SPANISH_PUERTORICO
+syn keyword ishdConstant ISLANG_SPANISH_TRADITIONALSORT ISLANG_SPANISH_VENEZUELA
+syn keyword ishdConstant ISLANG_SPANISH_URUGUAY ISLANG_SWEDISH
+syn keyword ishdConstant ISLANG_SWEDISH_FINLAND ISLANG_SWEDISH_STANDARD
+syn keyword ishdConstant ISLANG_THAI ISLANG_THA_STANDARDI ISLANG_TURKISH
+syn keyword ishdConstant ISLANG_TURKISH_STANDARD ISLANG_UKRAINIAN
+syn keyword ishdConstant ISLANG_UKRAINIAN_STANDARD ISLANG_VIETNAMESE
+syn keyword ishdConstant ISLANG_VIETNAMESE_STANDARD IS_MIPS IS_MONO IS_OS2
+syn keyword ishdConstant ISOSL_ALL ISOSL_WIN31 ISOSL_WIN95 ISOSL_NT351
+syn keyword ishdConstant ISOSL_NT351_ALPHA ISOSL_NT351_MIPS ISOSL_NT351_PPC
+syn keyword ishdConstant ISOSL_NT40 ISOSL_NT40_ALPHA ISOSL_NT40_MIPS
+syn keyword ishdConstant ISOSL_NT40_PPC IS_PENTIUM IS_POWERPC IS_RAMDRIVE
+syn keyword ishdConstant IS_REMOTE IS_REMOVABLE IS_SVGA IS_UNKNOWN IS_UVGA
+syn keyword ishdConstant IS_VALID_PATH IS_VGA IS_WIN32S IS_WINDOWS IS_WINDOWS95
+syn keyword ishdConstant IS_WINDOWSNT IS_WINOS2 IS_XVGA ISTYPE INFOFILENAME
+syn keyword ishdConstant ISRES ISUSER ISVERSION LANGUAGE LANGUAGE_DRV LESS_THAN
+syn keyword ishdConstant LINE_NUMBER LISTBOX_ENTER LISTBOX_SELECT LISTFIRST
+syn keyword ishdConstant LISTLAST LISTNEXT LISTPREV LOCKEDFILE LOGGING
+syn keyword ishdConstant LOWER_LEFT LOWER_RIGHT LIST_NULL MAGENTA MAINCAPTION
+syn keyword ishdConstant MATH_COPROCESSOR MAX_STRING MENU METAFILE MMEDIA_AVI
+syn keyword ishdConstant MMEDIA_MIDI MMEDIA_PLAYASYNCH MMEDIA_PLAYCONTINUOUS
+syn keyword ishdConstant MMEDIA_PLAYSYNCH MMEDIA_STOP MMEDIA_WAVE MOUSE
+syn keyword ishdConstant MOUSE_DRV MEDIA MODE NETWORK NETWORK_DRV NEXT
+syn keyword ishdConstant NEXTBUTTON NO NO_SUBDIR NO_WRITE_ACCESS NONCONTIGUOUS
+syn keyword ishdConstant NONEXCLUSIVE NORMAL NORMALMODE NOSET NOTEXISTS NOTRESET
+syn keyword ishdConstant NOWAIT NULL NUMBERLIST OFF OK ON ONLYDIR OS OSMAJOR
+syn keyword ishdConstant OSMINOR OTHER_FAILURE OUT_OF_DISK_SPACE PARALLEL
+syn keyword ishdConstant PARTIAL PATH PATH_EXISTS PAUSE PERSONAL PROFSTRING
+syn keyword ishdConstant PROGMAN PROGRAMFILES RAM_DRIVE REAL RECORDMODE RED
+syn keyword ishdConstant REGDB_APPPATH REGDB_APPPATH_DEFAULT REGDB_BINARY
+syn keyword ishdConstant REGDB_ERR_CONNECTIONEXISTS REGDB_ERR_CORRUPTEDREGISTRY
+syn keyword ishdConstant REGDB_ERR_FILECLOSE REGDB_ERR_FILENOTFOUND
+syn keyword ishdConstant REGDB_ERR_FILEOPEN REGDB_ERR_FILEREAD
+syn keyword ishdConstant REGDB_ERR_INITIALIZATION REGDB_ERR_INVALIDFORMAT
+syn keyword ishdConstant REGDB_ERR_INVALIDHANDLE REGDB_ERR_INVALIDNAME
+syn keyword ishdConstant REGDB_ERR_INVALIDPLATFORM REGDB_ERR_OUTOFMEMORY
+syn keyword ishdConstant REGDB_ERR_REGISTRY REGDB_KEYS REGDB_NAMES REGDB_NUMBER
+syn keyword ishdConstant REGDB_STRING REGDB_STRING_EXPAND REGDB_STRING_MULTI
+syn keyword ishdConstant REGDB_UNINSTALL_NAME REGKEY_CLASSES_ROOT
+syn keyword ishdConstant REGKEY_CURRENT_USER REGKEY_LOCAL_MACHINE REGKEY_USERS
+syn keyword ishdConstant REMOTE_DRIVE REMOVE REMOVEABLE_DRIVE REPLACE
+syn keyword ishdConstant REPLACE_ITEM RESET RESTART ROOT ROTATE RUN_MAXIMIZED
+syn keyword ishdConstant RUN_MINIMIZED RUN_SEPARATEMEMORY SELECTFOLDER
+syn keyword ishdConstant SELFREGISTER SELFREGISTERBATCH SELFREGISTRATIONPROCESS
+syn keyword ishdConstant SERIAL SET SETUPTYPE SETUPTYPE_INFO_DESCRIPTION
+syn keyword ishdConstant SETUPTYPE_INFO_DISPLAYNAME SEVERE SHARE SHAREDFILE
+syn keyword ishdConstant SHELL_OBJECT_FOLDER SILENTMODE SPLITCOMPRESS SPLITCOPY
+syn keyword ishdConstant SRCTARGETDIR STANDARD STATUS STATUS95 STATUSBAR
+syn keyword ishdConstant STATUSDLG STATUSEX STATUSOLD STRINGLIST STYLE_BOLD
+syn keyword ishdConstant STYLE_ITALIC STYLE_NORMAL STYLE_SHADOW STYLE_UNDERLINE
+syn keyword ishdConstant SW_HIDE SW_MAXIMIZE SW_MINIMIZE SW_NORMAL SW_RESTORE
+syn keyword ishdConstant SW_SHOW SW_SHOWMAXIMIZED SW_SHOWMINIMIZED
+syn keyword ishdConstant SW_SHOWMINNOACTIVE SW_SHOWNA SW_SHOWNOACTIVATE
+syn keyword ishdConstant SW_SHOWNORMAL SYS_BOOTMACHINE SYS_BOOTWIN
+syn keyword ishdConstant SYS_BOOTWIN_INSTALL SYS_RESTART SYS_SHUTDOWN SYS_TODOS
+syn keyword ishdConstant SELECTED_LANGUAGE SHELL_OBJECT_LANGUAGE SRCDIR SRCDISK
+syn keyword ishdConstant SUPPORTDIR TEXT TILED TIME TRUE TYPICAL TARGETDIR
+syn keyword ishdConstant TARGETDISK UPPER_LEFT UPPER_RIGHT USER_ADMINISTRATOR
+syn keyword ishdConstant UNINST VALID_PATH VARIABLE_LEFT VARIABLE_UNDEFINED
+syn keyword ishdConstant VER_DLL_NOT_FOUND VER_UPDATE_ALWAYS VER_UPDATE_COND
+syn keyword ishdConstant VERSION VIDEO VOLUMELABEL WAIT WARNING WELCOME WHITE
+syn keyword ishdConstant WIN32SINSTALLED WIN32SMAJOR WIN32SMINOR WINDOWS_SHARED
+syn keyword ishdConstant WINMAJOR WINMINOR WINDIR WINDISK WINSYSDIR WINSYSDISK
+syn keyword ishdConstant XCOPY_DATETIME YELLOW YES
+
+syn keyword ishdFunction AskDestPath AskOptions AskPath AskText AskYesNo
+syn keyword ishdFunction AppCommand AddProfString AddFolderIcon BatchAdd
+syn keyword ishdFunction BatchDeleteEx BatchFileLoad BatchFileSave BatchFind
+syn keyword ishdFunction BatchGetFileName BatchMoveEx BatchSetFileName
+syn keyword ishdFunction ComponentDialog ComponentAddItem
+syn keyword ishdFunction ComponentCompareSizeRequired ComponentDialog
+syn keyword ishdFunction ComponentError ComponentFileEnum ComponentFileInfo
+syn keyword ishdFunction ComponentFilterLanguage ComponentFilterOS
+syn keyword ishdFunction ComponentGetData ComponentGetItemSize
+syn keyword ishdFunction ComponentInitialize ComponentIsItemSelected
+syn keyword ishdFunction ComponentListItems ComponentMoveData
+syn keyword ishdFunction ComponentSelectItem ComponentSetData ComponentSetTarget
+syn keyword ishdFunction ComponentSetupTypeEnum ComponentSetupTypeGetData
+syn keyword ishdFunction ComponentSetupTypeSet ComponentTotalSize
+syn keyword ishdFunction ComponentValidate ConfigAdd ConfigDelete ConfigFileLoad
+syn keyword ishdFunction ConfigFileSave ConfigFind ConfigGetFileName
+syn keyword ishdFunction ConfigGetInt ConfigMove ConfigSetFileName ConfigSetInt
+syn keyword ishdFunction CmdGetHwndDlg CtrlClear CtrlDir CtrlGetCurSel
+syn keyword ishdFunction CtrlGetMLEText CtrlGetMultCurSel CtrlGetState
+syn keyword ishdFunction CtrlGetSubCommand CtrlGetText CtrlPGroups
+syn keyword ishdFunction CtrlSelectText CtrlSetCurSel CtrlSetFont CtrlSetList
+syn keyword ishdFunction CtrlSetMLEText CtrlSetMultCurSel CtrlSetState
+syn keyword ishdFunction CtrlSetText CallDLLFx ChangeDirectory CloseFile
+syn keyword ishdFunction CopyFile CreateDir CreateFile CreateRegistrySet
+syn keyword ishdFunction CommitSharedFiles CreateProgramFolder
+syn keyword ishdFunction CreateShellObjects CopyBytes DefineDialog Delay
+syn keyword ishdFunction DeleteDir DeleteFile Do DoInstall DeinstallSetReference
+syn keyword ishdFunction DeinstallStart DialogSetInfo DeleteFolderIcon
+syn keyword ishdFunction DeleteProgramFolder Disable EzBatchAddPath
+syn keyword ishdFunction EzBatchAddString ExBatchReplace EnterDisk
+syn keyword ishdFunction EzConfigAddDriver EzConfigAddString EzConfigGetValue
+syn keyword ishdFunction EzConfigSetValue EndDialog EzDefineDialog ExistsDir
+syn keyword ishdFunction ExistsDisk ExitProgMan Enable EzBatchReplace
+syn keyword ishdFunction FileCompare FileDeleteLine FileGrep FileInsertLine
+syn keyword ishdFunction FindAllDirs FindAllFiles FindFile FindWindow
+syn keyword ishdFunction GetFileInfo GetLine GetFont GetDiskSpace GetEnvVar
+syn keyword ishdFunction GetExtents GetMemFree GetMode GetSystemInfo
+syn keyword ishdFunction GetValidDrivesList GetWindowHandle GetProfInt
+syn keyword ishdFunction GetProfString GetFolderNameList GetGroupNameList
+syn keyword ishdFunction GetItemNameList GetDir GetDisk HIWORD Handler Is
+syn keyword ishdFunction ISCompareServicePack InstallationInfo LOWORD LaunchApp
+syn keyword ishdFunction LaunchAppAndWait ListAddItem ListAddString ListCount
+syn keyword ishdFunction ListCreate ListCurrentItem ListCurrentString
+syn keyword ishdFunction ListDeleteItem ListDeleteString ListDestroy
+syn keyword ishdFunction ListFindItem ListFindString ListGetFirstItem
+syn keyword ishdFunction ListGetFirstString ListGetNextItem ListGetNextString
+syn keyword ishdFunction ListReadFromFile ListSetCurrentItem
+syn keyword ishdFunction ListSetCurrentString ListSetIndex ListWriteToFile
+syn keyword ishdFunction LongPathFromShortPath LongPathToQuote
+syn keyword ishdFunction LongPathToShortPath MessageBox MessageBeep NumToStr
+syn keyword ishdFunction OpenFile OpenFileMode PathAdd PathDelete PathFind
+syn keyword ishdFunction PathGet PathMove PathSet ProgDefGroupType ParsePath
+syn keyword ishdFunction PlaceBitmap PlaceWindow PlayMMedia QueryProgGroup
+syn keyword ishdFunction QueryProgItem QueryShellMgr RebootDialog ReleaseDialog
+syn keyword ishdFunction ReadBytes RenameFile ReplaceProfString ReloadProgGroup
+syn keyword ishdFunction ReplaceFolderIcon RGB RegDBConnectRegistry
+syn keyword ishdFunction RegDBCreateKeyEx RegDBDeleteKey RegDBDeleteValue
+syn keyword ishdFunction RegDBDisConnectRegistry RegDBGetAppInfo RegDBGetItem
+syn keyword ishdFunction RegDBGetKeyValueEx RegDBKeyExist RegDBQueryKey
+syn keyword ishdFunction RegDBSetAppInfo RegDBSetDefaultRoot RegDBSetItem
+syn keyword ishdFunction RegDBSetKeyValueEx SeekBytes SelectDir SetFileInfo
+syn keyword ishdFunction SelectDir SelectFolder SetupType SprintfBox SdSetupType
+syn keyword ishdFunction SdSetupTypeEx SdMakeName SilentReadData SilentWriteData
+syn keyword ishdFunction SendMessage Sprintf System SdAskDestPath SdAskOptions
+syn keyword ishdFunction SdAskOptionsList SdBitmap SdComponentDialog
+syn keyword ishdFunction SdComponentDialog2 SdComponentDialogAdv SdComponentMult
+syn keyword ishdFunction SdConfirmNewDir SdConfirmRegistration SdDisplayTopics
+syn keyword ishdFunction SdFinish SdFinishReboot SdInit SdLicense SdMakeName
+syn keyword ishdFunction SdOptionsButtons SdProductName SdRegisterUser
+syn keyword ishdFunction SdRegisterUserEx SdSelectFolder SdSetupType
+syn keyword ishdFunction SdSetupTypeEx SdShowAnyDialog SdShowDlgEdit1
+syn keyword ishdFunction SdShowDlgEdit2 SdShowDlgEdit3 SdShowFileMods
+syn keyword ishdFunction SdShowInfoList SdShowMsg SdStartCopy SdWelcome
+syn keyword ishdFunction SelectFolder ShowGroup ShowProgamFolder SetColor
+syn keyword ishdFunction SetDialogTitle SetDisplayEffect SetErrorMsg
+syn keyword ishdFunction SetErrorTitle SetFont SetStatusWindow SetTitle
+syn keyword ishdFunction SizeWindow StatusUpdate StrCompare StrFind StrGetTokens
+syn keyword ishdFunction StrLength StrRemoveLastSlash StrSub StrToLower StrToNum
+syn keyword ishdFunction StrToUpper ShowProgramFolder UnUseDLL UseDLL VarRestore
+syn keyword ishdFunction VarSave VerUpdateFile VerCompare VerFindFileVersion
+syn keyword ishdFunction VerGetFileVersion VerSearchAndUpdateFile VerUpdateFile
+syn keyword ishdFunction Welcome WaitOnDialog WriteBytes WriteLine
+syn keyword ishdFunction WriteProfString XCopyFile
+
+syn keyword ishdTodo contained TODO
+
+"integer number, or floating point number without a dot.
+syn match ishdNumber "\<\d\+\>"
+"floating point number, with dot
+syn match ishdNumber "\<\d\+\.\d*\>"
+"floating point number, starting with a dot
+syn match ishdNumber "\.\d\+\>"
+
+" String constants
+syn region ishdString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+syn region ishdComment start="//" end="$" contains=ishdTodo
+syn region ishdComment start="/\*" end="\*/" contains=ishdTodo
+
+" Pre-processor commands
+syn region ishdPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=ishdComment,ishdString
+if !exists("ishd_no_if0")
+ syn region ishdHashIf0 start="^\s*#\s*if\s\+0\>" end=".\|$" contains=ishdHashIf0End
+ syn region ishdHashIf0End contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=ishdHashIf0Skip
+ syn region ishdHashIf0Skip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=ishdHashIf0Skip
+endif
+syn region ishdIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match ishdInclude +^\s*#\s*include\>\s*"+ contains=ishdIncluded
+syn cluster ishdPreProcGroup contains=ishdPreCondit,ishdIncluded,ishdInclude,ishdDefine,ishdHashIf0,ishdHashIf0End,ishdHashIf0Skip,ishdNumber
+syn region ishdDefine start="^\s*#\s*\(define\|undef\)\>" end="$" contains=ALLBUT,@ishdPreProcGroup
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_is_syntax_inits")
+ if version < 508
+ let did_is_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ishdNumber Number
+ HiLink ishdError Error
+ HiLink ishdStatement Statement
+ HiLink ishdString String
+ HiLink ishdComment Comment
+ HiLink ishdTodo Todo
+ HiLink ishdFunction Identifier
+ HiLink ishdConstant PreProc
+ HiLink ishdType Type
+ HiLink ishdInclude Include
+ HiLink ishdDefine Macro
+ HiLink ishdIncluded String
+ HiLink ishdPreCondit PreCondit
+ HiLink ishdHashIf0Skip ishdHashIf0
+ HiLink ishdHashIf0End ishdHashIf0
+ HiLink ishdHashIf0 Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ishd"
+
+" vim: ts=8
diff --git a/runtime/syntax/iss.vim b/runtime/syntax/iss.vim
new file mode 100644
index 000000000..be8901cc2
--- /dev/null
+++ b/runtime/syntax/iss.vim
@@ -0,0 +1,125 @@
+" Vim syntax file
+" Language: Inno Setup File (iss file) and My InnoSetup extension
+" Maintainer: Dominique Stéphan (dominique@mggen.com)
+" Last change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" shut case off
+syn case ignore
+
+" Section
+syn region issHeader start="\[" end="\]"
+
+" Label in the [Setup] Section
+syn match issLabel "^[^=]\+="
+
+" URL
+syn match issURL "http[s]\=:\/\/.*$"
+
+" syn match issName "[^: ]\+:"
+syn match issName "Name:"
+syn match issName "MinVersion:\|OnlyBelowVersion:"
+syn match issName "Source:\|DestDir:\|DestName:\|CopyMode:"
+syn match issName "Attribs:\|FontInstall:\|Flags:"
+syn match issName "FileName:\|Parameters:\|WorkingDir:\|Comment:"
+syn match issName "IconFilename:\|IconIndex:"
+syn match issName "Section:\|Key:\|String:"
+syn match issName "Root:\|SubKey:\|ValueType:\|ValueName:\|ValueData:"
+syn match issName "RunOnceId:"
+syn match issName "Type:"
+syn match issName "Components:\|Description:\|GroupDescription\|Types:"
+
+syn match issComment "^;.*$"
+
+" folder constant
+syn match issFolder "{[^{]*}"
+
+" string
+syn region issString start=+"+ end=+"+ contains=issFolder
+
+" [Dirs]
+syn keyword issDirsFlags deleteafterinstall uninsalwaysuninstall uninsneveruninstall
+
+" [Files]
+syn keyword issFilesCopyMode normal onlyifdoesntexist alwaysoverwrite alwaysskipifsameorolder
+syn keyword issFilesAttribs readonly hidden system
+syn keyword issFilesFlags comparetimestampalso confirmoverwrite deleteafterinstall
+syn keyword issFilesFlags external fontisnttruetype isreadme overwritereadonly
+syn keyword issFilesFlags regserver regtypelib restartreplace
+syn keyword issFilesFlags sharedfile skipifsourcedoesntexist uninsneveruninstall
+
+" [Icons]
+syn keyword issIconsFlags createonlyiffileexists runminimized uninsneveruninstall useapppaths
+
+" [INI]
+syn keyword issINIFlags createkeyifdoesntexist uninsdeleteentry uninsdeletesection uninsdeletesectionifempty
+
+" [Registry]
+syn keyword issRegRootKey HKCR HKCU HKLM HKU HKCC
+syn keyword issRegValueType none string expandsz multisz dword binary
+syn keyword issRegFlags createvalueifdoesntexist deletekey deletevalue preservestringtype
+syn keyword issRegFlags uninsclearvalue uninsdeletekey uninsdeletekeyifempty uninsdeletevalue
+
+" [Run] and [UninstallRun]
+syn keyword issRunFlags nowait shellexec skipifdoesntexist runminimized waituntilidle
+syn keyword issRunFlags postinstall unchecked showcheckbox
+
+" [Types]
+syn keyword issTypesFlags iscustom
+
+" [Components]
+syn keyword issComponentsFlags fixed restart disablenouninstallwarning
+
+" [UninstallDelete] and [InstallDelete]
+syn keyword issInstallDeleteType files filesandordirs dirifempty
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_iss_syntax_inits")
+ if version < 508
+ let did_iss_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink issHeader Special
+ HiLink issComment Comment
+ HiLink issLabel Type
+ HiLink issName Type
+ HiLink issFolder Special
+ HiLink issString String
+ HiLink issValue String
+ HiLink issURL Include
+
+ HiLink issDirsFlags Keyword
+ HiLink issFilesCopyMode Keyword
+ HiLink issFilesAttribs Keyword
+ HiLink issFilesFlags Keyword
+ HiLink issIconsFlags Keyword
+ HiLink issINIFlags Keyword
+ HiLink issRegRootKey Keyword
+ HiLink issRegValueType Keyword
+ HiLink issRegFlags Keyword
+ HiLink issRunFlags Keyword
+ HiLink issTypesFlags Keyword
+ HiLink issComponentsFlags Keyword
+ HiLink issInstallDeleteType Keyword
+
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "iss"
+
+" vim:ts=8
diff --git a/runtime/syntax/ist.vim b/runtime/syntax/ist.vim
new file mode 100644
index 000000000..fd0005e55
--- /dev/null
+++ b/runtime/syntax/ist.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: Makeindex style file, *.ist
+" Maintainer: Peter Meszaros <pmeszaros@effice.hu>
+" Last Change: May 4, 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=$,@,48-57,_
+else
+ set iskeyword=$,@,48-57,_
+endif
+
+syn case ignore
+syn keyword IstInpSpec actual arg_close arg_open encap escape
+syn keyword IstInpSpec keyword level quote range_close range_open
+syn keyword IstInpSpec page_compositor
+
+syn keyword IstOutSpec preamble postamble setpage_prefix setpage_suffix group_skip
+syn keyword IstOutSpec headings_flag heading_prefix heading_suffix
+syn keyword IstOutSpec lethead_flag lethead_prefix lethead_suffix
+syn keyword IstOutSpec symhead_positive symhead_negative numhead_positive numhead_negative
+syn keyword IstOutSpec item_0 item_1 item_2 item_01
+syn keyword IstOutSpec item_x1 item_12 item_x2
+syn keyword IstOutSpec delim_0 delim_1 delim_2
+syn keyword IstOutSpec delim_n delim_r delim_t
+syn keyword IstOutSpec encap_prefix encap_infix encap_suffix
+syn keyword IstOutSpec line_max indent_space indent_length
+syn keyword IstOutSpec suffix_2p suffix_3p suffix_mp
+
+syn region IstString matchgroup=IstDoubleQuote start=+"+ skip=+\\"+ end=+"+ contains=IstSpecial
+syn match IstCharacter "'.'"
+syn match IstNumber "\d\+"
+syn match IstComment "^[\t ]*%.*$" contains=IstTodo
+syn match IstSpecial "\\\\\|{\|}\|#\|\\n" contained
+syn match IstTodo "DEBUG\|TODO" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_dummy_syn_inits")
+ if version < 508
+ let did_dummy_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink IstInpSpec Type
+ HiLink IstOutSpec Identifier
+ HiLink IstString String
+ HiLink IstNumber Number
+ HiLink IstComment Comment
+ HiLink IstTodo Todo
+ HiLink IstSpecial Special
+ HiLink IstDoubleQuote Label
+ HiLink IstCharacter Label
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ist"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/jal.vim b/runtime/syntax/jal.vim
new file mode 100644
index 000000000..d0ba67285
--- /dev/null
+++ b/runtime/syntax/jal.vim
@@ -0,0 +1,249 @@
+" Vim syntax file
+" Language: JAL
+" Version: 0.1
+" Last Change: 2003 May 11
+" Maintainer: Mark Gross <mark@thegnar.org>
+" This is a syntax definition for the JAL language.
+" It is based on the Source Forge compiler source code.
+" https://sourceforge.net/projects/jal/
+"
+" TODO test.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+syn sync lines=250
+
+syn keyword picTodo NOTE TODO XXX contained
+
+syn match picIdentifier "[a-z_$][a-z0-9_$]*"
+syn match picLabel "^[A-Z_$][A-Z0-9_$]*"
+syn match picLabel "^[A-Z_$][A-Z0-9_$]*:"me=e-1
+
+syn match picASCII "A\='.'"
+syn match picBinary "B'[0-1]\+'"
+syn match picDecimal "D'\d\+'"
+syn match picDecimal "\d\+"
+syn match picHexadecimal "0x\x\+"
+syn match picHexadecimal "H'\x\+'"
+syn match picHexadecimal "[0-9]\x*h"
+syn match picOctal "O'[0-7]\o*'"
+
+syn match picComment ";.*" contains=picTodo
+
+syn region picString start=+"+ end=+"+
+
+syn keyword picRegister indf tmr0 pcl status fsr port_a port_b port_c port_d port_e x84_eedata x84_eeadr pclath intcon
+syn keyword picRegister f877_tmr1l f877_tmr1h f877_t1con f877_t2con f877_ccpr1l f877_ccpr1h f877_ccp1con
+syn keyword picRegister f877_pir1 f877_pir2 f877_pie1 f877_adcon1 f877_adcon0 f877_pr2 f877_adresl f877_adresh
+syn keyword picRegister f877_eeadr f877_eedath f877_eeadrh f877_eedata f877_eecon1 f877_eecon2 f628_EECON2
+syn keyword picRegister f877_rcsta f877_txsta f877_spbrg f877_txreg f877_rcreg f628_EEDATA f628_EEADR f628_EECON1
+
+" Register --- bits
+" STATUS
+syn keyword picRegisterPart status_c status_dc status_z status_pd
+syn keyword picRegisterPart status_to status_rp0 status_rp1 status_irp
+
+" pins
+syn keyword picRegisterPart pin_a0 pin_a1 pin_a2 pin_a3 pin_a4 pin_a5
+syn keyword picRegisterPart pin_b0 pin_b1 pin_b2 pin_b3 pin_b4 pin_b5 pin_b6 pin_b7
+syn keyword picRegisterPart pin_c0 pin_c1 pin_c2 pin_c3 pin_c4 pin_c5 pin_c6 pin_c7
+syn keyword picRegisterPart pin_d0 pin_d1 pin_d2 pin_d3 pin_d4 pin_d5 pin_d6 pin_d7
+syn keyword picRegisterPart pin_e0 pin_e1 pin_e2
+
+syn keyword picPortDir port_a_direction port_b_direction port_c_direction port_d_direction port_e_direction
+
+syn match picPinDir "pin_a[012345]_direction"
+syn match picPinDir "pin_b[01234567]_direction"
+syn match picPinDir "pin_c[01234567]_direction"
+syn match picPinDir "pin_d[01234567]_direction"
+syn match picPinDir "pin_e[012]_direction"
+
+
+" INTCON
+syn keyword picRegisterPart intcon_gie intcon_eeie intcon_peie intcon_t0ie intcon_inte
+syn keyword picRegisterPart intcon_rbie intcon_t0if intcon_intf intcon_rbif
+
+" TIMER
+syn keyword picRegisterPart t1ckps1 t1ckps0 t1oscen t1sync tmr1cs tmr1on tmr1ie tmr1if
+
+"cpp bits
+syn keyword picRegisterPart ccp1x ccp1y
+
+" adcon bits
+syn keyword picRegisterPart adcon0_go adcon0_ch0 adcon0_ch1 adcon0_ch2
+
+" EECON
+syn keyword picRegisterPart eecon1_rd eecon1_wr eecon1_wren eecon1_wrerr eecon1_eepgd
+syn keyword picRegisterPart f628_eecon1_rd f628_eecon1_wr f628_eecon1_wren f628_eecon1_wrerr
+
+" usart
+syn keyword picRegisterPart tx9 txen sync brgh tx9d
+syn keyword picRegisterPart spen rx9 cren ferr oerr rx9d
+syn keyword picRegisterPart TXIF RCIF
+
+" OpCodes...
+syn keyword picOpcode addlw andlw call clrwdt goto iorlw movlw option retfie retlw return sleep sublw tris
+syn keyword picOpcode xorlw addwf andwf clrf clrw comf decf decfsz incf incfsz retiw iorwf movf movwf nop
+syn keyword picOpcode rlf rrf subwf swapf xorwf bcf bsf btfsc btfss skpz skpnz setz clrz skpc skpnc setc clrc
+syn keyword picOpcode skpdc skpndc setdc clrdc movfw tstf bank page HPAGE mullw mulwf cpfseq cpfsgt cpfslt banka bankb
+
+
+syn keyword jalBoolean true false
+syn keyword jalBoolean off on
+syn keyword jalBit high low
+syn keyword jalConstant Input Output all_input all_output
+syn keyword jalConditional if else then elsif end if
+syn keyword jalLabel goto
+syn keyword jalRepeat for while forever loop
+syn keyword jalStatement procedure function
+syn keyword jalStatement return end volatile const var
+syn keyword jalType bit byte
+
+syn keyword jalModifier interrupt assembler asm put get
+syn keyword jalStatement out in is begin at
+syn keyword jalDirective pragma jump_table target target_clock target_chip name error test assert
+syn keyword jalPredefined hs xt rc lp internal 16c84 16f84 16f877 sx18 sx28 12c509a 12c508
+syn keyword jalPredefined 12ce674 16f628 18f252 18f242 18f442 18f452 12f629 12f675 16f88
+syn keyword jalPredefined 16f876 16f873 sx_12 sx18 sx28 pic_12 pic_14 pic_16
+
+syn keyword jalDirective chip osc clock fuses cpu watchdog powerup protection
+
+syn keyword jalFunction bank_0 bank_1 bank_2 bank_3 bank_4 bank_5 bank_6 bank_7 trisa trisb trisc trisd trise
+syn keyword jalFunction _trisa_flush _trisb_flush _trisc_flush _trisd_flush _trise_flush
+
+syn keyword jalPIC local idle_loop
+
+syn region jalAsm matchgroup=jalAsmKey start="\<assembler\>" end="\<end assembler\>" contains=jalComment,jalPreProc,jalLabel,picIdentifier, picLabel,picASCII,picDecimal,picHexadecimal,picOctal,picComment,picString,picRegister,picRigisterPart,picOpcode,picDirective,jalPIC
+syn region jalAsm matchgroup=jalAsmKey start="\<asm\>" end=/$/ contains=jalComment,jalPreProc,jalLabel,picIdentifier, picLabel,picASCII,picDecimal,picHexadecimal,picOctal,picComment,picString,picRegister,picRigisterPart,picOpcode,picDirective,jalPIC
+
+syn region jalPsudoVars matchgroup=jalPsudoVarsKey start="\<'put\>" end="/<is/>" contains=jalComment
+
+syn match jalStringEscape contained "#[12][0-9]\=[0-9]\="
+syn match jalIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
+syn match jalSymbolOperator "[+\-/*=]"
+syn match jalSymbolOperator "!"
+syn match jalSymbolOperator "<"
+syn match jalSymbolOperator ">"
+syn match jalSymbolOperator "<="
+syn match jalSymbolOperator ">="
+syn match jalSymbolOperator "!="
+syn match jalSymbolOperator "=="
+syn match jalSymbolOperator "<<"
+syn match jalSymbolOperator ">>"
+syn match jalSymbolOperator "|"
+syn match jalSymbolOperator "&"
+syn match jalSymbolOperator "%"
+syn match jalSymbolOperator "?"
+syn match jalSymbolOperator "[()]"
+syn match jalSymbolOperator "[\^.]"
+syn match jalLabel "[\^]*:"
+
+syn match jalNumber "-\=\<\d[0-9_]\+\>"
+syn match jalHexNumber "0x[0-9A-Fa-f_]\+\>"
+syn match jalBinNumber "0b[01_]\+\>"
+
+" String
+"wrong strings
+syn region jalStringError matchgroup=jalStringError start=+"+ end=+"+ end=+$+ contains=jalStringEscape
+
+"right strings
+syn region jalString matchgroup=jalString start=+'+ end=+'+ oneline contains=jalStringEscape
+" To see the start and end of strings:
+syn region jalString matchgroup=jalString start=+"+ end=+"+ oneline contains=jalStringEscapeGPC
+
+syn keyword jalTodo contained TODO
+syn region jalComment start=/-- / end=/$/ oneline contains=jalTodo
+syn region jalComment start=/--\t/ end=/$/ oneline contains=jalTodo
+syn match jalComment /--\_$/
+syn region jalPreProc start="include" end=/$/ contains=JalComment,jalToDo
+
+
+if exists("jal_no_tabs")
+ syn match jalShowTab "\t"
+endif
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jal_syn_inits")
+if version < 508
+ let did_jal_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+else
+ command -nargs=+ HiLink hi def link <args>
+endif
+
+ HiLink jalAcces jalStatement
+ HiLink jalBoolean Boolean
+ HiLink jalBit Boolean
+ HiLink jalComment Comment
+ HiLink jalConditional Conditional
+ HiLink jalConstant Constant
+ HiLink jalDelimiter Identifier
+ HiLink jalDirective PreProc
+ HiLink jalException Exception
+ HiLink jalFloat Float
+ HiLink jalFunction Function
+ HiLink jalPsudoVarsKey Function
+ HiLink jalLabel Label
+ HiLink jalMatrixDelimiter Identifier
+ HiLink jalModifier Type
+ HiLink jalNumber Number
+ HiLink jalBinNumber Number
+ HiLink jalHexNumber Number
+ HiLink jalOperator Operator
+ HiLink jalPredefined Constant
+ HiLink jalPreProc PreProc
+ HiLink jalRepeat Repeat
+ HiLink jalStatement Statement
+ HiLink jalString String
+ HiLink jalStringEscape Special
+ HiLink jalStringEscapeGPC Special
+ HiLink jalStringError Error
+ HiLink jalStruct jalStatement
+ HiLink jalSymbolOperator jalOperator
+ HiLink jalTodo Todo
+ HiLink jalType Type
+ HiLink jalUnclassified Statement
+ HiLink jalAsm Assembler
+ HiLink jalError Error
+ HiLink jalAsmKey Statement
+ HiLink jalPIC Statement
+
+ HiLink jalShowTab Error
+
+ HiLink picTodo Todo
+ HiLink picComment Comment
+ HiLink picDirective Statement
+ HiLink picLabel Label
+ HiLink picString String
+
+ HiLink picOpcode Keyword
+ HiLink picRegister Structure
+ HiLink picRegisterPart Special
+ HiLink picPinDir SPecial
+ HiLink picPortDir SPecial
+
+ HiLink picASCII String
+ HiLink picBinary Number
+ HiLink picDecimal Number
+ HiLink picHexadecimal Number
+ HiLink picOctal Number
+
+ HiLink picIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "jal"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/jam.vim b/runtime/syntax/jam.vim
new file mode 100644
index 000000000..9fe667886
--- /dev/null
+++ b/runtime/syntax/jam.vim
@@ -0,0 +1,252 @@
+" Vim syntax file
+" Language: JAM
+" Maintainer: Ralf Lemke (ralflemk@t-online.de)
+" Last change: 09-10-2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,-
+else
+ set iskeyword=@,48-57,_,-
+endif
+
+" A bunch of useful jam keywords
+syn keyword jamStatement break call dbms flush global include msg parms proc public receive return send unload vars
+syn keyword jamConditional if else
+syn keyword jamRepeat for while next step
+
+syn keyword jamTodo contained TODO FIXME XXX
+syn keyword jamDBState1 alias binary catquery close close_all_connections column_names connection continue continue_bottom continue_down continue_top continue_up
+syn keyword jamDBState2 cursor declare engine execute format occur onentry onerror onexit sql start store unique with
+syn keyword jamSQLState1 all alter and any avg between by count create current data database delete distinct drop exists fetch from grant group
+syn keyword jamSQLState2 having index insert into like load max min of open order revoke rollback runstats select set show stop sum synonym table to union update values view where bundle
+
+syn keyword jamLibFunc1 dm_bin_create_occur dm_bin_delete_occur dm_bin_get_dlength dm_bin_get_occur dm_bin_length dm_bin_max_occur dm_bin_set_dlength dm_convert_empty dm_cursor_connection dm_cursor_consistent dm_cursor_engine dm_dbi_init dm_dbms dm_dbms_noexp dm_disable_styles dm_enable_styles dm_exec_sql dm_expand dm_free_sql_info dm_gen_change_execute_using dm_gen_change_select_from dm_gen_change_select_group_by dm_gen_change_select_having dm_gen_change_select_list dm_gen_change_select_order_by dm_gen_change_select_suffix dm_gen_change_select_where dm_gen_get_tv_alias dm_gen_sql_info
+
+syn keyword jamLibFunc2 dm_get_db_conn_handle dm_get_db_cursor_handle dm_get_driver_option dm_getdbitext dm_init dm_is_connection dm_is_cursor dm_is_engine dm_odb_preserves_cursor dm_reset dm_set_driver_option dm_set_max_fetches dm_set_max_rows_per_fetch dm_set_tm_clear_fast dm_val_relative sm_adjust_area sm_allget sm_amt_format sm_e_amt_format sm_i_amt_format sm_n_amt_format sm_o_amt_format sm_append_bundle_data sm_append_bundle_done sm_append_bundle_item sm_d_at_cur sm_l_at_cur sm_r_at_cur sm_mw_attach_drawing_func sm_mwn_attach_drawing_func sm_mwe_attach_drawing_func sm_xm_attach_drawing_func sm_xmn_attach_drawing_func sm_xme_attach_drawing_func sm_backtab sm_bel sm_bi_comparesm_bi_copy sm_bi_initialize sm_bkrect sm_c_off sm_c_on sm_c_vis sm_calc sm_cancel sm_ckdigit sm_cl_all_mdts sm_cl_unprot sm_clear_array sm_n_clear_array sm_1clear_array sm_n_1clear_array sm_close_window sm_com_load_picture sm_com_QueryInterface sm_com_result sm_com_result_msg sm_com_set_handler sm_copyarray sm_n_copyarray sm_create_bundle
+
+syn keyword jamLibFunc3 sm_d_msg_line sm_dblval sm_e_dblval sm_i_dblval sm_n_dblval sm_o_dblval sm_dd_able sm_dde_client_connect_cold sm_dde_client_connect_hot sm_dde_client_connect_warm sm_dde_client_disconnect sm_dde_client_off sm_dde_client_on sm_dde_client_paste_link_cold sm_dde_client_paste_link_hot sm_dde_client_paste_link_warm sm_dde_client_request sm_dde_execute sm_dde_install_notify sm_dde_poke sm_dde_server_off sm_dde_server_on sm_delay_cursor sm_deselect sm_dicname sm_disp_off sm_dlength sm_e_dlength sm_i_dlength sm_n_dlength sm_o_dlength sm_do_uinstalls sm_i_doccur sm_o_doccur sm_drawingarea sm_xm_drawingarea sm_dtofield sm_e_dtofield sm_i_dtofield sm_n_dtofield sm_o_dtofield sm_femsg sm_ferr_reset sm_fi_path sm_file_copy sm_file_exists sm_file_move sm_file_remove sm_fi_open sm_fi_path sm_filebox sm_filetypes sm_fio_a2f sm_fio_close sm_fio_editor sm_fio_error sm_fio_error_set sm_fio_f2a sm_fio_getc sm_fio_gets sm_fio_handle sm_fio_open sm_fio_putc sm_fio_puts sm_fio_rewind sm_flush sm_d_form sm_l_form
+
+syn keyword jamLibFunc4 sm_r_form sm_formlist sm_fptr sm_e_fptr sm_i_fptr sm_n_fptr sm_o_fptr sm_fqui_msg sm_fquiet_err sm_free_bundle sm_ftog sm_e_ftog sm_i_ftog sm_n_ftog sm_o_ftog sm_fval sm_e_fval sm_i_fval sm_n_fval sm_o_fval sm_i_get_bi_data sm_o_get_bi_data sm_get_bundle_data sm_get_bundle_item_count sm_get_bundle_occur_count sm_get_next_bundle_name sm_i_get_tv_bi_data sm_o_get_tv_bi_data sm_getfield sm_e_getfield sm_i_getfield sm_n_getfield sm_o_getfield sm_getkey sm_gofield sm_e_gofield sm_i_gofield sm_n_gofield sm_o_gofield sm_gtof sm_gval sm_i_gtof sm_n_gval sm_hlp_by_name sm_home sm_inimsg sm_initcrt sm_jinitcrt sm_jxinitcrt sm_input sm_inquire sm_install sm_intval sm_e_intval sm_i_intval sm_n_intval sm_o_intval sm_i_ioccur sm_o_ioccur sm_is_bundle sm_is_no sm_e_is_no sm_i_is_no sm_n_is_no sm_o_is_no sm_is_yes sm_e_is_yes sm_i_is_yes sm_n_is_yes sm_o_is_yes sm_isabort sm_iset sm_issv sm_itofield sm_e_itofield sm_i_itofield sm_n_itofield sm_o_itofield sm_jclose sm_jfilebox sm_jform sm_djplcall sm_jplcall
+
+syn keyword jamLibFunc5 sm_sjplcall sm_jplpublic sm_jplunload sm_jtop sm_jwindow sm_key_integer sm_keyfilter sm_keyhit sm_keyinit sm_n_keyinit sm_keylabel sm_keyoption sm_l_close sm_l_open sm_l_open_syslib sm_last sm_launch sm_h_ldb_fld_get sm_n_ldb_fld_get sm_h_ldb_n_fld_get sm_n_ldb_n_fld_get sm_h_ldb_fld_store sm_n_ldb_fld_store sm_h_ldb_n_fld_store sm_n_ldb_n_fld_store sm_ldb_get_active sm_ldb_get_inactive sm_ldb_get_next_active sm_ldb_get_next_inactive sm_ldb_getfield sm_i_ldb_getfield sm_n_ldb_getfield sm_o_ldb_getfield sm_ldb_h_getfield sm_i_ldb_h_getfield sm_n_ldb_h_getfield sm_o_ldb_h_getfield sm_ldb_handle sm_ldb_init sm_ldb_is_loaded sm_ldb_load sm_ldb_name sm_ldb_next_handle sm_ldb_pop sm_ldb_push sm_ldb_putfield sm_i_ldb_putfield sm_n_ldb_putfield sm_o_ldb_putfield sm_ldb_h_putfield sm_i_ldb_h_putfield sm_n_ldb_h_putfield sm_o_ldb_h_putfield sm_ldb_state_get sm_ldb_h_state_get sm_ldb_state_set sm_ldb_h_state_set sm_ldb_unload sm_ldb_h_unload sm_leave sm_list_objects_count sm_list_objects_end sm_list_objects_next
+
+syn keyword jamLibFunc6 sm_list_objects_start sm_lngval sm_e_lngval sm_i_lngval sm_n_lngval sm_o_lngval sm_load_screen sm_log sm_lstore sm_ltofield sm_e_ltofield sm_i_ltofield sm_n_ltofield sm_o_ltofield sm_m_flush sm_menu_bar_error sm_menu_change sm_menu_create sm_menu_delete sm_menu_get_int sm_menu_get_str sm_menu_install sm_menu_remove sm_message_box sm_mncrinit6 sm_mnitem_change sm_n_mnitem_change sm_mnitem_create sm_n_mnitem_create sm_mnitem_delete sm_n_mnitem_delete sm_mnitem_get_int sm_n_mnitem_get_int sm_mnitem_get_str sm_n_mnitem_get_str sm_mnscript_load sm_mnscript_unload sm_ms_inquire sm_msg sm_msg_del sm_msg_get sm_msg_read sm_d_msg_read sm_n_msg_read sm_msgfind sm_mts_CreateInstance sm_mts_CreateProperty sm_mts_CreatePropertyGroup sm_mts_DisableCommit sm_mts_EnableCommit sm_mts_GetPropertyValue sm_mts_IsCallerInRole sm_mts_IsInTransaction sm_mts_IsSecurityEnabled sm_mts_PutPropertyValue sm_mts_SetAbort sm_mts_SetComplete sm_mus_time sm_mw_get_client_wnd sm_mw_get_cmd_show sm_mw_get_frame_wnd sm_mw_get_instance
+
+syn keyword jamLibFunc7 sm_mw_get_prev_instance sm_mw_PrintScreen sm_next_sync sm_nl sm_null sm_e_null sm_i_null sm_n_null sm_o_null sm_obj_call sm_obj_copy sm_obj_copy_id sm_obj_create sm_obj_delete sm_obj_delete_id sm_obj_get_property sm_obj_onerror sm_obj_set_property sm_obj_sort sm_obj_sort_auto sm_occur_no sm_off_gofield sm_e_off_gofield sm_i_off_gofield sm_n_off_gofield sm_o_off_gofield sm_option sm_optmnu_id sm_pinquire sm_popup_at_cur sm_prop_error sm_prop_get_int sm_prop_get_str sm_prop_get_dbl sm_prop_get_x_int sm_prop_get_x_str sm_prop_get_x_dbl sm_prop_get_m_int sm_prop_get_m_str sm_prop_get_m_dbl sm_prop_id sm_prop_name_to_id sm_prop_set_int sm_prop_set_str sm_prop_set_dbl sm_prop_set_x_int sm_prop_set_x_str sm_prop_set_x_dbl sm_prop_set_m_int sm_prop_set_m_str sm_prop_set_m_dbl sm_pset sm_putfield sm_e_putfield sm_i_putfield sm_n_putfield sm_o_putfield sm_raise_exception sm_receive sm_receive_args sm_rescreen sm_resetcrt sm_jresetcrt sm_jxresetcrt sm_resize sm_restore_data sm_return sm_return_args sm_rmformlist sm_rs_data
+
+syn keyword jamLibFunc8 sm_rw_error_message sm_rw_play_metafile sm_rw_runreport sm_s_val sm_save_data sm_sdtime sm_select sm_send sm_set_help sm_setbkstat sm_setsibling sm_setstatus sm_sh_off sm_shell sm_shrink_to_fit sm_slib_error sm_slib_install sm_slib_load sm_soption sm_strip_amt_ptr sm_e_strip_amt_ptr sm_i_strip_amt_ptr sm_n_strip_amt_ptr sm_o_strip_amt_ptr sm_sv_data sm_sv_free sm_svscreen sm_tab sm_tm_clear sm_tm_clear_model_events sm_tm_command sm_tm_command_emsgset sm_tm_command_errset sm_tm_continuation_validity sm_tm_dbi_checker sm_tm_error sm_tm_errorlog sm_tm_event sm_tm_event_name sm_tm_failure_message sm_tm_handling sm_tm_inquire sm_tm_iset sm_tm_msg_count_error sm_tm_msg_emsg sm_tm_msg_error sm_tm_old_bi_context sm_tm_pcopy sm_tm_pinquire sm_tm_pop_model_event sm_tm_pset sm_tm_push_model_event sm_tmpnam sm_tp_exec sm_tp_free_arg_buf sm_tp_gen_insert sm_tp_gen_sel_return sm_tp_gen_sel_where sm_tp_gen_val_link sm_tp_gen_val_return sm_tp_get_svc_alias sm_tp_get_tux_callid sm_translatecoords sm_tst_all_mdts
+
+syn keyword jamLibFunc9 sm_udtime sm_ungetkey sm_unload_screen sm_unsvscreen sm_upd_select sm_validate sm_n_validate sm_vinit sm_n_vinit sm_wcount sm_wdeselect sm_web_get_cookie sm_web_invoke_url sm_web_log_error sm_web_save_global sm_web_set_cookie sm_web_unsave_all_globals sm_web_unsave_global sm_mw_widget sm_mwe_widget sm_mwn_widget sm_xm_widget sm_xme_widget sm_xmn_widget sm_win_shrink sm_d_window sm_d_at_cur sm_l_window sm_l_at_cur sm_r_window sm_r_at_cur sm_winsize sm_wrotate sm_wselect sm_n_wselect sm_ww_length sm_n_ww_length sm_ww_read sm_n_ww_read sm_ww_write sm_n_ww_write sm_xlate_table sm_xm_get_base_window sm_xm_get_display
+
+syn keyword jamVariable1 SM_SCCS_ID SM_ENTERTERM SM_MALLOC SM_CANCEL SM_BADTERM SM_FNUM SM_DZERO SM_EXPONENT SM_INVDATE SM_MATHERR SM_FRMDATA SM_NOFORM SM_FRMERR SM_BADKEY SM_DUPKEY SM_ERROR SM_SP1 SM_SP2 SM_RENTRY SM_MUSTFILL SM_AFOVRFLW SM_TOO_FEW_DIGITS SM_CKDIGIT SM_HITANY SM_NOHELP SM_MAXHELP SM_OUTRANGE SM_ENTERTERM1 SM_SYSDATE SM_DATFRM SM_DATCLR SM_DATINV SM_KSDATA SM_KSERR SM_KSNONE SM_KSMORE SM_DAYA1 SM_DAYA2 SM_DAYA3 SM_DAYA4 SM_DAYA5 SM_DAYA6 SM_DAYA7 SM_DAYL1 SM_DAYL2 SM_DAYL3 SM_DAYL4 SM_DAYL5 SM_DAYL6 SM_DAYL7 SM_MNSCR_LOAD SM_MENU_INSTALL SM_INSTDEFSCRL SM_INSTSCROLL SM_MOREDATA SM_READY SM_WAIT SM_YES SM_NO SM_NOTEMP SM_FRMHELP SM_FILVER SM_ONLYONE SM_WMSMOVE SM_WMSSIZE SM_WMSOFF SM_LPRINT SM_FMODE SM_NOFILE SM_NOSECTN SM_FFORMAT SM_FREAD SM_RX1 SM_RX2 SM_RX3 SM_TABLOOK SM_MISKET SM_ILLKET SM_ILLBRA SM_MISDBLKET SM_ILLDBLKET SM_ILLDBLBRA SM_ILL_RIGHT SM_ILLELSE SM_NUMBER SM_EOT SM_BREAK SM_NOARGS SM_BIGVAR SM_EXCESS SM_EOL SM_FILEIO SM_FOR SM_RCURLY SM_NONAME SM_1JPL_ERR SM_2JPL_ERR SM_3JPL_ERR
+
+syn keyword jamVariable2 SM_JPLATCH SM_FORMAT SM_DESTINATION SM_ORAND SM_ORATOR SM_ILL_LEFT SM_MISSPARENS SM_ILLCLOSE_COMM SM_FUNCTION SM_EQUALS SM_MISMATCH SM_QUOTE SM_SYNTAX SM_NEXT SM_VERB_UNKNOWN SM_JPLFORM SM_NOT_LOADED SM_GA_FLG SM_GA_CHAR SM_GA_ARG SM_GA_DIG SM_NOFUNC SM_BADPROTO SM_JPLPUBLIC SM_NOCOMPILE SM_NULLEDIT SM_RP_NULL SM_DBI_NOT_INST SM_NOTJY SM_MAXLIB SM_FL_FLLIB SM_TPI_NOT_INST SM_RW_NOT_INST SM_MONA1 SM_MONA2 SM_MONA3 SM_MONA4 SM_MONA5 SM_MONA6 SM_MONA7 SM_MONA8 SM_MONA9 SM_MONA10 SM_MONA11 SM_MONA12 SM_MONL1 SM_MONL2 SM_MONL3 SM_MONL4 SM_MONL5 SM_MONL6 SM_MONL7 SM_MONL8 SM_MONL9 SM_MONL10 SM_MONL11 SM_MONL12 SM_AM SM_PM SM_0DEF_DTIME SM_1DEF_DTIME SM_2DEF_DTIME SM_3DEF_DTIME SM_4DEF_DTIME SM_5DEF_DTIME SM_6DEF_DTIME SM_7DEF_DTIME SM_8DEF_DTIME SM_9DEF_DTIME SM_CALC_DATE SM_BAD_DIGIT SM_BAD_YN SM_BAD_ALPHA SM_BAD_NUM SM_BAD_ALPHNUM SM_DECIMAL SM_1STATS SM_VERNO SM_DIG_ERR SM_YN_ERR SM_LET_ERR SM_NUM_ERR SM_ANUM_ERR SM_REXP_ERR SM_POSN_ERR SM_FBX_OPEN SM_FBX_WINDOW SM_FBX_SIBLING SM_OPENDIR
+
+syn keyword jamVariable3 SM_GETFILES SM_CHDIR SM_GETCWD SM_UNCLOSED_COMM SM_MB_OKLABEL SM_MB_CANCELLABEL SM_MB_YESLABEL SM_MB_NOLABEL SM_MB_RETRYLABEL SM_MB_IGNORELABEL SM_MB_ABORTLABEL SM_MB_HELPLABEL SM_MB_STOP SM_MB_QUESTION SM_MB_WARNING SM_MB_INFORMATION SM_MB_YESALLLABEL SM_0MN_CURRDEF SM_1MN_CURRDEF SM_2MN_CURRDEF SM_0DEF_CURR SM_1DEF_CURR SM_2DEF_CURR SM_3DEF_CURR SM_4DEF_CURR SM_5DEF_CURR SM_6DEF_CURR SM_7DEF_CURR SM_8DEF_CURR SM_9DEF_CURR SM_SEND_SYNTAX SM_SEND_ITEM SM_SEND_INVALID_BUNDLE SM_RECEIVE_SYNTAX SM_RECEIVE_ITEM_NUMBER SM_RECEIVE_OVERFLOW SM_RECEIVE_ITEM SM_SYNCH_RECEIVE SM_EXEC_FAIL SM_DYNA_HELP_NOT_AVAIL SM_DLL_LOAD_ERR SM_DLL_UNRESOLVED SM_DLL_VERSION_ERR SM_DLL_OPTION_ERR SM_DEMOERR SM_MB_OKALLLABEL SM_MB_NOALLLABEL SM_BADPROP SM_BETWEEN SM_ATLEAST SM_ATMOST SM_PR_ERROR SM_PR_OBJID SM_PR_OBJECT SM_PR_ITEM SM_PR_PROP SM_PR_PROP_ITEM SM_PR_PROP_VAL SM_PR_CONVERT SM_PR_OBJ_TYPE SM_PR_RANGE SM_PR_NO_SET SM_PR_BYND_SCRN SM_PR_WW_SCROLL SM_PR_NO_SYNC SM_PR_TOO_BIG SM_PR_BAD_MASK SM_EXEC_MEM_ERR
+
+syn keyword jamVariable4 SM_EXEC_NO_PROG SM_PR_NO_KEYSTRUCT SM_REOPEN_AS_SLIB SM_REOPEN_THE_SLIB SM_ERRLIB SM_WARNLIB SM_LIB_DOWNGRADE SM_OLDER SM_NEWER SM_UPGRADE SM_LIB_READONLY SM_LOPEN_ERR SM_LOPEN_WARN SM_MLOPEN_CREAT SM_MLOPEN_INIT SM_LIB_ERR SM_LIB_ISOLATE SM_LIB_NO_ERR SM_LIB_REC_ERR SM_LIB_FATAL_ERR SM_LIB_LERR_FILE SM_LIB_LERR_NOTLIB SM_LIB_LERR_BADVERS SM_LIB_LERR_FORMAT SM_LIB_LERR_BADCM SM_LIB_LERR_LOCK SM_LIB_LERR_RESERVED SM_LIB_LERR_READONLY SM_LIB_LERR_NOENTRY SM_LIB_LERR_BUSY SM_LIB_LERR_ROVERS SM_LIB_LERR_DEFAULT SM_LIB_BADCM SM_LIB_LERR_NEW SM_STANDALONE_MODE SM_FEATURE_RESTRICT FM_CH_LOST FM_JPL_PROMPT FM_YR4 FM_YR2 FM_MON FM_MON2 FM_DATE FM_DATE2 FM_HOUR FM_HOUR2 FM_MIN FM_MIN2 FM_SEC FM_SEC2 FM_YRDAY FM_AMPM FM_DAYA FM_DAYL FM_MONA FM_MONL FM_0MN_DEF_DT FM_1MN_DEF_DT FM_2MN_DEF_DT FM_DAY JM_QTERMINATE JM_HITSPACE JM_HITACK JM_NOJWIN UT_MEMERR UT_P_OPT UT_V_OPT UT_E_BINOPT UT_NO_INPUT UT_SECLONG UT_1FNAME UT_SLINE UT_FILE UT_ERROR UT_WARNING UT_MISSEQ UT_VOPT UT_M2_DESCR
+
+syn keyword jamVariable5 UT_M2_PROGNAME UT_M2_USAGE UT_M2_O_OPT UT_M2_COM UT_M2_BADTAG UT_M2_MSSQUOT UT_M2_AFTRQUOT UT_M2_DUPSECT UT_M2_BADUCLSS UT_M2_USECPRFX UT_M2_MPTYUSCT UT_M2_DUPMSGTG UT_M2_TOOLONG UT_M2_LONG UT_K2_DESCR UT_K2_PROGNAME UT_K2_USAGE UT_K2_MNEM UT_K2_NKEYDEF UT_K2_DUPKEY UT_K2_NOTFOUND UT_K2_1FNAME UT_K2_VOPT UT_K2_EXCHAR UT_V2_DESCR UT_V2_PROGNAME UT_V2_USAGE UT_V2_SLINE UT_V2_SEQUAL UT_V2_SVARNAME UT_V2_SNAME UT_V2_VOPT UT_V2_1REQ UT_CB_DESCR UT_CB_PROGNAME UT_CB_USAGE UT_CB_VOPT UT_CB_MIEXT UT_CB_AEXT UT_CB_UNKNOWN UT_CB_ISCHEME UT_CB_BKFGS UT_CB_ABGS UT_CB_REC UT_CB_GUI UT_CB_CONT UT_CB_CONTFG UT_CB_AFILE UT_CB_LEFT_QUOTE UT_CB_NO_EQUAL UT_CB_EXTRA_EQ UT_CB_BAD_LHS UT_CB_BAD_RHS UT_CB_BAD_QUOTED UT_CB_FILE UT_CB_FILE_LINE UT_CB_DUP_ALIAS UT_CB_LINE_LOOP UT_CB_BAD_STYLE UT_CB_DUP_STYLE UT_CB_NO_SECT UT_CB_DUP_SCHEME DM_ERROR DM_NODATABASE DM_NOTLOGGEDON DM_ALREADY_ON DM_ARGS_NEEDED DM_LOGON_DENIED DM_BAD_ARGS DM_BAD_CMD DM_NO_MORE_ROWS DM_ABORTED DM_NO_CURSOR DM_MANY_CURSORS DM_KEYWORD
+
+syn keyword jamVariable6 DM_INVALID_DATE DM_COMMIT DM_ROLLBACK DM_PARSE_ERROR DM_BIND_COUNT DM_BIND_VAR DM_DESC_COL DM_FETCH DM_NO_NAME DM_END_OF_PROC DM_NOCONNECTION DM_NOTSUPPORTED DM_TRAN_PEND DM_NO_TRANSACTION DM_ALREADY_INIT DM_INIT_ERROR DM_MAX_DEPTH DM_NO_PARENT DM_NO_CHILD DM_MODALITY_NOT_FOUND DM_NATIVE_NO_SUPPORT DM_NATIVE_CANCEL DM_TM_ALREADY DM_TM_IN_PROGRESS DM_TM_CLOSE_ERROR DM_TM_BAD_MODE DM_TM_BAD_CLOSE_ACTION DM_TM_INTERNAL DM_TM_MODEL_INTERNAL DM_TM_NO_ROOT DM_TM_NO_TRANSACTION DM_TM_INITIAL_MODE DM_TM_PARENT_NAME DM_TM_BAD_MEMBER DM_TM_FLD_NAM_LEN DM_TM_NO_PARENT DM_TM_BAD_REQUEST DM_TM_CANNOT_GEN_SQL DM_TM_CANNOT_EXEC_SQL DM_TM_DBI_ERROR DM_TM_DISCARD_ALL DM_TM_DISCARD_LATEST DM_TM_CALL_ERROR DM_TM_CALL_TYPE DM_TM_HOOK_MODEL DM_TM_ROOT_NAME DM_TM_TV_INVALID DM_TM_COL_NOT_FOUND DM_TM_BAD_LINK DM_TM_HOOK_MODEL_ERROR DM_TM_ONE_ROW DM_TM_SOME_ROWS DM_TM_GENERAL DM_TM_NO_HOOK DM_TM_NOSET DM_TM_TBLNAME DM_TM_PRIMARY_KEY DM_TM_INCOMPLETE_KEY DM_TM_CMD_MODE DM_TM_NO_SUCH_CMD DM_TM_NO_SUCH_SCOPE
+
+syn keyword jamVariable7 DM_TM_NO_SUCH_TV DM_TM_EVENT_LOOP DM_TM_UNSUPPORTED DM_TM_NO_MODEL DM_TM_SYNCH_SV DM_TM_WRONG_FORM DM_TM_VC_FIELD DM_TM_VC_DATE DM_TM_VC_TYPE DM_TM_BAD_CONTINUE DM_JDB_OUT_OF_MEMORY DM_JDB_DUPTABLEALIAS DM_JDB_DUPCURSORNAME DM_JDB_NODB DM_JDB_BINDCOUNT DM_JDB_NO_MORE_ROWS DM_JDB_AMBIGUOUS_COLUMN_REF DM_JDB_UNRESOLVED_COLUMN_REF DM_JDB_TABLE_READ_WRITE_CONFLICT DM_JDB_SYNTAX_ERROR DM_JDB_DUP_COLUMN_ASSIGNMENT DM_JDB_NO_MSG_FILE DM_JDB_NO_MSG DM_JDB_NOT_IMPLEMENTED DM_JDB_AGGREGATE_NOT_ALLOWED DM_JDB_TYPE_MISMATCH DM_JDB_NO_CURRENT_ROW DM_JDB_DB_CORRUPT DM_JDB_BUF_OVERFLOW DM_JDB_FILE_IO_ERR DM_JDB_BAD_HANDLE DM_JDB_DUP_TNAME DM_JDB_INVALID_TABLE_OP DM_JDB_TABLE_NOT_FOUND DM_JDB_CONVERSION_FAILED DM_JDB_INVALID_COLUMN_LIST DM_JDB_TABLE_OPEN DM_JDB_BAD_INPUT DM_JDB_DATATYPE_OVERFLOW DM_JDB_DATABASE_EXISTS DM_JDB_DATABASE_OPEN DM_JDB_DUP_CNAME DM_JDB_TMPDATABASE_ERR DM_JDB_INVALID_VALUES_COUNT DM_JDB_INVALID_COLUMN_COUNT DM_JDB_MAX_RECLEN_EXCEEDED DM_JDB_END_OF_GROUP
+
+syn keyword jamVariable8 TP_EXC_INVALID_CLIENT_COMMAND TP_EXC_INVALID_CLIENT_OPTION TP_EXC_INVALID_COMMAND TP_EXC_INVALID_COMMAND_SYNTAX TP_EXC_INVALID_CONNECTION TP_EXC_INVALID_CONTEXT TP_EXC_INVALID_FORWARD TP_EXC_INVALID_JAM_VARIABLE_REF TP_EXC_INVALID_MONITOR_COMMAND TP_EXC_INVALID_MONITOR_OPTION TP_EXC_INVALID_OPTION TP_EXC_INVALID_OPTION_VALUE TP_EXC_INVALID_SERVER_COMMAND TP_EXC_INVALID_SERVER_OPTION TP_EXC_INVALID_SERVICE TP_EXC_INVALID_TRANSACTION TP_EXC_JIF_ACCESS_FAILED TP_EXC_JIF_LOWER_VERSION TP_EXC_LOGFILE_ERROR TP_EXC_MONITOR_ERROR TP_EXC_NO_OUTSIDE_TRANSACTION TP_EXC_NO_OUTSTANDING_CALLS TP_EXC_NO_OUTSTANDING_MESSAGE TP_EXC_NO_SERVICES_ADVERTISED TP_EXC_NO_SIGNALS TP_EXC_NONTRANSACTIONAL_SERVICE TP_EXC_NONTRANSACTIONAL_ACTION TP_EXC_OUT_OF_MEMORY TP_EXC_POSTING_FAILED TP_EXC_PERMISSION_DENIED TP_EXC_REQUEST_LIMIT TP_EXC_ROLLBACK_COMMITTED TP_EXC_ROLLBACK_FAILED TP_EXC_SERVICE_FAILED TP_EXC_SERVICE_NOT_IN_JIF TP_EXC_SERVICE_PROTOCOL_ERROR TP_EXC_SUBSCRIPTION_LIMIT
+
+syn keyword jamVariable9 TP_EXC_SUBSCRIPTION_MATCH TP_EXC_SVC_ADVERTISE_LIMIT TP_EXC_SVC_WORK_OUTSTANDING TP_EXC_SVCROUTINE_MISSING TP_EXC_SVRINIT_WORK_OUTSTANDING TP_EXC_TIMEOUT TP_EXC_TRANSACTION_LIMIT TP_EXC_UNLOAD_FAILED TP_EXC_UNSUPPORTED_BUFFER TP_EXC_UNSUPPORTED_BUF_W_SUBT TP_EXC_USER_ABORT TP_EXC_WORK_OUTSTANDING TP_EXC_XA_CLOSE_FAILED TP_EXC_XA_OPEN_FAILED TP_EXC_QUEUE_BAD_MSGID TP_EXC_QUEUE_BAD_NAMESPACE TP_EXC_QUEUE_BAD_QUEUE TP_EXC_QUEUE_CANT_START_TRAN TP_EXC_QUEUE_FULL TP_EXC_QUEUE_MSG_IN_USE TP_EXC_QUEUE_NO_MSG TP_EXC_QUEUE_NOT_IN_QSPACE TP_EXC_QUEUE_RSRC_NOT_OPEN TP_EXC_QUEUE_SPACE_NOT_IN_JIF TP_EXC_QUEUE_TRAN_ABORTED TP_EXC_QUEUE_TRAN_ABSENT TP_EXC_QUEUE_UNEXPECTED TP_EXC_DCE_LOGIN_REQUIRED TP_EXC_ENC_CELL_NAME_REQUIRED TP_EXC_ENC_CONN_INFO_DIFFS TP_EXC_ENC_SVC_REGISTRY_ERROR TP_INVALID_START_ROUTINE TP_JIF_NOT_FOUND TP_JIF_OPEN_ERROR TP_NO_JIF TP_NO_MONITORS_ERROR TP_NO_SESSIONS_ERROR TP_NO_START_ROUTINE TP_ADV_SERVICE TP_ADV_SERVICE_IN_GROUP TP_PRE_SVCHDL_WINOPEN_FAILED
+
+syn keyword jamVariable10 PV_YES PV_NO TRUE FALSE TM_TRAN_NAME
+
+" jamCommentGroup allows adding matches for special things in comments
+syn cluster jamCommentGroup contains=jamTodo
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match jamSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+if !exists("c_no_utf")
+ syn match jamSpecial contained "\\\(u\x\{4}\|U\x\{8}\)"
+endif
+if exists("c_no_cformat")
+ syn region jamString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial
+else
+ syn match jamFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
+ syn match jamFormat "%%" contained
+ syn region jamString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
+ hi link jamFormat jamSpecial
+endif
+syn match jamCharacter "L\='[^\\]'"
+syn match jamCharacter "L'[^']*'" contains=jamSpecial
+syn match jamSpecialError "L\='\\[^'\"?\\abfnrtv]'"
+syn match jamSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
+syn match jamSpecialCharacter "L\='\\\o\{1,3}'"
+syn match jamSpecialCharacter "'\\x\x\{1,2}'"
+syn match jamSpecialCharacter "L'\\x\x\+'"
+
+"catch errors caused by wrong parenthesis and brackets
+syn cluster jamParenGroup contains=jamParenError,jamIncluded,jamSpecial,@jamCommentGroup,jamUserCont,jamUserLabel,jamBitField,jamCommentSkip,jamOctalZero,jamCppOut,jamCppOut2,jamCppSkip,jamFormat,jamNumber,jamFloat,jamOctal,jamOctalError,jamNumbersCom
+
+syn region jamParen transparent start='(' end=')' contains=ALLBUT,@jamParenGroup,jamErrInBracket
+syn match jamParenError "[\])]"
+syn match jamErrInParen contained "[\]{}]"
+syn region jamBracket transparent start='\[' end=']' contains=ALLBUT,@jamParenGroup,jamErrInParen
+syn match jamErrInBracket contained "[);{}]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match jamNumbers transparent "\<\d\|\,\d" contains=jamNumber,jamFloat,jamOctalError,jamOctal
+" Same, but without octal error (for comments)
+syn match jamNumbersCom contained transparent "\<\d\|\,\d" contains=jamNumber,jamFloat,jamOctal
+syn match jamNumber contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match jamNumber contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match jamOctal contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
+syn match jamOctalZero contained "\<0"
+syn match jamFloat contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match jamFloat contained "\d\+\,\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match jamFloat contained "\,\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match jamFloat contained "\d\+e[-+]\=\d\+[fl]\=\>"
+" flag an octal number with wrong digits
+syn match jamOctalError contained "0\o*[89]\d*"
+syn case match
+
+syntax match jamOperator1 "\#\#"
+syntax match jamOperator6 "/"
+syntax match jamOperator2 "+"
+syntax match jamOperator3 "*"
+syntax match jamOperator4 "-"
+syntax match jamOperator5 "|"
+syntax match jamOperator6 "/"
+syntax match jamOperator7 "&"
+syntax match jamOperator8 ":"
+syntax match jamOperator9 "<"
+syntax match jamOperator10 ">"
+syntax match jamOperator11 "!"
+syntax match jamOperator12 "%"
+syntax match jamOperator13 "^"
+syntax match jamOperator14 "@"
+
+syntax match jamCommentL "//"
+
+if exists("jam_comment_strings")
+ " A comment can contain jamString, jamCharacter and jamNumber.
+ " But a "*/" inside a jamString in a jamComment DOES end the comment! So we
+ " need to use a special type of jamString: jamCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match jamCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region jamCommentString contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=jamSpecial,jamCommentSkip
+ syntax region jamComment2String contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=jamSpecial
+ syntax region jamCommentL start="//" skip="\\$" end="$" keepend contains=@jamCommentGroup,jamComment2String,jamCharacter,jamNumbersCom,jamSpaceError
+ syntax region jamCommentL2 start="^#\|^\s\+\#" skip="\\$" end="$" keepend contains=@jamCommentGroup,jamComment2String,jamCharacter,jamNumbersCom,jamSpaceError
+ syntax region jamComment start="/\*" end="\*/" contains=@jamCommentGroup,jamCommentString,jamCharacter,jamNumbersCom,jamSpaceError
+else
+ syn region jamCommentL start="//" skip="\\$" end="$" keepend contains=@jamCommentGroup,jamSpaceError
+ syn region jamCommentL2 start="^\#\|^\s\+\#" skip="\\$" end="$" keepend contains=@jamCommentGroup,jamSpaceError
+ syn region jamComment start="/\*" end="\*/" contains=@jamCommentGroup,jamSpaceError
+endif
+
+" keep a // comment separately, it terminates a preproc. conditional
+syntax match jamCommentError "\*/"
+
+syntax match jamOperator3Error "*/"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jam_syn_inits")
+ if version < 508
+ let did_jam_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink jamCommentL jamComment
+ HiLink jamCommentL2 jamComment
+ HiLink jamOperator3Error jamError
+ HiLink jamConditional Conditional
+ HiLink jamRepeat Repeat
+ HiLink jamCharacter Character
+ HiLink jamSpecialCharacter jamSpecial
+ HiLink jamNumber Number
+ HiLink jamParenError jamError
+ HiLink jamErrInParen jamError
+ HiLink jamErrInBracket jamError
+ HiLink jamCommentError jamError
+ HiLink jamSpaceError jamError
+ HiLink jamSpecialError jamError
+ HiLink jamOperator1 jamOperator
+ HiLink jamOperator2 jamOperator
+ HiLink jamOperator3 jamOperator
+ HiLink jamOperator4 jamOperator
+ HiLink jamOperator5 jamOperator
+ HiLink jamOperator6 jamOperator
+ HiLink jamOperator7 jamOperator
+ HiLink jamOperator8 jamOperator
+ HiLink jamOperator9 jamOperator
+ HiLink jamOperator10 jamOperator
+ HiLink jamOperator11 jamOperator
+ HiLink jamOperator12 jamOperator
+ HiLink jamOperator13 jamOperator
+ HiLink jamOperator14 jamOperator
+ HiLink jamError Error
+ HiLink jamStatement Statement
+ HiLink jamPreCondit PreCondit
+ HiLink jamCommentError jamError
+ HiLink jamCommentString jamString
+ HiLink jamComment2String jamString
+ HiLink jamCommentSkip jamComment
+ HiLink jamString String
+ HiLink jamComment Comment
+ HiLink jamSpecial SpecialChar
+ HiLink jamTodo Todo
+ HiLink jamCppSkip jamCppOut
+ HiLink jamCppOut2 jamCppOut
+ HiLink jamCppOut Comment
+ HiLink jamDBState1 Identifier
+ HiLink jamDBState2 Identifier
+ HiLink jamSQLState1 jamSQL
+ HiLink jamSQLState2 jamSQL
+ HiLink jamLibFunc1 jamLibFunc
+ HiLink jamLibFunc2 jamLibFunc
+ HiLink jamLibFunc3 jamLibFunc
+ HiLink jamLibFunc4 jamLibFunc
+ HiLink jamLibFunc5 jamLibFunc
+ HiLink jamLibFunc6 jamLibFunc
+ HiLink jamLibFunc7 jamLibFunc
+ HiLink jamLibFunc8 jamLibFunc
+ HiLink jamLibFunc9 jamLibFunc
+ HiLink jamVariable1 jamVariablen
+ HiLink jamVariable2 jamVariablen
+ HiLink jamVariable3 jamVariablen
+ HiLink jamVariable4 jamVariablen
+ HiLink jamVariable5 jamVariablen
+ HiLink jamVariable6 jamVariablen
+ HiLink jamVariable7 jamVariablen
+ HiLink jamVariable8 jamVariablen
+ HiLink jamVariable9 jamVariablen
+ HiLink jamVariable10 jamVariablen
+ HiLink jamVariablen Constant
+ HiLink jamSQL Type
+ HiLink jamLibFunc PreProc
+ HiLink jamOperator Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "jam"
+
+" vim: ts=8
diff --git a/runtime/syntax/jargon.vim b/runtime/syntax/jargon.vim
new file mode 100644
index 000000000..25a88bc98
--- /dev/null
+++ b/runtime/syntax/jargon.vim
@@ -0,0 +1,36 @@
+" Vim syntax file
+" Language: Jargon File
+" Maintainer: <rms@poczta.onet.pl>
+" Last Change: 2001 May 26
+"
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match jargonChaptTitle /:[^:]*:/
+syn match jargonEmailAddr /[^<@ ^I]*@[^ ^I>]*/
+syn match jargonUrl +\(http\|ftp\)://[^\t )"]*+
+syn match jargonMark /{[^}]*}/
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jargon_syntax_inits")
+ if version < 508
+ let did_jargon_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink jargonChaptTitle Title
+ HiLink jargonEmailAddr Comment
+ HiLink jargonUrl Comment
+ HiLink jargonMark Label
+ delcommand HiLink
+endif
+
+let b:current_syntax = "jargon"
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
new file mode 100644
index 000000000..b47c17e69
--- /dev/null
+++ b/runtime/syntax/java.vim
@@ -0,0 +1,334 @@
+" Vim syntax file
+" Language: Java
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/java.vim
+" Last Change: 2004 Apr 23
+
+" Please check :help java.vim for comments on some of the options available.
+
+" Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ " we define it here so that included files can test for it
+ let main_syntax='java'
+endif
+
+" don't use standard HiLink, it will not work with included syntax files
+if version < 508
+ command! -nargs=+ JavaHiLink hi link <args>
+else
+ command! -nargs=+ JavaHiLink hi def link <args>
+endif
+
+" some characters that cannot be in a java program (outside a string)
+syn match javaError "[\\@`]"
+syn match javaError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
+syn match javaOK "\.\.\."
+
+" use separate name so that it can be deleted in javacc.vim
+syn match javaError2 "#\|=<"
+JavaHiLink javaError2 javaError
+
+
+
+" keyword definitions
+syn keyword javaExternal native package
+syn match javaExternal "\<import\(\s\+static\>\)\?"
+syn keyword javaError goto const
+syn keyword javaConditional if else switch
+syn keyword javaRepeat while for do
+syn keyword javaBoolean true false
+syn keyword javaConstant null
+syn keyword javaTypedef this super
+syn keyword javaOperator new instanceof
+syn keyword javaType boolean char byte short int long float double
+syn keyword javaType void
+syn keyword javaStatement return
+syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable
+syn keyword javaExceptions throw try catch finally
+syn keyword javaAssert assert
+syn keyword javaMethodDecl synchronized throws
+syn keyword javaClassDecl extends implements interface
+" to differentiate the keyword class from MyClass.class we use a match here
+syn match javaTypedef "\.\s*\<class\>"ms=s+1
+syn keyword javaClassDecl enum
+syn match javaClassDecl "^class\>"
+syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1
+syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite
+syn match javaUserLabelRef "\k\+" contained
+syn keyword javaScopeDecl public protected private abstract
+
+if exists("java_highlight_java_lang_ids") || exists("java_highlight_java_lang") || exists("java_highlight_all")
+ " java.lang.*
+ syn match javaLangClass "\<System\>"
+ syn keyword javaLangClass Cloneable Comparable Runnable Boolean Byte Class
+ syn keyword javaLangClass Character CharSequence ClassLoader Compiler Double Float
+ syn keyword javaLangClass Integer InheritableThreadLocal Long Math Number Object Package Process
+ syn keyword javaLangClass Runtime RuntimePermission InheritableThreadLocal
+ syn keyword javaLangClass SecurityManager Short String StrictMath StackTraceElement
+ syn keyword javaLangClass StringBuffer Thread ThreadGroup
+ syn keyword javaLangClass ThreadLocal Throwable Void ArithmeticException
+ syn keyword javaLangClass ArrayIndexOutOfBoundsException AssertionError
+ syn keyword javaLangClass ArrayStoreException ClassCastException
+ syn keyword javaLangClass ClassNotFoundException
+ syn keyword javaLangClass CloneNotSupportedException Exception
+ syn keyword javaLangClass IllegalAccessException
+ syn keyword javaLangClass IllegalArgumentException
+ syn keyword javaLangClass IllegalMonitorStateException
+ syn keyword javaLangClass IllegalStateException
+ syn keyword javaLangClass IllegalThreadStateException
+ syn keyword javaLangClass IndexOutOfBoundsException
+ syn keyword javaLangClass InstantiationException InterruptedException
+ syn keyword javaLangClass NegativeArraySizeException NoSuchFieldException
+ syn keyword javaLangClass NoSuchMethodException NullPointerException
+ syn keyword javaLangClass NumberFormatException RuntimeException
+ syn keyword javaLangClass SecurityException StringIndexOutOfBoundsException
+ syn keyword javaLangClass UnsupportedOperationException
+ syn keyword javaLangClass AbstractMethodError ClassCircularityError
+ syn keyword javaLangClass ClassFormatError Error ExceptionInInitializerError
+ syn keyword javaLangClass IllegalAccessError InstantiationError
+ syn keyword javaLangClass IncompatibleClassChangeError InternalError
+ syn keyword javaLangClass LinkageError NoClassDefFoundError
+ syn keyword javaLangClass NoSuchFieldError NoSuchMethodError
+ syn keyword javaLangClass OutOfMemoryError StackOverflowError
+ syn keyword javaLangClass ThreadDeath UnknownError UnsatisfiedLinkError
+ syn keyword javaLangClass UnsupportedClassVersionError VerifyError
+ syn keyword javaLangClass VirtualMachineError
+ syn keyword javaLangObject clone equals finalize getClass hashCode
+ syn keyword javaLangObject notify notifyAll toString wait
+ JavaHiLink javaLangClass javaConstant
+ JavaHiLink javaLangObject javaConstant
+ syn cluster javaTop add=javaLangObject,javaLangClass
+ syn cluster javaClasses add=javaLangClass
+endif
+
+if filereadable(expand("<sfile>:p:h")."/javaid.vim")
+ source <sfile>:p:h/javaid.vim
+endif
+
+if exists("java_space_errors")
+ if !exists("java_no_trail_space_error")
+ syn match javaSpaceError "\s\+$"
+ endif
+ if !exists("java_no_tab_space_error")
+ syn match javaSpaceError " \+\t"me=e-1
+ endif
+endif
+
+syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter
+syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel
+syn keyword javaLabel default
+
+if !exists("java_allow_cpp_keywords")
+ syn keyword javaError auto delete extern friend inline redeclared
+ syn keyword javaError register signed sizeof struct template typedef union
+ syn keyword javaError unsigned operator
+endif
+
+" The following cluster contains all java groups except the contained ones
+syn cluster javaTop add=javaExternal,javaError,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaScopeDecl,javaError,javaError2,javaUserLabel,javaLangObject
+
+
+" Comments
+syn keyword javaTodo contained TODO FIXME XXX
+if exists("java_comment_strings")
+ syn region javaCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=javaSpecial,javaCommentStar,javaSpecialChar,@Spell
+ syn region javaComment2String contained start=+"+ end=+$\|"+ contains=javaSpecial,javaSpecialChar,@Spell
+ syn match javaCommentCharacter contained "'\\[^']\{1,6\}'" contains=javaSpecialChar
+ syn match javaCommentCharacter contained "'\\''" contains=javaSpecialChar
+ syn match javaCommentCharacter contained "'[^\\]'"
+ syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber
+ syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber
+endif
+syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell
+syn match javaCommentStar contained "^\s*\*[^/]"me=e-1
+syn match javaCommentStar contained "^\s*\*$"
+syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,@Spell
+JavaHiLink javaCommentString javaString
+JavaHiLink javaComment2String javaString
+JavaHiLink javaCommentCharacter javaCharacter
+
+syn cluster javaTop add=javaComment,javaLineComment
+
+if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
+ syntax case ignore
+ " syntax coloring for javadoc comments (HTML)
+ syntax include @javaHtml <sfile>:p:h/html.vim
+ unlet b:current_syntax
+ syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaTodo,@Spell
+ syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags
+
+ syn region javaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
+ syn match javaDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
+ syn match javaDocParam contained "\s\S\+"
+ syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
+ syntax case match
+endif
+
+" match the special comment /**/
+syn match javaComment "/\*\*/"
+
+" Strings and constants
+syn match javaSpecialError contained "\\."
+syn match javaSpecialCharError contained "[^']"
+syn match javaSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
+syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaSpecialError,@Spell
+" next line disabled, it can cause a crash for a long line
+"syn match javaStringError +"\([^"\\]\|\\.\)*$+
+syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
+syn match javaCharacter "'\\''" contains=javaSpecialChar
+syn match javaCharacter "'[^\\]'"
+syn match javaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match javaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match javaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match javaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+" unicode characters
+syn match javaSpecial "\\u\d\{4\}"
+
+syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStringError
+
+if exists("java_highlight_functions")
+ if java_highlight_functions == "indent"
+ syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
+ syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
+ syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
+ syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
+ else
+ " This line catches method declarations at any indentation>0, but it assumes
+ " two things:
+ " 1. class names are always capitalized (ie: Button)
+ " 2. method names are never capitalized (except constructors, of course)
+ syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses
+ endif
+ syn match javaBraces "[{}]"
+ syn cluster javaTop add=javaFuncDef,javaBraces
+endif
+
+if exists("java_highlight_debug")
+
+ " Strings and constants
+ syn match javaDebugSpecial contained "\\\d\d\d\|\\."
+ syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial
+ syn match javaDebugStringError +"\([^"\\]\|\\.\)*$+
+ syn match javaDebugCharacter contained "'[^\\]'"
+ syn match javaDebugSpecialCharacter contained "'\\.'"
+ syn match javaDebugSpecialCharacter contained "'\\''"
+ syn match javaDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+ syn match javaDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+ syn match javaDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+ syn match javaDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+ syn keyword javaDebugBoolean contained true false
+ syn keyword javaDebugType contained null this super
+ syn region javaDebugParen start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen
+
+ " to make this work you must define the highlighting for these groups
+ syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
+ syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
+ syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
+
+ syn cluster javaTop add=javaDebug
+
+ if version >= 508 || !exists("did_c_syn_inits")
+ JavaHiLink javaDebug Debug
+ JavaHiLink javaDebugString DebugString
+ JavaHiLink javaDebugStringError javaError
+ JavaHiLink javaDebugType DebugType
+ JavaHiLink javaDebugBoolean DebugBoolean
+ JavaHiLink javaDebugNumber Debug
+ JavaHiLink javaDebugSpecial DebugSpecial
+ JavaHiLink javaDebugSpecialCharacter DebugSpecial
+ JavaHiLink javaDebugCharacter DebugString
+ JavaHiLink javaDebugParen Debug
+
+ JavaHiLink DebugString String
+ JavaHiLink DebugSpecial Special
+ JavaHiLink DebugBoolean Boolean
+ JavaHiLink DebugType Type
+ endif
+endif
+
+if exists("java_mark_braces_in_parens_as_errors")
+ syn match javaInParen contained "[{}]"
+ JavaHiLink javaInParen javaError
+ syn cluster javaTop add=javaInParen
+endif
+
+" catch errors caused by wrong parenthesis
+syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1
+syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained
+syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained
+syn match javaParenError ")"
+JavaHiLink javaParenError javaError
+
+if !exists("java_minlines")
+ let java_minlines = 10
+endif
+exec "syn sync ccomment javaComment minlines=" . java_minlines
+
+" The default highlighting.
+if version >= 508 || !exists("did_java_syn_inits")
+ if version < 508
+ let did_java_syn_inits = 1
+ endif
+ JavaHiLink javaFuncDef Function
+ JavaHiLink javaBraces Function
+ JavaHiLink javaBranch Conditional
+ JavaHiLink javaUserLabelRef javaUserLabel
+ JavaHiLink javaLabel Label
+ JavaHiLink javaUserLabel Label
+ JavaHiLink javaConditional Conditional
+ JavaHiLink javaRepeat Repeat
+ JavaHiLink javaExceptions Exception
+ JavaHiLink javaAssert Statement
+ JavaHiLink javaStorageClass StorageClass
+ JavaHiLink javaMethodDecl javaStorageClass
+ JavaHiLink javaClassDecl javaStorageClass
+ JavaHiLink javaScopeDecl javaStorageClass
+ JavaHiLink javaBoolean Boolean
+ JavaHiLink javaSpecial Special
+ JavaHiLink javaSpecialError Error
+ JavaHiLink javaSpecialCharError Error
+ JavaHiLink javaString String
+ JavaHiLink javaCharacter Character
+ JavaHiLink javaSpecialChar SpecialChar
+ JavaHiLink javaNumber Number
+ JavaHiLink javaError Error
+ JavaHiLink javaStringError Error
+ JavaHiLink javaStatement Statement
+ JavaHiLink javaOperator Operator
+ JavaHiLink javaComment Comment
+ JavaHiLink javaDocComment Comment
+ JavaHiLink javaLineComment Comment
+ JavaHiLink javaConstant Constant
+ JavaHiLink javaTypedef Typedef
+ JavaHiLink javaTodo Todo
+
+ JavaHiLink javaCommentTitle SpecialComment
+ JavaHiLink javaDocTags Special
+ JavaHiLink javaDocParam Function
+ JavaHiLink javaCommentStar javaComment
+
+ JavaHiLink javaType Type
+ JavaHiLink javaExternal Include
+
+ JavaHiLink htmlComment Special
+ JavaHiLink htmlCommentPart Special
+ JavaHiLink javaSpaceError Error
+endif
+
+delcommand JavaHiLink
+
+let b:current_syntax = "java"
+
+if main_syntax == 'java'
+ unlet main_syntax
+endif
+
+let b:spell_options="contained"
+
+" vim: ts=8
diff --git a/runtime/syntax/javacc.vim b/runtime/syntax/javacc.vim
new file mode 100644
index 000000000..57c57b568
--- /dev/null
+++ b/runtime/syntax/javacc.vim
@@ -0,0 +1,77 @@
+" Vim syntax file
+" Language: JavaCC, a Java Compiler Compiler written by JavaSoft
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/javacc.vim
+" Last Change: 2001 Jun 20
+
+" Uses java.vim, and adds a few special things for JavaCC Parser files.
+" Those files usually have the extension *.jj
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" source the java.vim file
+if version < 600
+ source <sfile>:p:h/java.vim
+else
+ runtime! syntax/java.vim
+endif
+unlet b:current_syntax
+
+"remove catching errors caused by wrong parenthesis (does not work in javacc
+"files) (first define them in case they have not been defined in java)
+syn match javaParen "--"
+syn match javaParenError "--"
+syn match javaInParen "--"
+syn match javaError2 "--"
+syn clear javaParen
+syn clear javaParenError
+syn clear javaInParen
+syn clear javaError2
+
+" remove function definitions (they look different) (first define in
+" in case it was not defined in java.vim)
+"syn match javaFuncDef "--"
+syn clear javaFuncDef
+syn match javaFuncDef "[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)[ \t]*:" contains=javaType
+
+syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANAGER
+syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK
+syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING
+syn keyword javaccPackages USER_TOKEN_MANAGER USER_CHAR_STREAM JAVA_UNICODE_ESCAPE
+syn keyword javaccPackages UNICODE_INPUT
+syn match javaccPackages "PARSER_END([^)]*)"
+syn match javaccPackages "PARSER_BEGIN([^)]*)"
+syn match javaccSpecToken "<EOF>"
+" the dot is necessary as otherwise it will be matched as a keyword.
+syn match javaccSpecToken ".LOOKAHEAD("ms=s+1,me=e-1
+syn match javaccToken "<[^> \t]*>"
+syn keyword javaccActionToken TOKEN SKIP MORE SPECIAL_TOKEN
+syn keyword javaccError DEBUG IGNORE_IN_BNF
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_css_syn_inits")
+ if version < 508
+ let did_css_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink javaccSpecToken Statement
+ HiLink javaccActionToken Type
+ HiLink javaccPackages javaScopeDecl
+ HiLink javaccToken String
+ HiLink javaccError Error
+ delcommand HiLink
+endif
+
+let b:current_syntax = "javacc"
+
+" vim: ts=8
diff --git a/runtime/syntax/javascript.vim b/runtime/syntax/javascript.vim
new file mode 100644
index 000000000..a037496bb
--- /dev/null
+++ b/runtime/syntax/javascript.vim
@@ -0,0 +1,111 @@
+" Vim syntax file
+" Language: JavaScript
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/javascript.vim
+" Last Change: 2004 May 16
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+" tuning parameters:
+" unlet javaScript_fold
+
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'javascript'
+endif
+
+" Drop fold if it set but vim doesn't support it.
+if version < 600 && exists("javaScript_fold")
+ unlet javaScript_fold
+endif
+
+syn case ignore
+
+
+syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
+syn match javaScriptLineComment "\/\/.*$" contains=javaScriptCommentTodo
+syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
+syn region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo
+syn match javaScriptSpecial "\\\d\d\d\|\\."
+syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
+syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
+syn match javaScriptSpecialCharacter "'\\.'"
+syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn region javaScriptRegexpString start=+/+ skip=+\\\\\|\\/+ end=+/[gi]\?\s*$+ end=+/[gi]\?\s*[;,)]+me=e-1 contains=@htmlPreproc oneline
+syn keyword javaScriptConditional if else
+syn keyword javaScriptRepeat while for
+syn keyword javaScriptBranch break continue switch case default
+syn keyword javaScriptOperator new in
+syn keyword javaScriptType this var const
+syn keyword javaScriptStatement return with
+syn keyword javaScriptBoolean true false
+
+if exists("javaScript_fold")
+ syn match javaScriptFunction "\<function\>"
+ syn region javaScriptFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
+
+ syn sync match javaScriptSync grouphere javaScriptFunctionFold "\<function\>"
+ syn sync match javaScriptSync grouphere NONE "^}"
+
+ setlocal foldmethod=syntax
+ setlocal foldtext=getline(v:foldstart)
+else
+ syn keyword javaScriptFunction function
+ syn match javaScriptBraces "[{}]"
+endif
+
+syn sync fromstart
+syn sync maxlines=100
+
+" catch errors caused by wrong parenthesis
+syn region javaScriptParen transparent start="(" end=")" contains=javaScriptParen,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptBoolean,javaScriptBraces
+syn match javaScrParenError ")"
+
+if main_syntax == "javascript"
+ syn sync ccomment javaScriptComment
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_javascript_syn_inits")
+ if version < 508
+ let did_javascript_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink javaScriptComment Comment
+ HiLink javaScriptLineComment Comment
+ HiLink javaScriptCommentTodo Todo
+ HiLink javaScriptSpecial Special
+ HiLink javaScriptStringS String
+ HiLink javaScriptStringD String
+ HiLink javaScriptCharacter Character
+ HiLink javaScriptSpecialCharacter javaScriptSpecial
+ HiLink javaScriptNumber javaScriptValue
+ HiLink javaScriptConditional Conditional
+ HiLink javaScriptRepeat Repeat
+ HiLink javaScriptBranch Conditional
+ HiLink javaScriptOperator Operator
+ HiLink javaScriptType Type
+ HiLink javaScriptStatement Statement
+ HiLink javaScriptFunction Function
+ HiLink javaScriptBraces Function
+ HiLink javaScriptError Error
+ HiLink javaScrParenError javaScriptError
+ HiLink javaScriptBoolean Boolean
+ HiLink javaScriptRegexpString String
+ delcommand HiLink
+endif
+
+let b:current_syntax = "javascript"
+if main_syntax == 'javascript'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/jess.vim b/runtime/syntax/jess.vim
new file mode 100644
index 000000000..243bab351
--- /dev/null
+++ b/runtime/syntax/jess.vim
@@ -0,0 +1,161 @@
+" Vim syntax file
+" Language: Jess
+" Maintainer: Paul Baleme <pbaleme@mail.com>
+" Last change: September 14, 2000
+" Based on lisp.vim by : Dr. Charles E. Campbell, Jr.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version < 600
+ set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
+else
+ setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
+endif
+
+" Lists
+syn match jessSymbol ![^()'`,"; \t]\+! contained
+syn match jessBarSymbol !|..\{-}|! contained
+syn region jessList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=jessAtom,jessBQList,jessConcat,jessDeclaration,jessList,jessNumber,jessSymbol,jessSpecial,jessFunc,jessKey,jessAtomMark,jessString,jessComment,jessBarSymbol,jessAtomBarSymbol,jessVar
+syn region jessBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=jessAtom,jessBQList,jessConcat,jessDeclaration,jessList,jessNumber,jessSpecial,jessSymbol,jessFunc,jessKey,jessVar,jessAtomMark,jessString,jessComment,jessBarSymbol,jessAtomBarSymbol
+
+" Atoms
+syn match jessAtomMark "'"
+syn match jessAtom "'("me=e-1 contains=jessAtomMark nextgroup=jessAtomList
+syn match jessAtom "'[^ \t()]\+" contains=jessAtomMark
+syn match jessAtomBarSymbol !'|..\{-}|! contains=jessAtomMark
+syn region jessAtom start=+'"+ skip=+\\"+ end=+"+
+syn region jessAtomList matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contained contains=jessAtomList,jessAtomNmbr0,jessString,jessComment,jessAtomBarSymbol
+syn match jessAtomNmbr "\<[0-9]\+" contained
+
+" Standard jess Functions and Macros
+syn keyword jessFunc * + ** - / < > <= >= <> =
+syn keyword jessFunc long longp
+syn keyword jessFunc abs agenda and
+syn keyword jessFunc assert assert-string bag
+syn keyword jessFunc batch bind bit-and
+syn keyword jessFunc bit-not bit-or bload
+syn keyword jessFunc bsave build call
+syn keyword jessFunc clear clear-storage close
+syn keyword jessFunc complement$ context count-query-results
+syn keyword jessFunc create$
+syn keyword jessFunc delete$ div
+syn keyword jessFunc do-backward-chaining e
+syn keyword jessFunc engine eq eq*
+syn keyword jessFunc eval evenp exit
+syn keyword jessFunc exp explode$ external-addressp
+syn keyword jessFunc fact-slot-value facts fetch
+syn keyword jessFunc first$ float floatp
+syn keyword jessFunc foreach format gensym*
+syn keyword jessFunc get get-fact-duplication
+syn keyword jessFunc get-member get-multithreaded-io
+syn keyword jessFunc get-reset-globals get-salience-evaluation
+syn keyword jessFunc halt if implode$
+syn keyword jessFunc import insert$ integer
+syn keyword jessFunc integerp intersection$ jess-version-number
+syn keyword jessFunc jess-version-string length$
+syn keyword jessFunc lexemep list-function$ load-facts
+syn keyword jessFunc load-function load-package log
+syn keyword jessFunc log10 lowcase matches
+syn keyword jessFunc max member$ min
+syn keyword jessFunc mod modify multifieldp
+syn keyword jessFunc neq new not
+syn keyword jessFunc nth$ numberp oddp
+syn keyword jessFunc open or pi
+syn keyword jessFunc ppdeffunction ppdefglobal ddpefrule
+syn keyword jessFunc printout random read
+syn keyword jessFunc readline replace$ reset
+syn keyword jessFunc rest$ retract retract-string
+syn keyword jessFunc return round rules
+syn keyword jessFunc run run-query run-until-halt
+syn keyword jessFunc save-facts set set-fact-duplication
+syn keyword jessFunc set-factory set-member set-multithreaded-io
+syn keyword jessFunc set-node-index-hash set-reset-globals
+syn keyword jessFunc set-salience-evaluation set-strategy
+syn keyword jessFunc setgen show-deffacts show-deftemplates
+syn keyword jessFunc show-jess-listeners socket
+syn keyword jessFunc sqrt store str-cat
+syn keyword jessFunc str-compare str-index str-length
+syn keyword jessFunc stringp sub-string subseq$
+syn keyword jessFunc subsetp sym-cat symbolp
+syn keyword jessFunc system throw time
+syn keyword jessFunc try undefadvice undefinstance
+syn keyword jessFunc undefrule union$ unwatch
+syn keyword jessFunc upcase view watch
+syn keyword jessFunc while
+syn match jessFunc "\<c[ad]\+r\>"
+
+" jess Keywords (modifiers)
+syn keyword jessKey defglobal deffunction defrule
+syn keyword jessKey deffacts
+syn keyword jessKey defadvice defclass definstance
+
+" Standard jess Variables
+syn region jessVar start="?" end="[^a-zA-Z0-9]"me=e-1
+
+" Strings
+syn region jessString start=+"+ skip=+\\"+ end=+"+
+
+" Shared with Declarations, Macros, Functions
+"syn keyword jessDeclaration
+
+syn match jessNumber "[0-9]\+"
+
+syn match jessSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*"
+syn match jessSpecial !#|[^()'`,"; \t]\+|#!
+syn match jessSpecial !#x[0-9a-fA-F]\+!
+syn match jessSpecial !#o[0-7]\+!
+syn match jessSpecial !#b[01]\+!
+syn match jessSpecial !#\\[ -\~]!
+syn match jessSpecial !#[':][^()'`,"; \t]\+!
+syn match jessSpecial !#([^()'`,"; \t]\+)!
+
+syn match jessConcat "\s\.\s"
+syntax match jessParenError ")"
+
+" Comments
+syn match jessComment ";.*$"
+
+" synchronization
+syn sync lines=100
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jess_syntax_inits")
+ if version < 508
+ let did_jess_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink jessAtomNmbr jessNumber
+ HiLink jessAtomMark jessMark
+
+ HiLink jessAtom Identifier
+ HiLink jessAtomBarSymbol Special
+ HiLink jessBarSymbol Special
+ HiLink jessComment Comment
+ HiLink jessConcat Statement
+ HiLink jessDeclaration Statement
+ HiLink jessFunc Statement
+ HiLink jessKey Type
+ HiLink jessMark Delimiter
+ HiLink jessNumber Number
+ HiLink jessParenError Error
+ HiLink jessSpecial Type
+ HiLink jessString String
+ HiLink jessVar Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "jess"
+
+" vim: ts=18
diff --git a/runtime/syntax/jgraph.vim b/runtime/syntax/jgraph.vim
new file mode 100644
index 000000000..7ecd5afae
--- /dev/null
+++ b/runtime/syntax/jgraph.vim
@@ -0,0 +1,58 @@
+" Vim syntax file
+" Language: jgraph (graph plotting utility)
+" Maintainer: Jonas Munsin jmunsin@iki.fi
+" Last Change: 2003 May 04
+" this syntax file is not yet complete
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+" comments
+syn region jgraphComment start="(\* " end=" \*)"
+
+syn keyword jgraphCmd newcurve newgraph marktype
+syn keyword jgraphType xaxis yaxis
+
+syn keyword jgraphType circle box diamond triangle x cross ellipse
+syn keyword jgraphType xbar ybar text postscript eps none general
+
+syn keyword jgraphType solid dotted dashed longdash dotdash dodotdash
+syn keyword jgraphType dotdotdashdash pts
+
+"integer number, or floating point number without a dot. - or no -
+syn match jgraphNumber "\<-\=\d\+\>"
+"floating point number, with dot - or no -
+syn match jgraphNumber "\<-\=\d\+\.\d*\>"
+"floating point number, starting with a dot - or no -
+syn match jgraphNumber "\-\=\.\d\+\>"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jgraph_syn_inits")
+ if version < 508
+ let did_jgraph_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink jgraphComment Comment
+ HiLink jgraphCmd Identifier
+ HiLink jgraphType Type
+ HiLink jgraphNumber Number
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "jgraph"
diff --git a/runtime/syntax/jproperties.vim b/runtime/syntax/jproperties.vim
new file mode 100644
index 000000000..9343bd292
--- /dev/null
+++ b/runtime/syntax/jproperties.vim
@@ -0,0 +1,148 @@
+" Vim syntax file
+" Language: Java Properties resource file (*.properties[_*])
+" Maintainer: Simon Baldwin <simonb@sco.com>
+" Last change: 26th Mar 2000
+
+" =============================================================================
+
+" Optional and tuning variables:
+
+" jproperties_lines
+" -----------------
+" Set a value for the sync block that we use to find long continuation lines
+" in properties; the value is already large - if you have larger continuation
+" sets you may need to increase it further - if not, and you find editing is
+" slow, reduce the value of jproperties_lines.
+if !exists("jproperties_lines")
+ let jproperties_lines = 256
+endif
+
+" jproperties_strict_syntax
+" -------------------------
+" Most properties files assign values with "id=value" or "id:value". But,
+" strictly, the Java properties parser also allows "id value", "id", and
+" even more bizarrely "=value", ":value", " value", and so on. These latter
+" ones, however, are rarely used, if ever, and handling them in the high-
+" lighting can obscure errors in the more normal forms. So, in practice
+" we take special efforts to pick out only "id=value" and "id:value" forms
+" by default. If you want strict compliance, set jproperties_strict_syntax
+" to non-zero (and good luck).
+if !exists("jproperties_strict_syntax")
+ let jproperties_strict_syntax = 0
+endif
+
+" jproperties_show_messages
+" -------------------------
+" If this properties file contains messages for use with MessageFormat,
+" setting a non-zero value will highlight them. Messages are of the form
+" "{...}". Highlighting doesn't go to the pains of picking apart what is
+" in the format itself - just the basics for now.
+if !exists("jproperties_show_messages")
+ let jproperties_show_messages = 0
+endif
+
+" =============================================================================
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" switch case sensitivity off
+syn case ignore
+
+" set the block
+exec "syn sync lines=" . jproperties_lines
+
+" switch between 'normal' and 'strict' syntax
+if jproperties_strict_syntax != 0
+
+ " an assignment is pretty much any non-empty line at this point,
+ " trying to not think about continuation lines
+ syn match jpropertiesAssignment "^\s*[^[:space:]]\+.*$" contains=jpropertiesIdentifier
+
+ " an identifier is anything not a space character, pretty much; it's
+ " followed by = or :, or space or tab. Or end-of-line.
+ syn match jpropertiesIdentifier "[^=:[:space:]]*" contained nextgroup=jpropertiesDelimiter
+
+ " treat the delimiter specially to get colours right
+ syn match jpropertiesDelimiter "\s*[=:[:space:]]\s*" contained nextgroup=jpropertiesString
+
+ " catch the bizarre case of no identifier; a special case of delimiter
+ syn match jpropertiesEmptyIdentifier "^\s*[=:]\s*" nextgroup=jpropertiesString
+else
+
+ " here an assignment is id=value or id:value, and we conveniently
+ " ignore continuation lines for the present
+ syn match jpropertiesAssignment "^\s*[^=:[:space:]]\+\s*[=:].*$" contains=jpropertiesIdentifier
+
+ " an identifier is anything not a space character, pretty much; it's
+ " always followed by = or :, and we find it in an assignment
+ syn match jpropertiesIdentifier "[^=:[:space:]]\+" contained nextgroup=jpropertiesDelimiter
+
+ " treat the delimiter specially to get colours right; this time the
+ " delimiter must contain = or :
+ syn match jpropertiesDelimiter "\s*[=:]\s*" contained nextgroup=jpropertiesString
+endif
+
+" a definition is all up to the last non-\-terminated line; strictly, Java
+" properties tend to ignore leading whitespace on all lines of a multi-line
+" definition, but we don't look for that here (because it's a major hassle)
+syn region jpropertiesString start="" skip="\\$" end="$" contained contains=jpropertiesSpecialChar,jpropertiesError,jpropertiesSpecial
+
+" {...} is a Java Message formatter - add a minimal recognition of these
+" if required
+if jproperties_show_messages != 0
+ syn match jpropertiesSpecial "{[^}]*}\{-1,\}" contained
+ syn match jpropertiesSpecial "'{" contained
+ syn match jpropertiesSpecial "''" contained
+endif
+
+" \uABCD are unicode special characters
+syn match jpropertiesSpecialChar "\\u\x\{1,4}" contained
+
+" ...and \u not followed by a hex digit is an error, though the properties
+" file parser won't issue an error on it, just set something wacky like zero
+syn match jpropertiesError "\\u\X\{1,4}" contained
+syn match jpropertiesError "\\u$"me=e-1 contained
+
+" other things of note are the \t,r,n,\, and the \ preceding line end
+syn match jpropertiesSpecial "\\[trn\\]" contained
+syn match jpropertiesSpecial "\\\s" contained
+syn match jpropertiesSpecial "\\$" contained
+
+" comments begin with # or !, and persist to end of line; put here since
+" they may have been caught by patterns above us
+syn match jpropertiesComment "^\s*[#!].*$" contains=jpropertiesTODO
+syn keyword jpropertiesTodo TODO FIXME XXX contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jproperties_syntax_inits")
+ if version < 508
+ let did_jproperties_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink jpropertiesComment Comment
+ HiLink jpropertiesTodo Todo
+ HiLink jpropertiesIdentifier Identifier
+ HiLink jpropertiesString String
+ HiLink jpropertiesExtendString String
+ HiLink jpropertiesCharacter Character
+ HiLink jpropertiesSpecial Special
+ HiLink jpropertiesSpecialChar SpecialChar
+ HiLink jpropertiesError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "jproperties"
+
+" vim:ts=8
diff --git a/runtime/syntax/jsp.vim b/runtime/syntax/jsp.vim
new file mode 100644
index 000000000..523c8e31e
--- /dev/null
+++ b/runtime/syntax/jsp.vim
@@ -0,0 +1,84 @@
+" Vim syntax file
+" Language: JSP (Java Server Pages)
+" Maintainer: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
+" URL: http://rgarciasuarez.free.fr/vim/syntax/jsp.vim
+" Last change: 2004 Feb 02
+" Credits : Patch by Darren Greaves (recognizes <jsp:...> tags)
+" Patch by Thomas Kimpton (recognizes jspExpr inside HTML tags)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'jsp'
+endif
+
+" Source HTML syntax
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+unlet b:current_syntax
+
+" Next syntax items are case-sensitive
+syn case match
+
+" Include Java syntax
+syn include @jspJava <sfile>:p:h/java.vim
+
+syn region jspScriptlet matchgroup=jspTag start=/<%/ keepend end=/%>/ contains=@jspJava
+syn region jspComment start=/<%--/ end=/--%>/
+syn region jspDecl matchgroup=jspTag start=/<%!/ keepend end=/%>/ contains=@jspJava
+syn region jspExpr matchgroup=jspTag start=/<%=/ keepend end=/%>/ contains=@jspJava
+syn region jspDirective start=/<%@/ end=/%>/ contains=htmlString,jspDirName,jspDirArg
+
+syn keyword jspDirName contained include page taglib
+syn keyword jspDirArg contained file uri prefix language extends import session buffer autoFlush
+syn keyword jspDirArg contained isThreadSafe info errorPage contentType isErrorPage
+syn region jspCommand start=/<jsp:/ start=/<\/jsp:/ keepend end=/>/ end=/\/>/ contains=htmlString,jspCommandName,jspCommandArg
+syn keyword jspCommandName contained include forward getProperty plugin setProperty useBean param params fallback
+syn keyword jspCommandArg contained id scope class type beanName page flush name value property
+syn keyword jspCommandArg contained code codebase name archive align height
+syn keyword jspCommandArg contained width hspace vspace jreversion nspluginurl iepluginurl
+
+" Redefine htmlTag so that it can contain jspExpr
+syn region htmlTag start=+<[^/%]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,jspExpr
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_jsp_syn_inits")
+ if version < 508
+ let did_jsp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ " java.vim has redefined htmlComment highlighting
+ HiLink htmlComment Comment
+ HiLink htmlCommentPart Comment
+ " Be consistent with html highlight settings
+ HiLink jspComment htmlComment
+ HiLink jspTag htmlTag
+ HiLink jspDirective jspTag
+ HiLink jspDirName htmlTagName
+ HiLink jspDirArg htmlArg
+ HiLink jspCommand jspTag
+ HiLink jspCommandName htmlTagName
+ HiLink jspCommandArg htmlArg
+ delcommand HiLink
+endif
+
+if main_syntax == 'jsp'
+ unlet main_syntax
+endif
+
+let b:current_syntax = "jsp"
+
+" vim: ts=8
diff --git a/runtime/syntax/kix.vim b/runtime/syntax/kix.vim
new file mode 100644
index 000000000..62dc3253e
--- /dev/null
+++ b/runtime/syntax/kix.vim
@@ -0,0 +1,182 @@
+" Vim syntax file
+" Language: KixTart 95, Kix2001 Windows script language http://kixtart.org/
+" Maintainer: Richard Howarth <rhowarth@sgb.co.uk>
+" Last Change: 2003 May 11
+" URL: http://www.howsoft.demon.co.uk/
+
+" KixTart files identified by *.kix extension.
+
+" Amendment History:
+" 26 April 2001: RMH
+" Removed development comments from distro version
+" Renamed "Kix*" to "kix*" for consistancy
+" Changes made in preperation for VIM version 5.8/6.00
+
+" TODO:
+" Handle arrays highlighting
+" Handle object highlighting
+" The next two may not be possible:
+" Work out how to error too many "(", i.e. (() should be an error.
+" Similarly, "if" without "endif" and similar constructs should error.
+
+" Clear legacy syntax rules for version 5.x, exit if already processed for version 6+
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+syn keyword kixTODO TODO FIX XXX contained
+
+" Case insensitive language.
+syn case ignore
+
+" Kix statements
+syn match kixStatement "?"
+syn keyword kixStatement beep big break
+syn keyword kixStatement call cd cls color cookie1 copy
+syn keyword kixStatement del dim display
+syn keyword kixStatement exit
+syn keyword kixStatement flushkb
+syn keyword kixStatement get gets global go gosub goto
+syn keyword kixStatement md
+syn keyword kixStatement password play
+syn keyword kixStatement quit
+syn keyword kixStatement rd return run
+syn keyword kixStatement set setl setm settime shell sleep small
+syn keyword kixStatement use
+
+" Kix2001
+syn keyword kixStatement debug function endfunction redim
+
+" Simple variables
+syn match kixNotVar "\$\$\|@@\|%%" transparent contains=NONE
+syn match kixLocalVar "\$\w\+"
+syn match kixMacro "@\w\+"
+syn match kixEnvVar "%\w\+"
+
+" Destination labels
+syn match kixLabel ":\w\+\>"
+
+" Identify strings, trap unterminated strings
+syn match kixStringError +".*\|'.*+
+syn region kixDoubleString oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar
+syn region kixSingleString oneline start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=kixLocalVar,kixMacro,kixEnvVar,kixNotVar
+
+" Operators
+syn match kixOperator "+\|-\|\*\|/\|=\|&\||"
+syn keyword kixOperator and or
+" Kix2001
+syn match kixOperator "=="
+syn keyword kixOperator not
+
+" Numeric constants
+syn match kixInteger "-\=\<\d\+\>" contains=NONE
+syn match kixFloat "-\=\.\d\+\>\|-\=\<\d\+\.\d\+\>" contains=NONE
+
+" Hex numeric constants
+syn match kixHex "\&\x\+\>" contains=NONE
+
+" Other contants
+" Kix2001
+syn keyword kixConstant on off
+
+" Comments
+syn match kixComment ";.*$" contains=kixTODO
+
+" Trap unmatched parenthesis
+syn match kixParenCloseError ")"
+syn region kixParen oneline transparent start="(" end=")" contains=ALLBUT,kixParenCloseError
+
+" Functions (Builtin + UDF)
+syn match kixFunction "\w\+("he=e-1,me=e-1 contains=ALL
+
+" Trap unmatched brackets
+syn match kixBrackCloseError "\]"
+syn region kixBrack transparent start="\[" end="\]" contains=ALLBUT,kixBrackCloseError
+
+" Clusters for ALLBUT shorthand
+syn cluster kixIfBut contains=kixIfError,kixSelectOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK
+syn cluster kixSelectBut contains=kixSelectError,kixIfOK,kixDoOK,kixWhileOK,kixForEachOK,kixForNextOK
+syn cluster kixDoBut contains=kixDoError,kixSelectOK,kixIfOK,kixWhileOK,kixForEachOK,kixForNextOK
+syn cluster kixWhileBut contains=kixWhileError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixForNextOK
+syn cluster kixForEachBut contains=kixForEachError,kixSelectOK,kixIfOK,kixDoOK,kixForNextOK,kixWhileOK
+syn cluster kixForNextBut contains=kixForNextError,kixSelectOK,kixIfOK,kixDoOK,kixForEachOK,kixWhileOK
+" Condtional construct errors.
+syn match kixIfError "\<if\>\|\<else\>\|\<endif\>"
+syn match kixIfOK contained "\<if\>\|\<else\>\|\<endif\>"
+syn region kixIf transparent matchgroup=kixIfOK start="\<if\>" end="\<endif\>" contains=ALLBUT,@kixIfBut
+syn match kixSelectError "\<select\>\|\<case\>\|\<endselect\>"
+syn match kixSelectOK contained "\<select\>\|\<case\>\|\<endselect\>"
+syn region kixSelect transparent matchgroup=kixSelectOK start="\<select\>" end="\<endselect\>" contains=ALLBUT,@kixSelectBut
+
+" Program control constructs.
+syn match kixDoError "\<do\>\|\<until\>"
+syn match kixDoOK contained "\<do\>\|\<until\>"
+syn region kixDo transparent matchgroup=kixDoOK start="\<do\>" end="\<until\>" contains=ALLBUT,@kixDoBut
+syn match kixWhileError "\<while\>\|\<loop\>"
+syn match kixWhileOK contained "\<while\>\|\<loop\>"
+syn region kixWhile transparent matchgroup=kixWhileOK start="\<while\>" end="\<loop\>" contains=ALLBUT,@kixWhileBut
+syn match kixForNextError "\<for\>\|\<to\>\|\<step\>\|\<next\>"
+syn match kixForNextOK contained "\<for\>\|\<to\>\|\<step\>\|\<next\>"
+syn region kixForNext transparent matchgroup=kixForNextOK start="\<for\>" end="\<next\>" contains=ALLBUT,@kixForBut
+syn match kixForEachError "\<for each\>\|\<in\>\|\<next\>"
+syn match kixForEachOK contained "\<for each\>\|\<in\>\|\<next\>"
+syn region kixForEach transparent matchgroup=kixForEachOK start="\<for each\>" end="\<next\>" contains=ALLBUT,@kixForEachBut
+
+" Expressions
+syn match kixExpression "<\|>\|<=\|>=\|<>"
+
+
+" Default highlighting.
+" Version < 5.8 set default highlight if file not already processed.
+" Version >= 5.8 set default highlight only if it doesn't already have a value.
+if version > 508 || !exists("did_kix_syn_inits")
+ if version < 508
+ let did_kix_syn_inits=1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink kixDoubleString String
+ HiLink kixSingleString String
+ HiLink kixStatement Statement
+ HiLink kixRepeat Repeat
+ HiLink kixComment Comment
+ HiLink kixBuiltin Function
+ HiLink kixLocalVar Special
+ HiLink kixMacro Special
+ HiLink kixEnvVar Special
+ HiLink kixLabel Type
+ HiLink kixFunction Function
+ HiLink kixInteger Number
+ HiLink kixHex Number
+ HiLink kixFloat Number
+ HiLink kixOperator Operator
+ HiLink kixExpression Operator
+
+ HiLink kixParenCloseError Error
+ HiLink kixBrackCloseError Error
+ HiLink kixStringError Error
+
+ HiLink kixWhileError Error
+ HiLink kixWhileOK Conditional
+ HiLink kixDoError Error
+ HiLink kixDoOK Conditional
+ HiLink kixIfError Error
+ HiLink kixIfOK Conditional
+ HiLink kixSelectError Error
+ HiLink kixSelectOK Conditional
+ HiLink kixForNextError Error
+ HiLink kixForNextOK Conditional
+ HiLink kixForEachError Error
+ HiLink kixForEachOK Conditional
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "kix"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/kscript.vim b/runtime/syntax/kscript.vim
new file mode 100644
index 000000000..903f8474b
--- /dev/null
+++ b/runtime/syntax/kscript.vim
@@ -0,0 +1,70 @@
+" Vim syntax file
+" Language: kscript
+" Maintainer: Thomas Capricelli <orzel@yalbi.com>
+" URL: http://aquila.rezel.enst.fr/thomas/vim/kscript.vim
+" CVS: $Id$
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword kscriptPreCondit import from
+
+syn keyword kscriptHardCoded print println connect length arg mid upper lower isEmpty toInt toFloat findApplication
+syn keyword kscriptConditional if else switch
+syn keyword kscriptRepeat while for do foreach
+syn keyword kscriptExceptions emit catch raise try signal
+syn keyword kscriptFunction class struct enum
+syn keyword kscriptConst FALSE TRUE false true
+syn keyword kscriptStatement return delete
+syn keyword kscriptLabel case default
+syn keyword kscriptStorageClass const
+syn keyword kscriptType in out inout var
+
+syn keyword kscriptTodo contained TODO FIXME XXX
+
+syn region kscriptComment start="/\*" end="\*/" contains=kscriptTodo
+syn match kscriptComment "//.*" contains=kscriptTodo
+syn match kscriptComment "#.*$" contains=kscriptTodo
+
+syn region kscriptString start=+'+ end=+'+ skip=+\\\\\|\\'+
+syn region kscriptString start=+"+ end=+"+ skip=+\\\\\|\\"+
+syn region kscriptString start=+"""+ end=+"""+
+syn region kscriptString start=+'''+ end=+'''+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_kscript_syntax_inits")
+ if version < 508
+ let did_kscript_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink kscriptConditional Conditional
+ HiLink kscriptRepeat Repeat
+ HiLink kscriptExceptions Statement
+ HiLink kscriptFunction Function
+ HiLink kscriptConst Constant
+ HiLink kscriptStatement Statement
+ HiLink kscriptLabel Label
+ HiLink kscriptStorageClass StorageClass
+ HiLink kscriptType Type
+ HiLink kscriptTodo Todo
+ HiLink kscriptComment Comment
+ HiLink kscriptString String
+ HiLink kscriptPreCondit PreCondit
+ HiLink kscriptHardCoded Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "kscript"
+
+" vim: ts=8
diff --git a/runtime/syntax/kwt.vim b/runtime/syntax/kwt.vim
new file mode 100644
index 000000000..47be7a804
--- /dev/null
+++ b/runtime/syntax/kwt.vim
@@ -0,0 +1,87 @@
+" Vim syntax file
+" Language: kimwitu++
+" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
+" Last Change: 2 May 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C++ syntax to start with
+if version < 600
+ source <sfile>:p:h/cpp.vim
+else
+ runtime! syntax/cpp.vim
+ unlet b:current_syntax
+endif
+
+" kimwitu++ extentions
+
+" Don't stop at eol, messes around with CPP mode, but gives line spanning
+" strings in unparse rules
+syn region cCppString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat
+syn keyword cType integer real casestring nocasestring voidptr list
+syn keyword cType uview rview uview_enum rview_enum
+
+" avoid unparsing rule sth:view being scanned as label
+syn clear cUserCont
+syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel contained
+syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel contained
+syn match cUserCont "^\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
+syn match cUserCont ";\s*\I\i*\s*:[^:]"me=e-1 contains=cUserLabel contained
+
+" highlight phylum decls
+syn match kwtPhylum "^\I\i*:$"
+syn match kwtPhylum "^\I\i*\s*{\s*\(!\|\I\)\i*\s*}\s*:$"
+
+syn keyword kwtStatement with foreach afterforeach provided
+syn match kwtDecl "%\(uviewvar\|rviewvar\)"
+syn match kwtDecl "^%\(uview\|rview\|ctor\|dtor\|base\|storageclass\|list\|attr\|member\|option\)"
+syn match kwtOption "no-csgio\|no-unparse\|no-rewrite\|no-printdot\|no-hashtables\|smart-pointer\|weak-pointer"
+syn match kwtSep "^%}$"
+syn match kwtSep "^%{\(\s\+\I\i*\)*$"
+syn match kwtCast "\<phylum_cast\s*<"me=e-1
+syn match kwtCast "\<phylum_cast\s*$"
+
+
+" match views, remove paren error in brackets
+syn clear cErrInBracket
+syn match cErrInBracket contained ")"
+syn match kwtViews "\(\[\|<\)\@<=[ [:alnum:]_]\{-}:"
+
+" match rule bodies
+syn region kwtUnpBody transparent keepend extend fold start="->\s*\[" start="^\s*\[" skip="\$\@<!{\_.\{-}\$\@<!}" end="\s]\s\=;\=$" end="^]\s\=;\=$" end="}]\s\=;\=$"
+syn region kwtRewBody transparent keepend extend fold start="->\s*<" start="^\s*<" end="\s>\s\=;\=$" end="^>\s\=;\=$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_kwt_syn_inits")
+ if version < 508
+ let did_kwt_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink kwtStatement cppStatement
+ HiLink kwtDecl cppStatement
+ HiLink kwtCast cppStatement
+ HiLink kwtSep Delimiter
+ HiLink kwtViews Label
+ HiLink kwtPhylum Type
+ HiLink kwtOption PreProc
+ "HiLink cText Comment
+
+ delcommand HiLink
+endif
+
+syn sync lines=300
+
+let b:current_syntax = "kwt"
+
+" vim: ts=8
diff --git a/runtime/syntax/lace.vim b/runtime/syntax/lace.vim
new file mode 100644
index 000000000..9e64eea7d
--- /dev/null
+++ b/runtime/syntax/lace.vim
@@ -0,0 +1,135 @@
+" Vim syntax file
+" Language: lace
+" Maintainer: Jocelyn Fiat <utilities@eiffel.com>
+" Last Change: 2001 May 09
+
+" Copyright Interactive Software Engineering, 1998
+" You are free to use this file as you please, but
+" if you make a change or improvement you must send
+" it to the maintainer at <utilities@eiffel.com>
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" LACE is case insensitive, but the style guide lines are not.
+
+if !exists("lace_case_insensitive")
+ syn case match
+else
+ syn case ignore
+endif
+
+" A bunch of useful LACE keywords
+syn keyword laceTopStruct system root default option visible cluster
+syn keyword laceTopStruct external generate end
+syn keyword laceOptionClause collect assertion debug optimize trace
+syn keyword laceOptionClause profile inline precompiled multithreaded
+syn keyword laceOptionClause exception_trace dead_code_removal
+syn keyword laceOptionClause array_optimization
+syn keyword laceOptionClause inlining_size inlining
+syn keyword laceOptionClause console_application dynamic_runtime
+syn keyword laceOptionClause line_generation
+syn keyword laceOptionMark yes no all
+syn keyword laceOptionMark require ensure invariant loop check
+syn keyword laceClusterProp use include exclude
+syn keyword laceAdaptClassName adapt ignore rename as
+syn keyword laceAdaptClassName creation export visible
+syn keyword laceExternal include_path object makefile
+
+" Operators
+syn match laceOperator "\$"
+syn match laceBrackets "[[\]]"
+syn match laceExport "[{}]"
+
+" Constants
+syn keyword laceBool true false
+syn keyword laceBool True False
+syn region laceString start=+"+ skip=+%"+ end=+"+ contains=laceEscape,laceStringError
+syn match laceEscape contained "%[^/]"
+syn match laceEscape contained "%/\d\+/"
+syn match laceEscape contained "^[ \t]*%"
+syn match laceEscape contained "%[ \t]*$"
+syn match laceStringError contained "%/[^0-9]"
+syn match laceStringError contained "%/\d\+[^0-9/]"
+syn match laceStringError "'\(%[^/]\|%/\d\+/\|[^'%]\)\+'"
+syn match laceCharacter "'\(%[^/]\|%/\d\+/\|[^'%]\)'" contains=laceEscape
+syn match laceNumber "-\=\<\d\+\(_\d\+\)*\>"
+syn match laceNumber "\<[01]\+[bB]\>"
+syn match laceNumber "-\=\<\d\+\(_\d\+\)*\.\(\d\+\(_\d\+\)*\)\=\([eE][-+]\=\d\+\(_\d\+\)*\)\="
+syn match laceNumber "-\=\.\d\+\(_\d\+\)*\([eE][-+]\=\d\+\(_\d\+\)*\)\="
+syn match laceComment "--.*" contains=laceTodo
+
+
+syn case match
+
+" Case sensitive stuff
+
+syn keyword laceTodo TODO XXX FIXME
+syn match laceClassName "\<[A-Z][A-Z0-9_]*\>"
+syn match laceCluster "[a-zA-Z][a-zA-Z0-9_]*\s*:"
+syn match laceCluster "[a-zA-Z][a-zA-Z0-9_]*\s*(\s*[a-zA-Z][a-zA-Z0-9_]*\s*)\s*:"
+
+" Catch mismatched parentheses
+syn match laceParenError ")"
+syn match laceBracketError "\]"
+syn region laceGeneric transparent matchgroup=laceBrackets start="\[" end="\]" contains=ALLBUT,laceBracketError
+syn region laceParen transparent start="(" end=")" contains=ALLBUT,laceParenError
+
+" Should suffice for even very long strings and expressions
+syn sync lines=40
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lace_syntax_inits")
+ if version < 508
+ let did_lace_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink laceTopStruct PreProc
+
+ HiLink laceOptionClause Statement
+ HiLink laceOptionMark Constant
+ HiLink laceClusterProp Label
+ HiLink laceAdaptClassName Label
+ HiLink laceExternal Statement
+ HiLink laceCluster ModeMsg
+
+ HiLink laceEscape Special
+
+ HiLink laceBool Boolean
+ HiLink laceString String
+ HiLink laceCharacter Character
+ HiLink laceClassName Type
+ HiLink laceNumber Number
+
+ HiLink laceOperator Special
+ HiLink laceArray Special
+ HiLink laceExport Special
+ HiLink laceCreation Special
+ HiLink laceBrackets Special
+ HiLink laceConstraint Special
+
+ HiLink laceComment Comment
+
+ HiLink laceError Error
+ HiLink laceStringError Error
+ HiLink laceParenError Error
+ HiLink laceBracketError Error
+ HiLink laceTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lace"
+
+" vim: ts=4
diff --git a/runtime/syntax/latte.vim b/runtime/syntax/latte.vim
new file mode 100644
index 000000000..e2a8729f3
--- /dev/null
+++ b/runtime/syntax/latte.vim
@@ -0,0 +1,98 @@
+" Vim syntax file
+" Language: Latte
+" Maintainer: Nick Moffitt, <nick@zork.net>
+" Last Change: 14 June, 2000
+"
+" Notes:
+" I based this on the TeX and Scheme syntax files (but mostly scheme).
+" See http://www.latte.org for info on the language.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match latteError "[{}\\]"
+syn match latteOther "\\{"
+syn match latteOther "\\}"
+syn match latteOther "\\\\"
+
+if version < 600
+ set iskeyword=33,43,45,48-57,63,65-90,95,97-122,_
+else
+ setlocal iskeyword=33,43,45,48-57,63,65-90,95,97-122,_
+endif
+
+syn region latteVar matchgroup=SpecialChar start=!\\[A-Za-z_]!rs=s+1 end=![^A-Za-z0-9?!+_-]!me=e-1 contains=ALLBUT,latteNumber,latteOther
+syn region latteVar matchgroup=SpecialChar start=!\\[=\&][A-Za-z_]!rs=s+2 end=![^A-Za-z0-9?!+_-]!me=e-1 contains=ALLBUT,latteNumber,latteOther
+syn region latteString start=+\\"+ skip=+\\\\"+ end=+\\"+
+
+syn region latteGroup matchgroup=Delimiter start="{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax
+
+syn region latteUnquote matchgroup=Delimiter start="\\,{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax
+syn region latteSplice matchgroup=Delimiter start="\\,@{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=ALLBUT,latteSyntax
+syn region latteQuote matchgroup=Delimiter start="\\'{" skip="\\[{}]" matchgroup=Delimiter end="}"
+syn region latteQuote matchgroup=Delimiter start="\\`{" skip="\\[{}]" matchgroup=Delimiter end="}" contains=latteUnquote,latteSplice
+
+syn match latteOperator '\\/'
+syn match latteOperator '='
+
+syn match latteComment "\\;.*$"
+
+" This was gathered by slurping in the index.
+
+syn keyword latteSyntax __FILE__ __latte-version__ contained
+syn keyword latteSyntax _bal-tag _pre _tag add and append apply back contained
+syn keyword latteSyntax caar cadr car cdar cddr cdr ceil compose contained
+syn keyword latteSyntax concat cons def defmacro divide downcase contained
+syn keyword latteSyntax empty? equal? error explode file-contents contained
+syn keyword latteSyntax floor foreach front funcall ge? getenv contained
+syn keyword latteSyntax greater-equal? greater? group group? gt? html contained
+syn keyword latteSyntax if include lambda le? length less-equal? contained
+syn keyword latteSyntax less? let lmap load-file load-library lt? macro contained
+syn keyword latteSyntax member? modulo multiply not nth operator? contained
+syn keyword latteSyntax or ordinary quote process-output push-back contained
+syn keyword latteSyntax push-front quasiquote quote random rdc reverse contained
+syn keyword latteSyntax set! snoc splicing unquote strict-html4 contained
+syn keyword latteSyntax string-append string-ge? string-greater-equal? contained
+syn keyword latteSyntax string-greater? string-gt? string-le? contained
+syn keyword latteSyntax string-less-equal? string-less? string-lt? contained
+syn keyword latteSyntax string? subseq substr subtract contained
+syn keyword latteSyntax upcase useless warn while zero? contained
+
+
+" If it's good enough for scheme...
+
+syn sync match matchPlace grouphere NONE "^[^ \t]"
+" ... i.e. synchronize on a line that starts at the left margin
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_latte_syntax_inits")
+ if version < 508
+ let did_latte_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink latteSyntax Statement
+ HiLink latteVar Function
+
+ HiLink latteString String
+ HiLink latteQuote String
+
+ HiLink latteDelimiter Delimiter
+ HiLink latteOperator Operator
+
+ HiLink latteComment Comment
+ HiLink latteError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "latte"
diff --git a/runtime/syntax/ldif.vim b/runtime/syntax/ldif.vim
new file mode 100644
index 000000000..9f67b57f5
--- /dev/null
+++ b/runtime/syntax/ldif.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: LDAP LDIF
+" Maintainer: Zak Johnson <zakj@nox.cx>
+" Last Change: 2003-12-30
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync minlines=10 linebreaks=1
+
+syn match ldifAttribute /^[^ #][^:]*/ contains=ldifOption display
+syn match ldifOption /;[^:]\+/ contained contains=ldifPunctuation display
+syn match ldifPunctuation /;/ contained display
+
+syn region ldifStringValue matchgroup=ldifPunctuation start=/: / end=/\_$/ skip=/\n /
+syn region ldifBase64Value matchgroup=ldifPunctuation start=/:: / end=/\_$/ skip=/\n /
+syn region ldifFileValue matchgroup=ldifPunctuation start=/:< / end=/\_$/ skip=/\n /
+
+syn region ldifComment start=/^#/ end=/\_$/ skip=/\n /
+
+if version >= 508 || !exists("did_ldif_syn_inits")
+ if version < 508
+ let did_ldif_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ldifAttribute Type
+ HiLink ldifOption Identifier
+ HiLink ldifPunctuation Normal
+ HiLink ldifStringValue String
+ HiLink ldifBase64Value Special
+ HiLink ldifFileValue Special
+ HiLink ldifComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ldif"
diff --git a/runtime/syntax/lex.vim b/runtime/syntax/lex.vim
new file mode 100644
index 000000000..25c423ef5
--- /dev/null
+++ b/runtime/syntax/lex.vim
@@ -0,0 +1,96 @@
+" Vim syntax file
+" Language: Lex
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 4
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Option:
+" lex_uses_cpp : if this variable exists, then C++ is loaded rather than C
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version >= 600
+ if exists("lex_uses_cpp")
+ runtime! syntax/cpp.vim
+ else
+ runtime! syntax/c.vim
+ endif
+ unlet b:current_syntax
+else
+ if exists("lex_uses_cpp")
+ so <sfile>:p:h/cpp.vim
+ else
+ so <sfile>:p:h/c.vim
+ endif
+endif
+
+" --- Lex stuff ---
+
+"I'd prefer to use lex.* , but it doesn't handle forward definitions yet
+syn cluster lexListGroup contains=lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatString,lexPatTag,lexPatTag,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,lexPatCode,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2,cCommentStartError,cParenError
+syn cluster lexListPatCodeGroup contains=lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatTag,lexPatTag,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,cInParen,cUserLabel,cOctalZero,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCppOut2,cCommentStartError,cParenError
+
+" Abbreviations Section
+syn region lexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude,lexAbbrvComment
+syn match lexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=lexAbbrvRegExp
+syn match lexAbbrv "^%[sx]" contained
+syn match lexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=lexAbbrv,lexInclude
+syn region lexInclude matchgroup=lexSep start="^%{" end="%}" contained contains=ALLBUT,@lexListGroup
+syn region lexAbbrvComment start="^\s\+/\*" end="\*/" contains=@Spell
+
+"%% : Patterns {Actions}
+syn region lexPatBlock matchgroup=Todo start="^%%$" matchgroup=Todo end="^%%$" skipnl skipwhite contains=lexPat,lexPatTag,lexPatComment
+syn region lexPat start=+\S+ skip="\\\\\|\\." end="\s"me=e-1 contained nextgroup=lexMorePat,lexPatSep contains=lexPatString,lexSlashQuote,lexBrace
+syn region lexBrace start="\[" skip=+\\\\\|\\+ end="]" contained
+syn region lexPatString matchgroup=String start=+"+ skip=+\\\\\|\\"+ matchgroup=String end=+"+ contained
+syn match lexPatTag "^<\I\i*\(,\I\i*\)*>*" contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep
+syn match lexPatTag +^<\I\i*\(,\I\i*\)*>*\(\\\\\)*\\"+ contained nextgroup=lexPat,lexPatTag,lexMorePat,lexPatSep
+syn region lexPatComment start="^\s*/\*" end="\*/" skipnl contained contains=cTodo nextgroup=lexPatComment,lexPat,lexPatString,lexPatTag,@Spell
+syn match lexPatCodeLine ".*$" contained contains=ALLBUT,@lexListGroup
+syn match lexMorePat "\s*|\s*$" skipnl contained nextgroup=lexPat,lexPatTag,lexPatComment
+syn match lexPatSep "\s\+" contained nextgroup=lexMorePat,lexPatCode,lexPatCodeLine
+syn match lexSlashQuote +\(\\\\\)*\\"+ contained
+syn region lexPatCode matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" skipnl contained contains=ALLBUT,@lexListPatCodeGroup
+
+syn keyword lexCFunctions BEGIN input unput woutput yyleng yylook yytext
+syn keyword lexCFunctions ECHO output winput wunput yyless yymore yywrap
+
+" <c.vim> includes several ALLBUTs; these have to be treated so as to exclude lex* groups
+syn cluster cParenGroup add=lex.*
+syn cluster cDefineGroup add=lex.*
+syn cluster cPreProcGroup add=lex.*
+syn cluster cMultiGroup add=lex.*
+
+" Synchronization
+syn sync clear
+syn sync minlines=300
+syn sync match lexSyncPat grouphere lexPatBlock "^%[a-zA-Z]"
+syn sync match lexSyncPat groupthere lexPatBlock "^<$"
+syn sync match lexSyncPat groupthere lexPatBlock "^%%$"
+
+" The default highlighting.
+hi def link lexSlashQuote lexPat
+hi def link lexBrace lexPat
+hi def link lexAbbrvComment lexPatComment
+
+hi def link lexAbbrv SpecialChar
+hi def link lexAbbrvRegExp Macro
+hi def link lexCFunctions Function
+hi def link lexMorePat SpecialChar
+hi def link lexPat Function
+hi def link lexPatComment Comment
+hi def link lexPatString Function
+hi def link lexPatTag Special
+hi def link lexSep Delimiter
+
+let b:current_syntax = "lex"
+
+" vim:ts=10
diff --git a/runtime/syntax/lftp.vim b/runtime/syntax/lftp.vim
new file mode 100644
index 000000000..fc1958ed3
--- /dev/null
+++ b/runtime/syntax/lftp.vim
@@ -0,0 +1,184 @@
+" Vim syntax file
+" Language: lftp(1) configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/lftp/
+" Latest Revision: 2004-05-22
+" arch-tag: f2537c49-5d64-42b8-beb4-13a09dd723d2
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk 48-57,97-122,-
+delcommand SetIsk
+
+" comments
+syn region lftpComment display oneline matchgroup=lftpComment start="#" end="$" contains=lftpTodo
+
+" todo
+syn keyword lftpTodo contained TODO FIXME XXX NOTE
+
+" strings
+syn region lftpString contained display start=+"+ skip=+\\$\|\\"+ end=+"+ end=+$+
+
+" numbers
+syn match lftpNumber contained display "\<\d\+\(\.\d\+\)\=\>"
+
+" booleans and other things
+syn keyword lftpBoolean contained yes no on off true false
+
+" intervals
+syn keyword lftpInterval contained infinity inf never forever
+syn match lftpInterval contained "\<\(\d\+\(\.\d\+\)\=[dhms]\)\+\>"
+
+" commands
+syn keyword lftpKeywords alias anon at bookmark cache cat cd chmod close
+syn keyword lftpKeywords cls command debug du echo exit fg find get get1
+syn keyword lftpKeywords glob help history jobs kill lcd lftp lpwd ls
+syn keyword lftpKeywords mget mirror mkdir module
+syn keyword lftpKeywords more mput mrm mv nlist open pget put pwd queue
+syn keyword lftpKeywords quote reget recls rels renlist repeat
+syn keyword lftpKeywords reput rm rmdir scache site source suspend user
+syn keyword lftpKeywords version wait zcat zmore
+
+" settings
+syn region lftpSet matchgroup=lftpKeywords start="set" end=";" end="$" contains=lftpString,lftpNumber,lftpBoolean,lftpInterval,lftpSettingsPrefix,lftpSettings
+syn match lftpSettingsPrefix contained '\<\%(bmk\|cache\|cmd\|color\|dns\):'
+syn match lftpSettingsPrefix contained '\<\%(file\|fish\|ftp\|hftp\):'
+syn match lftpSettingsPrefix contained '\<\%(http\|https\|mirror\|module\):'
+syn match lftpSettingsPrefix contained '\<\%(net\|sftp\|ssl\|xfer\):'
+" bmk:
+syn keyword lftpSettings contained save-p[asswords]
+" cache:
+syn keyword lftpSettings contained cache-em[pty-listings] en[able]
+syn keyword lftpSettings contained exp[ire] siz[e]
+" cmd:
+syn keyword lftpSettings contained at[-exit] cls-c[ompletion-default]
+syn keyword lftpSettings contained cls-d[efault] cs[h-history]
+syn keyword lftpSettings contained default-p[rotocol] default-t[itle]
+syn keyword lftpSettings contained fai[l-exit] in[teractive]
+syn keyword lftpSettings contained lo[ng-running] ls[-default]
+syn keyword lftpSettings contained mo[ve-background] prom[pt]
+syn keyword lftpSettings contained rem[ote-completion]
+syn keyword lftpSettings contained save-c[wd-history] save-r[l-history]
+syn keyword lftpSettings contained set-t[erm-status] statu[s-interval]
+syn keyword lftpSettings contained te[rm-status] verb[ose] verify-h[ost]
+syn keyword lftpSettings contained verify-path verify-path[-cached]
+" color:
+syn keyword lftpSettings contained dir[-colors] use-c[olor]
+" dns:
+syn keyword lftpSettings contained S[RV-query] cache-en[able]
+syn keyword lftpSettings contained cache-ex[pire] cache-s[ize]
+syn keyword lftpSettings contained fat[al-timeout] o[rder] use-fo[rk]
+" file:
+syn keyword lftpSettings contained ch[arset]
+" fish:
+syn keyword lftpSettings contained connect[-program] sh[ell]
+" ftp:
+syn keyword lftpSettings contained acct anon-p[ass] anon-u[ser]
+syn keyword lftpSettings contained au[to-sync-mode] b[ind-data-socket]
+syn keyword lftpSettings contained ch[arset] cli[ent] dev[ice-prefix]
+syn keyword lftpSettings contained fi[x-pasv-address] fxp-f[orce]
+syn keyword lftpSettings contained fxp-p[assive-source] h[ome] la[ng]
+syn keyword lftpSettings contained list-e[mpty-ok] list-o[ptions]
+syn keyword lftpSettings contained nop[-interval] pas[sive-mode]
+syn keyword lftpSettings contained port-i[pv4] port-r[ange] prox[y]
+syn keyword lftpSettings contained rest-l[ist] rest-s[tor]
+syn keyword lftpSettings contained retry-530 retry-530[-anonymous]
+syn keyword lftpSettings contained sit[e-group] skey-a[llow]
+syn keyword lftpSettings contained skey-f[orce] ssl-allow
+syn keyword lftpSettings contained ssl-allow[-anonymous] ssl-au[th]
+syn keyword lftpSettings contained ssl-f[orce] ssl-protect-d[ata]
+syn keyword lftpSettings contained ssl-protect-l[ist] stat-[interval]
+syn keyword lftpSettings contained sy[nc-mode] timez[one] use-a[bor]
+syn keyword lftpSettings contained use-fe[at] use-fx[p] use-hf[tp]
+syn keyword lftpSettings contained use-mdtm use-mdtm[-overloaded]
+syn keyword lftpSettings contained use-ml[sd] use-p[ret] use-q[uit]
+syn keyword lftpSettings contained use-site-c[hmod] use-site-i[dle]
+syn keyword lftpSettings contained use-site-u[time] use-siz[e]
+syn keyword lftpSettings contained use-st[at] use-te[lnet-iac]
+syn keyword lftpSettings contained verify-a[ddress] verify-p[ort]
+syn keyword lftpSettings contained w[eb-mode]
+" hftp:
+syn keyword lftpSettings contained w[eb-mode] cache prox[y]
+syn keyword lftpSettings contained use-au[thorization] use-he[ad]
+syn keyword lftpSettings contained use-ty[pe]
+" http:
+syn keyword lftpSettings contained accept accept-c[harset]
+syn keyword lftpSettings contained accept-l[anguage] cache coo[kie]
+syn keyword lftpSettings contained pos[t-content-type] prox[y]
+syn keyword lftpSettings contained put-c[ontent-type] put-m[ethod]
+syn keyword lftpSettings contained ref[erer] set-c[ookies] user[-agent]
+" https:
+syn keyword lftpSettings contained prox[y]
+" mirror:
+syn keyword lftpSettings contained exc[lude-regex] o[rder]
+syn keyword lftpSettings contained parallel-d[irectories]
+syn keyword lftpSettings contained parallel-t[ransfer-count]
+syn keyword lftpSettings contained use-p[get-n]
+" module:
+syn keyword lftpSettings contained pat[h]
+" net:
+syn keyword lftpSettings contained connection-l[imit]
+syn keyword lftpSettings contained connection-t[akeover]
+syn keyword lftpSettings contained id[le] limit-m[ax] limit-r[ate]
+syn keyword lftpSettings contained limit-total-m[ax] limit-total-r[ate]
+syn keyword lftpSettings contained max-ret[ries] no-[proxy]
+syn keyword lftpSettings contained pe[rsist-retries]
+syn keyword lftpSettings contained reconnect-interval-b[ase]
+syn keyword lftpSettings contained reconnect-interval-ma[x]
+syn keyword lftpSettings contained reconnect-interval-mu[ltiplier]
+syn keyword lftpSettings contained socket-bind-ipv4 socket-bind-ipv6
+syn keyword lftpSettings contained socket-bu[ffer] socket-m[axseg]
+syn keyword lftpSettings contained timeo[ut]
+" sftp:
+syn keyword lftpSettings contained connect[-program]
+syn keyword lftpSettings contained max-p[ackets-in-flight]
+syn keyword lftpSettings contained prot[ocol-version] ser[ver-program]
+syn keyword lftpSettings contained size-r[ead] size-w[rite]
+" ssl:
+syn keyword lftpSettings contained ca-f[ile] ca-p[ath] ce[rt-file]
+syn keyword lftpSettings contained crl-f[ile] crl-p[ath] k[ey-file]
+syn keyword lftpSettings contained verify-c[ertificate]
+" xfer:
+syn keyword lftpSettings contained clo[bber] dis[k-full-fatal]
+syn keyword lftpSettings contained eta-p[eriod] eta-t[erse]
+syn keyword lftpSettings contained mak[e-backup] max-red[irections]
+syn keyword lftpSettings contained ra[te-period]
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lftp_syn_inits")
+ if version < 508
+ let did_lftp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lftpComment Comment
+ HiLink lftpTodo Todo
+ HiLink lftpString String
+ HiLink lftpNumber Number
+ HiLink lftpBoolean Boolean
+ HiLink lftpInterval Number
+ HiLink lftpKeywords Keyword
+ HiLink lftpSettingsPrefix PreProc
+ HiLink lftpSettings Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lftp"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/lhaskell.vim b/runtime/syntax/lhaskell.vim
new file mode 100644
index 000000000..250ccfaf2
--- /dev/null
+++ b/runtime/syntax/lhaskell.vim
@@ -0,0 +1,136 @@
+" Vim syntax file
+" Language: Haskell with literate comments, Bird style,
+" TeX style and plain text surrounding
+" \begin{code} \end{code} blocks
+" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
+" Original Author: Arthur van Leeuwen <arthurvl@cs.uu.nl>
+" Last Change: 2004 May 16
+" Version: 1.01
+"
+" Thanks to Ian Lynagh for thoughtful comments on initial versions and
+" for the inspiration for writing this in the first place.
+"
+" This style guesses as to the type of markup used in a literate haskell
+" file and will highlight (La)TeX markup if it finds any
+" This behaviour can be overridden, both glabally and locally using
+" the lhs_markup variable or b:lhs_markup variable respectively.
+"
+" lhs_markup must be set to either tex or none to indicate that
+" you always want (La)TeX highlighting or no highlighting
+" must not be set to let the highlighting be guessed
+" b:lhs_markup must be set to eiterh tex or none to indicate that
+" you want (La)TeX highlighting or no highlighting for
+" this particular buffer
+" must not be set to let the highlighting be guessed
+"
+"
+" 2004 February 18: New version, based on Ian Lynagh's TeX guessing
+" lhaskell.vim, cweb.vim, tex.vim, sh.vim and fortran.vim
+" 2004 February 20: Cleaned up the guessing and overriding a bit
+" 2004 February 23: Cleaned up syntax highlighting for \begin{code} and
+" \end{code}, added some clarification to the attributions
+"
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" First off, see if we can inherit a user preference for lhs_markup
+if !exists("b:lhs_markup")
+ if exists("lhs_markup")
+ if lhs_markup =~ '\<\%(tex\|none\)\>'
+ let b:lhs_markup = matchstr(lhs_markup,'\<\%(tex\|none\)\>')
+ else
+ echohl WarningMsg | echo "Unknown value of lhs_markup" | echohl None
+ let b:lhs_markup = "unknown"
+ endif
+ else
+ let b:lhs_markup = "unknown"
+ endif
+else
+ if b:lhs_markup !~ '\<\%(tex\|none\)\>'
+ let b:lhs_markup = "unknown"
+ endif
+endif
+
+" Remember where the cursor is, and go to upperleft
+let s:oldline=line(".")
+let s:oldcolumn=col(".")
+call cursor(1,1)
+
+" If no user preference, scan buffer for our guess of the markup to
+" highlight. We only differentiate between TeX and plain markup, where
+" plain is not highlighted. The heuristic for finding TeX markup is if
+" one of the following occurs anywhere in the file:
+" - \documentclass
+" - \begin{env} (for env != code)
+" - \part, \chapter, \section, \subsection, \subsubsection, etc
+if b:lhs_markup == "unknown"
+ if search('%\|\\documentclass\|\\begin{\(code}\)\@!\|\\\(sub\)*section\|\\chapter|\\part','W') != 0
+ let b:lhs_markup = "tex"
+ else
+ let b:lhs_markup = "plain"
+ endif
+endif
+
+" If user wants us to highlight TeX syntax, read it.
+if b:lhs_markup == "tex"
+ if version < 600
+ source <sfile>:p:h/tex.vim
+ else
+ runtime! syntax/tex.vim
+ unlet b:current_syntax
+ endif
+endif
+
+" Literate Haskell is Haskell in between text, so at least read Haskell
+" highlighting
+if version < 600
+ syntax include @haskellTop <sfile>:p:h/haskell.vim
+else
+ syntax include @haskellTop syntax/haskell.vim
+endif
+
+syntax region lhsHaskellBirdTrack start="^>" end="\%(^[^>]\)\@=" contains=@haskellTop,lhsBirdTrack
+syntax region lhsHaskellBeginEndBlock start="^\\begin{code}\s*$" matchgroup=NONE end="\%(^\\end{code}.*$\)\@=" contains=@haskellTop,@beginCode
+
+syntax match lhsBirdTrack "^>" contained
+
+syntax match beginCodeBegin "^\\begin" nextgroup=beginCodeCode contained
+syntax region beginCodeCode matchgroup=texDelimiter start="{" end="}"
+syntax cluster beginCode contains=beginCodeBegin,beginCodeCode
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tex_syntax_inits")
+ if version < 508
+ let did_tex_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lhsBirdTrack Comment
+
+ HiLink beginCodeBegin texCmdName
+ HiLink beginCodeCode texSection
+
+ delcommand HiLink
+endif
+
+" Restore cursor to original position, as it may have been disturbed
+" by the searches in our guessing code
+call cursor (s:oldline, s:oldcolumn)
+
+unlet s:oldline
+unlet s:oldcolumn
+
+let b:current_syntax = "lhaskell"
+
+" vim: ts=8
diff --git a/runtime/syntax/libao.vim b/runtime/syntax/libao.vim
new file mode 100644
index 000000000..f675150e0
--- /dev/null
+++ b/runtime/syntax/libao.vim
@@ -0,0 +1,46 @@
+" Vim syntax file
+" Language: libao configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/libao/
+" Latest Revision: 2004-05-22
+" arch-tag: 4ddef0a8-6817-4555-a5a1-0be82094053d
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Todo
+syn keyword libaoTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region libaoComment matchgroup=libaoComment start='^\s*#' end='$' contains=libaoTodo
+
+" Keywords
+syn keyword libaoKeyword default_driver
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_libao_syn_inits")
+ if version < 508
+ let did_libao_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ HiDef hi <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ HiDef hi def <args>
+ endif
+
+ HiLink libaoTodo Todo
+ HiLink libaoComment Comment
+ HiLink libaoKeyword Keyword
+
+ delcommand HiLink
+ delcommand HiDef
+endif
+
+let b:current_syntax = "libao"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/lifelines.vim b/runtime/syntax/lifelines.vim
new file mode 100644
index 000000000..a6a2c8d14
--- /dev/null
+++ b/runtime/syntax/lifelines.vim
@@ -0,0 +1,118 @@
+" Vim syntax file
+" Language: Lifelines (v 3.0.7) http://lifelines.sourceforge.net
+" Maintainer: Patrick Texier <p.texier@orsennes.com>
+" Location: ftp://216.71.72.236/lifelines.vim
+" Last Change: 2002 Mar 03
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful lifelines keywords 3.0.7
+
+syn keyword lifelinesStatement set
+syn keyword lifelinesUser getindi geindiset getfam getint getstr choosechild
+syn keyword lifelinesUser chooseindi choosespouse choosesubset menuchoose
+syn keyword lifelinesUser choosefam getintmsg getindimsg getstrmsg
+syn keyword lifelinesProc proc func return call
+syn keyword lifelinesInclude include
+syn keyword lifelinesDef global
+syn keyword lifelinesConditional if else elsif switch
+syn keyword lifelinesRepeat continue break while
+syn keyword lifelinesLogical and or not eq ne lt gt le ge strcmp eqstr nestr
+syn keyword lifelinesArithm add sub mul div mod exp neg incr decr
+syn keyword lifelinesIndi name fullname surname givens trimname birth
+syn keyword lifelinesIndi death baptism burial
+syn keyword lifelinesIndi father mother nextsib prevsib sex male female
+syn keyword lifelinesIndi pn nspouses nfamilies parents title key
+syn keyword lifelinesIndi soundex inode root indi firstindi nextindi
+syn keyword lifelinesIndi previndi spouses families forindi indiset
+syn keyword lifelinesIndi addtoset deletefromset lengthset union intersect
+syn keyword lifelinesIndi difference parentset childset spouseset siblingset
+syn keyword lifelinesIndi ancestorset descendentset descendantset uniqueset
+syn keyword lifelinesIndi namesort keysort valuesort genindiset getindiset
+syn keyword lifelinesIndi forindiset lastindi writeindi
+syn keyword lifelinesIndi inset
+syn keyword lifelinesFam marriage husband wife nchildren firstchild
+syn keyword lifelinesFam lastchild fnode fam firstfam nextfam lastfam
+syn keyword lifelinesFam prevfam children forfam writefam
+syn keyword lifelinesList list empty length enqueue dequeue requeue
+syn keyword lifelinesList push pop setel getel forlist inlist
+syn keyword lifelinesTable table insert lookup
+syn keyword lifelinesGedcom xref tag value parent child sibling savenode
+syn keyword lifelinesGedcom fornodes traverse createnode addnode deletenode
+syn keyword lifelinesGedcom reference dereference getrecord
+syn keyword lifelinesGedcom gengedcom gengedcomstrong gengedcomweak
+syn keyword lifelinesFunct date place year long short gettoday dayformat
+syn keyword lifelinesFunct monthformat dateformat extractdate
+syn keyword lifelinesFunct complexdate
+syn keyword lifelinesFunct extractnames extractplaces extracttokens lower
+syn keyword lifelinesFunct upper capitalize trim rjustify save strsave
+syn keyword lifelinesFunct concat strconcat strlen substring index
+syn keyword lifelinesFunct d card ord alpha roman strsoundex strtoint
+syn keyword lifelinesFunct atoi linemode pagemod col row pos pageout nl
+syn keyword lifelinesFunct sp qt newfile outfile copyfile print lock unlock
+syn keyword lifelinesFunct database version system stddate program
+syn keyword lifelinesFunct pvalue pagemode level extractdatestr debug
+syn keyword lifelinesFunct f free getcol getproperty heapused
+
+syn region lifelinesString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lifelinesSpecial
+
+syn region lifelinesComment start="/\*" end="\*/" contains=lifelinesComment
+
+" Only integers with lifelines
+
+syn match lifelinesNumber "\<\d\+\>"
+
+"catch errors caused by wrong parenthesis
+"adapted from original c.vim written by Bram Moolenaar
+
+syn cluster lifelinesParenGroup contains=lifelinesParenError
+syn region lifelinesParen transparent start='(' end=')' contains=ALLBUT,@lifelinesParenGroup
+syn match lifelinesParenError ")"
+syn match lifelinesErrInParen contained "[{}]"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+
+if version >= 508 || !exists("did_lifelines_syn_inits")
+ if version < 508
+ let did_lifelines_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lifelinesConditional Conditional
+ HiLink lifelinesArithm Operator
+ HiLink lifelinesLogical Conditional
+ HiLink lifelinesInclude Include
+ HiLink lifelinesComment Comment
+ HiLink lifelinesStatement Statement
+ HiLink lifelinesUser Statement
+ HiLink lifelinesFunct Statement
+ HiLink lifelinesTable Statement
+ HiLink lifelinesGedcom Statement
+ HiLink lifelinesList Statement
+ HiLink lifelinesRepeat Repeat
+ HiLink lifelinesFam Statement
+ HiLink lifelinesIndi Statement
+ HiLink lifelinesProc Statement
+ HiLink lifelinesDef Statement
+ HiLink lifelinesString String
+ HiLink lifelinesNumber Number
+ HiLink lifelinesParenError Error
+ HiLink lifelinesErrInParen Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lifelines"
+
+" vim: ts=8
diff --git a/runtime/syntax/lilo.vim b/runtime/syntax/lilo.vim
new file mode 100644
index 000000000..a97bb9ca8
--- /dev/null
+++ b/runtime/syntax/lilo.vim
@@ -0,0 +1,194 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: lilo configuration (lilo.conf)
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003 May 04
+" URL: http://trific.ath.cx/Ftp/vim/syntax/lilo.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,.,-,_
+delcommand SetIsk
+
+syn case ignore
+
+" Base constructs
+syn match liloError "\S\+"
+syn match liloComment "#.*$"
+syn match liloEnviron "\$\w\+" contained
+syn match liloEnviron "\${[^}]\+}" contained
+syn match liloDecNumber "\d\+" contained
+syn match liloHexNumber "0[xX]\x\+" contained
+syn match liloDecNumberP "\d\+p\=" contained
+syn match liloSpecial contained "\\\(\"\|\\\|$\)"
+syn region liloString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=liloSpecial,liloEnviron
+syn match liloLabel "\S\+" contained contains=liloSpecial,liloEnviron
+syn region liloPath start=+[$/]+ skip=+\\\\\|\\ \|\\$"+ end=+ \|$+ contained contains=liloSpecial,liloEnviron
+syn match liloDecNumberList "\(\d\|,\)\+" contained contains=liloDecNumber
+syn match liloDecNumberPList "\(\d\|[,p]\)\+" contained contains=liloDecNumberP,liloDecNumber
+syn region liloAnything start=+[^[:space:]#]+ skip=+\\\\\|\\ \|\\$+ end=+ \|$+ contained contains=liloSpecial,liloEnviron,liloString
+
+" Path
+syn keyword liloOption backup bitmap boot disktab force-backup install keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn keyword liloKernelOpt initrd root nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn keyword liloImageOpt path loader table nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn keyword liloDiskOpt partition nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+
+" Other
+syn keyword liloOption menu-scheme raid-extra-boot serial nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
+syn keyword liloOption default nextgroup=liloEqLabel,liloEqLabelComment,liloError skipwhite skipempty
+syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
+syn keyword liloImageOpt alias label nextgroup=liloEqLabel,liloEqLabelComment,liloError skipwhite skipempty
+syn keyword liloImageOpt password range nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
+syn keyword liloDiskOpt set type nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
+
+" Symbolic
+syn keyword liloKernelOpt vga nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
+
+" Number
+syn keyword liloOption delay timeout verbose nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
+syn keyword liloDiskOpt sectors heads cylinders start nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
+
+" String
+syn keyword liloOption menu-title nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
+syn keyword liloKernelOpt append nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
+syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
+
+" Hex number
+syn keyword liloImageOpt map-drive to nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
+syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
+
+" Number list
+syn keyword liloOption bmp-colors bmp-timer nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
+
+" Number list, some of the numbers followed by p
+syn keyword liloOption bmp-table nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
+
+" Flag
+syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt
+syn keyword liloKernelOpt read-only read-write
+syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe
+syn keyword liloDiskOpt change activate deactivate inaccessible reset
+
+" Image
+syn keyword liloImage image other nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn keyword liloDisk disk nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn keyword liloChRules change-rules
+
+" Vga keywords
+syn keyword liloVgaKeyword ask ext extended normal contained
+
+" Comment followed by equal sign and ...
+syn match liloEqPathComment "#.*$" contained nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
+syn match liloEqVgaComment "#.*$" contained nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
+syn match liloEqNumberComment "#.*$" contained nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
+syn match liloEqDecNumberComment "#.*$" contained nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
+syn match liloEqHexNumberComment "#.*$" contained nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
+syn match liloEqStringComment "#.*$" contained nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
+syn match liloEqLabelComment "#.*$" contained nextgroup=liloEqLabel,liloEqLabelComment,liloError skipwhite skipempty
+syn match liloEqNumberListComment "#.*$" contained nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
+syn match liloEqDecNumberPListComment "#.*$" contained nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
+syn match liloEqAnythingComment "#.*$" contained nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
+
+" Equal sign followed by ...
+syn match liloEqPath "=" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
+syn match liloEqVga "=" contained nextgroup=liloVgaKeyword,liloHexNumber,liloDecNumber,liloVgaComment,liloError skipwhite skipempty
+syn match liloEqNumber "=" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
+syn match liloEqDecNumber "=" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
+syn match liloEqHexNumber "=" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
+syn match liloEqString "=" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
+syn match liloEqLabel "=" contained nextgroup=liloLabel,liloLabelComment,liloError skipwhite skipempty
+syn match liloEqNumberList "=" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
+syn match liloEqDecNumberPList "=" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
+syn match liloEqAnything "=" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
+
+" Comment followed by ...
+syn match liloPathComment "#.*$" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
+syn match liloVgaComment "#.*$" contained nextgroup=liloVgaKeyword,liloHexNumber,liloVgaComment,liloError skipwhite skipempty
+syn match liloNumberComment "#.*$" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
+syn match liloDecNumberComment "#.*$" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
+syn match liloHexNumberComment "#.*$" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
+syn match liloStringComment "#.*$" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
+syn match liloLabelComment "#.*$" contained nextgroup=liloLabel,liloLabelComment,liloError skipwhite skipempty
+syn match liloDecNumberListComment "#.*$" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
+syn match liloDecNumberPListComment "#.*$" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
+syn match liloAnythingComment "#.*$" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
+
+" Define the default highlighting
+if version >= 508 || !exists("did_lilo_syntax_inits")
+ if version < 508
+ let did_lilo_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink liloEqPath liloEquals
+ HiLink liloEqWord liloEquals
+ HiLink liloEqVga liloEquals
+ HiLink liloEqDecNumber liloEquals
+ HiLink liloEqHexNumber liloEquals
+ HiLink liloEqNumber liloEquals
+ HiLink liloEqString liloEquals
+ HiLink liloEqLabel liloEquals
+ HiLink liloEqAnything liloEquals
+ HiLink liloEquals Special
+
+ HiLink liloError Error
+
+ HiLink liloEqPathComment liloComment
+ HiLink liloEqVgaComment liloComment
+ HiLink liloEqDecNumberComment liloComment
+ HiLink liloEqHexNumberComment liloComment
+ HiLink liloEqStringComment liloComment
+ HiLink liloEqLabelComment liloComment
+ HiLink liloEqAnythingComment liloComment
+ HiLink liloPathComment liloComment
+ HiLink liloVgaComment liloComment
+ HiLink liloDecNumberComment liloComment
+ HiLink liloHexNumberComment liloComment
+ HiLink liloNumberComment liloComment
+ HiLink liloStringComment liloComment
+ HiLink liloLabelComment liloComment
+ HiLink liloAnythingComment liloComment
+ HiLink liloComment Comment
+
+ HiLink liloDiskOpt liloOption
+ HiLink liloKernelOpt liloOption
+ HiLink liloImageOpt liloOption
+ HiLink liloOption Keyword
+
+ HiLink liloDecNumber liloNumber
+ HiLink liloHexNumber liloNumber
+ HiLink liloDecNumberP liloNumber
+ HiLink liloNumber Number
+ HiLink liloString String
+ HiLink liloPath Constant
+
+ HiLink liloSpecial Special
+ HiLink liloLabel Title
+ HiLink liloDecNumberList Special
+ HiLink liloDecNumberPList Special
+ HiLink liloAnything Normal
+ HiLink liloEnviron Identifier
+ HiLink liloVgaKeyword Identifier
+ HiLink liloImage Type
+ HiLink liloChRules Preproc
+ HiLink liloDisk Preproc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lilo"
diff --git a/runtime/syntax/lisp.vim b/runtime/syntax/lisp.vim
new file mode 100644
index 000000000..30914ef9d
--- /dev/null
+++ b/runtime/syntax/lisp.vim
@@ -0,0 +1,499 @@
+" Vim syntax file
+" Language: Lisp
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 14
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Thanks to F Xavier Noria for a list of 978 Common Lisp symbols
+" taken from the HyperSpec
+"
+" Options:
+" lisp_instring : if it exists, then "(...") strings are highlighted
+" as if the contents were lisp. Useful for AutoLisp.
+" Put let lisp_instring=1 into your <.vimrc> if
+" you want this option.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
+else
+ set iskeyword=42,43,45,47-58,60-62,64-90,97-122,_
+endif
+
+" Clusters
+syn cluster lispAtomCluster contains=lispAtomBarSymbol,lispAtomList,lispAtomNmbr0,lispComment,lispDecl,lispFunc,lispLeadWhite
+syn cluster lispListCluster contains=lispAtom,lispAtomBarSymbol,lispAtomMark,lispBQList,lispBarSymbol,lispComment,lispConcat,lispDecl,lispFunc,lispKey,lispList,lispNumber,lispSpecial,lispSymbol,lispVar,lispLeadWhite
+
+" Lists
+syn match lispSymbol contained ![^()'`,"; \t]\+!
+syn match lispBarSymbol contained !|..\{-}|!
+if exists("lisp_instring")
+ syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster,lispString,lispInString,lispInStringString
+ syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster,lispString,lispInString,lispInStringString
+else
+ syn region lispList matchgroup=Delimiter start="(" skip="|.\{-}|" matchgroup=Delimiter end=")" contains=@lispListCluster,lispString
+ syn region lispBQList matchgroup=PreProc start="`(" skip="|.\{-}|" matchgroup=PreProc end=")" contains=@lispListCluster,lispString
+endif
+" Atoms
+syn match lispAtomMark "'"
+syn match lispAtom "'("me=e-1 contains=lispAtomMark nextgroup=lispAtomList
+syn match lispAtom "'[^ \t()]\+" contains=lispAtomMark
+syn match lispAtomBarSymbol !'|..\{-}|! contains=lispAtomMark
+syn region lispAtom start=+'"+ skip=+\\"+ end=+"+
+syn region lispAtomList contained matchgroup=Special start="(" skip="|.\{-}|" matchgroup=Special end=")" contains=@lispAtomCluster,lispString
+syn match lispAtomNmbr contained "\<\d\+"
+syn match lispLeadWhite contained "^\s\+"
+
+" Standard Lisp Functions and Macros
+syn keyword lispFunc * find-method pprint-indent
+syn keyword lispFunc ** find-package pprint-linear
+syn keyword lispFunc *** find-restart pprint-logical-block
+syn keyword lispFunc + find-symbol pprint-newline
+syn keyword lispFunc ++ finish-output pprint-pop
+syn keyword lispFunc +++ first pprint-tab
+syn keyword lispFunc - fixnum pprint-tabular
+syn keyword lispFunc / flet prin1
+syn keyword lispFunc // float prin1-to-string
+syn keyword lispFunc /// float-digits princ
+syn keyword lispFunc /= float-precision princ-to-string
+syn keyword lispFunc 1+ float-radix print
+syn keyword lispFunc 1- float-sign print-not-readable
+syn keyword lispFunc < floating-point-inexact print-not-readable-object
+syn keyword lispFunc <= floating-point-invalid-operation print-object
+syn keyword lispFunc = floating-point-overflow print-unreadable-object
+syn keyword lispFunc > floating-point-underflow probe-file
+syn keyword lispFunc >= floatp proclaim
+syn keyword lispFunc abort floor prog
+syn keyword lispFunc abs fmakunbound prog*
+syn keyword lispFunc access force-output prog1
+syn keyword lispFunc acons format prog2
+syn keyword lispFunc acos formatter progn
+syn keyword lispFunc acosh fourth program-error
+syn keyword lispFunc add-method fresh-line progv
+syn keyword lispFunc adjoin fround provide
+syn keyword lispFunc adjust-array ftruncate psetf
+syn keyword lispFunc adjustable-array-p ftype psetq
+syn keyword lispFunc allocate-instance funcall push
+syn keyword lispFunc alpha-char-p function pushnew
+syn keyword lispFunc alphanumericp function-keywords putprop
+syn keyword lispFunc and function-lambda-expression quote
+syn keyword lispFunc append functionp random
+syn keyword lispFunc apply gbitp random-state
+syn keyword lispFunc applyhook gcd random-state-p
+syn keyword lispFunc apropos generic-function rassoc
+syn keyword lispFunc apropos-list gensym rassoc-if
+syn keyword lispFunc aref gentemp rassoc-if-not
+syn keyword lispFunc arithmetic-error get ratio
+syn keyword lispFunc arithmetic-error-operands get-decoded-time rational
+syn keyword lispFunc arithmetic-error-operation get-dispatch-macro-character rationalize
+syn keyword lispFunc array get-internal-real-time rationalp
+syn keyword lispFunc array-dimension get-internal-run-time read
+syn keyword lispFunc array-dimension-limit get-macro-character read-byte
+syn keyword lispFunc array-dimensions get-output-stream-string read-char
+syn keyword lispFunc array-displacement get-properties read-char-no-hang
+syn keyword lispFunc array-element-type get-setf-expansion read-delimited-list
+syn keyword lispFunc array-has-fill-pointer-p get-setf-method read-eval-print
+syn keyword lispFunc array-in-bounds-p get-universal-time read-from-string
+syn keyword lispFunc array-rank getf read-line
+syn keyword lispFunc array-rank-limit gethash read-preserving-whitespace
+syn keyword lispFunc array-row-major-index go read-sequence
+syn keyword lispFunc array-total-size graphic-char-p reader-error
+syn keyword lispFunc array-total-size-limit handler-bind readtable
+syn keyword lispFunc arrayp handler-case readtable-case
+syn keyword lispFunc ash hash-table readtablep
+syn keyword lispFunc asin hash-table-count real
+syn keyword lispFunc asinh hash-table-p realp
+syn keyword lispFunc assert hash-table-rehash-size realpart
+syn keyword lispFunc assoc hash-table-rehash-threshold reduce
+syn keyword lispFunc assoc-if hash-table-size reinitialize-instance
+syn keyword lispFunc assoc-if-not hash-table-test rem
+syn keyword lispFunc atan host-namestring remf
+syn keyword lispFunc atanh identity remhash
+syn keyword lispFunc atom if remove
+syn keyword lispFunc base-char if-exists remove-duplicates
+syn keyword lispFunc base-string ignorable remove-if
+syn keyword lispFunc bignum ignore remove-if-not
+syn keyword lispFunc bit ignore-errors remove-method
+syn keyword lispFunc bit-and imagpart remprop
+syn keyword lispFunc bit-andc1 import rename-file
+syn keyword lispFunc bit-andc2 in-package rename-package
+syn keyword lispFunc bit-eqv in-package replace
+syn keyword lispFunc bit-ior incf require
+syn keyword lispFunc bit-nand initialize-instance rest
+syn keyword lispFunc bit-nor inline restart
+syn keyword lispFunc bit-not input-stream-p restart-bind
+syn keyword lispFunc bit-orc1 inspect restart-case
+syn keyword lispFunc bit-orc2 int-char restart-name
+syn keyword lispFunc bit-vector integer return
+syn keyword lispFunc bit-vector-p integer-decode-float return-from
+syn keyword lispFunc bit-xor integer-length revappend
+syn keyword lispFunc block integerp reverse
+syn keyword lispFunc boole interactive-stream-p room
+syn keyword lispFunc boole-1 intern rotatef
+syn keyword lispFunc boole-2 internal-time-units-per-second round
+syn keyword lispFunc boole-and intersection row-major-aref
+syn keyword lispFunc boole-andc1 invalid-method-error rplaca
+syn keyword lispFunc boole-andc2 invoke-debugger rplacd
+syn keyword lispFunc boole-c1 invoke-restart safety
+syn keyword lispFunc boole-c2 invoke-restart-interactively satisfies
+syn keyword lispFunc boole-clr isqrt sbit
+syn keyword lispFunc boole-eqv keyword scale-float
+syn keyword lispFunc boole-ior keywordp schar
+syn keyword lispFunc boole-nand labels search
+syn keyword lispFunc boole-nor lambda second
+syn keyword lispFunc boole-orc1 lambda-list-keywords sequence
+syn keyword lispFunc boole-orc2 lambda-parameters-limit serious-condition
+syn keyword lispFunc boole-set last set
+syn keyword lispFunc boole-xor lcm set-char-bit
+syn keyword lispFunc boolean ldb set-difference
+syn keyword lispFunc both-case-p ldb-test set-dispatch-macro-character
+syn keyword lispFunc boundp ldiff set-exclusive-or
+syn keyword lispFunc break least-negative-double-float set-macro-character
+syn keyword lispFunc broadcast-stream least-negative-long-float set-pprint-dispatch
+syn keyword lispFunc broadcast-stream-streams least-negative-normalized-double-float set-syntax-from-char
+syn keyword lispFunc built-in-class least-negative-normalized-long-float setf
+syn keyword lispFunc butlast least-negative-normalized-short-float setq
+syn keyword lispFunc byte least-negative-normalized-single-float seventh
+syn keyword lispFunc byte-position least-negative-short-float shadow
+syn keyword lispFunc byte-size least-negative-single-float shadowing-import
+syn keyword lispFunc call-arguments-limit least-positive-double-float shared-initialize
+syn keyword lispFunc call-method least-positive-long-float shiftf
+syn keyword lispFunc call-next-method least-positive-normalized-double-float short-float
+syn keyword lispFunc capitalize least-positive-normalized-long-float short-float-epsilon
+syn keyword lispFunc car least-positive-normalized-short-float short-float-negative-epsilon
+syn keyword lispFunc case least-positive-normalized-single-float short-site-name
+syn keyword lispFunc catch least-positive-short-float signal
+syn keyword lispFunc ccase least-positive-single-float signed-byte
+syn keyword lispFunc cdr length signum
+syn keyword lispFunc ceiling let simle-condition
+syn keyword lispFunc cell-error let* simple-array
+syn keyword lispFunc cell-error-name lisp simple-base-string
+syn keyword lispFunc cerror lisp-implementation-type simple-bit-vector
+syn keyword lispFunc change-class lisp-implementation-version simple-bit-vector-p
+syn keyword lispFunc char list simple-condition-format-arguments
+syn keyword lispFunc char-bit list* simple-condition-format-control
+syn keyword lispFunc char-bits list-all-packages simple-error
+syn keyword lispFunc char-bits-limit list-length simple-string
+syn keyword lispFunc char-code listen simple-string-p
+syn keyword lispFunc char-code-limit listp simple-type-error
+syn keyword lispFunc char-control-bit load simple-vector
+syn keyword lispFunc char-downcase load-logical-pathname-translations simple-vector-p
+syn keyword lispFunc char-equal load-time-value simple-warning
+syn keyword lispFunc char-font locally sin
+syn keyword lispFunc char-font-limit log single-flaot-epsilon
+syn keyword lispFunc char-greaterp logand single-float
+syn keyword lispFunc char-hyper-bit logandc1 single-float-epsilon
+syn keyword lispFunc char-int logandc2 single-float-negative-epsilon
+syn keyword lispFunc char-lessp logbitp sinh
+syn keyword lispFunc char-meta-bit logcount sixth
+syn keyword lispFunc char-name logeqv sleep
+syn keyword lispFunc char-not-equal logical-pathname slot-boundp
+syn keyword lispFunc char-not-greaterp logical-pathname-translations slot-exists-p
+syn keyword lispFunc char-not-lessp logior slot-makunbound
+syn keyword lispFunc char-super-bit lognand slot-missing
+syn keyword lispFunc char-upcase lognor slot-unbound
+syn keyword lispFunc char/= lognot slot-value
+syn keyword lispFunc char< logorc1 software-type
+syn keyword lispFunc char<= logorc2 software-version
+syn keyword lispFunc char= logtest some
+syn keyword lispFunc char> logxor sort
+syn keyword lispFunc char>= long-float space
+syn keyword lispFunc character long-float-epsilon special
+syn keyword lispFunc characterp long-float-negative-epsilon special-form-p
+syn keyword lispFunc check-type long-site-name special-operator-p
+syn keyword lispFunc cis loop speed
+syn keyword lispFunc class loop-finish sqrt
+syn keyword lispFunc class-name lower-case-p stable-sort
+syn keyword lispFunc class-of machine-instance standard
+syn keyword lispFunc clear-input machine-type standard-char
+syn keyword lispFunc clear-output machine-version standard-char-p
+syn keyword lispFunc close macro-function standard-class
+syn keyword lispFunc clrhash macroexpand standard-generic-function
+syn keyword lispFunc code-char macroexpand-1 standard-method
+syn keyword lispFunc coerce macroexpand-l standard-object
+syn keyword lispFunc commonp macrolet step
+syn keyword lispFunc compilation-speed make-array storage-condition
+syn keyword lispFunc compile make-array store-value
+syn keyword lispFunc compile-file make-broadcast-stream stream
+syn keyword lispFunc compile-file-pathname make-char stream-element-type
+syn keyword lispFunc compiled-function make-concatenated-stream stream-error
+syn keyword lispFunc compiled-function-p make-condition stream-error-stream
+syn keyword lispFunc compiler-let make-dispatch-macro-character stream-external-format
+syn keyword lispFunc compiler-macro make-echo-stream streamp
+syn keyword lispFunc compiler-macro-function make-hash-table streamup
+syn keyword lispFunc complement make-instance string
+syn keyword lispFunc complex make-instances-obsolete string-capitalize
+syn keyword lispFunc complexp make-list string-char
+syn keyword lispFunc compute-applicable-methods make-load-form string-char-p
+syn keyword lispFunc compute-restarts make-load-form-saving-slots string-downcase
+syn keyword lispFunc concatenate make-method string-equal
+syn keyword lispFunc concatenated-stream make-package string-greaterp
+syn keyword lispFunc concatenated-stream-streams make-pathname string-left-trim
+syn keyword lispFunc cond make-random-state string-lessp
+syn keyword lispFunc condition make-sequence string-not-equal
+syn keyword lispFunc conjugate make-string string-not-greaterp
+syn keyword lispFunc cons make-string-input-stream string-not-lessp
+syn keyword lispFunc consp make-string-output-stream string-right-strim
+syn keyword lispFunc constantly make-symbol string-right-trim
+syn keyword lispFunc constantp make-synonym-stream string-stream
+syn keyword lispFunc continue make-two-way-stream string-trim
+syn keyword lispFunc control-error makunbound string-upcase
+syn keyword lispFunc copy-alist map string/=
+syn keyword lispFunc copy-list map-into string<
+syn keyword lispFunc copy-pprint-dispatch mapc string<=
+syn keyword lispFunc copy-readtable mapcan string=
+syn keyword lispFunc copy-seq mapcar string>
+syn keyword lispFunc copy-structure mapcon string>=
+syn keyword lispFunc copy-symbol maphash stringp
+syn keyword lispFunc copy-tree mapl structure
+syn keyword lispFunc cos maplist structure-class
+syn keyword lispFunc cosh mask-field structure-object
+syn keyword lispFunc count max style-warning
+syn keyword lispFunc count-if member sublim
+syn keyword lispFunc count-if-not member-if sublis
+syn keyword lispFunc ctypecase member-if-not subseq
+syn keyword lispFunc debug merge subsetp
+syn keyword lispFunc decf merge-pathname subst
+syn keyword lispFunc declaim merge-pathnames subst-if
+syn keyword lispFunc declaration method subst-if-not
+syn keyword lispFunc declare method-combination substitute
+syn keyword lispFunc decode-float method-combination-error substitute-if
+syn keyword lispFunc decode-universal-time method-qualifiers substitute-if-not
+syn keyword lispFunc defclass min subtypep
+syn keyword lispFunc defconstant minusp svref
+syn keyword lispFunc defgeneric mismatch sxhash
+syn keyword lispFunc define-compiler-macro mod symbol
+syn keyword lispFunc define-condition most-negative-double-float symbol-function
+syn keyword lispFunc define-method-combination most-negative-fixnum symbol-macrolet
+syn keyword lispFunc define-modify-macro most-negative-long-float symbol-name
+syn keyword lispFunc define-setf-expander most-negative-short-float symbol-package
+syn keyword lispFunc define-setf-method most-negative-single-float symbol-plist
+syn keyword lispFunc define-symbol-macro most-positive-double-float symbol-value
+syn keyword lispFunc defmacro most-positive-fixnum symbolp
+syn keyword lispFunc defmethod most-positive-long-float synonym-stream
+syn keyword lispFunc defpackage most-positive-short-float synonym-stream-symbol
+syn keyword lispFunc defparameter most-positive-single-float sys
+syn keyword lispFunc defsetf muffle-warning system
+syn keyword lispFunc defstruct multiple-value-bind t
+syn keyword lispFunc deftype multiple-value-call tagbody
+syn keyword lispFunc defun multiple-value-list tailp
+syn keyword lispFunc defvar multiple-value-prog1 tan
+syn keyword lispFunc delete multiple-value-seteq tanh
+syn keyword lispFunc delete-duplicates multiple-value-setq tenth
+syn keyword lispFunc delete-file multiple-values-limit terpri
+syn keyword lispFunc delete-if name-char the
+syn keyword lispFunc delete-if-not namestring third
+syn keyword lispFunc delete-package nbutlast throw
+syn keyword lispFunc denominator nconc time
+syn keyword lispFunc deposit-field next-method-p trace
+syn keyword lispFunc describe nil translate-logical-pathname
+syn keyword lispFunc describe-object nintersection translate-pathname
+syn keyword lispFunc destructuring-bind ninth tree-equal
+syn keyword lispFunc digit-char no-applicable-method truename
+syn keyword lispFunc digit-char-p no-next-method truncase
+syn keyword lispFunc directory not truncate
+syn keyword lispFunc directory-namestring notany two-way-stream
+syn keyword lispFunc disassemble notevery two-way-stream-input-stream
+syn keyword lispFunc division-by-zero notinline two-way-stream-output-stream
+syn keyword lispFunc do nreconc type
+syn keyword lispFunc do* nreverse type-error
+syn keyword lispFunc do-all-symbols nset-difference type-error-datum
+syn keyword lispFunc do-exeternal-symbols nset-exclusive-or type-error-expected-type
+syn keyword lispFunc do-external-symbols nstring type-of
+syn keyword lispFunc do-symbols nstring-capitalize typecase
+syn keyword lispFunc documentation nstring-downcase typep
+syn keyword lispFunc dolist nstring-upcase unbound-slot
+syn keyword lispFunc dotimes nsublis unbound-slot-instance
+syn keyword lispFunc double-float nsubst unbound-variable
+syn keyword lispFunc double-float-epsilon nsubst-if undefined-function
+syn keyword lispFunc double-float-negative-epsilon nsubst-if-not unexport
+syn keyword lispFunc dpb nsubstitute unintern
+syn keyword lispFunc dribble nsubstitute-if union
+syn keyword lispFunc dynamic-extent nsubstitute-if-not unless
+syn keyword lispFunc ecase nth unread
+syn keyword lispFunc echo-stream nth-value unread-char
+syn keyword lispFunc echo-stream-input-stream nthcdr unsigned-byte
+syn keyword lispFunc echo-stream-output-stream null untrace
+syn keyword lispFunc ed number unuse-package
+syn keyword lispFunc eighth numberp unwind-protect
+syn keyword lispFunc elt numerator update-instance-for-different-class
+syn keyword lispFunc encode-universal-time nunion update-instance-for-redefined-class
+syn keyword lispFunc end-of-file oddp upgraded-array-element-type
+syn keyword lispFunc endp open upgraded-complex-part-type
+syn keyword lispFunc enough-namestring open-stream-p upper-case-p
+syn keyword lispFunc ensure-directories-exist optimize use-package
+syn keyword lispFunc ensure-generic-function or use-value
+syn keyword lispFunc eq otherwise user
+syn keyword lispFunc eql output-stream-p user-homedir-pathname
+syn keyword lispFunc equal package values
+syn keyword lispFunc equalp package-error values-list
+syn keyword lispFunc error package-error-package vector
+syn keyword lispFunc etypecase package-name vector-pop
+syn keyword lispFunc eval package-nicknames vector-push
+syn keyword lispFunc eval-when package-shadowing-symbols vector-push-extend
+syn keyword lispFunc evalhook package-use-list vectorp
+syn keyword lispFunc evenp package-used-by-list warn
+syn keyword lispFunc every packagep warning
+syn keyword lispFunc exp pairlis when
+syn keyword lispFunc export parse-error wild-pathname-p
+syn keyword lispFunc expt parse-integer with-accessors
+syn keyword lispFunc extended-char parse-namestring with-compilation-unit
+syn keyword lispFunc fboundp pathname with-condition-restarts
+syn keyword lispFunc fceiling pathname-device with-hash-table-iterator
+syn keyword lispFunc fdefinition pathname-directory with-input-from-string
+syn keyword lispFunc ffloor pathname-host with-open-file
+syn keyword lispFunc fifth pathname-match-p with-open-stream
+syn keyword lispFunc file-author pathname-name with-output-to-string
+syn keyword lispFunc file-error pathname-type with-package-iterator
+syn keyword lispFunc file-error-pathname pathname-version with-simple-restart
+syn keyword lispFunc file-length pathnamep with-slots
+syn keyword lispFunc file-namestring peek-char with-standard-io-syntax
+syn keyword lispFunc file-position phase write
+syn keyword lispFunc file-stream pi write-byte
+syn keyword lispFunc file-string-length plusp write-char
+syn keyword lispFunc file-write-date pop write-line
+syn keyword lispFunc fill position write-sequence
+syn keyword lispFunc fill-pointer position-if write-string
+syn keyword lispFunc find position-if-not write-to-string
+syn keyword lispFunc find-all-symbols pprint y-or-n-p
+syn keyword lispFunc find-class pprint-dispatch yes-or-no-p
+syn keyword lispFunc find-if pprint-exit-if-list-exhausted zerop
+syn keyword lispFunc find-if-not pprint-fill
+
+syn match lispFunc "\<c[ad]\+r\>"
+
+
+" Lisp Keywords (modifiers)
+syn keyword lispKey :abort :from-end :overwrite
+syn keyword lispKey :adjustable :gensym :predicate
+syn keyword lispKey :append :host :preserve-whitespace
+syn keyword lispKey :array :if-does-not-exist :pretty
+syn keyword lispKey :base :if-exists :print
+syn keyword lispKey :case :include :print-function
+syn keyword lispKey :circle :index :probe
+syn keyword lispKey :conc-name :inherited :radix
+syn keyword lispKey :constructor :initial-contents :read-only
+syn keyword lispKey :copier :initial-element :rehash-size
+syn keyword lispKey :count :initial-offset :rehash-threshold
+syn keyword lispKey :create :initial-value :rename
+syn keyword lispKey :default :input :rename-and-delete
+syn keyword lispKey :defaults :internal :size
+syn keyword lispKey :device :io :start
+syn keyword lispKey :direction :junk-allowed :start1
+syn keyword lispKey :directory :key :start2
+syn keyword lispKey :displaced-index-offset :length :stream
+syn keyword lispKey :displaced-to :level :supersede
+syn keyword lispKey :element-type :name :test
+syn keyword lispKey :end :named :test-not
+syn keyword lispKey :end1 :new-version :type
+syn keyword lispKey :end2 :nicknames :use
+syn keyword lispKey :error :output :verbose
+syn keyword lispKey :escape :output-file :version
+syn keyword lispKey :external
+
+" Standard Lisp Variables
+syn keyword lispVar *applyhook* *load-pathname* *print-pprint-dispatch*
+syn keyword lispVar *break-on-signals* *load-print* *print-pprint-dispatch*
+syn keyword lispVar *break-on-signals* *load-truename* *print-pretty*
+syn keyword lispVar *break-on-warnings* *load-verbose* *print-radix*
+syn keyword lispVar *compile-file-pathname* *macroexpand-hook* *print-readably*
+syn keyword lispVar *compile-file-pathname* *modules* *print-right-margin*
+syn keyword lispVar *compile-file-truename* *package* *print-right-margin*
+syn keyword lispVar *compile-file-truename* *print-array* *query-io*
+syn keyword lispVar *compile-print* *print-base* *random-state*
+syn keyword lispVar *compile-verbose* *print-case* *read-base*
+syn keyword lispVar *compile-verbose* *print-circle* *read-default-float-format*
+syn keyword lispVar *debug-io* *print-escape* *read-eval*
+syn keyword lispVar *debugger-hook* *print-gensym* *read-suppress*
+syn keyword lispVar *default-pathname-defaults* *print-length* *readtable*
+syn keyword lispVar *error-output* *print-level* *standard-input*
+syn keyword lispVar *evalhook* *print-lines* *standard-output*
+syn keyword lispVar *features* *print-miser-width* *terminal-io*
+syn keyword lispVar *gensym-counter* *print-miser-width* *trace-output*
+
+" Strings
+syn region lispString start=+"+ skip=+\\\\\|\\"+ end=+"+
+if exists("lisp_instring")
+ syn region lispInString keepend matchgroup=Delimiter start=+"(+rs=s+1 skip=+|.\{-}|+ matchgroup=Delimiter end=+)"+ contains=@lispListCluster,lispInStringString
+ syn region lispInStringString start=+\\"+ skip=+\\\\+ end=+\\"+ contained
+endif
+
+" Shared with Xlisp, Declarations, Macros, Functions
+syn keyword lispDecl defmacro do-all-symbols labels
+syn keyword lispDecl defsetf do-external-symbols let
+syn keyword lispDecl deftype do-symbols locally
+syn keyword lispDecl defun dotimes macrolet
+syn keyword lispDecl do* flet multiple-value-bind
+
+" Numbers: supporting integers and floating point numbers
+syn match lispNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\(e[-+]\=\d\+\)\="
+
+syn match lispSpecial "\*[a-zA-Z_][a-zA-Z_0-9-]*\*"
+syn match lispSpecial !#|[^()'`,"; \t]\+|#!
+syn match lispSpecial !#x[0-9a-fA-F]\+!
+syn match lispSpecial !#o[0-7]\+!
+syn match lispSpecial !#b[01]\+!
+syn match lispSpecial !#\\[ -\~]!
+syn match lispSpecial !#[':][^()'`,"; \t]\+!
+syn match lispSpecial !#([^()'`,"; \t]\+)!
+
+syn match lispConcat "\s\.\s"
+syn match lispParenError ")"
+
+" Comments
+syn cluster lispCommentGroup contains=lispTodo,@Spell
+syn match lispComment ";.*$" contains=@lispCommentGroup
+syn region lispCommentRegion start="#|" end="|#" contains=lispCommentRegion,@lispCommentGroup
+syn case ignore
+syn keyword lispTodo contained combak combak: todo todo:
+syn case match
+
+" synchronization
+syn sync lines=100
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lisp_syntax_inits")
+ if version < 508
+ let did_lisp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lispCommentRegion lispComment
+ HiLink lispAtomNmbr lispNumber
+ HiLink lispAtomMark lispMark
+ HiLink lispInStringString lispString
+
+ HiLink lispAtom Identifier
+ HiLink lispAtomBarSymbol Special
+ HiLink lispBarSymbol Special
+ HiLink lispComment Comment
+ HiLink lispConcat Statement
+ HiLink lispDecl Statement
+ HiLink lispFunc Statement
+ HiLink lispKey Type
+ HiLink lispMark Delimiter
+ HiLink lispNumber Number
+ HiLink lispParenError Error
+ HiLink lispSpecial Type
+ HiLink lispString String
+ HiLink lispTodo Todo
+ HiLink lispVar Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lisp"
+
+" vim: ts=8 nowrap
diff --git a/runtime/syntax/lite.vim b/runtime/syntax/lite.vim
new file mode 100644
index 000000000..8abc51dea
--- /dev/null
+++ b/runtime/syntax/lite.vim
@@ -0,0 +1,181 @@
+" Vim syntax file
+" Language: lite
+" Maintainer: Lutz Eymers <ixtab@polzin.com>
+" URL: http://www.isp.de/data/lite.vim
+" Email: Subject: send syntax_vim.tgz
+" Last Change: 2001 Mai 01
+"
+" Options lite_sql_query = 1 for SQL syntax highligthing inside strings
+" lite_minlines = x to sync at least x lines backwards
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'lite'
+endif
+
+if main_syntax == 'lite'
+ if exists("lite_sql_query")
+ if lite_sql_query == 1
+ syn include @liteSql <sfile>:p:h/sql.vim
+ unlet b:current_syntax
+ endif
+ endif
+endif
+
+if main_syntax == 'msql'
+ if exists("msql_sql_query")
+ if msql_sql_query == 1
+ syn include @liteSql <sfile>:p:h/sql.vim
+ unlet b:current_syntax
+ endif
+ endif
+endif
+
+syn cluster liteSql remove=sqlString,sqlComment
+
+syn case match
+
+" Internal Variables
+syn keyword liteIntVar ERRMSG contained
+
+" Comment
+syn region liteComment start="/\*" end="\*/" contains=liteTodo
+
+" Function names
+syn keyword liteFunctions echo printf fprintf open close read
+syn keyword liteFunctions readln readtok
+syn keyword liteFunctions split strseg chop tr sub substr
+syn keyword liteFunctions test unlink umask chmod mkdir chdir rmdir
+syn keyword liteFunctions rename truncate link symlink stat
+syn keyword liteFunctions sleep system getpid getppid kill
+syn keyword liteFunctions time ctime time2unixtime unixtime2year
+syn keyword liteFunctions unixtime2year unixtime2month unixtime2day
+syn keyword liteFunctions unixtime2hour unixtime2min unixtime2sec
+syn keyword liteFunctions strftime
+syn keyword liteFunctions getpwnam getpwuid
+syn keyword liteFunctions gethostbyname gethostbyaddress
+syn keyword liteFunctions urlEncode setContentType includeFile
+syn keyword liteFunctions msqlConnect msqlClose msqlSelectDB
+syn keyword liteFunctions msqlQuery msqlStoreResult msqlFreeResult
+syn keyword liteFunctions msqlFetchRow msqlDataSeek msqlListDBs
+syn keyword liteFunctions msqlListTables msqlInitFieldList msqlListField
+syn keyword liteFunctions msqlFieldSeek msqlNumRows msqlEncode
+syn keyword liteFunctions exit fatal typeof
+syn keyword liteFunctions crypt addHttpHeader
+
+" Conditional
+syn keyword liteConditional if else
+
+" Repeat
+syn keyword liteRepeat while
+
+" Operator
+syn keyword liteStatement break return continue
+
+" Operator
+syn match liteOperator "[-+=#*]"
+syn match liteOperator "/[^*]"me=e-1
+syn match liteOperator "\$"
+syn match liteRelation "&&"
+syn match liteRelation "||"
+syn match liteRelation "[!=<>]="
+syn match liteRelation "[<>]"
+
+" Identifier
+syn match liteIdentifier "$\h\w*" contains=liteIntVar,liteOperator
+syn match liteGlobalIdentifier "@\h\w*" contains=liteIntVar
+
+" Include
+syn keyword liteInclude load
+
+" Define
+syn keyword liteDefine funct
+
+" Type
+syn keyword liteType int uint char real
+
+" String
+syn region liteString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=liteIdentifier,liteSpecialChar,@liteSql
+
+" Number
+syn match liteNumber "-\=\<\d\+\>"
+
+" Float
+syn match liteFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
+
+" SpecialChar
+syn match liteSpecialChar "\\[abcfnrtv\\]" contained
+
+syn match liteParentError "[)}\]]"
+
+" Todo
+syn keyword liteTodo TODO Todo todo contained
+
+" dont syn #!...
+syn match liteExec "^#!.*$"
+
+" Parents
+syn cluster liteInside contains=liteComment,liteFunctions,liteIdentifier,liteGlobalIdentifier,liteConditional,liteRepeat,liteStatement,liteOperator,liteRelation,liteType,liteString,liteNumber,liteFloat,liteParent
+
+syn region liteParent matchgroup=Delimiter start="(" end=")" contains=@liteInside
+syn region liteParent matchgroup=Delimiter start="{" end="}" contains=@liteInside
+syn region liteParent matchgroup=Delimiter start="\[" end="\]" contains=@liteInside
+
+" sync
+if main_syntax == 'lite'
+ if exists("lite_minlines")
+ exec "syn sync minlines=" . lite_minlines
+ else
+ syn sync minlines=100
+ endif
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lite_syn_inits")
+ if version < 508
+ let did_lite_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink liteComment Comment
+ HiLink liteString String
+ HiLink liteNumber Number
+ HiLink liteFloat Float
+ HiLink liteIdentifier Identifier
+ HiLink liteGlobalIdentifier Identifier
+ HiLink liteIntVar Identifier
+ HiLink liteFunctions Function
+ HiLink liteRepeat Repeat
+ HiLink liteConditional Conditional
+ HiLink liteStatement Statement
+ HiLink liteType Type
+ HiLink liteInclude Include
+ HiLink liteDefine Define
+ HiLink liteSpecialChar SpecialChar
+ HiLink liteParentError liteError
+ HiLink liteError Error
+ HiLink liteTodo Todo
+ HiLink liteOperator Operator
+ HiLink liteRelation Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lite"
+
+if main_syntax == 'lite'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim
new file mode 100644
index 000000000..b8218da3e
--- /dev/null
+++ b/runtime/syntax/logtalk.vim
@@ -0,0 +1,428 @@
+" Vim syntax file
+"
+" Language: Logtalk
+" Maintainer: Paulo Moura <pmoura@logtalk.org>
+" Last Change: 2004 May 16
+
+
+" Quit when a syntax file was already loaded:
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" Logtalk is case sensitive:
+
+syn case match
+
+
+" Logtalk variables
+
+syn match logtalkVariable "\<\(\u\|_\)\(\w\)*\>"
+
+
+" Logtalk clause functor
+
+syn match logtalkOperator ":-"
+
+
+" Logtalk quoted atoms and strings
+
+syn region logtalkString start=+"+ skip=+\\"+ end=+"+
+syn region logtalkAtom start=+'+ skip=+\\'+ end=+'+
+
+
+" Logtalk message sending operators
+
+syn match logtalkOperator "::"
+syn match logtalkOperator "\^\^"
+
+
+" Logtalk external call
+
+syn region logtalkExtCall matchgroup=logtalkExtCallTag start="{" matchgroup=logtalkExtCallTag end="}" contains=ALL
+
+
+" Logtalk opening entity directives
+
+syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
+syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
+syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
+
+
+" Logtalk closing entity directives
+
+syn match logtalkCloseEntityDir ":- end_object\."
+syn match logtalkCloseEntityDir ":- end_protocol\."
+syn match logtalkCloseEntityDir ":- end_category\."
+
+
+" Logtalk entity relations
+
+syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
+syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
+syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
+syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
+syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
+
+
+" Logtalk directives
+
+syn region logtalkDir matchgroup=logtalkDirTag start=":- initialization(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- info(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- mode(" matchgroup=logtalkDirTag end=")\." contains=logtalkOperator,logtalkAtom
+syn region logtalkDir matchgroup=logtalkDirTag start=":- dynamic(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn match logtalkDirTag ":- dynamic\."
+syn region logtalkDir matchgroup=logtalkDirTag start=":- discontiguous(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- public(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- protected(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- private(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- metapredicate(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- op(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- calls(" matchgroup=logtalkDirTag end=")\." contains=ALL
+syn region logtalkDir matchgroup=logtalkDirTag start=":- uses(" matchgroup=logtalkDirTag end=")\." contains=ALL
+
+
+" Logtalk built-in predicates
+
+syn match logtalkBuiltIn "\<current_object\ze("
+syn match logtalkBuiltIn "\<current_protocol\ze("
+syn match logtalkBuiltIn "\<current_category\ze("
+
+syn match logtalkBuiltIn "\<create_object\ze("
+syn match logtalkBuiltIn "\<create_protocol\ze("
+syn match logtalkBuiltIn "\<create_category\ze("
+
+syn match logtalkBuiltIn "\<object_property\ze("
+syn match logtalkBuiltIn "\<protocol_property\ze("
+syn match logtalkBuiltIn "\<category_property\ze("
+
+syn match logtalkBuiltIn "\<abolish_object\ze("
+syn match logtalkBuiltIn "\<abolish_protocol\ze("
+syn match logtalkBuiltIn "\<abolish_category\ze("
+
+syn match logtalkBuiltIn "\<extends_object\ze("
+syn match logtalkBuiltIn "\<extends_protocol\ze("
+syn match logtalkBuiltIn "\<implements_protocol\ze("
+syn match logtalkBuiltIn "\<instantiates_class\ze("
+syn match logtalkBuiltIn "\<specializes_class\ze("
+syn match logtalkBuiltIn "\<imports_category\ze("
+
+syn match logtalkBuiltIn "\<abolish_events\ze("
+syn match logtalkBuiltIn "\<current_event\ze("
+syn match logtalkBuiltIn "\<define_events\ze("
+
+syn match logtalkBuiltIn "\<current_logtalk_flag\ze("
+syn match logtalkBuiltIn "\<set_logtalk_flag\ze("
+
+syn match logtalkBuiltIn "\<logtalk_compile\ze("
+syn match logtalkBuiltIn "\<logtalk_load\ze("
+
+syn match logtalkBuiltIn "\<forall\ze("
+syn match logtalkBuiltIn "\<retractall\ze("
+
+
+" Logtalk built-in methods
+
+syn match logtalkBuiltInMethod "\<parameter\ze("
+syn match logtalkBuiltInMethod "\<self\ze("
+syn match logtalkBuiltInMethod "\<sender\ze("
+syn match logtalkBuiltInMethod "\<this\ze("
+
+syn match logtalkBuiltInMethod "\<current_predicate\ze("
+syn match logtalkBuiltInMethod "\<predicate_property\ze("
+
+syn match logtalkBuiltInMethod "\<abolish\ze("
+syn match logtalkBuiltInMethod "\<asserta\ze("
+syn match logtalkBuiltInMethod "\<assertz\ze("
+syn match logtalkBuiltInMethod "\<clause\ze("
+syn match logtalkBuiltInMethod "\<retract\ze("
+syn match logtalkBuiltInMethod "\<retractall\ze("
+
+syn match logtalkBuiltInMethod "\<bagof\ze("
+syn match logtalkBuiltInMethod "\<findall\ze("
+syn match logtalkBuiltInMethod "\<forall\ze("
+syn match logtalkBuiltInMethod "\<setof\ze("
+
+syn match logtalkBuiltInMethod "\<before\ze("
+syn match logtalkBuiltInMethod "\<after\ze("
+
+syn match logtalkBuiltInMethod "\<phrase\ze("
+
+
+" Mode operators
+
+syn match logtalkOperator "?"
+syn match logtalkOperator "@"
+
+
+" Control constructs
+
+syn match logtalkKeyword "\<true\>"
+syn match logtalkKeyword "\<fail\>"
+syn match logtalkKeyword "\<call\ze("
+syn match logtalkOperator "!"
+syn match logtalkOperator ","
+syn match logtalkOperator ";"
+syn match logtalkOperator "-->"
+syn match logtalkOperator "->"
+syn match logtalkKeyword "\<catch\ze("
+syn match logtalkKeyword "\<throw\ze("
+
+
+" Term unification
+
+syn match logtalkOperator "="
+syn match logtalkKeyword "\<unify_with_occurs_check\ze("
+syn match logtalkOperator "\\="
+
+
+" Term testing
+
+syn match logtalkKeyword "\<var\ze("
+syn match logtalkKeyword "\<atom\ze("
+syn match logtalkKeyword "\<integer\ze("
+syn match logtalkKeyword "\<float\ze("
+syn match logtalkKeyword "\<atomic\ze("
+syn match logtalkKeyword "\<compound\ze("
+syn match logtalkKeyword "\<nonvar\ze("
+syn match logtalkKeyword "\<number\ze("
+
+
+" Term comparison
+
+syn match logtalkOperator "@=<"
+syn match logtalkOperator "=="
+syn match logtalkOperator "\\=="
+syn match logtalkOperator "@<"
+syn match logtalkOperator "@>"
+syn match logtalkOperator "@>="
+
+
+" Term creation and decomposition
+
+syn match logtalkKeyword "\<functor\ze("
+syn match logtalkKeyword "\<arg\ze("
+syn match logtalkOperator "=\.\."
+syn match logtalkKeyword "\<copy_term\ze("
+
+
+" Arithemtic evaluation
+
+syn keyword logtalkOperator is
+
+
+" Arithemtic comparison
+
+syn match logtalkOperator "=:="
+syn match logtalkOperator "=\\="
+syn match logtalkOperator "<"
+syn match logtalkOperator "=<"
+syn match logtalkOperator ">"
+syn match logtalkOperator ">="
+
+
+" Stream selection and control
+
+syn match logtalkKeyword "\<current_input\ze("
+syn match logtalkKeyword "\<current_output\ze("
+syn match logtalkKeyword "\<set_input\ze("
+syn match logtalkKeyword "\<set_output\ze("
+syn match logtalkKeyword "\<open\ze("
+syn match logtalkKeyword "\<close\ze("
+syn match logtalkKeyword "\<flush_output\ze("
+syn match logtalkKeyword "\<flush_output\>"
+syn match logtalkKeyword "\<stream_property\ze("
+syn match logtalkKeyword "\<at_end_of_stream\ze("
+syn match logtalkKeyword "\<at_end_of_stream\>"
+syn match logtalkKeyword "\<set_stream_position\ze("
+
+
+" Character input/output
+
+syn match logtalkKeyword "\<get_char\ze("
+syn match logtalkKeyword "\<get_code\ze("
+syn match logtalkKeyword "\<peek_char\ze("
+syn match logtalkKeyword "\<peek_code\ze("
+syn match logtalkKeyword "\<put_char\ze("
+syn match logtalkKeyword "\<put_code\ze("
+syn match logtalkKeyword "\<nl\ze("
+syn match logtalkKeyword "\<nl\>"
+
+
+" Byte input/output
+
+syn match logtalkKeyword "\<get_byte\ze("
+syn match logtalkKeyword "\<peek_byte\ze("
+syn match logtalkKeyword "\<put_byte\ze("
+
+
+" Term input/output
+
+syn match logtalkKeyword "\<read_term\ze("
+syn match logtalkKeyword "\<read\ze("
+syn match logtalkKeyword "\<write_term\ze("
+syn match logtalkKeyword "\<write\ze("
+syn match logtalkKeyword "\<writeq\ze("
+syn match logtalkKeyword "\<write_canonical\ze("
+syn match logtalkKeyword "\<op\ze("
+syn match logtalkKeyword "\<current_op\ze("
+syn match logtalkKeyword "\<char_conversion\ze("
+syn match logtalkKeyword "\<current_char_conversion\ze("
+
+
+" Logic and control
+
+syn match logtalkOperator "\\+"
+syn match logtalkKeyword "\<once\ze("
+syn match logtalkKeyword "\<repeat\>"
+
+
+" Atomic term processing
+
+syn match logtalkKeyword "\<atom_length\ze("
+syn match logtalkKeyword "\<atom_concat\ze("
+syn match logtalkKeyword "\<sub_atom\ze("
+syn match logtalkKeyword "\<atom_chars\ze("
+syn match logtalkKeyword "\<atom_codes\ze("
+syn match logtalkKeyword "\<char_code\ze("
+syn match logtalkKeyword "\<number_chars\ze("
+syn match logtalkKeyword "\<number_codes\ze("
+
+
+" Implementation defined hooks functions
+
+syn match logtalkKeyword "\<set_prolog_flag\ze("
+syn match logtalkKeyword "\<current_prolog_flag\ze("
+syn match logtalkKeyword "\<halt\ze("
+syn match logtalkKeyword "\<halt\>"
+
+
+" Evaluable functors
+
+syn match logtalkOperator "+"
+syn match logtalkOperator "-"
+syn match logtalkOperator "\*"
+syn match logtalkOperator "//"
+syn match logtalkOperator "/"
+syn match logtalkKeyword "\<rem(?=[(])"
+syn match logtalkKeyword "\<rem\>"
+syn match logtalkKeyword "\<mod\ze("
+syn match logtalkKeyword "\<mod\>"
+syn match logtalkKeyword "\<abs\ze("
+syn match logtalkKeyword "\<sign\ze("
+syn match logtalkKeyword "\<float_integer_part\ze("
+syn match logtalkKeyword "\<float_fractional_part\ze("
+syn match logtalkKeyword "\<float\ze("
+syn match logtalkKeyword "\<floor\ze("
+syn match logtalkKeyword "\<truncate\ze("
+syn match logtalkKeyword "\<round\ze("
+syn match logtalkKeyword "\<ceiling\ze("
+
+
+" Other arithemtic functors
+
+syn match logtalkOperator "\*\*"
+syn match logtalkKeyword "\<sin\ze("
+syn match logtalkKeyword "\<cos\ze("
+syn match logtalkKeyword "\<atan\ze("
+syn match logtalkKeyword "\<exp\ze("
+syn match logtalkKeyword "\<log\ze("
+syn match logtalkKeyword "\<sqrt\ze("
+
+
+" Bitwise functors
+
+syn match logtalkOperator ">>"
+syn match logtalkOperator "<<"
+syn match logtalkOperator "/\\"
+syn match logtalkOperator "\\/"
+syn match logtalkOperator "\\"
+
+
+" Logtalk end-of-clause
+
+syn match logtalkOperator "\."
+
+
+" Logtalk list operator
+
+syn match logtalkOperator "|"
+
+
+" Logtalk comments
+
+syn region logtalkBlockComment start="/\*" end="\*/"
+syn match logtalkLineComment "%.*"
+
+
+" Logtalk numbers
+
+syn match logtalkNumber "\<[0-9]\+\>"
+syn match logtalkNumber "\<[0-9]\+\.[0-9]\+\>"
+syn match logtalkNumber "\<[0-9]\+\.[0-9]\+[eE][-+][0-9]+\>"
+syn match logtalkNumber "\<0'[0-9a-zA-Z]\>"
+syn match logtalkNumber "\<0b[0-1]\+\>"
+syn match logtalkNumber "\<0o[0-7]\+\>"
+syn match logtalkNumber "\<0x[0-9a-fA-F]\+\>"
+
+
+syn sync ccomment maxlines=50
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+
+if version >= 508 || !exists("did_logtalk_syn_inits")
+ if version < 508
+ let did_logtalk_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink logtalkBlockComment Comment
+ HiLink logtalkLineComment Comment
+
+ HiLink logtalkOpenEntityDir Normal
+ HiLink logtalkOpenEntityDirTag PreProc
+
+ HiLink logtalkEntity Normal
+
+ HiLink logtalkEntityRel Normal
+ HiLink logtalkEntityRelTag PreProc
+
+ HiLink logtalkCloseEntityDir PreProc
+
+ HiLink logtalkDir Normal
+ HiLink logtalkDirTag PreProc
+
+ HiLink logtalkAtom String
+ HiLink logtalkString String
+
+ HiLink logtalkNumber Number
+
+ HiLink logtalkKeyword Keyword
+
+ HiLink logtalkBuiltIn Keyword
+ HiLink logtalkBuiltInMethod Keyword
+
+ HiLink logtalkOperator Operator
+
+ HiLink logtalkExtCall Normal
+ HiLink logtalkExtCallTag Operator
+
+ HiLink logtalkVariable Identifier
+
+ delcommand HiLink
+
+endif
+
+
+let b:current_syntax = "logtalk"
+
+setlocal ts=4
diff --git a/runtime/syntax/lotos.vim b/runtime/syntax/lotos.vim
new file mode 100644
index 000000000..3cd83c4d8
--- /dev/null
+++ b/runtime/syntax/lotos.vim
@@ -0,0 +1,82 @@
+" Vim syntax file
+" Language: LOTOS (Language Of Temporal Ordering Specifications, IS8807)
+" Maintainer: Daniel Amyot <damyot@csi.uottawa.ca>
+" Last Change: Wed Aug 19 1998
+" URL: http://lotos.csi.uottawa.ca/~damyot/vim/lotos.vim
+" This file is an adaptation of pascal.vim by Mario Eusebio
+" I'm not sure I understand all of the syntax highlight language,
+" but this file seems to do the job for standard LOTOS.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+"Comments in LOTOS are between (* and *)
+syn region lotosComment start="(\*" end="\*)" contains=lotosTodo
+
+"Operators [], [...], >>, ->, |||, |[...]|, ||, ;, !, ?, :, =, ,, :=
+syn match lotosDelimiter "[][]"
+syn match lotosDelimiter ">>"
+syn match lotosDelimiter "->"
+syn match lotosDelimiter "\[>"
+syn match lotosDelimiter "[|;!?:=,]"
+
+"Regular keywords
+syn keyword lotosStatement specification endspec process endproc
+syn keyword lotosStatement where behaviour behavior
+syn keyword lotosStatement any let par accept choice hide of in
+syn keyword lotosStatement i stop exit noexit
+
+"Operators from the Abstract Data Types in IS8807
+syn keyword lotosOperator eq ne succ and or xor implies iff
+syn keyword lotosOperator not true false
+syn keyword lotosOperator Insert Remove IsIn NotIn Union Ints
+syn keyword lotosOperator Minus Includes IsSubsetOf
+syn keyword lotosOperator lt le ge gt 0
+
+"Sorts in IS8807
+syn keyword lotosSort Boolean Bool FBoolean FBool Element
+syn keyword lotosSort Set String NaturalNumber Nat HexString
+syn keyword lotosSort HexDigit DecString DecDigit
+syn keyword lotosSort OctString OctDigit BitString Bit
+syn keyword lotosSort Octet OctetString
+
+"Keywords for ADTs
+syn keyword lotosType type endtype library endlib sorts formalsorts
+syn keyword lotosType eqns formaleqns opns formalopns forall ofsort is
+syn keyword lotosType for renamedby actualizedby sortnames opnnames
+syn keyword lotosType using
+
+syn sync lines=250
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lotos_syntax_inits")
+ if version < 508
+ let did_lotos_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lotosStatement Statement
+ HiLink lotosProcess Label
+ HiLink lotosOperator Operator
+ HiLink lotosSort Function
+ HiLink lotosType Type
+ HiLink lotosComment Comment
+ HiLink lotosDelimiter String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lotos"
+
+" vim: ts=8
diff --git a/runtime/syntax/lout.vim b/runtime/syntax/lout.vim
new file mode 100644
index 000000000..ea4cb0038
--- /dev/null
+++ b/runtime/syntax/lout.vim
@@ -0,0 +1,139 @@
+" Vim syntax file
+" Language: Lout
+" Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
+" Last Change: Son 22 Jun 2003 20:43:26 CEST
+" Filenames: *.lout,*.lt
+" URL: http://www.cvjb.de/comp/vim/lout.vim
+" $Id$
+"
+" Lout: Basser Lout document formatting system.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Lout is case sensitive
+syn case match
+
+" Synchronization, I know it is a huge number, but normal texts can be
+" _very_ long ;-)
+syn sync lines=1000
+
+" Characters allowed in keywords
+" I don't know if 128-255 are allowed in ANS-FORHT
+if version >= 600
+ setlocal iskeyword=@,48-57,.,@-@,_,192-255
+else
+ set iskeyword=@,48-57,.,@-@,_,192-255
+endif
+
+" Some special keywords
+syn keyword loutTodo contained TODO lout Lout LOUT
+syn keyword loutDefine def macro
+
+" Some big structures
+syn keyword loutKeyword @Begin @End @Figure @Tab
+syn keyword loutKeyword @Book @Doc @Document @Report
+syn keyword loutKeyword @Introduction @Abstract @Appendix
+syn keyword loutKeyword @Chapter @Section @BeginSections @EndSections
+
+" All kind of Lout keywords
+syn match loutFunction '\<@[^ \t{}]\+\>'
+
+" Braces -- Don`t edit these lines!
+syn match loutMBraces '[{}]'
+syn match loutIBraces '[{}]'
+syn match loutBBrace '[{}]'
+syn match loutBIBraces '[{}]'
+syn match loutHeads '[{}]'
+
+" Unmatched braces.
+syn match loutBraceError '}'
+
+" End of multi-line definitions, like @Document, @Report and @Book.
+syn match loutEOmlDef '^//$'
+
+" Grouping of parameters and objects.
+syn region loutObject transparent matchgroup=Delimiter start='{' matchgroup=Delimiter end='}' contains=ALLBUT,loutBraceError
+
+" The NULL object has a special meaning
+syn keyword loutNULL {}
+
+" Comments
+syn region loutComment start='\#' end='$' contains=loutTodo
+
+" Double quotes
+syn region loutSpecial start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+" ISO-LATIN-1 characters created with @Char, or Adobe symbols
+" created with @Sym
+syn match loutSymbols '@\(\(Char\)\|\(Sym\)\)\s\+[A-Za-z]\+'
+
+" Include files
+syn match loutInclude '@IncludeGraphic\s\+\k\+'
+syn region loutInclude start='@\(\(SysInclude\)\|\(IncludeGraphic\)\|\(Include\)\)\s*{' end='}'
+
+" Tags
+syn match loutTag '@\(\(Tag\)\|\(PageMark\)\|\(PageOf\)\|\(NumberOf\)\)\s\+\k\+'
+syn region loutTag start='@Tag\s*{' end='}'
+
+" Equations
+syn match loutMath '@Eq\s\+\k\+'
+syn region loutMath matchgroup=loutMBraces start='@Eq\s*{' matchgroup=loutMBraces end='}' contains=ALLBUT,loutBraceError
+"
+" Fonts
+syn match loutItalic '@I\s\+\k\+'
+syn region loutItalic matchgroup=loutIBraces start='@I\s*{' matchgroup=loutIBraces end='}' contains=ALLBUT,loutBraceError
+syn match loutBold '@B\s\+\k\+'
+syn region loutBold matchgroup=loutBBraces start='@B\s*{' matchgroup=loutBBraces end='}' contains=ALLBUT,loutBraceError
+syn match loutBoldItalic '@BI\s\+\k\+'
+syn region loutBoldItalic matchgroup=loutBIBraces start='@BI\s*{' matchgroup=loutBIBraces end='}' contains=ALLBUT,loutBraceError
+syn region loutHeadings matchgroup=loutHeads start='@\(\(Title\)\|\(Caption\)\)\s*{' matchgroup=loutHeads end='}' contains=ALLBUT,loutBraceError
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lout_syn_inits")
+ if version < 508
+ let did_lout_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overrriden later.
+ HiLink loutTodo Todo
+ HiLink loutDefine Define
+ HiLink loutEOmlDef Define
+ HiLink loutFunction Function
+ HiLink loutBraceError Error
+ HiLink loutNULL Special
+ HiLink loutComment Comment
+ HiLink loutSpecial Special
+ HiLink loutSymbols Character
+ HiLink loutInclude Include
+ HiLink loutKeyword Keyword
+ HiLink loutTag Tag
+ HiLink loutMath Number
+
+ " HiLink Not really needed here, but I think it is more consistent.
+ HiLink loutMBraces loutMath
+ hi loutItalic term=italic cterm=italic gui=italic
+ HiLink loutIBraces loutItalic
+ hi loutBold term=bold cterm=bold gui=bold
+ HiLink loutBBraces loutBold
+ hi loutBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
+ HiLink loutBIBraces loutBoldItalic
+ hi loutHeadings term=bold cterm=bold guifg=indianred
+ HiLink loutHeads loutHeadings
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lout"
+
+" vim:ts=8:sw=4:nocindent:smartindent:
diff --git a/runtime/syntax/lpc.vim b/runtime/syntax/lpc.vim
new file mode 100644
index 000000000..7665c1a6d
--- /dev/null
+++ b/runtime/syntax/lpc.vim
@@ -0,0 +1,455 @@
+" Vim syntax file
+" Language: LPC
+" Maintainer: Shizhu Pan <poet@mudbuilder.net>
+" URL: http://poet.tomud.com/pub/lpc.vim.bz2
+" Last Change: 2003 May 11
+" Comments: If you are using Vim 6.2 or later, see :h lpc.vim for
+" file type recognizing, if not, you had to use modeline.
+
+
+" Nodule: This is the start nodule. {{{1
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Nodule: Keywords {{{1
+
+" LPC keywords
+" keywords should always be highlighted so "contained" is not used.
+syn cluster lpcKeywdGrp contains=lpcConditional,lpcLabel,lpcOperator,lpcRepeat,lpcStatement,lpcModifier,lpcReserved
+
+syn keyword lpcConditional if else switch
+syn keyword lpcLabel case default
+syn keyword lpcOperator catch efun in inherit
+syn keyword lpcRepeat do for foreach while
+syn keyword lpcStatement break continue return
+
+syn match lpcEfunError /efun[^:]/ display
+
+" Illegal to use keyword as function
+" It's not working, maybe in the next version.
+syn keyword lpcKeywdError contained if for foreach return switch while
+
+" These are keywords only because they take lvalue or type as parameter,
+" so these keywords should only be used as function but cannot be names of
+" user-defined functions.
+syn keyword lpcKeywdFunc new parse_command sscanf time_expression
+
+" Nodule: Type and modifiers {{{1
+
+" Type names list.
+
+" Special types
+syn keyword lpcType void mixed unknown
+" Scalar/Value types.
+syn keyword lpcType int float string
+" Pointer types.
+syn keyword lpcType array buffer class function mapping object
+" Other types.
+if exists("lpc_compat_32")
+ syn keyword lpcType closure status funcall
+else
+ syn keyword lpcError closure status
+ syn keyword lpcType multiset
+endif
+
+" Type modifier.
+syn keyword lpcModifier nomask private public
+syn keyword lpcModifier varargs virtual
+
+" sensible modifiers
+if exists("lpc_pre_v22")
+ syn keyword lpcReserved nosave protected ref
+ syn keyword lpcModifier static
+else
+ syn keyword lpcError static
+ syn keyword lpcModifier nosave protected ref
+endif
+
+" Nodule: Applies {{{1
+
+" Match a function declaration or function pointer
+syn match lpcApplyDecl excludenl /->\h\w*(/me=e-1 contains=lpcApplies transparent display
+
+" We should note that in func_spec.c the efun definition syntax is so
+" complicated that I use such a long regular expression to describe.
+syn match lpcLongDecl excludenl /\(\s\|\*\)\h\+\s\h\+(/me=e-1 contains=@lpcEfunGroup,lpcType,@lpcKeywdGrp transparent display
+
+" this is form for all functions
+" ->foo() form had been excluded
+syn match lpcFuncDecl excludenl /\h\w*(/me=e-1 contains=lpcApplies,@lpcEfunGroup,lpcKeywdError transparent display
+
+" The (: :) parenthesis or $() forms a function pointer
+syn match lpcFuncName /(:\s*\h\+\s*:)/me=e-1 contains=lpcApplies,@lpcEfunGroup transparent display contained
+syn match lpcFuncName /(:\s*\h\+,/ contains=lpcApplies,@lpcEfunGroup transparent display contained
+syn match lpcFuncName /\$(\h\+)/ contains=lpcApplies,@lpcEfunGroup transparent display contained
+
+" Applies list.
+" system applies
+syn keyword lpcApplies contained __INIT clean_up create destructor heart_beat id init move_or_destruct reset
+" interactive
+syn keyword lpcApplies contained catch_tell logon net_dead process_input receive_message receive_snoop telnet_suboption terminal_type window_size write_prompt
+" master applies
+syn keyword lpcApplies contained author_file compile_object connect crash creator_file domain_file epilog error_handler flag get_bb_uid get_root_uid get_save_file_name log_error make_path_absolute object_name preload privs_file retrieve_ed_setup save_ed_setup slow_shutdown
+syn keyword lpcApplies contained valid_asm valid_bind valid_compile_to_c valid_database valid_hide valid_link valid_object valid_override valid_read valid_save_binary valid_seteuid valid_shadow valid_socket valid_write
+" parsing
+syn keyword lpcApplies contained inventory_accessible inventory_visible is_living parse_command_adjectiv_id_list parse_command_adjective_id_list parse_command_all_word parse_command_id_list parse_command_plural_id_list parse_command_prepos_list parse_command_users parse_get_environment parse_get_first_inventory parse_get_next_inventory parser_error_message
+
+
+" Nodule: Efuns {{{1
+
+syn cluster lpcEfunGroup contains=lpc_efuns,lpcOldEfuns,lpcNewEfuns,lpcKeywdFunc
+
+" Compat32 efuns
+if exists("lpc_compat_32")
+ syn keyword lpc_efuns contained closurep heart_beat_info m_delete m_values m_indices query_once_interactive strstr
+else
+ syn match lpcErrFunc /#`\h\w*/
+ " Shell compatible first line comment.
+ syn region lpcCommentFunc start=/^#!/ end=/$/
+endif
+
+" pre-v22 efuns which are removed in newer versions.
+syn keyword lpcOldEfuns contained tail dump_socket_status
+
+" new efuns after v22 should be added here!
+syn keyword lpcNewEfuns contained socket_status
+
+" LPC efuns list.
+" DEBUG efuns Not included.
+" New efuns should NOT be added to this list, see v22 efuns above.
+" Efuns list {{{2
+syn keyword lpc_efuns contained acos add_action all_inventory all_previous_objects allocate allocate_buffer allocate_mapping apply arrayp asin atan author_stats
+syn keyword lpc_efuns contained bind break_string bufferp
+syn keyword lpc_efuns contained cache_stats call_other call_out call_out_info call_stack capitalize catch ceil check_memory children classp clear_bit clone_object clonep command commands copy cos cp crc32 crypt ctime
+syn keyword lpc_efuns contained db_close db_commit db_connect db_exec db_fetch db_rollback db_status debug_info debugmalloc debug_message deep_inherit_list deep_inventory destruct disable_commands disable_wizard domain_stats dumpallobj dump_file_descriptors dump_prog
+syn keyword lpc_efuns contained each ed ed_cmd ed_start enable_commands enable_wizard environment error errorp eval_cost evaluate exec exp explode export_uid external_start
+syn keyword lpc_efuns contained fetch_variable file_length file_name file_size filter filter_array filter_mapping find_call_out find_living find_object find_player first_inventory floatp floor flush_messages function_exists function_owner function_profile functionp functions
+syn keyword lpc_efuns contained generate_source get_char get_config get_dir geteuid getuid
+syn keyword lpc_efuns contained heart_beats
+syn keyword lpc_efuns contained id_matrix implode in_edit in_input inherit_list inherits input_to interactive intp
+syn keyword lpc_efuns contained keys
+syn keyword lpc_efuns contained link living livings load_object localtime log log10 lookat_rotate lower_case lpc_info
+syn keyword lpc_efuns contained malloc_check malloc_debug malloc_status map map_array map_delete map_mapping mapp master match_path max_eval_cost member_array memory_info memory_summary message mkdir moncontrol move_object mud_status
+syn keyword lpc_efuns contained named_livings network_stats next_bit next_inventory notify_fail nullp
+syn keyword lpc_efuns contained objectp objects oldcrypt opcprof origin
+syn keyword lpc_efuns contained parse_add_rule parse_add_synonym parse_command parse_dump parse_init parse_my_rules parse_refresh parse_remove parse_sentence pluralize pointerp pow present previous_object printf process_string process_value program_info
+syn keyword lpc_efuns contained query_ed_mode query_heart_beat query_host_name query_idle query_ip_name query_ip_number query_ip_port query_load_average query_notify_fail query_privs query_replaced_program query_shadowing query_snoop query_snooping query_verb
+syn keyword lpc_efuns contained random read_buffer read_bytes read_file receive reclaim_objects refs regexp reg_assoc reload_object remove_action remove_call_out remove_interactive remove_shadow rename repeat_string replace_program replace_string replaceable reset_eval_cost resolve restore_object restore_variable rm rmdir rotate_x rotate_y rotate_z rusage
+syn keyword lpc_efuns contained save_object save_variable say scale set_author set_bit set_eval_limit set_heart_beat set_hide set_light set_living_name set_malloc_mask set_privs set_reset set_this_player set_this_user seteuid shadow shallow_inherit_list shout shutdown sin sizeof snoop socket_accept socket_acquire socket_address socket_bind socket_close socket_connect socket_create socket_error socket_listen socket_release socket_write sort_array sprintf sqrt stat store_variable strcmp stringp strlen strsrch
+syn keyword lpc_efuns contained tan tell_object tell_room terminal_colour test_bit this_interactive this_object this_player this_user throw time to_float to_int trace traceprefix translate typeof
+syn keyword lpc_efuns contained undefinedp unique_array unique_mapping upper_case uptime userp users
+syn keyword lpc_efuns contained values variables virtualp
+syn keyword lpc_efuns contained wizardp write write_buffer write_bytes write_file
+
+" Nodule: Constants {{{1
+
+" LPC Constants.
+" like keywords, constants are always highlighted, be careful to choose only
+" the constants we used to add to this list.
+syn keyword lpcConstant __ARCH__ __COMPILER__ __DIR__ __FILE__ __OPTIMIZATION__ __PORT__ __VERSION__
+" Defines in options.h are all predefined in LPC sources surrounding by
+" two underscores. Do we need to include all of that?
+syn keyword lpcConstant __SAVE_EXTENSION__ __HEARTBEAT_INTERVAL__
+" from the documentation we know that these constants remains only for
+" backward compatibility and should not be used any more.
+syn keyword lpcConstant HAS_ED HAS_PRINTF HAS_RUSAGE HAS_DEBUG_LEVEL
+syn keyword lpcConstant MUD_NAME F__THIS_OBJECT
+
+" Nodule: Todo for this file. {{{1
+
+" TODO : need to check for LPC4 syntax and other series of LPC besides
+" v22, b21 and l32, if you had a good idea, contact me at poet@mudbuilder.net
+" and I will be appreciated about that.
+
+" Notes about some FAQ:
+"
+" About variables : We adopts the same behavior for C because almost all the
+" LPC programmers are also C programmers, so we don't need separate settings
+" for C and LPC. That is the reason why I don't change variables like
+" "c_no_utf"s to "lpc_no_utf"s.
+"
+" Copy : Some of the following seems to be copied from c.vim but not quite
+" the same in details because the syntax for C and LPC is different.
+"
+" Color scheme : this syntax file had been thouroughly tested to work well
+" for all of the dark-backgrounded color schemes Vim has provided officially,
+" and it should be quite Ok for all of the bright-backgrounded color schemes,
+" of course it works best for the color scheme that I am using, download it
+" from http://poet.tomud.com/pub/ps_color.vim.bz2 if you want to try it.
+"
+
+" Nodule: String and Character {{{1
+
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match lpcSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+if !exists("c_no_utf")
+ syn match lpcSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
+endif
+
+" LPC version of sprintf() format,
+syn match lpcFormat display "%\(\d\+\)\=[-+ |=#@:.]*\(\d\+\)\=\('\I\+'\|'\I*\\'\I*'\)\=[OsdicoxXf]" contained
+syn match lpcFormat display "%%" contained
+syn region lpcString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=lpcSpecial,lpcFormat
+" lpcCppString: same as lpcString, but ends at end of line
+syn region lpcCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=lpcSpecial,lpcFormat
+
+" LPC preprocessor for the text formatting short cuts
+" Thanks to Dr. Charles E. Campbell <cec@gryphon.gsfc.nasa.gov>
+" he suggests the best way to do this.
+syn region lpcTextString start=/@\z(\h\w*\)$/ end=/^\z1/ contains=lpcSpecial
+syn region lpcArrayString start=/@@\z(\h\w*\)$/ end=/^\z1/ contains=lpcSpecial
+
+" Character
+syn match lpcCharacter "L\='[^\\]'"
+syn match lpcCharacter "L'[^']*'" contains=lpcSpecial
+syn match lpcSpecialError "L\='\\[^'\"?\\abefnrtv]'"
+syn match lpcSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
+syn match lpcSpecialCharacter display "L\='\\\o\{1,3}'"
+syn match lpcSpecialCharacter display "'\\x\x\{1,2}'"
+syn match lpcSpecialCharacter display "L'\\x\x\+'"
+
+" Nodule: White space {{{1
+
+" when wanted, highlight trailing white space
+if exists("c_space_errors")
+ if !exists("c_no_trail_space_error")
+ syn match lpcSpaceError display excludenl "\s\+$"
+ endif
+ if !exists("c_no_tab_space_error")
+ syn match lpcSpaceError display " \+\t"me=e-1
+ endif
+endif
+
+" Nodule: Parenthesis and brackets {{{1
+
+" catch errors caused by wrong parenthesis and brackets
+syn cluster lpcParenGroup contains=lpcParenError,lpcIncluded,lpcSpecial,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcUserCont,lpcUserLabel,lpcBitField,lpcCommentSkip,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom
+syn region lpcParen transparent start='(' end=')' contains=ALLBUT,@lpcParenGroup,lpcCppParen,lpcErrInBracket,lpcCppBracket,lpcCppString,@lpcEfunGroup,lpcApplies,lpcKeywdError
+" lpcCppParen: same as lpcParen but ends at end-of-line; used in lpcDefine
+syn region lpcCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@lpcParenGroup,lpcErrInBracket,lpcParen,lpcBracket,lpcString,@lpcEfunGroup,lpcApplies,lpcKeywdError
+syn match lpcParenError display ")"
+syn match lpcParenError display "\]"
+" for LPC:
+" Here we should consider the array ({ }) parenthesis and mapping ([ ])
+" parenthesis and multiset (< >) parenthesis.
+syn match lpcErrInParen display contained "[^^]{"ms=s+1
+syn match lpcErrInParen display contained "\(}\|\]\)[^)]"me=e-1
+syn region lpcBracket transparent start='\[' end=']' contains=ALLBUT,@lpcParenGroup,lpcErrInParen,lpcCppParen,lpcCppBracket,lpcCppString,@lpcEfunGroup,lpcApplies,lpcFuncName,lpcKeywdError
+" lpcCppBracket: same as lpcParen but ends at end-of-line; used in lpcDefine
+syn region lpcCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@lpcParenGroup,lpcErrInParen,lpcParen,lpcBracket,lpcString,@lpcEfunGroup,lpcApplies,lpcFuncName,lpcKeywdError
+syn match lpcErrInBracket display contained "[);{}]"
+
+" Nodule: Numbers {{{1
+
+" integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match lpcNumbers display transparent "\<\d\|\.\d" contains=lpcNumber,lpcFloat,lpcOctalError,lpcOctal
+" Same, but without octal error (for comments)
+syn match lpcNumbersCom display contained transparent "\<\d\|\.\d" contains=lpcNumber,lpcFloat,lpcOctal
+syn match lpcNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+" hex number
+syn match lpcNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match lpcOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=lpcOctalZero
+syn match lpcOctalZero display contained "\<0"
+syn match lpcFloat display contained "\d\+f"
+" floating point number, with dot, optional exponent
+syn match lpcFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+" floating point number, starting with a dot, optional exponent
+syn match lpcFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+" floating point number, without dot, with exponent
+syn match lpcFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+" flag an octal number with wrong digits
+syn match lpcOctalError display contained "0\o*[89]\d*"
+syn case match
+
+" Nodule: Comment string {{{1
+
+" lpcCommentGroup allows adding matches for special things in comments
+syn keyword lpcTodo contained TODO FIXME XXX
+syn cluster lpcCommentGroup contains=lpcTodo
+
+if exists("c_comment_strings")
+ " A comment can contain lpcString, lpcCharacter and lpcNumber.
+ syntax match lpcCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region lpcCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=lpcSpecial,lpcCommentSkip
+ syntax region lpcComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=lpcSpecial
+ syntax region lpcCommentL start="//" skip="\\$" end="$" keepend contains=@lpcCommentGroup,lpcComment2String,lpcCharacter,lpcNumbersCom,lpcSpaceError
+ syntax region lpcComment matchgroup=lpcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@lpcCommentGroup,lpcCommentStartError,lpcCommentString,lpcCharacter,lpcNumbersCom,lpcSpaceError
+else
+ syn region lpcCommentL start="//" skip="\\$" end="$" keepend contains=@lpcCommentGroup,lpcSpaceError
+ syn region lpcComment matchgroup=lpcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@lpcCommentGroup,lpcCommentStartError,lpcSpaceError
+endif
+" keep a // comment separately, it terminates a preproc. conditional
+syntax match lpcCommentError display "\*/"
+syntax match lpcCommentStartError display "/\*"me=e-1 contained
+
+" Nodule: Pre-processor {{{1
+
+syn region lpcPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=lpcComment,lpcCppString,lpcCharacter,lpcCppParen,lpcParenError,lpcNumbers,lpcCommentError,lpcSpaceError
+syn match lpcPreCondit display "^\s*#\s*\(else\|endif\)\>"
+if !exists("c_no_if0")
+ syn region lpcCppOut start="^\s*#\s*if\s\+0\+\>" end=".\|$" contains=lpcCppOut2
+ syn region lpcCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=lpcSpaceError,lpcCppSkip
+ syn region lpcCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=lpcSpaceError,lpcCppSkip
+endif
+syn region lpcIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match lpcIncluded display contained "<[^>]*>"
+syn match lpcInclude display "^\s*#\s*include\>\s*["<]" contains=lpcIncluded
+syn match lpcLineSkip "\\$"
+syn cluster lpcPreProcGroup contains=lpcPreCondit,lpcIncluded,lpcInclude,lpcDefine,lpcErrInParen,lpcErrInBracket,lpcUserLabel,lpcSpecial,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom,lpcString,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcParen,lpcBracket,lpcMulti,lpcKeywdError
+syn region lpcDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@lpcPreProcGroup
+
+if exists("lpc_pre_v22")
+ syn region lpcPreProc start="^\s*#\s*\(pragma\>\|echo\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@lpcPreProcGroup
+else
+ syn region lpcPreProc start="^\s*#\s*\(pragma\>\|echo\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@lpcPreProcGroup
+endif
+
+" Nodule: User labels {{{1
+
+" Highlight Labels
+" User labels in LPC is not allowed, only "case x" and "default" is supported
+syn cluster lpcMultiGroup contains=lpcIncluded,lpcSpecial,lpcCommentSkip,lpcCommentString,lpcComment2String,@lpcCommentGroup,lpcCommentStartError,lpcUserCont,lpcUserLabel,lpcBitField,lpcOctalZero,lpcCppOut,lpcCppOut2,lpcCppSkip,lpcFormat,lpcNumber,lpcFloat,lpcOctal,lpcOctalError,lpcNumbersCom,lpcCppParen,lpcCppBracket,lpcCppString,lpcKeywdError
+syn region lpcMulti transparent start='\(case\|default\|public\|protected\|private\)' skip='::' end=':' contains=ALLBUT,@lpcMultiGroup
+
+syn cluster lpcLabelGroup contains=lpcUserLabel
+syn match lpcUserCont display "^\s*lpc:$" contains=@lpcLabelGroup
+
+" Don't want to match anything
+syn match lpcUserLabel display "lpc" contained
+
+" Nodule: Initializations {{{1
+
+if exists("c_minlines")
+ let b:c_minlines = c_minlines
+else
+ if !exists("c_no_if0")
+ let b:c_minlines = 50 " #if 0 constructs can be long
+ else
+ let b:c_minlines = 15 " mostly for () constructs
+ endif
+endif
+exec "syn sync ccomment lpcComment minlines=" . b:c_minlines
+
+" Make sure these options take place since we no longer depend on file type
+" plugin for C
+setlocal cindent
+setlocal fo-=t fo+=croql
+setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
+set cpo-=C
+
+" Win32 can filter files in the browse dialog
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "LPC Source Files (*.c *.d *.h)\t*.c;*.d;*.h\n" .
+ \ "LPC Data Files (*.scr *.o *.dat)\t*.scr;*.o;*.dat\n" .
+ \ "Text Documentation (*.txt)\t*.txt\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+" Nodule: Highlight links {{{1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lpc_syn_inits")
+ if version < 508
+ let did_lpc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lpcModifier lpcStorageClass
+
+ HiLink lpcQuotedFmt lpcFormat
+ HiLink lpcFormat lpcSpecial
+ HiLink lpcCppString lpcString " Cpp means
+ " C Pre-Processor
+ HiLink lpcCommentL lpcComment
+ HiLink lpcCommentStart lpcComment
+ HiLink lpcUserLabel lpcLabel
+ HiLink lpcSpecialCharacter lpcSpecial
+ HiLink lpcOctal lpcPreProc
+ HiLink lpcOctalZero lpcSpecial " LPC will treat octal numbers
+ " as decimals, programmers should
+ " be aware of that.
+ HiLink lpcEfunError lpcError
+ HiLink lpcKeywdError lpcError
+ HiLink lpcOctalError lpcError
+ HiLink lpcParenError lpcError
+ HiLink lpcErrInParen lpcError
+ HiLink lpcErrInBracket lpcError
+ HiLink lpcCommentError lpcError
+ HiLink lpcCommentStartError lpcError
+ HiLink lpcSpaceError lpcError
+ HiLink lpcSpecialError lpcError
+ HiLink lpcErrFunc lpcError
+
+ if exists("lpc_pre_v22")
+ HiLink lpcOldEfuns lpc_efuns
+ HiLink lpcNewEfuns lpcError
+ else
+ HiLink lpcOldEfuns lpcReserved
+ HiLink lpcNewEfuns lpc_efuns
+ endif
+ HiLink lpc_efuns lpcFunction
+
+ HiLink lpcReserved lpcPreProc
+ HiLink lpcTextString lpcString " This should be preprocessors, but
+ HiLink lpcArrayString lpcPreProc " let's make some difference
+ " between text and array
+
+ HiLink lpcIncluded lpcString
+ HiLink lpcCommentString lpcString
+ HiLink lpcComment2String lpcString
+ HiLink lpcCommentSkip lpcComment
+ HiLink lpcCommentFunc lpcComment
+
+ HiLink lpcCppSkip lpcCppOut
+ HiLink lpcCppOut2 lpcCppOut
+ HiLink lpcCppOut lpcComment
+
+ " Standard type below
+ HiLink lpcApplies Special
+ HiLink lpcCharacter Character
+ HiLink lpcComment Comment
+ HiLink lpcConditional Conditional
+ HiLink lpcConstant Constant
+ HiLink lpcDefine Macro
+ HiLink lpcError Error
+ HiLink lpcFloat Float
+ HiLink lpcFunction Function
+ HiLink lpcIdentifier Identifier
+ HiLink lpcInclude Include
+ HiLink lpcLabel Label
+ HiLink lpcNumber Number
+ HiLink lpcOperator Operator
+ HiLink lpcPreCondit PreCondit
+ HiLink lpcPreProc PreProc
+ HiLink lpcRepeat Repeat
+ HiLink lpcStatement Statement
+ HiLink lpcStorageClass StorageClass
+ HiLink lpcString String
+ HiLink lpcStructure Structure
+ HiLink lpcSpecial LineNr
+ HiLink lpcTodo Todo
+ HiLink lpcType Type
+
+ delcommand HiLink
+endif
+
+" Nodule: This is the end nodule. {{{1
+
+let b:current_syntax = "lpc"
+
+" vim:ts=8:nosta:sw=2:ai:si:
+" vim600:set fdm=marker: }}}1
diff --git a/runtime/syntax/lprolog.vim b/runtime/syntax/lprolog.vim
new file mode 100644
index 000000000..2cc42f9ed
--- /dev/null
+++ b/runtime/syntax/lprolog.vim
@@ -0,0 +1,137 @@
+" Vim syntax file
+" Language: LambdaProlog (Teyjus)
+" Filenames: *.mod *.sig
+" Maintainer: Markus Mottl <markus@oefai.at>
+" URL: http://www.ai.univie.ac.at/~markus/vim/syntax/lprolog.vim
+" Last Change: 2003 May 11
+" 2001 Apr 26 - Upgraded for new Vim version
+" 2000 Jun 5 - Initial release
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Lambda Prolog is case sensitive.
+syn case match
+
+syn match lprologBrackErr "\]"
+syn match lprologParenErr ")"
+
+syn cluster lprologContained contains=lprologTodo,lprologModuleName,lprologTypeNames,lprologTypeName
+
+" Enclosing delimiters
+syn region lprologEncl transparent matchgroup=lprologKeyword start="(" matchgroup=lprologKeyword end=")" contains=ALLBUT,@lprologContained,lprologParenErr
+syn region lprologEncl transparent matchgroup=lprologKeyword start="\[" matchgroup=lprologKeyword end="\]" contains=ALLBUT,@lprologContained,lprologBrackErr
+
+" General identifiers
+syn match lprologIdentifier "\<\(\w\|[-+*/\\^<>=`'~?@#$&!_]\)*\>"
+syn match lprologVariable "\<\(\u\|_\)\(\w\|[-+*/\\^<>=`'~?@#$&!]\)*\>"
+
+syn match lprologOperator "/"
+
+" Comments
+syn region lprologComment start="/\*" end="\*/" contains=lprologComment,lprologTodo
+syn region lprologComment start="%" end="$" contains=lprologTodo
+syn keyword lprologTodo contained TODO FIXME XXX
+
+syn match lprologInteger "\<\d\+\>"
+syn match lprologReal "\<\(\d\+\)\=\.\d+\>"
+syn region lprologString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+" Clause definitions
+syn region lprologClause start="^\w\+" end=":-\|\."
+
+" Modules
+syn region lprologModule matchgroup=lprologKeyword start="^\<module\>" matchgroup=lprologKeyword end="\."
+
+" Types
+syn match lprologKeyword "^\<type\>" skipwhite nextgroup=lprologTypeNames
+syn region lprologTypeNames matchgroup=lprologBraceErr start="\<\w\+\>" matchgroup=lprologKeyword end="\." contained contains=lprologTypeName,lprologOperator
+syn match lprologTypeName "\<\w\+\>" contained
+
+" Keywords
+syn keyword lprologKeyword end import accumulate accum_sig
+syn keyword lprologKeyword local localkind closed sig
+syn keyword lprologKeyword kind exportdef useonly
+syn keyword lprologKeyword infixl infixr infix prefix
+syn keyword lprologKeyword prefixr postfix postfixl
+
+syn keyword lprologSpecial pi sigma is true fail halt stop not
+
+" Operators
+syn match lprologSpecial ":-"
+syn match lprologSpecial "->"
+syn match lprologSpecial "=>"
+syn match lprologSpecial "\\"
+syn match lprologSpecial "!"
+
+syn match lprologSpecial ","
+syn match lprologSpecial ";"
+syn match lprologSpecial "&"
+
+syn match lprologOperator "+"
+syn match lprologOperator "-"
+syn match lprologOperator "*"
+syn match lprologOperator "\~"
+syn match lprologOperator "\^"
+syn match lprologOperator "<"
+syn match lprologOperator ">"
+syn match lprologOperator "=<"
+syn match lprologOperator ">="
+syn match lprologOperator "::"
+syn match lprologOperator "="
+
+syn match lprologOperator "\."
+syn match lprologOperator ":"
+syn match lprologOperator "|"
+
+syn match lprologCommentErr "\*/"
+
+syn sync minlines=50
+syn sync maxlines=500
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lprolog_syntax_inits")
+ if version < 508
+ let did_lprolog_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lprologComment Comment
+ HiLink lprologTodo Todo
+
+ HiLink lprologKeyword Keyword
+ HiLink lprologSpecial Special
+ HiLink lprologOperator Operator
+ HiLink lprologIdentifier Normal
+
+ HiLink lprologInteger Number
+ HiLink lprologReal Number
+ HiLink lprologString String
+
+ HiLink lprologCommentErr Error
+ HiLink lprologBrackErr Error
+ HiLink lprologParenErr Error
+
+ HiLink lprologModuleName Special
+ HiLink lprologTypeName Identifier
+
+ HiLink lprologVariable Keyword
+ HiLink lprologAtom Normal
+ HiLink lprologClause Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lprolog"
+
+" vim: ts=8
diff --git a/runtime/syntax/lscript.vim b/runtime/syntax/lscript.vim
new file mode 100644
index 000000000..648a0ebea
--- /dev/null
+++ b/runtime/syntax/lscript.vim
@@ -0,0 +1,213 @@
+" Vim syntax file
+" Language: LotusScript
+" Maintainer: Taryn East (taryneast@hotmail.com)
+" Last Change: 2003 May 11
+
+" This is a rough amalgamation of the visual basic syntax file, and the UltraEdit
+" and Textpad syntax highlighters.
+" It's not too brilliant given that a) I've never written a syntax.vim file before
+" and b) I'm not so crash hot at LotusScript either. If you see any problems
+" feel free to email me with them.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" LotusScript is case insensitive
+syn case ignore
+
+" These are Notes thingies that had an equivalent in the vb highlighter
+" or I was already familiar with them
+syn keyword lscriptStatement ActivateApp As And Base Beep Call Case ChDir ChDrive Class
+syn keyword lscriptStatement Const Dim Declare DefCur DefDbl DefInt DefLng DefSng DefStr
+syn keyword lscriptStatement DefVar Do Else %Else ElseIf %ElseIf End %End Erase Event Exit
+syn keyword lscriptStatement Explicit FileCopy FALSE For ForAll Function Get GoTo GoSub
+syn keyword lscriptStatement If %If In Is Kill Let List Lock Loop MkDir
+syn keyword lscriptStatement Name Next New NoCase NoPitch Not Nothing NULL
+syn keyword lscriptStatement On Option Or PI Pitch Preserve Private Public
+syn keyword lscriptStatement Property Public Put
+syn keyword lscriptStatement Randomize ReDim Reset Resume Return RmDir
+syn keyword lscriptStatement Select SendKeys SetFileAttr Set Static Sub Then To TRUE
+syn keyword lscriptStatement Type Unlock Until While WEnd With Write XOr
+
+syn keyword lscriptDatatype Array Currency Double Integer Long Single String String$ Variant
+
+syn keyword lscriptNotesType Field Button Navigator
+syn keyword lscriptNotesType NotesACL NotesACLEntry NotesAgent NotesDatabase NotesDateRange
+syn keyword lscriptNotesType NotesDateTime NotesDbDirectory NotesDocument
+syn keyword lscriptNotesType NotesDocumentCollection NotesEmbeddedObject NotesForm
+syn keyword lscriptNotesType NotesInternational NotesItem NotesLog NotesName NotesNewsLetter
+syn keyword lscriptNotesType NotesMIMEEntry NotesOutline NotesOutlineEntry NotesRegistration
+syn keyword lscriptNotesType NotesReplication NotesRichTextItem NotesRichTextParagraphStyle
+syn keyword lscriptNotesType NotesRichTextStyle NotesRichTextTab
+syn keyword lscriptNotesType NotesSession NotesTimer NotesView NotesViewColumn NotesViewEntry
+syn keyword lscriptNotesType NotesViewEntryCollection NotesViewNavigator NotesUIDatabase
+syn keyword lscriptNotesType NotesUIDocument NotesUIView NotesUIWorkspace
+
+syn keyword lscriptNotesConst ACLLEVEL_AUTHOR ACLLEVEL_DEPOSITOR ACLLEVEL_DESIGNER
+syn keyword lscriptNotesConst ACLLEVEL_EDITOR ACLLEVEL_MANAGER ACLLEVEL_NOACCESS
+syn keyword lscriptNotesConst ACLLEVEL_READER ACLTYPE_MIXED_GROUP ACLTYPE_PERSON
+syn keyword lscriptNotesConst ACLTYPE_PERSON_GROUP ACLTYPE_SERVER ACLTYPE_SERVER_GROUP
+syn keyword lscriptNotesConst ACLTYPE_UNSPECIFIED ACTIONCD ALIGN_CENTER
+syn keyword lscriptNotesConst ALIGN_FULL ALIGN_LEFT ALIGN_NOWRAP ALIGN_RIGHT
+syn keyword lscriptNotesConst ASSISTANTINFO ATTACHMENT AUTHORS COLOR_BLACK
+syn keyword lscriptNotesConst COLOR_BLUE COLOR_CYAN COLOR_DARK_BLUE COLOR_DARK_CYAN
+syn keyword lscriptNotesConst COLOR_DARK_GREEN COLOR_DARK_MAGENTA COLOR_DARK_RED
+syn keyword lscriptNotesConst COLOR_DARK_YELLOW COLOR_GRAY COLOR_GREEN COLOR_LIGHT_GRAY
+syn keyword lscriptNotesConst COLOR_MAGENTA COLOR_RED COLOR_WHITE COLOR_YELLOW
+syn keyword lscriptNotesConst DATABASE DATETIMES DB_REPLICATION_PRIORITY_HIGH
+syn keyword lscriptNotesConst DB_REPLICATION_PRIORITY_LOW DB_REPLICATION_PRIORITY_MED
+syn keyword lscriptNotesConst DB_REPLICATION_PRIORITY_NOTSET EFFECTS_EMBOSS
+syn keyword lscriptNotesConst EFFECTS_EXTRUDE EFFECTS_NONE EFFECTS_SHADOW
+syn keyword lscriptNotesConst EFFECTS_SUBSCRIPT EFFECTS_SUPERSCRIPT EMBED_ATTACHMENT
+syn keyword lscriptNotesConst EMBED_OBJECT EMBED_OBJECTLINK EMBEDDEDOBJECT ERRORITEM
+syn keyword lscriptNotesConst EV_ALARM EV_COMM EV_MAIL EV_MISC EV_REPLICA EV_RESOURCE
+syn keyword lscriptNotesConst EV_SECURITY EV_SERVER EV_UNKNOWN EV_UPDATE FONT_COURIER
+syn keyword lscriptNotesConst FONT_HELV FONT_ROMAN FORMULA FT_DATABASE FT_DATE_ASC
+syn keyword lscriptNotesConst FT_DATE_DES FT_FILESYSTEM FT_FUZZY FT_SCORES FT_STEMS
+syn keyword lscriptNotesConst FT_THESAURUS HTML ICON ID_CERTIFIER ID_FLAT
+syn keyword lscriptNotesConst ID_HIERARCHICAL LSOBJECT MIME_PART NAMES NOTESLINKS
+syn keyword lscriptNotesConst NOTEREFS NOTES_DESKTOP_CLIENT NOTES_FULL_CLIENT
+syn keyword lscriptNotesConst NOTES_LIMITED_CLIENT NUMBERS OTHEROBJECT
+syn keyword lscriptNotesConst OUTLINE_CLASS_DATABASE OUTLINE_CLASS_DOCUMENT
+syn keyword lscriptNotesConst OUTLINE_CLASS_FOLDER OUTLINE_CLASS_FORM
+syn keyword lscriptNotesConst OUTLINE_CLASS_FRAMESET OUTLINE_CLASS_NAVIGATOR
+syn keyword lscriptNotesConst OUTLINE_CLASS_PAGE OUTLINE_CLASS_UNKNOWN
+syn keyword lscriptNotesConst OUTLINE_CLASS_VIEW OUTLINE_OTHER_FOLDERS_TYPE
+syn keyword lscriptNotesConst OUTLINE_OTHER_UNKNOWN_TYPE OUTLINE_OTHER_VIEWS_TYPE
+syn keyword lscriptNotesConst OUTLINE_TYPE_ACTION OUTLINE_TYPE_NAMEDELEMENT
+syn keyword lscriptNotesConst OUTLINE_TYPE_NOTELINK OUTLINE_TYPE_URL PAGINATE_BEFORE
+syn keyword lscriptNotesConst PAGINATE_DEFAULT PAGINATE_KEEP_TOGETHER
+syn keyword lscriptNotesConst PAGINATE_KEEP_WITH_NEXT PICKLIST_CUSTOM PICKLIST_NAMES
+syn keyword lscriptNotesConst PICKLIST_RESOURCES PICKLIST_ROOMS PROMPT_OK PROMPT_OKCANCELCOMBO
+syn keyword lscriptNotesConst PROMPT_OKCANCELEDIT PROMPT_OKCANCELEDITCOMBO PROMPT_OKCANCELLIST
+syn keyword lscriptNotesConst PROMPT_OKCANCELLISTMULT PROMPT_PASSWORD PROMPT_YESNO
+syn keyword lscriptNotesConst PROMPT_YESNOCANCEL QUERYCD READERS REPLICA_CANDIDATE
+syn keyword lscriptNotesConst RICHTEXT RULER_ONE_CENTIMETER RULER_ONE_INCH SEV_FAILURE
+syn keyword lscriptNotesConst SEV_FATAL SEV_NORMAL SEV_WARNING1 SEV_WARNING2
+syn keyword lscriptNotesConst SIGNATURE SPACING_DOUBLE SPACING_ONE_POINT_50
+syn keyword lscriptNotesConst SPACING_SINGLE STYLE_NO_CHANGE TAB_CENTER TAB_DECIMAL
+syn keyword lscriptNotesConst TAB_LEFT TAB_RIGHT TARGET_ALL_DOCS TARGET_ALL_DOCS_IN_VIEW
+syn keyword lscriptNotesConst TARGET_NEW_DOCS TARGET_NEW_OR_MODIFIED_DOCS TARGET_NONE
+syn keyword lscriptNotesConst TARGET_RUN_ONCE TARGET_SELECTED_DOCS TARGET_UNREAD_DOCS_IN_VIEW
+syn keyword lscriptNotesConst TEMPLATE TEMPLATE_CANDIDATE TEXT TRIGGER_AFTER_MAIL_DELIVERY
+syn keyword lscriptNotesConst TRIGGER_BEFORE_MAIL_DELIVERY TRIGGER_DOC_PASTED
+syn keyword lscriptNotesConst TRIGGER_DOC_UPDATE TRIGGER_MANUAL TRIGGER_NONE
+syn keyword lscriptNotesConst TRIGGER_SCHEDULED UNAVAILABLE UNKNOWN USERDATA
+syn keyword lscriptNotesConst USERID VC_ALIGN_CENTER VC_ALIGN_LEFT VC_ALIGN_RIGHT
+syn keyword lscriptNotesConst VC_ATTR_PARENS VC_ATTR_PUNCTUATED VC_ATTR_PERCENT
+syn keyword lscriptNotesConst VC_FMT_ALWAYS VC_FMT_CURRENCY VC_FMT_DATE VC_FMT_DATETIME
+syn keyword lscriptNotesConst VC_FMT_FIXED VC_FMT_GENERAL VC_FMT_HM VC_FMT_HMS
+syn keyword lscriptNotesConst VC_FMT_MD VC_FMT_NEVER VC_FMT_SCIENTIFIC
+syn keyword lscriptNotesConst VC_FMT_SOMETIMES VC_FMT_TIME VC_FMT_TODAYTIME VC_FMT_YM
+syn keyword lscriptNotesConst VC_FMT_YMD VC_FMT_Y4M VC_FONT_BOLD VC_FONT_ITALIC
+syn keyword lscriptNotesConst VC_FONT_STRIKEOUT VC_FONT_UNDERLINE VC_SEP_COMMA
+syn keyword lscriptNotesConst VC_SEP_NEWLINE VC_SEP_SEMICOLON VC_SEP_SPACE
+syn keyword lscriptNotesConst VIEWMAPDATA VIEWMAPLAYOUT VW_SPACING_DOUBLE
+syn keyword lscriptNotesConst VW_SPACING_ONE_POINT_25 VW_SPACING_ONE_POINT_50
+syn keyword lscriptNotesConst VW_SPACING_ONE_POINT_75 VW_SPACING_SINGLE
+
+syn keyword lscriptFunction Abs Asc Atn Atn2 ACos ASin
+syn keyword lscriptFunction CCur CDat CDbl Chr Chr$ CInt CLng Command Command$
+syn keyword lscriptFunction Cos CSng CStr
+syn keyword lscriptFunction CurDir CurDir$ CVar Date Date$ DateNumber DateSerial DateValue
+syn keyword lscriptFunction Day Dir Dir$ Environ$ Environ EOF Error Error$ Evaluate Exp
+syn keyword lscriptFunction FileAttr FileDateTime FileLen Fix Format Format$ FreeFile
+syn keyword lscriptFunction GetFileAttr GetThreadInfo Hex Hex$ Hour
+syn keyword lscriptFunction IMESetMode IMEStatus Input Input$ InputB InputB$
+syn keyword lscriptFunction InputBP InputBP$ InputBox InputBox$ InStr InStrB InStrBP InstrC
+syn keyword lscriptFunction IsA IsArray IsDate IsElement IsList IsNumeric
+syn keyword lscriptFunction IsObject IsResponse IsScalar IsUnknown LCase LCase$
+syn keyword lscriptFunction Left Left$ LeftB LeftB$ LeftC
+syn keyword lscriptFunction LeftBP LeftBP$ Len LenB LenBP LenC Loc LOF Log
+syn keyword lscriptFunction LSet LTrim LTrim$ MessageBox Mid Mid$ MidB MidB$ MidC
+syn keyword lscriptFunction Minute Month Now Oct Oct$ Responses Right Right$
+syn keyword lscriptFunction RightB RightB$ RightBP RightBP$ RightC Round Rnd RSet RTrim RTrim$
+syn keyword lscriptFunction Second Seek Sgn Shell Sin Sleep Space Space$ Spc Sqr Str Str$
+syn keyword lscriptFunction StrConv StrLeft StrleftBack StrRight StrRightBack
+syn keyword lscriptFunction StrCompare Tab Tan Time Time$ TimeNumber Timer
+syn keyword lscriptFunction TimeValue Trim Trim$ Today TypeName UCase UCase$
+syn keyword lscriptFunction UniversalID Val Weekday Year
+
+syn keyword lscriptMethods AppendToTextList ArrayAppend ArrayReplace ArrayGetIndex
+syn keyword lscriptMethods Append Bind Close
+"syn keyword lscriptMethods Contains
+syn keyword lscriptMethods CopyToDatabase CopyAllItems Count CurrentDatabase Delete Execute
+syn keyword lscriptMethods GetAllDocumentsByKey GetDatabase GetDocumentByKey
+syn keyword lscriptMethods GetDocumentByUNID GetFirstDocument GetFirstItem
+syn keyword lscriptMethods GetItems GetItemValue GetNthDocument GetView
+syn keyword lscriptMethods IsEmpty IsNull %Include Items
+syn keyword lscriptMethods Line LBound LoadMsgText Open Print
+syn keyword lscriptMethods RaiseEvent ReplaceItemValue Remove RemoveItem Responses
+syn keyword lscriptMethods Save Stop UBound UnprocessedDocuments Write
+
+syn keyword lscriptEvents Compare OnError
+
+"*************************************************************************************
+"These are Notes thingies that I'm not sure how to classify as they had no vb equivalent
+" At a wild guess I'd put them as Functions...
+" if anyone sees something really out of place... tell me!
+
+syn keyword lscriptFunction Access Alias Any Bin Bin$ Binary ByVal
+syn keyword lscriptFunction CodeLock CodeLockCheck CodeUnlock CreateLock
+syn keyword lscriptFunction CurDrive CurDrive$ DataType DestroyLock Eqv
+syn keyword lscriptFunction Erl Err Fraction From FromFunction FullTrim
+syn keyword lscriptFunction Imp Int Lib Like ListTag LMBCS LSServer Me
+syn keyword lscriptFunction Mod MsgDescription MsgText Output Published
+syn keyword lscriptFunction Random Read Shared Step UChr UChr$ Uni Unicode
+syn keyword lscriptFunction Until Use UseLSX UString UString$ Width Yield
+
+
+syn keyword lscriptTodo contained TODO
+
+"integer number, or floating point number without a dot.
+syn match lscriptNumber "\<\d\+\>"
+"floating point number, with dot
+syn match lscriptNumber "\<\d\+\.\d*\>"
+"floating point number, starting with a dot
+syn match lscriptNumber "\.\d\+\>"
+
+" String and Character constants
+syn region lscriptString start=+"+ end=+"+
+syn region lscriptComment start="REM" end="$" contains=lscriptTodo
+syn region lscriptComment start="'" end="$" contains=lscriptTodo
+syn region lscriptLineNumber start="^\d" end="\s"
+syn match lscriptTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lscript_syntax_inits")
+ if version < 508
+ let did_lscript_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ hi lscriptNotesType term=underline ctermfg=DarkGreen guifg=SeaGreen gui=bold
+
+ HiLink lscriptNotesConst lscriptNotesType
+ HiLink lscriptLineNumber Comment
+ HiLink lscriptDatatype Type
+ HiLink lscriptNumber Number
+ HiLink lscriptError Error
+ HiLink lscriptStatement Statement
+ HiLink lscriptString String
+ HiLink lscriptComment Comment
+ HiLink lscriptTodo Todo
+ HiLink lscriptFunction Identifier
+ HiLink lscriptMethods PreProc
+ HiLink lscriptEvents Special
+ HiLink lscriptTypeSpecifier Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lscript"
+
+" vim: ts=8
diff --git a/runtime/syntax/lss.vim b/runtime/syntax/lss.vim
new file mode 100644
index 000000000..fe20701d1
--- /dev/null
+++ b/runtime/syntax/lss.vim
@@ -0,0 +1,133 @@
+" Vim syntax file
+" Language: Lynx 2.7.1 style file
+" Maintainer: Scott Bigham <dsb@cs.duke.edu>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" This setup is probably atypical for a syntax highlighting file, because
+" most of it is not really intended to be overrideable. Instead, the
+" highlighting is supposed to correspond to the highlighting specified by
+" the .lss file entries themselves; ie. the "bold" keyword should be bold,
+" the "red" keyword should be red, and so forth. The exceptions to this
+" are comments, of course, and the initial keyword identifying the affected
+" element, which will inherit the usual Identifier highlighting.
+
+syn match lssElement "^[^:]\+" nextgroup=lssMono
+
+syn match lssMono ":[^:]\+" contained nextgroup=lssFgColor contains=lssReverse,lssUnderline,lssBold,lssStandout
+
+syn keyword lssBold bold contained
+syn keyword lssReverse reverse contained
+syn keyword lssUnderline underline contained
+syn keyword lssStandout standout contained
+
+syn match lssFgColor ":[^:]\+" contained nextgroup=lssBgColor contains=lssRedFg,lssBlueFg,lssGreenFg,lssBrownFg,lssMagentaFg,lssCyanFg,lssLightgrayFg,lssGrayFg,lssBrightredFg,lssBrightgreenFg,lssYellowFg,lssBrightblueFg,lssBrightmagentaFg,lssBrightcyanFg
+
+syn case ignore
+syn keyword lssRedFg red contained
+syn keyword lssBlueFg blue contained
+syn keyword lssGreenFg green contained
+syn keyword lssBrownFg brown contained
+syn keyword lssMagentaFg magenta contained
+syn keyword lssCyanFg cyan contained
+syn keyword lssLightgrayFg lightgray contained
+syn keyword lssGrayFg gray contained
+syn keyword lssBrightredFg brightred contained
+syn keyword lssBrightgreenFg brightgreen contained
+syn keyword lssYellowFg yellow contained
+syn keyword lssBrightblueFg brightblue contained
+syn keyword lssBrightmagentaFg brightmagenta contained
+syn keyword lssBrightcyanFg brightcyan contained
+syn case match
+
+syn match lssBgColor ":[^:]\+" contained contains=lssRedBg,lssBlueBg,lssGreenBg,lssBrownBg,lssMagentaBg,lssCyanBg,lssLightgrayBg,lssGrayBg,lssBrightredBg,lssBrightgreenBg,lssYellowBg,lssBrightblueBg,lssBrightmagentaBg,lssBrightcyanBg,lssWhiteBg
+
+syn case ignore
+syn keyword lssRedBg red contained
+syn keyword lssBlueBg blue contained
+syn keyword lssGreenBg green contained
+syn keyword lssBrownBg brown contained
+syn keyword lssMagentaBg magenta contained
+syn keyword lssCyanBg cyan contained
+syn keyword lssLightgrayBg lightgray contained
+syn keyword lssGrayBg gray contained
+syn keyword lssBrightredBg brightred contained
+syn keyword lssBrightgreenBg brightgreen contained
+syn keyword lssYellowBg yellow contained
+syn keyword lssBrightblueBg brightblue contained
+syn keyword lssBrightmagentaBg brightmagenta contained
+syn keyword lssBrightcyanBg brightcyan contained
+syn keyword lssWhiteBg white contained
+syn case match
+
+syn match lssComment "#.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lss_syntax_inits")
+ if version < 508
+ let did_lss_syntax_inits = 1
+ endif
+
+ hi def link lssComment Comment
+ hi def link lssElement Identifier
+
+ hi def lssBold term=bold cterm=bold
+ hi def lssReverse term=reverse cterm=reverse
+ hi def lssUnderline term=underline cterm=underline
+ hi def lssStandout term=standout cterm=standout
+
+ hi def lssRedFg ctermfg=red
+ hi def lssBlueFg ctermfg=blue
+ hi def lssGreenFg ctermfg=green
+ hi def lssBrownFg ctermfg=brown
+ hi def lssMagentaFg ctermfg=magenta
+ hi def lssCyanFg ctermfg=cyan
+ hi def lssGrayFg ctermfg=gray
+ if $COLORTERM == "rxvt"
+ " On rxvt's, bright colors are activated by setting the bold attribute.
+ hi def lssLightgrayFg ctermfg=gray cterm=bold
+ hi def lssBrightredFg ctermfg=red cterm=bold
+ hi def lssBrightgreenFg ctermfg=green cterm=bold
+ hi def lssYellowFg ctermfg=yellow cterm=bold
+ hi def lssBrightblueFg ctermfg=blue cterm=bold
+ hi def lssBrightmagentaFg ctermfg=magenta cterm=bold
+ hi def lssBrightcyanFg ctermfg=cyan cterm=bold
+ else
+ hi def lssLightgrayFg ctermfg=lightgray
+ hi def lssBrightredFg ctermfg=lightred
+ hi def lssBrightgreenFg ctermfg=lightgreen
+ hi def lssYellowFg ctermfg=yellow
+ hi def lssBrightblueFg ctermfg=lightblue
+ hi def lssBrightmagentaFg ctermfg=lightmagenta
+ hi def lssBrightcyanFg ctermfg=lightcyan
+ endif
+
+ hi def lssRedBg ctermbg=red
+ hi def lssBlueBg ctermbg=blue
+ hi def lssGreenBg ctermbg=green
+ hi def lssBrownBg ctermbg=brown
+ hi def lssMagentaBg ctermbg=magenta
+ hi def lssCyanBg ctermbg=cyan
+ hi def lssLightgrayBg ctermbg=lightgray
+ hi def lssGrayBg ctermbg=gray
+ hi def lssBrightredBg ctermbg=lightred
+ hi def lssBrightgreenBg ctermbg=lightgreen
+ hi def lssYellowBg ctermbg=yellow
+ hi def lssBrightblueBg ctermbg=lightblue
+ hi def lssBrightmagentaBg ctermbg=lightmagenta
+ hi def lssBrightcyanBg ctermbg=lightcyan
+ hi def lssWhiteBg ctermbg=white ctermfg=black
+endif
+
+let b:current_syntax = "lss"
+
+" vim: ts=8
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim
new file mode 100644
index 000000000..0bcda6202
--- /dev/null
+++ b/runtime/syntax/lua.vim
@@ -0,0 +1,256 @@
+" Vim syntax file
+" Language: Lua 4.0 and Lua 5.0
+" Maintainer: Marcus Aurelius Farias <marcuscf@vant.com.br>
+" First Author: Carlos Augusto Teixeira Mendes <cmendes@inf.puc-rio.br>
+" Last Change: 2003 May 04
+" Options: lua_version = 4 or 5 [default]
+"
+" Still has some syncing problems (long [[strings]])...
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("lua_version")
+ let lua_version = 5
+endif
+
+syn case match
+
+" Comments
+syn keyword luaTodo contained TODO FIXME XXX
+syn match luaComment "--.*$" contains=luaTodo
+if lua_version > 4
+ syn region luaComment matchgroup=luaComment start="--\[\[" end="\]\]" contains=luaTodo,luaInnerComment
+ syn region luaInnerComment contained transparent start="\[\[" end="\]\]"
+endif
+" First line may start with #!
+syn match luaComment "\%^#!.*"
+
+" catch errors caused by wrong parenthesis and wrong curly brackets or
+" keywords placed outside their respective blocks
+
+syn region luaParen transparent start='(' end=')' contains=ALLBUT,luaError,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement
+syn match luaError ")"
+syn match luaError "}"
+syn match luaError "\<\(end\|else\|elseif\|then\|until\|in\)\>"
+
+
+" Function declaration
+syn region luaFunctionBlock transparent matchgroup=luaFunction start="\<function\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
+
+" if then else elseif end
+syn keyword luaCond contained else
+
+" then ... end
+syn region luaCondEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaRepeat
+
+" elseif ... then
+syn region luaCondElseif contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
+
+" if ... then
+syn region luaCondStart transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaCondEnd skipwhite skipempty
+
+" do ... end
+syn region luaBlock transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
+
+" repeat ... until
+syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat
+
+" while ... do
+syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaRepeat nextgroup=luaBlock skipwhite skipempty
+
+" for ... do and for ... in ... do
+syn region luaRepeatBlock transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd nextgroup=luaBlock skipwhite skipempty
+
+" Following 'else' example. This is another item to those
+" contains=ALLBUT,... because only the 'for' luaRepeatBlock contains it.
+syn keyword luaRepeat contained in
+
+" other keywords
+syn keyword luaStatement return local break
+syn keyword luaOperator and or not
+syn keyword luaConstant nil
+if lua_version > 4
+ syn keyword luaConstant true false
+endif
+
+" Pre processor doesn't exist since Lua 4.0
+" syn match luaPreProc "^\s*$\(debug\|nodebug\|if\|ifnot\|end\|else\|endinput\)\>"
+
+" Strings
+syn match luaSpecial contained "\\[\\abfnrtv\'\"[\]]\|\\\d\{,3}"
+syn region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaSpecial
+syn region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaSpecial
+" Nested strings
+syn region luaString2 matchgroup=luaString start=+\[\[+ end=+\]\]+ contains=luaString2
+
+" integer number
+syn match luaNumber "\<[0-9]\+\>"
+" floating point number, with dot, optional exponent
+syn match luaFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\>"
+" floating point number, starting with a dot, optional exponent
+syn match luaFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>"
+" floating point number, without dot, with exponent
+syn match luaFloat "\<[0-9]\+e[-+]\=[0-9]\+\>"
+
+" tables
+syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" contains=ALLBUT,luaTodo,luaSpecial,luaCond,luaCondElseif,luaCondEnd,luaCondStart,luaBlock,luaRepeatBlock,luaRepeat,luaStatement
+
+syn keyword luaFunc assert collectgarbage dofile error gcinfo next
+syn keyword luaFunc print rawget rawset tonumber tostring type _VERSION
+
+if lua_version == 4
+ syn keyword luaFunc _ALERT _ERRORMESSAGE
+ syn keyword luaFunc call copytagmethods dostring
+ syn keyword luaFunc foreach foreachi getglobal getn
+ syn keyword luaFunc gettagmethod globals newtag
+ syn keyword luaFunc setglobal settag settagmethod sort
+ syn keyword luaFunc tag tinsert tremove
+ syn keyword luaFunc _INPUT _OUTPUT _STDIN _STDOUT _STDERR
+ syn keyword luaFunc openfile closefile flush seek
+ syn keyword luaFunc setlocale execute remove rename tmpname
+ syn keyword luaFunc getenv date clock exit
+ syn keyword luaFunc readfrom writeto appendto read write
+ syn keyword luaFunc PI abs sin cos tan asin
+ syn keyword luaFunc acos atan atan2 ceil floor
+ syn keyword luaFunc mod frexp ldexp sqrt min max log
+ syn keyword luaFunc log10 exp deg rad random
+ syn keyword luaFunc randomseed strlen strsub strlower strupper
+ syn keyword luaFunc strchar strrep ascii strbyte
+ syn keyword luaFunc format strfind gsub
+ syn keyword luaFunc getinfo getlocal setlocal setcallhook setlinehook
+else
+ syn keyword luaFunc _G getfenv getmetatable ipairs loadfile
+ syn keyword luaFunc loadlib loadstring pairs pcall rawequal
+ syn keyword luaFunc require setfenv setmetatable unpack xpcall
+ syn keyword luaFunc LUA_PATH _LOADED _REQUIREDNAME
+" Not sure if all these functions need to be highlighted...
+ syn match luaFunc /coroutine\.create/
+ syn match luaFunc /coroutine\.resume/
+ syn match luaFunc /coroutine\.status/
+ syn match luaFunc /coroutine\.wrap/
+ syn match luaFunc /coroutine\.yield/
+ syn match luaFunc /string\.byte/
+ syn match luaFunc /string\.char/
+ syn match luaFunc /string\.dump/
+ syn match luaFunc /string\.find/
+ syn match luaFunc /string\.len/
+ syn match luaFunc /string\.lower/
+ syn match luaFunc /string\.rep/
+ syn match luaFunc /string\.sub/
+ syn match luaFunc /string\.upper/
+ syn match luaFunc /string\.format/
+ syn match luaFunc /string\.gfind/
+ syn match luaFunc /string\.gsub/
+ syn match luaFunc /table\.concat/
+ syn match luaFunc /table\.foreach/
+ syn match luaFunc /table\.foreachi/
+ syn match luaFunc /table\.getn/
+ syn match luaFunc /table\.sort/
+ syn match luaFunc /table\.insert/
+ syn match luaFunc /table\.remove/
+ syn match luaFunc /table\.setn/
+ syn match luaFunc /math\.abs/
+ syn match luaFunc /math\.acos/
+ syn match luaFunc /math\.asin/
+ syn match luaFunc /math\.atan/
+ syn match luaFunc /math\.atan2/
+ syn match luaFunc /math\.ceil/
+ syn match luaFunc /math\.cos/
+ syn match luaFunc /math\.deg/
+ syn match luaFunc /math\.exp/
+ syn match luaFunc /math\.floor/
+ syn match luaFunc /math\.log/
+ syn match luaFunc /math\.log10/
+ syn match luaFunc /math\.max/
+ syn match luaFunc /math\.min/
+ syn match luaFunc /math\.mod/
+ syn match luaFunc /math\.pow/
+ syn match luaFunc /math\.rad/
+ syn match luaFunc /math\.sin/
+ syn match luaFunc /math\.sqrt/
+ syn match luaFunc /math\.tan/
+ syn match luaFunc /math\.frexp/
+ syn match luaFunc /math\.ldexp/
+ syn match luaFunc /math\.random/
+ syn match luaFunc /math\.randomseed/
+ syn match luaFunc /math\.pi/
+ syn match luaFunc /io\.stdin/
+ syn match luaFunc /io\.stdout/
+ syn match luaFunc /io\.stderr/
+ syn match luaFunc /io\.close/
+ syn match luaFunc /io\.flush/
+ syn match luaFunc /io\.input/
+ syn match luaFunc /io\.lines/
+ syn match luaFunc /io\.open/
+ syn match luaFunc /io\.output/
+ syn match luaFunc /io\.popen/
+ syn match luaFunc /io\.read/
+ syn match luaFunc /io\.tmpfile/
+ syn match luaFunc /io\.type/
+ syn match luaFunc /io\.write/
+ syn match luaFunc /os\.clock/
+ syn match luaFunc /os\.date/
+ syn match luaFunc /os\.difftime/
+ syn match luaFunc /os\.execute/
+ syn match luaFunc /os\.exit/
+ syn match luaFunc /os\.getenv/
+ syn match luaFunc /os\.remove/
+ syn match luaFunc /os\.rename/
+ syn match luaFunc /os\.setlocale/
+ syn match luaFunc /os\.time/
+ syn match luaFunc /os\.tmpname/
+ syn match luaFunc /debug\.debug/
+ syn match luaFunc /debug\.gethook/
+ syn match luaFunc /debug\.getinfo/
+ syn match luaFunc /debug\.getlocal/
+ syn match luaFunc /debug\.getupvalue/
+ syn match luaFunc /debug\.setlocal/
+ syn match luaFunc /debug\.setupvalue/
+ syn match luaFunc /debug\.sethook/
+ syn match luaFunc /debug\.traceback/
+endif
+
+"syncing method
+syn sync minlines=100
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lua_syntax_inits")
+ if version < 508
+ let did_lua_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink luaStatement Statement
+ HiLink luaRepeat Repeat
+ HiLink luaString String
+ HiLink luaString2 String
+ HiLink luaNumber Number
+ HiLink luaFloat Float
+ HiLink luaOperator Operator
+ HiLink luaConstant Constant
+ HiLink luaCond Conditional
+ HiLink luaFunction Function
+ HiLink luaComment Comment
+ HiLink luaTodo Todo
+ HiLink luaTable Structure
+ HiLink luaError Error
+ HiLink luaSpecial SpecialChar
+ " HiLink luaPreProc PreProc
+ HiLink luaFunc Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lua"
+
+" vim: noet ts=8
diff --git a/runtime/syntax/lynx.vim b/runtime/syntax/lynx.vim
new file mode 100644
index 000000000..1dee1ef79
--- /dev/null
+++ b/runtime/syntax/lynx.vim
@@ -0,0 +1,98 @@
+" Lynx syntax file
+" Filename: lynx.vim
+" Language: Lynx configuration file ( lynx.cfg )
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/lynx.vim
+" Last Change: 2003 May 11
+
+" TODO: more intelligent and complete argument highlighting
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match lynxLeadingWS "^\s*" transparent nextgroup=lynxOption
+
+syn match lynxComment "\(^\|\s\+\)#.*$" contains=lynxTodo
+
+syn keyword lynxTodo TODO NOTE FIXME XXX contained
+
+syn match lynxDelimiter ":" contained nextgroup=lynxBoolean,lynxNumber
+
+syn case ignore
+syn keyword lynxBoolean TRUE FALSE contained
+syn case match
+
+syn match lynxNumber "-\=\<\d\+\>" contained
+
+syn case ignore
+syn keyword lynxOption ACCEPT_ALL_COOKIES ALERTSECS ALWAYS_RESUBMIT_POSTS ALWAYS_TRUSTED_EXEC ASSUME_CHARSET ASSUMED_COLOR contained nextgroup=lynxDelimiter
+syn keyword lynxOption ASSUMED_DOC_CHARSET_CHOICE ASSUME_LOCAL_CHARSET ASSUME_UNREC_CHARSET AUTO_UNCACHE_DIRLISTS contained nextgroup=lynxDelimiter
+syn keyword lynxOption BIBP_BIBHOST BIBP_GLOBAL_SERVER BLOCK_MULTI_BOOKMARKS BOLD_H1 BOLD_HEADERS BOLD_NAME_ANCHORS contained nextgroup=lynxDelimiter
+syn keyword lynxOption CASE_SENSITIVE_ALWAYS_ON CHARACTER_SET CHARSETS_DIRECTORY CHARSET_SWITCH_RULES CHECKMAIL contained nextgroup=lynxDelimiter
+syn keyword lynxOption COLLAPSE_BR_TAGS COLOR CONNECT_TIMEOUT COOKIE_ACCEPT_DOMAINS COOKIE_FILE contained nextgroup=lynxDelimiter
+syn keyword lynxOption COOKIE_LOOSE_INVALID_DOMAINS COOKIE_QUERY_INVALID_DOMAINS COOKIE_REJECT_DOMAINS COOKIE_SAVE_FILE contained nextgroup=lynxDelimiter
+syn keyword lynxOption COOKIE_STRICT_INVALID_DOMAINS CSO_PROXY CSWING_PATH DEFAULT_BOOKMARK_FILE DEFAULT_CACHE_SIZE contained nextgroup=lynxDelimiter
+syn keyword lynxOption DEFAULT_EDITOR DEFAULT_INDEX_FILE DEFAULT_KEYPAD_MODE DEFAULT_KEYPAD_MODE_IS_NUMBERS_AS_ARROWS contained nextgroup=lynxDelimiter
+syn keyword lynxOption DEFAULT_USER_MODE DEFAULT_VIRTUAL_MEMORY_SIZE DIRED_MENU DISPLAY_CHARSET_CHOICE DOWNLOADER contained nextgroup=lynxDelimiter
+syn keyword lynxOption EMACS_KEYS_ALWAYS_ON ENABLE_LYNXRC ENABLE_SCROLLBACK EXTERNAL FINGER_PROXY FOCUS_WINDOW contained nextgroup=lynxDelimiter
+syn keyword lynxOption FORCE_8BIT_TOUPPER FORCE_EMPTY_HREFLESS_A FORCE_SSL_COOKIES_SECURE FORMS_OPTIONS FTP_PASSIVE contained nextgroup=lynxDelimiter
+syn keyword lynxOption FTP_PROXY GLOBAL_EXTENSION_MAP GLOBAL_MAILCAP GOPHER_PROXY GOTOBUFFER HELPFILE HIDDEN_LINK_MARKER contained nextgroup=lynxDelimiter
+syn keyword lynxOption HISTORICAL_COMMENTS HTMLSRC_ATTRNAME_XFORM HTMLSRC_TAGNAME_XFORM HTTP_PROXY HTTPS_PROXY INCLUDE contained nextgroup=lynxDelimiter
+syn keyword lynxOption INFOSECS JUMPBUFFER JUMPFILE JUMP_PROMPT JUSTIFY JUSTIFY_MAX_VOID_PERCENT KEYBOARD_LAYOUT KEYMAP contained nextgroup=lynxDelimiter
+syn keyword lynxOption LEFTARROW_IN_TEXTFIELD_PROMPT LIST_FORMAT LIST_NEWS_DATES LIST_NEWS_NUMBERS LOCAL_DOMAIN contained nextgroup=lynxDelimiter
+syn keyword lynxOption LOCAL_EXECUTION_LINKS_ALWAYS_ON LOCAL_EXECUTION_LINKS_ON_BUT_NOT_REMOTE LOCALHOST_ALIAS contained nextgroup=lynxDelimiter
+syn keyword lynxOption LYNXCGI_DOCUMENT_ROOT LYNXCGI_ENVIRONMENT LYNX_HOST_NAME LYNX_SIG_FILE MAIL_ADRS contained nextgroup=lynxDelimiter
+syn keyword lynxOption MAIL_SYSTEM_ERROR_LOGGING MAKE_LINKS_FOR_ALL_IMAGES MAKE_PSEUDO_ALTS_FOR_INLINES MESSAGESECS contained nextgroup=lynxDelimiter
+syn keyword lynxOption MINIMAL_COMMENTS MULTI_BOOKMARK_SUPPORT NCR_IN_BOOKMARKS NEWS_CHUNK_SIZE NEWS_MAX_CHUNK contained nextgroup=lynxDelimiter
+syn keyword lynxOption NEWS_POSTING NEWSPOST_PROXY NEWS_PROXY NEWSREPLY_PROXY NNTP_PROXY NNTPSERVER NO_DOT_FILES contained nextgroup=lynxDelimiter
+syn keyword lynxOption NO_FILE_REFERER NO_FORCED_CORE_DUMP NO_FROM_HEADER NO_ISMAP_IF_USEMAP NONRESTARTING_SIGWINCH contained nextgroup=lynxDelimiter
+syn keyword lynxOption NO_PROXY NO_REFERER_HEADER NO_TABLE_CENTER OUTGOING_MAIL_CHARSET PARTIAL PARTIAL_THRES contained nextgroup=lynxDelimiter
+syn keyword lynxOption PERSISTENT_COOKIES PERSONAL_EXTENSION_MAP PERSONAL_MAILCAP PREFERRED_CHARSET PREFERRED_LANGUAGE contained nextgroup=lynxDelimiter
+syn keyword lynxOption PREPEND_BASE_TO_SOURCE PREPEND_CHARSET_TO_SOURCE PRETTYSRC PRETTYSRC_SPEC contained nextgroup=lynxDelimiter
+syn keyword lynxOption PRETTYSRC_VIEW_NO_ANCHOR_NUMBERING PRINTER QUIT_DEFAULT_YES REFERER_WITH_QUERY REUSE_TEMPFILES contained nextgroup=lynxDelimiter
+syn keyword lynxOption RULE RULESFILE SAVE_SPACE SCAN_FOR_BURIED_NEWS_REFS SCROLLBAR SCROLLBAR_ARROW SEEK_FRAG_AREA_IN_CUR contained nextgroup=lynxDelimiter
+syn keyword lynxOption SEEK_FRAG_MAP_IN_CUR SET_COOKIES SHOW_CURSOR SHOW_KB_RATE SNEWSPOST_PROXY SNEWS_PROXY contained nextgroup=lynxDelimiter
+syn keyword lynxOption SNEWSREPLY_PROXY SOFT_DQUOTES SOURCE_CACHE SOURCE_CACHE_FOR_ABORTED STARTFILE STRIP_DOTDOT_URLS contained nextgroup=lynxDelimiter
+syn keyword lynxOption SUBSTITUTE_UNDERSCORES SUFFIX SUFFIX_ORDER SYSTEM_EDITOR SYSTEM_MAIL SYSTEM_MAIL_FLAGS TAGSOUP contained nextgroup=lynxDelimiter
+syn keyword lynxOption TEXTFIELDS_NEED_ACTIVATION TIMEOUT TRIM_INPUT_FIELDS TRUSTED_EXEC TRUSTED_LYNXCGI UPLOADER contained nextgroup=lynxDelimiter
+syn keyword lynxOption URL_DOMAIN_PREFIXES URL_DOMAIN_SUFFIXES USE_FIXED_RECORDS USE_MOUSE USE_SELECT_POPUPS VERBOSE_IMAGES contained nextgroup=lynxDelimiter
+syn keyword lynxOption VIEWER VI_KEYS_ALWAYS_ON WAIS_PROXY XLOADIMAGE_COMMAND contained nextgroup=lynxDelimiter
+syn case match
+
+" NOTE: set this if you want the cfg2html.pl formatting directives to be highlighted
+if exists("lynx_formatting_directives")
+ syn match lynxFormatDir "^\.\(h1\|h2\)\s.*$"
+ syn match lynxFormatDir "^\.\(ex\|nf\)\(\s\+\d\+\)\=$"
+ syn match lynxFormatDir "^\.fi$"
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_lynx_syn_inits")
+ if version < 508
+ let did_lynx_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink lynxBoolean Boolean
+ HiLink lynxComment Comment
+ HiLink lynxDelimiter Special
+ HiLink lynxFormatDir Special
+ HiLink lynxNumber Number
+ HiLink lynxOption Identifier
+ HiLink lynxTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "lynx"
+
+" vim: ts=8
diff --git a/runtime/syntax/m4.vim b/runtime/syntax/m4.vim
new file mode 100644
index 000000000..ef60a8ff7
--- /dev/null
+++ b/runtime/syntax/m4.vim
@@ -0,0 +1,73 @@
+" Vim syntax file
+" Language: M4
+" Maintainer: Claudio Fleiner
+" URL: http://www.fleiner.com/vim/syntax/m4.vim
+" Last Change: 2001 Apr 26
+
+" This file will highlight user function calls if they use only
+" capital letters and have at least one argument (i.e. the '('
+" must be there). Let me know if this is a problem.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+endif
+" we define it here so that included files can test for it
+ let main_syntax='m4'
+endif
+
+" define the m4 syntax
+syn match m4Variable contained "\$\d\+"
+syn match m4Special contained "$[@*#]"
+syn match m4Comment "dnl\>.*" contains=SpellErrors
+syn match m4Constants "\(\<m4_\)\=__file__"
+syn match m4Constants "\(\<m4_\)\=__line__"
+syn keyword m4Constants divnum sysval m4_divnum m4_sysval
+syn region m4Paren matchgroup=m4Delimiter start="(" end=")" contained contains=@m4Top
+syn region m4Command matchgroup=m4Function start="\<\(m4_\)\=\(define\|defn\|pushdef\)(" end=")" contains=@m4Top
+syn region m4Command matchgroup=m4Preproc start="\<\(m4_\)\=\(include\|sinclude\)("he=e-1 end=")" contains=@m4Top
+syn region m4Command matchgroup=m4Statement start="\<\(m4_\)\=\(syscmd\|esyscmd\|ifdef\|ifelse\|indir\|builtin\|shift\|errprint\|m4exit\|changecom\|changequote\|changeword\|m4wrap\|debugfile\|divert\|undivert\)("he=e-1 end=")" contains=@m4Top
+syn region m4Command matchgroup=m4builtin start="\<\(m4_\)\=\(len\|index\|regexp\|substr\|translit\|patsubst\|format\|incr\|decr\|eval\|maketemp\)("he=e-1 end=")" contains=@m4Top
+syn keyword m4Statement divert undivert
+syn region m4Command matchgroup=m4Type start="\<\(m4_\)\=\(undefine\|popdef\)("he=e-1 end=")" contains=@m4Top
+syn region m4Function matchgroup=m4Type start="\<[_A-Z][_A-Z0-9]*("he=e-1 end=")" contains=@m4Top
+syn region m4String start="`" end="'" contained contains=@m4Top,@m4StringContents,SpellErrors
+syn cluster m4Top contains=m4Comment,m4Constants,m4Special,m4Variable,m4String,m4Paren,m4Command,m4Statement,m4Function
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_m4_syn_inits")
+ if version < 508
+ let did_m4_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink m4Delimiter Delimiter
+ HiLink m4Comment Comment
+ HiLink m4Function Function
+ HiLink m4Keyword Keyword
+ HiLink m4Special Special
+ HiLink m4String String
+ HiLink m4Statement Statement
+ HiLink m4Preproc PreProc
+ HiLink m4Type Type
+ HiLink m4Special Special
+ HiLink m4Variable Special
+ HiLink m4Constants Constant
+ HiLink m4Builtin Statement
+ delcommand HiLink
+endif
+
+let b:current_syntax = "m4"
+
+if main_syntax == 'm4'
+ unlet main_syntax
+endif
+
+" vim: ts=4
diff --git a/runtime/syntax/mail.vim b/runtime/syntax/mail.vim
new file mode 100644
index 000000000..6fc0afb9d
--- /dev/null
+++ b/runtime/syntax/mail.vim
@@ -0,0 +1,92 @@
+" Vim syntax file
+" Language: Mail file
+" Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de>
+" Maintainer: Gautam Iyer <gautam@math.uchicago.edu>
+" Last Change: Mon 23 Feb 2004 02:26:16 PM CST
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+" The mail header is recognized starting with a "keyword:" line and ending
+" with an empty line or other line that can't be in the header. All lines of
+" the header are highlighted. Headers of quoted messages (quoted with >) are
+" also highlighted.
+
+" Syntax clusters
+syn cluster mailHeaderFields contains=mailHeaderKey,mailSubject,mailHeaderEmail,@mailLinks
+syn cluster mailLinks contains=mailURL,mailEmail
+syn cluster mailQuoteExps contains=mailQuoteExp1,mailQuoteExp2,mailQuoteExp3,mailQuoteExp4,mailQuoteExp5,mailQuoteExp6
+
+syn case match
+" For "From " matching case is required. The "From " is not matched in quoted
+" emails
+syn region mailHeader contains=@mailHeaderFields start="^From " skip="^\s" end="\v^[-A-Za-z0-9]*([^-A-Za-z0-9:]|$)"me=s-1
+syn match mailHeaderKey contained contains=mailEmail "^From\s.*$"
+
+syn case ignore
+" Nothing else depends on case. Headers in properly quoted (with "> " or ">")
+" emails are matched
+syn region mailHeader keepend contains=@mailHeaderFields,@mailQuoteExps start="^\z(\(> \?\)*\)\v(newsgroups|from|((in-)?reply-)?to|b?cc|subject|return-path|received|date|replied):" skip="^\z1\s" end="\v^\z1[-a-z0-9]*([^-a-z0-9:]|$)"me=s-1 end="\v^\z1@!"me=s-1 end="\v^\z1(\> ?)+"me=s-1
+
+syn region mailHeaderKey contained contains=mailHeaderEmail,mailEmail,@mailQuoteExps start="\v(^(\> ?)*)@<=(to|b?cc):" skip=",$" end="$"
+syn match mailHeaderKey contained contains=mailHeaderEmail,mailEmail "\v(^(\> ?)*)@<=(from|reply-to):.*$"
+syn match mailHeaderKey contained "\v(^(\> ?)*)@<=date:"
+syn match mailSubject contained "\v(^(\> ?)*)@<=subject:.*$" contains=@Spell
+
+" Anything in the header between < and > is an email address
+syn match mailHeaderEmail contained "<.\{-}>"
+
+" Mail Signatures. (Begin with "--", end with change in quote level)
+syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^\z(\(> \?\)*\)-- *$" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1
+
+" URLs start with a known protocol or www,web,w3.
+syn match mailURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]`
+syn match mailEmail "\v[_=a-z\./+0-9-]+\@[a-z0-9._-]+\a{2}"
+
+" Make sure quote markers in regions (header / signature) have correct color
+syn match mailQuoteExp1 contained "\v^(\> ?)"
+syn match mailQuoteExp2 contained "\v^(\> ?){2}"
+syn match mailQuoteExp3 contained "\v^(\> ?){3}"
+syn match mailQuoteExp4 contained "\v^(\> ?){4}"
+syn match mailQuoteExp5 contained "\v^(\> ?){5}"
+syn match mailQuoteExp6 contained "\v^(\> ?){6}"
+
+" Even and odd quoted lines. order is imporant here!
+syn match mailQuoted1 contains=mailHeader,@mailLinks,mailSignature "^\([a-z]\+>\|[]|}>]\).*$"
+syn match mailQuoted2 contains=mailHeader,@mailLinks,mailSignature "^\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{2}.*$"
+syn match mailQuoted3 contains=mailHeader,@mailLinks,mailSignature "^\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{3}.*$"
+syn match mailQuoted4 contains=mailHeader,@mailLinks,mailSignature "^\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{4}.*$"
+syn match mailQuoted5 contains=mailHeader,@mailLinks,mailSignature "^\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{5}.*$"
+syn match mailQuoted6 contains=mailHeader,@mailLinks,mailSignature "^\(\([a-z]\+>\|[]|}>]\)[ \t]*\)\{6}.*$"
+
+" Need to sync on the header. Assume we can do that within 100 lines
+if exists("mail_minlines")
+ exec "syn sync minlines=" . mail_minlines
+else
+ syn sync minlines=100
+endif
+
+" Define the default highlighting.
+hi def link mailHeader Statement
+hi def link mailHeaderKey Type
+hi def link mailSignature PreProc
+hi def link mailHeaderEmail mailEmail
+hi def link mailEmail Special
+hi def link mailURL String
+hi def link mailSubject LineNR
+hi def link mailQuoted1 Comment
+hi def link mailQuoted3 mailQuoted1
+hi def link mailQuoted5 mailQuoted1
+hi def link mailQuoted2 Identifier
+hi def link mailQuoted4 mailQuoted2
+hi def link mailQuoted6 mailQuoted2
+hi def link mailQuoteExp1 mailQuoted1
+hi def link mailQuoteExp2 mailQuoted2
+hi def link mailQuoteExp3 mailQuoted3
+hi def link mailQuoteExp4 mailQuoted4
+hi def link mailQuoteExp5 mailQuoted5
+hi def link mailQuoteExp6 mailQuoted6
+
+let b:current_syntax = "mail"
diff --git a/runtime/syntax/mailcap.vim b/runtime/syntax/mailcap.vim
new file mode 100644
index 000000000..6d6270709
--- /dev/null
+++ b/runtime/syntax/mailcap.vim
@@ -0,0 +1,54 @@
+" Vim syntax file
+" Language: Mailcap configuration file
+" Maintainer: Doug Kearns
+" Last Change: 2002 November 24
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/mailcap.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match mailcapComment "^#.*"
+
+syn region mailcapString start=+"+ end=+"+ contains=mailcapSpecial oneline
+
+syn match mailcapDelimiter "\\\@<!;"
+
+syn match mailcapSpecial "\\\@<!%[nstF]"
+syn match mailcapSpecial "\\\@<!%{[^}]*}"
+
+syn case ignore
+syn match mailcapFlag "\(=\s*\)\@<!\<\(needsterminal\|copiousoutput\|x-\w\+\)\>"
+syn match mailcapFieldname "\<\(compose\|composetyped\|print\|edit\|test\|x11-bitmap\|nametemplate\|textualnewlines\|description\|x-\w+\)\>\ze\s*="
+syn match mailcapTypeField "^\(text\|image\|audio\|video\|application\|message\|multipart\|model\|x-[[:graph:]]\+\)\(/\(\*\|[[:graph:]]\+\)\)\=\ze\s*;"
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mailcap_syntax_inits")
+ if version < 508
+ let did_mailcap_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mailcapComment Comment
+ HiLink mailcapDelimiter Delimiter
+ HiLink mailcapFlag Statement
+ HiLink mailcapFieldname Statement
+ HiLink mailcapSpecial Identifier
+ HiLink mailcapTypeField Type
+ HiLink mailcapString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mailcap"
+
+" vim: tabstop=8
diff --git a/runtime/syntax/make.vim b/runtime/syntax/make.vim
new file mode 100644
index 000000000..85da9800e
--- /dev/null
+++ b/runtime/syntax/make.vim
@@ -0,0 +1,137 @@
+" Vim syntax file
+" Language: Makefile
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/make.vim
+" Last Change: 2004 Apr 30
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" some special characters
+syn match makeSpecial "^\s*[@-]\+"
+syn match makeNextLine "\\\n\s*"
+
+" some directives
+syn match makePreCondit "^\s*\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
+syn match makeInclude "^\s*[-s]\=include"
+syn match makeStatement "^\s*vpath"
+syn match makeExport "^\s*\(export\|unexport\)\>"
+syn match makeOverride "^\s*override"
+hi link makeOverride makeStatement
+hi link makeExport makeStatement
+
+" Koehler: catch unmatched define/endef keywords. endef only matches it is by itself on a line
+syn region makeDefine start="^\s*define\s" end="^\s*endef\s*$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
+
+" Microsoft Makefile specials
+syn case ignore
+syn match makeInclude "^!\s*include"
+syn match makePreCondit "!\s*\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
+syn case match
+
+" identifiers
+syn region makeIdent start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
+syn region makeIdent start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
+syn match makeIdent "\$\$\w*"
+syn match makeIdent "\$[^({]"
+syn match makeIdent "^\s*\a\w*\s*[:+?!*]="me=e-2
+syn match makeIdent "^\s*\a\w*\s*="me=e-1
+syn match makeIdent "%"
+
+" Makefile.in variables
+syn match makeConfig "@[A-Za-z0-9_]\+@"
+
+" make targets
+" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
+syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
+syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
+
+syn region makeTarget transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeTarget "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
+
+syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
+
+syn match makeCommandError "^\s\+\S.*" contained
+syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
+syn match makeCmdNextLine "\\\n."he=e-1 contained
+
+
+" Statements / Functions (GNU make)
+syn match makeStatement contained "(\(subst\|addprefix\|addsuffix\|basename\|call\|dir\|error\|filter-out\|filter\|findstring\|firstword\|foreach\|if\|join\|notdir\|origin\|patsubst\|shell\|sort\|strip\|suffix\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
+
+" Comment
+if exists("make_microsoft")
+ syn match makeComment "#.*" contains=makeTodo
+else
+ syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=makeTodo
+ syn match makeComment "#$"
+endif
+syn keyword makeTodo TODO FIXME XXX contained
+
+" match escaped quotes and any other escaped character
+" except for $, as a backslash in front of a $ does
+" not make it a standard character, but instead it will
+" still act as the beginning of a variable
+" The escaped char is not highlightet currently
+syn match makeEscapedChar "\\[^$]"
+
+
+syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent
+syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
+syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine
+
+" Syncing
+syn sync minlines=20 maxlines=200
+
+" Sync on Make command block region: When searching backwards hits a line that
+" can't be a command or a comment, use makeCommands if it looks like a target,
+" NONE otherwise.
+syn sync match makeCommandSync groupthere NONE "^[^\t#]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_make_syn_inits")
+ if version < 508
+ let did_make_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink makeNextLine makeSpecial
+ HiLink makeCmdNextLine makeSpecial
+ HiLink makeSpecTarget Statement
+ if !exists("make_no_commands")
+ HiLink makeCommands Number
+ endif
+ HiLink makeImplicit Function
+ HiLink makeTarget Function
+ HiLink makeInclude Include
+ HiLink makePreCondit PreCondit
+ HiLink makeStatement Statement
+ HiLink makeIdent Identifier
+ HiLink makeSpecial Special
+ HiLink makeComment Comment
+ HiLink makeDString String
+ HiLink makeSString String
+ HiLink makeBString Function
+ HiLink makeError Error
+ HiLink makeTodo Todo
+ HiLink makeDefine Define
+ HiLink makeCommandError Error
+ HiLink makeConfig PreCondit
+ delcommand HiLink
+endif
+
+let b:current_syntax = "make"
+
+" vim: ts=8
diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim
new file mode 100644
index 000000000..347180c8d
--- /dev/null
+++ b/runtime/syntax/man.vim
@@ -0,0 +1,67 @@
+" Vim syntax file
+" Language: Man page
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
+" Version Info:
+" Last Change: 2004 May 16
+
+" Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>:
+" * manSubHeading
+" * manSynopsis (only for sections 2 and 3)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Get the CTRL-H syntax to handle backspaced text
+if version >= 600
+ runtime! syntax/ctrlh.vim
+else
+ source <sfile>:p:h/ctrlh.vim
+endif
+
+syn case ignore
+syn match manReference "\f\+([1-9][a-z]\=)"
+syn match manTitle "^\f\+([0-9]\+[a-z]\=).*"
+syn match manSectionHeading "^[a-z][a-z ]*[a-z]$"
+syn match manSubHeading "^\s\{3\}[a-z][a-z ]*[a-z]$"
+syn match manOptionDesc "^\s*[+-][a-z0-9]\S*"
+syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*"
+" syn match manHistory "^[a-z].*last change.*$"
+
+if getline(1) =~ '^[a-zA-Z_]\+([23])'
+ syntax include @cCode <sfile>:p:h/c.vim
+ syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained
+ syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"he=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition
+endif
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_man_syn_inits")
+ if version < 508
+ let did_man_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink manTitle Title
+ HiLink manSectionHeading Statement
+ HiLink manOptionDesc Constant
+ HiLink manLongOptionDesc Constant
+ HiLink manReference PreProc
+ HiLink manSubHeading Function
+ HiLink manCFuncDefinition Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "man"
+
+" vim:ts=8 sts=2 sw=2:
diff --git a/runtime/syntax/manual.vim b/runtime/syntax/manual.vim
new file mode 100644
index 000000000..5ac045f60
--- /dev/null
+++ b/runtime/syntax/manual.vim
@@ -0,0 +1,25 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Jun 04
+
+" This file is used for ":syntax manual".
+" It installs the Syntax autocommands, but no the FileType autocommands.
+
+if !has("syntax")
+ finish
+endif
+
+" Load the Syntax autocommands and set the default methods for highlighting.
+if !exists("syntax_on")
+ so <sfile>:p:h/synload.vim
+endif
+
+let syntax_manual = 1
+
+" Remove the connection between FileType and Syntax autocommands.
+silent! au! syntaxset FileType
+
+" If the GUI is already running, may still need to install the FileType menu.
+if has("gui_running") && !exists("did_install_syntax_menu")
+ source $VIMRUNTIME/menu.vim
+endif
diff --git a/runtime/syntax/maple.vim b/runtime/syntax/maple.vim
new file mode 100644
index 000000000..cda7c7516
--- /dev/null
+++ b/runtime/syntax/maple.vim
@@ -0,0 +1,582 @@
+" Vim syntax file
+" Language: Maple V (based on release 4)
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Mar 10, 2004
+" Version: 4
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Package Function Selection: {{{1
+" Because there are a lot of packages, and because of the potential for namespace
+" clashes, this version of <maple.vim> needs the user to select which, if any,
+" package functions should be highlighted. Select your packages and put into your
+" <.vimrc> none or more of the lines following let ...=1 lines:
+"
+" if exists("mvpkg_all")
+" ...
+" endif
+"
+" *OR* let mvpkg_all=1
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Iskeyword Effects: {{{1
+if version < 600
+ set iskeyword=$,48-57,_,a-z,@-Z
+else
+ setlocal iskeyword=$,48-57,_,a-z,@-Z
+endif
+
+" Package Selection: {{{1
+" allow user to simply select all packages for highlighting
+if exists("mvpkg_all")
+ let mv_DEtools = 1
+ let mv_Galois = 1
+ let mv_GaussInt = 1
+ let mv_LREtools = 1
+ let mv_combinat = 1
+ let mv_combstruct = 1
+ let mv_difforms = 1
+ let mv_finance = 1
+ let mv_genfunc = 1
+ let mv_geometry = 1
+ let mv_grobner = 1
+ let mv_group = 1
+ let mv_inttrans = 1
+ let mv_liesymm = 1
+ let mv_linalg = 1
+ let mv_logic = 1
+ let mv_networks = 1
+ let mv_numapprox = 1
+ let mv_numtheory = 1
+ let mv_orthopoly = 1
+ let mv_padic = 1
+ let mv_plots = 1
+ let mv_plottools = 1
+ let mv_powseries = 1
+ let mv_process = 1
+ let mv_simplex = 1
+ let mv_stats = 1
+ let mv_student = 1
+ let mv_sumtools = 1
+ let mv_tensor = 1
+ let mv_totorder = 1
+endif
+
+" Parenthesis/curly/brace sanity checker: {{{1
+syn region mvZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,mvError,mvBraceError,mvCurlyError
+syn region mvZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,mvError,mvBraceError,mvParenError
+syn region mvZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,mvError,mvCurlyError,mvParenError
+syn match mvError "[)\]}]"
+syn match mvBraceError "[)}]" contained
+syn match mvCurlyError "[)\]]" contained
+syn match mvParenError "[\]}]" contained
+syn match mvComma "[,;:]"
+syn match mvSemiError "[;:]" contained
+
+" Maple V Packages, circa Release 4: {{{1
+syn keyword mvPackage DEtools difforms group networks plots stats
+syn keyword mvPackage Galois finance inttrans numapprox plottools student
+syn keyword mvPackage GaussInt genfunc liesymm numtheory powseries sumtools
+syn keyword mvPackage LREtools geometry linalg orthopoly process tensor
+syn keyword mvPackage combinat grobner logic padic simplex totorder
+syn keyword mvPackage combstruct
+
+" Language Support: {{{1
+syn keyword mvTodo contained TODO
+syn region mvString start=+`+ skip=+``+ end=+`+ keepend contains=mvTodo
+syn region mvDelayEval start=+'+ end=+'+ keepend contains=ALLBUT,mvError,mvBraceError,mvCurlyError,mvParenError,mvSemiError
+syn match mvVarAssign "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:=" contains=mvAssign
+syn match mvAssign ":=" contained
+
+" Lower-Priority Operators: {{{1
+syn match mvOper "\."
+
+" Number handling: {{{1
+syn match mvNumber "\<\d\+" " integer
+ syn match mvNumber "[-+]\=\.\d\+" " . integer
+syn match mvNumber "\<\d\+\.\d\+" " integer . integer
+syn match mvNumber "\<\d\+\." " integer .
+syn match mvNumber "\<\d\+\.\." contains=mvRange " integer ..
+
+syn match mvNumber "\<\d\+e[-+]\=\d\+" " integer e [-+] integer
+syn match mvNumber "[-+]\=\.\d\+e[-+]\=\d\+" " . integer e [-+] integer
+syn match mvNumber "\<\d\+\.\d*e[-+]\=\d\+" " integer . [integer] e [-+] integer
+
+syn match mvNumber "[-+]\d\+" " integer
+syn match mvNumber "[-+]\d\+\.\d\+" " integer . integer
+syn match mvNumber "[-+]\d\+\." " integer .
+syn match mvNumber "[-+]\d\+\.\." contains=mvRange " integer ..
+
+syn match mvNumber "[-+]\d\+e[-+]\=\d\+" " integer e [-+] integer
+syn match mvNumber "[-+]\d\+\.\d*e[-+]\=\d\+" " integer . [integer] e [-+] integer
+
+syn match mvRange "\.\."
+
+" Operators: {{{1
+syn keyword mvOper and not or
+syn match mvOper "<>\|[<>]=\|[<>]\|="
+syn match mvOper "&+\|&-\|&\*\|&\/\|&"
+syn match mvError "\.\.\."
+
+" MapleV Statements: ? statement {{{1
+" Split into booleans, conditionals, operators, repeat-logic, etc
+syn keyword mvBool true false
+syn keyword mvCond elif else fi if then
+
+syn keyword mvRepeat by for in to
+syn keyword mvRepeat do from od while
+
+syn keyword mvSpecial NULL
+syn match mvSpecial "\[\]\|{}"
+
+syn keyword mvStatement Order fail options read save
+syn keyword mvStatement break local point remember stop
+syn keyword mvStatement done mod proc restart with
+syn keyword mvStatement end mods quit return
+syn keyword mvStatement error next
+
+" Builtin Constants: ? constants {{{1
+syn keyword mvConstant Catalan I gamma infinity
+syn keyword mvConstant FAIL Pi
+
+" Comments: DEBUG, if in a comment, is specially highlighted. {{{1
+syn keyword mvDebug contained DEBUG
+syn cluster mvCommentGroup contains=mvTodo,mvDebug,@Spell
+syn match mvComment "#.*$" contains=@mvCommentGroup
+
+" Basic Library Functions: ? index[function]
+syn keyword mvLibrary $ @ @@ ERROR
+syn keyword mvLibrary AFactor KelvinHer arctan factor log rhs
+syn keyword mvLibrary AFactors KelvinKei arctanh factors log10 root
+syn keyword mvLibrary AiryAi KelvinKer argument fclose lprint roots
+syn keyword mvLibrary AiryBi LambertW array feof map round
+syn keyword mvLibrary AngerJ Lcm assign fflush map2 rsolve
+syn keyword mvLibrary Berlekamp LegendreE assigned filepos match savelib
+syn keyword mvLibrary BesselI LegendreEc asspar fixdiv matrix scanf
+syn keyword mvLibrary BesselJ LegendreEc1 assume float max searchtext
+syn keyword mvLibrary BesselK LegendreF asubs floor maximize sec
+syn keyword mvLibrary BesselY LegendreKc asympt fnormal maxnorm sech
+syn keyword mvLibrary Beta LegendreKc1 attribute fopen maxorder select
+syn keyword mvLibrary C LegendrePi bernstein forget member seq
+syn keyword mvLibrary Chi LegendrePic branches fortran min series
+syn keyword mvLibrary Ci LegendrePic1 bspline fprintf minimize setattribute
+syn keyword mvLibrary CompSeq Li cat frac minpoly shake
+syn keyword mvLibrary Content Linsolve ceil freeze modp showprofile
+syn keyword mvLibrary D MOLS chrem fremove modp1 showtime
+syn keyword mvLibrary DESol Maple_floats close frontend modp2 sign
+syn keyword mvLibrary Det MeijerG close fscanf modpol signum
+syn keyword mvLibrary Diff Norm coeff fsolve mods simplify
+syn keyword mvLibrary Dirac Normal coeffs galois msolve sin
+syn keyword mvLibrary DistDeg Nullspace coeftayl gc mtaylor singular
+syn keyword mvLibrary Divide Power collect gcd mul sinh
+syn keyword mvLibrary Ei Powmod combine gcdex nextprime sinterp
+syn keyword mvLibrary Eigenvals Prem commutat genpoly nops solve
+syn keyword mvLibrary EllipticCE Primfield comparray harmonic norm sort
+syn keyword mvLibrary EllipticCK Primitive compoly has normal sparse
+syn keyword mvLibrary EllipticCPi Primpart conjugate hasfun numboccur spline
+syn keyword mvLibrary EllipticE ProbSplit content hasoption numer split
+syn keyword mvLibrary EllipticF Product convergs hastype op splits
+syn keyword mvLibrary EllipticK Psi convert heap open sprem
+syn keyword mvLibrary EllipticModulus Quo coords history optimize sprintf
+syn keyword mvLibrary EllipticNome RESol copy hypergeom order sqrfree
+syn keyword mvLibrary EllipticPi Randpoly cos iFFT parse sqrt
+syn keyword mvLibrary Eval Randprime cosh icontent pclose sscanf
+syn keyword mvLibrary Expand Ratrecon cost identity pclose ssystem
+syn keyword mvLibrary FFT Re cot igcd pdesolve stack
+syn keyword mvLibrary Factor Rem coth igcdex piecewise sturm
+syn keyword mvLibrary Factors Resultant csc ilcm plot sturmseq
+syn keyword mvLibrary FresnelC RootOf csch ilog plot3d subs
+syn keyword mvLibrary FresnelS Roots csgn ilog10 plotsetup subsop
+syn keyword mvLibrary Fresnelf SPrem dawson implicitdiff pochhammer substring
+syn keyword mvLibrary Fresnelg Searchtext define indets pointto sum
+syn keyword mvLibrary Frobenius Shi degree index poisson surd
+syn keyword mvLibrary GAMMA Si denom indexed polar symmdiff
+syn keyword mvLibrary GaussAGM Smith depends indices polylog symmetric
+syn keyword mvLibrary Gaussejord Sqrfree diagonal inifcn polynom system
+syn keyword mvLibrary Gausselim Ssi diff ininame powmod table
+syn keyword mvLibrary Gcd StruveH dilog initialize prem tan
+syn keyword mvLibrary Gcdex StruveL dinterp insert prevprime tanh
+syn keyword mvLibrary HankelH1 Sum disassemble int primpart testeq
+syn keyword mvLibrary HankelH2 Svd discont interface print testfloat
+syn keyword mvLibrary Heaviside TEXT discrim interp printf thaw
+syn keyword mvLibrary Hermite Trace dismantle invfunc procbody thiele
+syn keyword mvLibrary Im WeberE divide invztrans procmake time
+syn keyword mvLibrary Indep WeierstrassP dsolve iostatus product translate
+syn keyword mvLibrary Interp WeierstrassPPrime eliminate iperfpow proot traperror
+syn keyword mvLibrary Inverse WeierstrassSigma ellipsoid iquo property trigsubs
+syn keyword mvLibrary Irreduc WeierstrassZeta entries iratrecon protect trunc
+syn keyword mvLibrary Issimilar Zeta eqn irem psqrt type
+syn keyword mvLibrary JacobiAM abs erf iroot quo typematch
+syn keyword mvLibrary JacobiCD add erfc irreduc radnormal unames
+syn keyword mvLibrary JacobiCN addcoords eulermac iscont radsimp unapply
+syn keyword mvLibrary JacobiCS addressof eval isdifferentiable rand unassign
+syn keyword mvLibrary JacobiDC algebraic evala isolate randomize unload
+syn keyword mvLibrary JacobiDN algsubs evalapply ispoly randpoly unprotect
+syn keyword mvLibrary JacobiDS alias evalb isqrfree range updatesR4
+syn keyword mvLibrary JacobiNC allvalues evalc isqrt rationalize userinfo
+syn keyword mvLibrary JacobiND anames evalf issqr ratrecon value
+syn keyword mvLibrary JacobiNS antisymm evalfint latex readbytes vector
+syn keyword mvLibrary JacobiSC applyop evalgf lattice readdata verify
+syn keyword mvLibrary JacobiSD arccos evalhf lcm readlib whattype
+syn keyword mvLibrary JacobiSN arccosh evalm lcoeff readline with
+syn keyword mvLibrary JacobiTheta1 arccot evaln leadterm readstat writebytes
+syn keyword mvLibrary JacobiTheta2 arccoth evalr length realroot writedata
+syn keyword mvLibrary JacobiTheta3 arccsc exp lexorder recipoly writeline
+syn keyword mvLibrary JacobiTheta4 arccsch expand lhs rem writestat
+syn keyword mvLibrary JacobiZeta arcsec expandoff limit remove writeto
+syn keyword mvLibrary KelvinBei arcsech expandon ln residue zip
+syn keyword mvLibrary KelvinBer arcsin extract lnGAMMA resultant ztrans
+syn keyword mvLibrary KelvinHei arcsinh
+
+
+" == PACKAGES ======================================================= {{{1
+" Note: highlighting of package functions is now user-selectable by package.
+
+" Package: DEtools differential equations tools {{{2
+if exists("mv_DEtools")
+ syn keyword mvPkg_DEtools DEnormal Dchangevar autonomous dfieldplot reduceOrder untranslate
+ syn keyword mvPkg_DEtools DEplot PDEchangecoords convertAlg indicialeq regularsp varparam
+ syn keyword mvPkg_DEtools DEplot3d PDEplot convertsys phaseportrait translate
+endif
+
+" Package: Domains: create domains of computation {{{2
+if exists("mv_Domains")
+endif
+
+" Package: GF: Galois Fields {{{2
+if exists("mv_GF")
+ syn keyword mvPkg_Galois galois
+endif
+
+" Package: GaussInt: Gaussian Integers {{{2
+if exists("mv_GaussInt")
+ syn keyword mvPkg_GaussInt GIbasis GIfactor GIissqr GInorm GIquadres GIsmith
+ syn keyword mvPkg_GaussInt GIchrem GIfactors GIlcm GInormal GIquo GIsqrfree
+ syn keyword mvPkg_GaussInt GIdivisor GIgcd GImcmbine GIorder GIrem GIsqrt
+ syn keyword mvPkg_GaussInt GIfacpoly GIgcdex GInearest GIphi GIroots GIunitnormal
+ syn keyword mvPkg_GaussInt GIfacset GIhermite GInodiv GIprime GIsieve
+endif
+
+" Package: LREtools: manipulate linear recurrence relations {{{2
+if exists("mv_LREtools")
+ syn keyword mvPkg_LREtools REcontent REprimpart REtodelta delta hypergeomsols ratpolysols
+ syn keyword mvPkg_LREtools REcreate REreduceorder REtoproc dispersion polysols shift
+ syn keyword mvPkg_LREtools REplot REtoDE constcoeffsol
+endif
+
+" Package: combinat: combinatorial functions {{{2
+if exists("mv_combinat")
+ syn keyword mvPkg_combinat Chi composition graycode numbcomb permute randperm
+ syn keyword mvPkg_combinat bell conjpart inttovec numbcomp powerset stirling1
+ syn keyword mvPkg_combinat binomial decodepart lastpart numbpart prevpart stirling2
+ syn keyword mvPkg_combinat cartprod encodepart multinomial numbperm randcomb subsets
+ syn keyword mvPkg_combinat character fibonacci nextpart partition randpart vectoint
+ syn keyword mvPkg_combinat choose firstpart
+endif
+
+" Package: combstruct: combinatorial structures {{{2
+if exists("mv_combstruct")
+ syn keyword mvPkg_combstruct allstructs draw iterstructs options specification structures
+ syn keyword mvPkg_combstruct count finished nextstruct
+endif
+
+" Package: difforms: differential forms {{{2
+if exists("mv_difforms")
+ syn keyword mvPkg_difforms const defform formpart parity scalarpart wdegree
+ syn keyword mvPkg_difforms d form mixpar scalar simpform wedge
+endif
+
+" Package: finance: financial mathematics {{{2
+if exists("mv_finance")
+ syn keyword mvPkg_finance amortization cashflows futurevalue growingperpetuity mv_finance presentvalue
+ syn keyword mvPkg_finance annuity effectiverate growingannuity levelcoupon perpetuity yieldtomaturity
+ syn keyword mvPkg_finance blackscholes
+endif
+
+" Package: genfunc: rational generating functions {{{2
+if exists("mv_genfunc")
+ syn keyword mvPkg_genfunc rgf_charseq rgf_expand rgf_hybrid rgf_pfrac rgf_sequence rgf_term
+ syn keyword mvPkg_genfunc rgf_encode rgf_findrecur rgf_norm rgf_relate rgf_simp termscale
+endif
+
+" Package: geometry: Euclidean geometry {{{2
+if exists("mv_geometry")
+ syn keyword mvPkg_geometry circle dsegment hyperbola parabola segment triangle
+ syn keyword mvPkg_geometry conic ellipse line point square
+endif
+
+" Package: grobner: Grobner bases {{{2
+if exists("mv_grobner")
+ syn keyword mvPkg_grobner finduni gbasis leadmon normalf solvable spoly
+ syn keyword mvPkg_grobner finite gsolve
+endif
+
+" Package: group: permutation and finitely-presented groups {{{2
+if exists("mv_group")
+ syn keyword mvPkg_group DerivedS areconjugate cosets grouporder issubgroup permrep
+ syn keyword mvPkg_group LCS center cosrep inter mulperms pres
+ syn keyword mvPkg_group NormalClosure centralizer derived invperm normalizer subgrel
+ syn keyword mvPkg_group RandElement convert grelgroup isabelian orbit type
+ syn keyword mvPkg_group Sylow core groupmember isnormal permgroup
+endif
+
+" Package: inttrans: integral transforms {{{2
+if exists("mv_inttrans")
+ syn keyword mvPkg_inttrans addtable fouriercos hankel invfourier invlaplace mellin
+ syn keyword mvPkg_inttrans fourier fouriersin hilbert invhilbert laplace
+endif
+
+" Package: liesymm: Lie symmetries {{{2
+if exists("mv_liesymm")
+ syn keyword mvPkg_liesymm &^ TD depvars getform mixpar vfix
+ syn keyword mvPkg_liesymm &mod annul determine hasclosure prolong wcollect
+ syn keyword mvPkg_liesymm Eta autosimp dvalue hook reduce wdegree
+ syn keyword mvPkg_liesymm Lie close extvars indepvars setup wedgeset
+ syn keyword mvPkg_liesymm Lrank d getcoeff makeforms translate wsubs
+endif
+
+" Package: linalg: Linear algebra {{{2
+if exists("mv_linalg")
+ syn keyword mvPkg_linalg GramSchmidt coldim equal indexfunc mulcol singval
+ syn keyword mvPkg_linalg JordanBlock colspace exponential innerprod multiply smith
+ syn keyword mvPkg_linalg LUdecomp colspan extend intbasis norm stack
+ syn keyword mvPkg_linalg QRdecomp companion ffgausselim inverse normalize submatrix
+ syn keyword mvPkg_linalg addcol cond fibonacci ismith orthog subvector
+ syn keyword mvPkg_linalg addrow copyinto forwardsub issimilar permanent sumbasis
+ syn keyword mvPkg_linalg adjoint crossprod frobenius iszero pivot swapcol
+ syn keyword mvPkg_linalg angle curl gausselim jacobian potential swaprow
+ syn keyword mvPkg_linalg augment definite gaussjord jordan randmatrix sylvester
+ syn keyword mvPkg_linalg backsub delcols geneqns kernel randvector toeplitz
+ syn keyword mvPkg_linalg band delrows genmatrix laplacian rank trace
+ syn keyword mvPkg_linalg basis det grad leastsqrs references transpose
+ syn keyword mvPkg_linalg bezout diag hadamard linsolve row vandermonde
+ syn keyword mvPkg_linalg blockmatrix diverge hermite matadd rowdim vecpotent
+ syn keyword mvPkg_linalg charmat dotprod hessian matrix rowspace vectdim
+ syn keyword mvPkg_linalg charpoly eigenval hilbert minor rowspan vector
+ syn keyword mvPkg_linalg cholesky eigenvect htranspose minpoly scalarmul wronskian
+ syn keyword mvPkg_linalg col entermatrix ihermite
+endif
+
+" Package: logic: Boolean logic {{{2
+if exists("mv_logic")
+ syn keyword mvPkg_logic MOD2 bsimp distrib environ randbool tautology
+ syn keyword mvPkg_logic bequal canon dual frominert satisfy toinert
+endif
+
+" Package: networks: graph networks {{{2
+if exists("mv_networks")
+ syn keyword mvPkg_networks acycpoly connect dinic graph mincut show
+ syn keyword mvPkg_networks addedge connectivity djspantree graphical mindegree shrink
+ syn keyword mvPkg_networks addvertex contract dodecahedron gsimp neighbors span
+ syn keyword mvPkg_networks adjacency countcuts draw gunion new spanpoly
+ syn keyword mvPkg_networks allpairs counttrees duplicate head octahedron spantree
+ syn keyword mvPkg_networks ancestor cube edges icosahedron outdegree tail
+ syn keyword mvPkg_networks arrivals cycle ends incidence path tetrahedron
+ syn keyword mvPkg_networks bicomponents cyclebase eweight incident petersen tuttepoly
+ syn keyword mvPkg_networks charpoly daughter flow indegree random vdegree
+ syn keyword mvPkg_networks chrompoly degreeseq flowpoly induce rank vertices
+ syn keyword mvPkg_networks complement delete fundcyc isplanar rankpoly void
+ syn keyword mvPkg_networks complete departures getlabel maxdegree shortpathtree vweight
+ syn keyword mvPkg_networks components diameter girth
+endif
+
+" Package: numapprox: numerical approximation {{{2
+if exists("mv_numapprox")
+ syn keyword mvPkg_numapprox chebdeg chebsort fnorm laurent minimax remez
+ syn keyword mvPkg_numapprox chebmult chebyshev hornerform laurent pade taylor
+ syn keyword mvPkg_numapprox chebpade confracform infnorm minimax
+endif
+
+" Package: numtheory: number theory {{{2
+if exists("mv_numtheory")
+ syn keyword mvPkg_numtheory B cyclotomic invcfrac mcombine nthconver primroot
+ syn keyword mvPkg_numtheory F divisors invphi mersenne nthdenom quadres
+ syn keyword mvPkg_numtheory GIgcd euler isolve minkowski nthnumer rootsunity
+ syn keyword mvPkg_numtheory J factorEQ isprime mipolys nthpow safeprime
+ syn keyword mvPkg_numtheory L factorset issqrfree mlog order sigma
+ syn keyword mvPkg_numtheory M fermat ithprime mobius pdexpand sq2factor
+ syn keyword mvPkg_numtheory bernoulli ifactor jacobi mroot phi sum2sqr
+ syn keyword mvPkg_numtheory bigomega ifactors kronecker msqrt pprimroot tau
+ syn keyword mvPkg_numtheory cfrac imagunit lambda nearestp prevprime thue
+ syn keyword mvPkg_numtheory cfracpol index legendre nextprime
+endif
+
+" Package: orthopoly: orthogonal polynomials {{{2
+if exists("mv_orthopoly")
+ syn keyword mvPkg_orthopoly G H L P T U
+endif
+
+" Package: padic: p-adic numbers {{{2
+if exists("mv_padic")
+ syn keyword mvPkg_padic evalp function orderp ratvaluep rootp valuep
+ syn keyword mvPkg_padic expansion lcoeffp ordp
+endif
+
+" Package: plots: graphics package {{{2
+if exists("mv_plots")
+ syn keyword mvPkg_plots animate coordplot3d gradplot3d listplot3d polarplot setoptions3d
+ syn keyword mvPkg_plots animate3d cylinderplot implicitplot loglogplot polygonplot spacecurve
+ syn keyword mvPkg_plots changecoords densityplot implicitplot3d logplot polygonplot3d sparsematrixplot
+ syn keyword mvPkg_plots complexplot display inequal matrixplot polyhedraplot sphereplot
+ syn keyword mvPkg_plots complexplot3d display3d listcontplot odeplot replot surfdata
+ syn keyword mvPkg_plots conformal fieldplot listcontplot3d pareto rootlocus textplot
+ syn keyword mvPkg_plots contourplot fieldplot3d listdensityplot pointplot semilogplot textplot3d
+ syn keyword mvPkg_plots contourplot3d gradplot listplot pointplot3d setoptions tubeplot
+ syn keyword mvPkg_plots coordplot
+endif
+
+" Package: plottools: basic graphical objects {{{2
+if exists("mv_plottools")
+ syn keyword mvPkg_plottools arc curve dodecahedron hyperbola pieslice semitorus
+ syn keyword mvPkg_plottools arrow cutin ellipse icosahedron point sphere
+ syn keyword mvPkg_plottools circle cutout ellipticArc line polygon tetrahedron
+ syn keyword mvPkg_plottools cone cylinder hemisphere octahedron rectangle torus
+ syn keyword mvPkg_plottools cuboid disk hexahedron
+endif
+
+" Package: powseries: formal power series {{{2
+if exists("mv_powseries")
+ syn keyword mvPkg_powseries compose multiply powcreate powlog powsolve reversion
+ syn keyword mvPkg_powseries evalpow negative powdiff powpoly powsqrt subtract
+ syn keyword mvPkg_powseries inverse powadd powexp powseries quotient tpsform
+ syn keyword mvPkg_powseries multconst powcos powint powsin
+endif
+
+" Package: process: (Unix)-multi-processing {{{2
+if exists("mv_process")
+ syn keyword mvPkg_process block fork pclose pipe popen wait
+ syn keyword mvPkg_process exec kill
+endif
+
+" Package: simplex: linear optimization {{{2
+if exists("mv_simplex")
+ syn keyword mvPkg_simplex NONNEGATIVE cterm dual maximize pivoteqn setup
+ syn keyword mvPkg_simplex basis define_zero equality minimize pivotvar standardize
+ syn keyword mvPkg_simplex convexhull display feasible pivot ratio
+endif
+
+" Package: stats: statistics {{{2
+if exists("mv_stats")
+ syn keyword mvPkg_stats anova describe fit random statevalf statplots
+endif
+
+" Package: student: student calculus {{{2
+if exists("mv_student")
+ syn keyword mvPkg_student D Product distance isolate middlesum rightsum
+ syn keyword mvPkg_student Diff Sum equate leftbox midpoint showtangent
+ syn keyword mvPkg_student Doubleint Tripleint extrema leftsum minimize simpson
+ syn keyword mvPkg_student Int changevar integrand makeproc minimize slope
+ syn keyword mvPkg_student Limit combine intercept maximize powsubs trapezoid
+ syn keyword mvPkg_student Lineint completesquare intparts middlebox rightbox value
+ syn keyword mvPkg_student Point
+endif
+
+" Package: sumtools: indefinite and definite sums {{{2
+if exists("mv_sumtools")
+ syn keyword mvPkg_sumtools Hypersum extended_gosper hyperrecursion hyperterm sumrecursion sumtohyper
+ syn keyword mvPkg_sumtools Sumtohyper gosper hypersum simpcomb
+endif
+
+" Package: tensor: tensor computations and General Relativity {{{2
+if exists("mv_tensor")
+ syn keyword mvPkg_tensor Christoffel1 Riemann connexF display_allGR get_compts partial_diff
+ syn keyword mvPkg_tensor Christoffel2 RiemannF contract dual get_rank permute_indices
+ syn keyword mvPkg_tensor Einstein Weyl convertNP entermetric invars petrov
+ syn keyword mvPkg_tensor Jacobian act cov_diff exterior_diff invert prod
+ syn keyword mvPkg_tensor Killing_eqns antisymmetrize create exterior_prod lin_com raise
+ syn keyword mvPkg_tensor Levi_Civita change_basis d1metric frame lower symmetrize
+ syn keyword mvPkg_tensor Lie_diff commutator d2metric geodesic_eqns npcurve tensorsGR
+ syn keyword mvPkg_tensor Ricci compare directional_diff get_char npspin transform
+ syn keyword mvPkg_tensor Ricciscalar conj displayGR
+endif
+
+" Package: totorder: total orders on names {{{2
+if exists("mv_totorder")
+ syn keyword mvPkg_totorder forget init ordering tassume tis
+endif
+" =====================================================================
+
+" Highlighting: Define the default highlighting. {{{1
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_maplev_syntax_inits")
+ if version < 508
+ let did_maplev_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Maple->Maple Links {{{2
+ HiLink mvBraceError mvError
+ HiLink mvCurlyError mvError
+ HiLink mvDebug mvTodo
+ HiLink mvParenError mvError
+ HiLink mvPkg_DEtools mvPkgFunc
+ HiLink mvPkg_Galois mvPkgFunc
+ HiLink mvPkg_GaussInt mvPkgFunc
+ HiLink mvPkg_LREtools mvPkgFunc
+ HiLink mvPkg_combinat mvPkgFunc
+ HiLink mvPkg_combstruct mvPkgFunc
+ HiLink mvPkg_difforms mvPkgFunc
+ HiLink mvPkg_finance mvPkgFunc
+ HiLink mvPkg_genfunc mvPkgFunc
+ HiLink mvPkg_geometry mvPkgFunc
+ HiLink mvPkg_grobner mvPkgFunc
+ HiLink mvPkg_group mvPkgFunc
+ HiLink mvPkg_inttrans mvPkgFunc
+ HiLink mvPkg_liesymm mvPkgFunc
+ HiLink mvPkg_linalg mvPkgFunc
+ HiLink mvPkg_logic mvPkgFunc
+ HiLink mvPkg_networks mvPkgFunc
+ HiLink mvPkg_numapprox mvPkgFunc
+ HiLink mvPkg_numtheory mvPkgFunc
+ HiLink mvPkg_orthopoly mvPkgFunc
+ HiLink mvPkg_padic mvPkgFunc
+ HiLink mvPkg_plots mvPkgFunc
+ HiLink mvPkg_plottools mvPkgFunc
+ HiLink mvPkg_powseries mvPkgFunc
+ HiLink mvPkg_process mvPkgFunc
+ HiLink mvPkg_simplex mvPkgFunc
+ HiLink mvPkg_stats mvPkgFunc
+ HiLink mvPkg_student mvPkgFunc
+ HiLink mvPkg_sumtools mvPkgFunc
+ HiLink mvPkg_tensor mvPkgFunc
+ HiLink mvPkg_totorder mvPkgFunc
+ HiLink mvRange mvOper
+ HiLink mvSemiError mvError
+
+ " Maple->Standard Links {{{2
+ HiLink mvAssign Delimiter
+ HiLink mvBool Boolean
+ HiLink mvComma Delimiter
+ HiLink mvComment Comment
+ HiLink mvCond Conditional
+ HiLink mvConstant Number
+ HiLink mvDelayEval Label
+ HiLink mvError Error
+ HiLink mvLibrary Statement
+ HiLink mvNumber Number
+ HiLink mvOper Operator
+ HiLink mvPackage Type
+ HiLink mvPkgFunc Function
+ HiLink mvPktOption Special
+ HiLink mvRepeat Repeat
+ HiLink mvSpecial Special
+ HiLink mvStatement Statement
+ HiLink mvString String
+ HiLink mvTodo Todo
+
+ delcommand HiLink
+endif
+
+" Current Syntax: {{{1
+let b:current_syntax = "maple"
+" vim: ts=20 fdm=marker
diff --git a/runtime/syntax/masm.vim b/runtime/syntax/masm.vim
new file mode 100644
index 000000000..e11a0293a
--- /dev/null
+++ b/runtime/syntax/masm.vim
@@ -0,0 +1,144 @@
+" Vim syntax file
+" Language: Microsoft Assembler (80x86)
+" Maintainer: Rob Brady <robb@datatone.com>
+" Last Change: $Date$
+" URL: http://www.datatone.com/~robb/vim/syntax/masm.vim
+" $Revision$
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+
+" syn match masmType "\.word"
+
+syn match masmIdentifier "[a-z_$][a-z0-9_$]*"
+syn match masmLabel "^[A-Z_$][A-Z0-9_$]*:"he=e-1
+
+syn match masmDecimal "\d*"
+syn match masmBinary "[0-1]\+b" "put this before hex or 0bfh dies!
+syn match masmHexadecimal "[0-9]\x*h"
+syn match masmFloat "[0-9]\x*r"
+
+syn match masmComment ";.*"
+syn region masmString start=+'+ end=+'+
+
+syn keyword masmOperator AND BYTE PTR CODEPTR DATAPTR DUP DWORD EQ FAR
+syn keyword masmOperator FWORD GE GT HIGH LARGE LE LOW LT MOD NE NEAR
+syn keyword masmOperator NOT OFFSET OR PROC PWORD QWORD SEG SHORT TBYTE
+syn keyword masmOperator TYPE WORD PARA
+syn keyword masmDirective ALIGN ARG ASSUME CODESEG COMM
+syn keyword masmDirective CONST DATASEG DB DD DF DISPLAY DOSSEG DP
+syn keyword masmDirective DQ DT DW ELSE ELSEIF EMUL END ENDIF ENDM ENDP
+syn keyword masmDirective ENDS ENUM EQU PROC PUBLIC PUBLICDLL RADIX
+syn keyword masmDirective EXTRN FARDATA GLOBAL RECORD SEGMENT SMALLSTACK
+syn keyword masmDirective GROUP IF IF1 IF2 IFB IFDEF IFDIF IFDIFI
+syn keyword masmDirective IFE IFIDN IFIDNI IFNB IFNDEF INCLUDE INCLUDLIB
+syn keyword masmDirective LABEL LARGESTACK STACK STRUC SUBTTL TITLE
+syn keyword masmDirective MODEL NAME NOEMUL UNION USES VERSION
+syn keyword masmDirective ORG FLAT
+syn match masmDirective "\.model"
+syn match masmDirective "\.186"
+syn match masmDirective "\.286"
+syn match masmDirective "\.286c"
+syn match masmDirective "\.286p"
+syn match masmDirective "\.287"
+syn match masmDirective "\.386"
+syn match masmDirective "\.386c"
+syn match masmDirective "\.386p"
+syn match masmDirective "\.387"
+syn match masmDirective "\.486"
+syn match masmDirective "\.486c"
+syn match masmDirective "\.486p"
+syn match masmDirective "\.8086"
+syn match masmDirective "\.8087"
+syn match masmDirective "\.ALPHA"
+syn match masmDirective "\.CODE"
+syn match masmDirective "\.DATA"
+
+syn keyword masmRegister AX BX CX DX SI DI BP SP
+syn keyword masmRegister ES DS SS CS
+syn keyword masmRegister AH BH CH DH AL BL CL DL
+syn keyword masmRegister EAX EBX ECX EDX ESI EDI EBP ESP
+
+
+" these are current as of the 486 - don't have any pentium manuals handy
+syn keyword masmOpcode AAA AAD AAM AAS ADC ADD AND ARPL BOUND BSF
+syn keyword masmOpcode BSR BSWAP BT BTC BTR BTS BSWAP BT BTC BTR
+syn keyword masmOpcode BTS CALL CBW CDQ CLC CLD CLI CLTS CMC CMP
+syn keyword masmOpcode CMPS CMPSB CMPSW CMPSD CMPXCHG CWD CWDE DAA
+syn keyword masmOpcode DAS DEC DIV ENTER HLT IDIV IMUL IN INC INS
+syn keyword masmOpcode INSB INSW INSD INT INTO INVD INVLPG IRET
+syn keyword masmOpcode IRETD JA JAE JB JBE JC JCXZ JECXZ JE JZ JG
+syn keyword masmOpcode JGE JL JLE JNA JNAE JNB JNBE JNC JNE JNG JNGE
+syn keyword masmOpcode JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO JS JZ
+syn keyword masmOpcode JMP LAHF LAR LEA LEAVE LGDT LIDT LGS LSS LFS
+syn keyword masmOpcode LODS LODSB LODSW LODSD LOOP LOOPE LOOPZ LOONE
+syn keyword masmOpcode LOOPNE RETF RETN
+syn keyword masmOpcode LDS LES LLDT LMSW LOCK LSL LTR MOV MOVS MOVSB
+syn keyword masmOpcode MOVSW MOVSD MOVSX MOVZX MUL NEG NOP NOT OR
+syn keyword masmOpcode OUT OUTS OUTSB OUTSW OUTSD POP POPA POPD
+syn keyword masmOpcode POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD
+syn keyword masmOpcode RCL RCR ROL ROR REP REPE REPZ REPNE REPNZ
+syn keyword masmOpcode RET SAHF SAL SAR SHL SHR SBB SCAS SCASB
+syn keyword masmOpcode SCASW SCASD SETA SETAE SETB SETBE SETC SETE
+syn keyword masmOpcode SETG SETGE SETL SETLE SETNA SETNAE SETNB
+syn keyword masmOpcode SETNBE SETNC SETNE SETNG SETNGE SETNL SETNLE
+syn keyword masmOpcode SETNO SETNP SETNS SETNZ SETO SETP SETPE SETPO
+syn keyword masmOpcode SETS SETZ SGDT SIDT SHLD SHRD SLDT SMSW STC
+syn keyword masmOpcode STD STI STOS STOSB STOSW STOSD STR SUB TEST
+syn keyword masmOpcode VERR VERW WAIT WBINVD XADD XCHG XLAT XLATB XOR
+
+" floating point coprocessor as of 487
+syn keyword masmOpFloat F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX
+syn keyword masmOpFloat FNCLEX FCOM FCOMP FCOMPP FCOS FDECSTP FDISI
+syn keyword masmOpFloat FNDISI FDIV FDIVP FDIVR FDIVRP FENI FNENI
+syn keyword masmOpFloat FFREE FIADD FICOM FICOMP FIDIV FIDIVR FILD
+syn keyword masmOpFloat FIMUL FINCSTP FINIT FNINIT FIST FISTP FISUB
+syn keyword masmOpFloat FISUBR FLD FLDCW FLDENV FLDLG2 FLDLN2 FLDL2E
+syn keyword masmOpFloat FLDL2T FLDPI FLDZ FLD1 FMUL FMULP FNOP FPATAN
+syn keyword masmOpFloat FPREM FPREM1 FPTAN FRNDINT FRSTOR FSAVE
+syn keyword masmOpFloat FNSAVE FSCALE FSETPM FSIN FSINCOS FSQRT FST
+syn keyword masmOpFloat FSTCW FNSTCW FSTENV FNSTENV FSTP FSTSW FNSTSW
+syn keyword masmOpFloat FSUB FSUBP FSUBR FSUBRP FTST FUCOM FUCOMP
+syn keyword masmOpFloat FUCOMPP FWAIT FXAM FXCH FXTRACT FYL2X FYL2XP1
+syn match masmOpFloat "FSTSW[ \t]\+AX"
+syn match masmOpFloat "FNSTSW[ \t]\+AX"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_masm_syntax_inits")
+ if version < 508
+ let did_masm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink masmLabel Label
+ HiLink masmComment Comment
+ HiLink masmDirective Statement
+ HiLink masmOperator Statement
+ HiLink masmString String
+
+ HiLink masmHexadecimal Number
+ HiLink masmDecimal Number
+ HiLink masmBinary Number
+ HiLink masmFloat Number
+
+ HiLink masmIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "masm"
+
+" vim: ts=8
diff --git a/runtime/syntax/mason.vim b/runtime/syntax/mason.vim
new file mode 100644
index 000000000..40bdb0eaa
--- /dev/null
+++ b/runtime/syntax/mason.vim
@@ -0,0 +1,99 @@
+" Vim syntax file
+" Language: Mason (Perl embedded in HTML)
+" Maintainer: Andrew Smith <andrewdsmith@yahoo.com>
+" Last change: 2003 May 11
+" URL: http://www.masonhq.com/editors/mason.vim
+"
+" This seems to work satisfactorily with html.vim and perl.vim for version 5.5.
+" Please mail any fixes or improvements to the above address. Things that need
+" doing include:
+"
+" - Add match for component names in <& &> blocks.
+" - Add match for component names in <%def> and <%method> block delimiters.
+" - Fix <%text> blocks to show HTML tags but ignore Mason tags.
+"
+
+" Clear previous syntax settings unless this is v6 or above, in which case just
+" exit without doing anything.
+"
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" The HTML syntax file included below uses this variable.
+"
+if !exists("main_syntax")
+ let main_syntax = 'mason'
+endif
+
+" First pull in the HTML syntax.
+"
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syn cluster htmlPreproc add=@masonTop
+
+" Now pull in the Perl syntax.
+"
+if version < 600
+ syn include @perlTop <sfile>:p:h/perl.vim
+else
+ syn include @perlTop syntax/perl.vim
+endif
+
+" It's hard to reduce down to the correct sub-set of Perl to highlight in some
+" of these cases so I've taken the safe option of just using perlTop in all of
+" them. If you have any suggestions, please let me know.
+"
+syn region masonLine matchgroup=Delimiter start="^%" end="$" contains=@perlTop
+syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop
+syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=@perlTop
+syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop
+
+syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=@perlTop
+
+syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=@perlTop
+syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=@perlTop
+syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=@perlTop
+syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=@perlTop
+
+syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="</%def>" contains=@htmlTop
+syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="</%method>" contains=@htmlTop
+
+syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=@perlTop
+syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=@perlTop
+
+syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=@perlTop
+
+syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
+syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
+
+syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,masonInit,masonCleanup,masonOnce,masonShared,masonDef,masonMethod,masonFlags,masonAttr,masonFilter,masonDoc,masonText
+
+" Set up default highlighting. Almost all of this is done in the included
+" syntax files.
+"
+if version >= 508 || !exists("did_mason_syn_inits")
+ if version < 508
+ let did_mason_syn_inits = 1
+ com -nargs=+ HiLink hi link <args>
+ else
+ com -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink masonDoc Comment
+
+ delc HiLink
+endif
+
+let b:current_syntax = "mason"
+
+if main_syntax == 'mason'
+ unlet main_syntax
+endif
diff --git a/runtime/syntax/master.vim b/runtime/syntax/master.vim
new file mode 100644
index 000000000..c2125c155
--- /dev/null
+++ b/runtime/syntax/master.vim
@@ -0,0 +1,50 @@
+" Vim syntax file
+" Language: Focus Master File
+" Maintainer: Rob Brady <robb@datatone.com>
+" Last Change: $Date$
+" URL: http://www.datatone.com/~robb/vim/syntax/master.vim
+" $Revision$
+
+" this is a very simple syntax file - I will be improving it
+" add entire DEFINE syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+" A bunch of useful keywords
+syn keyword masterKeyword FILENAME SUFFIX SEGNAME SEGTYPE PARENT FIELDNAME
+syn keyword masterKeyword FIELD ALIAS USAGE INDEX MISSING ON
+syn keyword masterKeyword FORMAT CRFILE CRKEY
+syn keyword masterDefine DEFINE DECODE EDIT
+syn region masterString start=+"+ end=+"+
+syn region masterString start=+'+ end=+'+
+syn match masterComment "\$.*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_master_syntax_inits")
+ if version < 508
+ let did_master_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink masterKeyword Keyword
+ HiLink masterComment Comment
+ HiLink masterString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "master"
+
+" vim: ts=8
diff --git a/runtime/syntax/matlab.vim b/runtime/syntax/matlab.vim
new file mode 100644
index 000000000..9bba9759c
--- /dev/null
+++ b/runtime/syntax/matlab.vim
@@ -0,0 +1,109 @@
+" Vim syntax file
+" Language: Matlab
+" Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
+" Original author: Mario Eusebio
+" Last Change: 30 May 2003
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword matlabStatement return
+syn keyword matlabLabel case switch
+syn keyword matlabConditional else elseif end if otherwise
+syn keyword matlabRepeat do for while
+
+syn keyword matlabTodo contained TODO
+
+" If you do not want these operators lit, uncommment them and the "hi link" below
+syn match matlabArithmeticOperator "[-+]"
+syn match matlabArithmeticOperator "\.\=[*/\\^]"
+syn match matlabRelationalOperator "[=~]="
+syn match matlabRelationalOperator "[<>]=\="
+syn match matlabLogicalOperator "[&|~]"
+
+syn match matlabLineContinuation "\.\{3}"
+
+"syn match matlabIdentifier "\<\a\w*\>"
+
+" String
+syn region matlabString start=+'+ end=+'+ oneline
+
+" If you don't like tabs
+syn match matlabTab "\t"
+
+" Standard numbers
+syn match matlabNumber "\<\d\+[ij]\=\>"
+" floating point number, with dot, optional exponent
+syn match matlabFloat "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
+" floating point number, starting with a dot, optional exponent
+syn match matlabFloat "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
+
+" Transpose character and delimiters: Either use just [...] or (...) aswell
+syn match matlabDelimiter "[][]"
+"syn match matlabDelimiter "[][()]"
+syn match matlabTransposeOperator "[])a-zA-Z0-9.]'"lc=1
+
+syn match matlabSemicolon ";"
+
+syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
+
+syn keyword matlabOperator break zeros default margin round ones rand
+syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
+
+syn keyword matlabFunction error eval function
+
+syn keyword matlabImplicit abs acos atan asin cos cosh exp log prod sum
+syn keyword matlabImplicit log10 max min sign sin sqrt tan reshape
+
+syn match matlabError "-\=\<\d\+\.\d\+\.[^*/\\^]"
+syn match matlabError "-\=\<\d\+\.\d\+[eEdD][-+]\=\d\+\.\([^*/\\^]\)"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_matlab_syntax_inits")
+ if version < 508
+ let did_matlab_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink matlabTransposeOperator matlabOperator
+ HiLink matlabOperator Operator
+ HiLink matlabLineContinuation Special
+ HiLink matlabLabel Label
+ HiLink matlabConditional Conditional
+ HiLink matlabRepeat Repeat
+ HiLink matlabTodo Todo
+ HiLink matlabString String
+ HiLink matlabDelimiter Identifier
+ HiLink matlabTransposeOther Identifier
+ HiLink matlabNumber Number
+ HiLink matlabFloat Float
+ HiLink matlabFunction Function
+ HiLink matlabError Error
+ HiLink matlabImplicit matlabStatement
+ HiLink matlabStatement Statement
+ HiLink matlabSemicolon SpecialChar
+ HiLink matlabComment Comment
+
+ HiLink matlabArithmeticOperator matlabOperator
+ HiLink matlabRelationalOperator matlabOperator
+ HiLink matlabLogicalOperator matlabOperator
+
+"optional highlighting
+ "HiLink matlabIdentifier Identifier
+ "HiLink matlabTab Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "matlab"
+
+"EOF vim: ts=8 noet tw=100 sw=8 sts=0
diff --git a/runtime/syntax/mel.vim b/runtime/syntax/mel.vim
new file mode 100644
index 000000000..dab894865
--- /dev/null
+++ b/runtime/syntax/mel.vim
@@ -0,0 +1,121 @@
+" Vim syntax file
+" Language: MEL (Maya Extension Language)
+" Maintainer: Robert Minsk <egbert@centropolisfx.com>
+" Last Change: May 27 1999
+" Based on: Bram Moolenaar <Bram@vim.org> C syntax file
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" when wanted, highlight trailing white space and spaces before tabs
+if exists("mel_space_errors")
+ sy match melSpaceError "\s\+$"
+ sy match melSpaceError " \+\t"me=e-1
+endif
+
+" A bunch of usefull MEL keyworks
+sy keyword melBoolean true false yes no on off
+
+sy keyword melFunction proc
+sy match melIdentifier "\$\(\a\|_\)\w*"
+
+sy keyword melStatement break continue return
+sy keyword melConditional if else switch
+sy keyword melRepeat while for do in
+sy keyword melLabel case default
+sy keyword melOperator size eval env exists whatIs
+sy keyword melKeyword alias
+sy keyword melException catch error warning
+
+sy keyword melInclude source
+
+sy keyword melType int float string vector matrix
+sy keyword melStorageClass global
+
+sy keyword melDebug trace
+
+sy keyword melTodo contained TODO FIXME XXX
+
+" MEL data types
+sy match melCharSpecial contained "\\[ntr\\"]"
+sy match melCharError contained "\\[^ntr\\"]"
+
+sy region melString start=+"+ skip=+\\"+ end=+"+ contains=melCharSpecial,melCharError
+
+sy case ignore
+sy match melInteger "\<\d\+\(e[-+]\=\d\+\)\=\>"
+sy match melFloat "\<\d\+\(e[-+]\=\d\+\)\=f\>"
+sy match melFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=f\=\>"
+sy match melFloat "\.\d\+\(e[-+]\=\d\+\)\=f\=\>"
+sy case match
+
+sy match melCommaSemi contained "[,;]"
+sy region melMatrixVector start=/<</ end=/>>/ contains=melInteger,melFloat,melIdentifier,melCommaSemi
+
+sy cluster melGroup contains=melFunction,melStatement,melConditional,melLabel,melKeyword,melStorageClass,melTODO,melCharSpecial,melCharError,melCommaSemi
+
+" catch errors caused by wrong parenthesis
+sy region melParen transparent start='(' end=')' contains=ALLBUT,@melGroup,melParenError,melInParen
+sy match melParenError ")"
+sy match melInParen contained "[{}]"
+
+" comments
+sy region melComment start="/\*" end="\*/" contains=melTodo,melSpaceError
+sy match melComment "//.*" contains=melTodo,melSpaceError
+sy match melCommentError "\*/"
+
+sy region melQuestionColon matchgroup=melConditional transparent start='?' end=':' contains=ALLBUT,@melGroup
+
+if !exists("mel_minlines")
+ let mel_minlines=15
+endif
+exec "sy sync ccomment melComment minlines=" . mel_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mel_syntax_inits")
+ if version < 508
+ let did_mel_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink melBoolean Boolean
+ HiLink melFunction Function
+ HiLink melIdentifier Identifier
+ HiLink melStatement Statement
+ HiLink melConditional Conditional
+ HiLink melRepeat Repeat
+ HiLink melLabel Label
+ HiLink melOperator Operator
+ HiLink melKeyword Keyword
+ HiLink melException Exception
+ HiLink melInclude Include
+ HiLink melType Type
+ HiLink melStorageClass StorageClass
+ HiLink melDebug Debug
+ HiLink melTodo Todo
+ HiLink melCharSpecial SpecialChar
+ HiLink melString String
+ HiLink melInteger Number
+ HiLink melFloat Float
+ HiLink melMatrixVector Float
+ HiLink melComment Comment
+ HiLink melError Error
+ HiLink melSpaceError melError
+ HiLink melCharError melError
+ HiLink melParenError melError
+ HiLink melInParen melError
+ HiLink melCommentError melError
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mel"
diff --git a/runtime/syntax/mf.vim b/runtime/syntax/mf.vim
new file mode 100644
index 000000000..8bc48fee4
--- /dev/null
+++ b/runtime/syntax/mf.vim
@@ -0,0 +1,197 @@
+" Vim syntax file
+" Language: Metafont
+" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
+" Last Change: April 25, 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Metafont 'primitives' as defined in chapter 25 of 'The METAFONTbook'
+" Page 210: 'boolean expressions'
+syn keyword mfBoolExp true false known unknown odd charexists not and or
+
+" Page 210: 'numeric expression'
+syn keyword mfNumExp normaldeviate length ASCII oct hex angle turningnumber
+syn keyword mfNumExp totalweight directiontime xpart ypart xxpart xypart
+syn keyword mfNumExp yxpart yypart sqrt sind cosd mlog mexp floor
+syn keyword mfNumExp uniformdeviate
+
+" Page 211: 'internal quantities'
+syn keyword mfInternal tracingtitles tracingequations tracingcapsules
+syn keyword mfInternal tracingchoices tracingspecs tracingpens
+syn keyword mfInternal tracingcommands tracingrestores tracingmacros
+syn keyword mfInternal tracingedges tracingoutput tracingonline tracingstats
+syn keyword mfInternal pausing showstopping fontmaking proofing
+syn keyword mfInternal turningcheck warningcheck smoothing autorounding
+syn keyword mfInternal granularity fillin year month day time
+syn keyword mfInternal charcode charext charwd charht chardp charic
+syn keyword mfInternal chardx chardy designsize hppp vppp xoffset yoffset
+syn keyword mfInternal boundarychar
+
+" Page 212: 'pair expressions'
+syn keyword mfPairExp point of precontrol postcontrol penoffset rotated
+syn keyword mfPairExp scaled shifted slanted transformed xscaled yscaled
+syn keyword mfPairExp zscaled
+
+" Page 213: 'path expressions'
+syn keyword mfPathExp makepath reverse subpath curl tension atleast
+syn keyword mfPathExp controls cycle
+
+" Page 214: 'pen expressions'
+syn keyword mfPenExp nullpen pencircle makepen
+
+" Page 214: 'picutre expressions'
+syn keyword mfPicExp nullpicture
+
+" Page 214: 'string expressions'
+syn keyword mfStringExp jobname readstring str char decimal substring
+
+" Page 217: 'commands and statements'
+syn keyword mfCommand end dump save interim newinternal randomseed let
+syn keyword mfCommand delimiters outer everyjob show showvariable showtoken
+syn keyword mfCommand showdependencies showstats message errmessage errhelp
+syn keyword mfCommand batchmode nonstopmode scrollmode errorstopmode
+syn keyword mfCommand addto also contour doublepath withpen withweight cull
+syn keyword mfCommand keeping dropping display inwindow openwindow at from to
+syn keyword mfCommand shipout special numspecial
+
+" Page 56: 'types'
+syn keyword mfType boolean numeric pair path pen picture string transform
+
+" Page 155: 'grouping'
+syn keyword mfStatement begingroup endgroup
+
+" Page 165: 'definitions'
+syn keyword mfDefinition enddef def expr suffix text primary secondary
+syn keyword mfDefinition tertiary vardef primarydef secondarydef tertiarydef
+
+" Page 169: 'conditions and loops'
+syn keyword mfCondition if fi else elseif endfor for forsuffixes forever
+syn keyword mfCondition step until exitif
+
+" Other primitives listed in the index
+syn keyword mfPrimitive charlist endinput expandafter extensible
+syn keyword mfPrimitive fontdimen headerbyte inner input intersectiontimes
+syn keyword mfPrimitive kern ligtable quote scantokens skipto
+
+" Keywords defined by plain.mf (defined on pp.262-278)
+if !exists("plain_mf_macros")
+ let plain_mf_macros = 1 " Set this to '0' if your source gets too colourful
+ " metapost.vim does so to turn off Metafont macros
+endif
+if plain_mf_macros
+ syn keyword mfMacro abs addto_currentpicture aspect_ratio base_name
+ syn keyword mfMacro base_version beginchar blacker blankpicture bot bye byte
+ syn keyword mfMacro capsule_def ceiling change_width clear_pen_memory clearit
+ syn keyword mfMacro clearpen clearxy counterclockwise culldraw cullit
+ syn keyword mfMacro currentpen currentpen_path currentpicture
+ syn keyword mfMacro currenttransform currentwindow cutdraw cutoff d decr
+ syn keyword mfMacro define_blacker_pixels define_corrected_pixels
+ syn keyword mfMacro define_good_x_pixels define_good_y_pixels
+ syn keyword mfMacro define_horizontal_corrected_pixels define_pixels
+ syn keyword mfMacro define_whole_blacker_pixels define_whole_pixels
+ syn keyword mfMacro define_whole_vertical_blacker_pixels
+ syn keyword mfMacro define_whole_vertical_pixels dir direction directionpoint
+ syn keyword mfMacro displaying ditto div dotprod down downto draw drawdot
+ syn keyword mfMacro endchar eps epsilon extra_beginchar extra_endchar
+ syn keyword mfMacro extra_setup erase exitunless fill filldraw fix_units flex
+ syn keyword mfMacro font_coding_scheme font_extra_space font_identifier
+ syn keyword mfMacro font_normal_shrink font_normal_space font_normal_stretch
+ syn keyword mfMacro font_quad font_setup font_size font_slant font_x_height
+ syn keyword mfMacro fullcircle generate gfcorners gobble gobbled grayfont h
+ syn keyword mfMacro halfcircle hide hround identity image_rules incr infinity
+ syn keyword mfMacro interact interpath intersectionpoint inverse italcorr
+ syn keyword mfMacro join_radius killtext labelfont labels left lft localfont
+ syn keyword mfMacro loggingall lowres lowres_fix mag magstep makebox makegrid
+ syn keyword mfMacro makelabel maketicks max min mod mode mode_def mode_name
+ syn keyword mfMacro mode_setup nodisplays notransforms number_of_modes numtok
+ syn keyword mfMacro o_correction openit origin pen_bot pen_lft pen_rt pen_top
+ syn keyword mfMacro penlabels penpos penrazor penspeck pensquare penstroke
+ syn keyword mfMacro pickup pixels_per_inch proof proofoffset proofrule
+ syn keyword mfMacro proofrulethickness quartercircle range reflectedabout
+ syn keyword mfMacro relax right rotatedabout rotatedaround round rt rulepen
+ syn keyword mfMacro savepen screenchars screen_rows screen_cols screenrule
+ syn keyword mfMacro screenstrokes shipit showit slantfont smode smoke softjoin
+ syn keyword mfMacro solve stop superellipse takepower tensepath titlefont
+ syn keyword mfMacro tolerance top tracingall tracingnone undraw undrawdot
+ syn keyword mfMacro unfill unfilldraw unitpixel unitsquare unitvector up upto
+ syn keyword mfMacro vround w whatever
+endif
+
+" Some other basic macro names, e.g., from cmbase, logo, etc.
+if !exists("other_mf_macros")
+ let other_mf_macros = 1 " Set this to '0' if your code gets too colourful
+ " metapost.vim does so to turn off Metafont macros
+endif
+if other_mf_macros
+ syn keyword mfMacro beginlogochar
+endif
+
+" Numeric tokens
+syn match mfNumeric "[-]\=\d\+"
+syn match mfNumeric "[-]\=\.\d\+"
+syn match mfNumeric "[-]\=\d\+\.\d\+"
+
+" Metafont lengths
+syn match mfLength "\<\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\>"
+syn match mfLength "\<[-]\=\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
+syn match mfLength "\<[-]\=\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
+syn match mfLength "\<[-]\=\d\+\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
+
+" Metafont coordinates and points
+syn match mfCoord "\<[xy]\d\+\>"
+syn match mfPoint "\<z\d\+\>"
+
+" String constants
+syn region mfString start=+"+ end=+"+
+
+" Comments:
+syn match mfComment "%.*$"
+
+" synchronizing
+syn sync maxlines=50
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mf_syntax_inits")
+ if version < 508
+ let did_mf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mfBoolExp Statement
+ HiLink mfNumExp Statement
+ HiLink mfInternal Identifier
+ HiLink mfPairExp Statement
+ HiLink mfPathExp Statement
+ HiLink mfPenExp Statement
+ HiLink mfPicExp Statement
+ HiLink mfStringExp Statement
+ HiLink mfCommand Statement
+ HiLink mfType Type
+ HiLink mfStatement Statement
+ HiLink mfDefinition Statement
+ HiLink mfCondition Conditional
+ HiLink mfPrimitive Statement
+ HiLink mfMacro Macro
+ HiLink mfCoord Identifier
+ HiLink mfPoint Identifier
+ HiLink mfNumeric Number
+ HiLink mfLength Number
+ HiLink mfComment Comment
+ HiLink mfString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mf"
+
+" vim: ts=8
diff --git a/runtime/syntax/mgp.vim b/runtime/syntax/mgp.vim
new file mode 100644
index 000000000..76b96612e
--- /dev/null
+++ b/runtime/syntax/mgp.vim
@@ -0,0 +1,83 @@
+" Vim syntax file
+" Language: mgp - MaGic Point
+" Maintainer: Gerfried Fuchs <alfie@ist.org>
+" Filenames: *.mgp
+" Last Change: 25 Apr 2001
+" URL: http://alfie.ist.org/vim/syntax/mgp.vim
+"
+" Comments are very welcome - but please make sure that you are commenting on
+" the latest version of this file.
+" SPAM is _NOT_ welcome - be ready to be reported!
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+syn match mgpLineSkip "\\$"
+
+" all the commands that are currently recognized
+syn keyword mgpCommand contained size fore back bgrad left leftfill center
+syn keyword mgpCommand contained right shrink lcutin rcutin cont xfont vfont
+syn keyword mgpCommand contained tfont tmfont tfont0 bar image newimage
+syn keyword mgpCommand contained prefix icon bimage default tab vgap hgap
+syn keyword mgpCommand contained pause mark again system filter endfilter
+syn keyword mgpCommand contained vfcap tfdir deffont font embed endembed
+syn keyword mgpCommand contained noop pcache include
+
+" charset is not yet supported :-)
+" syn keyword mgpCommand contained charset
+
+syn region mgpFile contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match mgpValue contained "\d\+"
+syn match mgpSize contained "\d\+x\d\+"
+syn match mgpLine +^%.*$+ contains=mgpCommand,mgpFile,mgpSize,mgpValue
+
+" Comments
+syn match mgpPercent +^%%.*$+
+syn match mgpHash +^#.*$+
+
+" these only work alone
+syn match mgpPage +^%page$+
+syn match mgpNoDefault +^%nodefault$+
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mgp_syn_inits")
+ let did_mgp_syn_inits = 1
+ if version < 508
+ let did_mgp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mgpLineSkip Special
+
+ HiLink mgpHash mgpComment
+ HiLink mgpPercent mgpComment
+ HiLink mgpComment Comment
+
+ HiLink mgpCommand Identifier
+
+ HiLink mgpLine Type
+
+ HiLink mgpFile String
+ HiLink mgpSize Number
+ HiLink mgpValue Number
+
+ HiLink mgpPage mgpDefine
+ HiLink mgpNoDefault mgpDefine
+ HiLink mgpDefine Define
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mgp"
diff --git a/runtime/syntax/mib.vim b/runtime/syntax/mib.vim
new file mode 100644
index 000000000..a29242d0f
--- /dev/null
+++ b/runtime/syntax/mib.vim
@@ -0,0 +1,77 @@
+" Vim syntax file
+" Language: Vim syntax file for SNMPv1 and SNMPv2 MIB and SMI files
+" Author: David Pascoe <pascoedj@spamcop.net>
+" Written: Wed Jan 28 14:37:23 GMT--8:00 1998
+" Last Changed: Thu Feb 27 10:18:16 WST 2003
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,128-167,224-235,-,:,=
+else
+ set iskeyword=@,48-57,_,128-167,224-235,-,:,=
+endif
+
+syn keyword mibImplicit ACCESS ANY AUGMENTS BEGIN BIT BITS BOOLEAN CHOICE
+syn keyword mibImplicit COMPONENTS CONTACT-INFO DEFINITIONS DEFVAL
+syn keyword mibImplicit DESCRIPTION DISPLAY-HINT END ENTERPRISE EXTERNAL FALSE
+syn keyword mibImplicit FROM GROUP IMPLICIT IMPLIED IMPORTS INDEX
+syn keyword mibImplicit LAST-UPDATED MANDATORY-GROUPS MAX-ACCESS
+syn keyword mibImplicit MIN-ACCESS MODULE MODULE-COMPLIANCE MODULE-IDENTITY
+syn keyword mibImplicit NOTIFICATION-GROUP NOTIFICATION-TYPE NOTIFICATIONS
+syn keyword mibImplicit NULL OBJECT-GROUP OBJECT-IDENTITY OBJECT-TYPE
+syn keyword mibImplicit OBJECTS OF OPTIONAL ORGANIZATION REFERENCE
+syn keyword mibImplicit REVISION SEQUENCE SET SIZE STATUS SYNTAX
+syn keyword mibImplicit TEXTUAL-CONVENTION TRAP-TYPE TRUE UNITS VARIABLES
+syn keyword mibImplicit WRITE-SYNTAX ::=
+syn keyword mibValue accessible-for-notify current DisplayString
+syn keyword mibValue deprecated mandatory not-accessible obsolete optional
+syn keyword mibValue read-create read-only read-write write-only INTEGER
+syn keyword mibValue Counter Gauge IpAddress OCTET STRING experimental mib-2
+syn keyword mibValue TimeTicks RowStatus TruthValue UInteger32 snmpModules
+syn keyword mibValue Integer32 Counter32 TestAndIncr TimeStamp InstancePointer
+syn keyword mibValue OBJECT IDENTIFIER Gauge32 AutonomousType Counter64
+syn keyword mibValue PhysAddress TimeInterval MacAddress StorageType RowPointer
+syn keyword mibValue TDomain TAddress ifIndex
+
+" Epilogue SMI extensions
+syn keyword mibEpilogue FORCE-INCLUDE EXCLUDE cookie get-function set-function
+syn keyword mibEpilogue test-function get-function-async set-function-async
+syn keyword mibEpilogue test-function-async next-function next-function-async
+syn keyword mibEpilogue leaf-name
+syn keyword mibEpilogue DEFAULT contained
+
+syn match mibComment "\ *--.*$"
+syn match mibNumber "\<['0-9a-fA-FhH]*\>"
+syn region mibDescription start="\"" end="\"" contains=DEFAULT
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mib_syn_inits")
+ if version < 508
+ let did_mib_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mibImplicit Statement
+ HiLink mibComment Comment
+ HiLink mibConstants String
+ HiLink mibNumber Number
+ HiLink mibDescription Identifier
+ HiLink mibEpilogue SpecialChar
+ HiLink mibValue Structure
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mib"
+
+" vim: ts=8
diff --git a/runtime/syntax/mma.vim b/runtime/syntax/mma.vim
new file mode 100644
index 000000000..6eb8d66a9
--- /dev/null
+++ b/runtime/syntax/mma.vim
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language: Mathematica
+" Maintainer: Wolfgang Waltenberger <wwalten@ben.tuwien.ac.at>
+" Last Change: Thu 26 Apr 2001 13:20:03 CEST
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match mmaError "\*)"
+syn match mmaFixme "FIXME"
+syn region mmaComment start=+(\*+ end=+\*)+ skipempty contains=mmaFixme
+syn match mmaMessage "\a*::\a*"
+syn region mmaString start=+'+ end=+'+
+syn region mmaString start=+"+ end=+"+
+syn region mmaString start=+\\\"+ end=+\"+
+syn region mmaString start=+\"+ end=+\"+
+
+syn match mmaVariable "$\a*"
+
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Integer\|Real\|Pattern\|Symbol\)"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}\(Rational\|Complex\|Head\)"
+syn match mmaPattern "[A-Za-z01-9`]*_\{1,3}?[A-Za-z01-9`]*"
+
+" prefix/infix/postfix notations
+syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(\[\|@\)"he=e-1
+syn match mmaGenericFunction "[A-Za-z01-9`]*\s*\(/@\|@@\)"he=e-2
+syn match mmaGenericFunction "\~\s*[A-Za-z01-9`]*\s*\~"hs=s+1,he=e-1
+syn match mmaGenericFunction "//\s*[A-Za-z01-9`]*"hs=s+2
+syn match mmaOperator "/;"
+
+syn match mmaPureFunction "#\d*"
+syn match mmaPureFunction "&"
+
+syn match mmaUnicode "\\\[[a-zA-Z01-9]*\]"
+
+if version >= 508 || !exists("did_mma_syn_inits")
+ if version < 508
+ let did_mma_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mmaOperator Operator
+ HiLink mmaVariable Identifier
+ HiLink mmaString String
+ HiLink mmaUnicode String
+ HiLink mmaMessage Identifier
+ HiLink mmaPattern Identifier
+ HiLink mmaGenericFunction Function
+ HiLink mmaError Error
+ HiLink mmaFixme Error
+ HiLink mmaComment Comment
+ HiLink mmaPureFunction Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mma"
diff --git a/runtime/syntax/mmix.vim b/runtime/syntax/mmix.vim
new file mode 100644
index 000000000..5b6a44370
--- /dev/null
+++ b/runtime/syntax/mmix.vim
@@ -0,0 +1,162 @@
+" Vim syntax file
+" Language: MMIX
+" Maintainer: Dirk Hüsken, <huesken@informatik.uni-tuebingen.de>
+" Last Change: Wed Apr 24 01:18:52 CEST 2002
+" Filenames: *.mms
+" URL: http://homepages.uni-tuebingen.de/student/dirk.huesken/vim/syntax/mmix.vim
+
+" Limitations: Comments must start with either % or //
+" (preferrably %, Knuth-Style)
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" MMIX data types
+syn keyword mmixType byte wyde tetra octa
+
+" different literals...
+syn match decNumber "[0-9]*"
+syn match octNumber "0[0-7][0-7]\+"
+syn match hexNumber "#[0-9a-fA-F]\+"
+syn region mmixString start=+"+ skip=+\\"+ end=+"+
+syn match mmixChar "'.'"
+
+" ...and more special MMIX stuff
+syn match mmixAt "@"
+syn keyword mmixSegments Data_Segment Pool_Segment Stack_Segment
+
+syn match mmixIdentifier "[a-z_][a-z0-9_]*"
+
+" labels (for branches etc)
+syn match mmixLabel "^[a-z0-9_:][a-z0-9_]*"
+syn match mmixLabel "[0-9][HBF]"
+
+" pseudo-operations
+syn keyword mmixPseudo is loc greg
+
+" comments
+syn match mmixComment "%.*"
+syn match mmixComment "//.*"
+syn match mmixComment "^\*.*"
+
+
+syn keyword mmixOpcode trap fcmp fun feql fadd fix fsub fixu
+syn keyword mmixOpcode fmul fcmpe fune feqle fdiv fsqrt frem fint
+
+syn keyword mmixOpcode floti flotui sfloti sflotui i
+syn keyword mmixOpcode muli mului divi divui
+syn keyword mmixOpcode addi addui subi subui
+syn keyword mmixOpcode 2addui 4addui 8addui 16addui
+syn keyword mmixOpcode cmpi cmpui negi negui
+syn keyword mmixOpcode sli slui sri srui
+syn keyword mmixOpcode bnb bzb bpb bodb
+syn keyword mmixOpcode bnnb bnzb bnpb bevb
+syn keyword mmixOpcode pbnb pbzb pbpb pbodb
+syn keyword mmixOpcode pbnnb pbnzb pbnpb pbevb
+syn keyword mmixOpcode csni cszi cspi csodi
+syn keyword mmixOpcode csnni csnzi csnpi csevi
+syn keyword mmixOpcode zsni zszi zspi zsodi
+syn keyword mmixOpcode zsnni zsnzi zsnpi zsevi
+syn keyword mmixOpcode ldbi ldbui ldwi ldwui
+syn keyword mmixOpcode ldti ldtui ldoi ldoui
+syn keyword mmixOpcode ldsfi ldhti cswapi ldunci
+syn keyword mmixOpcode ldvtsi preldi pregoi goi
+syn keyword mmixOpcode stbi stbui stwi stwui
+syn keyword mmixOpcode stti sttui stoi stoui
+syn keyword mmixOpcode stsfi sthti stcoi stunci
+syn keyword mmixOpcode syncdi presti syncidi pushgoi
+syn keyword mmixOpcode ori orni nori xori
+syn keyword mmixOpcode andi andni nandi nxori
+syn keyword mmixOpcode bdifi wdifi tdifi odifi
+syn keyword mmixOpcode muxi saddi mori mxori
+syn keyword mmixOpcode muli mului divi divui
+
+syn keyword mmixOpcode flot flotu sflot sflotu
+syn keyword mmixOpcode mul mulu div divu
+syn keyword mmixOpcode add addu sub subu
+syn keyword mmixOpcode 2addu 4addu 8addu 16addu
+syn keyword mmixOpcode cmp cmpu neg negu
+syn keyword mmixOpcode sl slu sr sru
+syn keyword mmixOpcode bn bz bp bod
+syn keyword mmixOpcode bnn bnz bnp bev
+syn keyword mmixOpcode pbn pbz pbp pbod
+syn keyword mmixOpcode pbnn pbnz pbnp pbev
+syn keyword mmixOpcode csn csz csp csod
+syn keyword mmixOpcode csnn csnz csnp csev
+syn keyword mmixOpcode zsn zsz zsp zsod
+syn keyword mmixOpcode zsnn zsnz zsnp zsev
+syn keyword mmixOpcode ldb ldbu ldw ldwu
+syn keyword mmixOpcode ldt ldtu ldo ldou
+syn keyword mmixOpcode ldsf ldht cswap ldunc
+syn keyword mmixOpcode ldvts preld prego go
+syn keyword mmixOpcode stb stbu stw stwu
+syn keyword mmixOpcode stt sttu sto stou
+syn keyword mmixOpcode stsf stht stco stunc
+syn keyword mmixOpcode syncd prest syncid pushgo
+syn keyword mmixOpcode or orn nor xor
+syn keyword mmixOpcode and andn nand nxor
+syn keyword mmixOpcode bdif wdif tdif odif
+syn keyword mmixOpcode mux sadd mor mxor
+
+syn keyword mmixOpcode seth setmh setml setl inch incmh incml incl
+syn keyword mmixOpcode orh ormh orml orl andh andmh andml andnl
+syn keyword mmixOpcode jmp pushj geta put
+syn keyword mmixOpcode pop resume save unsave sync swym get trip
+syn keyword mmixOpcode set lda
+
+" switch back to being case sensitive
+syn case match
+
+" general-purpose and special-purpose registers
+syn match mmixRegister "$[0-9]*"
+syn match mmixRegister "r[A-Z]"
+syn keyword mmixRegister rBB rTT rWW rXX rYY rZZ
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mmix_syntax_inits")
+ if version < 508
+ let did_mmix_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink mmixAt Type
+ HiLink mmixPseudo Type
+ HiLink mmixRegister Special
+ HiLink mmixSegments Type
+
+ HiLink mmixLabel Special
+ HiLink mmixComment Comment
+ HiLink mmixOpcode Keyword
+
+ HiLink hexNumber Number
+ HiLink decNumber Number
+ HiLink octNumber Number
+
+ HiLink mmixString String
+ HiLink mmixChar String
+
+ HiLink mmixType Type
+ HiLink mmixIdentifier Normal
+ HiLink mmixSpecialComment Comment
+
+ " My default color overrides:
+ " hi mmixSpecialComment ctermfg=red
+ "hi mmixLabel ctermfg=lightcyan
+ " hi mmixType ctermbg=black ctermfg=brown
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mmix"
+
+" vim: ts=8
diff --git a/runtime/syntax/modconf.vim b/runtime/syntax/modconf.vim
new file mode 100644
index 000000000..569e13449
--- /dev/null
+++ b/runtime/syntax/modconf.vim
@@ -0,0 +1,66 @@
+" Vim syntax file
+" Language: Linux modutils modules.conf File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/modconf/
+" Latest Revision: 2004-05-22
+" arch-tag: b7981bdb-daa3-41d1-94b5-a3d60b627916
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" comments
+syn region modconfComment start="#" skip="\\$" end="$" contains=modconfTodo
+
+" todo
+syn keyword modconfTodo FIXME TODO XXX NOTE
+
+" keywords and similar
+syn match modconfBegin "^" skipwhite nextgroup=modconfCommand,modconfComment
+
+syn match modconfCommand "\(add\s\+\)\=(above\|below\|probe\|probeall\}"
+syn region modconfCommand transparent matchgroup=modconfCommand start="\(add\s\+\)\=options" skip="\\$" end="$" contains=modconfModOpt
+syn keyword modconfCommand define remove keep install insmod_opt else endif
+syn keyword modconfCommand nextgroup=modconfPath skipwhite alias depfile generic_stringfile pcimapfile include isapnpmapfile usbmapfile parportmapfile ieee1394mapfile pnpbiosmapfile persistdir prune
+syn match modconfCommand "path\(\[\w\+\]\)\=" nextgroup=modconfPath skipwhite
+syn region modconfCommand transparent matchgroup=modconfCommand start="^\s*\(if\|elseif\)" skip="\\$" end="$" contains=modconfOp
+syn region modconfCommand transparent matchgroup=modconfCommand start="^\s*\(post\|pre\)-\(install\|remove\)" skip="\\$" end="$"
+
+
+" expressions and similay
+syn match modconfOp contained "\s-[fnk]\>"
+syn region modconfPath contained start="\(=\@=\)\=/" skip="\\$" end="\\\@!\_s"
+syn match modconfModOpt contained "\<\w\+=\@="
+
+if exists("modconf_minlines")
+ let b:modconf_minlines = modconf_minlines
+else
+ let b:modconf_minlines = 50
+endif
+exec "syn sync minlines=" . b:modconf_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_modconf_syn_inits")
+ if version < 508
+ let did_modconf_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink modconfComment Comment
+ HiLink modconfTodo Todo
+ HiLink modconfCommand Keyword
+ HiLink modconfPath String
+ HiLink modconfOp Identifier
+ HiLink modconfModOpt Identifier
+ delcommand HiLink
+endif
+
+let b:current_syntax = "modconf"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/model.vim b/runtime/syntax/model.vim
new file mode 100644
index 000000000..91b678131
--- /dev/null
+++ b/runtime/syntax/model.vim
@@ -0,0 +1,59 @@
+" Vim syntax file
+" Language: Model
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Apr 25
+
+" very basic things only (based on the vgrindefs file).
+" If you use this language, please improve it, and send me the patches!
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of keywords
+syn keyword modelKeyword abs and array boolean by case cdnl char copied dispose
+syn keyword modelKeyword div do dynamic else elsif end entry external FALSE false
+syn keyword modelKeyword fi file for formal fortran global if iff ift in integer include
+syn keyword modelKeyword inline is lbnd max min mod new NIL nil noresult not notin od of
+syn keyword modelKeyword or procedure public read readln readonly record recursive rem rep
+syn keyword modelKeyword repeat res result return set space string subscript such then TRUE
+syn keyword modelKeyword true type ubnd union until varies while width
+
+" Special keywords
+syn keyword modelBlock beginproc endproc
+
+" Comments
+syn region modelComment start="\$" end="\$" end="$"
+
+" Strings
+syn region modelString start=+"+ end=+"+
+
+" Character constant (is this right?)
+syn match modelString "'."
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_model_syntax_inits")
+ if version < 508
+ let did_model_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink modelKeyword Statement
+ HiLink modelBlock PreProc
+ HiLink modelComment Comment
+ HiLink modelString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "model"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/modsim3.vim b/runtime/syntax/modsim3.vim
new file mode 100644
index 000000000..04e9ab9ab
--- /dev/null
+++ b/runtime/syntax/modsim3.vim
@@ -0,0 +1,109 @@
+" Vim syntax file
+" Language: Modsim III, by compuware corporation (www.compuware.com)
+" Maintainer: Philipp Jocham <flip@sbox.tu-graz.ac.at>
+" Extension: *.mod
+" Last Change: 2001 May 10
+"
+" 2001 March 24:
+" - Modsim III is a registered trademark from compuware corporation
+" - made compatible with Vim 6.0
+"
+" 1999 Apr 22 : Changed modsim3Literal from region to match
+"
+" very basic things only (based on the modula2 and c files).
+
+if version < 600
+ " Remove any old syntax stuff hanging around
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" syn case match " case sensitiv match is default
+
+" A bunch of keywords
+syn keyword modsim3Keyword ACTID ALL AND AS ASK
+syn keyword modsim3Keyword BY CALL CASE CLASS CONST DIV
+syn keyword modsim3Keyword DOWNTO DURATION ELSE ELSIF EXIT FALSE FIXED FOR
+syn keyword modsim3Keyword FOREACH FORWARD IF IN INHERITED INOUT
+syn keyword modsim3Keyword INTERRUPT LOOP
+syn keyword modsim3Keyword MOD MONITOR NEWVALUE
+syn keyword modsim3Keyword NONMODSIM NOT OBJECT OF ON OR ORIGINAL OTHERWISE OUT
+syn keyword modsim3Keyword OVERRIDE PRIVATE PROTO REPEAT
+syn keyword modsim3Keyword RETURN REVERSED SELF STRERR TELL
+syn keyword modsim3Keyword TERMINATE THISMETHOD TO TRUE TYPE UNTIL VALUE VAR
+syn keyword modsim3Keyword WAIT WAITFOR WHEN WHILE WITH
+
+" Builtin functions and procedures
+syn keyword modsim3Builtin ABS ACTIVATE ADDMONITOR CAP CHARTOSTR CHR CLONE
+syn keyword modsim3Builtin DEACTIVATE DEC DISPOSE FLOAT GETMONITOR HIGH INC
+syn keyword modsim3Builtin INPUT INSERT INTTOSTR ISANCESTOR LOW LOWER MAX MAXOF
+syn keyword modsim3Builtin MIN MINOF NEW OBJTYPEID OBJTYPENAME OBJVARID ODD
+syn keyword modsim3Builtin ONERROR ONEXIT ORD OUTPUT POSITION PRINT REALTOSTR
+syn keyword modsim3Builtin REPLACE REMOVEMONITOR ROUND SCHAR SIZEOF SPRINT
+syn keyword modsim3Builtin STRLEN STRTOCHAR STRTOINT STRTOREAL SUBSTR TRUNC
+syn keyword modsim3Builtin UPDATEVALUE UPPER VAL
+
+syn keyword modsim3BuiltinNoParen HALT TRACE
+
+" Special keywords
+syn keyword modsim3Block PROCEDURE METHOD MODULE MAIN DEFINITION IMPLEMENTATION
+syn keyword modsim3Block BEGIN END
+
+syn keyword modsim3Include IMPORT FROM
+
+syn keyword modsim3Type ANYARRAY ANYOBJ ANYREC ARRAY BOOLEAN CHAR INTEGER
+syn keyword modsim3Type LMONITORED LRMONITORED NILARRAY NILOBJ NILREC REAL
+syn keyword modsim3Type RECORD RMONITOR RMONITORED STRING
+
+" catch errros cause by wrong parenthesis
+" slight problem with "( *)" or "(* )". Hints?
+syn region modsim3Paren transparent start='(' end=')' contains=ALLBUT,modsim3ParenError
+syn match modsim3ParenError ")"
+
+" Comments
+syn region modsim3Comment1 start="{" end="}" contains=modsim3Comment1,modsim3Comment2
+syn region modsim3Comment2 start="(\*" end="\*)" contains=modsim3Comment1,modsim3Comment2
+" highlighting is wrong for constructs like "{ (* } *)",
+" which are allowed in Modsim III, but
+" I think something like that shouldn't be used anyway.
+
+" Strings
+syn region modsim3String start=+"+ end=+"+
+
+" Literals
+"syn region modsim3Literal start=+'+ end=+'+
+syn match modsim3Literal "'[^']'\|''''"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_modsim3_syntax_inits")
+ if version < 508
+ let did_modsim3_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink modsim3Keyword Statement
+ HiLink modsim3Block Statement
+ HiLink modsim3Comment1 Comment
+ HiLink modsim3Comment2 Comment
+ HiLink modsim3String String
+ HiLink modsim3Literal Character
+ HiLink modsim3Include Statement
+ HiLink modsim3Type Type
+ HiLink modsim3ParenError Error
+ HiLink modsim3Builtin Function
+ HiLink modsim3BuiltinNoParen Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "modsim3"
+
+" vim: ts=8 sw=2
+
diff --git a/runtime/syntax/modula2.vim b/runtime/syntax/modula2.vim
new file mode 100644
index 000000000..3018900e8
--- /dev/null
+++ b/runtime/syntax/modula2.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" Language: Modula 2
+" Maintainer: pf@artcom0.north.de (Peter Funk)
+" based on original work of Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Don't ignore case (Modula-2 is case significant). This is the default in vim
+
+" Especially emphasize headers of procedures and modules:
+syn region modula2Header matchgroup=modula2Header start="PROCEDURE " end="(" contains=modula2Ident oneline
+syn region modula2Header matchgroup=modula2Header start="MODULE " end=";" contains=modula2Ident oneline
+syn region modula2Header matchgroup=modula2Header start="BEGIN (\*" end="\*)" contains=modula2Ident oneline
+syn region modula2Header matchgroup=modula2Header start="END " end=";" contains=modula2Ident oneline
+syn region modula2Keyword start="END" end=";" contains=ALLBUT,modula2Ident oneline
+
+" Some very important keywords which should be emphasized more than others:
+syn keyword modula2AttKeyword CONST EXIT HALT RETURN TYPE VAR
+" All other keywords in alphabetical order:
+syn keyword modula2Keyword AND ARRAY BY CASE DEFINITION DIV DO ELSE
+syn keyword modula2Keyword ELSIF EXPORT FOR FROM IF IMPLEMENTATION IMPORT
+syn keyword modula2Keyword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD
+syn keyword modula2Keyword SET THEN TO UNTIL WHILE WITH
+
+syn keyword modula2Type ADDRESS BITSET BOOLEAN CARDINAL CHAR INTEGER REAL WORD
+syn keyword modula2StdFunc ABS CAP CHR DEC EXCL INC INCL ORD SIZE TSIZE VAL
+syn keyword modula2StdConst FALSE NIL TRUE
+" The following may be discussed, since NEW and DISPOSE are some kind of
+" special builtin macro functions:
+syn keyword modula2StdFunc NEW DISPOSE
+" The following types are added later on and may be missing from older
+" Modula-2 Compilers (they are at least missing from the original report
+" by N.Wirth from March 1980 ;-) Highlighting should apply nevertheless:
+syn keyword modula2Type BYTE LONGCARD LONGINT LONGREAL PROC SHORTCARD SHORTINT
+" same note applies to min and max, which were also added later to m2:
+syn keyword modula2StdFunc MAX MIN
+" The underscore was originally disallowed in m2 ids, it was also added later:
+syn match modula2Ident " [A-Z,a-z][A-Z,a-z,0-9,_]*" contained
+
+" Comments may be nested in Modula-2:
+syn region modula2Comment start="(\*" end="\*)" contains=modula2Comment,modula2Todo
+syn keyword modula2Todo contained TODO FIXME XXX
+
+" Strings
+syn region modula2String start=+"+ end=+"+
+syn region modula2String start="'" end="'"
+syn region modula2Set start="{" end="}"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_modula2_syntax_inits")
+ if version < 508
+ let did_modula2_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink modula2Ident Identifier
+ HiLink modula2StdConst Boolean
+ HiLink modula2Type Identifier
+ HiLink modula2StdFunc Identifier
+ HiLink modula2Header Type
+ HiLink modula2Keyword Statement
+ HiLink modula2AttKeyword PreProc
+ HiLink modula2Comment Comment
+ " The following is just a matter of taste (you want to try this instead):
+ " hi modula2Comment term=bold ctermfg=DarkBlue guifg=Blue gui=bold
+ HiLink modula2Todo Todo
+ HiLink modula2String String
+ HiLink modula2Set String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "modula2"
+
+" vim: ts=8
diff --git a/runtime/syntax/modula3.vim b/runtime/syntax/modula3.vim
new file mode 100644
index 000000000..d6f72afbc
--- /dev/null
+++ b/runtime/syntax/modula3.vim
@@ -0,0 +1,72 @@
+" Vim syntax file
+" Language: Modula-3
+" Maintainer: Timo Pedersen <dat97tpe@ludat.lth.se>
+" Last Change: 2001 May 10
+
+" Basic things only...
+" Based on the modula 2 syntax file
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Modula-3 is case-sensitive
+" syn case ignore
+
+" Modula-3 keywords
+syn keyword modula3Keyword ABS ADDRES ADR ADRSIZE AND ANY
+syn keyword modula3Keyword ARRAY AS BITS BITSIZE BOOLEAN BRANDED BY BYTESIZE
+syn keyword modula3Keyword CARDINAL CASE CEILING CHAR CONST DEC DEFINITION
+syn keyword modula3Keyword DISPOSE DIV
+syn keyword modula3Keyword EVAL EXIT EXCEPT EXCEPTION
+syn keyword modula3Keyword EXIT EXPORTS EXTENDED FALSE FINALLY FIRST FLOAT
+syn keyword modula3Keyword FLOOR FROM GENERIC IMPORT
+syn keyword modula3Keyword IN INC INTEGER ISTYPE LAST LOCK
+syn keyword modula3Keyword LONGREAL LOOPHOLE MAX METHOD MIN MOD MUTEX
+syn keyword modula3Keyword NARROW NEW NIL NOT NULL NUMBER OF OR ORD RAISE
+syn keyword modula3Keyword RAISES READONLY REAL RECORD REF REFANY
+syn keyword modula3Keyword RETURN ROOT
+syn keyword modula3Keyword ROUND SET SUBARRAY TEXT TRUE TRUNC TRY TYPE
+syn keyword modula3Keyword TYPECASE TYPECODE UNSAFE UNTRACED VAL VALUE VAR WITH
+
+" Special keywords, block delimiters etc
+syn keyword modula3Block PROCEDURE FUNCTION MODULE INTERFACE REPEAT THEN
+syn keyword modula3Block BEGIN END OBJECT METHODS OVERRIDES RECORD REVEAL
+syn keyword modula3Block WHILE UNTIL DO TO IF FOR ELSIF ELSE LOOP
+
+" Comments
+syn region modula3Comment start="(\*" end="\*)"
+
+" Strings
+syn region modula3String start=+"+ end=+"+
+syn region modula3String start=+'+ end=+'+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_modula3_syntax_inits")
+ if version < 508
+ let did_modula3_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink modula3Keyword Statement
+ HiLink modula3Block PreProc
+ HiLink modula3Comment Comment
+ HiLink modula3String String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "modula3"
+
+"I prefer to use this...
+"set ai
+"vim: ts=8
diff --git a/runtime/syntax/monk.vim b/runtime/syntax/monk.vim
new file mode 100644
index 000000000..560b79c67
--- /dev/null
+++ b/runtime/syntax/monk.vim
@@ -0,0 +1,228 @@
+" Vim syntax file
+" Language: Monk (See-Beyond Technologies)
+" Maintainer: Mike Litherland <litherm@ccf.org>
+" Last Change: March 6, 2002
+
+" This syntax file is good enough for my needs, but others
+" may desire more features. Suggestions and bug reports
+" are solicited by the author (above).
+
+" Originally based on the Scheme syntax file by:
+
+" Maintainer: Dirk van Deun <dvandeun@poboxes.com>
+" Last Change: April 30, 1998
+
+" In fact it's almost identical. :)
+
+" The original author's notes:
+" This script incorrectly recognizes some junk input as numerals:
+" parsing the complete system of Scheme numerals using the pattern
+" language is practically impossible: I did a lax approximation.
+
+" Initializing:
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Fascist highlighting: everything that doesn't fit the rules is an error...
+
+syn match monkError oneline ![^ \t()";]*!
+syn match monkError oneline ")"
+
+" Quoted and backquoted stuff
+
+syn region monkQuoted matchgroup=Delimiter start="['`]" end=![ \t()";]!me=e-1 contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+syn region monkQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+syn region monkQuoted matchgroup=Delimiter start="['`]#(" matchgroup=Delimiter end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+syn region monkStrucRestricted matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+syn region monkStrucRestricted matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+syn region monkUnquote matchgroup=Delimiter start="," end=![ \t()";]!me=e-1 contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+syn region monkUnquote matchgroup=Delimiter start=",@" end=![ \t()";]!me=e-1 contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+syn region monkUnquote matchgroup=Delimiter start=",(" end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+syn region monkUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+syn region monkUnquote matchgroup=Delimiter start=",#(" end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+syn region monkUnquote matchgroup=Delimiter start=",@#(" end=")" contains=ALLBUT,monkStruc,monkSyntax,monkFunc
+
+" R5RS Scheme Functions and Syntax:
+
+if version < 600
+ set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
+else
+ setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
+endif
+
+syn keyword monkSyntax lambda and or if cond case define let let* letrec
+syn keyword monkSyntax begin do delay set! else =>
+syn keyword monkSyntax quote quasiquote unquote unquote-splicing
+syn keyword monkSyntax define-syntax let-syntax letrec-syntax syntax-rules
+
+syn keyword monkFunc not boolean? eq? eqv? equal? pair? cons car cdr set-car!
+syn keyword monkFunc set-cdr! caar cadr cdar cddr caaar caadr cadar caddr
+syn keyword monkFunc cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr
+syn keyword monkFunc cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr
+syn keyword monkFunc cddaar cddadr cdddar cddddr null? list? list length
+syn keyword monkFunc append reverse list-ref memq memv member assq assv assoc
+syn keyword monkFunc symbol? symbol->string string->symbol number? complex?
+syn keyword monkFunc real? rational? integer? exact? inexact? = < > <= >=
+syn keyword monkFunc zero? positive? negative? odd? even? max min + * - / abs
+syn keyword monkFunc quotient remainder modulo gcd lcm numerator denominator
+syn keyword monkFunc floor ceiling truncate round rationalize exp log sin cos
+syn keyword monkFunc tan asin acos atan sqrt expt make-rectangular make-polar
+syn keyword monkFunc real-part imag-part magnitude angle exact->inexact
+syn keyword monkFunc inexact->exact number->string string->number char=?
+syn keyword monkFunc char-ci=? char<? char-ci<? char>? char-ci>? char<=?
+syn keyword monkFunc char-ci<=? char>=? char-ci>=? char-alphabetic? char?
+syn keyword monkFunc char-numeric? char-whitespace? char-upper-case?
+syn keyword monkFunc char-lower-case?
+syn keyword monkFunc char->integer integer->char char-upcase char-downcase
+syn keyword monkFunc string? make-string string string-length string-ref
+syn keyword monkFunc string-set! string=? string-ci=? string<? string-ci<?
+syn keyword monkFunc string>? string-ci>? string<=? string-ci<=? string>=?
+syn keyword monkFunc string-ci>=? substring string-append vector? make-vector
+syn keyword monkFunc vector vector-length vector-ref vector-set! procedure?
+syn keyword monkFunc apply map for-each call-with-current-continuation
+syn keyword monkFunc call-with-input-file call-with-output-file input-port?
+syn keyword monkFunc output-port? current-input-port current-output-port
+syn keyword monkFunc open-input-file open-output-file close-input-port
+syn keyword monkFunc close-output-port eof-object? read read-char peek-char
+syn keyword monkFunc write display newline write-char call/cc
+syn keyword monkFunc list-tail string->list list->string string-copy
+syn keyword monkFunc string-fill! vector->list list->vector vector-fill!
+syn keyword monkFunc force with-input-from-file with-output-to-file
+syn keyword monkFunc char-ready? load transcript-on transcript-off eval
+syn keyword monkFunc dynamic-wind port? values call-with-values
+syn keyword monkFunc monk-report-environment null-environment
+syn keyword monkFunc interaction-environment
+
+" Keywords specific to STC's implementation
+
+syn keyword monkFunc $event-clear $event-parse $event->string $make-event-map
+syn keyword monkFunc $resolve-event-definition change-pattern copy copy-strip
+syn keyword monkFunc count-data-children count-map-children count-rep data-map
+syn keyword monkFunc duplicate duplicate-strip file-check file-lookup get
+syn keyword monkFunc insert list-lookup node-has-data? not-verify path?
+syn keyword monkFunc path-defined-as-repeating? path-nodeclear path-nodedepth
+syn keyword monkFunc path-nodename path-nodeparentname path->string path-valid?
+syn keyword monkFunc regex string->path timestamp uniqueid verify
+
+" Keywords from the Monk function library (from e*Gate 4.1 programmers ref)
+syn keyword monkFunc allcap? capitalize char-punctuation? char-substitute
+syn keyword monkFunc char-to-char conv count-used-children degc->degf
+syn keyword monkFunc diff-two-dates display-error empty-string? fail_id
+syn keyword monkFunc fail_id_if fail_translation fail_translation_if
+syn keyword monkFunc find-get-after find-get-before get-timestamp julian-date?
+syn keyword monkFunc julian->standard leap-year? map-string not-empty-string?
+syn keyword monkFunc standard-date? standard->julian string-begins-with?
+syn keyword monkFunc string-contains? string-ends-with? string-search-from-left
+syn keyword monkFunc string-search-from-right string->ssn strip-punct
+syn keyword monkFunc strip-string substring=? symbol-table-get symbol-table-put
+syn keyword monkFunc trim-string-left trim-string-right valid-decimal?
+syn keyword monkFunc valid-integer? verify-type
+
+" Writing out the complete description of Scheme numerals without
+" using variables is a day's work for a trained secretary...
+" This is a useful lax approximation:
+
+syn match monkNumber oneline "[-#+0-9.][-#+/0-9a-f@i.boxesfdl]*"
+syn match monkError oneline ![-#+0-9.][-#+/0-9a-f@i.boxesfdl]*[^-#+/0-9a-f@i.boxesfdl \t()";][^ \t()";]*!
+
+syn match monkOther oneline ![+-][ \t()";]!me=e-1
+syn match monkOther oneline ![+-]$!
+" ... so that a single + or -, inside a quoted context, would not be
+" interpreted as a number (outside such contexts, it's a monkFunc)
+
+syn match monkDelimiter oneline !\.[ \t()";]!me=e-1
+syn match monkDelimiter oneline !\.$!
+" ... and a single dot is not a number but a delimiter
+
+" Simple literals:
+
+syn match monkBoolean oneline "#[tf]"
+syn match monkError oneline !#[tf][^ \t()";]\+!
+
+syn match monkChar oneline "#\\"
+syn match monkChar oneline "#\\."
+syn match monkError oneline !#\\.[^ \t()";]\+!
+syn match monkChar oneline "#\\space"
+syn match monkError oneline !#\\space[^ \t()";]\+!
+syn match monkChar oneline "#\\newline"
+syn match monkError oneline !#\\newline[^ \t()";]\+!
+
+" This keeps all other stuff unhighlighted, except *stuff* and <stuff>:
+
+syn match monkOther oneline ,[a-z!$%&*/:<=>?^_~][-a-z!$%&*/:<=>?^_~0-9+.@]*,
+syn match monkError oneline ,[a-z!$%&*/:<=>?^_~][-a-z!$%&*/:<=>?^_~0-9+.@]*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+syn match monkOther oneline "\.\.\."
+syn match monkError oneline !\.\.\.[^ \t()";]\+!
+" ... a special identifier
+
+syn match monkConstant oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[ \t()";],me=e-1
+syn match monkConstant oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*$,
+syn match monkError oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+syn match monkConstant oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[ \t()";],me=e-1
+syn match monkConstant oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>$,
+syn match monkError oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+" Monk input and output structures
+syn match monkSyntax oneline "\(\~input\|\[I\]->\)[^ \t]*"
+syn match monkFunc oneline "\(\~output\|\[O\]->\)[^ \t]*"
+
+" Non-quoted lists, and strings:
+
+syn region monkStruc matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALL
+syn region monkStruc matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALL
+
+syn region monkString start=+"+ skip=+\\[\\"]+ end=+"+
+
+" Comments:
+
+syn match monkComment ";.*$"
+
+" Synchronization and the wrapping up...
+
+syn sync match matchPlace grouphere NONE "^[^ \t]"
+" ... i.e. synchronize on a line that starts at the left margin
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_monk_syntax_inits")
+ if version < 508
+ let did_monk_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink monkSyntax Statement
+ HiLink monkFunc Function
+
+ HiLink monkString String
+ HiLink monkChar Character
+ HiLink monkNumber Number
+ HiLink monkBoolean Boolean
+
+ HiLink monkDelimiter Delimiter
+ HiLink monkConstant Constant
+
+ HiLink monkComment Comment
+ HiLink monkError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "monk"
diff --git a/runtime/syntax/moo.vim b/runtime/syntax/moo.vim
new file mode 100644
index 000000000..10c5d3b4b
--- /dev/null
+++ b/runtime/syntax/moo.vim
@@ -0,0 +1,173 @@
+" Vim syntax file
+" Language: MOO
+" Maintainer: Timo Frenay <timo@frenay.net>
+" Last Change: 2001 Oct 06
+" Note: Requires Vim 6.0 or above
+
+" Quit when a syntax file was already loaded
+if version < 600 || exists("b:current_syntax")
+ finish
+endif
+
+" Initializations
+syn case ignore
+
+" C-style comments
+syn match mooUncommentedError display ~\*/~
+syn match mooCStyleCommentError display ~/\ze\*~ contained
+syn region mooCStyleComment matchgroup=mooComment start=~/\*~ end=~\*/~ contains=mooCStyleCommentError
+
+" Statements
+if exists("moo_extended_cstyle_comments")
+ syn match mooIdentifier display ~\%(\%(/\*.\{-}\*/\s*\)*\)\@>\<\h\w*\>~ contained transparent contains=mooCStyleComment,@mooKeyword,mooType,mooVariable
+else
+ syn match mooIdentifier display ~\<\h\w*\>~ contained transparent contains=@mooKeyword,mooType,mooVariable
+endif
+syn keyword mooStatement break continue else elseif endfor endfork endif endtry endwhile finally for if try
+syn keyword mooStatement except fork while nextgroup=mooIdentifier skipwhite
+syn keyword mooStatement return nextgroup=mooString skipwhite
+
+" Operators
+syn keyword mooOperatorIn in
+
+" Error constants
+syn keyword mooAny ANY
+syn keyword mooErrorConstant E_ARGS E_INVARG E_DIV E_FLOAT E_INVIND E_MAXREC E_NACC E_NONE E_PERM E_PROPNF E_QUOTA E_RANGE E_RECMOVE E_TYPE E_VARNF E_VERBNF
+
+" Builtin variables
+syn match mooType display ~\<\%(ERR\|FLOAT\|INT\|LIST\|NUM\|OBJ\|STR\)\>~
+syn match mooVariable display ~\<\%(args\%(tr\)\=\|caller\|dobj\%(str\)\=\|iobj\%(str\)\=\|player\|prepstr\|this\|verb\)\>~
+
+" Strings
+syn match mooStringError display ~[^\t -[\]-~]~ contained
+syn match mooStringSpecialChar display ~\\["\\]~ contained
+if !exists("moo_no_regexp")
+ " Regular expressions
+ syn match mooRegexp display ~%%~ contained containedin=mooString,mooRegexpParentheses transparent contains=NONE
+ syn region mooRegexpParentheses display matchgroup=mooRegexpOr start=~%(~ skip=~%%~ end=~%)~ contained containedin=mooString,mooRegexpParentheses transparent oneline
+ syn match mooRegexpOr display ~%|~ contained containedin=mooString,mooRegexpParentheses
+endif
+if !exists("moo_no_pronoun_sub")
+ " Pronoun substitutions
+ syn match mooPronounSub display ~%%~ contained containedin=mooString transparent contains=NONE
+ syn match mooPronounSub display ~%[#dilnopqrst]~ contained containedin=mooString
+ syn match mooPronounSub display ~%\[#[dilnt]\]~ contained containedin=mooString
+ syn match mooPronounSub display ~%(\h\w*)~ contained containedin=mooString
+ syn match mooPronounSub display ~%\[[dilnt]\h\w*\]~ contained containedin=mooString
+ syn match mooPronounSub display ~%<\%([dilnt]:\)\=\a\+>~ contained containedin=mooString
+endif
+if exists("moo_unmatched_quotes")
+ syn region mooString matchgroup=mooStringError start=~"~ end=~$~ contains=@mooStringContents keepend
+ syn region mooString start=~"~ skip=~\\.~ end=~"~ contains=@mooStringContents oneline keepend
+else
+ syn region mooString start=~"~ skip=~\\.~ end=~"\|$~ contains=@mooStringContents keepend
+endif
+
+" Numbers and object numbers
+syn match mooNumber display ~\%(\%(\<\d\+\)\=\.\d\+\|\<\d\+\)\%(e[+\-]\=\d\+\)\=\>~
+syn match mooObject display ~#-\=\d\+\>~
+
+" Properties and verbs
+if exists("moo_builtin_properties")
+ "Builtin properties
+ syn keyword mooBuiltinProperty contents f location name owner programmer r w wizard contained containedin=mooPropRef
+endif
+if exists("moo_extended_cstyle_comments")
+ syn match mooPropRef display ~\.\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\h\w*\>~ transparent contains=mooCStyleComment,@mooKeyword
+ syn match mooVerbRef display ~:\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\h\w*\>~ transparent contains=mooCStyleComment,@mooKeyword
+else
+ syn match mooPropRef display ~\.\s*\h\w*\>~ transparent contains=@mooKeyword
+ syn match mooVerbRef display ~:\s*\h\w*\>~ transparent contains=@mooKeyword
+endif
+
+" Builtin functions, core properties and core verbs
+if exists("moo_extended_cstyle_comments")
+ syn match mooBuiltinFunction display ~\<\h\w*\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\ze(~ contains=mooCStyleComment
+ syn match mooCorePropOrVerb display ~\$\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>\%(in\>\)\@!\h\w*\>~ contains=mooCStyleComment,@mooKeyword
+else
+ syn match mooBuiltinFunction display ~\<\h\w*\s*\ze(~ contains=NONE
+ syn match mooCorePropOrVerb display ~\$\s*\%(in\>\)\@!\h\w*\>~ contains=@mooKeyword
+endif
+if exists("moo_unknown_builtin_functions")
+ syn match mooUnknownBuiltinFunction ~\<\h\w*\>~ contained containedin=mooBuiltinFunction contains=mooKnownBuiltinFunction
+ " Known builtin functions as of version 1.8.1 of the server
+ " Add your own extensions to this group if you like
+ syn keyword mooKnownBuiltinFunction abs acos add_property add_verb asin atan binary_hash boot_player buffered_output_length callers caller_perms call_function ceil children chparent clear_property connected_players connected_seconds connection_name connection_option connection_options cos cosh create crypt ctime db_disk_size decode_binary delete_property delete_verb disassemble dump_database encode_binary equal eval exp floatstr floor flush_input force_input function_info idle_seconds index is_clear_property is_member is_player kill_task length listappend listdelete listen listeners listinsert listset log log10 match max max_object memory_usage min move notify object_bytes open_network_connection output_delimiters parent pass players properties property_info queued_tasks queue_info raise random read recycle renumber reset_max_object resume rindex rmatch seconds_left server_log server_version setadd setremove set_connection_option set_player_flag set_property_info set_task_perms set_verb_args set_verb_code set_verb_info shutdown sin sinh sqrt strcmp string_hash strsub substitute suspend tan tanh task_id task_stack ticks_left time tofloat toint toliteral tonum toobj tostr trunc typeof unlisten valid value_bytes value_hash verbs verb_args verb_code verb_info contained
+endif
+
+" Enclosed expressions
+syn match mooUnenclosedError display ~[')\]|}]~
+syn match mooParenthesesError display ~[';\]|}]~ contained
+syn region mooParentheses start=~(~ end=~)~ transparent contains=@mooEnclosedContents,mooParenthesesError
+syn match mooBracketsError display ~[');|}]~ contained
+syn region mooBrackets start=~\[~ end=~\]~ transparent contains=@mooEnclosedContents,mooBracketsError
+syn match mooBracesError display ~[');\]|]~ contained
+syn region mooBraces start=~{~ end=~}~ transparent contains=@mooEnclosedContents,mooBracesError
+syn match mooQuestionError display ~[');\]}]~ contained
+syn region mooQuestion start=~?~ end=~|~ transparent contains=@mooEnclosedContents,mooQuestionError
+syn match mooCatchError display ~[);\]|}]~ contained
+syn region mooCatch matchgroup=mooExclamation start=~`~ end=~'~ transparent contains=@mooEnclosedContents,mooCatchError,mooExclamation
+if exists("moo_extended_cstyle_comments")
+ syn match mooExclamation display ~[\t !%&(*+,\-/<=>?@[^`{|]\@<!\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>!=\@!~ contained contains=mooCStyleComment
+else
+ syn match mooExclamation display ~[\t !%&(*+,\-/<=>?@[^`{|]\@<!\s*!=\@!~ contained
+endif
+
+" Comments
+syn match mooCommentSpecialChar display ~\\["\\]~ contained transparent contains=NONE
+syn match mooComment ~[\t !%&*+,\-/<=>?@^|]\@<!\s*"\([^\"]\|\\.\)*"\s*;~ contains=mooStringError,mooCommentSpecialChar
+
+" Non-code
+syn region mooNonCode start=~^\s*@\<~ end=~$~
+syn match mooNonCode display ~^\.$~
+syn match mooNonCode display ~^\s*\d\+:~he=e-1
+
+" Overriding matches
+syn match mooRangeOperator display ~\.\.~ transparent contains=NONE
+syn match mooOrOperator display ~||~ transparent contains=NONE
+if exists("moo_extended_cstyle_comments")
+ syn match mooScattering ~[,{]\@<=\s*\%(\%(/\*.\{-}\*/\s*\)*\)\@>?~ transparent contains=mooCStyleComment
+else
+ syn match mooScattering ~[,{]\@<=\s*?~ transparent contains=NONE
+endif
+
+" Clusters
+syn cluster mooKeyword contains=mooStatement,mooOperatorIn,mooAny,mooErrorConstant
+syn cluster mooStringContents contains=mooStringError,mooStringSpecialChar
+syn cluster mooEnclosedContents contains=TOP,mooUnenclosedError,mooComment,mooNonCode
+
+" Define the default highlighting.
+hi def link mooUncommentedError Error
+hi def link mooCStyleCommentError Error
+hi def link mooCStyleComment Comment
+hi def link mooStatement Statement
+hi def link mooOperatorIn Operator
+hi def link mooAny Constant " link this to Keyword if you want
+hi def link mooErrorConstant Constant
+hi def link mooType Type
+hi def link mooVariable Type
+hi def link mooStringError Error
+hi def link mooStringSpecialChar SpecialChar
+hi def link mooRegexpOr SpecialChar
+hi def link mooPronounSub SpecialChar
+hi def link mooString String
+hi def link mooNumber Number
+hi def link mooObject Number
+hi def link mooBuiltinProperty Type
+hi def link mooBuiltinFunction Function
+hi def link mooUnknownBuiltinFunction Error
+hi def link mooKnownBuiltinFunction Function
+hi def link mooCorePropOrVerb Identifier
+hi def link mooUnenclosedError Error
+hi def link mooParenthesesError Error
+hi def link mooBracketsError Error
+hi def link mooBracesError Error
+hi def link mooQuestionError Error
+hi def link mooCatchError Error
+hi def link mooExclamation Exception
+hi def link mooComment Comment
+hi def link mooNonCode PreProc
+
+let b:current_syntax = "moo"
+
+" vim: ts=8
diff --git a/runtime/syntax/mp.vim b/runtime/syntax/mp.vim
new file mode 100644
index 000000000..c0fd60b3d
--- /dev/null
+++ b/runtime/syntax/mp.vim
@@ -0,0 +1,132 @@
+" Vim syntax file
+" Language: MetaPost
+" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
+" Last Change: April 30, 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+let plain_mf_macros = 0 " plain.mf has no special meaning for MetaPost
+let other_mf_macros = 0 " cmbase.mf, logo.mf, ... neither
+
+" Read the Metafont syntax to start with
+if version < 600
+ source <sfile>:p:h/mf.vim
+else
+ runtime! syntax/mf.vim
+endif
+
+" MetaPost has TeX inserts for typeset labels
+" verbatimtex, btex, and etex will be treated as keywords
+syn match mpTeXbegin "\(verbatimtex\|btex\)"
+syn match mpTeXend "etex"
+syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 contains=mpTeXbegin,mpTeXend keepend
+
+" MetaPost primitives not found in Metafont
+syn keyword mpInternal bluepart clip color dashed fontsize greenpart infont
+syn keyword mpInternal linecap linejoin llcorner lrcorner miterlimit mpxbreak
+syn keyword mpInternal prologues redpart setbounds tracinglostchars
+syn keyword mpInternal truecorners ulcorner urcorner withcolor
+
+" Metafont primitives not found in MetaPost
+syn keyword notDefined autorounding chardx chardy fillin granularity hppp
+syn keyword notDefined proofing smoothing tracingedges tracingpens
+syn keyword notDefined turningcheck vppp xoffset yoffset
+
+" Keywords defined by plain.mp
+if !exists("plain_mp_macros")
+ let plain_mp_macros = 1 " Set this to '0' if your source gets too colourful
+endif
+if plain_mp_macros
+ syn keyword mpMacro ahangle ahlength background bbox bboxmargin beginfig
+ syn keyword mpMacro beveled black blue buildcycle butt center cutafter
+ syn keyword mpMacro cutbefore cuttings dashpattern defaultfont defaultpen
+ syn keyword mpMacro defaultscale dotlabel dotlabels drawarrow drawdblarrow
+ syn keyword mpMacro drawoptions endfig evenly extra_beginfig extra_endfig
+ syn keyword mpMacro green label labeloffset mitered red rounded squared
+ syn keyword mpMacro thelabel white base_name base_version
+ syn keyword mpMacro upto downto exitunless relax gobble gobbled
+ syn keyword mpMacro interact loggingall tracingall tracingnone
+ syn keyword mpMacro eps epsilon infinity right left up down origin
+ syn keyword mpMacro quartercircle halfcircle fullcircle unitsquare identity
+ syn keyword mpMacro blankpicture withdots ditto EOF pensquare penrazor
+ syn keyword mpMacro penspeck whatever abs round ceiling byte dir unitvector
+ syn keyword mpMacro inverse counterclockwise tensepath mod div dotprod
+ syn keyword mpMacro takepower direction directionpoint intersectionpoint
+ syn keyword mpMacro softjoin incr decr reflectedabout rotatedaround
+ syn keyword mpMacro rotatedabout min max flex superellipse interpath
+ syn keyword mpMacro magstep currentpen currentpen_path currentpicture
+ syn keyword mpMacro fill draw filldraw drawdot unfill undraw unfilldraw
+ syn keyword mpMacro undrawdot erase cutdraw image pickup numeric_pickup
+ syn keyword mpMacro pen_lft pen_rt pen_top pen_bot savepen clearpen
+ syn keyword mpMacro clear_pen_memory lft rt top bot ulft urt llft lrt
+ syn keyword mpMacro penpos penstroke arrowhead makelabel labels penlabel
+ syn keyword mpMacro range numtok thru clearxy clearit clearpen pickup
+ syn keyword mpMacro shipit bye hide stop solve
+endif
+
+" Keywords defined by mfplain.mp
+if !exists("mfplain_mp_macros")
+ let mfplain_mp_macros = 0 " Set this to '1' to include these macro names
+endif
+if mfplain_mp_macros
+ syn keyword mpMacro beginchar blacker capsule_def change_width
+ syn keyword mpMacro define_blacker_pixels define_corrected_pixels
+ syn keyword mpMacro define_good_x_pixels define_good_y_pixels
+ syn keyword mpMacro define_horizontal_corrected_pixels
+ syn keyword mpMacro define_pixels define_whole_blacker_pixels
+ syn keyword mpMacro define_whole_vertical_blacker_pixels
+ syn keyword mpMacro define_whole_vertical_pixels endchar
+ syn keyword mpMacro extra_beginchar extra_endchar extra_setup
+ syn keyword mpMacro font_coding_scheme font_extra_space font_identifier
+ syn keyword mpMacro font_normal_shrink font_normal_space
+ syn keyword mpMacro font_normal_stretch font_quad font_size
+ syn keyword mpMacro font_slant font_x_height italcorr labelfont
+ syn keyword mpMacro makebox makegrid maketicks mode_def mode_setup
+ syn keyword mpMacro o_correction proofrule proofrulethickness rulepen smode
+
+ " plus some no-ops, also from mfplain.mp
+ syn keyword mpMacro cullit currenttransform gfcorners grayfont hround
+ syn keyword mpMacro imagerules lowres_fix nodisplays notransforms openit
+ syn keyword mpMacro proofoffset screenchars screenrule screenstrokes
+ syn keyword mpMacro showit slantfont titlefont unitpixel vround
+endif
+
+" Keywords defined by other macro packages, e.g., boxes.mp
+if !exists("other_mp_macros")
+ let other_mp_macros = 1 " Set this to '0' if your source gets too colourful
+endif
+if other_mp_macros
+ syn keyword mpMacro circmargin defaultdx defaultdy
+ syn keyword mpMacro boxit boxjoin bpath circleit drawboxed drawboxes
+ syn keyword mpMacro drawunboxed fixpos fixsize pic
+endif
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mp_syntax_inits")
+ if version < 508
+ let did_mp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mpTeXinsert String
+ HiLink mpTeXbegin Statement
+ HiLink mpTeXend Statement
+ HiLink mpInternal mfInternal
+ HiLink mpMacro Macro
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mp"
+
+" vim: ts=8
diff --git a/runtime/syntax/mplayerconf.vim b/runtime/syntax/mplayerconf.vim
new file mode 100644
index 000000000..7abe20a1d
--- /dev/null
+++ b/runtime/syntax/mplayerconf.vim
@@ -0,0 +1,111 @@
+" Vim syntax file
+" Language: mplayer(1) configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/mplayerconf/
+" Latest Revision: 2004-05-22
+" arch-tag: c20b9381-5858-4452-b866-54e2e1891229
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,-
+delcommand SetIsk
+
+" Todo
+syn keyword mplayerconfTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region mplayerconfComment display matchgroup=mplayerconfComment start='#' end='$' contains=mplayerconfTodo
+
+" PreProc
+syn keyword mplayerconfPreProc include
+
+" Booleans
+syn keyword mplayerconfBoolean yes no
+
+" Numbers
+syn match mplayerconfNumber '\<\d\+\>'
+
+" Options
+syn keyword mplayerconfOption hardframedrop nomouseinput bandwidth dumpstream
+syn keyword mplayerconfOption rtsp-stream-over-tcp tv overlapsub sub-bg-alpha
+syn keyword mplayerconfOption subfont-outline unicode format vo edl cookies
+syn keyword mplayerconfOption fps zrfd af-adv nosound audio-density
+syn keyword mplayerconfOption passlogfile vobsuboutindex
+syn keyword mplayerconfOption autoq autosync benchmark colorkey nocolorkey
+syn keyword mplayerconfOption edlout enqueue fixed-vo framedrop h
+syn keyword mplayerconfOption identify input lircconf list-options loop menu
+syn keyword mplayerconfOption menu-cfg menu-root nojoystick nolirc
+syn keyword mplayerconfOption nortc playlist quiet really-quiet shuffle skin
+syn keyword mplayerconfOption slave softsleep speed sstep use-stdin aid alang
+syn keyword mplayerconfOption audio-demuxer audiofile audiofile-cache
+syn keyword mplayerconfOption cdrom-device cache cdda channels chapter
+syn keyword mplayerconfOption cookies-file demuxer dumpaudio dumpfile
+syn keyword mplayerconfOption dumpvideo dvbin dvd-device dvdangle forceidx
+syn keyword mplayerconfOption frames hr-mp3-seek idx ipv4-only-proxy loadidx
+syn keyword mplayerconfOption mc mf ni nobps noextbased passwd prefer-ipv4
+syn keyword mplayerconfOption prefer-ipv6 rawaudio rawvideo
+syn keyword mplayerconfOption saveidx sb srate ss tskeepbroken tsprog tsprobe
+syn keyword mplayerconfOption user user-agent vid vivo dumpjacosub
+syn keyword mplayerconfOption dumpmicrodvdsub dumpmpsub dumpsami dumpsrtsub
+syn keyword mplayerconfOption dumpsub ffactor flip-hebrew font forcedsubsonly
+syn keyword mplayerconfOption fribidi-charset ifo noautosub osdlevel
+syn keyword mplayerconfOption sid slang spuaa spualign spugauss sub
+syn keyword mplayerconfOption sub-bg-color sub-demuxer sub-fuzziness
+syn keyword mplayerconfOption sub-no-text-pp subalign subcc subcp subdelay
+syn keyword mplayerconfOption subfile subfont-autoscale subfont-blur
+syn keyword mplayerconfOption subfont-encoding subfont-osd-scale
+syn keyword mplayerconfOption subfont-text-scale subfps subpos subwidth
+syn keyword mplayerconfOption utf8 vobsub vobsubid abs ao aofile aop delay
+syn keyword mplayerconfOption mixer nowaveheader aa bpp brightness contrast
+syn keyword mplayerconfOption dfbopts display double dr dxr2 fb fbmode
+syn keyword mplayerconfOption fbmodeconfig forcexv fs fsmode-dontuse fstype
+syn keyword mplayerconfOption geometry guiwid hue jpeg monitor-dotclock
+syn keyword mplayerconfOption monitor-hfreq monitor-vfreq monitoraspect
+syn keyword mplayerconfOption nograbpointer nokeepaspect noxv ontop panscan
+syn keyword mplayerconfOption rootwin saturation screenw stop-xscreensaver vm
+syn keyword mplayerconfOption vsync wid xineramascreen z zrbw zrcrop zrdev
+syn keyword mplayerconfOption zrhelp zrnorm zrquality zrvdec zrxdoff ac af
+syn keyword mplayerconfOption afm aspect flip lavdopts noaspect noslices
+syn keyword mplayerconfOption novideo oldpp pp pphelp ssf stereo sws vc vfm x
+syn keyword mplayerconfOption xvidopts xy y zoom vf vop audio-delay
+syn keyword mplayerconfOption audio-preload endpos ffourcc include info
+syn keyword mplayerconfOption noautoexpand noskip o oac of ofps ovc
+syn keyword mplayerconfOption skiplimit v vobsubout vobsuboutid
+syn keyword mplayerconfOption lameopts lavcopts nuvopts xvidencopts
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mplayer_syn_inits")
+ if version < 508
+ let did_mplayer_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mplayerconfTodo Todo
+ HiLink mplayerconfComment Comment
+ HiLink mplayerconfPreProc PreProc
+ HiLink mplayerconfBoolean Boolean
+ HiLink mplayerconfNumber Number
+ HiLink mplayerconfOption Keyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mplayerconf"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/msidl.vim b/runtime/syntax/msidl.vim
new file mode 100644
index 000000000..cf270eebd
--- /dev/null
+++ b/runtime/syntax/msidl.vim
@@ -0,0 +1,92 @@
+" Vim syntax file
+" Language: MS IDL (Microsoft dialect of Interface Description Language)
+" Maintainer: Vadim Zeitlin <vadim@wxwindows.org>
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Misc basic
+syn match msidlId "[a-zA-Z][a-zA-Z0-9_]*"
+syn match msidlUUID "{\?[[:xdigit:]]\{8}-\([[:xdigit:]]\{4}-\)\{3}[[:xdigit:]]\{12}}\?"
+syn region msidlString start=/"/ skip=/\\\(\\\\\)*"/ end=/"/
+syn match msidlLiteral "\d\+\(\.\d*\)\="
+syn match msidlLiteral "\.\d\+"
+syn match msidlSpecial contained "[]\[{}:]"
+
+" Comments
+syn keyword msidlTodo contained TODO FIXME XXX
+syn region msidlComment start="/\*" end="\*/" contains=msidlTodo
+syn match msidlComment "//.*" contains=msidlTodo
+syn match msidlCommentError "\*/"
+
+" C style Preprocessor
+syn region msidlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+
+syn match msidlIncluded contained "<[^>]*>"
+syn match msidlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=msidlIncluded,msidlString
+syn region msidlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=msidlComment,msidlCommentError
+syn region msidlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=msidlLiteral, msidlString
+
+" Attributes
+syn keyword msidlAttribute contained in out propget propput propputref retval
+syn keyword msidlAttribute contained aggregatable appobject binadable coclass control custom default defaultbind defaultcollelem defaultvalue defaultvtable dispinterface displaybind dual entry helpcontext helpfile helpstring helpstringdll hidden id immediatebind lcid library licensed nonbrowsable noncreatable nonextensible oleautomation optional object public readonly requestedit restricted source string uidefault usesgetlasterror vararg version
+syn match msidlAttribute /uuid(.*)/he=s+4 contains=msidlUUID
+syn match msidlAttribute /helpstring(.*)/he=s+10 contains=msidlString
+syn region msidlAttributes start="\[" end="]" keepend contains=msidlSpecial,msidlString,msidlAttribute,msidlComment,msidlCommentError
+
+" Keywords
+syn keyword msidlEnum enum
+syn keyword msidlImport import importlib
+syn keyword msidlStruct interface library coclass
+syn keyword msidlTypedef typedef
+
+" Types
+syn keyword msidlStandardType byte char double float hyper int long short void wchar_t
+syn keyword msidlStandardType BOOL BSTR HRESULT VARIANT VARIANT_BOOL
+syn region msidlSafeArray start="SAFEARRAY(" end=")" contains=msidlStandardType
+
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_msidl_syntax_inits")
+ if version < 508
+ let did_msidl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink msidlInclude Include
+ HiLink msidlPreProc PreProc
+ HiLink msidlPreCondit PreCondit
+ HiLink msidlDefine Macro
+ HiLink msidlIncluded String
+ HiLink msidlString String
+ HiLink msidlComment Comment
+ HiLink msidlTodo Todo
+ HiLink msidlSpecial SpecialChar
+ HiLink msidlLiteral Number
+ HiLink msidlUUID Number
+
+ HiLink msidlImport Include
+ HiLink msidlEnum StorageClass
+ HiLink msidlStruct Structure
+ HiLink msidlTypedef Typedef
+ HiLink msidlAttribute StorageClass
+
+ HiLink msidlStandardType Type
+ HiLink msidlSafeArray Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "msidl"
+
+" vi: set ts=8 sw=4:
diff --git a/runtime/syntax/msql.vim b/runtime/syntax/msql.vim
new file mode 100644
index 000000000..0716fbb1f
--- /dev/null
+++ b/runtime/syntax/msql.vim
@@ -0,0 +1,100 @@
+" Vim syntax file
+" Language: msql
+" Maintainer: Lutz Eymers <ixtab@polzin.com>
+" URL: http://www.isp.de/data/msql.vim
+" Email: Subject: send syntax_vim.tgz
+" Last Change: 2001 May 10
+"
+" Options msql_sql_query = 1 for SQL syntax highligthing inside strings
+" msql_minlines = x to sync at least x lines backwards
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'msql'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syn cluster htmlPreproc add=msqlRegion
+
+syn case match
+
+" Internal Variables
+syn keyword msqlIntVar ERRMSG contained
+
+" Env Variables
+syn keyword msqlEnvVar SERVER_SOFTWARE SERVER_NAME SERVER_URL GATEWAY_INTERFACE contained
+syn keyword msqlEnvVar SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD PATH_INFO contained
+syn keyword msqlEnvVar PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST contained
+syn keyword msqlEnvVar REMOTE_ADDR AUTH_TYPE REMOTE_USER CONTEN_TYPE contained
+syn keyword msqlEnvVar CONTENT_LENGTH HTTPS HTTPS_KEYSIZE HTTPS_SECRETKEYSIZE contained
+syn keyword msqlEnvVar HTTP_ACCECT HTTP_USER_AGENT HTTP_IF_MODIFIED_SINCE contained
+syn keyword msqlEnvVar HTTP_FROM HTTP_REFERER contained
+
+" Inlclude lLite
+syn include @msqlLite <sfile>:p:h/lite.vim
+
+" Msql Region
+syn region msqlRegion matchgroup=Delimiter start="<!$" start="<![^!->D]" end=">" contains=@msqlLite,msql.*
+
+" sync
+if exists("msql_minlines")
+ exec "syn sync minlines=" . msql_minlines
+else
+ syn sync minlines=100
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_msql_syn_inits")
+ if version < 508
+ let did_msql_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink msqlComment Comment
+ HiLink msqlString String
+ HiLink msqlNumber Number
+ HiLink msqlFloat Float
+ HiLink msqlIdentifier Identifier
+ HiLink msqlGlobalIdentifier Identifier
+ HiLink msqlIntVar Identifier
+ HiLink msqlEnvVar Identifier
+ HiLink msqlFunctions Function
+ HiLink msqlRepeat Repeat
+ HiLink msqlConditional Conditional
+ HiLink msqlStatement Statement
+ HiLink msqlType Type
+ HiLink msqlInclude Include
+ HiLink msqlDefine Define
+ HiLink msqlSpecialChar SpecialChar
+ HiLink msqlParentError Error
+ HiLink msqlTodo Todo
+ HiLink msqlOperator Operator
+ HiLink msqlRelation Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "msql"
+
+if main_syntax == 'msql'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/mush.vim b/runtime/syntax/mush.vim
new file mode 100644
index 000000000..556592783
--- /dev/null
+++ b/runtime/syntax/mush.vim
@@ -0,0 +1,132 @@
+" MUSHcode syntax file
+" Maintainer: Bek Oberin <gossamer@tertius.net.au>
+" Last updated by Rimnal on Mon Aug 20 08:28:56 MDT 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" regular mush functions
+syntax keyword mushFunction contained abs acos add after and andflags aposs
+syntax keyword mushFunction contained asin atan before capstr cat ceil center
+syntax keyword mushFunction contained comp con conn controls convsecs convtime
+syntax keyword mushFunction contained cos default delete dist2d dist3d div e
+syntax keyword mushFunction contained edefault edit elements elock eq escape
+syntax keyword mushFunction contained exit exp extract fdiv filter first flags
+syntax keyword mushFunction contained floor fold foreach findable fullname get
+syntax keyword mushFunction contained get_eval grab gt gte hasattr hasflag
+syntax keyword mushFunction contained home idle index insert isdbref isnum
+syntax keyword mushFunction contained isword iter last lattr lcon lcstr
+syntax keyword mushFunction contained ldelete left lexits ljust ln lnum loc
+syntax keyword mushFunction contained locate lock log lpos lt lte lwho map
+syntax keyword mushFunction contained match matchall max member merge mid min
+syntax keyword mushFunction contained mix mod money mudname mul munge name
+syntax keyword mushFunction contained nearby neq next not num obj objeval
+syntax keyword mushFunction contained objmem or orflags owner parent parse pi
+syntax keyword mushFunction contained ports pos poss power r rand remove repeat
+syntax keyword mushFunction contained replace rest reverse revwords right
+syntax keyword mushFunction contained rjust rloc room round s scramble search
+syntax keyword mushFunction contained secs secure setdiff setinter setq
+syntax keyword mushFunction contained setunion shuffle sign sin sort sortby
+syntax keyword mushFunction contained space splice sqrt squish starttime stats
+syntax keyword mushFunction contained strlen strmatch sub subj switch tan time
+syntax keyword mushFunction contained trim trunc type u ucstr udefault ulocal
+syntax keyword mushFunction contained v version visible where wordpos words
+syntax keyword mushFunction contained xcon xor
+" only highligh functions when they have an in-bracket immediately after
+syntax match mushFunctionBrackets "\i\I*(" contains=mushFunction
+
+" regular mush commands
+syntax keyword mushAtCommandList contained @alias @chown @clone @create
+syntax keyword mushAtCommandList contained @decompile @destroy @doing @dolist
+syntax keyword mushAtCommandList contained @drain @edit @emit @entrances @femit
+syntax keyword mushAtCommandList contained @force @fpose @fsay @halt @last
+syntax keyword mushAtCommandList contained @link @list @listmotd @lock @mudwho
+syntax keyword mushAtCommandList contained @mvattr @name @notify @oemit @parent
+syntax keyword mushAtCommandList contained @password @pemit @ps @quota @robot
+syntax keyword mushAtCommandList contained @search @set @stats @sweep @switch
+syntax keyword mushAtCommandList contained @teleport @trigger @unlink @unlock
+syntax keyword mushAtCommandList contained @verb @wait @wipe
+syntax match mushCommand "@\i\I*" contains=mushAtCommandList
+
+
+syntax keyword mushCommand drop enter examine get give goto help inventory
+syntax keyword mushCommand kill leave look news page pose say score use
+syntax keyword mushCommand version whisper DOING LOGOUT OUTPUTPREFIX
+syntax keyword mushCommand OUTPUTSUFFIX QUIT SESSION WHO
+
+syntax match mushSpecial "\*\|!\|=\|-\|\\\|+"
+syntax match mushSpecial2 contained "\*"
+
+syntax match mushIdentifier "&[^ ]\+"
+
+syntax match mushVariable "%r\|%t\|%cr\|%[A-Za-z0-9]\+\|%#\|##\|here"
+
+" numbers
+syntax match mushNumber +[0-9]\++
+
+" A comment line starts with a or # or " at the start of the line
+" or an @@
+syntax keyword mushTodo contained TODO FIXME XXX
+syntax match mushComment +^\s*@@.*$+ contains=mushTodo
+syntax match mushComment +^".*$+ contains=mushTodo
+syntax match mushComment +^#.*$+ contains=mushTodo
+
+syntax region mushFuncBoundaries start="\[" end="\]" contains=mushFunction,mushFlag,mushAttributes,mushNumber,mushCommand,mushVariable,mushSpecial2
+
+" FLAGS
+syntax keyword mushFlag PLAYER ABODE BUILDER CHOWN_OK DARK FLOATING
+syntax keyword mushFlag GOING HAVEN INHERIT JUMP_OK KEY LINK_OK MONITOR
+syntax keyword mushFlag NOSPOOF OPAQUE QUIET STICKY TRACE UNFINDABLE VISUAL
+syntax keyword mushFlag WIZARD PARENT_OK ZONE AUDIBLE CONNECTED DESTROY_OK
+syntax keyword mushFlag ENTER_OK HALTED IMMORTAL LIGHT MYOPIC PUPPET TERSE
+syntax keyword mushFlag ROBOT SAFE TRANSPARENT VERBOSE CONTROL_OK COMMANDS
+
+syntax keyword mushAttribute aahear aclone aconnect adesc adfail adisconnect
+syntax keyword mushAttribute adrop aefail aenter afail agfail ahear akill
+syntax keyword mushAttribute aleave alfail alias amhear amove apay arfail
+syntax keyword mushAttribute asucc atfail atport aufail ause away charges
+syntax keyword mushAttribute cost desc dfail drop ealias efail enter fail
+syntax keyword mushAttribute filter forwardlist gfail idesc idle infilter
+syntax keyword mushAttribute inprefix kill lalias last lastsite leave lfail
+syntax keyword mushAttribute listen move odesc odfail odrop oefail oenter
+syntax keyword mushAttribute ofail ogfail okill oleave olfail omove opay
+syntax keyword mushAttribute orfail osucc otfail otport oufail ouse oxenter
+syntax keyword mushAttribute oxleave oxtport pay prefix reject rfail runout
+syntax keyword mushAttribute semaphore sex startup succ tfail tport ufail
+syntax keyword mushAttribute use va vb vc vd ve vf vg vh vi vj vk vl vm vn
+syntax keyword mushAttribute vo vp vq vr vs vt vu vv vw vx vy vz
+
+
+if version >= 508 || !exists("did_mush_syntax_inits")
+ if version < 508
+ let did_mush_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink mushAttribute Constant
+ HiLink mushCommand Function
+ HiLink mushComment Comment
+ HiLink mushNumber Number
+ HiLink mushSetting PreProc
+ HiLink mushFunction Statement
+ HiLink mushVariable Identifier
+ HiLink mushSpecial Special
+ HiLink mushTodo Todo
+ HiLink mushFlag Special
+ HiLink mushIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mush"
+
+" mush: ts=17
diff --git a/runtime/syntax/muttrc.vim b/runtime/syntax/muttrc.vim
new file mode 100644
index 000000000..4a1f1a90b
--- /dev/null
+++ b/runtime/syntax/muttrc.vim
@@ -0,0 +1,248 @@
+" Vim syntax file
+" Language: Mutt setup files
+" Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
+" Contributor: Gary Johnson <garyjohn@spk.agilent.com>
+" Last Change: 27 May 2004
+
+" This file covers mutt version 1.4.2.1i
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set the keyword characters
+if version < 600
+ set isk=@,48-57,_,-
+else
+ setlocal isk=@,48-57,_,-
+endif
+
+syn match muttrcComment "^#.*$"
+syn match muttrcComment "[^\\]#.*$"lc=1
+
+" Escape sequences (back-tick and pipe goes here too)
+syn match muttrcEscape +\\[#tnr"'Cc]+
+syn match muttrcEscape +[`|]+
+
+" The variables takes the following arguments
+syn match muttrcString "=\s*[^ #"']\+"lc=1 contains=muttrcEscape
+syn region muttrcString start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcMacro,muttrcCommand
+syn region muttrcString start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcMacro,muttrcCommand
+
+syn match muttrcSpecial +\(['"]\)!\1+
+
+" Numbers and Quadoptions may be surrounded by " or '
+syn match muttrcNumber /=\s*\d\+/lc=1
+syn match muttrcNumber /=\s*"\d\+"/lc=1
+syn match muttrcNumber /=\s*'\d\+'/lc=1
+syn match muttrcQuadopt +=\s*\(ask-\)\=\(yes\|no\)+lc=1
+syn match muttrcQuadopt +=\s*"\(ask-\)\=\(yes\|no\)"+lc=1
+syn match muttrcQuadopt +=\s*'\(ask-\)\=\(yes\|no\)'+lc=1
+
+" Now catch some email addresses and headers (purified version from mail.vim)
+syn match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+"
+syn match muttrcHeader "\<\(From\|To\|Cc\|Bcc\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\="
+
+syn match muttrcKeySpecial contained +\(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+
+syn match muttrcKey contained "\S\+" contains=muttrcKeySpecial
+syn region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial
+syn region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial
+syn match muttrcKeyName contained "\<f\(\d\|10\)\>"
+syn match muttrcKeyName contained "\\[trne]"
+syn match muttrcKeyName contained "<\(BackSpace\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>"
+
+syn keyword muttrcVarBool contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split
+syn keyword muttrcVarBool contained auto_tag autoedit beep beep_new bounce_delivered check_new collapse_unread
+syn keyword muttrcVarBool contained confirmappend confirmcreate delete_untag digest_collapse duplicate_threads
+syn keyword muttrcVarBool contained edit_hdrs edit_headers encode_from envelope_from fast_reply fcc_attach
+syn keyword muttrcVarBool contained fcc_clear followup_to force_name forw_decode forw_decrypt forw_quote
+syn keyword muttrcVarBool contained forward_decode forward_decrypt forward_quote hdrs header help hidden_host
+syn keyword muttrcVarBool contained hide_limited hide_missing hide_top_limited hide_top_missing ignore_list_reply_to
+syn keyword muttrcVarBool contained imap_force_ssl imap_list_subscribed imap_passive imap_peek imap_servernoise
+syn keyword muttrcVarBool contained implicit_autoview keep_flagged mailcap_sanitize maildir_trash mark_old markers
+syn keyword muttrcVarBool contained menu_scroll meta_key metoo mh_purge mime_forward_decode pager_stop pgp_autoencrypt
+syn keyword muttrcVarBool contained pgp_autosign pgp_ignore_subkeys pgp_long_ids pgp_replyencrypt pgp_replysign
+syn keyword muttrcVarBool contained pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable pgp_strict_enc
+syn keyword muttrcVarBool contained pipe_decode pipe_split pop_auth_try_all pop_last print_decode print_split
+syn keyword muttrcVarBool contained prompt_after read_only reply_self resolve reverse_alias reverse_name
+syn keyword muttrcVarBool contained reverse_realname rfc2047_parameters save_address save_empty save_name score
+syn keyword muttrcVarBool contained sig_dashes sig_on_top smart_wrap sort_re ssl_use_sslv2 ssl_use_sslv3 ssl_use_tlsv1
+syn keyword muttrcVarBool contained ssl_usesystemcerts status_on_top strict_threads suspend text_flowed thorough_search
+syn keyword muttrcVarBool contained thread_received tilde uncollapse_jump use_8bitmime use_domain use_from use_ipv6
+syn keyword muttrcVarBool contained user_agent wait_key weed wrap_search write_bcc
+
+syn keyword muttrcVarBool contained noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc
+syn keyword muttrcVarBool contained noattach_split noauto_tag noautoedit nobeep nobeep_new nobounce_delivered
+syn keyword muttrcVarBool contained nocheck_new nocollapse_unread noconfirmappend noconfirmcreate nodelete_untag
+syn keyword muttrcVarBool contained nodigest_collapse noduplicate_threads noedit_hdrs noedit_headers noencode_from
+syn keyword muttrcVarBool contained noenvelope_from nofast_reply nofcc_attach nofcc_clear nofollowup_to noforce_name
+syn keyword muttrcVarBool contained noforw_decode noforw_decrypt noforw_quote noforward_decode noforward_decrypt
+syn keyword muttrcVarBool contained noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nohide_missing
+syn keyword muttrcVarBool contained nohide_top_limited nohide_top_missing noignore_list_reply_to noimap_force_ssl
+syn keyword muttrcVarBool contained noimap_list_subscribed noimap_passive noimap_peek noimap_servernoise
+syn keyword muttrcVarBool contained noimplicit_autoview nokeep_flagged nomailcap_sanitize nomaildir_trash nomark_old
+syn keyword muttrcVarBool contained nomarkers nomenu_scroll nometa_key nometoo nomh_purge nomime_forward_decode
+syn keyword muttrcVarBool contained nopager_stop nopgp_autoencrypt nopgp_autosign nopgp_ignore_subkeys nopgp_long_ids
+syn keyword muttrcVarBool contained nopgp_replyencrypt nopgp_replysign nopgp_replysignencrypted nopgp_retainable_sigs
+syn keyword muttrcVarBool contained nopgp_show_unusable nopgp_strict_enc nopipe_decode nopipe_split nopop_auth_try_all
+syn keyword muttrcVarBool contained nopop_last noprint_decode noprint_split noprompt_after noread_only noreply_self
+syn keyword muttrcVarBool contained noresolve noreverse_alias noreverse_name noreverse_realname norfc2047_parameters
+syn keyword muttrcVarBool contained nosave_address nosave_empty nosave_name noscore nosig_dashes nosig_on_top
+syn keyword muttrcVarBool contained nosmart_wrap nosort_re nossl_use_sslv2 nossl_use_sslv3 nossl_use_tlsv1
+syn keyword muttrcVarBool contained nossl_usesystemcerts nostatus_on_top nostrict_threads nosuspend notext_flowed
+syn keyword muttrcVarBool contained nothorough_search nothread_received notilde nouncollapse_jump nouse_8bitmime
+syn keyword muttrcVarBool contained nouse_domain nouse_from nouse_ipv6 nouser_agent nowait_key noweed nowrap_search
+syn keyword muttrcVarBool contained nowrite_bcc
+
+syn keyword muttrcVarBool contained invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc invaskcc
+syn keyword muttrcVarBool contained invattach_split invauto_tag invautoedit invbeep invbeep_new invbounce_delivered
+syn keyword muttrcVarBool contained invcheck_new invcollapse_unread invconfirmappend invconfirmcreate invdelete_untag
+syn keyword muttrcVarBool contained invdigest_collapse invduplicate_threads invedit_hdrs invedit_headers invencode_from
+syn keyword muttrcVarBool contained invenvelope_from invfast_reply invfcc_attach invfcc_clear invfollowup_to invforce_name
+syn keyword muttrcVarBool contained invforw_decode invforw_decrypt invforw_quote invforward_decode invforward_decrypt
+syn keyword muttrcVarBool contained invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited
+syn keyword muttrcVarBool contained invhide_missing invhide_top_limited invhide_top_missing invignore_list_reply_to
+syn keyword muttrcVarBool contained invimap_force_ssl invimap_list_subscribed invimap_passive invimap_peek
+syn keyword muttrcVarBool contained invimap_servernoise invimplicit_autoview invkeep_flagged invmailcap_sanitize
+syn keyword muttrcVarBool contained invmaildir_trash invmark_old invmarkers invmenu_scroll invmeta_key invmetoo
+syn keyword muttrcVarBool contained invmh_purge invmime_forward_decode invpager_stop invpgp_autoencrypt invpgp_autosign
+syn keyword muttrcVarBool contained invpgp_ignore_subkeys invpgp_long_ids invpgp_replyencrypt invpgp_replysign
+syn keyword muttrcVarBool contained invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable invpgp_strict_enc
+syn keyword muttrcVarBool contained invpipe_decode invpipe_split invpop_auth_try_all invpop_last invprint_decode
+syn keyword muttrcVarBool contained invprint_split invprompt_after invread_only invreply_self invresolve invreverse_alias
+syn keyword muttrcVarBool contained invreverse_name invreverse_realname invrfc2047_parameters invsave_address invsave_empty
+syn keyword muttrcVarBool contained invsave_name invscore invsig_dashes invsig_on_top invsmart_wrap invsort_re
+syn keyword muttrcVarBool contained invssl_use_sslv2 invssl_use_sslv3 invssl_use_tlsv1 invssl_usesystemcerts
+syn keyword muttrcVarBool contained invstatus_on_top invstrict_threads invsuspend invtext_flowed invthorough_search
+syn keyword muttrcVarBool contained invthread_received invtilde invuncollapse_jump invuse_8bitmime invuse_domain invuse_from
+syn keyword muttrcVarBool contained invuse_ipv6 invuser_agent invwait_key invweed invwrap_search invwrite_bcc
+
+syn keyword muttrcVarQuad contained abort_nosubject abort_unmodified copy delete honor_followup_to include mime_forward
+syn keyword muttrcVarQuad contained mime_forward_rest mime_fwd move pgp_create_traditional pgp_verify_sig pop_delete
+syn keyword muttrcVarQuad contained pop_reconnect postpone print quit recall reply_to ssl_starttls
+
+syn keyword muttrcVarQuad contained noabort_nosubject noabort_unmodified nocopy nodelete nohonor_followup_to
+syn keyword muttrcVarQuad contained noinclude nomime_forward nocontained nomime_forward_rest nomime_fwd nomove
+syn keyword muttrcVarQuad contained nopgp_create_traditional nopgp_verify_sig nopop_delete nopop_reconnect
+syn keyword muttrcVarQuad contained nopostpone noprint noquit norecall noreply_to nossl_starttls
+
+syn keyword muttrcVarQuad contained invabort_nosubject invabort_unmodified invcopy invdelete invhonor_followup_to
+syn keyword muttrcVarQuad contained invinclude invmime_forward invcontained invmime_forward_rest invmime_fwd invmove
+syn keyword muttrcVarQuad contained invpgp_create_traditional invpgp_verify_sig invpop_delete invpop_reconnect
+syn keyword muttrcVarQuad contained invpostpone invprint invquit invrecall invreply_to invssl_starttls
+
+syn keyword muttrcVarNum contained connect_timeout history imap_keepalive mail_check pager_context pager_index_lines
+syn keyword muttrcVarNum contained pgp_timeout pop_checkinterval read_inc score_threshold_delete score_threshold_flag
+syn keyword muttrcVarNum contained score_threshold_read sendmail_wait sleep_time timeout wrapmargin write_inc
+
+syn keyword muttrcVarStr contained alias_file alias_format alternates attach_format attach_sep attribution certificate_file
+syn keyword muttrcVarStr contained charset compose_format date_format default_hook display_filter dotlock_program dsn_notify
+syn keyword muttrcVarStr contained dsn_return editor entropy_file escape folder folder_format forw_format forward_format
+syn keyword muttrcVarStr contained from gecos_mask hdr_format hostname imap_authenticators imap_delim_chars
+syn keyword muttrcVarStr contained imap_home_namespace imap_pass imap_user indent_str indent_string index_format ispell
+syn keyword muttrcVarStr contained locale mailcap_path mask mbox mbox_type message_format mh_seq_flagged mh_seq_replied
+syn keyword muttrcVarStr contained mh_seq_unseen mix_entry_format mixmaster msg_format pager pager_format
+syn keyword muttrcVarStr contained pgp_clearsign_command pgp_decode_command pgp_decrypt_command pgp_encrypt_only_command
+syn keyword muttrcVarStr contained pgp_encrypt_sign_command pgp_entry_format pgp_export_command pgp_getkeys_command
+syn keyword muttrcVarStr contained pgp_good_sign pgp_import_command pgp_list_pubring_command pgp_list_secring_command
+syn keyword muttrcVarStr contained pgp_sign_as pgp_sign_command pgp_sort_keys pgp_verify_command pgp_verify_key_command
+syn keyword muttrcVarStr contained pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_str post_indent_string
+syn keyword muttrcVarStr contained postponed preconnect print_cmd print_command query_command quote_regexp realname record
+syn keyword muttrcVarStr contained reply_regexp send_charset sendmail shell signature simple_search smileys sort sort_alias
+syn keyword muttrcVarStr contained sort_aux sort_browser spoolfile status_chars status_format tmpdir to_chars tunnel visual
+
+syn keyword muttrcMenu contained alias attach browser compose editor index pager postpone pgp mix query generic
+
+syn keyword muttrcCommand account-hook auto_view alternative_order charset-hook uncolor exec fcc-hook fcc-save-hook
+syn keyword muttrcCommand folder-hook hdr_order iconv-hook ignore lists mailboxes message-hook mbox-hook my_hdr
+syn keyword muttrcCommand pgp-hook push save-hook score send-hook source subscribe unalias unauto_view unhdr_order
+syn keyword muttrcCommand unhook unignore unlists unmono unmy_hdr unscore unsubscribe
+
+syn keyword muttrcSet set skipwhite nextgroup=muttrcVar.*
+syn keyword muttrcUnset unset skipwhite nextgroup=muttrcVar.*
+syn keyword muttrcReset reset skipwhite nextgroup=muttrcVar.*
+syn keyword muttrcToggle toggle skipwhite nextgroup=muttrcVar.*
+
+syn keyword muttrcBind contained bind skipwhite nextgroup=muttrcMenu
+syn match muttrcBindLine "^\s*bind\s\+\S\+" skipwhite nextgroup=muttrcKey\(Name\)\= contains=muttrcBind
+
+syn keyword muttrcMacro contained macro skipwhite nextgroup=muttrcMenu
+syn match muttrcMacroLine "^\s*macro\s\+\S\+" skipwhite nextgroup=muttrcKey\(Name\)\= contains=muttrcMacro
+
+syn keyword muttrcAlias contained alias
+syn match muttrcAliasLine "^\s*alias\s\+\S\+" contains=muttrcAlias
+
+" Colour definitions takes object, foreground and background arguments (regexps excluded).
+syn keyword muttrcColorField contained attachment body bold error hdrdefault header index
+syn keyword muttrcColorField contained indicator markers message normal quoted search signature
+syn keyword muttrcColorField contained status tilde tree underline
+syn match muttrcColorField contained "\<quoted\d\=\>"
+syn keyword muttrcColorFG contained black blue cyan default green magenta red white yellow
+syn keyword muttrcColorFG contained brightblack brightblue brightcyan brightdefault brightgreen
+syn keyword muttrcColorFG contained brightmagenta brightred brightwhite brightyellow
+syn match muttrcColorFG contained "\<\(bright\)\=color\d\{1,2}\>"
+syn keyword muttrcColorBG contained black blue cyan default green magenta red white yellow
+syn match muttrcColorBG contained "\<color\d\{1,2}\>"
+" Now for the match
+syn keyword muttrcColor contained color skipwhite nextgroup=muttrcColorField
+syn match muttrcColorInit contained "^\s*color\s\+\S\+" skipwhite nextgroup=muttrcColorFG contains=muttrcColor
+syn match muttrcColorLine "^\s*color\s\+\S\+\s\+\S" skipwhite nextgroup=muttrcColorBG contains=muttrcColorInit
+
+" Mono are almost like color (ojects inherited from color)
+syn keyword muttrcMonoAttrib contained bold none normal reverse standout underline
+syn keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField
+syn match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_muttrc_syntax_inits")
+ if version < 508
+ let did_muttrc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink muttrcComment Comment
+ HiLink muttrcEscape SpecialChar
+ HiLink muttrcString String
+ HiLink muttrcSpecial Special
+ HiLink muttrcNumber Number
+ HiLink muttrcQuadopt Boolean
+ HiLink muttrcEmail Special
+ HiLink muttrcHeader Type
+ HiLink muttrcKeySpecial SpecialChar
+ HiLink muttrcKey Type
+ HiLink muttrcKeyName Macro
+ HiLink muttrcVarBool Identifier
+ HiLink muttrcVarQuad Identifier
+ HiLink muttrcVarNum Identifier
+ HiLink muttrcVarStr Identifier
+ HiLink muttrcMenu Identifier
+ HiLink muttrcCommand Keyword
+ HiLink muttrcSet muttrcCommand
+ HiLink muttrcUnset muttrcCommand
+ HiLink muttrcReset muttrcCommand
+ HiLink muttrcToggle muttrcCommand
+ HiLink muttrcBind muttrcCommand
+ HiLink muttrcMacro muttrcCommand
+ HiLink muttrcAlias muttrcCommand
+ HiLink muttrcAliasLine Identifier
+ HiLink muttrcColorField Identifier
+ HiLink muttrcColorFG String
+ HiLink muttrcColorBG muttrcColorFG
+ HiLink muttrcColor muttrcCommand
+ HiLink muttrcMonoAttrib muttrcColorFG
+ HiLink muttrcMono muttrcCommand
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "muttrc"
+
+"EOF vim: ts=8 noet tw=100 sw=8 sts=0
diff --git a/runtime/syntax/mysql.vim b/runtime/syntax/mysql.vim
new file mode 100644
index 000000000..68b8e9de8
--- /dev/null
+++ b/runtime/syntax/mysql.vim
@@ -0,0 +1,296 @@
+" Vim syntax file
+" Language: mysql
+" Maintainer: Kenneth J. Pronovici <pronovic@ieee.org>
+" Last Change: $Date$
+" Filenames: *.mysql
+" URL: ftp://cedar-solutions.com/software/mysql.vim
+" Note: The definitions below are taken from the mysql user manual as of April 2002, for version 3.23
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Always ignore case
+syn case ignore
+
+" General keywords which don't fall into other categories
+syn keyword mysqlKeyword action add after aggregate all alter as asc auto_increment avg avg_row_length
+syn keyword mysqlKeyword both by
+syn keyword mysqlKeyword cascade change character check checksum column columns comment constraint create cross
+syn keyword mysqlKeyword current_date current_time current_timestamp
+syn keyword mysqlKeyword data database databases day day_hour day_minute day_second
+syn keyword mysqlKeyword default delayed delay_key_write delete desc describe distinct distinctrow drop
+syn keyword mysqlKeyword enclosed escape escaped explain
+syn keyword mysqlKeyword fields file first flush for foreign from full function
+syn keyword mysqlKeyword global grant grants group
+syn keyword mysqlKeyword having heap high_priority hosts hour hour_minute hour_second
+syn keyword mysqlKeyword identified ignore index infile inner insert insert_id into isam
+syn keyword mysqlKeyword join
+syn keyword mysqlKeyword key keys kill last_insert_id leading left limit lines load local lock logs long
+syn keyword mysqlKeyword low_priority
+syn keyword mysqlKeyword match max_rows middleint min_rows minute minute_second modify month myisam
+syn keyword mysqlKeyword natural no
+syn keyword mysqlKeyword on optimize option optionally order outer outfile
+syn keyword mysqlKeyword pack_keys partial password primary privileges procedure process processlist
+syn keyword mysqlKeyword read references reload rename replace restrict returns revoke row rows
+syn keyword mysqlKeyword second select show shutdown soname sql_big_result sql_big_selects sql_big_tables sql_log_off
+syn keyword mysqlKeyword sql_log_update sql_low_priority_updates sql_select_limit sql_small_result sql_warnings starting
+syn keyword mysqlKeyword status straight_join string
+syn keyword mysqlKeyword table tables temporary terminated to trailing type
+syn keyword mysqlKeyword unique unlock unsigned update usage use using
+syn keyword mysqlKeyword values varbinary variables varying
+syn keyword mysqlKeyword where with write
+syn keyword mysqlKeyword year_month
+syn keyword mysqlKeyword zerofill
+
+" Special values
+syn keyword mysqlSpecial false null true
+
+" Strings (single- and double-quote)
+syn region mysqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn region mysqlString start=+'+ skip=+\\\\\|\\'+ end=+'+
+
+" Numbers and hexidecimal values
+syn match mysqlNumber "-\=\<[0-9]*\>"
+syn match mysqlNumber "-\=\<[0-9]*\.[0-9]*\>"
+syn match mysqlNumber "-\=\<[0-9]*e[+-]\=[0-9]*\>"
+syn match mysqlNumber "-\=\<[0-9]*\.[0-9]*e[+-]\=[0-9]*\>"
+syn match mysqlNumber "\<0x[abcdefABCDEF0-9]*\>"
+
+" User variables
+syn match mysqlVariable "@\a*[A-Za-z0-9]*[._]*[A-Za-z0-9]*"
+
+" Comments (c-style, mysql-style and modified sql-style)
+syn region mysqlComment start="/\*" end="\*/"
+syn match mysqlComment "#.*"
+syn match mysqlComment "-- .*"
+syn sync ccomment mysqlComment
+
+" Column types
+"
+" This gets a bit ugly. There are two different problems we have to
+" deal with.
+"
+" The first problem is that some keywoards like 'float' can be used
+" both with and without specifiers, i.e. 'float', 'float(1)' and
+" 'float(@var)' are all valid. We have to account for this and we
+" also have to make sure that garbage like floatn or float_(1) is not
+" highlighted.
+"
+" The second problem is that some of these keywords are included in
+" function names. For instance, year() is part of the name of the
+" dayofyear() function, and the dec keyword (no parenthesis) is part of
+" the name of the decode() function.
+
+syn keyword mysqlType tinyint smallint mediumint int integer bigint
+syn keyword mysqlType date datetime time bit bool
+syn keyword mysqlType tinytext mediumtext longtext text
+syn keyword mysqlType tinyblob mediumblob longblob blob
+syn region mysqlType start="float\W" end="."me=s-1
+syn region mysqlType start="float$" end="."me=s-1
+syn region mysqlType start="float(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="double\W" end="."me=s-1
+syn region mysqlType start="double$" end="."me=s-1
+syn region mysqlType start="double(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="double precision\W" end="."me=s-1
+syn region mysqlType start="double precision$" end="."me=s-1
+syn region mysqlType start="double precision(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="real\W" end="."me=s-1
+syn region mysqlType start="real$" end="."me=s-1
+syn region mysqlType start="real(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="numeric(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="dec\W" end="."me=s-1
+syn region mysqlType start="dec$" end="."me=s-1
+syn region mysqlType start="dec(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="decimal\W" end="."me=s-1
+syn region mysqlType start="decimal$" end="."me=s-1
+syn region mysqlType start="decimal(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="\Wtimestamp\W" end="."me=s-1
+syn region mysqlType start="\Wtimestamp$" end="."me=s-1
+syn region mysqlType start="\Wtimestamp(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="^timestamp\W" end="."me=s-1
+syn region mysqlType start="^timestamp$" end="."me=s-1
+syn region mysqlType start="^timestamp(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="\Wyear(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="^year(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="char(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="varchar(" end=")" contains=mysqlNumber,mysqlVariable
+syn region mysqlType start="enum(" end=")" contains=mysqlString,mysqlVariable
+syn region mysqlType start="\Wset(" end=")" contains=mysqlString,mysqlVariable
+syn region mysqlType start="^set(" end=")" contains=mysqlString,mysqlVariable
+
+" Logical, string and numeric operators
+syn keyword mysqlOperator between not and or is in like regexp rlike binary exists
+syn region mysqlOperator start="isnull(" end=")" contains=ALL
+syn region mysqlOperator start="coalesce(" end=")" contains=ALL
+syn region mysqlOperator start="interval(" end=")" contains=ALL
+
+" Control flow functions
+syn keyword mysqlFlow case when then else end
+syn region mysqlFlow start="ifnull(" end=")" contains=ALL
+syn region mysqlFlow start="nullif(" end=")" contains=ALL
+syn region mysqlFlow start="if(" end=")" contains=ALL
+
+" General Functions
+"
+" I'm leery of just defining keywords for functions, since according to the MySQL manual:
+"
+" Function names do not clash with table or column names. For example, ABS is a
+" valid column name. The only restriction is that for a function call, no spaces
+" are allowed between the function name and the `(' that follows it.
+"
+" This means that if I want to highlight function names properly, I have to use a
+" region to define them, not just a keyword. This will probably cause the syntax file
+" to load more slowly, but at least it will be 'correct'.
+
+syn region mysqlFunction start="abs(" end=")" contains=ALL
+syn region mysqlFunction start="acos(" end=")" contains=ALL
+syn region mysqlFunction start="adddate(" end=")" contains=ALL
+syn region mysqlFunction start="ascii(" end=")" contains=ALL
+syn region mysqlFunction start="asin(" end=")" contains=ALL
+syn region mysqlFunction start="atan(" end=")" contains=ALL
+syn region mysqlFunction start="atan2(" end=")" contains=ALL
+syn region mysqlFunction start="benchmark(" end=")" contains=ALL
+syn region mysqlFunction start="bin(" end=")" contains=ALL
+syn region mysqlFunction start="bit_and(" end=")" contains=ALL
+syn region mysqlFunction start="bit_count(" end=")" contains=ALL
+syn region mysqlFunction start="bit_or(" end=")" contains=ALL
+syn region mysqlFunction start="ceiling(" end=")" contains=ALL
+syn region mysqlFunction start="character_length(" end=")" contains=ALL
+syn region mysqlFunction start="char_length(" end=")" contains=ALL
+syn region mysqlFunction start="concat(" end=")" contains=ALL
+syn region mysqlFunction start="concat_ws(" end=")" contains=ALL
+syn region mysqlFunction start="connection_id(" end=")" contains=ALL
+syn region mysqlFunction start="conv(" end=")" contains=ALL
+syn region mysqlFunction start="cos(" end=")" contains=ALL
+syn region mysqlFunction start="cot(" end=")" contains=ALL
+syn region mysqlFunction start="count(" end=")" contains=ALL
+syn region mysqlFunction start="curdate(" end=")" contains=ALL
+syn region mysqlFunction start="curtime(" end=")" contains=ALL
+syn region mysqlFunction start="date_add(" end=")" contains=ALL
+syn region mysqlFunction start="date_format(" end=")" contains=ALL
+syn region mysqlFunction start="date_sub(" end=")" contains=ALL
+syn region mysqlFunction start="dayname(" end=")" contains=ALL
+syn region mysqlFunction start="dayofmonth(" end=")" contains=ALL
+syn region mysqlFunction start="dayofweek(" end=")" contains=ALL
+syn region mysqlFunction start="dayofyear(" end=")" contains=ALL
+syn region mysqlFunction start="decode(" end=")" contains=ALL
+syn region mysqlFunction start="degrees(" end=")" contains=ALL
+syn region mysqlFunction start="elt(" end=")" contains=ALL
+syn region mysqlFunction start="encode(" end=")" contains=ALL
+syn region mysqlFunction start="encrypt(" end=")" contains=ALL
+syn region mysqlFunction start="exp(" end=")" contains=ALL
+syn region mysqlFunction start="export_set(" end=")" contains=ALL
+syn region mysqlFunction start="extract(" end=")" contains=ALL
+syn region mysqlFunction start="field(" end=")" contains=ALL
+syn region mysqlFunction start="find_in_set(" end=")" contains=ALL
+syn region mysqlFunction start="floor(" end=")" contains=ALL
+syn region mysqlFunction start="format(" end=")" contains=ALL
+syn region mysqlFunction start="from_days(" end=")" contains=ALL
+syn region mysqlFunction start="from_unixtime(" end=")" contains=ALL
+syn region mysqlFunction start="get_lock(" end=")" contains=ALL
+syn region mysqlFunction start="greatest(" end=")" contains=ALL
+syn region mysqlFunction start="group_unique_users(" end=")" contains=ALL
+syn region mysqlFunction start="hex(" end=")" contains=ALL
+syn region mysqlFunction start="inet_aton(" end=")" contains=ALL
+syn region mysqlFunction start="inet_ntoa(" end=")" contains=ALL
+syn region mysqlFunction start="instr(" end=")" contains=ALL
+syn region mysqlFunction start="lcase(" end=")" contains=ALL
+syn region mysqlFunction start="least(" end=")" contains=ALL
+syn region mysqlFunction start="length(" end=")" contains=ALL
+syn region mysqlFunction start="load_file(" end=")" contains=ALL
+syn region mysqlFunction start="locate(" end=")" contains=ALL
+syn region mysqlFunction start="log(" end=")" contains=ALL
+syn region mysqlFunction start="log10(" end=")" contains=ALL
+syn region mysqlFunction start="lower(" end=")" contains=ALL
+syn region mysqlFunction start="lpad(" end=")" contains=ALL
+syn region mysqlFunction start="ltrim(" end=")" contains=ALL
+syn region mysqlFunction start="make_set(" end=")" contains=ALL
+syn region mysqlFunction start="master_pos_wait(" end=")" contains=ALL
+syn region mysqlFunction start="max(" end=")" contains=ALL
+syn region mysqlFunction start="md5(" end=")" contains=ALL
+syn region mysqlFunction start="mid(" end=")" contains=ALL
+syn region mysqlFunction start="min(" end=")" contains=ALL
+syn region mysqlFunction start="mod(" end=")" contains=ALL
+syn region mysqlFunction start="monthname(" end=")" contains=ALL
+syn region mysqlFunction start="now(" end=")" contains=ALL
+syn region mysqlFunction start="oct(" end=")" contains=ALL
+syn region mysqlFunction start="octet_length(" end=")" contains=ALL
+syn region mysqlFunction start="ord(" end=")" contains=ALL
+syn region mysqlFunction start="period_add(" end=")" contains=ALL
+syn region mysqlFunction start="period_diff(" end=")" contains=ALL
+syn region mysqlFunction start="pi(" end=")" contains=ALL
+syn region mysqlFunction start="position(" end=")" contains=ALL
+syn region mysqlFunction start="pow(" end=")" contains=ALL
+syn region mysqlFunction start="power(" end=")" contains=ALL
+syn region mysqlFunction start="quarter(" end=")" contains=ALL
+syn region mysqlFunction start="radians(" end=")" contains=ALL
+syn region mysqlFunction start="rand(" end=")" contains=ALL
+syn region mysqlFunction start="release_lock(" end=")" contains=ALL
+syn region mysqlFunction start="repeat(" end=")" contains=ALL
+syn region mysqlFunction start="reverse(" end=")" contains=ALL
+syn region mysqlFunction start="round(" end=")" contains=ALL
+syn region mysqlFunction start="rpad(" end=")" contains=ALL
+syn region mysqlFunction start="rtrim(" end=")" contains=ALL
+syn region mysqlFunction start="sec_to_time(" end=")" contains=ALL
+syn region mysqlFunction start="session_user(" end=")" contains=ALL
+syn region mysqlFunction start="sign(" end=")" contains=ALL
+syn region mysqlFunction start="sin(" end=")" contains=ALL
+syn region mysqlFunction start="soundex(" end=")" contains=ALL
+syn region mysqlFunction start="space(" end=")" contains=ALL
+syn region mysqlFunction start="sqrt(" end=")" contains=ALL
+syn region mysqlFunction start="std(" end=")" contains=ALL
+syn region mysqlFunction start="stddev(" end=")" contains=ALL
+syn region mysqlFunction start="strcmp(" end=")" contains=ALL
+syn region mysqlFunction start="subdate(" end=")" contains=ALL
+syn region mysqlFunction start="substring(" end=")" contains=ALL
+syn region mysqlFunction start="substring_index(" end=")" contains=ALL
+syn region mysqlFunction start="sum(" end=")" contains=ALL
+syn region mysqlFunction start="sysdate(" end=")" contains=ALL
+syn region mysqlFunction start="system_user(" end=")" contains=ALL
+syn region mysqlFunction start="tan(" end=")" contains=ALL
+syn region mysqlFunction start="time_format(" end=")" contains=ALL
+syn region mysqlFunction start="time_to_sec(" end=")" contains=ALL
+syn region mysqlFunction start="to_days(" end=")" contains=ALL
+syn region mysqlFunction start="trim(" end=")" contains=ALL
+syn region mysqlFunction start="ucase(" end=")" contains=ALL
+syn region mysqlFunction start="unique_users(" end=")" contains=ALL
+syn region mysqlFunction start="unix_timestamp(" end=")" contains=ALL
+syn region mysqlFunction start="upper(" end=")" contains=ALL
+syn region mysqlFunction start="user(" end=")" contains=ALL
+syn region mysqlFunction start="version(" end=")" contains=ALL
+syn region mysqlFunction start="week(" end=")" contains=ALL
+syn region mysqlFunction start="weekday(" end=")" contains=ALL
+syn region mysqlFunction start="yearweek(" end=")" contains=ALL
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_mysql_syn_inits")
+ if version < 508
+ let did_mysql_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink mysqlKeyword Statement
+ HiLink mysqlSpecial Special
+ HiLink mysqlString String
+ HiLink mysqlNumber Number
+ HiLink mysqlVariable Identifier
+ HiLink mysqlComment Comment
+ HiLink mysqlType Type
+ HiLink mysqlOperator Statement
+ HiLink mysqlFlow Statement
+ HiLink mysqlFunction Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "mysql"
+
diff --git a/runtime/syntax/named.vim b/runtime/syntax/named.vim
new file mode 100644
index 000000000..0918352f6
--- /dev/null
+++ b/runtime/syntax/named.vim
@@ -0,0 +1,234 @@
+" Vim syntax file
+" Language: BIND 8.x configuration file
+" Maintainer: glory hump <rnd@web-drive.ru>
+" Last change: Mon May 21 04:51:01 SAMST 2001
+" Filenames: named.conf
+" URL: http://rnd.web-drive.ru/vim/syntax/named.vim
+" $Id$
+"
+" NOTE
+" it was not widely tested, i just tried it on my simple
+" single-master-single-slave configuration. most syntax was borrowed
+" directly from "BIND Configuration File Guide" without testing.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+if version >= 600
+ setlocal iskeyword=.,-,48-58,A-Z,a-z,_
+else
+ set iskeyword=.,-,48-58,A-Z,a-z,_
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+" BIND configuration file
+
+syn match namedComment "//.*"
+syn region namedComment start="/\*" end="\*/"
+syn region namedString start=/"/ end=/"/ contained
+" --- omitted trailing semicolon FIXME
+syn match namedError /[^;{]$/
+
+" --- top-level keywords
+
+syn keyword namedInclude include nextgroup=namedString skipwhite
+syn keyword namedKeyword acl key nextgroup=namedIntIdent skipwhite
+syn keyword namedKeyword server nextgroup=namedIdentifier skipwhite
+syn keyword namedKeyword controls nextgroup=namedSection skipwhite
+syn keyword namedKeyword trusted-keys nextgroup=namedIntSection skipwhite
+syn keyword namedKeyword logging nextgroup=namedLogSection skipwhite
+syn keyword namedKeyword options nextgroup=namedOptSection skipwhite
+syn keyword namedKeyword zone nextgroup=namedZoneString skipwhite
+
+" --- Identifier: name of following { ... } Section
+syn match namedIdentifier contained /\k\+/ nextgroup=namedSection skipwhite
+" --- IntIdent: name of following IntSection
+syn match namedIntIdent contained /"\=\k\+"\=/ nextgroup=namedIntSection skipwhite
+
+" --- Section: { ... } clause
+syn region namedSection contained start=+{+ end=+};+ contains=namedSection,namedIntKeyword
+
+" --- IntSection: section that does not contain other sections
+syn region namedIntSection contained start=+{+ end=+}+ contains=namedIntKeyword,namedError
+
+" --- IntKeyword: keywords contained within `{ ... }' sections only
+" + these keywords are contained within `key' and `acl' sections
+syn keyword namedIntKeyword contained key algorithm
+syn keyword namedIntKeyword contained secret nextgroup=namedString skipwhite
+
+" + these keywords are contained within `server' section only
+syn keyword namedIntKeyword contained bogus support-ixfr nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedIntKeyword contained transfers nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedIntKeyword contained transfer-format
+syn keyword namedIntKeyword contained keys nextgroup=namedIntSection skipwhite
+
+" + these keywords are contained within `controls' section only
+syn keyword namedIntKeyword contained inet nextgroup=namedIPaddr,namedIPerror skipwhite
+syn keyword namedIntKeyword contained unix nextgroup=namedString skipwhite
+syn keyword namedIntKeyword contained port perm owner group nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedIntKeyword contained allow nextgroup=namedIntSection skipwhite
+
+" --- options
+syn region namedOptSection contained start=+{+ end=+};+ contains=namedOption,namedCNOption,namedComment,namedParenError
+
+syn keyword namedOption contained version directory
+\ nextgroup=namedString skipwhite
+syn keyword namedOption contained named-xfer dump-file pid-file
+\ nextgroup=namedString skipwhite
+syn keyword namedOption contained mem-statistics-file statistics-file
+\ nextgroup=namedString skipwhite
+syn keyword namedOption contained auth-nxdomain deallocate-on-exit
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained dialup fake-iquery fetch-glue
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained has-old-clients host-statistics
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained maintain-ixfr-base multiple-cnames
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained notify recursion rfc2308-type1
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained use-id-pool treat-cr-as-space
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedOption contained also-notify forwarders
+\ nextgroup=namedIntSection skipwhite
+syn keyword namedOption contained forward check-names
+syn keyword namedOption contained allow-query allow-transfer allow-recursion nextgroup=namedAML skipwhite
+syn keyword namedOption contained blackhole listen-on
+\ nextgroup=namedIntSection skipwhite
+syn keyword namedOption contained lame-ttl max-transfer-time-in
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedOption contained max-ncache-ttl min-roots
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedOption contained serial-queries transfers-in
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedOption contained transfers-out transfers-per-ns
+syn keyword namedOption contained transfer-format
+syn keyword namedOption contained transfer-source
+\ nextgroup=namedIPaddr,namedIPerror skipwhite
+syn keyword namedOption contained max-ixfr-log-size
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedOption contained coresize datasize files stacksize
+syn keyword namedOption contained cleaning-interval interface-interval statistics-interval heartbeat-interval
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedOption contained topology sortlist rrset-order
+\ nextgroup=namedIntSection skipwhite
+
+syn match namedOption contained /\<query-source\s\+.*;/he=s+12 contains=namedQSKeywords
+syn keyword namedQSKeywords contained address port
+syn match namedCNOption contained /\<check-names\s\+.*;/he=s+11 contains=namedCNKeywords
+syn keyword namedCNKeywords contained fail warn ignore master slave response
+
+" --- logging facilities
+syn region namedLogSection contained start=+{+ end=+};+ contains=namedLogOption
+syn keyword namedLogOption contained channel nextgroup=namedIntIdent skipwhite
+syn keyword namedLogOption contained category nextgroup=namedIntIdent skipwhite
+syn keyword namedIntKeyword contained syslog null versions size severity
+syn keyword namedIntKeyword contained file nextgroup=namedString skipwhite
+syn keyword namedIntKeyword contained print-category print-severity print-time nextgroup=namedBool,namedNotBool skipwhite
+
+" --- zone section
+syn region namedZoneString contained oneline start=+"+ end=+"+ skipwhite
+\ contains=namedDomain,namedIllegalDom
+\ nextgroup=namedZoneClass,namedZoneSection
+syn keyword namedZoneClass contained in hs hesiod chaos
+\ IN HS HESIOD CHAOS
+\ nextgroup=namedZoneSection skipwhite
+
+syn region namedZoneSection contained start=+{+ end=+};+ contains=namedZoneOpt,namedCNOption,namedComment,namedMasters,namedParenError
+syn keyword namedZoneOpt contained file ixfr-base
+\ nextgroup=namedString skipwhite
+syn keyword namedZoneOpt contained notify dialup
+\ nextgroup=namedBool,namedNotBool skipwhite
+syn keyword namedZoneOpt contained pubkey forward
+syn keyword namedZoneOpt contained max-transfer-time-in
+\ nextgroup=namedNumber,namedNotNumber skipwhite
+syn keyword namedZoneOpt contained type nextgroup=namedZoneType skipwhite
+syn keyword namedZoneType contained master slave stub forward hint
+
+syn keyword namedZoneOpt contained masters forwarders
+\ nextgroup=namedIPlist skipwhite
+syn region namedIPlist contained start=+{+ end=+};+ contains=namedIPaddr,namedIPerror,namedParenError,namedComment
+syn match namedZoneOpt contained "\<allow-\(update\|query\|transfer\)"
+\ nextgroup=namedAML skipwhite
+
+" --- boolean parameter
+syn match namedNotBool contained "[^ ;]\+"
+syn keyword namedBool contained yes no true false 1 0
+
+" --- number parameter
+syn match namedNotNumber contained "[^ 0-9;]\+"
+syn match namedNumber contained "\d\+"
+
+" --- address match list
+syn region namedAML contained start=+{+ end=+};+ contains=namedParenError,namedComment
+
+" --- IPs & Domains
+syn match namedIPaddr contained /\<[0-9]\{1,3}\(\.[0-9]\{1,3}\)\{3};/he=e-1
+syn match namedDomain contained /\<[0-9A-Za-z][-0-9A-Za-z.]\+\>/ nextgroup=namedSpareDot
+syn match namedDomain contained /"\."/ms=s+1,me=e-1
+syn match namedSpareDot contained /\./
+
+" --- syntax errors
+syn match namedIllegalDom contained /"\S*[^-A-Za-z0-9.[:space:]]\S*"/ms=s+1,me=e-1
+syn match namedIPerror contained /\<\S*[^0-9.[:space:];]\S*/
+syn match namedEParenError contained +{+
+syn match namedParenError +}\([^;]\|$\)+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_named_syn_inits")
+ if version < 508
+ let did_named_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink namedComment Comment
+ HiLink namedInclude Include
+ HiLink namedKeyword Keyword
+ HiLink namedIntKeyword Keyword
+ HiLink namedIdentifier Identifier
+ HiLink namedIntIdent Identifier
+
+ HiLink namedString String
+ HiLink namedBool Type
+ HiLink namedNotBool Error
+ HiLink namedNumber Number
+ HiLink namedNotNumber Error
+
+ HiLink namedOption namedKeyword
+ HiLink namedLogOption namedKeyword
+ HiLink namedCNOption namedKeyword
+ HiLink namedQSKeywords Type
+ HiLink namedCNKeywords Type
+ HiLink namedLogCategory Type
+ HiLink namedDomain Identifier
+ HiLink namedZoneOpt namedKeyword
+ HiLink namedZoneType Type
+ HiLink namedParenError Error
+ HiLink namedEParenError Error
+ HiLink namedIllegalDom Error
+ HiLink namedIPerror Error
+ HiLink namedSpareDot Error
+ HiLink namedError Error
+
+ delcommand HiLink
+endif
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+let b:current_syntax = "named"
+
+" vim: ts=17
diff --git a/runtime/syntax/nasm.vim b/runtime/syntax/nasm.vim
new file mode 100644
index 000000000..6bbf33a9c
--- /dev/null
+++ b/runtime/syntax/nasm.vim
@@ -0,0 +1,522 @@
+" Vim syntax file
+" Language: NASM - The Netwide Assembler (v0.98)
+" Maintainer: Manuel M.H. Stol <mmh.stol@gmx.net>
+" Last Change: 2003 May 11
+" Vim URL: http://www.vim.org/lang.html
+" NASM Home: http://www.cryogen.com/Nasm/
+
+
+
+" Setup Syntax:
+" Clear old syntax settings
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+" Assembler syntax is case insensetive
+syn case ignore
+
+
+
+" Vim search and movement commands on identifers
+if version < 600
+ " Comments at start of a line inside which to skip search for indentifiers
+ set comments=:;
+ " Identifier Keyword characters (defines \k)
+ set iskeyword=@,48-57,#,$,.,?,@-@,_,~
+else
+ " Comments at start of a line inside which to skip search for indentifiers
+ setlocal comments=:;
+ " Identifier Keyword characters (defines \k)
+ setlocal iskeyword=@,48-57,#,$,.,?,@-@,_,~
+endif
+
+
+
+" Comments:
+syn region nasmComment start=";" keepend end="$" contains=@nasmGrpInComments
+syn region nasmSpecialComment start=";\*\*\*" keepend end="$"
+syn keyword nasmInCommentTodo contained TODO FIXME XXX[XXXXX]
+syn cluster nasmGrpInComments contains=nasmInCommentTodo
+syn cluster nasmGrpComments contains=@nasmGrpInComments,nasmComment,nasmSpecialComment
+
+
+
+" Label Identifiers:
+" in NASM: 'Everything is a Label'
+" Definition Label = label defined by %[i]define or %[i]assign
+" Identifier Label = label defined as first non-keyword on a line or %[i]macro
+syn match nasmLabelError "$\=\(\d\+\K\|[#\.@]\|\$\$\k\)\k*\>"
+syn match nasmLabel "\<\(\h\|[?@]\)\k*\>"
+syn match nasmLabel "[\$\~]\(\h\|[?@]\)\k*\>"lc=1
+" Labels starting with one or two '.' are special
+syn match nasmLocalLabel "\<\.\(\w\|[#$?@~]\)\k*\>"
+syn match nasmLocalLabel "\<\$\.\(\w\|[#$?@~]\)\k*\>"ms=s+1
+if !exists("nasm_no_warn")
+ syn match nasmLabelWarn "\<\~\=\$\=[_\.][_\.\~]*\>"
+endif
+if exists("nasm_loose_syntax")
+ syn match nasmSpecialLabel "\<\.\.@\k\+\>"
+ syn match nasmSpecialLabel "\<\$\.\.@\k\+\>"ms=s+1
+ if !exists("nasm_no_warn")
+ syn match nasmLabelWarn "\<\$\=\.\.@\(\d\|[#$\.~]\)\k*\>"
+ endif
+ " disallow use of nasm internal label format
+ syn match nasmLabelError "\<\$\=\.\.@\d\+\.\k*\>"
+else
+ syn match nasmSpecialLabel "\<\.\.@\(\h\|[?@]\)\k*\>"
+ syn match nasmSpecialLabel "\<\$\.\.@\(\h\|[?@]\)\k*\>"ms=s+1
+endif
+" Labels can be dereferenced with '$' to destinguish them from reserved words
+syn match nasmLabelError "\<\$\K\k*\s*:"
+syn match nasmLabelError "^\s*\$\K\k*\>"
+syn match nasmLabelError "\<\~\s*\(\k*\s*:\|\$\=\.\k*\)"
+
+
+
+" Constants:
+syn match nasmStringError +["']+
+syn match nasmString +\("[^"]\{-}"\|'[^']\{-}'\)+
+syn match nasmBinNumber "\<[0-1]\+b\>"
+syn match nasmBinNumber "\<\~[0-1]\+b\>"lc=1
+syn match nasmOctNumber "\<\o\+q\>"
+syn match nasmOctNumber "\<\~\o\+q\>"lc=1
+syn match nasmDecNumber "\<\d\+\>"
+syn match nasmDecNumber "\<\~\d\+\>"lc=1
+syn match nasmHexNumber "\<\(\d\x*h\|0x\x\+\|\$\d\x*\)\>"
+syn match nasmHexNumber "\<\~\(\d\x*h\|0x\x\+\|\$\d\x*\)\>"lc=1
+syn match nasmFltNumber "\<\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
+syn keyword nasmFltNumber Inf Infinity Indefinite NaN SNaN QNaN
+syn match nasmNumberError "\<\~\s*\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
+
+
+
+" Netwide Assembler Storage Directives:
+" Storage types
+syn keyword nasmTypeError DF EXTRN FWORD RESF TBYTE
+syn keyword nasmType FAR NEAR SHORT
+syn keyword nasmType BYTE WORD DWORD QWORD DQWORD HWORD DHWORD TWORD
+syn keyword nasmType CDECL FASTCALL NONE PASCAL STDCALL
+syn keyword nasmStorage DB DW DD DQ DDQ DT
+syn keyword nasmStorage RESB RESW RESD RESQ RESDQ REST
+syn keyword nasmStorage EXTERN GLOBAL COMMON
+" Structured storage types
+syn match nasmTypeError "\<\(AT\|I\=\(END\)\=\(STRUCT\=\|UNION\)\|I\=END\)\>"
+syn match nasmStructureLabel contained "\<\(AT\|I\=\(END\)\=\(STRUCT\=\|UNION\)\|I\=END\)\>"
+" structures cannot be nested (yet) -> use: 'keepend' and 're='
+syn cluster nasmGrpCntnStruc contains=ALLBUT,@nasmGrpInComments,nasmMacroDef,@nasmGrpInMacros,@nasmGrpInPreCondits,nasmStructureDef,@nasmGrpInStrucs
+syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*STRUCT\>"hs=e-5 end="^\s*ENDSTRUCT\>"re=e-9 contains=@nasmGrpCntnStruc
+syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*STRUC\>"hs=e-4 end="^\s*ENDSTRUC\>"re=e-8 contains=@nasmGrpCntnStruc
+syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnStruc,nasmInStructure
+" union types are not part of nasm (yet)
+"syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnStruc
+"syn region nasmStructureDef transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnStruc,nasmInStructure
+syn match nasmInStructure contained "^\s*AT\>"hs=e-1
+syn cluster nasmGrpInStrucs contains=nasmStructure,nasmInStructure,nasmStructureLabel
+
+
+
+" PreProcessor Instructions:
+" NAsm PreProcs start with %, but % is not a character
+syn match nasmPreProcError "%{\=\(%\=\k\+\|%%\+\k*\|[+-]\=\d\+\)}\="
+if exists("nasm_loose_syntax")
+ syn cluster nasmGrpNxtCtx contains=nasmStructureLabel,nasmLabel,nasmLocalLabel,nasmSpecialLabel,nasmLabelError,nasmPreProcError
+else
+ syn cluster nasmGrpNxtCtx contains=nasmStructureLabel,nasmLabel,nasmLabelError,nasmPreProcError
+endif
+
+" Multi-line macro
+syn cluster nasmGrpCntnMacro contains=ALLBUT,@nasmGrpInComments,nasmStructureDef,@nasmGrpInStrucs,nasmMacroDef,@nasmGrpPreCondits,nasmMemReference,nasmInMacPreCondit,nasmInMacStrucDef
+syn region nasmMacroDef matchgroup=nasmMacro keepend start="^\s*%macro\>"hs=e-5 start="^\s*%imacro\>"hs=e-6 end="^\s*%endmacro\>"re=e-9 contains=@nasmGrpCntnMacro,nasmInMacStrucDef
+if exists("nasm_loose_syntax")
+ syn match nasmInMacLabel contained "%\(%\k\+\>\|{%\k\+}\)"
+ syn match nasmInMacLabel contained "%\($\+\(\w\|[#\.?@~]\)\k*\>\|{$\+\(\w\|[#\.?@~]\)\k*}\)"
+ syn match nasmInMacPreProc contained "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=nasmStructureLabel,nasmLabel,nasmInMacParam,nasmLocalLabel,nasmSpecialLabel,nasmLabelError,nasmPreProcError
+ if !exists("nasm_no_warn")
+ syn match nasmInMacLblWarn contained "%\(%[$\.]\k*\>\|{%[$\.]\k*}\)"
+ syn match nasmInMacLblWarn contained "%\($\+\(\d\|[#\.@~]\)\k*\|{\$\+\(\d\|[#\.@~]\)\k*}\)"
+ hi link nasmInMacCatLabel nasmInMacLblWarn
+ else
+ hi link nasmInMacCatLabel nasmInMacLabel
+ endif
+else
+ syn match nasmInMacLabel contained "%\(%\(\w\|[#?@~]\)\k*\>\|{%\(\w\|[#?@~]\)\k*}\)"
+ syn match nasmInMacLabel contained "%\($\+\(\h\|[?@]\)\k*\>\|{$\+\(\h\|[?@]\)\k*}\)"
+ hi link nasmInMacCatLabel nasmLabelError
+endif
+syn match nasmInMacCatLabel contained "\d\K\k*"lc=1
+syn match nasmInMacLabel contained "\d}\k\+"lc=2
+if !exists("nasm_no_warn")
+ syn match nasmInMacLblWarn contained "%\(\($\+\|%\)[_~][._~]*\>\|{\($\+\|%\)[_~][._~]*}\)"
+endif
+syn match nasmInMacPreProc contained "^\s*%pop\>"hs=e-3
+syn match nasmInMacPreProc contained "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=@nasmGrpNxtCtx
+" structures cannot be nested (yet) -> use: 'keepend' and 're='
+syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*STRUCT\>"hs=e-5 end="^\s*ENDSTRUCT\>"re=e-9 contains=@nasmGrpCntnMacro
+syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*STRUC\>"hs=e-4 end="^\s*ENDSTRUC\>"re=e-8 contains=@nasmGrpCntnMacro
+syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<ISTRUCT\=\>" end="\<IEND\(STRUCT\=\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
+" union types are not part of nasm (yet)
+"syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="^\s*UNION\>"hs=e-4 end="^\s*ENDUNION\>"re=e-8 contains=@nasmGrpCntnMacro
+"syn region nasmInMacStrucDef contained transparent matchgroup=nasmStructure keepend start="\<IUNION\>" end="\<IEND\(UNION\)\=\>" contains=@nasmGrpCntnMacro,nasmInStructure
+syn region nasmInMacPreConDef contained transparent matchgroup=nasmInMacPreCondit start="^\s*%ifnidni\>"hs=e-7 start="^\s*%if\(idni\|n\(ctx\|def\|idn\|num\|str\)\)\>"hs=e-6 start="^\s*%if\(ctx\|def\|idn\|nid\|num\|str\)\>"hs=e-5 start="^\s*%ifid\>"hs=e-4 start="^\s*%if\>"hs=e-2 end="%endif\>" contains=@nasmGrpCntnMacro,nasmInMacPreCondit,nasmInPreCondit
+syn match nasmInMacPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx
+syn match nasmInMacPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx
+syn match nasmInMacPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx
+syn match nasmInMacParamNum contained "\<\d\+\.list\>"me=e-5
+syn match nasmInMacParamNum contained "\<\d\+\.nolist\>"me=e-7
+syn match nasmInMacDirective contained "\.\(no\)\=list\>"
+syn match nasmInMacMacro contained transparent "macro\s"lc=5 skipwhite nextgroup=nasmStructureLabel
+syn match nasmInMacMacro contained "^\s*%rotate\>"hs=e-6
+syn match nasmInMacParam contained "%\([+-]\=\d\+\|{[+-]\=\d\+}\)"
+" nasm conditional macro operands/arguments
+" Todo: check feasebility; add too nasmGrpInMacros, etc.
+"syn match nasmInMacCond contained "\<\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"
+syn cluster nasmGrpInMacros contains=nasmMacro,nasmInMacMacro,nasmInMacParam,nasmInMacParamNum,nasmInMacDirective,nasmInMacLabel,nasmInMacLblWarn,nasmInMacMemRef,nasmInMacPreConDef,nasmInMacPreCondit,nasmInMacPreProc,nasmInMacStrucDef
+
+" Context pre-procs that are better used inside a macro
+if exists("nasm_ctx_outside_macro")
+ syn region nasmPreConditDef transparent matchgroup=nasmCtxPreCondit start="^\s*%ifnctx\>"hs=e-6 start="^\s*%ifctx\>"hs=e-5 end="%endif\>" contains=@nasmGrpCntnPreCon
+ syn match nasmCtxPreProc "^\s*%pop\>"hs=e-3
+ if exists("nasm_loose_syntax")
+ syn match nasmCtxLocLabel "%$\+\(\w\|[#\.?@~]\)\k*\>"
+ else
+ syn match nasmCtxLocLabel "%$\+\(\h\|[?@]\)\k*\>"
+ endif
+ syn match nasmCtxPreProc "^\s*%\(push\|repl\)\>"hs=e-4 skipwhite nextgroup=@nasmGrpNxtCtx
+ syn match nasmCtxPreCondit contained transparent "ctx\s"lc=3 skipwhite nextgroup=@nasmGrpNxtCtx
+ syn match nasmCtxPreCondit contained "^\s*%elifctx\>"hs=e-7 skipwhite nextgroup=@nasmGrpNxtCtx
+ syn match nasmCtxPreCondit contained "^\s*%elifnctx\>"hs=e-8 skipwhite nextgroup=@nasmGrpNxtCtx
+ if exists("nasm_no_warn")
+ hi link nasmCtxPreCondit nasmPreCondit
+ hi link nasmCtxPreProc nasmPreProc
+ hi link nasmCtxLocLabel nasmLocalLabel
+ else
+ hi link nasmCtxPreCondit nasmPreProcWarn
+ hi link nasmCtxPreProc nasmPreProcWarn
+ hi link nasmCtxLocLabel nasmLabelWarn
+ endif
+endif
+
+" Conditional assembly
+syn cluster nasmGrpCntnPreCon contains=ALLBUT,@nasmGrpInComments,@nasmGrpInMacros,@nasmGrpInStrucs
+syn region nasmPreConditDef transparent matchgroup=nasmPreCondit start="^\s*%ifnidni\>"hs=e-7 start="^\s*%if\(idni\|n\(def\|idn\|num\|str\)\)\>"hs=e-6 start="^\s*%if\(def\|idn\|nid\|num\|str\)\>"hs=e-5 start="^\s*%ifid\>"hs=e-4 start="^\s*%if\>"hs=e-2 end="%endif\>" contains=@nasmGrpCntnPreCon
+syn match nasmInPreCondit contained "^\s*%el\(if\|se\)\>"hs=e-4
+syn match nasmInPreCondit contained "^\s*%elifid\>"hs=e-6
+syn match nasmInPreCondit contained "^\s*%elif\(def\|idn\|nid\|num\|str\)\>"hs=e-7
+syn match nasmInPreCondit contained "^\s*%elif\(n\(def\|idn\|num\|str\)\|idni\)\>"hs=e-8
+syn match nasmInPreCondit contained "^\s*%elifnidni\>"hs=e-9
+syn cluster nasmGrpInPreCondits contains=nasmPreCondit,nasmInPreCondit,nasmCtxPreCondit
+syn cluster nasmGrpPreCondits contains=nasmPreConditDef,@nasmGrpInPreCondits,nasmCtxPreProc,nasmCtxLocLabel
+
+" Other pre-processor statements
+syn match nasmPreProc "^\s*%rep\>"hs=e-3
+syn match nasmPreProc "^\s*%line\>"hs=e-4
+syn match nasmPreProc "^\s*%\(clear\|error\)\>"hs=e-5
+syn match nasmPreProc "^\s*%endrep\>"hs=e-6
+syn match nasmPreProc "^\s*%exitrep\>"hs=e-7
+syn match nasmDefine "^\s*%undef\>"hs=e-5
+syn match nasmDefine "^\s*%\(assign\|define\)\>"hs=e-6
+syn match nasmDefine "^\s*%i\(assign\|define\)\>"hs=e-7
+syn match nasmInclude "^\s*%include\>"hs=e-7
+
+" Multiple pre-processor instructions on single line detection (obsolete)
+"syn match nasmPreProcError +^\s*\([^\t "%';][^"%';]*\|[^\t "';][^"%';]\+\)%\a\+\>+
+syn cluster nasmGrpPreProcs contains=nasmMacroDef,@nasmGrpInMacros,@nasmGrpPreCondits,nasmPreProc,nasmDefine,nasmInclude,nasmPreProcWarn,nasmPreProcError
+
+
+
+" Register Identifiers:
+" Register operands:
+syn match nasmGen08Register "\<[A-D][HL]\>"
+syn match nasmGen16Register "\<\([A-D]X\|[DS]I\|[BS]P\)\>"
+syn match nasmGen32Register "\<E\([A-D]X\|[DS]I\|[BS]P\)\>"
+syn match nasmSegRegister "\<[C-GS]S\>"
+syn match nasmSpcRegister "\<E\=IP\>"
+syn match nasmFpuRegister "\<ST\o\>"
+syn match nasmMmxRegister "\<MM\o\>"
+syn match nasmSseRegister "\<XMM\o\>"
+syn match nasmCtrlRegister "\<CR\o\>"
+syn match nasmDebugRegister "\<DR\o\>"
+syn match nasmTestRegister "\<TR\o\>"
+syn match nasmRegisterError "\<\(CR[15-9]\|DR[4-58-9]\|TR[0-28-9]\)\>"
+syn match nasmRegisterError "\<X\=MM[8-9]\>"
+syn match nasmRegisterError "\<ST\((\d)\|[8-9]\>\)"
+syn match nasmRegisterError "\<E\([A-D][HL]\|[C-GS]S\)\>"
+" Memory reference operand (address):
+syn match nasmMemRefError "[\[\]]"
+syn cluster nasmGrpCntnMemRef contains=ALLBUT,@nasmGrpComments,@nasmGrpPreProcs,@nasmGrpInStrucs,nasmMemReference,nasmMemRefError
+syn match nasmInMacMemRef contained "\[[^;\[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmInMacLabel,nasmInMacLblWarn,nasmInMacParam
+syn match nasmMemReference "\[[^;\[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmCtxLocLabel
+
+
+
+" Netwide Assembler Directives:
+" Compilation constants
+syn keyword nasmConstant __BITS__ __DATE__ __FILE__ __FORMAT__ __LINE__
+syn keyword nasmConstant __NASM_MAJOR__ __NASM_MINOR__ __NASM_VERSION__
+syn keyword nasmConstant __TIME__
+" Instruction modifiers
+syn match nasmInstructnError "\<TO\>"
+syn match nasmInstrModifier "\(^\|:\)\s*[C-GS]S\>"ms=e-1
+syn keyword nasmInstrModifier A16 A32 O16 O32
+syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)\s\+TO\>"lc=5,ms=e-1
+" the 'to' keyword is not allowed for fpu-pop instructions (yet)
+"syn match nasmInstrModifier "\<F\(ADD\|MUL\|\(DIV\|SUB\)R\=\)P\s\+TO\>"lc=6,ms=e-1
+" NAsm directives
+syn keyword nasmRepeat TIMES
+syn keyword nasmDirective ALIGN[B] INCBIN EQU NOSPLIT SPLIT
+syn keyword nasmDirective ABSOLUTE BITS SECTION SEGMENT
+syn keyword nasmDirective ENDSECTION ENDSEGMENT
+syn keyword nasmDirective __SECT__
+" Macro created standard directives: (requires %include)
+syn case match
+syn keyword nasmStdDirective ENDPROC EPILOGUE LOCALS PROC PROLOGUE USES
+syn keyword nasmStdDirective ENDIF ELSE ELIF ELSIF IF
+"syn keyword nasmStdDirective BREAK CASE DEFAULT ENDSWITCH SWITCH
+"syn keyword nasmStdDirective CASE OF ENDCASE
+syn keyword nasmStdDirective DO ENDFOR ENDWHILE FOR REPEAT UNTIL WHILE EXIT
+syn case ignore
+" Format specific directives: (all formats)
+" (excluded: extension directives to section, global, common and extern)
+syn keyword nasmFmtDirective ORG
+syn keyword nasmFmtDirective EXPORT IMPORT GROUP UPPERCASE SEG WRT
+syn keyword nasmFmtDirective LIBRARY
+syn case match
+syn keyword nasmFmtDirective _GLOBAL_OFFSET_TABLE_ __GLOBAL_OFFSET_TABLE_
+syn keyword nasmFmtDirective ..start ..got ..gotoff ..gotpc ..plt ..sym
+syn case ignore
+
+
+
+" Standard Instructions:
+syn match nasmInstructnError "\<\(F\=CMOV\|SET\)N\=\a\{0,2}\>"
+syn keyword nasmInstructnError CMPS MOVS LCS LODS STOS XLAT
+syn match nasmStdInstruction "\<MOV\>"
+syn match nasmInstructnError "\<MOV\s[^,;[]*\<CS\>\s*[^:]"he=e-1
+syn match nasmStdInstruction "\<\(CMOV\|J\|SET\)\(N\=\([ABGL]E\=\|[CEOSZ]\)\|P[EO]\=\)\>"
+syn match nasmStdInstruction "\<POP\>"
+syn keyword nasmStdInstruction AAA AAD AAM AAS ADC ADD AND
+syn keyword nasmStdInstruction BOUND BSF BSR BSWAP BT[C] BTR BTS
+syn keyword nasmStdInstruction CALL CBW CDQ CLC CLD CMC CMP CMPSB CMPSD CMPSW
+syn keyword nasmStdInstruction CMPXCHG CMPXCHG8B CPUID CWD[E]
+syn keyword nasmStdInstruction DAA DAS DEC DIV ENTER
+syn keyword nasmStdInstruction IDIV IMUL INC INT[O] IRET[D] IRETW
+syn keyword nasmStdInstruction JCXZ JECXZ JMP
+syn keyword nasmStdInstruction LAHF LDS LEA LEAVE LES LFS LGS LODSB LODSD
+syn keyword nasmStdInstruction LODSW LOOP[E] LOOPNE LOOPNZ LOOPZ LSS
+syn keyword nasmStdInstruction MOVSB MOVSD MOVSW MOVSX MOVZX MUL NEG NOP NOT
+syn keyword nasmStdInstruction OR POPA[D] POPAW POPF[D] POPFW
+syn keyword nasmStdInstruction PUSH[AD] PUSHAW PUSHF[D] PUSHFW
+syn keyword nasmStdInstruction RCL RCR RETF RET[N] ROL ROR
+syn keyword nasmStdInstruction SAHF SAL SAR SBB SCASB SCASD SCASW
+syn keyword nasmStdInstruction SHL[D] SHR[D] STC STD STOSB STOSD STOSW SUB
+syn keyword nasmStdInstruction TEST XADD XCHG XLATB XOR
+
+
+" System Instructions: (usually privileged)
+" Verification of pointer parameters
+syn keyword nasmSysInstruction ARPL LAR LSL VERR VERW
+" Addressing descriptor tables
+syn keyword nasmSysInstruction LLDT SLDT LGDT SGDT
+" Multitasking
+syn keyword nasmSysInstruction LTR STR
+" Coprocessing and Multiprocessing (requires fpu and multiple cpu's resp.)
+syn keyword nasmSysInstruction CLTS LOCK WAIT
+" Input and Output
+syn keyword nasmInstructnError INS OUTS
+syn keyword nasmSysInstruction IN INSB INSW INSD OUT OUTSB OUTSB OUTSW OUTSD
+" Interrupt control
+syn keyword nasmSysInstruction CLI STI LIDT SIDT
+" System control
+syn match nasmSysInstruction "\<MOV\s[^;]\{-}\<CR\o\>"me=s+3
+syn keyword nasmSysInstruction HLT INVD LMSW
+syn keyword nasmSseInstruction PREFETCHT0 PREFETCHT1 PREFETCHT2 PREFETCHNTA
+syn keyword nasmSseInstruction RSM SFENCE SMSW SYSENTER SYSEXIT UD2 WBINVD
+" TLB (Translation Lookahead Buffer) testing
+syn match nasmSysInstruction "\<MOV\s[^;]\{-}\<TR\o\>"me=s+3
+syn keyword nasmSysInstruction INVLPG
+
+" Debugging Instructions: (privileged)
+syn match nasmDbgInstruction "\<MOV\s[^;]\{-}\<DR\o\>"me=s+3
+syn keyword nasmDbgInstruction INT1 INT3 RDMSR RDTSC RDPMC WRMSR
+
+
+" Floating Point Instructions: (requires FPU)
+syn match nasmFpuInstruction "\<FCMOVN\=\([AB]E\=\|[CEPUZ]\)\>"
+syn keyword nasmFpuInstruction F2XM1 FABS FADD[P] FBLD FBSTP
+syn keyword nasmFpuInstruction FCHS FCLEX FCOM[IP] FCOMP[P] FCOS
+syn keyword nasmFpuInstruction FDECSTP FDISI FDIV[P] FDIVR[P] FENI FFREE
+syn keyword nasmFpuInstruction FIADD FICOM[P] FIDIV[R] FILD
+syn keyword nasmFpuInstruction FIMUL FINCSTP FINIT FIST[P] FISUB[R]
+syn keyword nasmFpuInstruction FLD[1] FLDCW FLDENV FLDL2E FLDL2T FLDLG2
+syn keyword nasmFpuInstruction FLDLN2 FLDPI FLDZ FMUL[P]
+syn keyword nasmFpuInstruction FNCLEX FNDISI FNENI FNINIT FNOP FNSAVE
+syn keyword nasmFpuInstruction FNSTCW FNSTENV FNSTSW FNSTSW
+syn keyword nasmFpuInstruction FPATAN FPREM[1] FPTAN FRNDINT FRSTOR
+syn keyword nasmFpuInstruction FSAVE FSCALE FSETPM FSIN FSINCOS FSQRT
+syn keyword nasmFpuInstruction FSTCW FSTENV FST[P] FSTSW FSUB[P] FSUBR[P]
+syn keyword nasmFpuInstruction FTST FUCOM[IP] FUCOMP[P]
+syn keyword nasmFpuInstruction FXAM FXCH FXTRACT FYL2X FYL2XP1
+
+
+" Multi Media Xtension Packed Instructions: (requires MMX unit)
+" Standard MMX instructions: (requires MMX1 unit)
+syn match nasmInstructnError "\<P\(ADD\|SUB\)U\=S\=[DQ]\=\>"
+syn match nasmInstructnError "\<PCMP\a\{0,2}[BDWQ]\=\>"
+syn keyword nasmMmxInstruction EMMS MOVD MOVQ
+syn keyword nasmMmxInstruction PACKSSDW PACKSSWB PACKUSWB PADDB PADDD PADDW
+syn keyword nasmMmxInstruction PADDSB PADDSW PADDUSB PADDUSW PAND[N]
+syn keyword nasmMmxInstruction PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD PCMPGTW
+syn keyword nasmMmxInstruction PMACHRIW PMADDWD PMULHW PMULLW POR
+syn keyword nasmMmxInstruction PSLLD PSLLQ PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLW
+syn keyword nasmMmxInstruction PSUBB PSUBD PSUBW PSUBSB PSUBSW PSUBUSB PSUBUSW
+syn keyword nasmMmxInstruction PUNPCKHBW PUNPCKHDQ PUNPCKHWD
+syn keyword nasmMmxInstruction PUNPCKLBW PUNPCKLDQ PUNPCKLWD PXOR
+" Extended MMX instructions: (requires MMX2/SSE unit)
+syn keyword nasmMmxInstruction MASKMOVQ MOVNTQ
+syn keyword nasmMmxInstruction PAVGB PAVGW PEXTRW PINSRW PMAXSW PMAXUB
+syn keyword nasmMmxInstruction PMINSW PMINUB PMOVMSKB PMULHUW PSADBW PSHUFW
+
+
+" Streaming SIMD Extension Packed Instructions: (requires SSE unit)
+syn match nasmInstructnError "\<CMP\a\{1,5}[PS]S\>"
+syn match nasmSseInstruction "\<CMP\(N\=\(EQ\|L[ET]\)\|\(UN\)\=ORD\)\=[PS]S\>"
+syn keyword nasmSseInstruction ADDPS ADDSS ANDNPS ANDPS
+syn keyword nasmSseInstruction COMISS CVTPI2PS CVTPS2PI
+syn keyword nasmSseInstruction CVTSI2SS CVTSS2SI CVTTPS2PI CVTTSS2SI
+syn keyword nasmSseInstruction DIVPS DIVSS FXRSTOR FXSAVE LDMXCSR
+syn keyword nasmSseInstruction MAXPS MAXSS MINPS MINSS MOVAPS MOVHLPS MOVHPS
+syn keyword nasmSseInstruction MOVLHPS MOVLPS MOVMSKPS MOVNTPS MOVSS MOVUPS
+syn keyword nasmSseInstruction MULPS MULSS
+syn keyword nasmSseInstruction ORPS RCPPS RCPSS RSQRTPS RSQRTSS
+syn keyword nasmSseInstruction SHUFPS SQRTPS SQRTSS STMXCSR SUBPS SUBSS
+syn keyword nasmSseInstruction UCOMISS UNPCKHPS UNPCKLPS XORPS
+
+
+" Three Dimensional Now Packed Instructions: (requires 3DNow! unit)
+syn keyword nasmNowInstruction FEMMS PAVGUSB PF2ID PFACC PFADD PFCMPEQ PFCMPGE
+syn keyword nasmNowInstruction PFCMPGT PFMAX PFMIN PFMUL PFRCP PFRCPIT1
+syn keyword nasmNowInstruction PFRCPIT2 PFRSQIT1 PFRSQRT PFSUB[R] PI2FD
+syn keyword nasmNowInstruction PMULHRWA PREFETCH[W]
+
+
+" Vendor Specific Instructions:
+" Cyrix instructions (requires Cyrix processor)
+syn keyword nasmCrxInstruction PADDSIW PAVEB PDISTIB PMAGW PMULHRW[C] PMULHRIW
+syn keyword nasmCrxInstruction PMVGEZB PMVLZB PMVNZB PMVZB PSUBSIW
+syn keyword nasmCrxInstruction RDSHR RSDC RSLDT SMINT SMINTOLD SVDC SVLDT SVTS
+syn keyword nasmCrxInstruction WRSHR
+" AMD instructions (requires AMD processor)
+syn keyword nasmAmdInstruction SYSCALL SYSRET
+
+
+" Undocumented Instructions:
+syn match nasmUndInstruction "\<POP\s[^;]*\<CS\>"me=s+3
+syn keyword nasmUndInstruction CMPXCHG486 IBTS ICEBP INT01 INT03 LOADALL
+syn keyword nasmUndInstruction LOADALL286 LOADALL386 SALC SMI UD1 UMOV XBTS
+
+
+
+" Synchronize Syntax:
+syn sync clear
+syn sync minlines=50 "for multiple region nesting
+syn sync match nasmSync grouphere nasmMacroDef "^\s*%i\=macro\>"me=s-1
+syn sync match nasmSync grouphere NONE "^\s*%endmacro\>"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later : only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_nasm_syntax_inits")
+ if version < 508
+ let did_nasm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Sub Links:
+ HiLink nasmInMacDirective nasmDirective
+ HiLink nasmInMacLabel nasmLocalLabel
+ HiLink nasmInMacLblWarn nasmLabelWarn
+ HiLink nasmInMacMacro nasmMacro
+ HiLink nasmInMacParam nasmMacro
+ HiLink nasmInMacParamNum nasmDecNumber
+ HiLink nasmInMacPreCondit nasmPreCondit
+ HiLink nasmInMacPreProc nasmPreProc
+ HiLink nasmInPreCondit nasmPreCondit
+ HiLink nasmInStructure nasmStructure
+ HiLink nasmStructureLabel nasmStructure
+
+ " Comment Group:
+ HiLink nasmComment Comment
+ HiLink nasmSpecialComment SpecialComment
+ HiLink nasmInCommentTodo Todo
+
+ " Constant Group:
+ HiLink nasmString String
+ HiLink nasmStringError Error
+ HiLink nasmBinNumber Number
+ HiLink nasmOctNumber Number
+ HiLink nasmDecNumber Number
+ HiLink nasmHexNumber Number
+ HiLink nasmFltNumber Float
+ HiLink nasmNumberError Error
+
+ " Identifier Group:
+ HiLink nasmLabel Identifier
+ HiLink nasmLocalLabel Identifier
+ HiLink nasmSpecialLabel Special
+ HiLink nasmLabelError Error
+ HiLink nasmLabelWarn Todo
+
+ " PreProc Group:
+ HiLink nasmPreProc PreProc
+ HiLink nasmDefine Define
+ HiLink nasmInclude Include
+ HiLink nasmMacro Macro
+ HiLink nasmPreCondit PreCondit
+ HiLink nasmPreProcError Error
+ HiLink nasmPreProcWarn Todo
+
+ " Type Group:
+ HiLink nasmType Type
+ HiLink nasmStorage StorageClass
+ HiLink nasmStructure Structure
+ HiLink nasmTypeError Error
+
+ " Directive Group:
+ HiLink nasmConstant Constant
+ HiLink nasmInstrModifier Operator
+ HiLink nasmRepeat Repeat
+ HiLink nasmDirective Keyword
+ HiLink nasmStdDirective Operator
+ HiLink nasmFmtDirective Keyword
+
+ " Register Group:
+ HiLink nasmCtrlRegister Special
+ HiLink nasmDebugRegister Debug
+ HiLink nasmTestRegister Special
+ HiLink nasmRegisterError Error
+ HiLink nasmMemRefError Error
+
+ " Instruction Group:
+ HiLink nasmStdInstruction Statement
+ HiLink nasmSysInstruction Statement
+ HiLink nasmDbgInstruction Debug
+ HiLink nasmFpuInstruction Statement
+ HiLink nasmMmxInstruction Statement
+ HiLink nasmSseInstruction Statement
+ HiLink nasmNowInstruction Statement
+ HiLink nasmAmdInstruction Special
+ HiLink nasmCrxInstruction Special
+ HiLink nasmUndInstruction Todo
+ HiLink nasmInstructnError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "nasm"
+
+" vim:ts=8 sw=4
diff --git a/runtime/syntax/nastran.vim b/runtime/syntax/nastran.vim
new file mode 100644
index 000000000..f7927693f
--- /dev/null
+++ b/runtime/syntax/nastran.vim
@@ -0,0 +1,193 @@
+" Vim syntax file
+" Language: NASTRAN input/DMAP
+" Maintainer: Tom Kowalski <trk@schaefferas.com>
+" Last change: April 27, 2001
+" Thanks to the authors and maintainers of fortran.vim.
+" Since DMAP shares some traits with fortran, this syntax file
+" is based on the fortran.vim syntax file.
+"----------------------------------------------------------------------
+" Remove any old syntax stuff hanging around
+"syn clear
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+" DMAP is not case dependent
+syn case ignore
+"
+"--------------------DMAP SYNTAX---------------------------------------
+"
+" -------Executive Modules and Statements
+"
+syn keyword nastranDmapexecmod call dbview delete end equiv equivx exit
+syn keyword nastranDmapexecmod file message purge purgex return subdmap
+syn keyword nastranDmapType type
+syn keyword nastranDmapLabel go to goto
+syn keyword nastranDmapRepeat if else elseif endif then
+syn keyword nastranDmapRepeat do while
+syn region nastranDmapString start=+"+ end=+"+ oneline
+syn region nastranDmapString start=+'+ end=+'+ oneline
+" If you don't like initial tabs in dmap (or at all)
+"syn match nastranDmapIniTab "^\t.*$"
+"syn match nastranDmapTab "\t"
+
+" Any integer
+syn match nastranDmapNumber "-\=\<[0-9]\+\>"
+" floating point number, with dot, optional exponent
+syn match nastranDmapFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=\>"
+" floating point number, starting with a dot, optional exponent
+syn match nastranDmapFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=\>"
+" floating point number, without dot, with exponent
+syn match nastranDmapFloat "\<[0-9]\+[edED][-+]\=[0-9]\+\>"
+
+syn match nastranDmapLogical "\(true\|false\)"
+
+syn match nastranDmapPreCondit "^#define\>"
+syn match nastranDmapPreCondit "^#include\>"
+"
+" -------Comments may be contained in another line.
+"
+syn match nastranDmapComment "^[\$].*$"
+syn match nastranDmapComment "\$.*$"
+syn match nastranDmapComment "^[\$].*$" contained
+syn match nastranDmapComment "\$.*$" contained
+" Treat all past 72nd column as a comment. Do not work with tabs!
+" Breaks down when 72-73rd column is in another match (eg number or keyword)
+syn match nastranDmapComment "^.\{-72}.*$"lc=72 contained
+
+"
+" -------Utility Modules
+"
+syn keyword nastranDmapUtilmod append copy dbc dbdict dbdir dmin drms1
+syn keyword nastranDmapUtilmod dtiin eltprt ifp ifp1 inputt2 inputt4 lamx
+syn keyword nastranDmapUtilmod matgen matgpr matmod matpch matprn matprt
+syn keyword nastranDmapUtilmod modtrl mtrxin ofp output2 output4 param
+syn keyword nastranDmapUtilmod paraml paramr prtparam pvt scalar
+syn keyword nastranDmapUtilmod seqp setval tabedit tabprt tabpt vec vecplot
+syn keyword nastranDmapUtilmod xsort
+"
+" -------Matrix Modules
+"
+syn keyword nastranDmapMatmod add add5 cead dcmp decomp diagonal fbs merge
+syn keyword nastranDmapMatmod mpyad norm read reigl smpyad solve solvit
+syn keyword nastranDmapMatmod trnsp umerge umerge1 upartn dmiin partn
+syn region nastranDmapMatmod start=+^ *[Dd][Mm][Ii]+ end=+[\/]+
+"
+" -------Implicit Functions
+"
+syn keyword nastranDmapImplicit abs acos acosh andl asin asinh atan atan2
+syn keyword nastranDmapImplicit atanh atanh2 char clen clock cmplx concat1
+syn keyword nastranDmapImplicit concat2 concat3 conjg cos cosh dble diagoff
+syn keyword nastranDmapImplicit diagon dim dlablank dlxblank dprod eqvl exp
+syn keyword nastranDmapImplicit getdiag getsys ichar imag impl index indexstr
+syn keyword nastranDmapImplicit int itol leq lge lgt lle llt lne log log10
+syn keyword nastranDmapImplicit logx ltoi mcgetsys mcputsys max min mod neqvl
+syn keyword nastranDmapImplicit nint noop normal notl numeq numge numgt numle
+syn keyword nastranDmapImplicit numlt numne orl pi precison putdiag putsys
+syn keyword nastranDmapImplicit rand rdiagon real rtimtogo setcore sign sin
+syn keyword nastranDmapImplicit sinh sngl sprod sqrt substrin tan tanh
+syn keyword nastranDmapImplicit timetogo wlen xorl
+"
+"
+"--------------------INPUT FILE SYNTAX---------------------------------------
+"
+"
+" -------Nastran Statement
+"
+syn keyword nastranNastranCard nastran
+"
+" -------The File Management Section (FMS)
+"
+syn region nastranFMSCard start=+^ *[Aa][Cc][Qq][Uu][Ii]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Aa][Ss][Ss][Ii][Gg]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Cc][oO][Nn][Nn][Ee]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Cc][Ll][Ee]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Cc]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Dd][Ii][Rr]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Ff][Ii][Xx]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Aa]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Ll][Oo][Cc]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Ss][Ee][Tt]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Nn][Ll]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Bb][Uu][Pp][Dd]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Dd][Ee][Ff][Ii][Nn]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Ee][Nn][Dd][Jj][Oo]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Ee][Xx][Pp][Aa][Nn]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Ii][Nn][Ii][Tt]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Pp][Rr][Oo][Jj]+ end=+$+ oneline
+syn region nastranFMSCard start=+^ *[Rr][Ee][Ss][Tt]+ end=+$+ oneline
+syn match nastranDmapUtilmod "^ *[Rr][Ee][Ss][Tt][Aa].*,.*," contains=nastranDmapComment
+"
+" -------Executive Control Section
+"
+syn region nastranECSCard start=+^ *[Aa][Ll][Tt][Ee][Rr]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Aa][Pp][Pp]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Cc][Oo][Mm][Pp][Ii]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Dd][Ii][Aa][Gg] + end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ee][Cc][Hh][Oo]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ee][Nn][Dd][Aa][Ll]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ii][Dd]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ii][Nn][Cc][Ll][Uu]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ll][Ii][Nn][Kk]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Mm][Aa][Ll][Tt][Ee]+ end=+$+ oneline
+syn region nastranECSCard start=+^ *[Ss][Oo][Ll] + end=+$+ oneline
+syn region nastranECSCard start=+^ *[Tt][Ii][Mm][Ee]+ end=+$+ oneline
+"
+" -------Delimiters
+"
+syn match nastranDelimiter "[Cc][Ee][Nn][Dd]" contained
+syn match nastranDelimiter "[Bb][Ee][Gg][Ii][Nn]" contained
+syn match nastranDelimiter " *[Bb][Uu][Ll][Kk]" contained
+syn match nastranDelimiter "[Ee][Nn][Dd] *[dD][Aa][Tt][Aa]" contained
+"
+" -------Case Control section
+"
+syn region nastranCC start=+^ *[Cc][Ee][Nn][Dd]+ end=+^ *[Bb][Ee][Gg][Ii][Nn]+ contains=nastranDelimiter,nastranBulkData,nastranDmapComment
+
+"
+" -------Bulk Data section
+"
+syn region nastranBulkData start=+ *[Bb][Uu][Ll][Kk] *$+ end=+^ [Ee][Nn][Dd] *[Dd]+ contains=nastranDelimiter,nastranDmapComment
+"
+" -------The following cards may appear in multiple sections of the file
+"
+syn keyword nastranUtilCard ECHOON ECHOOFF INCLUDE PARAM
+
+
+if version >= 508 || !exists("did_nastran_syntax_inits")
+ if version < 508
+ let did_nastran_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi link <args>
+ endif
+ " The default methods for highlighting. Can be overridden later
+ HiLink nastranDmapexecmod Statement
+ HiLink nastranDmapType Type
+ HiLink nastranDmapPreCondit Error
+ HiLink nastranDmapUtilmod PreProc
+ HiLink nastranDmapMatmod nastranDmapUtilmod
+ HiLink nastranDmapString String
+ HiLink nastranDmapNumber Constant
+ HiLink nastranDmapFloat nastranDmapNumber
+ HiLink nastranDmapInitTab nastranDmapNumber
+ HiLink nastranDmapTab nastranDmapNumber
+ HiLink nastranDmapLogical nastranDmapExecmod
+ HiLink nastranDmapImplicit Identifier
+ HiLink nastranDmapComment Comment
+ HiLink nastranDmapRepeat nastranDmapexecmod
+ HiLink nastranNastranCard nastranDmapPreCondit
+ HiLink nastranECSCard nastranDmapUtilmod
+ HiLink nastranFMSCard nastranNastranCard
+ HiLink nastranCC nastranDmapexecmod
+ HiLink nastranDelimiter Special
+ HiLink nastranBulkData nastranDmapType
+ HiLink nastranUtilCard nastranDmapexecmod
+ delcommand HiLink
+endif
+
+let b:current_syntax = "nastran"
+
+"EOF vim: ts=8 noet tw=120 sw=8 sts=0
diff --git a/runtime/syntax/natural.vim b/runtime/syntax/natural.vim
new file mode 100644
index 000000000..f7f140f58
--- /dev/null
+++ b/runtime/syntax/natural.vim
@@ -0,0 +1,205 @@
+" Vim syntax file
+"
+" Language: NATURAL
+" Version: 2.0.26.17
+" Maintainer: Marko Leipert <vim@mleipert.de>
+" Last Changed: 2002-02-28 09:50:36
+" Support: http://www.winconsole.de/vim/syntax.html
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when this syntax file was already loaded
+if v:version < 600
+ syntax clear
+ set iskeyword+=-,*,#,+,_,/
+elseif exists("b:current_syntax")
+ finish
+else
+ setlocal iskeyword+=-,*,#,+,_,/
+endif
+
+" NATURAL is case insensitive
+syntax case ignore
+
+" preprocessor
+syn keyword naturalInclude include nextgroup=naturalObjName skipwhite
+
+" define data
+syn keyword naturalKeyword define data end-define
+syn keyword naturalKeyword independent global parameter local redefine view
+syn keyword naturalKeyword const[ant] init initial
+
+" loops
+syn keyword naturalLoop read end-read end-work find end-find histogram end-histogram
+syn keyword naturalLoop end-all sort end-sort sorted descending ascending
+syn keyword naturalRepeat repeat end-repeat while until for step end-for
+syn keyword naturalKeyword in file with field starting from ending at thru by isn where
+syn keyword naturalError on error end-error
+syn keyword naturalKeyword accept reject end-enddata number unique retain as release
+syn keyword naturalKeyword start end-start break end-break physical page top sequence
+syn keyword naturalKeyword end-toppage end-endpage end-endfile before processing
+syn keyword naturalKeyword end-before
+
+" conditionals
+syn keyword naturalConditional if then else end-if end-norec
+syn keyword naturalConditional decide end-decide value when condition none any
+
+" assignment / calculation
+syn keyword naturalKeyword reset assign move left right justified compress to into edited
+syn keyword naturalKeyword add subtract multiply divide compute name
+syn keyword naturalKeyword all giving remainder rounded leaving space
+syn keyword naturalKeyword examine full replace giving separate delimiter modified
+syn keyword naturalKeyword suspend identical suppress
+
+" program flow
+syn keyword naturalFlow callnat fetch return enter escape bottom top stack formatted
+syn keyword naturalFlow command call
+syn keyword naturalflow end-subroutine routine
+
+" file operations
+syn keyword naturalKeyword update store get delete end transaction work once close
+
+" other keywords
+syn keyword naturalKeyword first every of no record[s] found ignore immediate
+syn keyword naturalKeyword set settime key control stop terminate
+
+" in-/output
+syn keyword naturalKeyword write display input reinput notitle nohdr map newpage mark
+syn keyword naturalKeyword alarm text help eject index
+syn keyword naturalKeyword format printer skip lines
+
+" functions
+syn keyword naturalKeyword abs atn cos exp frac int log sgn sin sqrt tan val old
+
+" report mode keywords
+syn keyword naturalRMKeyword same loop obtain indexed do doend
+
+" Subroutine name
+syn keyword naturalFlow perform subroutine nextgroup=naturalFunction skipwhite
+syn match naturalFunction "\<[a-z][-_a-z0-9]*\>"
+
+syn keyword naturalFlow using nextgroup=naturalKeyword,naturalObjName skipwhite
+syn match naturalObjName "\<[a-z][-_a-z0-9]\{,7}\>"
+
+" Labels
+syn match naturalLabel "\<[+#a-z][-_#a-z0-9]*\."
+syn match naturalRef "\<[+#a-z][-_#a-z0-9]*\>\.\<[+#a-z][*]\=[-_#a-z0-9]*\>"
+
+" System variables
+syn match naturalSysVar "\<\*[a-z][-a-z0-9]*\>"
+
+"integer number, or floating point number without a dot.
+syn match naturalNumber "\<-\=\d\+\>"
+"floating point number, with dot
+syn match naturalNumber "\<-\=\d\+\.\d\+\>"
+"floating point number, starting with a dot
+syn match naturalNumber "\.\d\+"
+
+" Formats in write statement
+syn match naturalFormat "\<\d\+[TX]\>"
+
+" String and Character contstants
+syn match naturalString "H'\x\+'"
+syn region naturalString start=+"+ end=+"+
+syn region naturalString start=+'+ end=+'+
+
+" Type definition
+syn match naturalAttribute "\<[-a-z][a-z]=[-a-z0-9_\.,]\+\>"
+syn match naturalType contained "\<[ABINP]\d\+\(,\d\+\)\=\>"
+syn match naturalType contained "\<[CL]\>"
+
+" "TODO" / other comments
+syn keyword naturalTodo contained todo test
+syn match naturalCommentMark contained "[a-z][^ \t/:|]*\(\s[^ \t/:'"|]\+\)*:\s"he=e-1
+
+" comments
+syn region naturalComment start="/\*" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark
+syn region naturalComment start="^\*[\ \*]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark
+syn region naturalComment start="^\d\{4} \*[\ \*]"lc=5 end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark
+syn match naturalComment "^*$"
+syn match naturalComment "^\d\{4} \*$"lc=5
+" /* is legal syntax in parentheses e.g. "#ident(label./*)"
+syn region naturalPComment contained start="/\*\s*[^),]" end="$" contains=naturalTodo,naturalLineRef,naturalCommentMark
+
+" operators
+syn keyword naturalOperator and or not eq ne gt lt ge le mask scan
+
+" constants
+syn keyword naturalBoolean true false
+
+syn match naturalLineNo "^\d\{4}"
+
+" identifiers
+syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*\>[^\.']"me=e-1
+syn match naturalIdent "\<[+#a-z][-_#a-z0-9]*$"
+syn match naturalLegalIdent "[+#a-z][-_#a-z0-9]*/[-_#a-z0-9]*"
+
+" parentheses
+syn region naturalPar matchgroup=naturalParGui start="(" end=")" contains=naturalLabel,naturalRef,naturalOperator,@naturalConstant,naturalType,naturalSysVar,naturalPar,naturalLineNo,naturalPComment
+syn match naturalLineRef "(\d\{4})"
+
+" build syntax groups
+syntax cluster naturalConstant contains=naturalString,naturalNumber,naturalAttribute,naturalBoolean
+
+" folding
+if v:version >= 600
+ set foldignore=*
+endif
+
+
+if v:version >= 508 || !exists("did_natural_syntax_inits")
+ if v:version < 508
+ let did_natural_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ " The default methods for highlighting. Can be overridden later
+
+ " Constants
+ HiLink naturalFormat Constant
+ HiLink naturalAttribute Constant
+ HiLink naturalNumber Number
+ HiLink naturalString String
+ HiLink naturalBoolean Boolean
+
+ " All kinds of keywords
+ HiLink naturalConditional Conditional
+ HiLink naturalRepeat Repeat
+ HiLink naturalLoop Repeat
+ HiLink naturalFlow Keyword
+ HiLink naturalError Keyword
+ HiLink naturalKeyword Keyword
+ HiLink naturalOperator Operator
+ HiLink naturalParGui Operator
+
+ " Labels
+ HiLink naturalLabel Label
+ HiLink naturalRefLabel Label
+
+ " Comments
+ HiLink naturalPComment Comment
+ HiLink naturalComment Comment
+ HiLink naturalTodo Todo
+ HiLink naturalCommentMark PreProc
+
+ HiLink naturalInclude Include
+ HiLink naturalSysVar Identifier
+ HiLink naturalLineNo LineNr
+ HiLink naturalLineRef Error
+ HiLink naturalSpecial Special
+ HiLink naturalComKey Todo
+
+ " illegal things
+ HiLink naturalRMKeyword Error
+ HiLink naturalLegalIdent Error
+
+ HiLink naturalType Type
+ HiLink naturalFunction Function
+ HiLink naturalObjName Function
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "natural"
+
+" vim:set ts=4 sw=4 noet ft=vim list:
diff --git a/runtime/syntax/ncf.vim b/runtime/syntax/ncf.vim
new file mode 100644
index 000000000..15c74c8fa
--- /dev/null
+++ b/runtime/syntax/ncf.vim
@@ -0,0 +1,258 @@
+" Vim syntax file
+" Language: Novell "NCF" Batch File
+" Maintainer: Jonathan J. Miner <miner@doit.wisc.edu>
+" Last Change: Tue, 04 Sep 2001 16:20:33 CDT
+" $Id$
+
+" Remove any old syntax stuff hanging around
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn keyword ncfCommands mount load unload
+syn keyword ncfBoolean on off
+syn keyword ncfCommands set nextgroup=ncfSetCommands
+syn keyword ncfTimeTypes Reference Primary Secondary Single
+syn match ncfLoad "\(unl\|l\)oad .*"lc=4 contains=ALLBUT,Error
+syn match ncfMount "mount .*"lc=5 contains=ALLBUT,Error
+
+syn match ncfComment "^\ *rem.*$"
+syn match ncfComment "^\ *;.*$"
+syn match ncfComment "^\ *#.*$"
+
+syn match ncfSearchPath "search \(add\|del\) " nextgroup=ncfPath
+syn match ncfPath "\<[^: ]\+:\([A-Za-z0-9._]\|\\\)*\>"
+syn match ncfServerName "^file server name .*$"
+syn match ncfIPXNet "^ipx internal net"
+
+" String
+syn region ncfString start=+"+ end=+"+
+syn match ncfContString "= \(\(\.\{0,1}\(OU=\|O=\)\{0,1}[A-Z_]\+\)\+;\{0,1}\)\+"lc=2
+
+syn match ncfHexNumber "\<\d\(\d\+\|[A-F]\+\)*\>"
+syn match ncfNumber "\<\d\+\.\{0,1}\d*\>"
+syn match ncfIPAddr "\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}"
+syn match ncfTime "\(+|=\)\{0,1}\d\{1,2}:\d\{1,2}:\d\{1,2}"
+syn match ncfDSTTime "([^ ]\+ [^ ]\+ \(FIRST\|LAST\)\s*\d\{1,2}:\d\{1,2}:\d\{1,2} \(AM\|PM\))"
+syn match ncfTimeZone "[A-Z]\{3}\d[A-Z]\{3}"
+
+syn match ncfLogins "^\([Dd]is\|[Ee]n\)able login[s]*"
+syn match ncfScript "[^ ]*\.ncf"
+
+" SET Commands that take a Number following
+syn match ncfSetCommandsNum "\(Alert Message Nodes\)\s*="
+syn match ncfSetCommandsNum "\(Auto Restart After Abend\)\s*="
+syn match ncfSetCommandsNum "\(Auto Restart After Abend Delay Time\)\s*="
+syn match ncfSetCommandsNum "\(Compression Daily Check Starting Hour\)\s*="
+syn match ncfSetCommandsNum "\(Compression Daily Check Stop Hour\)\s*="
+syn match ncfSetCommandsNum "\(Concurrent Remirror Requests\)\s*="
+syn match ncfSetCommandsNum "\(Convert Compressed to Uncompressed Option\)\s*="
+syn match ncfSetCommandsNum "\(Days Untouched Before Compression\)\s*="
+syn match ncfSetCommandsNum "\(Decompress Free Space Warning Interval\)\s*="
+syn match ncfSetCommandsNum "\(Decompress Percent Disk Space Free to Allow Commit\)\s*="
+syn match ncfSetCommandsNum "\(Deleted Files Compression Option\)\s*="
+syn match ncfSetCommandsNum "\(Directory Cache Allocation Wait Time\)\s*="
+syn match ncfSetCommandsNum "\(Enable IPX Checksums\)\s*="
+syn match ncfSetCommandsNum "\(Garbage Collection Interval\)\s*="
+syn match ncfSetCommandsNum "\(IPX NetBIOS Replication Option\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Concurrent Compressions\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Concurrent Directory Cache Writes\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Concurrent Disk Cache Writes\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Directory Cache Buffers\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Extended Attributes per File or Path\)\s*="
+syn match ncfSetCommandsNum "\(Maximum File Locks\)\s*="
+syn match ncfSetCommandsNum "\(Maximum File Locks Per Connection\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Interrupt Events\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Number of Directory Handles\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Number of Internal Directory Handles\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Outstanding NCP Searches\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Packet Receive Buffers\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Physical Receive Packet Size\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Record Locks\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Record Locks Per Connection\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Service Processes\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Subdirectory Tree Depth\)\s*="
+syn match ncfSetCommandsNum "\(Maximum Transactions\)\s*="
+syn match ncfSetCommandsNum "\(Minimum Compression Percentage Gain\)\s*="
+syn match ncfSetCommandsNum "\(Minimum Directory Cache Buffers\)\s*="
+syn match ncfSetCommandsNum "\(Minimum File Cache Buffers\)\s*="
+syn match ncfSetCommandsNum "\(Minimum File Cache Report Threshold\)\s*="
+syn match ncfSetCommandsNum "\(Minimum Free Memory for Garbage Collection\)\s*="
+syn match ncfSetCommandsNum "\(Minimum Packet Receive Buffers\)\s*="
+syn match ncfSetCommandsNum "\(Minimum Service Processes\)\s*="
+syn match ncfSetCommandsNum "\(NCP Packet Signature Option\)\s*="
+syn match ncfSetCommandsNum "\(NDS Backlink Interval\)\s*="
+syn match ncfSetCommandsNum "\(NDS Client NCP Retries\)\s*="
+syn match ncfSetCommandsNum "\(NDS External Reference Life Span\)\s*="
+syn match ncfSetCommandsNum "\(NDS Inactivity Synchronization Interval\)\s*="
+syn match ncfSetCommandsNum "\(NDS Janitor Interval\)\s*="
+syn match ncfSetCommandsNum "\(New Service Process Wait Time\)\s*="
+syn match ncfSetCommandsNum "\(Number of Frees for Garbage Collection\)\s*="
+syn match ncfSetCommandsNum "\(Number of Watchdog Packets\)\s*="
+syn match ncfSetCommandsNum "\(Pseudo Preemption Count\)\s*="
+syn match ncfSetCommandsNum "\(Read Ahead LRU Sitting Time Threshold\)\s*="
+syn match ncfSetCommandsNum "\(Remirror Block Size\)\s*="
+syn match ncfSetCommandsNum "\(Reserved Buffers Below 16 Meg\)\s*="
+syn match ncfSetCommandsNum "\(Server Log File Overflow Size\)\s*="
+syn match ncfSetCommandsNum "\(Server Log File State\)\s*="
+syn match ncfSetCommandsNum "\(SMP Polling Count\)\s*="
+syn match ncfSetCommandsNum "\(SMP Stack Size\)\s*="
+syn match ncfSetCommandsNum "\(TIMESYNC Polling Count\)\s*="
+syn match ncfSetCommandsNum "\(TIMESYNC Polling Interval\)\s*="
+syn match ncfSetCommandsNum "\(TIMESYNC Synchronization Radius\)\s*="
+syn match ncfSetCommandsNum "\(TIMESYNC Write Value\)\s*="
+syn match ncfSetCommandsNum "\(Volume Log File Overflow Size\)\s*="
+syn match ncfSetCommandsNum "\(Volume Log File State\)\s*="
+syn match ncfSetCommandsNum "\(Volume Low Warning Reset Threshold\)\s*="
+syn match ncfSetCommandsNum "\(Volume Low Warning Threshold\)\s*="
+syn match ncfSetCommandsNum "\(Volume TTS Log File Overflow Size\)\s*="
+syn match ncfSetCommandsNum "\(Volume TTS Log File State\)\s*="
+syn match ncfSetCommandsNum "\(Worker Thread Execute In a Row Count\)\s*="
+
+" SET Commands that take a Boolean (ON/OFF)
+
+syn match ncfSetCommandsBool "\(Alloc Memory Check Flag\)\s*="
+syn match ncfSetCommandsBool "\(Allow Audit Passwords\)\s*="
+syn match ncfSetCommandsBool "\(Allow Change to Client Rights\)\s*="
+syn match ncfSetCommandsBool "\(Allow Deletion of Active Directories\)\s*="
+syn match ncfSetCommandsBool "\(Allow Invalid Pointers\)\s*="
+syn match ncfSetCommandsBool "\(Allow LIP\)\s*="
+syn match ncfSetCommandsBool "\(Allow Unencrypted Passwords\)\s*="
+syn match ncfSetCommandsBool "\(Allow Unowned Files To Be Extended\)\s*="
+syn match ncfSetCommandsBool "\(Auto Register Memory Above 16 Megabytes\)\s*="
+syn match ncfSetCommandsBool "\(Auto TTS Backout Flag\)\s*="
+syn match ncfSetCommandsBool "\(Automatically Repair Bad Volumes\)\s*="
+syn match ncfSetCommandsBool "\(Check Equivalent to Me\)\s*="
+syn match ncfSetCommandsBool "\(Command Line Prompt Default Choice\)\s*="
+syn match ncfSetCommandsBool "\(Console Display Watchdog Logouts\)\s*="
+syn match ncfSetCommandsBool "\(Daylight Savings Time Status\)\s*="
+syn match ncfSetCommandsBool "\(Developer Option\)\s*="
+syn match ncfSetCommandsBool "\(Display Incomplete IPX Packet Alerts\)\s*="
+syn match ncfSetCommandsBool "\(Display Lost Interrupt Alerts\)\s*="
+syn match ncfSetCommandsBool "\(Display NCP Bad Component Warnings\)\s*="
+syn match ncfSetCommandsBool "\(Display NCP Bad Length Warnings\)\s*="
+syn match ncfSetCommandsBool "\(Display Old API Names\)\s*="
+syn match ncfSetCommandsBool "\(Display Relinquish Control Alerts\)\s*="
+syn match ncfSetCommandsBool "\(Display Spurious Interrupt Alerts\)\s*="
+syn match ncfSetCommandsBool "\(Enable Deadlock Detection\)\s*="
+syn match ncfSetCommandsBool "\(Enable Disk Read After Write Verify\)\s*="
+syn match ncfSetCommandsBool "\(Enable File Compression\)\s*="
+syn match ncfSetCommandsBool "\(Enable IO Handicap Attribute\)\s*="
+syn match ncfSetCommandsBool "\(Enable SECURE.NCF\)\s*="
+syn match ncfSetCommandsBool "\(Fast Volume Mounts\)\s*="
+syn match ncfSetCommandsBool "\(Global Pseudo Preemption\)\s*="
+syn match ncfSetCommandsBool "\(Halt System on Invalid Parameters\)\s*="
+syn match ncfSetCommandsBool "\(Ignore Disk Geometry\)\s*="
+syn match ncfSetCommandsBool "\(Immediate Purge of Deleted Files\)\s*="
+syn match ncfSetCommandsBool "\(NCP File Commit\)\s*="
+syn match ncfSetCommandsBool "\(NDS Trace File Length to Zero\)\s*="
+syn match ncfSetCommandsBool "\(NDS Trace to File\)\s*="
+syn match ncfSetCommandsBool "\(NDS Trace to Screen\)\s*="
+syn match ncfSetCommandsBool "\(New Time With Daylight Savings Time Status\)\s*="
+syn match ncfSetCommandsBool "\(Read Ahead Enabled\)\s*="
+syn match ncfSetCommandsBool "\(Read Fault Emulation\)\s*="
+syn match ncfSetCommandsBool "\(Read Fault Notification\)\s*="
+syn match ncfSetCommandsBool "\(Reject NCP Packets with Bad Components\)\s*="
+syn match ncfSetCommandsBool "\(Reject NCP Packets with Bad Lengths\)\s*="
+syn match ncfSetCommandsBool "\(Replace Console Prompt with Server Name\)\s*="
+syn match ncfSetCommandsBool "\(Reply to Get Nearest Server\)\s*="
+syn match ncfSetCommandsBool "\(SMP Developer Option\)\s*="
+syn match ncfSetCommandsBool "\(SMP Flush Processor Cache\)\s*="
+syn match ncfSetCommandsBool "\(SMP Intrusive Abend Mode\)\s*="
+syn match ncfSetCommandsBool "\(SMP Memory Protection\)\s*="
+syn match ncfSetCommandsBool "\(Sound Bell for Alerts\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Configured Sources\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Directory Tree Mode\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Hardware Clock\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC RESET\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Restart Flag\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Service Advertising\)\s*="
+syn match ncfSetCommandsBool "\(TIMESYNC Write Parameters\)\s*="
+syn match ncfSetCommandsBool "\(TTS Abort Dump Flag\)\s*="
+syn match ncfSetCommandsBool "\(Upgrade Low Priority Threads\)\s*="
+syn match ncfSetCommandsBool "\(Volume Low Warn All Users\)\s*="
+syn match ncfSetCommandsBool "\(Write Fault Emulation\)\s*="
+syn match ncfSetCommandsBool "\(Write Fault Notification\)\s*="
+
+" Set Commands that take a "string" -- NOT QUOTED
+
+syn match ncfSetCommandsStr "\(Default Time Server Type\)\s*="
+syn match ncfSetCommandsStr "\(SMP NetWare Kernel Mode\)\s*="
+syn match ncfSetCommandsStr "\(Time Zone\)\s*="
+syn match ncfSetCommandsStr "\(TIMESYNC ADD Time Source\)\s*="
+syn match ncfSetCommandsStr "\(TIMESYNC REMOVE Time Source\)\s*="
+syn match ncfSetCommandsStr "\(TIMESYNC Time Source\)\s*="
+syn match ncfSetCommandsStr "\(TIMESYNC Type\)\s*="
+
+" SET Commands that take a "Time"
+
+syn match ncfSetCommandsTime "\(Command Line Prompt Time Out\)\s*="
+syn match ncfSetCommandsTime "\(Delay Before First Watchdog Packet\)\s*="
+syn match ncfSetCommandsTime "\(Delay Between Watchdog Packets\)\s*="
+syn match ncfSetCommandsTime "\(Directory Cache Buffer NonReferenced Delay\)\s*="
+syn match ncfSetCommandsTime "\(Dirty Directory Cache Delay Time\)\s*="
+syn match ncfSetCommandsTime "\(Dirty Disk Cache Delay Time\)\s*="
+syn match ncfSetCommandsTime "\(File Delete Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(Minimum File Delete Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(Mirrored Devices Are Out of Sync Message Frequency\)\s*="
+syn match ncfSetCommandsTime "\(New Packet Receive Buffer Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(TTS Backout File Truncation Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(TTS UnWritten Cache Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(Turbo FAT Re-Use Wait Time\)\s*="
+syn match ncfSetCommandsTime "\(Daylight Savings Time Offset\)\s*="
+
+syn match ncfSetCommandsTimeDate "\(End of Daylight Savings Time\)\s*="
+syn match ncfSetCommandsTimeDate "\(Start of Daylight Savings Time\)\s*="
+
+syn match ncfSetCommandsBindCon "\(Bindery Context\)\s*=" nextgroup=ncfContString
+
+syn cluster ncfSetCommands contains=ncfSetCommandsNum,ncfSetCommandsBool,ncfSetCommandsStr,ncfSetCommandsTime,ncfSetCommandsTimeDate,ncfSetCommandsBindCon
+
+
+if exists("ncf_highlight_unknowns")
+ syn match Error "[^ \t]*" contains=ALL
+endif
+
+if version >= 508 || !exists("did_ncf_syntax_inits")
+ if version < 508
+ let did_ncf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink ncfCommands Statement
+ HiLink ncfSetCommands ncfCommands
+ HiLink ncfLogins ncfCommands
+ HiLink ncfString String
+ HiLink ncfContString ncfString
+ HiLink ncfComment Comment
+ HiLink ncfImplicit Type
+ HiLink ncfBoolean Boolean
+ HiLink ncfScript Identifier
+ HiLink ncfNumber Number
+ HiLink ncfIPAddr ncfNumber
+ HiLink ncfHexNumber ncfNumber
+ HiLink ncfTime ncfNumber
+ HiLink ncfDSTTime ncfNumber
+ HiLink ncfPath Constant
+ HiLink ncfServerName Special
+ HiLink ncfIPXNet ncfServerName
+ HiLink ncfTimeTypes Constant
+ HiLink ncfSetCommandsNum ncfSetCommands
+ HiLink ncfSetCommandsBool ncfSetCommands
+ HiLink ncfSetCommandsStr ncfSetCommands
+ HiLink ncfSetCommandsTime ncfSetCommands
+ HiLink ncfSetCommandsTimeDate ncfSetCommands
+ HiLink ncfSetCommandsBindCon ncfSetCommands
+
+ delcommand HiLink
+
+endif
+
+let b:current_syntax = "ncf"
diff --git a/runtime/syntax/nosyntax.vim b/runtime/syntax/nosyntax.vim
new file mode 100644
index 000000000..b0b0c17df
--- /dev/null
+++ b/runtime/syntax/nosyntax.vim
@@ -0,0 +1,29 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2000 Jul 15
+
+" This file is used for ":syntax off".
+" It removes the autocommands and stops highlighting for all buffers.
+
+if !has("syntax")
+ finish
+endif
+
+" remove all syntax autocommands and remove the syntax for each buffer
+augroup syntaxset
+ au!
+ au BufEnter * syn clear
+ au BufEnter * if exists("b:current_syntax") | unlet b:current_syntax | endif
+ doautoall syntaxset BufEnter *
+ au!
+augroup END
+
+" Just in case: remove all autocommands for the Syntax event
+au! Syntax
+
+if exists("syntax_on")
+ unlet syntax_on
+endif
+if exists("syntax_manual")
+ unlet syntax_manual
+endif
diff --git a/runtime/syntax/nqc.vim b/runtime/syntax/nqc.vim
new file mode 100644
index 000000000..0a3cd6bc7
--- /dev/null
+++ b/runtime/syntax/nqc.vim
@@ -0,0 +1,378 @@
+" Vim syntax file
+" Language: NQC - Not Quite C, for LEGO mindstorms
+" NQC homepage: http://www.enteract.com/~dbaum/nqc/
+" Maintainer: Stefan Scherer <stefan@enotes.de>
+" Last Change: 2001 May 10
+" URL: http://www.enotes.de/twiki/pub/Home/LegoMindstorms/nqc.vim
+" Filenames: .nqc
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Statements
+syn keyword nqcStatement break return continue start stop abs sign
+syn keyword nqcStatement sub task
+syn keyword nqcLabel case default
+syn keyword nqcConditional if else switch
+syn keyword nqcRepeat while for do until repeat
+
+" Scout and RCX2
+syn keyword nqcEvents acquire catch monitor
+
+" types and classes
+syn keyword nqcType int true false void
+syn keyword nqcStorageClass asm const inline
+
+
+
+" Sensors --------------------------------------------
+" Input Sensors
+syn keyword nqcConstant SENSOR_1 SENSOR_2 SENSOR_3
+
+" Types for SetSensorType()
+syn keyword nqcConstant SENSOR_TYPE_TOUCH SENSOR_TYPE_TEMPERATURE
+syn keyword nqcConstant SENSOR_TYPE_LIGHT SENSOR_TYPE_ROTATION
+syn keyword nqcConstant SENSOR_LIGHT SENSOR_TOUCH
+
+" Modes for SetSensorMode()
+syn keyword nqcConstant SENSOR_MODE_RAW SENSOR_MODE_BOOL
+syn keyword nqcConstant SENSOR_MODE_EDGE SENSOR_MODE_PULSE
+syn keyword nqcConstant SENSOR_MODE_PERCENT SENSOR_MODE_CELSIUS
+syn keyword nqcConstant SENSOR_MODE_FAHRENHEIT SENSOR_MODE_ROTATION
+
+" Sensor configurations for SetSensor()
+syn keyword nqcConstant SENSOR_TOUCH SENSOR_LIGHT SENSOR_ROTATION
+syn keyword nqcConstant SENSOR_CELSIUS SENSOR_FAHRENHEIT SENSOR_PULSE
+syn keyword nqcConstant SENSOR_EDGE
+
+" Functions - All
+syn keyword nqcFunction ClearSensor
+syn keyword nqcFunction SensorValue SensorType
+
+" Functions - RCX
+syn keyword nqcFunction SetSensor SetSensorType
+syn keyword nqcFunction SensorValueBool
+
+" Functions - RCX, CyberMaster
+syn keyword nqcFunction SetSensorMode SensorMode
+
+" Functions - RCX, Scout
+syn keyword nqcFunction SensorValueRaw
+
+" Functions - Scout
+syn keyword nqcFunction SetSensorLowerLimit SetSensorUpperLimit
+syn keyword nqcFunction SetSensorHysteresis CalibrateSensor
+
+
+" Outputs --------------------------------------------
+" Outputs for On(), Off(), etc.
+syn keyword nqcConstant OUT_A OUT_B OUT_C
+
+" Modes for SetOutput()
+syn keyword nqcConstant OUT_ON OUT_OFF OUT_FLOAT
+
+" Directions for SetDirection()
+syn keyword nqcConstant OUT_FWD OUT_REV OUT_TOGGLE
+
+" Output power for SetPower()
+syn keyword nqcConstant OUT_LOW OUT_HALF OUT_FULL
+
+" Functions - All
+syn keyword nqcFunction SetOutput SetDirection SetPower OutputStatus
+syn keyword nqcFunction On Off Float Fwd Rev Toggle
+syn keyword nqcFunction OnFwd OnRev OnFor
+
+" Functions - RXC2, Scout
+syn keyword nqcFunction SetGlobalOutput SetGlobalDirection SetMaxPower
+syn keyword nqcFunction GlobalOutputStatus
+
+
+" Sound ----------------------------------------------
+" Sounds for PlaySound()
+syn keyword nqcConstant SOUND_CLICK SOUND_DOUBLE_BEEP SOUND_DOWN
+syn keyword nqcConstant SOUND_UP SOUND_LOW_BEEP SOUND_FAST_UP
+
+" Functions - All
+syn keyword nqcFunction PlaySound PlayTone
+
+" Functions - RCX2, Scout
+syn keyword nqcFunction MuteSound UnmuteSound ClearSound
+syn keyword nqcFunction SelectSounds
+
+
+" LCD ------------------------------------------------
+" Modes for SelectDisplay()
+syn keyword nqcConstant DISPLAY_WATCH DISPLAY_SENSOR_1 DISPLAY_SENSOR_2
+syn keyword nqcConstant DISPLAY_SENSOR_3 DISPLAY_OUT_A DISPLAY_OUT_B
+syn keyword nqcConstant DISPLAY_OUT_C
+" RCX2
+syn keyword nqcConstant DISPLAY_USER
+
+" Functions - RCX
+syn keyword nqcFunction SelectDisplay
+" Functions - RCX2
+syn keyword nqcFunction SetUserDisplay
+
+
+" Communication --------------------------------------
+" Messages - RCX, Scout ------------------------------
+" Tx power level for SetTxPower()
+syn keyword nqcConstant TX_POWER_LO TX_POWER_HI
+
+" Functions - RCX, Scout
+syn keyword nqcFunction Message ClearMessage SendMessage SetTxPower
+
+" Serial - RCX2 --------------------------------------
+" for SetSerialComm()
+syn keyword nqcConstant SERIAL_COMM_DEFAULT SERIAL_COMM_4800
+syn keyword nqcConstant SERIAL_COMM_DUTY25 SERIAL_COMM_76KHZ
+
+" for SetSerialPacket()
+syn keyword nqcConstant SERIAL_PACKET_DEFAULT SERIAL_PACKET_PREAMBLE
+syn keyword nqcConstant SERIAL_PACKET_NEGATED SERIAL_PACKET_CHECKSUM
+syn keyword nqcConstant SERIAL_PACKET_RCX
+
+" Functions - RCX2
+syn keyword nqcFunction SetSerialComm SetSerialPacket SetSerialData
+syn keyword nqcFunction SerialData SendSerial
+
+" VLL - Scout ----------------------------------------
+" Functions - Scout
+syn keyword nqcFunction SendVLL
+
+
+" Timers ---------------------------------------------
+" Functions - All
+syn keyword nqcFunction ClearTimer Timer
+
+" Functions - RCX2
+syn keyword nqcFunction SetTimer FastTimer
+
+
+" Counters -------------------------------------------
+" Functions - RCX2, Scout
+syn keyword nqcFunction ClearCounter IncCounter DecCounter Counter
+
+
+" Access Control -------------------------------------
+syn keyword nqcConstant ACQUIRE_OUT_A ACQUIRE_OUT_B ACQUIRE_OUT_C
+syn keyword nqcConstant ACQUIRE_SOUND
+" RCX2 only
+syn keyword nqcConstant ACQUIRE_USER_1 ACQUIRE_USER_2 ACQUIRE_USER_3
+syn keyword nqcConstant ACQUIRE_USER_4
+
+" Functions - RCX2, Scout
+syn keyword nqcFunction SetPriority
+
+
+" Events ---------------------------------------------
+" RCX2 Events
+syn keyword nqcConstant EVENT_TYPE_PRESSED EVENT_TYPE_RELEASED
+syn keyword nqcConstant EVENT_TYPE_PULSE EVENT_TYPE_EDGE
+syn keyword nqcConstant EVENT_TYPE_FAST_CHANGE EVENT_TYPE_LOW
+syn keyword nqcConstant EVENT_TYPE_NORMAL EVENT_TYPE_HIGH
+syn keyword nqcConstant EVENT_TYPE_CLICK EVENT_TYPE_DOUBLECLICK
+syn keyword nqcConstant EVENT_TYPE_MESSAGE
+
+" Scout Events
+syn keyword nqcConstant EVENT_1_PRESSED EVENT_1_RELEASED
+syn keyword nqcConstant EVENT_2_PRESSED EVENT_2_RELEASED
+syn keyword nqcConstant EVENT_LIGHT_HIGH EVENT_LIGHT_NORMAL
+syn keyword nqcConstant EVENT_LIGHT_LOW EVENT_LIGHT_CLICK
+syn keyword nqcConstant EVENT_LIGHT_DOUBLECLICK EVENT_COUNTER_0
+syn keyword nqcConstant EVENT_COUNTER_1 EVENT_TIMER_0 EVENT_TIMER_1
+syn keyword nqcConstant EVENT_TIMER_2 EVENT_MESSAGE
+
+" Functions - RCX2, Scout
+syn keyword nqcFunction ActiveEvents Event
+
+" Functions - RCX2
+syn keyword nqcFunction CurrentEvents
+syn keyword nqcFunction SetEvent ClearEvent ClearAllEvents EventState
+syn keyword nqcFunction CalibrateEvent SetUpperLimit UpperLimit
+syn keyword nqcFunction SetLowerLimit LowerLimit SetHysteresis
+syn keyword nqcFunction Hysteresis
+syn keyword nqcFunction SetClickTime ClickTime SetClickCounter
+syn keyword nqcFunction ClickCounter
+
+" Functions - Scout
+syn keyword nqcFunction SetSensorClickTime SetCounterLimit
+syn keyword nqcFunction SetTimerLimit
+
+
+" Data Logging ---------------------------------------
+" Functions - RCX
+syn keyword nqcFunction CreateDatalog AddToDatalog
+syn keyword nqcFunction UploadDatalog
+
+
+" General Features -----------------------------------
+" Functions - All
+syn keyword nqcFunction Wait StopAllTasks Random
+syn keyword nqcFunction SetSleepTime SleepNow
+
+" Functions - RCX
+syn keyword nqcFunction Program Watch SetWatch
+
+" Functions - RCX2
+syn keyword nqcFunction SetRandomSeed SelectProgram
+syn keyword nqcFunction BatteryLevel FirmwareVersion
+
+" Functions - Scout
+" Parameters for SetLight()
+syn keyword nqcConstant LIGHT_ON LIGHT_OFF
+syn keyword nqcFunction SetScoutRules ScoutRules SetScoutMode
+syn keyword nqcFunction SetEventFeedback EventFeedback SetLight
+
+" additional CyberMaster defines
+syn keyword nqcConstant OUT_L OUT_R OUT_X
+syn keyword nqcConstant SENSOR_L SENSOR_M SENSOR_R
+" Functions - CyberMaster
+syn keyword nqcFunction Drive OnWait OnWaitDifferent
+syn keyword nqcFunction ClearTachoCounter TachoCount TachoSpeed
+syn keyword nqcFunction ExternalMotorRunning AGC
+
+
+
+" nqcCommentGroup allows adding matches for special things in comments
+syn keyword nqcTodo contained TODO FIXME XXX
+syn cluster nqcCommentGroup contains=nqcTodo
+
+"when wanted, highlight trailing white space
+if exists("nqc_space_errors")
+ if !exists("nqc_no_trail_space_error")
+ syn match nqcSpaceError display excludenl "\s\+$"
+ endif
+ if !exists("nqc_no_tab_space_error")
+ syn match nqcSpaceError display " \+\t"me=e-1
+ endif
+endif
+
+"catch errors caused by wrong parenthesis and brackets
+syn cluster nqcParenGroup contains=nqcParenError,nqcIncluded,nqcCommentSkip,@nqcCommentGroup,nqcCommentStartError,nqcCommentSkip,nqcCppOut,nqcCppOut2,nqcCppSkip,nqcNumber,nqcFloat,nqcNumbers
+if exists("nqc_no_bracket_error")
+ syn region nqcParen transparent start='(' end=')' contains=ALLBUT,@nqcParenGroup,nqcCppParen
+ " nqcCppParen: same as nqcParen but ends at end-of-line; used in nqcDefine
+ syn region nqcCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@nqcParenGroup,nqcParen
+ syn match nqcParenError display ")"
+ syn match nqcErrInParen display contained "[{}]"
+else
+ syn region nqcParen transparent start='(' end=')' contains=ALLBUT,@nqcParenGroup,nqcCppParen,nqcErrInBracket,nqcCppBracket
+ " nqcCppParen: same as nqcParen but ends at end-of-line; used in nqcDefine
+ syn region nqcCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@nqcParenGroup,nqcErrInBracket,nqcParen,nqcBracket
+ syn match nqcParenError display "[\])]"
+ syn match nqcErrInParen display contained "[\]{}]"
+ syn region nqcBracket transparent start='\[' end=']' contains=ALLBUT,@nqcParenGroup,nqcErrInParen,nqcCppParen,nqcCppBracket
+ " nqcCppBracket: same as nqcParen but ends at end-of-line; used in nqcDefine
+ syn region nqcCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@nqcParenGroup,nqcErrInParen,nqcParen,nqcBracket
+ syn match nqcErrInBracket display contained "[);{}]"
+endif
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match nqcNumbers display transparent "\<\d\|\.\d" contains=nqcNumber,nqcFloat
+" Same, but without octal error (for comments)
+syn match nqcNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match nqcNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match nqcFloat display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match nqcFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match nqcFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match nqcFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+" flag an octal number with wrong digits
+syn case match
+
+syn region nqcCommentL start="//" skip="\\$" end="$" keepend contains=@nqcCommentGroup,nqcSpaceError
+syn region nqcComment matchgroup=nqcCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@nqcCommentGroup,nqcCommentStartError,nqcSpaceError
+
+" keep a // comment separately, it terminates a preproc. conditional
+syntax match nqcCommentError display "\*/"
+syntax match nqcCommentStartError display "/\*" contained
+
+
+
+
+
+syn region nqcPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=nqcComment,nqcCharacter,nqcCppParen,nqcParenError,nqcNumbers,nqcCommentError,nqcSpaceError
+syn match nqcPreCondit display "^\s*#\s*\(else\|endif\)\>"
+if !exists("nqc_no_if0")
+ syn region nqcCppOut start="^\s*#\s*if\s\+0\>" end=".\|$" contains=nqcCppOut2
+ syn region nqcCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=nqcSpaceError,nqcCppSkip
+ syn region nqcCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=nqcSpaceError,nqcCppSkip
+endif
+syn region nqcIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match nqcInclude display "^\s*#\s*include\>\s*["]" contains=nqcIncluded
+"syn match nqcLineSkip "\\$"
+syn cluster nqcPreProcGroup contains=nqcPreCondit,nqcIncluded,nqcInclude,nqcDefine,nqcErrInParen,nqcErrInBracket,nqcCppOut,nqcCppOut2,nqcCppSkip,nqcNumber,nqcFloat,nqcNumbers,nqcCommentSkip,@nqcCommentGroup,nqcCommentStartError,nqcParen,nqcBracket
+syn region nqcDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" contains=ALLBUT,@nqcPreProcGroup
+syn region nqcPreProc start="^\s*#\s*\(pragma\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@nqcPreProcGroup
+
+if !exists("nqc_minlines")
+ if !exists("nqc_no_if0")
+ let nqc_minlines = 50 " #if 0 constructs can be long
+ else
+ let nqc_minlines = 15 " mostly for () constructs
+ endif
+endif
+exec "syn sync ccomment nqcComment minlines=" . nqc_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_nqc_syn_inits")
+ if version < 508
+ let did_nqc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink nqcLabel Label
+ HiLink nqcConditional Conditional
+ HiLink nqcRepeat Repeat
+ HiLink nqcCharacter Character
+ HiLink nqcNumber Number
+ HiLink nqcFloat Float
+ HiLink nqcFunction Function
+ HiLink nqcParenError nqcError
+ HiLink nqcErrInParen nqcError
+ HiLink nqcErrInBracket nqcError
+ HiLink nqcCommentL nqcComment
+ HiLink nqcCommentStart nqcComment
+ HiLink nqcCommentError nqcError
+ HiLink nqcCommentStartError nqcError
+ HiLink nqcSpaceError nqcError
+ HiLink nqcStorageClass StorageClass
+ HiLink nqcInclude Include
+ HiLink nqcPreProc PreProc
+ HiLink nqcDefine Macro
+ HiLink nqcIncluded String
+ HiLink nqcError Error
+ HiLink nqcStatement Statement
+ HiLink nqcEvents Statement
+ HiLink nqcPreCondit PreCondit
+ HiLink nqcType Type
+ HiLink nqcConstant Constant
+ HiLink nqcCommentSkip nqcComment
+ HiLink nqcComment Comment
+ HiLink nqcTodo Todo
+ HiLink nqcCppSkip nqcCppOut
+ HiLink nqcCppOut2 nqcCppOut
+ HiLink nqcCppOut Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "nqc"
+
+" vim: ts=8
diff --git a/runtime/syntax/nroff.vim b/runtime/syntax/nroff.vim
new file mode 100644
index 000000000..2f004d605
--- /dev/null
+++ b/runtime/syntax/nroff.vim
@@ -0,0 +1,259 @@
+" VIM syntax file
+" Language: nroff/groff
+" Maintainer: Alejandro López-Valencia <dradul@yahoo.com>
+" URL: http://dradul.tripod.com/vim
+" Last Change: 2003 May 24
+"
+" {{{1 Acknowledgements
+"
+" ACKNOWLEDGEMENTS:
+"
+" My thanks to Jérôme Plût <Jerome.Plut@ens.fr>, who was the
+" creator and maintainer of this syntax file for several years.
+" May I be as good at it as he has been.
+"
+" {{{1 Todo
+"
+" TODO:
+"
+" * Write syntax highlighting files for the preprocessors,
+" and integrate with nroff.vim.
+"
+"
+" {{{1 Start syntax highlighting.
+"
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+"
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+"
+" {{{1 plugin settings...
+"
+" {{{2 enable spacing error highlighting
+"
+if exists("nroff_space_errors")
+ syn match nroffError /\s\+$/
+ syn match nroffSpaceError /[.,:;!?]\s\{2,}/
+endif
+"
+"
+" {{{1 Special file settings
+"
+" {{{2 ms exdented paragraphs are not in the default paragraphs list.
+"
+setlocal paragraphs+=XP
+"
+" {{{2 Activate navigation to preporcessor sections.
+"
+if exists("b:preprocs_as_sections")
+ setlocal sections=EQTSPS[\ G1GS
+endif
+
+" {{{1 Escape sequences
+" ------------------------------------------------------------
+
+syn match nroffEscChar /\\[CN]/ nextgroup=nroffEscCharArg
+syn match nroffEscape /\\[*fgmnYV]/ nextgroup=nroffEscRegPar,nroffEscRegArg
+syn match nroffEscape /\\s[+-]\=/ nextgroup=nroffSize
+syn match nroffEscape /\\[$AbDhlLRvxXZ]/ nextgroup=nroffEscPar,nroffEscArg
+
+syn match nroffEscRegArg /./ contained
+syn match nroffEscRegArg2 /../ contained
+syn match nroffEscRegPar /(/ contained nextgroup=nroffEscRegArg2
+syn match nroffEscArg /./ contained
+syn match nroffEscArg2 /../ contained
+syn match nroffEscPar /(/ contained nextgroup=nroffEscArg2
+syn match nroffSize /\((\d\)\=\d/ contained
+
+syn region nroffEscCharArg start=/'/ end=/'/ contained
+syn region nroffEscArg start=/'/ end=/'/ contained contains=nroffEscape,@nroffSpecial
+
+if exists("b:nroff_is_groff")
+ syn region nroffEscRegArg matchgroup=nroffEscape start=/\[/ end=/\]/ contained oneline
+ syn region nroffSize matchgroup=nroffEscape start=/\[/ end=/\]/ contained
+endif
+
+syn match nroffEscape /\\[adprtu{}]/
+syn match nroffEscape /\\$/
+syn match nroffEscape /\\\$[@*]/
+
+" {{{1 Strings and special characters
+" ------------------------------------------------------------
+
+syn match nroffSpecialChar /\\[\\eE?!-]/
+syn match nroffSpace "\\[&%~|^0)/,]"
+syn match nroffSpecialChar /\\(../
+
+if exists("b:nroff_is_groff")
+ syn match nroffSpecialChar /\\\[[^]]*]/
+ syn region nroffPreserve matchgroup=nroffSpecialChar start=/\\?/ end=/\\?/ oneline
+endif
+
+syn region nroffPreserve matchgroup=nroffSpecialChar start=/\\!/ end=/$/ oneline
+
+syn cluster nroffSpecial contains=nroffSpecialChar,nroffSpace
+
+
+syn region nroffString start=/"/ end=/"/ skip=/\\$/ contains=nroffEscape,@nroffSpecial contained
+syn region nroffString start=/'/ end=/'/ skip=/\\$/ contains=nroffEscape,@nroffSpecial contained
+
+
+" {{{1 Numbers and units
+" ------------------------------------------------------------
+syn match nroffNumBlock /[0-9.]\a\=/ contained contains=nroffNumber
+syn match nroffNumber /\d\+\(\.\d*\)\=/ contained nextgroup=nroffUnit,nroffBadChar
+syn match nroffNumber /\.\d\+)/ contained nextgroup=nroffUnit,nroffBadChar
+syn match nroffBadChar /./ contained
+syn match nroffUnit /[icpPszmnvMu]/ contained
+
+
+" {{{1 Requests
+" ------------------------------------------------------------
+
+" Requests begin with . or ' at the beginning of a line, or
+" after .if or .ie.
+
+syn match nroffReqLeader /^[.']/ nextgroup=nroffReqName skipwhite
+syn match nroffReqLeader /[.']/ contained nextgroup=nroffReqName skipwhite
+
+if exists("b:nroff_is_groff")
+"
+" GNU troff allows long request names
+"
+syn match nroffReqName /[^\t \\\[?]\+/ contained nextgroup=nroffReqArg
+else
+ syn match nroffReqName /[^\t \\\[?]\{1,2}/ contained nextgroup=nroffReqArg
+endif
+
+syn region roffReqArg start=/\S/ skip=/\\$/ end=/$/ contained contains=nroffEscape,@nroffSpecial,nroffString,nroffError,nroffSpaceError,nroffNumBlock,nroffComment
+
+" {{{2 Conditional: .if .ie .el
+syn match nroffReqName /\(if\|ie\)/ contained nextgroup=nroffCond skipwhite
+syn match nroffReqName /el/ contained nextgroup=nroffReqLeader skipwhite
+syn match nroffCond /\S\+/ contained nextgroup=nroffReqLeader skipwhite
+
+" {{{2 String definition: .ds .as
+syn match nroffReqname /[da]s/ contained nextgroup=nroffDefIdent skipwhite
+syn match nroffDefIdent /\S\+/ contained nextgroup=nroffDefinition skipwhite
+syn region nroffDefinition matchgroup=nroffSpecialChar start=/"/ matchgroup=NONE end=/\\"/me=e-2 skip=/\\$/ start=/\S/ end=/$/ contained contains=nroffDefSpecial
+syn match nroffDefSpecial /\\$/ contained
+syn match nroffDefSpecial /\\\((.\)\=./ contained
+
+if exists("b:nroff_is_groff")
+ syn match nroffDefSpecial /\\\[[^]]*]/ contained
+endif
+
+" {{{2 Macro definition: .de .am, also diversion: .di
+syn match nroffReqName /\(d[ei]\|am\)/ contained nextgroup=nroffIdent skipwhite
+syn match nroffIdent /[^[?( \t]\+/ contained
+if exists("b:nroff_is_groff")
+ syn match nroffReqName /als/ contained nextgroup=nroffIdent skipwhite
+endif
+
+" {{{2 Register definition: .rn .rr
+syn match nroffReqName /[rn]r/ contained nextgroup=nroffIdent skipwhite
+if exists("b:nroff_is_groff")
+ syn match nroffReqName /\(rnn\|aln\)/ contained nextgroup=nroffIdent skipwhite
+endif
+
+
+" {{{1 eqn/tbl/pic
+" ------------------------------------------------------------
+" <jp>
+" XXX: write proper syntax highlight for eqn / tbl / pic ?
+" <jp />
+
+syn region nroffEquation start=/^\.\s*EQ\>/ end=/^\.\s*EN\>/
+syn region nroffTable start=/^\.\s*TS\>/ end=/^\.\s*TE\>/
+syn region nroffPicture start=/^\.\s*PS\>/ end=/^\.\s*PE\>/
+syn region nroffRefer start=/^\.\s*\[\>/ end=/^\.\s*\]\>/
+syn region nroffGrap start=/^\.\s*G1\>/ end=/^\.\s*G2\>/
+syn region nroffGremlin start=/^\.\s*GS\>/ end=/^\.\s*GE|GF\>/
+
+" {{{1 Comments
+" ------------------------------------------------------------
+
+syn region nroffIgnore start=/^[.']\s*ig/ end=/^['.]\s*\./
+syn match nroffComment /\(^[.']\s*\)\=\\".*/ contains=nroffTodo
+syn match nroffComment /^'''.*/ contains=nroffTodo
+
+if exists("b:nroff_is_groff")
+ syn match nroffComment "\\#.*$" contains=nroffTodo
+endif
+
+syn keyword nroffTodo TODO XXX FIXME contained
+
+" {{{1 Hilighting
+" ------------------------------------------------------------
+"
+
+"
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+"
+if version >= 508 || !exists("did_nroff_syn_inits")
+
+ if version < 508
+ let did_nroff_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink nroffEscChar nroffSpecialChar
+ HiLink nroffEscCharAr nroffSpecialChar
+ HiLink nroffSpecialChar SpecialChar
+ HiLink nroffSpace Delimiter
+
+ HiLink nroffEscRegArg2 nroffEscRegArg
+ HiLink nroffEscRegArg nroffIdent
+
+ HiLink nroffEscArg2 nroffEscArg
+ HiLink nroffEscPar nroffEscape
+
+ HiLink nroffEscRegPar nroffEscape
+ HiLink nroffEscArg nroffEscape
+ HiLink nroffSize nroffEscape
+ HiLink nroffEscape Preproc
+
+ HiLink nroffIgnore Comment
+ HiLink nroffComment Comment
+ HiLink nroffTodo Todo
+
+ HiLink nroffReqLeader nroffRequest
+ HiLink nroffReqName nroffRequest
+ HiLink nroffRequest Statement
+ HiLink nroffCond PreCondit
+ HiLink nroffDefIdent nroffIdent
+ HiLink nroffIdent Identifier
+
+ HiLink nroffEquation PreProc
+ HiLink nroffTable PreProc
+ HiLink nroffPicture PreProc
+ HiLink nroffRefer PreProc
+ HiLink nroffGrap PreProc
+ HiLink nroffGremlin PreProc
+
+ HiLink nroffNumber Number
+ HiLink nroffBadChar nroffError
+ HiLink nroffSpaceError nroffError
+ HiLink nroffError Error
+
+ HiLink nroffPreserve String
+ HiLink nroffString String
+ HiLink nroffDefinition String
+ HiLink nroffDefSpecial Special
+
+ delcommand HiLink
+
+endif
+
+let b:current_syntax = "nroff"
+
+" vim600: set fdm=marker fdl=2:
diff --git a/runtime/syntax/nsis.vim b/runtime/syntax/nsis.vim
new file mode 100644
index 000000000..d6d803714
--- /dev/null
+++ b/runtime/syntax/nsis.vim
@@ -0,0 +1,271 @@
+" Vim syntax file
+" Language: NSIS script, for version of NSIS 1.91 and later
+" Maintainer: Alex Jakushev <Alex.Jakushev@kemek.lt>
+" Last Change: 2004 May 12
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+
+"COMMENTS
+syn keyword nsisTodo todo attention note fixme readme
+syn region nsisComment start=";" end="$" contains=nsisTodo
+syn region nsisComment start="#" end="$" contains=nsisTodo
+
+"LABELS
+syn match nsisLocalLabel "\a\S\{-}:"
+syn match nsisGlobalLabel "\.\S\{-1,}:"
+
+"PREPROCESSOR
+syn match nsisPreprocSubst "${.\{-}}"
+syn match nsisDefine "!define\>"
+syn match nsisDefine "!undef\>"
+syn match nsisPreCondit "!ifdef\>"
+syn match nsisPreCondit "!ifndef\>"
+syn match nsisPreCondit "!endif\>"
+syn match nsisPreCondit "!else\>"
+syn match nsisMacro "!macro\>"
+syn match nsisMacro "!macroend\>"
+syn match nsisMacro "!insertmacro\>"
+
+"COMPILER UTILITY
+syn match nsisInclude "!include\>"
+syn match nsisSystem "!cd\>"
+syn match nsisSystem "!system\>"
+syn match nsisSystem "!packhdr\>"
+
+"VARIABLES
+syn match nsisUserVar "$\d"
+syn match nsisUserVar "$R\d"
+syn match nsisSysVar "$INSTDIR"
+syn match nsisSysVar "$OUTDIR"
+syn match nsisSysVar "$CMDLINE"
+syn match nsisSysVar "$PROGRAMFILES"
+syn match nsisSysVar "$DESKTOP"
+syn match nsisSysVar "$EXEDIR"
+syn match nsisSysVar "$WINDIR"
+syn match nsisSysVar "$SYSDIR"
+syn match nsisSysVar "$TEMP"
+syn match nsisSysVar "$STARTMENU"
+syn match nsisSysVar "$SMPROGRAMS"
+syn match nsisSysVar "$SMSTARTUP"
+syn match nsisSysVar "$QUICKLAUNCH"
+syn match nsisSysVar "$HWNDPARENT"
+syn match nsisSysVar "$\\r"
+syn match nsisSysVar "$\\n"
+syn match nsisSysVar "$\$"
+
+"STRINGS
+syn region nsisString start=/"/ skip=/'\|`/ end=/"/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry
+syn region nsisString start=/'/ skip=/"\|`/ end=/'/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry
+syn region nsisString start=/`/ skip=/"\|'/ end=/`/ contains=nsisPreprocSubst,nsisUserVar,nsisSysVar,nsisRegistry
+
+"CONSTANTS
+syn keyword nsisBoolean true false on off
+
+syn keyword nsisAttribOptions hide show nevershow auto force try ifnewer normal silent silentlog
+syn keyword nsisAttribOptions smooth colored SET CUR END RO none listonly textonly both current all
+syn keyword nsisAttribOptions zlib bzip2 lzma
+
+syn match nsisAttribOptions '\/NOCUSTOM'
+syn match nsisAttribOptions '\/CUSTOMSTRING'
+syn match nsisAttribOptions '\/COMPONENTSONLYONCUSTOM'
+syn match nsisAttribOptions '\/windows'
+syn match nsisAttribOptions '\/r'
+syn match nsisAttribOptions '\/oname'
+syn match nsisAttribOptions '\/REBOOTOK'
+syn match nsisAttribOptions '\/SILENT'
+syn match nsisAttribOptions '\/FILESONLY'
+syn match nsisAttribOptions '\/SHORT'
+
+syn keyword nsisExecShell SW_SHOWNORMAL SW_SHOWMAXIMIZED SW_SHOWMINIMIZED
+
+syn keyword nsisRegistry HKCR HKLM HKCU HKU HKCC HKDD HKPD
+syn keyword nsisRegistry HKEY_CLASSES_ROOT HKEY_LOCAL_MACHINE HKEY_CURRENT_USER HKEY_USERS
+syn keyword nsisRegistry HKEY_CURRENT_CONFIG HKEY_DYN_DATA HKEY_PERFORMANCE_DATA
+
+syn keyword nsisFileAttrib NORMAL ARCHIVE HIDDEN OFFLINE READONLY SYSTEM TEMPORARY
+syn keyword nsisFileAttrib FILE_ATTRIBUTE_NORMAL FILE_ATTRIBUTE_ARCHIVE FILE_ATTRIBUTE_HIDDEN
+syn keyword nsisFileAttrib FILE_ATTRIBUTE_OFFLINE FILE_ATTRIBUTE_READONLY FILE_ATTRIBUTE_SYSTEM
+syn keyword nsisFileAttrib FILE_ATTRIBUTE_TEMPORARY
+
+syn keyword nsisMessageBox MB_OK MB_OKCANCEL MB_ABORTRETRYIGNORE MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL
+syn keyword nsisMessageBox MB_ICONEXCLAMATION MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP
+syn keyword nsisMessageBox MB_TOPMOST MB_SETFOREGROUND MB_RIGHT
+syn keyword nsisMessageBox MB_DEFBUTTON1 MB_DEFBUTTON2 MB_DEFBUTTON3 MB_DEFBUTTON4
+syn keyword nsisMessageBox IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES
+
+syn match nsisNumber "\<[^0]\d*\>"
+syn match nsisNumber "\<0x\x\+\>"
+syn match nsisNumber "\<0\o*\>"
+
+
+"INSTALLER ATTRIBUTES - General installer configuration
+syn keyword nsisAttribute OutFile Name Caption SubCaption BrandingText Icon
+syn keyword nsisAttribute WindowIcon BGGradient SilentInstall SilentUnInstall
+syn keyword nsisAttribute CRCCheck MiscButtonText InstallButtonText FileErrorText
+
+"INSTALLER ATTRIBUTES - Install directory configuration
+syn keyword nsisAttribute InstallDir InstallDirRegKey
+
+"INSTALLER ATTRIBUTES - License page configuration
+syn keyword nsisAttribute LicenseText LicenseData
+
+"INSTALLER ATTRIBUTES - Component page configuration
+syn keyword nsisAttribute ComponentText InstType EnabledBitmap DisabledBitmap SpaceTexts
+
+"INSTALLER ATTRIBUTES - Directory page configuration
+syn keyword nsisAttribute DirShow DirText AllowRootDirInstall
+
+"INSTALLER ATTRIBUTES - Install page configuration
+syn keyword nsisAttribute InstallColors InstProgressFlags AutoCloseWindow
+syn keyword nsisAttribute ShowInstDetails DetailsButtonText CompletedText
+
+"INSTALLER ATTRIBUTES - Uninstall configuration
+syn keyword nsisAttribute UninstallText UninstallIcon UninstallCaption
+syn keyword nsisAttribute UninstallSubCaption ShowUninstDetails UninstallButtonText
+
+"COMPILER ATTRIBUTES
+syn keyword nsisCompiler SetOverwrite SetCompress SetCompressor SetDatablockOptimize SetDateSave
+
+
+"FUNCTIONS - general purpose
+syn keyword nsisInstruction SetOutPath File Exec ExecWait ExecShell
+syn keyword nsisInstruction Rename Delete RMDir
+
+"FUNCTIONS - registry & ini
+syn keyword nsisInstruction WriteRegStr WriteRegExpandStr WriteRegDWORD WriteRegBin
+syn keyword nsisInstruction WriteINIStr ReadRegStr ReadRegDWORD ReadINIStr ReadEnvStr
+syn keyword nsisInstruction ExpandEnvStrings DeleteRegValue DeleteRegKey EnumRegKey
+syn keyword nsisInstruction EnumRegValue DeleteINISec DeleteINIStr
+
+"FUNCTIONS - general purpose, advanced
+syn keyword nsisInstruction CreateDirectory CopyFiles SetFileAttributes CreateShortCut
+syn keyword nsisInstruction GetFullPathName SearchPath GetTempFileName CallInstDLL
+syn keyword nsisInstruction RegDLL UnRegDLL GetDLLVersion GetDLLVersionLocal
+syn keyword nsisInstruction GetFileTime GetFileTimeLocal
+
+"FUNCTIONS - Branching, flow control, error checking, user interaction, etc instructions
+syn keyword nsisInstruction Goto Call Return IfErrors ClearErrors SetErrors FindWindow
+syn keyword nsisInstruction SendMessage IsWindow IfFileExists MessageBox StrCmp
+syn keyword nsisInstruction IntCmp IntCmpU Abort Quit GetFunctionAddress GetLabelAddress
+syn keyword nsisInstruction GetCurrentAddress
+
+"FUNCTIONS - File and directory i/o instructions
+syn keyword nsisInstruction FindFirst FindNext FindClose FileOpen FileClose FileRead
+syn keyword nsisInstruction FileWrite FileReadByte FileWriteByte FileSeek
+
+"FUNCTIONS - Misc instructions
+syn keyword nsisInstruction SetDetailsView SetDetailsPrint SetAutoClose DetailPrint
+syn keyword nsisInstruction Sleep BringToFront HideWindow SetShellVarContext
+
+"FUNCTIONS - String manipulation support
+syn keyword nsisInstruction StrCpy StrLen
+
+"FUNCTIONS - Stack support
+syn keyword nsisInstruction Push Pop Exch
+
+"FUNCTIONS - Integer manipulation support
+syn keyword nsisInstruction IntOp IntFmt
+
+"FUNCTIONS - Rebooting support
+syn keyword nsisInstruction Reboot IfRebootFlag SetRebootFlag
+
+"FUNCTIONS - Uninstaller instructions
+syn keyword nsisInstruction WriteUninstaller
+
+"FUNCTIONS - Install logging instructions
+syn keyword nsisInstruction LogSet LogText
+
+"FUNCTIONS - Section management instructions
+syn keyword nsisInstruction SectionSetFlags SectionGetFlags SectionSetText
+syn keyword nsisInstruction SectionGetText
+
+
+"SPECIAL FUNCTIONS - install
+syn match nsisCallback "\.onInit"
+syn match nsisCallback "\.onUserAbort"
+syn match nsisCallback "\.onInstSuccess"
+syn match nsisCallback "\.onInstFailed"
+syn match nsisCallback "\.onVerifyInstDir"
+syn match nsisCallback "\.onNextPage"
+syn match nsisCallback "\.onPrevPage"
+syn match nsisCallback "\.onSelChange"
+
+"SPECIAL FUNCTIONS - uninstall
+syn match nsisCallback "un\.onInit"
+syn match nsisCallback "un\.onUserAbort"
+syn match nsisCallback "un\.onInstSuccess"
+syn match nsisCallback "un\.onInstFailed"
+syn match nsisCallback "un\.onVerifyInstDir"
+syn match nsisCallback "un\.onNextPage"
+
+
+"STATEMENTS - sections
+syn keyword nsisStatement Section SectionIn SectionEnd SectionDivider
+syn keyword nsisStatement AddSize
+
+"STATEMENTS - functions
+syn keyword nsisStatement Function FunctionEnd
+
+"STATEMENTS - pages
+syn keyword nsisStatement Page UninstPage PageEx PageExEnc PageCallbacks
+
+
+"ERROR
+syn keyword nsisError UninstallExeName
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_nsis_syn_inits")
+
+ if version < 508
+ let did_nsys_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+
+ HiLink nsisInstruction Function
+ HiLink nsisComment Comment
+ HiLink nsisLocalLabel Label
+ HiLink nsisGlobalLabel Label
+ HiLink nsisStatement Statement
+ HiLink nsisString String
+ HiLink nsisBoolean Boolean
+ HiLink nsisAttribOptions Constant
+ HiLink nsisExecShell Constant
+ HiLink nsisFileAttrib Constant
+ HiLink nsisMessageBox Constant
+ HiLink nsisRegistry Identifier
+ HiLink nsisNumber Number
+ HiLink nsisError Error
+ HiLink nsisUserVar Identifier
+ HiLink nsisSysVar Identifier
+ HiLink nsisAttribute Type
+ HiLink nsisCompiler Type
+ HiLink nsisTodo Todo
+ HiLink nsisCallback Operator
+ " preprocessor commands
+ HiLink nsisPreprocSubst PreProc
+ HiLink nsisDefine Define
+ HiLink nsisMacro Macro
+ HiLink nsisPreCondit PreCondit
+ HiLink nsisInclude Include
+ HiLink nsisSystem PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "nsis"
+
diff --git a/runtime/syntax/objc.vim b/runtime/syntax/objc.vim
new file mode 100644
index 000000000..5a965a0f1
--- /dev/null
+++ b/runtime/syntax/objc.vim
@@ -0,0 +1,107 @@
+" Vim syntax file
+" Language: Objective C
+" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
+" Ex-maintainer: Anthony Hodsdon <ahodsdon@fastmail.fm>
+" First Author: Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de>
+" Last Change: 2004 May 20
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if &filetype != 'objcpp'
+ " Read the C syntax to start with
+ if version < 600
+ source <sfile>:p:h/c.vim
+ else
+ runtime! syntax/c.vim
+ endif
+endif
+
+" Objective C extentions follow below
+"
+" NOTE: Objective C is abbreviated to ObjC/objc
+" and uses *.h, *.m as file extensions!
+
+
+" ObjC keywords, types, type qualifiers etc.
+syn keyword objcStatement self super _cmd
+syn keyword objcType id Class SEL IMP BOOL nil Nil
+syn keyword objcTypeModifier bycopy in out inout oneway
+
+" Match the ObjC #import directive (like C's #include)
+syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match objcImported display contained "<[_0-9a-zA-Z.\/]*>"
+syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported
+
+" Match the important ObjC directives
+syn match objcScopeDecl "@public\|@private\|@protected"
+syn match objcDirective "@interface\|@implementation"
+syn match objcDirective "@class\|@end\|@defs"
+syn match objcDirective "@encode\|@protocol\|@selector"
+
+" Match the ObjC method types
+"
+" NOTE: here I match only the indicators, this looks
+" much nicer and reduces cluttering color highlightings.
+" However, if you prefer full method declaration matching
+" append .* at the end of the next two patterns!
+"
+syn match objcInstMethod "^\s*-\s*"
+syn match objcFactMethod "^\s*+\s*"
+
+" To distinguish from a header inclusion from a protocol list.
+syn match objcProtocol display "<[_a-zA-Z][_a-zA-Z0-9]*>" contains=objcType,cType,Type
+
+
+" To distinguish labels from the keyword for a method's parameter.
+syn region objcKeyForMethodParam display
+ \ start="^\s*[_a-zA-Z][_a-zA-Z0-9]*\s*:\s*("
+ \ end=")\s*[_a-zA-Z][_a-zA-Z0-9]*"
+ \ contains=objcType,objcTypeModifier,cType,cStructure,cStorageClass,Type
+
+" Objective-C Constant Strings
+syn match objcSpecial display "%@" contained
+syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial
+
+" Objective-C Message Expressions
+syn region objcMessage display start="\[" end="\]" contains=objcMessage,objcStatement,objcType,objcTypeModifier,objcString,objcConstant,objcDirective,cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,Type
+
+syn cluster cParenGroup add=objcMessage
+syn cluster cPreProcGroup add=objcMessage
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_objc_syntax_inits")
+ if version < 508
+ let did_objc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink objcImport Include
+ HiLink objcImported cString
+ HiLink objcTypeModifier objcType
+ HiLink objcType Type
+ HiLink objcScopeDecl Statement
+ HiLink objcInstMethod Function
+ HiLink objcFactMethod Function
+ HiLink objcStatement Statement
+ HiLink objcDirective Statement
+ HiLink objcKeyForMethodParam None
+ HiLink objcString cString
+ HiLink objcSpecial Special
+ HiLink objcProtocol None
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "objc"
+
+" vim: ts=8
diff --git a/runtime/syntax/objcpp.vim b/runtime/syntax/objcpp.vim
new file mode 100644
index 000000000..5ce380cc7
--- /dev/null
+++ b/runtime/syntax/objcpp.vim
@@ -0,0 +1,31 @@
+" Vim syntax file
+" Language: ObjC++
+" Maintainer: Anthony Hodsdon <ahodsdon@fastmail.fm>
+" Last change: 2003 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read in C++ and ObjC syntax files
+if version < 600
+ so <sfile>:p:h/cpp.vim
+ so <sflie>:p:h/objc.vim
+else
+ runtime! syntax/cpp.vim
+ unlet b:current_syntax
+ runtime! syntax/objc.vim
+endif
+
+" Note that we already have a region for method calls ( [objc_class method] )
+" by way of cBracket.
+syn region objCFunc start="^\s*[-+]" end="$" contains=ALLBUT,cErrInParen,cErrInBracket
+
+syn keyword objCppNonStructure class template namespace transparent contained
+syn keyword objCppNonStatement new delete friend using transparent contained
+
+let b:current_syntax = "objcpp"
diff --git a/runtime/syntax/ocaml.vim b/runtime/syntax/ocaml.vim
new file mode 100644
index 000000000..95534a489
--- /dev/null
+++ b/runtime/syntax/ocaml.vim
@@ -0,0 +1,317 @@
+" Vim syntax file
+" Language: OCaml
+" Filenames: *.ml *.mli *.mll *.mly
+" Maintainers: Markus Mottl <markus@oefai.at>
+" Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de>
+" Issac Trotts <<ijtrotts@ucdavis.edu>
+" URL: http://www.oefai.at/~markus/vim/syntax/ocaml.vim
+" Last Change: 2003 May 04
+" 2002 Oct 24 - Small fix for "module type" (MM)
+" 2002 Jun 16 - Added "&&", "<" and ">" as operators (MM)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" OCaml is case sensitive.
+syn case match
+
+" Script headers highlighted like comments
+syn match ocamlComment "^#!.*"
+
+" Scripting directives
+syn match ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|trace\|untrace\|untrace_all\|print_depth\|print_length\)\>"
+
+" lowercase identifier - the standard way to match
+syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
+
+syn match ocamlKeyChar "|"
+
+" Errors
+syn match ocamlBraceErr "}"
+syn match ocamlBrackErr "\]"
+syn match ocamlParenErr ")"
+syn match ocamlArrErr "|]"
+
+syn match ocamlCommentErr "\*)"
+
+syn match ocamlCountErr "\<downto\>"
+syn match ocamlCountErr "\<to\>"
+
+if !exists("ocaml_revised")
+ syn match ocamlDoErr "\<do\>"
+endif
+
+syn match ocamlDoneErr "\<done\>"
+syn match ocamlThenErr "\<then\>"
+
+" Error-highlighting of "end" without synchronization:
+" as keyword or as error (default)
+if exists("ocaml_noend_error")
+ syn match ocamlKeyword "\<end\>"
+else
+ syn match ocamlEndErr "\<end\>"
+endif
+
+" Some convenient clusters
+syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
+
+syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
+
+syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlPreMPRestr,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod
+
+
+" Enclosing delimiters
+syn region ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
+syn region ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
+syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
+syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
+
+
+" Comments
+syn region ocamlComment start="(\*" end="\*)" contains=ocamlComment,ocamlTodo
+syn keyword ocamlTodo contained TODO FIXME XXX
+
+
+" Objects
+syn region ocamlEnd matchgroup=ocamlKeyword start="\<object\>" matchgroup=ocamlKeyword end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
+
+
+" Blocks
+if !exists("ocaml_revised")
+ syn region ocamlEnd matchgroup=ocamlKeyword start="\<begin\>" matchgroup=ocamlKeyword end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
+endif
+
+
+" "for"
+syn region ocamlNone matchgroup=ocamlKeyword start="\<for\>" matchgroup=ocamlKeyword end="\<\(to\|downto\)\>" contains=ALLBUT,@ocamlContained,ocamlCountErr
+
+
+" "do"
+if !exists("ocaml_revised")
+ syn region ocamlDo matchgroup=ocamlKeyword start="\<do\>" matchgroup=ocamlKeyword end="\<done\>" contains=ALLBUT,@ocamlContained,ocamlDoneErr
+endif
+
+" "if"
+syn region ocamlNone matchgroup=ocamlKeyword start="\<if\>" matchgroup=ocamlKeyword end="\<then\>" contains=ALLBUT,@ocamlContained,ocamlThenErr
+
+
+"" Modules
+
+" "struct"
+syn region ocamlStruct matchgroup=ocamlModule start="\<struct\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
+
+" "sig"
+syn region ocamlSig matchgroup=ocamlModule start="\<sig\>" matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
+syn region ocamlModSpec matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contained contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlModTRWith,ocamlMPRestr
+
+" "open"
+syn region ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment
+
+" "include"
+syn match ocamlKeyword "\<include\>" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
+
+" "module" - somewhat complicated stuff ;-)
+syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
+syn region ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|="me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS
+syn region ocamlModParam start="([^*]" end=")" contained contains=@ocamlAENoParen,ocamlModParam1
+syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlPreMPRestr
+
+syn region ocamlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlMPRestr,ocamlModTypeRestr
+
+syn region ocamlMPRestr start=":" end="."me=e-1 contained contains=@ocamlComment skipwhite skipempty nextgroup=ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3
+syn region ocamlMPRestr1 matchgroup=ocamlModule start="\ssig\s\=" matchgroup=ocamlModule end="\<end\>" contained contains=ALLBUT,@ocamlContained,ocamlEndErr,ocamlModule
+syn region ocamlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=ocamlKeyword end="->" contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam skipwhite skipempty nextgroup=ocamlFuncWith,ocamlMPRestr2
+syn match ocamlMPRestr3 "\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*" contained
+syn match ocamlModPreRHS "=" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
+syn region ocamlModRHS start="." end=".\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
+syn match ocamlFullMod "\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
+
+syn region ocamlFuncWith start="([^*]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
+syn region ocamlFuncStruct matchgroup=ocamlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlModule end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
+
+syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*\>" contained
+syn region ocamlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@ocamlAENoParen,ocamlWith
+syn match ocamlWith "\<\(\u\(\w\|'\)*\.\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=ocamlWithRest
+syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@ocamlContained
+
+" "module type"
+syn region ocamlKeyword start="\<module\>\s*\<type\>" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
+syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s
+
+syn keyword ocamlKeyword and as assert class
+syn keyword ocamlKeyword constraint else
+syn keyword ocamlKeyword exception external fun
+
+syn keyword ocamlKeyword in inherit initializer
+syn keyword ocamlKeyword land lazy let match
+syn keyword ocamlKeyword method mutable new of
+syn keyword ocamlKeyword parser private raise rec
+syn keyword ocamlKeyword try type
+syn keyword ocamlKeyword val virtual when while with
+
+if exists("ocaml_revised")
+ syn keyword ocamlKeyword do value
+ syn keyword ocamlBoolean True False
+else
+ syn keyword ocamlKeyword function
+ syn keyword ocamlBoolean true false
+ syn match ocamlKeyChar "!"
+endif
+
+syn keyword ocamlType array bool char exn float format int
+syn keyword ocamlType list option string unit
+
+syn keyword ocamlOperator asr lor lsl lsr lxor mod not
+
+syn match ocamlConstructor "(\s*)"
+syn match ocamlConstructor "\[\s*\]"
+syn match ocamlConstructor "\[|\s*>|]"
+syn match ocamlConstructor "\[<\s*>\]"
+syn match ocamlConstructor "\u\(\w\|'\)*\>"
+
+" Polymorphic variants
+syn match ocamlConstructor "`\w\(\w\|'\)*\>"
+
+" Module prefix
+syn match ocamlModPath "\u\(\w\|'\)*\."he=e-1
+
+syn match ocamlCharacter "'\\\d\d\d'\|'\\[\'ntbr]'\|'.'"
+syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
+syn match ocamlCharErr "'\\[^\'ntbr]'"
+syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+syn match ocamlFunDef "->"
+syn match ocamlRefAssign ":="
+syn match ocamlTopStop ";;"
+syn match ocamlOperator "\^"
+syn match ocamlOperator "::"
+
+syn match ocamlOperator "&&"
+syn match ocamlOperator "<"
+syn match ocamlOperator ">"
+syn match ocamlAnyVar "\<_\>"
+syn match ocamlKeyChar "|[^\]]"me=e-1
+syn match ocamlKeyChar ";"
+syn match ocamlKeyChar "\~"
+syn match ocamlKeyChar "?"
+syn match ocamlKeyChar "\*"
+syn match ocamlKeyChar "="
+
+if exists("ocaml_revised")
+ syn match ocamlErr "<-"
+else
+ syn match ocamlOperator "<-"
+endif
+
+syn match ocamlNumber "\<-\=\d\+\>"
+syn match ocamlNumber "\<-\=0[x|X]\x\+\>"
+syn match ocamlNumber "\<-\=0[o|O]\o\+\>"
+syn match ocamlNumber "\<-\=0[b|B][01]\+\>"
+syn match ocamlFloat "\<-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=[fl]\=\>"
+
+" Labels
+syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
+syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1
+syn region ocamlLabel transparent matchgroup=ocamlLabel start="?(\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
+
+
+" Synchronization
+syn sync minlines=50
+syn sync maxlines=500
+
+if !exists("ocaml_revised")
+ syn sync match ocamlDoSync grouphere ocamlDo "\<do\>"
+ syn sync match ocamlDoSync groupthere ocamlDo "\<done\>"
+endif
+
+if exists("ocaml_revised")
+ syn sync match ocamlEndSync grouphere ocamlEnd "\<\(object\)\>"
+else
+ syn sync match ocamlEndSync grouphere ocamlEnd "\<\(begin\|object\)\>"
+endif
+
+syn sync match ocamlEndSync groupthere ocamlEnd "\<end\>"
+syn sync match ocamlStructSync grouphere ocamlStruct "\<struct\>"
+syn sync match ocamlStructSync groupthere ocamlStruct "\<end\>"
+syn sync match ocamlSigSync grouphere ocamlSig "\<sig\>"
+syn sync match ocamlSigSync groupthere ocamlSig "\<end\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ocaml_syntax_inits")
+ if version < 508
+ let did_ocaml_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ocamlBraceErr Error
+ HiLink ocamlBrackErr Error
+ HiLink ocamlParenErr Error
+ HiLink ocamlArrErr Error
+
+ HiLink ocamlCommentErr Error
+
+ HiLink ocamlCountErr Error
+ HiLink ocamlDoErr Error
+ HiLink ocamlDoneErr Error
+ HiLink ocamlEndErr Error
+ HiLink ocamlThenErr Error
+
+ HiLink ocamlCharErr Error
+
+ HiLink ocamlErr Error
+
+ HiLink ocamlComment Comment
+
+ HiLink ocamlModPath Include
+ HiLink ocamlModule Include
+ HiLink ocamlModParam1 Include
+ HiLink ocamlModType Include
+ HiLink ocamlMPRestr3 Include
+ HiLink ocamlFullMod Include
+ HiLink ocamlModTypeRestr Include
+ HiLink ocamlWith Include
+ HiLink ocamlMTDef Include
+
+ HiLink ocamlScript Include
+
+ HiLink ocamlConstructor Constant
+
+ HiLink ocamlModPreRHS Keyword
+ HiLink ocamlMPRestr2 Keyword
+ HiLink ocamlKeyword Keyword
+ HiLink ocamlFunDef Keyword
+ HiLink ocamlRefAssign Keyword
+ HiLink ocamlKeyChar Keyword
+ HiLink ocamlAnyVar Keyword
+ HiLink ocamlTopStop Keyword
+ HiLink ocamlOperator Keyword
+
+ HiLink ocamlBoolean Boolean
+ HiLink ocamlCharacter Character
+ HiLink ocamlNumber Number
+ HiLink ocamlFloat Float
+ HiLink ocamlString String
+
+ HiLink ocamlLabel Identifier
+
+ HiLink ocamlType Type
+
+ HiLink ocamlTodo Todo
+
+ HiLink ocamlEncl Keyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ocaml"
+
+" vim: ts=8
diff --git a/runtime/syntax/occam.vim b/runtime/syntax/occam.vim
new file mode 100644
index 000000000..1c84bf00f
--- /dev/null
+++ b/runtime/syntax/occam.vim
@@ -0,0 +1,126 @@
+" Vim syntax file
+" Language: occam
+" Copyright: Fred Barnes <frmb2@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
+" Maintainer: Mario Schweigler <ms44@kent.ac.uk>
+" Last Change: 24 May 2003
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+"{{{ Settings
+" Set shift width for indent
+setlocal shiftwidth=2
+" Set the tab key size to two spaces
+setlocal softtabstop=2
+" Let tab keys always be expanded to spaces
+setlocal expandtab
+
+" Dots are valid in occam identifiers
+setlocal iskeyword+=.
+"}}}
+
+syn case match
+
+syn keyword occamType BYTE BOOL INT INT16 INT32 INT64 REAL32 REAL64 ANY
+syn keyword occamType CHAN DATA OF TYPE TIMER INITIAL VAL PORT MOBILE PLACED
+syn keyword occamType PROCESSOR PACKED RECORD PROTOCOL SHARED ROUND TRUNC
+
+syn keyword occamStructure SEQ PAR IF ALT PRI FORKING PLACE AT
+
+syn keyword occamKeyword PROC IS TRUE FALSE SIZE RECURSIVE REC
+syn keyword occamKeyword RETYPES RESHAPES STEP FROM FOR RESCHEDULE STOP SKIP FORK
+syn keyword occamKeyword FUNCTION VALOF RESULT ELSE CLONE CLAIM
+syn keyword occamBoolean TRUE FALSE
+syn keyword occamRepeat WHILE
+syn keyword occamConditional CASE
+syn keyword occamConstant MOSTNEG MOSTPOS
+
+syn match occamBrackets /\[\|\]/
+syn match occamParantheses /(\|)/
+
+syn keyword occamOperator AFTER TIMES MINUS PLUS INITIAL REM AND OR XOR NOT
+syn keyword occamOperator BITAND BITOR BITNOT BYTESIN OFFSETOF
+
+syn match occamOperator /::\|:=\|?\|!/
+syn match occamOperator /<\|>\|+\|-\|\*\|\/\|\\\|=\|\~/
+syn match occamOperator /@\|\$\$\|%\|&&\|<&\|&>\|<\]\|\[>\|\^/
+
+syn match occamSpecialChar /\M**\|*'\|*"\|*#\(\[0-9A-F\]\+\)/ contained
+syn match occamChar /\M\L\='\[^*\]'/
+syn match occamChar /L'[^']*'/ contains=occamSpecialChar
+
+syn case ignore
+syn match occamTodo /\<todo\>:\=/ contained
+syn match occamNote /\<note\>:\=/ contained
+syn case match
+syn keyword occamNote NOT contained
+
+syn match occamComment /--.*/ contains=occamCommentTitle,occamTodo,occamNote
+syn match occamCommentTitle /--\s*\u\a*\(\s\+\u\a*\)*:/hs=s+2 contained contains=occamTodo,occamNote
+syn match occamCommentTitle /--\s*KROC-LIBRARY\(\.so\|\.a\)\=\s*$/hs=s+2 contained
+syn match occamCommentTitle /--\s*\(KROC-OPTIONS:\|RUN-PARAMETERS:\)/hs=s+2 contained
+
+syn match occamIdentifier /\<[A-Z.][A-Z.0-9]*\>/
+syn match occamFunction /\<[A-Za-z.][A-Za-z0-9.]*\>/ contained
+
+syn match occamPPIdentifier /##.\{-}\>/
+
+syn region occamString start=/"/ skip=/\M*"/ end=/"/ contains=occamSpecialChar
+syn region occamCharString start=/'/ end=/'/ contains=occamSpecialChar
+
+syn match occamNumber /\<\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
+syn match occamNumber /-\d\+\(\.\d\+\(E\(+\|-\)\d\+\)\=\)\=/
+syn match occamNumber /#\(\d\|[A-F]\)\+/
+syn match occamNumber /-#\(\d\|[A-F]\)\+/
+
+syn keyword occamCDString SHARED EXTERNAL DEFINED NOALIAS NOUSAGE NOT contained
+syn keyword occamCDString FILE LINE PROCESS.PRIORITY OCCAM2.5 contained
+syn keyword occamCDString USER.DEFINED.OPERATORS INITIAL.DECL MOBILES contained
+syn keyword occamCDString BLOCKING.SYSCALLS VERSION NEED.QUAD.ALIGNMENT contained
+syn keyword occamCDString TARGET.CANONICAL TARGET.CPU TARGET.OS TARGET.VENDOR contained
+syn keyword occamCDString TRUE FALSE AND OR contained
+syn match occamCDString /<\|>\|=\|(\|)/ contained
+
+syn region occamCDirective start=/#\(USE\|INCLUDE\|PRAGMA\|DEFINE\|UNDEFINE\|UNDEF\|IF\|ELIF\|ELSE\|ENDIF\|WARNING\|ERROR\|RELAX\)\>/ end=/$/ contains=occamString,occamComment,occamCDString
+
+if version >= 508 || !exists("did_occam_syn_inits")
+ if version < 508
+ let did_occam_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink occamType Type
+ HiLink occamKeyword Keyword
+ HiLink occamComment Comment
+ HiLink occamCommentTitle PreProc
+ HiLink occamTodo Todo
+ HiLink occamNote Todo
+ HiLink occamString String
+ HiLink occamCharString String
+ HiLink occamNumber Number
+ HiLink occamCDirective PreProc
+ HiLink occamCDString String
+ HiLink occamPPIdentifier PreProc
+ HiLink occamBoolean Boolean
+ HiLink occamSpecialChar SpecialChar
+ HiLink occamChar Character
+ HiLink occamStructure Structure
+ HiLink occamIdentifier Identifier
+ HiLink occamConstant Constant
+ HiLink occamOperator Operator
+ HiLink occamFunction Ignore
+ HiLink occamRepeat Repeat
+ HiLink occamConditional Conditional
+ HiLink occamBrackets Type
+ HiLink occamParantheses Delimiter
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "occam"
+
diff --git a/runtime/syntax/omnimark.vim b/runtime/syntax/omnimark.vim
new file mode 100644
index 000000000..698b3c09f
--- /dev/null
+++ b/runtime/syntax/omnimark.vim
@@ -0,0 +1,123 @@
+" Vim syntax file
+" Language: Omnimark
+" Maintainer: Paul Terray <mailto:terray@4dconcept.fr>
+" Last Change: 11 Oct 2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version < 600
+ set iskeyword=@,48-57,_,128-167,224-235,-
+else
+ setlocal iskeyword=@,48-57,_,128-167,224-235,-
+endif
+
+syn keyword omnimarkKeywords ACTIVATE AGAIN
+syn keyword omnimarkKeywords CATCH CLEAR CLOSE COPY COPY-CLEAR CROSS-TRANSLATE
+syn keyword omnimarkKeywords DEACTIVATE DECLARE DECREMENT DEFINE DISCARD DIVIDE DO DOCUMENT-END DOCUMENT-START DONE DTD-START
+syn keyword omnimarkKeywords ELEMENT ELSE ESCAPE EXIT
+syn keyword omnimarkKeywords FAIL FIND FIND-END FIND-START FORMAT
+syn keyword omnimarkKeywords GROUP
+syn keyword omnimarkKeywords HALT HALT-EVERYTHING
+syn keyword omnimarkKeywords IGNORE IMPLIED INCLUDE INCLUDE-END INCLUDE-START INCREMENT INPUT
+syn keyword omnimarkKeywords JOIN
+syn keyword omnimarkKeywords LINE-END LINE-START LOG LOOKAHEAD
+syn keyword omnimarkKeywords MACRO
+syn keyword omnimarkKeywords MACRO-END MARKED-SECTION MARKUP-COMMENT MARKUP-ERROR MARKUP-PARSER MASK MATCH MINUS MODULO
+syn keyword omnimarkKeywords NEW NEWLINE NEXT
+syn keyword omnimarkKeywords OPEN OUTPUT OUTPUT-TO OVER
+syn keyword omnimarkKeywords PROCESS PROCESS-END PROCESS-START PROCESSING-INSTRUCTION PROLOG-END PROLOG-IN-ERROR PUT
+syn keyword omnimarkKeywords REMOVE REOPEN REPEAT RESET RETHROW RETURN
+syn keyword omnimarkKeywords WHEN WHITE-SPACE
+syn keyword omnimarkKeywords SAVE SAVE-CLEAR SCAN SELECT SET SGML SGML-COMMENT SGML-DECLARATION-END SGML-DTD SGML-DTDS SGML-ERROR SGML-IN SGML-OUT SGML-PARSE SGML-PARSER SHIFT SUBMIT SUCCEED SUPPRESS
+syn keyword omnimarkKeywords SYSTEM-CALL
+syn keyword omnimarkKeywords TEST-SYSTEM THROW TO TRANSLATE
+syn keyword omnimarkKeywords UC UL UNLESS UP-TRANSLATE
+syn keyword omnimarkKeywords XML-PARSE
+
+syn keyword omnimarkCommands ACTIVE AFTER ANCESTOR AND ANOTHER ARG AS ATTACHED ATTRIBUTE ATTRIBUTES
+syn keyword omnimarkCommands BASE BEFORE BINARY BINARY-INPUT BINARY-MODE BINARY-OUTPUT BREAK-WIDTH BUFFER BY
+syn keyword omnimarkCommands CASE CHILDREN CLOSED COMPILED-DATE COMPLEMENT CONREF CONTENT CONTEXT-TRANSLATE COUNTER CREATED CREATING CREATOR CURRENT
+syn keyword omnimarkCommands DATA-ATTRIBUTE DATA-ATTRIBUTES DATA-CONTENT DATA-LETTERS DATE DECLARED-CONREF DECLARED-CURRENT DECLARED-DEFAULTED DECLARED-FIXED DECLARED-IMPLIED DECLARED-REQUIRED
+syn keyword omnimarkCommands DEFAULT-ENTITY DEFAULTED DEFAULTING DELIMITER DIFFERENCE DIRECTORY DOCTYPE DOCUMENT DOCUMENT-ELEMENT DOMAIN-FREE DOWN-TRANSLATE DTD DTD-END DTDS
+syn keyword omnimarkCommands ELEMENTS ELSEWHERE EMPTY ENTITIES ENTITY EPILOG-START EQUAL EXCEPT EXISTS EXTERNAL EXTERNAL-DATA-ENTITY EXTERNAL-ENTITY EXTERNAL-FUNCTION EXTERNAL-OUTPUT-FUNCTION
+syn keyword omnimarkCommands EXTERNAL-TEXT-ENTITY
+syn keyword omnimarkCommands FALSE FILE FUNCTION FUNCTION-LIBRARY
+syn keyword omnimarkCommands GENERAL GLOBAL GREATER-EQUAL GREATER-THAN GROUPS
+syn keyword omnimarkCommands HAS HASNT HERALDED-NAMES
+syn keyword omnimarkCommands ID ID-CHECKING IDREF IDREFS IN IN-LIBRARY INCLUSION INITIAL INITIAL-SIZE INSERTION-BREAK INSTANCE INTERNAL INVALID-DATA IS ISNT ITEM
+syn keyword omnimarkCommands KEY KEYED
+syn keyword omnimarkCommands LAST LASTMOST LC LENGTH LESS-EQUAL LESS-THAN LETTERS LIBRARY LITERAL LOCAL
+syn keyword omnimarkCommands MATCHES MIXED MODIFIABLE
+syn keyword omnimarkCommands NAME NAME-LETTERS NAMECASE NAMED NAMES NDATA-ENTITY NEGATE NESTED-REFERENTS NMTOKEN NMTOKENS NO NO-DEFAULT-IO NON-CDATA NON-IMPLIED NON-SDATA NOT NOTATION NUMBER-OF NUMBERS
+syn keyword omnimarkCommands NUTOKEN NUTOKENS
+syn keyword omnimarkCommands OCCURRENCE OF OPAQUE OPTIONAL OR
+syn keyword omnimarkCommands PARAMETER PARENT PAST PATTERN PLUS PREPARENT PREVIOUS PROPER PUBLIC
+syn keyword omnimarkCommands READ-ONLY READABLE REFERENT REFERENTS REFERENTS-ALLOWED REFERENTS-DISPLAYED REFERENTS-NOT-ALLOWED REMAINDER REPEATED REPLACEMENT-BREAK REVERSED
+syn keyword omnimarkCommands SILENT-REFERENT SIZE SKIP SOURCE SPECIFIED STATUS STREAM SUBDOC-ENTITY SUBDOCUMENT SUBDOCUMENTS SUBELEMENT SWITCH SYMBOL SYSTEM
+syn keyword omnimarkCommands TEXT-MODE THIS TIMES TOKEN TRUE
+syn keyword omnimarkCommands UNANCHORED UNATTACHED UNION USEMAP USING
+syn keyword omnimarkCommands VALUE VALUED VARIABLE
+syn keyword omnimarkCommands WITH WRITABLE
+syn keyword omnimarkCommands XML XML-DTD XML-DTDS
+syn keyword omnimarkCommands YES
+syn keyword omnimarkCommands #ADDITIONAL-INFO #APPINFO #CAPACITY #CHARSET #CLASS #COMMAND-LINE-NAMES #CONSOLE #CURRENT-INPUT #CURRENT-OUTPUT #DATA #DOCTYPE #DOCUMENT #DTD #EMPTY #ERROR #ERROR-CODE
+syn keyword omnimarkCommands #FILE-NAME #FIRST #GROUP #IMPLIED #ITEM #LANGUAGE-VERSION #LAST #LIBPATH #LIBRARY #LIBVALUE #LINE-NUMBER #MAIN-INPUT #MAIN-OUTPUT #MARKUP-ERROR-COUNT #MARKUP-ERROR-TOTAL
+syn keyword omnimarkCommands #MARKUP-PARSER #MARKUP-WARNING-COUNT #MARKUP-WARNING-TOTAL #MESSAGE #NONE #OUTPUT #PLATFORM-INFO #PROCESS-INPUT #PROCESS-OUTPUT #RECOVERY-INFO #SGML #SGML-ERROR-COUNT
+syn keyword omnimarkCommands #SGML-ERROR-TOTAL #SGML-WARNING-COUNT #SGML-WARNING-TOTAL #SUPPRESS #SYNTAX #!
+
+syn keyword omnimarkPatterns ANY ANY-TEXT
+syn keyword omnimarkPatterns BLANK
+syn keyword omnimarkPatterns CDATA CDATA-ENTITY CONTENT-END CONTENT-START
+syn keyword omnimarkPatterns DIGIT
+syn keyword omnimarkPatterns LETTER
+syn keyword omnimarkPatterns NUMBER
+syn keyword omnimarkPatterns PCDATA
+syn keyword omnimarkPatterns RCDATA
+syn keyword omnimarkPatterns SDATA SDATA-ENTITY SPACE
+syn keyword omnimarkPatterns TEXT
+syn keyword omnimarkPatterns VALUE-END VALUE-START
+syn keyword omnimarkPatterns WORD-END WORD-START
+
+syn region omnimarkComment start=";" end="$"
+
+" strings
+syn region omnimarkString matchgroup=Normal start=+'+ end=+'+ skip=+%'+ contains=omnimarkEscape
+syn region omnimarkString matchgroup=Normal start=+"+ end=+"+ skip=+%"+ contains=omnimarkEscape
+syn match omnimarkEscape contained +%.+
+syn match omnimarkEscape contained +%[0-9][0-9]#+
+
+"syn sync maxlines=100
+syn sync minlines=2000
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_omnimark_syntax_inits")
+ if version < 508
+ let did_omnimark_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink omnimarkCommands Statement
+ HiLink omnimarkKeywords Identifier
+ HiLink omnimarkString String
+ HiLink omnimarkPatterns Macro
+" HiLink omnimarkNumber Number
+ HiLink omnimarkComment Comment
+ HiLink omnimarkEscape Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "omnimark"
+
+" vim: ts=8
+
diff --git a/runtime/syntax/openroad.vim b/runtime/syntax/openroad.vim
new file mode 100644
index 000000000..3f9a78d55
--- /dev/null
+++ b/runtime/syntax/openroad.vim
@@ -0,0 +1,266 @@
+" Vim syntax file
+" Language: CA-OpenROAD
+" Maintainer: Luis Moreno <lmoreno@eresmas.net>
+" Last change: 2001 Jun 12
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+"
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+
+" Keywords
+"
+syntax keyword openroadKeyword ABORT ALL ALTER AND ANY AS ASC AT AVG BEGIN
+syntax keyword openroadKeyword BETWEEN BY BYREF CALL CALLFRAME CALLPROC CASE
+syntax keyword openroadKeyword CLEAR CLOSE COMMIT CONNECT CONTINUE COPY COUNT
+syntax keyword openroadKeyword CREATE CURRENT DBEVENT DECLARE DEFAULT DELETE
+syntax keyword openroadKeyword DELETEROW DESC DIRECT DISCONNECT DISTINCT DO
+syntax keyword openroadKeyword DROP ELSE ELSEIF END ENDCASE ENDDECLARE ENDFOR
+syntax keyword openroadKeyword ENDIF ENDLOOP ENDWHILE ESCAPE EXECUTE EXISTS
+syntax keyword openroadKeyword EXIT FETCH FIELD FOR FROM GOTOFRAME GRANT GROUP
+syntax keyword openroadKeyword HAVING IF IMMEDIATE IN INDEX INITIALISE
+syntax keyword openroadKeyword INITIALIZE INQUIRE_INGRES INQUIRE_SQL INSERT
+syntax keyword openroadKeyword INSERTROW INSTALLATION INTEGRITY INTO KEY LIKE
+syntax keyword openroadKeyword LINK MAX MESSAGE METHOD MIN MODE MODIFY NEXT
+syntax keyword openroadKeyword NOECHO NOT NULL OF ON OPEN OPENFRAME OR ORDER
+syntax keyword openroadKeyword PERMIT PROCEDURE PROMPT QUALIFICATION RAISE
+syntax keyword openroadKeyword REGISTER RELOCATE REMOVE REPEAT REPEATED RESUME
+syntax keyword openroadKeyword RETURN RETURNING REVOKE ROLE ROLLBACK RULE SAVE
+syntax keyword openroadKeyword SAVEPOINT SELECT SET SLEEP SOME SUM SYSTEM TABLE
+syntax keyword openroadKeyword THEN TO TRANSACTION UNION UNIQUE UNTIL UPDATE
+syntax keyword openroadKeyword VALUES VIEW WHERE WHILE WITH WORK
+
+syntax keyword openroadTodo contained TODO
+
+" Catch errors caused by wrong parenthesis
+"
+syntax cluster openroadParenGroup contains=openroadParenError,openroadTodo
+syntax region openroadParen transparent start='(' end=')' contains=ALLBUT,@openroadParenGroup
+syntax match openroadParenError ")"
+highlight link openroadParenError cError
+
+" Numbers
+"
+syntax match openroadNumber "\<[0-9]\+\>"
+
+" String
+"
+syntax region openroadString start=+'+ end=+'+
+
+" Operators, Data Types and Functions
+"
+syntax match openroadOperator /[\+\-\*\/=\<\>;\(\)]/
+
+syntax keyword openroadType ARRAY BYTE CHAR DATE DECIMAL FLOAT FLOAT4
+syntax keyword openroadType FLOAT8 INT1 INT2 INT4 INTEGER INTEGER1
+syntax keyword openroadType INTEGER2 INTEGER4 MONEY OBJECT_KEY
+syntax keyword openroadType SECURITY_LABEL SMALLINT TABLE_KEY VARCHAR
+
+syntax keyword openroadFunc IFNULL
+
+" System Classes
+"
+syntax keyword openroadClass ACTIVEFIELD ANALOGFIELD APPFLAG APPSOURCE
+syntax keyword openroadClass ARRAYOBJECT ATTRIBUTEOBJECT BARFIELD
+syntax keyword openroadClass BITMAPOBJECT BOXTRIM BREAKSPEC BUTTONFIELD
+syntax keyword openroadClass CELLATTRIBUTE CHOICEBITMAP CHOICEDETAIL
+syntax keyword openroadClass CHOICEFIELD CHOICEITEM CHOICELIST CLASS
+syntax keyword openroadClass CLASSSOURCE COLUMNCROSS COLUMNFIELD
+syntax keyword openroadClass COMPOSITEFIELD COMPSOURCE CONTROLBUTTON
+syntax keyword openroadClass CROSSTABLE CURSORBITMAP CURSOROBJECT DATASTREAM
+syntax keyword openroadClass DATEOBJECT DBEVENTOBJECT DBSESSIONOBJECT
+syntax keyword openroadClass DISPLAYFORM DYNEXPR ELLIPSESHAPE ENTRYFIELD
+syntax keyword openroadClass ENUMFIELD EVENT EXTOBJECT EXTOBJFIELD
+syntax keyword openroadClass FIELDOBJECT FLEXIBLEFORM FLOATOBJECT FORMFIELD
+syntax keyword openroadClass FRAMEEXEC FRAMEFORM FRAMESOURCE FREETRIM
+syntax keyword openroadClass GHOSTEXEC GHOSTSOURCE IMAGEFIELD IMAGETRIM
+syntax keyword openroadClass INTEGEROBJECT LISTFIELD LISTVIEWCOLATTR
+syntax keyword openroadClass LISTVIEWFIELD LONGBYTEOBJECT LONGVCHAROBJECT
+syntax keyword openroadClass MATRIXFIELD MENUBAR MENUBUTTON MENUFIELD
+syntax keyword openroadClass MENUGROUP MENUITEM MENULIST MENUSEPARATOR
+syntax keyword openroadClass MENUSTACK MENUTOGGLE METHODEXEC METHODOBJECT
+syntax keyword openroadClass MONEYOBJECT OBJECT OPTIONFIELD OPTIONMENU
+syntax keyword openroadClass PALETTEFIELD POPUPBUTTON PROC4GLSOURCE PROCEXEC
+syntax keyword openroadClass PROCHANDLE QUERYCOL QUERYOBJECT QUERYPARM
+syntax keyword openroadClass QUERYTABLE RADIOFIELD RECTANGLESHAPE ROWCROSS
+syntax keyword openroadClass SCALARFIELD SCOPE SCROLLBARFIELD SEGMENTSHAPE
+syntax keyword openroadClass SESSIONOBJECT SHAPEFIELD SLIDERFIELD SQLSELECT
+syntax keyword openroadClass STACKFIELD STRINGOBJECT SUBFORM TABBAR
+syntax keyword openroadClass TABFIELD TABFOLDER TABLEFIELD TABPAGE
+syntax keyword openroadClass TOGGLEFIELD TREE TREENODE TREEVIEWFIELD
+syntax keyword openroadClass USERCLASSOBJECT USEROBJECT VIEWPORTFIELD
+
+" System Events
+"
+syntax keyword openroadEvent CHILDCLICK CHILDCLICKPOINT CHILDCOLLAPSED
+syntax keyword openroadEvent CHILDDETAILS CHILDDOUBLECLICK CHILDDRAGBOX
+syntax keyword openroadEvent CHILDDRAGSEGMENT CHILDENTRY CHILDEXIT
+syntax keyword openroadEvent CHILDEXPANDED CHILDHEADERCLICK CHILDMOVED
+syntax keyword openroadEvent CHILDPROPERTIES CHILDRESIZED CHILDSCROLL
+syntax keyword openroadEvent CHILDSELECT CHILDSELECTIONCHANGED CHILDSETVALUE
+syntax keyword openroadEvent CHILDUNSELECT CHILDVALIDATE CLICK CLICKPOINT
+syntax keyword openroadEvent COLLAPSED DBEVENT DETAILS DOUBLECLICK DRAGBOX
+syntax keyword openroadEvent DRAGSEGMENT ENTRY EXIT EXPANDED EXTCLASSEVENT
+syntax keyword openroadEvent FRAMEACTIVATE FRAMEDEACTIVATE HEADERCLICK
+syntax keyword openroadEvent INSERTROW LABELCHANGED MOVED PAGEACTIVATED
+syntax keyword openroadEvent PAGECHANGED PAGEDEACTIVATED PROPERTIES RESIZED
+syntax keyword openroadEvent SCROLL SELECT SELECTIONCHANGED SETVALUE
+syntax keyword openroadEvent TERMINATE UNSELECT USEREVENT VALIDATE
+syntax keyword openroadEvent WINDOWCLOSE WINDOWICON WINDOWMOVED WINDOWRESIZED
+syntax keyword openroadEvent WINDOWVISIBLE
+
+" System Constants
+"
+syntax keyword openroadConst BF_BMP BF_GIF BF_SUNRASTER BF_TIFF
+syntax keyword openroadConst BF_WINDOWCURSOR BF_WINDOWICON BF_XBM
+syntax keyword openroadConst CC_BACKGROUND CC_BLACK CC_BLUE CC_BROWN CC_CYAN
+syntax keyword openroadConst CC_DEFAULT_1 CC_DEFAULT_10 CC_DEFAULT_11
+syntax keyword openroadConst CC_DEFAULT_12 CC_DEFAULT_13 CC_DEFAULT_14
+syntax keyword openroadConst CC_DEFAULT_15 CC_DEFAULT_16 CC_DEFAULT_17
+syntax keyword openroadConst CC_DEFAULT_18 CC_DEFAULT_19 CC_DEFAULT_2
+syntax keyword openroadConst CC_DEFAULT_20 CC_DEFAULT_21 CC_DEFAULT_22
+syntax keyword openroadConst CC_DEFAULT_23 CC_DEFAULT_24 CC_DEFAULT_25
+syntax keyword openroadConst CC_DEFAULT_26 CC_DEFAULT_27 CC_DEFAULT_28
+syntax keyword openroadConst CC_DEFAULT_29 CC_DEFAULT_3 CC_DEFAULT_30
+syntax keyword openroadConst CC_DEFAULT_4 CC_DEFAULT_5 CC_DEFAULT_6
+syntax keyword openroadConst CC_DEFAULT_7 CC_DEFAULT_8 CC_DEFAULT_9
+syntax keyword openroadConst CC_FOREGROUND CC_GRAY CC_GREEN CC_LIGHT_BLUE
+syntax keyword openroadConst CC_LIGHT_BROWN CC_LIGHT_CYAN CC_LIGHT_GRAY
+syntax keyword openroadConst CC_LIGHT_GREEN CC_LIGHT_ORANGE CC_LIGHT_PINK
+syntax keyword openroadConst CC_LIGHT_PURPLE CC_LIGHT_RED CC_LIGHT_YELLOW
+syntax keyword openroadConst CC_MAGENTA CC_ORANGE CC_PALE_BLUE CC_PALE_BROWN
+syntax keyword openroadConst CC_PALE_CYAN CC_PALE_GRAY CC_PALE_GREEN
+syntax keyword openroadConst CC_PALE_ORANGE CC_PALE_PINK CC_PALE_PURPLE
+syntax keyword openroadConst CC_PALE_RED CC_PALE_YELLOW CC_PINK CC_PURPLE
+syntax keyword openroadConst CC_RED CC_SYS_ACTIVEBORDER CC_SYS_ACTIVECAPTION
+syntax keyword openroadConst CC_SYS_APPWORKSPACE CC_SYS_BACKGROUND
+syntax keyword openroadConst CC_SYS_BTNFACE CC_SYS_BTNSHADOW CC_SYS_BTNTEXT
+syntax keyword openroadConst CC_SYS_CAPTIONTEXT CC_SYS_GRAYTEXT
+syntax keyword openroadConst CC_SYS_HIGHLIGHT CC_SYS_HIGHLIGHTTEXT
+syntax keyword openroadConst CC_SYS_INACTIVEBORDER CC_SYS_INACTIVECAPTION
+syntax keyword openroadConst CC_SYS_INACTIVECAPTIONTEXT CC_SYS_MENU
+syntax keyword openroadConst CC_SYS_MENUTEXT CC_SYS_SCROLLBAR CC_SYS_SHADOW
+syntax keyword openroadConst CC_SYS_WINDOW CC_SYS_WINDOWFRAME
+syntax keyword openroadConst CC_SYS_WINDOWTEXT CC_WHITE CC_YELLOW
+syntax keyword openroadConst CL_INVALIDVALUE CP_BOTH CP_COLUMNS CP_NONE
+syntax keyword openroadConst CP_ROWS CS_CLOSED CS_CURRENT CS_NOCURRENT
+syntax keyword openroadConst CS_NO_MORE_ROWS CS_OPEN CS_OPEN_CACHED DC_BW
+syntax keyword openroadConst DC_COLOR DP_AUTOSIZE_FIELD DP_CLIP_IMAGE
+syntax keyword openroadConst DP_SCALE_IMAGE_H DP_SCALE_IMAGE_HW
+syntax keyword openroadConst DP_SCALE_IMAGE_W DS_CONNECTED DS_DISABLED
+syntax keyword openroadConst DS_DISCONNECTED DS_INGRES_DBMS DS_NO_DBMS
+syntax keyword openroadConst DS_ORACLE_DBMS DS_SQLSERVER_DBMS DV_NULL
+syntax keyword openroadConst DV_STRING DV_SYSTEM EH_NEXT_HANDLER EH_RESUME
+syntax keyword openroadConst EH_RETRY EP_INTERACTIVE EP_NONE EP_OUTPUT
+syntax keyword openroadConst ER_FAIL ER_NAMEEXISTS ER_OK ER_OUTOFRANGE
+syntax keyword openroadConst ER_ROWNOTFOUND ER_USER1 ER_USER10 ER_USER2
+syntax keyword openroadConst ER_USER3 ER_USER4 ER_USER5 ER_USER6 ER_USER7
+syntax keyword openroadConst ER_USER8 ER_USER9 FALSE FA_BOTTOMCENTER
+syntax keyword openroadConst FA_BOTTOMLEFT FA_BOTTOMRIGHT FA_CENTER
+syntax keyword openroadConst FA_CENTERLEFT FA_CENTERRIGHT FA_DEFAULT FA_NONE
+syntax keyword openroadConst FA_TOPCENTER FA_TOPLEFT FA_TOPRIGHT
+syntax keyword openroadConst FB_CHANGEABLE FB_CLICKPOINT FB_DIMMED FB_DRAGBOX
+syntax keyword openroadConst FB_DRAGSEGMENT FB_FLEXIBLE FB_INVISIBLE
+syntax keyword openroadConst FB_LANDABLE FB_MARKABLE FB_RESIZEABLE
+syntax keyword openroadConst FB_VIEWABLE FB_VISIBLE FC_LOWER FC_NONE FC_UPPER
+syntax keyword openroadConst FM_QUERY FM_READ FM_UPDATE FM_USER1 FM_USER2
+syntax keyword openroadConst FM_USER3 FO_DEFAULT FO_HORIZONTAL FO_VERTICAL
+syntax keyword openroadConst FP_BITMAP FP_CLEAR FP_CROSSHATCH FP_DARKSHADE
+syntax keyword openroadConst FP_DEFAULT FP_HORIZONTAL FP_LIGHTSHADE FP_SHADE
+syntax keyword openroadConst FP_SOLID FP_VERTICAL FT_NOTSETVALUE FT_SETVALUE
+syntax keyword openroadConst FT_TABTO FT_TAKEFOCUS GF_BOTTOM GF_DEFAULT
+syntax keyword openroadConst GF_LEFT GF_RIGHT GF_TOP HC_DOUBLEQUOTE
+syntax keyword openroadConst HC_FORMFEED HC_NEWLINE HC_QUOTE HC_SPACE HC_TAB
+syntax keyword openroadConst HV_CONTENTS HV_CONTEXT HV_HELPONHELP HV_KEY
+syntax keyword openroadConst HV_QUIT LS_3D LS_DASH LS_DASHDOT LS_DASHDOTDOT
+syntax keyword openroadConst LS_DEFAULT LS_DOT LS_SOLID LW_DEFAULT
+syntax keyword openroadConst LW_EXTRATHIN LW_MAXIMUM LW_MIDDLE LW_MINIMUM
+syntax keyword openroadConst LW_NOLINE LW_THICK LW_THIN LW_VERYTHICK
+syntax keyword openroadConst LW_VERYTHIN MB_DISABLED MB_ENABLED MB_INVISIBLE
+syntax keyword openroadConst MB_MOVEABLE MT_ERROR MT_INFO MT_NONE MT_WARNING
+syntax keyword openroadConst OP_APPEND OP_NONE OS3D OS_DEFAULT OS_SHADOW
+syntax keyword openroadConst OS_SOLID PU_CANCEL PU_OK QS_ACTIVE QS_INACTIVE
+syntax keyword openroadConst QS_SETCOL QY_ARRAY QY_CACHE QY_CURSOR QY_DIRECT
+syntax keyword openroadConst RC_CHILDSELECTED RC_DOWN RC_END RC_FIELDFREED
+syntax keyword openroadConst RC_FIELDORPHANED RC_GROUPSELECT RC_HOME RC_LEFT
+syntax keyword openroadConst RC_MODECHANGED RC_MOUSECLICK RC_MOUSEDRAG
+syntax keyword openroadConst RC_NEXT RC_NOTAPPLICABLE RC_PAGEDOWN RC_PAGEUP
+syntax keyword openroadConst RC_PARENTSELECTED RC_PREVIOUS RC_PROGRAM
+syntax keyword openroadConst RC_RESUME RC_RETURN RC_RIGHT RC_ROWDELETED
+syntax keyword openroadConst RC_ROWINSERTED RC_ROWSALLDELETED RC_SELECT
+syntax keyword openroadConst RC_TFSCROLL RC_TOGGLESELECT RC_UP RS_CHANGED
+syntax keyword openroadConst RS_DELETED RS_NEW RS_UNCHANGED RS_UNDEFINED
+syntax keyword openroadConst SK_CLOSE SK_COPY SK_CUT SK_DELETE SK_DETAILS
+syntax keyword openroadConst SK_DUPLICATE SK_FIND SK_GO SK_HELP SK_NEXT
+syntax keyword openroadConst SK_NONE SK_PASTE SK_PROPS SK_QUIT SK_REDO
+syntax keyword openroadConst SK_SAVE SK_TFDELETEALLROWS SK_TFDELETEROW
+syntax keyword openroadConst SK_TFFIND SK_TFINSERTROW SK_UNDO SP_APPSTARTING
+syntax keyword openroadConst SP_ARROW SP_CROSS SP_IBEAM SP_ICON SP_NO
+syntax keyword openroadConst SP_SIZE SP_SIZENESW SP_SIZENS SP_SIZENWSE
+syntax keyword openroadConst SP_SIZEWE SP_UPARROW SP_WAIT SY_NT SY_OS2
+syntax keyword openroadConst SY_UNIX SY_VMS SY_WIN95 TF_COURIER TF_HELVETICA
+syntax keyword openroadConst TF_LUCIDA TF_MENUDEFAULT TF_NEWCENTURY TF_SYSTEM
+syntax keyword openroadConst TF_TIMESROMAN TRUE UE_DATAERROR UE_EXITED
+syntax keyword openroadConst UE_NOTACTIVE UE_PURGED UE_RESUMED UE_UNKNOWN
+syntax keyword openroadConst WI_MOTIF WI_MSWIN32 WI_MSWINDOWS WI_NONE WI_PM
+syntax keyword openroadConst WP_FLOATING WP_INTERACTIVE WP_PARENTCENTERED
+syntax keyword openroadConst WP_PARENTRELATIVE WP_SCREENCENTERED
+syntax keyword openroadConst WP_SCREENRELATIVE WV_ICON WV_INVISIBLE
+syntax keyword openroadConst WV_UNREALIZED WV_VISIBLE
+
+" System Variables
+"
+syntax keyword openroadVar CurFrame CurProcedure CurMethod CurObject
+
+" Identifiers
+"
+syntax match openroadIdent /[a-zA-Z_][a-zA-Z_]*![a-zA-Z_][a-zA-Z_]*/
+
+" Comments
+"
+if exists("openroad_comment_strings")
+ syntax match openroadCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region openroadCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$"
+ syntax region openroadComment start="/\*" end="\*/" contains=openroadCommentString,openroadCharacter,openroadNumber
+ syntax match openroadComment "//.*" contains=openroadComment2String,openroadCharacter,openroadNumber
+else
+ syn region openroadComment start="/\*" end="\*/"
+ syn match openroadComment "//.*"
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+"
+if version >= 508 || !exists("did_openroad_syntax_inits")
+ if version < 508
+ let did_openroad_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink openroadKeyword Statement
+ HiLink openroadNumber Number
+ HiLink openroadString String
+ HiLink openroadComment Comment
+ HiLink openroadOperator Operator
+ HiLink openroadType Type
+ HiLink openroadFunc Special
+ HiLink openroadClass Type
+ HiLink openroadEvent Statement
+ HiLink openroadConst Constant
+ HiLink openroadVar Identifier
+ HiLink openroadIdent Identifier
+ HiLink openroadTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "openroad"
diff --git a/runtime/syntax/opl.vim b/runtime/syntax/opl.vim
new file mode 100644
index 000000000..1914a050f
--- /dev/null
+++ b/runtime/syntax/opl.vim
@@ -0,0 +1,96 @@
+" Vim syntax file
+" Language: OPL
+" Maintainer: Czo <Olivier.Sirol@lip6.fr>
+" $Id$
+
+" Open Psion Language... (EPOC16/EPOC32)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" case is not significant
+syn case ignore
+
+" A bunch of useful OPL keywords
+syn keyword OPLStatement proc endp abs acos addr adjustalloc alert alloc app
+syn keyword OPLStatement append appendsprite asc asin at atan back beep
+syn keyword OPLStatement begintrans bookmark break busy byref cache
+syn keyword OPLStatement cachehdr cacherec cachetidy call cancel caption
+syn keyword OPLStatement changesprite chr$ clearflags close closesprite cls
+syn keyword OPLStatement cmd$ committrans compact compress const continue
+syn keyword OPLStatement copy cos count create createsprite cursor
+syn keyword OPLStatement datetosecs datim$ day dayname$ days daystodate
+syn keyword OPLStatement dbuttons dcheckbox dchoice ddate declare dedit
+syn keyword OPLStatement deditmulti defaultwin deg delete dfile dfloat
+syn keyword OPLStatement dialog diaminit diampos dinit dir$ dlong do dow
+syn keyword OPLStatement dposition drawsprite dtext dtime dxinput edit else
+syn keyword OPLStatement elseif enda endif endv endwh entersend entersend0
+syn keyword OPLStatement eof erase err err$ errx$ escape eval exist exp ext
+syn keyword OPLStatement external find findfield findlib first fix$ flags
+syn keyword OPLStatement flt font freealloc gat gborder gbox gbutton
+syn keyword OPLStatement gcircle gclock gclose gcls gcolor gcopy gcreate
+syn keyword OPLStatement gcreatebit gdrawobject gellipse gen$ get get$
+syn keyword OPLStatement getcmd$ getdoc$ getevent getevent32 geteventa32
+syn keyword OPLStatement geteventc getlibh gfill gfont ggmode ggrey gheight
+syn keyword OPLStatement gidentity ginfo ginfo32 ginvert giprint glineby
+syn keyword OPLStatement glineto gloadbit gloadfont global gmove gorder
+syn keyword OPLStatement goriginx goriginy goto gotomark gpatt gpeekline
+syn keyword OPLStatement gpoly gprint gprintb gprintclip grank gsavebit
+syn keyword OPLStatement gscroll gsetpenwidth gsetwin gstyle gtmode gtwidth
+syn keyword OPLStatement gunloadfont gupdate guse gvisible gwidth gx
+syn keyword OPLStatement gxborder gxprint gy hex$ hour iabs icon if include
+syn keyword OPLStatement input insert int intf intrans key key$ keya keyc
+syn keyword OPLStatement killmark kmod last lclose left$ len lenalloc
+syn keyword OPLStatement linklib ln loadlib loadm loc local lock log lopen
+syn keyword OPLStatement lower$ lprint max mcard mcasc mean menu mid$ min
+syn keyword OPLStatement minit minute mkdir modify month month$ mpopup
+syn keyword OPLStatement newobj newobjh next notes num$ odbinfo off onerr
+syn keyword OPLStatement open openr opx os parse$ path pause peek pi
+syn keyword OPLStatement pointerfilter poke pos position possprite print
+syn keyword OPLStatement put rad raise randomize realloc recsize rename
+syn keyword OPLStatement rept$ return right$ rmdir rnd rollback sci$ screen
+syn keyword OPLStatement screeninfo second secstodate send setdoc setflags
+syn keyword OPLStatement setname setpath sin space sqr statuswin
+syn keyword OPLStatement statwininfo std stop style sum tan testevent trap
+syn keyword OPLStatement type uadd unloadlib unloadm until update upper$
+syn keyword OPLStatement use usr usr$ usub val var vector week while year
+" syn keyword OPLStatement rem
+
+
+syn match OPLNumber "\<\d\+\>"
+syn match OPLNumber "\<\d\+\.\d*\>"
+syn match OPLNumber "\.\d\+\>"
+
+syn region OPLString start=+"+ end=+"+
+syn region OPLComment start="REM[\t ]" end="$"
+syn match OPLMathsOperator "-\|=\|[:<>+\*^/\\]"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_OPL_syntax_inits")
+ if version < 508
+ let did_OPL_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink OPLStatement Statement
+ HiLink OPLNumber Number
+ HiLink OPLString String
+ HiLink OPLComment Comment
+ HiLink OPLMathsOperator Conditional
+" HiLink OPLError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "opl"
+
+" vim: ts=8
diff --git a/runtime/syntax/ora.vim b/runtime/syntax/ora.vim
new file mode 100644
index 000000000..bf5d3220a
--- /dev/null
+++ b/runtime/syntax/ora.vim
@@ -0,0 +1,478 @@
+" Vim syntax file
+" Language: Oracle config files (.ora) (Oracle 8i, ver. 8.1.5)
+" Maintainer: Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
+" Url: <->
+" Last Change: 2003 May 11
+
+" * the keywords are listed by file (sqlnet.ora, listener.ora, etc.)
+" * the parathesis-checking is made at the beginning for all keywords
+" * possible values are listed also
+" * there are some overlappings (e.g. METHOD is mentioned both for
+" sqlnet-ora and tnsnames.ora; since will not cause(?) problems
+" is easier to follow separately each file's keywords)
+
+" Remove any old syntax stuff hanging around, if needed
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'ora'
+endif
+
+syn case ignore
+
+"comments
+syn match oraComment "\#.*"
+
+" catch errors caused by wrong parenthesis
+syn region oraParen transparent start="(" end=")" contains=@oraAll,oraParen
+syn match oraParenError ")"
+
+" strings
+syn region oraString start=+"+ end=+"+
+
+"common .ora staff
+
+"common protocol parameters
+syn keyword oraKeywordGroup ADDRESS ADDRESS_LIST
+syn keyword oraKeywordGroup DESCRIPTION_LIST DESCRIPTION
+"all protocols
+syn keyword oraKeyword PROTOCOL
+syn keyword oraValue ipc tcp nmp
+"Bequeath
+syn keyword oraKeyword PROGRAM ARGV0 ARGS
+"IPC
+syn keyword oraKeyword KEY
+"Named Pipes
+syn keyword oraKeyword SERVER PIPE
+"LU6.2
+syn keyword oraKeyword LU_NAME LLU LOCAL_LU LLU_NAME LOCAL_LU_NAME
+syn keyword oraKeyword MODE MDN
+syn keyword oraKeyword PLU PARTNER_LU_NAME PLU_LA PARTNER_LU_LOCAL_ALIAS
+syn keyword oraKeyword TP_NAME TPN
+"SPX
+syn keyword oraKeyword SERVICE
+"TCP/IP and TCP/IP with SSL
+syn keyword oraKeyword HOST PORT
+
+"misc. keywords I've met but didn't find in manual (maybe they are deprecated?)
+syn keyword oraKeywordGroup COMMUNITY_LIST
+syn keyword oraKeyword COMMUNITY NAME DEFAULT_ZONE
+syn keyword oraValue tcpcom
+
+"common values
+syn keyword oraValue yes no on off true false null all none ok
+"word 'world' is used a lot...
+syn keyword oraModifier world
+
+"misc. common keywords
+syn keyword oraKeyword TRACE_DIRECTORY TRACE_LEVEL TRACE_FILE
+
+
+"sqlnet.ora
+syn keyword oraKeywordPref NAMES NAMESCTL
+syn keyword oraKeywordPref OSS SOURCE SQLNET TNSPING
+syn keyword oraKeyword AUTOMATIC_IPC BEQUEATH_DETACH DAEMON TRACE_MASK
+syn keyword oraKeyword DISABLE_OOB
+syn keyword oraKeyword LOG_DIRECTORY_CLIENT LOG_DIRECTORY_SERVER
+syn keyword oraKeyword LOG_FILE_CLIENT LOG_FILE_SERVER
+syn keyword oraKeyword DCE PREFIX DEFAULT_DOMAIN DIRECTORY_PATH
+syn keyword oraKeyword INITIAL_RETRY_TIMEOUT MAX_OPEN_CONNECTIONS
+syn keyword oraKeyword MESSAGE_POOL_START_SIZE NIS META_MAP
+syn keyword oraKeyword PASSWORD PREFERRED_SERVERS REQUEST_RETRIES
+syn keyword oraKeyword INTERNAL_ENCRYPT_PASSWORD INTERNAL_USE
+syn keyword oraKeyword NO_INITIAL_SERVER NOCONFIRM
+syn keyword oraKeyword SERVER_PASSWORD TRACE_UNIQUE MY_WALLET
+syn keyword oraKeyword LOCATION DIRECTORY METHOD METHOD_DATA
+syn keyword oraKeyword SQLNET_ADDRESS
+syn keyword oraKeyword AUTHENTICATION_SERVICES
+syn keyword oraKeyword AUTHENTICATION_KERBEROS5_SERVICE
+syn keyword oraKeyword AUTHENTICATION_GSSAPI_SERVICE
+syn keyword oraKeyword CLIENT_REGISTRATION
+syn keyword oraKeyword CRYPTO_CHECKSUM_CLIENT CRYPTO_CHECKSUM_SERVER
+syn keyword oraKeyword CRYPTO_CHECKSUM_TYPES_CLIENT CRYPTO_CHECKSUM_TYPES_SERVER
+syn keyword oraKeyword CRYPTO_SEED
+syn keyword oraKeyword ENCRYPTION_CLIENT ENCRYPTION_SERVER
+syn keyword oraKeyword ENCRYPTION_TYPES_CLIENT ENCRYPTION_TYPES_SERVER
+syn keyword oraKeyword EXPIRE_TIME
+syn keyword oraKeyword IDENTIX_FINGERPRINT_DATABASE IDENTIX_FINGERPRINT_DATABASE_USER
+syn keyword oraKeyword IDENTIX_FINGERPRINT_DATABASE_PASSWORD IDENTIX_FINGERPRINT_METHOD
+syn keyword oraKeyword KERBEROS5_CC_NAME KERBEROS5_CLOCKSKEW KERBEROS5_CONF
+syn keyword oraKeyword KERBEROS5_KEYTAB KERBEROS5_REALMS
+syn keyword oraKeyword RADIUS_ALTERNATE RADIUS_ALTERNATE_PORT RADIUS_ALTERNATE_RETRIES
+syn keyword oraKeyword RADIUS_AUTHENTICATION_TIMEOUT RADIUS_AUTHENTICATION
+syn keyword oraKeyword RADIUS_AUTHENTICATION_INTERFACE RADIUS_AUTHENTICATION_PORT
+syn keyword oraKeyword RADIUS_AUTHENTICATION_RETRIES RADIUS_AUTHENTICATION_TIMEOUT
+syn keyword oraKeyword RADIUS_CHALLENGE_RESPONSE RADIUS_SECRET RADIUS_SEND_ACCOUNTING
+syn keyword oraKeyword SSL_CLIENT_AUTHENTICATION SSL_CIPHER_SUITES SSL_VERSION
+syn keyword oraKeyword TRACE_DIRECTORY_CLIENT TRACE_DIRECTORY_SERVER
+syn keyword oraKeyword TRACE_FILE_CLIENT TRACE_FILE_SERVER
+syn keyword oraKeyword TRACE_LEVEL_CLIENT TRACE_LEVEL_SERVER
+syn keyword oraKeyword TRACE_UNIQUE_CLIENT
+syn keyword oraKeyword USE_CMAN USE_DEDICATED_SERVER
+syn keyword oraValue user admin support
+syn keyword oraValue accept accepted reject rejected requested required
+syn keyword oraValue md5 rc4_40 rc4_56 rc4_128 des des_40
+syn keyword oraValue tnsnames onames hostname dce nis novell
+syn keyword oraValue file oracle
+syn keyword oraValue oss
+syn keyword oraValue beq nds nts kerberos5 securid cybersafe identix dcegssapi radius
+syn keyword oraValue undetermined
+
+"tnsnames.ora
+syn keyword oraKeywordGroup CONNECT_DATA FAILOVER_MODE
+syn keyword oraKeyword FAILOVER LOAD_BALANCE SOURCE_ROUTE TYPE_OF_SERVICE
+syn keyword oraKeyword BACKUP TYPE METHOD GLOBAL_NAME HS
+syn keyword oraKeyword INSTANCE_NAME RDB_DATABASE SDU SERVER
+syn keyword oraKeyword SERVICE_NAME SERVICE_NAMES SID
+syn keyword oraKeyword HANDLER_NAME EXTPROC_CONNECTION_DATA
+syn keyword oraValue session select basic preconnect dedicated shared
+
+"listener.ora
+syn keyword oraKeywordGroup SID_LIST SID_DESC PRESPAWN_LIST PRESPAWN_DESC
+syn match oraKeywordGroup "SID_LIST_\w*"
+syn keyword oraKeyword PROTOCOL_STACK PRESENTATION SESSION
+syn keyword oraKeyword GLOBAL_DBNAME ORACLE_HOME PROGRAM SID_NAME
+syn keyword oraKeyword PRESPAWN_MAX POOL_SIZE TIMEOUT
+syn match oraKeyword "CONNECT_TIMEOUT_\w*"
+syn match oraKeyword "LOG_DIRECTORY_\w*"
+syn match oraKeyword "LOG_FILE_\w*"
+syn match oraKeyword "PASSWORDS_\w*"
+syn match oraKeyword "STARTUP_WAIT_TIME_\w*"
+syn match oraKeyword "STARTUP_WAITTIME_\w*"
+syn match oraKeyword "TRACE_DIRECTORY_\w*"
+syn match oraKeyword "TRACE_FILE_\w*"
+syn match oraKeyword "TRACE_LEVEL_\w*"
+syn match oraKeyword "USE_PLUG_AND_PLAY_\w*"
+syn keyword oraValue ttc giop ns raw
+
+"names.ora
+syn keyword oraKeywordGroup ADDRESSES ADMIN_REGION
+syn keyword oraKeywordGroup DEFAULT_FORWARDERS FORWARDER_LIST FORWARDER
+syn keyword oraKeywordGroup DOMAIN_HINTS HINT_DESC HINT_LIST
+syn keyword oraKeywordGroup DOMAINS DOMAIN_LIST DOMAIN
+syn keyword oraKeywordPref NAMES
+syn keyword oraKeyword EXPIRE REFRESH REGION RETRY USERID VERSION
+syn keyword oraKeyword AUTHORITY_REQUIRED CONNECT_TIMEOUT
+syn keyword oraKeyword AUTO_REFRESH_EXPIRE AUTO_REFRESH_RETRY
+syn keyword oraKeyword CACHE_CHECKPOINT_FILE CACHE_CHECKPOINT_INTERVAL
+syn keyword oraKeyword CONFIG_CHECKPOINT_FILE DEFAULT_FORWARDERS_ONLY
+syn keyword oraKeyword HINT FORWARDING_AVAILABLE FORWARDING_DESIRED
+syn keyword oraKeyword KEEP_DB_OPEN
+syn keyword oraKeyword LOG_DIRECTORY LOG_FILE LOG_STATS_INTERVAL LOG_UNIQUE
+syn keyword oraKeyword MAX_OPEN_CONNECTIONS MAX_REFORWARDS
+syn keyword oraKeyword MESSAGE_POOL_START_SIZE
+syn keyword oraKeyword NO_MODIFY_REQUESTS NO_REGION_DATABASE
+syn keyword oraKeyword PASSWORD REGION_CHECKPOINT_FILE
+syn keyword oraKeyword RESET_STATS_INTERVAL SAVE_CONFIG_ON_STOP
+syn keyword oraKeyword SERVER_NAME TRACE_FUNC TRACE_UNIQUE
+
+"cman.ora
+syn keyword oraKeywordGroup CMAN CMAN_ADMIN CMAN_PROFILE PARAMETER_LIST
+syn keyword oraKeywordGroup CMAN_RULES RULES_LIST RULE
+syn keyword oraKeyword ANSWER_TIMEOUT AUTHENTICATION_LEVEL LOG_LEVEL
+syn keyword oraKeyword MAX_FREELIST_BUFFERS MAXIMUM_CONNECT_DATA MAXIMUM_RELAYS
+syn keyword oraKeyword RELAY_STATISTICS SHOW_TNS_INFO TRACING
+syn keyword oraKeyword USE_ASYNC_CALL SRC DST SRV ACT
+
+"protocol.ora
+syn match oraKeyword "\w*\.EXCLUDED_NODES"
+syn match oraKeyword "\w*\.INVITED_NODES"
+syn match oraKeyword "\w*\.VALIDNODE_CHECKING"
+syn keyword oraKeyword TCP NODELAY
+
+
+
+
+"---------------------------------------
+"init.ora
+
+"common values
+syn keyword oraValue nested_loops merge hash unlimited
+
+"init params
+syn keyword oraKeyword O7_DICTIONARY_ACCESSIBILITY ALWAYS_ANTI_JOIN ALWAYS_SEMI_JOIN
+syn keyword oraKeyword AQ_TM_PROCESSES ARCH_IO_SLAVES AUDIT_FILE_DEST AUDIT_TRAIL
+syn keyword oraKeyword BACKGROUND_CORE_DUMP BACKGROUND_DUMP_DEST
+syn keyword oraKeyword BACKUP_TAPE_IO_SLAVES BITMAP_MERGE_AREA_SIZE
+syn keyword oraKeyword BLANK_TRIMMING BUFFER_POOL_KEEP BUFFER_POOL_RECYCLE
+syn keyword oraKeyword COMMIT_POINT_STRENGTH COMPATIBLE CONTROL_FILE_RECORD_KEEP_TIME
+syn keyword oraKeyword CONTROL_FILES CORE_DUMP_DEST CPU_COUNT
+syn keyword oraKeyword CREATE_BITMAP_AREA_SIZE CURSOR_SPACE_FOR_TIME
+syn keyword oraKeyword DB_BLOCK_BUFFERS DB_BLOCK_CHECKING DB_BLOCK_CHECKSUM
+syn keyword oraKeyword DB_BLOCK_LRU_LATCHES DB_BLOCK_MAX_DIRTY_TARGET
+syn keyword oraKeyword DB_BLOCK_SIZE DB_DOMAIN
+syn keyword oraKeyword DB_FILE_DIRECT_IO_COUNT DB_FILE_MULTIBLOCK_READ_COUNT
+syn keyword oraKeyword DB_FILE_NAME_CONVERT DB_FILE_SIMULTANEOUS_WRITES
+syn keyword oraKeyword DB_FILES DB_NAME DB_WRITER_PROCESSES
+syn keyword oraKeyword DBLINK_ENCRYPT_LOGIN DBWR_IO_SLAVES
+syn keyword oraKeyword DELAYED_LOGGING_BLOCK_CLEANOUTS DISCRETE_TRANSACTIONS_ENABLED
+syn keyword oraKeyword DISK_ASYNCH_IO DISTRIBUTED_TRANSACTIONS
+syn keyword oraKeyword DML_LOCKS ENQUEUE_RESOURCES ENT_DOMAIN_NAME EVENT
+syn keyword oraKeyword FAST_START_IO_TARGET FAST_START_PARALLEL_ROLLBACK
+syn keyword oraKeyword FIXED_DATE FREEZE_DB_FOR_FAST_INSTANCE_RECOVERY
+syn keyword oraKeyword GC_DEFER_TIME GC_FILES_TO_LOCKS GC_RELEASABLE_LOCKS GC_ROLLBACK_LOCKS
+syn keyword oraKeyword GLOBAL_NAMES HASH_AREA_SIZE
+syn keyword oraKeyword HASH_JOIN_ENABLED HASH_MULTIBLOCK_IO_COUNT
+syn keyword oraKeyword HI_SHARED_MEMORY_ADDRESS HS_AUTOREGISTER
+syn keyword oraKeyword IFILE
+syn keyword oraKeyword INSTANCE_GROUPS INSTANCE_NAME INSTANCE_NUMBER
+syn keyword oraKeyword JAVA_POOL_SIZE JOB_QUEUE_INTERVAL JOB_QUEUE_PROCESSES LARGE_POOL_SIZE
+syn keyword oraKeyword LICENSE_MAX_SESSIONS LICENSE_MAX_USERS LICENSE_SESSIONS_WARNING
+syn keyword oraKeyword LM_LOCKS LM_PROCS LM_RESS
+syn keyword oraKeyword LOCAL_LISTENER LOCK_NAME_SPACE LOCK_SGA LOCK_SGA_AREAS
+syn keyword oraKeyword LOG_ARCHIVE_BUFFER_SIZE LOG_ARCHIVE_BUFFERS LOG_ARCHIVE_DEST
+syn match oraKeyword "LOG_ARCHIVE_DEST_\(1\|2\|3\|4\|5\)"
+syn match oraKeyword "LOG_ARCHIVE_DEST_STATE_\(1\|2\|3\|4\|5\)"
+syn keyword oraKeyword LOG_ARCHIVE_DUPLEX_DEST LOG_ARCHIVE_FORMAT LOG_ARCHIVE_MAX_PROCESSES
+syn keyword oraKeyword LOG_ARCHIVE_MIN_SUCCEED_DEST LOG_ARCHIVE_START
+syn keyword oraKeyword LOG_BUFFER LOG_CHECKPOINT_INTERVAL LOG_CHECKPOINT_TIMEOUT
+syn keyword oraKeyword LOG_CHECKPOINTS_TO_ALERT LOG_FILE_NAME_CONVERT
+syn keyword oraKeyword MAX_COMMIT_PROPAGATION_DELAY MAX_DUMP_FILE_SIZE
+syn keyword oraKeyword MAX_ENABLED_ROLES MAX_ROLLBACK_SEGMENTS
+syn keyword oraKeyword MTS_DISPATCHERS MTS_MAX_DISPATCHERS MTS_MAX_SERVERS MTS_SERVERS
+syn keyword oraKeyword NLS_CALENDAR NLS_COMP NLS_CURRENCY NLS_DATE_FORMAT
+syn keyword oraKeyword NLS_DATE_LANGUAGE NLS_DUAL_CURRENCY NLS_ISO_CURRENCY NLS_LANGUAGE
+syn keyword oraKeyword NLS_NUMERIC_CHARACTERS NLS_SORT NLS_TERRITORY
+syn keyword oraKeyword OBJECT_CACHE_MAX_SIZE_PERCENT OBJECT_CACHE_OPTIMAL_SIZE
+syn keyword oraKeyword OPEN_CURSORS OPEN_LINKS OPEN_LINKS_PER_INSTANCE
+syn keyword oraKeyword OPS_ADMINISTRATION_GROUP
+syn keyword oraKeyword OPTIMIZER_FEATURES_ENABLE OPTIMIZER_INDEX_CACHING
+syn keyword oraKeyword OPTIMIZER_INDEX_COST_ADJ OPTIMIZER_MAX_PERMUTATIONS
+syn keyword oraKeyword OPTIMIZER_MODE OPTIMIZER_PERCENT_PARALLEL
+syn keyword oraKeyword OPTIMIZER_SEARCH_LIMIT
+syn keyword oraKeyword ORACLE_TRACE_COLLECTION_NAME ORACLE_TRACE_COLLECTION_PATH
+syn keyword oraKeyword ORACLE_TRACE_COLLECTION_SIZE ORACLE_TRACE_ENABLE
+syn keyword oraKeyword ORACLE_TRACE_FACILITY_NAME ORACLE_TRACE_FACILITY_PATH
+syn keyword oraKeyword OS_AUTHENT_PREFIX OS_ROLES
+syn keyword oraKeyword PARALLEL_ADAPTIVE_MULTI_USER PARALLEL_AUTOMATIC_TUNING
+syn keyword oraKeyword PARALLEL_BROADCAST_ENABLED PARALLEL_EXECUTION_MESSAGE_SIZE
+syn keyword oraKeyword PARALLEL_INSTANCE_GROUP PARALLEL_MAX_SERVERS
+syn keyword oraKeyword PARALLEL_MIN_PERCENT PARALLEL_MIN_SERVERS
+syn keyword oraKeyword PARALLEL_SERVER PARALLEL_SERVER_INSTANCES PARALLEL_THREADS_PER_CPU
+syn keyword oraKeyword PARTITION_VIEW_ENABLED PLSQL_V2_COMPATIBILITY
+syn keyword oraKeyword PRE_PAGE_SGA PROCESSES
+syn keyword oraKeyword QUERY_REWRITE_ENABLED QUERY_REWRITE_INTEGRITY
+syn keyword oraKeyword RDBMS_SERVER_DN READ_ONLY_OPEN_DELAYED RECOVERY_PARALLELISM
+syn keyword oraKeyword REMOTE_DEPENDENCIES_MODE REMOTE_LOGIN_PASSWORDFILE
+syn keyword oraKeyword REMOTE_OS_AUTHENT REMOTE_OS_ROLES
+syn keyword oraKeyword REPLICATION_DEPENDENCY_TRACKING
+syn keyword oraKeyword RESOURCE_LIMIT RESOURCE_MANAGER_PLAN
+syn keyword oraKeyword ROLLBACK_SEGMENTS ROW_LOCKING SERIAL _REUSE SERVICE_NAMES
+syn keyword oraKeyword SESSION_CACHED_CURSORS SESSION_MAX_OPEN_FILES SESSIONS
+syn keyword oraKeyword SHADOW_CORE_DUMP
+syn keyword oraKeyword SHARED_MEMORY_ADDRESS SHARED_POOL_RESERVED_SIZE SHARED_POOL_SIZE
+syn keyword oraKeyword SORT_AREA_RETAINED_SIZE SORT_AREA_SIZE SORT_MULTIBLOCK_READ_COUNT
+syn keyword oraKeyword SQL92_SECURITY SQL_TRACE STANDBY_ARCHIVE_DEST
+syn keyword oraKeyword STAR_TRANSFORMATION_ENABLED TAPE_ASYNCH_IO THREAD
+syn keyword oraKeyword TIMED_OS_STATISTICS TIMED_STATISTICS
+syn keyword oraKeyword TRANSACTION_AUDITING TRANSACTIONS TRANSACTIONS_PER_ROLLBACK_SEGMENT
+syn keyword oraKeyword USE_INDIRECT_DATA_BUFFERS USER_DUMP_DEST
+syn keyword oraKeyword UTL_FILE_DIR
+syn keyword oraKeywordObs ALLOW_PARTIAL_SN_RESULTS B_TREE_BITMAP_PLANS
+syn keyword oraKeywordObs BACKUP_DISK_IO_SLAVES CACHE_SIZE_THRESHOLD
+syn keyword oraKeywordObs CCF_IO_SIZE CLEANUP_ROLLBACK_ENTRIES
+syn keyword oraKeywordObs CLOSE_CACHED_OPEN_CURSORS COMPATIBLE_NO_RECOVERY
+syn keyword oraKeywordObs COMPLEX_VIEW_MERGING
+syn keyword oraKeywordObs DB_BLOCK_CHECKPOINT_BATCH DB_BLOCK_LRU_EXTENDED_STATISTICS
+syn keyword oraKeywordObs DB_BLOCK_LRU_STATISTICS
+syn keyword oraKeywordObs DISTRIBUTED_LOCK_TIMEOUT DISTRIBUTED_RECOVERY_CONNECTION_HOLD_TIME
+syn keyword oraKeywordObs FAST_FULL_SCAN_ENABLED GC_LATCHES GC_LCK_PROCS
+syn keyword oraKeywordObs LARGE_POOL_MIN_ALLOC LGWR_IO_SLAVES
+syn keyword oraKeywordObs LOG_BLOCK_CHECKSUM LOG_FILES
+syn keyword oraKeywordObs LOG_SIMULTANEOUS_COPIES LOG_SMALL_ENTRY_MAX_SIZE
+syn keyword oraKeywordObs MAX_TRANSACTION_BRANCHES
+syn keyword oraKeywordObs MTS_LISTENER_ADDRESS MTS_MULTIPLE_LISTENERS
+syn keyword oraKeywordObs MTS_RATE_LOG_SIZE MTS_RATE_SCALE MTS_SERVICE
+syn keyword oraKeywordObs OGMS_HOME OPS_ADMIN_GROUP
+syn keyword oraKeywordObs PARALLEL_DEFAULT_MAX_INSTANCES PARALLEL_MIN_MESSAGE_POOL
+syn keyword oraKeywordObs PARALLEL_SERVER_IDLE_TIME PARALLEL_TRANSACTION_RESOURCE_TIMEOUT
+syn keyword oraKeywordObs PUSH_JOIN_PREDICATE REDUCE_ALARM ROW_CACHE_CURSORS
+syn keyword oraKeywordObs SEQUENCE_CACHE_ENTRIES SEQUENCE_CACHE_HASH_BUCKETS
+syn keyword oraKeywordObs SHARED_POOL_RESERVED_MIN_ALLOC
+syn keyword oraKeywordObs SORT_DIRECT_WRITES SORT_READ_FAC SORT_SPACEMAP_SIZE
+syn keyword oraKeywordObs SORT_WRITE_BUFFER_SIZE SORT_WRITE_BUFFERS
+syn keyword oraKeywordObs SPIN_COUNT TEMPORARY_TABLE_LOCKS USE_ISM
+syn keyword oraValue db os full partial mandatory optional reopen enable defer
+syn keyword oraValue always default intent disable dml plsql temp_disable
+syn match oravalue "Arabic Hijrah"
+syn match oravalue "English Hijrah"
+syn match oravalue "Gregorian"
+syn match oravalue "Japanese Imperial"
+syn match oravalue "Persian"
+syn match oravalue "ROC Official"
+syn match oravalue "Thai Buddha"
+syn match oravalue "8.0.0"
+syn match oravalue "8.0.3"
+syn match oravalue "8.0.4"
+syn match oravalue "8.1.3"
+syn match oraModifier "archived log"
+syn match oraModifier "backup corruption"
+syn match oraModifier "backup datafile"
+syn match oraModifier "backup piece "
+syn match oraModifier "backup redo log"
+syn match oraModifier "backup set"
+syn match oraModifier "copy corruption"
+syn match oraModifier "datafile copy"
+syn match oraModifier "deleted object"
+syn match oraModifier "loghistory"
+syn match oraModifier "offline range"
+
+"undocumented init params
+"up to 7.2 (inclusive)
+syn keyword oraKeywordUndObs _latch_spin_count _trace_instance_termination
+syn keyword oraKeywordUndObs _wakeup_timeout _lgwr_async_write
+"7.3
+syn keyword oraKeywordUndObs _standby_lock_space_name _enable_dba_locking
+"8.0.5
+syn keyword oraKeywordUnd _NUMA_instance_mapping _NUMA_pool_size
+syn keyword oraKeywordUnd _advanced_dss_features _affinity_on _all_shared_dblinks
+syn keyword oraKeywordUnd _allocate_creation_order _allow_resetlogs_corruption
+syn keyword oraKeywordUnd _always_star_transformation _bump_highwater_mark_count
+syn keyword oraKeywordUnd _column_elimination_off _controlfile_enqueue_timeout
+syn keyword oraKeywordUnd _corrupt_blocks_on_stuck_recovery _corrupted_rollback_segments
+syn keyword oraKeywordUnd _cr_deadtime _cursor_db_buffers_pinned
+syn keyword oraKeywordUnd _db_block_cache_clone _db_block_cache_map _db_block_cache_protect
+syn keyword oraKeywordUnd _db_block_hash_buckets _db_block_hi_priority_batch_size
+syn keyword oraKeywordUnd _db_block_max_cr_dba _db_block_max_scan_cnt
+syn keyword oraKeywordUnd _db_block_med_priority_batch_size _db_block_no_idle_writes
+syn keyword oraKeywordUnd _db_block_write_batch _db_handles _db_handles_cached
+syn keyword oraKeywordUnd _db_large_dirty_queue _db_no_mount_lock
+syn keyword oraKeywordUnd _db_writer_histogram_statistics _db_writer_scan_depth
+syn keyword oraKeywordUnd _db_writer_scan_depth_decrement _db_writer_scan_depth_increment
+syn keyword oraKeywordUnd _disable_incremental_checkpoints
+syn keyword oraKeywordUnd _disable_latch_free_SCN_writes_via_32cas
+syn keyword oraKeywordUnd _disable_latch_free_SCN_writes_via_64cas
+syn keyword oraKeywordUnd _disable_logging _disable_ntlog_events
+syn keyword oraKeywordUnd _dss_cache_flush _dynamic_stats_threshold
+syn keyword oraKeywordUnd _enable_cscn_caching _enable_default_affinity
+syn keyword oraKeywordUnd _enqueue_debug_multi_instance _enqueue_hash
+syn keyword oraKeywordUnd _enqueue_hash_chain_latches _enqueue_locks
+syn keyword oraKeywordUnd _fifth_spare_parameter _first_spare_parameter _fourth_spare_parameter
+syn keyword oraKeywordUnd _gc_class_locks _groupby_nopushdown_cut_ratio
+syn keyword oraKeywordUnd _idl_conventional_index_maintenance _ignore_failed_escalates
+syn keyword oraKeywordUnd _init_sql_file
+syn keyword oraKeywordUnd _io_slaves_disabled _ioslave_batch_count _ioslave_issue_count
+syn keyword oraKeywordUnd _kgl_bucket_count _kgl_latch_count _kgl_multi_instance_invalidation
+syn keyword oraKeywordUnd _kgl_multi_instance_lock _kgl_multi_instance_pin
+syn keyword oraKeywordUnd _latch_miss_stat_sid _latch_recovery_alignment _latch_wait_posting
+syn keyword oraKeywordUnd _lm_ast_option _lm_direct_sends _lm_dlmd_procs _lm_domains _lm_groups
+syn keyword oraKeywordUnd _lm_non_fault_tolerant _lm_send_buffers _lm_statistics _lm_xids
+syn keyword oraKeywordUnd _log_blocks_during_backup _log_buffers_debug _log_checkpoint_recovery_check
+syn keyword oraKeywordUnd _log_debug_multi_instance _log_entry_prebuild_threshold _log_io_size
+syn keyword oraKeywordUnd _log_space_errors
+syn keyword oraKeywordUnd _max_exponential_sleep _max_sleep_holding_latch
+syn keyword oraKeywordUnd _messages _minimum_giga_scn _mts_load_constants _nested_loop_fudge
+syn keyword oraKeywordUnd _no_objects _no_or_expansion
+syn keyword oraKeywordUnd _number_cached_attributes _offline_rollback_segments _open_files_limit
+syn keyword oraKeywordUnd _optimizer_undo_changes
+syn keyword oraKeywordUnd _oracle_trace_events _oracle_trace_facility_version
+syn keyword oraKeywordUnd _ordered_nested_loop _parallel_server_sleep_time
+syn keyword oraKeywordUnd _passwordfile_enqueue_timeout _pdml_slaves_diff_part
+syn keyword oraKeywordUnd _plsql_dump_buffer_events _predicate_elimination_enabled
+syn keyword oraKeywordUnd _project_view_columns
+syn keyword oraKeywordUnd _px_broadcast_fudge_factor _px_broadcast_trace _px_dop_limit_degree
+syn keyword oraKeywordUnd _px_dop_limit_threshold _px_kxfr_granule_allocation _px_kxib_tracing
+syn keyword oraKeywordUnd _release_insert_threshold _reuse_index_loop
+syn keyword oraKeywordUnd _rollback_segment_count _rollback_segment_initial
+syn keyword oraKeywordUnd _row_cache_buffer_size _row_cache_instance_locks
+syn keyword oraKeywordUnd _save_escalates _scn_scheme
+syn keyword oraKeywordUnd _second_spare_parameter _session_idle_bit_latches
+syn keyword oraKeywordUnd _shared_session_sort_fetch_buffer _single_process
+syn keyword oraKeywordUnd _small_table_threshold _sql_connect_capability_override
+syn keyword oraKeywordUnd _sql_connect_capability_table
+syn keyword oraKeywordUnd _test_param_1 _test_param_2 _test_param_3
+syn keyword oraKeywordUnd _third_spare_parameter _tq_dump_period
+syn keyword oraKeywordUnd _trace_archive_dest _trace_archive_start _trace_block_size
+syn keyword oraKeywordUnd _trace_buffers_per_process _trace_enabled _trace_events
+syn keyword oraKeywordUnd _trace_file_size _trace_files_public _trace_flushing _trace_write_batch_size
+syn keyword oraKeywordUnd _upconvert_from_ast _use_vector_post _wait_for_sync _walk_insert_threshold
+"dunno which version; may be 8.1.x, may be obsoleted
+syn keyword oraKeywordUndObs _arch_io_slaves _average_dirties_half_life _b_tree_bitmap_plans
+syn keyword oraKeywordUndObs _backup_disk_io_slaves _backup_io_pool_size
+syn keyword oraKeywordUndObs _cleanup_rollback_entries _close_cached_open_cursors
+syn keyword oraKeywordUndObs _compatible_no_recovery _complex_view_merging
+syn keyword oraKeywordUndObs _cpu_to_io _cr_server
+syn keyword oraKeywordUndObs _db_aging_cool_count _db_aging_freeze_cr _db_aging_hot_criteria
+syn keyword oraKeywordUndObs _db_aging_stay_count _db_aging_touch_time
+syn keyword oraKeywordUndObs _db_percent_hot_default _db_percent_hot_keep _db_percent_hot_recycle
+syn keyword oraKeywordUndObs _db_writer_chunk_writes _db_writer_max_writes
+syn keyword oraKeywordUndObs _dbwr_async_io _dbwr_tracing
+syn keyword oraKeywordUndObs _defer_multiple_waiters _discrete_transaction_enabled
+syn keyword oraKeywordUndObs _distributed_lock_timeout _distributed_recovery _distribited_recovery_
+syn keyword oraKeywordUndObs _domain_index_batch_size _domain_index_dml_batch_size
+syn keyword oraKeywordUndObs _enable_NUMA_optimization _enable_block_level_transaction_recovery
+syn keyword oraKeywordUndObs _enable_list_io _enable_multiple_sampling
+syn keyword oraKeywordUndObs _fairness_treshold _fast_full_scan_enabled _foreground_locks
+syn keyword oraKeywordUndObs _full_pwise_join_enabled _gc_latches _gc_lck_procs
+syn keyword oraKeywordUndObs _high_server_treshold _index_prefetch_factor _kcl_debug
+syn keyword oraKeywordUndObs _kkfi_trace _large_pool_min_alloc _lazy_freelist_close _left_nested_loops_random
+syn keyword oraKeywordUndObs _lgwr_async_io _lgwr_io_slaves _lock_sga_areas
+syn keyword oraKeywordUndObs _log_archive_buffer_size _log_archive_buffers _log_simultaneous_copies
+syn keyword oraKeywordUndObs _low_server_treshold _max_transaction_branches
+syn keyword oraKeywordUndObs _mts_rate_log_size _mts_rate_scale
+syn keyword oraKeywordUndObs _mview_cost_rewrite _mview_rewrite_2
+syn keyword oraKeywordUndObs _ncmb_readahead_enabled _ncmb_readahead_tracing
+syn keyword oraKeywordUndObs _ogms_home
+syn keyword oraKeywordUndObs _parallel_adaptive_max_users _parallel_default_max_instances
+syn keyword oraKeywordUndObs _parallel_execution_message_align _parallel_fake_class_pct
+syn keyword oraKeywordUndObs _parallel_load_bal_unit _parallel_load_balancing
+syn keyword oraKeywordUndObs _parallel_min_message_pool _parallel_recovery_stopat
+syn keyword oraKeywordUndObs _parallel_server_idle_time _parallelism_cost_fudge_factor
+syn keyword oraKeywordUndObs _partial_pwise_join_enabled _pdml_separate_gim _push_join_predicate
+syn keyword oraKeywordUndObs _px_granule_size _px_index_sampling _px_load_publish_interval
+syn keyword oraKeywordUndObs _px_max_granules_per_slave _px_min_granules_per_slave _px_no_stealing
+syn keyword oraKeywordUndObs _row_cache_cursors _serial_direct_read _shared_pool_reserved_min_alloc
+syn keyword oraKeywordUndObs _sort_space_for_write_buffers _spin_count _system_trig_enabled
+syn keyword oraKeywordUndObs _trace_buffer_flushes _trace_cr_buffer_creates _trace_multi_block_reads
+syn keyword oraKeywordUndObs _transaction_recovery_servers _use_ism _yield_check_interval
+
+
+syn cluster oraAll add=oraKeyword,oraKeywordGroup,oraKeywordPref,oraKeywordObs,oraKeywordUnd,oraKeywordUndObs
+syn cluster oraAll add=oraValue,oraModifier,oraString,oraSpecial,oraComment
+
+"==============================================================================
+" highlighting
+
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ora_syn_inits")
+
+ if version < 508
+ let did_ora_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink oraKeyword Statement "usual keywords
+ HiLink oraKeywordGroup Type "keywords which group other keywords
+ HiLink oraKeywordPref oraKeywordGroup "keywords which act as prefixes
+ HiLink oraKeywordObs Todo "obsolete keywords
+ HiLink oraKeywordUnd PreProc "undocumented keywords
+ HiLink oraKeywordUndObs oraKeywordObs "undocumented obsolete keywords
+ HiLink oraValue Identifier "values, like true or false
+ HiLink oraModifier oraValue "modifies values
+ HiLink oraString String "strings
+
+ HiLink oraSpecial Special "special characters
+ HiLink oraError Error "errors
+ HiLink oraParenError oraError "errors caused by mismatching parantheses
+
+ HiLink oraComment Comment "comments
+
+ delcommand HiLink
+endif
+
+
+
+let b:current_syntax = "ora"
+
+if main_syntax == 'ora'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/papp.vim b/runtime/syntax/papp.vim
new file mode 100644
index 000000000..0d84d80d9
--- /dev/null
+++ b/runtime/syntax/papp.vim
@@ -0,0 +1,92 @@
+" Vim syntax file for the "papp" file format (_p_erl _app_lication)
+"
+" Language: papp
+" Maintainer: Marc Lehmann <pcg@goof.com>
+" Last Change: 2003 May 11
+" Filenames: *.papp *.pxml *.pxsl
+" URL: http://papp.plan9.de/
+
+" You can set the "papp_include_html" variable so that html will be
+" rendered as such inside phtml sections (in case you actually put html
+" there - papp does not require that). Also, rendering html tends to keep
+" the clutter high on the screen - mixing three languages is difficult
+" enough(!). PS: it is also slow.
+
+" pod is, btw, allowed everywhere, which is actually wrong :(
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" source is basically xml, with included html (this is common) and perl bits
+if version < 600
+ so <sfile>:p:h/xml.vim
+else
+ runtime! syntax/xml.vim
+endif
+unlet b:current_syntax
+
+if exists("papp_include_html")
+ if version < 600
+ syn include @PAppHtml <sfile>:p:h/html.vim
+ else
+ syn include @PAppHtml syntax/html.vim
+ endif
+ unlet b:current_syntax
+endif
+
+if version < 600
+ syn include @PAppPerl <sfile>:p:h/perl.vim
+else
+ syn include @PAppPerl syntax/perl.vim
+endif
+
+if v:version >= 600
+ syn cluster xmlFoldCluster add=papp_perl,papp_xperl,papp_phtml,papp_pxml,papp_perlPOD
+endif
+
+" preprocessor commands
+syn region papp_prep matchgroup=papp_prep start="^#\s*\(if\|elsif\)" end="$" keepend contains=@perlExpr contained
+syn match papp_prep /^#\s*\(else\|endif\|??\).*$/ contained
+" translation entries
+syn region papp_gettext start=/__"/ end=/"/ contained contains=@papp_perlInterpDQ
+syn cluster PAppHtml add=papp_gettext,papp_prep
+
+" add special, paired xperl, perl and phtml tags
+syn region papp_perl matchgroup=xmlTag start="<perl>" end="</perl>" contains=papp_CDATAp,@PAppPerl keepend
+syn region papp_xperl matchgroup=xmlTag start="<xperl>" end="</xperl>" contains=papp_CDATAp,@PAppPerl keepend
+syn region papp_phtml matchgroup=xmlTag start="<phtml>" end="</phtml>" contains=papp_CDATAh,papp_ph_perl,papp_ph_html,papp_ph_hint,@PAppHtml keepend
+syn region papp_pxml matchgroup=xmlTag start="<pxml>" end="</pxml>" contains=papp_CDATAx,papp_ph_perl,papp_ph_xml,papp_ph_xint keepend
+syn region papp_perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,perlTodo keepend
+
+" cdata sections
+syn region papp_CDATAp matchgroup=xmlCdataDecl start="<!\[CDATA\[" end="\]\]>" contains=@PAppPerl contained keepend
+syn region papp_CDATAh matchgroup=xmlCdataDecl start="<!\[CDATA\[" end="\]\]>" contains=papp_ph_perl,papp_ph_html,papp_ph_hint,@PAppHtml contained keepend
+syn region papp_CDATAx matchgroup=xmlCdataDecl start="<!\[CDATA\[" end="\]\]>" contains=papp_ph_perl,papp_ph_xml,papp_ph_xint contained keepend
+
+syn region papp_ph_perl matchgroup=Delimiter start="<[:?]" end="[:?]>"me=e-2 nextgroup=papp_ph_html contains=@PAppPerl contained keepend
+syn region papp_ph_html matchgroup=Delimiter start=":>" end="<[:?]"me=e-2 nextgroup=papp_ph_perl contains=@PAppHtml contained keepend
+syn region papp_ph_hint matchgroup=Delimiter start="?>" end="<[:?]"me=e-2 nextgroup=papp_ph_perl contains=@perlInterpDQ,@PAppHtml contained keepend
+syn region papp_ph_xml matchgroup=Delimiter start=":>" end="<[:?]"me=e-2 nextgroup=papp_ph_perl contains= contained keepend
+syn region papp_ph_xint matchgroup=Delimiter start="?>" end="<[:?]"me=e-2 nextgroup=papp_ph_perl contains=@perlInterpDQ contained keepend
+
+" synchronization is horrors!
+syn sync clear
+syn sync match pappSync grouphere papp_CDATAh "</\(perl\|xperl\|phtml\|macro\|module\)>"
+syn sync match pappSync grouphere papp_CDATAh "^# *\(if\|elsif\|else\|endif\)"
+syn sync match pappSync grouphere papp_CDATAh "</\(tr\|td\|table\|hr\|h1\|h2\|h3\)>"
+syn sync match pappSync grouphere NONE "</\=\(module\|state\|macro\)>"
+
+syn sync maxlines=300
+syn sync minlines=5
+
+" The default highlighting.
+
+hi def link papp_prep preCondit
+hi def link papp_gettext String
+
+let b:current_syntax = "papp"
diff --git a/runtime/syntax/pascal.vim b/runtime/syntax/pascal.vim
new file mode 100644
index 000000000..bba198f72
--- /dev/null
+++ b/runtime/syntax/pascal.vim
@@ -0,0 +1,357 @@
+" Vim syntax file
+" Language: Pascal
+" Version: 2.7
+" Last Change: 2003 May 11
+" Maintainer: Xavier Crégut <xavier.cregut@enseeiht.fr>
+" Previous Maintainer: Mario Eusebio <bio@dq.fct.unl.pt>
+
+" Contributors: Tim Chase <tchase@csc.com>, Stas Grabois <stsi@vtrails.com>,
+" Mazen NEIFER <mazen.neifer.2001@supaero.fr>,
+" Klaus Hast <Klaus.Hast@arcor.net>
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+syn case ignore
+syn sync lines=250
+
+syn keyword pascalBoolean true false
+syn keyword pascalConditional if else then
+syn keyword pascalConstant nil maxint
+syn keyword pascalLabel case goto label
+syn keyword pascalOperator and div downto in mod not of or packed with
+syn keyword pascalRepeat do for do repeat while to until
+syn keyword pascalStatement procedure function
+syn keyword pascalStatement program begin end const var type
+syn keyword pascalStruct record
+syn keyword pascalType array boolean char integer file pointer real set
+syn keyword pascalType string text variant
+
+
+syn keyword pascalTodo contained TODO
+
+
+" String
+if !exists("pascal_one_line_string")
+ syn region pascalString matchgroup=pascalString start=+'+ end=+'+ contains=pascalStringEscape
+ if exists("pascal_gpc")
+ syn region pascalString matchgroup=pascalString start=+"+ end=+"+ contains=pascalStringEscapeGPC
+ else
+ syn region pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ contains=pascalStringEscape
+ endif
+else
+ "wrong strings
+ syn region pascalStringError matchgroup=pascalStringError start=+'+ end=+'+ end=+$+ contains=pascalStringEscape
+ if exists("pascal_gpc")
+ syn region pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ end=+$+ contains=pascalStringEscapeGPC
+ else
+ syn region pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ end=+$+ contains=pascalStringEscape
+ endif
+
+ "right strings
+ syn region pascalString matchgroup=pascalString start=+'+ end=+'+ oneline contains=pascalStringEscape
+ " To see the start and end of strings:
+ " syn region pascalString matchgroup=pascalStringError start=+'+ end=+'+ oneline contains=pascalStringEscape
+ if exists("pascal_gpc")
+ syn region pascalString matchgroup=pascalString start=+"+ end=+"+ oneline contains=pascalStringEscapeGPC
+ else
+ syn region pascalStringError matchgroup=pascalStringError start=+"+ end=+"+ oneline contains=pascalStringEscape
+ endif
+end
+syn match pascalStringEscape contained "''"
+syn match pascalStringEscapeGPC contained '""'
+
+
+" syn match pascalIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
+
+
+if exists("pascal_symbol_operator")
+ syn match pascalSymbolOperator "[+\-/*=]"
+ syn match pascalSymbolOperator "[<>]=\="
+ syn match pascalSymbolOperator "<>"
+ syn match pascalSymbolOperator ":="
+ syn match pascalSymbolOperator "[()]"
+ syn match pascalSymbolOperator "\.\."
+ syn match pascalSymbolOperator "[\^.]"
+ syn match pascalMatrixDelimiter "[][]"
+ "if you prefer you can highlight the range
+ "syn match pascalMatrixDelimiter "[\d\+\.\.\d\+]"
+endif
+
+syn match pascalNumber "-\=\<\d\+\>"
+syn match pascalFloat "-\=\<\d\+\.\d\+\>"
+syn match pascalFloat "-\=\<\d\+\.\d\+[eE]-\=\d\+\>"
+syn match pascalHexNumber "\$[0-9a-fA-F]\+\>"
+
+if exists("pascal_no_tabs")
+ syn match pascalShowTab "\t"
+endif
+
+syn region pascalComment start="(\*" end="\*)" contains=pascalTodo
+syn region pascalComment start="{" end="}" contains=pascalTodo
+
+
+if !exists("pascal_no_functions")
+ " array functions
+ syn keyword pascalFunction pack unpack
+
+ " memory function
+ syn keyword pascalFunction Dispose New
+
+ " math functions
+ syn keyword pascalFunction Abs Arctan Cos Exp Ln Sin Sqr Sqrt
+
+ " file functions
+ syn keyword pascalFunction Eof Eoln Write Writeln
+ syn keyword pascalPredefined Input Output
+
+ if exists("pascal_traditional")
+ " These functions do not seem to be defined in Turbo Pascal
+ syn keyword pascalFunction Get Page Put
+ endif
+
+ " ordinal functions
+ syn keyword pascalFunction Odd Pred Succ
+
+ " transfert functions
+ syn keyword pascalFunction Chr Ord Round Trunc
+endif
+
+
+if !exists("pascal_traditional")
+
+ syn keyword pascalStatement constructor destructor implementation inherited
+ syn keyword pascalStatement interface unit uses
+ syn keyword pascalModifier absolute assembler external far forward inline
+ syn keyword pascalModifier interrupt near virtual
+ syn keyword pascalAcces private public
+ syn keyword pascalStruct object
+ syn keyword pascalOperator shl shr xor
+
+ syn region pascalPreProc start="(\*\$" end="\*)" contains=pascalTodo
+ syn region pascalPreProc start="{\$" end="}"
+
+ syn region pascalAsm matchgroup=pascalAsmKey start="\<asm\>" end="\<end\>" contains=pascalComment,pascalPreProc
+
+ syn keyword pascalType ShortInt LongInt Byte Word
+ syn keyword pascalType ByteBool WordBool LongBool
+ syn keyword pascalType Cardinal LongWord
+ syn keyword pascalType Single Double Extended Comp
+ syn keyword pascalType PChar
+
+
+ if !exists ("pascal_fpc")
+ syn keyword pascalPredefined Result
+ endif
+
+ if exists("pascal_fpc")
+ syn region pascalComment start="//" end="$"
+ syn keyword pascalStatement fail otherwise operator
+ syn keyword pascalDirective popstack
+ syn keyword pascalPredefined self
+ syn keyword pascalType ShortString AnsiString WideString
+ endif
+
+ if exists("pascal_gpc")
+ syn keyword pascalType SmallInt
+ syn keyword pascalType AnsiChar
+ syn keyword pascalType PAnsiChar
+ endif
+
+ if exists("pascal_delphi")
+ syn region pascalComment start="//" end="$" contains=pascalTodo
+ syn keyword pascalType SmallInt Int64
+ syn keyword pascalType Real48 Currency
+ syn keyword pascalType AnsiChar WideChar
+ syn keyword pascalType ShortString AnsiString WideString
+ syn keyword pascalType PAnsiChar PWideChar
+ syn match pascalFloat "-\=\<\d\+\.\d\+[dD]-\=\d\+\>"
+ syn match pascalStringEscape contained "#[12][0-9]\=[0-9]\="
+ syn keyword pascalStruct class dispinterface
+ syn keyword pascalException try except raise at on finally
+ syn keyword pascalStatement out
+ syn keyword pascalStatement library package
+ syn keyword pascalStatement initialization finalization uses exports
+ syn keyword pascalStatement property out resourcestring threadvar
+ syn keyword pascalModifier contains
+ syn keyword pascalModifier overridden reintroduce abstract
+ syn keyword pascalModifier override export dynamic name message
+ syn keyword pascalModifier dispid index stored default nodefault readonly
+ syn keyword pascalModifier writeonly implements overload requires resident
+ syn keyword pascalAcces protected published automated
+ syn keyword pascalDirective register pascal cvar cdecl stdcall safecall
+ syn keyword pascalOperator as is
+ endif
+
+ if exists("pascal_no_functions")
+ "syn keyword pascalModifier read write
+ "may confuse with Read and Write functions. Not easy to handle.
+ else
+ " control flow functions
+ syn keyword pascalFunction Break Continue Exit Halt RunError
+
+ " ordinal functions
+ syn keyword pascalFunction Dec Inc High Low
+
+ " math functions
+ syn keyword pascalFunction Frac Int Pi
+
+ " string functions
+ syn keyword pascalFunction Concat Copy Delete Insert Length Pos Str Val
+
+ " memory function
+ syn keyword pascalFunction FreeMem GetMem MaxAvail MemAvail
+
+ " pointer and address functions
+ syn keyword pascalFunction Addr Assigned CSeg DSeg Ofs Ptr Seg SPtr SSeg
+
+ " misc functions
+ syn keyword pascalFunction Exclude FillChar Hi Include Lo Move ParamCount
+ syn keyword pascalFunction ParamStr Random Randomize SizeOf Swap TypeOf
+ syn keyword pascalFunction UpCase
+
+ " predefined variables
+ syn keyword pascalPredefined ErrorAddr ExitCode ExitProc FileMode FreeList
+ syn keyword pascalPredefined FreeZero HeapEnd HeapError HeapOrg HeapPtr
+ syn keyword pascalPredefined InOutRes OvrCodeList OvrDebugPtr OvrDosHandle
+ syn keyword pascalPredefined OvrEmsHandle OvrHeapEnd OvrHeapOrg OvrHeapPtr
+ syn keyword pascalPredefined OvrHeapSize OvrLoadList PrefixSeg RandSeed
+ syn keyword pascalPredefined SaveInt00 SaveInt02 SaveInt1B SaveInt21
+ syn keyword pascalPredefined SaveInt23 SaveInt24 SaveInt34 SaveInt35
+ syn keyword pascalPredefined SaveInt36 SaveInt37 SaveInt38 SaveInt39
+ syn keyword pascalPredefined SaveInt3A SaveInt3B SaveInt3C SaveInt3D
+ syn keyword pascalPredefined SaveInt3E SaveInt3F SaveInt75 SegA000 SegB000
+ syn keyword pascalPredefined SegB800 SelectorInc StackLimit Test8087
+
+ " file functions
+ syn keyword pascalFunction Append Assign BlockRead BlockWrite ChDir Close
+ syn keyword pascalFunction Erase FilePos FileSize Flush GetDir IOResult
+ syn keyword pascalFunction MkDir Read Readln Rename Reset Rewrite RmDir
+ syn keyword pascalFunction Seek SeekEof SeekEoln SetTextBuf Truncate
+
+ " crt unit
+ syn keyword pascalFunction AssignCrt ClrEol ClrScr Delay DelLine GotoXY
+ syn keyword pascalFunction HighVideo InsLine KeyPressed LowVideo NormVideo
+ syn keyword pascalFunction NoSound ReadKey Sound TextBackground TextColor
+ syn keyword pascalFunction TextMode WhereX WhereY Window
+ syn keyword pascalPredefined CheckBreak CheckEOF CheckSnow DirectVideo
+ syn keyword pascalPredefined LastMode TextAttr WindMin WindMax
+ syn keyword pascalFunction BigCursor CursorOff CursorOn
+ syn keyword pascalConstant Black Blue Green Cyan Red Magenta Brown
+ syn keyword pascalConstant LightGray DarkGray LightBlue LightGreen
+ syn keyword pascalConstant LightCyan LightRed LightMagenta Yellow White
+ syn keyword pascalConstant Blink ScreenWidth ScreenHeight bw40
+ syn keyword pascalConstant co40 bw80 co80 mono
+ syn keyword pascalPredefined TextChar
+
+ " DOS unit
+ syn keyword pascalFunction AddDisk DiskFree DiskSize DosExitCode DosVersion
+ syn keyword pascalFunction EnvCount EnvStr Exec Expand FindClose FindFirst
+ syn keyword pascalFunction FindNext FSearch FSplit GetCBreak GetDate
+ syn keyword pascalFunction GetEnv GetFAttr GetFTime GetIntVec GetTime
+ syn keyword pascalFunction GetVerify Intr Keep MSDos PackTime SetCBreak
+ syn keyword pascalFunction SetDate SetFAttr SetFTime SetIntVec SetTime
+ syn keyword pascalFunction SetVerify SwapVectors UnPackTime
+ syn keyword pascalConstant FCarry FParity FAuxiliary FZero FSign FOverflow
+ syn keyword pascalConstant Hidden Sysfile VolumeId Directory Archive
+ syn keyword pascalConstant AnyFile fmClosed fmInput fmOutput fmInout
+ syn keyword pascalConstant TextRecNameLength TextRecBufSize
+ syn keyword pascalType ComStr PathStr DirStr NameStr ExtStr SearchRec
+ syn keyword pascalType FileRec TextBuf TextRec Registers DateTime
+ syn keyword pascalPredefined DosError
+
+ "Graph Unit
+ syn keyword pascalFunction Arc Bar Bar3D Circle ClearDevice ClearViewPort
+ syn keyword pascalFunction CloseGraph DetectGraph DrawPoly Ellipse
+ syn keyword pascalFunction FillEllipse FillPoly FloodFill GetArcCoords
+ syn keyword pascalFunction GetAspectRatio GetBkColor GetColor
+ syn keyword pascalFunction GetDefaultPalette GetDriverName GetFillPattern
+ syn keyword pascalFunction GetFillSettings GetGraphMode GetImage
+ syn keyword pascalFunction GetLineSettings GetMaxColor GetMaxMode GetMaxX
+ syn keyword pascalFunction GetMaxY GetModeName GetModeRange GetPalette
+ syn keyword pascalFunction GetPaletteSize GetPixel GetTextSettings
+ syn keyword pascalFunction GetViewSettings GetX GetY GraphDefaults
+ syn keyword pascalFunction GraphErrorMsg GraphResult ImageSize InitGraph
+ syn keyword pascalFunction InstallUserDriver InstallUserFont Line LineRel
+ syn keyword pascalFunction LineTo MoveRel MoveTo OutText OutTextXY
+ syn keyword pascalFunction PieSlice PutImage PutPixel Rectangle
+ syn keyword pascalFunction RegisterBGIDriver RegisterBGIFont
+ syn keyword pascalFunction RestoreCRTMode Sector SetActivePage
+ syn keyword pascalFunction SetAllPallette SetAspectRatio SetBkColor
+ syn keyword pascalFunction SetColor SetFillPattern SetFillStyle
+ syn keyword pascalFunction SetGraphBufSize SetGraphMode SetLineStyle
+ syn keyword pascalFunction SetPalette SetRGBPalette SetTextJustify
+ syn keyword pascalFunction SetTextStyle SetUserCharSize SetViewPort
+ syn keyword pascalFunction SetVisualPage SetWriteMode TextHeight TextWidth
+ syn keyword pascalType ArcCoordsType FillPatternType FillSettingsType
+ syn keyword pascalType LineSettingsType PaletteType PointType
+ syn keyword pascalType TextSettingsType ViewPortType
+
+ " string functions
+ syn keyword pascalFunction StrAlloc StrBufSize StrCat StrComp StrCopy
+ syn keyword pascalFunction StrDispose StrECopy StrEnd StrFmt StrIComp
+ syn keyword pascalFunction StrLCat StrLComp StrLCopy StrLen StrLFmt
+ syn keyword pascalFunction StrLIComp StrLower StrMove StrNew StrPas
+ syn keyword pascalFunction StrPCopy StrPLCopy StrPos StrRScan StrScan
+ syn keyword pascalFunction StrUpper
+ endif
+
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pascal_syn_inits")
+ if version < 508
+ let did_pascal_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pascalAcces pascalStatement
+ HiLink pascalBoolean Boolean
+ HiLink pascalComment Comment
+ HiLink pascalConditional Conditional
+ HiLink pascalConstant Constant
+ HiLink pascalDelimiter Identifier
+ HiLink pascalDirective pascalStatement
+ HiLink pascalException Exception
+ HiLink pascalFloat Float
+ HiLink pascalFunction Function
+ HiLink pascalLabel Label
+ HiLink pascalMatrixDelimiter Identifier
+ HiLink pascalModifier Type
+ HiLink pascalNumber Number
+ HiLink pascalOperator Operator
+ HiLink pascalPredefined pascalStatement
+ HiLink pascalPreProc PreProc
+ HiLink pascalRepeat Repeat
+ HiLink pascalStatement Statement
+ HiLink pascalString String
+ HiLink pascalStringEscape Special
+ HiLink pascalStringEscapeGPC Special
+ HiLink pascalStringError Error
+ HiLink pascalStruct pascalStatement
+ HiLink pascalSymbolOperator pascalOperator
+ HiLink pascalTodo Todo
+ HiLink pascalType Type
+ HiLink pascalUnclassified pascalStatement
+ " HiLink pascalAsm Assembler
+ HiLink pascalError Error
+ HiLink pascalAsmKey pascalStatement
+ HiLink pascalShowTab Error
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "pascal"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/pcap.vim b/runtime/syntax/pcap.vim
new file mode 100644
index 000000000..17d0d42c0
--- /dev/null
+++ b/runtime/syntax/pcap.vim
@@ -0,0 +1,65 @@
+" Vim syntax file
+" Config file: printcap
+" Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> (defunct)
+" Modified by Bram
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+"define keywords
+if version < 600
+ set isk=@,46-57,_,-,#,=,192-255
+else
+ setlocal isk=@,46-57,_,-,#,=,192-255
+endif
+
+"first all the bad guys
+syn match pcapBad '^.\+$' "define any line as bad
+syn match pcapBadword '\k\+' contained "define any sequence of keywords as bad
+syn match pcapBadword ':' contained "define any single : as bad
+syn match pcapBadword '\\' contained "define any single \ as bad
+"then the good boys
+" Boolean keywords
+syn match pcapKeyword contained ':\(fo\|hl\|ic\|rs\|rw\|sb\|sc\|sf\|sh\)'
+" Numeric Keywords
+syn match pcapKeyword contained ':\(br\|du\|fc\|fs\|mx\|pc\|pl\|pw\|px\|py\|xc\|xs\)#\d\+'
+" String Keywords
+syn match pcapKeyword contained ':\(af\|cf\|df\|ff\|gf\|if\|lf\|lo\|lp\|nd\|nf\|of\|rf\|rg\|rm\|rp\|sd\|st\|tf\|tr\|vf\)=\k*'
+" allow continuation
+syn match pcapEnd ':\\$' contained
+"
+syn match pcapDefineLast '^\s.\+$' contains=pcapBadword,pcapKeyword
+syn match pcapDefine '^\s.\+$' contains=pcapBadword,pcapKeyword,pcapEnd
+syn match pcapHeader '^\k[^|]\+\(|\k[^|]\+\)*:\\$'
+syn match pcapComment "#.*$"
+
+syn sync minlines=50
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pcap_syntax_inits")
+ if version < 508
+ let did_pcap_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pcapBad WarningMsg
+ HiLink pcapBadword WarningMsg
+ HiLink pcapComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pcap"
+
+" vim: ts=8
diff --git a/runtime/syntax/pccts.vim b/runtime/syntax/pccts.vim
new file mode 100644
index 000000000..ef5268117
--- /dev/null
+++ b/runtime/syntax/pccts.vim
@@ -0,0 +1,106 @@
+" Vim syntax file
+" Language: PCCTS
+" Maintainer: Scott Bigham <dsb@cs.duke.edu>
+" Last Change: 10 Aug 1999
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C++ syntax to start with
+if version < 600
+ syn include @cppTopLevel <sfile>:p:h/cpp.vim
+else
+ syn include @cppTopLevel syntax/cpp.vim
+endif
+
+syn region pcctsAction matchgroup=pcctsDelim start="<<" end=">>?\=" contains=@cppTopLevel,pcctsRuleRef
+
+syn region pcctsArgBlock matchgroup=pcctsDelim start="\(>\s*\)\=\[" end="\]" contains=@cppTopLevel,pcctsRuleRef
+
+syn region pcctsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pcctsSpecialChar
+syn match pcctsSpecialChar "\\\\\|\\\"" contained
+
+syn region pcctsComment start="/\*" end="\*/" contains=cTodo
+syn match pcctsComment "//.*$" contains=cTodo
+
+syn region pcctsDirective start="^\s*#header\s\+<<" end=">>" contains=pcctsAction keepend
+syn match pcctsDirective "^\s*#parser\>.*$" contains=pcctsString,pcctsComment
+syn match pcctsDirective "^\s*#tokdefs\>.*$" contains=pcctsString,pcctsComment
+syn match pcctsDirective "^\s*#token\>.*$" contains=pcctsString,pcctsAction,pcctsTokenName,pcctsComment
+syn region pcctsDirective start="^\s*#tokclass\s\+[A-Z]\i*\s\+{" end="}" contains=pcctsString,pcctsTokenName
+syn match pcctsDirective "^\s*#lexclass\>.*$" contains=pcctsTokenName
+syn region pcctsDirective start="^\s*#errclass\s\+[^{]\+\s\+{" end="}" contains=pcctsString,pcctsTokenName
+syn match pcctsDirective "^\s*#pred\>.*$" contains=pcctsTokenName,pcctsAction
+
+syn cluster pcctsInRule contains=pcctsString,pcctsRuleName,pcctsTokenName,pcctsAction,pcctsArgBlock,pcctsSubRule,pcctsLabel,pcctsComment
+
+syn region pcctsRule start="\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\(\s*>\s*\[[^]]*\]\)\=\s*:" end=";" contains=@pcctsInRule
+
+syn region pcctsSubRule matchgroup=pcctsDelim start="(" end=")\(+\|\*\|?\(\s*=>\)\=\)\=" contains=@pcctsInRule contained
+syn region pcctsSubRule matchgroup=pcctsDelim start="{" end="}" contains=@pcctsInRule contained
+
+syn match pcctsRuleName "\<[a-z]\i*\>" contained
+syn match pcctsTokenName "\<[A-Z]\i*\>" contained
+
+syn match pcctsLabel "\<\I\i*:\I\i*" contained contains=pcctsLabelHack,pcctsRuleName,pcctsTokenName
+syn match pcctsLabel "\<\I\i*:\"\([^\\]\|\\.\)*\"" contained contains=pcctsLabelHack,pcctsString
+syn match pcctsLabelHack "\<\I\i*:" contained
+
+syn match pcctsRuleRef "\$\I\i*\>" contained
+syn match pcctsRuleRef "\$\d\+\(\.\d\+\)\>" contained
+
+syn keyword pcctsClass class nextgroup=pcctsClassName skipwhite
+syn match pcctsClassName "\<\I\i*\>" contained nextgroup=pcctsClassBlock skipwhite skipnl
+syn region pcctsClassBlock start="{" end="}" contained contains=pcctsRule,pcctsComment,pcctsDirective,pcctsAction,pcctsException,pcctsExceptionHandler
+
+syn keyword pcctsException exception nextgroup=pcctsExceptionRuleRef skipwhite
+syn match pcctsExceptionRuleRef "\[\I\i*\]" contained contains=pcctsExceptionID
+syn match pcctsExceptionID "\I\i*" contained
+syn keyword pcctsExceptionHandler catch default
+syn keyword pcctsExceptionHandler NoViableAlt NoSemViableAlt
+syn keyword pcctsExceptionHandler MismatchedToken
+
+syn sync clear
+syn sync match pcctsSyncAction grouphere pcctsAction "<<"
+syn sync match pcctsSyncAction "<<\([^>]\|>[^>]\)*>>"
+syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\s*\[[^]]*\]\s*:"
+syn sync match pcctsSyncRule grouphere pcctsRule "\<[a-z][A-Za-z0-9_]*\>\(\s*\[[^]]*\]\)\=\s*>\s*\[[^]]*\]\s*:"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pccts_syntax_inits")
+ if version < 508
+ let did_pccts_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pcctsDelim Special
+ HiLink pcctsTokenName Identifier
+ HiLink pcctsRuleName Statement
+ HiLink pcctsLabelHack Label
+ HiLink pcctsDirective PreProc
+ HiLink pcctsString String
+ HiLink pcctsComment Comment
+ HiLink pcctsClass Statement
+ HiLink pcctsClassName Identifier
+ HiLink pcctsException Statement
+ HiLink pcctsExceptionHandler Keyword
+ HiLink pcctsExceptionRuleRef pcctsDelim
+ HiLink pcctsExceptionID Identifier
+ HiLink pcctsRuleRef Identifier
+ HiLink pcctsSpecialChar SpecialChar
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pccts"
+
+" vim: ts=8
diff --git a/runtime/syntax/perl.vim b/runtime/syntax/perl.vim
new file mode 100644
index 000000000..438872918
--- /dev/null
+++ b/runtime/syntax/perl.vim
@@ -0,0 +1,556 @@
+" Vim syntax file
+" Language: Perl
+" Maintainer: Nick Hibma <n_hibma@van-laarhoven.org>
+" Last Change: 2004 May 16
+" Location: http://www.van-laarhoven.org/vim/syntax/perl.vim
+"
+" Please download most recent version first before mailing
+" any comments.
+" See also the file perl.vim.regression.pl to check whether your
+" modifications work in the most odd cases
+" http://www.van-laarhoven.org/vim/syntax/perl.vim.regression.pl
+"
+" Original version: Sonia Heimann <niania@netsurf.org>
+" Thanks to many people for their contribution.
+
+" The following parameters are available for tuning the
+" perl syntax highlighting, with defaults given:
+"
+" unlet perl_include_pod
+" unlet perl_want_scope_in_variables
+" unlet perl_extended_vars
+" unlet perl_string_as_statement
+" unlet perl_no_sync_on_sub
+" unlet perl_no_sync_on_global_var
+" let perl_sync_dist = 100
+" unlet perl_fold
+" unlet perl_fold_blocks
+
+" Remove any old syntax stuff that was loaded (5.x) or quit when a syntax file
+" was already loaded (6.x).
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Unset perl_fold if it set but vim doesn't support it.
+if version < 600 && exists("perl_fold")
+ unlet perl_fold
+endif
+
+
+" POD starts with ^=<word> and ends with ^=cut
+
+if exists("perl_include_pod")
+ " Include a while extra syntax file
+ syn include @Pod syntax/pod.vim
+ unlet b:current_syntax
+ if exists("perl_fold")
+ syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,perlTodo keepend fold
+ syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold
+ else
+ syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,perlTodo keepend
+ syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend
+ endif
+else
+ " Use only the bare minimum of rules
+ if exists("perl_fold")
+ syn region perlPOD start="^=[a-z]" end="^=cut" fold
+ else
+ syn region perlPOD start="^=[a-z]" end="^=cut"
+ endif
+endif
+
+
+" All keywords
+"
+if exists("perl_fold") && exists("perl_fold_blocks")
+ syn match perlConditional "\<if\>"
+ syn match perlConditional "\<elsif\>"
+ syn match perlConditional "\<unless\>"
+ syn match perlConditional "\<else\>" nextgroup=perlElseIfError skipwhite skipnl skipempty
+else
+ syn keyword perlConditional if elsif unless
+ syn keyword perlConditional else nextgroup=perlElseIfError skipwhite skipnl skipempty
+endif
+syn keyword perlConditional switch eq ne gt lt ge le cmp not and or xor err
+if exists("perl_fold") && exists("perl_fold_blocks")
+ syn match perlRepeat "\<while\>"
+ syn match perlRepeat "\<for\>"
+ syn match perlRepeat "\<foreach\>"
+ syn match perlRepeat "\<do\>"
+ syn match perlRepeat "\<until\>"
+ syn match perlRepeat "\<continue\>"
+else
+ syn keyword perlRepeat while for foreach do until continue
+endif
+syn keyword perlOperator defined undef and or not bless ref
+if exists("perl_fold")
+ " if BEGIN/END is a keyword the perlBEGINENDFold does not work
+ syn match perlControl "\<BEGIN\>" contained
+ syn match perlControl "\<END\>" contained
+else
+ syn keyword perlControl BEGIN END
+endif
+
+syn keyword perlStatementStorage my local our
+syn keyword perlStatementControl goto return last next redo
+syn keyword perlStatementScalar chomp chop chr crypt index lc lcfirst length ord pack reverse rindex sprintf substr uc ucfirst
+syn keyword perlStatementRegexp pos quotemeta split study
+syn keyword perlStatementNumeric abs atan2 cos exp hex int log oct rand sin sqrt srand
+syn keyword perlStatementList splice unshift shift push pop split join reverse grep map sort unpack
+syn keyword perlStatementHash each exists keys values tie tied untie
+syn keyword perlStatementIOfunc carp confess croak dbmclose dbmopen die syscall
+syn keyword perlStatementFiledesc binmode close closedir eof fileno getc lstat print printf readdir readline readpipe rewinddir select stat tell telldir write nextgroup=perlFiledescStatementNocomma skipwhite
+syn keyword perlStatementFiledesc fcntl flock ioctl open opendir read seek seekdir sysopen sysread sysseek syswrite truncate nextgroup=perlFiledescStatementComma skipwhite
+syn keyword perlStatementVector pack vec
+syn keyword perlStatementFiles chdir chmod chown chroot glob link mkdir readlink rename rmdir symlink umask unlink utime
+syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
+syn keyword perlStatementFlow caller die dump eval exit wantarray
+syn keyword perlStatementInclude require
+syn match perlStatementInclude "\(use\|no\)\s\+\(integer\>\|strict\>\|lib\>\|sigtrap\>\|subs\>\|vars\>\|warnings\>\|utf8\>\|byte\>\)\="
+syn keyword perlStatementScope import
+syn keyword perlStatementProc alarm exec fork getpgrp getppid getpriority kill pipe setpgrp setpriority sleep system times wait waitpid
+syn keyword perlStatementSocket accept bind connect getpeername getsockname getsockopt listen recv send setsockopt shutdown socket socketpair
+syn keyword perlStatementIPC msgctl msgget msgrcv msgsnd semctl semget semop shmctl shmget shmread shmwrite
+syn keyword perlStatementNetwork endhostent endnetent endprotoent endservent gethostbyaddr gethostbyname gethostent getnetbyaddr getnetbyname getnetent getprotobyname getprotobynumber getprotoent getservbyname getservbyport getservent sethostent setnetent setprotoent setservent
+syn keyword perlStatementPword getpwuid getpwnam getpwent setpwent endpwent getgrent getgrgid getlogin getgrnam setgrent endgrent
+syn keyword perlStatementTime gmtime localtime time times
+
+syn keyword perlStatementMisc warn formline reset scalar delete prototype lock
+syn keyword perlStatementNew new
+
+syn keyword perlTodo TODO TBD FIXME XXX contained
+
+" Perl Identifiers.
+"
+" Should be cleaned up to better handle identifiers in particular situations
+" (in hash keys for example)
+"
+" Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc.
+" We do not process complex things such as @{${"foo"}}. Too complicated, and
+" too slow. And what is after the -> is *not* considered as part of the
+" variable - there again, too complicated and too slow.
+
+" Special variables first ($^A, ...) and ($|, $', ...)
+syn match perlVarPlain "$^[ADEFHILMOPSTWX]\="
+syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@$<>(-]"
+syn match perlVarPlain "$\(0\|[1-9][0-9]*\)"
+" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
+syn match perlVarPlain "$:[^:]"
+" These variables are not recognized within matches.
+syn match perlVarNotInMatches "$[|)]"
+" This variable is not recognized within matches delimited by m//.
+syn match perlVarSlash "$/"
+
+" And plain identifiers
+syn match perlPackageRef "\(\h\w*\)\=\(::\|'\)\I"me=e-1 contained
+
+" To highlight packages in variables as a scope reference - i.e. in $pack::var,
+" pack:: is a scope, just set "perl_want_scope_in_variables"
+" If you *want* complex things like @{${"foo"}} to be processed,
+" just set the variable "perl_extended_vars"...
+
+" FIXME value between {} should be marked as string. is treated as such by Perl.
+" At the moment it is marked as something greyish instead of read. Probably todo
+" with transparency. Or maybe we should handle the bare word in that case. or make it into
+
+if exists("perl_want_scope_in_variables")
+ syn match perlVarPlain "\\\=\([@%$]\|\$#\)\$*\(\I\i*\)\=\(\(::\|'\)\I\i*\)*\>" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
+ syn match perlFunctionName "\\\=&\$*\(\I\i*\)\=\(\(::\|'\)\I\i*\)*\>" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember
+else
+ syn match perlVarPlain "\\\=\([@%$]\|\$#\)\$*\(\I\i*\)\=\(\(::\|'\)\I\i*\)*\>" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
+ syn match perlFunctionName "\\\=&\$*\(\I\i*\)\=\(\(::\|'\)\I\i*\)*\>" nextgroup=perlVarMember,perlVarSimpleMember
+endif
+
+if exists("perl_extended_vars")
+ syn cluster perlExpr contains=perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ
+ syn region perlVarBlock matchgroup=perlVarPlain start="\($#\|[@%$]\)\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember
+ syn region perlVarBlock matchgroup=perlVarPlain start="&\$*{" skip="\\}" end="}" contains=@perlExpr
+ syn match perlVarPlain "\\\=\(\$#\|[@%&$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember
+ syn region perlVarMember matchgroup=perlVarPlain start="\(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember
+ syn match perlVarSimpleMember "\(->\)\={\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember contains=perlVarSimpleMemberName contained
+ syn match perlVarSimpleMemberName "\I\i*" contained
+ syn region perlVarMember matchgroup=perlVarPlain start="\(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember
+ syn match perlMethod "\(->\)\I\i*" contained
+endif
+
+" File Descriptors
+syn match perlFiledescRead "[<]\h\w\+[>]"
+
+syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
+syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
+
+syn match perlFiledescStatement "\u\w*" contained
+
+" Special characters in strings and matches
+syn match perlSpecialString "\\\(\d\+\|[xX]\x\+\|c\u\|.\)" contained
+syn match perlSpecialStringU "\\['\\]" contained
+syn match perlSpecialMatch "{\d\(,\d\)\=}" contained
+syn match perlSpecialMatch "\[\(\]\|-\)\=[^\[\]]*\(\[\|\-\)\=\]" contained
+syn match perlSpecialMatch "[+*()?.]" contained
+syn match perlSpecialMatch "(?[#:=!]" contained
+syn match perlSpecialMatch "(?[imsx]\+)" contained
+" FIXME the line below does not work. It should mark end of line and
+" begin of line as perlSpecial.
+" syn match perlSpecialBEOM "^\^\|\$$" contained
+
+" Possible errors
+"
+" Highlight lines with only whitespace (only in blank delimited here documents) as errors
+syn match perlNotEmptyLine "^\s\+$" contained
+" Highlight '} else if (...) {', it should be '} else { if (...) { ' or
+" '} elsif (...) {'.
+"syn keyword perlElseIfError if contained
+
+" Variable interpolation
+"
+" These items are interpolated inside "" strings and similar constructs.
+syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock
+" These items are interpolated inside '' strings and similar constructs.
+syn cluster perlInterpSQ contains=perlSpecialStringU
+" These items are interpolated inside m// matches and s/// substitutions.
+syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock,perlSpecialBEOM
+" These items are interpolated inside m## matches and s### substitutions.
+syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash
+
+" Shell commands
+syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ
+
+" Constants
+"
+" Numbers
+syn match perlNumber "[-+]\=\(\<\d[[:digit:]_]*L\=\>\|0[xX]\x[[:xdigit:]_]*\>\)"
+syn match perlFloat "[-+]\=\<\d[[:digit:]_]*[eE][\-+]\=\d\+"
+syn match perlFloat "[-+]\=\<\d[[:digit:]_]*\.[[:digit:]_]*\([eE][\-+]\=\d\+\)\="
+syn match perlFloat "[-+]\=\<\.[[:digit:]_]\+\([eE][\-+]\=\d\+\)\="
+
+
+" Simple version of searches and matches
+" caters for m//, m##, m{} and m[] (and the !/ variant)
+syn region perlMatch matchgroup=perlMatchStartEnd start=+[m!]/+ end=+/[cgimosx]*+ contains=@perlInterpSlash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+[m!]#+ end=+#[cgimosx]*+ contains=@perlInterpMatch
+syn region perlMatch matchgroup=perlMatchStartEnd start=+[m!]{+ end=+}[cgimosx]*+ contains=@perlInterpMatch
+syn region perlMatch matchgroup=perlMatchStartEnd start=+[m!]\[+ end=+\][cgimosx]*+ contains=@perlInterpMatch
+
+" A special case for m!!x which allows for comments and extra whitespace in the pattern
+syn region perlMatch matchgroup=perlMatchStartEnd start=+[m!]!+ end=+![cgimosx]*+ contains=@perlInterpSlash,perlComment
+
+" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
+" cases as the / is used in so many other ways, but these should be the most obvious ones.
+"syn region perlMatch matchgroup=perlMatchStartEnd start=+^split /+lc=5 start=+[^$@%]\<split /+lc=6 start=+^if /+lc=2 start=+[^$@%]if /+lc=3 start=+[!=]\~\s*/+lc=2 start=+[(~]/+lc=1 start=+\.\./+lc=2 start=+\s/[^= \t0-9$@%]+lc=1,me=e-1,rs=e-1 start=+^/+ skip=+\\/+ end=+/[cgimosx]*+ contains=@perlInterpSlash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+^split /+lc=5 start=+[^$@%]\<split /+lc=6 start=+^while /+lc=5 start=+[^$@%]while /+lc=6 start=+^if /+lc=2 start=+[^$@%]if /+lc=3 start=+[!=]\~\s*/+lc=2 start=+[(~]/+lc=1 start=+\.\./+lc=2 start=+\s/[^= \t0-9$@%]+lc=1,me=e-1,rs=e-1 start=+^/+ skip=+\\/+ end=+/[cgimosx]*+ contains=@perlInterpSlash
+
+
+" Substitutions
+" caters for s///, s### and s[][]
+" perlMatch is the first part, perlSubstitution* is the substitution part
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s"+ end=+"+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionDQ
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionSlash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionHash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s\[+ end=+\]+ contains=@perlInterpMatch nextgroup=perlSubstitutionBracket skipwhite skipempty skipnl
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s{+ end=+}+ contains=@perlInterpMatch nextgroup=perlSubstitutionCurly skipwhite skipempty skipnl
+syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[ecgimosx]*+ contained contains=@perlInterpSQ
+syn region perlSubstitutionDQ matchgroup=perlMatchStartEnd start=+"+ end=+"[ecgimosx]*+ contained contains=@perlInterpDQ
+syn region perlSubstitutionSlash matchgroup=perlMatchStartEnd start=+/+ end=+/[ecgimosx]*+ contained contains=@perlInterpDQ
+syn region perlSubstitutionHash matchgroup=perlMatchStartEnd start=+#+ end=+#[ecgimosx]*+ contained contains=@perlInterpDQ
+syn region perlSubstitutionBracket matchgroup=perlMatchStartEnd start=+\[+ end=+\][ecgimosx]*+ contained contains=@perlInterpDQ
+syn region perlSubstitutionCurly matchgroup=perlMatchStartEnd start=+{+ end=+}[ecgimosx]*+ contained contains=@perlInterpDQ
+
+" A special case for m!!x which allows for comments and extra whitespace in the pattern
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<s!+ end=+!+me=e-1 contains=@perlInterpSlash,perlComment nextgroup=perlSubstitutionPling
+syn region perlSubstitutionPling matchgroup=perlMatchStartEnd start=+!+ end=+![ecgimosx]*+ contained contains=@perlInterpDQ
+
+" Substitutions
+" caters for tr///, tr### and tr[][]
+" perlMatch is the first part, perlTranslation* is the second, translator part.
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\)'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationSQ
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\)"+ end=+"+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationDQ
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\)/+ end=+/+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationSlash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationHash
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\)\[+ end=+\]+ contains=@perlInterpSQ nextgroup=perlTranslationBracket skipwhite skipempty skipnl
+syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\(tr\|y\){+ end=+}+ contains=@perlInterpSQ nextgroup=perlTranslationCurly skipwhite skipempty skipnl
+syn region perlTranslationSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[cds]*+ contained
+syn region perlTranslationDQ matchgroup=perlMatchStartEnd start=+"+ end=+"[cds]*+ contained
+syn region perlTranslationSlash matchgroup=perlMatchStartEnd start=+/+ end=+/[cds]*+ contained
+syn region perlTranslationHash matchgroup=perlMatchStartEnd start=+#+ end=+#[cds]*+ contained
+syn region perlTranslationBracket matchgroup=perlMatchStartEnd start=+\[+ end=+\][cds]*+ contained
+syn region perlTranslationCurly matchgroup=perlMatchStartEnd start=+{+ end=+}[cds]*+ contained
+
+
+" The => operator forces a bareword to the left of it to be interpreted as
+" a string
+syn match perlString "\<\I\i*\s*=>"me=e-2
+
+" Strings and q, qq, qw and qr expressions
+
+" Brackets in qq()
+syn region perlBrackets start=+(+ end=+)+ contained transparent contains=perlBrackets,@perlStringSQ
+
+syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ
+syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q#+ end=+#+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q|+ end=+|+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q(+ end=+)+ contains=@perlInterpSQ,perlBrackets
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q{+ end=+}+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q/+ end=+/+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q[qx]#+ end=+#+ contains=@perlInterpDQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q[qx]|+ end=+|+ contains=@perlInterpDQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q[qx](+ end=+)+ contains=@perlInterpDQ,perlBrackets
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q[qx]{+ end=+}+ contains=@perlInterpDQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<q[qx]/+ end=+/+ contains=@perlInterpDQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qw#+ end=+#+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qw|+ end=+|+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qw(+ end=+)+ contains=@perlInterpSQ,perlBrackets
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qw{+ end=+}+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qw/+ end=+/+ contains=@perlInterpSQ
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qr#+ end=+#[imosx]*+ contains=@perlInterpMatch
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qr|+ end=+|[imosx]*+ contains=@perlInterpMatch
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qr(+ end=+)[imosx]*+ contains=@perlInterpMatch
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qr{+ end=+}[imosx]*+ contains=@perlInterpMatch
+syn region perlQQ matchgroup=perlStringStartEnd start=+\<qr/+ end=+/[imosx]*+ contains=@perlInterpSlash
+
+" Constructs such as print <<EOF [...] EOF, 'here' documents
+"
+if version >= 600
+ " XXX Any statements after the identifier are in perlString colour (i.e.
+ " 'if $a' in 'print <<EOF if $a').
+ if exists("perl_fold")
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+^\z1$+ contains=@perlInterpDQ fold
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z(.\{-}\)"+ end=+^\z1$+ contains=@perlInterpDQ fold
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z(.\{-}\)'+ end=+^\z1$+ contains=@perlInterpSQ fold
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold
+ syn region perlAutoload matchgroup=perlStringStartEnd start=+<<['"]\z(END_\(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)['"]+ end=+^\z1$+ contains=ALL fold
+ else
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+^\z1$+ contains=@perlInterpDQ
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z(.\{-}\)"+ end=+^\z1$+ contains=@perlInterpDQ
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z(.\{-}\)'+ end=+^\z1$+ contains=@perlInterpSQ
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
+ syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
+ syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\(['"]\|\)\z(END_\(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
+ endif
+else
+ syn match perlUntilEOFStart "<<EOF.*"lc=5 nextgroup=perlUntilEOFDQ skipnl transparent
+ syn match perlUntilEOFStart "<<\s*\"EOF\".*" nextgroup=perlUntilEOFDQ skipnl transparent
+ syn match perlUntilEOFStart "<<\s*'EOF'.*" nextgroup=perlUntilEOFSQ skipnl transparent
+ syn match perlUntilEOFStart "<<\s*\"\".*" nextgroup=perlUntilEmptyDQ skipnl transparent
+ syn match perlUntilEOFStart "<<\s*''.*" nextgroup=perlUntilEmptySQ skipnl transparent
+ syn region perlUntilEOFDQ matchgroup=perlStringStartEnd start=++ end="^EOF$" contains=@perlInterpDQ contained
+ syn region perlUntilEOFSQ matchgroup=perlStringStartEnd start=++ end="^EOF$" contains=@perlInterpSQ contained
+ syn region perlUntilEmptySQ matchgroup=perlStringStartEnd start=++ end="^$" contains=@perlInterpDQ,perlNotEmptyLine contained
+ syn region perlUntilEmptyDQ matchgroup=perlStringStartEnd start=++ end="^$" contains=@perlInterpSQ,perlNotEmptyLine contained
+ syn match perlHereIdentifier "<<EOF"
+ syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\(['"]\|\)\(END_\(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\(END_\(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)$+ contains=ALL
+endif
+
+
+" Class declarations
+"
+syn match perlPackageDecl "^\s*\<package\s\+\S\+" contains=perlStatementPackage
+syn keyword perlStatementPackage package contained
+
+" Functions
+" sub [name] [(prototype)] {
+"
+syn region perlFunction start="\s*\<sub\>" end="[;{]"he=e-1 contains=perlStatementSub,perlFunctionPrototype,perlFunctionPRef,perlFunctionName,perlComment
+syn keyword perlStatementSub sub contained
+
+syn match perlFunctionPrototype "([^)]*)" contained
+if exists("perl_want_scope_in_variables")
+ syn match perlFunctionPRef "\h\w*::" contained
+ syn match perlFunctionName "\h\w*[^:]" contained
+else
+ syn match perlFunctionName "\h[[:alnum:]_:]*" contained
+endif
+
+
+" All other # are comments, except ^#!
+syn match perlComment "#.*" contains=perlTodo
+syn match perlSharpBang "^#!.*"
+
+" Formats
+syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain
+syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained
+syn match perlFormatField "[@^][|<>~]\+\(\.\.\.\)\=" contained
+syn match perlFormatField "[@^]#[#.]*" contained
+syn match perlFormatField "@\*" contained
+syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained
+syn match perlFormatField "@$" contained
+
+" __END__ and __DATA__ clauses
+if exists("perl_fold")
+ syntax region perlDATA start="^__\(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA fold
+else
+ syntax region perlDATA start="^__\(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA
+endif
+
+
+"
+" Folding
+
+if exists("perl_fold")
+ syn region perlPackageFold start="^package \S\+;$" end="^1;$" end="\n\+package"me=s-1 transparent fold keepend
+ syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*$" end="^\z1}\s*\#.*$" transparent fold keepend
+ syn region perlBEGINENDFold start="^\z(\s*\)\<\(BEGIN\|END\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
+
+ if exists("perl_fold_blocks")
+ syn region perlIfFold start="^\z(\s*\)\(if\|unless\|for\|while\|until\)\s*(.*)\s*{\s*$" start="^\z(\s*\)foreach\s*\(\(my\|our\)\=\s*\S\+\s*\)\=(.*)\s*{\s*$" end="^\z1}\s*;\=$" transparent fold keepend
+ syn region perlIfFold start="^\z(\s*\)do\s*{\s*$" end="^\z1}\s*while" end="^\z1}\s*;\=$" transparent fold keepend
+ endif
+
+ setlocal foldmethod=syntax
+ syn sync fromstart
+else
+ " fromstart above seems to set minlines even if perl_fold is not set.
+ syn sync minlines=0
+endif
+
+
+if version >= 508 || !exists("did_perl_syn_inits")
+ if version < 508
+ let did_perl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink perlSharpBang PreProc
+ HiLink perlControl PreProc
+ HiLink perlInclude Include
+ HiLink perlSpecial Special
+ HiLink perlString String
+ HiLink perlCharacter Character
+ HiLink perlNumber Number
+ HiLink perlFloat Float
+ HiLink perlType Type
+ HiLink perlIdentifier Identifier
+ HiLink perlLabel Label
+ HiLink perlStatement Statement
+ HiLink perlConditional Conditional
+ HiLink perlRepeat Repeat
+ HiLink perlOperator Operator
+ HiLink perlFunction Function
+ HiLink perlFunctionPrototype perlFunction
+ HiLink perlComment Comment
+ HiLink perlTodo Todo
+ if exists("perl_string_as_statement")
+ HiLink perlStringStartEnd perlStatement
+ else
+ HiLink perlStringStartEnd perlString
+ endif
+ HiLink perlList perlStatement
+ HiLink perlMisc perlStatement
+ HiLink perlVarPlain perlIdentifier
+ HiLink perlFiledescRead perlIdentifier
+ HiLink perlFiledescStatement perlIdentifier
+ HiLink perlVarSimpleMember perlIdentifier
+ HiLink perlVarSimpleMemberName perlString
+ HiLink perlVarNotInMatches perlIdentifier
+ HiLink perlVarSlash perlIdentifier
+ HiLink perlQQ perlString
+ if version >= 600
+ HiLink perlHereDoc perlString
+ else
+ HiLink perlHereIdentifier perlStringStartEnd
+ HiLink perlUntilEOFDQ perlString
+ HiLink perlUntilEOFSQ perlString
+ HiLink perlUntilEmptyDQ perlString
+ HiLink perlUntilEmptySQ perlString
+ HiLink perlUntilEOF perlString
+ endif
+ HiLink perlStringUnexpanded perlString
+ HiLink perlSubstitutionSQ perlString
+ HiLink perlSubstitutionDQ perlString
+ HiLink perlSubstitutionSlash perlString
+ HiLink perlSubstitutionHash perlString
+ HiLink perlSubstitutionBracket perlString
+ HiLink perlSubstitutionCurly perlString
+ HiLink perlSubstitutionPling perlString
+ HiLink perlTranslationSlash perlString
+ HiLink perlTranslationHash perlString
+ HiLink perlTranslationBracket perlString
+ HiLink perlTranslationCurly perlString
+ HiLink perlMatch perlString
+ HiLink perlMatchStartEnd perlStatement
+ HiLink perlFormatName perlIdentifier
+ HiLink perlFormatField perlString
+ HiLink perlPackageDecl perlType
+ HiLink perlStorageClass perlType
+ HiLink perlPackageRef perlType
+ HiLink perlStatementPackage perlStatement
+ HiLink perlStatementSub perlStatement
+ HiLink perlStatementStorage perlStatement
+ HiLink perlStatementControl perlStatement
+ HiLink perlStatementScalar perlStatement
+ HiLink perlStatementRegexp perlStatement
+ HiLink perlStatementNumeric perlStatement
+ HiLink perlStatementList perlStatement
+ HiLink perlStatementHash perlStatement
+ HiLink perlStatementIOfunc perlStatement
+ HiLink perlStatementFiledesc perlStatement
+ HiLink perlStatementVector perlStatement
+ HiLink perlStatementFiles perlStatement
+ HiLink perlStatementFlow perlStatement
+ HiLink perlStatementScope perlStatement
+ HiLink perlStatementInclude perlStatement
+ HiLink perlStatementProc perlStatement
+ HiLink perlStatementSocket perlStatement
+ HiLink perlStatementIPC perlStatement
+ HiLink perlStatementNetwork perlStatement
+ HiLink perlStatementPword perlStatement
+ HiLink perlStatementTime perlStatement
+ HiLink perlStatementMisc perlStatement
+ HiLink perlStatementNew perlStatement
+ HiLink perlFunctionName perlIdentifier
+ HiLink perlMethod perlIdentifier
+ HiLink perlFunctionPRef perlType
+ HiLink perlPOD perlComment
+ HiLink perlShellCommand perlString
+ HiLink perlSpecialAscii perlSpecial
+ HiLink perlSpecialDollar perlSpecial
+ HiLink perlSpecialString perlSpecial
+ HiLink perlSpecialStringU perlSpecial
+ HiLink perlSpecialMatch perlSpecial
+ HiLink perlSpecialBEOM perlSpecial
+ HiLink perlDATA perlComment
+
+ HiLink perlBrackets Error
+
+ " Possible errors
+ HiLink perlNotEmptyLine Error
+ HiLink perlElseIfError Error
+
+ delcommand HiLink
+endif
+
+" Syncing to speed up processing
+"
+if !exists("perl_no_sync_on_sub")
+ syn sync match perlSync grouphere NONE "^\s*\<package\s"
+ syn sync match perlSync grouphere perlFunction "^\s*\<sub\s"
+ syn sync match perlSync grouphere NONE "^}"
+endif
+
+if !exists("perl_no_sync_on_global_var")
+ syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{"
+ syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*("
+endif
+
+if exists("perl_sync_dist")
+ execute "syn sync maxlines=" . perl_sync_dist
+else
+ syn sync maxlines=100
+endif
+
+syn sync match perlSyncPOD grouphere perlPOD "^=pod"
+syn sync match perlSyncPOD grouphere perlPOD "^=head"
+syn sync match perlSyncPOD grouphere perlPOD "^=item"
+syn sync match perlSyncPOD grouphere NONE "^=cut"
+
+let b:current_syntax = "perl"
+
+" vim: ts=8
diff --git a/runtime/syntax/pf.vim b/runtime/syntax/pf.vim
new file mode 100644
index 000000000..394cfb3e4
--- /dev/null
+++ b/runtime/syntax/pf.vim
@@ -0,0 +1,75 @@
+" pf syntax file
+" Language: OpenBSD packet filter configuration (pf.conf)
+" Maintainer: Camiel Dobbelaar <cd@sentia.nl>
+" Last Change: 2003 May 27
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+setlocal foldmethod=syntax
+syn sync fromstart
+
+syn cluster pfNotLS contains=pfComment,pfTodo,pfVarAssign
+syn keyword pfCmd altq anchor antispoof binat nat pass
+syn keyword pfCmd queue rdr scrub table set
+syn keyword pfService auth bgp domain finger ftp http https ident
+syn keyword pfService imap irc isakmp kerberos mail nameserver nfs
+syn keyword pfService nntp ntp pop3 portmap pptp rpcbind rsync smtp
+syn keyword pfService snmp snmptrap socks ssh sunrpc syslog telnet
+syn keyword pfService tftp www
+syn keyword pfTodo TODO XXX contained
+syn keyword pfWildAddr all any
+syn match pfCmd /block\s/
+syn match pfComment /#.*$/ contains=pfTodo
+syn match pfCont /\\$/
+syn match pfErrClose /}/
+syn match pfIPv4 /\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}/
+syn match pfIPv6 /[a-fA-F0-9:]*::[a-fA-F0-9:.]*/
+syn match pfIPv6 /[a-fA-F0-9:]\+:[a-fA-F0-9:]\+:[a-fA-F0-9:.]\+/
+syn match pfNetmask /\/\d\+/
+syn match pfNum /[a-zA-Z0-9_:.]\@<!\d\+[a-zA-Z0-9_:.]\@!/
+syn match pfTable /<\s*[a-zA-Z][a-zA-Z0-9_]*\s*>/
+syn match pfVar /$[a-zA-Z][a-zA-Z0-9_]*/
+syn match pfVarAssign /^\s*[a-zA-Z][a-zA-Z0-9_]*\s*=/me=e-1
+syn region pfFold1 start=/^#\{1}>/ end=/^#\{1,3}>/me=s-1 transparent fold
+syn region pfFold2 start=/^#\{2}>/ end=/^#\{2,3}>/me=s-1 transparent fold
+syn region pfFold3 start=/^#\{3}>/ end=/^#\{3}>/me=s-1 transparent fold
+syn region pfList start=/{/ end=/}/ transparent contains=ALLBUT,pfErrClose,@pfNotLS
+syn region pfString start=/"/ end=/"/ transparent contains=ALLBUT,pfString,@pfNotLS
+syn region pfString start=/'/ end=/'/ transparent contains=ALLBUT,pfString,@pfNotLS
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_c_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pfCmd Statement
+ HiLink pfComment Comment
+ HiLink pfCont Statement
+ HiLink pfErrClose Error
+ HiLink pfIPv4 Type
+ HiLink pfIPv6 Type
+ HiLink pfNetmask Constant
+ HiLink pfNum Constant
+ HiLink pfService Constant
+ HiLink pfTable Identifier
+ HiLink pfTodo Todo
+ HiLink pfVar Identifier
+ HiLink pfVarAssign Identifier
+ HiLink pfWildAddr Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pf"
diff --git a/runtime/syntax/pfmain.vim b/runtime/syntax/pfmain.vim
new file mode 100644
index 000000000..0c36d7f33
--- /dev/null
+++ b/runtime/syntax/pfmain.vim
@@ -0,0 +1,858 @@
+" Vim syntax file
+" Language: Postfix main.cf configuration
+" Maintainer: KELEMEN Peter <Peter dot Kelemen at cern dot ch>
+" Last Change: 2004 Jun 01
+" Version: 0.12
+" URL: http://cern.ch/fuji/vim/syntax/pfmain.vim
+" Comment: Based on Postfix 2.1.1 defaults. (+TLS)
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,-
+else
+ set iskeyword=@,48-57,_,-
+endif
+
+syntax case match
+syntax sync minlines=1
+
+syntax keyword pfmainConf 2bounce_notice_recipient
+syntax keyword pfmainConf access_map_reject_code
+syntax keyword pfmainConf address_verify_default_transport
+syntax keyword pfmainConf address_verify_local_transport
+syntax keyword pfmainConf address_verify_map
+syntax keyword pfmainConf address_verify_negative_cache
+syntax keyword pfmainConf address_verify_negative_expire_time
+syntax keyword pfmainConf address_verify_negative_refresh_time
+syntax keyword pfmainConf address_verify_poll_count
+syntax keyword pfmainConf address_verify_poll_delay
+syntax keyword pfmainConf address_verify_positive_expire_time
+syntax keyword pfmainConf address_verify_positive_refresh_time
+syntax keyword pfmainConf address_verify_relay_transport
+syntax keyword pfmainConf address_verify_relayhost
+syntax keyword pfmainConf address_verify_sender
+syntax keyword pfmainConf address_verify_service_name
+syntax keyword pfmainConf address_verify_transport_maps
+syntax keyword pfmainConf address_verify_virtual_transport
+syntax keyword pfmainConf alias_database
+syntax keyword pfmainConf alias_maps
+syntax keyword pfmainConf allow_mail_to_commands
+syntax keyword pfmainConf allow_mail_to_files
+syntax keyword pfmainConf allow_min_user
+syntax keyword pfmainConf allow_percent_hack
+syntax keyword pfmainConf allow_untrusted_routing
+syntax keyword pfmainConf alternate_config_directories
+syntax keyword pfmainConf always_bcc
+syntax keyword pfmainConf append_at_myorigin
+syntax keyword pfmainConf append_dot_mydomain
+syntax keyword pfmainConf application_event_drain_time
+syntax keyword pfmainConf backwards_bounce_logfile_compatibility
+syntax keyword pfmainConf berkeley_db_create_buffer_size
+syntax keyword pfmainConf berkeley_db_read_buffer_size
+syntax keyword pfmainConf best_mx_transport
+syntax keyword pfmainConf biff
+syntax keyword pfmainConf body_checks
+syntax keyword pfmainConf body_checks_size_limit
+syntax keyword pfmainConf bounce_notice_recipient
+syntax keyword pfmainConf bounce_queue_lifetime
+syntax keyword pfmainConf bounce_service_name
+syntax keyword pfmainConf bounce_size_limit
+syntax keyword pfmainConf broken_sasl_auth_clients
+syntax keyword pfmainConf canonical_maps
+syntax keyword pfmainConf cleanup_service_name
+syntax keyword pfmainConf command_directory
+syntax keyword pfmainConf command_expansion_filter
+syntax keyword pfmainConf command_time_limit
+syntax keyword pfmainConf config_directory
+syntax keyword pfmainConf content_filter
+syntax keyword pfmainConf daemon_directory
+syntax keyword pfmainConf daemon_timeout
+syntax keyword pfmainConf debug_peer_level
+syntax keyword pfmainConf debug_peer_list
+syntax keyword pfmainConf default_database_type
+syntax keyword pfmainConf default_delivery_slot_cost
+syntax keyword pfmainConf default_delivery_slot_discount
+syntax keyword pfmainConf default_delivery_slot_loan
+syntax keyword pfmainConf default_destination_concurrency_limit
+syntax keyword pfmainConf default_destination_recipient_limit
+syntax keyword pfmainConf default_extra_recipient_limit
+syntax keyword pfmainConf default_minimum_delivery_slots
+syntax keyword pfmainConf default_privs
+syntax keyword pfmainConf default_process_limit
+syntax keyword pfmainConf default_rbl_reply
+syntax keyword pfmainConf default_recipient_limit
+syntax keyword pfmainConf default_transport
+syntax keyword pfmainConf default_verp_delimiters
+syntax keyword pfmainConf defer_code
+syntax keyword pfmainConf defer_service_name
+syntax keyword pfmainConf defer_transports
+syntax keyword pfmainConf delay_notice_recipient
+syntax keyword pfmainConf delay_warning_time
+syntax keyword pfmainConf deliver_lock_attempts
+syntax keyword pfmainConf deliver_lock_delay
+syntax keyword pfmainConf disable_dns_lookups
+syntax keyword pfmainConf disable_mime_input_processing
+syntax keyword pfmainConf disable_mime_output_conversion
+syntax keyword pfmainConf disable_verp_bounces
+syntax keyword pfmainConf disable_vrfy_command
+syntax keyword pfmainConf dont_remove
+syntax keyword pfmainConf double_bounce_sender
+syntax keyword pfmainConf duplicate_filter_limit
+syntax keyword pfmainConf empty_address_recipient
+syntax keyword pfmainConf enable_errors_to
+syntax keyword pfmainConf enable_original_recipient
+syntax keyword pfmainConf error_notice_recipient
+syntax keyword pfmainConf error_service_name
+syntax keyword pfmainConf expand_owner_alias
+syntax keyword pfmainConf export_environment
+syntax keyword pfmainConf fallback_relay
+syntax keyword pfmainConf fallback_transport
+syntax keyword pfmainConf fast_flush_domains
+syntax keyword pfmainConf fast_flush_purge_time
+syntax keyword pfmainConf fast_flush_refresh_time
+syntax keyword pfmainConf fault_injection_code
+syntax keyword pfmainConf flush_service_name
+syntax keyword pfmainConf fork_attempts
+syntax keyword pfmainConf fork_delay
+syntax keyword pfmainConf forward_expansion_filter
+syntax keyword pfmainConf forward_path
+syntax keyword pfmainConf hash_queue_depth
+syntax keyword pfmainConf hash_queue_names
+syntax keyword pfmainConf header_address_token_limit
+syntax keyword pfmainConf header_checks
+syntax keyword pfmainConf header_size_limit
+syntax keyword pfmainConf helpful_warnings
+syntax keyword pfmainConf home_mailbox
+syntax keyword pfmainConf hopcount_limit
+syntax keyword pfmainConf html_directory
+syntax keyword pfmainConf ignore_mx_lookup_error
+syntax keyword pfmainConf import_environment
+syntax keyword pfmainConf in_flow_delay
+syntax keyword pfmainConf inet_interfaces
+syntax keyword pfmainConf initial_destination_concurrency
+syntax keyword pfmainConf invalid_hostname_reject_code
+syntax keyword pfmainConf ipc_idle
+syntax keyword pfmainConf ipc_timeout
+syntax keyword pfmainConf ipc_ttl
+syntax keyword pfmainConf line_length_limit
+syntax keyword pfmainConf lmtp_cache_connection
+syntax keyword pfmainConf lmtp_connect_timeout
+syntax keyword pfmainConf lmtp_data_done_timeout
+syntax keyword pfmainConf lmtp_data_init_timeout
+syntax keyword pfmainConf lmtp_data_xfer_timeout
+syntax keyword pfmainConf lmtp_destination_concurrency_limit
+syntax keyword pfmainConf lmtp_destination_recipient_limit
+syntax keyword pfmainConf lmtp_lhlo_timeout
+syntax keyword pfmainConf lmtp_mail_timeout
+syntax keyword pfmainConf lmtp_quit_timeout
+syntax keyword pfmainConf lmtp_rcpt_timeout
+syntax keyword pfmainConf lmtp_rset_timeout
+syntax keyword pfmainConf lmtp_sasl_auth_enable
+syntax keyword pfmainConf lmtp_sasl_password_maps
+syntax keyword pfmainConf lmtp_sasl_security_options
+syntax keyword pfmainConf lmtp_send_xforward_command
+syntax keyword pfmainConf lmtp_skip_quit_response
+syntax keyword pfmainConf lmtp_tcp_port
+syntax keyword pfmainConf lmtp_xforward_timeout
+syntax keyword pfmainConf local_command_shell
+syntax keyword pfmainConf local_destination_concurrency_limit
+syntax keyword pfmainConf local_destination_recipient_limit
+syntax keyword pfmainConf local_recipient_maps
+syntax keyword pfmainConf local_transport
+syntax keyword pfmainConf luser_relay
+syntax keyword pfmainConf mail_name
+syntax keyword pfmainConf mail_owner
+syntax keyword pfmainConf mail_release_date
+syntax keyword pfmainConf mail_spool_directory
+syntax keyword pfmainConf mail_version
+syntax keyword pfmainConf mailbox_command
+syntax keyword pfmainConf mailbox_command_maps
+syntax keyword pfmainConf mailbox_delivery_lock
+syntax keyword pfmainConf mailbox_size_limit
+syntax keyword pfmainConf mailbox_transport
+syntax keyword pfmainConf mailq_path
+syntax keyword pfmainConf manpage_directory
+syntax keyword pfmainConf maps_rbl_domains
+syntax keyword pfmainConf maps_rbl_reject_code
+syntax keyword pfmainConf masquerade_classes
+syntax keyword pfmainConf masquerade_domains
+syntax keyword pfmainConf masquerade_exceptions
+syntax keyword pfmainConf max_idle
+syntax keyword pfmainConf max_use
+syntax keyword pfmainConf maximal_backoff_time
+syntax keyword pfmainConf maximal_queue_lifetime
+syntax keyword pfmainConf message_size_limit
+syntax keyword pfmainConf mime_boundary_length_limit
+syntax keyword pfmainConf mime_header_checks
+syntax keyword pfmainConf mime_nesting_limit
+syntax keyword pfmainConf minimal_backoff_time
+syntax keyword pfmainConf multi_recipient_bounce_reject_code
+syntax keyword pfmainConf mydestination
+syntax keyword pfmainConf mydomain
+syntax keyword pfmainConf myhostname
+syntax keyword pfmainConf mynetworks
+syntax keyword pfmainConf mynetworks_style
+syntax keyword pfmainConf myorigin
+syntax keyword pfmainConf nested_header_checks
+syntax keyword pfmainConf newaliases_path
+syntax keyword pfmainConf non_fqdn_reject_code
+syntax keyword pfmainConf notify_classes
+syntax keyword pfmainConf owner_request_special
+syntax keyword pfmainConf parent_domain_matches_subdomains
+syntax keyword pfmainConf permit_mx_backup_networks
+syntax keyword pfmainConf pickup_service_name
+syntax keyword pfmainConf prepend_delivered_header
+syntax keyword pfmainConf process_id_directory
+syntax keyword pfmainConf propagate_unmatched_extensions
+syntax keyword pfmainConf proxy_interfaces
+syntax keyword pfmainConf proxy_read_maps
+syntax keyword pfmainConf qmgr_clog_warn_time
+syntax keyword pfmainConf qmgr_fudge_factor
+syntax keyword pfmainConf qmgr_message_active_limit
+syntax keyword pfmainConf qmgr_message_recipient_limit
+syntax keyword pfmainConf qmgr_message_recipient_minimum
+syntax keyword pfmainConf qmqpd_authorized_clients
+syntax keyword pfmainConf qmqpd_error_delay
+syntax keyword pfmainConf qmqpd_timeout
+syntax keyword pfmainConf queue_directory
+syntax keyword pfmainConf queue_file_attribute_count_limit
+syntax keyword pfmainConf queue_minfree
+syntax keyword pfmainConf queue_run_delay
+syntax keyword pfmainConf queue_service_name
+syntax keyword pfmainConf rbl_reply_maps
+syntax keyword pfmainConf readme_directory
+syntax keyword pfmainConf receive_override_options
+syntax keyword pfmainConf recipient_bcc_maps
+syntax keyword pfmainConf recipient_canonical_maps
+syntax keyword pfmainConf recipient_delimiter
+syntax keyword pfmainConf reject_code
+syntax keyword pfmainConf relay_clientcerts
+syntax keyword pfmainConf relay_destination_concurrency_limit
+syntax keyword pfmainConf relay_destination_recipient_limit
+syntax keyword pfmainConf relay_domains
+syntax keyword pfmainConf relay_domains_reject_code
+syntax keyword pfmainConf relay_recipient_maps
+syntax keyword pfmainConf relay_transport
+syntax keyword pfmainConf relayhost
+syntax keyword pfmainConf relocated_maps
+syntax keyword pfmainConf require_home_directory
+syntax keyword pfmainConf resolve_dequoted_address
+syntax keyword pfmainConf resolve_null_domain
+syntax keyword pfmainConf rewrite_service_name
+syntax keyword pfmainConf sample_directory
+syntax keyword pfmainConf sender_based_routing
+syntax keyword pfmainConf sender_bcc_maps
+syntax keyword pfmainConf sender_canonical_maps
+syntax keyword pfmainConf sendmail_path
+syntax keyword pfmainConf service_throttle_time
+syntax keyword pfmainConf setgid_group
+syntax keyword pfmainConf show_user_unknown_table_name
+syntax keyword pfmainConf showq_service_name
+syntax keyword pfmainConf smtp_always_send_ehlo
+syntax keyword pfmainConf smtp_bind_address
+syntax keyword pfmainConf smtp_connect_timeout
+syntax keyword pfmainConf smtp_data_done_timeout
+syntax keyword pfmainConf smtp_data_init_timeout
+syntax keyword pfmainConf smtp_data_xfer_timeout
+syntax keyword pfmainConf smtp_defer_if_no_mx_address_found
+syntax keyword pfmainConf smtp_destination_concurrency_limit
+syntax keyword pfmainConf smtp_destination_recipient_limit
+syntax keyword pfmainConf smtp_enforce_tls
+syntax keyword pfmainConf smtp_helo_name
+syntax keyword pfmainConf smtp_helo_timeout
+syntax keyword pfmainConf smtp_host_lookup
+syntax keyword pfmainConf smtp_line_length_limit
+syntax keyword pfmainConf smtp_mail_timeout
+syntax keyword pfmainConf smtp_mx_address_limit
+syntax keyword pfmainConf smtp_mx_session_limit
+syntax keyword pfmainConf smtp_never_send_ehlo
+syntax keyword pfmainConf smtp_pix_workaround_delay_time
+syntax keyword pfmainConf smtp_pix_workaround_threshold_time
+syntax keyword pfmainConf smtp_quit_timeout
+syntax keyword pfmainConf smtp_quote_rfc821_envelope
+syntax keyword pfmainConf smtp_randomize_addresses
+syntax keyword pfmainConf smtp_rcpt_timeout
+syntax keyword pfmainConf smtp_rset_timeout
+syntax keyword pfmainConf smtp_sasl_auth_enable
+syntax keyword pfmainConf smtp_sasl_password_maps
+syntax keyword pfmainConf smtp_sasl_security_options
+syntax keyword pfmainConf smtp_sasl_tls_security_options
+syntax keyword pfmainConf smtp_sasl_tls_verified_security_options
+syntax keyword pfmainConf smtp_send_xforward_command
+syntax keyword pfmainConf smtp_skip_5xx_greeting
+syntax keyword pfmainConf smtp_skip_quit_response
+syntax keyword pfmainConf smtp_starttls_timeout
+syntax keyword pfmainConf smtp_tls_CAfile
+syntax keyword pfmainConf smtp_tls_CApath
+syntax keyword pfmainConf smtp_tls_cert_file
+syntax keyword pfmainConf smtp_tls_cipherlist
+syntax keyword pfmainConf smtp_tls_dcert_file
+syntax keyword pfmainConf smtp_tls_dkey_file
+syntax keyword pfmainConf smtp_tls_enforce_peername
+syntax keyword pfmainConf smtp_tls_key_file
+syntax keyword pfmainConf smtp_tls_loglevel
+syntax keyword pfmainConf smtp_tls_note_starttls_offer
+syntax keyword pfmainConf smtp_tls_per_site
+syntax keyword pfmainConf smtp_tls_scert_verifydepth
+syntax keyword pfmainConf smtp_tls_session_cache_database
+syntax keyword pfmainConf smtp_tls_session_cache_timeout
+syntax keyword pfmainConf smtp_use_tls
+syntax keyword pfmainConf smtp_xforward_timeout
+syntax keyword pfmainConf smtpd_authorized_verp_clients
+syntax keyword pfmainConf smtpd_authorized_xclient_hosts
+syntax keyword pfmainConf smtpd_authorized_xforward_hosts
+syntax keyword pfmainConf smtpd_banner
+syntax keyword pfmainConf smtpd_client_connection_count_limit
+syntax keyword pfmainConf smtpd_client_connection_limit_exceptions
+syntax keyword pfmainConf smtpd_client_connection_rate_limit
+syntax keyword pfmainConf smtpd_client_restrictions
+syntax keyword pfmainConf smtpd_data_restrictions
+syntax keyword pfmainConf smtpd_delay_reject
+syntax keyword pfmainConf smtpd_enforce_tls
+syntax keyword pfmainConf smtpd_error_sleep_time
+syntax keyword pfmainConf smtpd_etrn_restrictions
+syntax keyword pfmainConf smtpd_expansion_filter
+syntax keyword pfmainConf smtpd_hard_error_limit
+syntax keyword pfmainConf smtpd_helo_required
+syntax keyword pfmainConf smtpd_helo_restrictions
+syntax keyword pfmainConf smtpd_history_flush_threshold
+syntax keyword pfmainConf smtpd_junk_command_limit
+syntax keyword pfmainConf smtpd_noop_commands
+syntax keyword pfmainConf smtpd_null_access_lookup_key
+syntax keyword pfmainConf smtpd_policy_service_max_idle
+syntax keyword pfmainConf smtpd_policy_service_max_ttl
+syntax keyword pfmainConf smtpd_policy_service_timeout
+syntax keyword pfmainConf smtpd_proxy_ehlo
+syntax keyword pfmainConf smtpd_proxy_filter
+syntax keyword pfmainConf smtpd_proxy_timeout
+syntax keyword pfmainConf smtpd_recipient_limit
+syntax keyword pfmainConf smtpd_recipient_overshoot_limit
+syntax keyword pfmainConf smtpd_recipient_restrictions
+syntax keyword pfmainConf smtpd_reject_unlisted_recipient
+syntax keyword pfmainConf smtpd_reject_unlisted_sender
+syntax keyword pfmainConf smtpd_restriction_classes
+syntax keyword pfmainConf smtpd_sasl_application_name
+syntax keyword pfmainConf smtpd_sasl_auth_enable
+syntax keyword pfmainConf smtpd_sasl_exceptions_networks
+syntax keyword pfmainConf smtpd_sasl_local_domain
+syntax keyword pfmainConf smtpd_sasl_security_options
+syntax keyword pfmainConf smtpd_sasl_tls_security_options
+syntax keyword pfmainConf smtpd_sender_login_maps
+syntax keyword pfmainConf smtpd_sender_restrictions
+syntax keyword pfmainConf smtpd_soft_error_limit
+syntax keyword pfmainConf smtpd_starttls_timeout
+syntax keyword pfmainConf smtpd_timeout
+syntax keyword pfmainConf smtpd_tls_CAfile
+syntax keyword pfmainConf smtpd_tls_CApath
+syntax keyword pfmainConf smtpd_tls_ask_ccert
+syntax keyword pfmainConf smtpd_tls_auth_only
+syntax keyword pfmainConf smtpd_tls_ccert_verifydepth
+syntax keyword pfmainConf smtpd_tls_cert_file
+syntax keyword pfmainConf smtpd_tls_cipherlist
+syntax keyword pfmainConf smtpd_tls_dcert_file
+syntax keyword pfmainConf smtpd_tls_dh1024_param_file
+syntax keyword pfmainConf smtpd_tls_dh512_param_file
+syntax keyword pfmainConf smtpd_tls_dkey_file
+syntax keyword pfmainConf smtpd_tls_key_file
+syntax keyword pfmainConf smtpd_tls_loglevel
+syntax keyword pfmainConf smtpd_tls_received_header
+syntax keyword pfmainConf smtpd_tls_req_ccert
+syntax keyword pfmainConf smtpd_tls_session_cache_database
+syntax keyword pfmainConf smtpd_tls_session_cache_timeout
+syntax keyword pfmainConf smtpd_tls_wrappermode
+syntax keyword pfmainConf smtpd_use_tls
+syntax keyword pfmainConf soft_bounce
+syntax keyword pfmainConf stale_lock_time
+syntax keyword pfmainConf strict_7bit_headers
+syntax keyword pfmainConf strict_8bitmime
+syntax keyword pfmainConf strict_8bitmime_body
+syntax keyword pfmainConf strict_mime_encoding_domain
+syntax keyword pfmainConf strict_rfc821_envelopes
+syntax keyword pfmainConf sun_mailtool_compatibility
+syntax keyword pfmainConf swap_bangpath
+syntax keyword pfmainConf syslog_facility
+syntax keyword pfmainConf syslog_name
+syntax keyword pfmainConf tls_daemon_random_bytes
+syntax keyword pfmainConf tls_daemon_random_source
+syntax keyword pfmainConf tls_random_bytes
+syntax keyword pfmainConf tls_random_exchange_name
+syntax keyword pfmainConf tls_random_prng_update_period
+syntax keyword pfmainConf tls_random_reseed_period
+syntax keyword pfmainConf tls_random_source
+syntax keyword pfmainConf trace_service_name
+syntax keyword pfmainConf transport_maps
+syntax keyword pfmainConf transport_retry_time
+syntax keyword pfmainConf trigger_timeout
+syntax keyword pfmainConf undisclosed_recipients_header
+syntax keyword pfmainConf unknown_address_reject_code
+syntax keyword pfmainConf unknown_client_reject_code
+syntax keyword pfmainConf unknown_hostname_reject_code
+syntax keyword pfmainConf unknown_local_recipient_reject_code
+syntax keyword pfmainConf unknown_relay_recipient_reject_code
+syntax keyword pfmainConf unknown_virtual_alias_reject_code
+syntax keyword pfmainConf unknown_virtual_mailbox_reject_code
+syntax keyword pfmainConf unverified_recipient_reject_code
+syntax keyword pfmainConf unverified_sender_reject_code
+syntax keyword pfmainConf verp_delimiter_filter
+syntax keyword pfmainConf virtual_alias_domains
+syntax keyword pfmainConf virtual_alias_expansion_limit
+syntax keyword pfmainConf virtual_alias_maps
+syntax keyword pfmainConf virtual_alias_recursion_limit
+syntax keyword pfmainConf virtual_destination_concurrency_limit
+syntax keyword pfmainConf virtual_destination_recipient_limit
+syntax keyword pfmainConf virtual_gid_maps
+syntax keyword pfmainConf virtual_mailbox_base
+syntax keyword pfmainConf virtual_mailbox_domains
+syntax keyword pfmainConf virtual_mailbox_limit
+syntax keyword pfmainConf virtual_mailbox_lock
+syntax keyword pfmainConf virtual_mailbox_maps
+syntax keyword pfmainConf virtual_minimum_uid
+syntax keyword pfmainConf virtual_transport
+syntax keyword pfmainConf virtual_uid_maps
+syntax match pfmainRef "$\<2bounce_notice_recipient\>"
+syntax match pfmainRef "$\<access_map_reject_code\>"
+syntax match pfmainRef "$\<address_verify_default_transport\>"
+syntax match pfmainRef "$\<address_verify_local_transport\>"
+syntax match pfmainRef "$\<address_verify_map\>"
+syntax match pfmainRef "$\<address_verify_negative_cache\>"
+syntax match pfmainRef "$\<address_verify_negative_expire_time\>"
+syntax match pfmainRef "$\<address_verify_negative_refresh_time\>"
+syntax match pfmainRef "$\<address_verify_poll_count\>"
+syntax match pfmainRef "$\<address_verify_poll_delay\>"
+syntax match pfmainRef "$\<address_verify_positive_expire_time\>"
+syntax match pfmainRef "$\<address_verify_positive_refresh_time\>"
+syntax match pfmainRef "$\<address_verify_relay_transport\>"
+syntax match pfmainRef "$\<address_verify_relayhost\>"
+syntax match pfmainRef "$\<address_verify_sender\>"
+syntax match pfmainRef "$\<address_verify_service_name\>"
+syntax match pfmainRef "$\<address_verify_transport_maps\>"
+syntax match pfmainRef "$\<address_verify_virtual_transport\>"
+syntax match pfmainRef "$\<alias_database\>"
+syntax match pfmainRef "$\<alias_maps\>"
+syntax match pfmainRef "$\<allow_mail_to_commands\>"
+syntax match pfmainRef "$\<allow_mail_to_files\>"
+syntax match pfmainRef "$\<allow_min_user\>"
+syntax match pfmainRef "$\<allow_percent_hack\>"
+syntax match pfmainRef "$\<allow_untrusted_routing\>"
+syntax match pfmainRef "$\<alternate_config_directories\>"
+syntax match pfmainRef "$\<always_bcc\>"
+syntax match pfmainRef "$\<append_at_myorigin\>"
+syntax match pfmainRef "$\<append_dot_mydomain\>"
+syntax match pfmainRef "$\<application_event_drain_time\>"
+syntax match pfmainRef "$\<backwards_bounce_logfile_compatibility\>"
+syntax match pfmainRef "$\<berkeley_db_create_buffer_size\>"
+syntax match pfmainRef "$\<berkeley_db_read_buffer_size\>"
+syntax match pfmainRef "$\<best_mx_transport\>"
+syntax match pfmainRef "$\<biff\>"
+syntax match pfmainRef "$\<body_checks\>"
+syntax match pfmainRef "$\<body_checks_size_limit\>"
+syntax match pfmainRef "$\<bounce_notice_recipient\>"
+syntax match pfmainRef "$\<bounce_queue_lifetime\>"
+syntax match pfmainRef "$\<bounce_service_name\>"
+syntax match pfmainRef "$\<bounce_size_limit\>"
+syntax match pfmainRef "$\<broken_sasl_auth_clients\>"
+syntax match pfmainRef "$\<canonical_maps\>"
+syntax match pfmainRef "$\<cleanup_service_name\>"
+syntax match pfmainRef "$\<command_directory\>"
+syntax match pfmainRef "$\<command_expansion_filter\>"
+syntax match pfmainRef "$\<command_time_limit\>"
+syntax match pfmainRef "$\<config_directory\>"
+syntax match pfmainRef "$\<content_filter\>"
+syntax match pfmainRef "$\<daemon_directory\>"
+syntax match pfmainRef "$\<daemon_timeout\>"
+syntax match pfmainRef "$\<debug_peer_level\>"
+syntax match pfmainRef "$\<debug_peer_list\>"
+syntax match pfmainRef "$\<default_database_type\>"
+syntax match pfmainRef "$\<default_delivery_slot_cost\>"
+syntax match pfmainRef "$\<default_delivery_slot_discount\>"
+syntax match pfmainRef "$\<default_delivery_slot_loan\>"
+syntax match pfmainRef "$\<default_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<default_destination_recipient_limit\>"
+syntax match pfmainRef "$\<default_extra_recipient_limit\>"
+syntax match pfmainRef "$\<default_minimum_delivery_slots\>"
+syntax match pfmainRef "$\<default_privs\>"
+syntax match pfmainRef "$\<default_process_limit\>"
+syntax match pfmainRef "$\<default_rbl_reply\>"
+syntax match pfmainRef "$\<default_recipient_limit\>"
+syntax match pfmainRef "$\<default_transport\>"
+syntax match pfmainRef "$\<default_verp_delimiters\>"
+syntax match pfmainRef "$\<defer_code\>"
+syntax match pfmainRef "$\<defer_service_name\>"
+syntax match pfmainRef "$\<defer_transports\>"
+syntax match pfmainRef "$\<delay_notice_recipient\>"
+syntax match pfmainRef "$\<delay_warning_time\>"
+syntax match pfmainRef "$\<deliver_lock_attempts\>"
+syntax match pfmainRef "$\<deliver_lock_delay\>"
+syntax match pfmainRef "$\<disable_dns_lookups\>"
+syntax match pfmainRef "$\<disable_mime_input_processing\>"
+syntax match pfmainRef "$\<disable_mime_output_conversion\>"
+syntax match pfmainRef "$\<disable_verp_bounces\>"
+syntax match pfmainRef "$\<disable_vrfy_command\>"
+syntax match pfmainRef "$\<dont_remove\>"
+syntax match pfmainRef "$\<double_bounce_sender\>"
+syntax match pfmainRef "$\<duplicate_filter_limit\>"
+syntax match pfmainRef "$\<empty_address_recipient\>"
+syntax match pfmainRef "$\<enable_errors_to\>"
+syntax match pfmainRef "$\<enable_original_recipient\>"
+syntax match pfmainRef "$\<error_notice_recipient\>"
+syntax match pfmainRef "$\<error_service_name\>"
+syntax match pfmainRef "$\<expand_owner_alias\>"
+syntax match pfmainRef "$\<export_environment\>"
+syntax match pfmainRef "$\<fallback_relay\>"
+syntax match pfmainRef "$\<fallback_transport\>"
+syntax match pfmainRef "$\<fast_flush_domains\>"
+syntax match pfmainRef "$\<fast_flush_purge_time\>"
+syntax match pfmainRef "$\<fast_flush_refresh_time\>"
+syntax match pfmainRef "$\<fault_injection_code\>"
+syntax match pfmainRef "$\<flush_service_name\>"
+syntax match pfmainRef "$\<fork_attempts\>"
+syntax match pfmainRef "$\<fork_delay\>"
+syntax match pfmainRef "$\<forward_expansion_filter\>"
+syntax match pfmainRef "$\<forward_path\>"
+syntax match pfmainRef "$\<hash_queue_depth\>"
+syntax match pfmainRef "$\<hash_queue_names\>"
+syntax match pfmainRef "$\<header_address_token_limit\>"
+syntax match pfmainRef "$\<header_checks\>"
+syntax match pfmainRef "$\<header_size_limit\>"
+syntax match pfmainRef "$\<helpful_warnings\>"
+syntax match pfmainRef "$\<home_mailbox\>"
+syntax match pfmainRef "$\<hopcount_limit\>"
+syntax match pfmainRef "$\<html_directory\>"
+syntax match pfmainRef "$\<ignore_mx_lookup_error\>"
+syntax match pfmainRef "$\<import_environment\>"
+syntax match pfmainRef "$\<in_flow_delay\>"
+syntax match pfmainRef "$\<inet_interfaces\>"
+syntax match pfmainRef "$\<initial_destination_concurrency\>"
+syntax match pfmainRef "$\<invalid_hostname_reject_code\>"
+syntax match pfmainRef "$\<ipc_idle\>"
+syntax match pfmainRef "$\<ipc_timeout\>"
+syntax match pfmainRef "$\<ipc_ttl\>"
+syntax match pfmainRef "$\<line_length_limit\>"
+syntax match pfmainRef "$\<lmtp_cache_connection\>"
+syntax match pfmainRef "$\<lmtp_connect_timeout\>"
+syntax match pfmainRef "$\<lmtp_data_done_timeout\>"
+syntax match pfmainRef "$\<lmtp_data_init_timeout\>"
+syntax match pfmainRef "$\<lmtp_data_xfer_timeout\>"
+syntax match pfmainRef "$\<lmtp_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<lmtp_destination_recipient_limit\>"
+syntax match pfmainRef "$\<lmtp_lhlo_timeout\>"
+syntax match pfmainRef "$\<lmtp_mail_timeout\>"
+syntax match pfmainRef "$\<lmtp_quit_timeout\>"
+syntax match pfmainRef "$\<lmtp_rcpt_timeout\>"
+syntax match pfmainRef "$\<lmtp_rset_timeout\>"
+syntax match pfmainRef "$\<lmtp_sasl_auth_enable\>"
+syntax match pfmainRef "$\<lmtp_sasl_password_maps\>"
+syntax match pfmainRef "$\<lmtp_sasl_security_options\>"
+syntax match pfmainRef "$\<lmtp_send_xforward_command\>"
+syntax match pfmainRef "$\<lmtp_skip_quit_response\>"
+syntax match pfmainRef "$\<lmtp_tcp_port\>"
+syntax match pfmainRef "$\<lmtp_xforward_timeout\>"
+syntax match pfmainRef "$\<local_command_shell\>"
+syntax match pfmainRef "$\<local_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<local_destination_recipient_limit\>"
+syntax match pfmainRef "$\<local_recipient_maps\>"
+syntax match pfmainRef "$\<local_transport\>"
+syntax match pfmainRef "$\<luser_relay\>"
+syntax match pfmainRef "$\<mail_name\>"
+syntax match pfmainRef "$\<mail_owner\>"
+syntax match pfmainRef "$\<mail_release_date\>"
+syntax match pfmainRef "$\<mail_spool_directory\>"
+syntax match pfmainRef "$\<mail_version\>"
+syntax match pfmainRef "$\<mailbox_command\>"
+syntax match pfmainRef "$\<mailbox_command_maps\>"
+syntax match pfmainRef "$\<mailbox_delivery_lock\>"
+syntax match pfmainRef "$\<mailbox_size_limit\>"
+syntax match pfmainRef "$\<mailbox_transport\>"
+syntax match pfmainRef "$\<mailq_path\>"
+syntax match pfmainRef "$\<manpage_directory\>"
+syntax match pfmainRef "$\<maps_rbl_domains\>"
+syntax match pfmainRef "$\<maps_rbl_reject_code\>"
+syntax match pfmainRef "$\<masquerade_classes\>"
+syntax match pfmainRef "$\<masquerade_domains\>"
+syntax match pfmainRef "$\<masquerade_exceptions\>"
+syntax match pfmainRef "$\<max_idle\>"
+syntax match pfmainRef "$\<max_use\>"
+syntax match pfmainRef "$\<maximal_backoff_time\>"
+syntax match pfmainRef "$\<maximal_queue_lifetime\>"
+syntax match pfmainRef "$\<message_size_limit\>"
+syntax match pfmainRef "$\<mime_boundary_length_limit\>"
+syntax match pfmainRef "$\<mime_header_checks\>"
+syntax match pfmainRef "$\<mime_nesting_limit\>"
+syntax match pfmainRef "$\<minimal_backoff_time\>"
+syntax match pfmainRef "$\<multi_recipient_bounce_reject_code\>"
+syntax match pfmainRef "$\<mydestination\>"
+syntax match pfmainRef "$\<mydomain\>"
+syntax match pfmainRef "$\<myhostname\>"
+syntax match pfmainRef "$\<mynetworks\>"
+syntax match pfmainRef "$\<mynetworks_style\>"
+syntax match pfmainRef "$\<myorigin\>"
+syntax match pfmainRef "$\<nested_header_checks\>"
+syntax match pfmainRef "$\<newaliases_path\>"
+syntax match pfmainRef "$\<non_fqdn_reject_code\>"
+syntax match pfmainRef "$\<notify_classes\>"
+syntax match pfmainRef "$\<owner_request_special\>"
+syntax match pfmainRef "$\<parent_domain_matches_subdomains\>"
+syntax match pfmainRef "$\<permit_mx_backup_networks\>"
+syntax match pfmainRef "$\<pickup_service_name\>"
+syntax match pfmainRef "$\<prepend_delivered_header\>"
+syntax match pfmainRef "$\<process_id_directory\>"
+syntax match pfmainRef "$\<propagate_unmatched_extensions\>"
+syntax match pfmainRef "$\<proxy_interfaces\>"
+syntax match pfmainRef "$\<proxy_read_maps\>"
+syntax match pfmainRef "$\<qmgr_clog_warn_time\>"
+syntax match pfmainRef "$\<qmgr_fudge_factor\>"
+syntax match pfmainRef "$\<qmgr_message_active_limit\>"
+syntax match pfmainRef "$\<qmgr_message_recipient_limit\>"
+syntax match pfmainRef "$\<qmgr_message_recipient_minimum\>"
+syntax match pfmainRef "$\<qmqpd_authorized_clients\>"
+syntax match pfmainRef "$\<qmqpd_error_delay\>"
+syntax match pfmainRef "$\<qmqpd_timeout\>"
+syntax match pfmainRef "$\<queue_directory\>"
+syntax match pfmainRef "$\<queue_file_attribute_count_limit\>"
+syntax match pfmainRef "$\<queue_minfree\>"
+syntax match pfmainRef "$\<queue_run_delay\>"
+syntax match pfmainRef "$\<queue_service_name\>"
+syntax match pfmainRef "$\<rbl_reply_maps\>"
+syntax match pfmainRef "$\<readme_directory\>"
+syntax match pfmainRef "$\<receive_override_options\>"
+syntax match pfmainRef "$\<recipient_bcc_maps\>"
+syntax match pfmainRef "$\<recipient_canonical_maps\>"
+syntax match pfmainRef "$\<recipient_delimiter\>"
+syntax match pfmainRef "$\<reject_code\>"
+syntax match pfmainRef "$\<relay_clientcerts\>"
+syntax match pfmainRef "$\<relay_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<relay_destination_recipient_limit\>"
+syntax match pfmainRef "$\<relay_domains\>"
+syntax match pfmainRef "$\<relay_domains_reject_code\>"
+syntax match pfmainRef "$\<relay_recipient_maps\>"
+syntax match pfmainRef "$\<relay_transport\>"
+syntax match pfmainRef "$\<relayhost\>"
+syntax match pfmainRef "$\<relocated_maps\>"
+syntax match pfmainRef "$\<require_home_directory\>"
+syntax match pfmainRef "$\<resolve_dequoted_address\>"
+syntax match pfmainRef "$\<resolve_null_domain\>"
+syntax match pfmainRef "$\<rewrite_service_name\>"
+syntax match pfmainRef "$\<sample_directory\>"
+syntax match pfmainRef "$\<sender_based_routing\>"
+syntax match pfmainRef "$\<sender_bcc_maps\>"
+syntax match pfmainRef "$\<sender_canonical_maps\>"
+syntax match pfmainRef "$\<sendmail_path\>"
+syntax match pfmainRef "$\<service_throttle_time\>"
+syntax match pfmainRef "$\<setgid_group\>"
+syntax match pfmainRef "$\<show_user_unknown_table_name\>"
+syntax match pfmainRef "$\<showq_service_name\>"
+syntax match pfmainRef "$\<smtp_always_send_ehlo\>"
+syntax match pfmainRef "$\<smtp_bind_address\>"
+syntax match pfmainRef "$\<smtp_connect_timeout\>"
+syntax match pfmainRef "$\<smtp_data_done_timeout\>"
+syntax match pfmainRef "$\<smtp_data_init_timeout\>"
+syntax match pfmainRef "$\<smtp_data_xfer_timeout\>"
+syntax match pfmainRef "$\<smtp_defer_if_no_mx_address_found\>"
+syntax match pfmainRef "$\<smtp_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<smtp_destination_recipient_limit\>"
+syntax match pfmainRef "$\<smtp_enforce_tls\>"
+syntax match pfmainRef "$\<smtp_helo_name\>"
+syntax match pfmainRef "$\<smtp_helo_timeout\>"
+syntax match pfmainRef "$\<smtp_host_lookup\>"
+syntax match pfmainRef "$\<smtp_line_length_limit\>"
+syntax match pfmainRef "$\<smtp_mail_timeout\>"
+syntax match pfmainRef "$\<smtp_mx_address_limit\>"
+syntax match pfmainRef "$\<smtp_mx_session_limit\>"
+syntax match pfmainRef "$\<smtp_never_send_ehlo\>"
+syntax match pfmainRef "$\<smtp_pix_workaround_delay_time\>"
+syntax match pfmainRef "$\<smtp_pix_workaround_threshold_time\>"
+syntax match pfmainRef "$\<smtp_quit_timeout\>"
+syntax match pfmainRef "$\<smtp_quote_rfc821_envelope\>"
+syntax match pfmainRef "$\<smtp_randomize_addresses\>"
+syntax match pfmainRef "$\<smtp_rcpt_timeout\>"
+syntax match pfmainRef "$\<smtp_rset_timeout\>"
+syntax match pfmainRef "$\<smtp_sasl_auth_enable\>"
+syntax match pfmainRef "$\<smtp_sasl_password_maps\>"
+syntax match pfmainRef "$\<smtp_sasl_security_options\>"
+syntax match pfmainRef "$\<smtp_sasl_tls_security_options\>"
+syntax match pfmainRef "$\<smtp_sasl_tls_verified_security_options\>"
+syntax match pfmainRef "$\<smtp_send_xforward_command\>"
+syntax match pfmainRef "$\<smtp_skip_5xx_greeting\>"
+syntax match pfmainRef "$\<smtp_skip_quit_response\>"
+syntax match pfmainRef "$\<smtp_starttls_timeout\>"
+syntax match pfmainRef "$\<smtp_tls_CAfile\>"
+syntax match pfmainRef "$\<smtp_tls_CApath\>"
+syntax match pfmainRef "$\<smtp_tls_cert_file\>"
+syntax match pfmainRef "$\<smtp_tls_cipherlist\>"
+syntax match pfmainRef "$\<smtp_tls_dcert_file\>"
+syntax match pfmainRef "$\<smtp_tls_dkey_file\>"
+syntax match pfmainRef "$\<smtp_tls_enforce_peername\>"
+syntax match pfmainRef "$\<smtp_tls_key_file\>"
+syntax match pfmainRef "$\<smtp_tls_loglevel\>"
+syntax match pfmainRef "$\<smtp_tls_note_starttls_offer\>"
+syntax match pfmainRef "$\<smtp_tls_per_site\>"
+syntax match pfmainRef "$\<smtp_tls_scert_verifydepth\>"
+syntax match pfmainRef "$\<smtp_tls_session_cache_database\>"
+syntax match pfmainRef "$\<smtp_tls_session_cache_timeout\>"
+syntax match pfmainRef "$\<smtp_use_tls\>"
+syntax match pfmainRef "$\<smtp_xforward_timeout\>"
+syntax match pfmainRef "$\<smtpd_authorized_verp_clients\>"
+syntax match pfmainRef "$\<smtpd_authorized_xclient_hosts\>"
+syntax match pfmainRef "$\<smtpd_authorized_xforward_hosts\>"
+syntax match pfmainRef "$\<smtpd_banner\>"
+syntax match pfmainRef "$\<smtpd_client_connection_count_limit\>"
+syntax match pfmainRef "$\<smtpd_client_connection_limit_exceptions\>"
+syntax match pfmainRef "$\<smtpd_client_connection_rate_limit\>"
+syntax match pfmainRef "$\<smtpd_client_restrictions\>"
+syntax match pfmainRef "$\<smtpd_data_restrictions\>"
+syntax match pfmainRef "$\<smtpd_delay_reject\>"
+syntax match pfmainRef "$\<smtpd_enforce_tls\>"
+syntax match pfmainRef "$\<smtpd_error_sleep_time\>"
+syntax match pfmainRef "$\<smtpd_etrn_restrictions\>"
+syntax match pfmainRef "$\<smtpd_expansion_filter\>"
+syntax match pfmainRef "$\<smtpd_hard_error_limit\>"
+syntax match pfmainRef "$\<smtpd_helo_required\>"
+syntax match pfmainRef "$\<smtpd_helo_restrictions\>"
+syntax match pfmainRef "$\<smtpd_history_flush_threshold\>"
+syntax match pfmainRef "$\<smtpd_junk_command_limit\>"
+syntax match pfmainRef "$\<smtpd_noop_commands\>"
+syntax match pfmainRef "$\<smtpd_null_access_lookup_key\>"
+syntax match pfmainRef "$\<smtpd_policy_service_max_idle\>"
+syntax match pfmainRef "$\<smtpd_policy_service_max_ttl\>"
+syntax match pfmainRef "$\<smtpd_policy_service_timeout\>"
+syntax match pfmainRef "$\<smtpd_proxy_ehlo\>"
+syntax match pfmainRef "$\<smtpd_proxy_filter\>"
+syntax match pfmainRef "$\<smtpd_proxy_timeout\>"
+syntax match pfmainRef "$\<smtpd_recipient_limit\>"
+syntax match pfmainRef "$\<smtpd_recipient_overshoot_limit\>"
+syntax match pfmainRef "$\<smtpd_recipient_restrictions\>"
+syntax match pfmainRef "$\<smtpd_reject_unlisted_recipient\>"
+syntax match pfmainRef "$\<smtpd_reject_unlisted_sender\>"
+syntax match pfmainRef "$\<smtpd_restriction_classes\>"
+syntax match pfmainRef "$\<smtpd_sasl_application_name\>"
+syntax match pfmainRef "$\<smtpd_sasl_auth_enable\>"
+syntax match pfmainRef "$\<smtpd_sasl_exceptions_networks\>"
+syntax match pfmainRef "$\<smtpd_sasl_local_domain\>"
+syntax match pfmainRef "$\<smtpd_sasl_security_options\>"
+syntax match pfmainRef "$\<smtpd_sasl_tls_security_options\>"
+syntax match pfmainRef "$\<smtpd_sender_login_maps\>"
+syntax match pfmainRef "$\<smtpd_sender_restrictions\>"
+syntax match pfmainRef "$\<smtpd_soft_error_limit\>"
+syntax match pfmainRef "$\<smtpd_starttls_timeout\>"
+syntax match pfmainRef "$\<smtpd_timeout\>"
+syntax match pfmainRef "$\<smtpd_tls_CAfile\>"
+syntax match pfmainRef "$\<smtpd_tls_CApath\>"
+syntax match pfmainRef "$\<smtpd_tls_ask_ccert\>"
+syntax match pfmainRef "$\<smtpd_tls_auth_only\>"
+syntax match pfmainRef "$\<smtpd_tls_ccert_verifydepth\>"
+syntax match pfmainRef "$\<smtpd_tls_cert_file\>"
+syntax match pfmainRef "$\<smtpd_tls_cipherlist\>"
+syntax match pfmainRef "$\<smtpd_tls_dcert_file\>"
+syntax match pfmainRef "$\<smtpd_tls_dh1024_param_file\>"
+syntax match pfmainRef "$\<smtpd_tls_dh512_param_file\>"
+syntax match pfmainRef "$\<smtpd_tls_dkey_file\>"
+syntax match pfmainRef "$\<smtpd_tls_key_file\>"
+syntax match pfmainRef "$\<smtpd_tls_loglevel\>"
+syntax match pfmainRef "$\<smtpd_tls_received_header\>"
+syntax match pfmainRef "$\<smtpd_tls_req_ccert\>"
+syntax match pfmainRef "$\<smtpd_tls_session_cache_database\>"
+syntax match pfmainRef "$\<smtpd_tls_session_cache_timeout\>"
+syntax match pfmainRef "$\<smtpd_tls_wrappermode\>"
+syntax match pfmainRef "$\<smtpd_use_tls\>"
+syntax match pfmainRef "$\<soft_bounce\>"
+syntax match pfmainRef "$\<stale_lock_time\>"
+syntax match pfmainRef "$\<strict_7bit_headers\>"
+syntax match pfmainRef "$\<strict_8bitmime\>"
+syntax match pfmainRef "$\<strict_8bitmime_body\>"
+syntax match pfmainRef "$\<strict_mime_encoding_domain\>"
+syntax match pfmainRef "$\<strict_rfc821_envelopes\>"
+syntax match pfmainRef "$\<sun_mailtool_compatibility\>"
+syntax match pfmainRef "$\<swap_bangpath\>"
+syntax match pfmainRef "$\<syslog_facility\>"
+syntax match pfmainRef "$\<syslog_name\>"
+syntax match pfmainRef "$\<tls_daemon_random_bytes\>"
+syntax match pfmainRef "$\<tls_daemon_random_source\>"
+syntax match pfmainRef "$\<tls_random_bytes\>"
+syntax match pfmainRef "$\<tls_random_exchange_name\>"
+syntax match pfmainRef "$\<tls_random_prng_update_period\>"
+syntax match pfmainRef "$\<tls_random_reseed_period\>"
+syntax match pfmainRef "$\<tls_random_source\>"
+syntax match pfmainRef "$\<trace_service_name\>"
+syntax match pfmainRef "$\<transport_maps\>"
+syntax match pfmainRef "$\<transport_retry_time\>"
+syntax match pfmainRef "$\<trigger_timeout\>"
+syntax match pfmainRef "$\<undisclosed_recipients_header\>"
+syntax match pfmainRef "$\<unknown_address_reject_code\>"
+syntax match pfmainRef "$\<unknown_client_reject_code\>"
+syntax match pfmainRef "$\<unknown_hostname_reject_code\>"
+syntax match pfmainRef "$\<unknown_local_recipient_reject_code\>"
+syntax match pfmainRef "$\<unknown_relay_recipient_reject_code\>"
+syntax match pfmainRef "$\<unknown_virtual_alias_reject_code\>"
+syntax match pfmainRef "$\<unknown_virtual_mailbox_reject_code\>"
+syntax match pfmainRef "$\<unverified_recipient_reject_code\>"
+syntax match pfmainRef "$\<unverified_sender_reject_code\>"
+syntax match pfmainRef "$\<verp_delimiter_filter\>"
+syntax match pfmainRef "$\<virtual_alias_domains\>"
+syntax match pfmainRef "$\<virtual_alias_expansion_limit\>"
+syntax match pfmainRef "$\<virtual_alias_maps\>"
+syntax match pfmainRef "$\<virtual_alias_recursion_limit\>"
+syntax match pfmainRef "$\<virtual_destination_concurrency_limit\>"
+syntax match pfmainRef "$\<virtual_destination_recipient_limit\>"
+syntax match pfmainRef "$\<virtual_gid_maps\>"
+syntax match pfmainRef "$\<virtual_mailbox_base\>"
+syntax match pfmainRef "$\<virtual_mailbox_domains\>"
+syntax match pfmainRef "$\<virtual_mailbox_limit\>"
+syntax match pfmainRef "$\<virtual_mailbox_lock\>"
+syntax match pfmainRef "$\<virtual_mailbox_maps\>"
+syntax match pfmainRef "$\<virtual_minimum_uid\>"
+syntax match pfmainRef "$\<virtual_transport\>"
+syntax match pfmainRef "$\<virtual_uid_maps\>"
+
+syntax keyword pfmainDictDB hash btree dbm
+syntax keyword pfmainDictRE regexp pcre
+syntax keyword pfmainDictEXT ldap environ nis netinfo
+syntax keyword pfmainQueue active bounce corrupt defer deferred
+syntax keyword pfmainQueue flush incoming saved
+syntax keyword pfmainTransport smtp lmtp unix local error
+syntax keyword pfmainLock fcntl flock dotlock
+syntax keyword pfmainAnswer yes no
+
+syntax match pfmainComment "#.*$"
+syntax match pfmainNumber "\<\d\+\>"
+syntax match pfmainTime "\<\d\+[hmsd]\>"
+syntax match pfmainIP "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>"
+syntax match pfmainVariable "\$\w\+" contains=pfmainRef ",pfmainRefTLS
+
+if version >= 508 || !exists("pfmain_syntax_init")
+ if version < 508
+ let pfmain_syntax_init = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pfmainComment Comment
+ HiLink pfmainConf Keyword
+ HiLink pfmainNumber Number
+ HiLink pfmainTime Number
+ HiLink pfmainIP Number
+ HiLink pfmainDictDB Type
+ HiLink pfmainDictRE Type
+ HiLink pfmainDictEXT Type
+ HiLink pfmainQueue Constant
+ HiLink pfmainTransport Constant
+ HiLink pfmainLock Constant
+ HiLink pfmainAnswer Constant
+ HiLink pfmainRef Macro
+
+ " HiLink pfmainConfTLS Special
+ " HiLink pfmainRefTLS Macro
+
+ HiLink pfmainVariable Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pfmain"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim
new file mode 100644
index 000000000..b94a271de
--- /dev/null
+++ b/runtime/syntax/php.vim
@@ -0,0 +1,513 @@
+" Vim syntax file
+" Language: php PHP 3/4/5
+" Maintainer: Lutz Eymers <ixtab@polzin.com>
+" URL: http://www.isp.de/data/php.vim
+" Last Change: 2004 Feb 04
+"
+" Options php_sql_query = 1 for SQL syntax highlighting inside strings
+" php_htmlInStrings = 1 for HTML syntax highlighting inside strings
+" php_baselib = 1 for highlighting baselib functions
+" php_asp_tags = 1 for highlighting ASP-style short tags
+" php_parent_error_close = 1 for highlighting parent error ] or )
+" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one
+" php_oldStyle = 1 for using old colorstyle
+" php_noShortTags = 1 don't sync <? ?> as php
+" php_folding = 1 for folding classes and functions
+" php_folding = 2 for folding all { } regions
+" php_sync_method = x
+" x=-1 to sync by search ( default )
+" x>0 to sync at least x lines backwards
+" x=0 to sync from start
+
+" Note
+" Setting php_folding=1 will match a closing } by comparing the indent
+" before the class or function keyword with the indent of a matching }.
+" Setting php_folding=2 will match all of pairs of {,} ( see known
+" bugs ii )
+
+" Known bugs
+" setting php_parent_error_close on and php_parent_error_open off
+" has these two leaks:
+" i) An closing ) or ] inside a string match to the last open ( or [
+" before the string, when the the closing ) or ] is on the same line
+" where the string started. In this case a following ) or ] after
+" the string would be highlighted as an error, what is incorrect.
+" ii) Same problem if you are setting php_folding = 2 with a closing
+" } inside an string on the first line of this string.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'php'
+endif
+
+if version < 600
+ unlet! php_folding
+ if exists("php_sync_method") && !php_sync_method
+ let php_sync_method=-1
+ endif
+ so <sfile>:p:h/html.vim
+else
+ runtime syntax/html.vim
+ unlet b:current_syntax
+endif
+
+" accept old options
+if !exists("php_sync_method")
+ if exists("php_minlines")
+ let php_sync_method=php_minlines
+ else
+ let php_sync_method=-1
+ endif
+endif
+
+if exists("php_parentError") && !exists("php_parent_error_open") && !exists("php_parent_error_close")
+ let php_parent_error_close=1
+ let php_parent_error_open=1
+endif
+
+syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc
+
+if version < 600
+ syn include @sqlTop <sfile>:p:h/sql.vim
+else
+ syn include @sqlTop syntax/sql.vim
+endif
+syn sync clear
+unlet b:current_syntax
+syn cluster sqlTop remove=sqlString,sqlComment
+if exists( "php_sql_query")
+ syn cluster phpAddStrings contains=@sqlTop
+endif
+
+if exists( "php_htmlInStrings")
+ syn cluster phpAddStrings add=@htmlTop
+endif
+
+syn case match
+
+" Env Variables
+syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTOCOL REQUEST_METHOD QUERY_STRING DOCUMENT_ROOT HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CONNECTION HTTP_HOST HTTP_REFERER HTTP_USER_AGENT REMOTE_ADDR REMOTE_PORT SCRIPT_FILENAME SERVER_ADMIN SERVER_PORT SERVER_SIGNATURE PATH_TRANSLATED SCRIPT_NAME REQUEST_URI contained
+
+" Internal Variables
+syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION contained
+
+" Constants
+syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL contained
+
+syn case ignore
+
+syn keyword phpConstant __LINE__ __FILE__ __FUNCTION__ __METHOD__ __CLASS__ contained
+
+
+" Function and Methods ripped from php_manual_de.tar.gz Jan 2003
+syn keyword phpFunctions apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_response_headers apache_setenv ascii2ebcdic ebcdic2ascii getallheaders virtual contained
+syn keyword phpFunctions array_change_key_case array_chunk array_combine array_count_values array_diff_assoc array_diff_uassoc array_diff array_fill array_filter array_flip array_intersect_assoc array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_push array_rand array_reduce array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_unique array_unshift array_values array_walk array arsort asort compact count current each end extract in_array key krsort ksort list natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort contained
+syn keyword phpFunctions aspell_check aspell_new aspell_suggest contained
+syn keyword phpFunctions bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub contained
+syn keyword phpFunctions bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite contained
+syn keyword phpFunctions cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days frenchtojd gregoriantojd jddayofweek jdmonthname jdtofrench jdtogregorian jdtojewish jdtojulian jdtounix jewishtojd juliantojd unixtojd contained
+syn keyword phpFunctions ccvs_add ccvs_auth ccvs_command ccvs_count ccvs_delete ccvs_done ccvs_init ccvs_lookup ccvs_new ccvs_report ccvs_return ccvs_reverse ccvs_sale ccvs_status ccvs_textvalue ccvs_void contained
+syn keyword phpFunctions call_user_method_array call_user_method class_exists get_class_methods get_class_vars get_class get_declared_classes get_object_vars get_parent_class is_a is_subclass_of method_exists contained
+syn keyword phpFunctions com VARIANT com_addref com_get com_invoke com_isenum com_load_typelib com_load com_propget com_propput com_propset com_release com_set contained
+syn keyword phpFunctions cpdf_add_annotation cpdf_add_outline cpdf_arc cpdf_begin_text cpdf_circle cpdf_clip cpdf_close cpdf_closepath_fill_stroke cpdf_closepath_stroke cpdf_closepath cpdf_continue_text cpdf_curveto cpdf_end_text cpdf_fill_stroke cpdf_fill cpdf_finalize_page cpdf_finalize cpdf_global_set_document_limits cpdf_import_jpeg cpdf_lineto cpdf_moveto cpdf_newpath cpdf_open cpdf_output_buffer cpdf_page_init cpdf_place_inline_image cpdf_rect cpdf_restore cpdf_rlineto cpdf_rmoveto cpdf_rotate_text cpdf_rotate cpdf_save_to_file cpdf_save cpdf_scale cpdf_set_action_url cpdf_set_char_spacing cpdf_set_creator cpdf_set_current_page cpdf_set_font_directories cpdf_set_font_map_file cpdf_set_font cpdf_set_horiz_scaling cpdf_set_keywords cpdf_set_leading cpdf_set_page_animation cpdf_set_subject cpdf_set_text_matrix cpdf_set_text_pos cpdf_set_text_rendering cpdf_set_text_rise cpdf_set_title cpdf_set_viewer_preferences cpdf_set_word_spacing cpdf_setdash cpdf_setflat cpdf_setgray_fill cpdf_setgray_stroke cpdf_setgray cpdf_setlinecap cpdf_setlinejoin cpdf_setlinewidth cpdf_setmiterlimit cpdf_setrgbcolor_fill cpdf_setrgbcolor_stroke cpdf_setrgbcolor cpdf_show_xy cpdf_show cpdf_stringwidth cpdf_stroke cpdf_text cpdf_translate contained
+syn keyword phpFunctions crack_check crack_closedict crack_getlastmessage crack_opendict contained
+syn keyword phpFunctions ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit contained
+syn keyword phpFunctions curl_close curl_errno curl_error curl_exec curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_setopt curl_version contained
+syn keyword phpFunctions cybercash_base64_decode cybercash_base64_encode cybercash_decr cybercash_encr contained
+syn keyword phpFunctions cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind contained
+syn keyword phpFunctions checkdate date getdate gettimeofday gmdate gmmktime gmstrftime localtime microtime mktime strftime strtotime time contained
+syn keyword phpFunctions dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync contained
+syn keyword phpFunctions dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record contained
+syn keyword phpFunctions dblist dbmclose dbmdelete dbmexists dbmfetch dbmfirstkey dbminsert dbmnextkey dbmopen dbmreplace contained
+syn keyword phpFunctions dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel contained
+syn keyword phpFunctions dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort contained
+syn keyword phpFunctions dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write contained
+syn keyword phpFunctions chdir chroot dir closedir getcwd opendir readdir rewinddir scandir contained
+syn keyword phpFunctions domxml_new_doc domxml_open_file domxml_open_mem domxml_version domxml_xmltree domxml_xslt_stylesheet_doc domxml_xslt_stylesheet_file domxml_xslt_stylesheet xpath_eval_expression xpath_eval xpath_new_context xptr_eval xptr_new_context contained
+syn keyword phpMethods name specified value create_attribute create_cdata_section create_comment create_element_ns create_element create_entity_reference create_processing_instruction create_text_node doctype document_element dump_file dump_mem get_element_by_id get_elements_by_tagname html_dump_mem xinclude entities internal_subset name notations public_id system_id get_attribute_node get_attribute get_elements_by_tagname has_attribute remove_attribute set_attribute tagname add_namespace append_child append_sibling attributes child_nodes clone_node dump_node first_child get_content has_attributes has_child_nodes insert_before is_blank_node last_child next_sibling node_name node_type node_value owner_document parent_node prefix previous_sibling remove_child replace_child replace_node set_content set_name set_namespace unlink_node data target process result_dump_file result_dump_mem contained
+syn keyword phpFunctions dotnet_load contained
+syn keyword phpFunctions debug_backtrace debug_print_backtrace error_log error_reporting restore_error_handler set_error_handler trigger_error user_error contained
+syn keyword phpFunctions escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system contained
+syn keyword phpFunctions fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor contained
+syn keyword phpFunctions fbsql_affected_rows fbsql_autocommit fbsql_change_user fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_select_db fbsql_set_lob_mode fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_tablename fbsql_username fbsql_warnings contained
+syn keyword phpFunctions fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version contained
+syn keyword phpFunctions filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro contained
+syn keyword phpFunctions basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable link linkinfo lstat mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink contained
+syn keyword phpFunctions fribidi_log2vis contained
+syn keyword phpFunctions ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype contained
+syn keyword phpFunctions call_user_func_array call_user_func create_function func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function contained
+syn keyword phpFunctions bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain contained
+syn keyword phpFunctions gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_sqrtrm gmp_strval gmp_sub gmp_xor contained
+syn keyword phpFunctions header headers_list headers_sent setcookie contained
+syn keyword phpFunctions hw_api_attribute hwapi_hgcsp hw_api_content hw_api_object contained
+syn keyword phpMethods key langdepvalue value values checkin checkout children mimetype read content copy dbstat dcstat dstanchors dstofsrcanchors count reason find ftstat hwstat identify info insert insertanchor insertcollection insertdocument link lock move assign attreditable count insert remove title value object objectbyanchor parents description type remove replace setcommitedversion srcanchors srcsofdst unlock user userlist contained
+syn keyword phpFunctions hw_Array2Objrec hw_changeobject hw_Children hw_ChildrenObj hw_Close hw_Connect hw_connection_info hw_cp hw_Deleteobject hw_DocByAnchor hw_DocByAnchorObj hw_Document_Attributes hw_Document_BodyTag hw_Document_Content hw_Document_SetContent hw_Document_Size hw_dummy hw_EditText hw_Error hw_ErrorMsg hw_Free_Document hw_GetAnchors hw_GetAnchorsObj hw_GetAndLock hw_GetChildColl hw_GetChildCollObj hw_GetChildDocColl hw_GetChildDocCollObj hw_GetObject hw_GetObjectByQuery hw_GetObjectByQueryColl hw_GetObjectByQueryCollObj hw_GetObjectByQueryObj hw_GetParents hw_GetParentsObj hw_getrellink hw_GetRemote hw_getremotechildren hw_GetSrcByDestObj hw_GetText hw_getusername hw_Identify hw_InCollections hw_Info hw_InsColl hw_InsDoc hw_insertanchors hw_InsertDocument hw_InsertObject hw_mapid hw_Modifyobject hw_mv hw_New_Document hw_objrec2array hw_Output_Document hw_pConnect hw_PipeDocument hw_Root hw_setlinkroot hw_stat hw_Unlock hw_Who contained
+syn keyword phpFunctions ibase_add_user ibase_affected_rows ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_rollback_ret ibase_rollback ibase_set_event_handler ibase_timefmt ibase_trans ibase_wait_event contained
+syn keyword phpFunctions iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler contained
+syn keyword phpFunctions ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob contained
+syn keyword phpFunctions exif_imagetype exif_read_data exif_thumbnail gd_info getimagesize image_type_to_mime_type image2wbmp imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd2 imagegd imagegif imageinterlace imageistruecolor imagejpeg imageline imageloadfont imagepalettecopy imagepng imagepolygon imagepsbbox imagepscopyfont imagepsencodefont imagepsextendfont imagepsfreefont imagepsloadfont imagepsslantfont imagepstext imagerectangle imagerotate imagesavealpha imagesetbrush imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp iptcembed iptcparse jpeg2wbmp png2wbmp read_exif_data contained
+syn keyword phpFunctions imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 contained
+syn keyword phpFunctions assert_options assert dl extension_loaded get_cfg_var get_current_user get_defined_constants get_extension_funcs get_include_path get_included_files get_loaded_extensions get_magic_quotes_gpc get_magic_quotes_runtime get_required_files getenv getlastmod getmygid getmyinode getmypid getmyuid getopt getrusage ini_alter ini_get_all ini_get ini_restore ini_set main memory_get_usage php_ini_scanned_files php_logo_guid php_sapi_name php_uname phpcredits phpinfo phpversion putenv restore_include_path set_include_path set_magic_quotes_runtime set_time_limit version_compare zend_logo_guid zend_version contained
+syn keyword phpFunctions ingres_autocommit ingres_close ingres_commit ingres_connect ingres_fetch_array ingres_fetch_object ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_num_fields ingres_num_rows ingres_pconnect ingres_query ingres_rollback contained
+syn keyword phpFunctions ircg_channel_mode ircg_disconnect ircg_fetch_error_msg ircg_get_username ircg_html_encode ircg_ignore_add ircg_ignore_del ircg_is_conn_alive ircg_join ircg_kick ircg_lookup_format_messages ircg_msg ircg_nick ircg_nickname_escape ircg_nickname_unescape ircg_notice ircg_part ircg_pconnect ircg_register_format_messages ircg_set_current ircg_set_file ircg_set_on_die ircg_topic ircg_whois contained
+syn keyword phpFunctions java_last_exception_clear java_last_exception_get contained
+syn keyword phpFunctions ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind contained
+syn keyword phpFunctions lzf_compress lzf_decompress lzf_optimized_for contained
+syn keyword phpFunctions ezmlm_hash mail contained
+syn keyword phpFunctions mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all contained
+syn keyword phpFunctions abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh contained
+syn keyword phpFunctions mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_ereg_match mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_strlen mb_strpos mb_strrpos mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr contained
+syn keyword phpFunctions mcal_append_event mcal_close mcal_create_calendar mcal_date_compare mcal_date_valid mcal_day_of_week mcal_day_of_year mcal_days_in_month mcal_delete_calendar mcal_delete_event mcal_event_add_attribute mcal_event_init mcal_event_set_alarm mcal_event_set_category mcal_event_set_class mcal_event_set_description mcal_event_set_end mcal_event_set_recur_daily mcal_event_set_recur_monthly_mday mcal_event_set_recur_monthly_wday mcal_event_set_recur_none mcal_event_set_recur_weekly mcal_event_set_recur_yearly mcal_event_set_start mcal_event_set_title mcal_expunge mcal_fetch_current_stream_event mcal_fetch_event mcal_is_leap_year mcal_list_alarms mcal_list_events mcal_next_recurrence mcal_open mcal_popen mcal_rename_calendar mcal_reopen mcal_snooze mcal_store_event mcal_time_valid mcal_week_of_year contained
+syn keyword phpFunctions mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic contained
+syn keyword phpFunctions mcve_adduser mcve_adduserarg mcve_bt mcve_checkstatus mcve_chkpwd mcve_chngpwd mcve_completeauthorizations mcve_connect mcve_connectionerror mcve_deleteresponse mcve_deletetrans mcve_deleteusersetup mcve_deluser mcve_destroyconn mcve_destroyengine mcve_disableuser mcve_edituser mcve_enableuser mcve_force mcve_getcell mcve_getcellbynum mcve_getcommadelimited mcve_getheader mcve_getuserarg mcve_getuserparam mcve_gft mcve_gl mcve_gut mcve_initconn mcve_initengine mcve_initusersetup mcve_iscommadelimited mcve_liststats mcve_listusers mcve_maxconntimeout mcve_monitor mcve_numcolumns mcve_numrows mcve_override mcve_parsecommadelimited mcve_ping mcve_preauth mcve_preauthcompletion mcve_qc mcve_responseparam mcve_return mcve_returncode mcve_returnstatus mcve_sale mcve_setblocking mcve_setdropfile mcve_setip mcve_setssl_files mcve_setssl mcve_settimeout mcve_settle mcve_text_avs mcve_text_code mcve_text_cv mcve_transactionauth mcve_transactionavs mcve_transactionbatch mcve_transactioncv mcve_transactionid mcve_transactionitem mcve_transactionssent mcve_transactiontext mcve_transinqueue mcve_transnew mcve_transparam mcve_transsend mcve_ub mcve_uwait mcve_verifyconnection mcve_verifysslcert mcve_void contained
+syn keyword phpFunctions mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash contained
+syn keyword phpFunctions mime_content_type contained
+syn keyword phpFunctions ming_setcubicthreshold ming_setscale ming_useswfversion SWFAction SWFBitmap swfbutton_keypress SWFbutton SWFDisplayItem SWFFill SWFFont SWFGradient SWFMorph SWFMovie SWFShape SWFSprite SWFText SWFTextField contained
+syn keyword phpMethods getHeight getWidth addAction addShape setAction setdown setHit setOver setUp addColor move moveTo multColor remove Rotate rotateTo scale scaleTo setDepth setName setRatio skewX skewXTo skewY skewYTo moveTo rotateTo scaleTo skewXTo skewYTo getwidth addEntry getshape1 getshape2 add nextframe output remove save setbackground setdimension setframes setrate streammp3 addFill drawCurve drawCurveTo drawLine drawLineTo movePen movePenTo setLeftFill setLine setRightFill add nextframe remove setframes addString getWidth moveTo setColor setFont setHeight setSpacing addstring align setbounds setcolor setFont setHeight setindentation setLeftMargin setLineSpacing setMargins setname setrightMargin contained
+syn keyword phpFunctions connection_aborted connection_status connection_timeout constant define defined die eval exit get_browser highlight_file highlight_string ignore_user_abort pack show_source sleep uniqid unpack usleep contained
+syn keyword phpFunctions udm_add_search_limit udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_check_stored udm_clear_search_limits udm_close_stored udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_load_ispell_data udm_open_stored udm_set_agent_param contained
+syn keyword phpFunctions msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get msession_getdata msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set msession_setdata msession_timeout msession_uniq msession_unlock contained
+syn keyword phpFunctions msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_dbname msql_drop_db msql_dropdb msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_freeresult msql_list_dbs msql_list_fields msql_list_tables msql_listdbs msql_listfields msql_listtables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_selectdb msql_tablename msql contained
+syn keyword phpFunctions mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db contained
+syn keyword phpFunctions muscat_close muscat_get muscat_give muscat_setup_net muscat_setup contained
+syn keyword phpFunctions mysql_affected_rows mysql_change_user mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query contained
+syn keyword phpFunctions mysqli_affected_rows mysqli_autocommit mysqli_bind_param mysqli_bind_result mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect mysqli_data_seek mysqli_debug mysqli_disable_reads_from_master mysqli_disable_rpl_parse mysqli_dump_debug_info mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_errno mysqli_error mysqli_execute mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_fetch mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_client_info mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_master_query mysqli_num_fields mysqli_num_rows mysqli_options mysqli_param_count mysqli_ping mysqli_prepare_result mysqli_prepare mysqli_profiler mysqli_query mysqli_read_query_result mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reload mysqli_rollback mysqli_rpl_parse_enabled mysqli_rpl_probe mysqli_rpl_query_type mysqli_select_db mysqli_send_long_data mysqli_send_query mysqli_slave_query mysqli_ssl_set mysqli_stat mysqli_stmt_affected_rows mysqli_stmt_close mysqli_stmt_errno mysqli_stmt_error mysqli_stmt_store_result mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count contained
+syn keyword phpFunctions ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_instr ncurses_isendwin ncurses_keyok ncurses_keypad ncurses_killchar ncurses_longname ncurses_meta ncurses_mouse_trafo ncurses_mouseinterval ncurses_mousemask ncurses_move_panel ncurses_move ncurses_mvaddch ncurses_mvaddchnstr ncurses_mvaddchstr ncurses_mvaddnstr ncurses_mvaddstr ncurses_mvcur ncurses_mvdelch ncurses_mvgetch ncurses_mvhline ncurses_mvinch ncurses_mvvline ncurses_mvwaddstr ncurses_napms ncurses_new_panel ncurses_newpad ncurses_newwin ncurses_nl ncurses_nocbreak ncurses_noecho ncurses_nonl ncurses_noqiflush ncurses_noraw ncurses_pair_content ncurses_panel_above ncurses_panel_below ncurses_panel_window ncurses_pnoutrefresh ncurses_prefresh ncurses_putp ncurses_qiflush ncurses_raw ncurses_refresh ncurses_replace_panel ncurses_reset_prog_mode ncurses_reset_shell_mode ncurses_resetty ncurses_savetty ncurses_scr_dump ncurses_scr_init ncurses_scr_restore ncurses_scr_set ncurses_scrl ncurses_show_panel ncurses_slk_attr ncurses_slk_attroff ncurses_slk_attron ncurses_slk_attrset ncurses_slk_clear ncurses_slk_color ncurses_slk_init ncurses_slk_noutrefresh ncurses_slk_refresh ncurses_slk_restore ncurses_slk_set ncurses_slk_touch ncurses_standend ncurses_standout ncurses_start_color ncurses_termattrs ncurses_termname ncurses_timeout ncurses_top_panel ncurses_typeahead ncurses_ungetch ncurses_ungetmouse ncurses_update_panels ncurses_use_default_colors ncurses_use_env ncurses_use_extended_names ncurses_vidattr ncurses_vline ncurses_waddch ncurses_waddstr ncurses_wattroff ncurses_wattron ncurses_wattrset ncurses_wborder ncurses_wclear ncurses_wcolor_set ncurses_werase ncurses_wgetch ncurses_whline ncurses_wmouse_trafo ncurses_wmove ncurses_wnoutrefresh ncurses_wrefresh ncurses_wstandend ncurses_wstandout ncurses_wvline contained
+syn keyword phpFunctions checkdnsrr closelog debugger_off debugger_on define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel getmxrr getprotobyname getprotobynumber getservbyname getservbyport ip2long long2ip openlog pfsockopen socket_get_status socket_set_blocking socket_set_timeout syslog contained
+syn keyword phpFunctions yp_all yp_cat yp_err_string yp_errno yp_first yp_get_default_domain yp_master yp_match yp_next yp_order contained
+syn keyword phpFunctions notes_body notes_copy_db notes_create_db notes_create_note notes_drop_db notes_find_note notes_header_info notes_list_msgs notes_mark_read notes_mark_unread notes_nav_create notes_search notes_unread notes_version contained
+syn keyword phpFunctions nsapi_request_headers nsapi_response_headers nsapi_virtual contained
+syn keyword phpFunctions aggregate_info aggregate_methods_by_list aggregate_methods_by_regexp aggregate_methods aggregate_properties_by_list aggregate_properties_by_regexp aggregate_properties aggregate aggregation_info deaggregate contained
+syn keyword phpFunctions ocibindbyname ocicancel ocicloselob ocicollappend ocicollassign ocicollassignelem ocicollgetelem ocicollmax ocicollsize ocicolltrim ocicolumnisnull ocicolumnname ocicolumnprecision ocicolumnscale ocicolumnsize ocicolumntype ocicolumntyperaw ocicommit ocidefinebyname ocierror ociexecute ocifetch ocifetchinto ocifetchstatement ocifreecollection ocifreecursor ocifreedesc ocifreestatement ociinternaldebug ociloadlob ocilogoff ocilogon ocinewcollection ocinewcursor ocinewdescriptor ocinlogon ocinumcols ociparse ociplogon ociresult ocirollback ocirowcount ocisavelob ocisavelobfile ociserverversion ocisetprefetch ocistatementtype ociwritelobtofile ociwritetemporarylob contained
+syn keyword phpFunctions odbc_autocommit odbc_binmode odbc_close_all odbc_close odbc_columnprivileges odbc_columns odbc_commit odbc_connect odbc_cursor odbc_data_source odbc_do odbc_error odbc_errormsg odbc_exec odbc_execute odbc_fetch_array odbc_fetch_into odbc_fetch_object odbc_fetch_row odbc_field_len odbc_field_name odbc_field_num odbc_field_precision odbc_field_scale odbc_field_type odbc_foreignkeys odbc_free_result odbc_gettypeinfo odbc_longreadlen odbc_next_result odbc_num_fields odbc_num_rows odbc_pconnect odbc_prepare odbc_primarykeys odbc_procedurecolumns odbc_procedures odbc_result_all odbc_result odbc_rollback odbc_setoption odbc_specialcolumns odbc_statistics odbc_tableprivileges odbc_tables contained
+syn keyword phpFunctions openssl_csr_export_to_file openssl_csr_export openssl_csr_new openssl_csr_sign openssl_error_string openssl_free_key openssl_get_privatekey openssl_get_publickey openssl_open openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkey_export_to_file openssl_pkey_export openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_seal openssl_sign openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export_to_file openssl_x509_export openssl_x509_free openssl_x509_parse openssl_x509_read contained
+syn keyword phpFunctions ora_bind ora_close ora_columnname ora_columnsize ora_columntype ora_commit ora_commitoff ora_commiton ora_do ora_error ora_errorcode ora_exec ora_fetch_into ora_fetch ora_getcolumn ora_logoff ora_logon ora_numcols ora_numrows ora_open ora_parse ora_plogon ora_rollback contained
+syn keyword phpFunctions flush ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_gzhandler ob_implicit_flush ob_list_handlers ob_start output_add_rewrite_var output_reset_rewrite_vars contained
+syn keyword phpFunctions overload contained
+syn keyword phpFunctions ovrimos_close ovrimos_commit ovrimos_connect ovrimos_cursor ovrimos_exec ovrimos_execute ovrimos_fetch_into ovrimos_fetch_row ovrimos_field_len ovrimos_field_name ovrimos_field_num ovrimos_field_type ovrimos_free_result ovrimos_longreadlen ovrimos_num_fields ovrimos_num_rows ovrimos_prepare ovrimos_result_all ovrimos_result ovrimos_rollback contained
+syn keyword phpFunctions pcntl_exec pcntl_fork pcntl_signal pcntl_waitpid pcntl_wexitstatus pcntl_wifexited pcntl_wifsignaled pcntl_wifstopped pcntl_wstopsig pcntl_wtermsig contained
+syn keyword phpFunctions preg_grep preg_match_all preg_match preg_quote preg_replace_callback preg_replace preg_split contained
+syn keyword phpFunctions pdf_add_annotation pdf_add_bookmark pdf_add_launchlink pdf_add_locallink pdf_add_note pdf_add_outline pdf_add_pdflink pdf_add_thumbnail pdf_add_weblink pdf_arc pdf_arcn pdf_attach_file pdf_begin_page pdf_begin_pattern pdf_begin_template pdf_circle pdf_clip pdf_close_image pdf_close_pdi_page pdf_close_pdi pdf_close pdf_closepath_fill_stroke pdf_closepath_stroke pdf_closepath pdf_concat pdf_continue_text pdf_curveto pdf_delete pdf_end_page pdf_end_pattern pdf_end_template pdf_endpath pdf_fill_stroke pdf_fill pdf_findfont pdf_get_buffer pdf_get_font pdf_get_fontname pdf_get_fontsize pdf_get_image_height pdf_get_image_width pdf_get_majorversion pdf_get_minorversion pdf_get_parameter pdf_get_pdi_parameter pdf_get_pdi_value pdf_get_value pdf_initgraphics pdf_lineto pdf_makespotcolor pdf_moveto pdf_new pdf_open_CCITT pdf_open_file pdf_open_gif pdf_open_image_file pdf_open_image pdf_open_jpeg pdf_open_memory_image pdf_open_pdi_page pdf_open_pdi pdf_open_png pdf_open_tiff pdf_open pdf_place_image pdf_place_pdi_page pdf_rect pdf_restore pdf_rotate pdf_save pdf_scale pdf_set_border_color pdf_set_border_dash pdf_set_border_style pdf_set_char_spacing pdf_set_duration pdf_set_font pdf_set_horiz_scaling pdf_set_info_author pdf_set_info_creator pdf_set_info_keywords pdf_set_info_subject pdf_set_info_title pdf_set_info pdf_set_leading pdf_set_parameter pdf_set_text_matrix pdf_set_text_pos pdf_set_text_rendering pdf_set_text_rise pdf_set_value pdf_set_word_spacing pdf_setcolor pdf_setdash pdf_setflat pdf_setfont pdf_setgray_fill pdf_setgray_stroke pdf_setgray pdf_setlinecap pdf_setlinejoin pdf_setlinewidth pdf_setmatrix pdf_setmiterlimit pdf_setpolydash pdf_setrgbcolor_fill pdf_setrgbcolor_stroke pdf_setrgbcolor pdf_show_boxed pdf_show_xy pdf_show pdf_skew pdf_stringwidth pdf_stroke pdf_translate contained
+syn keyword phpFunctions pfpro_cleanup pfpro_init pfpro_process_raw pfpro_process pfpro_version contained
+syn keyword phpFunctions pg_affected_rows pg_cancel_query pg_client_encoding pg_close pg_connect pg_connection_busy pg_connection_reset pg_connection_status pg_convert pg_copy_from pg_copy_to pg_dbname pg_delete pg_end_copy pg_escape_bytea pg_escape_string pg_fetch_all pg_fetch_array pg_fetch_assoc pg_fetch_object pg_fetch_result pg_fetch_row pg_field_is_null pg_field_name pg_field_num pg_field_prtlen pg_field_size pg_field_type pg_free_result pg_get_notify pg_get_pid pg_get_result pg_host pg_insert pg_last_error pg_last_notice pg_last_oid pg_lo_close pg_lo_create pg_lo_export pg_lo_import pg_lo_open pg_lo_read_all pg_lo_read pg_lo_seek pg_lo_tell pg_lo_unlink pg_lo_write pg_meta_data pg_num_fields pg_num_rows pg_options pg_pconnect pg_ping pg_port pg_put_line pg_query pg_result_error pg_result_seek pg_result_status pg_select pg_send_query pg_set_client_encoding pg_trace pg_tty pg_unescape_bytea pg_untrace pg_update contained
+syn keyword phpFunctions posix_ctermid posix_get_last_error posix_getcwd posix_getegid posix_geteuid posix_getgid posix_getgrgid posix_getgrnam posix_getgroups posix_getlogin posix_getpgid posix_getpgrp posix_getpid posix_getppid posix_getpwnam posix_getpwuid posix_getrlimit posix_getsid posix_getuid posix_isatty posix_kill posix_mkfifo posix_setegid posix_seteuid posix_setgid posix_setpgid posix_setsid posix_setuid posix_strerror posix_times posix_ttyname posix_uname contained
+syn keyword phpFunctions printer_abort printer_close printer_create_brush printer_create_dc printer_create_font printer_create_pen printer_delete_brush printer_delete_dc printer_delete_font printer_delete_pen printer_draw_bmp printer_draw_chord printer_draw_elipse printer_draw_line printer_draw_pie printer_draw_rectangle printer_draw_roundrect printer_draw_text printer_end_doc printer_end_page printer_get_option printer_list printer_logical_fontheight printer_open printer_select_brush printer_select_font printer_select_pen printer_set_option printer_start_doc printer_start_page printer_write contained
+syn keyword phpFunctions pspell_add_to_personal pspell_add_to_session pspell_check pspell_clear_session pspell_config_create pspell_config_ignore pspell_config_mode pspell_config_personal pspell_config_repl pspell_config_runtogether pspell_config_save_repl pspell_new_config pspell_new_personal pspell_new pspell_save_wordlist pspell_store_replacement pspell_suggest contained
+syn keyword phpFunctions qdom_error qdom_tree contained
+syn keyword phpFunctions readline_add_history readline_clear_history readline_completion_function readline_info readline_list_history readline_read_history readline_write_history readline contained
+syn keyword phpFunctions recode_file recode_string recode contained
+syn keyword phpFunctions ereg_replace ereg eregi_replace eregi split spliti sql_regcase contained
+syn keyword phpFunctions ftok msg_get_queue msg_receive msg_remove_queue msg_send msg_set_queue msg_stat_queue sem_acquire sem_get sem_release sem_remove shm_attach shm_detach shm_get_var shm_put_var shm_remove_var shm_remove contained
+syn keyword phpFunctions sesam_affected_rows sesam_commit sesam_connect sesam_diagnostic sesam_disconnect sesam_errormsg sesam_execimm sesam_fetch_array sesam_fetch_result sesam_fetch_row sesam_field_array sesam_field_name sesam_free_result sesam_num_fields sesam_query sesam_rollback sesam_seek_row sesam_settransaction contained
+syn keyword phpFunctions session_cache_expire session_cache_limiter session_decode session_destroy session_encode session_get_cookie_params session_id session_is_registered session_module_name session_name session_regenerate_id session_register session_save_path session_set_cookie_params session_set_save_handler session_start session_unregister session_unset session_write_close contained
+syn keyword phpFunctions shmop_close shmop_delete shmop_open shmop_read shmop_size shmop_write contained
+syn keyword phpFunctions snmp_get_quick_print snmp_set_quick_print snmpget snmprealwalk snmpset snmpwalk snmpwalkoid contained
+syn keyword phpFunctions socket_accept socket_bind socket_clear_error socket_close socket_connect socket_create_listen socket_create_pair socket_create socket_get_option socket_getpeername socket_getsockname socket_iovec_add socket_iovec_alloc socket_iovec_delete socket_iovec_fetch socket_iovec_free socket_iovec_set socket_last_error socket_listen socket_read socket_readv socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_shutdown socket_strerror socket_write socket_writev contained
+syn keyword phpFunctions sqlite_array_query sqlite_busy_timeout sqlite_changes sqlite_close sqlite_column sqlite_create_aggregate sqlite_create_function sqlite_current sqlite_error_string sqlite_escape_string sqlite_fetch_array sqlite_fetch_single sqlite_fetch_string sqlite_field_name sqlite_has_more sqlite_last_error sqlite_last_insert_rowid sqlite_libencoding sqlite_libversion sqlite_next sqlite_num_fields sqlite_num_rows sqlite_open sqlite_popen sqlite_query sqlite_rewind sqlite_seek sqlite_udf_decode_binary sqlite_udf_encode_binary sqlite_unbuffered_query contained
+syn keyword phpFunctions stream_context_create stream_context_get_options stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_register_wrapper stream_select stream_set_blocking stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_get_name stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_wrapper_register contained
+syn keyword phpFunctions addcslashes addslashes bin2hex chop chr chunk_split convert_cyr_string count_chars crc32 crypt echo explode fprintf get_html_translation_table hebrev hebrevc html_entity_decode htmlentities htmlspecialchars implode join levenshtein localeconv ltrim md5_file md5 metaphone money_format nl_langinfo nl2br number_format ord parse_str print printf quoted_printable_decode quotemeta rtrim setlocale sha1_file sha1 similar_text soundex sprintf sscanf str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpos strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr substr_compare substr_count substr_replace substr trim ucfirst ucwords vprintf vsprintf wordwrap contained
+syn keyword phpFunctions swf_actiongeturl swf_actiongotoframe swf_actiongotolabel swf_actionnextframe swf_actionplay swf_actionprevframe swf_actionsettarget swf_actionstop swf_actiontogglequality swf_actionwaitforframe swf_addbuttonrecord swf_addcolor swf_closefile swf_definebitmap swf_definefont swf_defineline swf_definepoly swf_definerect swf_definetext swf_endbutton swf_enddoaction swf_endshape swf_endsymbol swf_fontsize swf_fontslant swf_fonttracking swf_getbitmapinfo swf_getfontinfo swf_getframe swf_labelframe swf_lookat swf_modifyobject swf_mulcolor swf_nextid swf_oncondition swf_openfile swf_ortho2 swf_ortho swf_perspective swf_placeobject swf_polarview swf_popmatrix swf_posround swf_pushmatrix swf_removeobject swf_rotate swf_scale swf_setfont swf_setframe swf_shapearc swf_shapecurveto3 swf_shapecurveto swf_shapefillbitmapclip swf_shapefillbitmaptile swf_shapefilloff swf_shapefillsolid swf_shapelinesolid swf_shapelineto swf_shapemoveto swf_showframe swf_startbutton swf_startdoaction swf_startshape swf_startsymbol swf_textwidth swf_translate swf_viewport contained
+syn keyword phpFunctions sybase_affected_rows sybase_close sybase_connect sybase_data_seek sybase_deadlock_retry_count sybase_fetch_array sybase_fetch_assoc sybase_fetch_field sybase_fetch_object sybase_fetch_row sybase_field_seek sybase_free_result sybase_get_last_message sybase_min_client_severity sybase_min_error_severity sybase_min_message_severity sybase_min_server_severity sybase_num_fields sybase_num_rows sybase_pconnect sybase_query sybase_result sybase_select_db sybase_set_message_handler sybase_unbuffered_query contained
+syn keyword phpFunctions tidy_access_count tidy_clean_repair tidy_config_count tidy_diagnose tidy_error_count tidy_get_body tidy_get_config tidy_get_error_buffer tidy_get_head tidy_get_html_ver tidy_get_html tidy_get_output tidy_get_release tidy_get_root tidy_get_status tidy_getopt tidy_is_xhtml tidy_load_config tidy_parse_file tidy_parse_string tidy_repair_file tidy_repair_string tidy_reset_config tidy_save_config tidy_set_encoding tidy_setopt tidy_warning_count contained
+syn keyword phpMethods attributes children get_attr get_nodes has_children has_siblings is_asp is_comment is_html is_jsp is_jste is_text is_xhtml is_xml next prev tidy_node contained
+syn keyword phpFunctions token_get_all token_name contained
+syn keyword phpFunctions base64_decode base64_encode get_meta_tags http_build_query parse_url rawurldecode rawurlencode urldecode urlencode contained
+syn keyword phpFunctions doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string isset print_r serialize settype strval unserialize unset var_dump var_export contained
+syn keyword phpFunctions vpopmail_add_alias_domain_ex vpopmail_add_alias_domain vpopmail_add_domain_ex vpopmail_add_domain vpopmail_add_user vpopmail_alias_add vpopmail_alias_del_domain vpopmail_alias_del vpopmail_alias_get_all vpopmail_alias_get vpopmail_auth_user vpopmail_del_domain_ex vpopmail_del_domain vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota contained
+syn keyword phpFunctions w32api_deftype w32api_init_dtype w32api_invoke_function w32api_register_function w32api_set_call_method contained
+syn keyword phpFunctions wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars contained
+syn keyword phpFunctions utf8_decode utf8_encode xml_error_string xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_parse_into_struct xml_parse xml_parser_create_ns xml_parser_create xml_parser_free xml_parser_get_option xml_parser_set_option xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler contained
+syn keyword phpFunctions xmlrpc_decode_request xmlrpc_decode xmlrpc_encode_request xmlrpc_encode xmlrpc_get_type xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type contained
+syn keyword phpFunctions xslt_create xslt_errno xslt_error xslt_free xslt_output_process xslt_set_base xslt_set_encoding xslt_set_error_handler xslt_set_log xslt_set_sax_handler xslt_set_sax_handlers xslt_set_scheme_handler xslt_set_scheme_handlers contained
+syn keyword phpFunctions yaz_addinfo yaz_ccl_conf yaz_ccl_parse yaz_close yaz_connect yaz_database yaz_element yaz_errno yaz_error yaz_es_result yaz_get_option yaz_hits yaz_itemorder yaz_present yaz_range yaz_record yaz_scan_result yaz_scan yaz_schema yaz_search yaz_set_option yaz_sort yaz_syntax yaz_wait contained
+syn keyword phpFunctions zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read contained
+syn keyword phpFunctions gzclose gzcompress gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite readgzfile zlib_get_coding_type contained
+
+if exists( "php_baselib" )
+ syn keyword phpMethods query next_record num_rows affected_rows nf f p np num_fields haltmsg seek link_id query_id metadata table_names nextid connect halt free register unregister is_registered delete url purl self_url pself_url hidden_session add_query padd_query reimport_get_vars reimport_post_vars reimport_cookie_vars set_container set_tokenname release_token put_headers get_id get_id put_id freeze thaw gc reimport_any_vars start url purl login_if is_authenticated auth_preauth auth_loginform auth_validatelogin auth_refreshlogin auth_registerform auth_doregister start check have_perm permsum perm_invalid contained
+ syn keyword phpFunctions page_open page_close sess_load sess_save contained
+endif
+
+" Conditional
+syn keyword phpConditional declare else enddeclare endswitch elseif endif if switch contained
+
+" Repeat
+syn keyword phpRepeat as do endfor endforeach endwhile for foreach while contained
+
+" Repeat
+syn keyword phpLabel case default switch contained
+
+" Statement
+syn keyword phpStatement return break continue exit contained
+
+" Keyword
+syn keyword phpKeyword var const contained
+
+" Type
+syn keyword phpType bool[ean] int[eger] real double float string array object NULL contained
+
+" Structure
+syn keyword phpStructure extends implements instanceof parent self contained
+
+" Operator
+syn match phpOperator "[-=+%^&|*!.~?:]" contained display
+syn match phpOperator "[-+*/%^&|.]=" contained display
+syn match phpOperator "/[^*/]"me=e-1 contained display
+syn match phpOperator "\$" contained display
+syn match phpOperator "&&\|\<and\>" contained display
+syn match phpOperator "||\|\<x\=or\>" contained display
+syn match phpRelation "[!=<>]=" contained display
+syn match phpRelation "[<>]" contained display
+syn match phpMemberSelector "->" contained display
+syn match phpVarSelector "\$" contained display
+
+" Identifier
+syn match phpIdentifier "$\h\w*" contained contains=phpEnvVar,phpIntVar,phpVarSelector display
+syn match phpIdentifierSimply "${\h\w*}" contains=phpOperator,phpParent contained display
+syn region phpIdentifierComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend
+syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained
+
+" Methoden
+syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display
+
+" Include
+syn keyword phpInclude include require include_once require_once contained
+
+" Define
+syn keyword phpDefine new contained
+
+" Boolean
+syn keyword phpBoolean true false contained
+
+" Number
+syn match phpNumber "-\=\<\d\+\>" contained display
+syn match phpNumber "\<0x\x\{1,8}\>" contained display
+
+" Float
+syn match phpFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" contained display
+
+" SpecialChar
+syn match phpSpecialChar "\\[abcfnrtyv\\]" contained display
+syn match phpSpecialChar "\\\d\{3}" contained contains=phpOctalError display
+syn match phpSpecialChar "\\x\x\{2}" contained display
+
+" Error
+syn match phpOctalError "[89]" contained display
+if exists("php_parent_error_close")
+ syn match phpParentError "[)\]}]" contained display
+endif
+
+" Todo
+syn keyword phpTodo todo fixme xxx contained
+
+" Comment
+if exists("php_parent_error_open")
+ syn region phpComment start="/\*" end="\*/" contained contains=phpTodo
+else
+ syn region phpComment start="/\*" end="\*/" contained contains=phpTodo extend
+endif
+if version >= 600
+ syn match phpComment "#.\{-}\(?>\|$\)\@=" contained contains=phpTodo
+ syn match phpComment "//.\{-}\(?>\|$\)\@=" contained contains=phpTodo
+else
+ syn match phpComment "#.\{-}$" contained contains=phpTodo
+ syn match phpComment "#.\{-}?>"me=e-2 contained contains=phpTodo
+ syn match phpComment "//.\{-}$" contained contains=phpTodo
+ syn match phpComment "//.\{-}?>"me=e-2 contained contains=phpTodo
+endif
+
+" String
+if exists("php_parent_error_open")
+ syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained keepend
+ syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings contained keepend
+else
+ syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained extend keepend
+ syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings contained keepend extend
+endif
+
+" HereDoc
+if version >= 600
+ syn case match
+ syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend
+" including HTML,JavaScript,SQL even if not enabled via options
+ syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend
+ syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend
+ syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend
+ syn case ignore
+endif
+
+" Parent
+if exists("php_parent_error_close") || exists("php_parent_error_open")
+ syn match phpParent "[{}]" contained
+ syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClInside transparent
+ syn region phpParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phpClInside transparent
+ if !exists("php_parent_error_close")
+ syn match phpParent "[\])]" contained
+ endif
+else
+ syn match phpParent "[({[\]})]" contained
+endif
+
+syn cluster phpClConst contains=phpFunctions,phpIdentifier,phpConditional,phpRepeat,phpStatement,phpOperator,phpRelation,phpStringSingle,phpStringDouble,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException
+syn cluster phpClInside contains=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc
+syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass
+syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch
+
+" Php Region
+if exists("php_parent_error_open")
+ if exists("php_noShortTags")
+ syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop
+ else
+ syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop
+ endif
+ syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop
+ if exists("php_asp_tags")
+ syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop
+ endif
+else
+ if exists("php_noShortTags")
+ syn region phpRegion matchgroup=Delimiter start="<?php" end="?>" contains=@phpClTop keepend
+ else
+ syn region phpRegion matchgroup=Delimiter start="<?\(php\)\=" end="?>" contains=@phpClTop keepend
+ endif
+ syn region phpRegionSc matchgroup=Delimiter start=+<script language="php">+ end=+</script>+ contains=@phpClTop keepend
+ if exists("php_asp_tags")
+ syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop keepend
+ endif
+endif
+
+" Fold
+if exists("php_folding") && php_folding==1
+" match one line constructs here and skip them at folding
+ syn keyword phpSCKeyword abstract final private protected public static contained
+ syn keyword phpFCKeyword function contained
+ syn keyword phpStorageClass global contained
+ syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
+ syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*class\(\s\+.*}\)\@=" contained
+ syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained
+ syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained
+ syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained
+
+ set foldmethod=syntax
+ syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
+ syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend
+ syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend
+ syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*class\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
+ syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
+ syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
+ syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
+elseif exists("php_folding") && php_folding==2
+ syn keyword phpDefine function contained
+ syn keyword phpStructure abstract class interface contained
+ syn keyword phpException catch throw try contained
+ syn keyword phpStorageClass final global private protected public static contained
+
+ set foldmethod=syntax
+ syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
+ syn region phpParent matchgroup=Delimiter start="{" end="}" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold
+else
+ syn keyword phpDefine function contained
+ syn keyword phpStructure abstract class interface contained
+ syn keyword phpException catch throw try contained
+ syn keyword phpStorageClass final global private protected public static contained
+endif
+
+
+" Sync
+if php_sync_method==-1
+ if exists("php_noShortTags")
+ syn sync match phpRegionSync grouphere phpRegion "^\s*<?php\s*$"
+ else
+ syn sync match phpRegionSync grouphere phpRegion "^\s*<?\(php\)\=\s*$"
+ endif
+ syn sync match phpRegionSync grouphere phpRegionSc +^\s*<script language="php">\s*$+
+ if exists("php_asp_tags")
+ syn sync match phpRegionSync grouphere phpRegionAsp "^\s*<%\(=\)\=\s*$"
+ endif
+ syn sync match phpRegionSync grouphere NONE "^\s*?>\s*$"
+ syn sync match phpRegionSync grouphere NONE "^\s*%>\s*$"
+ syn sync match phpRegionSync grouphere phpRegion "function\s.*(.*\$"
+ "syn sync match phpRegionSync grouphere NONE "/\i*>\s*$"
+elseif php_sync_method>0
+ exec "syn sync minlines=" . php_sync_method
+else
+ exec "syn sync fromstart"
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_php_syn_inits")
+ if version < 508
+ let did_php_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink phpConstant Constant
+ HiLink phpCoreConstant Constant
+ HiLink phpComment Comment
+ HiLink phpException Exception
+ HiLink phpBoolean Boolean
+ HiLink phpStorageClass StorageClass
+ HiLink phpSCKeyword StorageClass
+ HiLink phpFCKeyword Define
+ HiLink phpStructure Structure
+ HiLink phpStringSingle String
+ HiLink phpStringDouble String
+ HiLink phpNumber Number
+ HiLink phpFloat Float
+ HiLink phpMethods Function
+ HiLink phpFunctions Function
+ HiLink phpBaselib Function
+ HiLink phpRepeat Repeat
+ HiLink phpConditional Conditional
+ HiLink phpLabel Label
+ HiLink phpStatement Statement
+ HiLink phpKeyword Statement
+ HiLink phpType Type
+ HiLink phpInclude Include
+ HiLink phpDefine Define
+ HiLink phpSpecialChar SpecialChar
+ HiLink phpParent Delimiter
+ HiLink phpIdentifierConst Delimiter
+ HiLink phpParentError Error
+ HiLink phpOctalError Error
+ HiLink phpTodo Todo
+ HiLink phpMemberSelector Structure
+ if exists("php_oldStyle")
+ hi phpIntVar guifg=Red ctermfg=DarkRed
+ hi phpEnvVar guifg=Red ctermfg=DarkRed
+ hi phpOperator guifg=SeaGreen ctermfg=DarkGreen
+ hi phpVarSelector guifg=SeaGreen ctermfg=DarkGreen
+ hi phpRelation guifg=SeaGreen ctermfg=DarkGreen
+ hi phpIdentifier guifg=DarkGray ctermfg=Brown
+ hi phpIdentifierSimply guifg=DarkGray ctermfg=Brown
+ else
+ HiLink phpIntVar Identifier
+ HiLink phpEnvVar Identifier
+ HiLink phpOperator Operator
+ HiLink phpVarSelector Operator
+ HiLink phpRelation Operator
+ HiLink phpIdentifier Identifier
+ HiLink phpIdentifierSimply Identifier
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "php"
+
+if main_syntax == 'php'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/phtml.vim b/runtime/syntax/phtml.vim
new file mode 100644
index 000000000..2ff6dd95c
--- /dev/null
+++ b/runtime/syntax/phtml.vim
@@ -0,0 +1,244 @@
+" Vim syntax file
+" Language: phtml PHP 2.0
+" Maintainer: Lutz Eymers <ixtab@polzin.com>
+" URL: http://www.isp.de/data/phtml.vim
+" Email: Subject: send syntax_vim.tgz
+" Last change: 2003 May 11
+"
+" Options phtml_sql_query = 1 for SQL syntax highligthing inside strings
+" phtml_minlines = x to sync at least x lines backwards
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'phtml'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syn cluster htmlPreproc add=phtmlRegionInsideHtmlTags
+
+if exists( "phtml_sql_query")
+ if phtml_sql_query == 1
+ syn include @phtmlSql <sfile>:p:h/sql.vim
+ unlet b:current_syntax
+ endif
+endif
+syn cluster phtmlSql remove=sqlString,sqlComment
+
+syn case match
+
+" Env Variables
+syn keyword phtmlEnvVar SERVER_SOFTWARE SERVER_NAME SERVER_URL GATEWAY_INTERFACE contained
+syn keyword phtmlEnvVar SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD PATH_INFO contained
+syn keyword phtmlEnvVar PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST contained
+syn keyword phtmlEnvVar REMOTE_ADDR AUTH_TYPE REMOTE_USER CONTEN_TYPE contained
+syn keyword phtmlEnvVar CONTENT_LENGTH HTTPS HTTPS_KEYSIZE HTTPS_SECRETKEYSIZE contained
+syn keyword phtmlEnvVar HTTP_ACCECT HTTP_USER_AGENT HTTP_IF_MODIFIED_SINCE contained
+syn keyword phtmlEnvVar HTTP_FROM HTTP_REFERER contained
+syn keyword phtmlEnvVar PHP_SELF contained
+
+syn case ignore
+
+" Internal Variables
+syn keyword phtmlIntVar phperrmsg php_self contained
+
+" Comment
+syn region phtmlComment start="/\*" end="\*/" contained contains=phtmlTodo
+
+" Function names
+syn keyword phtmlFunctions Abs Ada_Close Ada_Connect Ada_Exec Ada_FetchRow contained
+syn keyword phtmlFunctions Ada_FieldName Ada_FieldNum Ada_FieldType contained
+syn keyword phtmlFunctions Ada_FreeResult Ada_NumFields Ada_NumRows Ada_Result contained
+syn keyword phtmlFunctions Ada_ResultAll AddSlashes ASort BinDec Ceil ChDir contained
+syn keyword phtmlFunctions AdaGrp ChMod ChOwn Chop Chr ClearStack ClearStatCache contained
+syn keyword phtmlFunctions closeDir CloseLog Cos Count Crypt Date dbList contained
+syn keyword phtmlFunctions dbmClose dbmDelete dbmExists dbmFetch dbmFirstKey contained
+syn keyword phtmlFunctions dbmInsert dbmNextKey dbmOpen dbmReplace DecBin DecHex contained
+syn keyword phtmlFunctions DecOct doubleval Echo End ereg eregi ereg_replace contained
+syn keyword phtmlFunctions eregi_replace EscapeShellCmd Eval Exec Exit Exp contained
+syn keyword phtmlFunctions fclose feof fgets fgetss File fileAtime fileCtime contained
+syn keyword phtmlFunctions fileGroup fileInode fileMtime fileOwner filePerms contained
+syn keyword phtmlFunctions fileSize fileType Floor Flush fopen fputs FPassThru contained
+syn keyword phtmlFunctions fseek fsockopen ftell getAccDir GetEnv getHostByName contained
+syn keyword phtmlFunctions getHostByAddr GetImageSize getLastAcess contained
+syn keyword phtmlFunctions getLastbrowser getLastEmail getLastHost getLastMod contained
+syn keyword phtmlFunctions getLastref getLogDir getMyInode getMyPid getMyUid contained
+syn keyword phtmlFunctions getRandMax getStartLogging getToday getTotal GetType contained
+syn keyword phtmlFunctions gmDate Header HexDec HtmlSpecialChars ImageArc contained
+syn keyword phtmlFunctions ImageChar ImageCharUp IamgeColorAllocate contained
+syn keyword phtmlFunctions ImageColorTransparent ImageCopyResized ImageCreate contained
+syn keyword phtmlFunctions ImageCreateFromGif ImageDestroy ImageFill contained
+syn keyword phtmlFunctions ImageFilledPolygon ImageFilledRectangle contained
+syn keyword phtmlFunctions ImageFillToBorder ImageGif ImageInterlace ImageLine contained
+syn keyword phtmlFunctions ImagePolygon ImageRectangle ImageSetPixel contained
+syn keyword phtmlFunctions ImageString ImageStringUp ImageSX ImageSY Include contained
+syn keyword phtmlFunctions InitSyslog intval IsSet Key Link LinkInfo Log Log10 contained
+syn keyword phtmlFunctions LosAs Mail Max Md5 mi_Close mi_Connect mi_DBname contained
+syn keyword phtmlFunctions mi_Exec mi_FieldName mi_FieldNum mi_NumFields contained
+syn keyword phtmlFunctions mi_NumRows mi_Result Microtime Min MkDir MkTime msql contained
+syn keyword phtmlFunctions msql_connect msql_CreateDB msql_dbName msql_DropDB contained
+syn keyword phtmlFunctions msqlFieldFlags msql_FieldLen msql_FieldName contained
+syn keyword phtmlFunctions msql_FieldType msql_FreeResult msql_ListDBs contained
+syn keyword phtmlFunctions msql_Listfields msql_ListTables msql_NumFields contained
+syn keyword phtmlFunctions msql_NumRows msql_RegCase msql_Result msql_TableName contained
+syn keyword phtmlFunctions mysql mysql_affected_rows mysql_close mysql_connect contained
+syn keyword phtmlFunctions mysql_CreateDB mysql_dbName mysqlDropDB contained
+syn keyword phtmlFunctions mysql_FieldFlags mysql_FieldLen mysql_FieldName contained
+syn keyword phtmlFunctions mysql_FieldType mysql_FreeResult mysql_insert_id contained
+syn keyword phtmlFunctions mysql_listDBs mysql_Listfields mysql_ListTables contained
+syn keyword phtmlFunctions mysql_NumFields mysql_NumRows mysql_Result contained
+syn keyword phtmlFunctions mysql_TableName Next OctDec openDir OpenLog contained
+syn keyword phtmlFunctions Ora_Bind Ora_Close Ora_Commit Ora_CommitOff contained
+syn keyword phtmlFunctions Ora_CommitOn Ora_Exec Ora_Fetch Ora_GetColumn contained
+syn keyword phtmlFunctions Ora_Logoff Ora_Logon Ora_Parse Ora_Rollback Ord contained
+syn keyword phtmlFunctions Parse_str PassThru pclose pg_Close pg_Connect contained
+syn keyword phtmlFunctions pg_DBname pg_ErrorMessage pg_Exec pg_FieldName contained
+syn keyword phtmlFunctions pg_FieldPrtLen pg_FieldNum pg_FieldSize contained
+syn keyword phtmlFunctions pg_FieldType pg_FreeResult pg_GetLastOid pg_Host contained
+syn keyword phtmlFunctions pg_NumFields pg_NumRows pg_Options pg_Port contained
+syn keyword phtmlFunctions pg_Result pg_tty phpInfo phpVersion popen pos pow contained
+syn keyword phtmlFunctions Prev PutEnv QuoteMeta Rand readDir ReadFile ReadLink contained
+syn keyword phtmlFunctions reg_Match reg_replace reg_Search Rename Reset return contained
+syn keyword phtmlFunctions rewind rewindDir RmDir rSort SetCookie SetErrorReporting contained
+syn keyword phtmlFunctions SetLogging SetShowInfo SetType shl shr Sin Sleep contained
+syn keyword phtmlFunctions Solid_Close Solid_Connect Solid_Exec Solid_FetchRow contained
+syn keyword phtmlFunctions Solid_FieldName Solid_FieldNum Solid_FreeResult contained
+syn keyword phtmlFunctions Solid_NumFields Solid_NumRows Solid_Result Sort contained
+syn keyword phtmlFunctions Spundtex Sprintf Sqrt Srand strchr strtr contained
+syn keyword phtmlFunctions StripSlashes strlen strchr strstr strtok strtolower contained
+syn keyword phtmlFunctions strtoupper strval substr sybSQL_CheckConnect contained
+syn keyword phtmlFunctions sybSQL_DBUSE sybSQL_Connect sybSQL_Exit contained
+syn keyword phtmlFunctions sybSQL_Fieldname sybSQL_GetField sybSQL_IsRow contained
+syn keyword phtmlFunctions sybSQL_NextRow sybSQL_NumFields sybSQL_NumRows contained
+syn keyword phtmlFunctions sybSQL_Query sybSQL_Result sybSQL_Result sybSQL_Seek contained
+syn keyword phtmlFunctions Symlink syslog System Tan TempNam Time Umask UniqId contained
+syn keyword phtmlFunctions Unlink Unset UrlDecode UrlEncode USleep Virtual contained
+syn keyword phtmlFunctions SecureVar contained
+
+" Conditional
+syn keyword phtmlConditional if else elseif endif switch endswitch contained
+
+" Repeat
+syn keyword phtmlRepeat while endwhile contained
+
+" Repeat
+syn keyword phtmlLabel case default contained
+
+" Statement
+syn keyword phtmlStatement break return continue exit contained
+
+" Operator
+syn match phtmlOperator "[-=+%^&|*!]" contained
+syn match phtmlOperator "[-+*/%^&|]=" contained
+syn match phtmlOperator "/[^*]"me=e-1 contained
+syn match phtmlOperator "\$" contained
+syn match phtmlRelation "&&" contained
+syn match phtmlRelation "||" contained
+syn match phtmlRelation "[!=<>]=" contained
+syn match phtmlRelation "[<>]" contained
+
+" Identifier
+syn match phtmlIdentifier "$\h\w*" contained contains=phtmlEnvVar,phtmlIntVar,phtmlOperator
+
+
+" Include
+syn keyword phtmlInclude include contained
+
+" Definesag
+syn keyword phtmlDefine Function contained
+
+" String
+syn region phtmlString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=phtmlIdentifier,phtmlSpecialChar,@phtmlSql contained
+
+" Number
+syn match phtmlNumber "-\=\<\d\+\>" contained
+
+" Float
+syn match phtmlFloat "\(-\=\<\d+\|-\=\)\.\d\+\>" contained
+
+" SpecialChar
+syn match phtmlSpecialChar "\\[abcfnrtyv\\]" contained
+syn match phtmlSpecialChar "\\\d\{3}" contained contains=phtmlOctalError
+syn match phtmlSpecialChar "\\x[0-9a-fA-F]\{2}" contained
+
+syn match phtmlOctalError "[89]" contained
+
+
+syn match phtmlParentError "[)}\]]" contained
+
+" Todo
+syn keyword phtmlTodo TODO Todo todo contained
+
+" Parents
+syn cluster phtmlInside contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent,phtmlParentError,phtmlInclude
+
+syn cluster phtmlTop contains=@phtmlInside,phtmlInclude,phtmlDefine,phtmlParentError,phtmlTodo
+syn region phtmlParent matchgroup=Delimiter start="(" end=")" contained contains=@phtmlInside
+syn region phtmlParent matchgroup=Delimiter start="{" end="}" contained contains=@phtmlInside
+syn region phtmlParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phtmlInside
+
+syn region phtmlRegion keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|".\{-}>.\{-}"\|/\*.\{-}>.\{-}\*/+ end=">" contains=@phtmlTop
+syn region phtmlRegionInsideHtmlTags keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|/\*.\{-}>.\{-}\*/+ end=">" contains=@phtmlTop contained
+
+" sync
+if exists("phtml_minlines")
+ exec "syn sync minlines=" . phtml_minlines
+else
+ syn sync minlines=100
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_phtml_syn_inits")
+ if version < 508
+ let did_phtml_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink phtmlComment Comment
+ HiLink phtmlString String
+ HiLink phtmlNumber Number
+ HiLink phtmlFloat Float
+ HiLink phtmlIdentifier Identifier
+ HiLink phtmlIntVar Identifier
+ HiLink phtmlEnvVar Identifier
+ HiLink phtmlFunctions Function
+ HiLink phtmlRepeat Repeat
+ HiLink phtmlConditional Conditional
+ HiLink phtmlLabel Label
+ HiLink phtmlStatement Statement
+ HiLink phtmlType Type
+ HiLink phtmlInclude Include
+ HiLink phtmlDefine Define
+ HiLink phtmlSpecialChar SpecialChar
+ HiLink phtmlParentError Error
+ HiLink phtmlOctalError Error
+ HiLink phtmlTodo Todo
+ HiLink phtmlOperator Operator
+ HiLink phtmlRelation Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "phtml"
+
+if main_syntax == 'phtml'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/pic.vim b/runtime/syntax/pic.vim
new file mode 100644
index 000000000..adc964ea9
--- /dev/null
+++ b/runtime/syntax/pic.vim
@@ -0,0 +1,127 @@
+" Vim syntax file
+" Language: PIC16F84 Assembler (Microchip's microcontroller)
+" Maintainer: Aleksandar Veselinovic <aleksa@cs.cmu.com>
+" Last Change: 2003 May 11
+" URL: http://galeb.etf.bg.ac.yu/~alexa/vim/syntax/pic.vim
+" Revision: 1.01
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+syn keyword picTodo NOTE TODO XXX contained
+
+syn case ignore
+
+syn match picIdentifier "[a-z_$][a-z0-9_$]*"
+syn match picLabel "^[A-Z_$][A-Z0-9_$]*"
+syn match picLabel "^[A-Z_$][A-Z0-9_$]*:"me=e-1
+
+syn match picASCII "A\='.'"
+syn match picBinary "B'[0-1]\+'"
+syn match picDecimal "D'\d\+'"
+syn match picDecimal "\d\+"
+syn match picHexadecimal "0x\x\+"
+syn match picHexadecimal "H'\x\+'"
+syn match picHexadecimal "[0-9]\x*h"
+syn match picOctal "O'[0-7]\o*'"
+
+
+syn match picComment ";.*" contains=picTodo
+
+syn region picString start=+"+ end=+"+
+
+syn keyword picRegister INDF TMR0 PCL STATUS FSR PORTA PORTB
+syn keyword picRegister EEDATA EEADR PCLATH INTCON INDF OPTION_REG PCL
+syn keyword picRegister FSR TRISA TRISB EECON1 EECON2 INTCON OPTION
+
+
+" Register --- bits
+
+" STATUS
+syn keyword picRegisterPart IRP RP1 RP0 TO PD Z DC C
+
+" PORTA
+syn keyword picRegisterPart T0CKI
+syn match picRegisterPart "RA[0-4]"
+
+" PORTB
+syn keyword picRegisterPart INT
+syn match picRegisterPart "RB[0-7]"
+
+" INTCON
+syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
+
+" OPTION
+syn keyword picRegisterPart RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
+
+" EECON2
+syn keyword picRegisterPart EEIF WRERR WREN WR RD
+
+" INTCON
+syn keyword picRegisterPart GIE EEIE T0IE INTE RBIE T0IF INTF RBIF
+
+
+" OpCodes...
+syn keyword picOpcode ADDWF ANDWF CLRF CLRW COMF DECF DECFSZ INCF INCFSZ
+syn keyword picOpcode IORWF MOVF MOVWF NOP RLF RRF SUBWF SWAPF XORWF
+syn keyword picOpcode BCF BSF BTFSC BTFSS
+syn keyword picOpcode ADDLW ANDLW CALL CLRWDT GOTO IORLW MOVLW RETFIE
+syn keyword picOpcode RETLW RETURN SLEEP SUBLW XORLW
+syn keyword picOpcode GOTO
+
+
+" Directives
+syn keyword picDirective __BADRAM BANKISEL BANKSEL CBLOCK CODE __CONFIG
+syn keyword picDirective CONSTANT DATA DB DE DT DW ELSE END ENDC
+syn keyword picDirective ENDIF ENDM ENDW EQU ERROR ERRORLEVEL EXITM EXPAND
+syn keyword picDirective EXTERN FILL GLOBAL IDATA __IDLOCS IF IFDEF IFNDEF
+syn keyword picDirective INCLUDE LIST LOCAL MACRO __MAXRAM MESSG NOEXPAND
+syn keyword picDirective NOLIST ORG PAGE PAGESEL PROCESSOR RADIX RES SET
+syn keyword picDirective SPACE SUBTITLE TITLE UDATA UDATA_OVR UDATA_SHR
+syn keyword picDirective VARIABLE WHILE INCLUDE
+syn match picDirective "#\=UNDEFINE"
+syn match picDirective "#\=INCLUDE"
+syn match picDirective "#\=DEFINE"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pic16f84_syntax_inits")
+ if version < 508
+ let did_pic16f84_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink picTodo Todo
+ HiLink picComment Comment
+ HiLink picDirective Statement
+ HiLink picLabel Label
+ HiLink picString String
+
+ "HiLink picOpcode Keyword
+ "HiLink picRegister Structure
+ "HiLink picRegisterPart Special
+
+ HiLink picASCII String
+ HiLink picBinary Number
+ HiLink picDecimal Number
+ HiLink picHexadecimal Number
+ HiLink picOctal Number
+
+ HiLink picIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pic"
+
+" vim: ts=8
diff --git a/runtime/syntax/pike.vim b/runtime/syntax/pike.vim
new file mode 100644
index 000000000..efbafd5d8
--- /dev/null
+++ b/runtime/syntax/pike.vim
@@ -0,0 +1,155 @@
+" Vim syntax file
+" Language: Pike
+" Maintainer: Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
+" Last Change: 2001 May 10
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful C keywords
+syn keyword pikeStatement goto break return continue
+syn keyword pikeLabel case default
+syn keyword pikeConditional if else switch
+syn keyword pikeRepeat while for foreach do
+syn keyword pikeStatement gauge destruct lambda inherit import typeof
+syn keyword pikeException catch
+syn keyword pikeType inline nomask private protected public static
+
+
+syn keyword pikeTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match pikeSpecial contained "\\[0-7][0-7][0-7]\=\|\\."
+syn region pikeString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pikeSpecial
+syn match pikeCharacter "'[^\\]'"
+syn match pikeSpecialCharacter "'\\.'"
+syn match pikeSpecialCharacter "'\\[0-7][0-7]'"
+syn match pikeSpecialCharacter "'\\[0-7][0-7][0-7]'"
+
+" Compound data types
+syn region pikeCompoundType start='({' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='})'
+syn region pikeCompoundType start='(\[' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='\])'
+syn region pikeCompoundType start='(<' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='>)'
+
+"catch errors caused by wrong parenthesis
+syn region pikeParen transparent start='([^{[<(]' end=')' contains=ALLBUT,pikeParenError,pikeIncluded,pikeSpecial,pikeTodo,pikeUserLabel,pikeBitField
+syn match pikeParenError ")"
+syn match pikeInParen contained "[^(][{}][^)]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match pikeNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match pikeFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match pikeFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match pikeFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match pikeNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+"syn match pikeIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+" flag an octal number with wrong digits
+syn match pikeOctalError "\<0[0-7]*[89]"
+
+if exists("c_comment_strings")
+ " A comment can contain pikeString, pikeCharacter and pikeNumber.
+ " But a "*/" inside a pikeString in a pikeComment DOES end the comment! So we
+ " need to use a special type of pikeString: pikeCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match pikeCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region pikeCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=pikeSpecial,pikeCommentSkip
+ syntax region pikeComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=pikeSpecial
+ syntax region pikeComment start="/\*" end="\*/" contains=pikeTodo,pikeCommentString,pikeCharacter,pikeNumber,pikeFloat
+ syntax match pikeComment "//.*" contains=pikeTodo,pikeComment2String,pikeCharacter,pikeNumber
+ syntax match pikeComment "#\!.*" contains=pikeTodo,pikeComment2String,pikeCharacter,pikeNumber
+else
+ syn region pikeComment start="/\*" end="\*/" contains=pikeTodo
+ syn match pikeComment "//.*" contains=pikeTodo
+ syn match pikeComment "#!.*" contains=pikeTodo
+endif
+syntax match pikeCommentError "\*/"
+
+syn keyword pikeOperator sizeof
+syn keyword pikeType int string void float mapping array multiset mixed
+syn keyword pikeType program object function
+
+syn region pikePreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=pikeComment,pikeString,pikeCharacter,pikeNumber,pikeCommentError
+syn region pikeIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match pikeIncluded contained "<[^>]*>"
+syn match pikeInclude "^\s*#\s*include\>\s*["<]" contains=pikeIncluded
+"syn match pikeLineSkip "\\$"
+syn region pikeDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,pikePreCondit,pikeIncluded,pikeInclude,pikeDefine,pikeInParen
+syn region pikePreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,pikePreCondit,pikeIncluded,pikeInclude,pikeDefine,pikeInParen
+
+" Highlight User Labels
+syn region pikeMulti transparent start='?' end=':' contains=ALLBUT,pikeIncluded,pikeSpecial,pikeTodo,pikeUserLabel,pikeBitField
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+syn match pikeUserLabel "^\s*\I\i*\s*:$"
+syn match pikeUserLabel ";\s*\I\i*\s*:$"ms=s+1
+syn match pikeUserLabel "^\s*\I\i*\s*:[^:]"me=e-1
+syn match pikeUserLabel ";\s*\I\i*\s*:[^:]"ms=s+1,me=e-1
+
+" Avoid recognizing most bitfields as labels
+syn match pikeBitField "^\s*\I\i*\s*:\s*[1-9]"me=e-1
+syn match pikeBitField ";\s*\I\i*\s*:\s*[1-9]"me=e-1
+
+syn sync ccomment pikeComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pike_syntax_inits")
+ if version < 508
+ let did_pike_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pikeLabel Label
+ HiLink pikeUserLabel Label
+ HiLink pikeConditional Conditional
+ HiLink pikeRepeat Repeat
+ HiLink pikeCharacter Character
+ HiLink pikeSpecialCharacter pikeSpecial
+ HiLink pikeNumber Number
+ HiLink pikeFloat Float
+ HiLink pikeOctalError pikeError
+ HiLink pikeParenError pikeError
+ HiLink pikeInParen pikeError
+ HiLink pikeCommentError pikeError
+ HiLink pikeOperator Operator
+ HiLink pikeInclude Include
+ HiLink pikePreProc PreProc
+ HiLink pikeDefine Macro
+ HiLink pikeIncluded pikeString
+ HiLink pikeError Error
+ HiLink pikeStatement Statement
+ HiLink pikePreCondit PreCondit
+ HiLink pikeType Type
+ HiLink pikeCommentError pikeError
+ HiLink pikeCommentString pikeString
+ HiLink pikeComment2String pikeString
+ HiLink pikeCommentSkip pikeComment
+ HiLink pikeString String
+ HiLink pikeComment Comment
+ HiLink pikeSpecial SpecialChar
+ HiLink pikeTodo Todo
+ HiLink pikeException pikeStatement
+ HiLink pikeCompoundType Constant
+ "HiLink pikeIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pike"
+
+" vim: ts=8
diff --git a/runtime/syntax/pilrc.vim b/runtime/syntax/pilrc.vim
new file mode 100644
index 000000000..86d561158
--- /dev/null
+++ b/runtime/syntax/pilrc.vim
@@ -0,0 +1,148 @@
+" Vim syntax file
+" Language: pilrc - a resource compiler for Palm OS development
+" Maintainer: Brian Schau <brian@schau.com>
+" Last change: 2003 May 11
+" Available on: http://www.schau.com/pilrcvim/pilrc.vim
+
+" Remove any old syntax
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Notes: TRANSPARENT, FONT and FONT ID are defined in the specials
+" section below. Beware of the order of the specials!
+" Look in the syntax.txt and usr_27.txt files in vim\vim{version}\doc
+" directory for regexps etc.
+
+" Keywords - basic
+syn keyword pilrcKeyword ALERT APPLICATION APPLICATIONICONNAME AREA
+syn keyword pilrcKeyword BITMAP BITMAPCOLOR BITMAPCOLOR16 BITMAPCOLOR16K
+syn keyword pilrcKeyword BITMAPFAMILY BITMAPFAMILYEX BITMAPFAMILYSPECIAL
+syn keyword pilrcKeyword BITMAPGREY BITMAPGREY16 BITMAPSCREENFAMILY
+syn keyword pilrcKeyword BOOTSCREENFAMILY BUTTON BUTTONS BYTELIST
+syn keyword pilrcKeyword CATEGORIES CHECKBOX COUNTRYLOCALISATION
+syn keyword pilrcKeyword DATA
+syn keyword pilrcKeyword FEATURE FIELD FONTINDEX FORM FORMBITMAP
+syn keyword pilrcKeyword GADGET GENERATEHEADER
+syn keyword pilrcKeyword GRAFFITIINPUTAREA GRAFFITISTATEINDICATOR
+syn keyword pilrcKeyword HEX
+syn keyword pilrcKeyword ICON ICONFAMILY ICONFAMILYEX INTEGER
+syn keyword pilrcKeyword KEYBOARD
+syn keyword pilrcKeyword LABEL LAUNCHERCATEGORY LIST LONGWORDLIST
+syn keyword pilrcKeyword MENU MENUITEM MESSAGE MIDI
+syn keyword pilrcKeyword PALETTETABLE POPUPLIST POPUPTRIGGER
+syn keyword pilrcKeyword PULLDOWN PUSHBUTTON
+syn keyword pilrcKeyword REPEATBUTTON RESETAUTOID
+syn keyword pilrcKeyword SCROLLBAR SELECTORTRIGGER SLIDER SMALLICON
+syn keyword pilrcKeyword SMALLICONFAMILY SMALLICONFAMILYEX STRING STRINGTABLE
+syn keyword pilrcKeyword TABLE TITLE TRANSLATION TRAP
+syn keyword pilrcKeyword VERSION
+syn keyword pilrcKeyword WORDLIST
+
+" Types
+syn keyword pilrcType AT AUTOSHIFT
+syn keyword pilrcType BACKGROUNDID BITMAPID BOLDFRAME BPP
+syn keyword pilrcType CHECKED COLORTABLE COLUMNS COLUMNWIDTHS COMPRESS
+syn keyword pilrcType COMPRESSBEST COMPRESSPACKBITS COMPRESSRLE COMPRESSSCANLINE
+syn keyword pilrcType CONFIRMATION COUNTRY CREATOR CURRENCYDECIMALPLACES
+syn keyword pilrcType CURRENCYNAME CURRENCYSYMBOL CURRENCYUNIQUESYMBOL
+syn keyword pilrcType DATEFORMAT DAYLIGHTSAVINGS DEFAULTBTNID DEFAULTBUTTON
+syn keyword pilrcType DENSITY DISABLED DYNAMICSIZE
+syn keyword pilrcType EDITABLE ENTRY ERROR EXTENDED
+syn keyword pilrcType FEEDBACK FILE FONTID FORCECOMPRESS FRAME
+syn keyword pilrcType GRAFFITI GRAPHICAL GROUP
+syn keyword pilrcType HASSCROLLBAR HELPID
+syn keyword pilrcType ID INDEX INFORMATION
+syn keyword pilrcType KEYDOWNCHR KEYDOWNKEYCODE KEYDOWNMODIFIERS
+syn keyword pilrcType LANGUAGE LEFTALIGN LEFTANCHOR LONGDATEFORMAT
+syn keyword pilrcType MAX MAXCHARS MEASUREMENTSYSTEM MENUID MIN LOCALE
+syn keyword pilrcType MINUTESWESTOFGMT MODAL MULTIPLELINES
+syn keyword pilrcType NAME NOCOLORTABLE NOCOMPRESS NOFRAME NONEDITABLE
+syn keyword pilrcType NONEXTENDED NONUSABLE NOSAVEBEHIND NUMBER NUMBERFORMAT
+syn keyword pilrcType NUMERIC
+syn keyword pilrcType PAGESIZE
+syn keyword pilrcType RECTFRAME RIGHTALIGN RIGHTANCHOR ROWS
+syn keyword pilrcType SAVEBEHIND SEARCH SCREEN SELECTEDBITMAPID SINGLELINE
+syn keyword pilrcType THUMBID TRANSPARENTINDEX TIMEFORMAT
+syn keyword pilrcType UNDERLINED USABLE
+syn keyword pilrcType VALUE VERTICAL VISIBLEITEMS
+syn keyword pilrcType WARNING WEEKSTARTDAY
+
+" Country
+syn keyword pilrcCountry Australia Austria Belgium Brazil Canada Denmark
+syn keyword pilrcCountry Finland France Germany HongKong Iceland Indian
+syn keyword pilrcCountry Indonesia Ireland Italy Japan Korea Luxembourg Malaysia
+syn keyword pilrcCountry Mexico Netherlands NewZealand Norway Philippines
+syn keyword pilrcCountry RepChina Singapore Spain Sweden Switzerland Thailand
+syn keyword pilrcCountry Taiwan UnitedKingdom UnitedStates
+
+" Language
+syn keyword pilrcLanguage English French German Italian Japanese Spanish
+
+" String
+syn match pilrcString "\"[^"]*\""
+
+" Number
+syn match pilrcNumber "\<0x\x\+\>"
+syn match pilrcNumber "\<\d\+\>"
+
+" Comment
+syn region pilrcComment start="/\*" end="\*/"
+syn region pilrcComment start="//" end="$"
+
+" Constants
+syn keyword pilrcConstant AUTO AUTOID BOTTOM CENTER PREVBOTTOM PREVHEIGHT
+syn keyword pilrcConstant PREVLEFT PREVRIGHT PREVTOP PREVWIDTH RIGHT
+syn keyword pilrcConstant SEPARATOR
+
+" Identifier
+syn match pilrcIdentifier "\<\h\w*\>"
+
+" Specials
+syn match pilrcType "\<FONT\>"
+syn match pilrcKeyword "\<FONT\>\s*\<ID\>"
+syn match pilrcType "\<TRANSPARENT\>"
+
+" Function
+syn keyword pilrcFunction BEGIN END
+
+" Include
+syn match pilrcInclude "\#include"
+syn match pilrcInclude "\#define"
+syn keyword pilrcInclude equ
+syn keyword pilrcInclude package
+syn region pilrcInclude start="public class" end="}"
+
+syn sync ccomment pilrcComment
+
+if version >= 508 || !exists("did_pilrc_syntax_inits")
+ if version < 508
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ let did_pilrc_syntax_inits = 1
+
+ " The default methods for highlighting
+ HiLink pilrcKeyword Statement
+ HiLink pilrcType Type
+ HiLink pilrcError Error
+ HiLink pilrcCountry SpecialChar
+ HiLink pilrcLanguage SpecialChar
+ HiLink pilrcString SpecialChar
+ HiLink pilrcNumber Number
+ HiLink pilrcComment Comment
+ HiLink pilrcConstant Constant
+ HiLink pilrcFunction Function
+ HiLink pilrcInclude SpecialChar
+ HiLink pilrcIdentifier Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pilrc"
diff --git a/runtime/syntax/pine.vim b/runtime/syntax/pine.vim
new file mode 100644
index 000000000..749535e1a
--- /dev/null
+++ b/runtime/syntax/pine.vim
@@ -0,0 +1,372 @@
+" Vim syntax file
+" Language: Pine (email program) run commands
+" Maintainer: David Pascoe <pascoedj@spamcop.net>
+" Last Change: Thu Feb 27 10:18:48 WST 2003, update for pine 4.53
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,128-167,224-235,-,
+else
+ set iskeyword=@,48-57,_,128-167,224-235,-,
+endif
+
+syn keyword pineConfig addrbook-sort-rule
+syn keyword pineConfig address-book
+syn keyword pineConfig addressbook-formats
+syn keyword pineConfig alt-addresses
+syn keyword pineConfig bugs-additional-data
+syn keyword pineConfig bugs-address
+syn keyword pineConfig bugs-fullname
+syn keyword pineConfig character-set
+syn keyword pineConfig color-style
+syn keyword pineConfig compose-mime
+syn keyword pineConfig composer-wrap-column
+syn keyword pineConfig current-indexline-style
+syn keyword pineConfig cursor-style
+syn keyword pineConfig customized-hdrs
+syn keyword pineConfig debug-memory
+syn keyword pineConfig default-composer-hdrs
+syn keyword pineConfig default-fcc
+syn keyword pineConfig default-saved-msg-folder
+syn keyword pineConfig disable-these-authenticators
+syn keyword pineConfig disable-these-drivers
+syn keyword pineConfig display-filters
+syn keyword pineConfig download-command
+syn keyword pineConfig download-command-prefix
+syn keyword pineConfig editor
+syn keyword pineConfig elm-style-save
+syn keyword pineConfig empty-header-message
+syn keyword pineConfig fcc-name-rule
+syn keyword pineConfig feature-level
+syn keyword pineConfig feature-list
+syn keyword pineConfig file-directory
+syn keyword pineConfig folder-collections
+syn keyword pineConfig folder-extension
+syn keyword pineConfig folder-sort-rule
+syn keyword pineConfig font-char-set
+syn keyword pineConfig font-name
+syn keyword pineConfig font-size
+syn keyword pineConfig font-style
+syn keyword pineConfig forced-abook-entry
+syn keyword pineConfig form-letter-folder
+syn keyword pineConfig global-address-book
+syn keyword pineConfig goto-default-rule
+syn keyword pineConfig header-in-reply
+syn keyword pineConfig image-viewer
+syn keyword pineConfig inbox-path
+syn keyword pineConfig incoming-archive-folders
+syn keyword pineConfig incoming-folders
+syn keyword pineConfig incoming-startup-rule
+syn keyword pineConfig index-answered-background-color
+syn keyword pineConfig index-answered-foreground-color
+syn keyword pineConfig index-deleted-background-color
+syn keyword pineConfig index-deleted-foreground-color
+syn keyword pineConfig index-format
+syn keyword pineConfig index-important-background-color
+syn keyword pineConfig index-important-foreground-color
+syn keyword pineConfig index-new-background-color
+syn keyword pineConfig index-new-foreground-color
+syn keyword pineConfig index-recent-background-color
+syn keyword pineConfig index-recent-foreground-color
+syn keyword pineConfig index-to-me-background-color
+syn keyword pineConfig index-to-me-foreground-color
+syn keyword pineConfig index-unseen-background-color
+syn keyword pineConfig index-unseen-foreground-color
+syn keyword pineConfig initial-keystroke-list
+syn keyword pineConfig kblock-passwd-count
+syn keyword pineConfig keylabel-background-color
+syn keyword pineConfig keylabel-foreground-color
+syn keyword pineConfig keyname-background-color
+syn keyword pineConfig keyname-foreground-color
+syn keyword pineConfig last-time-prune-questioned
+syn keyword pineConfig last-version-used
+syn keyword pineConfig ldap-servers
+syn keyword pineConfig literal-signature
+syn keyword pineConfig local-address
+syn keyword pineConfig local-fullname
+syn keyword pineConfig mail-check-interval
+syn keyword pineConfig mail-directory
+syn keyword pineConfig mailcap-search-path
+syn keyword pineConfig mimetype-search-path
+syn keyword pineConfig new-version-threshold
+syn keyword pineConfig news-active-file-path
+syn keyword pineConfig news-collections
+syn keyword pineConfig news-spool-directory
+syn keyword pineConfig newsrc-path
+syn keyword pineConfig nntp-server
+syn keyword pineConfig normal-background-color
+syn keyword pineConfig normal-foreground-color
+syn keyword pineConfig old-style-reply
+syn keyword pineConfig operating-dir
+syn keyword pineConfig patterns
+syn keyword pineConfig patterns-filters
+syn keyword pineConfig patterns-filters2
+syn keyword pineConfig patterns-indexcolors
+syn keyword pineConfig patterns-other
+syn keyword pineConfig patterns-roles
+syn keyword pineConfig patterns-scores
+syn keyword pineConfig patterns-scores2
+syn keyword pineConfig personal-name
+syn keyword pineConfig personal-print-category
+syn keyword pineConfig personal-print-command
+syn keyword pineConfig postponed-folder
+syn keyword pineConfig print-font-char-set
+syn keyword pineConfig print-font-name
+syn keyword pineConfig print-font-size
+syn keyword pineConfig print-font-style
+syn keyword pineConfig printer
+syn keyword pineConfig prompt-background-color
+syn keyword pineConfig prompt-foreground-color
+syn keyword pineConfig pruned-folders
+syn keyword pineConfig pruning-rule
+syn keyword pineConfig quote1-background-color
+syn keyword pineConfig quote1-foreground-color
+syn keyword pineConfig quote2-background-color
+syn keyword pineConfig quote2-foreground-color
+syn keyword pineConfig quote3-background-color
+syn keyword pineConfig quote3-foreground-color
+syn keyword pineConfig read-message-folder
+syn keyword pineConfig remote-abook-history
+syn keyword pineConfig remote-abook-metafile
+syn keyword pineConfig remote-abook-validity
+syn keyword pineConfig reply-indent-string
+syn keyword pineConfig reply-leadin
+syn keyword pineConfig reverse-background-color
+syn keyword pineConfig reverse-foreground-color
+syn keyword pineConfig rsh-command
+syn keyword pineConfig rsh-open-timeout
+syn keyword pineConfig rsh-path
+syn keyword pineConfig save-by-sender
+syn keyword pineConfig saved-msg-name-rule
+syn keyword pineConfig scroll-margin
+syn keyword pineConfig selectable-item-background-color
+syn keyword pineConfig selectable-item-foreground-color
+syn keyword pineConfig sending-filters
+syn keyword pineConfig sendmail-path
+syn keyword pineConfig show-all-characters
+syn keyword pineConfig signature-file
+syn keyword pineConfig smtp-server
+syn keyword pineConfig sort-key
+syn keyword pineConfig speller
+syn keyword pineConfig ssh-command
+syn keyword pineConfig ssh-open-timeout
+syn keyword pineConfig ssh-path
+syn keyword pineConfig standard-printer
+syn keyword pineConfig status-background-color
+syn keyword pineConfig status-foreground-color
+syn keyword pineConfig status-message-delay
+syn keyword pineConfig suggest-address
+syn keyword pineConfig suggest-fullname
+syn keyword pineConfig tcp-open-timeout
+syn keyword pineConfig tcp-query-timeout
+syn keyword pineConfig tcp-read-warning-timeout
+syn keyword pineConfig tcp-write-warning-timeout
+syn keyword pineConfig threading-display-style
+syn keyword pineConfig threading-expanded-character
+syn keyword pineConfig threading-index-style
+syn keyword pineConfig threading-indicator-character
+syn keyword pineConfig threading-lastreply-character
+syn keyword pineConfig title-background-color
+syn keyword pineConfig title-foreground-color
+syn keyword pineConfig titlebar-color-style
+syn keyword pineConfig upload-command
+syn keyword pineConfig upload-command-prefix
+syn keyword pineConfig url-viewers
+syn keyword pineConfig use-only-domain-name
+syn keyword pineConfig user-domain
+syn keyword pineConfig user-id
+syn keyword pineConfig user-id
+syn keyword pineConfig user-input-timeout
+syn keyword pineConfig viewer-hdr-colors
+syn keyword pineConfig viewer-hdrs
+syn keyword pineConfig viewer-overlap
+syn keyword pineConfig window-position
+
+syn keyword pineOption allow-changing-from
+syn keyword pineOption allow-talk
+syn keyword pineOption alternate-compose-menu
+syn keyword pineOption assume-slow-link
+syn keyword pineOption auto-move-read-msgs
+syn keyword pineOption auto-open-next-unread
+syn keyword pineOption auto-unzoom-after-apply
+syn keyword pineOption auto-zoom-after-select
+syn keyword pineOption cache-remote-pinerc
+syn keyword pineOption check-newmail-when-quitting
+syn keyword pineOption combined-addrbook-display
+syn keyword pineOption combined-folder-display
+syn keyword pineOption combined-subdirectory-display
+syn keyword pineOption compose-cut-from-cursor
+syn keyword pineOption compose-maps-delete-key-to-ctrl-d
+syn keyword pineOption compose-rejects-unqualified-addrs
+syn keyword pineOption compose-send-offers-first-filter
+syn keyword pineOption compose-sets-newsgroup-without-confirm
+syn keyword pineOption confirm-role-even-for-default
+syn keyword pineOption continue-tab-without-confirm
+syn keyword pineOption delete-skips-deleted
+syn keyword pineOption disable-2022-jp-conversions
+syn keyword pineOption disable-busy-alarm
+syn keyword pineOption disable-charset-conversions
+syn keyword pineOption disable-config-cmd
+syn keyword pineOption disable-keyboard-lock-cmd
+syn keyword pineOption disable-keymenu
+syn keyword pineOption disable-password-caching
+syn keyword pineOption disable-password-cmd
+syn keyword pineOption disable-pipes-in-sigs
+syn keyword pineOption disable-pipes-in-templates
+syn keyword pineOption disable-roles-setup-cmd
+syn keyword pineOption disable-roles-sig-edit
+syn keyword pineOption disable-roles-template-edit
+syn keyword pineOption disable-sender
+syn keyword pineOption disable-shared-namespaces
+syn keyword pineOption disable-signature-edit-cmd
+syn keyword pineOption disable-take-last-comma-first
+syn keyword pineOption enable-8bit-esmtp-negotiation
+syn keyword pineOption enable-8bit-nntp-posting
+syn keyword pineOption enable-aggregate-command-set
+syn keyword pineOption enable-alternate-editor-cmd
+syn keyword pineOption enable-alternate-editor-implicitly
+syn keyword pineOption enable-arrow-navigation
+syn keyword pineOption enable-arrow-navigation-relaxed
+syn keyword pineOption enable-background-sending
+syn keyword pineOption enable-bounce-cmd
+syn keyword pineOption enable-cruise-mode
+syn keyword pineOption enable-cruise-mode-delete
+syn keyword pineOption enable-delivery-status-notification
+syn keyword pineOption enable-dot-files
+syn keyword pineOption enable-dot-folders
+syn keyword pineOption enable-exit-via-lessthan-command
+syn keyword pineOption enable-fast-recent-test
+syn keyword pineOption enable-flag-cmd
+syn keyword pineOption enable-flag-screen-implicitly
+syn keyword pineOption enable-full-header-and-text
+syn keyword pineOption enable-full-header-cmd
+syn keyword pineOption enable-goto-in-file-browser
+syn keyword pineOption enable-incoming-folders
+syn keyword pineOption enable-jump-shortcut
+syn keyword pineOption enable-lame-list-mode
+syn keyword pineOption enable-mail-check-cue
+syn keyword pineOption enable-mailcap-param-substitution
+syn keyword pineOption enable-mouse-in-xterm
+syn keyword pineOption enable-msg-view-addresses
+syn keyword pineOption enable-msg-view-attachments
+syn keyword pineOption enable-msg-view-forced-arrows
+syn keyword pineOption enable-msg-view-urls
+syn keyword pineOption enable-msg-view-web-hostnames
+syn keyword pineOption enable-newmail-in-xterm-icon
+syn keyword pineOption enable-partial-match-lists
+syn keyword pineOption enable-print-via-y-command
+syn keyword pineOption enable-reply-indent-string-editing
+syn keyword pineOption enable-rules-under-take
+syn keyword pineOption enable-search-and-replace
+syn keyword pineOption enable-sigdashes
+syn keyword pineOption enable-suspend
+syn keyword pineOption enable-tab-completion
+syn keyword pineOption enable-take-export
+syn keyword pineOption enable-tray-icon
+syn keyword pineOption enable-unix-pipe-cmd
+syn keyword pineOption enable-verbose-smtp-posting
+syn keyword pineOption expanded-view-of-addressbooks
+syn keyword pineOption expanded-view-of-distribution-lists
+syn keyword pineOption expanded-view-of-folders
+syn keyword pineOption expose-hidden-config
+syn keyword pineOption expunge-only-manually
+syn keyword pineOption expunge-without-confirm
+syn keyword pineOption expunge-without-confirm-everywhere
+syn keyword pineOption fcc-on-bounce
+syn keyword pineOption fcc-only-without-confirm
+syn keyword pineOption fcc-without-attachments
+syn keyword pineOption include-attachments-in-reply
+syn keyword pineOption include-header-in-reply
+syn keyword pineOption include-text-in-reply
+syn keyword pineOption ldap-result-to-addrbook-add
+syn keyword pineOption mark-fcc-seen
+syn keyword pineOption mark-for-cc
+syn keyword pineOption news-approximates-new-status
+syn keyword pineOption news-deletes-across-groups
+syn keyword pineOption news-offers-catchup-on-close
+syn keyword pineOption news-post-without-validation
+syn keyword pineOption news-read-in-newsrc-order
+syn keyword pineOption next-thread-without-confirm
+syn keyword pineOption old-growth
+syn keyword pineOption pass-control-characters-as-is
+syn keyword pineOption prefer-plain-text
+syn keyword pineOption preserve-start-stop-characters
+syn keyword pineOption print-formfeed-between-messages
+syn keyword pineOption print-includes-from-line
+syn keyword pineOption print-index-enabled
+syn keyword pineOption print-offers-custom-cmd-prompt
+syn keyword pineOption quell-attachment-extra-prompt
+syn keyword pineOption quell-berkeley-format-timezone
+syn keyword pineOption quell-content-id
+syn keyword pineOption quell-dead-letter-on-cancel
+syn keyword pineOption quell-empty-directories
+syn keyword pineOption quell-extra-post-prompt
+syn keyword pineOption quell-folder-internal-msg
+syn keyword pineOption quell-imap-envelope-update
+syn keyword pineOption quell-lock-failure-warnings
+syn keyword pineOption quell-maildomain-warning
+syn keyword pineOption quell-news-envelope-update
+syn keyword pineOption quell-partial-fetching
+syn keyword pineOption quell-ssl-largeblocks
+syn keyword pineOption quell-status-message-beeping
+syn keyword pineOption quell-timezone-comment-when-sending
+syn keyword pineOption quell-user-lookup-in-passwd-file
+syn keyword pineOption quit-without-confirm
+syn keyword pineOption reply-always-uses-reply-to
+syn keyword pineOption save-aggregates-copy-sequence
+syn keyword pineOption save-will-advance
+syn keyword pineOption save-will-not-delete
+syn keyword pineOption save-will-quote-leading-froms
+syn keyword pineOption scramble-message-id
+syn keyword pineOption select-without-confirm
+syn keyword pineOption selectable-item-nobold
+syn keyword pineOption separate-folder-and-directory-entries
+syn keyword pineOption show-cursor
+syn keyword pineOption show-plain-text-internally
+syn keyword pineOption show-selected-in-boldface
+syn keyword pineOption signature-at-bottom
+syn keyword pineOption single-column-folder-list
+syn keyword pineOption slash-collapses-entire-thread
+syn keyword pineOption spell-check-before-sending
+syn keyword pineOption store-window-position-in-config
+syn keyword pineOption strip-from-sigdashes-on-reply
+syn keyword pineOption tab-visits-next-new-message-only
+syn keyword pineOption termdef-takes-precedence
+syn keyword pineOption thread-index-shows-important-color
+syn keyword pineOption try-alternative-authentication-driver-first
+syn keyword pineOption unselect-will-not-advance
+syn keyword pineOption use-current-dir
+syn keyword pineOption use-function-keys
+syn keyword pineOption use-sender-not-x-sender
+syn keyword pineOption use-subshell-for-suspend
+syn keyword pineOption vertical-folder-list
+
+syn match pineComment "^#.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pine_syn_inits")
+ if version < 508
+ let did_pine_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink pineConfig Type
+ HiLink pineComment Comment
+ HiLink pineOption Macro
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pine"
+
+" vim: ts=8
diff --git a/runtime/syntax/pinfo.vim b/runtime/syntax/pinfo.vim
new file mode 100644
index 000000000..aaef71289
--- /dev/null
+++ b/runtime/syntax/pinfo.vim
@@ -0,0 +1,134 @@
+" Vim syntax file
+" Language: pinfo(1) configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/
+" Latest Revision: 2004-05-22
+" arch-tag: da2cfa1c-0350-45dc-b2d2-2bf3915bd0a2
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,_,-
+delcommand SetIsk
+
+" Ignore Case
+syn case ignore
+
+" Todo
+syn keyword pinfoTodo contained FIXME TODO XXX NOTE
+
+" Comments
+syn region pinfoComment start='^#' end='$' contains=pinfoTodo
+
+" Keywords
+syn keyword pinfoOptions MANUAL CUT-MAN-HEADERS CUT-EMPTY-MAN-LINES
+syn keyword pinfoOptions RAW-FILENAME APROPOS DONT-HANDLE-WITHOUT-TAG-TABLE
+syn keyword pinfoOptions HTTPVIEWER FTPVIEWER MAILEDITOR PRINTUTILITY
+syn keyword pinfoOptions MANLINKS INFOPATH MAN-OPTIONS STDERR-REDIRECTION
+syn keyword pinfoOptions LONG-MANUAL-LINKS FILTER-0xB7 QUIT-CONFIRMATION
+syn keyword pinfoOptions QUIT-CONFIRM-DEFAULT CLEAR-SCREEN-AT-EXIT
+syn keyword pinfoOptions CALL-READLINE-HISTORY HIGHLIGHTREGEXP SAFE-USER
+syn keyword pinfoOptions SAFE-GROUP
+
+" Colors
+syn keyword pinfoColors COL_NORMAL COL_TOPLINE COL_BOTTOMLINE COL_MENU
+syn keyword pinfoColors COL_MENUSELECTED COL_NOTE COL_NOTESELECTED COL_URL
+syn keyword pinfoColors COL_URLSELECTED COL_INFOHIGHLIGHT COL_MANUALBOLD
+syn keyword pinfoColors COL_MANUALITALIC
+syn keyword pinfoColorDefault COLOR_DEFAULT
+syn keyword pinfoColorBold BOLD
+syn keyword pinfoColorNoBold NO_BOLD
+syn keyword pinfoColorBlink BLINK
+syn keyword pinfoColorNoBlink NO_BLINK
+syn keyword pinfoColorBlack COLOR_BLACK
+syn keyword pinfoColorRed COLOR_RED
+syn keyword pinfoColorGreen COLOR_GREEN
+syn keyword pinfoColorYellow COLOR_YELLOW
+syn keyword pinfoColorBlue COLOR_BLUE
+syn keyword pinfoColorMagenta COLOR_MAGENTA
+syn keyword pinfoColorCyan COLOR_CYAN
+syn keyword pinfoColorWhite COLOR_WHITE
+
+" Keybindings
+syn keyword pinfoKeys KEY_TOTALSEARCH_1 KEY_TOTALSEARCH_2 KEY_SEARCH_1
+syn keyword pinfoKeys KEY_SEARCH_2 KEY_SEARCH_AGAIN_1 KEY_SEARCH_AGAIN_2
+syn keyword pinfoKeys KEY_GOTO_1 KEY_GOTO_2 KEY_PREVNODE_1 KEY_PREVNODE_2
+syn keyword pinfoKeys KEY_NEXTNODE_1 KEY_NEXTNODE_2 KEY_UP_1 KEY_UP_2
+syn keyword pinfoKeys KEY_END_1 KEY_END_2 KEY_PGDN_1 KEY_PGDN_2
+syn keyword pinfoKeys KEY_PGDN_AUTO_1 KEY_PGDN_AUTO_2 KEY_HOME_1 KEY_HOME_2
+syn keyword pinfoKeys KEY_PGUP_1 KEY_PGUP_2 KEY_PGUP_AUTO_1 KEY_PGUP_AUTO_2
+syn keyword pinfoKeys KEY_DOWN_1 KEY_DOWN_2 KEY_TOP_1 KEY_TOP_2 KEY_BACK_1
+syn keyword pinfoKeys KEY_BACK_2 KEY_FOLLOWLINK_1 KEY_FOLLOWLINK_2
+syn keyword pinfoKeys KEY_REFRESH_1 KEY_REFRESH_2 KEY_SHELLFEED_1
+syn keyword pinfoKeys KEY_SHELLFEED_2 KEY_QUIT_1 KEY_QUIT_2 KEY_GOLINE_1
+syn keyword pinfoKeys KEY_GOLINE_2 KEY_PRINT_1 KEY_PRINT_2
+syn keyword pinfoKeys KEY_DIRPAGE_1 KEY_DIRPAGE_2
+
+" Special Keys
+syn keyword pinfoSpecialKeys KEY_BREAK KEY_DOWN KEY_UP KEY_LEFT KEY_RIGHT
+syn keyword pinfoSpecialKeys KEY_DOWN KEY_HOME KEY_BACKSPACE KEY_NPAGE
+syn keyword pinfoSpecialKeys KEY_PPAGE KEY_END KEY_IC KEY_DC
+syn region pinfoSpecialKeys matchgroup=pinfoSpecialKeys transparent start=+KEY_\%(F\|CTRL\|ALT\)(+ end=+)+
+syn region pinfoSimpleKey matchgroup=pinfoSimpleKey start=+'+ skip=+\\'+ end=+'+ contains=pinfoSimpleKeyEscape
+syn match pinfoSimpleKeyEscape +\\[\\nt']+
+syn match pinfoKeycode '\<\d\+\>'
+
+" Constants
+syn keyword pinfoConstants TRUE FALSE YES NO
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pinfo_syn_inits")
+ if version < 508
+ let did_pinfo_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ HiDef hi <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ HiDef hi def <args>
+ endif
+
+ HiLink pinfoTodo Todo
+ HiLink pinfoComment Comment
+ HiLink pinfoOptions Keyword
+ HiLink pinfoColors Keyword
+ HiLink pinfoColorDefault Normal
+ HiDef pinfoColorBold cterm=bold
+ HiDef pinfoColorNoBold cterm=none
+ " we can't access the blink attribute from Vim atm
+ HiDef pinfoColorBlink cterm=inverse
+ HiDef pinfoColorNoBlink cterm=none
+ HiDef pinfoColorBlack ctermfg=Black guifg=Black
+ HiDef pinfoColorRed ctermfg=DarkRed guifg=DarkRed
+ HiDef pinfoColorGreen ctermfg=DarkGreen guifg=DarkGreen
+ HiDef pinfoColorYellow ctermfg=DarkYellow guifg=DarkYellow
+ HiDef pinfoColorBlue ctermfg=DarkBlue guifg=DarkBlue
+ HiDef pinfoColorMagenta ctermfg=DarkMagenta guifg=DarkMagenta
+ HiDef pinfoColorCyan ctermfg=DarkCyan guifg=DarkCyan
+ HiDef pinfoColorWhite ctermfg=LightGray guifg=LightGray
+ HiLink pinfoKeys Keyword
+ HiLink pinfoSpecialKeys SpecialChar
+ HiLink pinfoSimpleKey String
+ HiLink pinfoSimpleKeyEscape SpecialChar
+ HiLink pinfoKeycode Number
+ HiLink pinfoConstants Constant
+
+ delcommand HiLink
+ delcommand HiDef
+endif
+
+let b:current_syntax = "pinfo"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/plm.vim b/runtime/syntax/plm.vim
new file mode 100644
index 000000000..bf7c32fd1
--- /dev/null
+++ b/runtime/syntax/plm.vim
@@ -0,0 +1,147 @@
+" Vim syntax file
+" Language: PL/M
+" Maintainer: Philippe Coulonges <cphil@cphil.net>
+" Last change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" PL/M is a case insensitive language
+syn case ignore
+
+syn keyword plmTodo contained TODO FIXME XXX
+
+" String
+syn region plmString start=+'+ end=+'+
+
+syn match plmOperator "[@=\+\-\*\/\<\>]"
+
+syn match plmIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>"
+
+syn match plmDelimiter "[();,]"
+
+syn region plmPreProc start="^\s*\$\s*" skip="\\$" end="$"
+
+" FIXME : No Number support for floats, as I'm working on an embedded
+" project that doesn't use any.
+syn match plmNumber "-\=\<\d\+\>"
+syn match plmNumber "\<[0-9a-fA-F]*[hH]*\>"
+
+" If you don't like tabs
+"syn match plmShowTab "\t"
+"syn match plmShowTabc "\t"
+
+"when wanted, highlight trailing white space
+if exists("c_space_errors")
+ syn match plmSpaceError "\s*$"
+ syn match plmSpaceError " \+\t"me=e-1
+endif
+
+"
+ " Use the same control variable as C language for I believe
+ " users will want the same behavior
+if exists("c_comment_strings")
+ " FIXME : don't work fine with c_comment_strings set,
+ " which I don't care as I don't use
+
+ " A comment can contain plmString, plmCharacter and plmNumber.
+ " But a "*/" inside a plmString in a plmComment DOES end the comment! So we
+ " need to use a special type of plmString: plmCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ syntax match plmCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region plmCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=plmSpecial,plmCommentSkip
+ syntax region plmComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=plmSpecial
+ syntax region plmComment start="/\*" end="\*/" contains=plmTodo,plmCommentString,plmCharacter,plmNumber,plmFloat,plmSpaceError
+ syntax match plmComment "//.*" contains=plmTodo,plmComment2String,plmCharacter,plmNumber,plmSpaceError
+else
+ syn region plmComment start="/\*" end="\*/" contains=plmTodo,plmSpaceError
+ syn match plmComment "//.*" contains=plmTodo,plmSpaceError
+endif
+
+syntax match plmCommentError "\*/"
+
+syn keyword plmReserved ADDRESS AND AT BASED BY BYTE CALL CASE
+syn keyword plmReserved DATA DECLARE DISABLE DO DWORD
+syn keyword plmReserved ELSE ENABLE END EOF EXTERNAL
+syn keyword plmReserved GO GOTO HALT IF INITIAL INTEGER INTERRUPT
+syn keyword plmReserved LABEL LITERALLY MINUS MOD NOT OR
+syn keyword plmReserved PLUS POINTER PROCEDURE PUBLIC
+syn keyword plmReserved REAL REENTRANT RETURN SELECTOR STRUCTURE
+syn keyword plmReserved THEN TO WHILE WORD XOR
+syn keyword plm386Reserved CHARINT HWORD LONGINT OFFSET QWORD SHORTINT
+
+syn keyword plmBuiltIn ABS ADJUSTRPL BLOCKINPUT BLOCKINWORD BLOCKOUTPUT
+syn keyword plmBuiltIn BLOCKOUTWORD BUILPTR CARRY CAUSEINTERRUPT CMPB
+syn keyword plmBuiltIn CMPW DEC DOUBLE FINDB FINDRB FINDRW FINDW FIX
+syn keyword plmBuiltIn FLAGS FLOAT GETREALERROR HIGH IABS INITREALMATHUNIT
+syn keyword plmBuiltIn INPUT INT INWORD LAST LOCKSET LENGTH LOW MOVB MOVE
+syn keyword plmBuiltIn MOVRB MOVRW MOVW NIL OUTPUT OUTWORD RESTOREREALSTATUS
+syn keyword plmBuiltIn ROL ROR SAL SAVEREALSTATUS SCL SCR SELECTOROF SETB
+syn keyword plmBuiltIn SETREALMODE SETW SHL SHR SIGN SIGNED SIZE SKIPB
+syn keyword plmBuiltIn SKIPRB SKIPRW SKIPW STACKBASE STACKPTR TIME SIZE
+syn keyword plmBuiltIn UNSIGN XLAT ZERO
+syn keyword plm386BuiltIn INTERRUPT SETINTERRUPT
+syn keyword plm286BuiltIn CLEARTASKSWITCHEDFLAG GETACCESSRIGHTS
+syn keyword plm286BuiltIn GETSEGMENTLIMIT LOCALTABLE MACHINESTATUS
+syn keyword plm286BuiltIn OFFSETOF PARITY RESTOREGLOBALTABLE
+syn keyword plm286BuiltIn RESTOREINTERRUPTTABLE SAVEGLOBALTABLE
+syn keyword plm286BuiltIn SAVEINTERRUPTTABLE SEGMENTREADABLE
+syn keyword plm286BuiltIn SEGMENTWRITABLE TASKREGISTER WAITFORINTERRUPT
+syn keyword plm386BuiltIn CONTROLREGISTER DEBUGREGISTER FINDHW
+syn keyword plm386BuiltIn FINDRHW INHWORD MOVBIT MOVRBIT MOVHW MOVRHW
+syn keyword plm386BuiltIn OUTHWORD SCANBIT SCANRBIT SETHW SHLD SHRD
+syn keyword plm386BuiltIn SKIPHW SKIPRHW TESTREGISTER
+syn keyword plm386w16BuiltIn BLOCKINDWORD BLOCKOUTDWORD CMPD FINDD
+syn keyword plm386w16BuiltIn FINDRD INDWORD MOVD MOVRD OUTDWORD
+syn keyword plm386w16BuiltIn SETD SKIPD SKIPRD
+
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_plm_syntax_inits")
+ if version < 508
+ let did_plm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+" HiLink plmLabel Label
+" HiLink plmConditional Conditional
+" HiLink plmRepeat Repeat
+ HiLink plmTodo Todo
+ HiLink plmNumber Number
+ HiLink plmOperator Operator
+ HiLink plmDelimiter Operator
+ "HiLink plmShowTab Error
+ "HiLink plmShowTabc Error
+ HiLink plmIdentifier Identifier
+ HiLink plmBuiltIn Statement
+ HiLink plm286BuiltIn Statement
+ HiLink plm386BuiltIn Statement
+ HiLink plm386w16BuiltIn Statement
+ HiLink plmReserved Statement
+ HiLink plm386Reserved Statement
+ HiLink plmPreProc PreProc
+ HiLink plmCommentError plmError
+ HiLink plmCommentString plmString
+ HiLink plmComment2String plmString
+ HiLink plmCommentSkip plmComment
+ HiLink plmString String
+ HiLink plmComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "plm"
+
+" vim: ts=8 sw=2
+
diff --git a/runtime/syntax/plp.vim b/runtime/syntax/plp.vim
new file mode 100644
index 000000000..f59702d3b
--- /dev/null
+++ b/runtime/syntax/plp.vim
@@ -0,0 +1,45 @@
+" Vim syntax file
+" Language: PLP (Perl in HTML)
+" Maintainer: Juerd <juerd@juerd.nl>
+" Last Change: 2003 Apr 25
+" Cloned From: aspperl.vim
+
+" Add to filetype.vim the following line (without quote sign):
+" au BufNewFile,BufRead *.plp setf plp
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'perlscript'
+endif
+
+if version < 600
+ so <sfile>:p:h/html.vim
+ syn include @PLPperl <sfile>:p:h/perl.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+ syn include @PLPperl syntax/perl.vim
+endif
+
+syn cluster htmlPreproc add=PLPperlblock
+
+syn keyword perlControl PLP_END
+syn keyword perlStatementInclude include Include
+syn keyword perlStatementFiles ReadFile WriteFile Counter
+syn keyword perlStatementScalar Entity AutoURL DecodeURI EncodeURI
+
+syn cluster PLPperlcode contains=perlStatement.*,perlFunction,perlOperator,perlVarPlain,perlVarNotInMatches,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlControl,perlConditional,perlRepeat,perlComment,perlPOD,perlHereDoc,perlPackageDecl,perlElseIfError,perlFiledescRead,perlMatch
+
+syn region PLPperlblock keepend matchgroup=Delimiter start=+<:=\=+ end=+:>+ transparent contains=@PLPperlcode
+
+syn region PLPinclude keepend matchgroup=Delimiter start=+<(+ end=+)>+
+
+let b:current_syntax = "plp"
+
diff --git a/runtime/syntax/plsql.vim b/runtime/syntax/plsql.vim
new file mode 100644
index 000000000..6e513660f
--- /dev/null
+++ b/runtime/syntax/plsql.vim
@@ -0,0 +1,277 @@
+" Vim syntax file
+" Language: Oracle Procedureal SQL (PL/SQL)
+" Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
+" Original Maintainer: C. Laurence Gonsalves (clgonsal@kami.com)
+" URL: http://lanzarotta.tripod.com/vim/syntax/plsql.vim.zip
+" Last Change: September 18, 2002
+" History: Geoff Evans & Bill Pribyl (bill at plnet dot org)
+" Added 9i keywords.
+" Austin Ziegler (austin at halostatue dot ca)
+" Added 8i+ features.
+"
+" For version 5.x, clear all syntax items.
+" For version 6.x, quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Todo.
+syn keyword plsqlTodo TODO FIXME XXX DEBUG NOTE
+syn cluster plsqlCommentGroup contains=plsqlTodo
+
+syn case ignore
+
+syn match plsqlGarbage "[^ \t()]"
+syn match plsqlIdentifier "[a-z][a-z0-9$_#]*"
+syn match plsqlHostIdentifier ":[a-z][a-z0-9$_#]*"
+
+" When wanted, highlight the trailing whitespace.
+if exists("c_space_errors")
+ if !exists("c_no_trail_space_error")
+ syn match plsqlSpaceError "\s\+$"
+ endif
+
+ if !exists("c_no_tab_space_error")
+ syn match plsqlSpaceError " \+\t"me=e-1
+ endif
+endif
+
+" Symbols.
+syn match plsqlSymbol "\(;\|,\|\.\)"
+
+" Operators.
+syn match plsqlOperator "\(+\|-\|\*\|/\|=\|<\|>\|@\|\*\*\|!=\|\~=\)"
+syn match plsqlOperator "\(^=\|<=\|>=\|:=\|=>\|\.\.\|||\|<<\|>>\|\"\)"
+
+" Some of Oracle's SQL keywords.
+syn keyword plsqlSQLKeyword ABORT ACCESS ACCESSED ADD AFTER ALL ALTER AND ANY
+syn keyword plsqlSQLKeyword AS ASC ATTRIBUTE AUDIT AUTHORIZATION AVG BASE_TABLE
+syn keyword plsqlSQLKeyword BEFORE BETWEEN BY CASCADE CAST CHECK CLUSTER
+syn keyword plsqlSQLKeyword CLUSTERS COLAUTH COLUMN COMMENT COMPRESS CONNECT
+syn keyword plsqlSQLKeyword CONSTRAINT CRASH CREATE CURRENT DATA DATABASE
+syn keyword plsqlSQLKeyword DATA_BASE DBA DEFAULT DELAY DELETE DESC DISTINCT
+syn keyword plsqlSQLKeyword DROP DUAL ELSE EXCLUSIVE EXISTS EXTENDS EXTRACT
+syn keyword plsqlSQLKeyword FILE FORCE FOREIGN FROM GRANT GROUP HAVING HEAP
+syn keyword plsqlSQLKeyword IDENTIFIED IDENTIFIER IMMEDIATE IN INCLUDING
+syn keyword plsqlSQLKeyword INCREMENT INDEX INDEXES INITIAL INSERT INSTEAD
+syn keyword plsqlSQLKeyword INTERSECT INTO INVALIDATE IS ISOLATION KEY LIBRARY
+syn keyword plsqlSQLKeyword LIKE LOCK MAXEXTENTS MINUS MODE MODIFY MULTISET
+syn keyword plsqlSQLKeyword NESTED NOAUDIT NOCOMPRESS NOT NOWAIT OF OFF OFFLINE
+syn keyword plsqlSQLKeyword ON ONLINE OPERATOR OPTION OR ORDER ORGANIZATION
+syn keyword plsqlSQLKeyword PCTFREE PRIMARY PRIOR PRIVATE PRIVILEGES PUBLIC
+syn keyword plsqlSQLKeyword QUOTA RELEASE RENAME REPLACE RESOURCE REVOKE ROLLBACK
+syn keyword plsqlSQLKeyword ROW ROWLABEL ROWS SCHEMA SELECT SEPARATE SESSION SET
+syn keyword plsqlSQLKeyword SHARE SIZE SPACE START STORE SUCCESSFUL SYNONYM
+syn keyword plsqlSQLKeyword SYSDATE TABLE TABLES TABLESPACE TEMPORARY TO TREAT
+syn keyword plsqlSQLKeyword TRIGGER TRUNCATE UID UNION UNIQUE UNLIMITED UPDATE
+syn keyword plsqlSQLKeyword USE USER VALIDATE VALUES VIEW WHENEVER WHERE WITH
+
+" PL/SQL's own keywords.
+syn keyword plsqlKeyword AGENT AND ANY ARRAY ASSIGN AS AT AUTHID BEGIN BODY BY
+syn keyword plsqlKeyword BULK C CASE CHAR_BASE CHARSETFORM CHARSETID CLOSE
+syn keyword plsqlKeyword COLLECT CONSTANT CONSTRUCTOR CONTEXT CURRVAL DECLARE
+syn keyword plsqlKeyword DVOID EXCEPTION EXCEPTION_INIT EXECUTE EXIT FETCH
+syn keyword plsqlKeyword FINAL FUNCTION GOTO HASH IMMEDIATE IN INDICATOR
+syn keyword plsqlKeyword INSTANTIABLE IS JAVA LANGUAGE LIBRARY MAP MAXLEN
+syn keyword plsqlKeyword MEMBER NAME NEW NOCOPY NUMBER_BASE OBJECT OCICOLL
+syn keyword plsqlKeyword OCIDATE OCIDATETIME OCILOBLOCATOR OCINUMBER OCIRAW
+syn keyword plsqlKeyword OCISTRING OF OPAQUE OPEN OR ORDER OTHERS OUT
+syn keyword plsqlKeyword OVERRIDING PACKAGE PARALLEL_ENABLE PARAMETERS
+syn keyword plsqlKeyword PARTITION PIPELINED PRAGMA PROCEDURE RAISE RANGE REF
+syn keyword plsqlKeyword RESULT RETURN REVERSE ROWTYPE SB1 SELF SHORT SIZE_T
+syn keyword plsqlKeyword SQL SQLCODE SQLERRM STATIC STRUCT SUBTYPE TDO THEN
+syn keyword plsqlKeyword TABLE TIMEZONE_ABBR TIMEZONE_HOUR TIMEZONE_MINUTE
+syn keyword plsqlKeyword TIMEZONE_REGION TYPE UNDER UNSIGNED USING VARIANCE
+syn keyword plsqlKeyword VARRAY VARYING WHEN WRITE
+syn match plsqlKeyword "\<END\>"
+syn match plsqlKeyword "\.COUNT\>"hs=s+1
+syn match plsqlKeyword "\.EXISTS\>"hs=s+1
+syn match plsqlKeyword "\.FIRST\>"hs=s+1
+syn match plsqlKeyword "\.LAST\>"hs=s+1
+syn match plsqlKeyword "\.DELETE\>"hs=s+1
+syn match plsqlKeyword "\.PREV\>"hs=s+1
+syn match plsqlKeyword "\.NEXT\>"hs=s+1
+
+" PL/SQL functions.
+syn keyword plsqlFunction ABS ACOS ADD_MONTHS ASCII ASCIISTR ASIN ATAN ATAN2
+syn keyword plsqlFunction BFILENAME BITAND CEIL CHARTOROWID CHR COALESCE
+syn keyword plsqlFunction COMMIT COMMIT_CM COMPOSE CONCAT CONVERT COS COSH
+syn keyword plsqlFunction COUNT CUBE CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP
+syn keyword plsqlFunction DBTIMEZONE DECODE DECOMPOSE DEREF DUMP EMPTY_BLOB
+syn keyword plsqlFunction EMPTY_CLOB EXISTS EXP FLOOR FROM_TZ GETBND GLB
+syn keyword plsqlFunction GREATEST GREATEST_LB GROUPING HEXTORAW INITCAP
+syn keyword plsqlFunction INSTR INSTR2 INSTR4 INSTRB INSTRC ISNCHAR LAST_DAY
+syn keyword plsqlFunction LEAST LEAST_UB LENGTH LENGTH2 LENGTH4 LENGTHB LENGTHC
+syn keyword plsqlFunction LN LOCALTIME LOCALTIMESTAMP LOG LOWER LPAD
+syn keyword plsqlFunction LTRIM LUB MAKE_REF MAX MIN MOD MONTHS_BETWEEN
+syn keyword plsqlFunction NCHARTOROWID NCHR NEW_TIME NEXT_DAY NHEXTORAW
+syn keyword plsqlFunction NLS_CHARSET_DECL_LEN NLS_CHARSET_ID NLS_CHARSET_NAME
+syn keyword plsqlFunction NLS_INITCAP NLS_LOWER NLSSORT NLS_UPPER NULLFN NULLIF
+syn keyword plsqlFunction NUMTODSINTERVAL NUMTOYMINTERVAL NVL POWER
+syn keyword plsqlFunction RAISE_APPLICATION_ERROR RAWTOHEX RAWTONHEX REF
+syn keyword plsqlFunction REFTOHEX REPLACE ROLLBACK_NR ROLLBACK_SV ROLLUP ROUND
+syn keyword plsqlFunction ROWIDTOCHAR ROWIDTONCHAR ROWLABEL RPAD RTRIM
+syn keyword plsqlFunction SAVEPOINT SESSIONTIMEZONE SETBND SET_TRANSACTION_USE
+syn keyword plsqlFunction SIGN SIN SINH SOUNDEX SQLCODE SQLERRM SQRT STDDEV
+syn keyword plsqlFunction SUBSTR SUBSTR2 SUBSTR4 SUBSTRB SUBSTRC SUM
+syn keyword plsqlFunction SYS_AT_TIME_ZONE SYS_CONTEXT SYSDATE SYS_EXTRACT_UTC
+syn keyword plsqlFunction SYS_GUID SYS_LITERALTODATE SYS_LITERALTODSINTERVAL
+syn keyword plsqlFunction SYS_LITERALTOTIME SYS_LITERALTOTIMESTAMP
+syn keyword plsqlFunction SYS_LITERALTOTZTIME SYS_LITERALTOTZTIMESTAMP
+syn keyword plsqlFunction SYS_LITERALTOYMINTERVAL SYS_OVER__DD SYS_OVER__DI
+syn keyword plsqlFunction SYS_OVER__ID SYS_OVER_IID SYS_OVER_IIT
+syn keyword plsqlFunction SYS_OVER__IT SYS_OVER__TI SYS_OVER__TT
+syn keyword plsqlFunction SYSTIMESTAMP TAN TANH TO_ANYLOB TO_BLOB TO_CHAR
+syn keyword plsqlFunction TO_CLOB TO_DATE TO_DSINTERVAL TO_LABEL TO_MULTI_BYTE
+syn keyword plsqlFunction TO_NCHAR TO_NCLOB TO_NUMBER TO_RAW TO_SINGLE_BYTE
+syn keyword plsqlFunction TO_TIME TO_TIMESTAMP TO_TIMESTAMP_TZ TO_TIME_TZ
+syn keyword plsqlFunction TO_YMINTERVAL TRANSLATE TREAT TRIM TRUNC TZ_OFFSET UID
+syn keyword plsqlFunction UNISTR UPPER UROWID USER USERENV VALUE VARIANCE
+syn keyword plsqlFunction VSIZE WORK XOR
+syn match plsqlFunction "\<SYS\$LOB_REPLICATION\>"
+
+" PL/SQL Exceptions
+syn keyword plsqlException ACCESS_INTO_NULL CASE_NOT_FOUND COLLECTION_IS_NULL
+syn keyword plsqlException CURSOR_ALREADY_OPEN DUP_VAL_ON_INDEX INVALID_CURSOR
+syn keyword plsqlException INVALID_NUMBER LOGIN_DENIED NO_DATA_FOUND
+syn keyword plsqlException NOT_LOGGED_ON PROGRAM_ERROR ROWTYPE_MISMATCH
+syn keyword plsqlException SELF_IS_NULL STORAGE_ERROR SUBSCRIPT_BEYOND_COUNT
+syn keyword plsqlException SUBSCRIPT_OUTSIDE_LIMIT SYS_INVALID_ROWID
+syn keyword plsqlException TIMEOUT_ON_RESOURCE TOO_MANY_ROWS VALUE_ERROR
+syn keyword plsqlException ZERO_DIVIDE
+
+" Oracle Pseudo Colums.
+syn keyword plsqlPseudo CURRVAL LEVEL NEXTVAL ROWID ROWNUM
+
+if exists("plsql_highlight_triggers")
+ syn keyword plsqlTrigger INSERTING UPDATING DELETING
+endif
+
+" Conditionals.
+syn keyword plsqlConditional ELSIF ELSE IF
+syn match plsqlConditional "\<END\s\+IF\>"
+
+" Loops.
+syn keyword plsqlRepeat FOR LOOP WHILE FORALL
+syn match plsqlRepeat "\<END\s\+LOOP\>"
+
+" Various types of comments.
+if exists("c_comment_strings")
+ syntax match plsqlCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region plsqlCommentString contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=plsqlCommentSkip
+ syntax region plsqlComment2String contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end="$"
+ syntax region plsqlCommentL start="--" skip="\\$" end="$" keepend contains=@plsqlCommentGroup,plsqlComment2String,plsqlCharLiteral,plsqlBooleanLiteral,plsqlNumbersCom,plsqlSpaceError
+ syntax region plsqlComment start="/\*" end="\*/" contains=@plsqlCommentGroup,plsqlComment2String,plsqlCharLiteral,plsqlBooleanLiteral,plsqlNumbersCom,plsqlSpaceError
+else
+ syntax region plsqlCommentL start="--" skip="\\$" end="$" keepend contains=@plsqlCommentGroup,plsqlSpaceError
+ syntax region plsqlComment start="/\*" end="\*/" contains=@plsqlCommentGroup,plsqlSpaceError
+endif
+
+syn sync ccomment plsqlComment
+syn sync ccomment plsqlCommentL
+
+" To catch unterminated string literals.
+syn match plsqlStringError "'.*$"
+
+" Various types of literals.
+syn match plsqlNumbers transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=plsqlIntLiteral,plsqlFloatLiteral
+syn match plsqlNumbersCom contained transparent "\<[+-]\=\d\|[+-]\=\.\d" contains=plsqlIntLiteral,plsqlFloatLiteral
+syn match plsqlIntLiteral contained "[+-]\=\d\+"
+syn match plsqlFloatLiteral contained "[+-]\=\d\+\.\d*"
+syn match plsqlFloatLiteral contained "[+-]\=\d*\.\d*"
+syn match plsqlCharLiteral "'[^']'"
+syn match plsqlStringLiteral "'\([^']\|''\)*'"
+syn keyword plsqlBooleanLiteral TRUE FALSE NULL
+
+" The built-in types.
+syn keyword plsqlStorage ANYDATA ANYTYPE BFILE BINARY_INTEGER BLOB BOOLEAN
+syn keyword plsqlStorage BYTE CHAR CHARACTER CLOB CURSOR DATE DAY DEC DECIMAL
+syn keyword plsqlStorage DOUBLE DSINTERVAL_UNCONSTRAINED FLOAT HOUR
+syn keyword plsqlStorage INT INTEGER INTERVAL LOB LONG MINUTE
+syn keyword plsqlStorage MLSLABEL MONTH NATURAL NATURALN NCHAR NCHAR_CS NCLOB
+syn keyword plsqlStorage NUMBER NUMERIC NVARCHAR PLS_INT PLS_INTEGER
+syn keyword plsqlStorage POSITIVE POSITIVEN PRECISION RAW REAL RECORD
+syn keyword plsqlStorage SECOND SIGNTYPE SMALLINT STRING SYS_REFCURSOR TABLE TIME
+syn keyword plsqlStorage TIMESTAMP TIMESTAMP_UNCONSTRAINED
+syn keyword plsqlStorage TIMESTAMP_TZ_UNCONSTRAINED
+syn keyword plsqlStorage TIMESTAMP_LTZ_UNCONSTRAINED UROWID VARCHAR
+syn keyword plsqlStorage VARCHAR2 YEAR YMINTERVAL_UNCONSTRAINED ZONE
+
+" A type-attribute is really a type.
+syn match plsqlTypeAttribute "%\(TYPE\|ROWTYPE\)\>"
+
+" All other attributes.
+syn match plsqlAttribute "%\(BULK_EXCEPTIONS\|BULK_ROWCOUNT\|ISOPEN\|FOUND\|NOTFOUND\|ROWCOUNT\)\>"
+
+" This'll catch mis-matched close-parens.
+syn cluster plsqlParenGroup contains=plsqlParenError,@plsqlCommentGroup,plsqlCommentSkip,plsqlIntLiteral,plsqlFloatLiteral,plsqlNumbersCom
+if exists("c_no_bracket_error")
+ syn region plsqlParen transparent start='(' end=')' contains=ALLBUT,@plsqlParenGroup
+ syn match plsqlParenError ")"
+ syn match plsqlErrInParen contained "[{}]"
+else
+ syn region plsqlParen transparent start='(' end=')' contains=ALLBUT,@plsqlParenGroup,plsqlErrInBracket
+ syn match plsqlParenError "[\])]"
+ syn match plsqlErrInParen contained "[{}]"
+ syn region plsqlBracket transparent start='\[' end=']' contains=ALLBUT,@plsqlParenGroup,plsqlErrInParen
+ syn match plsqlErrInBracket contained "[);{}]"
+endif
+
+" Syntax Synchronizing
+syn sync minlines=10 maxlines=100
+
+" Define the default highlighting.
+" For version 5.x and earlier, only when not done already.
+" For version 5.8 and later, only when an item doesn't have highlighting yet.
+if version >= 508 || !exists("did_plsql_syn_inits")
+ if version < 508
+ let did_plsql_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink plsqlAttribute Macro
+ HiLink plsqlBlockError Error
+ HiLink plsqlBooleanLiteral Boolean
+ HiLink plsqlCharLiteral Character
+ HiLink plsqlComment Comment
+ HiLink plsqlCommentL Comment
+ HiLink plsqlConditional Conditional
+ HiLink plsqlError Error
+ HiLink plsqlErrInBracket Error
+ HiLink plsqlErrInBlock Error
+ HiLink plsqlErrInParen Error
+ HiLink plsqlException Function
+ HiLink plsqlFloatLiteral Float
+ HiLink plsqlFunction Function
+ HiLink plsqlGarbage Error
+ HiLink plsqlHostIdentifier Label
+ HiLink plsqlIdentifier Normal
+ HiLink plsqlIntLiteral Number
+ HiLink plsqlOperator Operator
+ HiLink plsqlParen Normal
+ HiLink plsqlParenError Error
+ HiLink plsqlSpaceError Error
+ HiLink plsqlPseudo PreProc
+ HiLink plsqlKeyword Keyword
+ HiLink plsqlRepeat Repeat
+ HiLink plsqlStorage StorageClass
+ HiLink plsqlSQLKeyword Function
+ HiLink plsqlStringError Error
+ HiLink plsqlStringLiteral String
+ HiLink plsqlCommentString String
+ HiLink plsqlComment2String String
+ HiLink plsqlSymbol Normal
+ HiLink plsqlTrigger Function
+ HiLink plsqlTypeAttribute StorageClass
+ HiLink plsqlTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "plsql"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/po.vim b/runtime/syntax/po.vim
new file mode 100644
index 000000000..6da75d630
--- /dev/null
+++ b/runtime/syntax/po.vim
@@ -0,0 +1,46 @@
+" Vim syntax file
+" Language: po (gettext)
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2001 Apr 26
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match poComment "^#.*$"
+syn match poSources "^#:.*$"
+syn match poStatement "^\(domain\|msgid\|msgstr\)"
+syn match poSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+syn match poFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
+syn match poFormat "%%" contained
+syn region poString start=+"+ skip=+\\\\\|\\"+ end=+"+
+ \ contains=poSpecial,poFormat
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_po_syn_inits")
+ if version < 508
+ let did_po_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink poComment Comment
+ HiLink poSources PreProc
+ HiLink poStatement Statement
+ HiLink poSpecial Special
+ HiLink poFormat poSpecial
+ HiLink poString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "po"
+
+" vim:set ts=8 sts=2 sw=2 noet:
diff --git a/runtime/syntax/pod.vim b/runtime/syntax/pod.vim
new file mode 100644
index 000000000..24d0c852c
--- /dev/null
+++ b/runtime/syntax/pod.vim
@@ -0,0 +1,81 @@
+" Vim syntax file
+" Language: Perl POD format
+" Maintainer: Scott Bigham <dsb@cs.duke.edu>
+" Last Change: 2001 May 09
+
+" To add embedded POD documentation highlighting to your syntax file, add
+" the commands:
+"
+" syn include @Pod <sfile>:p:h/pod.vim
+" syn region myPOD start="^=pod" start="^=head" end="^=cut" keepend contained contains=@Pod
+"
+" and add myPod to the contains= list of some existing region, probably a
+" comment. The "keepend" flag is needed because "=cut" is matched as a
+" pattern in its own right.
+
+
+" Remove any old syntax stuff hanging around (this is suppressed
+" automatically by ":syn include" if necessary).
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" POD commands
+syn match podCommand "^=head[12]" nextgroup=podCmdText
+syn match podCommand "^=item" nextgroup=podCmdText
+syn match podCommand "^=over" nextgroup=podOverIndent skipwhite
+syn match podCommand "^=back"
+syn match podCommand "^=cut"
+syn match podCommand "^=pod"
+syn match podCommand "^=for" nextgroup=podForKeywd skipwhite
+syn match podCommand "^=begin" nextgroup=podForKeywd skipwhite
+syn match podCommand "^=end" nextgroup=podForKeywd skipwhite
+
+" Text of a =head1, =head2 or =item command
+syn match podCmdText ".*$" contained contains=podFormat
+
+" Indent amount of =over command
+syn match podOverIndent "\d\+" contained
+
+" Formatter identifier keyword for =for, =begin and =end commands
+syn match podForKeywd "\S\+" contained
+
+" An indented line, to be displayed verbatim
+syn match podVerbatimLine "^\s.*$"
+
+" Inline textual items handled specially by POD
+syn match podSpecial "\(\<\|&\)\I\i*\(::\I\i*\)*([^)]*)"
+syn match podSpecial "[$@%]\I\i*\(::\I\i*\)*\>"
+
+" Special formatting sequences
+syn region podFormat start="[IBSCLFXEZ]<" end=">" oneline contains=podFormat
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_pod_syntax_inits")
+ if version < 508
+ let did_pod_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink podCommand Statement
+ HiLink podCmdText String
+ HiLink podOverIndent Number
+ HiLink podForKeywd Identifier
+ HiLink podFormat Identifier
+ HiLink podVerbatimLine PreProc
+ HiLink podSpecial Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pod"
+
+" vim: ts=8
diff --git a/runtime/syntax/postscr.vim b/runtime/syntax/postscr.vim
new file mode 100644
index 000000000..40dbcec5f
--- /dev/null
+++ b/runtime/syntax/postscr.vim
@@ -0,0 +1,783 @@
+" Vim syntax file
+" Language: PostScript - all Levels, selectable
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Filenames: *.ps,*.eps
+" Last Change: 27th June 2002
+" URL: http://www.eandem.co.uk/mrw/vim
+"
+" Options Flags:
+" postscr_level - language level to use for highligting (1, 2, or 3)
+" postscr_display - include display PS operators
+" postscr_ghostscript - include GS extensions
+" postscr_fonts - highlight standard font names (a lot for PS 3)
+" postscr_encodings - highlight encoding names (there are a lot)
+" postscr_andornot_binary - highlight and, or, and not as binary operators (not logical)
+"
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" PostScript is case sensitive
+syn case match
+
+" Keyword characters - all 7-bit ASCII bar PS delimiters and ws
+if version >= 600
+ setlocal iskeyword=33-127,^(,^),^<,^>,^[,^],^{,^},^/,^%
+else
+ set iskeyword=33-127,^(,^),^<,^>,^[,^],^{,^},^/,^%
+endif
+
+" Yer trusty old TODO highlghter!
+syn keyword postscrTodo contained TODO
+
+" Comment
+syn match postscrComment "%.*$" contains=postscrTodo
+" DSC comment start line (NB: defines DSC level, not PS level!)
+syn match postscrDSCComment "^%!PS-Adobe-\d\+\.\d\+\s*.*$"
+" DSC comment line (no check on possible comments - another language!)
+syn match postscrDSCComment "^%%\u\+.*$" contains=@postscrString,@postscrNumber
+" DSC continuation line (no check that previous line is DSC comment)
+syn match postscrDSCComment "^%%+ *.*$" contains=@postscrString,@postscrNumber
+
+" Names
+syn match postscrName "\k\+"
+
+" Identifiers
+syn match postscrIdentifierError "/\{1,2}[[:space:]\[\]{}]"me=e-1
+syn match postscrIdentifier "/\{1,2}\k\+" contains=postscrConstant,postscrBoolean,postscrCustConstant
+
+" Numbers
+syn case ignore
+" In file hex data - usually complete lines
+syn match postscrHex "^[[:xdigit:]][[:xdigit:][:space:]]*$"
+"syn match postscrHex "\<\x\{2,}\>"
+" Integers
+syn match postscrInteger "\<[+-]\=\d\+\>"
+" Radix
+syn match postscrRadix "\d\+#\x\+\>"
+" Reals - upper and lower case e is allowed
+syn match postscrFloat "[+-]\=\d\+\.\>"
+syn match postscrFloat "[+-]\=\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
+syn match postscrFloat "[+-]\=\.\d\+\(e[+-]\=\d\+\)\=\>"
+syn match postscrFloat "[+-]\=\d\+e[+-]\=\d\+\>"
+syn cluster postscrNumber contains=postscrInteger,postscrRadix,postscrFloat
+syn case match
+
+" Escaped characters
+syn match postscrSpecialChar contained "\\[nrtbf\\()]"
+syn match postscrSpecialCharError contained "\\[^nrtbf\\()]"he=e-1
+" Escaped octal characters
+syn match postscrSpecialChar contained "\\\o\{1,3}"
+
+" Strings
+" ASCII strings
+syn region postscrASCIIString start=+(+ end=+)+ skip=+([^)]*)+ contains=postscrSpecialChar,postscrSpecialCharError
+" Hex strings
+syn match postscrHexCharError contained "[^<>[:xdigit:][:space:]]"
+syn region postscrHexString start=+<\($\|[^<]\)+ end=+>+ contains=postscrHexCharError
+syn match postscrHexString "<>"
+" ASCII85 strings
+syn match postscrASCII85CharError contained "[^<>\~!-uz[:space:]]"
+syn region postscrASCII85String start=+<\~+ end=+\~>+ contains=postscrASCII85CharError
+syn cluster postscrString contains=postscrASCIIString,postscrHexString,postscrASCII85String
+
+
+" Set default highlighting to level 2 - most common at the moment
+if !exists("postscr_level")
+ let postscr_level = 2
+endif
+
+
+" PS level 1 operators - common to all levels (well ...)
+
+" Stack operators
+syn keyword postscrOperator pop exch dup copy index roll clear count mark cleartomark counttomark
+
+" Math operators
+syn keyword postscrMathOperator add div idiv mod mul sub abs neg ceiling floor round truncate sqrt atan cos
+syn keyword postscrMathOperator sin exp ln log rand srand rrand
+
+" Array operators
+syn match postscrOperator "[\[\]{}]"
+syn keyword postscrOperator array length get put getinterval putinterval astore aload copy
+syn keyword postscrRepeat forall
+
+" Dictionary operators
+syn keyword postscrOperator dict maxlength begin end def load store known where currentdict
+syn keyword postscrOperator countdictstack dictstack cleardictstack internaldict
+syn keyword postscrConstant $error systemdict userdict statusdict errordict
+
+" String operators
+syn keyword postscrOperator string anchorsearch search token
+
+" Logic operators
+syn keyword postscrLogicalOperator eq ne ge gt le lt and not or
+if exists("postscr_andornot_binaryop")
+ syn keyword postscrBinaryOperator and or not
+else
+ syn keyword postscrLogicalOperator and not or
+endif
+syn keyword postscrBinaryOperator xor bitshift
+syn keyword postscrBoolean true false
+
+" PS Type names
+syn keyword postscrConstant arraytype booleantype conditiontype dicttype filetype fonttype gstatetype
+syn keyword postscrConstant integertype locktype marktype nametype nulltype operatortype
+syn keyword postscrConstant packedarraytype realtype savetype stringtype
+
+" Control operators
+syn keyword postscrConditional if ifelse
+syn keyword postscrRepeat for repeat loop
+syn keyword postscrOperator exec exit stop stopped countexecstack execstack quit
+syn keyword postscrProcedure start
+
+" Object operators
+syn keyword postscrOperator type cvlit cvx xcheck executeonly noaccess readonly rcheck wcheck cvi cvn cvr
+syn keyword postscrOperator cvrs cvs
+
+" File operators
+syn keyword postscrOperator file closefile read write readhexstring writehexstring readstring writestring
+syn keyword postscrOperator bytesavailable flush flushfile resetfile status run currentfile print
+syn keyword postscrOperator stack pstack readline deletefile setfileposition fileposition renamefile
+syn keyword postscrRepeat filenameforall
+syn keyword postscrProcedure = ==
+
+" VM operators
+syn keyword postscrOperator save restore
+
+" Misc operators
+syn keyword postscrOperator bind null usertime executive echo realtime
+syn keyword postscrConstant product revision serialnumber version
+syn keyword postscrProcedure prompt
+
+" GState operators
+syn keyword postscrOperator gsave grestore grestoreall initgraphics setlinewidth setlinecap currentgray
+syn keyword postscrOperator currentlinejoin setmiterlimit currentmiterlimit setdash currentdash setgray
+syn keyword postscrOperator sethsbcolor currenthsbcolor setrgbcolor currentrgbcolor currentlinewidth
+syn keyword postscrOperator currentlinecap setlinejoin setcmykcolor currentcmykcolor
+
+" Device gstate operators
+syn keyword postscrOperator setscreen currentscreen settransfer currenttransfer setflat currentflat
+syn keyword postscrOperator currentblackgeneration setblackgeneration setundercolorremoval
+syn keyword postscrOperator setcolorscreen currentcolorscreen setcolortransfer currentcolortransfer
+syn keyword postscrOperator currentundercolorremoval
+
+" Matrix operators
+syn keyword postscrOperator matrix initmatrix identmatrix defaultmatrix currentmatrix setmatrix translate
+syn keyword postscrOperator concat concatmatrix transform dtransform itransform idtransform invertmatrix
+syn keyword postscrOperator scale rotate
+
+" Path operators
+syn keyword postscrOperator newpath currentpoint moveto rmoveto lineto rlineto arc arcn arcto curveto
+syn keyword postscrOperator closepath flattenpath reversepath strokepath charpath clippath pathbbox
+syn keyword postscrOperator initclip clip eoclip rcurveto
+syn keyword postscrRepeat pathforall
+
+" Painting operators
+syn keyword postscrOperator erasepage fill eofill stroke image imagemask colorimage
+
+" Device operators
+syn keyword postscrOperator showpage copypage nulldevice
+
+" Character operators
+syn keyword postscrProcedure findfont
+syn keyword postscrConstant FontDirectory ISOLatin1Encoding StandardEncoding
+syn keyword postscrOperator definefont scalefont makefont setfont currentfont show ashow
+syn keyword postscrOperator stringwidth kshow setcachedevice
+syn keyword postscrOperator setcharwidth widthshow awidthshow findencoding cshow rootfont setcachedevice2
+
+" Interpreter operators
+syn keyword postscrOperator vmstatus cachestatus setcachelimit
+
+" PS constants
+syn keyword postscrConstant contained Gray Red Green Blue All None DeviceGray DeviceRGB
+
+" PS Filters
+syn keyword postscrConstant contained ASCIIHexDecode ASCIIHexEncode ASCII85Decode ASCII85Encode LZWDecode
+syn keyword postscrConstant contained RunLengthDecode RunLengthEncode SubFileDecode NullEncode
+syn keyword postscrConstant contained GIFDecode PNGDecode LZWEncode
+
+" PS JPEG filter dictionary entries
+syn keyword postscrConstant contained DCTEncode DCTDecode Colors HSamples VSamples QuantTables QFactor
+syn keyword postscrConstant contained HuffTables ColorTransform
+
+" PS CCITT filter dictionary entries
+syn keyword postscrConstant contained CCITTFaxEncode CCITTFaxDecode Uncompressed K EndOfLine
+syn keyword postscrConstant contained Columns Rows EndOfBlock Blacks1 DamagedRowsBeforeError
+syn keyword postscrConstant contained EncodedByteAlign
+
+" PS Form dictionary entries
+syn keyword postscrConstant contained FormType XUID BBox Matrix PaintProc Implementation
+
+" PS Errors
+syn keyword postscrProcedure handleerror
+syn keyword postscrConstant contained configurationerror dictfull dictstackunderflow dictstackoverflow
+syn keyword postscrConstant contained execstackoverflow interrupt invalidaccess
+syn keyword postscrConstant contained invalidcontext invalidexit invalidfileaccess invalidfont
+syn keyword postscrConstant contained invalidid invalidrestore ioerror limitcheck nocurrentpoint
+syn keyword postscrConstant contained rangecheck stackoverflow stackunderflow syntaxerror timeout
+syn keyword postscrConstant contained typecheck undefined undefinedfilename undefinedresource
+syn keyword postscrConstant contained undefinedresult unmatchedmark unregistered VMerror
+
+if exists("postscr_fonts")
+" Font names
+ syn keyword postscrConstant contained Symbol Times-Roman Times-Italic Times-Bold Times-BoldItalic
+ syn keyword postscrConstant contained Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-BoldOblique
+ syn keyword postscrConstant contained Courier Courier-Oblique Courier-Bold Courier-BoldOblique
+endif
+
+
+if exists("postscr_display")
+" Display PS only operators
+ syn keyword postscrOperator currentcontext fork join detach lock monitor condition wait notify yield
+ syn keyword postscrOperator viewclip eoviewclip rectviewclip initviewclip viewclippath deviceinfo
+ syn keyword postscrOperator sethalftonephase currenthalftonephase wtranslation defineusername
+endif
+
+" PS Character encoding names
+if exists("postscr_encodings")
+" Common encoding names
+ syn keyword postscrConstant contained .notdef
+
+" Standard and ISO encoding names
+ syn keyword postscrConstant contained space exclam quotedbl numbersign dollar percent ampersand quoteright
+ syn keyword postscrConstant contained parenleft parenright asterisk plus comma hyphen period slash zero
+ syn keyword postscrConstant contained one two three four five six seven eight nine colon semicolon less
+ syn keyword postscrConstant contained equal greater question at
+ syn keyword postscrConstant contained bracketleft backslash bracketright asciicircum underscore quoteleft
+ syn keyword postscrConstant contained braceleft bar braceright asciitilde
+ syn keyword postscrConstant contained exclamdown cent sterling fraction yen florin section currency
+ syn keyword postscrConstant contained quotesingle quotedblleft guillemotleft guilsinglleft guilsinglright
+ syn keyword postscrConstant contained fi fl endash dagger daggerdbl periodcentered paragraph bullet
+ syn keyword postscrConstant contained quotesinglbase quotedblbase quotedblright guillemotright ellipsis
+ syn keyword postscrConstant contained perthousand questiondown grave acute circumflex tilde macron breve
+ syn keyword postscrConstant contained dotaccent dieresis ring cedilla hungarumlaut ogonek caron emdash
+ syn keyword postscrConstant contained AE ordfeminine Lslash Oslash OE ordmasculine ae dotlessi lslash
+ syn keyword postscrConstant contained oslash oe germandbls
+" The following are valid names, but are used as short procedure names in generated PS!
+" a b c d e f g h i j k l m n o p q r s t u v w x y z
+" A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+
+" Symbol encoding names
+ syn keyword postscrConstant contained universal existential suchthat asteriskmath minus
+ syn keyword postscrConstant contained congruent Alpha Beta Chi Delta Epsilon Phi Gamma Eta Iota theta1
+ syn keyword postscrConstant contained Kappa Lambda Mu Nu Omicron Pi Theta Rho Sigma Tau Upsilon sigma1
+ syn keyword postscrConstant contained Omega Xi Psi Zeta therefore perpendicular
+ syn keyword postscrConstant contained radicalex alpha beta chi delta epsilon phi gamma eta iota phi1
+ syn keyword postscrConstant contained kappa lambda mu nu omicron pi theta rho sigma tau upsilon omega1
+ syn keyword postscrConstant contained Upsilon1 minute lessequal infinity club diamond heart spade
+ syn keyword postscrConstant contained arrowboth arrowleft arrowup arrowright arrowdown degree plusminus
+ syn keyword postscrConstant contained second greaterequal multiply proportional partialdiff divide
+ syn keyword postscrConstant contained notequal equivalence approxequal arrowvertex arrowhorizex
+ syn keyword postscrConstant contained aleph Ifraktur Rfraktur weierstrass circlemultiply circleplus
+ syn keyword postscrConstant contained emptyset intersection union propersuperset reflexsuperset notsubset
+ syn keyword postscrConstant contained propersubset reflexsubset element notelement angle gradient
+ syn keyword postscrConstant contained registerserif copyrightserif trademarkserif radical dotmath
+ syn keyword postscrConstant contained logicalnot logicaland logicalor arrowdblboth arrowdblleft arrowdblup
+ syn keyword postscrConstant contained arrowdblright arrowdbldown omega xi psi zeta similar carriagereturn
+ syn keyword postscrConstant contained lozenge angleleft registersans copyrightsans trademarksans summation
+ syn keyword postscrConstant contained parenlefttp parenleftex parenleftbt bracketlefttp bracketleftex
+ syn keyword postscrConstant contained bracketleftbt bracelefttp braceleftmid braceleftbt braceex euro
+ syn keyword postscrConstant contained angleright integral integraltp integralex integralbt parenrighttp
+ syn keyword postscrConstant contained parenrightex parenrightbt bracketrighttp bracketrightex
+ syn keyword postscrConstant contained bracketrightbt bracerighttp bracerightmid bracerightbt
+
+" ISO Latin1 encoding names
+ syn keyword postscrConstant contained brokenbar copyright registered twosuperior threesuperior
+ syn keyword postscrConstant contained onesuperior onequarter onehalf threequarters
+ syn keyword postscrConstant contained Agrave Aacute Acircumflex Atilde Adieresis Aring Ccedilla Egrave
+ syn keyword postscrConstant contained Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis
+ syn keyword postscrConstant contained Eth Ntilde Ograve Oacute Ocircumflex Otilde Odieresis Ugrave Uacute
+ syn keyword postscrConstant contained Ucircumflex Udieresis Yacute Thorn
+ syn keyword postscrConstant contained agrave aacute acircumflex atilde adieresis aring ccedilla egrave
+ syn keyword postscrConstant contained eacute ecircumflex edieresis igrave iacute icircumflex idieresis
+ syn keyword postscrConstant contained eth ntilde ograve oacute ocircumflex otilde odieresis ugrave uacute
+ syn keyword postscrConstant contained ucircumflex udieresis yacute thorn ydieresis
+ syn keyword postscrConstant contained zcaron exclamsmall Hungarumlautsmall dollaroldstyle dollarsuperior
+ syn keyword postscrConstant contained ampersandsmall Acutesmall parenleftsuperior parenrightsuperior
+ syn keyword postscrConstant contained twodotenleader onedotenleader zerooldstyle oneoldstyle twooldstyle
+ syn keyword postscrConstant contained threeoldstyle fouroldstyle fiveoldstyle sixoldstyle sevenoldstyle
+ syn keyword postscrConstant contained eightoldstyle nineoldstyle commasuperior
+ syn keyword postscrConstant contained threequartersemdash periodsuperior questionsmall asuperior bsuperior
+ syn keyword postscrConstant contained centsuperior dsuperior esuperior isuperior lsuperior msuperior
+ syn keyword postscrConstant contained nsuperior osuperior rsuperior ssuperior tsuperior ff ffi ffl
+ syn keyword postscrConstant contained parenleftinferior parenrightinferior Circumflexsmall hyphensuperior
+ syn keyword postscrConstant contained Gravesmall Asmall Bsmall Csmall Dsmall Esmall Fsmall Gsmall Hsmall
+ syn keyword postscrConstant contained Ismall Jsmall Ksmall Lsmall Msmall Nsmall Osmall Psmall Qsmall
+ syn keyword postscrConstant contained Rsmall Ssmall Tsmall Usmall Vsmall Wsmall Xsmall Ysmall Zsmall
+ syn keyword postscrConstant contained colonmonetary onefitted rupiah Tildesmall exclamdownsmall
+ syn keyword postscrConstant contained centoldstyle Lslashsmall Scaronsmall Zcaronsmall Dieresissmall
+ syn keyword postscrConstant contained Brevesmall Caronsmall Dotaccentsmall Macronsmall figuredash
+ syn keyword postscrConstant contained hypheninferior Ogoneksmall Ringsmall Cedillasmall questiondownsmall
+ syn keyword postscrConstant contained oneeighth threeeighths fiveeighths seveneighths onethird twothirds
+ syn keyword postscrConstant contained zerosuperior foursuperior fivesuperior sixsuperior sevensuperior
+ syn keyword postscrConstant contained eightsuperior ninesuperior zeroinferior oneinferior twoinferior
+ syn keyword postscrConstant contained threeinferior fourinferior fiveinferior sixinferior seveninferior
+ syn keyword postscrConstant contained eightinferior nineinferior centinferior dollarinferior periodinferior
+ syn keyword postscrConstant contained commainferior Agravesmall Aacutesmall Acircumflexsmall
+ syn keyword postscrConstant contained Atildesmall Adieresissmall Aringsmall AEsmall Ccedillasmall
+ syn keyword postscrConstant contained Egravesmall Eacutesmall Ecircumflexsmall Edieresissmall Igravesmall
+ syn keyword postscrConstant contained Iacutesmall Icircumflexsmall Idieresissmall Ethsmall Ntildesmall
+ syn keyword postscrConstant contained Ogravesmall Oacutesmall Ocircumflexsmall Otildesmall Odieresissmall
+ syn keyword postscrConstant contained OEsmall Oslashsmall Ugravesmall Uacutesmall Ucircumflexsmall
+ syn keyword postscrConstant contained Udieresissmall Yacutesmall Thornsmall Ydieresissmall Black Bold Book
+ syn keyword postscrConstant contained Light Medium Regular Roman Semibold
+
+" Sundry standard and expert encoding names
+ syn keyword postscrConstant contained trademark Scaron Ydieresis Zcaron scaron softhyphen overscore
+ syn keyword postscrConstant contained graybox Sacute Tcaron Zacute sacute tcaron zacute Aogonek Scedilla
+ syn keyword postscrConstant contained Zdotaccent aogonek scedilla Lcaron lcaron zdotaccent Racute Abreve
+ syn keyword postscrConstant contained Lacute Cacute Ccaron Eogonek Ecaron Dcaron Dcroat Nacute Ncaron
+ syn keyword postscrConstant contained Ohungarumlaut Rcaron Uring Uhungarumlaut Tcommaaccent racute abreve
+ syn keyword postscrConstant contained lacute cacute ccaron eogonek ecaron dcaron dcroat nacute ncaron
+ syn keyword postscrConstant contained ohungarumlaut rcaron uring uhungarumlaut tcommaaccent Gbreve
+ syn keyword postscrConstant contained Idotaccent gbreve blank apple
+endif
+
+
+" By default level 3 includes all level 2 operators
+if postscr_level == 2 || postscr_level == 3
+" Dictionary operators
+ syn match postscrOperator "\(<<\|>>\)"
+ syn keyword postscrOperator undef
+ syn keyword postscrConstant globaldict shareddict
+
+" Device operators
+ syn keyword postscrOperator setpagedevice currentpagedevice
+
+" Path operators
+ syn keyword postscrOperator rectclip setbbox uappend ucache upath ustrokepath arct
+
+" Painting operators
+ syn keyword postscrOperator rectfill rectstroke ufill ueofill ustroke
+
+" Array operators
+ syn keyword postscrOperator currentpacking setpacking packedarray
+
+" Misc operators
+ syn keyword postscrOperator languagelevel
+
+" Insideness operators
+ syn keyword postscrOperator infill ineofill instroke inufill inueofill inustroke
+
+" GState operators
+ syn keyword postscrOperator gstate setgstate currentgstate setcolor
+ syn keyword postscrOperator setcolorspace currentcolorspace setstrokeadjust currentstrokeadjust
+ syn keyword postscrOperator currentcolor
+
+" Device gstate operators
+ syn keyword postscrOperator sethalftone currenthalftone setoverprint currentoverprint
+ syn keyword postscrOperator setcolorrendering currentcolorrendering
+
+" Character operators
+ syn keyword postscrConstant GlobalFontDirectory SharedFontDirectory
+ syn keyword postscrOperator glyphshow selectfont
+ syn keyword postscrOperator addglyph undefinefont xshow xyshow yshow
+
+" Pattern operators
+ syn keyword postscrOperator makepattern setpattern execform
+
+" Resource operators
+ syn keyword postscrOperator defineresource undefineresource findresource resourcestatus
+ syn keyword postscrRepeat resourceforall
+
+" File operators
+ syn keyword postscrOperator filter printobject writeobject setobjectformat currentobjectformat
+
+" VM operators
+ syn keyword postscrOperator currentshared setshared defineuserobject execuserobject undefineuserobject
+ syn keyword postscrOperator gcheck scheck startjob currentglobal setglobal
+ syn keyword postscrConstant UserObjects
+
+" Interpreter operators
+ syn keyword postscrOperator setucacheparams setvmthreshold ucachestatus setsystemparams
+ syn keyword postscrOperator setuserparams currentuserparams setcacheparams currentcacheparams
+ syn keyword postscrOperator currentdevparams setdevparams vmreclaim currentsystemparams
+
+" PS2 constants
+ syn keyword postscrConstant contained DeviceCMYK Pattern Indexed Separation Cyan Magenta Yellow Black
+ syn keyword postscrConstant contained CIEBasedA CIEBasedABC CIEBasedDEF CIEBasedDEFG
+
+" PS2 $error dictionary entries
+ syn keyword postscrConstant contained newerror errorname command errorinfo ostack estack dstack
+ syn keyword postscrConstant contained recordstacks binary
+
+" PS2 Category dictionary
+ syn keyword postscrConstant contained DefineResource UndefineResource FindResource ResourceStatus
+ syn keyword postscrConstant contained ResourceForAll Category InstanceType ResourceFileName
+
+" PS2 Category names
+ syn keyword postscrConstant contained Font Encoding Form Pattern ProcSet ColorSpace Halftone
+ syn keyword postscrConstant contained ColorRendering Filter ColorSpaceFamily Emulator IODevice
+ syn keyword postscrConstant contained ColorRenderingType FMapType FontType FormType HalftoneType
+ syn keyword postscrConstant contained ImageType PatternType Category Generic
+
+" PS2 pagedevice dictionary entries
+ syn keyword postscrConstant contained PageSize MediaColor MediaWeight MediaType InputAttributes ManualFeed
+ syn keyword postscrConstant contained OutputType OutputAttributes NumCopies Collate Duplex Tumble
+ syn keyword postscrConstant contained Separations HWResolution Margins NegativePrint MirrorPrint
+ syn keyword postscrConstant contained CutMedia AdvanceMedia AdvanceDistance ImagingBBox
+ syn keyword postscrConstant contained Policies Install BeginPage EndPage PolicyNotFound PolicyReport
+ syn keyword postscrConstant contained ManualSize OutputFaceUp Jog
+ syn keyword postscrConstant contained Bind BindDetails Booklet BookletDetails CollateDetails
+ syn keyword postscrConstant contained DeviceRenderingInfo ExitJamRecovery Fold FoldDetails Laminate
+ syn keyword postscrConstant contained ManualFeedTimeout Orientation OutputPage
+ syn keyword postscrConstant contained PostRenderingEnhance PostRenderingEnhanceDetails
+ syn keyword postscrConstant contained PreRenderingEnhance PreRenderingEnhanceDetails
+ syn keyword postscrConstant contained Signature SlipSheet Staple StapleDetails Trim
+ syn keyword postscrConstant contained ProofSet REValue PrintQuality ValuesPerColorComponent AntiAlias
+
+" PS2 PDL resource entries
+ syn keyword postscrConstant contained Selector LanguageFamily LanguageVersion
+
+" PS2 halftone dictionary entries
+ syn keyword postscrConstant contained HalftoneType HalftoneName
+ syn keyword postscrConstant contained AccurateScreens ActualAngle Xsquare Ysquare AccurateFrequency
+ syn keyword postscrConstant contained Frequency SpotFunction Angle Width Height Thresholds
+ syn keyword postscrConstant contained RedFrequency RedSpotFunction RedAngle RedWidth RedHeight
+ syn keyword postscrConstant contained GreenFrequency GreenSpotFunction GreenAngle GreenWidth GreenHeight
+ syn keyword postscrConstant contained BlueFrequency BlueSpotFunction BlueAngle BlueWidth BlueHeight
+ syn keyword postscrConstant contained GrayFrequency GrayAngle GraySpotFunction GrayWidth GrayHeight
+ syn keyword postscrConstant contained GrayThresholds BlueThresholds GreenThresholds RedThresholds
+ syn keyword postscrConstant contained TransferFunction
+
+" PS2 CSR dictionaries
+ syn keyword postscrConstant contained RangeA DecodeA MatrixA RangeABC DecodeABC MatrixABC BlackPoint
+ syn keyword postscrConstant contained RangeLMN DecodeLMN MatrixLMN WhitePoint RangeDEF DecodeDEF RangeHIJ
+ syn keyword postscrConstant contained RangeDEFG DecodeDEFG RangeHIJK Table
+
+" PS2 CRD dictionaries
+ syn keyword postscrConstant contained ColorRenderingType EncodeLMB EncodeABC RangePQR MatrixPQR
+ syn keyword postscrConstant contained AbsoluteColorimetric RelativeColorimetric Saturation Perceptual
+ syn keyword postscrConstant contained TransformPQR RenderTable
+
+" PS2 Pattern dictionary
+ syn keyword postscrConstant contained PatternType PaintType TilingType XStep YStep
+
+" PS2 Image dictionary
+ syn keyword postscrConstant contained ImageType ImageMatrix MultipleDataSources DataSource
+ syn keyword postscrConstant contained BitsPerComponent Decode Interpolate
+
+" PS2 Font dictionaries
+ syn keyword postscrConstant contained FontType FontMatrix FontName FontInfo LanguageLevel WMode Encoding
+ syn keyword postscrConstant contained UniqueID StrokeWidth Metrics Metrics2 CDevProc CharStrings Private
+ syn keyword postscrConstant contained FullName Notice version ItalicAngle isFixedPitch UnderlinePosition
+ syn keyword postscrConstant contained FMapType Encoding FDepVector PrefEnc EscChar ShiftOut ShiftIn
+ syn keyword postscrConstant contained WeightVector Blend $Blend CIDFontType sfnts CIDSystemInfo CodeMap
+ syn keyword postscrConstant contained CMap CIDFontName CIDSystemInfo UIDBase CIDDevProc CIDCount
+ syn keyword postscrConstant contained CIDMapOffset FDArray FDBytes GDBytes GlyphData GlyphDictionary
+ syn keyword postscrConstant contained SDBytes SubrMapOffset SubrCount BuildGlyph CIDMap FID MIDVector
+ syn keyword postscrConstant contained Ordering Registry Supplement CMapName CMapVersion UIDOffset
+ syn keyword postscrConstant contained SubsVector UnderlineThickness FamilyName FontBBox CurMID
+ syn keyword postscrConstant contained Weight
+
+" PS2 User paramters
+ syn keyword postscrConstant contained MaxFontItem MinFontCompress MaxUPathItem MaxFormItem MaxPatternItem
+ syn keyword postscrConstant contained MaxScreenItem MaxOpStack MaxDictStack MaxExecStack MaxLocalVM
+ syn keyword postscrConstant contained VMReclaim VMThreshold
+
+" PS2 System paramters
+ syn keyword postscrConstant contained SystemParamsPassword StartJobPassword BuildTime ByteOrder RealFormat
+ syn keyword postscrConstant contained MaxFontCache CurFontCache MaxOutlineCache CurOutlineCache
+ syn keyword postscrConstant contained MaxUPathCache CurUPathCache MaxFormCache CurFormCache
+ syn keyword postscrConstant contained MaxPatternCache CurPatternCache MaxScreenStorage CurScreenStorage
+ syn keyword postscrConstant contained MaxDisplayList CurDisplayList
+
+" PS2 LZW Filters
+ syn keyword postscrConstant contained Predictor
+
+" Paper Size operators
+ syn keyword postscrOperator letter lettersmall legal ledger 11x17 a4 a3 a4small b5 note
+
+" Paper Tray operators
+ syn keyword postscrOperator lettertray legaltray ledgertray a3tray a4tray b5tray 11x17tray
+
+" SCC compatibility operators
+ syn keyword postscrOperator sccbatch sccinteractive setsccbatch setsccinteractive
+
+" Page duplexing operators
+ syn keyword postscrOperator duplexmode firstside newsheet setduplexmode settumble tumble
+
+" Device compatability operators
+ syn keyword postscrOperator devdismount devformat devmount devstatus
+ syn keyword postscrRepeat devforall
+
+" Imagesetter compatability operators
+ syn keyword postscrOperator accuratescreens checkscreen pagemargin pageparams setaccuratescreens setpage
+ syn keyword postscrOperator setpagemargin setpageparams
+
+" Misc compatability operators
+ syn keyword postscrOperator appletalktype buildtime byteorder checkpassword defaulttimeouts diskonline
+ syn keyword postscrOperator diskstatus manualfeed manualfeedtimeout margins mirrorprint pagecount
+ syn keyword postscrOperator pagestackorder printername processcolors sethardwareiomode setjobtimeout
+ syn keyword postscrOperator setpagestockorder setprintername setresolution doprinterrors dostartpage
+ syn keyword postscrOperator hardwareiomode initializedisk jobname jobtimeout ramsize realformat resolution
+ syn keyword postscrOperator setdefaulttimeouts setdoprinterrors setdostartpage setdosysstart
+ syn keyword postscrOperator setuserdiskpercent softwareiomode userdiskpercent waittimeout
+ syn keyword postscrOperator setsoftwareiomode dosysstart emulate setmargins setmirrorprint
+
+endif " PS2 highlighting
+
+if postscr_level == 3
+" Shading operators
+ syn keyword postscrOperator setsmoothness currentsmoothness shfill
+
+" Clip operators
+ syn keyword postscrOperator clipsave cliprestore
+
+" Pagedevive operators
+ syn keyword postscrOperator setpage setpageparams
+
+" Device gstate operators
+ syn keyword postscrOperator findcolorrendering
+
+" Font operators
+ syn keyword postscrOperator composefont
+
+" PS LL3 Output device resource entries
+ syn keyword postscrConstant contained DeviceN TrappingDetailsType
+
+" PS LL3 pagdevice dictionary entries
+ syn keyword postscrConstant contained DeferredMediaSelection ImageShift InsertSheet LeadingEdge MaxSeparations
+ syn keyword postscrConstant contained MediaClass MediaPosition OutputDevice PageDeviceName PageOffset ProcessColorModel
+ syn keyword postscrConstant contained RollFedMedia SeparationColorNames SeparationOrder Trapping TrappingDetails
+ syn keyword postscrConstant contained TraySwitch UseCIEColor
+ syn keyword postscrConstant contained ColorantDetails ColorantName ColorantType NeutralDensity TrappingOrder
+ syn keyword postscrConstant contained ColorantSetName
+
+" PS LL3 trapping dictionary entries
+ syn keyword postscrConstant contained BlackColorLimit BlackDensityLimit BlackWidth ColorantZoneDetails
+ syn keyword postscrConstant contained SlidingTrapLimit StepLimit TrapColorScaling TrapSetName TrapWidth
+ syn keyword postscrConstant contained ImageResolution ImageToObjectTrapping ImageTrapPlacement
+ syn keyword postscrConstant contained StepLimit TrapColorScaling Enabled ImageInternalTrapping
+
+" PS LL3 filters and entries
+ syn keyword postscrConstant contained ReusableStreamDecode CloseSource CloseTarget UnitSize LowBitFirst
+ syn keyword postscrConstant contained FlateEncode FlateDecode DecodeParams Intent AsyncRead
+
+" PS LL3 halftone dictionary entries
+ syn keyword postscrConstant contained Height2 Width2
+
+" PS LL3 function dictionary entries
+ syn keyword postscrConstant contained FunctionType Domain Range Order BitsPerSample Encode Size C0 C1 N
+ syn keyword postscrConstant contained Functions Bounds
+
+" PS LL3 image dictionary entries
+ syn keyword postscrConstant contained InterleaveType MaskDict DataDict MaskColor
+
+" PS LL3 Pattern and shading dictionary entries
+ syn keyword postscrConstant contained Shading ShadingType Background ColorSpace Coords Extend Function
+ syn keyword postscrConstant contained VerticesPerRow BitsPerCoordinate BitsPerFlag
+
+" PS LL3 image dictionary entries
+ syn keyword postscrConstant contained XOrigin YOrigin UnpaintedPath PixelCopy
+
+" PS LL3 colorrendering procedures
+ syn keyword postscrProcedure GetHalftoneName GetPageDeviceName GetSubstituteCRD
+
+" PS LL3 CIDInit procedures
+ syn keyword postscrProcedure beginbfchar beginbfrange begincidchar begincidrange begincmap begincodespacerange
+ syn keyword postscrProcedure beginnotdefchar beginnotdefrange beginrearrangedfont beginusematrix
+ syn keyword postscrProcedure endbfchar endbfrange endcidchar endcidrange endcmap endcodespacerange
+ syn keyword postscrProcedure endnotdefchar endnotdefrange endrearrangedfont endusematrix
+ syn keyword postscrProcedure StartData usefont usecmp
+
+" PS LL3 Trapping procedures
+ syn keyword postscrProcedure settrapparams currenttrapparams settrapzone
+
+" PS LL3 BitmapFontInit procedures
+ syn keyword postscrProcedure removeall removeglyphs
+
+" PS LL3 Font names
+ if exists("postscr_fonts")
+ syn keyword postscrConstant contained AlbertusMT AlbertusMT-Italic AlbertusMT-Light Apple-Chancery Apple-ChanceryCE
+ syn keyword postscrConstant contained AntiqueOlive-Roman AntiqueOlive-Italic AntiqueOlive-Bold AntiqueOlive-Compact
+ syn keyword postscrConstant contained AntiqueOliveCE-Roman AntiqueOliveCE-Italic AntiqueOliveCE-Bold AntiqueOliveCE-Compact
+ syn keyword postscrConstant contained ArialMT Arial-ItalicMT Arial-LightMT Arial-BoldMT Arial-BoldItalicMT
+ syn keyword postscrConstant contained ArialCE ArialCE-Italic ArialCE-Light ArialCE-Bold ArialCE-BoldItalic
+ syn keyword postscrConstant contained AvantGarde-Book AvantGarde-BookOblique AvantGarde-Demi AvantGarde-DemiOblique
+ syn keyword postscrConstant contained AvantGardeCE-Book AvantGardeCE-BookOblique AvantGardeCE-Demi AvantGardeCE-DemiOblique
+ syn keyword postscrConstant contained Bodoni Bodoni-Italic Bodoni-Bold Bodoni-BoldItalic Bodoni-Poster Bodoni-PosterCompressed
+ syn keyword postscrConstant contained BodoniCE BodoniCE-Italic BodoniCE-Bold BodoniCE-BoldItalic BodoniCE-Poster BodoniCE-PosterCompressed
+ syn keyword postscrConstant contained Bookman-Light Bookman-LightItalic Bookman-Demi Bookman-DemiItalic
+ syn keyword postscrConstant contained BookmanCE-Light BookmanCE-LightItalic BookmanCE-Demi BookmanCE-DemiItalic
+ syn keyword postscrConstant contained Carta Chicago ChicagoCE Clarendon Clarendon-Light Clarendon-Bold
+ syn keyword postscrConstant contained ClarendonCE ClarendonCE-Light ClarendonCE-Bold CooperBlack CooperBlack-Italic
+ syn keyword postscrConstant contained Copperplate-ThirtyTwoBC CopperPlate-ThirtyThreeBC Coronet-Regular CoronetCE-Regular
+ syn keyword postscrConstant contained CourierCE CourierCE-Oblique CourierCE-Bold CourierCE-BoldOblique
+ syn keyword postscrConstant contained Eurostile Eurostile-Bold Eurostile-ExtendedTwo Eurostile-BoldExtendedTwo
+ syn keyword postscrConstant contained Eurostile EurostileCE-Bold EurostileCE-ExtendedTwo EurostileCE-BoldExtendedTwo
+ syn keyword postscrConstant contained Geneva GenevaCE GillSans GillSans-Italic GillSans-Bold GillSans-BoldItalic GillSans-BoldCondensed
+ syn keyword postscrConstant contained GillSans-Light GillSans-LightItalic GillSans-ExtraBold
+ syn keyword postscrConstant contained GillSansCE-Roman GillSansCE-Italic GillSansCE-Bold GillSansCE-BoldItalic GillSansCE-BoldCondensed
+ syn keyword postscrConstant contained GillSansCE-Light GillSansCE-LightItalic GillSansCE-ExtraBold
+ syn keyword postscrConstant contained Goudy Goudy-Italic Goudy-Bold Goudy-BoldItalic Goudy-ExtraBould
+ syn keyword postscrConstant contained HelveticaCE HelveticaCE-Oblique HelveticaCE-Bold HelveticaCE-BoldOblique
+ syn keyword postscrConstant contained Helvetica-Condensed Helvetica-Condensed-Oblique Helvetica-Condensed-Bold Helvetica-Condensed-BoldObl
+ syn keyword postscrConstant contained HelveticaCE-Condensed HelveticaCE-Condensed-Oblique HelveticaCE-Condensed-Bold
+ syn keyword postscrConstant contained HelveticaCE-Condensed-BoldObl Helvetica-Narrow Helvetica-Narrow-Oblique Helvetica-Narrow-Bold
+ syn keyword postscrConstant contained Helvetica-Narrow-BoldOblique HelveticaCE-Narrow HelveticaCE-Narrow-Oblique HelveticaCE-Narrow-Bold
+ syn keyword postscrConstant contained HelveticaCE-Narrow-BoldOblique HoeflerText-Regular HoeflerText-Italic HoeflerText-Black
+ syn keyword postscrConstant contained HoeflerText-BlackItalic HoeflerText-Ornaments HoeflerTextCE-Regular HoeflerTextCE-Italic
+ syn keyword postscrConstant contained HoeflerTextCE-Black HoeflerTextCE-BlackItalic
+ syn keyword postscrConstant contained JoannaMT JoannaMT-Italic JoannaMT-Bold JoannaMT-BoldItalic
+ syn keyword postscrConstant contained JoannaMTCE JoannaMTCE-Italic JoannaMTCE-Bold JoannaMTCE-BoldItalic
+ syn keyword postscrConstant contained LetterGothic LetterGothic-Slanted LetterGothic-Bold LetterGothic-BoldSlanted
+ syn keyword postscrConstant contained LetterGothicCE LetterGothicCE-Slanted LetterGothicCE-Bold LetterGothicCE-BoldSlanted
+ syn keyword postscrConstant contained LubalinGraph-Book LubalinGraph-BookOblique LubalinGraph-Demi LubalinGraph-DemiOblique
+ syn keyword postscrConstant contained LubalinGraphCE-Book LubalinGraphCE-BookOblique LubalinGraphCE-Demi LubalinGraphCE-DemiOblique
+ syn keyword postscrConstant contained Marigold Monaco MonacoCE MonaLisa-Recut Oxford Symbol Tekton
+ syn keyword postscrConstant contained NewCennturySchlbk-Roman NewCenturySchlbk-Italic NewCenturySchlbk-Bold NewCenturySchlbk-BoldItalic
+ syn keyword postscrConstant contained NewCenturySchlbkCE-Roman NewCenturySchlbkCE-Italic NewCenturySchlbkCE-Bold
+ syn keyword postscrConstant contained NewCenturySchlbkCE-BoldItalic NewYork NewYorkCE
+ syn keyword postscrConstant contained Optima Optima-Italic Optima-Bold Optima-BoldItalic
+ syn keyword postscrConstant contained OptimaCE OptimaCE-Italic OptimaCE-Bold OptimaCE-BoldItalic
+ syn keyword postscrConstant contained Palatino-Roman Palatino-Italic Palatino-Bold Palatino-BoldItalic
+ syn keyword postscrConstant contained PalatinoCE-Roman PalatinoCE-Italic PalatinoCE-Bold PalatinoCE-BoldItalic
+ syn keyword postscrConstant contained StempelGaramond-Roman StempelGaramond-Italic StempelGaramond-Bold StempelGaramond-BoldItalic
+ syn keyword postscrConstant contained StempelGaramondCE-Roman StempelGaramondCE-Italic StempelGaramondCE-Bold StempelGaramondCE-BoldItalic
+ syn keyword postscrConstant contained TimesCE-Roman TimesCE-Italic TimesCE-Bold TimesCE-BoldItalic
+ syn keyword postscrConstant contained TimesNewRomanPSMT TimesNewRomanPS-ItalicMT TimesNewRomanPS-BoldMT TimesNewRomanPS-BoldItalicMT
+ syn keyword postscrConstant contained TimesNewRomanCE TimesNewRomanCE-Italic TimesNewRomanCE-Bold TimesNewRomanCE-BoldItalic
+ syn keyword postscrConstant contained Univers Univers-Oblique Univers-Bold Univers-BoldOblique
+ syn keyword postscrConstant contained UniversCE-Medium UniversCE-Oblique UniversCE-Bold UniversCE-BoldOblique
+ syn keyword postscrConstant contained Univers-Light Univers-LightOblique UniversCE-Light UniversCE-LightOblique
+ syn keyword postscrConstant contained Univers-Condensed Univers-CondensedOblique Univers-CondensedBold Univers-CondensedBoldOblique
+ syn keyword postscrConstant contained UniversCE-Condensed UniversCE-CondensedOblique UniversCE-CondensedBold UniversCE-CondensedBoldOblique
+ syn keyword postscrConstant contained Univers-Extended Univers-ExtendedObl Univers-BoldExt Univers-BoldExtObl
+ syn keyword postscrConstant contained UniversCE-Extended UniversCE-ExtendedObl UniversCE-BoldExt UniversCE-BoldExtObl
+ syn keyword postscrConstant contained Wingdings-Regular ZapfChancery-MediumItalic ZapfChanceryCE-MediumItalic ZapfDingBats
+ endif " Font names
+
+endif " PS LL3 highlighting
+
+
+if exists("postscr_ghostscript")
+ " GS gstate operators
+ syn keyword postscrOperator .setaccuratecurves .currentaccuratecurves .setclipoutside
+ syn keyword postscrOperator .setdashadapt .currentdashadapt .setdefaultmatrix .setdotlength
+ syn keyword postscrOperator .currentdotlength .setfilladjust2 .currentfilladjust2
+ syn keyword postscrOperator .currentclipoutside .setcurvejoin .currentcurvejoin
+ syn keyword postscrOperator .setblendmode .currentblendmode .setopacityalpha .currentopacityalpha .setshapealpha .currentshapealpha
+ syn keyword postscrOperator .setlimitclamp .currentlimitclamp .setoverprintmode .currentoverprintmode
+
+ " GS path operators
+ syn keyword postscrOperator .dashpath .rectappend
+
+ " GS painting operators
+ syn keyword postscrOperator .setrasterop .currentrasterop .setsourcetransparent
+ syn keyword postscrOperator .settexturetransparent .currenttexturetransparent
+ syn keyword postscrOperator .currentsourcetransparent
+
+ " GS character operators
+ syn keyword postscrOperator .charboxpath .type1execchar %Type1BuildChar %Type1BuildGlyph
+
+ " GS mathematical operators
+ syn keyword postscrMathOperator arccos arcsin
+
+ " GS dictionary operators
+ syn keyword postscrOperator .dicttomark .forceput .forceundef .knownget .setmaxlength
+
+ " GS byte and string operators
+ syn keyword postscrOperator .type1encrypt .type1decrypt
+ syn keyword postscrOperator .bytestring .namestring .stringmatch
+
+ " GS relational operators (seem like math ones to me!)
+ syn keyword postscrMathOperator max min
+
+ " GS file operators
+ syn keyword postscrOperator findlibfile unread writeppmfile
+ syn keyword postscrOperator .filename .fileposition .peekstring .unread
+
+ " GS vm operators
+ syn keyword postscrOperator .forgetsave
+
+ " GS device operators
+ syn keyword postscrOperator copydevice .getdevice makeimagedevice makewordimagedevice copyscanlines
+ syn keyword postscrOperator setdevice currentdevice getdeviceprops putdeviceprops flushpage
+ syn keyword postscrOperator finddevice findprotodevice .getbitsrect
+
+ " GS misc operators
+ syn keyword postscrOperator getenv .makeoperator .setdebug .oserrno .oserror .execn
+
+ " GS rendering stack operators
+ syn keyword postscrOperator .begintransparencygroup .discardtransparencygroup .endtransparencygroup
+ syn keyword postscrOperator .begintransparencymask .discardtransparencymask .endtransparencymask .inittransparencymask
+ syn keyword postscrOperator .settextknockout .currenttextknockout
+
+ " GS filters
+ syn keyword postscrConstant contained BCPEncode BCPDecode eexecEncode eexecDecode PCXDecode
+ syn keyword postscrConstant contained PixelDifferenceEncode PixelDifferenceDecode
+ syn keyword postscrConstant contained PNGPredictorDecode TBCPEncode TBCPDecode zlibEncode
+ syn keyword postscrConstant contained zlibDecode PNGPredictorEncode PFBDecode
+ syn keyword postscrConstant contained MD5Encode
+
+ " GS filter keys
+ syn keyword postscrConstant contained InitialCodeLength FirstBitLowOrder BlockData DecodedByteAlign
+
+ " GS device parameters
+ syn keyword postscrConstant contained BitsPerPixel .HWMargins HWSize Name GrayValues
+ syn keyword postscrConstant contained ColorValues TextAlphaBits GraphicsAlphaBits BufferSpace
+ syn keyword postscrConstant contained OpenOutputFile PageCount BandHeight BandWidth BandBufferSpace
+ syn keyword postscrConstant contained ViewerPreProcess GreenValues BlueValues OutputFile
+ syn keyword postscrConstant contained MaxBitmap RedValues
+
+endif " GhostScript highlighting
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_postscr_syntax_inits")
+ if version < 508
+ let did_postscr_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink postscrComment Comment
+
+ HiLink postscrConstant Constant
+ HiLink postscrString String
+ HiLink postscrASCIIString postscrString
+ HiLink postscrHexString postscrString
+ HiLink postscrASCII85String postscrString
+ HiLink postscrNumber Number
+ HiLink postscrInteger postscrNumber
+ HiLink postscrHex postscrNumber
+ HiLink postscrRadix postscrNumber
+ HiLink postscrFloat Float
+ HiLink postscrBoolean Boolean
+
+ HiLink postscrIdentifier Identifier
+ HiLink postscrProcedure Function
+
+ HiLink postscrName Statement
+ HiLink postscrConditional Conditional
+ HiLink postscrRepeat Repeat
+ HiLink postscrOperator Operator
+ HiLink postscrMathOperator postscrOperator
+ HiLink postscrLogicalOperator postscrOperator
+ HiLink postscrBinaryOperator postscrOperator
+
+ HiLink postscrDSCComment SpecialComment
+ HiLink postscrSpecialChar SpecialChar
+
+ HiLink postscrTodo Todo
+
+ HiLink postscrError Error
+ HiLink postscrSpecialCharError postscrError
+ HiLink postscrASCII85CharError postscrError
+ HiLink postscrHexCharError postscrError
+ HiLink postscrIdentifierError postscrError
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "postscr"
+
+" vim: ts=8
diff --git a/runtime/syntax/pov.vim b/runtime/syntax/pov.vim
new file mode 100644
index 000000000..700bb315d
--- /dev/null
+++ b/runtime/syntax/pov.vim
@@ -0,0 +1,144 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: PoV-Ray(tm) 3.5 Scene Description Language
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003 Apr 25
+" URL: http://physics.muni.cz/~yeti/download/syntax/pov.vim
+" Required Vim Version: 6.0
+
+" Setup
+if version >= 600
+ " Quit when a syntax file was already loaded
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ " Croak when an old Vim is sourcing us.
+ echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or use a version of " . expand("<sfile>:t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "."
+ finish
+endif
+
+syn case match
+
+" Top level stuff
+syn keyword povCommands global_settings
+syn keyword povObjects array atmosphere background bicubic_patch blob box camera component cone cubic cylinder disc fog height_field isosurface julia_fractal lathe light_group light_source mesh mesh2 object parametric pattern photons plane poly polygon prism quadric quartic rainbow sky_sphere smooth_triangle sor sphere sphere_sweep spline superellipsoid text torus triangle
+syn keyword povCSG clipped_by composite contained_by difference intersection merge union
+syn keyword povAppearance interior material media texture interior_texture texture_list
+syn keyword povGlobalSettings ambient_light assumed_gamma charset hf_gray_16 irid_wavelength max_intersections max_trace_level number_of_waves radiosity noise_generator
+syn keyword povTransform inverse matrix rotate scale translate transform
+
+" Descriptors
+syn keyword povDescriptors finish normal pigment uv_mapping uv_vectors vertex_vectors
+syn keyword povDescriptors adc_bailout always_sample brightness count error_bound distance_maximum gray_threshold load_file low_error_factor max_sample media minimum_reuse nearest_count normal pretrace_end pretrace_start recursion_limit save_file
+syn keyword povDescriptors color colour gray rgb rgbt rgbf rgbft red green blue
+syn keyword povDescriptors bump_map color_map colour_map image_map material_map pigment_map quick_color quick_colour normal_map texture_map image_pattern pigment_pattern
+syn keyword povDescriptors ambient brilliance conserve_energy crand diffuse fresnel irid metallic phong phong_size refraction reflection reflection_exponent roughness specular
+syn keyword povDescriptors cylinder fisheye omnimax orthographic panoramic perspective spherical ultra_wide_angle
+syn keyword povDescriptors agate average brick boxed bozo bumps cells checker crackle cylindrical dents facets function gradient granite hexagon julia leopard magnet mandel marble onion planar quilted radial ripples slope spherical spiral1 spiral2 spotted tiles tiles2 toroidal waves wood wrinkles
+syn keyword povDescriptors density_file
+syn keyword povDescriptors area_light shadowless spotlight parallel
+syn keyword povDescriptors absorption confidence density emission intervals ratio samples scattering variance
+syn keyword povDescriptors distance fog_alt fog_offset fog_type turb_depth
+syn keyword povDescriptors b_spline bezier_spline cubic_spline evaluate face_indices form linear_spline max_gradient natural_spline normal_indices normal_vectors quadratic_spline uv_indices
+syn keyword povDescriptors target
+
+" Modifiers
+syn keyword povModifiers caustics dispersion dispersion_samples fade_color fade_colour fade_distance fade_power ior
+syn keyword povModifiers bounded_by double_illuminate hierarchy hollow no_shadow open smooth sturm threshold water_level
+syn keyword povModifiers hypercomplex max_iteration precision quaternion slice
+syn keyword povModifiers conic_sweep linear_sweep
+syn keyword povModifiers flatness type u_steps v_steps
+syn keyword povModifiers aa_level aa_threshold adaptive falloff jitter looks_like media_attenuation media_interaction method point_at radius tightness
+syn keyword povModifiers angle aperture blur_samples confidence direction focal_point h_angle location look_at right sky up v_angle variance
+syn keyword povModifiers all bump_size filter interpolate map_type once slope_map transmit use_alpha use_color use_colour use_index
+syn keyword povModifiers black_hole agate_turb brick_size control0 control1 cubic_wave density_map flip frequency interpolate inverse lambda metric mortar octaves offset omega phase poly_wave ramp_wave repeat scallop_wave sine_wave size strength triangle_wave thickness turbulence turb_depth type warp
+syn keyword povModifiers eccentricity extinction
+syn keyword povModifiers arc_angle falloff_angle width
+syn keyword povModifiers accuracy all_intersections altitude autostop circular collect coords cutaway_textures dist_exp expand_thresholds exponent exterior gather global_lights major_radius max_trace no_bump_scale no_image no_reflection orient orientation pass_through precompute projected_through range_divider solid spacing split_union tolerance
+
+" Words not marked `reserved' in documentation, but...
+syn keyword povBMPType alpha gif iff jpeg pgm png pot ppm sys tga tiff contained
+syn keyword povFontType ttf contained
+syn keyword povDensityType df3 contained
+syn keyword povCharset ascii utf8 contained
+
+" Math functions on floats, vectors and strings
+syn keyword povFunctions abs acos acosh asc asin asinh atan atan2 atanh ceil cos cosh defined degrees dimensions dimension_size div exp file_exists floor int internal ln log max min mod pow radians rand seed select sin sinh sqrt strcmp strlen tan tanh val vdot vlength vstr vturbulence
+syn keyword povFunctions min_extent max_extent trace vcross vrotate vaxis_rotate vnormalize vturbulence
+syn keyword povFunctions chr concat substr str strupr strlwr
+syn keyword povJuliaFunctions acosh asinh atan cosh cube pwr reciprocal sinh sqr tanh
+
+" Specialities
+syn keyword povConsts clock clock_delta clock_on final_clock final_frame frame_number initial_clock initial_frame image_width image_height false no off on pi t true u v version x y yes z
+syn match povDotItem "\.\@<=\(blue\|green\|filter\|red\|transmit\|t\|u\|v\|x\|y\|z\)\>" display
+
+" Comments
+syn region povComment start="/\*" end="\*/" contains=povTodo,povComment
+syn match povComment "//.*" contains=povTodo
+syn match povCommentError "\*/"
+syn sync ccomment povComment
+syn sync minlines=50
+syn keyword povTodo TODO FIXME XXX NOT contained
+syn cluster povPRIVATE add=povTodo
+
+" Language directives
+syn match povConditionalDir "#\s*\(else\|end\|if\|ifdef\|ifndef\|switch\|while\)\>"
+syn match povLabelDir "#\s*\(break\|case\|default\|range\)\>"
+syn match povDeclareDir "#\s*\(declare\|default\|local\|macro\|undef\|version\)\>"
+syn match povIncludeDir "#\s*include\>"
+syn match povFileDir "#\s*\(fclose\|fopen\|read\|write\)\>"
+syn match povMessageDir "#\s*\(debug\|error\|render\|statistics\|warning\)\>"
+syn region povFileOpen start="#\s*fopen\>" skip=+"[^"]*"+ matchgroup=povOpenType end="\<\(read\|write\|append\)\>" contains=ALLBUT,PovParenError,PovBraceError,@PovPRIVATE transparent keepend
+
+" Literal strings
+syn match povSpecialChar "\\\d\d\d\|\\." contained
+syn region povString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=povSpecialChar oneline
+syn cluster povPRIVATE add=povSpecialChar
+
+" Catch errors caused by wrong parenthesization
+syn region povParen start='(' end=')' contains=ALLBUT,povParenError,@povPRIVATE transparent
+syn match povParenError ")"
+syn region povBrace start='{' end='}' contains=ALLBUT,povBraceError,@povPRIVATE transparent
+syn match povBraceError "}"
+
+" Numbers
+syn match povNumber "\(^\|\W\)\@<=[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="
+
+" Define the default highlighting
+hi def link povComment Comment
+hi def link povTodo Todo
+hi def link povNumber Number
+hi def link povString String
+hi def link povFileOpen Constant
+hi def link povConsts Constant
+hi def link povDotItem Constant
+hi def link povBMPType povSpecial
+hi def link povCharset povSpecial
+hi def link povDensityType povSpecial
+hi def link povFontType povSpecial
+hi def link povOpenType povSpecial
+hi def link povSpecialChar povSpecial
+hi def link povSpecial Special
+hi def link povConditionalDir PreProc
+hi def link povLabelDir PreProc
+hi def link povDeclareDir Define
+hi def link povIncludeDir Include
+hi def link povFileDir PreProc
+hi def link povMessageDir Debug
+hi def link povAppearance povDescriptors
+hi def link povObjects povDescriptors
+hi def link povGlobalSettings povDescriptors
+hi def link povDescriptors Type
+hi def link povJuliaFunctions PovFunctions
+hi def link povModifiers povFunctions
+hi def link povFunctions Function
+hi def link povCommands Operator
+hi def link povTransform Operator
+hi def link povCSG Operator
+hi def link povParenError povError
+hi def link povBraceError povError
+hi def link povCommentError povError
+hi def link povError Error
+
+let b:current_syntax = "pov"
diff --git a/runtime/syntax/povini.vim b/runtime/syntax/povini.vim
new file mode 100644
index 000000000..02169ea23
--- /dev/null
+++ b/runtime/syntax/povini.vim
@@ -0,0 +1,62 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: PoV-Ray(tm) 3.5 configuration/initialization files
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-06-01
+" URL: http://physics.muni.cz/~yeti/download/syntax/povini.vim
+" Required Vim Version: 6.0
+
+" Setup
+if version >= 600
+ " Quit when a syntax file was already loaded
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ " Croak when an old Vim is sourcing us.
+ echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or usea version of " . expand("<sfile>:t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "."
+ finish
+endif
+
+syn case ignore
+
+" Syntax
+syn match poviniInclude "^\s*[^[+-;]\S*\s*$" contains=poviniSection
+syn match poviniLabel "^.\{-1,}\ze=" transparent contains=poviniKeyword nextgroup=poviniBool,poviniNumber
+syn keyword poviniBool On Off True False Yes No
+syn match poviniNumber "\<\d*\.\=\d\+\>"
+syn keyword poviniKeyword Clock Initial_Frame Final_Frame Initial_Clock Final_Clock Subset_Start_Frame Subset_End_Frame Cyclic_Animation Field_Render Odd_Field
+syn keyword poviniKeyword Width Height Start_Column Start_Row End_Column End_Row Test_Abort Test_Abort_Count Continue_Trace Create_Ini
+syn keyword poviniKeyword Display Video_Mode Palette Display_Gamma Pause_When_Done Verbose Draw_Vistas Preview_Start_Size Preview_End_Size
+syn keyword poviniKeyword Output_to_File Output_File_Type Output_Alpha Bits_Per_Color Output_File_Name Buffer_Output Buffer_Size
+syn keyword poviniKeyword Histogram_Type Histogram_Grid_Size Histogram_Name
+syn keyword poviniKeyword Input_File_Name Include_Header Library_Path Version
+syn keyword poviniKeyword Debug_Console Fatal_Console Render_Console Statistic_Console Warning_Console All_Console Debug_File Fatal_File Render_File Statistic_File Warning_File All_File Warning_Level
+syn keyword poviniKeyword Quality Radiosity Bounding Bounding_Threshold Light_Buffer Vista_Buffer Remove_Bounds Split_Unions Antialias Sampling_Method Antialias_Threshold Jitter Jitter_Amount Antialias_Depth
+syn keyword poviniKeyword Pre_Scene_Return Pre_Frame_Return Post_Scene_Return Post_Frame_Return User_Abort_Return Fatal_Error_Return
+syn match poviniShellOut "^\s*\(Pre_Scene_Command\|Pre_Frame_Command\|Post_Scene_Command\|Post_Frame_Command\|User_Abort_Command\|Fatal_Error_Command\)\>" nextgroup=poviniShellOutEq skipwhite
+syn match poviniShellOutEq "=" nextgroup=poviniShellOutRHS skipwhite contained
+syn match poviniShellOutRHS "[^;]\+" skipwhite contained contains=poviniShellOutSpecial
+syn match poviniShellOutSpecial "%[osnkhw%]" contained
+syn keyword poviniDeclare Declare
+syn match poviniComment ";.*$"
+syn match poviniOption "^\s*[+-]\S*"
+syn match poviniIncludeLabel "^\s*Include_INI\s*=" nextgroup=poviniIncludedFile skipwhite
+syn match poviniIncludedFile "[^;]\+" contains=poviniSection contained
+syn region poviniSection start="\[" end="\]"
+
+" Define the default highlighting
+hi def link poviniSection Special
+hi def link poviniComment Comment
+hi def link poviniDeclare poviniKeyword
+hi def link poviniShellOut poviniKeyword
+hi def link poviniIncludeLabel poviniKeyword
+hi def link poviniKeyword Type
+hi def link poviniShellOutSpecial Special
+hi def link poviniIncludedFile poviniInclude
+hi def link poviniInclude Include
+hi def link poviniOption Keyword
+hi def link poviniBool Constant
+hi def link poviniNumber Number
+
+let b:current_syntax = "povini"
diff --git a/runtime/syntax/ppd.vim b/runtime/syntax/ppd.vim
new file mode 100644
index 000000000..192f70c05
--- /dev/null
+++ b/runtime/syntax/ppd.vim
@@ -0,0 +1,48 @@
+" Vim syntax file
+" Language: PPD (PostScript printer description) file
+" Maintainer: Bjoern Jacke <bjacke@suse.de>
+" Last Change: 2001-10-06
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+syn match ppdComment "^\*%.*"
+syn match ppdDef "\*[a-zA-Z0-9]\+"
+syn match ppdDefine "\*[a-zA-Z0-9\-_]\+:"
+syn match ppdUI "\*[a-zA-Z]*\(Open\|Close\)UI"
+syn match ppdUIGroup "\*[a-zA-Z]*\(Open\|Close\)Group"
+syn match ppdGUIText "/.*:"
+syn match ppdContraints "^*UIConstraints:"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ahdl_syn_inits")
+ if version < 508
+ let did_ahdl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+
+ HiLink ppdComment Comment
+ HiLink ppdDefine Statement
+ HiLink ppdUI Function
+ HiLink ppdUIGroup Function
+ HiLink ppdDef String
+ HiLink ppdGUIText Type
+ HiLink ppdContraints Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ppd"
+
+" vim: ts=8
diff --git a/runtime/syntax/ppwiz.vim b/runtime/syntax/ppwiz.vim
new file mode 100644
index 000000000..d3d7b3a17
--- /dev/null
+++ b/runtime/syntax/ppwiz.vim
@@ -0,0 +1,97 @@
+" Vim syntax file
+" Language: PPWizard (preprocessor by Dennis Bareis)
+" Maintainer: Stefan Schwarzer <s.schwarzer@ndh.net>
+" URL: http://www.ndh.net/home/sschwarzer/download/ppwiz.vim
+" Last Change: 2003 May 11
+" Filename: ppwiz.vim
+
+" Remove old syntax stuff
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+if !exists("ppwiz_highlight_defs")
+ let ppwiz_highlight_defs = 1
+endif
+
+if !exists("ppwiz_with_html")
+ let ppwiz_with_html = 1
+endif
+
+" comments
+syn match ppwizComment "^;.*$"
+syn match ppwizComment ";;.*$"
+" HTML
+if ppwiz_with_html > 0
+ syn region ppwizHTML start="<" end=">" contains=ppwizArg,ppwizMacro
+ syn match ppwizHTML "\&\w\+;"
+endif
+" define, evaluate etc.
+if ppwiz_highlight_defs == 1
+ syn match ppwizDef "^\s*\#\S\+\s\+\S\+" contains=ALL
+ syn match ppwizDef "^\s*\#\(if\|else\|endif\)" contains=ALL
+ syn match ppwizDef "^\s*\#\({\|break\|continue\|}\)" contains=ALL
+" elseif ppwiz_highlight_defs == 2
+" syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ALL
+else
+ syn region ppwizDef start="^\s*\#" end="[^\\]$" end="^$" keepend contains=ppwizCont
+endif
+syn match ppwizError "\s.\\$"
+syn match ppwizCont "\s\([+\-%]\|\)\\$"
+" macros to execute
+syn region ppwizMacro start="<\$" end=">" contains=@ppwizArgVal,ppwizCont
+" macro arguments
+syn region ppwizArg start="{" end="}" contains=ppwizEqual,ppwizString
+syn match ppwizEqual "=" contained
+syn match ppwizOperator "<>\|=\|<\|>" contained
+" standard variables (builtin)
+syn region ppwizStdVar start="<?[^?]" end=">" contains=@ppwizArgVal
+" Rexx variables
+syn region ppwizRexxVar start="<??" end=">" contains=@ppwizArgVal
+" Constants
+syn region ppwizString start=+"+ end=+"+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
+syn region ppwizString start=+'+ end=+'+ contained contains=ppwizMacro,ppwizArg,ppwizHTML,ppwizCont,ppwizStdVar,ppwizRexxVar
+syn match ppwizInteger "\d\+" contained
+
+" Clusters
+syn cluster ppwizArgVal add=ppwizString,ppwizInteger
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ppwiz_syn_inits")
+ if version < 508
+ let did_ppwiz_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ppwizSpecial Special
+ HiLink ppwizEqual ppwizSpecial
+ HiLink ppwizOperator ppwizSpecial
+ HiLink ppwizComment Comment
+ HiLink ppwizDef PreProc
+ HiLink ppwizMacro Statement
+ HiLink ppwizArg Identifier
+ HiLink ppwizStdVar Identifier
+ HiLink ppwizRexxVar Identifier
+ HiLink ppwizString Constant
+ HiLink ppwizInteger Constant
+ HiLink ppwizCont ppwizSpecial
+ HiLink ppwizError Error
+ HiLink ppwizHTML Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ppwiz"
+
+" vim: ts=4
+
diff --git a/runtime/syntax/procmail.vim b/runtime/syntax/procmail.vim
new file mode 100644
index 000000000..c2ffa3988
--- /dev/null
+++ b/runtime/syntax/procmail.vim
@@ -0,0 +1,67 @@
+" Vim syntax file
+" Language: Procmail definition file
+" Maintainer: Melchior FRANZ <mfranz@aon.at>
+" Last Change: 2003 Aug 14
+" Author: Sonia Heimann
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match procmailComment "#.*$" contains=procmailTodo
+syn keyword procmailTodo contained Todo TBD
+
+syn region procmailString start=+"+ skip=+\\"+ end=+"+
+syn region procmailString start=+'+ skip=+\\'+ end=+'+
+
+syn region procmailVarDeclRegion start="^\s*[a-zA-Z0-9_]\+\s*="hs=e-1 skip=+\\$+ end=+$+ contains=procmailVar,procmailVarDecl,procmailString
+syn match procmailVarDecl contained "^\s*[a-zA-Z0-9_]\+"
+syn match procmailVar "$[a-zA-Z0-9_]\+"
+
+syn match procmailCondition contained "^\s*\*.*"
+
+syn match procmailActionFolder contained "^\s*[-_a-zA-Z0-9/]\+"
+syn match procmailActionVariable contained "^\s*$[a-zA-Z_]\+"
+syn region procmailActionForward start=+^\s*!+ skip=+\\$+ end=+$+
+syn region procmailActionPipe start=+^\s*|+ skip=+\\$+ end=+$+
+syn region procmailActionNested start=+^\s*{+ end=+^\s*}+ contains=procmailRecipe,procmailComment,procmailVarDeclRegion
+
+syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_procmail_syntax_inits")
+ if version < 508
+ let did_procmail_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink procmailComment Comment
+ HiLink procmailTodo Todo
+
+ HiLink procmailRecipe Statement
+ "HiLink procmailCondition Statement
+
+ HiLink procmailActionFolder procmailAction
+ HiLink procmailActionVariable procmailAction
+ HiLink procmailActionForward procmailAction
+ HiLink procmailActionPipe procmailAction
+ HiLink procmailAction Function
+ HiLink procmailVar Identifier
+ HiLink procmailVarDecl Identifier
+
+ HiLink procmailString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "procmail"
+
+" vim: ts=8
diff --git a/runtime/syntax/progress.vim b/runtime/syntax/progress.vim
new file mode 100644
index 000000000..dd29310ad
--- /dev/null
+++ b/runtime/syntax/progress.vim
@@ -0,0 +1,215 @@
+" Vim syntax file
+" Language: Progress 4GL
+" Filename extensions: *.p (collides with Pascal),
+" *.i (collides with assembler)
+" *.w (collides with cweb)
+" Maintainer: Philip Uren <philu@computer.org>
+" Contributors: Chris Ruprecht <chrup@mac.com>
+" Philip Uren <philu@computer.org>
+" Mikhail Kuperblum <mikhail@whasup.com>
+" URL: http://www.zeta.org.au/~philu/vim/progress.vim
+" Last Change: Thu May 3 08:49:47 EST 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,-,!,#,$,%
+else
+ set iskeyword=@,48-57,_,-,!,#,$,%
+endif
+
+syn case ignore
+
+" Progress Blocks of code and mismatched "end." errors.
+syn match ProgressEndError "\<end\>"
+syn region ProgressDoBlock transparent matchgroup=ProgressDo start="\<do\>" matchgroup=ProgressDo end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
+syn region ProgressForBlock transparent matchgroup=ProgressFor start="\<for\>" matchgroup=ProgressFor end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
+syn region ProgressRepeatBlock transparent matchgroup=ProgressRepeat start="\<repeat\>" matchgroup=ProgressRepeat end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
+syn region ProgressCaseBlock transparent matchgroup=ProgressCase start="\<case\>" matchgroup=ProgressCase end="\<end\scase\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
+
+" These are Progress reserved words,
+" and they could go in ProgressReserved,
+" but I found it more helpful to highlight them in a different color.
+syn keyword ProgressConditional if else then when otherwise
+syn keyword ProgressFor each where
+
+" Make those TODO and debugging notes stand out!
+syn keyword ProgressTodo contained TODO BUG FIX
+syn keyword ProgressDebug contained DEBUG
+syn keyword ProgressDebug debugger
+
+syn keyword ProgressFunction procedure function
+
+syn keyword ProgressReserved accum[ulate] active-window add alias all alter ambig[uous] analyz[e] and any apply as asc[ending] assign at attr[-space]
+syn keyword ProgressReserved authorization auto-ret[urn] avail[able] back[ground] before-h[ide] begins bell between blank break btos by call can-do can-find
+syn keyword ProgressReserved center[ed] check chr clear clipboard col colon color col[umn] column-lab[el] col[umns] compiler connected control count-of
+syn keyword ProgressReserved cpstream create ctos current current-changed current-lang[uage] current-window current_date curs[or] database dataservers
+syn keyword ProgressReserved dbcodepage dbcollation dbname dbrest[rictions] dbtaskid dbtype dbvers[ion] dde deblank debug-list debugger decimals declare
+syn keyword ProgressReserved def default default-noxl[ate] default-window def[ine] delete delimiter desc[ending] dict[ionary] disable discon[nect] disp
+syn keyword ProgressReserved disp[lay] distinct dos down drop editing enable encode entry error-stat[us] escape etime except exclusive
+syn keyword ProgressReserved exclusive[-lock] exclusive-web-us[er] exists export false fetch field field[s] file-info[rmation] fill find find-case-sensitive
+syn keyword ProgressReserved find-global find-next-occurrence find-prev-occurrence find-select find-wrap-around first first-of focus font form form[at]
+syn keyword ProgressReserved fram[e] frame-col frame-db frame-down frame-field frame-file frame-inde[x] frame-line frame-name frame-row frame-val[ue]
+syn keyword ProgressReserved from from-c[hars] from-p[ixels] gateway[s] get-byte get-codepage[s] get-coll[ations] get-key-val[ue] getbyte global go-on
+syn keyword ProgressReserved go-pend[ing] grant graphic-e[dge] group having header help hide import in index indicator input input-o[utput] insert
+syn keyword ProgressReserved into is is-attr[-space] join kblabel key-code key-func[tion] key-label keycode keyfunc[tion] keylabel keys keyword label
+syn keyword ProgressReserved last last-even[t] last-key last-of lastkey ldbname leave library like line-count[er] listi[ng] locked lookup machine-class
+syn keyword ProgressReserved map member message message-lines mouse mpe new next next-prompt no no-attr[-space] no-error no-f[ill] no-help no-hide no-label[s]
+syn keyword ProgressReserved no-lock no-map no-mes[sage] no-pause no-prefe[tch] no-undo no-val[idate] no-wait not null num-ali[ases] num-dbs num-entries
+syn keyword ProgressReserved of off old on open opsys option or os-append os-command os-copy os-create-dir os-delete os-dir os-drive[s] os-error os-rename
+syn keyword ProgressReserved os2 os400 output overlay page page-bot[tom] page-num[ber] page-top param[eter] pause pdbname persist[ent] pixels
+syn keyword ProgressReserved preproc[ess] privileges proc-ha[ndle] proc-st[atus] process program-name Progress prompt prompt[-for] promsgs propath provers[ion]
+syn keyword ProgressReserved put put-byte put-key-val[ue] putbyte query query-tuning quit r-index rcode-informatio[n] readkey recid record-len[gth] rect[angle]
+syn keyword ProgressReserved release reposition retain retry return return-val[ue] revert revoke run save schema screen screen-io screen-lines
+syn keyword ProgressReserved scroll sdbname search seek select self session set setuser[id] share[-lock] shared show-stat[s] skip some space status stream
+syn keyword ProgressReserved stream-io string-xref system-dialog table term term[inal] text text-cursor text-seg[-growth] this-procedure time title
+syn keyword ProgressReserved to today top-only trans trans[action] trigger triggers trim true underl[ine] undo unform[atted] union unique unix up update
+syn keyword ProgressReserved use-index use-revvideo use-underline user user[id] using v6frame value values view view-as vms wait-for web-con[text]
+syn keyword ProgressReserved window window-maxim[ized] window-minim[ized] window-normal with work-tab[le] workfile write xcode xref yes _cbit
+syn keyword ProgressReserved _control _list _memory _msg _pcontrol _serial[-num] _trace
+
+" Strings. Handles embedded quotes.
+" Note that, for some reason, Progress doesn't use the backslash, "\"
+" as the escape character; it uses tilde, "~".
+syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~"+
+syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'+
+
+syn match ProgressIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>()"
+
+" syn match ProgressDelimiter "()"
+
+" syn match ProgressMatrixDelimiter "[][]"
+
+" If you prefer you can highlight the range
+"syn match ProgressMatrixDelimiter "[\d\+\.\.\d\+]"
+
+syn match ProgressNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+syn match ProgressByte "\$[0-9a-fA-F]\+"
+
+" If you don't like tabs:
+"syn match ProgressShowTab "\t"
+"syn match ProgressShowTabc "\t"
+
+syn region ProgressComment start="/\*" end="\*/" contains=ProgressComment,ProgressTodo,ProgressDebug
+syn match ProgressInclude "^[ ]*[{].*\.i[}]"
+
+syn match ProgressSubstitute "^[ ]*[{].*[^i][}]"
+syn match ProgressPreProc "^[ ]*&.*"
+
+syn match ProgressOperator "[!;|)(:.><+*=-]"
+
+syn keyword ProgressOperator <= <> >= abs[olute] accelerator across add-first add-last advise alert-box allow-replication ansi-only anywhere append appl-alert[-boxes] application as-cursor ask-overwrite
+syn keyword ProgressOperator attach[ment] auto-end-key auto-endkey auto-go auto-ind[ent] auto-resize auto-z[ap] available-formats ave[rage] avg backward[s] base-key batch[-mode] bgc[olor] binary
+syn keyword ProgressOperator bind-where block-iteration-display border-bottom border-bottom-ch[ars] border-bottom-pi[xels] border-left border-left-char[s] border-left-pixe[ls] border-right border-right-cha[rs]
+syn keyword ProgressOperator border-right-pix[els] border-t[op] border-t[op-chars] border-top-pixel[s] both bottom box box-select[able] browse browse-header buffer buffer-chars buffer-lines
+syn keyword ProgressOperator button button[s] byte cache cache-size can-query can-set cancel-break cancel-button caps careful-paint case-sensitive cdecl char[acter] character_length charset
+syn keyword ProgressOperator checked choose clear-select[ion] close code codepage codepage-convert col-of colon-align[ed] color-table column-bgc[olor] column-dcolor column-fgc[olor] column-font
+syn keyword ProgressOperator column-label-bgc[olor] column-label-dcolor column-label-fgc[olor] column-label-font column-of column-pfc[olor] column-sc[rolling] combo-box command compile complete
+syn keyword ProgressOperator connect constrained contents context context-pop[up] control-containe[r] c[ontrol-form] convert-to-offse[t] convert count cpcase cpcoll cpint[ernal] cplog
+syn keyword ProgressOperator cpprint cprcodein cprcodeout cpterm crc-val[ue] c[reate-control] create-result-list-entry create-test-file current-column current-environm[ent] current-iteration
+syn keyword ProgressOperator current-result-row current-row-modified current-value cursor-char cursor-line cursor-offset data-entry-retur[n] data-t[ype] date date-f[ormat] day db-references
+syn keyword ProgressOperator dcolor dde-error dde-i[d] dde-item dde-name dde-topic debu[g] dec[imal] default-b[utton] default-extensio[n] defer-lob-fetch defined delete-char delete-current-row
+syn keyword ProgressOperator delete-line delete-selected-row delete-selected-rows deselect-focused-row deselect-rows deselect-selected-row d[esign-mode] dialog-box dialog-help dir disabled display-message
+syn keyword ProgressOperator display-t[ype] double drag-enabled drop-down drop-down-list dump dynamic echo edge edge[-chars] edge-p[ixels] editor empty end-key endkey entered eq error error-col[umn]
+syn keyword ProgressOperator error-row event-t[ype] event[s] exclusive-id execute exp expand extended extent external extract fetch-selected-row fgc[olor] file file-name file-off[set] file-type
+syn keyword ProgressOperator filename fill-in filled filters first-child first-column first-proc[edure] first-tab-i[tem] fixed-only float focused-row font-based-layout font-table force-file
+syn keyword ProgressOperator fore[ground] form-input forward[s] frame-spa[cing] frame-x frame-y frequency from-cur[rent] full-height full-height-char[s] full-height-pixe[ls] full-pathn[ame]
+syn keyword ProgressOperator full-width full-width[-chars] full-width-pixel[s] ge get get-blue[-value] g[et-char-property] get-double get-dynamic get-file get-float get-green[-value]
+syn keyword ProgressOperator get-iteration get-license get-long get-message get-number get-pointer-value get-red[-value] get-repositioned-row get-selected-wid[get] get-short get-signature get-size
+syn keyword ProgressOperator get-string get-tab-item get-text-height get-text-height-char[s] get-text-height-pixe[ls] get-text-width get-text-width-c[hars] get-text-width-pixel[s] get-unsigned-short
+syn keyword ProgressOperator grayed grid-factor-horizont[al] grid-factor-vert[ical] grid-set grid-snap grid-unit-height grid-unit-height-cha[rs] grid-unit-height-pix[els] grid-unit-width grid-unit-width-char[s]
+syn keyword ProgressOperator grid-unit-width-pixe[ls] grid-visible gt handle height height[-chars] height-p[ixels] help-con[text] helpfile-n[ame] hidden hint hori[zontal] hwnd image image-down
+syn keyword ProgressOperator image-insensitive image-size image-size-c[hars] image-size-pixel[s] image-up immediate-display index-hint indexed-reposition info[rmation] init init[ial] initial-dir
+syn keyword ProgressOperator initial-filter initiate inner inner-chars inner-lines insert-b[acktab] insert-file insert-row insert-string insert-t[ab] int[eger] internal-entries is-lead-byte
+syn keyword ProgressOperator is-row-selected is-selected item items-per-row join-by-sqldb keep-frame-z-ord[er] keep-messages keep-tab-order key keyword-all label-bgc[olor] label-dc[olor] label-fgc[olor]
+syn keyword ProgressOperator label-font label-pfc[olor] labels language[s] large large-to-small last-child last-tab-i[tem] last-proce[dure] lc le leading left left-align[ed] left-trim length
+syn keyword ProgressOperator line list-events list-items list-query-attrs list-set-attrs list-widgets load l[oad-control] load-icon load-image load-image-down load-image-insensitive load-image-up
+syn keyword ProgressOperator load-mouse-point[er] load-small-icon log logical lookahead lower lt manual-highlight margin-extra margin-height margin-height-ch[ars] margin-height-pi[xels] margin-width
+syn keyword ProgressOperator margin-width-cha[rs] margin-width-pix[els] matches max max-chars max-data-guess max-height max-height[-chars] max-height-pixel[s] max-rows max-size max-val[ue] max-width
+syn keyword ProgressOperator max-width[-chars] max-width-p[ixels] maximize max[imum] memory menu menu-bar menu-item menu-k[ey] menu-m[ouse] menubar message-area message-area-font message-line
+syn keyword ProgressOperator min min-height min-height[-chars] min-height-pixel[s] min-size min-val[ue] min-width min-width[-chars] min-width-p[ixels] min[imum] mod modified mod[ulo] month mouse-p[ointer]
+syn keyword ProgressOperator movable move-after-tab-i[tem] move-before-tab-[item] move-col[umn] move-to-b[ottom] move-to-eof move-to-t[op] multiple multiple-key multitasking-interval must-exist
+syn keyword ProgressOperator name native ne new-row next-col[umn] next-sibling next-tab-ite[m] next-value no-apply no-assign no-bind-where no-box no-column-scroll[ing] no-convert no-current-value
+syn keyword ProgressOperator no-debug no-drag no-echo no-index-hint no-join-by-sqldb no-lookahead no-row-markers no-scrolling no-separate-connection no-separators no-und[erline] no-word-wrap
+syn keyword ProgressOperator none num-but[tons] num-col[umns] num-copies num-formats num-items num-iterations num-lines num-locked-colum[ns] num-messages num-results num-selected num-selected-rows
+syn keyword ProgressOperator num-selected-widgets num-tabs num-to-retain numeric numeric-f[ormat] octet_length ok ok-cancel on-frame[-border] ordered-join ordinal orientation os-getenv outer
+syn keyword ProgressOperator outer-join override owner page-size page-wid[th] paged parent partial-key pascal pathname pfc[olor] pinnable pixels-per-colum[n] pixels-per-row popup-m[enu] popup-o[nly]
+syn keyword ProgressOperator position precision presel[ect] prev prev-col[umn] prev-sibling prev-tab-i[tem] primary printer-control-handle printer-setup private-d[ata] profiler Progress-s[ource]
+syn keyword ProgressOperator publish put-double put-float put-long put-short put-string put-unsigned-short query-off-end question radio-buttons radio-set random raw raw-transfer read-file read-only
+syn keyword ProgressOperator real recursive refresh refreshable replace replace-selection-text replication-create replication-delete replication-write request resiza[ble] resize retry-cancel
+syn keyword ProgressOperator return-ins[erted] return-to-start-di[r] reverse-from right right-align[ed] right-trim round row row-ma[rkers] row-of rowid rule rule-row rule-y save-as save-file
+syn keyword ProgressOperator screen-val[ue] scroll-bars scroll-delta scroll-horiz-value scroll-offset scroll-to-current-row scroll-to-i[tem] scroll-to-selected-row scroll-vert-value scrollable
+syn keyword ProgressOperator scrollbar-horizo[ntal] scrollbar-vertic[al] scrolled-row-positio[n] scrolling se-check-pools se-enable-of[f] se-enable-on se-num-pools se-use-messa[ge] section select-focused-row
+syn keyword ProgressOperator select-next-row select-prev-row select-repositioned-row select-row selectable selected selected-items selection-end selection-list selection-start selection-text
+syn keyword ProgressOperator send sensitive separate-connection separators set-blue[-value] set-break set-cell-focus set-contents set-dynamic set-green[-value] set-leakpoint set-pointer-valu[e]
+syn keyword ProgressOperator s[et-property] set-red[-value] set-repositioned-row set-selection set-size set-wait[-state] side-lab side-lab[e] side-lab[el] side-label-handl[e] side-lab[els] silent
+syn keyword ProgressOperator simple single size size-c[hars] size-p[ixels] slider smallint sort source source-procedure sql sqrt start status-area status-area-font status-bar stdcall stenciled stop stoppe[d]
+syn keyword ProgressOperator stored-proc[edure] string sub-ave[rage] sub-count sub-max[imum] sub-me[nu] sub-menu-help sub-min[imum] sub-total subscribe subst[itute] substr[ing] subtype sum super suppress-warning[s]
+syn keyword ProgressOperator system-alert-box[es] system-help tab-position tabbable target target-procedure temp-dir[ectory] temp-table terminate text-selected three-d through thru tic-marks time-source title-bgc[olor]
+syn keyword ProgressOperator title-dc[olor] title-fgc[olor] title-fo[nt] to-rowid toggle-box tool-bar top topic total trailing trunc[ate] type unbuff[ered] unique-id unload unsubscribe upper use use-dic[t-exps]
+syn keyword ProgressOperator use-filename use-text v6display valid-event valid-handle validate validate-condition validate-message var[iable] vert[ical] virtual-height virtual-height-c[hars]
+syn keyword ProgressOperator virtual-height-pixel[s] virtual-width virtual-width-ch[ars] virtual-width-pi[xels] visible wait warning weekday widget widget-e[nter] widget-h[andle] widget-l[eave]
+syn keyword ProgressOperator widget-pool width width[-chars] width-p[ixels] window-name window-sta[te] window-sys[tem] word-wrap x-of y-of year yes-no yes-no-cancel _dcm
+
+syn keyword ProgressType char[acter] int[eger] format
+syn keyword ProgressType var[iable] log[ical] da[te]
+
+syn sync lines=800
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_progress_syntax_inits")
+ if version < 508
+ let did_progress_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later.
+ HiLink ProgressByte Number
+ HiLink ProgressCase Repeat
+ HiLink ProgressComment StatusLine
+ HiLink ProgressConditional Conditional
+ HiLink ProgressDebug Debug
+ HiLink ProgressDo Repeat
+ HiLink ProgressEndError Error
+ HiLink ProgressFor Repeat
+ HiLink ProgressFunction Procedure
+ HiLink ProgressInclude Include
+ HiLink ProgressLabel Label
+ HiLink ProgressMatrixDelimiter Identifier
+ HiLink ProgressModifier Type
+ HiLink ProgressNumber Number
+ HiLink ProgressOperator Function
+ HiLink ProgressPreProc PreProc
+ HiLink ProgressProcedure Procedure
+ HiLink ProgressQuote Delimiter
+ HiLink ProgressRepeat Repeat
+ HiLink ProgressReserved Identifier
+ HiLink ProgressString String
+ HiLink ProgressStructure Structure
+ HiLink ProgressSubstitute PreProc
+ HiLink ProgressTodo Todo
+ HiLink ProgressType Statement
+ HiLink ProgressUnclassified Statement
+
+ " Optional highlighting
+ " HiLink ProgressDelimiter Identifier
+ " HiLink ProgressShowTab Error
+ " HiLink ProgressShowTabc Error
+ " HiLink ProgressIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "progress"
+
+" vim: ts=4 sw=2
diff --git a/runtime/syntax/prolog.vim b/runtime/syntax/prolog.vim
new file mode 100644
index 000000000..2ca1cfa44
--- /dev/null
+++ b/runtime/syntax/prolog.vim
@@ -0,0 +1,120 @@
+" Vim syntax file
+" Language: PROLOG
+" Maintainers: Ralph Becket <rwab1@cam.sri.co.uk>,
+" Thomas Koehler <jean-luc@picard.franken.de>
+" Last Change: 2003 May 11
+" URL: http://jeanluc-picard.de/vim/syntax/prolog.vim
+
+" There are two sets of highlighting in here:
+" If the "prolog_highlighting_clean" variable exists, it is rather sparse.
+" Otherwise you get more highlighting.
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Prolog is case sensitive.
+syn case match
+
+" Very simple highlighting for comments, clause heads and
+" character codes. It respects prolog strings and atoms.
+
+syn region prologCComment start=+/\*+ end=+\*/+
+syn match prologComment +%.*+
+
+syn keyword prologKeyword module meta_predicate multifile dynamic
+syn match prologCharCode +0'\\\=.+
+syn region prologString start=+"+ skip=+\\"+ end=+"+
+syn region prologAtom start=+'+ skip=+\\'+ end=+'+
+syn region prologClauseHead start=+^[a-z][^(]*(+ skip=+\.[^ ]+ end=+:-\|\.$\|\.[ ]\|-->+
+
+if !exists("prolog_highlighting_clean")
+
+ " some keywords
+ " some common predicates are also highlighted as keywords
+ " is there a better solution?
+ syn keyword prologKeyword abolish current_output peek_code
+ syn keyword prologKeyword append current_predicate put_byte
+ syn keyword prologKeyword arg current_prolog_flag put_char
+ syn keyword prologKeyword asserta fail put_code
+ syn keyword prologKeyword assertz findall read
+ syn keyword prologKeyword at_end_of_stream float read_term
+ syn keyword prologKeyword atom flush_output repeat
+ syn keyword prologKeyword atom_chars functor retract
+ syn keyword prologKeyword atom_codes get_byte set_input
+ syn keyword prologKeyword atom_concat get_char set_output
+ syn keyword prologKeyword atom_length get_code set_prolog_flag
+ syn keyword prologKeyword atomic halt set_stream_position
+ syn keyword prologKeyword bagof integer setof
+ syn keyword prologKeyword call is stream_property
+ syn keyword prologKeyword catch nl sub_atom
+ syn keyword prologKeyword char_code nonvar throw
+ syn keyword prologKeyword char_conversion number true
+ syn keyword prologKeyword clause number_chars unify_with_occurs_check
+ syn keyword prologKeyword close number_codes var
+ syn keyword prologKeyword compound once write
+ syn keyword prologKeyword copy_term op write_canonical
+ syn keyword prologKeyword current_char_conversion open write_term
+ syn keyword prologKeyword current_input peek_byte writeq
+ syn keyword prologKeyword current_op peek_char
+
+ syn match prologOperator "=\\=\|=:=\|\\==\|=<\|==\|>=\|\\=\|\\+\|<\|>\|="
+ syn match prologAsIs "===\|\\===\|<=\|=>"
+
+ syn match prologNumber "\<[0123456789]*\>"
+ syn match prologCommentError "\*/"
+ syn match prologSpecialCharacter ";"
+ syn match prologSpecialCharacter "!"
+ syn match prologQuestion "?-.*\." contains=prologNumber
+
+
+endif
+
+syn sync ccomment maxlines=50
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_prolog_syn_inits")
+ if version < 508
+ let did_prolog_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink prologComment Comment
+ HiLink prologCComment Comment
+ HiLink prologCharCode Special
+
+ if exists ("prolog_highlighting_clean")
+
+ HiLink prologKeyword Statement
+ HiLink prologClauseHead Statement
+
+ else
+
+ HiLink prologKeyword Keyword
+ HiLink prologClauseHead Constant
+ HiLink prologQuestion PreProc
+ HiLink prologSpecialCharacter Special
+ HiLink prologNumber Number
+ HiLink prologAsIs Normal
+ HiLink prologCommentError Error
+ HiLink prologAtom String
+ HiLink prologString String
+ HiLink prologOperator Operator
+
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "prolog"
+
+" vim: ts=8
diff --git a/runtime/syntax/psf.vim b/runtime/syntax/psf.vim
new file mode 100644
index 000000000..2b376f94c
--- /dev/null
+++ b/runtime/syntax/psf.vim
@@ -0,0 +1,103 @@
+" Vim syntax file
+" Language: Software Distributor product specification file
+" (POSIX 1387.2-1995).
+" Maintainer: Rex Barzee <rex_barzee@hp.com>
+" Last change: 25 Apr 2001
+
+if version < 600
+ " Remove any old syntax stuff hanging around
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Product specification files are case sensitive
+syn case match
+
+syn keyword psfObject bundle category control_file depot distribution
+syn keyword psfObject end file fileset host installed_software media
+syn keyword psfObject product root subproduct vendor
+
+syn match psfUnquotString +[^"# ][^#]*+ contained
+syn region psfQuotString start=+"+ skip=+\\"+ end=+"+ contained
+
+syn match psfObjTag "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*" contained
+syn match psfAttAbbrev ",\<\(fa\|fr\|[aclqrv]\)\(<\|>\|<=\|>=\|=\|==\)[^,]\+" contained
+syn match psfObjTags "\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\(\s\+\<[-_+A-Z0-9a-z]\+\(\.[-_+A-Z0-9a-z]\+\)*\)*" contained
+
+syn match psfNumber "\<\d\+\>" contained
+syn match psfFloat "\<\d\+\>\(\.\<\d\+\>\)*" contained
+
+syn match psfLongDate "\<\d\d\d\d\d\d\d\d\d\d\d\d\.\d\d\>" contained
+
+syn keyword psfState available configured corrupt installed transient contained
+syn keyword psfPState applied committed superseded contained
+
+syn keyword psfBoolean false true contained
+
+
+"Some of the attributes covered by attUnquotString and attQuotString:
+" architecture category_tag control_directory copyright
+" create_date description directory file_permissions install_source
+" install_type location machine_type mod_date number os_name os_release
+" os_version pose_as_os_name pose_as_os_release readme revision
+" share_link title vendor_tag
+syn region psfAttUnquotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+[^#" ]~rs=e-1 contains=psfUnquotString,psfComment end=~$~ keepend oneline
+
+syn region psfAttQuotString matchgroup=psfAttrib start=~^\s*[^# ]\+\s\+"~rs=e-1 contains=psfQuotString,psfComment skip=~\\"~ matchgroup=psfQuotString end=~"~ keepend
+
+
+" These regions are defined in attempt to do syntax checking for some
+" of the attributes.
+syn region psfAttTag matchgroup=psfAttrib start="^\s*tag\s\+" contains=psfObjTag,psfComment end="$" keepend oneline
+
+syn region psfAttSpec matchgroup=psfAttrib start="^\s*\(ancestor\|applied_patches\|applied_to\|contents\|corequisites\|exrequisites\|prerequisites\|software_spec\|supersedes\|superseded_by\)\s\+" contains=psfObjTag,psfAttAbbrev,psfComment end="$" keepend
+
+syn region psfAttTags matchgroup=psfAttrib start="^\s*all_filesets\s\+" contains=psfObjTags,psfComment end="$" keepend
+
+syn region psfAttNumber matchgroup=psfAttrib start="^\s*\(compressed_size\|instance_id\|media_sequence_number\|sequence_number\|size\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
+
+syn region psfAttTime matchgroup=psfAttrib start="^\s*\(create_time\|ctime\|mod_time\|mtime\|timestamp\)\s\+" contains=psfNumber,psfComment end="$" keepend oneline
+
+syn region psfAttFloat matchgroup=psfAttrib start="^\s*\(data_model_revision\|layout_version\)\s\+" contains=psfFloat,psfComment end="$" keepend oneline
+
+syn region psfAttLongDate matchgroup=psfAttrib start="^\s*install_date\s\+" contains=psfLongDate,psfComment end="$" keepend oneline
+
+syn region psfAttState matchgroup=psfAttrib start="^\s*\(state\)\s\+" contains=psfState,psfComment end="$" keepend oneline
+
+syn region psfAttPState matchgroup=psfAttrib start="^\s*\(patch_state\)\s\+" contains=psfPState,psfComment end="$" keepend oneline
+
+syn region psfAttBoolean matchgroup=psfAttrib start="^\s*\(is_kernel\|is_locatable\|is_patch\|is_protected\|is_reboot\|is_reference\|is_secure\|is_sparse\)\s\+" contains=psfBoolean,psfComment end="$" keepend oneline
+
+syn match psfComment "#.*$"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_psf_syntax_inits")
+ if version < 508
+ let did_psf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink psfObject Statement
+ HiLink psfAttrib Type
+ HiLink psfQuotString String
+ HiLink psfObjTag Identifier
+ HiLink psfAttAbbrev PreProc
+ HiLink psfObjTags Identifier
+
+ HiLink psfComment Comment
+
+ delcommand HiLink
+endif
+
+" Long descriptions and copyrights confuse the syntax highlighting, so
+" force vim to backup at least 100 lines before the top visible line
+" looking for a sync location.
+syn sync lines=100
+
+let b:current_syntax = "psf"
diff --git a/runtime/syntax/ptcap.vim b/runtime/syntax/ptcap.vim
new file mode 100644
index 000000000..45590cf61
--- /dev/null
+++ b/runtime/syntax/ptcap.vim
@@ -0,0 +1,107 @@
+" Vim syntax file
+" Language: printcap/termcap database
+" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
+" URL: http://folk.uio.no/hakonrk/vim/syntax/ptcap.vim
+" Last Change: 2001 May 15
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Since I only highlight based on the structure of the databases, not
+" specific keywords, case sensitivity isn't required
+syn case ignore
+
+" Since everything that is not caught by the syntax patterns is assumed
+" to be an error, we start parsing 20 lines up, unless something else
+" is specified
+if exists("ptcap_minlines")
+ exe "syn sync lines=".ptcap_minlines
+else
+ syn sync lines=20
+endif
+
+" Highlight everything that isn't caught by the rules as errors,
+" except blank lines
+syn match ptcapError "^.*\S.*$"
+
+syn match ptcapLeadBlank "^\s\+" contained
+
+" `:' and `|' are delimiters for fields and names, and should not be
+" highlighted. Hence, they are linked to `NONE'
+syn match ptcapDelimiter "[:|]" contained
+
+" Escaped characters receive special highlighting
+syn match ptcapEscapedChar "\\." contained
+syn match ptcapEscapedChar "\^." contained
+syn match ptcapEscapedChar "\\\o\{3}" contained
+
+" A backslash at the end of a line will suppress the newline
+syn match ptcapLineCont "\\$" contained
+
+" A number follows the same rules as an integer in C
+syn match ptcapNumber "#\(+\|-\)\=\d\+"lc=1 contained
+syn match ptcapNumberError "#\d*[^[:digit:]:\\]"lc=1 contained
+syn match ptcapNumber "#0x\x\{1,8}"lc=1 contained
+syn match ptcapNumberError "#0x\X"me=e-1,lc=1 contained
+syn match ptcapNumberError "#0x\x\{9}"lc=1 contained
+syn match ptcapNumberError "#0x\x*[^[:xdigit:]:\\]"lc=1 contained
+
+" The `@' operator clears a flag (i.e., sets it to zero)
+" The `#' operator assigns a following number to the flag
+" The `=' operator assigns a string to the preceding flag
+syn match ptcapOperator "[@#=]" contained
+
+" Some terminal capabilites have special names like `#5' and `@1', and we
+" need special rules to match these properly
+syn match ptcapSpecialCap "\W[#@]\d" contains=ptcapDelimiter contained
+
+" If editing a termcap file, an entry in the database is terminated by
+" a (non-escaped) newline. Otherwise, it is terminated by a line which
+" does not start with a colon (:)
+if exists("b:ptcap_type") && b:ptcap_type[0] == 't'
+ syn region ptcapEntry start="^\s*[^[:space:]:]" end="[^\\]\(\\\\\)*$" end="^$" contains=ptcapNames,ptcapField,ptcapLeadBlank keepend
+else
+ syn region ptcapEntry start="^\s*[^[:space:]:]"me=e-1 end="^\s*[^[:space:]:#]"me=e-1 contains=ptcapNames,ptcapField,ptcapLeadBlank,ptcapComment
+endif
+syn region ptcapNames start="^\s*[^[:space:]:]" skip="[^\\]\(\\\\\)*\\:" end=":"me=e-1 contains=ptcapDelimiter,ptcapEscapedChar,ptcapLineCont,ptcapLeadBlank,ptcapComment keepend contained
+syn region ptcapField start=":" skip="[^\\]\(\\\\\)*\\$" end="[^\\]\(\\\\\)*:"me=e-1 end="$" contains=ptcapDelimiter,ptcapString,ptcapNumber,ptcapNumberError,ptcapOperator,ptcapLineCont,ptcapSpecialCap,ptcapLeadBlank,ptcapComment keepend contained
+syn region ptcapString matchgroup=ptcapOperator start="=" skip="[^\\]\(\\\\\)*\\:" matchgroup=ptcapDelimiter end=":"me=e-1 matchgroup=NONE end="[^\\]\(\\\\\)*[^\\]$" end="^$" contains=ptcapEscapedChar,ptcapLineCont keepend contained
+syn region ptcapComment start="^\s*#" end="$" contains=ptcapLeadBlank
+
+if version >= 508 || !exists("did_ptcap_syntax_inits")
+ if version < 508
+ let did_ptcap_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ptcapComment Comment
+ HiLink ptcapDelimiter Delimiter
+ " The highlighting of "ptcapEntry" should always be overridden by
+ " its contents, so I use Todo highlighting to indicate that there
+ " is work to be done with the syntax file if you can see it :-)
+ HiLink ptcapEntry Todo
+ HiLink ptcapError Error
+ HiLink ptcapEscapedChar SpecialChar
+ HiLink ptcapField Type
+ HiLink ptcapLeadBlank NONE
+ HiLink ptcapLineCont Special
+ HiLink ptcapNames Label
+ HiLink ptcapNumber NONE
+ HiLink ptcapNumberError Error
+ HiLink ptcapOperator Operator
+ HiLink ptcapSpecialCap Type
+ HiLink ptcapString NONE
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ptcap"
+
+" vim: sts=4 sw=4 ts=8
diff --git a/runtime/syntax/purifylog.vim b/runtime/syntax/purifylog.vim
new file mode 100644
index 000000000..8bcfb4b00
--- /dev/null
+++ b/runtime/syntax/purifylog.vim
@@ -0,0 +1,119 @@
+" Vim syntax file
+" Language: purify log files
+" Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Purify header
+syn match purifyLogHeader "^\*\*\*\*.*$"
+
+" Informational messages
+syn match purifyLogFIU "^FIU:.*$"
+syn match purifyLogMAF "^MAF:.*$"
+syn match purifyLogMIU "^MIU:.*$"
+syn match purifyLogSIG "^SIG:.*$"
+syn match purifyLogWPF "^WPF:.*$"
+syn match purifyLogWPM "^WPM:.*$"
+syn match purifyLogWPN "^WPN:.*$"
+syn match purifyLogWPR "^WPR:.*$"
+syn match purifyLogWPW "^WPW:.*$"
+syn match purifyLogWPX "^WPX:.*$"
+
+" Warning messages
+syn match purifyLogABR "^ABR:.*$"
+syn match purifyLogBSR "^BSR:.*$"
+syn match purifyLogBSW "^BSW:.*$"
+syn match purifyLogFMR "^FMR:.*$"
+syn match purifyLogMLK "^MLK:.*$"
+syn match purifyLogMSE "^MSE:.*$"
+syn match purifyLogPAR "^PAR:.*$"
+syn match purifyLogPLK "^PLK:.*$"
+syn match purifyLogSBR "^SBR:.*$"
+syn match purifyLogSOF "^SOF:.*$"
+syn match purifyLogUMC "^UMC:.*$"
+syn match purifyLogUMR "^UMR:.*$"
+
+" Corrupting messages
+syn match purifyLogABW "^ABW:.*$"
+syn match purifyLogBRK "^BRK:.*$"
+syn match purifyLogFMW "^FMW:.*$"
+syn match purifyLogFNH "^FNH:.*$"
+syn match purifyLogFUM "^FUM:.*$"
+syn match purifyLogMRE "^MRE:.*$"
+syn match purifyLogSBW "^SBW:.*$"
+
+" Fatal messages
+syn match purifyLogCOR "^COR:.*$"
+syn match purifyLogNPR "^NPR:.*$"
+syn match purifyLogNPW "^NPW:.*$"
+syn match purifyLogZPR "^ZPR:.*$"
+syn match purifyLogZPW "^ZPW:.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_purifyLog_syntax_inits")
+ if version < 508
+ let did_purifyLog_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink purifyLogFIU purifyLogInformational
+ HiLink purifyLogMAF purifyLogInformational
+ HiLink purifyLogMIU purifyLogInformational
+ HiLink purifyLogSIG purifyLogInformational
+ HiLink purifyLogWPF purifyLogInformational
+ HiLink purifyLogWPM purifyLogInformational
+ HiLink purifyLogWPN purifyLogInformational
+ HiLink purifyLogWPR purifyLogInformational
+ HiLink purifyLogWPW purifyLogInformational
+ HiLink purifyLogWPX purifyLogInformational
+
+ HiLink purifyLogABR purifyLogWarning
+ HiLink purifyLogBSR purifyLogWarning
+ HiLink purifyLogBSW purifyLogWarning
+ HiLink purifyLogFMR purifyLogWarning
+ HiLink purifyLogMLK purifyLogWarning
+ HiLink purifyLogMSE purifyLogWarning
+ HiLink purifyLogPAR purifyLogWarning
+ HiLink purifyLogPLK purifyLogWarning
+ HiLink purifyLogSBR purifyLogWarning
+ HiLink purifyLogSOF purifyLogWarning
+ HiLink purifyLogUMC purifyLogWarning
+ HiLink purifyLogUMR purifyLogWarning
+
+ HiLink purifyLogABW purifyLogCorrupting
+ HiLink purifyLogBRK purifyLogCorrupting
+ HiLink purifyLogFMW purifyLogCorrupting
+ HiLink purifyLogFNH purifyLogCorrupting
+ HiLink purifyLogFUM purifyLogCorrupting
+ HiLink purifyLogMRE purifyLogCorrupting
+ HiLink purifyLogSBW purifyLogCorrupting
+
+ HiLink purifyLogCOR purifyLogFatal
+ HiLink purifyLogNPR purifyLogFatal
+ HiLink purifyLogNPW purifyLogFatal
+ HiLink purifyLogZPR purifyLogFatal
+ HiLink purifyLogZPW purifyLogFatal
+
+ HiLink purifyLogHeader Comment
+ HiLink purifyLogInformational PreProc
+ HiLink purifyLogWarning Type
+ HiLink purifyLogCorrupting Error
+ HiLink purifyLogFatal Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "purifylog"
+
+" vim:ts=8
diff --git a/runtime/syntax/pyrex.vim b/runtime/syntax/pyrex.vim
new file mode 100644
index 000000000..f06b2d3d7
--- /dev/null
+++ b/runtime/syntax/pyrex.vim
@@ -0,0 +1,67 @@
+" Vim syntax file
+" Language: Pyrex
+" Maintainer: Marco Barisione <marco.bari@people.it>
+" URL: http://marcobari.altervista.org/pyrex_vim.html
+" Last Change: 2004 May 16
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the Python syntax to start with
+if version < 600
+ so <sfile>:p:h/python.vim
+else
+ runtime! syntax/python.vim
+ unlet b:current_syntax
+endif
+
+" Pyrex extentions
+syn keyword pyrexStatement cdef typedef ctypedef sizeof
+syn keyword pyrexType int long short float double char object void
+syn keyword pyrexType signed unsigned
+syn keyword pyrexStructure struct union enum
+syn keyword pyrexPrecondit include cimport
+syn keyword pyrexAccess public private property readonly extern
+" If someome wants Python's built-ins highlighted probably he
+" also wants Pyrex's built-ins highlighted
+if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
+ syn keyword pyrexBuiltin NULL
+endif
+
+" This deletes "from" from the keywords and re-adds it as a
+" match with lower priority than pyrexForFrom
+syn clear pythonPreCondit
+syn keyword pythonPreCondit import
+syn match pythonPreCondit "from"
+
+" With "for[^:]*\zsfrom" VIM does not match "for" anymore, so
+" I used the slower "\@<=" form
+syn match pyrexForFrom "\(for[^:]*\)\@<=from"
+
+" Default highlighting
+if version >= 508 || !exists("did_pyrex_syntax_inits")
+ if version < 508
+ let did_pyrex_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink pyrexStatement Statement
+ HiLink pyrexType Type
+ HiLink pyrexStructure Structure
+ HiLink pyrexPrecondit PreCondit
+ HiLink pyrexAccess pyrexStatement
+ if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
+ HiLink pyrexBuiltin Function
+ endif
+ HiLink pyrexForFrom Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "pyrex"
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
new file mode 100644
index 000000000..a73dfa73e
--- /dev/null
+++ b/runtime/syntax/python.vim
@@ -0,0 +1,171 @@
+" Vim syntax file
+" Language: Python
+" Maintainer: Neil Schemenauer <nas@python.ca>
+" Updated: 2002-10-18
+"
+" Options to control Python syntax highlighting:
+"
+" For highlighted numbers:
+"
+" let python_highlight_numbers = 1
+"
+" For highlighted builtin functions:
+"
+" let python_highlight_builtins = 1
+"
+" For highlighted standard exceptions:
+"
+" let python_highlight_exceptions = 1
+"
+" Highlight erroneous whitespace:
+"
+" let python_highlight_space_errors = 1
+"
+" If you want all possible Python highlighting (the same as setting the
+" preceding options):
+"
+" let python_highlight_all = 1
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+syn keyword pythonStatement break continue del
+syn keyword pythonStatement except exec finally
+syn keyword pythonStatement pass print raise
+syn keyword pythonStatement return try
+syn keyword pythonStatement global assert
+syn keyword pythonStatement lambda yield
+syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
+syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained
+syn keyword pythonRepeat for while
+syn keyword pythonConditional if elif else
+syn keyword pythonOperator and in is not or
+syn keyword pythonPreCondit import from
+syn match pythonComment "#.*$" contains=pythonTodo
+syn keyword pythonTodo TODO FIXME XXX contained
+
+" strings
+syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape
+syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape
+syn region pythonString matchgroup=Normal start=+[uU]\="""+ end=+"""+ contains=pythonEscape
+syn region pythonString matchgroup=Normal start=+[uU]\='''+ end=+'''+ contains=pythonEscape
+syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+
+syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+
+syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+
+syn region pythonRawString matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+
+syn match pythonEscape +\\[abfnrtv'"\\]+ contained
+syn match pythonEscape "\\\o\{1,3}" contained
+syn match pythonEscape "\\x\x\{2}" contained
+syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained
+syn match pythonEscape "\\$"
+
+if exists("python_highlight_all")
+ let python_highlight_numbers = 1
+ let python_highlight_builtins = 1
+ let python_highlight_exceptions = 1
+ let python_highlight_space_errors = 1
+endif
+
+if exists("python_highlight_numbers")
+ " numbers (including longs and complex)
+ syn match pythonNumber "\<0x\x\+[Ll]\=\>"
+ syn match pythonNumber "\<\d\+[LljJ]\=\>"
+ syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+ syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+ syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
+endif
+
+if exists("python_highlight_builtins")
+ " builtin functions, types and objects, not really part of the syntax
+ syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs
+ syn keyword pythonBuiltin apply buffer callable chr classmethod cmp
+ syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod
+ syn keyword pythonBuiltin eval execfile file filter float getattr globals
+ syn keyword pythonBuiltin hasattr hash hex id input int intern isinstance
+ syn keyword pythonBuiltin issubclass iter len list locals long map max
+ syn keyword pythonBuiltin min object oct open ord pow property range
+ syn keyword pythonBuiltin raw_input reduce reload repr round setattr
+ syn keyword pythonBuiltin slice staticmethod str super tuple type unichr
+ syn keyword pythonBuiltin unicode vars xrange zip
+endif
+
+if exists("python_highlight_exceptions")
+ " builtin exceptions and warnings
+ syn keyword pythonException ArithmeticError AssertionError AttributeError
+ syn keyword pythonException DeprecationWarning EOFError EnvironmentError
+ syn keyword pythonException Exception FloatingPointError IOError
+ syn keyword pythonException ImportError IndentationError IndexError
+ syn keyword pythonException KeyError KeyboardInterrupt LookupError
+ syn keyword pythonException MemoryError NameError NotImplementedError
+ syn keyword pythonException OSError OverflowError OverflowWarning
+ syn keyword pythonException ReferenceError RuntimeError RuntimeWarning
+ syn keyword pythonException StandardError StopIteration SyntaxError
+ syn keyword pythonException SyntaxWarning SystemError SystemExit TabError
+ syn keyword pythonException TypeError UnboundLocalError UnicodeError
+ syn keyword pythonException UserWarning ValueError Warning WindowsError
+ syn keyword pythonException ZeroDivisionError
+endif
+
+if exists("python_highlight_space_errors")
+ " trailing whitespace
+ syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1
+ " mixed tabs and spaces
+ syn match pythonSpaceError display " \+\t"
+ syn match pythonSpaceError display "\t\+ "
+endif
+
+" This is fast but code inside triple quoted strings screws it up. It
+" is impossible to fix because the only way to know if you are inside a
+" triple quoted string is to start from the beginning of the file. If
+" you have a fast machine you can try uncommenting the "sync minlines"
+" and commenting out the rest.
+syn sync match pythonSync grouphere NONE "):$"
+syn sync maxlines=200
+"syn sync minlines=2000
+
+if version >= 508 || !exists("did_python_syn_inits")
+ if version <= 508
+ let did_python_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink pythonStatement Statement
+ HiLink pythonFunction Function
+ HiLink pythonConditional Conditional
+ HiLink pythonRepeat Repeat
+ HiLink pythonString String
+ HiLink pythonRawString String
+ HiLink pythonEscape Special
+ HiLink pythonOperator Operator
+ HiLink pythonPreCondit PreCondit
+ HiLink pythonComment Comment
+ HiLink pythonTodo Todo
+ if exists("python_highlight_numbers")
+ HiLink pythonNumber Number
+ endif
+ if exists("python_highlight_builtins")
+ HiLink pythonBuiltin Function
+ endif
+ if exists("python_highlight_exceptions")
+ HiLink pythonException Exception
+ endif
+ if exists("python_highlight_space_errors")
+ HiLink pythonSpaceError Error
+ endif
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "python"
+
+" vim: ts=8
diff --git a/runtime/syntax/qf.vim b/runtime/syntax/qf.vim
new file mode 100644
index 000000000..5c987a97b
--- /dev/null
+++ b/runtime/syntax/qf.vim
@@ -0,0 +1,24 @@
+" Vim syntax file
+" Language: Quickfix window
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2001 Jan 15
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful C keywords
+syn match qfFileName "^[^|]*" nextgroup=qfSeparator
+syn match qfSeparator "|" nextgroup=qfLineNr contained
+syn match qfLineNr "[^|]*" contained contains=qfError
+syn match qfError "error" contained
+
+" The default highlighting.
+hi def link qfFileName Directory
+hi def link qfLineNr LineNr
+hi def link qfError Error
+
+let b:current_syntax = "qf"
+
+" vim: ts=8
diff --git a/runtime/syntax/quake.vim b/runtime/syntax/quake.vim
new file mode 100644
index 000000000..1ae8c71af
--- /dev/null
+++ b/runtime/syntax/quake.vim
@@ -0,0 +1,162 @@
+" Vim syntax file
+" Language: Quake[1-3] Configuration File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/quake/
+" Latest Revision: 2004-05-22
+" arch-tag: a95793d7-cab3-4544-a78c-1cea47b5870b
+" Variables: quake_is_quake1 - the syntax is to be used for quake1 configs
+" quake_is_quake2 - the syntax is to be used for quake2 configs
+" quake_is_quake3 - the syntax is to be used for quake3 configs
+
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk 48-57,65-90,97-122,+,-,_
+delcommand SetIsk
+
+
+" comments
+syn region quakeComment display oneline start="//" end="$" end=";" keepend contains=quakeTodo
+
+" todo
+syn keyword quakeTodo contained TODO FIXME XXX NOTE
+
+" string (can contain numbers (which should be hilighted as such)
+syn region quakeString display oneline start=+"+ skip=+\\"+ end=+"\|$+ contains=quakeNumbers,@quakeCommands
+
+" number
+syn case ignore
+syn match quakeNumbers display transparent "\<\d\|\.\d" contains=quakeNumber,quakeFloat,quakeOctalError,quakeOctal
+syn match quakeNumber display contained "\d\+\>"
+" Flag the first zero of an octal number as something special
+syn match quakeOctal display contained "0\o\+\>" contains=quakeOctalZero
+syn match quakeOctalZero display contained "\<0"
+" floating point number, with dot
+syn match quakeFloat display contained "\d\+\.\d*"
+" floating point number, starting with a dot
+syn match quakeFloat display contained "\.\d\+\>"
+" flag an octal number with wrong digits
+syn match quakeOctalError display contained "0\o*[89]\d*"
+syn case match
+
+" commands
+syn case ignore
+syn cluster quakeCommands contains=quakeCommand,quake1Command,quake12Command,Quake2Command,Quake23Command,Quake3Command
+
+syn keyword quakeCommand +attack +back +forward +left +lookdown +lookup
+syn keyword quakeCommand +mlook +movedown +moveleft +moveright +moveup
+syn keyword quakeCommand +right +speed +strafe -attack -back bind
+syn keyword quakeCommand bindlist centerview clear connect cvarlist dir
+syn keyword quakeCommand disconnect dumpuser echo error exec -forward
+syn keyword quakeCommand god heartbeat joy_advancedupdate kick kill
+syn keyword quakeCommand killserver -left -lookdown -lookup map
+syn keyword quakeCommand messagemode messagemode2 -mlook modellist
+syn keyword quakeCommand -movedown -moveleft -moveright -moveup play
+syn keyword quakeCommand quit rcon reconnect record -right say say_team
+syn keyword quakeCommand screenshot serverinfo serverrecord serverstop
+syn keyword quakeCommand set sizedown sizeup snd_restart soundinfo
+syn keyword quakeCommand soundlist -speed spmap status -strafe stopsound
+syn keyword quakeCommand toggleconsole unbind unbindall userinfo pause
+syn keyword quakeCommand vid_restart viewpos wait weapnext weapprev
+
+if exists("quake_is_quake1")
+syn keyword quake1Command sv
+endif
+
+if exists("quake_is_quake1") || exists("quake_is_quake2")
+syn keyword quake12Command +klook alias cd impulse link load save
+syn keyword quake12Command timerefresh changing info loading
+syn keyword quake12Command pingservers playerlist players score
+endif
+
+if exists("quake_is_quake2")
+syn keyword quake2Command cmd demomap +use condump download drop gamemap
+syn keyword quake2Command give gun_model setmaster sky sv_maplist wave
+syn keyword quake2Command cmdlist gameversiona gun_next gun_prev invdrop
+syn keyword quake2Command inven invnext invnextp invnextw invprev
+syn keyword quake2Command invprevp invprevw invuse menu_addressbook
+syn keyword quake2Command menu_credits menu_dmoptions menu_game
+syn keyword quake2Command menu_joinserver menu_keys menu_loadgame
+syn keyword quake2Command menu_main menu_multiplayer menu_options
+syn keyword quake2Command menu_playerconfig menu_quit menu_savegame
+syn keyword quake2Command menu_startserver menu_video
+syn keyword quake2Command notarget precache prog togglechat vid_front
+syn keyword quake2Command weaplast
+endif
+
+if exists("quake_is_quake2") || exists("quake_is_quake3")
+syn keyword quake23Command imagelist modellist path z_stats
+endif
+
+if exists("quake_is_quake3")
+syn keyword quake3Command +info +scores +zoom addbot arena banClient
+syn keyword quake3Command banUser callteamvote callvote changeVectors
+syn keyword quake3Command cinematic clientinfo clientkick cmd cmdlist
+syn keyword quake3Command condump configstrings crash cvar_restart devmap
+syn keyword quake3Command fdir follow freeze fs_openedList Fs_pureList
+syn keyword quake3Command Fs_referencedList gfxinfo globalservers
+syn keyword quake3Command hunk_stats in_restart -info levelshot
+syn keyword quake3Command loaddeferred localservers map_restart mem_info
+syn keyword quake3Command messagemode3 messagemode4 midiinfo model music
+syn keyword quake3Command modelist net_restart nextframe nextskin noclip
+syn keyword quake3Command notarget ping prevframe prevskin reset restart
+syn keyword quake3Command s_disable_a3d s_enable_a3d s_info s_list s_stop
+syn keyword quake3Command scanservers -scores screenshotJPEG sectorlist
+syn keyword quake3Command serverstatus seta setenv sets setu setviewpos
+syn keyword quake3Command shaderlist showip skinlist spdevmap startOribt
+syn keyword quake3Command stats stopdemo stoprecord systeminfo togglemenu
+syn keyword quake3Command tcmd team teamtask teamvote tell tell_attacker
+syn keyword quake3Command tell_target testgun testmodel testshader toggle
+syn keyword quake3Command touchFile vminfo vmprofile vmtest vosay
+syn keyword quake3Command vosay_team vote votell vsay vsay_team vstr
+syn keyword quake3Command vtaunt vtell vtell_attacker vtell_target weapon
+syn keyword quake3Command writeconfig -zoom
+syn match quake3Command display "\<[+-]button\(\d\|1[0-4]\)\>"
+endif
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_screen_syn_inits")
+ if version < 508
+ let did_screen_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink quakeComment Comment
+ HiLink quakeTodo Todo
+ HiLink quakeString String
+ HiLink quakeNumber Number
+ HiLink quakeOctal Number
+ HiLink quakeOctalZero Number
+ HiLink quakeFloat Number
+ HiLink quakeOctalError Error
+ HiLink quakeCommand quakeCommands
+ HiLink quake1Command quakeCommands
+ HiLink quake12Command quakeCommands
+ HiLink quake2Command quakeCommands
+ HiLink quake23Command quakeCommands
+ HiLink quake3Command quakeCommands
+ HiLink quakeCommands Keyword
+
+ delcommand HiLink
+endif
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim
new file mode 100644
index 000000000..c2ecca4ef
--- /dev/null
+++ b/runtime/syntax/r.vim
@@ -0,0 +1,104 @@
+" Vim syntax file
+" Language: R (GNU S)
+" Maintainer: Tom Payne <tom@tompayne.org>
+" Last Change: 2003 May 11
+" Filenames: *.r
+" URL: http://www.tompayne.org/vim/syntax/r.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,.
+else
+ set iskeyword=@,48-57,_,.
+endif
+
+syn case match
+
+" Comment
+syn match rComment /\#.*/
+
+" Constant
+" string enclosed in double quotes
+syn region rString start=/"/ skip=/\\\\\|\\"/ end=/"/
+" string enclosed in single quotes
+syn region rString start=/'/ skip=/\\\\\|\\'/ end=/'/
+" number with no fractional part or exponent
+syn match rNumber /\d\+/
+" floating point number with integer and fractional parts and optional exponent
+syn match rFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
+" floating point number with no integer part and optional exponent
+syn match rFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
+" floating point number with no fractional part and optional exponent
+syn match rFloat /\d\+[Ee][-+]\=\d\+/
+
+" Identifier
+" identifier with leading letter and optional following keyword characters
+syn match rIdentifier /\a\k*/
+" identifier with leading period, one or more digits, and at least one non-digit keyword character
+syn match rIdentifier /\.\d*\K\k*/
+
+" Statement
+syn keyword rStatement break next return
+syn keyword rConditional if else
+syn keyword rRepeat for in repeat while
+
+" Constant
+syn keyword rConstant LETTERS letters month.ab month.name pi
+syn keyword rConstant NULL
+syn keyword rBoolean FALSE TRUE
+syn keyword rNumber NA
+
+" Type
+syn keyword rType array category character complex double function integer list logical matrix numeric vector
+
+" Special
+syn match rDelimiter /[,;:]/
+
+" Error
+syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
+syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
+syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
+syn match rError /[)\]}]/
+syn match rBraceError /[)}]/ contained
+syn match rCurlyError /[)\]]/ contained
+syn match rParenError /[\]}]/ contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_r_syn_inits")
+ if version < 508
+ let did_r_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink rComment Comment
+ HiLink rConstant Constant
+ HiLink rString String
+ HiLink rNumber Number
+ HiLink rBoolean Boolean
+ HiLink rFloat Float
+ HiLink rStatement Statement
+ HiLink rConditional Conditional
+ HiLink rRepeat Repeat
+ HiLink rIdentifier Identifier
+ HiLink rType Type
+ HiLink rDelimiter Delimiter
+ HiLink rError Error
+ HiLink rBraceError Error
+ HiLink rCurlyError Error
+ HiLink rParenError Error
+ delcommand HiLink
+endif
+
+let b:current_syntax="r"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/radiance.vim b/runtime/syntax/radiance.vim
new file mode 100644
index 000000000..461b708f0
--- /dev/null
+++ b/runtime/syntax/radiance.vim
@@ -0,0 +1,159 @@
+" Vim syntax file
+" Language: Radiance Scene Description
+" Maintainer: Georg Mischler <schorsch@schorsch.com>
+" Last change: 26. April. 2001
+
+" Radiance is a lighting simulation software package written
+" by Gregory Ward-Larson ("the computer artist formerly known
+" as Greg Ward"), then at LBNL.
+"
+" http://radsite.lbl.gov/radiance/HOME.html
+"
+" Of course, there is also information available about it
+" from http://www.schorsch.com/
+
+
+" We take a minimalist approach here, highlighting just the
+" essential properties of each object, its type and ID, as well as
+" comments, external command names and the null-modifier "void".
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" all printing characters except '#' and '!' are valid in names.
+if version >= 600
+ setlocal iskeyword=\",$-~
+else
+ set iskeyword=\",$-~
+endif
+
+" The null-modifier
+syn keyword radianceKeyword void
+
+" The different kinds of scene description object types
+" Reference types
+syn keyword radianceExtraType contained alias instance
+" Surface types
+syn keyword radianceSurfType contained ring polygon sphere bubble
+syn keyword radianceSurfType contained cone cup cylinder tube source
+" Emitting material types
+syn keyword radianceLightType contained light glow illum spotlight
+" Material types
+syn keyword radianceMatType contained mirror mist prism1 prism2
+syn keyword radianceMatType contained metal plastic trans
+syn keyword radianceMatType contained metal2 plastic2 trans2
+syn keyword radianceMatType contained metfunc plasfunc transfunc
+syn keyword radianceMatType contained metdata plasdata transdata
+syn keyword radianceMatType contained dielectric interface glass
+syn keyword radianceMatType contained BRTDfunc antimatter
+" Pattern modifier types
+syn keyword radiancePatType contained colorfunc brightfunc
+syn keyword radiancePatType contained colordata colorpict brightdata
+syn keyword radiancePatType contained colortext brighttext
+" Texture modifier types
+syn keyword radianceTexType contained texfunc texdata
+" Mixture types
+syn keyword radianceMixType contained mixfunc mixdata mixpict mixtext
+
+
+" Each type name is followed by an ID.
+" This doesn't work correctly if the id is one of the type names of the
+" same class (which is legal for radiance), in which case the id will get
+" type color as well, and the int count (or alias reference) gets id color.
+
+syn region radianceID start="\<alias\>" end="\<\k*\>" contains=radianceExtraType
+syn region radianceID start="\<instance\>" end="\<\k*\>" contains=radianceExtraType
+
+syn region radianceID start="\<source\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<ring\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<polygon\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<sphere\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<bubble\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<cone\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<cup\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<cylinder\>" end="\<\k*\>" contains=radianceSurfType
+syn region radianceID start="\<tube\>" end="\<\k*\>" contains=radianceSurfType
+
+syn region radianceID start="\<light\>" end="\<\k*\>" contains=radianceLightType
+syn region radianceID start="\<glow\>" end="\<\k*\>" contains=radianceLightType
+syn region radianceID start="\<illum\>" end="\<\k*\>" contains=radianceLightType
+syn region radianceID start="\<spotlight\>" end="\<\k*\>" contains=radianceLightType
+
+syn region radianceID start="\<mirror\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<mist\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<prism1\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<prism2\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<metal\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<plastic\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<trans\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<metal2\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<plastic2\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<trans2\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<metfunc\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<plasfunc\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<transfunc\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<metdata\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<plasdata\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<transdata\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<dielectric\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<interface\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<glass\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<BRTDfunc\>" end="\<\k*\>" contains=radianceMatType
+syn region radianceID start="\<antimatter\>" end="\<\k*\>" contains=radianceMatType
+
+syn region radianceID start="\<colorfunc\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<brightfunc\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<colordata\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<brightdata\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<colorpict\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<colortext\>" end="\<\k*\>" contains=radiancePatType
+syn region radianceID start="\<brighttext\>" end="\<\k*\>" contains=radiancePatType
+
+syn region radianceID start="\<texfunc\>" end="\<\k*\>" contains=radianceTexType
+syn region radianceID start="\<texdata\>" end="\<\k*\>" contains=radianceTexType
+
+syn region radianceID start="\<mixfunc\>" end="\<\k*\>" contains=radianceMixType
+syn region radianceID start="\<mixdata\>" end="\<\k*\>" contains=radianceMixType
+syn region radianceID start="\<mixtext\>" end="\<\k*\>" contains=radianceMixType
+
+" external commands (generators, xform et al.)
+syn match radianceCommand "^\s*!\s*[^\s]\+\>"
+
+" The usual suspects
+syn keyword radianceTodo contained TODO XXX
+syn match radianceComment "#.*$" contains=radianceTodo
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_radiance_syn_inits")
+ if version < 508
+ let did_radiance_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink radianceKeyword Keyword
+ HiLink radianceExtraType Type
+ HiLink radianceSurfType Type
+ HiLink radianceLightType Type
+ HiLink radianceMatType Type
+ HiLink radiancePatType Type
+ HiLink radianceTexType Type
+ HiLink radianceMixType Type
+ HiLink radianceComment Comment
+ HiLink radianceCommand Function
+ HiLink radianceID String
+ HiLink radianceTodo Todo
+ delcommand HiLink
+endif
+
+let b:current_syntax = "radiance"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/ratpoison.vim b/runtime/syntax/ratpoison.vim
new file mode 100644
index 000000000..39094fc10
--- /dev/null
+++ b/runtime/syntax/ratpoison.vim
@@ -0,0 +1,249 @@
+" Vim syntax file
+" Filename: ratpoison.vim
+" Language: Ratpoison configuration/commands file ( /etc/ratpoisonrc ~/.ratpoisonrc )
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/ratpoison.vim
+" Last Change: 2004 Apr 27
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match ratpoisonComment "^\s*#.*$" contains=ratpoisonTodo
+
+syn keyword ratpoisonTodo TODO NOTE FIXME XXX contained
+
+syn case ignore
+syn keyword ratpoisonBooleanArg on off contained
+syn case match
+
+syn keyword ratpoisonCommandArg abort addhook alias banish bind contained
+syn keyword ratpoisonCommandArg chdir clrunmanaged colon curframe defbarborder contained
+syn keyword ratpoisonCommandArg defbargravity defbarpadding defbgcolor defborder deffgcolor contained
+syn keyword ratpoisonCommandArg deffont defframesels definekey definputwidth defmaxsizegravity contained
+syn keyword ratpoisonCommandArg defpadding defresizeunit deftransgravity defwaitcursor defwinfmt contained
+syn keyword ratpoisonCommandArg defwingravity defwinliststyle defwinname delete delkmap contained
+syn keyword ratpoisonCommandArg echo escape exec fdump focus contained
+syn keyword ratpoisonCommandArg focusdown focuslast focusleft focusright focusup contained
+syn keyword ratpoisonCommandArg frestore fselect gdelete getenv gmerge contained
+syn keyword ratpoisonCommandArg gmove gnew gnewbg gnext gprev contained
+syn keyword ratpoisonCommandArg gravity groups gselect help hsplit contained
+syn keyword ratpoisonCommandArg info kill lastmsg license link contained
+syn keyword ratpoisonCommandArg listhook meta msgwait newkmap newwm contained
+syn keyword ratpoisonCommandArg next nextscreen number only other contained
+syn keyword ratpoisonCommandArg prev prevscreen quit readkey redisplay contained
+syn keyword ratpoisonCommandArg remhook remove resize restart rudeness contained
+syn keyword ratpoisonCommandArg select setenv shrink source split contained
+syn keyword ratpoisonCommandArg startup_message time title tmpwm unalias contained
+syn keyword ratpoisonCommandArg unbind unmanage unsetenv verbexec version contained
+syn keyword ratpoisonCommandArg vsplit warp windows syn case ignore contained
+
+syn match ratpoisonGravityArg "\<\(n\|north\)\>" contained
+syn match ratpoisonGravityArg "\<\(nw\|northwest\)\>" contained
+syn match ratpoisonGravityArg "\<\(ne\|northeast\)\>" contained
+syn match ratpoisonGravityArg "\<\(w\|west\)\>" contained
+syn match ratpoisonGravityArg "\<\(c\|center\)\>" contained
+syn match ratpoisonGravityArg "\<\(e\|east\)\>" contained
+syn match ratpoisonGravityArg "\<\(s\|south\)\>" contained
+syn match ratpoisonGravityArg "\<\(sw\|southwest\)\>" contained
+syn match ratpoisonGravityArg "\<\(se\|southeast\)\>" contained
+syn case match
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(F[1-9][0-9]\=\|\(\a\|\d\)\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(space\|exclam\|quotedbl\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(numbersign\|dollar\|percent\|ampersand\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(apostrophe\|quoteright\|parenleft\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(parenright\|asterisk\|plus\|comma\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(minus\|period\|slash\|colon\|semicolon\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(less\|equal\|greater\|question\|at\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(bracketleft\|backslash\|bracketright\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(asciicircum\|underscore\|grave\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(quoteleft\|braceleft\|bar\|braceright\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(asciitilde\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(BackSpace\|Tab\|Linefeed\|Clear\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Return\|Pause\|Scroll_Lock\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Sys_Req\|Escape\|Delete\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Home\|Left\|Up\|Right\|Down\|Prior\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Page_Up\|Next\|Page_Down\|End\|Begin\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Select\|Print\|Execute\|Insert\|Undo\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Redo\|Menu\|Find\|Cancel\|Help\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=\(Break\|Mode_switch\|script_switch\|Num_Lock\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(Space\|Tab\|Enter\|F[1234]\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(Home\|Left\|Up\|Right\|Down\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(Prior\|Page_Up\|Next\|Page_Down\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(End\|Begin\|Insert\|Delete\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(Equal\|Multiply\|Add\|Separator\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+syn match ratpoisonKeySeqArg "\<\([CMASH]\(-[CMASH]\)\{,4}-\)\=KP_\(Subtract\|Decimal\|Divide\|\d\)\>" contained nextgroup=ratpoisonCommandArg skipwhite
+
+syn match ratpoisonHookArg "\<\(key\|switchwin\|switchframe\|switchgroup\|quit\|restart\)\>" contained
+
+syn match ratpoisonNumberArg "\<\d\+\>" contained nextgroup=ratpoisonNumberArg skipwhite
+
+syn keyword ratpoisonSetArg barborder contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg bargravity contained nextgroup=ratpoisonGravityArg
+syn keyword ratpoisonSetArg barpadding contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg bgcolor
+syn keyword ratpoisonSetArg border contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg fgcolor
+syn keyword ratpoisonSetArg font
+syn keyword ratpoisonSetArg framesels
+syn keyword ratpoisonSetArg inputwidth contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg maxsizegravity contained nextgroup=ratpoisonGravityArg
+syn keyword ratpoisonSetArg padding contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg resizeunit contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg transgravity contained nextgroup=ratpoisonGravityArg
+syn keyword ratpoisonSetArg waitcursor contained nextgroup=ratpoisonNumberArg
+syn keyword ratpoisonSetArg winfmt contained nextgroup=ratpoisonWinFmtArg
+syn keyword ratpoisonSetArg wingravity contained nextgroup=ratpoisonGravityArg
+syn keyword ratpoisonSetArg winliststyle contained nextgroup=ratpoisonWinListArg
+syn keyword ratpoisonSetArg winname contained nextgroup=ratpoisonWinNameArg
+
+syn match ratpoisonWinFmtArg "%[nstacil]" contained nextgroup=ratpoisonWinFmtArg skipwhite
+
+syn match ratpoisonWinListArg "\<\(row\|column\)\>" contained
+
+syn match ratpoisonWinNameArg "\<\(name\|title\|class\)\>" contained
+
+syn match ratpoisonDefCommand "^\s*set\s*" nextgroup=ratpoisonSetArg
+syn match ratpoisonDefCommand "^\s*defbarborder\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*defbargravity\s*" nextgroup=ratpoisonGravityArg
+syn match ratpoisonDefCommand "^\s*defbarpadding\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*defbgcolor\s*"
+syn match ratpoisonDefCommand "^\s*defborder\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*deffgcolor\s*"
+syn match ratpoisonDefCommand "^\s*deffont\s*"
+syn match ratpoisonDefCommand "^\s*defframesels\s*"
+syn match ratpoisonDefCommand "^\s*definputwidth\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*defmaxsizegravity\s*" nextgroup=ratpoisonGravityArg
+syn match ratpoisonDefCommand "^\s*defpadding\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*defresizeunit\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*deftransgravity\s*" nextgroup=ratpoisonGravityArg
+syn match ratpoisonDefCommand "^\s*defwaitcursor\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonDefCommand "^\s*defwinfmt\s*" nextgroup=ratpoisonWinFmtArg
+syn match ratpoisonDefCommand "^\s*defwingravity\s*" nextgroup=ratpoisonGravityArg
+syn match ratpoisonDefCommand "^\s*defwinliststyle\s*" nextgroup=ratpoisonWinListArg
+syn match ratpoisonDefCommand "^\s*defwinname\s*" nextgroup=ratpoisonWinNameArg
+syn match ratpoisonDefCommand "^\s*msgwait\s*" nextgroup=ratpoisonNumberArg
+
+syn match ratpoisonStringCommand "^\s*\zsaddhook\ze\s*" nextgroup=ratpoisonHookArg
+syn match ratpoisonStringCommand "^\s*\zsalias\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsbind\ze\s*" nextgroup=ratpoisonKeySeqArg
+syn match ratpoisonStringCommand "^\s*\zschdir\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zscolon\ze\s*" nextgroup=ratpoisonCommandArg
+syn match ratpoisonStringCommand "^\s*\zsdefinekey\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsdelkmap\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsecho\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsescape\ze\s*" nextgroup=ratpoisonKeySeqArg
+syn match ratpoisonStringCommand "^\s*\zsexec\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsfdump\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsfrestore\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsgdelete\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsgetenv\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsgravity\ze\s*" nextgroup=ratpoisonGravityArg
+syn match ratpoisonStringCommand "^\s*\zsgselect\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zslink\ze\s*" nextgroup=ratpoisonKeySeqArg
+syn match ratpoisonStringCommand "^\s*\zslisthook\ze\s*" nextgroup=ratpoisonHookArg
+syn match ratpoisonStringCommand "^\s*\zsnewkmap\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsnewwm\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsnumber\ze\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonStringCommand "^\s*\zsreadkey\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsremhook\ze\s*" nextgroup=ratpoisonHookArg
+syn match ratpoisonStringCommand "^\s*\zsresize\ze\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonStringCommand "^\s*\zsrudeness\ze\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonStringCommand "^\s*\zsselect\ze\s*" nextgroup=ratpoisonNumberArg
+syn match ratpoisonStringCommand "^\s*\zssetenv\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zssource\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsstartup_message\ze\s*" nextgroup=ratpoisonBooleanArg
+syn match ratpoisonStringCommand "^\s*\zstitle\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zstmpwm\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsunalias\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsunbind\ze\s*" nextgroup=ratpoisonKeySeqArg
+syn match ratpoisonStringCommand "^\s*\zsunmanage\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsunsetenv\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zsverbexec\ze\s*"
+syn match ratpoisonStringCommand "^\s*\zswarp\ze\s*" nextgroup=ratpoisonBooleanArg
+
+syn match ratpoisonVoidCommand "^\s*\zsabort\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsbanish\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsclrunmanaged\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zscurframe\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsdelete\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocusdown\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocuslast\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocusleft\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocusright\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocus\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfocusup\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsfselect\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgmerge\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgmove\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgnewbg\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgnew\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgnext\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgprev\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsgroups\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zshelp\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zshsplit\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsinfo\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zskill\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zslastmsg\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zslicense\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsmeta\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsnext\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsnextscreen\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsonly\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsother\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsprev\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsprevscreen\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsquit\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsredisplay\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsremove\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsrestart\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsshrink\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zssplit\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zstime\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsversion\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zsvsplit\ze\s*$"
+syn match ratpoisonVoidCommand "^\s*\zswindows\ze\s*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ratpoison_syn_inits")
+ if version < 508
+ let did_ratpoison_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ratpoisonBooleanArg Boolean
+ HiLink ratpoisonCommandArg Keyword
+ HiLink ratpoisonComment Comment
+ HiLink ratpoisonDefCommand Identifier
+ HiLink ratpoisonGravityArg Constant
+ HiLink ratpoisonKeySeqArg Special
+ HiLink ratpoisonNumberArg Number
+ HiLink ratpoisonSetArg Keyword
+ HiLink ratpoisonStringCommand Identifier
+ HiLink ratpoisonTodo Todo
+ HiLink ratpoisonVoidCommand Identifier
+ HiLink ratpoisonWinFmtArg Special
+ HiLink ratpoisonWinNameArg Constant
+ HiLink ratpoisonWinListArg Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ratpoison"
+
+" vim: ts=8
diff --git a/runtime/syntax/rc.vim b/runtime/syntax/rc.vim
new file mode 100644
index 000000000..c3feb9781
--- /dev/null
+++ b/runtime/syntax/rc.vim
@@ -0,0 +1,200 @@
+" Vim syntax file
+" Language: M$ Resource files (*.rc)
+" Maintainer: Heiko Erhardt <Heiko.Erhardt@munich.netsurf.de>
+" Last Change: 2001 May 09
+
+" This file is based on the c.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Common RC keywords
+syn keyword rcLanguage LANGUAGE
+
+syn keyword rcMainObject TEXTINCLUDE VERSIONINFO BITMAP ICON CURSOR CURSOR
+syn keyword rcMainObject MENU ACCELERATORS TOOLBAR DIALOG
+syn keyword rcMainObject STRINGTABLE MESSAGETABLE RCDATA DLGINIT DESIGNINFO
+
+syn keyword rcSubObject POPUP MENUITEM SEPARATOR
+syn keyword rcSubObject CONTROL LTEXT CTEXT EDITTEXT
+syn keyword rcSubObject BUTTON PUSHBUTTON DEFPUSHBUTTON GROUPBOX LISTBOX COMBOBOX
+syn keyword rcSubObject FILEVERSION PRODUCTVERSION FILEFLAGSMASK FILEFLAGS FILEOS
+syn keyword rcSubObject FILETYPE FILESUBTYPE
+
+syn keyword rcCaptionParam CAPTION
+syn keyword rcParam CHARACTERISTICS CLASS STYLE EXSTYLE VERSION FONT
+
+syn keyword rcStatement BEGIN END BLOCK VALUE
+
+syn keyword rcCommonAttribute PRELOAD LOADONCALL FIXED MOVEABLE DISCARDABLE PURE IMPURE
+
+syn keyword rcAttribute WS_OVERLAPPED WS_POPUP WS_CHILD WS_MINIMIZE WS_VISIBLE WS_DISABLED WS_CLIPSIBLINGS
+syn keyword rcAttribute WS_CLIPCHILDREN WS_MAXIMIZE WS_CAPTION WS_BORDER WS_DLGFRAME WS_VSCROLL WS_HSCROLL
+syn keyword rcAttribute WS_SYSMENU WS_THICKFRAME WS_GROUP WS_TABSTOP WS_MINIMIZEBOX WS_MAXIMIZEBOX WS_TILED
+syn keyword rcAttribute WS_ICONIC WS_SIZEBOX WS_TILEDWINDOW WS_OVERLAPPEDWINDOW WS_POPUPWINDOW WS_CHILDWINDOW
+syn keyword rcAttribute WS_EX_DLGMODALFRAME WS_EX_NOPARENTNOTIFY WS_EX_TOPMOST WS_EX_ACCEPTFILES
+syn keyword rcAttribute WS_EX_TRANSPARENT WS_EX_MDICHILD WS_EX_TOOLWINDOW WS_EX_WINDOWEDGE WS_EX_CLIENTEDGE
+syn keyword rcAttribute WS_EX_CONTEXTHELP WS_EX_RIGHT WS_EX_LEFT WS_EX_RTLREADING WS_EX_LTRREADING
+syn keyword rcAttribute WS_EX_LEFTSCROLLBAR WS_EX_RIGHTSCROLLBAR WS_EX_CONTROLPARENT WS_EX_STATICEDGE
+syn keyword rcAttribute WS_EX_APPWINDOW WS_EX_OVERLAPPEDWINDOW WS_EX_PALETTEWINDOW
+syn keyword rcAttribute ES_LEFT ES_CENTER ES_RIGHT ES_MULTILINE ES_UPPERCASE ES_LOWERCASE ES_PASSWORD
+syn keyword rcAttribute ES_AUTOVSCROLL ES_AUTOHSCROLL ES_NOHIDESEL ES_OEMCONVERT ES_READONLY ES_WANTRETURN
+syn keyword rcAttribute ES_NUMBER
+syn keyword rcAttribute BS_PUSHBUTTON BS_DEFPUSHBUTTON BS_CHECKBOX BS_AUTOCHECKBOX BS_RADIOBUTTON BS_3STATE
+syn keyword rcAttribute BS_AUTO3STATE BS_GROUPBOX BS_USERBUTTON BS_AUTORADIOBUTTON BS_OWNERDRAW BS_LEFTTEXT
+syn keyword rcAttribute BS_TEXT BS_ICON BS_BITMAP BS_LEFT BS_RIGHT BS_CENTER BS_TOP BS_BOTTOM BS_VCENTER
+syn keyword rcAttribute BS_PUSHLIKE BS_MULTILINE BS_NOTIFY BS_FLAT BS_RIGHTBUTTON
+syn keyword rcAttribute SS_LEFT SS_CENTER SS_RIGHT SS_ICON SS_BLACKRECT SS_GRAYRECT SS_WHITERECT
+syn keyword rcAttribute SS_BLACKFRAME SS_GRAYFRAME SS_WHITEFRAME SS_USERITEM SS_SIMPLE SS_LEFTNOWORDWRAP
+syn keyword rcAttribute SS_OWNERDRAW SS_BITMAP SS_ENHMETAFILE SS_ETCHEDHORZ SS_ETCHEDVERT SS_ETCHEDFRAME
+syn keyword rcAttribute SS_TYPEMASK SS_NOPREFIX SS_NOTIFY SS_CENTERIMAGE SS_RIGHTJUST SS_REALSIZEIMAGE
+syn keyword rcAttribute SS_SUNKEN SS_ENDELLIPSIS SS_PATHELLIPSIS SS_WORDELLIPSIS SS_ELLIPSISMASK
+syn keyword rcAttribute DS_ABSALIGN DS_SYSMODAL DS_LOCALEDIT DS_SETFONT DS_MODALFRAME DS_NOIDLEMSG
+syn keyword rcAttribute DS_SETFOREGROUND DS_3DLOOK DS_FIXEDSYS DS_NOFAILCREATE DS_CONTROL DS_CENTER
+syn keyword rcAttribute DS_CENTERMOUSE DS_CONTEXTHELP
+syn keyword rcAttribute LBS_NOTIFY LBS_SORT LBS_NOREDRAW LBS_MULTIPLESEL LBS_OWNERDRAWFIXED
+syn keyword rcAttribute LBS_OWNERDRAWVARIABLE LBS_HASSTRINGS LBS_USETABSTOPS LBS_NOINTEGRALHEIGHT
+syn keyword rcAttribute LBS_MULTICOLUMN LBS_WANTKEYBOARDINPUT LBS_EXTENDEDSEL LBS_DISABLENOSCROLL
+syn keyword rcAttribute LBS_NODATA LBS_NOSEL LBS_STANDARD
+syn keyword rcAttribute CBS_SIMPLE CBS_DROPDOWN CBS_DROPDOWNLIST CBS_OWNERDRAWFIXED CBS_OWNERDRAWVARIABLE
+syn keyword rcAttribute CBS_AUTOHSCROLL CBS_OEMCONVERT CBS_SORT CBS_HASSTRINGS CBS_NOINTEGRALHEIGHT
+syn keyword rcAttribute CBS_DISABLENOSCROLL CBS_UPPERCASE CBS_LOWERCASE
+syn keyword rcAttribute SBS_HORZ SBS_VERT SBS_TOPALIGN SBS_LEFTALIGN SBS_BOTTOMALIGN SBS_RIGHTALIGN
+syn keyword rcAttribute SBS_SIZEBOXTOPLEFTALIGN SBS_SIZEBOXBOTTOMRIGHTALIGN SBS_SIZEBOX SBS_SIZEGRIP
+syn keyword rcAttribute CCS_TOP CCS_NOMOVEY CCS_BOTTOM CCS_NORESIZE CCS_NOPARENTALIGN CCS_ADJUSTABLE
+syn keyword rcAttribute CCS_NODIVIDER
+syn keyword rcAttribute LVS_ICON LVS_REPORT LVS_SMALLICON LVS_LIST LVS_TYPEMASK LVS_SINGLESEL LVS_SHOWSELALWAYS
+syn keyword rcAttribute LVS_SORTASCENDING LVS_SORTDESCENDING LVS_SHAREIMAGELISTS LVS_NOLABELWRAP
+syn keyword rcAttribute LVS_EDITLABELS LVS_OWNERDATA LVS_NOSCROLL LVS_TYPESTYLEMASK LVS_ALIGNTOP LVS_ALIGNLEFT
+syn keyword rcAttribute LVS_ALIGNMASK LVS_OWNERDRAWFIXED LVS_NOCOLUMNHEADER LVS_NOSORTHEADER LVS_AUTOARRANGE
+syn keyword rcAttribute TVS_HASBUTTONS TVS_HASLINES TVS_LINESATROOT TVS_EDITLABELS TVS_DISABLEDRAGDROP
+syn keyword rcAttribute TVS_SHOWSELALWAYS
+syn keyword rcAttribute TCS_FORCEICONLEFT TCS_FORCELABELLEFT TCS_TABS TCS_BUTTONS TCS_SINGLELINE TCS_MULTILINE
+syn keyword rcAttribute TCS_RIGHTJUSTIFY TCS_FIXEDWIDTH TCS_RAGGEDRIGHT TCS_FOCUSONBUTTONDOWN
+syn keyword rcAttribute TCS_OWNERDRAWFIXED TCS_TOOLTIPS TCS_FOCUSNEVER
+syn keyword rcAttribute ACS_CENTER ACS_TRANSPARENT ACS_AUTOPLAY
+syn keyword rcStdId IDI_APPLICATION IDI_HAND IDI_QUESTION IDI_EXCLAMATION IDI_ASTERISK IDI_WINLOGO IDI_WINLOGO
+syn keyword rcStdId IDI_WARNING IDI_ERROR IDI_INFORMATION
+syn keyword rcStdId IDCANCEL IDABORT IDRETRY IDIGNORE IDYES IDNO IDCLOSE IDHELP IDC_STATIC
+
+" Common RC keywords
+
+" Common RC keywords
+syn keyword rcTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match rcSpecial contained "\\[0-7][0-7][0-7]\=\|\\."
+syn region rcString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rcSpecial
+syn match rcCharacter "'[^\\]'"
+syn match rcSpecialCharacter "'\\.'"
+syn match rcSpecialCharacter "'\\[0-7][0-7]'"
+syn match rcSpecialCharacter "'\\[0-7][0-7][0-7]'"
+
+"catch errors caused by wrong parenthesis
+syn region rcParen transparent start='(' end=')' contains=ALLBUT,rcParenError,rcIncluded,rcSpecial,rcTodo
+syn match rcParenError ")"
+syn match rcInParen contained "[{}]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match rcNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match rcFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match rcFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match rcFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match rcNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+"syn match rcIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+" flag an octal number with wrong digits
+syn match rcOctalError "\<0[0-7]*[89]"
+
+if exists("rc_comment_strings")
+ " A comment can contain rcString, rcCharacter and rcNumber.
+ " But a "*/" inside a rcString in a rcComment DOES end the comment! So we
+ " need to use a special type of rcString: rcCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match rcCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region rcCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=rcSpecial,rcCommentSkip
+ syntax region rcComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=rcSpecial
+ syntax region rcComment start="/\*" end="\*/" contains=rcTodo,rcCommentString,rcCharacter,rcNumber,rcFloat
+ syntax match rcComment "//.*" contains=rcTodo,rcComment2String,rcCharacter,rcNumber
+else
+ syn region rcComment start="/\*" end="\*/" contains=rcTodo
+ syn match rcComment "//.*" contains=rcTodo
+endif
+syntax match rcCommentError "\*/"
+
+syn region rcPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=rcComment,rcString,rcCharacter,rcNumber,rcCommentError
+syn region rcIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match rcIncluded contained "<[^>]*>"
+syn match rcInclude "^\s*#\s*include\>\s*["<]" contains=rcIncluded
+"syn match rcLineSkip "\\$"
+syn region rcDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,rcPreCondit,rcIncluded,rcInclude,rcDefine,rcInParen
+syn region rcPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,rcPreCondit,rcIncluded,rcInclude,rcDefine,rcInParen
+
+syn sync ccomment rcComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rc_syntax_inits")
+ if version < 508
+ let did_rc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rcCharacter Character
+ HiLink rcSpecialCharacter rcSpecial
+ HiLink rcNumber Number
+ HiLink rcFloat Float
+ HiLink rcOctalError rcError
+ HiLink rcParenError rcError
+ HiLink rcInParen rcError
+ HiLink rcCommentError rcError
+ HiLink rcInclude Include
+ HiLink rcPreProc PreProc
+ HiLink rcDefine Macro
+ HiLink rcIncluded rcString
+ HiLink rcError Error
+ HiLink rcPreCondit PreCondit
+ HiLink rcCommentString rcString
+ HiLink rcComment2String rcString
+ HiLink rcCommentSkip rcComment
+ HiLink rcString String
+ HiLink rcComment Comment
+ HiLink rcSpecial SpecialChar
+ HiLink rcTodo Todo
+
+ HiLink rcAttribute rcCommonAttribute
+ HiLink rcStdId rcStatement
+ HiLink rcStatement Statement
+
+ " Default color overrides
+ hi def rcLanguage term=reverse ctermbg=Red ctermfg=Yellow guibg=Red guifg=Yellow
+ hi def rcMainObject term=underline ctermfg=Blue guifg=Blue
+ hi def rcSubObject ctermfg=Green guifg=Green
+ hi def rcCaptionParam term=underline ctermfg=DarkGreen guifg=Green
+ hi def rcParam ctermfg=DarkGreen guifg=DarkGreen
+ hi def rcStatement ctermfg=DarkGreen guifg=DarkGreen
+ hi def rcCommonAttribute ctermfg=Brown guifg=Brown
+
+ "HiLink rcIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rc"
+
+" vim: ts=8
diff --git a/runtime/syntax/rcs.vim b/runtime/syntax/rcs.vim
new file mode 100644
index 000000000..f4a90c62c
--- /dev/null
+++ b/runtime/syntax/rcs.vim
@@ -0,0 +1,76 @@
+" Vim syntax file
+" Language: RCS file
+" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
+" URL: http://www.hlabs.spb.ru/vim/rcs.vim
+" Last Change: $Date$
+" Filenames: *,v
+" $Revision$
+"
+" Options:
+" rcs_folding = 1 For folding strings
+
+" For version 5.x: Clear all syntax items.
+" For version 6.x: Quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" RCS file must end with a newline.
+syn match rcsEOFError ".\%$" containedin=ALL
+
+" Keywords.
+syn keyword rcsKeyword head branch access symbols locks strict
+syn keyword rcsKeyword comment expand date author state branches
+syn keyword rcsKeyword next desc log
+syn keyword rcsKeyword text nextgroup=rcsTextStr skipwhite skipempty
+
+" Revision numbers and dates.
+syn match rcsNumber "\<[0-9.]\+\>" display
+
+" Strings.
+if exists("rcs_folding") && has("folding")
+ " Folded strings.
+ syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" fold contains=rcsSpecial
+ syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" fold contained contains=rcsSpecial,rcsDiffLines
+else
+ syn region rcsString matchgroup=rcsString start="@" end="@" skip="@@" contains=rcsSpecial
+ syn region rcsTextStr matchgroup=rcsTextStr start="@" end="@" skip="@@" contained contains=rcsSpecial,rcsDiffLines
+endif
+syn match rcsSpecial "@@" contained
+syn match rcsDiffLines "[da]\d\+ \d\+$" contained
+
+" Synchronization.
+syn sync clear
+if exists("rcs_folding") && has("folding")
+ syn sync fromstart
+else
+ " We have incorrect folding if following sync patterns is turned on.
+ syn sync match rcsSync grouphere rcsString "[0-9.]\+\(\s\|\n\)\+log\(\s\|\n\)\+@"me=e-1
+ syn sync match rcsSync grouphere rcsTextStr "@\(\s\|\n\)\+text\(\s\|\n\)\+@"me=e-1
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already.
+" For version 5.8 and later: only when an item doesn't have highlighting yet.
+if version >= 508 || !exists("did_rcs_syn_inits")
+ if version <= 508
+ let did_rcs_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rcsKeyword Keyword
+ HiLink rcsNumber Identifier
+ HiLink rcsString String
+ HiLink rcsTextStr String
+ HiLink rcsSpecial Special
+ HiLink rcsDiffLines Special
+ HiLink rcsEOFError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rcs"
diff --git a/runtime/syntax/rcslog.vim b/runtime/syntax/rcslog.vim
new file mode 100644
index 000000000..acacfa124
--- /dev/null
+++ b/runtime/syntax/rcslog.vim
@@ -0,0 +1,38 @@
+" Vim syntax file
+" Language: RCS log output
+" Maintainer: Joe Karthauser <joe@freebsd.org>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match rcslogRevision "^revision.*$"
+syn match rcslogFile "^RCS file:.*"
+syn match rcslogDate "^date: .*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rcslog_syntax_inits")
+ if version < 508
+ let did_rcslog_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rcslogFile Type
+ HiLink rcslogRevision Constant
+ HiLink rcslogDate Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rcslog"
+
+" vim: ts=8
diff --git a/runtime/syntax/readline.vim b/runtime/syntax/readline.vim
new file mode 100644
index 000000000..8f72048ab
--- /dev/null
+++ b/runtime/syntax/readline.vim
@@ -0,0 +1,152 @@
+" Vim syntax file
+" Language: readline configuration file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/readline/
+" Latest Revision: 2004-05-22
+" arch-tag: 6d8e7da4-b39c-4bf7-8e6a-d9135f993457
+" Variables:
+" readline_has_bash - if defined add support for bash specific
+" settings/functions
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk 48-57,65-90,97-122,-
+delcommand SetIsk
+
+" comments
+syn region readlineComment display oneline matchgroup=readlineComment start="^\s*#" end="$" contains=readlineTodo
+
+" todo
+syn keyword readlineTodo contained TODO FIXME XXX NOTE
+
+" strings (argh...not the way i want it, but fine..."
+syn match readlineString "^\s*[A-Za-z-]\+:"me=e-1 contains=readlineKeys
+syn region readlineString display oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=readlineKeysTwo
+
+" special key
+syn case ignore
+syn keyword readlineKeys contained Control Meta Del Esc Escape LFD Newline Ret Return Rubout Space Spc Tab
+syn case match
+
+syn match readlineKeysTwo contained +\\\([CM]-\|[e\\"'abdfnrtv]\|\o\{3}\|x\x\{3}\)+
+
+" keymaps
+syn match readlineKeymaps contained "emacs\(-standard\|-meta\|-ctlx\)\="
+syn match readlineKeymaps contained "vi\(-move\|-command\|-insert\)\="
+
+" bell styles
+syn keyword readlineBellStyles contained audible visible none
+
+" numbers
+syn match readlineNumber contained "\<\d\+\>"
+
+" booleans
+syn case ignore
+syn keyword readlineBoolean contained on off
+syn case match
+
+" conditionals
+syn keyword readlineIfOps contained mode term
+
+syn region readlineConditional display oneline transparent matchgroup=readlineConditional start="^\s*$if" end="$" contains=readlineIfOps,readlineKeymaps
+syn match readlineConditional "^\s*$\(else\|endif\)\>"
+
+" include
+syn match readlineInclude "^\s*$include\>"
+
+" settings
+
+syn region readlineSet display oneline transparent matchgroup=readlineKeyword start="^\s*set\>" end="$"me=e-1 contains=readlineNumber,readlineBoolean,readlineKeymaps,readlineBellStyles,readlineSettings
+
+syn keyword readlineSettings contained bell-style comment-begin completion-ignore-case
+syn keyword readlineSettings contained completion-query-items convert-meta disable-completion editing-mode enable-keypad
+syn keyword readlineSettings contained expand-tilde horizontal-scroll-mode mark-directories keymap mark-modified-lines meta-flag
+syn keyword readlineSettings contained input-meta output-meta print-completions-horizontally show-all-if-ambiguous visible-stats
+syn keyword readlineSettings contained prefer-visible-bell blink-matching-paren
+syn keyword readlineSettings contained match-hidden-files history-preserve-point isearch-terminators
+
+" bash extensions
+if exists("readline_has_bash")
+ "syn keyword readlineSettings contained
+endif
+
+" key bindings
+syn region readlineBinding display oneline transparent matchgroup=readlineKeyword start=":" end="$" contains=readlineKeys,readlineFunctions
+
+syn match readlineFunctions contained "\<\(beginning\|end\)-of-line\>"
+syn match readlineFunctions contained "\<\(backward\|forward\)-\(char\|word\)\>"
+syn match readlineFunctions contained "\<\(previous\|next\|\(beginning\|end\)-of\|\(non-incremental-\)\=\(reverse\|forward\)-search\)-history\>"
+syn match readlineFunctions contained "\<history-search-\(forward\|backward\)\>"
+syn match readlineFunctions contained "\<yank-\(nth\|last\)-arg\>"
+syn match readlineFunctions contained "\<\(backward-\)\=kill-\(\(whole-\)\=line\|word\)\>"
+syn match readlineFunctions contained "\<\(start\|end\|call-last\)-kbd-macro\>"
+syn match readlineFunctions contained "\<dump-\(functions\|variables\|macros\)\>"
+syn match readlineFunctions contained "\<non-incremental-\(reverse\|forward\)-search-history-again\>"
+syn keyword readlineFunctions contained clear-screen redraw-current-line accept-line delete-char backward-delete-char quoted-insert tab-insert
+syn keyword readlineFunctions contained self-insert transpose-chars transpose-words downcase-word capitalize-word unix-word-rubout
+syn keyword readlineFunctions contained delete-horizontal-space kill-region copy-region-as-kill copy-backward-word copy-forward-word yank yank-pop
+syn keyword readlineFunctions contained digit-argument universal-argument complete possible-completions insert-completions menu-complete
+syn keyword readlineFunctions contained re-read-init-file abort do-uppercase-version prefix-meta undo revert-line tilde-expand set-mark
+syn keyword readlineFunctions contained exchange-point-and-mark character-search character-search-backward insert-comment emacs-editing-mode vi-editing-mode
+syn keyword readlineFunctions contained unix-line-discard upcase-word backward-delete-word vi-eof-maybe vi-movement-mode vi-match vi-tilde-expand
+syn keyword readlineFunctions contained vi-complete vi-char-search vi-redo vi-search vi-arg-digit vi-append-eol vi-prev-word vi-change-to vi-delete-to
+syn keyword readlineFunctions contained vi-end-word vi-fetch-history vi-insert-beg vi-search-again vi-put vi-replace vi-subst vi-yank-to vi-first-print
+syn keyword readlineFunctions contained vi-yank-arg vi-goto-mark vi-append-mode vi-insertion-mode prev-history vi-set-mark vi-search-again vi-put vi-change-char
+syn keyword readlineFunctions contained vi-subst vi-delete vi-yank-to vi-column vi-change-case vi-overstrike vi-overstrike-delete
+syn keyword readlineFunctions contained do-lowercase-version delete-char-or-list tty-status arrow-key-prefix
+syn keyword readlineFunctions contained vi-back-to-indent vi-bword vi-bWord vi-eword vi-eWord vi-fword vi-fWord vi-next-word
+
+" bash extensions
+if exists("readline_has_bash")
+ syn keyword readlineFunctions contained shell-expand-line history-expand-line magic-space alias-expand-line history-and-alias-expand-line insert-last-argument
+ syn keyword readlineFunctions contained operate-and-get-next forward-backward-delete-char delete-char-or-list complete-filename possible-filename-completions
+ syn keyword readlineFunctions contained complete-username possible-username-completions complete-variable possible-variable-completions complete-hostname
+ syn keyword readlineFunctions contained possible-hostname-completions complete-command possible-command-completions dynamic-complete-history complete-into-braces
+ syn keyword readlineFunctions contained glob-expand-word glob-list-expansions display-shell-version
+ syn keyword readlineFunctions contained glob-complete-word edit-and-execute-command
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_readline_syn_inits")
+ if version < 508
+ let did_readline_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink readlineComment Comment
+ HiLink readlineTodo Todo
+ HiLink readlineString String
+ HiLink readlineKeys SpecialChar
+ HiLink readlineKeysTwo SpecialChar
+ HiLink readlineKeymaps Constant
+ HiLink readlineBellStyles Constant
+ HiLink readlineNumber Number
+ HiLink readlineBoolean Boolean
+ HiLink readlineIfOps Type
+ HiLink readlineConditional Conditional
+ HiLink readlineInclude Include
+ HiLink readlineKeyword Keyword
+ HiLink readlineSettings Type
+ HiLink readlineFunctions Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "readline"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/rebol.vim b/runtime/syntax/rebol.vim
new file mode 100644
index 000000000..e6395758f
--- /dev/null
+++ b/runtime/syntax/rebol.vim
@@ -0,0 +1,216 @@
+" Vim syntax file
+" Language: Rebol
+" Maintainer: Mike Williams <mrw@eandem.co.uk>
+" Filenames: *.r
+" Last Change: 27th June 2002
+" URL: http://www.eandem.co.uk/mrw/vim
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Rebol is case insensitive
+syn case ignore
+
+" As per current users documentation
+if version < 600
+ set isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~
+else
+ setlocal isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~
+endif
+
+" Yer TODO highlighter
+syn keyword rebolTodo contained TODO
+
+" Comments
+syn match rebolComment ";.*$" contains=rebolTodo
+
+" Words
+syn match rebolWord "\a\k*"
+syn match rebolWordPath "[^[:space:]]/[^[:space]]"ms=s+1,me=e-1
+
+" Booleans
+syn keyword rebolBoolean true false on off yes no
+
+" Values
+" Integers
+syn match rebolInteger "\<[+-]\=\d\+\('\d*\)*\>"
+" Decimals
+syn match rebolDecimal "[+-]\=\(\d\+\('\d*\)*\)\=[,.]\d*\(e[+-]\=\d\+\)\="
+syn match rebolDecimal "[+-]\=\d\+\('\d*\)*\(e[+-]\=\d\+\)\="
+" Time
+syn match rebolTime "[+-]\=\(\d\+\('\d*\)*\:\)\{1,2}\d\+\('\d*\)*\([.,]\d\+\)\=\([AP]M\)\=\>"
+syn match rebolTime "[+-]\=:\d\+\([.,]\d*\)\=\([AP]M\)\=\>"
+" Dates
+" DD-MMM-YY & YYYY format
+syn match rebolDate "\d\{1,2}\([/-]\)\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\1\(\d\{2}\)\{1,2}\>"
+" DD-month-YY & YYYY format
+syn match rebolDate "\d\{1,2}\([/-]\)\(January\|February\|March\|April\|May\|June\|July\|August\|September\|October\|November\|December\)\1\(\d\{2}\)\{1,2}\>"
+" DD-MM-YY & YY format
+syn match rebolDate "\d\{1,2}\([/-]\)\d\{1,2}\1\(\d\{2}\)\{1,2}\>"
+" YYYY-MM-YY format
+syn match rebolDate "\d\{4}-\d\{1,2}-\d\{1,2}\>"
+" DD.MM.YYYY format
+syn match rebolDate "\d\{1,2}\.\d\{1,2}\.\d\{4}\>"
+" Money
+syn match rebolMoney "\a*\$\d\+\('\d*\)*\([,.]\d\+\)\="
+" Strings
+syn region rebolString oneline start=+"+ skip=+^"+ end=+"+ contains=rebolSpecialCharacter
+syn region rebolString start=+[^#]{+ end=+}+ skip=+{[^}]*}+ contains=rebolSpecialCharacter
+" Binary
+syn region rebolBinary start=+\d*#{+ end=+}+ contains=rebolComment
+" Email
+syn match rebolEmail "\<\k\+@\(\k\+\.\)*\k\+\>"
+" File
+syn match rebolFile "%\(\k\+/\)*\k\+[/]\=" contains=rebolSpecialCharacter
+syn region rebolFile oneline start=+%"+ end=+"+ contains=rebolSpecialCharacter
+" URLs
+syn match rebolURL "http://\k\+\(\.\k\+\)*\(:\d\+\)\=\(/\(\k\+/\)*\(\k\+\)\=\)*"
+syn match rebolURL "file://\k\+\(\.\k\+\)*/\(\k\+/\)*\k\+"
+syn match rebolURL "ftp://\(\k\+:\k\+@\)\=\k\+\(\.\k\+\)*\(:\d\+\)\=/\(\k\+/\)*\k\+"
+syn match rebolURL "mailto:\k\+\(\.\k\+\)*@\k\+\(\.\k\+\)*"
+" Issues
+syn match rebolIssue "#\(\d\+-\)*\d\+"
+" Tuples
+syn match rebolTuple "\(\d\+\.\)\{2,}"
+
+" Characters
+syn match rebolSpecialCharacter contained "\^[^[:space:][]"
+syn match rebolSpecialCharacter contained "%\d\+"
+
+
+" Operators
+" Math operators
+syn match rebolMathOperator "\(\*\{1,2}\|+\|-\|/\{1,2}\)"
+syn keyword rebolMathFunction abs absolute add arccosine arcsine arctangent cosine
+syn keyword rebolMathFunction divide exp log-10 log-2 log-e max maximum min
+syn keyword rebolMathFunction minimum multiply negate power random remainder sine
+syn keyword rebolMathFunction square-root subtract tangent
+" Binary operators
+syn keyword rebolBinaryOperator complement and or xor ~
+" Logic operators
+syn match rebolLogicOperator "[<>=]=\="
+syn match rebolLogicOperator "<>"
+syn keyword rebolLogicOperator not
+syn keyword rebolLogicFunction all any
+syn keyword rebolLogicFunction head? tail?
+syn keyword rebolLogicFunction negative? positive? zero? even? odd?
+syn keyword rebolLogicFunction binary? block? char? date? decimal? email? empty?
+syn keyword rebolLogicFunction file? found? function? integer? issue? logic? money?
+syn keyword rebolLogicFunction native? none? object? paren? path? port? series?
+syn keyword rebolLogicFunction string? time? tuple? url? word?
+syn keyword rebolLogicFunction exists? input? same? value?
+
+" Datatypes
+syn keyword rebolType binary! block! char! date! decimal! email! file!
+syn keyword rebolType function! integer! issue! logic! money! native!
+syn keyword rebolType none! object! paren! path! port! string! time!
+syn keyword rebolType tuple! url! word!
+syn keyword rebolTypeFunction type?
+
+" Control statements
+syn keyword rebolStatement break catch exit halt reduce return shield
+syn keyword rebolConditional if else
+syn keyword rebolRepeat for forall foreach forskip loop repeat while until do
+
+" Series statements
+syn keyword rebolStatement change clear copy fifth find first format fourth free
+syn keyword rebolStatement func function head insert last match next parse past
+syn keyword rebolStatement pick remove second select skip sort tail third trim length?
+
+" Context
+syn keyword rebolStatement alias bind use
+
+" Object
+syn keyword rebolStatement import make make-object rebol info?
+
+" I/O statements
+syn keyword rebolStatement delete echo form format import input load mold prin
+syn keyword rebolStatement print probe read save secure send write
+syn keyword rebolOperator size? modified?
+
+" Debug statement
+syn keyword rebolStatement help probe trace
+
+" Misc statements
+syn keyword rebolStatement func function free
+
+" Constants
+syn keyword rebolConstant none
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rebol_syntax_inits")
+ if version < 508
+ let did_rebol_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rebolTodo Todo
+
+ HiLink rebolStatement Statement
+ HiLink rebolLabel Label
+ HiLink rebolConditional Conditional
+ HiLink rebolRepeat Repeat
+
+ HiLink rebolOperator Operator
+ HiLink rebolLogicOperator rebolOperator
+ HiLink rebolLogicFunction rebolLogicOperator
+ HiLink rebolMathOperator rebolOperator
+ HiLink rebolMathFunction rebolMathOperator
+ HiLink rebolBinaryOperator rebolOperator
+ HiLink rebolBinaryFunction rebolBinaryOperator
+
+ HiLink rebolType Type
+ HiLink rebolTypeFunction rebolOperator
+
+ HiLink rebolWord Identifier
+ HiLink rebolWordPath rebolWord
+ HiLink rebolFunction Function
+
+ HiLink rebolCharacter Character
+ HiLink rebolSpecialCharacter SpecialChar
+ HiLink rebolString String
+
+ HiLink rebolNumber Number
+ HiLink rebolInteger rebolNumber
+ HiLink rebolDecimal rebolNumber
+ HiLink rebolTime rebolNumber
+ HiLink rebolDate rebolNumber
+ HiLink rebolMoney rebolNumber
+ HiLink rebolBinary rebolNumber
+ HiLink rebolEmail rebolString
+ HiLink rebolFile rebolString
+ HiLink rebolURL rebolString
+ HiLink rebolIssue rebolNumber
+ HiLink rebolTuple rebolNumber
+ HiLink rebolFloat Float
+ HiLink rebolBoolean Boolean
+
+ HiLink rebolConstant Constant
+
+ HiLink rebolComment Comment
+
+ HiLink rebolError Error
+
+ delcommand HiLink
+endif
+
+if exists("my_rebol_file")
+ if file_readable(expand(my_rebol_file))
+ execute "source " . my_rebol_file
+ endif
+endif
+
+let b:current_syntax = "rebol"
+
+" vim: ts=8
diff --git a/runtime/syntax/registry.vim b/runtime/syntax/registry.vim
new file mode 100644
index 000000000..e9ff8fcab
--- /dev/null
+++ b/runtime/syntax/registry.vim
@@ -0,0 +1,114 @@
+" Vim syntax file
+" Language: Windows Registry export with regedit (*.reg)
+" Maintainer: Dominique Stéphan (dominique@mggen.com)
+" URL: http://www.mggen.com/vim/syntax/registry.zip
+" Last change: 2004 Apr 23
+
+" clear any unwanted syntax defs
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" shut case off
+syn case ignore
+
+" Head of regedit .reg files, it's REGEDIT4 on Win9#/NT
+syn match registryHead "^REGEDIT[0-9]*$"
+
+" Comment
+syn match registryComment "^;.*$"
+
+" Registry Key constant
+syn keyword registryHKEY HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT HKEY_CURRENT_USER
+syn keyword registryHKEY HKEY_USERS HKEY_CURRENT_CONFIG HKEY_DYN_DATA
+" Registry Key shortcuts
+syn keyword registryHKEY HKLM HKCR HKCU HKU HKCC HKDD
+
+" Some values often found in the registry
+" GUID (Global Unique IDentifier)
+syn match registryGUID "{[0-9A-Fa-f]\{8}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{4}\-[0-9A-Fa-f]\{12}}" contains=registrySpecial
+
+" Disk
+" syn match registryDisk "[a-zA-Z]:\\\\"
+
+" Special and Separator characters
+syn match registrySpecial "\\"
+syn match registrySpecial "\\\\"
+syn match registrySpecial "\\\""
+syn match registrySpecial "\."
+syn match registrySpecial ","
+syn match registrySpecial "\/"
+syn match registrySpecial ":"
+syn match registrySpecial "-"
+
+" String
+syn match registryString "\".*\"" contains=registryGUID,registrySpecial
+
+" Path
+syn region registryPath start="\[" end="\]" contains=registryHKEY,registryGUID,registrySpecial
+
+" Path to remove
+" like preceding path but with a "-" at begin
+syn region registryRemove start="\[\-" end="\]" contains=registryHKEY,registryGUID,registrySpecial
+
+" Subkey
+syn match registrySubKey "^\".*\"="
+" Default value
+syn match registrySubKey "^\@="
+
+" Numbers
+
+" Hex or Binary
+" The format can be precised between () :
+" 0 REG_NONE
+" 1 REG_SZ
+" 2 REG_EXPAND_SZ
+" 3 REG_BINARY
+" 4 REG_DWORD, REG_DWORD_LITTLE_ENDIAN
+" 5 REG_DWORD_BIG_ENDIAN
+" 6 REG_LINK
+" 7 REG_MULTI_SZ
+" 8 REG_RESOURCE_LIST
+" 9 REG_FULL_RESOURCE_DESCRIPTOR
+" 10 REG_RESOURCE_REQUIREMENTS_LIST
+" The value can take several lines, if \ ends the line
+" The limit to 999 matches is arbitrary, it avoids Vim crashing on a very long
+" line of hex values that ends in a comma.
+"syn match registryHex "hex\(([0-9]\{0,2})\)\=:\([0-9a-fA-F]\{2},\)\{0,999}\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
+syn match registryHex "hex\(([0-9]\{0,2})\)\=:\([0-9a-fA-F]\{2},\)*\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
+syn match registryHex "^\s*\([0-9a-fA-F]\{2},\)\{0,999}\([0-9a-fA-F]\{2}\|\\\)$" contains=registrySpecial
+" Dword (32 bits)
+syn match registryDword "dword:[0-9a-fA-F]\{8}$" contains=registrySpecial
+
+if version >= 508 || !exists("did_registry_syntax_inits")
+ if version < 508
+ let did_registry_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+" The default methods for highlighting. Can be overridden later
+ HiLink registryComment Comment
+ HiLink registryHead Constant
+ HiLink registryHKEY Constant
+ HiLink registryPath Special
+ HiLink registryRemove PreProc
+ HiLink registryGUID Identifier
+ HiLink registrySpecial Special
+ HiLink registrySubKey Type
+ HiLink registryString String
+ HiLink registryHex Number
+ HiLink registryDword Number
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "registry"
+
+" vim:ts=8
diff --git a/runtime/syntax/remind.vim b/runtime/syntax/remind.vim
new file mode 100644
index 000000000..55d583ec3
--- /dev/null
+++ b/runtime/syntax/remind.vim
@@ -0,0 +1,64 @@
+" Vim syntax file
+" Language: Remind
+" Maintainer: Davide Alberani <alberanid@bigfoot.com>
+" Last Change: 28 Apr 2001
+" Version: 0.2
+" URL: http://digilander.iol.it/alberanid/vim/syntax/remind.vim
+"
+" remind is a sophisticated reminder service
+" you can download remind from http://www.roaringpenguin.com/remind.html
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" shut case off
+syn case ignore
+
+syn keyword remindCommands REM OMIT SET FSET UNSET
+syn keyword remindExpiry UNTIL SCANFROM SCAN WARN SCHED
+syn keyword remindTag PRIORITY TAG
+syn keyword remindTimed AT DURATION
+syn keyword remindMove ONCE SKIP BEFORE AFTER
+syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP
+syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON
+syn keyword remindConditional IF ELSE ENDIF IFTRIG
+syn match remindComment "#.*$"
+syn region remindString start=+'+ end=+'+ skip=+\\\\\|\\'+ oneline
+syn region remindString start=+"+ end=+"+ skip=+\\\\\|\\"+ oneline
+syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE
+syn match remindVar "\$[_a-zA-Z][_a-zA-Z0-9]*"
+syn match remindSubst "%[^ ]"
+syn match remindAdvanceNumber "\(\*\|+\|-\|++\|--\)[0-9]\+"
+
+if version >= 508 || !exists("did_remind_syn_inits")
+ if version < 508
+ let did_remind_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink remindCommands Function
+ HiLink remindExpiry Repeat
+ HiLink remindTag Label
+ HiLink remindTimed Statement
+ HiLink remindMove Statement
+ HiLink remindSpecial Include
+ HiLink remindRun Function
+ HiLink remindConditional Conditional
+ HiLink remindComment Comment
+ HiLink remindString String
+ HiLink remindDebug Debug
+ HiLink remindVar Identifier
+ HiLink remindSubst Constant
+ HiLink remindAdvanceNumber Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "remind"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/resolv.vim b/runtime/syntax/resolv.vim
new file mode 100644
index 000000000..4fbc242e9
--- /dev/null
+++ b/runtime/syntax/resolv.vim
@@ -0,0 +1,85 @@
+" Vim syntax file
+" Language: resolver configuration file
+" Maintaner: Radu Dineiu <littledragon@altern.org>
+" URL: http://ld.yi.org/vim/resolv.vim
+" ChangeLog: http://ld.yi.org/vim/resolv.ChangeLog
+" Last Change: 2003 May 11
+" Version: 0.1
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Errors, comments and operators
+syn match resolvError /./
+syn match resolvNull /^\s*$/
+syn match resolvComment /^\s*#.*$/
+syn match resolvOperator /[\/:]/ contained
+
+" IP
+
+syn cluster resolvIPCluster contains=resolvIPError,resolvIPSpecial
+syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[\.0-9]*/ contained
+syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained
+
+" General
+syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster
+syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
+syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/
+
+" Particular
+syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\{1,3}/ contains=@resolvIPCluster
+syn match resolvHostnameSearch contained /\%(\w\{-}\.[-0-9A-Za-z_\.]\{-}\%(\s\|$\)\)\{1,6}/
+syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?\%(\s\|$\)\)\{1,10}/ contains=resolvOperator,@resolvIPCluster
+
+" Identifiers
+syn match resolvNameserver /^nameserver / nextgroup=resolvIPNameserver
+syn match resolvDomain /^domain / nextgroup=resolvHostname
+syn match resolvSearch /^search / nextgroup=resolvHostnameSearch
+syn match resolvSortList /^sortlist / nextgroup=resolvIPNetmaskSortList
+syn match resolvOptions /^options / nextgroup=resolvOption
+
+" Options
+syn match resolvOption /\%(debug\|ndots:\d\)/ contained contains=resolvOperator
+
+" Additional errors
+syn match resolvError /^search .\{257,}/
+syn match resolvNull /\s\{1,}$/
+
+if version >= 508 || !exists("did_config_syntax_inits")
+ if version < 508
+ let did_config_syntax_inits = 1
+ command! -nargs=+ HiLink hi link <args>
+ else
+ command! -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink resolvIP Number
+ HiLink resolvIPNetmask Number
+ HiLink resolvHostname String
+ HiLink resolvOption String
+
+ HiLink resolvIPNameserver Number
+ HiLink resolvHostnameSearch String
+ HiLink resolvIPNetmaskSortList Number
+
+ HiLink resolvNameServer Identifier
+ HiLink resolvDomain Identifier
+ HiLink resolvSearch Identifier
+ HiLink resolvSortList Identifier
+ HiLink resolvOptions Identifier
+
+ HiLink resolvComment Comment
+ HiLink resolvOperator Operator
+ HiLink resolvError Error
+ HiLink resolvIPError Error
+ HiLink resolvIPSpecial Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "resolv"
+
+" vim: ts=8 ft=vim
diff --git a/runtime/syntax/rexx.vim b/runtime/syntax/rexx.vim
new file mode 100644
index 000000000..ef4b058b5
--- /dev/null
+++ b/runtime/syntax/rexx.vim
@@ -0,0 +1,113 @@
+" Vim syntax file
+" Language: Rexx
+" Maintainer: Thomas Geulig <geulig@nentec.de>
+" Last Change: 2001 May 2
+" URL: http://mywebpage.netscape.com/sharpPeople/vim/syntax/rexx.vim
+"
+" Special Thanks to Dan Sharp <dwsharp@hotmail.com> for comments and additions
+" (and providing the webspace)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" A Keyword is the first symbol in a clause. A clause begins at the start
+" of a line or after a semicolon. THEN, ELSE, OTHERWISE, and colons are always
+" followed by an implied semicolon.
+syn match rexxClause "\(^\|;\|:\|then \|else \|otherwise \)\s*\w\+" contains=ALL
+
+" Considered keywords when used together in a phrase and begin a clause
+syn match rexxKeyword contained "\<signal\( on \(error\|failure\|halt\|notready\|novalue\|syntax\|lostdigits\)\(\s\+name\)\=\)\=\>"
+syn match rexxKeyword contained "\<signal off \(error\|failure\|halt\|notready\|novalue\|syntax\|lostdigits\)\>"
+syn match rexxKeyword contained "\<call off \(error\|failure\|halt\|notready\)\>"
+syn match rexxKeyword contained "\<parse \(upper \)\=\(arg\|linein\|pull\|source\|var\|value\|version\)\>"
+syn match rexxKeyword contained "\<numeric \(digits\|form \(scientific\|engineering\|value\)\|fuzz\)\>"
+syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\=\>"
+syn match rexxKeyword contained "\<procedure\( expose\)\=\>"
+syn match rexxKeyword contained "\<do\( forever\)\=\>"
+
+" Another keyword phrase, separated to aid highlighting in rexxFunction
+syn match rexxKeyword2 contained "\<call\( on \(error\|failure\|halt\|notready\)\(\s\+name\)\=\)\=\>"
+
+" Considered keywords when they begin a clause
+syn match rexxKeyword contained "\<\(arg\|drop\|end\|exit\|if\|interpret\|iterate\|leave\|nop\)\>"
+syn match rexxKeyword contained "\<\(options\|pull\|push\|queue\|return\|say\|select\|trace\)\>"
+
+" Conditional phrases
+syn match rexxConditional "\(^\s*\| \)\(to\|by\|for\|until\|while\|then\|when\|otherwise\|else\)\( \|\s*$\)" contains=ALLBUT,rexxConditional
+syn match rexxConditional contained "\<\(to\|by\|for\|until\|while\|then\|when\|else\|otherwise\)\>"
+
+" Assignments -- a keyword followed by an equal sign becomes a variable
+syn match rexxAssign "\<\w\+\s*=\s*" contains=rexxSpecialVariable
+
+" Functions/Procedures
+syn match rexxFunction "\<\h\w*\(/\*\s*\*/\)*("me=e-1 contains=rexxComment,rexxConditional,rexxKeyword
+syn match rexxFunction "\<\(arg\|trace\)\(/\*\s*\*/\)*("me=e-1
+syn match rexxFunction "\<call\( on \(error\|failure\|halt\|notready\)\(\s\+name\)\=\)\=\>\s\+\w\+\>" contains=rexxKeyword2
+
+" String constants
+syn region rexxString start=+"+ skip=+\\\\\|\\'+ end=+"+
+syn region rexxString start=+'+ skip=+\\\\\|\\"+ end=+'+
+syn match rexxCharacter +"'[^\\]'"+
+
+" Catch errors caused by wrong parenthesis
+syn region rexxParen transparent start='(' end=')' contains=ALLBUT,rexxParenError,rexxTodo,rexxUserLabel,rexxKeyword
+syn match rexxParenError ")"
+syn match rexxInParen "[\\[\\]{}]"
+
+" Comments
+syn region rexxComment start="/\*" end="\*/" contains=rexxTodo,rexxComment
+syn match rexxCommentError "\*/"
+
+syn keyword rexxTodo contained TODO FIXME XXX
+
+" Highlight User Labels
+syn match rexxUserLabel "\<\I\i*\s*:"me=e-1
+
+" Special Variables
+syn keyword rexxSpecialVariable sigl rc result
+syn match rexxCompoundVariable "\<\w\+\.\w*\>"
+
+if !exists("rexx_minlines")
+ let rexx_minlines = 10
+endif
+exec "syn sync ccomment rexxComment minlines=" . rexx_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rexx_syn_inits")
+ if version < 508
+ let did_rexx_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rexxUserLabel Function
+ HiLink rexxCharacter Character
+ HiLink rexxParenError rexxError
+ HiLink rexxInParen rexxError
+ HiLink rexxCommentError rexxError
+ HiLink rexxError Error
+ HiLink rexxKeyword Statement
+ HiLink rexxKeyword2 rexxKeyword
+ HiLink rexxFunction Function
+ HiLink rexxString String
+ HiLink rexxComment Comment
+ HiLink rexxTodo Todo
+ HiLink rexxSpecialVariable Special
+ HiLink rexxConditional rexxKeyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rexx"
+
+"vim: ts=8
diff --git a/runtime/syntax/rib.vim b/runtime/syntax/rib.vim
new file mode 100644
index 000000000..6b9f2b0bd
--- /dev/null
+++ b/runtime/syntax/rib.vim
@@ -0,0 +1,73 @@
+" Vim syntax file
+" Language: Renderman Interface Bytestream
+" Maintainer: Andrew Bromage <ajb@spamcop.net>
+" Last Change: 2003 May 11
+"
+
+" Remove any old syntax stuff hanging around
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+" Comments
+syn match ribLineComment "#.*$"
+syn match ribStructureComment "##.*$"
+
+syn case ignore
+syn match ribCommand /[A-Z][a-zA-Z]*/
+syn case match
+
+syn region ribString start=/"/ skip=/\\"/ end=/"/
+
+syn match ribStructure "[A-Z][a-zA-Z]*Begin\>\|[A-Z][a-zA-Z]*End"
+syn region ribSectionFold start="FrameBegin" end="FrameEnd" fold transparent keepend extend
+syn region ribSectionFold start="WorldBegin" end="WorldEnd" fold transparent keepend extend
+syn region ribSectionFold start="TransformBegin" end="TransformEnd" fold transparent keepend extend
+syn region ribSectionFold start="AttributeBegin" end="AttributeEnd" fold transparent keepend extend
+syn region ribSectionFold start="MotionBegin" end="MotionEnd" fold transparent keepend extend
+syn region ribSectionFold start="SolidBegin" end="SolidEnd" fold transparent keepend extend
+syn region ribSectionFold start="ObjectBegin" end="ObjectEnd" fold transparent keepend extend
+
+syn sync fromstart
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match ribNumbers display transparent "[-]\=\<\d\|\.\d" contains=ribNumber,ribFloat
+syn match ribNumber display contained "[-]\=\d\+\>"
+"floating point number, with dot, optional exponent
+syn match ribFloat display contained "[-]\=\d\+\.\d*\(e[-+]\=\d\+\)\="
+"floating point number, starting with a dot, optional exponent
+syn match ribFloat display contained "[-]\=\.\d\+\(e[-+]\=\d\+\)\=\>"
+"floating point number, without dot, with exponent
+syn match ribFloat display contained "[-]\=\d\+e[-+]\d\+\>"
+syn case match
+
+if version >= 508 || !exists("did_rib_syntax_inits")
+ if version < 508
+ let did_rib_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ribStructure Structure
+ HiLink ribCommand Statement
+
+ HiLink ribStructureComment SpecialComment
+ HiLink ribLineComment Comment
+
+ HiLink ribString String
+ HiLink ribNumber Number
+ HiLink ribFloat Float
+
+ delcommand HiLink
+end
+
+
+let b:current_syntax = "rib"
+
+" Options for vi: ts=8 sw=2 sts=2 nowrap noexpandtab ft=vim
diff --git a/runtime/syntax/rnc.vim b/runtime/syntax/rnc.vim
new file mode 100644
index 000000000..3878c8c1b
--- /dev/null
+++ b/runtime/syntax/rnc.vim
@@ -0,0 +1,94 @@
+" Vim syntax file
+" Language: Relax NG compact syntax
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/rnc/
+" Latest Revision: 2004-05-22
+" arch-tag: 061ee0a2-9efa-4e2a-b1a9-14cf5172d645
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set iskeyword since we need `-' (and potentially others) in keywords.
+" For version 5.x: Set it globally
+" For version 6.x: Set it locally
+if version >= 600
+ command -nargs=1 SetIsk setlocal iskeyword=<args>
+else
+ command -nargs=1 SetIsk set iskeyword=<args>
+endif
+SetIsk @,48-57,_,-,.
+delcommand SetIsk
+
+" Todo
+syn keyword rncTodo contained TODO FIXME XXX NOTE
+
+" Comments
+syn region rncComment matchgroup=rncComment start='^\s*#' end='$' contains=rncTodo
+
+" Operators
+syn match rncOperator '[-|,&+?*~]'
+syn match rncOperator '\%(|&\)\=='
+syn match rncOperator '>>'
+
+" Namespaces
+syn match rncNamespace '\<\k\+:'
+
+" Quoted Identifier
+syn match rncQuoted '\\\k\+\>'
+
+" Special Characters
+syn match rncSpecial '\\x{\x\+}'
+
+" Annotations
+syn region Annotation transparent start='\[' end='\]' contains=ALLBUT,rncComment,rncTodo
+
+" Literals
+syn region rncLiteral matchgroup=rncLiteral oneline start=+"+ end=+"+ contains=rncSpecial
+syn region rncLiteral matchgroup=rncLiteral oneline start=+'+ end=+'+
+syn region rncLiteral matchgroup=rncLiteral start=+"""+ end=+"""+ contains=rncSpecial
+syn region rncLiteral matchgroup=rncLiteral start=+'''+ end=+'''+
+
+" Delimiters
+syn match rncDelimiter '[{},()]'
+
+" Keywords
+syn keyword rncKeyword datatypes default div empty external grammar
+syn keyword rncKeyword include inherit list mixed name namespace
+syn keyword rncKeyword notAllowed parent start string text token
+
+" Identifiers
+syn match rncIdentifier '\k\+\_s*\%(=\|&=\||=\)\@=' nextgroup=rncOperator
+syn keyword rncKeyword nextgroup=rncIdName skipwhite skipempty element attribute
+syn match rncIdentifier contained '\k\+'
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rnc_syn_inits")
+ if version < 508
+ let did_rnc_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rncTodo Todo
+ HiLink rncComment Comment
+ HiLink rncOperator Operator
+ HiLink rncNamespace Identifier
+ HiLink rncQuoted Special
+ HiLink rncSpecial SpecialChar
+ HiLink rncLiteral String
+ HiLink rncDelimiter Delimiter
+ HiLink rncKeyword Keyword
+ HiLink rncIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rnc"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/robots.vim b/runtime/syntax/robots.vim
new file mode 100644
index 000000000..066628bb3
--- /dev/null
+++ b/runtime/syntax/robots.vim
@@ -0,0 +1,69 @@
+" Vim syntax file
+" Language: "Robots.txt" files
+" Robots.txt files indicate to WWW robots which parts of a web site should not be accessed.
+" Maintainer: Dominique Stéphan (dominique@mggen.com)
+" URL: http://www.mggen.com/vim/syntax/robots.zip
+" Last change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" shut case off
+syn case ignore
+
+" Comment
+syn match robotsComment "#.*$" contains=robotsUrl,robotsMail,robotsString
+
+" Star * (means all spiders)
+syn match robotsStar "\*"
+
+" :
+syn match robotsDelimiter ":"
+
+
+" The keywords
+" User-agent
+syn match robotsAgent "^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]"
+" Disallow
+syn match robotsDisallow "^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]"
+
+" Disallow: or User-Agent: and the rest of the line before an eventual comment
+synt match robotsLine "\(^[Uu][Ss][Ee][Rr]\-[Aa][Gg][Ee][Nn][Tt]\|^[Dd][Ii][Ss][Aa][Ll][Ll][Oo][Ww]\):[^#]*" contains=robotsAgent,robotsDisallow,robotsStar,robotsDelimiter
+
+" Some frequent things in comments
+syn match robotsUrl "http[s]\=://\S*"
+syn match robotsMail "\S*@\S*"
+syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+
+
+if version >= 508 || !exists("did_robos_syntax_inits")
+ if version < 508
+ let did_robots_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink robotsComment Comment
+ HiLink robotsAgent Type
+ HiLink robotsDisallow Statement
+ HiLink robotsLine Special
+ HiLink robotsStar Operator
+ HiLink robotsDelimiter Delimiter
+ HiLink robotsUrl String
+ HiLink robotsMail String
+ HiLink robotsString String
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "robots"
+
+" vim: ts=8 sw=2
+
diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim
new file mode 100644
index 000000000..edf87fb28
--- /dev/null
+++ b/runtime/syntax/rpcgen.vim
@@ -0,0 +1,63 @@
+" Vim syntax file
+" Language: rpcgen
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Nov 18, 2002
+" Version: 7
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ source <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+endif
+
+syn keyword rpcProgram program skipnl skipwhite nextgroup=rpcProgName
+syn match rpcProgName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcProgZone
+syn region rpcProgZone contained matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\(\d\+\|0x[23]\x\{7}\)\s*;"me=e-1 contains=rpcVersion,cComment,rpcProgNmbrErr
+syn keyword rpcVersion contained version skipnl skipwhite nextgroup=rpcVersName
+syn match rpcVersName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcVersZone
+syn region rpcVersZone contained matchgroup=Delimiter start="{" matchgroup=Delimiter end="}\s*=\s*\d\+\s*;"me=e-1 contains=cType,cStructure,cStorageClass,rpcDecl,rpcProcNmbr,cComment
+syn keyword rpcDecl contained string
+syn match rpcProcNmbr contained "=\s*\d\+;"me=e-1
+syn match rpcProgNmbrErr contained "=\s*0x[^23]\x*"ms=s+1
+syn match rpcPassThru "^\s*%.*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rpcgen_syntax_inits")
+ if version < 508
+ let did_rpcgen_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rpcProgName rpcName
+ HiLink rpcProgram rpcStatement
+ HiLink rpcVersName rpcName
+ HiLink rpcVersion rpcStatement
+
+ HiLink rpcDecl cType
+ HiLink rpcPassThru cComment
+
+ HiLink rpcName Special
+ HiLink rpcProcNmbr Delimiter
+ HiLink rpcProgNmbrErr Error
+ HiLink rpcStatement Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rpcgen"
+
+" vim: ts=8
diff --git a/runtime/syntax/rpl.vim b/runtime/syntax/rpl.vim
new file mode 100644
index 000000000..bc50475e1
--- /dev/null
+++ b/runtime/syntax/rpl.vim
@@ -0,0 +1,491 @@
+" Vim syntax file
+" Language: RPL/2
+" Version: 0.15.15 against RPL/2 version 4.00pre7i
+" Last Change: 2003 august 24
+" Maintainer: Joël BERTRAND <rpl2@free.fr>
+" URL: http://www.makalis.fr/~bertrand/rpl2/download/vim/indent/rpl.vim
+" Credits: Nothing
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Keyword characters (not used)
+" set iskeyword=33-127
+
+" Case sensitive
+syntax case match
+
+" Constants
+syntax match rplConstant "\(^\|\s\+\)\(e\|i\)\ze\($\|\s\+\)"
+
+" Any binary number
+syntax match rplBinaryError "\(^\|\s\+\)#\s*\S\+b\ze"
+syntax match rplBinary "\(^\|\s\+\)#\s*[01]\+b\ze\($\|\s\+\)"
+syntax match rplOctalError "\(^\|\s\+\)#\s*\S\+o\ze"
+syntax match rplOctal "\(^\|\s\+\)#\s*\o\+o\ze\($\|\s\+\)"
+syntax match rplDecimalError "\(^\|\s\+\)#\s*\S\+d\ze"
+syntax match rplDecimal "\(^\|\s\+\)#\s*\d\+d\ze\($\|\s\+\)"
+syntax match rplHexadecimalError "\(^\|\s\+\)#\s*\S\+h\ze"
+syntax match rplHexadecimal "\(^\|\s\+\)#\s*\x\+h\ze\($\|\s\+\)"
+
+" Case unsensitive
+syntax case ignore
+
+syntax match rplControl "\(^\|\s\+\)abort\ze\($\|\s\+\)"
+syntax match rplControl "\(^\|\s\+\)kill\ze\($\|\s\+\)"
+syntax match rplControl "\(^\|\s\+\)cont\ze\($\|\s\+\)"
+syntax match rplControl "\(^\|\s\+\)halt\ze\($\|\s\+\)"
+syntax match rplControl "\(^\|\s\+\)cmlf\ze\($\|\s\+\)"
+syntax match rplControl "\(^\|\s\+\)sst\ze\($\|\s\+\)"
+
+syntax match rplConstant "\(^\|\s\+\)pi\ze\($\|\s\+\)"
+
+syntax match rplStatement "\(^\|\s\+\)return\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)last\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)syzeval\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)wait\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)type\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)kind\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)eval\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)use\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)remove\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)external\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)dup\([2n]\|\)\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)drop\([2n]\|\)\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)depth\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)roll\(d\|\)\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)pick\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)rot\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)swap\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)over\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)clear\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)warranty\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)copyright\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)convert\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)date\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)time\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)mem\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)clmf\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)->num\ze\($\|\s\+\)"
+syntax match rplStatement "\(^\|\s\+\)help\ze\($\|\s\+\)"
+
+syntax match rplStorage "\(^\|\s\+\)get\(i\|r\|c\|\)\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)put\(i\|r\|c\|\)\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)rcl\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)purge\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)sinv\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)sneg\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)sconj\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)steq\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)rceq\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)vars\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)clusr\ze\($\|\s\+\)"
+syntax match rplStorage "\(^\|\s\+\)sto\([+-/\*]\|\)\ze\($\|\s\+\)"
+
+syntax match rplAlgConditional "\(^\|\s\+\)ift\(e\|\)\ze\($\|\s\+\)"
+
+syntax match rplOperator "\(^\|\s\+\)and\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)\(x\|\)or\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)not\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)same\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)==\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)<=\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)=<\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)=>\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)>=\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)<>\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)>\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)<\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)[+-]\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)[/\*]\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)\^\ze\($\|\s\+\)"
+syntax match rplOperator "\(^\|\s\+\)\*\*\ze\($\|\s\+\)"
+
+syntax match rplBoolean "\(^\|\s\+\)true\ze\($\|\s\+\)"
+syntax match rplBoolean "\(^\|\s\+\)false\ze\($\|\s\+\)"
+
+syntax match rplReadWrite "\(^\|\s\+\)store\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)recall\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\(\|wf\|un\)lock\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)open\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)close\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)delete\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)create\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)format\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)rewind\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)backspace\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\(\|re\)write\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)read\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)inquire\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)sync\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)append\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)suppress\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)seek\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)pr\(1\|int\|st\|stc\|lcd\|var\|usr\|md\)\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)paper\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)cr\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)erase\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)disp\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)input\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)prompt\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)key\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)cllcd\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\(\|re\)draw\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)drax\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)indep\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)depnd\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)res\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)axes\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)label\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)pmin\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)pmax\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)centr\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)persist\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)title\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\(slice\|auto\|log\|\)scale\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)eyept\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\(p\|s\)par\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)function\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)polar\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)scatter\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)plotter\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)wireframe\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)parametric\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)slice\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\*w\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\*h\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\*d\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)\*s\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)->lcd\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)lcd->\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)edit\ze\($\|\s\+\)"
+syntax match rplReadWrite "\(^\|\s\+\)visit\ze\($\|\s\+\)"
+
+syntax match rplIntrinsic "\(^\|\s\+\)abs\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)arg\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)conj\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)re\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)im\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)mant\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)xpon\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)ceil\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)fact\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)fp\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)floor\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)inv\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)ip\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)max\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)min\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)mod\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)neg\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)relax\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)sign\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)sq\(\|rt\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)xroot\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)cos\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)sin\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)tan\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)tg\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)a\(\|rc\)cos\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)a\(\|rc\)sin\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)atan\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)arctg\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|a\)cosh\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|a\)sinh\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|a\)tanh\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|arg\)th\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)arg[cst]h\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|a\)log\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)ln\(\|1\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)exp\(\|m\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)trn\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)con\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)idn\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rdm\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rsd\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)cnrm\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)cross\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)d[eo]t\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)[cr]swp\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rci\(j\|\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(in\|de\)cr\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)bessel\ze\($\|\s\+\)"
+
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|g\)egvl\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|g\)\(\|l\|r\)egv\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rnrm\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(std\|fix\|sci\|eng\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(rad\|deg\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|n\)rand\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rdz\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|i\)fft\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(dec\|bin\|oct\|hex\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)rclf\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)stof\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)[cs]f\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)chr\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)num\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)pos\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)sub\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)size\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(st\|rc\)ws\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(r\|s\)\(r\|l\)\(\|b\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)as\(r\|l\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(int\|der\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)stos\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|r\)cls\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)drws\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)scls\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)ns\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)tot\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)mean\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|p\)sdev\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|p\)var\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)maxs\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)mins\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|p\)cov\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)cols\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)s\(x\(\|y\|2\)\|y\(\|2\)\)\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(x\|y\)col\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)corr\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)utp[cfnt]\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)comb\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)perm\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)\(\|p\)lu\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)[lu]chol\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)schur\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)%\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)%ch\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)%t\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)hms->\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)->hms\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)hms+\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)hms-\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)d->r\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)r->d\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)b->r\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)r->b\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)c->r\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)r->c\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)r->p\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)p->r\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)str->\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)->str\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)array->\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)->array\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)list->\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)->list\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)s+\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)s-\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)col-\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)col+\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)row-\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)row+\ze\($\|\s\+\)"
+syntax match rplIntrinsic "\(^\|\s\+\)->q\ze\($\|\s\+\)"
+
+syntax match rplObsolete "\(^\|\s\+\)arry->\ze\($\|\s\+\)"hs=e-5
+syntax match rplObsolete "\(^\|\s\+\)->arry\ze\($\|\s\+\)"hs=e-5
+
+" Conditional structures
+syntax match rplConditionalError "\(^\|\s\+\)case\ze\($\|\s\+\)"hs=e-3
+syntax match rplConditionalError "\(^\|\s\+\)then\ze\($\|\s\+\)"hs=e-3
+syntax match rplConditionalError "\(^\|\s\+\)else\ze\($\|\s\+\)"hs=e-3
+syntax match rplConditionalError "\(^\|\s\+\)elseif\ze\($\|\s\+\)"hs=e-5
+syntax match rplConditionalError "\(^\|\s\+\)end\ze\($\|\s\+\)"hs=e-2
+syntax match rplConditionalError "\(^\|\s\+\)\(step\|next\)\ze\($\|\s\+\)"hs=e-3
+syntax match rplConditionalError "\(^\|\s\+\)until\ze\($\|\s\+\)"hs=e-4
+syntax match rplConditionalError "\(^\|\s\+\)repeat\ze\($\|\s\+\)"hs=e-5
+syntax match rplConditionalError "\(^\|\s\+\)default\ze\($\|\s\+\)"hs=e-6
+
+" FOR/(CYCLE)/(EXIT)/NEXT
+" FOR/(CYCLE)/(EXIT)/STEP
+" START/(CYCLE)/(EXIT)/NEXT
+" START/(CYCLE)/(EXIT)/STEP
+syntax match rplCycle "\(^\|\s\+\)\(cycle\|exit\)\ze\($\|\s\+\)"
+syntax region rplForNext matchgroup=rplRepeat start="\(^\|\s\+\)\(for\|start\)\ze\($\|\s\+\)" end="\(^\|\s\+\)\(next\|step\)\ze\($\|\s\+\)" contains=ALL keepend extend
+
+" ELSEIF/END
+syntax region rplElseifEnd matchgroup=rplConditional start="\(^\|\s\+\)elseif\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contained contains=ALLBUT,rplElseEnd keepend
+
+" ELSE/END
+syntax region rplElseEnd matchgroup=rplConditional start="\(^\|\s\+\)else\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contained contains=ALLBUT,rplElseEnd,rplThenEnd,rplElseifEnd keepend
+
+" THEN/END
+syntax region rplThenEnd matchgroup=rplConditional start="\(^\|\s\+\)then\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contained containedin=rplIfEnd contains=ALLBUT,rplThenEnd keepend
+
+" IF/END
+syntax region rplIfEnd matchgroup=rplConditional start="\(^\|\s\+\)if\(err\|\)\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contains=ALLBUT,rplElseEnd,rplElseifEnd keepend extend
+" if end is accepted !
+" select end too !
+
+" CASE/THEN
+syntax region rplCaseThen matchgroup=rplConditional start="\(^\|\s\+\)case\ze\($\|\s\+\)" end="\(^\|\s\+\)then\ze\($\|\s\+\)" contains=ALLBUT,rplCaseThen,rplCaseEnd,rplThenEnd keepend extend contained containedin=rplCaseEnd
+
+" CASE/END
+syntax region rplCaseEnd matchgroup=rplConditional start="\(^\|\s\+\)case\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contains=ALLBUT,rplCaseEnd,rplThenEnd,rplElseEnd keepend extend contained containedin=rplSelectEnd
+
+" DEFAULT/END
+syntax region rplDefaultEnd matchgroup=rplConditional start="\(^\|\s\+\)default\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contains=ALLBUT,rplDefaultEnd keepend contained containedin=rplSelectEnd
+
+" SELECT/END
+syntax region rplSelectEnd matchgroup=rplConditional start="\(^\|\s\+\)select\ze\($\|\s\+\)" end="\(^\|\s\+\)end\ze\($\|\s\+\)" contains=ALLBUT,rplThenEnd keepend extend
+" select end is accepted !
+
+" DO/UNTIL/END
+syntax region rplUntilEnd matchgroup=rplConditional start="\(^\|\s\+\)until\ze\($\|\s\+\)" end="\(^\|\s\+\)\zsend\ze\($\|\s\+\)" contains=ALLBUT,rplUntilEnd contained containedin=rplDoUntil extend keepend
+syntax region rplDoUntil matchgroup=rplConditional start="\(^\|\s\+\)do\ze\($\|\s\+\)" end="\(^\|\s\+\)until\ze\($\|\s\+\)" contains=ALL keepend extend
+
+" WHILE/REPEAT/END
+syntax region rplRepeatEnd matchgroup=rplConditional start="\(^\|\s\+\)repeat\ze\($\|\s\+\)" end="\(^\|\s\+\)\zsend\ze\($\|\s\+\)" contains=ALLBUT,rplRepeatEnd contained containedin=rplWhileRepeat extend keepend
+syntax region rplWhileRepeat matchgroup=rplConditional start="\(^\|\s\+\)while\ze\($\|\s\+\)" end="\(^\|\s\+\)repeat\ze\($\|\s\+\)" contains=ALL keepend extend
+
+" Comments
+syntax match rplCommentError "\*/"
+syntax region rplCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1
+syntax region rplCommentLine start="\(^\|\s\+\)//\ze" skip="\\$" end="$" contains=NONE keepend extend
+syntax region rplComment start="\(^\|\s\+\)/\*\ze" end="\*/" contains=rplCommentString keepend extend
+
+" Catch errors caused by too many right parentheses
+syntax region rplParen transparent start="(" end=")" contains=ALLBUT,rplParenError,rplComplex,rplIncluded keepend extend
+syntax match rplParenError ")"
+
+" Subroutines
+" Catch errors caused by too many right '>>'
+syntax match rplSubError "\(^\|\s\+\)>>\ze\($\|\s\+\)"hs=e-1
+syntax region rplSub matchgroup=rplSubDelimitor start="\(^\|\s\+\)<<\ze\($\|\s\+\)" end="\(^\|\s\+\)>>\ze\($\|\s\+\)" contains=ALLBUT,rplSubError,rplIncluded,rplDefaultEnd,rplStorageSub keepend extend
+
+" Expressions
+syntax region rplExpr start="\(^\|\s\+\)'" end="'\ze\($\|\s\+\)" contains=rplParen,rplParenError
+
+" Local variables
+syntax match rplStorageError "\(^\|\s\+\)->\ze\($\|\s\+\)"hs=e-1
+syntax region rplStorageSub matchgroup=rplStorage start="\(^\|\s\+\)<<\ze\($\|\s\+\)" end="\(^\|\s\+\)>>\ze\($\|\s\+\)" contains=ALLBUT,rplSubError,rplIncluded,rplDefaultEnd,rplStorageExpr contained containedin=rplLocalStorage keepend extend
+syntax region rplStorageExpr matchgroup=rplStorage start="\(^\|\s\+\)'" end="'\ze\($\|\s\+\)" contains=rplParen,rplParenError extend contained containedin=rplLocalStorage
+syntax region rplLocalStorage matchgroup=rplStorage start="\(^\|\s\+\)->\ze\($\|\s\+\)" end="\(^\|\s\+\)\(<<\ze\($\|\s\+\)\|'\)" contains=rplStorageSub,rplStorageExpr,rplComment,rplCommentLine keepend extend
+
+" Catch errors caused by too many right brackets
+syntax match rplArrayError "\]"
+syntax match rplArray "\]" contained containedin=rplArray
+syntax region rplArray matchgroup=rplArray start="\[" end="\]" contains=ALLBUT,rplArrayError keepend extend
+
+" Catch errors caused by too many right '}'
+syntax match rplListError "}"
+syntax match rplList "}" contained containedin=rplList
+syntax region rplList matchgroup=rplList start="{" end="}" contains=ALLBUT,rplListError,rplIncluded keepend extend
+
+" cpp is used by RPL/2
+syntax match rplPreProc "\_^#\s*\(define\|undef\)\>"
+syntax match rplPreProc "\_^#\s*\(warning\|error\)\>"
+syntax match rplPreCondit "\_^#\s*\(if\|ifdef\|ifndef\|elif\|else\|endif\)\>"
+syntax match rplIncluded contained "\<<\s*\S*\s*>\>"
+syntax match rplInclude "\_^#\s*include\>\s*["<]" contains=rplIncluded,rplString
+"syntax match rplExecPath "\%^\_^#!\s*\S*"
+syntax match rplExecPath "\%^\_^#!\p*\_$"
+
+" Any integer
+syntax match rplInteger "\(^\|\s\+\)[-+]\=\d\+\ze\($\|\s\+\)"
+
+" Floating point number
+" [S][ip].[fp]
+syntax match rplFloat "\(^\|\s\+\)[-+]\=\(\d*\)\=[\.,]\(\d*\)\=\ze\($\|\s\+\)" contains=ALLBUT,rplPoint,rplSign
+" [S]ip[.fp]E[S]exp
+syntax match rplFloat "\(^\|\s\+\)[-+]\=\d\+\([\.,]\d*\)\=[eE]\([-+]\)\=\d\+\ze\($\|\s\+\)" contains=ALLBUT,rplPoint,rplSign
+" [S].fpE[S]exp
+syntax match rplFloat "\(^\|\s\+\)[-+]\=\(\d*\)\=[\.,]\d\+[eE]\([-+]\)\=\d\+\ze\($\|\s\+\)" contains=ALLBUT,rplPoint,rplSign
+syntax match rplPoint "\<[\.,]\>"
+syntax match rplSign "\<[+-]\>"
+
+" Complex number
+" (x,y)
+syntax match rplComplex "\(^\|\s\+\)([-+]\=\(\d*\)\=\.\=\d*\([eE][-+]\=\d\+\)\=\s*,\s*[-+]\=\(\d*\)\=\.\=\d*\([eE][-+]\=\d\+\)\=)\ze\($\|\s\+\)"
+" (x.y)
+syntax match rplComplex "\(^\|\s\+\)([-+]\=\(\d*\)\=,\=\d*\([eE][-+]\=\d\+\)\=\s*\.\s*[-+]\=\(\d*\)\=,\=\d*\([eE][-+]\=\d\+\)\=)\ze\($\|\s\+\)"
+
+" Strings
+syntax match rplStringGuilles "\\\""
+syntax match rplStringAntislash "\\\\"
+syntax region rplString start=+\(^\|\s\+\)"+ end=+"\ze\($\|\s\+\)+ contains=rplStringGuilles,rplStringAntislash
+
+syntax match rplTab "\t" transparent
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rpl_syntax_inits")
+ if version < 508
+ let did_rpl_syntax_inits = 1
+ command -nargs=+ HiLink highlight link <args>
+ else
+ command -nargs=+ HiLink highlight default link <args>
+ endif
+
+ " The default highlighting.
+
+ HiLink rplControl Statement
+ HiLink rplStatement Statement
+ HiLink rplAlgConditional Conditional
+ HiLink rplConditional Repeat
+ HiLink rplConditionalError Error
+ HiLink rplRepeat Repeat
+ HiLink rplCycle Repeat
+ HiLink rplUntil Repeat
+ HiLink rplIntrinsic Special
+ HiLink rplStorage StorageClass
+ HiLink rplStorageExpr StorageClass
+ HiLink rplStorageError Error
+ HiLink rplReadWrite rplIntrinsic
+
+ HiLink rplOperator Operator
+
+ HiLink rplList Special
+ HiLink rplArray Special
+ HiLink rplConstant Identifier
+ HiLink rplExpr Type
+
+ HiLink rplString String
+ HiLink rplStringGuilles String
+ HiLink rplStringAntislash String
+
+ HiLink rplBinary Boolean
+ HiLink rplOctal Boolean
+ HiLink rplDecimal Boolean
+ HiLink rplHexadecimal Boolean
+ HiLink rplInteger Number
+ HiLink rplFloat Float
+ HiLink rplComplex Float
+ HiLink rplBoolean Identifier
+
+ HiLink rplObsolete Todo
+
+ HiLink rplPreCondit PreCondit
+ HiLink rplInclude Include
+ HiLink rplIncluded rplString
+ HiLink rplInclude Include
+ HiLink rplExecPath Include
+ HiLink rplPreProc PreProc
+ HiLink rplComment Comment
+ HiLink rplCommentLine Comment
+ HiLink rplCommentString Comment
+ HiLink rplSubDelimitor rplStorage
+ HiLink rplCommentError Error
+ HiLink rplParenError Error
+ HiLink rplSubError Error
+ HiLink rplArrayError Error
+ HiLink rplListError Error
+ HiLink rplTab Error
+ HiLink rplBinaryError Error
+ HiLink rplOctalError Error
+ HiLink rplDecimalError Error
+ HiLink rplHexadecimalError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rpl"
+
+" vim: ts=8 tw=132
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
new file mode 100644
index 000000000..02d43c66d
--- /dev/null
+++ b/runtime/syntax/rst.vim
@@ -0,0 +1,107 @@
+" Vim syntax file
+" Language: reStructuredText Documentation Format
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/rst/
+" Latest Revision: 2004-05-13
+" arch-tag: 6fae09da-d5d4-49d8-aec1-e49008ea21e6
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" todo
+syn keyword rstTodo contained FIXME TODO XXX NOTE
+
+syn case ignore
+
+" comments
+syn region rstComment matchgroup=rstComment start="^\.\.\%( \%([a-z0-9_.-]\+::\)\@!\|$\)" end="^\s\@!" contains=rstTodo
+
+syn cluster rstCruft contains=rstFootnoteLabel,rstCitationLabel,rstSubstitutionLabel,rstInline,rstHyperlinks,rstInternalTarget
+
+" blocks
+" syn region rstBlock matchgroup=rstDelimiter start=":\@<!:$" skip="^$" end="^\s\@!" contains=@rstCruft
+syn region rstBlock matchgroup=rstDelimiter start="::$" skip="^$" end="^\s\@!"
+syn region rstDoctestBlock matchgroup=rstDelimiter start="^>>>\s" end="^$"
+
+" tables
+" TODO: these may actually be a bit too complicated to match correctly and
+" should perhaps be removed. Whon really needs it anyway?
+syn region rstTable transparent start="^\n\s*+[-=+]\+" end="^$" contains=rstTableLines,@rstCruft
+syn match rstTableLines contained "^\s*[|+=-]\+$"
+syn region rstSimpleTable transparent start="^\n\s*\%(=\+\s\+\)\%(=\+\s*\)\+$" end="^$" contains=rstSimpleTableLines,@rstCruft
+syn match rstSimpleTableLines contained "^\s*\%(=\+\s\+\)\%(=\+\s*\)\+$"
+
+" footnotes
+syn region rstFootnote matchgroup=rstDirective start="^\.\. \[\%([#*]\|[0-9]\+\|#[a-z0-9_.-]\+\)\]\s" end="^\s\@!" contains=@rstCruft
+syn match rstFootnoteLabel "\[\%([#*]\|[0-9]\+\|#[a-z0-9_.-]\+\)\]_"
+
+" citations
+syn region rstCitation matchgroup=rstDirective start="^\.\. \[[a-z0-9_.-]\+\]\s" end="^\s\@!" contains=@rstCruft
+syn match rstCitationLabel "\[[a-z0-9_.-]\+\]_"
+
+" directives
+syn region rstDirectiveBody matchgroup=rstDirective start="^\.\. [a-z0-9_.-]\+::" end="^\s\@!"
+
+" substitutions
+syn region rstSubstitution matchgroup=rstDirective start="^\.\. |[a-z0-9_.-]|\s[a-z0-9_.-]\+::\s" end="^\s\@!" contains=@rstCruft
+syn match rstSubstitutionLabel "|[a-z0-9_.-]|"
+
+" inline markup
+syn match rstInline "\*\{1,2}\S\%([^*]*\S\)\=\*\{1,2}"
+syn match rstInline "`\{1,2}\S\%([^`]*\S\)\=`\{1,2}"
+
+" hyperlinks
+syn region rstHyperlinks matchgroup=RstDirective start="^\.\. _[a-z0-9_. -]\+:\s" end="^\s\@!" contains=@rstCruft
+
+syn match rstHyperlinksLabel "`\S\%([^`]*\S\)\=`__\=\>"
+syn match rstHyperlinksLabel "\w\+__\=\>"
+
+" internal targets
+syn match rstInternalTarget "_`\S\%([^`]*\S\)\=`"
+
+" lists
+syn match rstListItem "^:\%(\w\+\s*\)\+:"
+syn match rstListItem "^\s*[-*+]\s\+"
+
+syn sync minlines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rst_syn_inits")
+ if version < 508
+ let did_rst_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rstTodo Todo
+ HiLink rstComment Comment
+ HiLink rstDelimiter Delimiter
+ HiLink rstBlock String
+ HiLink rstDoctestBlock PreProc
+ HiLink rstTableLines Delimiter
+ HiLink rstSimpleTableLines rstTableLines
+ HiLink rstFootnote String
+ HiLink rstFootnoteLabel Identifier
+ HiLink rstCitation String
+ HiLink rstCitationLabel Identifier
+ HiLink rstDirective Keyword
+ HiLink rstDirectiveBody Type
+ HiLink rstSubstitution String
+ HiLink rstSubstitutionLabel Identifier
+ HiLink rstHyperlinks String
+ HiLink rstHyperlinksLabel Identifier
+ HiLink rstListItem Identifier
+ hi def rstInline term=italic cterm=italic gui=italic
+ hi def rstInternalTarget term=italic cterm=italic gui=italic
+ delcommand HiLink
+endif
+
+let b:current_syntax = "rst"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/rtf.vim b/runtime/syntax/rtf.vim
new file mode 100644
index 000000000..8f5ea71a3
--- /dev/null
+++ b/runtime/syntax/rtf.vim
@@ -0,0 +1,88 @@
+" Vim syntax file
+" Language: Rich Text Format
+" "*.rtf" files
+"
+" The Rich Text Format (RTF) Specification is a method of encoding formatted
+" text and graphics for easy transfer between applications.
+" .hlp (windows help files) use compiled rtf files
+" rtf documentation at http://night.primate.wisc.edu/software/RTF/
+"
+" Maintainer: Dominique Stéphan (dominique@mggen.com)
+" URL: http://www.mggen.com/vim/syntax/rtf.zip
+" Last change: 2001 Mai 02
+
+" TODO: render underline, italic, bold
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" case on (all controls must be lower case)
+syn case match
+
+" Control Words
+syn match rtfControlWord "\\[a-z]\+[\-]\=[0-9]*"
+
+" New Control Words (not in the 1987 specifications)
+syn match rtfNewControlWord "\\\*\\[a-z]\+[\-]\=[0-9]*"
+
+" Control Symbol : any \ plus a non alpha symbol, *, \, { and } and '
+syn match rtfControlSymbol "\\[^a-zA-Z\*\{\}\\']"
+
+" { } and \ are special characters, to use them
+" we add a backslash \
+syn match rtfCharacter "\\\\"
+syn match rtfCharacter "\\{"
+syn match rtfCharacter "\\}"
+" Escaped characters (for 8 bytes characters upper than 127)
+syn match rtfCharacter "\\'[A-Za-z0-9][A-Za-z0-9]"
+" Unicode
+syn match rtfUnicodeCharacter "\\u[0-9][0-9]*"
+
+" Color values, we will put this value in Red, Green or Blue
+syn match rtfRed "\\red[0-9][0-9]*"
+syn match rtfGreen "\\green[0-9][0-9]*"
+syn match rtfBlue "\\blue[0-9][0-9]*"
+
+" Some stuff for help files
+syn match rtfFootNote "[#$K+]{\\footnote.*}" contains=rtfControlWord,rtfNewControlWord
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_rtf_syntax_inits")
+ if version < 508
+ let did_rtf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+
+ HiLink rtfControlWord Statement
+ HiLink rtfNewControlWord Special
+ HiLink rtfControlSymbol Constant
+ HiLink rtfCharacter Character
+ HiLink rtfUnicodeCharacter SpecialChar
+ HiLink rtfFootNote Comment
+
+ " Define colors for the syntax file
+ hi rtfRed term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed
+ hi rtfGreen term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen
+ hi rtfBlue term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue
+
+ HiLink rtfRed rtfRed
+ HiLink rtfGreen rtfGreen
+ HiLink rtfBlue rtfBlue
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "rtf"
+
+" vim:ts=8
diff --git a/runtime/syntax/ruby.vim b/runtime/syntax/ruby.vim
new file mode 100644
index 000000000..02f178d65
--- /dev/null
+++ b/runtime/syntax/ruby.vim
@@ -0,0 +1,285 @@
+" Vim syntax file
+" Language: Ruby
+" Maintainer: Doug Kearns
+" Previous Maintainer: Mirko Nasato
+" Last Change: 2003 May 31
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/ruby.vim
+
+" $Id$
+
+" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Expression Substitution and Backslash Notation
+syn match rubyExprSubst "\\\\\|\(\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\w\)\|\(\\\o\{3}\|\\x\x\{2}\|\\[abefnrstv]\)" contained
+syn match rubyExprSubst "#{[^}]*}" contained
+syn match rubyExprSubst "#[$@]\w\+" contained
+
+" Numbers and ASCII Codes
+syn match rubyNumber "\w\@<!\(?\(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\S\)\)"
+syn match rubyNumber "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>"
+
+" Identifiers - constant, class and instance, global, symbol, iterator, predefined
+syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" transparent contains=NONE
+
+if !exists("ruby_no_identifiers")
+ syn match rubyConstant "\(::\)\=\zs\u\w*"
+ syn match rubyClassVariable "@@\h\w*"
+ syn match rubyInstanceVariable "@\h\w*"
+ syn match rubyGlobalVariable "$\(\h\w*\|-.\)"
+ syn match rubySymbol ":\@<!:\(\$\|@@\=\)\=\h\w*[?!=]\="
+ syn match rubyIterator "|[ ,a-zA-Z0-9_*]\+|"
+
+ syn match rubyPredefinedVariable "$[!"$&'*+,./0:;<=>?@\\_`~1-9]"
+ syn match rubyPredefinedVariable "$-[0FIKadilpvw]"
+ syn match rubyPredefinedVariable "$\(defout\|stderr\|stdin\|stdout\)\>"
+ syn match rubyPredefinedVariable "$\(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>"
+ syn match rubyPredefinedConstant "__\(FILE\|LINE\)__\>"
+ syn match rubyPredefinedConstant "\<\(::\)\=\zs\(MatchingData\|NotImplementError\|ARGF\|ARGV\|ENV\)\>"
+ syn match rubyPredefinedConstant "\<\(::\)\=\zs\(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>"
+ syn match rubyPredefinedConstant "\<\(::\)\=\zs\(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>"
+ "Obsolete Global Constants
+ "syn match rubyPredefinedConstant "\<\(::\)\=\zs\(PLATFORM\|RELEASE\|VERSION\)\>"
+endif
+
+"
+" BEGIN Autogenerated Stuff
+"
+" Generalized Regular Expression
+syn region rubyString matchgroup=rubyStringDelimit start="%r!" end="![iomx]*" skip="\\\\\|\\!" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\"" end="\"[iomx]*" skip="\\\\\|\\\"" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r#" end="#[iomx]*" skip="\\\\\|\\#" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\$" end="\$[iomx]*" skip="\\\\\|\\\$" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r%" end="%[iomx]*" skip="\\\\\|\\%" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r&" end="&[iomx]*" skip="\\\\\|\\&" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r'" end="'[iomx]*" skip="\\\\\|\\'" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\*" end="\*[iomx]*" skip="\\\\\|\\\*" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r+" end="+[iomx]*" skip="\\\\\|\\+" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r-" end="-[iomx]*" skip="\\\\\|\\-" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\." end="\.[iomx]*" skip="\\\\\|\\\." contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r/" end="/[iomx]*" skip="\\\\\|\\/" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r:" end=":[iomx]*" skip="\\\\\|\\:" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r;" end=";[iomx]*" skip="\\\\\|\\;" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r=" end="=[iomx]*" skip="\\\\\|\\=" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r?" end="?[iomx]*" skip="\\\\\|\\?" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r@" end="@[iomx]*" skip="\\\\\|\\@" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\\" end="\\[iomx]*" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\^" end="\^[iomx]*" skip="\\\\\|\\\^" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r`" end="`[iomx]*" skip="\\\\\|\\`" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r|" end="|[iomx]*" skip="\\\\\|\\|" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\~" end="\~[iomx]*" skip="\\\\\|\\\~" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r{" end="}[iomx]*" skip="\\\\\|\\}" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r<" end=">[iomx]*" skip="\\\\\|\\>" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r\[" end="\][iomx]*" skip="\\\\\|\\\]" contains=rubyExprSubst fold
+syn region rubyString matchgroup=rubyStringDelimit start="%r(" end=")[iomx]*" skip="\\\\\|\\)" contains=rubyExprSubst fold
+
+" Generalized Single Quoted String and Array of Strings
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]!" end="!" skip="\\\\\|\\!"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\"" end="\"" skip="\\\\\|\\\""
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]#" end="#" skip="\\\\\|\\#"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\$" end="\$" skip="\\\\\|\\\$"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]%" end="%" skip="\\\\\|\\%"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]&" end="&" skip="\\\\\|\\&"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]'" end="'" skip="\\\\\|\\'"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\*" end="\*" skip="\\\\\|\\\*"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]+" end="+" skip="\\\\\|\\+"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]-" end="-" skip="\\\\\|\\-"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\." end="\." skip="\\\\\|\\\."
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]/" end="/" skip="\\\\\|\\/"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]:" end=":" skip="\\\\\|\\:"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq];" end=";" skip="\\\\\|\\;"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]=" end="=" skip="\\\\\|\\="
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]?" end="?" skip="\\\\\|\\?"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]@" end="@" skip="\\\\\|\\@"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\\" end="\\"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\^" end="\^" skip="\\\\\|\\\^"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]`" end="`" skip="\\\\\|\\`"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]|" end="|" skip="\\\\\|\\|"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\~" end="\~" skip="\\\\\|\\\~"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]{" end="}" skip="\\\\\|\\}"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]<" end=">" skip="\\\\\|\\>"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq]\[" end="\]" skip="\\\\\|\\\]"
+syn region rubyString matchgroup=rubyStringDelimit start="%[wq](" end=")" skip="\\\\\|\\)"
+
+" Generalized Double Quoted String and Shell Command Output
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=!" end="!" skip="\\\\\|\\!" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=#" end="#" skip="\\\\\|\\#" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\$" end="\$" skip="\\\\\|\\\$" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=%" end="%" skip="\\\\\|\\%" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=&" end="&" skip="\\\\\|\\&" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\='" end="'" skip="\\\\\|\\'" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\*" end="\*" skip="\\\\\|\\\*" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=+" end="+" skip="\\\\\|\\+" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=-" end="-" skip="\\\\\|\\-" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\." end="\." skip="\\\\\|\\\." contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=/" end="/" skip="\\\\\|\\/" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=:" end=":" skip="\\\\\|\\:" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=;" end=";" skip="\\\\\|\\;" contains=rubyExprSubst
+"syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\==" end="=" skip="\\\\\|\\=" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]=" end="=" skip="\\\\\|\\=" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=?" end="?" skip="\\\\\|\\?" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=@" end="@" skip="\\\\\|\\@" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\\" end="\\" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\^" end="\^" skip="\\\\\|\\\^" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=`" end="`" skip="\\\\\|\\`" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=|" end="|" skip="\\\\\|\\|" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\~" end="\~" skip="\\\\\|\\\~" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\={" end="}" skip="\\\\\|\\}" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=<" end=">" skip="\\\\\|\\>" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=\[" end="\]" skip="\\\\\|\\\]" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="%[Qx]\=(" end=")" skip="\\\\\|\\)" contains=rubyExprSubst
+
+" Normal String and Shell Command Output
+syn region rubyString matchgroup=rubyStringDelimit start="\"" end="\"" skip="\\\\\|\\\"" contains=rubyExprSubst
+syn region rubyString matchgroup=rubyStringDelimit start="'" end="'" skip="\\\\\|\\'"
+syn region rubyString matchgroup=rubyStringDelimit start="`" end="`" skip="\\\\\|\\`" contains=rubyExprSubst
+"
+" END Autogenerated Stuff
+"
+
+" Normal Regular Expression
+syn region rubyString matchgroup=rubyStringDelimit start="^\s*/" start="\<and\s*/"lc=3 start="\<or\s*/"lc=2 start="\<while\s*/"lc=5 start="\<until\s*/"lc=5 start="\<unless\s*/"lc=6 start="\<if\s*/"lc=2 start="\<elsif\s*/"lc=5 start="\<when\s*/"lc=4 start="[\~=!|&(,[]\s*/"lc=1 end="/[iomx]*" skip="\\\\\|\\/" contains=rubyExprSubst
+
+" Here Document
+if version < 600
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<-\(\u\{3,}\|'\u\{3,}'\|"\u\{3,}"\|`\u\{3,}`\)+hs=s+2 end=+^\s*\u\{3,}$+ fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<-\(EOF\|'EOF'\|"EOF"\|`EOF`\)+hs=s+2 end=+^\s*EOF$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<-\(EOS\|'EOS'\|"EOS"\|`EOS`\)+hs=s+2 end=+^\s*EOS$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<\(\u\{3,}\|'\u\{3,}'\|"\u\{3,}"\|`\u\{3,}`\)+hs=s+2 end=+^\u\{3,}$+ fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<\(EOF\|'EOF'\|"EOF"\|`EOF`\)+hs=s+2 end=+^EOF$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+<<\(EOS\|'EOS'\|"EOS"\|`EOS`\)+hs=s+2 end=+^EOS$+ contains=rubyExprSubst fold
+else
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<\z(\h\w*\)\s*$+hs=s+2 end=+^\z1$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<"\z(.*\)"\s*$+hs=s+2 end=+^\z1$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<'\z(.*\)'\s*$+hs=s+2 end=+^\z1$+ fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<`\z(.*\)`\s*$+hs=s+2 end=+^\z1$+ contains=rubyExprSubst fold
+
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<-\z(\h\w*\)\s*$+hs=s+3 end=+^\s*\z1$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<-"\z(.*\)"\s*$+hs=s+3 end=+^\s*\z1$+ contains=rubyExprSubst fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<-'\z(.*\)'\s*$+hs=s+3 end=+^\s*\z1$+ fold
+ syn region rubyString matchgroup=rubyStringDelimit start=+\(class\s*\)\@<!<<-`\z(.*\)`\s*$+hs=s+3 end=+^\s*\z1$+ contains=rubyExprSubst fold
+endif
+
+" Expensive Mode - colorize *end* according to opening statement
+if !exists("ruby_no_expensive")
+ syn region rubyFunction matchgroup=rubyDefine start="^\s*def\s" matchgroup=NONE end="\ze\(\s\|(\|;\|$\)" skip="\.\|\(::\)" oneline fold
+ syn region rubyClassOrModule matchgroup=rubyDefine start="^\s*\(class\|module\)\s" end="<\|$\|;\|\>"he=e-1 oneline fold
+
+ syn region rubyBlock start="^\s*def\s\+"rs=s matchgroup=rubyDefine end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo nextgroup=rubyFunction fold
+ syn region rubyBlock start="^\s*\(class\|module\)\>"rs=s matchgroup=rubyDefine end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo nextgroup=rubyClassOrModule fold
+
+ " modifiers + redundant *do*
+ syn match rubyControl "\<\(if\|unless\|while\|until\|do\)\>"
+
+ " *do* requiring *end*
+ syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo fold
+
+ " *{* requiring *}*
+ syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,rubyExprSubst,rubyTodo fold
+
+ " statements without *do*
+ syn region rubyNoDoBlock matchgroup=rubyControl start="\<\(case\|begin\)\>" start="^\s*\(if\|unless\)\>" start=";\s*\(if\|unless\)\>"hs=s+1 end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo fold
+
+ " statement with optional *do*
+ syn region rubyOptDoBlock matchgroup=rubyControl start="\<for\>" start="^\s*\(while\|until\)\>" start=";\s*\(while\|until\)\>"hs=s+1 end="\<end\>" contains=ALLBUT,rubyExprSubst,rubyTodo,rubyDoBlock,rubyCurlyBlock fold
+
+ if !exists("ruby_minlines")
+ let ruby_minlines = 50
+ endif
+ exec "syn sync minlines=" . ruby_minlines
+
+else " not Expensive
+ syn region rubyFunction matchgroup=rubyControl start="^\s*def\s" matchgroup=NONE end="\ze\(\s\|(\|;\|$\)" skip="\.\|\(::\)" oneline fold
+ syn region rubyClassOrModule matchgroup=rubyControl start="^\s*\(class\|module\)\s" end="<\|$\|;\|\>"he=e-1 oneline fold
+ syn keyword rubyControl case begin do for if unless while until end
+endif " Expensive?
+
+" Keywords
+syn keyword rubyControl then else elsif when ensure rescue
+syn keyword rubyControl and or not in loop
+syn keyword rubyControl break redo retry next return
+syn match rubyKeyword "\<defined?"
+syn keyword rubyKeyword alias lambda proc super undef yield
+syn match rubyInclude "^\s*include\>"
+syn keyword rubyInclude load require
+syn keyword rubyTodo FIXME NOTE TODO XXX contained
+syn keyword rubyBoolean true false self nil
+syn keyword rubyException raise fail catch throw
+syn keyword rubyBeginEnd BEGIN END
+
+" Comments and Documentation
+if version < 600
+ syn match rubySharpBang "#!.*"
+else
+ syn match rubySharpBang "\%^#!.*"
+endif
+syn match rubyComment "#.*" contains=rubyTodo
+syn region rubyDocumentation start="^=begin" end="^=end.*$" contains=rubyTodo fold
+
+" Note: this is a hack to prevent 'keywords' being highlighted as such when used as method names
+syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(alias\|and\|begin\|break\|case\|catch\|class\|def\|do\|elsif\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(else\|fail\|false\|ensure\|for\|end\|if\|in\|include\|lambda\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(load\|loop\|module\|next\|nil\|not\|or\|proc\|raise\|require\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(redo\|rescue\|retry\|return\|self\|super\|then\|throw\|true\|unless\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\.\@<!\.\(\s*\n\s*\)*\(undef\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
+
+" __END__ Directive
+syn region rubyData matchgroup=rubyDataDirective start="^__END__$" matchgroup=NONE end="." skip="."
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_ruby_syntax_inits")
+ if version < 508
+ let did_ruby_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink rubyDefine Define
+ HiLink rubyFunction Function
+ HiLink rubyControl Statement
+ HiLink rubyInclude Include
+ HiLink rubyNumber Number
+ HiLink rubyBoolean Boolean
+ HiLink rubyException Exception
+ HiLink rubyClassOrModule Type
+ HiLink rubyIdentifier Identifier
+ HiLink rubyClassVariable rubyIdentifier
+ HiLink rubyConstant rubyIdentifier
+ HiLink rubyGlobalVariable rubyIdentifier
+ HiLink rubyIterator rubyIdentifier
+ HiLink rubyInstanceVariable rubyIdentifier
+ HiLink rubyPredefinedIdentifier rubyIdentifier
+ HiLink rubyPredefinedConstant rubyPredefinedIdentifier
+ HiLink rubyPredefinedVariable rubyPredefinedIdentifier
+ HiLink rubySymbol rubyIdentifier
+ HiLink rubySharpBang PreProc
+ HiLink rubyKeyword Keyword
+ HiLink rubyBeginEnd Statement
+
+ HiLink rubyString String
+ HiLink rubyStringDelimit Delimiter
+ HiLink rubyExprSubst Special
+
+ HiLink rubyComment Comment
+ HiLink rubyDocumentation Comment
+ HiLink rubyTodo Todo
+ HiLink rubyData Comment
+ HiLink rubyDataDirective Delimiter
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "ruby"
+
+" vim: nowrap tabstop=8
diff --git a/runtime/syntax/samba.vim b/runtime/syntax/samba.vim
new file mode 100644
index 000000000..10f7edce6
--- /dev/null
+++ b/runtime/syntax/samba.vim
@@ -0,0 +1,117 @@
+" Vim syntax file
+" Language: samba configuration files (smb.conf)
+" Maintainer: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
+" URL: http://rgarciasuarez.free.fr/vim/syntax/samba.vim
+" Last change: 2002 May 06
+
+" Don't forget to run your config file through testparm(1)!
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn match sambaParameter /^[a-zA-Z \t]\+=/ contains=sambaKeyword
+syn match sambaSection /^\s*\[[a-zA-Z0-9_\-. ]\+\]/
+syn match sambaMacro /%[SPugUGHvhmLMNpRdaIT]/
+syn match sambaMacro /%$([a-zA-Z0-9_]\+)/
+syn match sambaComment /^\s*[;#].*/
+syn match sambaContinue /\\$/
+syn keyword sambaBoolean true false yes no
+
+" Keywords for Samba 2.0.5a
+syn keyword sambaKeyword contained account acl action add address admin aliases
+syn keyword sambaKeyword contained allow alternate always announce anonymous
+syn keyword sambaKeyword contained archive as auto available bind blocking
+syn keyword sambaKeyword contained bmpx break browsable browse browseable ca
+syn keyword sambaKeyword contained cache case casesignames cert certDir
+syn keyword sambaKeyword contained certFile change char character chars chat
+syn keyword sambaKeyword contained ciphers client clientcert code coding
+syn keyword sambaKeyword contained command comment compatibility config
+syn keyword sambaKeyword contained connections contention controller copy
+syn keyword sambaKeyword contained create deadtime debug debuglevel default
+syn keyword sambaKeyword contained delete deny descend dfree dir directory
+syn keyword sambaKeyword contained disk dns domain domains dont dos dot drive
+syn keyword sambaKeyword contained driver encrypt encrypted equiv exec fake
+syn keyword sambaKeyword contained file files filetime filetimes filter follow
+syn keyword sambaKeyword contained force fstype getwd group groups guest
+syn keyword sambaKeyword contained hidden hide home homedir hosts include
+syn keyword sambaKeyword contained interfaces interval invalid keepalive
+syn keyword sambaKeyword contained kernel key ldap length level level2 limit
+syn keyword sambaKeyword contained links list lm load local location lock
+syn keyword sambaKeyword contained locking locks log logon logons logs lppause
+syn keyword sambaKeyword contained lpq lpresume lprm machine magic mangle
+syn keyword sambaKeyword contained mangled mangling map mask master max mem
+syn keyword sambaKeyword contained message min mode modes mux name names
+syn keyword sambaKeyword contained netbios nis notify nt null offset ok ole
+syn keyword sambaKeyword contained only open oplock oplocks options order os
+syn keyword sambaKeyword contained output packet page panic passwd password
+syn keyword sambaKeyword contained passwords path permissions pipe port
+syn keyword sambaKeyword contained postexec postscript prediction preexec
+syn keyword sambaKeyword contained prefered preferred preload preserve print
+syn keyword sambaKeyword contained printable printcap printer printers
+syn keyword sambaKeyword contained printing program protocol proxy public
+syn keyword sambaKeyword contained queuepause queueresume raw read readonly
+syn keyword sambaKeyword contained realname remote require resign resolution
+syn keyword sambaKeyword contained resolve restrict revalidate rhosts root
+syn keyword sambaKeyword contained script security sensitive server servercert
+syn keyword sambaKeyword contained service services set share shared short
+syn keyword sambaKeyword contained size smb smbrun socket space ssl stack stat
+syn keyword sambaKeyword contained status strict string strip suffix support
+syn keyword sambaKeyword contained symlinks sync syslog system time timeout
+syn keyword sambaKeyword contained times timestamp to trusted ttl unix update
+syn keyword sambaKeyword contained use user username users valid version veto
+syn keyword sambaKeyword contained volume wait wide wins workgroup writable
+syn keyword sambaKeyword contained write writeable xmit
+
+" New keywords for Samba 2.0.6
+syn keyword sambaKeyword contained hook hires pid uid close rootpreexec
+
+" New keywords for Samba 2.0.7
+syn keyword sambaKeyword contained utmp wtmp hostname consolidate
+syn keyword sambaKeyword contained inherit source environment
+
+" New keywords for Samba 2.2.0
+syn keyword sambaKeyword contained addprinter auth browsing deleteprinter
+syn keyword sambaKeyword contained enhanced enumports filemode gid host jobs
+syn keyword sambaKeyword contained lanman msdfs object os2 posix processes
+syn keyword sambaKeyword contained scope separator shell show smbd template
+syn keyword sambaKeyword contained total vfs winbind wizard
+
+" New keywords for Samba 2.2.1
+syn keyword sambaKeyword contained large obey pam readwrite restrictions
+syn keyword sambaKeyword contained unreadable
+
+" New keywords for Samba 2.2.2 - 2.2.4
+syn keyword sambaKeyword contained acls allocate bytes count csc devmode
+syn keyword sambaKeyword contained disable dn egd entropy enum extensions mmap
+syn keyword sambaKeyword contained policy spin spoolss
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_samba_syn_inits")
+ if version < 508
+ let did_samba_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink sambaParameter Normal
+ HiLink sambaKeyword Type
+ HiLink sambaSection Statement
+ HiLink sambaMacro PreProc
+ HiLink sambaComment Comment
+ HiLink sambaContinue Operator
+ HiLink sambaBoolean Constant
+ delcommand HiLink
+endif
+
+let b:current_syntax = "samba"
+
+" vim: ts=8
diff --git a/runtime/syntax/sas.vim b/runtime/syntax/sas.vim
new file mode 100644
index 000000000..68e8788e2
--- /dev/null
+++ b/runtime/syntax/sas.vim
@@ -0,0 +1,236 @@
+" Vim syntax file
+" Language: SAS
+" Maintainer: James Kidd <james.kidd@covance.com>
+" Last Change: 02 Jun 2003
+" Added highlighting for additional keywords and such;
+" Attempted to match SAS default syntax colors;
+" Changed syncing so it doesn't lose colors on large blocks;
+" Much thanks to Bob Heckel for knowledgeable tweaking.
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+
+
+" Want region from 'cards;' to ';' to be captured (Bob Heckel)
+syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$"
+syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$"
+
+syn match sasNumber "-\=\<\d*\.\=[0-9_]\>"
+
+syn region sasComment start="/\*" end="\*/" contains=sasTodo
+" Ignore misleading //JCL SYNTAX... (Bob Heckel)
+syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo
+
+" Allow highlighting of embedded TODOs (Bob Heckel)
+syn match sasComment "^\s*\*.*;" contains=sasTodo
+
+" Allow highlighting of embedded TODOs (Bob Heckel)
+syn match sasComment ";\s*\*.*;"hs=s+1 contains=sasTodo
+
+" Handle macro comments too (Bob Heckel).
+syn match sasComment "^\s*%*\*.*;" contains=sasTodo
+
+" This line defines macro variables in code. HiLink at end of file
+" defines the color scheme. Begin region with ampersand and end with
+" any non-word character offset by -1; put ampersand in the skip list
+" just in case it is used to concatenate macro variable values.
+
+" Thanks to ronald höllwarth for this fix to an intra-versioning
+" problem with this little feature
+
+if version < 600
+ syn region sasMacroVar start="\&" skip="[_&]" end="\W"he=e-1
+else " for the older Vim's just do it their way ...
+ syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1
+endif
+
+
+" I dont think specific PROCs need to be listed if use this line (Bob Heckel).
+syn match sasProc "^\s*PROC \w\+"
+syn keyword sasStep RUN QUIT DATA
+
+
+" Base SAS Procs - version 8.1
+
+syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE
+
+syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME
+syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY
+syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE
+syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP
+syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD
+syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE
+syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN
+syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE
+syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK
+
+" Keywords that are used in Proc SQL
+" I left them as statements because SAS's enhanced editor highlights
+" them the same as normal statements used in data steps (Jim Kidd)
+
+syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE
+syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN
+syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN
+syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT
+syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES
+syn keyword sasStatement RESET RESTRICT SELECT SET TABLE
+syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE
+
+
+syn match sasStatement "FOOTNOTE\d" "TITLE\d"
+
+syn match sasMacro "%BQUOTE" "%NRBQUOTE" "%CMPRES" "%QCMPRES"
+syn match sasMacro "%COMPSTOR" "%DATATYP" "%DISPLAY" "%DO"
+syn match sasMacro "%ELSE" "%END" "%EVAL" "%GLOBAL"
+syn match sasMacro "%GOTO" "%IF" "%INDEX" "%INPUT"
+syn match sasMacro "%KEYDEF" "%LABEL" "%LEFT" "%LENGTH"
+syn match sasMacro "%LET" "%LOCAL" "%LOWCASE" "%MACRO"
+syn match sasMacro "%MEND" "%NRBQUOTE" "%NRQUOTE" "%NRSTR"
+syn match sasMacro "%PUT" "%QCMPRES" "%QLEFT" "%QLOWCASE"
+syn match sasMacro "%QSCAN" "%QSUBSTR" "%QSYSFUNC" "%QTRIM"
+syn match sasMacro "%QUOTE" "%QUPCASE" "%SCAN" "%STR"
+syn match sasMacro "%SUBSTR" "%SUPERQ" "%SYSCALL" "%SYSEVALF"
+syn match sasMacro "%SYSEXEC" "%SYSFUNC" "%SYSGET" "%SYSLPUT"
+syn match sasMacro "%SYSPROD" "%SYSRC" "%SYSRPUT" "%THEN"
+syn match sasMacro "%TO" "%TRIM" "%UNQUOTE" "%UNTIL"
+syn match sasMacro "%UPCASE" "%VERIFY" "%WHILE" "%WINDOW"
+
+" SAS Functions
+
+syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
+syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
+syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
+syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
+syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
+syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY
+syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
+syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
+syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
+syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
+syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
+syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
+syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
+syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
+syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
+syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
+syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
+syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
+syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
+syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
+syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
+syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N
+syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
+syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
+syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM
+syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
+syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
+syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
+syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
+syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
+syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
+syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
+syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
+syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
+syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
+syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME
+syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
+syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
+syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
+syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
+syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL
+syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
+syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
+syn keyword sasFunction ZIPSTATE
+
+" Handy settings for using vim with log files
+syn keyword sasLogMsg NOTE
+syn keyword sasWarnMsg WARNING
+syn keyword sasErrMsg ERROR
+
+" Always contained in a comment (Bob Heckel)
+syn keyword sasTodo TODO TBD FIXME contained
+
+" These don't fit anywhere else (Bob Heckel).
+syn match sasUnderscore "_NULL_"
+syn match sasUnderscore "_INFILE_"
+syn match sasUnderscore "_N_"
+syn match sasUnderscore "_WEBOUT_"
+syn match sasUnderscore "_NUMERIC_"
+syn match sasUnderscore "_CHARACTER_"
+syn match sasUnderscore "_ALL_"
+
+" End of SAS Functions
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+
+if version >= 508 || !exists("did_sas_syntax_inits")
+ if version < 508
+ let did_sas_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Default sas enhanced editor color syntax
+ hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
+ hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
+ hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
+ hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
+ hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
+ hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
+ hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
+ hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
+ hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
+ hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
+ hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
+ hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
+ hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
+ hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
+ hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
+
+" Colors that closely match SAS log colors for default color scheme
+ hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
+ hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
+ hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
+
+
+ " Special hilighting for the SAS proc section
+
+ HiLink sasComment sComment
+ HiLink sasConditional sKeyword
+ HiLink sasStep sSection
+ HiLink sasFunction sKeyword
+ HiLink sasMacro mKeyword
+ HiLink sasMacroVar NonText
+ HiLink sasNumber sNumber
+ HiLink sasStatement sKeyword
+ HiLink sasString sString
+ HiLink sasProc sProc
+ " (Bob Heckel)
+ HiLink sasTodo Todo
+ HiLink sasErrMsg lError
+ HiLink sasWarnMsg lWarning
+ HiLink sasLogMsg lNote
+ HiLink sasCards sCard
+ " (Bob Heckel)
+ HiLink sasUnderscore PreProc
+ delcommand HiLink
+endif
+
+" Syncronize from beginning to keep large blocks from losing
+" syntax coloring while moving through code.
+syn sync fromstart
+
+let b:current_syntax = "sas"
+
+" vim: ts=8
diff --git a/runtime/syntax/sather.vim b/runtime/syntax/sather.vim
new file mode 100644
index 000000000..759591bf8
--- /dev/null
+++ b/runtime/syntax/sather.vim
@@ -0,0 +1,105 @@
+" Vim syntax file
+" Language: Sather/pSather
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/sather.vim
+" Last Change: 2003 May 11
+
+" Sather is a OO-language developped at the International Computer Science
+" Institute (ICSI) in Berkeley, CA. pSather is a parallel extension to Sather.
+" Homepage: http://www.icsi.berkeley.edu/~sather
+" Sather files use .sa as suffix
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" keyword definitions
+syn keyword satherExternal extern
+syn keyword satherBranch break continue
+syn keyword satherLabel when then
+syn keyword satherConditional if else elsif end case typecase assert with
+syn match satherConditional "near$"
+syn match satherConditional "far$"
+syn match satherConditional "near *[^(]"he=e-1
+syn match satherConditional "far *[^(]"he=e-1
+syn keyword satherSynchronize lock guard sync
+syn keyword satherRepeat loop parloop do
+syn match satherRepeat "while!"
+syn match satherRepeat "break!"
+syn match satherRepeat "until!"
+syn keyword satherBoolValue true false
+syn keyword satherValue self here cluster
+syn keyword satherOperator new "== != & ^ | && ||
+syn keyword satherOperator and or not
+syn match satherOperator "[#!]"
+syn match satherOperator ":-"
+syn keyword satherType void attr where
+syn match satherType "near *("he=e-1
+syn match satherType "far *("he=e-1
+syn keyword satherStatement return
+syn keyword satherStorageClass static const
+syn keyword satherExceptions try raise catch
+syn keyword satherMethodDecl is pre post
+syn keyword satherClassDecl abstract value class include
+syn keyword satherScopeDecl public private readonly
+
+
+syn match satherSpecial contained "\\\d\d\d\|\\."
+syn region satherString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=satherSpecial
+syn match satherCharacter "'[^\\]'"
+syn match satherSpecialCharacter "'\\.'"
+syn match satherNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn match satherCommentSkip contained "^\s*\*\($\|\s\+\)"
+syn region satherComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+$\|"+ contains=satherSpecial
+syn match satherComment "--.*" contains=satherComment2String,satherCharacter,satherNumber
+
+
+syn sync ccomment satherComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sather_syn_inits")
+ if version < 508
+ let did_sather_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink satherBranch satherStatement
+ HiLink satherLabel satherStatement
+ HiLink satherConditional satherStatement
+ HiLink satherSynchronize satherStatement
+ HiLink satherRepeat satherStatement
+ HiLink satherExceptions satherStatement
+ HiLink satherStorageClass satherDeclarative
+ HiLink satherMethodDecl satherDeclarative
+ HiLink satherClassDecl satherDeclarative
+ HiLink satherScopeDecl satherDeclarative
+ HiLink satherBoolValue satherValue
+ HiLink satherSpecial satherValue
+ HiLink satherString satherValue
+ HiLink satherCharacter satherValue
+ HiLink satherSpecialCharacter satherValue
+ HiLink satherNumber satherValue
+ HiLink satherStatement Statement
+ HiLink satherOperator Statement
+ HiLink satherComment Comment
+ HiLink satherType Type
+ HiLink satherValue String
+ HiLink satherString String
+ HiLink satherSpecial String
+ HiLink satherCharacter String
+ HiLink satherDeclarative Type
+ HiLink satherExternal PreCondit
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sather"
+
+" vim: ts=8
diff --git a/runtime/syntax/scheme.vim b/runtime/syntax/scheme.vim
new file mode 100644
index 000000000..d3de35b6b
--- /dev/null
+++ b/runtime/syntax/scheme.vim
@@ -0,0 +1,189 @@
+" Vim syntax file
+" Language: Scheme (R5RS)
+" Maintainer: Dirk van Deun <dirk@igwe.vub.ac.be>
+" Last Change: April 30, 1998
+
+" This script incorrectly recognizes some junk input as numerals:
+" parsing the complete system of Scheme numerals using the pattern
+" language is practically impossible: I did a lax approximation.
+
+" Suggestions and bug reports are solicited by the author.
+
+" Initializing:
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Fascist highlighting: everything that doesn't fit the rules is an error...
+
+syn match schemeError oneline ![^ \t()";]*!
+syn match schemeError oneline ")"
+
+" Quoted and backquoted stuff
+
+syn region schemeQuoted matchgroup=Delimiter start="['`]" end=![ \t()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+syn region schemeQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+syn region schemeQuoted matchgroup=Delimiter start="['`]#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+syn region schemeStrucRestricted matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+syn region schemeStrucRestricted matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+syn region schemeUnquote matchgroup=Delimiter start="," end=![ \t()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+syn region schemeUnquote matchgroup=Delimiter start=",@" end=![ \t()";]!me=e-1 contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+syn region schemeUnquote matchgroup=Delimiter start=",(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+syn region schemeUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+syn region schemeUnquote matchgroup=Delimiter start=",#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+syn region schemeUnquote matchgroup=Delimiter start=",@#(" end=")" contains=ALLBUT,schemeStruc,schemeSyntax,schemeFunc
+
+" R5RS Scheme Functions and Syntax:
+
+if version < 600
+ set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
+else
+ setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
+endif
+
+syn keyword schemeSyntax lambda and or if cond case define let let* letrec
+syn keyword schemeSyntax begin do delay set! else =>
+syn keyword schemeSyntax quote quasiquote unquote unquote-splicing
+syn keyword schemeSyntax define-syntax let-syntax letrec-syntax syntax-rules
+
+syn keyword schemeFunc not boolean? eq? eqv? equal? pair? cons car cdr set-car!
+syn keyword schemeFunc set-cdr! caar cadr cdar cddr caaar caadr cadar caddr
+syn keyword schemeFunc cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr
+syn keyword schemeFunc cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr
+syn keyword schemeFunc cddaar cddadr cdddar cddddr null? list? list length
+syn keyword schemeFunc append reverse list-ref memq memv member assq assv assoc
+syn keyword schemeFunc symbol? symbol->string string->symbol number? complex?
+syn keyword schemeFunc real? rational? integer? exact? inexact? = < > <= >=
+syn keyword schemeFunc zero? positive? negative? odd? even? max min + * - / abs
+syn keyword schemeFunc quotient remainder modulo gcd lcm numerator denominator
+syn keyword schemeFunc floor ceiling truncate round rationalize exp log sin cos
+syn keyword schemeFunc tan asin acos atan sqrt expt make-rectangular make-polar
+syn keyword schemeFunc real-part imag-part magnitude angle exact->inexact
+syn keyword schemeFunc inexact->exact number->string string->number char=?
+syn keyword schemeFunc char-ci=? char<? char-ci<? char>? char-ci>? char<=?
+syn keyword schemeFunc char-ci<=? char>=? char-ci>=? char-alphabetic? char?
+syn keyword schemeFunc char-numeric? char-whitespace? char-upper-case?
+syn keyword schemeFunc char-lower-case?
+syn keyword schemeFunc char->integer integer->char char-upcase char-downcase
+syn keyword schemeFunc string? make-string string string-length string-ref
+syn keyword schemeFunc string-set! string=? string-ci=? string<? string-ci<?
+syn keyword schemeFunc string>? string-ci>? string<=? string-ci<=? string>=?
+syn keyword schemeFunc string-ci>=? substring string-append vector? make-vector
+syn keyword schemeFunc vector vector-length vector-ref vector-set! procedure?
+syn keyword schemeFunc apply map for-each call-with-current-continuation
+syn keyword schemeFunc call-with-input-file call-with-output-file input-port?
+syn keyword schemeFunc output-port? current-input-port current-output-port
+syn keyword schemeFunc open-input-file open-output-file close-input-port
+syn keyword schemeFunc close-output-port eof-object? read read-char peek-char
+syn keyword schemeFunc write display newline write-char call/cc
+syn keyword schemeFunc list-tail string->list list->string string-copy
+syn keyword schemeFunc string-fill! vector->list list->vector vector-fill!
+syn keyword schemeFunc force with-input-from-file with-output-to-file
+syn keyword schemeFunc char-ready? load transcript-on transcript-off eval
+syn keyword schemeFunc dynamic-wind port? values call-with-values
+syn keyword schemeFunc scheme-report-environment null-environment
+syn keyword schemeFunc interaction-environment
+
+" Writing out the complete description of Scheme numerals without
+" using variables is a day's work for a trained secretary...
+" This is a useful lax approximation:
+
+syn match schemeNumber oneline "[-#+0-9.][-#+/0-9a-f@i.boxesfdl]*"
+syn match schemeError oneline ![-#+0-9.][-#+/0-9a-f@i.boxesfdl]*[^-#+/0-9a-f@i.boxesfdl \t()";][^ \t()";]*!
+
+syn match schemeOther oneline ![+-][ \t()";]!me=e-1
+syn match schemeOther oneline ![+-]$!
+" ... so that a single + or -, inside a quoted context, would not be
+" interpreted as a number (outside such contexts, it's a schemeFunc)
+
+syn match schemeDelimiter oneline !\.[ \t()";]!me=e-1
+syn match schemeDelimiter oneline !\.$!
+" ... and a single dot is not a number but a delimiter
+
+" Simple literals:
+
+syn match schemeBoolean oneline "#[tf]"
+syn match schemeError oneline !#[tf][^ \t()";]\+!
+
+syn match schemeChar oneline "#\\"
+syn match schemeChar oneline "#\\."
+syn match schemeError oneline !#\\.[^ \t()";]\+!
+syn match schemeChar oneline "#\\space"
+syn match schemeError oneline !#\\space[^ \t()";]\+!
+syn match schemeChar oneline "#\\newline"
+syn match schemeError oneline !#\\newline[^ \t()";]\+!
+
+" This keeps all other stuff unhighlighted, except *stuff* and <stuff>:
+
+syn match schemeOther oneline ,[a-z!$%&*/:<=>?^_~][-a-z!$%&*/:<=>?^_~0-9+.@]*,
+syn match schemeError oneline ,[a-z!$%&*/:<=>?^_~][-a-z!$%&*/:<=>?^_~0-9+.@]*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+syn match schemeOther oneline "\.\.\."
+syn match schemeError oneline !\.\.\.[^ \t()";]\+!
+" ... a special identifier
+
+syn match schemeConstant oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[ \t()";],me=e-1
+syn match schemeConstant oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*$,
+syn match schemeError oneline ,\*[-a-z!$%&*/:<=>?^_~0-9+.@]*\*[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+syn match schemeConstant oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[ \t()";],me=e-1
+syn match schemeConstant oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>$,
+syn match schemeError oneline ,<[-a-z!$%&*/:<=>?^_~0-9+.@]*>[^-a-z!$%&*/:<=>?^_~0-9+.@ \t()";]\+[^ \t()";]*,
+
+" Non-quoted lists, and strings:
+
+syn region schemeStruc matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALL
+syn region schemeStruc matchgroup=Delimiter start="#(" matchgroup=Delimiter end=")" contains=ALL
+
+syn region schemeString start=+"+ skip=+\\[\\"]+ end=+"+
+
+" Comments:
+
+syn match schemeComment ";.*$"
+
+" Synchronization and the wrapping up...
+
+syn sync match matchPlace grouphere NONE "^[^ \t]"
+" ... i.e. synchronize on a line that starts at the left margin
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_scheme_syntax_inits")
+ if version < 508
+ let did_scheme_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink schemeSyntax Statement
+ HiLink schemeFunc Function
+
+ HiLink schemeString String
+ HiLink schemeChar Character
+ HiLink schemeNumber Number
+ HiLink schemeBoolean Boolean
+
+ HiLink schemeDelimiter Delimiter
+ HiLink schemeConstant Constant
+
+ HiLink schemeComment Comment
+ HiLink schemeError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "scheme"
diff --git a/runtime/syntax/scilab.vim b/runtime/syntax/scilab.vim
new file mode 100644
index 000000000..1bfc00367
--- /dev/null
+++ b/runtime/syntax/scilab.vim
@@ -0,0 +1,115 @@
+"
+" Vim syntax file
+" Language : Scilab
+" Maintainer : Benoit Hamelin
+" File type : *.sci (see :help filetype)
+" History
+" 28jan2002 benoith 0.1 Creation. Adapted from matlab.vim.
+" 04feb2002 benoith 0.5 Fixed bugs with constant highlighting.
+"
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" Reserved words.
+syn keyword scilabStatement abort clear clearglobal end exit global mode predef quit resume
+syn keyword scilabStatement return
+syn keyword scilabFunction function endfunction funptr
+syn keyword scilabPredicate null iserror isglobal
+syn keyword scilabKeyword typename
+syn keyword scilabDebug debug pause what where whereami whereis who whos
+syn keyword scilabRepeat for while break
+syn keyword scilabConditional if then else elseif
+syn keyword scilabMultiplex select case
+
+" Reserved constants.
+syn match scilabConstant "\(%\)[0-9A-Za-z?!#$]\+"
+syn match scilabBoolean "\(%\)[FTft]\>"
+
+" Delimiters and operators.
+syn match scilabDelimiter "[][;,()]"
+syn match scilabComparison "[=~]="
+syn match scilabComparison "[<>]=\="
+syn match scilabComparison "<>"
+syn match scilabLogical "[&|~]"
+syn match scilabAssignment "="
+syn match scilabArithmetic "[+-]"
+syn match scilabArithmetic "\.\=[*/\\]\.\="
+syn match scilabArithmetic "\.\=^"
+syn match scilabRange ":"
+syn match scilabMlistAccess "\."
+
+syn match scilabLineContinuation "\.\{2,}"
+
+syn match scilabTransposition "[])a-zA-Z0-9?!_#$.]'"lc=1
+
+" Comments and tools.
+syn keyword scilabTodo TODO todo FIXME fixme TBD tbd contained
+syn match scilabComment "//.*$" contains=scilabTodo
+
+" Constants.
+syn match scilabNumber "[0-9]\+\(\.[0-9]*\)\=\([DEde][+-]\=[0-9]\+\)\="
+syn match scilabNumber "\.[0-9]\+\([DEde][+-]\=[0-9]\+\)\="
+syn region scilabString start=+'+ skip=+''+ end=+'+ oneline
+syn region scilabString start=+"+ end=+"+ oneline
+
+" Identifiers.
+syn match scilabIdentifier "\<[A-Za-z?!_#$][A-Za-z0-9?!_#$]*\>"
+syn match scilabOverload "%[A-Za-z0-9?!_#$]\+_[A-Za-z0-9?!_#$]\+"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_scilab_syntax_inits")
+ if version < 508
+ let did_scilab_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink scilabStatement Statement
+ HiLink scilabFunction Keyword
+ HiLink scilabPredicate Keyword
+ HiLink scilabKeyword Keyword
+ HiLink scilabDebug Debug
+ HiLink scilabRepeat Repeat
+ HiLink scilabConditional Conditional
+ HiLink scilabMultiplex Conditional
+
+ HiLink scilabConstant Constant
+ HiLink scilabBoolean Boolean
+
+ HiLink scilabDelimiter Delimiter
+ HiLink scilabMlistAccess Delimiter
+ HiLink scilabComparison Operator
+ HiLink scilabLogical Operator
+ HiLink scilabAssignment Operator
+ HiLink scilabArithmetic Operator
+ HiLink scilabRange Operator
+ HiLink scilabLineContinuation Underlined
+ HiLink scilabTransposition Operator
+
+ HiLink scilabTodo Todo
+ HiLink scilabComment Comment
+
+ HiLink scilabNumber Number
+ HiLink scilabString String
+
+ HiLink scilabIdentifier Identifier
+ HiLink scilabOverload Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "scilab"
+
+"EOF vim: ts=4 noet tw=100 sw=4 sts=0
diff --git a/runtime/syntax/screen.vim b/runtime/syntax/screen.vim
new file mode 100644
index 000000000..eef74f26f
--- /dev/null
+++ b/runtime/syntax/screen.vim
@@ -0,0 +1,93 @@
+" Vim syntax file
+" Language: Screen Virtual Terminal Emulator/Manager Configuration File
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/screen/
+" Latest Revision: 2004-05-22
+" arch-tag: 6a97fb8f-fc88-497f-9c55-e946734ba034
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" comments
+syn region screenComment matchgroup=screenComment start="#" end="$" contains=screenTodo
+
+" todo
+syn keyword screenTodo contained TODO FIXME XXX NOTE
+
+" string (can contain variables)
+syn region screenString matchgroup=screenString start='"' skip='\\"' end='"\|$' contains=screenVariable,screenSpecial
+
+" literal string
+syn region screenLiteral matchgroup=screenLiteral start="'" skip="\\'" end="'\|$"
+
+" environment variables
+syn match screenVariable contained "$\(\h\w*\|{\h\w*}\)"
+
+" booleans
+syn keyword screenBoolean on off
+
+" numbers
+syn match screenNumbers "\<\d\+\>"
+
+" specials
+syn match screenSpecials contained "%\([%aAdDhlmMstuwWyY?:{]\|[0-9]*n\|0?cC\)"
+
+" commands
+syn keyword screenCommands acladd aclchg acldel aclgrp aclumask activity addacl allpartial at attrcolor
+syn keyword screenCommands autodetach bell_msg bind bindkey bufferfile caption chacl chdir clear colon
+syn keyword screenCommands command compacthist console copy copy_regcrlf debug detach digraph dinfo crlf
+syn keyword screenCommands displays dumptermcap echo exec fit focus height help history
+syn keyword screenCommands info kill lastmsg license lockscreen markkeys meta msgminwait msgwait
+syn keyword screenCommands multiuser nethack next nonblock number only other partial_state
+syn keyword screenCommands password paste pastefont pow_break pow_detach_msg prev printcmd process
+syn keyword screenCommands quit readbuf readreg redisplay register remove removebuf reset resize screen
+syn keyword screenCommands select sessionname setenv shelltitle silencewait verbose
+syn keyword screenCommands sleep sorendition split startup_message stuff su suspend time
+syn keyword screenCommands title umask version wall width writebuf xoff xon defmode hardstatus
+syn keyword screenCommands altscreen break breaktype copy_reg defbreaktype defencoding deflog encoding
+syn keyword screenCommands eval ignorecase ins_reg maxwin partial pow_detach setsid source unsetenv
+syn keyword screenCommands windowlist windows
+syn match screenCommands "\<\(def\)\=\(autonuke\|bce\|c1\|charset\|escape\|flow\|kanji\|login\|monitor\|hstatus\|obuflimit\)\>"
+syn match screenCommands "\<\(def\)\=\(scrollback\|shell\|silence\|slowpaste\|utf8\|wrap\|writelock\|zombie\|gr\)\>"
+syn match screenCommands "\<hard\(copy\(_append\|dir\)\=\|status\)\>"
+syn match screenCommands "\<log\(file\|in\|tstamp\)\=\>"
+syn match screenCommands "\<map\(default\|notnext\|timeout\)\>"
+syn match screenCommands "\<term\(cap\|info\|capinfo\)\=\>"
+syn match screenCommands "\<vbell\(_msg\|wait\)\=\>"
+
+if exists("screen_minlines")
+ let b:screen_minlines = screen_minlines
+else
+ let b:screen_minlines = 10
+endif
+exec "syn sync minlines=" . b:screen_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_screen_syn_inits")
+ if version < 508
+ let did_screen_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink screenComment Comment
+ HiLink screenTodo Todo
+ HiLink screenString String
+ HiLink screenLiteral String
+ HiLink screenVariable Identifier
+ HiLink screenBoolean Boolean
+ HiLink screenNumbers Number
+ HiLink screenSpecials Special
+ HiLink screenCommands Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "screen"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/sdl.vim b/runtime/syntax/sdl.vim
new file mode 100644
index 000000000..d0165e760
--- /dev/null
+++ b/runtime/syntax/sdl.vim
@@ -0,0 +1,167 @@
+" Vim syntax file
+" Language: SDL
+" Maintainer: Michael Piefel <piefel@informatik.hu-berlin.de>
+" Last Change: 2 May 2001
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("sdl_2000")
+ syntax case ignore
+endif
+
+" A bunch of useful SDL keywords
+syn keyword sdlStatement task else nextstate
+syn keyword sdlStatement in out with from interface
+syn keyword sdlStatement to via env and use
+syn keyword sdlStatement process procedure block system service type
+syn keyword sdlStatement endprocess endprocedure endblock endsystem
+syn keyword sdlStatement package endpackage connection endconnection
+syn keyword sdlStatement channel endchannel connect
+syn keyword sdlStatement synonym dcl signal gate timer signallist signalset
+syn keyword sdlStatement create output set reset call
+syn keyword sdlStatement operators literals
+syn keyword sdlStatement active alternative any as atleast constants
+syn keyword sdlStatement default endalternative endmacro endoperator
+syn keyword sdlStatement endselect endsubstructure external
+syn keyword sdlStatement if then fi for import macro macrodefinition
+syn keyword sdlStatement macroid mod nameclass nodelay not operator or
+syn keyword sdlStatement parent provided referenced rem
+syn keyword sdlStatement select spelling substructure xor
+syn keyword sdlNewState state endstate
+syn keyword sdlInput input start stop return none save priority
+syn keyword sdlConditional decision enddecision join
+syn keyword sdlVirtual virtual redefined finalized adding inherits
+syn keyword sdlExported remote exported export
+
+if !exists("sdl_no_96")
+ syn keyword sdlStatement all axioms constant endgenerator endrefinement endservice
+ syn keyword sdlStatement error fpar generator literal map noequality ordering
+ syn keyword sdlStatement refinement returns revealed reverse service signalroute
+ syn keyword sdlStatement view viewed
+ syn keyword sdlExported imported
+endif
+
+if exists("sdl_2000")
+ syn keyword sdlStatement abstract aggregation association break choice composition
+ syn keyword sdlStatement continue endmethod handle method
+ syn keyword sdlStatement ordered private protected public
+ syn keyword sdlException exceptionhandler endexceptionhandler onexception
+ syn keyword sdlException catch new raise
+ " The same in uppercase
+ syn keyword sdlStatement TASK ELSE NEXTSTATE
+ syn keyword sdlStatement IN OUT WITH FROM INTERFACE
+ syn keyword sdlStatement TO VIA ENV AND USE
+ syn keyword sdlStatement PROCESS PROCEDURE BLOCK SYSTEM SERVICE TYPE
+ syn keyword sdlStatement ENDPROCESS ENDPROCEDURE ENDBLOCK ENDSYSTEM
+ syn keyword sdlStatement PACKAGE ENDPACKAGE CONNECTION ENDCONNECTION
+ syn keyword sdlStatement CHANNEL ENDCHANNEL CONNECT
+ syn keyword sdlStatement SYNONYM DCL SIGNAL GATE TIMER SIGNALLIST SIGNALSET
+ syn keyword sdlStatement CREATE OUTPUT SET RESET CALL
+ syn keyword sdlStatement OPERATORS LITERALS
+ syn keyword sdlStatement ACTIVE ALTERNATIVE ANY AS ATLEAST CONSTANTS
+ syn keyword sdlStatement DEFAULT ENDALTERNATIVE ENDMACRO ENDOPERATOR
+ syn keyword sdlStatement ENDSELECT ENDSUBSTRUCTURE EXTERNAL
+ syn keyword sdlStatement IF THEN FI FOR IMPORT MACRO MACRODEFINITION
+ syn keyword sdlStatement MACROID MOD NAMECLASS NODELAY NOT OPERATOR OR
+ syn keyword sdlStatement PARENT PROVIDED REFERENCED REM
+ syn keyword sdlStatement SELECT SPELLING SUBSTRUCTURE XOR
+ syn keyword sdlNewState STATE ENDSTATE
+ syn keyword sdlInput INPUT START STOP RETURN NONE SAVE PRIORITY
+ syn keyword sdlConditional DECISION ENDDECISION JOIN
+ syn keyword sdlVirtual VIRTUAL REDEFINED FINALIZED ADDING INHERITS
+ syn keyword sdlExported REMOTE EXPORTED EXPORT
+
+ syn keyword sdlStatement ABSTRACT AGGREGATION ASSOCIATION BREAK CHOICE COMPOSITION
+ syn keyword sdlStatement CONTINUE ENDMETHOD ENDOBJECT ENDVALUE HANDLE METHOD OBJECT
+ syn keyword sdlStatement ORDERED PRIVATE PROTECTED PUBLIC
+ syn keyword sdlException EXCEPTIONHANDLER ENDEXCEPTIONHANDLER ONEXCEPTION
+ syn keyword sdlException CATCH NEW RAISE
+endif
+
+" String and Character contstants
+" Highlight special characters (those which have a backslash) differently
+syn match sdlSpecial contained "\\\d\d\d\|\\."
+syn region sdlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial
+syn region sdlString start=+'+ skip=+''+ end=+'+
+
+" No, this doesn't happen, I just wanted to scare you. SDL really allows all
+" these characters for identifiers; fortunately, keywords manage without them.
+" set iskeyword=@,48-57,_,192-214,216-246,248-255,-
+
+syn region sdlComment start="/\*" end="\*/"
+syn region sdlComment start="comment" end=";"
+syn region sdlComment start="--" end="--\|$"
+syn match sdlCommentError "\*/"
+
+syn keyword sdlOperator present
+syn keyword sdlType integer real natural duration pid boolean time
+syn keyword sdlType character charstring ia5string
+syn keyword sdlType self now sender offspring
+syn keyword sdlStructure asntype endasntype syntype endsyntype struct
+
+if !exists("sdl_no_96")
+ syn keyword sdlStructure newtype endnewtype
+endif
+
+if exists("sdl_2000")
+ syn keyword sdlStructure object endobject value endvalue
+ " The same in uppercase
+ syn keyword sdlStructure OBJECT ENDOBJECT VALUE ENDVALUE
+ syn keyword sdlOperator PRESENT
+ syn keyword sdlType INTEGER NATURAL DURATION PID BOOLEAN TIME
+ syn keyword sdlType CHARSTRING IA5STRING
+ syn keyword sdlType SELF NOW SENDER OFFSPRING
+ syn keyword sdlStructure ASNTYPE ENDASNTYPE SYNTYPE ENDSYNTYPE STRUCT
+endif
+
+" ASN.1 in SDL
+syn case match
+syn keyword sdlType SET OF BOOLEAN INTEGER REAL BIT OCTET
+syn keyword sdlType SEQUENCE CHOICE
+syn keyword sdlType STRING OBJECT IDENTIFIER NULL
+
+syn sync ccomment sdlComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sdl_syn_inits")
+ if version < 508
+ let did_sdl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ Hi hi <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ Hi hi def <args>
+ endif
+
+ HiLink sdlException Label
+ HiLink sdlConditional sdlStatement
+ HiLink sdlVirtual sdlStatement
+ HiLink sdlExported sdlFlag
+ HiLink sdlCommentError sdlError
+ HiLink sdlOperator Operator
+ HiLink sdlStructure sdlType
+ Hi sdlStatement term=bold ctermfg=4 guifg=Blue
+ Hi sdlFlag term=bold ctermfg=4 guifg=Blue gui=italic
+ Hi sdlNewState term=italic ctermfg=2 guifg=Magenta gui=underline
+ Hi sdlInput term=bold guifg=Red
+ HiLink sdlType Type
+ HiLink sdlString String
+ HiLink sdlComment Comment
+ HiLink sdlSpecial Special
+ HiLink sdlError Error
+
+ delcommand HiLink
+ delcommand Hi
+endif
+
+let b:current_syntax = "sdl"
+
+" vim: ts=8
diff --git a/runtime/syntax/sed.vim b/runtime/syntax/sed.vim
new file mode 100644
index 000000000..68e395bb5
--- /dev/null
+++ b/runtime/syntax/sed.vim
@@ -0,0 +1,122 @@
+" Vim syntax file
+" Language: sed
+" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
+" URL: http://folk.uio.no/hakonrk/vim/syntax/sed.vim
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match sedError "\S"
+
+syn match sedWhitespace "\s\+" contained
+syn match sedSemicolon ";"
+syn match sedAddress "[[:digit:]$]"
+syn match sedAddress "\d\+\~\d\+"
+syn region sedAddress matchgroup=Special start="[{,;]\s*/\(\\/\)\="lc=1 skip="[^\\]\(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
+syn region sedAddress matchgroup=Special start="^\s*/\(\\/\)\=" skip="[^\\]\(\\\\\)*\\/" end="/I\=" contains=sedTab,sedRegexpMeta
+syn match sedComment "^\s*#.*$"
+syn match sedFunction "[dDgGhHlnNpPqx=]\s*\($\|;\)" contains=sedSemicolon,sedWhitespace
+syn match sedLabel ":[^;]*"
+syn match sedLineCont "^\(\\\\\)*\\$" contained
+syn match sedLineCont "[^\\]\(\\\\\)*\\$"ms=e contained
+syn match sedSpecial "[{},!]"
+if exists("highlight_sedtabs")
+ syn match sedTab "\t" contained
+endif
+
+" Append/Change/Insert
+syn region sedACI matchgroup=sedFunction start="[aci]\\$" matchgroup=NONE end="^.*$" contains=sedLineCont,sedTab
+
+syn region sedBranch matchgroup=sedFunction start="[bt]" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace
+syn region sedRW matchgroup=sedFunction start="[rw]" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace
+
+" Substitution/transform with various delimiters
+syn region sedFlagwrite matchgroup=sedFlag start="w" matchgroup=sedSemicolon end=";\|$" contains=sedWhitespace contained
+syn match sedFlag "[[:digit:]gpI]*w\=" contains=sedFlagwrite contained
+syn match sedRegexpMeta "[.*^$]" contained
+syn match sedRegexpMeta "\\." contains=sedTab contained
+syn match sedRegexpMeta "\[.\{-}\]" contains=sedTab contained
+syn match sedRegexpMeta "\\{\d\*,\d*\\}" contained
+syn match sedRegexpMeta "\\(.\{-}\\)" contains=sedTab contained
+syn match sedReplaceMeta "&\|\\\($\|.\)" contains=sedTab contained
+
+" Metacharacters: $ * . \ ^ [ ~
+" @ is used as delimiter and treated on its own below
+let __at = char2nr("@")
+let __sed_i = char2nr(" ")
+if has("ebcdic")
+ let __sed_last = 255
+else
+ let __sed_last = 126
+endif
+let __sed_metacharacters = '$*.\^[~'
+while __sed_i <= __sed_last
+ let __sed_delimiter = escape(nr2char(__sed_i), __sed_metacharacters)
+ if __sed_i != __at
+ exe 'syn region sedAddress matchgroup=Special start=@\\'.__sed_delimiter.'\(\\'.__sed_delimiter.'\)\=@ skip=@[^\\]\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'I\=@ contains=sedTab'
+ exe 'syn region sedRegexp'.__sed_i 'matchgroup=Special start=@'.__sed_delimiter.'\(\\\\\|\\'.__sed_delimiter.'\)*@ skip=@[^\\'.__sed_delimiter.']\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'@me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement'.__sed_i
+ exe 'syn region sedReplacement'.__sed_i 'matchgroup=Special start=@'.__sed_delimiter.'\(\\\\\|\\'.__sed_delimiter.'\)*@ skip=@[^\\'.__sed_delimiter.']\(\\\\\)*\\'.__sed_delimiter.'@ end=@'.__sed_delimiter.'@ contains=sedTab,sedReplaceMeta keepend contained nextgroup=sedFlag'
+ endif
+ let __sed_i = __sed_i + 1
+endwhile
+syn region sedAddress matchgroup=Special start=+\\@\(\\@\)\=+ skip=+[^\\]\(\\\\\)*\\@+ end=+@I\=+ contains=sedTab,sedRegexpMeta
+syn region sedRegexp64 matchgroup=Special start=+@\(\\\\\|\\@\)*+ skip=+[^\\@]\(\\\\\)*\\@+ end=+@+me=e-1 contains=sedTab,sedRegexpMeta keepend contained nextgroup=sedReplacement64
+syn region sedReplacement64 matchgroup=Special start=+@\(\\\\\|\\@\)*+ skip=+[^\\@]\(\\\\\)*\\@+ end=+@+ contains=sedTab,sedReplaceMeta keepend contained nextgroup=sedFlag
+
+" Since the syntax for the substituion command is very similar to the
+" syntax for the transform command, I use the same pattern matching
+" for both commands. There is one problem -- the transform command
+" (y) does not allow any flags. To save memory, I ignore this problem.
+syn match sedST "[sy]" nextgroup=sedRegexp\d\+
+
+if version >= 508 || !exists("did_sed_syntax_inits")
+ if version < 508
+ let did_sed_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sedAddress Macro
+ HiLink sedACI NONE
+ HiLink sedBranch Label
+ HiLink sedComment Comment
+ HiLink sedDelete Function
+ HiLink sedError Error
+ HiLink sedFlag Type
+ HiLink sedFlagwrite Constant
+ HiLink sedFunction Function
+ HiLink sedLabel Label
+ HiLink sedLineCont Special
+ HiLink sedPutHoldspc Function
+ HiLink sedReplaceMeta Special
+ HiLink sedRegexpMeta Special
+ HiLink sedRW Constant
+ HiLink sedSemicolon Special
+ HiLink sedST Function
+ HiLink sedSpecial Special
+ HiLink sedWhitespace NONE
+ if exists("highlight_sedtabs")
+ HiLink sedTab Todo
+ endif
+ let __sed_i = 32
+ while __sed_i <= 126
+ exe "HiLink sedRegexp".__sed_i "Macro"
+ exe "HiLink sedReplacement".__sed_i "NONE"
+ let __sed_i = __sed_i + 1
+ endwhile
+
+ delcommand HiLink
+endif
+
+unlet __sed_i __sed_delimiter __sed_metacharacters
+
+let b:current_syntax = "sed"
+
+" vim: sts=4 sw=4 ts=8
diff --git a/runtime/syntax/sendpr.vim b/runtime/syntax/sendpr.vim
new file mode 100644
index 000000000..28a26e684
--- /dev/null
+++ b/runtime/syntax/sendpr.vim
@@ -0,0 +1,32 @@
+" Vim syntax file
+" Language: FreeBSD send-pr file
+" Maintainer: Hendrik Scholz <hendrik@scholz.net>
+" Last Change: 2002 Mar 21
+"
+" http://raisdorf.net/files/misc/send-pr.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match sendprComment /^SEND-PR:/
+" email address
+syn match sendprType /<[a-zA-Z0-9\-\_\.]*@[a-zA-Z0-9\-\_\.]*>/
+" ^> lines
+syn match sendprString /^>[a-zA-Z\-]*:/
+syn region sendprLabel start="\[" end="\]"
+syn match sendprString /^To:/
+syn match sendprString /^From:/
+syn match sendprString /^Reply-To:/
+syn match sendprString /^Cc:/
+syn match sendprString /^X-send-pr-version:/
+syn match sendprString /^X-GNATS-Notify:/
+
+hi def link sendprComment Comment
+hi def link sendprType Type
+hi def link sendprString String
+hi def link sendprLabel Label
diff --git a/runtime/syntax/sgml.vim b/runtime/syntax/sgml.vim
new file mode 100644
index 000000000..bcc46c342
--- /dev/null
+++ b/runtime/syntax/sgml.vim
@@ -0,0 +1,337 @@
+" Vim syntax file
+" Language: SGML
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 15:05:21 CEST
+" Filenames: *.sgml,*.sgm
+" $Id$
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+let s:sgml_cpo_save = &cpo
+set cpo&vim
+
+syn case match
+
+" mark illegal characters
+syn match sgmlError "[<&]"
+
+
+" unicode numbers:
+" provide different highlithing for unicode characters
+" inside strings and in plain text (character data).
+"
+" EXAMPLE:
+"
+" \u4e88
+"
+syn match sgmlUnicodeNumberAttr +\\u\x\{4}+ contained contains=sgmlUnicodeSpecifierAttr
+syn match sgmlUnicodeSpecifierAttr +\\u+ contained
+syn match sgmlUnicodeNumberData +\\u\x\{4}+ contained contains=sgmlUnicodeSpecifierData
+syn match sgmlUnicodeSpecifierData +\\u+ contained
+
+
+" strings inside character data or comments
+"
+syn region sgmlString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=sgmlEntity,sgmlUnicodeNumberAttr display
+syn region sgmlString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=sgmlEntity,sgmlUnicodeNumberAttr display
+
+" punctuation (within attributes) e.g. <tag sgml:foo.attribute ...>
+" ^ ^
+syn match sgmlAttribPunct +[:.]+ contained display
+
+
+" no highlighting for sgmlEqual (sgmlEqual has no highlighting group)
+syn match sgmlEqual +=+
+
+
+" attribute, everything before the '='
+"
+" PROVIDES: @sgmlAttribHook
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^^^^^^^^^^^
+"
+syn match sgmlAttrib
+ \ +[^-'"<]\@<=\<[a-zA-Z0-9.:]\+\>\([^'">]\@=\|$\)+
+ \ contained
+ \ contains=sgmlAttribPunct,@sgmlAttribHook
+ \ display
+
+
+" UNQUOTED value (not including the '=' -- sgmlEqual)
+"
+" PROVIDES: @sgmlValueHook
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = value>
+" ^^^^^
+"
+syn match sgmlValue
+ \ +[^"' =/!?<>][^ =/!?<>]*+
+ \ contained
+ \ contains=sgmlEntity,sgmlUnicodeNumberAttr,@sgmlValueHook
+ \ display
+
+
+" QUOTED value (not including the '=' -- sgmlEqual)
+"
+" PROVIDES: @sgmlValueHook
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^^^^^
+" <tag foo.attribute = 'value'>
+" ^^^^^^^
+"
+syn region sgmlValue contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+ \ contains=sgmlEntity,sgmlUnicodeNumberAttr,@sgmlValueHook
+syn region sgmlValue contained start=+'+ skip=+\\\\\|\\'+ end=+'+
+ \ contains=sgmlEntity,sgmlUnicodeNumberAttr,@sgmlValueHook
+
+
+" value, everything after (and including) the '='
+" no highlighting!
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^^^^^^^
+" <tag foo.attribute = value>
+" ^^^^^^^
+"
+syn match sgmlEqualValue
+ \ +=\s*[^ =/!?<>]\++
+ \ contained
+ \ contains=sgmlEqual,sgmlString,sgmlValue
+ \ display
+
+
+" start tag
+" use matchgroup=sgmlTag to skip over the leading '<'
+" see also sgmlEmptyTag below.
+"
+" PROVIDES: @sgmlTagHook
+"
+syn region sgmlTag
+ \ matchgroup=sgmlTag start=+<[^ /!?"']\@=+
+ \ matchgroup=sgmlTag end=+>+
+ \ contained
+ \ contains=sgmlError,sgmlAttrib,sgmlEqualValue,@sgmlTagHook
+
+
+" tag content for empty tags. This is the same as sgmlTag
+" above, except the `matchgroup=sgmlEndTag for highlighting
+" the end '/>' differently.
+"
+" PROVIDES: @sgmlTagHook
+"
+syn region sgmlEmptyTag
+ \ matchgroup=sgmlTag start=+<[^ /!?"']\@=+
+ \ matchgroup=sgmlEndTag end=+/>+
+ \ contained
+ \ contains=sgmlError,sgmlAttrib,sgmlEqualValue,@sgmlTagHook
+
+
+" end tag
+" highlight everything but not the trailing '>' which
+" was already highlighted by the containing sgmlRegion.
+"
+" PROVIDES: @sgmlTagHook
+" (should we provide a separate @sgmlEndTagHook ?)
+"
+syn match sgmlEndTag
+ \ +</[^ /!?>"']\+>+
+ \ contained
+ \ contains=@sgmlTagHook
+
+
+" [-- SGML SPECIFIC --]
+
+" SGML specific
+" tag content for abbreviated regions
+"
+" PROVIDES: @sgmlTagHook
+"
+syn region sgmlAbbrTag
+ \ matchgroup=sgmlTag start=+<[^ /!?"']\@=+
+ \ matchgroup=sgmlTag end=+/+
+ \ contained
+ \ contains=sgmlError,sgmlAttrib,sgmlEqualValue,@sgmlTagHook
+
+
+" SGML specific
+" just highlight the trailing '/'
+syn match sgmlAbbrEndTag +/+
+
+
+" SGML specific
+" abbreviated regions
+"
+" No highlighing, highlighing is done by contained elements.
+"
+" PROVIDES: @sgmlRegionHook
+"
+" EXAMPLE:
+"
+" <bold/Im Anfang war das Wort/
+"
+syn match sgmlAbbrRegion
+ \ +<[^/!?>"']\+/\_[^/]\+/+
+ \ contains=sgmlAbbrTag,sgmlAbbrEndTag,sgmlCdata,sgmlComment,sgmlEntity,sgmlUnicodeNumberData,@sgmlRegionHook
+
+" [-- END OF SGML SPECIFIC --]
+
+
+" real (non-empty) elements. We cannot do syntax folding
+" as in xml, because end tags may be optional in sgml depending
+" on the dtd.
+" No highlighing, highlighing is done by contained elements.
+"
+" PROVIDES: @sgmlRegionHook
+"
+" EXAMPLE:
+"
+" <tag id="whoops">
+" <!-- comment -->
+" <another.tag></another.tag>
+" <another.tag/>
+" some data
+" </tag>
+"
+" SGML specific:
+" compared to xmlRegion:
+" - removed folding
+" - added a single '/'in the start pattern
+"
+syn region sgmlRegion
+ \ start=+<\z([^ /!?>"']\+\)\(\(\_[^/>]*[^/!?]>\)\|>\)+
+ \ end=+</\z1>+
+ \ contains=sgmlTag,sgmlEndTag,sgmlCdata,@sgmlRegionCluster,sgmlComment,sgmlEntity,sgmlUnicodeNumberData,@sgmlRegionHook
+ \ keepend
+ \ extend
+
+
+" empty tags. Just a container, no highlighting.
+" Compare this with sgmlTag.
+"
+" EXAMPLE:
+"
+" <tag id="lola"/>
+"
+" TODO use sgmlEmptyTag intead of sgmlTag
+syn match sgmlEmptyRegion
+ \ +<[^ /!?>"']\(\_[^"'<>]\|"\_[^"]*"\|'\_[^']*'\)*/>+
+ \ contains=sgmlEmptyTag
+
+
+" cluster which contains the above two elements
+syn cluster sgmlRegionCluster contains=sgmlRegion,sgmlEmptyRegion,sgmlAbbrRegion
+
+
+" &entities; compare with dtd
+syn match sgmlEntity "&[^; \t]*;" contains=sgmlEntityPunct
+syn match sgmlEntityPunct contained "[&.;]"
+
+
+" The real comments (this implements the comments as defined by sgml,
+" but not all sgml pages actually conform to it. Errors are flagged.
+syn region sgmlComment start=+<!+ end=+>+ contains=sgmlCommentPart,sgmlString,sgmlCommentError,sgmlTodo
+syn keyword sgmlTodo contained TODO FIXME XXX display
+syn match sgmlCommentError contained "[^><!]"
+syn region sgmlCommentPart contained start=+--+ end=+--+
+
+
+" CData sections
+"
+" PROVIDES: @sgmlCdataHook
+"
+syn region sgmlCdata
+ \ start=+<!\[CDATA\[+
+ \ end=+]]>+
+ \ contains=sgmlCdataStart,sgmlCdataEnd,@sgmlCdataHook
+ \ keepend
+ \ extend
+" using the following line instead leads to corrupt folding at CDATA regions
+" syn match sgmlCdata +<!\[CDATA\[\_.\{-}]]>+ contains=sgmlCdataStart,sgmlCdataEnd,@sgmlCdataHook
+syn match sgmlCdataStart +<!\[CDATA\[+ contained contains=sgmlCdataCdata
+syn keyword sgmlCdataCdata CDATA contained
+syn match sgmlCdataEnd +]]>+ contained
+
+
+" Processing instructions
+" This allows "?>" inside strings -- good idea?
+syn region sgmlProcessing matchgroup=sgmlProcessingDelim start="<?" end="?>" contains=sgmlAttrib,sgmlEqualValue
+
+
+" DTD -- we use dtd.vim here
+syn region sgmlDocType matchgroup=sgmlDocTypeDecl start="\c<!DOCTYPE"he=s+2,rs=s+2 end=">" contains=sgmlDocTypeKeyword,sgmlInlineDTD,sgmlString
+syn keyword sgmlDocTypeKeyword contained DOCTYPE PUBLIC SYSTEM
+syn region sgmlInlineDTD contained start="\[" end="]" contains=@sgmlDTD
+syn include @sgmlDTD <sfile>:p:h/dtd.vim
+
+
+" synchronizing
+" TODO !!! to be improved !!!
+
+syn sync match sgmlSyncDT grouphere sgmlDocType +\_.\(<!DOCTYPE\)\@=+
+" syn sync match sgmlSyncDT groupthere NONE +]>+
+
+syn sync match sgmlSync grouphere sgmlRegion +\_.\(<[^ /!?>"']\+\)\@=+
+" syn sync match sgmlSync grouphere sgmlRegion "<[^ /!?>"']*>"
+syn sync match sgmlSync groupthere sgmlRegion +</[^ /!?>"']\+>+
+
+syn sync minlines=100
+
+
+" The default highlighting.
+hi def link sgmlTodo Todo
+hi def link sgmlTag Function
+hi def link sgmlEndTag Identifier
+" SGML specifig
+hi def link sgmlAbbrEndTag Identifier
+hi def link sgmlEmptyTag Function
+hi def link sgmlEntity Statement
+hi def link sgmlEntityPunct Type
+
+hi def link sgmlAttribPunct Comment
+hi def link sgmlAttrib Type
+
+hi def link sgmlValue String
+hi def link sgmlString String
+hi def link sgmlComment Comment
+hi def link sgmlCommentPart Comment
+hi def link sgmlCommentError Error
+hi def link sgmlError Error
+
+hi def link sgmlProcessingDelim Comment
+hi def link sgmlProcessing Type
+
+hi def link sgmlCdata String
+hi def link sgmlCdataCdata Statement
+hi def link sgmlCdataStart Type
+hi def link sgmlCdataEnd Type
+
+hi def link sgmlDocTypeDecl Function
+hi def link sgmlDocTypeKeyword Statement
+hi def link sgmlInlineDTD Function
+hi def link sgmlUnicodeNumberAttr Number
+hi def link sgmlUnicodeSpecifierAttr SpecialChar
+hi def link sgmlUnicodeNumberData Number
+hi def link sgmlUnicodeSpecifierData SpecialChar
+
+let b:current_syntax = "sgml"
+
+let &cpo = s:sgml_cpo_save
+unlet s:sgml_cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/sgmldecl.vim b/runtime/syntax/sgmldecl.vim
new file mode 100644
index 000000000..6a69fc5d2
--- /dev/null
+++ b/runtime/syntax/sgmldecl.vim
@@ -0,0 +1,79 @@
+" Vim syntax file
+" Language: SGML (SGML Declaration <!SGML ...>)
+" Last Change: jueves, 28 de diciembre de 2000, 13:51:44 CLST
+" Maintainer: "Daniel A. Molina W." <sickd@linux-chile.org>
+" You can modify and maintain this file, in other case send comments
+" the maintainer email address.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn region sgmldeclDeclBlock transparent start=+<!SGML+ end=+>+
+syn region sgmldeclTagBlock transparent start=+<+ end=+>+
+ \ contains=ALLBUT,
+ \ @sgmlTagError,@sgmlErrInTag
+syn region sgmldeclComment contained start=+--+ end=+--+
+
+syn keyword sgmldeclDeclKeys SGML CHARSET CAPACITY SCOPE SYNTAX
+ \ FEATURES
+
+syn keyword sgmldeclTypes BASESET DESCSET DOCUMENT NAMING DELIM
+ \ NAMES QUANTITY SHUNCHAR DOCTYPE
+ \ ELEMENT ENTITY ATTLIST NOTATION
+ \ TYPE
+
+syn keyword sgmldeclStatem CONTROLS FUNCTION NAMECASE MINIMIZE
+ \ LINK OTHER APPINFO REF ENTITIES
+
+syn keyword sgmldeclVariables TOTALCAP GRPCAP ENTCAP DATATAG OMITTAG RANK
+ \ SIMPLE IMPLICIT EXPLICIT CONCUR SUBDOC FORMAL ATTCAP
+ \ ATTCHCAP AVGRPCAP ELEMCAP ENTCHCAP IDCAP IDREFCAP
+ \ SHORTTAG
+
+syn match sgmldeclNConst contained +[0-9]\++
+
+syn region sgmldeclString contained start=+"+ end=+"+
+
+syn keyword sgmldeclBool YES NO
+
+syn keyword sgmldeclSpecial SHORTREF SGMLREF UNUSED NONE GENERAL
+ \ SEEALSO ANY
+
+syn sync lines=250
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sgmldecl_syntax_init")
+ if version < 508
+ let did_sgmldecl_syntax_init = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sgmldeclDeclKeys Keyword
+ HiLink sgmldeclTypes Type
+ HiLink sgmldeclConst Constant
+ HiLink sgmldeclNConst Constant
+ HiLink sgmldeclString String
+ HiLink sgmldeclDeclBlock Normal
+ HiLink sgmldeclBool Boolean
+ HiLink sgmldeclSpecial Special
+ HiLink sgmldeclComment Comment
+ HiLink sgmldeclStatem Statement
+ HiLink sgmldeclVariables Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sgmldecl"
+" vim:set tw=78 ts=4:
diff --git a/runtime/syntax/sgmllnx.vim b/runtime/syntax/sgmllnx.vim
new file mode 100644
index 000000000..419e904ee
--- /dev/null
+++ b/runtime/syntax/sgmllnx.vim
@@ -0,0 +1,68 @@
+" Vim syntax file
+" Language: SGML-linuxdoc (supported by old sgmltools-1.x)
+" (for more information, visit www.sgmltools.org)
+" Maintainer: Nam SungHyun <namsh@kldp.org>
+" Last Change: 2001 Apr 26
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" tags
+syn region sgmllnxEndTag start=+</+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
+syn region sgmllnxTag start=+<[^/]+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
+syn match sgmllnxTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=sgmllnxTagName
+syn match sgmllnxTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=sgmllnxTagName
+
+syn region sgmllnxTag2 start=+<\s*[a-zA-Z]\+/+ keepend end=+/+ contains=sgmllnxTagN2
+syn match sgmllnxTagN2 contained +/.*/+ms=s+1,me=e-1
+
+syn region sgmllnxSpecial oneline start="&" end=";"
+
+" tag names
+syn keyword sgmllnxTagName contained article author date toc title sect verb
+syn keyword sgmllnxTagName contained abstract tscreen p itemize item enum
+syn keyword sgmllnxTagName contained descrip quote htmlurl code ref
+syn keyword sgmllnxTagName contained tt tag bf
+syn match sgmllnxTagName contained "sect\d\+"
+
+" Comments
+syn region sgmllnxComment start=+<!--+ end=+-->+
+syn region sgmllnxDocType start=+<!doctype+ end=+>+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sgmllnx_syn_inits")
+ if version < 508
+ let did_sgmllnx_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sgmllnxTag2 Function
+ HiLink sgmllnxTagN2 Function
+ HiLink sgmllnxTag Special
+ HiLink sgmllnxEndTag Special
+ HiLink sgmllnxParen Special
+ HiLink sgmllnxEntity Type
+ HiLink sgmllnxDocEnt Type
+ HiLink sgmllnxTagName Statement
+ HiLink sgmllnxComment Comment
+ HiLink sgmllnxSpecial Special
+ HiLink sgmllnxDocType PreProc
+ HiLink sgmllnxTagError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sgmllnx"
+
+" vim:set tw=78 ts=8 sts=2 sw=2 noet:
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
new file mode 100644
index 000000000..c8f6ee0ac
--- /dev/null
+++ b/runtime/syntax/sh.vim
@@ -0,0 +1,538 @@
+" Vim syntax file
+" Language: shell (sh) Korn shell (ksh) bash (sh)
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
+" Last Change: Apr 28, 2004
+" Version: 68
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Using the following VIM variables:
+" b:is_kornshell if defined, enhance with kornshell syntax
+" b:is_bash if defined, enhance with bash syntax
+" is_kornshell if neither b:is_kornshell or b:is_bash is
+" defined, then if is_kornshell is set
+" b:is_kornshell is default
+" is_bash if none of the previous three variables are
+" defined, then if is_bash is set b:is_bash is default
+" g:sh_fold_enabled if non-zero, syntax folding is enabled
+" sh_minlines sets up syn sync minlines (default: 200)
+" sh_maxlines sets up syn sync maxlines (default: twice sh_minlines)
+"
+" This file includes many ideas from Éric Brunet (eric.brunet@ens.fr)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" b:is_sh is set when "#! /bin/sh" is found;
+" However, it often is just a masquerade by bash (typically Linux)
+" or kornshell (typically workstations with Posix "sh").
+" So, when the user sets "is_bash" or "is_kornshell",
+" a b:is_sh is converted into b:is_bash/b:is_kornshell,
+" respectively.
+if !exists("b:is_kornshell") && !exists("b:is_bash")
+ if exists("is_kornshell")
+ let b:is_kornshell= 1
+ if exists("b:is_sh")
+ unlet b:is_sh
+ endif
+ elseif exists("is_bash")
+ let b:is_bash= 1
+ if exists("b:is_sh")
+ unlet b:is_sh
+ endif
+ else
+ let b:is_sh= 1
+ endif
+endif
+
+if !exists("g:sh_fold_enabled")
+ let g:sh_fold_enabled= 0
+endif
+
+" sh syntax is case sensitive
+syn case match
+
+" Clusters: contains=@... clusters
+"==================================
+syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseSingleQuote,shCaseDoubleQuote,shSpecial
+syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,bkshFunction,shSpecial
+syn cluster shColonList contains=@shCaseList
+syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shNumber,shOperator,shPosnParm,shSpecial,shSingleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias
+syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shSpecial,shPosnParm
+syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError
+syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError
+syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shExpr,shSingleQuote,shDoubleQuote,shSpecial
+syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shSingleQuote,shDoubleQuote,shSpecial,shExpr,shDblBrace,shDeref,shDerefSimple
+syn cluster shExprList2 contains=@shExprList1,@shCaseList
+syn cluster shFunctionList contains=@shCaseList,shOperator
+syn cluster shHereBeginList contains=@shCommandSubList
+syn cluster shHereList contains=shBeginHere,shHerePayload
+syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload
+syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shIdWhiteSpace,shDeref,shDerefSimple,shSpecial,shRedir,shSingleQuote,shDoubleQuote,shExpr
+syn cluster shLoopList contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac
+syn cluster shSubShList contains=@shCaseList
+syn cluster shTestList contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shDoubleQuote,shExpr,shExpr,shNumber,shOperator,shSingleQuote,shSpecial,shTestOpr
+
+
+" Echo:
+" ====
+" This one is needed INSIDE a CommandSub, so that `echo bla` be correct
+syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList
+syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|()]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList
+
+" This must be after the strings, so that bla \" be correct
+syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shOperator end="$" matchgroup=NONE end="[<>;&|`)]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=shNumber,shSingleQuote,shDeref,shDerefSimple,shSpecialVar,shSpecial,shOperator,shDoubleQuote,shCharClass
+
+" Alias:
+" =====
+if exists("b:is_kornshell") || exists("b:is_bash")
+ syn match shStatement "\<alias\>"
+ syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+\)\@=" skip="\\$" end="\>\|`"
+ syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\w\+=\)\@=" skip="\\$" end="="
+endif
+
+" Error Codes
+" ===========
+syn match shDoError "\<done\>"
+syn match shIfError "\<fi\>"
+syn match shInError "\<in\>"
+syn match shCaseError ";;"
+syn match shEsacError "\<esac\>"
+syn match shCurlyError "}"
+syn match shParenError ")"
+if exists("b:is_kornshell")
+ syn match shDTestError "]]"
+endif
+syn match shTestError "]"
+
+" Options interceptor
+" ===================
+syn match shOption "\s[\-+][a-zA-Z0-9]\+\>"ms=s+1
+syn match shOption "\s--\S\+"ms=s+1
+
+" Operators:
+" =========
+syn match shOperator "[!&;|]"
+syn match shOperator "\[[[^:]\|\]]"
+syn match shOperator "!\==" skipwhite nextgroup=shPattern
+syn match shPattern "\<\S\+\())\)\@=" contained contains=shSingleQuote,shDoubleQuote,shDeref
+
+" Subshells:
+" =========
+syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2
+syn region shSubSh transparent matchgroup=shSubShRegion start="(" end=")" contains=@shSubShList
+
+" Tests
+"======
+"syn region shExpr transparent matchgroup=shRange start="\[" skip=+\\\\\|\\$+ end="\]" contains=@shTestList
+syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$+ end="\]" contains=@shTestList
+syn region shExpr transparent matchgroup=shStatement start="\<test\>" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1
+syn match shTestOpr contained "<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!=<>]"
+if exists("b:is_kornshell") || exists("b:is_bash")
+ syn region shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+ end="\]\]" contains=@shTestList
+ syn region shDblParen matchgroup=Delimiter start="((" skip=+\\\\\|\\$+ end="))" contains=@shTestList
+endif
+
+" Character Class in Range
+" ========================
+syn match shCharClass contained "\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]"
+
+" Loops: do, if, while, until
+" =====
+syn region shDo transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
+syn region shIf transparent matchgroup=shConditional start="\<if\>" matchgroup=shConditional end="\<;\_s*then\>" end="\<fi\>" contains=@shLoopList,shDblBrace,shDblParen
+syn region shFor matchgroup=shLoop start="\<for\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen
+if exists("b:is_kornshell") || exists("b:is_bash")
+ syn cluster shCaseList add=shRepeat
+ syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
+ syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<in\>" end="\<do\>"me=e-2 contains=@shLoopList,shDblParen,shDblBrace
+ syn region shCaseEsac matchgroup=shConditional start="\<select\>" matchgroup=shConditional end="\<in\>" end="\<do\>" contains=@shLoopList
+else
+ syn region shRepeat matchgroup=shLoop start="\<while\>" end="\<do\>"me=e-2 contains=@shLoopList
+ syn region shRepeat matchgroup=shLoop start="\<until\>" end="\<do\>"me=e-2 contains=@shLoopList
+endif
+
+" Case: case...esac
+" ====
+syn match shCaseBar contained skipwhite "[^|"`'()]\{-}|"hs=e nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseSingleQuote,shCaseDoubleQuote
+syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBar
+syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="[^$()]\{-})"ms=s,hs=e end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,,shComment
+syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
+syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseSingleQuote,shCaseDoubleQuote
+syn region shCaseSingleQuote matchgroup=shOperator start=+'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
+syn region shCaseDoubleQuote matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+ contains=@shDblQuoteList,shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
+syn region shCaseCommandSub start=+`+ skip=+\\\\\|\\.+ end=+`+ contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar contained
+
+" Misc
+"=====
+syn match shWrapLineOperator "\\$"
+syn region shCommandSub start="`" skip="\\\\\|\\." end="`" contains=@shCommandSubList
+
+" $(..) is not supported by sh (Bourne shell). However, apparently
+" some systems (HP?) have as their /bin/sh a (link to) Korn shell
+" (ie. Posix compliant shell). /bin/ksh should work for those
+" systems too, however, so the following syntax will flag $(..) as
+" an Error under /bin/sh. By consensus of vimdev'ers!
+if exists("b:is_kornshell") || exists("b:is_bash")
+ syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
+ syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shCommandSubList
+ syn match shSkipInitWS contained "^\s\+"
+else
+ syn region shCommandSub matchgroup=Error start="$(" end=")" contains=@shCommandSubList
+endif
+
+if exists("b:is_bash")
+ syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
+ syn cluster shCaseList add=bashAdminStatement,bashStatement
+ syn keyword bashSpecialVariables contained BASH BASH_ENV BASH_VERSINFO BASH_VERSION CDPATH DIRSTACK EUID FCEDIT FIGNORE GLOBIGNORE GROUPS HISTCMD HISTCONTROL HISTFILE HISTFILESIZE HISTIGNORE HISTSIZE HOME HOSTFILE HOSTNAME HOSTTYPE IFS IGNOREEOF INPUTRC LANG LC_ALL LC_COLLATE LC_MESSAGES LINENO MACHTYPE MAIL MAILCHECK MAILPATH OLDPWD OPTARG OPTERR OPTIND OSTYPE PATH PIPESTATUS PPID PROMPT_COMMAND PS1 PS2 PS3 PS4 PWD RANDOM REPLY SECONDS SHELLOPTS SHLVL TIMEFORMAT TIMEOUT UID auto_resume histchars
+ syn keyword bashStatement chmod clear complete du egrep expr fgrep find gnufind gnugrep grep install less ls mkdir mv rm rmdir rpm sed sleep sort strip tail touch
+ syn keyword bashAdminStatement daemon killall killproc nice reload restart start status stop
+endif
+
+if exists("b:is_kornshell")
+ syn cluster shCommandSubList add=kshSpecialVariables,kshStatement
+ syn cluster shCaseList add=kshStatement
+ syn keyword kshSpecialVariables contained CDPATH COLUMNS EDITOR ENV ERRNO FCEDIT FPATH HISTFILE HISTSIZE HOME IFS LINENO LINES MAIL MAILCHECK MAILPATH OLDPWD OPTARG OPTIND PATH PPID PS1 PS2 PS3 PS4 PWD RANDOM REPLY SECONDS SHELL TMOUT VISUAL
+ syn keyword kshStatement cat chmod clear cp du egrep expr fgrep find grep install killall less ls mkdir mv nice printenv rm rmdir sed sort strip stty tail touch tput
+endif
+
+syn match shSource "^\.\s"
+syn match shSource "\s\.\s"
+syn region shColon start="^\s*:" end="$\|" end="#"me=e-1 contains=@shColonList
+
+" String and Character constants
+"===============================
+syn match shNumber "-\=\<\d\+\>"
+syn match shSpecial "\\\d\d\d\|\\[abcfnrtv0]" contained
+syn region shSingleQuote matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial
+syn region shDoubleQuote matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
+syn match shStringSpecial "[^[:print:]]" contained
+syn match shSpecial "\\[\\\"\'`$()#]"
+
+" Comments
+"=========
+syn cluster shCommentGroup contains=shTodo,@Spell
+syn keyword shTodo contained TODO
+syn match shComment "#.*$" contains=@shCommentGroup
+
+" File redirection highlighted as operators
+"==========================================
+syn match shRedir "\d\=>\(&[-0-9]\)\="
+syn match shRedir "\d\=>>-\="
+syn match shRedir "\d\=<\(&[-0-9]\)\="
+syn match shRedir "\d<<-\="
+
+" Shell Input Redirection (Here Documents)
+if version < 600
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir end="^\s*END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\**EOF\**" matchgroup=shRedir end="^EOF$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\**EOF\**" matchgroup=shRedir end="^\s*EOF$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\**\.\**" matchgroup=shRedir end="^\.$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\**\.\**" matchgroup=shRedir end="^\s*\.$" contains=@shDblQuoteList
+
+elseif g:sh_fold_enabled
+
+ if v:version > 602 || (v:version == 602 && has("patch219"))
+ syn region shHereDoc fold start="\(<<\s*\\\=\z(\S*\)\)\@=" matchgroup=shRedir end="^\z1$" contains=@shHereListDQ keepend
+ syn region shHereDoc fold start="\(<<\s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<\s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<\s*\\\_$\_s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<\s*\\\_$\_s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<\s*\\\_$\_s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\z1$" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<-\s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<-\s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\s*\z1$"" contains=@shHereListDQ keepend
+ syn region shHereDoc fold start="\(<<-\s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\s*\z1$"" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<-\s*\\\_$\_s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<-\s*\\\_$\_s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc fold start="\(<<-\s*\\\_$\_s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ else
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*\z(\S*\)" matchgroup=shRedir end="^\z1$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir fold start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1$"
+ endif
+else
+ if v:version > 602 || (v:version == 602 && has("patch219"))
+ syn region shHereDoc start="\(<<\s*\\\=\z(\S*\)\)\@=" matchgroup=shRedir end="^\z1$" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<\s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereListDQ keepend
+ syn region shHereDoc start="\(<<\s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<\s*\\\_$\_s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<\s*\\\_$\_s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\z1$"" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<\s*\\\_$\_s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\z1$" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<-\s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<-\s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\s*\z1$"" contains=@shHereListDQ keepend
+ syn region shHereDoc start="\(<<-\s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\s*\z1$"" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<-\s*\\\_$\_s*'\z(\S*\)'\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<-\s*\\\_$\_s*\z(\S*\)\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ syn region shHereDoc start="\(<<-\s*\\\_$\_s*\"\z(\S*\)\"\)\@=" matchgroup=shRedir end="^\s*\z1$" contains=@shHereList keepend
+ else
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\\\=\z(\S*\)" matchgroup=shRedir end="^\z1$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1$" contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<\s*'\z(\S*\)'" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\z(\S*\)" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\s*\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*'\z(\S*\)'" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\z1$"
+ syn region shHereDoc matchgroup=shRedir start="<<-\s*\\\_$\_s*\"\z(\S*\)\"" matchgroup=shRedir end="^\s*\z1$"
+ endif
+ if v:version > 602 || (v:version == 602 && has("patch219"))
+ syn match shHerePayload "^.*$" contained skipnl nextgroup=shHerePayload contains=@shDblQuoteList
+ syn match shBeginLine ".*$" contained skipnl nextgroup=shHerePayload contains=@shCommandSubList
+ syn match shBeginHere "<<-\=\s*\S\+" contained nextgroup=shBeginLine
+ endif
+ if exists("b:is_bash")
+ syn match shRedir "<<<"
+ endif
+endif
+
+" Identifiers
+"============
+syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier
+syn match shIdWhiteSpace contained "\s"
+syn match shSetIdentifier contained "=" nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shSingleQuote
+if exists("b:is_bash")
+ syn region shSetList matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>[^/]"me=e-1 end="$" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="#\|="me=e-1 contains=@shIdList
+ syn region shSetList matchgroup=shSet start="\<set\>[^/]"me=e-1 end="$" end="[|)]"me=e-1 matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
+ syn match shSet "\<\(declare\|typeset\|local\|export\|set\|unset\)$"
+elseif exists("b:is_kornshell")
+ syn region shSetList matchgroup=shSet start="\<\(typeset\|export\|unset\)\>[^/]"me=e-1 end="$" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
+ syn region shSetList matchgroup=shSet start="\<set\>[^/]"me=e-1 end="$" matchgroup=shOperator end="[;&]"me=e-1 matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
+ syn match shSet "\<\(typeset\|set\|export\|unset\)$"
+else
+ syn region shSetList matchgroup=shSet start="\<\(set\|export\|unset\)\>[^/]"me=e-1 end="$" end="[)|]"me=e-1 matchgroup=shOperator end="[;&]" matchgroup=NONE end="[#=]"me=e-1 contains=@shIdList
+ syn match shStatement "\<\(set\|export\|unset\)$"
+endif
+
+" handles functions which start: Function () {
+" Apparently Bourne shell accepts functions too,
+" even though it isn't documented by my man pages
+" for it.
+syn cluster shCommandSubList add=bkshFunction
+if g:sh_fold_enabled
+ syn region bkshFunctionBody transparent fold matchgroup=Delimiter start="^\s*\<\h\w*\>\s*()\s*{" end="}" contains=bkshFunction,bkshFunctionDelim,@shFunctionList
+else
+ syn region bkshFunctionBody transparent matchgroup=Delimiter start="^\s*\<\h\w*\>\s*()\s*{" end="}" contains=bkshFunction,bkshFunctionDelim,@shFunctionList
+endif
+syn match bkshFunction "^\s*\<\h\w*\>\s*()" skipwhite skipnl contains=bkshFunctionParen
+syn match bkshFunctionParen "[()]" contained
+syn match bkshFunctionDelim "[{}]" contained
+
+" Parameter Dereferencing
+" =======================
+syn match shDerefSimple "\$\w\+"
+syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray
+syn match shDerefWordError "[^}$[]" contained
+syn match shDerefSimple "\$[-#*@!?]"
+syn match shDerefSimple "\$\$"
+if exists("b:is_bash") || exists("b:is_kornshell")
+ syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList
+endif
+
+" bash : ${!prefix*}
+" bash : ${#parameter}
+if exists("b:is_bash")
+ syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp
+ syn match shDerefVar contained "{\@<=!\w\+" nextgroup=@shDerefVarList
+endif
+
+syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError
+syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp
+syn match shDerefVar contained "{\@<=\w\+" nextgroup=@shDerefVarList
+
+" sh ksh bash : ${var[... ]...} array reference
+syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
+
+" sh ksh bash : ${parameter:-word} word is default value
+" sh ksh bash : ${parameter:=word} assign word as default value
+" sh ksh bash : ${parameter:?word} display word if parameter is null
+" sh ksh bash : ${parameter:+word} use word if parameter is not null, otherwise nothing
+" ksh bash : ${parameter#pattern} remove small left pattern
+" ksh bash : ${parameter##pattern} remove large left pattern
+" ksh bash : ${parameter%pattern} remove small right pattern
+" ksh bash : ${parameter%%pattern} remove large right pattern
+syn cluster shDerefPatternList contains=shDerefPattern,shDerefString
+syn match shDerefOpError contained ":[[:punct:]]"
+syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList
+syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList
+if exists("b:is_bash") || exists("b:is_kornshell")
+ syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList
+ syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList
+ syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub nextgroup=shDerefPattern
+ syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern
+endif
+syn region shDerefString contained matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial
+syn region shDerefString contained matchgroup=shOperator start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial
+syn match shDerefString contained "\\["']"
+
+" bash : ${parameter:offset}
+" bash : ${parameter:offset:length}
+" bash : ${parameter//pattern/string}
+" bash : ${parameter//pattern}
+if exists("b:is_bash")
+ syn region shDerefOp contained start=":[$[:alnum:]_]"me=e-1 end=":"me=e-1 end="}"me=e-1 contains=@shCommandSubList nextgroup=shDerefPOL
+ syn match shDerefPOL contained ":[^}]\{1,}" contains=@shCommandSubList
+ syn match shDerefOp contained "/\{1,2}" nextgroup=shDerefPat
+ syn match shDerefPat contained "[^/}]\{1,}" nextgroup=shDerefPatStringOp
+ syn match shDerefPatStringOp contained "/" nextgroup=shDerefPatString
+ syn match shDerefPatString contained "[^}]\{1,}"
+endif
+
+" A bunch of useful sh keywords
+syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly return shift test trap ulimit umask wait
+syn keyword shConditional contained elif else then
+syn keyword shCondError elif else then
+
+if exists("b:is_kornshell") || exists("b:is_bash")
+ syn keyword shFunction function
+ syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup print printf r stop suspend time times true type unalias whence
+
+ if exists("b:is_bash")
+ syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source
+ else
+ syn keyword shStatement login newgrp
+ endif
+endif
+
+" Syncs
+" =====
+if !exists("sh_minlines")
+ let sh_minlines = 200
+endif
+if !exists("sh_maxlines")
+ let sh_maxlines = 2 * sh_minlines
+endif
+exec "syn sync minlines=" . sh_minlines . " maxlines=" . sh_maxlines
+syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>"
+syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>"
+syn sync match shDoSync grouphere shDo "\<do\>"
+syn sync match shDoSync groupthere shDo "\<done\>"
+syn sync match shForSync grouphere shFor "\<for\>"
+syn sync match shForSync groupthere shFor "\<in\>"
+syn sync match shIfSync grouphere shIf "\<if\>"
+syn sync match shIfSync groupthere shIf "\<fi\>"
+syn sync match shUntilSync grouphere shRepeat "\<until\>"
+syn sync match shWhileSync grouphere shRepeat "\<while\>"
+
+" The default highlighting.
+hi def link shArithRegion shShellVariables
+hi def link shCaseBar shConditional
+hi def link shCaseIn shConditional
+hi def link shCaseCommandSub shCommandSub
+hi def link shCaseDoubleQuote shDoubleQuote
+hi def link shCaseSingleQuote shSingleQuote
+hi def link shCaseStart shConditional
+hi def link shCmdSubRegion shShellVariables
+hi def link shColon shStatement
+
+hi def link shDeref shShellVariables
+hi def link shDerefOp shOperator
+
+hi def link shDerefVar shDeref
+hi def link shDerefPOL shDerefOp
+hi def link shDerefPatString shDerefPattern
+hi def link shDerefPatStringOp shDerefOp
+hi def link shDerefSimple shDeref
+hi def link shDerefSpecial shDeref
+hi def link shDerefString shDoubleQuote
+hi def link shHerePayload shHereDoc
+hi def link shBeginHere shRedir
+
+hi def link shDoubleQuote shString
+hi def link shEcho shString
+hi def link shEmbeddedEcho shString
+hi def link shHereDoc shString
+hi def link shLoop shStatement
+hi def link shOption shCommandSub
+hi def link shPattern shString
+hi def link shPosnParm shShellVariables
+hi def link shRange shOperator
+hi def link shRedir shOperator
+hi def link shSingleQuote shString
+hi def link shSource shOperator
+hi def link shStringSpecial shSpecial
+hi def link shSubShRegion shOperator
+hi def link shTestOpr shConditional
+hi def link shVariable shSetList
+hi def link shWrapLineOperator shOperator
+
+if exists("b:is_bash")
+ hi def link bashAdminStatement shStatement
+ hi def link bashSpecialVariables shShellVariables
+ hi def link bashStatement shStatement
+ hi def link bkshFunction Function
+ hi def link bkshFunctionParen Delimiter
+ hi def link bkshFunctionDelim Delimiter
+endif
+if exists("b:is_kornshell")
+ hi def link kshSpecialVariables shShellVariables
+ hi def link kshStatement shStatement
+ hi def link bkshFunction Function
+ hi def link bkshFunctionParen Delimiter
+endif
+
+hi def link shCaseError Error
+hi def link shCondError Error
+hi def link shCurlyError Error
+hi def link shDerefError Error
+hi def link shDerefOpError Error
+hi def link shDerefWordError Error
+hi def link shDoError Error
+hi def link shEsacError Error
+hi def link shIfError Error
+hi def link shInError Error
+hi def link shParenError Error
+hi def link shTestError Error
+if exists("b:is_kornshell")
+ hi def link shDTestError Error
+endif
+
+hi def link shArithmetic Special
+hi def link shCharClass Identifier
+hi def link shSnglCase Statement
+hi def link shCommandSub Special
+hi def link shComment Comment
+hi def link shConditional Conditional
+hi def link shExprRegion Delimiter
+hi def link shFunction Function
+hi def link shFunctionName Function
+hi def link shNumber Number
+hi def link shOperator Operator
+hi def link shRepeat Repeat
+hi def link shSet Statement
+hi def link shSetList Identifier
+hi def link shShellVariables PreProc
+hi def link shSpecial Special
+hi def link shStatement Statement
+hi def link shString String
+hi def link shTodo Todo
+hi def link shAlias Identifier
+
+" Current Syntax
+" ==============
+if exists("b:is_bash")
+ let b:current_syntax = "bash"
+elseif exists("b:is_kornshell")
+ let b:current_syntax = "ksh"
+else
+ let b:current_syntax = "sh"
+endif
+
+" vim: ts=16
diff --git a/runtime/syntax/sicad.vim b/runtime/syntax/sicad.vim
new file mode 100644
index 000000000..7e32451be
--- /dev/null
+++ b/runtime/syntax/sicad.vim
@@ -0,0 +1,413 @@
+" Vim syntax file
+" Language: SiCAD (procedure language)
+" Maintainer: Zsolt Branyiczky <zbranyiczky@lmark.mgx.hu>
+" Last Change: 2003 May 11
+" URL: http://lmark.mgx.hu:81/download/vim/sicad.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" use SQL highlighting after 'sql' command
+if version >= 600
+ syn include @SQL syntax/sql.vim
+else
+ syn include @SQL <sfile>:p:h/sql.vim
+endif
+unlet b:current_syntax
+
+" spaces are used in (auto)indents since sicad hates tabulator characters
+if version >= 600
+ setlocal expandtab
+else
+ set expandtab
+endif
+
+" ignore case
+syn case ignore
+
+" most important commands - not listed by ausku
+syn keyword sicadStatement define
+syn keyword sicadStatement dialog
+syn keyword sicadStatement do
+syn keyword sicadStatement dop contained
+syn keyword sicadStatement end
+syn keyword sicadStatement enddo
+syn keyword sicadStatement endp
+syn keyword sicadStatement erroff
+syn keyword sicadStatement erron
+syn keyword sicadStatement exitp
+syn keyword sicadGoto goto contained
+syn keyword sicadStatement hh
+syn keyword sicadStatement if
+syn keyword sicadStatement in
+syn keyword sicadStatement msgsup
+syn keyword sicadStatement out
+syn keyword sicadStatement padd
+syn keyword sicadStatement parbeg
+syn keyword sicadStatement parend
+syn keyword sicadStatement pdoc
+syn keyword sicadStatement pprot
+syn keyword sicadStatement procd
+syn keyword sicadStatement procn
+syn keyword sicadStatement psav
+syn keyword sicadStatement psel
+syn keyword sicadStatement psymb
+syn keyword sicadStatement ptrace
+syn keyword sicadStatement ptstat
+syn keyword sicadStatement set
+syn keyword sicadStatement sql contained
+syn keyword sicadStatement step
+syn keyword sicadStatement sys
+syn keyword sicadStatement ww
+
+" functions
+syn match sicadStatement "\<atan("me=e-1
+syn match sicadStatement "\<atan2("me=e-1
+syn match sicadStatement "\<cos("me=e-1
+syn match sicadStatement "\<dist("me=e-1
+syn match sicadStatement "\<exp("me=e-1
+syn match sicadStatement "\<log("me=e-1
+syn match sicadStatement "\<log10("me=e-1
+syn match sicadStatement "\<sin("me=e-1
+syn match sicadStatement "\<sqrt("me=e-1
+syn match sicadStatement "\<tanh("me=e-1
+syn match sicadStatement "\<x("me=e-1
+syn match sicadStatement "\<y("me=e-1
+syn match sicadStatement "\<v("me=e-1
+syn match sicadStatement "\<x%g\=p[0-9]\{1,2}\>"me=s+1
+syn match sicadStatement "\<y%g\=p[0-9]\{1,2}\>"me=s+1
+
+" logical operators
+syn match sicadOperator "\.and\."
+syn match sicadOperator "\.ne\."
+syn match sicadOperator "\.not\."
+syn match sicadOperator "\.eq\."
+syn match sicadOperator "\.ge\."
+syn match sicadOperator "\.gt\."
+syn match sicadOperator "\.le\."
+syn match sicadOperator "\.lt\."
+syn match sicadOperator "\.or\."
+syn match sicadOperator "\.eqv\."
+syn match sicadOperator "\.neqv\."
+
+" variable name
+syn match sicadIdentifier "%g\=[irpt][0-9]\{1,2}\>"
+syn match sicadIdentifier "%g\=l[0-9]\>"
+syn match sicadIdentifier "%g\=[irptl]("me=e-1
+syn match sicadIdentifier "%error\>"
+syn match sicadIdentifier "%nsel\>"
+syn match sicadIdentifier "%nvar\>"
+syn match sicadIdentifier "%scl\>"
+syn match sicadIdentifier "%wd\>"
+syn match sicadIdentifier "\$[irt][0-9]\{1,2}\>" contained
+
+" label
+syn match sicadLabel1 "^ *\.[a-z][a-z0-9]\{0,7} \+[^ ]"me=e-1
+syn match sicadLabel1 "^ *\.[a-z][a-z0-9]\{0,7}\*"me=e-1
+syn match sicadLabel2 "\<goto \.\=[a-z][a-z0-9]\{0,7}\>" contains=sicadGoto
+syn match sicadLabel2 "\<goto\.[a-z][a-z0-9]\{0,7}\>" contains=sicadGoto
+
+" boolean
+syn match sicadBoolean "\.[ft]\."
+" integer without sign
+syn match sicadNumber "\<[0-9]\+\>"
+" floating point number, with dot, optional exponent
+syn match sicadFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\>"
+" floating point number, starting with a dot, optional exponent
+syn match sicadFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\>"
+" floating point number, without dot, with exponent
+syn match sicadFloat "\<[0-9]\+e[-+]\=[0-9]\+\>"
+
+" without this extraString definition a ' ; ' could stop the comment
+syn region sicadString_ transparent start=+'+ end=+'+ oneline contained
+" string
+syn region sicadString start=+'+ end=+'+ oneline
+
+" comments - nasty ones in sicad
+
+" - ' * blabla' or ' * blabla;'
+syn region sicadComment start="^ *\*" skip='\\ *$' end=";"me=e-1 end="$" contains=sicadString_
+" - ' .LABEL03 * blabla' or ' .LABEL03 * blabla;'
+syn region sicadComment start="^ *\.[a-z][a-z0-9]\{0,7} *\*" skip='\\ *$' end=";"me=e-1 end="$" contains=sicadLabel1,sicadString_
+" - '; * blabla' or '; * blabla;'
+syn region sicadComment start="; *\*"ms=s+1 skip='\\ *$' end=";"me=e-1 end="$" contains=sicadString_
+" - comments between docbeg and docend
+syn region sicadComment matchgroup=sicadStatement start="\<docbeg\>" end="\<docend\>"
+
+" catch \ at the end of line
+syn match sicadLineCont "\\ *$"
+
+" parameters in dop block - for the time being it is not used
+"syn match sicadParameter " [a-z][a-z0-9]*[=:]"me=e-1 contained
+" dop block - for the time being it is not used
+syn region sicadDopBlock transparent matchgroup=sicadStatement start='\<dop\>' skip='\\ *$' end=';'me=e-1 end='$' contains=ALL
+
+" sql block - new highlighting mode is used (see syn include)
+syn region sicadSqlBlock transparent matchgroup=sicadStatement start='\<sql\>' skip='\\ *$' end=';'me=e-1 end='$' contains=@SQL,sicadIdentifier,sicadLineCont
+
+" synchronizing
+syn sync clear " clear sync used in sql.vim
+syn sync match sicadSyncComment groupthere NONE "\<docend\>"
+syn sync match sicadSyncComment grouphere sicadComment "\<docbeg\>"
+" next line must be examined too
+syn sync linecont "\\ *$"
+
+" catch error caused by tabulator key
+syn match sicadError "\t"
+" catch errors caused by wrong parenthesis
+"syn region sicadParen transparent start='(' end=')' contains=ALLBUT,sicadParenError
+syn region sicadParen transparent start='(' skip='\\ *$' end=')' end='$' contains=ALLBUT,sicadParenError
+syn match sicadParenError ')'
+"syn region sicadApostrophe transparent start=+'+ end=+'+ contains=ALLBUT,sicadApostropheError
+"syn match sicadApostropheError +'+
+" not closed apostrophe
+"syn region sicadError start=+'+ end=+$+ contains=ALLBUT,sicadApostropheError
+"syn match sicadApostropheError +'[^']*$+me=s+1 contained
+
+" SICAD keywords
+syn keyword sicadStatement abst add addsim adrin aib
+syn keyword sicadStatement aibzsn aidump aifgeo aisbrk alknam
+syn keyword sicadStatement alknr alksav alksel alktrc alopen
+syn keyword sicadStatement ansbo aractiv ararea arareao ararsfs
+syn keyword sicadStatement arbuffer archeck arcomv arcont arconv
+syn keyword sicadStatement arcopy arcopyo arcorr arcreate arerror
+syn keyword sicadStatement areval arflfm arflop arfrast argbkey
+syn keyword sicadStatement argenf argraph argrapho arinters arkompfl
+syn keyword sicadStatement arlasso arlcopy arlgraph arline arlining
+syn keyword sicadStatement arlisly armakea armemo arnext aroverl
+syn keyword sicadStatement arovers arparkmd arpars arrefp arselect
+syn keyword sicadStatement arset arstruct arunify arupdate arvector
+syn keyword sicadStatement arveinfl arvflfl arvoroni ausku basis
+syn keyword sicadStatement basisaus basisdar basisnr bebos befl
+syn keyword sicadStatement befla befli befls beo beorta
+syn keyword sicadStatement beortn bep bepan bepap bepola
+syn keyword sicadStatement bepoln bepsn bepsp ber berili
+syn keyword sicadStatement berk bewz bkl bli bma
+syn keyword sicadStatement bmakt bmakts bmbm bmerk bmerw
+syn keyword sicadStatement bmerws bminit bmk bmorth bmos
+syn keyword sicadStatement bmoss bmpar bmsl bmsum bmsums
+syn keyword sicadStatement bmver bmvero bmw bo bta
+syn keyword sicadStatement buffer bvl bw bza bzap
+syn keyword sicadStatement bzd bzgera bzorth cat catel
+syn keyword sicadStatement cdbdiff ce cgmparam close closesim
+syn keyword sicadStatement comgener comp comp conclose conclose coninfo
+syn keyword sicadStatement conopen conread contour conwrite cop
+syn keyword sicadStatement copar coparp coparp2 copel cr
+syn keyword sicadStatement cs cstat cursor d da
+syn keyword sicadStatement dal dasp dasps dataout dcol
+syn keyword sicadStatement dd defsr del delel deskrdef
+syn keyword sicadStatement df dfn dfns dfpos dfr
+syn keyword sicadStatement dgd dgm dgp dgr dh
+syn keyword sicadStatement diag diaus dir disbsd dkl
+syn keyword sicadStatement dktx dkur dlgfix dlgfre dma
+syn keyword sicadStatement dprio dr druse dsel dskinfo
+syn keyword sicadStatement dsr dv dve eba ebd
+syn keyword sicadStatement ebdmod ebs edbsdbin edbssnin edbsvtin
+syn keyword sicadStatement edt egaus egdef egdefs eglist
+syn keyword sicadStatement egloe egloenp egloes egxx eib
+syn keyword sicadStatement ekur ekuradd elel elpos epg
+syn keyword sicadStatement esau esauadd esek eta etap
+syn keyword sicadStatement etav feparam ficonv filse fl
+syn keyword sicadStatement fli flin flini flinit flins
+syn keyword sicadStatement flkor fln flnli flop flout
+syn keyword sicadStatement flowert flparam flraster flsy flsyd
+syn keyword sicadStatement flsym flsyms flsymt fmtatt fmtdia
+syn keyword sicadStatement fmtlib fpg gbadddb gbaim gbanrs
+syn keyword sicadStatement gbatw gbau gbaudit gbclosp gbcredic
+syn keyword sicadStatement gbcreem gbcreld gbcresdb gbcretd gbde
+syn keyword sicadStatement gbdeldb gbdeldic gbdelem gbdelld gbdelref
+syn keyword sicadStatement gbdeltd gbdisdb gbdisem gbdisld gbdistd
+syn keyword sicadStatement gbebn gbemau gbepsv gbgetdet gbgetes
+syn keyword sicadStatement gbgetmas gbgqel gbgqelr gbgqsa gbgrant
+syn keyword sicadStatement gbimpdic gbler gblerb gblerf gbles
+syn keyword sicadStatement gblocdic gbmgmg gbmntdb gbmoddb gbnam
+syn keyword sicadStatement gbneu gbopenp gbpoly gbpos gbpruef
+syn keyword sicadStatement gbpruefg gbps gbqgel gbqgsa gbrefdic
+syn keyword sicadStatement gbreftab gbreldic gbresem gbrevoke gbsav
+syn keyword sicadStatement gbsbef gbsddk gbsicu gbsrt gbss
+syn keyword sicadStatement gbstat gbsysp gbszau gbubp gbueb
+syn keyword sicadStatement gbunmdb gbuseem gbw gbweg gbwieh
+syn keyword sicadStatement gbzt gelp gera getvar hgw
+syn keyword sicadStatement hpg hr0 hra hrar icclchan
+syn keyword sicadStatement iccrecon icdescon icfree icgetcon icgtresp
+syn keyword sicadStatement icopchan icputcon icreacon icreqd icreqnw
+syn keyword sicadStatement icreqw icrespd icresrve icwricon imsget
+syn keyword sicadStatement imsgqel imsmget imsplot imsprint inchk
+syn keyword sicadStatement inf infd inst kbml kbmls
+syn keyword sicadStatement kbmm kbmms kbmt kbmtdps kbmts
+syn keyword sicadStatement khboe khbol khdob khe khetap
+syn keyword sicadStatement khfrw khktk khlang khld khmfrp
+syn keyword sicadStatement khmks khms khpd khpfeil khpl
+syn keyword sicadStatement khprofil khrand khsa khsabs khsaph
+syn keyword sicadStatement khsd khsdl khse khskbz khsna
+syn keyword sicadStatement khsnum khsob khspos khsvph khtrn
+syn keyword sicadStatement khver khzpe khzpl kib kldat
+syn keyword sicadStatement klleg klsch klsym klvert kmpg
+syn keyword sicadStatement kmtlage kmtp kmtps kodef kodefp
+syn keyword sicadStatement kodefs kok kokp kolae kom
+syn keyword sicadStatement kontly kopar koparp kopg kosy
+syn keyword sicadStatement kp kr krsek krtclose krtopen
+syn keyword sicadStatement ktk lad lae laesel language
+syn keyword sicadStatement lasso lbdes lcs ldesk ldesks
+syn keyword sicadStatement le leak leattdes leba lebas
+syn keyword sicadStatement lebaznp lebd lebm lebv lebvaus
+syn keyword sicadStatement lebvlist lede ledel ledepo ledepol
+syn keyword sicadStatement ledepos leder ledist ledm lee
+syn keyword sicadStatement leeins lees lege lekr lekrend
+syn keyword sicadStatement lekwa lekwas lel lelh lell
+syn keyword sicadStatement lelp lem lena lend lenm
+syn keyword sicadStatement lep lepe lepee lepko lepl
+syn keyword sicadStatement lepmko lepmkop lepos leposm leqs
+syn keyword sicadStatement leqsl leqssp leqsv leqsvov les
+syn keyword sicadStatement lesch lesr less lestd let
+syn keyword sicadStatement letaum letl lev levm levtm
+syn keyword sicadStatement levtp levtr lew lewm lexx
+syn keyword sicadStatement lfs li lining lldes lmode
+syn keyword sicadStatement loedk loepkt lop lose loses
+syn keyword sicadStatement lp lppg lppruef lr ls
+syn keyword sicadStatement lsop lsta lstat ly lyaus
+syn keyword sicadStatement lz lza lzae lzbz lze
+syn keyword sicadStatement lznr lzo lzpos ma ma0
+syn keyword sicadStatement ma1 mad map mapoly mcarp
+syn keyword sicadStatement mccfr mccgr mcclr mccrf mcdf
+syn keyword sicadStatement mcdma mcdr mcdrp mcdve mcebd
+syn keyword sicadStatement mcgse mcinfo mcldrp md me
+syn keyword sicadStatement mefd mefds minmax mipg ml
+syn keyword sicadStatement mmcmdme mmdbf mmdellb mmdir mmdome
+syn keyword sicadStatement mmfsb mminfolb mmlapp mmlbf mmlistlb
+syn keyword sicadStatement mmloadcm mmmsg mmreadlb mmsetlb mmshowcm
+syn keyword sicadStatement mmstatme mnp mpo mr mra
+syn keyword sicadStatement ms msav msgout msgsnd msp
+syn keyword sicadStatement mspf mtd nasel ncomp new
+syn keyword sicadStatement nlist nlistlt nlistly nlistnp nlistpo
+syn keyword sicadStatement np npa npdes npe npem
+syn keyword sicadStatement npinfa npruef npsat npss npssa
+syn keyword sicadStatement ntz oa oan odel odf
+syn keyword sicadStatement odfx oj oja ojaddsk ojaed
+syn keyword sicadStatement ojaeds ojaef ojaefs ojaen ojak
+syn keyword sicadStatement ojaks ojakt ojakz ojalm ojatkis
+syn keyword sicadStatement ojatt ojatw ojbsel ojcasel ojckon
+syn keyword sicadStatement ojde ojdtl ojeb ojebd ojel
+syn keyword sicadStatement ojelpas ojesb ojesbd ojex ojezge
+syn keyword sicadStatement ojko ojlb ojloe ojlsb ojmerk
+syn keyword sicadStatement ojmos ojnam ojpda ojpoly ojprae
+syn keyword sicadStatement ojs ojsak ojsort ojstrukt ojsub
+syn keyword sicadStatement ojtdef ojvek ojx old oldd
+syn keyword sicadStatement op opa opa1 open opensim
+syn keyword sicadStatement opnbsd orth osanz ot otp
+syn keyword sicadStatement otrefp param paranf pas passw
+syn keyword sicadStatement pcatchf pda pdadd pg pg0
+syn keyword sicadStatement pgauf pgaufsel pgb pgko pgm
+syn keyword sicadStatement pgr pgvs pily pkpg plot
+syn keyword sicadStatement plotf plotfr pmap pmdata pmdi
+syn keyword sicadStatement pmdp pmeb pmep pminfo pmlb
+syn keyword sicadStatement pmli pmlp pmmod pnrver poa
+syn keyword sicadStatement pos posa posaus post printfr
+syn keyword sicadStatement protect prs prssy prsym ps
+syn keyword sicadStatement psadd psclose psopen psparam psprw
+syn keyword sicadStatement psres psstat psw pswr qualif
+syn keyword sicadStatement rahmen raster rasterd rbbackup rbchang2
+syn keyword sicadStatement rbchange rbcmd rbcoldst rbcolor rbcopy
+syn keyword sicadStatement rbcut rbcut2 rbdbcl rbdbload rbdbop
+syn keyword sicadStatement rbdbwin rbdefs rbedit rbfdel rbfill
+syn keyword sicadStatement rbfill2 rbfload rbfload2 rbfnew rbfnew2
+syn keyword sicadStatement rbfpar rbfree rbg rbgetcol rbgetdst
+syn keyword sicadStatement rbinfo rbpaste rbpixel rbrstore rbsnap
+syn keyword sicadStatement rbsta rbtile rbtrpix rbvtor rcol
+syn keyword sicadStatement rd rdchange re reb rebmod
+syn keyword sicadStatement refunc ren renel rk rkpos
+syn keyword sicadStatement rohr rohrpos rpr rr rr0
+syn keyword sicadStatement rra rrar rs samtosdb sav
+syn keyword sicadStatement savd savesim savx scol scopy
+syn keyword sicadStatement scopye sdbtosam sddk sdwr se
+syn keyword sicadStatement selaus selpos seman semi sesch
+syn keyword sicadStatement setscl setvar sfclntpf sfconn sffetchf
+syn keyword sicadStatement sffpropi sfftypi sfqugeoc sfquwhcl sfself
+syn keyword sicadStatement sfstat sftest sge sid sie
+syn keyword sicadStatement sig sigp skk skks sn
+syn keyword sicadStatement sn21 snpa snpar snparp snparps
+syn keyword sicadStatement snpars snpas snpd snpi snpkor
+syn keyword sicadStatement snpl snpm sob sob0 sobloe
+syn keyword sicadStatement sobs sof sop split spr
+syn keyword sicadStatement sqdadd sqdlad sqdold sqdsav
+syn keyword sicadStatement sr sres srt sset stat
+syn keyword sicadStatement stdtxt string strukt strupru suinfl
+syn keyword sicadStatement suinflk suinfls supo supo1 sva
+syn keyword sicadStatement svr sy sya syly sysout
+syn keyword sicadStatement syu syux taa tabeg tabl
+syn keyword sicadStatement tabm tam tanr tapg tapos
+syn keyword sicadStatement tarkd tas tase tb tbadd
+syn keyword sicadStatement tbd tbext tbget tbint tbout
+syn keyword sicadStatement tbput tbsat tbsel tbstr tcaux
+syn keyword sicadStatement tccable tcchkrep tccomm tccond tcdbg
+syn keyword sicadStatement tcgbnr tcgrpos tcinit tclconv tcmodel
+syn keyword sicadStatement tcnwe tcpairs tcpath tcrect tcrmdli
+syn keyword sicadStatement tcscheme tcschmap tcse tcselc tcstar
+syn keyword sicadStatement tcstrman tcsubnet tcsymbol tctable tcthrcab
+syn keyword sicadStatement tctrans tctst tdb tdbdel tdbget
+syn keyword sicadStatement tdblist tdbput tgmod titel tmoff
+syn keyword sicadStatement tmon tp tpa tps tpta
+syn keyword sicadStatement tra trans transkdo transopt transpro
+syn keyword sicadStatement triangle trm trpg trrkd trs
+syn keyword sicadStatement ts tsa tx txa txchk
+syn keyword sicadStatement txcng txju txl txp txpv
+syn keyword sicadStatement txtcmp txv txz uckon uiinfo
+syn keyword sicadStatement uistatus umdk umdk1 umdka umge
+syn keyword sicadStatement umges umr verbo verflli verif
+syn keyword sicadStatement verly versinfo vfg vpactive vpcenter
+syn keyword sicadStatement vpcreate vpdelete vpinfo vpmodify vpscroll
+syn keyword sicadStatement vpsta wabsym wzmerk zdrhf zdrhfn
+syn keyword sicadStatement zdrhfw zdrhfwn zefp zfl zflaus
+syn keyword sicadStatement zka zlel zlels zortf zortfn
+syn keyword sicadStatement zortfw zortfwn zortp zortpn zparb
+syn keyword sicadStatement zparbn zparf zparfn zparfw zparfwn
+syn keyword sicadStatement zparp zparpn zwinkp zwinkpn
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sicad_syntax_inits")
+
+ if version < 508
+ let did_sicad_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sicadLabel PreProc
+ HiLink sicadLabel1 sicadLabel
+ HiLink sicadLabel2 sicadLabel
+ HiLink sicadConditional Conditional
+ HiLink sicadBoolean Boolean
+ HiLink sicadNumber Number
+ HiLink sicadFloat Float
+ HiLink sicadOperator Operator
+ HiLink sicadStatement Statement
+ HiLink sicadParameter sicadStatement
+ HiLink sicadGoto sicadStatement
+ HiLink sicadLineCont sicadStatement
+ HiLink sicadString String
+ HiLink sicadComment Comment
+ HiLink sicadSpecial Special
+ HiLink sicadIdentifier Type
+" HiLink sicadIdentifier Identifier
+ HiLink sicadError Error
+ HiLink sicadParenError sicadError
+ HiLink sicadApostropheError sicadError
+ HiLink sicadStringError sicadError
+ HiLink sicadCommentError sicadError
+" HiLink sqlStatement Special " modified highlight group in sql.vim
+
+ delcommand HiLink
+
+endif
+
+let b:current_syntax = "sicad"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/simula.vim b/runtime/syntax/simula.vim
new file mode 100644
index 000000000..e952ee26c
--- /dev/null
+++ b/runtime/syntax/simula.vim
@@ -0,0 +1,99 @@
+" Vim syntax file
+" Language: Simula
+" Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
+" URL: http://folk.uio.no/hakonrk/vim/syntax/simula.vim
+" Last Change: 2001 May 15
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" No case sensitivity in Simula
+syn case ignore
+
+syn match simulaComment "^%.*$" contains=simulaTodo
+syn region simulaComment start="!\|\<comment\>" end=";" contains=simulaTodo
+
+" Text between the keyword 'end' and either a semicolon or one of the
+" keywords 'end', 'else', 'when' or 'otherwise' is also a comment
+syn region simulaComment start="\<end\>"lc=3 matchgroup=Statement end=";\|\<\(end\|else\|when\|otherwise\)\>"
+
+syn match simulaCharError "'.\{-2,}'"
+syn match simulaCharacter "'.'"
+syn match simulaCharacter "'!\d\{-}!'" contains=simulaSpecialChar
+syn match simulaString '".\{-}"' contains=simulaSpecialChar,simulaTodo
+
+syn keyword simulaBoolean true false
+syn keyword simulaCompound begin end
+syn keyword simulaConditional else if otherwise then until when
+syn keyword simulaConstant none notext
+syn keyword simulaFunction procedure
+syn keyword simulaOperator eq eqv ge gt imp in is le lt ne new not qua
+syn keyword simulaRepeat while for
+syn keyword simulaReserved activate after at before delay go goto label prior reactivate switch to
+syn keyword simulaStatement do inner inspect step this
+syn keyword simulaStorageClass external hidden name protected value
+syn keyword simulaStructure class
+syn keyword simulaType array boolean character integer long real short text virtual
+syn match simulaAssigned "\<\h\w*\s*\((.*)\)\=\s*:\(=\|-\)"me=e-2
+syn match simulaOperator "[&:=<>+\-*/]"
+syn match simulaOperator "\<and\(\s\+then\)\=\>"
+syn match simulaOperator "\<or\(\s\+else\)\=\>"
+syn match simulaReferenceType "\<ref\s*(.\{-})"
+syn match simulaSemicolon ";"
+syn match simulaSpecial "[(),.]"
+syn match simulaSpecialCharErr "!\d\{-4,}!" contained
+syn match simulaSpecialCharErr "!!" contained
+syn match simulaSpecialChar "!\d\{-}!" contains=simulaSpecialCharErr contained
+syn match simulaTodo "xxx\+" contained
+
+" Integer number (or float without `.')
+syn match simulaNumber "-\=\<\d\+\>"
+" Real with optional exponent
+syn match simulaReal "-\=\<\d\+\(\.\d\+\)\=\(&&\=[+-]\=\d\+\)\=\>"
+" Real starting with a `.', optional exponent
+syn match simulaReal "-\=\.\d\+\(&&\=[+-]\=\d\+\)\=\>"
+
+if version >= 508 || !exists("did_simula_syntax_inits")
+ if version < 508
+ let did_simula_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink simulaAssigned Identifier
+ HiLink simulaBoolean Boolean
+ HiLink simulaCharacter Character
+ HiLink simulaCharError Error
+ HiLink simulaComment Comment
+ HiLink simulaCompound Statement
+ HiLink simulaConditional Conditional
+ HiLink simulaConstant Constant
+ HiLink simulaFunction Function
+ HiLink simulaNumber Number
+ HiLink simulaOperator Operator
+ HiLink simulaReal Float
+ HiLink simulaReferenceType Type
+ HiLink simulaRepeat Repeat
+ HiLink simulaReserved Error
+ HiLink simulaSemicolon Statement
+ HiLink simulaSpecial Special
+ HiLink simulaSpecialChar SpecialChar
+ HiLink simulaSpecialCharErr Error
+ HiLink simulaStatement Statement
+ HiLink simulaStorageClass StorageClass
+ HiLink simulaString String
+ HiLink simulaStructure Structure
+ HiLink simulaTodo Todo
+ HiLink simulaType Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "simula"
+" vim: sts=4 sw=4 ts=8
diff --git a/runtime/syntax/sinda.vim b/runtime/syntax/sinda.vim
new file mode 100644
index 000000000..2bde267c2
--- /dev/null
+++ b/runtime/syntax/sinda.vim
@@ -0,0 +1,146 @@
+" Vim syntax file
+" Language: sinda85, sinda/fluint input file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.sin
+" URL: http://www.naglenet.org/vim/syntax/sinda.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for sinda input and output files.
+"
+
+" Force free-form fortran format
+let fortran_free_source=1
+
+" Load FORTRAN syntax file
+if version < 600
+ source <sfile>:p:h/fortran.vim
+else
+ runtime! syntax/fortran.vim
+endif
+unlet b:current_syntax
+
+
+
+" Define keywords for SINDA
+syn keyword sindaMacro BUILD BUILDF DEBON DEBOFF DEFMOD FSTART FSTOP
+
+syn keyword sindaOptions TITLE PPSAVE RSI RSO OUTPUT SAVE QMAP USER1 USER2
+syn keyword sindaOptions MODEL PPOUT NOLIST MLINE NODEBUG DIRECTORIES
+syn keyword sindaOptions DOUBLEPR
+
+syn keyword sindaRoutine FORWRD FWDBCK STDSTL FASTIC
+
+syn keyword sindaControl ABSZRO ACCELX ACCELY ACCELZ ARLXCA ATMPCA
+syn keyword sindaControl BACKUP CSGFAC DRLXCA DTIMEH DTIMEI DTIMEL
+syn keyword sindaControl DTIMES DTMPCA EBALNA EBALSA EXTLIM ITEROT
+syn keyword sindaControl ITERXT ITHOLD NLOOPS NLOOPT OUTPUT OPEITR
+syn keyword sindaControl PATMOS SIGMA TIMEO TIMEND UID
+
+syn keyword sindaSubRoutine ASKERS ADARIN ADDARY ADDMOD ARINDV
+syn keyword sindaSubRoutine RYINV ARYMPY ARYSUB ARYTRN BAROC
+syn keyword sindaSubRoutine BELACC BNDDRV BNDGET CHENNB CHGFLD
+syn keyword sindaSubRoutine CHGLMP CHGSUC CHGVOL CHKCHL CHKCHP
+syn keyword sindaSubRoutine CNSTAB COMBAL COMPLQ COMPRS CONTRN
+syn keyword sindaSubRoutine CPRINT CRASH CRVINT CRYTRN CSIFLX
+syn keyword sindaSubRoutine CVTEMP D11CYL C11DAI D11DIM D11MCY
+syn keyword sindaSubRoutine D11MDA D11MDI D11MDT D12CYL D12MCY
+syn keyword sindaSubRoutine D12MDA D1D1DA D1D1IM D1D1WM D1D2DA
+syn keyword sindaSubRoutine D1D2WM D1DEG1 D1DEG2 D1DG1I D1IMD1
+syn keyword sindaSubRoutine D1IMIM D1IMWM D1M1DA D1M2MD D1M2WM
+syn keyword sindaSubRoutine D1MDG1 D1MDG2 D2D1WM D1DEG1 D2DEG2
+syn keyword sindaSubRoutine D2D2
+
+syn keyword sindaIdentifier BIV CAL DIM DIV DPM DPV DTV GEN PER PIV PIM
+syn keyword sindaIdentifier SIM SIV SPM SPV TVS TVD
+
+
+
+" Define matches for SINDA
+syn match sindaFortran "^F[0-9 ]"me=e-1
+syn match sindaMotran "^M[0-9 ]"me=e-1
+
+syn match sindaComment "^C.*$"
+syn match sindaComment "^R.*$"
+syn match sindaComment "\$.*$"
+
+syn match sindaHeader "^header[^,]*"
+
+syn match sindaIncludeFile "include \+[^ ]\+"hs=s+8 contains=fortranInclude
+
+syn match sindaMacro "^PSTART"
+syn match sindaMacro "^PSTOP"
+syn match sindaMacro "^FAC"
+
+syn match sindaInteger "-\=\<[0-9]*\>"
+syn match sindaFloat "-\=\<[0-9]*\.[0-9]*"
+syn match sindaScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+syn match sindaEndData "^END OF DATA"
+
+if exists("thermal_todo")
+ execute 'syn match sindaTodo ' . '"^'.thermal_todo.'.*$"'
+else
+ syn match sindaTodo "^?.*$"
+endif
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sinda_syntax_inits")
+ if version < 508
+ let did_sinda_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sindaMacro Macro
+ HiLink sindaOptions Special
+ HiLink sindaRoutine Type
+ HiLink sindaControl Special
+ HiLink sindaSubRoutine Function
+ HiLink sindaIdentifier Identifier
+
+ HiLink sindaFortran PreProc
+ HiLink sindaMotran PreProc
+
+ HiLink sindaComment Comment
+ HiLink sindaHeader Typedef
+ HiLink sindaIncludeFile Type
+ HiLink sindaInteger Number
+ HiLink sindaFloat Float
+ HiLink sindaScientific Float
+
+ HiLink sindaEndData Macro
+
+ HiLink sindaTodo Todo
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "sinda"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/sindacmp.vim b/runtime/syntax/sindacmp.vim
new file mode 100644
index 000000000..87b483409
--- /dev/null
+++ b/runtime/syntax/sindacmp.vim
@@ -0,0 +1,74 @@
+" Vim syntax file
+" Language: sinda85, sinda/fluint compare file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.cmp
+" URL: http://www.naglenet.org/vim/syntax/sindacmp.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+" Begin syntax definitions for compare files.
+"
+
+" Define keywords for sinda compare (sincomp)
+syn keyword sindacmpUnit celsius fahrenheit
+
+
+
+" Define matches for sinda compare (sincomp)
+syn match sindacmpTitle "Steady State Temperature Comparison"
+
+syn match sindacmpLabel "File [1-6] is"
+
+syn match sindacmpHeader "^ *Node\( *File \d\)* *Node Description"
+
+syn match sindacmpInteger "^ *-\=\<[0-9]*\>"
+syn match sindacmpFloat "-\=\<[0-9]*\.[0-9]*"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sindacmp_syntax_inits")
+ if version < 508
+ let did_sindacmp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sindacmpTitle Type
+ HiLink sindacmpUnit PreProc
+
+ HiLink sindacmpLabel Statement
+
+ HiLink sindacmpHeader sindaHeader
+
+ HiLink sindacmpInteger Number
+ HiLink sindacmpFloat Special
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "sindacmp"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/sindaout.vim b/runtime/syntax/sindaout.vim
new file mode 100644
index 000000000..b557e017e
--- /dev/null
+++ b/runtime/syntax/sindaout.vim
@@ -0,0 +1,100 @@
+" Vim syntax file
+" Language: sinda85, sinda/fluint output file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.out
+" URL: http://www.naglenet.org/vim/syntax/sindaout.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case match
+
+
+
+" Load SINDA syntax file
+if version < 600
+ source <sfile>:p:h/sinda.vim
+else
+ runtime! syntax/sinda.vim
+endif
+unlet b:current_syntax
+
+
+
+"
+"
+" Begin syntax definitions for sinda output files.
+"
+
+" Define keywords for sinda output
+syn case match
+
+syn keyword sindaoutPos ON SI
+syn keyword sindaoutNeg OFF ENG
+
+
+
+" Define matches for sinda output
+syn match sindaoutFile ": \w*\.TAK"hs=s+2
+
+syn match sindaoutInteger "T\=[0-9]*\>"ms=s+1
+
+syn match sindaoutSectionDelim "[-<>]\{4,}" contains=sindaoutSectionTitle
+syn match sindaoutSectionDelim ":\=\.\{4,}:\=" contains=sindaoutSectionTitle
+syn match sindaoutSectionTitle "[-<:] \w[0-9A-Za-z_() ]\+ [->:]"hs=s+1,me=e-1
+
+syn match sindaoutHeaderDelim "=\{5,}"
+syn match sindaoutHeaderDelim "|\{5,}"
+syn match sindaoutHeaderDelim "+\{5,}"
+
+syn match sindaoutLabel "Input File:" contains=sindaoutFile
+syn match sindaoutLabel "Begin Solution: Routine"
+
+syn match sindaoutError "<<< Error >>>"
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sindaout_syntax_inits")
+ if version < 508
+ let did_sindaout_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ hi sindaHeaderDelim ctermfg=Black ctermbg=Green guifg=Black guibg=Green
+
+ HiLink sindaoutPos Statement
+ HiLink sindaoutNeg PreProc
+ HiLink sindaoutTitle Type
+ HiLink sindaoutFile sindaIncludeFile
+ HiLink sindaoutInteger sindaInteger
+
+ HiLink sindaoutSectionDelim Delimiter
+ HiLink sindaoutSectionTitle Exception
+ HiLink sindaoutHeaderDelim SpecialComment
+ HiLink sindaoutLabel Identifier
+
+ HiLink sindaoutError Error
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "sindaout"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/skill.vim b/runtime/syntax/skill.vim
new file mode 100644
index 000000000..8b960441f
--- /dev/null
+++ b/runtime/syntax/skill.vim
@@ -0,0 +1,562 @@
+" Vim syntax file
+" Language: SKILL
+" Maintainer: Toby Schaffer <jtschaff@eos.ncsu.edu>
+" Last Change: 2003 May 11
+" Comments: SKILL is a Lisp-like programming language for use in EDA
+" tools from Cadence Design Systems. It allows you to have
+" a programming environment within the Cadence environment
+" that gives you access to the complete tool set and design
+" database. This file also defines syntax highlighting for
+" certain Design Framework II interface functions.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword skillConstants t nil unbound
+
+" enumerate all the SKILL reserved words/functions
+syn match skillFunction "(abs\>"hs=s+1
+syn match skillFunction "\<abs("he=e-1
+syn match skillFunction "(a\=cos\>"hs=s+1
+syn match skillFunction "\<a\=cos("he=e-1
+syn match skillFunction "(add1\>"hs=s+1
+syn match skillFunction "\<add1("he=e-1
+syn match skillFunction "(addDefstructClass\>"hs=s+1
+syn match skillFunction "\<addDefstructClass("he=e-1
+syn match skillFunction "(alias\>"hs=s+1
+syn match skillFunction "\<alias("he=e-1
+syn match skillFunction "(alphalessp\>"hs=s+1
+syn match skillFunction "\<alphalessp("he=e-1
+syn match skillFunction "(alphaNumCmp\>"hs=s+1
+syn match skillFunction "\<alphaNumCmp("he=e-1
+syn match skillFunction "(append1\=\>"hs=s+1
+syn match skillFunction "\<append1\=("he=e-1
+syn match skillFunction "(apply\>"hs=s+1
+syn match skillFunction "\<apply("he=e-1
+syn match skillFunction "(arrayp\>"hs=s+1
+syn match skillFunction "\<arrayp("he=e-1
+syn match skillFunction "(arrayref\>"hs=s+1
+syn match skillFunction "\<arrayref("he=e-1
+syn match skillFunction "(a\=sin\>"hs=s+1
+syn match skillFunction "\<a\=sin("he=e-1
+syn match skillFunction "(assoc\>"hs=s+1
+syn match skillFunction "\<assoc("he=e-1
+syn match skillFunction "(ass[qv]\>"hs=s+1
+syn match skillFunction "\<ass[qv]("he=e-1
+syn match skillFunction "(a\=tan\>"hs=s+1
+syn match skillFunction "\<a\=tan("he=e-1
+syn match skillFunction "(ato[fim]\>"hs=s+1
+syn match skillFunction "\<ato[fim]("he=e-1
+syn match skillFunction "(bcdp\>"hs=s+1
+syn match skillFunction "\<bcdp("he=e-1
+syn match skillKeywords "(begin\>"hs=s+1
+syn match skillKeywords "\<begin("he=e-1
+syn match skillFunction "(booleanp\>"hs=s+1
+syn match skillFunction "\<booleanp("he=e-1
+syn match skillFunction "(boundp\>"hs=s+1
+syn match skillFunction "\<boundp("he=e-1
+syn match skillFunction "(buildString\>"hs=s+1
+syn match skillFunction "\<buildString("he=e-1
+syn match skillFunction "(c[ad]{1,3}r\>"hs=s+1
+syn match skillFunction "\<c[ad]{1,3}r("he=e-1
+syn match skillConditional "(caseq\=\>"hs=s+1
+syn match skillConditional "\<caseq\=("he=e-1
+syn match skillFunction "(ceiling\>"hs=s+1
+syn match skillFunction "\<ceiling("he=e-1
+syn match skillFunction "(changeWorkingDir\>"hs=s+1
+syn match skillFunction "\<changeWorkingDir("he=e-1
+syn match skillFunction "(charToInt\>"hs=s+1
+syn match skillFunction "\<charToInt("he=e-1
+syn match skillFunction "(clearExitProcs\>"hs=s+1
+syn match skillFunction "\<clearExitProcs("he=e-1
+syn match skillFunction "(close\>"hs=s+1
+syn match skillFunction "\<close("he=e-1
+syn match skillFunction "(compareTime\>"hs=s+1
+syn match skillFunction "\<compareTime("he=e-1
+syn match skillFunction "(compress\>"hs=s+1
+syn match skillFunction "\<compress("he=e-1
+syn match skillFunction "(concat\>"hs=s+1
+syn match skillFunction "\<concat("he=e-1
+syn match skillConditional "(cond\>"hs=s+1
+syn match skillConditional "\<cond("he=e-1
+syn match skillFunction "(cons\>"hs=s+1
+syn match skillFunction "\<cons("he=e-1
+syn match skillFunction "(copy\>"hs=s+1
+syn match skillFunction "\<copy("he=e-1
+syn match skillFunction "(copyDefstructDeep\>"hs=s+1
+syn match skillFunction "\<copyDefstructDeep("he=e-1
+syn match skillFunction "(createDir\>"hs=s+1
+syn match skillFunction "\<createDir("he=e-1
+syn match skillFunction "(csh\>"hs=s+1
+syn match skillFunction "\<csh("he=e-1
+syn match skillKeywords "(declare\>"hs=s+1
+syn match skillKeywords "\<declare("he=e-1
+syn match skillKeywords "(declare\(N\|SQN\)\=Lambda\>"hs=s+1
+syn match skillKeywords "\<declare\(N\|SQN\)\=Lambda("he=e-1
+syn match skillKeywords "(defmacro\>"hs=s+1
+syn match skillKeywords "\<defmacro("he=e-1
+syn match skillKeywords "(defprop\>"hs=s+1
+syn match skillKeywords "\<defprop("he=e-1
+syn match skillKeywords "(defstruct\>"hs=s+1
+syn match skillKeywords "\<defstruct("he=e-1
+syn match skillFunction "(defstructp\>"hs=s+1
+syn match skillFunction "\<defstructp("he=e-1
+syn match skillKeywords "(defun\>"hs=s+1
+syn match skillKeywords "\<defun("he=e-1
+syn match skillKeywords "(defUserInitProc\>"hs=s+1
+syn match skillKeywords "\<defUserInitProc("he=e-1
+syn match skillKeywords "(defvar\>"hs=s+1
+syn match skillKeywords "\<defvar("he=e-1
+syn match skillFunction "(delete\(Dir\|File\)\>"hs=s+1
+syn match skillKeywords "\<delete\(Dir\|File\)("he=e-1
+syn match skillFunction "(display\>"hs=s+1
+syn match skillFunction "\<display("he=e-1
+syn match skillFunction "(drain\>"hs=s+1
+syn match skillFunction "\<drain("he=e-1
+syn match skillFunction "(dtpr\>"hs=s+1
+syn match skillFunction "\<dtpr("he=e-1
+syn match skillFunction "(ed\(i\|l\|it\)\=\>"hs=s+1
+syn match skillFunction "\<ed\(i\|l\|it\)\=("he=e-1
+syn match skillFunction "(envobj\>"hs=s+1
+syn match skillFunction "\<envobj("he=e-1
+syn match skillFunction "(equal\>"hs=s+1
+syn match skillFunction "\<equal("he=e-1
+syn match skillFunction "(eqv\=\>"hs=s+1
+syn match skillFunction "\<eqv\=("he=e-1
+syn match skillFunction "(err\>"hs=s+1
+syn match skillFunction "\<err("he=e-1
+syn match skillFunction "(error\>"hs=s+1
+syn match skillFunction "\<error("he=e-1
+syn match skillFunction "(errset\>"hs=s+1
+syn match skillFunction "\<errset("he=e-1
+syn match skillFunction "(errsetstring\>"hs=s+1
+syn match skillFunction "\<errsetstring("he=e-1
+syn match skillFunction "(eval\>"hs=s+1
+syn match skillFunction "\<eval("he=e-1
+syn match skillFunction "(evalstring\>"hs=s+1
+syn match skillFunction "\<evalstring("he=e-1
+syn match skillFunction "(evenp\>"hs=s+1
+syn match skillFunction "\<evenp("he=e-1
+syn match skillFunction "(exists\>"hs=s+1
+syn match skillFunction "\<exists("he=e-1
+syn match skillFunction "(exit\>"hs=s+1
+syn match skillFunction "\<exit("he=e-1
+syn match skillFunction "(exp\>"hs=s+1
+syn match skillFunction "\<exp("he=e-1
+syn match skillFunction "(expandMacro\>"hs=s+1
+syn match skillFunction "\<expandMacro("he=e-1
+syn match skillFunction "(file\(Length\|Seek\|Tell\|TimeModified\)\>"hs=s+1
+syn match skillFunction "\<file\(Length\|Seek\|Tell\|TimeModified\)("he=e-1
+syn match skillFunction "(fixp\=\>"hs=s+1
+syn match skillFunction "\<fixp\=("he=e-1
+syn match skillFunction "(floatp\=\>"hs=s+1
+syn match skillFunction "\<floatp\=("he=e-1
+syn match skillFunction "(floor\>"hs=s+1
+syn match skillFunction "\<floor("he=e-1
+syn match skillRepeat "(for\(all\|each\)\=\>"hs=s+1
+syn match skillRepeat "\<for\(all\|each\)\=("he=e-1
+syn match skillFunction "([fs]\=printf\>"hs=s+1
+syn match skillFunction "\<[fs]\=printf("he=e-1
+syn match skillFunction "(f\=scanf\>"hs=s+1
+syn match skillFunction "\<f\=scanf("he=e-1
+syn match skillFunction "(funobj\>"hs=s+1
+syn match skillFunction "\<funobj("he=e-1
+syn match skillFunction "(gc\>"hs=s+1
+syn match skillFunction "\<gc("he=e-1
+syn match skillFunction "(gensym\>"hs=s+1
+syn match skillFunction "\<gensym("he=e-1
+syn match skillFunction "(get\(_pname\|_string\)\=\>"hs=s+1
+syn match skillFunction "\<get\(_pname\|_string\)\=("he=e-1
+syn match skillFunction "(getc\(har\)\=\>"hs=s+1
+syn match skillFunction "\<getc\(har\)\=("he=e-1
+syn match skillFunction "(getCurrentTime\>"hs=s+1
+syn match skillFunction "\<getCurrentTime("he=e-1
+syn match skillFunction "(getd\>"hs=s+1
+syn match skillFunction "\<getd("he=e-1
+syn match skillFunction "(getDirFiles\>"hs=s+1
+syn match skillFunction "\<getDirFiles("he=e-1
+syn match skillFunction "(getFnWriteProtect\>"hs=s+1
+syn match skillFunction "\<getFnWriteProtect("he=e-1
+syn match skillFunction "(getRunType\>"hs=s+1
+syn match skillFunction "\<getRunType("he=e-1
+syn match skillFunction "(getInstallPath\>"hs=s+1
+syn match skillFunction "\<getInstallPath("he=e-1
+syn match skillFunction "(getqq\=\>"hs=s+1
+syn match skillFunction "\<getqq\=("he=e-1
+syn match skillFunction "(gets\>"hs=s+1
+syn match skillFunction "\<gets("he=e-1
+syn match skillFunction "(getShellEnvVar\>"hs=s+1
+syn match skillFunction "\<getShellEnvVar("he=e-1
+syn match skillFunction "(getSkill\(Path\|Version\)\>"hs=s+1
+syn match skillFunction "\<getSkill\(Path\|Version\)("he=e-1
+syn match skillFunction "(getVarWriteProtect\>"hs=s+1
+syn match skillFunction "\<getVarWriteProtect("he=e-1
+syn match skillFunction "(getVersion\>"hs=s+1
+syn match skillFunction "\<getVersion("he=e-1
+syn match skillFunction "(getWarn\>"hs=s+1
+syn match skillFunction "\<getWarn("he=e-1
+syn match skillFunction "(getWorkingDir\>"hs=s+1
+syn match skillFunction "\<getWorkingDir("he=e-1
+syn match skillRepeat "(go\>"hs=s+1
+syn match skillRepeat "\<go("he=e-1
+syn match skillConditional "(if\>"hs=s+1
+syn match skillConditional "\<if("he=e-1
+syn keyword skillConditional then else
+syn match skillFunction "(index\>"hs=s+1
+syn match skillFunction "\<index("he=e-1
+syn match skillFunction "(infile\>"hs=s+1
+syn match skillFunction "\<infile("he=e-1
+syn match skillFunction "(inportp\>"hs=s+1
+syn match skillFunction "\<inportp("he=e-1
+syn match skillFunction "(in\(Scheme\|Skill\)\>"hs=s+1
+syn match skillFunction "\<in\(Scheme\|Skill\)("he=e-1
+syn match skillFunction "(instring\>"hs=s+1
+syn match skillFunction "\<instring("he=e-1
+syn match skillFunction "(integerp\>"hs=s+1
+syn match skillFunction "\<integerp("he=e-1
+syn match skillFunction "(intToChar\>"hs=s+1
+syn match skillFunction "\<intToChar("he=e-1
+syn match skillFunction "(is\(Callable\|Dir\|Executable\|File\|FileEncrypted\|FileName\|Link\|Macro\|Writable\)\>"hs=s+1
+syn match skillFunction "\<is\(Callable\|Dir\|Executable\|File\|FileEncrypted\|FileName\|Link\|Macro\|Writable\)("he=e-1
+syn match skillKeywords "(n\=lambda\>"hs=s+1
+syn match skillKeywords "\<n\=lambda("he=e-1
+syn match skillKeywords "(last\>"hs=s+1
+syn match skillKeywords "\<last("he=e-1
+syn match skillFunction "(lconc\>"hs=s+1
+syn match skillFunction "\<lconc("he=e-1
+syn match skillFunction "(length\>"hs=s+1
+syn match skillFunction "\<length("he=e-1
+syn match skillKeywords "(let\>"hs=s+1
+syn match skillKeywords "\<let("he=e-1
+syn match skillFunction "(lineread\(string\)\=\>"hs=s+1
+syn match skillFunction "\<lineread\(string\)\=("he=e-1
+syn match skillKeywords "(list\>"hs=s+1
+syn match skillKeywords "\<list("he=e-1
+syn match skillFunction "(listp\>"hs=s+1
+syn match skillFunction "\<listp("he=e-1
+syn match skillFunction "(listToVector\>"hs=s+1
+syn match skillFunction "\<listToVector("he=e-1
+syn match skillFunction "(loadi\=\>"hs=s+1
+syn match skillFunction "\<loadi\=("he=e-1
+syn match skillFunction "(loadstring\>"hs=s+1
+syn match skillFunction "\<loadstring("he=e-1
+syn match skillFunction "(log\>"hs=s+1
+syn match skillFunction "\<log("he=e-1
+syn match skillFunction "(lowerCase\>"hs=s+1
+syn match skillFunction "\<lowerCase("he=e-1
+syn match skillFunction "(makeTable\>"hs=s+1
+syn match skillFunction "\<makeTable("he=e-1
+syn match skillFunction "(makeTempFileName\>"hs=s+1
+syn match skillFunction "\<makeTempFileName("he=e-1
+syn match skillFunction "(makeVector\>"hs=s+1
+syn match skillFunction "\<makeVector("he=e-1
+syn match skillFunction "(map\(c\|can\|car\|list\)\>"hs=s+1
+syn match skillFunction "\<map\(c\|can\|car\|list\)("he=e-1
+syn match skillFunction "(max\>"hs=s+1
+syn match skillFunction "\<max("he=e-1
+syn match skillFunction "(measureTime\>"hs=s+1
+syn match skillFunction "\<measureTime("he=e-1
+syn match skillFunction "(member\>"hs=s+1
+syn match skillFunction "\<member("he=e-1
+syn match skillFunction "(mem[qv]\>"hs=s+1
+syn match skillFunction "\<mem[qv]("he=e-1
+syn match skillFunction "(min\>"hs=s+1
+syn match skillFunction "\<min("he=e-1
+syn match skillFunction "(minusp\>"hs=s+1
+syn match skillFunction "\<minusp("he=e-1
+syn match skillFunction "(mod\(ulo\)\=\>"hs=s+1
+syn match skillFunction "\<mod\(ulo\)\=("he=e-1
+syn match skillKeywords "([mn]\=procedure\>"hs=s+1
+syn match skillKeywords "\<[mn]\=procedure("he=e-1
+syn match skillFunction "(ncon[cs]\>"hs=s+1
+syn match skillFunction "\<ncon[cs]("he=e-1
+syn match skillFunction "(needNCells\>"hs=s+1
+syn match skillFunction "\<needNCells("he=e-1
+syn match skillFunction "(negativep\>"hs=s+1
+syn match skillFunction "\<negativep("he=e-1
+syn match skillFunction "(neq\(ual\)\=\>"hs=s+1
+syn match skillFunction "\<neq\(ual\)\=("he=e-1
+syn match skillFunction "(newline\>"hs=s+1
+syn match skillFunction "\<newline("he=e-1
+syn match skillFunction "(nindex\>"hs=s+1
+syn match skillFunction "\<nindex("he=e-1
+syn match skillFunction "(not\>"hs=s+1
+syn match skillFunction "\<not("he=e-1
+syn match skillFunction "(nth\(cdr\|elem\)\=\>"hs=s+1
+syn match skillFunction "\<nth\(cdr\|elem\)\=("he=e-1
+syn match skillFunction "(null\>"hs=s+1
+syn match skillFunction "\<null("he=e-1
+syn match skillFunction "(numberp\>"hs=s+1
+syn match skillFunction "\<numberp("he=e-1
+syn match skillFunction "(numOpenFiles\>"hs=s+1
+syn match skillFunction "\<numOpenFiles("he=e-1
+syn match skillFunction "(oddp\>"hs=s+1
+syn match skillFunction "\<oddp("he=e-1
+syn match skillFunction "(onep\>"hs=s+1
+syn match skillFunction "\<onep("he=e-1
+syn match skillFunction "(otherp\>"hs=s+1
+syn match skillFunction "\<otherp("he=e-1
+syn match skillFunction "(outfile\>"hs=s+1
+syn match skillFunction "\<outfile("he=e-1
+syn match skillFunction "(outportp\>"hs=s+1
+syn match skillFunction "\<outportp("he=e-1
+syn match skillFunction "(pairp\>"hs=s+1
+syn match skillFunction "\<pairp("he=e-1
+syn match skillFunction "(parseString\>"hs=s+1
+syn match skillFunction "\<parseString("he=e-1
+syn match skillFunction "(plist\>"hs=s+1
+syn match skillFunction "\<plist("he=e-1
+syn match skillFunction "(plusp\>"hs=s+1
+syn match skillFunction "\<plusp("he=e-1
+syn match skillFunction "(portp\>"hs=s+1
+syn match skillFunction "\<portp("he=e-1
+syn match skillFunction "(p\=print\>"hs=s+1
+syn match skillFunction "\<p\=print("he=e-1
+syn match skillFunction "(prependInstallPath\>"hs=s+1
+syn match skillFunction "\<prependInstallPath("he=e-1
+syn match skillFunction "(printl\(ev\|n\)\>"hs=s+1
+syn match skillFunction "\<printl\(ev\|n\)("he=e-1
+syn match skillFunction "(procedurep\>"hs=s+1
+syn match skillFunction "\<procedurep("he=e-1
+syn match skillKeywords "(prog[12n]\=\>"hs=s+1
+syn match skillKeywords "\<prog[12n]\=("he=e-1
+syn match skillFunction "(putd\>"hs=s+1
+syn match skillFunction "\<putd("he=e-1
+syn match skillFunction "(putpropq\{,2}\>"hs=s+1
+syn match skillFunction "\<putpropq\{,2}("he=e-1
+syn match skillFunction "(random\>"hs=s+1
+syn match skillFunction "\<random("he=e-1
+syn match skillFunction "(read\>"hs=s+1
+syn match skillFunction "\<read("he=e-1
+syn match skillFunction "(readString\>"hs=s+1
+syn match skillFunction "\<readString("he=e-1
+syn match skillFunction "(readTable\>"hs=s+1
+syn match skillFunction "\<readTable("he=e-1
+syn match skillFunction "(realp\>"hs=s+1
+syn match skillFunction "\<realp("he=e-1
+syn match skillFunction "(regExit\(After\|Before\)\>"hs=s+1
+syn match skillFunction "\<regExit\(After\|Before\)("he=e-1
+syn match skillFunction "(remainder\>"hs=s+1
+syn match skillFunction "\<remainder("he=e-1
+syn match skillFunction "(remdq\=\>"hs=s+1
+syn match skillFunction "\<remdq\=("he=e-1
+syn match skillFunction "(remExitProc\>"hs=s+1
+syn match skillFunction "\<remExitProc("he=e-1
+syn match skillFunction "(remove\>"hs=s+1
+syn match skillFunction "\<remove("he=e-1
+syn match skillFunction "(remprop\>"hs=s+1
+syn match skillFunction "\<remprop("he=e-1
+syn match skillFunction "(remq\>"hs=s+1
+syn match skillFunction "\<remq("he=e-1
+syn match skillKeywords "(return\>"hs=s+1
+syn match skillKeywords "\<return("he=e-1
+syn match skillFunction "(reverse\>"hs=s+1
+syn match skillFunction "\<reverse("he=e-1
+syn match skillFunction "(rexCompile\>"hs=s+1
+syn match skillFunction "\<rexCompile("he=e-1
+syn match skillFunction "(rexExecute\>"hs=s+1
+syn match skillFunction "\<rexExecute("he=e-1
+syn match skillFunction "(rexMagic\>"hs=s+1
+syn match skillFunction "\<rexMagic("he=e-1
+syn match skillFunction "(rexMatchAssocList\>"hs=s+1
+syn match skillFunction "\<rexMatchAssocList("he=e-1
+syn match skillFunction "(rexMatchList\>"hs=s+1
+syn match skillFunction "\<rexMatchList("he=e-1
+syn match skillFunction "(rexMatchp\>"hs=s+1
+syn match skillFunction "\<rexMatchp("he=e-1
+syn match skillFunction "(rexReplace\>"hs=s+1
+syn match skillFunction "\<rexReplace("he=e-1
+syn match skillFunction "(rexSubstitute\>"hs=s+1
+syn match skillFunction "\<rexSubstitute("he=e-1
+syn match skillFunction "(rindex\>"hs=s+1
+syn match skillFunction "\<rindex("he=e-1
+syn match skillFunction "(round\>"hs=s+1
+syn match skillFunction "\<round("he=e-1
+syn match skillFunction "(rplac[ad]\>"hs=s+1
+syn match skillFunction "\<rplac[ad]("he=e-1
+syn match skillFunction "(schemeTopLevelEnv\>"hs=s+1
+syn match skillFunction "\<schemeTopLevelEnv("he=e-1
+syn match skillFunction "(set\>"hs=s+1
+syn match skillFunction "\<set("he=e-1
+syn match skillFunction "(setarray\>"hs=s+1
+syn match skillFunction "\<setarray("he=e-1
+syn match skillFunction "(setc[ad]r\>"hs=s+1
+syn match skillFunction "\<setc[ad]r("he=e-1
+syn match skillFunction "(setFnWriteProtect\>"hs=s+1
+syn match skillFunction "\<setFnWriteProtect("he=e-1
+syn match skillFunction "(setof\>"hs=s+1
+syn match skillFunction "\<setof("he=e-1
+syn match skillFunction "(setplist\>"hs=s+1
+syn match skillFunction "\<setplist("he=e-1
+syn match skillFunction "(setq\>"hs=s+1
+syn match skillFunction "\<setq("he=e-1
+syn match skillFunction "(setShellEnvVar\>"hs=s+1
+syn match skillFunction "\<setShellEnvVar("he=e-1
+syn match skillFunction "(setSkillPath\>"hs=s+1
+syn match skillFunction "\<setSkillPath("he=e-1
+syn match skillFunction "(setVarWriteProtect\>"hs=s+1
+syn match skillFunction "\<setVarWriteProtect("he=e-1
+syn match skillFunction "(sh\(ell\)\=\>"hs=s+1
+syn match skillFunction "\<sh\(ell\)\=("he=e-1
+syn match skillFunction "(simplifyFilename\>"hs=s+1
+syn match skillFunction "\<simplifyFilename("he=e-1
+syn match skillFunction "(sort\(car\)\=\>"hs=s+1
+syn match skillFunction "\<sort\(car\)\=("he=e-1
+syn match skillFunction "(sqrt\>"hs=s+1
+syn match skillFunction "\<sqrt("he=e-1
+syn match skillFunction "(srandom\>"hs=s+1
+syn match skillFunction "\<srandom("he=e-1
+syn match skillFunction "(sstatus\>"hs=s+1
+syn match skillFunction "\<sstatus("he=e-1
+syn match skillFunction "(strn\=cat\>"hs=s+1
+syn match skillFunction "\<strn\=cat("he=e-1
+syn match skillFunction "(strn\=cmp\>"hs=s+1
+syn match skillFunction "\<strn\=cmp("he=e-1
+syn match skillFunction "(stringp\>"hs=s+1
+syn match skillFunction "\<stringp("he=e-1
+syn match skillFunction "(stringTo\(Function\|Symbol\|Time\)\>"hs=s+1
+syn match skillFunction "\<stringTo\(Function\|Symbol\|Time\)("he=e-1
+syn match skillFunction "(strlen\>"hs=s+1
+syn match skillFunction "\<strlen("he=e-1
+syn match skillFunction "(sub1\>"hs=s+1
+syn match skillFunction "\<sub1("he=e-1
+syn match skillFunction "(subst\>"hs=s+1
+syn match skillFunction "\<subst("he=e-1
+syn match skillFunction "(substring\>"hs=s+1
+syn match skillFunction "\<substring("he=e-1
+syn match skillFunction "(sxtd\>"hs=s+1
+syn match skillFunction "\<sxtd("he=e-1
+syn match skillFunction "(symbolp\>"hs=s+1
+syn match skillFunction "\<symbolp("he=e-1
+syn match skillFunction "(symbolToString\>"hs=s+1
+syn match skillFunction "\<symbolToString("he=e-1
+syn match skillFunction "(symeval\>"hs=s+1
+syn match skillFunction "\<symeval("he=e-1
+syn match skillFunction "(symstrp\>"hs=s+1
+syn match skillFunction "\<symstrp("he=e-1
+syn match skillFunction "(system\>"hs=s+1
+syn match skillFunction "\<system("he=e-1
+syn match skillFunction "(tablep\>"hs=s+1
+syn match skillFunction "\<tablep("he=e-1
+syn match skillFunction "(tableToList\>"hs=s+1
+syn match skillFunction "\<tableToList("he=e-1
+syn match skillFunction "(tailp\>"hs=s+1
+syn match skillFunction "\<tailp("he=e-1
+syn match skillFunction "(tconc\>"hs=s+1
+syn match skillFunction "\<tconc("he=e-1
+syn match skillFunction "(timeToString\>"hs=s+1
+syn match skillFunction "\<timeToString("he=e-1
+syn match skillFunction "(timeToTm\>"hs=s+1
+syn match skillFunction "\<timeToTm("he=e-1
+syn match skillFunction "(tmToTime\>"hs=s+1
+syn match skillFunction "\<tmToTime("he=e-1
+syn match skillFunction "(truncate\>"hs=s+1
+syn match skillFunction "\<truncate("he=e-1
+syn match skillFunction "(typep\=\>"hs=s+1
+syn match skillFunction "\<typep\=("he=e-1
+syn match skillFunction "(unalias\>"hs=s+1
+syn match skillFunction "\<unalias("he=e-1
+syn match skillConditional "(unless\>"hs=s+1
+syn match skillConditional "\<unless("he=e-1
+syn match skillFunction "(upperCase\>"hs=s+1
+syn match skillFunction "\<upperCase("he=e-1
+syn match skillFunction "(vector\(ToList\)\=\>"hs=s+1
+syn match skillFunction "\<vector\(ToList\)\=("he=e-1
+syn match skillFunction "(warn\>"hs=s+1
+syn match skillFunction "\<warn("he=e-1
+syn match skillConditional "(when\>"hs=s+1
+syn match skillConditional "\<when("he=e-1
+syn match skillRepeat "(while\>"hs=s+1
+syn match skillRepeat "\<while("he=e-1
+syn match skillFunction "(write\>"hs=s+1
+syn match skillFunction "\<write("he=e-1
+syn match skillFunction "(writeTable\>"hs=s+1
+syn match skillFunction "\<writeTable("he=e-1
+syn match skillFunction "(xcons\>"hs=s+1
+syn match skillFunction "\<xcons("he=e-1
+syn match skillFunction "(zerop\>"hs=s+1
+syn match skillFunction "\<zerop("he=e-1
+syn match skillFunction "(zxtd\>"hs=s+1
+syn match skillFunction "\<zxtd("he=e-1
+
+" DFII procedural interface routines
+
+" CDF functions
+syn match skillcdfFunctions "(cdf\u\a\+\>"hs=s+1
+syn match skillcdfFunctions "\<cdf\u\a\+("he=e-1
+" graphic editor functions
+syn match skillgeFunctions "(ge\u\a\+\>"hs=s+1
+syn match skillgeFunctions "\<ge\u\a\+("he=e-1
+" human interface functions
+syn match skillhiFunctions "(hi\u\a\+\>"hs=s+1
+syn match skillhiFunctions "\<hi\u\a\+("he=e-1
+" layout editor functions
+syn match skillleFunctions "(le\u\a\+\>"hs=s+1
+syn match skillleFunctions "\<le\u\a\+("he=e-1
+" database|design editor|design flow functions
+syn match skilldbefFunctions "(d[bef]\u\a\+\>"hs=s+1
+syn match skilldbefFunctions "\<d[bef]\u\a\+("he=e-1
+" design management & design data services functions
+syn match skillddFunctions "(dd[s]\=\u\a\+\>"hs=s+1
+syn match skillddFunctions "\<dd[s]\=\u\a\+("he=e-1
+" parameterized cell functions
+syn match skillpcFunctions "(pc\u\a\+\>"hs=s+1
+syn match skillpcFunctions "\<pc\u\a\+("he=e-1
+" tech file functions
+syn match skilltechFunctions "(\(tech\|tc\)\u\a\+\>"hs=s+1
+syn match skilltechFunctions "\<\(tech\|tc\)\u\a\+("he=e-1
+
+" strings
+syn region skillString start=+"+ skip=+\\"+ end=+"+
+
+syn keyword skillTodo contained TODO FIXME XXX
+syn keyword skillNote contained NOTE IMPORTANT
+
+" comments are either C-style or begin with a semicolon
+syn region skillComment start="/\*" end="\*/" contains=skillTodo,skillNote
+syn match skillComment ";.*" contains=skillTodo,skillNote
+syn match skillCommentError "\*/"
+
+syn sync ccomment skillComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_skill_syntax_inits")
+ if version < 508
+ let did_skill_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink skillcdfFunctions Function
+ HiLink skillgeFunctions Function
+ HiLink skillhiFunctions Function
+ HiLink skillleFunctions Function
+ HiLink skilldbefFunctions Function
+ HiLink skillddFunctions Function
+ HiLink skillpcFunctions Function
+ HiLink skilltechFunctions Function
+ HiLink skillConstants Constant
+ HiLink skillFunction Function
+ HiLink skillKeywords Statement
+ HiLink skillConditional Conditional
+ HiLink skillRepeat Repeat
+ HiLink skillString String
+ HiLink skillTodo Todo
+ HiLink skillNote Todo
+ HiLink skillComment Comment
+ HiLink skillCommentError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "skill"
+
+" vim: ts=4
diff --git a/runtime/syntax/sl.vim b/runtime/syntax/sl.vim
new file mode 100644
index 000000000..fa3bca06d
--- /dev/null
+++ b/runtime/syntax/sl.vim
@@ -0,0 +1,120 @@
+" Vim syntax file
+" Language: Renderman shader language
+" Maintainer: Dan Piponi <dan@tanelorn.demon.co.uk>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful Renderman keywords including special
+" RenderMan control structures
+syn keyword slStatement break return continue
+syn keyword slConditional if else
+syn keyword slRepeat while for
+syn keyword slRepeat illuminance illuminate solar
+
+syn keyword slTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match slSpecial contained "\\[0-9][0-9][0-9]\|\\."
+syn region slString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=slSpecial
+syn match slCharacter "'[^\\]'"
+syn match slSpecialCharacter "'\\.'"
+syn match slSpecialCharacter "'\\[0-9][0-9]'"
+syn match slSpecialCharacter "'\\[0-9][0-9][0-9]'"
+
+"catch errors caused by wrong parenthesis
+syn region slParen transparent start='(' end=')' contains=ALLBUT,slParenError,slIncluded,slSpecial,slTodo,slUserLabel
+syn match slParenError ")"
+syn match slInParen contained "[{}]"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match slNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match slFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match slFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match slFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
+"hex number
+syn match slNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+"syn match slIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+
+if exists("sl_comment_strings")
+ " A comment can contain slString, slCharacter and slNumber.
+ " But a "*/" inside a slString in a slComment DOES end the comment! So we
+ " need to use a special type of slString: slCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syntax match slCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syntax region slCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=slSpecial,slCommentSkip
+ syntax region slComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=slSpecial
+ syntax region slComment start="/\*" end="\*/" contains=slTodo,slCommentString,slCharacter,slNumber
+else
+ syn region slComment start="/\*" end="\*/" contains=slTodo
+endif
+syntax match slCommentError "\*/"
+
+syn keyword slOperator sizeof
+syn keyword slType float point color string vector normal matrix void
+syn keyword slStorageClass varying uniform extern
+syn keyword slStorageClass light surface volume displacement transformation imager
+syn keyword slVariable Cs Os P dPdu dPdv N Ng u v du dv s t
+syn keyword slVariable L Cl Ol E I ncomps time Ci Oi
+syn keyword slVariable Ps alpha
+syn keyword slVariable dtime dPdtime
+
+syn sync ccomment slComment minlines=10
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sl_syntax_inits")
+ if version < 508
+ let did_sl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink slLabel Label
+ HiLink slUserLabel Label
+ HiLink slConditional Conditional
+ HiLink slRepeat Repeat
+ HiLink slCharacter Character
+ HiLink slSpecialCharacter slSpecial
+ HiLink slNumber Number
+ HiLink slFloat Float
+ HiLink slParenError slError
+ HiLink slInParen slError
+ HiLink slCommentError slError
+ HiLink slOperator Operator
+ HiLink slStorageClass StorageClass
+ HiLink slError Error
+ HiLink slStatement Statement
+ HiLink slType Type
+ HiLink slCommentError slError
+ HiLink slCommentString slString
+ HiLink slComment2String slString
+ HiLink slCommentSkip slComment
+ HiLink slString String
+ HiLink slComment Comment
+ HiLink slSpecial SpecialChar
+ HiLink slTodo Todo
+ HiLink slVariable Identifier
+ "HiLink slIdentifier Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sl"
+
+" vim: ts=8
diff --git a/runtime/syntax/slang.vim b/runtime/syntax/slang.vim
new file mode 100644
index 000000000..9fa89b4d6
--- /dev/null
+++ b/runtime/syntax/slang.vim
@@ -0,0 +1,102 @@
+" Vim syntax file
+" Language: S-Lang
+" Maintainer: Jan Hlavacek <lahvak@math.ohio-state.edu>
+" Last Change: 980216
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword slangStatement break return continue EXECUTE_ERROR_BLOCK
+syn match slangStatement "\<X_USER_BLOCK[0-4]\>"
+syn keyword slangLabel case
+syn keyword slangConditional !if if else switch
+syn keyword slangRepeat while for _for loop do forever
+syn keyword slangDefinition define typedef variable struct
+syn keyword slangOperator or and andelse orelse shr shl xor not
+syn keyword slangBlock EXIT_BLOCK ERROR_BLOCK
+syn match slangBlock "\<USER_BLOCK[0-4]\>"
+syn keyword slangConstant NULL
+syn keyword slangType Integer_Type Double_Type Complex_Type String_Type Struct_Type Ref_Type Null_Type Array_Type DataType_Type
+
+syn match slangOctal "\<0\d\+\>" contains=slangOctalError
+syn match slangOctalError "[89]\+" contained
+syn match slangHex "\<0[xX][0-9A-Fa-f]*\>"
+syn match slangDecimal "\<[1-9]\d*\>"
+syn match slangFloat "\<\d\+\."
+syn match slangFloat "\<\d\+\.\d\+\([Ee][-+]\=\d\+\)\=\>"
+syn match slangFloat "\<\d\+\.[Ee][-+]\=\d\+\>"
+syn match slangFloat "\<\d\+[Ee][-+]\=\d\+\>"
+syn match slangFloat "\.\d\+\([Ee][-+]\=\d\+\)\=\>"
+syn match slangImaginary "\.\d\+\([Ee][-+]\=\d*\)\=[ij]\>"
+syn match slangImaginary "\<\d\+\(\.\d*\)\=\([Ee][-+]\=\d\+\)\=[ij]\>"
+
+syn region slangString oneline start='"' end='"' skip='\\"'
+syn match slangCharacter "'[^\\]'"
+syn match slangCharacter "'\\.'"
+syn match slangCharacter "'\\[0-7]\{1,3}'"
+syn match slangCharacter "'\\d\d\{1,3}'"
+syn match slangCharacter "'\\x[0-7a-fA-F]\{1,2}'"
+
+syn match slangDelim "[][{};:,]"
+syn match slangOperator "[-%+/&*=<>|!~^@]"
+
+"catch errors caused by wrong parenthesis
+syn region slangParen matchgroup=slangDelim transparent start='(' end=')' contains=ALLBUT,slangParenError
+syn match slangParenError ")"
+
+syn match slangComment "%.*$"
+syn keyword slangOperator sizeof
+
+syn region slangPreCondit start="^\s*#\s*\(ifdef\>\|ifndef\>\|iftrue\>\|ifnfalse\>\|iffalse\>\|ifntrue\>\|if\$\|ifn\$\|\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=cComment,slangString,slangCharacter,slangNumber
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_slang_syntax_inits")
+ if version < 508
+ let did_slang_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink slangDefinition Type
+ HiLink slangBlock slangDefinition
+ HiLink slangLabel Label
+ HiLink slangConditional Conditional
+ HiLink slangRepeat Repeat
+ HiLink slangCharacter Character
+ HiLink slangFloat Float
+ HiLink slangImaginary Float
+ HiLink slangDecimal slangNumber
+ HiLink slangOctal slangNumber
+ HiLink slangHex slangNumber
+ HiLink slangNumber Number
+ HiLink slangParenError Error
+ HiLink slangOctalError Error
+ HiLink slangOperator Operator
+ HiLink slangStructure Structure
+ HiLink slangInclude Include
+ HiLink slangPreCondit PreCondit
+ HiLink slangError Error
+ HiLink slangStatement Statement
+ HiLink slangType Type
+ HiLink slangString String
+ HiLink slangConstant Constant
+ HiLink slangRangeArray slangConstant
+ HiLink slangComment Comment
+ HiLink slangSpecial SpecialChar
+ HiLink slangTodo Todo
+ HiLink slangDelim Delimiter
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "slang"
+
+" vim: ts=8
diff --git a/runtime/syntax/slice.vim b/runtime/syntax/slice.vim
new file mode 100644
index 000000000..e8f876c8b
--- /dev/null
+++ b/runtime/syntax/slice.vim
@@ -0,0 +1,90 @@
+" Vim syntax file
+" Language: Slice (ZeroC's Specification Language for Ice)
+" Maintainer: Morel Bodin <bodin@tuxfamily.net>
+" Last Change: 2003 Sep 24
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" The Slice keywords
+
+syn keyword sliceType bool byte double float int long short string void
+syn keyword sliceQualifier const extends idempotent implements local nonmutating out throws
+syn keyword sliceConstruct class enum exception dictionnary interface module LocalObject Object sequence struct
+syn keyword sliceQualifier const extends idempotent implements local nonmutating out throws
+syn keyword sliceBoolean false true
+
+" Include directives
+syn match sliceIncluded display contained "<[^>]*>"
+syn match sliceInclude display "^\s*#\s*include\>\s*["<]" contains=sliceIncluded
+
+" Double-include guards
+syn region sliceGuard start="^#\(define\|ifndef\|endif\)" end="$"
+
+" Strings and characters
+syn region sliceString start=+"+ end=+"+
+
+" Numbers (shamelessly ripped from c.vim, only slightly modified)
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match sliceNumbers display transparent "\<\d\|\.\d" contains=sliceNumber,sliceFloat,sliceOctal
+syn match sliceNumber display contained "\d\+"
+"hex number
+syn match sliceNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match sliceOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=sliceOctalZero
+syn match sliceOctalZero display contained "\<0"
+syn match sliceFloat display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match sliceFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match sliceFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match sliceFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+" flag an octal number with wrong digits
+syn case match
+
+
+" Comments
+syn region sliceComment start="/\*" end="\*/"
+syn match sliceComment "//.*"
+
+syn sync ccomment sliceComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_slice_syn_inits")
+ if version < 508
+ let did_slice_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sliceComment Comment
+ HiLink sliceConstruct Keyword
+ HiLink sliceType Type
+ HiLink sliceString String
+ HiLink sliceIncluded String
+ HiLink sliceQualifier Keyword
+ HiLink sliceInclude Include
+ HiLink sliceGuard PreProc
+ HiLink sliceBoolean Boolean
+ HiLink sliceFloat Number
+ HiLink sliceNumber Number
+ HiLink sliceOctal Number
+ HiLink sliceOctalZero Special
+ HiLink sliceNumberError Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "slice"
+
+" vim: ts=8
diff --git a/runtime/syntax/slrnrc.vim b/runtime/syntax/slrnrc.vim
new file mode 100644
index 000000000..c15d9afd8
--- /dev/null
+++ b/runtime/syntax/slrnrc.vim
@@ -0,0 +1,194 @@
+" Vim syntax file
+" Language: Slrn setup file (based on slrn 0.9.8.0)
+" Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
+" Last Change: 19 May 2004
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword slrnrcTodo contained Todo
+
+" In some places whitespace is illegal
+syn match slrnrcSpaceError contained "\s"
+
+syn match slrnrcNumber contained "-\=\<\d\+\>"
+syn match slrnrcNumber contained +'[^']\+'+
+
+syn match slrnrcSpecKey contained +\(\\[er"']\|\^[^'"]\|\\\o\o\o\)+
+
+syn match slrnrcKey contained "\S\+" contains=slrnrcSpecKey
+syn region slrnrcKey contained start=+"+ skip=+\\"+ end=+"+ oneline contains=slrnrcSpecKey
+syn region slrnrcKey contained start=+'+ skip=+\\'+ end=+'+ oneline contains=slrnrcSpecKey
+
+syn match slrnrcSpecChar contained +'+
+syn match slrnrcSpecChar contained +\\[n"]+
+syn match slrnrcSpecChar contained "%[dfmnrs%]"
+
+syn match slrnrcString contained /[^ \t%"']\+/ contains=slrnrcSpecChar
+syn region slrnrcString contained start=+"+ skip=+\\"+ end=+"+ oneline contains=slrnrcSpecChar
+
+syn match slrnSlangPreCondit "^#\s*ifn\=\(def\>\|false\>\|true\>\|\$\)"
+syn match slrnSlangPreCondit "^#\s*e\(lif\|lse\|ndif\)\>"
+
+syn match slrnrcComment "%.*$" contains=slrnrcTodo
+
+syn keyword slrnrcVarInt contained abort_unmodified_edits article_window_page_overlap auto_mark_article_as_read beep broken_xref broken_xref cc_followup check_new_groups
+syn keyword slrnrcVarInt contained color_by_score confirm_actions custom_sort_by_threads display_cursor_bar drop_bogus_groups editor_uses_mime_charset emphasized_text_mask
+syn keyword slrnrcVarInt contained emphasized_text_mode fold_headers fold_headers followup_strip_signature force_authentication force_authentication generate_date_header
+syn keyword slrnrcVarInt contained generate_email_from generate_email_from generate_message_id grouplens_port hide_pgpsignature hide_quotes hide_signature
+syn keyword slrnrcVarInt contained hide_verbatim_marks hide_verbatim_text highlight_unread_subjects highlight_urls ignore_signature kill_score lines_per_update
+syn keyword slrnrcVarInt contained mail_editor_is_mua max_low_score max_queued_groups min_high_score mouse netiquette_warnings new_subject_breaks_threads no_autosave
+syn keyword slrnrcVarInt contained no_backups prefer_head process_verbatim_marks query_next_article query_next_group query_read_group_cutoff read_active reject_long_lines
+syn keyword slrnrcVarInt contained scroll_by_page show_article show_thread_subject simulate_graphic_chars smart_quote sorting_method spoiler_char spoiler_char
+syn keyword slrnrcVarInt contained spoiler_display_mode spoiler_display_mode spool_check_up_on_nov spool_check_up_on_nov uncollapse_threads unsubscribe_new_groups use_blink
+syn keyword slrnrcVarInt contained use_color use_flow_control use_grouplens use_grouplens use_header_numbers use_inews use_inews use_localtime use_metamail use_mime use_mime
+syn keyword slrnrcVarInt contained use_recommended_msg_id use_slrnpull use_slrnpull use_tilde use_tmpdir use_uudeview use_uudeview warn_followup_to wrap_flags wrap_method
+syn keyword slrnrcVarInt contained write_newsrc_flags
+
+" Listed for removal
+syn keyword slrnrcVarInt contained author_display display_author_realname display_score group_dsc_start_column process_verbatum_marks prompt_next_group query_reconnect
+syn keyword slrnrcVarInt contained show_descriptions use_xgtitle
+
+" Match as a "string" too
+syn region slrnrcVarIntStr contained matchgroup=slrnrcVarInt start=+"+ end=+"+ oneline contains=slrnrcVarInt,slrnrcSpaceError
+
+syn keyword slrnrcVarStr contained Xbrowser art_help_line art_status_line cansecret_file cc_post_string charset custom_headers custom_sort_order decode_directory
+syn keyword slrnrcVarStr contained editor_command failed_posts_file followup_custom_headers followup_date_format followup_string followupto_string group_help_line
+syn keyword slrnrcVarStr contained group_status_line grouplens_host grouplens_pseudoname header_help_line header_status_line hostname inews_program macro_directory
+syn keyword slrnrcVarStr contained mail_editor_command metamail_command mime_charset non_Xbrowser organization overview_date_format post_editor_command post_object
+syn keyword slrnrcVarStr contained postpone_directory printer_name quote_string realname reply_custom_headers reply_string replyto save_directory save_posts save_replies
+syn keyword slrnrcVarStr contained score_editor_command scorefile sendmail_command server_object signature signoff_string spool_active_file spool_activetimes_file
+syn keyword slrnrcVarStr contained spool_inn_root spool_newsgroups_file spool_nov_file spool_nov_root spool_overviewfmt_file spool_root supersedes_custom_headers
+syn keyword slrnrcVarStr contained top_status_line username
+
+" Listed for removal
+syn keyword slrnrcVarStr contained followup cc_followup_string
+
+" Match as a "string" too
+syn region slrnrcVarStrStr contained matchgroup=slrnrcVarStr start=+"+ end=+"+ oneline contains=slrnrcVarStr,slrnrcSpaceError
+
+" Various commands
+syn region slrnrcCmdLine matchgroup=slrnrcCmd start="\<\(autobaud\|color\|compatible_charsets\|group_display_format\|grouplens_add\|header_display_format\|ignore_quotes\|include\|interpret\|mono\|nnrpaccess\|posting_host\|server\|set\|setkey\|strip_re_regexp\|strip_sig_regexp\|strip_was_regexp\|unsetkey\|visible_headers\)\>" end="$" oneline contains=slrnrc\(String\|Comment\)
+
+" Listed for removal
+syn region slrnrcCmdLine matchgroup=slrnrcCmd start="\<\(cc_followup_string\|decode_directory\|editor_command\|followup\|hostname\|organization\|quote_string\|realname\|replyto\|scorefile\|signature\|username\)\>" end="$" oneline contains=slrnrc\(String\|Comment\)
+
+" Setting variables
+syn keyword slrnrcSet contained set
+syn match slrnrcSetStr "^\s*set\s\+\S\+" skipwhite nextgroup=slrnrcString contains=slrnrcSet,slrnrcVarStr\(Str\)\=
+syn match slrnrcSetInt contained "^\s*set\s\+\S\+" contains=slrnrcSet,slrnrcVarInt\(Str\)\=
+syn match slrnrcSetIntLine "^\s*set\s\+\S\+\s\+\(-\=\d\+\>\|'[^']\+'\)" contains=slrnrcSetInt,slrnrcNumber,slrnrcVarInt
+
+" Color definitions
+syn match slrnrcColorObj contained "\<quotes\d\+\>"
+syn keyword slrnrcColorObj contained article author boldtext box cursor date description error frame from_myself group grouplens_display header_name header_number headers
+syn keyword slrnrcColorObj contained high_score italicstext menu menu_press message neg_score normal pgpsignature pos_score quotes response_char selection signature status
+syn keyword slrnrcColorObj contained subject thread_number tilde tree underlinetext unread_subject url verbatim
+
+" Listed for removal
+syn keyword slrnrcColorObj contained verbatum
+
+syn region slrnrcColorObjStr contained matchgroup=slrnrcColorObj start=+"+ end=+"+ oneline contains=slrnrcColorObj,slrnrcSpaceError
+syn keyword slrnrcColorVal contained default
+syn keyword slrnrcColorVal contained black blue brightblue brightcyan brightgreen brightmagenta brightred brown cyan gray green lightgray magenta red white yellow
+syn region slrnrcColorValStr contained matchgroup=slrnrcColorVal start=+"+ end=+"+ oneline contains=slrnrcColorVal,slrnrcSpaceError
+" Mathcing a function with three arguments
+syn keyword slrnrcColor contained color
+syn match slrnrcColorInit contained "^\s*color\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Obj\|ObjStr\)\=
+syn match slrnrcColorLine "^\s*color\s\+\S\+\s\+\S\+" skipwhite nextgroup=slrnrcColorVal\(Str\)\= contains=slrnrcColor\(Init\|Val\|ValStr\)
+
+" Mono settings
+syn keyword slrnrcMonoVal contained blink bold none reverse underline
+syn region slrnrcMonoValStr contained matchgroup=slrnrcMonoVal start=+"+ end=+"+ oneline contains=slrnrcMonoVal,slrnrcSpaceError
+" Color object is inherited
+" Mono needs at least one argument
+syn keyword slrnrcMono contained mono
+syn match slrnrcMonoInit contained "^\s*mono\s\+\S\+" contains=slrnrcMono,slrnrcColorObj\(Str\)\=
+syn match slrnrcMonoLine "^\s*mono\s\+\S\+\s\+\S.*" contains=slrnrcMono\(Init\|Val\|ValStr\),slrnrcComment
+
+" Functions in article mode
+syn keyword slrnrcFunArt contained article_bob article_eob article_left article_line_down article_line_up article_page_down article_page_up article_right article_search
+syn keyword slrnrcFunArt contained author_search_backward author_search_forward browse_url cancel catchup catchup_all create_score decode delete delete_thread digit_arg
+syn keyword slrnrcFunArt contained enlarge_article_window evaluate_cmd exchange_mark expunge fast_quit followup forward forward_digest get_children_headers get_parent_header
+syn keyword slrnrcFunArt contained goto_article goto_last_read grouplens_rate_article header_bob header_eob header_line_down header_line_up header_page_down header_page_up
+syn keyword slrnrcFunArt contained help hide_article locate_article mark_spot next next_high_score next_same_subject pipe post post_postponed previous print quit redraw
+syn keyword slrnrcFunArt contained repeat_last_key reply request save show_spoilers shrink_article_window skip_quotes skip_to_next_group skip_to_previous_group
+syn keyword slrnrcFunArt contained subject_search_backward subject_search_forward supersede suspend tag_header toggle_collapse_threads toggle_header_formats
+syn keyword slrnrcFunArt contained toggle_header_tag toggle_headers toggle_pgpsignature toggle_quotes toggle_rot13 toggle_signature toggle_verbatim_marks
+syn keyword slrnrcFunArt contained toggle_verbatim_text uncatchup uncatchup_all undelete untag_headers view_scores wrap_article zoom_article_window
+
+" Listed for removal
+syn keyword slrnrcFunArt contained art_bob art_eob art_xpunge article_linedn article_lineup article_pagedn article_pageup down enlarge_window goto_beginning goto_end left
+syn keyword slrnrcFunArt contained locate_header_by_msgid pagedn pageup pipe_article prev print_article right scroll_dn scroll_up shrink_window skip_to_prev_group
+syn keyword slrnrcFunArt contained toggle_show_author up
+
+" Functions in group mode
+syn keyword slrnrcFunGroup contained add_group bob catchup digit_arg eob evaluate_cmd group_search group_search_backward group_search_forward help line_down line_up move_group
+syn keyword slrnrcFunGroup contained page_down page_up post post_postponed quit redraw refresh_groups repeat_last_key save_newsrc select_group subscribe suspend
+syn keyword slrnrcFunGroup contained toggle_group_formats toggle_hidden toggle_list_all toggle_scoring transpose_groups uncatchup unsubscribe
+
+" Listed for removal
+syn keyword slrnrcFunGroup contained down group_bob group_eob pagedown pageup toggle_group_display uncatch_up up
+
+" Functions in readline mode (actually from slang's slrline.c)
+syn keyword slrnrcFunRead contained bdel bol del deleol down enter eol left quoted_insert right self_insert trim up
+
+" Binding keys
+syn keyword slrnrcSetkeyObj contained article group readline
+syn region slrnrcSetkeyObjStr contained matchgroup=slrnrcSetkeyObj start=+"+ end=+"+ oneline contains=slrnrcSetkeyObj
+syn match slrnrcSetkeyArt contained '\("\=\)\<article\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunArt
+syn match slrnrcSetkeyGroup contained '\("\=\)\<group\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunGroup
+syn match slrnrcSetkeyRead contained '\("\=\)\<readline\>\1\s\+\S\+' skipwhite nextgroup=slrnrcKey contains=slrnrcSetKeyObj\(Str\)\=,slrnrcFunRead
+syn match slrnrcSetkey "^\s*setkey\>" skipwhite nextgroup=slrnrcSetkeyArt,slrnrcSetkeyGroup,slrnrcSetkeyRead
+
+" Unbinding keys
+syn match slrnrcUnsetkey '^\s*unsetkey\s\+\("\)\=\(article\|group\|readline\)\>\1' skipwhite nextgroup=slrnrcKey contains=slrnrcSetkeyObj\(Str\)\=
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_slrnrc_syntax_inits")
+ if version < 508
+ let did_slrnrc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink slrnrcTodo Todo
+ HiLink slrnrcSpaceError Error
+ HiLink slrnrcNumber Number
+ HiLink slrnrcSpecKey SpecialChar
+ HiLink slrnrcKey String
+ HiLink slrnrcSpecChar SpecialChar
+ HiLink slrnrcString String
+ HiLink slrnSlangPreCondit Special
+ HiLink slrnrcComment Comment
+ HiLink slrnrcVarInt Identifier
+ HiLink slrnrcVarStr Identifier
+ HiLink slrnrcCmd slrnrcSet
+ HiLink slrnrcSet Operator
+ HiLink slrnrcColor Keyword
+ HiLink slrnrcColorObj Identifier
+ HiLink slrnrcColorVal String
+ HiLink slrnrcMono Keyword
+ HiLink slrnrcMonoObj Identifier
+ HiLink slrnrcMonoVal String
+ HiLink slrnrcFunArt Macro
+ HiLink slrnrcFunGroup Macro
+ HiLink slrnrcFunRead Macro
+ HiLink slrnrcSetkeyObj Identifier
+ HiLink slrnrcSetkey Keyword
+ HiLink slrnrcUnsetkey slrnrcSetkey
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "slrnrc"
+
+"EOF vim: ts=8 noet tw=120 sw=8 sts=0
diff --git a/runtime/syntax/slrnsc.vim b/runtime/syntax/slrnsc.vim
new file mode 100644
index 000000000..3f653cc4e
--- /dev/null
+++ b/runtime/syntax/slrnsc.vim
@@ -0,0 +1,85 @@
+" Vim syntax file
+" Language: Slrn score file (based on slrn 0.9.8.0)
+" Maintainer: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
+" Last Change: 19 May 2004
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" characters in newsgroup names
+if version < 600
+ set isk=@,48-57,.,-,_,+
+else
+ setlocal isk=@,48-57,.,-,_,+
+endif
+
+syn match slrnscComment "%.*$"
+syn match slrnscSectionCom ".].*"lc=2
+
+syn match slrnscGroup contained "\(\k\|\*\)\+"
+syn match slrnscNumber contained "\d\+"
+syn match slrnscDate contained "\(\d\{1,2}[-/]\)\{2}\d\{4}"
+syn match slrnscDelim contained ":"
+syn match slrnscComma contained ","
+syn match slrnscOper contained "\~"
+syn match slrnscEsc contained "\\[ecC<>.]"
+syn match slrnscEsc contained "[?^]"
+syn match slrnscEsc contained "[^\\]$\s*$"lc=1
+
+syn keyword slrnscInclude contained include
+syn match slrnscIncludeLine "^\s*Include\s\+\S.*$"
+
+syn region slrnscSection matchgroup=slrnscSectionStd start="^\s*\[" end='\]' contains=slrnscGroup,slrnscComma,slrnscSectionCom
+syn region slrnscSection matchgroup=slrnscSectionNot start="^\s*\[\~" end='\]' contains=slrnscGroup,slrnscCommas,slrnscSectionCom
+
+syn keyword slrnscItem contained Age Bytes Date Expires From Has-Body Lines Message-Id Newsgroup References Subject Xref
+
+syn match slrnscScoreItem contained "%.*$" skipempty nextgroup=slrnscScoreItem contains=slrnscComment
+syn match slrnscScoreItem contained "^\s*Expires:\s*\(\d\{1,2}[-/]\)\{2}\d\{4}\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscItem,slrnscDelim,slrnscDate
+syn match slrnscScoreItem contained "^\s*\~\=\(Age\|Bytes\|Has-Body\|Lines\):\s*\d\+\s*$" skipempty nextgroup=slrnscScoreItem contains=slrnscOper,slrnscItem,slrnscDelim,slrnscNumber
+syn match slrnscScoreItemFill contained ".*$" skipempty nextgroup=slrnscScoreItem contains=slrnscEsc
+syn match slrnscScoreItem contained "^\s*\~\=\(Date\|From\|Message-Id\|Newsgroup\|References\|Subject\|Xref\):" nextgroup=slrnscScoreItemFill contains=slrnscOper,slrnscItem,slrnscDelim
+syn region slrnscScoreItem contained matchgroup=Special start="^\s*\~\={::\=" end="^\s*}" skipempty nextgroup=slrnscScoreItem contains=slrnscScoreItem
+
+syn keyword slrnscScore contained Score
+syn match slrnscScoreIdent contained "%.*"
+syn match slrnScoreLine "^\s*Score::\=\s\+=\=-\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_slrnsc_syntax_inits")
+ if version < 508
+ let did_slrnsc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink slrnscComment Comment
+ HiLink slrnscSectionCom slrnscComment
+ HiLink slrnscGroup String
+ HiLink slrnscNumber Number
+ HiLink slrnscDate Special
+ HiLink slrnscDelim Delimiter
+ HiLink slrnscComma SpecialChar
+ HiLink slrnscOper SpecialChar
+ HiLink slrnscEsc String
+ HiLink slrnscSectionStd Type
+ HiLink slrnscSectionNot Delimiter
+ HiLink slrnscItem Statement
+ HiLink slrnscScore Keyword
+ HiLink slrnscScoreIdent Identifier
+ HiLink slrnscInclude Keyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "slrnsc"
+
+"EOF vim: ts=8 noet tw=200 sw=8 sts=0
diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim
new file mode 100644
index 000000000..f919d8732
--- /dev/null
+++ b/runtime/syntax/sm.vim
@@ -0,0 +1,96 @@
+" Vim syntax file
+" Language: sendmail
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 3
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Comments
+syn match smComment "^#.*$" contains=@Spell
+
+" Definitions, Classes, Files, Options, Precedence, Trusted Users, Mailers
+syn match smDefine "^[CDF]."
+syn match smDefine "^O[AaBcdDeFfgHiLmNoQqrSsTtuvxXyYzZ]"
+syn match smDefine "^O\s"he=e-1
+syn match smDefine "^M[a-zA-Z0-9]\+,"he=e-1
+syn match smDefine "^T" nextgroup=smTrusted
+syn match smDefine "^P" nextgroup=smMesg
+syn match smTrusted "\S\+$" contained
+syn match smMesg "\S*="he=e-1 contained nextgroup=smPrecedence
+syn match smPrecedence "-\=[0-9]\+" contained
+
+" Header Format H?list-of-mailer-flags?name: format
+syn match smHeaderSep contained "[?:]"
+syn match smHeader "^H\(?[a-zA-Z]\+?\)\=[-a-zA-Z_]\+:" contains=smHeaderSep
+
+" Variables
+syn match smVar "\$[a-z\.\|]"
+
+" Rulesets
+syn match smRuleset "^S\d*"
+
+" Rewriting Rules
+syn match smRewrite "^R" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsUser
+
+syn match smRewriteLhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsSep
+syn match smRewriteLhsToken contained "\(\$[-*+]\|\$[-=][A-Za-z]\|\$Y\)\+" skipwhite nextgroup=smRewriteLhsUser,smRewriteLhsSep
+
+syn match smRewriteLhsSep contained "\t\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsUser
+
+syn match smRewriteRhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsSep
+syn match smRewriteRhsToken contained "\(\$\d\|\$>\d\|\$#\|\$@\|\$:[-_a-zA-Z]\+\|\$[[\]]\|\$@\|\$:\|\$[A-Za-z]\)\+" skipwhite nextgroup=smRewriteRhsUser,smRewriteRhsSep
+
+syn match smRewriteRhsSep contained "\t\+" skipwhite nextgroup=smRewriteComment,smRewriteRhsSep
+syn match smRewriteRhsSep contained "$"
+
+syn match smRewriteComment contained "[^\t$]*$"
+
+" Clauses
+syn match smClauseError "\$\."
+syn match smElse contained "\$|"
+syn match smClauseCont contained "^\t"
+syn region smClause matchgroup=Delimiter start="\$?." matchgroup=Delimiter end="\$\." contains=smElse,smClause,smVar,smClauseCont
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_smil_syntax_inits")
+ if version < 508
+ let did_smil_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink smClause Special
+ HiLink smClauseError Error
+ HiLink smComment Comment
+ HiLink smDefine Statement
+ HiLink smElse Delimiter
+ HiLink smHeader Statement
+ HiLink smHeaderSep String
+ HiLink smMesg Special
+ HiLink smPrecedence Number
+ HiLink smRewrite Statement
+ HiLink smRewriteComment Comment
+ HiLink smRewriteLhsToken String
+ HiLink smRewriteLhsUser Statement
+ HiLink smRewriteRhsToken String
+ HiLink smRuleset Preproc
+ HiLink smTrusted Special
+ HiLink smVar String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sm"
+
+" vim: ts=18
diff --git a/runtime/syntax/smarty.vim b/runtime/syntax/smarty.vim
new file mode 100644
index 000000000..6dda366ba
--- /dev/null
+++ b/runtime/syntax/smarty.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" Language: Smarty Templates
+" Maintainer: Manfred Stienstra manfred.stienstra@dwerg.net
+" Last Change: Mon Nov 4 11:42:23 CET 2002
+" Filenames: *.tpl
+" URL: http://www.dwerg.net/projects/vim/smarty.vim
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+endif
+ let main_syntax = 'smarty'
+endif
+
+syn case ignore
+
+runtime! syntax/html.vim
+"syn cluster htmlPreproc add=smartyUnZone
+
+syn match smartyBlock contained "[\[\]]"
+
+syn keyword smartyTagName capture config_load include include_php
+syn keyword smartyTagName insert if elseif else ldelim rdelim literal
+syn keyword smartyTagName php section sectionelse foreach foreachelse
+syn keyword smartyTagName strip assign counter cycle debug eval fetch
+syn keyword smartyTagName html_options html_select_date html_select_time
+syn keyword smartyTagName math popup_init popup html_checkboxes html_image
+syn keyword smartyTagName html_radios html_table mailto textformat
+
+syn keyword smartyModifier cat capitalize count_characters count_paragraphs
+syn keyword smartyModifier count_sentences count_words date_format default
+syn keyword smartyModifier escape indent lower nl2br regex_replace replace
+syn keyword smartyModifier spacify string_format strip strip_tags truncate
+syn keyword smartyModifier upper wordwrap
+
+syn keyword smartyInFunc neq eq
+
+syn keyword smartyProperty contained "file="
+syn keyword smartyProperty contained "loop="
+syn keyword smartyProperty contained "name="
+syn keyword smartyProperty contained "include="
+syn keyword smartyProperty contained "skip="
+syn keyword smartyProperty contained "section="
+
+syn keyword smartyConstant "\$smarty"
+
+syn keyword smartyDot .
+
+syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc, smartyModifier
+
+syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
+syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
+ syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone
+
+
+if version >= 508 || !exists("did_smarty_syn_inits")
+ if version < 508
+ let did_smarty_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink smartyTagName Identifier
+ HiLink smartyProperty Constant
+ " if you want the text inside the braces to be colored, then
+ " remove the comment in from of the next statement
+ "HiLink smartyZone Include
+ HiLink smartyInFunc Function
+ HiLink smartyBlock Constant
+ HiLink smartyDot SpecialChar
+ HiLink smartyModifier Function
+ delcommand HiLink
+endif
+
+let b:current_syntax = "smarty"
+
+if main_syntax == 'smarty'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/smil.vim b/runtime/syntax/smil.vim
new file mode 100644
index 000000000..0b53d8ec3
--- /dev/null
+++ b/runtime/syntax/smil.vim
@@ -0,0 +1,154 @@
+" Vim syntax file
+" Language: SMIL (Synchronized Multimedia Integration Language)
+" Maintainer: Herve Foucher <Herve.Foucher@helio.org>
+" URL: http://www.helio.org/vim/syntax/smil.vim
+" Last Change: 2003 May 11
+
+" To learn more about SMIL, please refer to http://www.w3.org/AudioVideo/
+" and to http://www.helio.org/products/smil/tutorial/
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" SMIL is case sensitive
+syn case match
+
+" illegal characters
+syn match smilError "[<>&]"
+syn match smilError "[()&]"
+
+if !exists("main_syntax")
+ let main_syntax = 'smil'
+endif
+
+" tags
+syn match smilSpecial contained "\\\d\d\d\|\\."
+syn match smilSpecial contained "("
+syn match smilSpecial contained "id("
+syn match smilSpecial contained ")"
+syn keyword smilSpecial contained remove freeze true false on off overdub caption new pause replace
+syn keyword smilSpecial contained first last
+syn keyword smilSpecial contained fill meet slice scroll hidden
+syn region smilString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=smilSpecial
+syn region smilString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=smilSpecial
+syn match smilValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1
+syn region smilEndTag start=+</+ end=+>+ contains=smilTagN,smilTagError
+syn region smilTag start=+<[^/]+ end=+>+ contains=smilTagN,smilString,smilArg,smilValue,smilTagError,smilEvent,smilCssDefinition
+syn match smilTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=smilTagName,smilSpecialTagName
+syn match smilTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=smilTagName,smilSpecialTagName
+syn match smilTagError contained "[^>]<"ms=s+1
+
+" tag names
+syn keyword smilTagName contained smil head body anchor a switch region layout meta
+syn match smilTagName contained "root-layout"
+syn keyword smilTagName contained par seq
+syn keyword smilTagName contained animation video img audio ref text textstream
+syn match smilTagName contained "\<\(head\|body\)\>"
+
+
+" legal arg names
+syn keyword smilArg contained dur begin end href target id coords show title abstract author copyright alt
+syn keyword smilArg contained left top width height fit src name content fill longdesc repeat type
+syn match smilArg contained "z-index"
+syn match smilArg contained " end-sync"
+syn match smilArg contained " region"
+syn match smilArg contained "background-color"
+syn match smilArg contained "system-bitrate"
+syn match smilArg contained "system-captions"
+syn match smilArg contained "system-overdub-or-caption"
+syn match smilArg contained "system-language"
+syn match smilArg contained "system-required"
+syn match smilArg contained "system-screen-depth"
+syn match smilArg contained "system-screen-size"
+syn match smilArg contained "clip-begin"
+syn match smilArg contained "clip-end"
+syn match smilArg contained "skip-content"
+
+
+" SMIL Boston ext.
+" This are new SMIL functionnalities seen on www.w3.org on August 3rd 1999
+
+" Animation
+syn keyword smilTagName contained animate set move
+syn keyword smilArg contained calcMode from to by additive values origin path
+syn keyword smilArg contained accumulate hold attribute
+syn match smilArg contained "xml:link"
+syn keyword smilSpecial contained discrete linear spline parent layout
+syn keyword smilSpecial contained top left simple
+
+" Linking
+syn keyword smilTagName contained area
+syn keyword smilArg contained actuate behavior inline sourceVolume
+syn keyword smilArg contained destinationVolume destinationPlaystate tabindex
+syn keyword smilArg contained class style lang dir onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup shape nohref accesskey onfocus onblur
+syn keyword smilSpecial contained play pause stop rect circ poly child par seq
+
+" Media Object
+syn keyword smilTagName contained rtpmap
+syn keyword smilArg contained port transport encoding payload clipBegin clipEnd
+syn match smilArg contained "fmt-list"
+
+" Timing and Synchronization
+syn keyword smilTagName contained excl
+syn keyword smilArg contained beginEvent endEvent eventRestart endSync repeatCount repeatDur
+syn keyword smilArg contained syncBehavior syncTolerance
+syn keyword smilSpecial contained canSlip locked
+
+" special characters
+syn match smilSpecialChar "&[^;]*;"
+
+if exists("smil_wrong_comments")
+ syn region smilComment start=+<!--+ end=+-->+
+else
+ syn region smilComment start=+<!+ end=+>+ contains=smilCommentPart,smilCommentError
+ syn match smilCommentError contained "[^><!]"
+ syn region smilCommentPart contained start=+--+ end=+--+
+endif
+syn region smilComment start=+<!DOCTYPE+ keepend end=+>+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_smil_syntax_inits")
+ if version < 508
+ let did_smil_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink smilTag Function
+ HiLink smilEndTag Identifier
+ HiLink smilArg Type
+ HiLink smilTagName smilStatement
+ HiLink smilSpecialTagName Exception
+ HiLink smilValue Value
+ HiLink smilSpecialChar Special
+
+ HiLink smilSpecial Special
+ HiLink smilSpecialChar Special
+ HiLink smilString String
+ HiLink smilStatement Statement
+ HiLink smilComment Comment
+ HiLink smilCommentPart Comment
+ HiLink smilPreProc PreProc
+ HiLink smilValue String
+ HiLink smilCommentError smilError
+ HiLink smilTagError smilError
+ HiLink smilError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "smil"
+
+if main_syntax == 'smil'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/smith.vim b/runtime/syntax/smith.vim
new file mode 100644
index 000000000..e05ce6968
--- /dev/null
+++ b/runtime/syntax/smith.vim
@@ -0,0 +1,52 @@
+" Vim syntax file
+" Language: SMITH
+" Maintainer: Rafal M. Sulejman <rms@poczta.onet.pl>
+" Last Change: 21.07.2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+
+syn match smithComment ";.*$"
+
+syn match smithNumber "\<[+-]*[0-9]\d*\>"
+
+syn match smithRegister "R[\[]*[0-9]*[\]]*"
+
+syn match smithKeyword "COR\|MOV\|MUL\|NOT\|STOP\|SUB\|NOP\|BLA\|REP"
+
+syn region smithString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_smith_syntax_inits")
+ if version < 508
+ let did_smith_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink smithRegister Identifier
+ HiLink smithKeyword Keyword
+ HiLink smithComment Comment
+ HiLink smithString String
+ HiLink smithNumber Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "smith"
+
+" vim: ts=2
diff --git a/runtime/syntax/sml.vim b/runtime/syntax/sml.vim
new file mode 100644
index 000000000..b3c335b8b
--- /dev/null
+++ b/runtime/syntax/sml.vim
@@ -0,0 +1,230 @@
+" Vim syntax file
+" Language: SML
+" Filenames: *.sml *.sig
+" Maintainers: Markus Mottl <markus@oefai.at>
+" Fabrizio Zeno Cornelli <zeno@filibusta.crema.unimi.it>
+" URL: http://www.ai.univie.ac.at/~markus/vim/syntax/sml.vim
+" Last Change: 2003 May 11
+" 2001 Nov 20 - Fixed small highlighting bug with modules (MM)
+" 2001 Aug 29 - Fixed small highlighting bug (MM)
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" SML is case sensitive.
+syn case match
+
+" lowercase identifier - the standard way to match
+syn match smlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
+
+syn match smlKeyChar "|"
+
+" Errors
+syn match smlBraceErr "}"
+syn match smlBrackErr "\]"
+syn match smlParenErr ")"
+syn match smlCommentErr "\*)"
+syn match smlThenErr "\<then\>"
+
+" Error-highlighting of "end" without synchronization:
+" as keyword or as error (default)
+if exists("sml_noend_error")
+ syn match smlKeyword "\<end\>"
+else
+ syn match smlEndErr "\<end\>"
+endif
+
+" Some convenient clusters
+syn cluster smlAllErrs contains=smlBraceErr,smlBrackErr,smlParenErr,smlCommentErr,smlEndErr,smlThenErr
+
+syn cluster smlAENoParen contains=smlBraceErr,smlBrackErr,smlCommentErr,smlEndErr,smlThenErr
+
+syn cluster smlContained contains=smlTodo,smlPreDef,smlModParam,smlModParam1,smlPreMPRestr,smlMPRestr,smlMPRestr1,smlMPRestr2,smlMPRestr3,smlModRHS,smlFuncWith,smlFuncStruct,smlModTypeRestr,smlModTRWith,smlWith,smlWithRest,smlModType,smlFullMod
+
+
+" Enclosing delimiters
+syn region smlEncl transparent matchgroup=smlKeyword start="(" matchgroup=smlKeyword end=")" contains=ALLBUT,@smlContained,smlParenErr
+syn region smlEncl transparent matchgroup=smlKeyword start="{" matchgroup=smlKeyword end="}" contains=ALLBUT,@smlContained,smlBraceErr
+syn region smlEncl transparent matchgroup=smlKeyword start="\[" matchgroup=smlKeyword end="\]" contains=ALLBUT,@smlContained,smlBrackErr
+syn region smlEncl transparent matchgroup=smlKeyword start="#\[" matchgroup=smlKeyword end="\]" contains=ALLBUT,@smlContained,smlBrackErr
+
+
+" Comments
+syn region smlComment start="(\*" end="\*)" contains=smlComment,smlTodo
+syn keyword smlTodo contained TODO FIXME XXX
+
+
+" let
+syn region smlEnd matchgroup=smlKeyword start="\<let\>" matchgroup=smlKeyword end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+" local
+syn region smlEnd matchgroup=smlKeyword start="\<local\>" matchgroup=smlKeyword end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+" abstype
+syn region smlNone matchgroup=smlKeyword start="\<abstype\>" matchgroup=smlKeyword end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+" begin
+syn region smlEnd matchgroup=smlKeyword start="\<begin\>" matchgroup=smlKeyword end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+" if
+syn region smlNone matchgroup=smlKeyword start="\<if\>" matchgroup=smlKeyword end="\<then\>" contains=ALLBUT,@smlContained,smlThenErr
+
+
+"" Modules
+
+" "struct"
+syn region smlStruct matchgroup=smlModule start="\<struct\>" matchgroup=smlModule end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+" "sig"
+syn region smlSig matchgroup=smlModule start="\<sig\>" matchgroup=smlModule end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr,smlModule
+syn region smlModSpec matchgroup=smlKeyword start="\<structure\>" matchgroup=smlModule end="\<\u\(\w\|'\)*\>" contained contains=@smlAllErrs,smlComment skipwhite skipempty nextgroup=smlModTRWith,smlMPRestr
+
+" "open"
+syn region smlNone matchgroup=smlKeyword start="\<open\>" matchgroup=smlModule end="\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*\>" contains=@smlAllErrs,smlComment
+
+" "structure" - somewhat complicated stuff ;-)
+syn region smlModule matchgroup=smlKeyword start="\<\(structure\|functor\)\>" matchgroup=smlModule end="\<\u\(\w\|'\)*\>" contains=@smlAllErrs,smlComment skipwhite skipempty nextgroup=smlPreDef
+syn region smlPreDef start="."me=e-1 matchgroup=smlKeyword end="\l\|="me=e-1 contained contains=@smlAllErrs,smlComment,smlModParam,smlModTypeRestr,smlModTRWith nextgroup=smlModPreRHS
+syn region smlModParam start="([^*]" end=")" contained contains=@smlAENoParen,smlModParam1
+syn match smlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=smlPreMPRestr
+
+syn region smlPreMPRestr start="."me=e-1 end=")"me=e-1 contained contains=@smlAllErrs,smlComment,smlMPRestr,smlModTypeRestr
+
+syn region smlMPRestr start=":" end="."me=e-1 contained contains=@smlComment skipwhite skipempty nextgroup=smlMPRestr1,smlMPRestr2,smlMPRestr3
+syn region smlMPRestr1 matchgroup=smlModule start="\ssig\s\=" matchgroup=smlModule end="\<end\>" contained contains=ALLBUT,@smlContained,smlEndErr,smlModule
+syn region smlMPRestr2 start="\sfunctor\(\s\|(\)\="me=e-1 matchgroup=smlKeyword end="->" contained contains=@smlAllErrs,smlComment,smlModParam skipwhite skipempty nextgroup=smlFuncWith
+syn match smlMPRestr3 "\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*" contained
+syn match smlModPreRHS "=" contained skipwhite skipempty nextgroup=smlModParam,smlFullMod
+syn region smlModRHS start="." end=".\w\|([^*]"me=e-2 contained contains=smlComment skipwhite skipempty nextgroup=smlModParam,smlFullMod
+syn match smlFullMod "\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=smlFuncWith
+
+syn region smlFuncWith start="([^*]"me=e-1 end=")" contained contains=smlComment,smlWith,smlFuncStruct
+syn region smlFuncStruct matchgroup=smlModule start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=smlModule end="\<end\>" contains=ALLBUT,@smlContained,smlEndErr
+
+syn match smlModTypeRestr "\<\w\(\w\|'\)*\(\.\w\(\w\|'\)*\)*\>" contained
+syn region smlModTRWith start=":\s*("hs=s+1 end=")" contained contains=@smlAENoParen,smlWith
+syn match smlWith "\<\(\u\(\w\|'\)*\.\)*\w\(\w\|'\)*\>" contained skipwhite skipempty nextgroup=smlWithRest
+syn region smlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,@smlContained
+
+" "signature"
+syn region smlKeyword start="\<signature\>" matchgroup=smlModule end="\<\w\(\w\|'\)*\>" contains=smlComment skipwhite skipempty nextgroup=smlMTDef
+syn match smlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s
+
+syn keyword smlKeyword and andalso case
+syn keyword smlKeyword datatype else eqtype
+syn keyword smlKeyword exception fn fun handle
+syn keyword smlKeyword in infix infixl infixr
+syn keyword smlKeyword match nonfix of orelse
+syn keyword smlKeyword raise handle type
+syn keyword smlKeyword val where while with withtype
+
+syn keyword smlType bool char exn int list option
+syn keyword smlType real string unit
+
+syn keyword smlOperator div mod not or quot rem
+
+syn keyword smlBoolean true false
+syn match smlConstructor "(\s*)"
+syn match smlConstructor "\[\s*\]"
+syn match smlConstructor "#\[\s*\]"
+syn match smlConstructor "\u\(\w\|'\)*\>"
+
+" Module prefix
+syn match smlModPath "\u\(\w\|'\)*\."he=e-1
+
+syn match smlCharacter +#"."\|#"\\\d\d\d"+
+syn match smlCharErr +#"\\\d\d"\|#"\\\d"+
+syn region smlString start=+"+ skip=+\\\\\|\\"+ end=+"+
+
+syn match smlFunDef "=>"
+syn match smlRefAssign ":="
+syn match smlTopStop ";;"
+syn match smlOperator "\^"
+syn match smlOperator "::"
+syn match smlAnyVar "\<_\>"
+syn match smlKeyChar "!"
+syn match smlKeyChar ";"
+syn match smlKeyChar "\*"
+syn match smlKeyChar "="
+
+syn match smlNumber "\<-\=\d\+\>"
+syn match smlNumber "\<-\=0[x|X]\x\+\>"
+syn match smlReal "\<-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=[fl]\=\>"
+
+" Synchronization
+syn sync minlines=20
+syn sync maxlines=500
+
+syn sync match smlEndSync grouphere smlEnd "\<begin\>"
+syn sync match smlEndSync groupthere smlEnd "\<end\>"
+syn sync match smlStructSync grouphere smlStruct "\<struct\>"
+syn sync match smlStructSync groupthere smlStruct "\<end\>"
+syn sync match smlSigSync grouphere smlSig "\<sig\>"
+syn sync match smlSigSync groupthere smlSig "\<end\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sml_syntax_inits")
+ if version < 508
+ let did_sml_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink smlBraceErr Error
+ HiLink smlBrackErr Error
+ HiLink smlParenErr Error
+
+ HiLink smlCommentErr Error
+
+ HiLink smlEndErr Error
+ HiLink smlThenErr Error
+
+ HiLink smlCharErr Error
+
+ HiLink smlComment Comment
+
+ HiLink smlModPath Include
+ HiLink smlModule Include
+ HiLink smlModParam1 Include
+ HiLink smlModType Include
+ HiLink smlMPRestr3 Include
+ HiLink smlFullMod Include
+ HiLink smlModTypeRestr Include
+ HiLink smlWith Include
+ HiLink smlMTDef Include
+
+ HiLink smlConstructor Constant
+
+ HiLink smlModPreRHS Keyword
+ HiLink smlMPRestr2 Keyword
+ HiLink smlKeyword Keyword
+ HiLink smlFunDef Keyword
+ HiLink smlRefAssign Keyword
+ HiLink smlKeyChar Keyword
+ HiLink smlAnyVar Keyword
+ HiLink smlTopStop Keyword
+ HiLink smlOperator Keyword
+
+ HiLink smlBoolean Boolean
+ HiLink smlCharacter Character
+ HiLink smlNumber Number
+ HiLink smlReal Float
+ HiLink smlString String
+ HiLink smlType Type
+ HiLink smlTodo Todo
+ HiLink smlEncl Keyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sml"
+
+" vim: ts=8
diff --git a/runtime/syntax/snnsnet.vim b/runtime/syntax/snnsnet.vim
new file mode 100644
index 000000000..6b24de563
--- /dev/null
+++ b/runtime/syntax/snnsnet.vim
@@ -0,0 +1,77 @@
+" Vim syntax file
+" Language: SNNS network file
+" Maintainer: Davide Alberani <alberanid@bigfoot.com>
+" Last Change: 28 Apr 2001
+" Version: 0.2
+" URL: http://digilander.iol.it/alberanid/vim/syntax/snnsnet.vim
+"
+" SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/
+" is a simulator for neural networks.
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match snnsnetTitle "no\."
+syn match snnsnetTitle "type name"
+syn match snnsnetTitle "unit name"
+syn match snnsnetTitle "act\( func\)\="
+syn match snnsnetTitle "out func"
+syn match snnsnetTitle "site\( name\)\="
+syn match snnsnetTitle "site function"
+syn match snnsnetTitle "source:weight"
+syn match snnsnetTitle "unitNo\."
+syn match snnsnetTitle "delta x"
+syn match snnsnetTitle "delta y"
+syn keyword snnsnetTitle typeName unitName bias st position subnet layer sites name target z LLN LUN Toff Soff Ctype
+
+syn match snnsnetType "SNNS network definition file [Vv]\d.\d.*" contains=snnsnetNumbers
+syn match snnsnetType "generated at.*" contains=snnsnetNumbers
+syn match snnsnetType "network name\s*:"
+syn match snnsnetType "source files\s*:"
+syn match snnsnetType "no\. of units\s*:.*" contains=snnsnetNumbers
+syn match snnsnetType "no\. of connections\s*:.*" contains=snnsnetNumbers
+syn match snnsnetType "no\. of unit types\s*:.*" contains=snnsnetNumbers
+syn match snnsnetType "no\. of site types\s*:.*" contains=snnsnetNumbers
+syn match snnsnetType "learning function\s*:"
+syn match snnsnetType "pruning function\s*:"
+syn match snnsnetType "subordinate learning function\s*:"
+syn match snnsnetType "update function\s*:"
+
+syn match snnsnetSection "unit definition section"
+syn match snnsnetSection "unit default section"
+syn match snnsnetSection "site definition section"
+syn match snnsnetSection "type definition section"
+syn match snnsnetSection "connection definition section"
+syn match snnsnetSection "layer definition section"
+syn match snnsnetSection "subnet definition section"
+syn match snnsnetSection "3D translation section"
+syn match snnsnetSection "time delay section"
+
+syn match snnsnetNumbers "\d" contained
+syn match snnsnetComment "#.*$" contains=snnsnetTodo
+syn keyword snnsnetTodo TODO XXX FIXME contained
+
+if version >= 508 || !exists("did_snnsnet_syn_inits")
+ if version < 508
+ let did_snnsnet_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink snnsnetType Type
+ HiLink snnsnetComment Comment
+ HiLink snnsnetNumbers Number
+ HiLink snnsnetSection Statement
+ HiLink snnsnetTitle Label
+ HiLink snnsnetTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "snnsnet"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/snnspat.vim b/runtime/syntax/snnspat.vim
new file mode 100644
index 000000000..3c07fad16
--- /dev/null
+++ b/runtime/syntax/snnspat.vim
@@ -0,0 +1,68 @@
+" Vim syntax file
+" Language: SNNS pattern file
+" Maintainer: Davide Alberani <alberanid@bigfoot.com>
+" Last Change: 28 Apr 2001
+" Version: 0.2
+" URL: http://digilander.iol.it/alberanid/vim/syntax/snnspat.vim
+"
+" SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/
+" is a simulator for neural networks.
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" anything that isn't part of the header, a comment or a number
+" is wrong
+syn match snnspatError ".*"
+" hoping that matches any kind of notation...
+syn match snnspatAccepted "\([-+]\=\(\d\+\.\|\.\)\=\d\+\([Ee][-+]\=\d\+\)\=\)"
+syn match snnspatAccepted "\s"
+syn match snnspatBrac "\[\s*\d\+\(\s\|\d\)*\]" contains=snnspatNumbers
+
+" the accepted fields in the header
+syn match snnspatNoHeader "No\. of patterns\s*:\s*" contained
+syn match snnspatNoHeader "No\. of input units\s*:\s*" contained
+syn match snnspatNoHeader "No\. of output units\s*:\s*" contained
+syn match snnspatNoHeader "No\. of variable input dimensions\s*:\s*" contained
+syn match snnspatNoHeader "No\. of variable output dimensions\s*:\s*" contained
+syn match snnspatNoHeader "Maximum input dimensions\s*:\s*" contained
+syn match snnspatNoHeader "Maximum output dimensions\s*:\s*" contained
+syn match snnspatGen "generated at.*" contained contains=snnspatNumbers
+syn match snnspatGen "SNNS pattern definition file [Vv]\d\.\d" contained contains=snnspatNumbers
+
+" the header, what is not an accepted field, is an error
+syn region snnspatHeader start="^SNNS" end="^\s*[-+\.]\=[0-9#]"me=e-2 contains=snnspatNoHeader,snnspatNumbers,snnspatGen,snnspatBrac
+
+" numbers inside the header
+syn match snnspatNumbers "\d" contained
+syn match snnspatComment "#.*$" contains=snnspatTodo
+syn keyword snnspatTodo TODO XXX FIXME contained
+
+if version >= 508 || !exists("did_snnspat_syn_inits")
+ if version < 508
+ let did_snnspat_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink snnspatGen Statement
+ HiLink snnspatHeader Error
+ HiLink snnspatNoHeader Define
+ HiLink snnspatNumbers Number
+ HiLink snnspatComment Comment
+ HiLink snnspatError Error
+ HiLink snnspatTodo Todo
+ HiLink snnspatAccepted NONE
+ HiLink snnspatBrac NONE
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "snnspat"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/snnsres.vim b/runtime/syntax/snnsres.vim
new file mode 100644
index 000000000..4c1d59600
--- /dev/null
+++ b/runtime/syntax/snnsres.vim
@@ -0,0 +1,60 @@
+" Vim syntax file
+" Language: SNNS result file
+" Maintainer: Davide Alberani <alberanid@bigfoot.com>
+" Last Change: 28 Apr 2001
+" Version: 0.2
+" URL: http://digilander.iol.it/alberanid/vim/syntax/snnsres.vim
+"
+" SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/
+" is a simulator for neural networks.
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" the accepted fields in the header
+syn match snnsresNoHeader "No\. of patterns\s*:\s*" contained
+syn match snnsresNoHeader "No\. of input units\s*:\s*" contained
+syn match snnsresNoHeader "No\. of output units\s*:\s*" contained
+syn match snnsresNoHeader "No\. of variable input dimensions\s*:\s*" contained
+syn match snnsresNoHeader "No\. of variable output dimensions\s*:\s*" contained
+syn match snnsresNoHeader "Maximum input dimensions\s*:\s*" contained
+syn match snnsresNoHeader "Maximum output dimensions\s*:\s*" contained
+syn match snnsresNoHeader "startpattern\s*:\s*" contained
+syn match snnsresNoHeader "endpattern\s*:\s*" contained
+syn match snnsresNoHeader "input patterns included" contained
+syn match snnsresNoHeader "teaching output included" contained
+syn match snnsresGen "generated at.*" contained contains=snnsresNumbers
+syn match snnsresGen "SNNS result file [Vv]\d\.\d" contained contains=snnsresNumbers
+
+" the header, what is not an accepted field, is an error
+syn region snnsresHeader start="^SNNS" end="^\s*[-+\.]\=[0-9#]"me=e-2 contains=snnsresNoHeader,snnsresNumbers,snnsresGen
+
+" numbers inside the header
+syn match snnsresNumbers "\d" contained
+syn match snnsresComment "#.*$" contains=snnsresTodo
+syn keyword snnsresTodo TODO XXX FIXME contained
+
+if version >= 508 || !exists("did_snnsres_syn_inits")
+ if version < 508
+ let did_snnsres_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink snnsresGen Statement
+ HiLink snnsresHeader Statement
+ HiLink snnsresNoHeader Define
+ HiLink snnsresNumbers Number
+ HiLink snnsresComment Comment
+ HiLink snnsresTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "snnsres"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/snobol4.vim b/runtime/syntax/snobol4.vim
new file mode 100644
index 000000000..d5475e5e7
--- /dev/null
+++ b/runtime/syntax/snobol4.vim
@@ -0,0 +1,93 @@
+" Vim syntax file
+" Language: SNOBOL4
+" Maintainer: Rafal Sulejman <rms@poczta.onet.pl>
+" Last change: 2004 May 16
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+" Vanilla Snobol4 keywords
+syn keyword snobol4Keywoard any apply arb arbno arg array
+syn keyword snobol4Keywoard break
+syn keyword snobol4Keywoard char clear code collect convert copy
+syn keyword snobol4Keywoard data datatype date define detach differ dump dupl
+syn keyword snobol4Keywoard endfile eq eval
+syn keyword snobol4Keywoard field
+syn keyword snobol4Keywoard ge gt ident
+syn keyword snobol4Keywoard input integer item
+syn keyword snobol4Keywoard le len lgt local lpad lt
+syn keyword snobol4Keywoard ne notany
+syn keyword snobol4Keywoard opsyn output
+syn keyword snobol4Keywoard pos prototype
+syn keyword snobol4Keywoard remdr replace rpad rpos rtab
+syn keyword snobol4Keywoard size span stoptr
+syn keyword snobol4Keywoard tab table time trace trim
+syn keyword snobol4Keywoard unload
+syn keyword snobol4Keywoard value
+" Spitbol keywords
+" CSNOBOL keywords
+syn keyword snobol4Keywoard sset
+
+syn region snobol4String matchgroup=Quote start=+"+ skip=+\\"+ end=+"+
+syn region snobol4String matchgroup=Quote start=+'+ skip=+\\'+ end=+'+
+syn match snobol4Label "^[^- \t][^ \t]*"
+syn match snobol4Statement "^-[^ ][^ ]*"
+syn match snobol4Comment "^*.*$"
+syn match Constant "\.[a-z][a-z0-9\-]*"
+"syn match snobol4Label ":\([sf]*([^)]*)\)*" contains=ALLBUT,snobol4ParenError
+syn region snobol4Label start=":(" end=")" contains=ALLBUT,snobol4ParenError
+syn region snobol4Label start=":f(" end=")" contains=ALLBUT,snobol4ParenError
+syn region snobol4Label start=":s(" end=")" contains=ALLBUT,snobol4ParenError
+syn match snobol4Number "\<\d*\(\.\d\d*\)*\>"
+" Parens matching
+syn cluster snobol4ParenGroup contains=snobol4ParenError
+syn region snobol4Paren transparent start='(' end=')' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInBracket
+syn match snobol4ParenError display "[\])]"
+syn match snobol4ErrInParen display contained "[\]{}]\|<%\|%>"
+syn region snobol4Bracket transparent start='\[\|<:' end=']\|:>' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInParen
+syn match snobol4ErrInBracket display contained "[);{}]\|<%\|%>"
+
+" optional shell shebang line
+syn match snobol4Comment "^\#\!.*$"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_snobol4_syntax_inits")
+ if version < 508
+ let did_snobol4_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink snobol4Label Label
+ HiLink snobol4Conditional Conditional
+ HiLink snobol4Repeat Repeat
+ HiLink snobol4Number Number
+ HiLink snobol4Error Error
+ HiLink snobol4Statement PreProc
+ HiLink snobol4String String
+ HiLink snobol4Comment Comment
+ HiLink snobol4Special Special
+ HiLink snobol4Todo Todo
+ HiLink snobol4Keyword Statement
+ HiLink snobol4Function Statement
+ HiLink snobol4Keyword Keyword
+ HiLink snobol4MathsOperator Operator
+ HiLink snobol4ParenError snobol4Error
+ HiLink snobol4ErrInParen snobol4Error
+ HiLink snobol4ErrInBracket snobol4Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "snobol4"
+" vim: ts=8
diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim
new file mode 100644
index 000000000..fafb2d4af
--- /dev/null
+++ b/runtime/syntax/spec.vim
@@ -0,0 +1,236 @@
+" Filename: spec.vim
+" Purpose: Vim syntax file
+" Language: SPEC: Build/install scripts for Linux RPM packages
+" Maintainer: Donovan Rebbechi elflord@pegasus.rutgers.edu
+" URL: http://pegasus.rutgers.edu/~elflord/vim/syntax/spec.vim
+" Last Change: Tue Oct 3 17:35:15 BRST 2000 <aurelio@conectiva.com.br>
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn sync minlines=1000
+
+syn match specSpecialChar contained '[][!$()\\|>^;:{}]'
+syn match specColon contained ':'
+syn match specPercent contained '%'
+
+syn match specVariables contained '\$\h\w*' contains=specSpecialVariablesNames,specSpecialChar
+syn match specVariables contained '\${\w*}' contains=specSpecialVariablesNames,specSpecialChar
+
+syn match specMacroIdentifier contained '%\h\w*' contains=specMacroNameLocal,specMacroNameOther,specPercent
+syn match specMacroIdentifier contained '%{\w*}' contains=specMacroNameLocal,specMacroNameOther,specPercent,specSpecialChar
+
+syn match specSpecialVariables contained '\$[0-9]\|\${[0-9]}'
+syn match specCommandOpts contained '\s\(-\w\+\|--\w[a-zA-Z_-]\+\)'ms=s+1
+syn match specComment '^\s*#.*$'
+
+
+syn case match
+
+
+"matches with no highlight
+syn match specNoNumberHilite 'X11\|X11R6\|[a-zA-Z]*\.\d\|[a-zA-Z][-/]\d'
+syn match specManpageFile '[a-zA-Z]\.1'
+
+"Day, Month and most used license acronyms
+syn keyword specLicense contained GPL LGPL BSD MIT GNU
+syn keyword specWeekday contained Mon Tue Wed Thu Fri Sat Sun
+syn keyword specMonth contained Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec
+syn keyword specMonth contained January February March April May June July August September October November December
+
+"#, @, www
+syn match specNumber '\(^-\=\|[ \t]-\=\|-\)[0-9.-]*[0-9]'
+syn match specEmail contained "<\=\<[A-Za-z0-9_.-]\+@\([A-Za-z0-9_-]\+\.\)\+[A-Za-z]\+\>>\="
+syn match specURL contained '\<\(\(https\{0,1}\|ftp\)://\|\(www[23]\{0,1}\.\|ftp\.\)\)[A-Za-z0-9._/~:,#-]\+\>'
+syn match specURLMacro contained '\<\(\(https\{0,1}\|ftp\)://\|\(www[23]\{0,1}\.\|ftp\.\)\)[A-Za-z0-9._/~:,#%{}-]\+\>' contains=specMacroIdentifier
+
+"TODO take specSpecialVariables out of the cluster for the sh* contains (ALLBUT)
+"Special system directories
+syn match specListedFilesPrefix contained '/\(usr\|local\|opt\|X11R6\|X11\)/'me=e-1
+syn match specListedFilesBin contained '/s\=bin/'me=e-1
+syn match specListedFilesLib contained '/\(lib\|include\)/'me=e-1
+syn match specListedFilesDoc contained '/\(man\d*\|doc\|info\)\>'
+syn match specListedFilesEtc contained '/etc/'me=e-1
+syn match specListedFilesShare contained '/share/'me=e-1
+syn cluster specListedFiles contains=specListedFilesBin,specListedFilesLib,specListedFilesDoc,specListedFilesEtc,specListedFilesShare,specListedFilesPrefix,specVariables,specSpecialChar
+
+"specComands
+syn match specConfigure contained '\./configure'
+syn match specTarCommand contained '\<tar\s\+[cxvpzIf]\{,5}\s*'
+syn keyword specCommandSpecial contained root
+syn keyword specCommand contained make xmkmf mkdir chmod ln find sed rm strip moc echo grep ls rm mv mkdir install cp pwd cat tail then else elif cd gzip rmdir ln eval export touch
+syn cluster specCommands contains=specCommand,specTarCommand,specConfigure,specCommandSpecial
+
+"frequently used rpm env vars
+syn keyword specSpecialVariablesNames contained RPM_BUILD_ROOT RPM_BUILD_DIR RPM_SOURCE_DIR RPM_OPT_FLAGS LDFLAGS CC CC_FLAGS CPPNAME CFLAGS CXX CXXFLAGS CPPFLAGS
+
+"valid macro names from /usr/lib/rpm/macros
+syn keyword specMacroNameOther contained buildroot buildsubdir distribution disturl ix86 name nil optflags perl_sitearch release requires_eq vendor version
+syn match specMacroNameOther contained '\<\(PATCH\|SOURCE\)\d*\>'
+
+"valid _macro names from /usr/lib/rpm/macros
+syn keyword specMacroNameLocal contained _arch _binary_payload _bindir _build _build_alias _build_cpu _builddir _build_os _buildshell _buildsubdir _build_vendor _bzip2bin _datadir _dbpath _dbpath_rebuild _defaultdocdir _docdir _excludedocs _exec_prefix _fixgroup _fixowner _fixperms _ftpport _ftpproxy _gpg_path _gzipbin _host _host_alias _host_cpu _host_os _host_vendor _httpport _httpproxy _includedir _infodir _install_langs _install_script_path _instchangelog _langpatt _lib _libdir _libexecdir _localstatedir _mandir _netsharedpath _oldincludedir _os _pgpbin _pgp_path _prefix _preScriptEnvironment _provides _rpmdir _rpmfilename _sbindir _sharedstatedir _signature _sourcedir _source_payload _specdir _srcrpmdir _sysconfdir _target _target_alias _target_cpu _target_os _target_platform _target_vendor _timecheck _tmppath _topdir _usr _usrsrc _var _vendor
+
+
+"------------------------------------------------------------------------------
+" here's is all the spec sections definitions: PreAmble, Description, Package,
+" Scripts, Files and Changelog
+
+"One line macros - valid in all ScriptAreas
+"tip: remember do include new itens on specScriptArea's skip section
+syn region specSectionMacroArea oneline matchgroup=specSectionMacro start='^%\(define\|patch\d*\|setup\|configure\|GNUconfigure\|find_lang\|makeinstall\)\>' end='$' contains=specCommandOpts,specMacroIdentifier
+syn region specSectionMacroBracketArea oneline matchgroup=specSectionMacro start='^%{\(configure\|GNUconfigure\|find_lang\|makeinstall\)}' end='$' contains=specCommandOpts,specMacroIdentifier
+
+"%% Files Section %%
+"TODO %config valid parameters: missingok\|noreplace
+"TODO %verify valid parameters: \(not\)\= \(md5\|atime\|...\)
+syn region specFilesArea matchgroup=specSection start='^%[Ff][Ii][Ll][Ee][Ss]\>' skip='%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|verify\|ghost\)\>' end='^%[a-zA-Z]'me=e-2 contains=specFilesOpts,specFilesDirective,@specListedFiles,specComment,specCommandSpecial,specMacroIdentifier
+"tip: remember to include new itens in specFilesArea above
+syn match specFilesDirective contained '%\(attrib\|defattr\|attr\|dir\|config\|docdir\|doc\|lang\|verify\|ghost\)\>'
+
+"valid options for certain section headers
+syn match specDescriptionOpts contained '\s-[ln]\s*\a'ms=s+1,me=e-1
+syn match specPackageOpts contained '\s-n\s*\w'ms=s+1,me=e-1
+syn match specFilesOpts contained '\s-f\s*\w'ms=s+1,me=e-1
+
+
+syn case ignore
+
+
+"%% PreAmble Section %%
+"Copyright and Serial were deprecated by License and Epoch
+syn region specPreAmbleDeprecated oneline matchgroup=specError start='^\(Copyright\|Serial\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier
+syn region specPreAmble oneline matchgroup=specCommand start='^\(Prereq\|Summary\|Name\|Version\|Packager\|Requires\|Icon\|URL\|Source\d*\|Patch\d*\|Prefix\|Packager\|Group\|License\|Release\|BuildRoot\|Distribution\|Vendor\|Provides\|ExclusiveArch\|ExcludeArch\|ExclusiveOS\|Obsoletes\|BuildArch\|BuildArchitectures\|BuildRequires\|BuildConflicts\|BuildPreReq\|Conflicts\|AutoRequires\|AutoReq\|AutoReqProv\|AutoProv\|Epoch\)' end='$' contains=specEmail,specURL,specURLMacro,specLicense,specColon,specVariables,specSpecialChar,specMacroIdentifier
+
+"%% Description Section %%
+syn region specDescriptionArea matchgroup=specSection start='^%description' end='^%'me=e-1 contains=specDescriptionOpts,specEmail,specURL,specNumber,specMacroIdentifier,specComment
+
+"%% Package Section %%
+syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment
+
+"%% Scripts Section %%
+syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|pre\|postun\|preun\|post\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|find_lang\|makeinstall\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
+
+"%% Changelog Section %%
+syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense
+
+
+
+"------------------------------------------------------------------------------
+"here's the shell syntax for all the Script Sections
+
+
+syn case match
+
+
+"sh-like comment stile, only valid in script part
+syn match shComment contained '#.*$'
+
+syn region shQuote1 contained matchgroup=shQuoteDelim start=+'+ skip=+\\'+ end=+'+ contains=specMacroIdentifier
+syn region shQuote2 contained matchgroup=shQuoteDelim start=+"+ skip=+\\"+ end=+"+ contains=specVariables,specMacroIdentifier
+
+syn match shOperator contained '[><|!&;]\|[!=]='
+syn region shDo transparent matchgroup=specBlock start="\<do\>" end="\<done\>" contains=ALLBUT,shFunction,shDoError,shCase,specPreAmble,@specListedFiles
+
+syn region specIf matchgroup=specBlock start="%ifosf\|%ifos\|%ifnos\|%ifarch\|%ifnarch\|%else" end='%endif' contains=ALLBUT, specIfError, shCase
+
+syn region shIf transparent matchgroup=specBlock start="\<if\>" end="\<fi\>" contains=ALLBUT,shFunction,shIfError,shCase,@specListedFiles
+
+syn region shFor matchgroup=specBlock start="\<for\>" end="\<in\>" contains=ALLBUT,shFunction,shInError,shCase,@specListedFiles
+
+syn region shCaseEsac transparent matchgroup=specBlock start="\<case\>" matchgroup=NONE end="\<in\>"me=s-1 contains=ALLBUT,shFunction,shCaseError,@specListedFiles nextgroup=shCaseEsac
+syn region shCaseEsac matchgroup=specBlock start="\<in\>" end="\<esac\>" contains=ALLBUT,shFunction,shCaseError,@specListedFilesBin
+syn region shCase matchgroup=specBlock contained start=")" end=";;" contains=ALLBUT,shFunction,shCaseError,shCase,@specListedFiles
+
+syn sync match shDoSync grouphere shDo "\<do\>"
+syn sync match shDoSync groupthere shDo "\<done\>"
+syn sync match shIfSync grouphere shIf "\<if\>"
+syn sync match shIfSync groupthere shIf "\<fi\>"
+syn sync match specIfSync grouphere specIf "%ifarch\|%ifos\|%ifnos"
+syn sync match specIfSync groupthere specIf "%endIf"
+syn sync match shForSync grouphere shFor "\<for\>"
+syn sync match shForSync groupthere shFor "\<in\>"
+syn sync match shCaseEsacSync grouphere shCaseEsac "\<case\>"
+syn sync match shCaseEsacSync groupthere shCaseEsac "\<esac\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_spec_syntax_inits")
+ if version < 508
+ let did_spec_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ "main types color definitions
+ HiLink specSection Structure
+ HiLink specSectionMacro Macro
+ HiLink specWWWlink PreProc
+ HiLink specOpts Operator
+
+ "yes, it's ugly, but white is sooo cool
+ if &background == "dark"
+ hi def specGlobalMacro ctermfg=white
+ else
+ HiLink specGlobalMacro Identifier
+ endif
+
+ "sh colors
+ HiLink shComment Comment
+ HiLink shIf Statement
+ HiLink shOperator Special
+ HiLink shQuote1 String
+ HiLink shQuote2 String
+ HiLink shQuoteDelim Statement
+
+ "spec colors
+ HiLink specBlock Function
+ HiLink specColon Special
+ HiLink specCommand Statement
+ HiLink specCommandOpts specOpts
+ HiLink specCommandSpecial Special
+ HiLink specComment Comment
+ HiLink specConfigure specCommand
+ HiLink specDate String
+ HiLink specDescriptionOpts specOpts
+ HiLink specEmail specWWWlink
+ HiLink specError Error
+ HiLink specFilesDirective specSectionMacro
+ HiLink specFilesOpts specOpts
+ HiLink specLicense String
+ HiLink specMacroNameLocal specGlobalMacro
+ HiLink specMacroNameOther specGlobalMacro
+ HiLink specManpageFile NONE
+ HiLink specMonth specDate
+ HiLink specNoNumberHilite NONE
+ HiLink specNumber Number
+ HiLink specPackageOpts specOpts
+ HiLink specPercent Special
+ HiLink specSpecialChar Special
+ HiLink specSpecialVariables specGlobalMacro
+ HiLink specSpecialVariablesNames specGlobalMacro
+ HiLink specTarCommand specCommand
+ HiLink specURL specWWWlink
+ HiLink specURLMacro specWWWlink
+ HiLink specVariables Identifier
+ HiLink specWeekday specDate
+ HiLink specListedFilesBin Statement
+ HiLink specListedFilesDoc Statement
+ HiLink specListedFilesEtc Statement
+ HiLink specListedFilesLib Statement
+ HiLink specListedFilesPrefix Statement
+ HiLink specListedFilesShare Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "spec"
+
+" vim: ts=8
diff --git a/runtime/syntax/specman.vim b/runtime/syntax/specman.vim
new file mode 100644
index 000000000..3fb77a2af
--- /dev/null
+++ b/runtime/syntax/specman.vim
@@ -0,0 +1,182 @@
+" Vim syntax file
+" Language: SPECMAN E-LANGUAGE
+" Maintainer: Or Freund <or@mobilian.com ;omf@gmx.co.uk; OrMeir@yahoo.com>
+" Last Update: Wed Oct 24 2001
+
+"---------------------------------------------------------
+"| If anyone found an error or fix the parenthesis part |
+"| I will be happy to hear about it |
+"| Thanks Or. |
+"---------------------------------------------------------
+
+" Remove any old syntax stuff hanging around
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword specmanTodo contained TODO todo ToDo FIXME XXX
+
+syn keyword specmanStatement var instance on compute start event expect check that routine
+syn keyword specmanStatement specman is also first only with like
+syn keyword specmanStatement list of all radix hex dec bin ignore illegal
+syn keyword specmanStatement traceable untraceable
+syn keyword specmanStatement cover using count_only trace_only at_least transition item ranges
+syn keyword specmanStatement cross text call task within
+
+syn keyword specmanMethod initialize non_terminal testgroup delayed exit finish
+syn keyword specmanMethod out append print outf appendf
+syn keyword specmanMethod post_generate pre_generate setup_test finalize_test extract_test
+syn keyword specmanMethod init run copy as_a set_config dut_error add clear lock quit
+syn keyword specmanMethod lock unlock release swap quit to_string value stop_run
+syn keyword specmanMethod crc_8 crc_32 crc_32_flip get_config add0 all_indices and_all
+syn keyword specmanMethod apply average count delete exists first_index get_indices
+syn keyword specmanMethod has insert is_a_permutation is_empty key key_exists key_index
+syn keyword specmanMethod last last_index max max_index max_value min min_index
+syn keyword specmanMethod min_value or_all pop pop0 push push0 product resize reverse
+syn keyword specmanMethod sort split sum top top0 unique clear is_all_iterations
+syn keyword specmanMethod get_enclosing_unit hdl_path exec deep_compare deep_compare_physical
+syn keyword specmanMethod pack unpack warning error fatal
+syn match specmanMethod "size()"
+syn keyword specmanPacking packing low high
+syn keyword specmanType locker address
+syn keyword specmanType body code vec chars
+syn keyword specmanType integer real bool int long uint byte bits bit time string
+syn keyword specmanType byte_array external_pointer
+syn keyword specmanBoolean TRUE FALSE
+syn keyword specmanPreCondit #ifdef #ifndef #else
+
+syn keyword specmanConditional choose matches
+syn keyword specmanConditional if then else when try
+
+
+
+syn keyword specmanLabel case casex casez default
+
+syn keyword specmanLogical and or not xor
+
+syn keyword specmanRepeat until repeat while for from to step each do break continue
+syn keyword specmanRepeat before next sequence always -kind network
+syn keyword specmanRepeat index it me in new return result select
+
+syn keyword specmanTemporal cycle sample events forever
+syn keyword specmanTemporal wait change negedge rise fall delay sync sim true detach eventually emit
+
+syn keyword specmanConstant MAX_INT MIN_INT NULL UNDEF
+
+syn keyword specmanDefine define as computed type extend
+syn keyword specmanDefine verilog vhdl variable global sys
+syn keyword specmanStructure struct unit
+syn keyword specmanInclude import
+syn keyword specmanConstraint gen keep keeping soft before
+
+syn keyword specmanSpecial untyped symtab ECHO DOECHO
+syn keyword specmanFile files load module ntv source_ref script read write
+syn keyword specmanFSM initial idle others posedge clock cycles
+
+
+syn match specmanOperator "[&|~><!)(*%@+/=?:;}{,.\^\-\[\]]"
+syn match specmanOperator "+="
+syn match specmanOperator "-="
+syn match specmanOperator "*="
+
+syn match specmanComment "//.*" contains=specmanTodo
+syn match specmanComment "--.*"
+syn region specmanComment start="^'>"hs=s+2 end="^<'"he=e-2
+
+syn match specmanHDL "'[`.a-zA-Z0-9_@\[\]]\+\>'"
+
+
+syn match specmanCompare "=="
+syn match specmanCompare "!==="
+syn match specmanCompare "==="
+syn match specmanCompare "!="
+syn match specmanCompare ">="
+syn match specmanCompare "<="
+syn match specmanNumber "[0-9]:[0-9]"
+syn match specmanNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
+syn match specmanNumber "0[bB]\s*[0-1_xXzZ?]\+\>"
+syn match specmanNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
+syn match specmanNumber "0[oO]\s*[0-9a-fA-F_xXzZ?]\+\>"
+syn match specmanNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
+syn match specmanNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
+syn match specmanNumber "0[xX]\s*[0-9a-fA-F_xXzZ?]\+\>"
+syn match specmanNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
+
+syn region specmanString start=+"+ end=+"+
+
+
+
+"**********************************************************************
+" I took this section from c.vim but I didnt succeded to make it work
+" ANY one who dare jumping to this deep watter is more than welocome!
+"**********************************************************************
+""catch errors caused by wrong parenthesis and brackets
+
+"syn cluster specmanParenGroup contains=specmanParenError
+"" ,specmanNumbera,specmanComment
+"if exists("specman_no_bracket_error")
+"syn region specmanParen transparent start='(' end=')' contains=ALLBUT,@specmanParenGroup
+"syn match specmanParenError ")"
+"syn match specmanErrInParen contained "[{}]"
+"else
+"syn region specmanParen transparent start='(' end=')' contains=ALLBUT,@specmanParenGroup,specmanErrInBracket
+"syn match specmanParenError "[\])]"
+"syn match specmanErrInParen contained "[\]{}]"
+"syn region specmanBracket transparent start='\[' end=']' contains=ALLBUT,@specmanParenGroup,specmanErrInParen
+"syn match specmanErrInBracket contained "[);{}]"
+"endif
+"
+
+"Modify the following as needed. The trade-off is performance versus
+"functionality.
+
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_specman_syn_inits")
+ if version < 508
+ let did_specman_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ " The default methods for highlighting. Can be overridden later
+ HiLink specmanConditional Conditional
+ HiLink specmanConstraint Conditional
+ HiLink specmanRepeat Repeat
+ HiLink specmanString String
+ HiLink specmanComment Comment
+ HiLink specmanConstant Macro
+ HiLink specmanNumber Number
+ HiLink specmanCompare Operator
+ HiLink specmanOperator Operator
+ HiLink specmanLogical Operator
+ HiLink specmanStatement Statement
+ HiLink specmanHDL SpecialChar
+ HiLink specmanMethod Function
+ HiLink specmanInclude Include
+ HiLink specmanStructure Structure
+ HiLink specmanBoolean Boolean
+ HiLink specmanFSM Label
+ HiLink specmanSpecial Special
+ HiLink specmanType Type
+ HiLink specmanTemporal Type
+ HiLink specmanFile Include
+ HiLink specmanPreCondit Include
+ HiLink specmanDefine Typedef
+ HiLink specmanLabel Label
+ HiLink specmanPacking keyword
+ HiLink specmanTodo Todo
+ HiLink specmanParenError Error
+ HiLink specmanErrInParen Error
+ HiLink specmanErrInBracket Error
+ delcommand HiLink
+endif
+
+let b:current_syntax = "specman"
diff --git a/runtime/syntax/spice.vim b/runtime/syntax/spice.vim
new file mode 100644
index 000000000..ee1433ead
--- /dev/null
+++ b/runtime/syntax/spice.vim
@@ -0,0 +1,87 @@
+" Vim syntax file
+" Language: Spice circuit simulator input netlist
+" Maintainer: Noam Halevy <Noam.Halevy.motorola.com>
+" Last Change: 12/08/99
+"
+" This is based on sh.vim by Lennart Schultz
+" but greatly simplified
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" spice syntax is case INsensitive
+syn case ignore
+
+syn keyword spiceTodo contained TODO
+
+syn match spiceComment "^ \=\*.*$"
+syn match spiceComment "\$.*$"
+
+" Numbers, all with engineering suffixes and optional units
+"==========================================================
+"floating point number, with dot, optional exponent
+syn match spiceNumber "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
+"floating point number, starting with a dot, optional exponent
+syn match spiceNumber "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
+"integer number with optional exponent
+syn match spiceNumber "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
+
+" Misc
+"=====
+syn match spiceWrapLineOperator "\\$"
+syn match spiceWrapLineOperator "^+"
+
+syn match spiceStatement "^ \=\.\I\+"
+
+" Matching pairs of parentheses
+"==========================================
+syn region spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError
+syn region spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+
+
+" Errors
+"=======
+syn match spiceParenError ")"
+
+" Syncs
+" =====
+syn sync minlines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_spice_syntax_inits")
+ if version < 508
+ let did_spice_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink spiceTodo Todo
+ HiLink spiceWrapLineOperator spiceOperator
+ HiLink spiceSinglequote spiceExpr
+ HiLink spiceExpr Function
+ HiLink spiceParenError Error
+ HiLink spiceStatement Statement
+ HiLink spiceNumber Number
+ HiLink spiceComment Comment
+ HiLink spiceOperator Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "spice"
+
+" insert the following to $VIM/syntax/scripts.vim
+" to autodetect HSpice netlists and text listing output:
+"
+" " Spice netlists and text listings
+" elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end'
+" so <sfile>:p:h/spice.vim
+
+" vim: ts=8
diff --git a/runtime/syntax/splint.vim b/runtime/syntax/splint.vim
new file mode 100644
index 000000000..2f283809d
--- /dev/null
+++ b/runtime/syntax/splint.vim
@@ -0,0 +1,260 @@
+" Vim syntax file
+" Language: splint (C with lclint/splint Annotations)
+" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+" Splint Home: http://www.splint.org/
+" Last Change: $Date$
+" $Revision$
+
+" Note: Splint annotated files are not detected by default.
+" If you want to use this file for highlighting C code,
+" please make sure splint.vim is sourced instead of c.vim,
+" for example by putting
+" /* vim: set filetype=splint : */
+" at the end of your code or something like
+" au! BufRead,BufNewFile *.c setfiletype splint
+" in your vimrc file or filetype.vim
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ so <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+endif
+
+
+" FIXME: uses and changes several clusters defined in c.vim
+" so watch for changes there
+
+" TODO: make a little more grammar explicit
+" match flags with hyphen and underscore notation
+" match flag expanded forms
+" accept other comment char than @
+
+syn case match
+" splint annotations (taken from 'splint -help annotations')
+syn match splintStateAnnot contained "\(pre\|post\):\(only\|shared\|owned\|dependent\|observer\|exposed\|isnull\|notnull\)"
+syn keyword splintSpecialAnnot contained special
+syn keyword splintSpecTag contained uses sets defines allocated releases
+syn keyword splintModifies contained modifies
+syn keyword splintRequires contained requires ensures
+syn keyword splintGlobals contained globals
+syn keyword splintGlobitem contained internalState fileSystem
+syn keyword splintGlobannot contained undef killed
+syn keyword splintWarning contained warn
+
+syn keyword splintModitem contained internalState fileSystem nothing
+syn keyword splintReqitem contained MaxSet MaxRead result
+syn keyword splintIter contained iter yield
+syn keyword splintConst contained constant
+syn keyword splintAlt contained alt
+
+syn keyword splintType contained abstract concrete mutable immutable refcounted numabstract
+syn keyword splintGlobalType contained unchecked checkmod checked checkedstrict
+syn keyword splintMemMgm contained dependent keep killref only owned shared temp
+syn keyword splintAlias contained unique returned
+syn keyword splintExposure contained observer exposed
+syn keyword splintDefState contained out in partial reldef
+syn keyword splintGlobState contained undef killed
+syn keyword splintNullState contained null notnull relnull
+syn keyword splintNullPred contained truenull falsenull nullwhentrue falsewhennull
+syn keyword splintExit contained exits mayexit trueexit falseexit neverexit
+syn keyword splintExec contained noreturn maynotreturn noreturnwhentrue noreturnwhenfalse alwaysreturns
+syn keyword splintSef contained sef
+syn keyword splintDecl contained unused external
+syn keyword splintCase contained fallthrough
+syn keyword splintBreak contained innerbreak loopbreak switchbreak innercontinue
+syn keyword splintUnreach contained notreached
+syn keyword splintSpecFunc contained printflike scanflike messagelike
+
+" TODO: make these region or match
+syn keyword splintErrSupp contained i ignore end t
+syn match splintErrSupp contained "[it]\d\+\>"
+syn keyword splintTypeAcc contained access noaccess
+
+syn keyword splintMacro contained notfunction
+syn match splintSpecType contained "\(\|unsigned\|signed\)integraltype"
+
+" Flags taken from 'splint -help flags full' divided in local and global flags
+" Local Flags:
+syn keyword splintFlag contained abstract abstractcompare accessall accessczech accessczechoslovak
+syn keyword splintFlag contained accessfile accessmodule accessslovak aliasunique allblock
+syn keyword splintFlag contained allempty allglobs allimponly allmacros alwaysexits
+syn keyword splintFlag contained annotationerror ansi89limits assignexpose badflag bitwisesigned
+syn keyword splintFlag contained boolcompare boolfalse boolint boolops booltrue
+syn keyword splintFlag contained booltype bounds boundscompacterrormessages boundsread boundswrite
+syn keyword splintFlag contained branchstate bufferoverflow bufferoverflowhigh bugslimit casebreak
+syn keyword splintFlag contained caseinsensitivefilenames castexpose castfcnptr charindex charint
+syn keyword splintFlag contained charintliteral charunsignedchar checkedglobalias checkmodglobalias checkpost
+syn keyword splintFlag contained checkstrictglobalias checkstrictglobs codeimponly commentchar commenterror
+syn keyword splintFlag contained compdef compdestroy compmempass constmacros constprefix
+syn keyword splintFlag contained constprefixexclude constuse continuecomment controlnestdepth cppnames
+syn keyword splintFlag contained csvoverwrite czech czechconsts czechfcns czechmacros
+syn keyword splintFlag contained czechoslovak czechoslovakconsts czechoslovakfcns czechoslovakmacros czechoslovaktypes
+syn keyword splintFlag contained czechoslovakvars czechtypes czechvars debugfcnconstraint declundef
+syn keyword splintFlag contained deepbreak deparrays dependenttrans distinctexternalnames distinctinternalnames
+syn keyword splintFlag contained duplicatecases duplicatequals elseifcomplete emptyret enumindex
+syn keyword splintFlag contained enumint enummembers enummemuse enumprefix enumprefixexclude
+syn keyword splintFlag contained evalorder evalorderuncon exitarg exportany exportconst
+syn keyword splintFlag contained exportfcn exportheader exportheadervar exportiter exportlocal
+syn keyword splintFlag contained exportmacro exporttype exportvar exposetrans externalnamecaseinsensitive
+syn keyword splintFlag contained externalnamelen externalprefix externalprefixexclude fcnderef fcnmacros
+syn keyword splintFlag contained fcnpost fcnuse fielduse fileextensions filestaticprefix
+syn keyword splintFlag contained filestaticprefixexclude firstcase fixedformalarray floatdouble forblock
+syn keyword splintFlag contained forcehints forempty forloopexec formalarray formatcode
+syn keyword splintFlag contained formatconst formattype forwarddecl freshtrans fullinitblock
+syn keyword splintFlag contained globalias globalprefix globalprefixexclude globimponly globnoglobs
+syn keyword splintFlag contained globs globsimpmodsnothing globstate globuse gnuextensions
+syn keyword splintFlag contained grammar hasyield hints htmlfileformat ifblock
+syn keyword splintFlag contained ifempty ignorequals ignoresigns immediatetrans impabstract
+syn keyword splintFlag contained impcheckedglobs impcheckedspecglobs impcheckedstatics impcheckedstrictglobs impcheckedstrictspecglobs
+syn keyword splintFlag contained impcheckedstrictstatics impcheckmodglobs impcheckmodinternals impcheckmodspecglobs impcheckmodstatics
+syn keyword splintFlag contained impconj implementationoptional implictconstraint impouts imptype
+syn keyword splintFlag contained includenest incompletetype incondefs incondefslib indentspaces
+syn keyword splintFlag contained infloops infloopsuncon initallelements initsize internalglobs
+syn keyword splintFlag contained internalglobsnoglobs internalnamecaseinsensitive internalnamelen internalnamelookalike iso99limits
+syn keyword splintFlag contained isoreserved isoreservedinternal iterbalance iterloopexec iterprefix
+syn keyword splintFlag contained iterprefixexclude iteryield its4low its4moderate its4mostrisky
+syn keyword splintFlag contained its4risky its4veryrisky keep keeptrans kepttrans
+syn keyword splintFlag contained legacy libmacros likelyboundsread likelyboundswrite likelybool
+syn keyword splintFlag contained likelybounds limit linelen lintcomments localprefix
+syn keyword splintFlag contained localprefixexclude locindentspaces longint longintegral longsignedintegral
+syn keyword splintFlag contained longunsignedintegral longunsignedunsignedintegral loopexec looploopbreak looploopcontinue
+syn keyword splintFlag contained loopswitchbreak macroassign macroconstdecl macrodecl macroempty
+syn keyword splintFlag contained macrofcndecl macromatchname macroparams macroparens macroredef
+syn keyword splintFlag contained macroreturn macrostmt macrounrecog macrovarprefix macrovarprefixexclude
+syn keyword splintFlag contained maintype matchanyintegral matchfields mayaliasunique memchecks
+syn keyword splintFlag contained memimp memtrans misplacedsharequal misscase modfilesys
+syn keyword splintFlag contained modglobs modglobsnomods modglobsunchecked modinternalstrict modnomods
+syn keyword splintFlag contained modobserver modobserveruncon mods modsimpnoglobs modstrictglobsnomods
+syn keyword splintFlag contained moduncon modunconnomods modunspec multithreaded mustdefine
+syn keyword splintFlag contained mustfree mustfreefresh mustfreeonly mustmod mustnotalias
+syn keyword splintFlag contained mutrep namechecks needspec nestcomment nestedextern
+syn keyword splintFlag contained newdecl newreftrans nextlinemacros noaccess nocomments
+syn keyword splintFlag contained noeffect noeffectuncon noparams nopp noret
+syn keyword splintFlag contained null nullassign nullderef nullinit nullpass
+syn keyword splintFlag contained nullptrarith nullret nullstate nullterminated
+syn keyword splintFlag contained numabstract numabstractcast numabstractindex numabstractlit numabstractprint
+syn keyword splintFlag contained numenummembers numliteral numstructfields observertrans obviousloopexec
+syn keyword splintFlag contained oldstyle onlytrans onlyunqglobaltrans orconstraint overload
+syn keyword splintFlag contained ownedtrans paramimptemp paramuse parenfileformat partial
+syn keyword splintFlag contained passunknown portability predassign predbool predboolint
+syn keyword splintFlag contained predboolothers predboolptr preproc protoparammatch protoparamname
+syn keyword splintFlag contained protoparamprefix protoparamprefixexclude ptrarith ptrcompare ptrnegate
+syn keyword splintFlag contained quiet readonlystrings readonlytrans realcompare redecl
+syn keyword splintFlag contained redef redundantconstraints redundantsharequal refcounttrans relaxquals
+syn keyword splintFlag contained relaxtypes repeatunrecog repexpose retalias retexpose
+syn keyword splintFlag contained retimponly retval retvalbool retvalint retvalother
+syn keyword splintFlag contained sefparams sefuncon shadow sharedtrans shiftimplementation
+syn keyword splintFlag contained shiftnegative shortint showallconjs showcolumn showconstraintlocation
+syn keyword splintFlag contained showconstraintparens showdeephistory showfunc showloadloc showscan
+syn keyword splintFlag contained showsourceloc showsummary sizeofformalarray sizeoftype skipisoheaders
+syn keyword splintFlag contained skipposixheaders slashslashcomment slovak slovakconsts slovakfcns
+syn keyword splintFlag contained slovakmacros slovaktypes slovakvars specglobimponly specimponly
+syn keyword splintFlag contained specmacros specretimponly specstructimponly specundecl specundef
+syn keyword splintFlag contained stackref statemerge statetransfer staticinittrans statictrans
+syn keyword splintFlag contained strictbranchstate strictdestroy strictops strictusereleased stringliterallen
+syn keyword splintFlag contained stringliteralnoroom stringliteralnoroomfinalnull stringliteralsmaller stringliteraltoolong structimponly
+syn keyword splintFlag contained superuser switchloopbreak switchswitchbreak syntax sysdirerrors
+syn keyword splintFlag contained sysdirexpandmacros sysunrecog tagprefix tagprefixexclude temptrans
+syn keyword splintFlag contained tmpcomments toctou topuse trytorecover type
+syn keyword splintFlag contained typeprefix typeprefixexclude typeuse uncheckedglobalias uncheckedmacroprefix
+syn keyword splintFlag contained uncheckedmacroprefixexclude uniondef unixstandard unqualifiedinittrans unqualifiedtrans
+syn keyword splintFlag contained unreachable unrecog unrecogcomments unrecogdirective unrecogflagcomments
+syn keyword splintFlag contained unsignedcompare unusedspecial usedef usereleased usevarargs
+syn keyword splintFlag contained varuse voidabstract warnflags warnlintcomments warnmissingglobs
+syn keyword splintFlag contained warnmissingglobsnoglobs warnposixheaders warnrc warnsysfiles warnunixlib
+syn keyword splintFlag contained warnuse whileblock whileempty whileloopexec zerobool
+syn keyword splintFlag contained zeroptr
+" Global Flags:
+syn keyword splintGlobalFlag contained csv dump errorstream errorstreamstderr errorstreamstdout
+syn keyword splintGlobalFlag contained expect f help i isolib
+syn keyword splintGlobalFlag contained larchpath lclexpect lclimportdir lcs lh
+syn keyword splintGlobalFlag contained load messagestream messagestreamstderr messagestreamstdout mts
+syn keyword splintGlobalFlag contained neverinclude nof nolib posixlib posixstrictlib
+syn keyword splintGlobalFlag contained showalluses singleinclude skipsysheaders stats streamoverwrite
+syn keyword splintGlobalFlag contained strictlib supcounts sysdirs timedist tmpdir
+syn keyword splintGlobalFlag contained unixlib unixstrictlib warningstream warningstreamstderr warningstreamstdout
+syn keyword splintGlobalFlag contained whichlib
+syn match splintFlagExpr contained "[\+\-\=]" nextgroup=splintFlag,splintGlobalFlag
+
+" detect missing /*@ and wrong */
+syn match splintAnnError "@\*/"
+syn cluster cCommentGroup add=splintAnnError
+syn match splintAnnError2 "[^@]\*/"hs=s+1 contained
+syn region splintAnnotation start="/\*@" end="@\*/" contains=@splintAnnotElem,cType keepend
+syn match splintShortAnn "/\*@\*/"
+syn cluster splintAnnotElem contains=splintStateAnnot,splintSpecialAnnot,splintSpecTag,splintModifies,splintRequires,splintGlobals,splintGlobitem,splintGlobannot,splintWarning,splintModitem,splintIter,splintConst,splintAlt,splintType,splintGlobalType,splintMemMgm,splintAlias,splintExposure,splintDefState,splintGlobState,splintNullState,splintNullPred,splintExit,splintExec,splintSef,splintDecl,splintCase,splintBreak,splintUnreach,splintSpecFunc,splintErrSupp,splintTypeAcc,splintMacro,splintSpecType,splintAnnError2,splintFlagExpr
+syn cluster splintAllStuff contains=@splintAnnotElem,splintFlag,splintGlobalFlag
+syn cluster cParenGroup add=@splintAllStuff
+syn cluster cPreProcGroup add=@splintAllStuff
+syn cluster cMultiGroup add=@splintAllStuff
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_splint_syntax_inits")
+ if version < 508
+ let did_splint_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink splintShortAnn splintAnnotation
+ HiLink splintAnnotation Comment
+ HiLink splintAnnError splintError
+ HiLink splintAnnError2 splintError
+ HiLink splintFlag SpecialComment
+ HiLink splintGlobalFlag splintError
+ HiLink splintSpecialAnnot splintAnnKey
+ HiLink splintStateAnnot splintAnnKey
+ HiLink splintSpecTag splintAnnKey
+ HiLink splintModifies splintAnnKey
+ HiLink splintRequires splintAnnKey
+ HiLink splintGlobals splintAnnKey
+ HiLink splintGlobitem Constant
+ HiLink splintGlobannot splintAnnKey
+ HiLink splintWarning splintAnnKey
+ HiLink splintModitem Constant
+ HiLink splintIter splintAnnKey
+ HiLink splintConst splintAnnKey
+ HiLink splintAlt splintAnnKey
+ HiLink splintType splintAnnKey
+ HiLink splintGlobalType splintAnnKey
+ HiLink splintMemMgm splintAnnKey
+ HiLink splintAlias splintAnnKey
+ HiLink splintExposure splintAnnKey
+ HiLink splintDefState splintAnnKey
+ HiLink splintGlobState splintAnnKey
+ HiLink splintNullState splintAnnKey
+ HiLink splintNullPred splintAnnKey
+ HiLink splintExit splintAnnKey
+ HiLink splintExec splintAnnKey
+ HiLink splintSef splintAnnKey
+ HiLink splintDecl splintAnnKey
+ HiLink splintCase splintAnnKey
+ HiLink splintBreak splintAnnKey
+ HiLink splintUnreach splintAnnKey
+ HiLink splintSpecFunc splintAnnKey
+ HiLink splintErrSupp splintAnnKey
+ HiLink splintTypeAcc splintAnnKey
+ HiLink splintMacro splintAnnKey
+ HiLink splintSpecType splintAnnKey
+ HiLink splintAnnKey Type
+ HiLink splintError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "splint"
+
+" vim: ts=8
diff --git a/runtime/syntax/spup.vim b/runtime/syntax/spup.vim
new file mode 100644
index 000000000..af5773740
--- /dev/null
+++ b/runtime/syntax/spup.vim
@@ -0,0 +1,277 @@
+" Vim syntax file
+" Language: Speedup, plant simulator from AspenTech
+" Maintainer: Stefan.Schwarzer <s.schwarzer@ndh.net>
+" URL: http://www.ndh.net/home/sschwarzer/download/spup.vim
+" Last Change: 2003 May 11
+" Filename: spup.vim
+
+" Bugs
+" - in the appropriate sections keywords are always highlighted
+" even if they are not used with the appropriate meaning;
+" example: in
+" MODEL demonstration
+" TYPE
+" *area AS area
+" both "area" are highlighted as spupType.
+"
+" If you encounter problems or have questions or suggestions, mail me
+
+" Remove old syntax stuff
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" don't hightlight several keywords like subsections
+"let strict_subsections = 1
+
+" highlight types usually found in DECLARE section
+if !exists("hightlight_types")
+ let highlight_types = 1
+endif
+
+" one line comment syntax (# comments)
+" 1. allow appended code after comment, do not complain
+" 2. show code beginnig with the second # as an error
+" 3. show whole lines with more than one # as an error
+if !exists("oneline_comments")
+ let oneline_comments = 2
+endif
+
+" Speedup SECTION regions
+syn case ignore
+syn region spupCdi matchgroup=spupSection start="^CDI" end="^\*\*\*\*" contains=spupCdiSubs,@spupOrdinary
+syn region spupConditions matchgroup=spupSection start="^CONDITIONS" end="^\*\*\*\*" contains=spupConditionsSubs,@spupOrdinary,spupConditional,spupOperator,spupCode
+syn region spupDeclare matchgroup=spupSection start="^DECLARE" end="^\*\*\*\*" contains=spupDeclareSubs,@spupOrdinary,spupTypes,spupCode
+syn region spupEstimation matchgroup=spupSection start="^ESTIMATION" end="^\*\*\*\*" contains=spupEstimationSubs,@spupOrdinary
+syn region spupExternal matchgroup=spupSection start="^EXTERNAL" end="^\*\*\*\*" contains=spupExternalSubs,@spupOrdinary
+syn region spupFlowsheet matchgroup=spupSection start="^FLOWSHEET" end="^\*\*\*\*" contains=spupFlowsheetSubs,@spupOrdinary,spupStreams,@spupTextproc
+syn region spupFunction matchgroup=spupSection start="^FUNCTION" end="^\*\*\*\*" contains=spupFunctionSubs,@spupOrdinary,spupHelp,spupCode,spupTypes
+syn region spupGlobal matchgroup=spupSection start="^GLOBAL" end="^\*\*\*\*" contains=spupGlobalSubs,@spupOrdinary
+syn region spupHomotopy matchgroup=spupSection start="^HOMOTOPY" end="^\*\*\*\*" contains=spupHomotopySubs,@spupOrdinary
+syn region spupMacro matchgroup=spupSection start="^MACRO" end="^\*\*\*\*" contains=spupMacroSubs,@spupOrdinary,@spupTextproc,spupTypes,spupStreams,spupOperator
+syn region spupModel matchgroup=spupSection start="^MODEL" end="^\*\*\*\*" contains=spupModelSubs,@spupOrdinary,spupConditional,spupOperator,spupTypes,spupStreams,@spupTextproc,spupHelp
+syn region spupOperation matchgroup=spupSection start="^OPERATION" end="^\*\*\*\*" contains=spupOperationSubs,@spupOrdinary,@spupTextproc
+syn region spupOptions matchgroup=spupSection start="^OPTIONS" end="^\*\*\*\*" contains=spupOptionsSubs,@spupOrdinary
+syn region spupProcedure matchgroup=spupSection start="^PROCEDURE" end="^\*\*\*\*" contains=spupProcedureSubs,@spupOrdinary,spupHelp,spupCode,spupTypes
+syn region spupProfiles matchgroup=spupSection start="^PROFILES" end="^\*\*\*\*" contains=@spupOrdinary,@spupTextproc
+syn region spupReport matchgroup=spupSection start="^REPORT" end="^\*\*\*\*" contains=spupReportSubs,@spupOrdinary,spupHelp,@spupTextproc
+syn region spupTitle matchgroup=spupSection start="^TITLE" end="^\*\*\*\*" contains=spupTitleSubs,spupComment,spupConstant,spupError
+syn region spupUnit matchgroup=spupSection start="^UNIT" end="^\*\*\*\*" contains=spupUnitSubs,@spupOrdinary
+
+" Subsections
+syn keyword spupCdiSubs INPUT FREE OUTPUT LINEARTIME MINNONZERO CALCULATE FILES SCALING contained
+syn keyword spupDeclareSubs TYPE STREAM contained
+syn keyword spupEstimationSubs ESTIMATE SSEXP DYNEXP RESULT contained
+syn keyword spupExternalSubs TRANSMIT RECEIVE contained
+syn keyword spupFlowsheetSubs STREAM contained
+syn keyword spupFunctionSubs INPUT OUTPUT contained
+syn keyword spupGlobalSubs VARIABLES MAXIMIZE MINIMIZE CONSTRAINT contained
+syn keyword spupHomotopySubs VARY OPTIONS contained
+syn keyword spupMacroSubs MODEL FLOWSHEET contained
+syn keyword spupModelSubs CATEGORY SET TYPE STREAM EQUATION PROCEDURE contained
+syn keyword spupOperationSubs SET PRESET INITIAL SSTATE FREE contained
+syn keyword spupOptionsSubs ROUTINES TRANSLATE EXECUTION contained
+syn keyword spupProcedureSubs INPUT OUTPUT SPACE PRECALL POSTCALL DERIVATIVE STREAM contained
+" no subsections for Profiles
+syn keyword spupReportSubs SET INITIAL FIELDS FIELDMARK DISPLAY WITHIN contained
+syn keyword spupUnitSubs ROUTINES SET contained
+
+" additional keywords for subsections
+if !exists( "strict_subsections" )
+ syn keyword spupConditionsSubs STOP PRINT contained
+ syn keyword spupDeclareSubs UNIT SET COMPONENTS THERMO OPTIONS contained
+ syn keyword spupEstimationSubs VARY MEASURE INITIAL contained
+ syn keyword spupFlowsheetSubs TYPE FEED PRODUCT INPUT OUTPUT CONNECTION OF IS contained
+ syn keyword spupMacroSubs CONNECTION STREAM SET INPUT OUTPUT OF IS FEED PRODUCT TYPE contained
+ syn keyword spupModelSubs AS ARRAY OF INPUT OUTPUT CONNECTION contained
+ syn keyword spupOperationSubs WITHIN contained
+ syn keyword spupReportSubs LEFT RIGHT CENTER CENTRE UOM TIME DATE VERSION RELDATE contained
+ syn keyword spupUnitSubs IS A contained
+endif
+
+" Speedup data types
+if exists( "highlight_types" )
+ syn keyword spupTypes act_coeff_liq area coefficient concentration contained
+ syn keyword spupTypes control_signal cond_liq cond_vap cp_mass_liq contained
+ syn keyword spupTypes cp_mol_liq cp_mol_vap cv_mol_liq cv_mol_vap contained
+ syn keyword spupTypes diffus_liq diffus_vap delta_p dens_mass contained
+ syn keyword spupTypes dens_mass_sol dens_mass_liq dens_mass_vap dens_mol contained
+ syn keyword spupTypes dens_mol_sol dens_mol_liq dens_mol_vap enthflow contained
+ syn keyword spupTypes enth_mass enth_mass_liq enth_mass_vap enth_mol contained
+ syn keyword spupTypes enth_mol_sol enth_mol_liq enth_mol_vap entr_mol contained
+ syn keyword spupTypes entr_mol_sol entr_mol_liq entr_mol_vap fraction contained
+ syn keyword spupTypes flow_mass flow_mass_liq flow_mass_vap flow_mol contained
+ syn keyword spupTypes flow_mol_vap flow_mol_liq flow_vol flow_vol_vap contained
+ syn keyword spupTypes flow_vol_liq fuga_vap fuga_liq fuga_sol contained
+ syn keyword spupTypes gibb_mol_sol heat_react heat_trans_coeff contained
+ syn keyword spupTypes holdup_heat holdup_heat_liq holdup_heat_vap contained
+ syn keyword spupTypes holdup_mass holdup_mass_liq holdup_mass_vap contained
+ syn keyword spupTypes holdup_mol holdup_mol_liq holdup_mol_vap k_value contained
+ syn keyword spupTypes length length_delta length_short liqfraction contained
+ syn keyword spupTypes liqmassfraction mass massfraction molefraction contained
+ syn keyword spupTypes molweight moment_inertia negative notype percent contained
+ syn keyword spupTypes positive pressure press_diff press_drop press_rise contained
+ syn keyword spupTypes ratio reaction reaction_mass rotation surf_tens contained
+ syn keyword spupTypes temperature temperature_abs temp_diff temp_drop contained
+ syn keyword spupTypes temp_rise time vapfraction vapmassfraction contained
+ syn keyword spupTypes velocity visc_liq visc_vap volume zmom_rate contained
+ syn keyword spupTypes seg_rate smom_rate tmom_rate zmom_mass seg_mass contained
+ syn keyword spupTypes smom_mass tmom_mass zmom_holdup seg_holdup contained
+ syn keyword spupTypes smom_holdup tmom_holdup contained
+endif
+
+" stream types
+syn keyword spupStreams mainstream vapour liquid contained
+
+" "conditional" keywords
+syn keyword spupConditional IF THEN ELSE ENDIF contained
+" Operators, symbols etc.
+syn keyword spupOperator AND OR NOT contained
+syn match spupSymbol "[,\-+=:;*/\"<>@%()]" contained
+syn match spupSpecial "[&\$?]" contained
+" Surprisingly, Speedup allows no unary + instead of the -
+syn match spupError "[(=+\-*/]\s*+\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 contained
+syn match spupError "[(=+\-*/]\s*+\d\+\.\([ed][+-]\=\d\+\)\=\>"lc=1 contained
+syn match spupError "[(=+\-*/]\s*+\d*\.\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 contained
+" String
+syn region spupString start=+"+ end=+"+ oneline contained
+syn region spupString start=+'+ end=+'+ oneline contained
+" Identifier
+syn match spupIdentifier "\<[a-z][a-z0-9_]*\>" contained
+" Textprocessor directives
+syn match spupTextprocGeneric "?[a-z][a-z0-9_]*\>" contained
+syn region spupTextprocError matchgroup=spupTextprocGeneric start="?ERROR" end="?END"he=s-1 contained
+" Number, without decimal point
+syn match spupNumber "-\=\d\+\([ed][+-]\=\d\+\)\=" contained
+" Number, allows 1. before exponent
+syn match spupNumber "-\=\d\+\.\([ed][+-]\=\d\+\)\=" contained
+" Number allows .1 before exponent
+syn match spupNumber "-\=\d*\.\d\+\([ed][+-]\=\d\+\)\=" contained
+" Help subsections
+syn region spupHelp start="^HELP"hs=e+1 end="^\$ENDHELP"he=s-1 contained
+" Fortran code
+syn region spupCode start="^CODE"hs=e+1 end="^\$ENDCODE"he=s-1 contained
+" oneline comments
+if oneline_comments > 3
+ oneline_comments = 2 " default
+endif
+if oneline_comments == 1
+ syn match spupComment "#[^#]*#\="
+elseif oneline_comments == 2
+ syn match spupError "#.*$"
+ syn match spupComment "#[^#]*" nextgroup=spupError
+elseif oneline_comments == 3
+ syn match spupComment "#[^#]*"
+ syn match spupError "#[^#]*#.*"
+endif
+" multiline comments
+syn match spupOpenBrace "{" contained
+syn match spupError "}"
+syn region spupComment matchgroup=spupComment2 start="{" end="}" keepend contains=spupOpenBrace
+
+syn cluster spupOrdinary contains=spupNumber,spupIdentifier,spupSymbol
+syn cluster spupOrdinary add=spupError,spupString,spupComment
+syn cluster spupTextproc contains=spupTextprocGeneric,spupTextprocError
+
+" define syncronizing; especially OPERATION sections can become very large
+syn sync clear
+syn sync minlines=100
+syn sync maxlines=500
+
+syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"
+syn sync match spupSyncCdi grouphere spupCdi "^CDI"
+syn sync match spupSyncConditions grouphere spupConditions "^CONDITIONS"
+syn sync match spupSyncDeclare grouphere spupDeclare "^DECLARE"
+syn sync match spupSyncEstimation grouphere spupEstimation "^ESTIMATION"
+syn sync match spupSyncExternal grouphere spupExternal "^EXTERNAL"
+syn sync match spupSyncFlowsheet grouphere spupFlowsheet "^FLOWSHEET"
+syn sync match spupSyncFunction grouphere spupFunction "^FUNCTION"
+syn sync match spupSyncGlobal grouphere spupGlobal "^GLOBAL"
+syn sync match spupSyncHomotopy grouphere spupHomotopy "^HOMOTOPY"
+syn sync match spupSyncMacro grouphere spupMacro "^MACRO"
+syn sync match spupSyncModel grouphere spupModel "^MODEL"
+syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"
+syn sync match spupSyncOptions grouphere spupOptions "^OPTIONS"
+syn sync match spupSyncProcedure grouphere spupProcedure "^PROCEDURE"
+syn sync match spupSyncProfiles grouphere spupProfiles "^PROFILES"
+syn sync match spupSyncReport grouphere spupReport "^REPORT"
+syn sync match spupSyncTitle grouphere spupTitle "^TITLE"
+syn sync match spupSyncUnit grouphere spupUnit "^UNIT"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_spup_syn_inits")
+ if version < 508
+ let did_spup_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink spupCdi spupSection
+ HiLink spupConditions spupSection
+ HiLink spupDeclare spupSection
+ HiLink spupEstimation spupSection
+ HiLink spupExternal spupSection
+ HiLink spupFlowsheet spupSection
+ HiLink spupFunction spupSection
+ HiLink spupGlobal spupSection
+ HiLink spupHomotopy spupSection
+ HiLink spupMacro spupSection
+ HiLink spupModel spupSection
+ HiLink spupOperation spupSection
+ HiLink spupOptions spupSection
+ HiLink spupProcedure spupSection
+ HiLink spupProfiles spupSection
+ HiLink spupReport spupSection
+ HiLink spupTitle spupConstant " this is correct, truly ;)
+ HiLink spupUnit spupSection
+
+ HiLink spupCdiSubs spupSubs
+ HiLink spupConditionsSubs spupSubs
+ HiLink spupDeclareSubs spupSubs
+ HiLink spupEstimationSubs spupSubs
+ HiLink spupExternalSubs spupSubs
+ HiLink spupFlowsheetSubs spupSubs
+ HiLink spupFunctionSubs spupSubs
+ HiLink spupHomotopySubs spupSubs
+ HiLink spupMacroSubs spupSubs
+ HiLink spupModelSubs spupSubs
+ HiLink spupOperationSubs spupSubs
+ HiLink spupOptionsSubs spupSubs
+ HiLink spupProcedureSubs spupSubs
+ HiLink spupReportSubs spupSubs
+ HiLink spupUnitSubs spupSubs
+
+ HiLink spupCode Normal
+ HiLink spupComment Comment
+ HiLink spupComment2 spupComment
+ HiLink spupConditional Statement
+ HiLink spupConstant Constant
+ HiLink spupError Error
+ HiLink spupHelp Normal
+ HiLink spupIdentifier Identifier
+ HiLink spupNumber Constant
+ HiLink spupOperator Special
+ HiLink spupOpenBrace spupError
+ HiLink spupSection Statement
+ HiLink spupSpecial spupTextprocGeneric
+ HiLink spupStreams Type
+ HiLink spupString Constant
+ HiLink spupSubs Statement
+ HiLink spupSymbol Special
+ HiLink spupTextprocError Normal
+ HiLink spupTextprocGeneric PreProc
+ HiLink spupTypes Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "spup"
+
+" vim:ts=4
diff --git a/runtime/syntax/spyce.vim b/runtime/syntax/spyce.vim
new file mode 100644
index 000000000..641aa8659
--- /dev/null
+++ b/runtime/syntax/spyce.vim
@@ -0,0 +1,110 @@
+" Vim syntax file
+" Language: SPYCE
+" Maintainer: Rimon Barr <rimon AT acm DOT org>
+" URL: http://spyce.sourceforge.net
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" we define it here so that included files can test for it
+if !exists("main_syntax")
+ let main_syntax='spyce'
+endif
+
+" Read the HTML syntax to start with
+let b:did_indent = 1 " don't perform HTML indentation!
+let html_no_rendering = 1 " do not render <b>,<i>, etc...
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+" include python
+syn include @Python <sfile>:p:h/python.vim
+syn include @Html <sfile>:p:h/html.vim
+
+" spyce definitions
+syn keyword spyceDirectiveKeyword include compact module import contained
+syn keyword spyceDirectiveArg name names file contained
+syn region spyceDirectiveString start=+"+ end=+"+ contained
+syn match spyceDirectiveValue "=[\t ]*[^'", \t>][^, \t>]*"hs=s+1 contained
+
+syn match spyceBeginErrorS ,\[\[,
+syn match spyceBeginErrorA ,<%,
+syn cluster spyceBeginError contains=spyceBeginErrorS,spyceBeginErrorA
+syn match spyceEndErrorS ,\]\],
+syn match spyceEndErrorA ,%>,
+syn cluster spyceEndError contains=spyceEndErrorS,spyceEndErrorA
+
+syn match spyceEscBeginS ,\\\[\[,
+syn match spyceEscBeginA ,\\<%,
+syn cluster spyceEscBegin contains=spyceEscBeginS,spyceEscBeginA
+syn match spyceEscEndS ,\\\]\],
+syn match spyceEscEndA ,\\%>,
+syn cluster spyceEscEnd contains=spyceEscEndS,spyceEscEndA
+syn match spyceEscEndCommentS ,--\\\]\],
+syn match spyceEscEndCommentA ,--\\%>,
+syn cluster spyceEscEndComment contains=spyceEscEndCommentS,spyceEscEndCommentA
+
+syn region spyceStmtS matchgroup=spyceStmtDelim start=,\[\[, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceStmtA matchgroup=spyceStmtDelim start=,<%, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceChunkS matchgroup=spyceChunkDelim start=,\[\[\\, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceChunkA matchgroup=spyceChunkDelim start=,<%\\, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceEvalS matchgroup=spyceEvalDelim start=,\[\[=, end=,\]\], contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceEvalA matchgroup=spyceEvalDelim start=,<%=, end=,%>, contains=@Python,spyceLambdaS,spyceLambdaA,spyceBeginError keepend
+syn region spyceDirectiveS matchgroup=spyceDelim start=,\[\[\., end=,\]\], contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
+syn region spyceDirectiveA matchgroup=spyceDelim start=,<%@, end=,%>, contains=spyceBeginError,spyceDirectiveKeyword,spyceDirectiveArg,spyceDirectiveValue,spyceDirectiveString keepend
+syn region spyceCommentS matchgroup=spyceCommentDelim start=,\[\[--, end=,--\]\],
+syn region spyceCommentA matchgroup=spyceCommentDelim start=,<%--, end=,--%>,
+syn region spyceLambdaS matchgroup=spyceLambdaDelim start=,\[\[spy!\?, end=,\]\], contains=@Html,@spyce extend
+syn region spyceLambdaA matchgroup=spyceLambdaDelim start=,<%spy!\?, end=,%>, contains=@Html,@spyce extend
+
+syn cluster spyce contains=spyceStmtS,spyceStmtA,spyceChunkS,spyceChunkA,spyceEvalS,spyceEvalA,spyceCommentS,spyceCommentA,spyceDirectiveS,spyceDirectiveA
+
+syn cluster htmlPreproc contains=@spyce
+
+hi link spyceDirectiveKeyword Special
+hi link spyceDirectiveArg Type
+hi link spyceDirectiveString String
+hi link spyceDirectiveValue String
+
+hi link spyceDelim Special
+hi link spyceStmtDelim spyceDelim
+hi link spyceChunkDelim spyceDelim
+hi link spyceEvalDelim spyceDelim
+hi link spyceLambdaDelim spyceDelim
+hi link spyceCommentDelim Comment
+
+hi link spyceBeginErrorS Error
+hi link spyceBeginErrorA Error
+hi link spyceEndErrorS Error
+hi link spyceEndErrorA Error
+
+hi link spyceStmtS spyce
+hi link spyceStmtA spyce
+hi link spyceChunkS spyce
+hi link spyceChunkA spyce
+hi link spyceEvalS spyce
+hi link spyceEvalA spyce
+hi link spyceDirectiveS spyce
+hi link spyceDirectiveA spyce
+hi link spyceCommentS Comment
+hi link spyceCommentA Comment
+hi link spyceLambdaS Normal
+hi link spyceLambdaA Normal
+
+hi link spyce Statement
+
+let b:current_syntax = "spyce"
+if main_syntax == 'spyce'
+ unlet main_syntax
+endif
+
diff --git a/runtime/syntax/sql.vim b/runtime/syntax/sql.vim
new file mode 100644
index 000000000..9083b8136
--- /dev/null
+++ b/runtime/syntax/sql.vim
@@ -0,0 +1,89 @@
+" Vim syntax file
+" Language: SQL, PL/SQL (Oracle 8i)
+" Maintainer: Paul Moore <gustav@morpheus.demon.co.uk>
+" Last Change: 2001 Apr 30
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" The SQL reserved words, defined as keywords.
+
+syn keyword sqlSpecial false null true
+
+syn keyword sqlKeyword access add as asc begin by check cluster column
+syn keyword sqlKeyword compress connect current cursor decimal default desc
+syn keyword sqlKeyword else elsif end exception exclusive file for from
+syn keyword sqlKeyword function group having identified if immediate increment
+syn keyword sqlKeyword index initial into is level loop maxextents mode modify
+syn keyword sqlKeyword nocompress nowait of offline on online start
+syn keyword sqlKeyword successful synonym table then to trigger uid
+syn keyword sqlKeyword unique user validate values view whenever
+syn keyword sqlKeyword where with option order pctfree privileges procedure
+syn keyword sqlKeyword public resource return row rowlabel rownum rows
+syn keyword sqlKeyword session share size smallint type using
+
+syn keyword sqlOperator not and or
+syn keyword sqlOperator in any some all between exists
+syn keyword sqlOperator like escape
+syn keyword sqlOperator union intersect minus
+syn keyword sqlOperator prior distinct
+syn keyword sqlOperator sysdate out
+
+syn keyword sqlStatement alter analyze audit comment commit create
+syn keyword sqlStatement delete drop execute explain grant insert lock noaudit
+syn keyword sqlStatement rename revoke rollback savepoint select set
+syn keyword sqlStatement truncate update
+
+syn keyword sqlType boolean char character date float integer long
+syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray
+
+" Strings and characters:
+syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+
+
+" Numbers:
+syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>"
+
+" Comments:
+syn region sqlComment start="/\*" end="\*/" contains=sqlTodo
+syn match sqlComment "--.*$" contains=sqlTodo
+
+syn sync ccomment sqlComment
+
+" Todo.
+syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_sql_syn_inits")
+ if version < 508
+ let did_sql_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sqlComment Comment
+ HiLink sqlKeyword sqlSpecial
+ HiLink sqlNumber Number
+ HiLink sqlOperator sqlStatement
+ HiLink sqlSpecial Special
+ HiLink sqlStatement Statement
+ HiLink sqlString String
+ HiLink sqlType Type
+ HiLink sqlTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sql"
+
+" vim: ts=8
diff --git a/runtime/syntax/sqlforms.vim b/runtime/syntax/sqlforms.vim
new file mode 100644
index 000000000..055b2ae87
--- /dev/null
+++ b/runtime/syntax/sqlforms.vim
@@ -0,0 +1,168 @@
+" Vim syntax file
+" Language: SQL*Forms (Oracle 7), based on sql.vim (vim5.0)
+" Maintainer: Austin Ziegler (austin@halostatue.ca)
+" Last Change: 2003 May 11
+" Prev Change: 19980710
+" URL: http://www.halostatue.ca/vim/syntax/proc.vim
+"
+" TODO Find a new maintainer who knows SQL*Forms.
+
+ " For version 5.x, clear all syntax items.
+ " For version 6.x, quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case ignore
+
+if version >= 600
+ setlocal iskeyword=a-z,A-Z,48-57,_,.,-,>
+else
+ set iskeyword=a-z,A-Z,48-57,_,.,-,>
+endif
+
+
+ " The SQL reserved words, defined as keywords.
+syntax match sqlTriggers /on-.*$/
+syntax match sqlTriggers /key-.*$/
+syntax match sqlTriggers /post-.*$/
+syntax match sqlTriggers /pre-.*$/
+syntax match sqlTriggers /user-.*$/
+
+syntax keyword sqlSpecial null false true
+
+syntax keyword sqlProcedure abort_query anchor_view bell block_menu break call
+syntax keyword sqlProcedure call_input call_query clear_block clear_eol
+syntax keyword sqlProcedure clear_field clear_form clear_record commit_form
+syntax keyword sqlProcedure copy count_query create_record default_value
+syntax keyword sqlProcedure delete_record display_error display_field down
+syntax keyword sqlProcedure duplicate_field duplicate_record edit_field
+syntax keyword sqlProcedure enter enter_query erase execute_query
+syntax keyword sqlProcedure execute_trigger exit_form first_Record go_block
+syntax keyword sqlProcedure go_field go_record help hide_menu hide_page host
+syntax keyword sqlProcedure last_record list_values lock_record message
+syntax keyword sqlProcedure move_view new_form next_block next_field next_key
+syntax keyword sqlProcedure next_record next_set pause post previous_block
+syntax keyword sqlProcedure previous_field previous_record print redisplay
+syntax keyword sqlProcedure replace_menu resize_view scroll_down scroll_up
+syntax keyword sqlProcedure set_field show_keys show_menu show_page
+syntax keyword sqlProcedure synchronize up user_exit
+
+syntax keyword sqlFunction block_characteristic error_code error_text
+syntax keyword sqlFunction error_type field_characteristic form_failure
+syntax keyword sqlFunction form_fatal form_success name_in
+
+syntax keyword sqlParameters hide no_hide replace no_replace ask_commit
+syntax keyword sqlParameters do_commit no_commit no_validate all_records
+syntax keyword sqlParameters for_update no_restrict restrict no_screen
+syntax keyword sqlParameters bar full_screen pull_down auto_help auto_skip
+syntax keyword sqlParameters fixed_length enterable required echo queryable
+syntax keyword sqlParameters updateable update_null upper_case attr_on
+syntax keyword sqlParameters attr_off base_table first_field last_field
+syntax keyword sqlParameters datatype displayed display_length field_length
+syntax keyword sqlParameters list page primary_key query_length x_pos y_pos
+
+syntax match sqlSystem /system\.block_status/
+syntax match sqlSystem /system\.current_block/
+syntax match sqlSystem /system\.current_field/
+syntax match sqlSystem /system\.current_form/
+syntax match sqlSystem /system\.current_value/
+syntax match sqlSystem /system\.cursor_block/
+syntax match sqlSystem /system\.cursor_field/
+syntax match sqlSystem /system\.cursor_record/
+syntax match sqlSystem /system\.cursor_value/
+syntax match sqlSystem /system\.form_status/
+syntax match sqlSystem /system\.last_query/
+syntax match sqlSystem /system\.last_record/
+syntax match sqlSystem /system\.message_level/
+syntax match sqlSystem /system\.record_status/
+syntax match sqlSystem /system\.trigger_block/
+syntax match sqlSystem /system\.trigger_field/
+syntax match sqlSystem /system\.trigger_record/
+syntax match sqlSystem /\$\$date\$\$/
+syntax match sqlSystem /\$\$time\$\$/
+
+syntax keyword sqlKeyword accept access add as asc by check cluster column
+syntax keyword sqlKeyword compress connect current decimal default
+syntax keyword sqlKeyword desc exclusive file for from group
+syntax keyword sqlKeyword having identified immediate increment index
+syntax keyword sqlKeyword initial into is level maxextents mode modify
+syntax keyword sqlKeyword nocompress nowait of offline on online start
+syntax keyword sqlKeyword successful synonym table to trigger uid
+syntax keyword sqlKeyword unique user validate values view whenever
+syntax keyword sqlKeyword where with option order pctfree privileges
+syntax keyword sqlKeyword public resource row rowlabel rownum rows
+syntax keyword sqlKeyword session share size smallint sql\*forms_version
+syntax keyword sqlKeyword terse define form name title procedure begin
+syntax keyword sqlKeyword default_menu_application trigger block field
+syntax keyword sqlKeyword enddefine declare exception raise when cursor
+syntax keyword sqlKeyword definition base_table pragma
+syntax keyword sqlKeyword column_name global trigger_type text description
+syntax match sqlKeyword "<<<"
+syntax match sqlKeyword ">>>"
+
+syntax keyword sqlOperator not and or out to_number to_date message erase
+syntax keyword sqlOperator in any some all between exists substr nvl
+syntax keyword sqlOperator exception_init
+syntax keyword sqlOperator like escape trunc lpad rpad sum
+syntax keyword sqlOperator union intersect minus to_char greatest
+syntax keyword sqlOperator prior distinct decode least avg
+syntax keyword sqlOperator sysdate true false field_characteristic
+syntax keyword sqlOperator display_field call host
+
+syntax keyword sqlStatement alter analyze audit comment commit create
+syntax keyword sqlStatement delete drop explain grant insert lock noaudit
+syntax keyword sqlStatement rename revoke rollback savepoint select set
+syntax keyword sqlStatement truncate update if elsif loop then
+syntax keyword sqlStatement open fetch close else end
+
+syntax keyword sqlType char character date long raw mlslabel number rowid
+syntax keyword sqlType varchar varchar2 float integer boolean global
+
+syntax keyword sqlCodes sqlcode no_data_found too_many_rows others
+syntax keyword sqlCodes form_trigger_failure notfound found
+syntax keyword sqlCodes validate no_commit
+
+ " Comments:
+syntax region sqlComment start="/\*" end="\*/"
+syntax match sqlComment "--.*"
+
+ " Strings and characters:
+syntax region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syntax region sqlString start=+'+ skip=+\\\\\|\\"+ end=+'+
+
+ " Numbers:
+syntax match sqlNumber "-\=\<[0-9]*\.\=[0-9_]\>"
+
+syntax sync ccomment sqlComment
+
+if version >= 508 || !exists("did_sqlforms_syn_inits")
+ if version < 508
+ let did_sqlforms_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sqlComment Comment
+ HiLink sqlKeyword Statement
+ HiLink sqlNumber Number
+ HiLink sqlOperator Statement
+ HiLink sqlProcedure Statement
+ HiLink sqlFunction Statement
+ HiLink sqlSystem Identifier
+ HiLink sqlSpecial Special
+ HiLink sqlStatement Statement
+ HiLink sqlString String
+ HiLink sqlType Type
+ HiLink sqlCodes Identifier
+ HiLink sqlTriggers PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sqlforms"
+
+" vim: ts=8 sw=4
diff --git a/runtime/syntax/sqlj.vim b/runtime/syntax/sqlj.vim
new file mode 100644
index 000000000..ba64bdfc0
--- /dev/null
+++ b/runtime/syntax/sqlj.vim
@@ -0,0 +1,100 @@
+" Vim syntax file
+" Language: sqlj
+" Maintainer: Andreas Fischbach <afisch@altavista.com>
+" This file is based on sql.vim && java.vim (thanx)
+" with a handful of additional sql words and still
+" a subset of whatever standard
+" Last change: 31th Dec 2001
+
+" au BufNewFile,BufRead *.sqlj so $VIM/syntax/sqlj.vim
+
+" Remove any old syntax stuff hanging around
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the Java syntax to start with
+source <sfile>:p:h/java.vim
+
+" SQLJ extentions
+" The SQL reserved words, defined as keywords.
+
+syn case ignore
+syn keyword sqljSpecial null
+
+syn keyword sqljKeyword access add as asc by check cluster column
+syn keyword sqljKeyword compress connect current decimal default
+syn keyword sqljKeyword desc else exclusive file for from group
+syn keyword sqljKeyword having identified immediate increment index
+syn keyword sqljKeyword initial into is level maxextents mode modify
+syn keyword sqljKeyword nocompress nowait of offline on online start
+syn keyword sqljKeyword successful synonym table then to trigger uid
+syn keyword sqljKeyword unique user validate values view whenever
+syn keyword sqljKeyword where with option order pctfree privileges
+syn keyword sqljKeyword public resource row rowlabel rownum rows
+syn keyword sqljKeyword session share size smallint
+
+syn keyword sqljKeyword fetch database context iterator field join
+syn keyword sqljKeyword foreign outer inner isolation left right
+syn keyword sqljKeyword match primary key
+
+syn keyword sqljOperator not and or
+syn keyword sqljOperator in any some all between exists
+syn keyword sqljOperator like escape
+syn keyword sqljOperator union intersect minus
+syn keyword sqljOperator prior distinct
+syn keyword sqljOperator sysdate
+
+syn keyword sqljOperator max min avg sum count hex
+
+syn keyword sqljStatement alter analyze audit comment commit create
+syn keyword sqljStatement delete drop explain grant insert lock noaudit
+syn keyword sqljStatement rename revoke rollback savepoint select set
+syn keyword sqljStatement truncate update begin work
+
+syn keyword sqljType char character date long raw mlslabel number
+syn keyword sqljType rowid varchar varchar2 float integer
+
+syn keyword sqljType byte text serial
+
+
+" Strings and characters:
+syn region sqljString start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn region sqljString start=+'+ skip=+\\\\\|\\"+ end=+'+
+
+" Numbers:
+syn match sqljNumber "-\=\<\d*\.\=[0-9_]\>"
+
+" PreProc
+syn match sqljPre "#sql"
+
+" Comments:
+syn region sqljComment start="/\*" end="\*/"
+syn match sqlComment "--.*"
+
+syn sync ccomment sqljComment
+
+if version >= 508 || !exists("did_sqlj_syn_inits")
+ if version < 508
+ let did_sqlj_syn_inits = 1
+ command! -nargs=+ HiLink hi link <args>
+ else
+ command! -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later.
+ HiLink sqljComment Comment
+ HiLink sqljKeyword sqljSpecial
+ HiLink sqljNumber Number
+ HiLink sqljOperator sqljStatement
+ HiLink sqljSpecial Special
+ HiLink sqljStatement Statement
+ HiLink sqljString String
+ HiLink sqljType Type
+ HiLink sqljPre PreProc
+endif
+
+let b:current_syntax = "sqlj"
+
diff --git a/runtime/syntax/sqr.vim b/runtime/syntax/sqr.vim
new file mode 100644
index 000000000..874944779
--- /dev/null
+++ b/runtime/syntax/sqr.vim
@@ -0,0 +1,295 @@
+" Vim syntax file
+" Language: Structured Query Report Writer (SQR)
+" Maintainer: Nathan Stratton Treadway (nathanst at ontko dot com)
+" URL: http://www.ontko.com/sqr/#editor_config_files
+"
+" Modification History:
+" 2002-Apr-12: Updated for SQR v6.x
+" 2002-Jul-30: Added { and } to iskeyword definition
+" 2003-Oct-15: Allow "." in variable names
+" highlight entire open '... literal when it contains
+" "''" inside it (e.g. "'I can''t say" is treated
+" as one open string, not one terminated and one open)
+" {} variables can occur inside of '...' literals
+"
+" Thanks to the previous maintainer of this file, Jeff Lanzarotta:
+" http://lanzarotta.tripod.com/vim.html
+" jefflanzarotta at yahoo dot com
+
+" For version 5.x, clear all syntax items.
+" For version 6.x, quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version >= 600
+ setlocal iskeyword=@,48-57,_,-,#,$,{,}
+else
+ set iskeyword=@,48-57,_,-,#,$,{,}
+endif
+
+syn case ignore
+
+" BEGIN GENERATED SECTION ============================================
+
+" Generated by generate_vim_syntax.sqr at 2002/04/11 13:04
+" (based on the UltraEdit syntax file for SQR 6.1.4
+" found at http://www.ontko.com/sqr/#editor_config_files )
+
+syn keyword sqrSection begin-footing begin-heading begin-procedure
+syn keyword sqrSection begin-program begin-report begin-setup
+syn keyword sqrSection end-footing end-heading end-procedure
+syn keyword sqrSection end-program end-report end-setup
+
+syn keyword sqrParagraph alter-color-map alter-conection
+syn keyword sqrParagraph alter-locale alter-printer alter-report
+syn keyword sqrParagraph begin-document begin-execute begin-select
+syn keyword sqrParagraph begin-sql declare-chart declare-image
+syn keyword sqrParagraph declare-color-map declare-conection
+syn keyword sqrParagraph declare-layout declare-printer
+syn keyword sqrParagraph declare-report declare-procedure
+syn keyword sqrParagraph declare-toc declare-variable end-declare
+syn keyword sqrParagraph end-document end-select exit-select end-sql
+syn keyword sqrParagraph load-lookup
+
+syn keyword sqrReserved #current-column #current-date #current-line
+syn keyword sqrReserved #end-file #page-count #return-status
+syn keyword sqrReserved #sql-count #sql-status #sqr-max-columns
+syn keyword sqrReserved #sqr-max-lines #sqr-pid #sqr-toc-level
+syn keyword sqrReserved #sqr-toc-page $sqr-database {sqr-database}
+syn keyword sqrReserved $sqr-dbcs {sqr-dbcs} $sqr-encoding
+syn keyword sqrReserved {sqr-encoding} $sqr-encoding-console
+syn keyword sqrReserved {sqr-encoding-console}
+syn keyword sqrReserved $sqr-encoding-database
+syn keyword sqrReserved {sqr-encoding-database}
+syn keyword sqrReserved $sqr-encoding-file-input
+syn keyword sqrReserved {sqr-encoding-file-input}
+syn keyword sqrReserved $sqr-encoding-file-output
+syn keyword sqrReserved {sqr-encoding-file-output}
+syn keyword sqrReserved $sqr-encoding-report-input
+syn keyword sqrReserved {sqr-encoding-report-input}
+syn keyword sqrReserved $sqr-encoding-report-output
+syn keyword sqrReserved {sqr-encoding-report-output}
+syn keyword sqrReserved $sqr-encoding-source {sqr-encoding-source}
+syn keyword sqrReserved $sql-error $sqr-hostname {sqr-hostname}
+syn keyword sqrReserved $sqr-locale $sqr-platform {sqr-platform}
+syn keyword sqrReserved $sqr-program $sqr-report $sqr-toc-text
+syn keyword sqrReserved $sqr-ver $username
+
+syn keyword sqrPreProc #define #else #end-if #endif #if #ifdef
+syn keyword sqrPreProc #ifndef #include
+
+syn keyword sqrCommand add array-add array-divide array-multiply
+syn keyword sqrCommand array-subtract ask break call clear-array
+syn keyword sqrCommand close columns commit concat connect
+syn keyword sqrCommand create-array create-color-palette date-time
+syn keyword sqrCommand display divide do dollar-symbol else encode
+syn keyword sqrCommand end-evaluate end-if end-while evaluate
+syn keyword sqrCommand execute extract find get get-color goto
+syn keyword sqrCommand graphic if input last-page let lookup
+syn keyword sqrCommand lowercase mbtosbs money-symbol move
+syn keyword sqrCommand multiply new-page new-report next-column
+syn keyword sqrCommand next-listing no-formfeed open page-number
+syn keyword sqrCommand page-size position print print-bar-code
+syn keyword sqrCommand print-chart print-direct print-image
+syn keyword sqrCommand printer-deinit printer-init put read
+syn keyword sqrCommand rollback security set-color set-delay-print
+syn keyword sqrCommand set-generations set-levels set-members
+syn keyword sqrCommand sbtombs show stop string subtract toc-entry
+syn keyword sqrCommand unstring uppercase use use-column
+syn keyword sqrCommand use-printer-type use-procedure use-report
+syn keyword sqrCommand while write
+
+syn keyword sqrParam 3d-effects after after-bold after-page
+syn keyword sqrParam after-report after-toc and as at-end before
+syn keyword sqrParam background batch-mode beep before-bold
+syn keyword sqrParam before-page before-report before-toc blink
+syn keyword sqrParam bold border bottom-margin box break by
+syn keyword sqrParam caption center char char-size char-width
+syn keyword sqrParam chars-inch chart-size checksum cl
+syn keyword sqrParam clear-line clear-screen color color-palette
+syn keyword sqrParam cs color_ data-array
+syn keyword sqrParam data-array-column-count
+syn keyword sqrParam data-array-column-labels
+syn keyword sqrParam data-array-row-count data-labels date
+syn keyword sqrParam date-edit-mask date-seperator
+syn keyword sqrParam day-of-week-case day-of-week-full
+syn keyword sqrParam day-of-week-short decimal decimal-seperator
+syn keyword sqrParam default-numeric delay distinct dot-leader
+syn keyword sqrParam edit-option-ad edit-option-am
+syn keyword sqrParam edit-option-bc edit-option-na
+syn keyword sqrParam edit-option-pm encoding entry erase-page
+syn keyword sqrParam extent field fill fixed fixed_nolf float
+syn keyword sqrParam font font-style font-type footing
+syn keyword sqrParam footing-size foreground for-append
+syn keyword sqrParam for-reading for-reports for-tocs
+syn keyword sqrParam for-writing format formfeed from goto-top
+syn keyword sqrParam group having heading heading-size height
+syn keyword sqrParam horz-line image-size in indentation
+syn keyword sqrParam init-string input-date-edit-mask insert
+syn keyword sqrParam integer into item-color item-size key
+syn keyword sqrParam layout left-margin legend legend-placement
+syn keyword sqrParam legend-presentation legend-title level
+syn keyword sqrParam line-height line-size line-width lines-inch
+syn keyword sqrParam local locale loops max-columns max-lines
+syn keyword sqrParam maxlen money money-edit-mask money-sign
+syn keyword sqrParam money-sign-location months-case months-full
+syn keyword sqrParam months-short name need newline newpage
+syn keyword sqrParam no-advance nolf noline noprompt normal not
+syn keyword sqrParam nowait number number-edit-mask on-break
+syn keyword sqrParam on-error or order orientation page-depth
+syn keyword sqrParam paper-size pie-segment-explode
+syn keyword sqrParam pie-segment-percent-display
+syn keyword sqrParam pie-segment-quantity-display pitch
+syn keyword sqrParam point-markers point-size printer
+syn keyword sqrParam printer-type quiet record reset-string
+syn keyword sqrParam return_value reverse right-margin rows save
+syn keyword sqrParam select size skip skiplines sort source
+syn keyword sqrParam sqr-database sqr-platform startup-file
+syn keyword sqrParam status stop sub-title symbol-set system
+syn keyword sqrParam table text thousand-seperator
+syn keyword sqrParam time-seperator times title to toc
+syn keyword sqrParam top-margin type underline update using
+syn keyword sqrParam value vary vert-line wait warn when
+syn keyword sqrParam when-other where with x-axis-grid
+syn keyword sqrParam x-axis-label x-axis-major-increment
+syn keyword sqrParam x-axis-major-tick-marks x-axis-max-value
+syn keyword sqrParam x-axis-min-value x-axis-minor-increment
+syn keyword sqrParam x-axis-minor-tick-marks x-axis-rotate
+syn keyword sqrParam x-axis-scale x-axis-tick-mark-placement xor
+syn keyword sqrParam y-axis-grid y-axis-label
+syn keyword sqrParam y-axis-major-increment
+syn keyword sqrParam y-axis-major-tick-marks y-axis-max-value
+syn keyword sqrParam y-axis-min-value y-axis-minor-increment
+syn keyword sqrParam y-axis-minor-tick-marks y-axis-scale
+syn keyword sqrParam y-axis-tick-mark-placement y2-type
+syn keyword sqrParam y2-data-array y2-data-array-row-count
+syn keyword sqrParam y2-data-array-column-count
+syn keyword sqrParam y2-data-array-column-labels
+syn keyword sqrParam y2-axis-color-palette y2-axis-label
+syn keyword sqrParam y2-axis-major-increment
+syn keyword sqrParam y2-axis-major-tick-marks y2-axis-max-value
+syn keyword sqrParam y2-axis-min-value y2-axis-minor-increment
+syn keyword sqrParam y2-axis-minor-tick-marks y2-axis-scale
+
+syn keyword sqrFunction abs acos asin atan array ascii asciic ceil
+syn keyword sqrFunction cos cosh chr cond deg delete dateadd
+syn keyword sqrFunction datediff datenow datetostr e10 exp edit
+syn keyword sqrFunction exists floor getenv instr instrb isblank
+syn keyword sqrFunction isnull log log10 length lengthb lengthp
+syn keyword sqrFunction lengtht lower lpad ltrim mod nvl power rad
+syn keyword sqrFunction round range replace roman rpad rtrim rename
+syn keyword sqrFunction sign sin sinh sqrt substr substrb substrp
+syn keyword sqrFunction substrt strtodate tan tanh trunc to_char
+syn keyword sqrFunction to_multi_byte to_number to_single_byte
+syn keyword sqrFunction transform translate unicode upper wrapdepth
+
+" END GENERATED SECTION ==============================================
+
+" Variables
+syn match sqrVariable /\(\$\|#\|&\)\(\k\|\.\)*/
+
+
+" Debug compiler directives
+syn match sqrPreProc /\s*#debug\a\=\(\s\|$\)/
+syn match sqrSubstVar /{\k*}/
+
+
+" Strings
+" Note: if an undoubled ! is found, this is not a valid string
+" (SQR will treat the end of the line as a comment)
+syn match sqrString /'\(!!\|[^!']\)*'/ contains=sqrSubstVar
+syn match sqrStrOpen /'\(!!\|''\|[^!']\)*$/
+" If we find a ' followed by an unmatched ! before a matching ',
+" flag the error.
+syn match sqrError /'\(!!\|[^'!]\)*![^!]/me=e-1
+syn match sqrError /'\(!!\|[^'!]\)*!$/
+
+" Numbers:
+syn match sqrNumber /-\=\<\d*\.\=[0-9_]\>/
+
+
+
+" Comments:
+" Handle comments that start with "!=" specially; they are only valid
+" in the first column of the source line. Also, "!!" is only treated
+" as a start-comment if there is only whitespace ahead of it on the line.
+
+syn keyword sqrTodo TODO FIXME XXX DEBUG NOTE ###
+syn match sqrTodo /???/
+
+if version >= 600
+ " See also the sqrString section above for handling of ! characters
+ " inside of strings. (Those patterns override the ones below.)
+ syn match sqrComment /!\@<!!\([^!=].*\|$\)/ contains=sqrTodo
+ " the ! can't be preceeded by another !,
+ " and must be followed by at least one
+ " character other than ! or =, or immediately
+ " by the end-of-line
+ syn match sqrComment /^!=.*/ contains=sqrTodo
+ syn match sqrComment /^!!.*/ contains=sqrTodo
+ syn match sqrError /^\s\+\zs!=.*/
+ " it's an error to have "!=" preceeded by
+ " just whitespace on the line ("!="
+ " preceeded by non-whitespace is treated
+ " as neither a comment nor an error, since
+ " it is often correct, i.e.
+ " if #count != 7
+ syn match sqrError /.\+\zs!!.*/
+ " a "!!" anywhere but at the beginning of
+ " the line is always an error
+else "For versions before 6.0, same idea as above but we are limited
+ "to simple patterns only. Also, the sqrString patterns above
+ "don't seem to take precedence in v5 as they do in v6, so
+ "we split the last rule to ignore comments found inside of
+ "string literals.
+ syn match sqrComment /!\([^!=].*\|$\)/ contains=sqrTodo
+ syn match sqrComment /^!=.*/ contains=sqrTodo
+ syn match sqrComment /^!!.*/ contains=sqrTodo
+ syn match sqrError /^\s\+!=.*/
+ syn match sqrError /^[^'!]\+!!/
+ " flag !! on lines that don't have ! or '
+ syn match sqrError /^\([^!']*'[^']*'[^!']*\)\+!!/
+ " flag !! found after matched ' ' chars
+ " (that aren't also commented)
+endif
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier, only when not done already.
+" For version 5.8 and later, only when an item doesn;t have hightlighting yet.
+if version >= 508 || !exists("did_sqr_syn_inits")
+ if version < 508
+ let did_sqr_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sqrSection Statement
+ HiLink sqrParagraph Statement
+ HiLink sqrReserved Statement
+ HiLink sqrParameter Statement
+ HiLink sqrPreProc PreProc
+ HiLink sqrSubstVar PreProc
+ HiLink sqrCommand Statement
+ HiLink sqrParam Type
+ HiLink sqrFunction Special
+
+ HiLink sqrString String
+ HiLink sqrStrOpen Todo
+ HiLink sqrNumber Number
+ HiLink sqrVariable Identifier
+
+ HiLink sqrComment Comment
+ HiLink sqrTodo Todo
+ HiLink sqrError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sqr"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/squid.vim b/runtime/syntax/squid.vim
new file mode 100644
index 000000000..554bdca09
--- /dev/null
+++ b/runtime/syntax/squid.vim
@@ -0,0 +1,149 @@
+" Vim syntax file
+" Language: Squid config file
+" Maintainer: Klaus Muth <klaus@hampft.de>
+" Last Change: 2004 Feb 01
+" URL: http://www.hampft.de/vim/syntax/squid.vim
+" ThanksTo: Ilya Sher <iso8601@mail.ru>
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" squid.conf syntax seems to be case insensitive
+syn case ignore
+
+syn keyword squidTodo contained TODO
+syn match squidComment "#.*$" contains=squidTodo,squidTag
+syn match squidTag contained "TAG: .*$"
+
+" Lots & lots of Keywords!
+syn keyword squidConf acl always_direct announce_host
+syn keyword squidConf announce_period announce_port announce_to
+syn keyword squidConf anonymize_headers append_domain
+syn keyword squidConf as_whois_server authenticate_children
+syn keyword squidConf authenticate_program authenticate_ttl
+syn keyword squidConf broken_posts buffered_logs cache_access_log
+syn keyword squidConf cache_announce cache_dir cache_dns_program
+syn keyword squidConf cache_effective_group cache_effective_user
+syn keyword squidConf cache_host cache_host_acl cache_host_domain
+syn keyword squidConf cache_log cache_mem cache_mem_high
+syn keyword squidConf cache_mem_low cache_mgr cachemgr_passwd
+syn keyword squidConf cache_peer cache_stoplist
+syn keyword squidConf cache_stoplist_pattern cache_store_log
+syn keyword squidConf cache_swap cache_swap_high cache_swap_log
+syn keyword squidConf cache_swap_low client_db client_lifetime
+syn keyword squidConf client_netmask connect_timeout coredump_dir
+syn keyword squidConf dead_peer_timeout debug_options delay_access
+syn keyword squidConf delay_class delay_initial_bucket_level
+syn keyword squidConf delay_parameters delay_pools dns_children
+syn keyword squidConf dns_defnames dns_nameservers dns_testnames
+syn keyword squidConf emulate_httpd_log err_html_text
+syn keyword squidConf fake_user_agent firewall_ip forwarded_for
+syn keyword squidConf forward_snmpd_port fqdncache_size
+syn keyword squidConf ftpget_options ftpget_program ftp_list_width
+syn keyword squidConf ftp_user half_closed_clients
+syn keyword squidConf hierarchy_stoplist htcp_port http_access
+syn keyword squidConf http_anonymizer httpd_accel httpd_accel_host
+syn keyword squidConf httpd_accel_port httpd_accel_uses_host_header
+syn keyword squidConf httpd_accel_with_proxy http_port
+syn keyword squidConf http_reply_access icp_access icp_hit_stale
+syn keyword squidConf icp_port icp_query_timeout ident_lookup
+syn keyword squidConf ident_lookup_access ident_timeout
+syn keyword squidConf incoming_http_average incoming_icp_average
+syn keyword squidConf inside_firewall ipcache_high ipcache_low
+syn keyword squidConf ipcache_size local_domain local_ip
+syn keyword squidConf logfile_rotate log_fqdn log_icp_queries
+syn keyword squidConf log_mime_hdrs maximum_object_size
+syn keyword squidConf maximum_single_addr_tries mcast_groups
+syn keyword squidConf mcast_icp_query_timeout mcast_miss_addr
+syn keyword squidConf mcast_miss_encode_key mcast_miss_port
+syn keyword squidConf memory_pools mime_table min_http_poll_cnt
+syn keyword squidConf min_icp_poll_cnt minimum_direct_hops
+syn keyword squidConf minimum_retry_timeout miss_access
+syn keyword squidConf negative_dns_ttl negative_ttl
+syn keyword squidConf neighbor_timeout neighbor_type_domain
+syn keyword squidConf netdb_high netdb_low netdb_ping_period
+syn keyword squidConf netdb_ping_rate no_cache passthrough_proxy
+syn keyword squidConf pconn_timeout pid_filename pinger_program
+syn keyword squidConf positive_dns_ttl prefer_direct proxy_auth
+syn keyword squidConf proxy_auth_realm query_icmp quick_abort
+syn keyword squidConf quick_abort quick_abort_max quick_abort_min
+syn keyword squidConf quick_abort_pct range_offset_limit
+syn keyword squidConf read_timeout redirect_children
+syn keyword squidConf redirect_program
+syn keyword squidConf redirect_rewrites_host_header reference_age
+syn keyword squidConf reference_age refresh_pattern reload_into_ims
+syn keyword squidConf request_size request_timeout
+syn keyword squidConf shutdown_lifetime single_parent_bypass
+syn keyword squidConf siteselect_timeout snmp_access
+syn keyword squidConf snmp_incoming_address snmp_port source_ping
+syn keyword squidConf ssl_proxy store_avg_object_size
+syn keyword squidConf store_objects_per_bucket strip_query_terms
+syn keyword squidConf swap_level1_dirs swap_level2_dirs
+syn keyword squidConf tcp_incoming_address tcp_outgoing_address
+syn keyword squidConf tcp_recv_bufsize test_reachability
+syn keyword squidConf udp_hit_obj udp_hit_obj_size
+syn keyword squidConf udp_incoming_address udp_outgoing_address
+syn keyword squidConf unique_hostname unlinkd_program
+syn keyword squidConf uri_whitespace useragent_log visible_hostname
+syn keyword squidConf wais_relay wais_relay_host wais_relay_port
+
+syn keyword squidOpt proxy-only weight ttl no-query default
+syn keyword squidOpt round-robin multicast-responder
+syn keyword squidOpt on off all deny allow
+
+" Security Actions for cachemgr_passwd
+syn keyword squidAction shutdown info parameter server_list
+syn keyword squidAction client_list
+syn match squidAction "stats/\(objects\|vm_objects\|utilization\|ipcache\|fqdncache\|dns\|redirector\|io\|reply_headers\|filedescriptors\|netdb\)"
+syn match squidAction "log\(/\(status\|enable\|disable\|clear\)\)\="
+syn match squidAction "squid\.conf"
+
+" Keywords for the acl-config
+syn keyword squidAcl url_regex urlpath_regex referer_regex port proto
+syn keyword squidAcl req_mime_type rep_mime_type
+syn keyword squidAcl method browser user src dst
+
+syn match squidNumber "\<\d\+\>"
+syn match squidIP "\<\d\{1,3}\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\>"
+syn match squidStr "\(^\s*acl\s\+\S\+\s\+\(\S*_regex\|re[pq]_mime_type\|browser\|_domain\|user\)\+\s\+\)\@<=.*" contains=squidRegexOpt
+syn match squidRegexOpt contained "\(^\s*acl\s\+\S\+\s\+\S\+\(_regex\|_mime_type\)\s\+\)\@<=[-+]i\s\+"
+
+" All config is in one line, so this has to be sufficient
+" Make it fast like hell :)
+syn sync minlines=3
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_squid_syntax_inits")
+ if version < 508
+ let did_squid_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink squidTodo Todo
+ HiLink squidComment Comment
+ HiLink squidTag Special
+ HiLink squidConf Keyword
+ HiLink squidOpt Constant
+ HiLink squidAction String
+ HiLink squidNumber Number
+ HiLink squidIP Number
+ HiLink squidAcl Keyword
+ HiLink squidStr String
+ HiLink squidRegexOpt Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "squid"
+
+" vim: ts=8
diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim
new file mode 100644
index 000000000..c2da72ad7
--- /dev/null
+++ b/runtime/syntax/sshconfig.vim
@@ -0,0 +1,99 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: OpenSSH server configuration file (ssh_config)
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-05-06
+" URL: http://trific.ath.cx/Ftp/vim/syntax/sshconfig.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if version >= 600
+ setlocal iskeyword=_,-,a-z,A-Z,48-57
+else
+ set iskeyword=_,-,a-z,A-Z,48-57
+endif
+
+syn case ignore
+
+" Comments
+syn match sshconfigComment "#.*$" contains=sshconfigTodo
+syn keyword sshconfigTodo TODO FIXME NOT contained
+
+" Constants
+syn keyword sshconfigYesNo yes no ask
+syn keyword sshconfigCipher blowfish des 3des
+syn keyword sshconfigCipher aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
+syn keyword sshconfigCipher arcfour aes192-cbc aes256-cbc
+syn keyword sshconfigMAC hmac-md5 hmac-sha1 hmac-ripemd160 hmac-sha1-96
+syn keyword sshconfigMAC hmac-md5-96
+syn keyword sshconfigHostKeyAlg ssh-rsa ssh-dss
+syn keyword sshconfigPreferredAuth hostbased publickey password
+syn keyword sshconfigPreferredAuth keyboard-interactive
+syn keyword sshconfigLogLevel QUIET FATAL ERROR INFO VERBOSE
+syn keyword sshconfigLogLevel DEBUG DEBUG1 DEBUG2 DEBUG3
+syn keyword sshconfigSysLogFacility DAEMON USER AUTH LOCAL0 LOCAL1 LOCAL2
+syn keyword sshconfigSysLogFacility LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7
+syn match sshconfigSpecial "[*?]"
+syn match sshconfigNumber "\d\+"
+syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>"
+syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>"
+syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>"
+
+" Keywords
+syn keyword sshconfigHostSect Host
+syn keyword sshconfigKeyword AFSTokenPassing BatchMode BindAddress
+syn keyword sshconfigKeyword ChallengeResponseAuthentication CheckHostIP
+syn keyword sshconfigKeyword Cipher Ciphers ClearAllForwardings Compression
+syn keyword sshconfigKeyword CompressionLevel ConnectionAttempts
+syn keyword sshconfigKeyword DynamicForward EscapeChar ForwardAgent ForwardX11
+syn keyword sshconfigKeyword GatewayPorts GlobalKnownHostsFile
+syn keyword sshconfigKeyword HostbasedAuthentication HostKeyAlgorithms
+syn keyword sshconfigKeyword HostKeyAlias HostName IdentityFile KeepAlive
+syn keyword sshconfigKeyword KerberosAuthentication KerberosTgtPassing
+syn keyword sshconfigKeyword LocalForward LogLevel MACs
+syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost
+syn keyword sshconfigKeyword NumberOfPasswordPrompts PasswordAuthentication
+syn keyword sshconfigKeyword Port PreferredAuthentications Protocol
+syn keyword sshconfigKeyword ProxyCommand PubkeyAuthentication RemoteForward
+syn keyword sshconfigKeyword RhostsAuthentication RhostsRSAAuthentication
+syn keyword sshconfigKeyword RSAAuthentication SmartcardDevice
+syn keyword sshconfigKeyword StrictHostKeyChecking UsePrivilegedPort User
+syn keyword sshconfigKeyword UserKnownHostsFile XAuthLocation
+
+" Define the default highlighting
+if version >= 508 || !exists("did_sshconfig_syntax_inits")
+ if version < 508
+ let did_sshconfig_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sshconfigComment Comment
+ HiLink sshconfigTodo Todo
+ HiLink sshconfigHostPort sshconfigConstant
+ HiLink sshconfigNumber sshconfigConstant
+ HiLink sshconfigConstant Constant
+ HiLink sshconfigYesNo sshconfigEnum
+ HiLink sshconfigCipher sshconfigEnum
+ HiLink sshconfigMAC sshconfigEnum
+ HiLink sshconfigHostKeyAlg sshconfigEnum
+ HiLink sshconfigLogLevel sshconfigEnum
+ HiLink sshconfigSysLogFacility sshconfigEnum
+ HiLink sshconfigPreferredAuth sshconfigEnum
+ HiLink sshconfigEnum Function
+ HiLink sshconfigSpecial Special
+ HiLink sshconfigKeyword Keyword
+ HiLink sshconfigHostSect Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sshconfig"
+
diff --git a/runtime/syntax/sshdconfig.vim b/runtime/syntax/sshdconfig.vim
new file mode 100644
index 000000000..c334304f9
--- /dev/null
+++ b/runtime/syntax/sshdconfig.vim
@@ -0,0 +1,98 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: OpenSSH server configuration file (sshd_config)
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-05-06
+" URL: http://trific.ath.cx/Ftp/vim/syntax/sshdconfig.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+if version >= 600
+ setlocal iskeyword=_,-,a-z,A-Z,48-57
+else
+ set iskeyword=_,-,a-z,A-Z,48-57
+endif
+
+syn case ignore
+
+" Comments
+syn match sshdconfigComment "#.*$" contains=sshdconfigTodo
+syn keyword sshdconfigTodo TODO FIXME NOT contained
+
+" Constants
+syn keyword sshdconfigYesNo yes no
+syn keyword sshdconfigCipher aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
+syn keyword sshdconfigCipher aes192-cbc aes256-cbc
+syn keyword sshdconfigCipher arcfour
+syn keyword sshdconfigMAC hmac-md5 hmac-sha1 hmac-ripemd160 hmac-sha1-96
+syn keyword sshdconfigMAC hmac-md5-96
+syn keyword sshdconfigRootLogin without-password forced-commands-only
+syn keyword sshdconfigLogLevel QUIET FATAL ERROR INFO VERBOSE
+syn keyword sshdconfigLogLevel DEBUG DEBUG1 DEBUG2 DEBUG3
+syn keyword sshdconfigSysLogFacility DAEMON USER AUTH LOCAL0 LOCAL1 LOCAL2
+syn keyword sshdconfigSysLogFacility LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7
+syn match sshdconfigSpecial "[*?]"
+syn match sshdconfigNumber "\d\+"
+syn match sshdconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>"
+syn match sshdconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>"
+syn match sshdconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}:\d\+\>"
+syn match sshdconfigTime "\<\(\d\+[sSmMhHdDwW]\)\+\>"
+
+" Keywords
+syn keyword sshdconfigKeyword AFSTokenPassing AllowGroups AllowTcpForwarding
+syn keyword sshdconfigKeyword AllowUsers AuthorizedKeysFile Banner
+syn keyword sshdconfigKeyword ChallengeResponseAuthentication Ciphers
+syn keyword sshdconfigKeyword ClientAliveInterval ClientAliveCountMax
+syn keyword sshdconfigKeyword Compression DenyGroups DenyUsers GatewayPorts
+syn keyword sshdconfigKeyword HostbasedAuthentication HostKey IgnoreRhosts
+syn keyword sshdconfigKeyword IgnoreUserKnownHosts KeepAlive
+syn keyword sshdconfigKeyword KerberosAuthentication KerberosOrLocalPasswd
+syn keyword sshdconfigKeyword KerberosTgtPassing KerberosTicketCleanup
+syn keyword sshdconfigKeyword KeyRegenerationInterval ListenAddress
+syn keyword sshdconfigKeyword LoginGraceTime LogLevel MACs MaxStartups
+syn keyword sshdconfigKeyword PAMAuthenticationViaKbdInt
+syn keyword sshdconfigKeyword PasswordAuthentication PermitEmptyPasswords
+syn keyword sshdconfigKeyword PermitRootLogin PermitUserEnvironment PidFile
+syn keyword sshdconfigKeyword Port PrintLastLog PrintMotd Protocol
+syn keyword sshdconfigKeyword PubkeyAuthentication RhostsAuthentication
+syn keyword sshdconfigKeyword RhostsRSAAuthentication RSAAuthentication
+syn keyword sshdconfigKeyword ServerKeyBits StrictModes Subsystem
+syn keyword sshdconfigKeyword SyslogFacility UseLogin UsePrivilegeSeparation
+syn keyword sshdconfigKeyword VerifyReverseMapping X11DisplayOffset
+syn keyword sshdconfigKeyword X11Forwarding X11UseLocalhost XAuthLocation
+
+" Define the default highlighting
+if version >= 508 || !exists("did_sshdconfig_syntax_inits")
+ if version < 508
+ let did_sshdconfig_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink sshdconfigComment Comment
+ HiLink sshdconfigTodo Todo
+ HiLink sshdconfigHostPort sshdconfigConstant
+ HiLink sshdconfigTime sshdconfigConstant
+ HiLink sshdconfigNumber sshdconfigConstant
+ HiLink sshdconfigConstant Constant
+ HiLink sshdconfigYesNo sshdconfigEnum
+ HiLink sshdconfigCipher sshdconfigEnum
+ HiLink sshdconfigMAC sshdconfigEnum
+ HiLink sshdconfigRootLogin sshdconfigEnum
+ HiLink sshdconfigLogLevel sshdconfigEnum
+ HiLink sshdconfigSysLogFacility sshdconfigEnum
+ HiLink sshdconfigEnum Function
+ HiLink sshdconfigSpecial Special
+ HiLink sshdconfigKeyword Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "sshdconfig"
diff --git a/runtime/syntax/st.vim b/runtime/syntax/st.vim
new file mode 100644
index 000000000..d629eb4ed
--- /dev/null
+++ b/runtime/syntax/st.vim
@@ -0,0 +1,102 @@
+" Vim syntax file
+" Language: Smalltalk
+" Maintainer: Arndt Hesse <hesse@self.de>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" some Smalltalk keywords and standard methods
+syn keyword stKeyword super self class true false new not
+syn keyword stKeyword notNil isNil inspect out nil
+syn match stMethod "\<do\>:"
+syn match stMethod "\<whileTrue\>:"
+syn match stMethod "\<whileFalse\>:"
+syn match stMethod "\<ifTrue\>:"
+syn match stMethod "\<ifFalse\>:"
+syn match stMethod "\<put\>:"
+syn match stMethod "\<to\>:"
+syn match stMethod "\<at\>:"
+syn match stMethod "\<add\>:"
+syn match stMethod "\<new\>:"
+syn match stMethod "\<for\>:"
+syn match stMethod "\<methods\>:"
+syn match stMethod "\<methodsFor\>:"
+syn match stMethod "\<instanceVariableNames\>:"
+syn match stMethod "\<classVariableNames\>:"
+syn match stMethod "\<poolDictionaries\>:"
+syn match stMethod "\<subclass\>:"
+
+" the block of local variables of a method
+syn region stLocalVariables start="^[ \t]*|" end="|"
+
+" the Smalltalk comment
+syn region stComment start="\"" end="\""
+
+" the Smalltalk strings and single characters
+syn region stString start='\'' skip="''" end='\''
+syn match stCharacter "$."
+
+syn case ignore
+
+" the symols prefixed by a '#'
+syn match stSymbol "\(#\<[a-z_][a-z0-9_]*\>\)"
+syn match stSymbol "\(#'[^']*'\)"
+
+" the variables in a statement block for loops
+syn match stBlockVariable "\(:[ \t]*\<[a-z_][a-z0-9_]*\>[ \t]*\)\+|" contained
+
+" some representations of numbers
+syn match stNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+syn match stFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+syn match stFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
+
+syn case match
+
+" a try to higlight paren mismatches
+syn region stParen transparent start='(' end=')' contains=ALLBUT,stParenError
+syn match stParenError ")"
+syn region stBlock transparent start='\[' end='\]' contains=ALLBUT,stBlockError
+syn match stBlockError "\]"
+syn region stSet transparent start='{' end='}' contains=ALLBUT,stSetError
+syn match stSetError "}"
+
+hi link stParenError stError
+hi link stSetError stError
+hi link stBlockError stError
+
+" synchronization for syntax analysis
+syn sync minlines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_st_syntax_inits")
+ if version < 508
+ let did_st_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink stKeyword Statement
+ HiLink stMethod Statement
+ HiLink stComment Comment
+ HiLink stCharacter Constant
+ HiLink stString Constant
+ HiLink stSymbol Special
+ HiLink stNumber Type
+ HiLink stFloat Type
+ HiLink stError Error
+ HiLink stLocalVariables Identifier
+ HiLink stBlockVariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "st"
diff --git a/runtime/syntax/stp.vim b/runtime/syntax/stp.vim
new file mode 100644
index 000000000..f4f0f3b61
--- /dev/null
+++ b/runtime/syntax/stp.vim
@@ -0,0 +1,167 @@
+" Vim syntax file
+" Language: Stored Procedures (STP)
+" Maintainer: Jeff Lanzarotta (jefflanzarotta@yahoo.com)
+" URL: http://lanzarotta.tripod.com/vim/syntax/stp.vim.zip
+" Last Change: March 05, 2002
+
+" For version 5.x, clear all syntax items.
+" For version 6.x, quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Specials.
+syn keyword stpSpecial null
+
+" Keywords.
+syn keyword stpKeyword begin break call case create deallocate dynamic
+syn keyword stpKeyword execute from function go grant
+syn keyword stpKeyword index insert into leave max min on output procedure
+syn keyword stpKeyword public result return returns scroll table to
+syn keyword stpKeyword when
+syn match stpKeyword "\<end\>"
+
+" Conditional.
+syn keyword stpConditional if else elseif then
+syn match stpConditional "\<end\s\+if\>"
+
+" Repeats.
+syn keyword stpRepeat for while loop
+syn match stpRepeat "\<end\s\+loop\>"
+
+" Operators.
+syn keyword stpOperator asc not and or desc group having in is any some all
+syn keyword stpOperator between exists like escape with union intersect minus
+syn keyword stpOperator out prior distinct sysdate
+
+" Statements.
+syn keyword stpStatement alter analyze as audit avg by close clustered comment
+syn keyword stpStatement commit continue count create cursor declare delete
+syn keyword stpStatement drop exec execute explain fetch from index insert
+syn keyword stpStatement into lock max min next noaudit nonclustered open
+syn keyword stpStatement order output print raiserror recompile rename revoke
+syn keyword stpStatement rollback savepoint select set sum transaction
+syn keyword stpStatement truncate unique update values where
+
+" Functions.
+syn keyword stpFunction abs acos ascii asin atan atn2 avg ceiling charindex
+syn keyword stpFunction charlength convert col_name col_length cos cot count
+syn keyword stpFunction curunreservedpgs datapgs datalength dateadd datediff
+syn keyword stpFunction datename datepart db_id db_name degree difference
+syn keyword stpFunction exp floor getdate hextoint host_id host_name index_col
+syn keyword stpFunction inttohex isnull lct_admin log log10 lower ltrim max
+syn keyword stpFunction min now object_id object_name patindex pi pos power
+syn keyword stpFunction proc_role radians rand replace replicate reserved_pgs
+syn keyword stpFunction reverse right rtrim rowcnt round show_role sign sin
+syn keyword stpFunction soundex space sqrt str stuff substr substring sum
+syn keyword stpFunction suser_id suser_name tan tsequal upper used_pgs user
+syn keyword stpFunction user_id user_name valid_name valid_user message
+
+" Types.
+syn keyword stpType binary bit char datetime decimal double float image
+syn keyword stpType int integer long money nchar numeric precision real
+syn keyword stpType smalldatetime smallint smallmoney text time tinyint
+syn keyword stpType timestamp varbinary varchar
+
+" Globals.
+syn match stpGlobals '@@char_convert'
+syn match stpGlobals '@@cient_csname'
+syn match stpGlobals '@@client_csid'
+syn match stpGlobals '@@connections'
+syn match stpGlobals '@@cpu_busy'
+syn match stpGlobals '@@error'
+syn match stpGlobals '@@identity'
+syn match stpGlobals '@@idle'
+syn match stpGlobals '@@io_busy'
+syn match stpGlobals '@@isolation'
+syn match stpGlobals '@@langid'
+syn match stpGlobals '@@language'
+syn match stpGlobals '@@max_connections'
+syn match stpGlobals '@@maxcharlen'
+syn match stpGlobals '@@ncharsize'
+syn match stpGlobals '@@nestlevel'
+syn match stpGlobals '@@pack_received'
+syn match stpGlobals '@@pack_sent'
+syn match stpGlobals '@@packet_errors'
+syn match stpGlobals '@@procid'
+syn match stpGlobals '@@rowcount'
+syn match stpGlobals '@@servername'
+syn match stpGlobals '@@spid'
+syn match stpGlobals '@@sqlstatus'
+syn match stpGlobals '@@testts'
+syn match stpGlobals '@@textcolid'
+syn match stpGlobals '@@textdbid'
+syn match stpGlobals '@@textobjid'
+syn match stpGlobals '@@textptr'
+syn match stpGlobals '@@textsize'
+syn match stpGlobals '@@thresh_hysteresis'
+syn match stpGlobals '@@timeticks'
+syn match stpGlobals '@@total_error'
+syn match stpGlobals '@@total_read'
+syn match stpGlobals '@@total_write'
+syn match stpGlobals '@@tranchained'
+syn match stpGlobals '@@trancount'
+syn match stpGlobals '@@transtate'
+syn match stpGlobals '@@version'
+
+" Todos.
+syn keyword stpTodo TODO FIXME XXX DEBUG NOTE
+
+" Strings and characters.
+syn match stpStringError "'.*$"
+syn match stpString "'\([^']\|''\)*'"
+
+" Numbers.
+syn match stpNumber "-\=\<\d*\.\=[0-9_]\>"
+
+" Comments.
+syn region stpComment start="/\*" end="\*/" contains=stpTodo
+syn match stpComment "--.*" contains=stpTodo
+syn sync ccomment stpComment
+
+" Parens.
+syn region stpParen transparent start='(' end=')' contains=ALLBUT,stpParenError
+syn match stpParenError ")"
+
+" Syntax Synchronizing.
+syn sync minlines=10 maxlines=100
+
+" Define the default highlighting.
+" For version 5.x and earlier, only when not done already.
+" For version 5.8 and later, only when and item doesn't have highlighting yet.
+if version >= 508 || !exists("did_stp_syn_inits")
+ if version < 508
+ let did_stp_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink stpConditional Conditional
+ HiLink stpComment Comment
+ HiLink stpKeyword Keyword
+ HiLink stpNumber Number
+ HiLink stpOperator Operator
+ HiLink stpSpecial Special
+ HiLink stpStatement Statement
+ HiLink stpString String
+ HiLink stpStringError Error
+ HiLink stpType Type
+ HiLink stpTodo Todo
+ HiLink stpFunction Function
+ HiLink stpGlobals Macro
+ HiLink stpParen Normal
+ HiLink stpParenError Error
+ HiLink stpSQLKeyword Function
+ HiLink stpRepeat Repeat
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "stp"
+
+" vim ts=8 sw=2
diff --git a/runtime/syntax/strace.vim b/runtime/syntax/strace.vim
new file mode 100644
index 000000000..80cd262ef
--- /dev/null
+++ b/runtime/syntax/strace.vim
@@ -0,0 +1,66 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: strace output
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2002-10-10
+" URL: http://trific.ath.cx/Ftp/vim/syntax/strace.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+syn case match
+
+" Parse the line
+syn match straceSpecialChar "\\\d\d\d\|\\." contained
+syn region straceString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=straceSpecialChar oneline
+syn match straceNumber "\W[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="lc=1
+syn match straceNumber "\W0x\x\+"lc=1
+syn match straceNumberRHS "\W\(0x\x\+\|-\=\d\+\)"lc=1 contained
+syn match straceOtherRHS "?" contained
+syn match straceConstant "[A-Z_]\{2,}"
+syn region straceVerbosed start="(" end=")" matchgroup=Normal contained oneline
+syn region straceReturned start="\s=\s" end="$" contains=StraceEquals,straceNumberRHS,straceOtherRHS,straceConstant,straceVerbosed oneline transparent
+syn match straceEquals "\s=\s"ms=s+1,me=e-1
+syn match straceParenthesis "[][(){}]"
+syn match straceSysCall "^\w\+"
+syn match straceOtherPID "^\[[^]]*\]" contains=stracePID,straceNumber nextgroup=straceSysCallEmbed skipwhite
+syn match straceSysCallEmbed "\w\+" contained
+syn keyword stracePID pid contained
+syn match straceOperator "[-+=*/!%&|:,]"
+syn region straceComment start="/\*" end="\*/" oneline
+
+" Define the default highlighting
+if version >= 508 || !exists("did_strace_syntax_inits")
+ if version < 508
+ let did_strace_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink straceComment Comment
+ HiLink straceVerbosed Comment
+ HiLink stracePID PreProc
+ HiLink straceNumber Number
+ HiLink straceNumberRHS Type
+ HiLink straceOtherRHS Type
+ HiLink straceString String
+ HiLink straceConstant Function
+ HiLink straceEquals Type
+ HiLink straceSysCallEmbed straceSysCall
+ HiLink straceSysCall Statement
+ HiLink straceParenthesis Statement
+ HiLink straceOperator Normal
+ HiLink straceSpecialChar Special
+ HiLink straceOtherPID PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "strace"
diff --git a/runtime/syntax/svn.vim b/runtime/syntax/svn.vim
new file mode 100644
index 000000000..5ec3236c5
--- /dev/null
+++ b/runtime/syntax/svn.vim
@@ -0,0 +1,46 @@
+" Vim syntax file
+" Language: Subversion (svn) commit file
+" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
+" URL: http://www.hlabs.spb.ru/vim/svn.vim
+" Last Change: $Date$
+" $Revision$
+
+" For version 5.x: Clear all syntax items.
+" For version 6.x: Quit when a syntax file was already loaded.
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn region svnRegion start="--This line, and those below, will be ignored--" end="\%$" contains=ALL
+syn match svnRemoved "^D .*$" contained
+syn match svnAdded "^A[ M] .*$" contained
+syn match svnModified "^M[ M] .*$" contained
+syn match svnProperty "^_M .*$" contained
+
+" Synchronization.
+syn sync clear
+syn sync match svnSync grouphere svnRegion "--This line, and those below, will be ignored--"me=s-1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already.
+" For version 5.8 and later: only when an item doesn't have highlighting yet.
+if version >= 508 || !exists("did_svn_syn_inits")
+ if version <= 508
+ let did_svn_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink svnRegion Comment
+ HiLink svnRemoved Constant
+ HiLink svnAdded Identifier
+ HiLink svnModified Special
+ HiLink svnProperty Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "svn"
diff --git a/runtime/syntax/syncolor.vim b/runtime/syntax/syncolor.vim
new file mode 100644
index 000000000..8d0064db1
--- /dev/null
+++ b/runtime/syntax/syncolor.vim
@@ -0,0 +1,85 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Sep 12
+
+" This file sets up the default methods for highlighting.
+" It is loaded from "synload.vim" and from Vim for ":syntax reset".
+" Also used from init_highlight().
+
+if !exists("syntax_cmd") || syntax_cmd == "on"
+ " ":syntax on" works like in Vim 5.7: set colors but keep links
+ command -nargs=* SynColor hi <args>
+ command -nargs=* SynLink hi link <args>
+else
+ if syntax_cmd == "enable"
+ " ":syntax enable" keeps any existing colors
+ command -nargs=* SynColor hi def <args>
+ command -nargs=* SynLink hi def link <args>
+ elseif syntax_cmd == "reset"
+ " ":syntax reset" resets all colors to the default
+ command -nargs=* SynColor hi <args>
+ command -nargs=* SynLink hi! link <args>
+ else
+ " User defined syncolor file has already set the colors.
+ finish
+ endif
+endif
+
+" Many terminals can only use six different colors (plus black and white).
+" Therefore the number of colors used is kept low. It doesn't look nice with
+" too many colors anyway.
+" Careful with "cterm=bold", it changes the color to bright for some terminals.
+" There are two sets of defaults: for a dark and a light background.
+if &background == "dark"
+ SynColor Comment term=bold cterm=NONE ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#80a0ff guibg=NONE
+ SynColor Constant term=underline cterm=NONE ctermfg=Magenta ctermbg=NONE gui=NONE guifg=#ffa0a0 guibg=NONE
+ SynColor Special term=bold cterm=NONE ctermfg=LightRed ctermbg=NONE gui=NONE guifg=Orange guibg=NONE
+ SynColor Identifier term=underline cterm=bold ctermfg=Cyan ctermbg=NONE gui=NONE guifg=#40ffff guibg=NONE
+ SynColor Statement term=bold cterm=NONE ctermfg=Yellow ctermbg=NONE gui=bold guifg=#ffff60 guibg=NONE
+ SynColor PreProc term=underline cterm=NONE ctermfg=LightBlue ctermbg=NONE gui=NONE guifg=#ff80ff guibg=NONE
+ SynColor Type term=underline cterm=NONE ctermfg=LightGreen ctermbg=NONE gui=bold guifg=#60ff60 guibg=NONE
+ SynColor Underlined term=underline cterm=underline ctermfg=LightBlue gui=underline guifg=#80a0ff
+ SynColor Ignore term=NONE cterm=NONE ctermfg=black ctermbg=NONE gui=NONE guifg=bg guibg=NONE
+else
+ SynColor Comment term=bold cterm=NONE ctermfg=DarkBlue ctermbg=NONE gui=NONE guifg=Blue guibg=NONE
+ SynColor Constant term=underline cterm=NONE ctermfg=DarkRed ctermbg=NONE gui=NONE guifg=Magenta guibg=NONE
+ SynColor Special term=bold cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=SlateBlue guibg=NONE
+ SynColor Identifier term=underline cterm=NONE ctermfg=DarkCyan ctermbg=NONE gui=NONE guifg=DarkCyan guibg=NONE
+ SynColor Statement term=bold cterm=NONE ctermfg=Brown ctermbg=NONE gui=bold guifg=Brown guibg=NONE
+ SynColor PreProc term=underline cterm=NONE ctermfg=DarkMagenta ctermbg=NONE gui=NONE guifg=Purple guibg=NONE
+ SynColor Type term=underline cterm=NONE ctermfg=DarkGreen ctermbg=NONE gui=bold guifg=SeaGreen guibg=NONE
+ SynColor Underlined term=underline cterm=underline ctermfg=DarkMagenta gui=underline guifg=SlateBlue
+ SynColor Ignore term=NONE cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=bg guibg=NONE
+endif
+SynColor Error term=reverse cterm=NONE ctermfg=White ctermbg=Red gui=NONE guifg=White guibg=Red
+SynColor Todo term=standout cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Blue guibg=Yellow
+
+" Common groups that link to default highlighting.
+" You can specify other highlighting easily.
+SynLink String Constant
+SynLink Character Constant
+SynLink Number Constant
+SynLink Boolean Constant
+SynLink Float Number
+SynLink Function Identifier
+SynLink Conditional Statement
+SynLink Repeat Statement
+SynLink Label Statement
+SynLink Operator Statement
+SynLink Keyword Statement
+SynLink Exception Statement
+SynLink Include PreProc
+SynLink Define PreProc
+SynLink Macro PreProc
+SynLink PreCondit PreProc
+SynLink StorageClass Type
+SynLink Structure Type
+SynLink Typedef Type
+SynLink Tag Special
+SynLink SpecialChar Special
+SynLink Delimiter Special
+SynLink SpecialComment Special
+SynLink Debug Special
+
+delcommand SynColor
+delcommand SynLink
diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim
new file mode 100644
index 000000000..f816bc2d2
--- /dev/null
+++ b/runtime/syntax/synload.vim
@@ -0,0 +1,69 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 May 21
+
+" This file sets up for syntax highlighting.
+" It is loaded from "syntax.vim" and "manual.vim".
+" 1. Set the default highlight groups.
+" 2. Install Syntax autocommands for all the available syntax files.
+
+if !has("syntax")
+ finish
+endif
+
+" let others know that syntax has been switched on
+let syntax_on = 1
+
+" Set the default highlighting colors. Use a color scheme if specified.
+if exists("colors_name")
+ exe "colors " . colors_name
+else
+ runtime! syntax/syncolor.vim
+endif
+
+" Line continuation is used here, remove 'C' from 'cpoptions'
+let s:cpo_save = &cpo
+set cpo&vim
+
+" First remove all old syntax autocommands.
+au! Syntax
+
+au Syntax * call s:SynSet()
+
+fun! s:SynSet()
+ " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
+ syn clear
+ if exists("b:current_syntax")
+ unlet b:current_syntax
+ endif
+
+ let s = expand("<amatch>")
+ if s == "ON"
+ " :set syntax=ON
+ if &filetype == ""
+ echohl ErrorMsg
+ echo "filetype unknown"
+ echohl None
+ endif
+ let s = &filetype
+ endif
+
+ if s != ""
+ " Load the syntax file(s)
+" if has("mac")
+" exe "runtime! syntax:" . s . ".vim"
+" else
+ exe "runtime! syntax/" . s . ".vim"
+" endif
+ endif
+endfun
+
+
+" Source the user-specified syntax highlighting file
+if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile))
+ execute "source " . mysyntaxfile
+endif
+
+" Restore 'cpoptions'
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/syntax.vim b/runtime/syntax/syntax.vim
new file mode 100644
index 000000000..f274d93f4
--- /dev/null
+++ b/runtime/syntax/syntax.vim
@@ -0,0 +1,43 @@
+" Vim syntax support file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Sep 04
+
+" This file is used for ":syntax on".
+" It installs the autocommands and starts highlighting for all buffers.
+
+if !has("syntax")
+ finish
+endif
+
+" If Syntax highlighting appears to be on already, turn it off first, so that
+" any leftovers are cleared.
+if exists("syntax_on") || exists("syntax_manual")
+ so <sfile>:p:h/nosyntax.vim
+endif
+
+" Load the Syntax autocommands and set the default methods for highlighting.
+runtime syntax/synload.vim
+
+" Load the FileType autocommands if not done yet.
+if exists("did_load_filetypes")
+ let s:did_ft = 1
+else
+ filetype on
+ let s:did_ft = 0
+endif
+
+" Set up the connection between FileType and Syntax autocommands.
+" This makes the syntax automatically set when the file type is detected.
+augroup syntaxset
+ au! FileType * exe "set syntax=" . expand("<amatch>")
+augroup END
+
+
+" Execute the syntax autocommands for the each buffer.
+" If the filetype wasn't detected yet, do that now.
+" Always do the syntaxset autocommands, for buffers where the 'filetype'
+" already was set manually (e.g., help buffers).
+doautoall syntaxset FileType
+if !s:did_ft
+ doautoall filetypedetect BufRead
+endif
diff --git a/runtime/syntax/tads.vim b/runtime/syntax/tads.vim
new file mode 100644
index 000000000..70ffe6f21
--- /dev/null
+++ b/runtime/syntax/tads.vim
@@ -0,0 +1,184 @@
+" Vim syntax file
+" Language: TADS
+" Maintainer: Amir Karger <karger@post.harvard.edu>
+" $Date$
+" $Revision$
+" Stolen from: Bram Moolenaar's C language file
+" Newest version at: http://www.hec.utah.edu/~karger/vim/syntax/tads.vim
+" History info at the bottom of the file
+
+" TODO lots more keywords
+" global, self, etc. are special *objects*, not functions. They should
+" probably be a different color than the special functions
+" Actually, should cvtstr etc. be functions?! (change tadsFunction)
+" Make global etc. into Identifiers, since we don't have regular variables?
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful keywords
+syn keyword tadsStatement goto break return continue pass
+syn keyword tadsLabel case default
+syn keyword tadsConditional if else switch
+syn keyword tadsRepeat while for do
+syn keyword tadsStorageClass local compoundWord formatstring specialWords
+syn keyword tadsBoolean nil true
+
+" TADS keywords
+syn keyword tadsKeyword replace modify
+syn keyword tadsKeyword global self inherited
+" builtin functions
+syn keyword tadsKeyword cvtstr cvtnum caps lower upper substr
+syn keyword tadsKeyword say length
+syn keyword tadsKeyword setit setscore
+syn keyword tadsKeyword datatype proptype
+syn keyword tadsKeyword car cdr
+syn keyword tadsKeyword defined isclass
+syn keyword tadsKeyword find firstobj nextobj
+syn keyword tadsKeyword getarg argcount
+syn keyword tadsKeyword input yorn askfile
+syn keyword tadsKeyword rand randomize
+syn keyword tadsKeyword restart restore quit save undo
+syn keyword tadsException abort exit exitobj
+
+syn keyword tadsTodo contained TODO FIXME XXX
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match tadsSpecial contained "\\."
+syn region tadsDoubleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tadsSpecial,tadsEmbedded
+syn region tadsSingleString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=tadsSpecial
+" Embedded expressions in strings
+syn region tadsEmbedded contained start="<<" end=">>" contains=tadsKeyword
+
+" TADS doesn't have \xxx, right?
+"syn match cSpecial contained "\\[0-7][0-7][0-7]\=\|\\."
+"syn match cSpecialCharacter "'\\[0-7][0-7]'"
+"syn match cSpecialCharacter "'\\[0-7][0-7][0-7]'"
+
+"catch errors caused by wrong parenthesis
+"syn region cParen transparent start='(' end=')' contains=ALLBUT,cParenError,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel
+"syn match cParenError ")"
+"syn match cInParen contained "[{}]"
+syn region tadsBrace transparent start='{' end='}' contains=ALLBUT,tadsBraceError,tadsIncluded,tadsSpecial,tadsTodo
+syn match tadsBraceError "}"
+
+"integer number (TADS has no floating point numbers)
+syn case ignore
+syn match tadsNumber "\<[0-9]\+\>"
+"hex number
+syn match tadsNumber "\<0x[0-9a-f]\+\>"
+syn match tadsIdentifier "\<[a-z][a-z0-9_$]*\>"
+syn case match
+" flag an octal number with wrong digits
+syn match tadsOctalError "\<0[0-7]*[89]"
+
+" Removed complicated c_comment_strings
+syn region tadsComment start="/\*" end="\*/" contains=tadsTodo
+syn match tadsComment "//.*" contains=tadsTodo
+syntax match tadsCommentError "\*/"
+
+syn region tadsPreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=tadsComment,tadsString,tadsNumber,tadsCommentError
+syn region tadsIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match tadsIncluded contained "<[^>]*>"
+syn match tadsInclude "^\s*#\s*include\>\s*["<]" contains=tadsIncluded
+syn region tadsDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,tadsPreCondit,tadsIncluded,tadsInclude,tadsDefine,tadsInBrace,tadsIdentifier
+
+syn region tadsPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,tadsPreCondit,tadsIncluded,tadsInclude,tadsDefine,tadsInParen,tadsIdentifier
+
+" Highlight User Labels
+" TODO labels for gotos?
+"syn region cMulti transparent start='?' end=':' contains=ALLBUT,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel,cBitField
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+"syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel
+"syn match cUserCont ";\s*\I\i*\s*:$" contains=cUserLabel
+"syn match cUserCont "^\s*\I\i*\s*:[^:]" contains=cUserLabel
+"syn match cUserCont ";\s*\I\i*\s*:[^:]" contains=cUserLabel
+
+"syn match cUserLabel "\I\i*" contained
+
+" identifier: class-name [, class-name [...]] [property-list] ;
+" Don't highlight comment in class def
+syn match tadsClassDef "\<class\>[^/]*" contains=tadsObjectDef,tadsClass
+syn match tadsClass contained "\<class\>"
+syn match tadsObjectDef "\<[a-zA-Z][a-zA-Z0-9_$]*\s*:\s*[a-zA-Z0-9_$]\+\(\s*,\s*[a-zA-Z][a-zA-Z0-9_$]*\)*\(\s*;\)\="
+syn keyword tadsFunction contained function
+syn match tadsFunctionDef "\<[a-zA-Z][a-zA-Z0-9_$]*\s*:\s*function[^{]*" contains=tadsFunction
+"syn region tadsObject transparent start = '[a-zA-Z][\i$]\s*:\s*' end=";" contains=tadsBrace,tadsObjectDef
+
+" How far back do we go to find matching groups
+if !exists("tads_minlines")
+ let tads_minlines = 15
+endif
+exec "syn sync ccomment tadsComment minlines=" . tads_minlines
+if !exists("tads_sync_dist")
+ let tads_sync_dist = 100
+endif
+execute "syn sync maxlines=" . tads_sync_dist
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tads_syn_inits")
+ if version < 508
+ let did_tads_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink tadsFunctionDef Function
+ HiLink tadsFunction Structure
+ HiLink tadsClass Structure
+ HiLink tadsClassDef Identifier
+ HiLink tadsObjectDef Identifier
+" no highlight for tadsEmbedded, so it prints as normal text w/in the string
+
+ HiLink tadsOperator Operator
+ HiLink tadsStructure Structure
+ HiLink tadsTodo Todo
+ HiLink tadsLabel Label
+ HiLink tadsConditional Conditional
+ HiLink tadsRepeat Repeat
+ HiLink tadsException Exception
+ HiLink tadsStatement Statement
+ HiLink tadsStorageClass StorageClass
+ HiLink tadsKeyWord Keyword
+ HiLink tadsSpecial SpecialChar
+ HiLink tadsNumber Number
+ HiLink tadsBoolean Boolean
+ HiLink tadsDoubleString tadsString
+ HiLink tadsSingleString tadsString
+
+ HiLink tadsOctalError tadsError
+ HiLink tadsCommentError tadsError
+ HiLink tadsBraceError tadsError
+ HiLink tadsInBrace tadsError
+ HiLink tadsError Error
+
+ HiLink tadsInclude Include
+ HiLink tadsPreProc PreProc
+ HiLink tadsDefine Macro
+ HiLink tadsIncluded tadsString
+ HiLink tadsPreCondit PreCondit
+
+ HiLink tadsString String
+ HiLink tadsComment Comment
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "tads"
+
+" Changes:
+" 11/18/99 Added a bunch of TADS functions, tadsException
+" 10/22/99 Misspelled Moolenaar (sorry!), c_minlines to tads_minlines
+"
+" vim: ts=8
diff --git a/runtime/syntax/tags.vim b/runtime/syntax/tags.vim
new file mode 100644
index 000000000..8d87c2bee
--- /dev/null
+++ b/runtime/syntax/tags.vim
@@ -0,0 +1,47 @@
+" Language: tags
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchip@PcampbellAfamily.Mbiz>
+" Last Change: Nov 18, 2002
+" Version: 2
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match tagName "^[^\t]\+" skipwhite nextgroup=tagPath
+syn match tagPath "[^\t]\+" contained skipwhite nextgroup=tagAddr contains=tagBaseFile
+syn match tagBaseFile "[a-zA-Z_]\+[\.a-zA-Z_0-9]*\t"me=e-1 contained
+syn match tagAddr "\d*" contained skipwhite nextgroup=tagComment
+syn region tagAddr matchgroup=tagDelim start="/" skip="\(\\\\\)*\\/" matchgroup=tagDelim end="$\|/" oneline contained skipwhite nextgroup=tagComment
+syn match tagComment ";.*$" contained contains=tagField
+syn match tagComment "^!_TAG_.*$"
+syn match tagField contained "[a-z]*:"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_drchip_tags_inits")
+ if version < 508
+ let did_drchip_tags_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tagBaseFile PreProc
+ HiLink tagComment Comment
+ HiLink tagDelim Delimiter
+ HiLink tagField Number
+ HiLink tagName Identifier
+ HiLink tagPath PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tags"
+
+" vim: ts=12
diff --git a/runtime/syntax/tak.vim b/runtime/syntax/tak.vim
new file mode 100644
index 000000000..20186db14
--- /dev/null
+++ b/runtime/syntax/tak.vim
@@ -0,0 +1,136 @@
+" Vim syntax file
+" Language: TAK2, TAK3, TAK2000 thermal modeling input file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.tak
+" URL: http://www.naglenet.org/vim/syntax/tak.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for tak input file.
+"
+
+" Force free-form fortran format
+let fortran_free_source=1
+
+" Load FORTRAN syntax file
+if version < 600
+ source <sfile>:p:h/fortran.vim
+else
+ runtime! syntax/fortran.vim
+endif
+unlet b:current_syntax
+
+
+
+" Define keywords for TAK and TAKOUT
+syn keyword takOptions AUTODAMP CPRINT CSGDUMP GPRINT HPRINT LODTMP
+syn keyword takOptions LOGIC LPRINT NCVPRINT PLOTQ QPRINT QDUMP
+syn keyword takOptions SUMMARY SOLRTN UID DICTIONARIES
+
+syn keyword takRoutine SSITER FWDWRD FWDBCK BCKWRD
+
+syn keyword takControl ABSZRO BACKUP DAMP DTIMEI DTIMEL DTIMEH IFC
+syn keyword takControl MAXTEMP NLOOPS NLOOPT NODELIST OUTPUT PLOT
+syn keyword takControl SCALE SIGMA SSCRIT TIMEND TIMEN TIMEO TRCRIT
+syn keyword takControl PLOT
+
+syn keyword takSolids PLATE CYL
+syn keyword takSolidsArg ID MATNAM NTYPE TEMP XL YL ZL ISTRN ISTRG NNX
+syn keyword takSolidsArg NNY NNZ INCX INCY INCZ IAK IAC DIFF ARITH BOUN
+syn keyword takSolidsArg RMIN RMAX AXMAX NNR NNTHETA INCR INCTHETA END
+
+syn case ignore
+
+syn keyword takMacro fac pstart pstop
+syn keyword takMacro takcommon fstart fstop
+
+syn keyword takIdentifier flq flx gen ncv per sim siv stf stv tvd tvs
+syn keyword takIdentifier tvt pro thm
+
+
+
+" Define matches for TAK
+syn match takFortran "^F[0-9 ]"me=e-1
+syn match takMotran "^M[0-9 ]"me=e-1
+
+syn match takComment "^C.*$"
+syn match takComment "^R.*$"
+syn match takComment "\$.*$"
+
+syn match takHeader "^header[^,]*"
+
+syn match takIncludeFile "include \+[^ ]\+"hs=s+8 contains=fortranInclude
+
+syn match takInteger "-\=\<[0-9]*\>"
+syn match takFloat "-\=\<[0-9]*\.[0-9]*"
+syn match takScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+syn match takEndData "END OF DATA"
+
+if exists("thermal_todo")
+ execute 'syn match takTodo ' . '"^'.thermal_todo.'.*$"'
+else
+ syn match takTodo "^?.*$"
+endif
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tak_syntax_inits")
+ if version < 508
+ let did_tak_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink takMacro Macro
+ HiLink takOptions Special
+ HiLink takRoutine Type
+ HiLink takControl Special
+ HiLink takSolids Special
+ HiLink takSolidsArg Statement
+ HiLink takIdentifier Identifier
+
+ HiLink takFortran PreProc
+ HiLink takMotran PreProc
+
+ HiLink takComment Comment
+ HiLink takHeader Typedef
+ HiLink takIncludeFile Type
+ HiLink takInteger Number
+ HiLink takFloat Float
+ HiLink takScientific Float
+
+ HiLink takEndData Macro
+
+ HiLink takTodo Todo
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "tak"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/takcmp.vim b/runtime/syntax/takcmp.vim
new file mode 100644
index 000000000..a94609b32
--- /dev/null
+++ b/runtime/syntax/takcmp.vim
@@ -0,0 +1,82 @@
+" Vim syntax file
+" Language: TAK2, TAK3, TAK2000 thermal modeling compare file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.cmp
+" URL: http://www.naglenet.org/vim/syntax/takcmp.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for compare files.
+"
+" Define keywords for TAK compare
+ syn keyword takcmpUnit celsius fahrenheit
+
+
+
+" Define matches for TAK compare
+ syn match takcmpTitle "Steady State Temperature Comparison"
+
+ syn match takcmpLabel "Run Date:"
+ syn match takcmpLabel "Run Time:"
+ syn match takcmpLabel "Temp. File \d Units:"
+ syn match takcmpLabel "Filename:"
+ syn match takcmpLabel "Output Units:"
+
+ syn match takcmpHeader "^ *Node\( *File \d\)* *Node Description"
+
+ syn match takcmpDate "\d\d\/\d\d\/\d\d"
+ syn match takcmpTime "\d\d:\d\d:\d\d"
+ syn match takcmpInteger "^ *-\=\<[0-9]*\>"
+ syn match takcmpFloat "-\=\<[0-9]*\.[0-9]*"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_takcmp_syntax_inits")
+ if version < 508
+ let did_takcmp_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink takcmpTitle Type
+ HiLink takcmpUnit PreProc
+
+ HiLink takcmpLabel Statement
+
+ HiLink takcmpHeader takHeader
+
+ HiLink takcmpDate Identifier
+ HiLink takcmpTime Identifier
+ HiLink takcmpInteger Number
+ HiLink takcmpFloat Special
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "takcmp"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/takout.vim b/runtime/syntax/takout.vim
new file mode 100644
index 000000000..774353942
--- /dev/null
+++ b/runtime/syntax/takout.vim
@@ -0,0 +1,102 @@
+" Vim syntax file
+" Language: TAK2, TAK3, TAK2000 thermal modeling output file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.out
+" URL: http://www.naglenet.org/vim/syntax/takout.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case match
+
+
+
+" Load TAK syntax file
+if version < 600
+ source <sfile>:p:h/tak.vim
+else
+ runtime! syntax/tak.vim
+endif
+unlet b:current_syntax
+
+
+
+"
+"
+" Begin syntax definitions for tak output files.
+"
+
+" Define keywords for TAK output
+syn case match
+
+syn keyword takoutPos ON SI
+syn keyword takoutNeg OFF ENG
+
+
+
+" Define matches for TAK output
+syn match takoutTitle "TAK III"
+syn match takoutTitle "Release \d.\d\d"
+syn match takoutTitle " K & K Associates *Thermal Analysis Kit III *Serial Number \d\d-\d\d\d"
+
+syn match takoutFile ": \w*\.TAK"hs=s+2
+
+syn match takoutInteger "T\=[0-9]*\>"ms=s+1
+
+syn match takoutSectionDelim "[-<>]\{4,}" contains=takoutSectionTitle
+syn match takoutSectionDelim ":\=\.\{4,}:\=" contains=takoutSectionTitle
+syn match takoutSectionTitle "[-<:] \w[0-9A-Za-z_() ]\+ [->:]"hs=s+1,me=e-1
+
+syn match takoutHeaderDelim "=\{5,}"
+syn match takoutHeaderDelim "|\{5,}"
+syn match takoutHeaderDelim "+\{5,}"
+
+syn match takoutLabel "Input File:" contains=takoutFile
+syn match takoutLabel "Begin Solution: Routine"
+
+syn match takoutError "<<< Error >>>"
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_takout_syntax_inits")
+ if version < 508
+ let did_takout_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink takoutPos Statement
+ HiLink takoutNeg PreProc
+ HiLink takoutTitle Type
+ HiLink takoutFile takIncludeFile
+ HiLink takoutInteger takInteger
+
+ HiLink takoutSectionDelim Delimiter
+ HiLink takoutSectionTitle Exception
+ HiLink takoutHeaderDelim SpecialComment
+ HiLink takoutLabel Identifier
+
+ HiLink takoutError Error
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "takout"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/tasm.vim b/runtime/syntax/tasm.vim
new file mode 100644
index 000000000..1cfc1218a
--- /dev/null
+++ b/runtime/syntax/tasm.vim
@@ -0,0 +1,122 @@
+" Vim syntax file
+" Language: TASM: turbo assembler by Borland
+" Maintaner: FooLman of United Force <foolman@bigfoot.com>
+" Last change: 22 aug 2000
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+syn match tasmLabel "^[\ \t]*[@a-z_$][a-z0-9_$@]*\ *:"
+syn keyword tasmDirective ALIAS ALIGN ARG ASSUME %BIN CATSRT CODESEG
+syn match tasmDirective "\<\(byte\|word\|dword\|qword\)\ ptr\>"
+" CALL extended syntax
+syn keyword tasmDirective COMM %CONDS CONST %CREF %CREFALL %CREFREF
+syn keyword tasmDirective %CREFUREF %CTLS DATASEG DB DD %DEPTH DF DISPLAY
+syn keyword tasmDirective DOSSEG DP DQ DT DW ELSE EMUL END ENDIF
+" IF XXXX
+syn keyword tasmDirective ENDM ENDP ENDS ENUM EQU ERR EVEN EVENDATA EXITCODE
+syn keyword tasmDirective EXITM EXTRN FARDATA FASTIMUL FLIPFLAG GETFIELD GLOBAL
+syn keyword tasmDirective GOTO GROUP IDEAL %INCL INCLUDE INCLUDELIB INSTR IRP
+"JMP
+syn keyword tasmDirective IRPC JUMPS LABEL LARGESTACK %LINUM %LIST LOCAL
+syn keyword tasmDirective LOCALS MACRO %MACS MASKFLAG MASM MASM51 MODEL
+syn keyword tasmDirective MULTERRS NAME %NEWPAGE %NOCONDS %NOCREF %NOCTLS
+syn keyword tasmDirective NOEMUL %NOINCL NOJUMPS %NOLIST NOLOCALS %NOMACS
+syn keyword tasmDirective NOMASM51 NOMULTERRS NOSMART %NOSYMS %NOTRUNC NOWARN
+syn keyword tasmDirective %PAGESIZE %PCNT PNO87 %POPLCTL POPSTATE PROC PROCDESC
+syn keyword tasmDirective PROCTYPE PUBLIC PUBLICDLL PURGE %PUSHCTL PUSHSTATE
+"rept, ret
+syn keyword tasmDirective QUIRKS RADIX RECORD RETCODE SEGMENT SETFIELD
+syn keyword tasmDirective SETFLAG SIZESTR SMALLSTACK SMART STACK STARTUPCODE
+syn keyword tasmDirective STRUC SUBSTR %SUBTTL %SYMS TABLE %TABSIZE TBLINIT
+syn keyword tasmDirective TBLINST TBLPTR TESTFLAG %TEXT %TITLE %TRUNC TYPEDEF
+syn keyword tasmDirective UDATASEG UFARDATA UNION USES VERSION WAR WHILE ?DEBUG
+
+syn keyword tasmInstruction AAA AAD AAM AAS ADC ADD AND ARPL BOUND BSF BSR
+syn keyword tasmInstruction BSWAP BT BTC BTR BTS CALL CBW CLC CLD CLI CLTS
+syn keyword tasmInstruction CMC CMP CMPXCHG CMPXCHG8B CPUID CWD CDQ CWDE
+syn keyword tasmInstruction DAA DAS DEC DIV ENTER RETN RETF F2XM1
+syn keyword tasmCoprocInstr FABS FADD FADDP FBLD FBSTP FCHG FCOM FCOM2 FCOMI
+syn keyword tasmCoprocInstr FCOMIP FCOMP FCOMP3 FCOMP5 FCOMPP FCOS FDECSTP
+syn keyword tasmCoprocInstr FDISI FDIV FDIVP FDIVR FENI FFREE FFREEP FIADD
+syn keyword tasmCoprocInstr FICOM FICOMP FIDIV FIDIVR FILD FIMUL FINIT FINCSTP
+syn keyword tasmCoprocInstr FIST FISTP FISUB FISUBR FLD FLD1 FLDCW FLDENV
+syn keyword tasmCoprocInstr FLDL2E FLDL2T FLDLG2 FLDLN2 FLDPI FLDZ FMUL FMULP
+syn keyword tasmCoprocInstr FNCLEX FNINIT FNOP FNSAVE FNSTCW FNSTENV FNSTSW
+syn keyword tasmCoprocInstr FPATAN FPREM FPREM1 FPTAN FRNDINT FRSTOR FSCALE
+syn keyword tasmCoprocInstr FSETPM FSIN FSINCOM FSQRT FST FSTP FSTP1 FSTP8
+syn keyword tasmCoprocInstr FSTP9 FSUB FSUBP FSUBR FSUBRP FTST FUCOM FUCOMI
+syn keyword tasmCoprocInstr FUCOMPP FWAIT FXAM FXCH FXCH4 FXCH7 FXTRACT FYL2X
+syn keyword tasmCoprocInstr FYL2XP1 FSTCW FCHS FSINCOS
+syn keyword tasmInstruction IDIV IMUL IN INC INT INTO INVD INVLPG IRET JMP
+syn keyword tasmInstruction LAHF LAR LDS LEA LEAVE LES LFS LGDT LGS LIDT LLDT
+syn keyword tasmInstruction LMSW LOCK LODSB LSL LSS LTR MOV MOVSX MOVZX MUL
+syn keyword tasmInstruction NEG NOP NOT OR OUT POP POPA POPAD POPF POPFD PUSH
+syn keyword tasmInstruction PUSHA PUSHAD PUSHF PUSHFD RCL RCR RDMSR RDPMC RDTSC
+syn keyword tasmInstruction REP RET ROL ROR RSM SAHF SAR SBB SGDT SHL SAL SHLD
+syn keyword tasmInstruction SHR SHRD SIDT SMSW STC STD STI STR SUB TEST VERR
+syn keyword tasmInstruction VERW WBINVD WRMSR XADD XCHG XLAT XOR
+syn keyword tasmMMXinst EMMS MOVD MOVQ PACKSSDW PACKSSWB PACKUSWB PADDB
+syn keyword tasmMMXinst PADDD PADDSB PADDSB PADDSW PADDUSB PADDUSW PADDW
+syn keyword tasmMMXinst PAND PANDN PCMPEQB PCMPEQD PCMPEQW PCMPGTB PCMPGTD
+syn keyword tasmMMXinst PCMPGTW PMADDWD PMULHW PMULLW POR PSLLD PSLLQ
+syn keyword tasmMMXinst PSLLW PSRAD PSRAW PSRLD PSRLQ PSRLW PSUBB PSUBD
+syn keyword tasmMMXinst PSUBSB PSUBSW PSUBUSB PSUBUSW PSUBW PUNPCKHBW
+syn keyword tasmMMXinst PUNPCKHBQ PUNPCKHWD PUNPCKLBW PUNPCKLDQ PUNPCKLWD
+syn keyword tasmMMXinst PXOR
+"FCMOV
+syn match tasmInstruction "\<\(CMPS\|MOVS\|OUTS\|SCAS\|STOS\|LODS\|INS\)[BWD]"
+syn match tasmInstruction "\<\(CMOV\|SET\|J\)N\=[ABCGLESXZ]\>"
+syn match tasmInstruction "\<\(CMOV\|SET\|J\)N\=[ABGL]E\>"
+syn match tasmInstruction "\<\(LOOP\|REP\)N\=[EZ]\=\>"
+syn match tasmRegister "\<[A-D][LH]\>"
+syn match tasmRegister "\<E\=\([A-D]X\|[SD]I\|[BS]P\)\>"
+syn match tasmRegister "\<[C-GS]S\>"
+syn region tasmComment start=";" end="$"
+"HACK! comment ? ... selection
+syn region tasmComment start="comment \+\$" end="\$"
+syn region tasmComment start="comment \+\~" end="\~"
+syn region tasmComment start="comment \+#" end="#"
+syn region tasmString start="'" end="'"
+syn region tasmString start='"' end='"'
+
+syn match tasmDec "\<-\=[0-9]\+\.\=[0-9]*\>"
+syn match tasmHex "\<[0-9][0-9A-F]*H\>"
+syn match tasmOct "\<[0-7]\+O\>"
+syn match tasmBin "\<[01]\+B\>"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tasm_syntax_inits")
+ if version < 508
+ let did_tasm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tasmString String
+ HiLink tasmDec Number
+ HiLink tasmHex Number
+ HiLink tasmOct Number
+ HiLink tasmBin Number
+ HiLink tasmInstruction Keyword
+ HiLink tasmCoprocInstr Keyword
+ HiLink tasmMMXInst Keyword
+ HiLink tasmDirective PreProc
+ HiLink tasmRegister Identifier
+ HiLink tasmProctype PreProc
+ HiLink tasmComment Comment
+ HiLink tasmLabel Label
+
+ delcommand HiLink
+endif
+
+let b:curret_syntax = "tasm"
diff --git a/runtime/syntax/tcl.vim b/runtime/syntax/tcl.vim
new file mode 100644
index 000000000..145da9087
--- /dev/null
+++ b/runtime/syntax/tcl.vim
@@ -0,0 +1,235 @@
+" Vim syntax file
+" Language: TCL/TK
+" Maintainer: Dean Copsey <copsey@cs.ucdavis.edu>
+" (previously Matt Neumann <mattneu@purpleturtle.com>)
+" (previously Allan Kelly <allan@fruitloaf.co.uk>)
+" Original: Robin Becker <robin@jessikat.demon.co.uk>
+" Last Change: 2004 May 16
+"
+" Keywords TODO: format clock click anchor
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful keywords
+syn keyword tclStatement proc global return lindex
+syn keyword tclStatement llength lappend lreplace lrange list concat incr
+syn keyword tclStatement upvar set
+syn keyword tclLabel case default
+syn keyword tclConditional if then else elseif switch
+syn keyword tclRepeat while for foreach break continue
+syn keyword tcltkSwitch contained insert create polygon fill outline tag
+
+" WIDGETS
+" commands associated with widgets
+syn keyword tcltkWidgetSwitch contained background highlightbackground insertontime cget
+syn keyword tcltkWidgetSwitch contained selectborderwidth borderwidth highlightcolor insertwidth
+syn keyword tcltkWidgetSwitch contained selectforeground cursor highlightthickness padx setgrid
+syn keyword tcltkWidgetSwitch contained exportselection insertbackground pady takefocus
+syn keyword tcltkWidgetSwitch contained font insertborderwidth relief xscrollcommand
+syn keyword tcltkWidgetSwitch contained foreground insertofftime selectbackground yscrollcommand
+syn keyword tcltkWidgetSwitch contained height spacing1 spacing2 spacing3
+syn keyword tcltkWidgetSwitch contained state tabs width wrap
+" button
+syn keyword tcltkWidgetSwitch contained command default
+" canvas
+syn keyword tcltkWidgetSwitch contained closeenough confine scrollregion xscrollincrement yscrollincrement orient
+" checkbutton, radiobutton
+syn keyword tcltkWidgetSwitch contained indicatoron offvalue onvalue selectcolor selectimage state variable
+" entry, frame
+syn keyword tcltkWidgetSwitch contained show class colormap container visual
+" listbox, menu
+syn keyword tcltkWidgetSwitch contained selectmode postcommand selectcolor tearoff tearoffcommand title type
+" menubutton, message
+syn keyword tcltkWidgetSwitch contained direction aspect justify
+" scale
+syn keyword tcltkWidgetSwitch contained bigincrement digits from length resolution showvalue sliderlength sliderrelief tickinterval to
+" scrollbar
+syn keyword tcltkWidgetSwitch contained activerelief elementborderwidth
+" image
+syn keyword tcltkWidgetSwitch contained delete names types create
+" variable reference
+ " ::optional::namespaces
+syn match tclVarRef "$\(\(::\)\?\([[:alnum:]_.]*::\)*\)\a[a-zA-Z0-9_.]*"
+ " ${...} may contain any character except '}'
+syn match tclVarRef "${[^}]*}"
+" menu, mane add
+syn keyword tcltkWidgetSwitch contained active end last none cascade checkbutton command radiobutton separator
+syn keyword tcltkWidgetSwitch contained activebackground actveforeground accelerator background bitmap columnbreak
+syn keyword tcltkWidgetSwitch contained font foreground hidemargin image indicatoron label menu offvalue onvalue
+syn keyword tcltkWidgetSwitch contained selectcolor selectimage state underline value variable
+syn keyword tcltkWidgetSwitch contained add clone configure delete entrycget entryconfigure index insert invoke
+syn keyword tcltkWidgetSwitch contained post postcascade type unpost yposition activate
+"syn keyword tcltkWidgetSwitch contained
+"syn match tcltkWidgetSwitch contained
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<button\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<scale\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<canvas\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<checkbutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<entry\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<frame\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<image\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<listbox\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<menubutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<message\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<radiobutton\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\<scrollbar\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+" These words are dual purpose.
+" match switches
+"syn match tcltkWidgetSwitch contained "-text"hs=s+1
+syn match tcltkWidgetSwitch contained "-text\(var\)\?"hs=s+1
+syn match tcltkWidgetSwitch contained "-menu"hs=s+1
+syn match tcltkWidgetSwitch contained "-label"hs=s+1
+" match commands - 2 lines for pretty match.
+"variable
+" Special case - If a number follows a variable region, it must be at the end of
+" the pattern, by definition. Therefore, (1) either include a number as the region
+" end and exclude tclNumber from the contains list, or (2) make variable
+" keepend. As (1) would put variable out of step with everything else, use (2).
+syn region tcltkCommand matchgroup=tcltkCommandColor start="^\<variable\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tclString,tclNumber,tclVarRef,tcltkCommand
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\s\<variable\>\|\[\<variable\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tclString,tclNumber,tclVarRef,tcltkCommand
+" menu
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<menu\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<menu\>\|\[\<menu\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+" label
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<label\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<label\>\|\[\<label\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+" text
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="^\<text\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidget,tcltkWidgetSwitch,tcltkSwitch,tclNumber,tclVarRef,tclString
+syn region tcltkWidget matchgroup=tcltkWidgetColor start="\s\<text\>\|\[\<text\>"hs=s+1 matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidget,tcltkWidgetSwitch,tclString,tcltkSwitch,tclNumber,tclVarRef
+
+" This isn't contained (I don't think) so it's OK to just associate with the Color group.
+" TODO: This could be wrong.
+syn keyword tcltkWidgetColor toplevel
+
+
+syn region tcltkPackConf matchgroup=tcltkPackConfColor start="\<configure\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tcltkPackConfSwitch,tclNumber,tclVarRef keepend
+syn region tcltkPackConf matchgroup=tcltkPackConfColor start="\<cget\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkWidgetSwitch,tclString,tcltkSwitch,tcltkPackConfSwitch,tclNumber,tclVarRef
+
+
+" NAMESPACE
+" commands associated with namespace
+syn keyword tcltkNamespaceSwitch contained children code current delete eval
+syn keyword tcltkNamespaceSwitch contained export forget import inscope origin
+syn keyword tcltkNamespaceSwitch contained parent qualifiers tail which command variable
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<namespace\>" matchgroup=NONE skip="^\s*$" end="{\|}\|]\|\"\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkNamespaceSwitch
+
+" EXPR
+" commands associated with expr
+syn keyword tcltkMaths contained acos cos hypot sinh
+syn keyword tcltkMaths contained asin cosh log sqrt
+syn keyword tcltkMaths contained atan exp log10 tan
+syn keyword tcltkMaths contained atan2 floor pow tanh
+syn keyword tcltkMaths contained ceil fmod sin
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<expr\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkMaths,tclNumber,tclVarRef,tclString,tcltlWidgetSwitch,tcltkCommand,tcltkPackConf
+
+" format
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<format\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"me=e-1 contains=tclLineContinue,tcltkMaths,tclNumber,tclVarRef,tclString,tcltlWidgetSwitch,tcltkCommand,tcltkPackConf
+
+" PACK
+" commands associated with pack
+syn keyword tcltkPackSwitch contained forget info propogate slaves
+syn keyword tcltkPackConfSwitch contained after anchor before expand fill in ipadx ipady padx pady side
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<pack\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkPackSwitch,tcltkPackConf,tcltkPackConfSwitch,tclNumber,tclVarRef,tclString,tcltkCommand keepend
+
+" STRING
+" commands associated with string
+syn keyword tcltkStringSwitch contained compare first index last length match range tolower toupper trim trimleft trimright wordstart wordend
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<string\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkStringSwitch,tclNumber,tclVarRef,tclString,tcltkCommand
+
+" ARRAY
+" commands associated with array
+syn keyword tcltkArraySwitch contained anymore donesearch exists get names nextelement size startsearch set
+" match from command name to ] or EOL
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<array\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkArraySwitch,tclNumber,tclVarRef,tclString,tcltkCommand
+
+" LSORT
+" switches for lsort
+syn keyword tcltkLsortSwitch contained ascii dictionary integer real command increasing decreasing index
+" match from command name to ] or EOL
+syn region tcltkCommand matchgroup=tcltkCommandColor start="\<lsort\>" matchgroup=NONE skip="^\s*$" end="]\|[^\\]*\s*$"he=e-1 contains=tclLineContinue,tcltkLsortSwitch,tclNumber,tclVarRef,tclString,tcltkCommand
+
+syn keyword tclTodo contained TODO
+
+
+" String and Character contstants
+" Highlight special characters (those which have a backslash) differently
+syn match tclSpecial contained "\\\d\d\d\=\|\\."
+" A string needs the skip argument as it may legitimately contain \".
+" Match at start of line
+syn region tclString start=+^"+ end=+"+ contains=tclSpecial skip=+\\\\\|\\"+
+"Match all other legal strings.
+syn region tclString start=+[^\\]"+ms=s+1 end=+"+ contains=tclSpecial skip=+\\\\\|\\"+
+
+syn match tclLineContinue "\\\s*$"
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match tclNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match tclNumber "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match tclNumber "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match tclNumber "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match tclNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+"syn match tclIdentifier "\<[a-z_][a-z0-9_]*\>"
+syn case match
+
+syn region tclComment start="^\s*\#" skip="\\$" end="$" contains=tclTodo
+syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo
+
+"syn sync ccomment tclComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tcl_syntax_inits")
+ if version < 508
+ let did_tcl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tcltkSwitch Special
+ HiLink tclLabel Label
+ HiLink tclConditional Conditional
+ HiLink tclRepeat Repeat
+ HiLink tclNumber Number
+ HiLink tclError Error
+ HiLink tclStatement Statement
+ "HiLink tclStatementColor Statement
+ HiLink tclString String
+ HiLink tclComment Comment
+ HiLink tclSpecial Special
+ HiLink tclTodo Todo
+ " Below here are the commands and their options.
+ HiLink tcltkCommandColor Statement
+ HiLink tcltkWidgetColor Structure
+ HiLink tclLineContinue WarningMsg
+ HiLink tcltkStringSwitch Special
+ HiLink tcltkArraySwitch Special
+ HiLink tcltkLsortSwitch Special
+ HiLink tcltkPackSwitch Special
+ HiLink tcltkPackConfSwitch Special
+ HiLink tcltkMaths Special
+ HiLink tcltkNamespaceSwitch Special
+ HiLink tcltkWidgetSwitch Special
+ HiLink tcltkPackConfColor Identifier
+ "HiLink tcltkLsort Statement
+ HiLink tclVarRef Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tcl"
+
+" vim: ts=8
diff --git a/runtime/syntax/tcsh.vim b/runtime/syntax/tcsh.vim
new file mode 100644
index 000000000..29fbb2e3c
--- /dev/null
+++ b/runtime/syntax/tcsh.vim
@@ -0,0 +1,188 @@
+" Vim syntax file
+" Language: C-shell (tcsh)
+" Maintainor: Gautam Iyer <gautam@math.uchicago.edu>
+" Last Modified: Mon 23 Feb 2004 02:28:51 PM CST
+"
+" Description: We break up each statement into a "command" and an "end" part.
+" All groups are either a "command" or part of the "end" of a statement (ie
+" everything after the "command"). This is because blindly highlighting tcsh
+" statements as keywords caused way too many false positives. Eg:
+"
+" set history=200
+"
+" causes history to come up as a keyword, which we want to avoid.
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+" ----- Clusters -----
+syn cluster tcshModifiers contains=tcshModifier,tcshModifierError
+syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote
+syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,tcshUsrVar,TcshArgv,tcshSubst,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement
+syn cluster tcshStatements contains=tcshBuiltins,tcshCommands,tcshSet,tcshSetEnv,tcshAlias,tcshIf,tcshWhile
+syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst
+
+" ----- Statements -----
+" Tcsh commands: Any filename / modifiable variable (must be first!)
+syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd
+
+" Builtin commands except (un)set(env), (un)alias, if, while, else
+syn keyword tcshBuiltins nextgroup=tcshStatementEnd alloc bg bindkey break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
+
+" StatementEnd is anything after a builtin / command till the lexical end of a
+" statement (;, |, ||, |&, && or end of line)
+syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltins start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds
+
+" set expressions (Contains shell variables)
+syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars
+syn keyword tcshSet nextgroup=tcshSetEnd set unset
+syn region tcshSetEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshShellVar,@tcshStatementEnds
+
+" setenv expressions (Contains enviorenment variables)
+syn keyword tcshEnvVar contained AFSUSER COLUMNS DISPLAY EDITOR GROUP HOME HOST HOSTTYPE HPATH LANG LC_CTYPE LINES LS_COLORS MACHTYPE NOREBIND OSTYPE PATH PWD REMOTEHOST SHLVL SYSTYPE TERM TERMCAP USER VENDOR VISUAL
+syn keyword tcshSetEnv nextgroup=tcshEnvEnd setenv unsetenv
+syn region tcshEnvEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshEnvVar,@tcshStatementEnds
+
+" alias and unalias (contains special aliases)
+syn keyword tcshAliases contained beemcmd cwdcmd jobcmd helpcommand periodic precmd postcmd shell
+syn keyword tcshAlias nextgroup=tcshAliEnd alias unalias
+syn region tcshAliEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="$\|;" contains=tcshAliases,@tcshStatementEnds
+
+" if statements (contains expressions / operators)
+syn keyword tcshIf nextgroup=tcshIfEnd if
+syn region tcshIfEnd contained matchgroup=tcshBuiltins start='' skip="\\$" end="\v<then>|$" contains=tcshOperator,tcshNumber,@tcshStatementEnds
+
+" else statements (nextgroup if)
+syn keyword tcshElse nextgroup=tcshIf skipwhite else
+
+" while statements (contains expressions / operators)
+syn keyword tcshWhile nextgroup=tcshWhEnd while
+syn region tcshWhEnd contained transparent matchgroup=tcshBuiltins start='' skip="\\$" end="\v$" contains=tcshOperator,tcshNumber,@tcshStatementEnds
+
+" Expressions start with @.
+syn match tcshExprStart "\v\@\s+" nextgroup=tcshExprVar
+syn match tcshExprVar contained "\v\h\w*%(\[\d+\])?" contains=tcshShellVar,tcshEnvVar nextgroup=tcshExprOp
+syn match tcshExprOp contained "++\|--"
+syn match tcshExprOp contained "\v\s*\=" nextgroup=tcshExprEnd
+syn match tcshExprEnd contained "\v.*$"hs=e+1 contains=tcshOperator,tcshNumber,@tcshVarList
+syn match tcshExprEnd contained "\v.{-};"hs=e contains=tcshOperator,tcshNumber,@tcshVarList
+
+" ----- Comments: -----
+syn match tcshComment "#.*" contains=tcshTodo,tcshCommentTi,tcshCommentSp,@Spell
+syn match tcshSharpBang "^#! .*$"
+syn match tcshCommentTi contained '\v#\s*\u\w*(\s+\u\w*)*:'hs=s+1 contains=tcshTodo
+syn match tcshCommentSp contained '\v<\u{3,}>' contains=tcshTodo
+syn match tcshTodo contained '\v\c<todo>'
+
+" ----- Strings -----
+" Tcsh does not allow \" in strings unless the "backslash_quote" shell
+" variable is set. Set the vim variable "tcsh_backslash_quote" to 0 if you
+" want VIM to assume that no backslash quote constructs exist.
+
+" Backquotes are treated as commands, and are not contained in anything
+if(exists("tcsh_backslash_quote") && tcsh_backslash_quote == 0)
+ syn region tcshSQuote keepend contained start="\v\\@<!'" end="'" contains=@Spell
+ syn region tcshDQuote keepend contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell
+ syn region tcshBQuote keepend start='\v\\@<!`' end='`' contains=@tcshStatements
+else
+ syn region tcshSQuote contained start="\v\\@<!'" skip="\v\\\\|\\'" end="'" contains=@Spell
+ syn region tcshDQuote contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell
+ syn region tcshBQuote keepend matchgroup=tcshBQuoteGrp start='\v\\@<!`' skip='\v\\\\|\\`' end='`' contains=@tcshStatements
+endif
+
+" ----- Variables -----
+" Variable Errors. Must come first! \$ constructs will be flagged by
+" tcshSpecial, so we don't consider them here.
+syn match tcshVarError '\v\$\S*' contained
+
+" Modifiable Variables without {}.
+syn match tcshUsrVar contained "\v\$\h\w*%(\[\d+%(-\d+)?\])?" nextgroup=@tcshModifiers contains=tcshShellVar,tcshEnvVar
+syn match tcshArgv contained "\v\$%(\d+|\*)" nextgroup=@tcshModifiers
+
+" Modifiable Variables with {}.
+syn match tcshUsrVar contained "\v\$\{\h\w*%(\[\d+%(-\d+)?\])?%(:\S*)?\}" contains=@tcshModifiers,tcshShellVar,tcshEnvVar
+syn match tcshArgv contained "\v\$\{%(\d+|\*)%(:\S*)?\}" contains=@tcshModifiers
+
+" UnModifiable Substitutions. Order is important here.
+syn match tcshSubst contained "\v\$[?#$!_<]" nextgroup=tcshModifierError
+syn match tcshSubst contained "\v\$[%#?]%(\h\w*|\d+)" nextgroup=tcshModifierError contains=tcshShellVar,tcshEnvVar
+syn match tcshSubst contained "\v\$\{[%#?]%(\h\w*|\d+)%(:\S*)?\}" contains=tcshModifierError contains=tcshShellVar,tcshEnvVar
+
+" Variable Name Expansion Modifiers (order important)
+syn match tcshModifierError contained '\v:\S*'
+syn match tcshModifier contained '\v:[ag]?[htreuls&qx]' nextgroup=@tcshModifiers
+
+" ----- Operators / Specials -----
+" Standard redirects (except <<) [<, >, >>, >>&, >>!, >>&!]
+syn match tcshRedir contained "\v\<|\>\>?\&?!?"
+
+" Metachars
+syn match tcshMeta contained "\v[]{}*?[]"
+
+" Here Documents (<<)
+syn region tcshHereDoc contained matchgroup=tcshRedir start="\v\<\<\s*\z(\h\w*)" end="^\z1$" contains=@tcshVarList,tcshSpecial
+syn region tcshHereDoc contained matchgroup=tcshRedir start="\v\<\<\s*'\z(\h\w*)'" start='\v\<\<\s*"\z(\h\w*)"$' start="\v\<\<\s*\\\z(\h\w*)$" end="^\z1$"
+
+" Operators
+syn match tcshOperator contained "&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|\~\|||\|!\|%\|&\|+\|-\|/\|<\|>\||"
+syn match tcshOperator contained "[(){}]"
+
+" Numbers
+syn match tcshNumber contained "\v<-?\d+>"
+
+" Arguements
+syn match tcshArguement contained "\v\s@<=-(\w|-)*"
+
+" Special charectors
+syn match tcshSpecial contained "\v\\@<!\\(\d{3}|.)"
+
+" ----- Syncronising -----
+if exists("tcsh_minlines")
+ exec "syn sync minlines=" . tcsh_minlines
+else
+ syn sync minlines=15 " Except 'here' documents, nothing is long
+endif
+
+" Define highlighting of syntax groups
+hi def link tcshBuiltins statement
+hi def link tcshShellVar preproc
+hi def link tcshEnvVar tcshShellVar
+hi def link tcshAliases tcshShellVar
+hi def link tcshCommands identifier
+hi def link tcshSet tcshBuiltins
+hi def link tcshSetEnv tcshBuiltins
+hi def link tcshAlias tcshBuiltins
+hi def link tcshIf tcshBuiltins
+hi def link tcshElse tcshBuiltins
+hi def link tcshWhile tcshBuiltins
+hi def link tcshExprStart tcshBuiltins
+hi def link tcshExprVar tcshUsrVar
+hi def link tcshExprOp tcshOperator
+hi def link tcshExprEnd tcshOperator
+hi def link tcshComment comment
+hi def link tcshCommentTi preproc
+hi def link tcshCommentSp WarningMsg
+hi def link tcshSharpBang preproc
+hi def link tcshTodo todo
+hi def link tcshSQuote constant
+hi def link tcshDQuote tcshSQuote
+hi def link tcshBQuoteGrp include
+hi def link tcshVarError error
+hi def link tcshUsrVar type
+hi def link tcshArgv tcshUsrVar
+hi def link tcshSubst tcshUsrVar
+hi def link tcshModifier tcshArguement
+hi def link tcshModifierError tcshVarError
+hi def link tcshMeta tcshSubst
+hi def link tcshRedir tcshOperator
+hi def link tcshHereDoc tcshSQuote
+hi def link tcshOperator operator
+hi def link tcshNumber number
+hi def link tcshArguement special
+hi def link tcshSpecial specialchar
+
+let b:current_syntax = "tcsh"
diff --git a/runtime/syntax/terminfo.vim b/runtime/syntax/terminfo.vim
new file mode 100644
index 000000000..6ac7ffaf3
--- /dev/null
+++ b/runtime/syntax/terminfo.vim
@@ -0,0 +1,115 @@
+" Vim syntax file
+" Language: Terminfo definition
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/terminfo/
+" Latest Revision: 2004-05-22
+" arch-tag: 8464dd47-0c5a-47d5-87ed-a2ad99e1196f
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" keywords (define first as to not mess up comments
+syn match terminfoKeywords "[,=#|]"
+
+" todo
+syn keyword terminfoTodo contained TODO FIXME XXX NOTE
+
+" comments
+syn region terminfoComment matchgroup=terminfoComment start="^#" end="$" contains=terminfoTodo
+
+" numbers
+syn match terminfoNumbers "\<[0-9]\+\>"
+
+" special keys
+syn match terminfoSpecialChar "\\\(\o\{3}\|[Eenlrtbfs^\,:0]\)"
+syn match terminfoSpecialChar "\^\a"
+
+" delays
+syn match terminfoDelay "$<[0-9]\+>"
+
+" boolean capabilities
+syn keyword terminfoBooleans bw am bce ccc xhp xhpa cpix crxw xt xenl eo gn
+syn keyword terminfoBooleans hc chts km daisy hs hls in lpix da db mir msgr
+syn keyword terminfoBooleans nxon xsb npc ndscr nrrmc os mc5i xcpa sam eslok
+syn keyword terminfoBooleans hz ul xon
+
+" numeric capabilities
+syn keyword terminfoNumerics cols it lh lw lines lm xmc ma colors pairs wnum
+syn keyword terminfoNumerics ncv nlab pb vt wsl bitwin bitype bufsz btns
+syn keyword terminfoNumerics spinh spinv maddr mjump mcs npins orc orhi orl
+syn keyword terminfoNumerics orvi cps widcs
+
+" string capabilities
+syn keyword terminfoStrings acsc cbt bel cr cpi lpi chr cvr csr rmp tbc mgc
+syn keyword terminfoStrings clear el1 el ed hpa cmdch cwin cup cud1 home
+syn keyword terminfoStrings civis cub1 mrcup cnorm cuf1 ll cuu1 cvvis defc
+syn keyword terminfoStrings dch1 dl1 dial dsl dclk hd enacs smacs smam blink
+syn keyword terminfoStrings bold smcup smdc dim swidm sdrfq smir sitm slm
+syn keyword terminfoStrings smicm snlq snrmq prot rev invis sshm smso ssubm
+syn keyword terminfoStrings ssupm smul sum smxon ech rmacs rmam sgr0 rmcup
+syn keyword terminfoStrings rmdc rwidm rmir ritm rlm rmicm rshm rmso rsubm
+syn keyword terminfoStrings rsupm rmul rum rmxon pause hook flash ff fsl
+syn keyword terminfoStrings wingo hup is1 is2 is3 if iprog initc initp ich1
+syn keyword terminfoStrings il1 ip ka1 ka3 kb2 kbs kbeg kcbt kc1 kc3 kcan
+syn keyword terminfoStrings ktbc kclr kclo kcmd kcpy kcrt kctab kdch1 kdl1
+syn keyword terminfoStrings kcud1 krmir kend kent kel ked kext
+syn match terminfoStrings "\<kf\([0-9]\|[0-5][0-9]\|6[0-3]\)\>"
+syn keyword terminfoStrings kfnd khlp khome kich1 kil1 kcub1 kll kmrk
+syn keyword terminfoStrings kmsg kmov knxt knp kopn kopt kpp kprv kprt krdo
+syn keyword terminfoStrings kref krfr krpl krst kres kcuf1 ksav kBEG kCAN
+syn keyword terminfoStrings kCMD kCPY kCRT kDC kDL kslt kEND kEOL kEXT kind
+syn keyword terminfoStrings kFND kHLP kHOM kIC kLFT kMSG kMOV kNXT kOPT kPRV
+syn keyword terminfoStrings kPRT kri kRDO kRPL kRIT kRES kSAV kSPD khts kUND
+syn keyword terminfoStrings kspd kund kcuu1 rmkx smkx lf0 lf1 lf10 lf2 lf3
+syn keyword terminfoStrings lf4 lf5 lf6 lf7 lf8 lf9 fln rmln smln rmm smm
+syn keyword terminfoStrings mhpa mcud1 mcub1 mcuf1 mvpa mcuu1 nel porder oc
+syn keyword terminfoStrings op pad dch dl cud mcud ich indn il cub mcub cuf
+syn keyword terminfoStrings mcuf rin cuu mccu pfkey pfloc pfx pln mc0 mc5p
+syn keyword terminfoStrings mc4 mc5 pulse qdial rmclk rep rfi rs1 rs2 rs3 rf
+syn keyword terminfoStrings rc vpa sc ind ri scs sgr setbsmgb smgbp sclk scp
+syn keyword terminfoStrings setb setf smgl smglp smgr smgrp hts smgt smgtp
+syn keyword terminfoStrings wind sbim scsd rbim rcsd subcs supcs ht docr
+syn keyword terminfoStrings tsl tone uc hu
+syn match terminfoStrings "\<u[0-9]\>"
+syn keyword terminfoStrings wait xoffc xonc zerom
+syn keyword terminfoStrings scesa bicr binel birep csnm csin colornm defbi
+syn keyword terminfoStrings devt dispc endbi smpch smsc rmpch rmsc getm
+syn keyword terminfoStrings kmous minfo pctrm pfxl reqmp scesc s0ds s1ds
+syn keyword terminfoStrings s2ds s3ds setab setaf setcolor smglr slines
+syn keyword terminfoStrings smgtb ehhlm elhlm erhlm ethlm evhlm sgr1
+syn keyword terminfoStrings slengthsL
+
+" parameterized strings
+syn match terminfoParameters "%[%dcspl+*/mAO&|^=<>!~i?te;-]"
+syn match terminfoParameters "%\('[A-Z]'\|{[0-9]\{1,2}}\|p[1-9]\|P[a-z]\|g[A-Z]\)"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_terminfo_syn_inits")
+ if version < 508
+ let did_terminfo_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink terminfoComment Comment
+ HiLink terminfoTodo Todo
+ HiLink terminfoNumbers Number
+ HiLink terminfoSpecialChar SpecialChar
+ HiLink terminfoDelay Special
+ HiLink terminfoBooleans Type
+ HiLink terminfoNumerics Type
+ HiLink terminfoStrings Type
+ HiLink terminfoParameters Keyword
+ HiLink terminfoKeywords Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "terminfo"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
new file mode 100644
index 000000000..6eb134dce
--- /dev/null
+++ b/runtime/syntax/tex.vim
@@ -0,0 +1,480 @@
+" Vim syntax file
+" Language: TeX
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Jun 01, 2004
+" Version: 24
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Notes: {{{1
+"
+" 1. If you have a \begin{verbatim} that appears to overrun its boundaries,
+" use %stopzone.
+"
+" 2. Run-on equations ($..$ and $$..$$, particularly) can also be stopped
+" by suitable use of %stopzone.
+"
+" 3. If you have a slow computer, you may wish to modify
+"
+" syn sync maxlines=200
+" syn sync minlines=50
+"
+" to values that are more to your liking.
+"
+" 4. There is no match-syncing for $...$ and $$...$$; hence large
+" equation blocks constructed that way may exhibit syncing problems.
+" (there's no difference between begin/end patterns)
+"
+" 5. If you have the variable "g:tex_no_error" defined then none of the
+" lexical error-checking will be done.
+"
+" ie. let g:tex_no_error=1
+
+" Version Clears: {{{1
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Define the default highlighting. {{{1
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tex_syntax_inits")
+ let did_tex_syntax_inits = 1
+ if version < 508
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+endif
+if exists("g:tex_tex") && !exists("g:tex_no_error")
+ let g:tex_no_error= 1
+endif
+
+" Determine whether or not to use "*.sty" mode
+" The user may override the normal determination by setting
+" g:tex_stylish to 1 (for "*.sty" mode)
+" or to 0 else (normal "*.tex" mode)
+" or on a buffer-by-buffer basis with b:tex_stylish
+let b:extfname=expand("%:e")
+if exists("g:tex_stylish")
+ let b:tex_stylish= g:tex_stylish
+elseif !exists("b:tex_stylish")
+ if b:extfname == "sty" || b:extfname == "cls" || b:extfname == "clo" || b:extfname == "dtx" || b:extfname == "ltx"
+ let b:tex_stylish= 1
+ else
+ let b:tex_stylish= 0
+ endif
+endif
+
+" (La)TeX keywords: only use the letters a-zA-Z {{{1
+" but _ is the only one that causes problems.
+if version < 600
+ set isk-=_
+ if b:tex_stylish
+ set isk+=@
+ endif
+else
+ setlocal isk-=_
+ if b:tex_stylish
+ setlocal isk+=@
+ endif
+endif
+
+" Clusters: {{{1
+" --------
+syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSectionMarker,texSectionName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle
+if !exists("g:tex_no_error")
+ syn cluster texCmdGroup add=texMathError
+endif
+syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement
+syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption
+if !exists("tex_no_math")
+ syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
+ syn cluster texMatchGroup add=@texMathZones
+ syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
+ syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone
+ syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle
+ if !exists("g:tex_no_error")
+ syn cluster texMathMatchGroup add=texMathError
+ syn cluster texMathZoneGroup add=texMathError
+ endif
+endif
+
+" Try to flag {} and () mismatches: {{{1
+if !exists("g:tex_no_error")
+ syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError
+ syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError
+else
+ syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup
+ syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup
+endif
+syn region texParen start="(" end=")" contains=@texMatchGroup
+if !exists("g:tex_no_error")
+ syn match texError "[}\])]"
+endif
+if !exists("tex_no_math")
+ if !exists("g:tex_no_error")
+ syn match texMathError "}" contained
+ endif
+ syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
+endif
+
+" TeX/LaTeX keywords: {{{1
+" Instead of trying to be All Knowing, I just match \..alphameric..
+" Note that *.tex files may not have "@" in their \commands
+if exists("g:tex_tex") || b:tex_stylish
+ syn match texStatement "\\[a-zA-Z@]\+"
+else
+ syn match texStatement "\\\a\+"
+ if !exists("g:tex_no_error")
+ syn match texError "\\\a*@[a-zA-Z@]*"
+ endif
+endif
+
+" TeX/LaTeX delimiters: {{{1
+syn match texDelimiter "&"
+syn match texDelimiter "\\\\"
+
+" Tex/Latex Options: {{{1
+syn match texOption "[^\\]\zs#\d\+\|^#\d\+"
+
+" texAccent (tnx to Karim Belabas) avoids annoying highlighting for accents: {{{1
+if b:tex_stylish
+ syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1
+ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1
+else
+ syn match texAccent "\\[bcdvuH]\A"me=e-1
+ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)\A"me=e-1
+endif
+syn match texAccent "\\[bcdvuH]$"
+syn match texAccent +\\[=^.\~"`']+
+syn match texAccent +\\['=t'.c^ud"vb~Hr]{\a}+
+syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$"
+
+" \begin{}/\end{} section markers: {{{1
+syn match texSectionMarker "\\begin\>\|\\end\>" nextgroup=texSectionName
+syn region texSectionName matchgroup=Delimiter start="{" end="}" contained nextgroup=texSectionModifier
+syn region texSectionModifier matchgroup=Delimiter start="\[" end="]" contained
+
+" \documentclass, \documentstyle, \usepackage: {{{1
+syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texSectionName,texDocTypeArgs
+syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texSectionName
+
+" TeX input: {{{1
+syn match texInput "\\input\s\+[a-zA-Z/.0-9_^]\+"hs=s+7 contains=texStatement
+syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies
+syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
+syn match texInputCurlies "[{}]" contained
+syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained
+
+" Type Styles (LaTeX 2.09): {{{1
+syn match texTypeStyle "\\rm\>"
+syn match texTypeStyle "\\em\>"
+syn match texTypeStyle "\\bf\>"
+syn match texTypeStyle "\\it\>"
+syn match texTypeStyle "\\sl\>"
+syn match texTypeStyle "\\sf\>"
+syn match texTypeStyle "\\sc\>"
+syn match texTypeStyle "\\tt\>"
+
+" Type Styles: attributes, commands, families, etc (LaTeX2E): {{{1
+syn match texTypeStyle "\\textbf\>"
+syn match texTypeStyle "\\textit\>"
+syn match texTypeStyle "\\textmd\>"
+syn match texTypeStyle "\\textrm\>"
+syn match texTypeStyle "\\textsc\>"
+syn match texTypeStyle "\\textsf\>"
+syn match texTypeStyle "\\textsl\>"
+syn match texTypeStyle "\\texttt\>"
+syn match texTypeStyle "\\textup\>"
+syn match texTypeStyle "\\emph\>"
+
+syn match texTypeStyle "\\mathbb\>"
+syn match texTypeStyle "\\mathbf\>"
+syn match texTypeStyle "\\mathcal\>"
+syn match texTypeStyle "\\mathfrak\>"
+syn match texTypeStyle "\\mathit\>"
+syn match texTypeStyle "\\mathnormal\>"
+syn match texTypeStyle "\\mathrm\>"
+syn match texTypeStyle "\\mathsf\>"
+syn match texTypeStyle "\\mathtt\>"
+
+syn match texTypeStyle "\\rmfamily\>"
+syn match texTypeStyle "\\sffamily\>"
+syn match texTypeStyle "\\ttfamily\>"
+
+syn match texTypeStyle "\\itshape\>"
+syn match texTypeStyle "\\scshape\>"
+syn match texTypeStyle "\\slshape\>"
+syn match texTypeStyle "\\upshape\>"
+
+syn match texTypeStyle "\\bfseries\>"
+syn match texTypeStyle "\\mdseries\>"
+
+" Some type sizes: {{{1
+syn match texTypeSize "\\tiny\>"
+syn match texTypeSize "\\scriptsize\>"
+syn match texTypeSize "\\footnotesize\>"
+syn match texTypeSize "\\small\>"
+syn match texTypeSize "\\normalsize\>"
+syn match texTypeSize "\\large\>"
+syn match texTypeSize "\\Large\>"
+syn match texTypeSize "\\LARGE\>"
+syn match texTypeSize "\\huge\>"
+syn match texTypeSize "\\Huge\>"
+
+" Spacecodes (TeX'isms): {{{1
+" \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x
+syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar
+syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
+
+" Sections, subsections, etc: {{{1
+syn match texSection "\\\(sub\)*section\*\=\>"
+syn match texSection "\\\(title\|author\|part\|chapter\|paragraph\|subparagraph\)\>"
+syn match texSection "\\begin\s*{\s*abstract\s*}\|\\end\s*{\s*abstract\s*}"
+
+" Bad Math (mismatched): {{{1
+if !exists("tex_no_math")
+ syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
+ syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
+ syn match texBadMath "\\[\])]"
+endif
+
+" Math Zones: {{{1
+if !exists("tex_no_math")
+ " TexNewMathZone: creates a mathzone with the given suffix and mathzone name. {{{2
+ " Starred forms are created if starform is true. Starred
+ " forms have syntax group and synchronization groups with a
+ " "S" appended. Handles: cluster, syntax, sync, and HiLink.
+ fun! TexNewMathZone(sfx,mathzone,starform)
+ let grpname = "texMathZone".a:sfx
+ let syncname = "texSyncMathZone".a:sfx
+ exe "syn cluster texMathZones add=".grpname
+ exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\s*}'."'".' keepend contains=@texMathZoneGroup'
+ exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
+ exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
+ exe 'HiLink '.grpname.' texMath'
+ if a:starform
+ let grpname = "texMathZone".a:sfx.'S'
+ let syncname = "texSyncMathZone".a:sfx.'S'
+ exe "syn cluster texMathZones add=".grpname
+ exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\*\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\*\s*}'."'".' keepend contains=@texMathZoneGroup'
+ exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
+ exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"'
+ exe 'HiLink '.grpname.' texMath'
+ endif
+ endfun
+
+ " Standard Math Zones: {{{2
+ call TexNewMathZone("A","align",1)
+ call TexNewMathZone("B","alignat",1)
+ call TexNewMathZone("C","displaymath",1)
+ call TexNewMathZone("D","eqnarray",1)
+ call TexNewMathZone("E","equation",1)
+ call TexNewMathZone("F","flalign",1)
+ call TexNewMathZone("G","gather",1)
+ call TexNewMathZone("H","math",1)
+ call TexNewMathZone("I","multline",1)
+ call TexNewMathZone("J","subequations",0)
+ call TexNewMathZone("K","xalignat",1)
+ call TexNewMathZone("L","xxalignat",0)
+
+ " Inline Math Zones: {{{2
+ syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup
+ syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup
+ syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
+ syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup
+ syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup
+
+ syn match texMathOper "[_^=]" contained
+
+ " \left..something.. and \right..something.. support: {{{2
+ syn match texMathDelimBad contained "\S"
+ syn match texMathDelim contained "\\\(left\|right\|[bB]igg\=[lr]\)\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad
+ syn match texMathDelim contained "\\\(left\|right\)arrow\>\|\<\([aA]rrow\|brace\)\=vert\>"
+ syn match texMathDelim contained "\\lefteqn\>"
+ syn match texMathDelimSet2 contained "\\" nextgroup=texMathDelimKey,texMathDelimBad
+ syn match texMathDelimSet1 contained "[<>()[\]|/.]\|\\[{}|]"
+ syn keyword texMathDelimKey contained backslash lceil lVert rgroup uparrow
+ syn keyword texMathDelimKey contained downarrow lfloor rangle rmoustache Uparrow
+ syn keyword texMathDelimKey contained Downarrow lgroup rbrace rvert updownarrow
+ syn keyword texMathDelimKey contained langle lmoustache rceil rVert Updownarrow
+ syn keyword texMathDelimKey contained lbrace lvert rfloor
+endif
+
+" Special TeX characters ( \$ \& \% \# \{ \} \_ \S \P ) : {{{1
+syn match texSpecialChar "\\[$&%#{}_]"
+if b:tex_stylish
+ syn match texSpecialChar "\\[SP@][^a-zA-Z@]"me=e-1
+else
+ syn match texSpecialChar "\\[SP@]\A"me=e-1
+endif
+syn match texSpecialChar "\\\\"
+if !exists("tex_no_math")
+ syn match texOnlyMath "[_^]"
+endif
+syn match texSpecialChar "\^\^[0-9a-f]\{2}\|\^\^\S"
+
+" Comments: {{{1
+" Normal TeX LaTeX : %....
+" Documented TeX Format: ^^A... -and- leading %s (only)
+syn cluster texCommentGroup contains=texTodo,@Spell
+syn case ignore
+syn keyword texTodo contained combak fixme todo
+syn case match
+if b:extfname == "dtx"
+ syn match texComment "\^\^A.*$" contains=@texCommentGroup
+ syn match texComment "^%\+" contains=@texCommentGroup
+else
+ syn match texComment "%.*$" contains=@texCommentGroup
+endif
+
+" Separate lines used for verb` and verb# so that the end conditions {{{1
+" will appropriately terminate. Ideally vim would let me save a
+" character from the start pattern and re-use it in the end-pattern.
+syn region texZone start="\\begin{verbatim}" end="\\end{verbatim}\|%stopzone\>"
+if version < 600
+ syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>"
+ syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>"
+else
+ if b:tex_stylish
+ syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>"
+ else
+ syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>"
+ endif
+endif
+
+" Tex Reference Zones: {{{1
+syn region texZone start="@samp{" end="}\|%stopzone\>"
+syn region texRefZone matchgroup=texStatement start="\\nocite{" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+syn region texRefZone matchgroup=texStatement start="\\bibliography{" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+syn region texRefZone matchgroup=texStatement start="\\cite\([tp]\*\=\)\={" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+syn region texRefZone matchgroup=texStatement start="\\label{" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+syn region texRefZone matchgroup=texStatement start="\\v\=ref{" keepend end="}\|%stopzone\>" contains=texComment,texDelimiter
+
+" Handle newcommand, newenvironment : {{{1
+syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl
+syn region texCmdName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texCmdArgs,texCmdBody skipwhite skipnl
+syn region texCmdArgs contained matchgroup=Delimiter start="\["rs=s+1 end="]" nextgroup=texCmdBody skipwhite skipnl
+syn region texCmdBody contained matchgroup=Delimiter start="{"rs=s+1 skip="\\\\\|\\[{}]" matchgroup=Delimiter end="}" contains=@texCmdGroup
+syn match texNewEnv "\\newenvironment\>" nextgroup=texEnvName skipwhite skipnl
+syn region texEnvName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvBgn skipwhite skipnl
+syn region texEnvBgn contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvEnd skipwhite skipnl contains=@texEnvGroup
+syn region texEnvEnd contained matchgroup=Delimiter start="{"rs=s+1 end="}" skipwhite skipnl contains=@texEnvGroup
+
+" Definitions/Commands: {{{1
+syn match texDefCmd "\\def\>" nextgroup=texDefName skipwhite skipnl
+if b:tex_stylish
+ syn match texDefName contained "\\[a-zA-Z@]\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl
+ syn match texDefName contained "\\[^a-zA-Z@]" nextgroup=texDefParms,texCmdBody skipwhite skipnl
+else
+ syn match texDefName contained "\\\a\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl
+ syn match texDefName contained "\\\A" nextgroup=texDefParms,texCmdBody skipwhite skipnl
+endif
+syn match texDefParms contained "#[^{]*" contains=texDefParm nextgroup=texCmdBody skipwhite skipnl
+syn match texDefParm contained "#\d\+"
+
+" TeX Lengths: {{{1
+syn match texLength "\<\d\+\(\.\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\|ex\|in\|mm\|pc\|pt\|sp\)\>"
+
+" TeX String Delimiters: {{{1
+syn match texString "\(``\|''\|,,\)"
+
+" LaTeX synchronization: {{{1
+syn sync maxlines=200
+syn sync minlines=50
+
+syn sync match texSyncStop groupthere NONE "%stopzone\>"
+
+" Synchronization: {{{1
+" The $..$ and $$..$$ make for impossible sync patterns
+" (one can't tell if a "$$" starts or stops a math zone by itself)
+" The following grouptheres coupled with minlines above
+" help improve the odds of good syncing.
+if !exists("tex_no_math")
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{abstract}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{center}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{description}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{enumerate}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{itemize}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{table}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\end{tabular}"
+ syn sync match texSyncMathZoneA groupthere NONE "\\\(sub\)*section\>"
+endif
+
+" Highlighting: {{{1
+if did_tex_syntax_inits == 1
+ let did_tex_syntax_inits= 2
+ " TeX highlighting groups which should share similar highlighting
+ if !exists("g:tex_no_error")
+ if !exists("tex_no_math")
+ HiLink texBadMath texError
+ HiLink texMathDelimBad texError
+ HiLink texMathError texError
+ if !b:tex_stylish
+ HiLink texOnlyMath texError
+ endif
+ endif
+ HiLink texError Error
+ endif
+
+ HiLink texDefCmd texDef
+ HiLink texDefName texDef
+ HiLink texDocType texCmdName
+ HiLink texDocTypeArgs texCmdArgs
+ HiLink texInputFileOpt texCmdArgs
+ HiLink texInputCurlies texDelimiter
+ HiLink texLigature texSpecialChar
+ if !exists("tex_no_math")
+ HiLink texMathDelimSet1 texMathDelim
+ HiLink texMathDelimSet2 texMathDelim
+ HiLink texMathDelimKey texMathDelim
+ HiLink texMathMatcher texMath
+ HiLink texMathZoneW texMath
+ HiLink texMathZoneX texMath
+ HiLink texMathZoneY texMath
+ HiLink texMathZoneZ texMath
+ endif
+ HiLink texSectionMarker texCmdName
+ HiLink texSectionName texSection
+ HiLink texSpaceCode texStatement
+ HiLink texTypeSize texType
+ HiLink texTypeStyle texType
+
+ " Basic TeX highlighting groups
+ HiLink texCmdArgs Number
+ HiLink texCmdName Statement
+ HiLink texComment Comment
+ HiLink texDef Statement
+ HiLink texDefParm Special
+ HiLink texDelimiter Delimiter
+ HiLink texInput Special
+ HiLink texInputFile Special
+ HiLink texLength Number
+ HiLink texMath Special
+ HiLink texMathDelim Statement
+ HiLink texMathOper Operator
+ HiLink texNewCmd Statement
+ HiLink texNewEnv Statement
+ HiLink texOption Number
+ HiLink texRefZone Special
+ HiLink texSection PreCondit
+ HiLink texSpaceCodeChar Special
+ HiLink texSpecialChar SpecialChar
+ HiLink texStatement Statement
+ HiLink texString String
+ HiLink texTodo Todo
+ HiLink texType Type
+ HiLink texZone PreCondit
+
+ delcommand HiLink
+endif
+
+" Current Syntax: {{{1
+unlet b:extfname
+let b:current_syntax = "tex"
+" vim: ts=8 fdm=marker
diff --git a/runtime/syntax/texinfo.vim b/runtime/syntax/texinfo.vim
new file mode 100644
index 000000000..c7d5d8ec7
--- /dev/null
+++ b/runtime/syntax/texinfo.vim
@@ -0,0 +1,409 @@
+" Vim syntax file
+" Language: Texinfo (macro package for TeX)
+" Maintainer: Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
+" URL: <->
+" Last Change: 2003 May 11
+"
+" the file follows the Texinfo manual structure; this file is based
+" on manual for Texinfo version 4.0, 28 September 1999
+" since @ can have special meanings, everything is 'match'-ed and 'region'-ed
+" (including @ in 'iskeyword' option has unexpected effects)
+
+" Remove any old syntax stuff hanging around, if needed
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'texinfo'
+endif
+
+"in Texinfo can be real big things, like tables; sync for that
+syn sync lines=200
+
+"some general stuff
+"syn match texinfoError "\S" contained TODO
+syn match texinfoIdent "\k\+" contained "IDENTifier
+syn match texinfoAssignment "\k\+\s*=\s*\k\+\s*$" contained "assigment statement ( var = val )
+syn match texinfoSinglePar "\k\+\s*$" contained "single parameter (used for several @-commands)
+syn match texinfoIndexPar "\k\k\s*$" contained "param. used for different *index commands (+ @documentlanguage command)
+
+
+"marking words and phrases (chap. 9 in Texinfo manual)
+"(almost) everything appears as 'contained' too; is for tables (@table)
+
+"this chapter is at the beginning of this file to avoid overwritings
+
+syn match texinfoSpecialChar "@acronym" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@acronym{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@b" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@b{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@cite" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@cite{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@code" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@code{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@command" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@command{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@dfn" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dfn{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@email" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@email{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@emph" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@emph{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@env" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@env{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@file" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@file{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@i" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@i{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@kbd" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@kbd{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@key" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@key{" end="}" contains=texinfoSpecialChar
+syn match texinfoSpecialChar "@option" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@option{" end="}" contains=texinfoSpecialChar
+syn match texinfoSpecialChar "@r" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@r{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@samp" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@samp{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@sc" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@sc{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@strong" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@strong{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@t" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@t{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@url" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@url{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoSpecialChar "@var" contained
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@var{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn match texinfoAtCmd "^@kbdinputstyle" nextgroup=texinfoSinglePar skipwhite
+
+
+"overview of Texinfo (chap. 1 in Texinfo manual)
+syn match texinfoComment "@c .*"
+syn match texinfoComment "@c$"
+syn match texinfoComment "@comment .*"
+syn region texinfoMltlnAtCmd matchgroup=texinfoComment start="^@ignore\s*$" end="^@end ignore\s*$" contains=ALL
+
+
+"beginning a Texinfo file (chap. 3 in Texinfo manual)
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="@center " skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
+syn region texinfoMltlnDMAtCmd matchgroup=texinfoAtCmd start="^@detailmenu\s*$" end="^@end detailmenu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@setfilename " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@settitle " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@shorttitlepage " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@title " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@titlefont{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@titlepage\s*$" end="^@end titlepage\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd,texinfoAtCmd,texinfoPrmAtCmd,texinfoMltlnAtCmd
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@vskip " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn match texinfoAtCmd "^@exampleindent" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "^@headings" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "^\\input" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "^@paragraphindent" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "^@setchapternewpage" nextgroup=texinfoSinglePar skipwhite
+
+
+"ending a Texinfo file (chap. 4 in Texinfo manual)
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="@author " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+"all below @bye should be comment TODO
+syn match texinfoAtCmd "^@bye\s*$"
+syn match texinfoAtCmd "^@contents\s*$"
+syn match texinfoAtCmd "^@printindex" nextgroup=texinfoIndexPar skipwhite
+syn match texinfoAtCmd "^@setcontentsaftertitlepage\s*$"
+syn match texinfoAtCmd "^@setshortcontentsaftertitlepage\s*$"
+syn match texinfoAtCmd "^@shortcontents\s*$"
+syn match texinfoAtCmd "^@summarycontents\s*$"
+
+
+"chapter structuring (chap. 5 in Texinfo manual)
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendix" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@appendixsubsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@centerchap" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@chapter" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@heading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@majorheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@section" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subheading " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubheading" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subsubsection" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@subtitle" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumbered" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@unnumberedsubsubsec" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn match texinfoAtCmd "^@lowersections\s*$"
+syn match texinfoAtCmd "^@raisesections\s*$"
+
+
+"nodes (chap. 6 in Texinfo manual)
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@anchor{" end="}"
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@top" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@node" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+
+
+"menus (chap. 7 in Texinfo manual)
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@menu\s*$" end="^@end menu\s*$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoMltlnDMAtCmd
+
+
+"cross references (chap. 8 in Texinfo manual)
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@inforef{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@pxref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@ref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@uref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@xref{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+
+
+"marking words and phrases (chap. 9 in Texinfo manual)
+"(almost) everything appears as 'contained' too; is for tables (@table)
+
+"this chapter is at the beginning of this file to avoid overwritings
+
+
+"quotations and examples (chap. 10 in Texinfo manual)
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@cartouche\s*$" end="^@end cartouche\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@display\s*$" end="^@end display\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@example\s*$" end="^@end example\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushleft\s*$" end="^@end flushleft\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@flushright\s*$" end="^@end flushright\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@format\s*$" end="^@end format\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@lisp\s*$" end="^@end lisp\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@quotation\s*$" end="^@end quotation\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalldisplay\s*$" end="^@end smalldisplay\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallexample\s*$" end="^@end smallexample\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smallformat\s*$" end="^@end smallformat\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@smalllisp\s*$" end="^@end smalllisp\s*$" contains=ALL
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@exdent" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn match texinfoAtCmd "^@noindent\s*$"
+syn match texinfoAtCmd "^@smallbook\s*$"
+
+
+"lists and tables (chap. 11 in Texinfo manual)
+syn match texinfoAtCmd "@asis" contained
+syn match texinfoAtCmd "@columnfractions" contained
+syn match texinfoAtCmd "@item" contained
+syn match texinfoAtCmd "@itemx" contained
+syn match texinfoAtCmd "@tab" contained
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@enumerate" end="^@end enumerate\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ftable" end="^@end ftable\s*$" contains=ALL
+syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@itemize" end="^@end itemize\s*$" contains=ALL
+syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@multitable" end="^@end multitable\s*$" contains=ALL
+syn region texinfoMltlnNAtCmd matchgroup=texinfoAtCmd start="^@table" end="^@end table\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@vtable" end="^@end vtable\s*$" contains=ALL
+
+
+"indices (chap. 12 in Texinfo manual)
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@\(c\|f\|k\|p\|t\|v\)index" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@..index" skip="\\$" end="$" contains=texinfoSpecialChar oneline
+"@defcodeindex and @defindex is defined after chap. 15's @def* commands (otherwise those ones will overwrite these ones)
+syn match texinfoSIPar "\k\k\s*\k\k\s*$" contained
+syn match texinfoAtCmd "^@syncodeindex" nextgroup=texinfoSIPar skipwhite
+syn match texinfoAtCmd "^@synindex" nextgroup=texinfoSIPar skipwhite
+
+"special insertions (chap. 13 in Texinfo manual)
+syn match texinfoSpecialChar "@\(!\|?\|@\|\s\)"
+syn match texinfoSpecialChar "@{"
+syn match texinfoSpecialChar "@}"
+"accents
+syn match texinfoSpecialChar "@=."
+syn match texinfoSpecialChar "@\('\|\"\|\^\|`\)[aeiouyAEIOUY]"
+syn match texinfoSpecialChar "@\~[aeinouyAEINOUY]"
+syn match texinfoSpecialChar "@dotaccent{.}"
+syn match texinfoSpecialChar "@H{.}"
+syn match texinfoSpecialChar "@,{[cC]}"
+syn match texinfoSpecialChar "@AA{}"
+syn match texinfoSpecialChar "@aa{}"
+syn match texinfoSpecialChar "@L{}"
+syn match texinfoSpecialChar "@l{}"
+syn match texinfoSpecialChar "@O{}"
+syn match texinfoSpecialChar "@o{}"
+syn match texinfoSpecialChar "@ringaccent{.}"
+syn match texinfoSpecialChar "@tieaccent{..}"
+syn match texinfoSpecialChar "@u{.}"
+syn match texinfoSpecialChar "@ubaraccent{.}"
+syn match texinfoSpecialChar "@udotaccent{.}"
+syn match texinfoSpecialChar "@v{.}"
+"ligatures
+syn match texinfoSpecialChar "@AE{}"
+syn match texinfoSpecialChar "@ae{}"
+syn match texinfoSpecialChar "@copyright{}"
+syn match texinfoSpecialChar "@bullet" contained "for tables and lists
+syn match texinfoSpecialChar "@bullet{}"
+syn match texinfoSpecialChar "@dotless{i}"
+syn match texinfoSpecialChar "@dotless{j}"
+syn match texinfoSpecialChar "@dots{}"
+syn match texinfoSpecialChar "@enddots{}"
+syn match texinfoSpecialChar "@equiv" contained "for tables and lists
+syn match texinfoSpecialChar "@equiv{}"
+syn match texinfoSpecialChar "@error{}"
+syn match texinfoSpecialChar "@exclamdown{}"
+syn match texinfoSpecialChar "@expansion{}"
+syn match texinfoSpecialChar "@minus" contained "for tables and lists
+syn match texinfoSpecialChar "@minus{}"
+syn match texinfoSpecialChar "@OE{}"
+syn match texinfoSpecialChar "@oe{}"
+syn match texinfoSpecialChar "@point" contained "for tables and lists
+syn match texinfoSpecialChar "@point{}"
+syn match texinfoSpecialChar "@pounds{}"
+syn match texinfoSpecialChar "@print{}"
+syn match texinfoSpecialChar "@questiondown{}"
+syn match texinfoSpecialChar "@result" contained "for tables and lists
+syn match texinfoSpecialChar "@result{}"
+syn match texinfoSpecialChar "@ss{}"
+syn match texinfoSpecialChar "@TeX{}"
+"other
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@dmn{" end="}"
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@footnote{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@image{" end="}"
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@math{" end="}"
+syn match texinfoAtCmd "@footnotestyle" nextgroup=texinfoSinglePar skipwhite
+
+
+"making and preventing breaks (chap. 14 in Texinfo manual)
+syn match texinfoSpecialChar "@\(\*\|-\|\.\)"
+syn match texinfoAtCmd "^@need" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "^@page\s*$"
+syn match texinfoAtCmd "^@sp" nextgroup=texinfoSinglePar skipwhite
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@group\s*$" end="^@end group\s*$" contains=ALL
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@hyphenation{" end="}"
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@w{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+
+
+"definition commands (chap. 15 in Texinfo manual)
+syn match texinfoMltlnAtCmdFLine "^@def\k\+" contained
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@def\k\+" end="^@end def\k\+$" contains=ALL
+
+"next 2 commands are from chap. 12; must be defined after @def* commands above to overwrite them
+syn match texinfoAtCmd "@defcodeindex" nextgroup=texinfoIndexPar skipwhite
+syn match texinfoAtCmd "@defindex" nextgroup=texinfoIndexPar skipwhite
+
+
+"conditionally visible text (chap. 16 in Texinfo manual)
+syn match texinfoAtCmd "^@clear" nextgroup=texinfoSinglePar skipwhite
+syn region texinfoMltln2AtCmd matchgroup=texinfoAtCmd start="^@html\s*$" end="^@end html\s*$"
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifclear" end="^@end ifclear\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifhtml" end="^@end ifhtml\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifinfo" end="^@end ifinfo\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnothtml" end="^@end ifnothtml\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnotinfo" end="^@end ifnotinfo\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifnottex" end="^@end ifnottex\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@ifset" end="^@end ifset\s*$" contains=ALL
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@iftex" end="^@end iftex\s*$" contains=ALL
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@set " skip="\\$" end="$" contains=texinfoSpecialChar oneline
+syn region texinfoTexCmd start="\$\$" end="\$\$" contained
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@tex" end="^@end tex\s*$" contains=texinfoTexCmd
+syn region texinfoBrcPrmAtCmd matchgroup=texinfoAtCmd start="@value{" end="}" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+
+
+"internationalization (chap. 17 in Texinfo manual)
+syn match texinfoAtCmd "@documentencoding" nextgroup=texinfoSinglePar skipwhite
+syn match texinfoAtCmd "@documentlanguage" nextgroup=texinfoIndexPar skipwhite
+
+
+"defining new texinfo commands (chap. 18 in Texinfo manual)
+syn match texinfoAtCmd "@alias" nextgroup=texinfoAssignment skipwhite
+syn match texinfoDIEPar "\S*\s*,\s*\S*\s*,\s*\S*\s*$" contained
+syn match texinfoAtCmd "@definfoenclose" nextgroup=texinfoDIEPar skipwhite
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@macro" end="^@end macro\s*$" contains=ALL
+
+
+"formatting hardcopy (chap. 19 in Texinfo manual)
+syn match texinfoAtCmd "^@afourlatex\s*$"
+syn match texinfoAtCmd "^@afourpaper\s*$"
+syn match texinfoAtCmd "^@afourwide\s*$"
+syn match texinfoAtCmd "^@finalout\s*$"
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@pagesizes" end="$" oneline
+
+
+"creating and installing Info Files (chap. 20 in Texinfo manual)
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@dircategory" skip="\\$" end="$" oneline
+syn region texinfoMltlnAtCmd matchgroup=texinfoAtCmd start="^@direntry\s*$" end="^@end direntry\s*$" contains=texinfoSpecialChar
+syn match texinfoAtCmd "^@novalidate\s*$"
+
+
+"include files (appendix E in Texinfo manual)
+syn match texinfoAtCmd "^@include" nextgroup=texinfoSinglePar skipwhite
+
+
+"page headings (appendix F in Texinfo manual)
+syn match texinfoHFSpecialChar "@|" contained
+syn match texinfoThisAtCmd "@thischapter" contained
+syn match texinfoThisAtCmd "@thischaptername" contained
+syn match texinfoThisAtCmd "@thisfile" contained
+syn match texinfoThisAtCmd "@thispage" contained
+syn match texinfoThisAtCmd "@thistitle" contained
+syn match texinfoThisAtCmd "@today{}" contained
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@evenheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@everyheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddfooting" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+syn region texinfoPrmAtCmd matchgroup=texinfoAtCmd start="^@oddheading" skip="\\$" end="$" contains=texinfoSpecialChar,texinfoBrcPrmAtCmd,texinfoThisAtCmd,texinfoHFSpecialChar oneline
+
+
+"refilling paragraphs (appendix H in Texinfo manual)
+syn match texinfoAtCmd "@refill"
+
+
+syn cluster texinfoAll contains=ALLBUT,{texinfoThisAtCmd,texinfoHFSpecialChar}
+syn cluster texinfoReducedAll contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
+"==============================================================================
+" highlighting
+
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_texinfo_syn_inits")
+
+ if version < 508
+ let did_texinfo_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink texinfoSpecialChar Special
+ HiLink texinfoHFSpecialChar Special
+
+ HiLink texinfoError Error
+ HiLink texinfoIdent Identifier
+ HiLink texinfoAssignment Identifier
+ HiLink texinfoSinglePar Identifier
+ HiLink texinfoIndexPar Identifier
+ HiLink texinfoSIPar Identifier
+ HiLink texinfoDIEPar Identifier
+ HiLink texinfoTexCmd PreProc
+
+
+ HiLink texinfoAtCmd Statement "@-command
+ HiLink texinfoPrmAtCmd String "@-command in one line with unknown nr. of parameters
+ "is String because is found as a region and is 'matchgroup'-ed
+ "to texinfoAtCmd
+ HiLink texinfoBrcPrmAtCmd String "@-command with parameter(s) in braces ({})
+ "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
+ HiLink texinfoMltlnAtCmdFLine texinfoAtCmd "repeated embedded First lines in @-commands
+ HiLink texinfoMltlnAtCmd String "@-command in multiple lines
+ "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd
+ HiLink texinfoMltln2AtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
+ HiLink texinfoMltlnDMAtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors; used for @detailmenu, which can be included in @menu)
+ HiLink texinfoMltlnNAtCmd Normal "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors)
+ HiLink texinfoThisAtCmd Statement "@-command used in headers and footers (@this... series)
+
+ HiLink texinfoComment Comment
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "texinfo"
+
+if main_syntax == 'texinfo'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/texmf.vim b/runtime/syntax/texmf.vim
new file mode 100644
index 000000000..7b91168f0
--- /dev/null
+++ b/runtime/syntax/texmf.vim
@@ -0,0 +1,86 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: Web2C TeX texmf.cnf configuration file
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2001-05-13
+" URL: http://physics.muni.cz/~yeti/download/syntax/texmf.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+syn case match
+
+" Comments
+syn match texmfComment "%..\+$" contains=texmfTodo
+syn match texmfComment "%\s*$" contains=texmfTodo
+syn keyword texmfTodo TODO FIXME XXX NOT contained
+
+" Constants and parameters
+syn match texmfPassedParameter "[-+]\=%\w\W"
+syn match texmfPassedParameter "[-+]\=%\w$"
+syn match texmfNumber "\<\d\+\>"
+syn match texmfVariable "\$\(\w\k*\|{\w\k*}\)"
+syn match texmfSpecial +\\"\|\\$+
+syn region texmfString start=+"+ end=+"+ skip=+\\"\\\\+ contains=texmfVariable,texmfSpecial,texmfPassedParameter
+
+" Assignments
+syn match texmfLHSStart "^\s*\w\k*" nextgroup=texmfLHSDot,texmfEquals
+syn match texmfLHSVariable "\w\k*" contained nextgroup=texmfLHSDot,texmfEquals
+syn match texmfLHSDot "\." contained nextgroup=texmfLHSVariable
+syn match texmfEquals "\s*=" contained
+
+" Specialities
+syn match texmfComma "," contained
+syn match texmfColons ":\|;"
+syn match texmfDoubleExclam "!!" contained
+
+" Catch errors caused by wrong parenthesization
+syn region texmfBrace matchgroup=texmfBraceBrace start="{" end="}" contains=ALLBUT,texmfTodo,texmfBraceError,texmfLHSVariable,texmfLHSDot transparent
+syn match texmfBraceError "}"
+
+" Define the default highlighting
+if version >= 508 || !exists("did_texmf_syntax_inits")
+ if version < 508
+ let did_texmf_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink texmfComment Comment
+ HiLink texmfTodo Todo
+
+ HiLink texmfPassedParameter texmfVariable
+ HiLink texmfVariable Identifier
+
+ HiLink texmfNumber Number
+ HiLink texmfString String
+
+ HiLink texmfLHSStart texmfLHS
+ HiLink texmfLHSVariable texmfLHS
+ HiLink texmfLHSDot texmfLHS
+ HiLink texmfLHS Type
+
+ HiLink texmfEquals Normal
+
+ HiLink texmfBraceBrace texmfDelimiter
+ HiLink texmfComma texmfDelimiter
+ HiLink texmfColons texmfDelimiter
+ HiLink texmfDelimiter Preproc
+
+ HiLink texmfDoubleExclam Statement
+ HiLink texmfSpecial Special
+
+ HiLink texmfBraceError texmfError
+ HiLink texmfError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "texmf"
diff --git a/runtime/syntax/tf.vim b/runtime/syntax/tf.vim
new file mode 100644
index 000000000..2a9a99988
--- /dev/null
+++ b/runtime/syntax/tf.vim
@@ -0,0 +1,209 @@
+" Vim syntax file
+" Language: tf
+" Maintainer: Lutz Eymers <ixtab@polzin.com>
+" URL: http://www.isp.de/data/tf.vim
+" Email: send syntax_vim.tgz
+" Last Change: 2001 May 10
+"
+" Options lite_minlines = x to sync at least x lines backwards
+
+" Remove any old syntax stuff hanging around
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+if !exists("main_syntax")
+ let main_syntax = 'tf'
+endif
+
+" Special global variables
+syn keyword tfVar HOME LANG MAIL SHELL TERM TFHELP TFLIBDIR TFLIBRARY TZ contained
+syn keyword tfVar background backslash contained
+syn keyword tfVar bamf bg_output borg clearfull cleardone clock connect contained
+syn keyword tfVar emulation end_color gag gethostbyname gpri hook hilite contained
+syn keyword tfVar hiliteattr histsize hpri insert isize istrip kecho contained
+syn keyword tfVar kprefix login lp lpquote maildelay matching max_iter contained
+syn keyword tfVar max_recur mecho more mprefix oldslash promt_sec contained
+syn keyword tfVar prompt_usec proxy_host proxy_port ptime qecho qprefix contained
+syn keyword tfVar quite quitdone redef refreshtime scroll shpause snarf sockmload contained
+syn keyword tfVar start_color tabsize telopt sub time_format visual contained
+syn keyword tfVar watch_dog watchname wordpunct wrap wraplog wrapsize contained
+syn keyword tfVar wrapspace contained
+
+" Worldvar
+syn keyword tfWorld world_name world_character world_password world_host contained
+syn keyword tfWorld world_port world_mfile world_type contained
+
+" Number
+syn match tfNumber "-\=\<\d\+\>"
+
+" Float
+syn match tfFloat "\(-\=\<\d+\|-\=\)\.\d\+\>"
+
+" Operator
+syn match tfOperator "[-+=?:&|!]"
+syn match tfOperator "/[^*~@]"he=e-1
+syn match tfOperator ":="
+syn match tfOperator "[^/%]\*"hs=s+1
+syn match tfOperator "$\+[([{]"he=e-1,me=e-1
+syn match tfOperator "\^\[\+"he=s+1 contains=tfSpecialCharEsc
+
+" Relational
+syn match tfRelation "&&"
+syn match tfRelation "||"
+syn match tfRelation "[<>/!=]="
+syn match tfRelation "[<>]"
+syn match tfRelation "[!=]\~"
+syn match tfRelation "[=!]/"
+
+
+" Readonly Var
+syn match tfReadonly "[#*]" contained
+syn match tfReadonly "\<-\=L\=\d\{-}\>" contained
+syn match tfReadonly "\<P\(\d\+\|R\|L\)\>" contained
+syn match tfReadonly "\<R\>" contained
+
+" Identifier
+syn match tfIdentifier "%\+[a-zA-Z_#*-0-9]\w*" contains=tfVar,tfReadonly
+syn match tfIdentifier "%\+[{]"he=e-1,me=e-1
+syn match tfIdentifier "\$\+{[a-zA-Z_#*-0-9]\w*}" contains=tfWorld
+
+" Function names
+syn keyword tfFunctions ascii char columns echo filename ftime fwrite getopts
+syn keyword tfFunctions getpid idle kbdel kbgoto kbhead kblen kbmatch kbpoint
+syn keyword tfFunctions kbtail kbwordleft kbwordright keycode lines mod
+syn keyword tfFunctions moresize pad rand read regmatch send strcat strchr
+syn keyword tfFunctions strcmp strlen strncmp strrchr strrep strstr substr
+syn keyword tfFunctions systype time tolower toupper
+
+syn keyword tfStatement addworld bamf beep bind break cat changes connect contained
+syn keyword tfStatement dc def dokey echo edit escape eval export expr fg for contained
+syn keyword tfStatement gag getfile grab help hilite histsize hook if input contained
+syn keyword tfStatement kill lcd let list listsockets listworlds load contained
+syn keyword tfStatement localecho log nohilite not partial paste ps purge contained
+syn keyword tfStatement purgeworld putfile quit quote recall recordline save contained
+syn keyword tfStatement saveworld send sh shift sub substitute contained
+syn keyword tfStatement suspend telnet test time toggle trig trigger unbind contained
+syn keyword tfStatement undef undefn undeft unhook untrig unworld contained
+syn keyword tfStatement version watchdog watchname while world contained
+
+" Hooks
+syn keyword tfHook ACTIVITY BACKGROUND BAMF CONFAIL CONFLICT CONNECT DISCONNECT
+syn keyword tfHook KILL LOAD LOADFAIL LOG LOGIN MAIL MORE PENDING PENDING
+syn keyword tfHook PROCESS PROMPT PROXY REDEF RESIZE RESUME SEND SHADOW SHELL
+syn keyword tfHook SIGHUP SIGTERM SIGUSR1 SIGUSR2 WORLD
+
+" Conditional
+syn keyword tfConditional if endif then else elseif contained
+
+" Repeat
+syn keyword tfRepeat while do done repeat for contained
+
+" Statement
+syn keyword tfStatement break quit contained
+
+" Include
+syn keyword tfInclude require load save loaded contained
+
+" Define
+syn keyword tfDefine bind unbind def undef undefn undefn purge hook unhook trig untrig contained
+syn keyword tfDefine set unset setenv contained
+
+" Todo
+syn keyword tfTodo TODO Todo todo contained
+
+" SpecialChar
+syn match tfSpecialChar "\\[abcfnrtyv\\]" contained
+syn match tfSpecialChar "\\\d\{3}" contained contains=tfOctalError
+syn match tfSpecialChar "\\x[0-9a-fA-F]\{2}" contained
+syn match tfSpecialCharEsc "\[\+" contained
+
+syn match tfOctalError "[89]" contained
+
+" Comment
+syn region tfComment start="^;" end="$" contains=tfTodo
+
+" String
+syn region tfString oneline matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=tfIdentifier,tfSpecialChar,tfEscape
+syn region tfString matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tfIdentifier,tfSpecialChar,tfEscape
+
+syn match tfParentError "[)}\]]"
+
+" Parents
+syn region tfParent matchgroup=Delimiter start="(" end=")" contains=ALLBUT,tfReadonly
+syn region tfParent matchgroup=Delimiter start="\[" end="\]" contains=ALL
+syn region tfParent matchgroup=Delimiter start="{" end="}" contains=ALL
+
+syn match tfEndCommand "%%\{-};"
+syn match tfJoinLines "\\$"
+
+" Types
+
+syn match tfType "/[a-zA-Z_~@][a-zA-Z0-9_]*" contains=tfConditional,tfRepeat,tfStatement,tfInclude,tfDefine,tfStatement
+
+" Catch /quote .. '
+syn match tfQuotes "/quote .\{-}'" contains=ALLBUT,tfString
+" Catch $(/escape )
+syn match tfEscape "(/escape .*)"
+
+" sync
+if exists("tf_minlines")
+ exec "syn sync minlines=" . tf_minlines
+else
+ syn sync minlines=100
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tf_syn_inits")
+ if version < 508
+ let did_tf_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tfComment Comment
+ HiLink tfString String
+ HiLink tfNumber Number
+ HiLink tfFloat Float
+ HiLink tfIdentifier Identifier
+ HiLink tfVar Identifier
+ HiLink tfWorld Identifier
+ HiLink tfReadonly Identifier
+ HiLink tfHook Identifier
+ HiLink tfFunctions Function
+ HiLink tfRepeat Repeat
+ HiLink tfConditional Conditional
+ HiLink tfLabel Label
+ HiLink tfStatement Statement
+ HiLink tfType Type
+ HiLink tfInclude Include
+ HiLink tfDefine Define
+ HiLink tfSpecialChar SpecialChar
+ HiLink tfSpecialCharEsc SpecialChar
+ HiLink tfParentError Error
+ HiLink tfTodo Todo
+ HiLink tfEndCommand Delimiter
+ HiLink tfJoinLines Delimiter
+ HiLink tfOperator Operator
+ HiLink tfRelation Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tf"
+
+if main_syntax == 'tf'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/tidy.vim b/runtime/syntax/tidy.vim
new file mode 100644
index 000000000..06518033b
--- /dev/null
+++ b/runtime/syntax/tidy.vim
@@ -0,0 +1,153 @@
+" Vim syntax file
+" Filename: tidy.vim
+" Language: HMTL Tidy configuration file ( /etc/tidyrc ~/.tidyrc )
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/tidy.vim
+" Last Change: 2002 Oct 24
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+if version < 600
+ set iskeyword=@,48-57,-
+else
+ setlocal iskeyword=@,48-57,-
+endif
+
+syn match tidyComment "^\s*//.*$" contains=tidyTodo
+syn match tidyComment "^\s*#.*$" contains=tidyTodo
+syn keyword tidyTodo TODO NOTE FIXME XXX contained
+
+syn match tidyAssignment "^[a-z0-9-]\+:\s*.*$" contains=tidyOption,@tidyValue,tidyDelimiter
+syn match tidyDelimiter ":" contained
+
+syn match tidyNewTagAssignment "^new-\l\+-tags:\s*.*$" contains=tidyNewTagOption,tidyNewTagDelimiter,tidyNewTagValue,tidyDelimiter
+syn match tidyNewTagDelimiter "," contained
+syn match tidyNewTagValue "\<\w\+\>" contained
+
+syn case ignore
+syn keyword tidyBoolean t[rue] f[alse] y[es] n[o] contained
+syn case match
+syn match tidyDoctype "\<omit\|auto\|strict\|loose\|transitional\>" contained
+" NOTE: use match rather than keyword here so that tidyEncoding raw does not always have precedence over tidyOption raw
+syn match tidyEncoding "\<\(ascii\|latin1\|raw\|utf8\|iso2022\|mac\|utf16le\|utf16be\|utf16\|win1252\|big5\|shiftjis\)\>" contained
+syn match tidyNumber "\<\d\+\>" contained
+syn match tidyRepeat "\<keep-first\|keep-last\>" contained
+syn region tidyString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
+syn region tidyString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
+syn cluster tidyValue contains=tidyBoolean,tidyDoctype,tidyEncoding,tidyNumber,tidyRepeat,tidyString
+
+syn match tidyOption "^accessibility-check" contained
+syn match tidyOption "^add-xml-decl" contained
+syn match tidyOption "^add-xml-pi" contained
+syn match tidyOption "^add-xml-space" contained
+syn match tidyOption "^alt-text" contained
+syn match tidyOption "^ascii-chars" contained
+syn match tidyOption "^assume-xml-procins" contained
+syn match tidyOption "^bare" contained
+syn match tidyOption "^break-before-br" contained
+syn match tidyOption "^char-encoding" contained
+syn match tidyOption "^clean" contained
+syn match tidyOption "^css-prefix" contained
+syn match tidyOption "^doctype" contained
+syn match tidyOption "^drop-empty-paras" contained
+syn match tidyOption "^drop-font-tags" contained
+syn match tidyOption "^drop-proprietary-attributes" contained
+syn match tidyOption "^enclose-block-text" contained
+syn match tidyOption "^enclose-text" contained
+syn match tidyOption "^error-file" contained
+syn match tidyOption "^escape-cdata" contained
+syn match tidyOption "^fix-backslash" contained
+syn match tidyOption "^fix-bad-comments" contained
+syn match tidyOption "^fix-uri" contained
+syn match tidyOption "^force-output" contained
+syn match tidyOption "^gnu-emacs" contained
+syn match tidyOption "^hide-comments" contained
+syn match tidyOption "^hide-endtags" contained
+syn match tidyOption "^indent" contained
+syn match tidyOption "^indent-attributes" contained
+syn match tidyOption "^indent-cdata" contained
+syn match tidyOption "^indent-spaces" contained
+syn match tidyOption "^input-encoding" contained
+syn match tidyOption "^input-xml" contained
+syn match tidyOption "^join-classes" contained
+syn match tidyOption "^join-styles" contained
+syn match tidyOption "^keep-time" contained
+syn match tidyOption "^language" contained
+syn match tidyOption "^literal-attributes" contained
+syn match tidyOption "^logical-emphasis" contained
+syn match tidyOption "^lower-literals" contained
+syn match tidyOption "^markup" contained
+syn match tidyOption "^ncr" contained
+syn match tidyOption "^numeric-entities" contained
+syn match tidyOption "^output-bom" contained
+syn match tidyOption "^output-encoding" contained
+syn match tidyOption "^output-html" contained
+syn match tidyOption "^output-xhtml" contained
+syn match tidyOption "^output-xml" contained
+syn match tidyOption "^quiet" contained
+syn match tidyOption "^quote-ampersand" contained
+syn match tidyOption "^quote-marks" contained
+syn match tidyOption "^quote-nbsp" contained
+syn match tidyOption "^raw" contained
+syn match tidyOption "^repeated-attributes" contained
+syn match tidyOption "^replace-color" contained
+syn match tidyOption "^show-body-only" contained
+syn match tidyOption "^show-errors" contained
+syn match tidyOption "^show-warnings" contained
+syn match tidyOption "^slide-style" contained
+syn match tidyOption "^split" contained
+syn match tidyOption "^tab-size" contained
+syn match tidyOption "^tidy-mark" contained
+syn match tidyOption "^uppercase-attributes" contained
+syn match tidyOption "^uppercase-tags" contained
+syn match tidyOption "^word-2000" contained
+syn match tidyOption "^wrap" contained
+syn match tidyOption "^wrap-asp" contained
+syn match tidyOption "^wrap-attributes" contained
+syn match tidyOption "^wrap-jste" contained
+syn match tidyOption "^wrap-php" contained
+syn match tidyOption "^wrap-script-literals" contained
+syn match tidyOption "^wrap-sections" contained
+syn match tidyOption "^write-back" contained
+syn match tidyNewTagOption "^new-blocklevel-tags" contained
+syn match tidyNewTagOption "^new-empty-tags" contained
+syn match tidyNewTagOption "^new-inline-tags" contained
+syn match tidyNewTagOption "^new-pre-tags" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tidy_syn_inits")
+ if version < 508
+ let did_tidy_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tidyBoolean Boolean
+ HiLink tidyComment Comment
+ HiLink tidyDelimiter Special
+ HiLink tidyDoctype Constant
+ HiLink tidyEncoding Constant
+ HiLink tidyNewTagDelimiter Special
+ HiLink tidyNewTagOption Identifier
+ HiLink tidyNewTagValue Constant
+ HiLink tidyNumber Number
+ HiLink tidyOption Identifier
+ HiLink tidyRepeat Constant
+ HiLink tidyString String
+ HiLink tidyTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tidy"
+
+" vim: ts=8
diff --git a/runtime/syntax/tilde.vim b/runtime/syntax/tilde.vim
new file mode 100644
index 000000000..568805013
--- /dev/null
+++ b/runtime/syntax/tilde.vim
@@ -0,0 +1,41 @@
+" Vim syntax file
+" This file works only for Vim6.x
+" Language: Tilde
+" Maintainer: Tobias Rundström <tobi@tildesoftware.net>
+" URL: http://www.tildesoftware.net
+" CVS: $Id$
+
+if exists("b:current_syntax")
+ finish
+endif
+
+"tilde dosent care ...
+syn case ignore
+
+syn match tildeFunction "\~[a-z_0-9]\+"ms=s+1
+syn region tildeParen start="(" end=")" contains=tildeString,tildeNumber,tildeVariable,tildeField,tildeSymtab,tildeFunction,tildeParen,tildeHexNumber,tildeOperator
+syn region tildeString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ keepend
+syn region tildeString contained start=+'+ skip=+\\\\\|\\"+ end=+'+ keepend
+syn match tildeNumber "\d" contained
+syn match tildeOperator "or\|and" contained
+syn match tildeHexNumber "0x[a-z0-9]\+" contained
+syn match tildeVariable "$[a-z_0-9]\+" contained
+syn match tildeField "%[a-z_0-9]\+" contained
+syn match tildeSymtab "@[a-z_0-9]\+" contained
+syn match tildeComment "^#.*"
+syn region tildeCurly start=+{+ end=+}+ contained contains=tildeLG,tildeString,tildeNumber,tildeVariable,tildeField,tildeFunction,tildeSymtab,tildeHexNumber
+syn match tildeLG "=>" contained
+
+
+hi def link tildeComment Comment
+hi def link tildeFunction Operator
+hi def link tildeOperator Operator
+hi def link tildeString String
+hi def link tildeNumber Number
+hi def link tildeHexNumber Number
+hi def link tildeVariable Identifier
+hi def link tildeField Identifier
+hi def link tildeSymtab Identifier
+hi def link tildeError Error
+
+let b:current_syntax = "tilde"
diff --git a/runtime/syntax/tli.vim b/runtime/syntax/tli.vim
new file mode 100644
index 000000000..5685a6cbf
--- /dev/null
+++ b/runtime/syntax/tli.vim
@@ -0,0 +1,71 @@
+" Vim syntax file
+" Language: TealInfo source files (*.tli)
+" Maintainer: Kurt W. Andrews <kandrews@fastrans.net>
+" Last Change: 2001 May 10
+" Version: 1.0
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" TealInfo Objects
+
+syn keyword tliObject LIST POPLIST WINDOW POPWINDOW OUTLINE CHECKMARK GOTO
+syn keyword tliObject LABEL IMAGE RECT TRES PASSWORD POPEDIT POPIMAGE CHECKLIST
+
+" TealInfo Fields
+
+syn keyword tliField X Y W H BX BY BW BH SX SY FONT BFONT CYCLE DELAY TABS
+syn keyword tliField STYLE BTEXT RECORD DATABASE KEY TARGET DEFAULT TEXT
+syn keyword tliField LINKS MAXVAL
+
+" TealInfo Styles
+
+syn keyword tliStyle INVERTED HORIZ_RULE VERT_RULE NO_SCROLL NO_BORDER BOLD_BORDER
+syn keyword tliStyle ROUND_BORDER ALIGN_RIGHT ALIGN_CENTER ALIGN_LEFT_START ALIGN_RIGHT_START
+syn keyword tliStyle ALIGN_CENTER_START ALIGN_LEFT_END ALIGN_RIGHT_END ALIGN_CENTER_END
+syn keyword tliStyle LOCKOUT BUTTON_SCROLL BUTTON_SELECT STROKE_FIND FILLED REGISTER
+
+" String and Character constants
+
+syn match tliSpecial "@"
+syn region tliString start=+"+ end=+"+
+
+"TealInfo Numbers, identifiers and comments
+
+syn case ignore
+syn match tliNumber "\d*"
+syn match tliIdentifier "\<\h\w*\>"
+syn match tliComment "#.*"
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tli_syntax_inits")
+ if version < 508
+ let did_tli_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tliNumber Number
+ HiLink tliString String
+ HiLink tliComment Comment
+ HiLink tliSpecial SpecialChar
+ HiLink tliIdentifier Identifier
+ HiLink tliObject Statement
+ HiLink tliField Type
+ HiLink tliStyle PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tli"
+
+" vim: ts=8
diff --git a/runtime/syntax/trasys.vim b/runtime/syntax/trasys.vim
new file mode 100644
index 000000000..cfecc1c1f
--- /dev/null
+++ b/runtime/syntax/trasys.vim
@@ -0,0 +1,177 @@
+" Vim syntax file
+" Language: TRASYS input file
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.inp
+" URL: http://www.naglenet.org/vim/syntax/trasys.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" Force free-form fortran format
+let fortran_free_source=1
+
+" Load FORTRAN syntax file
+if version < 600
+ source <sfile>:p:h/fortran.vim
+else
+ runtime! syntax/fortran.vim
+endif
+unlet b:current_syntax
+
+
+" Ignore case
+syn case ignore
+
+
+
+" Define keywords for TRASYS
+syn keyword trasysOptions model rsrec info maxfl nogo dmpdoc
+syn keyword trasysOptions rsi rti rso rto bcdou cmerg emerg
+syn keyword trasysOptions user1 nnmin erplot
+
+syn keyword trasysSurface icsn tx ty tz rotx roty rotz inc bcsn
+syn keyword trasysSurface nnx nny nnz nnax nnr nnth unnx
+syn keyword trasysSurface unny unnz unnax unnr unnth type idupsf
+syn keyword trasysSurface imagsf act active com shade bshade axmin
+syn keyword trasysSurface axmax zmin zmax rmin rmax thmin thmin
+syn keyword trasysSurface thmax alpha emiss trani trans spri sprs
+syn keyword trasysSurface refno posit com dupbcs dimensions
+syn keyword trasysSurface dimension position prop surfn
+
+syn keyword trasysSurfaceType rect trap disk cyl cone sphere parab
+syn keyword trasysSurfaceType box5 box6 shpero tor ogiv elem tape poly
+
+syn keyword trasysSurfaceArgs ff di top bottom in out both no only
+
+syn keyword trasysArgs fig smn nodea zero only ir sol
+syn keyword trasysArgs both wband stepn initl
+
+syn keyword trasysOperations orbgen build
+
+"syn keyword trasysSubRoutine call
+syn keyword trasysSubRoutine chgblk ndata ndatas odata odatas
+syn keyword trasysSubRoutine pldta ffdata cmdata adsurf rbdata
+syn keyword trasysSubRoutine rtdata pffshd orbit1 orbit2 orient
+syn keyword trasysSubRoutine didt1 didt1s didt2 didt2s spin
+syn keyword trasysSubRoutine spinav dicomp distab drdata gbdata
+syn keyword trasysSubRoutine gbaprx rkdata rcdata aqdata stfaq
+syn keyword trasysSubRoutine qodata qoinit modar modpr modtr
+syn keyword trasysSubRoutine modprs modshd moddat rstoff rston
+syn keyword trasysSubRoutine rsmerg ffread diread ffusr1 diusr1
+syn keyword trasysSubRoutine surfp didt3 didt3s romain stfrc
+syn keyword trasysSubRoutine rornt rocstr romove flxdata title
+
+syn keyword trassyPrcsrSegm nplot oplot plot cmcal ffcal rbcal
+syn keyword trassyPrcsrSegm rtcal dical drcal sfcal gbcal rccal
+syn keyword trassyPrcsrSegm rkcal aqcal qocal
+
+
+
+" Define matches for TRASYS
+syn match trasysOptions "list source"
+syn match trasysOptions "save source"
+syn match trasysOptions "no print"
+
+"syn match trasysSurface "^K *.* [^$]"
+"syn match trasysSurface "^D *[0-9]*\.[0-9]\+"
+"syn match trasysSurface "^I *.*[0-9]\+\.\="
+"syn match trasysSurface "^N *[0-9]\+"
+"syn match trasysSurface "^M *[a-z[A-Z0-9]\+"
+"syn match trasysSurface "^B[C][S] *[a-zA-Z0-9]*"
+"syn match trasysSurface "^S *SURFN.*[0-9]"
+syn match trasysSurface "P[0-9]* *="he=e-1
+
+syn match trasysIdentifier "^L "he=e-1
+syn match trasysIdentifier "^K "he=e-1
+syn match trasysIdentifier "^D "he=e-1
+syn match trasysIdentifier "^I "he=e-1
+syn match trasysIdentifier "^N "he=e-1
+syn match trasysIdentifier "^M "he=e-1
+syn match trasysIdentifier "^B[C][S]"
+syn match trasysIdentifier "^S "he=e-1
+
+syn match trasysComment "^C.*$"
+syn match trasysComment "^R.*$"
+syn match trasysComment "\$.*$"
+
+syn match trasysHeader "^header[^,]*"
+
+syn match trasysMacro "^FAC"
+
+syn match trasysInteger "-\=\<[0-9]*\>"
+syn match trasysFloat "-\=\<[0-9]*\.[0-9]*"
+syn match trasysScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+syn match trasysBlank "' \+'"hs=s+1,he=e-1
+
+syn match trasysEndData "^END OF DATA"
+
+if exists("thermal_todo")
+ execute 'syn match trasysTodo ' . '"^'.thermal_todo.'.*$"'
+else
+ syn match trasysTodo "^?.*$"
+endif
+
+
+
+" Define regions for TRASYS
+syn region trasysComment matchgroup=trasysHeader start="^HEADER DOCUMENTATION DATA" end="^HEADER[^,]*"
+
+
+
+" Define synchronizing patterns for TRASYS
+syn sync maxlines=500
+syn sync match trasysSync grouphere trasysComment "^HEADER DOCUMENTATION DATA"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_trasys_syntax_inits")
+ if version < 508
+ let did_trasys_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink trasysOptions Special
+ HiLink trasysSurface Special
+ HiLink trasysSurfaceType Constant
+ HiLink trasysSurfaceArgs Constant
+ HiLink trasysArgs Constant
+ HiLink trasysOperations Statement
+ HiLink trasysSubRoutine Statement
+ HiLink trassyPrcsrSegm PreProc
+ HiLink trasysIdentifier Identifier
+ HiLink trasysComment Comment
+ HiLink trasysHeader Typedef
+ HiLink trasysMacro Macro
+ HiLink trasysInteger Number
+ HiLink trasysFloat Float
+ HiLink trasysScientific Float
+
+ HiLink trasysBlank SpecialChar
+
+ HiLink trasysEndData Macro
+
+ HiLink trasysTodo Todo
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "trasys"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/tsalt.vim b/runtime/syntax/tsalt.vim
new file mode 100644
index 000000000..56f17558b
--- /dev/null
+++ b/runtime/syntax/tsalt.vim
@@ -0,0 +1,214 @@
+" Vim syntax file
+" Language: Telix (Modem Comm Program) SALT Script
+" Maintainer: Sean M. McKee <mckee@misslink.net>
+" Last Change: 2001 May 09
+" Version Info: @(#)tsalt.vim 1.5 97/12/16 08:11:15
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" turn case matching off
+syn case ignore
+
+"FUNCTIONS
+" Character Handling Functions
+syn keyword tsaltFunction IsAscii IsAlNum IsAlpha IsCntrl IsDigit
+syn keyword tsaltFunction IsLower IsUpper ToLower ToUpper
+
+" Connect Device Operations
+syn keyword tsaltFunction Carrier cInp_Cnt cGetC cGetCT cPutC cPutN
+syn keyword tsaltFunction cPutS cPutS_TR FlushBuf Get_Baud
+syn keyword tsaltFunction Get_DataB Get_Port Get_StopB Hangup
+syn keyword tsaltFunction KillConnectDevice MakeConnectDevice
+syn keyword tsaltFunction Send_Brk Set_ConnectDevice Set_Port
+
+" File Input/Output Operations
+syn keyword tsaltFunction fClearErr fClose fDelete fError fEOF fFlush
+syn keyword tsaltFunction fGetC fGetS FileAttr FileFind FileSize
+syn keyword tsaltFunction FileTime fnStrip fOpen fPutC fPutS fRead
+syn keyword tsaltFunction fRename fSeek fTell fWrite
+
+" File Transfers and Logs
+syn keyword tsaltFunction Capture Capture_Stat Printer Receive Send
+syn keyword tsaltFunction Set_DefProt UsageLog Usage_Stat UStamp
+
+" Input String Matching
+syn keyword tsaltFunction Track Track_AddChr Track_Free Track_Hit
+syn keyword tsaltFunction WaitFor
+
+" Keyboard Operations
+syn keyword tsaltFunction InKey InKeyW KeyGet KeyLoad KeySave KeySet
+
+" Miscellaneous Functions
+syn keyword tsaltFunction ChatMode Dos Dial DosFunction ExitTelix
+syn keyword tsaltFunction GetEnv GetFon HelpScreen LoadFon NewDir
+syn keyword tsaltFunction Randon Redial RedirectDOS Run
+syn keyword tsaltFunction Set_Terminal Show_Directory TelixVersion
+syn keyword tsaltFunction Terminal TransTab Update_Term
+
+" Script Management
+syn keyword tsaltFunction ArgCount Call CallD CompileScript GetRunPath
+syn keyword tsaltFunction Is_Loaded Load_Scr ScriptVersion
+syn keyword tsaltFunction TelixForWindows Unload_Scr
+
+" Sound Functions
+syn keyword tsaltFunction Alarm PlayWave Tone
+
+" String Handling
+syn keyword tsaltFunction CopyChrs CopyStr DelChrs GetS GetSXY
+syn keyword tsaltFunction InputBox InsChrs ItoS SetChr StoI StrCat
+syn keyword tsaltFunction StrChr StrCompI StrLen StrLower StrMaxLen
+syn keyword tsaltFunction StrPos StrPosI StrUpper SubChr SubChrs
+syn keyword tsaltFunction SubStr
+
+" Time, Date, and Timer Operations
+syn keyword tsaltFunction CurTime Date Delay Delay_Scr Get_OnlineTime
+syn keyword tsaltFunction tDay tHour tMin tMonth tSec tYear Time
+syn keyword tsaltFunction Time_Up Timer_Free Time_Restart
+syn keyword tsaltFunction Time_Start Time_Total
+
+" Video Operations
+syn keyword tsaltFunction Box CNewLine Cursor_OnOff Clear_Scr
+syn keyword tsaltFunction GetTermHeight GetTermWidth GetX GetY
+syn keyword tsaltFunction GotoXY MsgBox NewLine PrintC PrintC_Trm
+syn keyword tsaltFunction PrintN PrintN_Trm PrintS PrintS_Trm
+syn keyword tsaltFunction PrintSC PRintSC_Trm
+syn keyword tsaltFunction PStrA PStrAXY Scroll Status_Wind vGetChr
+syn keyword tsaltFunction vGetChrs vGetChrsA vPutChr vPutChrs
+syn keyword tsaltFunction vPutChrsA vRstrArea vSaveArea
+
+" Dynamic Data Exchange (DDE) Operations
+syn keyword tsaltFunction DDEExecute DDEInitate DDEPoke DDERequest
+syn keyword tsaltFunction DDETerminate DDETerminateAll
+"END FUNCTIONS
+
+"PREDEFINED VARAIABLES
+syn keyword tsaltSysVar _add_lf _alarm_on _answerback_str _asc_rcrtrans
+syn keyword tsaltSysVar _asc_remabort _asc_rlftrans _asc_scpacing
+syn keyword tsaltSysVar _asc_scrtrans _asc_secho _asc_slpacing
+syn keyword tsaltSysVar _asc_spacechr _asc_striph _back_color
+syn keyword tsaltSysVar _capture_fname _connect_str _dest_bs
+syn keyword tsaltSysVar _dial_pause _dial_time _dial_post
+syn keyword tsaltSysVar _dial_pref1 _dial_pref2 _dial_pref3
+syn keyword tsaltSysVar _dial_pref4 _dir_prog _down_dir
+syn keyword tsaltSysVar _entry_bbstype _entry_comment _entry_enum
+syn keyword tsaltSysVar _entry_name _entry_num _entry_logonname
+syn keyword tsaltSysVar _entry_pass _fore_color _image_file
+syn keyword tsaltSysVar _local_echo _mdm_hang_str _mdm_init_str
+syn keyword tsaltSysVar _no_connect1 _no_connect2 _no_connect3
+syn keyword tsaltSysVar _no_connect4 _no_connect5 _redial_stop
+syn keyword tsaltSysVar _scr_chk_key _script_dir _sound_on
+syn keyword tsaltSysVar _strip_high _swap_bs _telix_dir _up_dir
+syn keyword tsaltSysVar _usage_fname _zmodauto _zmod_rcrash
+syn keyword tsaltSysVar _zmod_scrash
+"END PREDEFINED VARAIABLES
+
+"TYPE
+syn keyword tsaltType str int
+"END TYPE
+
+"KEYWORDS
+syn keyword tsaltStatement goto break return continue
+syn keyword tsaltConditional if then else
+syn keyword tsaltRepeat while for do
+"END KEYWORDS
+
+syn keyword tsaltTodo contained TODO
+
+" the rest is pretty close to C -----------------------------------------
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match tsaltSpecial contained "\^\d\d\d\|\^."
+syn region tsaltString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=tsaltSpecial
+syn match tsaltCharacter "'[^\\]'"
+syn match tsaltSpecialCharacter "'\\.'"
+
+"catch errors caused by wrong parenthesis
+syn region tsaltParen transparent start='(' end=')' contains=ALLBUT,tsaltParenError,tsaltIncluded,tsaltSpecial,tsaltTodo
+syn match tsaltParenError ")"
+syn match tsaltInParen contained "[{}]"
+
+hi link tsaltParenError tsaltError
+hi link tsaltInParen tsaltError
+
+"integer number, or floating point number without a dot and with "f".
+syn match tsaltNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
+"floating point number, with dot, optional exponent
+syn match tsaltFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, starting with a dot, optional exponent
+syn match tsaltFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match tsaltFloat "\<\d\+e[-+]\=\d\+[fl]\=\>"
+"hex number
+syn match tsaltNumber "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
+"syn match cIdentifier "\<[a-z_][a-z0-9_]*\>"
+
+syn region tsaltComment start="/\*" end="\*/" contains=cTodo
+syn match tsaltComment "//.*" contains=cTodo
+syn match tsaltCommentError "\*/"
+
+syn region tsaltPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=tsaltComment,tsaltString,tsaltCharacter,tsaltNumber,tsaltCommentError
+syn region tsaltIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match tsaltIncluded contained "<[^>]*>"
+syn match tsaltInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=tsaltIncluded
+"syn match TelixSalyLineSkip "\\$"
+syn region tsaltDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,tsaltPreCondit,tsaltIncluded,tsaltInclude,tsaltDefine,tsaltInParen
+syn region tsaltPreProc start="^[ \t]*#[ \t]*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,tsaltPreCondit,tsaltIncluded,tsaltInclude,tsaltDefine,tsaltInParen
+
+" Highlight User Labels
+syn region tsaltMulti transparent start='?' end=':' contains=ALLBUT,tsaltIncluded,tsaltSpecial,tsaltTodo
+
+syn sync ccomment tsaltComment
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tsalt_syntax_inits")
+ if version < 508
+ let did_tsalt_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tsaltFunction Statement
+ HiLink tsaltSysVar Type
+ "HiLink tsaltLibFunc UserDefFunc
+ "HiLink tsaltConstants Type
+ "HiLink tsaltFuncArg Type
+ "HiLink tsaltOperator Operator
+ "HiLink tsaltLabel Label
+ "HiLink tsaltUserLabel Label
+ HiLink tsaltConditional Conditional
+ HiLink tsaltRepeat Repeat
+ HiLink tsaltCharacter SpecialChar
+ HiLink tsaltSpecialCharacter SpecialChar
+ HiLink tsaltNumber Number
+ HiLink tsaltFloat Float
+ HiLink tsaltCommentError tsaltError
+ HiLink tsaltInclude Include
+ HiLink tsaltPreProc PreProc
+ HiLink tsaltDefine Macro
+ HiLink tsaltIncluded tsaltString
+ HiLink tsaltError Error
+ HiLink tsaltStatement Statement
+ HiLink tsaltPreCondit PreCondit
+ HiLink tsaltType Type
+ HiLink tsaltString String
+ HiLink tsaltComment Comment
+ HiLink tsaltSpecial Special
+ HiLink tsaltTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tsalt"
+
+" vim: ts=8
diff --git a/runtime/syntax/tsscl.vim b/runtime/syntax/tsscl.vim
new file mode 100644
index 000000000..3fc18c684
--- /dev/null
+++ b/runtime/syntax/tsscl.vim
@@ -0,0 +1,217 @@
+" Vim syntax file
+" Language: TSS (Thermal Synthesizer System) Command Line
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.tsscl
+" URL: http://www.naglenet.org/vim/syntax/tsscl.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for tss geomtery file.
+"
+
+" Load TSS geometry syntax file
+"source $VIM/myvim/tssgm.vim
+"source $VIMRUNTIME/syntax/c.vim
+
+" Define keywords for TSS
+syn keyword tssclCommand begin radk list heatrates attr draw
+
+syn keyword tssclKeyword cells rays error nodes levels objects cpu
+syn keyword tssclKeyword units length positions energy time unit solar
+syn keyword tssclKeyword solar_constant albedo planet_power
+
+syn keyword tssclEnd exit
+
+syn keyword tssclUnits cm feet meters inches
+syn keyword tssclUnits Celsius Kelvin Fahrenheit Rankine
+
+
+
+" Define matches for TSS
+syn match tssclString /"[^"]\+"/ contains=ALLBUT,tssInteger,tssclKeyword,tssclCommand,tssclEnd,tssclUnits
+
+syn match tssclComment "#.*$"
+
+" rational and logical operators
+" < Less than
+" > Greater than
+" <= Less than or equal
+" >= Greater than or equal
+" == or = Equal to
+" != Not equal to
+" && or & Logical AND
+" || or | Logical OR
+" ! Logical NOT
+"
+" algebraic operators:
+" ^ or ** Exponentation
+" * Multiplication
+" / Division
+" % Remainder
+" + Addition
+" - Subtraction
+"
+syn match tssclOper "||\||\|&&\|&\|!=\|!\|>=\|<=\|>\|<\|+\|-\|^\|\*\*\|\*\|/\|%\|==\|=\|\." skipwhite
+
+" CLI Directive Commands, with arguments
+"
+" BASIC COMMAND LIST
+" *ADD input_source
+" *ARITHMETIC { [ON] | OFF }
+" *CLOSE unit_number
+" *CPU
+" *DEFINE
+" *ECHO[/qualifiers] { [ON] | OFF }
+" *ELSE [IF { 0 | 1 } ]
+" *END { IF | WHILE }
+" *EXIT
+" *IF { 0 | 1 }
+" *LIST/n list variable
+" *OPEN[/r | /r+ | /w | /w+ ] unit_number file_name
+" *PROMPT prompt_string sybol_name
+" *READ/unit=unit_number[/LOCAL | /GLOBAL ] sym1 [sym2, [sym3 ...]]
+" *REWIND
+" *STOP
+" *STRCMP string_1 string_2 difference
+" *SYSTEM command
+" *UNDEFINE[/LOCAL][/GLOBAL] symbol_name
+" *WHILE { 0 | 1 }
+" *WRITE[/unit=unit_number] output text
+"
+syn match tssclDirective "\*ADD"
+syn match tssclDirective "\*ARITHMETIC \+\(ON\|OFF\)"
+syn match tssclDirective "\*CLOSE"
+syn match tssclDirective "\*CPU"
+syn match tssclDirective "\*DEFINE"
+syn match tssclDirective "\*ECHO"
+syn match tssclConditional "\*ELSE"
+syn match tssclConditional "\*END \+\(IF\|WHILE\)"
+syn match tssclDirective "\*EXIT"
+syn match tssclConditional "\*IF"
+syn match tssclDirective "\*LIST"
+syn match tssclDirective "\*OPEN"
+syn match tssclDirective "\*PROMPT"
+syn match tssclDirective "\*READ"
+syn match tssclDirective "\*REWIND"
+syn match tssclDirective "\*STOP"
+syn match tssclDirective "\*STRCMP"
+syn match tssclDirective "\*SYSTEM"
+syn match tssclDirective "\*UNDEFINE"
+syn match tssclConditional "\*WHILE"
+syn match tssclDirective "\*WRITE"
+
+syn match tssclContChar "-$"
+
+" C library functoins
+" Bessel functions (jn, yn)
+" Error and complementary error fuctions (erf, erfc)
+" Exponential functions (exp)
+" Logrithm (log, log10)
+" Power (pow)
+" Square root (sqrt)
+" Floor (floor)
+" Ceiling (ceil)
+" Floating point remainder (fmod)
+" Floating point absolute value (fabs)
+" Gamma (gamma)
+" Euclidean distance function (hypot)
+" Hperbolic functions (sinh, cosh, tanh)
+" Trigometric functions in radians (sin, cos, tan, asin, acos, atan, atan2)
+" Trigometric functions in degrees (sind, cosd, tand, asind, acosd, atand,
+" atan2d)
+"
+" local varialbles: cl_arg1, cl_arg2, etc. (cl_arg is an array of arguments)
+" cl_args is the number of arguments
+"
+"
+" I/O: *PROMPT, *WRITE, *READ
+"
+" Conditional branching:
+" IF, ELSE IF, END
+" *IF value *IF I==10
+" *ELSE IF value *ELSE IF I<10
+" *ELSE *ELSE
+" *ENDIF *ENDIF
+"
+"
+" Iterative looping:
+" WHILE
+" *WHILE test
+" .....
+" *END WHILE
+"
+"
+" EXAMPLE:
+" *DEFINE I = 1
+" *WHILE (I <= 10)
+" *WRITE I = 'I'
+" *DEFINE I = (I + 1)
+" *END WHILE
+"
+
+syn match tssclQualifier "/[^/ ]\+"hs=s+1
+syn match tssclSymbol "'\S\+'"
+"syn match tssclSymbol2 " \S\+ " contained
+
+syn match tssclInteger "-\=\<[0-9]*\>"
+syn match tssclFloat "-\=\<[0-9]*\.[0-9]*"
+syn match tssclScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tsscl_syntax_inits")
+ if version < 508
+ let did_tsscl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tssclCommand Statement
+ HiLink tssclKeyword Special
+ HiLink tssclEnd Macro
+ HiLink tssclUnits Special
+
+ HiLink tssclComment Comment
+ HiLink tssclDirective Statement
+ HiLink tssclConditional Conditional
+ HiLink tssclContChar Macro
+ HiLink tssclQualifier Typedef
+ HiLink tssclSymbol Identifier
+ HiLink tssclSymbol2 Symbol
+ HiLink tssclString String
+ HiLink tssclOper Operator
+
+ HiLink tssclInteger Number
+ HiLink tssclFloat Number
+ HiLink tssclScientific Number
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "tsscl"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/tssgm.vim b/runtime/syntax/tssgm.vim
new file mode 100644
index 000000000..b8182d48e
--- /dev/null
+++ b/runtime/syntax/tssgm.vim
@@ -0,0 +1,111 @@
+" Vim syntax file
+" Language: TSS (Thermal Synthesizer System) Geometry
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.tssgm
+" URL: http://www.naglenet.org/vim/syntax/tssgm.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for tss geomtery file.
+"
+
+" Define keywords for TSS
+syn keyword tssgmParam units mirror param active sides submodel include
+syn keyword tssgmParam iconductor nbeta ngamma optics material thickness color
+syn keyword tssgmParam initial_temp
+syn keyword tssgmParam initial_id node_ids node_add node_type
+syn keyword tssgmParam gamma_boundaries gamma_add beta_boundaries
+syn keyword tssgmParam p1 p2 p3 p4 p5 p6 rot1 rot2 rot3 tx ty tz
+
+syn keyword tssgmSurfType rectangle trapezoid disc ellipse triangle
+syn keyword tssgmSurfType polygon cylinder cone sphere ellipic-cone
+syn keyword tssgmSurfType ogive torus box paraboloid hyperboloid ellipsoid
+syn keyword tssgmSurfType quadrilateral trapeziod
+
+syn keyword tssgmArgs OUT IN DOWN BOTH DOUBLE NONE SINGLE RADK CC FECC
+syn keyword tssgmArgs white red blue green yellow orange violet pink
+syn keyword tssgmArgs turquoise grey black
+syn keyword tssgmArgs Arithmetic Boundary Heater
+
+syn keyword tssgmDelim assembly
+
+syn keyword tssgmEnd end
+
+syn keyword tssgmUnits cm feet meters inches
+syn keyword tssgmUnits Celsius Kelvin Fahrenheit Rankine
+
+
+
+" Define matches for TSS
+syn match tssgmDefault "^DEFAULT/LENGTH = \(ft\|in\|cm\|m\)"
+syn match tssgmDefault "^DEFAULT/TEMP = [CKFR]"
+
+syn match tssgmComment /comment \+= \+".*"/ contains=tssParam,tssgmCommentString
+syn match tssgmCommentString /".*"/ contained
+
+syn match tssgmSurfIdent " \S\+\.\d\+ \=$"
+
+syn match tssgmString /"[^" ]\+"/ms=s+1,me=e-1 contains=ALLBUT,tssInteger
+
+syn match tssgmArgs / = [xyz],"/ms=s+3,me=e-2
+
+syn match tssgmInteger "-\=\<[0-9]*\>"
+syn match tssgmFloat "-\=\<[0-9]*\.[0-9]*"
+syn match tssgmScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tssgm_syntax_inits")
+ if version < 508
+ let did_tssgm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tssgmParam Statement
+ HiLink tssgmSurfType Type
+ HiLink tssgmArgs Special
+ HiLink tssgmDelim Typedef
+ HiLink tssgmEnd Macro
+ HiLink tssgmUnits Special
+
+ HiLink tssgmDefault SpecialComment
+ HiLink tssgmComment Statement
+ HiLink tssgmCommentString Comment
+ HiLink tssgmSurfIdent Identifier
+ HiLink tssgmString Delimiter
+
+ HiLink tssgmInteger Number
+ HiLink tssgmFloat Float
+ HiLink tssgmScientific Float
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "tssgm"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/tssop.vim b/runtime/syntax/tssop.vim
new file mode 100644
index 000000000..d416df054
--- /dev/null
+++ b/runtime/syntax/tssop.vim
@@ -0,0 +1,87 @@
+" Vim syntax file
+" Language: TSS (Thermal Synthesizer System) Optics
+" Maintainer: Adrian Nagle, anagle@ball.com
+" Last Change: 2003 May 11
+" Filenames: *.tssop
+" URL: http://www.naglenet.org/vim/syntax/tssop.vim
+" MAIN URL: http://www.naglenet.org/vim/
+
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+
+" Ignore case
+syn case ignore
+
+
+
+"
+"
+" Begin syntax definitions for tss optics file.
+"
+
+" Define keywords for TSS
+syn keyword tssopParam ir_eps ir_trans ir_spec ir_tspec ir_refract
+syn keyword tssopParam sol_eps sol_trans sol_spec sol_tspec sol_refract
+syn keyword tssopParam color
+
+"syn keyword tssopProp property
+
+syn keyword tssopArgs white red blue green yellow orange violet pink
+syn keyword tssopArgs turquoise grey black
+
+
+
+" Define matches for TSS
+syn match tssopComment /comment \+= \+".*"/ contains=tssopParam,tssopCommentString
+syn match tssopCommentString /".*"/ contained
+
+syn match tssopProp "property "
+syn match tssopProp "edit/optic "
+syn match tssopPropName "^property \S\+" contains=tssopProp
+syn match tssopPropName "^edit/optic \S\+$" contains=tssopProp
+
+syn match tssopInteger "-\=\<[0-9]*\>"
+syn match tssopFloat "-\=\<[0-9]*\.[0-9]*"
+syn match tssopScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"
+
+
+
+" Define the default highlighting
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_tssop_syntax_inits")
+ if version < 508
+ let did_tssop_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tssopParam Statement
+ HiLink tssopProp Identifier
+ HiLink tssopArgs Special
+
+ HiLink tssopComment Statement
+ HiLink tssopCommentString Comment
+ HiLink tssopPropName Typedef
+
+ HiLink tssopInteger Number
+ HiLink tssopFloat Float
+ HiLink tssopScientific Float
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "tssop"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/uc.vim b/runtime/syntax/uc.vim
new file mode 100644
index 000000000..7eab1d48a
--- /dev/null
+++ b/runtime/syntax/uc.vim
@@ -0,0 +1,178 @@
+" Vim syntax file
+" Language: UnrealScript
+" Maintainer: Mark Ferrell <major@chaoticdreams.org>
+" URL: ftp://ftp.chaoticdreams.org/pub/ut/vim/uc.vim
+" Credits: Based on the java.vim syntax file by Claudio Fleiner
+" Last change: 2003 May 31
+
+" Please check :help uc.vim for comments on some of the options available.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" some characters that cannot be in a UnrealScript program (outside a string)
+syn match ucError "[\\@`]"
+syn match ucError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
+
+" we define it here so that included files can test for it
+if !exists("main_syntax")
+ let main_syntax='uc'
+endif
+
+syntax case ignore
+
+" keyword definitions
+syn keyword ucBranch break continue
+syn keyword ucConditional if else switch
+syn keyword ucRepeat while for do foreach
+syn keyword ucBoolean true false
+syn keyword ucConstant null
+syn keyword ucOperator new instanceof
+syn keyword ucType boolean char byte short int long float double
+syn keyword ucType void Pawn sound state auto exec function ipaddr
+syn keyword ucType ELightType actor ammo defaultproperties bool
+syn keyword ucType native noexport var out vector name local string
+syn keyword ucType event
+syn keyword ucStatement return
+syn keyword ucStorageClass static synchronized transient volatile final
+syn keyword ucMethodDecl synchronized throws
+
+" UnrealScript defines classes in sorta fscked up fashion
+syn match ucClassDecl "^[Cc]lass[\s$]*\S*[\s$]*expands[\s$]*\S*;" contains=ucSpecial,ucSpecialChar,ucClassKeys
+syn keyword ucClassKeys class expands extends
+syn match ucExternal "^\#exec.*" contains=ucCommentString,ucNumber
+syn keyword ucScopeDecl public protected private abstract
+
+" UnrealScript Functions
+syn match ucFuncDef "^.*function\s*[\(]*" contains=ucType,ucStorageClass
+syn match ucEventDef "^.*event\s*[\(]*" contains=ucType,ucStorageClass
+syn match ucClassLabel "[a-zA-Z0-9]*\'[a-zA-Z0-9]*\'" contains=ucCharacter
+
+syn region ucLabelRegion transparent matchgroup=ucLabel start="\<case\>" matchgroup=NONE end=":" contains=ucNumber
+syn match ucUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=ucLabel
+syn keyword ucLabel default
+
+" The following cluster contains all java groups except the contained ones
+syn cluster ucTop contains=ucExternal,ucError,ucError,ucBranch,ucLabelRegion,ucLabel,ucConditional,ucRepeat,ucBoolean,ucConstant,ucTypedef,ucOperator,ucType,ucType,ucStatement,ucStorageClass,ucMethodDecl,ucClassDecl,ucClassDecl,ucClassDecl,ucScopeDecl,ucError,ucError2,ucUserLabel,ucClassLabel
+
+" Comments
+syn keyword ucTodo contained TODO FIXME XXX
+syn region ucCommentString contained start=+"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=ucSpecial,ucCommentStar,ucSpecialChar
+syn region ucComment2String contained start=+"+ end=+$\|"+ contains=ucSpecial,ucSpecialChar
+syn match ucCommentCharacter contained "'\\[^']\{1,6\}'" contains=ucSpecialChar
+syn match ucCommentCharacter contained "'\\''" contains=ucSpecialChar
+syn match ucCommentCharacter contained "'[^\\]'"
+syn region ucComment start="/\*" end="\*/" contains=ucCommentString,ucCommentCharacter,ucNumber,ucTodo
+syn match ucCommentStar contained "^\s*\*[^/]"me=e-1
+syn match ucCommentStar contained "^\s*\*$"
+syn match ucLineComment "//.*" contains=ucComment2String,ucCommentCharacter,ucNumber,ucTodo
+hi link ucCommentString ucString
+hi link ucComment2String ucString
+hi link ucCommentCharacter ucCharacter
+
+syn cluster ucTop add=ucComment,ucLineComment
+
+" match the special comment /**/
+syn match ucComment "/\*\*/"
+
+" Strings and constants
+syn match ucSpecialError contained "\\."
+"syn match ucSpecialCharError contained "[^']"
+syn match ucSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
+syn region ucString start=+"+ end=+"+ contains=ucSpecialChar,ucSpecialError
+syn match ucStringError +"\([^"\\]\|\\.\)*$+
+syn match ucCharacter "'[^']*'" contains=ucSpecialChar,ucSpecialCharError
+syn match ucCharacter "'\\''" contains=ucSpecialChar
+syn match ucCharacter "'[^\\]'"
+syn match ucNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
+syn match ucNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
+syn match ucNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
+syn match ucNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
+
+" unicode characters
+syn match ucSpecial "\\u\d\{4\}"
+
+syn cluster ucTop add=ucString,ucCharacter,ucNumber,ucSpecial,ucStringError
+
+" catch errors caused by wrong parenthesis
+syn region ucParen transparent start="(" end=")" contains=@ucTop,ucParen
+syn match ucParenError ")"
+hi link ucParenError ucError
+
+if !exists("uc_minlines")
+ let uc_minlines = 10
+endif
+exec "syn sync ccomment ucComment minlines=" . uc_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_uc_syntax_inits")
+ if version < 508
+ let did_uc_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink ucFuncDef Conditional
+ HiLink ucEventDef Conditional
+ HiLink ucBraces Function
+ HiLink ucBranch Conditional
+ HiLink ucLabel Label
+ HiLink ucUserLabel Label
+ HiLink ucConditional Conditional
+ HiLink ucRepeat Repeat
+ HiLink ucStorageClass StorageClass
+ HiLink ucMethodDecl ucStorageClass
+ HiLink ucClassDecl ucStorageClass
+ HiLink ucScopeDecl ucStorageClass
+ HiLink ucBoolean Boolean
+ HiLink ucSpecial Special
+ HiLink ucSpecialError Error
+ HiLink ucSpecialCharError Error
+ HiLink ucString String
+ HiLink ucCharacter Character
+ HiLink ucSpecialChar SpecialChar
+ HiLink ucNumber Number
+ HiLink ucError Error
+ HiLink ucStringError Error
+ HiLink ucStatement Statement
+ HiLink ucOperator Operator
+ HiLink ucOverLoaded Operator
+ HiLink ucComment Comment
+ HiLink ucDocComment Comment
+ HiLink ucLineComment Comment
+ HiLink ucConstant ucBoolean
+ HiLink ucTypedef Typedef
+ HiLink ucTodo Todo
+
+ HiLink ucCommentTitle SpecialComment
+ HiLink ucDocTags Special
+ HiLink ucDocParam Function
+ HiLink ucCommentStar ucComment
+
+ HiLink ucType Type
+ HiLink ucExternal Include
+
+ HiLink ucClassKeys Conditional
+ HiLink ucClassLabel Conditional
+
+ HiLink htmlComment Special
+ HiLink htmlCommentPart Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "uc"
+
+if main_syntax == 'uc'
+ unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/runtime/syntax/uil.vim b/runtime/syntax/uil.vim
new file mode 100644
index 000000000..bdc4e95b6
--- /dev/null
+++ b/runtime/syntax/uil.vim
@@ -0,0 +1,85 @@
+" Vim syntax file
+" Language: Motif UIL (User Interface Language)
+" Maintainer: Thomas Koehler <jean-luc@picard.franken.de>
+" Last Change: 2002 Sep 20
+" URL: http://jeanluc-picard.de/vim/syntax/uil.vim
+
+" Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" A bunch of useful keywords
+syn keyword uilType arguments callbacks color
+syn keyword uilType compound_string controls end
+syn keyword uilType exported file include
+syn keyword uilType module object procedure
+syn keyword uilType user_defined xbitmapfile
+
+syn keyword uilTodo contained TODO
+
+" String and Character contstants
+" Highlight special characters (those which have a backslash) differently
+syn match uilSpecial contained "\\\d\d\d\|\\."
+syn region uilString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=uilSpecial
+syn match uilCharacter "'[^\\]'"
+syn region uilString start=+'+ skip=+\\\\\|\\"+ end=+'+ contains=uilSpecial
+syn match uilSpecialCharacter "'\\.'"
+syn match uilSpecialStatement "Xm[^ =(){}]*"
+syn match uilSpecialFunction "MrmNcreateCallback"
+syn match uilRessource "XmN[^ =(){}]*"
+
+syn match uilNumber "-\=\<\d*\.\=\d\+\(e\=f\=\|[uU]\=[lL]\=\)\>"
+syn match uilNumber "0[xX][0-9a-fA-F]\+\>"
+
+syn region uilComment start="/\*" end="\*/" contains=uilTodo
+syn match uilComment "!.*" contains=uilTodo
+syn match uilCommentError "\*/"
+
+syn region uilPreCondit start="^#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=uilComment,uilString,uilCharacter,uilNumber,uilCommentError
+syn match uilIncluded contained "<[^>]*>"
+syn match uilInclude "^#\s*include\s\+." contains=uilString,uilIncluded
+syn match uilLineSkip "\\$"
+syn region uilDefine start="^#\s*\(define\>\|undef\>\)" end="$" contains=uilLineSkip,uilComment,uilString,uilCharacter,uilNumber,uilCommentError
+
+syn sync ccomment uilComment
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_uil_syn_inits")
+ if version < 508
+ let did_uil_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink uilCharacter uilString
+ HiLink uilSpecialCharacter uilSpecial
+ HiLink uilNumber uilString
+ HiLink uilCommentError uilError
+ HiLink uilInclude uilPreCondit
+ HiLink uilDefine uilPreCondit
+ HiLink uilIncluded uilString
+ HiLink uilSpecialFunction uilRessource
+ HiLink uilRessource Identifier
+ HiLink uilSpecialStatement Keyword
+ HiLink uilError Error
+ HiLink uilPreCondit PreCondit
+ HiLink uilType Type
+ HiLink uilString String
+ HiLink uilComment Comment
+ HiLink uilSpecial Special
+ HiLink uilTodo Todo
+
+ delcommand HiLink
+endif
+
+
+let b:current_syntax = "uil"
+
+" vim: ts=8
diff --git a/runtime/syntax/valgrind.vim b/runtime/syntax/valgrind.vim
new file mode 100644
index 000000000..f23b7924b
--- /dev/null
+++ b/runtime/syntax/valgrind.vim
@@ -0,0 +1,99 @@
+" Vim syntax file
+" Language: Valgrind Memory Debugger Output
+" Maintainer: Roger Luethi <rl@hellgate.ch>
+" Program URL: http://devel-home.kde.org/~sewardj/
+" Last Change: 2002 Apr 07
+"
+" Notes: mostly based on strace.vim and xml.vim
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+syn sync minlines=50
+
+syn match valgrindSpecLine "^[+-]\{2}\d\+[+-]\{2}.*$"
+
+syn region valgrindRegion
+ \ start=+^==\z(\d\+\)== \w.*$+
+ \ skip=+^==\z1==\( \| .*\)$+
+ \ end=+^+
+ \ fold
+ \ keepend
+ \ contains=valgrindPidChunk,valgrindLine
+
+syn region valgrindPidChunk
+ \ start=+\(^==\)\@<=+
+ \ end=+\(==\)\@=+
+ \ contained
+ \ contains=valgrindPid0,valgrindPid1,valgrindPid2,valgrindPid3,valgrindPid4,valgrindPid5,valgrindPid6,valgrindPid7,valgrindPid8,valgrindPid9
+ \ keepend
+
+syn match valgrindPid0 "\d\+0=" contained
+syn match valgrindPid1 "\d\+1=" contained
+syn match valgrindPid2 "\d\+2=" contained
+syn match valgrindPid3 "\d\+3=" contained
+syn match valgrindPid4 "\d\+4=" contained
+syn match valgrindPid5 "\d\+5=" contained
+syn match valgrindPid6 "\d\+6=" contained
+syn match valgrindPid7 "\d\+7=" contained
+syn match valgrindPid8 "\d\+8=" contained
+syn match valgrindPid9 "\d\+9=" contained
+
+syn region valgrindLine
+ \ start=+\(^==\d\+== \)\@<=+
+ \ end=+$+
+ \ keepend
+ \ contained
+ \ contains=valgrindOptions,valgrindMsg,valgrindLoc
+
+syn match valgrindOptions "[ ]\{3}-.*$" contained
+
+syn match valgrindMsg "\S.*$" contained
+ \ contains=valgrindError,valgrindNote,valgrindSummary
+syn match valgrindError "\(Invalid\|\d\+ errors\|.* definitely lost\).*$" contained
+syn match valgrindNote ".*still reachable.*" contained
+syn match valgrindSummary ".*SUMMARY:" contained
+
+syn match valgrindLoc "\s\+\(by\|at\|Address\).*$" contained
+ \ contains=valgrindAt,valgrindAddr,valgrindFunc,valgrindBin,valgrindSrc
+syn match valgrindAt "at\s\@=" contained
+syn match valgrindAddr "\(\W\)\@<=0x\x\+" contained
+syn match valgrindFunc "\(: \)\@<=\w\+" contained
+syn match valgrindBin "\((\(with\|\)in \)\@<=\S\+\()\)\@=" contained
+syn match valgrindSrc "\((\)\@<=.*:\d\+\()\)\@=" contained
+
+" Define the default highlighting
+
+hi def link valgrindSpecLine Type
+"hi def link valgrindRegion Special
+
+hi def link valgrindPid0 Special
+hi def link valgrindPid1 Comment
+hi def link valgrindPid2 Type
+hi def link valgrindPid3 Constant
+hi def link valgrindPid4 Number
+hi def link valgrindPid5 Identifier
+hi def link valgrindPid6 Statement
+hi def link valgrindPid7 Error
+hi def link valgrindPid8 LineNr
+hi def link valgrindPid9 Normal
+"hi def link valgrindLine Special
+
+hi def link valgrindOptions Type
+"hi def link valgrindMsg Special
+"hi def link valgrindLoc Special
+
+hi def link valgrindError Special
+hi def link valgrindNote Comment
+hi def link valgrindSummary Type
+
+hi def link valgrindAt Special
+hi def link valgrindAddr Number
+hi def link valgrindFunc Type
+hi def link valgrindBin Comment
+hi def link valgrindSrc Statement
+
+let b:current_syntax = "valgrind"
diff --git a/runtime/syntax/vb.vim b/runtime/syntax/vb.vim
new file mode 100644
index 000000000..a107e7d9f
--- /dev/null
+++ b/runtime/syntax/vb.vim
@@ -0,0 +1,273 @@
+" Vim syntax file
+" Language: Visual Basic
+" Maintainer: Tim Chase <vb.vim@tim.thechases.com>
+" Former Maintainer: Robert M. Cortopassi <cortopar@mindspring.com>
+" (tried multiple times to contact, but email bounced)
+" Last Change: 2004 May 25
+" 2004 May 30 Added a few keywords
+
+" This was thrown together after seeing numerous requests on the
+" VIM and VIM-DEV mailing lists. It is by no means complete.
+" Send comments, suggestions and requests to the maintainer.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" VB is case insensitive
+syn case ignore
+
+syn keyword vbStatement Alias AppActivate As Base Beep Call Case
+syn keyword vbStatement ChDir ChDrive Const Declare DefBool DefByte
+syn keyword vbStatement DefCur DefDate DefDbl DefDec DefInt
+syn keyword vbStatement DefLng DefObj DefSng DefStr Deftype
+syn keyword vbStatement DefVar DeleteSetting Dim Do Each Else
+syn keyword vbStatement ElseIf End Enum Erase Event Exit Explicit
+syn keyword vbStatement FileCopy For ForEach Function Get GoSub
+syn keyword vbStatement GoTo If Implements Kill Let Lib LineInput
+syn keyword vbStatement Lock Loop LSet MkDir Name Next OnError On
+syn keyword vbStatement Option Preserve Private Property Public Put
+syn keyword vbStatement RaiseEvent Randomize ReDim Reset Resume
+syn keyword vbStatement Return RmDir RSet SavePicture SaveSetting
+syn keyword vbStatement SendKeys Select SetAttr Static Step Sub
+syn keyword vbStatement Then Type Unlock Until Wend While Width
+syn keyword vbStatement With Write
+
+syn keyword vbFunction Abs Array Asc AscB AscW Atn Avg CBool
+syn keyword vbFunction CByte CCur CDate CDbl Cdec Choose Chr
+syn keyword vbFunction ChrB ChrW CInt CLng Command Cos Count
+syn keyword vbFunction CreateObject CSng CStr CurDir CVar
+syn keyword vbFunction CVDate CVErr DateAdd DateDiff DatePart
+syn keyword vbFunction DateSerial DateValue Day DDB Dir
+syn keyword vbFunction DoEvents Environ EOF Error Exp FileAttr
+syn keyword vbFunction FileDateTime FileLen Fix Format FreeFile
+syn keyword vbFunction FV GetAllStrings GetAttr
+syn keyword vbFunction GetAutoServerSettings GetObject
+syn keyword vbFunction GetSetting Hex Hour IIf IMEStatus Input
+syn keyword vbFunction InputB InputBox InStr InstB Int IPmt
+syn keyword vbFunction IsArray IsDate IsEmpty IsError IsMissing
+syn keyword vbFunction IsNull IsNumeric IsObject LBound LCase
+syn keyword vbFunction Left LeftB Len LenB LoadPicture Loc LOF
+syn keyword vbFunction Log LTrim Max Mid MidB Min Minute MIRR
+syn keyword vbFunction Month MsgBox Now NPer NPV Oct Partition
+syn keyword vbFunction Pmt PPmt PV QBColor Rate RGB Right
+syn keyword vbFunction RightB Rnd RTrim Second Seek Sgn Shell
+syn keyword vbFunction Sin SLN Space Spc Sqr StDev StDevP Str
+syn keyword vbFunction StrComp StrConv String Switch Sum SYD
+syn keyword vbFunction Tab Tan Time Timer TimeSerial TimeValue
+syn keyword vbFunction Trim TypeName UBound UCase Val Var VarP
+syn keyword vbFunction VarType Weekday Year
+
+syn keyword vbMethods Accept Activate Add AddCustom AddFile
+syn keyword vbMethods AddFromFile AddFromTemplate AddItem
+syn keyword vbMethods AddNew AddToAddInToolbar
+syn keyword vbMethods AddToolboxProgID Append AppendChunk
+syn keyword vbMethods Arrange Assert AsyncRead BatchUpdate
+syn keyword vbMethods BeginTrans Bind Cancel CancelAsyncRead
+syn keyword vbMethods CancelBatch CancelUpdate
+syn keyword vbMethods CanPropertyChange CaptureImage CellText
+syn keyword vbMethods CellValue Circle Clear ClearFields
+syn keyword vbMethods ClearSel ClearSelCols Clone Close Cls
+syn keyword vbMethods ColContaining ColumnSize CommitTrans
+syn keyword vbMethods CompactDatabase Compose Connect Copy
+syn keyword vbMethods CopyQueryDef CreateDatabase
+syn keyword vbMethods CreateDragImage CreateEmbed CreateField
+syn keyword vbMethods CreateGroup CreateIndex CreateLink
+syn keyword vbMethods CreatePreparedStatement CreatePropery
+syn keyword vbMethods CreateQuery CreateQueryDef
+syn keyword vbMethods CreateRelation CreateTableDef CreateUser
+syn keyword vbMethods CreateWorkspace Customize Delete
+syn keyword vbMethods DeleteColumnLabels DeleteColumns
+syn keyword vbMethods DeleteRowLabels DeleteRows DoVerb Drag
+syn keyword vbMethods Draw Edit EditCopy EditPaste EndDoc
+syn keyword vbMethods EnsureVisible EstablishConnection
+syn keyword vbMethods Execute ExtractIcon Fetch FetchVerbs
+syn keyword vbMethods Files FillCache Find FindFirst FindItem
+syn keyword vbMethods FindLast FindNext FindPrevious Forward
+syn keyword vbMethods GetBookmark GetChunk GetClipString
+syn keyword vbMethods GetData GetFirstVisible GetFormat
+syn keyword vbMethods GetHeader GetLineFromChar GetNumTicks
+syn keyword vbMethods GetRows GetSelectedPart GetText
+syn keyword vbMethods GetVisibleCount GoBack GoForward Hide
+syn keyword vbMethods HitTest HoldFields Idle InitializeLabels
+syn keyword vbMethods InsertColumnLabels InsertColumns
+syn keyword vbMethods InsertObjDlg InsertRowLabels InsertRows
+syn keyword vbMethods Item KillDoc Layout Line LinkExecute
+syn keyword vbMethods LinkPoke LinkRequest LinkSend Listen
+syn keyword vbMethods LoadFile LoadResData LoadResPicture
+syn keyword vbMethods LoadResString LogEvent MakeCompileFile
+syn keyword vbMethods MakeReplica MoreResults Move MoveData
+syn keyword vbMethods MoveFirst MoveLast MoveNext MovePrevious
+syn keyword vbMethods NavigateTo NewPage NewPassword
+syn keyword vbMethods NextRecordset OLEDrag OnAddinsUpdate
+syn keyword vbMethods OnConnection OnDisconnection
+syn keyword vbMethods OnStartupComplete Open OpenConnection
+syn keyword vbMethods OpenDatabase OpenQueryDef OpenRecordset
+syn keyword vbMethods OpenResultset OpenURL Overlay
+syn keyword vbMethods PaintPicture Paste PastSpecialDlg
+syn keyword vbMethods PeekData Play Point PopulatePartial
+syn keyword vbMethods PopupMenu Print PrintForm
+syn keyword vbMethods PropertyChanged PSet Quit Raise
+syn keyword vbMethods RandomDataFill RandomFillColumns
+syn keyword vbMethods RandomFillRows rdoCreateEnvironment
+syn keyword vbMethods rdoRegisterDataSource ReadFromFile
+syn keyword vbMethods ReadProperty Rebind ReFill Refresh
+syn keyword vbMethods RefreshLink RegisterDatabase Reload
+syn keyword vbMethods Remove RemoveAddInFromToolbar RemoveItem
+syn keyword vbMethods Render RepairDatabase Reply ReplyAll
+syn keyword vbMethods Requery ResetCustom ResetCustomLabel
+syn keyword vbMethods ResolveName RestoreToolbar Resync
+syn keyword vbMethods Rollback RollbackTrans RowBookmark
+syn keyword vbMethods RowContaining RowTop Save SaveAs
+syn keyword vbMethods SaveFile SaveToFile SaveToolbar
+syn keyword vbMethods SaveToOle1File Scale ScaleX ScaleY
+syn keyword vbMethods Scroll SelectAll SelectPart SelPrint
+syn keyword vbMethods Send SendData Set SetAutoServerSettings
+syn keyword vbMethods SetData SetFocus SetOption SetSize
+syn keyword vbMethods SetText SetViewport Show ShowColor
+syn keyword vbMethods ShowFont ShowHelp ShowOpen ShowPrinter
+syn keyword vbMethods ShowSave ShowWhatsThis SignOff SignOn
+syn keyword vbMethods Size Span SplitContaining StartLabelEdit
+syn keyword vbMethods StartLogging Stop Synchronize TextHeight
+syn keyword vbMethods TextWidth ToDefaults TwipsToChartPart
+syn keyword vbMethods TypeByChartType Update UpdateControls
+syn keyword vbMethods UpdateRecord UpdateRow Upto
+syn keyword vbMethods WhatsThisMode WriteProperty ZOrder
+
+syn keyword vbEvents AccessKeyPress AfterAddFile
+syn keyword vbEvents AfterChangeFileName AfterCloseFile
+syn keyword vbEvents AfterColEdit AfterColUpdate AfterDelete
+syn keyword vbEvents AfterInsert AfterLabelEdit
+syn keyword vbEvents AfterRemoveFile AfterUpdate
+syn keyword vbEvents AfterWriteFile AmbienChanged
+syn keyword vbEvents ApplyChanges Associate AsyncReadComplete
+syn keyword vbEvents AxisActivated AxisLabelActivated
+syn keyword vbEvents AxisLabelSelected AxisLabelUpdated
+syn keyword vbEvents AxisSelected AxisTitleActivated
+syn keyword vbEvents AxisTitleSelected AxisTitleUpdated
+syn keyword vbEvents AxisUpdated BeforeClick BeforeColEdit
+syn keyword vbEvents BeforeColUpdate BeforeConnect
+syn keyword vbEvents BeforeDelete BeforeInsert
+syn keyword vbEvents BeforeLabelEdit BeforeLoadFile
+syn keyword vbEvents BeforeUpdate ButtonClick ButtonCompleted
+syn keyword vbEvents ButtonGotFocus ButtonLostFocus Change
+syn keyword vbEvents ChartActivated ChartSelected
+syn keyword vbEvents ChartUpdated Click ColEdit Collapse
+syn keyword vbEvents ColResize ColumnClick Compare
+syn keyword vbEvents ConfigChageCancelled ConfigChanged
+syn keyword vbEvents ConnectionRequest DataArrival
+syn keyword vbEvents DataChanged DataUpdated DblClick
+syn keyword vbEvents Deactivate DeviceArrival
+syn keyword vbEvents DeviceOtherEvent DeviceQueryRemove
+syn keyword vbEvents DeviceQueryRemoveFailed
+syn keyword vbEvents DeviceRemoveComplete DeviceRemovePending
+syn keyword vbEvents DevModeChange Disconnect DisplayChanged
+syn keyword vbEvents Dissociate DoGetNewFileName Done
+syn keyword vbEvents DonePainting DownClick DragDrop DragOver
+syn keyword vbEvents DropDown EditProperty EnterCell
+syn keyword vbEvents EnterFocus ExitFocus Expand
+syn keyword vbEvents FootnoteActivated FootnoteSelected
+syn keyword vbEvents FootnoteUpdated GotFocus HeadClick
+syn keyword vbEvents InfoMessage Initialize IniProperties
+syn keyword vbEvents ItemActivated ItemAdded ItemCheck
+syn keyword vbEvents ItemClick ItemReloaded ItemRemoved
+syn keyword vbEvents ItemRenamed ItemSeletected KeyDown
+syn keyword vbEvents KeyPress KeyUp LeaveCell LegendActivated
+syn keyword vbEvents LegendSelected LegendUpdated LinkClose
+syn keyword vbEvents LinkError LinkNotify LinkOpen Load
+syn keyword vbEvents LostFocus MouseDown MouseMove MouseUp
+syn keyword vbEvents NodeClick ObjectMove OLECompleteDrag
+syn keyword vbEvents OLEDragDrop OLEDragOver OLEGiveFeedback
+syn keyword vbEvents OLESetData OLEStartDrag OnAddNew OnComm
+syn keyword vbEvents Paint PanelClick PanelDblClick
+syn keyword vbEvents PathChange PatternChange PlotActivated
+syn keyword vbEvents PlotSelected PlotUpdated PointActivated
+syn keyword vbEvents PointLabelActivated PointLabelSelected
+syn keyword vbEvents PointLabelUpdated PointSelected
+syn keyword vbEvents PointUpdated PowerQuerySuspend
+syn keyword vbEvents PowerResume PowerStatusChanged
+syn keyword vbEvents PowerSuspend QueryChangeConfig
+syn keyword vbEvents QueryComplete QueryCompleted
+syn keyword vbEvents QueryTimeout QueryUnload ReadProperties
+syn keyword vbEvents Reposition RequestChangeFileName
+syn keyword vbEvents RequestWriteFile Resize ResultsChanged
+syn keyword vbEvents RowColChange RowCurrencyChange RowResize
+syn keyword vbEvents RowStatusChanged SelChange
+syn keyword vbEvents SelectionChanged SendComplete
+syn keyword vbEvents SendProgress SeriesActivated
+syn keyword vbEvents SeriesSelected SeriesUpdated
+syn keyword vbEvents SettingChanged SplitChange StateChanged
+syn keyword vbEvents StatusUpdate SysColorsChanged Terminate
+syn keyword vbEvents TimeChanged TitleActivated TitleSelected
+syn keyword vbEvents TitleActivated UnboundAddData
+syn keyword vbEvents UnboundDeleteRow
+syn keyword vbEvents UnboundGetRelativeBookmark
+syn keyword vbEvents UnboundReadData UnboundWriteData Unload
+syn keyword vbEvents UpClick Updated Validate ValidationError
+syn keyword vbEvents WillAssociate WillChangeData
+syn keyword vbEvents WillDissociate WillExecute
+syn keyword vbEvents WillUpdateRows WriteProperties
+
+syn keyword vbTypes Boolean Byte Currency Date Decimal
+syn keyword vbTypes Double Empty Integer Long Single String
+
+syn match vbOperator "[()+.,\-/*=&]"
+syn match vbOperator "[<>]=\="
+syn match vbOperator "<>"
+syn match vbOperator "\s\+_$"
+syn keyword vbOperator And Or Not Xor Mod In Is Imp Eqv
+syn keyword vbOperator To ByVal ByRef
+syn keyword vbConst True False Null Nothing
+
+syn keyword vbTodo contained TODO
+
+"integer number, or floating point number without a dot.
+syn match vbNumber "\<\d\+\>"
+"floating point number, with dot
+syn match vbNumber "\<\d\+\.\d*\>"
+"floating point number, starting with a dot
+syn match vbNumber "\.\d\+\>"
+
+" String and Character contstants
+syn region vbString start=+"+ end=+"+
+syn region vbComment start="\<REM\>" end="$" contains=vbTodo
+syn region vbComment start="'" end="$" contains=vbTodo
+syn region vbLineNumber start="^\d" end="\s"
+syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_vb_syntax_inits")
+ if version < 508
+ let did_vb_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink vbLineNumber Comment
+ HiLink vbNumber Number
+ HiLink vbConst Constant
+ HiLink vbError Error
+ HiLink vbStatement Statement
+ HiLink vbString String
+ HiLink vbComment Comment
+ HiLink vbTodo Todo
+ HiLink vbFunction Identifier
+ HiLink vbMethods PreProc
+ HiLink vbEvents Special
+ HiLink vbTypeSpecifier Type
+ HiLink vbTypes Type
+ HiLink vbOperator Operator
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vb"
+
+" vim: ts=8
diff --git a/runtime/syntax/verilog.vim b/runtime/syntax/verilog.vim
new file mode 100644
index 000000000..2e0179942
--- /dev/null
+++ b/runtime/syntax/verilog.vim
@@ -0,0 +1,134 @@
+" Vim syntax file
+" Language: Verilog
+" Maintainer: Mun Johl <mun_johl@sierralogic.com>
+" Last Update: Tue Nov 4 09:39:40 PST 2003
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Set the local value of the 'iskeyword' option
+if version >= 600
+ setlocal iskeyword=@,48-57,_,192-255
+else
+ set iskeyword=@,48-57,_,192-255
+endif
+
+" A bunch of useful Verilog keywords
+
+syn keyword verilogStatement always and assign automatic buf
+syn keyword verilogStatement bufif0 bufif1 cell cmos
+syn keyword verilogStatement config deassign defparam design
+syn keyword verilogStatement disable edge endconfig
+syn keyword verilogStatement endfunction endgenerate endmodule
+syn keyword verilogStatement endprimitive endspecify endtable endtask
+syn keyword verilogStatement event force function
+syn keyword verilogStatement generate genvar highz0 highz1 ifnone
+syn keyword verilogStatement incdir include initial inout input
+syn keyword verilogStatement instance integer large liblist
+syn keyword verilogStatement library localparam macromodule medium
+syn keyword verilogStatement module nand negedge nmos nor
+syn keyword verilogStatement noshowcancelled not notif0 notif1 or
+syn keyword verilogStatement output parameter pmos posedge primitive
+syn keyword verilogStatement pull0 pull1 pulldown pullup
+syn keyword verilogStatement pulsestyle_onevent pulsestyle_ondetect
+syn keyword verilogStatement rcmos real realtime reg release
+syn keyword verilogStatement rnmos rpmos rtran rtranif0 rtranif1
+syn keyword verilogStatement scalared showcancelled signed small
+syn keyword verilogStatement specify specparam strong0 strong1
+syn keyword verilogStatement supply0 supply1 table task time tran
+syn keyword verilogStatement tranif0 tranif1 tri tri0 tri1 triand
+syn keyword verilogStatement trior trireg unsigned use vectored wait
+syn keyword verilogStatement wand weak0 weak1 wire wor xnor xor
+syn keyword verilogLabel begin end fork join
+syn keyword verilogConditional if else case casex casez default endcase
+syn keyword verilogRepeat forever repeat while for
+
+syn keyword verilogTodo contained TODO
+
+syn match verilogOperator "[&|~><!)(*#%@+/=?:;}{,.\^\-\[\]]"
+
+syn region verilogComment start="/\*" end="\*/" contains=verilogTodo
+syn match verilogComment "//.*" contains=verilogTodo
+
+"syn match verilogGlobal "`[a-zA-Z0-9_]\+\>"
+syn match verilogGlobal "`celldefine"
+syn match verilogGlobal "`default_nettype"
+syn match verilogGlobal "`define"
+syn match verilogGlobal "`else"
+syn match verilogGlobal "`elsif"
+syn match verilogGlobal "`endcelldefine"
+syn match verilogGlobal "`endif"
+syn match verilogGlobal "`ifdef"
+syn match verilogGlobal "`ifndef"
+syn match verilogGlobal "`include"
+syn match verilogGlobal "`line"
+syn match verilogGlobal "`nounconnected_drive"
+syn match verilogGlobal "`resetall"
+syn match verilogGlobal "`timescale"
+syn match verilogGlobal "`unconnected_drive"
+syn match verilogGlobal "`undef"
+syn match verilogGlobal "$[a-zA-Z0-9_]\+\>"
+
+syn match verilogConstant "\<[A-Z][A-Z0-9_]\+\>"
+
+syn match verilogNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
+syn match verilogNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
+syn match verilogNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
+syn match verilogNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
+syn match verilogNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
+
+syn region verilogString start=+"+ skip=+\\"+ end=+"+ contains=verilogEscape
+syn match verilogEscape +\\[nt"\\]+ contained
+syn match verilogEscape "\\\o\o\=\o\=" contained
+
+" Directives
+syn match verilogDirective "//\s*synopsys\>.*$"
+syn region verilogDirective start="/\*\s*synopsys\>" end="\*/"
+syn region verilogDirective start="//\s*synopsys dc_script_begin\>" end="//\s*synopsys dc_script_end\>"
+
+syn match verilogDirective "//\s*\$s\>.*$"
+syn region verilogDirective start="/\*\s*\$s\>" end="\*/"
+syn region verilogDirective start="//\s*\$s dc_script_begin\>" end="//\s*\$s dc_script_end\>"
+
+"Modify the following as needed. The trade-off is performance versus
+"functionality.
+syn sync lines=50
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_verilog_syn_inits")
+ if version < 508
+ let did_verilog_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default highlighting.
+ HiLink verilogCharacter Character
+ HiLink verilogConditional Conditional
+ HiLink verilogRepeat Repeat
+ HiLink verilogString String
+ HiLink verilogTodo Todo
+ HiLink verilogComment Comment
+ HiLink verilogConstant Constant
+ HiLink verilogLabel Label
+ HiLink verilogNumber Number
+ HiLink verilogOperator Special
+ HiLink verilogStatement Statement
+ HiLink verilogGlobal Define
+ HiLink verilogDirective SpecialComment
+ HiLink verilogEscape Special
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "verilog"
+
+" vim: ts=8
diff --git a/runtime/syntax/vgrindefs.vim b/runtime/syntax/vgrindefs.vim
new file mode 100644
index 000000000..a4b81b7ef
--- /dev/null
+++ b/runtime/syntax/vgrindefs.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language: Vgrindefs
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Apr 25
+
+" The Vgrindefs file is used to specify a language for vgrind
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Comments
+syn match vgrindefsComment "^#.*"
+
+" The fields that vgrind recognizes
+syn match vgrindefsField ":ab="
+syn match vgrindefsField ":ae="
+syn match vgrindefsField ":pb="
+syn match vgrindefsField ":bb="
+syn match vgrindefsField ":be="
+syn match vgrindefsField ":cb="
+syn match vgrindefsField ":ce="
+syn match vgrindefsField ":sb="
+syn match vgrindefsField ":se="
+syn match vgrindefsField ":lb="
+syn match vgrindefsField ":le="
+syn match vgrindefsField ":nc="
+syn match vgrindefsField ":tl"
+syn match vgrindefsField ":oc"
+syn match vgrindefsField ":kw="
+
+" Also find the ':' at the end of the line, so all ':' are highlighted
+syn match vgrindefsField ":\\$"
+syn match vgrindefsField ":$"
+syn match vgrindefsField "\\$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_vgrindefs_syntax_inits")
+ if version < 508
+ let did_vgrindefs_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink vgrindefsField Statement
+ HiLink vgrindefsComment Comment
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vgrindefs"
+
+" vim: ts=8
diff --git a/runtime/syntax/vhdl.vim b/runtime/syntax/vhdl.vim
new file mode 100644
index 000000000..96fbcd620
--- /dev/null
+++ b/runtime/syntax/vhdl.vim
@@ -0,0 +1,184 @@
+" Vim syntax file
+" Language: VHDL
+" Maintainer: Czo <Olivier.Sirol@lip6.fr>
+" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
+" $Id$
+
+" VHSIC Hardware Description Language
+" Very High Scale Integrated Circuit
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" This is not VHDL. I use the C-Preprocessor cpp to generate different binaries
+" from one VHDL source file. Unfortunately there is no preprocessor for VHDL
+" available. If you don't like this, please remove the following lines.
+syn match cDefine "^#ifdef[ ]\+[A-Za-z_]\+"
+syn match cDefine "^#endif"
+
+" case is not significant
+syn case ignore
+
+" VHDL keywords
+syn keyword vhdlStatement access after alias all assert
+syn keyword vhdlStatement architecture array attribute
+syn keyword vhdlStatement begin block body buffer bus
+syn keyword vhdlStatement case component configuration constant
+syn keyword vhdlStatement disconnect downto
+syn keyword vhdlStatement elsif end entity exit
+syn keyword vhdlStatement file for function
+syn keyword vhdlStatement generate generic group guarded
+syn keyword vhdlStatement impure in inertial inout is
+syn keyword vhdlStatement label library linkage literal loop
+syn keyword vhdlStatement map
+syn keyword vhdlStatement new next null
+syn keyword vhdlStatement of on open others out
+syn keyword vhdlStatement package port postponed procedure process pure
+syn keyword vhdlStatement range record register reject report return
+syn keyword vhdlStatement select severity signal shared
+syn keyword vhdlStatement subtype
+syn keyword vhdlStatement then to transport type
+syn keyword vhdlStatement unaffected units until use
+syn keyword vhdlStatement variable wait when while with
+syn keyword vhdlStatement note warning error failure
+
+" Special match for "if" and "else" since "else if" shouldn't be highlighted.
+" The right keyword is "elsif"
+syn match vhdlStatement "\<\(if\|else\)\>"
+syn match vhdlNone "\<else\s\+if\>$"
+syn match vhdlNone "\<else\s\+if\>\s"
+
+" Predifined VHDL types
+syn keyword vhdlType bit bit_vector
+syn keyword vhdlType character boolean integer real time
+syn keyword vhdlType string severity_level
+" Predifined standard ieee VHDL types
+syn keyword vhdlType positive natural signed unsigned
+syn keyword vhdlType line text
+syn keyword vhdlType std_logic std_logic_vector
+syn keyword vhdlType std_ulogic std_ulogic_vector
+" Predefined non standard VHDL types for Mentor Graphics Sys1076/QuickHDL
+syn keyword vhdlType qsim_state qsim_state_vector
+syn keyword vhdlType qsim_12state qsim_12state_vector
+syn keyword vhdlType qsim_strength
+" Predefined non standard VHDL types for Alliance VLSI CAD
+syn keyword vhdlType mux_bit mux_vector reg_bit reg_vector wor_bit wor_vector
+
+" array attributes
+syn match vhdlAttribute "\'high"
+syn match vhdlAttribute "\'left"
+syn match vhdlAttribute "\'length"
+syn match vhdlAttribute "\'low"
+syn match vhdlAttribute "\'range"
+syn match vhdlAttribute "\'reverse_range"
+syn match vhdlAttribute "\'right"
+syn match vhdlAttribute "\'ascending"
+" block attributes
+syn match vhdlAttribute "\'behaviour"
+syn match vhdlAttribute "\'structure"
+syn match vhdlAttribute "\'simple_name"
+syn match vhdlAttribute "\'instance_name"
+syn match vhdlAttribute "\'path_name"
+syn match vhdlAttribute "\'foreign"
+" signal attribute
+syn match vhdlAttribute "\'active"
+syn match vhdlAttribute "\'delayed"
+syn match vhdlAttribute "\'event"
+syn match vhdlAttribute "\'last_active"
+syn match vhdlAttribute "\'last_event"
+syn match vhdlAttribute "\'last_value"
+syn match vhdlAttribute "\'quiet"
+syn match vhdlAttribute "\'stable"
+syn match vhdlAttribute "\'transaction"
+syn match vhdlAttribute "\'driving"
+syn match vhdlAttribute "\'driving_value"
+" type attributes
+syn match vhdlAttribute "\'base"
+syn match vhdlAttribute "\'high"
+syn match vhdlAttribute "\'left"
+syn match vhdlAttribute "\'leftof"
+syn match vhdlAttribute "\'low"
+syn match vhdlAttribute "\'pos"
+syn match vhdlAttribute "\'pred"
+syn match vhdlAttribute "\'rightof"
+syn match vhdlAttribute "\'succ"
+syn match vhdlAttribute "\'val"
+syn match vhdlAttribute "\'image"
+syn match vhdlAttribute "\'value"
+
+syn keyword vhdlBoolean true false
+
+" for this vector values case is significant
+syn case match
+" Values for standard VHDL types
+syn match vhdlVector "\'[0L1HXWZU\-\?]\'"
+" Values for non standard VHDL types qsim_12state for Mentor Graphics Sys1076/QuickHDL
+syn keyword vhdlVector S0S S1S SXS S0R S1R SXR S0Z S1Z SXZ S0I S1I SXI
+syn case ignore
+
+syn match vhdlVector "B\"[01_]\+\""
+syn match vhdlVector "O\"[0-7_]\+\""
+syn match vhdlVector "X\"[0-9a-f_]\+\""
+syn match vhdlCharacter "'.'"
+syn region vhdlString start=+"+ end=+"+
+
+" floating numbers
+syn match vhdlNumber "-\=\<\d\+\.\d\+\(E[+\-]\=\d\+\)\>"
+syn match vhdlNumber "-\=\<\d\+\.\d\+\>"
+syn match vhdlNumber "0*2#[01_]\+\.[01_]\+#\(E[+\-]\=\d\+\)\="
+syn match vhdlNumber "0*16#[0-9a-f_]\+\.[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
+" integer numbers
+syn match vhdlNumber "-\=\<\d\+\(E[+\-]\=\d\+\)\>"
+syn match vhdlNumber "-\=\<\d\+\>"
+syn match vhdlNumber "0*2#[01_]\+#\(E[+\-]\=\d\+\)\="
+syn match vhdlNumber "0*16#[0-9a-f_]\+#\(E[+\-]\=\d\+\)\="
+" operators
+syn keyword vhdlOperator and nand or nor xor xnor
+syn keyword vhdlOperator rol ror sla sll sra srl
+syn keyword vhdlOperator mod rem abs not
+syn match vhdlOperator "[&><=:+\-*\/|]"
+syn match vhdlSpecial "[().,;]"
+" time
+syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
+syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
+
+syn match vhdlComment "--.*$"
+" syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_vhdl_syntax_inits")
+ if version < 508
+ let did_vhdl_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink cDefine PreProc
+ HiLink vhdlSpecial Special
+ HiLink vhdlStatement Statement
+ HiLink vhdlCharacter String
+ HiLink vhdlString String
+ HiLink vhdlVector String
+ HiLink vhdlBoolean String
+ HiLink vhdlComment Comment
+ HiLink vhdlNumber String
+ HiLink vhdlTime String
+ HiLink vhdlType Type
+ HiLink vhdlOperator Type
+ HiLink vhdlGlobal Error
+ HiLink vhdlAttribute Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vhdl"
+
+" vim: ts=8
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
new file mode 100644
index 000000000..bfad112a1
--- /dev/null
+++ b/runtime/syntax/vim.vim
@@ -0,0 +1,642 @@
+" Vim syntax file
+" Language: Vim 6.3 script
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: May 25, 2004
+" Version: 6.3-04
+" Automatically generated keyword lists: {{{1
+
+" Quit when a syntax file was already loaded {{{2
+if exists("b:current_syntax")
+ finish
+endif
+
+" vimTodo: contains common special-notices for comments {{{2
+" Use the vimCommentGroup cluster to add your own.
+syn keyword vimTodo contained COMBAK NOT RELEASED TODO WIP
+syn cluster vimCommentGroup contains=vimTodo,@Spell
+
+" regular vim commands {{{2
+syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[ark] diffg[et] diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] norm[al] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vi[sual] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revous] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank]
+syn match vimCommand contained "\<z[-+^.=]"
+
+" vimOptions are caught only when contained in a vimSet {{{2
+syn keyword vimOption contained : acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval bdir bdlay beval bex bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete conc conceallevel confirm consk conskey copyindent cp cpo cpoptions cpt crb cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cursorbind cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatoptions formatprg fp ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmemtot mef menuitems mfd mh mis ml mls mm mmd mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps nf nrformats nu number oft osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printoptions pt pvh pvw readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smd sn so softtabstop sol sp splitbelow splitright spr sr srr ss ssl ssop st sta startofline statusline stl sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wig wildchar wildcharm wildignore wildmenu wildmode wim winaltkeys winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww
+
+" vimOptions: These are the turn-off setting variants {{{2
+syn keyword vimOption contained noacd noai noakm noallowrevins noaltkeymap noanti noantialias noar noarab noarabic noarabicshape noari noarshape noautochdir noautoindent noautoread noautowrite noautowriteall noaw noawa nobackup noballooneval nobeval nobin nobinary nobiosk nobioskey nobk nobl nobomb nobuflisted nocf noci nocin nocindent nocompatible noconfirm noconsk noconskey nocopyindent nocp nocrb nocscopetag nocscopeverbose nocst nocsverb nocursorbind nodeco nodelcombine nodg nodiff nodigraph nodisable noea noeb noed noedcompatible noek noendofline noeol noequalalways noerrorbells noesckeys noet noex noexpandtab noexrc nofen nofk nofkmap nofoldenable nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkmapp nohkp nohls nohlsearch noic noicon noignorecase noim noimc noimcmdline noimd noincsearch noinf noinfercase noinsertmode nois nojoinspaces nojs nolazyredraw nolbr nolinebreak nolisp nolist noloadplugins nolpl nolz noma nomagic nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus nomousehide nonu nonumber nopaste nopi nopreserveindent nopreviewwindow nopvw noreadonly noremap norestorescreen norevins nori norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb noscrollbind noscs nosecure nosft noshellslash noshiftround noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase nosmartindent nosmarttab nosmd nosn nosol nosplitbelow nosplitright nospr nosr nossl nosta nostartofline noswapfile noswf nota notagbsearch notagrelative notagstack notbi notbidi notbs notermbidi noterse notextauto notextmode notf notgst notildeop notimeout notitle noto notop notr nottimeout nottybuiltin nottyfast notx novb novisualbell nowa nowarn nowb noweirdinvert nowfh nowildmenu nowinfixheight nowiv nowmnu nowrap nowrapscan nowrite nowriteany nowritebackup nows
+
+" vimOptions: These are the invertible variants {{{2
+syn keyword vimOption contained invacd invai invakm invallowrevins invaltkeymap invanti invantialias invar invarab invarabic invarabicshape invari invarshape invautochdir invautoindent invautoread invautowrite invautowriteall invaw invawa invbackup invballooneval invbeval invbin invbinary invbiosk invbioskey invbk invbl invbomb invbuflisted invcf invci invcin invcindent invcompatible invconfirm invconsk invconskey invcopyindent invcp invcrb invcscopetag invcscopeverbose invcst invcsverb invcursorbind invdeco invdelcombine invdg invdiff invdigraph invdisable invea inveb inved invedcompatible invek invendofline inveol invequalalways inverrorbells invesckeys invet invex invexpandtab invexrc invfen invfk invfkmap invfoldenable invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkmapp invhkp invhls invhlsearch invic invicon invignorecase invim invimc invimcmdline invimd invincsearch invinf invinfercase invinsertmode invis invjoinspaces invjs invlazyredraw invlbr invlinebreak invlisp invlist invloadplugins invlpl invlz invma invmagic invmh invml invmod invmodeline invmodifiable invmodified invmore invmousef invmousefocus invmousehide invnu invnumber invpaste invpi invpreserveindent invpreviewwindow invpvw invreadonly invremap invrestorescreen invrevins invri invrightleft invrightleftcmd invrl invrlc invro invrs invru invruler invsb invsc invscb invscrollbind invscs invsecure invsft invshellslash invshiftround invshortname invshowcmd invshowfulltag invshowmatch invshowmode invsi invsm invsmartcase invsmartindent invsmarttab invsmd invsn invsol invsplitbelow invsplitright invspr invsr invssl invsta invstartofline invswapfile invswf invta invtagbsearch invtagrelative invtagstack invtbi invtbidi invtbs invtermbidi invterse invtextauto invtextmode invtf invtgst invtildeop invtimeout invtitle invto invtop invtr invttimeout invttybuiltin invttyfast invtx invvb invvisualbell invwa invwarn invwb invweirdinvert invwfh invwildmenu invwinfixheight invwiv invwmnu invwrap invwrapscan invwrite invwriteany invwritebackup invws
+
+" termcap codes (which can also be set) {{{2
+syn keyword vimOption contained t_AB t_AF t_al t_AL t_bc t_cd t_ce t_cl t_cm t_Co t_cs t_CS t_CV t_da t_db t_dl t_DL t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RI t_RV t_Sb t_se t_Sf t_so t_sr t_te t_ti t_ts t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xs t_ZH t_ZR
+syn match vimOption contained "t_%1"
+syn match vimOption contained "t_#2"
+syn match vimOption contained "t_#4"
+syn match vimOption contained "t_@7"
+syn match vimOption contained "t_*7"
+syn match vimOption contained "t_&8"
+syn match vimOption contained "t_%i"
+syn match vimOption contained "t_k;"
+
+" unsupported settings: these are supported by vi but don't do anything in vim {{{2
+syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600 wi window
+
+" AutoBuf Events {{{2
+syn case ignore
+syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave
+
+" Highlight commonly used Groupnames {{{2
+syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
+
+" Default highlighting groups {{{2
+syn keyword vimHLGroup contained Conceal Cursor CursorIM DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr Menu ModeMsg MoreMsg NonText Normal Question Scrollbar Search SignColumn SpecialKey StatusLine StatusLineNC Title Tooltip VertSplit Visual VisualNOS WarningMsg WildMenu
+syn case match
+
+" Function Names {{{2
+syn keyword vimFuncName contained append argc argidx argv browse bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line char2nr cindent col confirm cscope_connection cursor delete did_filetype escape eventhandler executable exists expand filereadable filewritable fnamemodify foldclosed foldclosedend foldlevel foldtext foreground function getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfsize getftime getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent input inputdialog inputrestore inputsave inputsecret isdirectory libcall libcallnr line line2byte lispindent localtime maparg mapcheck match matchend matchstr mode nextnonblank nr2char prevnonblank remote_expr remote_foreground remote_peek remote_read remote_send rename resolve search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify strftime stridx strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper type virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth
+
+"--- syntax above generated by mkvimvim ---
+
+" Special Vim Highlighting {{{1
+
+" Numbers {{{1
+" =======
+syn match vimNumber "\<\d\+\([lL]\|\.\d\+\)\="
+syn match vimNumber "-\d\+\([lL]\|\.\d\+\)\="
+syn match vimNumber "\<0[xX]\x\+"
+syn match vimNumber "#\x\{6}"
+
+" All vimCommands are contained by vimIsCommands. {{{1
+syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
+syn match vimIsCommand "\<\a\+\>" contains=vimCommand
+syn match vimVar "\<[bwglsav]:\K\k*\>"
+syn match vimVar contained "\<\K\k*\>"
+
+" Insertions And Appends: insert append {{{1
+" =======================
+syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$" matchgroup=vimCommand end="^\.$""
+syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$" matchgroup=vimCommand end="^\.$""
+syn region vimInsert matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$" matchgroup=vimCommand end="^\.$""
+
+" Behave! {{{1
+" =======
+syn match vimBehave "\<be\%[have]\>" skipwhite nextgroup=vimBehaveModel,vimBehaveError
+syn keyword vimBehaveModel contained mswin xterm
+syn match vimBehaveError contained "[^ ]\+"
+
+" Filetypes {{{1
+" =========
+syn match vimFiletype "\<filet\%[ype]\(\s\+\I\i*\)*\(|\|$\)" skipwhite contains=vimFTCmd,vimFTOption,vimFTError
+syn match vimFTError contained "\I\i*"
+syn keyword vimFTCmd contained filet[ype]
+syn keyword vimFTOption contained detect indent off on plugin
+
+" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{1
+" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
+syn cluster vimAugroupList contains=vimIsCommand,vimFunction,vimFunctionError,vimLineComment,vimSpecFile,vimOper,vimNumber,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
+syn region vimAugroup start="\<aug\%[roup]\>\s\+\K\k*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>" contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
+syn match vimAugroupError "\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
+syn keyword vimAugroupKey contained aug[roup]
+
+" Functions : Tag is provided for those who wish to highlight tagged functions {{{1
+" =========
+syn cluster vimFuncList contains=vimFuncKey,Tag,vimFuncSID
+syn cluster vimFuncBodyList contains=vimIsCommand,vimFunction,vimFunctionError,vimFuncBody,vimLineComment,vimSpecFile,vimOper,vimNumber,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
+syn match vimFunctionError "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*(" contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody
+syn match vimFunction "\<fu\%[nction]!\=\s\+\(<[sS][iI][dD]>\|[Ss]:\|\u\)\i*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
+syn region vimFuncBody contained start=")" end="\<endf\%[unction]" contains=@vimFuncBodyList
+syn match vimFuncVar contained "a:\(\I\i*\|\d\+\)"
+syn match vimFuncSID contained "\c<sid>\|\<s:"
+syn keyword vimFuncKey contained fu[nction]
+syn match vimFuncBlank contained "\s\+"
+
+syn keyword vimPattern contained start skip end
+
+" Operators: {{{1
+" =========
+syn cluster vimOperGroup contains=vimOper,vimOperParen,vimNumber,vimString
+syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
+syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
+syn region vimOperParen matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
+syn match vimOperError ")"
+
+" Special Filenames, Modifiers, Extension Removal: {{{1
+" ===============================================
+syn match vimSpecFile "<c\(word\|WORD\)>" nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFile "<\([acs]file\|amatch\|abuf\)>" nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFile "\s%[ \t:]"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFile "\s%$"ms=s+1 nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFile "\s%<"ms=s+1,me=e-1 nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFile "#\d\+\|[#%]<\>" nextgroup=vimSpecFileMod,vimSubst
+syn match vimSpecFileMod "\(:[phtre]\)\+" contained
+
+" User-Specified Commands: {{{1
+" =======================
+syn cluster vimUserCmdList contains=vimAddress,vimSyntax,vimHighlight,vimAutoCmd,vimCmplxRepeat,vimComment,vimCtrlChar,vimEscapeBrace,vimFilter,vimFunc,vimFunction,vimIsCommand,vimMark,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimLet,vimSet,vimSetEqual,vimSetString,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange,vimSynLine
+syn keyword vimUserCommand contained com[mand]
+syn match vimUserCmd "\<com\%[mand]!\=\>.*$" contains=vimUserAttrb,vimUserCommand,@vimUserCmdList
+syn match vimUserAttrb contained "-n\%[args]=[01*?+]" contains=vimUserAttrbKey,vimOper
+syn match vimUserAttrb contained "-com\%[plete]=" contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
+syn match vimUserAttrb contained "-ra\%[nge]\(=%\|=\d\+\)\=" contains=vimNumber,vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-cou\%[nt]=\d\+" contains=vimNumber,vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-bang\=\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-bar\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserAttrb contained "-re\%[gister]\>" contains=vimOper,vimUserAttrbKey
+syn match vimUserCmdError contained "\S\+\>"
+syn case ignore
+syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister]
+syn keyword vimUserAttrbCmplt contained augroup buffer command dir environment event expression file function help highlight mapping menu option tag tag_listfiles var
+syn case match
+syn match vimUserAttrbCmplt contained "custom,\u\w*"
+
+" Errors: {{{1
+" ======
+syn match vimElseIfErr "\<else\s\+if\>"
+
+" Lower Priority Comments: after some vim commands... {{{1
+" =======================
+syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString
+syn match vimComment +\<endif\s\+".*$+lc=5 contains=@vimCommentGroup,vimCommentString
+syn match vimComment +\<else\s\+".*$+lc=4 contains=@vimCommentGroup,vimCommentString
+syn region vimCommentString contained oneline start='\S\s\+"'ms=s+1 end='"'
+
+" Environment Variables: {{{1
+" =====================
+syn match vimEnvvar "\$\I\i*"
+syn match vimEnvvar "\${\I\i*}"
+
+" In-String Specials: {{{1
+" Try to catch strings, if nothing else matches (therefore it must precede the others!)
+" vimEscapeBrace handles ["] []"] (ie. "s don't terminate string inside [])
+syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1
+syn match vimPatSepErr contained "\\)"
+syn match vimPatSep contained "\\|"
+syn region vimPatSepZone oneline contained transparent matchgroup=vimPatSep start="\\%\=(" skip="\\\\" end="\\)" contains=@vimStringGroup
+syn region vimPatSepZone oneline contained matchgroup=vimPatSep start="\\%\=(" skip="\\\\" end="\\)" contains=@vimStringGroup
+syn region vimPatRegion contained transparent matchgroup=vimPatSep start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
+syn match vimNotPatSep contained "\\\\"
+syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone
+syn region vimString oneline keepend start=+[^:a-zA-Z>!\\]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup
+syn region vimString oneline keepend start=+[^:a-zA-Z>!\\]'+lc=1 end=+'+ contains=@vimStringGroup
+syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup
+syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup
+syn region vimString oneline start="[^\\]+\s*[^a-zA-Z0-9. \t]"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup
+syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup
+syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
+syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
+
+" Substitutions: {{{1
+" =============
+syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
+syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
+syn cluster vimSubstList add=vimCollection
+syn match vimSubst "\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat
+syn match vimSubst "s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat contained
+syn match vimSubst "/\zss\%[ubstitute]\ze/" nextgroup=vimSubstPat
+syn match vimSubst1 contained "s\%[ubstitute]\>" nextgroup=vimSubstPat
+syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([^a-zA-Z( \t[\]&]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline
+syn region vimSubstRep4 contained matchgroup=vimSubstDelim start="\z(.\)" skip="\\\\\|\\\z1" end="\z1" matchgroup=vimNotation end="<[cC][rR]>" contains=@vimSubstRepList nextgroup=vimSubstFlagErr oneline
+syn region vimCollection contained transparent start="\\\@<!\[" skip="\\\[" end="\]" contains=vimCollClass
+syn match vimCollClassErr contained "\[:.\{-\}:\]"
+syn match vimCollClass contained transparent "\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|return\|tab\|escape\|backspace\):\]"
+syn match vimSubstSubstr contained "\\z\=\d"
+syn match vimSubstTwoBS contained "\\\\"
+syn match vimSubstFlagErr contained "[^< \t\r]\+" contains=vimSubstFlags
+syn match vimSubstFlags contained "[&cegiIpr]\+"
+
+" 'String': {{{1
+syn match vimString "[^(,]'[^']\{-}'"lc=1 contains=@vimStringGroup
+
+" Marks, Registers, Addresses, Filters: {{{1
+syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
+syn match vimMark "'[<>]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
+syn match vimMark ",\zs'[<>]\ze" nextgroup=vimOper,vimMarkNumber,vimSubst
+syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst
+syn match vimMark "\<norm\%[al]\s\zs'[a-zA-Z0-9]" nextgroup=vimOper,vimMarkNumber,vimSubst
+syn match vimMarkNumber "[-+]\d\+" nextgroup=vimSubst contained contains=vimOper
+syn match vimPlainMark contained "'[a-zA-Z0-9]"
+
+syn match vimRegister '[^(,;.]"[a-zA-Z0-9.%#:_\-/][^a-zA-Z_"]'lc=1,me=e-1
+syn match vimRegister '\<norm\s\+"[a-zA-Z0-9]'lc=5
+syn match vimRegister '\<normal\s\+"[a-zA-Z0-9]'lc=7
+syn match vimPlainRegister contained '"[a-zA-Z0-9\-:.%#*+=]'
+
+syn match vimAddress ",[.$]"lc=1 skipwhite nextgroup=vimSubst1
+syn match vimAddress "%\a"me=e-1 skipwhite nextgroup=vimString,vimSubst1
+
+syn match vimFilter contained "^!.\{-}\(|\|$\)" contains=vimSpecFile
+syn match vimFilter contained "\A!.\{-}\(|\|$\)"ms=s+1 contains=vimSpecFile
+
+" Complex repeats (:h complex-repeat) {{{1
+syn match vimCmplxRepeat '[^a-zA-Z_/\\]q[0-9a-zA-Z"]'lc=1
+syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)'
+
+" Set command and associated set-options (vimOptions) with comment {{{1
+syn region vimSet matchgroup=vimCommand start="\<setlocal\|set\>" end="|"me=e-1 end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
+syn region vimSetEqual contained start="=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation
+syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar
+syn match vimSetSep contained "[,:]"
+syn match vimSetMod contained "&vim\|[!&]\|all&"
+
+" Let {{{1
+" ===
+syn keyword vimLet let unl[et] skipwhite nextgroup=vimVar
+
+" Autocmd {{{1
+" =======
+syn match vimAutoEventList contained "\(!\s\+\)\=\(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace
+syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList
+syn match vimAutoCmdSfxList contained "\S*"
+syn keyword vimAutoCmd au[tocmd] do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList
+
+" Echo and Execute -- prefer strings! {{{1
+" ================
+syn region vimEcho oneline excludenl matchgroup=vimCommand start="\<ec\%[ho]\>" skip="\(\\\\\)*\\|" end="$\||" contains=vimFunc,vimString,varVar
+syn region vimExecute oneline excludenl matchgroup=vimCommand start="\<exe\%[cute]\>" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimIsCommand,vimString,vimOper,vimVar,vimNotation
+syn match vimEchoHL "echohl\=" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone
+syn case ignore
+syn keyword vimEchoHLNone none
+syn case match
+
+" Maps {{{1
+" ====
+syn cluster vimMapGroup contains=vimMapBang,vimMapLhs,vimMapMod
+syn keyword vimMap cm[ap] cno[remap] im[ap] ino[remap] map nm[ap] nn[oremap] no[remap] om[ap] ono[remap] vm[ap] vn[oremap] skipwhite nextgroup=@vimMapGroup
+syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar
+syn match vimMapBang contained "!" skipwhite nextgroup=vimMapLhs
+syn match vimMapMod contained "\c<\(buffer\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMapGroup
+syn case ignore
+syn keyword vimMapModKey contained buffer leader localleader plug script sid silent unique
+syn case match
+
+" Menus {{{1
+" =====
+syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod
+syn keyword vimCommand am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] skipwhite nextgroup=@vimMenuList
+syn match vimMenuName "[^ \t\\<]\+" contained nextgroup=vimMenuNameMore,vimMenuMap
+syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMenuName
+syn match vimMenuNameMore "\c\\\s\|<tab>\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation
+syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList
+syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs
+syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vimIsCommand
+syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList
+
+" Angle-Bracket Notation (tnx to Michael Geddes) {{{1
+" ======================
+syn case ignore
+syn match vimNotation "\(\\\|<lt>\)\=<\([scam]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|space\|k\=\(page\)\=\(\|down\|up\)\)>" contains=vimBracket
+syn match vimNotation "\(\\\|<lt>\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket
+syn match vimNotation "\(\\\|<lt>\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket
+syn match vimNotation '\(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket
+syn match vimNotation '\(\\\|<lt>\)\=<\(line[12]\|count\|bang\|reg\|args\|lt\|[qf]-args\)>' contains=vimBracket
+syn match vimNotation "\(\\\|<lt>\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket
+syn match vimBracket contained "[\\<>]"
+syn case match
+
+" User Function Highlighting (following Gautam Iyer's suggestion)
+" ==========================
+syn match vimFunc "\%([sS]:\|<[sS][iI][dD]>\)\=\I\i*\ze\s*(" contains=vimUserFunc,vimFuncName
+syn match vimUserFunc "\%([sS]:\|<[sS][iI][dD]>\)\i\+\|\<\u\i*\>\|\<if\>" contained contains=vimNotation,vimCommand
+
+" Syntax {{{1
+"=======
+syn match vimGroupList contained "@\=[^ \t,]*" contains=vimGroupSpecial,vimPatSep
+syn match vimGroupList contained "@\=[^ \t,]*," nextgroup=vimGroupList contains=vimGroupSpecial,vimPatSep
+syn keyword vimGroupSpecial contained ALL ALLBUT
+syn match vimSynError contained "\i\+"
+syn match vimSynError contained "\i\+=" nextgroup=vimGroupList
+syn match vimSynContains contained "\<contain\(s\|edin\)=" nextgroup=vimGroupList
+syn match vimSynKeyContainedin contained "\<containedin=" nextgroup=vimGroupList
+syn match vimSynNextgroup contained "nextgroup=" nextgroup=vimGroupList
+
+syn match vimSyntax "\<sy\%[ntax]\>" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment
+syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment
+
+" Syntax: case {{{1
+syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError
+syn match vimSynCaseError contained "\i\+"
+syn keyword vimSynCase contained ignore match
+
+" Syntax: clear {{{1
+syn keyword vimSynType contained clear skipwhite nextgroup=vimGroupList
+
+" Syntax: cluster {{{1
+syn keyword vimSynType contained cluster skipwhite nextgroup=vimClusterName
+syn region vimClusterName contained matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
+syn match vimGroupAdd contained "add=" nextgroup=vimGroupList
+syn match vimGroupRem contained "remove=" nextgroup=vimGroupList
+
+" Syntax: include {{{1
+syn keyword vimSynType contained include skipwhite nextgroup=vimGroupList
+
+" Syntax: keyword {{{1
+syn cluster vimSynKeyGroup contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
+syn keyword vimSynType contained keyword skipwhite nextgroup=vimSynKeyRegion
+syn region vimSynKeyRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
+syn match vimSynKeyOpt contained "\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
+
+" Syntax: match {{{1
+syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
+syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
+syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
+syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
+if has("conceal")
+ syn match vimSynMtchOpt contained "\<cchar=" nextgroup=VimSynMtchCchar
+ syn match vimSynMtchCchar contained "."
+endif
+
+" Syntax: off and on {{{1
+syn keyword vimSynType contained enable list manual off on reset
+
+" Syntax: region {{{1
+syn cluster vimSynRegPatGroup contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
+syn cluster vimSynRegGroup contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
+syn keyword vimSynType contained region skipwhite nextgroup=vimSynRegion
+syn region vimSynRegion contained keepend matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
+syn match vimSynRegOpt contained "\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
+syn match vimSynReg contained "\(start\|skip\|end\)="he=e-1 nextgroup=vimSynRegPat
+syn match vimSynMtchGrp contained "matchgroup=" nextgroup=vimGroup,vimHLGroup
+syn region vimSynRegPat contained extend start="\z([-`~!@#$%^&*_=+;:'",./?]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSynRegPatGroup skipwhite nextgroup=vimSynPatMod,vimSynReg
+syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\="
+syn match vimSynPatMod contained "\(hs\|ms\|me\|hs\|he\|rs\|re\)=[se]\([-+]\d\+\)\=," nextgroup=vimSynPatMod
+syn match vimSynPatMod contained "lc=\d\+"
+syn match vimSynPatMod contained "lc=\d\+," nextgroup=vimSynPatMod
+syn region vimSynPatRange contained start="\[" skip="\\\\\|\\]" end="]"
+syn match vimSynNotPatRange contained "\\\\\|\\\["
+syn match vimMtchComment contained '"[^"]\+$'
+
+" Syntax: sync {{{1
+" ============
+syn keyword vimSynType contained sync skipwhite nextgroup=vimSyncC,vimSyncLines,vimSyncMatch,vimSyncError,vimSyncLinecont,vimSyncRegion
+syn match vimSyncError contained "\i\+"
+syn keyword vimSyncC contained ccomment clear fromstart
+syn keyword vimSyncMatch contained match skipwhite nextgroup=vimSyncGroupName
+syn keyword vimSyncRegion contained region skipwhite nextgroup=vimSynReg
+syn keyword vimSyncLinecont contained linecont skipwhite nextgroup=vimSynRegPat
+syn match vimSyncLines contained "\(min\|max\)\=lines=" nextgroup=vimNumber
+syn match vimSyncGroupName contained "\k\+" skipwhite nextgroup=vimSyncKey
+syn match vimSyncKey contained "\<groupthere\|grouphere\>" skipwhite nextgroup=vimSyncGroup
+syn match vimSyncGroup contained "\k\+" skipwhite nextgroup=vimSynRegPat,vimSyncNone
+syn keyword vimSyncNone contained NONE
+
+" Additional IsCommand, here by reasons of precedence {{{1
+" ====================
+syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
+
+" Highlighting {{{1
+" ============
+syn cluster vimHighlightCluster contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment
+syn match vimHighlight "\<hi\%[ghlight]\>" skipwhite nextgroup=vimHiBang,@vimHighlightCluster
+syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster
+
+syn match vimHiGroup contained "\i\+"
+syn case ignore
+syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline
+syn keyword vimFgBgAttrib contained none bg background fg foreground
+syn case match
+syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
+syn match vimHiAttribList contained "\i\+,"he=e-1 contains=vimHiAttrib nextgroup=vimHiAttribList
+syn case ignore
+syn keyword vimHiCtermColor contained black blue brown cyan darkBlue darkcyan darkgray darkgreen darkgrey darkmagenta darkred darkyellow gray green grey lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightred magenta red white yellow
+
+syn case match
+syn match vimHiFontname contained "[a-zA-Z\-*]\+"
+syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'"
+syn match vimHiGuiRgb contained "#\x\{6}"
+syn match vimHiCtermError contained "[^0-9]\i*"
+
+" Highlighting: hi group key=arg ... {{{1
+syn cluster vimHiCluster contains=vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation
+syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster
+syn match vimHiKeyError contained "\i\+="he=e-1
+syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList
+syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption
+syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList
+syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
+syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList
+syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname
+syn match vimHiGuiFgBg contained "\cgui[fb]g="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
+syn match vimHiTermcap contained "\S\+" contains=vimNotation
+
+" Highlight: clear {{{1
+syn keyword vimHiClear contained clear nextgroup=vimHiGroup
+
+" Highlight: link {{{1
+syn region vimHiLink contained oneline matchgroup=vimCommand start="\<\(def\s\+\)\=link\>\|\<def\>" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
+
+" Control Characters {{{1
+" ==================
+syn match vimCtrlChar "[- -]"
+
+" Beginners - Patterns that involve ^ {{{1
+" =========
+syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+syn match vimCommentTitle '"\s*\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
+syn match vimContinue "^\s*\\"
+syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
+syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained
+
+" Scripts : perl,ruby : Benoit Cerrina {{{1
+" ======= python,tcl: Johannes Zellner
+
+" allow users to prevent embedded script syntax highlighting
+" when vim doesn't have perl/python/ruby/tcl support. Do
+" so by setting g:vimembedscript= 0 in the user's <.vimrc>.
+if !exists("g:vimembedscript")
+ let g:vimembedscript= 1
+endif
+
+" [-- perl --] {{{2
+if (has("perl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/perl.vim")
+ unlet! b:current_syntax
+ syn include @vimPerlScript <sfile>:p:h/perl.vim
+ syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPerlScript
+ syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript
+endif
+
+" [-- ruby --] {{{2
+if (has("ruby") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/ruby.vim")
+ unlet! b:current_syntax
+ syn include @vimRubyScript <sfile>:p:h/ruby.vim
+ syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimRubyScript
+ syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript
+endif
+
+" [-- python --] {{{2
+if (has("python") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/python.vim")
+ unlet! b:current_syntax
+ syn include @vimPythonScript <sfile>:p:h/python.vim
+ syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimPythonScript
+ syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]\s*<<\s*$+ end=+\.$+ contains=@vimPythonScript
+endif
+
+" [-- tcl --] {{{2
+if (has("tcl") || g:vimembedscript) && filereadable(expand("<sfile>:p:h")."/tcl.vim")
+ unlet! b:current_syntax
+ syn include @vimTclScript <sfile>:p:h/tcl.vim
+ syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimTclScript
+ syn region vimTclRegion matchgroup=vimScriptDelim start=+tc[l]\=\s*<<\s*$+ end=+\.$+ contains=@vimTclScript
+endif
+
+" Synchronize (speed) {{{1
+"============
+if exists("g:vim_minlines")
+ exe "syn sync minlines=".g:vim_minlines
+endif
+if exists("g:vim_maxlines")
+ exe "syn sync maxlines=".g:vim_maxlines
+else
+ syn sync maxlines=60
+endif
+syn sync linecont "^\s\+\\"
+syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"
+
+" Highlighting Settings {{{1
+" ====================
+
+hi def link vimAuHighlight vimHighlight
+hi def link vimSubst1 vimSubst
+hi def link vimBehaveModel vimBehave
+
+hi def link vimAddress vimMark
+" hi def link vimAugroupError vimError
+hi def link vimAugroupKey vimCommand
+hi def link vimAutoCmdOpt vimOption
+hi def link vimAutoCmd vimCommand
+hi def link vimAutoSet vimCommand
+hi def link vimBehaveError vimError
+hi def link vimBehave vimCommand
+hi def link vimCollClassErr vimError
+hi def link vimCommentString vimString
+hi def link vimCondHL vimCommand
+hi def link vimEchoHLNone vimGroup
+hi def link vimEchoHL vimCommand
+hi def link vimElseif vimCondHL
+hi def link vimErrSetting vimError
+hi def link vimFgBgAttrib vimHiAttrib
+hi def link vimFTCmd vimCommand
+hi def link vimFTError vimError
+hi def link vimFTOption vimSynType
+hi def link VimFunc vimError
+hi def link vimFuncKey vimCommand
+hi def link vimFunctionError vimError
+hi def link vimGroupAdd vimSynOption
+hi def link vimGroupRem vimSynOption
+hi def link vimHiAttribList vimError
+hi def link vimHiCtermError vimError
+hi def link vimHiCtermFgBg vimHiTerm
+hi def link vimHiCTerm vimHiTerm
+hi def link vimHighlight vimCommand
+hi def link vimHiGroup vimGroupName
+hi def link vimHiGuiFgBg vimHiTerm
+hi def link vimHiGuiFont vimHiTerm
+hi def link vimHiGuiRgb vimNumber
+hi def link vimHiGui vimHiTerm
+hi def link vimHiKeyError vimError
+hi def link vimHiStartStop vimHiTerm
+hi def link vimHLGroup vimGroup
+hi def link vimInsert vimString
+hi def link vimKeyCodeError vimError
+hi def link vimKeyCode vimSpecFile
+hi def link vimLet vimCommand
+hi def link vimLineComment vimComment
+hi def link vimMapBang vimCommand
+hi def link vimMapModErr vimError
+hi def link vimMapModKey vimFuncSID
+hi def link vimMapMod vimBracket
+hi def link vimMap vimCommand
+hi def link vimMarkNumber vimNumber
+hi def link vimMenuMod vimMapMod
+hi def link vimMenuNameMore vimMenuName
+hi def link vimMtchComment vimComment
+hi def link vimNotFunc vimCommand
+hi def link vimNotPatSep vimString
+hi def link vimPatSepErr vimPatSep
+hi def link vimPatSepZone vimString
+hi def link vimPlainMark vimMark
+hi def link vimPlainRegister vimRegister
+hi def link vimSetMod vimOption
+hi def link vimSetString vimString
+hi def link vimSpecFileMod vimSpecFile
+hi def link vimStringCont vimString
+hi def link vimSubstFlagErr vimError
+hi def link vimSubstTwoBS vimString
+hi def link vimSubst vimCommand
+hi def link vimSynCaseError vimError
+hi def link vimSyncGroupName vimGroupName
+hi def link vimSyncGroup vimGroupName
+hi def link vimSynContains vimSynOption
+hi def link vimSynKeyContainedin vimSynContains
+hi def link vimSynKeyOpt vimSynOption
+hi def link vimSynMtchGrp vimSynOption
+hi def link vimSynMtchOpt vimSynOption
+hi def link vimSynNextgroup vimSynOption
+hi def link vimSynNotPatRange vimSynRegPat
+hi def link vimSynPatRange vimString
+hi def link vimSynRegOpt vimSynOption
+hi def link vimSynRegPat vimString
+hi def link vimSyntax vimCommand
+hi def link vimSynType vimSpecial
+hi def link vimUserAttrbCmplt vimSpecial
+hi def link vimUserAttrbKey vimOption
+hi def link vimUserAttrb vimSpecial
+hi def link vimUserCommand vimCommand
+hi def link vimUserFunc Normal
+
+hi def link vimAutoEvent Type
+hi def link vimBracket Delimiter
+hi def link vimCmplxRepeat SpecialChar
+hi def link vimCommand Statement
+hi def link vimComment Comment
+hi def link vimCommentTitle PreProc
+hi def link vimContinue Special
+hi def link vimCtrlChar SpecialChar
+hi def link vimElseIfErr Error
+hi def link vimEnvvar PreProc
+hi def link vimError Error
+hi def link vimFold Folded
+hi def link vimFuncName Function
+hi def link vimFuncSID Special
+hi def link vimFuncVar Identifier
+hi def link vimGroup Type
+hi def link vimGroupSpecial Special
+hi def link vimHLMod PreProc
+hi def link vimHiAttrib PreProc
+hi def link vimHiTerm Type
+hi def link vimKeyword Statement
+hi def link vimMark Number
+hi def link vimMenuName PreProc
+hi def link vimNotation Special
+hi def link vimNumber Number
+hi def link vimOper Operator
+hi def link vimOption PreProc
+hi def link vimOperError Error
+hi def link vimPatSep SpecialChar
+hi def link vimPattern Type
+hi def link vimRegister SpecialChar
+hi def link vimScriptDelim Comment
+hi def link vimSep Delimiter
+hi def link vimSetSep Statement
+hi def link vimSpecFile Identifier
+hi def link vimSpecial Type
+hi def link vimStatement Statement
+hi def link vimString String
+hi def link vimSubstDelim Delimiter
+hi def link vimSubstFlags Special
+hi def link vimSubstSubstr SpecialChar
+hi def link vimSynCase Type
+hi def link vimSynCaseError Error
+hi def link vimSynError Error
+hi def link vimSynOption Special
+hi def link vimSynReg Type
+hi def link vimSyncC Type
+hi def link vimSyncError Error
+hi def link vimSyncKey Type
+hi def link vimSyncNone Type
+hi def link vimTodo Todo
+hi def link vimUserCmdError Error
+
+" Current Syntax Variable: {{{1
+let b:current_syntax = "vim"
+" vim:ts=18 fdm=marker
diff --git a/runtime/syntax/viminfo.vim b/runtime/syntax/viminfo.vim
new file mode 100644
index 000000000..46d5b892a
--- /dev/null
+++ b/runtime/syntax/viminfo.vim
@@ -0,0 +1,53 @@
+" Vim syntax file
+" Language: Vim .viminfo file
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2001 Apr 25
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" The lines that are NOT recognized
+syn match viminfoError "^[^\t].*"
+
+" The one-character one-liners that are recognized
+syn match viminfoStatement "^[/&$@:?=%!<]"
+
+" The two-character one-liners that are recognized
+syn match viminfoStatement "^[-'>"]."
+syn match viminfoStatement +^"".+
+syn match viminfoStatement "^\~[/&]"
+syn match viminfoStatement "^\~[hH]"
+syn match viminfoStatement "^\~[mM][sS][lL][eE]\d\+\~\=[/&]"
+
+syn match viminfoOption "^\*.*=" contains=viminfoOptionName
+syn match viminfoOptionName "\*\a*"ms=s+1 contained
+
+" Comments
+syn match viminfoComment "^#.*"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_viminfo_syntax_inits")
+ if version < 508
+ let did_viminfo_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink viminfoComment Comment
+ HiLink viminfoError Error
+ HiLink viminfoStatement Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "viminfo"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/virata.vim b/runtime/syntax/virata.vim
new file mode 100644
index 000000000..e597b8e31
--- /dev/null
+++ b/runtime/syntax/virata.vim
@@ -0,0 +1,219 @@
+" Vim syntax file
+" Language: Virata AConfig Configuration Script
+" Maintainer: Manuel M.H. Stol <mmh.stol@gmx.net>
+" Last Change: 2003 May 11
+" Vim URL: http://www.vim.org/lang.html
+" Virata URL: http://www.globespanvirata.com/
+
+
+" Virata AConfig Configuration Script syntax
+" Can be detected by: 1) Extension .hw, .sw, .pkg and .module
+" 2) The file name pattern "mk.*\.cfg"
+" 3) The string "Virata" in the first 5 lines
+
+
+" Setup Syntax:
+if version < 600
+ " Clear old syntax settings
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+" Virata syntax is case insensitive (mostly)
+syn case ignore
+
+
+
+" Comments:
+" Virata comments start with %, but % is not a keyword character
+syn region virataComment start="^%" start="\s%"lc=1 keepend end="$" contains=@virataGrpInComments
+syn region virataSpclComment start="^%%" start="\s%%"lc=1 keepend end="$" contains=@virataGrpInComments
+syn keyword virataInCommentTodo contained TODO FIXME XXX[XXXXX] REVIEW TBD
+syn cluster virataGrpInComments contains=virataInCommentTodo
+syn cluster virataGrpComments contains=@virataGrpInComments,virataComment,virataSpclComment
+
+
+" Constants:
+syn match virataStringError +["]+
+syn region virataString start=+"+ skip=+\(\\\\\|\\"\)+ end=+"+ oneline contains=virataSpclCharError,virataSpclChar,@virataGrpDefSubsts
+syn match virataCharacter +'[^']\{-}'+ contains=virataSpclCharError,virataSpclChar
+syn match virataSpclChar contained +\\\(x\x\+\|\o\{1,3}\|['\"?\\abefnrtv]\)+
+syn match virataNumberError "\<\d\{-1,}\I\{-1,}\>"
+syn match virataNumberError "\<0x\x*\X\x*\>"
+syn match virataNumberError "\<\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
+syn match virataDecNumber "\<\d\+U\=L\=\>"
+syn match virataHexNumber "\<0x\x\+U\=L\=\>"
+syn match virataSizeNumber "\<\d\+[BKM]\>"he=e-1
+syn match virataSizeNumber "\<\d\+[KM]B\>"he=e-2
+syn cluster virataGrpNumbers contains=virataNumberError,virataDecNumber,virataHexNumber,virataSizeNumber
+syn cluster virataGrpConstants contains=@virataGrpNumbers,virataStringError,virataString,virataCharacter,virataSpclChar
+
+
+" Identifiers:
+syn match virataIdentError contained "\<\D\S*\>"
+syn match virataIdentifier contained "\<\I\i\{-}\(\-\i\{-1,}\)*\>" contains=@virataGrpDefSubsts
+syn match virataFileIdent contained "\F\f*" contains=@virataGrpDefSubsts
+syn cluster virataGrpIdents contains=virataIdentifier,virataIdentError
+syn cluster virataGrpFileIdents contains=virataFileIdent,virataIdentError
+
+
+" Statements:
+syn match virataStatement "^\s*Config\(\(/Kernel\)\=\.\(hs\=\|s\)\)\=\>"
+syn match virataStatement "^\s*Config\s\+\I\i\{-}\(\-\i\{-1,}\)*\.\(hs\=\|s\)\>"
+syn match virataStatement "^\s*Make\.\I\i\{-}\(\-\i\{-1}\)*\>" skipwhite nextgroup=@virataGrpIdents
+syn match virataStatement "^\s*Make\.c\(at\)\=++\s"me=e-1 skipwhite nextgroup=@virataGrpIdents
+syn match virataStatement "^\s*\(Architecture\|GetEnv\|Reserved\|\(Un\)\=Define\|Version\)\>" skipwhite nextgroup=@virataGrpIdents
+syn match virataStatement "^\s*\(Hardware\|ModuleSource\|\(Release\)\=Path\|Software\)\>" skipwhite nextgroup=@virataGrpFileIdents
+syn match virataStatement "^\s*\(DefaultPri\|Hydrogen\)\>" skipwhite nextgroup=virataDecNumber,virataNumberError
+syn match virataStatement "^\s*\(NoInit\|PCI\|SysLink\)\>"
+syn match virataStatement "^\s*Allow\s\+\(ModuleConfig\)\>"
+syn match virataStatement "^\s*NoWarn\s\+\(Export\|Parse\=able\|Relative]\)\>"
+syn match virataStatement "^\s*Debug\s\+O\(ff\|n\)\>"
+
+" Import (Package <exec>|Module <name> from <dir>)
+syn region virataImportDef transparent matchgroup=virataStatement start="^\s*Import\>" keepend end="$" contains=virataInImport,virataModuleDef,virataNumberError,virataStringError,@virataGrpDefSubsts
+syn match virataInImport contained "\<\(Module\|Package\|from\)\>" skipwhite nextgroup=@virataGrpFileIdents
+" Export (Header <header file>|SLibrary <obj file>)
+syn region virataExportDef transparent matchgroup=virataStatement start="^\s*Export\>" keepend end="$" contains=virataInExport,virataNumberError,virataStringError,@virataGrpDefSubsts
+syn match virataInExport contained "\<\(Header\|[SU]Library\)\>" skipwhite nextgroup=@virataGrpFileIdents
+" Process <name> is <dir/exec>
+syn region virataProcessDef transparent matchgroup=virataStatement start="^\s*Process\>" keepend end="$" contains=virataInProcess,virataInExec,virataNumberError,virataStringError,@virataGrpDefSubsts,@virataGrpIdents
+syn match virataInProcess contained "\<is\>"
+" Instance <name> of <module>
+syn region virataInstanceDef transparent matchgroup=virataStatement start="^\s*Instance\>" keepend end="$" contains=virataInInstance,virataNumberError,virataStringError,@virataGrpDefSubsts,@virataGrpIdents
+syn match virataInInstance contained "\<of\>"
+" Module <name> from <dir>
+syn region virataModuleDef transparent matchgroup=virataStatement start="^\s*\(Package\|Module\)\>" keepend end="$" contains=virataInModule,virataNumberError,virataStringError,@virataGrpDefSubsts
+syn match virataInModule contained "^\s*Package\>"hs=e-7 skipwhite nextgroup=@virataGrpIdents
+syn match virataInModule contained "^\s*Module\>"hs=e-6 skipwhite nextgroup=@virataGrpIdents
+syn match virataInModule contained "\<from\>" skipwhite nextgroup=@virataGrpFileIdents
+" Colour <name> from <dir>
+syn region virataColourDef transparent matchgroup=virataStatement start="^\s*Colour\>" keepend end="$" contains=virataInColour,virataNumberError,virataStringError,@virataGrpDefSubsts
+syn match virataInColour contained "^\s*Colour\>"hs=e-6 skipwhite nextgroup=@virataGrpIdents
+syn match virataInColour contained "\<from\>" skipwhite nextgroup=@virataGrpFileIdents
+" Link {<link cmds>}
+" Object {Executable [<ExecOptions>]}
+syn match virataStatement "^\s*\(Link\|Object\)"
+" Executable <name> [<ExecOptions>]
+syn region virataExecDef transparent matchgroup=virataStatement start="^\s*Executable\>" keepend end="$" contains=virataInExec,virataNumberError,virataStringError
+syn match virataInExec contained "^\s*Executable\>" skipwhite nextgroup=@virataGrpDefSubsts,@virataGrpIdents
+syn match virataInExec contained "\<\(epilogue\|pro\(logue\|cess\)\|qhandler\)\>" skipwhite nextgroup=@virataGrpDefSubsts,@virataGrpIdents
+syn match virataInExec contained "\<\(priority\|stack\)\>" skipwhite nextgroup=@virataGrpDefSubsts,@virataGrpNumbers
+" Message <name> {<msg format>}
+" MessageId <number>
+syn match virataStatement "^\s*Message\(Id\)\=\>" skipwhite nextgroup=@virataGrpNumbers
+" MakeRule <make suffix=file> {<make cmds>}
+syn region virataMakeDef transparent matchgroup=virataStatement start="^\s*MakeRule\>" keepend end="$" contains=virataInMake,@virataGrpDefSubsts
+syn case match
+syn match virataInMake contained "\<N\>"
+syn case ignore
+" (Append|Edit|Copy)Rule <make suffix=file> <subst cmd>
+syn match virataStatement "^\s*\(Append\|Copy\|Edit\)Rule\>"
+" AlterRules in <file> <subst cmd>
+syn region virataAlterDef transparent matchgroup=virataStatement start="^\s*AlterRules\>" keepend end="$" contains=virataInAlter,@virataGrpDefSubsts
+syn match virataInAlter contained "\<in\>" skipwhite nextgroup=@virataGrpIdents
+" Clustering
+syn cluster virataGrpInStatmnts contains=virataInImport,virataInExport,virataInExec,virataInProcess,virataInAlter,virataInInstance,virataInModule,virataInColour
+syn cluster virataGrpStatements contains=@virataGrpInStatmnts,virataStatement,virataImportDef,virataExportDef,virataExecDef,virataProcessDef,virataAlterDef,virataInstanceDef,virataModuleDef,virataColourDef
+
+
+" MkFlash.Cfg File Statements:
+syn region virataCfgFileDef transparent matchgroup=virataCfgStatement start="^\s*Dir\>" start="^\s*\a\{-}File\>" start="^\s*OutputFile\d\d\=\>" start="^\s*\a\w\{-}[NP]PFile\>" keepend end="$" contains=@virataGrpFileIdents
+syn region virataCfgSizeDef transparent matchgroup=virataCfgStatement start="^\s*\a\{-}Size\>" start="^\s*ConfigInfo\>" keepend end="$" contains=@virataGrpNumbers,@virataGrpDefSubsts,virataIdentError
+syn region virataCfgNumberDef transparent matchgroup=virataCfgStatement start="^\s*FlashchipNum\(b\(er\=\)\=\)\=\>" start="^\s*Granularity\>" keepend end="$" contains=@virataGrpNumbers,@virataGrpDefSubsts
+syn region virataCfgMacAddrDef transparent matchgroup=virataCfgStatement start="^\s*MacAddress\>" keepend end="$" contains=virataNumberError,virataStringError,virataIdentError,virataInMacAddr,@virataGrpDefSubsts
+syn match virataInMacAddr contained "\x[:]\x\{1,2}\>"lc=2
+syn match virataInMacAddr contained "\s\x\{1,2}[:]\x"lc=1,me=e-1,he=e-2 nextgroup=virataInMacAddr
+syn match virataCfgStatement "^\s*Target\>" skipwhite nextgroup=@virataGrpIdents
+syn cluster virataGrpCfgs contains=virataCfgStatement,virataCfgFileDef,virataCfgSizeDef,virataCfgNumberDef,virataCfgMacAddrDef,virataInMacAddr
+
+
+
+" PreProcessor Instructions:
+" Defines
+syn match virataDefine "^\s*\(Un\)\=Set\>" skipwhite nextgroup=@virataGrpIdents
+syn match virataInclude "^\s*Include\>" skipwhite nextgroup=@virataGrpFileIdents
+syn match virataDefSubstError "[^$]\$"lc=1
+syn match virataDefSubstError "\$\(\w\|{\(.\{-}}\)\=\)"
+syn case match
+syn match virataDefSubst "\$\(\d\|[DINORS]\|{\I\i\{-}\(\-\i\{-1,}\)*}\)"
+syn case ignore
+" Conditionals
+syn cluster virataGrpCntnPreCon contains=ALLBUT,@virataGrpInComments,@virataGrpFileIdents,@virataGrpInStatmnts
+syn region virataPreConDef transparent matchgroup=virataPreCondit start="^\s*If\>" end="^\s*Endif\>" contains=@virataGrpCntnPreCon
+syn match virataPreCondit contained "^\s*Else\(\s\+If\)\=\>"
+syn region virataPreConDef transparent matchgroup=virataPreCondit start="^\s*ForEach\>" end="^\s*Done\>" contains=@virataGrpCntnPreCon
+" Pre-Processors
+syn region virataPreProc start="^\s*Error\>" start="^\s*Warning\>" oneline end="$" contains=@virataGrpConstants,@virataGrpDefSubsts
+syn cluster virataGrpDefSubsts contains=virataDefSubstError,virataDefSubst
+syn cluster virataGrpPreProcs contains=@virataGrpDefSubsts,virataDefine,virataInclude,virataPreConDef,virataPreCondit,virataPreProc
+
+
+" Synchronize Syntax:
+syn sync clear
+syn sync minlines=50 "for multiple region nesting
+
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later : only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_virata_syntax_inits")
+ if version < 508
+ let did_virata_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Sub Links:
+ HiLink virataDefSubstError virataPreProcError
+ HiLink virataDefSubst virataPreProc
+ HiLink virataInAlter virataOperator
+ HiLink virataInExec virataOperator
+ HiLink virataInExport virataOperator
+ HiLink virataInImport virataOperator
+ HiLink virataInInstance virataOperator
+ HiLink virataInMake virataOperator
+ HiLink virataInModule virataOperator
+ HiLink virataInProcess virataOperator
+ HiLink virataInMacAddr virataHexNumber
+
+ " Comment Group:
+ HiLink virataComment Comment
+ HiLink virataSpclComment SpecialComment
+ HiLink virataInCommentTodo Todo
+
+ " Constant Group:
+ HiLink virataString String
+ HiLink virataStringError Error
+ HiLink virataCharacter Character
+ HiLink virataSpclChar Special
+ HiLink virataDecNumber Number
+ HiLink virataHexNumber Number
+ HiLink virataSizeNumber Number
+ HiLink virataNumberError Error
+
+ " Identifier Group:
+ HiLink virataIdentError Error
+
+ " PreProc Group:
+ HiLink virataPreProc PreProc
+ HiLink virataDefine Define
+ HiLink virataInclude Include
+ HiLink virataPreCondit PreCondit
+ HiLink virataPreProcError Error
+ HiLink virataPreProcWarn Todo
+
+ " Directive Group:
+ HiLink virataStatement Statement
+ HiLink virataCfgStatement Statement
+ HiLink virataOperator Operator
+ HiLink virataDirective Keyword
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "virata"
+
+" vim:ts=8:sw=2:noet:
diff --git a/runtime/syntax/vmasm.vim b/runtime/syntax/vmasm.vim
new file mode 100644
index 000000000..85d044125
--- /dev/null
+++ b/runtime/syntax/vmasm.vim
@@ -0,0 +1,251 @@
+" Vim syntax file
+" Language: (VAX) Macro Assembly
+" Maintainer: Tom Uijldert <tom.uijldert [at] cmg.nl>
+" Last change: 2004 May 16
+"
+" This is incomplete. Feel free to contribute...
+"
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Partial list of register symbols
+syn keyword vmasmReg r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12
+syn keyword vmasmReg ap fp sp pc iv dv
+
+" All matches - order is important!
+syn keyword vmasmOpcode adawi adwc ashl ashq bitb bitw bitl decb decw decl
+syn keyword vmasmOpcode ediv emul incb incw incl mcomb mcomw mcoml
+syn keyword vmasmOpcode movzbw movzbl movzwl popl pushl rotl sbwc
+syn keyword vmasmOpcode cmpv cmpzv cmpc3 cmpc5 locc matchc movc3 movc5
+syn keyword vmasmOpcode movtc movtuc scanc skpc spanc crc extv extzv
+syn keyword vmasmOpcode ffc ffs insv aobleq aoblss bbc bbs bbcci bbssi
+syn keyword vmasmOpcode blbc blbs brb brw bsbb bsbw caseb casew casel
+syn keyword vmasmOpcode jmp jsb rsb sobgeq sobgtr callg calls ret
+syn keyword vmasmOpcode bicpsw bispsw bpt halt index movpsl nop popr pushr xfc
+syn keyword vmasmOpcode insqhi insqti insque remqhi remqti remque
+syn keyword vmasmOpcode addp4 addp6 ashp cmpp3 cmpp4 cvtpl cvtlp cvtps cvtpt
+syn keyword vmasmOpcode cvtsp cvttp divp movp mulp subp4 subp6 editpc
+syn keyword vmasmOpcode prober probew rei ldpctx svpctx mfpr mtpr bugw bugl
+syn keyword vmasmOpcode vldl vldq vgathl vgathq vstl vstq vscatl vscatq
+syn keyword vmasmOpcode vvcvt iota mfvp mtvp vsync
+syn keyword vmasmOpcode beql[u] bgtr[u] blss[u]
+syn match vmasmOpcode "\<add[bwlfdgh][23]\>"
+syn match vmasmOpcode "\<bi[cs][bwl][23]\>"
+syn match vmasmOpcode "\<clr[bwlqofdgh]\>"
+syn match vmasmOpcode "\<cmp[bwlfdgh]\>"
+syn match vmasmOpcode "\<cvt[bwlfdgh][bwlfdgh]\>"
+syn match vmasmOpcode "\<cvtr[fdgh]l\>"
+syn match vmasmOpcode "\<div[bwlfdgh][23]\>"
+syn match vmasmOpcode "\<emod[fdgh]\>"
+syn match vmasmOpcode "\<mneg[bwlfdgh]\>"
+syn match vmasmOpcode "\<mov[bwlqofdgh]\>"
+syn match vmasmOpcode "\<mul[bwlfdgh][23]\>"
+syn match vmasmOpcode "\<poly[fdgh]\>"
+syn match vmasmOpcode "\<sub[bwlfdgh][23]\>"
+syn match vmasmOpcode "\<tst[bwlfdgh]\>"
+syn match vmasmOpcode "\<xor[bwl][23]\>"
+syn match vmasmOpcode "\<mova[bwlfqdgho]\>"
+syn match vmasmOpcode "\<push[bwlfqdgho]\>"
+syn match vmasmOpcode "\<acb[bwlfgdh]\>"
+syn match vmasmOpcode "\<b[lng]equ\=\>"
+syn match vmasmOpcode "\<b[cv][cs]\>"
+syn match vmasmOpcode "\<bb[cs][cs]\>"
+syn match vmasmOpcode "\<v[vs]add[lfdg]\>"
+syn match vmasmOpcode "\<v[vs]cmp[lfdg]\>"
+syn match vmasmOpcode "\<v[vs]div[fdg]\>"
+syn match vmasmOpcode "\<v[vs]mul[lfdg]\>"
+syn match vmasmOpcode "\<v[vs]sub[lfdg]\>"
+syn match vmasmOpcode "\<v[vs]bi[cs]l\>"
+syn match vmasmOpcode "\<v[vs]xorl\>"
+syn match vmasmOpcode "\<v[vs]merge\>"
+syn match vmasmOpcode "\<v[vs]s[rl]ll\>"
+
+" Various number formats
+syn match vmasmdecNumber "[+-]\=[0-9]\+\>"
+syn match vmasmdecNumber "^d[0-9]\+\>"
+syn match vmasmhexNumber "^x[0-9a-f]\+\>"
+syn match vmasmoctNumber "^o[0-7]\+\>"
+syn match vmasmbinNumber "^b[01]\+\>"
+syn match vmasmfloatNumber "[-+]\=[0-9]\+E[-+]\=[0-9]\+"
+syn match vmasmfloatNumber "[-+]\=[0-9]\+\.[0-9]*\(E[-+]\=[0-9]\+\)\="
+
+" Valid labels
+syn match vmasmLabel "^[a-z_$.][a-z0-9_$.]\{,30}::\="
+syn match vmasmLabel "\<[0-9]\{1,5}\$:\=" " Local label
+
+" Character string constants
+" Too complex really. Could be "<...>" but those could also be
+" expressions. Don't know how to handle chosen delimiters
+" ("^<sep>...<sep>")
+" syn region vmasmString start="<" end=">" oneline
+
+" Operators
+syn match vmasmOperator "[-+*/@&!\\]"
+syn match vmasmOperator "="
+syn match vmasmOperator "==" " Global assignment
+syn match vmasmOperator "%length(.*)"
+syn match vmasmOperator "%locate(.*)"
+syn match vmasmOperator "%extract(.*)"
+syn match vmasmOperator "^[amfc]"
+syn match vmasmOperator "[bwlg]^"
+
+syn match vmasmOperator "\<\(not_\)\=equal\>"
+syn match vmasmOperator "\<less_equal\>"
+syn match vmasmOperator "\<greater\(_equal\)\=\>"
+syn match vmasmOperator "\<less_than\>"
+syn match vmasmOperator "\<\(not_\)\=defined\>"
+syn match vmasmOperator "\<\(not_\)\=blank\>"
+syn match vmasmOperator "\<identical\>"
+syn match vmasmOperator "\<different\>"
+syn match vmasmOperator "\<eq\>"
+syn match vmasmOperator "\<[gl]t\>"
+syn match vmasmOperator "\<n\=df\>"
+syn match vmasmOperator "\<n\=b\>"
+syn match vmasmOperator "\<idn\>"
+syn match vmasmOperator "\<[nlg]e\>"
+syn match vmasmOperator "\<dif\>"
+
+" Special items for comments
+syn keyword vmasmTodo contained todo
+
+" Comments
+syn match vmasmComment ";.*" contains=vmasmTodo
+
+" Include
+syn match vmasmInclude "\.library\>"
+
+" Macro definition
+syn match vmasmMacro "\.macro\>"
+syn match vmasmMacro "\.mexit\>"
+syn match vmasmMacro "\.endm\>"
+syn match vmasmMacro "\.mcall\>"
+syn match vmasmMacro "\.mdelete\>"
+
+" Conditional assembly
+syn match vmasmPreCond "\.iff\=\>"
+syn match vmasmPreCond "\.if_false\>"
+syn match vmasmPreCond "\.iftf\=\>"
+syn match vmasmPreCond "\.if_true\(_false\)\=\>"
+syn match vmasmPreCond "\.iif\>"
+
+" Loop control
+syn match vmasmRepeat "\.irpc\=\>"
+syn match vmasmRepeat "\.repeat\>"
+syn match vmasmRepeat "\.rept\>"
+syn match vmasmRepeat "\.endr\>"
+
+" Directives
+syn match vmasmDirective "\.address\>"
+syn match vmasmDirective "\.align\>"
+syn match vmasmDirective "\.asci[cdiz]\>"
+syn match vmasmDirective "\.blk[abdfghloqw]\>"
+syn match vmasmDirective "\.\(signed_\)\=byte\>"
+syn match vmasmDirective "\.\(no\)\=cross\>"
+syn match vmasmDirective "\.debug\>"
+syn match vmasmDirective "\.default displacement\>"
+syn match vmasmDirective "\.[dfgh]_floating\>"
+syn match vmasmDirective "\.disable\>"
+syn match vmasmDirective "\.double\>"
+syn match vmasmDirective "\.dsabl\>"
+syn match vmasmDirective "\.enable\=\>"
+syn match vmasmDirective "\.endc\=\>"
+syn match vmasmDirective "\.entry\>"
+syn match vmasmDirective "\.error\>"
+syn match vmasmDirective "\.even\>"
+syn match vmasmDirective "\.external\>"
+syn match vmasmDirective "\.extrn\>"
+syn match vmasmDirective "\.float\>"
+syn match vmasmDirective "\.globa\=l\>"
+syn match vmasmDirective "\.ident\>"
+syn match vmasmDirective "\.link\>"
+syn match vmasmDirective "\.list\>"
+syn match vmasmDirective "\.long\>"
+syn match vmasmDirective "\.mask\>"
+syn match vmasmDirective "\.narg\>"
+syn match vmasmDirective "\.nchr\>"
+syn match vmasmDirective "\.nlist\>"
+syn match vmasmDirective "\.ntype\>"
+syn match vmasmDirective "\.octa\>"
+syn match vmasmDirective "\.odd\>"
+syn match vmasmDirective "\.opdef\>"
+syn match vmasmDirective "\.packed\>"
+syn match vmasmDirective "\.page\>"
+syn match vmasmDirective "\.print\>"
+syn match vmasmDirective "\.psect\>"
+syn match vmasmDirective "\.quad\>"
+syn match vmasmDirective "\.ref[1248]\>"
+syn match vmasmDirective "\.ref16\>"
+syn match vmasmDirective "\.restore\(_psect\)\=\>"
+syn match vmasmDirective "\.save\(_psect\)\=\>"
+syn match vmasmDirective "\.sbttl\>"
+syn match vmasmDirective "\.\(no\)\=show\>"
+syn match vmasmDirective "\.\(sub\)\=title\>"
+syn match vmasmDirective "\.transfer\>"
+syn match vmasmDirective "\.warn\>"
+syn match vmasmDirective "\.weak\>"
+syn match vmasmDirective "\.\(signed_\)\=word\>"
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_macro_syntax_inits")
+ if version < 508
+ let did_macro_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " The default methods for highlighting. Can be overridden later
+ " Comment Constant Error Identifier PreProc Special Statement Todo Type
+ "
+ " Constant Boolean Character Number String
+ " Identifier Function
+ " PreProc Define Include Macro PreCondit
+ " Special Debug Delimiter SpecialChar SpecialComment Tag
+ " Statement Conditional Exception Keyword Label Operator Repeat
+ " Type StorageClass Structure Typedef
+
+ HiLink vmasmComment Comment
+ HiLink vmasmTodo Todo
+
+ HiLink vmasmhexNumber Number " Constant
+ HiLink vmasmoctNumber Number " Constant
+ HiLink vmasmbinNumber Number " Constant
+ HiLink vmasmdecNumber Number " Constant
+ HiLink vmasmfloatNumber Number " Constant
+
+" HiLink vmasmString String " Constant
+
+ HiLink vmasmReg Identifier
+ HiLink vmasmOperator Identifier
+
+ HiLink vmasmInclude Include " PreProc
+ HiLink vmasmMacro Macro " PreProc
+ " HiLink vmasmMacroParam Keyword " Statement
+
+ HiLink vmasmDirective Special
+ HiLink vmasmPreCond Special
+
+
+ HiLink vmasmOpcode Statement
+ HiLink vmasmCond Conditional " Statement
+ HiLink vmasmRepeat Repeat " Statement
+
+ HiLink vmasmLabel Type
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vmasm"
+
+" vim: ts=8 sw=2
diff --git a/runtime/syntax/vrml.vim b/runtime/syntax/vrml.vim
new file mode 100644
index 000000000..651a39b91
--- /dev/null
+++ b/runtime/syntax/vrml.vim
@@ -0,0 +1,239 @@
+" Vim syntax file
+" Language: VRML97
+" Modified from: VRML 1.0C by David Brown <dbrown@cgs.c4.gmeds.com>
+" Maintainer: Gregory Seidman <gseidman@acm.org>
+" URL: http://www.cs.brown.edu/~gss/vim/syntax/vrml.vim
+" Last change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" keyword definitions
+
+syn keyword VRMLFields ambientIntensity appearance attenuation
+syn keyword VRMLFields autoOffset avatarSize axisOfRotation backUrl
+syn keyword VRMLFields bboxCenter bboxSize beamWidth beginCap
+syn keyword VRMLFields bottom bottomRadius bottomUrl ccw center
+syn keyword VRMLFields children choice collide color colorIndex
+syn keyword VRMLFields colorPerVertex convex coord coordIndex
+syn keyword VRMLFields creaseAngle crossSection cutOffAngle
+syn keyword VRMLFields cycleInterval description diffuseColor
+syn keyword VRMLFields directOutput direction diskAngle
+syn keyword VRMLFields emissiveColor enabled endCap family
+syn keyword VRMLFields fieldOfView fogType fontStyle frontUrl
+syn keyword VRMLFields geometry groundAngle groundColor headlight
+syn keyword VRMLFields height horizontal info intensity jump
+syn keyword VRMLFields justify key keyValue language leftToRight
+syn keyword VRMLFields leftUrl length level location loop material
+syn keyword VRMLFields maxAngle maxBack maxExtent maxFront
+syn keyword VRMLFields maxPosition minAngle minBack minFront
+syn keyword VRMLFields minPosition mustEvaluate normal normalIndex
+syn keyword VRMLFields normalPerVertex offset on orientation
+syn keyword VRMLFields parameter pitch point position priority
+syn keyword VRMLFields proxy radius range repeatS repeatT rightUrl
+syn keyword VRMLFields rotation scale scaleOrientation shininess
+syn keyword VRMLFields side size skyAngle skyColor solid source
+syn keyword VRMLFields spacing spatialize specularColor speed spine
+syn keyword VRMLFields startTime stopTime string style texCoord
+syn keyword VRMLFields texCoordIndex texture textureTransform title
+syn keyword VRMLFields top topToBottom topUrl translation
+syn keyword VRMLFields transparency type url vector visibilityLimit
+syn keyword VRMLFields visibilityRange whichChoice xDimension
+syn keyword VRMLFields xSpacing zDimension zSpacing
+syn match VRMLFields "\<[A-Za-z_][A-Za-z0-9_]*\>" contains=VRMLComment,VRMLProtos,VRMLfTypes
+" syn match VRMLFields "\<[A-Za-z_][A-Za-z0-9_]*\>\(,\|\s\)*\(#.*$\)*\<IS\>\(#.*$\)*\(,\|\s\)*\<[A-Za-z_][A-Za-z0-9_]*\>\(,\|\s\)*\(#.*$\)*" contains=VRMLComment,VRMLProtos
+" syn region VRMLFields start="\<[A-Za-z_][A-Za-z0-9_]*\>" end=+\(,\|#\|\s\)+me=e-1 contains=VRMLComment,VRMLProtos
+
+syn keyword VRMLEvents addChildren ambientIntensity_changed
+syn keyword VRMLEvents appearance_changed attenuation_changed
+syn keyword VRMLEvents autoOffset_changed avatarSize_changed
+syn keyword VRMLEvents axisOfRotation_changed backUrl_changed
+syn keyword VRMLEvents beamWidth_changed bindTime bottomUrl_changed
+syn keyword VRMLEvents center_changed children_changed
+syn keyword VRMLEvents choice_changed collideTime collide_changed
+syn keyword VRMLEvents color_changed coord_changed
+syn keyword VRMLEvents cutOffAngle_changed cycleInterval_changed
+syn keyword VRMLEvents cycleTime description_changed
+syn keyword VRMLEvents diffuseColor_changed direction_changed
+syn keyword VRMLEvents diskAngle_changed duration_changed
+syn keyword VRMLEvents emissiveColor_changed enabled_changed
+syn keyword VRMLEvents enterTime exitTime fogType_changed
+syn keyword VRMLEvents fontStyle_changed fraction_changed
+syn keyword VRMLEvents frontUrl_changed geometry_changed
+syn keyword VRMLEvents groundAngle_changed headlight_changed
+syn keyword VRMLEvents hitNormal_changed hitPoint_changed
+syn keyword VRMLEvents hitTexCoord_changed intensity_changed
+syn keyword VRMLEvents isActive isBound isOver jump_changed
+syn keyword VRMLEvents keyValue_changed key_changed leftUrl_changed
+syn keyword VRMLEvents length_changed level_changed
+syn keyword VRMLEvents location_changed loop_changed
+syn keyword VRMLEvents material_changed maxAngle_changed
+syn keyword VRMLEvents maxBack_changed maxExtent_changed
+syn keyword VRMLEvents maxFront_changed maxPosition_changed
+syn keyword VRMLEvents minAngle_changed minBack_changed
+syn keyword VRMLEvents minFront_changed minPosition_changed
+syn keyword VRMLEvents normal_changed offset_changed on_changed
+syn keyword VRMLEvents orientation_changed parameter_changed
+syn keyword VRMLEvents pitch_changed point_changed position_changed
+syn keyword VRMLEvents priority_changed radius_changed
+syn keyword VRMLEvents removeChildren rightUrl_changed
+syn keyword VRMLEvents rotation_changed scaleOrientation_changed
+syn keyword VRMLEvents scale_changed set_ambientIntensity
+syn keyword VRMLEvents set_appearance set_attenuation
+syn keyword VRMLEvents set_autoOffset set_avatarSize
+syn keyword VRMLEvents set_axisOfRotation set_backUrl set_beamWidth
+syn keyword VRMLEvents set_bind set_bottomUrl set_center
+syn keyword VRMLEvents set_children set_choice set_collide
+syn keyword VRMLEvents set_color set_colorIndex set_coord
+syn keyword VRMLEvents set_coordIndex set_crossSection
+syn keyword VRMLEvents set_cutOffAngle set_cycleInterval
+syn keyword VRMLEvents set_description set_diffuseColor
+syn keyword VRMLEvents set_direction set_diskAngle
+syn keyword VRMLEvents set_emissiveColor set_enabled set_fogType
+syn keyword VRMLEvents set_fontStyle set_fraction set_frontUrl
+syn keyword VRMLEvents set_geometry set_groundAngle set_headlight
+syn keyword VRMLEvents set_height set_intensity set_jump set_key
+syn keyword VRMLEvents set_keyValue set_leftUrl set_length
+syn keyword VRMLEvents set_level set_location set_loop set_material
+syn keyword VRMLEvents set_maxAngle set_maxBack set_maxExtent
+syn keyword VRMLEvents set_maxFront set_maxPosition set_minAngle
+syn keyword VRMLEvents set_minBack set_minFront set_minPosition
+syn keyword VRMLEvents set_normal set_normalIndex set_offset set_on
+syn keyword VRMLEvents set_orientation set_parameter set_pitch
+syn keyword VRMLEvents set_point set_position set_priority
+syn keyword VRMLEvents set_radius set_rightUrl set_rotation
+syn keyword VRMLEvents set_scale set_scaleOrientation set_shininess
+syn keyword VRMLEvents set_size set_skyAngle set_skyColor
+syn keyword VRMLEvents set_source set_specularColor set_speed
+syn keyword VRMLEvents set_spine set_startTime set_stopTime
+syn keyword VRMLEvents set_string set_texCoord set_texCoordIndex
+syn keyword VRMLEvents set_texture set_textureTransform set_topUrl
+syn keyword VRMLEvents set_translation set_transparency set_type
+syn keyword VRMLEvents set_url set_vector set_visibilityLimit
+syn keyword VRMLEvents set_visibilityRange set_whichChoice
+syn keyword VRMLEvents shininess_changed size_changed
+syn keyword VRMLEvents skyAngle_changed skyColor_changed
+syn keyword VRMLEvents source_changed specularColor_changed
+syn keyword VRMLEvents speed_changed startTime_changed
+syn keyword VRMLEvents stopTime_changed string_changed
+syn keyword VRMLEvents texCoord_changed textureTransform_changed
+syn keyword VRMLEvents texture_changed time topUrl_changed
+syn keyword VRMLEvents touchTime trackPoint_changed
+syn keyword VRMLEvents translation_changed transparency_changed
+syn keyword VRMLEvents type_changed url_changed value_changed
+syn keyword VRMLEvents vector_changed visibilityLimit_changed
+syn keyword VRMLEvents visibilityRange_changed whichChoice_changed
+syn region VRMLEvents start="\S+[^0-9]+\.[A-Za-z_]+"ms=s+1 end="\(,\|$\|\s\)"me=e-1
+
+syn keyword VRMLNodes Anchor Appearance AudioClip Background
+syn keyword VRMLNodes Billboard Box Collision Color
+syn keyword VRMLNodes ColorInterpolator Cone Coordinate
+syn keyword VRMLNodes CoordinateInterpolator Cylinder
+syn keyword VRMLNodes CylinderSensor DirectionalLight
+syn keyword VRMLNodes ElevationGrid Extrusion Fog FontStyle
+syn keyword VRMLNodes Group ImageTexture IndexedFaceSet
+syn keyword VRMLNodes IndexedLineSet Inline LOD Material
+syn keyword VRMLNodes MovieTexture NavigationInfo Normal
+syn keyword VRMLNodes NormalInterpolator OrientationInterpolator
+syn keyword VRMLNodes PixelTexture PlaneSensor PointLight
+syn keyword VRMLNodes PointSet PositionInterpolator
+syn keyword VRMLNodes ProximitySensor ScalarInterpolator
+syn keyword VRMLNodes Script Shape Sound Sphere SphereSensor
+syn keyword VRMLNodes SpotLight Switch Text TextureCoordinate
+syn keyword VRMLNodes TextureTransform TimeSensor TouchSensor
+syn keyword VRMLNodes Transform Viewpoint VisibilitySensor
+syn keyword VRMLNodes WorldInfo
+
+" the following line doesn't catch <node><newline><openbrace> since \n
+" doesn't match as an atom yet :-(
+syn match VRMLNodes "[A-Za-z_][A-Za-z0-9_]*\(,\|\s\)*{"me=e-1
+syn region VRMLNodes start="\<EXTERNPROTO\>\(,\|\s\)*[A-Za-z_]"ms=e start="\<EXTERNPROTO\>\(,\|\s\)*" end="[\s]*\["me=e-1 contains=VRMLProtos,VRMLComment
+syn region VRMLNodes start="PROTO\>\(,\|\s\)*[A-Za-z_]"ms=e start="PROTO\>\(,\|\s\)*" end="[\s]*\["me=e-1 contains=VRMLProtos,VRMLComment
+
+syn keyword VRMLTypes SFBool SFColor MFColor SFFloat MFFloat
+syn keyword VRMLTypes SFImage SFInt32 MFInt32 SFNode MFNode
+syn keyword VRMLTypes SFRotation MFRotation SFString MFString
+syn keyword VRMLTypes SFTime MFTime SFVec2f MFVec2f SFVec3f MFVec3f
+
+syn keyword VRMLfTypes field exposedField eventIn eventOut
+
+syn keyword VRMLValues TRUE FALSE NULL
+
+syn keyword VRMLProtos contained EXTERNPROTO PROTO IS
+
+syn keyword VRMLRoutes contained ROUTE TO
+
+if version >= 502
+"containment!
+ syn include @jscript $VIMRUNTIME/syntax/javascript.vim
+ syn region VRMLjScriptString contained start=+"\(\(javascript\)\|\(vrmlscript\)\|\(ecmascript\)\):+ms=e+1 skip=+\\\\\|\\"+ end=+"+me=e-1 contains=@jscript
+endif
+
+" match definitions.
+syn match VRMLSpecial contained "\\[0-9][0-9][0-9]\|\\."
+syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=VRMLSpecial,VRMLjScriptString
+syn match VRMLCharacter "'[^\\]'"
+syn match VRMLSpecialCharacter "'\\.'"
+syn match VRMLNumber "[-+]\=\<[0-9]\+\(\.[0-9]\+\)\=\([eE]\{1}[-+]\=[0-9]\+\)\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn match VRMLNumber "0[xX][0-9a-fA-F]\+\>"
+syn match VRMLComment "#.*$"
+
+" newlines should count as whitespace, but they can't be matched yet :-(
+syn region VRMLRouteNode start="[^O]TO\(,\|\s\)*" end="\."me=e-1 contains=VRMLRoutes,VRMLComment
+syn region VRMLRouteNode start="ROUTE\(,\|\s\)*" end="\."me=e-1 contains=VRMLRoutes,VRMLComment
+syn region VRMLInstName start="DEF\>"hs=e+1 skip="DEF\(,\|\s\)*" end="[A-Za-z0-9_]\(\s\|$\|,\)"me=e contains=VRMLInstances,VRMLComment
+syn region VRMLInstName start="USE\>"hs=e+1 skip="USE\(,\|\s\)*" end="[A-Za-z0-9_]\(\s\|$\|,\)"me=e contains=VRMLInstances,VRMLComment
+
+syn keyword VRMLInstances contained DEF USE
+syn sync minlines=1
+
+if version >= 600
+"FOLDS!
+ syn sync fromstart
+ setlocal foldmethod=syntax
+ syn region braceFold start="{" end="}" transparent fold contains=TOP
+ syn region bracketFold start="\[" end="]" transparent fold contains=TOP
+ syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ fold contains=VRMLSpecial,VRMLjScriptString
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_VRML_syntax_inits")
+ if version < 508
+ let did_VRML_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink VRMLCharacter VRMLString
+ HiLink VRMLSpecialCharacter VRMLSpecial
+ HiLink VRMLNumber VRMLString
+ HiLink VRMLValues VRMLString
+ HiLink VRMLString String
+ HiLink VRMLSpecial Special
+ HiLink VRMLComment Comment
+ HiLink VRMLNodes Statement
+ HiLink VRMLFields Type
+ HiLink VRMLEvents Type
+ HiLink VRMLfTypes LineNr
+" hi VRMLfTypes ctermfg=6 guifg=Brown
+ HiLink VRMLInstances PreCondit
+ HiLink VRMLRoutes PreCondit
+ HiLink VRMLProtos PreProc
+ HiLink VRMLRouteNode Identifier
+ HiLink VRMLInstName Identifier
+ HiLink VRMLTypes Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vrml"
+
+" vim: ts=8
diff --git a/runtime/syntax/vsejcl.vim b/runtime/syntax/vsejcl.vim
new file mode 100644
index 000000000..f4f00c65e
--- /dev/null
+++ b/runtime/syntax/vsejcl.vim
@@ -0,0 +1,49 @@
+" Vim syntax file
+" Language: JCL job control language - DOS/VSE
+" Maintainer: Davyd Ondrejko <david.ondrejko@safelite.com>
+" URL:
+" Last change: 2001 May 10
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" tags
+syn keyword vsejclKeyword DLBL EXEC JOB ASSGN EOJ
+syn keyword vsejclField JNM CLASS DISP USER SYSID JSEP SIZE
+syn keyword vsejclField VSAM
+syn region vsejclComment start="^/\*" end="$"
+syn region vsejclComment start="^[\* ]\{}$" end="$"
+syn region vsejclMisc start="^ " end="$" contains=Jparms
+syn match vsejclString /'.\{-}'/
+syn match vsejclParms /(.\{-})/ contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_vsejcl_syntax")
+ if version < 508
+ let did_vsejcl_syntax = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink vsejclComment Comment
+ HiLink vsejclField Type
+ HiLink vsejclKeyword Statement
+ HiLink vsejclObject Constant
+ HiLink vsejclString Constant
+ HiLink vsejclMisc Special
+ HiLink vsejclParms Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "vsejcl"
+
+" vim: ts=4
diff --git a/runtime/syntax/wdiff.vim b/runtime/syntax/wdiff.vim
new file mode 100644
index 000000000..9cd061181
--- /dev/null
+++ b/runtime/syntax/wdiff.vim
@@ -0,0 +1,43 @@
+" Vim syntax file
+" Language: wDiff (wordwise diff)
+" Maintainer: Gerfried Fuchs <alfie@ist.org>
+" Last Change: 25 Apr 2001
+" URL: http://alfie.ist.org/vim/syntax/wdiff.vim
+"
+" Comments are very welcome - but please make sure that you are commenting on
+" the latest version of this file.
+" SPAM is _NOT_ welcome - be ready to be reported!
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+syn region wdiffOld start=+\[-+ end=+-]+
+syn region wdiffNew start="{+" end="+}"
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_wdiff_syn_inits")
+ let did_wdiff_syn_inits = 1
+ if version < 508
+ let did_wdiff_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink wdiffOld Special
+ HiLink wdiffNew Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "wdiff"
diff --git a/runtime/syntax/web.vim b/runtime/syntax/web.vim
new file mode 100644
index 000000000..f7a7fdfdc
--- /dev/null
+++ b/runtime/syntax/web.vim
@@ -0,0 +1,39 @@
+" Vim syntax file
+" Language: WEB
+" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
+" Last Change: April 30, 2001
+
+" Details of the WEB language can be found in the article by Donald E. Knuth,
+" "The WEB System of Structured Documentation", included as "webman.tex" in
+" the standard WEB distribution, available for anonymous ftp at
+" ftp://labrea.stanford.edu/pub/tex/web/.
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Although WEB is the ur-language for the "Literate Programming" paradigm,
+" we base this syntax file on the modern superset, CWEB. Note: This shortcut
+" may introduce some illegal constructs, e.g., CWEB's "@c" does _not_ start a
+" code section in WEB. Anyway, I'm not a WEB programmer.
+if version < 600
+ source <sfile>:p:h/cweb.vim
+else
+ runtime! syntax/cweb.vim
+ unlet b:current_syntax
+endif
+
+" Replace C/C++ syntax by Pascal syntax.
+syntax include @webIncludedC <sfile>:p:h/pascal.vim
+
+" Double-@ means single-@, anywhere in the WEB source (as in CWEB).
+" Don't misinterpret "@'" as the start of a Pascal string.
+syntax match webIgnoredStuff "@[@']"
+
+let b:current_syntax = "web"
+
+" vim: ts=8
diff --git a/runtime/syntax/webmacro.vim b/runtime/syntax/webmacro.vim
new file mode 100644
index 000000000..3b863f7c3
--- /dev/null
+++ b/runtime/syntax/webmacro.vim
@@ -0,0 +1,82 @@
+" WebMacro syntax file
+" Language: WebMacro
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/webmacro.vim
+" Last Change: 2003 May 11
+
+" webmacro is a nice little language that you should
+" check out if you use java servlets.
+" webmacro: http://www.webmacro.org
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'webmacro'
+endif
+
+
+if version < 600
+ source <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+ unlet b:current_syntax
+endif
+
+syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment
+
+syn match webmacroVariable "\$[a-zA-Z0-9.()]*;\="
+syn match webmacroNumber "[-+]\=\d\+[lL]\=" contained
+syn keyword webmacroBoolean true false contained
+syn match webmacroSpecial "\\." contained
+syn region webmacroString contained start=+"+ end=+"+ contains=webmacroSpecial,webmacroVariable
+syn region webmacroString contained start=+'+ end=+'+ contains=webmacroSpecial,webmacroVariable
+syn region webmacroList contained matchgroup=Structure start="\[" matchgroup=Structure end="\]" contains=webmacroString,webmacroVariable,webmacroNumber,webmacroBoolean,webmacroList
+
+syn region webmacroIf start="#if" start="#else" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
+syn region webmacroForeach start="#foreach" end="{"me=e-1 contains=webmacroVariable,webmacroNumber,webmacroString,webmacroBoolean,webmacroList nextgroup=webmacroBraces
+syn match webmacroSet "#set .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
+syn match webmacroInclude "#include .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
+syn match webmacroParse "#parse .*$" contains=webmacroVariable,webmacroNumber,webmacroNumber,webmacroBoolean,webmacroString,webmacroList
+syn region webmacroUse matchgroup=PreProc start="#use .*" matchgroup=PreProc end="^-.*" contains=webmacroHash,@HtmlTop
+syn region webmacroBraces matchgroup=Structure start="{" matchgroup=Structure end="}" contained transparent
+syn match webmacroBracesError "[{}]"
+syn match webmacroComment "##.*$"
+syn match webmacroHash "[#{}\$]" contained
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_webmacro_syn_inits")
+ if version < 508
+ let did_webmacro_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink webmacroComment CommentTitle
+ HiLink webmacroVariable PreProc
+ HiLink webmacroIf webmacroStatement
+ HiLink webmacroForeach webmacroStatement
+ HiLink webmacroSet webmacroStatement
+ HiLink webmacroInclude webmacroStatement
+ HiLink webmacroParse webmacroStatement
+ HiLink webmacroStatement Function
+ HiLink webmacroNumber Number
+ HiLink webmacroBoolean Boolean
+ HiLink webmacroSpecial Special
+ HiLink webmacroString String
+ HiLink webmacroBracesError Error
+ delcommand HiLink
+endif
+
+let b:current_syntax = "webmacro"
+
+if main_syntax == 'webmacro'
+ unlet main_syntax
+endif
diff --git a/runtime/syntax/wget.vim b/runtime/syntax/wget.vim
new file mode 100644
index 000000000..801f76d8d
--- /dev/null
+++ b/runtime/syntax/wget.vim
@@ -0,0 +1,159 @@
+" Wget syntax file
+" Filename: wget.vim
+" Language: Wget configuration file ( /etc/wgetrc ~/.wgetrc )
+" Maintainer: Doug Kearns <djkea2@mugca.its.monash.edu.au>
+" URL: http://mugca.its.monash.edu.au/~djkea2/vim/syntax/wget.vim
+" Last Change: 2003 May 11
+
+" TODO: all commands are actually underscore and hyphen insensitive, though
+" they are normally named as listed below
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match wgetComment "^\s*#.*$" contains=wgetTodo
+
+syn keyword wgetTodo TODO NOTE FIXME XXX contained
+
+syn match wgetAssignment "^\s*[A-Za-z_-]\+\s*=\s*.*$" contains=wgetCommand,wgetAssignmentOperator,wgetString,wgetBoolean,wgetNumber,wgetValue,wgetQuota
+
+syn match wgetAssignmentOperator "=" contained
+
+syn region wgetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
+syn region wgetString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
+
+" Make this a match so that always_rest matches properly
+syn case ignore
+syn match wgetBoolean "\<on\|off\|always\|never\|1\|0\>" contained
+syn case match
+
+syn match wgetNumber "\<\d\+\|inf\>" contained
+
+syn match wgetQuota "\<\d\+[kKmM]\?\>" contained
+
+syn case ignore
+syn keyword wgetValue default binary mega giga micro contained
+syn case match
+
+syn case ignore
+syn match wgetCommand "^\s*accept" contained
+syn match wgetCommand "^\s*add[-_]\=hostdir" contained
+syn match wgetCommand "^\s*always[-_]\=rest" contained
+syn match wgetCommand "^\s*background" contained
+syn match wgetCommand "^\s*backup[-_]\=converted" contained
+syn match wgetCommand "^\s*backups" contained
+syn match wgetCommand "^\s*base" contained
+syn match wgetCommand "^\s*bind[-_]\=address" contained
+syn match wgetCommand "^\s*cache" contained
+syn match wgetCommand "^\s*continue" contained
+syn match wgetCommand "^\s*convert[-_]\=links" contained
+syn match wgetCommand "^\s*cookies" contained
+syn match wgetCommand "^\s*cut[-_]\=dirs" contained
+syn match wgetCommand "^\s*debug" contained
+syn match wgetCommand "^\s*delete[-_]\=after" contained
+syn match wgetCommand "^\s*dir[-_]\=prefix" contained
+syn match wgetCommand "^\s*dir[-_]\=struct" contained
+syn match wgetCommand "^\s*domains" contained
+syn match wgetCommand "^\s*dot[-_]\=bytes" contained
+syn match wgetCommand "^\s*dots[-_]\=in[-_]\=line" contained
+syn match wgetCommand "^\s*dot[-_]\=spacing" contained
+syn match wgetCommand "^\s*dot[-_]\=style" contained
+syn match wgetCommand "^\s*egd[-_]\=file" contained
+syn match wgetCommand "^\s*exclude[-_]\=directories" contained
+syn match wgetCommand "^\s*exclude[-_]\=domains" contained
+syn match wgetCommand "^\s*follow[-_]\=ftp" contained
+syn match wgetCommand "^\s*follow[-_]\=tags" contained
+syn match wgetCommand "^\s*force[-_]\=html" contained
+syn match wgetCommand "^\s*ftp[-_]\=proxy" contained
+syn match wgetCommand "^\s*glob" contained
+syn match wgetCommand "^\s*header" contained
+syn match wgetCommand "^\s*html[-_]\=extension" contained
+syn match wgetCommand "^\s*htmlify" contained
+syn match wgetCommand "^\s*http[-_]\=keep[-_]\=alive" contained
+syn match wgetCommand "^\s*http[-_]\=passwd" contained
+syn match wgetCommand "^\s*http[-_]\=proxy" contained
+syn match wgetCommand "^\s*https[-_]\=proxy" contained
+syn match wgetCommand "^\s*http[-_]\=user" contained
+syn match wgetCommand "^\s*ignore[-_]\=length" contained
+syn match wgetCommand "^\s*ignore[-_]\=tags" contained
+syn match wgetCommand "^\s*include[-_]\=directories" contained
+syn match wgetCommand "^\s*input" contained
+syn match wgetCommand "^\s*kill[-_]\=longer" contained
+syn match wgetCommand "^\s*limit[-_]\=rate" contained
+syn match wgetCommand "^\s*load[-_]\=cookies" contained
+syn match wgetCommand "^\s*logfile" contained
+syn match wgetCommand "^\s*login" contained
+syn match wgetCommand "^\s*mirror" contained
+syn match wgetCommand "^\s*netrc" contained
+syn match wgetCommand "^\s*no[-_]\=clobber" contained
+syn match wgetCommand "^\s*no[-_]\=parent" contained
+syn match wgetCommand "^\s*no[-_]\=proxy" contained
+" Note: this option is deprecated, use 'tries' instead
+syn match wgetCommand "^\s*numtries" contained
+syn match wgetCommand "^\s*output[-_]\=document" contained
+syn match wgetCommand "^\s*page[-_]\=requisites" contained
+syn match wgetCommand "^\s*passive[-_]\=ftp" contained
+syn match wgetCommand "^\s*passwd" contained
+syn match wgetCommand "^\s*progress" contained
+syn match wgetCommand "^\s*proxy[-_]\=passwd" contained
+syn match wgetCommand "^\s*proxy[-_]\=user" contained
+syn match wgetCommand "^\s*quiet" contained
+syn match wgetCommand "^\s*quota" contained
+syn match wgetCommand "^\s*random[-_]\=wait" contained
+syn match wgetCommand "^\s*reclevel" contained
+syn match wgetCommand "^\s*recursive" contained
+syn match wgetCommand "^\s*referer" contained
+syn match wgetCommand "^\s*reject" contained
+syn match wgetCommand "^\s*relative[-_]\=only" contained
+syn match wgetCommand "^\s*remove[-_]\=listing" contained
+syn match wgetCommand "^\s*retr[-_]\=symlinks" contained
+syn match wgetCommand "^\s*robots" contained
+syn match wgetCommand "^\s*save[-_]\=cookies" contained
+syn match wgetCommand "^\s*save[-_]\=headers" contained
+syn match wgetCommand "^\s*server[-_]\=response" contained
+" Note: this option was removed in wget 1.8
+syn match wgetCommand "^\s*simple[-_]\=host[-_]\=check" contained
+syn match wgetCommand "^\s*span[-_]\=hosts" contained
+syn match wgetCommand "^\s*spider" contained
+syn match wgetCommand "^\s*sslcertfile" contained
+syn match wgetCommand "^\s*sslcertkey" contained
+syn match wgetCommand "^\s*timeout" contained
+syn match wgetCommand "^\s*time[-_]\=stamping" contained
+syn match wgetCommand "^\s*tries" contained
+syn match wgetCommand "^\s*use[-_]\=proxy" contained
+syn match wgetCommand "^\s*user[-_]\=agent" contained
+syn match wgetCommand "^\s*verbose" contained
+syn match wgetCommand "^\s*wait" contained
+syn match wgetCommand "^\s*wait[-_]\=retry" contained
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_wget_syn_inits")
+ if version < 508
+ let did_wget_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink wgetAssignmentOperator Special
+ HiLink wgetBoolean Boolean
+ HiLink wgetCommand Identifier
+ HiLink wgetComment Comment
+ HiLink wgetNumber Number
+ HiLink wgetQuota Number
+ HiLink wgetString String
+ HiLink wgetTodo Todo
+ HiLink wgetValue Constant
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "wget"
diff --git a/runtime/syntax/whitespace.vim b/runtime/syntax/whitespace.vim
new file mode 100644
index 000000000..4d2e32eb7
--- /dev/null
+++ b/runtime/syntax/whitespace.vim
@@ -0,0 +1,13 @@
+" Simplistic way to make spaces and Tabs visible
+
+" This can be added to an already active syntax.
+
+syn match Space " "
+syn match Tab "\t"
+if &background == "dark"
+ hi def Space ctermbg=darkred guibg=#500000
+ hi def Tab ctermbg=darkgreen guibg=#003000
+else
+ hi def Space ctermbg=lightred guibg=#ffd0d0
+ hi def Tab ctermbg=lightgreen guibg=#d0ffd0
+endif
diff --git a/runtime/syntax/winbatch.vim b/runtime/syntax/winbatch.vim
new file mode 100644
index 000000000..aea2cdebc
--- /dev/null
+++ b/runtime/syntax/winbatch.vim
@@ -0,0 +1,187 @@
+" Vim syntax file
+" Language: WinBatch/Webbatch (*.wbt, *.web)
+" Maintainer: dominique@mggen.com
+" URL: http://www.mggen.com/vim/syntax/winbatch.zip
+" Last change: 2001 May 10
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+syn keyword winbatchCtl if then else endif break end return exit next
+syn keyword winbatchCtl while for gosub goto switch select to case
+syn keyword winbatchCtl endselect endwhile endselect endswitch
+
+" String
+syn region winbatchVar start=+%+ end=+%+
+" %var% in strings
+syn region winbatchString start=+"+ end=+"+ contains=winbatchVar
+
+syn match winbatchComment ";.*$"
+syn match winbatchLabel "^\ *:[0-9a-zA-Z_\-]\+\>"
+
+" constant (bezgin by @)
+syn match winbatchConstant "@[0_9a-zA-Z_\-]\+"
+
+" number
+syn match winbatchNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
+
+syn keyword winbatchImplicit aboveicons acc_attrib acc_chng_nt acc_control acc_create
+syn keyword winbatchImplicit acc_delete acc_full_95 acc_full_nt acc_list acc_pfull_nt
+syn keyword winbatchImplicit acc_pmang_nt acc_print_nt acc_read acc_read_95 acc_read_nt
+syn keyword winbatchImplicit acc_write amc arrange ascending attr_a attr_a attr_ci attr_ci
+syn keyword winbatchImplicit attr_dc attr_dc attr_di attr_di attr_dm attr_dm attr_h attr_h
+syn keyword winbatchImplicit attr_ic attr_ic attr_p attr_p attr_ri attr_ri attr_ro attr_ro
+syn keyword winbatchImplicit attr_sh attr_sh attr_sy attr_sy attr_t attr_t attr_x attr_x
+syn keyword winbatchImplicit avogadro backscan boltzmann cancel capslock check columns
+syn keyword winbatchImplicit commonformat cr crlf ctrl default default deg2rad descending
+syn keyword winbatchImplicit disable drive electric enable eulers false faraday float8
+syn keyword winbatchImplicit fwdscan gftsec globalgroup gmtsec goldenratio gravitation hidden
+syn keyword winbatchImplicit icon lbutton lclick ldblclick lf lightmps lightmtps localgroup
+syn keyword winbatchImplicit magfield major mbokcancel mbutton mbyesno mclick mdblclick minor
+syn keyword winbatchImplicit msformat multiple ncsaformat no none none noresize normal
+syn keyword winbatchImplicit notify nowait numlock off on open parsec parseonly pi
+syn keyword winbatchImplicit planckergs planckjoules printer rad2deg rbutton rclick rdblclick
+syn keyword winbatchImplicit regclasses regcurrent regmachine regroot regusers rows save
+syn keyword winbatchImplicit scrolllock server shift single sorted stack string tab tile
+syn keyword winbatchImplicit true uncheck unsorted wait wholesection word1 word2 word4 yes
+syn keyword winbatchImplicit zoomed about abs acos addextender appexist appwaitclose asin
+syn keyword winbatchImplicit askfilename askfiletext askitemlist askline askpassword askyesno
+syn keyword winbatchImplicit atan average beep binaryalloc binarycopy binaryeodget binaryeodset
+syn keyword winbatchImplicit binaryfree binaryhashrec binaryincr binaryincr2 binaryincr4
+syn keyword winbatchImplicit binaryincrflt binaryindex binaryindexnc binaryoletype binarypeek
+syn keyword winbatchImplicit binarypeek2 binarypeek4 binarypeekflt binarypeekstr binarypoke
+syn keyword winbatchImplicit binarypoke2 binarypoke4 binarypokeflt binarypokestr binaryread
+syn keyword winbatchImplicit binarysort binarystrcnt binarywrite boxbuttondraw boxbuttonkill
+syn keyword winbatchImplicit boxbuttonstat boxbuttonwait boxcaption boxcolor
+syn keyword winbatchImplicit boxdataclear boxdatatag
+syn keyword winbatchImplicit boxdestroy boxdrawcircle boxdrawline boxdrawrect boxdrawtext
+syn keyword winbatchImplicit boxesup boxmapmode boxnew boxopen boxpen boxshut boxtext boxtextcolor
+syn keyword winbatchImplicit boxtextfont boxtitle boxupdates break buttonnames by call
+syn keyword winbatchImplicit callext ceiling char2num clipappend clipget clipput
+syn keyword winbatchImplicit continue cos cosh datetime
+syn keyword winbatchImplicit ddeexecute ddeinitiate ddepoke dderequest ddeterminate
+syn keyword winbatchImplicit ddetimeout debug debugdata decimals delay dialog
+syn keyword winbatchImplicit dialogbox dirattrget dirattrset dirchange direxist
+syn keyword winbatchImplicit dirget dirhome diritemize dirmake dirremove dirrename
+syn keyword winbatchImplicit dirwindows diskexist diskfree diskinfo diskscan disksize
+syn keyword winbatchImplicit diskvolinfo display dllcall dllfree dllhinst dllhwnd dllload
+syn keyword winbatchImplicit dosboxcursorx dosboxcursory dosboxgetall dosboxgetdata
+syn keyword winbatchImplicit dosboxheight dosboxscrmode dosboxversion dosboxwidth dosversion
+syn keyword winbatchImplicit drop edosgetinfo edosgetvar edoslistvars edospathadd edospathchk
+syn keyword winbatchImplicit edospathdel edossetvar
+syn keyword winbatchImplicit endsession envgetinfo envgetvar environment
+syn keyword winbatchImplicit environset envitemize envlistvars envpathadd envpathchk
+syn keyword winbatchImplicit envpathdel envsetvar errormode exclusive execute exetypeinfo
+syn keyword winbatchImplicit exp fabs fileappend fileattrget fileattrset fileclose
+syn keyword winbatchImplicit filecompare filecopy filedelete fileexist fileextension filefullname
+syn keyword winbatchImplicit fileitemize filelocate filemapname filemove filenameeval1
+syn keyword winbatchImplicit filenameeval2 filenamelong filenameshort fileopen filepath
+syn keyword winbatchImplicit fileread filerename fileroot filesize filetimecode filetimeget
+syn keyword winbatchImplicit filetimeset filetimetouch fileverinfo filewrite fileymdhms
+syn keyword winbatchImplicit findwindow floor getexacttime gettickcount
+syn keyword winbatchImplicit iconarrange iconreplace ignoreinput inidelete inideletepvt
+syn keyword winbatchImplicit iniitemize iniitemizepvt iniread inireadpvt iniwrite iniwritepvt
+syn keyword winbatchImplicit installfile int intcontrol isdefined isfloat isint iskeydown
+syn keyword winbatchImplicit islicensed isnumber itemcount itemextract iteminsert itemlocate
+syn keyword winbatchImplicit itemremove itemselect itemsort keytoggleget keytoggleset
+syn keyword winbatchImplicit lasterror log10 logdisk loge max message min mod mouseclick
+syn keyword winbatchImplicit mouseclickbtn mousedrag mouseinfo mousemove msgtextget n3attach
+syn keyword winbatchImplicit n3captureend n3captureprt n3chgpassword n3detach n3dirattrget
+syn keyword winbatchImplicit n3dirattrset n3drivepath n3drivepath2 n3drivestatus n3fileattrget
+syn keyword winbatchImplicit n3fileattrset n3getloginid n3getmapped n3getnetaddr n3getuser
+syn keyword winbatchImplicit n3getuserid n3logout n3map n3mapdelete n3mapdir n3maproot n3memberdel
+syn keyword winbatchImplicit n3memberget n3memberset n3msgsend n3msgsendall n3serverinfo
+syn keyword winbatchImplicit n3serverlist n3setsrchdrv n3usergroups n3version n4attach
+syn keyword winbatchImplicit n4captureend n4captureprt n4chgpassword n4detach n4dirattrget
+syn keyword winbatchImplicit n4dirattrset n4drivepath n4drivestatus n4fileattrget n4fileattrset
+syn keyword winbatchImplicit n4getloginid n4getmapped n4getnetaddr n4getuser n4getuserid
+syn keyword winbatchImplicit n4login n4logout n4map n4mapdelete n4mapdir n4maproot n4memberdel
+syn keyword winbatchImplicit n4memberget n4memberset n4msgsend n4msgsendall n4serverinfo
+syn keyword winbatchImplicit n4serverlist n4setsrchdrv n4usergroups n4version netadddrive
+syn keyword winbatchImplicit netaddprinter netcancelcon netdirdialog netgetcon netgetuser
+syn keyword winbatchImplicit netinfo netresources netversion num2char objectclose
+syn keyword winbatchImplicit objectopen parsedata pause playmedia playmidi playwaveform
+syn keyword winbatchImplicit print random regapp regclosekey regconnect regcreatekey
+syn keyword winbatchImplicit regdeletekey regdelvalue regentrytype regloadhive regopenkey
+syn keyword winbatchImplicit regquerybin regquerydword regqueryex regqueryexpsz regqueryitem
+syn keyword winbatchImplicit regquerykey regquerymulsz regqueryvalue regsetbin
+syn keyword winbatchImplicit regsetdword regsetex regsetexpsz regsetmulsz regsetvalue
+syn keyword winbatchImplicit regunloadhive reload reload rtstatus run runenviron
+syn keyword winbatchImplicit runexit runhide runhidewait runicon runiconwait runshell runwait
+syn keyword winbatchImplicit runzoom runzoomwait sendkey sendkeyschild sendkeysto
+syn keyword winbatchImplicit sendmenusto shellexecute shortcutedit shortcutextra shortcutinfo
+syn keyword winbatchImplicit shortcutmake sin sinh snapshot sounds sqrt
+syn keyword winbatchImplicit srchfree srchinit srchnext strcat strcharcount strcmp
+syn keyword winbatchImplicit strfill strfix strfixchars stricmp strindex strlen
+syn keyword winbatchImplicit strlower strreplace strscan strsub strtrim strupper
+syn keyword winbatchImplicit tan tanh tcpaddr2host tcpftpchdir tcpftpclose tcpftpget
+syn keyword winbatchImplicit tcpftplist tcpftpmode tcpftpopen tcpftpput tcphost2addr tcphttpget
+syn keyword winbatchImplicit tcphttppost tcpparmget tcpparmset tcpping tcpsmtp terminate
+syn keyword winbatchImplicit textbox textboxsort textoutbufdel textoutbuffer textoutdebug
+syn keyword winbatchImplicit textoutfree textoutinfo textoutreset textouttrack textouttrackb
+syn keyword winbatchImplicit textouttrackp textoutwait textselect timeadd timedate
+syn keyword winbatchImplicit timedelay timediffdays timediffsecs timejulianday timejultoymd
+syn keyword winbatchImplicit timesubtract timewait timeymdhms version versiondll
+syn keyword winbatchImplicit w3addcon w3cancelcon w3dirbrowse w3getcaps w3getcon w3netdialog
+syn keyword winbatchImplicit w3netgetuser w3prtbrowse w3version w95accessadd w95accessdel
+syn keyword winbatchImplicit w95adddrive w95addprinter w95cancelcon w95dirdialog w95getcon
+syn keyword winbatchImplicit w95getuser w95resources w95shareadd w95sharedel w95shareset
+syn keyword winbatchImplicit w95version waitforkey wallpaper webbaseconv webcloselog
+syn keyword winbatchImplicit webcmddata webcondata webcounter webdatdata webdumperror webhashcode
+syn keyword winbatchImplicit webislocal weblogline webopenlog webout weboutfile webparamdata
+syn keyword winbatchImplicit webparamnames websettimeout webverifycard winactivate
+syn keyword winbatchImplicit winactivchild winarrange winclose winclosenot winconfig winexename
+syn keyword winbatchImplicit winexist winparset winparget winexistchild wingetactive
+syn keyword winbatchImplicit winhelp winhide winiconize winidget winisdos winitemchild
+syn keyword winbatchImplicit winitemize winitemnameid winmetrics winname winparmget
+syn keyword winbatchImplicit winparmset winplace winplaceget winplaceset
+syn keyword winbatchImplicit winposition winresources winshow winstate winsysinfo
+syn keyword winbatchImplicit wintitle winversion winwaitchild winwaitclose winwaitexist
+syn keyword winbatchImplicit winzoom wnaddcon wncancelcon wncmptrinfo wndialog
+syn keyword winbatchImplicit wndlgbrowse wndlgcon wndlgcon2 wndlgcon3
+syn keyword winbatchImplicit wndlgcon4 wndlgdiscon wndlgnoshare wndlgshare wngetcaps
+syn keyword winbatchImplicit wngetcon wngetuser wnnetnames wnrestore wnservers wnsharecnt
+syn keyword winbatchImplicit wnsharename wnsharepath wnshares wntaccessadd wntaccessdel
+syn keyword winbatchImplicit wntaccessget wntadddrive wntaddprinter wntcancelcon wntdirdialog
+syn keyword winbatchImplicit wntgetcon wntgetuser wntlistgroups wntmemberdel wntmemberget
+syn keyword winbatchImplicit wntmembergrps wntmemberlist wntmemberset wntresources wntshareadd
+syn keyword winbatchImplicit wntsharedel wntshareset wntversion wnversion wnwrkgroups wwenvunload
+syn keyword winbatchImplicit xbaseconvert xcursorset xdisklabelget xdriveready xextenderinfo
+syn keyword winbatchImplicit xgetchildhwnd xgetelapsed xhex xmemcompact xmessagebox
+syn keyword winbatchImplicit xsendmessage xverifyccard yield
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_winbatch_syntax_inits")
+ if version < 508
+ let did_winbatch_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink winbatchLabel PreProc
+ HiLink winbatchCtl Operator
+ HiLink winbatchStatement Statement
+ HiLink winbatchTodo Todo
+ HiLink winbatchString String
+ HiLink winbatchVar Type
+ HiLink winbatchComment Comment
+ HiLink winbatchImplicit Special
+ HiLink winbatchNumber Number
+ HiLink winbatchConstant StorageClass
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "winbatch"
+
+" vim: ts=8
diff --git a/runtime/syntax/wml.vim b/runtime/syntax/wml.vim
new file mode 100644
index 000000000..5957930c8
--- /dev/null
+++ b/runtime/syntax/wml.vim
@@ -0,0 +1,172 @@
+" Vim syntax file
+" Language: WML - Website MetaLanguage
+" Maintainer: Gerfried Fuchs <alfie@ist.org>
+" Filenames: *.wml
+" Last Change: 07 Feb 2002
+" URL: http://alfie.ist.org/software/vim/syntax/wml.vim
+"
+" Original Version: Craig Small <csmall@eye-net.com.au>
+
+" Comments are very welcome - but please make sure that you are commenting on
+" the latest version of this file.
+" SPAM is _NOT_ welcome - be ready to be reported!
+
+" If you are looking for the "Wireless Markup Language" syntax file,
+" please take a look at the wap.vim file done by Ralf Schandl, soon in a
+" vim-package around your corner :)
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syn clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+
+" A lot of the web stuff looks like HTML so we load that first
+if version < 600
+ so <sfile>:p:h/html.vim
+else
+ runtime! syntax/html.vim
+endif
+unlet b:current_syntax
+
+if !exists("main_syntax")
+ let main_syntax = 'wml'
+endif
+
+" special character
+syn match wmlNextLine "\\$"
+
+" Redfine htmlTag
+syn clear htmlTag
+syn region htmlTag start=+<[^/<]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition
+
+"
+" Add in extra Arguments used by wml
+syn keyword htmlTagName contained gfont imgbg imgdot lowsrc
+syn keyword htmlTagName contained navbar:define navbar:header
+syn keyword htmlTagName contained navbar:footer navbar:prolog
+syn keyword htmlTagName contained navbar:epilog navbar:button
+syn keyword htmlTagName contained navbar:filter navbar:debug
+syn keyword htmlTagName contained navbar:render
+syn keyword htmlTagName contained preload rollover
+syn keyword htmlTagName contained space hspace vspace over
+syn keyword htmlTagName contained ps ds pi ein big sc spaced headline
+syn keyword htmlTagName contained ue subheadline zwue verbcode
+syn keyword htmlTagName contained isolatin pod sdf text url verbatim
+syn keyword htmlTagName contained xtable
+syn keyword htmlTagName contained csmap fsview import box
+syn keyword htmlTagName contained case:upper case:lower
+syn keyword htmlTagName contained grid cell info lang: logo page
+syn keyword htmlTagName contained set-var restore
+syn keyword htmlTagName contained array:push array:show set-var ifdef
+syn keyword htmlTagName contained say m4 symbol dump enter divert
+syn keyword htmlTagName contained toc
+syn keyword htmlTagName contained wml card do refresh oneevent catch spawn
+
+"
+" The wml arguments
+syn keyword htmlArg contained adjust background base bdcolor bdspace
+syn keyword htmlArg contained bdwidth complete copyright created crop
+syn keyword htmlArg contained direction description domainname eperlfilter
+syn keyword htmlArg contained file hint imgbase imgstar interchar interline
+syn keyword htmlArg contained keephr keepindex keywords layout spacing
+syn keyword htmlArg contained padding nonetscape noscale notag notypo
+syn keyword htmlArg contained onload oversrc pos select slices style
+syn keyword htmlArg contained subselected txtcol_select txtcol_normal
+syn keyword htmlArg contained txtonly via
+syn keyword htmlArg contained mode columns localsrc ordered
+
+
+" Lines starting with an # are usually comments
+syn match wmlComment "^\s*#.*"
+" The different exceptions to comments
+syn match wmlSharpBang "^#!.*"
+syn match wmlUsed contained "\s\s*[A-Za-z:_-]*"
+syn match wmlUse "^\s*#\s*use\s\+" contains=wmlUsed
+syn match wmlInclude "^\s*#\s*include.+"
+
+syn region wmlBody contained start=+<<+ end=+>>+
+
+syn match wmlLocationId contained "[A-Za-z]\+"
+syn region wmlLocation start=+<<+ end=+>>+ contains=wmlLocationId
+"syn region wmlLocation start=+{#+ end=+#}+ contains=wmlLocationId
+"syn region wmlLocationed contained start=+<<+ end=+>>+ contains=wmlLocationId
+
+syn match wmlDivert "\.\.[a-zA-Z_]\+>>"
+syn match wmlDivertEnd "<<\.\."
+" new version
+"syn match wmlDivert "{#[a-zA-Z_]\+#:"
+"syn match wmlDivertEnd ":##}"
+
+syn match wmlDefineName contained "\s\+[A-Za-z-]\+"
+syn region htmlTagName start="\<\(define-tag\|define-region\)" end="\>" contains=wmlDefineName
+
+" The perl include stuff
+if main_syntax != 'perl'
+ " Perl script
+ if version < 600
+ syn include @wmlPerlScript <sfile>:p:h/perl.vim
+ else
+ syn include @wmlPerlScript syntax/perl.vim
+ endif
+ unlet b:current_syntax
+
+ syn region perlScript start=+<perl>+ keepend end=+</perl>+ contains=@wmlPerlScript,wmlPerlTag
+" eperl between '<:' and ':>' -- Alfie [1999-12-26]
+ syn region perlScript start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag
+ syn match wmlPerlTag contained "</*perl>" contains=wmlPerlTagN
+ syn keyword wmlPerlTagN contained perl
+
+ hi link wmlPerlTag htmlTag
+ hi link wmlPerlTagN htmlStatement
+endif
+
+" verbatim tags -- don't highlight anything in between -- Alfie [2002-02-07]
+syn region wmlVerbatimText start=+<verbatim>+ keepend end=+</verbatim>+ contains=wmlVerbatimTag
+syn match wmlVerbatimTag contained "</*verbatim>" contains=wmlVerbatimTagN
+syn keyword wmlVerbatimTagN contained verbatim
+hi link wmlVerbatimTag htmlTag
+hi link wmlVerbatimTagN htmlStatement
+
+if main_syntax == "html"
+ syn sync match wmlHighlight groupthere NONE "</a-zA-Z]"
+ syn sync match wmlHighlight groupthere perlScript "<perl>"
+ syn sync match wmlHighlightSkip "^.*['\"].*$"
+ syn sync minlines=10
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_wml_syn_inits")
+ let did_wml_syn_inits = 1
+ if version < 508
+ let did_wml_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink wmlNextLine Special
+ HiLink wmlUse Include
+ HiLink wmlUsed String
+ HiLink wmlBody Special
+ HiLink wmlDiverted Label
+ HiLink wmlDivert Delimiter
+ HiLink wmlDivertEnd Delimiter
+ HiLink wmlLocationId Label
+ HiLink wmlLocation Delimiter
+" HiLink wmlLocationed Delimiter
+ HiLink wmlDefineName String
+ HiLink wmlComment Comment
+ HiLink wmlInclude Include
+ HiLink wmlSharpBang PreProc
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "wml"
diff --git a/runtime/syntax/wsh.vim b/runtime/syntax/wsh.vim
new file mode 100644
index 000000000..98ba105a7
--- /dev/null
+++ b/runtime/syntax/wsh.vim
@@ -0,0 +1,45 @@
+" Vim syntax file
+" Language: Windows Scripting Host
+" Maintainer: Paul Moore <gustav@morpheus.demon.co.uk>
+" Last Change: Fre, 24 Nov 2000 21:54:09 +0100
+
+" This reuses the XML, VB and JavaScript syntax files. While VB is not
+" VBScript, it's close enough for us. No attempt is made to handle
+" other languages.
+" Send comments, suggestions and requests to the maintainer.
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:wsh_cpo_save = &cpo
+set cpo&vim
+
+runtime! syntax/xml.vim
+unlet b:current_syntax
+
+syn case ignore
+syn include @wshVBScript <sfile>:p:h/vb.vim
+unlet b:current_syntax
+syn include @wshJavaScript <sfile>:p:h/javascript.vim
+unlet b:current_syntax
+syn region wshVBScript
+ \ matchgroup=xmlTag start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)"
+ \ matchgroup=xmlEndTag end="</script>"
+ \ fold
+ \ contains=@wshVBScript
+ \ keepend
+syn region wshJavaScript
+ \ matchgroup=xmlTag start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)"
+ \ matchgroup=xmlEndTag end="</script>"
+ \ fold
+ \ contains=@wshJavaScript
+ \ keepend
+
+syn cluster xmlRegionHook add=wshVBScript,wshJavaScript
+
+let b:current_syntax = "wsh"
+
+let &cpo = s:wsh_cpo_save
+unlet s:wsh_cpo_save
diff --git a/runtime/syntax/wvdial.vim b/runtime/syntax/wvdial.vim
new file mode 100644
index 000000000..035138b65
--- /dev/null
+++ b/runtime/syntax/wvdial.vim
@@ -0,0 +1,28 @@
+" Vim syntax file
+" Language: Configuration file for WvDial
+" Maintainer: Prahlad Vaidyanathan <slime@vsnl.net>
+" Last Update: Mon, 15 Oct 2001 09:39:03 Indian Standard Time
+
+" Quit if syntax file is already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match wvdialComment "^;.*$"lc=1
+syn match wvdialComment "[^\\];.*$"lc=1
+syn match wvdialSection "^\s*\[.*\]"
+syn match wvdialValue "=.*$"ms=s+1
+syn match wvdialValue "\s*[^ ;"' ]\+"lc=1
+syn match wvdialVar "^\s*\(Inherits\|Modem\|Baud\|Init.\|Phone\|Area\ Code\|Dial\ Prefix\|Dial\ Command\|Login\|Login\| Prompt\|Password\|Password\ Prompt\|PPPD\ Path\|Force\ Address\|Remote\ Name\|Carrier\ Check\|Stupid\ [Mm]ode\|New\ PPPD\|Default\ Reply\|Auto\ Reconnect\|SetVolume\|Username\)"
+syn match wvdialEqual "="
+
+" The default highlighting
+hi def link wvdialComment Comment
+hi def link wvdialSection PreProc
+hi def link wvdialVar Identifier
+hi def link wvdialValue String
+hi def link wvdialEqual Statement
+
+let b:current_syntax = "wvdial"
+
+"EOF vim: tw=78:ft=vim:ts=8
diff --git a/runtime/syntax/xdefaults.vim b/runtime/syntax/xdefaults.vim
new file mode 100644
index 000000000..64d3b6953
--- /dev/null
+++ b/runtime/syntax/xdefaults.vim
@@ -0,0 +1,145 @@
+" Vim syntax file
+" Language: X resources files like ~/.Xdefaults (xrdb)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Author and previous maintainer:
+" Gautam H. Mudunuri <gmudunur@informatica.com>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" $Id$
+"
+" REFERENCES:
+" xrdb manual page
+" xrdb source: ftp://ftp.x.org/pub/R6.4/xc/programs/xrdb/xrdb.c
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" turn case on
+syn case match
+
+
+if !exists("xdefaults_no_colon_errors")
+ " mark lines which do not contain a colon as errors.
+ " This does not really catch all errors but only lines
+ " which contain at least two WORDS and no colon. This
+ " was done this way so that a line is not marked as
+ " error while typing (which would be annoying).
+ syntax match xdefaultsErrorLine "^\s*[a-zA-Z.*]\+\s\+[^: ]\+"
+endif
+
+
+" syn region xdefaultsLabel start=+^[^:]\{-}:+he=e-1 skip=+\\+ end="$"
+syn match xdefaultsLabel +[^:]\{-}:+he=e-1 contains=xdefaultsPunct,xdefaultsSpecial,xdefaultsLineEnd
+syn region xdefaultsValue keepend start=+:+lc=1 skip=+\\+ end=+$+ contains=xdefaultsSpecial,xdefaultsLabel,xdefaultsLineEnd
+
+syn match xdefaultsSpecial contained +#override+
+syn match xdefaultsSpecial contained +#augment+
+syn match xdefaultsPunct contained +[.*:]+
+syn match xdefaultsLineEnd contained +\\$+
+syn match xdefaultsLineEnd contained +\\n\\$+
+syn match xdefaultsLineEnd contained +\\n$+
+
+
+
+" COMMENTS
+
+" note, that the '!' must be at the very first position of the line
+syn match xdefaultsComment "^!.*$" contains=xdefaultsTodo
+
+" lines starting with a '#' mark and which are not preprocessor
+" lines are skipped. This is not part of the xrdb documentation.
+" It was reported by Bram Moolenaar and could be confirmed by
+" having a look at xrdb.c:GetEntries()
+syn match xdefaultsCommentH "^#.*$"
+"syn region xdefaultsComment start="^#" end="$" keepend contains=ALL
+syn region xdefaultsComment start="/\*" end="\*/" contains=xdefaultsTodo
+
+syntax match xdefaultsCommentError "\*/"
+
+syn keyword xdefaultsTodo contained TODO FIXME XXX display
+
+
+
+" PREPROCESSOR STUFF
+
+syn region xdefaultsPreProc start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\|else\|endif\)\>" skip="\\$" end="$" contains=xdefaultsSymbol
+if !exists("xdefaults_no_if0")
+ syn region xdefaultsCppOut start="^\s*#\s*if\s\+0\>" end=".\|$" contains=xdefaultsCppOut2
+ syn region xdefaultsCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=xdefaultsCppSkip
+ syn region xdefaultsCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=xdefaultsCppSkip
+endif
+syn region xdefaultsIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match xdefaultsIncluded contained "<[^>]*>"
+syn match xdefaultsInclude "^\s*#\s*include\>\s*["<]" contains=xdefaultsIncluded
+syn cluster xdefaultsPreProcGroup contains=xdefaultsPreProc,xdefaultsIncluded,xdefaultsInclude,xdefaultsDefine
+syn region xdefaultsDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" contains=ALLBUT,@xdefaultsPreProcGroup,xdefaultsCommentH,xdefaultsErrorLine
+syn region xdefaultsPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@xdefaultsPreProcGroup,xdefaultsCommentH,xdefaultsErrorLine
+
+
+
+" symbols as defined by xrdb
+syn keyword xdefaultsSymbol contained SERVERHOST
+syn match xdefaultsSymbol contained "SRVR_[a-zA-Z0-9_]\+"
+syn keyword xdefaultsSymbol contained HOST
+syn keyword xdefaultsSymbol contained DISPLAY_NUM
+syn keyword xdefaultsSymbol contained CLIENTHOST
+syn match xdefaultsSymbol contained "CLNT_[a-zA-Z0-9_]\+"
+syn keyword xdefaultsSymbol contained RELEASE
+syn keyword xdefaultsSymbol contained REVISION
+syn keyword xdefaultsSymbol contained VERSION
+syn keyword xdefaultsSymbol contained VENDOR
+syn match xdefaultsSymbol contained "VNDR_[a-zA-Z0-9_]\+"
+syn match xdefaultsSymbol contained "EXT_[a-zA-Z0-9_]\+"
+syn keyword xdefaultsSymbol contained NUM_SCREENS
+syn keyword xdefaultsSymbol contained SCREEN_NUM
+syn keyword xdefaultsSymbol contained BITS_PER_RGB
+syn keyword xdefaultsSymbol contained CLASS
+syn keyword xdefaultsSymbol contained StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor
+syn match xdefaultsSymbol contained "CLASS_\(StaticGray\|GrayScale\|StaticColor\|PseudoColor\|TrueColor\|DirectColor\)"
+syn keyword xdefaultsSymbol contained COLOR
+syn match xdefaultsSymbol contained "CLASS_\(StaticGray\|GrayScale\|StaticColor\|PseudoColor\|TrueColor\|DirectColor\)_[0-9]\+"
+syn keyword xdefaultsSymbol contained HEIGHT
+syn keyword xdefaultsSymbol contained WIDTH
+syn keyword xdefaultsSymbol contained PLANES
+syn keyword xdefaultsSymbol contained X_RESOLUTION
+syn keyword xdefaultsSymbol contained Y_RESOLUTION
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xdefaults_syntax_inits")
+ if version < 508
+ let did_xdefaults_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink xdefaultsLabel Type
+ HiLink xdefaultsValue Constant
+ HiLink xdefaultsComment Comment
+ HiLink xdefaultsCommentH xdefaultsComment
+ HiLink xdefaultsPreProc PreProc
+ HiLink xdefaultsInclude xdefaultsPreProc
+ HiLink xdefaultsCppSkip xdefaultsCppOut
+ HiLink xdefaultsCppOut2 xdefaultsCppOut
+ HiLink xdefaultsCppOut Comment
+ HiLink xdefaultsIncluded String
+ HiLink xdefaultsDefine Macro
+ HiLink xdefaultsSymbol Statement
+ HiLink xdefaultsSpecial Statement
+ HiLink xdefaultsErrorLine Error
+ HiLink xdefaultsCommentError Error
+ HiLink xdefaultsPunct Normal
+ HiLink xdefaultsLineEnd Special
+ HiLink xdefaultsTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xdefaults"
+
+" vim:ts=8
diff --git a/runtime/syntax/xf86conf.vim b/runtime/syntax/xf86conf.vim
new file mode 100644
index 000000000..8d0f60638
--- /dev/null
+++ b/runtime/syntax/xf86conf.vim
@@ -0,0 +1,209 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: XF86Config (XFree86 configuration file)
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-05-01
+" URL: http://trific.ath.cx/Ftp/vim/syntax/xf86conf.vim
+" Required Vim Version: 6.0
+"
+" Options: let xf86conf_xfree86_version = 3 or 4
+" to force XFree86 3.x or 4.x XF86Config syntax
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or usea version of " . expand("<sfile>:t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "."
+ finish
+endif
+
+if !exists("b:xf86conf_xfree86_version")
+ if exists("xf86conf_xfree86_version")
+ let b:xf86conf_xfree86_version = xf86conf_xfree86_version
+ else
+ let b:xf86conf_xfree86_version = 4
+ endif
+endif
+
+syn case ignore
+
+" Comments
+syn match xf86confComment "#.*$" contains=xf86confTodo
+syn case match
+syn keyword xf86confTodo FIXME TODO XXX NOT contained
+syn case ignore
+syn match xf86confTodo "???" contained
+
+" Sectioning errors
+syn keyword xf86confSectionError Section contained
+syn keyword xf86confSectionError EndSection
+syn keyword xf86confSubSectionError SubSection
+syn keyword xf86confSubSectionError EndSubSection
+syn keyword xf86confModeSubSectionError Mode
+syn keyword xf86confModeSubSectionError EndMode
+syn cluster xf86confSectionErrors contains=xf86confSectionError,xf86confSubSectionError,xf86confModeSubSectionError
+
+" Values
+if b:xf86conf_xfree86_version >= 4
+ syn region xf86confString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=xf86confSpecialChar,xf86confConstant,xf86confOptionName oneline keepend nextgroup=xf86confValue skipwhite
+else
+ syn region xf86confString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=xf86confSpecialChar,xf86confOptionName oneline keepend
+endif
+syn match xf86confSpecialChar "\\\d\d\d\|\\." contained
+syn match xf86confDecimalNumber "\(\s\|-\)\zs\d*\.\=\d\+\>"
+syn match xf86confFrequency "\(\s\|-\)\zs\d\+\.\=\d*\(Hz\|k\|kHz\|M\|MHz\)"
+syn match xf86confOctalNumber "\<0\o\+\>"
+syn match xf86confOctalNumberError "\<0\o\+[89]\d*\>"
+syn match xf86confHexadecimalNumber "\<0x\x\+\>"
+syn match xf86confValue "\s\+.*$" contained contains=xf86confComment,xf86confString,xf86confFrequency,xf86conf\w\+Number,xf86confConstant
+syn keyword xf86confOption Option nextgroup=xf86confString skipwhite
+syn match xf86confModeLineValue "\"[^\"]\+\"\(\_s\+[0-9.]\+\)\{9}" nextgroup=xf86confSync skipwhite skipnl
+
+" Sections and subsections
+if b:xf86conf_xfree86_version >= 4
+ syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Vendor\|Keyboard\|Pointer\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,xf86confSectionError
+ syn region xf86confSectionModule matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Module\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionAny,xf86confComment,xf86confOption,xf86confKeyword
+ syn region xf86confSectionMonitor matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Monitor\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment,xf86confOption,xf86confKeyword
+ syn region xf86confSectionModes matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Modes\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment
+ syn region xf86confSectionScreen matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Screen\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionDisplay,xf86confComment,xf86confOption,xf86confKeyword
+ syn region xf86confSubSectionAny matchgroup=xf86confSectionDelim start="^\s*SubSection\s\+\"[^\"]\+\"" end="^\s*EndSubSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,@xf86confSectionErrors
+ syn region xf86confSubSectionMode matchgroup=xf86confSectionDelim start="^\s*Mode\s\+\"[^\"]\+\"" end="^\s*EndMode\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confKeyword,@xf86confSectionErrors
+ syn region xf86confSubSectionDisplay matchgroup=xf86confSectionDelim start="^\s*SubSection\s\+\"Display\"" end="^\s*EndSubSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOption,xf86confKeyword,@xf86confSectionErrors
+else
+ syn region xf86confSection matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Device\|Keyboard\|Pointer\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword
+ syn region xf86confSectionMX matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"\(Module\|Xinput\)\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionAny,xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword
+ syn region xf86confSectionMonitor matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Monitor\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionMode,xf86confModeLine,xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword
+ syn region xf86confSectionScreen matchgroup=xf86confSectionDelim start="^\s*Section\s\+\"Screen\"" end="^\s*EndSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confSubsectionDisplay,xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword
+ syn region xf86confSubSectionAny matchgroup=xf86confSectionDelim start="^\s*SubSection\s\+\"[^\"]\+\"" end="^\s*EndSubSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword,@xf86confSectionErrors
+ syn region xf86confSubSectionMode matchgroup=xf86confSectionDelim start="^\s*Mode\s\+\"[^\"]\+\"" end="^\s*EndMode\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword,@xf86confSectionErrors
+ syn region xf86confSubSectionDisplay matchgroup=xf86confSectionDelim start="^\s*SubSection\s\+\"Display\"" end="^\s*EndSubSection\>" skip="#.*$\|\"[^\"]*\"" contains=xf86confComment,xf86confOptionName,xf86confOption,xf86confKeyword,@xf86confSectionErrors
+endif
+
+" Options
+if b:xf86conf_xfree86_version >= 4
+ command -nargs=+ Xf86confdeclopt syn keyword xf86confOptionName <args> contained
+else
+ command -nargs=+ Xf86confdeclopt syn keyword xf86confOptionName <args> contained nextgroup=xf86confValue,xf86confComment skipwhite
+endif
+
+Xf86confdeclopt 18bitBus AGPFastWrite AGPMode Accel AllowClosedownGrabs AllowDeactivateGrabs
+Xf86confdeclopt AllowMouseOpenFail AllowNonLocalModInDev AllowNonLocalXvidtune AlwaysCore
+Xf86confdeclopt AngleOffset AutoRepeat BaudRate BeamTimeout Beep BlankTime BlockWrite BottomX
+Xf86confdeclopt BottomY ButtonNumber ButtonThreshold Buttons ByteSwap CacheLines ChordMiddle
+Xf86confdeclopt ClearDTR ClearDTS ClickMode CloneDisplay CloneHSync CloneMode CloneVRefresh
+Xf86confdeclopt ColorKey Composite CompositeSync CoreKeyboard CorePointer Crt2Memory CrtScreen
+Xf86confdeclopt CrtcNumber CyberShadow CyberStretch DDC DDCMode DMAForXv DPMS Dac6Bit DacSpeed
+Xf86confdeclopt DataBits Debug DebugLevel DefaultServerLayout DeltaX DeltaY Device DeviceName
+Xf86confdeclopt DisableModInDev DisableVidModeExtension Display Display1400 DontVTSwitch
+Xf86confdeclopt DontZap DontZoom DoubleScan DozeMode DozeScan DozeTime DragLockButtons
+Xf86confdeclopt DualCount DualRefresh EarlyRasPrecharge Emulate3Buttons Emulate3Timeout
+Xf86confdeclopt EmulateWheel EmulateWheelButton EmulateWheelInertia EnablePageFlip EnterCount
+Xf86confdeclopt EstimateSizesAggressively ExternDisp FPClock16 FPClock24 FPClock32
+Xf86confdeclopt FPClock8 FPDither FastDram FifoAggresive FifoConservative FifoModerate
+Xf86confdeclopt FireGL3000 FixPanelSize FlatPanel FlipXY FlowControl ForceCRT1 ForceCRT2Type
+Xf86confdeclopt ForceLegacyCRT ForcePCIMode FpmVRAM FrameBufferWC FullMMIO GammaBrightness
+Xf86confdeclopt HWClocks HWCursor HandleSpecialKeys HistorySize Interlace Interlaced InternDisp
+Xf86confdeclopt InvX InvY InvertX InvertY KeepShape LCDClock LateRasPrecharge LcdCenter
+Xf86confdeclopt LeftAlt Linear MGASDRAM MMIO MMIOCache MTTR MaxX MaxY MaximumXPosition
+Xf86confdeclopt MaximumYPosition MinX MinY MinimumXPosition MinimumYPosition NoAccel
+Xf86confdeclopt NoAllowMouseOpenFail NoAllowNonLocalModInDev NoAllowNonLocalXvidtune
+Xf86confdeclopt NoBlockWrite NoCompositeSync NoCompression NoCrtScreen NoCyberShadow NoDCC
+Xf86confdeclopt NoDDC NoDac6Bit NoDebug NoDisableModInDev NoDisableVidModeExtension NoDontZap
+Xf86confdeclopt NoDontZoom NoFireGL3000 NoFixPanelSize NoFpmVRAM NoFrameBufferWC NoHWClocks
+Xf86confdeclopt NoHWCursor NoHal NoLcdCenter NoLinear NoMGASDRAM NoMMIO NoMMIOCache NoMTTR
+Xf86confdeclopt NoOverClockMem NoOverlay NoPC98 NoPM NoPciBurst NoPciRetry NoProbeClock
+Xf86confdeclopt NoSTN NoSWCursor NoShadowFb NoShowCache NoSlowEDODRAM NoStretch NoSuspendHack
+Xf86confdeclopt NoTexturedVideo NoTrapSignals NoUseFBDev NoUseModeline NoUseVclk1 NoVTSysReq
+Xf86confdeclopt NoXVideo NvAGP OSMImageBuffers OffTime Origin OverClockMem Overlay
+Xf86confdeclopt PC98 PCIBurst PM PWMActive PWMSleep PanelDelayCompensation PanelHeight
+Xf86confdeclopt PanelOff PanelWidth Parity PciBurst PciRetry Pixmap Port PressDur PressPitch
+Xf86confdeclopt PressVol ProbeClocks ProgramFPRegs Protocol RGBBits ReleaseDur ReleasePitch
+Xf86confdeclopt ReportingMode Resolution RightAlt RightCtl Rotate STN SWCursor SampleRate
+Xf86confdeclopt ScreenNumber ScrollLock SendCoreEvents SendDragEvents Serial ServerNumLock
+Xf86confdeclopt SetLcdClk SetMClk SetRefClk ShadowFb ShadowStatus ShowCache SleepMode
+Xf86confdeclopt SleepScan SleepTime SlowDram SlowEDODRAM StandbyTime StopBits Stretch
+Xf86confdeclopt SuspendHack SuspendTime SwapXY SyncOnGreen TV TVOutput TVOverscan TVStandard
+Xf86confdeclopt TVXPosOffset TVYPosOffset TexturedVideo Threshold Tilt TopX TopY TouchTime
+Xf86confdeclopt TrapSignals Type USB UseBIOS UseFB UseFBDev UseFlatPanel UseModeline
+Xf86confdeclopt UseROMData UseVclk1 VTInit VTSysReq VTime VideoKey Vmin XAxisMapping
+Xf86confdeclopt XLeds XVideo XaaNoCPUToScreenColorExpandFill XaaNoColor8x8PatternFillRect
+Xf86confdeclopt XaaNoColor8x8PatternFillTrap XaaNoDashedBresenhamLine XaaNoDashedTwoPointLine
+Xf86confdeclopt XaaNoImageWriteRect XaaNoMono8x8PatternFillRect XaaNoMono8x8PatternFillTrap
+Xf86confdeclopt XaaNoOffscreenPixmaps XaaNoPixmapCache XaaNoScanlineCPUToScreenColorExpandFill
+Xf86confdeclopt XaaNoScanlineImageWriteRect XaaNoScreenToScreenColorExpandFill
+Xf86confdeclopt XaaNoScreenToScreenCopy XaaNoSolidBresenhamLine XaaNoSolidFillRect
+Xf86confdeclopt XaaNoSolidFillTrap XaaNoSolidHorVertLine XaaNoSolidTwoPointLine Xinerama
+Xf86confdeclopt XkbCompat XkbDisable XkbGeometry XkbKeycodes XkbKeymap XkbLayout XkbModel
+Xf86confdeclopt XkbOptions XkbRules XkbSymbols XkbTypes XkbVariant XvBskew XvHsync XvOnCRT2
+Xf86confdeclopt XvRskew XvVsync YAxisMapping ZAxisMapping ZoomOnLCD
+
+delcommand Xf86confdeclopt
+
+" Keywords
+syn keyword xf86confKeyword Device Driver FontPath Group Identifier Load ModelName ModulePath Monitor RGBPath VendorName VideoAdaptor Visual nextgroup=xf86confComment,xf86confString skipwhite
+syn keyword xf86confKeyword BiosBase Black BoardName BusID ChipID ChipRev Chipset nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword ClockChip Clocks DacSpeed DefaultDepth DefaultFbBpp nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword DefaultColorDepth nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword Depth DisplaySize DotClock FbBpp Flags Gamma HorizSync nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword Hskew HTimings InputDevice IOBase MemBase Mode nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword Modes Ramdac Screen TextClockFreq UseModes VendorName nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword VertRefresh VideoRam ViewPort Virtual VScan VTimings nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confKeyword Weight White nextgroup=xf86confComment,xf86confValue
+syn keyword xf86confModeLine ModeLine nextgroup=xf86confComment,xf86confModeLineValue skipwhite skipnl
+
+" Constants
+if b:xf86conf_xfree86_version >= 4
+ syn keyword xf86confConstant true false on off yes no omit contained
+else
+ syn keyword xf86confConstant Meta Compose Control
+endif
+syn keyword xf86confConstant StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor contained
+syn keyword xf86confConstant Absolute RightOf LeftOf Above Below Relative StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor contained
+syn match xf86confSync "\(\s\+[+-][CHV]_*Sync\)\+" contained
+
+" Synchronization
+if b:xf86conf_xfree86_version >= 4
+ syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Input[_ ]*Device\|Device\|Video[_ ]*Adaptor\|Server[_ ]*Layout\|DRI\|Vendor\|Keyboard\|Pointer\)\""
+ syn sync match xf86confSyncSectionModule grouphere xf86confSectionModule "^\s*Section\s\+\"Module\""
+ syn sync match xf86confSyncSectionModes groupthere xf86confSectionModes "^\s*Section\s\+\"Modes\""
+else
+ syn sync match xf86confSyncSection grouphere xf86confSection "^\s*Section\s\+\"\(Files\|Server[_ ]*Flags\|Device\|Keyboard\|Pointer\)\""
+ syn sync match xf86confSyncSectionMX grouphere xf86confSectionMX "^\s*Section\s\+\"\(Module\|Xinput\)\""
+endif
+syn sync match xf86confSyncSectionMonitor groupthere xf86confSectionMonitor "^\s*Section\s\+\"Monitor\""
+syn sync match xf86confSyncSectionScreen groupthere xf86confSectionScreen "^\s*Section\s\+\"Screen\""
+syn sync match xf86confSyncEndSection groupthere NONE "^\s*End_*Section\s*$"
+
+" Define the default highlighting
+hi def link xf86confComment Comment
+hi def link xf86confTodo Todo
+hi def link xf86confSectionDelim Statement
+hi def link xf86confOptionName Identifier
+
+hi def link xf86confSectionError xf86confError
+hi def link xf86confSubSectionError xf86confError
+hi def link xf86confModeSubSectionError xf86confError
+hi def link xf86confOctalNumberError xf86confError
+hi def link xf86confError Error
+
+hi def link xf86confOption xf86confKeyword
+hi def link xf86confModeLine xf86confKeyword
+hi def link xf86confKeyword Type
+
+hi def link xf86confDecimalNumber xf86confNumber
+hi def link xf86confOctalNumber xf86confNumber
+hi def link xf86confHexadecimalNumber xf86confNumber
+hi def link xf86confFrequency xf86confNumber
+hi def link xf86confModeLineValue Constant
+hi def link xf86confNumber Constant
+
+hi def link xf86confSync xf86confConstant
+hi def link xf86confConstant Special
+hi def link xf86confSpecialChar Special
+hi def link xf86confString String
+
+hi def link xf86confValue Constant
+
+let b:current_syntax = "xf86conf"
diff --git a/runtime/syntax/xhtml.vim b/runtime/syntax/xhtml.vim
new file mode 100644
index 000000000..0c6ea7340
--- /dev/null
+++ b/runtime/syntax/xhtml.vim
@@ -0,0 +1,11 @@
+" Vim syntax file
+" Language: XHTML
+" Maintainer: noone
+" Last Change: 2003 Feb 04
+
+" Load the HTML syntax for now.
+runtime! syntax/html.vim
+
+let b:current_syntax = "xhtml"
+
+" vim: ts=8
diff --git a/runtime/syntax/xkb.vim b/runtime/syntax/xkb.vim
new file mode 100644
index 000000000..ff9bfd0da
--- /dev/null
+++ b/runtime/syntax/xkb.vim
@@ -0,0 +1,91 @@
+" Vim syntax file
+" This is a GENERATED FILE. Please always refer to source file at the URI below.
+" Language: XKB (X Keyboard Extension) components
+" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2003-04-13
+" URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim
+
+" Setup
+if version >= 600
+ if exists("b:current_syntax")
+ finish
+ endif
+else
+ syntax clear
+endif
+
+syn case match
+syn sync minlines=100
+
+" Comments
+syn region xkbComment start="//" skip="\\$" end="$" keepend contains=xkbTodo
+syn region xkbComment start="/\*" matchgroup=NONE end="\*/" contains=xkbCommentStartError,xkbTodo
+syn match xkbCommentError "\*/"
+syntax match xkbCommentStartError "/\*" contained
+syn sync ccomment xkbComment
+syn keyword xkbTodo TODO FIXME contained
+
+" Literal strings
+syn match xkbSpecialChar "\\\d\d\d\|\\." contained
+syn region xkbString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=xkbSpecialChar oneline
+
+" Catch errors caused by wrong parenthesization
+syn region xkbParen start='(' end=')' contains=ALLBUT,xkbParenError,xkbSpecial,xkbTodo transparent
+syn match xkbParenError ")"
+syn region xkbBrace start='{' end='}' contains=ALLBUT,xkbBraceError,xkbSpecial,xkbTodo transparent
+syn match xkbBraceError "}"
+syn region xkbBracket start='\[' end='\]' contains=ALLBUT,xkbBracketError,xkbSpecial,xkbTodo transparent
+syn match xkbBracketError "\]"
+
+" Physical keys
+syn match xkbPhysicalKey "<\w\+>"
+
+" Keywords
+syn keyword xkbPreproc augment include replace
+syn keyword xkbConstant False True
+syn keyword xkbModif override replace
+syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
+syn keyword xkbFunction AnyOf ISOLock LatchGroup LatchMods LockControls LockGroup LockMods LockPointerButton MovePtr NoAction PointerButton SetControls SetGroup SetMods SetPtrDflt Terminate
+syn keyword xkbTModif default hidden partial virtual
+syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types
+
+" Define the default highlighting
+if version >= 508 || !exists("did_xkb_syntax_inits")
+ if version < 508
+ let did_xkb_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xkbModif xkbPreproc
+ HiLink xkbTModif xkbPreproc
+ HiLink xkbPreproc Preproc
+
+ HiLink xkbIdentifier Keyword
+ HiLink xkbFunction Function
+ HiLink xkbSect Type
+ HiLink xkbPhysicalKey Identifier
+ HiLink xkbKeyword Keyword
+
+ HiLink xkbComment Comment
+ HiLink xkbTodo Todo
+
+ HiLink xkbConstant Constant
+ HiLink xkbString String
+
+ HiLink xkbSpecialChar xkbSpecial
+ HiLink xkbSpecial Special
+
+ HiLink xkbParenError xkbBalancingError
+ HiLink xkbBraceError xkbBalancingError
+ HiLink xkbBraketError xkbBalancingError
+ HiLink xkbBalancingError xkbError
+ HiLink xkbCommentStartError xkbCommentError
+ HiLink xkbCommentError xkbError
+ HiLink xkbError Error
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xkb"
diff --git a/runtime/syntax/xmath.vim b/runtime/syntax/xmath.vim
new file mode 100644
index 000000000..21962fb42
--- /dev/null
+++ b/runtime/syntax/xmath.vim
@@ -0,0 +1,235 @@
+" Vim syntax file
+" Language: xmath (a simulation tool)
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Sep 02, 2003
+" Version: 3
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" parenthesis sanity checker
+syn region xmathZone matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" transparent contains=ALLBUT,xmathError,xmathBraceError,xmathCurlyError
+syn region xmathZone matchgroup=Delimiter start="{" matchgroup=Delimiter end="}" transparent contains=ALLBUT,xmathError,xmathBraceError,xmathParenError
+syn region xmathZone matchgroup=Delimiter start="\[" matchgroup=Delimiter end="]" transparent contains=ALLBUT,xmathError,xmathCurlyError,xmathParenError
+syn match xmathError "[)\]}]"
+syn match xmathBraceError "[)}]" contained
+syn match xmathCurlyError "[)\]]" contained
+syn match xmathParenError "[\]}]" contained
+syn match xmathComma "[,;:]"
+syn match xmathComma "\.\.\.$"
+
+" A bunch of useful xmath keywords
+syn case ignore
+syn keyword xmathFuncCmd function endfunction command endcommand
+syn keyword xmathStatement abort beep debug default define
+syn keyword xmathStatement execute exit pause return undefine
+syn keyword xmathConditional if else elseif endif
+syn keyword xmathRepeat while for endwhile endfor
+syn keyword xmathCmd anigraph deletedatastore keep renamedatastore
+syn keyword xmathCmd autocode deletestd linkhyper renamestd
+syn keyword xmathCmd build deletesuperblock linksim renamesuperblock
+syn keyword xmathCmd comment deletetransition listusertype save
+syn keyword xmathCmd copydatastore deleteusertype load sbadisplay
+syn keyword xmathCmd copystd detailmodel lock set
+syn keyword xmathCmd copysuperblock display minmax_display setsbdefault
+syn keyword xmathCmd createblock documentit modifyblock show
+syn keyword xmathCmd createbubble editcatalog modifybubble showlicense
+syn keyword xmathCmd createconnection erase modifystd showsbdefault
+syn keyword xmathCmd creatertf expandsuperbubble modifysuperblock stop
+syn keyword xmathCmd createstd for modifytransition stopcosim
+syn keyword xmathCmd createsuperblock go modifyusertype syntax
+syn keyword xmathCmd createsuperbubble goto new unalias
+syn keyword xmathCmd createtransition hardcopy next unlock
+syn keyword xmathCmd createusertype help polargraph usertype
+syn keyword xmathCmd delete hyperbuild print whatis
+syn keyword xmathCmd deleteblock if printmodel while
+syn keyword xmathCmd deletebubble ifilter quit who
+syn keyword xmathCmd deleteconnection ipcwc remove xgraph
+
+syn keyword xmathFunc abcd eye irea querystdoptions
+syn keyword xmathFunc abs eyepattern is querysuperblock
+syn keyword xmathFunc acos feedback ISID querysuperblockopt
+syn keyword xmathFunc acosh fft ISID Models querytransition
+syn keyword xmathFunc adconversion fftpdm kronecker querytransitionopt
+syn keyword xmathFunc afeedback filter length qz
+syn keyword xmathFunc all find limit rampinvar
+syn keyword xmathFunc ambiguity firparks lin random
+syn keyword xmathFunc amdemod firremez lin30 randpdm
+syn keyword xmathFunc analytic firwind linearfm randpert
+syn keyword xmathFunc analyze fmdemod linfnorm randsys
+syn keyword xmathFunc any forwdiff lintodb rank
+syn keyword xmathFunc append fprintf list rayleigh
+syn keyword xmathFunc argn frac log rcepstrum
+syn keyword xmathFunc argv fracred log10 rcond
+syn keyword xmathFunc arma freq logm rdintegrate
+syn keyword xmathFunc arma2ss freqcircle lognormal read
+syn keyword xmathFunc armax freqcont logspace real
+syn keyword xmathFunc ascii frequencyhop lowpass rectify
+syn keyword xmathFunc asin fsesti lpopt redschur
+syn keyword xmathFunc asinh fslqgcomp lqgcomp reflect
+syn keyword xmathFunc atan fsregu lqgltr regulator
+syn keyword xmathFunc atan2 fwls ls residue
+syn keyword xmathFunc atanh gabor ls2unc riccati
+syn keyword xmathFunc attach_ac100 garb ls2var riccati_eig
+syn keyword xmathFunc backdiff gaussian lsjoin riccati_schur
+syn keyword xmathFunc balance gcexp lu ricean
+syn keyword xmathFunc balmoore gcos lyapunov rifd
+syn keyword xmathFunc bandpass gdfileselection makecontinuous rlinfo
+syn keyword xmathFunc bandstop gdmessage makematrix rlocus
+syn keyword xmathFunc bj gdselection makepoly rms
+syn keyword xmathFunc blknorm genconv margin rootlocus
+syn keyword xmathFunc bode get markoff roots
+syn keyword xmathFunc bpm get_info30 matchedpz round
+syn keyword xmathFunc bpm2inn get_inn max rref
+syn keyword xmathFunc bpmjoin gfdm maxlike rve_get
+syn keyword xmathFunc bpmsplit gfsk mean rve_info
+syn keyword xmathFunc bst gfskernel mergeseg rve_reset
+syn keyword xmathFunc buttconstr gfunction min rve_update
+syn keyword xmathFunc butterworth ggauss minimal samplehold
+syn keyword xmathFunc cancel giv mkpert schur
+syn keyword xmathFunc canform giv2var mkphase sdf
+syn keyword xmathFunc ccepstrum givjoin mma sds
+syn keyword xmathFunc char gpsk mmaget sdtrsp
+syn keyword xmathFunc chebconstr gpulse mmaput sec
+syn keyword xmathFunc chebyshev gqam mod sech
+syn keyword xmathFunc check gqpsk modal siginterp
+syn keyword xmathFunc cholesky gramp modalstate sign
+syn keyword xmathFunc chop gsawtooth modcarrier sim
+syn keyword xmathFunc circonv gsigmoid mreduce sim30
+syn keyword xmathFunc circorr gsin mtxplt simin
+syn keyword xmathFunc clock gsinc mu simin30
+syn keyword xmathFunc clocus gsqpsk mulhank simout
+syn keyword xmathFunc clsys gsquarewave multipath simout30
+syn keyword xmathFunc coherence gstep musynfit simtransform
+syn keyword xmathFunc colorind GuiDialogCreate mxstr2xmstr sin
+syn keyword xmathFunc combinepf GuiDialogDestroy mxstring2xmstring singriccati
+syn keyword xmathFunc commentof GuiFlush names sinh
+syn keyword xmathFunc compare GuiGetValue nichols sinm
+syn keyword xmathFunc complementaryerf GuiManage noisefilt size
+syn keyword xmathFunc complexenvelope GuiPlot none smargin
+syn keyword xmathFunc complexfreqshift GuiPlotGet norm sns2sys
+syn keyword xmathFunc concatseg GuiSetValue numden sort
+syn keyword xmathFunc condition GuiShellCreate nyquist spectrad
+syn keyword xmathFunc conj GuiShellDeiconify obscf spectrum
+syn keyword xmathFunc conmap GuiShellDestroy observable spline
+syn keyword xmathFunc connect GuiShellIconify oe sprintf
+syn keyword xmathFunc conpdm GuiShellLower ones sqrt
+syn keyword xmathFunc constellation GuiShellRaise ophank sqrtm
+syn keyword xmathFunc consys GuiShellRealize optimize sresidualize
+syn keyword xmathFunc controllable GuiShellUnrealize optscale ss2arma
+syn keyword xmathFunc convolve GuiTimer orderfilt sst
+syn keyword xmathFunc correlate GuiToolCreate orderstate ssv
+syn keyword xmathFunc cos GuiToolDestroy orth stable
+syn keyword xmathFunc cosh GuiToolExist oscmd stair
+syn keyword xmathFunc cosm GuiUnmanage oscope starp
+syn keyword xmathFunc cot GuiWidgetExist osscale step
+syn keyword xmathFunc coth h2norm padcrop stepinvar
+syn keyword xmathFunc covariance h2syn partialsum string
+syn keyword xmathFunc csc hadamard pdm stringex
+syn keyword xmathFunc csch hankelsv pdmslice substr
+syn keyword xmathFunc csum hessenberg pem subsys
+syn keyword xmathFunc ctrcf highpass perfplots sum
+syn keyword xmathFunc ctrlplot hilbert period svd
+syn keyword xmathFunc daug hilberttransform pfscale svplot
+syn keyword xmathFunc dbtolin hinfcontr phaseshift sweep
+syn keyword xmathFunc dct hinfnorm pinv symbolmap
+syn keyword xmathFunc decimate hinfsyn plot sys2sns
+syn keyword xmathFunc defFreqRange histogram plot30 sysic
+syn keyword xmathFunc defTimeRange idfreq pmdemod Sysid
+syn keyword xmathFunc delay idimpulse poisson system
+syn keyword xmathFunc delsubstr idsim poissonimpulse tan
+syn keyword xmathFunc det ifft poleplace tanh
+syn keyword xmathFunc detrend imag poles taper
+syn keyword xmathFunc dht impinvar polezero tfid
+syn keyword xmathFunc diagonal impplot poltrend toeplitz
+syn keyword xmathFunc differentiate impulse polyfit trace
+syn keyword xmathFunc directsequence index polynomial tril
+syn keyword xmathFunc discretize indexlist polyval trim
+syn keyword xmathFunc divide initial polyvalm trim30
+syn keyword xmathFunc domain initmodel prbs triu
+syn keyword xmathFunc dst initx0 product trsp
+syn keyword xmathFunc eig inn2bpm psd truncate
+syn keyword xmathFunc ellipconstr inn2pe put_inn tustin
+syn keyword xmathFunc elliptic inn2unc qpopt uniform
+syn keyword xmathFunc erf insertseg qr val
+syn keyword xmathFunc error int quantize variance
+syn keyword xmathFunc estimator integrate queryblock videolines
+syn keyword xmathFunc etfe integratedump queryblockoptions wcbode
+syn keyword xmathFunc exist interp querybubble wcgain
+syn keyword xmathFunc exp interpolate querybubbleoptionswindow
+syn keyword xmathFunc expm inv querycatalog wtbalance
+syn keyword xmathFunc extractchan invhilbert queryconnection zeros
+syn keyword xmathFunc extractseg iqmix querystd
+
+syn case match
+
+" Labels (supports xmath's goto)
+syn match xmathLabel "^\s*<[a-zA-Z_][a-zA-Z0-9]*>"
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match xmathSpecial contained "\\\d\d\d\|\\."
+syn region xmathString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=xmathSpecial
+syn match xmathCharacter "'[^\\]'"
+syn match xmathSpecialChar "'\\.'"
+
+syn match xmathNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+
+" Comments:
+" xmath supports #... (like Unix shells)
+" and #{ ... }# comment blocks
+syn keyword xmathTodo contained TODO Todo DEBUG
+syn match xmathComment "#.*$" contains=xmathString,xmathTodo,@Spell
+syn region xmathCommentBlock start="#{" end="}#" contains=xmathString,xmathTodo
+
+" synchronizing
+syn sync match xmathSyncComment grouphere xmathCommentBlock "#{"
+syn sync match xmathSyncComment groupthere NONE "}#"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xmath_syntax_inits")
+ if version < 508
+ let did_xmath_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xmathBraceError xmathError
+ HiLink xmathCmd xmathStatement
+ HiLink xmathCommentBlock xmathComment
+ HiLink xmathCurlyError xmathError
+ HiLink xmathFuncCmd xmathStatement
+ HiLink xmathParenError xmathError
+
+ " The default methods for highlighting. Can be overridden later
+ HiLink xmathCharacter Character
+ HiLink xmathComma Delimiter
+ HiLink xmathComment Comment
+ HiLink xmathCommentBlock Comment
+ HiLink xmathConditional Conditional
+ HiLink xmathError Error
+ HiLink xmathFunc Function
+ HiLink xmathLabel PreProc
+ HiLink xmathNumber Number
+ HiLink xmathRepeat Repeat
+ HiLink xmathSpecial Type
+ HiLink xmathSpecialChar SpecialChar
+ HiLink xmathStatement Statement
+ HiLink xmathString String
+ HiLink xmathTodo Todo
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xmath"
+
+" vim: ts=17
diff --git a/runtime/syntax/xml.vim b/runtime/syntax/xml.vim
new file mode 100644
index 000000000..af6c626cf
--- /dev/null
+++ b/runtime/syntax/xml.vim
@@ -0,0 +1,344 @@
+" Vim syntax file
+" Language: XML
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Author and previous maintainer:
+" Paul Siegmann <pauls@euronet.nl>
+" Last Change: Fri, 04 Jun 2004 10:41:54 CEST
+" Filenames: *.xml
+" $Id$
+
+" CONFIGURATION:
+" syntax folding can be turned on by
+"
+" let g:xml_syntax_folding = 1
+"
+" before the syntax file gets loaded (e.g. in ~/.vimrc).
+" This might slow down syntax highlighting significantly,
+" especially for large files.
+"
+" CREDITS:
+" The original version was derived by Paul Siegmann from
+" Claudio Fleiner's html.vim.
+"
+" REFERENCES:
+" [1] http://www.w3.org/TR/2000/REC-xml-20001006
+" [2] http://www.w3.org/XML/1998/06/xmlspec-report-19980910.htm
+"
+" as <hirauchi@kiwi.ne.jp> pointed out according to reference [1]
+"
+" 2.3 Common Syntactic Constructs
+" [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
+" [5] Name ::= (Letter | '_' | ':') (NameChar)*
+"
+" NOTE:
+" 1) empty tag delimiters "/>" inside attribute values (strings)
+" confuse syntax highlighting.
+" 2) for large files, folding can be pretty slow, especially when
+" loading a file the first time and viewoptions contains 'folds'
+" so that folds of previous sessions are applied.
+" Don't use 'foldmethod=syntax' in this case.
+
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:xml_cpo_save = &cpo
+set cpo&vim
+
+syn case match
+
+" mark illegal characters
+syn match xmlError "[<&]"
+
+" strings (inside tags) aka VALUES
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^^^^^
+syn region xmlString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=xmlEntity display
+syn region xmlString contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=xmlEntity display
+
+
+" punctuation (within attributes) e.g. <tag xml:foo.attribute ...>
+" ^ ^
+" syn match xmlAttribPunct +[-:._]+ contained display
+syn match xmlAttribPunct +[:.]+ contained display
+
+" no highlighting for xmlEqual (xmlEqual has no highlighting group)
+syn match xmlEqual +=+ display
+
+
+" attribute, everything before the '='
+"
+" PROVIDES: @xmlAttribHook
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^^^^^^^^^^^
+"
+syn match xmlAttrib
+ \ +[-'"<]\@<!\<[a-zA-Z:_][-.0-9a-zA-Z0-9:_]*\>\(['">]\@!\|$\)+
+ \ contained
+ \ contains=xmlAttribPunct,@xmlAttribHook
+ \ display
+
+
+" namespace spec
+"
+" PROVIDES: @xmlNamespaceHook
+"
+" EXAMPLE:
+"
+" <xsl:for-each select = "lola">
+" ^^^
+"
+if exists("g:xml_namespace_transparent")
+syn match xmlNamespace
+ \ +\(<\|</\)\@<=[^ /!?<>"':]\+[:]\@=+
+ \ contained
+ \ contains=@xmlNamespaceHook
+ \ transparent
+ \ display
+else
+syn match xmlNamespace
+ \ +\(<\|</\)\@<=[^ /!?<>"':]\+[:]\@=+
+ \ contained
+ \ contains=@xmlNamespaceHook
+ \ display
+endif
+
+
+" tag name
+"
+" PROVIDES: @xmlTagHook
+"
+" EXAMPLE:
+"
+" <tag foo.attribute = "value">
+" ^^^
+"
+syn match xmlTagName
+ \ +[<]\@<=[^ /!?<>"']\++
+ \ contained
+ \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
+ \ display
+
+
+if exists('g:xml_syntax_folding')
+
+ " start tag
+ " use matchgroup=xmlTag to skip over the leading '<'
+ "
+ " PROVIDES: @xmlStartTagHook
+ "
+ " EXAMPLE:
+ "
+ " <tag id="whoops">
+ " s^^^^^^^^^^^^^^^e
+ "
+ syn region xmlTag
+ \ matchgroup=xmlTag start=+<[^ /!?<>"']\@=+
+ \ matchgroup=xmlTag end=+>+
+ \ contained
+ \ contains=xmlError,xmlTagName,xmlAttrib,xmlEqual,xmlString,@xmlStartTagHook
+
+
+ " highlight the end tag
+ "
+ " PROVIDES: @xmlTagHook
+ " (should we provide a separate @xmlEndTagHook ?)
+ "
+ " EXAMPLE:
+ "
+ " </tag>
+ " ^^^^^^
+ "
+ syn match xmlEndTag
+ \ +</[^ /!?<>"']\+>+
+ \ contained
+ \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
+
+
+ " tag elements with syntax-folding.
+ " NOTE: NO HIGHLIGHTING -- highlighting is done by contained elements
+ "
+ " PROVIDES: @xmlRegionHook
+ "
+ " EXAMPLE:
+ "
+ " <tag id="whoops">
+ " <!-- comment -->
+ " <another.tag></another.tag>
+ " <empty.tag/>
+ " some data
+ " </tag>
+ "
+ syn region xmlRegion
+ \ start=+<\z([^ /!?<>"']\+\)+
+ \ skip=+<!--\_.\{-}-->+
+ \ end=+</\z1\_\s\{-}>+
+ \ matchgroup=xmlEndTag end=+/>+
+ \ fold
+ \ contains=xmlTag,xmlEndTag,xmlCdata,xmlRegion,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook
+ \ keepend
+ \ extend
+
+else
+
+ " no syntax folding:
+ " - contained attribute removed
+ " - xmlRegion not defined
+ "
+ syn region xmlTag
+ \ matchgroup=xmlTag start=+<[^ /!?<>"']\@=+
+ \ matchgroup=xmlTag end=+>+
+ \ contains=xmlError,xmlTagName,xmlAttrib,xmlEqual,xmlString,@xmlStartTagHook
+
+ syn match xmlEndTag
+ \ +</[^ /!?<>"']\+>+
+ \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook
+
+endif
+
+
+" &entities; compare with dtd
+syn match xmlEntity "&[^; \t]*;" contains=xmlEntityPunct
+syn match xmlEntityPunct contained "[&.;]"
+
+if exists('g:xml_syntax_folding')
+
+ " The real comments (this implements the comments as defined by xml,
+ " but not all xml pages actually conform to it. Errors are flagged.
+ syn region xmlComment
+ \ start=+<!+
+ \ end=+>+
+ \ contains=xmlCommentPart,xmlCommentError
+ \ extend
+ \ fold
+
+else
+
+ " no syntax folding:
+ " - fold attribute removed
+ "
+ syn region xmlComment
+ \ start=+<!+
+ \ end=+>+
+ \ contains=xmlCommentPart,xmlCommentError
+ \ extend
+
+endif
+
+syn keyword xmlTodo contained TODO FIXME XXX display
+syn match xmlCommentError contained "[^><!]"
+syn region xmlCommentPart
+ \ start=+--+
+ \ end=+--+
+ \ contained
+ \ contains=xmlTodo,@xmlCommentHook
+
+
+" CData sections
+"
+" PROVIDES: @xmlCdataHook
+"
+syn region xmlCdata
+ \ start=+<!\[CDATA\[+
+ \ end=+]]>+
+ \ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook
+ \ keepend
+ \ extend
+
+" using the following line instead leads to corrupt folding at CDATA regions
+" syn match xmlCdata +<!\[CDATA\[\_.\{-}]]>+ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook
+syn match xmlCdataStart +<!\[CDATA\[+ contained contains=xmlCdataCdata
+syn keyword xmlCdataCdata CDATA contained
+syn match xmlCdataEnd +]]>+ contained
+
+
+" Processing instructions
+" This allows "?>" inside strings -- good idea?
+syn region xmlProcessing matchgroup=xmlProcessingDelim start="<?" end="?>" contains=xmlAttrib,xmlEqual,xmlString
+
+
+if exists('g:xml_syntax_folding')
+
+ " DTD -- we use dtd.vim here
+ syn region xmlDocType matchgroup=xmlDocTypeDecl
+ \ start="<!DOCTYPE"he=s+2,rs=s+2 end=">"
+ \ fold
+ \ contains=xmlDocTypeKeyword,xmlInlineDTD,xmlString
+else
+
+ " no syntax folding:
+ " - fold attribute removed
+ "
+ syn region xmlDocType matchgroup=xmlDocTypeDecl
+ \ start="<!DOCTYPE"he=s+2,rs=s+2 end=">"
+ \ contains=xmlDocTypeKeyword,xmlInlineDTD,xmlString
+
+endif
+
+syn keyword xmlDocTypeKeyword contained DOCTYPE PUBLIC SYSTEM
+syn region xmlInlineDTD contained matchgroup=xmlDocTypeDecl start="\[" end="]" contains=@xmlDTD
+syn include @xmlDTD <sfile>:p:h/dtd.vim
+unlet b:current_syntax
+
+
+" synchronizing
+" TODO !!! to be improved !!!
+
+syn sync match xmlSyncDT grouphere xmlDocType +\_.\(<!DOCTYPE\)\@=+
+" syn sync match xmlSyncDT groupthere NONE +]>+
+
+if exists('g:xml_syntax_folding')
+ syn sync match xmlSync grouphere xmlRegion +\_.\(<[^ /!?<>"']\+\)\@=+
+ " syn sync match xmlSync grouphere xmlRegion "<[^ /!?<>"']*>"
+ syn sync match xmlSync groupthere xmlRegion +</[^ /!?<>"']\+>+
+endif
+
+syn sync minlines=100
+
+
+" The default highlighting.
+hi def link xmlTodo Todo
+hi def link xmlTag Function
+hi def link xmlTagName Function
+hi def link xmlEndTag Identifier
+if !exists("g:xml_namespace_transparent")
+ hi def link xmlNamespace Tag
+endif
+hi def link xmlEntity Statement
+hi def link xmlEntityPunct Type
+
+hi def link xmlAttribPunct Comment
+hi def link xmlAttrib Type
+
+hi def link xmlString String
+hi def link xmlComment Comment
+hi def link xmlCommentPart Comment
+hi def link xmlCommentError Error
+hi def link xmlError Error
+
+hi def link xmlProcessingDelim Comment
+hi def link xmlProcessing Type
+
+hi def link xmlCdata String
+hi def link xmlCdataCdata Statement
+hi def link xmlCdataStart Type
+hi def link xmlCdataEnd Type
+
+hi def link xmlDocTypeDecl Function
+hi def link xmlDocTypeKeyword Statement
+hi def link xmlInlineDTD Function
+
+let b:current_syntax = "xml"
+
+let &cpo = s:xml_cpo_save
+unlet s:xml_cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/xmodmap.vim b/runtime/syntax/xmodmap.vim
new file mode 100644
index 000000000..77218845c
--- /dev/null
+++ b/runtime/syntax/xmodmap.vim
@@ -0,0 +1,172 @@
+" Vim syntax file
+" Language: xmodmap definition file
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/xmodmap/
+" Latest Revision: 2004-05-22
+" arch-tag: 8c37ed41-655a-479d-8050-e15dc6770338
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" comments
+syn region xmodmapComment display oneline matchgroup=xmodmapComment start=/^!/ end=/$/ contains=xmodmapTodo
+
+" todo
+syn keyword xmodmapTodo contained TODO FIXME XXX NOTE
+
+" numbers
+syn case ignore
+syn match xmodmapInt display "\<\d\+\>"
+syn match xmodmapHex display "\<0x\x\+\>"
+syn match xmodmapOctal display "\<0\o\+\>"
+syn match xmodmapOctalError display "\<0\o*[89]\d*"
+syn case match
+
+" keysyms (taken from <X11/keysymdef.h>)
+syn keyword xmodmapKeySym VoidSymbol BackSpace Tab Linefeed Clear Return Pause Scroll_Lock Sys_Req Escape Delete Multi_key Codeinput SingleCandidate MultipleCandidate
+syn keyword xmodmapKeySym PreviousCandidate Kanji Muhenkan Henkan_Mode Henkan Romaji Hiragana Katakana Hiragana_Katakana Zenkaku Hankaku Zenkaku_Hankaku Touroku Massyo Kana_Lock
+syn keyword xmodmapKeySym Kana_Shift Eisu_Shift Eisu_toggle Kanji_Bangou Zen_Koho Mae_Koho Home Left Up Right Down Prior Page_Up Next Page_Down
+syn keyword xmodmapKeySym End Begin Select Print Execute Insert Undo Redo Menu Find Cancel Help Break Mode_switch script_switch
+syn keyword xmodmapKeySym Num_Lock KP_Space KP_Tab KP_Enter KP_F1 KP_F2 KP_F3 KP_F4 KP_Home KP_Left KP_Up KP_Right KP_Down KP_Prior KP_Page_Up
+syn keyword xmodmapKeySym KP_Next KP_Page_Down KP_End KP_Begin KP_Insert KP_Delete KP_Equal KP_Multiply KP_Add KP_Separator KP_Subtract KP_Decimal KP_Divide KP_0 KP_1
+syn keyword xmodmapKeySym KP_2 KP_3 KP_4 KP_5 KP_6 KP_7 KP_8 KP_9 F1 F2 F3 F4 F5 F6 F7
+syn keyword xmodmapKeySym F8 F9 F10 F11 L1 F12 L2 F13 L3 F14 L4 F15 L5 F16 L6
+syn keyword xmodmapKeySym F17 L7 F18 L8 F19 L9 F20 L10 F21 R1 F22 R2 F23 R3 F24
+syn keyword xmodmapKeySym R4 F25 R5 F26 R6 F27 R7 F28 R8 F29 R9 F30 R10 F31 R11
+syn keyword xmodmapKeySym F32 R12 F33 R13 F34 R14 F35 R15 Shift_L Shift_R Control_L Control_R Caps_Lock Shift_Lock Meta_L
+syn keyword xmodmapKeySym Meta_R Alt_L Alt_R Super_L Super_R Hyper_L Hyper_R ISO_Lock ISO_Level2_Latch ISO_Level3_Shift ISO_Level3_Latch ISO_Level3_Lock ISO_Group_Shift ISO_Group_Latch ISO_Group_Lock
+syn keyword xmodmapKeySym ISO_Next_Group ISO_Next_Group_Lock ISO_Prev_Group ISO_Prev_Group_Lock ISO_First_Group ISO_First_Group_Lock ISO_Last_Group ISO_Last_Group_Lock ISO_Left_Tab ISO_Move_Line_Up ISO_Move_Line_Down ISO_Partial_Line_Up ISO_Partial_Line_Down ISO_Partial_Space_Left ISO_Partial_Space_Right
+syn keyword xmodmapKeySym ISO_Set_Margin_Left ISO_Set_Margin_Right ISO_Release_Margin_Left ISO_Release_Margin_Right ISO_Release_Both_Margins ISO_Fast_Cursor_Left ISO_Fast_Cursor_Right ISO_Fast_Cursor_Up ISO_Fast_Cursor_Down ISO_Continuous_Underline ISO_Discontinuous_Underline ISO_Emphasize ISO_Center_Object ISO_Enter dead_grave
+syn keyword xmodmapKeySym dead_acute dead_circumflex dead_tilde dead_macron dead_breve dead_abovedot dead_diaeresis dead_abovering dead_doubleacute dead_caron dead_cedilla dead_ogonek dead_iota dead_voiced_sound dead_semivoiced_sound
+syn keyword xmodmapKeySym dead_belowdot dead_hook dead_horn First_Virtual_Screen Prev_Virtual_Screen Next_Virtual_Screen Last_Virtual_Screen Terminate_Server AccessX_Enable AccessX_Feedback_Enable RepeatKeys_Enable SlowKeys_Enable BounceKeys_Enable StickyKeys_Enable MouseKeys_Enable
+syn keyword xmodmapKeySym MouseKeys_Accel_Enable Overlay1_Enable Overlay2_Enable AudibleBell_Enable Pointer_Left Pointer_Right Pointer_Up Pointer_Down Pointer_UpLeft Pointer_UpRight Pointer_DownLeft Pointer_DownRight Pointer_Button_Dflt Pointer_Button1 Pointer_Button2
+syn keyword xmodmapKeySym Pointer_Button3 Pointer_Button4 Pointer_Button5 Pointer_DblClick_Dflt Pointer_DblClick1 Pointer_DblClick2 Pointer_DblClick3 Pointer_DblClick4 Pointer_DblClick5 Pointer_Drag_Dflt Pointer_Drag1 Pointer_Drag2 Pointer_Drag3 Pointer_Drag4 Pointer_Drag5
+syn keyword xmodmapKeySym Pointer_EnableKeys Pointer_Accelerate Pointer_DfltBtnNext Pointer_DfltBtnPrev 3270_Duplicate 3270_FieldMark 3270_Right2 3270_Left2 3270_BackTab 3270_EraseEOF 3270_EraseInput 3270_Reset 3270_Quit 3270_PA1 3270_PA2
+syn keyword xmodmapKeySym 3270_PA3 3270_Test 3270_Attn 3270_CursorBlink 3270_AltCursor 3270_KeyClick 3270_Jump 3270_Ident 3270_Rule 3270_Copy 3270_Play 3270_Setup 3270_Record 3270_ChangeScreen 3270_DeleteWord
+syn keyword xmodmapKeySym 3270_ExSelect 3270_CursorSelect 3270_PrintScreen 3270_Enter space exclam quotedbl numbersign dollar percent ampersand apostrophe quoteright parenleft parenright
+syn keyword xmodmapKeySym asterisk plus comma minus period slash 0 1 2 3 4 5 6 7 8
+syn keyword xmodmapKeySym 9 colon semicolon less equal greater question at A B C D E F G
+syn keyword xmodmapKeySym H I J K L M N O P Q R S T U V
+syn keyword xmodmapKeySym W X Y Z bracketleft backslash bracketright asciicircum underscore grave quoteleft a b c d
+syn keyword xmodmapKeySym e f g h i j k l m n o p q r s
+syn keyword xmodmapKeySym t u v w x y z braceleft bar braceright asciitilde nobreakspace exclamdown cent sterling
+syn keyword xmodmapKeySym currency yen brokenbar section diaeresis copyright ordfeminine guillemotleft notsign hyphen registered macron degree plusminus twosuperior
+syn keyword xmodmapKeySym threesuperior acute mu paragraph periodcentered cedilla onesuperior masculine guillemotright onequarter onehalf threequarters questiondown Agrave Aacute
+syn keyword xmodmapKeySym Acircumflex Atilde Adiaeresis Aring AE Ccedilla Egrave Eacute Ecircumflex Ediaeresis Igrave Iacute Icircumflex Idiaeresis ETH
+syn keyword xmodmapKeySym Eth Ntilde Ograve Oacute Ocircumflex Otilde Odiaeresis multiply Ooblique Oslash Ugrave Uacute Ucircumflex Udiaeresis Yacute
+syn keyword xmodmapKeySym THORN Thorn ssharp agrave aacute acircumflex atilde adiaeresis aring ae ccedilla egrave eacute ecircumflex ediaeresis
+syn keyword xmodmapKeySym igrave iacute icircumflex idiaeresis eth ntilde ograve oacute ocircumflex otilde odiaeresis division oslash ooblique ugrave
+syn keyword xmodmapKeySym uacute ucircumflex udiaeresis yacute thorn ydiaeresis Aogonek breve Lstroke Lcaron Sacute Scaron Scedilla Tcaron Zacute
+syn keyword xmodmapKeySym Zcaron Zabovedot aogonek ogonek lstroke lcaron sacute caron scaron scedilla tcaron zacute doubleacute zcaron zabovedot
+syn keyword xmodmapKeySym Racute Abreve Lacute Cacute Ccaron Eogonek Ecaron Dcaron Dstroke Nacute Ncaron Odoubleacute Rcaron Uring Udoubleacute
+syn keyword xmodmapKeySym Tcedilla racute abreve lacute cacute ccaron eogonek ecaron dcaron dstroke nacute ncaron odoubleacute udoubleacute rcaron
+syn keyword xmodmapKeySym uring tcedilla abovedot Hstroke Hcircumflex Iabovedot Gbreve Jcircumflex hstroke hcircumflex idotless gbreve jcircumflex Cabovedot Ccircumflex
+syn keyword xmodmapKeySym Gabovedot Gcircumflex Ubreve Scircumflex cabovedot ccircumflex gabovedot gcircumflex ubreve scircumflex kra kappa Rcedilla Itilde Lcedilla
+syn keyword xmodmapKeySym Emacron Gcedilla Tslash rcedilla itilde lcedilla emacron gcedilla tslash ENG eng Amacron Iogonek Eabovedot Imacron
+syn keyword xmodmapKeySym Ncedilla Omacron Kcedilla Uogonek Utilde Umacron amacron iogonek eabovedot imacron ncedilla omacron kcedilla uogonek utilde
+syn keyword xmodmapKeySym umacron Babovedot babovedot Dabovedot Wgrave Wacute dabovedot Ygrave Fabovedot fabovedot Mabovedot mabovedot Pabovedot wgrave pabovedot
+syn keyword xmodmapKeySym wacute Sabovedot ygrave Wdiaeresis wdiaeresis sabovedot Wcircumflex Tabovedot Ycircumflex wcircumflex tabovedot ycircumflex OE oe Ydiaeresis
+syn keyword xmodmapKeySym overline kana_fullstop kana_openingbracket kana_closingbracket kana_comma kana_conjunctive kana_middledot kana_WO kana_a kana_i kana_u kana_e kana_o kana_ya kana_yu
+syn keyword xmodmapKeySym kana_yo kana_tsu kana_tu prolongedsound kana_A kana_I kana_U kana_E kana_O kana_KA kana_KI kana_KU kana_KE kana_KO kana_SA
+syn keyword xmodmapKeySym kana_SHI kana_SU kana_SE kana_SO kana_TA kana_CHI kana_TI kana_TSU kana_TU kana_TE kana_TO kana_NA kana_NI kana_NU kana_NE
+syn keyword xmodmapKeySym kana_NO kana_HA kana_HI kana_FU kana_HU kana_HE kana_HO kana_MA kana_MI kana_MU kana_ME kana_MO kana_YA kana_YU kana_YO
+syn keyword xmodmapKeySym kana_RA kana_RI kana_RU kana_RE kana_RO kana_WA kana_N voicedsound semivoicedsound kana_switch Farsi_0 Farsi_1 Farsi_2 Farsi_3 Farsi_4
+syn keyword xmodmapKeySym Farsi_5 Farsi_6 Farsi_7 Farsi_8 Farsi_9 Arabic_percent Arabic_superscript_alef Arabic_tteh Arabic_peh Arabic_tcheh Arabic_ddal Arabic_rreh Arabic_comma Arabic_fullstop Arabic_0
+syn keyword xmodmapKeySym Arabic_1 Arabic_2 Arabic_3 Arabic_4 Arabic_5 Arabic_6 Arabic_7 Arabic_8 Arabic_9 Arabic_semicolon Arabic_question_mark Arabic_hamza Arabic_maddaonalef Arabic_hamzaonalef Arabic_hamzaonwaw
+syn keyword xmodmapKeySym Arabic_hamzaunderalef Arabic_hamzaonyeh Arabic_alef Arabic_beh Arabic_tehmarbuta Arabic_teh Arabic_theh Arabic_jeem Arabic_hah Arabic_khah Arabic_dal Arabic_thal Arabic_ra Arabic_zain Arabic_seen
+syn keyword xmodmapKeySym Arabic_sheen Arabic_sad Arabic_dad Arabic_tah Arabic_zah Arabic_ain Arabic_ghain Arabic_tatweel Arabic_feh Arabic_qaf Arabic_kaf Arabic_lam Arabic_meem Arabic_noon Arabic_ha
+syn keyword xmodmapKeySym Arabic_heh Arabic_waw Arabic_alefmaksura Arabic_yeh Arabic_fathatan Arabic_dammatan Arabic_kasratan Arabic_fatha Arabic_damma Arabic_kasra Arabic_shadda Arabic_sukun Arabic_madda_above Arabic_hamza_above Arabic_hamza_below
+syn keyword xmodmapKeySym Arabic_jeh Arabic_veh Arabic_keheh Arabic_gaf Arabic_noon_ghunna Arabic_heh_doachashmee Farsi_yeh Arabic_farsi_yeh Arabic_yeh_baree Arabic_heh_goal Arabic_switch Cyrillic_GHE_bar Cyrillic_ghe_bar Cyrillic_ZHE_descender Cyrillic_zhe_descender
+syn keyword xmodmapKeySym Cyrillic_KA_descender Cyrillic_ka_descender Cyrillic_KA_vertstroke Cyrillic_ka_vertstroke Cyrillic_EN_descender Cyrillic_en_descender Cyrillic_U_straight Cyrillic_u_straight Cyrillic_U_straight_bar Cyrillic_u_straight_bar Cyrillic_HA_descender Cyrillic_ha_descender Cyrillic_CHE_descender Cyrillic_che_descender Cyrillic_CHE_vertstroke
+syn keyword xmodmapKeySym Cyrillic_che_vertstroke Cyrillic_SHHA Cyrillic_shha Cyrillic_SCHWA Cyrillic_schwa Cyrillic_I_macron Cyrillic_i_macron Cyrillic_O_bar Cyrillic_o_bar Cyrillic_U_macron Cyrillic_u_macron Serbian_dje Macedonia_gje Cyrillic_io Ukrainian_ie
+syn keyword xmodmapKeySym Ukranian_je Macedonia_dse Ukrainian_i Ukranian_i Ukrainian_yi Ukranian_yi Cyrillic_je Serbian_je Cyrillic_lje Serbian_lje Cyrillic_nje Serbian_nje Serbian_tshe Macedonia_kje Ukrainian_ghe_with_upturn
+syn keyword xmodmapKeySym Byelorussian_shortu Cyrillic_dzhe Serbian_dze numerosign Serbian_DJE Macedonia_GJE Cyrillic_IO Ukrainian_IE Ukranian_JE Macedonia_DSE Ukrainian_I Ukranian_I Ukrainian_YI Ukranian_YI Cyrillic_JE
+syn keyword xmodmapKeySym Serbian_JE Cyrillic_LJE Serbian_LJE Cyrillic_NJE Serbian_NJE Serbian_TSHE Macedonia_KJE Ukrainian_GHE_WITH_UPTURN Byelorussian_SHORTU Cyrillic_DZHE Serbian_DZE Cyrillic_yu Cyrillic_a Cyrillic_be Cyrillic_tse
+syn keyword xmodmapKeySym Cyrillic_de Cyrillic_ie Cyrillic_ef Cyrillic_ghe Cyrillic_ha Cyrillic_i Cyrillic_shorti Cyrillic_ka Cyrillic_el Cyrillic_em Cyrillic_en Cyrillic_o Cyrillic_pe Cyrillic_ya Cyrillic_er
+syn keyword xmodmapKeySym Cyrillic_es Cyrillic_te Cyrillic_u Cyrillic_zhe Cyrillic_ve Cyrillic_softsign Cyrillic_yeru Cyrillic_ze Cyrillic_sha Cyrillic_e Cyrillic_shcha Cyrillic_che Cyrillic_hardsign Cyrillic_YU Cyrillic_A
+syn keyword xmodmapKeySym Cyrillic_BE Cyrillic_TSE Cyrillic_DE Cyrillic_IE Cyrillic_EF Cyrillic_GHE Cyrillic_HA Cyrillic_I Cyrillic_SHORTI Cyrillic_KA Cyrillic_EL Cyrillic_EM Cyrillic_EN Cyrillic_O Cyrillic_PE
+syn keyword xmodmapKeySym Cyrillic_YA Cyrillic_ER Cyrillic_ES Cyrillic_TE Cyrillic_U Cyrillic_ZHE Cyrillic_VE Cyrillic_SOFTSIGN Cyrillic_YERU Cyrillic_ZE Cyrillic_SHA Cyrillic_E Cyrillic_SHCHA Cyrillic_CHE Cyrillic_HARDSIGN
+syn keyword xmodmapKeySym Greek_ALPHAaccent Greek_EPSILONaccent Greek_ETAaccent Greek_IOTAaccent Greek_IOTAdieresis Greek_IOTAdiaeresis Greek_OMICRONaccent Greek_UPSILONaccent Greek_UPSILONdieresis Greek_OMEGAaccent Greek_accentdieresis Greek_horizbar Greek_alphaaccent Greek_epsilonaccent Greek_etaaccent
+syn keyword xmodmapKeySym Greek_iotaaccent Greek_iotadieresis Greek_iotaaccentdieresis Greek_omicronaccent Greek_upsilonaccent Greek_upsilondieresis Greek_upsilonaccentdieresis Greek_omegaaccent Greek_ALPHA Greek_BETA Greek_GAMMA Greek_DELTA Greek_EPSILON Greek_ZETA Greek_ETA
+syn keyword xmodmapKeySym Greek_THETA Greek_IOTA Greek_KAPPA Greek_LAMDA Greek_LAMBDA Greek_MU Greek_NU Greek_XI Greek_OMICRON Greek_PI Greek_RHO Greek_SIGMA Greek_TAU Greek_UPSILON Greek_PHI
+syn keyword xmodmapKeySym Greek_CHI Greek_PSI Greek_OMEGA Greek_alpha Greek_beta Greek_gamma Greek_delta Greek_epsilon Greek_zeta Greek_eta Greek_theta Greek_iota Greek_kappa Greek_lamda Greek_lambda
+syn keyword xmodmapKeySym Greek_mu Greek_nu Greek_xi Greek_omicron Greek_pi Greek_rho Greek_sigma Greek_finalsmallsigma Greek_tau Greek_upsilon Greek_phi Greek_chi Greek_psi Greek_omega Greek_switch
+syn keyword xmodmapKeySym leftradical topleftradical horizconnector topintegral botintegral vertconnector topleftsqbracket botleftsqbracket toprightsqbracket botrightsqbracket topleftparens botleftparens toprightparens botrightparens leftmiddlecurlybrace
+syn keyword xmodmapKeySym rightmiddlecurlybrace topleftsummation botleftsummation topvertsummationconnector botvertsummationconnector toprightsummation botrightsummation rightmiddlesummation lessthanequal notequal greaterthanequal integral therefore variation infinity
+syn keyword xmodmapKeySym nabla approximate similarequal ifonlyif implies identical radical includedin includes intersection union logicaland logicalor partialderivative function
+syn keyword xmodmapKeySym leftarrow uparrow rightarrow downarrow blank soliddiamond checkerboard ht ff cr lf nl vt lowrightcorner uprightcorner
+syn keyword xmodmapKeySym upleftcorner lowleftcorner crossinglines horizlinescan1 horizlinescan3 horizlinescan5 horizlinescan7 horizlinescan9 leftt rightt bott topt vertbar emspace enspace
+syn keyword xmodmapKeySym em3space em4space digitspace punctspace thinspace hairspace emdash endash signifblank ellipsis doubbaselinedot onethird twothirds onefifth twofifths
+syn keyword xmodmapKeySym threefifths fourfifths onesixth fivesixths careof figdash leftanglebracket decimalpoint rightanglebracket marker oneeighth threeeighths fiveeighths seveneighths trademark
+syn keyword xmodmapKeySym signaturemark trademarkincircle leftopentriangle rightopentriangle emopencircle emopenrectangle leftsinglequotemark rightsinglequotemark leftdoublequotemark rightdoublequotemark prescription minutes seconds latincross hexagram
+syn keyword xmodmapKeySym filledrectbullet filledlefttribullet filledrighttribullet emfilledcircle emfilledrect enopencircbullet enopensquarebullet openrectbullet opentribulletup opentribulletdown openstar enfilledcircbullet enfilledsqbullet filledtribulletup filledtribulletdown
+syn keyword xmodmapKeySym leftpointer rightpointer club diamond heart maltesecross dagger doubledagger checkmark ballotcross musicalsharp musicalflat malesymbol femalesymbol telephone
+syn keyword xmodmapKeySym telephonerecorder phonographcopyright caret singlelowquotemark doublelowquotemark cursor leftcaret rightcaret downcaret upcaret overbar downtack upshoe downstile underbar
+syn keyword xmodmapKeySym jot quad uptack circle upstile downshoe rightshoe leftshoe lefttack righttack hebrew_doublelowline hebrew_aleph hebrew_bet hebrew_beth hebrew_gimel
+syn keyword xmodmapKeySym hebrew_gimmel hebrew_dalet hebrew_daleth hebrew_he hebrew_waw hebrew_zain hebrew_zayin hebrew_chet hebrew_het hebrew_tet hebrew_teth hebrew_yod hebrew_finalkaph hebrew_kaph hebrew_lamed
+syn keyword xmodmapKeySym hebrew_finalmem hebrew_mem hebrew_finalnun hebrew_nun hebrew_samech hebrew_samekh hebrew_ayin hebrew_finalpe hebrew_pe hebrew_finalzade hebrew_finalzadi hebrew_zade hebrew_zadi hebrew_qoph hebrew_kuf
+syn keyword xmodmapKeySym hebrew_resh hebrew_shin hebrew_taw hebrew_taf Hebrew_switch Thai_kokai Thai_khokhai Thai_khokhuat Thai_khokhwai Thai_khokhon Thai_khorakhang Thai_ngongu Thai_chochan Thai_choching Thai_chochang
+syn keyword xmodmapKeySym Thai_soso Thai_chochoe Thai_yoying Thai_dochada Thai_topatak Thai_thothan Thai_thonangmontho Thai_thophuthao Thai_nonen Thai_dodek Thai_totao Thai_thothung Thai_thothahan Thai_thothong Thai_nonu
+syn keyword xmodmapKeySym Thai_bobaimai Thai_popla Thai_phophung Thai_fofa Thai_phophan Thai_fofan Thai_phosamphao Thai_moma Thai_yoyak Thai_rorua Thai_ru Thai_loling Thai_lu Thai_wowaen Thai_sosala
+syn keyword xmodmapKeySym Thai_sorusi Thai_sosua Thai_hohip Thai_lochula Thai_oang Thai_honokhuk Thai_paiyannoi Thai_saraa Thai_maihanakat Thai_saraaa Thai_saraam Thai_sarai Thai_saraii Thai_saraue Thai_sarauee
+syn keyword xmodmapKeySym Thai_sarau Thai_sarauu Thai_phinthu Thai_maihanakat_maitho Thai_baht Thai_sarae Thai_saraae Thai_sarao Thai_saraaimaimuan Thai_saraaimaimalai Thai_lakkhangyao Thai_maiyamok Thai_maitaikhu Thai_maiek Thai_maitho
+syn keyword xmodmapKeySym Thai_maitri Thai_maichattawa Thai_thanthakhat Thai_nikhahit Thai_leksun Thai_leknung Thai_leksong Thai_leksam Thai_leksi Thai_lekha Thai_lekhok Thai_lekchet Thai_lekpaet Thai_lekkao Hangul
+syn keyword xmodmapKeySym Hangul_Start Hangul_End Hangul_Hanja Hangul_Jamo Hangul_Romaja Hangul_Codeinput Hangul_Jeonja Hangul_Banja Hangul_PreHanja Hangul_PostHanja Hangul_SingleCandidate Hangul_MultipleCandidate Hangul_PreviousCandidate Hangul_Special Hangul_switch
+syn keyword xmodmapKeySym Hangul_Kiyeog Hangul_SsangKiyeog Hangul_KiyeogSios Hangul_Nieun Hangul_NieunJieuj Hangul_NieunHieuh Hangul_Dikeud Hangul_SsangDikeud Hangul_Rieul Hangul_RieulKiyeog Hangul_RieulMieum Hangul_RieulPieub Hangul_RieulSios Hangul_RieulTieut Hangul_RieulPhieuf
+syn keyword xmodmapKeySym Hangul_RieulHieuh Hangul_Mieum Hangul_Pieub Hangul_SsangPieub Hangul_PieubSios Hangul_Sios Hangul_SsangSios Hangul_Ieung Hangul_Jieuj Hangul_SsangJieuj Hangul_Cieuc Hangul_Khieuq Hangul_Tieut Hangul_Phieuf Hangul_Hieuh
+syn keyword xmodmapKeySym Hangul_A Hangul_AE Hangul_YA Hangul_YAE Hangul_EO Hangul_E Hangul_YEO Hangul_YE Hangul_O Hangul_WA Hangul_WAE Hangul_OE Hangul_YO Hangul_U Hangul_WEO
+syn keyword xmodmapKeySym Hangul_WE Hangul_WI Hangul_YU Hangul_EU Hangul_YI Hangul_I Hangul_J_Kiyeog Hangul_J_SsangKiyeog Hangul_J_KiyeogSios Hangul_J_Nieun Hangul_J_NieunJieuj Hangul_J_NieunHieuh Hangul_J_Dikeud Hangul_J_Rieul Hangul_J_RieulKiyeog
+syn keyword xmodmapKeySym Hangul_J_RieulMieum Hangul_J_RieulPieub Hangul_J_RieulSios Hangul_J_RieulTieut Hangul_J_RieulPhieuf Hangul_J_RieulHieuh Hangul_J_Mieum Hangul_J_Pieub Hangul_J_PieubSios Hangul_J_Sios Hangul_J_SsangSios Hangul_J_Ieung Hangul_J_Jieuj Hangul_J_Cieuc Hangul_J_Khieuq
+syn keyword xmodmapKeySym Hangul_J_Tieut Hangul_J_Phieuf Hangul_J_Hieuh Hangul_RieulYeorinHieuh Hangul_SunkyeongeumMieum Hangul_SunkyeongeumPieub Hangul_PanSios Hangul_KkogjiDalrinIeung Hangul_SunkyeongeumPhieuf Hangul_YeorinHieuh Hangul_AraeA Hangul_AraeAE Hangul_J_PanSios Hangul_J_KkogjiDalrinIeung Hangul_J_YeorinHieuh
+syn keyword xmodmapKeySym Korean_Won Armenian_eternity Armenian_ligature_ew Armenian_full_stop Armenian_verjaket Armenian_parenright Armenian_parenleft Armenian_guillemotright Armenian_guillemotleft Armenian_em_dash Armenian_dot Armenian_mijaket Armenian_separation_mark Armenian_but Armenian_comma
+syn keyword xmodmapKeySym Armenian_en_dash Armenian_hyphen Armenian_yentamna Armenian_ellipsis Armenian_exclam Armenian_amanak Armenian_accent Armenian_shesht Armenian_question Armenian_paruyk Armenian_AYB Armenian_ayb Armenian_BEN Armenian_ben Armenian_GIM
+syn keyword xmodmapKeySym Armenian_gim Armenian_DA Armenian_da Armenian_YECH Armenian_yech Armenian_ZA Armenian_za Armenian_E Armenian_e Armenian_AT Armenian_at Armenian_TO Armenian_to Armenian_ZHE Armenian_zhe
+syn keyword xmodmapKeySym Armenian_INI Armenian_ini Armenian_LYUN Armenian_lyun Armenian_KHE Armenian_khe Armenian_TSA Armenian_tsa Armenian_KEN Armenian_ken Armenian_HO Armenian_ho Armenian_DZA Armenian_dza Armenian_GHAT
+syn keyword xmodmapKeySym Armenian_ghat Armenian_TCHE Armenian_tche Armenian_MEN Armenian_men Armenian_HI Armenian_hi Armenian_NU Armenian_nu Armenian_SHA Armenian_sha Armenian_VO Armenian_vo Armenian_CHA Armenian_cha
+syn keyword xmodmapKeySym Armenian_PE Armenian_pe Armenian_JE Armenian_je Armenian_RA Armenian_ra Armenian_SE Armenian_se Armenian_VEV Armenian_vev Armenian_TYUN Armenian_tyun Armenian_RE Armenian_re Armenian_TSO
+syn keyword xmodmapKeySym Armenian_tso Armenian_VYUN Armenian_vyun Armenian_PYUR Armenian_pyur Armenian_KE Armenian_ke Armenian_O Armenian_o Armenian_FE Armenian_fe Armenian_apostrophe Armenian_section_sign Georgian_an Georgian_ban
+syn keyword xmodmapKeySym Georgian_gan Georgian_don Georgian_en Georgian_vin Georgian_zen Georgian_tan Georgian_in Georgian_kan Georgian_las Georgian_man Georgian_nar Georgian_on Georgian_par Georgian_zhar Georgian_rae
+syn keyword xmodmapKeySym Georgian_san Georgian_tar Georgian_un Georgian_phar Georgian_khar Georgian_ghan Georgian_qar Georgian_shin Georgian_chin Georgian_can Georgian_jil Georgian_cil Georgian_char Georgian_xan Georgian_jhan
+syn keyword xmodmapKeySym Georgian_hae Georgian_he Georgian_hie Georgian_we Georgian_har Georgian_hoe Georgian_fi Ccedillaabovedot Xabovedot Qabovedot Ibreve IE UO Zstroke Gcaron
+syn keyword xmodmapKeySym Obarred ccedillaabovedot xabovedot Ocaron qabovedot ibreve ie uo zstroke gcaron ocaron obarred SCHWA schwa Lbelowdot
+syn keyword xmodmapKeySym Lstrokebelowdot lbelowdot lstrokebelowdot Gtilde gtilde Abelowdot abelowdot Ahook ahook Acircumflexacute acircumflexacute Acircumflexgrave acircumflexgrave Acircumflexhook acircumflexhook
+syn keyword xmodmapKeySym Acircumflextilde acircumflextilde Acircumflexbelowdot acircumflexbelowdot Abreveacute abreveacute Abrevegrave abrevegrave Abrevehook abrevehook Abrevetilde abrevetilde Abrevebelowdot abrevebelowdot Ebelowdot
+syn keyword xmodmapKeySym ebelowdot Ehook ehook Etilde etilde Ecircumflexacute ecircumflexacute Ecircumflexgrave ecircumflexgrave Ecircumflexhook ecircumflexhook Ecircumflextilde ecircumflextilde Ecircumflexbelowdot ecircumflexbelowdot
+syn keyword xmodmapKeySym Ihook ihook Ibelowdot ibelowdot Obelowdot obelowdot Ohook ohook Ocircumflexacute ocircumflexacute Ocircumflexgrave ocircumflexgrave Ocircumflexhook ocircumflexhook Ocircumflextilde
+syn keyword xmodmapKeySym ocircumflextilde Ocircumflexbelowdot ocircumflexbelowdot Ohornacute ohornacute Ohorngrave ohorngrave Ohornhook ohornhook Ohorntilde ohorntilde Ohornbelowdot ohornbelowdot Ubelowdot ubelowdot
+syn keyword xmodmapKeySym Uhook uhook Uhornacute uhornacute Uhorngrave uhorngrave Uhornhook uhornhook Uhorntilde uhorntilde Uhornbelowdot uhornbelowdot Ybelowdot ybelowdot Yhook
+syn keyword xmodmapKeySym yhook Ytilde ytilde Ohorn ohorn Uhorn uhorn combining_tilde combining_grave combining_acute combining_hook combining_belowdot EcuSign ColonSign CruzeiroSign
+syn keyword xmodmapKeySym FFrancSign LiraSign MillSign NairaSign PesetaSign RupeeSign WonSign NewSheqelSign DongSign EuroSign
+syn match xmodmapKeySym "\<[A-Za-z]\>"
+
+" keywords
+syn keyword xmodmapKeyword keycode keysym clear add remove pointer
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xmodmap_syn_inits")
+ if version < 508
+ let did_xmodmap_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xmodmapComment Comment
+ HiLink xmodmapTodo Todo
+ HiLink xmodmapInt Number
+ HiLink xmodmapHex Number
+ HiLink xmodmapOctal Number
+ HiLink xmodmapOctalError Error
+ HiLink xmodmapKeySym Constant
+ HiLink xmodmapKeyword Keyword
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xmodmap"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/xpm.vim b/runtime/syntax/xpm.vim
new file mode 100644
index 000000000..4cbda82fb
--- /dev/null
+++ b/runtime/syntax/xpm.vim
@@ -0,0 +1,144 @@
+" Vim syntax file
+" Language: X Pixmap
+" Maintainer: Ronald Schild <rs@scutum.de>
+" Last Change: 2001 May 09
+" Version: 5.4n.1
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn keyword xpmType char
+syn keyword xpmStorageClass static
+syn keyword xpmTodo TODO FIXME XXX contained
+syn region xpmComment start="/\*" end="\*/" contains=xpmTodo
+syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors
+
+if has("gui_running")
+
+let color = ""
+let chars = ""
+let colors = 0
+let cpp = 0
+let n = 0
+let i = 1
+
+while i <= line("$") " scanning all lines
+
+ let s = matchstr(getline(i), '".\{-1,}"')
+ if s != "" " does line contain a string?
+
+ if n == 0 " first string is the Values string
+
+ " get the 3rd value: colors = number of colors
+ let colors = substitute(s, '"\s*\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
+ " get the 4th value: cpp = number of character per pixel
+ let cpp = substitute(s, '"\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
+
+ " highlight the Values string as normal string (no pixel string)
+ exe 'syn match xpmValues /'.s.'/'
+ hi link xpmValues String
+
+ let n = 1 " n = color index
+
+ elseif n <= colors " string is a color specification
+
+ " get chars = <cpp> length string representing the pixels
+ " (first incl. the following whitespace)
+ let chars = substitute(s, '"\(.\{'.cpp.'}\s\).*"', '\1', '')
+
+ " now get color, first try 'c' key if any (color visual)
+ let color = substitute(s, '".*\sc\s\+\(.\{-}\)\s*\(\(g4\=\|[ms]\)\s.*\)*\s*"', '\1', '')
+ if color == s
+ " no 'c' key, try 'g' key (grayscale with more than 4 levels)
+ let color = substitute(s, '".*\sg\s\+\(.\{-}\)\s*\(\(g4\|[ms]\)\s.*\)*\s*"', '\1', '')
+ if color == s
+ " next try: 'g4' key (4-level grayscale)
+ let color = substitute(s, '".*\sg4\s\+\(.\{-}\)\s*\([ms]\s.*\)*\s*"', '\1', '')
+ if color == s
+ " finally try 'm' key (mono visual)
+ let color = substitute(s, '".*\sm\s\+\(.\{-}\)\s*\(s\s.*\)*\s*"', '\1', '')
+ if color == s
+ let color = ""
+ endif
+ endif
+ endif
+ endif
+
+ " Vim cannot handle RGB codes with more than 6 hex digits
+ if color =~ '#\x\{10,}$'
+ let color = substitute(color, '\(\x\x\)\x\x', '\1', 'g')
+ elseif color =~ '#\x\{7,}$'
+ let color = substitute(color, '\(\x\x\)\x', '\1', 'g')
+ " nor with 3 digits
+ elseif color =~ '#\x\{3}$'
+ let color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '')
+ endif
+
+ " escape meta characters in patterns
+ let s = escape(s, '/\*^$.~[]')
+ let chars = escape(chars, '/\*^$.~[]')
+
+ " now create syntax items
+ " highlight the color string as normal string (no pixel string)
+ exe 'syn match xpmCol'.n.'Def /'.s.'/ contains=xpmCol'.n.'inDef'
+ exe 'hi link xpmCol'.n.'Def String'
+
+ " but highlight the first whitespace after chars in its color
+ exe 'syn match xpmCol'.n.'inDef /"'.chars.'/hs=s+'.(cpp+1).' contained'
+ exe 'hi link xpmCol'.n.'inDef xpmColor'.n
+
+ " remove the following whitespace from chars
+ let chars = substitute(chars, '.$', '', '')
+
+ " and create the syntax item contained in the pixel strings
+ exe 'syn match xpmColor'.n.' /'.chars.'/ contained'
+ exe 'syn cluster xpmColors add=xpmColor'.n
+
+ " if no color or color = "None" show background
+ if color == "" || substitute(color, '.*', '\L&', '') == 'none'
+ exe 'hi xpmColor'.n.' guifg=bg'
+ exe 'hi xpmColor'.n.' guibg=NONE'
+ else
+ exe 'hi xpmColor'.n." guifg='".color."'"
+ exe 'hi xpmColor'.n." guibg='".color."'"
+ endif
+ let n = n + 1
+ else
+ break " no more color string
+ endif
+ endif
+ let i = i + 1
+endwhile
+
+unlet color chars colors cpp n i s
+
+endif " has("gui_running")
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xpm_syntax_inits")
+ if version < 508
+ let did_xpm_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xpmType Type
+ HiLink xpmStorageClass StorageClass
+ HiLink xpmTodo Todo
+ HiLink xpmComment Comment
+ HiLink xpmPixelString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xpm"
+
+" vim: ts=8:sw=3:noet:
diff --git a/runtime/syntax/xpm2.vim b/runtime/syntax/xpm2.vim
new file mode 100644
index 000000000..3a3de6f54
--- /dev/null
+++ b/runtime/syntax/xpm2.vim
@@ -0,0 +1,156 @@
+" Vim syntax file
+" Language: X Pixmap v2
+" Maintainer: Steve Wall (hitched97@velnet.com)
+" Last Change: 2001 Apr 25
+" Version: 5.8
+"
+" Made from xpm.vim by Ronald Schild <rs@scutum.de>
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn region xpm2PixelString start="^" end="$" contains=@xpm2Colors
+syn keyword xpm2Todo TODO FIXME XXX contained
+syn match xpm2Comment "\!.*$" contains=xpm2Todo
+
+
+if version < 508
+ command -nargs=+ HiLink hi link <args>
+ command -nargs=+ Hi hi <args>
+else
+ command -nargs=+ HiLink hi def link <args>
+ command -nargs=+ Hi hi def <args>
+endif
+
+if has("gui_running")
+
+ let color = ""
+ let chars = ""
+ let colors = 0
+ let cpp = 0
+ let n = 0
+ let i = 1
+
+ while i <= line("$") " scanning all lines
+
+ let s = getline(i)
+ if match(s,"\!.*$") != -1
+ let s = matchstr(s, "^[^\!]*")
+ endif
+ if s != "" " does line contain a string?
+
+ if n == 0 " first string is the Values string
+
+ " get the 3rd value: colors = number of colors
+ let colors = substitute(s, '\s*\d\+\s\+\d\+\s\+\(\d\+\).*', '\1', '')
+ " get the 4th value: cpp = number of character per pixel
+ let cpp = substitute(s, '\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\d\+\).*', '\1', '')
+
+ " highlight the Values string as normal string (no pixel string)
+ exe 'syn match xpm2Values /'.s.'/'
+ HiLink xpm2Values Statement
+
+ let n = 1 " n = color index
+
+ elseif n <= colors " string is a color specification
+
+ " get chars = <cpp> length string representing the pixels
+ " (first incl. the following whitespace)
+ let chars = substitute(s, '\(.\{'.cpp.'}\s\+\).*', '\1', '')
+
+ " now get color, first try 'c' key if any (color visual)
+ let color = substitute(s, '.*\sc\s\+\(.\{-}\)\s*\(\(g4\=\|[ms]\)\s.*\)*\s*', '\1', '')
+ if color == s
+ " no 'c' key, try 'g' key (grayscale with more than 4 levels)
+ let color = substitute(s, '.*\sg\s\+\(.\{-}\)\s*\(\(g4\|[ms]\)\s.*\)*\s*', '\1', '')
+ if color == s
+ " next try: 'g4' key (4-level grayscale)
+ let color = substitute(s, '.*\sg4\s\+\(.\{-}\)\s*\([ms]\s.*\)*\s*', '\1', '')
+ if color == s
+ " finally try 'm' key (mono visual)
+ let color = substitute(s, '.*\sm\s\+\(.\{-}\)\s*\(s\s.*\)*\s*', '\1', '')
+ if color == s
+ let color = ""
+ endif
+ endif
+ endif
+ endif
+
+ " Vim cannot handle RGB codes with more than 6 hex digits
+ if color =~ '#\x\{10,}$'
+ let color = substitute(color, '\(\x\x\)\x\x', '\1', 'g')
+ elseif color =~ '#\x\{7,}$'
+ let color = substitute(color, '\(\x\x\)\x', '\1', 'g')
+ " nor with 3 digits
+ elseif color =~ '#\x\{3}$'
+ let color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '')
+ endif
+
+ " escape meta characters in patterns
+ let s = escape(s, '/\*^$.~[]')
+ let chars = escape(chars, '/\*^$.~[]')
+
+ " change whitespace to "\s\+"
+ let s = substitute(s, "[ \t][ \t]*", "\\\\s\\\\+", "g")
+ let chars = substitute(chars, "[ \t][ \t]*", "\\\\s\\\\+", "g")
+
+ " now create syntax items
+ " highlight the color string as normal string (no pixel string)
+ exe 'syn match xpm2Col'.n.'Def /'.s.'/ contains=xpm2Col'.n.'inDef'
+ exe 'HiLink xpm2Col'.n.'Def Constant'
+
+ " but highlight the first whitespace after chars in its color
+ exe 'syn match xpm2Col'.n.'inDef /^'.chars.'/hs=s+'.(cpp).' contained'
+ exe 'HiLink xpm2Col'.n.'inDef xpm2Color'.n
+
+ " remove the following whitespace from chars
+ let chars = substitute(chars, '\\s\\+$', '', '')
+
+ " and create the syntax item contained in the pixel strings
+ exe 'syn match xpm2Color'.n.' /'.chars.'/ contained'
+ exe 'syn cluster xpm2Colors add=xpm2Color'.n
+
+ " if no color or color = "None" show background
+ if color == "" || substitute(color, '.*', '\L&', '') == 'none'
+ exe 'Hi xpm2Color'.n.' guifg=bg guibg=NONE'
+ else
+ exe 'Hi xpm2Color'.n." guifg='".color."' guibg='".color."'"
+ endif
+ let n = n + 1
+ else
+ break " no more color string
+ endif
+ endif
+ let i = i + 1
+ endwhile
+
+ unlet color chars colors cpp n i s
+
+endif " has("gui_running")
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xpm2_syntax_inits")
+ if version < 508
+ let did_xpm2_syntax_inits = 1
+ endif
+
+ " The default highlighting.
+ HiLink xpm2Type Type
+ HiLink xpm2StorageClass StorageClass
+ HiLink xpm2Todo Todo
+ HiLink xpm2Comment Comment
+ HiLink xpm2PixelString String
+endif
+delcommand HiLink
+delcommand Hi
+
+let b:current_syntax = "xpm2"
+
+" vim: ts=8:sw=2:noet:
diff --git a/runtime/syntax/xs.vim b/runtime/syntax/xs.vim
new file mode 100644
index 000000000..9f1054a89
--- /dev/null
+++ b/runtime/syntax/xs.vim
@@ -0,0 +1,54 @@
+" Vim syntax file
+" Language: XS (Perl extension interface language)
+" Maintainer: Michael W. Dodge <sarge@pobox.com>
+" Last Change: 2001 May 09
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ source <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+endif
+
+" XS extentions
+" TODO: Figure out how to look for trailing '='.
+syn keyword xsKeyword MODULE PACKAGE PREFIX
+syn keyword xsKeyword OUTPUT: CODE: INIT: PREINIT: INPUT:
+syn keyword xsKeyword PPCODE: REQUIRE: CLEANUP: BOOT:
+syn keyword xsKeyword VERSIONCHECK: PROTOTYPES: PROTOTYPE:
+syn keyword xsKeyword ALIAS: INCLUDE: CASE:
+" TODO: Figure out how to look for trailing '('.
+syn keyword xsMacro SV EXTEND PUSHs
+syn keyword xsVariable RETVAL NO_INIT
+"syn match xsCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
+"syn match xsCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xs_syntax_inits")
+ if version < 508
+ let did_xs_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xsKeyword Keyword
+ HiLink xsMacro Macro
+ HiLink xsVariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xs"
+
+" vim: ts=8
diff --git a/runtime/syntax/xsd.vim b/runtime/syntax/xsd.vim
new file mode 100644
index 000000000..c3431f42e
--- /dev/null
+++ b/runtime/syntax/xsd.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language: XSD (XML Schema)
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
+" Filenames: *.xsd
+" $Id$
+
+" REFERENCES:
+" [1] http://www.w3.org/TR/xmlschema-0
+"
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+runtime syntax/xml.vim
+
+syn cluster xmlTagHook add=xsdElement
+syn case match
+
+syn match xsdElement '\%(xsd:\)\@<=all'
+syn match xsdElement '\%(xsd:\)\@<=annotation'
+syn match xsdElement '\%(xsd:\)\@<=any'
+syn match xsdElement '\%(xsd:\)\@<=anyAttribute'
+syn match xsdElement '\%(xsd:\)\@<=appInfo'
+syn match xsdElement '\%(xsd:\)\@<=attribute'
+syn match xsdElement '\%(xsd:\)\@<=attributeGroup'
+syn match xsdElement '\%(xsd:\)\@<=choice'
+syn match xsdElement '\%(xsd:\)\@<=complexContent'
+syn match xsdElement '\%(xsd:\)\@<=complexType'
+syn match xsdElement '\%(xsd:\)\@<=documentation'
+syn match xsdElement '\%(xsd:\)\@<=element'
+syn match xsdElement '\%(xsd:\)\@<=enumeration'
+syn match xsdElement '\%(xsd:\)\@<=extension'
+syn match xsdElement '\%(xsd:\)\@<=field'
+syn match xsdElement '\%(xsd:\)\@<=group'
+syn match xsdElement '\%(xsd:\)\@<=import'
+syn match xsdElement '\%(xsd:\)\@<=include'
+syn match xsdElement '\%(xsd:\)\@<=key'
+syn match xsdElement '\%(xsd:\)\@<=keyref'
+syn match xsdElement '\%(xsd:\)\@<=length'
+syn match xsdElement '\%(xsd:\)\@<=list'
+syn match xsdElement '\%(xsd:\)\@<=maxInclusive'
+syn match xsdElement '\%(xsd:\)\@<=maxLength'
+syn match xsdElement '\%(xsd:\)\@<=minInclusive'
+syn match xsdElement '\%(xsd:\)\@<=minLength'
+syn match xsdElement '\%(xsd:\)\@<=pattern'
+syn match xsdElement '\%(xsd:\)\@<=redefine'
+syn match xsdElement '\%(xsd:\)\@<=restriction'
+syn match xsdElement '\%(xsd:\)\@<=schema'
+syn match xsdElement '\%(xsd:\)\@<=selector'
+syn match xsdElement '\%(xsd:\)\@<=sequence'
+syn match xsdElement '\%(xsd:\)\@<=simpleContent'
+syn match xsdElement '\%(xsd:\)\@<=simpleType'
+syn match xsdElement '\%(xsd:\)\@<=union'
+syn match xsdElement '\%(xsd:\)\@<=unique'
+
+hi def link xsdElement Statement
+
+" vim: ts=8
diff --git a/runtime/syntax/xslt.vim b/runtime/syntax/xslt.vim
new file mode 100644
index 000000000..98dd86919
--- /dev/null
+++ b/runtime/syntax/xslt.vim
@@ -0,0 +1,62 @@
+" Vim syntax file
+" Language: XSLT
+" Maintainer: Johannes Zellner <johannes@zellner.org>
+" Last Change: Sun, 28 Oct 2001 21:22:24 +0100
+" Filenames: *.xsl
+" $Id$
+
+" REFERENCES:
+" [1] http://www.w3.org/TR/xslt
+"
+
+" Quit when a syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+runtime syntax/xml.vim
+
+syn cluster xmlTagHook add=xslElement
+syn case match
+
+syn match xslElement '\%(xsl:\)\@<=apply-imports'
+syn match xslElement '\%(xsl:\)\@<=apply-templates'
+syn match xslElement '\%(xsl:\)\@<=attribute'
+syn match xslElement '\%(xsl:\)\@<=attribute-set'
+syn match xslElement '\%(xsl:\)\@<=call-template'
+syn match xslElement '\%(xsl:\)\@<=choose'
+syn match xslElement '\%(xsl:\)\@<=comment'
+syn match xslElement '\%(xsl:\)\@<=copy'
+syn match xslElement '\%(xsl:\)\@<=copy-of'
+syn match xslElement '\%(xsl:\)\@<=decimal-format'
+syn match xslElement '\%(xsl:\)\@<=document'
+syn match xslElement '\%(xsl:\)\@<=element'
+syn match xslElement '\%(xsl:\)\@<=fallback'
+syn match xslElement '\%(xsl:\)\@<=for-each'
+syn match xslElement '\%(xsl:\)\@<=if'
+syn match xslElement '\%(xsl:\)\@<=include'
+syn match xslElement '\%(xsl:\)\@<=import'
+syn match xslElement '\%(xsl:\)\@<=key'
+syn match xslElement '\%(xsl:\)\@<=message'
+syn match xslElement '\%(xsl:\)\@<=namespace-alias'
+syn match xslElement '\%(xsl:\)\@<=number'
+syn match xslElement '\%(xsl:\)\@<=otherwise'
+syn match xslElement '\%(xsl:\)\@<=output'
+syn match xslElement '\%(xsl:\)\@<=param'
+syn match xslElement '\%(xsl:\)\@<=processing-instruction'
+syn match xslElement '\%(xsl:\)\@<=preserve-space'
+syn match xslElement '\%(xsl:\)\@<=script'
+syn match xslElement '\%(xsl:\)\@<=sort'
+syn match xslElement '\%(xsl:\)\@<=strip-space'
+syn match xslElement '\%(xsl:\)\@<=stylesheet'
+syn match xslElement '\%(xsl:\)\@<=template'
+syn match xslElement '\%(xsl:\)\@<=transform'
+syn match xslElement '\%(xsl:\)\@<=text'
+syn match xslElement '\%(xsl:\)\@<=value-of'
+syn match xslElement '\%(xsl:\)\@<=variable'
+syn match xslElement '\%(xsl:\)\@<=when'
+syn match xslElement '\%(xsl:\)\@<=with-param'
+
+hi def link xslElement Statement
+
+" vim: ts=8
diff --git a/runtime/syntax/xxd.vim b/runtime/syntax/xxd.vim
new file mode 100644
index 000000000..1ed543c20
--- /dev/null
+++ b/runtime/syntax/xxd.vim
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language: bin using xxd
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Nov 18, 2002
+" Version: 6
+" Notes: use :help xxd to see how to invoke it
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn match xxdAddress "^[0-9a-f]\+:" contains=xxdSep
+syn match xxdSep contained ":"
+syn match xxdAscii " .\{,16\}\r\=$"hs=s+2 contains=xxdDot
+syn match xxdDot contained "[.\r]"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_xxd_syntax_inits")
+ if version < 508
+ let did_xxd_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink xxdAddress Constant
+ HiLink xxdSep Identifier
+ HiLink xxdAscii Statement
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "xxd"
+
+" vim: ts=4
diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim
new file mode 100644
index 000000000..532a39a95
--- /dev/null
+++ b/runtime/syntax/yacc.vim
@@ -0,0 +1,98 @@
+" Vim syntax file
+" Language: Yacc
+" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Nov 18, 2002
+" Version: 2
+" URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
+"
+" Option:
+" yacc_uses_cpp : if this variable exists, then C++ is loaded rather than C
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version >= 600
+ if exists("yacc_uses_cpp")
+ runtime! syntax/cpp.vim
+ else
+ runtime! syntax/c.vim
+ endif
+elseif exists("yacc_uses_cpp")
+ so <sfile>:p:h/cpp.vim
+else
+ so <sfile>:p:h/c.vim
+endif
+
+" Clusters
+syn cluster yaccActionGroup contains=yaccDelim,cInParen,cTodo,cIncluded,yaccDelim,yaccCurlyError,yaccUnionCurly,yaccUnion,cUserLabel,cOctalZero,cCppOut2,cCppSkip,cErrInBracket,cErrInParen,cOctalError,cCommentStartError,cParenError
+syn cluster yaccUnionGroup contains=yaccKey,cComment,yaccCurly,cType,cStructure,cStorageClass,yaccUnionCurly
+
+" Yacc stuff
+syn match yaccDelim "^\s*[:|;]"
+syn match yaccOper "@\d\+"
+
+syn match yaccKey "^\s*%\(token\|type\|left\|right\|start\|ident\|nonassoc\)\>"
+syn match yaccKey "\s%\(prec\|expect\)\>"
+syn match yaccKey "\$\(<[a-zA-Z_][a-zA-Z_0-9]*>\)\=[\$0-9]\+"
+syn keyword yaccKeyActn yyerrok yyclearin
+
+syn match yaccUnionStart "^%union" skipwhite skipnl nextgroup=yaccUnion
+syn region yaccUnion contained matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccUnionGroup
+syn region yaccUnionCurly contained matchgroup=yaccCurly start="{" matchgroup=yaccCurly end="}" contains=@yaccUnionGroup
+syn match yaccBrkt contained "[<>]"
+syn match yaccType "<[a-zA-Z_][a-zA-Z0-9_]*>" contains=yaccBrkt
+syn match yaccDefinition "^[A-Za-z][A-Za-z0-9_]*[ \t]*:"
+
+" special Yacc separators
+syn match yaccSectionSep "^[ \t]*%%"
+syn match yaccSep "^[ \t]*%{"
+syn match yaccSep "^[ \t]*%}"
+
+" I'd really like to highlight just the outer {}. Any suggestions???
+syn match yaccCurlyError "[{}]"
+syn region yaccAction matchgroup=yaccCurly start="{" end="}" contains=ALLBUT,@yaccActionGroup
+
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_yacc_syn_inits")
+ if version < 508
+ let did_yacchdl_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " Internal yacc highlighting links
+ HiLink yaccBrkt yaccStmt
+ HiLink yaccKey yaccStmt
+ HiLink yaccOper yaccStmt
+ HiLink yaccUnionStart yaccKey
+
+ " External yacc highlighting links
+ HiLink yaccCurly Delimiter
+ HiLink yaccCurlyError Error
+ HiLink yaccDefinition Function
+ HiLink yaccDelim Function
+ HiLink yaccKeyActn Special
+ HiLink yaccSectionSep Todo
+ HiLink yaccSep Delimiter
+ HiLink yaccStmt Statement
+ HiLink yaccType Type
+
+ " since Bram doesn't like my Delimiter :|
+ HiLink Delimiter Type
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "yacc"
+
+" vim: ts=15
diff --git a/runtime/syntax/yaml.vim b/runtime/syntax/yaml.vim
new file mode 100644
index 000000000..56e578b30
--- /dev/null
+++ b/runtime/syntax/yaml.vim
@@ -0,0 +1,105 @@
+" Vim syntax file
+" Language: YAML (YAML Ain't Markup Language)
+" Maintainer: Nikolai Weibull <source@pcppopper.org>
+" URL: http://www.pcppopper.org/vim/syntax/pcp/yaml/
+" Latest Revision: 2004-05-22
+" arch-tag: 01bf8ef1-335f-4692-a228-4846cb64cd16
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Todo
+syn keyword yamlTodo contained TODO FIXME XXX NOTE
+
+" Comments (4.2.2)
+syn region yamlComment matchgroup=yamlComment start='\%(^\|\s\)#' end='$' contains=yamlTodo
+
+" Node Properties (4.3.4)
+syn match yamlNodeProperty '!\%(![^\\^% ]\+\|[^!][^:/ ]*\)'
+
+" Anchors (4.3.6)
+syn match yamlAnchor '&.\+'
+
+" Aliases (4.3.7)
+syn match yamlAlias '\*.\+'
+
+" Operators, Blocks, Keys, and Delimiters
+syn match yamlDelimiter '[-,:]'
+syn match yamlBlock '[\[\]{}>|]'
+syn match yamlOperator '[?+-]'
+syn match yamlKey '\w\+\(\s\+\w\+\)*\ze\s*:'
+
+" Strings (4.6.8, 4.6.9)
+syn region yamlString start=+"+ skip=+\\"+ end=+"+ contains=yamlEscape
+syn region yamlString start=+'+ skip=+''+ end=+'+ contains=yamlSingleEscape
+syn match yamlEscape contained +\\[\\"abefnrtv^0_ NLP]+
+syn match yamlEscape contained '\\x\x\{2}'
+syn match yamlEscape contained '\\u\x\{4}'
+syn match yamlEscape contained '\\U\x\{8}'
+" TODO: how do we get 0x85, 0x2028, and 0x2029 into this?
+syn match yamlEscape '\\\%(\r\n\|[\r\n]\)'
+syn match yamlSingleEscape contained +''+
+
+" Numbers
+" TODO: sexagecimal and fixed (20:30.15 and 1,230.15)
+syn match yamlNumber '\<[+-]\=\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\='
+syn match yamlNumber '0\o\+'
+syn match yamlNumber '0x\x\+'
+syn match yamlNumber '([+-]\=[iI]nf)'
+syn match yamlNumber '(NaN)'
+
+" Constants
+syn match yamlConstant '\<[~yn]\>'
+syn keyword yamlConstant true True TRUE false False FALSE
+syn keyword yamlConstant yes Yes on ON no No off OFF
+syn keyword yamlConstant null Null NULL nil Nil NIL
+
+" Timestamps
+syn match yamlTimestamp '\d\d\d\d-\%(1[0-2]\|\d\)-\%(3[0-2]\|2\d\|1\d\|\d\)\%( \%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d [+-]\%([01]\d\|2[0-3]\):[0-5]\d\|t\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d[+-]\%([01]\d\|2[0-3]\):[0-5]\d\|T\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\dZ\)\='
+
+" Documents (4.3.1)
+syn region yamlDocumentHeader start='---' end='$' contains=yamlDirective
+syn match yamlDocumentEnd '\.\.\.'
+
+" Directives (4.3.2)
+syn match yamlDirective contained '%[^:]\+:.\+'
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_yaml_syn_inits")
+ if version < 508
+ let did_yaml_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink yamlTodo Todo
+ HiLink yamlComment Comment
+ HiLink yamlDocumentHeader PreProc
+ HiLink yamlDocumentEnd PreProc
+ HiLink yamlDirective Keyword
+ HiLink yamlNodeProperty Type
+ HiLink yamlAnchor Type
+ HiLink yamlAlias Type
+ HiLink yamlDelimiter Delimiter
+ HiLink yamlBlock Operator
+ HiLink yamlOperator Operator
+ HiLink yamlKey Identifier
+ HiLink yamlString String
+ HiLink yamlEscape SpecialChar
+ HiLink yamlSingleEscape SpecialChar
+ HiLink yamlNumber Number
+ HiLink yamlConstant Constant
+ HiLink yamlTimestamp Number
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "yaml"
+
+" vim: set sts=2 sw=2:
diff --git a/runtime/syntax/z8a.vim b/runtime/syntax/z8a.vim
new file mode 100644
index 000000000..a3a8a2bbd
--- /dev/null
+++ b/runtime/syntax/z8a.vim
@@ -0,0 +1,114 @@
+" Vim syntax file
+" Language: Z80 assembler asz80
+" Maintainer: Milan Pikula <www@fornax.elf.stuba.sk>
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case ignore
+
+" Common Z80 Assembly instructions
+syn keyword z8aInstruction adc add and bit ccf cp cpd cpdr cpi cpir cpl
+syn keyword z8aInstruction daa di djnz ei exx halt im in
+syn keyword z8aInstruction ind ini indr inir jp jr ld ldd lddr ldi ldir
+syn keyword z8aInstruction neg nop or otdr otir out outd outi
+syn keyword z8aInstruction res rl rla rlc rlca rld
+syn keyword z8aInstruction rr rra rrc rrca rrd sbc scf set sla sra
+syn keyword z8aInstruction srl sub xor
+" syn keyword z8aInstruction push pop call ret reti retn inc dec ex rst
+
+" Any other stuff
+syn match z8aIdentifier "[a-z_][a-z0-9_]*"
+
+" Instructions changing stack
+syn keyword z8aSpecInst push pop call ret reti retn rst
+syn match z8aInstruction "\<inc\>"
+syn match z8aInstruction "\<dec\>"
+syn match z8aInstruction "\<ex\>"
+syn match z8aSpecInst "\<inc\s\+sp\>"me=s+3
+syn match z8aSpecInst "\<dec\s\+sp\>"me=s+3
+syn match z8aSpecInst "\<ex\s\+(\s*sp\s*)\s*,\s*hl\>"me=s+2
+
+"Labels
+syn match z8aLabel "[a-z_][a-z0-9_]*:"
+syn match z8aSpecialLabel "[a-z_][a-z0-9_]*::"
+
+" PreProcessor commands
+syn match z8aPreProc "\.org"
+syn match z8aPreProc "\.globl"
+syn match z8aPreProc "\.db"
+syn match z8aPreProc "\.dw"
+syn match z8aPreProc "\.ds"
+syn match z8aPreProc "\.byte"
+syn match z8aPreProc "\.word"
+syn match z8aPreProc "\.blkb"
+syn match z8aPreProc "\.blkw"
+syn match z8aPreProc "\.ascii"
+syn match z8aPreProc "\.asciz"
+syn match z8aPreProc "\.module"
+syn match z8aPreProc "\.title"
+syn match z8aPreProc "\.sbttl"
+syn match z8aPreProc "\.even"
+syn match z8aPreProc "\.odd"
+syn match z8aPreProc "\.area"
+syn match z8aPreProc "\.page"
+syn match z8aPreProc "\.setdp"
+syn match z8aPreProc "\.radix"
+syn match z8aInclude "\.include"
+syn match z8aPreCondit "\.if"
+syn match z8aPreCondit "\.else"
+syn match z8aPreCondit "\.endif"
+
+" Common strings
+syn match z8aString "\".*\""
+syn match z8aString "\'.*\'"
+
+" Numbers
+syn match z8aNumber "[0-9]\+"
+syn match z8aNumber "0[xXhH][0-9a-fA-F]\+"
+syn match z8aNumber "0[bB][0-1]*"
+syn match z8aNumber "0[oO\@qQ][0-7]\+"
+syn match z8aNumber "0[dD][0-9]\+"
+
+" Character constant
+syn match z8aString "\#\'."hs=s+1
+
+" Comments
+syn match z8aComment ";.*"
+
+syn case match
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_z8a_syntax_inits")
+ if version < 508
+ let did_z8a_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink z8aSection Special
+ HiLink z8aLabel Label
+ HiLink z8aSpecialLabel Label
+ HiLink z8aComment Comment
+ HiLink z8aInstruction Statement
+ HiLink z8aSpecInst Statement
+ HiLink z8aInclude Include
+ HiLink z8aPreCondit PreCondit
+ HiLink z8aPreProc PreProc
+ HiLink z8aNumber Number
+ HiLink z8aString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "z8a"
+" vim: ts=8
diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim
new file mode 100644
index 000000000..83763a627
--- /dev/null
+++ b/runtime/syntax/zsh.vim
@@ -0,0 +1,118 @@
+" Vim syntax file
+" Language: Z shell (zsh)
+" Maintainer: Felix von Leitner <leitner@math.fu-berlin.de>
+" Heavily based on sh.vim by Lennart Schultz
+" Last Change: 2003 May 11
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" String and Character contstants
+" Highlight special characters (those which have a backslash) differently
+syn match zshSpecial "\\\d\d\d\|\\[abcfnrtv\\']"
+syn region zshSinglequote start=+'+ skip=+\\'+ end=+'+
+" A bunch of useful zsh keywords
+" syn keyword zshFunction function
+syn keyword zshStatement bg break cd chdir continue echo eval exec
+syn keyword zshStatement exit export fg getopts hash jobs kill
+syn keyword zshStatement pwd read readonly return set zshift function
+syn keyword zshStatement stop suspend test times trap type ulimit
+syn keyword zshStatement umask unset wait setopt compctl source
+syn keyword zshStatement whence disown shift which unhash unalias
+syn keyword zshStatement alias functions unfunction getln disable
+syn keyword zshStatement vared getopt enable unsetopt autoload
+syn keyword zshStatement bindkey pushln command limit unlimit fc
+syn keyword zshStatement print builtin noglob sched r time
+syn keyword zshStatement typeset declare local integer
+
+syn keyword zshConditional if else esac case then elif fi in
+syn keyword zshRepeat while for do done
+
+" Following is worth to notice: command substitution, file redirection and functions (so these features turns red)
+syn match zshFunctionName "\h\w*\s*()"
+syn region zshCommandSub start=+`+ skip=+\\`+ end=+`+
+" contains=ALLBUT,zshFunction
+syn match zshRedir "\d\=\(<\|<<\|>\|>>\)\(|\|&\d\)\="
+
+syn keyword zshTodo contained TODO
+
+syn keyword zshShellVariables USER LOGNAME HOME PATH CDPATH SHELL
+syn keyword zshShellVariables LC_TYPE LC_MESSAGE MAIL MAILCHECK
+syn keyword zshShellVariables PS1 PS2 IFS EGID EUID ERRNO GID UID
+syn keyword zshShellVariables HOST LINENO MACHTYPE OLDPWD OPTARG
+syn keyword zshShellVariables OPTIND OSTYPE PPID PWD RANDOM SECONDS
+syn keyword zshShellVariables SHLVL TTY signals TTYIDLE USERNAME
+syn keyword zshShellVariables VENDOR ZSH_NAME ZSH_VERSION ARGV0
+syn keyword zshShellVariables BAUD COLUMNS cdpath DIRSTACKSIZE
+syn keyword zshShellVariables FCEDIT fignore fpath histchars HISTCHARS
+syn keyword zshShellVariables HISTFILE HISTSIZE KEYTIMEOUT LANG
+syn keyword zshShellVariables LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES
+syn keyword zshShellVariables LC_TIME LINES LISTMAX LOGCHECK mailpath
+syn keyword zshShellVariables MAILPATH MANPATH manpath module_path
+syn keyword zshShellVariables MODULE_PATH NULLCMD path POSTEDIT
+syn keyword zshShellVariables PS3 PS4 PROMPT PROMPT2 PROMPT3 PROMPT4
+syn keyword zshShellVariables psvar PSVAR prompt READNULLCMD
+syn keyword zshShellVariables REPORTTIME RPROMPT RPS1 SAVEHIST
+syn keyword zshShellVariables SPROMPT STTY TIMEFMT TMOUT TMPPREFIX
+syn keyword zshShellVariables watch WATCH WATCHFMT WORDCHARS ZDOTDIR
+syn match zshSpecialShellVar "\$[-#@*$?!0-9]"
+syn keyword zshSetVariables ignoreeof noclobber
+syn region zshDerefOpr start="\${" end="}" contains=zshShellVariables
+syn match zshDerefIdentifier "\$[a-zA-Z_][a-zA-Z0-9_]*\>"
+syn match zshOperator "[][}{&;|)(]"
+
+
+
+syn match zshNumber "-\=\<\d\+\>"
+syn match zshComment "#.*$" contains=zshNumber,zshTodo
+
+
+syn match zshTestOpr "-\<[oeaznlg][tfqet]\=\>\|!\==\|-\<[b-gkLprsStuwjxOG]\>"
+"syn region zshTest start="\[" skip="\\$" end="\]" contains=zshString,zshTestOpr,zshDerefIdentifier,zshDerefOpr
+syn region zshString start=+"+ skip=+\\"+ end=+"+ contains=zshSpecial,zshOperator,zshDerefIdentifier,zshDerefOpr,zshSpecialShellVar,zshSinglequote,zshCommandSub
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_zsh_syntax_inits")
+ if version < 508
+ let did_zsh_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink zshSinglequote zshString
+ HiLink zshConditional zshStatement
+ HiLink zshRepeat zshStatement
+ HiLink zshFunctionName zshFunction
+ HiLink zshCommandSub zshOperator
+ HiLink zshRedir zshOperator
+ HiLink zshSetVariables zshShellVariables
+ HiLink zshSpecialShellVar zshShellVariables
+ HiLink zshTestOpr zshOperator
+ HiLink zshDerefOpr zshSpecial
+ HiLink zshDerefIdentifier zshShellVariables
+ HiLink zshOperator Operator
+ HiLink zshStatement Statement
+ HiLink zshNumber Number
+ HiLink zshString String
+ HiLink zshComment Comment
+ HiLink zshSpecial Special
+ HiLink zshTodo Todo
+ HiLink zshShellVariables Special
+" hi zshOperator term=underline ctermfg=6 guifg=Purple gui=bold
+" hi zshShellVariables term=underline ctermfg=2 guifg=SeaGreen gui=bold
+" hi zshFunction term=bold ctermbg=1 guifg=Red
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "zsh"
+
+" vim: ts=8
diff --git a/runtime/termcap b/runtime/termcap
new file mode 100644
index 000000000..38790c49d
--- /dev/null
+++ b/runtime/termcap
@@ -0,0 +1,135 @@
+#
+# Demonstration of a termcap file (for the Amiga and Archimedes)
+#
+# Maintainer: Bram Moolenaar <Bram@vim.org>
+# Last change: 1999 Feb 02
+#
+sx|ansi|any ansi terminal with pessimistic assumptions:\
+ :co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\
+ :nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:pt:
+
+Mu|sun|Sun Microsystems Workstation console:\
+ :am:bs:km:mi:ms:pt:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:\
+ :ce=\E[K:cd=\E[J:\
+ :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:rs=\E[s:\
+ :md=\E[1m:mr=\E[7m:me=\E[m:\
+ :al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
+ :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\
+ :up=\E[A:nd=\E[C:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
+ :k1=\E[224z:k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:\
+ :k6=\E[229z:k7=\E[230z:k8=\E[231z:k9=\E[232z:
+
+M-|sun-e|sun-nic|sune|Sun Microsystems Workstation without insert character:\
+ :ic@:im@:ei@:tc=sun:
+Mu|sun-s|Sun Microsystems Workstation window with status line:\
+ :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun:
+Mu|sun-e-s|sun-s-e|Sun Microsystems Workstation with status hacked for emacs:\
+ :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun-e:
+M0|sun-48|Sun 48-line window:\
+ :li#48:co#80:tc=sun:
+M1|sun-34|Sun 34-line window:\
+ :li#34:co#80:tc=sun:
+M2|sun-24|Sun 24-line window:\
+ :li#24:co#80:tc=sun:
+M3|sun-17|Sun 17-line window:\
+ :li#17:co#80:tc=sun:
+
+v9|925a|tvi925a|TeleVideo Model 925:\
+ :al=\EE:am:bs:bt=\EI:bw:cd=\EY:ce=\ET:cl=^Z:cm=\E=%+ %+ :co#80:dc=\EW:\
+ :dl=\ER:do=^V:ei=:ic=\EQ:if=/usr/share/lib/tabset/std:im=:kb=^H:kd=^V:\
+ :kh=^^:kl=^H:kn#12:kr=^L:ku=^K:li#24:nd=^L:pt:se=\EG0:sg#1:so=\EG4:\
+ :ue=\EG0:ug#1:ul:up=^K:us=\EG8:is=\El\
+ :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\
+ :ve=\E.4:vs=\E.2:
+
+d0|vt100|vt100-am|vt100am|dec vt100:\
+ :do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=5\ED:\
+ :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
+ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
+ :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
+ :rf=/usr/share/lib/tabset/vt100:\
+ :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
+ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
+ :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:xn:\
+ :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
+
+# Amiga termcap by Bram Moolenaar
+AA|amiga|Amiga ANSI:\
+ :co#80:li#25:am:do=\E[B:ce=\E[K:cd=\E[J:\
+ :cl=\014:ku=\233A:kd=\233B:kl=\233D:kr=\233C:kb=^H:\
+ :#4=\233 A:%i=\233 @:%1=\233?~:\
+ :k1=\2330~:k2=\2331~:k3=\2332~:k4=\2333~:k5=\2334~:\
+ :k6=\2335~:k7=\2336~:k8=\2337~:k9=\2338~:k;=\2339~:\
+ :F1=\23310~:F2=\23311~:F3=\23312~:F4=\23313~:F5=\23314~:\
+ :F6=\23315~:F7=\23316~:F8=\23317~:F9=\23318~:FA=\23319~:\
+ :al=\E[L:AL=\E[%dL:dl=\E[M:DL=\E[%dM:le=^H:cm=\E[%i%d;%dH:\
+ :nd=\E[C:RI=\E[%dC:up=\E[A:\
+ :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:vi=\E[0 p:ve=\E[1 p:\
+ :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\E[m:
+
+# Acorn VDU
+# For non-green text, change the ^B in the :cl= line to
+# your favourite control code.
+a0|acorn0|Acorn VDU Driver Mode 0:\
+ :cl=^V\200^S^A^B\200\200\200:\
+ :is=^C^F^D^O^V\200^S^A^B\200\200\200:\
+ :tc=acorn_generic
+
+ag|acorn_generic|Acorn Generic VDU driver:\
+ :li#32:\
+ :co#80:\
+ :am:\
+ :bs:\
+ :bw:\
+ :bl=^G:\
+ :ce=^W^H^E^F\200\200\200\200\200\200:\
+ :cl=^L:\
+ :cm=^_%r%.%.:\
+ :ho=^^:\
+ :le=\010:\
+ :cr=\015:\
+ :me=^W^Q^E\200\200\200\200\200\200\200:\
+ :mr=^W^Q^E\200\200\200\200\200\200\200:\
+ :sb=^W^G^A^B\200\200\200\200\200\200:\
+ :se=^W^Q^E\200\200\200\200\200\200\200:\
+ :sf=^W^G^A^C\200\200\200\200\200\200:\
+ :so=^W^Q^E\200\200\200\200\200\200\200:\
+ :sr=^W^G^A^B\200\200\200\200\200\200:\
+ :up=^K:\
+ :vb=^R^C^G^Y^D\200\200\200\200^Ye\200^E\200^D^Ye\200\200\200\200:\
+ :vi=^W^A\200\200\200\200\200\200\200\200:\
+ :ve=^W^A^A\200\200\200\200\200\200\200:\
+ :ku=\317:\
+ :kd=\316:\
+ :kl=\314:\
+ :kr=\315:\
+ :kP=\337:\
+ :kN=\336:\
+ :kh=\036:\
+ :kH=\313:\
+ :su=\337:\
+ :sd=\336:\
+ :#4=\334:\
+ :%i=\335:\
+ :k1=\301:\
+ :k2=\302:\
+ :k3=\303:\
+ :k4=\304:\
+ :k5=\305:\
+ :k6=\306:\
+ :k7=\307:\
+ :k8=\310:\
+ :k9=\311:\
+ :F1=\321:\
+ :F2=\322:\
+ :F3=\323:\
+ :F4=\324:\
+ :F5=\325:\
+ :F6=\326:\
+ :F7=\327:\
+ :F8=\330:\
+ :F9=\331
+
+#
+# END OF TERMCAP
+#
diff --git a/runtime/tools.info b/runtime/tools.info
new file mode 100755
index 000000000..4d173b0bc
--- /dev/null
+++ b/runtime/tools.info
Binary files differ
diff --git a/runtime/tools/README.txt b/runtime/tools/README.txt
new file mode 100644
index 000000000..3133f13ca
--- /dev/null
+++ b/runtime/tools/README.txt
@@ -0,0 +1,37 @@
+Some tools that can be used with Vim:
+
+blink.c: C program to make the cursor blink in an xterm.
+
+ccfilter*: C program to filter the output of a few compilers to a common
+ QuickFix format.
+
+efm_filter.*: Perl script to filter compiler messages to QuickFix format.
+
+efm_perl.pl: Perl script to filter error messages from the Perl interpreter
+ for use with Vim quickfix mode.
+
+mve.* Awk script to filter error messages to QuickFix format.
+
+pltags.pl: Perl script to create a tags file from Perl scripts.
+
+ref: Shell script for the K command.
+
+shtags.*: Perl script to create a tags file from a shell script.
+
+tcltags: Shell + Awk script to create a tags file from a TCL file.
+
+vim132: Shell script to edit in 132 column mode on vt100 compatible
+ terminals.
+
+vimm: Shell script to start Vim on a DEC terminal with mouse
+ enabled.
+
+vimspell.*: Shell script for highlighting spelling mistakes.
+
+vim_vs_net.cmd: MS-Windows command file to use Vim with MS Visual Studio 7 and
+ later.
+
+xcmdsrv_client.c: Example for a client program that communicates with a Vim
+ server through the X-Windows interface.
+
+[xxd (and tee for OS/2) can be found in the src directory]
diff --git a/runtime/tools/blink.c b/runtime/tools/blink.c
new file mode 100644
index 000000000..1ffd848ed
--- /dev/null
+++ b/runtime/tools/blink.c
@@ -0,0 +1,21 @@
+/*
+ * An extremely simple program to make the cursor blink in an xterm.
+ * This is useful when the cursor is hard to spot in a highlighted file.
+ * Start in the background: "blink&" Stop by killing it.
+ * Bram Moolenaar 980109 (based on an idea from John Lange).
+ */
+
+#include <stdio.h>
+
+main()
+{
+ while (1)
+ {
+ printf("\e[?25h");
+ fflush(stdout);
+ usleep(400000); /* on time */
+ printf("\e[?25l");
+ fflush(stdout);
+ usleep(250000); /* off time */
+ }
+}
diff --git a/runtime/tools/ccfilter.1 b/runtime/tools/ccfilter.1
new file mode 100644
index 000000000..e3de38da1
--- /dev/null
+++ b/runtime/tools/ccfilter.1
@@ -0,0 +1,93 @@
+.TH ccfilter 1 "01-Apr-97"
+.SH NAME
+ccfilter \- a compiler's output filter for vim quickfix
+.SH SYNOPSIS
+ccfilter [
+.B <options>
+]
+.SH DESCRIPTION
+The ccfilter utility "filters" the output of several compilers
+and makers (make/gmake) from several platforms (see NOTES below)
+to a standardized format which easily fits in vim's quickfix
+feature. For further details, see in vim ":help quickfix".
+.PP
+ccfilter reads
+.B 'stdin'
+and outputs to
+.B 'stdout'
+\.
+.PP
+The need for ccfilter is clear, as some compilers have irregular
+and/or multiple line error messages (with the relevant information on
+line 2), which makes it impossible for the errorformat to correctly
+display them !
+
+When working on different platforms, and with different compilers,
+ccfilter eases the utilization of quickfix, due to it's standardized
+output, allowing to have in .vimrc a plain
+.br
+.B \ \ \ \ :set\ errorformat=%f:%l:%c:%t:%m
+
+.SH USAGE
+When using ccfilter, one would include the following lines in .vimrc:
+.br
+.B \ \ \ \ :set shellpipe=\\\\|&ccfilter\\\\>
+.br
+.B \ \ \ \ :set errorformat=%f:%l:%c:%t:%m
+
+.SH OPTIONS
+.TP 16
+-c
+Decrement column by one. This may be needed, depending on
+the compiler being used.
+.TP
+-r
+Decrement row by one. This may be needed, depending on
+the compiler being used.
+.TP
+-v
+Verbose (Outputs also invalid lines).
+This option makes ccfilter output also the lines that
+couldn't be correctly parsed. This is used mostly for
+ccfilter debugging.
+.TP
+-o <COMPILER>
+Treat input as <COMPILER>'s output.
+Even when configuring ccfilter to assume a default
+COMPILER, sometimes it's helpful to be able to specify
+the COMPILER used to generate ccfilter's input.
+For example, when cross-compiling on a network from a
+single machine.
+.TP
+-h
+Shows a brief help, describing the configured default COMPILER
+and the valid parameters for COMPILER.
+
+.SH NOTES
+Currently, ccfilter accepts output from several compilers, as
+described below:
+.TP 10
+GCC
+GCC compiler
+.TP
+AIX
+AIX's C compiler
+.TP
+ATT
+AT&T/NCR's High Performance C Compiler
+.TP
+IRIX
+IRIX's MIPS/MIPSpro C compiler
+.TP
+SOLARIS
+SOLARIS's SparcWorks C compiler
+.TP
+HPUX
+HPUX's C compiler
+
+.SH AUTHOR
+.B ccfilter
+was developed by
+.B Pablo Ariel Kohan
+.BR
+.B mailto:pablo@memco.co.il
diff --git a/runtime/tools/ccfilter.c b/runtime/tools/ccfilter.c
new file mode 100644
index 000000000..270333910
--- /dev/null
+++ b/runtime/tools/ccfilter.c
@@ -0,0 +1,326 @@
+/* ======================================================================= */
+/* Project : VIM */
+/* Module : ccfilter Version: 02.01.01 */
+/* File : ccfilter.c */
+/* Purpose : Filter gmake/cc output into a standardized form */
+/* ======================================================================= */
+/* Created On: 12-Sep-95 20:32 */
+/* Last modification: 03-Feb-98 */
+/* -e option added by Bernd Feige */
+/* ======================================================================= */
+/* Copyright : */
+/* This source file is copyright (c) to Pablo Ariel Kohan */
+/* ======================================================================= */
+#define __CCFILTER_C__
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LINELENGTH 2048
+
+/* Collector(s) */
+char Line[LINELENGTH];
+char Line2[LINELENGTH];
+/* Components */
+char FileName[1024];
+char BasePath[1024];
+char CWD[1024];
+unsigned long Row;
+unsigned long Col;
+char Severity;
+char Reason[LINELENGTH];
+
+#define COMPILER_UNKNOWN 0
+#define COMPILER_GCC 1
+#define COMPILER_AIX 2
+#define COMPILER_ATT 3
+#define COMPILER_IRIX 4
+#define COMPILER_SOLARIS 5
+#define COMPILER_HPUX 6
+
+char *COMPILER_Names[][2] =
+ {
+ /* Name Description */
+ { "N/A", "" },
+ { "GCC", "GCC compiler" },
+ { "AIX", "AIX's C compiler" },
+ { "ATT", "AT&T/NCR's High Performance C Compiler" },
+ { "IRIX", "IRIX's MIPS/MIPSpro C compiler" },
+ { "SOLARIS", "SOLARIS's SparcWorks C compiler" },
+ { "HPUX", "HPUX's C compiler" }
+ };
+#define COMPILER_QTY (sizeof(COMPILER_Names)/sizeof(COMPILER_Names[0]))
+
+#if defined(_GCC)
+# define COMPILER_DEFAULT COMPILER_GCC
+#elif defined(_AIX)
+# define COMPILER_DEFAULT COMPILER_AIX
+#elif defined(_ATT)
+# define COMPILER_DEFAULT COMPILER_ATT
+#elif defined(_IRIX)
+# define COMPILER_DEFAULT COMPILER_IRIX
+#elif defined(_SOLARIS)
+# define COMPILER_DEFAULT COMPILER_SOLARIS
+#elif defined(_HPUX)
+# define COMPILER_DEFAULT COMPILER_HPUX
+#else
+# define COMPILER_DEFAULT COMPILER_UNKNOWN
+#endif
+
+const char USAGE[] =
+"ccfilter v2.1 (c)1994-1997 by Pablo Ariel Kohan\n"
+"Filter Out compiler's output, and converts it to fit VIM\n\n"
+"Usage:\n"
+" ccfilter [<options>]\n"
+"Where: <options> is one or more of:\n"
+" -c Decrement column by one\n"
+" -r Decrement row by one\n"
+" -e Echo stdin to stderr\n"
+" -v Verbose (Outputs also invalid lines)\n"
+" -o <COMPILER> Treat input as <COMPILER>'s output\n"
+" Note: COMPILER may be preceded by an _\n"
+" -h This usage.\n";
+
+
+int ShowUsage( char *szError )
+{ int i;
+
+ fprintf( stderr, USAGE );
+
+ fprintf( stderr, "Current default <COMPILER>: %s\n",
+ COMPILER_Names[COMPILER_DEFAULT][0] );
+
+ fprintf( stderr, "Acceptable parameters for <COMPILER> are:\n" );
+ for (i=1; i < COMPILER_QTY; i++)
+ fprintf( stderr, " %-15.15s %s\n",
+ COMPILER_Names[i][0],
+ COMPILER_Names[i][1] );
+ fprintf(stderr, szError);
+ return 0;
+}
+
+char *echogets(char *s, int echo) {
+ char * const retval=fgets(s, LINELENGTH, stdin);
+ if (echo!=0 && retval!=NULL) {
+ fputs(retval, stderr);
+ }
+ return retval;
+}
+
+int main( int argc, char *argv[] )
+{ int rv, i, j, ok;
+ int stay;
+ int prefetch;
+ char *p;
+ int dec_col = 0; /* Decrement column value by 1 */
+ int dec_row = 0; /* Decrement row value by 1 */
+ int echo = 0; /* Echo stdin to stderr */
+ int verbose = 0; /* Include Bad Formatted Lines */
+ int CWDlen;
+ int COMPILER = COMPILER_DEFAULT;
+
+ getcwd( CWD, sizeof(CWD) );
+ CWDlen = strlen(CWD);
+
+ for (i=1; i<argc; i++)
+ {
+ if (argv[i][0] != '-')
+ return ShowUsage("");
+ switch ( argv[i][1] )
+ {
+ case 'c':
+ dec_col = 1;
+ break;
+ case 'r':
+ dec_row = 1;
+ break;
+ case 'e':
+ echo = 1;
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+ case 'o':
+ {
+ if (i+1 >= argc)
+ return ShowUsage("Error: Missing parameter for -o\n");
+ i++;
+ COMPILER = -1;
+ for (j=1; j<COMPILER_QTY; j++)
+ if ( (strcmp(argv[i], COMPILER_Names[j][0]) == 0) ||
+ ( (argv[i][0] == '_') &&
+ (strcmp(&argv[i][1], COMPILER_Names[j][0]) == 0) ) )
+ COMPILER = j;
+ if (COMPILER == -1)
+ return ShowUsage("Error: Invalid COMPILER specified\n");
+ }
+ break;
+ case 'h':
+ return ShowUsage("");
+ default:
+ return ShowUsage("Error: Invalid option\n");
+ }
+ }
+ if (COMPILER == 0)
+ return ShowUsage("Error: COMPILER must be specified in this system\n");
+
+ stay = ( echogets(Line, echo) != NULL );
+ prefetch = 0;
+
+ while( stay )
+ {
+ *FileName = 0;
+ Row = 0;
+ Col = 0;
+ Severity = ' ';
+ *Reason = 0;
+ ok = 0;
+ switch (COMPILER)
+ {
+ case COMPILER_GCC:
+ Severity = 'e';
+#ifdef GOTO_FROM_WHERE_INCLUDED
+ rv = sscanf( Line, "In file included from %[^:]:%u:",
+ FileName, &Row );
+ if ( rv == 2 )
+ {
+ ok = (echogets(Reason, echo) != NULL);
+ }
+ else
+#endif
+ {
+ if ((rv = sscanf( Line, "%[^:]:%u: warning: %[^\n]",
+ FileName, &Row, Reason ))==3) {
+ Severity = 'w';
+ } else {
+ rv = sscanf( Line, "%[^:]:%u: %[^\n]",
+ FileName, &Row, Reason );
+ }
+ ok = ( rv == 3 );
+ }
+ Col = (dec_col ? 1 : 0 );
+ break;
+ case COMPILER_AIX:
+ rv = sscanf( Line, "\"%[^\"]\", line %u.%u: %*s (%c) %[^\n]",
+ FileName, &Row, &Col, &Severity, Reason );
+ ok = ( rv == 5 );
+ break;
+ case COMPILER_HPUX:
+ rv = sscanf( Line, "cc: \"%[^\"]\", line %u: %c%*[^:]: %[^\n]",
+ FileName, &Row, &Severity, Reason );
+ ok = ( rv == 4 );
+ Col = (dec_col ? 1 : 0 );
+ break;
+ case COMPILER_SOLARIS:
+ rv = sscanf( Line, "\"%[^\"]\", line %u: warning: %[^\n]",
+ FileName, &Row, Reason );
+ Severity = 'w';
+ ok = ( rv == 3 );
+ if ( rv != 3 )
+ {
+ rv = sscanf( Line, "\"%[^\"]\", line %u: %[^\n]",
+ FileName, &Row, Reason );
+ Severity = 'e';
+ ok = ( rv == 3 );
+ }
+ Col = (dec_col ? 1 : 0 );
+ break;
+ case COMPILER_ATT:
+ rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u%*[^:]:%[^\n]",
+ &Severity, FileName, &Row, &Col, Reason );
+ ok = ( rv == 5 );
+
+ if (rv != 5)
+ { rv = sscanf( Line, "%c \"%[^\"]\",L%u/C%u: %[^\n]",
+ &Severity, FileName, &Row, &Col, Reason );
+ ok = ( rv == 5 );
+ }
+
+ if (rv != 5)
+ { rv = sscanf( Line, "%c \"%[^\"]\",L%u: %[^\n]",
+ &Severity, FileName, &Row, Reason );
+ ok = ( rv == 4 );
+ Col = (dec_col ? 1 : 0 );
+ }
+
+ stay = (echogets(Line2, echo) != NULL);
+ while ( stay && (Line2[0] == '|') )
+ { for (p=&Line2[2]; (*p) && (isspace(*p)); p++);
+ strcat( Reason, ": " );
+ strcat( Reason, p );
+ Line2[0] = 0;
+ stay = (echogets(Line2, echo) != NULL);
+ }
+ prefetch = 1;
+ strcpy( Line, Line2 );
+ break;
+ case COMPILER_IRIX:
+ Col = 1;
+ prefetch = 0;
+ rv = 0;
+ ok = 0;
+ if ( !strncmp(Line, "cfe: ", 5) )
+ { p = &Line[5];
+ Severity = tolower(*p);
+ p = strchr( &Line[5], ':' );
+ if (p == NULL)
+ { ok = 0;
+ }
+ else
+ {
+ rv = sscanf( p+2, "%[^:]: %u: %[^\n]",
+ FileName, &Row, Reason );
+ if (rv != 3)
+ rv = sscanf( p+2, "%[^,], line %u: %[^\n]",
+ FileName, &Row, Reason );
+ ok = ( rv == 3 );
+ }
+
+ if (ok)
+ { prefetch = 1;
+ stay = (echogets(Line, echo) != NULL);
+ if (Line[0] == ' ')
+ stay = (echogets(Line2, echo) != NULL);
+ if ( (Line2[0] == ' ') &&
+ ( (Line2[1] == '-') || (Line2[1] == '^') ) )
+ { Col = strlen(Line2)-1;
+ prefetch = 0;
+ }
+ else
+ { strcat( Line, "\n" );
+ strcat( Line, Line2 );
+ }
+ }
+ }
+ break;
+ }
+ if (dec_col) Col--;
+ if (dec_row) Row--;
+ if (!ok)
+ {
+ if ( Line[0] == 'g' )
+ p = &Line[1];
+ else
+ p = &Line[0];
+ ok = sscanf( p, "make[%*d]: Entering directory `%[^']",
+ BasePath );
+ if (verbose)
+ printf( "[%u]?%s\n", ok, Line );
+ }
+ else
+ {
+ for (p=Reason; (*p) && (isspace(*p)); p++);
+ if ( BasePath[CWDlen] == 0 )
+ printf( "%s:%u:%u:%c:%s\n", FileName, Row, Col, Severity, p );
+ else
+ {
+ printf( "%s/%s:%u:%u:%c:%s\n", &BasePath[CWDlen+1], FileName, Row, Col, Severity, p );
+ }
+ }
+ if (!prefetch)
+ stay = ( echogets(Line, echo) != NULL );
+ }
+ return 0;
+}
diff --git a/runtime/tools/ccfilter_README.txt b/runtime/tools/ccfilter_README.txt
new file mode 100644
index 000000000..ff658c92f
--- /dev/null
+++ b/runtime/tools/ccfilter_README.txt
@@ -0,0 +1,91 @@
+COMPILING AND INSTALLING:
+=========================
+
+To compile ccfilter, you can just do a plain:
+ cc ccfilter.c -o ccfilter
+Though, it may be wise to have your default compiler defined,
+so you would normally compile it with one of the following:
+ cc -D_GCC ccfilter.c -o ccfilter
+ cc -D_AIX ccfilter.c -o ccfilter
+ cc -D_ATT ccfilter.c -o ccfilter
+ cc -D_IRIX ccfilter.c -o ccfilter
+ cc -D_SOLARIS ccfilter.c -o ccfilter
+ cc -D_HPUX ccfilter.c -o ccfilter
+You can then copy ccfilter to it's target destination (i.e: /usr/local/bin).
+The man page ccfilter.1 has to be copied to somewhere in your MANPATH,
+under a man1 directory (i.e: /usr/local/man/man1).
+
+
+SUPPORTED COMPILERS/PORTING NOTES:
+==================================
+
+The supported formats for the different compilers are described below:
+In this section, meta-names are used as place-holders in the line
+formats: <FILE> <ROW> <COL> <SEVERITY> <REASON> <>
+The <> denotes ignored text.
+Line formats are delimited by the ^ (caret) symbol.
+
+0) Special case: "gmake directory change" lines:
+ Lines with a format like:
+ ^gmake[<NUM>]: Entering directory `<DIR>'^
+ are used to follow the directory changes during the make process,
+ providing in the <FILE> part, a relative (if possible) directory
+ path to the erroneous file.
+
+
+1) GCC:
+ Recognized lines are of the format:
+ - ^In file included from <FILE>:<ROW>:^
+ Line following this one is used as <REASON>
+ <SEVERITY> is always 'e' (error)
+ <COL> is always '0'
+
+ - ^<FILE>:<ROW>:<REASON>^
+ <SEVERITY> is always 'e' (error)
+ <COL> is always '0'
+
+
+2) AIX:
+ Recognized lines are of the format:
+ - ^"<FILE>", line <ROW>.<COL>: <> (<SEVERITY>) <REASON>",
+
+
+3) HPUX:
+ Recognized lines are of the format:
+ - ^cc: "<FILE>", line <ROW>: <SEVERITY>: <REASON>^
+ <COL> is always '0'
+
+
+4) SOLARIS:
+ Recognized lines are of the format:
+ - ^"<FILE>", line <ROW>: warning: <REASON>^
+ This assumes <SEVERITY> is "W"
+ <COL> is always '0'
+
+ - ^"<FILE>", line <ROW>: <REASON>^
+ This assumes <SEVERITY> is "E"
+ <COL> is always '0'
+
+
+5) ATT / NCR:
+ Recognized lines are of the format:
+ - ^<SEVERITY> "<FILE>",L<ROW>/C<COL><>:<REASON>^
+ or
+ - ^<SEVERITY> "<FILE>",L<ROW>/C<COL>:<REASON>^
+ Following lines beginning with a pipe (|) are continuation
+ lines, and are therefore appended to the <REASON>
+
+ - ^<SEVERITY> "<FILE>",L<ROW>:<REASON>^
+ <COL> is '0'
+ Following lines beginning with a pipe (|) are continuation
+ lines, and are therefore appended to the <REASON>
+
+
+6) SGI-IRIX:
+ Recognized lines are of the format:
+ - ^cfe: <SEVERITY>: <FILE>: <ROW>: <REASON>^
+ or
+ ^cfe: <SEVERITY>: <FILE>, line <ROW>: <REASON>^
+ Following lines beginning with a dash (-) are "column-bar"
+ that end with a caret in the column of the error. These lines
+ are analyzed to generate the <COL>.
diff --git a/runtime/tools/efm_filter.pl b/runtime/tools/efm_filter.pl
new file mode 100755
index 000000000..1d1a4f303
--- /dev/null
+++ b/runtime/tools/efm_filter.pl
@@ -0,0 +1,39 @@
+#!/usr/bin/env perl
+#
+# This program works as a filter that reads from stdin, copies to
+# stdout *and* creates an error file that can be read by vim.
+#
+# This program has only been tested on SGI, Irix5.3.
+#
+# Written by Ives Aerts in 1996. This little program is not guaranteed
+# to do (or not do) anything at all and can be freely used for
+# whatever purpose you can think of.
+
+$args = @ARGV;
+
+unless ($args == 1) {
+ die("Usage: vimccparse <output filename>\n");
+}
+
+$filename = @ARGV[0];
+open (OUT, ">$filename") || die ("Can't open file: \"$filename\"");
+
+while (<STDIN>) {
+ print;
+ if ( (/"(.*)", line (\d+): (e)rror\((\d+)\):/)
+ || (/"(.*)", line (\d+): (w)arning\((\d+)\):/) ) {
+ $file=$1;
+ $line=$2;
+ $errortype="\u$3";
+ $errornr=$4;
+ chop($errormsg=<STDIN>);
+ $errormsg =~ s/^\s*//;
+ $sourceline=<STDIN>;
+ $column=index(<STDIN>, "^") - 1;
+
+ print OUT "$file>$line:$column:$errortype:$errornr:$errormsg\n";
+ }
+}
+
+close(OUT);
+exit(0);
diff --git a/runtime/tools/efm_filter.txt b/runtime/tools/efm_filter.txt
new file mode 100644
index 000000000..d3f97f45a
--- /dev/null
+++ b/runtime/tools/efm_filter.txt
@@ -0,0 +1,31 @@
+[adopted from a message that Ives posted in the Vim mailing list]
+
+Some compilers produce an error message that cannot be handled with
+'errorformat' in Vim. Following is an example of a Perl script that
+translates one error message into something that Vim understands.
+
+
+The compiler that generates this kind of error messages (4 lines):
+
+"/tmp_mnt/cm/src/apertos/MoU/MetaCore/MetaCore/common/src/MetaCoreImp_M.cc",
+line 50: error(3114):
+ identifier "PRIMITIVE_M" is undefined
+ return(ExecuteCore(PRIMITIVE_M,
+
+You can find a small perl program at the end.
+The way I use it is:
+
+:set errorformat=%f>%l:%c:%t:%n:%m
+:set makeprg=clearmake\ -C\ gnu
+:set shellpipe=2>&1\|\ vimccparse
+
+If somebody thinks this is useful: feel free to do whatever you can think
+of with this code.
+
+-Ives
+____________________________________________________________
+Ives Aerts (SW Developer) Sony Telecom Europe
+ives@sonytel.be St.Stevens Woluwestr. 55
+`Death could create most things, B-1130 Brussels, Belgium
+ except for plumbing.' PHONE : +32 2 724 19 67
+ (Soul Music - T.Pratchett) FAX : +32 2 726 26 86
diff --git a/runtime/tools/efm_perl.pl b/runtime/tools/efm_perl.pl
new file mode 100755
index 000000000..570d6e766
--- /dev/null
+++ b/runtime/tools/efm_perl.pl
@@ -0,0 +1,153 @@
+#!/usr/bin/perl -w
+
+# vimparse.pl - Reformats the error messages of the Perl interpreter for use
+# with the quickfix mode of Vim
+#
+# Copyright (©) 2001 by Jörg Ziefle <joerg.ziefle@gmx.de>
+# You may use and distribute this software under the same terms as Perl itself.
+#
+# Usage: put one of the two configurations below in your ~/.vimrc (without the
+# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl
+# before):
+#
+# Program is run interactively with 'perl -w':
+#
+# set makeprg=$HOME/bin/vimparse.pl\ %\ $*
+# set errorformat=%f:%l:%m
+#
+# Program is only compiled with 'perl -wc':
+#
+# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
+# set errorformat=%f:%l:%m
+#
+# Usage:
+# vimparse.pl [-c] [-f <errorfile>] <programfile> [programargs]
+#
+# -c compile only, don't run (perl -wc)
+# -f write errors to <errorfile>
+#
+# Example usages:
+# * From the command line:
+# vimparse.pl program.pl
+#
+# vimparse.pl -c -f errorfile program.pl
+# Then run vim -q errorfile to edit the errors with Vim.
+#
+# * From Vim:
+# Edit in Vim (and save, if you don't have autowrite on), then
+# type ':mak' or ':mak args' (args being the program arguments)
+# to error check.
+#
+# Version history:
+# 0.2 (04/12/2001):
+# * First public version (sent to Bram)
+# * -c command line option for compiling only
+# * grammatical fix: 'There was 1 error.'
+# * bug fix for multiple arguments
+# * more error checks
+# * documentation (top of file, &usage)
+# * minor code clean ups
+# 0.1 (02/02/2001):
+# * Initial version
+# * Basic functionality
+#
+# Todo:
+# * test on more systems
+# * use portable way to determine the location of perl ('use Config')
+# * include option that shows perldiag messages for each error
+# * allow to pass in program by STDIN
+# * more intuitive behaviour if no error is found (show message)
+#
+# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for
+# you.
+
+use strict;
+use Getopt::Std;
+
+use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
+
+use constant VERSION => 0.2;
+
+getopts('cf:h');
+
+&usage if $opt_h; # not necessarily needed, but good for further extension
+
+if (defined $opt_f) {
+
+ open FILE, "> $opt_f" or do {
+ warn "Couldn't open $opt_f: $!. Using STDOUT instead.\n";
+ undef $opt_f;
+ };
+
+};
+
+my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
+
+(my $file = shift) or &usage; # display usage if no filename is supplied
+my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
+
+my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`;
+
+my $errors = 0;
+foreach my $line (@lines) {
+
+ chomp($line);
+ my ($file, $lineno, $message, $rest);
+
+ if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) {
+
+ ($message, $file, $lineno, $rest) = ($1, $2, $3, $4);
+ $errors++;
+ $message .= $rest if ($rest =~ s/^,//);
+ print $handle "$file:$lineno:$message\n";
+
+ } else { next };
+
+}
+
+if (defined $opt_f) {
+
+ my $msg;
+ if ($errors == 1) {
+
+ $msg = "There was 1 error.\n";
+
+ } else {
+
+ $msg = "There were $errors errors.\n";
+
+ };
+
+ print STDOUT $msg;
+ close FILE;
+ unlink $opt_f unless $errors;
+
+};
+
+sub usage {
+
+ (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
+ print<<EOT;
+Usage:
+ $0 [-c] [-f <errorfile>] <programfile> [programargs]
+
+ -c compile only, don't run (executes 'perl -wc')
+ -f write errors to <errorfile>
+
+Examples:
+ * At the command line:
+ $0 program.pl
+ Displays output on STDOUT.
+
+ $0 -c -f errorfile program.pl
+ Then run 'vim -q errorfile' to edit the errors with Vim.
+
+ * In Vim:
+ Edit in Vim (and save, if you don't have autowrite on), then
+ type ':mak' or ':mak args' (args being the program arguments)
+ to error check.
+EOT
+
+ exit 0;
+
+};
diff --git a/runtime/tools/mve.awk b/runtime/tools/mve.awk
new file mode 100755
index 000000000..396f80677
--- /dev/null
+++ b/runtime/tools/mve.awk
@@ -0,0 +1,23 @@
+#!/usr/bin/nawk -f
+#
+# Change "nawk" to "awk" or "gawk" if you get errors.
+#
+# Make Vim Errors
+# Processes errors from cc for use by Vim's quick fix tools
+# specifically it translates the ---------^ notation to a
+# column number
+#
+BEGIN { FS="[:,]" }
+
+/^cfe/ { file=$3
+ msg=$5
+ split($4,s," ")
+ line=s[2]
+}
+
+# You may have to substitute a tab character for the \t here:
+/^[\t-]*\^/ {
+ p=match($0, ".*\\^" )
+ col=RLENGTH-2
+ printf("%s, line %d, col %d : %s\n", file,line,col,msg)
+}
diff --git a/runtime/tools/mve.txt b/runtime/tools/mve.txt
new file mode 100644
index 000000000..8aa5cf66b
--- /dev/null
+++ b/runtime/tools/mve.txt
@@ -0,0 +1,20 @@
+[ The mve awk script was posted on the vimdev mailing list ]
+
+From: jimmer@barney.mdhc.mdc.com (J. McGlasson)
+Date: Mon, 31 Mar 1997 13:16:49 -0700 (Mar)
+
+My compiler (SGI MIPSpro C compiler - IRIX 6.4) works like this.
+I have written a script mve (make vim errors), through which I pipe my make
+output, which translates output of the following form:
+
+cfe: Error: syntax.c, line 4: Syntax Error
+ int i[12;
+ ------------^
+
+into:
+
+ cl.c, line 4, col 12 : Syntax Error
+
+(in vim notation: %f, line %l, col %c : %m)
+
+You might be able to tailor this for your compiler's output.
diff --git a/runtime/tools/pltags.pl b/runtime/tools/pltags.pl
new file mode 100755
index 000000000..7a74682b8
--- /dev/null
+++ b/runtime/tools/pltags.pl
@@ -0,0 +1,300 @@
+#!/usr/bin/env perl
+
+# pltags - create a tags file for Perl code, for use by vi(m)
+#
+# Distributed with Vim <http://www.vim.org/>, latest version always available
+# at <http://www.mscha.com/mscha.html?pltags#tools>
+#
+# Version 2.3, 28 February 2002
+#
+# Written by Michael Schaap <pltags@mscha.com>. Suggestions for improvement
+# are very welcome!
+#
+# This script will not work with Perl 4 or below!
+#
+# Revision history:
+# 1.0 1997? Original version, quickly hacked together
+# 2.0 1999? Completely rewritten, better structured and documented,
+# support for variables, packages, Exuberant Ctags extensions
+# 2.1 Jun 2000 Fixed critical bug (typo in comment) ;-)
+# Support multiple level packages (e.g. Archive::Zip::Member)
+# 2.2 Jul 2001 'Glob' wildcards - especially useful under Windows
+# (thanks to Serge Sivkov and Jason King)
+# Bug fix: reset package name for each file
+# 2.21 Jul 2001 Oops... bug in variable detection (/local../ -> /^local.../)
+# 2.3 Feb 2002 Support variables declared with "our"
+# (thanks to Lutz Mende)
+
+# Complain about undeclared variables
+use strict;
+
+# Used modules
+use Getopt::Long;
+
+# Options with their defaults
+my $do_subs = 1; # --subs, --nosubs include subs in tags file?
+my $do_vars = 1; # --vars, --novars include variables in tags file?
+my $do_pkgs = 1; # --pkgs, --nopkgs include packages in tags file?
+my $do_exts = 1; # --extensions, --noextensions
+ # include Exuberant Ctags extensions
+
+# Global variables
+my $VERSION = "2.21"; # pltags version
+my $status = 0; # GetOptions return value
+my $file = ""; # File being processed
+my @tags = (); # List of produced tags
+my $is_pkg = 0; # Are we tagging a package?
+my $has_subs = 0; # Has this file any subs yet?
+my $package_name = ""; # Name of current package
+my $var_continues = 0; # Variable declaration continues on last line
+my $line = ""; # Current line in file
+my $stmt = ""; # Current Perl statement
+my @vars = (); # List of variables in declaration
+my $var = ""; # Variable in declaration
+my $tagline = ""; # Tag file line
+
+# Create a tag file line and push it on the list of found tags
+sub MakeTag($$$$$)
+{
+ my ($tag, # Tag name
+ $type, # Type of tag
+ $is_static, # Is this a static tag?
+ $file, # File in which tag appears
+ $line) = @_; # Line in which tag appears
+
+ my $tagline = ""; # Created tag line
+
+ # Only process tag if not empty
+ if ($tag)
+ {
+ # Get rid of \n, and escape / and \ in line
+ chomp $line;
+ $line =~ s/\\/\\\\/g;
+ $line =~ s/\//\\\//g;
+
+ # Create a tag line
+ $tagline = "$tag\t$file\t/^$line\$/";
+
+ # If we're told to do so, add extensions
+ if ($do_exts)
+ {
+ $tagline .= ";\"\t$type"
+ . ($is_static ? "\tfile:" : "")
+ . ($package_name ? "\tclass:$package_name" : "");
+ }
+
+ # Push it on the stack
+ push (@tags, $tagline);
+ }
+}
+
+# Parse package name from statement
+sub PackageName($)
+{
+ my ($stmt) = @_; # Statement
+
+ # Look for the argument to "package". Return it if found, else return ""
+ if ($stmt =~ /^package\s+([\w:]+)/)
+ {
+ my $pkgname = $1;
+
+ # Remove any parent package name(s)
+ $pkgname =~ s/.*://;
+ return $pkgname;
+ }
+ else
+ {
+ return "";
+ }
+}
+
+# Parse sub name from statement
+sub SubName($)
+{
+ my ($stmt) = @_; # Statement
+
+ # Look for the argument to "sub". Return it if found, else return ""
+ if ($stmt =~ /^sub\s+([\w:]+)/)
+ {
+ my $subname = $1;
+
+ # Remove any parent package name(s)
+ $subname =~ s/.*://;
+ return $subname;
+ }
+ else
+ {
+ return "";
+ }
+}
+
+# Parse all variable names from statement
+sub VarNames($)
+{
+ my ($stmt) = @_;
+
+ # Remove my or local from statement, if present
+ $stmt =~ s/^(my|our|local)\s+//;
+
+ # Remove any assignment piece
+ $stmt =~ s/\s*=.*//;
+
+ # Now find all variable names, i.e. "words" preceded by $, @ or %
+ @vars = ($stmt =~ /[\$\@\%]([\w:]+)\b/g);
+
+ # Remove any parent package name(s)
+ map(s/.*://, @vars);
+
+ return (@vars);
+}
+
+############### Start ###############
+
+print "\npltags $VERSION by Michael Schaap <mscha\@mscha.com>\n\n";
+
+# Get options
+$status = GetOptions("subs!" => \$do_subs,
+ "vars!" => \$do_vars,
+ "pkgs!" => \$do_pkgs,
+ "extensions!" => \$do_exts);
+
+# Usage if error in options or no arguments given
+unless ($status && @ARGV)
+{
+ print "\n" unless ($status);
+ print " Usage: $0 [options] filename ...\n\n";
+ print " Where options can be:\n";
+ print " --subs (--nosubs) (don't) include sub declarations in tag file\n";
+ print " --vars (--novars) (don't) include variable declarations in tag file\n";
+ print " --pkgs (--nopkgs) (don't) include package declarations in tag file\n";
+ print " --extensions (--noextensions)\n";
+ print " (don't) include Exuberant Ctags / Vim style\n";
+ print " extensions in tag file\n\n";
+ print " Default options: ";
+ print ($do_subs ? "--subs " : "--nosubs ");
+ print ($do_vars ? "--vars " : "--novars ");
+ print ($do_pkgs ? "--pkgs " : "--nopkgs ");
+ print ($do_exts ? "--extensions\n\n" : "--noextensions\n\n");
+ print " Example: $0 *.pl *.pm ../shared/*.pm\n\n";
+ exit;
+}
+
+# Loop through files on command line - 'glob' any wildcards, since Windows
+# doesn't do this for us
+foreach $file (map { glob } @ARGV)
+{
+ # Skip if this is not a file we can open. Also skip tags files and backup
+ # files
+ next unless ((-f $file) && (-r $file) && ($file !~ /tags$/)
+ && ($file !~ /~$/));
+
+ print "Tagging file $file...\n";
+
+ $is_pkg = 0;
+ $package_name = "";
+ $has_subs = 0;
+ $var_continues = 0;
+
+ open (IN, $file) or die "Can't open file '$file': $!";
+
+ # Loop through file
+ foreach $line (<IN>)
+ {
+ # Statement is line with comments and whitespace trimmed
+ ($stmt = $line) =~ s/#.*//;
+ $stmt =~ s/^\s*//;
+ $stmt =~ s/\s*$//;
+
+ # Nothing left? Never mind.
+ next unless ($stmt);
+
+ # This is a variable declaration if one was started on the previous
+ # line, or if this line starts with my or local
+ if ($var_continues or ($stmt =~/^my\b/)
+ or ($stmt =~/^our\b/) or ($stmt =~/^local\b/))
+ {
+ # The declaration continues if the line does not end with ;
+ $var_continues = ($stmt !~ /;$/);
+
+ # Loop through all variable names in the declaration
+ foreach $var (VarNames($stmt))
+ {
+ # Make a tag for this variable unless we're told not to. We
+ # assume that a variable is always static, unless it appears
+ # in a package before any sub. (Not necessarily true, but
+ # it's ok for most purposes and Vim works fine even if it is
+ # incorrect)
+ if ($do_vars)
+ {
+ MakeTag($var, "v", (!$is_pkg or $has_subs), $file, $line);
+ }
+ }
+ }
+
+ # This is a package declaration if the line starts with package
+ elsif ($stmt =~/^package\b/)
+ {
+ # Get name of the package
+ $package_name = PackageName($stmt);
+
+ if ($package_name)
+ {
+ # Remember that we're doing a package
+ $is_pkg = 1;
+
+ # Make a tag for this package unless we're told not to. A
+ # package is never static.
+ if ($do_pkgs)
+ {
+ MakeTag($package_name, "p", 0, $file, $line);
+ }
+ }
+ }
+
+ # This is a sub declaration if the line starts with sub
+ elsif ($stmt =~/^sub\b/)
+ {
+ # Remember that this file has subs
+ $has_subs = 1;
+
+ # Make a tag for this sub unless we're told not to. We assume
+ # that a sub is static, unless it appears in a package. (Not
+ # necessarily true, but it's ok for most purposes and Vim works
+ # fine even if it is incorrect)
+ if ($do_subs)
+ {
+ MakeTag(SubName($stmt), "s", (!$is_pkg), $file, $line);
+ }
+ }
+ }
+ close (IN);
+}
+
+# Do we have any tags? If so, write them to the tags file
+if (@tags)
+{
+ # Add some tag file extensions if we're told to
+ if ($do_exts)
+ {
+ push (@tags, "!_TAG_FILE_FORMAT\t2\t/extended format/");
+ push (@tags, "!_TAG_FILE_SORTED\t1\t/0=unsorted, 1=sorted/");
+ push (@tags, "!_TAG_PROGRAM_AUTHOR\tMichael Schaap\t/mscha\@mscha.com/");
+ push (@tags, "!_TAG_PROGRAM_NAME\tpltags\t//");
+ push (@tags, "!_TAG_PROGRAM_VERSION\t$VERSION\t/supports multiple tags and extended format/");
+ }
+
+ print "\nWriting tags file.\n";
+
+ open (OUT, ">tags") or die "Can't open tags file: $!";
+
+ foreach $tagline (sort @tags)
+ {
+ print OUT "$tagline\n";
+ }
+
+ close (OUT);
+}
+else
+{
+ print "\nNo tags found.\n";
+}
diff --git a/runtime/tools/ref b/runtime/tools/ref
new file mode 100755
index 000000000..77bfc805e
--- /dev/null
+++ b/runtime/tools/ref
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# ref - Check spelling of the arguments
+#
+# Usage: ref word ..
+#
+# can be used for the K command of Vim
+#
+spell <<EOF
+$*
+EOF
diff --git a/runtime/tools/shtags.1 b/runtime/tools/shtags.1
new file mode 100644
index 000000000..314df883c
--- /dev/null
+++ b/runtime/tools/shtags.1
@@ -0,0 +1,61 @@
+.TH shtags 1 "local Utilities"
+.SH NAME
+shtags \- Create tags for shell scripts
+.SH SYNOPSIS
+.B shtags
+[\fI-mvw\fP] [\fI-t <file>\fP] [\fI-s <shell>\fP] <files>
+.SH DESCRIPTION
+\fBshtags\fP creates a \fBvi(1)\fP tags file for shell scripts - which
+essentially turns your code into a hypertext document. \fBshtags\fP
+attempts to create tags for all function and variable definitions,
+although this is a little difficult, because in most shell languages,
+variables don't need to be explicitly defined, and as such there is
+often no distinct "variable definition". If this is the case,
+\fBshtags\fP simply creates a tag for the first instance of a variable
+which is being set in a simple way, ie: \fIset x = 5\fP.
+.SH OPTIONS
+.IP "\fB-t <file>\fP"
+Name of tags file to create. (default is 'tags')
+.IP "\fB-s <shell>\fP"
+The name of the shell used by the script(s). By default,
+\fBshtags\fP tries to work out which is the appropriate shell for each
+file individually by looking at the first line of each file. This wont
+work however, if the script starts as a bourne shell script and tries
+to be clever about starting the shell it really wants.
+.b
+Currently supported shells are:
+.RS
+.IP \fBsh\fP
+Bourne Shell
+.IP \fBperl\fP
+Perl (versions 4 and 5)
+.IP \fBksh\fP
+Korn Shell
+.IP \fBtclsh\fP
+The TCL shell
+.IP \fBwish\fP
+The TK Windowing shell (same as tclsh)
+.RE
+
+.IP \fB-v\fP
+Include variable definitions (variables mentioned at the start of a line)
+.IP \fB-V\fP
+Print version information.
+.IP \fB-w\fP
+Suppress "duplicate tag" warning messages.
+.IP \fB-x\fP
+Explicitly create a new tags file. Normally new tags are merged with
+the old tags file.
+.PP
+\fBshtags\fP scans the specified files for subroutines and possibly
+variable definitions, and creates a \fBvi\fP style tags file.
+.SH FILES
+.IP \fBtags\fP
+A tags file contains a sorted list of tags, one tag per line. The
+format is the same as that used by \fBvi\fP(1)
+.SH AUTHOR
+Stephen Riehm
+.br
+sr@pc-plus.de
+.SH "SEE ALSO"
+ctags(1), etags(1), perl(1), tclsh(1), wish(1), sh(1), ksh(1).
diff --git a/runtime/tools/shtags.pl b/runtime/tools/shtags.pl
new file mode 100755
index 000000000..48dcdc747
--- /dev/null
+++ b/runtime/tools/shtags.pl
@@ -0,0 +1,144 @@
+#!/usr/bin/env perl
+#
+# shtags: create a tags file for perl scripts
+#
+# Author: Stephen Riehm
+# Last Changed: 96/11/27 19:46:06
+#
+# "@(#) shtags 1.1 by S. Riehm"
+#
+
+# obvious... :-)
+sub usage
+ {
+ print <<_EOUSAGE_ ;
+USAGE: $program [-kvwVx] [-t <file>] <files>
+ -t <file> Name of tags file to create. (default is 'tags')
+ -s <shell> Name of the shell language in the script
+ -v Include variable definitions.
+ (variables mentioned at the start of a line)
+ -V Print version information.
+ -w Suppress "duplicate tag" warnings.
+ -x Explicitly create a new tags file. Normally tags are merged.
+ <files> List of files to scan for tags.
+_EOUSAGE_
+ exit 0
+ }
+
+sub version
+{
+ #
+ # Version information
+ #
+ @id = split( ', ', 'scripts/bin/shtags, /usr/local/, LOCAL_SCRIPTS, 1.1, 96/11/27, 19:46:06' );
+ $id[0] =~ s,.*/,,;
+ print <<_EOVERS;
+$id[0]: $id[3]
+Last Modified: @id[4,5]
+Component: $id[1]
+Release: $id[2]
+_EOVERS
+ exit( 1 );
+}
+
+#
+# initialisations
+#
+($program = $0) =~ s,.*/,,;
+require 'getopts.pl';
+
+#
+# parse command line
+#
+&Getopts( "t:s:vVwx" ) || &usage();
+$tags_file = $opt_t || 'tags';
+$explicit = $opt_x;
+$variable_tags = $opt_v;
+$allow_warnings = ! $opt_w;
+&version if $opt_V;
+&usage() unless @ARGV != 0;
+
+# slurp up the existing tags. Some will be replaced, the ones that aren't
+# will be re-written exactly as they were read
+if( ! $explicit && open( TAGS, "< $tags_file" ) )
+ {
+ while( <TAGS> )
+ {
+ /^\S+/;
+ $tags{$&} = $_;
+ }
+ close( TAGS );
+ }
+
+#
+# for each line of every file listed on the command line, look for a
+# 'sub' definition, or, if variables are wanted aswell, look for a
+# variable definition at the start of a line
+#
+while( <> )
+ {
+ &check_shell($_), ( $old_file = $ARGV ) if $ARGV ne $old_file;
+ next unless $shell;
+ if( $shell eq "sh" )
+ {
+ next unless /^\s*(((\w+)))\s*\(\s*\)/
+ || ( $variable_tags && /^(((\w+)=))/ );
+ $match = $3;
+ }
+ if( $shell eq "ksh" )
+ {
+ # ksh
+ next unless /^\s*function\s+(((\w+)))/
+ || ( $variable_tags && /^(((\w+)=))/ );
+ $match = $3;
+ }
+ if( $shell eq "perl" )
+ {
+ # perl
+ next unless /^\s*sub\s+(\w+('|::))?(\w+)/
+ || /^\s*(((\w+))):/
+ || ( $variable_tags && /^(([(\s]*[\$\@\%]{1}(\w+).*=))/ );
+ $match = $3;
+ }
+ if( $shell eq "tcl" )
+ {
+ next unless /^\s*proc\s+(((\S+)))/
+ || ( $variable_tags && /^\s*set\s+(((\w+)\s))/ );
+ $match = $3;
+ }
+ chop;
+ warn "$match - duplicate ignored\n"
+ if ( $new{$match}++
+ || !( $tags{$match} = sprintf( "%s\t%s\t?^%s\$?\n", $match, $ARGV, $_ ) ) )
+ && $allow_warnings;
+ }
+
+# write the new tags to the tags file - note that the whole file is rewritten
+open( TAGS, "> $tags_file" );
+foreach( sort( keys %tags ) )
+ {
+ print TAGS "$tags{$_}";
+ }
+close( TAGS );
+
+sub check_shell
+ {
+ local( $_ ) = @_;
+ # read the first line of a script, and work out which shell it is,
+ # unless a shell was specified on the command line
+ #
+ # This routine can't handle clever scripts which start sh and then
+ # use sh to start the shell they really wanted.
+ if( $opt_s )
+ {
+ $shell = $opt_s;
+ }
+ else
+ {
+ $shell = "sh" if /^:$/ || /^#!.*\/bin\/sh/;
+ $shell = "ksh" if /^#!.*\/ksh/;
+ $shell = "perl" if /^#!.*\/perl/;
+ $shell = "tcl" if /^#!.*\/wish/;
+ printf "Using $shell for $ARGV\n";
+ }
+ }
diff --git a/runtime/tools/tcltags b/runtime/tools/tcltags
new file mode 100755
index 000000000..952415279
--- /dev/null
+++ b/runtime/tools/tcltags
@@ -0,0 +1,159 @@
+#!/bin/sh
+# vim:ts=4:
+# Generates a tag file for TCL code. Slow, but gets the job done.
+#
+# Written by Darren Hiebert <darren@hiebert.com>
+
+program_name=`basename $0`
+program_version="0.3"
+program_author="Darren Hiebert"
+author_email="darren@hiebert.com"
+tmp_tagfile=/tmp/${program_name}.$$
+
+usage="\
+Usage: $program_name [-au] [-{f|o} tagfile] [--format=n] file(s)
+ -a append to current tag file
+ -f tagfile specify output tag file name (default=tags)
+ -o alternative for -f
+ -u unsorted
+ --format=n specify tag file format (default=2)
+ --help print this help message
+"
+
+# defaults
+#
+append=0
+format=2
+sorted=1
+tagfile=tags
+filelist=
+
+# read options
+#
+getparam()
+{
+ if [ -n "$1" ]; then
+ # set variable to word passed in
+ echo "$2='$1'; opt="
+ else
+ # set variable to next word on command line
+ echo "$2="'$1'"; shift"
+ fi
+}
+
+finished=0
+while [ $# -gt 0 -a $finished -eq 0 ]
+do
+ case "$1" in
+ --*)
+ opt=`echo "$1" | cut -c 3-`
+ shift
+ opt_name=`echo "$opt" | awk -F= '{print $1}'`
+ opt_value=`echo "$opt" | awk -F= '{print $2}'`
+ case "$opt_name" in
+ format) case "$opt_value" in
+ 1|2) format=$opt_value;;
+ *) echo "--$opt: unsupported value" >&2; exit 1;;
+ esac
+ ;;
+ help) echo "$usage"; exit 0;;
+ *) echo "$opt_name: unsupported option" >&2; exit 1;;
+ esac
+ ;;
+ -*)
+ # chop off leading '-'
+ opt=`echo "$1" | cut -c 2-`
+ shift
+ while [ -n "$opt" ]
+ do
+ opt_char=`echo "$opt" | cut -c 1`
+ opt=`echo "$opt" | cut -c 2-`
+ case "$opt_char" in
+ a) append=1;;
+ u) sorted=0;;
+ o|f) eval `getparam "$opt" tagfile`;;
+ *) echo "$opt: unsupported option" >&2; exit 1;;
+ esac
+ done
+ ;;
+ *) filelist="$*"; break;;
+ esac
+done
+
+if [ -z "$filelist" ] ;then
+ echo "$usage" >&2; exit 1
+fi
+
+# awk program for generating tags
+#
+ext_flags=""
+ttype=""
+if [ $format -eq 2 ] ;then
+ ext_flags=';\" %s'
+ ttype=", type"
+fi
+awkprg='
+function trim_comment(string) {
+ comment = index(string, "#")
+ if (comment != 0)
+ string = substr(string, 0, comment-1)
+ return string
+}
+function maketag(tagname, pattern, type, line_end) {
+ gsub(/\\/, "\\\\", pattern)
+ gsub(/\//, "\\/", pattern)
+ if (line_end)
+ terminator="$"
+ else
+ terminator=""
+ printf("%s\t%s\t/^%s%s/'"$ext_flags"'\n", \
+ tagname, FILENAME, pattern, terminator'"$ttype"')
+}
+$1 == "proc" && $3 ~ /^{/ {
+ pattern = substr($0, 0, index($0, "{"))
+ maketag($2, pattern, "f", 0)
+}
+/^set[ \t]/ && $2 !~ /\(/ {
+ pattern = substr($0, 0, index($0, $2) + length($2))
+ maketag($2, pattern, "v", 0)
+}
+/^array[ \t]*set[ \t]/ && $3 !~ /\(/ {
+ pattern = substr($0, 0, index($0, $3) + length($3))
+ maketag($3, pattern, "v", 0)
+}'
+
+# add or correct the pseudo tags
+#
+if [ "$tagfile" != "-" ] ;then
+ if [ $append -eq 1 ]; then
+ # ensure existing sort flag is correct
+ sed -e "/^!_TAG_FILE_SORTED/s/ [01] / $sorted /" \
+ -e "/^!_TAG_FILE_FORMAT/s/ 1 / $format /" \
+ $tagfile > $tmp_tagfile
+ else
+ echo -ne "\
+!_TAG_FILE_FORMAT $format /extended format; --format=1 will not append ;\" to lines/
+!_TAG_FILE_SORTED $sorted /0=unsorted, 1=sorted/
+!_TAG_PROGRAM_AUTHOR $program_author /$author_email/
+!_TAG_PROGRAM_NAME $program_name //
+!_TAG_PROGRAM_VERSION $program_version //
+" > $tmp_tagfile
+ fi
+fi
+
+# generate tags
+#
+awk "$awkprg" $filelist >> $tmp_tagfile
+
+if [ $sorted -eq 1 ] ;then
+ sort -u -o $tmp_tagfile $tmp_tagfile
+fi
+
+if [ "$tagfile" = '-' ] ;then
+ cat $tmp_tagfile
+else
+ cp $tmp_tagfile $tagfile
+fi
+rm $tmp_tagfile
+
+exit 0
diff --git a/runtime/tools/vim132 b/runtime/tools/vim132
new file mode 100755
index 000000000..29ea4ce1f
--- /dev/null
+++ b/runtime/tools/vim132
@@ -0,0 +1,13 @@
+#!/bin/csh
+#
+# Shell script for use with UNIX
+# Starts up Vim with the terminal in 132 column mode
+# Only works on VT-100 terminals and lookalikes
+# You need to have a termcap entry "vt100-w". Same as vt100 but 132 columns.
+#
+set oldterm=$term
+echo "[?3h"
+setenv TERM vt100-w
+vim $*
+set term=$oldterm
+echo "[?3l"
diff --git a/runtime/tools/vim_vs_net.cmd b/runtime/tools/vim_vs_net.cmd
new file mode 100644
index 000000000..6307d95a5
--- /dev/null
+++ b/runtime/tools/vim_vs_net.cmd
@@ -0,0 +1,24 @@
+@rem
+@rem To use this with Visual Studio .Net
+@rem Tools->External Tools...
+@rem Add
+@rem Title - Vim
+@rem Command - d:\files\util\vim_vs_net.cmd
+@rem Arguments - +$(CurLine) $(ItemPath)
+@rem Init Dir - Empty
+@rem
+@rem Coutesy of Brian Sturk
+@rem
+@rem --remote-silent +%1 is a command +954, move ahead 954 lines
+@rem --remote-silent %2 full path to file
+@rem In Vim
+@rem :h --remote-silent for mor details
+@rem
+@rem --servername VS_NET
+@rem This will create a new instance of vim called VS_NET. So if you
+open
+@rem multiple files from VS, they will use the same instance of Vim.
+@rem This allows you to have multiple copies of Vim running, but you can
+@rem control which one has VS files in it.
+@rem
+start /b gvim.exe --servername VS_NET --remote-silent "%1" "%2"
diff --git a/runtime/tools/vimm b/runtime/tools/vimm
new file mode 100755
index 000000000..042c4a022
--- /dev/null
+++ b/runtime/tools/vimm
@@ -0,0 +1,6 @@
+#!/bin/sh
+# enable DEC locator input model on remote terminal
+echo "\033[1;2'z\033[1;3'{\c"
+vim "$@"
+# disable DEC locator input model on remote terminal
+echo "\033[2;4'{\033[0'z\c"
diff --git a/runtime/tools/vimspell.sh b/runtime/tools/vimspell.sh
new file mode 100755
index 000000000..42072222c
--- /dev/null
+++ b/runtime/tools/vimspell.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Spell a file & generate the syntax statements necessary to
+# highlight in vim. Based on a program from Krishna Gadepalli
+# <krishna@stdavids.picker.com>.
+#
+# I use the following mappings (in .vimrc):
+#
+# noremap <F8> :so `vimspell.sh %`<CR><CR>
+# noremap <F7> :syntax clear SpellErrors<CR>
+#
+# Neil Schemenauer <nascheme@ucalgary.ca>
+# March 1999
+
+INFILE=$1
+OUTFILE=/tmp/vimspell.$$
+# if you have "tempfile", use the following line
+#OUTFILE=`tempfile`
+
+#
+# local spellings
+#
+LOCAL_DICT=${LOCAL_DICT-$HOME/local/lib/local_dict}
+
+if [ -f $LOCAL_DICT ]
+then
+ SPELL_ARGS="+$LOCAL_DICT"
+fi
+
+spell $SPELL_ARGS $INFILE | sort -u |
+awk '
+ {
+ printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ;
+ }
+
+END {
+ printf "highlight link SpellErrors ErrorMsg\n\n" ;
+ }
+' > $OUTFILE
+echo "!rm $OUTFILE" >> $OUTFILE
+echo $OUTFILE
diff --git a/runtime/tools/vimspell.txt b/runtime/tools/vimspell.txt
new file mode 100644
index 000000000..2842af7bd
--- /dev/null
+++ b/runtime/tools/vimspell.txt
@@ -0,0 +1,22 @@
+vimspell.sh
+===========
+
+This is a simple script to spell check a file and generate the syntax
+statements necessary to highlight the errors in vim. It is based on a
+similar program by Krishna Gadepalli <krishna@stdavids.picker.com>.
+
+To use this script, first place it in a directory in your path. Next,
+you should add some convenient key mappings. I use the following (in
+.vimrc):
+
+ noremap <F8> :so `vimspell.sh %`<CR><CR>
+ noremap <F7> :syntax clear SpellErrors<CR>
+
+This program requires the old Unix "spell" command. On my Debian
+system, "spell" is a wrapper around "ispell". For better security,
+you should uncomment the line in the script that uses "tempfile" to
+create a temporary file. As all systems don't have "tempfile" the
+insecure "pid method" is used.
+
+
+ Neil Schemenauer <nascheme@ucalgary.ca>
diff --git a/runtime/tools/xcmdsrv_client.c b/runtime/tools/xcmdsrv_client.c
new file mode 100644
index 000000000..a0e6211a1
--- /dev/null
+++ b/runtime/tools/xcmdsrv_client.c
@@ -0,0 +1,584 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * X-Windows communication by Flemming Madsen
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ *
+ * Client for sending commands to an '+xcmdsrv' enabled vim.
+ * This is mostly a de-Vimified version of if_xcmdsrv.c in vim.
+ * See that file for a protocol specification.
+ *
+ * You can make a test program with a Makefile like:
+ * xcmdsrv_client: xcmdsrv_client.c
+ * cc -o $@ -g -DMAIN -I/usr/X11R6/include -L/usr/X11R6/lib $< -lX11
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#ifdef HAVE_SELECT
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+#else
+#include <sys/poll.h>
+#endif
+#include <X11/Intrinsic.h>
+#include <X11/Xatom.h>
+
+#define __ARGS(x) x
+
+/* Client API */
+char * sendToVim __ARGS((Display *dpy, char *name, char *cmd, int asKeys, int *code));
+
+#ifdef MAIN
+/* A sample program */
+main(int argc, char **argv)
+{
+ char *res;
+ int code;
+
+ if (argc == 4)
+ {
+ if ((res = sendToVim(XOpenDisplay(NULL), argv[2], argv[3],
+ argv[1][0] != 'e', &code)) != NULL)
+ {
+ if (code)
+ printf("Error code returned: %d\n", code);
+ puts(res);
+ }
+ exit(0);
+ }
+ else
+ fprintf(stderr, "Usage: %s {k|e} <server> <command>", argv[0]);
+
+ exit(1);
+}
+#endif
+
+/*
+ * Maximum size property that can be read at one time by
+ * this module:
+ */
+
+#define MAX_PROP_WORDS 100000
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event));
+static int AppendPropCarefully __ARGS((Display *display,
+ Window window, Atom property, char *value, int length));
+static Window LookupName __ARGS((Display *dpy, char *name,
+ int delete, char **loose));
+static int SendInit __ARGS((Display *dpy));
+static char *SendEventProc __ARGS((Display *dpy, XEvent *eventPtr,
+ int expect, int *code));
+static int IsSerialName __ARGS((char *name));
+
+/* Private variables */
+static Atom registryProperty = None;
+static Atom commProperty = None;
+static Window commWindow = None;
+static int got_x_error = FALSE;
+
+
+/*
+ * sendToVim --
+ * Send to an instance of Vim via the X display.
+ *
+ * Results:
+ * A string with the result or NULL. Caller must free if non-NULL
+ */
+
+ char *
+sendToVim(dpy, name, cmd, asKeys, code)
+ Display *dpy; /* Where to send. */
+ char *name; /* Where to send. */
+ char *cmd; /* What to send. */
+ int asKeys; /* Interpret as keystrokes or expr ? */
+ int *code; /* Return code. 0 => OK */
+{
+ Window w;
+ Atom *plist;
+ XErrorHandler old_handler;
+#define STATIC_SPACE 500
+ char *property, staticSpace[STATIC_SPACE];
+ int length;
+ int res;
+ static int serial = 0; /* Running count of sent commands.
+ * Used to give each command a
+ * different serial number. */
+ XEvent event;
+ XPropertyEvent *e = (XPropertyEvent *)&event;
+ time_t start;
+ char *result;
+ char *loosename = NULL;
+
+ if (commProperty == None && dpy != NULL)
+ {
+ if (SendInit(dpy) < 0)
+ return NULL;
+ }
+
+ /*
+ * Bind the server name to a communication window.
+ *
+ * Find any survivor with a serialno attached to the name if the
+ * original registrant of the wanted name is no longer present.
+ *
+ * Delete any lingering names from dead editors.
+ */
+
+ old_handler = XSetErrorHandler(x_error_check);
+ while (TRUE)
+ {
+ got_x_error = FALSE;
+ w = LookupName(dpy, name, 0, &loosename);
+ /* Check that the window is hot */
+ if (w != None)
+ {
+ plist = XListProperties(dpy, w, &res);
+ XSync(dpy, False);
+ if (plist != NULL)
+ XFree(plist);
+ if (got_x_error)
+ {
+ LookupName(dpy, loosename ? loosename : name,
+ /*DELETE=*/TRUE, NULL);
+ continue;
+ }
+ }
+ break;
+ }
+ if (w == None)
+ {
+ fprintf(stderr, "no registered server named %s\n", name);
+ return NULL;
+ }
+ else if (loosename != NULL)
+ name = loosename;
+
+ /*
+ * Send the command to target interpreter by appending it to the
+ * comm window in the communication window.
+ */
+
+ length = strlen(name) + strlen(cmd) + 10;
+ if (length <= STATIC_SPACE)
+ property = staticSpace;
+ else
+ property = (char *) malloc((unsigned) length);
+
+ serial++;
+ sprintf(property, "%c%c%c-n %s%c-s %s",
+ 0, asKeys ? 'k' : 'c', 0, name, 0, cmd);
+ if (name == loosename)
+ free(loosename);
+ if (!asKeys)
+ {
+ /* Add a back reference to our comm window */
+ sprintf(property + length, "%c-r %x %d", 0, (uint) commWindow, serial);
+ length += strlen(property + length + 1) + 1;
+ }
+
+ res = AppendPropCarefully(dpy, w, commProperty, property, length + 1);
+ if (length > STATIC_SPACE)
+ free(property);
+ if (res < 0)
+ {
+ fprintf(stderr, "Failed to send command to the destination program\n");
+ return NULL;
+ }
+
+ if (asKeys) /* There is no answer for this - Keys are sent async */
+ return NULL;
+
+
+ /*
+ * Enter a loop processing X events & pooling chars until we see the result
+ */
+
+#define SEND_MSEC_POLL 50
+
+ time(&start);
+ while ((time((time_t *) 0) - start) < 60)
+ {
+ /* Look out for the answer */
+#ifndef HAVE_SELECT
+ struct pollfd fds;
+
+ fds.fd = ConnectionNumber(dpy);
+ fds.events = POLLIN;
+ if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
+ break;
+#else
+ fd_set fds;
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = SEND_MSEC_POLL * 1000;
+ FD_ZERO(&fds);
+ FD_SET(ConnectionNumber(dpy), &fds);
+ if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0)
+ break;
+#endif
+ while (XEventsQueued(dpy, QueuedAfterReading) > 0)
+ {
+ XNextEvent(dpy, &event);
+ if (event.type == PropertyNotify && e->window == commWindow)
+ if ((result = SendEventProc(dpy, &event, serial, code)) != NULL)
+ return result;
+ }
+ }
+ return NULL;
+}
+
+
+/*
+ * SendInit --
+ * This procedure is called to initialize the
+ * communication channels for sending commands and
+ * receiving results.
+ */
+
+ static int
+SendInit(dpy)
+ Display *dpy;
+{
+ XErrorHandler old_handler;
+
+ /*
+ * Create the window used for communication, and set up an
+ * event handler for it.
+ */
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+
+ commProperty = XInternAtom(dpy, "Comm", False);
+ /* Change this back to "InterpRegistry" to talk to tk processes */
+ registryProperty = XInternAtom(dpy, "VimRegistry", False);
+
+ if (commWindow == None)
+ {
+ commWindow =
+ XCreateSimpleWindow(dpy, XDefaultRootWindow(dpy),
+ getpid(), 0, 10, 10, 0,
+ WhitePixel(dpy, DefaultScreen(dpy)),
+ WhitePixel(dpy, DefaultScreen(dpy)));
+ XSelectInput(dpy, commWindow, PropertyChangeMask);
+ }
+
+ XSync(dpy, False);
+ (void) XSetErrorHandler(old_handler);
+
+ return got_x_error ? -1 : 0;
+}
+
+/*
+ * LookupName --
+ * Given an interpreter name, see if the name exists in
+ * the interpreter registry for a particular display.
+ *
+ * Results:
+ * If the given name is registered, return the ID of
+ * the window associated with the name. If the name
+ * isn't registered, then return 0.
+ */
+
+ static Window
+LookupName(dpy, name, delete, loose)
+ Display *dpy; /* Display whose registry to check. */
+ char *name; /* Name of an interpreter. */
+ int delete; /* If non-zero, delete info about name. */
+ char **loose; /* Do another search matching -999 if not found
+ Return result here if a match is found */
+{
+ unsigned char *regProp, *entry;
+ unsigned char *p;
+ int result, actualFormat;
+ unsigned long numItems, bytesAfter;
+ Atom actualType;
+ Window returnValue;
+
+ /*
+ * Read the registry property.
+ */
+
+ regProp = NULL;
+ result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0,
+ MAX_PROP_WORDS, False, XA_STRING, &actualType,
+ &actualFormat, &numItems, &bytesAfter,
+ &regProp);
+
+ if (actualType == None)
+ return 0;
+
+ /*
+ * If the property is improperly formed, then delete it.
+ */
+
+ if ((result != Success) || (actualFormat != 8) || (actualType != XA_STRING))
+ {
+ if (regProp != NULL)
+ XFree(regProp);
+ XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
+ return 0;
+ }
+
+ /*
+ * Scan the property for the desired name.
+ */
+
+ returnValue = None;
+ entry = NULL; /* Not needed, but eliminates compiler warning. */
+ for (p = regProp; (p - regProp) < numItems; )
+ {
+ entry = p;
+ while ((*p != 0) && (!isspace(*p)))
+ p++;
+ if ((*p != 0) && (strcasecmp(name, p + 1) == 0))
+ {
+ sscanf(entry, "%x", (uint*) &returnValue);
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (loose != NULL && returnValue == None && !IsSerialName(name))
+ {
+ for (p = regProp; (p - regProp) < numItems; )
+ {
+ entry = p;
+ while ((*p != 0) && (!isspace(*p)))
+ p++;
+ if ((*p != 0) && IsSerialName(p + 1)
+ && (strncmp(name, p + 1, strlen(name)) == 0))
+ {
+ sscanf(entry, "%x", (uint*) &returnValue);
+ *loose = strdup(p + 1);
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+ }
+
+ /*
+ * Delete the property, if that is desired (copy down the
+ * remainder of the registry property to overlay the deleted
+ * info, then rewrite the property).
+ */
+
+ if ((delete) && (returnValue != None))
+ {
+ int count;
+
+ while (*p != 0)
+ p++;
+ p++;
+ count = numItems - (p-regProp);
+ if (count > 0)
+ memcpy(entry, p, count);
+ XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING,
+ 8, PropModeReplace, regProp,
+ (int) (numItems - (p-entry)));
+ XSync(dpy, False);
+ }
+
+ XFree(regProp);
+ return returnValue;
+}
+
+ static char *
+SendEventProc(dpy, eventPtr, expected, code)
+ Display *dpy;
+ XEvent *eventPtr; /* Information about event. */
+ int expected; /* The one were waiting for */
+ int *code; /* Return code. 0 => OK */
+{
+ unsigned char *propInfo;
+ unsigned char *p;
+ int result, actualFormat;
+ int retCode;
+ unsigned long numItems, bytesAfter;
+ Atom actualType;
+
+ if ((eventPtr->xproperty.atom != commProperty)
+ || (eventPtr->xproperty.state != PropertyNewValue))
+ {
+ return;
+ }
+
+ /*
+ * Read the comm property and delete it.
+ */
+
+ propInfo = NULL;
+ result = XGetWindowProperty(dpy, commWindow, commProperty, 0,
+ MAX_PROP_WORDS, True, XA_STRING, &actualType,
+ &actualFormat, &numItems, &bytesAfter,
+ &propInfo);
+
+ /*
+ * If the property doesn't exist or is improperly formed
+ * then ignore it.
+ */
+
+ if ((result != Success) || (actualType != XA_STRING)
+ || (actualFormat != 8))
+ {
+ if (propInfo != NULL)
+ {
+ XFree(propInfo);
+ }
+ return;
+ }
+
+ /*
+ * Several commands and results could arrive in the property at
+ * one time; each iteration through the outer loop handles a
+ * single command or result.
+ */
+
+ for (p = propInfo; (p - propInfo) < numItems; )
+ {
+ /*
+ * Ignore leading NULs; each command or result starts with a
+ * NUL so that no matter how badly formed a preceding command
+ * is, we'll be able to tell that a new command/result is
+ * starting.
+ */
+
+ if (*p == 0)
+ {
+ p++;
+ continue;
+ }
+
+ if ((*p == 'r') && (p[1] == 0))
+ {
+ int serial, gotSerial;
+ char *res;
+
+ /*
+ * This is a reply to some command that we sent out. Iterate
+ * over all of its options. Stop when we reach the end of the
+ * property or something that doesn't look like an option.
+ */
+
+ p += 2;
+ gotSerial = 0;
+ res = "";
+ retCode = 0;
+ while (((p-propInfo) < numItems) && (*p == '-'))
+ {
+ switch (p[1])
+ {
+ case 'r':
+ if (p[2] == ' ')
+ res = p + 3;
+ break;
+ case 's':
+ if (sscanf(p + 2, " %d", &serial) == 1)
+ gotSerial = 1;
+ break;
+ case 'c':
+ if (sscanf(p + 2, " %d", &retCode) != 1)
+ retCode = 0;
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (!gotSerial)
+ continue;
+
+ if (code != NULL)
+ *code = retCode;
+ return serial == expected ? strdup(res) : NULL;
+ }
+ else
+ {
+ /*
+ * Didn't recognize this thing. Just skip through the next
+ * null character and try again.
+ * Also, throw away commands that we cant process anyway.
+ */
+
+ while (*p != 0)
+ p++;
+ p++;
+ }
+ }
+ XFree(propInfo);
+}
+
+/*
+ * AppendPropCarefully --
+ *
+ * Append a given property to a given window, but set up
+ * an X error handler so that if the append fails this
+ * procedure can return an error code rather than having
+ * Xlib panic.
+ *
+ * Return:
+ * 0 on OK - -1 on error
+ *--------------------------------------------------------------
+ */
+
+ static int
+AppendPropCarefully(dpy, window, property, value, length)
+ Display *dpy; /* Display on which to operate. */
+ Window window; /* Window whose property is to
+ * be modified. */
+ Atom property; /* Name of property. */
+ char *value; /* Characters to append to property. */
+ int length; /* How much to append */
+{
+ XErrorHandler old_handler;
+
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+ XChangeProperty(dpy, window, property, XA_STRING, 8,
+ PropModeAppend, value, length);
+ XSync(dpy, False);
+ (void) XSetErrorHandler(old_handler);
+ return got_x_error ? -1 : 0;
+}
+
+
+/*
+ * Another X Error handler, just used to check for errors.
+ */
+/* ARGSUSED */
+ static int
+x_error_check(dpy, error_event)
+ Display *dpy;
+ XErrorEvent *error_event;
+{
+ got_x_error = TRUE;
+ return 0;
+}
+
+/*
+ * Check if "str" looks like it had a serial number appended.
+ * Actually just checks if the name ends in a digit.
+ */
+ static int
+IsSerialName(str)
+ char *str;
+{
+ int len = strlen(str);
+
+ return (len > 1 && isdigit(str[len - 1]));
+}
diff --git a/runtime/tutor.info b/runtime/tutor.info
new file mode 100755
index 000000000..f8ceda364
--- /dev/null
+++ b/runtime/tutor.info
Binary files differ
diff --git a/runtime/tutor/Makefile b/runtime/tutor/Makefile
new file mode 100644
index 000000000..05a59615a
--- /dev/null
+++ b/runtime/tutor/Makefile
@@ -0,0 +1,15 @@
+# Makefile for the Vim tutor.
+#
+# The Japanese tutor exists in three encodings. Use the UTF-8 version as the
+# original and create the others with conversion.
+
+all: tutor.ja.sjis tutor.ja.euc tutor.ko.euc
+
+tutor.ja.sjis: tutor.ja.utf-8
+ nkf -WXs tutor.ja.utf-8 > tutor.ja.sjis
+
+tutor.ja.euc: tutor.ja.utf-8
+ nkf -WXe tutor.ja.utf-8 > tutor.ja.euc
+
+tutor.ko.euc: tutor.ko.utf-8
+ iconv -f UTF-8 -t EUC-KR tutor.ko.utf-8 > tutor.ko.euc
diff --git a/runtime/tutor/README.gr.cp737.txt b/runtime/tutor/README.gr.cp737.txt
new file mode 100644
index 000000000..426f929c6
--- /dev/null
+++ b/runtime/tutor/README.gr.cp737.txt
@@ -0,0 +1,24 @@
+’¦ Tutor œå¤˜  £å˜ "®œ ¨¦¤˜¡« ¡ã" §œ¨ ãšž©ž š ˜ ¤â¦¬ª ®¨ã©«œª «¦¬
+©¬¤«á¡«ž Vim.
+
+Ž  §œ¨ ©©æ«œ¨¦  ¤â¦  ®¨ã©«œª £§¦¨¦ç¤ ¤˜ «¦ «œ¢œ é©¦¬¤ ©œ ¢ šæ«œ¨¦ ˜§æ
+£å˜ 騘. ’¦ ˜§¦«â¢œ©£˜ œå¤˜  æ«  £§¦¨œå«œ ¤˜ ¡á¤œ«œ £å˜ ˜§¢ã œ¨š˜©å˜
+œ§œ¥œ¨š˜©å˜ª ¡œ £â¤¦¬ ®¨ž© £¦§¦ é¤«˜ª «¦¤ ©¬¤«á¡«ž Vim.
+
+’¦ Tutor œå¤˜  ⤘ ˜¨®œå¦ §¦¬ §œ¨ â®œ  «˜ £˜Ÿã£˜«˜ «žª §¨¦§˜¨˜©¡œ¬ãª.
+‹§¦¨œå«œ ¤˜ œ¡«œ¢â©œ«œ ˜§¢á "vim tutor" ¡˜  £œ«á ¤˜ ˜¡¦¢¦¬Ÿã©œ«œ « ª
+¦›žšåœª ©«˜ £˜Ÿã£˜«˜. ’˜ £˜Ÿã£˜«˜ Ÿ˜ ©˜ª §¦ç¤œ ¤˜ «¨¦§¦§¦ ã©œ«œ
+«¦ ˜¨®œå¦, œ§¦£â¤àª ‹†Œ ’Ž ‰€Œ„’„ ‘’Ž —’Ž’“Ž €Œ’ˆ‚€”Ž ‘€‘.
+
+‘œ ©ç©«ž£˜ Unix £§¦¨œå«œ œ§å©žª ¤˜ ®¨ž© £¦§¦ ã©œ«œ «¦ §¨æš¨˜££˜ "vimtutor".
+‡˜ ›ž£ ¦¬¨šã©œ  §¨é«˜ ⤘ §¨æ®œ ¨¦ ˜¤«åš¨˜­¦ «¦¬ tutor.
+
+ë®à ©¡œ­«œå ¤˜ §¨¦©Ÿâ©à §œ¨ ©©æ«œ¨˜ §¨¦®à¨ž£â¤˜ £˜Ÿã£˜«˜ ˜¢¢á ›œ¤ â®à ™¨œ 
+«¦¤ ˜§˜¨˜å«ž«¦ ®¨æ¤¦. „¤ž£œ¨é©«œ £œ §˜¨˜¡˜¢é §éª Ÿ˜ «¦ Ÿâ¢˜«œ ¡˜  ©«œå¢œ«œ
+£¦¬ ¦§¦ œ©›ã§¦«œ ™œ¢« é©œ ª ¡á¤œ«œ.
+
+Bob Ware, Colorado School of Mines, Golden, Co 80401, USA
+(303) 273-3987
+bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet
+
+[’¦ ˜¨®œå¦ ˜¬«æ «¨¦§¦§¦ ãŸž¡œ š ˜ «¦¤ Vim ˜§æ «¦¤ Bram Moolenaar]
diff --git a/runtime/tutor/README.gr.txt b/runtime/tutor/README.gr.txt
new file mode 100644
index 000000000..b2f5e0746
--- /dev/null
+++ b/runtime/tutor/README.gr.txt
@@ -0,0 +1,24 @@
+Ôï Tutor åßíáé ìßá "÷åéñïíáêôéêÞ" ðåñéÞãçóç ãéá íÝïõò ÷ñÞóôåò ôïõ
+óõíôÜêôç Vim.
+
+Ïé ðåñéóóüôåñïé íÝïé ÷ñÞóôåò ìðïñïýí íá ôï ôåëåéþóïõí óå ëéãüôåñï áðü
+ìßá þñá. Ôï áðïôÝëåóìá åßíáé üôé ìðïñåßôå íá êÜíåôå ìßá áðëÞ åñãáóßá
+åðåîåñãáóßáò êåéìÝíïõ ÷ñçóéìïðïéþíôáò ôïí óõíôÜêôç Vim.
+
+Ôï Tutor åßíáé Ýíá áñ÷åßï ðïõ ðåñéÝ÷åé ôá ìáèÞìáôá ôçò ðñïðáñáóêåõÞò.
+Ìðïñåßôå íá åêôåëÝóåôå áðëÜ "vim tutor" êáé ìåôÜ íá áêïëïõèÞóåôå ôéò
+ïäçãßåò óôá ìáèÞìáôá. Ôá ìáèÞìáôá èá óáò ðïýíå íá ôñïðïðïéÞóåôå
+ôï áñ÷åßï, åðïìÝíùò ÌÇÍ ÔÏ ÊÁÍÅÔÅ ÓÔÏ ÐÑÙÔÏÔÕÐÏ ÁÍÔÉÃÑÁÖÏ ÓÁÓ.
+
+Óå óýóôçìá Unix ìðïñåßôå åðßóçò íá ÷ñçóéìïðïéÞóåôå ôï ðñüãñáììá "vimtutor".
+Èá äçìéïõñãÞóåé ðñþôá Ýíá ðñü÷åéñï áíôßãñáöï ôïõ tutor.
+
+¸÷ù óêåöôåß íá ðñïóèÝóù ðåñéóóüôåñá ðñï÷ùñçìÝíá ìáèÞìáôá áëëÜ äåí Ý÷ù âñåé
+ôïí áðáñáßôçôï ÷ñüíï. Åíçìåñþóôå ìå ðáñáêáëþ ðþò èá ôï èÝëáôå êáé óôåßëåôå
+ìïõ ïðïéåóäÞðïôå âåëôéþóåéò êÜíåôå.
+
+Bob Ware, Colorado School of Mines, Golden, Co 80401, USA
+(303) 273-3987
+bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet
+
+[Ôï áñ÷åßï áõôü ôñïðïðïéÞèçêå ãéá ôïí Vim áðü ôïí Bram Moolenaar]
diff --git a/runtime/tutor/README.txt b/runtime/tutor/README.txt
new file mode 100644
index 000000000..77097c199
--- /dev/null
+++ b/runtime/tutor/README.txt
@@ -0,0 +1,22 @@
+Tutor is a "hands on" tutorial for new users of the Vim editor.
+
+Most new users can get through it in less than one hour. The result
+is that you can do a simple editing task using the Vim editor.
+
+Tutor is a file that contains the tutorial lessons. You can simply
+execute "vim tutor" and then follow the instructions in the lessons.
+The lessons tell you to modify the file, so DON'T DO THIS ON YOUR
+ORIGINAL COPY.
+
+On Unix you can also use the "vimtutor" program. It will make a
+scratch copy of the tutor first.
+
+I have considered adding more advanced lessons but have not found the
+time. Please let me know how you like it and send any improvements you
+make.
+
+Bob Ware, Colorado School of Mines, Golden, Co 80401, USA
+(303) 273-3987
+bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet
+
+[This file was modified for Vim by Bram Moolenaar]
diff --git a/runtime/tutor/README.txt.info b/runtime/tutor/README.txt.info
new file mode 100755
index 000000000..238b11fa9
--- /dev/null
+++ b/runtime/tutor/README.txt.info
Binary files differ
diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor
new file mode 100644
index 000000000..7da46f037
--- /dev/null
+++ b/runtime/tutor/tutor
@@ -0,0 +1,808 @@
+===============================================================================
+= W e l c o m e t o t h e V I M T u t o r - Version 1.5 =
+===============================================================================
+
+ Vim is a very powerful editor that has many commands, too many to
+ explain in a tutor such as this. This tutor is designed to describe
+ enough of the commands that you will be able to easily use Vim as
+ an all-purpose editor.
+
+ The approximate time required to complete the tutor is 25-30 minutes,
+ depending upon how much time is spent with experimentation.
+
+ The commands in the lessons will modify the text. Make a copy of this
+ file to practise on (if you started "vimtutor" this is already a copy).
+
+ It is important to remember that this tutor is set up to teach by
+ use. That means that you need to execute the commands to learn them
+ properly. If you only read the text, you will forget the commands!
+
+ Now, make sure that your Shift-Lock key is NOT depressed and press
+ the j key enough times to move the cursor so that Lesson 1.1
+ completely fills the screen.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.1: MOVING THE CURSOR
+
+
+ ** To move the cursor, press the h,j,k,l keys as indicated. **
+ ^
+ k Hint: The h key is at the left and moves left.
+ < h l > The l key is at the right and moves right.
+ j The j key looks like a down arrow
+ v
+ 1. Move the cursor around the screen until you are comfortable.
+
+ 2. Hold down the down key (j) until it repeats.
+---> Now you know how to move to the next lesson.
+
+ 3. Using the down key, move to Lesson 1.2.
+
+Note: If you are ever unsure about something you typed, press <ESC> to place
+ you in Normal mode. Then retype the command you wanted.
+
+Note: The cursor keys should also work. But using hjkl you will be able to
+ move around much faster, once you get used to it.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.2: ENTERING AND EXITING VIM
+
+
+ !! NOTE: Before executing any of the steps below, read this entire lesson!!
+
+ 1. Press the <ESC> key (to make sure you are in Normal mode).
+
+ 2. Type: :q! <ENTER>.
+
+---> This exits the editor WITHOUT saving any changes you have made.
+ If you want to save the changes and exit type:
+ :wq <ENTER>
+
+ 3. When you see the shell prompt, type the command that got you into this
+ tutor. That could be: vimtutor <ENTER>
+ Normally you would use: vim tutor <ENTER>
+
+---> 'vim' means enter the vim editor, 'tutor' is the file you wish to edit.
+
+ 4. If you have these steps memorized and are confident, execute steps
+ 1 through 3 to exit and re-enter the editor. Then move the cursor down
+ to Lesson 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.3: TEXT EDITING - DELETION
+
+
+** While in Normal mode press x to delete the character under the cursor. **
+
+ 1. Move the cursor to the line below marked --->.
+
+ 2. To fix the errors, move the cursor until it is on top of the
+ character to be deleted.
+
+ 3. Press the x key to delete the unwanted character.
+
+ 4. Repeat steps 2 through 4 until the sentence is correct.
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. Now that the line is correct, go on to Lesson 1.4.
+
+NOTE: As you go through this tutor, do not try to memorize, learn by usage.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.4: TEXT EDITING - INSERTION
+
+
+ ** While in Normal mode press i to insert text. **
+
+ 1. Move the cursor to the first line below marked --->.
+
+ 2. To make the first line the same as the second, move the cursor on top
+ of the first character AFTER where the text is to be inserted.
+
+ 3. Press i and type in the necessary additions.
+
+ 4. As each error is fixed press <ESC> to return to Normal mode.
+ Repeat steps 2 through 4 to correct the sentence.
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. When you are comfortable inserting text move to the summary below.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 1 SUMMARY
+
+
+ 1. The cursor is moved using either the arrow keys or the hjkl keys.
+ h (left) j (down) k (up) l (right)
+
+ 2. To enter Vim (from the % prompt) type: vim FILENAME <ENTER>
+
+ 3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
+ OR type: <ESC> :wq <ENTER> to save the changes.
+
+ 4. To delete a character under the cursor in Normal mode type: x
+
+ 5. To insert text at the cursor while in Normal mode type:
+ i type in text <ESC>
+
+NOTE: Pressing <ESC> will place you in Normal mode or will cancel
+ an unwanted and partially completed command.
+
+Now continue with Lesson 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.1: DELETION COMMANDS
+
+
+ ** Type dw to delete to the end of a word. **
+
+ 1. Press <ESC> to make sure you are in Normal mode.
+
+ 2. Move the cursor to the line below marked --->.
+
+ 3. Move the cursor to the beginning of a word that needs to be deleted.
+
+ 4. Type dw to make the word disappear.
+
+ NOTE: The letters dw will appear on the last line of the screen as you type
+ them. If you typed something wrong, press <ESC> and start over.
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.2: MORE DELETION COMMANDS
+
+
+ ** Type d$ to delete to the end of the line. **
+
+ 1. Press <ESC> to make sure you are in Normal mode.
+
+ 2. Move the cursor to the line below marked --->.
+
+ 3. Move the cursor to the end of the correct line (AFTER the first . ).
+
+ 4. Type d$ to delete to the end of the line.
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+
+ 5. Move on to Lesson 2.3 to understand what is happening.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: ON COMMANDS AND OBJECTS
+
+
+ The format for the d delete command is as follows:
+
+ [number] d object OR d [number] object
+ Where:
+ number - is how many times to execute the command (optional, default=1).
+ d - is the command to delete.
+ object - is what the command will operate on (listed below).
+
+ A short list of objects:
+ w - from the cursor to the end of the word, including the space.
+ e - from the cursor to the end of the word, NOT including the space.
+ $ - from the cursor to the end of the line.
+
+NOTE: For the adventurous, pressing just the object while in Normal mode
+ without a command will move the cursor as specified in the object list.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.4: AN EXCEPTION TO 'COMMAND-OBJECT'
+
+
+ ** Type dd to delete a whole line. **
+
+ Due to the frequency of whole line deletion, the designers of Vi decided
+ it would be easier to simply type two d's in a row to delete a line.
+
+ 1. Move the cursor to the second line in the phrase below.
+ 2. Type dd to delete the line.
+ 3. Now move to the fourth line.
+ 4. Type 2dd (remember number-command-object) to delete the two lines.
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.5: THE UNDO COMMAND
+
+
+ ** Press u to undo the last commands, U to fix a whole line. **
+
+ 1. Move the cursor to the line below marked ---> and place it on the
+ first error.
+ 2. Type x to delete the first unwanted character.
+ 3. Now type u to undo the last command executed.
+ 4. This time fix all the errors on the line using the x command.
+ 5. Now type a capital U to return the line to its original state.
+ 6. Now type u a few times to undo the U and preceding commands.
+ 7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times
+ to redo the commands (undo the undo's).
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. These are very useful commands. Now move on to the Lesson 2 Summary.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 2 SUMMARY
+
+
+ 1. To delete from the cursor to the end of a word type: dw
+
+ 2. To delete from the cursor to the end of a line type: d$
+
+ 3. To delete a whole line type: dd
+
+ 4. The format for a command in Normal mode is:
+
+ [number] command object OR command [number] object
+ where:
+ number - is how many times to repeat the command
+ command - is what to do, such as d for delete
+ object - is what the command should act upon, such as w (word),
+ $ (to the end of line), etc.
+
+ 5. To undo previous actions, type: u (lowercase u)
+ To undo all the changes on a line type: U (capital U)
+ To undo the undo's type: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.1: THE PUT COMMAND
+
+
+ ** Type p to put the last deletion after the cursor. **
+
+ 1. Move the cursor to the first line in the set below.
+
+ 2. Type dd to delete the line and store it in Vim's buffer.
+
+ 3. Move the cursor to the line ABOVE where the deleted line should go.
+
+ 4. While in Normal mode, type p to replace the line.
+
+ 5. Repeat steps 2 through 4 to put all the lines in correct order.
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.2: THE REPLACE COMMAND
+
+
+ ** Type r and a character to replace the character under the cursor. **
+
+ 1. Move the cursor to the first line below marked --->.
+
+ 2. Move the cursor so that it is on top of the first error.
+
+ 3. Type r and then the character which should replace the error.
+
+ 4. Repeat steps 2 and 3 until the first line is correct.
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. Now move on to Lesson 3.2.
+
+NOTE: Remember that you should be learning by use, not memorization.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.3: THE CHANGE COMMAND
+
+
+ ** To change part or all of a word, type cw . **
+
+ 1. Move the cursor to the first line below marked --->.
+
+ 2. Place the cursor on the u in lubw.
+
+ 3. Type cw and the correct word (in this case, type 'ine'.)
+
+ 4. Press <ESC> and move to the next error (the first character to be changed.)
+
+ 5. Repeat steps 3 and 4 until the first sentence is the same as the second.
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+Notice that cw not only replaces the word, but also places you in insert.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.4: MORE CHANGES USING c
+
+
+ ** The change command is used with the same objects as delete. **
+
+ 1. The change command works in the same way as delete. The format is:
+
+ [number] c object OR c [number] object
+
+ 2. The objects are also the same, such as w (word), $ (end of line), etc.
+
+ 3. Move to the first line below marked --->.
+
+ 4. Move the cursor to the first error.
+
+ 5. Type c$ to make the rest of the line like the second and press <ESC>.
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 3 SUMMARY
+
+
+ 1. To replace text that has already been deleted, type p . This Puts the
+ deleted text AFTER the cursor (if a line was deleted it will go on the
+ line below the cursor).
+
+ 2. To replace the character under the cursor, type r and then the
+ character which will replace the original.
+
+ 3. The change command allows you to change the specified object from the
+ cursor to the end of the object. eg. Type cw to change from the
+ cursor to the end of the word, c$ to change to the end of a line.
+
+ 4. The format for change is:
+
+ [number] c object OR c [number] object
+
+Now go on to the next lesson.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.1: LOCATION AND FILE STATUS
+
+
+ ** Type CTRL-g to show your location in the file and the file status.
+ Type SHIFT-G to move to a line in the file. **
+
+ Note: Read this entire lesson before executing any of the steps!!
+
+ 1. Hold down the Ctrl key and press g . A status line will appear at the
+ bottom of the page with the filename and the line you are on. Remember
+ the line number for Step 3.
+
+ 2. Press shift-G to move you to the bottom of the file.
+
+ 3. Type in the number of the line you were on and then shift-G. This will
+ return you to the line you were on when you first pressed Ctrl-g.
+ (When you type in the numbers, they will NOT be displayed on the screen.)
+
+ 4. If you feel confident to do this, execute steps 1 through 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.2: THE SEARCH COMMAND
+
+
+ ** Type / followed by a phrase to search for the phrase. **
+
+ 1. In Normal mode type the / character. Notice that it and the cursor
+ appear at the bottom of the screen as with the : command.
+
+ 2. Now type 'errroor' <ENTER>. This is the word you want to search for.
+
+ 3. To search for the same phrase again, simply type n .
+ To search for the same phrase in the opposite direction, type Shift-N .
+
+ 4. If you want to search for a phrase in the backwards direction, use the
+ command ? instead of /.
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+Note: When the search reaches the end of the file it will continue at the
+ start.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.3: MATCHING PARENTHESES SEARCH
+
+
+ ** Type % to find a matching ),], or } . **
+
+ 1. Place the cursor on any (, [, or { in the line below marked --->.
+
+ 2. Now type the % character.
+
+ 3. The cursor should be on the matching parenthesis or bracket.
+
+ 4. Type % to move the cursor back to the first bracket (by matching).
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+Note: This is very useful in debugging a program with unmatched parentheses!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.4: A WAY TO CHANGE ERRORS
+
+
+ ** Type :s/old/new/g to substitute 'new' for 'old'. **
+
+ 1. Move the cursor to the line below marked --->.
+
+ 2. Type :s/thee/the <ENTER> . Note that this command only changes the
+ first occurrence on the line.
+
+ 3. Now type :s/thee/the/g meaning substitute globally on the line.
+ This changes all occurrences on the line.
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. To change every occurrence of a character string between two lines,
+ type :#,#s/old/new/g where #,# are the numbers of the two lines.
+ Type :%s/old/new/g to change every occurrence in the whole file.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 4 SUMMARY
+
+
+ 1. Ctrl-g displays your location in the file and the file status.
+ Shift-G moves to the end of the file. A line number followed
+ by Shift-G moves to that line number.
+
+ 2. Typing / followed by a phrase searches FORWARD for the phrase.
+ Typing ? followed by a phrase searches BACKWARD for the phrase.
+ After a search type n to find the next occurrence in the same direction
+ or Shift-N to search in the opposite direction.
+
+ 3. Typing % while the cursor is on a (,),[,],{, or } locates its
+ matching pair.
+
+ 4. To substitute new for the first old on a line type :s/old/new
+ To substitute new for all 'old's on a line type :s/old/new/g
+ To substitute phrases between two line #'s type :#,#s/old/new/g
+ To substitute all occurrences in the file type :%s/old/new/g
+ To ask for confirmation each time add 'c' :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.1: HOW TO EXECUTE AN EXTERNAL COMMAND
+
+
+ ** Type :! followed by an external command to execute that command. **
+
+ 1. Type the familiar command : to set the cursor at the bottom of the
+ screen. This allows you to enter a command.
+
+ 2. Now type the ! (exclamation point) character. This allows you to
+ execute any external shell command.
+
+ 3. As an example type ls following the ! and then hit <ENTER>. This
+ will show you a listing of your directory, just as if you were at the
+ shell prompt. Or use :!dir if ls doesn't work.
+
+Note: It is possible to execute any external command this way.
+
+Note: All : commands must be finished by hitting <ENTER>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.2: MORE ON WRITING FILES
+
+
+ ** To save the changes made to the file, type :w FILENAME. **
+
+ 1. Type :!dir or :!ls to get a listing of your directory.
+ You already know you must hit <ENTER> after this.
+
+ 2. Choose a filename that does not exist yet, such as TEST.
+
+ 3. Now type: :w TEST (where TEST is the filename you chose.)
+
+ 4. This saves the whole file (Vim Tutor) under the name TEST.
+ To verify this, type :!dir again to see your directory
+
+Note: If you were to exit Vim and enter again with the filename TEST, the file
+ would be an exact copy of the tutor when you saved it.
+
+ 5. Now remove the file by typing (MS-DOS): :!del TEST
+ or (Unix): :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.3: A SELECTIVE WRITE COMMAND
+
+
+ ** To save part of the file, type :#,# w FILENAME **
+
+ 1. Once again, type :!dir or :!ls to obtain a listing of your directory
+ and choose a suitable filename such as TEST.
+
+ 2. Move the cursor to the top of this page and type Ctrl-g to find the
+ number of that line. REMEMBER THIS NUMBER!
+
+ 3. Now move to the bottom of the page and type Ctrl-g again. REMEMBER THIS
+ LINE NUMBER ALSO!
+
+ 4. To save ONLY a section to a file, type :#,# w TEST where #,# are
+ the two numbers you remembered (top,bottom) and TEST is your filename.
+
+ 5. Again, see that the file is there with :!dir but DO NOT remove it.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.4: RETRIEVING AND MERGING FILES
+
+
+ ** To insert the contents of a file, type :r FILENAME **
+
+ 1. Type :!dir to make sure your TEST filename is present from before.
+
+ 2. Place the cursor at the top of this page.
+
+NOTE: After executing Step 3 you will see Lesson 5.3. Then move DOWN to
+ this lesson again.
+
+ 3. Now retrieve your TEST file using the command :r TEST where TEST is
+ the name of the file.
+
+NOTE: The file you retrieve is placed starting where the cursor is located.
+
+ 4. To verify that a file was retrieved, cursor back and notice that there
+ are now two copies of Lesson 5.3, the original and the file version.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 5 SUMMARY
+
+
+ 1. :!command executes an external command.
+
+ Some useful examples are:
+ (MS-DOS) (Unix)
+ :!dir :!ls - shows a directory listing.
+ :!del FILENAME :!rm FILENAME - removes file FILENAME.
+
+ 2. :w FILENAME writes the current Vim file to disk with name FILENAME.
+
+ 3. :#,#w FILENAME saves the lines # through # in file FILENAME.
+
+ 4. :r FILENAME retrieves disk file FILENAME and inserts it into the
+ current file following the cursor position.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.1: THE OPEN COMMAND
+
+
+ ** Type o to open a line below the cursor and place you in Insert mode. **
+
+ 1. Move the cursor to the line below marked --->.
+
+ 2. Type o (lowercase) to open up a line BELOW the cursor and place you in
+ Insert mode.
+
+ 3. Now copy the line marked ---> and press <ESC> to exit Insert mode.
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. To open up a line ABOVE the cursor, simply type a capital O , rather
+ than a lowercase o. Try this on the line below.
+Open up a line above this by typing Shift-O while the cursor is on this line.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.2: THE APPEND COMMAND
+
+
+ ** Type a to insert text AFTER the cursor. **
+
+ 1. Move the cursor to the end of the first line below marked ---> by
+ typing $ in Normal mode.
+
+ 2. Type an a (lowercase) to append text AFTER the character under the
+ cursor. (Uppercase A appends to the end of the line.)
+
+Note: This avoids typing i , the last character, the text to insert, <ESC>,
+ cursor-right, and finally, x , just to append to the end of a line!
+
+ 3. Now complete the first line. Note also that append is exactly the same
+ as Insert mode, except for the location where text is inserted.
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.3: ANOTHER VERSION OF REPLACE
+
+
+ ** Type a capital R to replace more than one character. **
+
+ 1. Move the cursor to the first line below marked --->.
+
+ 2. Place the cursor at the beginning of the first word that is different
+ from the second line marked ---> (the word 'last').
+
+ 3. Now type R and replace the remainder of the text on the first line by
+ typing over the old text to make the first line the same as the second.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. Note that when you press <ESC> to exit, any unaltered text remains.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.4: SET OPTION
+
+ ** Set an option so a search or substitute ignores case **
+
+ 1. Search for 'ignore' by entering:
+ /ignore
+ Repeat several times by hitting the n key
+
+ 2. Set the 'ic' (Ignore case) option by typing:
+ :set ic
+
+ 3. Now search for 'ignore' again by entering: n
+ Repeat search several more times by hitting the n key
+
+ 4. Set the 'hlsearch' and 'incsearch' options:
+ :set hls is
+
+ 5. Now enter the search command again, and see what happens:
+ /ignore
+
+ 6. To remove the highlighting of matches, type:
+ :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 6 SUMMARY
+
+
+ 1. Typing o opens a line BELOW the cursor and places the cursor on the open
+ line in Insert mode.
+ Typing a capital O opens the line ABOVE the line the cursor is on.
+
+ 2. Type an a to insert text AFTER the character the cursor is on.
+ Typing a capital A automatically appends text to the end of the line.
+
+ 3. Typing a capital R enters Replace mode until <ESC> is pressed to exit.
+
+ 4. Typing ":set xxx" sets the option "xxx"
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 7: ON-LINE HELP COMMANDS
+
+
+ ** Use the on-line help system **
+
+ Vim has a comprehensive on-line help system. To get started, try one of
+ these three:
+ - press the <HELP> key (if you have one)
+ - press the <F1> key (if you have one)
+ - type :help <ENTER>
+
+ Type :q <ENTER> to close the help window.
+
+ You can find help on just about any subject, by giving an argument to the
+ ":help" command. Try these (don't forget pressing <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 8: CREATE A STARTUP SCRIPT
+
+ ** Switch on Vim features **
+
+ Vim has many more features than Vi, but most of them are disabled by default.
+ To start using more features you have to create a "vimrc" file.
+
+ 1. Start editing the "vimrc" file, this depends on your system:
+ :edit ~/.vimrc for Unix
+ :edit $VIM/_vimrc for MS-Windows
+
+ 2. Now read the example "vimrc" file text:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Write the file with:
+
+ :write
+
+ The next time you start Vim it will use syntax highlighting.
+ You can add all your preferred settings to this "vimrc" file.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ This concludes the Vim Tutor. It was intended to give a brief overview of
+ the Vim editor, just enough to allow you to use the editor fairly easily.
+ It is far from complete as Vim has many many more commands. Read the user
+ manual next: ":help user-manual".
+
+ For further reading and studying, this book is recommended:
+ Vim - Vi Improved - by Steve Oualline
+ Publisher: New Riders
+ The first book completely dedicated to Vim. Especially useful for beginners.
+ There are many examples and pictures.
+ See http://iccf-holland.org/click5.html
+
+ This book is older and more about Vi than Vim, but also recommended:
+ Learning the Vi Editor - by Linda Lamb
+ Publisher: O'Reilly & Associates Inc.
+ It is a good book to get to know almost anything you want to do with Vi.
+ The sixth edition also includes information on Vim.
+
+ This tutorial was written by Michael C. Pierce and Robert K. Ware,
+ Colorado School of Mines using ideas supplied by Charles Smith,
+ Colorado State University. E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ca b/runtime/tutor/tutor.ca
new file mode 100644
index 000000000..603a34756
--- /dev/null
+++ b/runtime/tutor/tutor.ca
@@ -0,0 +1,807 @@
+===============================================================================
+= B e n v i n g u t s a l t u t o r d e l V I M - Versió 1.5 =
+===============================================================================
+
+ El Vim és un editor molt potent que té moltes ordres, masses com per
+ explicar-les totes un tutor com aquest. Aquest tutor està dissenyat
+ per descriure les ordres bàsiques que us permetin fer servir el Vim com
+ a editor de propòsit general.
+
+ El temps aproximat de seguir el tutor complet és d'uns 25 o 30 minuts
+ depenent de quant temps dediqueu a experimentar.
+
+ Feu una còpia d'aquest fitxer per practicar-hi (si heu començat amb el
+ programa vimtutor això que esteu llegint ja és una còpia).
+
+ És important recordar que aquest tutor està pensat per ensenyar
+ practicant. És a dir, que haureu d'executar les ordres si les voleu
+ aprendre. Si només llegiu el text el més probable és que les oblideu.
+
+ Ara assegureu-vos que la tecla de bloqueig de majúscules no està
+ activada i premeu la tecla j per moure el cursor avall, fins que
+ la lliçó 1.1 ocupi completament la pantalla.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 1.1: MOURE EL CURSOR
+
+
+ ** Per moure el cursor premeu les tecles h,j,k,l tal com està indicat. **
+ ^
+ k Pista: La h és a l'esquerra i mou el cursor cap a l'esquerra.
+ < h l > La l és a la dreta i mou el cursor cap a la dreta.
+ j La j sembla una fletxa cap avall.
+ v
+ 1. Moveu el cursor per la pantalla fins que us sentiu confortables.
+
+ 2. Mantingueu premuda la tecla avall (j) una estona.
+---> Ara sabeu com moure-us fins a la pròxima lliçó.
+
+ 3. Usant la tecla avall, aneu a la lliçó 1.2.
+
+Nota: Si no esteu segurs de la tecla que heu premut, premeu <ESC> per tornar
+ al mode Normal. Llavors torneu a teclejar l'ordre que volíeu.
+
+Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però usant
+ hjkl anireu més ràpid, quan us hi hàgiu acostumant.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 1.2: ENTRAR I SORTIR DEL VIM
+
+
+ !! NOTA: Abans de seguir els passos següents llegiu *tota* la lliçó!!
+
+ 1. Premeu <ESC> (per estar segurs que esteu en el mode Normal).
+
+ 2. Teclegeu: :q! <ENTRAR>.
+
+---> Amb això sortireu de l'editor SENSE desar els canvis que hàgiu pogut
+ fer. Si voleu desar els canvis teclegeu:
+ :wq <ENTRAR>
+
+ 3. Quan vegeu l'introductor de la shell escriviu l'ordre amb la qual heu
+ arribat a aquest tutor. Podria ser: vimtutor <ENTRAR>
+ O bé: vim tutor <ENTRAR>
+
+---> 'vim' és l'editor vim, i 'tutor' és el fitxer que voleu editar.
+
+ 4. Si heu memoritzat les ordres, feu els passos anteriors, de l'1 al 3,
+ per sortir i tornar a entrar a l'editor. Llavors moveu el cursor avall
+ fins la lliçó 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 1.3: EDITAR TEXT - ESBORRAR
+
+
+ ** En mode Normal premeu x per esborrar el caràcter de sota el cursor. **
+
+ 1. Moveu el cursor fins la línia que hi ha més avall marcada amb --->.
+
+ 2. Poseu el cursor a sobre el caràcter que cal esborrar, per corregir els
+ errors.
+
+ 3. Premeu la tecla x per esborrar el caràcter.
+
+ 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta.
+
+---> Unna vaaca vva salttar sobbree la llluna.
+
+ 5. Ara que la línia és correcta, aneu a la lliçó 1.4.
+
+NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 1.4: EDITAR TEXT - INSERIR
+
+
+ ** En mode Normal premeu i per inserir text. **
+
+ 1. Moveu el cursor avall fins la primera línia marcada amb --->.
+
+ 2. Per fer la primera línia igual que la segona poseu el cursor sobre el
+ primer caràcter POSTERIOR al text que s'ha d'inserir.
+
+ 3. Premeu la tecla i i escriviu el text que falta.
+
+ 4. Quan hàgiu acabat premeu <ESC> per tornar al mode Normal. Repetiu
+ els passos 2, 3 i 4 per corregir la frase.
+
+---> Falten carctrs en aquesta .
+---> Falten alguns caràcters en aquesta línia.
+
+ 5. Quan us trobeu còmodes inserint text aneu al sumari de baix.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 1 SUMARI
+
+
+ 1. El cursor es mou amb les fletxes o bé amb les tecles hjkl.
+ h (esquerra) j (avall) k (amunt) l (dreta)
+
+ 2. Per entrar al Vim (des de la shell) escriviu: vim FITXER <ENTRAR>
+
+ 3. Per sortir teclegeu: <ESC> :q! <ENTRAR> per descartar els canvis.
+ O BÉ teclegeu: <ESC> :wq <ENTRAR> per desar els canvis.
+
+ 4. Per esborrar el caràcter de sota el cursor en el mode Normal premeu: x
+
+ 5. Per inserir text on hi ha el cursor, en mode Normal, premeu:
+ i escriviu el text <ESC>
+
+NOTA: La tecla <ESC> us portarà al mode Normal o cancel·larà una ordre
+ que estigui a mitges.
+
+Ara continueu amb la lliçó 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 2.1: ORDRES PER ESBORRAR
+
+
+ ** Teclegeu dw per esborrar fins al final d'una paraula. **
+
+ 1. Premeu <ESC> per estar segurs que esteu en mode normal.
+
+ 2. Moveu el cursor avall fins la línia marcada amb --->.
+
+ 3. Moveu el cursor fins el principi de la paraula que s'ha d'esborrar.
+
+ 4. Teclegeu dw per fer desaparèixer la paraula.
+
+NOTA: Les lletres dw apareixeran a la línia de baix de la pantalla mentre
+ les aneu escrivint. Si us equivoqueu premeu <ESC> i torneu a començar.
+
+---> Hi han algunes paraules divertit que no pertanyen paper a aquesta frase.
+
+ 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu a
+ la lliçó 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 2.2: MÉS ORDRES PER ESBORRAR
+
+
+ ** Escriviu d$ per esborrar fins al final de la línia. **
+
+ 1. Premeu <ESC> per estar segurs que esteu en el mode Normal.
+
+ 2. Moveu el cursor avall fins a la línia marcada amb --->.
+
+ 3. Moveu el cursor fins el final de la línia correcta
+ (DESPRÉS del primer . ).
+
+ 4. Teclegeu d$ per esborrar fins al final de la línia.
+
+---> Algú ha escrit el final d'aquesta línia dos cops. línia dos cops.
+
+ 5. Aneu a la lliçó 2.3 per entendre què està passant.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 2.3: SOBRE ORDRES I OBJECTES
+
+
+ El format de l'ordre d'esborrar d és el següent:
+
+ [nombre] d objecte O BÉ d [nombre] objecte
+ On:
+ nombre - és el nombre de cops que s'ha d'executar (opcional, omissió=1).
+ d - és l'ordre per esborrar.
+ objecte - és la cosa amb la qual operar (llista a baix).
+
+ Una petita llista d'objectes:
+ w - des del cursor fins al final de la paraula, incloent-hi l'espai.
+ e - des del cursor fins al final de la paraula, SENSE incloure l'espai.
+ $ - des del cursor fins al final de la línia.
+
+NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal,
+ sense cap ordre, el cursor es mourà tal com està especificat a la
+ llista d'objectes.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE'
+
+
+ ** Teclegeu dd esborrar tota la línia. **
+
+ Com que molt sovint s'han d'eliminar línies senceres els dissenyadors del
+ Vi van creure que seria més fàcil teclejar dd per esborrar tota la línia.
+
+ 1. Moveu el cursor a la segona línia de la frase de baix.
+ 2. Teclegeu dd per esborrar la línia.
+ 3. Ara aneu a la quarta línia.
+ 4. Teclegeu 2dd per esborrar dues línies (recordeu nombre-ordre-objecte).
+
+ 1) Les roses són vermelles,
+ 2) El fang és divertit,
+ 3) Les violetes són blaves,
+ 4) Tinc un cotxe,
+ 5) Els rellotges diuen l'hora,
+ 6) El sucre és dolç,
+ 7) Igual que tu.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 2.5: L'ORDRE DESFER
+
+
+ ** Premeu u per desfer els últims canvis, U per arreglar tota la línia. **
+
+ 1. Moveu el cursor sobre el primer error de línia de baix marcada amb --->
+ 2. Premeu x per esborrar el caràcter no desitjat.
+ 3. Ara premeu u per desfer l'última ordre executada.
+ 4. Aquest cop corregiu tots els errors de la línia amb l'ordre x.
+ 5. Ara premeu U per restablir la línia al seu estat original.
+ 6. Ara premeu u uns quants cops per desfer U i les ordres anteriors.
+ 7. Ara premeu CONTROL-R (les dues tecles al mateix temps) uns quants cops
+ per refer les ordres.
+
+---> Correegiu els errors d'aqquesta línia i dessfeu-los aamb desfer.
+
+ 8. Aquestes ordres són molt útils. Ara aneu al sumari de la lliçó 2.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 2 SUMARI
+
+
+ 1. Per esborrar del cursor al final de la paraula teclegeu: dw
+
+ 2. Per esborrar del cursor al final de la línia teclegeu: d$
+
+ 3. Per esborrar una línia sencera teclegeu: dd
+
+ 4. El format de qualsevol ordre del mode Normal és:
+
+ [nombre] ordre objecte O BÉ ordre [nombre] objecte
+ on:
+ nombre - és quants cops repetir l'ordre
+ ordre - és què fer, com ara d per esborrar
+ objecte - és amb què s'ha d'actuar, com ara w (paraula),
+ $ (fins a final de línia), etc.
+
+ 5. Per desfer les accions anteriors premeu: u
+ Per desfer tots el canvis en una línia premeu: U
+ Per desfer l'ordre desfer premeu: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 3.1: L'ORDRE 'POSAR'
+
+
+ ** Premeu p per posar l'última cosa que heu esborrat després del cursor. **
+
+
+ 1. Moveu el cursor a la primera línia de llista de baix.
+
+ 2. Teclegeu dd per esborrar la línia i desar-la a la memòria.
+
+ 3. Moveu el cursor a la línia ANTERIOR on hauria d'anar.
+
+ 4. En mode Normal, premeu p per inserir la línia.
+
+ 5. Repetiu els passos 2, 3 i 4 per ordenar les línies correctament.
+
+ d) Pots aprendre tu?
+ b) Les violetes són blaves,
+ c) L'intel·ligència s'aprèn,
+ a) Les roses són vermelles,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 3.2: L'ORDRE SUBSTITUIR
+
+
+ ** Premeu r i un caràcter per substituir el caràcter de sota el cursor. **
+
+ 1. Moveu el cursor a la primera línia de sota marcada amb --->.
+
+ 2. Moveu el cursor a sobre del primer caràcter equivocat.
+
+ 3. Premeu r i tot seguit el caràcter correcte per corregir l'error.
+
+ 4. Repetiu els passos 2 i 3 fins que la línia sigui correcta.
+
+---> Quen van escroure aquerta línia, algh va apretar tikles equivocades!
+---> Quan van escriure aquesta línia, algú va apretar tecles equivocades!
+
+ 5. Ara continueu a la lliçó 3.2.
+
+NOTA: Recordeu que heu de practicar, no memoritzar.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 3.3: L'ORDRE CANVIAR
+
+
+ ** Per canviar una part o tota la paraula, escriviu cw . **
+
+ 1. Moveu el cursor a la primera línia de sota marcada amb --->.
+
+ 2. Poseu el cursor sobre la u de 'lughc'.
+
+ 3. Teclegeu cw i corregiu la paraula (en aquest cas escriviu 'ínia'.)
+
+ 4. Premeu <ESC> i aneu al següent error.
+
+ 5. Repetiu els passos 3 i 4 fins que les dues frases siguin iguals.
+
+---> Aquesta lughc té algunes paradskl que s'han de cdddf.
+---> Aquesta línia té algunes paraules que s'han de canviar.
+
+Noteu que cw no només canvia la paraula, també us posa en mode d'inserció.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 3.4: MÉS CANVIS AMB c
+
+
+ ** L'ordre canviar s'usa amb els mateixos objectes que l'ordre esborrar. **
+
+ 1. L'ordre canviar funciona igual que la d'esborrar. El format és:
+
+ [nombre] c objecte O BÉ c [nombre] objecte
+
+ 2. Els objectes són els mateixos, com w (paraula), $ (final de línia), etc.
+
+ 3. Moveu el cursor fins la primera línia marcada amb --->.
+
+ 4. Avanceu fins al primer error.
+
+ 5. Premeu c$ per fer la línia igual que la segona i premeu <ESC>.
+
+---> El final d'aquesta línia necessita canvis per ser igual que la segona.
+---> El final d'aquesta línia s'ha de corregir amb l'ordre c$.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 3 SUMARI
+
+
+ 1. Per tornar a posar el text que s'ha esborrat, premeu p . Això posa el
+ text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà a
+ parar a la línia SEGÜENT d'on hi ha el cursor).
+
+ 2. Per substituir el caràcter de sota el cursor, premeu r i tot seguit
+ el caràcter que ha de reemplaçar l'original.
+
+ 3. L'ordre canviar permet canviar l'objecte especificat des del cursor
+ fins el final de l'objecte. Per exemple, cw canvia el que hi ha des
+ del cursor fins al final de la paraula, i c$ fins al final de línia.
+
+ 4. El format de l'ordre canviar és:
+
+ [nombre] c objecte O BÉ c [nombre] objecte
+
+Ara aneu a la pròxima lliçó.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 4.1: SITUACIÓ I ESTAT DEL FITXER
+
+
+ ** Premeu CTRL-g per veure la situació dins del fitxer i el seu estat.
+ Premeu SHIFT-G per anar a una línia determinada. **
+
+ Nota: No proveu res fins que hàgiu llegit TOTA la lliçó!!
+
+ 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix de
+ la pàgina apareixerà un línia amb el nom del fitxer i la línia en la
+ qual us trobeu. Recordeu el número de la línia pel Pas 3.
+
+ 2. Premeu Shift-G per anar al final de tot del fitxer.
+
+ 3. Teclegeu el número de la línia on éreu i després premeu Shift-G. Això
+ us tornarà a la línia on éreu quan heu premut per primer cop Ctrl-g.
+ (Quan teclegeu el número NO es veurà a la pantalla.)
+
+ 4. Ara executeu els passos de l'1 al 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 4.2: L'ORDRE CERCAR
+
+
+ ** Premeu / seguit de la frase que vulgueu cercar. **
+
+ 1. En el mode Normal premeu el caràcter / . Noteu que el cursor apareix
+ a la part de baix de la pantalla igual que amb l'ordre : .
+
+ 2. Ara escriviu 'errroor' <ENTRAR>. Aquesta és la paraula que voleu
+ cercar.
+
+ 3. Per tornar a cercar la mateixa frase, premeu n .
+ Per cercar la mateixa frase en direcció contraria, premeu Shift-N .
+
+ 4. Si voleu cercar una frase en direcció ascendent, useu l'ordre ? en
+ lloc de /.
+
+---> "errroor" no és com s'escriu error; errroor és un error.
+
+Note: Quan la cerca arribi al final del fitxer continuarà a l'inici.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 4.3: CERCA DE PARÈNTESIS
+
+
+ ** Premeu % per cercar el ),], o } corresponent. **
+
+ 1. Poseu el cursor en qualsevol (, [, o { de la línia marcada amb --->.
+
+ 2. Ara premeu el caràcter % .
+
+ 3. El cursor hauria d'anar a la clau o parèntesis corresponent.
+
+ 4. Premeu % per tornar el cursor al primer parèntesi.
+
+---> Això ( és una línia amb caràcters (, [ ] i { } de prova. ))
+
+Nota: Això és molt útil per trobar errors en programes informàtics!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 4.4: UNA MANERA DE CANVIAR ERRORS
+
+
+ ** Escriviu :s/vell/nou/g per substituir 'vell' per 'nou'. **
+
+ 1. Moveu el cursor a la línia de sota marcada amb --->.
+
+ 2. Escriviu :s/laa/la <ENTRAR> . Aquesta ordre només canvia la primera
+ coincidència que es trobi a la línia.
+
+ 3. Ara escriviu :s/laa/la/g per fer una substitució global. Això
+ canviarà totes les coincidències que es trobin a la línia.
+
+---> laa millor època per veure laa flor és laa primavera.
+
+ 4. Per canviar totes les coincidències d'una cadena entre dues línies,
+ escriviu :#,#s/vell/nou/g on #,# són els nombres de les línies.
+ Escriviu :%s/vell/nou/g per substituir la cadena a tot el fitxer.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 4 SUMARI
+
+
+ 1. Ctrl-g mostra la posició dins del fitxer i l'estat del mateix.
+ Shift-G us porta al final del fitxer. Un número seguit de Shift-G
+ us porta a la línia corresponent.
+
+ 2. L'ordre / seguida d'una frase cerca la frase ENDAVANT.
+ L'ordre ? seguida d'una frase cerca la frase ENDARRERE.
+ Després d'una cerca premeu n per trobar la pròxima coincidència en
+ la mateixa direcció, o Shift-N per cercar en la direcció contrària.
+
+ 3. L'ordre % quan el cursor és a sobre un (,),[,],{, o } troba la
+ parella corresponent.
+
+ 4. Per substituir el primer 'vell' per 'nou' en una línia :s/vell/nou
+ Per substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g
+ Per substituir frases entre les línies # i # :#,#s/vell/nou/g
+ Per substituir totes les coincidències en el fitxer :%s/vell/nou/g
+ Per demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 5.1: COM EXECUTAR UNA ORDRE EXTERNA
+
+
+ ** Teclegeu :! seguit d'una ordre externa per executar-la. **
+
+ 1. Premeu el familiar : per col·locar el cursor a la part de baix de
+ la pantalla. Això us permet entrar una ordre.
+
+ 2. Ara teclegeu el caràcter ! (signe d'exclamació). Això us permet
+ executar qualsevol ordre de la shell.
+
+ 3. Com a exemple escriviu ls i tot seguit premeu <ENTRAR>. Això us
+ mostrarà el contingut del directori, tal com si estiguéssiu a la
+ línia d'ordres. Feu servir :!dir si ls no funciona.
+
+Nota: D'aquesta manera es pot executar qualsevol ordre externa.
+
+Nota: Totes les ordres : s'han d'acabar amb la tecla <ENTRAR>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS
+
+
+ ** Per desar els canvis fets, escriviu :w FITXER. ***
+
+ 1. Escriviu :!dir o bé :!ls per obtenir un llistat del directori.
+ Ja sabeu que heu de prémer <ENTRAR> després d'això.
+
+ 2. Trieu un nom de fitxer que no existeixi, com ara PROVA.
+
+ 3. Ara feu: :w PROVA (on PROVA és el nom que heu triat.)
+
+ 4. Això desa tot el fitxer amb el nom de PROVA. Per comprovar-ho
+ escriviu :!dir per veure el contingut del directori.
+
+Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el
+ fitxer serà una còpia exacta del tutor que heu desat.
+
+ 5. Ara esborreu el fitxer teclejant (MS-DOS): :!del PROVA
+ o bé (Unix): :!rm PROVA
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 5.3: UNA ORDRE SELECTIVA PER DESAR
+
+
+ ** Per desar una part del fitxer, escriviu :#,# w FITXER **
+
+ 1. Un altre cop, feu :!dir o :!ls per obtenir un llistat del directori
+ i trieu un nom de fitxer adequat com ara PROVA.
+
+ 2. Moveu el cursor a dalt de tot de la pàgina i premeu Ctrl-g per
+ saber el número de la línia. RECORDEU AQUEST NÚMERO!
+
+ 3. Ara aneu a baix de tot de la pàgina i torneu a prémer Ctrl-g.
+ RECORDEU AQUEST NÚMERO TAMBÉ!
+
+ 4. Per desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on
+ #,# són els dos números que heu recordat (dalt,baix) i PROVA el nom
+ del fitxer.
+
+ 5. Mireu que el fitxer nou hi sigui amb :!dir però no l'esborreu.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 5.4: OBTENIR I AJUNTAR FITXERS
+
+
+ ** Per inserir el contingut d'un fitxer, feu :r FITXER **
+
+ 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi és.
+
+ 2. Poseu el cursor a dalt de tot d'aquesta pàgina.
+
+NOTA: Després d'executar el Pas 3 veureu la lliçó 5.3. Aleshores moveu-vos
+ cap avall fins a aquesta lliçó un altre cop.
+
+ 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA és el
+ nom del fitxer.
+
+NOTA: El fitxer que obtingueu es posa en el lloc on hi hagi el cursor.
+
+ 4. Per comprovar que s'ha obtingut el fitxer tireu enrere i mireu com
+ ara hi han dues còpies de la lliçó 5.3: l'original i la del fitxer.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 5 SUMARI
+
+
+ 1. :!ordre executa una ordre externa.
+
+ Alguns exemples útils són:
+ (MS-DOS) (Unix)
+ :!dir :!ls - mostra un llistat del directori
+ :!del FITXER :!rm FITXER - esborra el fitxer FITXER
+
+ 2. :w FITXER escriu el fitxer editat al disc dur, amb el nom FITXER.
+
+ 3. :#,#w FITXER desa les línies de # a # en el fitxer FITXER.
+
+ 4. :r FITXER llegeix el fitxer FITXER del disc dur i l'insereix en el
+ fitxer editat a la posició on hi ha el cursor.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 6.1: L'ORDRE OBRIR
+
+
+** Premeu o per obrir una línia sota el cursor i entrar en mode inserció. **
+
+ 1. Moveu el cursor a la línia de sota marcada amb --->.
+
+ 2. Premeu o (minúscula) per obrir una línia SOTA el cursor i situar-vos
+ en mode d'inserció.
+
+ 3. Ara copieu la línia marcada amb ---> i premeu <ESC> per tornar al mode
+ normal.
+
+---> Després de prémer o el cursor es situa a la línia nova en mode inserció.
+
+ 4. Per obrir una línia SOBRE el cursor, premeu la O majúscula, en lloc
+ de la minúscula. Proveu-ho amb la línia de sota.
+Obriu una línia sobre aquesta amb Shift-O amb el cursor en aquesta línia.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 6.2: L'ORDRE AFEGIR
+
+
+ ** Premeu a per afegir text DESPRÉS del cursor. **
+
+ 1. Moveu el cursor al final de la primera línia de sota marcada
+ amb ---> prement $ en el mode Normal.
+
+ 2. Premeu la lletra a (minúscula) per afegir text DESPRÉS del caràcter
+ sota el cursor. (La A majúscula afegeix text al final de línia.)
+
+Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir,
+ la tecla <ESC>, cursor a la dreta, i finalment x , només per afegir
+ text a final de línia.
+
+ 3. Ara completeu la primera línia. Tingueu en compte que aquesta ordre
+ és exactament igual que la d'inserir, excepte pel que fa al lloc on
+ s'insereix el text.
+
+---> Aquesta línia us permetrà practicar
+---> Aquesta línia us permetrà practicar afegir text a final de línia.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 6.3: UNA ALTRA MANERA DE SUBSTITUIR
+
+
+ ** Teclegeu una R majúscula per substituir més d'un caràcter. **
+
+ 1. Moveu el cursor a la línia de sota marcada amb --->.
+
+ 2. Poseu el cursor al principi de la primera paraula que es diferent
+ respecte a la segona línia marcada amb ---> (la paraula "l'última").
+
+ 3. Ara premeu R i substituïu el que queda de text a la primera línia
+ escrivint sobre el text vell, per fer-la igual que la segona.
+
+---> Per fer aquesta línia igual que l'última useu les tecles.
+---> Per fer aquesta línia igual que la segona, premeu R i el text nou.
+
+ 4. Tingueu en compte que en prémer <ESC> per sortir, el text que no
+ s'hagi alterat es manté.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lliçó 6.4: ESTABLIR OPCIONS
+
+ ** Feu que les ordres cercar o substituir ignorin les diferències
+ entre majúscules i minúscules **
+
+ 1. Cerqueu la paraula 'ignorar' amb: /ignorar
+ Repetiu-ho uns quants cops amb la tecla n.
+
+ 2. Establiu l'opció 'ic' (Ignorar Capitals) escrivint:
+ :set ic
+
+ 3. Ara cerqueu 'ignorar' un altre cop amb la tecla n.
+ Repetiu-ho uns quants cops més.
+
+ 4. Establiu les opcions 'hlsearch' i 'incsearch':
+ :set hls is
+
+ 5. Ara torneu a executar una ordre de cerca, i mireu què passa:
+ /ignorar
+
+ 6. Per treure el ressalt dels resultats, feu:
+ :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 6 SUMARI
+
+
+ 1. L'ordre o obre una línia SOTA la del cursor i mou el cursor a la nova
+ línia, en mode Inserció.
+ La O majúscula obre la línia a SOBRE la que hi ha el cursor.
+
+ 2. Premeu una a per afegir text DESPRÉS del caràcter sota el cursor.
+ La A majúscula afegeix automàticament el text a final de línia.
+
+ 3. L'ordre R majúscula us posa en mode substitució fins que premeu <ESC>.
+
+ 4. Escriviu ":set xxx" per establir l'opció "xxx"
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 7: ORDRES D'AJUDA
+
+
+ ** Utilitzeu el sistema intern d'ajuda **
+
+ El Vim té un extens sistema d'ajuda. Per llegir una introducció proveu una
+ d'aquestes tres coses:
+ - premeu la tecla <AJUDA> (si en teniu alguna)
+ - premeu la tecla <F1> (si en teniu alguna)
+ - escriviu :help <ENTRAR>
+
+ Teclegeu :q <ENTRAR> per tancar la finestra d'ajuda.
+
+ Podeu trobar ajuda sobre pràcticament qualsevol tema donant un argument
+ a l'ordre ":help". Proveu això (no oblideu prémer <ENTRAR>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LLIÇÓ 8: CREAR UN SCRIPT D'INICI
+
+ ** Activar funcions automàticament **
+
+ El Vim té moltes més funcions que el Vi, però moltes estan desactivades per
+ omissió. Per començar a utilitzar més funcions heu de crear un fitxer "vimrc".
+
+ 1. Comenceu a editar el fitxer "vimrc", depenent del sistema
+ :edit ~/.vimrc per Unix
+ :edit $VIM/_vimrc per MS-Windows
+
+ 2. Ara llegiu el fitxer "vimrc" d'exemple:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Deseu el fitxer amb:
+
+ :write
+
+ El pròxim cop que executeu el Vim usarà ressalt de sintaxi.
+ Podeu afegir els ajustos que vulgueu en aquest fitxer "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Aquí conclou el Tutor del Vim. Ha sigut un intent de fer-vos una breu
+ introducció a l'editor Vim, suficient com per què el pugueu començar a fer
+ servir. Està lluny de ser complet perquè el Vim té moltes més ordres.
+ Llegiu el manual de l'usuari: ":help user-manual".
+
+ Per un estudi més profund us recomanem el següent llibre:
+ Vim - Vi Improved - de Steve Oualline
+ Editorial: New Riders
+ És el primer llibre dedicat completament al Vim, especialment útil per a
+ usuaris novells. Té molts exemples i dibuixos.
+ Vegeu http://iccf-holland.org/click5.html
+
+ Aquest altre és més vell i tracta més sobre el Vi que sobre el Vim:
+ Learning the Vi Editor - de Linda Lamb
+ Editorial: O'Reilly & Associates Inc.
+ És un bon llibre per saber qualsevol cosa que desitgeu sobre el Vi.
+ La sisena edició també inclou informació sobre el Vim.
+
+ Aquest tutorial ha estat escrit per Michael C. Pierce i Robert K. Ware,
+ Colorado School of Mines amb la col·laboració de Charles Smith,
+ Colorado State University. E-mail: bware@mines.colorado.edu.
+
+ Modificat pel Vim per Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.de b/runtime/tutor/tutor.de
new file mode 100644
index 000000000..2a8f0909a
--- /dev/null
+++ b/runtime/tutor/tutor.de
@@ -0,0 +1,849 @@
+===============================================================================
+= W i l l k o m m e n z u m V I M T u t o r - Version 1.5D =
+===============================================================================
+
+ Vim ist ein sehr mächtiger Editor, der viele Befehle bereitstellt;
+ zu viele, um alle in einem Tutor wie diesem zu erklären.
+ Dieser Tutor ist so gestaltet, um genug Befehle vorzustellen, so dass Du
+ die Fähigkeit erlangst, Vim mit Leichtigkeit als einen Allzweck-Editor
+ zu benutzen.
+
+ Die Zeit für das Durcharbeiten dieses Tutors beträgt ca. 25-30 Minuten,
+ abhängig davon, wie viel Zeit Du mit Experimentieren verbringst.
+
+ Die in den Lektionen angewendeten Kommandos werden den Text modifizieren.
+ Erstelle eine Kopie dieser Datei, in der Du üben willst
+ (falls Du "vimtutor.bat" aufgerufen hast, ist dies bereits eine Kopie).
+
+ Es ist wichtig, sich zu vergegenwärtigen, dass dieser Tutor angelegt ist,
+ um über das Anwenden zu lehren. Das bedeutet, dass Du die Befehle ausführen
+ musst, um sie richtig zu lernen. Wenn Du nur den Text liest, vergisst Du die
+ Befehle!
+
+ Jetzt stelle sicher, dass Deine Umstelltaste NICHT gedrückt ist, und
+ betätige die j Taste genügend Male, um den Cursor nach unten
+ zu bewegen, so dass Lektion 1.1 den Bildschirm vollkommen ausfüllt.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.1: BEWEGEN DES CURSORS
+
+
+ ** Um den Cursor zu bewegen, drücke die h,j,k,l Tasten wie unten gezeigt. **
+
+ ^ Hilfestellung:
+ k Die h Taste befindet sich links und bewegt nach links.
+ < h l > Die l Taste liegt rechts und bewegt nach rechts.
+ j Die j Taste ähnelt einem Pfeil nach unten.
+ v
+ 1. Bewege den Cursor auf dem Bildschirm herum, bis Du Dich sicher fühlst.
+
+ 2. Halte die Nach-Unten-Taste (j) gedrückt, bis sie sich wiederholt.
+---> Jetzt weißt Du, wie Du Dich zur nächsten Lektion bewegen kannst.
+
+ 3. Benutze die Nach-Unten-Taste, um Dich zu Lektion 1.2 zu bewegen.
+
+Bemerkung: Immer, wenn Du Dir unsicher bist über das, was Du getippt hast,
+ drücke <ESC> , um Dich in den Normal-Modus zu begeben.
+ Dann gib das gewünschte Kommando noch einmal ein.
+
+Bemerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du
+ hjkl benutzt, wirst Du in der Lage sein, Dich sehr viel schneller
+ umherzubewegen, wenn Du Dich erst einmal daran gewöhnt hast.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.2: STARTEN UND VERLASSEN VON VIM
+
+
+ !! ACHTUNG: Bevor Du einen der unten aufgeführten Schritte ausführst, lies
+ diese gesamte Lektion!!
+
+ 1. Drücke die <ESC> Taste (um sicherzustellen, dass Du im Normal-Modus bist).
+
+ 2. Tippe: :q! <ENTER>.
+
+---> Dies beendet den Editor OHNE jedwelche Änderungen, die Du gemacht hast.
+ Wenn Du die Änderungen speichern und beenden willst, tippe:
+ :wq <ENTER>
+
+ 3. Wenn Du die Eingabeaufforderung siehst, tippe das Kommando, dass Dich zu
+ diesem Tutor geführt hat. Das könnte sein: vimtutor <ENTER>
+ Im Normalfall würdest Du eingeben Vim tutor <ENTER>
+
+---> 'Vim' ist der Aufruf des Editors, 'tutor' ist die zu editierende Datei.
+
+ 4. Wenn Du Dir diese Schritte eingeprägt hast und Du Dich sicher genug fühlst,
+ führe Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder
+ hineinzugelangen. Dann bewege den Cursor nach unten zur Lektion 1.3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.3: TEXT EDITIEREN - LÖSCHEN
+
+
+ ** Im Normal-Modus, drücke x um das Zeichen unter dem Cursor zu löschen. **
+
+ 1. Bewege den Cursor zu der mit ---> markierten Zeile unten.
+
+ 2. Um die Fehler zu beheben, bewege den Cursor, bis er auf dem Zeichen steht,
+ das gelöscht werden soll.
+
+ 3. Drücke die x Taste, um das überflüssige Zeichen zu löschen.
+
+ 4. Wiederhole die Schritte 2 bis 4, bis der Satz korrekt ist.
+
+---> Die Kkuh sprangg übber deen Moond.
+
+ 5. Wenn nun die Zeile korrekt ist, gehe weiter zur Lektion 1.4.
+
+Anmerkung: Während Du durch diesen Tutor gehst, versuche nicht, auswendig zu
+ lernen, lerne vielmehr durch Anwenden.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.4: TEXT EDITIEREN - EINFÜGEN
+
+
+ ** Während Du im Normal-Modus bist, drücke i , um Text einzufügen. **
+
+ 1.Bewege den Cursor zu der mit ---> markierten Zeile unten.
+
+ 2. Um die erste Zeile mit der zweiten gleichzumachen, bewege den Cursor auf
+ das erste Zeichen NACH der Stelle, wo der Text eingefügt werden soll.
+
+ 3. Drücke i und gib die notwendige Ergänzung ein.
+
+ 4. Wenn jeweils ein Fehler beseitigt ist, drücke <ESC> , um zum Normal-Modus
+ zurückzukehren.
+ Wiederhole die Schritte 2 bis 4, um den Satz zu korrigieren.
+
+---> In dieser ft etwas .
+---> In dieser Zeile fehlt etwas Text.
+
+ 5. Wenn Du Dich mit dem Einfügen von Text sicher fühlst, bewege den Cursor zur
+ untenstehenden Zusammenfassung.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON LEKTION 1
+
+
+ 1. Der Cursor wird bewegt, indem man entweder die Pfeiltasten oder die
+ hjkl Tasten benutzt.
+ h (links) j (unten) k (aufwärts) l (rechts)
+
+ 2. Um Vim aufzurufen (vom % prompt) tippe: vim DATEINAME <ENTER>
+
+ 3. Um Vim zu verlassen, tippe: <ESC> :q! <ENTER> ,
+ um alle Änderungen zu verwerfen.
+ ODER tippe: <ESC> :wq <ENTER> ,
+ um die Änderungen zu speichern.
+
+ 4. Um ein Zeichen im Normal-Modus zu löschen, tippe: x
+
+ 5. Um Text beim Cursor einzugeben, während Du im Normal-Modus bist, tippe:
+ i Text eingeben <ESC>
+
+Bemerkung: Drücken von <ESC> bringt Dich in den Normal-Modus oder bricht ein
+ ungewolltes, erst teilweise eingegebenes Kommando ab.
+
+Nun fahre mit Lektion 2 fort.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.1: LÖSCHKOMMANDOS
+
+
+ ** Tippe dw , um bis zum Ende des Wortes zu löschen **
+
+ 1. Drücke <ESC> um sicherzustellen, dass Du im Normal-Modus bist.
+
+ 2. Bewege den Cursor zu der mit ---> markierten Zeile unten.
+
+ 3. Bewege den Cursor zum Anfang eines Wortes, das gelöscht werden soll.
+
+ 4. Tippe dw , um das Wort zu entfernen.
+
+ Bemerkung: Die Buchstaben dw erscheinen auf der letzten Zeile des
+ Bildschirms, wenn Du sie eingibst. Wenn Du etwas falsch eingetippt hast,
+ drücke <ESC> und fahre fort.
+
+---> Einige Wörter lustig gehören nicht Papier in diesen Satz.
+
+ 5. Wiederhole die Schritte 3 und 4, bis der Satz korrekt ist und gehe
+ danach zur Lektion 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.2: WEITERE LÖSCHKOMMANDOS
+
+
+ ** Tippe d$ , um bis zum Ende der Zeile zu löschen. **
+
+ 1. Drücke <ESC> ,um sicherzustellen, dass Du im Normal-Modus bist.
+
+ 2. Bewege den Cursor zu der mit ---> markierten Zeile unten.
+
+ 3. Bewege den Cursor zum Ende der korrekten Zeile (NACH dem ersten . ).
+
+ 4. Tippe d$ ,um bis zum Ende der Zeile zu löschen.
+
+---> Jemand hat das Ende der Zeile doppelt eingegeben. doppelt eingegeben.
+
+
+ 5. Gehe weiter zur Lektion 2.3 , um zu verstehen, was hierbei passiert.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.3: ÜBER KOMMANDOS UND OBJEKTE
+
+
+ Das Format für das Löschkommando d ist folgendermaßen:
+
+ [Nummer] d Objekt ODER d [Nummer] Objekt
+
+ Wobei:
+ Nummer - gibt an, wie viele Male das Kommando ausgeführt werden soll
+ (optional, standardmäßig 1).
+ d - ist das Löschkommando.
+ Objekt - bedeutet, worauf das Kommando angewendet wird (unten aufgeführt).
+
+ Eine kurze Liste von Objekten:
+ w - vom Cursor an bis zum Ende des Wortes, inklusive dem Leerzeichen.
+ e - vom Cursor an bis zum Ende des Wortes, OHNE das Leerzeichen.
+ $ - vom Cursor an bis zum Ende der Zeile.
+
+Bemerkung: Für die Wagemutigen: die Eingabe lediglich des Objekt-Teils im
+ Normal-Modus ohne ein Kommando bewegt den Cursor so,
+ wie in der Objektliste angegeben ist.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.4: EINE AUSNAHME ZU 'KOMMANDO-OBJEKT'
+
+
+ ** Tippe dd , um eine ganze Zeile zu löschen. **
+
+ Wegen der Häufigkeit, dass man ganze Zeilen löscht, kamen die
+ Entwickler von Vim darauf, dass es leichter wäre, zwei d's hintereinander
+ einzugeben, um eine Zeile zu löschen.
+
+ 1. Bewege den Cursor zur zweiten Zeile in der unten stehenden Redewendung.
+ 2. Tippe dd , um die Zeile zu löschen.
+ 3. Nun bewege Dich zur vierten Zeile.
+ 4. Tippe 2dd (erinnere Dich an Nummer-Kommando-Objekt),
+ um die überflüssigen Zeilen zu löschen.
+
+ 1) Rosen sind rot,
+ 2) Matsch ist lustig,
+ 3) Veilchen sind blau,
+ 4) Ich habe ein Auto,
+ 5) Die Uhr sagt die Zeit,
+ 6) Zucker ist süß,
+ 7) So wie Du auch.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.5: RÜCKGÄNGIG MACHEN (UNDO)
+
+
+ ** Tippe u , um die letzten Kommandos rückgängig zu machen **
+ ** oder U um eine ganze Zeile wiederherzustellen. **
+
+ 1. Bewege den Cursor zu der mit ---> markierten Zeile unten
+ und setze ihn auf den ersten Fehler.
+ 2. Tippe x , um das erste überflüssige Zeichen zu löschen.
+ 3. Nun tippe u um das soeben ausgeführte Kommando rückgängig zu machen.
+ 4. Dieses Mal behebe alle Fehler auf der Zeile, indem Du das x Kommando
+ anwendest.
+ 5. Nun tippe ein großes U , um die Zeile in ihren Ursprungszustand
+ wiederherzustellen.
+ 6. Nun tippe u mehrere Male, um das U und die vorhergehenden Kommandos
+ rückgängig zu machen.
+ 7. Nun tippe CTRL-R (halte die CTRL-Taste gedrückt und drücke R )
+ mehrere Male, um die Kommandos rückgängig zu machen
+ (die Rückgängigmachungen rückgängig machen).
+
+---> Beehebe die Fehller diesser Zeile und sttelle sie mitt 'undo' wieder her.
+
+ 8. Dieses sind sehr nützliche Kommandos.
+ Nun gehe weiter zur Zusammenfassung von Lektion 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON LEKTION 2
+
+
+ 1. Um vom Cursor bis zum Ende eines Wortes zu löschen, tippe: dw
+
+ 2. Um vom Cursor bis zum Ende einer Zeile zu löschen, tippe: d$
+
+ 3. Um eine ganze Zeile zu löschen, tippe: dd
+
+ 4. Das Format für ein Kommandos im Normal-Modus ist:
+
+ [Nummer] Kommando Objekt ODER Kommando [Nummer] Objekt
+ wobei:
+ Nummer - gibt an, wie oft das Kommando wiederholt wird
+ Kommando - gibt an, was getan werden soll, zum Beispiel d für delete
+ Objekt - gibt an, worauf das Kommando angewendet werden soll,
+ zum Beispiel w (Wort), $ (zum Ende der Zeile), etc.
+
+ 5. Um vorherige Aktionen rückgängig zu machen, tippe: u (kleines u)
+ Um alle Änderungen auf einer Zeile rückgängig zu machen: U (großes U)
+ Um die Rückgängigmachungen rückgängig zu machen, tippe: CTRL-R
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.1: ANFÜGEN (PUT)
+
+
+ ** Tippe p ,um das zuletzt Gelöschte nach dem Cursor anzufügen. **
+
+ 1. Bewege den Cursor zur ersten Zeile des unten stehenden Sinnspruchs.
+
+ 2. Tippe dd , um die Zeile zu löschen und sie im Vims Puffer zu speichern.
+
+ 3. Bewege den Cursor zur Zeile ÜBER derjenigen,
+ wo die gelöschte Zeile platziert werden soll.
+
+ 4. Im Normal-Modus, tippe p , um die Zeile zu platzieren.
+
+ 5. Wiederhole die Schritte 2 bis 4, um alle Zeilen in die richtige Reihenfolge
+ zu bringen.
+
+ d) Kannst Du das auch?
+ b) Veilchen sind blau,
+ c) Intelligenz ist erlernbar,
+ a) Rosen sind rot,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.2: ERSETZEN (REPLACE)
+
+
+ ** Tippe r und ein Zeichen, um das Zeichen unter dem Cursor zu ersetzen. **
+
+ 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
+
+ 2. Bewege den Cursor, bis er sich auf dem ersten Fehler befindet.
+
+ 3. Tippe r und anschließend das Zeichen, welches den Fehler beheben sollte.
+
+ 4. Wiederhole die Schritte 2 und 3, bis die erste Zeile korrekt ist.
+
+---> Als diese Zeite eingegoben wurde, wurden einike falsche Tasten gelippt.
+---> Als diese Zeile eingegeben wurde, wurden einige falsche Tasten getippt.
+
+ 5. Nun fahre fort mit Lektion 3.2.
+
+Bemerkung: Erinnere Dich, dass Du durch Anwenden lernen solltest, nicht durch
+ Auswendiglernen.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.3: ÄNDERN (CHANGE)
+
+
+ ** Um ein Wortteil oder ein ganzes Wort zu ändern, tippe cw . **
+
+ 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
+
+ 2. Plaziere den Cursor auf das s von Wstwr.
+
+ 3. Tippe cw und die Wortkorrektur ein (in diesem Fall, tippe 'örter'.)
+
+ 4. Drücke <ESC> und bewege den Cursor zum nächsten Fehler
+ (Das erste zu ändernde Zeichen.)
+
+ 5. Wiederhole Schritte 3 und 4 bis der erste Satz gleich dem zweiten ist.
+
+---> Einige Wstwr dieser Zlaww lasdjlaf mit dem Ändern-Kommando gaaauu werden.
+---> Einige Wörter dieser Zeile sollen mit dem Ändern-Kommando geändert werden.
+
+Bemerke, dass cw nicht nur das Wort ersetzt, sondern Dich außerdem in den
+ Eingabemodus versetzt.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.4: MEHR ÄNDERUNGEN MITTELS c
+
+
+ ** Das change-Kommando arbeitet mit denselben Objekten wie delete **
+
+ 1. Das change Kommando arbeitet gleicher Weise wie delete. Das Format ist:
+
+ [Nummer] c Objekt ODER c [Nummer] Objekt
+
+ 2. Auch sind die Objekte gleich, so wie w (Wort), $ (Ende der Zeile), etc.
+
+ 3. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
+
+ 4. Bewege den Cursor zum ersten Unterschied zur anderen Zeile.
+
+ 5. Tippe c$ , um den Rest der Zeile an die zweite anzugleichen
+ und drücke abschließend <ESC> .
+
+---> Das Ende dieser Zeile sollte an die zweite Zeile angeglichen werden.
+---> Das Ende dieser Zeile sollte mit dem 'c$' Kommando korrigiert werden.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON LEKTION 3
+
+
+ 1. Um einen vorher gelöschten Text anzufügen, tippe p . Diese fügt den
+ gelöschten Text NACH dem Cursor an (wenn es sich um eine ganze Zeile
+ handelt, wird ab der Zeile unter dem Cursor eingefügt).
+
+ 2. Um das Zeichen unter dem Cursor zu ersetzen, tippe r ; das danach
+ eingegebene Zeichen ersetzt das Original.
+
+ 3. Das Änderungs- (change) Kommando erlaubt, das angegebene Objekt vom Cursor
+ bis zum Ende des Objektes zu ändern. Tippe z.B. cw , um eine Änderung vom
+ Cursor bis zum Ende des Wortes vorzunehmen; c$ bis zum Ende der Zeile.
+
+ 4. Das Format für change ist:
+
+ [Nummer] c Objekt ODER c [Nummer] Objekt
+
+Nun fahre mit der nächsten Lektion fort.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.1: DATEIPOSITION UND DATEISTATUS
+
+
+ ** Tippe CTRL-g , um Deine Dateiposition sowie den Dateistatus anzuzeigen. **
+ ** Tippe SHIFT-G , um Dich zu einer Zeile in der Datei zu bewegen. **
+
+ Bemerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausführst!!
+
+ 1. Halte die Ctrl Taste unten und drücke g . Eine Statuszeile erscheint in
+ der untersten Zeile des Fensters mit dem Dateinamen und der Zeile,
+ auf der Du Dich befindest. Präge Dir die Zeilennummer für Schritt 3 ein.
+
+ 2. Drücke Shift-G , um Dich zum Ende der Datei zu begeben.
+
+ 3. Gib die Nummer der Zeile ein, auf der Du vorher warst, gefolgt von Shift-G.
+ Dieses bringt Dich zurück zu der Zeile, auf der Du gestanden hast, als Du
+ das erste Mal Ctrl-g gedrückt hast.
+ (Wenn Du die Ziffern eingibst, werden sie NICHT auf dem Schirm angezeigt.)
+
+ 4. Wenn Du sicher genug fühlst, führe die Schritte 1 bis 3 aus.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.2: DAS SUCHEN - KOMMANDO
+
+
+ ** Tippe / gefolgt von einem Ausdruck, um nach dem Ausdruck zu suchen. **
+
+ 1. Wenn Du im Normal-Modus bist, tippe das / Zeichen. Beachte, dass das /
+ und der Cursor auf der untersten Zeile des Schirms erscheinen,
+ so wie beim : Kommando.
+
+ 2. Nun tippe 'Fehhler' <ENTER>. Dies ist das Wort, nach dem Du suchen willst.
+
+ 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (für *n*ext).
+ Um nach demselben Ausdruck in der anderen Richtung zu suchen, Shift-N .
+
+ 4. Wenn Du nach einem Ausdruck rückwärts in der Datei suchen willst,
+ benutze das Kommando ? statt / .
+
+---> Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang fortgesetzt.
+
+ Fehler schreibt sich nicht "Fehhler"; "Fehhler" ist ein Fehler
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.3: PASSENDE KLAMMERN FINDEN
+
+
+ ** Tippe % , um eine korrespondierende Klammer ),], oder } zu finden. **
+
+ 1. Plaziere den Cursor auf irgendeinem der Zeichen (, [, oder {
+ in der unten stehenden Zeile, die mit ---> markiert ist.
+
+ 2. Nun tippe das % Zeichen.
+
+ 3. Der Cursor sollte sich nun auf der gegenüberliegenden Klammer befinden.
+
+ 4. Tippe % , um den Cursor zurück auf die erste Gegenklammer zurückzubewegen.
+
+---> Dies ( ist eine Testzeile mit ( verschiedenen [ Klammern ] { xx } darin. ))
+
+Bemerkung: Diese Funktionalität ist sehr nützlich bei der Fehlersuche in einem
+ Programmtext, in dem eine passende Klammer fehlt!
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.4: WEGE, UM FEHLER ZU BEHEBEN
+
+
+ ** Tippe :s/alt/neu/g , um 'alt' durch 'neu' zu ersetzen. **
+
+ 1. Bewege den Cursor zu der unten stehenden mit ---> markierten Zeile.
+
+ 2. Tippe :s/diee/die <ENTER> . Bemerke, dass der Befehl nur das erste
+ Vorkommen auf der Zeile ersetzt.
+
+ 3. Nun tippe :s/diee/die/g , welches bedeutet, eine zeilenweite
+ (*g*lobale) Ersetzung vorzunehmen.
+ Dies ersetzt alle Vorkommen auf der Zeile.
+
+---> diee schönste Zeit, um diee Blumen anzuschauen, ist diee Frühlingszeit.
+
+ 4. Um alle Vorkommen einer Zeichenkette zwischen zwei Zeilen zu ändern,
+ tippe :#,#s/alt/neu/g , wobei #,# die zwei Nummern der Zeilen sind.
+ Tippe :%s/alt/neu/g , um alle Vorkommen in der gesamten Datei zu ändern.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON LEKTION 4
+
+
+ 1. Ctrl-g zeigt die aktuelle Dateiposition sowie den Dateistatus.
+ Shift-G bringt Dich bis zum Ende der Datei. Eine Zeilennummer
+ gefolgt von Shift-G bewegt den Cursor zu der Zeilennummer.
+
+ 2. Die Eingabe von / gefolgt von einem Ausdruck sucht VORWÄRTS nach dem
+ Ausdruck.
+ Die Eingabe von ? gefolgt von einem Ausdruck sucht RÜCKWÄRTS nach dem
+ Ausdruck.
+ Tippe nach einer Suche n , um das nächste Vorkommen in der gleichen
+ Richtung zu finden; oder Shift-N , um in der entgegengesetzten Richtung
+ zu suchen.
+
+ 3. Die Eingabe von % , wenn der Cursor sich auf (,),[,],{, oder }
+ befindet, findet die korrespondierende Gegenklammer.
+
+ 4. Um das ERSTE Vorkommen von alt in eine Zeile durch neu zu ersetzen, tippe
+ :s/alt/neu
+ Um ALLE Vorkommen von alt in eine Zeile durch neu zu ersetzen, tippe
+ :s/alt/neu/g
+ Um Ausdrücke innerhalb von zwei Zeilen zu ersetzen, tippe
+ :#,#s/alt/neu/g
+ Um alle Vorkommen in der ganzen Datei zu ersetzen, tippe
+ :%s/alt/neu/g
+ Um jedes Mal nach einer Bestätigung gefragt zu werden, füge 'c' hinzu.
+ :%s/alt/neu/gc (*c*onfirm)
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.1: AUSFÜHREN EINES EXTERNEN KOMMANDOS
+
+
+ ** Gib :! , gefolgt von einem externen Kommando ein, um es auszuführen. **
+
+ 1. Tippe das vertraute Kommando : , um den Cursor auf die unterste Zeile
+ des Fensters zu setzen. Dies erlaubt Dir, ein Kommando einzugeben.
+
+ 2. Nun tippe ein ! (Ausrufezeichen). Dieses ermöglicht Dir, ein
+ beliebiges, externes Shellkommando auszuführen.
+
+ 3. Als Beispiel tippe ls nach dem ! und drücke <ENTER>. Dies zeigt
+ eine Auflistung Deines Verzeichnisses; genauso, als wenn Du auf der
+ Eingabeaufforderung wärst.
+ Verwende :!dir , falls ls nicht funktioniert.
+
+---> Bemerkung: Mit dieser Methode kann jedes beliebige externe Kommando
+ ausgeführt werden.
+
+---> Bemerkung: Alle : Kommandos müssen durch Eingabe von <ENTER>
+ abgeschlossen werden.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.2: MEHR ÜBER DAS SCHREIBEN VON DATEIEN
+
+
+** Um an der Datei durchgeführte Änderungen zu sichern , tippe :w DATEINAME. **
+
+ 1. Tippe :!ls oder :!dir , um eine Auflistung Deines Verzeichnisses
+ zu erhalten.
+ Du weißt nun bereits, dass Du danach <ENTER> eingeben musst.
+
+ 2. Wähle einen Dateinamen, der dort noch nicht existiert, z.B. TEST.
+
+ 3. Nun tippe: :w TEST (wobei TEST der gewählte Dateiname ist.)
+
+ 4. Dieses speichert diese ganze Datei (Vim Tutor) unter dem Namen TEST.
+ Um dieses zu überprüfen, tippe nochmals :!ls bzw. !dir,
+ um Deinen Verzeichnisinhalt zu sehen.
+
+---> Beachte: würdest Du Vim jetzt beenden und danach wieder mit dem Dateinamen
+ TEST öffnen, dann wäre diese Datei eine exakte Kopie des Tutors zu dem
+ Zeitpunkt, als Du ihn gespeichert hast.
+
+ 5. Nun entferne die Datei durch Eingabe von :!rm TEST bzw. :!del TEST.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.3: SELEKTIVES SCHREIBEN VON DATEIEN
+
+
+ ** Um einen Abschnitt der Datei zu speichern tippe :#,# w DATEINAME **
+
+ 1. Gib nochmals :!ls bzw :!dir ein, um eine Auflistung Deines
+ Verzeichnisses zu erhalten und wähle einen geeigneten Dateinamen wie TEST.
+
+ 2. Bewege den Cursor zum Anfang dieses Kapitels und tippe Ctrl-g , um die
+ Nummer dieser Zeile zu erhalten. PRÄGE DIR DIESE NUMMER EIN!
+
+ 3. Nun bewege Dich zum Ende dieses Kapitels und tippe wieder Ctrl-g .
+ PRÄGE DIR AUCH DIESE ZEILENNUMMER EIN!
+
+ 4. Um NUR einen Abschnitt einer Datei zu speichern, tippe :#,# w TEST
+ wobei #,# die zwei Nummern sind, die Du im Gedächtnis hast (oben, unten);
+ und TEST Dein Dateiname ist.
+
+ 5. Überprüfe wiederum mit :!ls oder :!dir nach, dass die Datei
+ existiert, aber lösche sie NICHT.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.4: EINLESEN UND ZUSAMMENFÜHREN VON DATEIEN
+
+
+ ** Um den Inhalt einer Datei einzulesen, tippe :r DATEINAME **
+
+ 1. Tippe :!ls bzw. !dir , um sicherzustellen, dass Deine Datei TEST
+ von vorhin vorhanden ist.
+
+ 2. Plaziere den Cursor auf der ersten Zeile dieses Kapitels.
+
+BEACHTE: Nachdem Du Schritt 3 ausgeführt hast, wirst Du Lektion 5.3 sehen.
+ An diesem Punkt bewege Dich wieder ABWÄRTS zu dieser Lektion.
+
+ 3. Nun lies Deine Datei TEST ein indem Du das Kommando :r TEST ausführst,
+ wobei TEST der Name der Datei ist.
+
+BEMERKUNG: Die Datei, die Du einliest, wird an der Stelle eingefügt, an der
+ sich der Cursor befindet.
+
+ 4. Um zu überprüfen, dass eine Datei eingelesen wurde, gehe zurück und
+ sehe, dass es jetzt zwei Kopien von Lektion 5.3 gibt, das Original und die
+ eingefügte Version.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON Lektion 5
+
+
+ 1. :!Kommando führt ein externes (Shell-)Kommando aus.
+
+ Einige nützliche Beispiele sind
+ UNIX:
+ :!ls - Auflistung des aktuellen Verzeichnisses
+ :!rm DATEINAME - entfernt Datei DATEINAME
+ MS-DOS/Windows:
+ :!dir - Auflistung des aktuellen Verzeichnisses
+ :!del DATEINAME - entfernt Datei DATEINAME
+
+ 2. :w DATEINAME schreibt die aktuelle Vim-Datei als DATEINAME auf die
+ Platte.
+
+ 3. :#,#w DATEINAME speichert die Zeilen # bis # in der Datei DATEINAME.
+
+ 4. :r DATEINAME lädt die Datei DATEINAME von der Platte und fügt sie in
+ die aktuelle Datei nach der Cursorposition ein.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.1: ZEILEN ÖFFNEN (OPEN)
+
+
+ ** Tippe o , um eine Zeile unter dem Cursor zu öffnen und Dich in den **
+ ** Einfügemodus zu begeben. **
+
+ 1. Bewege den Cursor zu der unten stehenden Zeile, die mit ---> markiert ist.
+
+ 2. Tippe o (klein geschrieben), um eine Zeile UNTER dem Cursor aufzumachen
+ und Dich in den Einfügemodus zu begeben.
+
+ 3. Nun tippe den Text der mit ---> markierte Zeile ab und drücke <ESC> , um
+ den Einfügemodus zu verlassen.
+
+---> Mit o wird der Cursor auf der geöffneten Zeile im Eingabemodus platziert.
+
+ 4. Um eine Zeile ÜBER dem Cursor aufzumachen, gib einfach ein großes O
+ anstelle eines kleinen o ein. Versuche dies auf der unten stehenden
+ Zeile.
+Öffne eine Zeile über dieser mit Shift-O , wenn der Cursor auf dieser Zeile ist.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.2: TEXT ANFÜGEN (APPEND)
+
+
+ ** Tippe a , um Text NACH dem Cursor einzufügen. **
+
+ 1. Bewege den Cursor zum Ende der unten stehenden Zeile, die mit --->
+ markiert ist, indem Du im Normal-Modus $ eingibst.
+
+ 2. Tippe ein a (klein geschrieben), um Text NACH dem Zeichen unter dem
+ Cursor einzugeben. (Ein großes A fügt nach dem Ende der Zeile an.)
+
+Bemerkung: Dies macht es überflüssig, erst i zu tippen, dann das letzte
+ Zeichen, den anzuhängenden Text, <ESC>, Cursor-Rechts,
+ und schließlich, x, nur um Text an eine Zeile anzuhängen!
+
+ 3. Nun vervollständige die erste Zeile. Beachte außerdem , dass Anfügen
+ (Append) genau das gleiche ist, wie der Einfüge- (Insert-) Modus,
+ abgesehen von der Stelle, an dem der Text eingefügt wird.
+
+---> Diese Zeile bietet Gelegenheit
+---> Diese Zeile bietet Gelegenheit, Text an ihr Ende anzufügen.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.3: EINE ANDERE VERSION DES ERSETZENS (REPLACE)
+
+
+ ** Tippe ein großes R , um mehr als ein Zeichen zu ersetzen. **
+
+ 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile.
+
+ 2. Plaziere den Cursor auf den Anfang des ersten Wortes, welches sich von
+ der zweiten mit ---> markierten Zeile unterscheidet (das Wort 'benutze').
+
+ 3. Nun gib ein R ein, und ersetze den Rest des Textes auf der ersten
+ Zeile, um diese gleich der zweiten zu machen, indem Du den alten Text
+ überschreibst.
+
+---> Um die erste Zeile gleich der zweiten zu machen, benutze die Tastatur.
+---> Um die erste Zeile gleich der zweiten zu machen, tippe R und neuen Text.
+
+ 4. Beachte, dass, wenn Du zum Verlassen <ESC> drückst, sämtlicher
+ ungeänderte Text bestehen bleibt.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.4: OPTIONEN SETZEN
+
+
+ ** Setze eine Option so, dass eine Suche oder eine Ersetzung Groß- **
+ ** und Kleinschreibung ignoriert **
+
+
+ 1. Suche nach 'igno', indem Du /igno eingibst.
+ Wiederhole die Suche einige Male, indem Du die n - Taste drückst.
+
+ 2. Setze die 'ic' (ignorecase; Ignoriere Groß-/Kleinschreibung) - Option,
+ indem Du :set ic eingibst.
+
+ 3. Nun suche wieder nach 'igno', indem Du n tippst.
+ Wiederhole dieses noch einige Male, indem Du die n Taste drückst.
+
+ 4. Setze die 'hlsearch' (Suche hervorheben) und 'incsearch' (Inkrementelle
+ Suche) - Optionen:
+ :set hls is
+
+ 5. Jetzt gib den Suchen-Befehl noch einmal ein und beobachte, was passiert:
+ /igno
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZUSAMMENFASSUNG VON Lektion 6
+
+
+ 1. Die Eingabe von o macht eine Zeile UNTER dem Cursor auf und
+ platziert den Cursor auf der geöffneten Zeile im Einfügemodus.
+ Die Eingabe eines großen O öffnet eine Zeile ÜBER derjenigen,
+ auf der sich der Cursor befindet.
+
+ 2. Gib ein a ein, um Text NACH dem Zeichen, auf dem sich der Cursor
+ befindet, einzufügen.
+ Die Eingabe eines großen A erlaubt das Anfügen von Text nach dem
+ Ende der Zeile.
+
+ 3. Die Eingabe eines großen R wechselt in den Ersetzungs-(Replace)-Modus,
+ bis zum Verlassen <ESC> eingegeben wird.
+
+ 4. Die Eingabe von ":set xxx" setzt die Option "xxx"
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 7 : DIE ONLINE-HILFE
+
+ ** Nutze das eingebaute Hilfesystem **
+
+ Vim besitzt ein umfassendes eingebautes Hilfesystem. Für den Anfang probiere
+ eins der drei folgenden Dinge aus:
+ - Drücke die <Hilfe> - Taste (falls Du eine besitzt)
+ - Drücke die <F1> Taste (falls Du eine besitzt)
+ - Tippe :help <ENTER>
+
+ Tippe :q <ENTER> , um das Hilfefenster zu schließen.
+
+ Du kannst Hilfe über praktisch jedes Thema finden, indem Du dem ":help"
+ Kommando ein Argument gibst. Probiere folgendes (<ENTER> nicht vergessen):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 8: ERSTELLE EIN START-SKRIPT
+
+ ** Aktiviere die Funktionalitäten von Vim **
+
+ Vim besitzt viele Funktionalitäten, die über Vi hinausgehen, aber die meisten
+ von ihnen sind standardmäßig deaktiviert.
+ Um diese zu aktivieren, musst Du eine "vimrc" - Datei erstellen.
+
+1. Starte das Editieren der "vimrc"-Datei, dies ist von Deinem System abhängig:
+ :edit ~/.vimrc für Unix
+ :edit $VIM/_vimrc für MS-Windows
+
+2. Nun lies die Beispiel - "vimrc" ein:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+3. Speichere die Datei mit:
+
+ :write
+
+Das nächste Mal, wenn Du Vim startest, wird die Syntax-Hervorhebung
+aktiviert sein.
+Du kannst all Deine Lieblingsoptionen zu dieser "vimrc" - Datei zufügen.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Damit ist der Vim Tutor beendet. Die Intention war, einen kurzen und
+ bündigen Überblick über den Vim Editor zu liefern; gerade genug, um relativ
+ leicht mit ihm umgehen zu können.
+ Der Vim Tutor hat nicht den geringsten Anspruch auf Vollständigkeit;
+ Vim hat noch weitaus mehr Kommandos.
+ Wage Dich als nächstes an das User Manual: ":help user-manual".
+
+ Für weiteres Lesen und Lernen kann folgendes Buch empfohlen werden:
+ Vim - Vi Improved - von Steve Oualline
+ Verlag: New Riders
+ Das erste Buch, dass durchgängig Vim gewidmet ist. Besonders nützlich
+ für Anfänger.
+ Viele Beispiele und Bilder sind enthalten.
+ Siehe http://www.iccf.nl/click5.html
+
+ Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert:
+ Linda Lamb und Arnold Robbins
+ Textbearbeitung mit dem vi-Editor
+ Verlag O'Reilly - ISBN: 3897211262
+ In diesem Buch kann man fast alles finden, was man mit Vi tun möchte.
+ Die sechste Ausgabe enthält auch Informationen über Vim.
+
+ Dieses Tutorial wurde geschrieben von Michael C. Pierce and Robert K. Ware,
+ Colorado School of Mines. Es benutzt Ideen, die Charles Smith,
+ Colorado State University, zur Verfügung stellte.
+ E-mail: bware@mines.colorado.edu.
+
+ Bearbeitet für Vim von Bram Moolenaar.
+
+ Deutsche Übersetzung von Joachim Hofmann, September 2002.
+ E-mail: Joachim.Hof@gmx.de
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.es b/runtime/tutor/tutor.es
new file mode 100644
index 000000000..bbdb13d1f
--- /dev/null
+++ b/runtime/tutor/tutor.es
@@ -0,0 +1,769 @@
+===============================================================================
+= B i e n v e n i d o a l t u t o r d e V I M - Versión 1.4 =
+===============================================================================
+
+ Vim es un editor muy potente que dispone de muchos mandatos, demasiados
+ para ser explicados en un tutor como éste. Este tutor está diseñado
+ para describir suficientes mandatos para que usted sea capaz de
+ aprender fácilmente a usar Vim como un editor de propósito general.
+
+ El tiempo necesario para completar el tutor es aproximadamente de 25-30
+ minutos, dependiendo de cuanto tiempo se dedique a la experimentación.
+
+ Los mandatos de estas lecciones modificarán el texto. Haga una copia de
+ este fichero para practicar (con «vimtutor» esto ya es una copia).
+
+ Es importante recordar que este tutor está pensado para enseñar con
+ la práctica. Esto significa que es necesario ejecutar los mandatos
+ para aprenderlos adecuadamente. Si únicamente se lee el texto, se
+ olvidarán los mandatos.
+
+ Ahora, asegúrese de que la tecla de bloqueo de mayúsculas no está
+ activada y pulse la tecla j lo suficiente para mover el cursor
+ de forma que la Lección 1.1 ocupe completamente la pantalla.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 1.1: MOVIMIENTOS DEL CURSOR
+
+ ** Para mover el cursor, pulse las teclas h,j,k,l de la forma que se indica. **
+ ^
+ k Indicación: La tecla h está a la izquierda y mueve a la izquierda.
+ < h l > La tecla l está a la derecha y mueve a la derecha.
+ j La tecla j parece una flecha que apunta hacia abajo.
+ v
+
+ 1. Mueva el cursor por la pantalla hasta que se sienta cómodo con ello.
+
+ 2. Mantenga pulsada la tecla j hasta que se repita «automágicamente».
+---> Ahora ya sabe como llegar a la lección siguiente.
+
+ 3. Utilizando la tecla abajo, vaya a la Lección 1.2.
+
+Nota: Si alguna vez no está seguro sobre algo que ha tecleado, pulse <ESC>
+ para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba.
+
+Nota: Las teclas de movimiento del cursor también funcionan. Pero usando
+ hjkl podrá moverse mucho más rápido una vez que se acostumbre a ello.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 1.2: ENTRANDO Y SALIENDO DE VIM
+
+ ¡¡ NOTA: Antes de ejecutar alguno de los pasos siguientes lea primero
+ la lección entera!!
+
+ 1. Pulse la tecla <ESC> (para asegurarse de que está en modo Normal).
+
+ 2. Escriba: :q! <INTRO>
+
+---> Esto provoca la salida del editor SIN guardar ningún cambio que se haya
+ hecho. Si quiere guardar los cambios y salir escriba:
+ :wq <INTRO>
+
+ 3. Cuando vea el símbolo del sistema, escriba el mandato que le trajo a este
+ tutor. Éste puede haber sido: vimtutor <INTRO>
+ Normalmente se usaría: vim tutor <INTRO>
+
+---> 'vim' significa entrar al editor, 'tutor' es el fichero a editar.
+
+ 4. Si ha memorizado estos pasos y se se siente con confianza, ejecute los
+ pasos 1 a 3 para salir y volver a entrar al editor. Después mueva el
+ cursor hasta la Lección 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 1.3: EDICIÓN DE TEXTO - BORRADO
+
+** Estando en modo Normal pulse x para borrar el carácter sobre el cursor. **j
+
+
+ 1. Mueva el cursor a la línea de abajo señalada con --->.
+
+ 2. Para corregir los errores, mueva el cursor hasta que esté bajo el
+ carácter que va aser borrado.
+
+ 3. Pulse la tecla x para borrar el carácter sobrante.
+
+ 4. Repita los pasos 2 a 4 hasta que la frase sea la correcta.
+
+---> La vvaca saltóó soobree laa luuuuna.
+
+ 5. Ahora que la línea esta correcta, continúe con la Lección 1.4.
+
+
+NOTA: A medida que vaya avanzando en este tutor no intente memorizar,
+ aprenda practicando.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 1.4: EDICIÓN DE TEXTO - INSERCIÓN
+
+ ** Estando en modo Normal pulse i para insertar texto. **
+
+
+ 1. Mueva el cursor a la primera línea de abajo señalada con --->.
+
+ 2. Para que la primera línea se igual a la segunda mueva el cursor bajo el
+ primer carácter que sigue al texto que ha de ser insertado.
+
+ 3. Pulse i y escriba los caracteres a añadir.
+
+ 4. A medida que sea corregido cada error pulse <ESC> para volver al modo
+ Normal. Repita los pasos 2 a 4 para corregir la frase.
+
+---> Flta texto en esta .
+---> Falta algo de texto en esta línea.
+
+ 5. Cuando se sienta cómodo insertando texto pase al resumen que esta más
+ abajo.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 1
+
+
+ 1. El cursor se mueve utilizamdo las teclas de las flechas o las teclas hjkl.
+ h (izquierda) j (abajo) k (arriba) l (derecha)
+
+ 2. Para acceder a Vim (desde el símbolo del sistema %) escriba:
+ vin FILENAME <INTRO>
+
+ 3. Para salir de Vim escriba: <ESC> :q! <INTRO> para eliminar todos
+ los cambios.
+
+ 4. Para borrar un carácter sobre el cursor en modo Normal pulse: x
+
+ 5. Para insertar texto en la posición del cursor estando en modo Normal:
+ pulse i escriba el texto pulse <ESC>
+
+NOTA: Pulsando <ESC> se vuelve al modo Normal o cancela un mandato no deseado
+ o incompleto.
+
+Ahora continúe con la Lección 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 2.1: MANDATOS PARA BORRAR
+
+
+ ** Escriba dw para borrar hasta el final de una palabra **
+
+
+ 1. Pulse <ESC> para asegurarse de que está en el modo Normal.
+
+ 2. Mueva el cursor a la línea de abajo señalada con --->.
+
+ 3. Mueva el cursor al comienzo de una palabra que desee borrar.
+
+ 4. Pulse dw para hacer que la palabra desaparezca.
+
+
+ NOTA: Las letras dw aparecerán en la última línea de la pantalla cuando
+ las escriba. Si escribe algo equivocado pulse <ESC> y comience de nuevo.
+
+
+---> Hay algunas palabras pásalo bien que no pertenecen papel a esta frase.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 2.2: MÁS MANDATOS PARA BORRAR
+
+
+ ** Escriba d$ para borrar hasta el final de la línea. **
+
+
+ 1. Pulse <ESC> para asegurarse de que está en el modo Normal.
+
+ 2. Mueva el cursor a la línea de abajo señalada con --->.
+
+ 3. Mueva el cursor al final de la línea correcta (DESPUÉS del primer . ).
+
+ 4. Escriba d$ para borrar hasta el final de la línea.
+
+---> Alguien ha escrito el final de esta línea dos veces. esta línea dos veces.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 2.3: SOBRE MANDATOS Y OBJETOS
+
+
+ El formato del mandato de borrar d es como sigue:
+
+ [número] d objeto O d [número] objeto
+ donde:
+ número - es cuántas veces se ha de ejecutar el mandato (opcional, defecto=1).
+ d - es el mandato para borrar.
+ objeto - es sobre lo que el mandato va a operar (lista, abajo).
+
+ Una lista corta de objetos:
+ w - desde el cursor hasta el final de la palabra, incluyendo el espacio.
+ e - desde el cursor hasta el final de la palabra, SIN incluir el espacio.
+ $ - desde el cursor hasta el final de la línea.
+
+NOTE: Para los aventureros, pulsando sólo el objeto estando en modo Normal
+ sin un mandato moverá el cursor como se especifica en la lista de objetos.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 2.4: UNA EXCEPCIÓN AL 'MANDATO-OBJETO'
+
+ ** Escriba dd para borrar una línea entera. **
+
+ Debido a la frecuencia con que se borran líneas enteras, los diseñadores
+ de Vim decidieron que sería más fácil el escribir simplemente dos des en
+ una fila para borrar una línea.
+
+ 1. Mueva el cursor a la segunda línea de la lista de abajo.
+ 2. Escriba dd para borrar la línea.
+ 3. Muévase ahora a la cuarta línea.
+ 4. Escriba 2dd (recuerde número-mandato-objeto) para borrar las dos
+ líneas.
+
+ 1) Las rosas son rojas,
+ 2) El barro es divertido,
+ 3) El cielo es azul,
+ 4) Yo tengo un coche,
+ 5) Los relojes marcan la hora,
+ 6) El azucar es dulce,
+ 7) Y así eres tu.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 2.5: EL MANDATO DESHACER
+
+
+ ** Pulse u para deshacer los últimos mandatos,
+ U para deshacer una línea entera. **
+
+ 1. Mueva el cursor a la línea de abajo señalada con ---> y sitúelo bajo el
+ primer error.
+ 2. Pulse x para borrar el primer caráter erróneo.
+ 3. Pulse ahora u para deshacer el último mandato ejecutado.
+ 4. Ahora corrija todos los errores de la línea usando el mandato x.
+ 5. Pulse ahora U mayúscula para devolver la línea a su estado original.
+ 6. Pulse ahora u unas pocas veces para deshacer lo hecho por U y los
+ mandatos previos.
+ 7. Ahora pulse CTRL-R (mantenga pulsada la tecla CTRL y pulse R) unas
+ pocas veces para volver a ejecutar los mandatos (deshacer lo deshecho).
+
+---> Corrrija los errores dee esttta línea y vuuelva a ponerlos coon deshacer.
+
+ 8. Estos mandatos son muy útiles. Ahora pase al resumen de la Lección 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 2
+
+ 1. Para borrar desde el cursor hasta el final de una palabra pulse: dw
+
+ 2. Para borrar desde el cursor hasta el final de una línea pulse: d$
+
+ 3. Para borrar una línea enter pulse: dd
+
+ 4. El formato de un mandato en modo Normal es:
+
+ [número] mandato objeto O mandato [número] objeto
+ donde:
+ número - es cuántas veces se ha de ejecutar el mandato
+ mandato - es lo que hay que hacer, por ejemplo, d para borrar
+ objeto - es sobre lo que el mandato va a operar, por ejemplo
+ w (palabra), $ (hasta el final de la línea), etc.
+
+ 5. Para deshacer acciones previas pulse: u (u minúscula)
+ Para deshacer todos los cambios de una línea pulse: U (U mayúscula)
+ Para deshacer lo deshecho pulse: CTRL-R
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 3.1: EL MANDATO «PUT» (poner)
+
+ ** Pulse p para poner lo último que ha borrado después del cursor. **
+
+ 1. Mueva el cursor al final de la lista de abajo.
+
+ 2. Escriba dd para borrar la línea y almacenarla en el buffer de Vim.
+
+ 3. Mueva el cursor a la línea que debe quedar por debajo de la
+ línea a mover.
+
+ 4. Estando en mod Normal, pulse p para restituir la línea borrada.
+
+ 5. Repita los pasos 2 a 4 para poner todas las líneas en el orden correcto.
+
+ d) ¿Puedes aprenderla tu?
+ b) Las violetas son azules,
+ c) La inteligencia se aprende,
+ a) Las rosas son rojas,
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 3.2: EL MANDATO «REPLACE» (remplazar)
+
+
+ ** Pulse r y un carácter para sustituir el carácter sobre el cursor. **
+
+
+ 1. Mueva el cursor a la primera línea de abajo señalada con --->.
+
+ 2. Mueva el cursor para situarlo bajo el primer error.
+
+ 3. Pulse r y el carácter que debe sustituir al erróneo.
+
+ 4. Repita los pasos 2 y 3 hasta que la primera línea esté corregida.
+
+---> ¡Cuendo esta línea fue rscrita alguien pulso algunas teclas equibocadas!
+---> ¡Cuando esta línea fue escrita alguien pulsó algunas teclas equivocadas!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 3.3: EL MANDATO «CHANGE» (cambiar)
+
+
+ ** Para cambiar parte de una palabra o toda ella escriba cw . **
+
+
+ 1. Mueva el cursor a la primera línea de abajo señalada con --->.
+
+ 2. Sitúe el cursor en la u de lubrs.
+
+ 3. Escriba cw y corrija la palabra (en este caso, escriba 'ínea').
+
+ 4. Pulse <ESC> y mueva el cursor al error siguiente (el primer carácter
+ que deba cambiarse).
+
+ 5. Repita los pasos 3 y 4 hasta que la primera frase sea igual a la segunda.
+
+---> Esta lubrs tiene unas pocas pskavtad que corregir usem el mandato change.
+---> Esta línea tiene unas pocas palabras que corregir usando el mandato change.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 3.4: MÁS CAMBIOS USANDO c
+
+ ** El mandato change se utiliza con los mismos objetos que delete. **
+
+ 1. El mandato change funciona de la misma forma que delete. El formato es:
+
+ [número] c objeto O c [número] objeto
+
+ 2. Los objetos son tambiém los mismos, tales como w (palabra), $ (fin de
+ la línea), etc.
+
+ 3. Mueva el cursor a la primera línea de abajo señalada con --->.
+
+ 4. Mueva el cursor al primer error.
+
+ 5. Escriba c$ para hacer que el resto de la línea sea como la segunda
+ y pulse <ESC>.
+
+---> El final de esta línea necesita alguna ayuda para que sea como la segunda.
+---> El final de esta línea necesita ser corregido usando el mandato c$.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 3
+
+
+ 1. Para sustituir texto que ha sido borrado, pulse p . Esto Pone el texto
+ borrado DESPUÉS del cursor (si lo que se ha borrado es una línea se
+ situará sobre la línea que está sobre el cursor).
+
+ 2. Para sustituir el carácter bajo el cursor, pulse r y luego el
+ carácter que sustituirá al original.
+
+ 3. El mandato change le permite cambiar el objeto especificado desde la
+ posición del cursor hasta el final del objeto; e.g. Pulse cw para
+ cambiar desde el cursor hasta el final de la palabra, c$ para cambiar
+ hasta el final de la línea.
+
+ 4. El formato para change es:
+
+ [número] c objeto O c [número] objeto
+
+ Pase ahora a la lección siguiente.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 4.1: SITUACIÓN EN EL FICHERO Y SU ESTADO
+
+
+ ** Pulse CTRL-g para mostrar su situación en el fichero y su estado.
+ Pulse MAYU-G para moverse a una determinada línea del fichero. **
+
+ Nota: ¡¡Lea esta lección entera antes de ejecutar alguno de los pasos!!
+
+
+ 1. Mantenga pulsada la tecla Ctrl y pulse g . Aparece una línea de estado
+ al final de la pantalla con el nombre del fichero y la línea en la que
+ está situado. Recuerde el número de la línea para el Paso 3.
+
+ 2. Pulse Mayu-G para ir al final del fichero.
+
+ 3. Escriba el número de la línea en la que estaba y despúes Mayu-G. Esto
+ le volverá a la línea en la que estaba cuando pulsó Ctrl-g.
+ (Cuando escriba los números NO se mostrarán en la pantalla).
+
+ 4. Si se siente confiado en poder hacer esto ejecute los pasos 1 a 3.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 4.2: EL MANDATO «SEARCH» (buscar)
+
+ ** Escriba / seguido de una frase para buscar la frase. **
+
+ 1. En modo Normal pulse el carácter / . Fíjese que tanto el carácter /
+ como el cursor aparecen en la última línea de la pantalla, lo mismo
+ que el mandato : .
+
+ 2. Escriba ahora errroor <INTRO>. Esta es la palabra que quiere buscar.
+
+ 3. Para repetir la búsqueda, simplemente pulse n .
+ Para busacar la misma frase en la dirección opuesta, pulse Mayu-N .
+
+ 4. Si quiere buscar una frase en la dirección opuesta (hacia arriba),
+ utilice el mandato ? en lugar de / .
+
+---> Cuando la búsqueda alcanza el final del fichero continuará desde el
+ principio.
+
+ «errroor» no es la forma de deletrear error; errroor es un error.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 4.3: BÚSQUEDA PARA COMPROBAR PARÉNTESIS
+
+ ** Pulse % para encontrar el paréntesis correspondiente a ),] o } . **
+
+
+ 1. Sitúe el cursor en cualquiera de los caracteres ), ] o } en la línea de
+ abajo señalada con --->.
+
+ 2. Pulse ahora el carácter % .
+
+ 3. El cursor debería situarse en el paréntesis (, corchete [ o llave {
+ correspondiente.
+
+ 4. Pulse % para mover de nuevo el cursor al paréntesis, corchete o llave
+ correspondiente.
+
+---> Esto ( es una línea de prueba con (, [, ], {, y } en ella. )).
+
+Nota: ¡Esto es muy útil en la detección de errores en un programa con
+ paréntesis, corchetes o llaves disparejos.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 4.4: UNA FORMA DE CAMBIAR ERRORES
+
+
+ ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. **
+
+
+ 1. Mueva el cursor a la línea de abajo señalada con --->.
+
+ 2. Escriba :s/laas/las/ <INTRO> . Tenga en cuenta que este mandato cambia
+ sólo la primera aparición en la línea de la expresión a cambiar.
+
+---> Laas mejores épocas para ver laas flores son laas primaveras.
+
+ 4. Para cambiar todas las apariciones de una expresión ente dos líneas
+ escriba :#,#s/viejo/nuevo/g donde #,# son los números de las dos
+ líneas. Escriba :%s/viejo/nuevo/g para hacer los cambios en todo
+ el fichero.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 4
+
+
+ 1. Ctrl-g muestra la posición del cursor en el fichero y su estado.
+ Mayu-G mueve el cursor al final del fichero. Un número de línea
+ sewguido de Mayu-G mueve el cursor a la línea con ese número.
+
+ 2. Pulsando / seguido de una frase busca la frase hacia ADELANTE.
+ Pulsando ? seguido de una frase busca la frase hacia ATRÁS.
+ Después de una búsqueda pulse n para encontrar la aparición
+ siguiente en la misma dirección.
+
+ 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza
+ la pareja correspondiente.
+
+ 4. Para cambiar viejo por nuevo en una línea pulse :s/viejo/nuevo
+ Para cambiar todos los viejo por nuevo en una línea pulse :s/viejo/nuevo/g
+ Para cambiar frases entre dos números de líneas pulse :#,#s/viejo/nuevo/g
+ Para cambiar viejo por nuevo en todo el fichero pulse :%s/viejo/nuevo/g
+ Para pedir confirmación en cada caso añada 'c' :%s/viejo/nuevo/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 5.1: CÓMO EJECUTAR UN MANDATO EXTERNO
+
+
+ ** Escriba :! seguido de un mandato externo para ejecutar ese mandato. **
+
+
+ 1. Escriba el conocido mandato : para situar el cursor al final de la
+ pantalla. Esto le permitirá introducir un mandato.
+
+ 2. Ahora escriba el carácter ! (signo de admiración). Esto le permitirá
+ ejecutar cualquier mandato del sistema.
+
+ 3. Como ejemplo escriba ls después del ! y luego pulse <INTRO>. Esto
+ le mostrará una lista de su directorio, igual que si estuviera en el
+ símbolo del sistema. Si ls no funciona utilice !:dir .
+
+--->Nota: De esta manera es posible ejecutar cualquier mandato externo.
+
+--->Nota: Todos los mandatos : deben finalizarse pulsando <INTRO>.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 5.2: MÁS SOBRE GUARDAR FICHEROS
+
+
+ ** Para guardar los cambios hechos en un fichero,
+ escriba :w NOMBRE_DE_FICHERO. **
+
+
+ 1. Escriba :!dir o :!ls para ver una lista de su directorio.
+ Ya sabe que debe pulsar <INTRO> después de ello.
+
+ 2. Elija un nombre de fichero que todavía no exista, como TEST.
+
+ 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido).
+
+ 4. Esta acción guarda todo el fichero (Vim Tutor) bajo el nombre TEST.
+ Para comprobarlo escriba :!dir de nuevo y vea su directorio.
+
+---> Tenga en cuenta que si sale de Vim y entra de nuevo con el nombre de
+ fichero TEST, el fichero sería una copia exacta del tutor cuando lo
+ ha guardado.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 5.3: UN MANDATO DE ESCRITURA SELECTIVO
+
+ ** Para guardar parte del fuchero escriba :#,# NOMBRE_DEL_FICHERO **
+
+
+ 1. Escriba de nuevo, una vez más, :!dir o :!ls para obtener una lista
+ de su directorio y elija nombre de fichero adecuado, como TEST.
+
+ 2. Mueva el cursor al principio de la pantalla y pulse Ctrl-g para saber
+ el número de la línea correspondiente. ¡RECUERDE ESTE NÚMERO!
+
+ 3. Ahora mueva el cursor a la última línea de la pantalla y pulse Ctrl-g
+ de nuevo. ¡RECUERDE TAMBIÉN ESTE NÚMERO!
+
+ 4. Para guardar SOLAMENTE una parte de un fichero, escriba :#,# w TEST
+ donde #,# son los números que usted ha recordado (primera línea,
+ última línea) y TEST es su nombre de dichero.
+
+ 5. De nuevo, vea que el fichero esta ahí con :!dir pero NO lo borre.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 5.4: RECUPERANDO Y MEZCLANDO FICHEROS
+
+ ** Para insertar el contenido de un fichero escriba :r NOMBRE_DEL_FICHERO **
+
+ 1. Escriba :!dir para asegurarse de que su fichero TEST del ejercicio
+ anterior está presente.
+
+ 2. Situe el cursor al principio de esta pantalla.
+
+NOTA: Después de ejecutar el paso 3 se verá la Lección 5.3. Luego muévase
+ hacia ABAJO para ver esta lección de nuevo.
+
+ 3. Ahora recupere el fichero TEST utilizando el mandato :r TEST donde
+ TEST es el nombre del fichero.
+
+NOTA: El fichero recuperado se sitúa a partir de la posición del cursor.
+
+ 4. Para verificar que el fichero ha sido recuperado, mueva el cursor hacia
+ arriba y vea que hay dos copias de la Lección 5.3, la original y la
+ versión del fichero.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 5
+
+
+ 1. :!mandato ejecuta un mandato externo.
+
+ Algunos ejemplos útiles son:
+ :!dir - muestra el contenido de un directorio.
+ :!del NOMBRE_DE_FICHERO - borra el fichero NOMBRE_DE FICHERO.
+
+ 2. :#,#w NOMBRE_DE _FICHERO guarda desde las líneas # hasta la # en el
+ fichero NOMBRE_DE_FICHERO.
+
+ 3. :r NOMBRE_DE _FICHERO recupera el fichero del disco NOMBRE_DE FICHERO
+ y lo inserta en el fichero en curso a partir de la posición del cursor.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 6.1: EL MANDATO «OPEN» (abrir)
+
+
+ ** Pulse o para abrir una línea debajo del cursor
+ y situarle en modo Insert **
+
+
+ 1. Mueva el cursor a la línea de abajo señalada con --->.
+
+ 2. Pulse o (minúscula) para abrir una línea por DEBAJO del cursor
+ y situarle en modo Insert.
+
+ 3. Ahora copie la línea señalada con ---> y pulse <ESC> para salir del
+ modo Insert.
+
+---> Luego de pulsar o el cursor se sitúa en la línea abierta en modo Insert.
+
+ 4. Para abrir una línea por encima del cursor, simplemente pulse una O
+ mayúscula, en lugar de una o minúscula. Pruebe este en la línea siguiente.
+Abra una línea sobre ésta pulsando Mayu-O cuando el curso está en esta línea.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 6.2: EL MANDATO «APPEND» (añadir)
+
+ ** Pulse a para insertar texto DESPUÉS del cursor. **
+
+
+ 1. Mueva el cursor al final de la primera línea de abajo señalada con --->
+ pulsando $ en modo Normal.
+
+ 2. Escriba una a (minúscula) para añadir texto DESPUÉS del carácter
+ que está sobre el cursor. (A mayúscula añade texto al final de la línea).
+
+Nota: ¡Esto evita el pulsar i , el último carácter, el texto a insertar,
+ <ESC>, cursor a la derecha y, finalmente, x , sólo para añadir algo
+ al final de una línea!
+
+ 3. Complete ahora la primera línea. Nótese que append es exactamente lo
+ mismo que modo Insert, excepto por el lugar donde se inserta el texto.
+
+---> Esta línea le permitirá praticar
+---> Esta línea le permitirá praticar el añadido de texto al final de una línea.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 6.3: OTRA VERSIÓN DE «REPLACE» (remplazar)
+
+ ** Pulse una R mayúscula para sustituir más de un carácter. **
+
+
+ 1. Mueva el cursor a la primera línea de abajo señalada con --->.
+
+ 2. Sitúe el cursor al comienzo de la primera palabra que sea diferente
+ de las de la segunda línea marcada con ---> (la palabra 'anterior').
+
+ 3. Ahora pulse R y sustituya el resto del texto de la primera línea
+ escribiendo sobre el viejo texto para que la primera línea sea igual
+ que la primera.
+
+---> Para hacer que esta línea sea igual que la anterior use las teclas.
+---> Para hacer que esta línea sea igual que la siguiente escriba R y el texto.
+
+ 4. Nótese que cuando pulse <ESC> para salir, el texto no alterado permanece.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 6.4: FIJAR OPCIONES
+
+ ** Fijar una opción de forma que una búsqueda o sustitución ignore la caja **
+ (Para el concepto de caja de una letra, véase la nota al final del fichero)
+
+
+ 1. Busque 'ignorar' introduciendo:
+ /ignorar
+ Repita varias veces la búsque pulsando la tecla n
+
+ 2. Fije la opción 'ic' (Ignorar la caja de la letra) escribiendo:
+ :set ic
+
+ 3. Ahora busque 'ignorar' de nuevo pulsando n
+ Repita la búsqueda varias veces más pulsando la tecla n
+
+ 4. Fije las opciones 'hlsearch' y 'insearch':
+ :set hls is
+
+ 5. Ahora introduzca la orden de búsqueda otra vez, y vea qué pasa:
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RESUMEN DE LA LECCIÓN 6
+
+
+ 1. Pulsando o abre una línea por DEBAJO del cursor y sitúa el cursor en
+ la línea abierta en modo Insert.
+ Pulsando una O mayúscula se abre una línea SOBRE la que está el cursor.
+
+ 2. Pulse una a para insertar texto DESPUÉS del carácter sobre el cursor.
+ Pulsando una A mayúscula añade automáticamente texto al final de la
+ línea.
+
+ 3. Pulsando una R mayúscula se entra en modo Replace hasta que, para salir,
+ se pulse <ESC>.
+
+ 4. Escribiendo «:set xxx» fija la opción «xxx»
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lección 7: MANDATOS PARA LA AYUDA EN LÍNEA
+
+ ** Utilice el sistema de ayuda en línea **
+
+
+ Vim dispone de un sistema de ayuda en línea. Para activarlo, pruebe una
+ de estas tres formas:
+ - pulse la tecla <AYUDA> (si dispone de ella)
+ - pulse la tecla <F1> (si dispone de ella)
+ - escriba :help <INTRO>
+
+ Escriba :q <INTRO> para cerrar la ventana de ayuda.
+
+ Puede encontrar ayuda en casi cualquier tema añadiendo un argumento al
+ mandato «:help» mandato. Pruebe éstos:
+
+ :help w <INTRO>
+ :help c_<T <INTRO>
+ :help insert-index <INTRO>
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Aquí concluye el tutor de Vim. Está pensado para dar una visión breve del
+ editor Vim, lo suficiente para permitirle usar el editor de forma bastante
+ sencilla. Está muy lejos de estar completo pues Vim tiene muchísimos más
+ mandatos.
+
+ Para lecturas y estudios posteriores se recomienda el libro:
+ Learning the Vi Editor - por Linda Lamb
+ Editorial: O'Reilly & Associates Inc.
+ Es un buen libro para llegar a saber casi todo lo que desee hacer con Vi.
+ La sexta edición incluye también información sobre Vim.
+
+ Este tutorial ha sido escrito por Michael C. Pierce y Robert K. Ware,
+ Colorado School of Mines utilizando ideas suministradas por Charles Smith,
+ Colorado State University.
+ E-mail: bware@mines.colorado.edu.
+
+ Modificado para Vim por Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Traducido del inglés por:
+
+ Eduardo F. Amatria
+ Correo electrónico: eferna1@platea.pntic.mec.es
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr
new file mode 100644
index 000000000..bc566894b
--- /dev/null
+++ b/runtime/tutor/tutor.fr
@@ -0,0 +1,809 @@
+===============================================================================
+= B i e n v e n u e dans le T u t o r i e l de V I M - Version 1.5.fr.2 =
+===============================================================================
+
+ Vim est un éditeur très puissant qui a trop de commandes pour pouvoir
+ toutes les expliquer dans un cours comme celui-ci, qui est conçu pour en
+ décrire suffisamment afin de vous permettre d'utiliser simplement Vim.
+
+ Le temps requis pour suivre ce cours est d'environ 25 à 30 minutes, selon
+ le temps que vous passerez à expérimenter. Les commandes utilisées dans
+ les leçons modifieront le texte. Faites une copie de ce fichier afin de
+ vous entraîner dessus (si vous avez lancé "vimtutor" ceci est déjà une
+ copie).
+
+ Il est important de garder en tête que ce cours est conçu pour apprendre
+ par la pratique. Cela signifie que vous devez exécuter les commandes
+ pour les apprendre correctement. Si vous vous contentez de lire le
+ texte, vous oublierez les commandes !
+
+ Maintenant, vérifiez que votre clavier n'est PAS verouillé en majuscules,
+ et appuyez la touche j le nombre de fois suffisant pour que la leçon
+ 1.1 remplisse complètement l'écran.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 1.1 : DÉPLACEMENT DU CURSEUR
+
+
+ ** Pour déplacer le curseur, appuyez les touches h,j,k,l comme indiqué. **
+ ^
+ k Astuce: La touche h est à gauche et déplace à gauche.
+ < h l > La touche l est à droite et déplace à droite.
+ j La touche j ressemble à une flèche vers le bas.
+ v
+ 1. Déplacez le curseur sur l'écran jusqu'à vous sentir à l'aise.
+
+ 2. Maintenez la touche Bas (j) enfoncée jusqu'à ce qu'elle se répète.
+---> Maintenant vous êtes capable de vous déplacer jusqu'à la leçon suivante.
+
+ 3. En utilisant la touche Bas, allez à la Leçon 1.2.
+
+Note: Si jamais vous doutez de ce que vous venez de taper, appuyez <Échap>
+ pour revenir en mode Normal. Puis retapez la commande que vous vouliez.
+
+Note: Les touches fléchées devraient également fonctionner. Mais en utilisant
+ hjkl vous pourrez vous déplacer beaucoup plus rapidement, une fois que
+ vous aurez pris l'habitude.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 1.2 : ENTRÉE ET SORTIE DE VIM
+
+
+ !! NOTE: Avant d'effectuer les étapes ci-dessous, lisez toute cette leçon !!
+
+ 1. Appuyez la touche <Échap> (pour être sûr d'être en mode Normal).
+
+ 2. Tapez: :q! <Entrée>
+
+---> Ceci quitte l'éditeur SANS sauver les changements que vous avez faits.
+ Si vous voulez enregistrer les changements et sortir, tapez:
+ :wq <Entrée>
+
+ 3. Lorsque l'invite du 'shell' vous sera présentée, tapez la commande qui
+ vous a amené dans ce tutoriel. Cela pourrait être: vimtutor <Entrée>
+ Normalement, vous utiliseriez: vim tutor <Entrée>
+
+---> 'vim' lance l'éditeur, 'tutor' est le fichier que vous souhaitez éditer.
+
+ 4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes
+ 1 à 3 pour sortir puis rentrer dans l'éditeur. Déplacez ensuite le
+ curseur jusqu'à la Leçon 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 1.3 : ÉDITION DE TEXTE - EFFACEMENT
+
+
+ ** En mode Normal, appuyez x pour effacer le caractère sous le curseur. **
+
+ 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous.
+
+ 2. Pour corriger les erreurs, déplacez le curseur jusqu'à ce qu'il soit
+ sur un caractère à effacer.
+
+ 3. Appuyez la touche x pour effacer le caractère redondant.
+
+ 4. Répétez les étapes 2 à 4 jusqu'à ce que la phrase soit correcte.
+
+---> La vvache à sautéé au-ddessus dde la luune.
+
+ 5. Maintenant que la ligne est correcte, passez à la leçon 1.4.
+
+NOTE: En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par
+ la pratique.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 1.4 : ÉDITION DE TEXTE - INSERTION
+
+
+ ** En mode Normal, appuyez i pour insérer du texte. **
+
+ 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous.
+
+ 2. Pour rendre la première ligne identique à la seconde, mettez le curseur
+ sur le premier caractère APRÈS l'endroit où insérer le texte.
+
+ 3. Appuyez i et tapez les caractères qui manquent.
+
+ 4. Une fois qu'une erreur est corrigée, appuyez <Échap> pour revenir en mode
+ Normal. Répétez les étapes 2 à 4 pour corriger la phrase.
+
+---> Il mnqe caractères cette .
+---> Il manque des caractères dans cette ligne.
+
+ 5. Une fois que vous êtes à l'aise avec l'insertion de texte, allez au
+ résumé ci-dessous.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 1
+
+ 1. Le curseur se déplace avec les touches fléchées ou les touches hjkl.
+ h (gauche) j (bas) k (haut) l (droite)
+
+ 2. Pour entrer dans Vim (à l'invite %) tapez: vim FICHIER <Entrée>
+
+ 3. Pour quitter Vim tapez: <Échap> :q! <Entrée> pour perdre tous les
+ changements.
+ OU tapez: <Échap> :wq <Entrée> pour enregistrer les
+ changements.
+
+ 4. Pour effacer un caractère sous le curseur en mode Normal tapez: x
+
+ 5. Pour insérer du texte au niveau du curseur en mode Normal tapez:
+ i tapez le texte <Échap>
+
+NOTE: Appuyer <Échap> vous place en mode Normal ou annule une commande
+ partiellement tapée dont vous ne voudriez plus.
+
+Passez maintenant à la Leçon 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 2.1 : EFFACEMENTS
+
+
+ ** Tapez dw pour effacer jusqu'à la fin d'un mot. **
+
+ 1. Appuyez <Échap> pour être sûr d'être en mode Normal.
+
+ 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous.
+
+ 3. Placez le curseur sur le début d'un mot qui a besoin d'être effacé.
+
+ 4. Tapez dw pour faire disparaître ce mot.
+
+NOTE: Les lettres dw apparaîtront sur la dernière ligne de l'écran lors de
+ votre frappe. Si vous avez mal tapé quelque chose, appuyez <Échap> et
+ recommencez.
+
+---> Il y a quelques drôle mots qui n'ont rien à faire papier sur cette ligne.
+
+ 5. Répétez les étapes 3 et 4 jusqu'à ce que la phrase soit correcte et allez
+ à la Leçon 2.2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 2.2 : PLUS D'EFFACEMENTS
+
+
+ ** Tapez d$ pour effacer jusqu'à la fin de la ligne. **
+
+ 1. Appuyez <Échap> pour être sûr d'être en mode Normal.
+
+ 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous.
+
+ 3. Déplacez le curseur jusqu'à la fin correcte de la ligne
+ (APRÈS le premier . ).
+
+ 4. Tapez d$ pour effacer jusqu'à la fin de la ligne.
+
+---> Quelqu'un a tapé la fin de cette ligne deux fois. cette ligne deux fois.
+
+ 5. Allez à la Leçon 2.3 pour comprendre ce qui se passe.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 2.3 : DES COMMANDES ET DES OBJETS
+
+
+ Le format de la commande d'effacement d est le suivant:
+
+ [nombre] d objet OU d [nombre] objet
+ où:
+ nombre - est combien de fois exécuter la commande (optionnel, défaut: 1).
+ d - est la commande d'effacement.
+ objet - est ce sur quoi la commande va opérer (liste ci-dessous).
+
+ Une courte liste d'objets:
+ w - du curseur jusqu'à la fin du mot, y compris l'espace qui suit.
+ e - du curseur jusqu'à la fin du mot, SANS l'espace qui suit.
+ $ - du curseur jusqu'à la fin de la ligne.
+
+NOTE: Pour les aventureux, le seul appui d' objet en mode Normal, sans
+ commande, déplace le curseur comme indiqué dans la liste des objets.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 2.4 : UNE EXCEPTION À 'COMMANDE-OBJET'
+
+ ** Tapez dd pour effacer une ligne complète. **
+
+ Vu le nombre de fois où l'on efface des lignes complètes, les concepteurs
+ de Vi ont décidé qu'il serait plus facile de taper simplement deux d à la
+ suite pour effacer une ligne.
+
+ 1. Placez le curseur sur la seconde ligne de la phrase ci-dessous.
+ 2. Tapez dd pour effacer la ligne.
+ 3. Maintenant allez à la quatrième ligne.
+ 4. Tapez 2dd (rappelez-vous, nombre-commande-objet) pour effacer les
+ deux lignes.
+
+ 1) Les roses sont rouges,
+ 2) La boue c'est drôle,
+ 3) Les violettes sont bleues,
+ 4) J'ai une voiture,
+ 5) Les horloges donnent l'heure,
+ 6) Le sucre est doux
+ 7) Tout comme vous.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 2.5 : L'ANNULATION
+
+ ** Tapez u pour annuler les dernières commandes. **
+ ** Tapez U pour récupérer toute une ligne. **
+
+ 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous et placez-le sur
+ la première erreur.
+ 2. Tapez x pour effacer le premier caractère redondant.
+ 3. Puis tapez u pour annuler la dernière commande exécutée.
+ 4. Cette fois, corrigez toutes les erreurs de la ligne avec la commande x .
+ 5. Puis tapez un U majuscule pour remettre la ligne dans son état initial.
+ 6. Puis tapez u deux-trois fois pour annuler le U et les commandes
+ précédentes.
+ 7. Maintenant tapez Ctrl-R (maintenez la touche Ctrl enfoncée pendant que
+ vous appuyez sur R) deux-trois fois pour refaire les commandes (annuler
+ les annulations).
+
+---> Coorrigez les erreurs suur ccette ligne et reemettez-les avvec 'annuler'.
+
+ 8. Ce sont des commandes très utiles. Maintenant, allez au résumé de la
+ Leçon 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 2
+
+
+ 1. Pour effacer du curseur jusqu'à la fin d'un mot tapez: dw
+
+ 2. Pour effacer du curseur jusqu'à la fin d'une ligne tapez: d$
+
+ 3. Pour effacer toute une ligne tapez: dd
+
+ 4. Le format d'une commande en mode Normal est:
+
+ [nombre] commande objet OU commande [nombre] objet
+ où:
+ nombre - est combien de fois répéter la commande
+ commande - est ce qu'il faut faire, par exemple d pour effacer
+ objet - est ce sur quoi la commande devrait agir, par exemple w (mot),
+ $ (jusqu'à la fin de la ligne), etc.
+
+ 5. Pour annuler des actions précédentes, tapez: u (u minuscule)
+ Pour annuler tous les changements sur une ligne tapez: U (U majuscule)
+ Pour annuler l'annulation tapez: Ctrl-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 3.1 : LE COLLAGE
+
+
+ ** Tapez p pour placer après le curseur ce qui vient d'être effacé. **
+
+ 1. Placez le curseur sur la première ligne du "poème" ci-dessous.
+
+ 2. Tapez dd pour effacer la ligne et la placer dans le tampon de Vim.
+
+ 3. Déplacez le curseur sur la ligne qui PRÉCÈDE l'endroit où vous voulez
+ remettre la ligne effacée.
+
+ 4. En mode Normal, tapez p pour remettre la ligne.
+
+ 5. Répétez les étapes 2 à 4 pour mettre toutes les lignes dans le bon ordre.
+
+ d) Et vous, qu'apprenez-vous ?
+ b) Les violettes sont bleues,
+ c) L'intelligence s'apprend,
+ a) Les roses sont rouges,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 3.2 : LE REMPLACEMENT
+
+
+ ** Tapez r et un caractère pour remplacer le caractère sous le curseur. **
+
+ 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous.
+
+ 2. Placez le curseur de manière à ce qu'il surplombe la première erreur.
+
+ 3. Tapez r suivi du caractère qui doit corriger l'erreur.
+
+ 4. Répétez les étapes 2 et 3 jusqu'à ce que la première ligne soit correcte.
+
+---> Quand cette ligne a été sauvie, quelqu'un a lait des faunes de frappe !
+---> Quand cette ligne a été saisie, quelqu'un a fait des fautes de frappe !
+
+ 5. Maintenant, allez à la Leçon 3.3.
+
+NOTE: N'oubliez pas que vous devriez apprendre par la pratique, pas par
+ mémorisation.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 3.3 : LE CHANGEMENT
+
+
+ ** Pour changer tout ou partie d'un mot, tapez cw .**
+
+ 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous.
+
+ 2. Placez le curseur sur le u de luhko.
+
+ 3. Tapez cw et corrigez le mot (dans notre cas, tapez 'igne'.)
+
+ 4. Appuyez <Échap> et placez-vous sur l'erreur suivante (le premier
+ caractère qui doit être changé).
+
+ 5. Répétez les étapes 3 et 4 jusqu'à ce que la première phrase soit
+ identique à la seconde.
+
+---> Cette luhko contient quelques myqa qui ont ricne d'être chantufip.
+---> Cette ligne contient quelques mots qui ont besoin d'être changés.
+
+Notez que cw efface le mot et vous place ensuite en mode Insertion.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 3.4 : PLUS DE CHANGEMENTS AVEC c
+
+
+ ** Le changement fonctionne avec les mêmes objets que l'effacement. **
+
+ 1. Le changement fonctionne de la même manière que l'effacement.
+ Le format est:
+
+ [nombre] c objet OU c [nombre] objet
+
+ 2. Les objets sont également les mêmes: w (mot), $ (fin de ligne), etc.
+
+ 3. Déplacez-vous à la première ligne marquée ---> ci-dessous.
+
+ 4. Placez le curseur sur la première erreur.
+
+ 5. Tapez c$ pour changer la fin de la ligne, rendez-là identique à la
+ seconde ligne, puis tapez <Échap>.
+
+---> La fin de cette ligne doit être rendue identique à la seconde.
+---> La fin de cette ligne doit être corrigée avec la commande c$ .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 3
+
+
+ 1. Pour remettre du texte qui vient d'être effacé, tapez p . Cela Place le
+ texte effacé APRÈS le curseur (si une ligne complète a été effacée, elle
+ sera placée sous la ligne du curseur).
+
+ 2. Pour remplacer le caractère sous le curseur, tapez r suivi du caractère
+ qui remplacera l'original.
+
+ 3. Le changement vous permet de changer l'objet spécifié, du curseur jusqu'à
+ la fin de l'objet. Par exemple, tapez cw pour changer du curseur
+ jusqu'à la fin du mot, c$ pour changer jusqu'à la fin d'une ligne.
+
+ 4. Le format pour le changement est:
+
+ [nombre] c objet OU c [nombre] objet
+
+Passez maintenant à la leçon suivante.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 4.1 : POSITION ET ÉTAT DU FICHIER
+
+
+ ** Tapez Ctrl-G pour afficher votre position dans le fichier et son état.
+ Utilisez Maj-G pour vous rendre à une ligne donnée du fichier. **
+
+ Note: Lisez toute cette leçon avant d'effectuer l'une des étapes !
+
+ 1. Maintenez enfoncée la touche Ctrl et appuyez sur G . Une ligne d'état
+ va apparaître en bas de l'écran avec le nom du fichier et le numéro de la
+ ligne où vous êtes. Notez ce numéro, il servira lors de l'étape 3.
+
+ 2. Tapez G majuscule (Maj-G) pour vous rendre à la fin du fichier.
+
+ 3. Tapez le numéro de la ligne où vous étiez suivi de Maj-G. Cela vous
+ ramènera à la ligne où vous étiez au départ.
+ (Lorsque vous tapez les chiffres, ils n'apparaissent PAS à l'écran).
+
+ 4. Si vous vous sentez prêt à faire ceci, effectuez les étapes 1 à 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 4.2 : LA RECHERCHE
+
+
+ ** Tapez / suivi d'un texte pour rechercher ce texte. **
+
+ 1. Tapez le caractère / en mode Normal. Notez que celui-ci et le curseur
+ apparaissent en bas de l'écran, comme lorsque l'on utilise : .
+
+ 2. Puis tapez 'errreuur' <Entrée>. C'est le mot que vous voulez rechercher.
+
+ 3. Pour rechercher à nouveau le même texte, tapez simplement n .
+ Pour rechercher le même texte dans la direction opposée, tapez Maj-N .
+
+ 4. Si vous voulez rechercher un texte vers le haut du fichier, utilisez ?
+ à la place de / .
+
+---> erreur ne s'écrit pas "errreuur"; errreuur est une erreur.
+
+Note: Quand la recherche atteint la fin du fichier, elle reprend au début.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 4.3 : RECHERCHE DES PARENTHÈSES CORRESPONDANTES
+
+
+ ** Tapez % pour trouver des ), ] ou } correspondants. **
+
+ 1. Placez le curseur sur l'un des (, [ ou { de la ligne marquée --->
+ ci-dessous.
+
+ 2. Puis tapez le caractère % .
+
+ 3. Le curseur devrait se placer sur la parenthèse correspondante.
+
+ 4. Tapez % pour replacer le curseur sur l'autre parenthèse.
+
+---> Voici ( une ligne de test contenant des (, des [ ] et des { } )).
+
+Note: Cette fonctionnalité est très utile lors du débogage d'un programme qui
+ contient des parenthèses déséquilibrées !
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 4.4 : UNE MANIÈRE DE CORRIGER LES ERREURS
+
+
+ ** Tapez :s/ancien/nouveau/g pour remplacer 'ancien' par 'nouveau'. **
+
+ 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous.
+
+ 2. Tapez :s/lee/le <Entrée> . Notez que cette commande change seulement la
+ première occurence sur la ligne.
+
+ 3. Puis tapez :s/lee/le/g qui ordonne de faire une substitution globale
+ sur la ligne. Cela change toutes les occurences sur la ligne
+
+---> lee meilleur moment pour regarder lees fleurs est pendant lee Printemps.
+
+ 4. Pour changer toutes les occurences d'un texte, entre deux lignes,
+ tapez :#,#s/ancien/nouveau/g où #,# sont les numéros des deux lignes.
+ Tapez :%s/ancien/nouveau/g pour changer chaque occurence dans tout
+ le fichier.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 4
+
+
+ 1. Ctrl-G affiche votre position dans le fichier et l'état de celui-ci.
+ Maj-G vous place à la fin du fichier. Un numéro de ligne suivi de Maj-G
+ vous place à cette ligne.
+
+ 2. Taper / suivi d'un texte recherche ce texte vers l'AVANT.
+ Taper ? suivi d'un texte recherche ce texte vers l'ARRIÈRE.
+ Après une recherche tapez n pour trouver l'occurence suivante dans la
+ même direction ou Maj-N pour rechercher dans la direction opposée.
+
+ 3. Taper % lorsque le curseur est sur (, ), [, ], { ou } déplace
+ celui-ci sur le caractère correspondant.
+
+ 4. Pour remplacer le premier aa par bb sur une ligne tapez :s/aa/bb
+ Pour remplacer tous les aa par bb sur une ligne tapez :s/aa/bb/g
+ Pour remplacer du texte entre deux numéros de ligne tapez :#,#s/aa/bb/g
+ Pour remplacer toutes les occurences dans le fichier tapez :%s/aa/bb/g
+ Pour demander une confirmation à chaque fois ajoutez 'c' :%s/aa/bb/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 5.1 : COMMENT EXÉCUTER UNE COMMANDE EXTERNE
+
+
+ ** Tapez :! suivi d'une commande externe pour exécuter cette commande. **
+
+ 1. Tapez le : familier pour mettre le curseur en bas de l'écran. Cela vous
+ permet de saisir une commande.
+
+ 2. Puis tapez un ! (point d'exclamation). Cela vous permet d'exécuter
+ n'importe quelle commande valide pour votre interpréteur (shell).
+
+ 3. Par exemple, tapez ls après le ! et appuyez <Entrée>. Ceci affichera
+ la liste des fichiers du dossier courant, comme si vous aviez tapé la
+ commande à l'invite du shell. Utilisez :!dir si :!ls ne marche pas.
+
+Note: Il est possible d'exécuter n'importe quelle commande externe de cette
+ manière.
+
+Note: Toutes les commandes : doivent finir par la frappe de <Entrée>.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 5.2 : PLUS DE DÉTAILS SUR L'ENREGISTREMENT DE FICHIERS
+
+
+ ** Pour enregistrer les changements faits au fichier, tapez :w FICHIER . **
+
+ 1. Tapez :!dir ou :!ls pour avoir la liste des fichiers du dossier
+ courant. Vous savez déjà qu'il faut appuyer <Entrée> après cela.
+
+ 2. Choisissez un nom de fichier qui n'existe pas encore, par exemple TEST.
+
+ 3. Puis tapez :w TEST (où TEST est le nom que vous avez choisi).
+
+ 4. Cela sauvegarde tout le fichier (Tutoriel Vim) sous le nom TEST.
+ Pour le vérifier, tapez :!dir pour revisualiser le contenu du dossier.
+
+Notez que si vous quittez Vim et y retournez avec le fichier TEST, celui-ci
+sera une copie exacte du cours au moment où vous l'avez sauvé.
+
+ 5. Maintenant, effacez le fichier en tapant (MS-DOS): :!del TEST
+ ou (Unix): :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 5.3 : UN ENREGISTREMENT SÉLECTIF
+
+
+ ** Pour enregistrer une portion de fichier, tapez :#,#w FICHIER **
+
+ 1. Tapez à nouveau :!dir ou :!ls pour visualiser le contenu du dossier
+ courant et choisissez un nom de fichier, tel que TEST.
+
+ 2. Déplacez le curseur jusqu'en haut de cette page et tapez Ctrl-G pour
+ connaître le numéro de cette ligne. NOTEZ CE NUMÉRO !
+
+ 3. Puis rendez-vous au bas de cette page et tapez à nouveau Ctrl-G .
+ NOTEZ ÉGALEMENT CE NUMÉRO !
+
+ 4. Pour enregistrer SEULEMENT une portion d'un fichier, tapez :#,#w TEST
+ où #,# sont les deux numéros que vous avez notés (haut,bas) et TEST est
+ le nom du fichier.
+
+ 5. Une fois encore, vérifiez la présence du fichier avec :!dir mais NE
+ L'EFFACEZ PAS.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 5.4 : RÉCUPÉRATION ET FUSION DE FICHIERS
+
+
+ ** Pour insérer le contenu d'un fichier, tapez :r FICHIER **
+
+ 1. Tapez :!dir pour vérifier que votre fichier TEST est encore là.
+
+ 2. Placez le curseur en haut de cette page.
+
+NOTE: Après avoir suivi l'étape 3 vous verrez à l'écran la Leçon 5.3.
+ Déplacez-vous vers le bas jusqu'à revenir à cette leçon.
+
+ 3. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST
+ où TEST est le nom de votre fichier.
+
+NOTE: Le fichier que vous récupérez est placé là où se trouve le curseur.
+
+ 4. Pour vérifier que le fichier a bien été inséré, remontez et vérifiez
+ qu'il y a maintenant deux copies de la Leçon 5.3, l'originale et celle
+ contenue dans le fichier.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 5
+
+
+ 1. :!commande exécute une commande externe.
+
+ Quelques exemples pratiques:
+ (MS-DOS) (Unix)
+ :!dir :!ls affiche le contenu du dossier courant.
+ :!del FICHIER :!rm FICHIER efface FICHIER.
+
+ 2. :w FICHIER enregistre le fichier Vim courant sur le disque avec pour
+ nom FICHIER.
+
+ 3. :#,#w FICHIER enregistre les lignes # à # dans le fichier FICHIER.
+
+ 4. :r FICHIER récupère le fichier FICHIER et l'insère dans le fichier
+ courant à partir de la position du curseur.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 6.1 : L'OUVERTURE
+
+
+** Tapez o pour ouvrir une ligne sous le curseur et y aller en Insertion. **
+
+ 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous.
+
+ 2. Tapez o (minuscule) pour ouvrir une ligne SOUS le curseur et vous y
+ placer en mode Insertion.
+
+ 3. Puis recopiez la ligne marquée ---> et appuyez sur <Échap> pour quitter
+ le mode Insertion.
+
+---> En tapant o le curseur se met sur la ligne ouverte, en mode Insertion.
+
+ 4. Pour ouvrir une ligne au DESSUS du curseur, tapez simplement un O
+ majuscule, plutôt qu'un o minuscule. Faites un essai sur la ligne
+ ci-dessous.
+Ouvrez une ligne ci-dessus en tapant MAJ-O lorsque le curseur est ici.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 6.2 : L'AJOUT
+
+
+ ** Tapez a pour insérer du texte APRÈS le curseur. **
+
+ 1. Placez le curseur à la fin de la première ligne marquée ---> ci-dessous
+ en tapant $ en mode Normal.
+
+ 2. Tapez un a (minuscule) pour ajouter du texte APRÈS le caractère situé
+ sous le curseur. ( A majuscule ajoute du texte à la fin de la ligne).
+
+Note: Ceci évite de taper i , le dernier caractère, le texte à insérer,
+ <Échap>, curseur-à-droite, et finalement x , juste pour ajouter du
+ texte à la fin d'une ligne !
+
+ 3. Maintenant, complétez la première ligne. Notez également que l'ajout est
+ identique au mode Insertion, hormis la position où le texte est inséré.
+
+---> Cette ligne vous permet de pratiquer
+---> Cette ligne vous permet de pratiquer l'ajout de texte en fin de ligne.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 6.3 : UNE AUTRE VERSION DU REMPLACEMENT
+
+
+ ** Tapez un R majuscule pour remplacer plus d'un caractère. **
+
+ 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous.
+
+ 2. Placez le curseur au début du premier mot qui diffère de la seconde ligne
+ marquée ---> (le mot 'celle').
+
+ 3. Puis tapez R et remplacez le reste du texte de la première ligne en
+ tapant par dessus celui-ci, de manière à rendre la première ligne
+ identique à la seconde.
+
+---> Pour rendre cette ligne identique à celle du dessous utilisez le clavier.
+---> Pour rendre cette ligne identique à la seconde, tapez R et la correction.
+
+ 4. Notez que lorsque vous appuyez <Échap>, le texte qui n'a pas encore été
+ remplacé reste.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 6.4 : RÉGLAGE DES OPTIONS
+
+
+ ** Réglons une option afin que la recherche et la substitution ignorent la
+ casse des caractères. **
+
+ 1. Recherchez 'ignore' en tapant /ignore .
+ Répétez ceci plusieurs fois en utilisant la touche n .
+
+ 2. Activez l'option 'ic' (Ignorer casse) en tapant :set ic .
+
+ 3. Puis poursuivez votre recherche en utilisant n .
+ Répétez cette recherche plusieurs fois avec la touche n .
+
+ 4. Activez les options 'hlsearch' et 'incsearch' avec :set hls is .
+
+ 5. Puis recommencez une recherche, et faites bien attention à ce qui se
+ produit: /ignore .
+
+ 6. Pour interrompre la mise en surbrillance des résultats, tapez:
+ :nohlsearch
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ RÉSUMÉ DE LA LEÇON 6
+
+
+ 1. Taper o ouvre une ligne SOUS le curseur et y place celui-ci en mode
+ Insertion. Taper un O majuscule ouvre une ligne au DESSUS de la ligne
+ où se trouve le curseur.
+
+ 2. Tapez un a pour insérer du texte APRÈS le caractère où se trouve le
+ curseur. Taper un A majuscule ajoute du texte automatiquement à la fin
+ de la ligne.
+
+ 3. Taper un R majuscule active le mode Remplacement jusqu'à ce que la
+ touche <Échap> soit appuyée pour en sortir.
+
+ 4. Taper :set xxx active l'option 'xxx'.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 7 : ACCÉDER À L'AIDE EN LIGNE
+
+ ** Utiliser le système d'aide en ligne. **
+
+ Vim a un système complet d'aide en ligne. Pour y accéder, essayez l'une de
+ ces trois méthodes:
+ - appuyez la touche <Help> (si vous en avez une)
+ - appuyez la touche <F1> (si vous en avez une)
+ - tapez :help <Entrée>
+
+ Tapez :q <Entrée> pour fermer la fenêtre d'aide.
+
+ Vous pouvez accéder à l'aide sur à peu près n'importe quel sujet en donnant
+ des arguments à la commande :help . Essayez par exemple (n'oubliez pas
+ d'appuyer sur <Entrée>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leçon 8 : CRÉER UN SCRIPT DE DÉMARRAGE
+
+ ** Activer les fonctionnalités de Vim. **
+
+ Vim a beaucoup plus de fonctionnalités que Vi, mais la plupart de celles-ci
+ sont désactivées par défaut. Pour commencer à les utiliser, vous devez
+ créer un fichier "vimrc".
+
+ 1. Commencez à éditer le fichier "vimrc". Ceci dépend de votre système:
+ :edit ~/.vimrc pour Unix
+ :edit $VIM/_vimrc pour MS-Windows
+
+ 2. Intégrez maintenant le texte du fichier "vimrc" d'exemple:
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Enregistrez le fichier avec:
+ :write
+
+ La prochaine fois que vous démarrerez Vim, le surlignage syntactique sera
+ activé. Vous pouvez ajouter tous vos réglages préférés dans ce fichier.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Ceci conclut le Tutoriel Vim. Le but était de vous donner un bref aperçu de
+ l'éditeur Vim, juste assez pour vous permettre d'utiliser l'éditeur
+ relativement facilement. Il est loin d'être complet, vu que Vim a beaucoup
+ beaucoup plus de commandes. Un Manuel de l'utilisateur est disponible en
+ anglais: :help user-manual .
+
+ Pour continuer à découvrir et à apprendre Vim, il existe un livre traduit en
+ français. Il parle plus de Vi que de Vim, mais pourra vous être utile.
+ L'éditeur Vi - Collection Précis et concis - par Arnold Robbins
+ Éditeur: O'Reilly France
+ ISBN: 2-84177-102-4
+
+ Deux livres en anglais sont également mentionnés dans la version originale
+ de ce tutoriel, dont un qui traite spécifiquement de Vim. Merci de vous y
+ référer si vous êtes intéressé.
+
+ Ce tutoriel a été écrit par Michael C. Pierce et Robert K. Ware de l'École
+ des Mines du Colorado et reprend des idées fournies par Charles Smith,
+ Universté d'État du Colorado. E-mail: bware@mines.colorado.edu.
+
+ Modifié pour Vim par Bram Moolenar.
+
+ Traduit en Français par Adrien Beau, en avril 2001.
+ E-mail: version.francaise@free.fr
+ Last Change: 2003 May 29
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.gr b/runtime/tutor/tutor.gr
new file mode 100644
index 000000000..528977b04
--- /dev/null
+++ b/runtime/tutor/tutor.gr
@@ -0,0 +1,815 @@
+===============================================================================
+= Ê áë ù ó Þ ñ è á ô å ó ô ï V I M T u t o r - ¸êäïóç 1.5 =
+===============================================================================
+
+ Ï Vim åßíáé Ýíáò ðáíßó÷õñïò óõíôÜêôçò ðïõ Ý÷åé ðïëëÝò åíôïëÝò, ðÜñá
+ ðïëëÝò ãéá íá åîçãÞóïõìå óå ìßá ðåñéÞãçóç üðùò áõôÞ. ÁõôÞ ç ðåñéÞãçóç
+ ó÷åäéÜóôçêå ãéá íá ðåñéãñÜøåé éêáíïðïéçôéêÜ ôéò åíôïëÝò ðïõ èá óáò
+ êÜíïõí íá ÷ñçóéìïðïéåßôå åýêïëá ôïí Vim óáí Ýíáí ãåíéêÞò ÷ñÞóçò óõíôÜêôç.
+
+ Ï êáôÜ ðñïóÝããéóç ÷ñüíïò ðïõ áðáéôåßôáé ãéá íá ïëïêëçñþóåôå ôçí ðåñéÞãçóç
+ åßíáé 25-30 ëåðôÜ, åîáñôþíôáò áðü ôï ðüóï ÷ñüíï èá îïäÝøåôå ãéá
+ ðåéñáìáôéóìïýò.
+
+ Ïé åíôïëÝò óôá ìáèÞìáôá èá ôñïðïðïéÞóïõí ôï êåßìåíï. ÄçìéïõñãÞóôå Ýíá
+ áíôßãñáöï áõôïý ôïõ áñ÷åßïõ ãéá íá åîáóêçèåßôå (áí îåêéíÞóáôå ôï
+ "Vimtutor" áõôü åßíáé Þäç Ýíá áíôßãñáöï).
+
+ Åßíáé óçìáíôéêü íá èõìÜóôå üôé áõôÞ ç ðåñéÞãçóç åßíáé ïñãáíùìÝíç Ýôóé
+ þóôå íá äéäÜóêåé ìÝóù ôçò ÷ñÞóçò. Áõôü óçìáßíåé üôé ÷ñåéÜæåôáé íá
+ åêôåëåßôå ôéò åíôïëÝò ãéá íá ôéò ìÜèåôå óùóôÜ. Áí äéáâÜæåôå ìüíï ôï
+ êåßìåíï, èá ôéò îå÷Üóåôå!
+
+ Ôþñá, âåâáéùèåßôå üôé ôï ðëÞêôñï Shift-Lock ÄÅÍ åßíáé ðáôçìÝíï êáé
+ ðáôÞóôå ôï ðëÞêôñï j áñêåôÝò öïñÝò ãéá íá ìåôáêéíÞóåôå ôïí äñïìÝá Ýôóé
+ þóôå ôï ÌÜèçìá 1.1 íá ãåìßóåé ðëÞñùò ôçí ïèüíç.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 1.1: ÌÅÔÁÊÉÍÏÍÔÁÓ ÔÏÍ ÄÑÏÌÅÁ
+
+ ** Ãéá íá êéíÞóåôå ôïí äñïìÝá, ðáôÞóôå ôá ðëÞêôñá h,j,k,l üðùò äåß÷íåôáé. **
+ ^
+ k Hint: Ôï ðëÞêôñï h åßíáé áñéóôåñÜ êáé êéíåß óô' áñéóôåñÜ.
+ < h l > Ôï ðëÞêôñï l åßíáé äåîéÜ êáé êéíåß óôá äåîéÜ.
+ j Ôï ðëÞêôñï j ìïéÜæåé ìå âåëÜêé ðñïò ôá êÜôù.
+ v
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá ôñéãýñù óôçí ïèüíç ìÝ÷ñé íá íïéþèåôå Üíåôá.
+
+ 2. ÊñáôÞóôå ðáôçìÝíï ôï êÜôù ðëÞêôñï (j) ìÝ÷ñé íá åðáíáëçöèåß.
+---> Ôþñá îÝñåôå ðþò íá ìåôáêéíçèåßôå óôï åðüìåíï ìÜèçìá.
+
+ 3. ×ñçóéìïðïéþíôáò ôï êÜôù ðëÞêôñï, ìåôáêéíçèåßôå óôï ÌÜèçìá 1.2.
+
+Óçìåßùóç: Áí áìöéâÜëëåôå ãéá êÜôé ðïõ ðáôÞóáôå, ðáôÞóôå <ESC> ãéá íá âñåèåßôå
+ óôçí ÊáíïíéêÞ ÊáôÜóôáóç. ÌåôÜ ðáôÞóôå îáíÜ ôçí åíôïëÞ ðïõ èÝëáôå.
+
+Óçìåßùóç: Ôá ðëÞêôñá ôïõ äñïìÝá èá ðñÝðåé åðßóçò íá äïõëåýïõí. ÁëëÜ ìå ôá hjkl
+ èá ìðïñåßôå íá êéíçèåßôå ðïëý ãñçãïñüôåñá, ìüëéò ôá óõíçèßóåôå.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 1.2: ÌÐÁÉÍÏÍÔÁÓ ÊÁÉ ÂÃÁÉÍÏÍÔÁÓ ÓÔÏÍ VIM
+
+ !! ÓÇÌÅÉÙÓÇ: Ðñéí åêôåëÝóåôå êÜðïéï áðü ôá âÞìáôá, äéáâÜóôå üëï ôï ìÜèçìá!!
+
+ 1. ÐáôÞóôå ôï ðëÞêôñï <ESC> (ãéá íá åßóôå óßãïõñá óôçí ÊáíïíéêÞ ÊáôÜóôáóç).
+
+ 2. ÐëçêôñïëïãÞóôå: :q! <ENTER>.
+
+---> Áõôü åîÝñ÷åôáé áðü ôïí óõíôÜêôç ×ÙÑÉÓ íá óþóåé üðïéåò áëëáãÝò Ý÷åôå êÜíåé.
+ Áí èÝëåôå íá óþóåôå ôéò áëëáãÝò êáé íá åîÝñèåôå ðëçêôñïëïãÞóôå:
+ :wq <ENTER>
+
+ 3. ¼ôáí äåßôå ôçí ðñïôñïðÞ ôïõ öëïéïý, ðëçêôñïëïãÞóôå ôçí åíôïëÞ ìå ôçí ïðïßá
+ ìðÞêáôå óå áõôÞí ôçí ðåñéÞãçóç. Ìðïñåß íá åßíáé: vimtutor <ENTER>
+ ÊáíïíéêÜ èá ÷ñçóéìïðïéïýóáôå: vim tutor <ENTER>
+
+---> 'vim' óçìáßíåé åéóáãùãÞ óôïí óõíôÜêôç vim, 'tutor' åßíáé ôï áñ÷åßï ðïõ
+ èÝëïõìå íá äéïñèþóïõìå.
+
+ 4. Áí Ý÷åôå áðïìíçìïíåýóåé áõôÜ ôá âÞìáôá êáé Ý÷åôå áõôïðåðïßèçóç, åêôåëÝóôå
+ ôá âÞìáôá 1 Ýùò 3 ãéá íá âãåßôå êáé íá ìðåßôå îáíÜ óôïí óõíôÜêôç. ÌåôÜ
+ ìåôáêéíÞóôå ôïí äñïìÝá êÜôù óôï ÌÜèçìá 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 1.3: ÄÉÏÑÈÙÓÇ ÊÅÉÌÅÍÏÕ - ÄÉÁÃÑÁÖÇ
+
+ ** ¼óï åßóôå óôçí ÊáíïíéêÞ ÊáôÜóôáóç ðáôÞóôå x ãéá íá äéáãñÜøåôå ôïí
+ ÷áñáêôÞñá êÜôù áðü ôïí äñïìÝá. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå --->.
+
+ 2. Ãéá íá äéïñèþóåôå ôá ëÜèç, êéíåßóôå ôïí äñïìÝá ìÝ÷ñé íá åßíáé ðÜíù áðü
+ ôïí ÷áñáêôÞñá ðïõ èá äéáãñáöåß.
+
+ 3. ÐáôÞóôå ôï ðëÞêôñï x ãéá íá äéáãñÜøåôå ôïí áíåðéèýìçôï ÷áñáêôÞñá.
+
+ 4. ÅðáíáëÜâåôå ôá âÞìáôá 2 ìÝ÷ñé 4 ìÝ÷ñé ç ðñüôáóç íá åßíáé óùóôÞ.
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. Ôþñá ðïõ ç ãñáììÞ åßíáé óùóôÞ, ðçãáßíôå óôï ÌÜèçìá 1.4.
+
+ÓÇÌÅÉÙÓÇ: Êáèþò äéáôñÝ÷åôå áõôÞí ôçí ðåñéÞãçóç, ðñïóðáèÞóôå íá ìçí
+ áðïìíçìïíåýåôå, ìáèáßíåôå ìå ôç ÷ñÞóç.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 1.4: ÄÉÏÑÈÙÓÇ ÊÅÉÌÅÍÏÕ - ÐÁÑÅÌÂÏËÇ
+
+ ** ¼óï åßóôå óå ÊáíïíéêÞ ÊáôÜóôáóç ðáôÞóôå i ãéá íá ðáñåìâÜëëåôå êåßìåíï. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá ìÝ÷ñé ôçí ðñþôç ãñáììÞ ðáñáêÜôù óçìåéùìÝíç ìå --->.
+
+ 2. Ãéá íá êÜíåôå ôçí ðñþôç ãñáììÞ ßäéá ìå ôçí äåýôåñç, ìåôáêéíåßóôå ôïí
+ äñïìÝá ðÜíù óôïí ðñþôï ÷áñáêôÞñá ÌÅÔÁ áðü üðïõ èá ðáñåìâëçèåß ôï êåßìåíï.
+
+ 3. ÐáôÞóôå ôï i êáé ðëçêôñïëïãÞóôå ôéò áðáñáßôçôåò ðñïóèÞêåò.
+
+ 4. Êáèþò äéïñèþíåôå êÜèå ëÜèïò ðáôÞóôå <ESC> ãéá íá åðéóôñÝøåôå óôçí
+ ÊáíïíéêÞ ÊáôÜóôáóç. ÅðáíáëÜâåôå ôá âÞìáôá 2 ìÝ÷ñé 4 ãéá íá äéïñèþóåôå
+ ôçí ðñüôáóç.
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. ¼ôáí åßóôå Üíåôïé ìå ôçí ðáñåìâïëÞ êåéìÝíïõ ìåôáêéíçèåßôå óôçí
+ ðáñáêÜôù ðåñßëçøç.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 1 ÐÅÑÉËÇØÇ
+
+
+ 1. Ï äñïìÝáò êéíåßôáé ÷ñçóéìïðïéþíôáò åßôå ôá ðëÞêôñá äñïìÝá Þ ôá hjkl.
+ h (áñéóôÝñá) j (êÜôù) k (ðÜíù) l (äåîéÜ)
+
+ 2. Ãéá íá ìðåßôå óôïí Vim (áðü ôçí ðñïôñïðÞ %) ãñÜøôå: vim ÁÑ×ÅÉÏ <ENTER>
+
+ 3. Ãéá íá âãåßôå ãñÜøôå: <ESC> :q! <ENTER> ãéá áðüññéøç ôùí áëëáãþí.
+ ¹ ãñÜøôå: <ESC> :wq <ENTER> ãéá áðïèÞêåõóç ôùí áëëáãþí.
+
+ 4. Ãéá íá äéáãñÜøåôå Ýíáí ÷áñáêôÞñá êÜôù áðü ôïí äñïìÝá óå
+ ÊáíïíéêÞ ÊáôÜóôáóç ðáôÞóôå: x
+
+ 5. Ãéá íá åéóÜãåôå êåßìåíï óôïí äñïìÝá üóï åßóôå óå ÊáíïíéêÞ ÊáôÜóôáóç ãñÜøôå:
+ i ðëçêôñïëïãÞóôå ôï êåßìåíï <ESC>
+
+ÓÇÌÅÉÙÓÇ: Ðáôþíôáò <ESC> èá ôïðïèåôçèåßôå óôçí ÊáíïíéêÞ ÊáôÜóôáóç Þ èá
+ áêõñþóåôå ìßá áíåðéèýìçôç êáé ìåñéêþò ïëïêëçñùìÝíç åíôïëÞ.
+
+Ôþñá óõíå÷ßóôå ìå ôï ÌÜèçìá 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 2.1: ÅÍÔÏËÅÓ ÄÉÁÃÑÁÖÇÓ
+
+ ** ÃñÜøôå dw ãéá íá äéáãñÜøåôå ìÝ÷ñé ôï ôÝëïò ìßáò ëÝîçò. **
+
+ 1. ÐáôÞóôå <ESC> ãéá íá âåâáéùèåßôå üôé åßóôå óôçí ÊáíïíéêÞ ÊáôÜóôáóç.
+
+ 2. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå --->.
+
+ 3. Ðçãáßíåôå ôïí äñïìÝá óôçí áñ÷Þ ôçò ëÝîçò ðïõ ðñÝðåé íá äéáãñáöåß.
+
+ 4. ÃñÜøôå dw ãéá íá êÜíåôå ôçí ëÝîç íá åîáöáíéóôåß.
+
+ÓÇÌÅÉÙÓÇ: Ôá ãñÜììáôá dw èá åìöáíéóôïýí óôçí ôåëåõôáßá ãñáììÞ ôçò ïèüíçò üóï
+ ôá ðëçêôñïëïãåßôå. Áí ãñÜøáôå êÜôé ëÜèïò, ðáôÞóôå <ESC> êáé
+ îåêéíÞóôå áðü ôçí áñ÷Þ.
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. ÅðáíáëÜâåôå ôá âÞìáôá 3 êáé 4 ìÝ÷ñé ç ðñüôáóç íá åßíáé óùóôÞ êáé
+ ðçãáßíåôå óôï ÌÜèçìá 2.2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 2.2: ÐÅÑÉÓÓÏÔÅÑÅÓ ÅÍÔÏËÅÓ ÄÉÁÃÑÁÖÇÓ
+
+ ** ÐëçêôñïëïãÞóôå d$ ãéá íá äéáãñÜøåôå ìÝ÷ñé ôï ôÝëïò ôçò ãñáììÞò. **
+
+ 1. ÐáôÞóôå <ESC> ãéá íá âåâáéùèåßôå üôé åßóôå óôçí ÊáíïíéêÞ ÊáôÜóôáóç.
+
+ 2. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå --->.
+
+ 3. Ìåôáêéíåßóôå ôïí äñïìÝá óôï ôÝëïò ôçò óùóôÞò ãñáììÞò (ÌÅÔÁ ôçí ðñþôç . ).
+
+ 4. ÐáôÞóôå d$ ãéá íá äéáãñÜøåôå ìÝ÷ñé ôï ôÝëïò ôçò ãñáììÞò.
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+ 5. Ðçãáßíåôå óôï ÌÜèçìá 2.3 ãéá íá êáôáëÜâåôå ôé óõìâáßíåé.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 2.3: ÐÅÑÉ ÅÍÔÏËÙÍ ÊÁÉ ÁÍÔÉÊÅÉÌÅÍÙÍ
+
+
+Ç ìïñöÞ ôçò åíôïëÞò äéáãñáöÞò d åßíáé ùò åîÞò:
+
+ [áñéèìüò] d áíôéêåßìåíï ¹ d [áñéèìüò] áíôéêåßìåíï
+ ¼ðïõ:
+ áñéèìüò - ðüóåò öïñÝò èá åêôåëåóôåß ç åíôïëÞ (ðñïáéñåôéêü, åî' ïñéóìïý=1).
+ d - ç åíôïëÞ ôçò äéáãñáöÞò.
+ áíôéêåßìåíï - ðÜíù óå ôé èá ëåéôïõñãÞóåé ç åíôïëÞ (ðáñáêÜôù ëßóôá).
+
+ Ìßá ìéêñÞ ëßóôá áðü áíôéêåßìåíá:
+ w - áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ôçò ëÝîçò, ðåñéëáìâÜíïíôáò ôï äéÜóôçìá.
+ e - áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ôçò ëÝîçò, ×ÙÑÉÓ ôï äéÜóôçìá.
+ $ - áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ôçò ãñáììÞò.
+
+ÓÇÌÅÉÙÓÇ: Ãéá ôïõò ôýðïõò ôçò ðåñéðÝôåéáò, ðáôþíôáò áðëþò ôï áíôéêåßìåíï üóï
+ åßóôå óôçí ÊáíïíéêÞ ÊáôÜóôáóç ÷ùñßò êÜðïéá åíôïëÞ èá ìåôáêéíÞóåôå
+ ôïí äñïìÝá üðùò êáèïñßæåôáé óôçí ëßóôá áíôéêåéìÝíùí.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 2.4: ÌÉÁ ÅÎÁÉÑÅÓÇ ÓÔÇÍ 'ÅÍÔÏËÇ-ÁÍÔÉÊÅÉÌÅÍÏ'
+
+ ** ÐëçêôñïëïãÞóôå dd ãéá íá äéáãñÜøåôå üëç ôç ãñáììÞ. **
+
+ Åîáéôßáò ôçò óõ÷íüôçôáò ôçò äéáãñáöÞò ïëüêëçñçò ãñáììÞò, ïé ó÷åäéáóôÝò
+ ôïõ Vim áðïöÜóéóáí üôé èá Þôáí åõêïëüôåñï íá ãñÜöåôå áðëþò äýï d óôç
+ óåéñÜ ãéá íá äéáãñÜøåôå ìßá ãñáììÞ.
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôç äåýôåñç ãñáììÞ ôçò ðáñáêÜôù öñÜóçò.
+ 2. ÃñÜøôå dd ãéá íá äéáãñÜøåôå ôç ãñáììÞ.
+ 3. Ôþñá ìåôáêéíçèåßôå óôçí ôÝôáñôç ãñáììÞ.
+ 4. ÃñÜøôå 2dd (èõìçèåßôå áñéèìüò-åíôïëÞ-áíôéêåßìåíï) ãéá íá
+ äéáãñÜøåôå äýï ãñáììÝò.
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 2.5: Ç ÅÍÔÏËÇ ÁÍÁÉÑÅÓÇÓ
+
+ ** ÐáôÞóôå u ãéá íá áíáéñÝóåôå ôéò ôåëåõôáßåò åíôïëÝò,
+ U ãéá íá äéïñèþóåôå üëç ôç ãñáììÞ. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå ---> êáé
+ ôïðïèåôÞóôå ôïí ðÜíù óôï ðñþôï ëÜèïò.
+ 2. ÐáôÞóôå x ãéá íá äéáãñÜøåôå ôïí ðñþôï áíåðéèýìçôï ÷áñáêôÞñá.
+ 3. Ôþñá ðáôÞóôå u ãéá íá áíáéñÝóåôå ôçí ôåëåõôáßá åêôåëåóìÝíç åíôïëÞ.
+ 4. ÁõôÞ ôç öïñÜ äéïñèþóôå üëá ôá ëÜèç óôç ãñáììÞ ÷ñçóéìïðïéþíôáò ôçí åíôïëÞ x.
+ 5. Ôþñá ðáôÞóôå Ýíá êåöáëáßï U ãéá íá åðéóôñÝøåôå ôç ãñáììÞ óôçí áñ÷éêÞ
+ ôçò êáôÜóôáóç.
+ 6. Ôþñá ðáôÞóôå u ìåñéêÝò öïñÝò ãéá íá áíáéñÝóåôå ôçí U êáé
+ ðñïçãïýìåíåò åíôïëÝò.
+ 7. Ôþñá ðáôÞóôå CTRL-R (êñáôþíôáò ðáôçìÝíï ôï ðëÞêôñï CTRL êáèþò ðáôÜôå ôï R)
+ ìåñéêÝò öïñÝò ãéá íá åðáíáöÝñåôå ôéò åíôïëÝò (áíáßñåóç ôùí áíáéñÝóåùí).
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. ÁõôÝò åßíáé ðïëý ÷ñÞóéìåò åíôïëÝò. Ôþñá ðçãáßíåôå óôçí
+ Ðåñßëçøç ôïõ ÌáèÞìáôïò 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 2 ÐÅÑÉËÇØÇ
+
+
+ 1. Ãéá íá äéáãñÜøåôå áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ëÝîçò ãñÜøôå: dw
+
+ 2. Ãéá íá äéáãñÜøåôå áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ãñáììÞò ãñÜøôå: d$
+
+ 3. Ãéá íá äéáãñÜøåôå ïëüêëçñç ôç ãñáììÞ ãñÜøôå: dd
+
+ 4. Ç ìïñöÞ ãéá ìßá åíôïëÞ óôçí ÊáíïíéêÞ ÊáôÜóôáóç åßíáé:
+
+ [áñéèìüò] åíôïëÞ áíôéêåßìåíï ¹ åíôïëÞ [áñéèìüò] áíôéêåßìåíï
+ üðïõ:
+ áñéèìüò - ðüóåò öïñÝò íá åðáíáëçöèåß ç åíôïëÞ
+ åíôïëÞ - ôé íá ãßíåé, üðùò ç d ãéá äéáãñáöÞ
+ áíôéêåßìåíï - ðÜíù óå ôé íá åíåñãÞóåé ç åíôïëÞ, üðùò w (ëÝîç),
+ $ (ôÝëïò ôçò ãñáììÞò), êôë.
+
+ 5. Ãéá íá áíáéñÝóåôå ðñïçãïýìåíåò åíÝñãåéåò, ðáôÞóôå: u (ðåæü u)
+ Ãéá íá áíáéñÝóåôå üëåò ôéò áëëáãÝò óôç ãñáììÞ, ðáôÞóôå: U (êåöáëáßï U)
+ Ãéá íá áíáéñÝóåôå ôéò áíáéñÝóåéò, ðáôÞóôå: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 3.1: Ç ÅÍÔÏËÇ ÔÏÐÏÈÅÔÇÓÇÓ
+
+
+ ** ÐáôÞóôå p ãéá íá ôïðïèåôÞóåôå ôçí ôåëåõôáßá äéáãñáöÞ ìåôÜ ôïí äñïìÝá. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðñþôç ãñáììÞ ôçò ðáñáêÜôù ïìÜäáò.
+
+ 2. ÐáôÞóôå dd ãéá íá äéáãñÜøåôå ôç ãñáììÞ êáé íá ôçí áðïèçêåýóåôå óå
+ ðñïóùñéíÞ ìíÞìç ôïõ Vim.
+
+ 3. Ìåôáêéíåßóôå ôïí äñïìÝá óôç ãñáììÞ ÐÁÍÙ áðü åêåß ðïõ èá ðñÝðåé íá ðÜåé
+ ç äéáãñáììÝíç ãñáììÞ.
+
+ 4. ¼óï åßóôå óå ÊáíïíéêÞ ÊáôÜóôáóç, ðáôÞóôå p ãéá íá âÜëåôå ôç ãñáììÞ.
+
+ 5. ÅðáíáëÜâåôå ôá âÞìáôá 2 Ýùò 4 ãéá íá âÜëåôå üëåò ôéò ãñáììÝò óôç
+ óùóôÞ óåéñÜ.
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 3.2: Ç ÅÍÔÏËÇ ÁÍÔÉÊÁÔÁÓÔÁÓÇÓ
+
+
+ ** ÐáôÞóôå r êáé ÷áñáêôÞñá ãéá íá áëëÜîåôå áõôüí ðïõ åßíáé
+ êÜôù áðü ôïí äñïìÝá. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðñþôç ãñáììÞ ðáñáêÜôù óçìåéùìÝíç ìå --->.
+
+ 2. Ìåôáêéíåßóôå ôïí äñïìÝá Ýôóé þóôå íá åßíáé ðÜíù óôï ðñþôï ëÜèïò.
+
+ 3. ÐáôÞóôå r êáé ìåôÜ ôïí ÷áñáêôÞñá ï ïðïßïò äéïñèþíåé ôï ëÜèïò.
+
+ 4. ÅðáíáëÜâåôå ôá âÞìáôá 2 êáé 3 ìÝ÷ñé íá åßíáé óùóôÞ ç ðñþôç ãñáììÞ.
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. Ôþñá ðçãáßíåôå óôï ÌÜèçìá 3.2.
+
+ÓÇÌÅÉÙÓÇ: Íá èõìÜóôå üôé ðñÝðåé íá ìáèáßíåôå ìå ôç ÷ñÞóç, êáé ü÷é ìå
+ ôçí áðïìíçìüíåõóç.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 3.3: Ç ÅÍÔÏËÇ ÁËËÁÃÇÓ
+
+ ** Ãéá íá áëëÜîåôå ôìÞìá Þ üëç ôç ëÝîç, ðáôÞóôå cw . **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðñþôç ãñáììÞ ðáñáêÜôù óçìåéùìÝíç ìå --->.
+
+ 2. ÔïðïèåôÞóôå ôïí äñïìÝá ðÜíù óôï u ôçò ëÝîçò lubw.
+
+ 3. ÐáôÞóôå cw êáé ôç óùóôÞ ëÝîç (óôçí ðåñßðôùóç áõôÞ, ãñÜøôå 'ine'.)
+
+ 4. ÐáôÞóôå <ESC> êáé ðçãáßíåôå óôï åðüìåíï ëÜèïò (óôïí ðñþôï
+ ÷áñáêôÞñá ðñïò áëëáãÞ).
+
+ 5. ÅðáíáëÜâåôå ôá âÞìáôá 3 êáé 4 ìÝ÷ñéò üôïõ ç ðñþôç ðñüôáóç íá åßíáé
+ ßäéá ìå ôç äåýôåñç.
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+Ðáñáôçñåßóôå üôé ç cw ü÷é ìüíï áíôéêáèéóôÜåé ôç ëÝîç, áëëÜ óáò åéóÜãåé
+åðßóçò óå ðáñåìâïëÞ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 3.4: ÐÅÑÉÓÓÏÔÅÑÅÓ ÁËËÁÃÅÓ ÌÅ c
+
+
+ ** Ç åíôïëÞ áëëáãÞò ÷ñçóéìïðïéåßôáé ìå ôá ßäéá áíôéêåßìåíá ôçò äéáãñáöÞò. **
+
+
+ 1. Ç åíôïëÞ áëëáãÞò äïõëåýåé ìå ôïí ßäéï ôñüðï üðùò ç äéáãñáöÞ. Ç ìïñöÞ åßíáé:
+
+ [áñéèìüò] c áíôéêåßìåíï ¹ c [áñéèìüò] áíôéêåßìåíï
+
+ 2. Ôá áíôéêåßìåíá åßíáé ðÜëé ôá ßäéá, üðùò w (ëÝîç), $ (ôÝëïò ãñáììÞò), êôë.
+
+ 3. Ìåôáêéíçèåßôå óôçí ðñþôç ãñáììÞ ðáñáêÜôù óçìåéùìÝíç ìå --->.
+
+ 4. Ìåôáêéíåßóôå ôïí äñïìÝá óôï ðñþôï ëÜèïò.
+
+ 5. ÃñÜøôå c$ ãéá íá êÜíåôå ôï õðüëïéðï ôçò ãñáììÞò ßäéï ìå ôç äåýôåñç
+ êáé ðáôÞóôå <ESC>.
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 3 ÐÅÑÉËÇØÇ
+
+
+ 1. Ãéá íá ôïðïèåôÞóåôå êåßìåíï ðïõ ìüëéò Ý÷åé äéáãñáöåß, ðáôÞóôå p .
+ Áõôü ôïðïèåôåß ôï äéáãñáììÝíï êåßìåíï ÌÅÔÁ ôïí äñïìÝá (áí äéáãñÜöôçêå
+ ãñáììÞ èá ðÜåé ìåôÜ óôç ãñáììÞ êÜôù áðü ôïí äñïìÝá.
+
+ 2. Ãéá íá áíôéêáôáóôÞóåôå ôïí ÷áñáêôÞñá êÜôù áðü ôïí äñïìÝá, ðáôÞóôå r
+ êáé ìåôÜ ôïí ÷áñáêôÞñá ðïõ èá áíôéêáôáóôÞóåé ôïí áñ÷éêü.
+
+ 3. Ç åíôïëÞ áëëáãÞò óáò åðéôñÝðåé íá áëëÜîåôå ôï êáèïñéóìÝíï áíôéêåßìåíï
+ áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ôïõ áíôéêåßìåíï. Ð.÷. ãñÜøôå cw ãéá íá
+ áëëÜîåôå áðü ôïí äñïìÝá ìÝ÷ñé ôï ôÝëïò ôçò ëÝîçò, c$ ãéá íá áëëÜîåôå
+ ìÝ÷ñé ôï ôÝëïò ãñáììÞò.
+
+ 4. Ç ìïñöÞ ãéá ôçí áëëáãÞ åßíáé:
+
+ [áñéèìüò] c áíôéêåßìåíï ¹ c [áñéèìüò] áíôéêåßìåíï
+
+Ôþñá óõíå÷ßóôå ìå ôï åðüìåíï ìÜèçìá.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 4.1: ÈÅÓÇ ÊÁÉ ÊÁÔÁÓÔÁÓÇ ÁÑ×ÅÉÏÕ
+
+
+ ** ÐáôÞóôå CTRL-g ãéá íá åìöáíéóôåß ç èÝóç óáò óôï áñ÷åßï êáé ç êáôÜóôáóÞ ôïõ.
+ ÐáôÞóôå SHIFT-G ãéá íá ðÜôå óå ìßá ãñáììÞ óôï áñ÷åßï. **
+
+ Óçìåßùóç: ÄéáâÜóôå ïëüêëçñï ôï ìÜèçìá ðñéí åêôåëÝóåôå êÜðïéï áðü ôá âÞìáôá!!
+
+ 1. ÊñáôÞóôå ðáôçìÝíï ôï ðëÞêôñï Ctrl êáé ðáôÞóôå g . Ìßá ãñáììÞ êáôÜóôáóçò
+ èá åìöáíéóôåß óôï êÜôù ìÝñïò ôçò óåëßäáò ìå ôï üíïìá áñ÷åßïõ êáé ôç
+ ãñáììÞ ðïõ åßóôå. Èõìçèåßôå ôïí áñéèìü ãñáììÞò ãéá ôï ÂÞìá 3.
+
+ 2. ÐáôÞóôå shift-G ãéá íá ìåôáêéíçèåßôå óôï ôÝëïò ôïõ áñ÷åßïõ.
+
+ 3. ÐáôÞóôå ôïí áñéèìü ôçò ãñáììÞò ðïõ Þóáóôáí êáé ìåôÜ shift-G. Áõôü èá
+ óáò åðéóôñÝøåé óôç ãñáììÞ ðïõ Þóáóôáí ðñéí ðáôÞóåôå ãéá ðñþôç öïñÜ Ctrl-g.
+ (¼ôáí ðëçêôñïëïãåßôå ôïõò áñéèìïýò, ÄÅÍ èá åìöáíßæïíôáé óôçí ïèüíç).
+
+ 4. Áí íïéþèåôå óßãïõñïò ãéá áõôü, åêôåëÝóôå ôá âÞìáôá 1 Ýùò 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 4.2: Ç ÅÍÔÏËÇ ÁÍÁÆÇÔÇÓÇÓ
+
+
+ ** ÐáôÞóôå / áêïëïõèïýìåíï áðü ôç öñÜóç ðïõ øÜ÷íåôå. **
+
+ 1. Óå ÊáíïíéêÞ ÊáôÜóôáóç ðáôÞóôå ôïí ÷áñáêôÞñá / . ÐáñáôçñÞóôå üôé áõôüò êáé
+ ï äñïìÝáò åìöáíßæïíôáé óôï êÜôù ìÝñïò ôçò ïèüíçò üðùò ìå ôçí åíôïëÞ : .
+
+ 2. Ôþñá ãñÜøôå 'errroor' <ENTER>. ÁõôÞ åßíáé ç ëÝîç ðïõ èÝëåôå íá øÜîåôå.
+
+ 3. Ãéá íá øÜîåôå îáíÜ ãéá ôçí ßäéá öñÜóç, ðáôÞóôå áðëþò n .
+ Ãéá íá øÜîåôå ôçí ßäéá öñÜóç óôçí áíôßèåôç êáôåýèõíóç, ðáôÞóôå Shift-N .
+
+ 4. Áí èÝëåôå íá øÜîåôå ãéá ìßá öñÜóç ðñïò ôá ðßóù, ÷ñçóéìïðïéÞóôå ôçí åíôïëÞ ? áíôß ôçò / .
+
+---> ¼ôáí ç áíáæÞôçóç öôÜóåé óôï ôÝëïò ôïõ áñ÷åßïõ èá óõíå÷ßóåé áðü ôçí áñ÷Þ.
+
+ "errroor" is not the way to spell error; errroor is an error.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 4.3: ÅÕÑÅÓÇ ÔÁÉÑÉÁÓÔÙÍ ÐÁÑÅÍÈÅÓÅÙÍ
+
+
+ ** ÐáôÞóôå % ãéá íá âñåßôå ôçí áíôßóôïé÷ç ), ], Þ } . **
+
+ 1. ÔïðïèåôÞóôå ôïí äñïìÝá óå êÜðïéá (, [, Þ { óôçí ðáñáêÜôù ãñáììÞ
+ óçìåéùìÝíç ìå --->.
+
+ 2. Ôþñá ðáôÞóôå ôïí ÷áñáêôÞñá % .
+
+ 3. Ï äñïìÝáò èá ðñÝðåé íá åßíáé óôçí áíôßóôïé÷ç ðáñÝíèåóç Þ áãêýëç.
+
+ 4. ÐáôÞóôå % ãéá íá ìåôáêéíÞóåôå ôïí äñïìÝá ðßóù óôçí ðñþôç áãêýëç
+ (ôïõ æåõãáñéïý).
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+ÓÇÌÅÉÙÓÇ: Áõôü åßíáé ðïëý ÷ñÞóéìï óôçí áðïóöáëìÜôùóç åíüò ðñïãñÜììáôïò
+ ìå ìç ôáéñéáóôÝò ðáñåíèÝóåéò!
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 4.4: ÅÍÁÓ ÔÑÏÐÏÓ ÃÉÁ ÁËËÁÃÇ ËÁÈÙÍ
+
+
+ ** ÃñÜøôå :s/old/new/g ãéá íá áëëÜîåôå ôï 'new' ìå ôï 'old'. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå --->.
+
+ 2. ÃñÜøôå :s/thee/the <ENTER> . Óçìåéþóôå üôé áõôÞ ç åíôïëÞ áëëÜæåé ìüíï
+ ôçí ðñþôç åìöÜíéóç óôç ãñáììÞ.
+
+ 3. Ôþñá ãñÜøôå :s/thee/the/g åííïþíôáò ãåíéêÞ áíôéêáôÜóôáóç óôç
+ ãñáììÞ. Áõôü áëëÜæåé üëåò ôéò åìöáíßóåéò åðß ôçò ãñáììÞò.
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. Ãéá íá áëëÜîåôå êÜèå åìöÜíéóç ìßáò óõìâïëïóåéñÜò ìåôáîý äýï ãñáììþí,
+ ãñÜøôå :#,#s/old/new/g üðïõ #,# ïé áñéèìïß ôùí äýï ãñáììþí.
+ ÃñÜøôå :%s/old/new/g ãéá íá áëëÜîåôå êÜèå åìöÜíéóç óå üëï ôï áñ÷åßï.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 4 ÐÅÑÉËÇØÇ
+
+
+ 1. Ôï Ctrl-g åìöáíßæåé ôç èÝóç óáò óôï áñ÷åßï êáé ôçí êáôÜóôáóÞ ôïõ.
+ Ôï Shift-G ðçãáßíåé óôï ôÝëïò ôïõ áñ÷åßïõ. ¸íáò áñéèìüò ãñáììÞò
+ áêïëïõèïýìåíïò áðü Shift-G ðçãáßíåé óå åêåßíç ôç ãñáììÞ.
+
+ 2. ÃñÜöïíôáò / áêïëïõèïýìåíï áðü ìßá öñÜóç øÜ÷íåé ðñïò ôá ÌÐÑÏÓÔÁ ãéá
+ ôç öñÜóç. ÃñÜöïíôáò ? áêïëïõèïýìåíï áðü ìßá öñÜóç øÜ÷íåé ðñïò ôá ÐÉÓÙ
+ ãéá ôç öñÜóç. ÌåôÜ áðü ìßá áíáæÞôçóç ðáôÞóôå n ãéá íá âñåßôå ôçí
+ åðüìåíç åìöÜíéóç ðñïò ôçí ßäéá êáôåýèõíóç Þ Shift-N ãéá íá øÜîåôå
+ ðñïò ôçí áíôßèåôç êáôåýèõíóç.
+
+ 3. Ðáôþíôáò % üóï ï äñïìÝáò åßíáé ðÜíù óå ìßá (,),[,],{, Þ } åíôïðßæåé
+ ôï áíôßóôïé÷ï ôáßñé ôïõ æåõãáñéïý.
+
+ 4. Ãéá áíôéêáôÜóôáóç ìå new ôïõ ðñþôïõ old óôç ãñáììÞ ãñÜøôå :s/old/new
+ Ãéá áíôéêáôÜóôáóç ìå new üëùí ôùí 'old' óôç ãñáììÞ ãñÜøôå :s/old/new/g
+ Ãéá áíôéêáôÜóôáóç öñÜóåùí ìåôáîý äýï # ãñáììþí ãñÜøôå :#,#s/old/new/g
+ Ãéá áíôéêáôÜóôáóç üëùí ôùí åìöáíßóåùí óôï áñ÷åßï ãñÜøôå :%s/old/new/g
+ Ãéá åñþôçóç åðéâåâáßùóçò êÜèå öïñÜ ðñïóèÝóôå Ýíá 'c' "%s/old/new/gc
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 5.1: ÐÙÓ ÅÊÔÅËÙ ÌÉÁ ÅÎÙÔÅÑÉÊÇ ÅÍÔÏËÇ
+
+
+** ÃñÜøôå :! áêïëïõèïýìåíï áðü ìßá åîùôåñéêÞ åíôïëÞ ãéá íá ôçí åêôåëÝóåôå. **
+
+ 1. ÐáôÞóôå ôçí ïéêåßá åíôïëÞ : ãéá íá èÝóåôå ôïí äñïìÝá óôï êÜôù ìÝñïò
+ ôçò ïèüíçò. Áõôü óáò åðéôñÝðåé íá äþóåôå ìßá åíôïëÞ.
+
+ 2. Ôþñá ðáôÞóôå ôï ! (èáõìáóôéêü). Áõôü óáò åðéôñÝðåé íá åêôåëÝóåôå
+ ïðïéáäÞðïôå åîùôåñéêÞ åíôïëÞ ôïõ öëïéïý.
+
+ 3. Óáí ðáñÜäåéãìá ãñÜøôå ls ìåôÜ áðü ôï ! êáé ðáôÞóôå <ENTER>. Áõôü èá
+ óáò åìöáíßóåé ìßá ëßóôá ôïõ êáôáëüãïõ óáò, áêñéâþò óáí íá Þóáóôáí óôçí
+ ðñïôñïðÞ ôïõ öëïéïý. ¹ ÷ñçóéìïðïéÞóôå :!dir áí ôï ls äåí äïõëåýåé.
+
+---> Óçìåßùóç: Åßíáé äõíáôüí íá åêôåëÝóåôå ïðïéáäÞðïôå åîùôåñéêÞ åíôïëÞ
+ ìå áõôüí ôïí ôñüðï.
+
+---> Óçìåßùóç: ¼ëåò ïé åíôïëÝò : ðñÝðåé íá ôåñìáôßæïíôáé ðáôþíôáò ôï <ENTER>.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 5.2: ÐÅÑÉÓÓÏÔÅÑÁ ÐÅÑÉ ÅÃÃÑÁÖÇÓ ÁÑ×ÅÉÙÍ
+
+
+ ** Ãéá íá óþóåôå ôéò áëëÜãåò ðïõ êÜíáôå óôï áñ÷åßï, ãñÜøôå :w ÁÑ×ÅÉÏ. **
+
+ 1. ÃñÜøôå :!dir Þ :!ls ãéá íá ðÜñåôå ìßá ëßóôá ôïõ êáôáëüãïõ óáò.
+ ¹äç îÝñåôå üôé ðñÝðåé íá ðáôÞóåôå <ENTER> ìåôÜ áðü áõôü.
+
+ 2. ÄéáëÝîôå Ýíá üíïìá áñ÷åßïõ ðïõ äåí õðÜñ÷åé áêüìá, üðùò ôï TEST.
+
+ 3. Ôþñá ãñÜøôå: :w TEST (üðïõ TEST åßíáé ôï üíïìá áñ÷åßïõ ðïõ äéáëÝîáôå).
+
+ 4. Áõôü óþæåé üëï ôï áñ÷åßï (vim Tutor) ìå ôï üíïìá TEST. Ãéá íá ôï
+ åðáëçèåýóåôå, ãñÜøôå îáíÜ :!dir ãéá íá äåßôå ôïí êáôÜëïãü óáò.
+
+---> Óçìåéþóôå üôé áí âãáßíáôå áðü ôïí Vim êáé ìðáßíáôå îáíÜ ìå ôï üíïìá
+ áñ÷åßïõ TEST, ôï áñ÷åßï èá Þôáí áêñéâÝò áíôßãñáöï ôïõ tutor üôáí ôï óþóáôå.
+
+ 5. Ôþñá äéáãñÜøôå ôï áñ÷åßï ãñÜöïíôáò (MS-DOS): :!del TEST
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 5.3: ÅÐÉËÅÊÔÉÊÇ ÅÍÔÏËÇ ÅÃÃÑÁÖÇÓ
+
+
+ ** Ãéá íá óþóåôå ôìÞìá ôïõ áñ÷åßïõ, ãñÜøôå :#,# w ÁÑ×ÅÉÏ **
+
+ 1. ¢ëëç ìéá öïñÜ, ãñÜøôå :!dir Þ :!ls ãéá íá ðÜñåôå ìßá ëßóôá áðü ôïí
+ êáôÜëïãü óáò êáé äéáëÝîôå Ýíá êáôÜëëçëï üíïìá áñ÷åßïõ üðùò ôï TEST.
+
+ 2. Ìåôáêéíåßóôå ôïí äñïìÝá óôï ðÜíù ìÝñïò áõôÞò ôçò óåëßäáò êáé ðáôÞóôå
+ Ctrl-g ãéá íá âñåßôå ôïí áñéèìü áõôÞò ôçò ãñáììÞò.
+ ÍÁ ÈÕÌÁÓÔÅ ÁÕÔÏÍ ÔÏÍ ÁÑÉÈÌÏ!
+
+ 3. Ôþñá ðçãáßíåôå óôï êÜôù ìÝñïò ôçò óåëßäáò êáé ðáôÞóôå Ctrl-g îáíÜ.
+ ÍÁ ÈÕÌÁÓÔÅ ÊÁÉ ÁÕÔÏÍ ÔÏÍ ÁÑÉÈÌÏ!
+
+ 4. Ãéá íá óþóåôå ÌÏÍÏ Ýíá ôìÞìá óå áñ÷åßï, ãñÜøôå :#,# w TEST
+ üðïõ #,# ïé äýï áñéèìïß ðïõ áðïìíçìïíåýóáôå (ðÜíù,êÜôù) êáé TEST ôï
+ üíïìá ôïõ áñ÷åßïõ óáò.
+
+ 5. ÎáíÜ, äåßôå üôé ôï áñ÷åßï åßíáé åêåß ìå ôçí :!dir áëëÜ ÌÇÍ ôï äéáãñÜøåôå.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 5.4: ÁÍÁÊÔÙÍÔÁÓ ÊÁÉ ÅÍÙÍÏÍÔÁÓ ÁÑ×ÅÉÁ
+
+
+ ** Ãéá íá åéóÜãåôå ôá ðåñéå÷üìåíá åíüò áñ÷åßïõ, ãñÜøôå :r ÁÑ×ÅÉÏ **
+
+ 1. ÃñÜøôå :!dir ãéá íá âåâáéùèåßôå üôé ôï TEST õðÜñ÷åé áðü ðñéí.
+
+ 2. ÔïðïèåôÞóôå ôïí äñïìÝá óôï ðÜíù ìÝñïò ôçò óåëßäáò.
+
+ÓÇÌÅÉÙÓÇ: Áöüôïõ åêôåëÝóåôå ôï ÂÞìá 3 èá äåßôå ôï ÌÜèçìá 5.3.
+ ÌåôÜ êéíçèåßôå ÊÁÔÙ îáíÜ ðñïò ôï ìÜèçìá áõôü.
+
+ 3. Ôþñá áíáêôÞóôå ôï áñ÷åßï óáò TEST ÷ñçóéìïðïéþíôáò ôçí åíôïëÞ :r TEST
+ üðïõ TEST åßíáé ôï üíïìá ôïõ áñ÷åßïõ.
+
+ÓÇÌÅÉÙÓÇ: Ôï áñ÷åßï ðïõ áíáêôÜôå ôïðïèåôåßôáé îåêéíþíôáò åêåß ðïõ âñßóêåôáé
+ ï äñïìÝáò.
+
+ 4. Ãéá íá åðáëçèåýóåôå üôé ôï áñ÷åßï áíáêôÞèçêå, ðßóù ôïí äñïìÝá êáé
+ ðáñáôçñÞóôå üôé õðÜñ÷ïõí ôþñá äýï áíôßãñáöá ôïõ ÌáèÞìáôïò 5.3, ôï
+ áñ÷éêü êáé ç Ýêäïóç ôïõ áñ÷åßïõ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 5 ÐÅÑÉËÇØÇ
+
+
+ 1. :!åíôïëÞ åêôåëåß ìßá åîùôåñéêÞ åíôïëÞ.
+
+ ÌåñéêÜ ÷ñÞóéìá ðáñáäåßãìáôá åßíáé (MS-DOS):
+ :!dir - åìöÜíéóç ëßóôáò åíüò êáôáëüãïõ.
+ :!del ÁÑ×ÅÉÏ - äéáãñÜöåé ôï ÁÑ×ÅÉÏ.
+
+ 2. :w ÁÑ×ÅÉÏ ãñÜöåé ôï ôñÝ÷ùí áñ÷åßï ôïõ Vim óôï äßóêï ìå üíïìá ÁÑ×ÅÉÏ.
+
+ 3. :#,#w ÁÑ×ÅÉÏ óþæåé ôéò ãñáììÝò áðü # ìÝ÷ñé # óôï ÁÑ×ÅÉÏ.
+
+ 4. :r ÁÑ×ÅÉÏ áíáêôåß ôï áñ÷åßï äßóêïõ ÁÑ×ÅÉÏ êáé ôï ðáñåìâÜëëåé ìÝóá
+ óôï ôñÝ÷ïí áñ÷åßï ìåôÜ áðü ôç èÝóç ôïõ äñïìÝá.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 6.1: Ç ÅÍÔÏËÇ ÁÍÏÉÃÌÁÔÏÓ
+
+
+ ** ÐáôÞóôå o ãéá íá áíïßîåôå ìßá ãñáììÞ êÜôù áðü ôïí äñïìÝá êáé íá
+ âñåèåßôå óå ÊáôÜóôáóç ÊåéìÝíïõ. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðáñáêÜôù ãñáììÞ óçìåéùìÝíç ìå --->.
+
+ 2. ÐáôÞóôå o (ðåæü) ãéá íá áíïßîåôå ìßá ãñáììÞ ÊÁÔÙ áðü ôïí äñïìÝá êáé íá
+ âñåèåßôå óå ÊáôÜóôáóç ÊåéìÝíïõ.
+
+ 3. Ôþñá áíôéãñÜøôå ôç óçìåéùìÝíç ìå ---> ãñáììÞ êáé ðáôÞóôå <ESC> ãéá íá
+ âãåßôå áðü ôçí ÊáôÜóôáóç ÊåéìÝíïõ.
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. Ãéá íá áíïßîåôå ìßá ãñáììÞ ÐÁÍÙ áðü ôïí äñïìÝá, ðáôÞóôå áðëÜ Ýíá êåöáëáßï
+ O, áíôß ãéá Ýíá ðåæü o. ÄïêéìÜóôå ôï óôçí ðáñáêÜôù ãñáììÞ.
+Áíïßãåôå ãñáììÞ ðÜíù áðü áõôÞí ðáôþíôáò Shift-O üóï ï äñïìÝáò åßíáé óôç ãñáììÞ
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 6.2: Ç ÅÍÔÏËÇ ÐÑÏÓÈÇÊÇÓ
+
+ ** ÐáôÞóôå a ãéá íá åéóÜãåôå êåßìåíï ÌÅÔ¢ ôïí äñïìÝá. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôï ôÝëïò ôçò ðñþôçò ãñáììÞò ðáñáêÜôù
+ óçìåéùìÝíç ìå ---> ðáôþíôáò $ óôçí ÊáíïíéêÞ ÊáôÜóôáóç.
+
+ 2. ÐáôÞóôå Ýíá a (ðåæü) ãéá íá ðñïóèÝóåôå êåßìåíï ÌÅÔÁ áðü ôïí ÷áñáêôÞñá
+ ðïõ åßíáé êÜôù áðü ôïí äñïìÝá. (Ôï êåöáëáßï A ðñïóèÝôåé óôï ôÝëïò
+ ôçò ãñáììÞò).
+
+Óçìåßùóç: Áõôü áðïöåýãåé ôï ðÜôçìá ôïõ i , ôïí ôåëåõôáßï ÷áñáêôÞñá, ôï
+ êåßìåíï ôçò åéóáãùãÞò, <ESC>, äñïìÝá-äåîéÜ, êáé ôÝëïò, x, ìüíï êáé
+ ìüíï ãéá íá ðñïóèÝóåôå óôï ôÝëïò ôçò ãñáììÞò!
+
+ 3. Óõìðëçñþóôå ôþñá ôçí ðñþôç ãñáììÞ. Óçìåéþóôå åðßóçò üôé ç ðñïóèÞêç åßíáé
+ áêñéâþò ßäéá óôçí ÊáôÜóôáóç ÊåéìÝíïõ ìå ôçí ÊáôÜóôáóç ÅéóáãùãÞò, åêôüò
+ áðü ôç èÝóç ðïõ åéóÜãåôáé ôï êåßìåíï.
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 6.3: ÁËËÇ ÅÊÄÏÓÇ ÔÇÓ ÁÍÔÉÊÁÔÁÓÔÁÓÇÓ
+
+
+ ** ÐáôÞóôå êåöáëáßï R ãéá íá áëëÜîåôå ðåñéóóüôåñïõò áðü Ýíáí ÷áñáêôÞñåò. **
+
+ 1. Ìåôáêéíåßóôå ôïí äñïìÝá óôçí ðñþôç ãñáììÞ ðáñáêÜôù óçìåéùìÝíç ìå --->.
+
+ 2. ÔïðïèåôÞóôå ôïí äñïìÝá óôçí áñ÷Þ ôçò ðñþôçò ëÝîçò ðïõ åßíáé äéáöïñåôéêÞ
+ áðü ôç äåýôåñç ãñáììÞ óçìåéùìÝíç ìå ---> (ç ëÝîç 'last').
+
+ 3. ÐáôÞóôå ôþñá R êáé áëëÜîôå ôï õðüëïéðï ôïõ êåéìÝíïõ óôçí ðñþôç ãñáììÞ
+ ãñÜöïíôáò ðÜíù áðü ôï ðáëéü êåßìåíï þóôå íá êÜíåôå ôçí ðñþôç ãñáììÞ ßäéá
+ ìå ôç äåýôåñç.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. Óçìåéþóôå üôé üôáí ðáôÜôå <ESC> ãéá íá âãåßôå, ðáñáìÝíåé ïðïéïäÞðïôå
+ áíáëëïßùôï êåßìåíï.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÜèçìá 6.4: ÑÕÈÌÉÓÇ ÅÐÉËÏÃÇÓ
+
+
+ ** Ñõèìßóôå ìßá åðéëïãÞ Ýôóé þóôå ç áíáæÞôçóç Þ ç áíôéêáôÜóôáóç íá áãíïåß
+ ôç äéáöïñÜ ðåæþí-êåöáëáßùí **
+
+ 1. ØÜîôå ãéá 'ignore' åéóÜãïíôáò:
+ /ignore
+ Óõíå÷ßóôå áñêåôÝò öïñÝò ðáôþíôáò ôï ðëÞêôñï n.
+
+ 2. ÈÝóôå ôçí åðéëïãÞ 'ic' (Ignore case) ãñÜöïíôáò:
+ :set ic
+
+ 3. ØÜîôå ôþñá îáíÜ ãéá 'ignore' ðáôþíôáò: n
+ Óõíå÷ßóôå ôçí áíáæÞôçóç ìåñéêÝò áêüìá öïñÝò ðáôþíôáò ôï ðëÞêôñï n
+
+ 4. ÈÝóôå ôéò åðéëïãÝò 'hlsearch' êáé 'incsearch':
+ :set hls is
+
+ 5. ÅéóÜãåôå ôþñá îáíÜ ôçí åíôïëÞ áíáæÞôçóçò, êáé äåßôå ôé óõìâáßíåé
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 6 ÐÅÑÉËÇØÇ
+
+
+ 1. Ðáôþíôáò o áíïßãåé ìßá ãñáììÞ ÊÁÔÙ áðü ôïí äñïìÝá êáé ôïðïèåôåß ôïí
+ äñïìÝá óôçí áíïé÷ôÞ ãñáììÞ óå ÊáôÜóôáóç ÊåéìÝíïõ.
+
+ 2. ÐáôÞóôå a ãéá íá åéóÜãåôå êåßìåíï ÌÅÔÁ ôïí ÷áñáêôÞñá óôïí ïðïßï åßíáé
+ ï äñïìÝáò. Ðáôþíôáò êåöáëáßï A áõôüìáôá ðñïóèÝôåé êåßìåíï óôï ôÝëïò
+ ôçò ãñáììÞò.
+
+ 3. Ðáôþíôáò êåöáëáßï R åéóÝñ÷åôáé óôçí ÊáôÜóôáç ÁíôéêáôÜóôáóçò ìÝ÷ñé íá
+ ðáôçèåß ôï <ESC> êáé íá åîÝëèåé.
+
+ 4. ÃñÜöïíôáò ":set xxx" ñõèìßæåé ôçí åðéëïãÞ "xxx".
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 7: ON-LINE ÅÍÔÏËÅÓ ÂÏÇÈÅÉÁÓ
+
+
+ ** ×ñçóéìïðïéÞóôå ôï on-line óýóôçìá âïÞèåéáò **
+
+ Ï Vim Ý÷åé Ýíá ðåñéåêôéêü on-line óýóôçìá âïÞèåéáò. Ãéá íá îåêéíÞóåé,
+ äïêéìÜóôå êÜðïéï áðü ôá ôñßá:
+ - ðáôÞóôå ôï ðëÞêôñï <HELP> (áí Ý÷åôå êÜðïéï)
+ - ðáôÞóôå ôï ðëÞêôñï <F1> (áí Ý÷åôå êÜðïéï)
+ - ãñÜøôå :help <ENTER>
+
+ ÃñÜøôå :q <ENTER> ãéá íá êëåßóåôå ôï ðáñÜèõñï ôçò âïÞèåéáò.
+
+ Ìðïñåßôå íá âñåßôå âïÞèåéá ðÜíù óå êÜèå áíôéêåßìåíï, äßíïíôáò ìßá ðáñÜìåôñï
+ óôçí åíôïëÞ ":help". ÄïêéìÜóôå áõôÜ (ìçí îå÷íÜôå íá ðáôÜôå <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÌÁÈÇÌÁ 8: ÄÇÌÉÏÕÑÃÇÓÔÅ ÅÍÁ SCRIPT ÅÊÊÉÍÇÓÇÓ
+
+ ** ÅíåñãïðïéÞóôå ÷áñáêôçñéóôéêÜ ôïõ Vim **
+
+ Ï Vim Ý÷åé ðïëëÜ ðåñéóóüôåñá ÷áñáêôçñéóôéêÜ áð' ü,ôé ï Vi, áëëÜ ôá
+ ðåñéóóüôåñá åßíáé áñ÷éêÜ áðåíåñãïðïéçìÝíá. Ãéá íá áñ÷ßóåôå íá ÷ñçóéìïðïéåßôå
+ ðåñéóóüôåñá ÷áñáêôçñéóôéêÜ ðñÝðåé íá öôéÜîåôå Ýíá áñ÷åßï "vimrc".
+
+ 1. Áñ÷ßóôå äéïñèþíïíôáò ôï áñ÷åßï "vimrc", áõôü åîáñôÜôáé áðü ôï óýóôçìÜ óáò:
+ :edit ~/.vimrc ãéá Unix
+ :edit $VIM/_vimrc ãéá MS-Windows
+
+ 2. Ôþñá åéóÜãåôå ôï êåßìåíï ðáñáäåßãìáôïò ãéá áñ÷åßï "vimrc":
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. ÃñÜøôå ôï áñ÷åßï ìå ôçí:
+ :write
+
+ Ôçí åðüìåíç öïñÜ ðïõ èá îåêéíÞóåôå ôïí Vim èá ÷ñçóéìïðïéÞóåé öùôéóìü
+ óýíôáîçò. Ìðïñåßôå íá ðñïóèÝóåôå üëåò ôéò ðñïôéìþìåíåò åðéëïãÝò ó' áõôü
+ ôï áñ÷åßï "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Åäþ ïëïêëçñþíåôáé ôï Vim Tutor. Óêïðüò ôïõ Þôáí íá äþóåé ìßá óýíôïìç
+ ðåñßëçøç ôïõ óõíôÜêôç Vim, ôïõëÜ÷éóôïí ôüóç þóôå íá óáò åðéôñÝøåé íá
+ ÷ñçóéìïðïéÞóåôå ôïí óõíôÜêôç áñêåôÜ åýêïëá. ÁðÝ÷åé ðïëý áðü ìßá
+ ïëïêëçñùìÝíç ðáñïõóßáóç êáèþò ï Vim Ý÷åé ðÜñá ðïëëÝò åíôïëÝò. ÄéáâÜóôå
+ êáôüðéí ôï åã÷åéñßäéï ÷ñÞóçò:
+ ":help user-manual".
+
+ Ãéá ðåñáéôÝñù äéÜâáóìá êáé ìåëÝôç, óõóôÞíåôáé áõôü ôï âéâëßï:
+ Vim - Vi Improved - by Steve Oualline
+ Publisher: New Riders
+ Ôï ðñþôï âéâëßï ðëÞñùò áöéåñùìÝíï óôïí Vim.
+ Éäéáßôåñá ÷ñÞóéìï ãéá áñ÷Üñéïõò.
+ ÕðÜñ÷ïõí ðïëëÜ ðáñáäåßãìáôá êáé åéêüíåò.
+ Äåßôå ôçí http://iccf-holland.org/click5.html
+
+ Áõôü ôï âéâëßï åßíáé ðáëéüôåñï êáé ðåñéóóüôåñï ãéá ôïí Vi ðáñÜ ãéá ôïí Vim,
+ áëëÜ åðßóçò óõíéóôþìåíï:
+ Learning the Vi Editor - by Linda Lamb
+ Publisher: O'Reilly & Associates Inc.
+ Åßíáé Ýíá êáëü âéâëßï ãéá íá ìÜèåôå ó÷åäüí ôá ðÜíôá ðïõ èÝëåôå
+ íá êÜíåôå ìå ôïí Vi.
+ Ç Ýêôç Ýêäïóç ðåñéÝ÷åé áêüìá ðëçñïöïñßåò ãéá ôïí Vim.
+
+ ÁõôÞ ç ðåñéÞãçóç ãñÜöôçêå áðü ôïõò Michael C. Pierce êáé Robert K. Ware,
+ Colorado School of Mines ÷ñçóéìïðïéþíôáò éäÝåò áðü ôïí Charles Smith,
+ Colorado State University. E-mail: bware@mines.colorado.edu.
+
+ ÐñïóáñìïãÞ ãéá ôïí Vim áðü ôïí Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.gr.cp737 b/runtime/tutor/tutor.gr.cp737
new file mode 100644
index 000000000..6ad372e3c
--- /dev/null
+++ b/runtime/tutor/tutor.gr.cp737
@@ -0,0 +1,815 @@
+===============================================================================
+= ‰ ˜¢ à © ã ¨ Ÿ ˜ « œ © « ¦ V I M T u t o r - ë¡›¦©ž 1.5 =
+===============================================================================
+
+ Ž Vim œå¤˜  ⤘ª §˜¤å©®¬¨¦ª ©¬¤«á¡«žª §¦¬ ⮜  §¦¢¢âª œ¤«¦¢âª, §á¨˜
+ §¦¢¢âª š ˜ ¤˜ œ¥žšã©¦¬£œ ©œ £å˜ §œ¨ ãšž©ž æ§àª ˜¬«ã. €¬«ã ž §œ¨ ãšž©ž
+ ©®œ› á©«ž¡œ š ˜ ¤˜ §œ¨ š¨á¯œ   ¡˜¤¦§¦ ž« ¡á « ª œ¤«¦¢âª §¦¬ Ÿ˜ ©˜ª
+ ¡á¤¦¬¤ ¤˜ ®¨ž© £¦§¦ œå«œ œç¡¦¢˜ «¦¤ Vim ©˜¤ ⤘¤ šœ¤ ¡ãª ®¨ã©žª ©¬¤«á¡«ž.
+
+ Ž ¡˜«á §¨¦©âšš ©ž ®¨æ¤¦ª §¦¬ ˜§˜ «œå«˜  š ˜ ¤˜ ¦¢¦¡¢ž¨é©œ«œ «ž¤ §œ¨ ãšž©ž
+ œå¤˜  25-30 ¢œ§«á, œ¥˜¨«é¤«˜ª ˜§æ «¦ §æ©¦ ®¨æ¤¦ Ÿ˜ ¥¦›â¯œ«œ š ˜
+ §œ ¨˜£˜« ©£¦çª.
+
+ Ž  œ¤«¦¢âª ©«˜ £˜Ÿã£˜«˜ Ÿ˜ «¨¦§¦§¦ ã©¦¬¤ «¦ ¡œå£œ¤¦. ƒž£ ¦¬¨šã©«œ ⤘
+ ˜¤«åš¨˜­¦ ˜¬«¦ç «¦¬ ˜¨®œå¦¬ š ˜ ¤˜ œ¥˜©¡žŸœå«œ (˜¤ ¥œ¡ ¤ã©˜«œ «¦
+ "Vimtutor" ˜¬«æ œå¤˜  㛞 ⤘ ˜¤«åš¨˜­¦).
+
+ „夘  ©ž£˜¤« ¡æ ¤˜ Ÿ¬£á©«œ æ«  ˜¬«ã ž §œ¨ ãšž©ž œå¤˜  ¦¨š˜¤à£â¤ž â«© 
+ é©«œ ¤˜ › ›á©¡œ  £â©à «žª ®¨ã©žª. €¬«æ ©ž£˜å¤œ  æ«  ®¨œ áœ«˜  ¤˜
+ œ¡«œ¢œå«œ « ª œ¤«¦¢âª š ˜ ¤˜ « ª £áŸœ«œ ©à©«á. €¤ › ˜™áœ«œ £æ¤¦ «¦
+ ¡œå£œ¤¦, Ÿ˜ « ª ¥œ®á©œ«œ!
+
+ ’騘, ™œ™˜ àŸœå«œ æ«  «¦ §¢ã¡«¨¦ Shift-Lock ƒ„Œ œå¤˜  §˜«ž£â¤¦ ¡˜ 
+ §˜«ã©«œ «¦ §¢ã¡«¨¦ j ˜¨¡œ«âª ­¦¨âª š ˜ ¤˜ £œ«˜¡ ¤ã©œ«œ «¦¤ ›¨¦£â˜ â«© 
+ é©«œ «¦ ‹áŸž£˜ 1.1 ¤˜ šœ£å©œ  §¢ã¨àª «ž¤ ¦Ÿæ¤ž.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 1.1: ‹„’€‰ˆŒŽŒ’€‘ ’ŽŒ ƒŽ‹„€
+
+ ** ‚ ˜ ¤˜ ¡ ¤ã©œ«œ «¦¤ ›¨¦£â˜, §˜«ã©«œ «˜ §¢ã¡«¨˜ h,j,k,l æ§àª ›œå®¤œ«˜ . **
+ ^
+ k Hint: ’¦ §¢ã¡«¨¦ h œå¤˜  ˜¨ ©«œ¨á ¡˜  ¡ ¤œå ©«' ˜¨ ©«œ¨á.
+ < h l > ’¦ §¢ã¡«¨¦ l œå¤˜  ›œ¥ á ¡˜  ¡ ¤œå ©«˜ ›œ¥ á.
+ j ’¦ §¢ã¡«¨¦ j £¦ áœ  £œ ™œ¢á¡  §¨¦ª «˜ ¡á«à.
+ v
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ «¨ šç¨à ©«ž¤ ¦Ÿæ¤ž £â®¨  ¤˜ ¤¦ éŸœ«œ ᤜ«˜.
+
+ 2. ‰¨˜«ã©«œ §˜«ž£â¤¦ «¦ ¡á«à §¢ã¡«¨¦ (j) £â®¨  ¤˜ œ§˜¤˜¢ž­Ÿœå.
+---> ’騘 ¥â¨œ«œ §éª ¤˜ £œ«˜¡ ¤žŸœå«œ ©«¦ œ§æ£œ¤¦ £áŸž£˜.
+
+ 3. •¨ž© £¦§¦ é¤«˜ª «¦ ¡á«à §¢ã¡«¨¦, £œ«˜¡ ¤žŸœå«œ ©«¦ ‹áŸž£˜ 1.2.
+
+‘ž£œåà©ž: €¤ ˜£­ ™á¢¢œ«œ š ˜ ¡á«  §¦¬ §˜«ã©˜«œ, §˜«ã©«œ <ESC> š ˜ ¤˜ ™¨œŸœå«œ
+ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž. ‹œ«á §˜«ã©«œ ¥˜¤á «ž¤ œ¤«¦¢ã §¦¬ Ÿâ¢˜«œ.
+
+‘ž£œåà©ž: ’˜ §¢ã¡«¨˜ «¦¬ ›¨¦£â˜ Ÿ˜ §¨â§œ  œ§å©žª ¤˜ ›¦¬¢œç¦¬¤. €¢¢á £œ «˜ hjkl
+ Ÿ˜ £§¦¨œå«œ ¤˜ ¡ ¤žŸœå«œ §¦¢ç š¨žš¦¨æ«œ¨˜, £æ¢ ª «˜ ©¬¤žŸå©œ«œ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 1.2: ‹€ˆŒŽŒ’€‘ ‰€ˆ ‚€ˆŒŽŒ’€‘ ‘’ŽŒ VIM
+
+ !! ‘†‹„ˆ—‘†: ¨ ¤ œ¡«œ¢â©œ«œ ¡á§¦ ¦ ˜§æ «˜ ™ã£˜«˜, › ˜™á©«œ 梦 «¦ £áŸž£˜!!
+
+ 1. ˜«ã©«œ «¦ §¢ã¡«¨¦ <ESC> (š ˜ ¤˜ œå©«œ ©åš¦¬¨˜ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž).
+
+ 2. ¢ž¡«¨¦¢¦šã©«œ: :q! <ENTER>.
+
+---> €¬«æ œ¥â¨®œ«˜  ˜§æ «¦¤ ©¬¤«á¡«ž •—ˆ‘ ¤˜ ©é©œ  槦 œª ˜¢¢˜šâª ⮜«œ ¡á¤œ .
+ €¤ Ÿâ¢œ«œ ¤˜ ©é©œ«œ « ª ˜¢¢˜šâª ¡˜  ¤˜ œ¥â¨Ÿœ«œ §¢ž¡«¨¦¢¦šã©«œ:
+ :wq <ENTER>
+
+ 3. ¤ ›œå«œ «ž¤ §¨¦«¨¦§ã «¦¬ ­¢¦ ¦ç, §¢ž¡«¨¦¢¦šã©«œ «ž¤ œ¤«¦¢ã £œ «ž¤ ¦§¦å˜
+ £§ã¡˜«œ ©œ ˜¬«ã¤ «ž¤ §œ¨ ãšž©ž. ‹§¦¨œå ¤˜ œå¤˜ : vimtutor <ENTER>
+ ‰˜¤¦¤ ¡á Ÿ˜ ®¨ž© £¦§¦ ¦ç©˜«œ: vim tutor <ENTER>
+
+---> 'vim' ©ž£˜å¤œ  œ ©˜šàšã ©«¦¤ ©¬¤«á¡«ž vim, 'tutor' œå¤˜  «¦ ˜¨®œå¦ §¦¬
+ Ÿâ¢¦¬£œ ¤˜ › ¦¨Ÿé©¦¬£œ.
+
+ 4. €¤ ⮜«œ ˜§¦£¤ž£¦¤œç©œ  ˜¬«á «˜ ™ã£˜«˜ ¡˜  ⮜«œ ˜¬«¦§œ§¦åŸž©ž, œ¡«œ¢â©«œ
+ «˜ ™ã£˜«˜ 1 âઠ3 š ˜ ¤˜ ™šœå«œ ¡˜  ¤˜ £§œå«œ ¥˜¤á ©«¦¤ ©¬¤«á¡«ž. ‹œ«á
+ £œ«˜¡ ¤ã©«œ «¦¤ ›¨¦£â˜ ¡á«à ©«¦ ‹áŸž£˜ 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 1.3: ƒˆŽ‡—‘† ‰„ˆ‹„ŒŽ“ - ƒˆ€‚€”†
+
+ **  œå©«œ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž §˜«ã©«œ x š ˜ ¤˜ › ˜š¨á¯œ«œ «¦¤
+ ®˜¨˜¡«ã¨˜ ¡á«à ˜§æ «¦¤ ›¨¦£â˜. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ --->.
+
+ 2. ‚ ˜ ¤˜ › ¦¨Ÿé©œ«œ «˜ ¢áŸž, ¡ ¤œå©«œ «¦¤ ›¨¦£â˜ £â®¨  ¤˜ œå¤˜  §á¤à ˜§æ
+ «¦¤ ®˜¨˜¡«ã¨˜ §¦¬ Ÿ˜ › ˜š¨˜­œå.
+
+ 3. ˜«ã©«œ «¦ §¢ã¡«¨¦ x š ˜ ¤˜ › ˜š¨á¯œ«œ «¦¤ ˜¤œ§ Ÿç£ž«¦ ®˜¨˜¡«ã¨˜.
+
+ 4. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 2 £â®¨  4 £â®¨  ž §¨æ«˜©ž ¤˜ œå¤˜  ©à©«ã.
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. ’騘 §¦¬ ž š¨˜££ã œå¤˜  ©à©«ã, §žš˜å¤œ«œ ©«¦ ‹áŸž£˜ 1.4.
+
+‘†‹„ˆ—‘†: ‰˜Ÿéª › ˜«¨â®œ«œ ˜¬«ã¤ «ž¤ §œ¨ ãšž©ž, §¨¦©§˜Ÿã©«œ ¤˜ £ž¤
+ ˜§¦£¤ž£¦¤œçœ«œ, £˜Ÿ˜å¤œ«œ £œ «ž ®¨ã©ž.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 1.4: ƒˆŽ‡—‘† ‰„ˆ‹„ŒŽ“ - €„‹ŽŠ†
+
+ **  œå©«œ ©œ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž §˜«ã©«œ i š ˜ ¤˜ §˜¨œ£™á¢¢œ«œ ¡œå£œ¤¦. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ £â®¨  «ž¤ §¨é«ž š¨˜££ã §˜¨˜¡á«à ©ž£œ à£â¤ž £œ --->.
+
+ 2. ‚ ˜ ¤˜ ¡á¤œ«œ «ž¤ §¨é«ž š¨˜££ã å› ˜ £œ «ž¤ ›œç«œ¨ž, £œ«˜¡ ¤œå©«œ «¦¤
+ ›¨¦£â˜ §á¤à ©«¦¤ §¨é«¦ ®˜¨˜¡«ã¨˜ ‹„’€ ˜§æ 槦¬ Ÿ˜ §˜¨œ£™¢žŸœå «¦ ¡œå£œ¤¦.
+
+ 3. ˜«ã©«œ «¦ i ¡˜  §¢ž¡«¨¦¢¦šã©«œ « ª ˜§˜¨˜å«ž«œª §¨¦©Ÿã¡œª.
+
+ 4. ‰˜Ÿéª › ¦¨Ÿé¤œ«œ ¡áŸœ ¢áŸ¦ª §˜«ã©«œ <ESC> š ˜ ¤˜ œ§ ©«¨â¯œ«œ ©«ž¤
+ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 2 £â®¨  4 š ˜ ¤˜ › ¦¨Ÿé©œ«œ
+ «ž¤ §¨æ«˜©ž.
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. ¤ œå©«œ ᤜ«¦  £œ «ž¤ §˜¨œ£™¦¢ã ¡œ £â¤¦¬ £œ«˜¡ ¤žŸœå«œ ©«ž¤
+ §˜¨˜¡á«à §œ¨å¢ž¯ž.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 1 „ˆŠ†–†
+
+
+ 1. Ž ›¨¦£â˜ª ¡ ¤œå«˜  ®¨ž© £¦§¦ é¤«˜ª œå«œ «˜ §¢ã¡«¨˜ ›¨¦£â˜ ã «˜ hjkl.
+ h (˜¨ ©«â¨˜) j (¡á«à) k (§á¤à) l (›œ¥ á)
+
+ 2. ‚ ˜ ¤˜ £§œå«œ ©«¦¤ Vim (˜§æ «ž¤ §¨¦«¨¦§ã %) š¨á¯«œ: vim €•„ˆŽ <ENTER>
+
+ 3. ‚ ˜ ¤˜ ™šœå«œ š¨á¯«œ: <ESC> :q! <ENTER> š ˜ ˜§æ¨¨ ¯ž «à¤ ˜¢¢˜šé¤.
+ ì š¨á¯«œ: <ESC> :wq <ENTER> š ˜ ˜§¦Ÿã¡œ¬©ž «à¤ ˜¢¢˜šé¤.
+
+ 4. ‚ ˜ ¤˜ › ˜š¨á¯œ«œ ⤘¤ ®˜¨˜¡«ã¨˜ ¡á«à ˜§æ «¦¤ ›¨¦£â˜ ©œ
+ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž §˜«ã©«œ: x
+
+ 5. ‚ ˜ ¤˜ œ ©ášœ«œ ¡œå£œ¤¦ ©«¦¤ ›¨¦£â˜ 橦 œå©«œ ©œ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž š¨á¯«œ:
+ i §¢ž¡«¨¦¢¦šã©«œ «¦ ¡œå£œ¤¦ <ESC>
+
+‘†‹„ˆ—‘†: ˜«é¤«˜ª <ESC> Ÿ˜ «¦§¦Ÿœ«žŸœå«œ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž ã Ÿ˜
+ ˜¡¬¨é©œ«œ £å˜ ˜¤œ§ Ÿç£ž«ž ¡˜  £œ¨ ¡éª ¦¢¦¡¢ž¨à£â¤ž œ¤«¦¢ã.
+
+’騘 ©¬¤œ®å©«œ £œ «¦ ‹áŸž£˜ 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 2.1: „Œ’ŽŠ„‘ ƒˆ€‚€”†‘
+
+ ** ‚¨á¯«œ dw š ˜ ¤˜ › ˜š¨á¯œ«œ £â®¨  «¦ «â¢¦ª £å˜ª ¢â¥žª. **
+
+ 1. ˜«ã©«œ <ESC> š ˜ ¤˜ ™œ™˜ àŸœå«œ æ«  œå©«œ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž.
+
+ 2. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ --->.
+
+ 3. žš˜å¤œ«œ «¦¤ ›¨¦£â˜ ©«ž¤ ˜¨®ã «žª ¢â¥žª §¦¬ §¨â§œ  ¤˜ › ˜š¨˜­œå.
+
+ 4. ‚¨á¯«œ dw š ˜ ¤˜ ¡á¤œ«œ «ž¤ ¢â¥ž ¤˜ œ¥˜­˜¤ ©«œå.
+
+‘†‹„ˆ—‘†: ’˜ š¨á££˜«˜ dw Ÿ˜ œ£­˜¤ ©«¦ç¤ ©«ž¤ «œ¢œ¬«˜å˜ š¨˜££ã «žª ¦Ÿæ¤žª 橦
+ «˜ §¢ž¡«¨¦¢¦šœå«œ. €¤ š¨á¯˜«œ ¡á«  ¢áŸ¦ª, §˜«ã©«œ <ESC> ¡˜ 
+ ¥œ¡ ¤ã©«œ ˜§æ «ž¤ ˜¨®ã.
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 3 ¡˜  4 £â®¨  ž §¨æ«˜©ž ¤˜ œå¤˜  ©à©«ã ¡˜ 
+ §žš˜å¤«œ ©«¦ ‹áŸž£˜ 2.2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 2.2: „ˆ‘‘Ž’„„‘ „Œ’ŽŠ„‘ ƒˆ€‚€”†‘
+
+ ** ¢ž¡«¨¦¢¦šã©«œ d$ š ˜ ¤˜ › ˜š¨á¯œ«œ £â®¨  «¦ «â¢¦ª «žª š¨˜££ãª. **
+
+ 1. ˜«ã©«œ <ESC> š ˜ ¤˜ ™œ™˜ àŸœå«œ æ«  œå©«œ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž.
+
+ 2. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ --->.
+
+ 3. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«¦ «â¢¦ª «žª ©à©«ãª š¨˜££ãª (‹„’€ «ž¤ §¨é«ž . ).
+
+ 4. ˜«ã©«œ d$ š ˜ ¤˜ › ˜š¨á¯œ«œ £â®¨  «¦ «â¢¦ª «žª š¨˜££ãª.
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+ 5. žš˜å¤œ«œ ©«¦ ‹áŸž£˜ 2.3 š ˜ ¤˜ ¡˜«˜¢á™œ«œ «  ©¬£™˜å¤œ .
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 2.3: „ˆ „Œ’ŽŠ—Œ ‰€ˆ €Œ’ˆ‰„ˆ‹„Œ—Œ
+
+
+† £¦¨­ã «žª œ¤«¦¢ãª › ˜š¨˜­ãª d œå¤˜  ઠœ¥ãª:
+
+ [˜¨ Ÿ£æª] d ˜¤« ¡œå£œ¤¦ ì d [˜¨ Ÿ£æª] ˜¤« ¡œå£œ¤¦
+ ¬:
+ ˜¨ Ÿ£æª - §æ©œª ­¦¨âª Ÿ˜ œ¡«œ¢œ©«œå ž œ¤«¦¢ã (§¨¦˜ ¨œ« ¡æ, œ¥' ¦¨ ©£¦ç=1).
+ d - ž œ¤«¦¢ã «žª › ˜š¨˜­ãª.
+ ˜¤« ¡œå£œ¤¦ - §á¤à ©œ «  Ÿ˜ ¢œ «¦¬¨šã©œ  ž œ¤«¦¢ã (§˜¨˜¡á«à ¢å©«˜).
+
+ ‹å˜ £ ¡¨ã ¢å©«˜ ˜§æ ˜¤« ¡œå£œ¤˜:
+ w - ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª «žª ¢â¥žª, §œ¨ ¢˜£™á¤¦¤«˜ª «¦ › á©«ž£˜.
+ e - ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª «žª ¢â¥žª, •—ˆ‘ «¦ › á©«ž£˜.
+ $ - ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª «žª š¨˜££ãª.
+
+‘†‹„ˆ—‘†: ‚ ˜ «¦¬ª «ç§¦¬ª «žª §œ¨ §â«œ ˜ª, §˜«é¤«˜ª ˜§¢éª «¦ ˜¤« ¡œå£œ¤¦ 橦
+ œå©«œ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž ®à¨åª ¡á§¦ ˜ œ¤«¦¢ã Ÿ˜ £œ«˜¡ ¤ã©œ«œ
+ «¦¤ ›¨¦£â˜ æ§àª ¡˜Ÿ¦¨åœ«˜  ©«ž¤ ¢å©«˜ ˜¤« ¡œ £â¤à¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 2.4: ‹ˆ€ „€ˆ„‘† ‘’†Œ '„Œ’ŽŠ†-€Œ’ˆ‰„ˆ‹„ŒŽ'
+
+ ** ¢ž¡«¨¦¢¦šã©«œ dd š ˜ ¤˜ › ˜š¨á¯œ«œ 梞 «ž š¨˜££ã. **
+
+ „¥˜ «å˜ª «žª ©¬®¤æ«ž«˜ª «žª › ˜š¨˜­ãª ¦¢æ¡¢ž¨žª š¨˜££ãª, ¦  ©®œ› ˜©«âª
+ «¦¬ Vim ˜§¦­á© ©˜¤ æ«  Ÿ˜ 㫘¤ œ¬¡¦¢æ«œ¨¦ ¤˜ š¨á­œ«œ ˜§¢éª ›ç¦ d ©«ž
+ ©œ ¨á š ˜ ¤˜ › ˜š¨á¯œ«œ £å˜ š¨˜££ã.
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž ›œç«œ¨ž š¨˜££ã «žª §˜¨˜¡á«à ­¨á©žª.
+ 2. ‚¨á¯«œ dd š ˜ ¤˜ › ˜š¨á¯œ«œ «ž š¨˜££ã.
+ 3. ’騘 £œ«˜¡ ¤žŸœå«œ ©«ž¤ «â«˜¨«ž š¨˜££ã.
+ 4. ‚¨á¯«œ 2dd (Ÿ¬£žŸœå«œ ˜¨ Ÿ£æª-œ¤«¦¢ã-˜¤« ¡œå£œ¤¦) š ˜ ¤˜
+ › ˜š¨á¯œ«œ ›ç¦ š¨˜££âª.
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 2.5: † „Œ’ŽŠ† €Œ€ˆ„‘†‘
+
+ ** ˜«ã©«œ u š ˜ ¤˜ ˜¤˜ ¨â©œ«œ « ª «œ¢œ¬«˜åœª œ¤«¦¢âª,
+ U š ˜ ¤˜ › ¦¨Ÿé©œ«œ 梞 «ž š¨˜££ã. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ ---> ¡˜ 
+ «¦§¦Ÿœ«ã©«œ «¦¤ §á¤à ©«¦ §¨é«¦ ¢áŸ¦ª.
+ 2. ˜«ã©«œ x š ˜ ¤˜ › ˜š¨á¯œ«œ «¦¤ §¨é«¦ ˜¤œ§ Ÿç£ž«¦ ®˜¨˜¡«ã¨˜.
+ 3. ’騘 §˜«ã©«œ u š ˜ ¤˜ ˜¤˜ ¨â©œ«œ «ž¤ «œ¢œ¬«˜å˜ œ¡«œ¢œ©£â¤ž œ¤«¦¢ã.
+ 4. €¬«ã «ž ­¦¨á › ¦¨Ÿé©«œ 梘 «˜ ¢áŸž ©«ž š¨˜££ã ®¨ž© £¦§¦ é¤«˜ª «ž¤ œ¤«¦¢ã x.
+ 5. ’騘 §˜«ã©«œ ⤘ ¡œ­˜¢˜å¦ U š ˜ ¤˜ œ§ ©«¨â¯œ«œ «ž š¨˜££ã ©«ž¤ ˜¨® ¡ã
+ «žª ¡˜«á©«˜©ž.
+ 6. ’騘 §˜«ã©«œ u £œ¨ ¡âª ­¦¨âª š ˜ ¤˜ ˜¤˜ ¨â©œ«œ «ž¤ U ¡˜ 
+ §¨¦žš¦ç£œ¤œª œ¤«¦¢âª.
+ 7. ’騘 §˜«ã©«œ CTRL-R (¡¨˜«é¤«˜ª §˜«ž£â¤¦ «¦ §¢ã¡«¨¦ CTRL ¡˜Ÿéª §˜«á«œ «¦ R)
+ £œ¨ ¡âª ­¦¨âª š ˜ ¤˜ œ§˜¤˜­â¨œ«œ « ª œ¤«¦¢âª (˜¤˜å¨œ©ž «à¤ ˜¤˜ ¨â©œà¤).
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. €¬«âª œå¤˜  §¦¢ç ®¨ã© £œª œ¤«¦¢âª. ’騘 §žš˜å¤œ«œ ©«ž¤
+ œ¨å¢ž¯ž «¦¬ ‹˜Ÿã£˜«¦ª 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 2 „ˆŠ†–†
+
+
+ 1. ‚ ˜ ¤˜ › ˜š¨á¯œ«œ ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª ¢â¥žª š¨á¯«œ: dw
+
+ 2. ‚ ˜ ¤˜ › ˜š¨á¯œ«œ ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª š¨˜££ãª š¨á¯«œ: d$
+
+ 3. ‚ ˜ ¤˜ › ˜š¨á¯œ«œ ¦¢æ¡¢ž¨ž «ž š¨˜££ã š¨á¯«œ: dd
+
+ 4. † £¦¨­ã š ˜ £å˜ œ¤«¦¢ã ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž œå¤˜ :
+
+ [˜¨ Ÿ£æª] œ¤«¦¢ã ˜¤« ¡œå£œ¤¦ ì œ¤«¦¢ã [˜¨ Ÿ£æª] ˜¤« ¡œå£œ¤¦
+ 槦¬:
+ ˜¨ Ÿ£æª - §æ©œª ­¦¨âª ¤˜ œ§˜¤˜¢ž­Ÿœå ž œ¤«¦¢ã
+ œ¤«¦¢ã - «  ¤˜ šå¤œ , æ§àª ž d š ˜ › ˜š¨˜­ã
+ ˜¤« ¡œå£œ¤¦ - §á¤à ©œ «  ¤˜ œ¤œ¨šã©œ  ž œ¤«¦¢ã, æ§àª w (¢â¥ž),
+ $ («â¢¦ª «žª š¨˜££ãª), ¡«¢.
+
+ 5. ‚ ˜ ¤˜ ˜¤˜ ¨â©œ«œ §¨¦žš¦ç£œ¤œª œ¤â¨šœ œª, §˜«ã©«œ: u (§œæ u)
+ ‚ ˜ ¤˜ ˜¤˜ ¨â©œ«œ 梜ª « ª ˜¢¢˜šâª ©«ž š¨˜££ã, §˜«ã©«œ: U (¡œ­˜¢˜å¦ U)
+ ‚ ˜ ¤˜ ˜¤˜ ¨â©œ«œ « ª ˜¤˜ ¨â©œ ª, §˜«ã©«œ: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 3.1: † „Œ’ŽŠ† ’ŽŽ‡„’†‘†‘
+
+ ** ˜«ã©«œ p š ˜ ¤˜ «¦§¦Ÿœ«ã©œ«œ «ž¤ «œ¢œ¬«˜å˜ › ˜š¨˜­ã £œ«á «¦¤ ›¨¦£â˜. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §¨é«ž š¨˜££ã «žª §˜¨˜¡á«à ¦£á›˜ª.
+
+ 2. ˜«ã©«œ dd š ˜ ¤˜ › ˜š¨á¯œ«œ «ž š¨˜££ã ¡˜  ¤˜ «ž¤ ˜§¦Ÿž¡œç©œ«œ ©œ
+ §¨¦©à¨ ¤ã £¤ã£ž «¦¬ Vim.
+
+ 3. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž š¨˜££ã €Œ— ˜§æ œ¡œå §¦¬ Ÿ˜ §¨â§œ  ¤˜ §áœ 
+ ž › ˜š¨˜££â¤ž š¨˜££ã.
+
+ 4.  œå©«œ ©œ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž, §˜«ã©«œ p š ˜ ¤˜ ™á¢œ«œ «ž š¨˜££ã.
+
+ 5. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 2 âઠ4 š ˜ ¤˜ ™á¢œ«œ 梜ª « ª š¨˜££âª ©«ž
+ ©à©«ã ©œ ¨á.
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 3.2: † „Œ’ŽŠ† €Œ’ˆ‰€’€‘’€‘†‘
+
+
+ ** ˜«ã©«œ r ¡˜  ®˜¨˜¡«ã¨˜ š ˜ ¤˜ ˜¢¢á¥œ«œ ˜¬«æ¤ §¦¬ œå¤˜ 
+ ¡á«à ˜§æ «¦¤ ›¨¦£â˜. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §¨é«ž š¨˜££ã §˜¨˜¡á«à ©ž£œ é£œ¤ž £œ --->.
+
+ 2. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ â«©  é©«œ ¤˜ œå¤˜  §á¤à ©«¦ §¨é«¦ ¢áŸ¦ª.
+
+ 3. ˜«ã©«œ r ¡˜  £œ«á «¦¤ ®˜¨˜¡«ã¨˜ ¦ ¦§¦å¦ª › ¦¨Ÿé¤œ  «¦ ¢áŸ¦ª.
+
+ 4. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 2 ¡˜  3 £â®¨  ¤˜ œå¤˜  ©à©«ã ž §¨é«ž š¨˜££ã.
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. ’騘 §žš˜å¤œ«œ ©«¦ ‹áŸž£˜ 3.2.
+
+‘†‹„ˆ—‘†: Œ˜ Ÿ¬£á©«œ æ«  §¨â§œ  ¤˜ £˜Ÿ˜å¤œ«œ £œ «ž ®¨ã©ž, ¡˜  æ®  £œ
+ «ž¤ ˜§¦£¤ž£æ¤œ¬©ž.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 3.3: † „Œ’ŽŠ† €ŠŠ€‚†‘
+
+ ** ‚ ˜ ¤˜ ˜¢¢á¥œ«œ «£ã£˜ ã 梞 «ž ¢â¥ž, §˜«ã©«œ cw . **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §¨é«ž š¨˜££ã §˜¨˜¡á«à ©ž£œ à£â¤ž £œ --->.
+
+ 2. ’¦§¦Ÿœ«ã©«œ «¦¤ ›¨¦£â˜ §á¤à ©«¦ u «žª ¢â¥žª lubw.
+
+ 3. ˜«ã©«œ cw ¡˜  «ž ©à©«ã ¢â¥ž (©«ž¤ §œ¨å§«à©ž ˜¬«ã, š¨á¯«œ 'ine'.)
+
+ 4. ˜«ã©«œ <ESC> ¡˜  §žš˜å¤œ«œ ©«¦ œ§æ£œ¤¦ ¢áŸ¦ª (©«¦¤ §¨é«¦
+ ®˜¨˜¡«ã¨˜ §¨¦ª ˜¢¢˜šã).
+
+ 5. „§˜¤˜¢á™œ«œ «˜ ™ã£˜«˜ 3 ¡˜  4 £â®¨ ª 櫦¬ ž §¨é«ž §¨æ«˜©ž ¤˜ œå¤˜ 
+ å› ˜ £œ «ž ›œç«œ¨ž.
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+˜¨˜«ž¨œå©«œ æ«  ž cw æ®  £æ¤¦ ˜¤« ¡˜Ÿ ©«áœ  «ž ¢â¥ž, ˜¢¢á ©˜ª œ ©ášœ 
+œ§å©žª ©œ §˜¨œ£™¦¢ã.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 3.4: „ˆ‘‘Ž’„„‘ €ŠŠ€‚„‘ ‹„ c
+
+
+ ** † œ¤«¦¢ã ˜¢¢˜šãª ®¨ž© £¦§¦ œå«˜  £œ «˜ å› ˜ ˜¤« ¡œå£œ¤˜ «žª › ˜š¨˜­ãª. **
+
+
+ 1. † œ¤«¦¢ã ˜¢¢˜šãª ›¦¬¢œçœ  £œ «¦¤ å› ¦ «¨æ§¦ æ§àª ž › ˜š¨˜­ã. † £¦¨­ã œå¤˜ :
+
+ [˜¨ Ÿ£æª] c ˜¤« ¡œå£œ¤¦ ì c [˜¨ Ÿ£æª] ˜¤« ¡œå£œ¤¦
+
+ 2. ’˜ ˜¤« ¡œå£œ¤˜ œå¤˜  §á¢  «˜ å› ˜, æ§àª w (¢â¥ž), $ («â¢¦ª š¨˜££ãª), ¡«¢.
+
+ 3. ‹œ«˜¡ ¤žŸœå«œ ©«ž¤ §¨é«ž š¨˜££ã §˜¨˜¡á«à ©ž£œ à£â¤ž £œ --->.
+
+ 4. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«¦ §¨é«¦ ¢áŸ¦ª.
+
+ 5. ‚¨á¯«œ c$ š ˜ ¤˜ ¡á¤œ«œ «¦ ¬§æ¢¦ §¦ «žª š¨˜££ãª å› ¦ £œ «ž ›œç«œ¨ž
+ ¡˜  §˜«ã©«œ <ESC>.
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 3 „ˆŠ†–†
+
+
+ 1. ‚ ˜ ¤˜ «¦§¦Ÿœ«ã©œ«œ ¡œå£œ¤¦ §¦¬ £æ¢ ª ⮜  › ˜š¨˜­œå, §˜«ã©«œ p .
+ €¬«æ «¦§¦Ÿœ«œå «¦ › ˜š¨˜££â¤¦ ¡œå£œ¤¦ ‹„’€ «¦¤ ›¨¦£â˜ (˜¤ › ˜š¨á­«ž¡œ
+ š¨˜££ã Ÿ˜ §áœ  £œ«á ©«ž š¨˜££ã ¡á«à ˜§æ «¦¤ ›¨¦£â˜.
+
+ 2. ‚ ˜ ¤˜ ˜¤« ¡˜«˜©«ã©œ«œ «¦¤ ®˜¨˜¡«ã¨˜ ¡á«à ˜§æ «¦¤ ›¨¦£â˜, §˜«ã©«œ r
+ ¡˜  £œ«á «¦¤ ®˜¨˜¡«ã¨˜ §¦¬ Ÿ˜ ˜¤« ¡˜«˜©«ã©œ  «¦¤ ˜¨® ¡æ.
+
+ 3. † œ¤«¦¢ã ˜¢¢˜šãª ©˜ª œ§ «¨â§œ  ¤˜ ˜¢¢á¥œ«œ «¦ ¡˜Ÿ¦¨ ©£â¤¦ ˜¤« ¡œå£œ¤¦
+ ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª «¦¬ ˜¤« ¡œå£œ¤¦. .®. š¨á¯«œ cw š ˜ ¤˜
+ ˜¢¢á¥œ«œ ˜§æ «¦¤ ›¨¦£â˜ £â®¨  «¦ «â¢¦ª «žª ¢â¥žª, c$ š ˜ ¤˜ ˜¢¢á¥œ«œ
+ £â®¨  «¦ «â¢¦ª š¨˜££ãª.
+
+ 4. † £¦¨­ã š ˜ «ž¤ ˜¢¢˜šã œå¤˜ :
+
+ [˜¨ Ÿ£æª] c ˜¤« ¡œå£œ¤¦ ì c [˜¨ Ÿ£æª] ˜¤« ¡œå£œ¤¦
+
+’騘 ©¬¤œ®å©«œ £œ «¦ œ§æ£œ¤¦ £áŸž£˜.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 4.1: ‡„‘† ‰€ˆ ‰€’€‘’€‘† €•„ˆŽ“
+
+
+ ** ˜«ã©«œ CTRL-g š ˜ ¤˜ œ£­˜¤ ©«œå ž Ÿâ©ž ©˜ª ©«¦ ˜¨®œå¦ ¡˜  ž ¡˜«á©«˜©ã «¦¬.
+ ˜«ã©«œ SHIFT-G š ˜ ¤˜ §á«œ ©œ £å˜ š¨˜££ã ©«¦ ˜¨®œå¦. **
+
+ ‘ž£œåà©ž: ƒ ˜™á©«œ ¦¢æ¡¢ž¨¦ «¦ £áŸž£˜ §¨ ¤ œ¡«œ¢â©œ«œ ¡á§¦ ¦ ˜§æ «˜ ™ã£˜«˜!!
+
+ 1. ‰¨˜«ã©«œ §˜«ž£â¤¦ «¦ §¢ã¡«¨¦ Ctrl ¡˜  §˜«ã©«œ g . ‹å˜ š¨˜££ã ¡˜«á©«˜©žª
+ Ÿ˜ œ£­˜¤ ©«œå ©«¦ ¡á«à £â¨¦ª «žª ©œ¢å›˜ª £œ «¦ 椦£˜ ˜¨®œå¦¬ ¡˜  «ž
+ š¨˜££ã §¦¬ œå©«œ. ‡¬£žŸœå«œ «¦¤ ˜¨ Ÿ£æ š¨˜££ãª š ˜ «¦ 㣘 3.
+
+ 2. ˜«ã©«œ shift-G š ˜ ¤˜ £œ«˜¡ ¤žŸœå«œ ©«¦ «â¢¦ª «¦¬ ˜¨®œå¦¬.
+
+ 3. ˜«ã©«œ «¦¤ ˜¨ Ÿ£æ «žª š¨˜££ãª §¦¬ 㩘©«˜¤ ¡˜  £œ«á shift-G. €¬«æ Ÿ˜
+ ©˜ª œ§ ©«¨â¯œ  ©«ž š¨˜££ã §¦¬ 㩘©«˜¤ §¨ ¤ §˜«ã©œ«œ š ˜ §¨é«ž ­¦¨á Ctrl-g.
+ (¤ §¢ž¡«¨¦¢¦šœå«œ «¦¬ª ˜¨ Ÿ£¦çª, ƒ„Œ Ÿ˜ œ£­˜¤å¦¤«˜  ©«ž¤ ¦Ÿæ¤ž).
+
+ 4. €¤ ¤¦ éŸœ«œ ©åš¦¬¨¦ª š ˜ ˜¬«æ, œ¡«œ¢â©«œ «˜ ™ã£˜«˜ 1 âઠ3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 4.2: † „Œ’ŽŠ† €Œ€…†’†‘†‘
+
+
+ ** ˜«ã©«œ / ˜¡¦¢¦¬Ÿ¦ç£œ¤¦ ˜§æ «ž ­¨á©ž §¦¬ ¯á®¤œ«œ. **
+
+ 1. ‘œ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž §˜«ã©«œ «¦¤ ®˜¨˜¡«ã¨˜ / . ˜¨˜«ž¨ã©«œ æ«  ˜¬«æª ¡˜ 
+ ¦ ›¨¦£â˜ª œ£­˜¤å¦¤«˜  ©«¦ ¡á«à £â¨¦ª «žª ¦Ÿæ¤žª æ§àª £œ «ž¤ œ¤«¦¢ã : .
+
+ 2. ’騘 š¨á¯«œ 'errroor' <ENTER>. €¬«ã œå¤˜  ž ¢â¥ž §¦¬ Ÿâ¢œ«œ ¤˜ ¯á¥œ«œ.
+
+ 3. ‚ ˜ ¤˜ ¯á¥œ«œ ¥˜¤á š ˜ «ž¤ å› ˜ ­¨á©ž, §˜«ã©«œ ˜§¢éª n .
+ ‚ ˜ ¤˜ ¯á¥œ«œ «ž¤ å› ˜ ­¨á©ž ©«ž¤ ˜¤«åŸœ«ž ¡˜«œçŸ¬¤©ž, §˜«ã©«œ Shift-N .
+
+ 4. €¤ Ÿâ¢œ«œ ¤˜ ¯á¥œ«œ š ˜ £å˜ ­¨á©ž §¨¦ª «˜ §å©à, ®¨ž© £¦§¦ ã©«œ «ž¤ œ¤«¦¢ã ? ˜¤«å «žª / .
+
+---> ¤ ž ˜¤˜ã«ž©ž ­«á©œ  ©«¦ «â¢¦ª «¦¬ ˜¨®œå¦¬ Ÿ˜ ©¬¤œ®å©œ  ˜§æ «ž¤ ˜¨®ã.
+
+ "errroor" is not the way to spell error; errroor is an error.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 4.3: „“„‘† ’€ˆˆ€‘’—Œ €„Œ‡„‘„—Œ
+
+
+ ** ˜«ã©«œ % š ˜ ¤˜ ™¨œå«œ «ž¤ ˜¤«å©«¦ ®ž ), ], ã } . **
+
+ 1. ’¦§¦Ÿœ«ã©«œ «¦¤ ›¨¦£â˜ ©œ ¡á§¦ ˜ (, [, ã { ©«ž¤ §˜¨˜¡á«à š¨˜££ã
+ ©ž£œ à£â¤ž £œ --->.
+
+ 2. ’騘 §˜«ã©«œ «¦¤ ®˜¨˜¡«ã¨˜ % .
+
+ 3. Ž ›¨¦£â˜ª Ÿ˜ §¨â§œ  ¤˜ œå¤˜  ©«ž¤ ˜¤«å©«¦ ®ž §˜¨â¤Ÿœ©ž ã ˜š¡ç¢ž.
+
+ 4. ˜«ã©«œ % š ˜ ¤˜ £œ«˜¡ ¤ã©œ«œ «¦¤ ›¨¦£â˜ §å©à ©«ž¤ §¨é«ž ˜š¡ç¢ž
+ («¦¬ œ¬š˜¨ ¦ç).
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+‘†‹„ˆ—‘†: €¬«æ œå¤˜  §¦¢ç ®¨ã© £¦ ©«ž¤ ˜§¦©­˜¢£á«à©ž œ¤æª §¨¦š¨á££˜«¦ª
+ £œ £ž «˜ ¨ ˜©«âª §˜¨œ¤Ÿâ©œ ª!
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 4.4: „Œ€‘ ’ŽŽ‘ ‚ˆ€ €ŠŠ€‚† Š€‡—Œ
+
+
+ ** ‚¨á¯«œ :s/old/new/g š ˜ ¤˜ ˜¢¢á¥œ«œ «¦ 'new' £œ «¦ 'old'. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ --->.
+
+ 2. ‚¨á¯«œ :s/thee/the <ENTER> . ‘ž£œ é©«œ æ«  ˜¬«ã ž œ¤«¦¢ã ˜¢¢áœ  £æ¤¦
+ «ž¤ §¨é«ž œ£­á¤ ©ž ©«ž š¨˜££ã.
+
+ 3. ’騘 š¨á¯«œ :s/thee/the/g œ¤¤¦é¤«˜ª šœ¤ ¡ã ˜¤« ¡˜«á©«˜©ž ©«ž
+ š¨˜££ã. €¬«æ ˜¢¢áœ  梜ª « ª œ£­˜¤å©œ ª œ§å «žª š¨˜££ãª.
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. ‚ ˜ ¤˜ ˜¢¢á¥œ«œ ¡áŸœ œ£­á¤ ©ž £å˜ª ©¬£™¦¢¦©œ ¨áª £œ«˜¥ç ›ç¦ š¨˜££é¤,
+ š¨á¯«œ :#,#s/old/new/g 槦¬ #,# ¦  ˜¨ Ÿ£¦å «à¤ ›ç¦ š¨˜££é¤.
+ ‚¨á¯«œ :%s/old/new/g š ˜ ¤˜ ˜¢¢á¥œ«œ ¡áŸœ œ£­á¤ ©ž ©œ 梦 «¦ ˜¨®œå¦.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 4 „ˆŠ†–†
+
+
+ 1. ’¦ Ctrl-g œ£­˜¤åœ  «ž Ÿâ©ž ©˜ª ©«¦ ˜¨®œå¦ ¡˜  «ž¤ ¡˜«á©«˜©ã «¦¬.
+ ’¦ Shift-G §žš˜å¤œ  ©«¦ «â¢¦ª «¦¬ ˜¨®œå¦¬. 뤘ª ˜¨ Ÿ£æª š¨˜££ãª
+ ˜¡¦¢¦¬Ÿ¦ç£œ¤¦ª ˜§æ Shift-G §žš˜å¤œ  ©œ œ¡œå¤ž «ž š¨˜££ã.
+
+ 2. ‚¨á­¦¤«˜ª / ˜¡¦¢¦¬Ÿ¦ç£œ¤¦ ˜§æ £å˜ ­¨á©ž ¯á®¤œ  §¨¦ª «˜ ‹Ž‘’€ š ˜
+ «ž ­¨á©ž. ‚¨á­¦¤«˜ª ? ˜¡¦¢¦¬Ÿ¦ç£œ¤¦ ˜§æ £å˜ ­¨á©ž ¯á®¤œ  §¨¦ª «˜ ˆ‘—
+ š ˜ «ž ­¨á©ž. ‹œ«á ˜§æ £å˜ ˜¤˜ã«ž©ž §˜«ã©«œ n š ˜ ¤˜ ™¨œå«œ «ž¤
+ œ§æ£œ¤ž œ£­á¤ ©ž §¨¦ª «ž¤ å› ˜ ¡˜«œçŸ¬¤©ž ã Shift-N š ˜ ¤˜ ¯á¥œ«œ
+ §¨¦ª «ž¤ ˜¤«åŸœ«ž ¡˜«œçŸ¬¤©ž.
+
+ 3. ˜«é¤«˜ª % 橦 ¦ ›¨¦£â˜ª œå¤˜  §á¤à ©œ £å˜ (,),[,],{, ã } œ¤«¦§åœ 
+ «¦ ˜¤«å©«¦ ®¦ «˜å¨  «¦¬ œ¬š˜¨ ¦ç.
+
+ 4. ‚ ˜ ˜¤« ¡˜«á©«˜©ž £œ new «¦¬ §¨é«¦¬ old ©«ž š¨˜££ã š¨á¯«œ :s/old/new
+ ‚ ˜ ˜¤« ¡˜«á©«˜©ž £œ new æ¢à¤ «à¤ 'old' ©«ž š¨˜££ã š¨á¯«œ :s/old/new/g
+ ‚ ˜ ˜¤« ¡˜«á©«˜©ž ­¨á©œà¤ £œ«˜¥ç ›ç¦ # š¨˜££é¤ š¨á¯«œ :#,#s/old/new/g
+ ‚ ˜ ˜¤« ¡˜«á©«˜©ž æ¢à¤ «à¤ œ£­˜¤å©œà¤ ©«¦ ˜¨®œå¦ š¨á¯«œ :%s/old/new/g
+ ‚ ˜ œ¨é«ž©ž œ§ ™œ™˜åà©žª ¡áŸœ ­¦¨á §¨¦©Ÿâ©«œ ⤘ 'c' "%s/old/new/gc
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 5.1: —‘ „‰’„Š— ‹ˆ€ „—’„ˆ‰† „Œ’ŽŠ†
+
+
+** ‚¨á¯«œ :! ˜¡¦¢¦¬Ÿ¦ç£œ¤¦ ˜§æ £å˜ œ¥à«œ¨ ¡ã œ¤«¦¢ã š ˜ ¤˜ «ž¤ œ¡«œ¢â©œ«œ. **
+
+ 1. ˜«ã©«œ «ž¤ ¦ ¡œå˜ œ¤«¦¢ã : š ˜ ¤˜ Ÿâ©œ«œ «¦¤ ›¨¦£â˜ ©«¦ ¡á«à £â¨¦ª
+ «žª ¦Ÿæ¤žª. €¬«æ ©˜ª œ§ «¨â§œ  ¤˜ ›é©œ«œ £å˜ œ¤«¦¢ã.
+
+ 2. ’騘 §˜«ã©«œ «¦ ! (Ÿ˜¬£˜©« ¡æ). €¬«æ ©˜ª œ§ «¨â§œ  ¤˜ œ¡«œ¢â©œ«œ
+ ¦§¦ ˜›ã§¦«œ œ¥à«œ¨ ¡ã œ¤«¦¢ã «¦¬ ­¢¦ ¦ç.
+
+ 3. ‘˜¤ §˜¨á›œ š£˜ š¨á¯«œ ls £œ«á ˜§æ «¦ ! ¡˜  §˜«ã©«œ <ENTER>. €¬«æ Ÿ˜
+ ©˜ª œ£­˜¤å©œ  £å˜ ¢å©«˜ «¦¬ ¡˜«˜¢æš¦¬ ©˜ª, ˜¡¨ ™éª ©˜¤ ¤˜ 㩘©«˜¤ ©«ž¤
+ §¨¦«¨¦§ã «¦¬ ­¢¦ ¦ç. ì ®¨ž© £¦§¦ ã©«œ :!dir ˜¤ «¦ ls ›œ¤ ›¦¬¢œçœ .
+
+---> ‘ž£œåà©ž: „夘  ›¬¤˜«æ¤ ¤˜ œ¡«œ¢â©œ«œ ¦§¦ ˜›ã§¦«œ œ¥à«œ¨ ¡ã œ¤«¦¢ã
+ £œ ˜¬«æ¤ «¦¤ «¨æ§¦.
+
+---> ‘ž£œåà©ž: ª ¦  œ¤«¦¢âª : §¨â§œ  ¤˜ «œ¨£˜«å¦¤«˜  §˜«é¤«˜ª «¦ <ENTER>.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 5.2: „ˆ‘‘Ž’„€ „ˆ „‚‚€”†‘ €•„ˆ—Œ
+
+
+ ** ‚ ˜ ¤˜ ©é©œ«œ « ª ˜¢¢ášœª §¦¬ ¡á¤˜«œ ©«¦ ˜¨®œå¦, š¨á¯«œ :w €•„ˆŽ. **
+
+ 1. ‚¨á¯«œ :!dir ã :!ls š ˜ ¤˜ §á¨œ«œ £å˜ ¢å©«˜ «¦¬ ¡˜«˜¢æš¦¬ ©˜ª.
+ 웞 ¥â¨œ«œ æ«  §¨â§œ  ¤˜ §˜«ã©œ«œ <ENTER> £œ«á ˜§æ ˜¬«æ.
+
+ 2. ƒ ˜¢â¥«œ ⤘ 椦£˜ ˜¨®œå¦¬ §¦¬ ›œ¤ ¬§á¨®œ  ˜¡æ£˜, æ§àª «¦ TEST.
+
+ 3. ’騘 š¨á¯«œ: :w TEST (槦¬ TEST œå¤˜  «¦ 椦£˜ ˜¨®œå¦¬ §¦¬ › ˜¢â¥˜«œ).
+
+ 4. €¬«æ ©éœ  梦 «¦ ˜¨®œå¦ (vim Tutor) £œ «¦ 椦£˜ TEST. ‚ ˜ ¤˜ «¦
+ œ§˜¢žŸœç©œ«œ, š¨á¯«œ ¥˜¤á :!dir š ˜ ¤˜ ›œå«œ «¦¤ ¡˜«á¢¦šæ ©˜ª.
+
+---> ‘ž£œ é©«œ æ«  ˜¤ ™š˜å¤˜«œ ˜§æ «¦¤ Vim ¡˜  £§˜å¤˜«œ ¥˜¤á £œ «¦ 椦£˜
+ ˜¨®œå¦¬ TEST, «¦ ˜¨®œå¦ Ÿ˜ 㫘¤ ˜¡¨ ™âª ˜¤«åš¨˜­¦ «¦¬ tutor 櫘¤ «¦ ©é©˜«œ.
+
+ 5. ’騘 › ˜š¨á¯«œ «¦ ˜¨®œå¦ š¨á­¦¤«˜ª (MS-DOS): :!del TEST
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 5.3: „ˆŠ„‰’ˆ‰† „Œ’ŽŠ† „‚‚€”†‘
+
+
+ ** ‚ ˜ ¤˜ ©é©œ«œ «£ã£˜ «¦¬ ˜¨®œå¦¬, š¨á¯«œ :#,# w €•„ˆŽ **
+
+ 1. ꢢž £ ˜ ­¦¨á, š¨á¯«œ :!dir ã :!ls š ˜ ¤˜ §á¨œ«œ £å˜ ¢å©«˜ ˜§æ «¦¤
+ ¡˜«á¢¦šæ ©˜ª ¡˜  › ˜¢â¥«œ ⤘ ¡˜«á¢¢ž¢¦ 椦£˜ ˜¨®œå¦¬ æ§àª «¦ TEST.
+
+ 2. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«¦ §á¤à £â¨¦ª ˜¬«ãª «žª ©œ¢å›˜ª ¡˜  §˜«ã©«œ
+ Ctrl-g š ˜ ¤˜ ™¨œå«œ «¦¤ ˜¨ Ÿ£æ ˜¬«ãª «žª š¨˜££ãª.
+ Œ€ ‡“‹€‘’„ €“’ŽŒ ’ŽŒ €ˆ‡‹Ž!
+
+ 3. ’騘 §žš˜å¤œ«œ ©«¦ ¡á«à £â¨¦ª «žª ©œ¢å›˜ª ¡˜  §˜«ã©«œ Ctrl-g ¥˜¤á.
+ Œ€ ‡“‹€‘’„ ‰€ˆ €“’ŽŒ ’ŽŒ €ˆ‡‹Ž!
+
+ 4. ‚ ˜ ¤˜ ©é©œ«œ ‹ŽŒŽ ⤘ «£ã£˜ ©œ ˜¨®œå¦, š¨á¯«œ :#,# w TEST
+ 槦¬ #,# ¦  ›ç¦ ˜¨ Ÿ£¦å §¦¬ ˜§¦£¤ž£¦¤œç©˜«œ (§á¤à,¡á«à) ¡˜  TEST «¦
+ 椦£˜ «¦¬ ˜¨®œå¦¬ ©˜ª.
+
+ 5. ˜¤á, ›œå«œ æ«  «¦ ˜¨®œå¦ œå¤˜  œ¡œå £œ «ž¤ :!dir ˜¢¢á ‹†Œ «¦ › ˜š¨á¯œ«œ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 5.4: €Œ€‰’—Œ’€‘ ‰€ˆ „Œ—ŒŽŒ’€‘ €•„ˆ€
+
+
+ ** ‚ ˜ ¤˜ œ ©ášœ«œ «˜ §œ¨ œ®æ£œ¤˜ œ¤æª ˜¨®œå¦¬, š¨á¯«œ :r €•„ˆŽ **
+
+ 1. ‚¨á¯«œ :!dir š ˜ ¤˜ ™œ™˜ àŸœå«œ æ«  «¦ TEST ¬§á¨®œ  ˜§æ §¨ ¤.
+
+ 2. ’¦§¦Ÿœ«ã©«œ «¦¤ ›¨¦£â˜ ©«¦ §á¤à £â¨¦ª «žª ©œ¢å›˜ª.
+
+‘†‹„ˆ—‘†: €­æ«¦¬ œ¡«œ¢â©œ«œ «¦ 㣘 3 Ÿ˜ ›œå«œ «¦ ‹áŸž£˜ 5.3.
+ ‹œ«á ¡ ¤žŸœå«œ ‰€’— ¥˜¤á §¨¦ª «¦ £áŸž£˜ ˜¬«æ.
+
+ 3. ’騘 ˜¤˜¡«ã©«œ «¦ ˜¨®œå¦ ©˜ª TEST ®¨ž© £¦§¦ é¤«˜ª «ž¤ œ¤«¦¢ã :r TEST
+ 槦¬ TEST œå¤˜  «¦ 椦£˜ «¦¬ ˜¨®œå¦¬.
+
+‘†‹„ˆ—‘†: ’¦ ˜¨®œå¦ §¦¬ ˜¤˜¡«á«œ «¦§¦Ÿœ«œå«˜  ¥œ¡ ¤é¤«˜ª œ¡œå §¦¬ ™¨å©¡œ«˜ 
+ ¦ ›¨¦£â˜ª.
+
+ 4. ‚ ˜ ¤˜ œ§˜¢žŸœç©œ«œ æ«  «¦ ˜¨®œå¦ ˜¤˜¡«ãŸž¡œ, §å©à «¦¤ ›¨¦£â˜ ¡˜ 
+ §˜¨˜«ž¨ã©«œ æ«  ¬§á¨®¦¬¤ «é¨˜ ›ç¦ ˜¤«åš¨˜­˜ «¦¬ ‹˜Ÿã£˜«¦ª 5.3, «¦
+ ˜¨® ¡æ ¡˜  ž â¡›¦©ž «¦¬ ˜¨®œå¦¬.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 5 „ˆŠ†–†
+
+
+ 1. :!œ¤«¦¢ã œ¡«œ¢œå £å˜ œ¥à«œ¨ ¡ã œ¤«¦¢ã.
+
+ ‹œ¨ ¡á ®¨ã© £˜ §˜¨˜›œåš£˜«˜ œå¤˜  (MS-DOS):
+ :!dir - œ£­á¤ ©ž ¢å©«˜ª œ¤æª ¡˜«˜¢æš¦¬.
+ :!del €•„ˆŽ - › ˜š¨á­œ  «¦ €•„ˆŽ.
+
+ 2. :w €•„ˆŽ š¨á­œ  «¦ «¨â®à¤ ˜¨®œå¦ «¦¬ Vim ©«¦ ›å©¡¦ £œ 椦£˜ €•„ˆŽ.
+
+ 3. :#,#w €•„ˆŽ ©éœ  « ª š¨˜££âª ˜§æ # £â®¨  # ©«¦ €•„ˆŽ.
+
+ 4. :r €•„ˆŽ ˜¤˜¡«œå «¦ ˜¨®œå¦ ›å©¡¦¬ €•„ˆŽ ¡˜  «¦ §˜¨œ£™á¢¢œ  £â©˜
+ ©«¦ «¨â®¦¤ ˜¨®œå¦ £œ«á ˜§æ «ž Ÿâ©ž «¦¬ ›¨¦£â˜.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 6.1: † „Œ’ŽŠ† €ŒŽˆ‚‹€’Ž‘
+
+
+ ** ˜«ã©«œ o š ˜ ¤˜ ˜¤¦å¥œ«œ £å˜ š¨˜££ã ¡á«à ˜§æ «¦¤ ›¨¦£â˜ ¡˜  ¤˜
+ ™¨œŸœå«œ ©œ ‰˜«á©«˜©ž ‰œ £â¤¦¬. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §˜¨˜¡á«à š¨˜££ã ©ž£œ à£â¤ž £œ --->.
+
+ 2. ˜«ã©«œ o (§œæ) š ˜ ¤˜ ˜¤¦å¥œ«œ £å˜ š¨˜££ã ‰€’— ˜§æ «¦¤ ›¨¦£â˜ ¡˜  ¤˜
+ ™¨œŸœå«œ ©œ ‰˜«á©«˜©ž ‰œ £â¤¦¬.
+
+ 3. ’騘 ˜¤« š¨á¯«œ «ž ©ž£œ à£â¤ž £œ ---> š¨˜££ã ¡˜  §˜«ã©«œ <ESC> š ˜ ¤˜
+ ™šœå«œ ˜§æ «ž¤ ‰˜«á©«˜©ž ‰œ £â¤¦¬.
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. ‚ ˜ ¤˜ ˜¤¦å¥œ«œ £å˜ š¨˜££ã €Œ— ˜§æ «¦¤ ›¨¦£â˜, §˜«ã©«œ ˜§¢á ⤘ ¡œ­˜¢˜å¦
+ O, ˜¤«å š ˜ ⤘ §œæ o. ƒ¦¡ £á©«œ «¦ ©«ž¤ §˜¨˜¡á«à š¨˜££ã.
+€¤¦åšœ«œ š¨˜££ã §á¤à ˜§æ ˜¬«ã¤ §˜«é¤«˜ª Shift-O 橦 ¦ ›¨¦£â˜ª œå¤˜  ©«ž š¨˜££ã
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 6.2: † „Œ’ŽŠ† Ž‘‡†‰†‘
+
+ ** ˜«ã©«œ a š ˜ ¤˜ œ ©ášœ«œ ¡œå£œ¤¦ ‹„’ê «¦¤ ›¨¦£â˜. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«¦ «â¢¦ª «žª §¨é«žª š¨˜££ãª §˜¨˜¡á«à
+ ©ž£œ à£â¤ž £œ ---> §˜«é¤«˜ª $ ©«ž¤ ‰˜¤¦¤ ¡ã ‰˜«á©«˜©ž.
+
+ 2. ˜«ã©«œ ⤘ a (§œæ) š ˜ ¤˜ §¨¦©Ÿâ©œ«œ ¡œå£œ¤¦ ‹„’€ ˜§æ «¦¤ ®˜¨˜¡«ã¨˜
+ §¦¬ œå¤˜  ¡á«à ˜§æ «¦¤ ›¨¦£â˜. (’¦ ¡œ­˜¢˜å¦ A §¨¦©Ÿâ«œ  ©«¦ «â¢¦ª
+ «žª š¨˜££ãª).
+
+‘ž£œåà©ž: €¬«æ ˜§¦­œçšœ  «¦ §á«ž£˜ «¦¬ i , «¦¤ «œ¢œ¬«˜å¦ ®˜¨˜¡«ã¨˜, «¦
+ ¡œå£œ¤¦ «žª œ ©˜šàšãª, <ESC>, ›¨¦£â˜-›œ¥ á, ¡˜  «â¢¦ª, x, £æ¤¦ ¡˜ 
+ £æ¤¦ š ˜ ¤˜ §¨¦©Ÿâ©œ«œ ©«¦ «â¢¦ª «žª š¨˜££ãª!
+
+ 3. ‘¬£§¢ž¨é©«œ «é¨˜ «ž¤ §¨é«ž š¨˜££ã. ‘ž£œ é©«œ œ§å©žª æ«  ž §¨¦©Ÿã¡ž œå¤˜ 
+ ˜¡¨ ™éª å› ˜ ©«ž¤ ‰˜«á©«˜©ž ‰œ £â¤¦¬ £œ «ž¤ ‰˜«á©«˜©ž „ ©˜šàšãª, œ¡«æª
+ ˜§æ «ž Ÿâ©ž §¦¬ œ ©ášœ«˜  «¦ ¡œå£œ¤¦.
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 6.3: €ŠŠ† „‰ƒŽ‘† ’†‘ €Œ’ˆ‰€’€‘’€‘†‘
+
+
+ ** ˜«ã©«œ ¡œ­˜¢˜å¦ R š ˜ ¤˜ ˜¢¢á¥œ«œ §œ¨ ©©æ«œ¨¦¬ª ˜§æ ⤘¤ ®˜¨˜¡«ã¨œª. **
+
+ 1. ‹œ«˜¡ ¤œå©«œ «¦¤ ›¨¦£â˜ ©«ž¤ §¨é«ž š¨˜££ã §˜¨˜¡á«à ©ž£œ à£â¤ž £œ --->.
+
+ 2. ’¦§¦Ÿœ«ã©«œ «¦¤ ›¨¦£â˜ ©«ž¤ ˜¨®ã «žª §¨é«žª ¢â¥žª §¦¬ œå¤˜  › ˜­¦¨œ« ¡ã
+ ˜§æ «ž ›œç«œ¨ž š¨˜££ã ©ž£œ à£â¤ž £œ ---> (ž ¢â¥ž 'last').
+
+ 3. ˜«ã©«œ «é¨˜ R ¡˜  ˜¢¢á¥«œ «¦ ¬§æ¢¦ §¦ «¦¬ ¡œ £â¤¦¬ ©«ž¤ §¨é«ž š¨˜££ã
+ š¨á­¦¤«˜ª §á¤à ˜§æ «¦ §˜¢ æ ¡œå£œ¤¦ é©«œ ¤˜ ¡á¤œ«œ «ž¤ §¨é«ž š¨˜££ã å› ˜
+ £œ «ž ›œç«œ¨ž.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. ‘ž£œ é©«œ æ«  櫘¤ §˜«á«œ <ESC> š ˜ ¤˜ ™šœå«œ, §˜¨˜£â¤œ  ¦§¦ ¦›ã§¦«œ
+ ˜¤˜¢¢¦å૦ ¡œå£œ¤¦.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹áŸž£˜ 6.4: “‡‹ˆ‘† „ˆŠŽ‚†‘
+
+
+ ** ¬Ÿ£å©«œ £å˜ œ§ ¢¦šã â«©  é©«œ ž ˜¤˜ã«ž©ž ã ž ˜¤« ¡˜«á©«˜©ž ¤˜ ˜š¤¦œå
+ «ž › ˜­¦¨á §œé¤-¡œ­˜¢˜åठ**
+
+ 1. –ᥫœ š ˜ 'ignore' œ ©áš¦¤«˜ª:
+ /ignore
+ ‘¬¤œ®å©«œ ˜¨¡œ«âª ­¦¨âª §˜«é¤«˜ª «¦ §¢ã¡«¨¦ n.
+
+ 2. ‡â©«œ «ž¤ œ§ ¢¦šã 'ic' (Ignore case) š¨á­¦¤«˜ª:
+ :set ic
+
+ 3. –ᥫœ «é¨˜ ¥˜¤á š ˜ 'ignore' §˜«é¤«˜ª: n
+ ‘¬¤œ®å©«œ «ž¤ ˜¤˜ã«ž©ž £œ¨ ¡âª ˜¡æ£˜ ­¦¨âª §˜«é¤«˜ª «¦ §¢ã¡«¨¦ n
+
+ 4. ‡â©«œ « ª œ§ ¢¦šâª 'hlsearch' ¡˜  'incsearch':
+ :set hls is
+
+ 5. „ ©ášœ«œ «é¨˜ ¥˜¤á «ž¤ œ¤«¦¢ã ˜¤˜ã«ž©žª, ¡˜  ›œå«œ «  ©¬£™˜å¤œ 
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 6 „ˆŠ†–†
+
+
+ 1. ˜«é¤«˜ª o ˜¤¦åšœ  £å˜ š¨˜££ã ‰€’— ˜§æ «¦¤ ›¨¦£â˜ ¡˜  «¦§¦Ÿœ«œå «¦¤
+ ›¨¦£â˜ ©«ž¤ ˜¤¦ ®«ã š¨˜££ã ©œ ‰˜«á©«˜©ž ‰œ £â¤¦¬.
+
+ 2. ˜«ã©«œ a š ˜ ¤˜ œ ©ášœ«œ ¡œå£œ¤¦ ‹„’€ «¦¤ ®˜¨˜¡«ã¨˜ ©«¦¤ ¦§¦å¦ œå¤˜ 
+ ¦ ›¨¦£â˜ª. ˜«é¤«˜ª ¡œ­˜¢˜å¦ A ˜¬«æ£˜«˜ §¨¦©Ÿâ«œ  ¡œå£œ¤¦ ©«¦ «â¢¦ª
+ «žª š¨˜££ãª.
+
+ 3. ˜«é¤«˜ª ¡œ­˜¢˜å¦ R œ ©â¨®œ«˜  ©«ž¤ ‰˜«á©«˜ž €¤« ¡˜«á©«˜©žª £â®¨  ¤˜
+ §˜«žŸœå «¦ <ESC> ¡˜  ¤˜ œ¥â¢Ÿœ .
+
+ 4. ‚¨á­¦¤«˜ª ":set xxx" ¨¬Ÿ£åœ  «ž¤ œ§ ¢¦šã "xxx".
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 7: ON-LINE „Œ’ŽŠ„‘ Ž†‡„ˆ€‘
+
+
+ ** •¨ž© £¦§¦ ã©«œ «¦ on-line ©ç©«ž£˜ ™¦ãŸœ ˜ª **
+
+ Ž Vim ⮜  ⤘ §œ¨ œ¡« ¡æ on-line ©ç©«ž£˜ ™¦ãŸœ ˜ª. ‚ ˜ ¤˜ ¥œ¡ ¤ã©œ ,
+ ›¦¡ £á©«œ ¡á§¦ ¦ ˜§æ «˜ «¨å˜:
+ - §˜«ã©«œ «¦ §¢ã¡«¨¦ <HELP> (˜¤ ⮜«œ ¡á§¦ ¦)
+ - §˜«ã©«œ «¦ §¢ã¡«¨¦ <F1> (˜¤ ⮜«œ ¡á§¦ ¦)
+ - š¨á¯«œ :help <ENTER>
+
+ ‚¨á¯«œ :q <ENTER> š ˜ ¤˜ ¡¢œå©œ«œ «¦ §˜¨áŸ¬¨¦ «žª ™¦ãŸœ ˜ª.
+
+ ‹§¦¨œå«œ ¤˜ ™¨œå«œ ™¦ãŸœ ˜ §á¤à ©œ ¡áŸœ ˜¤« ¡œå£œ¤¦, ›å¤¦¤«˜ª £å˜ §˜¨á£œ«¨¦
+ ©«ž¤ œ¤«¦¢ã ":help". ƒ¦¡ £á©«œ ˜¬«á (£ž¤ ¥œ®¤á«œ ¤˜ §˜«á«œ <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ‹€‡†‹€ 8: ƒ†‹ˆŽ“‚†‘’„ „Œ€ SCRIPT „‰‰ˆŒ†‘†‘
+
+ ** „¤œ¨š¦§¦ ã©«œ ®˜¨˜¡«ž¨ ©« ¡á «¦¬ Vim **
+
+ Ž Vim ⮜  §¦¢¢á §œ¨ ©©æ«œ¨˜ ®˜¨˜¡«ž¨ ©« ¡á ˜§' æ,«  ¦ Vi, ˜¢¢á «˜
+ §œ¨ ©©æ«œ¨˜ œå¤˜  ˜¨® ¡á ˜§œ¤œ¨š¦§¦ ž£â¤˜. ‚ ˜ ¤˜ ˜¨®å©œ«œ ¤˜ ®¨ž© £¦§¦ œå«œ
+ §œ¨ ©©æ«œ¨˜ ®˜¨˜¡«ž¨ ©« ¡á §¨â§œ  ¤˜ ­« á¥œ«œ ⤘ ˜¨®œå¦ "vimrc".
+
+ 1. €¨®å©«œ › ¦¨Ÿé¤¦¤«˜ª «¦ ˜¨®œå¦ "vimrc", ˜¬«æ œ¥˜¨«á«˜  ˜§æ «¦ ©ç©«ž£á ©˜ª:
+ :edit ~/.vimrc š ˜ Unix
+ :edit $VIM/_vimrc š ˜ MS-Windows
+
+ 2. ’騘 œ ©ášœ«œ «¦ ¡œå£œ¤¦ §˜¨˜›œåš£˜«¦ª š ˜ ˜¨®œå¦ "vimrc":
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. ‚¨á¯«œ «¦ ˜¨®œå¦ £œ «ž¤:
+ :write
+
+ ’ž¤ œ§æ£œ¤ž ­¦¨á §¦¬ Ÿ˜ ¥œ¡ ¤ã©œ«œ «¦¤ Vim Ÿ˜ ®¨ž© £¦§¦ ã©œ  ­à« ©£æ
+ ©ç¤«˜¥žª. ‹§¦¨œå«œ ¤˜ §¨¦©Ÿâ©œ«œ 梜ª « ª §¨¦« £é£œ¤œª œ§ ¢¦šâª ©' ˜¬«æ
+ «¦ ˜¨®œå¦ "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ „›é ¦¢¦¡¢ž¨é¤œ«˜  «¦ Vim Tutor. ‘¡¦§æª «¦¬ 㫘¤ ¤˜ ›é©œ  £å˜ ©ç¤«¦£ž
+ §œ¨å¢ž¯ž «¦¬ ©¬¤«á¡«ž Vim, «¦¬¢á® ©«¦¤ «æ©ž é©«œ ¤˜ ©˜ª œ§ «¨â¯œ  ¤˜
+ ®¨ž© £¦§¦ ã©œ«œ «¦¤ ©¬¤«á¡«ž ˜¨¡œ«á œç¡¦¢˜. €§â®œ  §¦¢ç ˜§æ £å˜
+ ¦¢¦¡¢ž¨à£â¤ž §˜¨¦¬©å˜©ž ¡˜Ÿéª ¦ Vim ⮜  §á¨˜ §¦¢¢âª œ¤«¦¢âª. ƒ ˜™á©«œ
+ ¡˜«æ§ ¤ «¦ œš®œ ¨å› ¦ ®¨ã©žª:
+ ":help user-manual".
+
+ ‚ ˜ §œ¨˜ «â¨à › á™˜©£˜ ¡˜  £œ¢â«ž, ©¬©«ã¤œ«˜  ˜¬«æ «¦ ™ ™¢å¦:
+ Vim - Vi Improved - by Steve Oualline
+ Publisher: New Riders
+ ’¦ §¨é«¦ ™ ™¢å¦ §¢ã¨àª ˜­ œ¨à£â¤¦ ©«¦¤ Vim.
+ ˆ› ˜å«œ¨˜ ®¨ã© £¦ š ˜ ˜¨®á¨ ¦¬ª.
+ “§á¨®¦¬¤ §¦¢¢á §˜¨˜›œåš£˜«˜ ¡˜  œ ¡æ¤œª.
+ ƒœå«œ «ž¤ http://iccf-holland.org/click5.html
+
+ €¬«æ «¦ ™ ™¢å¦ œå¤˜  §˜¢ æ«œ¨¦ ¡˜  §œ¨ ©©æ«œ¨¦ š ˜ «¦¤ Vi §˜¨á š ˜ «¦¤ Vim,
+ ˜¢¢á œ§å©žª ©¬¤ ©«é£œ¤¦:
+ Learning the Vi Editor - by Linda Lamb
+ Publisher: O'Reilly & Associates Inc.
+ „夘  ⤘ ¡˜¢æ ™ ™¢å¦ š ˜ ¤˜ £áŸœ«œ ©®œ›æ¤ «˜ §á¤«˜ §¦¬ Ÿâ¢œ«œ
+ ¤˜ ¡á¤œ«œ £œ «¦¤ Vi.
+ † â¡«ž â¡›¦©ž §œ¨ â®œ  ˜¡æ£˜ §¢ž¨¦­¦¨åœª š ˜ «¦¤ Vim.
+
+ €¬«ã ž §œ¨ ãšž©ž š¨á­«ž¡œ ˜§æ «¦¬ª Michael C. Pierce ¡˜  Robert K. Ware,
+ Colorado School of Mines ®¨ž© £¦§¦ é¤«˜ª  ›âœª ˜§æ «¦¤ Charles Smith,
+ Colorado State University. E-mail: bware@mines.colorado.edu.
+
+ ¨¦©˜¨£¦šã š ˜ «¦¤ Vim ˜§æ «¦¤ Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
diff --git a/runtime/tutor/tutor.info b/runtime/tutor/tutor.info
new file mode 100644
index 000000000..dccf4be6f
--- /dev/null
+++ b/runtime/tutor/tutor.info
Binary files differ
diff --git a/runtime/tutor/tutor.it b/runtime/tutor/tutor.it
new file mode 100644
index 000000000..b7b70de7a
--- /dev/null
+++ b/runtime/tutor/tutor.it
@@ -0,0 +1,805 @@
+===============================================================================
+= Benvenuto alla G u i d a all'Editor V I M - Versione 1.5 =
+===============================================================================
+
+ Vim è un Editor molto potente ed ha parecchi comandi, troppi per
+ spiegarli tutti in una guida come questa. Questa guida serve a
+ descrivere quei comandi che ti permettono di usare facilmente
+ Vim come Editor di uso generale.
+
+ Il tempo necessario per completare la guida è circa 25-30 minuti,
+ a seconda di quanto tempo dedichi alla sperimentazione.
+
+ I comandi nelle lezioni modificano questo testo. Fai una copia di questo
+ file per esercitarti (se hai usato "vimtutor", stai già usando una copia).
+
+ E' importante non scordare che questa guida vuole insegnare tramite
+ l'uso. Questo vuol dire che devi eseguire i comandi per impararli
+ davvero. Se leggi il testo e basta, dimenticherai presto i comandi!
+
+ Adesso, assicurati che il tasto BLOCCA-MAIUSCOLO non sia schiacciato
+ e premi il tasto j tanto da muovere il cursore fino a che la
+ Lezione 1.1 riempia completamente lo schermo.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 1.1: MOVIMENTI DEL CURSORE
+
+
+ ** Per muovere il cursore, premi i tasti h,j,k,l come indicato. **
+ ^
+ k NOTA: Il tasto h è a sinistra e muove a sinistra.
+ < h l > Il tasto l è a destra e muove a destra.
+ j Il tasto j ricorda una freccia in giù.
+ v
+ 1. Muovi il cursore sullo schermo finché non ti senti a tuo agio.
+
+ 2. Tieni schiacciato il tasto "giù" (j) finché non si ripete il movimento.
+---> Adesso sai come arrivare fino alla lezione successiva.
+
+ 3. Usando il tasto "giù" spostati alla Lezione 1.2.
+
+NOTA: Quando non sei sicuro del tasto che hai premuto, premi <ESC> per andare
+ in Modalità Normale [Normal Mode]. Poi ri-immetti il comando che volevi.
+
+NOTA: I tasti con le frecce fanno lo stesso servizio. Ma usando hjkl riesci
+ a muoverti molto più rapidamente, una volta presa l'abitudine.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 1.2: ENTRARE E USCIRE DA VIM
+
+
+ !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!!
+
+ 1. Premi il tasto <ESC> (per assicurarti di essere in Modalità Normale).
+
+ 2. Batti: :q! <INVIO>.
+
+---> Così esci dall'Editor SENZA SALVARE alcuna modifica fatta.
+ Se vuoi uscire SALVANDO le modifiche batti:
+ :wq <INVIO>
+
+ 3. Quando vedi il PROMPT della Shell, batti il comando con cui sei arrivato
+ qui. Potrebbe essere: vimtutor <INVIO>
+ Normalmente useresti: vim tutor <INVIO>
+
+---> 'vim' indica l'Editor vim, 'tutor' è il nome del file che tu vuoi aprire.
+
+ 4. Se hai memorizzato questi comandi e ti senti pronto, esegui i passi
+ da 1 a 3 per uscire e rientrare nell'Editor. Poi muovi il cursore in giù
+ fino alla Lezione 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 1.3: EDITING DI TESTI - CANCELLAZIONE
+
+
+** In Modalità Normale premi x per cancellare il carattere sotto al cursore **
+
+ 1. Muovi il cursore alla linea più sotto, indicata da --->
+
+ 2. Per correggere errori, muovi il cursore fino a posizionarlo sopra il
+ carattere da cancellare.
+
+ 3. Premi il tasto x per cancellare il carattere sbagliato.
+
+ 4. Ripeti i passi da 2 a 4 finché la frase è corretta.
+
+---> La mmucca saltòò finnoo allaa lunnna.
+
+ 5. Ora che la linea è corretta, vai alla Lezione 1.4
+
+NOTA: Mentre segui questa guida, non cercare di imparare a memoria,
+ ma impara facendo pratica.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 1.4: EDITING DI TESTI - INSERIMENTO
+
+
+ ** Quando sei in Modalità Normale premi i per inserire testo. **
+
+ 1. Muovi il cursore alla prima linea qui sotto, indicata da --->
+
+ 2. Per rendere la prima linea uguale alla seconda, muovi il cursore sopra
+ il primo carattere DOPO la posizione in cui il testo va inserito.
+
+ 3. Premi i e batti le aggiunte opportune.
+
+ 4. Quando un errore è corretto, premi <ESC> per tornare in Modalità Normale.
+ Ripeti i passi da 2 a 4 fino a completare la correzione della frase.
+
+---> C'era del tsto mncnt questa .
+---> C'era del testo mancante da questa linea.
+
+ 5. Quando sei a tuo agio nell'inserimento di testo vai al sommario sotto.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 1 SOMMARIO
+
+
+ 1. Il cursore si muove usando i tasti con le frecce o i tasti hjkl.
+ h (sinistra) j (giù) k (su) l (destra)
+
+ 2. Per eseguire Vim (dal prompt %) batti: vim NOMEFILE <INVIO>
+
+ 3. Per uscire da Vim batti: <ESC> :q! <INVIO> per uscire senza salvare.
+ oppure batti: <ESC> :wq <INVIO> per uscire salvando modifiche.
+
+ 4. Per cancellare il carattere sotto al cursore in Modalità Normale batti: x
+
+ 5. Per inserire testo subito prima del cursore in Modalità Normale batti:
+ i batti del testo <ESC>
+
+NOTA: premendo <ESC> ritornerai in Modalità Normale o annullerai
+ un comando errato che puoi aver inserito in parte.
+
+Ora continua con la Lezione 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2.1: COMANDI DI CANCELLAZIONE
+
+
+ ** Batti dw per cancellare fino a fine parola. **
+
+ 1. Premi <ESC> per accertarti di essere in Modalità Normale.
+
+ 2. Muovi il cursore fino alla linea qui sotto, indicata da --->
+
+ 3. Muovi il cursore all'inizio di una parola che vuoi cancellare.
+
+ 4. Batti dw per cancellare la parola.
+
+NOTA: Le lettere dw saranno visibili sull'ultima linea dello schermo mentre le
+ batti. Se hai battuto qualcosa di sbagliato, premi <ESC> e ricomincia.
+
+---> Ci sono le alcune parole gioia che non c'entrano carta in questa frase.
+
+ 5. Ripeti i passi 3 e 4 finché la frase è corretta, poi vai alla Lezione 2.2.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2.2: ALTRI COMANDI DI CANCELLAZIONE
+
+
+ ** Batti d$ per cancellare fino a fine linea. **
+
+ 1. Premi <ESC> per accertarti di essere in Modalità Normale.
+
+ 2. Muovi il cursore fino alla linea qui sotto, indicata da --->
+
+ 3. Muovi il cursore alla fine della linea corretta (DOPO il primo . ).
+
+ 4. Batti d$ per cancellare fino a fine linea.
+
+---> Qualcuno ha battuto la fine di questa linea due volte. linea due volte.
+
+
+ 5. Vai alla Lezione 2.3 per capire il funzionamento di questo comando.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2.3: COMANDI E OGGETTI
+
+
+ Il formato del comando d [delete] cancella è il seguente:
+
+ [numero] d oggetto OPPURE d [numero] oggetto
+ Dove:
+ numero - indica quante volte va eseguito il comando (se omesso, vale 1).
+ d - è il comando di cancellazione.
+ oggetto - indica dove il comando va applicato (lista qui sotto).
+
+ Breve lista di oggetti:
+ w - dal cursore alla fine della parola, incluso lo spazio.
+ e - dal cursore alla fine della parola, ESCLUSO lo spazio.
+ $ - dal cursore fino a fine linea.
+
+NOTA: Per amanti dell'avventura: premendo solo il tasto che indica l'oggetto
+ mentre siete in Modalità Normale, senza dare un comando, sposta
+ il cursore come specificato nella "lista di oggetti" qui sopra.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2.4: UNA ECCEZIONE A 'COMANDO-OGGETTO'
+
+ ** Batti dd per cancellare un'intera linea. **
+
+ Per la frequenza con cui capita di cancellare linee intere, chi
+ ha progettato Vi ha deciso che sarebbe stato più semplice
+ battere due d consecutive per cancellare una linea.
+
+ 1. Muovi il cursore alla linea 2) nella frase qui sotto.
+ 2. Batti dd per cancellare la linea.
+ 3. Ora spostati alla linea 4).
+ 4. Batti 2dd (ricorda: numero-comando-oggetto) per cancellare due linee.
+
+ 1) Le rose sono rosse,
+ 2) Nel fango ci si diverte,
+ 3) Le viole sono blu,
+ 4) Io ho un'automobile,
+ 5) Gli orologi segnano il tempo,
+ 6) Il miele è dolce,
+ 7) E lo sei anche tu.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2.5: IL COMANDO UNDO [ANNULLA]
+
+ ** Premi u per annullare gli ultimi comandi eseguiti. **
+ ** Premi U per annullare le modifiche all'ultima linea. **
+
+ 1. Muovi il cursore fino alla linea qui sotto, indicata da --->
+ e posizionati sul primo errore.
+ 2. Batti x per cancellare il primo carattere sbagliato.
+ 3. Adesso batti u per annullare l'ultimo comando eseguito.
+ 4. Ora invece, correggi tutti gli errori sulla linea usando il comando x .
+ 5. Adesso batti una U Maiuscola per riportare la linea al suo stato originale.
+ 6. Adesso batti u più volte per annullare la U e i comandi precedenti.
+ 7. Adesso batti più volte CTRL-r (tenendo il tasto CTRL schiacciato
+ mentre batti r) per rifare i comandi (annullare l'annullamento).
+
+---> Correeggi gli errori ssu quuesta linea e riimpiazzali coon "undo".
+
+ 8. Questi comandi sono molto utili. Ora spostati al Sommario della Lezione 2.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 2 SOMMARIO
+
+
+ 1. Per cancellare dal cursore fino alla fine di una parola batti: dw
+
+ 2. Per cancellare dal cursore fino alla fine della linea batti: d$
+
+ 3. Per cancellare un'intera linea batti: dd
+
+ 4. Il formato per un comando in Modalità Normale è:
+
+ [numero] comando oggetto OPPURE comando [numero] oggetto
+ Dove:
+ numero - indica quante volte va eseguito il comando (se omesso, vale 1).
+ comando - è il comando da eseguire, ad es. d per [delete] cancellare.
+ oggetto - indica dove il comando va applicato, ad es. w [word] parola,
+ $ (fino alla fine della linea), etc.
+
+ 5. Per annullare i comandi precedenti, batti: u (u minuscola)
+ Per annullare tutte le modifiche a una linea batti: U (U Maiuscola)
+ Per annullare l'annullamento [gli "undo"] batti: CTRL-r
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 3.1: IL COMANDO PUT [METTI, PONI]
+
+
+ ** Batti p per porre [put] l'ultima cancellazione dopo il cursore. **
+
+ 1. Muovi il cursore alla prima linea fra quelle qui in basso.
+
+ 2. Batti dd per cancellare la linea e depositarla nel buffer di Vim.
+
+ 3. Muovi il cursore fino alla linea SOPRA quella dove andrebbe spostata
+ la linea che hai appena cancellato.
+
+ 4. Mentre sei in Modalità Normale, batti p per reinserire la linea.
+
+ 5. Ripeti i passi da 2 a 4 per mettere tutte le linee nel corretto ordine.
+
+ d) Riesci a impararla tu?
+ b) Le viole sono blu,
+ c) La saggezza si impara,
+ a) Le rose sono rosse,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 3.2: IL COMANDO REPLACE [RIMPIAZZA]
+
+
+ ** Batti r e una lettera per rimpiazzare il carattere sotto al cursore. **
+
+ 1. Muovi il cursore alla prima linea qui sotto, indicata da --->
+
+ 2. Muovi il cursore fino a posizionarlo sopra il primo errore.
+
+ 3. Batti r e poi il carattere che dovrebbe rimpiazzare l'errore.
+
+ 4. Ripeti i passi 2 e 3 finché la prima linea è corretta.
+
+---> Immattendo quetta libea, qualcuno ho predato alcuni tosti sballiati!
+---> Immettendo questa linea, qualcuno ha premuto alcuni tasti sbagliati!
+
+ 5. Ora passa alla Lezione 3.2.
+
+NOTA: Ricordati che dovresti imparare con la pratica, non solo leggendo.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 3.3: IL COMANDO CHANGE [CAMBIA]
+
+
+ ** Per cambiare una parola in tutto o in parte, batti cw . **
+
+ 1. Muovi il cursore alla prima linea qui sotto, indicata da --->
+
+ 2. Posiziona il cursore alla u in lubw.
+
+ 3. Batti cw e la parola corretta (in questo caso, batti inea ).
+
+ 4. Premi <ESC> e vai sull'errore seguente (sul primo carattere da modificare).
+
+ 5. Ripeti i passi 3 e 4 finché la prima frase è uguale alla seconda.
+
+---> Questa lubw ha alcune pptfd da asdert usgfk il comando CHANGE.
+---> Questa linea ha alcune parole da cambiare usando il comando CHANGE.
+
+Nota che cw non solo rimpiazza la parola, ma ti mette anche in Modalità
+Inserimento [Insert Mode]
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 3.4: ALTRI CAMBIAMENTI USANDO c
+
+
+** Il comando c [CHANGE] agisce sugli stessi oggetti del comando d [DELETE] **
+
+ 1. Il comando CHANGE si comporta come DELETE. Il formato è:
+
+ [numero] c oggetto OPPURE c [numero] oggetto
+
+ 2. Gli oggetti sono gli stessi, ad es. w (word, parola), $ (fine linea), etc.
+
+ 3. Muovi il cursore alla prima linea qui sotto, indicata da --->
+
+ 4. Posiziona il cursore al primo errore.
+
+ 5. Batti c$ per modificare il resto della linea secondo il modello della
+ linea successiva, e quando hai finito premi <ESC>
+
+---> La fine di questa linea deve essere aiutata a divenire come la seguente.
+---> La fine di questa linea deve essere corretta usando il comando c$ .
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 3 SOMMARIO
+
+
+ 1. Per reinserire testo che hai appena cancellato, batti p . Questo
+ inserisce [pone] il testo cancellato DOPO il cursore (se era stata tolta
+ una linea intera, questa verrà messa nella linea SOTTO il cursore).
+
+ 2. Per rimpiazzare il carattere sotto il cursore, batti r e poi il
+ carattere sostitutivo.
+
+ 3. Il comando CHANGE ti permette di cambiare l'oggetto specificato dal
+ cursore fino alla fine dell'oggetto. Ad es. Batti cw per cambiare dal
+ cursore alla fine della parola, c$ per cambiare fino a fine linea.
+
+ 4. Il formato del comando CHANGE è:
+
+ [numero] c oggetto OPPURE c [numero] oggetto
+
+Ora vai alla prossima Lezione.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 4.1: POSIZIONAMENTE E SITUAZIONE FILE
+
+
+ ** Batti CTRL-g per vedere a che punto sei nel file e la situazione del file.
+ Batti [numero] G per raggiungere il numero della linea [numero] nel file.
+ Batti [numero] % per posizionarti alla percentuale [numero] nel file **
+
+ NOTA: Leggi l'intera Lezione prima di eseguire un qualunque comando!!
+
+ 1. Tieni premuto il tasto CTRL e batti g . Una linea di situazione
+ sarà visibile in fondo alla pagina con il NOME FILE e la linea
+ in cui sei posizionato. Ricordati il numero della linea per il Passo 3.
+
+ 2. Premi G [G Maiuscolo] per posizionarti alla fine del file.
+
+ 3. Batti il numero della linea in cui ti trovavi e poi G . Questo ti
+ riporterà fino alla linea in cui ti trovavi quando avevi battuto CTRL-g.
+ (Mentre batti i numeri, questi NON saranno visualizzati sullo schermo.)
+
+ 4. Se ti senti sicuro nel farlo, esegui i passi da 1 a 3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 4.2: IL COMANDO SEARCH [RICERCA]
+
+
+ ** Batti / seguito da una frase per ricercare quella frase. **
+
+ 1. in Modalità Normale batti il carattere / . Nota che la "/" e il cursore
+ sono visibili in fondo dello schermo come quando si usa il comando : .
+
+ 2. Adesso batti 'errroore' <INVIO>. Questa è la parola che vuoi ricercare.
+
+ 3. Per ricercare ancora la stessa frase, batti soltanto n .
+ Per ricercare la stessa frase in direzione opposta, batti N .
+
+ 4. Se vuoi ricercare una frase in direzione opposta (in su), usa il
+ comando ? invece che / .
+
+---> Quando la ricerca arriva a fine file, ricomincia dall'inizio del file.
+
+ "errroore" non è il modo giusto di digitare errore; errroore è un errore.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 4.3: RICERCA DI PARENTESI CORRISPONDENTI
+
+
+ ** Batti % per trovare una ),], o } corripondenti. **
+
+ 1. Posiziona il cursore su un (, [, or { nella linea, indicata da --->
+
+ 2. Adesso batti il carattere % .
+
+ 3. Il cursore dovrebbe ora trovarsi sulla parentesi corrispondente.
+
+ 4. Batti % per muovere il cursore alla parentesi di prima (corrispondente)
+
+---> Questa ( è una linea di test con (, [ ] e { } al suo interno. ))
+
+NOTA: Questo è molto utile nel "debug" di un programma con parentesi errate!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 4.4: UN MODO PER CORREGGERE GLI ERRORI
+
+
+ ** Batti :s/vecchio/nuovo/g per sostituire 'nuovo' a 'vecchio'. **
+
+ 1. Muovi il cursore fino alla linea qui sotto, indicata da --->.
+
+ 2. Batti :s/lla/la <INVIO> . Nota che questo comando cambia solo
+ LA PRIMA occorrenza di "lla" sulla linea.
+
+ 3. Adesso batti :s/lla/la/g dove "g" sta per "globalmente" sulla linea.
+ Questo cambia TUTTE le occorrenze di "lla" sulla linea.
+
+---> lla stagione migliore per lla fioritura è lla primavera.
+
+ 4. Per cambiare ogni ricorrenza di una stringa di caratteri tra due linee,
+ batti :#,#s/vecchio/nuovo/g dove #,# sono i numeri delle due linee.
+ Batti :%s/vecchio/nuovo/g per cambiare ogni occorrenza nell'intero file.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 4 SOMMARIO
+
+
+1. CTRL-g visualizza a che punto sei nel file e la situazione del file.
+ G [G Maiuscolo] ti porta alla fine del file. Un numero di linea
+ seguito da G [G Maiuscolo] ti porta a quel numero di linea nel file.
+
+2. Battendo / seguito da una frase ricerca IN AVANTI quella frase.
+ Battendo ? seguito da una frase ricerca ALL'INDIETRO quella frase.
+ DOPO una ricerca batti n per trovare la prossima occorrenza nella
+ stessa direzione, oppure N per cercare in direzione opposta.
+
+3. Battendo % mentre il cursore si trova su (,),[,],{, oppure }
+ ti posizioni sulla corrispondente parentesi.
+
+4. Per sostituire "nuovo" al primo "vecchio" in 1 linea batti :s/vecchio/nuovo
+ Per sostituire "nuovo" ad ogni "vecchio" in 1 linea batti :s/vecchio/nuovo/g
+ Per sostituire frasi tra 2 numeri di linea [#] batti :#,#s/vecchio/nuovo/g
+ Per sostituire tutte le occorrenze nel file batti :%s/vecchio/nuovo/g
+ Per chiedere conferma ogni volta aggiungi 'c' :%s/vecchio/nuovo/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 5.1: COME ESEGUIRE UN COMANDO ESTERNO
+
+
+ ** Batti :! seguito da un comando esterno per eseguire il comando. **
+
+ 1. Batti il comando : Per posizionare il cursore in fondo allo schermo.
+ Ciò ti permette di immettere un comando.
+
+ 2. Adesso batti il carattere ! (punto esclamativo). Ciò ti permette di
+ eseguire qualsiasi comando esterno che si può eseguire nella "shell".
+
+ 3. Ad esempio batti ls dopo il ! e poi premi <INVIO>. Questo
+ visualizza una lista della tua directory, proprio come se fossi in una
+ "shell". Usa :!dir se ls non funziona. [Unix:ls MSDOS:dir]
+
+---> NOTA: E' possibile in questo modo eseguire un comando a piacere.
+
+---> NOTA: Tutti i comandi : devono essere terminati premendo <INVIO>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 5.2: ANCORA SULLA SCRITTURA DEI FILES
+
+
+ ** Per salvare le modifiche apportate a un file batti :w NOMEFILE. **
+
+ 1. Batti :!dir or :!ls per procurarti una lista della tua directory.
+ Già sai che devi premere <INVIO> dopo aver scritto il comando.
+
+ 2. Scegli un NOMEFILE che ancora non esista, ad es. TEST .
+
+ 3. Adesso batti: :w TEST (dove TEST è il NOMEFILE che hai scelto).
+
+ 4. Questo salva l'intero file ("tutor.it") con il nome di TEST.
+ Per una verifica batti ancora :!dir per listare la tua directory.
+
+---> Nota che se esci da Vim e riesegui Vim usando come NOMEFILE TEST,
+ il file sarà una copia esatta di "tutor.it" al momento del salvataggio.
+
+ 5. Ora cancella il file battendo: :!rm TEST [sotto Unix] oppure
+ :!del TEST [sotto MSDOS]
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 5.3: SCRIVERE IN MANIERA SELETTIVA
+
+
+ ** Per salvare una porzione del file, batti :#,# w NOMEFILE **
+
+ 1. Batti ancora :!dir o :!ls per procurarti una lista della tua directory
+ e scegli un NOMEFILE adatto, come ad es. TEST .
+
+ 2. Muovi il cursore in cima a questa pagina e batti CTRL-g per procurarti
+ il numero di linea. RICORDATI QUESTO NUMERO!
+
+ 3. Ora spostati in fondo alla pagina e batti CTRL-g again.
+ RICORDATI ANCHE QUESTO NUMERO!
+
+ 4. Per salvare SOLO una parte in un file, batti :#,# w TEST
+ dove #,# sono i due numeri che hai memorizzato (cima,fondo) e TEST
+ è il tuo NOMEFILE.
+
+ 5. Ancora una volta, controlla che il file esista con il comando :!dir
+ ma NON CANCELLARLO.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 5.4: INSERIRE E RIUNIRE FILE
+
+
+ ** Per inserire il contenuto di un file, batti :r NOMEFILE **
+
+ 1. Batti :!dir per accertarti che il tuo NOMEFILE TEST sia ancora presente.
+
+ 2. Posiziona il cursore all'inizio di questa pagina.
+
+NOTA: DOPO aver eseguito il Passo 3 vedrai ancora la Lezione 5.3.
+ Quindi spostati IN GIU' per tornare ancora a questa Lezione.
+
+ 3. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST è
+ il nome del file.
+
+NOTA: Il file che tu richiedi è inserito a partire da dove si trova il cursore.
+
+ 4. Per verificare che un file è stato inserito, torna indietro col cursore
+ e nota che ci sono ora 2 copie della Lezione 5.3, quella originale e quella
+ da te inserita.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 5 SOMMARIO
+
+
+ 1. :!comando esegue un comando esterno.
+
+ Alcuni esempi utili sono [in MSDOS]:
+ :!dir - visualizza lista directory
+ :!del NOMEFILE - cancella file NOMEFILE.
+
+ 2. :w NOMEFILE scrive su disco il file che stai editando con nome NOMEFILE.
+
+ 3. :#,#w NOMEFILE salva le linee da # a # nel file NOMEFILE.
+
+ 4. :r NOMEFILE legge il file NOMEFILE da disco e lo inserisce nel
+ file che stai editando, dopo il punto dove è posizionato il cursore.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 6.1: IL COMANDO OPEN [APRI]
+
+
+ ** Batti o per aprire una linea sotto il cursore e per passare in
+ Modalità Inserimento. **
+
+ 1. Muovi il cursore fino alla linea qui sotto, indicata da --->.
+
+ 2. Batti o (minuscolo) per aprire una linea sotto il cursore e per
+ passare in Modalità Inserimento.
+
+ 3. Adesso ricopia la linea indicata da --->
+ e premi <ESC> per uscire dalla Modalità Inserimento.
+
+---> Dopo battuto o il cursore è sulla linea aperta (in Modalità Inserimento)
+
+ 4. Per aprire una linea SOPRA il cursore, batti O [Maiuscola], invece
+ che una o minuscola. Prova sulla linea subito sotto.
+Apri una linea SOPRA questa battendo O quando il cursore è su questa linea.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 6.2: IL COMANDO APPEND [AGGIUNGI]
+
+
+ ** Batti a per inserire testo DOPO il cursore. **
+
+ 1. Muovi il cursore alla fine della prima linea qui sotto, indicata da --->
+ battendo $ mentre sei in Modalità Normale.
+
+ 2. Batti una a (minuscola) per aggiungere testo DOPO il carattere sotto
+ il cursore. (A Maiuscola aggiunge alla fine della linea).
+
+NOTA: Eviti così di battere i , l'ultimo carattere, il testo da aggiungere,
+ <ESC>, spostare il cursore a sinistra e battere x solo per aggiungere
+ qualcosa alla fine della linea!
+
+ 3. Adesso completa la prima linea. Nota anche che l'aggiunta funziona come
+ la Modalità Inserimento, tranne che per il luogo dove il testo è inserito.
+
+---> Questa linea ti permetterà di esercitarti
+---> Questa linea ti permetterà di esercitarti ad aggiungere testo a fine linea.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 6.3: UN'ALTRA VARIANTE DI REPLACE [RIMPIAZZA]
+
+
+ ** Batti una R Maiuscola per rimpiazzare più di un carattere. **
+
+ 1. Muovi il cursore alla prima linea qui sotto, indicata da --->.
+
+ 2. Posiziona il cursore all'inizio della prima parola differente
+ dalla seconda linea indicata da ---> (la parola "'ultima").
+
+ 3. Adesso batti R e rimpiazza il resto del testo sulla prima linea battendo
+ sopra il testo preesistente per rendere la prima linea uguale alla seconda.
+
+---> Per rendere la prima linea uguale alla ultima su questa pagina usa i tasti.
+---> Per rendere la prima linea uguale alla seconda, batti R e il nuovo testo.
+
+ 4. Nota che quando premi <ESC> per uscire, ogni testo non toccato resta
+ uguale.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 6.4: SET [IMPOSTA] UN'OPZIONE
+
+ ** Imposta un'opzione per ignorare maiuscole/minuscole
+ durante la ricerca/sostituzione **
+
+ 1. Ricerca 'ignora' battendo:
+ /ignora
+ Ripeti la ricerca più volte usando il tasto n
+
+ 2. Imposta l'opzione 'ic' (Ignore case, [Ignora Maiuscolo/minuscolo]) battendo:
+ :set ic
+
+ 3. Adesso ricerca ancora 'ignora' premendo il tasto n
+ Ripeti la ricerca più volte usando il tasto n
+
+ 4. Imposta le opzioni 'hlsearch' e 'incsearch' [evidenzia_ricerca subito]
+ :set hls is
+
+ 5. Adesso ribatti ancora il comando di ricerca, e guarda cosa succede:
+ /ignore
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 6 SOMMARIO
+
+
+ 1. Battendo o aggiungi una linea SOTTO il cursore ed il cursore
+ si posiziona sulla linea appena aperta, in Modalità Inserimento.
+ Battendo O [Maiuscola] apri la linea SOPRA la linea su cui è il cursore.
+
+ 2. Batti una a per inserire testo DOPO il carattere su cui è il cursore.
+ Battendo A [Maiuscola] aggiungi testo alla fine della linea.
+
+ 3. Battendo R [Maiuscola] entri in Modalità Rimpiazzo [Replace mode]
+ e ci resti finché non premi <ESC> per uscirne.
+
+ 4. Battendo ":set xxx" imposti l'opzione "xxx"
+ Battendo ":h xxx" vedi la documentazione [inglese] per l'opzione "xxx"
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lezione 7: COMANDI DI AIUTO ON-LINE
+
+
+ ** Usa il sistema di help on-line **
+
+ Vim ha un esauriente sistema di aiuto on-line. Per cominciare, prova una di
+ queste alternative:
+ - premi il tasto <AIUTO> (se ce n'è uno)
+ - premi il tasto <F1> (se ce n'è uno)
+ - batti :help <INVIO> OPPURE :h <INVIO>
+
+ Batti :q <INVIO> per chiudere la finestra di help.
+
+ Puoi trovare aiuto su quasi tutto, dando un argomento al comando ":help"
+ Prova questi (non dimenticare di premere <INVIO>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEZIONE 8: PREPARA UNO SCRIPT INIZIALE
+
+ ** Attiva le opzioni Vim **
+
+ Vim ha molte più opzioni di Vi, ma molte di esse sono predefinite inattive.
+ Per cominciare a usare più opzioni, devi preparare un file "vimrc".
+
+ 1. Comincia a editare il file "vimrc", a seconda del tuo sistema operativo:
+ :edit ~/.vimrc per Unix
+ :edit $VIM/_vimrc per MS-Windows
+
+ 2. Ora inserisci il file "vimrc" d'esempio:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Scrivi il file con:
+
+ :write
+
+ La prossima volta che apri Vim, vedrai in uso la colorazione sintattica.
+ Puoi aggiungere a questo file "vimrc" tutte le tue impostazioni preferite.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Qui finisce la Guida a Vim. Il suo intento è di fornire una breve panoramica
+ dell'Editor Vim, che ti consenta di usare l'Editor abbastanza facilmente.
+ Questa guida è largamente incompleta poiché Vim ha moltissimi altri comandi.
+ Puoi anche leggere il manuale utente: ":help user-manual".
+
+ Per ulteriore lettura e studio, raccomandiamo:
+ Vim - Vi Improved - di Steve Oualline Editore: New Riders
+ Il primo libro completamente dedicato a Vim. Utile specie per principianti.
+ Contiene molti esempi e figure.
+ Vedi http://iccf-holland.org/click5.html
+
+ Quest'altro libro è più su Vi che su Vim, ma è pure consigliato:
+ Learning the Vi Editor - di Linda Lamb e Arnold Robbins
+ Editore: O'Reilly & Associates Inc.
+ E' un buon libro per imparare quasi tutto ciò che puoi voler fare con Vi.
+ Ne esiste una traduzione italiana, basata su una vecchia edizione.
+
+ Questa guida è stata scritta da Michael C. Pierce e Robert K. Ware,
+ Colorado School of Mines, usando idee fornite da Charles Smith,
+ Colorado State University - E-mail: bware@mines.colorado.edu
+ Modificato per Vim da Bram Moolenaar.
+ Segnalare refusi ad Antonio Colombo - E-mail: antonio.colombo@jrc.it
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc
new file mode 100644
index 000000000..02753d75d
--- /dev/null
+++ b/runtime/tutor/tutor.ja.euc
@@ -0,0 +1,811 @@
+===============================================================================
+= V I M ¶µ ËÜ (¥Á¥å¡¼¥È¥ê¥¢¥ë) ¤Ø ¤è ¤¦ ¤³ ¤½ - Version 1.5 =
+===============================================================================
+
+ Vim ¤Ï¡¢¤³¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤ÇÀâÌÀ¤¹¤ë¤Ë¤Ï¿¤¹¤®¤ëÄø¤Î¥³¥Þ¥ó¥É¤òÈ÷¤¨¤¿
+ Èó¾ï¤Ë¶¯ÎϤʥ¨¥Ç¥£¥¿¡¼¤Ç¤¹¡£¤³¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤Ï¡¢¤¢¤Ê¤¿¤¬ Vim
+ ¤òËüǽ¥¨¥Ç¥£¥¿¡¼¤È¤·¤Æ»È¤¤¤³¤Ê¤»¤ë¤è¤¦¤Ë¤Ê¤ë¤Î¤Ë½½Ê¬¤Ê¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤Æ
+ ÀâÌÀ¤ò¤¹¤ë¤è¤¦¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+
+ ¥Á¥å¡¼¥È¥ê¥¢¥ë¤ò´°Î»¤¹¤ë¤Î¤ËɬÍפʻþ´Ö¤Ï¡¢³Ð¤¨¤¿¥³¥Þ¥ó¥É¤ò»î¤¹¤Î¤Ë¤É¤ì
+ ¤À¤±»þ´Ö¤ò»È¤¦¤Î¤«¤Ë¤â¤è¤ê¤Þ¤¹¤¬¡¢¤ª¤è¤½25¡Á30ʬ¤Ç¤¹¡£
+
+ ³Ø¤Ö¥³¥Þ¥ó¥É¤Ë¤Ï¤³¤Îʸ¾Ï¤òÊѹ¹¤¹¤ë¤â¤Î¤â¤¢¤ê¤Þ¤¹¡£Îý½¬¤ò»Ï¤á¤ëÁ°¤Ë¥³
+ ¥Ô¡¼¤òºîÀ®¤·¤Þ¤·¤ç¤¦("vimtutor"¤·¤¿¤Ê¤é¤Ð¡¢´û¤Ë¥³¥Ô¡¼¤µ¤ì¤Æ¤¤¤Þ¤¹)¡£
+
+ ¤³¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤¬¡¢»È¤¦¤³¤È¤Ç³Ð¤¨¤é¤ì¤ë»ÅÁȤߤˤʤäƤ¤¤ë¤³¤È¤ò¡¢¿´
+ ¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£Àµ¤·¤¯³Ø½¬¤¹¤ë¤Ë¤Ï¥³¥Þ¥ó¥É¤ò¼ÂºÝ¤Ë»î¤µ¤Ê¤±
+ ¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ç¤¹¡£Ê¸¾Ï¤òÆɤó¤À¤À¤±¤Ê¤é¤Ð¡¢¤­¤Ã¤È˺¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹!¡£
+
+ ¤µ¤¡¡¢Caps¥í¥Ã¥¯(Shift-Lock)¥­¡¼¤¬²¡¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤·¤¿¸å¡¢
+ ²èÌ̤˥ì¥Ã¥¹¥ó1.1 ¤¬Á´Éôɽ¼¨¤µ¤ì¤ë¤È¤³¤í¤Þ¤Ç¡¢j ¥­¡¼¤ò²¡¤·¤Æ¥«¡¼¥½¥ë¤ò
+ °ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 1.1: ¥«¡¼¥½¥ë¤Î°ÜÆ°
+
+
+ ** ¥«¡¼¥½¥ë¤ò°ÜÆ°¤¹¤ë¤Ë¤Ï¡¢¼¨¤µ¤ì¤ëÍÍ¤Ë h,j,k,l ¤ò²¡¤·¤Þ¤¹ **
+ ^
+ k ¥Ò¥ó¥È: h ¥­¡¼¤Ïº¸Êý¸þ¤Ë°ÜÆ°¤·¤Þ¤¹¡£
+ < h l > l ¥­¡¼¤Ï±¦Êý¸þ¤Ë°ÜÆ°¤·¤Þ¤¹¡£
+ j j ¥­¡¼¤Ï²¼Ìð°õ¥­¡¼¤Î¤è¤¦¤Ê¥­¡¼¤Ç¤¹¡£
+ v
+ 1. °ÜÆ°¤Ë´·¤ì¤ë¤Þ¤Ç¡¢¥¹¥¯¥ê¡¼¥ó¤Ç¥«¡¼¥½¥ë°ÜÆ°¤µ¤»¤Þ¤·¤ç¤¦¡£
+
+ 2. ²¼¤Ø¤Î¥­¡¼(j)¤ò²¡¤·¤Ä¤Å¤±¤ë¤È¡¢Ï¢Â³¤·¤Æ°ÜÆ°¤Ç¤­¤Þ¤¹¡£
+---> ¤³¤ì¤Ç¼¡¤Î¥ì¥Ã¥¹¥ó¤Ë°ÜÆ°¤¹¤ëÊýË¡¤¬¤ï¤«¤ê¤Þ¤·¤¿¤Í¡£
+
+ 3. ²¼¤Ø¤Î¥­¡¼¤ò»È¤Ã¤Æ¡¢¥ì¥Ã¥¹¥ó1.2 ¤Ë°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+NOTE: ²¿¤ò¥¿¥¤¥×¤·¤Æ¤¤¤ë¤«È½¤é¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢<ESC>¤ò²¡¤·¤Æ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤·¤Þ
+ ¤¹¡£¤½¤ì¤«¤éÆþÎϤ·¤è¤¦¤È¤·¤Æ¤¤¤¿¥³¥Þ¥ó¥É¤òºÆÆþÎϤ·¤Þ¤·¤ç¤¦¡£
+
+NOTE: ¥«¡¼¥½¥ë¥­¡¼¤Ç¤â°ÜÆ°¤Ç¤­¤Þ¤¹¡£¤·¤«¤· hjkl ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë°ìÅÙ´·¤ì¤Æ¤·¤Þ
+ ¤¨¤Ð¡¢¤Ï¤ë¤«¤Ë®¤¯°ÜÆ°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 1.2: VIM ¤Îµ¯Æ°¤È½ªÎ»
+
+
+ !! NOTE: °Ê²¼¤Î¤¢¤é¤æ¤ë¥¹¥Æ¥Ã¥×¤ò¹Ô¤¦Á°¤Ë¡¢¤³¤Î¥ì¥Ã¥¹¥ó¤òÆɤߤޤ·¤ç¤¦!!
+
+ 1. <ESC>¥­¡¼¤ò²¡¤·¤Þ¤·¤ç¤¦¡£(³Î¼Â¤Ë¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤¹¤ë¤¿¤á)
+
+ 2. ¼¡¤Î¤è¤¦¤Ë¥¿¥¤¥×: :q! <ENTER>
+
+---> ¤³¤ì¤Ë¤è¤êÊÔ½¸¤·¤¿ÆâÍƤòÊݸ¤»¤º¤Ë¥¨¥Ç¥£¥¿¤¬½ªÎ»¤·¤Þ¤¹¡£
+ ÊÔ½¸ÆâÍƤòÊݸ¤·¤Æ½ªÎ»¤¹¤ë¤È¤­¤Ï¼¡¤Î¤è¤¦¤Ë¥¿¥¤¥×¤·¤Þ¤¹:
+ :wq <ENTER>
+
+ 3. ¥·¥§¥ë¥×¥í¥ó¥×¥È¤«¤é¥Á¥å¡¼¥È¥ê¥¢¥ë¤ò»Ï¤á¤ë¤Ë¤Ï¥³¥Þ¥ó¥É¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+ ¤½¤Î¥³¥Þ¥ó¥É¤Ï: vimtutor <ENTER>
+ Ä̾ï¤Ï¤³¤¦¤Ç¤·¤ç¤¦: vim tutor <ENTER>
+
+---> 'vim' ¤Ï Vim ¥¨¥Ç¥£¥¿¤Îµ¯Æ°¤ò¡¢'tutor' ¤ÏÊÔ½¸¤·¤¿¤¤¥Õ¥¡¥¤¥ë¤ò°ÕÌ£¤·¤Þ¤¹¡£
+
+ 4. ¤³¤ì¤Þ¤Ç¤Î¥¹¥Æ¥Ã¥×¤ò³Ð¤¨¼«¿®¤¬¤Ä¤¤¤¿¤Ê¤é¤Ð¡¢¥¹¥Æ¥Ã¥× 1 ¤«¤é 3 ¤Þ¤Ç¤ò¼Â
+ ºÝ¤Ë»î¤·¤Æ¡¢Vim ¤ò1ÅÙ½ªÎ»¤·¤Æ¤«¤éºÆ¤Óµ¯Æ°¤·¤Þ¤·¤ç¤¦¡£¤½¤ì¤«¤é¥ì¥Ã¥¹¥ó
+ 1.3¤Þ¤Ç¥«¡¼¥½¥ë¤ò°ÜÆ°¤µ¤»¤Þ¤·¤ç¤¦¡£
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 1.3: ¥Æ¥­¥¹¥ÈÊÔ½¸ - ºï½ü
+
+
+ ** ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤Æ¥«¡¼¥½¥ë¤Î²¼¤Îʸ»ú¤òºï½ü¤¹¤ë¤Ë¤Ï x ¤ò²¡¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ´Ö°ã¤¤¤ò½¤Àµ¤¹¤ë¤¿¤á¤Ë¡¢ºï½ü¤¹¤ëºÇ½é¤Îʸ»ú¤Þ¤Ç¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤¹¡£
+
+ 3. ÉÔɬÍפÊʸ»ú¤ò x ¤ò²¡¤·¤Æºï½ü¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. ʸ¤¬Àµ¤·¤¯¤Ê¤ë¤Þ¤Ç ¥¹¥Æ¥Ã¥× 2 ¤«¤é 4 ¤ò·«¤êÊÖ¤·¤Þ¤·¤ç¤¦¡£
+
+---> ¤½¤Î ¤¦¤¦¤µ¤® ¤Ï ¤Ä¤Ä¤­¤­ ¤ò ¤³¤¨¤¨¤Æ¤Æ ¤È¤Ó¤Ï¤Í¤¿¤¿
+
+ 5. ¹Ô¤¬Àµ¤·¤¯¤Ê¤Ã¤¿¤é¡¢¥ì¥Ã¥¹¥ó 1.4 ¤Ë°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+NOTE: Á´¤Æ¤Î¥ì¥Ã¥¹¥ó¤òÄ̤¸¤Æ¡¢³Ð¤¨¤è¤¦¤È¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¼ÂºÝ¤Ë¤ä¤Ã¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 1.4: ¥Æ¥­¥¹¥ÈÊÔ½¸ - ÁÞÆþ
+
+
+ ** ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤Æ¥Æ¥­¥¹¥È¤òÁÞÆþ¤¹¤ë¤Ë¤Ï i ¤ò²¡¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿ºÇ½é¤Î¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. 1¹ÔÌܤò2¹ÔÌܤÈƱ¤¸Íͤˤ¹¤ë¤¿¤á¤Ë¡¢¥Æ¥­¥¹¥È¤òÁÞÆþ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤°Ì
+ Ã֤μ¡¤Îʸ»ú¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤¹¡£
+
+ 3. i ¥­¡¼¤ò²¡¤·¤Æ¤«¤é¡¢Äɲä¬É¬ÍפÊʸ»ú¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. ´Ö°ã¤¤¤ò½¤Àµ¤·¤¿¤é <ESC> ¤ò²¡¤·¤Æ¥³¥Þ¥ó¥É¥â¡¼¥É¤ËÌá¤ê¡¢Àµ¤·¤¤Ê¸¤Ë
+ ¤Ê¤ëÍͤ˥¹¥Æ¥Ã¥× 2 ¤«¤é 4 ¤ò·«¤êÊÖ¤·¤Þ¤·¤ç¤¦¡£
+
+---> ¤³¤Î ¤Ë¤Ï ­¤ê¤Ê¤¤ ¥Æ¥­¥¹¥È ¤¢¤ë¡£
+---> ¤³¤Î ¹Ô ¤Ë¤Ï ´ö¤Ä¤« ­¤ê¤Ê¤¤ ¥Æ¥­¥¹¥È ¤¬ ¤¢¤ë¡£
+
+ 5. ÁÞÆþ¤ÎÊýË¡¤¬¤ï¤«¤Ã¤¿¤é²¼¤Î¥ì¥Ã¥¹¥ó1¤ÎÍ×Ìó¤ò¸«¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 1 Í×Ìó
+
+
+ 1. ¥«¡¼¥½¥ë¤ÏÌð°õ¥­¡¼¤â¤·¤¯¤Ï hjkl ¥­¡¼¤Ç°ÜÆ°¤·¤Þ¤¹¡£
+ h (º¸) j (²¼) k (¾å) l (±¦)
+
+ 2. Vim ¤òµ¯Æ°¤¹¤ë¤Ë¤Ï¥×¥í¥ó¥×¥È¤«¤é vim ¥Õ¥¡¥¤¥ë̾ <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 3. Vim ¤ò½ªÎ»¤¹¤ë¤Ë¤Ï <ESC> :q! <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤¹(Êѹ¹¤òÇË´þ)¡£
+ ¤â¤·¤¯¤Ï <ESC> :wq <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤¹(Êѹ¹¤òÊݸ)¡£
+
+ 4. ¥«¡¼¥½¥ë¤Î²¼¤Îʸ»ú¤òºï½ü¤¹¤ë¤Ë¤Ï¡¢¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç x ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 5. ¥«¡¼¥½¥ë¤Î°ÌÃÖ¤Ëʸ»ú¤òÁÞÆþ¤¹¤ë¤Ë¤Ï¡¢¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç i ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+ i ¥Æ¥­¥¹¥È¤Î¥¿¥¤¥× <ESC>
+
+NOTE: <ESC> ¥­¡¼¤ò²¡¤¹¤È¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë°Ü¹Ô¤·¤Þ¤¹¡£¤½¤ÎºÝ¡¢´Ö°ã¤Ã¤¿¤êÆþÎÏÅÓÃæ
+ ¤Î¥³¥Þ¥ó¥É¤ò¼è¤ê¾Ã¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+
+¤µ¤Æ¡¢Â³¤±¤Æ¥ì¥Ã¥¹¥ó 2 ¤ò»Ï¤á¤Þ¤·¤ç¤¦¡£
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 2.1: ºï½ü¥³¥Þ¥ó¥É
+
+
+ ** ñ¸ì¤ÎËöÈø¤Þ¤Ç¤òºï½ü¤¹¤ë¤Ë¤Ï dw ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦ **
+
+ 1. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤¿¤á¤Ë <ESC> ¤ò²¡¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. ¾Ã¤·¤¿¤¤Ã±¸ì¤ÎÀèƬ¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. ñ¸ì¤òºï½ü¤¹¤ë¤¿¤á¤Ë dw ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ NOTE: ¥¿¥¤¥×¤¹¤ë¤È¡¢dw ¤È¤¤¤¦Ê¸»ú¤¬¥¹¥¯¥ê¡¼¥ó¤ÎºÇ²¼¹Ô¤Ë¸½¤ï¤ì¤Þ¤¹¡£
+ ¥¿¥¤¥×¤ò´Ö°ã¤Ã¤Æ¤·¤Þ¤Ã¤¿»þ¤Ë¤Ï <ESC> ¤ò²¡¤·¤Æ¤ä¤êľ¤·¤Þ¤·¤ç¤¦¡£
+
+---> ¤³¤Î ʸ »æ ¤Ë¤Ï ¤¤¤¯¤Ä¤«¤Î ¤¿¤Î¤·¤¤ ɬÍפΤʤ¤ ñ¸ì ¤¬ ´Þ¤Þ¤ì¤Æ ¤¤¤Þ¤¹¡£
+
+ 5. 3 ¤«¤é 4 ¤Þ¤Ç¤òʸ¤¬Àµ¤·¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤·¡¢¥ì¥Ã¥¹¥ó 2.2 ¤Ë°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 2.2: ¤½¤Î¾¤Îºï½ü¥³¥Þ¥ó¥É
+
+
+ ** ¹Ô¤ÎËöÈø¤Þ¤Ç¤òºï½ü¤¹¤ë¤Ë¤Ï d$ ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦ **
+
+ 1. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç¤¢¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤Î¤Ë <ESC> ¤ò²¡¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. Àµ¤·¤¤Ê¸¤ÎËöÈø¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦(ºÇ½é¤Î . ¤Î¸å¤Ç¤¹)¡£
+
+ 4. ¹ÔËö¤Þ¤Çºï½ü¤¹¤ë¤Î¤Ë d$ ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+---> 狼¤¬¤³¤Î¹Ô¤ÎºÇ¸å¤ò2ÅÙ¥¿¥¤¥×¤·¤Þ¤·¤¿¡£ 2ÅÙ¥¿¥¤¥×¤·¤Þ¤·¤¿¡£
+
+
+ 5. ¤É¤¦¤¤¤¦¤³¤È¤«Íý²ò¤¹¤ë¤¿¤á¤Ë¡¢¥ì¥Ã¥¹¥ó 2.3 ¤Ø°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: ¥³¥Þ¥ó¥É¤ÈÌÜŪ¸ì
+
+
+ ºï½ü¥³¥Þ¥ó¥É d ¤Î·Á¼°¤Ï¼¡¤ÎÍͤˤʤäƤ¤¤Þ¤¹:
+
+ [²ó¿ô] d ÌÜŪ¸ì ¤â¤·¤¯¤Ï d [²ó¿ô] ÌÜŪ¸ì
+ ¤½¤ì¤¾¤ì:
+ ²ó¿ô - ¤½¤Î¥³¥Þ¥ó¥É¤ò²¿²ó·«¤êÊÖ¤¹¤«(¾Êά²Äǽ, ¾Êά¤·¤¿»þ¤Ï =1)¡£
+ d - ºï½ü¥³¥Þ¥ó¥É¡£
+ ÌÜŪ¸ì - ²¿¤ËÂФ·¤ÆƯ¤­¤«¤±¤ë¤«(°Ê²¼¤Ëµó¤²¤Þ¤¹)¡£
+
+ ÌÜŪ¸ì°ìÍ÷:
+ w - ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é¶õÇò¤ò´Þ¤àñ¸ì¤ÎËöÈø¤Þ¤Ç¡£
+ e - ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é¶õÇò¤ò´Þ¤Þ¤Ê¤¤Ã±¸ì¤ÎËöÈø¤Þ¤Ç¡£
+ $ - ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é¹ÔËö¤Þ¤Ç¡£
+
+NOTE: ËÁ¸±¤·¤¿¤¤¿Í¤Ï¡¢¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤Æ¥³¥Þ¥ó¥É¤Ê¤·¤ËÌÜŪ¸ì¤ò²¡¤·¤Æ
+ ¤ß¤Þ¤·¤ç¤¦¡£¥«¡¼¥½¥ë¤¬ÌÜŪ¸ì°ìÍ÷¤Ç¼¨¤µ¤ì¤ë°ÌÃ֤˰ÜÆ°¤¹¤ë¤Ï¤º¤Ç¤¹¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 2.4: ¤½¤ì°Ê³°¤Î·Á¤Î¥³¥Þ¥ó¥É
+
+
+ ** ¹ÔÁ´ÂΤòºï½ü¤¹¤ë¤Ë¤Ï dd ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦ **
+
+ ¹ÔÁ´ÂΤκï½ü¤ÏÉÑÈˤ˹Ԥʤ¦ºî¶È¤Ê¤Î¤Ç¡¢Vim ¤ÎÀ߷׼ԤϹԤòºï½ü¤¹¤ë¤Î¤Ë¤Ï¡¢
+ ñ¤ËÎóÆâ¤Ë¤Æ2²ó d ¤ò¥¿¥¤¥×¤¹¤ëÊý¤¬´Êñ¤À¤í¤¦¤ÈȽÃǤ·¤Þ¤·¤¿¡£
+
+ 1. ²¼¤Ë¤¢¤ë°ìÏ¢¤Î¥Õ¥ì¡¼¥º¤Î2¹ÔÌܤ˥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+ 2. dd ¤È¥¿¥¤¥×¤·¤Æ¹Ô¤òºï½ü¤·¤Þ¤·¤ç¤¦¡£
+ 3. ¤Ç¤Ï4¹ÔÌܤ˰ÜÆ°¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+ 4. 2dd ¤È¥¿¥¤¥×¤·¤Æ2¹Ôºï½ü¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+ (²ó¿ô-¥³¥Þ¥ó¥É-ÌÜŪ¸ì ¤Î·Á¼°¤ò»×¤¤½Ð¤·¤Þ¤·¤ç¤¦)
+
+ 1) ¥Ð¥é¤ÏÀÖ¤¤¡¢
+ 2) ¤Ä¤Þ¤é¤Ê¤¤¤â¤Î¤Ï³Ú¤·¤¤¡¢
+ 3) ¥¹¥ß¥ì¤ÏÀĤ¤¡¢
+ 4) »ä¤Ï¼Ö¤ò¤â¤Ã¤Æ¤¤¤ë¡¢
+ 5) »þ·×¤¬»þ¹ï¤ò¹ð¤²¤ë¡¢
+ 6) º½Åü¤Ï´Å¤¤
+ 7) ¥ª¥Þ¥¨¥â¥Ê¡¼
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 2.5: ¤ä¤êľ¤·¥³¥Þ¥ó¥É
+
+
+ ** ºÇ¸å¤Î¥³¥Þ¥ó¥É¤ò¼è¤ê¾Ã¤¹¤Ë¤Ï u ¤ò²¡¤·¤Þ¤¹¡£U ¤Ï¹ÔÁ´ÂΤμè¾Ã¤Ç¤¹¡£ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¡¢ºÇ½é¤Î´Ö°ã¤¤¤Ë¥«¡¼¥½¥ë
+ ¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+ 2. x ¤ò¥¿¥¤¥×¤·¤Æ¤¤¤é¤Ê¤¤ÀèƬ¤Îʸ»ú¤òºï½ü¤·¤Þ¤·¤ç¤¦¡£
+ 3. ¤µ¤¡¡¢u ¤ò¥¿¥¤¥×¤·¤ÆºÇ¸å¤Ë¼Â¹Ô¤·¤¿¥³¥Þ¥ó¥É¤ò¼è¤ê¾Ã¤·¤Þ¤·¤ç¤¦¡£
+ 4. º£Å٤ϡ¢x ¤ò»ÈÍѤ·¤Æ¸í¤ê¤òÁ´¤Æ½¤Àµ¤·¤Þ¤·¤ç¤¦¡£
+ 5. Âçʸ»ú¤Î U ¤ò¥¿¥¤¥×¤·¤Æ¡¢¹Ô¤ò¸µ¤Î¾õÂÖ¤ËÌᤷ¤Þ¤·¤ç¤¦¡£
+ 6. u ¤ò¥¿¥¤¥×¤·¤ÆľÁ°¤Î U ¥³¥Þ¥ó¥É¤ò¼è¾Ã¤·¤Þ¤·¤ç¤¦¡£
+ 7. ¤Ç¤Ï¥³¥Þ¥ó¥É¤òºÆ¼Â¹Ô¤¹¤ë¤Î¤Ë CTRL-R (CTRL ¤ò²¡¤·¤¿¤Þ¤Þ R ¤òÂǤÄ)¤ò
+ ¿ô²ó¥¿¥¤¥×¤·¤Æ¤ß¤Þ¤·¤ç¤¦(¼è¾Ã¤Î¼è¾Ã)¡£
+
+---> ¤³¤Î¤Î¹Ô¤Î¤Î´Ö°ã¤¤¤ò½¤Àµ¡¹¤·¡¢¸å¤Ç¤½¤ì¤é¤Î½¤Àµ¤ò¤ò¼è¾Ã¤·¤Þ¤Þ¤¹¤¹¡£
+
+ 8. ¤³¤ì¤Ï¤È¤Æ¤âÊØÍø¤Ê¥³¥Þ¥ó¥É¤Ç¤¹¡£¤µ¤¡¥ì¥Ã¥¹¥ó 2 Í×Ìó¤Ë°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 2 Í×Ìó
+
+
+ 1. ¥«¡¼¥½¥ë°ÌÃÖ¤«¤éñ¸ì¤ÎËöÈø¤Þ¤Ç¤òºï½ü¤¹¤ë¤Ë¤Ï dw ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 2. ¥«¡¼¥½¥ë°ÌÃÖ¤«¤é¹Ô¤ÎËöÈø¤Þ¤Ç¤òºï½ü¤¹¤ë¤Ë¤Ï d$ ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 3. ¹ÔÁ´ÂΤòºï½ü¤¹¤ë¤Ë¤Ï dd ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 4. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç¤Î¥³¥Þ¥ó¥É·Á¼°¤Ï
+
+ [²ó¿ô] ¥³¥Þ¥ó¥É ÌÜŪ¸ì ¤â¤·¤¯¤Ï ¥³¥Þ¥ó¥É [²ó¿ô] ÌÜŪ¸ì
+ ¤½¤ì¤¾¤ì:
+ ²ó¿ô - ¤½¤Î¥³¥Þ¥ó¥É¤ò²¿²ó·«¤êÊÖ¤¹¤«¡£
+ ¥³¥Þ¥ó¥É - ºï½ü d ¤ÎÎà¤Ç²¿¤ò¤¹¤ë¤«¡£
+ ÌÜŪ¸ì - ñ¸ì w ¤ä¹ÔËö $ ¤Ê¤É¤ÎÎà¤Ç²¿¤ËÂФ·¤ÆƯ¤­¤«¤±¤ë¤«¡£
+
+ 5. Á°²ó¤ÎÆ°ºî¤ò¼è¾Ã¤¹: u (¾®Ê¸»ú u)
+ ¹ÔÁ´ÂΤÎÊѹ¹¤ò¼è¾Ã¤¹: U (Âçʸ»ú U)
+ ¼è¾Ã¤·¤Î¼è¾Ã¤·: CTRL-R
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 3.1: Ž¤êÉÕ¤±¥³¥Þ¥ó¥É
+
+
+ ** ºÇ¸å¤Ëºï½ü¤µ¤ì¤¿¹Ô¤ò¥«¡¼¥½¥ë¤Î¸å¤ËŽ¤êÉÕ¤±¤ë¤Ë¤Ï p ¤ò¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤ÎÃÊÍî¤ÎºÇ½é¤Î¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. dd ¤È¥¿¥¤¥×¤·¤Æ¹Ô¤òºï½ü¤·¡¢Vim ¤Î¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. ºï½ü¤·¤¿¹Ô¤¬ËÜÍ褢¤ë¤Ù¤­°ÌÃ֤ξå¤Î¹Ô¤Þ¤Ç¡¢¥«¡¼¥½¥ë¤ò°ÜÆ°¤µ¤»¤Þ¤·¤ç¤¦¡£
+
+ 4. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç p ¤ò¥¿¥¤¥×¤·¤Æ³ÊǼ¤·¤¿¹Ô¤ò²èÌ̤ËÌᤷ¤Þ¤¹¡£
+
+ 5. ½çÈÖ¤¬Àµ¤·¤¯¤Ê¤ëÍͤ˥¹¥Æ¥Ã¥× 2 ¤«¤é 4 ¤ò·«¤êÊÖ¤·¤Þ¤·¤ç¤¦¡£
+
+ d) µ®Êý¤â³Ø¤Ö¤³¤È¤¬¤Ç¤­¤ë?
+ b) ¥¹¥ß¥ì¤ÏÀĤ¤¡¢
+ c) ÃηäȤϳؤ֤â¤Î¡¢
+ a) ¥Ð¥é¤ÏÀÖ¤¤¡¢
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 3.2: ÃÖ¤­´¹¤¨¥³¥Þ¥ó¥É
+
+
+ ** ¥«¡¼¥½¥ë¤Î²¼¤Îʸ»ú¤òÃÖ¤­´¹¤¨¤ë¤Ë¤Ï r ¤ò¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿ºÇ½é¤Î¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ºÇ½é¤Î´Ö°ã¤¤¤ÎÀèƬ¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. r ¤È¥¿¥¤¥×¤·¡¢´Ö°ã¤Ã¤Æ¤¤¤ëʸ»ú¤òÃÖ¤­´¹¤¨¤ë¡¢Àµ¤·¤¤Ê¸»ú¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. ºÇ½é¤Î¹Ô¤¬Àµ¤·¤¯¤Ê¤ë¤Þ¤Ç¥¹¥Æ¥Ã¥× 2 ¤«¤é 3 ¤ò·«¤êÊÖ¤·¤Þ¤·¤ç¤¦¡£
+
+---> ¤³¤Î¹ç¤ò¿ÍÎϤ·¤¿»þ¤Í¡¢¤½¤Î¿Í¤Ï´ö¤Ä¤«Ìä°ã¤Ã¤¿¥­¡¼¤ò²¡¤·¤â¤·¤¿!
+---> ¤³¤Î¹Ô¤òÆþÎϤ·¤¿»þ¤Ë¡¢¤½¤Î¿Í¤Ï´ö¤Ä¤«´Ö°ã¤Ã¤¿¥­¡¼¤ò²¡¤·¤Þ¤·¤¿!
+
+ 5. ¤µ¤¡¡¢¥ì¥Ã¥¹¥ó 3.2 ¤Ë°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+NOTE: ¼ÂºÝ¤Ë»î¤·¤Þ¤·¤ç¤¦¡£·è¤·¤Æ³Ð¤¨¤ë¤À¤±¤Ë¤Ï¤·¤Ê¤¤¤³¤È¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 3.3: Êѹ¹¥³¥Þ¥ó¥É
+
+
+ ** ñ¸ì¤Î°ìÉô¡¢¤â¤·¤¯¤ÏÁ´ÂΤòÊѹ¹¤¹¤ë¤Ë¤Ï cw ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿ºÇ½é¤Î¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. lubw ¤Î u ¤Î°ÌÃ֤˥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. cw ¤È¥¿¥¤¥×¤·¡¢Àµ¤·¤¤Ã±¸ì¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦(¤³¤Î¾ì¹ç 'ine' ¤È¥¿¥¤¥×)¡£
+
+ 4. ¼¡¤Î´Ö°ã¤¤(Êѹ¹¤¹¤Ù¤­Ê¸»ú¤ÎÀèƬ)¤Ë°ÜÆ°¤¹¤ë¤¿¤á¤Ë <ESC> ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 5. ºÇ½é¤Î¹Ô¤¬¼¡¤Î¹Ô¤ÎÍͤˤʤë¤Þ¤Ç¥¹¥Æ¥Ã¥× 3 ¤È 4 ¤ò·«¤êÊÖ¤·¤Þ¤¹¡£
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+cw ¤Ïñ¸ì¤òÊѹ¹¤¹¤ë¤À¤±¤Ç¤Ê¤¯¡¢ÁÞÆþ¤â¹Ô¤¨¤ë¤³¤È¤ËÃí°Õ¤·¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 3.4: c ¤ò»ÈÍѤ·¤¿¤½¤Î¾¤ÎÊѹ¹
+
+
+ ** Êѹ¹¥³¥Þ¥ó¥É¤Ï¡¢ºï½ü¥³¥Þ¥ó¥É¤ÈƱ¤¸Íͤ˥ª¥Ö¥¸¥§¥¯¥È¤ò»ÈÍѤ·¤Þ¤¹ **
+
+
+ 1. Êѹ¹¥³¥Þ¥ó¥É¤Ï¡¢ºï½ü¥³¥Þ¥ó¥É¤ÈƱ¤¸¤è¤¦¤ÊÆ°ºî¤ò¤·¤Þ¤¹¡£¤½¤Î·Á¼°¤Ï
+
+ [²ó¿ô] c ÌÜŪ¸ì ¤â¤·¤¯¤Ï c [²ó¿ô] ÌÜŪ¸ì
+
+ 2. ¥ª¥Ö¥¸¥§¥¯¥È¤âƱ¤¸¤Ç¡¢w ¤Ïñ¸ì¡¢ $ ¤Ï¹ÔËö¤Ê¤É¤È¤¤¤Ã¤¿¤â¤Î¤Ç¤¹¡£
+
+ 3. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. ºÇ½é¤Î´Ö°ã¤¤¤Ø¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 5. c$ ¤È¥¿¥¤¥×¤·¤Æ¹Ô¤Î»Ä¤ê¤ò£²¹ÔÌܤÎÍͤˤ·¡¢<ESC> ¤ò²¡¤·¤Þ¤·¤ç¤¦¡£
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 3 Í×Ìó
+
+
+ 1. ´û¤Ëºï½ü¤µ¤ì¤¿¥Æ¥­¥¹¥È¤òºÆÇÛÃÖ¤¹¤ë¤Ë¤Ï¡¢p ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£¤³¤ì¤Ïºï½ü¤µ
+ ¤ì¤¿¥Æ¥­¥¹¥È¤ò¥«¡¼¥½¥ë¤Î¸å¤ËÁÞÆþ¤·¤Þ¤¹(¹Ôñ°Ì¤Çºï½ü¤µ¤ì¤¿¤Î¤Ê¤é¤Ð¡¢¥«¡¼
+ ¥½¥ë¤Î¤¢¤ë¼¡¤Î¹Ô¤ËÁÞÆþ¤µ¤ì¤Þ¤¹)¡£
+
+ 2. ¥«¡¼¥½¥ë¤Î²¼¤Îʸ»ú¤òÃÖ¤­´¹¤¨¤ë¤Ë¤Ï¡¢r ¤ò¥¿¥¤¥×¤·¤¿¸å¡¢¤½¤ì¤òÃÖ¤­´¹¤¨¤ë
+ ʸ»ú¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 3. Êѹ¹¥³¥Þ¥ó¥É¤Ç¤Ï¥«¡¼¥½¥ë°ÌÃÖ¤«¤éÆÃÄê¤ÎÌÜŪ¸ì¤Ç»ØÄꤵ¤ì¤ë½ªÃ¼¤Þ¤Ç¤òÊѹ¹
+ ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£Î㤨¤Ð cw ¤Ê¤é¤Ð¥«¡¼¥½¥ë°ÌÃÖ¤«¤éñ¸ì¤Î½ª¤ï¤ê¤Þ¤Ç¡¢
+ c$ ¤Ê¤é¤Ð¹Ô¤Î½ª¤ï¤ê¤Þ¤Ç¤òÊѹ¹¤·¤Þ¤¹¡£
+
+ 4. Êѹ¹¥³¥Þ¥ó¥É¤Î·Á¼°¤Ï
+
+ [²ó¿ô] c ÌÜŪ¸ì ¤â¤·¤¯¤Ï c [²ó¿ô] ÌÜŪ¸ì
+
+¤µ¤¡¡¢¼¡¤Î¥ì¥Ã¥¹¥ó¤Ë°Ü¤ê¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 4.1: °ÌÃ֤ȥե¡¥¤¥ë¤Î¾ðÊó
+
+
+ ** ¥Õ¥¡¥¤¥ëÆâ¤Ç¤Î°ÌÃ֤ȥե¡¥¤¥ë¤Î¾õÂÖ¤òɽ¼¨¤¹¤ë¤Ë¤Ï CTRL-g ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+ ¥Õ¥¡¥¤¥ëÆâ¤Î¤¢¤ë¹Ô¤Ë°ÜÆ°¤¹¤ë¤Ë¤Ï SHIFT-G ¤ò¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ NOTE: ¥¹¥Æ¥Ã¥×¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¢¤³¤Î¥ì¥Ã¥¹¥óÁ´¤Æ¤ËÌܤòÄ̤·¤Þ¤·¤ç¤¦!!
+
+ 1. CTRL ¤ò²¡¤·¤¿¤Þ¤Þ g ¤ò²¡¤·¤Þ¤·¤ç¤¦¡£¥Ú¡¼¥¸¤Î°ìÈÖ²¼¤Ë¤¢¤ë¥¹¥Æ¡¼¥¿¥¹¹Ô
+ ¤Ë¥Õ¥¡¥¤¥ë̾¤È¹Ô¤¬É½¼¨¤µ¤ì¤ë¤Ï¤º¤Ç¤¹¡£ ¥¹¥Æ¥Ã¥× 3 ¤Î¤¿¤á¤Ë¹ÔÈÖ¹æ¤ò
+ ³Ð¤¨¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡£(Ìõ¼ÔÃí:¥ë¡¼¥é¡¼¤¬¤¢¤ë¾ì¹ç¤Ï¤½¤Á¤é¤ËÃíÌÜ)
+
+ 2. ºÇ²¼¹Ô¤Ë°ÜÆ°¤¹¤ë¤¿¤á¤Ë shift-G ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. Àè¤Û¤É¤Î¹Ô¤ÎÈÖ¹æ¤ò¥¿¥¤¥×¤·¡¢ shift-G ¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+ ºÇ½é¤Ë Ctrl-g ¤ò²¡¤·¤¿¹Ô¤ËÌá¤Ã¤ÆÍè¤ë¤Ï¤º¤Ç¤¹¡£
+ (¿ô»ú¤ò¥¿¥¤¥×¤·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï²èÌ̤Ëɽ¼¨¤µ¤ì¤Þ¤»¤ó)
+
+ 4. ¼«¿®¤¬»ý¤Æ¤¿¤é¥¹¥Æ¥Ã¥× 1 ¤«¤é 3 ¤ò¼Â¹Ô¤·¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 4.2: ¸¡º÷¥³¥Þ¥ó¥É
+
+
+ ** ¸ì¶ç¤ò¸¡º÷¤¹¤ë¤Ë¤Ï / ¤È¡¢Á°Êý¸¡º÷¤¹¤ë¸ì¶ç¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£**
+
+ 1. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ç / ¤È¤¤¤¦Ê¸»ú¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£²èÌÌ°ìÈÖ²¼¤Ë : ¥³¥Þ¥ó¥É
+ ¤ÈƱ¤¸ÍÍ¤Ë / ¤¬¸½¤ì¤ë¤³¤È¤Ëµ¤¤Å¤¯¤Ç¤·¤ç¤¦¡£
+
+ 2. ¤Ç¤Ï¡¢'errroor' <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£¤³¤ì¤¬¸¡º÷¤·¤¿¤¤Ã±¸ì¤Ç¤¹¡£
+
+ 3. Ʊ¤¸¸ì¤ò¤â¤¦°ìÅÙ¸¡º÷¤¹¤ë¤È¤­¤Ï ñ¤Ë n ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+ µÕÊý¸þ¤Ë¸ì¶ç¤ò¸¡º÷¤¹¤ë¤È¤­¤Ï N ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ 4. µÕÊý¸þ¤Ë¸ì¶ç¤ò¸¡º÷¤·¤¿¤¤¾ì¹ç¤Ï¡¢/ ¥³¥Þ¥ó¥É¤Î¤«¤ï¤ê¤Ë ? ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·
+ ¤Þ¤¹¡£
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+¸¡º÷¤¬¥Õ¥¡¥¤¥ë¤Î½ª¤ï¤ê¤Ë㤹¤ë¤È¡¢¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤«¤é¸¡º÷¤ò³¹Ô¤·¤Þ¤¹¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 4.3: Âбþ¤¹¤ë³ç¸Ì¤ò¸¡º÷
+
+
+ ** Âбþ¤¹¤ë ),] ¤ä } ¤ò¸¡º÷¤¹¤ë¤Ë¤Ï % ¤ò¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ç (,[ ¤« { ¤Î¤É¤ì¤«¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°
+ ¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ¤½¤³¤Ç % ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ 3. ¥«¡¼¥½¥ë¤ÏÂбþ¤¹¤ë³ç¸Ì¤Ë°ÜÆ°¤¹¤ë¤Ï¤º¤Ç¤¹¡£
+
+ 4. ºÇ½é¤Î³ç¸Ì¤Ë°ÜÆ°¤¹¤ë¤Ë¤Ï % ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+NOTE: ¤³¤Îµ¡Ç½¤Ï³ç¸Ì¤¬°ìÃפ·¤Æ¤¤¤Ê¤¤¥×¥í¥°¥é¥à¤ò¥Ç¥Ð¥Ã¥°¤¹¤ë¤Î¤Ë¤È¤Æ¤âÌòΩ¤Á
+ ¤Þ¤¹¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 4.4: ´Ö°ã¤¤¤òÊѹ¹¤¹¤ëÊýË¡
+
+
+ ** 'old' ¤ò 'new' ¤ËÃÖ´¹¤¹¤ë¤Ë¤Ï :s/old/new/g ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. :s/thee/the <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£¤³¤Î¥³¥Þ¥ó¥É¤Ï¤½¤Î¹Ô¤ÇºÇ½é¤Ë¸«
+ ¤Ä¤«¤Ã¤¿¤â¤Î¤Ë¤À¤±¹Ô¤Ê¤ï¤ì¤ë¤³¤È¤Ëµ¤¤ò¤Ä¤±¤Þ¤·¤ç¤¦¡£
+
+ 3. ¤Ç¤Ï :s/thee/the/g ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£¹ÔÁ´ÂΤòÃÖ´¹¤¹¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
+ ¤³¤ÎÊѹ¹¤Ï¤½¤Î¹Ô¤Ç¸«¤Ä¤«¤Ã¤¿Á´¤Æ¤Î²Õ½ê¤ËÂФ·¤Æ¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. Ê£¿ô¹Ô¤«¤é¸«¤Ä¤«¤ëʸ»ú¤òÊѹ¹¤¹¤ë¤Ë¤Ï
+ :#,#s/old/new/g #,# ¤Ï£²¹Ô¤Î¹ÔÈÖ¹æ¤ò»Ø¤·¤Þ¤¹¡£
+ :%s/old/new/g ¥Õ¥¡¥¤¥ëÁ´ÂΤǸ«¤Ä¤«¤ë¤â¤Î¤ËÂФ·¤ÆÊѹ¹¤¹¤ë¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 4 Í×Ìó
+
+
+ 1. Ctrl-g ¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Î°ÌÃ֤ȥե¡¥¤¥ë¤Î¾ÜºÙ¤òɽ¼¨¤·¤Þ¤¹¡£
+ Shift-G ¤Ï¥Õ¥¡¥¤¥ë¤ÎºÇ²¼¹Ô¤Ë°ÜÆ°¤·¤Þ¤¹¡£¹ÔÈÖ¹æ¸å¤Ë Shift-G ¤È¤¹¤ë¤È
+ ¤½¤Î¹Ô¤Ë°ÜÆ°¤·¤Þ¤¹¡£
+
+ 2. / ¤Î¸å¤Ë¸ì¶ç¤ò¥¿¥¤¥×¤¹¤ë¤ÈÁ°Êý¤Ë¸ì¶ç¤ò¸¡º÷¤·¤Þ¤¹¡£
+ ? ¤Î¸å¤Ë¸ì¶ç¤ò¥¿¥¤¥×¤¹¤ë¤È¸åÊý¤Ë¸ì¶ç¤ò¸¡º÷¤·¤Þ¤¹¡£
+ ¸¡º÷¤Î¸å n ¤Ç¡¢Æ±Êý¸þ¤Ë¸¡º÷¤òºÆ¤Ó¹Ô¤¤¡¢¤Þ¤¿ N ¤ÇµÕÊý¸þ¤Ë¸¡º÷¤ò¹Ô¤Ê¤¤¤Þ
+ ¤¹¡£
+
+ 3. (,),[,],{, or } ¾å¤Ë¥«¡¼¥½¥ë¤¬¤¢¤ë¾õÂÖ¤Ç % ¤ò¥¿¥¤¥×¤¹¤ë¤È
+ Âбþ¤·¤¿ÂФ˰ÜÆ°¤·¤Þ¤¹¡£
+
+ 4. ¸½ºß¹Ô¤ÎºÇ½é¤Î old ¤ò new ¤ËÃÖ´¹¤¹¤ë¡£ :s/old/new
+ ¸½ºß¹Ô¤ÎÁ´¤Æ¤Î old ¤ò new ¤ËÃÖ´¹¤¹¤ë¡£ :s/old/new/g
+ 2¤Ä¤Î # ´Ö¤Ç¸ì¶ç¤òÃÖ´¹¤¹¤ë¡£ :#,#s/old/new/g
+ ¥Õ¥¡¥¤¥ë¤ÎÃæ¤ÎÁ´¤Æ¤Î¸¡º÷¸ì¶ç¤òÃÖ´¹¤¹¤ë¡£ :%s/old/new/g
+ 'c' ¤ò²Ã¤¨¤ë¤ÈÃÖ´¹¤ÎÅ٤˳Îǧ¤òµá¤á¤ë¡£ :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 5.1: ³°Éô¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ëÊýË¡
+
+
+ ** :! ¤Î¸å¤Ë¼Â¹Ô¤¹¤ë³°Éô¥³¥Þ¥ó¥É¤ò¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. ²èÌ̤κDz¼Éô¤Ë¥«¡¼¥½¥ë¤¬°ÜÆ°¤¹¤ë¤è¤¦¡¢´·¤ì¿Æ¤·¤ó¤À : ¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+ ¤³¤ì¤Ç¥³¥Þ¥ó¥É¤¬¥¿¥¤¥×¤Ç¤­¤ëÍͤˤʤê¤Þ¤¹¡£
+
+ 2. ¤³¤³¤Ç ! ¤È¤¤¤¦Ê¸»ú(´¶Ã²Éä)¤ò¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+ ¤³¤ì¤Ç³°Éô¥·¥§¥ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤Ç¤­¤ëÍͤˤʤê¤Þ¤¹¡£
+
+ 3. Îã¤È¤·¤Æ ! ¤Ë³¤±¤Æ ls ¤È¥¿¥¤¥×¤· <ENTER> ¤ò²¡¤·¤Þ¤·¤ç¤¦¡£
+ ¥·¥§¥ë¥×¥í¥ó¥×¥È¤Î¤è¤¦¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤Î°ìÍ÷¤¬É½¼¨¤µ¤ì¤ë¤Ï¤º¤Ç¤¹¡£
+ ¤â¤·¤¯¤Ï ls ¤¬Æ°¤«¤Ê¤¤¤Ê¤é¤Ð :!dir ¤ò»ÈÍѤ·¤Þ¤·¤ç¤¦¡£
+
+---> NOTE: ¤³¤ÎÊýË¡¤Ë¤è¤Ã¤Æ¤¢¤é¤æ¤ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+
+---> NOTE: Á´¤Æ¤Î : ¥³¥Þ¥ó¥É¤Ï <ENTER> ¤ò²¡¤·¤Æ½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 5.2: ¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë¤Ø½ñ¤­¹þ¤ß
+
+
+ ** ¥Õ¥¡¥¤¥ë¤ØÊѹ¹¤òÊݸ¤¹¤ë¤Ë¤Ï :w ¥Õ¥¡¥¤¥ë̾ ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. ¥Ç¥£¥ì¥¯¥È¥ê¤Î°ìÍ÷¤òÆÀ¤ë¤¿¤á¤Ë :!dir ¤â¤·¤¯¤Ï :!ls ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+ ¤³¤Î¤¢¤È <ENTER> ¤ò²¡¤¹¤Î¤Ï´û¤Ë¤´Â¸ÃΤǤ¹¤Í¡£
+
+ 2. TEST ¤Î¤è¤¦¤Ë¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë̵¤¤¥Õ¥¡¥¤¥ë̾¤ò°ì¤ÄÁª¤Ó¤Þ¤¹¡£
+
+ 3. ¤Ç¤Ï :w TEST ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦ (TEST ¤Ï¡¢Áª¤ó¤À¥Õ¥¡¥¤¥ë̾¤Ç¤¹)¡£
+
+ 4. ¤³¤ì¤Ë¤è¤ê¥Õ¥¡¥¤¥ëÁ´ÂΤ¬ TEST ¤È¤¤¤¦Ì¾Á°¤ÇÊݸ¤µ¤ì¤Þ¤¹¡£
+ ¤â¤¦°ìÅÙ :!dir ¤È¥¿¥¤¥×¤·¤Æ³Îǧ¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+
+---> ¤³¤³¤Ç Vim ¤ò½ªÎ»¤·¡¢¥Õ¥¡¥¤¥ë̾ TEST ¤È¶¦¤Ëµ¯Æ°¤¹¤ë¤È¡¢Êݸ¤·¤¿»þ¤Î
+ ¥Á¥å¡¼¥È¥ê¥¢¥ë¤ÎÊ£À½¤¬¤Ç¤­¾å¤¬¤ë¤Ï¤º¤Ç¤¹¡£
+
+ 5. ¤Ç¤Ï¡¢ :!del TEST ¤È¥¿¥¤¥×¤·¤Æ¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 5.3: ÁªÂò¤·¤¿½ñ¤­¹þ¤ß
+
+
+ ** ÉôʬŪ¤ËÊݸ¤¹¤ë¤Ë¤Ï :#,# w ¥Õ¥¡¥¤¥ë̾ ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. ¤â¤¦°ìÅ٥ǥ£¥ì¥¯¥È¥ê¤Î°ìÍ÷¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Ë :!ls ¤È¥¿¥¤¥×¤·¡¢TEST ¤ÎÍͤË
+ ¥Õ¥¡¥¤¥ë¤ò°ì¤ÄÁª¤ó¤Ç¤ß¤Þ¤·¤ç¤¦¡£
+
+ 2. ¤³¤Î¥Ú¡¼¥¸¤Î»Ï¤á¤Þ¤Ç¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¡¢¥Õ¥¡¥¤¥ë¤Î¹Ô¿ô¤òÃΤ뤿¤á¤Ë Ctrl-g ¤È
+ ¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£¤½¤Î¹ÔÈÖ¹æ¤ò²±¤¨¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡£
+
+ 3. ¤½¤·¤Æ¥Ú¡¼¥¸¤Î½ª¤ê¤Þ¤Ç°ÜÆ°¤·¡¢ºÆÅÙ Ctrl-g ¤ò¹Ô¤¤¤Þ¤¹¡£
+ ¤³¤Î¹ÔÈÖ¹æ¤â²±¤¨¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡£
+
+ 4. ¤¢¤ëÉôʬ¤À¤±¤ò TEST ¤È¤¤¤¦Ì¾¤ÇÊݸ¤¹¤ë¤¿¤á¤Ë¡¢:#,# w TEST ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+ ¤³¤Î #,# ¤Ï³Ð¤¨¤Æ¤ª¤¤¤¿£²¤Ä¤ÎÈÖ¹æ(¾åü,²¼Ã¼) ¤Ç¤¢¤ê¡¢ TEST ¤¬¥Õ¥¡¥¤¥ë̾
+ ¤È¤Ê¤ê¤Þ¤¹¡£
+
+ 5. ºÆÅÙ¡¢¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤³¤È¤ò³Îǧ¤¹¤ë¤¿¤á¤Ë :!dir ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+ ¤¿¤À¤·¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¾Ã¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 5.4: ¥Õ¥¡¥¤¥ë¤Î¼è¹þ¤È¹çÊ»
+
+
+ ** ¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤òÁÞÆþ¤¹¤ë¤Ë¤Ï :r ¥Õ¥¡¥¤¥ë̾ ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. Àè¤Û¤É¤Î TEST ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤³¤È¤ò³Î¤«¤á¤ë¤¿¤á¤Ë :!dir ¤È
+ ¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ¥«¡¼¥½¥ë¤ò¤³¤Î¥Ú¡¼¥¸¤ÎÀèƬ¤Ë°ÜÆ°¤·¤Þ¤¹¡£
+
+NOTE: ¥¹¥Æ¥Ã¥× 3 ¤ò¼Â¹Ô¤¹¤ë¤È¡¢²èÌÌ¤Ë ¥ì¥Ã¥¹¥ó 5.3 ¤¬¸½¤ï¤ì¤ë¤Î¤Ç¡¢¥«¡¼¥½¥ë¤ò
+ ²¼¤Ë°ÜÆ°¤·¤³¤Î¥ì¥Ã¥¹¥ó¤Þ¤ÇÌá¤ê¤Þ¤·¤ç¤¦¡£
+
+ 3. ¤Ç¤Ï¡¢:r TEST ¤È¥¿¥¤¥×¤·¤Æ TEST ¥Õ¥¡¥¤¥ë¤ò¼è¹þ¤ß¤Þ¤·¤ç¤¦¡£¤³¤Î TEST ¤Ï
+ ¥Õ¥¡¥¤¥ë̾¤Ç¤¹¡£
+
+NOTE: ¥Õ¥¡¥¤¥ë¤Î¼è¹þ¤ß¤Ï¥«¡¼¥½¥ë¤Î°ÌÃÖ¤«¤é¹Ô¤ï¤ì¤Þ¤¹¡£
+
+ 4. ¼è¹þ¤ó¤À¥Õ¥¡¥¤¥ë¤ò³Îǧ¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£¥«¡¼¥½¥ë¤òÌ᤹¤È¡¢¥ì¥Ã¥¹¥ó5.3 ¤Î
+ ¥ª¥ê¥¸¥Ê¥ë¤È¥Õ¥¡¥¤¥ë¤Ë¤è¤ë¤â¤Î¤Î2¤Ä¤¬¤¢¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤¹¡£
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 5 Í×Ìó
+
+
+ 1. :!command ¤Ë¤è¤Ã¤Æ ³°Éô¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£
+
+ ¤è¤¯»È¤¦Îã:
+ :!ls - ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë°ìÍ÷¤ò¸«¤ë¡£
+ :!del ¥Õ¥¡¥¤¥ë̾ - ¥Õ¥¡¥¤¥ë̾¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Îºï½ü¤¹¤ë¡£
+
+ 2. :w ¥Õ¥¡¥¤¥ë̾ ¤Ë¤è¤Ã¤Æ¥Õ¥¡¥¤¥ë̾¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¡£
+
+ 3. :#,# w ¥Õ¥¡¥¤¥ë̾ ¤Ë¤è¤Ã¤Æ # ¤«¤é # ¤Þ¤Ç¤òÊݸ¤¹¤ë¡£
+
+ 4. :r ¥Õ¥¡¥¤¥ë̾ ¤Ë¤è¤ê¥Õ¥¡¥¤¥ë̾¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¥Ç¥£¥¹¥¯¤è¤ê¼è¹þ¤Þ¤ì¡¢
+ ¥«¡¼¥½¥ë°ÌÃ֤β¼¤ËÁÞÆþ¤µ¤ì¤ë¡£
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 6.1: ¥ª¡¼¥×¥ó¥³¥Þ¥ó¥É
+
+
+ ** o ¤ò¥¿¥¤¥×¤¹¤ë¤È¡¢¥«¡¼¥½¥ë¤Î²¼¤Î¹Ô¤¬³«¤­¡¢ÁÞÆþ¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. o (¾®Ê¸»ú) ¤ò¥¿¥¤¥×¤·¤Æ¡¢¥«¡¼¥½¥ë¤Î²¼¤Î¹Ô¤ò³«¤­¡¢ÁÞÆþ¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹¡£
+
+ 3. ---> ¤Èµ­¤µ¤ì¤¿¹Ô¤ò¼Ì¤·¡¢<ESC> ¤È¥¿¥¤¥×¤·¤ÆÄɲå⡼¥É¤ò½ªÎ»¤·¤Þ¤·¤ç¤¦¡£
+
+---> o ¤ò¥¿¥¤¥×¤¹¤ë¤È¥«¡¼¥½¥ë¤Ï³«¤¤¤¿¹Ô¤Ø°ÜÆ°¤·ÁÞÆþ¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹¡£
+
+ 4. ¥«¡¼¥½¥ë¤Î¾å¤Î¹Ô¤ËÁÞÆþ¤¹¤ë¤Ë¤Ï¡¢¾®Ê¸»ú¤Î o ¤Ç¤Ï¤Ê¤¯¡¢Ã±½ã¤ËÂçʸ»ú¤Î O
+ ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£¼¡¤Î¹Ô¤Ç»î¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
+¤³¤Î¹Ô¤Î¾å¤ØÁÞÆþ¤¹¤ë¤Ë¤Ï¡¢¤³¤Î¹Ô¤Ø¥«¡¼¥½¥ë¤òÃÖ¤¤¤Æ Shift-O ¤ò¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 6.2: Äɲå³¥Þ¥ó¥É
+
+
+ ** ¥«¡¼¥½¥ë¤Î¼¡¤Î°ÌÃÖ¤«¤é¥Æ¥­¥¹¥È¤òÄɲ乤ë¤Ë¤Ï a ¤È¥¿¥¤¥×¤·¤Þ¤¹ **
+
+ 1. ¥Î¡¼¥Þ¥ë¥â¡¼¥É¤Ë¤·¤Æ°Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿ºÇ½é¤Î¹Ô¤Ç $ ¤ò¥¿¥¤¥×¤·
+ ¤Æ¡¢½ªÃ¼¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ¥«¡¼¥½¥ë¤Îʸ»ú¤Î¸å¤í¤Ë¥Æ¥­¥¹¥È¤òÄɲ乤뤿¤á¤Ë a (¾®Ê¸»ú) ¤ò¥¿¥¤¥×¤·¤Þ
+ ¤¹¡£
+
+NOTE: ¤³¤ì¤ÏºÇ¸å¤Îʸ»ú¤Ë¤Æ¥Æ¥­¥¹¥È¤òÁÞÆþ¤·¡¢<ESC> ¤ò¥¿¥¤¥×¤·¤Æ¥«¡¼¥½¥ë¤ò±¦¤Ë
+ °ÜÆ°¤·¡¢ºÇ¸å¤Ë x ¥¿¥¤¥×¤·¤Æ¹ÔËö¤ËÄɲ乤ë¤È¤¤¤Ã¤¿¤è¤¦¤Ê i ¤Î¥¿¥¤¥×¤ò
+ Èò¤±¤ë¤³¤È¤¬¤­¤Þ¤¹¡£
+
+ 3. ¤µ¤ÆºÇ½é¤Î¹Ô¤ò´°À®¤·¤Þ¤·¤ç¤¦¡£¥Æ¥­¥¹¥È¤¬ÁÞÆþ¤µ¤ì¤ë°ÌÃÖ¤ò½ü¤±¤Ð¡¢
+ Äɲå³¥Þ¥ó¥É¤ÏÁÞÆþ¥â¡¼¥É¤È¤Þ¤Ã¤¿¤¯Æ±¤¸¤Ç¤¹¡£
+
+---> ¤³¤Î¹Ô¤Ç¡¢¹ÔËö¤Ëʸ¾Ï¤òÄɲ乤ë
+---> ¤³¤Î¹Ô¤Ç¡¢¹ÔËö¤Ëʸ¾Ï¤òÄɲ乤ëÎý½¬¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 6.3: ¤½¤Î¾¤ÎÃÖ´¹
+
+
+ ** 1ʸ»ú°Ê¾å¤òÃÖ¤­´¹¤¨¤ë¤Ë¤ÏÂçʸ»ú¤Î R ¤È¥¿¥¤¥×¤·¤Þ¤·¤ç¤¦ **
+
+ 1. °Ê²¼¤Î ---> ¤Èµ­¤µ¤ì¤¿¤µ¤ì¤¿¹Ô¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+
+ 2. ---> ¤Èµ­¤µ¤ì¤¿£²¹ÔÌܤȰ㤦¡¢ºÇ½é¤Îñ¸ì¤ÎÀèƬ¤Ë¥«¡¼¥½¥ë¤ò°ÜÆ°¤·¤Þ¤·¤ç¤¦¡£
+ (ñ¸ì 'last')
+
+ 3. ¤³¤³¤Ç R ¤ò¥¿¥¤¥×¤·¤Æ¡¢ºÇ½é¤Î¹Ô¤È¼¡¤Î¹Ô¤¬Æ±¤¸¤Ë¤Ê¤ë¤è¤¦¤Ë´û¸¤Î¥Æ¥­¥¹¥È
+ ¤Ø¾å½ñ¤­¥¿¥¤¥×¤·¡¢£±¹ÔÌܤλĤê¤ÎÉôʬ¤ò½ñ¤­´¹¤¨¤Þ¤·¤ç¤¦¡£
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. ¥â¡¼¥É¤òÈ´¤±¤ë¤¿¤á¤Ë <ESC> ¤ò¥¿¥¤¥×¤¹¤ë¤È¡¢Êѹ¹¤·¤Æ¤¤¤Ê¤¤Éôʬ¤¬»Ä¤ë¤³¤È
+ ¤ËÃí°Õ¤·¤Þ¤·¤ç¤¦¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 6.4: ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê
+
+
+ ** ¸¡º÷¤äÃÖ´¹¤ÎºÝ¤ËÂçʸ»ú¤È¾®Ê¸»ú¤ò̵»ë¤¹¤ëÍͤ˥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹ **
+
+
+ 1. °Ê²¼¤ÎÍͤ˥¿¥¤¥×¤·¤Æ 'ignore' ¤ò¸¡º÷¤·¤Þ¤·¤ç¤¦:
+ /ignore
+ n ¤ò²¡¤·¤Æ²¿ÅÙ¤«¸¡º÷¤ò·«¤êÊÖ¤·¤Þ¤¹¡£
+
+ 2. °Ê²¼¤ÎÍͤ˥¿¥¤¥×¤·¤Æ 'ic' (Ignore Case ¤Îά¤Ç¤¹) ¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹¡£
+ :set ic
+
+ 3. ¤Ç¤Ï n ¤Ë¤è¤Ã¤Æ¤â¤¦1ÅÙ 'ignore' ¤ò¸¡º÷¤·¤Þ¤¹¡£
+ n ¤ò²¡¤·¤Æ¤µ¤é¤Ë¿ô²ó¸¡º÷¤ò·«¤êÊÖ¤·¤Þ¤·¤ç¤¦¡£
+
+ 4. 'hlsearch' ¤È 'incsearch' ¥ª¥×¥·¥ç¥ó¤ò°Ê²¼¤ÎÍͤËÀßÄꤷ¤Þ¤·¤ç¤¦¡£
+ :set hls is
+
+ 5. ¤â¤¦°ìÅÙ¸¡º÷¥³¥Þ¥ó¥É¤òÆþÎϤ·¤Æ¡¢²¿¤¬µ¯¤³¤ë¤«¸«¤Æ¤ß¤Þ¤·¤ç¤¦:
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 6 Í×Ìó
+
+
+ 1. o ¤ò¥¿¥¤¥×¤¹¤ë¤È¥«¡¼¥½¥ë¤Î²¼¤Î¹Ô¤ò³«¤±¤Æ¡¢¤½¤³¤ÇÁÞÆþ¥â¡¼¥É¤Ë¤Ê¤ë¡£
+ O (Âçʸ»ú) ¤ò¥¿¥¤¥×¤¹¤ë¤È¥«¡¼¥½¥ë¤Î¾å¤Î¹Ô¤ÇÁÞÆþ¥â¡¼¥É¤Ë¤Ê¤ë¡£
+
+ 2. ¥«¡¼¥½¥ë¾å¤Îʸ»ú¤Î¼¡¤«¤é¥Æ¥­¥¹¥È¤òÄɲ乤ë¤Ë¤Ï a ¤È¥¿¥¤¥×¤¹¤ë¡£
+ ¹ÔËö¤Ë¼«Æ°¤Ç¥Æ¥­¥¹¥È¤òÁÞÆþ¤¹¤ë¤Ë¤ÏÂçʸ»ú A ¤ò¥¿¥¤¥×¤¹¤ë¡£
+
+ 3. Âçʸ»ú¤Î R ¤ò¥¿¥¤¥×¤¹¤ë¤ÈÃÖ´¹¥â¡¼¥É¤ËÆþ¤ê¡¢<ESC>¤ò²¡¤¹¤ÈÈ´¤±¤ë¡£
+
+ 4. ":set xxx" ¤È¥¿¥¤¥×¤¹¤ë¤È¥ª¥×¥·¥ç¥ó "xxx" ¤¬ÀßÄꤵ¤ì¤ë¡£
+
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 7: ¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¥³¥Þ¥ó¥É
+
+ ** ¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¤ò»ÈÍѤ·¤Þ¤·¤ç¤¦ **
+
+ Vim ¤Ë¤Ï¹­ÈϤˤ錄¤ë¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¥·¥¹¥Æ¥à¤¬¤¢¤ê¤Þ¤¹¡£
+ ¥Ø¥ë¥×¤ò³«»Ï¤¹¤ë¤Ë¤Ï¡¢¤³¤ì¤é3¤Ä¤Î¤É¤ì¤«1¤Ä¤ò»î¤·¤Æ¤ß¤Þ¤·¤ç¤¦:
+ - ¥Ø¥ë¥×¥­¡¼ <HELP> ¤ò²¡¤¹(¤â¤·¤¢¤ë¤Ê¤é¤Ð)¡£
+ - <F1> ¥­¡¼¤ò²¡¤¹(¤â¤·¤¢¤ë¤Ê¤é¤Ð)¡£
+ - :help <ENTER> ¤È¥¿¥¤¥×¤¹¤ë¡£
+
+ ¥Ø¥ë¥×¥¦¥£¥ó¥É¥¦¤òÊĤ¸¤ë¤Ë¤Ï :q <ENTER> ¤È¥¿¥¤¥×¤·¤Þ¤¹¡£
+
+ ":help" ¥³¥Þ¥ó¥É¤Ë°ú¿ô¤òÍ¿¤¨¤ë¤³¤È¤Ë¤è¤ê¡¢¤¢¤é¤æ¤ëÂê̾¤Î¥Ø¥ë¥×¤ò¸«¤Ä¤±¤ë
+ ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤é¤ò»î¤·¤Æ¤ß¤Þ¤·¤ç¤¦(<ENTER> ¤ò¥¿¥¤¥×¤·Ëº¤ì¤Ê¤¤¤è¤¦¤Ë):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ¥ì¥Ã¥¹¥ó 8: µ¯Æ°¥¹¥¯¥ê¥×¥È¤ÎºîÀ®
+
+ ** Vim ¤ÎÆÃħ¤òȯ´ø¤¹¤ë **
+
+ Vim ¤Ë¤Ï Vi ¤è¤ê¤â¿¤¯¤ÎÆÃħ¤òƧ¤Þ¤¨¤Æ¤¤¤Þ¤¬¡¢¤½¤Î¤Û¤È¤ó¤É¤Ï½é´ü¾õÂ֤ˤÆ
+ »ÈÍÑÉԲĤȤʤäƤ¤¤Þ¤¹¡£¤è¤ê¿¤¯¤ÎÆÃħ¤ò»È¤¤¤Ï¤¸¤á¤ë¤Ë¤Ï "vimrc" ¥Õ¥¡¥¤¥ë
+ ¤òºîÀ®¤·¤Þ¤¹¡£
+
+ 1. "vimrc" ¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¤ò³«»Ï¤¹¤ë¡£¤³¤ì¤Ï¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Þ¤¹¡£
+ :edit ~/.vimrc UNIX ¸þ¤±
+ :edit $VIM/_vimrc MS-Windows ¸þ¤±
+
+ 2. ¤³¤³¤Ç¥µ¥ó¥×¥ë¤Î "vimrc" ¤òÆɤ߹þ¤ß¤Þ¤¹¡£
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. °Ê²¼¤Î¤è¤¦¤Ë¥Õ¥¡¥¤¥ë¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£
+
+ :write
+
+ ¼¡²ó Vim ¤òµ¯Æ°¤¹¤ë¤È¡¢¿§¤Å¤±¹½Ê¸¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
+ ¤³¤Î "vimrc" ¥Õ¥¡¥¤¥ë¤Ø¡¢¤ª¹¥¤ß¤ÎÀßÄê¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ¤³¤ì¤Ë¤Æ Vim ¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤ò½ª¤ï¤ê¤Þ¤¹¡£¥¨¥Ç¥£¥¿¤ò´Êñ¤Ë¡¢¤·¤«¤â½¼Ê¬¤Ë
+ »È¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤È¡¢Vim ¤Î»ý¤Ä³µÇ°¤ÎÍ×ÅÀ¤Î¤ß¤òÅÁ¤¨¤è¤¦¤È¤·¤Þ¤·¤¿¡£
+ Vim ¤Ë¤Ï¤µ¤é¤Ë¿¤¯¤Î¥³¥Þ¥ó¥É¤¬¤¢¤ê¡¢¤³¤³¤ÇÁ´¤Æ¤òÀâÌÀ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
+ °Ê¹ß¤Ï¥æ¡¼¥¶¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤¯¤À¤µ¤¤: "help :user-manual"
+
+ ¤³¤ì°Ê¸å¤Î³Ø½¬¤Î¤¿¤á¤Ë¡¢¼¡¤ÎËܤò¿äÁ¦¤·¤Þ¤¹¡£
+ Vim - Vi Improved - by Steve Oualline
+ ½ÐÈǼÒ: New Riders
+ ºÇ½é¤ÎËܤϴ°Á´¤Ë Vim ¤Î¤¿¤á¤Ë½ñ¤«¤ì¤Þ¤·¤¿¡£¤È¤ê¤ï¤±½é¿´¼Ô¤Ë¤Ï¤ª¾©¤á¤Ç¤¹¡£
+ ¿¤¯¤ÎÎãÂê¤ä¿ÞÈǤ¬·ÇºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+ ¼¡¤ÎURL¤ò»²¾È¤·¤Æ²¼¤µ¤¤ http://iccf-holland.org/click5.html
+
+ ¼¡¤Ï Vim ¤è¤ê¤â Vi ¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤¿¸Å¤¤ËܤǤ¹¤¬¿äÁ¦¤·¤Þ¤¹:
+ Learning the Vi Editor - by Linda Lamb
+ ½ÐÈǼÒ: O'Reilly & Associates Inc.
+ Vi ¤Ç¤ä¤ê¤¿¤¤¤È»×¤¦¤³¤È¤Û¤ÜÁ´¤Æ¤òÃΤ뤳¤È¤¬¤Ç¤­¤ëÎɽñ¤Ç¤¹¡£
+ Âè6ÈǤǤϡ¢Vim ¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤â´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
+
+ ¤³¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤Ï Colorado State University ¤Î Charles Smith ¤Î¥¢¥¤¥Ç¥¢
+ ¤ò´ð¤Ë¡¢Colorado School of Mines ¤Î Michael C. Pierce ¤È Robert K. Ware ¤Î
+ ξ̾¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤Þ¤·¤¿¡£ E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+ ÆüËܸìÌõ ¾¾ËÜÂÙ¹° E-mail:mattn@mail.goo.ne.jp
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ vi:set ts=8 sts=4 sw=4 tw=76:
diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis
new file mode 100644
index 000000000..3bc8a4c4a
--- /dev/null
+++ b/runtime/tutor/tutor.ja.sjis
@@ -0,0 +1,811 @@
+===============================================================================
+= V I M ‹³ –{ (ƒ`ƒ…[ƒgƒŠƒAƒ‹) ‚Ö ‚æ ‚¤ ‚± ‚» - Version 1.5 =
+===============================================================================
+
+ Vim ‚ÍA‚±‚̃`ƒ…[ƒgƒŠƒAƒ‹‚Åà–¾‚·‚é‚É‚Í‘½‚·‚¬‚é’ö‚̃Rƒ}ƒ“ƒh‚ð”õ‚¦‚½
+ ”ñí‚É‹­—͂ȃGƒfƒBƒ^[‚Å‚·B‚±‚̃`ƒ…[ƒgƒŠƒAƒ‹‚ÍA‚ ‚È‚½‚ª Vim
+ ‚𖜔\ƒGƒfƒBƒ^[‚Æ‚µ‚ÄŽg‚¢‚±‚È‚¹‚é‚悤‚É‚È‚é‚Ì‚É\•ª‚ȃRƒ}ƒ“ƒh‚ɂ‚¢‚Ä
+ à–¾‚ð‚·‚é‚悤‚È‚Á‚Ä‚¢‚Ü‚·B
+
+ ƒ`ƒ…[ƒgƒŠƒAƒ‹‚ðŠ®—¹‚·‚é‚Ì‚É•K—v‚ÈŽžŠÔ‚ÍAŠo‚¦‚½ƒRƒ}ƒ“ƒh‚ðŽŽ‚·‚Ì‚É‚Ç‚ê
+ ‚¾‚¯ŽžŠÔ‚ðŽg‚¤‚Ì‚©‚É‚à‚æ‚è‚Ü‚·‚ªA‚¨‚æ‚»25`30•ª‚Å‚·B
+
+ Šw‚ÔƒRƒ}ƒ“ƒh‚É‚Í‚±‚Ì•¶Í‚ð•ÏX‚·‚é‚à‚Ì‚à‚ ‚è‚Ü‚·B—ûK‚ðŽn‚ß‚é‘O‚ɃR
+ ƒs[‚ð쬂µ‚Ü‚µ‚傤("vimtutor"‚µ‚½‚È‚ç‚ÎAŠù‚ɃRƒs[‚³‚ê‚Ä‚¢‚Ü‚·)B
+
+ ‚±‚̃`ƒ…[ƒgƒŠƒAƒ‹‚ªAŽg‚¤‚±‚Æ‚ÅŠo‚¦‚ç‚ê‚éŽd‘g‚Ý‚É‚È‚Á‚Ä‚¢‚邱‚Æ‚ðAS
+ ‚µ‚Ä‚¨‚©‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB³‚µ‚­ŠwK‚·‚é‚ɂ̓Rƒ}ƒ“ƒh‚ðŽÀÛ‚ÉŽŽ‚³‚È‚¯
+ ‚ê‚΂Ȃç‚È‚¢‚Ì‚Å‚·B•¶Í‚ð“Ç‚ñ‚¾‚¾‚¯‚È‚ç‚ÎA‚«‚Á‚Æ–Y‚ê‚Ä‚µ‚Ü‚¢‚Ü‚·!B
+
+ ‚³‚ŸACapsƒƒbƒN(Shift-Lock)ƒL[‚ª‰Ÿ‚³‚ê‚Ä‚¢‚È‚¢‚±‚Æ‚ðŠm”F‚µ‚½ŒãA
+ ‰æ–ʂɃŒƒbƒXƒ“1.1 ‚ª‘S•”•\Ž¦‚³‚ê‚é‚Æ‚±‚ë‚Ü‚ÅAj ƒL[‚ð‰Ÿ‚µ‚ăJ[ƒ\ƒ‹‚ð
+ ˆÚ“®‚µ‚Ü‚µ‚傤B
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 1.1: ƒJ[ƒ\ƒ‹‚̈ړ®
+
+
+ ** ƒJ[ƒ\ƒ‹‚ðˆÚ“®‚·‚é‚É‚ÍAŽ¦‚³‚ê‚é—l‚É h,j,k,l ‚ð‰Ÿ‚µ‚Ü‚· **
+ ^
+ k ƒqƒ“ƒg: h ƒL[‚Ͷ•ûŒü‚Ɉړ®‚µ‚Ü‚·B
+ < h l > l ƒL[‚͉E•ûŒü‚Ɉړ®‚µ‚Ü‚·B
+ j j ƒL[‚͉º–îˆóƒL[‚̂悤‚ȃL[‚Å‚·B
+ v
+ 1. ˆÚ“®‚ÉŠµ‚ê‚é‚Ü‚ÅAƒXƒNƒŠ[ƒ“‚ŃJ[ƒ\ƒ‹ˆÚ“®‚³‚¹‚Ü‚µ‚傤B
+
+ 2. ‰º‚ւ̃L[(j)‚ð‰Ÿ‚µ‚‚¯‚é‚ÆA˜A‘±‚µ‚Ĉړ®‚Å‚«‚Ü‚·B
+---> ‚±‚ê‚ÅŽŸ‚̃ŒƒbƒXƒ“‚Ɉړ®‚·‚é•û–@‚ª‚í‚©‚è‚Ü‚µ‚½‚ËB
+
+ 3. ‰º‚ւ̃L[‚ðŽg‚Á‚ÄAƒŒƒbƒXƒ“1.2 ‚Ɉړ®‚µ‚Ü‚µ‚傤B
+
+NOTE: ‰½‚ðƒ^ƒCƒv‚µ‚Ä‚¢‚é‚©”»‚ç‚È‚­‚È‚Á‚½‚çA<ESC>‚ð‰Ÿ‚µ‚ăm[ƒ}ƒ‹ƒ‚[ƒh‚É‚µ‚Ü
+ ‚·B‚»‚ê‚©‚ç“ü—Í‚µ‚悤‚Æ‚µ‚Ä‚¢‚½ƒRƒ}ƒ“ƒh‚ðÄ“ü—Í‚µ‚Ü‚µ‚傤B
+
+NOTE: ƒJ[ƒ\ƒ‹ƒL[‚Å‚àˆÚ“®‚Å‚«‚Ü‚·B‚µ‚©‚µ hjkl ‚ðŽg—p‚·‚邱‚ƂɈê“xŠµ‚ê‚Ä‚µ‚Ü
+ ‚¦‚ÎA‚Í‚é‚©‚É‘¬‚­ˆÚ“®‚·‚邱‚Æ‚ª‚Å‚«‚é‚Å‚µ‚傤B
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 1.2: VIM ‚Ì‹N“®‚ÆI—¹
+
+
+ !! NOTE: ˆÈ‰º‚Ì‚ ‚ç‚ä‚éƒXƒeƒbƒv‚ðs‚¤‘O‚ÉA‚±‚̃ŒƒbƒXƒ“‚ð“Ç‚Ý‚Ü‚µ‚傤!!
+
+ 1. <ESC>ƒL[‚ð‰Ÿ‚µ‚Ü‚µ‚傤B(ŠmŽÀ‚Ƀm[ƒ}ƒ‹ƒ‚[ƒh‚É‚·‚邽‚ß)
+
+ 2. ŽŸ‚̂悤‚Ƀ^ƒCƒv: :q! <ENTER>
+
+---> ‚±‚ê‚É‚æ‚è•ÒW‚µ‚½“à—e‚ð•Û‘¶‚¹‚¸‚ɃGƒfƒBƒ^‚ªI—¹‚µ‚Ü‚·B
+ •ÒW“à—e‚ð•Û‘¶‚µ‚ÄI—¹‚·‚é‚Æ‚«‚ÍŽŸ‚̂悤‚Ƀ^ƒCƒv‚µ‚Ü‚·:
+ :wq <ENTER>
+
+ 3. ƒVƒFƒ‹ƒvƒƒ“ƒvƒg‚©‚çƒ`ƒ…[ƒgƒŠƒAƒ‹‚ðŽn‚ß‚é‚ɂ̓Rƒ}ƒ“ƒh‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+ ‚»‚̃Rƒ}ƒ“ƒh‚Í: vimtutor <ENTER>
+ ’Êí‚Í‚±‚¤‚Å‚µ‚傤: vim tutor <ENTER>
+
+---> 'vim' ‚Í Vim ƒGƒfƒBƒ^‚Ì‹N“®‚ðA'tutor' ‚Í•ÒW‚µ‚½‚¢ƒtƒ@ƒCƒ‹‚ðˆÓ–¡‚µ‚Ü‚·B
+
+ 4. ‚±‚ê‚܂ł̃Xƒeƒbƒv‚ðŠo‚¦Ž©M‚ª‚‚¢‚½‚È‚ç‚ÎAƒXƒeƒbƒv 1 ‚©‚ç 3 ‚Ü‚Å‚ðŽÀ
+ Û‚ÉŽŽ‚µ‚ÄAVim ‚ð1“xI—¹‚µ‚Ä‚©‚çÄ‚Ñ‹N“®‚µ‚Ü‚µ‚傤B‚»‚ê‚©‚烌ƒbƒXƒ“
+ 1.3‚܂ŃJ[ƒ\ƒ‹‚ðˆÚ“®‚³‚¹‚Ü‚µ‚傤B
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 1.3: ƒeƒLƒXƒg•ÒW - íœ
+
+
+ ** ƒm[ƒ}ƒ‹ƒ‚[ƒh‚ɂăJ[ƒ\ƒ‹‚̉º‚Ì•¶Žš‚ð휂·‚é‚É‚Í x ‚ð‰Ÿ‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. ŠÔˆá‚¢‚ðC³‚·‚邽‚ß‚ÉA휂·‚éʼn‚Ì•¶Žš‚܂ŃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚·B
+
+ 3. •s•K—v‚È•¶Žš‚ð x ‚ð‰Ÿ‚µ‚Ä휂µ‚Ü‚µ‚傤B
+
+ 4. •¶‚ª³‚µ‚­‚È‚é‚Ü‚Å ƒXƒeƒbƒv 2 ‚©‚ç 4 ‚ðŒJ‚è•Ô‚µ‚Ü‚µ‚傤B
+
+---> ‚»‚Ì ‚¤‚¤‚³‚¬ ‚Í ‚‚‚«‚« ‚ð ‚±‚¦‚¦‚Ä‚Ä ‚Æ‚Ñ‚Í‚Ë‚½‚½
+
+ 5. s‚ª³‚µ‚­‚È‚Á‚½‚çAƒŒƒbƒXƒ“ 1.4 ‚Ɉڂè‚Ü‚µ‚傤B
+
+NOTE: ‘S‚ẴŒƒbƒXƒ“‚ð’Ê‚¶‚ÄAŠo‚¦‚悤‚Æ‚·‚é‚Ì‚Å‚Í‚È‚­ŽÀÛ‚É‚â‚Á‚Ä‚Ý‚Ü‚µ‚傤B
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 1.4: ƒeƒLƒXƒg•ÒW - ‘}“ü
+
+
+ ** ƒm[ƒ}ƒ‹ƒ‚[ƒh‚ɂăeƒLƒXƒg‚ð‘}“ü‚·‚é‚É‚Í i ‚ð‰Ÿ‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽʼn‚Ìs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. 1s–Ú‚ð2s–Ú‚Æ“¯‚¶—l‚É‚·‚邽‚ß‚ÉAƒeƒLƒXƒg‚ð‘}“ü‚µ‚È‚¯‚ê‚΂Ȃç‚È‚¢ˆÊ
+ ’u‚ÌŽŸ‚Ì•¶Žš‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚·B
+
+ 3. i ƒL[‚ð‰Ÿ‚µ‚Ä‚©‚çA’ljÁ‚ª•K—v‚È•¶Žš‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ 4. ŠÔˆá‚¢‚ðC³‚µ‚½‚ç <ESC> ‚ð‰Ÿ‚µ‚ăRƒ}ƒ“ƒhƒ‚[ƒh‚É–ß‚èA³‚µ‚¢•¶‚É
+ ‚È‚é—l‚ɃXƒeƒbƒv 2 ‚©‚ç 4 ‚ðŒJ‚è•Ô‚µ‚Ü‚µ‚傤B
+
+---> ‚±‚Ì ‚É‚Í ‘«‚è‚È‚¢ ƒeƒLƒXƒg ‚ ‚éB
+---> ‚±‚Ì s ‚É‚Í Šô‚‚© ‘«‚è‚È‚¢ ƒeƒLƒXƒg ‚ª ‚ ‚éB
+
+ 5. ‘}“ü‚Ì•û–@‚ª‚í‚©‚Á‚½‚牺‚̃ŒƒbƒXƒ“1‚Ì—v–ñ‚ðŒ©‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 1 —v–ñ
+
+
+ 1. ƒJ[ƒ\ƒ‹‚Í–îˆóƒL[‚à‚µ‚­‚Í hjkl ƒL[‚ňړ®‚µ‚Ü‚·B
+ h (¶) j (‰º) k (ã) l (‰E)
+
+ 2. Vim ‚ð‹N“®‚·‚é‚ɂ̓vƒƒ“ƒvƒg‚©‚ç vim ƒtƒ@ƒCƒ‹–¼ <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ 3. Vim ‚ðI—¹‚·‚é‚É‚Í <ESC> :q! <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚·(•ÏX‚ð”jŠü)B
+ ‚à‚µ‚­‚Í <ESC> :wq <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚·(•ÏX‚ð•Û‘¶)B
+
+ 4. ƒJ[ƒ\ƒ‹‚̉º‚Ì•¶Žš‚ð휂·‚é‚É‚ÍAƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å x ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ 5. ƒJ[ƒ\ƒ‹‚̈ʒu‚É•¶Žš‚ð‘}“ü‚·‚é‚É‚ÍAƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å i ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+ i ƒeƒLƒXƒg‚̃^ƒCƒv <ESC>
+
+NOTE: <ESC> ƒL[‚ð‰Ÿ‚·‚ƃm[ƒ}ƒ‹ƒ‚[ƒh‚ɈÚs‚µ‚Ü‚·B‚»‚ÌÛAŠÔˆá‚Á‚½‚è“ü—Í“r’†
+ ‚̃Rƒ}ƒ“ƒh‚ðŽæ‚èÁ‚·‚±‚Æ‚ª‚Å‚«‚Ü‚·B
+
+‚³‚ÄA‘±‚¯‚ăŒƒbƒXƒ“ 2 ‚ðŽn‚ß‚Ü‚µ‚傤B
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 2.1: 휃Rƒ}ƒ“ƒh
+
+
+ ** ’PŒê‚Ì––”ö‚Ü‚Å‚ð휂·‚é‚É‚Í dw ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤 **
+
+ 1. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å‚ ‚邱‚Æ‚ðŠm”F‚·‚邽‚ß‚É <ESC> ‚ð‰Ÿ‚µ‚Ü‚µ‚傤B
+
+ 2. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 3. Á‚µ‚½‚¢’PŒê‚Ì擪‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 4. ’PŒê‚ð휂·‚邽‚ß‚É dw ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ NOTE: ƒ^ƒCƒv‚·‚é‚ÆAdw ‚Æ‚¢‚¤•¶Žš‚ªƒXƒNƒŠ[ƒ“‚Ìʼnºs‚ÉŒ»‚í‚ê‚Ü‚·B
+ ƒ^ƒCƒv‚ðŠÔˆá‚Á‚Ä‚µ‚Ü‚Á‚½Žž‚É‚Í <ESC> ‚ð‰Ÿ‚µ‚Ä‚â‚è’¼‚µ‚Ü‚µ‚傤B
+
+---> ‚±‚Ì •¶ Ž† ‚É‚Í ‚¢‚­‚‚©‚Ì ‚½‚Ì‚µ‚¢ •K—v‚Ì‚È‚¢ ’PŒê ‚ª ŠÜ‚Ü‚ê‚Ä ‚¢‚Ü‚·B
+
+ 5. 3 ‚©‚ç 4 ‚܂ł𕶂ª³‚µ‚­‚È‚é‚Ü‚ÅŒJ‚è•Ô‚µAƒŒƒbƒXƒ“ 2.2 ‚Ɉڂè‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 2.2: ‚»‚Ì‘¼‚Ì휃Rƒ}ƒ“ƒh
+
+
+ ** s‚Ì––”ö‚Ü‚Å‚ð휂·‚é‚É‚Í d$ ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤 **
+
+ 1. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å‚ ‚邱‚Æ‚ðŠm”F‚·‚é‚Ì‚É <ESC> ‚ð‰Ÿ‚µ‚Ü‚µ‚傤B
+
+ 2. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 3. ³‚µ‚¢•¶‚Ì––”ö‚ÖƒJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤(ʼn‚Ì . ‚ÌŒã‚Å‚·)B
+
+ 4. s––‚Ü‚Å휂·‚é‚Ì‚É d$ ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+---> ’N‚©‚ª‚±‚Ìs‚ÌÅŒã‚ð2“xƒ^ƒCƒv‚µ‚Ü‚µ‚½B 2“xƒ^ƒCƒv‚µ‚Ü‚µ‚½B
+
+
+ 5. ‚Ç‚¤‚¢‚¤‚±‚Æ‚©—‰ð‚·‚邽‚ß‚ÉAƒŒƒbƒXƒ“ 2.3 ‚ÖˆÚ‚è‚Ü‚µ‚傤B
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: ƒRƒ}ƒ“ƒh‚Æ–Ú“IŒê
+
+
+ 휃Rƒ}ƒ“ƒh d ‚ÌŒ`Ž®‚ÍŽŸ‚Ì—l‚É‚È‚Á‚Ä‚¢‚Ü‚·:
+
+ [‰ñ”] d –Ú“IŒê ‚à‚µ‚­‚Í d [‰ñ”] –Ú“IŒê
+ ‚»‚ꂼ‚ê:
+ ‰ñ” - ‚»‚̃Rƒ}ƒ“ƒh‚ð‰½‰ñŒJ‚è•Ô‚·‚©(È—ª‰Â”\, È—ª‚µ‚½Žž‚Í =1)B
+ d - 휃Rƒ}ƒ“ƒhB
+ –Ú“IŒê - ‰½‚ɑ΂µ‚Ä“­‚«‚©‚¯‚é‚©(ˆÈ‰º‚É‹“‚°‚Ü‚·)B
+
+ –Ú“IŒêˆê——:
+ w - ƒJ[ƒ\ƒ‹ˆÊ’u‚©‚ç‹ó”’‚ðŠÜ‚Þ’PŒê‚Ì––”ö‚Ü‚ÅB
+ e - ƒJ[ƒ\ƒ‹ˆÊ’u‚©‚ç‹ó”’‚ðŠÜ‚Ü‚È‚¢’PŒê‚Ì––”ö‚Ü‚ÅB
+ $ - ƒJ[ƒ\ƒ‹ˆÊ’u‚©‚çs––‚Ü‚ÅB
+
+NOTE: –`Œ¯‚µ‚½‚¢l‚ÍAƒm[ƒ}ƒ‹ƒ‚[ƒh‚ɂăRƒ}ƒ“ƒh‚È‚µ‚É–Ú“IŒê‚ð‰Ÿ‚µ‚Ä
+ ‚Ý‚Ü‚µ‚傤BƒJ[ƒ\ƒ‹‚ª–Ú“IŒêˆê——‚ÅŽ¦‚³‚ê‚éˆÊ’u‚Ɉړ®‚·‚é‚Í‚¸‚Å‚·B
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 2.4: ‚»‚êˆÈŠO‚ÌŒ`‚̃Rƒ}ƒ“ƒh
+
+
+ ** s‘S‘Ì‚ð휂·‚é‚É‚Í dd ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤 **
+
+ s‘S‘Ì‚Ì휂͕p”É‚És‚È‚¤ì‹Æ‚È‚Ì‚ÅAVim ‚ÌÝŒvŽÒ‚Ís‚ð휂·‚é‚Ì‚É‚ÍA
+ ’P‚É—ñ“à‚É‚Ä2‰ñ d ‚ðƒ^ƒCƒv‚·‚é•û‚ªŠÈ’P‚¾‚낤‚Æ”»’f‚µ‚Ü‚µ‚½B
+
+ 1. ‰º‚É‚ ‚éˆê˜A‚̃tƒŒ[ƒY‚Ì2s–ڂɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+ 2. dd ‚ƃ^ƒCƒv‚µ‚Äs‚ð휂µ‚Ü‚µ‚傤B
+ 3. ‚Å‚Í4s–ڂɈړ®‚µ‚Ä‚Ý‚Ü‚µ‚傤B
+ 4. 2dd ‚ƃ^ƒCƒv‚µ‚Ä2s휂µ‚Ä‚Ý‚Ü‚µ‚傤B
+ (‰ñ”-ƒRƒ}ƒ“ƒh-–Ú“IŒê ‚ÌŒ`Ž®‚ðŽv‚¢o‚µ‚Ü‚µ‚傤)
+
+ 1) ƒoƒ‰‚ÍÔ‚¢A
+ 2) ‚‚܂ç‚È‚¢‚à‚Ì‚ÍŠy‚µ‚¢A
+ 3) ƒXƒ~ƒŒ‚Í‚¢A
+ 4) Ž„‚ÍŽÔ‚ð‚à‚Á‚Ä‚¢‚éA
+ 5) ŽžŒv‚ªŽž‚ð‚°‚éA
+ 6) »“œ‚͊¢
+ 7) ƒIƒ}ƒGƒ‚ƒi[
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 2.5: ‚â‚è’¼‚µƒRƒ}ƒ“ƒh
+
+
+ ** ÅŒã‚̃Rƒ}ƒ“ƒh‚ðŽæ‚èÁ‚·‚É‚Í u ‚ð‰Ÿ‚µ‚Ü‚·BU ‚Ís‘S‘Ì‚ÌŽæÁ‚Å‚·B **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µAʼn‚̊ԈႢ‚ɃJ[ƒ\ƒ‹
+ ‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+ 2. x ‚ðƒ^ƒCƒv‚µ‚Ä‚¢‚ç‚È‚¢æ“ª‚Ì•¶Žš‚ð휂µ‚Ü‚µ‚傤B
+ 3. ‚³‚ŸAu ‚ðƒ^ƒCƒv‚µ‚ÄÅŒã‚ÉŽÀs‚µ‚½ƒRƒ}ƒ“ƒh‚ðŽæ‚èÁ‚µ‚Ü‚µ‚傤B
+ 4. ¡“x‚ÍAx ‚ðŽg—p‚µ‚ÄŒë‚è‚ð‘S‚ÄC³‚µ‚Ü‚µ‚傤B
+ 5. ‘啶Žš‚Ì U ‚ðƒ^ƒCƒv‚µ‚ÄAs‚ðŒ³‚Ìó‘Ô‚É–ß‚µ‚Ü‚µ‚傤B
+ 6. u ‚ðƒ^ƒCƒv‚µ‚Ä’¼‘O‚Ì U ƒRƒ}ƒ“ƒh‚ðŽæÁ‚µ‚Ü‚µ‚傤B
+ 7. ‚ł̓Rƒ}ƒ“ƒh‚ðÄŽÀs‚·‚é‚Ì‚É CTRL-R (CTRL ‚ð‰Ÿ‚µ‚½‚Ü‚Ü R ‚ð‘Å‚Â)‚ð
+ ”‰ñƒ^ƒCƒv‚µ‚Ä‚Ý‚Ü‚µ‚傤(ŽæÁ‚ÌŽæÁ)B
+
+---> ‚±‚Ì‚Ìs‚̂̊ԈႢ‚ðC³X‚µAŒã‚Å‚»‚ê‚ç‚ÌC³‚ð‚ðŽæÁ‚µ‚Ü‚Ü‚·‚·B
+
+ 8. ‚±‚ê‚Í‚Æ‚Ä‚à•Ö—˜‚ȃRƒ}ƒ“ƒh‚Å‚·B‚³‚ŸƒŒƒbƒXƒ“ 2 —v–ñ‚Ɉڂè‚Ü‚µ‚傤B
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 2 —v–ñ
+
+
+ 1. ƒJ[ƒ\ƒ‹ˆÊ’u‚©‚ç’PŒê‚Ì––”ö‚Ü‚Å‚ð휂·‚é‚É‚Í dw ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ 2. ƒJ[ƒ\ƒ‹ˆÊ’u‚©‚çs‚Ì––”ö‚Ü‚Å‚ð휂·‚é‚É‚Í d$ ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ 3. s‘S‘Ì‚ð휂·‚é‚É‚Í dd ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ 4. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚ł̃Rƒ}ƒ“ƒhŒ`Ž®‚Í
+
+ [‰ñ”] ƒRƒ}ƒ“ƒh –Ú“IŒê ‚à‚µ‚­‚Í ƒRƒ}ƒ“ƒh [‰ñ”] –Ú“IŒê
+ ‚»‚ꂼ‚ê:
+ ‰ñ” - ‚»‚̃Rƒ}ƒ“ƒh‚ð‰½‰ñŒJ‚è•Ô‚·‚©B
+ ƒRƒ}ƒ“ƒh - íœ d ‚̗ނʼn½‚ð‚·‚é‚©B
+ –Ú“IŒê - ’PŒê w ‚âs–– $ ‚Ȃǂ̗ނʼn½‚ɑ΂µ‚Ä“­‚«‚©‚¯‚é‚©B
+
+ 5. ‘O‰ñ‚Ì“®ì‚ðŽæÁ‚·: u (¬•¶Žš u)
+ s‘S‘Ì‚Ì•ÏX‚ðŽæÁ‚·: U (‘啶Žš U)
+ ŽæÁ‚µ‚ÌŽæÁ‚µ: CTRL-R
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 3.1: “\‚è•t‚¯ƒRƒ}ƒ“ƒh
+
+
+ ** ÅŒã‚É휂³‚ꂽs‚ðƒJ[ƒ\ƒ‹‚ÌŒã‚É“\‚è•t‚¯‚é‚É‚Í p ‚ðƒ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì’i—Ž‚Ìʼn‚Ìs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. dd ‚ƃ^ƒCƒv‚µ‚Äs‚ð휂µAVim ‚̃oƒbƒtƒ@‚ÉŠi”[‚µ‚Ü‚µ‚傤B
+
+ 3. 휂µ‚½s‚ª–{—ˆ‚ ‚é‚ׂ«ˆÊ’u‚Ìã‚Ìs‚Ü‚ÅAƒJ[ƒ\ƒ‹‚ðˆÚ“®‚³‚¹‚Ü‚µ‚傤B
+
+ 4. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å p ‚ðƒ^ƒCƒv‚µ‚ÄŠi”[‚µ‚½s‚ð‰æ–Ê‚É–ß‚µ‚Ü‚·B
+
+ 5. ‡”Ô‚ª³‚µ‚­‚È‚é—l‚ɃXƒeƒbƒv 2 ‚©‚ç 4 ‚ðŒJ‚è•Ô‚µ‚Ü‚µ‚傤B
+
+ d) ‹M•û‚àŠw‚Ô‚±‚Æ‚ª‚Å‚«‚é?
+ b) ƒXƒ~ƒŒ‚Í‚¢A
+ c) ’mŒb‚Æ‚ÍŠw‚Ô‚à‚ÌA
+ a) ƒoƒ‰‚ÍÔ‚¢A
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 3.2: ’u‚«Š·‚¦ƒRƒ}ƒ“ƒh
+
+
+ ** ƒJ[ƒ\ƒ‹‚̉º‚Ì•¶Žš‚ð’u‚«Š·‚¦‚é‚É‚Í r ‚ðƒ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽʼn‚Ìs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. ʼn‚̊ԈႢ‚Ì擪‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 3. r ‚ƃ^ƒCƒv‚µAŠÔˆá‚Á‚Ä‚¢‚镶Žš‚ð’u‚«Š·‚¦‚éA³‚µ‚¢•¶Žš‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ 4. ʼn‚Ìs‚ª³‚µ‚­‚È‚é‚܂ŃXƒeƒbƒv 2 ‚©‚ç 3 ‚ðŒJ‚è•Ô‚µ‚Ü‚µ‚傤B
+
+---> ‚±‚̇‚ðl—Í‚µ‚½Žž‚ËA‚»‚Ìl‚ÍŠô‚‚©–âˆá‚Á‚½ƒL[‚ð‰Ÿ‚µ‚à‚µ‚½!
+---> ‚±‚Ìs‚ð“ü—Í‚µ‚½Žž‚ÉA‚»‚Ìl‚ÍŠô‚‚©ŠÔˆá‚Á‚½ƒL[‚ð‰Ÿ‚µ‚Ü‚µ‚½!
+
+ 5. ‚³‚ŸAƒŒƒbƒXƒ“ 3.2 ‚Ɉڂè‚Ü‚µ‚傤B
+
+NOTE: ŽÀÛ‚ÉŽŽ‚µ‚Ü‚µ‚傤BŒˆ‚µ‚ÄŠo‚¦‚邾‚¯‚É‚Í‚µ‚È‚¢‚±‚ÆB
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 3.3: •ÏXƒRƒ}ƒ“ƒh
+
+
+ ** ’PŒê‚̈ꕔA‚à‚µ‚­‚Í‘S‘Ì‚ð•ÏX‚·‚é‚É‚Í cw ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽʼn‚Ìs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. lubw ‚Ì u ‚̈ʒu‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 3. cw ‚ƃ^ƒCƒv‚µA³‚µ‚¢’PŒê‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤(‚±‚Ìê‡ 'ine' ‚ƃ^ƒCƒv)B
+
+ 4. ŽŸ‚̊ԈႢ(•ÏX‚·‚ׂ«•¶Žš‚Ì擪)‚Ɉړ®‚·‚邽‚ß‚É <ESC> ‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+
+ 5. ʼn‚Ìs‚ªŽŸ‚Ìs‚Ì—l‚É‚È‚é‚܂ŃXƒeƒbƒv 3 ‚Æ 4 ‚ðŒJ‚è•Ô‚µ‚Ü‚·B
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+cw ‚Í’PŒê‚ð•ÏX‚·‚邾‚¯‚Å‚È‚­A‘}“ü‚às‚¦‚邱‚Æ‚É’ˆÓ‚µ‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 3.4: c ‚ðŽg—p‚µ‚½‚»‚Ì‘¼‚Ì•ÏX
+
+
+ ** •ÏXƒRƒ}ƒ“ƒh‚ÍA휃Rƒ}ƒ“ƒh‚Æ“¯‚¶—l‚ɃIƒuƒWƒFƒNƒg‚ðŽg—p‚µ‚Ü‚· **
+
+
+ 1. •ÏXƒRƒ}ƒ“ƒh‚ÍA휃Rƒ}ƒ“ƒh‚Æ“¯‚¶‚悤‚È“®ì‚ð‚µ‚Ü‚·B‚»‚ÌŒ`Ž®‚Í
+
+ [‰ñ”] c –Ú“IŒê ‚à‚µ‚­‚Í c [‰ñ”] –Ú“IŒê
+
+ 2. ƒIƒuƒWƒFƒNƒg‚à“¯‚¶‚ÅAw ‚Í’PŒêA $ ‚Ís––‚È‚Ç‚Æ‚¢‚Á‚½‚à‚Ì‚Å‚·B
+
+ 3. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 4. ʼn‚̊ԈႢ‚ÖƒJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 5. c$ ‚ƃ^ƒCƒv‚µ‚Äs‚ÌŽc‚è‚ð‚Qs–Ú‚Ì—l‚É‚µA<ESC> ‚ð‰Ÿ‚µ‚Ü‚µ‚傤B
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 3 —v–ñ
+
+
+ 1. Šù‚É휂³‚ꂽƒeƒLƒXƒg‚ðÄ”z’u‚·‚é‚É‚ÍAp ‚ðƒ^ƒCƒv‚µ‚Ü‚·B‚±‚ê‚Í휂³
+ ‚ꂽƒeƒLƒXƒg‚ðƒJ[ƒ\ƒ‹‚ÌŒã‚É‘}“ü‚µ‚Ü‚·(s’PˆÊ‚Å휂³‚ꂽ‚Ì‚È‚ç‚ÎAƒJ[
+ ƒ\ƒ‹‚Ì‚ ‚鎟‚Ìs‚É‘}“ü‚³‚ê‚Ü‚·)B
+
+ 2. ƒJ[ƒ\ƒ‹‚̉º‚Ì•¶Žš‚ð’u‚«Š·‚¦‚é‚É‚ÍAr ‚ðƒ^ƒCƒv‚µ‚½ŒãA‚»‚ê‚ð’u‚«Š·‚¦‚é
+ •¶Žš‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+
+ 3. •ÏXƒRƒ}ƒ“ƒh‚ł̓J[ƒ\ƒ‹ˆÊ’u‚©‚ç“Á’è‚Ì–Ú“IŒê‚ÅŽw’肳‚ê‚éI’[‚Ü‚Å‚ð•ÏX
+ ‚·‚邱‚Æ‚ª‰Â”\‚Å‚·B—Ⴆ‚Î cw ‚È‚ç‚΃J[ƒ\ƒ‹ˆÊ’u‚©‚ç’PŒê‚ÌI‚í‚è‚Ü‚ÅA
+ c$ ‚È‚ç‚Îs‚ÌI‚í‚è‚Ü‚Å‚ð•ÏX‚µ‚Ü‚·B
+
+ 4. •ÏXƒRƒ}ƒ“ƒh‚ÌŒ`Ž®‚Í
+
+ [‰ñ”] c –Ú“IŒê ‚à‚µ‚­‚Í c [‰ñ”] –Ú“IŒê
+
+‚³‚ŸAŽŸ‚̃ŒƒbƒXƒ“‚Ɉڂè‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 4.1: ˆÊ’u‚ƃtƒ@ƒCƒ‹‚Ìî•ñ
+
+
+ ** ƒtƒ@ƒCƒ‹“à‚ł̈ʒu‚ƃtƒ@ƒCƒ‹‚Ìó‘Ô‚ð•\Ž¦‚·‚é‚É‚Í CTRL-g ‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+ ƒtƒ@ƒCƒ‹“à‚Ì‚ ‚és‚Ɉړ®‚·‚é‚É‚Í SHIFT-G ‚ðƒ^ƒCƒv‚µ‚Ü‚· **
+
+ NOTE: ƒXƒeƒbƒv‚ðŽÀs‚·‚é‘O‚ÉA‚±‚̃ŒƒbƒXƒ“‘S‚Ä‚É–Ú‚ð’Ê‚µ‚Ü‚µ‚傤!!
+
+ 1. CTRL ‚ð‰Ÿ‚µ‚½‚Ü‚Ü g ‚ð‰Ÿ‚µ‚Ü‚µ‚傤Bƒy[ƒW‚̈ê”Ô‰º‚É‚ ‚éƒXƒe[ƒ^ƒXs
+ ‚Ƀtƒ@ƒCƒ‹–¼‚Æs‚ª•\Ž¦‚³‚ê‚é‚Í‚¸‚Å‚·B ƒXƒeƒbƒv 3 ‚Ì‚½‚ß‚És”Ô†‚ð
+ Šo‚¦‚Ä‚¨‚«‚Ü‚µ‚傤B(–óŽÒ’:ƒ‹[ƒ‰[‚ª‚ ‚éꇂ͂»‚¿‚ç‚É’–Ú)
+
+ 2. ʼnºs‚Ɉړ®‚·‚邽‚ß‚É shift-G ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ 3. æ‚Ù‚Ç‚Ìs‚̔Ԇ‚ðƒ^ƒCƒv‚µA shift-G ‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+ ʼn‚É Ctrl-g ‚ð‰Ÿ‚µ‚½s‚É–ß‚Á‚Ä—ˆ‚é‚Í‚¸‚Å‚·B
+ (”Žš‚ðƒ^ƒCƒv‚µ‚Ä‚¢‚é‚Æ‚«‚ɂ͉æ–Ê‚É•\Ž¦‚³‚ê‚Ü‚¹‚ñ)
+
+ 4. Ž©M‚ªŽ‚Ä‚½‚çƒXƒeƒbƒv 1 ‚©‚ç 3 ‚ðŽÀs‚µ‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 4.2: ŒŸõƒRƒ}ƒ“ƒh
+
+
+ ** Œê‹å‚ðŒŸõ‚·‚é‚É‚Í / ‚ÆA‘O•ûŒŸõ‚·‚éŒê‹å‚ðƒ^ƒCƒv‚µ‚Ü‚·B**
+
+ 1. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚Å / ‚Æ‚¢‚¤•¶Žš‚ðƒ^ƒCƒv‚µ‚Ü‚·B‰æ–ʈê”Ô‰º‚É : ƒRƒ}ƒ“ƒh
+ ‚Æ“¯‚¶—l‚É / ‚ªŒ»‚ê‚邱‚Æ‚É‹C‚­‚Å‚µ‚傤B
+
+ 2. ‚Å‚ÍA'errroor' <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B‚±‚ꂪŒŸõ‚µ‚½‚¢’PŒê‚Å‚·B
+
+ 3. “¯‚¶Œê‚ð‚à‚¤ˆê“xŒŸõ‚·‚é‚Æ‚«‚Í ’P‚É n ‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+ ‹t•ûŒü‚ÉŒê‹å‚ðŒŸõ‚·‚é‚Æ‚«‚Í N ‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+
+ 4. ‹t•ûŒü‚ÉŒê‹å‚ðŒŸõ‚µ‚½‚¢ê‡‚ÍA/ ƒRƒ}ƒ“ƒh‚Ì‚©‚í‚è‚É ? ƒRƒ}ƒ“ƒh‚ðŽg—p‚µ
+ ‚Ü‚·B
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+ŒŸõ‚ªƒtƒ@ƒCƒ‹‚ÌI‚í‚è‚É’B‚·‚é‚ÆAƒtƒ@ƒCƒ‹‚Ì擪‚©‚猟õ‚ð‘±s‚µ‚Ü‚·B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 4.3: ‘Ήž‚·‚銇ŒÊ‚ðŒŸõ
+
+
+ ** ‘Ήž‚·‚é ),] ‚â } ‚ðŒŸõ‚·‚é‚É‚Í % ‚ðƒ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚Å (,[ ‚© { ‚Ì‚Ç‚ê‚©‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®
+ ‚µ‚Ü‚µ‚傤B
+
+ 2. ‚»‚±‚Å % ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ 3. ƒJ[ƒ\ƒ‹‚͑Ήž‚·‚銇ŒÊ‚Ɉړ®‚·‚é‚Í‚¸‚Å‚·B
+
+ 4. ʼn‚ÌŠ‡ŒÊ‚Ɉړ®‚·‚é‚É‚Í % ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+NOTE: ‚±‚Ì‹@”\‚ÍŠ‡ŒÊ‚ªˆê’v‚µ‚Ä‚¢‚È‚¢ƒvƒƒOƒ‰ƒ€‚ðƒfƒoƒbƒO‚·‚é‚Ì‚É‚Æ‚Ä‚à–𗧂¿
+ ‚Ü‚·B
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 4.4: ŠÔˆá‚¢‚ð•ÏX‚·‚é•û–@
+
+
+ ** 'old' ‚ð 'new' ‚É’uŠ·‚·‚é‚É‚Í :s/old/new/g ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. :s/thee/the <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B‚±‚̃Rƒ}ƒ“ƒh‚Í‚»‚Ìs‚Åʼn‚ÉŒ©
+ ‚‚©‚Á‚½‚à‚Ì‚É‚¾‚¯s‚È‚í‚ê‚邱‚Æ‚É‹C‚ð‚‚¯‚Ü‚µ‚傤B
+
+ 3. ‚Å‚Í :s/thee/the/g ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤Bs‘S‘Ì‚ð’uŠ·‚·‚邱‚Æ‚ðˆÓ–¡‚µ‚Ü‚·B
+ ‚±‚Ì•ÏX‚Í‚»‚Ìs‚ÅŒ©‚‚©‚Á‚½‘S‚Ẳӊ‚ɑ΂µ‚Äs‚È‚í‚ê‚Ü‚·B
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. •¡”s‚©‚猩‚‚©‚镶Žš‚ð•ÏX‚·‚é‚É‚Í
+ :#,#s/old/new/g #,# ‚Í‚Qs‚Ìs”Ô†‚ðŽw‚µ‚Ü‚·B
+ :%s/old/new/g ƒtƒ@ƒCƒ‹‘S‘Ì‚ÅŒ©‚‚©‚é‚à‚̂ɑ΂µ‚Ä•ÏX‚·‚éB
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 4 —v–ñ
+
+
+ 1. Ctrl-g ‚̓tƒ@ƒCƒ‹‚ł̈ʒu‚ƃtƒ@ƒCƒ‹‚ÌÚׂð•\Ž¦‚µ‚Ü‚·B
+ Shift-G ‚̓tƒ@ƒCƒ‹‚Ìʼnºs‚Ɉړ®‚µ‚Ü‚·Bs”Ô†Œã‚É Shift-G ‚Æ‚·‚é‚Æ
+ ‚»‚Ìs‚Ɉړ®‚µ‚Ü‚·B
+
+ 2. / ‚ÌŒã‚ÉŒê‹å‚ðƒ^ƒCƒv‚·‚é‚Æ‘O•û‚ÉŒê‹å‚ðŒŸõ‚µ‚Ü‚·B
+ ? ‚ÌŒã‚ÉŒê‹å‚ðƒ^ƒCƒv‚·‚é‚ÆŒã•û‚ÉŒê‹å‚ðŒŸõ‚µ‚Ü‚·B
+ ŒŸõ‚ÌŒã n ‚ÅA“¯•ûŒü‚ÉŒŸõ‚ðÄ‚Ñs‚¢A‚Ü‚½ N ‚Å‹t•ûŒü‚ÉŒŸõ‚ðs‚È‚¢‚Ü
+ ‚·B
+
+ 3. (,),[,],{, or } ã‚ɃJ[ƒ\ƒ‹‚ª‚ ‚éó‘Ô‚Å % ‚ðƒ^ƒCƒv‚·‚é‚Æ
+ ‘Ήž‚µ‚½‘΂Ɉړ®‚µ‚Ü‚·B
+
+ 4. Œ»Ýs‚Ìʼn‚Ì old ‚ð new ‚É’uŠ·‚·‚éB :s/old/new
+ Œ»Ýs‚Ì‘S‚Ä‚Ì old ‚ð new ‚É’uŠ·‚·‚éB :s/old/new/g
+ 2‚Â‚Ì # ŠÔ‚ÅŒê‹å‚ð’uŠ·‚·‚éB :#,#s/old/new/g
+ ƒtƒ@ƒCƒ‹‚Ì’†‚Ì‘S‚Ä‚ÌŒŸõŒê‹å‚ð’uŠ·‚·‚éB :%s/old/new/g
+ 'c' ‚ð‰Á‚¦‚é‚Æ’uŠ·‚Ì“x‚ÉŠm”F‚ð‹‚ß‚éB :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 5.1: ŠO•”ƒRƒ}ƒ“ƒh‚ðŽÀs‚·‚é•û–@
+
+
+ ** :! ‚ÌŒã‚ÉŽÀs‚·‚éŠO•”ƒRƒ}ƒ“ƒh‚ðƒ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ‰æ–Ê‚Ìʼnº•”‚ɃJ[ƒ\ƒ‹‚ªˆÚ“®‚·‚é‚悤AŠµ‚êe‚µ‚ñ‚¾ : ‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+ ‚±‚ê‚ŃRƒ}ƒ“ƒh‚ªƒ^ƒCƒv‚Å‚«‚é—l‚É‚È‚è‚Ü‚·B
+
+ 2. ‚±‚±‚Å ! ‚Æ‚¢‚¤•¶Žš(Š´’Q•„)‚ðƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+ ‚±‚ê‚ÅŠO•”ƒVƒFƒ‹ƒRƒ}ƒ“ƒh‚ªŽÀs‚Å‚«‚é—l‚É‚È‚è‚Ü‚·B
+
+ 3. —á‚Æ‚µ‚Ä ! ‚É‘±‚¯‚Ä ls ‚ƃ^ƒCƒv‚µ <ENTER> ‚ð‰Ÿ‚µ‚Ü‚µ‚傤B
+ ƒVƒFƒ‹ƒvƒƒ“ƒvƒg‚̂悤‚ɃfƒBƒŒƒNƒgƒŠ‚̈ꗗ‚ª•\Ž¦‚³‚ê‚é‚Í‚¸‚Å‚·B
+ ‚à‚µ‚­‚Í ls ‚ª“®‚©‚È‚¢‚È‚ç‚Î :!dir ‚ðŽg—p‚µ‚Ü‚µ‚傤B
+
+---> NOTE: ‚±‚Ì•û–@‚É‚æ‚Á‚Ä‚ ‚ç‚ä‚éƒRƒ}ƒ“ƒh‚ªŽÀs‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B
+
+---> NOTE: ‘S‚Ä‚Ì : ƒRƒ}ƒ“ƒh‚Í <ENTER> ‚ð‰Ÿ‚µ‚ÄI—¹‚µ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 5.2: ‚»‚Ì‘¼‚̃tƒ@ƒCƒ‹‚Ö‘‚«ž‚Ý
+
+
+ ** ƒtƒ@ƒCƒ‹‚Ö•ÏX‚ð•Û‘¶‚·‚é‚É‚Í :w ƒtƒ@ƒCƒ‹–¼ ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ƒfƒBƒŒƒNƒgƒŠ‚̈ꗗ‚𓾂邽‚ß‚É :!dir ‚à‚µ‚­‚Í :!ls ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+ ‚±‚Ì‚ ‚Æ <ENTER> ‚ð‰Ÿ‚·‚Ì‚ÍŠù‚É‚²‘¶’m‚Å‚·‚ËB
+
+ 2. TEST ‚̂悤‚ÉA‚»‚̃fƒBƒŒƒNƒgƒŠ‚É–³‚¢ƒtƒ@ƒCƒ‹–¼‚ðˆê‚‘I‚Ñ‚Ü‚·B
+
+ 3. ‚Å‚Í :w TEST ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤 (TEST ‚ÍA‘I‚ñ‚¾ƒtƒ@ƒCƒ‹–¼‚Å‚·)B
+
+ 4. ‚±‚ê‚É‚æ‚èƒtƒ@ƒCƒ‹‘S‘Ì‚ª TEST ‚Æ‚¢‚¤–¼‘O‚Å•Û‘¶‚³‚ê‚Ü‚·B
+ ‚à‚¤ˆê“x :!dir ‚ƃ^ƒCƒv‚µ‚ÄŠm”F‚µ‚Ä‚Ý‚Ü‚µ‚傤B
+
+---> ‚±‚±‚Å Vim ‚ðI—¹‚µAƒtƒ@ƒCƒ‹–¼ TEST ‚Æ‹¤‚É‹N“®‚·‚é‚ÆA•Û‘¶‚µ‚½Žž‚Ì
+ ƒ`ƒ…[ƒgƒŠƒAƒ‹‚Ì•¡»‚ª‚Å‚«ã‚ª‚é‚Í‚¸‚Å‚·B
+
+ 5. ‚Å‚ÍA :!del TEST ‚ƃ^ƒCƒv‚µ‚ătƒ@ƒCƒ‹‚ð휂µ‚Ä‚Ý‚Ü‚µ‚傤B
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 5.3: ‘I‘ð‚µ‚½‘‚«ž‚Ý
+
+
+ ** •”•ª“I‚É•Û‘¶‚·‚é‚É‚Í :#,# w ƒtƒ@ƒCƒ‹–¼ ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ‚à‚¤ˆê“xƒfƒBƒŒƒNƒgƒŠ‚̈ꗗ‚ðŽæ“¾‚·‚邽‚ß‚É :!ls ‚ƃ^ƒCƒv‚µATEST ‚Ì—l‚É
+ ƒtƒ@ƒCƒ‹‚ðˆê‚‘I‚ñ‚Å‚Ý‚Ü‚µ‚傤B
+
+ 2. ‚±‚̃y[ƒW‚ÌŽn‚߂܂ŃJ[ƒ\ƒ‹‚ðˆÚ“®‚µAƒtƒ@ƒCƒ‹‚Ìs”‚ð’m‚邽‚ß‚É Ctrl-g ‚Æ
+ ƒ^ƒCƒv‚µ‚Ü‚µ‚傤B‚»‚Ìs”Ô†‚ð‰¯‚¦‚Ä‚¨‚«‚Ü‚µ‚傤B
+
+ 3. ‚»‚µ‚ăy[ƒW‚ÌI‚è‚܂ňړ®‚µAÄ“x Ctrl-g ‚ðs‚¢‚Ü‚·B
+ ‚±‚Ìs”Ô†‚à‰¯‚¦‚Ä‚¨‚«‚Ü‚µ‚傤B
+
+ 4. ‚ ‚é•”•ª‚¾‚¯‚ð TEST ‚Æ‚¢‚¤–¼‚Å•Û‘¶‚·‚邽‚ß‚ÉA:#,# w TEST ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+ ‚±‚Ì #,# ‚ÍŠo‚¦‚Ä‚¨‚¢‚½‚Q‚‚̔Ԇ(ã’[,‰º’[) ‚Å‚ ‚èA TEST ‚ªƒtƒ@ƒCƒ‹–¼
+ ‚Æ‚È‚è‚Ü‚·B
+
+ 5. Ä“xAƒtƒ@ƒCƒ‹‚ª‘¶Ý‚·‚邱‚Æ‚ðŠm”F‚·‚邽‚ß‚É :!dir ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤B
+ ‚½‚¾‚µ‚±‚̃tƒ@ƒCƒ‹‚ÍÁ‚µ‚Ä‚Í‚¢‚¯‚Ü‚¹‚ñB
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 5.4: ƒtƒ@ƒCƒ‹‚̎枂Ƈ•¹
+
+
+ ** ƒtƒ@ƒCƒ‹‚Ì’†g‚ð‘}“ü‚·‚é‚É‚Í :r ƒtƒ@ƒCƒ‹–¼ ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. æ‚Ù‚Ç‚Ì TEST ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‘¶Ý‚·‚邱‚Æ‚ðŠm‚©‚߂邽‚ß‚É :!dir ‚Æ
+ ƒ^ƒCƒv‚µ‚Ü‚µ‚傤B
+
+ 2. ƒJ[ƒ\ƒ‹‚ð‚±‚Ìƒy[ƒW‚Ì擪‚Ɉړ®‚µ‚Ü‚·B
+
+NOTE: ƒXƒeƒbƒv 3 ‚ðŽÀs‚·‚é‚ÆA‰æ–Ê‚É ƒŒƒbƒXƒ“ 5.3 ‚ªŒ»‚í‚ê‚é‚Ì‚ÅAƒJ[ƒ\ƒ‹‚ð
+ ‰º‚Ɉړ®‚µ‚±‚̃ŒƒbƒXƒ“‚Ü‚Å–ß‚è‚Ü‚µ‚傤B
+
+ 3. ‚Å‚ÍA:r TEST ‚ƃ^ƒCƒv‚µ‚Ä TEST ƒtƒ@ƒCƒ‹‚ðŽæž‚Ý‚Ü‚µ‚傤B‚±‚Ì TEST ‚Í
+ ƒtƒ@ƒCƒ‹–¼‚Å‚·B
+
+NOTE: ƒtƒ@ƒCƒ‹‚̎枂݂̓J[ƒ\ƒ‹‚̈ʒu‚©‚çs‚í‚ê‚Ü‚·B
+
+ 4. Žæž‚ñ‚¾ƒtƒ@ƒCƒ‹‚ðŠm”F‚µ‚Ä‚Ý‚Ü‚µ‚傤BƒJ[ƒ\ƒ‹‚ð–ß‚·‚ÆAƒŒƒbƒXƒ“5.3 ‚Ì
+ ƒIƒŠƒWƒiƒ‹‚ƃtƒ@ƒCƒ‹‚É‚æ‚é‚à‚Ì‚Ì2‚‚ª‚ ‚邱‚Æ‚ª‚í‚©‚è‚Ü‚·B
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 5 —v–ñ
+
+
+ 1. :!command ‚É‚æ‚Á‚Ä ŠO•”ƒRƒ}ƒ“ƒh‚ðŽÀs‚µ‚Ü‚·B
+
+ ‚æ‚­Žg‚¤—á:
+ :!ls - ƒfƒBƒŒƒNƒgƒŠ‚̃tƒ@ƒCƒ‹ˆê——‚ðŒ©‚éB
+ :!del ƒtƒ@ƒCƒ‹–¼ - ƒtƒ@ƒCƒ‹–¼‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚Ì휂·‚éB
+
+ 2. :w ƒtƒ@ƒCƒ‹–¼ ‚É‚æ‚Á‚ătƒ@ƒCƒ‹–¼‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ªƒfƒBƒXƒN‚É‘‚«ž‚Ü‚ê‚éB
+
+ 3. :#,# w ƒtƒ@ƒCƒ‹–¼ ‚É‚æ‚Á‚Ä # ‚©‚ç # ‚Ü‚Å‚ð•Û‘¶‚·‚éB
+
+ 4. :r ƒtƒ@ƒCƒ‹–¼ ‚É‚æ‚èƒtƒ@ƒCƒ‹–¼‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ªƒfƒBƒXƒN‚æ‚èŽæž‚Ü‚êA
+ ƒJ[ƒ\ƒ‹ˆÊ’u‚̉º‚É‘}“ü‚³‚ê‚éB
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 6.1: ƒI[ƒvƒ“ƒRƒ}ƒ“ƒh
+
+
+ ** o ‚ðƒ^ƒCƒv‚·‚é‚ÆAƒJ[ƒ\ƒ‹‚̉º‚Ìs‚ªŠJ‚«A‘}“üƒ‚[ƒh‚É“ü‚è‚Ü‚· **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. o (¬•¶Žš) ‚ðƒ^ƒCƒv‚µ‚ÄAƒJ[ƒ\ƒ‹‚̉º‚Ìs‚ðŠJ‚«A‘}“üƒ‚[ƒh‚É“ü‚è‚Ü‚·B
+
+ 3. ---> ‚Æ‹L‚³‚ꂽs‚ðŽÊ‚µA<ESC> ‚ƃ^ƒCƒv‚µ‚ĒljÁƒ‚[ƒh‚ðI—¹‚µ‚Ü‚µ‚傤B
+
+---> o ‚ðƒ^ƒCƒv‚·‚é‚ƃJ[ƒ\ƒ‹‚ÍŠJ‚¢‚½s‚ÖˆÚ“®‚µ‘}“üƒ‚[ƒh‚É“ü‚è‚Ü‚·B
+
+ 4. ƒJ[ƒ\ƒ‹‚Ìã‚Ìs‚É‘}“ü‚·‚é‚É‚ÍA¬•¶Žš‚Ì o ‚Å‚Í‚È‚­A’Pƒ‚ɑ啶Žš‚Ì O
+ ‚ðƒ^ƒCƒv‚µ‚Ü‚·BŽŸ‚Ìs‚ÅŽŽ‚µ‚Ä‚Ý‚Ü‚µ‚傤B
+‚±‚Ìs‚Ìã‚Ö‘}“ü‚·‚é‚É‚ÍA‚±‚Ìs‚ÖƒJ[ƒ\ƒ‹‚ð’u‚¢‚Ä Shift-O ‚ðƒ^ƒCƒv‚µ‚Ü‚·B
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 6.2: ’ljÁƒRƒ}ƒ“ƒh
+
+
+ ** ƒJ[ƒ\ƒ‹‚ÌŽŸ‚̈ʒu‚©‚çƒeƒLƒXƒg‚ð’ljÁ‚·‚é‚É‚Í a ‚ƃ^ƒCƒv‚µ‚Ü‚· **
+
+ 1. ƒm[ƒ}ƒ‹ƒ‚[ƒh‚É‚µ‚Ĉȉº‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽʼn‚Ìs‚Å $ ‚ðƒ^ƒCƒv‚µ
+ ‚ÄAI’[‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. ƒJ[ƒ\ƒ‹‚Ì•¶Žš‚ÌŒã‚ë‚ɃeƒLƒXƒg‚ð’ljÁ‚·‚邽‚ß‚É a (¬•¶Žš) ‚ðƒ^ƒCƒv‚µ‚Ü
+ ‚·B
+
+NOTE: ‚±‚ê‚ÍÅŒã‚Ì•¶Žš‚ɂăeƒLƒXƒg‚ð‘}“ü‚µA<ESC> ‚ðƒ^ƒCƒv‚µ‚ăJ[ƒ\ƒ‹‚ð‰E‚É
+ ˆÚ“®‚µAÅŒã‚É x ƒ^ƒCƒv‚µ‚Äs––‚ɒljÁ‚·‚é‚Æ‚¢‚Á‚½‚悤‚È i ‚̃^ƒCƒv‚ð
+ ”ð‚¯‚é‚±‚Æ‚ª‚«‚Ü‚·B
+
+ 3. ‚³‚Äʼn‚Ìs‚ðŠ®¬‚µ‚Ü‚µ‚傤BƒeƒLƒXƒg‚ª‘}“ü‚³‚ê‚éˆÊ’u‚𜂯‚ÎA
+ ’ljÁƒRƒ}ƒ“ƒh‚Í‘}“üƒ‚[ƒh‚Æ‚Ü‚Á‚½‚­“¯‚¶‚Å‚·B
+
+---> ‚±‚Ìs‚ÅAs––‚É•¶Í‚ð’ljÁ‚·‚é
+---> ‚±‚Ìs‚ÅAs––‚É•¶Í‚ð’ljÁ‚·‚é—ûK‚ð‚·‚é‚±‚Æ‚ª‚Å‚«‚é‚Å‚µ‚傤B
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 6.3: ‚»‚Ì‘¼‚Ì’uŠ·
+
+
+ ** 1•¶ŽšˆÈã‚ð’u‚«Š·‚¦‚é‚ɂ͑啶Žš‚Ì R ‚ƃ^ƒCƒv‚µ‚Ü‚µ‚傤 **
+
+ 1. ˆÈ‰º‚Ì ---> ‚Æ‹L‚³‚ꂽ‚³‚ꂽs‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+
+ 2. ---> ‚Æ‹L‚³‚ꂽ‚Qs–ڂƈႤAʼn‚Ì’PŒê‚Ì擪‚ɃJ[ƒ\ƒ‹‚ðˆÚ“®‚µ‚Ü‚µ‚傤B
+ (’PŒê 'last')
+
+ 3. ‚±‚±‚Å R ‚ðƒ^ƒCƒv‚µ‚ÄAʼn‚Ìs‚ÆŽŸ‚Ìs‚ª“¯‚¶‚É‚È‚é‚悤‚ÉŠù‘¶‚̃eƒLƒXƒg
+ ‚Öã‘‚«ƒ^ƒCƒv‚µA‚Ps–Ú‚ÌŽc‚è‚Ì•”•ª‚ð‘‚«Š·‚¦‚Ü‚µ‚傤B
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. ƒ‚[ƒh‚𔲂¯‚邽‚ß‚É <ESC> ‚ðƒ^ƒCƒv‚·‚é‚ÆA•ÏX‚µ‚Ä‚¢‚È‚¢•”•ª‚ªŽc‚邱‚Æ
+ ‚É’ˆÓ‚µ‚Ü‚µ‚傤B
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 6.4: ƒIƒvƒVƒ‡ƒ“‚ÌÝ’è
+
+
+ ** ŒŸõ‚â’uŠ·‚Ìۂɑ啶Žš‚Ƭ•¶Žš‚𖳎‹‚·‚é—l‚ɃIƒvƒVƒ‡ƒ“‚ðݒ肵‚Ü‚· **
+
+
+ 1. ˆÈ‰º‚Ì—l‚Ƀ^ƒCƒv‚µ‚Ä 'ignore' ‚ðŒŸõ‚µ‚Ü‚µ‚傤:
+ /ignore
+ n ‚ð‰Ÿ‚µ‚ĉ½“x‚©ŒŸõ‚ðŒJ‚è•Ô‚µ‚Ü‚·B
+
+ 2. ˆÈ‰º‚Ì—l‚Ƀ^ƒCƒv‚µ‚Ä 'ic' (Ignore Case ‚Ì—ª‚Å‚·) ƒIƒvƒVƒ‡ƒ“‚ðݒ肵‚Ü‚·B
+ :set ic
+
+ 3. ‚Å‚Í n ‚É‚æ‚Á‚Ä‚à‚¤1“x 'ignore' ‚ðŒŸõ‚µ‚Ü‚·B
+ n ‚ð‰Ÿ‚µ‚Ä‚³‚ç‚É”‰ñŒŸõ‚ðŒJ‚è•Ô‚µ‚Ü‚µ‚傤B
+
+ 4. 'hlsearch' ‚Æ 'incsearch' ƒIƒvƒVƒ‡ƒ“‚ðˆÈ‰º‚Ì—l‚Éݒ肵‚Ü‚µ‚傤B
+ :set hls is
+
+ 5. ‚à‚¤ˆê“xŒŸõƒRƒ}ƒ“ƒh‚ð“ü—Í‚µ‚ÄA‰½‚ª‹N‚±‚é‚©Œ©‚Ä‚Ý‚Ü‚µ‚傤:
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 6 —v–ñ
+
+
+ 1. o ‚ðƒ^ƒCƒv‚·‚é‚ƃJ[ƒ\ƒ‹‚̉º‚Ìs‚ðŠJ‚¯‚ÄA‚»‚±‚Å‘}“üƒ‚[ƒh‚É‚È‚éB
+ O (‘啶Žš) ‚ðƒ^ƒCƒv‚·‚é‚ƃJ[ƒ\ƒ‹‚Ìã‚Ìs‚Å‘}“üƒ‚[ƒh‚É‚È‚éB
+
+ 2. ƒJ[ƒ\ƒ‹ã‚Ì•¶Žš‚ÌŽŸ‚©‚çƒeƒLƒXƒg‚ð’ljÁ‚·‚é‚É‚Í a ‚ƃ^ƒCƒv‚·‚éB
+ s––‚ÉŽ©“®‚ŃeƒLƒXƒg‚ð‘}“ü‚·‚é‚ɂ͑啶Žš A ‚ðƒ^ƒCƒv‚·‚éB
+
+ 3. ‘啶Žš‚Ì R ‚ðƒ^ƒCƒv‚·‚é‚Æ’uŠ·ƒ‚[ƒh‚É“ü‚èA<ESC>‚ð‰Ÿ‚·‚Æ”²‚¯‚éB
+
+ 4. ":set xxx" ‚ƃ^ƒCƒv‚·‚é‚ƃIƒvƒVƒ‡ƒ“ "xxx" ‚ªÝ’肳‚ê‚éB
+
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 7: ƒIƒ“ƒ‰ƒCƒ“ƒwƒ‹ƒvƒRƒ}ƒ“ƒh
+
+ ** ƒIƒ“ƒ‰ƒCƒ“ƒwƒ‹ƒv‚ðŽg—p‚µ‚Ü‚µ‚傤 **
+
+ Vim ‚É‚ÍL”͂ɂ킽‚éƒIƒ“ƒ‰ƒCƒ“ƒwƒ‹ƒvƒVƒXƒeƒ€‚ª‚ ‚è‚Ü‚·B
+ ƒwƒ‹ƒv‚ðŠJŽn‚·‚é‚É‚ÍA‚±‚ê‚ç3‚‚̂ǂꂩ1‚Â‚ðŽŽ‚µ‚Ä‚Ý‚Ü‚µ‚傤:
+ - ƒwƒ‹ƒvƒL[ <HELP> ‚ð‰Ÿ‚·(‚à‚µ‚ ‚é‚È‚ç‚Î)B
+ - <F1> ƒL[‚ð‰Ÿ‚·(‚à‚µ‚ ‚é‚È‚ç‚Î)B
+ - :help <ENTER> ‚ƃ^ƒCƒv‚·‚éB
+
+ ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚é‚É‚Í :q <ENTER> ‚ƃ^ƒCƒv‚µ‚Ü‚·B
+
+ ":help" ƒRƒ}ƒ“ƒh‚Ɉø”‚ð—^‚¦‚邱‚Æ‚É‚æ‚èA‚ ‚ç‚ä‚é‘è–¼‚̃wƒ‹ƒv‚ðŒ©‚Â‚¯‚é
+ ‚±‚Æ‚ª‚Å‚«‚Ü‚·B‚±‚ê‚ç‚ðŽŽ‚µ‚Ä‚Ý‚Ü‚µ‚傤(<ENTER> ‚ðƒ^ƒCƒv‚µ–Y‚ê‚È‚¢‚悤‚É):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ƒŒƒbƒXƒ“ 8: ‹N“®ƒXƒNƒŠƒvƒg‚Ìì¬
+
+ ** Vim ‚Ì“Á’¥‚ð”­Šö‚·‚é **
+
+ Vim ‚É‚Í Vi ‚æ‚è‚à‘½‚­‚Ì“Á’¥‚𓥂܂¦‚Ä‚¢‚Ü‚ªA‚»‚Ì‚Ù‚Æ‚ñ‚ǂ͉Šúó‘Ô‚É‚Ä
+ Žg—p•s‰Â‚Æ‚È‚Á‚Ä‚¢‚Ü‚·B‚æ‚葽‚­‚Ì“Á’¥‚ðŽg‚¢‚Í‚¶‚ß‚é‚É‚Í "vimrc" ƒtƒ@ƒCƒ‹
+ ‚ð쬂µ‚Ü‚·B
+
+ 1. "vimrc" ƒtƒ@ƒCƒ‹‚Ì•ÒW‚ðŠJŽn‚·‚éB‚±‚ê‚̓VƒXƒeƒ€‚Ɉˑ¶‚µ‚Ü‚·B
+ :edit ~/.vimrc UNIX Œü‚¯
+ :edit $VIM/_vimrc MS-Windows Œü‚¯
+
+ 2. ‚±‚±‚ŃTƒ“ƒvƒ‹‚Ì "vimrc" ‚ð“Ç‚Ýž‚Ý‚Ü‚·B
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. ˆÈ‰º‚̂悤‚Ƀtƒ@ƒCƒ‹‚Ö‘‚«ž‚Ý‚Ü‚·B
+
+ :write
+
+ ŽŸ‰ñ Vim ‚ð‹N“®‚·‚é‚ÆAF‚¯\•¶‚ªŽg‚¦‚é‚悤‚É‚È‚é‚Å‚µ‚傤B
+ ‚±‚Ì "vimrc" ƒtƒ@ƒCƒ‹‚ÖA‚¨D‚Ý‚ÌÝ’è‚ð’ljÁ‚·‚邱‚Æ‚ª‚Å‚«‚Ü‚·B
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ‚±‚ê‚É‚Ä Vim ‚̃`ƒ…[ƒgƒŠƒAƒ‹‚ðI‚í‚è‚Ü‚·BƒGƒfƒBƒ^‚ðŠÈ’P‚ÉA‚µ‚©‚à[•ª‚É
+ Žg‚¤‚±‚Æ‚ª‚Å‚«‚é‚悤‚É‚ÆAVim ‚ÌŽ‚ŠT”O‚Ì—v“_‚Ì‚Ý‚ð“`‚¦‚悤‚Æ‚µ‚Ü‚µ‚½B
+ Vim ‚É‚Í‚³‚ç‚É‘½‚­‚̃Rƒ}ƒ“ƒh‚ª‚ ‚èA‚±‚±‚Å‘S‚Ä‚ðà–¾‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñB
+ ˆÈ~‚̓†[ƒUƒ}ƒjƒ…ƒAƒ‹‚ðŽQÆ‚­‚¾‚³‚¢: "help :user-manual"
+
+ ‚±‚êˆÈŒã‚ÌŠwK‚Ì‚½‚ß‚ÉAŽŸ‚Ì–{‚ð„‘E‚µ‚Ü‚·B
+ Vim - Vi Improved - by Steve Oualline
+ o”ÅŽÐ: New Riders
+ ʼn‚Ì–{‚ÍŠ®‘S‚É Vim ‚Ì‚½‚ß‚É‘‚©‚ê‚Ü‚µ‚½B‚Æ‚è‚킯‰SŽÒ‚É‚Í‚¨§‚ß‚Å‚·B
+ ‘½‚­‚Ì—á‘è‚â}”Å‚ªŒfÚ‚³‚ê‚Ä‚¢‚Ü‚·B
+ ŽŸ‚ÌURL‚ðŽQÆ‚µ‚ĉº‚³‚¢ http://iccf-holland.org/click5.html
+
+ ŽŸ‚Í Vim ‚æ‚è‚à Vi ‚ɂ‚¢‚Ä‘‚©‚ꂽŒÃ‚¢–{‚Å‚·‚ª„‘E‚µ‚Ü‚·:
+ Learning the Vi Editor - by Linda Lamb
+ o”ÅŽÐ: O'Reilly & Associates Inc.
+ Vi ‚Å‚â‚肽‚¢‚ÆŽv‚¤‚±‚Æ‚Ù‚Ú‘S‚Ä‚ð’m‚邱‚Æ‚ª‚Å‚«‚é—Ç‘‚Å‚·B
+ ‘æ6”Å‚Å‚ÍAVim ‚ɂ‚¢‚Ä‚Ìî•ñ‚àŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B
+
+ ‚±‚̃`ƒ…[ƒgƒŠƒAƒ‹‚Í Colorado State University ‚Ì Charles Smith ‚̃AƒCƒfƒA
+ ‚ðŠî‚ÉAColorado School of Mines ‚Ì Michael C. Pierce ‚Æ Robert K. Ware ‚Ì
+ —¼–¼‚É‚æ‚Á‚Ä‘‚©‚ê‚Ü‚µ‚½B E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+ “ú–{Œê–ó ¼–{‘×O E-mail:mattn@mail.goo.ne.jp
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ vi:set ts=8 sts=4 sw=4 tw=76:
diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor.ja.utf-8
new file mode 100644
index 000000000..ae5677ba3
--- /dev/null
+++ b/runtime/tutor/tutor.ja.utf-8
@@ -0,0 +1,811 @@
+===============================================================================
+= V I M æ•™ 本 (ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«) 㸠よ ㆠ㓠ã - Version 1.5 =
+===============================================================================
+
+ Vim ã¯ã€ã“ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã§èª¬æ˜Žã™ã‚‹ã«ã¯å¤šã™ãŽã‚‹ç¨‹ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’å‚™ãˆãŸ
+ éžå¸¸ã«å¼·åŠ›ãªã‚¨ãƒ‡ã‚£ã‚¿ãƒ¼ã§ã™ã€‚ã“ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã¯ã€ã‚ãªãŸãŒ Vim
+ を万能エディターã¨ã—ã¦ä½¿ã„ã“ãªã›ã‚‹ã‚ˆã†ã«ãªã‚‹ã®ã«å分ãªã‚³ãƒžãƒ³ãƒ‰ã«ã¤ã„ã¦
+ 説明をã™ã‚‹ã‚ˆã†ãªã£ã¦ã„ã¾ã™ã€‚
+
+ ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã‚’完了ã™ã‚‹ã®ã«å¿…è¦ãªæ™‚é–“ã¯ã€è¦šãˆãŸã‚³ãƒžãƒ³ãƒ‰ã‚’試ã™ã®ã«ã©ã‚Œ
+ ã ã‘時間を使ã†ã®ã‹ã«ã‚‚よりã¾ã™ãŒã€ãŠã‚ˆã25〜30分ã§ã™ã€‚
+
+ å­¦ã¶ã‚³ãƒžãƒ³ãƒ‰ã«ã¯ã“ã®æ–‡ç« ã‚’変更ã™ã‚‹ã‚‚ã®ã‚‚ã‚ã‚Šã¾ã™ã€‚練習を始ã‚ã‚‹å‰ã«ã‚³
+ ピーを作æˆã—ã¾ã—ょã†("vimtutor"ã—ãŸãªã‚‰ã°ã€æ—¢ã«ã‚³ãƒ”ーã•ã‚Œã¦ã„ã¾ã™)。
+
+ ã“ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ãŒã€ä½¿ã†ã“ã¨ã§è¦šãˆã‚‰ã‚Œã‚‹ä»•çµ„ã¿ã«ãªã£ã¦ã„ã‚‹ã“ã¨ã‚’ã€å¿ƒ
+ ã—ã¦ãŠã‹ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。正ã—ã学習ã™ã‚‹ã«ã¯ã‚³ãƒžãƒ³ãƒ‰ã‚’実際ã«è©¦ã•ãªã‘
+ ã‚Œã°ãªã‚‰ãªã„ã®ã§ã™ã€‚文章を読んã ã ã‘ãªã‚‰ã°ã€ãã£ã¨å¿˜ã‚Œã¦ã—ã¾ã„ã¾ã™!。
+
+ ã•ãã€Capsロック(Shift-Lock)キーãŒæŠ¼ã•ã‚Œã¦ã„ãªã„ã“ã¨ã‚’確èªã—ãŸå¾Œã€
+ ç”»é¢ã«ãƒ¬ãƒƒã‚¹ãƒ³1.1 ãŒå…¨éƒ¨è¡¨ç¤ºã•ã‚Œã‚‹ã¨ã“ã‚ã¾ã§ã€j キーを押ã—ã¦ã‚«ãƒ¼ã‚½ãƒ«ã‚’
+ 移動ã—ã¾ã—ょã†ã€‚
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 1.1: カーソルã®ç§»å‹•
+
+
+ ** カーソルを移動ã™ã‚‹ã«ã¯ã€ç¤ºã•ã‚Œã‚‹æ§˜ã« h,j,k,l を押ã—ã¾ã™ **
+ ^
+ k ヒント: h キーã¯å·¦æ–¹å‘ã«ç§»å‹•ã—ã¾ã™ã€‚
+ < h l > l キーã¯å³æ–¹å‘ã«ç§»å‹•ã—ã¾ã™ã€‚
+ j j キーã¯ä¸‹çŸ¢å°ã‚­ãƒ¼ã®ã‚ˆã†ãªã‚­ãƒ¼ã§ã™ã€‚
+ v
+ 1. 移動ã«æ…£ã‚Œã‚‹ã¾ã§ã€ã‚¹ã‚¯ãƒªãƒ¼ãƒ³ã§ã‚«ãƒ¼ã‚½ãƒ«ç§»å‹•ã•ã›ã¾ã—ょã†ã€‚
+
+ 2. 下ã¸ã®ã‚­ãƒ¼(j)を押ã—ã¤ã¥ã‘ã‚‹ã¨ã€é€£ç¶šã—ã¦ç§»å‹•ã§ãã¾ã™ã€‚
+---> ã“ã‚Œã§æ¬¡ã®ãƒ¬ãƒƒã‚¹ãƒ³ã«ç§»å‹•ã™ã‚‹æ–¹æ³•ãŒã‚ã‹ã‚Šã¾ã—ãŸã­ã€‚
+
+ 3. 下ã¸ã®ã‚­ãƒ¼ã‚’使ã£ã¦ã€ãƒ¬ãƒƒã‚¹ãƒ³1.2 ã«ç§»å‹•ã—ã¾ã—ょã†ã€‚
+
+NOTE: 何をタイプã—ã¦ã„ã‚‹ã‹åˆ¤ã‚‰ãªããªã£ãŸã‚‰ã€<ESC>を押ã—ã¦ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã«ã—ã¾
+ ã™ã€‚ãã‚Œã‹ã‚‰å…¥åŠ›ã—よã†ã¨ã—ã¦ã„ãŸã‚³ãƒžãƒ³ãƒ‰ã‚’å†å…¥åŠ›ã—ã¾ã—ょã†ã€‚
+
+NOTE: カーソルキーã§ã‚‚移動ã§ãã¾ã™ã€‚ã—ã‹ã— hjkl を使用ã™ã‚‹ã“ã¨ã«ä¸€åº¦æ…£ã‚Œã¦ã—ã¾
+ ãˆã°ã€ã¯ã‚‹ã‹ã«é€Ÿã移動ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã§ã—ょã†ã€‚
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 1.2: VIM ã®èµ·å‹•ã¨çµ‚了
+
+
+ !! NOTE: 以下ã®ã‚らゆるステップを行ã†å‰ã«ã€ã“ã®ãƒ¬ãƒƒã‚¹ãƒ³ã‚’読ã¿ã¾ã—ょã†!!
+
+ 1. <ESC>キーを押ã—ã¾ã—ょã†ã€‚(確実ã«ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã«ã™ã‚‹ãŸã‚)
+
+ 2. 次ã®ã‚ˆã†ã«ã‚¿ã‚¤ãƒ—: :q! <ENTER>
+
+---> ã“ã‚Œã«ã‚ˆã‚Šç·¨é›†ã—ãŸå†…容をä¿å­˜ã›ãšã«ã‚¨ãƒ‡ã‚£ã‚¿ãŒçµ‚了ã—ã¾ã™ã€‚
+ 編集内容をä¿å­˜ã—ã¦çµ‚了ã™ã‚‹ã¨ãã¯æ¬¡ã®ã‚ˆã†ã«ã‚¿ã‚¤ãƒ—ã—ã¾ã™:
+ :wq <ENTER>
+
+ 3. シェルプロンプトã‹ã‚‰ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã‚’始ã‚ã‚‹ã«ã¯ã‚³ãƒžãƒ³ãƒ‰ã‚’タイプã—ã¾ã™ã€‚
+ ãã®ã‚³ãƒžãƒ³ãƒ‰ã¯: vimtutor <ENTER>
+ 通常ã¯ã“ã†ã§ã—ょã†: vim tutor <ENTER>
+
+---> 'vim' 㯠Vim エディタã®èµ·å‹•ã‚’ã€'tutor' ã¯ç·¨é›†ã—ãŸã„ファイルをæ„味ã—ã¾ã™ã€‚
+
+ 4. ã“ã‚Œã¾ã§ã®ã‚¹ãƒ†ãƒƒãƒ—を覚ãˆè‡ªä¿¡ãŒã¤ã„ãŸãªã‚‰ã°ã€ã‚¹ãƒ†ãƒƒãƒ— 1 ã‹ã‚‰ 3 ã¾ã§ã‚’実
+ éš›ã«è©¦ã—ã¦ã€Vim ã‚’1度終了ã—ã¦ã‹ã‚‰å†ã³èµ·å‹•ã—ã¾ã—ょã†ã€‚ãã‚Œã‹ã‚‰ãƒ¬ãƒƒã‚¹ãƒ³
+ 1.3ã¾ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã•ã›ã¾ã—ょã†ã€‚
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 1.3: テキスト編集 - 削除
+
+
+ ** ノーマルモードã«ã¦ã‚«ãƒ¼ã‚½ãƒ«ã®ä¸‹ã®æ–‡å­—を削除ã™ã‚‹ã«ã¯ x を押ã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. é–“é•ã„を修正ã™ã‚‹ãŸã‚ã«ã€å‰Šé™¤ã™ã‚‹æœ€åˆã®æ–‡å­—ã¾ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã™ã€‚
+
+ 3. ä¸å¿…è¦ãªæ–‡å­—ã‚’ x を押ã—ã¦å‰Šé™¤ã—ã¾ã—ょã†ã€‚
+
+ 4. æ–‡ãŒæ­£ã—ããªã‚‹ã¾ã§ ステップ 2 ã‹ã‚‰ 4 ã‚’ç¹°ã‚Šè¿”ã—ã¾ã—ょã†ã€‚
+
+---> ãã® ã†ã†ã•ãŽ 㯠ã¤ã¤ãã ã‚’ ã“ãˆãˆã¦ã¦ ã¨ã³ã¯ã­ãŸãŸ
+
+ 5. è¡ŒãŒæ­£ã—ããªã£ãŸã‚‰ã€ãƒ¬ãƒƒã‚¹ãƒ³ 1.4 ã«ç§»ã‚Šã¾ã—ょã†ã€‚
+
+NOTE: å…¨ã¦ã®ãƒ¬ãƒƒã‚¹ãƒ³ã‚’通ã˜ã¦ã€è¦šãˆã‚ˆã†ã¨ã™ã‚‹ã®ã§ã¯ãªã実際ã«ã‚„ã£ã¦ã¿ã¾ã—ょã†ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 1.4: テキスト編集 - 挿入
+
+
+ ** ノーマルモードã«ã¦ãƒ†ã‚­ã‚¹ãƒˆã‚’挿入ã™ã‚‹ã«ã¯ i を押ã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸæœ€åˆã®è¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. 1行目を2行目ã¨åŒã˜æ§˜ã«ã™ã‚‹ãŸã‚ã«ã€ãƒ†ã‚­ã‚¹ãƒˆã‚’挿入ã—ãªã‘ã‚Œã°ãªã‚‰ãªã„ä½
+ ç½®ã®æ¬¡ã®æ–‡å­—ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã™ã€‚
+
+ 3. i キーを押ã—ã¦ã‹ã‚‰ã€è¿½åŠ ãŒå¿…è¦ãªæ–‡å­—をタイプã—ã¾ã—ょã†ã€‚
+
+ 4. é–“é•ã„を修正ã—ãŸã‚‰ <ESC> を押ã—ã¦ã‚³ãƒžãƒ³ãƒ‰ãƒ¢ãƒ¼ãƒ‰ã«æˆ»ã‚Šã€æ­£ã—ã„æ–‡ã«
+ ãªã‚‹æ§˜ã«ã‚¹ãƒ†ãƒƒãƒ— 2 ã‹ã‚‰ 4 ã‚’ç¹°ã‚Šè¿”ã—ã¾ã—ょã†ã€‚
+
+---> ã“ã® ã«ã¯ 足りãªã„ テキスト ã‚る。
+---> ã“ã® è¡Œ ã«ã¯ å¹¾ã¤ã‹ 足りãªã„ テキスト ㌠ã‚る。
+
+ 5. 挿入ã®æ–¹æ³•ãŒã‚ã‹ã£ãŸã‚‰ä¸‹ã®ãƒ¬ãƒƒã‚¹ãƒ³1ã®è¦ç´„を見ã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 1 è¦ç´„
+
+
+ 1. カーソルã¯çŸ¢å°ã‚­ãƒ¼ã‚‚ã—ã㯠hjkl キーã§ç§»å‹•ã—ã¾ã™ã€‚
+ h (å·¦) j (下) k (上) l (å³)
+
+ 2. Vim ã‚’èµ·å‹•ã™ã‚‹ã«ã¯ãƒ—ロンプトã‹ã‚‰ vim ファイルå <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ 3. Vim を終了ã™ã‚‹ã«ã¯ <ESC> :q! <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™(変更を破棄)。
+ ã‚‚ã—ã㯠<ESC> :wq <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™(変更をä¿å­˜)。
+
+ 4. カーソルã®ä¸‹ã®æ–‡å­—を削除ã™ã‚‹ã«ã¯ã€ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã§ x ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ 5. カーソルã®ä½ç½®ã«æ–‡å­—を挿入ã™ã‚‹ã«ã¯ã€ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã§ i ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+ i テキストã®ã‚¿ã‚¤ãƒ— <ESC>
+
+NOTE: <ESC> キーを押ã™ã¨ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã«ç§»è¡Œã—ã¾ã™ã€‚ãã®éš›ã€é–“é•ã£ãŸã‚Šå…¥åŠ›é€”中
+ ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’å–り消ã™ã“ã¨ãŒã§ãã¾ã™ã€‚
+
+ã•ã¦ã€ç¶šã‘ã¦ãƒ¬ãƒƒã‚¹ãƒ³ 2 を始ã‚ã¾ã—ょã†ã€‚
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 2.1: 削除コマンド
+
+
+ ** å˜èªžã®æœ«å°¾ã¾ã§ã‚’削除ã™ã‚‹ã«ã¯ dw ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょㆠ**
+
+ 1. ノーマルモードã§ã‚ã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãŸã‚ã« <ESC> を押ã—ã¾ã—ょã†ã€‚
+
+ 2. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 3. 消ã—ãŸã„å˜èªžã®å…ˆé ­ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 4. å˜èªžã‚’削除ã™ã‚‹ãŸã‚ã« dw ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+
+ NOTE: タイプã™ã‚‹ã¨ã€dw ã¨ã„ã†æ–‡å­—ãŒã‚¹ã‚¯ãƒªãƒ¼ãƒ³ã®æœ€ä¸‹è¡Œã«ç¾ã‚ã‚Œã¾ã™ã€‚
+ タイプを間é•ã£ã¦ã—ã¾ã£ãŸæ™‚ã«ã¯ <ESC> を押ã—ã¦ã‚„ã‚Šç›´ã—ã¾ã—ょã†ã€‚
+
+---> ã“ã® æ–‡ ç´™ ã«ã¯ ã„ãã¤ã‹ã® ãŸã®ã—ã„ å¿…è¦ã®ãªã„ å˜èªž ㌠å«ã¾ã‚Œã¦ ã„ã¾ã™ã€‚
+
+ 5. 3 ã‹ã‚‰ 4 ã¾ã§ã‚’æ–‡ãŒæ­£ã—ããªã‚‹ã¾ã§ç¹°ã‚Šè¿”ã—ã€ãƒ¬ãƒƒã‚¹ãƒ³ 2.2 ã«ç§»ã‚Šã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 2.2: ãã®ä»–ã®å‰Šé™¤ã‚³ãƒžãƒ³ãƒ‰
+
+
+ ** è¡Œã®æœ«å°¾ã¾ã§ã‚’削除ã™ã‚‹ã«ã¯ d$ ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょㆠ**
+
+ 1. ノーマルモードã§ã‚ã‚‹ã“ã¨ã‚’確èªã™ã‚‹ã®ã« <ESC> を押ã—ã¾ã—ょã†ã€‚
+
+ 2. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 3. æ­£ã—ã„æ–‡ã®æœ«å°¾ã¸ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†(最åˆã® . ã®å¾Œã§ã™)。
+
+ 4. 行末ã¾ã§å‰Šé™¤ã™ã‚‹ã®ã« d$ ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+
+---> 誰ã‹ãŒã“ã®è¡Œã®æœ€å¾Œã‚’2度タイプã—ã¾ã—ãŸã€‚ 2度タイプã—ã¾ã—ãŸã€‚
+
+
+ 5. ã©ã†ã„ã†ã“ã¨ã‹ç†è§£ã™ã‚‹ãŸã‚ã«ã€ãƒ¬ãƒƒã‚¹ãƒ³ 2.3 ã¸ç§»ã‚Šã¾ã—ょã†ã€‚
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: コマンドã¨ç›®çš„語
+
+
+ 削除コマンド d ã®å½¢å¼ã¯æ¬¡ã®æ§˜ã«ãªã£ã¦ã„ã¾ã™:
+
+ [回数] d 目的語 ã‚‚ã—ã㯠d [回数] 目的語
+ ãã‚Œãžã‚Œ:
+ 回数 - ãã®ã‚³ãƒžãƒ³ãƒ‰ã‚’何回繰り返ã™ã‹(çœç•¥å¯èƒ½, çœç•¥ã—ãŸæ™‚㯠=1)。
+ d - 削除コマンド。
+ 目的語 - 何ã«å¯¾ã—ã¦åƒãã‹ã‘ã‚‹ã‹(以下ã«æŒ™ã’ã¾ã™)。
+
+ 目的語一覧:
+ w - カーソルä½ç½®ã‹ã‚‰ç©ºç™½ã‚’å«ã‚€å˜èªžã®æœ«å°¾ã¾ã§ã€‚
+ e - カーソルä½ç½®ã‹ã‚‰ç©ºç™½ã‚’å«ã¾ãªã„å˜èªžã®æœ«å°¾ã¾ã§ã€‚
+ $ - カーソルä½ç½®ã‹ã‚‰è¡Œæœ«ã¾ã§ã€‚
+
+NOTE: 冒険ã—ãŸã„人ã¯ã€ãƒŽãƒ¼ãƒžãƒ«ãƒ¢ãƒ¼ãƒ‰ã«ã¦ã‚³ãƒžãƒ³ãƒ‰ãªã—ã«ç›®çš„語を押ã—ã¦
+ ã¿ã¾ã—ょã†ã€‚カーソルãŒç›®çš„語一覧ã§ç¤ºã•ã‚Œã‚‹ä½ç½®ã«ç§»å‹•ã™ã‚‹ã¯ãšã§ã™ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 2.4: ãれ以外ã®å½¢ã®ã‚³ãƒžãƒ³ãƒ‰
+
+
+ ** 行全体を削除ã™ã‚‹ã«ã¯ dd ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょㆠ**
+
+ 行全体ã®å‰Šé™¤ã¯é »ç¹ã«è¡Œãªã†ä½œæ¥­ãªã®ã§ã€Vim ã®è¨­è¨ˆè€…ã¯è¡Œã‚’削除ã™ã‚‹ã®ã«ã¯ã€
+ å˜ã«åˆ—内ã«ã¦2回 d をタイプã™ã‚‹æ–¹ãŒç°¡å˜ã ã‚ã†ã¨åˆ¤æ–­ã—ã¾ã—ãŸã€‚
+
+ 1. 下ã«ã‚る一連ã®ãƒ•ãƒ¬ãƒ¼ã‚ºã®2行目ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+ 2. dd ã¨ã‚¿ã‚¤ãƒ—ã—ã¦è¡Œã‚’削除ã—ã¾ã—ょã†ã€‚
+ 3. ã§ã¯4行目ã«ç§»å‹•ã—ã¦ã¿ã¾ã—ょã†ã€‚
+ 4. 2dd ã¨ã‚¿ã‚¤ãƒ—ã—ã¦2行削除ã—ã¦ã¿ã¾ã—ょã†ã€‚
+ (回数-コマンド-目的語 ã®å½¢å¼ã‚’æ€ã„出ã—ã¾ã—ょã†)
+
+ 1) ãƒãƒ©ã¯èµ¤ã„ã€
+ 2) ã¤ã¾ã‚‰ãªã„ã‚‚ã®ã¯æ¥½ã—ã„ã€
+ 3) スミレã¯é’ã„ã€
+ 4) ç§ã¯è»Šã‚’ã‚‚ã£ã¦ã„ã‚‹ã€
+ 5) 時計ãŒæ™‚刻を告ã’ã‚‹ã€
+ 6) ç ‚ç³–ã¯ç”˜ã„
+ 7) オマエモナー
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 2.5: ã‚„ã‚Šç›´ã—コマンド
+
+
+ ** 最後ã®ã‚³ãƒžãƒ³ãƒ‰ã‚’å–り消ã™ã«ã¯ u を押ã—ã¾ã™ã€‚U ã¯è¡Œå…¨ä½“ã®å–消ã§ã™ã€‚ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã€æœ€åˆã®é–“é•ã„ã«ã‚«ãƒ¼ã‚½ãƒ«
+ を移動ã—ã¾ã—ょã†ã€‚
+ 2. x をタイプã—ã¦ã„らãªã„先頭ã®æ–‡å­—を削除ã—ã¾ã—ょã†ã€‚
+ 3. ã•ãã€u をタイプã—ã¦æœ€å¾Œã«å®Ÿè¡Œã—ãŸã‚³ãƒžãƒ³ãƒ‰ã‚’å–り消ã—ã¾ã—ょã†ã€‚
+ 4. 今度ã¯ã€x を使用ã—ã¦èª¤ã‚Šã‚’å…¨ã¦ä¿®æ­£ã—ã¾ã—ょã†ã€‚
+ 5. 大文字㮠U をタイプã—ã¦ã€è¡Œã‚’å…ƒã®çŠ¶æ…‹ã«æˆ»ã—ã¾ã—ょã†ã€‚
+ 6. u をタイプã—ã¦ç›´å‰ã® U コマンドをå–消ã—ã¾ã—ょã†ã€‚
+ 7. ã§ã¯ã‚³ãƒžãƒ³ãƒ‰ã‚’å†å®Ÿè¡Œã™ã‚‹ã®ã« CTRL-R (CTRL を押ã—ãŸã¾ã¾ R を打ã¤)ã‚’
+ 数回タイプã—ã¦ã¿ã¾ã—ょã†(å–消ã®å–消)。
+
+---> ã“ã®ã®è¡Œã®ã®é–“é•ã„を修正々ã—ã€å¾Œã§ãれらã®ä¿®æ­£ã‚’ã‚’å–消ã—ã¾ã¾ã™ã™ã€‚
+
+ 8. ã“ã‚Œã¯ã¨ã¦ã‚‚便利ãªã‚³ãƒžãƒ³ãƒ‰ã§ã™ã€‚ã•ãレッスン 2 è¦ç´„ã«ç§»ã‚Šã¾ã—ょã†ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 2 è¦ç´„
+
+
+ 1. カーソルä½ç½®ã‹ã‚‰å˜èªžã®æœ«å°¾ã¾ã§ã‚’削除ã™ã‚‹ã«ã¯ dw ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ 2. カーソルä½ç½®ã‹ã‚‰è¡Œã®æœ«å°¾ã¾ã§ã‚’削除ã™ã‚‹ã«ã¯ d$ ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ 3. 行全体を削除ã™ã‚‹ã«ã¯ dd ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ 4. ノーマルモードã§ã®ã‚³ãƒžãƒ³ãƒ‰å½¢å¼ã¯
+
+ [回数] コマンド 目的語 ã‚‚ã—ã㯠コマンド [回数] 目的語
+ ãã‚Œãžã‚Œ:
+ 回数 - ãã®ã‚³ãƒžãƒ³ãƒ‰ã‚’何回繰り返ã™ã‹ã€‚
+ コマンド - 削除 d ã®é¡žã§ä½•ã‚’ã™ã‚‹ã‹ã€‚
+ 目的語 - å˜èªž w や行末 $ ãªã©ã®é¡žã§ä½•ã«å¯¾ã—ã¦åƒãã‹ã‘ã‚‹ã‹ã€‚
+
+ 5. å‰å›žã®å‹•ä½œã‚’å–消ã™: u (å°æ–‡å­— u)
+ 行全体ã®å¤‰æ›´ã‚’å–消ã™: U (大文字 U)
+ å–消ã—ã®å–消ã—: CTRL-R
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 3.1: 貼り付ã‘コマンド
+
+
+ ** 最後ã«å‰Šé™¤ã•ã‚ŒãŸè¡Œã‚’カーソルã®å¾Œã«è²¼ã‚Šä»˜ã‘ã‚‹ã«ã¯ p をタイプã—ã¾ã™ **
+
+ 1. 以下ã®æ®µè½ã®æœ€åˆã®è¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. dd ã¨ã‚¿ã‚¤ãƒ—ã—ã¦è¡Œã‚’削除ã—ã€Vim ã®ãƒãƒƒãƒ•ã‚¡ã«æ ¼ç´ã—ã¾ã—ょã†ã€‚
+
+ 3. 削除ã—ãŸè¡ŒãŒæœ¬æ¥ã‚ã‚‹ã¹ãä½ç½®ã®ä¸Šã®è¡Œã¾ã§ã€ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã•ã›ã¾ã—ょã†ã€‚
+
+ 4. ノーマルモード㧠p をタイプã—ã¦æ ¼ç´ã—ãŸè¡Œã‚’ç”»é¢ã«æˆ»ã—ã¾ã™ã€‚
+
+ 5. 順番ãŒæ­£ã—ããªã‚‹æ§˜ã«ã‚¹ãƒ†ãƒƒãƒ— 2 ã‹ã‚‰ 4 ã‚’ç¹°ã‚Šè¿”ã—ã¾ã—ょã†ã€‚
+
+ d) 貴方も学ã¶ã“ã¨ãŒã§ãã‚‹?
+ b) スミレã¯é’ã„ã€
+ c) 知æµã¨ã¯å­¦ã¶ã‚‚ã®ã€
+ a) ãƒãƒ©ã¯èµ¤ã„ã€
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 3.2: ç½®ãæ›ãˆã‚³ãƒžãƒ³ãƒ‰
+
+
+ ** カーソルã®ä¸‹ã®æ–‡å­—ã‚’ç½®ãæ›ãˆã‚‹ã«ã¯ r をタイプã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸæœ€åˆã®è¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. 最åˆã®é–“é•ã„ã®å…ˆé ­ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 3. r ã¨ã‚¿ã‚¤ãƒ—ã—ã€é–“é•ã£ã¦ã„る文字を置ãæ›ãˆã‚‹ã€æ­£ã—ã„文字をタイプã—ã¾ã—ょã†ã€‚
+
+ 4. 最åˆã®è¡ŒãŒæ­£ã—ããªã‚‹ã¾ã§ã‚¹ãƒ†ãƒƒãƒ— 2 ã‹ã‚‰ 3 ã‚’ç¹°ã‚Šè¿”ã—ã¾ã—ょã†ã€‚
+
+---> ã“ã®åˆã‚’人力ã—ãŸæ™‚ã­ã€ãã®äººã¯å¹¾ã¤ã‹å•é•ã£ãŸã‚­ãƒ¼ã‚’押ã—ã‚‚ã—ãŸ!
+---> ã“ã®è¡Œã‚’入力ã—ãŸæ™‚ã«ã€ãã®äººã¯å¹¾ã¤ã‹é–“é•ã£ãŸã‚­ãƒ¼ã‚’押ã—ã¾ã—ãŸ!
+
+ 5. ã•ãã€ãƒ¬ãƒƒã‚¹ãƒ³ 3.2 ã«ç§»ã‚Šã¾ã—ょã†ã€‚
+
+NOTE: 実際ã«è©¦ã—ã¾ã—ょã†ã€‚決ã—ã¦è¦šãˆã‚‹ã ã‘ã«ã¯ã—ãªã„ã“ã¨ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 3.3: 変更コマンド
+
+
+ ** å˜èªžã®ä¸€éƒ¨ã€ã‚‚ã—ãã¯å…¨ä½“を変更ã™ã‚‹ã«ã¯ cw ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸæœ€åˆã®è¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. lubw ã® u ã®ä½ç½®ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 3. cw ã¨ã‚¿ã‚¤ãƒ—ã—ã€æ­£ã—ã„å˜èªžã‚’タイプã—ã¾ã—ょã†(ã“ã®å ´åˆ 'ine' ã¨ã‚¿ã‚¤ãƒ—)。
+
+ 4. 次ã®é–“é•ã„(変更ã™ã¹ã文字ã®å…ˆé ­)ã«ç§»å‹•ã™ã‚‹ãŸã‚ã« <ESC> をタイプã—ã¾ã™ã€‚
+
+ 5. 最åˆã®è¡ŒãŒæ¬¡ã®è¡Œã®æ§˜ã«ãªã‚‹ã¾ã§ã‚¹ãƒ†ãƒƒãƒ— 3 㨠4 ã‚’ç¹°ã‚Šè¿”ã—ã¾ã™ã€‚
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+cw ã¯å˜èªžã‚’変更ã™ã‚‹ã ã‘ã§ãªãã€æŒ¿å…¥ã‚‚è¡Œãˆã‚‹ã“ã¨ã«æ³¨æ„ã—ã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 3.4: c を使用ã—ãŸãã®ä»–ã®å¤‰æ›´
+
+
+ ** 変更コマンドã¯ã€å‰Šé™¤ã‚³ãƒžãƒ³ãƒ‰ã¨åŒã˜æ§˜ã«ã‚ªãƒ–ジェクトを使用ã—ã¾ã™ **
+
+
+ 1. 変更コマンドã¯ã€å‰Šé™¤ã‚³ãƒžãƒ³ãƒ‰ã¨åŒã˜ã‚ˆã†ãªå‹•ä½œã‚’ã—ã¾ã™ã€‚ãã®å½¢å¼ã¯
+
+ [回数] c 目的語 ã‚‚ã—ã㯠c [回数] 目的語
+
+ 2. オブジェクトもåŒã˜ã§ã€w ã¯å˜èªžã€ $ ã¯è¡Œæœ«ãªã©ã¨ã„ã£ãŸã‚‚ã®ã§ã™ã€‚
+
+ 3. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 4. 最åˆã®é–“é•ã„ã¸ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 5. c$ ã¨ã‚¿ã‚¤ãƒ—ã—ã¦è¡Œã®æ®‹ã‚Šã‚’2行目ã®æ§˜ã«ã—ã€<ESC> を押ã—ã¾ã—ょã†ã€‚
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 3 è¦ç´„
+
+
+ 1. æ—¢ã«å‰Šé™¤ã•ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆã‚’å†é…ç½®ã™ã‚‹ã«ã¯ã€p をタイプã—ã¾ã™ã€‚ã“ã‚Œã¯å‰Šé™¤ã•
+ ã‚ŒãŸãƒ†ã‚­ã‚¹ãƒˆã‚’カーソルã®å¾Œã«æŒ¿å…¥ã—ã¾ã™(è¡Œå˜ä½ã§å‰Šé™¤ã•ã‚ŒãŸã®ãªã‚‰ã°ã€ã‚«ãƒ¼
+ ソルã®ã‚る次ã®è¡Œã«æŒ¿å…¥ã•ã‚Œã¾ã™)。
+
+ 2. カーソルã®ä¸‹ã®æ–‡å­—ã‚’ç½®ãæ›ãˆã‚‹ã«ã¯ã€r をタイプã—ãŸå¾Œã€ãれを置ãæ›ãˆã‚‹
+ 文字をタイプã—ã¾ã™ã€‚
+
+ 3. 変更コマンドã§ã¯ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã‹ã‚‰ç‰¹å®šã®ç›®çš„語ã§æŒ‡å®šã•ã‚Œã‚‹çµ‚端ã¾ã§ã‚’変更
+ ã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚例ãˆã° cw ãªã‚‰ã°ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã‹ã‚‰å˜èªžã®çµ‚ã‚ã‚Šã¾ã§ã€
+ c$ ãªã‚‰ã°è¡Œã®çµ‚ã‚ã‚Šã¾ã§ã‚’変更ã—ã¾ã™ã€‚
+
+ 4. 変更コマンドã®å½¢å¼ã¯
+
+ [回数] c 目的語 ã‚‚ã—ã㯠c [回数] 目的語
+
+ã•ãã€æ¬¡ã®ãƒ¬ãƒƒã‚¹ãƒ³ã«ç§»ã‚Šã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 4.1: ä½ç½®ã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®æƒ…å ±
+
+
+ ** ファイル内ã§ã®ä½ç½®ã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®çŠ¶æ…‹ã‚’表示ã™ã‚‹ã«ã¯ CTRL-g をタイプã—ã¾ã™ã€‚
+ ファイル内ã®ã‚ã‚‹è¡Œã«ç§»å‹•ã™ã‚‹ã«ã¯ SHIFT-G をタイプã—ã¾ã™ **
+
+ NOTE: ステップを実行ã™ã‚‹å‰ã«ã€ã“ã®ãƒ¬ãƒƒã‚¹ãƒ³å…¨ã¦ã«ç›®ã‚’通ã—ã¾ã—ょã†!!
+
+ 1. CTRL を押ã—ãŸã¾ã¾ g を押ã—ã¾ã—ょã†ã€‚ページã®ä¸€ç•ªä¸‹ã«ã‚るステータス行
+ ã«ãƒ•ã‚¡ã‚¤ãƒ«åã¨è¡ŒãŒè¡¨ç¤ºã•ã‚Œã‚‹ã¯ãšã§ã™ã€‚ ステップ 3 ã®ãŸã‚ã«è¡Œç•ªå·ã‚’
+ 覚ãˆã¦ãŠãã¾ã—ょã†ã€‚(訳者注:ルーラーãŒã‚ã‚‹å ´åˆã¯ãã¡ã‚‰ã«æ³¨ç›®)
+
+ 2. 最下行ã«ç§»å‹•ã™ã‚‹ãŸã‚ã« shift-G ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+
+ 3. å…ˆã»ã©ã®è¡Œã®ç•ªå·ã‚’タイプã—〠shift-G をタイプã—ã¾ã—ょã†ã€‚
+ 最åˆã« Ctrl-g を押ã—ãŸè¡Œã«æˆ»ã£ã¦æ¥ã‚‹ã¯ãšã§ã™ã€‚
+ (数字をタイプã—ã¦ã„ã‚‹ã¨ãã«ã¯ç”»é¢ã«è¡¨ç¤ºã•ã‚Œã¾ã›ã‚“)
+
+ 4. 自信ãŒæŒã¦ãŸã‚‰ã‚¹ãƒ†ãƒƒãƒ— 1 ã‹ã‚‰ 3 を実行ã—ã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 4.2: 検索コマンド
+
+
+ ** 語å¥ã‚’検索ã™ã‚‹ã«ã¯ / ã¨ã€å‰æ–¹æ¤œç´¢ã™ã‚‹èªžå¥ã‚’タイプã—ã¾ã™ã€‚**
+
+ 1. ノーマルモード㧠/ ã¨ã„ã†æ–‡å­—をタイプã—ã¾ã™ã€‚ç”»é¢ä¸€ç•ªä¸‹ã« : コマンド
+ ã¨åŒã˜æ§˜ã« / ãŒç¾ã‚Œã‚‹ã“ã¨ã«æ°—ã¥ãã§ã—ょã†ã€‚
+
+ 2. ã§ã¯ã€'errroor' <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚ã“ã‚ŒãŒæ¤œç´¢ã—ãŸã„å˜èªžã§ã™ã€‚
+
+ 3. åŒã˜èªžã‚’ã‚‚ã†ä¸€åº¦æ¤œç´¢ã™ã‚‹ã¨ã㯠å˜ã« n をタイプã—ã¾ã™ã€‚
+ 逆方å‘ã«èªžå¥ã‚’検索ã™ã‚‹ã¨ã㯠N をタイプã—ã¾ã™ã€‚
+
+ 4. 逆方å‘ã«èªžå¥ã‚’検索ã—ãŸã„å ´åˆã¯ã€/ コマンドã®ã‹ã‚ã‚Šã« ? コマンドを使用ã—
+ ã¾ã™ã€‚
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+検索ãŒãƒ•ã‚¡ã‚¤ãƒ«ã®çµ‚ã‚ã‚Šã«é”ã™ã‚‹ã¨ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®å…ˆé ­ã‹ã‚‰æ¤œç´¢ã‚’続行ã—ã¾ã™ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 4.3: 対応ã™ã‚‹æ‹¬å¼§ã‚’検索
+
+
+ ** 対応ã™ã‚‹ ),] ã‚„ } を検索ã™ã‚‹ã«ã¯ % をタイプã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã§ (,[ ã‹ { ã®ã©ã‚Œã‹ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動
+ ã—ã¾ã—ょã†ã€‚
+
+ 2. ãã“㧠% ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+
+ 3. カーソルã¯å¯¾å¿œã™ã‚‹æ‹¬å¼§ã«ç§»å‹•ã™ã‚‹ã¯ãšã§ã™ã€‚
+
+ 4. 最åˆã®æ‹¬å¼§ã«ç§»å‹•ã™ã‚‹ã«ã¯ % ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+NOTE: ã“ã®æ©Ÿèƒ½ã¯æ‹¬å¼§ãŒä¸€è‡´ã—ã¦ã„ãªã„プログラムをデãƒãƒƒã‚°ã™ã‚‹ã®ã«ã¨ã¦ã‚‚役立ã¡
+ ã¾ã™ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 4.4: é–“é•ã„を変更ã™ã‚‹æ–¹æ³•
+
+
+ ** 'old' ã‚’ 'new' ã«ç½®æ›ã™ã‚‹ã«ã¯ :s/old/new/g ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. :s/thee/the <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚ã“ã®ã‚³ãƒžãƒ³ãƒ‰ã¯ãã®è¡Œã§æœ€åˆã«è¦‹
+ ã¤ã‹ã£ãŸã‚‚ã®ã«ã ã‘è¡Œãªã‚れるã“ã¨ã«æ°—ã‚’ã¤ã‘ã¾ã—ょã†ã€‚
+
+ 3. ã§ã¯ :s/thee/the/g ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚行全体を置æ›ã™ã‚‹ã“ã¨ã‚’æ„味ã—ã¾ã™ã€‚
+ ã“ã®å¤‰æ›´ã¯ãã®è¡Œã§è¦‹ã¤ã‹ã£ãŸå…¨ã¦ã®ç®‡æ‰€ã«å¯¾ã—ã¦è¡Œãªã‚ã‚Œã¾ã™ã€‚
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. 複数行ã‹ã‚‰è¦‹ã¤ã‹ã‚‹æ–‡å­—を変更ã™ã‚‹ã«ã¯
+ :#,#s/old/new/g #,# ã¯ï¼’è¡Œã®è¡Œç•ªå·ã‚’指ã—ã¾ã™ã€‚
+ :%s/old/new/g ファイル全体ã§è¦‹ã¤ã‹ã‚‹ã‚‚ã®ã«å¯¾ã—ã¦å¤‰æ›´ã™ã‚‹ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 4 è¦ç´„
+
+
+ 1. Ctrl-g ã¯ãƒ•ã‚¡ã‚¤ãƒ«ã§ã®ä½ç½®ã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®è©³ç´°ã‚’表示ã—ã¾ã™ã€‚
+ Shift-G ã¯ãƒ•ã‚¡ã‚¤ãƒ«ã®æœ€ä¸‹è¡Œã«ç§»å‹•ã—ã¾ã™ã€‚行番å·å¾Œã« Shift-G ã¨ã™ã‚‹ã¨
+ ãã®è¡Œã«ç§»å‹•ã—ã¾ã™ã€‚
+
+ 2. / ã®å¾Œã«èªžå¥ã‚’タイプã™ã‚‹ã¨å‰æ–¹ã«èªžå¥ã‚’検索ã—ã¾ã™ã€‚
+ ? ã®å¾Œã«èªžå¥ã‚’タイプã™ã‚‹ã¨å¾Œæ–¹ã«èªžå¥ã‚’検索ã—ã¾ã™ã€‚
+ 検索ã®å¾Œ n ã§ã€åŒæ–¹å‘ã«æ¤œç´¢ã‚’å†ã³è¡Œã„ã€ã¾ãŸ N ã§é€†æ–¹å‘ã«æ¤œç´¢ã‚’è¡Œãªã„ã¾
+ ã™ã€‚
+
+ 3. (,),[,],{, or } 上ã«ã‚«ãƒ¼ã‚½ãƒ«ãŒã‚る状態㧠% をタイプã™ã‚‹ã¨
+ 対応ã—ãŸå¯¾ã«ç§»å‹•ã—ã¾ã™ã€‚
+
+ 4. ç¾åœ¨è¡Œã®æœ€åˆã® old ã‚’ new ã«ç½®æ›ã™ã‚‹ã€‚ :s/old/new
+ ç¾åœ¨è¡Œã®å…¨ã¦ã® old ã‚’ new ã«ç½®æ›ã™ã‚‹ã€‚ :s/old/new/g
+ 2ã¤ã® # é–“ã§èªžå¥ã‚’ç½®æ›ã™ã‚‹ã€‚ :#,#s/old/new/g
+ ファイルã®ä¸­ã®å…¨ã¦ã®æ¤œç´¢èªžå¥ã‚’ç½®æ›ã™ã‚‹ã€‚ :%s/old/new/g
+ 'c' を加ãˆã‚‹ã¨ç½®æ›ã®åº¦ã«ç¢ºèªã‚’求ã‚る。 :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 5.1: 外部コマンドを実行ã™ã‚‹æ–¹æ³•
+
+
+ ** :! ã®å¾Œã«å®Ÿè¡Œã™ã‚‹å¤–部コマンドをタイプã—ã¾ã™ **
+
+ 1. ç”»é¢ã®æœ€ä¸‹éƒ¨ã«ã‚«ãƒ¼ã‚½ãƒ«ãŒç§»å‹•ã™ã‚‹ã‚ˆã†ã€æ…£ã‚Œè¦ªã—ã‚“ã  : をタイプã—ã¾ã—ょã†ã€‚
+ ã“ã‚Œã§ã‚³ãƒžãƒ³ãƒ‰ãŒã‚¿ã‚¤ãƒ—ã§ãる様ã«ãªã‚Šã¾ã™ã€‚
+
+ 2. ã“ã“㧠! ã¨ã„ã†æ–‡å­—(感嘆符)をタイプã—ã¾ã—ょã†ã€‚
+ ã“ã‚Œã§å¤–部シェルコマンドãŒå®Ÿè¡Œã§ãる様ã«ãªã‚Šã¾ã™ã€‚
+
+ 3. 例ã¨ã—㦠! ã«ç¶šã‘㦠ls ã¨ã‚¿ã‚¤ãƒ—ã— <ENTER> を押ã—ã¾ã—ょã†ã€‚
+ シェルプロンプトã®ã‚ˆã†ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸€è¦§ãŒè¡¨ç¤ºã•ã‚Œã‚‹ã¯ãšã§ã™ã€‚
+ ã‚‚ã—ã㯠ls ãŒå‹•ã‹ãªã„ãªã‚‰ã° :!dir を使用ã—ã¾ã—ょã†ã€‚
+
+---> NOTE: ã“ã®æ–¹æ³•ã«ã‚ˆã£ã¦ã‚らゆるコマンドãŒå®Ÿè¡Œã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
+
+---> NOTE: å…¨ã¦ã® : コマンド㯠<ENTER> を押ã—ã¦çµ‚了ã—ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 5.2: ãã®ä»–ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¸æ›¸ãè¾¼ã¿
+
+
+ ** ファイルã¸å¤‰æ›´ã‚’ä¿å­˜ã™ã‚‹ã«ã¯ :w ファイルå ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. ディレクトリã®ä¸€è¦§ã‚’å¾—ã‚‹ãŸã‚ã« :!dir ã‚‚ã—ã㯠:!ls ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+ ã“ã®ã‚㨠<ENTER> を押ã™ã®ã¯æ—¢ã«ã”存知ã§ã™ã­ã€‚
+
+ 2. TEST ã®ã‚ˆã†ã«ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ç„¡ã„ファイルåを一ã¤é¸ã³ã¾ã™ã€‚
+
+ 3. ã§ã¯ :w TEST ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょㆠ(TEST ã¯ã€é¸ã‚“ã ãƒ•ã‚¡ã‚¤ãƒ«åã§ã™)。
+
+ 4. ã“ã‚Œã«ã‚ˆã‚Šãƒ•ã‚¡ã‚¤ãƒ«å…¨ä½“㌠TEST ã¨ã„ã†åå‰ã§ä¿å­˜ã•ã‚Œã¾ã™ã€‚
+ ã‚‚ã†ä¸€åº¦ :!dir ã¨ã‚¿ã‚¤ãƒ—ã—ã¦ç¢ºèªã—ã¦ã¿ã¾ã—ょã†ã€‚
+
+---> ã“ã“㧠Vim を終了ã—ã€ãƒ•ã‚¡ã‚¤ãƒ«å TEST ã¨å…±ã«èµ·å‹•ã™ã‚‹ã¨ã€ä¿å­˜ã—ãŸæ™‚ã®
+ ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã®è¤‡è£½ãŒã§ã上ãŒã‚‹ã¯ãšã§ã™ã€‚
+
+ 5. ã§ã¯ã€ :!del TEST ã¨ã‚¿ã‚¤ãƒ—ã—ã¦ãƒ•ã‚¡ã‚¤ãƒ«ã‚’削除ã—ã¦ã¿ã¾ã—ょã†ã€‚
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 5.3: é¸æŠžã—ãŸæ›¸ãè¾¼ã¿
+
+
+ ** 部分的ã«ä¿å­˜ã™ã‚‹ã«ã¯ :#,# w ファイルå ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. ã‚‚ã†ä¸€åº¦ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ä¸€è¦§ã‚’å–å¾—ã™ã‚‹ãŸã‚ã« :!ls ã¨ã‚¿ã‚¤ãƒ—ã—ã€TEST ã®æ§˜ã«
+ ファイルを一ã¤é¸ã‚“ã§ã¿ã¾ã—ょã†ã€‚
+
+ 2. ã“ã®ãƒšãƒ¼ã‚¸ã®å§‹ã‚ã¾ã§ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®è¡Œæ•°ã‚’知るãŸã‚ã« Ctrl-g ã¨
+ タイプã—ã¾ã—ょã†ã€‚ãã®è¡Œç•ªå·ã‚’憶ãˆã¦ãŠãã¾ã—ょã†ã€‚
+
+ 3. ãã—ã¦ãƒšãƒ¼ã‚¸ã®çµ‚ã‚Šã¾ã§ç§»å‹•ã—ã€å†åº¦ Ctrl-g ã‚’è¡Œã„ã¾ã™ã€‚
+ ã“ã®è¡Œç•ªå·ã‚‚憶ãˆã¦ãŠãã¾ã—ょã†ã€‚
+
+ 4. ã‚る部分ã ã‘ã‚’ TEST ã¨ã„ã†åã§ä¿å­˜ã™ã‚‹ãŸã‚ã«ã€:#,# w TEST ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+ ã“ã® #,# ã¯è¦šãˆã¦ãŠã„ãŸï¼’ã¤ã®ç•ªå·(上端,下端) ã§ã‚り〠TEST ãŒãƒ•ã‚¡ã‚¤ãƒ«å
+ ã¨ãªã‚Šã¾ã™ã€‚
+
+ 5. å†åº¦ã€ãƒ•ã‚¡ã‚¤ãƒ«ãŒå­˜åœ¨ã™ã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãŸã‚ã« :!dir ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょã†ã€‚
+ ãŸã ã—ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ã¯æ¶ˆã—ã¦ã¯ã„ã‘ã¾ã›ã‚“。
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 5.4: ファイルã®å–è¾¼ã¨åˆä½µ
+
+
+ ** ファイルã®ä¸­èº«ã‚’挿入ã™ã‚‹ã«ã¯ :r ファイルå ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. å…ˆã»ã©ã® TEST ã¨ã„ã†ãƒ•ã‚¡ã‚¤ãƒ«ãŒå­˜åœ¨ã™ã‚‹ã“ã¨ã‚’確ã‹ã‚ã‚‹ãŸã‚ã« :!dir ã¨
+ タイプã—ã¾ã—ょã†ã€‚
+
+ 2. カーソルをã“ã®ãƒšãƒ¼ã‚¸ã®å…ˆé ­ã«ç§»å‹•ã—ã¾ã™ã€‚
+
+NOTE: ステップ 3 を実行ã™ã‚‹ã¨ã€ç”»é¢ã« レッスン 5.3 ãŒç¾ã‚れるã®ã§ã€ã‚«ãƒ¼ã‚½ãƒ«ã‚’
+ 下ã«ç§»å‹•ã—ã“ã®ãƒ¬ãƒƒã‚¹ãƒ³ã¾ã§æˆ»ã‚Šã¾ã—ょã†ã€‚
+
+ 3. ã§ã¯ã€:r TEST ã¨ã‚¿ã‚¤ãƒ—ã—㦠TEST ファイルをå–è¾¼ã¿ã¾ã—ょã†ã€‚ã“ã® TEST ã¯
+ ファイルåã§ã™ã€‚
+
+NOTE: ファイルã®å–è¾¼ã¿ã¯ã‚«ãƒ¼ã‚½ãƒ«ã®ä½ç½®ã‹ã‚‰è¡Œã‚ã‚Œã¾ã™ã€‚
+
+ 4. å–込んã ãƒ•ã‚¡ã‚¤ãƒ«ã‚’確èªã—ã¦ã¿ã¾ã—ょã†ã€‚カーソルを戻ã™ã¨ã€ãƒ¬ãƒƒã‚¹ãƒ³5.3 ã®
+ オリジナルã¨ãƒ•ã‚¡ã‚¤ãƒ«ã«ã‚ˆã‚‹ã‚‚ã®ã®2ã¤ãŒã‚ã‚‹ã“ã¨ãŒã‚ã‹ã‚Šã¾ã™ã€‚
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 5 è¦ç´„
+
+
+ 1. :!command ã«ã‚ˆã£ã¦ 外部コマンドを実行ã—ã¾ã™ã€‚
+
+ よã使ã†ä¾‹:
+ :!ls - ディレクトリã®ãƒ•ã‚¡ã‚¤ãƒ«ä¸€è¦§ã‚’見る。
+ :!del ファイルå - ファイルåã¨ã„ã†ãƒ•ã‚¡ã‚¤ãƒ«ã®å‰Šé™¤ã™ã‚‹ã€‚
+
+ 2. :w ファイルå ã«ã‚ˆã£ã¦ãƒ•ã‚¡ã‚¤ãƒ«åã¨ã„ã†ãƒ•ã‚¡ã‚¤ãƒ«ãŒãƒ‡ã‚£ã‚¹ã‚¯ã«æ›¸ãè¾¼ã¾ã‚Œã‚‹ã€‚
+
+ 3. :#,# w ファイルå ã«ã‚ˆã£ã¦ # ã‹ã‚‰ # ã¾ã§ã‚’ä¿å­˜ã™ã‚‹ã€‚
+
+ 4. :r ファイルå ã«ã‚ˆã‚Šãƒ•ã‚¡ã‚¤ãƒ«åã¨ã„ã†ãƒ•ã‚¡ã‚¤ãƒ«ãŒãƒ‡ã‚£ã‚¹ã‚¯ã‚ˆã‚Šå–è¾¼ã¾ã‚Œã€
+ カーソルä½ç½®ã®ä¸‹ã«æŒ¿å…¥ã•ã‚Œã‚‹ã€‚
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 6.1: オープンコマンド
+
+
+ ** o をタイプã™ã‚‹ã¨ã€ã‚«ãƒ¼ã‚½ãƒ«ã®ä¸‹ã®è¡ŒãŒé–‹ãã€æŒ¿å…¥ãƒ¢ãƒ¼ãƒ‰ã«å…¥ã‚Šã¾ã™ **
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. o (å°æ–‡å­—) をタイプã—ã¦ã€ã‚«ãƒ¼ã‚½ãƒ«ã®ä¸‹ã®è¡Œã‚’é–‹ãã€æŒ¿å…¥ãƒ¢ãƒ¼ãƒ‰ã«å…¥ã‚Šã¾ã™ã€‚
+
+ 3. ---> ã¨è¨˜ã•ã‚ŒãŸè¡Œã‚’写ã—ã€<ESC> ã¨ã‚¿ã‚¤ãƒ—ã—ã¦è¿½åŠ ãƒ¢ãƒ¼ãƒ‰ã‚’終了ã—ã¾ã—ょã†ã€‚
+
+---> o をタイプã™ã‚‹ã¨ã‚«ãƒ¼ã‚½ãƒ«ã¯é–‹ã„ãŸè¡Œã¸ç§»å‹•ã—挿入モードã«å…¥ã‚Šã¾ã™ã€‚
+
+ 4. カーソルã®ä¸Šã®è¡Œã«æŒ¿å…¥ã™ã‚‹ã«ã¯ã€å°æ–‡å­—ã® o ã§ã¯ãªãã€å˜ç´”ã«å¤§æ–‡å­—ã® O
+ をタイプã—ã¾ã™ã€‚次ã®è¡Œã§è©¦ã—ã¦ã¿ã¾ã—ょã†ã€‚
+ã“ã®è¡Œã®ä¸Šã¸æŒ¿å…¥ã™ã‚‹ã«ã¯ã€ã“ã®è¡Œã¸ã‚«ãƒ¼ã‚½ãƒ«ã‚’ç½®ã„㦠Shift-O をタイプã—ã¾ã™ã€‚
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 6.2: 追加コマンド
+
+
+ ** カーソルã®æ¬¡ã®ä½ç½®ã‹ã‚‰ãƒ†ã‚­ã‚¹ãƒˆã‚’追加ã™ã‚‹ã«ã¯ a ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ **
+
+ 1. ノーマルモードã«ã—ã¦ä»¥ä¸‹ã® ---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸæœ€åˆã®è¡Œã§ $ をタイプã—
+ ã¦ã€çµ‚端ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. カーソルã®æ–‡å­—ã®å¾Œã‚ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’追加ã™ã‚‹ãŸã‚ã« a (å°æ–‡å­—) をタイプã—ã¾
+ ã™ã€‚
+
+NOTE: ã“ã‚Œã¯æœ€å¾Œã®æ–‡å­—ã«ã¦ãƒ†ã‚­ã‚¹ãƒˆã‚’挿入ã—ã€<ESC> をタイプã—ã¦ã‚«ãƒ¼ã‚½ãƒ«ã‚’å³ã«
+ 移動ã—ã€æœ€å¾Œã« x タイプã—ã¦è¡Œæœ«ã«è¿½åŠ ã™ã‚‹ã¨ã„ã£ãŸã‚ˆã†ãª i ã®ã‚¿ã‚¤ãƒ—ã‚’
+ é¿ã‘ã‚‹ã“ã¨ãŒãã¾ã™ã€‚
+
+ 3. ã•ã¦æœ€åˆã®è¡Œã‚’完æˆã—ã¾ã—ょã†ã€‚テキストãŒæŒ¿å…¥ã•ã‚Œã‚‹ä½ç½®ã‚’除ã‘ã°ã€
+ 追加コマンドã¯æŒ¿å…¥ãƒ¢ãƒ¼ãƒ‰ã¨ã¾ã£ãŸãåŒã˜ã§ã™ã€‚
+
+---> ã“ã®è¡Œã§ã€è¡Œæœ«ã«æ–‡ç« ã‚’追加ã™ã‚‹
+---> ã“ã®è¡Œã§ã€è¡Œæœ«ã«æ–‡ç« ã‚’追加ã™ã‚‹ç·´ç¿’ã‚’ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã§ã—ょã†ã€‚
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 6.3: ãã®ä»–ã®ç½®æ›
+
+
+ ** 1文字以上を置ãæ›ãˆã‚‹ã«ã¯å¤§æ–‡å­—ã® R ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã—ょㆠ**
+
+ 1. 以下㮠---> ã¨è¨˜ã•ã‚ŒãŸã•ã‚ŒãŸè¡Œã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+
+ 2. ---> ã¨è¨˜ã•ã‚ŒãŸï¼’行目ã¨é•ã†ã€æœ€åˆã®å˜èªžã®å…ˆé ­ã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’移動ã—ã¾ã—ょã†ã€‚
+ (å˜èªž 'last')
+
+ 3. ã“ã“㧠R をタイプã—ã¦ã€æœ€åˆã®è¡Œã¨æ¬¡ã®è¡ŒãŒåŒã˜ã«ãªã‚‹ã‚ˆã†ã«æ—¢å­˜ã®ãƒ†ã‚­ã‚¹ãƒˆ
+ ã¸ä¸Šæ›¸ãタイプã—ã€ï¼‘行目ã®æ®‹ã‚Šã®éƒ¨åˆ†ã‚’書ãæ›ãˆã¾ã—ょã†ã€‚
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. モードを抜ã‘ã‚‹ãŸã‚ã« <ESC> をタイプã™ã‚‹ã¨ã€å¤‰æ›´ã—ã¦ã„ãªã„部分ãŒæ®‹ã‚‹ã“ã¨
+ ã«æ³¨æ„ã—ã¾ã—ょã†ã€‚
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 6.4: オプションã®è¨­å®š
+
+
+ ** 検索や置æ›ã®éš›ã«å¤§æ–‡å­—ã¨å°æ–‡å­—を無視ã™ã‚‹æ§˜ã«ã‚ªãƒ—ションを設定ã—ã¾ã™ **
+
+
+ 1. 以下ã®æ§˜ã«ã‚¿ã‚¤ãƒ—ã—㦠'ignore' を検索ã—ã¾ã—ょã†:
+ /ignore
+ n を押ã—ã¦ä½•åº¦ã‹æ¤œç´¢ã‚’ç¹°ã‚Šè¿”ã—ã¾ã™ã€‚
+
+ 2. 以下ã®æ§˜ã«ã‚¿ã‚¤ãƒ—ã—㦠'ic' (Ignore Case ã®ç•¥ã§ã™) オプションを設定ã—ã¾ã™ã€‚
+ :set ic
+
+ 3. ã§ã¯ n ã«ã‚ˆã£ã¦ã‚‚ã†1度 'ignore' を検索ã—ã¾ã™ã€‚
+ n を押ã—ã¦ã•ã‚‰ã«æ•°å›žæ¤œç´¢ã‚’ç¹°ã‚Šè¿”ã—ã¾ã—ょã†ã€‚
+
+ 4. 'hlsearch' 㨠'incsearch' オプションを以下ã®æ§˜ã«è¨­å®šã—ã¾ã—ょã†ã€‚
+ :set hls is
+
+ 5. ã‚‚ã†ä¸€åº¦æ¤œç´¢ã‚³ãƒžãƒ³ãƒ‰ã‚’入力ã—ã¦ã€ä½•ãŒèµ·ã“ã‚‹ã‹è¦‹ã¦ã¿ã¾ã—ょã†:
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 6 è¦ç´„
+
+
+ 1. o をタイプã™ã‚‹ã¨ã‚«ãƒ¼ã‚½ãƒ«ã®ä¸‹ã®è¡Œã‚’é–‹ã‘ã¦ã€ãã“ã§æŒ¿å…¥ãƒ¢ãƒ¼ãƒ‰ã«ãªã‚‹ã€‚
+ O (大文字) をタイプã™ã‚‹ã¨ã‚«ãƒ¼ã‚½ãƒ«ã®ä¸Šã®è¡Œã§æŒ¿å…¥ãƒ¢ãƒ¼ãƒ‰ã«ãªã‚‹ã€‚
+
+ 2. カーソル上ã®æ–‡å­—ã®æ¬¡ã‹ã‚‰ãƒ†ã‚­ã‚¹ãƒˆã‚’追加ã™ã‚‹ã«ã¯ a ã¨ã‚¿ã‚¤ãƒ—ã™ã‚‹ã€‚
+ 行末ã«è‡ªå‹•ã§ãƒ†ã‚­ã‚¹ãƒˆã‚’挿入ã™ã‚‹ã«ã¯å¤§æ–‡å­— A をタイプã™ã‚‹ã€‚
+
+ 3. 大文字㮠R をタイプã™ã‚‹ã¨ç½®æ›ãƒ¢ãƒ¼ãƒ‰ã«å…¥ã‚Šã€<ESC>を押ã™ã¨æŠœã‘る。
+
+ 4. ":set xxx" ã¨ã‚¿ã‚¤ãƒ—ã™ã‚‹ã¨ã‚ªãƒ—ション "xxx" ãŒè¨­å®šã•ã‚Œã‚‹ã€‚
+
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 7: オンラインヘルプコマンド
+
+ ** オンラインヘルプを使用ã—ã¾ã—ょㆠ**
+
+ Vim ã«ã¯åºƒç¯„ã«ã‚ãŸã‚‹ã‚ªãƒ³ãƒ©ã‚¤ãƒ³ãƒ˜ãƒ«ãƒ—システムãŒã‚ã‚Šã¾ã™ã€‚
+ ヘルプを開始ã™ã‚‹ã«ã¯ã€ã“れら3ã¤ã®ã©ã‚Œã‹1ã¤ã‚’試ã—ã¦ã¿ã¾ã—ょã†:
+ - ヘルプキー <HELP> を押ã™(ã‚‚ã—ã‚ã‚‹ãªã‚‰ã°)。
+ - <F1> キーを押ã™(ã‚‚ã—ã‚ã‚‹ãªã‚‰ã°)。
+ - :help <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã™ã‚‹ã€‚
+
+ ヘルプウィンドウを閉ã˜ã‚‹ã«ã¯ :q <ENTER> ã¨ã‚¿ã‚¤ãƒ—ã—ã¾ã™ã€‚
+
+ ":help" コマンドã«å¼•æ•°ã‚’与ãˆã‚‹ã“ã¨ã«ã‚ˆã‚Šã€ã‚らゆる題åã®ãƒ˜ãƒ«ãƒ—を見ã¤ã‘ã‚‹
+ ã“ã¨ãŒã§ãã¾ã™ã€‚ã“れらを試ã—ã¦ã¿ã¾ã—ょã†(<ENTER> をタイプã—忘れãªã„よã†ã«):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ レッスン 8: 起動スクリプトã®ä½œæˆ
+
+ ** Vim ã®ç‰¹å¾´ã‚’発æ®ã™ã‚‹ **
+
+ Vim ã«ã¯ Vi よりも多ãã®ç‰¹å¾´ã‚’è¸ã¾ãˆã¦ã„ã¾ãŒã€ãã®ã»ã¨ã‚“ã©ã¯åˆæœŸçŠ¶æ…‹ã«ã¦
+ 使用ä¸å¯ã¨ãªã£ã¦ã„ã¾ã™ã€‚より多ãã®ç‰¹å¾´ã‚’使ã„ã¯ã˜ã‚ã‚‹ã«ã¯ "vimrc" ファイル
+ を作æˆã—ã¾ã™ã€‚
+
+ 1. "vimrc" ファイルã®ç·¨é›†ã‚’開始ã™ã‚‹ã€‚ã“ã‚Œã¯ã‚·ã‚¹ãƒ†ãƒ ã«ä¾å­˜ã—ã¾ã™ã€‚
+ :edit ~/.vimrc UNIX å‘ã‘
+ :edit $VIM/_vimrc MS-Windows å‘ã‘
+
+ 2. ã“ã“ã§ã‚µãƒ³ãƒ—ル㮠"vimrc" を読ã¿è¾¼ã¿ã¾ã™ã€‚
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. 以下ã®ã‚ˆã†ã«ãƒ•ã‚¡ã‚¤ãƒ«ã¸æ›¸ãè¾¼ã¿ã¾ã™ã€‚
+
+ :write
+
+ 次回 Vim ã‚’èµ·å‹•ã™ã‚‹ã¨ã€è‰²ã¥ã‘構文ãŒä½¿ãˆã‚‹ã‚ˆã†ã«ãªã‚‹ã§ã—ょã†ã€‚
+ ã“ã® "vimrc" ファイルã¸ã€ãŠå¥½ã¿ã®è¨­å®šã‚’追加ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ã“ã‚Œã«ã¦ Vim ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã‚’終ã‚ã‚Šã¾ã™ã€‚エディタを簡å˜ã«ã€ã—ã‹ã‚‚充分ã«
+ 使ã†ã“ã¨ãŒã§ãるよã†ã«ã¨ã€Vim ã®æŒã¤æ¦‚念ã®è¦ç‚¹ã®ã¿ã‚’ä¼ãˆã‚ˆã†ã¨ã—ã¾ã—ãŸã€‚
+ Vim ã«ã¯ã•ã‚‰ã«å¤šãã®ã‚³ãƒžãƒ³ãƒ‰ãŒã‚ã‚Šã€ã“ã“ã§å…¨ã¦ã‚’説明ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。
+ 以é™ã¯ãƒ¦ãƒ¼ã‚¶ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ã‚’å‚ç…§ãã ã•ã„: "help :user-manual"
+
+ ã“れ以後ã®å­¦ç¿’ã®ãŸã‚ã«ã€æ¬¡ã®æœ¬ã‚’推薦ã—ã¾ã™ã€‚
+ Vim - Vi Improved - by Steve Oualline
+ 出版社: New Riders
+ 最åˆã®æœ¬ã¯å®Œå…¨ã« Vim ã®ãŸã‚ã«æ›¸ã‹ã‚Œã¾ã—ãŸã€‚ã¨ã‚Šã‚ã‘åˆå¿ƒè€…ã«ã¯ãŠå¥¨ã‚ã§ã™ã€‚
+ 多ãã®ä¾‹é¡Œã‚„図版ãŒæŽ²è¼‰ã•ã‚Œã¦ã„ã¾ã™ã€‚
+ 次ã®URLã‚’å‚ç…§ã—ã¦ä¸‹ã•ã„ http://iccf-holland.org/click5.html
+
+ 次㯠Vim よりも Vi ã«ã¤ã„ã¦æ›¸ã‹ã‚ŒãŸå¤ã„本ã§ã™ãŒæŽ¨è–¦ã—ã¾ã™:
+ Learning the Vi Editor - by Linda Lamb
+ 出版社: O'Reilly & Associates Inc.
+ Vi ã§ã‚„ã‚ŠãŸã„ã¨æ€ã†ã“ã¨ã»ã¼å…¨ã¦ã‚’知るã“ã¨ãŒã§ãる良書ã§ã™ã€‚
+ 第6版ã§ã¯ã€Vim ã«ã¤ã„ã¦ã®æƒ…報もå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚
+
+ ã“ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã¯ Colorado State University ã® Charles Smith ã®ã‚¢ã‚¤ãƒ‡ã‚¢
+ を基ã«ã€Colorado School of Mines ã® Michael C. Pierce 㨠Robert K. Ware ã®
+ 両åã«ã‚ˆã£ã¦æ›¸ã‹ã‚Œã¾ã—ãŸã€‚ E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+ 日本語訳 æ¾æœ¬æ³°å¼˜ E-mail:mattn@mail.goo.ne.jp
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ vi:set ts=8 sts=4 sw=4 tw=76:
diff --git a/runtime/tutor/tutor.ko.euc b/runtime/tutor/tutor.ko.euc
new file mode 100644
index 000000000..ddfc5ac81
--- /dev/null
+++ b/runtime/tutor/tutor.ko.euc
@@ -0,0 +1,812 @@
+===============================================================================
+= ºö ±æÀâÀÌ (VIM Tutor) ¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù - Version 1.5 =
+===============================================================================
+
+ ºö(Vim)Àº ÀÌ ±æÀâÀÌ¿¡¼­ ´Ù ¼³¸íÇÒ ¼ö ¾øÀ» ¸¸Å­ ¸¹Àº ¸í·ÉÀ» °¡Áø
+ ¸Å¿ì °­·ÂÇÑ ÆíÁý±âÀÔ´Ï´Ù. ÀÌ ±æÀâÀÌ´Â ºöÀ» ½±°Ô ÀüõÈÄ ÆíÁý±â·Î »ç¿ëÇÒ
+ ¼ö ÀÖµµ·Ï ÃæºÐÇÑ ¸í·É¿¡ ´ëÇØ ¼³¸íÇÏ°í ÀÖ½À´Ï´Ù.
+
+ ÀÌ ±æÀâÀ̸¦ ¶¼´Â µ¥¿¡´Â ½Ç½ÀÇÏ´Â µ¥¿¡ ¾ó¸¶³ª ½Ã°£À» ¾²´Â °¡¿¡ µû¶ó¼­
+ 25-30 ºÐ Á¤µµ°¡ °É¸³´Ï´Ù.
+
+ ÀÌ ¿¬½À¿¡ Æ÷ÇÔµÈ ¸í·ÉÀº ³»¿ëÀ» °íĨ´Ï´Ù. ÀÌ ÆÄÀÏÀÇ º¹»çº»À» ¸¸µé¾î¼­
+ ¿¬½ÀÇϼ¼¿ä. (vimtutor ¸¦ ÅëÇØ ½ÃÀÛÇß´Ù¸é, ÀÌ¹Ì º¹»çº»À» »ç¿ëÇÏ´Â
+ ÁßÀÔ´Ï´Ù.)
+
+ Áß¿äÇÑ °ÍÀº, ÀÌ ±æÀâÀÌ°¡ Á÷Á¢ ½áº¸¸é¼­ ¹è¿ìµµ·Ï °í·ÁµÇ¾î ÀÖ´Ù´Â °ÍÀÔ´Ï´Ù.
+ ¸í·ÉÀ» Á¦´ë·Î ÀÍÈ÷·Á¸é, Á÷Á¢ ½ÇÇàÇغ¸´Â °ÍÀÌ ÇÊ¿äÇÕ´Ï´Ù. ³»¿ëÀ» ÀдÂ
+ °Í¸¸À¸·Î´Â, ¸í·ÉÀ» Àؾî¹ö¸®°Ô µÉ °ÍÀÔ´Ï´Ù.
+
+ ÀÚ ÀÌÁ¦, Caps Lock(Shift-Lock) Å°°¡ ´­·ÁÀÖÁö ¾ÊÀºÁö È®ÀÎÇغ¸½Ã°í, j Å°¸¦
+ ÃæºÐÈ÷ ´­·¯¼­ Lesson 1.1ÀÌ È­¸é¿¡ °¡µæ Â÷µµ·Ï ¿òÁ÷¿©º¾½Ã´Ù.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.1: Ä¿¼­ ¿òÁ÷À̱â
+
+ ** Ä¿¼­¸¦ ¿òÁ÷ÀÌ·Á¸é, Ç¥½ÃµÈ ´ë·Î h,j,k,l Å°¸¦ ´©¸£½Ê½Ã¿À. **
+ ^
+ k ÈùÆ®: h Å°´Â ¿ÞÂÊ¿¡ ÀÖÀ¸¸ç, ¿ÞÂÊÀ¸·Î ¿òÁ÷ÀÔ´Ï´Ù.
+ < h l > l Å°´Â ¿À¸¥ÂÊ¿¡ ÀÖÀ¸¸ç, ¿À¸¥ÂÊÀ¸·Î
+ j ¿òÁ÷ÀÔ´Ï´Ù.
+ v j Å°´Â ¾Æ·¡¹æÇâ È­»ìǥó·³ »ý°å½À´Ï´Ù.
+
+ 1. Àͼ÷ÇØÁú ¶§±îÁö Ä¿¼­¸¦ ½ºÅ©¸° »ó¿¡¼­ ¿òÁ÷¿© º¸½Ê½Ã¿À.
+
+ 2. ¾Æ·¡ ¹æÇâÅ° (j)¸¦ ¹Ýº¹ÀÔ·ÂÀÌ µÉ ¶§±îÁö ´©¸£°í °è½Ê½Ã¿À.
+---> ÀÌÁ¦ ´ÙÀ½ lessonÀ¸·Î °¡´Â ¹æ¹ýÀ» ¾Ë°Ô µÇ¾ú½À´Ï´Ù.
+
+ 3. ¾Æ·¡ ¹æÇâÅ°¸¦ ÀÌ¿ëÇÏ¿©, Lesson 1.2 ·Î °¡½Ê½Ã¿À.
+
+Âü°í: ¿øÇÏÁö ¾Ê´Â ¹«¾ð°¡°¡ ÀÔ·ÂÀÌ µÇ¾ú´Ù¸é, <ESC>¸¦ ´­·¯¼­, ¸í·É ¸ðµå·Î
+ µ¹¾Æ°¡½Ê½Ã¿À. ±× ÈÄ¿¡ ¿øÇÏ´Â ¸í·ÉÀ» ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ.
+
+Âü°í: Ä¿¼­Å° ¶ÇÇÑ ÀÛµ¿ÇÒ °ÍÀÔ´Ï´Ù. ÇÏÁö¸¸ hjkl¿¡ Àͼ÷ÇØÁö¸é, Ä¿¼­Å°º¸´Ù
+ ÈξÀ ºü¸£°Ô À̵¿ÇÒ ¼ö ÀÖÀ» °ÍÀÔ´Ï´Ù.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.2: ºöÀ» ½ÃÀÛÇÏ°í ³¡³»±â
+
+
+ !! ÁÖÀÇ: ¾Æ·¡ ÀÖ´Â ´Ü°è¸¦ ½ÇÇàÇϱâ Àü¿¡, ÀÌ lesson Àüü¸¦ ÀÐÀ¸½Ê½Ã¿À!!
+
+ 1. <ESC> Å°¸¦ ´­·¯¼­ È®½ÇÇÏ°Ô ¸í·É ¸ðµå·Î ºüÁ® ³ª¿É´Ï´Ù.
+
+ 2. ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù: :q! <ENTER>
+
+---> ÀÌ·¸°Ô Çϸé, ¹Ù²ï ³»¿ëÀ» *ÀúÀåÇÏÁö ¾Ê°í* ÆíÁý±â¸¦ ºüÁ®³ª°©´Ï´Ù.
+ ÀúÀåÇÑ ÈÄ ºüÁ®³ª°¡·Á¸é ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù:
+ :wq <ENTER>
+
+ 3. ½© ÇÁ·ÒÇÁÆ®°¡ º¸Àδٸé, ´Ù½Ã ±æÀâÀÌ·Î µ¹¾Æ¿À±â À§ÇØ ´ÙÀ½°ú °°ÀÌ
+ ÀÔ·ÂÇÕ´Ï´Ù.
+ vimtutor <ENTER>
+ ¶Ç´Â ´ÙÀ½°ú °°À» ¼öµµ ÀÖ½À´Ï´Ù.
+ vim tutor.ko <ENTER>
+
+---> 'vim' Àº ºö ÆíÁý±â·Î µé¾î°¡´Â °ÍÀ» ¶æÇϸç, 'tutor.ko'´Â ÆíÁýÇÏ·Á´Â
+ ÆÄÀÏÀ» ¶æÇÕ´Ï´Ù.
+
+ 4. À§¿¡¼­ À̾߱âÇÑ ´Ü°è¸¦ ±â¾ïÇÏ¿´À¸¸ç, È®½ÅÀÌ ¼­¸é, 1¿¡¼­ 3±îÁö¸¦
+ ¼öÇàÇÏ¿© ÆíÁý±â¸¦ ³ª°¬´Ù°¡ ´Ù½Ã µé¾î¿Íº¸½Ê½Ã¿À. ±× ÈÄ Ä¿¼­¸¦ ¾Æ·¡·Î
+ ¿òÁ÷¿© Lesson 1.3 À¸·Î °¡½Ê½Ã¿À.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.3: ÅؽºÆ® ÆíÁý - Áö¿ì±â
+
+
+** ¸í·É ¸ðµå¿¡¼­ x ¸¦ ´©¸£¸é Ä¿¼­°¡ À§Ä¡ÇÑ °÷ÀÇ ±ÛÀÚ¸¦ Áö¿ï ¼ö ÀÖ½À´Ï´Ù. **
+
+ 1. ----> ·Î Ç¥½ÃµÈ °÷À¸·Î Ä¿¼­¸¦ ¿Å°Üº¸½Ê½Ã¿À.
+
+ 2. ¿ÀŸ¸¦ ¼öÁ¤Çϱâ À§ÇØ, Ä¿¼­¸¦ Áö¿ï ±ÛÀÚ À§·Î ¿òÁ÷¿© º¸½Ê½Ã¿À.
+
+ 3. x Å°¸¦ ´­·¯¼­ Áö¿ö¾ßÇÒ ±ÛÀÚ¸¦ Áö¿ì½Ê½Ã¿À.
+
+ 4. 2¿¡¼­ 4±îÁö¸¦ ¹Ýº¹ÇÏ¿© ¹®ÀåÀÌ ¿Ã¹Ù¸£°Ô µÇµµ·Ï ÇÏ¿© º¸½Ê½Ã¿À.
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. ¹®ÀåÀÌ Á¤È®ÇØÁ³´Ù¸é, Lesson 1.4·Î °¡½Ê½Ã¿À.
+
+ÁÖÀÇ: ÀÌ ±æÀâÀ̸¦ º¸¸é¼­ ¿Ü¿ì·Á°í ÇÏÁö¸»°í, Á÷Á¢ »ç¿ëÇغ¸¸é¼­ ÀÍÈ÷±æ
+ ¹Ù¶ø´Ï´Ù.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.4: ÅؽºÆ® ÆíÁý - »ðÀÔ (INSERTION)
+
+
+ ** ¸í·É ¸ðµå¿¡¼­ i ¸¦ ´©¸£¸é ÅؽºÆ®¸¦ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ù¹ø° ---> ·Î Ç¥½ÃµÈ ÁÙ·Î ¿òÁ÷ÀÔ´Ï´Ù.
+
+ 2. ù¹ø° ÁÙÀ» µÎ¹ø° ÁÙ°ú ¶È°°ÀÌ ¸¸µé°ÍÀÔ´Ï´Ù. ÅؽºÆ®°¡ µé¾î°¡¾ßÇÒ
+ °÷ ´ÙÀ½ºÎÅÍ Ã¹¹ø° ±ÛÀÚ À§¿¡ Ä¿¼­¸¦ ¿Å°Ü ³õ½À´Ï´Ù.
+
+ 3. i Å°¸¦ ´©¸¥ ÈÄ, ÇÊ¿äÇÑ ³»¿ëÀ» ÀÔ·ÂÇÕ´Ï´Ù.
+
+ 4. ¼öÁ¤ÇÑ ÈÄ¿¡´Â <ESC> ¸¦ ´­·¯¼­ ¸í·É ¸ðµå·Î µ¹¾Æ°©´Ï´Ù.
+ ¹®ÀåÀ» ¿Ã¹Ù¸£°Ô ¸¸µé±â À§ÇØ 2¿¡¼­ 4ÀÇ °úÁ¤À» ¹Ýº¹ÇÕ´Ï´Ù.
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. ÅؽºÆ®¸¦ »ðÀÔÇÏ´Â µ¥¿¡ Àͼ÷ÇØÁ³´Ù¸é, ¿ä¾àÀ» ºÁÁֽʽÿÀ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 1 ¿ä¾à
+
+
+ 1. Ä¿¼­¸¦ ¿òÁ÷ÀÏ ¶§¿¡´Â È­»ìÇ¥ Å°³ª hjkl Å°¸¦ ÀÌ¿ëÇÕ´Ï´Ù.
+ h (¿ÞÂÊ) j (¾Æ·¡) k (À§) l (¿À¸¥ÂÊ)
+
+ 2. ½© ÇÁ·ÒÇÁÆ®¿¡¼­ ºöÀ» ½ÃÀÛÇÏ·Á¸é vim FILENAME <ENTER>
+
+ 3. ¼öÁ¤ÇÑ ³»¿ëÀ» ¹«½ÃÇÑ Ã¤·Î ºö¿¡¼­ ºüÁ®³ª°¡·Á¸é <ESC> :q! <ENTER>
+ ÀúÀåÇÑ ÈÄ ºö¿¡¼­ ºüÁ®³ª°¡·Á¸é <ESC> :wq <ENTER>
+
+ 4. ¸í·É ¸ðµå¿¡¼­ Ä¿¼­°¡ À§Ä¡ÇÑ °÷ÀÇ ±ÛÀÚ¸¦ Áö¿ì·Á¸é x ¸¦ ÀÔ·ÂÇÕ´Ï´Ù.
+
+ 5. ¸í·É ¸ðµå¿¡¼­ Ä¿¼­°¡ À§Ä¡ÇÑ °÷¿¡ ÅؽºÆ®¸¦ »ðÀÔÇÏ·Á¸é
+ i ¸¦ ´©¸¥ ÈÄ ÅؽºÆ®¸¦ ÀÔ·ÂÇÏ°í <ESC> ¸¦ ´©¸¨´Ï´Ù.
+
+Âü°í: <ESC>´Â ¸í·É ¸ðµå·Î µ¹¾Æ°¡´Â µ¥ ¾²¸ç, ¿øÄ¡ ¾Ê´Â ¸í·ÉÀ̳ª ¿ÏÀüÈ÷ ÀԷµÇÁö
+ ¾ÊÀº ¸í·ÉÀ» Ãë¼ÒÇÏ´Â µ¥¿¡µµ ¾¹´Ï´Ù.
+
+±×·³ Lesson 2¸¦ ½ÃÀÛÇսôÙ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.1: »èÁ¦(DELETION) ¸í·É
+
+
+ ** ÇÑ ´Ü¾î¸¦ ³¡±îÁö Áö¿ì·Á¸é dw ¶ó°í Ä¡¸é µË´Ï´Ù. **
+
+ 1. <ESC> Å°¸¦ ´­·¯¼­ È®½ÇÇÏ°Ô ¸í·É ¸ðµå·Î ºüÁ® ³ª¿É´Ï´Ù.
+
+ 2. ¾Æ·¡¿¡ ---> ·Î Ç¥½ÃµÈ ÁÙ ±îÁö Ä¿¼­¸¦ ¿Å±é´Ï´Ù.
+
+ 3. Áö¿ö¾ßÇÒ ´Ü¾îÀÇ Ã³À½À¸·Î Ä¿¼­¸¦ ¿Å±é´Ï´Ù.
+
+ 4. dw ¶ó°í Ãļ­ ±× ´Ü¾î¸¦ Áö¿ó´Ï´Ù.
+
+ ÁÖÀÇ: À§¿¡¼­ ¸»ÇÑ´ë·Î Çϸé È­¸éÀÇ ¸¶Áö¸· ÁÙ¿¡ dw ¶ó´Â ±ÛÀÚ°¡ Ç¥½ÃµË´Ï´Ù.
+ À߸ø ÃÆ´Ù¸é, <ESC> ¸¦ ´­·¯¼­ ´Ù½Ã ½ÃÀÛÇϽʽÿÀ.
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. 3, 4¹ø °úÁ¤À» ´Ù½Ã ÇÏ¿© ¹®ÀåÀ» Á¤È®ÇÏ°Ô ¸¸µç µÚ Lesson 2.2·Î °¡½Ê½Ã¿À.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.2: ´Ù¸¥ »èÁ¦ ¸í·É
+
+ ** d$ ¶ó°í Ä¡¸é ±× ÁÙ ³¡±îÁö Áö¿öÁý´Ï´Ù. **
+
+ 1. <ESC> Å°¸¦ ´­·¯¼­ È®½ÇÇÏ°Ô ¸í·É ¸ðµå·Î ºüÁ® ³ª¿É´Ï´Ù.
+
+ 2. ¾Æ·¡¿¡ ---> ·Î Ç¥½ÃµÈ ÁÙ ±îÁö Ä¿¼­¸¦ ¿Å±é´Ï´Ù.
+
+ 3. ¿Ã¹Ù¸¥ ÁÙÀÇ ³¡À¸·Î Ä¿¼­¸¦ ¿Å±é´Ï´Ù. (ù¹ø°·Î ³ª¿À´Â . ´ÙÀ½ÀÔ´Ï´Ù.)
+
+ 4. d$ ¶ó°í Ãļ­ ÁÙ ³¡±îÁö Áö¿ó´Ï´Ù.
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+
+ 5. ¾î¶² ÀÏÀÌ ÀϾ´ÂÁö ÀÌÇØÇϱâ À§ÇØ Lesson 2.3 À¸·Î °¡½Ê½Ã¿À.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: ¸í·É°ú Àû¿ë ´ë»ó¿¡ ´ëÇØ
+
+
+ »èÁ¦ ¸í·É dÀÇ Çü½ÄÀº ´ÙÀ½°ú °°½À´Ï´Ù.
+
+ [Ƚ¼ö] d ´ë»ó ¶Ç´Â d [Ƚ¼ö] ´ë»ó
+ ¿©±â¼­
+ Ƚ¼ö - ¸í·ÉÀ» ¸î ¹ø ¼öÇàÇÒ Áö (¿É¼Ç, ±âº»°ª=1).
+ d - Áö¿ì´Â ¸í·É
+ ´ë»ó - ¾Æ·¡¿¡ Á¦½ÃµÈ ´ë»ó¿¡ ´ëÇØ ¸í·ÉÀ» ¼öÇà
+
+ Àû¿ë °¡´ÉÇÑ ´ë»óÀÇ Á¾·ù:
+ w - Ä¿¼­¿¡¼­ ±× ´Ü¾îÀÇ ³¡±îÁö (°ø¹é Æ÷ÇÔ.)
+ e - Ä¿¼­¿¡¼­ ±× ´Ü¾îÀÇ ³¡±îÁö (°ø¹éÀ» Æ÷ÇÔÇÏÁö ¾ÊÀ½.)
+ $ - Ä¿¼­¿¡¼­ ±× ÁÙÀÇ ³¡±îÁö
+
+Âü°í: È£±â½ÉÀÌ ÀÖ´Ù¸é, ¸í·É ¸ðµå¿¡¼­ ¸í·É ¾øÀÌ ´ë»óÀ» ÀÔ·ÂÇغ¸½Ê½Ã¿À.
+ À§¿¡¼­ À̾߱âÇÑ ´ë»óÀÇ ¸ñ·Ï¿¡ µû¶ó Ä¿¼­°¡ ¿òÁ÷ÀÌ°Ô µË´Ï´Ù.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.4: '¸í·É-´ë»ó' ¿¡ ´ëÇÑ ¿¹¿Ü
+
+
+ ** dd ¶ó°í Ä¡¸é ÁÙ Àüü¸¦ Áö¿ó´Ï´Ù. **
+
+ ÁÙ Àüü¸¦ Áö¿ì´Â ÀÏÀÌ Àæ±â ¶§¹®¿¡, Vi¸¦ µðÀÚÀÎ ÇÑ »ç¶÷µéÀº, °£´ÜÈ÷ d¸¦
+ µÎ¹ø ¿¬´Þ¾Æ Ä¡¸é ÇÑ ÁÙÀ» Áö¿ï ¼ö ÀÖµµ·Ï ÇÏ¿´½À´Ï´Ù.
+
+ 1. Ä¿¼­¸¦ ¾Æ·¡ ³ª¿Â ´Ü¶ôÀÇ µÎ¹ø° ÁÙ·Î °¡Á®°¡½Ê½Ã¿À.
+ 2. dd ¸¦ ÀÔ·ÂÇÏ¿© ±× ÁÙÀ» Áö¿ì½Ê½Ã¿À.
+ 3. ±×·± ´ÙÀ½ ³×¹ø° ÁÙ·Î °¡½Ê½Ã¿À.
+ 4. 2dd ¶ó°í ÀÔ·ÂÇÏ¿© µÎÁÙÀ» Áö¿ó´Ï´Ù. ( Ƚ¼ö-¸í·É-´ë»óÀ» ±â¾ïÇϼ¼¿ä. )
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.5: Ãë¼Ò(UNDO) ¸í·É
+
+
+ ** u ¸¦ ´©¸£¸é ¸¶Áö¸· ¸í·ÉÀÌ Ãë¼ÒµÇ¸ç, U ´Â ÁÙ Àüü¸¦ ¼öÁ¤ÇÕ´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ÁÙ·Î À̵¿ÇÑ ÈÄ Ã¹¹ø° À߸øµÈ ºÎºÐ À§·Î ¿Å±é´Ï´Ù.
+ 2. x ¸¦ ÀÔ·ÂÇÏ¿© ù¹ø° À߸øµÈ ±ÛÀÚ¸¦ Áö¿ó´Ï´Ù.
+ 3. ±×·³ ÀÌÁ¦ u ¸¦ ÀÔ·ÂÇÏ¿© ¸¶Áö¸·À¸·Î ¼öÇàµÈ ¸í·ÉÀ» Ãë¼ÒÇÕ´Ï´Ù.
+ 4. À̹ø¿¡´Â x ¸í·ÉÀ» ÀÌ¿ëÇÏ¿© ±× ÁÙÀÇ ¸ðµç ¿¡·¯¸¦ ¼öÁ¤Çغ¾½Ã´Ù.
+ 5. ´ë¹®ÀÚ U ¸¦ ´­·¯¼­ ±× ÁÙÀ» ¿ø·¡ »óÅ·Πµ¹·Á³õ¾Æ º¸½Ê½Ã¿À.
+ 6. À̹ø¿¡´Â u ¸¦ ¸î ¹ø ´­·¯¼­ U ¿Í ÀÌÀü ¸í·ÉÀ» Ãë¼ÒÇغ¾½Ã´Ù.
+ 7. CTRL-R (CTRL Å°¸¦ ´©¸¥ »óÅ¿¡¼­ RÀ» ´©¸£´Â °Í) À» ¸î ¹ø ´­·¯¼­
+ ¸í·ÉÀ» ´Ù½Ã ½ÇÇàÇغ¾½Ã´Ù. (Ãë¼ÒÇÑ °ÍÀ» Ãë¼ÒÇÔ.)
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. ÀÌ ¸í·ÉÀº ¸Å¿ì À¯¿ëÇÕ´Ï´Ù. ±×·³ Lesson 2 ¿ä¾àÀ¸·Î ³Ñ¾î°¡µµ·Ï ÇսôÙ.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 2 ¿ä¾à
+
+
+ 1. Ä¿¼­°¡ À§Ä¡ÇÑ °÷ºÎÅÍ ´Ü¾îÀÇ ³¡±îÁö Áö¿ì·Á¸é: dw
+
+ 2. Ä¿¼­°¡ À§Ä¡ÇÑ °÷ºÎÅÍ ÁÙ ³¡±îÁö Áö¿ì·Á¸é: d$
+
+ 3. ÁÙ Àüü¸¦ Áö¿ì·Á¸é: dd
+
+ 4. ¸í·É ¸ðµå¿¡¼­ ³»¸®´Â ¸í·ÉÀÇ Çü½ÄÀº ´ÙÀ½°ú °°½À´Ï´Ù:
+
+ [Ƚ¼ö] ¸í·É ´ë»ó ¶Ç´Â ¸í·É [Ƚ¼ö] ´ë»ó
+ ¿©±â¼­:
+ Ƚ¼ö - ±× ¸í·ÉÀ» ¸î ¹ø ¹Ýº¹ÇÒ °ÍÀΰ¡
+ ¸í·É - ¾î¶² ¸í·ÉÀ» ³»¸± °ÍÀΰ¡ ( ¿¹¸¦ µé¾î, »èÁ¦ÀÎ °æ¿ì´Â d )
+ ´ë»ó - ¸í·ÉÀÌ µ¿ÀÛÇÒ ´ë»ó, ¿¹¸¦ µé¾î w (´Ü¾î), $ (ÁÙÀÇ ³¡) µî.
+
+ 5. ÀÌÀü ÇൿÀ» Ãë¼ÒÇÏ·Á¸é: u (¼Ò¹®ÀÚ u)
+ ÇÑ ÁÙ¿¡¼­ ¼öÁ¤ÇÑ °ÍÀ» ¸ðµÎ Ãë¼ÒÇÏ·Á¸é: U (´ë¹®ÀÚ U)
+ Ãë¼ÒÇÑ °ÍÀ» ´Ù½Ã ½ÇÇàÇÏ·Á¸é: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.1: ºÙÀ̱â(PUT) ¸í·É
+
+
+ ** p ¸¦ ÀÔ·ÂÇÏ¿© ¸¶Áö¸·À¸·Î Áö¿î ³»¿ëÀ» Ä¿¼­ µÚ¿¡ ºÙÀÔ´Ï´Ù. **
+
+ 1. ¾Æ·¡¿¡ ÀÖ´Â ¹®´ÜÀÇ Ã¹ ÁÙ·Î Ä¿¼­¸¦ ¿òÁ÷À̽ʽÿÀ.
+
+ 2. dd ¸¦ ÀÔ·ÂÇÏ¿© ±× ÁÙÀ» Áö¿ö¼­ ºöÀÇ ¹öÆÛ¿¡ ÀúÀåÇÕ´Ï´Ù.
+
+ 3. ¾Æ±î Áö¿î ÁÙÀÌ °¡¾ßÇÒ À§Ä¡ÀÇ *À­ÁÙ·Î* Ä¿¼­¸¦ ¿Å±é´Ï´Ù.
+
+ 4. ¸í·É ¸ðµå¿¡¼­, p ¸¦ ÀÔ·ÂÇÏ¿© ±× ÁÙÀ» Á¦´ë·Î µÈ ÀÚ¸®·Î ¿Å±é´Ï´Ù.
+
+ 5. 2¿¡¼­ 4¸¦ ¹Ýº¹ÇÏ¿© ¸ðµç ÁÙÀÇ ¼ø¼­¸¦ ¹Ù·Î ÀâÀ¸½Ê½Ã¿À.
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.2: ġȯ(REPLACE) ¸í·É
+
+
+ ** Ä¿¼­ ¾Æ·¡ÀÇ ±ÛÀÚ Çϳª¸¦ ¹Ù²Ù·Á¸é, r À» ´©¸¥ ÈÄ ¹Ù²Ü ±ÛÀÚ¸¦ ÀÔ·ÂÇÕ´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ù ÁÙ·Î ¿Å±é´Ï´Ù.
+
+ 2. Ä¿¼­¸¦ À߸øµÈ ù ºÎºÐÀ¸·Î ¿Å±é´Ï´Ù.
+
+ 3. r À» ´©¸¥ ÈÄ, À߸øµÈ ºÎºÐÀ» °íÃÄ ¾µ ±ÛÀÚ¸¦ ÀÔ·ÂÇÕ´Ï´Ù.
+
+ 4. 2¿¡¼­ 3ÀÇ °úÁ¤À» ¹Ýº¹ÇÏ¿©, ù ÁÙÀÇ ¿À·ù¸¦ ¼öÁ¤ÇϽʽÿÀ.
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. Lesson 3.2 ·Î À̵¿ÇսôÙ.
+
+ÁÖÀÇ: ¿Ü¿ìÁö ¸»°í, Á÷Á¢ Çغ¸¸é¼­ ÀÍÇô¾ß ÇÑ´Ù´Â °ÍÀ» ÀØÁö ¸¶½Ê½Ã¿À.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.3: º¯È¯(CHANGE) ¸í·É
+
+
+ ** ÇÑ ´Ü¾îÀÇ ÀϺγª Àüü¸¦ ¹Ù²Ù·Á¸é, cw ¸¦ Ä¡½Ê½Ã¿À. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ùÁÙ·Î ¿Å±é´Ï´Ù.
+
+ 2. Ä¿¼­¸¦ lubw ¿¡¼­ u À§¿¡ ¿Ã·Á³õ½À´Ï´Ù.
+
+ 3. cw ¶ó°í ¸í·ÉÇÑ ÈÄ ´Ü¾î¸¦ Á¤È®ÇÏ°Ô ¼öÁ¤ÇÕ´Ï´Ù. (ÀÌ °æ¿ì, 'ine' ¸¦ Ĩ´Ï´Ù.)
+
+ 4. <ESC> ¸¦ ´©¸¥ ÈÄ ´ÙÀ½ ¿¡·¯·Î °©´Ï´Ù (¼öÁ¤µÇ¾î¾ßÇÒ Ã¹ ±ÛÀÚ·Î °©´Ï´Ù.)
+
+ 5. 3¿¡¼­ 4ÀÇ °úÁ¤À» ¹Ýº¹ÇÏ¿© ù¹ø° ¹®ÀåÀ» µÎ¹ø° ¹®Àå°ú °°µµ·Ï ¸¸µì´Ï´Ù.
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+cw ´Â ´Ü¾î¸¦ ġȯÇÏ´Â °Í »Ó¸¸ ¾Æ´Ï¶ó, ³»¿ëÀ» »ðÀÔÇÒ ¼ö ÀÖµµ·Ï ÇÑ´Ù´Â °Í¿¡
+ÁÖÀÇÇսôÙ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.4: c ¸¦ ÀÌ¿ëÇÑ ´Ù¸¥ º¯È¯ ¸í·É
+
+
+ ** º¯È¯ ¸í·ÉÀº »èÁ¦ÇÒ ¶§ ÀÌ¿ëÇÑ ´ë»ó¿¡ ´ëÇØ Àû¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. **
+
+ 1. º¯È¯ ¸í·ÉÀº »èÁ¦¿Í µ¿ÀÏÇÑ ¹æ½ÄÀ¸·Î µ¿ÀÛÇÕ´Ï´Ù. Çü½ÄÀº ´ÙÀ½°ú °°½À´Ï´Ù:
+
+ [Ƚ¼ö] c ´ë»ó ¶Ç´Â c [Ƚ¼ö] ´ë»ó
+
+ 2. Àû¿ë °¡´ÉÇÑ ´ë»ó ¿ª½Ã °°½À´Ï´Ù. w (´Ü¾î), $ (ÁÙÀÇ ³¡) µîÀÌ ÀÖ½À´Ï´Ù.
+
+ 3. ---> ·Î Ç¥½ÃµÈ ùÁÙ·Î À̵¿ÇÕ´Ï´Ù.
+
+ 4. ù ¿¡·¯ À§·Î Ä¿¼­¸¦ ¿Å±é´Ï´Ù.
+
+ 5. c$ ¸¦ ÀÔ·ÂÇÏ¿©, ±× ÁÙÀÇ ³ª¸ÓÁö°¡ µÎ¹ø° ÁÙó·³ µÇµµ·Ï ¼öÁ¤ÇÑ ÈÄ <ESC> ¸¦
+ ´©¸£½Ê½Ã¿À.
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 3 ¿ä¾à
+
+
+ 1. ÀÌ¹Ì Áö¿î ³»¿ëÀ» µÇµ¹¸®·Á¸é, p ¸¦ ´©¸£½Ê½Ã¿À. ÀÌ ¸í·ÉÀº Ä¿¼­ *´ÙÀ½¿¡*
+ Áö¿öÁø ³»¿ëÀ» ºÙÀÔ´Ï´Ù(PUT). (ÇÑ ÁÙÀ» Áö¿î °æ¿ì¿¡´Â Ä¿¼­ ´ÙÀ½ ÁÙ¿¡
+ Áö¿öÁø ³»¿ëÀÌ ºÙ½À´Ï´Ù.)
+
+ 2. Ä¿¼­ ¾Æ·¡ÀÇ ±ÛÀÚ¸¦ ġȯÇÏ·Á¸é(REPLACE), r À» ´©¸¥ ÈÄ ¿ø·¡ ±ÛÀÚ ´ë½Å
+ ¹Ù²Ù¾î ³ÖÀ» ±ÛÀÚ¸¦ ÀÔ·ÂÇÕ´Ï´Ù.
+
+ 3. º¯È¯ ¸í·É(CHANGE)Àº Ä¿¼­¿¡¼­ ºÎÅÍ ÁöÁ¤ÇÑ ´ë»óÀÇ ³¡±îÁö ¹Ù²Ü ¼ö ÀÖ´Â
+ ¸í·ÉÀÔ´Ï´Ù. ¿¹¸¦ µé¾î, Ä¿¼­ À§Ä¡¿¡¼­ ´Ü¾îÀÇ ³¡±îÁö ¹Ù²Ù·Á¸é, cw ¸¦
+ ÀÔ·ÂÇÏ¸é µÇ¸ç, c$ ´Â ÁÙ ³¡±îÁö ¹Ù²Ù´Â µ¥ ¾²ÀÔ´Ï´Ù.
+
+ 4. º¯È¯ ¸í·ÉÀÇ Çü½ÄÀº ´ÙÀ½°ú °°½À´Ï´Ù:
+
+ [Ƚ¼ö] c ´ë»ó ¶Ç´Â c [Ƚ¼ö] ´ë»ó
+
+°è¼ÓÇؼ­ ´ÙÀ½ Lesson À» ÁøÇàÇսôÙ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.1: À§Ä¡¿Í ÆÄÀÏÀÇ »óÅÂ
+
+
+ ** CTRL-g ¸¦ ´©¸£¸é ÆÄÀÏ ³»¿¡¼­ÀÇ ÇöÀç À§Ä¡¿Í ÆÄÀÏÀÇ »óŸ¦ º¼ ¼ö ÀÖ½À´Ï´Ù.
+ SHIFT-G ¸¦ ´©¸£¸é ÆÄÀÏ ³»ÀÇ ÁÙ·Î À̵¿ÇÕ´Ï´Ù. **
+
+ ÁÖÀÇ: ¾Æ·¡ÀÇ ´Ü°è¸¦ µû¶óÇϱâ Àü¿¡, ÀÌ Lesson Àüü¸¦ ¸ÕÀú ÀÐÀ¸½Ê½Ã¿À.
+
+ 1. CTRL Å°¸¦ ´©¸¥ »óÅ¿¡¼­ g ¸¦ ´©¸¨´Ï´Ù. ÆÄÀÏ À̸§°ú ÇöÀç À§Ä¡ÇÑ ÁÙÀÌ
+ Ç¥½ÃµÈ »óÅÂÁÙÀÌ È­¸é ¾Æ·¡¿¡ Ç¥½ÃµÉ °ÍÀÔ´Ï´Ù. 3¹ø° ´Ü°è¸¦ À§ÇØ ±×
+ ÁÙ ¹øÈ£¸¦ ±â¾ïÇÏ°í °è½Ê½Ã¿À.
+
+ 2. SHIFT-G ¸¦ ´©¸£¸é ÆÄÀÏÀÇ ¸¶Áö¸·À¸·Î À̵¿ÇÕ´Ï´Ù.
+
+ 3. ¾Æ±î ±â¾ïÇß´ø ÁÙ ¹øÈ£¸¦ ÀÔ·ÂÇÑ ÈÄ SHIFT-G ¸¦ ´©¸£½Ê½Ã¿À. ÀÌ·¸°Ô Çϸé
+ óÀ½¿¡ CTRL-g ¸¦ ´­·¶´ø Àå¼Ò·Î µÇµ¹¾Æ°¡°Ô µÉ °ÍÀÔ´Ï´Ù.
+ (¹øÈ£¸¦ ÀÔ·ÂÇÒ ¶§, ÀÌ°ÍÀº È­¸é¿¡ Ç¥½ÃµÇÁö ¾Ê½À´Ï´Ù.)
+
+ 4. ÀÚ½ÅÀÌ »ý°å´Ù¸é, 1¿¡¼­ 3±îÁö¸¦ ½ÇÇàÇغ¸½Ê½Ã¿À.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.2: ã±â ¸í·É
+
+
+ ** / ¸¦ ´©¸¥ ÈÄ °Ë»öÇÒ ¹®±¸¸¦ ÀÔ·ÂÇϽʽÿÀ. **
+
+ 1. ¸í·É ¸ðµå¿¡¼­ / ¸¦ ÀÔ·ÂÇϽʽÿÀ. : ¸í·É¿¡¼­¿Í ¸¶Âù°¡Áö·Î, È­¸é ¾Æ·¡¿¡
+ / ¿Í Ä¿¼­°¡ Ç¥½ÃµÉ °ÍÀÔ´Ï´Ù.
+
+ 2. 'errroor' ¶ó°í Ä£ ÈÄ <ENTER> ¸¦ Ä¡½Ê½Ã¿À. ÀÌ ´Ü¾î¸¦ ãÀ¸·Á°í ÇÕ´Ï´Ù.
+
+ 3. °°Àº ¹®±¸¸¦ ´Ù½Ã ãÀ¸·Á¸é, °£´ÜÈ÷ n À» ÀÔ·ÂÇϽʽÿÀ.
+ °°Àº ¹®±¸¸¦ ¹Ý´ë ¹æÇâÀ¸·Î ãÀ¸·Á¸é, Shift-N À» ÀÔ·ÂÇϽʽÿÀ.
+
+ 4. ¹®±¸¸¦ ¿ª¹æÇâÀ¸·Î ãÀ¸·Á¸é, / ´ë½Å ? ¸¦ ÀÌ¿ëÇÏ¸é µË´Ï´Ù.
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+Âü°í: ã´Â Áß¿¡ ÆÄÀÏÀÇ ³¡¿¡ ´Ù´Ù¸£°Ô µÇ¸é, ÆÄÀÏÀÇ Ã³À½ºÎÅÍ ´Ù½Ã ã°Ô µË´Ï´Ù.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.3: °ýÈ£ÀÇ Â¦ ã±â
+
+
+ ** % ¸¦ ´­·¯¼­ ), ], } ÀÇ Â¦À» ã½À´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ÁÙÀÇ (, [, { Áß Çϳª¿¡ °¡Á®´Ù ³õ½À´Ï´Ù.
+
+ 2. % ¸¦ ÀÔ·ÂÇØ º¾½Ã´Ù.
+
+ 3. Ä¿¼­°¡ ¦ÀÌ ¸Â´Â °ýÈ£·Î À̵¿ÇÒ °ÍÀÔ´Ï´Ù.
+
+ 4. % ¸¦ ÀÔ·ÂÇÏ¿©, ÀÌÀü °ýÈ£·Î µÇµ¹¾Æ ¿É½Ã´Ù.
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+Âü°í: ¦ÀÌ ¸ÂÁö ¾Ê´Â °ýÈ£°¡ ÀÖ´Â ÇÁ·Î±×·¥À» µð¹ö±ëÇÒ ¶§¿¡ ¸Å¿ì À¯¿ëÇÕ´Ï´Ù!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.4: ¿¡·¯¸¦ ¼öÁ¤ÇÏ´Â ¹æ¹ý
+
+
+ ** :s/old/new/g Çϸé 'old' ¸¦ 'new' ·Î ġȯ(SUBTITUTE)ÇÕ´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ÁÙ¿¡ °¡Á®´Ù ³õ½À´Ï´Ù.
+
+ 2. :s/thee/the ¸¦ ÀÔ·ÂÇÑ ÈÄ <ENTER> ¸¦ Ĩ´Ï´Ù. ÀÌ ¸í·ÉÀº ±× ÁÙ¿¡¼­
+ óÀ½À¸·Î ¹ß°ßµÈ °Í¸¸ ¹Ù²Û´Ù´Â °Í¿¡ ÁÖÀÇÇϽʽÿÀ.
+
+ 3. À̹ø¿¡´Â :s/thee/the/g ¸¦ ÀÔ·ÂÇÕ´Ï´Ù. ÀÌ´Â ±× ÁÙ Àüü(globally)¸¦
+ ġȯÇÑ´Ù´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù.
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. µÎ ÁÙ »çÀÌÀÇ ¸ðµç ¹®ÀÚ¿­¿¡ ´ëÇØ Ä¡È¯ÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù,
+ :#,#s/old/new/g #,# ´Â µÎ ÁÙÀÇ ÁÙ¹øÈ£¸¦ ¶æÇÕ´Ï´Ù.
+ :%s/old/new/g ÆÄÀÏ Àüü¿¡¼­ ¹ß°ßµÈ ¸ðµç °ÍÀ» ġȯÇÏ´Â °æ¿ìÀÔ´Ï´Ù.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 4 ¿ä¾à
+
+
+ 1. CTRL-g ´Â ÆÄÀÏÀÇ »óÅÂ¿Í ÆÄÀÏ ³»¿¡¼­ÀÇ ÇöÀç À§Ä¡¸¦ Ç¥½ÃÇÕ´Ï´Ù.
+ SHIFT-G ´Â ÆÄÀÏÀÇ ³¡À¸·Î À̵¿ÇÕ´Ï´Ù. ÁÙ¹øÈ£¸¦ ÀÔ·ÂÇÑ ÈÄ SHIFT-G¸¦
+ ÀÔ·ÂÇϸé, ±× ÁÙ·Î À̵¿ÇÕ´Ï´Ù.
+
+ 2. / ¸¦ ÀÔ·ÂÇÑ ÈÄ ¹®±¸¸¦ ÀÔ·ÂÇÏ¸é ±× ¹®±¸¸¦ ¾Æ·§¹æÇâÀ¸·Î ã½À´Ï´Ù.
+ ? ¸¦ ÀÔ·ÂÇÑ ÈÄ ¹®±¸¸¦ ÀÔ·ÂÇϸé À­¹æÇâÀ¸·Î ã½À´Ï´Ù.
+ °Ë»ö ÈÄ, n À» ÀÔ·ÂÇÏ¸é °°Àº ¹æÇâÀ¸·Î ´ÙÀ½ ¹®±¸¸¦ ãÀ¸¸ç,
+ Shift-N À» ÀÔ·ÂÇÏ¸é ¹Ý´ë ¹æÇâÀ¸·Î ã½À´Ï´Ù.
+
+ 3. Ä¿¼­°¡ (,),[,],{,} À§¿¡ ÀÖÀ» ¶§¿¡ % ¸¦ ÀÔ·ÂÇÏ¸é »óÀÀÇϴ ¦À»
+ ã¾Æ°©´Ï´Ù.
+
+ 4. ¾î¶² ÁÙ¿¡ óÀ½ µîÀåÇÏ´Â old¸¦ new·Î ¹Ù²Ù·Á¸é :s/old/new
+ ÇÑ ÁÙ¿¡ µîÀåÇÏ´Â ¸ðµç old¸¦ new·Î ¹Ù²Ù·Á¸é :s/old/new/g
+ µÎ ÁÙ #,# »çÀÌ¿¡¼­ ġȯÀ» ÇÏ·Á¸é :#,#s/old/new/g
+ ÆÄÀÏ ³»ÀÇ ¸ðµç ¹®±¸¸¦ ġȯÇÏ·Á¸é :%s/old/new/g
+ ¹Ù²Ü ¶§¸¶´Ù È®ÀÎÀ» °ÅÄ¡·Á¸é 'c'¸¦ ºÙ¿©¼­ :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.1: ¿ÜºÎ ¸í·É ½ÇÇàÇÏ´Â ¹æ¹ý
+
+
+ ** :! À» ÀÔ·ÂÇÑ ÈÄ ½ÇÇàÇÏ·Á´Â ¸í·ÉÀ» ÀÔ·ÂÇϽʽÿÀ. **
+
+ 1. Ä£¼÷ÇÑ ¸í·ÉÀÎ : ¸¦ ÀÔ·ÂÇϸé Ä¿¼­°¡ È­¸é ¾Æ·¡·Î À̵¿ÇÕ´Ï´Ù. ¸í·ÉÀ»
+ ÀÔ·ÂÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù.
+
+ 2. ÀÌÁ¦ ! (´À³¦Ç¥) ¸¦ ÀÔ·ÂÇϽʽÿÀ. ÀÌ·¸°Ô ÇÏ¸é ¿ÜºÎ ½© ¸í·ÉÀ» ½ÇÇàÇÒ
+ ¼ö ÀÖ½À´Ï´Ù.
+
+ 3. ½ÃÇè»ï¾Æ ! ´ÙÀ½¿¡ ls ¸¦ ÀÔ·ÂÇÑ ÈÄ <ENTER> ¸¦ Ãĺ¸½Ê½Ã¿À. ½© ÇÁ·ÒÇÁÆ®
+ ¿¡¼­Ã³·³ µð·ºÅ丮ÀÇ ¸ñ·ÏÀÌ Ãâ·ÂµÉ °ÍÀÔ´Ï´Ù. ls °¡ µ¿ÀÛÇÏÁö ¾Ê´Â´Ù¸é
+ :!dir À» ½ÃµµÇØ º¸½Ê½Ã¿À.
+
+Âü°í: ¾î¶² ¿ÜºÎ ¸í·Éµµ ÀÌ ¹æ¹ýÀ¸·Î ½ÇÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.
+
+Âü°í: ¸ðµç : ¸í·ÉÀº <ENTER> ¸¦ ÃÄ¾ß ¸¶¹«¸® µË´Ï´Ù.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.2: º¸´Ù ÀÚ¼¼ÇÑ ÆÄÀÏ ÀúÀå
+
+
+ ** ¼öÁ¤µÈ ³»¿ëÀ» ÆÄÀÏ·Î ÀúÀåÇÏ·Á¸é, :w FILENAME ÇϽʽÿÀ. **
+
+ 1. :!dir ¶Ç´Â :!ls ¸¦ ÀÔ·ÂÇÏ¿© µð·ºÅ丮ÀÇ ¸®½ºÆ®¸¦ ¾ò¾î¿É´Ï´Ù.
+ À§ÀÇ ¸í·É ÈÄ <ENTER>¸¦ ÃľßÇÑ´Ù´Â °ÍÀº ÀÌ¹Ì ¾Ë°í ÀÖÀ» °ÍÀÔ´Ï´Ù.
+
+ 2. TEST ó·³ Á¸ÀçÇÏÁö ¾Ê´Â ÆÄÀÏ À̸§À» Çϳª °í¸£½Ê½Ã¿À.
+
+ 3. ÀÌÁ¦ :w TEST ¶ó°í ÀÔ·ÂÇϽʽÿÀ. (TEST´Â ´ç½ÅÀÌ ¼±ÅÃÇÑ ÆÄÀÏ À̸§ÀÔ´Ï´Ù.)
+
+ 4. ÀÌ·¸°Ô ÇÏ¸é ºö ±æÀâÀÌ ÆÄÀÏ Àüü¸¦ TEST¶ó´Â À̸§À¸·Î ÀúÀåÇÕ´Ï´Ù.
+ È®ÀÎÇÏ·Á¸é, :!dir À» ´Ù½Ã ÀÔ·ÂÇÏ¿©, µð·ºÅ丮¸¦ »ìÆ캸½Ê½Ã¿À.
+
+Âü°í: ºöÀ» Á¾·áÇÑ ÈÄ, ºöÀ» ´Ù½Ã ½ÇÇàÇÏ¿© TEST¶ó´Â ÆÄÀÏÀ» ¿­¸é, ±× ÆÄÀÏÀº
+ ÀúÀåÇßÀ» ¶§¿Í ¿Ïº®È÷ °°Àº º¹»çº»ÀÏ °ÍÀÔ´Ï´Ù.
+
+ 5. ÀÌÁ¦ ±× ÆÄÀÏÀ» Áö¿ó½Ã´Ù.
+ (MS-DOS¿¡¼­): !del TEST
+ (Unix¿¡¼­): !rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.3: ¼±ÅÃÀûÀ¸·Î ÀúÀåÇÏ´Â ¸í·É
+
+
+ ** ÆÄÀÏÀÇ ÀϺθ¦ ÀúÀåÇÏ·Á¸é, :#,# w FILENAME ÇϽʽÿÀ. **
+
+ 1. ´Ù½Ã Çѹø, :!dir À̳ª !ls ¸¦ ÀÔ·ÂÇÏ¿© µð·ºÅ丮ÀÇ ¸ñ·ÏÀ» ¹Þ¾Æ¿Â ÈÄ
+ TEST °°Àº ÀûÇÕÇÑ À̸§À» ¼±ÅÃÇÕ´Ï´Ù.
+
+ 2. Ä¿¼­¸¦ ÀÌ ÆäÀÌÁöÀÇ Ã³À½À¸·Î ¿Å±ä ÈÄ, Ctrl-g ¸¦ ÀÔ·ÂÇÏ¿© ±× ÁÙÀÇ ÁÙ¹øÈ£¸¦
+ ¾Ë¾Æ³À´Ï´Ù. ÀÌ ¹øÈ£¸¦ ±â¾ïÇϽʽÿÀ!
+
+ 3. ÀÌÁ¦ ÀÌ ÆäÀÌÁöÀÇ ¸¶Áö¸·À¸·Î °¡¼­ Ctrl-g ¸¦ ´Ù½Ã ÀÔ·ÂÇϽʽÿÀ. ÀÌ ÁÙÀÇ
+ ÁÙ¹øÈ£ ¶ÇÇÑ ±â¾ïÇϽʽÿÀ!
+
+ 4. ¾î¶² ¼½¼Ç¸¸ ÆÄÀÏ·Î ÀúÀåÇÏ·Á¸é, :#,# w TEST ¸¦ ÀÔ·ÂÇÏ¸é µË´Ï´Ù. ÀÌ ¶§
+ #,# ´Â ¾Æ±î ±â¾ïÇß´ø ½ÃÀÛ°ú ³¡ ÁÙ¹øÈ£ ÀÔ´Ï´Ù. TEST´Â ÆÄÀÏ À̸§ÀÔ´Ï´Ù.
+
+ 5. :!dir À» ÀÌ¿ëÇÏ¿© ÆÄÀÏÀÌ ¸¸µé¾îÁ³´ÂÁö È®ÀÎÇϽʽÿÀ. Áö¿ìÁö´Â ¸¶½Ê½Ã¿À.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.4: ÆÄÀÏ ÀоîµéÀ̱â, ÇÕÄ¡±â
+
+
+ ** ¾î¶² ÆÄÀÏÀÇ ³»¿ëÀ» »ðÀÔÇÏ·Á¸é, :r FILENAME ÇϽʽÿÀ **
+
+ 1. :!dir À» ÀÔ·ÂÇÏ¿© ¾Æ±î ¸¸µç TEST ÆÄÀÏÀÌ ±×´ë·Î ÀÖ´ÂÁö È®ÀÎÇϽʽÿÀ.
+
+ 2. Ä¿¼­¸¦ ÀÌ ÆäÀÌÁöÀÇ Ã³À½À¸·Î ¿òÁ÷À̽ʽÿÀ.
+
+ÁÖÀÇ: 3¹ø° ´Ü°è¸¦ ½ÇÇàÇϸé, Lesson 5.3 À» º¸°Ô µÉ °ÍÀÔ´Ï´Ù. ±×·¸°Ô µÇ¸é
+ ÀÌ lessonÀ¸·Î ´Ù½Ã ³»·Á¿À½Ê½Ã¿À.
+
+ 3. ÀÌÁ¦ TEST ÆÄÀÏÀ» ÀоîµéÀԽôÙ. :r TEST ¸í·ÉÀ» »ç¿ëÇϽʽÿÀ. TEST ´Â
+ ÆÄÀÏÀÇ À̸§ÀÔ´Ï´Ù.
+
+Âü°í: ÀоîµéÀÎ ÆÄÀÏÀº Ä¿¼­°¡ À§Ä¡ÇÑ ÁöÁ¡¿¡¼­ºÎÅÍ ³õÀÌ°Ô µË´Ï´Ù.
+
+ 4. ÆÄÀÏÀÌ Àоîµé¿©Áø °ÍÀ» È®ÀÎÇϱâ À§ÇØ, µÚ·Î À̵¿Çؼ­ ±âÁ¸ ¹öÀü°ú ÆÄÀÏ¿¡¼­
+ ÀоîµéÀÎ ¹öÀü, ÀÌ·¸°Ô Lesson 5.3 ÀÌ µÎ¹ø ¹Ýº¹µÇ¾úÀ½À» È®ÀÎÇϽʽÿÀ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 5 ¿ä¾à
+
+
+ 1. :!command ¸¦ ÀÌ¿ëÇÏ¿© ¿ÜºÎ ¸í·ÉÀ» ½ÇÇàÇÕ´Ï´Ù.
+
+ À¯¿ëÇÑ ¿¹:
+ (MS-DOS) (Unix)
+ :!dir :!ls - µð·ºÅ丮ÀÇ ¸ñ·ÏÀ» º¸¿©ÁØ´Ù.
+ :!del FILENAME :!rm FILENAME - FILENAMEÀ̶ó´Â ÆÄÀÏÀ» Áö¿î´Ù.
+
+ 2. :w FILENAME Çϸé ÇöÀç ºö¿¡¼­ »ç¿ëÇÏ´Â ÆÄÀÏÀ» FILENAMEÀ̶ó´Â À̸§À¸·Î
+ µð½ºÅ©¿¡ ÀúÀåÇÕ´Ï´Ù.
+
+ 3. :#,#w FILENAME Çϸé #ºÎÅÍ #±îÁöÀÇ ÁÙÀ» FILENAMEÀ̶ó´Â ÆÄÀÏ·Î ÀúÀåÇÕ´Ï´Ù.
+
+ 4. :r FILENAME Àº µð½ºÅ©¿¡¼­ FILENAMEÀ̶ó´Â ÆÄÀÏÀ» ºÒ·¯µé¿©¼­ Ä¿¼­ À§Ä¡
+ µÚ¿¡ ÇöÀç ÆÄÀÏÀ» Áý¾î³Ö½À´Ï´Ù.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.1: »õ ÁÙ ¿­±â(OPEN) ¸í·É
+
+
+ ** o ¸¦ ´©¸£¸é Ä¿¼­ ¾Æ·¡¿¡ ÁÙÀ» ¸¸µé°í ÆíÁý ¸ðµå°¡ µË´Ï´Ù. **
+
+ 1. ¾Æ·¡¿¡ ---> ·Î Ç¥½ÃµÈ ÁÙ·Î Ä¿¼­¸¦ ¿Å±â½Ê½Ã¿À.
+
+ 2. o (¼Ò¹®ÀÚ)¸¦ Ãļ­ Ä¿¼­ *¾Æ·¡¿¡* ÁÙÀ» Çϳª ¿©½Ê½Ã¿À. ÆíÁý ¸ðµå°¡ µË´Ï´Ù.
+ Insert mode.
+
+ 3. ---> ·Î Ç¥½ÃµÈ ÁÙÀ» º¹»çÇÑ ÈÄ <ESC> ¸¦ ´­·¯¼­ ÆíÁý ¸ðµå¿¡¼­ ³ª¿À½Ê½Ã¿À.
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. Ä¿¼­ *À§¿¡* ÁÙÀ» Çϳª ¸¸µå·Á¸é, ¼Ò¹®ÀÚ o ´ë½Å ´ë¹®ÀÚ O ¸¦ Ä¡¸é µË´Ï´Ù.
+ ¾Æ·¡ ÀÖ´Â ÁÙ¿¡ ´ëÇØ ÀÌ ¸í·ÉÀ» ³»·Áº¸½Ê½Ã¿À.
+Open up a line above this by typing Shift-O while the cursor is on this line.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.2: Ãß°¡(APPEND) ¸í·É
+
+
+ ** a ¸¦ ´©¸£¸é Ä¿¼­ *´ÙÀ½¿¡* ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ù¹ø° ÁÙÀÇ ³¡À¸·Î ¿Å±é´Ï´Ù. ¸í·É ¸ðµå¿¡¼­
+ $ ¸¦ ÀÌ¿ëÇϽʽÿÀ.
+
+ 2. ¼Ò¹®ÀÚ a ¸¦ Ä¿¼­ ¾Æ·¡ ±ÛÀÚ *´ÙÀ½*¿¡ ±ÛÀ» Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù.
+ (´ë¹®ÀÚ A´Â ±× ÁÙÀÇ ³¡¿¡ Ãß°¡ÇÕ´Ï´Ù.)
+
+Âü°í: ±×·¸°Ô ÇÏ½Ã¸é °íÀÛ ÁÙÀÇ ³¡¿¡ Ãß°¡¸¦ Çϱâ À§ÇØ i¸¦ ´©¸£°í, Ä¿¼­ ¾Æ·¡¿¡
+ ÀÖ´ø ±ÛÀÚ¸¦ ¹Ýº¹ÇÏ°í, ±ÛÀ» ³¢¿ö³Ö°í, <ESC>¸¦ ´­·¯ ¸í·É ¸ðµå·Î µ¹¾Æ¿Í¼­,
+ Ä¿¼­¸¦ ¿À¸¥ÂÊÀ¸·Î ¿Å±â°í ¸¶Áö¸·À¸·Î x±îÁö ´­·¯¾ß ÇÏ´Â ¹ø°Å·Î¿òÀ» ÇÇÇϽÇ
+ ¼ö ÀÖ½À´Ï´Ù.
+
+ 3. ÀÌÁ¦ ù ÁÙÀ» ¿Ï¼ºÇϽʽÿÀ. Ãß°¡ ¸í·ÉÀº ÅؽºÆ®°¡ ÀԷµǴ À§Ä¡ ¿Ü¿¡´Â
+ ÆíÁý ¸ðµå¿Í ¿ÏÀüÈ÷ °°´Ù´Â °ÍÀ» À¯³äÇϽʽÿÀ.
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.3: ġȯ(REPLACE) ÀÇ ´Ù¸¥ ¹öÀü
+
+
+ ** ´ë¹®ÀÚ R À» ÀÔ·ÂÇϸé Çϳª ÀÌ»óÀÇ ±ÛÀÚ¸¦ ¹Ù²Ü ¼ö ÀÖ½À´Ï´Ù. **
+
+ 1. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ ù¹ø° ÁÙ·Î ¿Å±â½Ê½Ã¿À.
+
+ 2. Ä¿¼­¸¦ ---> ·Î Ç¥½ÃµÈ µÎ¹ø° ÁÙ°ú ´Ù¸¥ ù¹ø° ´Ü¾î À§·Î ¿Å±â½Ê½Ã¿À.
+ ('last' ÀÔ´Ï´Ù.)
+
+ 3. R À» ÀÔ·ÂÇÑ ÈÄ Ã¹¹ø° ÁÙÀÇ ¿¹Àü ÅؽºÆ® À§¿¡ »õ·Î¿î ±ÛÀ» ÀÔ·ÂÇÏ¿©
+ ³ª¸ÓÁö ³»¿ëÀÌ µÎ¹ø° ÁÙ°ú °°¾ÆÁöµµ·Ï ¹Ù²ß½Ã´Ù.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. <ESC> ¸¦ ´­·¯¼­ ³ª°¡¸é, ¹Ù²îÁö ¾ÊÀº ÅؽºÆ®´Â ±×´ë·Î ³²°Ô µË´Ï´Ù.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.4: ¿É¼Ç ¼³Á¤(SET)
+
+ ** ã±â³ª ¹Ù²Ù±â¿¡¼­ ´ë¼Ò¹®ÀÚ ±¸ºÐÀ» ¾ø¾Ö±â À§ÇØ ¿É¼ÇÀ» ¼³Á¤ÇÕ´Ï´Ù **
+
+ 1. ´ÙÀ½À» ÀÔ·ÂÇÏ¿© 'ignore' ¸¦ ãÀ¸½Ê½Ã¿À:
+ /ignore
+ n Å°¸¦ ÀÌ¿ëÇÏ¿© ¿©·¯¹ø ¹Ýº¹ÇϽʽÿÀ.
+
+ 2. 'ic' (´ë¼Ò¹®ÀÚ ±¸º° ¾ÈÇÔ, Ignore case) ¿É¼ÇÀ» ¼³Á¤ÇϽʽÿÀ:
+ :set ic
+
+ 3. n Å°¸¦ ´­·¯¼­ 'ignore' ¸¦ ´Ù½Ã ã¾Æº¸½Ê½Ã¿À.
+ n Å°¸¦ °è¼Ó ´­·¯¼­ ¿©·¯¹ø ãÀ¸½Ê½Ã¿À.
+
+ 4. 'hlsearch' ¿Í 'incsearch' ¿É¼ÇÀ» ¼³Á¤ÇսôÙ.
+ :set hls is
+
+ 5. ã±â ¸í·ÉÀ» ´Ù½Ã ÀÔ·ÂÇÏ¿©, ¾î¶² ÀÏÀÌ ÀϾ´ÂÁö È®ÀÎÇØ º¸½Ê½Ã¿À:
+ /ignore
+
+ 6. ãÀº ³»¿ëÀÌ °­Á¶(HIGHLIGHT)µÈ °ÍÀ» ¾ø¾Ö·Á¸é, ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù:
+ :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 6 ¿ä¾à
+
+
+ 1. o ¸¦ ÀÔ·ÂÇϸé Ä¿¼­ *¾Æ·¡¿¡* ÇÑ ÁÙÀÌ ¿­¸®¸ç, Ä¿¼­´Â ÆíÁý ¸ðµå·Î
+ ¿­¸° ÁÙ À§¿¡ À§Ä¡ÇÏ°Ô µË´Ï´Ù.
+ ´ë¹®ÀÚ O ¸¦ ÀÔ·ÂÇϸé Ä¿¼­°¡ ÀÖ´Â ÁÙÀÇ *À§·Î* »õ ÁÙÀ» ¿­°Ô µË´Ï´Ù.
+
+ 2. a ¸¦ ÀÔ·ÂÇϸé Ä¿¼­ *´ÙÀ½¿¡* ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.
+ ´ë¹®ÀÚ A ¸¦ ÀÔ·ÂÇϸé ÀÚµ¿À¸·Î ±× ÁÙÀÇ ³¡¿¡ ±ÛÀÚ¸¦ Ãß°¡ÇÏ°Ô µË´Ï´Ù.
+
+ 3. ´ë¹®ÀÚ R À» ÀÔ·ÂÇϸé <ESC> ¸¦ ´­·¯¼­ ³ª°¡±â Àü±îÁö ¹Ù²Ù±â ¸ðµå°¡ µË´Ï´Ù.
+
+ 4. ":set xxx" ¸¦ Çϸé "xxx" ¿É¼ÇÀÌ ¼³Á¤µË´Ï´Ù.
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 7: ¿Â¶óÀÎ µµ¿ò¸» ¸í·É
+
+
+ ** ¿Â¶óÀÎ µµ¿ò¸» ½Ã½ºÅÛ »ç¿ëÇϱâ **
+
+ ºöÀº Æø ³ÐÀº ¿Â¶óÀÎ µµ¿ò¸» ½Ã½ºÅÛÀ» Á¦°øÇÕ´Ï´Ù. µµ¿ò¸»À» º¸·Á¸é,
+ ´ÙÀ½ ¼¼°¡Áö Áß Çϳª¸¦ ½ÃµµÇغ¸½Ê½Ã¿À:
+ - <HELP> Å°¸¦ ´©¸¥´Ù. (Å°°¡ ÀÖ´Â °æ¿ì)
+ - <F1> Å°¸¦ ´©¸¥´Ù. (Å°°¡ ÀÖ´Â °æ¿ì)
+ - :help <ENTER> ¶ó°í ÀÔ·ÂÇÑ´Ù.
+
+ µµ¿ò¸» âÀ» ´ÝÀ¸·Á¸é :q <ENTER> ¶ó°í ÀÔ·ÂÇϽʽÿÀ.
+
+ ":help" ¶ó´Â ¸í·É¿¡ ÀÎÀÚ¸¦ ÁÖ¸é ¾î¶² ÁÖÁ¦¿¡ °üÇÑ µµ¿ò¸»À» ãÀ» ¼ö ÀÖ½À´Ï´Ù.
+ ´ÙÀ½ ¸í·ÉÀ» ³»·Á º¸½Ê½Ã¿À. ( <ENTER> Å°¸¦ ´©¸£´Â °ÍÀ» ÀØÁö ¸¶½Ê½Ã¿À.)
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 8: ½ÃÀÛ ½ºÅ©¸³Æ® ¸¸µé±â
+
+ ** ºöÀÇ ±â´É Äѱâ **
+
+ ºöÀº Vi º¸´Ù ÈξÀ ¸¹Àº ±â´ÉÀ» °¡Áö°í ÀÖÁö¸¸, ´ëºÎºÐÀº ±âº»ÀûÀ¸·Î ÀÛµ¿ÇÏÁö
+ ¾Ê½À´Ï´Ù. ´õ ¸¹Àº ±â´ÉÀ» ½áº¸·Á¸é, "vimrc" ¶ó´Â ÆÄÀÏÀ» ¸¸µé¾î¾ß ÇÕ´Ï´Ù.
+
+ 1. "vimrc" ÆÄÀÏÀ» ¼öÁ¤ÇսôÙ. ÀÌ ÆÄÀÏÀº »ç¿ëÇÏ´Â ½Ã½ºÅÛ¿¡ µû¶ó ´Ù¸¨´Ï´Ù:
+ 1. Start editing the "vimrc" file, this depends on your system:
+ :edit ~/.vimrc UnixÀÇ °æ¿ì
+ :edit $VIM/_vimrc MS-WindowsÀÇ °æ¿ì
+
+ 2. ÀÌÁ¦ "vimrc"ÀÇ ¿¹Á¦¸¦ ÀоîµéÀÔ´Ï´Ù:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. ´ÙÀ½°ú °°ÀÌ ÇÏ¿© ÆÄÀÏÀ» ÀúÀåÇÕ´Ï´Ù:
+
+ :write
+
+ ´ÙÀ½ ¹ø¿¡ ºöÀ» ½ÃÀÛÇϸé, ±¸¹® °­Á¶(syntax highlighting)ÀÌ »ç¿ëµÉ °ÍÀÔ´Ï´Ù.
+ ¸ðµç ¿øÇÏ´Â ¼³Á¤À» ÀÌ "vimrc" ÆÄÀÏ¿¡ ³Ö¾îµÑ ¼ö ÀÖ½À´Ï´Ù.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ÀÌ°ÍÀ¸·Î ºö ±æÀâÀ̸¦ ¸¶Ä¨´Ï´Ù. ÀÌ ±æÀâÀÌ´Â ºö ÆíÁý±â¿¡ ´ëÇÑ °£·«ÇÑ °³¿ä¸¦
+ º¸¿©ÁÖ±â À§ÇÑ Àǵµ·Î Á¦À۵ǾúÀ¸¸ç, ÀÌ ÆíÁý±â¸¦ Á¤¸» °£´ÜÈ÷ »ç¿ëÇϱ⿡
+ ÃæºÐÇÒ »ÓÀÔ´Ï´Ù. ºö¿¡´Â ÀÌ ±æÀâÀÌ¿Í´Â ºñ±³ÇÒ ¼ö ¾øÀ» ¸¸Å­ ÈξÀ ¸¹Àº ¸í·ÉÀÌ
+ ÀÖ½À´Ï´Ù. ´ÙÀ½ »ç¿ëÀÚ ¸Å´º¾óÀ» ÀÐÀ¸½Ê½Ã¿À: ":help user-manual"
+
+ º¸´Ù ÀÚ¼¼È÷ ÀÐ°í °øºÎÇÏ·Á¸é, ´ÙÀ½ Ã¥À» ÃßõÇØ µå¸³´Ï´Ù:
+ Vim - Vi Improved - by Steve Oualline
+ ÃâÆÇ»ç: New Riders
+ ÀÌ Ã¥Àº ¿ÏÀüÈ÷ ºö¿¡ ´ëÇؼ­¸¸ ´Ù·ç°í ÀÖ½À´Ï´Ù. ƯÈ÷ Ãʺ¸Àڵ鿡°Ô À¯¿ëÇÕ´Ï´Ù.
+ ¸¹Àº ¿¹Á¦¿Í ±×¸²ÀÌ ÀÖ½À´Ï´Ù.
+ ´ÙÀ½À» Âü°íÇϽʽÿÀ: http://iccf-holland.org/click5.html
+
+ ´ÙÀ½ Ã¥Àº Á» ¿À·¡µÈ Ã¥À¸·Î ºöº¸´Ù´Â Vi¿¡ ´ëÇØ ´Ù·ç°í ÀÖÁö¸¸, ¿ª½Ã ÃßõÇÒ ¸¸
+ ÇÕ´Ï´Ù:
+ Learning the Vi Editor - by Linda Lamb
+ ÃâÆÇ»ç: O'Reilly & Associates Inc.
+ Vi·Î ÇÏ°í ½ÍÀº °ÅÀÇ ¸ðµç °Í¿¡ ´ëÇØ ¾Ë ¼ö ÀÖ´Â ÁÁÀº Ã¥ÀÔ´Ï´Ù.
+ ¿©¼¸¹ø° °³Á¤ÆÇÀº ºö¿¡ °üÇÑ ³»¿ëÀ» Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù.
+
+ ÀÌ ±æÀâÀÌ´Â Colorado School of MinesÀÇ Michael C. Pierce ¿Í
+ Robert K. Ware °¡ Colorado State UniversityÀÇ Charles Smith ÀÇ ¾ÆÀ̵ð¾î¿¡
+ Âø¾ÈÇÏ¿© ½è½À´Ï´Ù.
+ . E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+ ÀÌ ¹®¼­ÀÇ Çѱ¹¾î ¹öÀü¿¡ °üÇÑ ¹®ÀÇ´Â ´ÙÀ½ »çÀÌÆ®·Î ÇØÁֽʽÿÀ.
+ http://wiki.kldp.org/wiki.php/VimTutorKo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ko.utf-8 b/runtime/tutor/tutor.ko.utf-8
new file mode 100644
index 000000000..4498c9f6d
--- /dev/null
+++ b/runtime/tutor/tutor.ko.utf-8
@@ -0,0 +1,812 @@
+===============================================================================
+= ë¹” ê¸¸ìž¡ì´ (VIM Tutor) ì— ì˜¤ì‹  ê²ƒì„ í™˜ì˜í•©ë‹ˆë‹¤ - Version 1.5 =
+===============================================================================
+
+ ë¹”(Vim)ì€ ì´ ê¸¸ìž¡ì´ì—ì„œ 다 설명할 수 ì—†ì„ ë§Œí¼ ë§Žì€ ëª…ë ¹ì„ ê°€ì§„
+ 매우 강력한 편집기입니다. ì´ ê¸¸ìž¡ì´ëŠ” ë¹”ì„ ì‰½ê²Œ 전천후 편집기로 사용할
+ 수 있ë„ë¡ ì¶©ë¶„í•œ ëª…ë ¹ì— ëŒ€í•´ 설명하고 있습니다.
+
+ ì´ ê¸¸ìž¡ì´ë¥¼ 떼는 ë°ì—는 실습하는 ë°ì— 얼마나 ì‹œê°„ì„ ì“°ëŠ” ê°€ì— ë”°ë¼ì„œ
+ 25-30 분 ì •ë„ê°€ 걸립니다.
+
+ ì´ ì—°ìŠµì— í¬í•¨ëœ ëª…ë ¹ì€ ë‚´ìš©ì„ ê³ ì¹©ë‹ˆë‹¤. ì´ íŒŒì¼ì˜ ë³µì‚¬ë³¸ì„ ë§Œë“¤ì–´ì„œ
+ 연습하세요. (vimtutor 를 통해 시작했다면, ì´ë¯¸ ë³µì‚¬ë³¸ì„ ì‚¬ìš©í•˜ëŠ”
+ 중입니다.)
+
+ 중요한 것ì€, ì´ ê¸¸ìž¡ì´ê°€ ì§ì ‘ ì¨ë³´ë©´ì„œ ë°°ìš°ë„ë¡ ê³ ë ¤ë˜ì–´ 있다는 것입니다.
+ ëª…ë ¹ì„ ì œëŒ€ë¡œ ìµížˆë ¤ë©´, ì§ì ‘ 실행해보는 ê²ƒì´ í•„ìš”í•©ë‹ˆë‹¤. ë‚´ìš©ì„ ì½ëŠ”
+ 것만으로는, ëª…ë ¹ì„ ìžŠì–´ë²„ë¦¬ê²Œ ë  ê²ƒìž…ë‹ˆë‹¤.
+
+ ìž ì´ì œ, Caps Lock(Shift-Lock) 키가 눌려있지 ì•Šì€ì§€ 확ì¸í•´ë³´ì‹œê³ , j 키를
+ 충분히 눌러서 Lesson 1.1ì´ í™”ë©´ì— ê°€ë“ ì°¨ë„ë¡ ì›€ì§ì—¬ë´…시다.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.1: 커서 움ì§ì´ê¸°
+
+ ** 커서를 움ì§ì´ë ¤ë©´, í‘œì‹œëœ ëŒ€ë¡œ h,j,k,l 키를 누르십시오. **
+ ^
+ k 힌트: h 키는 ì™¼ìª½ì— ìžˆìœ¼ë©°, 왼쪽으로 움ì§ìž…니다.
+ < h l > l 키는 ì˜¤ë¥¸ìª½ì— ìžˆìœ¼ë©°, 오른쪽으로
+ j 움ì§ìž…니다.
+ v j 키는 아래방향 화살표처럼 ìƒê²¼ìŠµë‹ˆë‹¤.
+
+ 1. ìµìˆ™í•´ì§ˆ 때까지 커서를 스í¬ë¦° ìƒì—ì„œ 움ì§ì—¬ 보십시오.
+
+ 2. 아래 방향키 (j)를 ë°˜ë³µìž…ë ¥ì´ ë  ë•Œê¹Œì§€ 누르고 계십시오.
+---> ì´ì œ ë‹¤ìŒ lesson으로 가는 ë°©ë²•ì„ ì•Œê²Œ ë˜ì—ˆìŠµë‹ˆë‹¤.
+
+ 3. 아래 방향키를 ì´ìš©í•˜ì—¬, Lesson 1.2 ë¡œ 가십시오.
+
+참고: ì›í•˜ì§€ 않는 무언가가 ìž…ë ¥ì´ ë˜ì—ˆë‹¤ë©´, <ESC>를 눌러서, 명령 모드로
+ ëŒì•„가십시오. ê·¸ í›„ì— ì›í•˜ëŠ” ëª…ë ¹ì„ ë‹¤ì‹œ 입력하십시오.
+
+참고: 커서키 ë˜í•œ ìž‘ë™í•  것입니다. 하지만 hjklì— ìµìˆ™í•´ì§€ë©´, 커서키보다
+ 훨씬 빠르게 ì´ë™í•  수 ìžˆì„ ê²ƒìž…ë‹ˆë‹¤.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.2: ë¹”ì„ ì‹œìž‘í•˜ê³  ë내기
+
+
+ !! 주ì˜: 아래 있는 단계를 실행하기 ì „ì—, ì´ lesson 전체를 ì½ìœ¼ì‹­ì‹œì˜¤!!
+
+ 1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
+
+ 2. 다ìŒê³¼ ê°™ì´ ìž…ë ¥í•©ë‹ˆë‹¤: :q! <ENTER>
+
+---> ì´ë ‡ê²Œ 하면, ë°”ë€ ë‚´ìš©ì„ *저장하지 ì•Šê³ * 편집기를 빠져나갑니다.
+ 저장한 후 빠져나가려면 다ìŒê³¼ ê°™ì´ ìž…ë ¥í•©ë‹ˆë‹¤:
+ :wq <ENTER>
+
+ 3. 쉘 프롬프트가 ë³´ì¸ë‹¤ë©´, 다시 길잡ì´ë¡œ ëŒì•„오기 위해 다ìŒê³¼ ê°™ì´
+ 입력합니다.
+ vimtutor <ENTER>
+ ë˜ëŠ” 다ìŒê³¼ ê°™ì„ ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤.
+ vim tutor.ko <ENTER>
+
+---> 'vim' ì€ ë¹” 편집기로 들어가는 ê²ƒì„ ëœ»í•˜ë©°, 'tutor.ko'는 편집하려는
+ 파ì¼ì„ 뜻합니다.
+
+ 4. 위ì—ì„œ ì´ì•¼ê¸°í•œ 단계를 기억하였으며, í™•ì‹ ì´ ì„œë©´, 1ì—ì„œ 3까지를
+ 수행하여 편집기를 나갔다가 다시 들어와보십시오. 그 후 커서를 아래로
+ 움ì§ì—¬ Lesson 1.3 으로 가십시오.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.3: í…스트 편집 - 지우기
+
+
+** 명령 모드ì—ì„œ x 를 누르면 커서가 위치한 ê³³ì˜ ê¸€ìžë¥¼ 지울 수 있습니다. **
+
+ 1. ----> ë¡œ í‘œì‹œëœ ê³³ìœ¼ë¡œ 커서를 옮겨보십시오.
+
+ 2. 오타를 수정하기 위해, 커서를 지울 ê¸€ìž ìœ„ë¡œ 움ì§ì—¬ 보십시오.
+
+ 3. x 키를 눌러서 지워야할 글ìžë¥¼ 지우십시오.
+
+ 4. 2ì—ì„œ 4까지를 반복하여 ë¬¸ìž¥ì´ ì˜¬ë°”ë¥´ê²Œ ë˜ë„ë¡ í•˜ì—¬ 보십시오.
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. ë¬¸ìž¥ì´ ì •í™•í•´ì¡Œë‹¤ë©´, Lesson 1.4ë¡œ 가십시오.
+
+주ì˜: ì´ ê¸¸ìž¡ì´ë¥¼ ë³´ë©´ì„œ 외우려고 하지ë§ê³ , ì§ì ‘ 사용해보면서 ìµížˆê¸¸
+ ë°”ëžë‹ˆë‹¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 1.4: í…스트 편집 - 삽입 (INSERTION)
+
+
+ ** 명령 모드ì—ì„œ i 를 누르면 í…스트를 입력할 수 있습니다. **
+
+ 1. 커서를 첫번째 ---> ë¡œ í‘œì‹œëœ ì¤„ë¡œ 움ì§ìž…니다.
+
+ 2. 첫번째 ì¤„ì„ ë‘번째 줄과 ë˜‘ê°™ì´ ë§Œë“¤ê²ƒìž…ë‹ˆë‹¤. í…스트가 들어가야할
+ ê³³ 다ìŒë¶€í„° 첫번째 ê¸€ìž ìœ„ì— ì»¤ì„œë¥¼ 옮겨 놓습니다.
+
+ 3. i 키를 누른 후, 필요한 ë‚´ìš©ì„ ìž…ë ¥í•©ë‹ˆë‹¤.
+
+ 4. 수정한 후ì—는 <ESC> 를 눌러서 명령 모드로 ëŒì•„갑니다.
+ ë¬¸ìž¥ì„ ì˜¬ë°”ë¥´ê²Œ 만들기 위해 2ì—ì„œ 4ì˜ ê³¼ì •ì„ ë°˜ë³µí•©ë‹ˆë‹¤.
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. í…스트를 삽입하는 ë°ì— ìµìˆ™í•´ì¡Œë‹¤ë©´, ìš”ì•½ì„ ë´ì£¼ì‹­ì‹œì˜¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 1 요약
+
+
+ 1. 커서를 움ì§ì¼ ë•Œì—는 화살표 키나 hjkl 키를 ì´ìš©í•©ë‹ˆë‹¤.
+ h (왼쪽) j (아래) k (위) l (오른쪽)
+
+ 2. 쉘 프롬프트ì—ì„œ ë¹”ì„ ì‹œìž‘í•˜ë ¤ë©´ vim FILENAME <ENTER>
+
+ 3. 수정한 ë‚´ìš©ì„ ë¬´ì‹œí•œ 채로 ë¹”ì—ì„œ 빠져나가려면 <ESC> :q! <ENTER>
+ 저장한 후 ë¹”ì—ì„œ 빠져나가려면 <ESC> :wq <ENTER>
+
+ 4. 명령 모드ì—ì„œ 커서가 위치한 ê³³ì˜ ê¸€ìžë¥¼ 지우려면 x 를 입력합니다.
+
+ 5. 명령 모드ì—ì„œ 커서가 위치한 ê³³ì— í…스트를 삽입하려면
+ i 를 누른 후 í…스트를 입력하고 <ESC> 를 누릅니다.
+
+참고: <ESC>는 명령 모드로 ëŒì•„가는 ë° ì“°ë©°, ì›ì¹˜ 않는 명령ì´ë‚˜ 완전히 ìž…ë ¥ë˜ì§€
+ ì•Šì€ ëª…ë ¹ì„ ì·¨ì†Œí•˜ëŠ” ë°ì—ë„ ì”니다.
+
+그럼 Lesson 2를 시작합시다.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.1: 삭제(DELETION) 명령
+
+
+ ** í•œ 단어를 ë까지 지우려면 dw ë¼ê³  치면 ë©ë‹ˆë‹¤. **
+
+ 1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
+
+ 2. ì•„ëž˜ì— ---> ë¡œ í‘œì‹œëœ ì¤„ 까지 커서를 옮ê¹ë‹ˆë‹¤.
+
+ 3. 지워야할 ë‹¨ì–´ì˜ ì²˜ìŒìœ¼ë¡œ 커서를 옮ê¹ë‹ˆë‹¤.
+
+ 4. dw ë¼ê³  ì³ì„œ ê·¸ 단어를 지ì›ë‹ˆë‹¤.
+
+ 주ì˜: 위ì—ì„œ ë§í•œëŒ€ë¡œ 하면 í™”ë©´ì˜ ë§ˆì§€ë§‰ ì¤„ì— dw ë¼ëŠ” 글ìžê°€ 표시ë©ë‹ˆë‹¤.
+ 잘못 쳤다면, <ESC> 를 눌러서 다시 시작하십시오.
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. 3, 4번 ê³¼ì •ì„ ë‹¤ì‹œ 하여 ë¬¸ìž¥ì„ ì •í™•í•˜ê²Œ 만든 ë’¤ Lesson 2.2ë¡œ 가십시오.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.2: 다른 삭제 명령
+
+ ** d$ ë¼ê³  치면 ê·¸ 줄 ë까지 지워집니다. **
+
+ 1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
+
+ 2. ì•„ëž˜ì— ---> ë¡œ í‘œì‹œëœ ì¤„ 까지 커서를 옮ê¹ë‹ˆë‹¤.
+
+ 3. 올바른 ì¤„ì˜ ë으로 커서를 옮ê¹ë‹ˆë‹¤. (첫번째로 나오는 . 다ìŒìž…니다.)
+
+ 4. d$ ë¼ê³  ì³ì„œ 줄 ë까지 지ì›ë‹ˆë‹¤.
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+
+ 5. ì–´ë–¤ ì¼ì´ ì¼ì–´ë‚¬ëŠ”지 ì´í•´í•˜ê¸° 위해 Lesson 2.3 으로 가십시오.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: 명령과 ì ìš© 대ìƒì— 대해
+
+
+ ì‚­ì œ 명령 dì˜ í˜•ì‹ì€ 다ìŒê³¼ 같습니다.
+
+ [횟수] d ëŒ€ìƒ ë˜ëŠ” d [횟수] 대ìƒ
+ 여기서
+ 횟수 - ëª…ë ¹ì„ ëª‡ 번 수행할 지 (옵션, 기본값=1).
+ d - 지우는 명령
+ ëŒ€ìƒ - ì•„ëž˜ì— ì œì‹œëœ ëŒ€ìƒì— 대해 ëª…ë ¹ì„ ìˆ˜í–‰
+
+ ì ìš© 가능한 대ìƒì˜ 종류:
+ w - 커서ì—ì„œ ê·¸ ë‹¨ì–´ì˜ ë까지 (공백 í¬í•¨.)
+ e - 커서ì—ì„œ ê·¸ ë‹¨ì–´ì˜ ë까지 (ê³µë°±ì„ í¬í•¨í•˜ì§€ ì•ŠìŒ.)
+ $ - 커서ì—ì„œ ê·¸ ì¤„ì˜ ë까지
+
+참고: í˜¸ê¸°ì‹¬ì´ ìžˆë‹¤ë©´, 명령 모드ì—ì„œ 명령 ì—†ì´ ëŒ€ìƒì„ 입력해보십시오.
+ 위ì—ì„œ ì´ì•¼ê¸°í•œ 대ìƒì˜ 목ë¡ì— ë”°ë¼ ì»¤ì„œê°€ 움ì§ì´ê²Œ ë©ë‹ˆë‹¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.4: '명령-대ìƒ' ì— ëŒ€í•œ 예외
+
+
+ ** dd ë¼ê³  치면 줄 전체를 지ì›ë‹ˆë‹¤. **
+
+ 줄 전체를 지우는 ì¼ì´ 잦기 때문ì—, Vi를 ë””ìžì¸ í•œ 사람들ì€, 간단히 d를
+ ë‘번 연달아 치면 í•œ ì¤„ì„ ì§€ìš¸ 수 있ë„ë¡ í•˜ì˜€ìŠµë‹ˆë‹¤.
+
+ 1. 커서를 아래 나온 단ë½ì˜ ë‘번째 줄로 가져가십시오.
+ 2. dd 를 입력하여 ê·¸ ì¤„ì„ ì§€ìš°ì‹­ì‹œì˜¤.
+ 3. 그런 ë‹¤ìŒ ë„¤ë²ˆì§¸ 줄로 가십시오.
+ 4. 2dd ë¼ê³  입력하여 ë‘ì¤„ì„ ì§€ì›ë‹ˆë‹¤. ( 횟수-명령-대ìƒì„ 기억하세요. )
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.5: 취소(UNDO) 명령
+
+
+ ** u 를 누르면 마지막 ëª…ë ¹ì´ ì·¨ì†Œë˜ë©°, U 는 줄 전체를 수정합니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì¤„ë¡œ ì´ë™í•œ 후 첫번째 ìž˜ëª»ëœ ë¶€ë¶„ 위로 옮ê¹ë‹ˆë‹¤.
+ 2. x 를 입력하여 첫번째 ìž˜ëª»ëœ ê¸€ìžë¥¼ 지ì›ë‹ˆë‹¤.
+ 3. 그럼 ì´ì œ u 를 입력하여 마지막으로 ìˆ˜í–‰ëœ ëª…ë ¹ì„ ì·¨ì†Œí•©ë‹ˆë‹¤.
+ 4. ì´ë²ˆì—는 x ëª…ë ¹ì„ ì´ìš©í•˜ì—¬ ê·¸ ì¤„ì˜ ëª¨ë“  ì—러를 수정해봅시다.
+ 5. ëŒ€ë¬¸ìž U 를 눌러서 ê·¸ ì¤„ì„ ì›ëž˜ ìƒíƒœë¡œ ëŒë ¤ë†“ì•„ 보십시오.
+ 6. ì´ë²ˆì—는 u 를 몇 번 눌러서 U 와 ì´ì „ ëª…ë ¹ì„ ì·¨ì†Œí•´ë´…ì‹œë‹¤.
+ 7. CTRL-R (CTRL 키를 누른 ìƒíƒœì—ì„œ Rì„ ëˆ„ë¥´ëŠ” 것) ì„ ëª‡ 번 눌러서
+ ëª…ë ¹ì„ ë‹¤ì‹œ 실행해봅시다. (취소한 ê²ƒì„ ì·¨ì†Œí•¨.)
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. ì´ ëª…ë ¹ì€ ë§¤ìš° 유용합니다. 그럼 Lesson 2 요약으로 넘어가ë„ë¡ í•©ì‹œë‹¤.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 2 요약
+
+
+ 1. 커서가 위치한 곳부터 ë‹¨ì–´ì˜ ë까지 지우려면: dw
+
+ 2. 커서가 위치한 곳부터 줄 ë까지 지우려면: d$
+
+ 3. 줄 전체를 지우려면: dd
+
+ 4. 명령 모드ì—ì„œ 내리는 ëª…ë ¹ì˜ í˜•ì‹ì€ 다ìŒê³¼ 같습니다:
+
+ [횟수] 명령 ëŒ€ìƒ ë˜ëŠ” 명령 [횟수] 대ìƒ
+ 여기서:
+ 횟수 - ê·¸ ëª…ë ¹ì„ ëª‡ 번 반복할 것ì¸ê°€
+ 명령 - ì–´ë–¤ ëª…ë ¹ì„ ë‚´ë¦´ 것ì¸ê°€ ( 예를 들어, ì‚­ì œì¸ ê²½ìš°ëŠ” d )
+ ëŒ€ìƒ - ëª…ë ¹ì´ ë™ìž‘í•  대ìƒ, 예를 들어 w (단어), $ (ì¤„ì˜ ë) 등.
+
+ 5. ì´ì „ í–‰ë™ì„ 취소하려면: u (ì†Œë¬¸ìž u)
+ í•œ 줄ì—ì„œ 수정한 ê²ƒì„ ëª¨ë‘ ì·¨ì†Œí•˜ë ¤ë©´: U (ëŒ€ë¬¸ìž U)
+ 취소한 ê²ƒì„ ë‹¤ì‹œ 실행하려면: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.1: 붙ì´ê¸°(PUT) 명령
+
+
+ ** p 를 입력하여 마지막으로 지운 ë‚´ìš©ì„ ì»¤ì„œ ë’¤ì— ë¶™ìž…ë‹ˆë‹¤. **
+
+ 1. ì•„ëž˜ì— ìžˆëŠ” ë¬¸ë‹¨ì˜ ì²« 줄로 커서를 움ì§ì´ì‹­ì‹œì˜¤.
+
+ 2. dd 를 입력하여 ê·¸ ì¤„ì„ ì§€ì›Œì„œ ë¹”ì˜ ë²„í¼ì— 저장합니다.
+
+ 3. 아까 지운 ì¤„ì´ ê°€ì•¼í•  ìœ„ì¹˜ì˜ *윗줄로* 커서를 옮ê¹ë‹ˆë‹¤.
+
+ 4. 명령 모드ì—ì„œ, p 를 입력하여 ê·¸ ì¤„ì„ ì œëŒ€ë¡œ ëœ ìžë¦¬ë¡œ 옮ê¹ë‹ˆë‹¤.
+
+ 5. 2ì—ì„œ 4를 반복하여 모든 ì¤„ì˜ ìˆœì„œë¥¼ 바로 잡으십시오.
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.2: 치환(REPLACE) 명령
+
+
+ ** 커서 ì•„ëž˜ì˜ ê¸€ìž í•˜ë‚˜ë¥¼ 바꾸려면, r ì„ ëˆ„ë¥¸ 후 바꿀 글ìžë¥¼ 입력합니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì²« 줄로 옮ê¹ë‹ˆë‹¤.
+
+ 2. 커서를 ìž˜ëª»ëœ ì²« 부분으로 옮ê¹ë‹ˆë‹¤.
+
+ 3. r ì„ ëˆ„ë¥¸ 후, ìž˜ëª»ëœ ë¶€ë¶„ì„ ê³ ì³ ì“¸ 글ìžë¥¼ 입력합니다.
+
+ 4. 2ì—ì„œ 3ì˜ ê³¼ì •ì„ ë°˜ë³µí•˜ì—¬, 첫 ì¤„ì˜ ì˜¤ë¥˜ë¥¼ 수정하십시오.
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. Lesson 3.2 ë¡œ ì´ë™í•©ì‹œë‹¤.
+
+주ì˜: 외우지 ë§ê³ , ì§ì ‘ í•´ë³´ë©´ì„œ ìµí˜€ì•¼ 한다는 ê²ƒì„ ìžŠì§€ 마십시오.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.3: 변환(CHANGE) 명령
+
+
+ ** í•œ ë‹¨ì–´ì˜ ì¼ë¶€ë‚˜ 전체를 바꾸려면, cw 를 치십시오. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì²«ì¤„ë¡œ 옮ê¹ë‹ˆë‹¤.
+
+ 2. 커서를 lubw ì—ì„œ u ìœ„ì— ì˜¬ë ¤ë†“ìŠµë‹ˆë‹¤.
+
+ 3. cw ë¼ê³  명령한 후 단어를 정확하게 수정합니다. (ì´ ê²½ìš°, 'ine' 를 칩니다.)
+
+ 4. <ESC> 를 누른 후 ë‹¤ìŒ ì—러로 갑니다 (수정ë˜ì–´ì•¼í•  첫 글ìžë¡œ 갑니다.)
+
+ 5. 3ì—ì„œ 4ì˜ ê³¼ì •ì„ ë°˜ë³µí•˜ì—¬ 첫번째 ë¬¸ìž¥ì„ ë‘번째 문장과 ê°™ë„ë¡ ë§Œë“­ë‹ˆë‹¤.
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+cw 는 단어를 치환하는 것 ë¿ë§Œ 아니ë¼, ë‚´ìš©ì„ ì‚½ìž…í•  수 있ë„ë¡ í•œë‹¤ëŠ” 것ì—
+주ì˜í•©ì‹œë‹¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.4: c 를 ì´ìš©í•œ 다른 변환 명령
+
+
+ ** 변환 ëª…ë ¹ì€ ì‚­ì œí•  ë•Œ ì´ìš©í•œ 대ìƒì— 대해 ì ìš©í•  수 있습니다. **
+
+ 1. 변환 ëª…ë ¹ì€ ì‚­ì œì™€ ë™ì¼í•œ ë°©ì‹ìœ¼ë¡œ ë™ìž‘합니다. 형ì‹ì€ 다ìŒê³¼ 같습니다:
+
+ [횟수] c ëŒ€ìƒ ë˜ëŠ” c [횟수] 대ìƒ
+
+ 2. ì ìš© 가능한 ëŒ€ìƒ ì—­ì‹œ 같습니다. w (단어), $ (ì¤„ì˜ ë) ë“±ì´ ìžˆìŠµë‹ˆë‹¤.
+
+ 3. ---> ë¡œ í‘œì‹œëœ ì²«ì¤„ë¡œ ì´ë™í•©ë‹ˆë‹¤.
+
+ 4. 첫 ì—러 위로 커서를 옮ê¹ë‹ˆë‹¤.
+
+ 5. c$ 를 입력하여, ê·¸ ì¤„ì˜ ë‚˜ë¨¸ì§€ê°€ ë‘번째 줄처럼 ë˜ë„ë¡ ìˆ˜ì •í•œ 후 <ESC> 를
+ 누르십시오.
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 3 요약
+
+
+ 1. ì´ë¯¸ 지운 ë‚´ìš©ì„ ë˜ëŒë¦¬ë ¤ë©´, p 를 누르십시오. ì´ ëª…ë ¹ì€ ì»¤ì„œ *다ìŒì—*
+ 지워진 ë‚´ìš©ì„ ë¶™ìž…ë‹ˆë‹¤(PUT). (í•œ ì¤„ì„ ì§€ìš´ 경우ì—는 커서 ë‹¤ìŒ ì¤„ì—
+ 지워진 ë‚´ìš©ì´ ë¶™ìŠµë‹ˆë‹¤.)
+
+ 2. 커서 ì•„ëž˜ì˜ ê¸€ìžë¥¼ 치환하려면(REPLACE), r ì„ ëˆ„ë¥¸ 후 ì›ëž˜ ê¸€ìž ëŒ€ì‹ 
+ 바꾸어 ë„£ì„ ê¸€ìžë¥¼ 입력합니다.
+
+ 3. 변환 명령(CHANGE)ì€ ì»¤ì„œì—ì„œ 부터 지정한 대ìƒì˜ ë까지 바꿀 수 있는
+ 명령입니다. 예를 들어, 커서 위치ì—ì„œ ë‹¨ì–´ì˜ ë까지 바꾸려면, cw 를
+ 입력하면 ë˜ë©°, c$ 는 줄 ë까지 바꾸는 ë° ì“°ìž…ë‹ˆë‹¤.
+
+ 4. 변환 ëª…ë ¹ì˜ í˜•ì‹ì€ 다ìŒê³¼ 같습니다:
+
+ [횟수] c ëŒ€ìƒ ë˜ëŠ” c [횟수] 대ìƒ
+
+계ì†í•´ì„œ ë‹¤ìŒ Lesson ì„ ì§„í–‰í•©ì‹œë‹¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.1: 위치와 파ì¼ì˜ ìƒíƒœ
+
+
+ ** CTRL-g 를 누르면 íŒŒì¼ ë‚´ì—ì„œì˜ í˜„ìž¬ 위치와 파ì¼ì˜ ìƒíƒœë¥¼ ë³¼ 수 있습니다.
+ SHIFT-G 를 누르면 íŒŒì¼ ë‚´ì˜ ì¤„ë¡œ ì´ë™í•©ë‹ˆë‹¤. **
+
+ 주ì˜: ì•„ëž˜ì˜ ë‹¨ê³„ë¥¼ ë”°ë¼í•˜ê¸° ì „ì—, ì´ Lesson 전체를 먼저 ì½ìœ¼ì‹­ì‹œì˜¤.
+
+ 1. CTRL 키를 누른 ìƒíƒœì—ì„œ g 를 누릅니다. íŒŒì¼ ì´ë¦„ê³¼ 현재 위치한 줄ì´
+ í‘œì‹œëœ ìƒíƒœì¤„ì´ í™”ë©´ ì•„ëž˜ì— í‘œì‹œë  ê²ƒìž…ë‹ˆë‹¤. 3번째 단계를 위해 ê·¸
+ 줄 번호를 기억하고 계십시오.
+
+ 2. SHIFT-G 를 누르면 파ì¼ì˜ 마지막으로 ì´ë™í•©ë‹ˆë‹¤.
+
+ 3. 아까 ê¸°ì–µí–ˆë˜ ì¤„ 번호를 입력한 후 SHIFT-G 를 누르십시오. ì´ë ‡ê²Œ 하면
+ 처ìŒì— CTRL-g 를 ëˆŒë €ë˜ ìž¥ì†Œë¡œ ë˜ëŒì•„가게 ë  ê²ƒìž…ë‹ˆë‹¤.
+ (번호를 입력할 ë•Œ, ì´ê²ƒì€ í™”ë©´ì— í‘œì‹œë˜ì§€ 않습니다.)
+
+ 4. ìžì‹ ì´ ìƒê²¼ë‹¤ë©´, 1ì—ì„œ 3까지를 실행해보십시오.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.2: 찾기 명령
+
+
+ ** / 를 누른 후 검색할 문구를 입력하십시오. **
+
+ 1. 명령 모드ì—ì„œ / 를 입력하십시오. : 명령ì—서와 마찬가지로, 화면 아래ì—
+ / 와 커서가 í‘œì‹œë  ê²ƒìž…ë‹ˆë‹¤.
+
+ 2. 'errroor' ë¼ê³  친 후 <ENTER> 를 치십시오. ì´ ë‹¨ì–´ë¥¼ 찾으려고 합니다.
+
+ 3. ê°™ì€ ë¬¸êµ¬ë¥¼ 다시 찾으려면, 간단히 n ì„ ìž…ë ¥í•˜ì‹­ì‹œì˜¤.
+ ê°™ì€ ë¬¸êµ¬ë¥¼ 반대 방향으로 찾으려면, Shift-N ì„ ìž…ë ¥í•˜ì‹­ì‹œì˜¤.
+
+ 4. 문구를 역방향으로 찾으려면, / 대신 ? 를 ì´ìš©í•˜ë©´ ë©ë‹ˆë‹¤.
+
+---> "errroor" is not the way to spell error; errroor is an error.
+
+참고: 찾는 ì¤‘ì— íŒŒì¼ì˜ ëì— ë‹¤ë‹¤ë¥´ê²Œ ë˜ë©´, 파ì¼ì˜ 처ìŒë¶€í„° 다시 찾게 ë©ë‹ˆë‹¤.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.3: ê´„í˜¸ì˜ ì§ ì°¾ê¸°
+
+
+ ** % 를 눌러서 ), ], } ì˜ ì§ì„ 찾습니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì¤„ì˜ (, [, { 중 í•˜ë‚˜ì— ê°€ì ¸ë‹¤ 놓습니다.
+
+ 2. % 를 입력해 봅시다.
+
+ 3. 커서가 ì§ì´ 맞는 괄호로 ì´ë™í•  것입니다.
+
+ 4. % 를 입력하여, ì´ì „ 괄호로 ë˜ëŒì•„ 옵시다.
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+참고: ì§ì´ 맞지 않는 괄호가 있는 í”„ë¡œê·¸ëž¨ì„ ë””ë²„ê¹…í•  ë•Œì— ë§¤ìš° 유용합니다!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 4.4: ì—러를 수정하는 방법
+
+
+ ** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì¤„ì— ê°€ì ¸ë‹¤ 놓습니다.
+
+ 2. :s/thee/the 를 입력한 후 <ENTER> 를 칩니다. ì´ ëª…ë ¹ì€ ê·¸ 줄ì—ì„œ
+ 처ìŒìœ¼ë¡œ ë°œê²¬ëœ ê²ƒë§Œ 바꾼다는 ê²ƒì— ì£¼ì˜í•˜ì‹­ì‹œì˜¤.
+
+ 3. ì´ë²ˆì—는 :s/thee/the/g 를 입력합니다. ì´ëŠ” ê·¸ 줄 ì „ì²´(globally)를
+ 치환한다는 ê²ƒì„ ì˜ë¯¸í•©ë‹ˆë‹¤.
+
+---> thee best time to see thee flowers is in thee spring.
+
+ 4. ë‘ ì¤„ 사ì´ì˜ 모든 문ìžì—´ì— 대해 치환하려면 다ìŒê³¼ ê°™ì´ í•©ë‹ˆë‹¤,
+ :#,#s/old/new/g #,# 는 ë‘ ì¤„ì˜ ì¤„ë²ˆí˜¸ë¥¼ 뜻합니다.
+ :%s/old/new/g íŒŒì¼ ì „ì²´ì—ì„œ ë°œê²¬ëœ ëª¨ë“  ê²ƒì„ ì¹˜í™˜í•˜ëŠ” 경우입니다.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 4 요약
+
+
+ 1. CTRL-g 는 파ì¼ì˜ ìƒíƒœì™€ íŒŒì¼ ë‚´ì—ì„œì˜ í˜„ìž¬ 위치를 표시합니다.
+ SHIFT-G 는 파ì¼ì˜ ë으로 ì´ë™í•©ë‹ˆë‹¤. 줄번호를 입력한 후 SHIFT-G를
+ 입력하면, ê·¸ 줄로 ì´ë™í•©ë‹ˆë‹¤.
+
+ 2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다.
+ ? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다.
+ 검색 후, n ì„ ìž…ë ¥í•˜ë©´ ê°™ì€ ë°©í–¥ìœ¼ë¡œ ë‹¤ìŒ ë¬¸êµ¬ë¥¼ 찾으며,
+ Shift-N ì„ ìž…ë ¥í•˜ë©´ 반대 방향으로 찾습니다.
+
+ 3. 커서가 (,),[,],{,} ìœ„ì— ìžˆì„ ë•Œì— % 를 입력하면 ìƒì‘하는 ì§ì„
+ 찾아갑니다.
+
+ 4. ì–´ë–¤ ì¤„ì— ì²˜ìŒ ë“±ìž¥í•˜ëŠ” old를 newë¡œ 바꾸려면 :s/old/new
+ í•œ ì¤„ì— ë“±ìž¥í•˜ëŠ” 모든 old를 newë¡œ 바꾸려면 :s/old/new/g
+ ë‘ ì¤„ #,# 사ì´ì—ì„œ ì¹˜í™˜ì„ í•˜ë ¤ë©´ :#,#s/old/new/g
+ íŒŒì¼ ë‚´ì˜ ëª¨ë“  문구를 치환하려면 :%s/old/new/g
+ 바꿀 때마다 확ì¸ì„ 거치려면 'c'를 붙여서 :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.1: 외부 명령 실행하는 방법
+
+
+ ** :! ì„ ìž…ë ¥í•œ 후 실행하려는 ëª…ë ¹ì„ ìž…ë ¥í•˜ì‹­ì‹œì˜¤. **
+
+ 1. 친숙한 ëª…ë ¹ì¸ : 를 입력하면 커서가 화면 아래로 ì´ë™í•©ë‹ˆë‹¤. 명령ì„
+ 입력할 수 있게 ë©ë‹ˆë‹¤.
+
+ 2. ì´ì œ ! (ëŠë‚Œí‘œ) 를 입력하십시오. ì´ë ‡ê²Œ 하면 외부 쉘 ëª…ë ¹ì„ ì‹¤í–‰í• 
+ 수 있습니다.
+
+ 3. 시험삼아 ! 다ìŒì— ls 를 입력한 후 <ENTER> 를 ì³ë³´ì‹­ì‹œì˜¤. 쉘 프롬프트
+ ì—서처럼 ë””ë ‰í† ë¦¬ì˜ ëª©ë¡ì´ ì¶œë ¥ë  ê²ƒìž…ë‹ˆë‹¤. ls ê°€ ë™ìž‘하지 않는다면
+ :!dir ì„ ì‹œë„í•´ 보십시오.
+
+참고: ì–´ë–¤ 외부 ëª…ë ¹ë„ ì´ ë°©ë²•ìœ¼ë¡œ 실행할 수 있습니다.
+
+참고: 모든 : ëª…ë ¹ì€ <ENTER> 를 ì³ì•¼ 마무리 ë©ë‹ˆë‹¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.2: 보다 ìžì„¸í•œ íŒŒì¼ ì €ìž¥
+
+
+ ** ìˆ˜ì •ëœ ë‚´ìš©ì„ íŒŒì¼ë¡œ 저장하려면, :w FILENAME 하십시오. **
+
+ 1. :!dir ë˜ëŠ” :!ls 를 입력하여 ë””ë ‰í† ë¦¬ì˜ ë¦¬ìŠ¤íŠ¸ë¥¼ 얻어옵니다.
+ ìœ„ì˜ ëª…ë ¹ 후 <ENTER>를 ì³ì•¼í•œë‹¤ëŠ” ê²ƒì€ ì´ë¯¸ 알고 ìžˆì„ ê²ƒìž…ë‹ˆë‹¤.
+
+ 2. TEST 처럼 존재하지 않는 íŒŒì¼ ì´ë¦„ì„ í•˜ë‚˜ 고르십시오.
+
+ 3. ì´ì œ :w TEST ë¼ê³  입력하십시오. (TEST는 ë‹¹ì‹ ì´ ì„ íƒí•œ íŒŒì¼ ì´ë¦„입니다.)
+
+ 4. ì´ë ‡ê²Œ 하면 ë¹” ê¸¸ìž¡ì´ íŒŒì¼ ì „ì²´ë¥¼ TESTë¼ëŠ” ì´ë¦„으로 저장합니다.
+ 확ì¸í•˜ë ¤ë©´, :!dir ì„ ë‹¤ì‹œ 입력하여, 디렉토리를 살펴보십시오.
+
+참고: ë¹”ì„ ì¢…ë£Œí•œ 후, ë¹”ì„ ë‹¤ì‹œ 실행하여 TESTë¼ëŠ” 파ì¼ì„ ì—´ë©´, ê·¸ 파ì¼ì€
+ ì €ìž¥í–ˆì„ ë•Œì™€ 완벽히 ê°™ì€ ë³µì‚¬ë³¸ì¼ ê²ƒìž…ë‹ˆë‹¤.
+
+ 5. ì´ì œ ê·¸ 파ì¼ì„ 지ì›ì‹œë‹¤.
+ (MS-DOSì—ì„œ): !del TEST
+ (Unixì—ì„œ): !rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.3: ì„ íƒì ìœ¼ë¡œ 저장하는 명령
+
+
+ ** 파ì¼ì˜ ì¼ë¶€ë¥¼ 저장하려면, :#,# w FILENAME 하십시오. **
+
+ 1. 다시 한번, :!dir ì´ë‚˜ !ls 를 입력하여 ë””ë ‰í† ë¦¬ì˜ ëª©ë¡ì„ 받아온 후
+ TEST ê°™ì€ ì í•©í•œ ì´ë¦„ì„ ì„ íƒí•©ë‹ˆë‹¤.
+
+ 2. 커서를 ì´ íŽ˜ì´ì§€ì˜ 처ìŒìœ¼ë¡œ 옮긴 후, Ctrl-g 를 입력하여 ê·¸ ì¤„ì˜ ì¤„ë²ˆí˜¸ë¥¼
+ 알아냅니다. ì´ ë²ˆí˜¸ë¥¼ 기억하십시오!
+
+ 3. ì´ì œ ì´ íŽ˜ì´ì§€ì˜ 마지막으로 가서 Ctrl-g 를 다시 입력하십시오. ì´ ì¤„ì˜
+ 줄번호 ë˜í•œ 기억하십시오!
+
+ 4. ì–´ë–¤ 섹션만 파ì¼ë¡œ 저장하려면, :#,# w TEST 를 입력하면 ë©ë‹ˆë‹¤. ì´ ë•Œ
+ #,# 는 아까 ê¸°ì–µí–ˆë˜ ì‹œìž‘ê³¼ ë 줄번호 입니다. TEST는 íŒŒì¼ ì´ë¦„입니다.
+
+ 5. :!dir ì„ ì´ìš©í•˜ì—¬ 파ì¼ì´ 만들어졌는지 확ì¸í•˜ì‹­ì‹œì˜¤. 지우지는 마십시오.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 5.4: íŒŒì¼ ì½ì–´ë“¤ì´ê¸°, 합치기
+
+
+ ** ì–´ë–¤ 파ì¼ì˜ ë‚´ìš©ì„ ì‚½ìž…í•˜ë ¤ë©´, :r FILENAME 하십시오 **
+
+ 1. :!dir ì„ ìž…ë ¥í•˜ì—¬ 아까 만든 TEST 파ì¼ì´ 그대로 있는지 확ì¸í•˜ì‹­ì‹œì˜¤.
+
+ 2. 커서를 ì´ íŽ˜ì´ì§€ì˜ 처ìŒìœ¼ë¡œ 움ì§ì´ì‹­ì‹œì˜¤.
+
+주ì˜: 3번째 단계를 실행하면, Lesson 5.3 ì„ ë³´ê²Œ ë  ê²ƒìž…ë‹ˆë‹¤. 그렇게 ë˜ë©´
+ ì´ lesson으로 다시 내려오십시오.
+
+ 3. ì´ì œ TEST 파ì¼ì„ ì½ì–´ë“¤ìž…시다. :r TEST ëª…ë ¹ì„ ì‚¬ìš©í•˜ì‹­ì‹œì˜¤. TEST 는
+ 파ì¼ì˜ ì´ë¦„입니다.
+
+참고: ì½ì–´ë“¤ì¸ 파ì¼ì€ 커서가 위치한 지ì ì—서부터 놓ì´ê²Œ ë©ë‹ˆë‹¤.
+
+ 4. 파ì¼ì´ ì½ì–´ë“¤ì—¬ì§„ ê²ƒì„ í™•ì¸í•˜ê¸° 위해, 뒤로 ì´ë™í•´ì„œ 기존 버전과 파ì¼ì—ì„œ
+ ì½ì–´ë“¤ì¸ 버전, ì´ë ‡ê²Œ Lesson 5.3 ì´ ë‘번 반복ë˜ì—ˆìŒì„ 확ì¸í•˜ì‹­ì‹œì˜¤.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 5 요약
+
+
+ 1. :!command 를 ì´ìš©í•˜ì—¬ 외부 ëª…ë ¹ì„ ì‹¤í–‰í•©ë‹ˆë‹¤.
+
+ 유용한 예:
+ (MS-DOS) (Unix)
+ :!dir :!ls - ë””ë ‰í† ë¦¬ì˜ ëª©ë¡ì„ 보여준다.
+ :!del FILENAME :!rm FILENAME - FILENAMEì´ë¼ëŠ” 파ì¼ì„ 지운다.
+
+ 2. :w FILENAME 하면 현재 ë¹”ì—ì„œ 사용하는 파ì¼ì„ FILENAMEì´ë¼ëŠ” ì´ë¦„으로
+ 디스í¬ì— 저장합니다.
+
+ 3. :#,#w FILENAME 하면 #부터 #ê¹Œì§€ì˜ ì¤„ì„ FILENAMEì´ë¼ëŠ” 파ì¼ë¡œ 저장합니다.
+
+ 4. :r FILENAME ì€ ë””ìŠ¤í¬ì—ì„œ FILENAMEì´ë¼ëŠ” 파ì¼ì„ 불러들여서 커서 위치
+ ë’¤ì— í˜„ìž¬ 파ì¼ì„ 집어넣습니다.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.1: 새 줄 열기(OPEN) 명령
+
+
+ ** o 를 누르면 커서 ì•„ëž˜ì— ì¤„ì„ ë§Œë“¤ê³  편집 모드가 ë©ë‹ˆë‹¤. **
+
+ 1. ì•„ëž˜ì— ---> ë¡œ í‘œì‹œëœ ì¤„ë¡œ 커서를 옮기십시오.
+
+ 2. o (소문ìž)를 ì³ì„œ 커서 *아래ì—* ì¤„ì„ í•˜ë‚˜ 여십시오. 편집 모드가 ë©ë‹ˆë‹¤.
+ Insert mode.
+
+ 3. ---> ë¡œ í‘œì‹œëœ ì¤„ì„ ë³µì‚¬í•œ 후 <ESC> 를 눌러서 편집 모드ì—ì„œ 나오십시오.
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. 커서 *위ì—* ì¤„ì„ í•˜ë‚˜ 만드려면, ì†Œë¬¸ìž o 대신 ëŒ€ë¬¸ìž O 를 치면 ë©ë‹ˆë‹¤.
+ 아래 있는 ì¤„ì— ëŒ€í•´ ì´ ëª…ë ¹ì„ ë‚´ë ¤ë³´ì‹­ì‹œì˜¤.
+Open up a line above this by typing Shift-O while the cursor is on this line.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.2: 추가(APPEND) 명령
+
+
+ ** a 를 누르면 커서 *다ìŒì—* ê¸€ì„ ìž…ë ¥í•  수 있습니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì²«ë²ˆì§¸ ì¤„ì˜ ë으로 옮ê¹ë‹ˆë‹¤. 명령 모드ì—ì„œ
+ $ 를 ì´ìš©í•˜ì‹­ì‹œì˜¤.
+
+ 2. ì†Œë¬¸ìž a 를 커서 아래 ê¸€ìž *다ìŒ*ì— ê¸€ì„ ì¶”ê°€í•  수 있습니다.
+ (ëŒ€ë¬¸ìž A는 ê·¸ ì¤„ì˜ ëì— ì¶”ê°€í•©ë‹ˆë‹¤.)
+
+참고: 그렇게 하시면 ê³ ìž‘ ì¤„ì˜ ëì— ì¶”ê°€ë¥¼ 하기 위해 i를 누르고, 커서 아래ì—
+ ìžˆë˜ ê¸€ìžë¥¼ 반복하고, ê¸€ì„ ë¼ì›Œë„£ê³ , <ESC>를 눌러 명령 모드로 ëŒì•„와서,
+ 커서를 오른쪽으로 옮기고 마지막으로 x까지 눌러야 하는 ë²ˆê±°ë¡œì›€ì„ í”¼í•˜ì‹¤
+ 수 있습니다.
+
+ 3. ì´ì œ 첫 ì¤„ì„ ì™„ì„±í•˜ì‹­ì‹œì˜¤. 추가 ëª…ë ¹ì€ í…스트가 ìž…ë ¥ë˜ëŠ” 위치 외ì—는
+ 편집 모드와 완전히 같다는 ê²ƒì„ ìœ ë…하십시오.
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.3: 치환(REPLACE) ì˜ ë‹¤ë¥¸ 버전
+
+
+ ** ëŒ€ë¬¸ìž R ì„ ìž…ë ¥í•˜ë©´ 하나 ì´ìƒì˜ 글ìžë¥¼ 바꿀 수 있습니다. **
+
+ 1. 커서를 ---> ë¡œ í‘œì‹œëœ ì²«ë²ˆì§¸ 줄로 옮기십시오.
+
+ 2. 커서를 ---> ë¡œ í‘œì‹œëœ ë‘번째 줄과 다른 첫번째 단어 위로 옮기십시오.
+ ('last' 입니다.)
+
+ 3. R ì„ ìž…ë ¥í•œ 후 첫번째 ì¤„ì˜ ì˜ˆì „ í…스트 ìœ„ì— ìƒˆë¡œìš´ ê¸€ì„ ìž…ë ¥í•˜ì—¬
+ 나머지 ë‚´ìš©ì´ ë‘번째 줄과 같아지ë„ë¡ ë°”ê¿‰ì‹œë‹¤.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. <ESC> 를 눌러서 나가면, 바뀌지 ì•Šì€ í…스트는 그대로 남게 ë©ë‹ˆë‹¤.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 6.4: 옵션 설정(SET)
+
+ ** 찾기나 바꾸기ì—ì„œ ëŒ€ì†Œë¬¸ìž êµ¬ë¶„ì„ ì—†ì• ê¸° 위해 ì˜µì…˜ì„ ì„¤ì •í•©ë‹ˆë‹¤ **
+
+ 1. 다ìŒì„ 입력하여 'ignore' 를 찾으십시오:
+ /ignore
+ n 키를 ì´ìš©í•˜ì—¬ 여러번 반복하십시오.
+
+ 2. 'ic' (ëŒ€ì†Œë¬¸ìž êµ¬ë³„ 안함, Ignore case) ì˜µì…˜ì„ ì„¤ì •í•˜ì‹­ì‹œì˜¤:
+ :set ic
+
+ 3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
+ n 키를 ê³„ì† ëˆŒëŸ¬ì„œ 여러번 찾으십시오.
+
+ 4. 'hlsearch' 와 'incsearch' ì˜µì…˜ì„ ì„¤ì •í•©ì‹œë‹¤.
+ :set hls is
+
+ 5. 찾기 ëª…ë ¹ì„ ë‹¤ì‹œ 입력하여, ì–´ë–¤ ì¼ì´ ì¼ì–´ë‚˜ëŠ”지 확ì¸í•´ 보십시오:
+ /ignore
+
+ 6. ì°¾ì€ ë‚´ìš©ì´ ê°•ì¡°(HIGHLIGHT)ëœ ê²ƒì„ ì—†ì• ë ¤ë©´, 다ìŒê³¼ ê°™ì´ ìž…ë ¥í•©ë‹ˆë‹¤:
+ :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 6 요약
+
+
+ 1. o 를 입력하면 커서 *아래ì—* í•œ ì¤„ì´ ì—´ë¦¬ë©°, 커서는 편집 모드로
+ 열린 줄 ìœ„ì— ìœ„ì¹˜í•˜ê²Œ ë©ë‹ˆë‹¤.
+ ëŒ€ë¬¸ìž O 를 입력하면 커서가 있는 ì¤„ì˜ *위로* 새 ì¤„ì„ ì—´ê²Œ ë©ë‹ˆë‹¤.
+
+ 2. a 를 입력하면 커서 *다ìŒì—* ê¸€ì„ ìž…ë ¥í•  수 있습니다.
+ ëŒ€ë¬¸ìž A 를 입력하면 ìžë™ìœ¼ë¡œ ê·¸ ì¤„ì˜ ëì— ê¸€ìžë¥¼ 추가하게 ë©ë‹ˆë‹¤.
+
+ 3. ëŒ€ë¬¸ìž R ì„ ìž…ë ¥í•˜ë©´ <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 ë©ë‹ˆë‹¤.
+
+ 4. ":set xxx" 를 하면 "xxx" ì˜µì…˜ì´ ì„¤ì •ë©ë‹ˆë‹¤.
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 7: 온ë¼ì¸ ë„ì›€ë§ ëª…ë ¹
+
+
+ ** 온ë¼ì¸ ë„ì›€ë§ ì‹œìŠ¤í…œ 사용하기 **
+
+ ë¹”ì€ í­ ë„“ì€ ì˜¨ë¼ì¸ ë„ì›€ë§ ì‹œìŠ¤í…œì„ ì œê³µí•©ë‹ˆë‹¤. ë„움ë§ì„ 보려면,
+ ë‹¤ìŒ ì„¸ê°€ì§€ 중 하나를 ì‹œë„해보십시오:
+ - <HELP> 키를 누른다. (키가 있는 경우)
+ - <F1> 키를 누른다. (키가 있는 경우)
+ - :help <ENTER> ë¼ê³  입력한다.
+
+ ë„ì›€ë§ ì°½ì„ ë‹«ìœ¼ë ¤ë©´ :q <ENTER> ë¼ê³  입력하십시오.
+
+ ":help" ë¼ëŠ” ëª…ë ¹ì— ì¸ìžë¥¼ 주면 ì–´ë–¤ ì£¼ì œì— ê´€í•œ ë„움ë§ì„ ì°¾ì„ ìˆ˜ 있습니다.
+ ë‹¤ìŒ ëª…ë ¹ì„ ë‚´ë ¤ 보십시오. ( <ENTER> 키를 누르는 ê²ƒì„ ìžŠì§€ 마십시오.)
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LESSON 8: 시작 스í¬ë¦½íŠ¸ 만들기
+
+ ** ë¹”ì˜ ê¸°ëŠ¥ 켜기 **
+
+ ë¹”ì€ Vi 보다 훨씬 ë§Žì€ ê¸°ëŠ¥ì„ ê°€ì§€ê³  있지만, ëŒ€ë¶€ë¶„ì€ ê¸°ë³¸ì ìœ¼ë¡œ ìž‘ë™í•˜ì§€
+ 않습니다. ë” ë§Žì€ ê¸°ëŠ¥ì„ ì¨ë³´ë ¤ë©´, "vimrc" ë¼ëŠ” 파ì¼ì„ 만들어야 합니다.
+
+ 1. "vimrc" 파ì¼ì„ 수정합시다. ì´ íŒŒì¼ì€ 사용하는 ì‹œìŠ¤í…œì— ë”°ë¼ ë‹¤ë¦…ë‹ˆë‹¤:
+ 1. Start editing the "vimrc" file, this depends on your system:
+ :edit ~/.vimrc Unixì˜ ê²½ìš°
+ :edit $VIM/_vimrc MS-Windowsì˜ ê²½ìš°
+
+ 2. ì´ì œ "vimrc"ì˜ ì˜ˆì œë¥¼ ì½ì–´ë“¤ìž…니다:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. 다ìŒê³¼ ê°™ì´ í•˜ì—¬ 파ì¼ì„ 저장합니다:
+
+ :write
+
+ ë‹¤ìŒ ë²ˆì— ë¹”ì„ ì‹œìž‘í•˜ë©´, 구문 ê°•ì¡°(syntax highlighting)ì´ ì‚¬ìš©ë  ê²ƒìž…ë‹ˆë‹¤.
+ 모든 ì›í•˜ëŠ” ì„¤ì •ì„ ì´ "vimrc" 파ì¼ì— 넣어둘 수 있습니다.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ ì´ê²ƒìœ¼ë¡œ ë¹” 길잡ì´ë¥¼ 마칩니다. ì´ ê¸¸ìž¡ì´ëŠ” ë¹” íŽ¸ì§‘ê¸°ì— ëŒ€í•œ 간략한 개요를
+ 보여주기 위한 ì˜ë„ë¡œ 제작ë˜ì—ˆìœ¼ë©°, ì´ íŽ¸ì§‘ê¸°ë¥¼ ì •ë§ ê°„ë‹¨ížˆ 사용하기ì—
+ 충분할 ë¿ìž…니다. ë¹”ì—는 ì´ ê¸¸ìž¡ì´ì™€ëŠ” 비êµí•  수 ì—†ì„ ë§Œí¼ í›¨ì”¬ ë§Žì€ ëª…ë ¹ì´
+ 있습니다. ë‹¤ìŒ ì‚¬ìš©ìž ë§¤ë‰´ì–¼ì„ ì½ìœ¼ì‹­ì‹œì˜¤: ":help user-manual"
+
+ 보다 ìžì„¸ížˆ ì½ê³  공부하려면, ë‹¤ìŒ ì±…ì„ ì¶”ì²œí•´ 드립니다:
+ Vim - Vi Improved - by Steve Oualline
+ 출íŒì‚¬: New Riders
+ ì´ ì±…ì€ ì™„ì „ížˆ ë¹”ì— ëŒ€í•´ì„œë§Œ 다루고 있습니다. 특히 초보ìžë“¤ì—게 유용합니다.
+ ë§Žì€ ì˜ˆì œì™€ ê·¸ë¦¼ì´ ìžˆìŠµë‹ˆë‹¤.
+ 다ìŒì„ 참고하십시오: http://iccf-holland.org/click5.html
+
+ ë‹¤ìŒ ì±…ì€ ì¢€ ì˜¤ëž˜ëœ ì±…ìœ¼ë¡œ 빔보다는 Viì— ëŒ€í•´ 다루고 있지만, ì—­ì‹œ 추천할 만
+ 합니다:
+ Learning the Vi Editor - by Linda Lamb
+ 출íŒì‚¬: O'Reilly & Associates Inc.
+ Vië¡œ 하고 ì‹¶ì€ ê±°ì˜ ëª¨ë“  ê²ƒì— ëŒ€í•´ ì•Œ 수 있는 ì¢‹ì€ ì±…ìž…ë‹ˆë‹¤.
+ 여섯번째 개정íŒì€ ë¹”ì— ê´€í•œ ë‚´ìš©ì„ í¬í•¨í•˜ê³  있습니다.
+
+ ì´ ê¸¸ìž¡ì´ëŠ” Colorado School of Minesì˜ Michael C. Pierce 와
+ Robert K. Ware ê°€ Colorado State Universityì˜ Charles Smith ì˜ ì•„ì´ë””ì–´ì—
+ 착안하여 ì¼ìŠµë‹ˆë‹¤.
+ . E-mail: bware@mines.colorado.edu.
+
+ Modified for Vim by Bram Moolenaar.
+
+ ì´ ë¬¸ì„œì˜ í•œêµ­ì–´ ë²„ì „ì— ê´€í•œ 문ì˜ëŠ” ë‹¤ìŒ ì‚¬ì´íŠ¸ë¡œ 해주십시오.
+ http://wiki.kldp.org/wiki.php/VimTutorKo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.no b/runtime/tutor/tutor.no
new file mode 100644
index 000000000..2e036042e
--- /dev/null
+++ b/runtime/tutor/tutor.no
@@ -0,0 +1,810 @@
+===============================================================================
+= V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.5 =
+===============================================================================
+
+ Vim er en meget kraftig editor med mange kommandoer, alt for mange
+ til å kunne gå gjennom alle i en innføring som denne. Den er beregnet
+ på å sette deg inn i bruken av nok kommandoer så du vil være i stand
+ til lett å kunne bruke Vim som en editor til alle formål.
+
+ Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30
+ minutter, avhengig av hvor mye tid du bruker til eksperimentering.
+
+ Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne
+ filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er
+ dette allerede en kopi).
+
+ Det er viktig å huske at denne innføringen er beregnet på læring
+ gjennom bruk. Det betyr at du må utføre kommandoene for å lære dem
+ skikkelig. Hvis du bare leser teksten, vil du glemme kommandoene!
+
+ Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten
+ helt til leksjon 1.1 fyller skjermen.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.1: FLYTTING AV MARKØREN
+
+
+ ** For å flytte markøren, trykk tastene h, j, k, l som vist. **
+ ^
+ k Tips: h-tasten er til venstre og flytter til venstre.
+ < h l > l-tasten er til høyre og flytter til høyre.
+ j j-tasten ser ut som en pil som peker nedover.
+ v
+ 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene.
+
+ 2. Hold inne nedovertasten (j) til den repeterer.
+---> Nå vet du hvordan du beveger deg til neste leksjon.
+
+ 3. Gå til leksjon 1.2 ved hjelp av nedovertasten.
+
+MERK: Hvis du blir usikker på noe du har skrevet, trykk <ESC> for å gå til
+ normalmodus. Skriv deretter kommandoen du ønsket.
+
+MERK: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til
+ å bevege markøren mye raskere når du er blitt vant til det.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.2: OPPSTART OG AVSLUTNING AV VIM
+
+
+ !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!
+
+ 1. Trykk <ESC>-tasten (for å forsikre deg om at du er i normalmodus).
+
+ 2. Skriv: :q! <ENTER>
+
+---> Dette avslutter editoren UTEN at endringer blir lagret.
+ Hvis du vil lagre endringene og avslutte, skriver du:
+ :wq <ENTER>
+
+ 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne
+ innføringen. Det kan være: vimtutor <ENTER>
+ Normalt vil du bruke: vim tutor <ENTER>
+
+---> Med «vim» menes Vim-editoren, «tutor» er filen som du vil redigere.
+
+ 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å
+ avslutte og starte editoren på nytt. Deretter flytter du markøren ned til
+ leksjon 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING
+
+
+ ** Trykk tasten x for å slette tegnet under markøren. **
+
+ 1. Flytt markøren til den første linjen merket med ---> .
+
+ 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som
+ skal slettes.
+
+ 3. Trykk tasten x for å slette det uønskede tegnet.
+
+ 4. Repeter punkt 2 til 4 til setningen er lik den som er under.
+
+---> Kkua hoppett ovverr måååånenn.
+---> Kua hoppet over månen.
+
+ 5. Nå som linjen er korrekt, gå til leksjon 1.4.
+
+HUSK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men
+ bruk dem helt til de sitter.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.4: REDIGERING AV TEKST -- INNSETTING
+
+
+ ** Når du er i normalmodus, trykk i for å sette inn tekst. **
+
+ 1. Flytt markøren til den første linjen som er merket med ---> .
+
+ 2. For å gjøre den første linjen lik den andre, flytt markøren til den står
+ på tegnet ETTER posisjonen der teksten skal settes inn.
+
+ 3. Trykk i og skriv inn teksten som mangler.
+
+ 4. Etterhvert som hver feil er fikset, trykk <ESC> for å returnere til
+ normalmodus. Repeter punkt 2 til 4 til setningen er korrekt.
+
+---> Det er tkst som mnglr .
+---> Det er ganske mye tekst som mangler her.
+
+ 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen
+ nedenfor.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 1
+
+
+ 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene.
+ h (venstre) j (ned) k (opp) l (høyre)
+
+ 2. For å starte Vim (fra skall-kommandolinjen), skriv: vim FILNAVN <ENTER>
+
+ 3. For å avslutte Vim, skriv: <ESC> :q! <ENTER> for å forkaste forandringer.
+ ELLER skriv: <ESC> :wq <ENTER> for å lagre forandringene.
+
+ 4. For å slette et tegn under markøren når du er i normalmodus, trykk x
+
+ 5. For å sette inn tekst ved markøren når du er i normalmodus, trykk:
+ i [skriv inn teksten] <ESC>
+
+MERK: Når du trykker <ESC> går du til normalmodus eller du avbryter en uønsket
+ og delvis fullført kommando.
+
+ Nå kan du gå videre til leksjon 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.1: SLETTEKOMMANDOER
+
+
+ ** Trykk dw for å slette til slutten av et ord. **
+
+ 1. Trykk <ESC> for å være sikker på at du er i normalmodus.
+
+ 2. Flytt markøren til den første linjen nedenfor merket ---> .
+
+ 3. Flytt markøren til begynnelsen av ordet som skal slettes.
+
+ 4. Trykk dw og ordet vil forsvinne.
+
+MERK: Bokstavene vil komme til syne på den nederste linjen på skjermen
+ etterhvert som du skriver dem. Hvis du skriver feil, trykk <ESC> og
+ start på nytt.
+
+---> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen.
+---> Det er tre ord som ikke hører hjemme i denne setningen.
+
+ 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå
+ deretter til leksjon 2.2.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.2: FLERE SLETTEKOMMANDOER
+
+
+ ** Trykk d$ for å slette til slutten av linjen. **
+
+ 1. Trykk <ESC> for å være sikker på at du er i normalmodus.
+
+ 2. Flytt markøren til linjen nedenfor merket ---> .
+
+ 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum).
+
+ 4. Trykk d$ for å slette alt til slutten av linjen.
+
+---> Noen skrev slutten på linjen en gang for mye. på linjen en gang for mye.
+
+ 5. Gå til leksjon 2.3 for å forstå hva som skjer.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.3: OM KOMMANDOER OG OBJEKTER
+
+
+ Formatet for slettekommandoen d er som følger:
+
+ [nummer] d objekt ELLER d [nummer] objekt
+
+ Der:
+ nummer -- hvor mange ganger kommandoen utføres (valgfri, standard=1).
+ d -- selve slettekommandoen.
+ objekt -- hva kommandoen vil operere på (listet ut nedenfor).
+
+ En kort liste med objekter:
+ w -- fra markøren til slutten av ordet, inkludert mellomrom.
+ e -- fra markøren til slutten av ordet, IKKE inkludert mellomrom.
+ $ -- fra markøren til slutten av linjen.
+
+MERK: For den eventyrlystne: Skriving av kun objektet i normalmodus uten en
+ kommando vil flytte markøren til objektet i listen.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.4: ET UNNTAK FRA «KOMMANDO-OBJEKT»-REGELEN
+
+
+ ** Trykk dd for å slette en hel linje. **
+
+ På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at
+ det vil være lettere å rett og slett trykke to «d»-er etter hverandre for å
+ slette en linje.
+
+ 1. Flytt markøren til den andre linjen i verset nedenfor.
+ 2. Trykk dd for å slette linjen.
+ 3. Flytt deretter til den fjerde linjen.
+ 4. Trykk 2dd (husk «nummer-kommando-objekt») for å slette disse to
+ linjene.
+
+ 1) Roser er røde
+ 2) Gjørme er gøy,
+ 3) Fioler er blå,
+ 4) Jeg har en bil,
+ 5) Klokker viser tiden,
+ 6) Druer er søte
+ 7) Og du er likeså.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.5: ANGRE-KOMMANDOEN
+
+
+ ** Trykk u for å angre siste kommando, U for å fikse en hel linje. **
+
+ 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den
+ første feilen.
+ 2. Trykk x for å slette det første uønskede tegnet.
+ 3. Trykk så u for å angre den siste utførte kommandoen.
+ 4. Deretter ordner du alle feilene på linjene ved å bruke x kommandoen.
+ 5. Trykk nå en stor U for å sette linjen tilbake til det den var.
+ 6. Trykk u noen ganger for å angre U og foregående kommandoer.
+ 7. Deretter trykker du Ctrl-r (hold Ctrl nede mens du trykker «r») noen
+ ganger for å gjenopprette kommandoene (omgjøre angrekommandoene).
+
+---> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre.
+
+ 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av
+ leksjon 2.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 2
+
+
+ 1. For å slette fra markøren til slutten av et ord, trykk: dw
+
+ 2. For å slette fra markøren til slutten av en linje, trykk: d$
+
+ 3. For å slette en hel linje, trykk: dd
+
+ 4. Formatet for en kommando i normalmodus er:
+
+ [nummer] kommando objekt ELLER kommando [nummer] objekt
+ der:
+ nummer -- hvor mange ganger kommandoen skal repeteres
+ kommando -- hva som skal gjøres, f.eks. d for å slette
+ objekt -- hva kommandoen skal operere på, eksempelvis w (ord),
+ $ (til slutten av linjen) og så videre.
+
+ 5. For å angre tidligere kommandoer, skriv u (liten u)
+ For å angre alle forandringer på en linje, skriv U (stor U)
+ For å omgjøre angringen, trykk Ctrl-r
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.1: «LIM INN»-KOMMANDOEN
+
+
+ ** Trykk p for å lime inn den siste slettede teksten etter markøren **
+
+ 1. Flytt markøren til den første linjen i listen nedenfor.
+
+ 2. Trykk dd for å slette linjen og lagre den i utklippstavlen til Vim.
+
+ 3. Flytt markøren til linjen OVER posisjonen linjen skal settes inn.
+
+ 4. Mens du er i normalmodus, trykk p for å erstatte linjen.
+
+ 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge.
+
+ d) Kan du også lære?
+ b) Fioler er blå,
+ c) Intelligens må læres,
+ a) Roser er røde,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.2: «ERSTATT»-KOMMANDOEN
+
+
+ ** Trykk r og et tegn for å erstatte tegnet under markøren. **
+
+ 1. Flytt markøren til den første linjen nedenfor merket ---> .
+
+ 2. Flytt markøren så den står oppå den første feilen.
+
+ 3. Trykk r og deretter tegnet som skal erstatte det som er feil.
+
+ 4. Repeter punkt 2 og 3 til den første linjen er korrekt.
+
+---> Da dfnne lynjxn ble zkrevet, var det nøen som trykket feite taster!
+---> Da denne linjen ble skrevet, var det noen som trykket feile taster!
+
+ 5. Gå videre til leksjon 3.2.
+
+MERK: Husk at du bør lære ved å BRUKE, ikke pugge.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.3: «FORANDRE»-KOMMANDOEN
+
+
+ ** For å forandre en del av eller et helt ord, trykk cw . **
+
+ 1. Flytt markøren til den første linjen nedenfor som er merket ---> .
+
+ 2. Plasser markøren på «u»-en i «lubjwr».
+
+ 3. Trykk cw og det korrekte ordet (i dette tilfellet, skriv «injen».)
+
+ 4. Trykk <ESC> og gå til den neste feilen (det første tegnet som skal
+ forandres).
+
+ 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre.
+
+---> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen.
+---> Denne linjen har noen ord som må forandres med «forandre»-kommandoen.
+
+ Vær oppmerksom på at cw ikke bare forandrer ordet, men også går inn i
+ innsettingsmodus.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c
+
+
+ ** «Forandre»-kommandoen blir brukt med de samme objektene som «slett». **
+
+ 1. «Forandre»-kommandoen fungerer på samme måte som «slett». Formatet er:
+
+ [nummer] c objekt ELLER c [nummer] objekt
+
+ 2. Objektene er også de samme, som for eksempel w (ord), $ (slutten av
+ en linje) og så videre.
+
+ 3. Gå til den første linjen nedenfor som er merket ---> .
+
+ 4. Flytt markøren til den første feilen.
+
+ 5. Skriv c$ for å forandre resten av linjen lik den andre og trykk <ESC>.
+
+---> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste.
+---> Slutten på denne linjen trenger å bli rettet ved bruk av «c$»-kommandoen.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 3
+
+
+ 1. For å erstatte tekst som allerede er blitt slettet, trykk p . Dette
+ limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet
+ vil den bli limt inn på linjen under markøren).
+
+ 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som
+ skal erstatte det originale tegnet.
+
+ 3. «Forandre»-kommandoen lar deg forandre det spesifiserte objektet fra
+ markøren til slutten av objektet, f.eks.: Trykk cw for å forandre fra
+ markøren til slutten av ordet, c$ for å forandre til slutten av linjen.
+
+ 4. Formatet for «forandre» er:
+
+ [nummer] c objekt ELLER c [nummer] objekt
+
+ Nå kan du gå til neste leksjon.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.1: POSISJON OG FILSTATUS
+
+
+ ** Trykk Ctrl-g for å vise posisjonen i filen og filstatusen.
+ Trykk Shift-G for å gå til en spesifikk linje i filen. **
+
+MERK: Les hele leksjonen før du utfører noen av punktene!
+
+ 1. Hold nede Ctrl-tasten og trykk g . En statuslinje vil komme til syne på
+ bunnen av skjermen med filnavnet og hvilken linje markøren er på. Husk
+ linjenummeret for bruk i steg 3.
+
+ 2. Trykk Shift-G for å gå til bunnen av filen.
+
+ 3. Skriv inn linjenummeret du var på og deretter Shift-G. Dette vil føre deg
+ tilbake til linjen du var på da du trykket Ctrl-g. (Når du skriver inn
+ nummeret, vil det IKKE bli vist på skjermen.)
+
+ 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.2: SØKEKOMMANDOEN
+
+
+ ** Skriv / etterfulgt av en søkestreng som du vil lete etter. **
+
+ 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og
+ markøren kommer til syne på bunnen av skjermen i likhet med
+ «:»-kommandoene.
+
+ 2. Skriv feeeiil og trykk ENTER. Dette er teksten du vil lete etter.
+
+ 3. For å finne neste forekomst av søkestrengen, trykk n . For å lete etter
+ samme søketeksten i motsatt retning, trykk Shift-N .
+
+ 4. Hvis du vil lete etter en tekst bakover i filen, bruk kommandoen ?
+ istedenfor / .
+
+MERK: Når søket treffer slutten av filen vil det fortsette fra den andre enden
+ av filen.
+
+---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.3: FINN SAMSVARENDE PARENTESER
+
+
+ ** Trykk % for å finne en samsvarende ), ] eller } . **
+
+ 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket ---> .
+
+ 2. Trykk % .
+
+ 3. Markøren flytter seg nå til parentesen som samsvarer med den du stod på.
+
+ 4. Trykk % for å flytte markøren tilbake til den første parentesen.
+
+---> Dette ( er en testlinje med (, [ ] og { } i den ))
+
+MERK: Dette er meget god hjelp til feilsøking i programmer som har ubalansert
+ antall parenteser!
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.4: EN MÅTE Å RETTE SKRIVEFEIL PÅ
+
+
+ ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». **
+
+ 1. Flytt markøren til linjen nedenfor som begynner med ---> .
+
+ 2. Skriv :s/deen/den/ <ENTER> . Legg merke til at denne kommandoen bare
+ forandrer den første forekomsten av ordet på linjen.
+
+ 3. Skriv :s/deen/den/g som betyr global erstatning på linjen. Dette vil
+ erstatte alle forekomster av søketeksten på linjen du står på.
+
+---> deen beste er deen som kan kaste deen tyngste steinen lengst
+
+ 4. Skriv :#,#s/gammel/ny/g for å erstatte tekst mellom to linjer, der #,#
+ er linjenumrene på de to linjene.
+ Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 4
+
+
+ 1. Ctrl-g viser nåværende posisjon i filen og filstatusen. Shift-G går til
+ slutten av filen. Et linjenummer etterfulgt av Shift-G går til denne
+ linjen.
+
+ 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten.
+ Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten.
+ Etter et søk kan du trykke n for å finne neste forekomst i den samme
+ retningen eller Shift-N for å lete i motsatt retning.
+
+ 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne
+ parentesten som samsvarer med den markøren står på.
+
+ 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny
+ Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g
+ Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g
+ Erstatte alle forekomster i en fil: :%s/gammel/ny/g
+ For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO
+
+
+ ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. **
+
+ 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av
+ skjermen. Dette lar deg skrive en kommando.
+
+ 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst
+ ekstern kommando.
+
+ 3. Som et eksempel, skriv ls etter utropstegnet og trykk <ENTER>. Du vil
+ nå få en liste over filene i katalogen, akkurat som om du hadde kjørt
+ kommandoen direkte fra skallet. Eller bruk :!dir hvis «ls» ikke virker.
+
+---> MERK: Det er mulig å kjøre alle mulige eksterne kommandoer på denne
+ måten.
+
+---> MERK: Alle «:»-kommandoer må avsluttes med <ENTER>.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.2: MER OM LAGRING AV FILER
+
+
+ ** For å lagre endringene gjort i en fil, skriv :w FILNAVN . **
+
+ 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du
+ vet allerede at du må trykke <ENTER> etter dette.
+
+ 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST .
+
+ 3. Skriv :w TEST (der TEST er filnavnet du velger).
+
+ 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å
+ sjekke dette, skriv :!dir igjen for å se innholdet av katalogen.
+
+---> Hvis du nå hadde avsluttet Vim og startet på nytt igjen med filnavnet
+ TEST, ville filen vært en eksakt kopi av innføringen da du lagret den.
+
+ 5. Fjern filen ved å skrive :!rm TEST hvis du er på et UNIX-lignende
+ operativsystem, eller :!del TEST hvis du bruker MS-DOS.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.3: DELVIS LAGRING AV EN FIL
+
+
+ ** For å lagre en del av en fil, skriv :#,# w FILNAVN **
+
+ 1. En gang til: Skriv :!dir eller :!ls for å få en liste over filene i
+ katalogen. Velg et passende filnavn, som TEST .
+
+ 2. Flytt markøren til toppen av denne siden og trykk Ctrl-g for å finne
+ nummeret på denne linjen. HUSK DETTE NUMMERET!
+
+ 3. Gå til nederste linje på skjermen og trykk Ctrl-g igjen. HUSK DETTE
+ LINJENUMMERET OGSÅ!
+
+ 4. For å lagre BARE en del av filen, skriv :#,# w TEST hvor #,# er de to
+ numrene du skulle huske (topp og bunn) og TEST er filnavnet.
+
+ 5. Sjekk med :!dir om filen er der, men IKKE slett den.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.4: HENTING OG SAMMENSLÅING AV FILER
+
+
+** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN . **
+
+ 1. Skriv :!dir for å forsikre deg om at filen TEST finnes.
+
+ 2. Plasser markøren på toppen av denne siden.
+
+MERK: Etter at du har utført steg 3 vil du se leksjon 5.3. Gå nedover forbi
+ den og til denne posisjonen igjen.
+
+ 3. Hent «TEST»-filen din med kommandoen :r TEST der TEST er navnet på
+ filen.
+
+MERK: Filen du henter vil bli plassert der markøren står.
+
+ 4. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av
+ leksjon 5.3, originalen og denne versjonen.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 5
+
+
+ 1. :!KOMMANDO utfører en ekstern kommandio.
+
+ Noen nyttige eksempler er:
+ (MS-DOS) (Unix)
+ :!dir :!ls -- List filene i katalogen
+ :!del FIL :!rm FIL -- Slett filen FIL
+
+ 2. :w FILNAVN skriver den filen du står i til disken med navnet FILNAVN .
+
+ 3. :#,#w FILNAVN lagrer linjene # til # til filen FILNAVN .
+
+ 4. :r FILNAVN henter inn en annen fil og legger den inn like etter
+ markøren.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.1: «ÅPNE LINJE»-KOMMANDOEN
+
+
+ ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå i
+ innsettingsmodus **
+
+ 1. Flytt markøren til linjen nedenfor merket ---> .
+
+ 2. Skriv o (liten o) for å starte på en ny linje nedenfor markøren og gå
+ over til innsettingsmodus.
+
+ 3. Kopier linjen som er merket ---> og trykk <ESC> for å avslutte
+ innsettingsmodusen.
+
+---> Etter at o er skrevet blir markøren plassert på den tomme linjen.
+
+ 4. For å lage en ny linje OVER markøren, trykk rett og slett en stor O
+ istedenfor en liten o . Prøv dette på linjen nedenfor.
+---> Lag en ny, tom linje over denne med Shift-O mens markøren står på den.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.2: «LEGG TIL»-KOMMANDOEN
+
+
+ ** Skriv a for å legge til tekst ETTER markøren. **
+
+ 1. Flytt markøren til slutten av den første linjen merket ---> ved å
+ trykke $ i normalmodusen.
+
+ 2. Trykk a (liten a) for å legge til tekst ETTER tegnet under markøren.
+ (Stor A legger til på slutten av linjen.)
+
+MERK: Dette gjør at du slipper å trykke i , det siste tegnet, teksten som
+ skal settes inn, <ESC>, høyrepil og til sist, x bare for å legge til
+ på slutten av en linje!
+
+ 3. Gjør ferdig den øverste linjen. Legg merke til at «legg til» er det samme
+ som innsettingsmodusen, med den forskjellen hvor teksten settes inn.
+
+---> På denne linjen må det legges
+---> På denne linjen må det legges til tekst på slutten.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.3: EN ANNEN VERSJON AV «ERSTATT»
+
+
+ ** Skriv R for å erstatte mer enn ett tegn. **
+
+ 1. Flytt markøren til den første linjen nedenfor merket ---> .
+
+ 2. Plasser markøren på begynnelsen av det første ordet som er forskjellig
+ fra den andre linjen merket ---> (ordet «siste»).
+
+ 3. Trykk R og erstatt resten av linjen med den samme teksten som står på
+ den andre linjen.
+
+---> For å gjøre den første linjen lik den andre, må bokstaven stor R brukes.
+---> For å gjøre den første linjen lik den andre, trykk R og den nye teksten.
+
+ 4. Legg merke til at når du trykker <ESC> for å avslutte, bevares teksten
+ som ikke er redigert.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.4: SETT VALG
+
+
+ ** Sett et valg så et søk eller erstatning ignorerer store/små bokstaver. **
+
+ 1. Let etter «ignore» ved å skrive:
+ /ignore <ENTER>
+ Repeter flere ganger ved å trykke n .
+
+ 2. Sett «ic»-valget (Ignore Case) ved å skrive:
+ :set ic
+
+ 3. Let etter «ignore» igjen ved å skrive: n
+ Repeter søket flere ganger ved å trykke n .
+
+ 4. Sett «hlsearch»- og «incsearch»-valgene:
+ :set hls is
+
+ 5. Skriv søkekommandoen igjen, og se hva som skjer:
+ /ignore <ENTER>
+
+ 6. Hvis du vil slå av uthevingen på søketeksten, skriv :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 6
+
+
+ 1. Trykk o for å legge til en linje NEDENFOR markøren og plassere markøren
+ på den nye linjen i innsettingsmodus.
+ Hvis du trykker en stor O åpnes linjen OVER linjen markøren står på.
+
+ 2. Skriv en a for å sette inn tekst ETTER tegnet markøren er på.
+ En stor A vil legge til tekst på slutten av linjen.
+
+ 3. Ved å trykke R for går inn i erstatningsmodus helt til <ESC> trykkes
+ for å avslutte modusen.
+
+ 4. Skriv :set xxx for å sette valget «xxx».
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKSJON 7: TILGJENGELIGE HJELPEKOMMANDOER
+
+
+ ** Bruk det innebyggede hjelpesystemet. **
+
+ Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av
+ disse måtene:
+ - Trykk Hjelp-tasten (hvis du har noen)
+ - Trykk F1-tasten (hvis du har noen)
+ - Skriv :help <ENTER>
+
+ Skriv :q <ENTER> for å lukke hjelpevinduet.
+
+ Du kan få hjelp på omtrent alle temaer om Vim ved å skrive et parameter til
+ «:help»-kommandoen. Prøv disse (ikke glem Enter etter hver):
+
+ :help w
+ :help c<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKSJON 8: LAG ET OPPSTARTSSKRIPT
+
+
+ ** Slå på funksjoner i Vim. **
+
+ Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av
+ som standard. For å begynne å bruke dem kan du lage en «vimrc»-fil.
+
+ 1. Start redigeringen av «vimrc»-filen, dette avhenger av systemet ditt:
+ :edit ~/.vimrc for UNIX
+ :edit $VIM/_vimrc for MS Windows
+
+ 2. Les inn eksempelfilen for «vimrc»:
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Lagre filen med:
+ :write
+
+ Neste gang du starter Vim vil den bruke farger og utheving i henhold til
+ syntaksen i filen. Ved å legge inn forskjellige valg i «vimrc»-filen, kan du
+ forandre oppsettet i Vim til det du foretrekker.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Her slutter innføringen i Vim. Den var ment som en rask oversikt over
+ editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på
+ langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen
+ ved å skrive :help user-manual .
+
+ For videre lesing og studier, kan denne boken anbefales:
+ «Vim - Vi Improved» av Steve Oualline
+ Utgiver: New Riders
+ Den førstnevnte boken er fullt og helt dedikert til Vim. Spesielt nyttig
+ for nybegynnere. Inneholder mange eksempler og illustrasjoner.
+ Se http://iccf-holland.org/click5.html
+
+ Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også:
+ «Learning the Vi Editor» av Linda Lamb
+ Utgiver: O'Reilly & Associates Inc.
+ Det er en god bok for å få vite omtrent hva som helst om Vi.
+ Den sjette utgaven inneholder også informasjon om Vim.
+
+ Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware,
+ Colorado School of Mines med idéer av Charles Smith, Colorado State
+ University. Email: bware@mines.colorado.edu .
+
+ Modifisert for Vim av Bram Moolenaar.
+ Oversatt av Øyvind A. Holm -- sunny _AT_ sunbase.org
+ tutor.no 279 2004-05-12 09:21:53Z sunny
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+vim: set ts=8 :
diff --git a/runtime/tutor/tutor.pl b/runtime/tutor/tutor.pl
new file mode 100644
index 000000000..eccb81b9c
--- /dev/null
+++ b/runtime/tutor/tutor.pl
@@ -0,0 +1,830 @@
+===============================================================================
+= W i t a j w t u t o r i a l u V I M - a - Wersja 1.5. =
+===============================================================================
+
+ Vim to potê¿ny edytor, który posiada wiele poleceñ, zbyt du¿o by
+ wyja¶niæ je wszystkie w tym tutorialu. Ten przewodnik ma nauczyæ
+ Ciê pos³ugiwaæ siê wystarczaj±co wieloma komendami by¶ móg³ ³atwo
+ u¿ywaæ Vim-a jako edytora ogólnego przeznaczenia.
+
+ Czas potrzebny na ukoñczenie tutoriala to 25 do 30 minut i zale¿y
+ od tego jak wiele czasu spêdzisz na eksperymentowaniu. Polecenia
+ wykonywane w czasie lekcji zmodyfikuj± tekst. Zrób wcze¶niej kopiê
+ tego pliku do æwiczeñ (je¶li zacz±³e¶ komend± "vimtutor" to ju¿
+ pracujesz na kopii).
+
+ Wa¿ne jest, by¶ pamiêta³, ¿e przewodnik ten zosta³ zaprojektowany do
+ nauki poprzez æwiczenia. To oznacza, ¿e musisz wykonywaæ polecenia
+ by nauczyæ siê ich prawid³owo. Je¶li bêdziesz jedynie czyta³ tekst
+ szybko zapomnisz wiele poleceñ!
+
+ Teraz upewnij siê, ¿e nie masz wci¶niêtego CapsLocka i wciskaj j
+ tak d³ugo dopóki Lekcja 1.1. nie wype³ni ca³kowicie ekranu.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.1.: PORUSZANIE SIÊ KURSOREM
+
+ ** By wykonaæ ruch kursorem, wci¶nij h, j, k, l jak pokazano. **
+
+ ^
+ k Wskazówka: h jest po lewej
+ < h l > l jest po prawej
+ j j wygl±da jak strza³ka w dó³
+ v
+ 1. Poruszaj kursorem dopóki nie bêdziesz pewien, ¿e pamiêtasz polecenia.
+
+ 2. Trzymaj j tak d³ugo a¿ bêdzie siê powtarza³.
+---> Teraz wiesz jak doj¶æ do nastêpnej lekcji.
+
+ 3. U¿ywaj±c strza³ki w dó³ przejd¼ do nastêpnej lekcji.
+
+Uwaga: Je¶li nie jeste¶ pewien czego¶ co wpisa³e¶, wci¶nij <ESC> by wróciæ do
+ trybu Normal. Wtedy powtórz polecenie.
+
+Uwaga: Klawisze kursora tak¿e powinny dzia³aæ, ale u¿ywaj±c hjkl bêdziesz
+ w stanie poruszaæ siê o wiele szybciej jak siê tylko przyzwyczaisz.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.2.: WCHODZENIE I WYCHODZENIE Z VIM-a
+
+ !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca³± lekcjê.!!
+
+ 1. Wci¶nij <ESC> (aby upewniæ siê, ¿e jeste¶ w trybie Normal).
+ 2. Wpisz: :q!<ENTER>.
+
+---> To spowoduje wyj¶cie z edytora BEZ zapamiêtywania zmian jakie
+ zd±¿y³e¶ zrobiæ. Je¶li chcesz zapamiêtaæ zmiany i wyj¶æ
+ wpisz: :wq<ENTER>
+
+ 3. Kiedy widzisz znak zachêty pow³oki wpisz komendê, ¿eby wróciæ
+ do tutoriala.
+ Powinienie¶ wpisaæ: vimtutor<ENTER>
+ Normalnie u¿y³by¶: vim tutor<ENTER>
+
+---> 'vim' oznacza edytor vim, 'tutor' jest plikem, który chcia³by¶
+ edytowaæ.
+
+ 4. Je¶li chcesz zapamiêtaæ polecenia, wykonaj kroki 1. do 3. aby
+ wyj¶æ i wróciæ do edytora. Potem przenie¶ siê do Lekcji 1.3.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE
+
+
+ ** W trybie Normal wci¶nij x aby usun±æ znak pod kursorem. **
+
+ 1. Przenie¶ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. By poprawiæ b³êdy, naprowad¼ kursor na znak do usuniêcia.
+
+ 3. Wci¶nij x aby usun±æ niechciany znak.
+
+ 4. Powtarzaj kroki 2. do 4. dopóki zdanie nie jest poprawne.
+
+---> Kkrowa prrzeskoczy³a prrzez ksiiê¿ycc.
+
+ 5. Teraz kiedy zdanie jest poprawione przejd¼ do Lekcji 1.4.
+
+UWAGA: Ucz siê przez æwiczenie, nie wkuwanie.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie)
+
+
+ ** W trybie Normal wci¶nij i aby wstawiæ tekst. **
+
+ 1. Przenie¶ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. Aby poprawiæ pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym
+ gdzie tekst ma byæ wstawiony.
+
+ 3. Wci¶nij i a nastêpnie wpisz konieczne poprawki.
+
+ 4. Po poprawieniu b³êdu wci¶nij <ESC> by wróciæ do trybu Normal.
+ Powtarzaj kroki 2. do 4. aby poprawiæ ca³e zdanie.
+
+---> W tej brkje trochê .
+---> W tej linii brakuje trochê tekstu.
+
+ 5. Kiedy czujesz siê swobodnie wstawiaj±c tekst przejd¼ do
+ podsumowania poni¿ej.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 1. PODSUMOWANIE
+
+ 1. Poruszasz kursorem u¿ywaj±c "strza³ek" i klawiszy hjkl .
+ h (w lewo) j (w dó³) k (do góry) l (w prawo)
+
+ 2. By wej¶æ do Vim-a (od znaku zachêty) wpisz:
+ vim NAZWA_PLIKU<ENTER>
+
+ 3. By wyj¶æ z Vim-a wpisz:
+ <ESC> :q!<ENTER> by usun±c wszystkie zmiany.
+ LUB: <ESC> :wq<ENTER> by zmiany zachowaæ.
+
+ 4. By usun±æ znak pod kursorem w trybie Normal: x
+
+ 5. By wstawiæ tekst przed kursorem w trybie Normal:
+ i type in text <ESC>
+
+UWAGA: Wci¶niêcie <ESC> przeniesie Ciê z powrotem do trybu Normal
+lub odwo³a niechciane lub czê¶ciowo wprowadzone polecenia.
+
+Teraz mo¿emy kontynuowaæ i przej¶æ do Lekcji 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.1.: POLECENIE DELETE (usuwanie)
+
+
+ ** Wpisz dw by usun±c tekst do koñca wyrazu. **
+
+ 1. Wci¶nij <ESC> by upewniæ siê, ¿e jeste¶ w trybie Normal.
+
+ 2. Przenie¶ kursor do linii poni¿ej oznaczonej --->.
+
+ 3. Przesuñ kursor na pocz±tek wyrazu, które chcesz usun±æ.
+
+ 4. Wpisz dw by usun±c wyraz.
+
+ UWAGA: Litery dw bêd± siê pojawiaæ na dole ekranu w miarê
+ wpisywania. Je¶li wpisa³e¶ co¶ ¼le wci¶nij <ESC> i zacznij od
+ pocz±tku.
+
+---> Jest tu parê papier wyrazów, które kamieñ nie nale¿± do no¿yce tego zdania.
+
+ 5. Powtarzaj kroki 3. i 4. dopóki zdanie nie bêdzie poprawne, potem
+ przejd¼ do Lekcji 2.2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.2.: WIÊCEJ POLECEÑ USUWAJ¡CYCH
+
+
+ ** Wpisz d$ aby usun±æ tekst do koñca linii. **
+
+ 1. Wci¶nij <ESC> aby siê upewniæ, ¿e jeste¶ w trybie Normal.
+
+ 2. Przenie¶ kursor do linii poni¿ej oznaczonej --->.
+
+ 3. Przenie¶ kursor do koñca poprawnego zdania (PO pierwszej . ).
+
+ 4. Wpisz d$ aby usun±æ resztê linii.
+
+---> Kto¶ wpisa³ koniec tego zdania dwukrotnie. zdania dwukrotnie.
+
+
+ 5. Przejd¼ do Lekcji 2.3. by zrozumieæ co siê sta³o.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.3.: O POLECENIACH I OBIEKTACH
+
+
+ Format dla polecenia usuwaj±cego d jest taki:
+
+ [liczba] d obiekt LUB d [liczba] obiekt
+
+ Gdzie:
+ liczba - ile razy polecenie ma byæ wykonane (opcjonalne, domy¶lna=1).
+ d - polecenie usuwaj±ce.
+ obiekt - na czym polecenie bêdzie wykonywane (lista poni¿ej).
+
+ Krótka lista obiektów:
+ w - od kursora do koñca wyrazu w³±czaj±c spacjê.
+ e - od kursora do koñca wyrazu NIE w³±czaj±c spacji.
+ $ - od kursora do koñca linii.
+
+UWAGA: Dla ciekawskich, wybieranie obiektu w trybie Normal bez polecania
+ polecenia przeniesie kursor tak jak opisano w li¶cie obiektów.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.4.: WYJ¡TEK DO 'POLECENIE-OBIEKT'
+
+
+ ** Wpisz dd by usun±c ca³± liniê. **
+
+ Z powodu czêsto¶ci usuwania ca³ych linii, projektanci Vim-a zdecydowali, ¿e
+ bêdzie ³atwiej wpisaæ dwa razy pod rz±d d aby usun±æ liniê.
+
+ 1. Przenie¶ kursor do zdania poni¿ej.
+ 2. Wpisz dd aby usun±c wiersz.
+ 3. Teraz przenie¶ siê do czwartego wiersza.
+ 4. Wpisz 2dd (pamiêtaj liczba-polecenie-obiekt) aby usun±c dwia wiersze.
+
+ 1) Ró¿e s± czerwone,
+ 2) B³oto jest fajne,
+ 3) Fio³ki s± niebieskie,
+ 4) Mam samochód,
+ 5) Zegar podaje czas,
+ 6) Cukier jest s³odki,
+ 7) I ty te¿.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.5.: POLECENIE UNDO (cofnij)
+
+
+ ** Wci¶nij u aby cofn±æ skutki ostatniego polecenia.
+ U za¶, by cofn±æ skutki dla ca³ej linii. **
+
+ 1. Przenie¶ kursor do zdania poni¿ej oznaczonego ---> i umie¶æ go na
+ pierwszym b³êdzie.
+ 2. Wpisz x aby usun±æ pierwszy niechciany znak.
+ 3. Teraz wci¶nij u aby cofn±æ skutki ostatniego polecenia.
+ 4. Tym razem popraw wszystkie b³êdy w linii u¿ywaj±c polecenia x .
+ 5. Teraz wci¶nij wielkie U aby przywróciæ liniê do oryginalnego stanu.
+ 6. Teraz wci¶nij u kilka razy by cofn±æ U i poprzednie polecenia.
+ 7. Teraz wpsz CTRL-R (trzymaj równocze¶nie wci¶niête klawisze CTRL i R)
+ kilka razy, by cofn±æ cofniêcia.
+
+---> Poopraw blêdyyy w teej liniii i zaamiieñ je prrzez coofnij.
+
+ 8. To s± bardzo po¿yteczne polecenia.
+
+ Przejd¼ teraz do podsumowania Lekcji 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 2. PODSUMOWANIE
+
+ 1. By usun±æ znaki od kursora do koñca wyrazu wpisz: dw
+
+ 2. By usun±æ znaki od kursora do koñca linii wpisz: d$
+
+ 3. By usun±æ ca³± liniê: dd
+
+ 4. Format polecenia w trybie Normal:
+
+ [liczba] polecenie obiekt LUB polecenie [liczba] obiekt
+
+ Gdzie:
+ liczba - ile razy polecenie ma byæ wykonane
+ polecenie - to co trzeba zrobiæ (np. d dla usuwania)
+ obiekt - na czym polecenie bêdzie wykonywane, takie jak w (wyraz),
+ $ (do koñca linii), etc.
+
+ 5. By cofn±æ poprzednie polecenie, wpisz: u (ma³e u)
+ By cofn±æ wszystkie zmiany w linii wpisz: U (wielkie U)
+ By cofn±æ cofniêcia wpisz: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.1.: POLECENIE PUT (wstaw)
+
+
+ ** Wpisz p by wstawiæ ostatnie usuniêcia po kursorze. **
+
+ 1. Przenie¶ kursor do pierwszej linii w zestawie poni¿ej.
+
+ 2. Wpisz dd aby usun±æ liniê i przechowaæ j± w buforze Vim-a.
+
+ 3. Przenie¶ kursor do linii POWY¯EJ tej gdzie usuniêta linia powinna
+ siê znajdowaæ.
+
+ 4. W trybie Normal, wci¶nij p by wstawiæ liniê.
+
+ 5. Powtaj kroki 2. do 4. a¿ znajd± siê w odpowiednim porz±dku.
+
+ d) Jak dwa anio³ki.
+ b) Na dole fio³ki,
+ c) A my siê kochamy,
+ a) Na górze ró¿e,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.2.: POLECENIE REPLACE (zast±p)
+
+
+ ** Wpisz r a nastêpnie znak by zast±piæ znak pod kursorem. **
+
+ 1. Przenie¶ kursor do pierwszej linii poni¿ej oznaczonej --->
+
+ 2. Ustaw kursor na pierwszym b³êdzie.
+
+ 3. Wpisz r a potem znak jaki powinien zast±piæ b³êdny.
+
+ 4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie bêdzie poprawna.
+
+---> Kjedy ten wiersz bi³ wstókiwany kto¶ wcizn±³ perê z³ych klawirzy!
+---> Kiedy ten wiersz by³ wstukiwany kto¶ wcisn±³ parê z³ych klawiszy!
+
+ 5. Teraz czas na Lekcjê 3.3.
+
+
+UWAGA: Pamiêtaj by uczyæ siê æwicz±c, a nie pamiêciowo.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.3.: POLECENIE CHANGE (zmieñ)
+
+ ** By zmieniæ ca³e s³owo lub jego czê¶æ wpisz cw (change word). **
+
+ 1. Przenie¶ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. Umie¶æ kursor na u w lunos.
+
+ 3. Wpisz cw i popraw wyraz (w tym wypadku wstaw 'inia').
+
+ 4. Wci¶nij <ESC> i przejd¼ do nastêpnego b³êdu (pierwszy znak, który ma
+ ulec zmianie).
+
+ 5. Powtarzaj kroki 3. i 4. dopóki pierwsze zdanie nie bêdzie takie same
+ jak drugie.
+
+---> Ta lunos ma pire s³ów, które t¿ina zbnic u¿ifajonc pcmazu zmieñ.
+---> Ta linia ma parê s³ów, które trzeba zmieniæ u¿ywaj±c polecenia zmieñ.
+
+ Zauwa¿, ¿e cw nie tylko zamienia wyraz, ale tak¿e zmienia tryb na
+ Insert (wprowadzanie).
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.4.: WIÊCEJ ZMIAN U¯YWAJ¡C c
+
+
+ ** Polecenie change u¿ywa takich samych obiektów jak delete. **
+
+ 1. Polecenie change dzia³a tak samo jak delete. Format wygl±da tak:
+
+ [liczba] c obiekt LUB c [liczba] obiekt
+
+ 2. Obiekty s± tak¿e takie same, np.: w (wyraz), $ (koniec linii), etc.
+
+ 3. Przenie¶ siê do pierwszej linii poni¿ej oznaczonej --->
+
+ 4. Ustaw kursor na pierwszym b³êdzie.
+
+ 5. Wpisz c$ , popraw koniec wiersza i wci¶nij <ESC>.
+
+---> Koniec tego wiersza musi byæ poprawiony aby wygl±dal tak jak drugi.
+---> Koniec tego wiersza musi byæ poprawiony u¿ywaj±c polecenia c$ .
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 3. PODSUMOWANIE
+
+
+ 1. Aby wstawiæ tekst, który zosta³ wcze¶niej usuniêty wci¶nij p . To
+ polecenie wstawia skasowany tekst PO kursorze (je¶li ca³a linia
+ zosta³a usuniêta, zostanie ona umieszczona w linii poni¿ej kursora).
+
+ 2. By zamieniæ znak pod kursorem wci¶nij r a potem znak, który ma zast±piæ
+ oryginalny.
+
+ 3. Polecenie change pozwala Ci na zast±pienie wyszczególnionego obiektu
+ od kursora do koñca obiektu. Np. wpisz cw aby zamieniæ tekst od
+ kursora do koñca wyrazu, c$ aby zmieniæ tekst do koñca linii.
+
+ 4. Format do polecenia change (zmieñ):
+
+ [liczba] c obiekt LUB c [liczba] obiekt
+
+ Teraz przejd¼ do nastêpnej lekcji.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.1.: LOKALIZACJA ORAZ STATUS PLIKU
+
+ ** Naci¶nij CTRL-G aby zobaczyæ swoje po³o¿enie w pliku i status
+ pliku. Naci¶nij SHIFT-G aby przej¶æ do linii w pliku. **
+
+ UWAGA: Przeczytaj ca³± lekcjê zanim wykonasz jakie¶ polecenia!!!
+
+ 1. Przytrzymaj klawisz CTRL i wci¶nij g . Na dole strony pojawi siê pasek
+ statusu z nazw± pliku i numerem linii, w której jeste¶. Zapamiêtaj numer
+ linii dla potrzeb kroku 3.
+
+ 2. Wci¶nij SHIFT-G aby przej¶æ na koniec pliku.
+
+ 3. Wpisz numer linii, w której by³e¶ a potem SHIFT-G. To przeniesie Ciê
+ z powrotem do linii, w której by³e¶ kiedy wcisn±³e¶ CTRL-G (kiedy
+ wpisujesz numery NIE pojawiaj± siê one na ekranie).
+
+ 4. Je¶li czujesz siê wystarczaj±co pewnie, wykonaj kroki 1-3.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.2.: POLECENIE SZUKAJ
+
+
+ ** Wpisz / a nastêpnie wyra¿enie aby je znale¼æ. **
+
+ 1. W trybie Normal wpisz / . Zauwa¿, ¿e znak ten, oraz kursor pojawi±
+ siê na dole ekranu tak samo jak polecenie : .
+
+ 2. Teraz wpisz b³ond<ENTER> . To jest s³owo, którego chcesz szukaæ.
+
+ 3. By szukaæ tej samej frazy ponownie, po prostu wci¶nij n .
+ Aby szukaæ tej frazy w przeciwnym, kierunku wci¶nij SHIFT-N.
+
+ 4. Je¶li chcesz szukaæ frazy do ty³u, u¿yj polecenia ? zamiast / .
+
+---> Kiedy polecenie 'szukaj' osi±gnie koniec pliku, przeszukiwanie
+ zacznie siê od pocz±tku pliku.
+
+ 'b³ond' to nie jest metoda by przeliterowaæ b³±d; 'b³ond' to b³±d.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.3.: W POSZUKIWANIU PARUJ¡CYCH NAWIASÓW
+
+
+ ** Wpisz % by znale¼æ pasuj±cy ),], lub } . **
+
+ 1. Umie¶æ kursor na którym¶ z (, [, lub { w linii poni¿ej oznaczonej --->.
+
+ 2. Teraz wpisz znak % .
+
+ 3. Kursor powinien siê znale¼æ na paruj±cym nawiasie.
+
+ 4. Wci¶nij % aby przenie¶æ kursor z powrotem do paruj±cego nawiasu.
+
+---> To ( jest linia testowa z (, [, ] i {, } . ))
+
+UWAGA: Ta funkcja jest bardzo u¿yteczna w debuggowaniu programu
+ z niesparowanymi nawiasami!
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.4.: INNA METODA POPRAWIANIA B£ÊDÓW
+
+
+ ** Wpisz :s/stary/nowy/g aby zamieniæ 'stary' na 'nowy'. **
+
+ 1. Przenie¶ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. Wpisz :s/czaas/czas<ENTER> . Zauwa¿, ¿e to polecenie zmienia
+ tylko pierwsze wyst±pienie 'czaas' w linii.
+
+ 3. Teraz wpisz :s/czaas/czas/g oznacza zamianê (substytucjê)
+ globalnie w ca³ej linii. Zmienia wszystkie wyst±pienia w linii.
+
+---> Najlepszy czaas na zobaczenie naj³adniejszych kwiatów to czaas wiosny.
+
+ 4. Aby zmieniæ wszystkie wyst±pienia ³añcucha znaków pomiêdzy dwoma liniami,
+ wpisz: :#,#s/stare/nowe/g gdzie #,# s± numerami dwóch linii.
+ Wpisz :%s/stare/nowe/g by zmieniæ wszystkie wyst±pienia w ca³ym pliku.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 4. PODSUMOWANIE
+
+
+ 1. CTRL-G poka¿e Twoj± pozycjê w pliku i status pliku. SHIFT-G przenosi
+ Ciê do koñca pliku. SHIFT-G poprzedzony liczb± przenosi Ciê do linii
+ o tym numerze.
+
+ 2. Wpisanie / a nastêpnie ³añcucha znaków szuka ³añcucha DO PRZODU.
+ Wpisanie ? a nastêpnie ³añcucha znaków szuka ³añcucha DO TY£U.
+ Po wyszukiwaniu wci¶nij n by znale¼æ nastêpne wyst±pienie szukanej
+ frazy tym samym kierunku lub Shift-N by szukaæ w kierunku przeciwnym.
+
+ 3. Wpisanie % gdy kursor znajduje siê na (,),[,],{, lub } lokalizuje
+ paruj±cy znak.
+
+ 4. By zamieniæ pierwszy stary na nowy w linii wpisz :s/stary/nowy
+ By zamieniæ wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
+ By zamieniæ frazy pomiêdzy dwoma liniami # wpisz :#,#s/stary/nowy/g
+ By zamieniæ wszystkie wyst±pienia w pliku wpisz :%s/stary/nowy/g
+ By Vim prosi³ Ciê o potwierdzienie dodaj 'c' :%s/stary/nowy/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.1.: JAK WYKONAÆ POLECENIA ZEWNÊTRZNE
+
+
+ ** Wpisz :! a nastêpnie zewnêtrzne polecenie by je wykonaæ. **
+
+ 1. Wpisz znajome polecenie : by ustawiæ kursor na dole ekranu. To pozwala
+ na wprowadzenie polecenia.
+
+ 2. Teraz wstaw ! (wykrzyknik). To umo¿liwi Ci wykonanie dowolnego
+ zewnêtrznego polecenia pow³oki.
+
+ 3. Jako przyk³ad wpisz ls za ! a nastêpnie wci¶nij <ENTER>. To polecenie
+ poka¿e spis plików w Twoim katalogu, tak jakby¶ by³ przy znaku zachêty
+ pow³oki. Mo¿esz te¿ u¿yæ :!dir je¶li ls nie dzia³a.
+
+---> Uwaga: W ten sposób mo¿na wykonaæ wszystkie polecenia pow³oki.
+---> Uwaga: Wszystkie polecenia : musz± byæ zakoñczone <ENTER>.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.2.: WIÊCEJ O ZAPISYWANIU PLIKÓW
+
+
+ ** By zachowaæ zmiany w pliku wpisz :w NAZWA_PLIKU . **
+
+ 1. Wpisz :!dir lub :!ls by zobaczyæ spis plików w katalogu.
+ Ju¿ wiesz, ¿e musisz wcisn±æ <ENTER> po tym.
+
+ 2. Wybierz nazwê pliku jaka jeszcze nie istnieje, np. TEST.
+
+ 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw± pliku jak± wybra³e¶.)
+
+ 4. To polecenie zapamiêta ca³y plik (Vim Tutor) pod nazw± TEST.
+ By to sprawdziæ wpisz :!dir , ¿eby znowu zobaczyæ listê plików.
+
+---> Zauwa¿, ¿e gdyby¶ teraz wyszed³ z Vim-a, a nastêpnie wszed³ ponownie
+ komend± vim TEST , plik by³by dok³adn± kopi± tutoriala kiedy go
+ zapisywa³e¶.
+
+ 5. Teraz usuñ plik wpisuj±c: :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.3.: SELEKTYWNE POLECENIE WRITE (zapisz)
+
+
+ ** By zachowaæ czê¶æ pliku wpisz :#,# w NAZWA_PLIKU **
+
+ 1. Jeszcze raz wpisz :!dir lub :!ls by uzyskaæ listê plików
+ w katalogu i wybierz odpowiedni± nazwê tak± jak TEST.
+
+ 2. Przenie¶ kursor na góre tej strony i wci¶nij CTRL-G by uzyskaæ
+ numer linii. ZAPAMIÊTAJ TÊ LICZBÊ!
+
+ 3. Teraz przenie¶ siê na dó³ strony i wpisz CTRL-G znowu. ZAPAMIÊTAJ
+ NUMER TAK¯E TEJ LINII!
+
+ 4. By zachowaæ JEDYNIE czê¶æ pliku wpisz :#,# w TEST gdzie #,# to
+ dwie liczby jakie zapamiêta³e¶ (góra, dó³ ekranu), a TEST to nazwa
+ Twojego pliku.
+
+ 5. Ponownie sprawd¼ czy ten plik tam jest ( :!dir ), ale NIE usuwaj go.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.4.: WSTAWIANIE I £¡CZENIE PLIKÓW
+
+
+ ** By wstawiæ zawarto¶æ pliku wpisz :r NAZWA_PLIKU **
+
+ 1. Wpisz :!dir by siê upewniæ, ze Twój plik TEST zosta³ poprawnie
+ zapamiêtany.
+
+ 2. Umie¶æ kursor na górze strony.
+
+UWAGA: Po wykonaniu kroku 3. ponownie zobaczysz Lekcjê 5.3. Potem przejd¼
+ do DO£U by zobaczyæ ponownie tê lekcjê.
+
+ 3. Teraz wczytaj plik TEST u¿ywaj±c polecenia :r TEST , gdzie TEST
+ jest nazw± pliku.
+
+UWAGA: Plik, który wczytujesz jest wstawiany tam gdzie by³ kursor.
+
+ 4. By sprawdziæ czy plik zosta³ wczytany cofnij kursor i zobacz, ¿e
+ teraz s± dwie kopie Lekcji 5.3., orygina³ i kopia z pliku.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 5. PODSUMOWANIE
+
+
+ 1. :!polecenie wykonuje polecenie zewnêtrzne.
+
+ U¿ytecznymi przyk³adami s±:
+
+ :!dir - pokazuje spis plików w katalogu.
+
+ :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
+
+ 2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazw± NAZWA_PLIKU.
+
+ 3. :#,#w NAZWA_PLIKU zapisuje linie od # do # w pliku NAZWA_PLIKU.
+
+ 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do
+ bie¿±cego pliku po kursorze.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.1.: POLECENIE OPEN (otwórz)
+
+
+ ** Wpisz o by otworzyæ liniê poni¿ej kursora i przenie¶æ siê do
+ trybu Insert (wprowadzanie). **
+
+ 1. Przenie¶ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. Wpisz o (ma³e) by otworzyæ liniê PONI¯EJ kursora i przenie¶æ siê
+ do trybu Insert (wprowadzanie).
+
+ 3. Teraz przepisz liniê oznaczon± ---> i wci¶nij <ESC> by wyj¶æ
+ z trybu Insert (wprowadzanie).
+
+---> Po wci¶niêciu o kursor znajdzie siê w otwartej linii w trybie
+ Insert (wprowadzanie).
+
+ 4. By otworzyæ liniê POWY¯EJ kursora wci¶nij wielkie O zamiast ma³ego
+ o . Wypróbuj to na linii poni¿ej.
+
+ Otwórz liniê powy¿ej wciskaj±c SHIFT-O gdy kursor bêdzie na tej linii.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.2.: POLECENIE APPEND (dodaj)
+
+
+ ** Wpisz a by dodaæ tekst ZA kursorem. **
+
+ 1. Przenie¶ kursor do koñca pierwszej linii poni¿ej oznaczonej --->
+ Zrób to wciskaj±c $ w trybie Normal.
+
+ 2. Wpisz a (ma³e) aby dodaæ tekst ZA znakiem pod kursorem.
+ Wielkie A dodaje tekst na koñcu linii.
+
+Uwaga: To oszczêdza wpisania: ostatni znak ( $ ), i , tekst do dodania,
+ <ESC>, strza³ka w prawo i ostatecznie x , tylko po to by dodaæ
+ tekst na koñcu linii.
+
+ 3. Teraz dokoñcz pierwsz± liniê. Zauwa¿ tak¿e, ¿e append (dodaj)
+ dzia³a tak samo jak tryb Insert (wprowadzanie) z wyj±tkiem tego gdzie
+ tekst jest wstawiany.
+
+---> Ta linia pozwoli Ci æwiczyæ
+---> Ta linia pozwoli Ci æwiczyæ dodawanie tekstu do koñca linii.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
+
+
+ ** Wpisz wielkie R by zamieniæ wiêcej ni¿ jeden znak. **
+
+ 1. Przenie¶ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. Umie¶æ kursor na pocz±tku pierwszego wyrazu, który rózni siê od
+ drugiej linii oznaczonej ---> (wyraz 'ostatni').
+
+ 3. Teraz wpisz R i zamieñ resztê tekstu w pierwszej linii przez
+ nadpisanie nad starym tekstem tak aby pierwsza linia brzmia³a tak samo
+ jak druga.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. Zauwa¿, ¿e kiedy wci¶niesz <ESC> aby wyj¶æ niezmieniony tekst
+ pozostaje.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.4.: USTAWIANIE OPCJI
+
+
+** Ustawianie opcji tak by szukaj lub substytucja ignorowa³y wielko¶æ liter **
+
+ 1. Szukaj 'ignore' wpisuj±c (w trybie Normal):
+ /ignore
+ Powtórz szukanie kilka razy naciskaj±c klawisz n .
+
+ 2. Ustaw opcjê 'ic' (Ignore case -- ignoruj wielko¶æ liter) poprzez
+ wpisanie: :set ic
+
+ 3. Teraz szukaj 'ignore' ponownie wciskuj±c: n
+ Powtórz szukanie kilka razy naciskaj±c klawisz n .
+
+ 4. Ustaw opcje 'hlsearch' i 'incsearch':
+ :set hls is
+
+ 5. Teraz wprowad¼ polecenie szukaj ponownie i zobacz co siê zdarzy:
+ /ignore
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 6. PODSUMOWANIE
+
+
+ 1. Wpisanie o otwiera liniê PONI¯EJ kursora i umieszcza kursor
+ w otwartej linii w trybie Insert (wprowadzanie).
+ Wpisanie wielkiego O otwiera liniê POWY¯EJ linii, w której
+ znajduje siê kursor.
+
+ 2. Wpisz a by wstawiæ tekst ZA znakiem na, którym jest kursor.
+ Wpisanie wielkiego A automatycznie dodaje tekst na koñcu linii.
+
+ 3. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
+ nie zostanie wci¶niêty <ESC>.
+
+ 4. Wpisanie ":set xxx" ustawia opcjê "xxx".
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 7. POLECENIA POMOCY ON-LINE
+
+
+ ** U¿ycie systemu pomocy on-line **
+
+ Vim posiada bardzo dobry system pomocy on-line. By zacz±æ spróbuj jednej
+ z trzech mo¿liwo¶ci:
+
+ - wci¶nij klawisz <HELP> (je¶li takowy posiadasz)
+ - wci¶nij klawisz <F1> (je¶li takowy posiadasz)
+ - wpisz :help<ENTER>
+
+ Wpisz :q<ENTER> by zamkn±c okno pomocy.
+
+ Mo¿esz te¿ znale¼æ pomoc na ka¿dy temat podaj±c argument polecenia ":help".
+ Spróbuj tych (nie zapomnij wcisn±æ <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 8. TWORZENIE SKRYPTU STARTOWEGO
+
+ ** W³±czanie mo¿liwo¶ci Vim-a **
+
+ Vim ma o wiele wiêcej mo¿liwo¶ci ni¿ Vi, ale wiêkszo¶æ z nich jest domy¶lnie
+ wy³±czona. Je¶li chcesz w³±czyæ te mo¿liwo¶ci na starcie musisz utworzyæ
+ plik "vimrc".
+
+ 1. Pocz±tek edycji pliku "vimrc" zale¿y od Twojego systemu:
+ :edit ~/.vimrc dla Unixa
+ :edit $VIM/_vimrc dla MS-Windows
+
+ 2. Teraz wczytaj przyk³adowy plik "vimrc":
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Zapisz plik:
+ :write
+
+ Nastêpnym razem gdy zaczniesz pracê w Vimie bêdzie on u¿ywaæ pod¶wietlania
+ sk³adni. Mo¿esz dodaæ wszystkie swoje ulubione ustawienia do tego pliku
+ "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Tutaj siê koñczy tutorial Vim-a. Zosta³ on pomy¶lany tak aby daæ krótki
+ przegl±d jego mo¿liwo¶ci, wystarczaj±cy by¶ móg³ go u¿ywaæ. Jest on
+ daleki od kompletno¶ci poniewa¿ Vim ma o wiele, wiele wiêcej poleceñ.
+
+ Dla dalszej nauki rekomendujemy ksi±¿kê:
+ Vim - Vi Improved - autor Steve Oualline
+ Wydawca: New Riders
+ Pierwsza ksi±zka ca³kowicie po¶wiêcona Vim-owi. U¿yteczna zw³aszcza dla
+ pocz±tkuj±cych. Zawiera wiele przyk³adów i ilustracji.
+ Zobacz http://iccf-holland.org./click5.html
+
+ Ta ksi±¿ka jest starsza i bardziej o Vi ni¿ o Vim-ie, ale tak¿e warta
+ polecenia:
+ Learning the Vi Editor - autor Linda Lamb
+ Wydawca: O'Reilly & Associates Inc.
+ To dobra ksi±¿ka by dowiedzieæ siê niemal wszystkiego co chcia³by¶ zrobiæ
+ z Vi. Szósta edycja zawiera te¿ informacje o Vim-ie.
+
+ Po polsku wydano:
+ Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
+ Wydawca: Helion 2001 (O'Reilly).
+ ISBN: 83-7197-472-8
+ http://helion.pl/ksiazki/vilek.htm
+ Jest to ksi±¿eczka zawieraj±ca spis poleceñ vi i jego najwa¿niejszych
+ klonów (miêdzy innymi Vim-a).
+
+ Edytor vi - autorzy Linda Lamb i Arnold Robbins
+ Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania
+ ISBN: 83-7197-539-2
+ http://helion.pl/ksiazki/viedyt.htm
+ Rozszerzona wersja Learning the Vi Editor w polskim t³umaczeniu.
+
+ Ten tutorial zosta³ napisany przez Michaela C. Pierce'a i Roberta K. Ware'a,
+ Colorado School of Mines korzystaj±c z pomocy Charlesa Smitha,
+ Colorado State University.
+ E-mail: bware@mines.colorado.edu.
+
+ Zmodyfikowane dla Vim-a przez Brama Moolenaara.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Przet³umaczone przez Miko³aja Machowskiego,
+ Sierpieñ 2001,
+ rev. Marzec 2002
+ Wszelkie uwagi proszê kierowaæ na: mikmach@wp.pl
+
diff --git a/runtime/tutor/tutor.pl.cp1250 b/runtime/tutor/tutor.pl.cp1250
new file mode 100644
index 000000000..dc42c9cfd
--- /dev/null
+++ b/runtime/tutor/tutor.pl.cp1250
@@ -0,0 +1,830 @@
+===============================================================================
+= W i t a j w t u t o r i a l u V I M - a - Wersja 1.5. =
+===============================================================================
+
+ Vim to potê¿ny edytor, który posiada wiele poleceñ, zbyt du¿o by
+ wyjaœniæ je wszystkie w tym tutorialu. Ten przewodnik ma nauczyæ
+ Ciê pos³ugiwaæ siê wystarczaj¹co wieloma komendami byœ móg³ ³atwo
+ u¿ywaæ Vim-a jako edytora ogólnego przeznaczenia.
+
+ Czas potrzebny na ukoñczenie tutoriala to 25 do 30 minut i zale¿y
+ od tego jak wiele czasu spêdzisz na eksperymentowaniu. Polecenia
+ wykonywane w czasie lekcji zmodyfikuj¹ tekst. Zrób wczeœniej kopiê
+ tego pliku do æwiczeñ (jeœli zacz¹³eœ komend¹ "vimtutor" to ju¿
+ pracujesz na kopii).
+
+ Wa¿ne jest, byœ pamiêta³, ¿e przewodnik ten zosta³ zaprojektowany do
+ nauki poprzez æwiczenia. To oznacza, ¿e musisz wykonywaæ polecenia
+ by nauczyæ siê ich prawid³owo. Jeœli bêdziesz jedynie czyta³ tekst
+ szybko zapomnisz wiele poleceñ!
+
+ Teraz upewnij siê, ¿e nie masz wciœniêtego CapsLocka i wciskaj j
+ tak d³ugo dopóki Lekcja 1.1. nie wype³ni ca³kowicie ekranu.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.1.: PORUSZANIE SIÊ KURSOREM
+
+ ** By wykonaæ ruch kursorem, wciœnij h, j, k, l jak pokazano. **
+
+ ^
+ k Wskazówka: h jest po lewej
+ < h l > l jest po prawej
+ j j wygl¹da jak strza³ka w dó³
+ v
+ 1. Poruszaj kursorem dopóki nie bêdziesz pewien, ¿e pamiêtasz polecenia.
+
+ 2. Trzymaj j tak d³ugo a¿ bêdzie siê powtarza³.
+---> Teraz wiesz jak dojœæ do nastêpnej lekcji.
+
+ 3. U¿ywaj¹c strza³ki w dó³ przejdŸ do nastêpnej lekcji.
+
+Uwaga: Jeœli nie jesteœ pewien czegoœ co wpisa³eœ, wciœnij <ESC> by wróciæ do
+ trybu Normal. Wtedy powtórz polecenie.
+
+Uwaga: Klawisze kursora tak¿e powinny dzia³aæ, ale u¿ywaj¹c hjkl bêdziesz
+ w stanie poruszaæ siê o wiele szybciej jak siê tylko przyzwyczaisz.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.2.: WCHODZENIE I WYCHODZENIE Z VIM-a
+
+ !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca³¹ lekcjê.!!
+
+ 1. Wciœnij <ESC> (aby upewniæ siê, ¿e jesteœ w trybie Normal).
+ 2. Wpisz: :q!<ENTER>.
+
+---> To spowoduje wyjœcie z edytora BEZ zapamiêtywania zmian jakie
+ zd¹¿y³eœ zrobiæ. Jeœli chcesz zapamiêtaæ zmiany i wyjœæ
+ wpisz: :wq<ENTER>
+
+ 3. Kiedy widzisz znak zachêty pow³oki wpisz komendê, ¿eby wróciæ
+ do tutoriala.
+ Powinienieœ wpisaæ: vimtutor<ENTER>
+ Normalnie u¿y³byœ: vim tutor<ENTER>
+
+---> 'vim' oznacza edytor vim, 'tutor' jest plikem, który chcia³byœ
+ edytowaæ.
+
+ 4. Jeœli chcesz zapamiêtaæ polecenia, wykonaj kroki 1. do 3. aby
+ wyjœæ i wróciæ do edytora. Potem przenieœ siê do Lekcji 1.3.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.3.: EDYCJA TEKSTU - KASOWANIE
+
+
+ ** W trybie Normal wciœnij x aby usun¹æ znak pod kursorem. **
+
+ 1. Przenieœ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. By poprawiæ b³êdy, naprowadŸ kursor na znak do usuniêcia.
+
+ 3. Wciœnij x aby usun¹æ niechciany znak.
+
+ 4. Powtarzaj kroki 2. do 4. dopóki zdanie nie jest poprawne.
+
+---> Kkrowa prrzeskoczy³a prrzez ksiiê¿ycc.
+
+ 5. Teraz kiedy zdanie jest poprawione przejdŸ do Lekcji 1.4.
+
+UWAGA: Ucz siê przez æwiczenie, nie wkuwanie.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie)
+
+
+ ** W trybie Normal wciœnij i aby wstawiæ tekst. **
+
+ 1. Przenieœ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. Aby poprawiæ pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym
+ gdzie tekst ma byæ wstawiony.
+
+ 3. Wciœnij i a nastêpnie wpisz konieczne poprawki.
+
+ 4. Po poprawieniu b³êdu wciœnij <ESC> by wróciæ do trybu Normal.
+ Powtarzaj kroki 2. do 4. aby poprawiæ ca³e zdanie.
+
+---> W tej brkje trochê .
+---> W tej linii brakuje trochê tekstu.
+
+ 5. Kiedy czujesz siê swobodnie wstawiaj¹c tekst przejdŸ do
+ podsumowania poni¿ej.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 1. PODSUMOWANIE
+
+ 1. Poruszasz kursorem u¿ywaj¹c "strza³ek" i klawiszy hjkl .
+ h (w lewo) j (w dó³) k (do góry) l (w prawo)
+
+ 2. By wejœæ do Vim-a (od znaku zachêty) wpisz:
+ vim NAZWA_PLIKU<ENTER>
+
+ 3. By wyjϾ z Vim-a wpisz:
+ <ESC> :q!<ENTER> by usun¹c wszystkie zmiany.
+ LUB: <ESC> :wq<ENTER> by zmiany zachowaæ.
+
+ 4. By usun¹æ znak pod kursorem w trybie Normal: x
+
+ 5. By wstawiæ tekst przed kursorem w trybie Normal:
+ i type in text <ESC>
+
+UWAGA: Wciœniêcie <ESC> przeniesie Ciê z powrotem do trybu Normal
+lub odwo³a niechciane lub czêœciowo wprowadzone polecenia.
+
+Teraz mo¿emy kontynuowaæ i przejœæ do Lekcji 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.1.: POLECENIE DELETE (usuwanie)
+
+
+ ** Wpisz dw by usun¹c tekst do koñca wyrazu. **
+
+ 1. Wciœnij <ESC> by upewniæ siê, ¿e jesteœ w trybie Normal.
+
+ 2. Przenieœ kursor do linii poni¿ej oznaczonej --->.
+
+ 3. Przesuñ kursor na pocz¹tek wyrazu, które chcesz usun¹æ.
+
+ 4. Wpisz dw by usun¹c wyraz.
+
+ UWAGA: Litery dw bêd¹ siê pojawiaæ na dole ekranu w miarê
+ wpisywania. Jeœli wpisa³eœ coœ Ÿle wciœnij <ESC> i zacznij od
+ pocz¹tku.
+
+---> Jest tu parê papier wyrazów, które kamieñ nie nale¿¹ do no¿yce tego zdania.
+
+ 5. Powtarzaj kroki 3. i 4. dopóki zdanie nie bêdzie poprawne, potem
+ przejdŸ do Lekcji 2.2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.2.: WIÊCEJ POLECEÑ USUWAJ¥CYCH
+
+
+ ** Wpisz d$ aby usun¹æ tekst do koñca linii. **
+
+ 1. Wciœnij <ESC> aby siê upewniæ, ¿e jesteœ w trybie Normal.
+
+ 2. Przenieœ kursor do linii poni¿ej oznaczonej --->.
+
+ 3. Przenieœ kursor do koñca poprawnego zdania (PO pierwszej . ).
+
+ 4. Wpisz d$ aby usun¹æ resztê linii.
+
+---> Ktoœ wpisa³ koniec tego zdania dwukrotnie. zdania dwukrotnie.
+
+
+ 5. PrzejdŸ do Lekcji 2.3. by zrozumieæ co siê sta³o.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.3.: O POLECENIACH I OBIEKTACH
+
+
+ Format dla polecenia usuwaj¹cego d jest taki:
+
+ [liczba] d obiekt LUB d [liczba] obiekt
+
+ Gdzie:
+ liczba - ile razy polecenie ma byæ wykonane (opcjonalne, domyœlna=1).
+ d - polecenie usuwaj¹ce.
+ obiekt - na czym polecenie bêdzie wykonywane (lista poni¿ej).
+
+ Krótka lista obiektów:
+ w - od kursora do koñca wyrazu w³¹czaj¹c spacjê.
+ e - od kursora do koñca wyrazu NIE w³¹czaj¹c spacji.
+ $ - od kursora do koñca linii.
+
+UWAGA: Dla ciekawskich, wybieranie obiektu w trybie Normal bez polecania
+ polecenia przeniesie kursor tak jak opisano w liœcie obiektów.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.4.: WYJ¥TEK DO 'POLECENIE-OBIEKT'
+
+
+ ** Wpisz dd by usun¹c ca³¹ liniê. **
+
+ Z powodu czêstoœci usuwania ca³ych linii, projektanci Vim-a zdecydowali, ¿e
+ bêdzie ³atwiej wpisaæ dwa razy pod rz¹d d aby usun¹æ liniê.
+
+ 1. Przenieœ kursor do zdania poni¿ej.
+ 2. Wpisz dd aby usun¹c wiersz.
+ 3. Teraz przenieœ siê do czwartego wiersza.
+ 4. Wpisz 2dd (pamiêtaj liczba-polecenie-obiekt) aby usun¹c dwia wiersze.
+
+ 1) Ró¿e s¹ czerwone,
+ 2) B³oto jest fajne,
+ 3) Fio³ki s¹ niebieskie,
+ 4) Mam samochód,
+ 5) Zegar podaje czas,
+ 6) Cukier jest s³odki,
+ 7) I ty te¿.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 2.5.: POLECENIE UNDO (cofnij)
+
+
+ ** Wciœnij u aby cofn¹æ skutki ostatniego polecenia.
+ U zaœ, by cofn¹æ skutki dla ca³ej linii. **
+
+ 1. Przenieœ kursor do zdania poni¿ej oznaczonego ---> i umieœæ go na
+ pierwszym b³êdzie.
+ 2. Wpisz x aby usun¹æ pierwszy niechciany znak.
+ 3. Teraz wciœnij u aby cofn¹æ skutki ostatniego polecenia.
+ 4. Tym razem popraw wszystkie b³êdy w linii u¿ywaj¹c polecenia x .
+ 5. Teraz wciœnij wielkie U aby przywróciæ liniê do oryginalnego stanu.
+ 6. Teraz wciœnij u kilka razy by cofn¹æ U i poprzednie polecenia.
+ 7. Teraz wpsz CTRL-R (trzymaj równoczeœnie wciœniête klawisze CTRL i R)
+ kilka razy, by cofn¹æ cofniêcia.
+
+---> Poopraw blêdyyy w teej liniii i zaamiieñ je prrzez coofnij.
+
+ 8. To s¹ bardzo po¿yteczne polecenia.
+
+ PrzejdŸ teraz do podsumowania Lekcji 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 2. PODSUMOWANIE
+
+ 1. By usun¹æ znaki od kursora do koñca wyrazu wpisz: dw
+
+ 2. By usun¹æ znaki od kursora do koñca linii wpisz: d$
+
+ 3. By usun¹æ ca³¹ liniê: dd
+
+ 4. Format polecenia w trybie Normal:
+
+ [liczba] polecenie obiekt LUB polecenie [liczba] obiekt
+
+ Gdzie:
+ liczba - ile razy polecenie ma byæ wykonane
+ polecenie - to co trzeba zrobiæ (np. d dla usuwania)
+ obiekt - na czym polecenie bêdzie wykonywane, takie jak w (wyraz),
+ $ (do koñca linii), etc.
+
+ 5. By cofn¹æ poprzednie polecenie, wpisz: u (ma³e u)
+ By cofn¹æ wszystkie zmiany w linii wpisz: U (wielkie U)
+ By cofn¹æ cofniêcia wpisz: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.1.: POLECENIE PUT (wstaw)
+
+
+ ** Wpisz p by wstawiæ ostatnie usuniêcia po kursorze. **
+
+ 1. Przenieœ kursor do pierwszej linii w zestawie poni¿ej.
+
+ 2. Wpisz dd aby usun¹æ liniê i przechowaæ j¹ w buforze Vim-a.
+
+ 3. Przenieœ kursor do linii POWY¯EJ tej gdzie usuniêta linia powinna
+ siê znajdowaæ.
+
+ 4. W trybie Normal, wciœnij p by wstawiæ liniê.
+
+ 5. Powtaj kroki 2. do 4. a¿ znajd¹ siê w odpowiednim porz¹dku.
+
+ d) Jak dwa anio³ki.
+ b) Na dole fio³ki,
+ c) A my siê kochamy,
+ a) Na górze ró¿e,
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.2.: POLECENIE REPLACE (zast¹p)
+
+
+ ** Wpisz r a nastêpnie znak by zast¹piæ znak pod kursorem. **
+
+ 1. Przenieœ kursor do pierwszej linii poni¿ej oznaczonej --->
+
+ 2. Ustaw kursor na pierwszym b³êdzie.
+
+ 3. Wpisz r a potem znak jaki powinien zast¹piæ b³êdny.
+
+ 4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie bêdzie poprawna.
+
+---> Kjedy ten wiersz bi³ wstókiwany ktoœ wcizn¹³ perê z³ych klawirzy!
+---> Kiedy ten wiersz by³ wstukiwany ktoœ wcisn¹³ parê z³ych klawiszy!
+
+ 5. Teraz czas na Lekcjê 3.3.
+
+
+UWAGA: Pamiêtaj by uczyæ siê æwicz¹c, a nie pamiêciowo.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.3.: POLECENIE CHANGE (zmieñ)
+
+ ** By zmieniæ ca³e s³owo lub jego czêœæ wpisz cw (change word). **
+
+ 1. Przenieœ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. UmieϾ kursor na u w lunos.
+
+ 3. Wpisz cw i popraw wyraz (w tym wypadku wstaw 'inia').
+
+ 4. Wciœnij <ESC> i przejdŸ do nastêpnego b³êdu (pierwszy znak, który ma
+ ulec zmianie).
+
+ 5. Powtarzaj kroki 3. i 4. dopóki pierwsze zdanie nie bêdzie takie same
+ jak drugie.
+
+---> Ta lunos ma pire s³ów, które t¿ina zbnic u¿ifajonc pcmazu zmieñ.
+---> Ta linia ma parê s³ów, które trzeba zmieniæ u¿ywaj¹c polecenia zmieñ.
+
+ Zauwa¿, ¿e cw nie tylko zamienia wyraz, ale tak¿e zmienia tryb na
+ Insert (wprowadzanie).
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 3.4.: WIÊCEJ ZMIAN U¯YWAJ¥C c
+
+
+ ** Polecenie change u¿ywa takich samych obiektów jak delete. **
+
+ 1. Polecenie change dzia³a tak samo jak delete. Format wygl¹da tak:
+
+ [liczba] c obiekt LUB c [liczba] obiekt
+
+ 2. Obiekty s¹ tak¿e takie same, np.: w (wyraz), $ (koniec linii), etc.
+
+ 3. Przenieœ siê do pierwszej linii poni¿ej oznaczonej --->
+
+ 4. Ustaw kursor na pierwszym b³êdzie.
+
+ 5. Wpisz c$ , popraw koniec wiersza i wciœnij <ESC>.
+
+---> Koniec tego wiersza musi byæ poprawiony aby wygl¹dal tak jak drugi.
+---> Koniec tego wiersza musi byæ poprawiony u¿ywaj¹c polecenia c$ .
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 3. PODSUMOWANIE
+
+
+ 1. Aby wstawiæ tekst, który zosta³ wczeœniej usuniêty wciœnij p . To
+ polecenie wstawia skasowany tekst PO kursorze (jeœli ca³a linia
+ zosta³a usuniêta, zostanie ona umieszczona w linii poni¿ej kursora).
+
+ 2. By zamieniæ znak pod kursorem wciœnij r a potem znak, który ma zast¹piæ
+ oryginalny.
+
+ 3. Polecenie change pozwala Ci na zast¹pienie wyszczególnionego obiektu
+ od kursora do koñca obiektu. Np. wpisz cw aby zamieniæ tekst od
+ kursora do koñca wyrazu, c$ aby zmieniæ tekst do koñca linii.
+
+ 4. Format do polecenia change (zmieñ):
+
+ [liczba] c obiekt LUB c [liczba] obiekt
+
+ Teraz przejdŸ do nastêpnej lekcji.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.1.: LOKALIZACJA ORAZ STATUS PLIKU
+
+ ** Naciœnij CTRL-G aby zobaczyæ swoje po³o¿enie w pliku i status
+ pliku. Naciœnij SHIFT-G aby przejœæ do linii w pliku. **
+
+ UWAGA: Przeczytaj ca³¹ lekcjê zanim wykonasz jakieœ polecenia!!!
+
+ 1. Przytrzymaj klawisz CTRL i wciœnij g . Na dole strony pojawi siê pasek
+ statusu z nazw¹ pliku i numerem linii, w której jesteœ. Zapamiêtaj numer
+ linii dla potrzeb kroku 3.
+
+ 2. Wciœnij SHIFT-G aby przejœæ na koniec pliku.
+
+ 3. Wpisz numer linii, w której by³eœ a potem SHIFT-G. To przeniesie Ciê
+ z powrotem do linii, w której by³eœ kiedy wcisn¹³eœ CTRL-G (kiedy
+ wpisujesz numery NIE pojawiaj¹ siê one na ekranie).
+
+ 4. Jeœli czujesz siê wystarczaj¹co pewnie, wykonaj kroki 1-3.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.2.: POLECENIE SZUKAJ
+
+
+ ** Wpisz / a nastêpnie wyra¿enie aby je znaleŸæ. **
+
+ 1. W trybie Normal wpisz / . Zauwa¿, ¿e znak ten, oraz kursor pojawi¹
+ siê na dole ekranu tak samo jak polecenie : .
+
+ 2. Teraz wpisz b³ond<ENTER> . To jest s³owo, którego chcesz szukaæ.
+
+ 3. By szukaæ tej samej frazy ponownie, po prostu wciœnij n .
+ Aby szukaæ tej frazy w przeciwnym, kierunku wciœnij SHIFT-N.
+
+ 4. Jeœli chcesz szukaæ frazy do ty³u, u¿yj polecenia ? zamiast / .
+
+---> Kiedy polecenie 'szukaj' osi¹gnie koniec pliku, przeszukiwanie
+ zacznie siê od pocz¹tku pliku.
+
+ 'b³ond' to nie jest metoda by przeliterowaæ b³¹d; 'b³ond' to b³¹d.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.3.: W POSZUKIWANIU PARUJ¥CYCH NAWIASÓW
+
+
+ ** Wpisz % by znaleŸæ pasuj¹cy ),], lub } . **
+
+ 1. Umieœæ kursor na którymœ z (, [, lub { w linii poni¿ej oznaczonej --->.
+
+ 2. Teraz wpisz znak % .
+
+ 3. Kursor powinien siê znaleŸæ na paruj¹cym nawiasie.
+
+ 4. Wciœnij % aby przenieœæ kursor z powrotem do paruj¹cego nawiasu.
+
+---> To ( jest linia testowa z (, [, ] i {, } . ))
+
+UWAGA: Ta funkcja jest bardzo u¿yteczna w debuggowaniu programu
+ z niesparowanymi nawiasami!
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 4.4.: INNA METODA POPRAWIANIA B£ÊDÓW
+
+
+ ** Wpisz :s/stary/nowy/g aby zamieniæ 'stary' na 'nowy'. **
+
+ 1. Przenieœ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. Wpisz :s/czaas/czas<ENTER> . Zauwa¿, ¿e to polecenie zmienia
+ tylko pierwsze wyst¹pienie 'czaas' w linii.
+
+ 3. Teraz wpisz :s/czaas/czas/g oznacza zamianê (substytucjê)
+ globalnie w ca³ej linii. Zmienia wszystkie wyst¹pienia w linii.
+
+---> Najlepszy czaas na zobaczenie naj³adniejszych kwiatów to czaas wiosny.
+
+ 4. Aby zmieniæ wszystkie wyst¹pienia ³añcucha znaków pomiêdzy dwoma liniami,
+ wpisz: :#,#s/stare/nowe/g gdzie #,# s¹ numerami dwóch linii.
+ Wpisz :%s/stare/nowe/g by zmieniæ wszystkie wyst¹pienia w ca³ym pliku.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 4. PODSUMOWANIE
+
+
+ 1. CTRL-G poka¿e Twoj¹ pozycjê w pliku i status pliku. SHIFT-G przenosi
+ Ciê do koñca pliku. SHIFT-G poprzedzony liczb¹ przenosi Ciê do linii
+ o tym numerze.
+
+ 2. Wpisanie / a nastêpnie ³añcucha znaków szuka ³añcucha DO PRZODU.
+ Wpisanie ? a nastêpnie ³añcucha znaków szuka ³añcucha DO TY£U.
+ Po wyszukiwaniu wciœnij n by znaleŸæ nastêpne wyst¹pienie szukanej
+ frazy tym samym kierunku lub Shift-N by szukaæ w kierunku przeciwnym.
+
+ 3. Wpisanie % gdy kursor znajduje siê na (,),[,],{, lub } lokalizuje
+ paruj¹cy znak.
+
+ 4. By zamieniæ pierwszy stary na nowy w linii wpisz :s/stary/nowy
+ By zamieniæ wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
+ By zamieniæ frazy pomiêdzy dwoma liniami # wpisz :#,#s/stary/nowy/g
+ By zamieniæ wszystkie wyst¹pienia w pliku wpisz :%s/stary/nowy/g
+ By Vim prosi³ Ciê o potwierdzienie dodaj 'c' :%s/stary/nowy/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.1.: JAK WYKONAÆ POLECENIA ZEWNÊTRZNE
+
+
+ ** Wpisz :! a nastêpnie zewnêtrzne polecenie by je wykonaæ. **
+
+ 1. Wpisz znajome polecenie : by ustawiæ kursor na dole ekranu. To pozwala
+ na wprowadzenie polecenia.
+
+ 2. Teraz wstaw ! (wykrzyknik). To umo¿liwi Ci wykonanie dowolnego
+ zewnêtrznego polecenia pow³oki.
+
+ 3. Jako przyk³ad wpisz ls za ! a nastêpnie wciœnij <ENTER>. To polecenie
+ poka¿e spis plików w Twoim katalogu, tak jakbyœ by³ przy znaku zachêty
+ pow³oki. Mo¿esz te¿ u¿yæ :!dir jeœli ls nie dzia³a.
+
+---> Uwaga: W ten sposób mo¿na wykonaæ wszystkie polecenia pow³oki.
+---> Uwaga: Wszystkie polecenia : musz¹ byæ zakoñczone <ENTER>.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.2.: WIÊCEJ O ZAPISYWANIU PLIKÓW
+
+
+ ** By zachowaæ zmiany w pliku wpisz :w NAZWA_PLIKU . **
+
+ 1. Wpisz :!dir lub :!ls by zobaczyæ spis plików w katalogu.
+ Ju¿ wiesz, ¿e musisz wcisn¹æ <ENTER> po tym.
+
+ 2. Wybierz nazwê pliku jaka jeszcze nie istnieje, np. TEST.
+
+ 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw¹ pliku jak¹ wybra³eœ.)
+
+ 4. To polecenie zapamiêta ca³y plik (Vim Tutor) pod nazw¹ TEST.
+ By to sprawdziæ wpisz :!dir , ¿eby znowu zobaczyæ listê plików.
+
+---> Zauwa¿, ¿e gdybyœ teraz wyszed³ z Vim-a, a nastêpnie wszed³ ponownie
+ komend¹ vim TEST , plik by³by dok³adn¹ kopi¹ tutoriala kiedy go
+ zapisywa³eœ.
+
+ 5. Teraz usuñ plik wpisuj¹c: :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.3.: SELEKTYWNE POLECENIE WRITE (zapisz)
+
+
+ ** By zachowaæ czêœæ pliku wpisz :#,# w NAZWA_PLIKU **
+
+ 1. Jeszcze raz wpisz :!dir lub :!ls by uzyskaæ listê plików
+ w katalogu i wybierz odpowiedni¹ nazwê tak¹ jak TEST.
+
+ 2. Przenieœ kursor na góre tej strony i wciœnij CTRL-G by uzyskaæ
+ numer linii. ZAPAMIÊTAJ TÊ LICZBÊ!
+
+ 3. Teraz przenieœ siê na dó³ strony i wpisz CTRL-G znowu. ZAPAMIÊTAJ
+ NUMER TAK¯E TEJ LINII!
+
+ 4. By zachowaæ JEDYNIE czêœæ pliku wpisz :#,# w TEST gdzie #,# to
+ dwie liczby jakie zapamiêta³eœ (góra, dó³ ekranu), a TEST to nazwa
+ Twojego pliku.
+
+ 5. Ponownie sprawdŸ czy ten plik tam jest ( :!dir ), ale NIE usuwaj go.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 5.4.: WSTAWIANIE I £¥CZENIE PLIKÓW
+
+
+ ** By wstawiæ zawartoœæ pliku wpisz :r NAZWA_PLIKU **
+
+ 1. Wpisz :!dir by siê upewniæ, ze Twój plik TEST zosta³ poprawnie
+ zapamiêtany.
+
+ 2. Umieœæ kursor na górze strony.
+
+UWAGA: Po wykonaniu kroku 3. ponownie zobaczysz Lekcjê 5.3. Potem przejdŸ
+ do DO£U by zobaczyæ ponownie tê lekcjê.
+
+ 3. Teraz wczytaj plik TEST u¿ywaj¹c polecenia :r TEST , gdzie TEST
+ jest nazw¹ pliku.
+
+UWAGA: Plik, który wczytujesz jest wstawiany tam gdzie by³ kursor.
+
+ 4. By sprawdziæ czy plik zosta³ wczytany cofnij kursor i zobacz, ¿e
+ teraz s¹ dwie kopie Lekcji 5.3., orygina³ i kopia z pliku.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 5. PODSUMOWANIE
+
+
+ 1. :!polecenie wykonuje polecenie zewnêtrzne.
+
+ U¿ytecznymi przyk³adami s¹:
+
+ :!dir - pokazuje spis plików w katalogu.
+
+ :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
+
+ 2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazw¹ NAZWA_PLIKU.
+
+ 3. :#,#w NAZWA_PLIKU zapisuje linie od # do # w pliku NAZWA_PLIKU.
+
+ 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do
+ bie¿¹cego pliku po kursorze.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.1.: POLECENIE OPEN (otwórz)
+
+
+ ** Wpisz o by otworzyæ liniê poni¿ej kursora i przenieœæ siê do
+ trybu Insert (wprowadzanie). **
+
+ 1. Przenieœ kursor do linii poni¿ej oznaczonej --->.
+
+ 2. Wpisz o (ma³e) by otworzyæ liniê PONI¯EJ kursora i przenieœæ siê
+ do trybu Insert (wprowadzanie).
+
+ 3. Teraz przepisz liniê oznaczon¹ ---> i wciœnij <ESC> by wyjœæ
+ z trybu Insert (wprowadzanie).
+
+---> Po wciœniêciu o kursor znajdzie siê w otwartej linii w trybie
+ Insert (wprowadzanie).
+
+ 4. By otworzyæ liniê POWY¯EJ kursora wciœnij wielkie O zamiast ma³ego
+ o . Wypróbuj to na linii poni¿ej.
+
+ Otwórz liniê powy¿ej wciskaj¹c SHIFT-O gdy kursor bêdzie na tej linii.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.2.: POLECENIE APPEND (dodaj)
+
+
+ ** Wpisz a by dodaæ tekst ZA kursorem. **
+
+ 1. Przenieœ kursor do koñca pierwszej linii poni¿ej oznaczonej --->
+ Zrób to wciskaj¹c $ w trybie Normal.
+
+ 2. Wpisz a (ma³e) aby dodaæ tekst ZA znakiem pod kursorem.
+ Wielkie A dodaje tekst na koñcu linii.
+
+Uwaga: To oszczêdza wpisania: ostatni znak ( $ ), i , tekst do dodania,
+ <ESC>, strza³ka w prawo i ostatecznie x , tylko po to by dodaæ
+ tekst na koñcu linii.
+
+ 3. Teraz dokoñcz pierwsz¹ liniê. Zauwa¿ tak¿e, ¿e append (dodaj)
+ dzia³a tak samo jak tryb Insert (wprowadzanie) z wyj¹tkiem tego gdzie
+ tekst jest wstawiany.
+
+---> Ta linia pozwoli Ci æwiczyæ
+---> Ta linia pozwoli Ci æwiczyæ dodawanie tekstu do koñca linii.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
+
+
+ ** Wpisz wielkie R by zamieniæ wiêcej ni¿ jeden znak. **
+
+ 1. Przenieœ kursor do pierwszej linii poni¿ej oznaczonej --->.
+
+ 2. Umieœæ kursor na pocz¹tku pierwszego wyrazu, który rózni siê od
+ drugiej linii oznaczonej ---> (wyraz 'ostatni').
+
+ 3. Teraz wpisz R i zamieñ resztê tekstu w pierwszej linii przez
+ nadpisanie nad starym tekstem tak aby pierwsza linia brzmia³a tak samo
+ jak druga.
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. Zauwa¿, ¿e kiedy wciœniesz <ESC> aby wyjœæ niezmieniony tekst
+ pozostaje.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcja 6.4.: USTAWIANIE OPCJI
+
+
+** Ustawianie opcji tak by szukaj lub substytucja ignorowa³y wielkoœæ liter **
+
+ 1. Szukaj 'ignore' wpisuj¹c (w trybie Normal):
+ /ignore
+ Powtórz szukanie kilka razy naciskaj¹c klawisz n .
+
+ 2. Ustaw opcjê 'ic' (Ignore case -- ignoruj wielkoœæ liter) poprzez
+ wpisanie: :set ic
+
+ 3. Teraz szukaj 'ignore' ponownie wciskuj¹c: n
+ Powtórz szukanie kilka razy naciskaj¹c klawisz n .
+
+ 4. Ustaw opcje 'hlsearch' i 'incsearch':
+ :set hls is
+
+ 5. Teraz wprowadŸ polecenie szukaj ponownie i zobacz co siê zdarzy:
+ /ignore
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 6. PODSUMOWANIE
+
+
+ 1. Wpisanie o otwiera liniê PONI¯EJ kursora i umieszcza kursor
+ w otwartej linii w trybie Insert (wprowadzanie).
+ Wpisanie wielkiego O otwiera liniê POWY¯EJ linii, w której
+ znajduje siê kursor.
+
+ 2. Wpisz a by wstawiæ tekst ZA znakiem na, którym jest kursor.
+ Wpisanie wielkiego A automatycznie dodaje tekst na koñcu linii.
+
+ 3. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
+ nie zostanie wciœniêty <ESC>.
+
+ 4. Wpisanie ":set xxx" ustawia opcjê "xxx".
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 7. POLECENIA POMOCY ON-LINE
+
+
+ ** U¿ycie systemu pomocy on-line **
+
+ Vim posiada bardzo dobry system pomocy on-line. By zacz¹æ spróbuj jednej
+ z trzech mo¿liwoœci:
+
+ - wciœnij klawisz <HELP> (jeœli takowy posiadasz)
+ - wciœnij klawisz <F1> (jeœli takowy posiadasz)
+ - wpisz :help<ENTER>
+
+ Wpisz :q<ENTER> by zamkn¹c okno pomocy.
+
+ Mo¿esz te¿ znaleŸæ pomoc na ka¿dy temat podaj¹c argument polecenia ":help".
+ Spróbuj tych (nie zapomnij wcisn¹æ <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCJA 8. TWORZENIE SKRYPTU STARTOWEGO
+
+ ** W³¹czanie mo¿liwoœci Vim-a **
+
+ Vim ma o wiele wiêcej mo¿liwoœci ni¿ Vi, ale wiêkszoœæ z nich jest domyœlnie
+ wy³¹czona. Jeœli chcesz w³¹czyæ te mo¿liwoœci na starcie musisz utworzyæ
+ plik "vimrc".
+
+ 1. Pocz¹tek edycji pliku "vimrc" zale¿y od Twojego systemu:
+ :edit ~/.vimrc dla Unixa
+ :edit $VIM/_vimrc dla MS-Windows
+
+ 2. Teraz wczytaj przyk³adowy plik "vimrc":
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Zapisz plik:
+ :write
+
+ Nastêpnym razem gdy zaczniesz pracê w Vimie bêdzie on u¿ywaæ podœwietlania
+ sk³adni. Mo¿esz dodaæ wszystkie swoje ulubione ustawienia do tego pliku
+ "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Tutaj siê koñczy tutorial Vim-a. Zosta³ on pomyœlany tak aby daæ krótki
+ przegl¹d jego mo¿liwoœci, wystarczaj¹cy byœ móg³ go u¿ywaæ. Jest on
+ daleki od kompletnoœci poniewa¿ Vim ma o wiele, wiele wiêcej poleceñ.
+
+ Dla dalszej nauki rekomendujemy ksi¹¿kê:
+ Vim - Vi Improved - autor Steve Oualline
+ Wydawca: New Riders
+ Pierwsza ksi¹zka ca³kowicie poœwiêcona Vim-owi. U¿yteczna zw³aszcza dla
+ pocz¹tkuj¹cych. Zawiera wiele przyk³adów i ilustracji.
+ Zobacz http://iccf-holland.org./click5.html
+
+ Ta ksi¹¿ka jest starsza i bardziej o Vi ni¿ o Vim-ie, ale tak¿e warta
+ polecenia:
+ Learning the Vi Editor - autor Linda Lamb
+ Wydawca: O'Reilly & Associates Inc.
+ To dobra ksi¹¿ka by dowiedzieæ siê niemal wszystkiego co chcia³byœ zrobiæ
+ z Vi. Szósta edycja zawiera te¿ informacje o Vim-ie.
+
+ Po polsku wydano:
+ Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
+ Wydawca: Helion 2001 (O'Reilly).
+ ISBN: 83-7197-472-8
+ http://helion.pl/ksiazki/vilek.htm
+ Jest to ksi¹¿eczka zawieraj¹ca spis poleceñ vi i jego najwa¿niejszych
+ klonów (miêdzy innymi Vim-a).
+
+ Edytor vi - autorzy Linda Lamb i Arnold Robbins
+ Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania
+ ISBN: 83-7197-539-2
+ http://helion.pl/ksiazki/viedyt.htm
+ Rozszerzona wersja Learning the Vi Editor w polskim t³umaczeniu.
+
+ Ten tutorial zosta³ napisany przez Michaela C. Pierce'a i Roberta K. Ware'a,
+ Colorado School of Mines korzystaj¹c z pomocy Charlesa Smitha,
+ Colorado State University.
+ E-mail: bware@mines.colorado.edu.
+
+ Zmodyfikowane dla Vim-a przez Brama Moolenaara.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Przet³umaczone przez Miko³aja Machowskiego,
+ Sierpieñ 2001,
+ rev. Marzec 2002
+ Wszelkie uwagi proszê kierowaæ na: mikmach@wp.pl
+
diff --git a/runtime/tutor/tutor.ru b/runtime/tutor/tutor.ru
new file mode 100644
index 000000000..6fd74cf08
--- /dev/null
+++ b/runtime/tutor/tutor.ru
@@ -0,0 +1,834 @@
+===============================================================================
+= ä Ï Â Ò Ï Ð Ï Ö Á Ì Ï × Á Ô Ø × Õ Þ Å Â Î É Ë VIM - ÷ÅÒÓÉÑ 1.5 =
+===============================================================================
+ Vim --- ÜÔÏ ÏÞÅÎØ ÍÏÝÎÙÊ ÒÅÄÁËÔÏÒ, ÉÍÅÀÝÉÊ ÍÎÏÖÅÓÔ×Ï ËÏÍÁÎÄ, ÓÌÉÛËÏÍ
+ ÍÎÏÇÏ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÉÈ ×ÓÅ ÍÏÖÎÏ ÂÙÌÏ ÏÐÉÓÁÔØ × ÔÁËÏÍ ÕÞÅÂÎÉËÅ, ËÁË
+ ÜÔÏÔ. üÔÏÔ ÕÞÅÂÎÉË ÐÒÉÚ×ÁÎ ÏÂßÑÓÎÉÔØ ÄÏÓÔÁÔÏÞÎÏÅ ÞÉÓÌÏ ËÏÍÁÎÄ ÄÌÑ ÔÏÇÏ,
+ ÞÔÏÂÙ ÷Ù ÍÏÇÌÉ Ó ÌÅÇËÏÓÔØÀ ÉÓÐÏÌØÚÏ×ÁÔØ Vim × ËÁÞÅÓÔ×Å ÒÅÄÁËÔÏÒÁ ÏÂÝÅÇÏ
+ ÎÁÚÎÁÞÅÎÉÑ.
+
+ ÷ÁÍ ÐÏÔÒÅÂÕÅÔÓÑ ÐÒÉÂÌÉÚÉÔÅÌØÎÏ 25-30 ÍÉÎÕÔ ÎÁ ÏÓ×ÏÅÎÉÅ ÄÁÎÎÏÇÏ ÕÞÅÂÎÉËÁ ×
+ ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÔÏÇÏ, ÓËÏÌØËÏ ×ÒÅÍÅÎÉ ÷Ù ÐÏÔÒÁÔÉÔÅ ÎÁ ÜËÓÐÅÒÉÍÅÎÔÙ.
+
+ ëÏÍÁÎÄÙ × ÕÒÏËÁÈ ÂÕÄÕÔ ÍÏÄÉÆÉÃÉÒÏ×ÁÔØ ÔÅËÓÔ. óÏÚÄÁÊÔÅ ËÏÐÉÀ ÜÔÏÇÏ ÆÁÊÌÁ,
+ ÞÔÏÂÙ ÐÏÐÒÁËÔÉËÏ×ÁÔØÓÑ ÎÁ ÎÅÊ (ÅÓÌÉ ÷Ù ÚÁÐÕÓÔÉÌÉ "vimtutor", ÔÏ ÜÔÏ ÕÖÅ
+ ËÏÐÉÑ).
+
+ ÷ÁÖÎÏ ÐÏÍÎÉÔØ, ÞÔÏ ÜÔÏÔ ÕÞÅÂÎÉË ÐÒÅÄÎÁÚÎÁÞÅÎ ÄÌÑ ÏÂÕÞÅÎÉÑ × ÐÒÏÃÅÓÓÅ
+ ÉÓÐÏÌØÚÏ×ÁÎÉÑ. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÷Ù ÄÏÌÖÎÙ ÚÁÐÕÓËÁÔØ ËÏÍÁÎÄÙ ÄÌÑ ÔÏÇÏ,
+ ÞÔÏÂÙ ËÁË ÓÌÅÄÕÅÔ ÉÈ ÉÚÕÞÉÔØ. åÓÌÉ ÷Ù ÐÒÏÓÔÏ ÐÒÏÞÉÔÁÅÔÅ ÔÅËÓÔ, ÔÏ
+ ÚÁÂÕÄÅÔÅ ËÏÍÁÎÄÙ!
+
+ ôÅÐÅÒØ ÕÂÅÄÉÔÅÓØ × ÔÏÍ, ÞÔÏ ËÌÁ×ÉÛÁ CapsLock ÎÅ ×ËÌÀÞÅÎÁ É ÎÁÖÍÉÔÅ
+ ËÌÁ×ÉÛÕ j ÎÅÓËÏÌØËÏ ÒÁÚ, ÔÁË, ÞÔÏÂÙ õÒÏË 1.1 ÐÏÌÎÏÓÔØÀ ÐÏÍÅÓÔÉÌÓÑ ÎÁ
+ ÜËÒÁÎÅ.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 1.1: ðåòåíåýåîéå ëõòóïòá
+
+** äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ ÎÁÖÍÉÔÅ ËÌÁ×ÉÛÉ h,j,k,l ÔÁË, ËÁË ÐÏËÁÚÁÎÏ ÎÉÖÅ. **
+ ^
+ k óÏ×ÅÔÙ: ëÌÁ×ÉÛÁ h ÎÁÈÏÄÉÔÓÑ ÓÌÅ×Á É ÐÅÒÅÍÅÝÁÅÔ ×ÌÅ×Ï.
+ < h l > ëÌÁ×ÉÛÁ l ÎÁÈÏÄÉÔÓÑ ÓÐÒÁ×Á É ÐÅÒÅÍÅÝÁÅÔ ×ÐÒÁ×Ï.
+ j ëÌÁ×ÉÛÁ j ÐÏÈÏÖÁ ÎÁ ÓÔÒÅÌËÕ `×ÎÉÚ'.
+ v
+ 1. ðÏÄ×ÉÇÁÊÔÅ ËÕÒÓÏÒ ÐÏ ÜËÒÁÎÕ, ÐÏËÁ ÎÅ ÐÏÞÕ×ÓÔ×ÕÅÔÅ ÓÅÂÑ Õ×ÅÒÅÎÎÏ.
+
+ 2. îÁÄÁ×ÉÔÅ ËÌÁ×ÉÛÕ `×ÎÉÚ' (j) ÐÏËÁ ÏÎÁ ÎÅ ÎÁÞÎÅÔ ÐÏ×ÔÏÒÑÔØÓÑ.
+---> ôÅÐÅÒØ ÷Ù ÚÎÁÅÔÅ, ËÁË ÐÅÒÅÊÔÉ Ë ÓÌÅÄÕÀÝÅÍÕ ÕÒÏËÕ.
+
+ 3. éÓÐÏÌØÚÕÑ ËÌÁ×ÉÛÕ `×ÎÉÚ' ÐÅÒÅÊÄÉÔÅ Ë õÒÏËÕ 1.2.
+
+úÁÍÅÞÁÎÉÅ: åÓÌÉ ×Ù ÐÏËÁ ÎÅ Õ×ÅÒÅÎÙ × ÔÏÍ, ÞÔÏ ÎÁÂÉÒÁÅÔÅ, ÎÁÖÍÉÔÅ <ESC> ÄÌÑ
+ ÐÅÒÅÈÏÄÁ × ÏÂÙÞÎÙÊ ÒÅÖÉÍ (Normal mode). ðÏÓÌÅ ÜÔÏÇÏ ÐÅÒÅÎÁÂÅÒÉÔÅ
+ ÔÒÅÂÕÅÍÕÀ ËÏÍÁÎÄÕ.
+
+úÁÍÅÞÁÎÉÅ: ïÂÙÞÎÙÅ ËÌÁ×ÉÛÉ ÕÐÒÁ×ÌÅÎÉÑ ËÕÒÓÏÒÏÍ (ÓÔÒÅÌËÉ) ÔÁËÖÅ ÄÏÌÖÎÙ
+ ÒÁÂÏÔÁÔØ. ïÄÎÁËÏ, ËÌÁ×ÉÛÉ hjkl ÐÏÚ×ÏÌÑÔ ÷ÁÍ ÐÅÒÅÍÅÝÁÔØÓÑ
+ ÚÎÁÞÉÔÅÌØÎÏ ÂÙÓÔÒÅÅ, ËÁË ÔÏÌØËÏ ÷Ù ÎÁÕÞÉÔÅÓØ ÉÍÉ ÐÏÌØÚÏ×ÁÔØÓÑ.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 1.2: úáðõóë é úá÷åòûåîéå òáâïôù ó VIM
+
+!! ÷îéíáîéå! ðÒÅÖÄÅ, ÞÅÍ ×ÙÐÏÌÎÑÔØ ÌÀÂÏÊ ÉÚ ÏÐÉÓÁÎÎÙÈ ÎÉÖÅ ÛÁÇÏ×, ÐÒÏÞÔÉÔÅ
+ ÕÒÏË ÃÅÌÉËÏÍ !!
+
+ 1. îÁÖÍÉÔÅ ËÌÁ×ÉÛÕ <ESC> (ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÕÄÏÓÔÏ×ÅÒÉÔØÓÑ, ÞÔÏ ÷Ù × ÏÂÙÞÎÏÍ
+ ÒÅÖÉÍÅ (Normal mode)).
+
+ 2. îÁÂÅÒÉÔÅ: :q! <ENTER>.
+
+---> üÔÏ ÐÏÚ×ÏÌÉÔ ÷ÁÍ ×ÙÊÔÉ ÉÚ ÒÅÄÁËÔÏÒÁ âåú óïèòáîåîéñ ÌÀÂÙÈ ÓÄÅÌÁÎÎÙÈ
+ ÉÚÍÅÎÅÎÉÊ. åÓÌÉ ÷Ù ÈÏÔÉÔÅ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ É ×ÙÊÔÉ:
+ :wq <ENTER>
+
+ 3. ëÏÇÄÁ ÷Ù Õ×ÉÄÉÔÅ ÐÒÉÇÌÁÛÅÎÉÅ ËÏÍÁÎÄÎÏÊ ÏÂÏÌÏÞËÉ, ÎÁÂÅÒÉÔÅ ËÏÍÁÎÄÕ,
+ ËÏÔÏÒÁÑ ÐÒÉ×ÅÌÁ ÷ÁÓ × ÜÔÏÔ ÕÞÅÂÎÉË. üÔÏ ÍÏÖÅÔ ÂÙÔØ
+ vimtutor ru <ENTER>
+ ïÂÙÞÎÏ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ: vim tutor.ru <ENTER>
+
+---> 'vim' ÐÏÚ×ÏÌÑÅÔ ÚÁÐÕÓÔÉÔØ ÒÅÄÁËÔÏÒ vim, 'tutor.ru' --- ÜÔÏ ÆÁÊÌ, ËÏÔÏÒÙÊ
+ ÷Ù ÂÕÄÅÔÅ ÒÅÄÁËÔÉÒÏ×ÁÔØ.
+
+ 4. åÓÌÉ ÷Ù Õ×ÅÒÅÎÙ × ÔÏÍ, ÞÔÏ ÚÁÐÏÍÎÉÌÉ ÜÔÉ ÛÁÇÉ, ×ÙÐÏÌÎÉÔÅ ÛÁÇÉ ÏÔ 1 ÄÏ 3
+ ÞÔÏÂÙ ×ÙÊÔÉ ÓÎÏ×Á ÚÁÐÕÓÔÉÔØ ÒÅÄÁËÔÏÒ. úÁÔÅÍ ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ Ë
+ õÒÏËÕ 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 1.3: òåäáëôéòï÷áîéå ôåëóôá - õäáìåîéå
+
+
+** îÁÈÏÄÑÓØ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ ÎÁÖÍÉÔÅ x, ÞÔÏÂÙ ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÐÏÄ ËÕÒÓÏÒÏÍ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÓÔÒÏËÅ ×ÎÉÚÕ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. äÌÑ ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË, ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ, ÐÏËÁ ÏÎ ÎÅ ÏËÁÖÅÔÓÑ ÎÁÄ
+ ÕÄÁÌÑÅÍÙÍ ÓÉÍ×ÏÌÏÍ.
+
+ 3. îÁÖÍÉÔÅ ËÌÁ×ÉÛÕ x ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÒÅÂÕÅÍÏÇÏ ÓÉÍ×ÏÌÁ.
+
+ 4. ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 2--4 ÐÏËÁ ÓÔÒÏËÁ ÎÅ ÂÕÄÅÔ ÉÓÐÒÁ×ÌÅÎÁ.
+
+---> ïÔ ÔÔÔÏÐÏÔÁ ËÏÐÙÔÔ ÐÐÐÙÌØ ÐÐÏ ÐÐÐÏÌÀ ÌÅÔÔÉÔÔ.
+
+ 5. ôÅÐÅÒØ, ËÏÇÄÁ ÓÔÒÏËÁ ÏÔËÏÒÒÅËÔÉÒÏ×ÁÎÁ, ÐÅÒÅÈÏÄÉÔÅ Ë ÕÒÏËÕ 1.4.
+
+úáíåþáîéå: ÷ ÈÏÄÅ ÏÓ×ÏÅÎÉÑ ÜÔÏÇÏ ÕÞÅÂÎÉËÁ ÎÅ ÐÙÔÁÊÔÅÓØ ÚÁÐÏÍÉÎÁÔØ, ÕÞÉÔÅ
+ × ÐÒÏÃÅÓÓÅ ÉÓÐÏÌØÚÏ×ÁÎÉÑ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 1.4: òåäáëôéòï÷áîéå ôåëóôá - ÷óôá÷ëá
+
+
+ ** îÁÈÏÄÑÓØ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ (Normal mode), ÎÁÖÍÉÔÅ i ÄÌÑ ×ÓÔÁ×ËÉ ÔÅËÓÔÁ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÐÅÒ×ÏÊ ÓÔÒÏËÅ ×ÎÉÚÕ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÓÄÅÌÁÔØ ÐÅÒ×ÕÀ ÓÔÒÏËÕ ÉÄÅÎÔÉÞÎÏÊ ×ÔÏÒÏÊ, ÐÏÍÅÓÔÉÔÅ
+ ËÕÒÓÏÒ ÎÁ ÓÉÍ×ÏÌ ðåòåä ËÏÔÏÒÙÍ ÓÌÅÄÕÅÔ ×ÓÔÁ×ÉÔØ ÔÅËÓÔ.
+
+ 3. îÁÖÍÉÔÅ i É ÎÁÂÅÒÉÔÅ ÔÒÅÂÕÅÍÙÅ ÄÏÂÁ×ÌÅÎÉÑ.
+
+ 4. ðÏÓÌÅ ÉÓÐÒÁ×ÌÅÎÉÑ ×ÓÅÈ ÏÛÉÂÏË ÎÁÖÍÉÔÅ <ESC> ÄÌÑ ×ÏÚ×ÒÁÔÁ × ÏÂÙÞÎÙÊ ÒÅÖÉÍ.
+ ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 2--4, ÐÏËÁ ÆÒÁÚÁ ÎÅ ÂÕÄÅÔ ÉÓÐÒÁ×ÌÅÎÁ ÐÏÌÎÏÓÔØÀ.
+
+---> þÁÓÔØ ÔÅËÓÔÁ × ÓÔÒÏËÅ ÂÅÓÌÅÄÎÏ .
+---> þÁÓÔØ ÔÅËÓÔÁ × ÜÔÏÊ ÓÔÒÏËÅ ÂÅÓÓÌÅÄÎÏ ÐÒÏÐÁÌÁ.
+
+ 5. ëÏÇÄÁ ÏÓ×ÏÉÔÅ ×ÓÔÁ×ËÕ ÔÅËÓÔÁ, ÐÅÒÅÈÏÄÉÔÅ ÄÁÌØÛÅ Ë òÅÚÀÍÅ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 1
+
+ 1. ëÕÒÓÏÒ ÐÅÒÅÍÅÝÁÅÔÓÑ ÌÉÂÏ ËÌÁ×ÉÛÁÍÉ ÓÏ ÓÔÒÅÌËÁÍÉ, ÌÉÂÏ ËÌÁ×ÉÛÁÍÉ hjkl.
+ h (×ÌÅ×Ï) j (×ÎÉÚ) k (××ÅÒÈ) l (×ÐÒÁ×Ï)
+
+ 2. äÌÑ ÚÁÐÕÓËÁ Vim (ÉÚ ÐÒÉÇÌÁÛÅÎÉÑ % ËÏÍÁÎÄÎÏÊ ÏÂÏÌÏÞËÉ) ÎÁÂÅÒÉÔÅ:
+ vim éíñ_æáêìá <ENTER>
+
+ 3. äÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÒÁÂÏÔÙ Ó Vim ÎÁÂÅÒÉÔÅ:
+ <ESC> :q! <ENTER> ÞÔÏÂÙ ÏÔËÁÚÁÔØÓÑ ÏÔ ÓÏÈÒÁÎÅÎÉÑ ÉÚÍÅÎÅÎÉÊ.
+ éÌÉ ÎÁÂÅÒÉÔÅ:
+ <ESC> :wq <ENTER> ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ.
+
+ 4. äÌÑ ÕÄÁÌÅÎÉÑ ÓÉÍ×ÏÌÁ ÐÏÄ ËÕÒÓÏÒÏÍ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ, ÎÁÂÅÒÉÔÅ: x
+
+ 5. þÔÏÂÙ ×ÓÔÁ×ÉÔØ ÔÅËÓÔ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ, ÎÁÂÅÒÉÔÅ:
+ i ××ÏÄÉÔÅ ÔÅËÓÔ <ESC>
+
+úáíåþáîéå: îÁÖÁÔÉÅ <ESC> ÐÅÒÅÍÅÓÔÉÔ ÷ÁÓ × ÏÂÙÞÎÙÊ ÒÅÖÉÍ (Normal mode) ÌÉÂÏ
+ ÐÒÅÒ×ÅÔ ÎÅÖÅÌÁÔÅÌØÎÕÀ É ÞÁÓÔÉÞÎÏ ÚÁ×ÅÒÛÅÎÎÕÀ ËÏÍÁÎÄÕ.
+
+ôÅÐÅÒØ ÐÅÒÅÈÏÄÉÍ Ë õÒÏËÕ 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 2.1: ëïíáîäù õäáìåîéñ
+
+
+ ** îÁÂÅÒÉÔÅ dw ÄÌÑ ÕÄÁÌÅÎÉÑ ÕÞÁÓÔËÁ ÔÅËÓÔÁ ÄÏ ËÏÎÃÁ ÓÌÏ×Á. **
+
+ 1. îÁÖÍÉÔÅ <ESC>, ÞÔÏÂÙ ÐÅÒÅÊÔÉ × ÏÂÙÞÎÙÊ ÒÅÖÉÍ.
+
+ 2. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 3. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÏ ÓÌÏ×Á, ËÏÔÏÒÏÅ ÓÌÅÄÕÅÔ ÕÄÁÌÉÔØ.
+
+ 4. îÁÂÅÒÉÔÅ dw , ÞÔÏÂÙ ÕÄÁÌÉÔØ ÜÔÏ ÓÌÏ×Ï.
+
+úáíåþáîéå: ÷Ï ×ÒÅÍÑ ÎÁÂÏÒÁ ÂÕË×Ù dw ÐÏÑ×ÑÔÓÑ × ÐÏÓÌÅÄÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ. åÓÌÉ
+ ÷Ù ÞÔÏ-ÔÏ ÎÁÂÅÒÅÔÅ ÎÅÐÒÁ×ÉÌØÎÏ, ÎÁÖÍÉÔÅ <ESC> É ÎÁÞÎÉÔÅ ÓÎÁÞÁÌÁ.
+
+---> îÅÓËÏÌØËÏ ÓÌÏ× ÒÁÆÉÎÁÄ × ÜÔÏÍ ÐÒÅÄÌÏÖÅÎÉÉ Á×ÔÏËÒÁÎ ÉÚÌÉÛÎÉ.
+
+ 5. ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 3 É 4, ÐÏËÁ ÎÅ ÉÓÐÒÁ×ÉÔÅ ×ÓÅ ÏÛÉÂËÉ É ÐÅÒÅÈÏÄÉÔÅ Ë
+ õÒÏËÕ 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 2.2: äïðïìîéôåìøîùå ëïíáîäù õäáìåîéñ
+
+
+ ** îÁÂÅÒÉÔÅ d$ ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ. **
+
+ 1. îÁÖÍÉÔÅ <ESC>, ÞÔÏÂÙ ÐÅÒÅÊÔÉ × ÏÂÙÞÎÙÊ ÒÅÖÉÍ.
+
+ 2. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 3. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ËÏÎÃÕ ÐÒÁ×ÉÌØÎÏÊ ÓÔÒÏËÉ (ðïóìå ÐÅÒ×ÏÊ . ).
+
+ 4. þÔÏÂÙ ÕÄÁÌÉÔØ ÏÓÔÁÔÏË ÓÔÒÏËÉ, ÎÁÂÅÒÉÔÅ d$ .
+
+---> ëÔÏ-ÔÏ ÎÁÂÒÁÌ ÏËÏÎÞÁÎÉÅ ÜÔÏÊ ÓÔÒÏËÉ Ä×ÁÖÄÙ. ÏËÏÎÞÁÎÉÅ ÜÔÏÊ ÓÔÒÏËÉ Ä×ÁÖÄÙ.
+
+
+ 5.þÔÏÂÙ ÌÕÞÛÅ ÒÁÚÏÂÒÁÔØÓÑ × ÜÔÏÍ, ÐÅÒÅÈÏÄÉÔÅ Ë õÒÏËÕ 2.3.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 2.3: ëïíáîäù é ïâÿåëôù
+
+
+ æÏÒÍÁÔ ËÏÍÁÎÄÙ `ÕÄÁÌÅÎÉÅ' d ÔÁËÏ×:
+
+ [ÞÉÓÌÏ] d ÏÂßÅËÔ éìé d [ÞÉÓÌÏ] ÏÂßÅËÔ
+ úÄÅÓØ:
+ ÞÉÓÌÏ - ÓËÏÌØËÏ ÒÁÚ ÉÓÐÏÌÎÉÔØ ËÏÍÁÎÄÕ (ÎÅÏÂÑÚÁÔÅÌØÎÏ, ÐÏ ÕÍÏÌÞÁÎÉÀ=1).
+ d - ËÏÍÁÎÄÁ ÕÄÁÌÅÎÉÑ.
+ ÏÂßÅËÔ - Ó ÞÅÍ ËÏÍÁÎÄÁ ÄÏÌÖÎÁ ÂÙÔØ ×ÙÐÏÌÎÅÎÁ (ÐÅÒÅÞÉÓÌÅÎÏ ÎÉÖÅ).
+
+ ëÒÁÔËÉÊ ÓÐÉÓÏË ÏÂßÅËÔÏ×:
+ w - ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÌÏ×Á, ×ËÌÀÞÁÑ ÚÁ×ÅÒÛÁÀÝÉÊ ÐÒÏÂÅÌ.
+ e - ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÌÏ×Á, îå ×ËÌÀÞÁÑ ÚÁ×ÅÒÛÁÀÝÉÊ ÐÒÏÂÅÌ.
+ $ - ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ.
+ ^ - ÏÔ ËÕÒÓÏÒÁ ÄÏ ÎÁÞÁÌÁ ÓÔÒÏËÉ.
+
+úáíåþáîéå: ðÒÏÓÔÏÅ ÎÁÖÁÔÉÅ ÎÁ ÓÉÍ×ÏÌ ÏÂßÅËÔÁ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ (Normal mode)
+ ÂÅÚ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÎÅÔ ËÕÒÓÏÒ ÔÁË, ËÁË ÕËÁÚÁÎÏ ×
+ ÓÐÉÓËÅ ÏÂßÅËÔÏ×.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 2.4: éóëìàþåîéå éú ðòá÷éìá `ëïíáîäá-ïâÿåëô'
+
+
+ ** îÁÂÅÒÉÔÅ dd ÄÌÑ ÕÄÁÌÅÎÉÑ ×ÓÅÊ ÓÔÒÏËÉ. **
+
+ ÷ÓÌÅÄÓÔ×ÉÅ ÞÁÓÔÏÇÏ ÐÒÉÍÅÎÅÎÉÑ ÏÐÅÒÁÃÉÉ ÕÄÁÌÅÎÉÑ ×ÓÅÊ ÓÔÒÏËÉ, ÒÁÚÒÁÂÏÔÞÉËÉ
+ Vim ÒÅÛÉÌÉ, ÞÔÏ ÄÌÑ ÜÔÏÇÏ ÐÒÏÝÅ ×ÓÅÇÏ ÐÒÏÓÔÏ ÎÁÂÒÁÔØ d Ä×ÁÖÄÙ.
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, ËÏ ×ÔÏÒÏÊ ÓÔÒÏËÅ ÆÒÁÚÙ.
+ 2. îÁÂÅÒÉÔÅ dd ÄÌÑ ÕÄÁÌÅÎÉÑ ÓÔÒÏËÉ.
+ 3. ôÅÐÅÒØ ÐÅÒÅÍÅÓÔÉÔÅÓØ Ë ÞÅÔ×ÅÒÔÏÊ ÓÔÒÏËÅ.
+ 4. îÁÂÅÒÉÔÅ 2dd (×ÓÐÏÍÎÉÔÅ ÐÒÁ×ÉÌÏ `ÞÉÓÌÏ-ËÏÍÁÎÄÁ-ÏÂßÅËÔ'), ÞÔÏÂÙ ÕÄÁÌÉÔØ
+ Ä×Å ÓÔÒÏËÉ.
+
+ 1) ìÅÔÏÍ Ñ ÈÏÖÕ ÎÁ ÓÔÁÄÉÏÎ,
+ 2) ï, ËÁË ×ÎÅÚÁÐÎÏ ËÏÎÞÉÌÓÑ ÄÉ×ÁÎ!
+ 3) ñ ÂÏÌÅÀ ÚÁ ``úÅÎÉÔ'', ``úÅÎÉÔ'' --- ÞÅÍÐÉÏÎ!
+ 4) ðÅÞÁÌØÎÏ Ñ ÇÌÑÖÕ ÎÁ ÎÁÛÅ ÐÏËÏÌÅÎÉÅ!
+ 5) åÇÏ ÇÒÑÄÕÝÅÅ ÉÌØ ÐÕÓÔÏ ÉÌØ ÔÅÍÎÏ...
+ 6) ñ ÓÉÖÕ ÎÁ ÓËÁÍÅÊËÅ × ÌÏÖÅ `â'
+ 7) é ÉÇÒÁÀ ÎÁ ÂÏÌØÛÏÊ ÖÅÓÔÑÎÏÊ ÔÒÕÂÅ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 2.5: ëïíáîäá `ïôëáô'
+
+
+ ** îÁÖÍÉÔÅ u ÄÌÑ ÏÔÍÅÎÙ ÒÅÚÕÌØÔÁÔÁ ÒÁÂÏÔÙ ÐÒÅÄÙÄÕÝÅÊ ËÏÍÁÎÄÙ, U ÄÌÑ ÏÔÍÅÎÙ
+ ÉÓÐÒÁ×ÌÅÎÉÊ ×Ï ×ÓÅÊ ÓÔÒÏËÅ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ ---> É ÕÓÔÁÎÏ×ÉÔÅ ÅÇÏ ÎÁ
+ ÐÅÒ×ÕÀ ÏÛÉÂËÕ.
+ 2. îÁÖÍÉÔÅ x ÄÌÑ ÕÄÁÌÅÎÉÑ ÐÅÒ×ÏÇÏ ÎÅÐÒÁ×ÉÌØÎÏÇÏ ÓÉÍ×ÏÌÁ.
+ 3. ôÅÐÅÒØ ÎÁÖÍÉÔÅ u ÄÌÑ ÏÔÍÅÎÙ (ÏÔËÁÔÁ) ÐÏÓÌÅÄÎÅÊ ×ÙÐÏÌÎÅÎÎÏÊ ËÏÍÁÎÄÙ.
+ 4. éÓÐÒÁ×ØÔÅ ×ÓÅ ÏÛÉÂËÉ × ÓÔÒÏËÅ, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ x .
+ 5. ôÅÐÅÒØ ÎÁÖÍÉÔÅ ÚÁÇÌÁ×ÎÕÀ U ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ×ÅÒÎÕÔØ ×ÓÀ ÓÔÒÏËÕ × ÉÓÈÏÄÎÏÅ
+ ÓÏÓÔÏÑÎÉÅ.
+ 6. îÁÖÍÉÔÅ u ÎÅÓËÏÌØËÏ ÒÁÚ ÄÌÑ ÏÔÍÅÎÙ ËÏÍÁÎÄÙ U É ÐÒÅÄÙÄÕÝÉÈ ËÏÍÁÎÄ.
+ 7. îÁÖÍÉÔÅ ÔÅÐÅÒØ CTRL-R (ÕÄÅÒÖÉ×ÁÊÔÅ ËÌÁ×ÉÛÕ CTRL ÎÁÖÁÔÏÊ × ÍÏÍÅÎÔ ÎÁÖÁÔÉÑ
+ R) ÎÅÓËÏÌØËÏ ÒÁÚ ÄÌÑ ×ÏÚ×ÒÁÔÁ ËÏÍÁÎÄ (ÏÔËÁÔ ÏÔËÁÔÁ).
+
+---> éÓÐÒÒÁ×ØÔÅ ÏÏÛÉÂËÉ × ÜÔÏÊÊ ÓÔÒÏËÅ É ×ÅÒÎÉÔÔÅ ÉÈ ÓÓ ÐÏÍÏÝØØÀ `ÏÔËÁÔÁ'.
+
+ 8. üÔÏ ÂÙÌÉ ÏÞÅÎØ ÐÏÌÅÚÎÙÅ ËÏÍÁÎÄÙ. äÁÌÅÅ ÐÅÒÅÈÏÄÉÔÅ Ë òÅÚÀÍÅ õÒÏËÁ 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 2
+
+
+ 1. äÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÌÏ×Á ÎÁÂÅÒÉÔÅ: dw
+
+ 2. äÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ ÎÁÂÅÒÉÔÅ: d$
+
+ 3. äÌÑ ÕÄÁÌÅÎÉÑ ×ÓÅÊ ÓÔÒÏËÉ ÎÁÂÅÒÉÔÅ: dd
+
+ 4. æÏÒÍÁÔ ËÏÍÁÎÄÙ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ ÉÍÅÅÔ ×ÉÄ:
+
+ [ÞÉÓÌÏ] ËÏÍÁÎÄÁ ÏÂßÅËÔ éìé ËÏÍÁÎÄÁ [ÞÉÓÌÏ] ÏÂßÅËÔ
+ ÇÄÅ:
+ ÞÉÓÌÏ - ÓËÏÌØËÏ ÒÁÚ ÐÏ×ÔÏÒÉÔØ ×ÙÐÏÌÎÅÎÉÅ ËÏÍÁÎÄÙ
+ ËÏÍÁÎÄÁ - ÞÔÏ ×ÙÐÏÌÎÉÔØ, ÎÁÐÒÉÍÅÒ d ÄÌÑ ÕÄÁÌÅÎÉÑ
+ ÏÂßÅËÔ - ÎÁ ÞÔÏ ÄÏÌÖÎÁ ×ÏÚÄÅÊÓÔ×Ï×ÁÔØ ËÏÍÁÎÄÁ, ÎÁÐÒÉÍÅÒ w (ÓÌÏ×Ï),
+ $ (ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ), É Ô.Ä.
+
+ 5. äÌÑ ÏÔÍÅÎÙ (ÏÔËÁÔÁ) ÐÒÅÄÛÅÓÔ×ÕÀÝÉÈ ÄÅÊÓÔ×ÉÊ ÎÁÂÅÒÉÔÅ: u (ÓÔÒÏÞÎÁÑ u)
+ äÌÑ ÏÔÍÅÎÙ (ÏÔËÁÔÁ) ×ÓÅÈ ÉÚÍÅÎÅÎÉÊ × ÓÔÒÏËÅ ÎÁÂÅÒÉÔÅ: U (ÐÒÏÐÉÓÎÁÑ U)
+ äÌÑ ÏÔÍÅÎÙ ÏÔËÁÔÁ ÎÁÂÅÒÉÔÅ: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 3.1: ëïíáîäá ÷óôá÷ëé
+
+
+ ** îÁÂÅÒÉÔÅ p ÄÌÑ ×ÓÔÁ×ËÉ ÐÏÓÌÅÄÎÅÇÏ ÕÄÁÌÅÎÎÏÇÏ ÔÅËÓÔÁ ÐÏÓÌÅ ËÕÒÓÏÒÁ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ Ë ÐÏÓÌÅÄÎÅÊ ÓÔÒÏËÅ ÉÚ ÎÁÂÏÒÁ.
+
+ 2. îÁÂÅÒÉÔÅ dd ÄÌÑ ÕÄÁÌÅÎÉÑ ÓÔÒÏËÉ É ÅÅ ÓÏÈÒÁÎÅÎÉÑ × ÂÕÆÅÒÅ Vim'Á.
+
+ 3. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÓÔÒÏËÅ îáä ÔÅÍ ÍÅÓÔÏÍ, ËÕÄÁ ÓÌÅÄÕÅÔ ×ÓÔÁ×ÉÔØ
+ ÕÄÁÌÅÎÎÕÀ ÓÔÒÏËÕ.
+
+ 4. îÁÈÏÄÑÓØ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ ÎÁÂÅÒÉÔÅ p ÄÌÑ ÚÁÍÅÎÙ ÓÔÒÏËÉ.
+
+ 5. ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 2--4, ÐÏËÁ ÎÅ ÒÁÓÓÔÁ×ÉÔÅ ×ÓÅ ÓÔÒÏËÉ × ÎÕÖÎÏÍ ÐÏÒÑÄËÅ.
+
+ Ç) é ÌÕÞÛÅ ×ÙÄÕÍÁÔØ ÎÅ ÍÏÇ.
+ Â) ëÏÇÄÁ ÎÅ × ÛÕÔËÕ ÚÁÎÅÍÏÇ,
+ ×) ïÎ Õ×ÁÖÁÔØ ÓÅÂÑ ÚÁÓÔÁ×ÉÌ
+ Á) íÏÊ ÄÑÄÑ ÓÁÍÙÈ ÞÅÓÔÎÙÈ ÐÒÁ×ÉÌ
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 3.2: ëïíáîäá úáíåîù
+
+
+ ** îÁÂÅÒÉÔÅ r É ÓÉÍ×ÏÌ, ÚÁÍÅÎÑÀÝÉÊ ÓÉÍ×ÏÌ ÐÏÄ ËÕÒÓÏÒÏÍ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. õÓÔÁÎÏ×ÉÔÅ ËÕÒÓÏÒ ÔÁË, ÞÔÏÂÙ ÏÎ ÎÁÈÏÄÉÌÓÑ ÎÁÄ ÐÅÒ×ÏÊ ÏÛÉÂËÏÊ.
+
+ 3. îÁÂÅÒÉÔÅ r É ÚÁÔÅÍ ÓÉÍ×ÏÌ, ÉÓÐÒÁ×ÌÑÀÝÉÊ ÏÛÉÂËÕ.
+
+ 4. ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 2 É 3, ÐÏËÁ ÐÅÒ×ÁÑ ÓÔÒÏËÁ ÎÅ ÂÕÄÅÔ ÉÓÐÒÁ×ÌÅÎÁ.
+
+---> ÷ ÍÏÍÅÇÔ ÎÁÂÔÒÁ ÜÔÏÊ ÞÔÒÏËÉ ËÏÅ0ËÔÏ Ó ÔÒÕÄÏÍ ÐÏÐ×ÄÁÌ ÐÏ ËÌ×ÁÉÛÁÍ!
+---> ÷ ÍÏÍÅÎÔ ÎÁÂÏÒÁ ÜÔÏÊ ÓÔÒÏËÉ ËÏÅ-ËÔÏ Ó ÔÒÕÄÏÍ ÐÏÐÁÄÁÌ ÐÏ ËÌÁ×ÉÛÁÍ!
+
+ 5. ôÅÐÅÒØ ÐÅÒÅÈÏÄÉÔÅ Ë õÒÏËÕ 3.2.
+
+úáíåþáîéå: ðÏÍÎÉÔÅ, ÞÔÏ ×Ù ÄÏÌÖÎÙ ÕÞÉÔØÓÑ × ÐÒÏÃÅÓÓÅ ÒÁÂÏÔÙ, Á ÎÅ ÐÒÏÓÔÏ
+ ÚÁÐÏÍÉÎÁÑ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 3.3: ëïíáîäá éúíåîåîéñ
+
+
+ ** äÌÑ ÉÚÍÅÎÅÎÉÑ ÞÁÓÔÉ ÓÌÏ×Á ÎÁÂÅÒÉÔÅ cw . **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. òÁÓÐÏÌÏÖÉÔÅ ËÕÒÓÏÒ ÎÁÄ ÂÕË×ÏÊ `o' × ÓÌÏ×Å `ÓÏÌÁ'.
+
+ 3. îÁÂÅÒÉÔÅ cw É ÉÓÐÒÁ×ØÔÅ ÓÌÏ×Ï (× ÄÁÎÎÏÍ ÓÌÕÞÁÅ, ÎÁÂÅÒÉÔÅ `ÌÏ×'.)
+
+ 4. îÁÖÍÉÔÅ <ESC> É ÐÅÒÅÈÏÄÉÔÅ Ë ÓÌÅÄÕÀÝÅÊ ÏÛÉÂËÅ (Ë ÐÅÒ×ÏÍÕ ÓÉÍ×ÏÌÕ, ËÏÔÏÒÙÊ
+ ÎÁÄÏ ÉÚÍÅÎÉÔØ.)
+
+ 5. ðÏ×ÔÏÒÉÔÅ ÛÁÇÉ 3--4 ÐÏËÁ ÐÅÒ×ÏÅ ÐÒÅÄÌÏÖÅÎÉÅ ÎÅ ÓÔÁÎÅÔ ÉÄÅÎÔÉÞÎÙÍ ×ÔÏÒÏÍÕ.
+
+---> îÅÓËÏÌØËÏ ÓÏÌÁ × ÜØÇà ÓÔÒÏËÅ ÔÐÇÛÃÂØ ÒÅÄÁÌÚËÕÀÉÅÓ×È.
+---> îÅÓËÏÌØËÏ ÓÌÏ× × ÜÔÏÊ ÓÔÒÏËÅ ÔÒÅÂÕÀÔ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ.
+
+ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ, ÞÔÏ cw ÎÅ ÔÏÌØËÏ ÚÁÍÅÎÑÅÔ ÓÌÏ×Ï, ÎÏ É ÐÅÒÅ×ÏÄÉÔ ×ÁÓ × ÒÅÖÉÍ
+×ÓÔÁ×ËÉ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 3.4: ðòïäïìöáåí éúíåîñôø ó ëïíáîäïê c
+
+
+** ëÏÍÁÎÄÁ ÚÁÍÅÎÙ ÉÓÐÏÌØÚÕÅÔÓÑ Ó ÔÅÍÉ ÖÅ ÏÂßÅËÔÁÍÉ, ÞÔÏ É ËÏÍÁÎÄÁ ÕÄÁÌÅÎÉÑ. **
+
+ 1. ëÏÍÁÎÄÁ ÉÚÍÅÎÅÎÉÑ ÐÒÉÍÅÎÑÅÔÓÑ ÔÁËÉÍ ÖÅ ÏÂÒÁÚÏÍ, ËÁË É ËÏÍÁÎÄÁ ÕÄÁÌÅÎÉÑ.
+ åÅ ÆÏÒÍÁÔ ÔÁËÏ×:
+
+ [ÞÉÓÌÏ] c ÏÂßÅËÔ éìé c [ÞÉÓÌÏ] ÏÂßÅËÔ
+
+ 2. ïÂßÅËÔÙ ÔÁËÖÅ ÓÏ×ÐÁÄÁÀÔ: w (ÓÌÏ×Ï), $ (ËÏÎÅà ÓÔÒÏËÉ) É Ô.Ð.
+
+ 3. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 4. ðÅÒÅÊÄÉÔÅ Ë ÐÅÒ×ÏÊ ÏÛÉÂËÅ.
+
+ 5. îÁÂÅÒÉÔÅ c$ É ÏÔÒÅÄÁËÔÉÒÕÊÔÅ ÐÅÒ×ÕÀ ÓÔÒÏËÕ ÔÁË, ÞÔÏÂÙ ÏÎÁ ÓÏ×ÐÁÄÁÌÁ ÓÏ
+ ×ÔÏÒÏÊ, ÐÏÓÌÅ ÞÅÇÏ ÎÁÖÍÉÔÅ <ESC>.
+
+---> ëÏÎÅà ÜÔÏÊ ÓÔÒÏËÉ ÎÕÖÄÁÅÔÓÑ × ÐÏÍÏÝÉ, ÞÔÏÂÙ ÓÔÁÔØ ÐÏÈÏÖÉÍ ÎÁ ×ÔÏÒÏÊ.
+---> ëÏÎÅà ÜÔÏÊ ÓÔÒÏËÉ ÎÕÖÄÁÅÔÓÑ × ÐÏÍÏÝÉ ËÏÍÁÎÄÙ c$ .
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 3
+
+
+ 1. äÌÑ ×ÓÔÁ×ËÉ ÔÅËÓÔÁ, ËÏÔÏÒÙÊ ÔÏÌØËÏ ÞÔÏ ÂÙÌ ÕÄÁÌÅÎ, ÎÁÂÅÒÉÔÅ p . üÔÁ
+ ËÏÍÁÎÄÁ ×ÓÔÁ×ÉÔ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ ðïóìå ËÕÒÓÏÒÁ (ÅÓÌÉ ÂÙÌÁ ÕÄÁÌÅÎÁ ÓÔÒÏËÁ,
+ ÔÏ ÏÎÁ ÂÕÄÅÔ ÐÏÍÅÝÅÎÁ × ÓÔÒÏËÅ ÐÏÄ ËÕÒÓÏÒÏÍ).
+
+ 2. äÌÑ ÚÁÍÅÎÙ ÓÉÍ×ÏÌÁ ÐÏÄ ËÕÒÓÏÒÏÍ ÎÁÂÅÒÉÔÅ r É ÚÁÔÅÍ ÚÁÍÅÎÑÀÝÉÊ ÓÉÍ×ÏÌ.
+
+ 3. ëÏÍÁÎÄÁ ÉÚÍÅÎÅÎÉÑ ÐÏÚ×ÏÌÑÅÔ ÷ÁÍ ÉÚÍÅÎÉÔØ ÕËÁÚÁÎÎÙÊ ÏÂßÅËÔ ÏÔ ËÕÒÓÏÒÁ ÄÏ
+ ËÏÎÃÁ ÜÔÏÇÏ ÏÂßÅËÔÁ. îÁÐÒÉÍÅÒ, ÎÁÂÅÒÉÔÅ cw ÄÌÑ ÚÁÍÅÎÙ ÏÔ ËÕÒÓÏÒÁ ÄÏ
+ ËÏÎÃÁ ÓÌÏ×Á, c$ ÄÌÑ ÉÚÍÅÎÅÎÉÑ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ.
+
+ 4. æÏÒÍÁÔ ËÏÍÁÎÄÙ ÉÚÍÅÎÅÎÉÑ ÔÁËÏ×:
+
+ [ÞÉÓÌÏ] c ÏÂßÅËÔ éìé c [ÞÉÓÌÏ] ÏÂßÅËÔ
+
+ôÅÐÅÒØ ÏÔÐÒÁ×ÌÑÊÔÅÓØ Ë ÓÌÅÄÕÀÝÅÍÕ ÕÒÏËÕ.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 4.1: éîæïòíáãéñ ï æáêìå é òáóðïìïöåîéå ÷ îåí
+
+
+ ** îÁÂÅÒÉÔÅ CTRL-g ÞÔÏÂÙ Õ×ÉÄÅÔØ ÷ÁÛÅ ÍÅÓÔÏÒÁÓÐÏÌÏÖÅÎÉÅ × ÆÁÊÌÅ É ÉÎÆÏÒÍÁÃÉÀ
+ Ï ÎÅÍ.
+ îÁÂÅÒÉÔÅ SHIFT-G ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ Ë ÚÁÄÁÎÎÏÊ ÓÔÒÏËÅ × ÆÁÊÌÅ. **
+
+ úÁÍÅÞÁÎÉÅ: ðÒÏÞÉÔÁÊÔÅ ×ÅÓØ ÕÒÏË ÐÒÅÖÄÅ ÞÅÍ ×ÙÐÏÌÎÑÔØ ÌÀÂÙÅ ËÏÍÁÎÄÙ!!
+
+ 1. õÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ Ctrl ÎÁÖÍÉÔÅ g . ÷ÎÉÚÕ ÜËÒÁÎÁ ÐÏÑ×ÉÔÓÑ ÓÔÒÏËÁ ÓÔÁÔÕÓÁ Ó
+ ÉÍÅÎÅÍ ÆÁÊÌÁ É ÎÏÍÅÒÏÍ ÓÔÒÏËÉ, × ËÏÔÏÒÏÊ ÷Ù ÎÁÈÏÄÉÔÅÓØ. úÁÐÏÍÎÉÔÅ ÎÏÍÅÒ
+ ÓÔÒÏËÉ, ÏÎ ÐÏÔÒÅÂÕÅÔÓÑ ÎÁ ûÁÇÅ 3.
+
+ 2. îÁÖÍÉÔÅ shift-G ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ Ë ËÏÎÃÕ ÆÁÊÌÁ.
+
+ 3. îÁÂÅÒÉÔÅ ÎÏÍÅÒ ÓÔÒÏËÉ, × ËÏÔÏÒÏÊ ×Ù ÎÁÈÏÄÉÌÉÓØ É ÚÁÔÅÍ shift-G. üÔÏ
+ ×ÅÒÎÅÔ ÷ÁÓ Ë ÓÔÒÏËÅ, × ËÏÔÏÒÏÊ ÷Ù ÂÙÌÉ, ËÏÇÄÁ × ÐÅÒ×ÙÊ ÒÁÚ ÎÁÖÁÌÉ Ctrl-g.
+ (ëÏÇÄÁ ÷Ù ÂÕÄÅÔÅ ÎÁÂÉÒÁÔØ ÃÉÆÒÙ, ÏÎÉ îå ÏÔÏÂÒÁÚÑÔÓÑ ÎÁ ÜËÒÁÎÅ.)
+
+ 4. åÓÌÉ ÷Ù ÚÁÐÏÍÎÉÌÉ ×ÓÅ ×ÙÛÅÓËÁÚÁÎÎÏÅ, ×ÙÐÏÌÎÉÔÅ ÛÁÇÉ 1--3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 4.2: ëïíáîäá ðïéóëá
+
+ ** îÁÂÅÒÉÔÅ / É ÚÁÔÅÍ ××ÅÄÉÔÅ ÉÓËÏÍÕÀ ÆÒÁÚÕ. **
+
+ 1. ÷ ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ (Normal mode) ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ / . ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ,
+ ÞÔÏ ÏÎ ×ÍÅÓÔÅ Ó ËÕÒÓÏÒÏÍ ÐÏÑ×ÉÔÓÑ ×ÎÉÚÕ ÜËÒÁÎÁ, ËÁË ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ Ó
+ ËÏÍÁÎÄÏÊ : .
+
+ 2. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ 'ÏÛÛÛÉÂËÁ' <ENTER>. üÔÏ ÔÏ ÓÌÏ×Ï, ËÏÔÏÒÏÅ ÷Ù ÂÕÄÅÔÅ
+ ÉÓËÁÔØ.
+
+ 3. äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÐÏ×ÔÏÒÉÔØ ÐÏÉÓË, ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ n .
+ äÌÑ ÐÏÉÓËÁ ÜÔÏÊ ÆÒÁÚÙ × ÏÂÒÁÔÎÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ, ÎÁÖÍÉÔÅ Shift-N .
+
+ 4. åÓÌÉ ÷Ù ÖÅÌÁÅÔÅ ÓÒÁÚÕ ÉÓËÁÔØ × ÏÂÒÁÔÎÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ, ÉÓÐÏÌØÚÕÊÔÅ
+ ËÏÍÁÎÄÕ ? ×ÍÅÓÔÏ / .
+
+---> ëÏÇÄÁ ÷Ù ÐÒÉ ÐÏÉÓËÅ ÄÏÓÔÉÇÎÅÔÅ ËÏÎÃÁ ÆÁÊÌÁ, ÐÏÉÓË ÂÕÄÅÔ ÐÒÏÄÏÌÖÅÎ Ó
+ ÎÁÞÁÌÁ.
+
+ "ÏÛÛÛÉÂËÁ" ÜÔÏ ÎÅ ÓÐÏÓÏ ÐÒÏÉÚÎÅÓÅÎÉÑ ÓÌÏ×Á `ÏÛÉÂËÁ'; ÏÛÛÛÉÂËÁ ÜÔÏ ÏÛÉÂËÁ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 4.3: ðïéóë ðáòîùè óëïâïë
+
+
+ ** îÁÂÅÒÉÔÅ % ÄÌÑ ÐÏÉÓËÁ ÐÁÒÎÙÈ ),] ÉÌÉ } . **
+
+ 1. ðÏÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁÄ ÌÀÂÏÊ ÉÚ (, [ ÉÌÉ { × ÓÔÒÏËÅ ×ÎÉÚÕ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ % .
+
+ 3. ëÕÒÓÏÒ ÄÏÌÖÅÎ ÐÅÒÅÓËÏÞÉÔØ ÎÁ ÐÁÒÎÕÀ ÓËÏÂËÕ.
+
+ 4. îÁÂÅÒÉÔÅ % ÄÌÑ ×ÏÚ×ÒÁÔÁ ËÕÒÓÏÒÁ ÎÁÚÁÄ Ë ÐÅÒ×ÏÊ ÓËÏÂËÅ.
+
+---> üÔÏ ( ÓÔÒÏËÁ, ÓÏÄÅÒÖÁÝÁÑ ÔÁËÉÅ (, ÔÁËÉÅ [ ] É ÔÁËÉÅ { } ÓËÏÂËÉ. ))
+
+úÁÍÅÞÁÎÉÅ: üÔÏ ÏÞÅÎØ ÕÄÏÂÎÏ ÐÒÉ ÏÔÌÁÄËÅ ÐÒÏÇÒÁÍÍ Ó ÐÒÏÐÕÝÅÎÎÙÍÉ ÓËÏÂËÁÍÉ!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 4.4: óðïóïâ éóðòá÷ìåîéñ ïûéâïë
+
+
+ ** îÁÂÅÒÉÔÅ :s/ÂÙÌÏ/ÓÔÁÌÏ/g ÄÌÑ ÚÁÍÅÎÙ 'ÂÙÌÏ' ÎÁ 'ÓÔÁÌÏ'. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. îÁÂÅÒÉÔÅ :s/Õ×ÏÄÀ/Õ×ÏÖÕ <ENTER> . ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ ÎÁ ÔÏ, ÞÔÏ ÜÔÁ ËÏÍÁÎÄÁ
+ ÚÁÍÅÎÉÔ ÔÏÌØËÏ ÐÅÒ×ÏÅ ÎÁÊÄÅÎÎÏÅ ×ÈÏÖÄÅÎÉÅ × ÓÔÒÏËÅ.
+
+ 3. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ :s/Õ×ÏÄÀ/Õ×ÏÖÕ/g , ÏÚÎÁÞÁÀÝÅÅ ÐÏÄÓÔÁÎÏ×ËÕ ÇÌÏÂÁÌØÎÏ ×Ï
+ ×ÓÅÊ ÓÔÒÏËÅ. üÔÏ ÚÁÍÅÎÉÔ ×ÓÅ ÎÁÊÄÅÎÎÙÅ × ÓÔÒÏËÅ ×ÈÏÖÄÅÎÉÑ.
+
+---> ñ Õ×ÏÄÀ Ë ÏÔ×ÅÒÖÅÎÎÙÍ ÓÅÌÅÎØÑÍ, Ñ Õ×ÏÄÀ ÓË×ÏÚØ ×ÅËÏ×ÅÞÎÙÊ ÓÔÏÎ, Ñ Õ×ÏÄÀ Ë
+ ÚÁÂÙÔÙÍ ÐÏËÏÌÅÎØÑÍ.
+
+ 4. äÌÑ ÚÁÍÅÎÙ ×ÓÅÈ ×ÈÏÖÄÅÎÉÊ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔÉ ÓÉÍ×ÏÌÏ× ÍÅÖÄÕ Ä×ÕÍÑ
+ ÓÔÒÏËÁÍÉ,
+ ÎÁÂÅÒÉÔÅ :#,#s/ÂÙÌÏ/ÓÔÁÌÏ/g ÇÄÅ #,# --- ÎÏÍÅÒÁ ÜÔÉÈ ÓÔÒÏË.
+ îÁÂÅÒÉÔÅ :%s/ÂÙÌÏ/ÓÔÁÌÏ/g ÄÌÑ ÚÁÍÅÎÙ ×ÓÅÈ ×ÈÏÖÄÅÎÉÊ ×Ï ×ÓÅÍ ÆÁÊÌÅ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 4
+ 1. Ctrl-g ÐÏËÁÚÙ×ÁÅÔ ×ÁÛÅ ÐÏÌÏÖÅÎÉÅ × ÆÁÊÌÅ É ÉÎÆÏÒÍÁÃÉÀ Ï ÎÅÍ.
+ Shift-G ÐÅÒÅÍÅÝÁÅÔ ÷ÁÓ × ËÏÎÅà ÆÁÊÌÁ. îÏÍÅÒ, ÚÁ ËÏÔÏÒÙÍ ÓÌÅÄÕÅÔ Shift-G
+ ÐÏÚ×ÏÌÑÅÔ ÐÅÒÅÊÔÉ Ë ÓÔÒÏËÅ Ó ÜÔÉÍ ÎÏÍÅÒÏÍ.
+
+ 2. îÁÖÁÔÉÅ / É ÚÁÔÅÍ ××ÏÄ ÓÔÒÏËÉ ÐÏÚ×ÏÌÑÅÔ ÐÒÏÉÚ×ÅÓÔÉ ÐÏÉÓË ÜÔÏÊ ÓÔÒÏËÉ
+ ÷ðåòåä ÐÏ ÔÅËÓÔÕ.
+ îÁÖÁÔÉÅ ? É ÚÁÔÅÍ ××ÏÄ ÓÔÒÏËÉ ÐÏÚ×ÏÌÑÅÔ ÐÒÏÉÚ×ÅÓÔÉ ÐÏÉÓË ÜÔÏÊ ÓÔÒÏËÉ
+ îáúáä ÐÏ ÔÅËÓÔÕ.
+ ðÏÓÌÅ ÐÏÉÓËÁ ÎÁÂÅÒÉÔÅ n ÄÌÑ ÐÅÒÅÈÏÄÁ Ë ÓÌÅÄÕÀÝÅÍÕ ×ÈÏÖÄÅÎÉÀ ÉÓËÏÍÏÊ
+ ÓÔÒÏËÉ × ÔÏÍ ÖÅ ÎÁÐÒÁ×ÌÅÎÉÉ ÉÌÉ Shift-N ÄÌÑ ÐÅÒÅÈÏÄÁ × ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏÍ
+ ÎÁÐÒÁ×ÌÅÎÉÉ.
+
+ 3. îÁÖÁÔÉÅ % , ËÏÇÄÁ ËÕÒÓÏÒ ÎÁÈÏÄÉÔÓÑ ÎÁ (,),[,],{, ÉÌÉ } ÐÏÚ×ÏÌÑÅÔ ÎÁÊÔÉ
+ ÐÁÒÎÕÀ ÓËÏÂËÕ.
+
+ 4. äÌÑ ÐÏÄÓÔÁÎÏ×ËÉ `ÓÔÁÌÏ' ×ÍÅÓÔÏ ÐÅÒ×ÏÇÏ `ÂÙÌÏ' × ÓÔÒÏËÅ, ÎÁÂÅÒÉÔÅ
+ :s/old/new
+ äÌÑ ÐÏÄÓÔÁÎÏ×ËÉ `ÓÔÁÌÏ' ×ÍÅÓÔÏ ×ÓÅÈ `ÂÙÌÏ' × ÓÔÒÏËÅ, ÎÁÂÅÒÉÔÅ
+ :s/old/new/g
+ äÌÑ ÚÁÍÅÎÙ × ÉÎÔÅÒ×ÁÌÅ ÍÅÖÄÕ Ä×ÕÍÑ ÓÔÒÏËÁÍÉ, ÎÁÂÅÒÉÔÅ
+ :#,#s/old/new/g
+ äÌÑ ÚÁÍÅÎÙ ×ÓÅÈ ×ÈÏÖÄÅÎÉÊ `ÂÙÌÏ' ÎÁ `ÓÔÁÌÏ' × ÆÁÊÌÅ, ÎÁÂÅÒÉÔÅ
+ :%s/old/new/g
+ þÔÏÂÙ ÒÅÄÁËÔÏÒ ËÁÖÄÙÊ ÒÁÚ ÚÁÐÒÁÛÉ×ÁÌ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÄÏÂÁ×ØÔÅ 'c'
+ :%s/old/new/gc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 5.1: ëáë ÷ùðïìîéôø ÷îåûîàà ëïíáîäõ
+
+
+ ** îÁÂÅÒÉÔÅ :! É ÚÁÔÅÍ ×ÎÅÛÎÀÀ ËÏÍÁÎÄÕ, ËÏÔÏÒÕÀ ÓÌÅÄÕÅÔ ×ÙÐÏÌÎÉÔØ. **
+
+ 1. îÁÂÅÒÉÔÅ ÕÖÅ ÚÎÁËÏÍÕÀ ÷ÁÍ ËÏÍÁÎÄÕ : ÄÌÑ ÕÓÔÁÎÏ×ËÉ ËÕÒÓÏÒÁ × ËÏÍÁÎÄÎÕÀ
+ ÓÔÒÏËÕ ÒÅÄÁËÔÏÒÁ. üÔÏ ÐÏÚ×ÏÌÉÔ ÷ÁÍ ××ÅÓÔÉ ËÏÍÁÎÄÕ.
+
+ 2. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ ! (×ÏÓËÌÉÃÁÔÅÌØÎÙÊ ÚÎÁË). ôÅÐÅÒØ ÍÏÖÎÏ ÉÓÐÏÌÎÉÔØ
+ ×ÎÅÛÎÀÀ ËÏÍÁÎÄÕ, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÎÕÀ ÏÂÏÌÏÞËÕ.
+
+ 3. äÌÑ ÐÒÉÍÅÒÁ ÎÁÂÅÒÉÔÅ ls ÐÏÓÌÅ ! É ÎÁÖÍÉÔÅ <ENTER>. üÔÁ ËÏÍÁÎÄÁ ×Ù×ÅÄÅÔ
+ ÓÐÉÓÏË ÆÁÊÌÏ× × ÔÅËÕÝÅÍ ËÁÔÁÌÏÇÅ, ÔÏÞÎÏ ÔÁËÖÅ, ËÁË ÅÓÌÉ ÂÙ ÷Ù ××ÅÌÉ ÜÔÕ
+ ËÏÍÁÎÄÕ × ÐÒÉÇÌÁÛÅÎÉÉ ÏÂÏÌÏÞËÉ. éÌÉ ÐÏÐÒÏÂÕÊÔÅ :!dir , ÅÓÌÉ ÐÒÅÄÙÄÕÝÁÑ
+ ËÏÍÁÎÄÁ ÎÅ ÓÒÁÂÏÔÁÌÁ.
+
+---> úÁÍÅÞÁÎÉÅ: ôÁËÉÍ ÓÐÏÓÏÂÏÍ ÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÌÀÂÕÀ ×ÎÅÛÎÀÀ ËÏÍÁÎÄÕ.
+
+---> úÁÍÅÞÁÎÉÅ: ÷ÓÅ ËÏÍÁÎÄÙ, ÎÁÞÉÎÁÀÝÉÅÓÑ Ó : , ÄÏÌÖÎÙ ÚÁ×ÅÒÛÁÔØÓÑ ÎÁÖÁÔÉÅÍ
+ <ENTER>.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 5.2: ëáë úáðéóáôø æáêì
+
+
+** äÌÑ ÓÏÈÒÁÎÅÎÉÑ ÉÚÍÅÎÅÎÉÊ, ÐÒÏÉÚ×ÅÄÅÎÎÙÈ × ÆÁÊÌÅ, ÎÁÂÅÒÉÔÅ :w éíñ_æáêìá. **
+
+ 1. îÁÂÅÒÉÔÅ :!dir ÉÌÉ :!ls ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÓÐÉÓËÁ ÆÁÊÌÏ× × ÔÅËÕÝÅÍ ËÁÔÁÌÏÇÅ.
+ ëÁË ÷ÁÍ ÕÖÅ ÉÚ×ÅÓÔÎÏ, ÷Ù ÄÏÌÖÎÙ ÎÁÖÁÔØ <ENTER> ÐÏÓÌÅ ××ÏÄÁ ÜÔÉÈ ËÏÍÁÎÄ.
+
+ 2. ðÒÉÄÕÍÁÊÔÅ ÎÁÚ×ÁÎÉÅ ÄÌÑ ÆÁÊÌÁ, ËÏÔÏÒÏÅ ÅÝÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ, ÎÁÐÒÉÍÅÒ TEST.
+
+ 3. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ :w TEST (ÇÄÅ TEST --- ÜÔÏ ÉÍÑ ÆÁÊÌÁ, ÐÒÉÄÕÍÁÎÎÏÅ ÷ÁÍÉ.)
+
+ 4. üÔÁ ËÏÍÁÎÄÁ ÓÏÈÒÁÎÉÔ ×ÅÓØ ÆÁÊÌ (õÞÅÂÎÉË ÐÏ Vim) ÐÏÄ ÉÍÅÎÅÍ TEST. þÔÏÂÙ
+ ÕÄÏÓÔÏ×ÅÒÉÔØÓÑ × ÜÔÏÍ, ÓÎÏ×Á ÎÁÂÅÒÉÔÅ :!dir É ÐÒÏÓÍÏÔÒÉÔÅ ËÁÔÁÌÏÇ.
+
+---> úÁÍÅÔØÔÅ, ÞÔÏ ÅÓÌÉ ÷Ù ×ÙÊÄÅÔÅ ÉÚ Vim É ÚÁÔÅÍ ÚÁÐÕÓÔÉÔÅ ÅÇÏ ÓÎÏ×Á Ó
+ ÆÁÊÌÏÍ TEST, ÜÔÏÔ ÆÁÊÌ ÂÕÄÅÔ ÔÏÞÎÏÊ ËÏÐÉÅÊ ÕÞÅÂÎÉËÁ × ÔÏÔ ÍÏÍÅÎÔ, ËÏÇÄÁ
+ ÷Ù ÅÇÏ ÓÏÈÒÁÎÉÌÉ.
+
+ 5. ôÅÐÅÒØ ÕÄÁÌÉÔÅ ÜÔÏÔ ÆÁÊÌ, ÎÁÂÒÁ× :!del TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 5.3: ÷ùâïòïþîïå óïèòáîåîéå
+
+
+ ** äÌÑ ÓÏÈÒÁÎÅÎÉÑ ÞÁÓÔÉ ÆÁÊÌÁ, ÎÁÂÅÒÉÔÅ :#,# w éíñ_æáêìá **
+
+ 1. åÝÅ ÒÁÚ ÎÁÂÅÒÉÔÅ :!dir ÉÌÉ :!ls ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÓÐÉÓËÁ ÆÁÊÌÏ× × ÔÅËÕÝÅÍ
+ ËÁÔÁÌÏÇÅ É ×ÙÂÅÒÉÔÅ ÐÏÄÈÏÄÑÝÅÅ ÉÍÑ, ÎÁÐÒÉÍÅÒ TEST.
+
+ 2. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ Ë ÎÁÞÁÌÕ ÜÔÏÊ ÓÔÒÁÎÉÃÙ É ÎÁÖÍÉÔÅ Ctrl-g ÄÌÑ ÎÁÈÏÖÄÅÎÉÑ
+ ÎÏÍÅÒÁ ÓÔÒÏËÉto. úáðïíîéôå üôïô îïíåò!
+
+ 3. ôÅÐÅÒØ ÐÅÒÅÍÅÓÔÉÔÅÓØ × ËÏÎÅà ÓÔÒÁÎÉÃÙ É ×ÎÏ×Ø ÎÁÂÅÒÉÔÅ Ctrl-g. úáðïíîéôå
+ é üôïô îïíåò ôïöå!
+
+ 4. äÌÑ ÓÏÈÒÁÎÅÎÉÑ ôïìøëï þáóôé ÆÁÊÌÁ ÎÁÂÅÒÉÔÅ :#,# w TEST , ÇÄÅ #,# --- ÜÔÏ
+ ÎÏÍÅÒÁ, ËÏÔÏÒÙÅ ÷Ù ÚÁÐÏÍÎÉÌÉ (ÎÁÞÁÌÏ, ËÏÎÅÃ), Á TEST --- ÉÍÑ ×ÁÛÅÇÏ ÆÁÊÌÁ.
+
+ 5. ëÁË É ÐÒÅÖÄÅ, ÕÂÅÄÉÔÅÓØ × ÎÁÌÉÞÉÉ ÜÔÏÇÏ ÆÁÊÌÁ ËÏÍÁÎÄÏÊ :!dir , ÎÏ îå
+ õäáìñêôå ÅÇÏ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 5.4: þôåîéå é ïâÿåäéîåîéå æáêìï÷
+
+ ** äÌÑ ×ÓÔÁ×ËÉ ÓÏÄÅÒÖÉÍÏÇÏ ÆÁÊÌÁ, ÎÁÂÅÒÉÔÅ :r FILENAME **
+
+ 1. îÁÂÅÒÉÔÅ :!dir ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÕÂÅÄÉÔØÓÑ × ÔÏÍ, ÞÔÏ ÆÁÊÌ TEST ×ÓÅ ÅÝÅ
+ ÓÕÝÅÓÔ×ÕÅÔ.
+
+ 2. õÓÔÁÎÏ×ÉÔÅ ËÕÒÓÏÒ × ×ÅÒÈÎÅÊ ÞÁÓÔÉ ÜÔÏÊ ÓÔÒÁÎÉÃÙ.
+
+úÁÍÅÞÁÎÉÅ: ðÏÓÌÅ ×ÙÐÏÌÎÅÎÉÑ ÛÁÇÁ 3 ÷Ù Õ×ÉÄÉÔÅ õÒÏË 5.3. ðÏÓÌÅ ÜÔÏÇÏ
+ ÐÅÒÅÍÅÝÁÊÔÅÓØ ÷îéú, ÓÎÏ×Á Ë ÜÔÏÍÕ ÕÒÏËÕ.
+
+ 3. ôÅÐÅÒØ ÐÒÏÞÉÔÁÊÔÅ ÷ÁÛ ÆÁÊÌ TEST, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ :r TEST , ÇÄÅ
+ TEST --- ÜÔÏ ÉÍÑ ÆÁÊÌÁ.
+
+úÁÍÅÞÁÎÉÅ: ðÒÏÞÉÔÁÎÎÙÊ ÷ÁÍÉ ÆÁÊÌ ÂÕÄÅÔ ×ÓÔÁ×ÌÅÎ × ÔÏÍ ÍÅÓÔÅ, ÇÄÅ ÎÁÈÏÄÉÔÓÑ
+ ËÕÒÓÏÒ.
+
+ 4. þÔÏÂÙ ÕÂÅÄÉÔØÓÑ × ÔÏÍ, ÞÔÏ ÆÁÊÌ ÐÒÏÞÉÔÁÎ, ÐÅÒÅÍÅÓÔÉÔÅÓØ ÎÅÍÎÏÇÏ ÎÁÚÁÄ ÐÏ
+ ÔÅËÓÔÕ É ÚÁÍÅÔØÔÅ, ÞÔÏ ÔÅÐÅÒØ ÓÕÝÅÓÔ×ÕÀÔ Ä×Å ËÏÐÉÉ õÒÏËÁ 5.3, ÉÓÈÏÄÎÁÑ
+ É ÐÏÌÕÞÅÎÎÁÑ ÉÚ ÆÁÊÌÁ.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 5
+
+
+ 1. :!ËÏÍÁÎÄÁ ÉÓÐÏÌÎÑÅÔ ×ÎÅÛÎÀÀ ËÏÍÁÎÄÕ.
+
+ îÅËÏÔÏÒÙÅ ÐÏÌÅÚÎÙÅ ÐÒÉÍÅÒÙ:
+ :!dir --- ×Ù×ÏÄÉÔ ÓÐÉÓÏË ÆÁÊÌÏ× × ËÁÔÁÌÏÇÅ.
+ :!del FILENAME --- ÕÄÁÌÑÅÔ ÆÁÊÌ FILENAME.
+
+ 2. :w FILENAME ÚÁÐÉÓÙ×ÁÅÔ ÔÅËÕÝÉÊ ÒÅÄÁËÔÉÒÕÅÍÙÊ ÆÁÊÌ ÎÁ ÄÉÓË
+ ÐÏÄ ÉÍÅÎÅÍ FILENAME.
+
+ 3. :#,#w FILENAME ÓÏÈÒÁÎÑÅÔ ÓÔÒÏËÉ ÏÔ # ÄÏ # × ÆÁÊÌ FILENAME.
+
+ 4. :r FILENAME ÓÞÉÔÙ×ÁÅÔ Ó ÄÉÓËÁ ÆÁÊÌ FILENAME É ÐÏÍÅÝÁÅÔ ÅÇÏ × ÔÅËÕÝÉÊ
+ ÆÁÊÌ ÓÌÅÄÏÍ ÚÁ ÐÏÚÉÃÉÅÊ ËÕÒÓÏÒÁ.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 6.1: ëïíáîäá óïúäáîéñ
+
+
+ ** îÁÂÅÒÉÔÅ o ÞÔÏÂÙ ÓÏÚÄÁÔØ ÐÕÓÔÕÀ ÓÔÒÏËÕ ÐÏÄ ËÕÒÓÏÒÏÍ É ÐÅÒÅÊÔÉ × ÒÅÖÉÍ
+ ×ÓÔÁ×ËÉ (Insert mode) **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. îÁÂÅÒÉÔÅ o (× ÎÉÖÎÅÍ ÒÅÇÉÓÔÒÅ) ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÓÏÚÄÁÔØ ÐÕÓÔÕÀ ÓÔÒÏËÕ
+ îéöå ËÕÒÓÏÒÁ É ÐÅÒÅÊÔÉ × ÒÅÖÉÍ ×ÓÔÁ×ËÉ (Insert mode).
+
+ 3. ôÅÐÅÒØ ÓËÏÐÉÒÕÊÔÅ ÐÏÍÅÞÅÎÎÕÀ ---> ÓÔÒÏËÕ É ÎÁÖÍÉÔÅ <ESC> ÄÌÑ ×ÙÈÏÄÁ ÉÚ
+ ÒÅÖÉÍÁ ×ÓÔÁ×ËÉ.
+
+---> ðÏÓÌÅ ÎÁÖÁÔÉÑ o ËÕÒÓÏÒ ÐÅÒÅÊÄÅÔ ÎÁ ÎÏ×ÕÀ ÐÕÓÔÕÀ ÓÔÒÏËÕ × ÒÅÖÉÍÅ ×ÓÔÁ×ËÉ.
+
+ 4. äÌÑ ÓÏÚÄÁÎÉÑ ÓÔÒÏËÉ ÷ùûå ËÕÒÓÏÒÁ, ÐÒÏÓÔÏ ÎÁÂÅÒÉÔÅ ÚÁÇÌÁ×ÎÕÀ O, ×ÍÅÓÔÏ
+ ÓÔÒÏÞÎÏÊ o. ðÏÐÒÏÂÕÊÔÅ ÐÒÏÄÅÌÁÔØ ÜÔÏ Ó ÎÉÖÅÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÏÊ.
+óÏÚÄÁÊÔÅ ÎÏ×ÕÀ ÓÔÒÏËÕ ÎÁÄ ÜÔÏÊ, ÎÁÖÁ× Shift-O, ÐÏÍÅÓÔÉ× ËÕÒÓÏÒ ÎÁ ÜÔÕ ÓÔÒÏËÕ.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 6.2: ëïíáîäá äïâá÷ìåîéñ
+
+ ** îÁÂÅÒÉÔÅ a , ÞÔÏÂÙ ×ÓÔÁ×ÉÔØ ÔÅËÓÔ ðïóìå ËÕÒÓÏÒÁ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, × ËÏÎÅà ÐÅÒ×ÏÊ ÓÔÒÏËÉ, ÐÏÍÅÞÅÎÎÏÊ ---> ,
+ ÎÁÂÒÁ× $ × ÏÂÙÞÎÏÍ ÒÅÖÉÍÅ (Normal mode).
+
+ 2. îÁÂÅÒÉÔÅ a (× ÎÉÖÎÅÍ ÒÅÇÉÓÔÒÅ) ÄÌÑ ÄÏÂÁ×ÌÅÎÉÑ ÔÅËÓÔÁ ðïóìå ÓÉÍ×ÏÌÁ,
+ ÎÁÈÏÄÑÝÅÇÏÓÑ ÐÏÄ ËÕÒÓÏÒÏÍ. (úÁÇÌÁ×ÎÁÑ A ÐÏÚ×ÏÌÑÅÔ ÄÏÂÁ×ÉÔØ × ËÏÎÅÃ
+ ÓÔÒÏËÉ.)
+
+úÁÍÅÞÁÎÉÅ: üÔÏ ÐÏÚ×ÏÌÑÅÔ ÉÚÂÅÖÁÔØ ÎÁÖÁÔÉÑ i , ÐÏÓÌÅÄÎÅÇÏ ÓÉÍ×ÏÌÁ, ÔÅËÓÔÁ ÄÌÑ
+ ×ÓÔÁ×ËÉ, <ESC>, ËÕÒÓÏÒ-×ÐÒÁ×Ï, É, ÎÁËÏÎÅÃ, x , ÐÒÏÓÔÏ ÄÌÑ ÔÏÇÏ,
+ ÞÔÏÂÙ ÄÏÂÁ×ÉÔØ ÔÅÓÔ × ËÏÎÅà ÓÔÒÏËÉ!
+
+ 3. ôÅÐÅÒØ ÚÁ×ÅÒÛÉÔÅ ÐÅÒ×ÕÀ ÓÔÒÏËÕ. úÁÍÅÔØÔÅ ÔÁËÖÅ, ÞÔÏ ÄÏÂÁ×ÌÅÎÉÅ ÜÔÏ ×
+ ÔÏÞÎÏÓÔÉ ÔÏ ÖÅ ÓÁÍÏÅ, ÞÔÏ É ÒÅÖÉÍ ×ÓÔÁ×ËÉ, ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÐÏÚÉÃÉÉ, ×
+ ËÏÔÏÒÕÀ ÂÕÄÅÔ ×ÓÔÁ×ÌÅÎ ÔÅËÓÔ.
+
+---> üÔÁ ÓÔÒÏÞËÁ ÐÏÚ×ÏÌÉÔ ÷ÁÍ ÐÏÐÒÁËÔÉËÏ×ÁÔØÓÑ
+---> üÔÁ ÓÔÒÏÞËÁ ÐÏÚ×ÏÌÉÔ ÷ÁÍ ÐÏÐÒÁËÔÉËÏ×ÁÔØÓÑ × ÄÏÂÁ×ÌÅÎÉÉ ÔÅËÓÔÁ × ËÏÎÅÃ
+ ÓÔÒÏËÉ.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 6.3: åýå ïäéî óðïóïâ úáíåîù
+
+
+ ** îÁÂÅÒÉÔÅ ÚÁÇÌÁ×ÎÕÀ R ÄÌÑ ÚÁÍÅÎÙ ÂÏÌÅÅ, ÞÅÍ ÏÄÎÏÇÏ ÓÉÍ×ÏÌÁ. **
+
+ 1. ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÎÉÚ, Ë ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ --->.
+
+ 2. òÁÓÐÏÌÏÖÉÔÅ ËÕÒÓÏÒ × ÎÁÞÁÌÅ ÐÅÒ×ÏÇÏ ÓÌÏ×Á, ÏÔÌÉÞÁÀÝÅÇÏÓÑ ÏÔ
+ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÇÏ × ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÅ, ÐÏÍÅÞÅÎÎÏÊ ---> (ÓÌÏ×Ï 'ÐÏÓÌÅÄÎÅÊ').
+
+ 3. ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ R É ÚÁÍÅÎÉÔÅ ÏÓÔÁÔÏË ÔÅËÓÔÁ × ÐÅÒ×ÏÊ ÓÔÒÏËÅ, ÎÁÂÒÁ×
+ ÐÏ×ÅÒÈ ÓÔÁÒÏÇÏ ÔÅËÓÔÁ ÔÁË, ÞÔÏÂÙ ÏÂÅ ÓÔÒÏËÉ ÓÔÁÌÉ ÏÄÉÎÁËÏ×ÙÍÉ.
+
+---> ðÅÒ×ÕÀ ÓÔÒÏËÕ ÍÏÖÎÏ ÓÒÁ×ÎÑÔØ Ó ÐÏÓÌÅÄÎÅÊ, ÉÓÐÏÌØÚÕÑ ËÌÁ×ÉÛÉ.
+---> ðÅÒ×ÕÀ ÓÔÒÏËÕ ÍÏÖÎÏ ÓÒÁ×ÎÑÔØ Ó ×ÔÏÒÏÊ, ÉÓÐÏÌØÚÕÑ R É ÎÁÂÒÁ× ÎÏ×ÙÊ ÔÅËÓÔ.
+
+ 4. ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ, ÞÔÏ ÐÒÉ ÎÁÖÁÔÉÉ <ESC> ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ, ÌÀÂÏÊ
+ ÎÅ ÉÚÍÅÎÅÎÎÙÊ ÔÅËÓÔ ÓÏÈÒÁÎÉÔÓÑ.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 6.4: õóôáîï÷ëá ðáòáíåôòï÷
+
+
+** õÓÔÁÎÏ×ÉÍ ÐÁÒÁÍÅÔÒÙ ÔÁË, ÞÔÏÂÙ ÉÇÎÏÒÉÒÏ×ÁÔØ ÒÅÇÉÓÔÒ ÐÒÉ ÐÏÉÓËÅ ÉÌÉ ÚÁÍÅÎÅ **
+
+
+ 1. ðÏÉÝÉÔÅ ÓÌÏ×Ï 'ÉÇÎÏÒÉÒÏ×ÁÔØ', ÎÁÂÒÁ×:
+ /ÉÇÎÏÒÉÒÏ×ÁÔØ
+ ðÏ×ÔÏÒÉÔÅ ÐÏÉÓË ÎÅÓËÏÌØËÏ ÒÁÚ, ÎÁÖÉÍÁÑ ËÌÁ×ÉÛÕ n
+
+ 2. ÷ËÌÀÞÉÔÅ ÐÁÒÁÍÅÔÒ 'ic' (éÇÎÏÒÉÒÏ×ÁÔØ ÒÅÇÉÓÔÒ), ÎÁÂÒÁ×:
+ :set ic
+
+ 3. ôÅÐÅÒØ ÓÎÏ×Á ÓÄÅÌÁÊÔÅ ÐÏÉÓË ÓÌÏ×Á 'ÉÇÎÏÒÉÒÏ×ÁÔØ', ÎÁÖÁ×: n
+ ðÏ×ÔÏÒÉÔÅ ÐÏÉÓË ÎÅÓËÏÌØËÏ ÒÁÚ, ÎÁÖÉÍÁÑ ËÌÁ×ÉÛÕ n
+
+ 4. ÷ËÌÀÞÉÔÅ ÐÁÒÁÍÅÔÒÙ 'hlsearch' É 'incsearch':
+ :set hls is
+
+ 5. ôÅÐÅÒØ ÏÐÑÔØ ××ÅÄÉÔÅ ËÏÍÁÎÄÕ ÐÏÉÓËÁ É ÐÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÐÏÌÕÞÉÔÓÑ:
+ /ÉÇÎÏÒÉÒÏ×ÁÔØ
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ òåúàíå õòïëá 6
+
+
+ 1. îÁÖÁÔÉÅ o ÓÏÚÄÁÅÔ ÓÔÒÏËÕ îéöå ËÕÒÓÏÒÁ É ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÅÅ × ÒÅÖÉÍÅ
+ ×ÓÔÁ×ËÉ.
+ îÁÖÁÔÉÅ ÚÁÇÌÁ×ÎÏÊ O ÓÏÚÄÁÅÔ ÓÔÒÏËÕ ÷ùûå ÓÔÒÏËÉ, × ËÏÔÏÒÏÊ ÎÁÈÏÄÉÔÓÑ
+ ËÕÒÓÏÒ.
+
+ 2. îÁÂÅÒÉÔÅ a ÄÌÑ ×ÓÔÁ×ËÉ ÔÅËÓÔÁ ðïóìå ÓÉÍ×ÏÌÁ, ÎÁ ËÏÔÏÒÏÍ ÎÁÈÏÄÉÔÓÑ ËÕÒÓÏÒ.
+ îÁÖÁÔÉÅ ÚÁÇÌÁ×ÎÏÊ A Á×ÔÏÍÁÔÉÞÅÓËÉ ÐÅÒÅÍÅÝÁÅÔ ÷ÁÓ ÄÌÑ ÄÏÂÁ×ÌÅÎÉÑ ÔÅËÓÔÁ
+ × ËÏÎÅÃ ÓÔÒÏËÉ.
+
+ 3. îÁÖÁÔÉÅ ÚÁÇÌÁ×ÎÏÊ R ÐÅÒÅ×ÏÄÉÔ ÷ÁÓ × ÒÅÖÉÍ ÚÁÍÅÎÙ ÄÏ ÔÅÈ ÐÏÒ, ÐÏËÁ ÎÅ
+ ÂÕÄÅÔ ÎÁÖÁÔÁ ËÌÁ×ÉÛÁ <ESC> ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ.
+
+ 4. îÁÂÒÁ× ":set xxx" ×Ù ÓÍÏÖÅÔÅ ×ËÌÀÞÉÔØ ÐÁÒÁÍÅÔÒ "xxx"
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 7: ëïíáîäù ðïìõþåîéñ ÷óôòïåîîïê óðòá÷ëé
+
+ ** éÓÐÏÌØÚÕÊÔÅ ×ÓÔÒÏÅÎÎÕÀ ÓÐÒÁ×ÏÞÎÕÀ ÓÉÓÔÅÍÕ **
+
+ Vim ÏÂÌÁÄÁÅÔ ÍÏÝÎÏÊ ×ÓÔÒÏÅÎÎÏÊ ÓÐÒÁ×ÏÞÎÏÊ ÓÉÓÔÅÍÏÊ. äÌÑ ÎÁÞÁÌÁ ÐÏÐÒÏÂÕÊÔÅ
+ ÏÄÉÎ ÉÚ ÔÒÅÈ ×ÁÒÉÁÎÔÏ×:
+ - ÎÁÖÍÉÔÅ ËÌÁ×ÉÛÕ <HELP> (ÅÓÌÉ ÔÁËÏ×ÁÑ ÉÍÅÅÔÓÑ ÎÁ ËÌÁ×ÉÁÔÕÒÅ)
+ - ÎÁÖÍÉÔÅ ËÌÁ×ÉÛÕ <F1> (ÅÓÌÉ ÔÁËÏ×ÁÑ ÉÍÅÅÔÓÑ ÎÁ ËÌÁ×ÉÁÔÕÒÅ)
+ - ÎÁÂÅÒÉÔÅ :help <ENTER>
+
+ îÁÂÅÒÉÔÅ :q <ENTER> ÞÔÏÂÙ ÚÁËÒÙÔØ ÏËÎÏ ÓÐÒÁ×ËÉ.
+
+ ÷Ù ÍÏÖÅÔÅ ÎÁÊÔÉ ÓÐÒÁ×ËÕ ÄÌÑ ÌÀÂÏÇÏ ÐÏÎÑÔÉÑ ÉÌÉ ËÏÍÁÎÄÙ, ÐÒÏÓÔÏ ÚÁÄÁ×
+ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÊ ÁÒÇÕÍÅÎÔ ËÏÍÁÎÄÅ ":help". ðÏÐÒÏÂÕÊÔÅ ÓÌÅÄÕÀÝÅÅ (ÎÅ ÚÁÂÕÄØÔÅ
+ ÎÁÖÁÔØ <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ õÒÏË 8: óïúäáîéå óôáòôï÷ïçï óëòéðôá
+
+ ** ÷ËÌÀÞÉÍ ×ÏÚÍÏÖÎÏÓÔÉ Vim **
+
+ Vim ÉÍÅÅÔ ÎÁÍÎÏÇÏ ÂÏÌØÛÅ ×ÏÚÍÏÖÎÏÓÔÅÊ, ÞÅÍ Vi, ÏÄÎÁËÏ ÂÏÌØÛÉÎÓÔ×ÁÏ ÉÚ ÎÉÈ
+ ×ÙËÌÀÞÅÎÙ ÐÏ ÕÍÏÌÞÁÎÉÀ. äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÎÁÞÁÔØ ÉÓÐÏÌØÚÏ×ÁÔØ ÎÏ×ÙÅ
+ ×ÏÚÍÏÖÎÏÓÔÉ ÷ÁÍ ÓÌÅÄÕÅÔ ÓÏÚÄÁÔØ ÆÁÊÌ "vimrc".
+
+ 1. ïÔÒÅÄÁËÔÉÒÕÊÔÅ ÆÁÊÌ "vimrc", ÅÇÏ ÒÁÓÐÏÌÏÖÅÎÉÅ ÚÁ×ÉÓÉÔ ÏÔ ÉÓÐÏÌØÚÕÅÍÏÊ
+ ÓÉÓÔÅÍÙ:
+
+ :edit ~/.vimrc ÄÌÑ Unix
+ :edit $VIM/_vimrc ÄÌÑ MS-Windows
+
+ 2. ôÅÐÅÒØ ÐÒÏÞÉÔÁÊÔÅ ÐÒÉÍÅÒ ÆÁÊÌÁ "vimrc":
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. úÁÐÉÛÉÔÅ ÆÁÊÌ:
+
+ :write
+
+ ôÅÐÅÒØ ÐÒÉ ÓÌÅÄÕÀÝÅÍ ÚÁÐÕÓËÅ Vim ÂÕÄÅÔ ×ËÌÀÞÅÎÁ ÐÏÄÓ×ÅÔËÁ ÓÉÎÔÁËÓÉÓÁ. ÷ÓÅ
+ ÎÁÓÔÒÏÊËÉ, ÐÒÅÄÐÏÞÉÔÁÅÍÙÅ ÷ÁÍÉ, ÍÏÇÕÔ ÂÙÔØ ÄÏÂÁ×ÌÅÎÙ × ÆÁÊÌ "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ îÁ ÜÔÏÍ ÚÁ×ÅÒÛÁÅÔÓÑ õÞÅÂÎÉË Vim. ïÎ ÂÙÌ ÐÒÅÄÎÁÚÎÁÞÅÎ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÄÁÔØ
+ ÏÂÝÅÅ ÐÒÅÄÓÔÁ×ÌÅÎÉÅ Ï ÒÅÄÁËÔÏÒÅ Vim, ÄÏÓÔÁÔÏÞÎÏÅ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ Ó ÌÅÇËÏÓÔØÀ
+ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÇÏ. õÞÅÂÎÉË ÄÁÌÅË ÏÔ ÐÏÌÎÏÔÙ, ÐÏÓËÏÌØËÕ Vim ÉÍÅÅÔ ÏÞÅÎØ ÍÎÏÇÏ
+ ËÏÍÁÎÄ. ðÒÏÞÉÔÁÊÔÅ ÔÅÐÅÒØ ÒÕËÏ×ÏÄÓÔ×Ï ÐÏÌØÚÏ×ÁÔÅÌÑ: ":help user-manual".
+
+ äÌÑ ÄÁÌØÎÅÊÛÅÇÏ ÞÔÅÎÉÑ ÒÅËÏÍÅÎÄÕÅÔÓÑ ËÎÉÇÁ:
+ Vim - Vi Improved - á×ÔÏÒ: Steve Oualline
+ éÚÄÁÔÅÌØ: New Riders
+ üÔÁ ËÎÉÇÁ ÐÏÌÎÏÓÔØÀ ÐÏÓ×ÑÝÅÎÁ Vim. ïÓÏÂÅÎÎÏ ÐÏÌÅÚÎÁ ÎÏ×ÉÞËÁÍ. óÏÄÅÒÖÉÔ
+ ÍÎÏÖÅÓÔ×Ï ÐÒÉÍÅÒÏ× É ÉÌÌÀÓÔÒÁÃÉÊ.
+ ÷ÚÇÌÑÎÉÔÅ ÎÁ See http://iccf-holland.org/click5.html
+
+ óÌÅÄÕÀÝÁÑ ËÎÉÇÁ ÂÏÌÅÅ ÐÏÞÔÅÎÎÏÇÏ ×ÏÚÒÁÓÔÁ É ÐÏÓ×ÑÝÅÎÁ ÂÏÌØÛÅ Vi, ÞÅÍ Vim,
+ ÏÄÎÁËÏ ÔÁËÖÅ ÒÅËÏÍÅÎÄÕÅÔÓÑ:
+ Learning the Vi Editor - á×ÔÏÒ: Linda Lamb
+ éÚÄÁÔÅÌØ: O'Reilly & Associates Inc.
+ üÔÏ ÈÏÒÏÛÁÑ ËÎÉÇÁ ÄÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÕÚÎÁÔØ ×ÓÅ, ÞÔÏ ÔÏÌØËÏ ÍÏÖÎÏ ÐÒÏÄÅÌÙ×ÁÔØ Ó
+ Vi. ûÅÓÔÏÅ ÉÚÄÁÎÉÅ ÔÁËÖÅ ×ËÌÀÞÁÅÔ ÉÎÆÏÒÍÁÃÉÀ Ï Vim.
+
+ üÔÏÔ ÕÞÅÂÎÉË ÂÙÌ ÎÁÐÉÓÁÎ Michael C. Pierce É Robert K. Ware, Colorado School
+ of Mines Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÉÄÅÊ, ÐÒÅÄÌÏÖÅÎÎÙÈ Charles Smith, Colorado State
+ University. E-mail: bware@mines.colorado.edu.
+
+ äÏÒÁÂÏÔÁÎÏ ÄÌÑ Vim Bram Moolenaar.
+
+ ðÅÒÅ×ÏÄ: áÎÄÒÅÊ ëÉÓÅÌÅ× <a_kissel@eudoramail.com>, 2002.
+ Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ru.cp1251 b/runtime/tutor/tutor.ru.cp1251
new file mode 100644
index 000000000..024ca526b
--- /dev/null
+++ b/runtime/tutor/tutor.ru.cp1251
@@ -0,0 +1,834 @@
+===============================================================================
+= Ä î á ð î ï î æ à ë î â à ò ü â ó ÷ å á í è ê VIM - Âåðñèÿ 1.5 =
+===============================================================================
+ Vim --- ýòî î÷åíü ìîùíûé ðåäàêòîð, èìåþùèé ìíîæåñòâî êîìàíä, ñëèøêîì
+ ìíîãî äëÿ òîãî, ÷òîáû èõ âñå ìîæíî áûëî îïèñàòü â òàêîì ó÷åáíèêå, êàê
+ ýòîò. Ýòîò ó÷åáíèê ïðèçâàí îáúÿñíèòü äîñòàòî÷íîå ÷èñëî êîìàíä äëÿ òîãî,
+ ÷òîáû Âû ìîãëè ñ ëåãêîñòüþ èñïîëüçîâàòü Vim â êà÷åñòâå ðåäàêòîðà îáùåãî
+ íàçíà÷åíèÿ.
+
+ Âàì ïîòðåáóåòñÿ ïðèáëèçèòåëüíî 25-30 ìèíóò íà îñâîåíèå äàííîãî ó÷åáíèêà â
+ çàâèñèìîñòè îò òîãî, ñêîëüêî âðåìåíè Âû ïîòðàòèòå íà ýêñïåðèìåíòû.
+
+ Êîìàíäû â óðîêàõ áóäóò ìîäèôèöèðîâàòü òåêñò. Ñîçäàéòå êîïèþ ýòîãî ôàéëà,
+ ÷òîáû ïîïðàêòèêîâàòüñÿ íà íåé (åñëè Âû çàïóñòèëè "vimtutor", òî ýòî óæå
+ êîïèÿ).
+
+ Âàæíî ïîìíèòü, ÷òî ýòîò ó÷åáíèê ïðåäíàçíà÷åí äëÿ îáó÷åíèÿ â ïðîöåññå
+ èñïîëüçîâàíèÿ. Ýòî îçíà÷àåò, ÷òî Âû äîëæíû çàïóñêàòü êîìàíäû äëÿ òîãî,
+ ÷òîáû êàê ñëåäóåò èõ èçó÷èòü. Åñëè Âû ïðîñòî ïðî÷èòàåòå òåêñò, òî
+ çàáóäåòå êîìàíäû!
+
+ Òåïåðü óáåäèòåñü â òîì, ÷òî êëàâèøà CapsLock íå âêëþ÷åíà è íàæìèòå
+ êëàâèøó j íåñêîëüêî ðàç, òàê, ÷òîáû Óðîê 1.1 ïîëíîñòüþ ïîìåñòèëñÿ íà
+ ýêðàíå.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 1.1: ÏÅÐÅÌÅÙÅÍÈÅ ÊÓÐÑÎÐÀ
+
+** Äëÿ ïåðåìåùåíèÿ êóðñîðà íàæìèòå êëàâèøè h,j,k,l òàê, êàê ïîêàçàíî íèæå. **
+ ^
+ k Ñîâåòû: Êëàâèøà h íàõîäèòñÿ ñëåâà è ïåðåìåùàåò âëåâî.
+ < h l > Êëàâèøà l íàõîäèòñÿ ñïðàâà è ïåðåìåùàåò âïðàâî.
+ j Êëàâèøà j ïîõîæà íà ñòðåëêó `âíèç'.
+ v
+ 1. Ïîäâèãàéòå êóðñîð ïî ýêðàíó, ïîêà íå ïî÷óâñòâóåòå ñåáÿ óâåðåííî.
+
+ 2. Íàäàâèòå êëàâèøó `âíèç' (j) ïîêà îíà íå íà÷íåò ïîâòîðÿòüñÿ.
+---> Òåïåðü Âû çíàåòå, êàê ïåðåéòè ê ñëåäóþùåìó óðîêó.
+
+ 3. Èñïîëüçóÿ êëàâèøó `âíèç' ïåðåéäèòå ê Óðîêó 1.2.
+
+Çàìå÷àíèå: Åñëè âû ïîêà íå óâåðåíû â òîì, ÷òî íàáèðàåòå, íàæìèòå <ESC> äëÿ
+ ïåðåõîäà â îáû÷íûé ðåæèì (Normal mode). Ïîñëå ýòîãî ïåðåíàáåðèòå
+ òðåáóåìóþ êîìàíäó.
+
+Çàìå÷àíèå: Îáû÷íûå êëàâèøè óïðàâëåíèÿ êóðñîðîì (ñòðåëêè) òàêæå äîëæíû
+ ðàáîòàòü. Îäíàêî, êëàâèøè hjkl ïîçâîëÿò Âàì ïåðåìåùàòüñÿ
+ çíà÷èòåëüíî áûñòðåå, êàê òîëüêî Âû íàó÷èòåñü èìè ïîëüçîâàòüñÿ.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 1.2: ÇÀÏÓÑÊ È ÇÀÂÅÐØÅÍÈÅ ÐÀÁÎÒÛ Ñ VIM
+
+!! ÂÍÈÌÀÍÈÅ! Ïðåæäå, ÷åì âûïîëíÿòü ëþáîé èç îïèñàííûõ íèæå øàãîâ, ïðî÷òèòå
+ óðîê öåëèêîì !!
+
+ 1. Íàæìèòå êëàâèøó <ESC> (äëÿ òîãî, ÷òîáû óäîñòîâåðèòüñÿ, ÷òî Âû â îáû÷íîì
+ ðåæèìå (Normal mode)).
+
+ 2. Íàáåðèòå: :q! <ENTER>.
+
+---> Ýòî ïîçâîëèò Âàì âûéòè èç ðåäàêòîðà ÁÅÇ ÑÎÕÐÀÍÅÍÈß ëþáûõ ñäåëàííûõ
+ èçìåíåíèé. Åñëè Âû õîòèòå ñîõðàíèòü èçìåíåíèÿ è âûéòè:
+ :wq <ENTER>
+
+ 3. Êîãäà Âû óâèäèòå ïðèãëàøåíèå êîìàíäíîé îáîëî÷êè, íàáåðèòå êîìàíäó,
+ êîòîðàÿ ïðèâåëà Âàñ â ýòîò ó÷åáíèê. Ýòî ìîæåò áûòü
+ vimtutor ru <ENTER>
+ Îáû÷íî ìîæíî èñïîëüçîâàòü: vim tutor.ru <ENTER>
+
+---> 'vim' ïîçâîëÿåò çàïóñòèòü ðåäàêòîð vim, 'tutor.ru' --- ýòî ôàéë, êîòîðûé
+ Âû áóäåòå ðåäàêòèðîâàòü.
+
+ 4. Åñëè Âû óâåðåíû â òîì, ÷òî çàïîìíèëè ýòè øàãè, âûïîëíèòå øàãè îò 1 äî 3
+ ÷òîáû âûéòè ñíîâà çàïóñòèòü ðåäàêòîð. Çàòåì ïåðåìåñòèòå êóðñîð âíèç ê
+ Óðîêó 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 1.3: ÐÅÄÀÊÒÈÐÎÂÀÍÈÅ ÒÅÊÑÒÀ - ÓÄÀËÅÍÈÅ
+
+
+** Íàõîäÿñü â îáû÷íîì ðåæèìå íàæìèòå x, ÷òîáû óäàëèòü ñèìâîë ïîä êóðñîðîì. **
+
+ 1. Ïåðåìåñòèòå êóðñîð ê ñòðîêå âíèçó, ïîìå÷åííîé --->.
+
+ 2. Äëÿ èñïðàâëåíèÿ îøèáîê, ïåðåìåñòèòå êóðñîð, ïîêà îí íå îêàæåòñÿ íàä
+ óäàëÿåìûì ñèìâîëîì.
+
+ 3. Íàæìèòå êëàâèøó x äëÿ óäàëåíèÿ òðåáóåìîãî ñèìâîëà.
+
+ 4. Ïîâòîðèòå øàãè 2--4 ïîêà ñòðîêà íå áóäåò èñïðàâëåíà.
+
+---> Îò òòòîïîòà êîïûòò ïïïûëü ïïî ïïïîëþ ëåòòèòò.
+
+ 5. Òåïåðü, êîãäà ñòðîêà îòêîððåêòèðîâàíà, ïåðåõîäèòå ê óðîêó 1.4.
+
+ÇÀÌÅ×ÀÍÈÅ:  õîäå îñâîåíèÿ ýòîãî ó÷åáíèêà íå ïûòàéòåñü çàïîìèíàòü, ó÷èòå
+ â ïðîöåññå èñïîëüçîâàíèÿ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 1.4: ÐÅÄÀÊÒÈÐÎÂÀÍÈÅ ÒÅÊÑÒÀ - ÂÑÒÀÂÊÀ
+
+
+ ** Íàõîäÿñü â îáû÷íîì ðåæèìå (Normal mode), íàæìèòå i äëÿ âñòàâêè òåêñòà. **
+
+ 1. Ïåðåìåñòèòå êóðñîð ê ïåðâîé ñòðîêå âíèçó, ïîìå÷åííîé --->.
+
+ 2. Äëÿ òîãî, ÷òîáû ñäåëàòü ïåðâóþ ñòðîêó èäåíòè÷íîé âòîðîé, ïîìåñòèòå
+ êóðñîð íà ñèìâîë ÏÅÐÅÄ êîòîðûì ñëåäóåò âñòàâèòü òåêñò.
+
+ 3. Íàæìèòå i è íàáåðèòå òðåáóåìûå äîáàâëåíèÿ.
+
+ 4. Ïîñëå èñïðàâëåíèÿ âñåõ îøèáîê íàæìèòå <ESC> äëÿ âîçâðàòà â îáû÷íûé ðåæèì.
+ Ïîâòîðèòå øàãè 2--4, ïîêà ôðàçà íå áóäåò èñïðàâëåíà ïîëíîñòüþ.
+
+---> ×àñòü òåêñòà â ñòðîêå áåñëåäíî .
+---> ×àñòü òåêñòà â ýòîé ñòðîêå áåññëåäíî ïðîïàëà.
+
+ 5. Êîãäà îñâîèòå âñòàâêó òåêñòà, ïåðåõîäèòå äàëüøå ê Ðåçþìå.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 1
+
+ 1. Êóðñîð ïåðåìåùàåòñÿ ëèáî êëàâèøàìè ñî ñòðåëêàìè, ëèáî êëàâèøàìè hjkl.
+ h (âëåâî) j (âíèç) k (ââåðõ) l (âïðàâî)
+
+ 2. Äëÿ çàïóñêà Vim (èç ïðèãëàøåíèÿ % êîìàíäíîé îáîëî÷êè) íàáåðèòå:
+ vim ÈÌß_ÔÀÉËÀ <ENTER>
+
+ 3. Äëÿ çàâåðøåíèÿ ðàáîòû ñ Vim íàáåðèòå:
+ <ESC> :q! <ENTER> ÷òîáû îòêàçàòüñÿ îò ñîõðàíåíèÿ èçìåíåíèé.
+ Èëè íàáåðèòå:
+ <ESC> :wq <ENTER> ÷òîáû ñîõðàíèòü èçìåíåíèÿ.
+
+ 4. Äëÿ óäàëåíèÿ ñèìâîëà ïîä êóðñîðîì â îáû÷íîì ðåæèìå, íàáåðèòå: x
+
+ 5. ×òîáû âñòàâèòü òåêñò ïåðåä êóðñîðîì â îáû÷íîì ðåæèìå, íàáåðèòå:
+ i ââîäèòå òåêñò <ESC>
+
+ÇÀÌÅ×ÀÍÈÅ: Íàæàòèå <ESC> ïåðåìåñòèò Âàñ â îáû÷íûé ðåæèì (Normal mode) ëèáî
+ ïðåðâåò íåæåëàòåëüíóþ è ÷àñòè÷íî çàâåðøåííóþ êîìàíäó.
+
+Òåïåðü ïåðåõîäèì ê Óðîêó 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 2.1: ÊÎÌÀÍÄÛ ÓÄÀËÅÍÈß
+
+
+ ** Íàáåðèòå dw äëÿ óäàëåíèÿ ó÷àñòêà òåêñòà äî êîíöà ñëîâà. **
+
+ 1. Íàæìèòå <ESC>, ÷òîáû ïåðåéòè â îáû÷íûé ðåæèì.
+
+ 2. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 3. Ïåðåìåñòèòå êóðñîð â íà÷àëî ñëîâà, êîòîðîå ñëåäóåò óäàëèòü.
+
+ 4. Íàáåðèòå dw , ÷òîáû óäàëèòü ýòî ñëîâî.
+
+ÇÀÌÅ×ÀÍÈÅ: Âî âðåìÿ íàáîðà áóêâû dw ïîÿâÿòñÿ â ïîñëåäíåé ñòðîêå ýêðàíà. Åñëè
+ Âû ÷òî-òî íàáåðåòå íåïðàâèëüíî, íàæìèòå <ESC> è íà÷íèòå ñíà÷àëà.
+
+---> Íåñêîëüêî ñëîâ ðàôèíàä â ýòîì ïðåäëîæåíèè àâòîêðàí èçëèøíè.
+
+ 5. Ïîâòîðèòå øàãè 3 è 4, ïîêà íå èñïðàâèòå âñå îøèáêè è ïåðåõîäèòå ê
+ Óðîêó 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 2.2: ÄÎÏÎËÍÈÒÅËÜÍÛÅ ÊÎÌÀÍÄÛ ÓÄÀËÅÍÈß
+
+
+ ** Íàáåðèòå d$ äëÿ óäàëåíèÿ òåêñòà äî êîíöà ñòðîêè. **
+
+ 1. Íàæìèòå <ESC>, ÷òîáû ïåðåéòè â îáû÷íûé ðåæèì.
+
+ 2. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 3. Ïåðåìåñòèòå êóðñîð ê êîíöó ïðàâèëüíîé ñòðîêè (ÏÎÑËÅ ïåðâîé . ).
+
+ 4. ×òîáû óäàëèòü îñòàòîê ñòðîêè, íàáåðèòå d$ .
+
+---> Êòî-òî íàáðàë îêîí÷àíèå ýòîé ñòðîêè äâàæäû. îêîí÷àíèå ýòîé ñòðîêè äâàæäû.
+
+
+ 5.×òîáû ëó÷øå ðàçîáðàòüñÿ â ýòîì, ïåðåõîäèòå ê Óðîêó 2.3.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 2.3: ÊÎÌÀÍÄÛ È ÎÁÚÅÊÒÛ
+
+
+ Ôîðìàò êîìàíäû `óäàëåíèå' d òàêîâ:
+
+ [÷èñëî] d îáúåêò ÈËÈ d [÷èñëî] îáúåêò
+ Çäåñü:
+ ÷èñëî - ñêîëüêî ðàç èñïîëíèòü êîìàíäó (íåîáÿçàòåëüíî, ïî óìîë÷àíèþ=1).
+ d - êîìàíäà óäàëåíèÿ.
+ îáúåêò - ñ ÷åì êîìàíäà äîëæíà áûòü âûïîëíåíà (ïåðå÷èñëåíî íèæå).
+
+ Êðàòêèé ñïèñîê îáúåêòîâ:
+ w - îò êóðñîðà äî êîíöà ñëîâà, âêëþ÷àÿ çàâåðøàþùèé ïðîáåë.
+ e - îò êóðñîðà äî êîíöà ñëîâà, ÍÅ âêëþ÷àÿ çàâåðøàþùèé ïðîáåë.
+ $ - îò êóðñîðà äî êîíöà ñòðîêè.
+ ^ - îò êóðñîðà äî íà÷àëà ñòðîêè.
+
+ÇÀÌÅ×ÀÍÈÅ: Ïðîñòîå íàæàòèå íà ñèìâîë îáúåêòà â îáû÷íîì ðåæèìå (Normal mode)
+ áåç äîïîëíèòåëüíûõ êîìàíä ïåðåäâèíåò êóðñîð òàê, êàê óêàçàíî â
+ ñïèñêå îáúåêòîâ.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 2.4: ÈÑÊËÞ×ÅÍÈÅ ÈÇ ÏÐÀÂÈËÀ `ÊÎÌÀÍÄÀ-ÎÁÚÅÊÒ'
+
+
+ ** Íàáåðèòå dd äëÿ óäàëåíèÿ âñåé ñòðîêè. **
+
+ Âñëåäñòâèå ÷àñòîãî ïðèìåíåíèÿ îïåðàöèè óäàëåíèÿ âñåé ñòðîêè, ðàçðàáîò÷èêè
+ Vim ðåøèëè, ÷òî äëÿ ýòîãî ïðîùå âñåãî ïðîñòî íàáðàòü d äâàæäû.
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, êî âòîðîé ñòðîêå ôðàçû.
+ 2. Íàáåðèòå dd äëÿ óäàëåíèÿ ñòðîêè.
+ 3. Òåïåðü ïåðåìåñòèòåñü ê ÷åòâåðòîé ñòðîêå.
+ 4. Íàáåðèòå 2dd (âñïîìíèòå ïðàâèëî `÷èñëî-êîìàíäà-îáúåêò'), ÷òîáû óäàëèòü
+ äâå ñòðîêè.
+
+ 1) Ëåòîì ÿ õîæó íà ñòàäèîí,
+ 2) Î, êàê âíåçàïíî êîí÷èëñÿ äèâàí!
+ 3) ß áîëåþ çà ``Çåíèò'', ``Çåíèò'' --- ÷åìïèîí!
+ 4) Ïå÷àëüíî ÿ ãëÿæó íà íàøå ïîêîëåíèå!
+ 5) Åãî ãðÿäóùåå èëü ïóñòî èëü òåìíî...
+ 6) ß ñèæó íà ñêàìåéêå â ëîæå `Á'
+ 7) È èãðàþ íà áîëüøîé æåñòÿíîé òðóáå.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 2.5: ÊÎÌÀÍÄÀ `ÎÒÊÀÒ'
+
+
+ ** Íàæìèòå u äëÿ îòìåíû ðåçóëüòàòà ðàáîòû ïðåäûäóùåé êîìàíäû, U äëÿ îòìåíû
+ èñïðàâëåíèé âî âñåé ñòðîêå. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé ---> è óñòàíîâèòå åãî íà
+ ïåðâóþ îøèáêó.
+ 2. Íàæìèòå x äëÿ óäàëåíèÿ ïåðâîãî íåïðàâèëüíîãî ñèìâîëà.
+ 3. Òåïåðü íàæìèòå u äëÿ îòìåíû (îòêàòà) ïîñëåäíåé âûïîëíåííîé êîìàíäû.
+ 4. Èñïðàâüòå âñå îøèáêè â ñòðîêå, èñïîëüçóÿ êîìàíäó x .
+ 5. Òåïåðü íàæìèòå çàãëàâíóþ U äëÿ òîãî, ÷òîáû âåðíóòü âñþ ñòðîêó â èñõîäíîå
+ ñîñòîÿíèå.
+ 6. Íàæìèòå u íåñêîëüêî ðàç äëÿ îòìåíû êîìàíäû U è ïðåäûäóùèõ êîìàíä.
+ 7. Íàæìèòå òåïåðü CTRL-R (óäåðæèâàéòå êëàâèøó CTRL íàæàòîé â ìîìåíò íàæàòèÿ
+ R) íåñêîëüêî ðàç äëÿ âîçâðàòà êîìàíä (îòêàò îòêàòà).
+
+---> Èñïððàâüòå îîøèáêè â ýòîéé ñòðîêå è âåðíèòòå èõ ññ ïîìîùüüþ `îòêàòà'.
+
+ 8. Ýòî áûëè î÷åíü ïîëåçíûå êîìàíäû. Äàëåå ïåðåõîäèòå ê Ðåçþìå Óðîêà 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 2
+
+
+ 1. Äëÿ óäàëåíèÿ òåêñòà îò êóðñîðà äî êîíöà ñëîâà íàáåðèòå: dw
+
+ 2. Äëÿ óäàëåíèÿ òåêñòà îò êóðñîðà äî êîíöà ñòðîêè íàáåðèòå: d$
+
+ 3. Äëÿ óäàëåíèÿ âñåé ñòðîêè íàáåðèòå: dd
+
+ 4. Ôîðìàò êîìàíäû â îáû÷íîì ðåæèìå èìååò âèä:
+
+ [÷èñëî] êîìàíäà îáúåêò ÈËÈ êîìàíäà [÷èñëî] îáúåêò
+ ãäå:
+ ÷èñëî - ñêîëüêî ðàç ïîâòîðèòü âûïîëíåíèå êîìàíäû
+ êîìàíäà - ÷òî âûïîëíèòü, íàïðèìåð d äëÿ óäàëåíèÿ
+ îáúåêò - íà ÷òî äîëæíà âîçäåéñòâîâàòü êîìàíäà, íàïðèìåð w (ñëîâî),
+ $ (äî êîíöà ñòðîêè), è ò.ä.
+
+ 5. Äëÿ îòìåíû (îòêàòà) ïðåäøåñòâóþùèõ äåéñòâèé íàáåðèòå: u (ñòðî÷íàÿ u)
+ Äëÿ îòìåíû (îòêàòà) âñåõ èçìåíåíèé â ñòðîêå íàáåðèòå: U (ïðîïèñíàÿ U)
+ Äëÿ îòìåíû îòêàòà íàáåðèòå: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 3.1: ÊÎÌÀÍÄÀ ÂÑÒÀÂÊÈ
+
+
+ ** Íàáåðèòå p äëÿ âñòàâêè ïîñëåäíåãî óäàëåííîãî òåêñòà ïîñëå êóðñîðà. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç ê ïîñëåäíåé ñòðîêå èç íàáîðà.
+
+ 2. Íàáåðèòå dd äëÿ óäàëåíèÿ ñòðîêè è åå ñîõðàíåíèÿ â áóôåðå Vim'à.
+
+ 3. Ïåðåìåñòèòå êóðñîð ê ñòðîêå ÍÀÄ òåì ìåñòîì, êóäà ñëåäóåò âñòàâèòü
+ óäàëåííóþ ñòðîêó.
+
+ 4. Íàõîäÿñü â îáû÷íîì ðåæèìå íàáåðèòå p äëÿ çàìåíû ñòðîêè.
+
+ 5. Ïîâòîðèòå øàãè 2--4, ïîêà íå ðàññòàâèòå âñå ñòðîêè â íóæíîì ïîðÿäêå.
+
+ ã) È ëó÷øå âûäóìàòü íå ìîã.
+ á) Êîãäà íå â øóòêó çàíåìîã,
+ â) Îí óâàæàòü ñåáÿ çàñòàâèë
+ à) Ìîé äÿäÿ ñàìûõ ÷åñòíûõ ïðàâèë
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 3.2: ÊÎÌÀÍÄÀ ÇÀÌÅÍÛ
+
+
+ ** Íàáåðèòå r è ñèìâîë, çàìåíÿþùèé ñèìâîë ïîä êóðñîðîì. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 2. Óñòàíîâèòå êóðñîð òàê, ÷òîáû îí íàõîäèëñÿ íàä ïåðâîé îøèáêîé.
+
+ 3. Íàáåðèòå r è çàòåì ñèìâîë, èñïðàâëÿþùèé îøèáêó.
+
+ 4. Ïîâòîðèòå øàãè 2 è 3, ïîêà ïåðâàÿ ñòðîêà íå áóäåò èñïðàâëåíà.
+
+---> Â ìîìåãò íàáòðà ýòîé ÷òðîêè êîå0êòî ñ òðóäîì ïîïâäàë ïî êëâàèøàì!
+---> Â ìîìåíò íàáîðà ýòîé ñòðîêè êîå-êòî ñ òðóäîì ïîïàäàë ïî êëàâèøàì!
+
+ 5. Òåïåðü ïåðåõîäèòå ê Óðîêó 3.2.
+
+ÇÀÌÅ×ÀÍÈÅ: Ïîìíèòå, ÷òî âû äîëæíû ó÷èòüñÿ â ïðîöåññå ðàáîòû, à íå ïðîñòî
+ çàïîìèíàÿ.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 3.3: ÊÎÌÀÍÄÀ ÈÇÌÅÍÅÍÈß
+
+
+ ** Äëÿ èçìåíåíèÿ ÷àñòè ñëîâà íàáåðèòå cw . **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 2. Ðàñïîëîæèòå êóðñîð íàä áóêâîé `o' â ñëîâå `ñîëà'.
+
+ 3. Íàáåðèòå cw è èñïðàâüòå ñëîâî (â äàííîì ñëó÷àå, íàáåðèòå `ëîâ'.)
+
+ 4. Íàæìèòå <ESC> è ïåðåõîäèòå ê ñëåäóþùåé îøèáêå (ê ïåðâîìó ñèìâîëó, êîòîðûé
+ íàäî èçìåíèòü.)
+
+ 5. Ïîâòîðèòå øàãè 3--4 ïîêà ïåðâîå ïðåäëîæåíèå íå ñòàíåò èäåíòè÷íûì âòîðîìó.
+
+---> Íåñêîëüêî ñîëà â ýüãö ñòðîêå òïãøöáü ðåäàëçêóþèåñâõ.
+---> Íåñêîëüêî ñëîâ â ýòîé ñòðîêå òðåáóþò ðåäàêòèðîâàíèÿ.
+
+Îáðàòèòå âíèìàíèå, ÷òî cw íå òîëüêî çàìåíÿåò ñëîâî, íî è ïåðåâîäèò âàñ â ðåæèì
+âñòàâêè.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 3.4: ÏÐÎÄÎËÆÀÅÌ ÈÇÌÅÍßÒÜ Ñ ÊÎÌÀÍÄÎÉ c
+
+
+** Êîìàíäà çàìåíû èñïîëüçóåòñÿ ñ òåìè æå îáúåêòàìè, ÷òî è êîìàíäà óäàëåíèÿ. **
+
+ 1. Êîìàíäà èçìåíåíèÿ ïðèìåíÿåòñÿ òàêèì æå îáðàçîì, êàê è êîìàíäà óäàëåíèÿ.
+ Åå ôîðìàò òàêîâ:
+
+ [÷èñëî] c îáúåêò ÈËÈ c [÷èñëî] îáúåêò
+
+ 2. Îáúåêòû òàêæå ñîâïàäàþò: w (ñëîâî), $ (êîíåö ñòðîêè) è ò.ï.
+
+ 3. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 4. Ïåðåéäèòå ê ïåðâîé îøèáêå.
+
+ 5. Íàáåðèòå c$ è îòðåäàêòèðóéòå ïåðâóþ ñòðîêó òàê, ÷òîáû îíà ñîâïàäàëà ñî
+ âòîðîé, ïîñëå ÷åãî íàæìèòå <ESC>.
+
+---> Êîíåö ýòîé ñòðîêè íóæäàåòñÿ â ïîìîùè, ÷òîáû ñòàòü ïîõîæèì íà âòîðîé.
+---> Êîíåö ýòîé ñòðîêè íóæäàåòñÿ â ïîìîùè êîìàíäû c$ .
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 3
+
+
+ 1. Äëÿ âñòàâêè òåêñòà, êîòîðûé òîëüêî ÷òî áûë óäàëåí, íàáåðèòå p . Ýòà
+ êîìàíäà âñòàâèò óäàëåííûé òåêñò ÏÎÑËÅ êóðñîðà (åñëè áûëà óäàëåíà ñòðîêà,
+ òî îíà áóäåò ïîìåùåíà â ñòðîêå ïîä êóðñîðîì).
+
+ 2. Äëÿ çàìåíû ñèìâîëà ïîä êóðñîðîì íàáåðèòå r è çàòåì çàìåíÿþùèé ñèìâîë.
+
+ 3. Êîìàíäà èçìåíåíèÿ ïîçâîëÿåò Âàì èçìåíèòü óêàçàííûé îáúåêò îò êóðñîðà äî
+ êîíöà ýòîãî îáúåêòà. Íàïðèìåð, íàáåðèòå cw äëÿ çàìåíû îò êóðñîðà äî
+ êîíöà ñëîâà, c$ äëÿ èçìåíåíèÿ äî êîíöà ñòðîêè.
+
+ 4. Ôîðìàò êîìàíäû èçìåíåíèÿ òàêîâ:
+
+ [÷èñëî] c îáúåêò ÈËÈ c [÷èñëî] îáúåêò
+
+Òåïåðü îòïðàâëÿéòåñü ê ñëåäóþùåìó óðîêó.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 4.1: ÈÍÔÎÐÌÀÖÈß Î ÔÀÉËÅ È ÐÀÑÏÎËÎÆÅÍÈÅ Â ÍÅÌ
+
+
+ ** Íàáåðèòå CTRL-g ÷òîáû óâèäåòü Âàøå ìåñòîðàñïîëîæåíèå â ôàéëå è èíôîðìàöèþ
+ î íåì.
+ Íàáåðèòå SHIFT-G äëÿ ïåðåìåùåíèÿ ê çàäàííîé ñòðîêå â ôàéëå. **
+
+ Çàìå÷àíèå: Ïðî÷èòàéòå âåñü óðîê ïðåæäå ÷åì âûïîëíÿòü ëþáûå êîìàíäû!!
+
+ 1. Óäåðæèâàÿ êëàâèøó Ctrl íàæìèòå g . Âíèçó ýêðàíà ïîÿâèòñÿ ñòðîêà ñòàòóñà ñ
+ èìåíåì ôàéëà è íîìåðîì ñòðîêè, â êîòîðîé Âû íàõîäèòåñü. Çàïîìíèòå íîìåð
+ ñòðîêè, îí ïîòðåáóåòñÿ íà Øàãå 3.
+
+ 2. Íàæìèòå shift-G äëÿ ïåðåìåùåíèÿ ê êîíöó ôàéëà.
+
+ 3. Íàáåðèòå íîìåð ñòðîêè, â êîòîðîé âû íàõîäèëèñü è çàòåì shift-G. Ýòî
+ âåðíåò Âàñ ê ñòðîêå, â êîòîðîé Âû áûëè, êîãäà â ïåðâûé ðàç íàæàëè Ctrl-g.
+ (Êîãäà Âû áóäåòå íàáèðàòü öèôðû, îíè ÍÅ îòîáðàçÿòñÿ íà ýêðàíå.)
+
+ 4. Åñëè Âû çàïîìíèëè âñå âûøåñêàçàííîå, âûïîëíèòå øàãè 1--3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 4.2: ÊÎÌÀÍÄÀ ÏÎÈÑÊÀ
+
+ ** Íàáåðèòå / è çàòåì ââåäèòå èñêîìóþ ôðàçó. **
+
+ 1.  îáû÷íîì ðåæèìå (Normal mode) íàáåðèòå ñèìâîë / . Îáðàòèòå âíèìàíèå,
+ ÷òî îí âìåñòå ñ êóðñîðîì ïîÿâèòñÿ âíèçó ýêðàíà, êàê ýòî ïðîèñõîäèò ñ
+ êîìàíäîé : .
+
+ 2. Òåïåðü íàáåðèòå 'îøøøèáêà' <ENTER>. Ýòî òî ñëîâî, êîòîðîå Âû áóäåòå
+ èñêàòü.
+
+ 3. Äëÿ òîãî, ÷òîáû ïîâòîðèòü ïîèñê, ïðîñòî íàæìèòå n .
+ Äëÿ ïîèñêà ýòîé ôðàçû â îáðàòíîì íàïðàâëåíèè, íàæìèòå Shift-N .
+
+ 4. Åñëè Âû æåëàåòå ñðàçó èñêàòü â îáðàòíîì íàïðàâëåíèè, èñïîëüçóéòå
+ êîìàíäó ? âìåñòî / .
+
+---> Êîãäà Âû ïðè ïîèñêå äîñòèãíåòå êîíöà ôàéëà, ïîèñê áóäåò ïðîäîëæåí ñ
+ íà÷àëà.
+
+ "îøøøèáêà" ýòî íå ñïîñîá ïðîèçíåñåíèÿ ñëîâà `îøèáêà'; îøøøèáêà ýòî îøèáêà.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 4.3: ÏÎÈÑÊ ÏÀÐÍÛÕ ÑÊÎÁÎÊ
+
+
+ ** Íàáåðèòå % äëÿ ïîèñêà ïàðíûõ ),] èëè } . **
+
+ 1. Ïîìåñòèòå êóðñîð íàä ëþáîé èç (, [ èëè { â ñòðîêå âíèçó, ïîìå÷åííîé --->.
+
+ 2. Òåïåðü íàáåðèòå ñèìâîë % .
+
+ 3. Êóðñîð äîëæåí ïåðåñêî÷èòü íà ïàðíóþ ñêîáêó.
+
+ 4. Íàáåðèòå % äëÿ âîçâðàòà êóðñîðà íàçàä ê ïåðâîé ñêîáêå.
+
+---> Ýòî ( ñòðîêà, ñîäåðæàùàÿ òàêèå (, òàêèå [ ] è òàêèå { } ñêîáêè. ))
+
+Çàìå÷àíèå: Ýòî î÷åíü óäîáíî ïðè îòëàäêå ïðîãðàìì ñ ïðîïóùåííûìè ñêîáêàìè!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 4.4: ÑÏÎÑÎÁ ÈÑÏÐÀÂËÅÍÈß ÎØÈÁÎÊ
+
+
+ ** Íàáåðèòå :s/áûëî/ñòàëî/g äëÿ çàìåíû 'áûëî' íà 'ñòàëî'. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 2. Íàáåðèòå :s/óâîäþ/óâîæó <ENTER> . Îáðàòèòå âíèìàíèå íà òî, ÷òî ýòà êîìàíäà
+ çàìåíèò òîëüêî ïåðâîå íàéäåííîå âõîæäåíèå â ñòðîêå.
+
+ 3. Òåïåðü íàáåðèòå :s/óâîäþ/óâîæó/g , îçíà÷àþùåå ïîäñòàíîâêó ãëîáàëüíî âî
+ âñåé ñòðîêå. Ýòî çàìåíèò âñå íàéäåííûå â ñòðîêå âõîæäåíèÿ.
+
+---> ß óâîäþ ê îòâåðæåííûì ñåëåíüÿì, ÿ óâîäþ ñêâîçü âåêîâå÷íûé ñòîí, ÿ óâîäþ ê
+ çàáûòûì ïîêîëåíüÿì.
+
+ 4. Äëÿ çàìåíû âñåõ âõîæäåíèé ïîñëåäîâàòåëüíîñòè ñèìâîëîâ ìåæäó äâóìÿ
+ ñòðîêàìè,
+ íàáåðèòå :#,#s/áûëî/ñòàëî/g ãäå #,# --- íîìåðà ýòèõ ñòðîê.
+ Íàáåðèòå :%s/áûëî/ñòàëî/g äëÿ çàìåíû âñåõ âõîæäåíèé âî âñåì ôàéëå.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 4
+ 1. Ctrl-g ïîêàçûâàåò âàøå ïîëîæåíèå â ôàéëå è èíôîðìàöèþ î íåì.
+ Shift-G ïåðåìåùàåò Âàñ â êîíåö ôàéëà. Íîìåð, çà êîòîðûì ñëåäóåò Shift-G
+ ïîçâîëÿåò ïåðåéòè ê ñòðîêå ñ ýòèì íîìåðîì.
+
+ 2. Íàæàòèå / è çàòåì ââîä ñòðîêè ïîçâîëÿåò ïðîèçâåñòè ïîèñê ýòîé ñòðîêè
+ ÂÏÅÐÅÄ ïî òåêñòó.
+ Íàæàòèå ? è çàòåì ââîä ñòðîêè ïîçâîëÿåò ïðîèçâåñòè ïîèñê ýòîé ñòðîêè
+ ÍÀÇÀÄ ïî òåêñòó.
+ Ïîñëå ïîèñêà íàáåðèòå n äëÿ ïåðåõîäà ê ñëåäóþùåìó âõîæäåíèþ èñêîìîé
+ ñòðîêè â òîì æå íàïðàâëåíèè èëè Shift-N äëÿ ïåðåõîäà â ïðîòèâîïîëîæíîì
+ íàïðàâëåíèè.
+
+ 3. Íàæàòèå % , êîãäà êóðñîð íàõîäèòñÿ íà (,),[,],{, èëè } ïîçâîëÿåò íàéòè
+ ïàðíóþ ñêîáêó.
+
+ 4. Äëÿ ïîäñòàíîâêè `ñòàëî' âìåñòî ïåðâîãî `áûëî' â ñòðîêå, íàáåðèòå
+ :s/old/new
+ Äëÿ ïîäñòàíîâêè `ñòàëî' âìåñòî âñåõ `áûëî' â ñòðîêå, íàáåðèòå
+ :s/old/new/g
+ Äëÿ çàìåíû â èíòåðâàëå ìåæäó äâóìÿ ñòðîêàìè, íàáåðèòå
+ :#,#s/old/new/g
+ Äëÿ çàìåíû âñåõ âõîæäåíèé `áûëî' íà `ñòàëî' â ôàéëå, íàáåðèòå
+ :%s/old/new/g
+ ×òîáû ðåäàêòîð êàæäûé ðàç çàïðàøèâàë ïîäòâåðæäåíèå, äîáàâüòå 'c'
+ :%s/old/new/gc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 5.1: ÊÀÊ ÂÛÏÎËÍÈÒÜ ÂÍÅØÍÞÞ ÊÎÌÀÍÄÓ
+
+
+ ** Íàáåðèòå :! è çàòåì âíåøíþþ êîìàíäó, êîòîðóþ ñëåäóåò âûïîëíèòü. **
+
+ 1. Íàáåðèòå óæå çíàêîìóþ Âàì êîìàíäó : äëÿ óñòàíîâêè êóðñîðà â êîìàíäíóþ
+ ñòðîêó ðåäàêòîðà. Ýòî ïîçâîëèò Âàì ââåñòè êîìàíäó.
+
+ 2. Òåïåðü íàáåðèòå ñèìâîë ! (âîñêëèöàòåëüíûé çíàê). Òåïåðü ìîæíî èñïîëíèòü
+ âíåøíþþ êîìàíäó, èñïîëüçóÿ êîìàíäíóþ îáîëî÷êó.
+
+ 3. Äëÿ ïðèìåðà íàáåðèòå ls ïîñëå ! è íàæìèòå <ENTER>. Ýòà êîìàíäà âûâåäåò
+ ñïèñîê ôàéëîâ â òåêóùåì êàòàëîãå, òî÷íî òàêæå, êàê åñëè áû Âû ââåëè ýòó
+ êîìàíäó â ïðèãëàøåíèè îáîëî÷êè. Èëè ïîïðîáóéòå :!dir , åñëè ïðåäûäóùàÿ
+ êîìàíäà íå ñðàáîòàëà.
+
+---> Çàìå÷àíèå: Òàêèì ñïîñîáîì ìîæíî âûïîëíèòü ëþáóþ âíåøíþþ êîìàíäó.
+
+---> Çàìå÷àíèå: Âñå êîìàíäû, íà÷èíàþùèåñÿ ñ : , äîëæíû çàâåðøàòüñÿ íàæàòèåì
+ <ENTER>.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 5.2: ÊÀÊ ÇÀÏÈÑÀÒÜ ÔÀÉË
+
+
+** Äëÿ ñîõðàíåíèÿ èçìåíåíèé, ïðîèçâåäåííûõ â ôàéëå, íàáåðèòå :w ÈÌß_ÔÀÉËÀ. **
+
+ 1. Íàáåðèòå :!dir èëè :!ls äëÿ ïîëó÷åíèÿ ñïèñêà ôàéëîâ â òåêóùåì êàòàëîãå.
+ Êàê Âàì óæå èçâåñòíî, Âû äîëæíû íàæàòü <ENTER> ïîñëå ââîäà ýòèõ êîìàíä.
+
+ 2. Ïðèäóìàéòå íàçâàíèå äëÿ ôàéëà, êîòîðîå åùå íå ñóùåñòâóåò, íàïðèìåð TEST.
+
+ 3. Òåïåðü íàáåðèòå :w TEST (ãäå TEST --- ýòî èìÿ ôàéëà, ïðèäóìàííîå Âàìè.)
+
+ 4. Ýòà êîìàíäà ñîõðàíèò âåñü ôàéë (Ó÷åáíèê ïî Vim) ïîä èìåíåì TEST. ×òîáû
+ óäîñòîâåðèòüñÿ â ýòîì, ñíîâà íàáåðèòå :!dir è ïðîñìîòðèòå êàòàëîã.
+
+---> Çàìåòüòå, ÷òî åñëè Âû âûéäåòå èç Vim è çàòåì çàïóñòèòå åãî ñíîâà ñ
+ ôàéëîì TEST, ýòîò ôàéë áóäåò òî÷íîé êîïèåé ó÷åáíèêà â òîò ìîìåíò, êîãäà
+ Âû åãî ñîõðàíèëè.
+
+ 5. Òåïåðü óäàëèòå ýòîò ôàéë, íàáðàâ :!del TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 5.3: ÂÛÁÎÐÎ×ÍÎÅ ÑÎÕÐÀÍÅÍÈÅ
+
+
+ ** Äëÿ ñîõðàíåíèÿ ÷àñòè ôàéëà, íàáåðèòå :#,# w ÈÌß_ÔÀÉËÀ **
+
+ 1. Åùå ðàç íàáåðèòå :!dir èëè :!ls äëÿ ïîëó÷åíèÿ ñïèñêà ôàéëîâ â òåêóùåì
+ êàòàëîãå è âûáåðèòå ïîäõîäÿùåå èìÿ, íàïðèìåð TEST.
+
+ 2. Ïåðåìåñòèòå êóðñîð ê íà÷àëó ýòîé ñòðàíèöû è íàæìèòå Ctrl-g äëÿ íàõîæäåíèÿ
+ íîìåðà ñòðîêèto. ÇÀÏÎÌÍÈÒÅ ÝÒÎÒ ÍÎÌÅÐ!
+
+ 3. Òåïåðü ïåðåìåñòèòåñü â êîíåö ñòðàíèöû è âíîâü íàáåðèòå Ctrl-g. ÇÀÏÎÌÍÈÒÅ
+ È ÝÒÎÒ ÍÎÌÅÐ ÒÎÆÅ!
+
+ 4. Äëÿ ñîõðàíåíèÿ ÒÎËÜÊÎ ×ÀÑÒÈ ôàéëà íàáåðèòå :#,# w TEST , ãäå #,# --- ýòî
+ íîìåðà, êîòîðûå Âû çàïîìíèëè (íà÷àëî, êîíåö), à TEST --- èìÿ âàøåãî ôàéëà.
+
+ 5. Êàê è ïðåæäå, óáåäèòåñü â íàëè÷èè ýòîãî ôàéëà êîìàíäîé :!dir , íî ÍÅ
+ ÓÄÀËßÉÒÅ åãî.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 5.4: ×ÒÅÍÈÅ È ÎÁÚÅÄÈÍÅÍÈÅ ÔÀÉËÎÂ
+
+ ** Äëÿ âñòàâêè ñîäåðæèìîãî ôàéëà, íàáåðèòå :r FILENAME **
+
+ 1. Íàáåðèòå :!dir äëÿ òîãî, ÷òîáû óáåäèòüñÿ â òîì, ÷òî ôàéë TEST âñå åùå
+ ñóùåñòâóåò.
+
+ 2. Óñòàíîâèòå êóðñîð â âåðõíåé ÷àñòè ýòîé ñòðàíèöû.
+
+Çàìå÷àíèå: Ïîñëå âûïîëíåíèÿ øàãà 3 Âû óâèäèòå Óðîê 5.3. Ïîñëå ýòîãî
+ ïåðåìåùàéòåñü ÂÍÈÇ, ñíîâà ê ýòîìó óðîêó.
+
+ 3. Òåïåðü ïðî÷èòàéòå Âàø ôàéë TEST, èñïîëüçóÿ êîìàíäó :r TEST , ãäå
+ TEST --- ýòî èìÿ ôàéëà.
+
+Çàìå÷àíèå: Ïðî÷èòàííûé Âàìè ôàéë áóäåò âñòàâëåí â òîì ìåñòå, ãäå íàõîäèòñÿ
+ êóðñîð.
+
+ 4. ×òîáû óáåäèòüñÿ â òîì, ÷òî ôàéë ïðî÷èòàí, ïåðåìåñòèòåñü íåìíîãî íàçàä ïî
+ òåêñòó è çàìåòüòå, ÷òî òåïåðü ñóùåñòâóþò äâå êîïèè Óðîêà 5.3, èñõîäíàÿ
+ è ïîëó÷åííàÿ èç ôàéëà.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 5
+
+
+ 1. :!êîìàíäà èñïîëíÿåò âíåøíþþ êîìàíäó.
+
+ Íåêîòîðûå ïîëåçíûå ïðèìåðû:
+ :!dir --- âûâîäèò ñïèñîê ôàéëîâ â êàòàëîãå.
+ :!del FILENAME --- óäàëÿåò ôàéë FILENAME.
+
+ 2. :w FILENAME çàïèñûâàåò òåêóùèé ðåäàêòèðóåìûé ôàéë íà äèñê
+ ïîä èìåíåì FILENAME.
+
+ 3. :#,#w FILENAME ñîõðàíÿåò ñòðîêè îò # äî # â ôàéë FILENAME.
+
+ 4. :r FILENAME ñ÷èòûâàåò ñ äèñêà ôàéë FILENAME è ïîìåùàåò åãî â òåêóùèé
+ ôàéë ñëåäîì çà ïîçèöèåé êóðñîðà.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 6.1: ÊÎÌÀÍÄÀ ÑÎÇÄÀÍÈß
+
+
+ ** Íàáåðèòå o ÷òîáû ñîçäàòü ïóñòóþ ñòðîêó ïîä êóðñîðîì è ïåðåéòè â ðåæèì
+ âñòàâêè (Insert mode) **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 2. Íàáåðèòå o (â íèæíåì ðåãèñòðå) äëÿ òîãî, ÷òîáû ñîçäàòü ïóñòóþ ñòðîêó
+ ÍÈÆÅ êóðñîðà è ïåðåéòè â ðåæèì âñòàâêè (Insert mode).
+
+ 3. Òåïåðü ñêîïèðóéòå ïîìå÷åííóþ ---> ñòðîêó è íàæìèòå <ESC> äëÿ âûõîäà èç
+ ðåæèìà âñòàâêè.
+
+---> Ïîñëå íàæàòèÿ o êóðñîð ïåðåéäåò íà íîâóþ ïóñòóþ ñòðîêó â ðåæèìå âñòàâêè.
+
+ 4. Äëÿ ñîçäàíèÿ ñòðîêè ÂÛØÅ êóðñîðà, ïðîñòî íàáåðèòå çàãëàâíóþ O, âìåñòî
+ ñòðî÷íîé o. Ïîïðîáóéòå ïðîäåëàòü ýòî ñ íèæåñëåäóþùåé ñòðîêîé.
+Ñîçäàéòå íîâóþ ñòðîêó íàä ýòîé, íàæàâ Shift-O, ïîìåñòèâ êóðñîð íà ýòó ñòðîêó.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 6.2: ÊÎÌÀÍÄÀ ÄÎÁÀÂËÅÍÈß
+
+ ** Íàáåðèòå a , ÷òîáû âñòàâèòü òåêñò ÏÎÑËÅ êóðñîðà. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, â êîíåö ïåðâîé ñòðîêè, ïîìå÷åííîé ---> ,
+ íàáðàâ $ â îáû÷íîì ðåæèìå (Normal mode).
+
+ 2. Íàáåðèòå a (â íèæíåì ðåãèñòðå) äëÿ äîáàâëåíèÿ òåêñòà ÏÎÑËÅ ñèìâîëà,
+ íàõîäÿùåãîñÿ ïîä êóðñîðîì. (Çàãëàâíàÿ A ïîçâîëÿåò äîáàâèòü â êîíåö
+ ñòðîêè.)
+
+Çàìå÷àíèå: Ýòî ïîçâîëÿåò èçáåæàòü íàæàòèÿ i , ïîñëåäíåãî ñèìâîëà, òåêñòà äëÿ
+ âñòàâêè, <ESC>, êóðñîð-âïðàâî, è, íàêîíåö, x , ïðîñòî äëÿ òîãî,
+ ÷òîáû äîáàâèòü òåñò â êîíåö ñòðîêè!
+
+ 3. Òåïåðü çàâåðøèòå ïåðâóþ ñòðîêó. Çàìåòüòå òàêæå, ÷òî äîáàâëåíèå ýòî â
+ òî÷íîñòè òî æå ñàìîå, ÷òî è ðåæèì âñòàâêè, çà èñêëþ÷åíèåì ïîçèöèè, â
+ êîòîðóþ áóäåò âñòàâëåí òåêñò.
+
+---> Ýòà ñòðî÷êà ïîçâîëèò Âàì ïîïðàêòèêîâàòüñÿ
+---> Ýòà ñòðî÷êà ïîçâîëèò Âàì ïîïðàêòèêîâàòüñÿ â äîáàâëåíèè òåêñòà â êîíåö
+ ñòðîêè.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 6.3: ÅÙÅ ÎÄÈÍ ÑÏÎÑÎÁ ÇÀÌÅÍÛ
+
+
+ ** Íàáåðèòå çàãëàâíóþ R äëÿ çàìåíû áîëåå, ÷åì îäíîãî ñèìâîëà. **
+
+ 1. Ïåðåìåñòèòå êóðñîð âíèç, ê ñòðîêå, ïîìå÷åííîé --->.
+
+ 2. Ðàñïîëîæèòå êóðñîð â íà÷àëå ïåðâîãî ñëîâà, îòëè÷àþùåãîñÿ îò
+ ñîîòâåòñòâóþùåãî â ñëåäóþùåé ñòðîêå, ïîìå÷åííîé ---> (ñëîâî 'ïîñëåäíåé').
+
+ 3. Òåïåðü íàáåðèòå R è çàìåíèòå îñòàòîê òåêñòà â ïåðâîé ñòðîêå, íàáðàâ
+ ïîâåðõ ñòàðîãî òåêñòà òàê, ÷òîáû îáå ñòðîêè ñòàëè îäèíàêîâûìè.
+
+---> Ïåðâóþ ñòðîêó ìîæíî ñðàâíÿòü ñ ïîñëåäíåé, èñïîëüçóÿ êëàâèøè.
+---> Ïåðâóþ ñòðîêó ìîæíî ñðàâíÿòü ñ âòîðîé, èñïîëüçóÿ R è íàáðàâ íîâûé òåêñò.
+
+ 4. Îáðàòèòå âíèìàíèå, ÷òî ïðè íàæàòèè <ESC> äëÿ çàâåðøåíèÿ, ëþáîé
+ íå èçìåíåííûé òåêñò ñîõðàíèòñÿ.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 6.4: ÓÑÒÀÍÎÂÊÀ ÏÀÐÀÌÅÒÐÎÂ
+
+
+** Óñòàíîâèì ïàðàìåòðû òàê, ÷òîáû èãíîðèðîâàòü ðåãèñòð ïðè ïîèñêå èëè çàìåíå **
+
+
+ 1. Ïîèùèòå ñëîâî 'èãíîðèðîâàòü', íàáðàâ:
+ /èãíîðèðîâàòü
+ Ïîâòîðèòå ïîèñê íåñêîëüêî ðàç, íàæèìàÿ êëàâèøó n
+
+ 2. Âêëþ÷èòå ïàðàìåòð 'ic' (Èãíîðèðîâàòü ðåãèñòð), íàáðàâ:
+ :set ic
+
+ 3. Òåïåðü ñíîâà ñäåëàéòå ïîèñê ñëîâà 'èãíîðèðîâàòü', íàæàâ: n
+ Ïîâòîðèòå ïîèñê íåñêîëüêî ðàç, íàæèìàÿ êëàâèøó n
+
+ 4. Âêëþ÷èòå ïàðàìåòðû 'hlsearch' è 'incsearch':
+ :set hls is
+
+ 5. Òåïåðü îïÿòü ââåäèòå êîìàíäó ïîèñêà è ïîñìîòðèòå, ÷òî ïîëó÷èòñÿ:
+ /èãíîðèðîâàòü
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ÐÅÇÞÌÅ ÓÐÎÊÀ 6
+
+
+ 1. Íàæàòèå o ñîçäàåò ñòðîêó ÍÈÆÅ êóðñîðà è ïåðåìåùàåò êóðñîð â íåå â ðåæèìå
+ âñòàâêè.
+ Íàæàòèå çàãëàâíîé O ñîçäàåò ñòðîêó ÂÛØÅ ñòðîêè, â êîòîðîé íàõîäèòñÿ
+ êóðñîð.
+
+ 2. Íàáåðèòå a äëÿ âñòàâêè òåêñòà ÏÎÑËÅ ñèìâîëà, íà êîòîðîì íàõîäèòñÿ êóðñîð.
+ Íàæàòèå çàãëàâíîé A àâòîìàòè÷åñêè ïåðåìåùàåò Âàñ äëÿ äîáàâëåíèÿ òåêñòà
+ â êîíåö ñòðîêè.
+
+ 3. Íàæàòèå çàãëàâíîé R ïåðåâîäèò Âàñ â ðåæèì çàìåíû äî òåõ ïîð, ïîêà íå
+ áóäåò íàæàòà êëàâèøà <ESC> äëÿ çàâåðøåíèÿ.
+
+ 4. Íàáðàâ ":set xxx" âû ñìîæåòå âêëþ÷èòü ïàðàìåòð "xxx"
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 7: ÊÎÌÀÍÄÛ ÏÎËÓ×ÅÍÈß ÂÑÒÐÎÅÍÍÎÉ ÑÏÐÀÂÊÈ
+
+ ** Èñïîëüçóéòå âñòðîåííóþ ñïðàâî÷íóþ ñèñòåìó **
+
+ Vim îáëàäàåò ìîùíîé âñòðîåííîé ñïðàâî÷íîé ñèñòåìîé. Äëÿ íà÷àëà ïîïðîáóéòå
+ îäèí èç òðåõ âàðèàíòîâ:
+ - íàæìèòå êëàâèøó <HELP> (åñëè òàêîâàÿ èìååòñÿ íà êëàâèàòóðå)
+ - íàæìèòå êëàâèøó <F1> (åñëè òàêîâàÿ èìååòñÿ íà êëàâèàòóðå)
+ - íàáåðèòå :help <ENTER>
+
+ Íàáåðèòå :q <ENTER> ÷òîáû çàêðûòü îêíî ñïðàâêè.
+
+ Âû ìîæåòå íàéòè ñïðàâêó äëÿ ëþáîãî ïîíÿòèÿ èëè êîìàíäû, ïðîñòî çàäàâ
+ ñîîòâåòñòâóþùèé àðãóìåíò êîìàíäå ":help". Ïîïðîáóéòå ñëåäóþùåå (íå çàáóäüòå
+ íàæàòü <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Óðîê 8: ÑÎÇÄÀÍÈÅ ÑÒÀÐÒÎÂÎÃÎ ÑÊÐÈÏÒÀ
+
+ ** Âêëþ÷èì âîçìîæíîñòè Vim **
+
+ Vim èìååò íàìíîãî áîëüøå âîçìîæíîñòåé, ÷åì Vi, îäíàêî áîëüøèíñòâàî èç íèõ
+ âûêëþ÷åíû ïî óìîë÷àíèþ. Äëÿ òîãî, ÷òîáû íà÷àòü èñïîëüçîâàòü íîâûå
+ âîçìîæíîñòè Âàì ñëåäóåò ñîçäàòü ôàéë "vimrc".
+
+ 1. Îòðåäàêòèðóéòå ôàéë "vimrc", åãî ðàñïîëîæåíèå çàâèñèò îò èñïîëüçóåìîé
+ ñèñòåìû:
+
+ :edit ~/.vimrc äëÿ Unix
+ :edit $VIM/_vimrc äëÿ MS-Windows
+
+ 2. Òåïåðü ïðî÷èòàéòå ïðèìåð ôàéëà "vimrc":
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Çàïèøèòå ôàéë:
+
+ :write
+
+ Òåïåðü ïðè ñëåäóþùåì çàïóñêå Vim áóäåò âêëþ÷åíà ïîäñâåòêà ñèíòàêñèñà. Âñå
+ íàñòðîéêè, ïðåäïî÷èòàåìûå Âàìè, ìîãóò áûòü äîáàâëåíû â ôàéë "vimrc".
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Íà ýòîì çàâåðøàåòñÿ Ó÷åáíèê Vim. Îí áûë ïðåäíàçíà÷åí äëÿ òîãî, ÷òîáû äàòü
+ îáùåå ïðåäñòàâëåíèå î ðåäàêòîðå Vim, äîñòàòî÷íîå äëÿ òîãî, ÷òîáû ñ ëåãêîñòüþ
+ èñïîëüçîâàòü åãî. Ó÷åáíèê äàëåê îò ïîëíîòû, ïîñêîëüêó Vim èìååò î÷åíü ìíîãî
+ êîìàíä. Ïðî÷èòàéòå òåïåðü ðóêîâîäñòâî ïîëüçîâàòåëÿ: ":help user-manual".
+
+ Äëÿ äàëüíåéøåãî ÷òåíèÿ ðåêîìåíäóåòñÿ êíèãà:
+ Vim - Vi Improved - Àâòîð: Steve Oualline
+ Èçäàòåëü: New Riders
+ Ýòà êíèãà ïîëíîñòüþ ïîñâÿùåíà Vim. Îñîáåííî ïîëåçíà íîâè÷êàì. Ñîäåðæèò
+ ìíîæåñòâî ïðèìåðîâ è èëëþñòðàöèé.
+ Âçãëÿíèòå íà See http://iccf-holland.org/click5.html
+
+ Ñëåäóþùàÿ êíèãà áîëåå ïî÷òåííîãî âîçðàñòà è ïîñâÿùåíà áîëüøå Vi, ÷åì Vim,
+ îäíàêî òàêæå ðåêîìåíäóåòñÿ:
+ Learning the Vi Editor - Àâòîð: Linda Lamb
+ Èçäàòåëü: O'Reilly & Associates Inc.
+ Ýòî õîðîøàÿ êíèãà äëÿ òîãî, ÷òîáû óçíàòü âñå, ÷òî òîëüêî ìîæíî ïðîäåëûâàòü ñ
+ Vi. Øåñòîå èçäàíèå òàêæå âêëþ÷àåò èíôîðìàöèþ î Vim.
+
+ Ýòîò ó÷åáíèê áûë íàïèñàí Michael C. Pierce è Robert K. Ware, Colorado School
+ of Mines ñ èñïîëüçîâàíèåì èäåé, ïðåäëîæåííûõ Charles Smith, Colorado State
+ University. E-mail: bware@mines.colorado.edu.
+
+ Äîðàáîòàíî äëÿ Vim Bram Moolenaar.
+
+ Ïåðåâîä: Àíäðåé Êèñåëåâ <a_kissel@eudoramail.com>, 2002.
+ Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.sk b/runtime/tutor/tutor.sk
new file mode 100644
index 000000000..243493bd1
--- /dev/null
+++ b/runtime/tutor/tutor.sk
@@ -0,0 +1,821 @@
+===============================================================================
+= V i t a j t e v o V I M T u t o r i a l i - Verzia 1.5 =
+===============================================================================
+
+ Vim je veµmi výkonný editor, ktorý má príli¾ veµa príkazov na to aby
+ mohli byt v¹etky popísané vo výuke akou je táto. Táto výuka
+ popisuje dostatoèné mno¾stvo príkazov nato aby bolo mo¾né pou¾íva»
+ Vim ako viacúèelový editor.
+
+ Pribli¾ný èas potrebný na prebratie tejto výuky je 25-30 minút,
+ závisí na tom, koµko je stráveného èasu s preskú¹avaním.
+
+ Príkazy v lekciách modifikujú text. Vytvor kópiu tohto súboru aby
+ sa mohlo precvièova» na òom (pri ¹tarte "vimtutor" je toto kópia).
+
+ Je dôle¾ité zapamäta» si, ¾e táto výuka je vytvorená pre výuku
+ pou¾ívaním. To znamená, ¾e je potrebné si príkazy vyskú¹a», aby bolo
+ uèenie správne. Ak len èitas text, príkazy zabudne¹!
+
+ Presvedè sa, ¾e Shift-Lock NIEJE stlaèený a stlaèt klávesu
+ j niekoµko krát, aby sa kurzor posunul natoµko, ¾e lekcia 1.1
+ celkom zaplní obrazovku.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 1.1: POHYB KURZOROM
+
+
+ ** Pre pohyb kurzorum stlaè klávesy h,j,k,l ako je znázornené. **
+ ^
+ k Funkcia: Klávesa h je naµavo a vykoná pohyb doµava.
+ < h l > Klávesa l je napravo a vykoná pohyb doprava.
+ j Klávesa j vyzerá ako ¹ípka dole
+ v
+ 1. Pohybuj kurzorom po obrazovke, kým si na to nezvykne¹.
+
+ 2. Dr¾ stlaèenú klávesu pre pohyb dole (j), kým sa jej funkcia nezopakuje.
+---> Teraz sa u¾ vie¹ pohybova» na nasledujúcu lekciu.
+
+ 3. Pou¾itím klávesy pre pohyb dole prejdi na Lekciu 1.2.
+
+Poznámka: Ak si niesi istý tým èo si napísal, stlaè <ESC>
+ na prechod do normálneho módu.
+
+Poznámka: Kurzorové klávesy sú tie¾ funkèné. Ale pou¾ívaním hjkl sa bude¹
+ schopný pohybova» rýchlej¹ie, keï si zvykne¹ ich pou¾íva».
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 1.2: SPÚ©«ANIE A ZATVÁRANIE VIMU
+
+ !! POZNÁMKA: Pred vykonaním týchto krokov si preèítaj celú túto lekciu !!
+
+ 1. Stlaè klávesu <ESC> (aby si sa uèite nachádzal v normálnom móde)
+
+ 2. Napí¹: :q! <ENTER>.
+
+---> Tým ukonèí¹ prácu s editorom BEZ ulo¾enia zmien, ktoré si vykonal.
+ Ak chce¹ ulo¾i» vykonané zmeny a ukonèi» prácu s editorom napí¹:
+ :wq <ENTER>
+
+ 3. Keï sa dostane¹ na príkazový riadok, napí¹ príkaz, ktorým sa dostane¹
+ spe» do tejto výuky. To mô¾e by»: vimtutor <ENTER>
+ Zvyèajne sa pou¾íva: vim tutor <ENTER>
+
+---> 'vim' znamená spustenie editora vim, 'tutor' je názov súboru, ktorý
+ chce¹ editova».
+
+ 4. Ak si si tieto kroky spoµahlivo zapamätal, vykonaj kroky 1 a¾ 3, pre
+ ukonèenie a znovu spustenie editora. Potom presuò kurzor dole na
+ lekciu 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 1.3: EDITÁCIA TEXTU - MAZANIE
+
+
+** Stlaèenie klávesy x v normálnom móde zma¾e znak na mieste kurzora. **
+
+ 1. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou --->.
+
+ 2. Aby si mohol odstráni» chyby, pohybuj kurzorom kým neprejde na znak,
+ ktorý chce¹ zmaza».
+
+ 3. Stlaè klávesu x aby sa zmazal nechcený znak.
+
+ 4. Zopakuj kroky 2 a¾ 4 a¾ kým veta nieje správna.
+
+---> Kraava skooèilla ccezz mesiiac.
+
+ 5. Ak je veta správna, prejdi na lekciu 1.4.
+
+POZNÁMKA: Neskú¹aj si zapametä» obsah tejto výuky, ale sa uè pou¾ívaním.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 1.4: EDITÁCIA TEXTU - VKLADANIE
+
+
+ ** Stlaèenie klávesy i v normálnom móde umo¾òuje vkladanie textu. **
+
+ 1. Presuò kurzor ni¾¹ie na prvý riadok za znaèku --->.
+
+ 2. Pre upravenie prvého riadku do rovnakého tvaru ako je druhý riadok,
+ presuò kurzor na prvý znak za misto, kde má by» text vlo¾ený.
+
+ 3. Stlaè klávesu i a napí¹ potrebný text.
+
+ 4. Po opravení ka¾dej chyby, stlaè <ESC> pre návrat do normálneho módu.
+ Zopakuj kroky 2 a¾ 4 kým nieje veta správna.
+
+---> Tu je text chýbajúci tejto.
+---> Tu je nejaký text chýbajúci od tejto èiary.
+
+ 5. Keï sa dostatoène nauèí¹ vklada» text, prejdi na nasledujúce zhrnutie.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ZHRNUTIE LEKCIE 1
+
+
+ 1. Kurzor sa pohybuje pou¾itím kláves so ¹ípkami alebo klávesmi hjkl.
+ h (do lava) j (dole) k (hore) l (doprava)
+
+ 2. Pre spustenie Vimu (z príkazového riadku) napí¹: vim FILENAME <ENTER>
+
+ 3. Na ukonèenie Vimu napí¹: <ESC> :q! <ENTER> pre zru¹enie v¹etkých zmien
+ alebo napí¹: <ESC> :wq <ENTER> pre ulo¾enie zmien.
+
+ 4. Na zmazanie znaku na mieste kurzora napí¹ v normálnom móde: x
+
+ 5. Pre vlo¾enie textu na mieste kurzora v normálnom móde napí¹:
+ i vkladaný text <ESC>
+
+POZNÁMKA: Stlaèenie <ESC> »a premiestní do normálneho módu alebo zru¹í
+ nejaký nechcený a èiastoène dokonèený príkaz.
+
+Teraz pokraèuj lekciou 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 2.1: Mazacie príkazy
+
+
+ ** Napísanie príkazu dw zma¾e znaky do konca slova. **
+
+1. Stlaè <ESC> aby si bol bezpeène v normálnom móde.
+
+2. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou --->.
+
+3. Presuò kurzor na zaèiatok slova, ktoré je potrebné zmaza».
+
+4. Napí¹ dw aby slovo zmizlo.
+
+POZNÁMKA: Písmená dw sa zobrazia na poslednom riadku obrazovky tak ako ich
+ pí¹e¹. Ak pí¹e¹ nieèo zle, stlaè <ESC> a zaèni znova.
+
+---> Tu je niekoµko slov zábava, ktoré nie patria list do tejto vety.
+
+5. Zopakuj kroky 3 a¾ 4 kým veta nieje správna a prejdi na lekciu 2.2.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 2.2: VIAC MAZACÍCH PRÍKAZOV
+
+
+ ** Napísanie príkazu d$ zma¾e znaky do konca riadku **
+
+1. Stlaè <ESC> aby si bol bezpeène v normálnom móde.
+
+2. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou --->.
+
+3. Presuò kurzor na koniec správnej vety (ZA prvú bodku).
+
+4. Napí¹ d$ aby sa zmazali znaky do konca riadku.
+
+---> Niekto napísal koniec tohto riadku dvakrát. koniec tohot riadku dvakrát.
+
+
+5. Prejdi na lekciu 2.3 pre pochopenie toho èo sa stalo.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 2.3: ROZ©IROVACIE PRÍKAZY A OBJEKTY
+
+
+ Formát mazacieho príkazu d je nasledovný:
+
+ [èíslo] d objekt ALEBO d [èíslo] objekt
+ Kde:
+ èíslo - udáva koµko krát sa príkaz vykoná (voliteµné, implicitne=1)
+ d - je príkaz pre mazanie
+ objekt - udáva na èom sa príkaz vykonáva (vypísané ni¾¹ie)
+
+ Krátky výpis objektov:
+ w - od kurzora do konca slova, vrátanie medzier
+ e - od kurzora do konca slova, BEZ medzier
+ $ - od kurzora do konca riadku.
+
+POZNÁMKA: Ak stlaèí¹ klávesu objektu v normálnom móde bez príkazu, kurzor
+ sa presunie na miesto ¹pecifikované vo výpise objektov.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 2.4: VÝNIMKA V 'PRÍKAZOVOM OBJEKTE'
+
+
+ ** Napísanie príkazu dd zma¾e celý riadok. **
+
+Vzhµadom na frekvenciu mazania celého riadku, sa autori Vimu rozhodli,
+¾e bude jednoduch¹ie maza» celý riadok napísaním dvoch písmen d.
+
+1. Presuò kurzor na druhý riadok v texte na spodu.
+2. Napí¹ dd aby si zmazal riadok.
+3. Prejdi na ¹tvrtý riadok.
+4. Napí¹ 2dd (pametaj si èíslo-príkaz-objekt) aby si zmazal dva riadky.
+
+ 1) Ru¾e sú èervené,
+ 2) Blato je zábavné,
+ 3) Fialky sú modré,
+ 4) Mám auto,
+ 5) Hodinky ukazujú èas,
+ 6) Cukor je sladký,
+ 7) A to si ty.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 2.5: PRÍKAZ UNDO
+
+
+** Stlaè u pre vrátenie posledného príkazu, U pre úpravu celého riadku. **
+
+1. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou ---> a premiestni ho na
+ prvú chybu.
+2. Napí¹ x pre zmazanie prvého nechceného riadku.
+3. Teraz napí¹ u èím vrátí¹ spä» posledne vykonaný príkaz.
+4. Teraz oprav v¹etky chyby na riadku pou¾itím príkazu x .
+5. Teraz napí¹ veµké U èím vrátí¹ riadok do pôvodného stavu.
+6. Teraz napí¹ u niekoµko krát, èím vrátí¹ spä» príkaz U.
+7. Teraz napí¹ CTRL-R (dr¾ klávesu CTRL stlaèenú kým stláèa¹ R) niekoµko
+ krát, èím vrátí¹ spä» predtým vrátené príkazy (redo).
+
+---> Opprav chybby nna toomto riadku a zmeeò ich pommocou undo.
+
+ 8. Tieto príkazy sú èasto pou¾ívané. Teraz prejdi na zhrnutie lekcie 2.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 2 ZHRNUTIE
+
+
+ 1. Pre zmazanie znakov od kurzora do konca slova napí¹: dw
+
+ 2. Pre zmazanie znakov od kurzora do konca riadku napí¹: d$
+
+ 3. Pre zmazanie celého riadku napí¹: dd
+
+ 4. Formát pre píkaz v norálnom móde je:
+
+ [èíslo] príkaz objekt ALEBO príkaz [èíslo] objekt
+ kde:
+ èíslo - udáva koµko krát sa príkaz zopakuje
+ príkaz - udáva vykonávaný príkaz, ako napríklad d pre mazanie
+ objekt - udáva rozsah príkazu, ako napríklad w(slovo),
+ $ (do konca riadku), atï.
+
+ 5. Pre vrátenie spä» predo¹lej operácie napí¹: u (malé u)
+ Pre vrátenie v¹etkých úprav na riadku napí¹: U (veµké U)
+ Pre vrátenie vrátených úprav napí¹: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 3.1: PRÍKAZ VLO®I«
+
+
+ ** Napísanie príkazu p vlo¾í psledný výmaz za kurzor. **
+
+ 1. Presuò kurzor ni¾¹ie na prvý riadok textu.
+
+ 2. Napí¹ dd èím zma¾e¹ riadok a ulo¾í¹ ho do buffera editora Vim.
+
+ 3. Presuò kurzor vy¹¹ie tam, kam zmazaný riadok patrí.
+
+ 4. Ak napí¹e¹ v normálnom móde p zmazaný riadk sa vlo¾í.
+
+ 5. Zopakuj kroky 2 a¾ 4, kým riadky niesú v správnom poradí.
+
+ d) Tie¾ sa doká¾e¹ vzdeláva»?
+ b) Fialky sú modré,
+ c) Inteligencia sa vzdeláva,
+ a) Ru¾e sú èervené,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 3.2: PRÍKAZ NAHRADENIA
+
+
+ ** Napísaním r a znaku sa nahradí znak na mieste kurzora. **
+
+ 1. Presuò kurzor ni¾¹ie na prví riadok textu oznaèeného znaèkou --->.
+
+ 2. Presuò kurzor na zaèiatok prvej chyby.
+
+ 3. napí¹ r a potom znak, ktorý nahradí chybu.
+
+ 4. Zopakuj kroky 2 a 3, kým prvý riadok nieje správny.
+
+---> Kaï bol tento riasok píaaný, niekro stla¹il nesprábne klávesy!
+---> Keï bol tento riadok písaný, niekto stlaèil nesprávne klávesy!
+
+ 5. Teraz prejdi na lekciu 3.2.
+
+POZNÁMKA: Pamätaj si, ¾e nauèi» sa mô¾e¹ len pou¾ívanim, nie pamätaním.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 3.3. PRÍKAZ ÚPRAVY
+
+
+ ** Ak chce¹ zmeni» èas» slova alebo celé slovo, napí¹ cw . **
+
+ 1. Presuò kurzor ni¾¹ie na prvý riadok oznaèený znaèkou --->.
+
+ 2. Umiestni kurzor na písmeno o v slove rosfpl.
+
+ 3. Napí¹ cw a oprav slovo (v tomto prípade napí¹ 'iadok'.)
+
+ 4. Stlaè <ESC> a prejdi na ïal¹iu chybu (prvý znak, ktorý treba zmeni».)
+
+ 5. Zopakuj kroky 3 a 4, kým prvá veta nieje rovnaká ako druhá.
+
+---> Tento rosfpl má niekoµko skic, ktoré je pirewvbí zmeni» piy»uèán príkazu.
+---> Tento riadok má niekoµko slov, ktoré je potrebné zmeni» pou¾itím príkazu.
+
+Poznámka, ¾e cw nielen nahrádza slovo, ale »a aj premiestní do vkladania.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 3.4: VIAC ZMIEN POU®ITÍM c
+
+
+ ** Príkaz pre úpravy sa pou¾íva s rovnakými objektami ako pre mazanie **
+
+ 1. Príkaz pre úpravy pracuje rovnako ako pre mazanie. Formát je:
+
+ [èíslo] c objekt ALEBO c [èíslo] objekt
+
+ 2. Objekty sú rovnaké, ako napríklad w (slovo), $ (koniec riadku), atï.
+
+ 3. Presuò kurzor ni¾¹ie na prvý riadok oznaèený znaèkou --->.
+
+ 4. Presuò kurzor na prvú chybu.
+
+ 5. napí¹ c$ aby si mohol upravi» zvy¹ok riadku podµa druhého
+ a stlaè <ESC>.
+
+---> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy.
+---> Koniec tohto riadku potrebuje opravi» pou¾itím príkazu c$ .
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 3 ZHRNUTIE
+
+
+ 1. Na vlo¾enie textu, ktorý u¾ bol zmazaný, napí¹ p . To vlo¾í zmazaný
+ text ZA kurzor (ak bol riadok zmazaný prejde na riadok pod kurzorom).
+
+ 2. Pre naradenie znaku na mieste kurzora, napí¹ r a potom znak, ktorý
+ nahradí pôvodný znak.
+
+ 3. Príkaz na upravenie umo¾òuje zmeni» ¹pecifikovaný objekt od kurzora
+ a¾ po koniec objektu. napr. Napí¹ cw èím zmní¹ text od pozície
+ kurzora do konca slova, c$ zmení text do konca riadku.
+
+ 4. Format pre nahradenie je:
+
+ [èíslo] c objekt ALEBO c [èíslo] objekt
+
+
+Teraz prejdi na nalsedujúcu lekciu.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 4.1: POZÍCIA A STATUS SÚBORU
+
+
+ ** Stlaè CTRL-g pre zobrazenie svojej pozície v súbore a statusu súboru.
+ Stlaè SHIFT-G pre prechod na riadok v súbore. **
+
+ Poznámka: Preèítaj si celú túto lekciu skôr ako zaène¹ vykonáva» kroky!!
+
+ 1. Dr¾ stlaèenú klávesu Ctrl a stlaè g . Na spodu obrazovky sa zobrazí
+ stavový riadok s názvom súboru a riadkom na ktorom práve si. Zapamätaj
+ si si èíslo riadku pre krok 3.
+
+ 2. Stlaè Shift-G èím sa dostane¹ na spodok súboru.
+
+ 3. Napí¹ èíslo riadku na ktorom si sa nachádzal a stlaè Shift-G. To »a
+ vráti na riadok, na ktorom si prvý krát stlaèil Ctrl-g.
+ (Keï pí¹e¹ èísla, tieto sa nezobrazujú na obrazovke.)
+
+ 4. Ak sa cítí¹ schopný vykona» teto kroky, vykonaj kroky 1 a¾ 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 4.2: PRÍKAZ VYH¥ADÁVANIA
+
+
+ ** Napí¹ / nasledované re»azcom pre vyhµadanie príslu¹ného re»azca. **
+
+ 1. Napí¹ znak / v normálnom móde. Poznámka, ¾e tento znak sa spolu
+ s kurzorom zobrazí v dolnej èasti obrazovky ako s : príkazom.
+
+ 2. Teraz napí¹ 'errroor' <ENTER>. To je slovo, ktoré chce¹ vyhµada».
+
+ 3. Pre vyhµadanie ïal¹ieho výskytu rovnakého re»azca, stlaè jednoducho n.
+ Pre vyhµadanie ïal¹ieho výskytu rovnakého re»azca opaèným smerom,
+ napí¹ Shift-N.
+
+ 4. Ak chce¹ vyhµada» re»azec v spätnom smere, pou¾í príkaz ? miesto
+ príkazu /.
+
+ ---> Keï vyhµadávanie dosiahne koniec tohto súboru, bude pokraèova» na
+ zaèiatku.
+
+ "errroor" nie je spôsob ako nahradi» error; errroor je error.
+
+POZNÁMKA: Keï vyhµadávanie dosiahne koniec súboru, bude pokraèova» na jeho
+ zaèiatku.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 4.3: VYH¥ADÁVANIE ZODPOVEDAJÚCICH ZÁTAVORIEK
+
+
+ ** Napí¹ % pre vyhµadanie príslu¹ného znaku ),], alebo } . **
+
+ 1. Premiestni kurzor na hocaký zo znakov (, [, alebo { v riadku ni¾¹ie
+ oznaèeného znaèkou --->.
+
+ 2. Teraz napí¹ znak % .
+
+ 3. Kurzor sa premiestni na zodpovedajúcu zátvorku.
+
+ 4. Napí¹ % pre presun kurzoru spä» na otvárajúcu zátvorku.
+
+---> Toto ( je testovací riadok s ('s, ['s ] a {'s } v riadku. ))
+
+Poznámka: Toto je veµmi výhodné pou¾í» pri ladení programu s chýbajúcimi
+ uzatvárajúcimi zátvorkami.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 4.4: SPOSOB AKO ZMENI« CHYBY
+
+
+ ** Napí¹ :s/starý/nový/g pre nahradenie slova 'starý' za slovo 'nový'. **
+
+ 1. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou --->.
+
+ 2. Napí¹ :s/thee/the <ENTER> . Poznamka, ¾e tento príkaz zmení len prvý
+ výskyt v riadku.
+
+ 3. Teraz napí¹ :s/thee/the/g èo znamená celkové nahradenie v riadku.
+ Toto nahradí v¹etky výskyty v riadku.
+
+---> Thee best time to see thee flowers in thee spring.
+
+ 4. Pre zmenu v¹etkých výskytov daného re»azca medzi dvomi ridakami,
+ napí¹ :#,#s/starý/nový/g kde #,# sú èísla dvoch riadkov.
+ napí¹ :%s/starý/nový/g pre zmenu v¹etkých výskytov v celom riadku
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 4 ZHRNUTIE
+
+
+ 1. Ctrl-g vypí¹e tvoju pozíciu v súbore a status súboru.
+ Shift-g »a premiestni na koniec riadku. Èíslo riadku nasledované
+ Shift-g »a presunie na dané èíslo riadku.
+
+ 2. Napísanie / nasledované re»azcom vyhµadá re»azec smerom DOPREDU.
+ Napísanie ? nasledované re»azcom vyhµada re»azec smerom DOZADU.
+ Napísanie n po vyhµadávaní, vyhµadá nasledujúci výskyt re»azca
+ v rovnakom smere, prièom Shift-N vyhµadá v opaènom smere.
+
+ 3. Napísanie % keï kurzor je na (,),[,],{, alebo } nájde zodpovdajúcu
+ párú zátvorku.
+
+ 4. Pre nahradenie nového za prvý starý v riadku napí¹ :s/nový/starý
+ Pre nahradenie nového za v¹etky staré v riadku napí¹ :s/nový/starý/g
+ Pre nahradenie re»azcov medzi dvoma riadkami 3 napí¹ :#,#/nový/starý/g
+ Pre nahradenie v¹etkých výskytov v súbore napí¹ :%s/starý/nový/g
+ Pre potvrdenie ka¾dého nahradenia pridaj 'c' :%s/nový/starý/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 5.1 AKO SPUSTI« VONKAJ©Í PRÍKAZ
+
+
+ ** Napí¹ príkaz :! nasledovaný vonkaj¹ím príkazom pre spustenie príkazu **
+
+ 1. Napí¹ obvyklý píkaz : ktorý nastaví kurzor na spodok obrazovky.
+ To umo¾ní napísa» príkaz.
+
+ 2. Teraz napí¹ ! (výkrièník). To umo¾ní spusti» hociaký vonkaj¹í príkaz
+ z príkazového riadku.
+
+ 3. Ako príklad napí¹ ls za ! a stlaè <ENTER>. Tento príkaz
+ zobrazí obsah tvojho adresára rovnako ako na príkazovom riadku.
+ Alebo pou¾i :!dir ak ls nefunguje.
+
+Poznámka: Takto je mo¾né spusti» hociaký vonkaj¹í príkaz.
+Poznámka: V¹etky príkazy : musia by» dokonèené stlaèením <ENTER>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 5.2: VIAC O UKLADANÍ SÚBOROV
+
+
+ ** Pre ulo¾enie zmien v súbore, napí¹ :w FILENAME. **
+
+ 1. Napí¹ :!dir alebo :!ls pre výpis aktuálneho adresára.
+ U¾ vie¹, ¾e musí¹ za týmto stlaèi» <ENTER> .
+
+ 2. Vyber názov súboru, ktorý E©TE neexistuje.
+
+ 3. Teraz napí¹: :w TEST (kde TEST je názov vybratého súboru.)
+
+ 4. To ulo¾í celý súbor (Vim Tutor) pod názovm TEST.
+ Pre overenie napí¹ :!dir , èím zobrazí¹ obsah adresára.
+
+Poznámka: ¾e ak ukonèí¹ prácu s editorom Vim a znovu ho spustí¹ s názvom
+ súboru TEST, súbor bude kópia výuky, keï si ho ulo¾il.
+
+ 5. Teraz odstráò súbor napísaním (MS-DOS): :!del TEST
+ alebo (Unix): :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 5.3 VÝBEROVÝ PRÍKAZ PRE ULO®ENIE
+
+
+ ** Pre ulo¾enie èasti súboru, napí¹ :#,# w FILENAME **
+
+ 1. Znovu napí¹ :!dir alebo :!ls pre zobrazenie obsahu aktuálneho
+ adresára a vyber vhodný súbor ako TEST.
+
+ 2. Presuò kurzor na vrch tejto strany a napí¹ Ctrl-g pre vyhµadanie èísla
+ tohto riadku. PAMETAJ SI TOTO ÈÍSLO!
+
+ 3. Teraz prejdi na spodok strany a napí¹ Ctrl-g znovu. ZAPAMETAJ SI ÈÍSLO
+ AJ TOHTO RIADKU!
+
+ 4. Pre ulo¾enie LEN èasti súboru, napí¹ :#,# w TEST kde #,# sú dve èísla
+ zapamätaných riadkov (vrch, spodok) a TEST je názov súboru.
+
+ 5. Znova sa pozri, èi tam ten súbor je pomocou príkazu :!dir ale
+ NEODSTRAÒUJ ho.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 5.4: VÝBER A ZLUÈOVANIE SÚBOROV
+
+
+ ** Pre vlo¾enie obsahu súboru, napí¹ :r FILENAME **
+
+ 1. Napí¹ :!dir aby si sa presvedèil, ¾e súbor TEST stále existuje.
+
+ 2. Presuò kurzor na vrch tejto strany.
+
+POZNÁMKA: Po vykonaní kroku 3 uvidí¹ Lekciu 5.3. Potom sa presuò dole
+ na túto lekciu.
+
+ 3. Teraz vlo¾ súbor TEST pou¾itím príkazu :r TEST kde TEST je názov
+ súboru.
+
+POZNÁMKA: Súbor, ktorý si vlo¾il sa vlo¾í od miesta, kde sa nachádza kurzor.
+
+ 4. Pre kontrolu vlo¾enia súboru, presuò kurzor spä» a v¹imni si, ¾e teraz
+ má¹ dve kópie lekcie 5.3, originál a súborovú verziu.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 5 ZHRNUTIE
+
+
+ 1. :!príkaz spustí vonkaj¹í príkaz.
+
+ Niektoré vyu¾iteµné príklady sú:
+ (MS_DOS) (UNIX)
+ :!dir :!ls - zobrazí obsah adresára
+ :!del FILENAME :!rm FILENAME - odstráni súbor FILENAME
+
+ 2. :w FILENAME ulo¾í aktuálny súbor na disk pod menom FILENAME.
+
+ 3. :#,#w FILENAME ulo¾í riadky od # do # do súboru FILENAME.
+
+ 4. :r FILENAME vyberie z disku súbor FILENAME a vlo¾í ho do aktuálneho
+ súboru za pozíciou kurzora.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 6.1: PRÍKAZ OTVORI«
+
+
+** Napí¹ o pre vlo¾enie riadku pod kurzor a prepnutie do vkladacieho módu **
+
+ 1. Presuò kurzor ni¾¹ie na riadok oznaèený znaèkou --->.
+
+ 2. Napí¹ o (malé písmeno) pre vlo¾enie èistého riadku pod kurzorm
+ a prepnutie do vkladacieho módu.
+
+ 3. Teraz skopíruj riadok oznaèený ---> a stlaè <ESC> pre ukonèenie
+ vkladacieho módu.
+
+---> Po napísaní o sa kurzor premiestní na vlo¾ený riadok do vkladacieho
+ módu.
+
+ 4. Pre otvorenie riadku nad kurzorom, jednotucho napí¹ veµké O , namiesto
+ malého o. Vyskú¹aj si to na nasledujúcom riadku.
+Vlo¾ riadok nad týmto napísaním Shift-O, keï kurzor je na tomto riadku.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 6.2: PRÍKAZ PRIDA«
+
+
+ ** Napí¹ a pre vlo¾enie textu ZA kurzor. **
+
+ 1. Presuò kurzor ni¾¹ie na koniec prvého riadku oznaèeného znaèkou --->
+ napísaním $ v normálnom móde.
+
+ 2. Napí¹ a (malé písmeno) pre pridanie textu ZA znakom na mieste
+ kurzora. (Veµké A pridá na koniec riadku.)
+
+Poznámka: Toto obchádza písanie i , posledný znak, text na vlo¾enie, <ESC>,
+ kurzor doprava, a nakoniec, x , na pridávanie na koniec riadku!
+
+ 3. Teraz dokonèi prvý riadok. Poznámka, ¾e pridávanie je vlastne rovnaké
+ ako vkladací mód, okrem miesta, kde sa text vkladá.
+
+---> Tento riadok ti dovoµuje nácvik
+---> Tento riadok ti dovoµuje nácvik pridávania textu na koniec riadku.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 6.3: INÝ SPOSOB NAHRADZOVANIA
+
+
+ ** Napí¹ veµké R pre nahradenie viac ako jedného znaku. **
+
+ 1. Presuò kurzor ni¾¹ie na prvý riadok oznaèený znaèkou --->.
+
+ 2. Premiestni kurzor na zaèiatok prvého slova, ktoré je odli¹né od druhého
+ riadku oznaèeného ---> (slovo 'posledná').
+
+ 3. Teraz napí¹ R a nahraï zvy¹ok textu na prvom riadku písaním cez starý
+ text tak, aby prvý riadok bol rovnaký ako druhý.
+
+---> Na úpravu prvého riadku do tvaru ako je posledný na strane pou¾i klávesy.
+---> Na úpravu prvého riadku do tavru ako je druhý, napí¹ R a nový text.
+
+ 4. Poznámka, ¾e ak stlaèí¹ <ESC> pre ukonèenie, v¹etok nezmenený text
+ zostane.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcia 6.4: NASTAVENIE MO®NOSTÍ
+
+
+** Nastav mo¾nosti, tak¾e vyhµadávanie alebo nahradzovanie ignoruje
+ rozli¹ovanie **
+
+
+ 1. Vyhµadaj re»azec 'ignore' napísaním:
+ /ignore
+ Zopakuj vyhµadávanie niekoµko krát stlaèením klávesy n
+
+ 2. Nastav mo¾nos» 'ic' (Ignore case) napísaním príkazu:
+ :set ic
+
+ 3. Teraz vyhµadaj re»azec 'ingore' znova stlaèením klávesy: n
+ Zopakuj vyhµadávanie niekoµko krát stlaèením klávesy n
+
+ 4. Nastav mo¾nos»i 'hlsearch' a 'incsearch':
+ :set hls is
+
+ 5. Teraz spusti vyhµadávací príkaz znovu, a pozri èo sa stalo:
+ /ignore
+
+ 6. Na odstránenie zvýraznenia výrazov napí¹:
+ :nohlsearch
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 6 ZHRNUTIE
+
+
+ 1. Napísaním o sa otvorí nový riadok pod kurzorom a premiestni sa kurzor
+ na vlo¾ený riadok do vkladacieho módu.
+ napísaním veµkého O sa otvorí riadok nad aktuálnym riadkom s kurzorom.
+
+ 2. Napí¹ a pre vkladanie textu ZA znak na pozícii kurzoru.
+ Napísaním veµkého A sa text automatický pridáva na koniec riadku.
+
+ 3. Napísanie veµkého R prepne do nahradzovacieho módu, kým nieje
+ stlaèené <ESC> pre ukonèenie nahradzovacieho módu.
+
+ 4. Napísanie ":set xxx" nastaví mo¾nos» "xxx".
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 7: PRÍKAZY ON-LINE NÁPOVEDY
+
+
+ ** Pou¾ívaj on-line systém nápovedy **
+
+ Vim má obsiahly on-line systém nápovedy. Pre od¹tartovanie, vyskú¹aj jeden
+ z týchto troch:
+ - stlaè klávesu <HELP> (ak nejakú má¹)
+ - stlaè klávesu <F1> (ak nejakú má¹)
+ - napí¹ :help <ENTER>
+
+ Napí¹ :q <ENTER> èím zatvorí¹ okno nápovedy.
+
+ Mô¾e¹ nájs» help ku hociakej téme pridaním argumentu ku príkazu ":help".
+ Vyskú¹aj tieto (nezabudni stlaèi» <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKCIA 8: VYTVORENIE ©TARTOVACIEHO SKRIPTU
+
+ ** Zapni funkcie editora Vim **
+
+ Vim má omnoho viac funkcii ne¾ Vi, ale veè¹ina z nich je implicitne
+ vypnutá. Pre pou¾ívanie viac Vim funkcii vytvor "vimrc" súbor.
+
+ 1. Zaèni editova» "vimrc" súbor, to závisí na pou¾itom systéme:
+ :edit ~/.vimrc pre Unix
+ :edit $VIM/_vimrc pre MS-Windows
+
+ 2. Teraz si preèítaj text príkladu "vimrc" súboru:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Ulo¾ súbor:
+
+ :write
+
+ Pri nasledujúcom ¹tarte editora Vim sa pou¾ije zvýrazòovanie syntaxe.
+ Do "vimrc" súboru mô¾e¹ prida» v¹etky svoje uprednostòované nastavenia.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Toto vymedzuje výuku Vimu. Toto je urèené pre strucný prehµad o editore
+ Vim, úplne postaèujúce pre µahké a obstojné pou¾ívanie tohto editora.
+ Táto výuka je ïaleko od kompletnosti, preto¾e Vim má omnoho viacej príkazov.
+ Ako ïal¹ie si preèítaj u¾ívatµský manuál: ":help user-manual".
+
+ Pre ïal¹ie èítanie a ¹túdium je odporúèaná kniha:
+ Vim - Vi Improved - od Steve Oualline
+ Vydavateµ: New Riders
+ Prvá kniha urèená pre Vim. ©peciálne vhodná pre zaèiatoèníkov.
+ Obsahuje mno¾stvo príkladov a obrázkov.
+ Pozri na http://iccf-holland.org/click5.html
+
+ Táto kniha je star¹ia a je viac o Vi ako o Vim, ale je tie¾ odporúèaná:
+ Learning the Vi Editor - od Linda Lamb
+ Vydavateµ: O'Reilly & Associates Inc.
+ Je to dobrá kniha pre získanie vedomostí o práci s editorom Vi.
+ ©ieste vydanie obsahuje tie¾ informácie o editore Vim.
+
+ Táto výuka bola napísaná autormi Michael C. Pierce a Robert K. Ware,
+ Colorado School of Mines s pou¾itím my¹lienok dodanými od Charles Smith,
+ Colorado State University. E-mail: bware@mines.colorado.edu.
+
+ Modifikované pre Vim od Bram Moolenaar.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Preklad do Slovenèiny: ¥ubo¹ Èelko
+ e-mail: celbos@inmail.sk
+ Last Change: 2004 Apr 29
+ Encoding: iso8859-2
diff --git a/runtime/tutor/tutor.sv b/runtime/tutor/tutor.sv
new file mode 100644
index 000000000..2ff3eb8b3
--- /dev/null
+++ b/runtime/tutor/tutor.sv
@@ -0,0 +1,830 @@
+===============================================================================
+= V ä l k o m m e n t i l l h a n d l e d n i n g e n i V i m - Ver. 1.5 =
+===============================================================================
+
+ Vim är en väldigt kraftfull redigerare som har många kommandon, alltför
+ många att förklara i en handledning som denna. Den här handledningen är
+ gjord för att förklara tillräckligt många kommandon så att du enkelt ska
+ kunna använda Vim som en redigerare för alla ändamål.
+
+ Den beräknade tiden för att slutföra denna handledning är 25-30 minuter,
+ beroende på hur mycket tid som läggs ned på experimentering.
+
+ Kommandona i lektionerna kommer att modifiera texten. Gör en kopia av den
+ här filen att öva på (om du startade "vimtutor är det här redan en kopia).
+
+ Det är viktigt att komma ihåg att den här handledningen är konstruerad
+ att lära vid användning. Det betyder att du måste köra kommandona för att
+ lära dig dem ordentligt. Om du bara läser texten så kommer du att glömma
+ kommandona!
+
+ Försäkra dig nu om att din Caps-Lock tangent INTE är aktiv och tryck på
+ j-tangenten tillräckligt många gången för att förflytta markören så att
+ Lektion 1.1 fyller skärmen skärmen helt.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.1: FLYTTA MARKÖREN
+
+
+ ** För att flytta markören, tryck på tangenterna h,j,k,l som indikerat. **
+ ^
+ k Tips:
+ < h l > h-tangenten är till vänster och flyttar till vänster.
+ j l-tangenten är till höger och flyttar till höger.
+ v j-tangenten ser ut som en pil ned.
+ 1. Flytta runt markören på skärmen tills du känner dig bekväm.
+
+ 2. Håll ned tangenten pil ned (j) tills att den repeterar.
+---> Nu vet du hur du tar dig till nästa lektion.
+
+ 3. Flytta till Lektion 1.2, med hjälp av ned tangenten.
+
+Notera: Om du är osäker på någonting du skrev, tryck <ESC> för att placera dig
+ dig i Normal-läge. Skriv sedan om kommandot.
+
+Notera: Piltangenterna borde också fungera. Men om du använder hjkl så kommer
+ du att kunna flytta omkring mycket snabbare, när du väl vant dig vid
+ det.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.2: STARTA OCH AVSLUTA VIM
+
+
+ !! NOTERA: Innan du utför någon av punkterna nedan, läs hela lektionen!!
+
+ 1. Tryck <ESC>-tangenten (för att se till att du är i Normal-läge).
+
+ 2. Skriv: :q! <ENTER>.
+
+---> Detta avslutar redigeraren UTAN att spara några ändringar du gjort.
+ Om du vill spara ändringarna och avsluta skriv:
+ :wq <ENTER>
+
+ 3. När du ser skal-prompten, skriv kommandot som tog dig in i den här
+ handledningen. Det kan vara: vimtutor <ENTER>
+ Normalt vill du använda: vim tutor <ENTER>
+
+---> 'vim' betyder öppna redigeraren vim, 'tutor' är filen du vill redigera.
+
+ 4. Om du har memorerat dessa steg och känner dig självsäker, kör då stegen
+ 1 till 3 för att avsluta och starta om redigeraren. Flytta sedan ned
+ markören till Lektion 1.3.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.3: TEXT REDIGERING - BORTTAGNING
+
+
+** När du är i Normal-läge tryck x för att ta bort tecknet under markören. **
+
+ 1. Flytta markören till raden nedan med markeringen --->.
+
+ 2. För att rätta felen, flytta markören tills den står på tecknet som ska
+ tas bort. fix the errors, move the cursor until it is on top of the
+
+ 3. Tryck på x-tangenten för att ta bort det felaktiga tecknet.
+
+ 4. Upprepa steg 2 till 4 tills meningen är korrekt.
+
+---> Kkon hoppadee övverr måånen.
+
+ 5. Nu när raden är korrekt, gå till Lektion 1.4.
+
+NOTERA: När du går igenom den här handledningen, försök inte att memorera, lär
+ genom användning.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 1.4: TEXT REDIGERING - INFOGNING
+
+
+ ** När du är i Normal-läge tryck i för att infoga text. **
+
+ 1. Flytta markören till den första raden nedan med markeringen --->.
+
+ 2. För att göra den första raden likadan som den andra, flytta markören till
+ det första tecknet EFTER där text ska infogas.
+
+ 3. Tryck i och skriv in det som saknas.
+
+ 4. När du rättat ett fel tryck <ESC> för att återgå till Normal-läge.
+ Upprepa steg 2 till 4 för att rätta meningen.
+
+---> Det sakns här .
+---> Det saknas lite text från den här raden.
+
+ 5. När du känner dig bekväm med att infoga text, gå till sammanfattningen
+ nedan.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 1 SAMMANFATTNING
+
+
+ 1. Markören flyttas genom att använda piltangenterna eller hjkl-tangenterna.
+ h (vänster) j (ned) k (upp) l (höger)
+
+ 2. För att starta Vim (från %-prompten) skriv: vim FILNAMN <ENTER>
+
+ 3. För att avsluta Vim skriv: <ESC> :q! <ENTER> för att kasta ändringar.
+ ELLER skriv: <ESC> :wq <ENTER> för att spara ändringar.
+
+ 4. För att ta bort tecknet under markören i Normal-läge skriv: x
+
+ 5. För att infoga text vid markören i Normal-läge skriv:
+ i skriv in text <ESC>
+
+NOTERA: Genom att trycka <ESC> kommer du att placeras i Normal-läge eller
+ avbryta ett delvis färdigskrivet kommando.
+
+Fortsätt nu med Lektion 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.1: BORTTAGNINGSKOMMANDON
+
+
+ ** Skriv dw för att radera till slutet av ett ord. **
+
+ 1. Tryck <ESC> för att försäkra dig om att du är i Normal-läge.
+
+ 2. Flytta markören till raden nedan markerad --->.
+
+ 3. Flytta markören till början av ett ord som måste raderas.
+
+ 4. Skriv dw för att radera ordet.
+
+ NOTERA: Bokstäverna dw kommer att synas på den sista raden på skärmen när
+ du skriver dem. Om du skrev något fel, tryck <ESC> och börja om.
+
+---> Det är ett några ord roliga att som inte hör hemma i den här meningen.
+
+ 5. Upprepa stegen 3 och 4 tills meningen är korrekt och gå till Lektion 2.2.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.2: FLER BORTTAGNINGSKOMMANDON
+
+
+ ** Skriv d$ för att radera till slutet på raden. **
+
+ 1. Tryck <ESC> för att försäkra dig om att du är i Normal-läge.
+
+ 2. Flytta markören till raden nedan markerad --->.
+
+ 3. Flytta markören till slutet på den rätta raden (EFTER den första . ).
+
+ 4. Skriv d$ för att radera till slutet på raden.
+
+---> Någon skrev slutet på den här raden två gånger. den här raden två gånger.
+
+
+ 5. Gå vidare till Lektion 2.3 för att förstå vad det är som händer.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 2.3: KOMMANDON OCH OBJEKT
+
+
+ Syntaxen för d raderingskommandot är följande:
+
+ [nummer] d objekt ELLER d [nummer] objekt
+ Var:
+ nummer - är antalet upprepningar av kommandot (valfritt, standard=1).
+ d - är kommandot för att radera.
+ objekt - är vad kommandot kommer att operera på (listade nedan).
+
+ En kort lista över objekt:
+ w - från markören till slutet av ordet, inklusive blanksteget.
+ e - från markören till slutet av ordet, EJ inklusive blanksteget.
+ $ - från markören till slutet på raden.
+
+NOTERA: För den äventyrslystne, genom att bara trycka på objektet i
+ Normal-läge (utan kommando) så kommer markören att flyttas som
+ angivet i objektlistan.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.4: ETT UNDANTAG TILL 'KOMMANDO-OBJEKT'
+
+
+ ** Skriv dd för att radera hela raden. **
+
+ På grund av hur vanligt det är att ta bort hela rader, valde upphovsmannen
+ till Vi att det skulle vara enklare att bara trycka d två gånger i rad för
+ att ta bort en rad.
+
+ 1. Flytta markören till den andra raden i frasen nedan.
+ 2. Skriv dd för att radera raden.
+ 3. Flytta nu till den fjärde raden.
+ 4. Skriv 2dd (kom ihåg: nummer-kommando-objekt) för att radera de två
+ raderna.
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 2.5: ÅNGRA-KOMMANDOT
+
+
+** Skriv u för att ångra det senaste kommandona, U för att fixa en hel rad. **
+
+ 1. Flytta markören till slutet av raden nedan markerad ---> och placera den
+ på det första felet.
+ 2. Skriv x för att radera den första felaktiga tecknet.
+ 3. Skriv nu u för att ångra det senaste körda kommandot.
+ 4. Rätta den här gången alla felen på raden med x-kommandot.
+ 5. Skriv nu U för att återställa raden till dess ursprungliga utseende.
+ 6. Skriv nu u några gånger för att ångra U och tidigare kommandon.
+ 7. Tryck nu CTRL-R (håll inne CTRL samtidigt som du trycker R) några gånger
+ för att upprepa kommandona (ångra ångringarna).
+
+---> Fiixa felen ppå deen häär meningen och återskapa dem med ångra.
+
+ 8. Det här är väldigt användbara kommandon. Gå nu vidare till
+ Lektion 2 Sammanfattning.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 2 SAMMANFATTNING
+
+
+ 1. För att radera från markören till slutet av ett ord skriv: dw
+
+ 2. För att radera från markören till slutet av en rad skriv: d$
+
+ 3. För att radera en hel rad skriv: dd
+
+ 4. Syntaxen för ett kommando i Normal-läge är:
+
+ [nummer] kommando objekt ELLER kommando [nummer] objekt
+ där:
+ nummer - är hur många gånger kommandot kommandot ska repeteras
+ kommando - är vad som ska göras, t.ex. d för att radera
+ objekt - är vad kommandot ska operera på, som t.ex. w (ord),
+ $ (till slutet av raden), etc.
+
+ 5. För att ångra tidigare kommandon, skriv: u (litet u)
+ För att ångra alla tidigare ändringar på en rad skriv: U (stort U)
+ För att ångra ångringar tryck: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.1: KLISTRA IN-KOMMANDOT
+
+
+ ** Skriv p för att klistra in den senaste raderingen efter markören. **
+
+ 1. Flytta markören till den första raden i listan nedan.
+
+ 2. Skriv dd för att radera raden och lagra den i Vims buffert.
+
+ 3. Flytta markören till raden OVANFÖR där den raderade raden borde vara.
+
+ 4. När du är i Normal-läge, skriv p för att byta ut raden.
+
+ 5. Repetera stegen 2 till 4 för att klistra in alla rader i rätt ordning.
+
+ d) Kan du lära dig också?
+ b) Violetter är blå,
+ c) Intelligens fås genom lärdom,
+ a) Rosor är röda,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lesson 3.2: ERSÄTT-KOMMANDOT
+
+
+ ** Skriv r och ett tecken för att ersätta tecknet under markören. **
+
+ 1. Flytta markören till den första raden nedan markerad --->.
+
+ 2. Flytta markören så att den står på det första felet.
+
+ 3. Skriv r och sedan det tecken som borde ersätta felet.
+
+ 4. Repetera steg 2 och 3 tills den första raden är korrekt.
+
+---> När drn här ruden skrevs, trickte någon på fil knappar!
+---> När den här raden skrevs, tryckte någon på fel knappar!
+
+ 5. Gå nu vidare till Lektion 3.2.
+
+NOTERA: Kom ihåg att du skall lära dig genom användning, inte genom memorering.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.3: ÄNDRA-KOMMANDOT
+
+
+ ** För att ändra en del eller ett helt ord, skriv cw . **
+
+ 1. Flytta markören till den första redan nedan markerad --->.
+
+ 2. Placera markören på d i rdrtn.
+
+ 3. Skriv cw och det rätta ordet (i det här fallet, skriv "aden".)
+
+ 4. Tryck <ESC> och flytta markören till nästa fel (det första tecknet som
+ ska ändras.)
+
+ 5. Repetera steg 3 och 4 tills den första raden är likadan som den andra.
+
+---> Den här rdrtn har några otf som brhotrt ändras mrf ändra-komjendit.
+---> Den här raden har några ord som behöver ändras med ändra-kommandot.
+
+Notera att cw inte bara ändrar ordet, utan även placerar dig i infogningsläge.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 3.4: FLER ÄNDRINGAR MED c
+
+
+ ** Ändra-kommandot används på samma objekt som radera. **
+
+ 1. Ändra-kommandot fungerar på samma sätt som radera. Syntaxen är:
+
+ [nummer] c objekt ELLER c [nummer] objekt
+
+ 2. Objekten är också de samma, som t.ex. w (ord), $ (slutet av raden), etc.
+
+ 3. Flytta till den första raden nedan markerad -->.
+
+ 4. Flytta markören till det första felet.
+
+ 5. Skriv c$ för att göra resten av raden likadan som den andra och tryck
+ <ESC>.
+
+---> Slutet på den här raden behöver hjälp med att få den att likna den andra.
+---> Slutet på den här raden behöver rättas till med c$-kommandot.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 3 SAMMANFATTNING
+
+
+ 1. För att ersätta text som redan har blivit raderad, skriv p .
+ Detta klistrar in den raderade texten EFTER markören (om en rad raderades
+ kommer den att hamna på raden under markören.
+
+ 2. För att ersätta tecknet under markören, skriv r och sedan tecknet som
+ kommer att ersätta orginalet.
+
+ 3. Ändra-kommandot låter dig ändra det angivna objektet från markören till
+ slutet på objektet. eg. Skriv cw för att ändra från markören till slutet
+ på ordet, c$ för att ändra till slutet på en rad.
+
+ 4. Syntaxen för ändra-kommandot är:
+
+ [nummer] c objekt ELLER c [nummer] objekt
+
+Gå nu till nästa lektion.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.1: POSITION OCH FILSTATUS
+
+
+ ** Tryck CTRL-g för att visa din position i filen och filstatusen.
+ Tryck SHIFT-G för att flytta till en rad i filen. **
+
+ Notera: Läsa hela den lektion innan du utför något av stegen!!
+
+ 1. Håll ned Ctrl-tangenten och tryck g . En statusrad med filnamn och raden
+ du befinner dig på kommer att synas. Kom ihåg radnummret till Steg 3.
+
+ 2. Tryck shift-G för att flytta markören till slutet på filen.
+
+ 3. Skriv in nummret på raden du var på och tryck sedan shift-G. Detta kommer
+ att ta dig tillbaka till raden du var på när du först tryckte Ctrl-g.
+ (När du skriver in nummren, kommer de INTE att visas på skärmen.)
+
+ 4. Om du känner dig säker på det här, utför steg 1 till 3.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.2: SÖK-KOMMANDOT
+
+
+ ** Skriv / följt av en fras för att söka efter frasen. **
+
+ 1. I Normal-läge skriv /-tecknet. Notera att det och markören blir synlig
+ längst ned på skärmen precis som med :-kommandot.
+
+ 2. Skriv nu "feeel" <ENTER>. Det här är ordet du vill söka efter.
+
+ 3. För att söka efter samma fras igen, tryck helt enkelt n .
+ För att söka efter samma fras igen i motsatt riktning, tryck Shift-N .
+
+ 4. Om du vill söka efter en fras bakåt i filen, använd kommandot ? istället
+ för /.
+
+---> "feeel" är inte rätt sätt att stava fel: feeel är ett fel.
+
+Notera: När sökningen når slutet på filen kommer den att fortsätta vid början.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.3: SÖKNING EFTER MATCHANDE PARENTESER
+
+
+ ** Skriv % för att hitta en matchande ),], or } . **
+
+ 1. Placera markören på någon av (, [, or { på raden nedan markerad --->.
+
+ 2. Skriv nu %-tecknet.
+
+ 3. Markören borde vara på den matchande parentesen eller hakparentesen.
+
+ 4. Skriv % för att flytta markören tillbaka till den första hakparentesen
+ (med matchning).
+
+---> Det ( här är en testrad med (, [ ] och { } i den. ))
+
+Notera: Det här är väldigt användbart vid avlusning av ett program med icke
+ matchande parenteser!
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 4.4: ETT SÄTT ATT ÄNDRA FEL
+
+
+ ** Skriv :s/gammalt/nytt/g för att ersätta "gammalt" med "nytt". **
+
+ 1. Flytta markören till raden nedan markerad --->.
+
+ 2. Skriv :s/denn/den <ENTER> . Notera att det här kommandot bara ändrar den
+ första förekomsten på raden.
+
+ 3. Skriv nu :s/denn/den/g vilket betyder ersätt globalt på raden.
+ Det ändrar alla förekomster på raden.
+
+---> denn bästa tiden att se blommor blomma är denn på våren.
+
+ 4. För att ändra alla förekomster av en teckensträng mellan två rader,
+ skriv :#,#s/gammalt/nytt/g där #,# är de två radernas radnummer.
+ Skriv :%s/gammtl/nytt/g för att ändra varje förekomst i hela filen.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 4 SAMMANFATTNING
+
+
+ 1. Ctrl-g visar din position i filen och filstatusen.
+ Shift-G flyttar till slutet av filen. Ett radnummer följt Shift-G
+ flyttar till det radnummret.
+
+ 2. Skriver man / följt av en fras söks det FRAMMÅT efter frasen.
+ Skriver man ? följt av en fras söks det BAKÅT efter frasen.
+ Efter en sökning skriv n för att hitta nästa förekomst i samma riktning
+ eller Shift-N för att söka i den motsatta riktningen.
+
+ 3. Skriver man % när markören är på ett (,),[,],{, eller } hittas dess
+ matchande par.
+
+ 4. För att ersätta den första gammalt med nytt på en rad skriv :s/gammlt/nytt
+ För att ersätta alla gammlt med nytt på en rad skriv :s/gammlt/nytt/g
+ För att ersätta fraser mellan rad # och rad # skriv :#,#s/gammlt/nytt/g
+ För att ersätta alla förekomster i filen skriv :%s/gammlt/nytt/g
+ För att bekräfta varje gång lägg till "c" :%s/gammlt/nytt/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.1: HUR MAN KÖR ETT EXTERNT KOMMANDO
+
+
+ ** Skriv :! följt av ett externt kommando för att köra det kommandot. **
+
+ 1. Skriv det välbekanta kommandot : för att placera markören längst ned
+ på skärmen på skärmen. Detta låter dig skriva in ett kommando.
+
+ 2. Skriv nu ! (utropstecken). Detta låter dig köra ett godtyckligt externt
+ skalkommando.
+
+ 3. Som ett exempel skriv ls efter ! och tryck sedan <ENTER>. Detta kommer
+ att visa dig en listning av din katalog, precis som om du kört det vid
+ skalprompten. Använd :!dir om ls inte fungerar.
+
+Notera: Det är möjligt att köra vilket externt kommando som helst på det här
+ sättet.
+
+Notera: Alla :-kommandon måste avslutas med att trycka på <ENTER>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.2: MER OM ATT SPARA FILER
+
+
+ ** För att spara ändringar gjorda i en fil, skriv :w FILNAMN. **
+
+ 1. Skriv :!dir eller :!ls för att få en listning av din katalog.
+ Du vet redan att du måste trycka <ENTER> efter det här.
+
+ 2. Välj ett filnamn som inte redan existerar, som t.ex. TEST.
+
+ 3. Skriv nu: :w TEST (där TEST är filnamnet du valt.)
+
+ 4. Det här sparar hela filen (Vim handledningen) under namnet TEST.
+ För att verifiera detta, skriv :!dir igen för att se din katalog
+
+Notera: Om du skulle avsluta Vim och sedan öppna igen med filnamnet TEST så
+ skulle filen vara en exakt kopia av handledningen när du sparade den.
+
+ 5. Ta nu bort filen genom att skriva (MS-DOS): :!del TEST
+ eller (Unix): :!rm TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.3: ETT SELEKTIVT SPARA-KOMMANDO
+
+
+ ** För att spara en del av en fil, skriv :#,# w FILNAMN **
+
+ 1. Ännu en gång, skriv :!dir eller :!ls för att få en listning av din
+ katalog och välj ett passande filnamn som t.ex. TEST.
+
+ 2. Flytta markören högst upp på den här sidan och tryck Ctrl-g för att få
+ reda på radnumret på den raden. KOM IHÅG DET NUMMRET!
+
+ 3. Flytta nu längst ned på sidan och skriv Ctrl-g igen.
+ KOM IHÅG DET RADNUMMRET OCKSÅ!
+
+ 4. För att BARA spara en sektion till en fil, skriv :#,# w TEST
+ där #,# är de två nummren du kom ihåg (toppen, botten) och TEST är
+ ditt filnamn.
+
+ 5. Ännu en gång, kolla så att filen är där med :!dir men radera den INTE.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 5.4: TA EMOT OCH FÖRENA FILER
+
+
+ ** För att infoga innehållet av en fil, skriv :r FILNAMN **
+
+ 1. Skriv :!dir för att försäkra dig om att TEST-filen från tidigare
+ fortfarande är kvar.
+
+ 2. Placera markören högst upp på den här sidan.
+
+NOTERA: Efter att du kört Steg 3 kommer du att se Lektion 5.3.
+ Flytta då NED till den här lektionen igen.
+
+ 3. Ta nu emot din TEST-fil med kommandot :r TEST där TEST är namnet på
+ filen.
+
+NOTERA: Filen du tar emot placeras där markören är placerad.
+
+ 4. För att verifiera att filen togs emot, gå tillbaka och notera att det nu
+ finns två kopior av Lektion 5.3, orginalet och filversionen.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 5 SAMMANFATTNING
+
+
+ 1. :!kommando kör ett externt kommando.
+
+ Några användbara exempel är:
+ (MS-DOS) (Unix)
+ :!dir :!ls - visar en kataloglistning.
+ :!del FILNAMN :!rm FILNAMN - tar bort filen FILNAMN.
+
+ 2. :w FILNAMN sparar den aktuella Vim-filen med namnet FILNAMN.
+
+ 3. :#,#w FILNAMN sparar raderna # till # i filen FILNAMN.
+
+ 4. :r FILNAMN tar emot filen FILNAMN och infogar den i den aktuella filen
+ efter markören.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.1: ÖPPNA-KOMMANDOT
+
+
+ ** Skriv o för att öppna en rad under markören och placera dig i
+ Infoga-läge. **
+
+ 1. Flytta markören till raden nedan markerad --->.
+
+ 2. Skriv o (litet o) för att öppna upp en rad NEDANFÖR markören och placera
+ dig i Infoga-mode.
+
+ 3. Kopiera nu raden markerad ---> och tryck <ESC> för att avsluta
+ Infoga-läget.
+
+---> Efter du skrivit o placerad markören på en öppen rad i Infoga-läge.
+
+ 4. För att öppna upp en rad OVANFÖR markören, skriv ett stort O , istället
+ för ett litet o. Pröva detta på raden nedan.
+Öppna upp en rad ovanför denna genom att trycka Shift-O när markören står här.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.2: LÄGG TILL-KOMMANDOT
+
+
+ ** Skriv a för att infoga text EFTER markören. **
+
+ 1. Flytta markören till slutet av den första raden nedan markerad ---> genom
+ att skriv $ i Normal-läge.
+
+ 2. Skriv ett a (litet a) för att lägga till text EFTER tecknet under
+ markören. (Stort A lägger till i slutet av raden.)
+
+Notera: Detta undviker att behöva skriva i , det sista tecknet, texten att
+ infoga, <ESC>, högerpil, och slutligen, x, bara för att lägga till i
+ slutet på en rad!
+
+ 3. Gör nu färdigt den första raden. Notera också att lägga till är likadant
+ som Infoga-läge, enda skillnaden är positionen där texten blir infogad.
+
+---> Här kan du träna
+---> Här kan du träna på att lägga till text i slutet på en rad.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.3: EN ANNAN VERSION AV ERSÄTT
+
+
+ ** Skriv ett stort R för att ersätta fler än ett tecken. **
+
+ 1. Flytta markören till den första raden nedan markerad --->.
+
+ 2. Placera markören vid början av det första ordet som är annorlunda jämfört
+ med den andra raden markerad ---> (ordet "sista").
+
+ 3. Skriv nu R och ersätt resten av texten på den första raden genom att
+ skriva över den gamla texten så att den första raden blir likadan som
+ den andra.
+
+---> För att få den första raden lika som den sista, använd tangenterna.
+---> För att få den första raden lika som den andra, skriv R och den nya texten.
+
+ 4. Notera att när du trycker <ESC> för att avsluta, så blir eventuell
+ oförändrad text kvar.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lektion 6.4: SÄTT FLAGGOR
+
+ ** Sätt en flagga så att en sökning eller ersättning ignorerar storlek **
+
+ 1. Sök efter "ignore" genom att skriva:
+ /ignore
+ Repetera flera gånger genom att trycka på n-tangenten
+
+ 2. Sätt 'ic' (Ignore Case) flaggan genom att skriva:
+ :set ic
+
+ 3. Sök nu efter "ignore" igen genom att trycka: n
+ Repeat search several more times by hitting the n key
+
+ 4. Sätt 'hlsearch' and 'incsearch' flaggorna:
+ :set hls is
+
+ 5. Skriv nu in sök-kommandot igen, och se vad som händer:
+ /ignore
+
+ 6. För att ta bort framhävningen av träffar, skriv
+ :nohlsearch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 6 SAMMANFATTNING
+
+
+ 1. Genom att skriva o öpnnas en rad NEDANFÖR markören och markören placeras
+ på den öppna raden i Infoga-läge.
+ Genom att skriva ett stort O öppnas raden OVANFÖR raden som markören är
+ på.
+
+ 2. Skriv ett a för att infoga text EFTER tecknet som markören står på.
+ Genom att skriva ett stort A läggs text automatiskt till i slutet på
+ raden.
+
+ 3. Genom att skriva ett stort R hamnar du i Ersätt-läge till <ESC> trycks
+ för att avsluta.
+
+ 4. Genom att skriva ":set xxx" sätts flaggan "xxx"
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 7: ON-LINE HJÄLP-KOMMANDON
+
+
+ ** Använd on-line hjälpsystemet **
+
+ Vim har ett omfattande on-line hjälpsystem. För att komma igång pröva ett av
+ dessa tre:
+ - tryck <HELP> tangenten (om du har någon)
+ - tryck <F1> tangenten (om du har någon)
+ - skriv :help <ENTER>
+
+ Skriv :q <ENTER> för att stränga hjälpfönstret.
+
+ Du kan hitta hjälp om nästan allting, genom att ge ett argument till
+ ":help" kommandot. Pröva dessa (glöm inte att trycka <ENTER>):
+
+ :help w
+ :help c_<T
+ :help insert-index
+ :help user-manual
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKTION 8: SKAPA ETT UPPSTARTSSKRIPT
+
+ ** Aktivera Vim- funktioner **
+
+ Vim har många fler funktioner än Vi, men de flesta av dem är inaktiverade som
+ standard. För att börja använda fler funktioner måste du skapa en "vimrc"-fil.
+
+ 1. Börja redigera "vimrc"-filen, detta beror på ditt system:
+ :edit ~/.vimrc för Unix
+ :edit $VIM/_vimrc för MS-Windows
+
+ 2. Läs nu texten i exempel "vimrc"-filen:
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. Spara filen med:
+
+ :write
+
+ Nästa gång du startar Vim kommer den att använda syntaxframhävning.
+ Du kan lägga till alla inställningar du föredrar till den här "vimrc"-filen.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Detta avslutar handledningen i Vim. Den var avsedd att ge en kort översikt av
+ redigeraren Vim, bara tillräckligt för att du ska kunna använda redigeraren
+ relativt enkelt. Den är långt ifrån komplett eftersom Vim har många många fler
+ kommandon. Läs användarmanualen härnäst: ":help user-manual".
+
+ För vidare läsning rekommenderas den här boken:
+ Vim - Vi Improved - av Steve Oualline
+ Förlag: New Riders
+ Den första boken som är endast behandlar Vim. Speciellt användbar för
+ nybörjare. Det finns många exempel och bilder.
+ Se http://iccf-holland.org/click5.html
+
+ Den här boken är äldre och behandlar mer Vi än Vim, men rekommenderas också:
+ Learning the Vi Editor - av Linda Lamb
+ Förlag: O'Reilly & Associates Inc.
+ Det är en bra bok för att lära sig nästan allt som du vill kunna göra med Vi.
+ Den sjätte upplagan inkluderar också information om Vim.
+
+ Den här handledningen är skriven av Michael C. Pierce och Robert K. Ware,
+ Colorado School of Mines med idéer från Charles Smith,
+ Colorado State University. E-post: bware@mines.colorado.edu.
+
+ Modifierad för Vim av Bram Moolenaar.
+ Översatt av Johan Svedberg <johan@svedberg.pp.se>
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim
new file mode 100644
index 000000000..0edbf61b8
--- /dev/null
+++ b/runtime/tutor/tutor.vim
@@ -0,0 +1,119 @@
+" Vim tutor support file
+" Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
+" Last Change: 2004 Jun 03
+
+" This small source file is used for detecting if a translation of the
+" tutor file exist, i.e., a tutor.xx file, where xx is the language.
+" If the translation does not exist, or no extension is given,
+" it defaults to the english version.
+
+" It is invoked by the vimtutor shell script.
+
+" 1. Build the extension of the file, if any:
+let s:ext = ""
+if strlen($xx) > 1
+ let s:ext = "." . $xx
+else
+ let s:lang = ""
+ if exists("v:lang") && v:lang != "C"
+ let s:lang = v:lang
+ elseif strlen($LANG) > 0 && $LANG != "C"
+ let s:lang = $LANG
+ endif
+ if s:lang != ""
+ " Remove "@euro" (ignoring case), it may be at the end
+ let s:lang = substitute(s:lang, '\c@euro', '', '')
+ " On MS-Windows it may be German_Germany.1252 or Polish_Poland.1250. How
+ " about other languages?
+ if s:lang =~ "German"
+ let s:ext = ".de"
+ elseif s:lang =~ "Polish"
+ let s:ext = ".pl"
+ elseif s:lang =~ "Slovak"
+ let s:ext = ".sk"
+ else
+ let s:ext = "." . strpart(s:lang, 0, 2)
+ endif
+ endif
+endif
+
+" The japanese tutor is available in two encodings, guess which one to use
+" The "sjis" one is actually "cp932", it doesn't matter for this text.
+if s:ext =~? '\.ja'
+ if &enc =~ "euc"
+ let s:ext = ".ja.euc"
+ elseif &enc =~ "utf-8$"
+ let s:ext = ".ja.utf-8"
+ else
+ let s:ext = ".ja.sjis"
+ endif
+endif
+
+" The korean tutor is available in two encodings, guess which one to use
+if s:ext =~? '\.ko'
+ if &enc =~ "utf-8$"
+ let s:ext = ".ko.utf-8"
+ else
+ let s:ext = ".ko.euc"
+ endif
+endif
+
+" The Chinese tutor is available in two encodings, guess which one to use
+" This segment is from the above lines and modified by
+" Mendel L Chan <beos@turbolinux.com.cn> for Chinese vim tutorial
+if s:ext =~? '\.zh'
+ if &enc =~ 'big5\|cp950'
+ let s:ext = ".zh.big5"
+ else
+ let s:ext = ".zh.euc"
+ endif
+endif
+
+" The Polish tutor is available in two encodings, guess which one to use.
+if s:ext =~? '\.pl' && &enc =~ 1250
+ let s:ext = ".pl.cp1250"
+endif
+
+" The Greek tutor is available in two encodings, guess which one to use
+if s:ext =~? '\.gr' && &enc =~ 737
+ let s:ext = ".gr.cp737"
+endif
+
+" The Slovak tutor is available in two encodings, guess which one to use
+if s:ext =~? '\.sk' && &enc =~ 1250
+ let s:ext = ".sk.cp1250"
+endif
+
+" The Russian tutor is available in two encodings, guess which one to use.
+" This segment is from the above lines and modified by
+" Alexey I. Froloff <raorn@altlinux.org> for Russian vim tutorial
+if s:ext =~? '\.ru' && &enc =~ 1251
+ let s:ext = ".ru.cp1251"
+endif
+
+" Somehow ".ge" (Germany) is sometimes used for ".de" (Deutsch).
+if s:ext =~? '\.ge'
+ let s:ext = ".de"
+endif
+
+if s:ext =~? '\.en'
+ let s:ext = ""
+endif
+
+" 2. Build the name of the file:
+let s:tutorfile = "/tutor/tutor"
+let s:tutorxx = $VIMRUNTIME . s:tutorfile . s:ext
+
+" 3. Finding the file:
+if filereadable(s:tutorxx)
+ let $TUTOR = s:tutorxx
+else
+ let $TUTOR = $VIMRUNTIME . s:tutorfile
+ echo "The file " . s:tutorxx . " does not exist.\n"
+ echo "Copying English version: " . $TUTOR
+ 4sleep
+endif
+
+" 4. Making the copy and exiting Vim:
+e $TUTOR
+wq! $TUTORCOPY
diff --git a/runtime/tutor/tutor.zh.big5 b/runtime/tutor/tutor.zh.big5
new file mode 100644
index 000000000..4daad6470
--- /dev/null
+++ b/runtime/tutor/tutor.zh.big5
@@ -0,0 +1,852 @@
+===============================================================================
+= Åw ªï ¾\ Ū ¡m V I M ±Ð µ{ ¡n ¢w¢w ª©¥» 1.5 =
+===============================================================================
+ vim ¬O¤@­Ó¨ã¦³«Ü¦h©R¥Oªº¥\¯à«D±`±j¤jªº½s¿è¾¹¡C­­¤_½g´T¡A¦b¥»±Ðµ{·í¤¤
+ ¤£´N¸Ô²Ó¤¶²Ð¤F¡C¥»±Ðµ{ªº³]­p¥Ø¼Ð¬OÁ¿­z¤@¨Ç¥²­nªº°ò¥»©R¥O¡A¦Ó´x´¤¦n³o
+ ¨Ç©R¥O¡A±z´N¯à°÷«Ü®e©ö±Nvim·í§@¤@­Ó³q¥Îªº¸U¯à½s¿è¾¹¨Ó¨Ï¥Î¤F¡C
+
+ §¹¦¨¥»±Ðµ{ªº¤º®e¤j¬ù»Ý­n25-30¤ÀÄÁ¡A¨ú¨M¤_±z°V½mªº®É¶¡¡C
+
+ ¨C¤@¸`ªº©R¥O¾Þ§@±N·|§ó§ï¥»¤å¡C±ÀÂ˱z´_¨î¥»¤åªº¤@­Ó°Æ¥»¡AµM«á¦b°Æ¥»¤W
+ ¶i¦æ°V½m(¦pªG±z¬O³q¹L"vimtutor"¨Ó±Ò°Ê±Ðµ{ªº¡A¨º»ò¥»¤å´N¤w¸g¬O°Æ¥»¤F)¡C
+
+ ¤Á°O¤@ÂI¡J¥»±Ðµ{ªº³]­p«ä¸ô¬O¦b¨Ï¥Î¤¤¶i¦æ¾Ç²ßªº¡C¤]´N¬O»¡¡A±z»Ý­n³q¹L
+ °õ¦æ©R¥O¨Ó¾Ç²ß¥¦­Ì¥»¨­ªº¥¿½T¥Îªk¡C¦pªG±z¥u¬O¾\Ū¦Ó¤£¾Þ§@¡A¨º»ò±z¥i¯à
+ ·|«Ü§Ö¿ò§Ñ³o¨Ç©R¥Oªº¡I
+
+ ¦n¤F¡A²{¦b½Ð½T©w±zªºShift-Lock(¤j¤p¼gÂê©wÁä)ÁÙ¨S¦³«ö¤U¡AµM«á«öÁä½L¤W
+ ªº¦r¥ÀÁä j ¨¬°÷¦hªº¦¸¼Æ¨Ó²¾°Ê¥ú¼Ð¡Aª½¨ì²Ä¤@¸`ªº¤º®e¯à°÷§¹¥þ¥Rº¡«Ì¹õ¡C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤@Á¿²Ä¤@¸`¡J²¾°Ê¥ú¼Ð
+
+
+ ¡°¡° ­n²¾°Ê¥ú¼Ð¡A½Ð¨Ì·Ó»¡©ú¤À§O«ö¤U h¡Bj¡Bk¡Bl Áä¡C ¡°¡°
+
+ ^
+ k ´£¥Ü¡J h ªºÁä¦ì¤_¥ªÃä¡A¨C¦¸«ö¤U´N·|¦V¥ª²¾°Ê¡C
+ < h l > l ªºÁä¦ì¤_¥kÃä¡A¨C¦¸«ö¤U´N·|¦V¥k²¾°Ê¡C
+ j j Áä¬Ý°_¨Ó«Ü¶H¤@¤ä¦yºÝ¤è¦V´Â¤Uªº½bÀY¡C
+ v
+
+ 1. ½ÐÀH·N¦b«Ì¹õ¤º²¾°Ê¥ú¼Ð¡Aª½¦Ü±zı±oµÎªA¬°¤î¡C
+
+ 2. «ö¤U¤U¦æÁä(j)¡Aª½¨ì¥X²{¥ú¼Ð­«´_¤U¦æ¡C
+
+---> ²{¦b±zÀ³¸Ó¤w¸g¾Ç·|¦p¦ó²¾°Ê¨ì¤U¤@Á¿§a¡C
+
+ 3. ²{¦b½Ð¨Ï¥Î¤U¦æÁä¡A±N¥ú¼Ð²¾°Ê¨ì²Ä¤GÁ¿¡C
+
+´£¥Ü¡J¦pªG±z¤£´±½T©w±z©Ò«ö¤Uªº¦r¥À¡A½Ð«ö¤U<ESC>Áä¦^¨ì¥¿±`(Normal)¼Ò¦¡¡C
+ µM«á¦A¦¸±qÁä½L¿é¤J±z·Q­nªº©R¥O¡C
+
+´£¥Ü¡J¥ú¼ÐÁäÀ³·í¤]¯à¥¿±`¤u§@ªº¡C¦ý¬O¨Ï¥ÎhjklÁä¡A¦b²ßºD¤§«á±z´N¯à°÷§Ö³t
+ ¦a¦b«Ì¹õ¤º¥|³B²¾°Ê¥ú¼Ð¤F¡C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤@Á¿²Ä¤G¸`¡JVIMªº¶i¤J©M°h¥X
+
+
+ !! ¯S§O´£¥Ü¡J·q½Ð¾\Ū§¹¾ã¥»¤@¸`ªº¤º®e¡AµM«á¤~¯à°õ¦æ¥H¤U©ÒÁ¿¸Ñªº©R¥O¡C
+
+ 1. ½Ð«ö<ESC>Áä(³o¬O¬°¤F½T«O±z³B¦b¥¿±`¼Ò¦¡)¡C
+
+ 2. µM«á¿é¤J¡J :q! <¦^¨®>
+
+---> ³oºØ¤è¦¡ªº°h¥X½s¿è¾¹µ´¤£·|«O¦s±z¶i¤J½s¿è¾¹¥H¨Ó©Ò°µªº§ï°Ê¡C
+ ¦pªG±z·Q«O¦s§ó§ï¦A°h¥X¡A½Ð¿é¤J¡J
+ :wq <¦^¨®>
+
+ 3. ¦pªG±z¬Ý¨ì¤F©R¥O¦æ´£¥Ü²Å¡A½Ð¿é¤J¯à°÷±a±z¦^¨ì¥»±Ðµ{ªº©R¥O¡A¨º´N¬O¡J
+
+ vimtutor <¦^¨®>
+
+ ³q±`±¡ªp¤U±z¤]¥i¥H¥Î³oºØ¤è¦¡¡J
+
+ vim tutor <¦^¨®>
+
+---> ³o¸Ìªº 'vim' ªí¥Ü¶i¤Jvim½s¿è¾¹¡A¦Ó 'tutor'«h¬O±z·Ç³Æ­n½s¿èªº¤å¥ó¡C
+
+ 4. ¦pªG±z¦Û«H¤w¸g¨c¨c°O¦í¤F³o¨Ç¨BÆJªº¸Ü¡A½Ð±q¨BÆJ1°õ¦æ¨ì¨BÆJ3°h¥X¡AµM
+ «á¦A¦¸¶i¤J½s¿è¾¹¡C±µµÛ±N¥ú¼Ð²¾°Ê¨ì²Ä¤@Á¿²Ä¤T¸`¨ÓÄ~Äò§Ú­Ìªº±Ðµ{Á¿¸Ñ¡C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤@Á¿²Ä¤T¸`¡J¤å¥»½s¿è¤§§R°£
+
+
+ ** ¦b¥¿±`(Normal)¼Ò¦¡¤U¡A¥i¥H«ö¤U x Áä¨Ó§R°£¥ú¼Ð©Ò¦b¦ì¸mªº¦r²Å¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡C
+
+ 2. ¬°¤F­×¥¿¿é¤J¿ù»~¡A½Ð±N¥ú¼Ð²¾¦Ü·Ç³Æ§R°£ªº¦r²Åªº¦ì¸m³B¡C
+
+ 3. µM«á«ö¤U x Áä±N¿ù»~¦r²Å§R°£±¼¡C
+
+ 4. ­«´_¨BÆJ2¨ì¨BÆJ4¡Aª½¨ì¥y¤l­×¥¿¬°¤î¡C
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. ¦n¤F¡A¸Ó¦æ¤w¸g­×¥¿¤F¡A¤U¤@¸`¤º®e¬O²Ä¤@Á¿²Ä¥|¸`¡C
+
+¯S§O´£¥Ü¡J¦b±zÂsÄý¥»±Ðµ{®É¡A¤£­n±j¦æ°O¾Ð¡C°O¦í¤@ÂI¡J¦b¨Ï¥Î¤¤¾Ç²ß¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤@Á¿²Ä¥|¸`¡J¤å¥»½s¿è¤§´¡¤J
+
+
+ ** ¦b¥¿±`¼Ò¦¡¤U¡A¥i¥H«ö¤U i Áä¨Ó´¡¤J¤å¥»¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ¡C
+
+ 2. ¬°¤F¨Ï±o²Ä¤@¦æ¤º®e¹p¦P¤_²Ä¤G¦æ¡A½Ð±N¥ú¼Ð²¾¦Ü¤å¥»²Ä¤@­Ó¦r²Å·Ç³Æ´¡¤J
+ ªº¦ì¸m¡C
+
+ 3. µM«á«ö¤U i Áä¡A±µµÛ¿é¤J¥²­nªº¤å¥»¦r²Å¡C
+
+ 4. ©Ò¦³¤å¥»³£­×¥¿§¹²¦¡A½Ð«ö¤U <ESC> Áäªð¦^¥¿±`¼Ò¦¡¡C
+ ­«´_¨BÆJ2¦Ü¨BÆJ4¥H«K­×¥¿¥y¤l¡C
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. ¦pªG±z¹ï¤å¥»´¡¤J¾Þ§@¤w¸g«Üº¡·N¡A½Ð±µµÛ¾\Ū¤U­±ªº¤pµ²¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤@Á¿¤pµ²
+
+
+ 1. ¥ú¼Ð¦b«Ì¹õ¤å¥»¤¤ªº²¾°Ê¬J¥i¥H¥Î½bÀYÁä¡A¤]¥i¥H¨Ï¥Î hjkl ¦r¥ÀÁä¡C
+ h (¥ª²¾) j (¤U¦æ) k (¤W¦æ) l (¥k²¾)
+
+ 2. ±ý¶i¤Jvim½s¿è¾¹(±q©R¥O¦æ´£¥Ü²Å)¡A½Ð¿é¤J¡Jvim ¤å¥ó¦W <¦^¨®>
+
+ 3. ±ý°h¥Xvim½s¿è¾¹¡A½Ð¿é¤J¥H¤U©R¥O©ñ±ó©Ò¦³­×§ï¡J
+
+ <ESC> :q! <¦^¨®>
+
+ ©ÎªÌ¿é¤J¥H¤U©R¥O«O¦s©Ò¦³­×§ï¡J
+
+ <ESC> :wq <¦^¨®>
+
+ 4. ¦b¥¿±`¼Ò¦¡¤U§R°£¥ú¼Ð©Ò¦b¦ì¸mªº¦r²Å¡A½Ð«ö¡J x
+
+ 5. ¦b¥¿±`¼Ò¦¡¤U­n¦b¥ú¼Ð©Ò¦b¦ì¸m¶}©l´¡¤J¤å¥»¡A½Ð«ö¡J
+
+ i ¿é¤J¥²­n¤å¥» <ESC>
+
+¯S§O´£¥Ü¡J«ö¤U <ESC> Áä·|±a±z¦^¨ì¥¿±`¼Ò¦¡©ÎªÌ¨ú®ø¤@­Ó¤£´Á±æ©ÎªÌ³¡¤À§¹¦¨
+ªº©R¥O¡C
+
+¦n¤F¡A²Ä¤@Á¿¨ì¦¹µ²§ô¡C¤U­±±µ¤U¨ÓÄ~Äò²Ä¤GÁ¿ªº¤º®e¡C
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿²Ä¤@¸`¡J§R°£Ãþ©R¥O
+
+
+ ** ¿é¤J dw ¥i¥H±q¥ú¼Ð³B§R°£¦Ü¤@­Ó³æ¦r/³æµüªº¥½§À¡C**
+
+ 1. ½Ð«ö¤U <ESC> Áä½T«O±z³B¤_¥¿±`¼Ò¦¡¡C
+
+ 2. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡C
+
+ 3. ½Ð±N¥ú¼Ð²¾¦Ü·Ç³Æ­n§R°£ªº³æµüªº¶}©l¡C
+
+ 4. ±µµÛ¿é¤J dw §R°£±¼¸Ó³æµü¡C
+
+ ¯S§O´£¥Ü¡J±z©Ò¿é¤Jªº dw ·|¦b±z¿é¤Jªº¦P®É¥X²{¦b«Ì¹õªº³Ì«á¤@¦æ¡C¦pªG±z¿é
+ ¤J¦³»~¡A½Ð«ö¤U <ESC> Áä¨ú®ø¡AµM«á­«·s¦A¨Ó¡C
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. ­«´_¨BÆJ3¦Ü¨BÆJ4¡Aª½¦Ü¥y¤l­×¥¿§¹²¦¡C±µµÛÄ~Äò²Ä¤GÁ¿²Ä¤G¸`¤º®e¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿²Ä¤G¸`¡J¨ä¥L§R°£Ãþ©R¥O
+
+
+ ** ¿é¤J d$ ±q·í«e¥ú¼Ð§R°£¨ì¦æ¥½¡C**
+
+ 1. ½Ð«ö¤U <ESC> Áä½T«O±z³B¤_¥¿±`¼Ò¦¡¡C
+
+ 2. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡C
+
+ 3. ½Ð±N¥ú¼Ð²¾°Ê¨ì¸Ó¦æªº§À³¡(¤]´N¬O¦b²Ä¤@­ÓÂI¸¹¡¥.¡¦«á­±)¡C
+
+ 4. µM«á¿é¤J d$ ±q¥ú¼Ð³B§R¦Ü·í«e¦æ§À³¡¡C
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+
+ 5. ½ÐÄ~Äò¾Ç²ß²Ä¤GÁ¿²Ä¤T¸`´Nª¾¹D¬O«ç»ò¦^¨Æ¤F¡C
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿²Ä¤T¸`¡JÃö¤_©R¥O©M¹ï¶H
+
+
+ §R°£©R¥O d ªº®æ¦¡¦p¤U¡J
+
+ [number] d object ©ÎªÌ d [number] object
+
+ ¨ä·N¦p¤U¡J
+ number - ¥Nªí°õ¦æ©R¥Oªº¦¸¼Æ(¥i¿ï¶µ¡A¯Ê¬Ù³]¸m¬° 1 )¡C
+ d - ¥Nªí§R°£¡C
+ object - ¥Nªí©R¥O©Ò­n¾Þ§@ªº¹ï¶H(¤U­±¦³¬ÛÃö¤¶²Ð)¡C
+
+ ¤@­Ó²µuªº¹ï¶H¦Cªí¡J
+ w - ±q·í«e¥ú¼Ð·í«e¦ì¸mª½¨ì³æ¦r/³æµü¥½§À¡A¥]¬AªÅ®æ¡C
+ e - ±q·í«e¥ú¼Ð·í«e¦ì¸mª½¨ì³æ¦r/³æµü¥½§À¡A¦ý¬O *¤£* ¥]¬AªÅ®æ¡C
+ $ - ±q·í«e¥ú¼Ð·í«e¦ì¸mª½¨ì·í«e¦æ¥½¡C
+
+¯S§O´£¥Ü¡J
+ ¹ï¤_«i¤_±´¯ÁªÌ¡A½Ð¦b¥¿±`¼Ò¦¡¤U­±¶È«ö¥Nªí¬ÛÀ³¹ï¶HªºÁä¦Ó¤£¨Ï¥Î©R¥O¡A«h
+ ±N¬Ý¨ì¥ú¼Ðªº²¾°Ê¥¿¦p¤W­±ªº¹ï¶H¦Cªí©Ò¥Nªíªº¤@¼Ë¡C
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿²Ä¥|¸`¡J¹ï¶H©R¥Oªº¯S®í±¡ªp
+
+
+ ** ¿é¤J dd ¥i¥H§R°£¾ã¤@­Ó·í«e¦æ¡C **
+
+ ų¤_¾ã¦æ§R°£ªº°ªÀW«×¡AVIM ªº³]­pªÌ¨M©w­n²¤Æ¾ã¦æ§R°£¡A¶È»Ý­n¦b¦P¤@¦æ¤W
+ À»¥´¨â¦¸ d ´N¥i¥H§R°£±¼¥ú¼Ð©Ò¦bªº¾ã¦æ¤F¡C
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±ªºµu¥y¬q¸¨¤¤ªº²Ä¤G¦æ¡C
+ 2. ¿é¤J dd §R°£¸Ó¦æ¡C
+ 3. µM«á²¾°Ê¨ì²Ä¥|¦æ¡C
+ 4. ±µµÛ¿é¤J 2dd (ÁÙ°O±o«e­±Á¿¹Lªº number-command-object ¶Ü¡H) §R°£¨â¦æ¡C
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿²Ä¤­¸`¡JºM®øÃþ©R¥O
+
+
+ ** ¿é¤J u ¨ÓºM®ø³Ì«á°õ¦æªº©R¥O¡A¿é¤J U ¨Ó­×¥¿¾ã¦æ¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡A¨Ã±N¨ä¸m¤_²Ä¤@­Ó¿ù»~
+ ³B¡C
+ 2. ¿é¤J x §R°£²Ä¤@­Ó¤£·Q«O¯dªº¦r¥À¡C
+ 3. µM«á¿é¤J u ºM®ø³Ì«á°õ¦æªº(¤@¦¸)©R¥O¡C
+ 4. ³o¦¸­n¨Ï¥Î x ­×¥¿¥»¦æªº©Ò¦³¿ù»~¡C
+ 5. ²{¦b¿é¤J¤@­Ó¤j¼gªº U ¡A«ì´_¨ì¸Ó¦æªº­ì©lª¬ºA¡C
+ 6. ±µµÛ¦h¦¸¿é¤J u ¥HºM®ø U ¥H¤Î§ó«eªº©R¥O¡C
+ 7. µM«á¦h¦¸¿é¤J CTRL-R (¥ý«ö¤U CTRL Á䤣©ñ¶}¡A±µµÛ¿é¤J R Áä) ¡A³o¼Ë´N
+ ¥i¥H°õ¦æ«ì´_©R¥O¡A¤]´N¬OºM®ø±¼ºM®ø©R¥O¡C
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. ³o¨Ç³£¬O«D±`¦³¥Îªº©R¥O¡C¤U­±¬O²Ä¤GÁ¿ªº¤pµ²¤F¡C
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤GÁ¿¤pµ²
+
+
+ 1. ±ý±q·í«e¥ú¼Ð§R°£¦Ü³æ¦r/³æµü¥½§À¡A½Ð¿é¤J¡Jdw
+
+ 2. ±ý±q·í«e¥ú¼Ð§R°£¦Ü·í«e¦æ¥½§À¡A½Ð¿é¤J¡Jd$
+
+ 3. ±ý§R°£¾ã¦æ¡A½Ð¿é¤J¡Jdd
+
+ 4. ¦b¥¿±`¼Ò¦¡¤U¤@­Ó©R¥Oªº®æ¦¡¬O¡J
+
+ [number] command object ©ÎªÌ command [number] object
+ ¨ä·N¬O¡J
+ number - ¥Nªíªº¬O©R¥O°õ¦æªº¦¸¼Æ
+ command - ¥Nªí­n°µªº¨Æ±¡¡A¤ñ¦p d ¥Nªí§R°£
+ object - ¥Nªí­n¾Þ§@ªº¹ï¶H¡A¤ñ¦p w ¥Nªí³æ¦r/³æµü¡A$ ¥Nªí¨ì¦æ¥½µ¥µ¥¡C
+ $ (to the end of line), etc.
+
+ 5. ±ýºM®ø¥H«eªº¾Þ§@¡A½Ð¿é¤J¡Ju (¤p¼gªºu)
+ ±ýºM®ø¦b¤@¦æ¤¤©Ò°µªº§ï°Ê¡A½Ð¿é¤J¡JU (¤j¼gªºU)
+ ±ýºM®ø¥H«eªººM®ø©R¥O¡A«ì´_¥H«eªº¾Þ§@µ²ªG¡A½Ð¿é¤J¡JCTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤TÁ¿²Ä¤@¸`¡J¸m¤JÃþ©R¥O
+
+
+ ** ¿é¤J p ±N³Ì«á¤@¦¸§R°£ªº¤º®e¸m¤J¥ú¼Ð¤§«á **
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¥Ü­S¬q¸¨ªº­º¦æ¡C
+
+ 2. ¿é¤J dd ±N¸Ó¦æ§R°£¡A³o¼Ë·|±N¸Ó¦æ«O¦s¨ìvimªº½w¨R°Ï¤¤¡C
+
+ 3. ±µµÛ±N¥ú¼Ð²¾°Ê¨ì·Ç³Æ¸m¤Jªº¦ì¸mªº¤W¤è¡C°O¦í¡J¬O¤W¤è®@¡C
+
+ 4. µM«á¦b¥¿±`¼Ò¦¡¤U(<ESC>Áä¶i¤J)¡A¿é¤J p ±N¸Ó¦æÖ߶K¸m¤J¡C
+
+ 5. ­«´_¨BÆJ2¦Ü¨BÆJ4¡A±N©Ò¦³ªº¦æ¨Ì§Ç©ñ¸m¨ì¥¿½Tªº¦ì¸m¤W¡C
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤TÁ¿²Ä¤G¸`¡J´À´«Ãþ©R¥O
+
+
+ ** ¿é¤J r ©M¤@­Ó¦r²Å´À´«¥ú¼Ð©Ò¦b¦ì¸mªº¦r²Å¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ¡C
+
+ 2. ½Ð²¾°Ê¥ú¼Ð¨ì²Ä¤@­Ó¿ù»~ªº¾A·í¦ì¸m¡C
+
+ 3. ±µµÛ¿é¤J r ¡A³o¼Ë´N¯à±N¿ù»~´À´«±¼¤F¡C
+
+ 4. ­«´_¨BÆJ2©M¨BÆJ3¡Aª½¨ì²Ä¤@¦æ¤w¸g­×§ï§¹²¦¡C
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. µM«á§Ú­ÌÄ~Äò¾Ç®Õ²Ä¤TÁ¿²Ä¤T¸`¡C
+
+¯S§O´£¥Ü¡J¤Á°O±z­n¦b¨Ï¥Î¤¤¾Ç²ß¡A¦Ó¤£¬O¦b°O¾Ð¤¤¾Ç²ß¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤TÁ¿²Ä¤T¸`¡J§ó§ïÃþ©R¥O
+
+
+ ** ­n§ïÅܤ@­Ó³æ¦r/³æµüªº³¡¤À©ÎªÌ¥þ³¡¡A½Ð¿é¤J cw **
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ¡C
+
+ 2. ±µµÛ§â¥ú¼Ð©ñ¦b³æµü lubw ªº¦r¥À u ªº¦ì¸m¨º¸Ì¡C
+
+ 3. µM«á¿é¤J cw ´N¥i¥H­×¥¿¸Ó³æµü¤F(¦b¥»¨Ò³o¸Ì¬O¿é¤J ine ¡C)
+
+ 4. ³Ì«á«ö <ESC> Áä¡AµM«á¥ú¼Ð©w¦ì¨ì¤U¤@­Ó¿ù»~²Ä¤@­Ó·Ç³Æ§ó§ïªº¦r¥À³B¡C
+
+ 5. ­«´_¨BÆJ3©M¨BÆJ4¡Aª½¨ì²Ä¤@­Ó¥y¤l§¹¥þ¹p¦P²Ä¤G­Ó¥y¤l¡C
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+´£¥Ü¡J½Ðª`·N cw ©R¥O¤£¶È¶È¬O´À´«¤F¤@­Ó³æµü¡A¤]Åý±z¶i¤J¤å¥»´¡¤Jª¬ºA¤F¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤TÁ¿²Ä¥|¸`¡J¨Ï¥Îc«ü¥Oªº¨ä¥L§ó§ïÃþ©R¥O
+
+
+ ** §ó§ïÃþ«ü¥O¥i¥H¨Ï¥Î¦P§R°£Ãþ©R¥O©Ò¨Ï¥Îªº¹ï¶H°Ñ¼Æ¡C**
+
+ 1. §ó§ïÃþ«ü¥Oªº¤u§@¤è¦¡¸ò§R°£Ãþ©R¥O¬O¤@­Pªº¡C¾Þ§@®æ¦¡¬O¡J
+
+ [number] c object ©ÎªÌ c [number] object
+
+ 2. ¹ï¶H°Ñ¼Æ¤]¬O¤@¼Ëªº¡A¤ñ¦p w ¥Nªí³æ¦r/³æµü¡A$¥Nªí¦æ¥½µ¥µ¥¡C
+
+ 3. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ¡C
+
+ 4. ±µµÛ±N¥ú¼Ð²¾°Ê¨ì²Ä¤@­Ó¿ù»~³B¡C
+
+ 5. µM«á¿é¤J c$ ¨Ï±o¸Ó¦æ³Ñ¤Uªº³¡¤À§ó¥¿±o¦P²Ä¤G¦æ¤@¼Ë¡C³Ì«á«ö <ESC> Áä¡C
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤TÁ¿¤pµ²
+
+
+ 1. ­n­«·s¸m¤J¤w¸g§R°£ªº¤å¥»¤º®e¡A½Ð¿é¤J¤p¼g¦r¥À p¡C¸Ó¾Þ§@¥i¥H±N¤w§R°£
+ ªº¤å¥»¤º®e¸m¤_¥ú¼Ð¤§«á¡C¦pªG³Ì«á¤@¦¸§R°£ªº¬O¤@­Ó¾ã¦æ¡A¨º»ò¸Ó¦æ±N¸m
+ ¤_·í«e¥ú¼Ð©Ò¦b¦æªº¤U¤@¦æ¡C
+
+ 2. ­n´À´«¥ú¼Ð©Ò¦b¦ì¸mªº¦r²Å¡A½Ð¿é¤J¤p¼gªº r ©M­n´À´«±¼­ì¦ì¸m¦r²Åªº·s¦r
+ ²Å§Y¥i¡C
+
+ 3. §ó§ïÃþ©R¥O¤¹³\±z§ïÅÜ«ü©wªº¹ï¶H¡A±q·í«e¥ú¼Ð©Ò¦b¦ì¸mª½¨ì¹ï¶Hªº¥½§À¡C
+ ¤ñ¦p¿é¤J cw ¥i¥H´À´«·í«e¥ú¼Ð¨ì³æµüªº¥½§Àªº¤º®e¡F¿é¤J c$ ¥i¥H´À´«·í
+ «e¥ú¼Ð¨ì¦æ¥½ªº¤º®e¡C
+
+ 4. §ó§ïÃþ©R¥Oªº®æ¦¡¬O¡J
+
+ [number] c object ©ÎªÌ c [number] object
+
+¤U­±§Ú­ÌÄ~Äò¾Ç²ß¤U¤@Á¿¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¥|Á¿²Ä¤@¸`¡J©w¦ì¤Î¤å¥óª¬ºA
+
+
+ ** ¿é¤J CTRL-g Åã¥Ü·í«e½s¿è¤å¥ó¤¤·í«e¥ú¼Ð©Ò¦b¦æ¦ì¸m¥H¤Î¤å¥óª¬ºA«H®§¡C
+ ¿é¤J SHIFT-G «hª½±µ¸õÂà¨ì¤å¥ó¤¤ªº¬Y¤@«ü©w¦æ¡C**
+
+ ´£¥Ü¡J¤Á°O­n¥ý³qŪ¥»¸`¤º®e¡A¤§«á¤~¥i¥H°õ¦æ¥H¤U¨BÆJ!!!
+
+ 1. «ö¤U CTRL Á䤣©ñ¶}µM«á«ö g Áä¡CµM«á´N·|¬Ý¨ì­¶­±³Ì©³³¡¥X²{¤@­Óª¬ºA«H
+ ®§¦æ¡AÅã¥Üªº¤º®e¬O·í«e½s¿èªº¤å¥ó¦W©M¤å¥óªºÁ`¦æ¼Æ¡C½Ð°O¦í¨BÆJ3ªº¦æ¸¹¡C
+
+ 2. «ö¤U SHIFT-G Áä¥i¥H¨Ï±o·í«e¥ú¼Ðª½±µ¸õÂà¨ì¤å¥ó³Ì«á¤@¦æ¡C
+
+ 3. ¿é¤J±z´¿°±¯dªº¦æ¸¹¡AµM«á«ö¤U SHIFT-G¡C³o¼Ë´N¥i¥Hªð¦^¨ì±z²Ä¤@¦¸«ö¤U
+ CTRL-g ®É©Ò¦bªº¦æ¦n¤F¡Cª`·N¡J¿é¤J¦æ¸¹®É¡A¦æ¸¹¬O¤£·|¦b«Ì¹õ¤WÅã¥Ü¥X¨Ó
+ ªº¡C
+
+ 4. ¦pªGÄ@·N¡A±z¥i¥HÄ~Äò°õ¦æ¨BÆJ1¦Ü¨BÆJ¤T¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¥|Á¿²Ä¤G¸`¡J·j¯ÁÃþ©R¥O
+
+
+ ** ¿é¤J / ¥H¤Î§ÀÀHªº¦r²Å¦ê¥i¥H¥Î¥H¦b·í«e¤å¥ó¤¤¬d§ä¸Ó¦r²Å¦ê¡C**
+
+ 1. ¦b¥¿±`¼Ò¦¡¤U¿é¤J / ¦r²Å¡C±z¦¹®É·|ª`·N¨ì¸Ó¦r²Å©M¥ú¼Ð³£·|¥X²{¦b«Ì¹õ©³
+ ³¡¡A³o¸ò : ©R¥O¬O¤@¼Ëªº¡C
+
+ 2. ±µµÛ¿é¤J errroor <¦^¨®>¡C¨º­Óerrroor´N¬O±z­n¬d§äªº¦r²Å¦ê¡C
+
+ 3. ­n¬d§ä¦P¤W¤@¦¸ªº¦r²Å¦ê¡A¥u»Ý­n«ö n Áä¡C­n¦V¬Û¤Ï¤è¦V¬d§ä¦P¤W¤@¦¸ªº¦r
+ ²Å¦ê¡A½Ð¿é¤J Shift-N §Y¥i¡C
+
+ 4. ¦pªG±z·Q°f¦V¬d§ä¦r²Å¦ê¡A½Ð¨Ï¥Î ? ¥N´À / ¶i¦æ¡C
+
+---> When the search reaches the end of the file it will continue at the start.
+
+ "errroor" is not the way to spell error; errroor is an error.
+
+ ´£¥Ü¡J¦pªG¬d§ä¤w¸g¨ì¹F¤å¥ó¥½§À¡A¬d§ä·|¦Û°Ê±q¤å¥óÀY³¡Ä~Äò¬d§ä¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¥|Á¿²Ä¤T¸`¡J°t¹ï¬A¸¹ªº¬d§ä
+
+
+ ** «ö % ¥i¥H¬d§ä°t¹ïªº¬A¸¹ )¡B]¡B}¡C**
+
+ 1. §â¥ú¼Ð©ñ¦b¥»¸`¤U­±¼Ð°O¦³ --> ¨º¤@¦æ¤¤ªº¥ô¦ó¤@­Ó (¡B[ ©Î { ³B¡C
+
+ 2. ±µµÛ«ö % ¦r²Å¡C
+
+ 3. ¦¹®É¥ú¼Ðªº¦ì¸mÀ³·í¬O¦b°t¹ïªº¬A¸¹³B¡C
+
+ 4. ¦A¦¸«ö % ´N¥i¥H¸õ¦^°t¹ïªº²Ä¤@­Ó¬A¸¹³B¡C
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+´£¥Ü¡J¦bµ{§Ç½Õ¸Õ®É¡A³o­Ó¥\¯à¥Î¨Ó¬d§ä¤£°t¹ïªº¬A¸¹¬O«Ü¦³¥Îªº¡C
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¥|Á¿²Ä¥|¸`¡J­×¥¿¿ù»~ªº¤èªk¤§¤@
+
+
+ ** ¿é¤J :s/old/new/g ¥i¥H´À´« old ¬° new¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡C
+
+ 2. ¿é¤J :s/thee/the <¦^¨®> ¡C½Ðª`·N¸Ó©R¥O¥u§ïÅÜ¥ú¼Ð©Ò¦b¦æªº²Ä¤@­Ó¤Ç°t
+ ¦ê¡C
+
+ 3. ¿é¤J :s/thee/the/g «h¬O´À´«¥þ¦æªº¤Ç°t¦ê¡C
+
+---> the best time to see thee flowers is in thee spring.
+
+ 4. ­n´À´«¨â¦æ¤§¶¡¥X²{ªº¨C­Ó¤Ç°t¦ê¡A½Ð¿é¤J :#,#s/old/new/g (#,#¥Nªíªº¬O
+ ¨â¦æªº¦æ¸¹)¡C¿é¤J :%s/old/new/g «h¬O´À´«¾ã­Ó¤å¥ó¤¤ªº¨C­Ó¤Ç°t¦ê¡C
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¥|Á¿¤pµ²
+
+
+ 1. Ctrl-g ¥Î¤_Åã¥Ü·í«e¥ú¼Ð©Ò¦b¦ì¸m©M¤å¥óª¬ºA«H®§¡CShift-G ¥Î¤_±N¥ú¼Ð¸õ
+ Âà¦Ü¤å¥ó³Ì«á¤@¦æ¡C¥ýºV¤J¤@­Ó¦æ¸¹µM«á«ö Shift-G «h¬O±N¥ú¼Ð²¾°Ê¦Ü¸Ó¦æ
+ ¸¹¥Nªíªº¦æ¡C
+
+ 2. ¿é¤J / µM«áºòÀH¤@­Ó¦r²Å¦ê¬O«h¬O¦b·í«e©Ò½s¿èªº¤åÀɤ¤¦V«á¬d§ä¸Ó¦r²Å¦ê¡C
+ ¿é¤J°Ý¸¹ ? µM«áºòÀH¤@­Ó¦r²Å¦ê¬O«h¬O¦b·í«e©Ò½s¿èªº¤åÀɤ¤¦V«e¬d§ä¸Ó¦r
+ ²Å¦ê¡C§¹¦¨¤@¦¸¬d§ä¤§«á«ö n Áä«h¬O­«´_¤W¤@¦¸ªº©R¥O¡A¥i¦b¦P¤@¤è¦V¤W¬d
+ §ä¤U¤@­Ó¦r²Å¦ê©Ò¦b¡F©ÎªÌ«ö Shift-N ¦V¬Û¤Ï¤è¦V¬d§ä¤U¸Ó¦r²Å¦ê©Ò¦b¡C
+
+ 3. ¦pªG¥ú¼Ð·í«e¦ì¸m¬O¬A¸¹(¡B)¡B[¡B]¡B{¡B}¡A«ö % ¥i¥H±N¥ú¼Ð²¾°Ê¨ì°t¹ïªº
+ ¬A¸¹¤W¡C
+
+ 4. ¦b¤@¦æ¤º´À´«ÀY¤@­Ó¦r²Å¦ê old ¬°·sªº¦r²Å¦ê new¡A½Ð¿é¤J :s/old/new
+ ¦b¤@¦æ¤º´À´«©Ò¦³ªº¦r²Å¦ê old ¬°·sªº¦r²Å¦ê new¡A½Ð¿é¤J :s/old/new/g
+ ¦b¨â¦æ¤º´À´«©Ò¦³ªº¦r²Å¦ê old ¬°·sªº¦r²Å¦ê new¡A½Ð¿é¤J :#,#s/old/new/g
+ ¦b¤å¥ó¤º´À´«©Ò¦³ªº¦r²Å¦ê old ¬°·sªº¦r²Å¦ê new¡A½Ð¿é¤J :%s/old/new/g
+ ¶i¦æ¥þ¤å´À´«®É¸ß°Ý¥Î¤á½T»{¨C­Ó´À´«»Ý²K¥[ c ¿ï¶µ¡A½Ð¿é¤J :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤­Á¿²Ä¤@¸`¡J¦b VIM ¤º°õ¦æ¥~³¡©R¥Oªº¤èªk
+
+
+ ** ¿é¤J :! µM«áºòÀHµÛ¿é¤J¤@­Ó¥~³¡©R¥O¥i¥H°õ¦æ¸Ó¥~³¡©R¥O¡C**
+
+ 1. «ö¤U§Ú­Ì©Ò¼ô±xªº : ©R¥O³]¸m¥ú¼Ð¨ì«Ì¹õ©³³¡¡C³o¼Ë´N¥i¥HÅý±z¿é¤J©R¥O¤F¡C
+
+ 2. ±µµÛ¿é¤J·P¹Ä¸¹ ! ³o­Ó¦r²Å¡A³o¼Ë´N¤¹³\±z°õ¦æ¥~³¡ªº shell ©R¥O¤F¡C
+
+ 3. §Ú­Ì¥H ls ©R¥O¬°¨Ò¡C¿é¤J !ls <¦^¨®> ¡C¸Ó©R¥O´N·|¦CÁ|¥X±z·í«e¥Ø¿ýªº
+ ¤º®e¡A´N¦p¦P±z¦b©R¥O¦æ´£¥Ü²Å¤U¿é¤J ls ©R¥Oªºµ²ªG¤@¼Ë¡C¦pªG !ls ¨S°_
+ §@¥Î¡A±z¥i¥H¸Õ¸Õ :!dir ¬Ý¬Ý¡C
+
+---> ´£¥Ü¡J ©Ò¦³ªº¥~³¡©R¥O³£¥i¥H¥H³oºØ¤è¦¡°õ¦æ¡C
+
+---> ´£¥Ü¡J ©Ò¦³ªº : ©R¥O³£¥²¶·¥H <¦^¨®> §i²×¡C
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤­Á¿²Ä¤G¸`¡JÃö¤_«O¦s¤å¥óªº§ó¦h«H®§
+
+
+ ** ­n±N¹ï¤å¥óªº§ï°Ê«O¦s¨ì¤å¥ó¤¤¡A½Ð¿é¤J :w FILENAME **
+
+ 1. ¿é¤J :!dir ©ÎªÌ :!ls Àòª¾·í«e¥Ø¿ýªº¤º®e¡C±zÀ³·í¤wª¾¹D³Ì«áÁÙ±oºV
+ <¦^¨®> §a¡C
+
+ 2. ¿ï¾Ü¤@­Ó©|¥¼¦s¦b¤å¥ó¦W¡A¤ñ¦p TEST ¡C
+
+ 3. ±µµÛ¿é¤J :w TEST (¦¹³B TEST ¬O±z©Ò¿ï¾Üªº¤å¥ó¦W¡C)
+
+ 4. ¸Ó©R¥O·|¥H TEST ¬°¤å¥ó¦W«O¦s¾ã­Ó¤å¥ó (VIM ±Ðµ{)¡C¬°¤F½T«O¥¿½T«O¦s¡A
+ ½Ð¦A¦¸¿é¤J :!dir ¬d¬Ý±zªº¥Ø¿ý¦Cªí¤º®e¡C
+
+---> ½Ðª`·N¡J¦pªG±z°h¥X VIM µM«á¦b¥H¤å¥ó¦W TEST ¬°°Ñ¼Æ¶i¤J¡A¨º»ò¸Ó¤å¥ó¤º
+ ®eÀ³¸Ó¦P±z«O¦s®Éªº¤å¥ó¤º®e¬O§¹¥þ¤@¼Ëªº¡C
+
+ 5. ²{¦b±z¥i¥H³q¹L¿é¤J :!rm TEST ¨Ó§R°£ TEST ¤å¥ó¤F¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤­Á¿²Ä¤T¸`¡J¤@­Ó¨ã¦³¿ï¾Ü©Êªº«O¦s©R¥O
+
+
+ ** ­n«O¦s¤å¥óªº³¡¤À¤º®e¡A½Ð¿é¤J :#,# w FILENAME **
+
+ 1. ¦A¨Ó°õ¦æ¤@¦¸ :!dir ©ÎªÌ :!ls Àòª¾·í«e¥Ø¿ýªº¤º®e¡AµM«á¿ï¾Ü¤@­Ó¦X¾Aªº
+ ¤£­«¦Wªº¤å¥ó¦W¡A¤ñ¦p TEST ¡C
+
+ 2. ±µµÛ±N¥ú¼Ð²¾°Ê¦Ü¥»­¶ªº³Ì³»ºÝ¡AµM«á«ö CTRL-g §ä¨ì¸Ó¦æªº¦æ¸¹¡C§O§Ñ¤F
+ ¦æ¸¹®@¡C
+
+ 3. ±µµÛ§â¥ú¼Ð²¾°Ê¦Ü¥»­¶ªº³Ì©³ºÝ¡A¦A«ö¤@¦¸ CTRL-g ¡C¤]§O§Ñ¤F³o­Ó¦æ¦n®@¡C
+
+ 4. ¬°¤F¥u«O¦s¤å³¹ªº¬Y­Ó³¡¤À¡A½Ð¿é¤J :#,# w TEST ¡C³o¸Ìªº #,# ´N¬O¤W­±
+ ­n¨D±z°O¦íªº¦æ¸¹(³»ºÝ¦æ¸¹,©³ºÝ¦æ¸¹)¡A¦Ó TEST ´N¬O¿ï©wªº¤å¥ó¦W¡C
+
+ 5. ³Ì«á¡A¥Î :!dir ½T»{¤å¥ó¬O§_¥¿½T«O¦s¡C¦ý¬O³o¦¸¥ý§O§R°£±¼¡C
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤­Á¿²Ä¥|¸`¡J´£¨ú©M¦X¨Ã¤å¥ó
+
+
+ ** ­n¦V·í«e¤å¥ó¤¤´¡¤J¥t¥~ªº¤å¥óªº¤º®e¡A½Ð¿é¤J :r FILENAME **
+
+ 1. ½ÐÁä¤J :!dir ½T»{±z«e­±³Ð«Øªº TEST ¤å¥óÁÙ¦b¡C
+
+ 2. µM«á±N¥ú¼Ð²¾°Ê¦Ü·í«e­¶­±ªº³»ºÝ¡C
+
+¯S§O´£¥Ü¡J °õ¦æ¨BÆJ3¤§«á±z±N¬Ý¨ì²Ä¤­Á¿²Ä¤T¸`¡A½Ð©¡®É¦A©¹¤U²¾°Ê¦^¨ì³o¸Ì¨Ó¡C
+
+ 3. ±µµÛ³q¹L :r TEST ±N«e­±³Ð«Øªº¦W¬° TEST ªº¤å¥ó´£¨ú¶i¨Ó¡C
+
+¯S§O´£¥Ü¡J±z©Ò´£¨ú¶i¨Óªº¤å¥ó±N±q¥ú¼Ð©Ò¦b¦ì¸m³B¶}©l¸m¤J¡C
+
+ 4. ¬°¤F½T»{¤å¥ó¤w¸g´£¨ú¦¨¥\¡A²¾°Ê¥ú¼Ð¦^¨ì­ì¨Óªº¦ì¸m´N¥i¥Hª`·N¦³¨â¥÷²Ä
+ ¤­Á¿²Ä¤T¸`¡A¤@¥÷¬O­ì¥»¡A¥t¥~¤@¥÷¬O¨Ó¦Û¤å¥óªº°Æ¥»¡C
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤­Á¿¤pµ²
+
+
+ 1. :!command ¥Î¤_°õ¦æ¤@­Ó¥~³¡©R¥O command¡C
+
+ ½Ð¬Ý¤@¨Ç¹ê»Ú¨Ò¤l¡J
+ :!dir - ¥Î¤_Åã¥Ü·í«e¥Ø¿ýªº¤º®e¡C
+ :!rm FILENAME - ¥Î¤_§R°£¦W¬° FILENAME ªº¤å¥ó¡C
+
+ 2. :w FILENAME ¥i±N·í«e VIM ¤¤¥¿¦b½s¿èªº¤å¥ó«O¦s¨ì¦W¬° FILENAME
+ ªº¤å¥ó¤¤¡C
+
+ 3. :#,#w FILENAME ¥i±N·í«e½s¿è¤å¥ó²Ä # ¦æ¦Ü²Ä # ¦æªº¤º®e«O¦s¨ì¤å¥ó
+ FILENAME ¤¤¡C
+
+ 4. :r FILENAME ¥i´£¨úºÏ½L¤å¥ó FILENAME ¨Ã±N¨ä´¡¤J¨ì·í«e¤å¥óªº¥ú¼Ð¦ì¸m
+ «á­±¡C
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤»Á¿²Ä¤@¸`¡J¥´¶}Ãþ©R¥O
+
+
+ ** ¿é¤J o ±N¦b¥ú¼Ðªº¤U¤è¥´¶}·sªº¤@¦æ¨Ã¶i¤J´¡¤J¼Ò¦¡¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº¨º¤@¦æ¡C
+
+ 2. ±µµÛ¿é¤J¤p¼gªº o ¦b¥ú¼Ð *¤U¤è* ¥´¶}·sªº¤@¦æ¨Ã¶i¤J´¡¤J¼Ò¦¡¡C
+
+ 3. µM«á´_¨î¼Ð°O¦³ ---> ªº¦æ¨Ã«ö <ESC> Áä°h¥X´¡¤J¼Ò¦¡¦Ó¶i¤J¥¿±`¼Ò¦¡¡C
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. ¬°¤F¦b¥ú¼Ð *¤W¤è* ¥´¶}·sªº¤@¦æ¡A¥u»Ý­n¿é¤J¤j¼gªº O ¦Ó¤£¬O¤p¼gªº o
+ ´N¥i¥H¤F¡C½Ð¦b¤U¦æ´ú¸Õ¤@¤U§a¡C·í¥ú¼Ð³B¦b¦b¸Ó¦æ¤W®É¡A«ö Shift-O¥i¥H
+ ¦b¸Ó¦æ¤W¤è·s¶}¤@¦æ¡C
+
+Open up a line above this by typing Shift-O while the cursor is on this line.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤»Á¿²Ä¤G¸`¡J¥ú¼Ð«á´¡¤JÃþ©R¥O
+
+
+ ** ¿é¤J a ±N¥i¦b¥ú¼Ð¤§«á´¡¤J¤å¥»¡C **
+
+ 1. ½Ð¦b¥¿±`¼Ò¦¡¤U³q¹L¿é¤J $ ±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ
+ ªº¥½§À¡C
+
+ 2. ±µµÛ¿é¤J¤p¼gªº a «h¥i¦b¥ú¼Ð¤§«á´¡¤J¤å¥»¤F¡C¤j¼gªº A «h¥i¥Hª½±µ¦b¦æ
+ ¥½´¡¤J¤å¥»¡C
+
+´£¥Ü¡J¿é¤J¤j¼g A ªº¾Þ§@¤èªk¥i¥H¦b¦æ¥½´¡¤J¤å¥»¡AÁקK¤F¿é¤J i¡A¥ú¼Ð©w¦ì¨ì
+ ³Ì«á¤@­Ó¦r²Å¡A¿é¤Jªº¤å¥»¡A<ESC> ¦^´_¥¿±`¼Ò¦¡¡A½bÀY¥kÁä²¾°Ê¥ú¼Ð¥H¤Î
+ x §R°£·í«e¥ú¼Ð©Ò¦b¦ì¸m¦r²Åµ¥µ¥½Ñ¦hÁcÂøªº¾Þ§@¡C
+
+ 3. ¾Þ§@¤§«á²Ä¤@¦æ´N¥i¥H¸É¥R§¹¾ã¤F¡C½Ðª`·N¥ú¼Ð«á´¡¤J¤å¥»»P´¡¤J¼Ò¦¡¬O°ò
+ ¥»§¹¥þ¤@­Pªº¡A¥u¬O¤å¥»´¡¤Jªº¦ì¸m©w¦ìµy¦³¤£¦P½}¤F¡C
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤»Á¿²Ä¤T¸`¡J¥t¥~¤@­Ó¸m´«Ãþ©R¥Oªºª©¥»
+
+
+ ** ¿é¤J¤j¼gªº R ¥i³sÄò´À´«¦h­Ó¦r²Å¡C**
+
+ 1. ½Ð±N¥ú¼Ð²¾°Ê¨ì¥»¸`¤¤¤U­±¼Ð°O¦³ ---> ªº²Ä¤@¦æ¡C
+
+ 2. ²¾°Ê¥ú¼Ð¨ì²Ä¤@¦æ¤¤¤£¦P¤_¼Ð¦³ ---> ªº²Ä¤G¦æªº²Ä¤@­Ó³æµüªº¶}©l¡A§Y³æ
+ µü last ³B¡C
+
+ 3. µM«á¿é¤J¤j¼gªº R ¶}©l§â²Ä¤@¦æ¤¤ªº¤£¦P¤_²Ä¤G¦æªº³Ñ§E¦r²Å³v¤@¿é¤J¡A´N
+ ¥i¥H¥þ³¡´À´«±¼­ì¦³ªº¦r²Å¦Ó¨Ï±o²Ä¤@¦æ§¹¥þ¹p¦P²Ä¤G¦æ¤F¡C
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. ½Ðª`·N¡J¦pªG±z«ö <ESC> °h¥X¸m´«¼Ò¦¡¦^´_¥¿±`¼Ò¦¡¡A©|¥¼´À´«ªº¤å¥»±N¤´
+ µM«O«ù­ìª¬¡C
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤»Á¿²Ä¥|¸`¡J³]¸mÃþ©R¥Oªº¿ï¶µ
+
+
+ ** ³]¸m¥i¨Ï¬d§ä©ÎªÌ´À´«¥i©¿²¤¤j¤p¼gªº¿ï¶µ **
+
+
+ 1. ­n¬d§ä³æµü ignore ¥i¦b¥¿±`¼Ò¦¡¤U¿é¤J /ignore ¡C­n­«´_¬d§ä¸Óµü¡A¥i¥H
+ ­«´_«ö n Áä¡C
+
+ 2. µM«á³]¸m ic ¿ï¶µ(ic´N¬O­^¤å©¿²¤¤j¤p¼gIgnore Caseªº­º¦r¥ÀÁY¼gµü)¡A§Y
+ ¿é¤J¡J
+ :set ic
+
+ 3. ²{¦b¥i¥H³q¹LÁä¤J n Áä¦A¦¸¬d§ä³æµü ignore¡C­«´_¬d§ä¥i¥H­«´_Áä¤J n Áä¡C
+
+ 4. µM«á³]¸m hlsearch ©M incsearch ³o¨â­Ó¿ï¶µ¡A¿é¤J¥H¤U¤º®e¡J
+ :set hls is
+
+ 5. ²{¦b¥i¥H¦A¦¸¿é¤J¬d§ä©R¥O¡A¬Ý¬Ý·|¦³¤°»ò®ÄªG¡J
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤»Á¿¤pµ²
+
+
+ 1. ¿é¤J¤p¼gªº o ¥i¥H¦b¥ú¼Ð¤U¤è¥´¶}·sªº¤@¦æ¨Ã±N¥ú¼Ð¸m¤_·s¶}ªº¦æ­º¡A¶i¤J
+ ´¡¤J¼Ò¦¡¡C
+ ¿é¤J¤j¼gªº O ¥i¥H¦b¥ú¼Ð¤W¤è¥´¶}·sªº¤@¦æ¨Ã±N¥ú¼Ð¸m¤_·s¶}ªº¦æ­º¡A¶i¤J
+ ´¡¤J¼Ò¦¡¡C
+
+ 2. ¿é¤J¤p¼gªº a ¥i¥H¦b¥ú¼Ð©Ò¦b¦ì¸m¤§«á´¡¤J¤å¥»¡C
+ ¿é¤J¤j¼gªº A ¥i¥H¦b¥ú¼Ð©Ò¦b¦æªº¦æ¥½¤§«á´¡¤J¤å¥»¡C
+
+ 3. ¿é¤J¤j¼gªº R ±N¶i¤J´À´«¼Ò¦¡¡Aª½¦Ü«ö <ESC> Áä°h¥X´À´«¼Ò¦¡¦Ó¶i¤J¥¿±`
+ ¼Ò¦¡¡C
+
+ 4. ¿é¤J :set xxx ¥i¥H³]¸m xxx ¿ï¶µ¡C
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤CÁ¿¡J¦b½uÀ°§U©R¥O
+
+ ** ¨Ï¥Î¦b½uÀ°§U¨t²Î **
+
+ Vim ¾Ö¦³¤@­Ó²Ó­P¥þ­±ªº¦b½uÀ°§U¨t²Î¡C­n±Ò°Ê¸ÓÀ°§U¨t²Î¡A½Ð¿ï¾Ü¦p¤U¤TºØ¤è
+ ªk¤§¤@¡J
+ - «ö¤U <HELP> Áä (¦pªGÁä½L¤W¦³ªº¸Ü)
+ - «ö¤U <F1> Áä (¦pªGÁä½L¤W¦³ªº¸Ü)
+ - ¿é¤J :help <¦^¨®>
+
+ ¿é¤J :q <¦^¨®> ¥i¥HÃö³¬À°§Uµ¡¤f¡C
+
+ ´£¨Ñ¤@­Ó¥¿½Tªº°Ñ¼Æµ¹":help"©R¥O¡A±z¥i¥H§ä¨ìÃö¤_¸Ó¥DÃDªºÀ°§U¡C½Ð¸ÕÅç¥H
+ ¤U°Ñ¼Æ(¥i§O§Ñ¤F«ö¦^¨®Áä®@¡C:)¡J
+
+ :help w <¦^¨®>
+ :help c_<T <¦^¨®>
+ :help insert-index <¦^¨®>
+ :help user-manual <¦^¨®>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ²Ä¤KÁ¿¡J³Ð«Ø¤@­Ó±Ò°Ê¸}¥»
+
+ ** ±Ò¥Îvimªº¥\¯à **
+
+ Vimªº¥\¯à¯S©Ê­n¤ñvi¦h±o¦h¡A¦ý¤j³¡¤À¥\¯à³£¨S¦³¯Ê¬Ù¿E¬¡¡C¬°¤F±Ò°Ê§ó¦hªº
+ ¥\¯à¡A±z±o³Ð«Ø¤@­Óvimrc¤å¥ó¡C
+
+ 1. ¶}©l½s¿èvimrc¤å¥ó¡A³o¨ú¨M¤_±z©Ò¨Ï¥Îªº¾Þ§@¨t²Î¡J
+
+ :edit ~/.vimrc ³o¬OUnix¨t²Î©Ò¨Ï¥Îªº©R¥O
+ :edit $VIM/_vimrc ³o¬OWindows¨t²Î©Ò¨Ï¥Îªº©R¥O
+
+ 2. ±µµÛ¾É¤Jvimrc­S¨Ò¤å¥ó¡J
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. «O¦s¤å¥ó¡A©R¥O¬°¡J
+
+ :write
+
+ ¦b¤U¦¸±z±Ò°Êvimªº®É­Ô¡A½s¿è¾¹´N·|¦³¤F»yªk°ª«Gªº¥\¯à¡C±z¥i¥HÄ~Äò§â±z³ß
+ Åwªº¨ä¥¦¥\¯à³]¸m²K¥[¨ì³o­Óvimrc¤å¥ó¤¤¡C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ vim ±Ðµ{¨ì¦¹µ²§ô¡C¥»±Ðµ{¥u¬O¬°¤F²©ú¦a¤¶²Ð¤@¤Uvim½s¿è¾¹¡A¦ý¤w¨¬¥HÅý±z
+ «Ü®e©ö¾Ç·|¨Ï¥Î¥»½s¿è¾¹¤F¡C¤ð±e½èºÃ¡AvimÁÙ¦³«Ü¦h«Ü¦hªº©R¥O¡A¥»±Ðµ{©Ò¤¶
+ ²ÐªºÁÙ®t±o»·µÛ©O¡C©Ò¥H±z­nºë³qªº¸Ü¡AÁÙ±æÄ~Äò§V¤O®@¡C¤U¤@¨B±z¥i¥H¾\Ū
+ vim¤â¥U¡A¨Ï¥Îªº©R¥O¬O¡J
+ :help user-manual
+
+ ¬°¤F§ó¶i¤@¨Bªº°Ñ¦Ò©M¾Ç²ß¡A¥H¤U³o¥»®Ñ­È±o±ÀÂË¡J
+
+ Vim - Vi Improved - §@ªÌ¡JSteve Oualline
+ ¥Xª©ªÀ¡JNew Riders
+
+ ³o¬O²Ä¤@¥»§¹¥þÁ¿¸Ñvimªº®ÑÄy¡C¹ï¤_ªì¾ÇªÌ¯S§O¦³¥Î¡C¨ä¤¤ÁÙ¥]§t¦³¤j¶q¹ê¨Ò
+ ©M¹Ï¥Ü¡C±ýª¾¸Ô±¡¡A½Ð³X°Ý http://iccf-holland.org/click5.html
+
+ ¥H¤U³o¥»®Ñ¤ñ¸û¦Ñ¤F¦Ó¥B¤º®e¥D­n¬Ovi¦Ó¤£¬Ovim¡A¦ý¬O¤]­È±o±ÀÂË¡J
+
+ Learning the Vi Editor - §@ªÌ¡JLinda Lamb
+ ¥Xª©ªÀ¡JO'Reilly & Associates Inc.
+
+ ³o¬O¤@¥»¤£¿ùªº®Ñ¡A³q¹L¥¦±z´X¥G¯à°÷¤F¸Ñ¨ì¥þ³¡vi¯à°÷°µ¨ìªº¨Æ±¡¡C¦¹®Ñªº²Ä
+ ¤»­Óª©¥»¤]¥]§t¤F¤@¨ÇÃö¤_vimªº«H®§¡C
+
+ ¥»±Ðµ{¬O¥Ñ¨Ó¦ÛCalorado School of MineseªºMichael C. Pierce¡BRobert K.
+ Ware ©Ò½s¼gªº¡A¨ä¤¤¨Ó¦ÛColorado State UniversityªºCharles Smith´£¨Ñ¤F
+ «Ü¦h³Ð·N¡C½sªÌ³q«H¦a§}¬O¡J
+
+ bware@mines.colorado.edu
+
+ ¥»±Ðµ{¤w¥ÑBram Moolenaar±M¬°vim¶i¦æ­×­q¡C
+
+
+
+ Ķ¨îªÌªþ¨¥¡J
+ ===========
+ ²Å餤¤å±Ðµ{½Ķª©¤§Ä¶¨îªÌ¬°±ç©÷®õ <beos@turbolinux.com.cn>¡AÁÙ¦³
+ ¥t¥~¤@­ÓÁp¨t¦a§}¡Jlinuxrat@gnuchina.org¡C
+
+ ÁcÅ餤¤å±Ðµ{¬O±q²Å餤¤å±Ðµ{½Ķª©¨Ï¥Î Debian GNU/Linux ¤¤¤å¶µ¥Ø¤p
+ ²Õªº¤_¼s½÷¥ý¥Í½s¼gªº¤¤¤åº~¦rÂà½X¾¹ autoconvert Âà´«¦Ó¦¨ªº¡A¨Ã¹ïÂà
+ ´«ªºµ²ªG°µ¤F¤@¨Ç²Ó¸`ªº§ï°Ê¡C
+
+ Åܧó°O¿ý¡J
+ =========
+ 2002¦~08¤ë30¤é ±ç©÷®õ <beos@turbolinux.com.cn>
+ ·PÁ RMS@SMTH ªº«ü¥¿¡A±N¦h³B¿ù»~­×¥¿¡C
+
+ 2002¦~04¤ë22¤é ±ç©÷®õ <linuxrat@gnuchina.org>
+ ·PÁ xuandong@sh163.net ªº«ü¥¿¡A±N¨â³B¿ù§O¦r­×¥¿¡C
+
+ 2002¦~03¤ë18¤é ±ç©÷®õ <linuxrat@gnuchina.org>
+ ®Ú¾ÚBram Molenaar¥ý¥Í¦b2002¦~03¤ë16¤éªº¨Ó«H­n¨D¡A±Nvimtutor1.4¤¤Ä¶
+ ª©¤É¯Å¨ìvimtutor1.5¡C
+
+ 2001¦~11¤ë15¤é ±ç©÷®õ <linuxrat@gnuchina.org>
+ ±Nvimtutor1.4¤¤Ä¶ª©´£¥æµ¹Bram Molenaar©MSven Guckes¡C
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh.euc b/runtime/tutor/tutor.zh.euc
new file mode 100644
index 000000000..7f80f690b
--- /dev/null
+++ b/runtime/tutor/tutor.zh.euc
@@ -0,0 +1,851 @@
+===============================================================================
+= »¶ Ó­ ÔÄ ¶Á ¡¶ V I M ½Ì ³Ì ¡· ¡ª¡ª °æ±¾ 1.5 =
+===============================================================================
+ vim ÊÇÒ»¸ö¾ßÓкܶàÃüÁîµÄ¹¦Äܷdz£Ç¿´óµÄ±à¼­Æ÷¡£ÏÞÓÚƪ·ù£¬ÔÚ±¾½Ì³Ìµ±ÖÐ
+ ¾Í²»Ïêϸ½éÉÜÁË¡£±¾½Ì³ÌµÄÉè¼ÆÄ¿±êÊǽ²ÊöһЩ±ØÒªµÄ»ù±¾ÃüÁ¶øÕÆÎÕºÃÕâ
+ ЩÃüÁÄú¾ÍÄܹ»ºÜÈÝÒ×½«vimµ±×÷Ò»¸öͨÓõÄÍòÄܱ༭Æ÷À´Ê¹ÓÃÁË¡£
+
+ Íê³É±¾½Ì³ÌµÄÄÚÈÝ´óÔ¼ÐèÒª25-30·ÖÖÓ£¬È¡¾öÓÚÄúѵÁ·µÄʱ¼ä¡£
+
+ ÿһ½ÚµÄÃüÁî²Ù×÷½«»á¸ü¸Ä±¾ÎÄ¡£ÍƼöÄú¸´ÖƱ¾ÎĵÄÒ»¸ö¸±±¾£¬È»ºóÔÚ¸±±¾ÉÏ
+ ½øÐÐѵÁ·(Èç¹ûÄúÊÇͨ¹ý"vimtutor"À´Æô¶¯½Ì³ÌµÄ£¬ÄÇô±¾ÎľÍÒѾ­ÊǸ±±¾ÁË)¡£
+
+ ÇмÇÒ»µã¡Ã±¾½Ì³ÌµÄÉè¼Æ˼·ÊÇÔÚʹÓÃÖнøÐÐѧϰµÄ¡£Ò²¾ÍÊÇ˵£¬ÄúÐèҪͨ¹ý
+ Ö´ÐÐÃüÁîÀ´Ñ§Ï°ËüÃDZ¾ÉíµÄÕýÈ·Ó÷¨¡£Èç¹ûÄúÖ»ÊÇÔĶÁ¶ø²»²Ù×÷£¬ÄÇôÄú¿ÉÄÜ
+ »áºÜ¿ìÒÅÍüÕâЩÃüÁîµÄ£¡
+
+ ºÃÁË£¬ÏÖÔÚÇëÈ·¶¨ÄúµÄShift-Lock(´óСдËø¶¨¼ü)»¹Ã»Óа´Ï£¬È»ºó°´¼üÅÌÉÏ
+ µÄ×Öĸ¼ü j ×ã¹»¶àµÄ´ÎÊýÀ´Òƶ¯¹â±ê£¬Ö±µ½µÚÒ»½ÚµÄÄÚÈÝÄܹ»ÍêÈ«³äÂúÆÁÄ»¡£
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÒ»½²µÚÒ»½Ú¡ÃÒƶ¯¹â±ê
+
+
+ ¡ù¡ù ÒªÒƶ¯¹â±ê£¬ÇëÒÀÕÕ˵Ã÷·Ö±ð°´Ï h¡¢j¡¢k¡¢l ¼ü¡£ ¡ù¡ù
+
+ ^
+ k Ìáʾ¡Ã h µÄ¼üλÓÚ×ó±ß£¬Ã¿´Î°´Ï¾ͻáÏò×óÒƶ¯¡£
+ < h l > l µÄ¼üλÓÚÓұߣ¬Ã¿´Î°´Ï¾ͻáÏòÓÒÒƶ¯¡£
+ j j ¼ü¿´ÆðÀ´ºÜÏóÒ»Ö§¼â¶Ë·½Ïò³¯ÏµļýÍ·¡£
+ v
+
+ 1. ÇëËæÒâÔÚÆÁÄ»ÄÚÒƶ¯¹â±ê£¬Ö±ÖÁÄú¾õµÃÊæ·þΪֹ¡£
+
+ 2. °´ÏÂÏÂÐмü(j)£¬Ö±µ½³öÏÖ¹â±êÖظ´ÏÂÐС£
+
+---> ÏÖÔÚÄúÓ¦¸ÃÒѾ­Ñ§»áÈçºÎÒƶ¯µ½ÏÂÒ»½²°É¡£
+
+ 3. ÏÖÔÚÇëʹÓÃÏÂÐмü£¬½«¹â±êÒƶ¯µ½µÚ¶þ½²¡£
+
+Ìáʾ¡ÃÈç¹ûÄú²»¸ÒÈ·¶¨ÄúËù°´ÏµÄ×Öĸ£¬Çë°´ÏÂ<ESC>¼ü»Øµ½Õý³£(Normal)ģʽ¡£
+ È»ºóÔٴδӼüÅÌÊäÈëÄúÏëÒªµÄÃüÁî¡£
+
+Ìáʾ¡Ã¹â±ê¼üÓ¦µ±Ò²ÄÜÕý³£¹¤×÷µÄ¡£µ«ÊÇʹÓÃhjkl¼ü£¬ÔÚÏ°¹ßÖ®ºóÄú¾ÍÄܹ»¿ìËÙ
+ µØÔÚÆÁÄ»ÄÚËÄ´¦Òƶ¯¹â±êÁË¡£
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÒ»½²µÚ¶þ½Ú¡ÃVIMµÄ½øÈëºÍÍ˳ö
+
+
+ !! ÌرðÌáʾ¡Ã¾´ÇëÔĶÁÍêÕû±¾Ò»½ÚµÄÄÚÈÝ£¬È»ºó²ÅÄÜÖ´ÐÐÒÔÏÂËù½²½âµÄÃüÁî¡£
+
+ 1. Çë°´<ESC>¼ü(ÕâÊÇΪÁËÈ·±£Äú´¦ÔÚÕý³£Ä£Ê½)¡£
+
+ 2. È»ºóÊäÈë¡Ã :q! <»Ø³µ>
+
+---> ÕâÖÖ·½Ê½µÄÍ˳ö±à¼­Æ÷¾ø²»»á±£´æÄú½øÈë±à¼­Æ÷ÒÔÀ´Ëù×öµÄ¸Ä¶¯¡£
+ Èç¹ûÄúÏë±£´æ¸ü¸ÄÔÙÍ˳ö£¬ÇëÊäÈë¡Ã
+ :wq <»Ø³µ>
+
+ 3. Èç¹ûÄú¿´µ½ÁËÃüÁîÐÐÌáʾ·û£¬ÇëÊäÈëÄܹ»´øÄú»Øµ½±¾½Ì³ÌµÄÃüÁÄǾÍÊÇ¡Ã
+
+ vimtutor <»Ø³µ>
+
+ ͨ³£Çé¿öÏÂÄúÒ²¿ÉÒÔÓÃÕâÖÖ·½Ê½¡Ã
+
+ vim tutor <»Ø³µ>
+
+---> ÕâÀïµÄ 'vim' ±íʾ½øÈëvim±à¼­Æ÷£¬¶ø 'tutor'ÔòÊÇÄú×¼±¸Òª±à¼­µÄÎļþ¡£
+
+ 4. Èç¹ûÄú×ÔÐÅÒѾ­ÀÎÀμÇסÁËÕâЩ²½ÖèµÄ»°£¬Çë´Ó²½Öè1Ö´Ðе½²½Öè3Í˳ö£¬È»
+ ºóÔٴνøÈë±à¼­Æ÷¡£½Ó׎«¹â±êÒƶ¯µ½µÚÒ»½²µÚÈý½ÚÀ´¼ÌÐøÎÒÃǵĽ̳̽²½â¡£
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÒ»½²µÚÈý½Ú¡ÃÎı¾±à¼­Ö®É¾³ý
+
+
+ ** ÔÚÕý³£(Normal)ģʽÏ£¬¿ÉÒÔ°´Ï x ¼üÀ´É¾³ý¹â±êËùÔÚλÖõÄ×Ö·û¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐС£
+
+ 2. ΪÁËÐÞÕýÊäÈë´íÎó£¬Ç뽫¹â±êÒÆÖÁ×¼±¸É¾³ýµÄ×Ö·ûµÄλÖô¦¡£
+
+ 3. È»ºó°´Ï x ¼ü½«´íÎó×Ö·ûɾ³ýµô¡£
+
+ 4. Öظ´²½Öè2µ½²½Öè4£¬Ö±µ½¾ä×ÓÐÞÕýΪֹ¡£
+
+---> The ccow jumpedd ovverr thhe mooon.
+
+ 5. ºÃÁË£¬¸ÃÐÐÒѾ­ÐÞÕýÁË£¬ÏÂÒ»½ÚÄÚÈÝÊǵÚÒ»½²µÚËĽڡ£
+
+ÌرðÌáʾ¡ÃÔÚÄúä¯ÀÀ±¾½Ì³Ìʱ£¬²»ÒªÇ¿ÐмÇÒä¡£¼Çסһµã¡ÃÔÚʹÓÃÖÐѧϰ¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÒ»½²µÚËĽڡÃÎı¾±à¼­Ö®²åÈë
+
+
+ ** ÔÚÕý³£Ä£Ê½Ï£¬¿ÉÒÔ°´Ï i ¼üÀ´²åÈëÎı¾¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐС£
+
+ 2. ΪÁËʹµÃµÚÒ»ÐÐÄÚÈÝÀ×ͬÓÚµÚ¶þÐУ¬Ç뽫¹â±êÒÆÖÁÎı¾µÚÒ»¸ö×Ö·û×¼±¸²åÈë
+ µÄλÖá£
+
+ 3. È»ºó°´Ï i ¼ü£¬½Ó×ÅÊäÈë±ØÒªµÄÎı¾×Ö·û¡£
+
+ 4. ËùÓÐÎı¾¶¼ÐÞÕýÍê±Ï£¬Çë°´Ï <ESC> ¼ü·µ»ØÕý³£Ä£Ê½¡£
+ Öظ´²½Öè2ÖÁ²½Öè4ÒÔ±ãÐÞÕý¾ä×Ó¡£
+
+---> There is text misng this .
+---> There is some text missing from this line.
+
+ 5. Èç¹ûÄú¶ÔÎı¾²åÈë²Ù×÷ÒѾ­ºÜÂúÒ⣬Çë½Ó×ÅÔĶÁÏÂÃæµÄС½á¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÒ»½²Ð¡½á
+
+
+ 1. ¹â±êÔÚÆÁÄ»Îı¾ÖеÄÒƶ¯¼È¿ÉÒÔÓüýÍ·¼ü£¬Ò²¿ÉÒÔʹÓà hjkl ×Öĸ¼ü¡£
+ h (×óÒÆ) j (ÏÂÐÐ) k (ÉÏÐÐ) l (ÓÒÒÆ)
+
+ 2. Óû½øÈëvim±à¼­Æ÷(´ÓÃüÁîÐÐÌáʾ·û)£¬ÇëÊäÈë¡Ãvim ÎļþÃû <»Ø³µ>
+
+ 3. ÓûÍ˳övim±à¼­Æ÷£¬ÇëÊäÈëÒÔÏÂÃüÁî·ÅÆúËùÓÐÐ޸ġÃ
+
+ <ESC> :q! <»Ø³µ>
+
+ »òÕßÊäÈëÒÔÏÂÃüÁî±£´æËùÓÐÐ޸ġÃ
+
+ <ESC> :wq <»Ø³µ>
+
+ 4. ÔÚÕý³£Ä£Ê½ÏÂɾ³ý¹â±êËùÔÚλÖõÄ×Ö·û£¬Çë°´¡Ã x
+
+ 5. ÔÚÕý³£Ä£Ê½ÏÂÒªÔÚ¹â±êËùÔÚλÖÿªÊ¼²åÈëÎı¾£¬Çë°´¡Ã
+
+ i ÊäÈë±ØÒªÎı¾ <ESC>
+
+ÌرðÌáʾ¡Ã°´Ï <ESC> ¼ü»á´øÄú»Øµ½Õý³£Ä£Ê½»òÕßÈ¡ÏûÒ»¸ö²»ÆÚÍû»òÕß²¿·ÖÍê³É
+µÄÃüÁî¡£
+
+ºÃÁË£¬µÚÒ»½²µ½´Ë½áÊø¡£ÏÂÃæ½ÓÏÂÀ´¼ÌÐøµÚ¶þ½²µÄÄÚÈÝ¡£
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²µÚÒ»½Ú¡Ãɾ³ýÀàÃüÁî
+
+
+ ** ÊäÈë dw ¿ÉÒÔ´Ó¹â±ê´¦É¾³ýÖÁÒ»¸öµ¥×Ö/µ¥´ÊµÄĩβ¡£**
+
+ 1. Çë°´Ï <ESC> ¼üÈ·±£Äú´¦ÓÚÕý³£Ä£Ê½¡£
+
+ 2. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐС£
+
+ 3. Ç뽫¹â±êÒÆÖÁ×¼±¸ÒªÉ¾³ýµÄµ¥´ÊµÄ¿ªÊ¼¡£
+
+ 4. ½Ó×ÅÊäÈë dw ɾ³ýµô¸Ãµ¥´Ê¡£
+
+ ÌرðÌáʾ¡ÃÄúËùÊäÈëµÄ dw »áÔÚÄúÊäÈëµÄͬʱ³öÏÖÔÚÆÁÄ»µÄ×îºóÒ»ÐС£Èç¹ûÄúÊä
+ ÈëÓÐÎó£¬Çë°´Ï <ESC> ¼üÈ¡Ïû£¬È»ºóÖØÐÂÔÙÀ´¡£
+
+---> There are a some words fun that don't belong paper in this sentence.
+
+ 5. Öظ´²½Öè3ÖÁ²½Öè4£¬Ö±ÖÁ¾ä×ÓÐÞÕýÍê±Ï¡£½Ó׿ÌÐøµÚ¶þ½²µÚ¶þ½ÚÄÚÈÝ¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²µÚ¶þ½Ú¡ÃÆäËûɾ³ýÀàÃüÁî
+
+
+ ** ÊäÈë d$ ´Óµ±Ç°¹â±êɾ³ýµ½ÐÐÄ©¡£**
+
+ 1. Çë°´Ï <ESC> ¼üÈ·±£Äú´¦ÓÚÕý³£Ä£Ê½¡£
+
+ 2. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐС£
+
+ 3. Ç뽫¹â±êÒƶ¯µ½¸ÃÐеÄβ²¿(Ò²¾ÍÊÇÔÚµÚÒ»¸öµãºÅ¡®.¡¯ºóÃæ)¡£
+
+ 4. È»ºóÊäÈë d$ ´Ó¹â±ê´¦É¾ÖÁµ±Ç°ÐÐβ²¿¡£
+
+---> Somebody typed the end of this line twice. end of this line twice.
+
+
+ 5. Çë¼ÌÐøѧϰµÚ¶þ½²µÚÈý½Ú¾ÍÖªµÀÊÇÔõô»ØÊÂÁË¡£
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²µÚÈý½Ú¡Ã¹ØÓÚÃüÁîºÍ¶ÔÏó
+
+
+ ɾ³ýÃüÁî d µÄ¸ñʽÈçÏ¡Ã
+
+ [number] d object »òÕß d [number] object
+
+ ÆäÒâÈçÏ¡Ã
+ number - ´ú±íÖ´ÐÐÃüÁîµÄ´ÎÊý(¿ÉÑ¡ÏȱʡÉèÖÃΪ 1 )¡£
+ d - ´ú±íɾ³ý¡£
+ object - ´ú±íÃüÁîËùÒª²Ù×÷µÄ¶ÔÏó(ÏÂÃæÓÐÏà¹Ø½éÉÜ)¡£
+
+ Ò»¸ö¼ò¶ÌµÄ¶ÔÏóÁбí¡Ã
+ w - ´Óµ±Ç°¹â±êµ±Ç°Î»ÖÃÖ±µ½µ¥×Ö/µ¥´Êĩ⣬°üÀ¨¿Õ¸ñ¡£
+ e - ´Óµ±Ç°¹â±êµ±Ç°Î»ÖÃÖ±µ½µ¥×Ö/µ¥´Êĩ⣬µ«ÊÇ *²»* °üÀ¨¿Õ¸ñ¡£
+ $ - ´Óµ±Ç°¹â±êµ±Ç°Î»ÖÃÖ±µ½µ±Ç°ÐÐÄ©¡£
+
+ÌرðÌáʾ¡Ã
+ ¶ÔÓÚÓÂÓÚ̽Ë÷Õߣ¬ÇëÔÚÕý³£Ä£Ê½ÏÂÃæ½ö°´´ú±íÏàÓ¦¶ÔÏóµÄ¼ü¶ø²»Ê¹ÓÃÃüÁÔò
+ ½«¿´µ½¹â±êµÄÒƶ¯ÕýÈçÉÏÃæµÄ¶ÔÏóÁбíËù´ú±íµÄÒ»Ñù¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²µÚËĽڡöÔÏóÃüÁîµÄÌØÊâÇé¿ö
+
+
+ ** ÊäÈë dd ¿ÉÒÔɾ³ýÕûÒ»¸öµ±Ç°ÐС£ **
+
+ ¼øÓÚÕûÐÐɾ³ýµÄ¸ßƵ¶È£¬VIM µÄÉè¼ÆÕß¾ö¶¨Òª¼ò»¯ÕûÐÐɾ³ý£¬½öÐèÒªÔÚͬһÐÐÉÏ
+ »÷´òÁ½´Î d ¾Í¿ÉÒÔɾ³ýµô¹â±êËùÔÚµÄÕûÐÐÁË¡£
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæµÄ¶Ì¾ä¶ÎÂäÖеĵڶþÐС£
+ 2. ÊäÈë dd ɾ³ý¸ÃÐС£
+ 3. È»ºóÒƶ¯µ½µÚËÄÐС£
+ 4. ½Ó×ÅÊäÈë 2dd (»¹¼ÇµÃÇ°Ãæ½²¹ýµÄ number-command-object Âð£¿) ɾ³ýÁ½ÐС£
+
+ 1) Roses are red,
+ 2) Mud is fun,
+ 3) Violets are blue,
+ 4) I have a car,
+ 5) Clocks tell time,
+ 6) Sugar is sweet
+ 7) And so are you.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²µÚÎå½Ú¡Ã³·ÏûÀàÃüÁî
+
+
+ ** ÊäÈë u À´³·Ïû×îºóÖ´ÐеÄÃüÁÊäÈë U À´ÐÞÕýÕûÐС£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐУ¬²¢½«ÆäÖÃÓÚµÚÒ»¸ö´íÎó
+ ´¦¡£
+ 2. ÊäÈë x ɾ³ýµÚÒ»¸ö²»Ïë±£ÁôµÄ×Öĸ¡£
+ 3. È»ºóÊäÈë u ³·Ïû×îºóÖ´ÐеÄ(Ò»´Î)ÃüÁî¡£
+ 4. Õâ´ÎҪʹÓà x ÐÞÕý±¾ÐеÄËùÓдíÎó¡£
+ 5. ÏÖÔÚÊäÈëÒ»¸ö´óдµÄ U £¬»Ö¸´µ½¸ÃÐеÄԭʼ״̬¡£
+ 6. ½Ó×Ŷà´ÎÊäÈë u ÒÔ³·Ïû U ÒÔ¼°¸üÇ°µÄÃüÁî¡£
+ 7. È»ºó¶à´ÎÊäÈë CTRL-R (ÏÈ°´Ï CTRL ¼ü²»·Å¿ª£¬½Ó×ÅÊäÈë R ¼ü) £¬ÕâÑù¾Í
+ ¿ÉÒÔÖ´Ðлָ´ÃüÁҲ¾ÍÊdz·Ïûµô³·ÏûÃüÁî¡£
+
+---> Fiix the errors oon thhis line and reeplace them witth undo.
+
+ 8. ÕâЩ¶¼ÊǷdz£ÓÐÓõÄÃüÁî¡£ÏÂÃæÊǵڶþ½²µÄС½áÁË¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ¶þ½²Ð¡½á
+
+
+ 1. Óû´Óµ±Ç°¹â±êɾ³ýÖÁµ¥×Ö/µ¥´Êĩ⣬ÇëÊäÈë¡Ãdw
+
+ 2. Óû´Óµ±Ç°¹â±êɾ³ýÖÁµ±Ç°ÐÐĩ⣬ÇëÊäÈë¡Ãd$
+
+ 3. Óûɾ³ýÕûÐУ¬ÇëÊäÈë¡Ãdd
+
+ 4. ÔÚÕý³£Ä£Ê½ÏÂÒ»¸öÃüÁîµÄ¸ñʽÊÇ¡Ã
+
+ [number] command object »òÕß command [number] object
+ ÆäÒâÊÇ¡Ã
+ number - ´ú±íµÄÊÇÃüÁîÖ´ÐеĴÎÊý
+ command - ´ú±íÒª×öµÄÊÂÇ飬±ÈÈç d ´ú±íɾ³ý
+ object - ´ú±íÒª²Ù×÷µÄ¶ÔÏ󣬱ÈÈç w ´ú±íµ¥×Ö/µ¥´Ê£¬$ ´ú±íµ½ÐÐÄ©µÈµÈ¡£
+ $ (to the end of line), etc.
+
+ 5. Óû³·ÏûÒÔÇ°µÄ²Ù×÷£¬ÇëÊäÈë¡Ãu (СдµÄu)
+ Óû³·ÏûÔÚÒ»ÐÐÖÐËù×öµÄ¸Ä¶¯£¬ÇëÊäÈë¡ÃU (´óдµÄU)
+ Óû³·ÏûÒÔÇ°µÄ³·ÏûÃüÁ»Ö¸´ÒÔÇ°µÄ²Ù×÷½á¹û£¬ÇëÊäÈë¡ÃCTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÈý½²µÚÒ»½Ú¡ÃÖÃÈëÀàÃüÁî
+
+
+ ** ÊäÈë p ½«×îºóÒ»´Îɾ³ýµÄÄÚÈÝÖÃÈë¹â±êÖ®ºó **
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæʾ·¶¶ÎÂäµÄÊ×ÐС£
+
+ 2. ÊäÈë dd ½«¸ÃÐÐɾ³ý£¬ÕâÑù»á½«¸ÃÐб£´æµ½vimµÄ»º³åÇøÖС£
+
+ 3. ½Ó׎«¹â±êÒƶ¯µ½×¼±¸ÖÃÈëµÄλÖõÄÉÏ·½¡£¼Çס¡ÃÊÇÉÏ·½Å¶¡£
+
+ 4. È»ºóÔÚÕý³£Ä£Ê½ÏÂ(<ESC>¼ü½øÈë)£¬ÊäÈë p ½«¸ÃÐÐÕ³ÌùÖÃÈë¡£
+
+ 5. Öظ´²½Öè2ÖÁ²½Öè4£¬½«ËùÓеÄÐÐÒÀÐò·ÅÖõ½ÕýÈ·µÄλÖÃÉÏ¡£
+
+ d) Can you learn too?
+ b) Violets are blue,
+ c) Intelligence is learned,
+ a) Roses are red,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÈý½²µÚ¶þ½Ú¡ÃÌæ»»ÀàÃüÁî
+
+
+ ** ÊäÈë r ºÍÒ»¸ö×Ö·ûÌæ»»¹â±êËùÔÚλÖõÄ×Ö·û¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐС£
+
+ 2. ÇëÒƶ¯¹â±êµ½µÚÒ»¸ö´íÎóµÄÊʵ±Î»Öá£
+
+ 3. ½Ó×ÅÊäÈë r £¬ÕâÑù¾ÍÄܽ«´íÎóÌæ»»µôÁË¡£
+
+ 4. Öظ´²½Öè2ºÍ²½Öè3£¬Ö±µ½µÚÒ»ÐÐÒѾ­ÐÞ¸ÄÍê±Ï¡£
+
+---> Whan this lime was tuoed in, someone presswd some wrojg keys!
+---> When this line was typed in, someone pressed some wrong keys!
+
+ 5. È»ºóÎÒÃǼÌÐøѧУµÚÈý½²µÚÈý½Ú¡£
+
+ÌرðÌáʾ¡ÃÇмÇÄúÒªÔÚʹÓÃÖÐѧϰ£¬¶ø²»ÊÇÔÚ¼ÇÒäÖÐѧϰ¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÈý½²µÚÈý½Ú¡Ã¸ü¸ÄÀàÃüÁî
+
+
+ ** Òª¸Ä±äÒ»¸öµ¥×Ö/µ¥´ÊµÄ²¿·Ö»òÕßÈ«²¿£¬ÇëÊäÈë cw **
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐС£
+
+ 2. ½Ó×Űѹâ±ê·ÅÔÚµ¥´Ê lubw µÄ×Öĸ u µÄλÖÃÄÇÀï¡£
+
+ 3. È»ºóÊäÈë cw ¾Í¿ÉÒÔÐÞÕý¸Ãµ¥´ÊÁË(ÔÚ±¾ÀýÕâÀïÊÇÊäÈë ine ¡£)
+
+ 4. ×îºó°´ <ESC> ¼ü£¬È»ºó¹â±ê¶¨Î»µ½ÏÂÒ»¸ö´íÎóµÚÒ»¸ö×¼±¸¸ü¸ÄµÄ×Öĸ´¦¡£
+
+ 5. Öظ´²½Öè3ºÍ²½Öè4£¬Ö±µ½µÚÒ»¸ö¾ä×ÓÍêÈ«À×ͬµÚ¶þ¸ö¾ä×Ó¡£
+
+---> This lubw has a few wptfd that mrrf changing usf the change command.
+---> This line has a few words that need changing using the change command.
+
+Ìáʾ¡ÃÇë×¢Òâ cw ÃüÁî²»½ö½öÊÇÌæ»»ÁËÒ»¸öµ¥´Ê£¬Ò²ÈÃÄú½øÈëÎı¾²åÈë״̬ÁË¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÈý½²µÚËĽڡÃʹÓÃcÖ¸ÁîµÄÆäËû¸ü¸ÄÀàÃüÁî
+
+
+ ** ¸ü¸ÄÀàÖ¸Áî¿ÉÒÔʹÓÃͬɾ³ýÀàÃüÁîËùʹÓõĶÔÏó²ÎÊý¡£**
+
+ 1. ¸ü¸ÄÀàÖ¸ÁîµÄ¹¤×÷·½Ê½¸úɾ³ýÀàÃüÁîÊÇÒ»Öµġ£²Ù×÷¸ñʽÊÇ¡Ã
+
+ [number] c object »òÕß c [number] object
+
+ 2. ¶ÔÏó²ÎÊýÒ²ÊÇÒ»ÑùµÄ£¬±ÈÈç w ´ú±íµ¥×Ö/µ¥´Ê£¬$´ú±íÐÐÄ©µÈµÈ¡£
+
+ 3. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐС£
+
+ 4. ½Ó׎«¹â±êÒƶ¯µ½µÚÒ»¸ö´íÎ󴦡£
+
+ 5. È»ºóÊäÈë c$ ʹµÃ¸ÃÐÐʣϵIJ¿·Ö¸üÕýµÃͬµÚ¶þÐÐÒ»Ñù¡£×îºó°´ <ESC> ¼ü¡£
+
+---> The end of this line needs some help to make it like the second.
+---> The end of this line needs to be corrected using the c$ command.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÈý½²Ð¡½á
+
+
+ 1. ÒªÖØÐÂÖÃÈëÒѾ­É¾³ýµÄÎı¾ÄÚÈÝ£¬ÇëÊäÈëСд×Öĸ p¡£¸Ã²Ù×÷¿ÉÒÔ½«ÒÑɾ³ý
+ µÄÎı¾ÄÚÈÝÖÃÓÚ¹â±êÖ®ºó¡£Èç¹û×îºóÒ»´Îɾ³ýµÄÊÇÒ»¸öÕûÐУ¬ÄÇô¸ÃÐн«ÖÃ
+ ÓÚµ±Ç°¹â±êËùÔÚÐеÄÏÂÒ»ÐС£
+
+ 2. ÒªÌæ»»¹â±êËùÔÚλÖõÄ×Ö·û£¬ÇëÊäÈëСдµÄ r ºÍÒªÌæ»»µôԭλÖÃ×Ö·ûµÄÐÂ×Ö
+ ·û¼´¿É¡£
+
+ 3. ¸ü¸ÄÀàÃüÁîÔÊÐíÄú¸Ä±äÖ¸¶¨µÄ¶ÔÏ󣬴ӵ±Ç°¹â±êËùÔÚλÖÃÖ±µ½¶ÔÏóµÄĩβ¡£
+ ±ÈÈçÊäÈë cw ¿ÉÒÔÌæ»»µ±Ç°¹â±êµ½µ¥´ÊµÄĩβµÄÄÚÈÝ£»ÊäÈë c$ ¿ÉÒÔÌæ»»µ±
+ Ç°¹â±êµ½ÐÐÄ©µÄÄÚÈÝ¡£
+
+ 4. ¸ü¸ÄÀàÃüÁîµÄ¸ñʽÊÇ¡Ã
+
+ [number] c object »òÕß c [number] object
+
+ÏÂÃæÎÒÃǼÌÐøѧϰÏÂÒ»½²¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚËĽ²µÚÒ»½Ú¡Ã¶¨Î»¼°Îļþ״̬
+
+
+ ** ÊäÈë CTRL-g ÏÔʾµ±Ç°±à¼­ÎļþÖе±Ç°¹â±êËùÔÚÐÐλÖÃÒÔ¼°Îļþ״̬ÐÅÏ¢¡£
+ ÊäÈë SHIFT-G ÔòÖ±½ÓÌøתµ½ÎļþÖеÄijһָ¶¨ÐС£**
+
+ Ìáʾ¡ÃÇмÇÒªÏÈͨ¶Á±¾½ÚÄÚÈÝ£¬Ö®ºó²Å¿ÉÒÔÖ´ÐÐÒÔϲ½Öè!!!
+
+ 1. °´Ï CTRL ¼ü²»·Å¿ªÈ»ºó°´ g ¼ü¡£È»ºó¾Í»á¿´µ½Ò³Ãæ×îµ×²¿³öÏÖÒ»¸ö״̬ÐÅ
+ Ï¢ÐУ¬ÏÔʾµÄÄÚÈÝÊǵ±Ç°±à¼­µÄÎļþÃûºÍÎļþµÄ×ÜÐÐÊý¡£Çë¼Çס²½Öè3µÄÐкš£
+
+ 2. °´Ï SHIFT-G ¼ü¿ÉÒÔʹµÃµ±Ç°¹â±êÖ±½ÓÌøתµ½Îļþ×îºóÒ»ÐС£
+
+ 3. ÊäÈëÄúÔøÍ£ÁôµÄÐкţ¬È»ºó°´Ï SHIFT-G¡£ÕâÑù¾Í¿ÉÒÔ·µ»Øµ½ÄúµÚÒ»´Î°´ÏÂ
+ CTRL-g ʱËùÔÚµÄÐкÃÁË¡£×¢Òâ¡ÃÊäÈëÐкÅʱ£¬ÐкÅÊDz»»áÔÚÆÁÄ»ÉÏÏÔʾ³öÀ´
+ µÄ¡£
+
+ 4. Èç¹ûÔ¸Ò⣬Äú¿ÉÒÔ¼ÌÐøÖ´Ðв½Öè1ÖÁ²½ÖèÈý¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚËĽ²µÚ¶þ½Ú¡ÃËÑË÷ÀàÃüÁî
+
+
+ ** ÊäÈë / ÒÔ¼°Î²ËæµÄ×Ö·û´®¿ÉÒÔÓÃÒÔÔÚµ±Ç°ÎļþÖвéÕÒ¸Ã×Ö·û´®¡£**
+
+ 1. ÔÚÕý³£Ä£Ê½ÏÂÊäÈë / ×Ö·û¡£Äú´Ëʱ»á×¢Òâµ½¸Ã×Ö·ûºÍ¹â±ê¶¼»á³öÏÖÔÚÆÁÄ»µ×
+ ²¿£¬Õâ¸ú : ÃüÁîÊÇÒ»ÑùµÄ¡£
+
+ 2. ½Ó×ÅÊäÈë errroor <»Ø³µ>¡£ÄǸöerrroor¾ÍÊÇÄúÒª²éÕÒµÄ×Ö·û´®¡£
+
+ 3. Òª²éÕÒͬÉÏÒ»´ÎµÄ×Ö·û´®£¬Ö»ÐèÒª°´ n ¼ü¡£ÒªÏòÏà·´·½Ïò²éÕÒͬÉÏÒ»´ÎµÄ×Ö
+ ·û´®£¬ÇëÊäÈë Shift-N ¼´¿É¡£
+
+ 4. Èç¹ûÄúÏëÄæÏò²éÕÒ×Ö·û´®£¬ÇëʹÓà ? ´úÌæ / ½øÐС£
+
+---> When the search reaches the end of the file it will continue at the start.
+
+ "errroor" is not the way to spell error; errroor is an error.
+
+ Ìáʾ¡ÃÈç¹û²éÕÒÒѾ­µ½´ïÎļþĩ⣬²éÕÒ»á×Ô¶¯´ÓÎļþÍ·²¿¼ÌÐø²éÕÒ¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚËĽ²µÚÈý½Ú¡ÃÅä¶ÔÀ¨ºÅµÄ²éÕÒ
+
+
+ ** °´ % ¿ÉÒÔ²éÕÒÅä¶ÔµÄÀ¨ºÅ )¡¢]¡¢}¡£**
+
+ 1. °Ñ¹â±ê·ÅÔÚ±¾½ÚÏÂÃæ±ê¼ÇÓÐ --> ÄÇÒ»ÐÐÖеÄÈκÎÒ»¸ö (¡¢[ »ò { ´¦¡£
+
+ 2. ½Ó×Å°´ % ×Ö·û¡£
+
+ 3. ´Ëʱ¹â±êµÄλÖÃÓ¦µ±ÊÇÔÚÅä¶ÔµÄÀ¨ºÅ´¦¡£
+
+ 4. Ôٴΰ´ % ¾Í¿ÉÒÔÌø»ØÅä¶ÔµÄµÚÒ»¸öÀ¨ºÅ´¦¡£
+
+---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
+
+Ìáʾ¡ÃÔÚ³ÌÐòµ÷ÊÔʱ£¬Õâ¸ö¹¦ÄÜÓÃÀ´²éÕÒ²»Åä¶ÔµÄÀ¨ºÅÊǺÜÓÐÓõġ£
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚËĽ²µÚËĽڡÃÐÞÕý´íÎóµÄ·½·¨Ö®Ò»
+
+
+ ** ÊäÈë :s/old/new/g ¿ÉÒÔÌæ»» old Ϊ new¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐС£
+
+ 2. ÊäÈë :s/thee/the <»Ø³µ> ¡£Çë×¢Òâ¸ÃÃüÁîÖ»¸Ä±ä¹â±êËùÔÚÐеĵÚÒ»¸öÆ¥Åä
+ ´®¡£
+
+ 3. ÊäÈë :s/thee/the/g ÔòÊÇÌ滻ȫÐеÄÆ¥Åä´®¡£
+
+---> the best time to see thee flowers is in thee spring.
+
+ 4. ÒªÌæ»»Á½ÐÐÖ®¼ä³öÏÖµÄÿ¸öÆ¥Åä´®£¬ÇëÊäÈë :#,#s/old/new/g (#,#´ú±íµÄÊÇ
+ Á½ÐеÄÐкÅ)¡£ÊäÈë :%s/old/new/g ÔòÊÇÌæ»»Õû¸öÎļþÖеÄÿ¸öÆ¥Åä´®¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚËĽ²Ð¡½á
+
+
+ 1. Ctrl-g ÓÃÓÚÏÔʾµ±Ç°¹â±êËùÔÚλÖúÍÎļþ״̬ÐÅÏ¢¡£Shift-G ÓÃÓÚ½«¹â±êÌø
+ תÖÁÎļþ×îºóÒ»ÐС£ÏÈÇÃÈëÒ»¸öÐкÅÈ»ºó°´ Shift-G ÔòÊǽ«¹â±êÒƶ¯ÖÁ¸ÃÐÐ
+ ºÅ´ú±íµÄÐС£
+
+ 2. ÊäÈë / È»ºó½ôËæÒ»¸ö×Ö·û´®ÊÇÔòÊÇÔÚµ±Ç°Ëù±à¼­µÄÎĵµÖÐÏòºó²éÕÒ¸Ã×Ö·û´®¡£
+ ÊäÈëÎʺŠ? È»ºó½ôËæÒ»¸ö×Ö·û´®ÊÇÔòÊÇÔÚµ±Ç°Ëù±à¼­µÄÎĵµÖÐÏòÇ°²éÕÒ¸Ã×Ö
+ ·û´®¡£Íê³ÉÒ»´Î²éÕÒÖ®ºó°´ n ¼üÔòÊÇÖظ´ÉÏÒ»´ÎµÄÃüÁ¿ÉÔÚͬһ·½ÏòÉϲé
+ ÕÒÏÂÒ»¸ö×Ö·û´®ËùÔÚ£»»òÕß°´ Shift-N ÏòÏà·´·½Ïò²éÕÒϸÃ×Ö·û´®ËùÔÚ¡£
+
+ 3. Èç¹û¹â±êµ±Ç°Î»ÖÃÊÇÀ¨ºÅ(¡¢)¡¢[¡¢]¡¢{¡¢}£¬°´ % ¿ÉÒÔ½«¹â±êÒƶ¯µ½Åä¶ÔµÄ
+ À¨ºÅÉÏ¡£
+
+ 4. ÔÚÒ»ÐÐÄÚÌ滻ͷһ¸ö×Ö·û´® old ΪеÄ×Ö·û´® new£¬ÇëÊäÈë :s/old/new
+ ÔÚÒ»ÐÐÄÚÌæ»»ËùÓеÄ×Ö·û´® old ΪеÄ×Ö·û´® new£¬ÇëÊäÈë :s/old/new/g
+ ÔÚÁ½ÐÐÄÚÌæ»»ËùÓеÄ×Ö·û´® old ΪеÄ×Ö·û´® new£¬ÇëÊäÈë :#,#s/old/new/g
+ ÔÚÎļþÄÚÌæ»»ËùÓеÄ×Ö·û´® old ΪеÄ×Ö·û´® new£¬ÇëÊäÈë :%s/old/new/g
+ ½øÐÐÈ«ÎÄÌ滻ʱѯÎÊÓû§È·ÈÏÿ¸öÌæ»»ÐèÌí¼Ó c Ñ¡ÏÇëÊäÈë :%s/old/new/gc
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÎå½²µÚÒ»½Ú¡ÃÔÚ VIM ÄÚÖ´ÐÐÍⲿÃüÁîµÄ·½·¨
+
+
+ ** ÊäÈë :! È»ºó½ôËæÖøÊäÈëÒ»¸öÍⲿÃüÁî¿ÉÒÔÖ´ÐиÃÍⲿÃüÁî¡£**
+
+ 1. °´ÏÂÎÒÃÇËùÊìϤµÄ : ÃüÁîÉèÖùâ±êµ½ÆÁÄ»µ×²¿¡£ÕâÑù¾Í¿ÉÒÔÈÃÄúÊäÈëÃüÁîÁË¡£
+
+ 2. ½Ó×ÅÊäÈë¸Ð̾ºÅ ! Õâ¸ö×Ö·û£¬ÕâÑù¾ÍÔÊÐíÄúÖ´ÐÐÍⲿµÄ shell ÃüÁîÁË¡£
+
+ 3. ÎÒÃÇÒÔ ls ÃüÁîΪÀý¡£ÊäÈë !ls <»Ø³µ> ¡£¸ÃÃüÁî¾Í»áÁоٳöÄúµ±Ç°Ä¿Â¼µÄ
+ ÄÚÈÝ£¬¾ÍÈçͬÄúÔÚÃüÁîÐÐÌáʾ·ûÏÂÊäÈë ls ÃüÁîµÄ½á¹ûÒ»Ñù¡£Èç¹û !ls ûÆð
+ ×÷Óã¬Äú¿ÉÒÔÊÔÊÔ :!dir ¿´¿´¡£
+
+---> Ìáʾ¡Ã ËùÓеÄÍⲿÃüÁ¿ÉÒÔÒÔÕâÖÖ·½Ê½Ö´ÐС£
+
+---> Ìáʾ¡Ã ËùÓÐµÄ : ÃüÁ±ØÐëÒÔ <»Ø³µ> ¸æÖÕ¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÎå½²µÚ¶þ½Ú¡Ã¹ØÓÚ±£´æÎļþµÄ¸ü¶àÐÅÏ¢
+
+
+ ** Òª½«¶ÔÎļþµÄ¸Ä¶¯±£´æµ½ÎļþÖУ¬ÇëÊäÈë :w FILENAME ¡£**
+
+ 1. ÊäÈë :!dir »òÕß :!ls »ñÖªµ±Ç°Ä¿Â¼µÄÄÚÈÝ¡£ÄúÓ¦µ±ÒÑÖªµÀ×îºó»¹µÃÇÃ
+ <»Ø³µ> °É¡£
+
+ 2. Ñ¡ÔñÒ»¸öÉÐδ´æÔÚÎļþÃû£¬±ÈÈç TEST ¡£
+
+ 3. ½Ó×ÅÊäÈë :w TEST (´Ë´¦ TEST ÊÇÄúËùÑ¡ÔñµÄÎļþÃû¡£)
+
+ 4. ¸ÃÃüÁî»áÒÔ TEST ΪÎļþÃû±£´æÕû¸öÎļþ (VIM ½Ì³Ì)¡£ÎªÁËÈ·±£ÕýÈ·±£´æ£¬
+ ÇëÔÙ´ÎÊäÈë :!dir ²é¿´ÄúµÄĿ¼ÁбíÄÚÈÝ¡£
+
+---> Çë×¢Òâ¡ÃÈç¹ûÄúÍ˳ö VIM È»ºóÔÚÒÔÎļþÃû TEST Ϊ²ÎÊý½øÈ룬ÄÇô¸ÃÎļþÄÚ
+ ÈÝÓ¦¸ÃͬÄú±£´æʱµÄÎļþÄÚÈÝÊÇÍêÈ«Ò»ÑùµÄ¡£
+
+ 5. ÏÖÔÚÄú¿ÉÒÔͨ¹ýÊäÈë :!rm TEST À´É¾³ý TEST ÎļþÁË¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÎå½²µÚÈý½Ú¡ÃÒ»¸ö¾ßÓÐÑ¡ÔñÐԵı£´æÃüÁî
+
+
+ ** Òª±£´æÎļþµÄ²¿·ÖÄÚÈÝ£¬ÇëÊäÈë :#,# w FILENAME **
+
+ 1. ÔÙÀ´Ö´ÐÐÒ»´Î :!dir »òÕß :!ls »ñÖªµ±Ç°Ä¿Â¼µÄÄÚÈÝ£¬È»ºóÑ¡ÔñÒ»¸öºÏÊʵÄ
+ ²»ÖØÃûµÄÎļþÃû£¬±ÈÈç TEST ¡£
+
+ 2. ½Ó׎«¹â±êÒƶ¯ÖÁ±¾Ò³µÄ×¶Ë£¬È»ºó°´ CTRL-g ÕÒµ½¸ÃÐеÄÐкš£±ðÍüÁË
+ ÐкÅŶ¡£
+
+ 3. ½Ó×Űѹâ±êÒƶ¯ÖÁ±¾Ò³µÄ×îµ×¶Ë£¬ÔÙ°´Ò»´Î CTRL-g ¡£Ò²±ðÍüÁËÕâ¸öÐкÃŶ¡£
+
+ 4. ΪÁËÖ»±£´æÎÄÕµÄij¸ö²¿·Ö£¬ÇëÊäÈë :#,# w TEST ¡£ÕâÀïµÄ #,# ¾ÍÊÇÉÏÃæ
+ ÒªÇóÄú¼ÇסµÄÐкÅ(¶¥¶ËÐкÅ,µ×¶ËÐкÅ)£¬¶ø TEST ¾ÍÊÇÑ¡¶¨µÄÎļþÃû¡£
+
+ 5. ×îºó£¬Óà :!dir È·ÈÏÎļþÊÇ·ñÕýÈ·±£´æ¡£µ«ÊÇÕâ´ÎÏȱðɾ³ýµô¡£
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÎå½²µÚËĽڡÃÌáÈ¡ºÍºÏ²¢Îļþ
+
+
+ ** ÒªÏòµ±Ç°ÎļþÖвåÈëÁíÍâµÄÎļþµÄÄÚÈÝ£¬ÇëÊäÈë :r FILENAME **
+
+ 1. Çë¼üÈë :!dir È·ÈÏÄúÇ°Ãæ´´½¨µÄ TEST Îļþ»¹ÔÚ¡£
+
+ 2. È»ºó½«¹â±êÒƶ¯ÖÁµ±Ç°Ò³ÃæµÄ¶¥¶Ë¡£
+
+ÌرðÌáʾ¡Ã Ö´Ðв½Öè3Ö®ºóÄú½«¿´µ½µÚÎå½²µÚÈý½Ú£¬Çë½ìʱÔÙÍùÏÂÒƶ¯»Øµ½ÕâÀïÀ´¡£
+
+ 3. ½Ó×Åͨ¹ý :r TEST ½«Ç°Ãæ´´½¨µÄÃûΪ TEST µÄÎļþÌáÈ¡½øÀ´¡£
+
+ÌرðÌáʾ¡ÃÄúËùÌáÈ¡½øÀ´µÄÎļþ½«´Ó¹â±êËùÔÚλÖô¦¿ªÊ¼ÖÃÈë¡£
+
+ 4. ΪÁËÈ·ÈÏÎļþÒѾ­ÌáÈ¡³É¹¦£¬Òƶ¯¹â±ê»Øµ½Ô­À´µÄλÖþͿÉÒÔ×¢ÒâÓÐÁ½·ÝµÚ
+ Îå½²µÚÈý½Ú£¬Ò»·ÝÊÇÔ­±¾£¬ÁíÍâÒ»·ÝÊÇÀ´×ÔÎļþµÄ¸±±¾¡£
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÎ彲С½á
+
+
+ 1. :!command ÓÃÓÚÖ´ÐÐÒ»¸öÍⲿÃüÁî command¡£
+
+ Ç뿴һЩʵ¼ÊÀý×Ó¡Ã
+ :!dir - ÓÃÓÚÏÔʾµ±Ç°Ä¿Â¼µÄÄÚÈÝ¡£
+ :!rm FILENAME - ÓÃÓÚɾ³ýÃûΪ FILENAME µÄÎļþ¡£
+
+ 2. :w FILENAME ¿É½«µ±Ç° VIM ÖÐÕýÔڱ༭µÄÎļþ±£´æµ½ÃûΪ FILENAME µÄÎÄ
+ ¼þÖС£
+
+ 3. :#,#w FILENAME ¿É½«µ±Ç°±à¼­ÎļþµÚ # ÐÐÖÁµÚ # ÐеÄÄÚÈݱ£´æµ½Îļþ
+ FILENAME ÖС£
+
+ 4. :r FILENAME ¿ÉÌáÈ¡´ÅÅÌÎļþ FILENAME ²¢½«Æä²åÈëµ½µ±Ç°ÎļþµÄ¹â±êλÖÃ
+ ºóÃæ¡£
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÁù½²µÚÒ»½Ú¡Ã´ò¿ªÀàÃüÁî
+
+
+ ** ÊäÈë o ½«ÔÚ¹â±êµÄÏ·½´ò¿ªÐµÄÒ»Ðв¢½øÈë²åÈëģʽ¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄÄÇÒ»ÐС£
+
+ 2. ½Ó×ÅÊäÈëСдµÄ o ÔÚ¹â±ê *Ï·½* ´ò¿ªÐµÄÒ»Ðв¢½øÈë²åÈëģʽ¡£
+
+ 3. È»ºó¸´ÖƱê¼ÇÓÐ ---> µÄÐв¢°´ <ESC> ¼üÍ˳ö²åÈëģʽ¶ø½øÈëÕý³£Ä£Ê½¡£
+
+---> After typing o the cursor is placed on the open line in Insert mode.
+
+ 4. ΪÁËÔÚ¹â±ê *ÉÏ·½* ´ò¿ªÐµÄÒ»ÐУ¬Ö»ÐèÒªÊäÈë´óдµÄ O ¶ø²»ÊÇСдµÄ o
+ ¾Í¿ÉÒÔÁË¡£ÇëÔÚÏÂÐвâÊÔһϰɡ£µ±¹â±ê´¦ÔÚÔÚ¸ÃÐÐÉÏʱ£¬°´ Shift-O¿ÉÒÔ
+ ÔÚ¸ÃÐÐÉÏ·½Ð¿ªÒ»ÐС£
+
+Open up a line above this by typing Shift-O while the cursor is on this line.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÁù½²µÚ¶þ½Ú¡Ã¹â±êºó²åÈëÀàÃüÁî
+
+
+ ** ÊäÈë a ½«¿ÉÔÚ¹â±êÖ®ºó²åÈëÎı¾¡£ **
+
+ 1. ÇëÔÚÕý³£Ä£Ê½ÏÂͨ¹ýÊäÈë $ ½«¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐÐ
+ µÄĩβ¡£
+
+ 2. ½Ó×ÅÊäÈëСдµÄ a Ôò¿ÉÔÚ¹â±êÖ®ºó²åÈëÎı¾ÁË¡£´óдµÄ A Ôò¿ÉÒÔÖ±½ÓÔÚÐÐ
+ Ä©²åÈëÎı¾¡£
+
+Ìáʾ¡ÃÊäÈë´óд A µÄ²Ù×÷·½·¨¿ÉÒÔÔÚÐÐÄ©²åÈëÎı¾£¬±ÜÃâÁËÊäÈë i£¬¹â±ê¶¨Î»µ½
+ ×îºóÒ»¸ö×Ö·û£¬ÊäÈëµÄÎı¾£¬<ESC> »Ø¸´Õý³£Ä£Ê½£¬¼ýÍ·ÓÒ¼üÒƶ¯¹â±êÒÔ¼°
+ x ɾ³ýµ±Ç°¹â±êËùÔÚλÖÃ×Ö·ûµÈµÈÖî¶à·±ÔӵIJÙ×÷¡£
+
+ 3. ²Ù×÷Ö®ºóµÚÒ»ÐоͿÉÒÔ²¹³äÍêÕûÁË¡£Çë×¢Òâ¹â±êºó²åÈëÎı¾Óë²åÈëģʽÊÇ»ù
+ ±¾ÍêÈ«Ò»Öµģ¬Ö»ÊÇÎı¾²åÈëµÄλÖö¨Î»ÉÔÓв»Í¬°ÕÁË¡£
+
+---> This line will allow you to practice
+---> This line will allow you to practice appending text to the end of a line.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÁù½²µÚÈý½Ú¡ÃÁíÍâÒ»¸öÖû»ÀàÃüÁîµÄ°æ±¾
+
+
+ ** ÊäÈë´óдµÄ R ¿ÉÁ¬ÐøÌæ»»¶à¸ö×Ö·û¡£**
+
+ 1. Ç뽫¹â±êÒƶ¯µ½±¾½ÚÖÐÏÂÃæ±ê¼ÇÓÐ ---> µÄµÚÒ»ÐС£
+
+ 2. Òƶ¯¹â±êµ½µÚÒ»ÐÐÖв»Í¬ÓÚ±êÓÐ ---> µÄµÚ¶þÐеĵÚÒ»¸öµ¥´ÊµÄ¿ªÊ¼£¬¼´µ¥
+ ´Ê last ´¦¡£
+
+ 3. È»ºóÊäÈë´óдµÄ R ¿ªÊ¼°ÑµÚÒ»ÐÐÖеIJ»Í¬ÓÚµÚ¶þÐеÄÊ£Óà×Ö·ûÖðÒ»ÊäÈ룬¾Í
+ ¿ÉÒÔÈ«²¿Ìæ»»µôÔ­ÓеÄ×Ö·û¶øʹµÃµÚÒ»ÐÐÍêÈ«À×ͬµÚ¶þÐÐÁË¡£
+
+---> To make the first line the same as the last on this page use the keys.
+---> To make the first line the same as the second, type R and the new text.
+
+ 4. Çë×¢Òâ¡ÃÈç¹ûÄú°´ <ESC> Í˳öÖû»Ä£Ê½»Ø¸´Õý³£Ä£Ê½£¬ÉÐδÌæ»»µÄÎı¾½«ÈÔ
+ È»±£³ÖÔ­×´¡£
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÁù½²µÚËĽڡÃÉèÖÃÀàÃüÁîµÄÑ¡Ïî
+
+
+ ** ÉèÖÿÉʹ²éÕÒ»òÕßÌæ»»¿ÉºöÂÔ´óСдµÄÑ¡Ïî **
+
+
+ 1. Òª²éÕÒµ¥´Ê ignore ¿ÉÔÚÕý³£Ä£Ê½ÏÂÊäÈë /ignore ¡£ÒªÖظ´²éÕҸôʣ¬¿ÉÒÔ
+ Öظ´°´ n ¼ü¡£
+
+ 2. È»ºóÉèÖà ic Ñ¡Ïî(ic¾ÍÊÇÓ¢ÎĺöÂÔ´óСдIgnore CaseµÄÊ××ÖĸËõд´Ê)£¬¼´
+ ÊäÈë¡Ã
+ :set ic
+
+ 3. ÏÖÔÚ¿ÉÒÔͨ¹ý¼üÈë n ¼üÔٴβéÕÒµ¥´Ê ignore¡£Öظ´²éÕÒ¿ÉÒÔÖظ´¼üÈë n ¼ü¡£
+
+ 4. È»ºóÉèÖà hlsearch ºÍ incsearch ÕâÁ½¸öÑ¡ÏÊäÈëÒÔÏÂÄÚÈÝ¡Ã
+ :set hls is
+
+ 5. ÏÖÔÚ¿ÉÒÔÔÙ´ÎÊäÈë²éÕÒÃüÁ¿´¿´»áÓÐʲôЧ¹û¡Ã
+ /ignore
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÁù½²Ð¡½á
+
+
+ 1. ÊäÈëСдµÄ o ¿ÉÒÔÔÚ¹â±êÏ·½´ò¿ªÐµÄÒ»Ðв¢½«¹â±êÖÃÓÚпªµÄÐÐÊ×£¬½øÈë
+ ²åÈëģʽ¡£
+ ÊäÈë´óдµÄ O ¿ÉÒÔÔÚ¹â±êÉÏ·½´ò¿ªÐµÄÒ»Ðв¢½«¹â±êÖÃÓÚпªµÄÐÐÊ×£¬½øÈë
+ ²åÈëģʽ¡£
+
+ 2. ÊäÈëСдµÄ a ¿ÉÒÔÔÚ¹â±êËùÔÚλÖÃÖ®ºó²åÈëÎı¾¡£
+ ÊäÈë´óдµÄ A ¿ÉÒÔÔÚ¹â±êËùÔÚÐеÄÐÐÄ©Ö®ºó²åÈëÎı¾¡£
+
+ 3. ÊäÈë´óдµÄ R ½«½øÈëÌ滻ģʽ£¬Ö±ÖÁ°´ <ESC> ¼üÍ˳öÌ滻ģʽ¶ø½øÈëÕý³£
+ ģʽ¡£
+
+ 4. ÊäÈë :set xxx ¿ÉÒÔÉèÖà xxx Ñ¡Ïî¡£
+
+
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚÆß½²¡ÃÔÚÏß°ïÖúÃüÁî
+
+ ** ʹÓÃÔÚÏß°ïÖúϵͳ **
+
+ Vim ÓµÓÐÒ»¸öϸÖÂÈ«ÃæµÄÔÚÏß°ïÖúϵͳ¡£ÒªÆô¶¯¸Ã°ïÖúϵͳ£¬ÇëÑ¡ÔñÈçÏÂÈýÖÖ·½
+ ·¨Ö®Ò»¡Ã
+ - °´Ï <HELP> ¼ü (Èç¹û¼üÅÌÉÏÓеĻ°)
+ - °´Ï <F1> ¼ü (Èç¹û¼üÅÌÉÏÓеĻ°)
+ - ÊäÈë :help <»Ø³µ>
+
+ ÊäÈë :q <»Ø³µ> ¿ÉÒԹرհïÖú´°¿Ú¡£
+
+ Ìṩһ¸öÕýÈ·µÄ²ÎÊý¸ø":help"ÃüÁÄú¿ÉÒÔÕÒµ½¹ØÓÚ¸ÃÖ÷ÌâµÄ°ïÖú¡£ÇëÊÔÑéÒÔ
+ ϲÎÊý(¿É±ðÍüÁË°´»Ø³µ¼üŶ¡£:)¡Ã
+
+ :help w <»Ø³µ>
+ :help c_<T <»Ø³µ>
+ :help insert-index <»Ø³µ>
+ :help user-manual <»Ø³µ>
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ µÚ°Ë½²¡Ã´´½¨Ò»¸öÆô¶¯½Å±¾
+
+ ** ÆôÓÃvimµÄ¹¦ÄÜ **
+
+ VimµÄ¹¦ÄÜÌØÐÔÒª±Èvi¶àµÃ¶à£¬µ«´ó²¿·Ö¹¦Äܶ¼Ã»ÓÐȱʡ¼¤»î¡£ÎªÁËÆô¶¯¸ü¶àµÄ
+ ¹¦ÄÜ£¬ÄúµÃ´´½¨Ò»¸övimrcÎļþ¡£
+
+ 1. ¿ªÊ¼±à¼­vimrcÎļþ£¬ÕâÈ¡¾öÓÚÄúËùʹÓõIJÙ×÷ϵͳ¡Ã
+
+ :edit ~/.vimrc ÕâÊÇUnixϵͳËùʹÓõÄÃüÁî
+ :edit $VIM/_vimrc ÕâÊÇWindowsϵͳËùʹÓõÄÃüÁî
+
+ 2. ½Ó×ŵ¼Èëvimrc·¶ÀýÎļþ¡Ã
+
+ :read $VIMRUNTIME/vimrc_example.vim
+
+ 3. ±£´æÎļþ£¬ÃüÁîΪ¡Ã
+
+ :write
+
+ ÔÚÏ´ÎÄúÆô¶¯vimµÄʱºò£¬±à¼­Æ÷¾Í»áÓÐÁËÓï·¨¸ßÁÁµÄ¹¦ÄÜ¡£Äú¿ÉÒÔ¼ÌÐø°ÑÄúϲ
+ »¶µÄÆäËü¹¦ÄÜÉèÖÃÌí¼Óµ½Õâ¸övimrcÎļþÖС£
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ vim ½Ì³Ìµ½´Ë½áÊø¡£±¾½Ì³ÌÖ»ÊÇΪÁ˼òÃ÷µØ½éÉÜÒ»ÏÂvim±à¼­Æ÷£¬µ«ÒÑ×ãÒÔÈÃÄú
+ ºÜÈÝÒ×ѧ»áʹÓñ¾±à¼­Æ÷ÁË¡£ÎãÓ¹ÖÊÒÉ£¬vim»¹ÓкܶàºÜ¶àµÄÃüÁ±¾½Ì³ÌËù½é
+ ÉܵĻ¹²îµÃÔ¶ÖøÄØ¡£ËùÒÔÄúÒª¾«Í¨µÄ»°£¬»¹Íû¼ÌÐøŬÁ¦Å¶¡£ÏÂÒ»²½Äú¿ÉÒÔÔĶÁ
+ vimÊֲᣬʹÓõÄÃüÁîÊÇ¡Ã
+ :help user-manual
+
+ ΪÁ˸ü½øÒ»²½µÄ²Î¿¼ºÍѧϰ£¬ÒÔÏÂÕâ±¾ÊéÖµµÃÍƼö¡Ã
+
+ Vim - Vi Improved - ×÷Õß¡ÃSteve Oualline
+ ³ö°æÉç¡ÃNew Riders
+
+ ÕâÊǵÚÒ»±¾ÍêÈ«½²½âvimµÄÊé¼®¡£¶ÔÓÚ³õѧÕßÌرðÓÐÓá£ÆäÖл¹°üº¬ÓдóÁ¿ÊµÀý
+ ºÍͼʾ¡£ÓûÖªÏêÇ飬Çë·ÃÎÊ http://iccf-holland.org/click5.html
+
+ ÒÔÏÂÕâ±¾Êé±È½ÏÀÏÁ˶øÇÒÄÚÈÝÖ÷ÒªÊÇvi¶ø²»ÊÇvim£¬µ«ÊÇÒ²ÖµµÃÍƼö¡Ã
+
+ Learning the Vi Editor - ×÷Õß¡ÃLinda Lamb
+ ³ö°æÉç¡ÃO'Reilly & Associates Inc.
+
+ ÕâÊÇÒ»±¾²»´íµÄÊ飬ͨ¹ýËüÄú¼¸ºõÄܹ»Á˽⵽ȫ²¿viÄܹ»×öµ½µÄÊÂÇé¡£´ËÊéµÄµÚ
+ Áù¸ö°æ±¾Ò²°üº¬ÁËһЩ¹ØÓÚvimµÄÐÅÏ¢¡£
+
+ ±¾½Ì³ÌÊÇÓÉÀ´×ÔCalorado School of MineseµÄMichael C. Pierce¡¢Robert K.
+ Ware Ëù±àдµÄ£¬ÆäÖÐÀ´×ÔColorado State UniversityµÄCharles SmithÌṩÁË
+ ºÜ¶à´´Òâ¡£±àÕßͨÐŵØÖ·ÊÇ¡Ã
+
+ bware@mines.colorado.edu
+
+ ±¾½Ì³ÌÒÑÓÉBram MoolenaarרΪvim½øÐÐÐÞ¶©¡£
+
+
+
+ ÒëÖÆÕ߸½ÑÔ¡Ã
+ ===========
+ ¼òÌåÖÐÎĽ̷̳­Òë°æÖ®ÒëÖÆÕßΪÁº²ýÌ© <beos@turbolinux.com.cn>£¬»¹ÓÐ
+ ÁíÍâÒ»¸öÁªÏµµØÖ·¡Ãlinuxrat@gnuchina.org¡£
+
+ ·±ÌåÖÐÎĽ̳ÌÊÇ´Ó¼òÌåÖÐÎĽ̷̳­Òë°æʹÓà Debian GNU/Linux ÖÐÎÄÏîĿС
+ ×éµÄÓÚ¹ã»ÔÏÈÉú±àдµÄÖÐÎĺº×ÖתÂëÆ÷ autoconvert ת»»¶ø³ÉµÄ£¬²¢¶Ôת
+ »»µÄ½á¹û×öÁËһЩϸ½ÚµÄ¸Ä¶¯¡£
+
+ ±ä¸ü¼Ç¼¡Ã
+ =========
+ 2002Äê08ÔÂ30ÈÕ Áº²ýÌ© <beos@turbolinux.com.cn>
+ ¸Ðл RMS@SMTH µÄÖ¸Õý£¬½«¶à´¦´íÎóÐÞÕý¡£
+
+ 2002Äê04ÔÂ22ÈÕ Áº²ýÌ© <linuxrat@gnuchina.org>
+ ¸Ðл xuandong@sh163.net µÄÖ¸Õý£¬½«Á½´¦´í±ð×ÖÐÞÕý¡£
+
+ 2002Äê03ÔÂ18ÈÕ Áº²ýÌ© <linuxrat@gnuchina.org>
+ ¸ù¾ÝBram MolenaarÏÈÉúÔÚ2002Äê03ÔÂ16ÈÕµÄÀ´ÐÅÒªÇ󣬽«vimtutor1.4ÖÐÒë
+ °æÉý¼¶µ½vimtutor1.5¡£
+
+ 2001Äê11ÔÂ15ÈÕ Áº²ýÌ© <linuxrat@gnuchina.org>
+ ½«vimtutor1.4ÖÐÒë°æÌá½»¸øBram MolenaarºÍSven Guckes¡£
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/vim16x16.gif b/runtime/vim16x16.gif
new file mode 100644
index 000000000..505a855a6
--- /dev/null
+++ b/runtime/vim16x16.gif
Binary files differ
diff --git a/runtime/vim16x16.png b/runtime/vim16x16.png
new file mode 100644
index 000000000..fb45d22a0
--- /dev/null
+++ b/runtime/vim16x16.png
Binary files differ
diff --git a/runtime/vim16x16.xpm b/runtime/vim16x16.xpm
new file mode 100644
index 000000000..cb75b7178
--- /dev/null
+++ b/runtime/vim16x16.xpm
@@ -0,0 +1,27 @@
+/* XPM */
+static char * vim16x16[] = {
+"16 16 8 1",
+" c None",
+". c #000000",
+"+ c #000080",
+"@ c #008000",
+"# c #00FF00",
+"$ c #808080",
+"% c #C0C0C0",
+"& c #FFFFFF",
+" .....#. .... ",
+" .&&&&&.@.&&&&. ",
+" .%%%%%$..%%%%$.",
+" .%%%$.@.&%%$. ",
+" .%%%$..&%%$. ",
+" .%%%$.&%%$.. ",
+" #.%%%$&%%$.@@. ",
+"#@.%%%&%%$.@@@@.",
+".@.%%%%%..@@@@+ ",
+" ..%%%%.%...@. ",
+" .%%%%...%%.%. ",
+" .%%%.%%.%%%%%.",
+" .%%$..%.%.%.%.",
+" .%$.@.%.%.%.%.",
+" .. .%%.%.%.%.",
+" .. . . . "};
diff --git a/runtime/vim32x32.gif b/runtime/vim32x32.gif
new file mode 100644
index 000000000..523821b44
--- /dev/null
+++ b/runtime/vim32x32.gif
Binary files differ
diff --git a/runtime/vim32x32.png b/runtime/vim32x32.png
new file mode 100644
index 000000000..c6e04fab2
--- /dev/null
+++ b/runtime/vim32x32.png
Binary files differ
diff --git a/runtime/vim32x32.xpm b/runtime/vim32x32.xpm
new file mode 100644
index 000000000..43a3a40c0
--- /dev/null
+++ b/runtime/vim32x32.xpm
@@ -0,0 +1,43 @@
+/* XPM */
+static char * vim32x32[] = {
+"32 32 8 1",
+" c None",
+". c #000000",
+"+ c #000080",
+"@ c #008000",
+"# c #00FF00",
+"$ c #808080",
+"% c #C0C0C0",
+"& c #FFFFFF",
+" .. ",
+" .##. ",
+" ...........#@@#. ......... ",
+" .&&&&&&&&&&&.@@@#.&&&&&&&&&. ",
+" .&%%%%%%%%%%%.@@@.&%%%%%%%%%. ",
+" .%%%%%%%%%%$.@@@@.%%%%%%%%$. ",
+" .$%%%%%%$$.@@@@@@.$%%%%%$$. ",
+" .&%%%%%%$.@@@@@@.&%%%%%$$. ",
+" .&%%%%%%$.@@@@@.&&%%%%$$. ",
+" .&%%%%%%$.@@@@.&&%%%%$$. ",
+" .&%%%%%%$.@@@.&&%%%%$$. ",
+" .&%%%%%%$.@@.&&%%%%$$.#. ",
+" ..&%%%%%%$.@.&&%%%%$$.@@#. ",
+" .#.&%%%%%%$..&&%%%%$$.@@@@#. ",
+" .#@.&%%%%%%$.&&%%%%$$.@@@@@@#. ",
+".#@@.&%%%%%%$&&%%%%$$.@@@@@@@@#.",
+".+@@.&%%%%%%$&%%%%$$.@@@@@@@@@+.",
+" .+@.&%%%%%%$%%%%$$.@@@@@@@@@+. ",
+" .+.&%%%%%%%%%%...@@@@@@@@@+. ",
+" ..&%%%%%%%%%.%%.@@@@@@@@+. ",
+" .&%%%%%%%%%.%%.@@@@@@@+. ",
+" .&%%%%%%%%$...@...@...... ",
+" .&%%%%%%%$.%%%.%%%.%%%.%%. ",
+" .&%%%%%%$$..%%..%%%%%%%%%%. ",
+" .&%%%%%$$..%%...%%++%%..%. ",
+" .&%%%%$$.@.%%..%%+.%%..%%. ",
+" .&%%%$$.@@.%%..%%..%%..%%. ",
+" .&%%$$..+.%%..%%..%%..%%. ",
+" .%$$. ..%%%.%%..%%..%%%. ",
+" ... ....+.. .. ... ",
+" .++. ",
+" .. "};
diff --git a/runtime/vim48x48.gif b/runtime/vim48x48.gif
new file mode 100644
index 000000000..6be182ec9
--- /dev/null
+++ b/runtime/vim48x48.gif
Binary files differ
diff --git a/runtime/vim48x48.png b/runtime/vim48x48.png
new file mode 100644
index 000000000..4bac67e62
--- /dev/null
+++ b/runtime/vim48x48.png
Binary files differ
diff --git a/runtime/vim48x48.xpm b/runtime/vim48x48.xpm
new file mode 100644
index 000000000..b2fdd9592
--- /dev/null
+++ b/runtime/vim48x48.xpm
@@ -0,0 +1,59 @@
+/* XPM */
+static char * vim48x48[] = {
+"48 48 8 1",
+" c None",
+". c #000000",
+"+ c #000084",
+"@ c #008200",
+"# c #00FF00",
+"$ c #848284",
+"& c #C6C3C6",
+"* c #FFFFFF",
+" .. ",
+" .##. ",
+" .#@@#. ",
+" ...............#@@@@#. ............... ",
+" .***************.@@@@@#. .***************. ",
+" .**&&&&&&&&&&&&&&$.@@@@@#.**&&&&&&&&&&&&&&$.",
+" .*&&&&&&&&&&&&&&&$.@@@@@@.*&&&&&&&&&&&&&&&$.",
+" .*$&&&&&&&&&&&&&&$.@@@@@@.*$&&&&&&&&&&&&&&$.",
+" .$$$&&&&&&&&&$$$.@@@@@@@@.$$$&&&&&&&&&&&$$.",
+" ..*&&&&&&&&&$$.@@@@@@@@@@..*&&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@@.**&&&&&&&&&$$. ",
+" .*&&&&&&&&&$$.@@@@.**&&&&&&&&&$$.. ",
+" ..*&&&&&&&&&$$.@@@.**&&&&&&&&&$$.@#. ",
+" .#.*&&&&&&&&&$$.@@.**&&&&&&&&&$$.@@@#. ",
+" .#@.*&&&&&&&&&$$.@.**&&&&&&&&&$$.@@@@@#. ",
+" .#@@.*&&&&&&&&&$$..**&&&&&&&&&$$.@@@@@@@#. ",
+" .#@@@.*&&&&&&&&&$$.**&&&&&&&&&$$.@@@@@@@@@#. ",
+" .#@@@@.*&&&&&&&&&$$**&&&&&&&&&$$.@@@@@@@@@@@#. ",
+".#+@@@@.*&&&&&&&&&$$*&&&&&&&&&$$.@@@@@@@@@@@@@#.",
+" .++@@@.*&&&&&&&&&$*&&&&&&&&&$$.@@@@@@@@@@@@@++.",
+" .++@@.*&&&&&&&&&$&&&&&&&&&$$.@@@@@@@@@@@@@++. ",
+" .++@.*&&&&&&&&&&&&&&&&&&$$.@@@@@@@@@@@@@++. ",
+" .++.*&&&&&&&&&&&&&&&&....@@@@@@@@@@@@@++. ",
+" .+.*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@@@+++ ",
+" ..*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@@++. ",
+" .*&&&&&&&&&&&&&&&.&&&.@@@@@@@@@@++. ",
+" .*&&&&&&&&&&&&&&$$...@@@@@@@@@@++. ",
+" .*&&&&&&&&&&&&&$$...@@....@@....+.... ",
+" .*&&&&&&&&&&&&$$..&&..&&&&..&&&&..&&&. ",
+" .*&&&&&&&&&&&$$..&&&.@.&&&&&&&&&&&&&&&. ",
+" .*&&&&&&&&&&$$.@.&&&.@.&&&&&&&&&&&&&&&. ",
+" .*&&&&&&&&&$$.@@.&&.@@.&&....&&....&&. ",
+" .*&&&&&&&&$$.@@.&&&.@.&&&.+.&&&. .&&&. ",
+" .*&&&&&&&$$.@@@.&&.@@.&&.++.&&. .&&. ",
+" .*&&&&&&$$.@@@.&&&.@.&&&.+.&&&. .&&&. ",
+" .*&&&&&$$.++@@.&&.@@.&&.. .&&. .&&. ",
+" .*&&&&$$. .++.&&&.@.&&&. .&&&. .&&&. ",
+" .$$$$$. .+.&&&&..&&&&..&&&&..&&&&. ",
+" ..... .+....@+.... .... .... ",
+" .++@@++. ",
+" .++++. ",
+" .++. ",
+" .. "};
diff --git a/runtime/vimlogo.eps b/runtime/vimlogo.eps
new file mode 100644
index 000000000..5bf45ff4f
--- /dev/null
+++ b/runtime/vimlogo.eps
@@ -0,0 +1,791 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 147 74 429 356
+%%LanguageLevel: 1
+%%Creator: CorelDRAW 11
+%%Title: vimlogo.eps
+%%CreationDate: Mon Feb 02 14:35:16 2004
+%%DocumentProcessColors: Cyan Yellow Black
+%%DocumentSuppliedResources: (atend)
+%%EndComments
+%%BeginProlog
+/AutoFlatness false def
+/AutoSteps 0 def
+/CMYKMarks true def
+/UseLevel 1 def
+%Build: CorelDRAW 11 Version 11.633
+%Color profile: Generic offset separations profile
+/CorelIsEPS true def
+%%BeginResource: procset wCorel11Dict 11.0 0
+/wCorel11Dict 300 dict def wCorel11Dict begin
+% Copyright (c)1992-2002 Corel Corporation
+% All rights reserved. v11.0 r0.0
+/bd{bind def}bind def/ld{load def}bd/xd{exch def}bd/_ null def/rp{{pop}repeat}
+bd/@cp/closepath ld/@gs/gsave ld/@gr/grestore ld/@np/newpath ld/Tl/translate ld
+/$sv 0 def/@sv{/$sv save def}bd/@rs{$sv restore}bd/spg/showpage ld/showpage{}
+bd currentscreen/@dsp xd/$dsp/@dsp def/$dsa xd/$dsf xd/$sdf false def/$SDF
+false def/$Scra 0 def/SetScr/setscreen ld/@ss{2 index 0 eq{$dsf 3 1 roll 4 -1
+roll pop}if exch $Scra add exch load SetScr}bd/SepMode_5 where{pop}{/SepMode_5
+0 def}ifelse/CorelIsSeps where{pop}{/CorelIsSeps false def}ifelse
+/CorelIsInRIPSeps where{pop}{/CorelIsInRIPSeps false def}ifelse/CorelIsEPS
+where{pop}{/CorelIsEPS false def}ifelse/CurrentInkName_5 where{pop}
+{/CurrentInkName_5(Composite)def}ifelse/$ink_5 where{pop}{/$ink_5 -1 def}
+ifelse/$c 0 def/$m 0 def/$y 0 def/$k 0 def/$t 1 def/$n _ def/$o 0 def/$fil 0
+def/$C 0 def/$M 0 def/$Y 0 def/$K 0 def/$T 1 def/$N _ def/$O 0 def/$PF false
+def/s1c 0 def/s1m 0 def/s1y 0 def/s1k 0 def/s1t 0 def/s1n _ def/$bkg false def
+/SK 0 def/SM 0 def/SY 0 def/SC 0 def/$op false def matrix currentmatrix/$ctm xd
+/$ptm matrix def/$ttm matrix def/$stm matrix def/$ffpnt true def
+/CorelDrawReencodeVect[16#0/grave 16#5/breve 16#6/dotaccent 16#8/ring
+16#A/hungarumlaut 16#B/ogonek 16#C/caron 16#D/dotlessi 16#27/quotesingle
+16#60/grave 16#7C/bar
+16#82/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl
+16#88/circumflex/perthousand/Scaron/guilsinglleft/OE
+16#91/quoteleft/quoteright/quotedblleft/quotedblright/bullet/endash/emdash
+16#98/tilde/trademark/scaron/guilsinglright/oe 16#9F/Ydieresis
+16#A1/exclamdown/cent/sterling/currency/yen/brokenbar/section
+16#a8/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/minus/registered/macron
+16#b0/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered
+16#b8/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
+16#c0/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
+16#c8/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
+16#d0/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply
+16#d8/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
+16#e0/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
+16#e8/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
+16#f0/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
+16#f8/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
+/L2?/languagelevel where{pop languagelevel 2 ge}{false}ifelse def/Comp?{
+/LumSepsDict where{pop false}{/AldusSepsDict where{pop false}{1 0 0 0 @gs
+setcmykcolor currentcmykcolor @gr add add add 0 ne 0 1 0 0 @gs setcmykcolor
+currentcmykcolor @gr add add add 0 ne 0 0 1 0 @gs setcmykcolor currentcmykcolor
+@gr add add add 0 ne 0 0 0 1 @gs setcmykcolor currentcmykcolor @gr add add add
+0 ne and and and}ifelse}ifelse}bd/@PL{/LV where{pop LV 2 ge L2? not and{@np
+/Courier findfont 12 scalefont setfont 72 144 m
+(The PostScript level set in the Corel application is higher than)show 72 132 m
+(the PostScript level of this device. Change the PS Level in the Corel)show 72
+120 m(application to Level 1 by selecting the PostScript tab in the print)show
+72 108 m(dialog, and selecting Level 1 from the Compatibility drop down list.)
+show flush spg quit}if}if}bd/@BeginSysCorelDict{systemdict/Corel30Dict known
+{systemdict/Corel30Dict get exec}if systemdict/CorelLexDict known{1 systemdict
+/CorelLexDict get exec}if}bd/@EndSysCorelDict{systemdict/Corel30Dict known
+{end}if/EndCorelLexDict where{pop EndCorelLexDict}if}bd AutoFlatness{/@ifl{dup
+currentflat exch sub 10 gt{
+([Error: PathTooComplex; OffendingCommand: AnyPaintingOperator]\n)print flush
+@np exit}{currentflat 2 add setflat}ifelse}bd/@fill/fill ld/fill{currentflat{
+{@fill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd/@eofill/eofill ld/eofill
+{currentflat{{@eofill}stopped{@ifl}{exit}ifelse}bind loop setflat}bd/@clip
+/clip ld/clip{currentflat{{@clip}stopped{@ifl}{exit}ifelse}bind loop setflat}
+bd/@eoclip/eoclip ld/eoclip{currentflat{{@eoclip}stopped{@ifl}{exit}ifelse}
+bind loop setflat}bd/@stroke/stroke ld/stroke{currentflat{{@stroke}stopped
+{@ifl}{exit}ifelse}bind loop setflat}bd}if L2?{/@ssa{true setstrokeadjust}bd}{
+/@ssa{}bd}ifelse/d/setdash ld/j/setlinejoin ld/J/setlinecap ld/M/setmiterlimit
+ld/w/setlinewidth ld/O{/$o xd}bd/R{/$O xd}bd/W/eoclip ld/c/curveto ld/C/c ld/l
+/lineto ld/L/l ld/rl/rlineto ld/m/moveto ld/n/newpath ld/N/newpath ld/P{11 rp}
+bd/u{}bd/U{}bd/A{pop}bd/q/@gs ld/Q/@gr ld/&{}bd/@j{@sv @np}bd/@J{@rs}bd/g{1
+exch sub/$k xd/$c 0 def/$m 0 def/$y 0 def/$t 1 def/$n _ def/$fil 0 def}bd/G{1
+sub neg/$K xd _ 1 0 0 0/$C xd/$M xd/$Y xd/$T xd/$N xd}bd/k{1 index type
+/stringtype eq{/$t xd/$n xd}{/$t 0 def/$n _ def}ifelse/$k xd/$y xd/$m xd/$c xd
+/$fil 0 def}bd/K{1 index type/stringtype eq{/$T xd/$N xd}{/$T 0 def/$N _ def}
+ifelse/$K xd/$Y xd/$M xd/$C xd}bd/x/k ld/X/K ld/sf{1 index type/stringtype eq{
+/s1t xd/s1n xd}{/s1t 0 def/s1n _ def}ifelse/s1k xd/s1y xd/s1m xd/s1c xd}bd/i{
+dup 0 ne{setflat}{pop}ifelse}bd/v{4 -2 roll 2 copy 6 -2 roll c}bd/V/v ld/y{2
+copy c}bd/Y/y ld/@w{matrix rotate/$ptm xd matrix scale $ptm dup concatmatrix
+/$ptm xd 1 eq{$ptm exch dup concatmatrix/$ptm xd}if 1 w}bd/@g{1 eq dup/$sdf xd
+{/$scp xd/$sca xd/$scf xd}if}bd/@G{1 eq dup/$SDF xd{/$SCP xd/$SCA xd/$SCF xd}
+if}bd/@D{2 index 0 eq{$dsf 3 1 roll 4 -1 roll pop}if 3 copy exch $Scra add exch
+load SetScr/$dsp xd/$dsa xd/$dsf xd}bd/$ngx{$SDF{$SCF SepMode_5 0 eq{$SCA}
+{$dsa}ifelse $SCP @ss}if}bd/@MN{2 copy le{pop}{exch pop}ifelse}bd/@MX{2 copy ge
+{pop}{exch pop}ifelse}bd/InRange{3 -1 roll @MN @MX}bd/@sqr{dup 0 rl dup 0 exch
+rl neg 0 rl @cp}bd/currentscale{1 0 dtransform matrix defaultmatrix idtransform
+dup mul exch dup mul add sqrt 0 1 dtransform matrix defaultmatrix idtransform
+dup mul exch dup mul add sqrt}bd/@unscale{}bd/wDstChck{2 1 roll dup 3 -1 roll
+eq{1 add}if}bd/@dot{dup mul exch dup mul add 1 exch sub}bd/@lin{exch pop abs 1
+exch sub}bd/cmyk2rgb{3{dup 5 -1 roll add 1 exch sub dup 0 lt{pop 0}if exch}
+repeat pop}bd/rgb2cmyk{3{1 exch sub 3 1 roll}repeat 3 copy @MN @MN 3{dup 5 -1
+roll sub neg exch}repeat}bd/rgb2g{2 index .299 mul 2 index .587 mul add 1 index
+.114 mul add 4 1 roll pop pop pop}bd/WaldoColor_5 where{pop}{/SetRgb
+/setrgbcolor ld/GetRgb/currentrgbcolor ld/SetGry/setgray ld/GetGry/currentgray
+ld/SetRgb2 systemdict/setrgbcolor get def/GetRgb2 systemdict/currentrgbcolor
+get def/SetHsb systemdict/sethsbcolor get def/GetHsb systemdict
+/currenthsbcolor get def/rgb2hsb{SetRgb2 GetHsb}bd/hsb2rgb{3 -1 roll dup floor
+sub 3 1 roll SetHsb GetRgb2}bd/setcmykcolor where{pop/LumSepsDict where{pop
+/SetCmyk_5{LumSepsDict/setcmykcolor get exec}def}{/AldusSepsDict where{pop
+/SetCmyk_5{AldusSepsDict/setcmykcolor get exec}def}{/SetCmyk_5/setcmykcolor ld
+}ifelse}ifelse}{/SetCmyk_5{cmyk2rgb SetRgb}bd}ifelse/currentcmykcolor where{
+pop/GetCmyk/currentcmykcolor ld}{/GetCmyk{GetRgb rgb2cmyk}bd}ifelse
+/setoverprint where{pop}{/setoverprint{/$op xd}bd}ifelse/currentoverprint where
+{pop}{/currentoverprint{$op}bd}ifelse/@tc_5{5 -1 roll dup 1 ge{pop}{4{dup 6 -1
+roll mul exch}repeat pop}ifelse}bd/@trp{exch pop 5 1 roll @tc_5}bd
+/setprocesscolor_5{SepMode_5 0 eq{SetCmyk_5}{0 4 $ink_5 sub index exch pop 5 1
+roll pop pop pop pop SepsColor true eq{$ink_5 3 gt{1 sub neg SetGry}{0 0 0 4
+$ink_5 roll SetCmyk_5}ifelse}{1 sub neg SetGry}ifelse}ifelse}bd
+/findcmykcustomcolor where{pop}{/findcmykcustomcolor{5 array astore}bd}ifelse
+/Corelsetcustomcolor_exists false def/setcustomcolor where{pop
+/Corelsetcustomcolor_exists true def}if CorelIsSeps true eq CorelIsInRIPSeps
+false eq and{/Corelsetcustomcolor_exists false def}if
+Corelsetcustomcolor_exists false eq{/setcustomcolor{exch aload pop SepMode_5 0
+eq{pop @tc_5 setprocesscolor_5}{CurrentInkName_5 eq{4 index}{0}ifelse 6 1 roll
+5 rp 1 sub neg SetGry}ifelse}bd}if/@scc_5{dup type/booleantype eq{dup
+currentoverprint ne{setoverprint}{pop}ifelse}{1 eq setoverprint}ifelse dup _ eq
+{pop setprocesscolor_5 pop}{findcmykcustomcolor exch setcustomcolor}ifelse
+SepMode_5 0 eq{true}{GetGry 1 eq currentoverprint and not}ifelse}bd/colorimage
+where{pop/ColorImage{colorimage}def}{/ColorImage{/ncolors xd/$multi xd $multi
+true eq{ncolors 3 eq{/daqB xd/daqG xd/daqR xd pop pop exch pop abs{daqR pop
+daqG pop daqB pop}repeat}{/daqK xd/daqY xd/daqM xd/daqC xd pop pop exch pop abs
+{daqC pop daqM pop daqY pop daqK pop}repeat}ifelse}{/dataaq xd{dataaq ncolors
+dup 3 eq{/$dat xd 0 1 $dat length 3 div 1 sub{dup 3 mul $dat 1 index get 255
+div $dat 2 index 1 add get 255 div $dat 3 index 2 add get 255 div rgb2g 255 mul
+cvi exch pop $dat 3 1 roll put}for $dat 0 $dat length 3 idiv getinterval pop}{
+4 eq{/$dat xd 0 1 $dat length 4 div 1 sub{dup 4 mul $dat 1 index get 255 div
+$dat 2 index 1 add get 255 div $dat 3 index 2 add get 255 div $dat 4 index 3
+add get 255 div cmyk2rgb rgb2g 255 mul cvi exch pop $dat 3 1 roll put}for $dat
+0 $dat length ncolors idiv getinterval}if}ifelse}image}ifelse}bd}ifelse
+/setcmykcolor{1 5 1 roll _ currentoverprint @scc_5/$ffpnt xd}bd
+/currentcmykcolor{GetCmyk}bd/setrgbcolor{rgb2cmyk setcmykcolor}bd
+/currentrgbcolor{currentcmykcolor cmyk2rgb}bd/sethsbcolor{hsb2rgb setrgbcolor}
+bd/currenthsbcolor{currentrgbcolor rgb2hsb}bd/setgray{dup dup setrgbcolor}bd
+/currentgray{currentrgbcolor rgb2g}bd/InsideDCS false def/IMAGE/image ld/image
+{InsideDCS{IMAGE}{/EPSDict where{pop SepMode_5 0 eq{IMAGE}{dup type/dicttype eq
+{dup/ImageType get 1 ne{IMAGE}{dup dup/BitsPerComponent get 8 eq exch
+/BitsPerComponent get 1 eq or currentcolorspace 0 get/DeviceGray eq and{
+CurrentInkName_5(Black)eq{IMAGE}{dup/DataSource get/TCC xd/Height get abs{TCC
+pop}repeat}ifelse}{IMAGE}ifelse}ifelse}{2 index 1 ne{CurrentInkName_5(Black)eq
+{IMAGE}{/TCC xd pop pop exch pop abs{TCC pop}repeat}ifelse}{IMAGE}ifelse}
+ifelse}ifelse}{IMAGE}ifelse}ifelse}bd}ifelse/WaldoColor_5 true def/$fm 0 def
+/wfill{1 $fm eq{fill}{eofill}ifelse}bd/@Pf{@sv SepMode_5 0 eq $Psc 0 ne or
+$ink_5 3 eq or{0 J 0 j[]0 d $t $c $m $y $k $n $o @scc_5 pop $ctm setmatrix 72
+1000 div dup matrix scale dup concat dup Bburx exch Bbury exch itransform
+ceiling cvi/Bbury xd ceiling cvi/Bburx xd Bbllx exch Bblly exch itransform
+floor cvi/Bblly xd floor cvi/Bbllx xd $Prm aload pop $Psn load exec}{1 SetGry
+wfill}ifelse @rs @np}bd/F{matrix currentmatrix $sdf{$scf $sca $scp @ss}if $fil
+1 eq{CorelPtrnDoFill}{$fil 2 eq{@ff}{$fil 3 eq{@Pf}{$fil 4 eq
+{CorelShfillDoFill}{$t $c $m $y $k $n $o @scc_5{wfill}{@np}ifelse}ifelse}
+ifelse}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if setmatrix}bd/f{@cp F}bd/S{
+matrix currentmatrix $ctm setmatrix $SDF{$SCF $SCA $SCP @ss}if $T $C $M $Y $K
+$N $O @scc_5{matrix currentmatrix $ptm concat stroke setmatrix}{@np}ifelse $SDF
+{$dsf $dsa $dsp @ss}if setmatrix}bd/s{@cp S}bd/B{@gs F @gr S}bd/b{@cp B}bd/_E{
+5 array astore exch cvlit xd}bd/@cc{currentfile $dat readhexstring pop}bd/@sm{
+/$ctm $ctm currentmatrix def}bd/@E{/Bbury xd/Bburx xd/Bblly xd/Bbllx xd}bd/@c{
+@cp}bd/@P{/$fil 3 def/$Psn xd/$Psc xd array astore/$Prm xd}bd/tcc{@cc}def/@B{
+@gs S @gr F}bd/@b{@cp @B}bd/@sep{CurrentInkName_5(Composite)eq{/$ink_5 -1 def}
+{CurrentInkName_5(Cyan)eq{/$ink_5 0 def}{CurrentInkName_5(Magenta)eq{/$ink_5 1
+def}{CurrentInkName_5(Yellow)eq{/$ink_5 2 def}{CurrentInkName_5(Black)eq
+{/$ink_5 3 def}{/$ink_5 4 def}ifelse}ifelse}ifelse}ifelse}ifelse}bd/@whi{@gs
+-72000 dup m -72000 72000 l 72000 dup l 72000 -72000 l @cp 1 SetGry fill @gr}
+bd/@neg{[{1 exch sub}/exec cvx currenttransfer/exec cvx]cvx settransfer @whi}
+bd/deflevel 0 def/@sax{/deflevel deflevel 1 add def}bd/@eax{/deflevel deflevel
+dup 0 gt{1 sub}if def deflevel 0 gt{/eax load}{eax}ifelse}bd/eax{{exec}forall}
+bd/@rax{deflevel 0 eq{@rs @sv}if}bd systemdict/pdfmark known not{/pdfmark
+/cleartomark ld}if/wclip{1 $fm eq{clip}{eoclip}ifelse}bd
+% Copyright (c)1992-2002 Corel Corporation
+% All rights reserved. v11.0 r0.0
+/@ii{concat 3 index 3 index m 3 index 1 index l 2 copy l 1 index 3 index l 3
+index 3 index l clip pop pop pop pop}bd/@i{@sm @gs @ii 6 index 1 ne{/$frg true
+def pop pop}{1 eq{s1t s1c s1m s1y s1k s1n $O @scc_5/$frg xd}{/$frg false def}
+ifelse 1 eq{@gs $ctm setmatrix F @gr}if}ifelse @np/$ury xd/$urx xd/$lly xd
+/$llx xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul 8 div ceiling cvi string
+def $bkg $frg or{$SDF{$SCF $SCA $SCP @ss}if $llx $lly Tl $urx $llx sub $ury
+$lly sub scale $bkg{$t $c $m $y $k $n $o @scc_5 pop}if $wid $hei abs $bts 1 eq
+{$bkg}{$bts}ifelse[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]/tcc load $bts
+1 eq{imagemask}{image}ifelse $SDF{$dsf $dsa $dsp @ss}if}{$hei abs{tcc pop}
+repeat}ifelse @gr $ctm setmatrix}bd/@I{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd
+/$llx xd/$ncl xd/$bts xd/$hei xd/$wid xd $ngx $llx $lly Tl $urx $llx sub $ury
+$lly sub scale $wid $hei abs $bts[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse
+]$msimage false eq $ncl 1 eq or{/$dat $wid $bts mul $ncl mul 8 div ceiling cvi
+string def/@cc load false $ncl ColorImage}{$wid $bts mul 8 div ceiling cvi $ncl
+3 eq{dup dup/$dat1 exch string def/$dat2 exch string def/$dat3 exch string def
+/@cc1 load/@cc2 load/@cc3 load}{dup dup dup/$dat1 exch string def/$dat2 exch
+string def/$dat3 exch string def/$dat4 exch string def/@cc1 load/@cc2 load
+/@cc3 load/@cc4 load}ifelse true $ncl ColorImage}ifelse $SDF{$dsf $dsa $dsp
+@ss}if @gr $ctm setmatrix}bd/@cc1{currentfile $dat1 readhexstring pop}bd/@cc2{
+currentfile $dat2 readhexstring pop}bd/@cc3{currentfile $dat3 readhexstring pop
+}bd/@cc4{currentfile $dat4 readhexstring pop}bd/$msimage false def/COMP 0 def
+/MaskedImage false def L2?{/@I_2{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd/$llx
+xd/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul $ncl mul 8 div ceiling
+cvi string def $ngx $ncl 1 eq{/DeviceGray}{$ncl 3 eq{/DeviceRGB}{/DeviceCMYK}
+ifelse}ifelse setcolorspace $llx $lly Tl $urx $llx sub $ury $lly sub scale 8
+dict begin/ImageType 1 def/Width $wid def/Height $hei abs def/BitsPerComponent
+$bts def/Decode $ncl 1 eq{[0 1]}{$ncl 3 eq{[0 1 0 1 0 1]}{[0 1 0 1 0 1 0 1]}
+ifelse}ifelse def/ImageMatrix[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]def
+/DataSource currentfile/ASCII85Decode filter COMP 1 eq{/DCTDecode filter}{COMP
+2 eq{/RunLengthDecode filter}if}ifelse def currentdict end image $SDF{$dsf $dsa
+$dsp @ss}if @gr $ctm setmatrix}bd}{/@I_2{}bd}ifelse/@I_3{@sm @gs @ii @np/$ury
+xd/$urx xd/$lly xd/$llx xd/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul
+$ncl mul 8 div ceiling cvi string def $ngx $ncl 1 eq{/DeviceGray}{$ncl 3 eq
+{/DeviceRGB}{/DeviceCMYK}ifelse}ifelse setcolorspace $llx $lly Tl $urx $llx sub
+$ury $lly sub scale/ImageDataDict 8 dict def ImageDataDict begin/ImageType 1
+def/Width $wid def/Height $hei abs def/BitsPerComponent $bts def/Decode $ncl 1
+eq{[0 1]}{$ncl 3 eq{[0 1 0 1 0 1]}{[0 1 0 1 0 1 0 1]}ifelse}ifelse def
+/ImageMatrix[$wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]def/DataSource
+currentfile/ASCII85Decode filter COMP 1 eq{/DCTDecode filter}{COMP 2 eq{
+/RunLengthDecode filter}if}ifelse def end/MaskedImageDict 7 dict def
+MaskedImageDict begin/ImageType 3 def/InterleaveType 3 def/MaskDict
+ImageMaskDict def/DataDict ImageDataDict def end MaskedImageDict image $SDF
+{$dsf $dsa $dsp @ss}if @gr $ctm setmatrix}bd/@SetMask{/$mbts xd/$mhei xd/$mwid
+xd/ImageMaskDict 8 dict def ImageMaskDict begin/ImageType 1 def/Width $mwid def
+/Height $mhei abs def/BitsPerComponent $mbts def/DataSource maskstream def
+/ImageMatrix[$mwid 0 0 $mhei neg 0 $mhei 0 gt{$mhei}{0}ifelse]def/Decode[1 0]
+def end}bd/@daq{dup type/arraytype eq{{}forall}if}bd/@BMP{/@cc xd UseLevel 3 eq
+MaskedImage true eq and{7 -2 roll pop pop @I_3}{12 index 1 gt UseLevel 2 eq
+UseLevel 3 eq or and{7 -2 roll pop pop @I_2}{11 index 1 eq{12 -1 roll pop @i}{
+7 -2 roll pop pop @I}ifelse}ifelse}ifelse}bd
+% Copyright (c)1992-2002 Corel Corporation
+% All rights reserved. v11.0 r0.0
+/@p{/$fil 1 def 1 eq dup/$vectpat xd{/$pfrg true def}{@gs $t $c $m $y $k $n $o
+@scc_5/$pfrg xd @gr}ifelse/$pm xd/$psy xd/$psx xd/$pyf xd/$pxf xd/$pn xd}bd
+/CorelPtrnDoFill{@gs $ctm setmatrix $pm concat CorelPtrnSetBBox wclip @sv Bburx
+Bbury $pm itransform/$tury xd/$turx xd Bbllx Bblly $pm itransform/$tlly xd
+/$tllx xd newpath $tllx $tlly m $tllx $tury l $turx $tury l $turx $tlly l $tllx
+$tlly m @cp pathbbox @rs/$tury xd/$turx xd/$tlly xd/$tllx xd/$wid $turx $tllx
+sub def/$hei $tury $tlly sub def @gs $vectpat{1 0 0 0 0 _ $o @scc_5{wfill}if}{
+$t $c $m $y $k $n $o @scc_5{SepMode_5 0 eq $pfrg or{$tllx $tlly Tl $wid $hei
+scale <00> 8 1 false[8 0 0 1 0 0]{}imagemask}{/$bkg true def}ifelse}if}ifelse
+@gr $wid 0 gt $hei 0 gt and{$pn cvlit load aload pop/$pd xd 3 -1 roll sub
+/$phei xd exch sub/$pwid xd $wid $pwid div ceiling 1 add/$tlx xd $hei $phei div
+ceiling 1 add/$tly xd currentdict/CorelPtrnL2Pattern known $psy 0 eq and $psx 0
+eq and{CorelPtrnL2Pattern}{$psx 0 eq{CorelPtrnTileVeritcal}{CorelPtrnTileHoriz
+}ifelse}ifelse}if @gr @np/$bkg false def}bd/CorelPtrnSetBBox{pathbbox/$ury xd
+/$urx xd/$lly xd/$llx xd}bd/CorelPtrnSetFirstTile{$tllx $pxf add dup $tllx gt
+{$pwid sub}if/$tx xd $tury $pyf sub dup $tury lt{$phei add}if/$ty xd}bd/p{/$pm
+xd 7 rp/$pyf xd/$pxf xd/$pn xd/$fil 1 def}bd/CorelPtrnDraw{@ep}bd
+/CorelPtrnPutTile{@sv/$in true def 2 copy dup $lly le{/$in false def}if $phei
+sub $ury ge{/$in false def}if dup $urx ge{/$in false def}if $pwid add $llx le{
+/$in false def}if $in{@np 2 copy m $pwid 0 rl 0 $phei neg rl $pwid neg 0 rl 0
+$phei rl clip @np $pn cvlit load aload pop 7 -1 roll 5 index sub 7 -1 roll 3
+index sub Tl matrix currentmatrix/$ctm xd CorelPtrnDraw pop pop pop pop}{pop
+pop}ifelse @rs}bd/CorelPtrnTileHoriz{CorelPtrnSetFirstTile 0 1 $tly 1 sub{dup
+$psx mul $tx add{dup $llx gt{$pwid sub}{exit}ifelse}loop exch $phei mul $ty
+exch sub 0 1 $tlx 1 sub{$pwid mul 3 copy 3 -1 roll add exch CorelPtrnPutTile
+pop}for pop pop}for}bd/CorelPtrnTileVeritcal{CorelPtrnSetFirstTile 0 1 $tlx 1
+sub{dup $pwid mul $tx add exch $psy mul $ty exch sub{dup $ury lt{$phei add}
+{exit}ifelse}loop 0 1 $tly 1 sub{$phei mul 3 copy sub CorelPtrnPutTile pop}for
+pop pop}for}bd L2? UseLevel 2 ge and{/CorelPtrnL2Pattern{@sv[$pn cvlit load
+aload pop pop]$pwid $phei $pn cvlit load aload pop pop pop pop pathbbox pop pop
+2 index sub exch 3 index sub 4 -2 roll pop pop exch matrix identmatrix
+translate/PatternMatrix xd/PatternYStep xd/PatternXStep xd/PatternBBox xd
+currentdict/PatternMainDict xd <</PaintType 1/PatternType 1/TilingType 1/BBox
+PatternBBox/XStep PatternXStep/YStep PatternYStep/PaintProc{begin
+PatternMainDict begin $ctm currentmatrix pop 0 CorelPtrnDraw end end}bind >>
+PatternMatrix makepattern setpattern fill @rs}def}if
+end
+%%EndResource
+%%EndProlog
+%%BeginSetup
+wCorel11Dict begin
+@BeginSysCorelDict
+2.6131 setmiterlimit
+1.00 setflat
+/$fst 128 def
+%%EndSetup
+
+%%Page: 1 1
+%LogicalPage: 1
+%%BeginPageSetup
+@sv
+@sm
+@sv
+%%EndPageSetup
+@rax %Note: Object
+147.81600 74.66400 428.47200 355.32000 @E
+ 0 O 0 @g
+0.00 0.00 0.00 1.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+428.47200 216.43200 m
+286.70400 355.32000 L
+147.81600 213.62400 L
+286.70400 74.66400 L
+428.47200 216.43200 L
+@c
+B
+
+@rax %Note: Object
+286.70400 80.35200 422.78400 216.43200 @E
+ 0 O 0 @g
+0.60 0.00 0.40 0.58 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+414.28800 216.43200 m
+422.78400 216.43200 L
+286.70400 80.35200 L
+286.70400 88.84800 L
+414.28800 216.43200 L
+@c
+B
+
+@rax %Note: Object
+153.50400 80.35200 286.70400 213.62400 @E
+ 0 O 0 @g
+0.60 0.00 0.40 0.51 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+153.50400 213.62400 m
+162.00000 213.62400 L
+286.70400 88.84800 L
+286.70400 80.35200 L
+153.50400 213.62400 L
+@c
+B
+
+@rax %Note: Object
+153.50400 213.62400 286.70400 349.63200 @E
+ 0 O 0 @g
+0.60 0.00 0.40 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+286.70400 341.20800 m
+286.70400 349.63200 L
+153.50400 213.62400 L
+162.00000 213.62400 L
+286.70400 341.20800 L
+@c
+B
+
+@rax %Note: Object
+286.70400 216.43200 422.78400 349.63200 @E
+ 0 O 0 @g
+0.73 0.00 0.99 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+286.70400 349.63200 m
+286.70400 341.20800 L
+414.28800 216.43200 L
+422.78400 216.43200 L
+286.70400 349.63200 L
+@c
+B
+
+@rax %Note: Object
+162.00000 88.84800 414.28800 341.20800 @E
+ 0 O 0 @g
+0.60 0.00 0.40 0.40 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+286.70400 88.84800 m
+414.28800 216.43200 L
+286.70400 341.20800 L
+162.00000 213.62400 L
+286.70400 88.84800 L
+@c
+B
+
+@rax %Note: Object
+165.81600 103.03200 423.72000 344.01600 @E
+ 0 O 0 @g
+0.00 0.00 0.00 1.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+313.20000 312.84000 m
+321.69600 304.27200 L
+321.69600 304.27200 L
+263.08800 244.80000 L
+263.08800 304.27200 L
+268.77600 304.27200 L
+277.27200 312.84000 L
+277.27200 335.44800 L
+268.77600 344.01600 L
+174.31200 344.01600 L
+165.81600 335.44800 L
+165.81600 312.84000 L
+174.31200 304.27200 L
+180.93600 304.27200 L
+180.93600 111.52800 L
+191.30400 103.03200 L
+220.60800 103.03200 L
+423.72000 312.84000 L
+423.72000 335.44800 L
+415.22400 344.01600 L
+322.63200 344.01600 L
+313.20000 335.44800 L
+313.20000 312.84000 L
+@c
+B
+
+@rax %Note: Object
+171.43200 309.96000 271.58400 338.40000 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+177.12000 309.96000 m
+171.43200 315.64800 L
+171.43200 332.64000 L
+177.12000 338.32800 L
+265.96800 338.40000 L
+271.58400 332.64000 L
+265.96800 329.90400 L
+263.08800 332.64000 L
+177.12000 318.52800 L
+177.12000 309.96000 L
+@c
+B
+
+@rax %Note: Object
+187.48800 108.72000 194.11200 315.64800 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+194.11200 108.72000 m
+187.48800 114.40800 L
+187.48800 310.03200 L
+194.11200 315.64800 L
+194.11200 108.72000 L
+@c
+B
+
+@rax %Note: Object
+247.03200 207.93600 341.56800 315.64800 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+335.88000 309.96000 m
+341.56800 315.64800 L
+341.56800 304.27200 L
+247.03200 207.93600 L
+257.47200 230.61600 L
+335.88000 309.96000 L
+@c
+B
+
+@rax %Note: Object
+177.12000 309.96000 196.05600 321.33600 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.50 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+196.05600 318.45600 m
+194.11200 315.64800 L
+187.48800 309.96000 L
+177.12000 309.96000 L
+177.12000 321.33600 L
+196.05600 318.45600 L
+@c
+B
+
+@rax %Note: Object
+247.03200 208.00800 271.58400 332.64000 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.50 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+257.47200 309.96000 m
+257.47200 230.61600 L
+247.03200 208.00800 L
+247.03200 315.72000 L
+263.08800 315.72000 L
+265.96800 318.52800 L
+263.08800 332.64000 L
+271.58400 332.64000 L
+271.58400 315.64800 L
+265.96800 309.96000 L
+257.47200 309.96000 L
+@c
+B
+
+@rax %Note: Object
+318.88800 309.96000 418.10400 338.32800 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+324.50400 309.96000 m
+318.88800 315.64800 L
+318.88800 332.64000 L
+325.44000 338.32800 L
+411.48000 338.32800 L
+418.10400 332.64000 L
+408.60000 324.14400 L
+324.50400 318.52800 L
+324.50400 309.96000 L
+@c
+B
+
+@rax %Note: Object
+194.11200 108.72000 418.10400 332.64000 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.50 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+418.10400 315.64800 m
+218.66400 108.72000 L
+194.11200 108.72000 L
+194.11200 117.21600 L
+212.11200 117.21600 L
+411.48000 321.33600 L
+408.60000 332.64000 L
+418.10400 332.64000 L
+418.10400 315.64800 L
+@c
+B
+
+@rax %Note: Object
+324.50400 309.96000 343.44000 321.33600 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.50 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+343.44000 318.45600 m
+341.49600 315.64800 L
+335.88000 309.96000 L
+324.50400 309.96000 L
+324.50400 321.33600 L
+343.44000 318.45600 L
+@c
+B
+
+@rax %Note: Object
+177.12000 114.40800 412.41600 332.71200 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.20 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+247.03200 208.00800 m
+247.03200 315.72000 L
+263.08800 315.72000 L
+265.96800 318.52800 L
+265.96800 329.90400 L
+263.08800 332.71200 L
+179.92800 332.71200 L
+177.12000 329.90400 L
+177.12000 318.52800 L
+179.92800 315.72000 L
+194.11200 315.72000 L
+194.11200 117.21600 L
+197.78400 114.40800 L
+213.98400 114.40800 L
+412.41600 321.33600 L
+412.41600 329.47200 L
+409.53600 332.71200 L
+327.38400 332.71200 L
+324.50400 329.90400 L
+324.50400 318.45600 L
+327.38400 315.64800 L
+341.56800 315.64800 L
+341.56800 304.27200 L
+247.03200 208.00800 L
+@c
+B
+
+@rax %Note: Object
+292.89600 185.18400 326.95200 213.55200 @E
+ 0 O 0 @g
+0.00 0.00 0.00 1.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+298.58400 207.86400 m
+305.20800 213.55200 L
+322.20000 213.55200 L
+326.95200 207.86400 L
+321.26400 190.87200 L
+314.71200 185.18400 L
+297.72000 185.18400 L
+292.89600 190.87200 L
+298.58400 207.86400 L
+@c
+B
+
+@rax %Note: Object
+304.27200 114.33600 424.22400 182.37600 @E
+ 0 O 0 @g
+0.00 0.00 0.00 1.00 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+304.27200 114.33600 m
+321.33600 165.31200 L
+315.64800 165.31200 L
+321.33600 182.37600 L
+346.75200 182.37600 L
+352.44000 176.68800 L
+356.25600 176.68800 L
+361.87200 182.37600 L
+380.80800 182.37600 L
+386.49600 176.68800 L
+390.24000 176.68800 L
+395.92800 182.37600 L
+416.66400 182.37600 L
+424.22400 171.00000 L
+411.84000 130.68000 L
+417.45600 130.68000 L
+411.98400 114.33600 L
+377.92800 114.33600 L
+391.24800 154.00800 L
+382.75200 154.00800 L
+374.90400 130.82400 L
+380.52000 130.82400 L
+375.19200 114.33600 L
+341.13600 114.33600 L
+354.38400 154.00800 L
+345.88800 154.00800 L
+337.96800 130.68000 L
+343.65600 130.68000 L
+338.32800 114.33600 L
+304.27200 114.33600 L
+@c
+B
+
+@rax %Note: Object
+311.83200 120.02400 418.46400 176.68800 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.20 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+414.07200 176.68800 m
+418.46400 170.42400 L
+404.49600 125.64000 L
+410.11200 125.64000 L
+408.24000 120.02400 L
+385.56000 120.02400 L
+398.80800 159.69600 L
+378.93600 159.69600 L
+367.63200 125.64000 L
+373.24800 125.64000 L
+371.37600 120.02400 L
+348.69600 120.02400 L
+361.94400 159.69600 L
+342.07200 159.69600 L
+330.76800 125.64000 L
+336.45600 125.64000 L
+334.51200 120.02400 L
+311.83200 120.02400 L
+328.89600 171.00000 L
+323.20800 171.00000 L
+325.08000 176.68800 L
+345.88800 176.68800 L
+351.57600 171.00000 L
+357.19200 171.00000 L
+362.88000 176.68800 L
+379.87200 176.68800 L
+385.56000 171.00000 L
+391.24800 171.00000 L
+396.93600 176.68800 L
+414.07200 176.68800 L
+@c
+B
+
+@rax %Note: Object
+267.40800 114.33600 318.45600 182.37600 @E
+ 0 O 0 @g
+0.00 0.00 0.00 1.00 k
+/$fm 0 def
+318.45600 182.37600 m
+301.10400 130.75200 L
+307.00800 130.75200 L
+301.39200 114.33600 L
+267.40800 114.33600 L
+284.40000 165.31200 L
+278.71200 165.31200 L
+318.45600 182.37600 L
+@c
+278.71200 165.31200 m
+284.40000 182.37600 L
+318.45600 182.37600 L
+@c
+F
+
+@rax %Note: Object
+267.40800 114.33600 318.45600 182.37600 @E
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+318.45600 182.37600 m
+301.10400 130.75200 L
+307.00800 130.75200 L
+301.39200 114.33600 L
+267.40800 114.33600 L
+284.40000 165.31200 L
+278.71200 165.31200 L
+@c
+278.71200 165.31200 m
+284.40000 182.37600 L
+318.45600 182.37600 L
+@c
+S
+
+@rax %Note: Object
+274.96800 120.02400 310.89600 176.68800 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.20 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+297.64800 120.02400 m
+299.52000 125.64000 L
+293.83200 125.64000 L
+310.89600 176.68800 L
+287.28000 176.68800 L
+285.33600 171.00000 L
+291.96000 171.00000 L
+274.96800 120.02400 L
+297.64800 120.02400 L
+@c
+B
+
+@rax %Note: Object
+299.52000 190.87200 320.32800 207.86400 @E
+ 0 O 0 @g
+0.00 0.00 0.00 0.20 k
+0 J 0 j [] 0 d 0 R 0 @G
+0.00 0.00 0.00 1.00 K
+0 0.21600 0.21600 0.00000 @w
+/$fm 0 def
+316.51200 193.68000 m
+320.32800 205.05600 L
+318.45600 207.86400 L
+307.08000 207.86400 L
+303.33600 205.05600 L
+299.52000 193.68000 L
+301.46400 190.87200 L
+312.84000 190.87200 L
+316.51200 193.68000 L
+@c
+B
+
+%%PageTrailer
+@rs
+@rs
+%%Trailer
+@EndSysCorelDict
+end
+%%DocumentSuppliedResources: procset wCorel11Dict 11.0 0
+%%EOF
diff --git a/runtime/vimlogo.gif b/runtime/vimlogo.gif
new file mode 100644
index 000000000..89c4c135a
--- /dev/null
+++ b/runtime/vimlogo.gif
Binary files differ
diff --git a/runtime/vimlogo.pdf b/runtime/vimlogo.pdf
new file mode 100644
index 000000000..a9ad60ff4
--- /dev/null
+++ b/runtime/vimlogo.pdf
Binary files differ
diff --git a/runtime/vimlogo.xpm b/runtime/vimlogo.xpm
new file mode 100644
index 000000000..63e0d54b5
--- /dev/null
+++ b/runtime/vimlogo.xpm
@@ -0,0 +1,75 @@
+/* XPM */
+static char *vimlogo[] = {
+/* width height num_colors chars_per_pixel */
+" 125 60 8 1",
+/* colors */
+". c #000000",
+"# c #00007f",
+"a c #007f00",
+"b c #7f7f7f",
+"c c #00ff00",
+"d c #bfbfbf",
+"e c #ffffff",
+"f c None",
+/* pixels */
+"fffffffffffffffffffffffffffee..eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffffffffffffffffffffee.cc.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fffffffffffffffffffffffffee.cccc.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffeeeeeeeeeeeeeeeeeeee.ccaacc.eeffeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fffffee....................caaaacc.eeee...................eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffee.deeeeeeeeeeeeeeeeeeb.aaaaacc.ee.deeeeeeeeeeeeeeeeeb.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffe.dedddddddddddddddddddb.aaaaacc..dedddddddddddddddddd.beffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffe.eddddddddddddddddddddb.aaaaaacc.edddddddddddddddddddb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffe.eddddddddddddddddddddb.aaaaaaac.edddddddddddddddddddb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffe.edddddddddddddddddddbb.aaaaaaaa.eddddddddddddddddddbb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffe.bbdddddddddddddddddbbb.aaaaaaaa.bbddddddddddddddddbb.befffffffffffffffffffffffffffeeeeeffffffffffffffffffffffffffffffff",
+"ffffee.bbbbddddddddddddbbbb.aaaaaaaaaa.bbbbddddddddddddbbb.eefffffffffffffffeeeeeeeeeeeee...effffffffffffffffffffffffffffffff",
+"fffffee..beddddddddddddbbb.aaaaaaaaaaaa..dedddddddddddbbb.eeffffffffffffffffe..........ee...effffffffffffffffffffffffffffffff",
+"ffffffeee.eddddddddddddbb.aaaaaaaaaaaaa.eedddddddddddbbb.eefffffffffffffffffe..........eee..eeeeeefffeeeeeeefffffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaaaaaaa.eedddddddddddbbb.eeffffffffffffffffffe..ee..ee..efe..e....eefee.....eeffffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaaaaaa.eedddddddddddbbb.eefffffffffffffffffffe..ee..ee..efe........eee.......eefffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaaaaa.eedddddddddddbbb.eeffffffffffffffffffffe..ee..ee..efe...eee..ee..eeeee..efffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaaaa.eedddddddddddbbb.eefffffffffffffffffffffeeeee..eeeeefe..eefe..ee.........efffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaaa.eedddddddddddbbb.eeffffffffffffffffffffffffffe..efffffe..effe..ee.........efffffffffffffff",
+"ffffffffe.eddddddddddddbb.aaaaaaa.eedddddddddddbbb.eefffffffffffffffffffffffffffe..efffffe..effe..ee..eeeeeeeefffffffffffffff",
+"fffffffee.eddddddddddddbb.aaaaaa.eedddddddddddbbb.eeffffffffffffffffffffffffffeee..eeeffee..eeee..ee...eeee..efffffffffffffff",
+"ffffffee..eddddddddddddbb.aaaaa.eedddddddddddbbb.c.eefffffffffffffffffffffffffe......effe....ee....ee........efffffffffffffff",
+"fffffee.c.eddddddddddddbb.aaaa.eedddddddddddbbb.acc.eeffffffffffffffffffffffffe......effe....ee....eee......eefffffffffffffff",
+"ffffee.cc.eddddddddddddbb.aaa.eedddddddddddbbb.aaacc.eefffffffffffffffffffffffeeeeeeeeffeeeeeeeeeeeefeeeeeeeeffffffffffffffff",
+"fffee.cca.eddddddddddddbb.aa.eedddddddddddbbb.aaaaacc.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffee.ccaa.eddddddddddddbb.a.eedddddddddddbbb.aaaaaaacc.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fee.ccaaa.eddddddddddddbb..eedddddddddddbbb.aaaaaaaaacc.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ee.ccaaaa.eddddddddddddbb.eedddddddddddbbb.aaaaaaaaaaacc.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"e.ccaaaaa.eddddddddddddbbeedddddddddddbbb.aaaaaaaaaaaaacc.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"...aaaaaa.eddddddddddddbdedddddddddddbbb.aaaaaaaaaaaaaaacc.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"e.##aaaaa.eddddddddddddbedddddddddddbbb.aaaaaaaaaaaaaaaaa...effffffffffffffffeeeeeffffeeeefffffeeeeffffffffffffffffffffffffff",
+"ee.##aaaa.eddddddddddddddddddddddddbbb.aaaaaaaaaaaaaaaaa##.eeffffffffffffffffe...effffe..efffffe..effffffffffffffffffffffffff",
+"fee.##aaa.edddddddddddddddddddddddbbb.aaaaaaaaaaaaaaaaa##.eefffffffffffffffffe...effffe..efffffe..effffffffffffffffffffffffff",
+"ffee.##aa.eddddddddddddddddddddddbbb.aaaaaaaaaaaaaaaaa##.eefffeeeeeeeffffeeeeee..efeeeeeeefffeee..eeeeefffeeeeeeeffeeeeeeeeee",
+"fffee.##a.edddddddddddddddddddddbbb.aaaaaaaaaaaaaaaaa##.eefffee.....eeffee....e..efe.....efffe........effee.....eefe....e...e",
+"ffffee.##.edddddddddddddddddddd....aaaaaaaaaaaaaaaaa##.eefffee.......eeee........efe.....efffe........efee.......eee.........",
+"fffffee.#.eddddddddddddddddddd.dbb.aaaaaaaaaaaaaaaa##.eeffffe..eeeee..ee...eee...efeeee..efffeee..eeeeefe...eee...eeee...ee..",
+"ffffffee..eddddddddddddddddddd.ddb.aaaaaaaaaaaaaaa##.eefffffe.........ee..eefee..effffe..efffffe..efffffe..eefee..effe..eeeee",
+"fffffffee.eddddddddddddddddddb.bbb.aaaaaaaaaaaaaa##.eeffffffe.........ee..efffe..effffe..efffffe..efffffe..efffe..effe..effff",
+"ffffffffe.edddddddddddddddddbbb...aaaaaaaaaaaaaa##.eeeeeeeffe..eeeeeeeee..eefee..effffe..efffffe..efeeeee..eefee..effe..effff",
+"ffffffffe.eddddddddddddddddbb......aa.....aa.....#......beefe...eeee..ee...eee...eeeeee..eeeeffe..eee..ee...eee...eeee..eeeee",
+"ffffffffe.edddddddddddddddbbb.dbbb.aa.dbbb..dbbbb..dbbbb.befee........eee.........ee........effe.......eee.......eee........e",
+"ffffffffe.eddddddddddddddbbb..bdd.aaa.bdddbbdddddbbdddddb.effee......eefee....e...ee........effee....eeefee.....eefe........e",
+"ffffffffe.edddddddddddddbbb.a.ddb.aaa.ddddddddddddddddddb.efffeeeeeeeefffeeeeeeeeeeeeeeeeeeeefffeeeeeeffffeeeeeeeffeeeeeeeeee",
+"ffffffffe.eddddddddddddbbb.a.bddb.aa.bdddbbbbddddbbbbdddb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.edddddddddddbbb.aa.bdd.aaa.bddb....bddb....bdd.beffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.eddddddddddbbb.aaa.ddb.aaa.ddb.##b.ddb.eeb.ddb.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.edddddddddbbb..aa.bddb.aa.bddb.#e.bddb.ee.bddb.efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.eddddddddbbb..aaa.bdd.aaa.bdd.#ee.bdd.bee.bdd.befffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.edddddddbbb.aaaaa.ddb.aaa.ddb.eeb.ddb.eeb.ddb.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.eddddddbbb.##aaa.bddb.aa.bddb.ee.bddb.ee.bddb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.edddddbbb.e.##aa.bdd.aaa.bdd.bee.bdd.bee.bdd.beffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffe.bddddbbb.eee.##a.ddb.aaa.ddb.eeb.ddb.eeb.ddb.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffee..bbbb..eefee.#.bbbbb.a.bbbbb.e.bbbbb.e.bbbbb.effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fffffffffeeb....beefffee........a.......e.......e.......effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffffeeeeeeeefffffee.##aaaa##.eeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffffffffffffffffffee.##aa##.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fffffffffffffffffffffffffee.####.eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"ffffffffffffffffffffffffffee.##.eefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+"fffffffffffffffffffffffffffee..eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
+};
diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
new file mode 100644
index 000000000..f69e3d690
--- /dev/null
+++ b/runtime/vimrc_example.vim
@@ -0,0 +1,81 @@
+" An example for a vimrc file.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2002 Sep 19
+"
+" To use it, copy it to
+" for Unix and OS/2: ~/.vimrc
+" for Amiga: s:.vimrc
+" for MS-DOS and Win32: $VIM\_vimrc
+" for OpenVMS: sys$login:.vimrc
+
+" When started as "evim", evim.vim will already have done these settings.
+if v:progname =~? "evim"
+ finish
+endif
+
+" Use Vim settings, rather then Vi settings (much better!).
+" This must be first, because it changes other options as a side effect.
+set nocompatible
+
+" allow backspacing over everything in insert mode
+set backspace=indent,eol,start
+
+if has("vms")
+ set nobackup " do not keep a backup file, use versions instead
+else
+ set backup " keep a backup file
+endif
+set history=50 " keep 50 lines of command line history
+set ruler " show the cursor position all the time
+set showcmd " display incomplete commands
+set incsearch " do incremental searching
+
+" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
+" let &guioptions = substitute(&guioptions, "t", "", "g")
+
+" Don't use Ex mode, use Q for formatting
+map Q gq
+
+" This is an alternative that also works in block mode, but the deleted
+" text is lost and it only works for putting the current register.
+"vnoremap p "_dp
+
+" Switch syntax highlighting on, when the terminal has colors
+" Also switch on highlighting the last used search pattern.
+if &t_Co > 2 || has("gui_running")
+ syntax on
+ set hlsearch
+endif
+
+" Only do this part when compiled with support for autocommands.
+if has("autocmd")
+
+ " Enable file type detection.
+ " Use the default filetype settings, so that mail gets 'tw' set to 72,
+ " 'cindent' is on in C files, etc.
+ " Also load indent files, to automatically do language-dependent indenting.
+ filetype plugin indent on
+
+ " Put these in an autocmd group, so that we can delete them easily.
+ augroup vimrcEx
+ au!
+
+ " For all text files set 'textwidth' to 78 characters.
+ autocmd FileType text setlocal textwidth=78
+
+ " When editing a file, always jump to the last known cursor position.
+ " Don't do it when the position is invalid or when inside an event handler
+ " (happens when dropping a file on gvim).
+ autocmd BufReadPost *
+ \ if line("'\"") > 0 && line("'\"") <= line("$") |
+ \ exe "normal g`\"" |
+ \ endif
+
+ augroup END
+
+else
+
+ set autoindent " always set autoindenting on
+
+endif " has("autocmd")
diff --git a/src.info b/src.info
new file mode 100755
index 000000000..1ab7c6cb1
--- /dev/null
+++ b/src.info
Binary files differ
diff --git a/src/INSTALL b/src/INSTALL
new file mode 100644
index 000000000..b1aa6a879
--- /dev/null
+++ b/src/INSTALL
@@ -0,0 +1,427 @@
+INSTALL - Installation of Vim on different machines.
+
+This file contains instructions for compiling Vim. If you already have an
+executable version of Vim, you don't need this.
+
+Contents:
+1. Generic
+2. Unix
+3. RISC OS
+4. Macintosh
+5. OS/2 (with EMX 0.9b)
+6. Atari MiNT
+
+For OS/390 Unix see ../runtime/doc/os_390.txt
+For BeBox see ../runtime/doc/os_beos.txt.
+For Amiga see INSTALLami.txt
+For PC (MS-DOS, Windows NT, Windows 95) see INSTALLpc.txt
+For Macintosh see INSTALLmac.txt
+
+
+1. Generic
+==========
+
+If you compile Vim without specifying anything, you will get the default
+behaviour as is documented, which should be fine for most people.
+
+For features that you can't enable/disable in another way, you can edit the
+file "feature.h" to match your preferences.
+
+
+2. Unix
+=======
+
+Summary:
+1. make run configure, compile and link
+2. make install installation in /usr/local
+
+This will include the GUI and X11 libraries, if you have them. If you want a
+version of Vim that is small and starts up quickly, see the Makefile for how
+to disable the GUI and X11. If you don't have Motif and/or X11, these
+features will be disabled automatically.
+
+See the start of Makefile for more detailed instructions about how to compile
+Vim.
+
+If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
+before starting configure. Example:
+
+ env CFLAGS=-I/usr/local/include LIBS=-lm make
+
+This is only needed for things that configure doesn't offer a specific argument
+for or figures out by itself. First try running configure without extra
+arguments.
+
+GNU Autoconf and a few other tools have been used to make Vim work on many
+different Unix systems. The advantage of this is that Vim should compile
+on most sytems without any adjustments. The disadvantage is that when
+adjustments are required, it takes some time to understand what is happening.
+
+If configure finds all library files and then complains when linking that some
+of them can't be found, your linker doesn't return an error code for missing
+libraries. Vim should be linked fine anyway, mostly you can just ignore these
+errors.
+
+If you run configure by hand (not using the Makefile), remember that any
+changes in the Makefile have no influence on configure. This may be what you
+want, but maybe not!
+
+The advantage of running configure separately, is that you can write a script
+to build Vim, without changing the Makefile or feature.h. Example (using sh):
+
+ CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
+
+One thing to watch out for: If the configure script itself changes, running
+"make" will execute it again, but without your arguments. Do "make clean" and
+run configure again.
+
+If you are compiling Vim for several machines, for each machine:
+ a. make shadow
+ b. mv shadow machine_name
+ c. cd machine_name
+ d. make; make install
+
+[Don't use a path for machine_name, just a directory name, otherwise the links
+that "make shadow" creates won't work.]
+
+
+Unix: COMPILING WITH/WITHOUT GUI
+
+These configure arguments can be used to select which GUI to use:
+--enable-gui= gtk, motif, athena or auto
+--disable-gtk-check
+--disable-motif-check
+--disable-athena-check
+
+--enable-gui defaults to "auto", so it will automatically look for a GUI (in
+the order of GTK, Motif, then Athena). If one is found, then is uses it and
+does not proceed to check any of the remaining ones. Otherwise, it moves on
+to the next one.
+
+--enable-{gtk,motif,athena}-check all default to "yes", such that if
+--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
+be checked for. If you want to *exclude* a certain check, then you use
+--disable-{gtk,motif,athena}-check.
+
+For example, if --enable-gui is set to "auto", but you don't want it look for
+Motif, you then also specify --disable-motif-check. This results in only
+checking for GTK and Athena.
+
+Lastly, if you know which one you want to use, then you can just do
+--enable-gui={gtk,motif,athena}. So if you wanted to only use Motif, then
+you'd specify --enable-gui=motif. Once you specify what you want, the
+--enable-{gtk,motif,athena}-check options are ignored.
+
+For compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
+Configure checks for at least version 1.1.16, but below 2.0. An older versions
+is not selected automatically. If you want to use it anyway, run configure
+with "--disable-gtktest". GTK 2.0 doesn't work yet.
+GTK requires an ANSI C compiler. If you fail to compile Vim with GTK+ (it
+is the preferred choice), try selecting another one in the Makefile.
+If you are sure you have GTK installed, but for some reason configure says you
+do not, you may have left-over header files and/or library files from an older
+(and incompatible) version of GTK. if this is the case, please check
+auto/config.log for any error messages that may give you a hint as to what's
+happening.
+
+Unix: COMPILING WITH MULTI-BYTE
+
+When you want to compile with the multi-byte features enabled, make sure you
+compile on a machine where the locale settings actually work. otherwise the
+configure tests may fail. You need to compile with "big" features:
+
+ ./configure --with-features=big
+
+Unix: COMPILING ON LINUX
+
+On Linux, when using -g to compile (which is default for gcc), the executable
+will probably be statically linked. If you don't want this, remove the -g
+option from CFLAGS.
+
+Unix: PUTTING vimrc IN /etc
+
+Some Linux distributions prefer to put the global vimrc file in /etc, and the
+Vim runtime files in /usr. This can be done with:
+ ./configure --prefix=/usr
+ make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
+
+Unix: COMPILING ON NeXT
+
+Add the "-posix" argument to the compiler by using one of these commands:
+ setenv CC 'cc -posix' (csh)
+ export CC='cc -posix' (sh)
+And run configure with "--disable-motif-check".
+
+
+3. RISC OS
+=============
+
+Much file renaming is needed before you can compile anything.
+You'll need UnixLib to link against, GCC and GNU make.
+
+I suggest you get the RISC OS binary distribution, which includes the
+Templates file and the loader.
+
+Try here: http://www.ecs.soton.ac.uk/~tal197
+
+Do
+ :help riscos
+
+within the editor for more information, or read the os_riscos.txt help file.
+
+
+4. Macintosh
+============
+
+Vim should work on the Macintosh, but I don't have a makefile for it.
+Work is being done to update the Macintosh port. It's a lot of work; don't
+expect it soon.
+
+
+5. OS/2
+=======
+
+Summary:
+ren Makefile Makefile.unix
+ren makefile.os2 Makefile
+make
+
+This port of Vim to OS/2 is based on the emx environment together
+with GNU C. The main design goal of emx is to simplify porting Unix
+software to OS/2 and DOS. Because of this, almost all the Unix defines
+etc. already existing in the Vim source code could be reused. Only where
+OS/2 specifics came into play were additional changes necessary. Those
+places can be found by searching for "OS2" and "__EMX__" (I've tried to
+keep emx-specific things separate from generic OS/2 stuff).
+
+Note: This OS/2 port works well for me and an additional OS/2 user on
+ the Vim development team (Karsten Sievert); however, since I
+ haven't had any other feedback from other people, that either
+ means no (OS/2-specific) bugs exist, or no one has yet created
+ a situation in which any bugs are apparent.
+ Report any problems or other comments to paul@wau.mis.ah.nl
+ (email valid up to at least September 1996, after that try
+ paul@wurtel.hobby.nl, paul@murphy.nl, or paulS@toecompst.nl).
+ Textmode/notextmode and binary mode both seem to work well.
+
+Prerequisites:
+- To compile, you need the emx environment (at least rev. 0.9b), GCC,
+ some make utility (GNU make works fine). These are generally
+ available as (ask Archie about them):
+ emxrt.zip emx runtime package
+ emxdev.zip emx development system (without compiler)
+ GNU programs compiled for emx, patches and patched sources:
+ gnudev1.zip GNU development tools compiled for emx (part 1)
+ gnudev2.zip GNU development tools compiled for emx (part 2)
+ gnumake.zip GNU make
+- Don't set a TERM environment variable; Vim defaults to os2ansi
+ which is available as a builtin termcap entry. Using other values
+ may give problems! (OS/2 ANSI emulation is quite limited.) If you
+ need to set TERM for other programs, you may consider putting
+ set term=os2ansi in the vimrc file.
+
+Check vim_os2.txt for additional info on running Vim.
+
+
+6. Atari MiNT
+=============
+
+
+To compile Vim for MiNT you may either copy makefile.mint to Makefile or use
+the Unix Makefile adapted for the MiNT configuration.
+
+Now proceed as described in the Unix section.
+
+Prerequisites:
+
+You need a curses or termcap library that supports non-alphanumeric
+termcap names. If you don't have any, link with termlib.o.
+
+-----------------------------------------------------------------------------
+
+The rest of this file is based on the INSTALL file that comes with GNU
+autoconf 2.12. Not everything applies to Vim. Read Makefile too!
+
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/src/INSTALLami.txt b/src/INSTALLami.txt
new file mode 100644
index 000000000..0acd6fdff
--- /dev/null
+++ b/src/INSTALLami.txt
@@ -0,0 +1,34 @@
+INSTALLami.txt - Installation of Vim from source on Amiga
+
+This file contains instructions for compiling Vim. If you already have an
+executable version of Vim, you don't need this.
+
+The file "feature.h" can be edited to match your preferences. You can skip
+this, then you will get the default behavior as is documented, which should
+be fine for most people.
+
+
+Summary:
+make -f Make_manx.mak Manx C
+make -f Make_sas.mak Lattice/SAS C
+make -f Make_dice.mak DICE
+
+The Manx compiler is preferred, it was used to produce the Amiga executable
+and has been tested most. You should not get any errors or warnings.
+
+The SAS compiler can be used. Older versions (6.0 to 6.3) don't work with the
+optimizer switched on. This seems to be fixed with 6.5 or 6.56, but this has
+not been tested much. Also disable optimizing when the compiler runs out of
+memory or crashes the system (yes, that happens; did I say the Manx compiler
+is preferred?).
+
+The DICE makefile has been reported to work by one person only.
+
+You will have to set the "VIM" environment variable to the location of the
+documentation files.
+
+
+MorphOS
+
+Use the Make_morph.mak Makefile:
+ make -f Make_morph.mak
diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt
new file mode 100644
index 000000000..8b944c379
--- /dev/null
+++ b/src/INSTALLmac.txt
@@ -0,0 +1,164 @@
+INSTALLmac.txt - Installation of Vim on Macintosh
+
+This file contains instructions for compiling Vim. If you already have an
+executable version of Vim, you don't need this.
+
+An alternate way of building that Benji Fisher uses can be found here:
+
+ http://macvim.swdev.org/OSX/#Developers
+
+----------------------------------------------------------------------------
+Summary
+----------------------------------------------------------------------------
+
+1 MacOS X
+ 1.1. Carbon interface
+ 1.2. X (Athena, GTK, Motif) or plain text.
+
+2 MacOS Classic
+ 2.1. CodeWarrior
+ 2.2. MPW
+
+NOTE: The Carbon version can only be compiled properly under
+ MacOS X.
+
+----------------------------------------------------------------------------
+1 MacOS X
+----------------------------------------------------------------------------
+
+1.0 Considerations
+
+ Only '/' supported as path separator.
+
+1.1 Carbon interface (default)
+
+ You can compile vim with the standard Unix routine:
+ cd ..
+ ./configure
+ make; make install
+
+ This will create a working Vim.app application bundle in the src
+ directory. You can move this bundle (the Vim.app directory) anywhere
+ you want, for example, /Applications.
+
+1.2 X-Windows or Plain Text
+
+ If you do not want the Carbon interface, you must explicitly tell
+ configure to use a different GUI.
+
+ cd ..
+ ./configure --enable-gui=gtk2
+ make; make install
+
+ NOTE: The following GUI options are supported:
+ no (for text), motif, athena, nextaw
+ gtk, gtk2, gnome, gnome2,
+
+ NOTE: You need to first install XFree86 and XDarwin.
+ Please visit http://www.XDarwin.org
+
+----------------------------------------------------------------------------
+MacOS 9
+----------------------------------------------------------------------------
+
+Both ':' and '/' supported as path separator.
+
+2.1: Compiling with CodeWarior
+
+ 1. Expand the resource file:
+ open ../src/os_mac.rsr.hqx to produce ../src/gui_mac.rsrc:
+ % cd vim62/src
+ % open -a StuffIt\ Expander os_mac.rsr.hqx
+
+ 2. Expand the project file:
+ - ../src/os_mac.sit.hqx (to produce ../src/vim.mcp)
+
+ 3. Open vim.mcp with CodeWarior
+
+ This is a CodeWarior 9 project file. When using a newer version,
+ you need to convert the file. you may also need to change some
+ access path.
+
+ NOTE: the current project file is old, you need to add a few files:
+ (ex_cmds2.c, fold.c, mbyte.c, move.c)
+
+ 4. Select the target PPC, 68k FAT (with/without debugger)
+
+ 5. Compile
+
+2.2: Compiling with MPW.
+
+ 0. You will need a recent version of the MPW and the Universal Interfaces.
+ You can get both at:
+ ftp://ftp.apple.com/developer/Tool_Chest/Interfaces-Libraries/
+ ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/
+ For a Carbon version you will need a recent Carbon SDK as well.
+ (When you have an older version already installed you not be able to
+ compile a carbon version. Update "CreateMake" which is available at
+ Apple.
+
+ 1. Expand the resource file:
+ open ../src/os_mac.rsr.hqx to produce ../src/gui_mac.rsrc:
+ % cd vim62/src
+ % open -a StuffIt\ Expander os_mac.rsr.hqx
+
+ 3. Double click on os_make.make, the MPW will now open in the correct
+ folder and load the CreateVimMake script. Change to the Worksheet
+ window. Type "os_mac.build" and hit Enter (not Return). A dialog box
+ will appear. Select the target you want. (Vim-68k, Vim-ppc, Vim-carbon)
+
+ 4. Select "Build" from the menu (or type command-B). Type the program name
+ into the dialog box.
+
+------------------------------------------------------
+
+OLD FILE: SOME INFO MAY STILL BE USEFUL
+
+NOTE: Users of more recent CodeWarrior version may have to reset the library
+ path, and change the mch_delay in os_mac.c so the finalTick is unsigned.
+
+Compilation instructions:
+
+1. Visit the Vim ftp site (see ftp://ftp.vim.org/pub/vim/MIRRORS)
+ and obtain the following five files:
+
+ unix/vim-X.X-src1.tar.gz
+ unix/vim-X.X-src2.tar.gz
+ unix/vim-X.X-rt1.tar.gz
+ unix/vim-X.X-rt2.tar.gz
+ extra/vim-X.X-extra.tar.gz
+
+ where X.X is the version number.
+
+ NOTE: the language support is not yet supported
+
+2. Expand the archives.
+
+3. Apply patches if they exist. (Patch files are found in the ftp
+ site in the "patches" directory.)
+
+4. Edit vim-X.X/src/feature.h for your preference. (You can skip
+ this, then you will get the default behavior as is documented,
+ which should be fine for most people.)
+
+ For example, if you want to add the FEAT_MBYTE feature, turn on
+ #define FEAT_MBYTE
+
+5. Expand the resource file:
+
+ - vim-X.X/src/os_mac.rsr.hqx (to produce vim-X.X/src/gui_mac.rsrc)
+
+6. If using CodeWarrior, expand the project file:
+
+ - vim-X.X/src/os_mac.sit.hqx (to produce vim-X.X/src/vim.mcp)
+
+ The latter file is the CodeWarrior project file to be used.
+
+7. Launch CodeWarrior by double clicking vim.mcp.
+
+8. Check additional files if you include non-standard features.
+
+ For example, if you added the MULTI_BYTE feature, check
+ Extras/mbyte.c in the project window.
+
+9. Compile and you will obtain binaries: vimPPC, Vim 68k, and/or vimFAT.
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
new file mode 100644
index 000000000..1e7d3297a
--- /dev/null
+++ b/src/INSTALLpc.txt
@@ -0,0 +1,310 @@
+INSTALLpc.txt - Installation of Vim on PC
+
+This file contains instructions for compiling Vim. If you already have an
+executable version of Vim, you don't need this.
+
+More information can be found here:
+
+ http://mywebpage.netscape.com/sharppeople/vim/howto/
+
+The file "feature.h" can be edited to match your preferences. You can skip
+this, then you will get the default behavior as is documented, which should
+be fine for most people.
+
+
+Contents:
+1. MS-DOS
+2. Win32 (Windows NT and Windows 95)
+3. Windows NT with OpenNT
+4. Windows 3.1
+5. Using Mingw
+6. Cross compiling for Win32 from a Linux machine
+7. Building with Python support
+
+
+1. MS-DOS
+=========
+
+Summary:
+ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++
+ren Make_tcc.mak Makefile; make 16 bit, Turbo C
+make -f Make_djg.mak 32 bit, DJGPP 2.0
+make -f Make_bc5.mak 32 bit, Borland C++ 5.0 (edit it to
+ define DOS)
+
+Warning: Be sure to use the right make.exe. Microsoft C make doesn't work;
+Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak;
+DJGPP/GNU make must be used for Make_djg.mak.
+
+The Borland C++ compiler has been used to generate the MS-DOS executable; it
+should work without problems. You will probably have to change the paths for
+LIBPATH and INCLUDEPATH in the start of the Makefile. You will get two
+warnings which can be ignored (one about _chmod and one about precompiled
+header files).
+
+The "spawno" library by Ralf Brown was used in order to free memory when Vim
+starts a shell or other external command. Only about 200 bytes are taken from
+conventional memory. When recompiling get the spawno library from Simtel,
+directory "msdos/c". It is called something like "spwno413.zip". Or follow
+the instructions in the Makefile to remove the library.
+
+The Turbo C Makefile has not been tested much lately. It is included for those
+that don't have C++. You may need to make a few changes to get it to work.
+
+DJGPP needs to be installed properly to compile Vim; you need a lot of things
+before it works. When your setup is OK, Vim should compile with just one
+warning (about an argument to signal()).
+
+Make_bc5.mak is for those that have Borland C++ 5.0 or later. At the top of
+the file, there are some variables you can change to make either a 32-bit
+Windows exe (GUI or console mode), or a 16-bit MS-DOS version.
+
+If you get all kinds of strange error messages when compiling, try adding <CR>
+characters at the end of each line.
+
+
+2. Win32 (Windows NT and Windows 95)
+====================================
+
+Summary:
+vcvars32 Setup paths for nmake and MSVC
+
+nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
+nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
+nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
+nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
+ Perl, Python, etc.
+ Microsoft Visual C++
+
+make -f Make_bc5.mak GUI Borland C++ 5.x
+make -f Make_bc5.mak console Borland C++ 5.x (change the file)
+nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
+ GUI Microsoft Visual C++ 4.x or later
+nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
+ OLE Microsoft Visual C++ 4.x or later
+
+make -f Make_cyg.mak various Cygnus gcc
+make -f Make_mingw.mak various MingW with gcc
+
+See the specific files for comments and options.
+
+These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
+Ron Aaron; they have been tested. The Cygnus one many not fully work yet.
+With Cygnus gcc you can use the Unix Makefile instead (you need to get the
+Unix archive then). Then you get a Cygwin application (feels like Vim is
+runnin on Unix), while with Make_cyg.mak you get a Windows application (like
+with the other makefiles).
+
+You can also use the Visual C++ IDE: use File/Open workspace, select the
+Make_ivc.mak file, then select Build/Build all. This builds the GUI version
+by default.
+
+Vim for Win32 compiles with the Microsoft Visual C++ 2.0 compiler and later,
+and with the Borland C++ 4.5 32-bit compiler and later. It compiles on
+Windows 95 and all four NT platforms: i386, Alpha, MIPS, and PowerPC. The
+NT/i386 and the Windows 95 binaries are identical. Use Make_mvc.mak to
+compile with Visual C++ and Make_bc5.mak to compile with Borland C++.
+
+Make_mvc.mak allows a Vim to be built with various different features and
+debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
+For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
+
+For compiling Gvim with IME support on far-east Windows, uncomment the
+MULTI_BYTE_IME define in the src/feature.h file before compiling.
+
+The Win32 console binary was compiled with Visual C++ version 5.0, using
+Make_mvc.mak and Make_bc5.mak (Borland C). Other compilers should also work.
+If you get all kinds of strange error messages when compiling (you shouldn't
+with the Microsoft or Borland 32-bit compilers), try adding <CR> characters
+at the end of each line.
+
+You probably need to run "vcvars32" before using "nmake".
+
+For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER.
+In version 4.2 support for Win32s was dropped! Use this command:
+ nmake -f Make_mvc.mak GUI=yes
+
+See the respective Makefiles for more comments.
+
+
+3. Windows NT with OpenNT
+=========================
+
+(contributed by Michael A. Benzinger)
+
+Building Vim on OpenNT 2.0 on Windows NT 4.0, with Softway's prerelease gcc:
+1. export CONFIG_SHELL=//D/OpenNT/bin/sh
+2. Make the following exports for modifying config.mk:
+ export CFLAGS=-O -Wshadow
+ export X_PRE_LIBS=-lXmu
+2. Run configure as follows:
+ configure --prefix=/vim --bindir=/bin/opennt --enable-gui=Motif
+ If you don't have OpenNTif (Motif support), use this:
+ configure --prefix=/vim --bindir=/bin/opennt --enable-gui=Athena
+3. Edit Makefile to perform the following since the Makefile include syntax
+ differs from that of gmake:
+ #include config.mk
+ .include "config.mk"
+4. Change all install links to be "ln -f" and not "ln -s".
+5. Change to the 'ctags' directory and configure.
+6. Edit the Makefile and remove spurious spaces from lines 99 and 114.
+7. Change slink to "ln -f" from "ln -s".
+8. Return to the src directory.
+9. make
+
+
+4. Windows 3.1x
+===============
+
+make -f Make_w16.mak 16 bit, Borland C++ 5.0
+
+Warning: Be sure to use the right make.exe. It should be Borland make.
+
+You will almost certainly have to change the paths for libs and include files
+in the Makefile. Look for "D:\BC5" and "ctl3dv2". You will get a number of
+warnings which can be ignored ( _chmod, precompiled header files, and
+"possibly incorrect assignment").
+
+The makefile should also work for BC++ 4.0 and 4.5, but may need tweaking to
+remove unsupported compiler & liker options.
+
+
+5. Mingw
+========
+
+(written by Ron Aaron: <ronaharon@yahoo.com>)
+
+This is about how to produce a Win32 binary of gvim with Mingw.
+
+First, you need to get the 'mingw32' compiler, which is free for the download
+at:
+
+ http://www.mingw.org/
+
+Once you have downloaded the compiler binaries, unpack them on your hard disk
+somewhere, and put them on your PATH. If you are on Win95/98 you can edit
+your AUTOEXEC.BAT file with a line like:
+
+ set PATH=C:\GCC-2.95.2\BIN;%PATH%
+
+or on NT/2000, go to the Control Panel, System, and edit the environment from
+there.
+
+Test if gcc is on your path. From a CMD (or COMMAND on '95/98):
+
+ C:\> gcc --version
+ 2.95.2
+
+ C:\> make --version
+ GNU Make version 3.77 (...etc...)
+
+Now you are ready to rock 'n' roll. Unpack the vim sources (look on
+www.vim.org for exactly which version of the vim files you need).
+
+Change directory to 'vim\src':
+
+ C:\> cd vim\src
+ C:\VIM\SRC>
+
+and you type:
+
+ make -f Make_ming.mak gvim.exe
+
+After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
+directory.
+
+You should not need to do *any* editing of any files to get vim compiled this
+way. If, for some reason, you want the console-mode-only version of vim (this
+is NOT recommended on Win32, especially on '95/'98!!!), you need only change
+the 'gvim.exe' to 'vim.exe' in the 'make' commands given above.
+
+If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
+(also free!) and compress the file (typical compression is 50%). UPX can be
+found at
+ http://upx.tsx.org/
+
+
+ADDITION: NLS support with Mingw
+
+(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
+
+If you want National Language Support, read the file src/po/README_mingw.txt.
+You need to uncomment lines in Make_ming.mak to have NLS defined.
+
+
+6. Cross compiling for Win32 from a Linux machine
+=================================================
+
+(written by Ron Aaron: <ronaharon@yahoo.com> with help from
+Martin Kahlert <martin.kahlert@infineon.com>)
+
+If you like, you can compile the 'mingw' Win32 version from the comfort of
+your Linux (or other unix) box. To do this, you need to follow a few steps:
+
+ 1) Install the mingw32 cross-compiler (if you have it, go to step 2)
+ 1a) from 'ftp://ftp.nanotech.wisc.edu/pub/khan/gnu-win32/mingw32/snapshots/gcc-2.95.2-1',
+ get:
+ binutils-19990818-1-src.tar.gz
+ mingw-msvcrt-20000203.zip
+ gcc-2.95.2-1-x86-win32.diff.gz
+ 1b) from 'http://gcc.gnu.org/' get:
+ gcc-2.95.2.tar.gz
+ 1c) create a place to put the compiler source and binaries:
+ (assuming you are in the home directory)
+ mkdir gcc-bin
+ mkdir gcc-src
+ 1d) unpack the sources:
+ cd gcc-src
+ tar xzf ../binutils-19990818-1-src.tar.gz
+ tar xzf ../gcc-2.95.2.tar.gz
+ unzip ../mingw-msvcrt-20000203
+ 1e) build the different tools:
+ export PREFIX=~/gcc-bin/
+ cd gcc-2.95.2
+ zcat ../gcc-2.95.2-1-x86-win32.diff.gz | patch -p1 -E
+ cd ../binutils-19990818
+ ./configure --target=i586-pc-mingw32msvc --prefix=$PREFIX
+ make
+ make install
+ cd ../gcc-2.95.2
+ ./configure --target=i586-pc-mingw32msvc \
+ --with-libs=~/gcc-bin/i386-mingw32msvc/lib \
+ --with-headers=~/gcc-bin/i386-mingw32msvc/include \
+ --enable-languages=c++ \
+ --prefix=$PREFIX
+ make
+ make install
+ 1f) Add $PREFIX/bin to your $PATH.
+
+ 2) get the *unix* version of the vim sources
+ 3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'.
+ 4) make -f Make_ming.mak gvim.exe
+
+Now you have created the Windows binary from your Linux box! Have fun...
+
+7. Building with Python support
+=================================================
+
+(written by Ron Aaron: <ronaharon@yahoo.com>)
+
+This has been tested with the mingw32 compiler, and the ActiveState
+ActivePython:
+ http://www.ActiveState.com/Products/ActivePython/
+
+After installing the ActivePython, you will have to create a 'mingw32'
+'libpython20.a' to link with:
+ cd $PYTHON/libs
+ pexports python20.dll > python20.def
+ dlltool -d python20.def -l libpython20.a
+
+Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
+the root of the Python installation (C:\Python20, for example). If you are
+cross-compiling on Linux with the mingw32 setup, you need to also convert all
+the 'Include' files to *unix* line-endings. This bash command will do it
+easily:
+ for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
+
+Now just do:
+ make -f Make_ming.mak gvim.exe
+
+and you will end up with a Python-enabled, Win32 version. Enjoy!
diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt
new file mode 100644
index 000000000..f7df6a740
--- /dev/null
+++ b/src/INSTALLvms.txt
@@ -0,0 +1,375 @@
+INSTALLvms.txt - Installation of Vim on OpenVMS
+
+Maintainer: Zoltan Arpadffy <arpadffy@polarfox.com>
+Last change: 2003 May 04
+
+This file contains instructions for compiling Vim on Openvms.
+If you already have an executable version of Vim, you don't need this.
+
+If you skip settings described here, then you will get the default Vim
+behavior as it is documented, which should be fine for most users.
+
+The file "feature.h" can be edited to match your preferences, but this files
+does not describe possibilities hidden in feature.h acrobatics, however
+parameters from MAKE_VMS.MMS actively uses and sets up parameters in relation
+with feature.h
+
+More information and case analysis you can found in os_vms.txt
+([runtime.doc]os_vms.txt or :help vms from vim prompt)
+
+Contents:
+1. Download files
+2. Configuration
+3. Compilation DECC
+4. Compilation VAXC
+5. CTAGS, XXD
+6. Deployment
+7. GTK and other features
+8. Notes
+9. Authors
+
+----------------------------------------------------------------------------
+1. Download files
+
+1.1. Visit the Vim ftp site (see ftp://ftp.vim.org/pub/vim/MIRRORS)
+ and obtain the following three files:
+
+ unix/vim-X.X-src.tar.gz
+ unix/vim-X.X-rt.tar.gz
+ extra/vim-X.X-extra.tar.gz
+
+ where X.X is the version number.
+
+1.2. Expand the three archives.
+
+1.3. Apply patches if they exist. (Patch files are found in the ftp
+ site in the "patches" directory.)
+
+1.4. You will need either the DECSET mms utility or the freely available clone
+ of it called mmk (VMS has no make utility in the standard distribution).
+ You can download mmk from http://www.openvms.digital.com/freeware/MMK/
+
+1.5. If you want to have Perl, Python or Tcl support in Vim you will need VMS
+ distributions for them as well.
+
+1.6 If you want to have GTK executable, you need to have properly installed
+ GTK libraries.
+
+NOTE: procedure in chapter 1 describes source code preparation from multi OS
+code,however it is available OpenVMS oprimized (and tested) source code from:
+ftp://ftp.polarhome.com/pub/vim/source/vms/
+
+Current OpenVMS source code as .zip or .tar.gz file is possible to download
+from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/
+
+
+2. Configuration
+
+2.1. Edit vim-X.X/src/feature.h for your preference. (You can skip
+ this, then you will get the default behavior as is documented,
+ which should be fine for most people.)
+
+ For example, if you want to add the MULTI_BYTE feature, turn on
+ #define MULTI_BYTE
+
+2.2 Edit vim-X.X/src/Make_vms.mms to customize your Vim. Options are:
+
+ Parameter name : MODEL
+ Description : Build model selection
+ Options: : TINY - Almost no features enabled, not even
+ multiple windows
+ SMALL - Few features enabled, as basic as possible
+ NORMAL - A default selection of features enabled
+ BIG - Many features enabled, as rich as possible.
+ (OpenVMS default)
+ HUGE - All possible featues enabled.
+ Uncommented - will default to BIG
+ Default : MODEL = BIG
+
+ Parameter name : GUI
+ Description : GUI or terminal mode executable
+ Options: : YES - GUI executable
+ Uncommented - char only
+ Default : GUI = YES
+
+ Parameter name : GTK
+ Description : Enable GTK in GUI mode.
+ It enables features as toolbar etc.
+ Options: : YES - GTK executable
+ Uncommented - without GTK
+ Default : Uncommented
+
+ Parameter name : DECC
+ Description : Compiler selection
+ Options: : YES - DECC compiler
+ Uncommented - VAXC compiler
+ Default : DECC = YES
+
+ Parameter name : CCVER
+ Description : Compiler version with :ver command
+ Options: : YES - Compiler version info will be added
+ Uncommented - will not be added
+ Default : CCVER = YES
+
+ Parameter name : DEBUG
+ Description : Building a debug version
+ Options: : YES - debug version will be built
+ Uncommented - building normal executable
+ Default : Uncommented
+
+ Parameter name : VIM_TCL
+ Description : Add Tcl support
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+ Parameter name : VIM_PERL
+ Description : Add Perl support
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+ Parameter name : VIM_PYTHON
+ Description : Add Python support
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+
+ Parameter name : VIM_XIM
+ Description : X Input Method. For entering special languages
+ like chinese and Japanese. Please define just
+ one: VIM_XIM or VIM_HANGULIN
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+ Parameter name : VIM_HANGULIN
+ Description : Internal Hangul input method. GUI only.
+ Please define just one: VIM_XIM or VIM_HANGULIN
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+ Parameter name : VIM_TAG_ANYWHITE
+ Description : Allow any white space to separate the fields in a
+ tags file
+ When not defined, only a TAB is allowed.
+ Options: : YES - Build with support
+ Uncommented - build without support.
+ Default : Uncommented
+
+ You can edit the *_INC and *_LIB qualifiers, but it is really
+ not recommended for beginners.
+
+3. Compilation DECC
+
+3.1. If you have MSS on your system, the command
+
+ mms /descrip=Make_vms.mms
+
+ will start building your own customized version of Vim.
+ The adequate command for mmk is:
+
+ mmk /descrip=Make_vms.mms
+
+ NOTE: Because of empty /auto/config.h (needed for Unix configure) build
+ will fail with very strange messages. Therefore before building, it is
+ recommended to make one clean up, to prepare everything for OpenVMS
+ development. The command is:
+
+ mms /descrip=Make_vms.mms clean
+
+4. Compilation VAXC
+
+4.1. VAXC compiler is not fully ANSI C compatible in pre-processor directives
+ semantics, therefore you have to use a converter program what will do the
+ lion part of the job.
+
+ @os_vms_fix.com *.c *.h <.proto>*.pro
+
+ more information can be found in os_vms_fix.com file itself.
+
+ NOTE: even if os_vms_fix.com will fix all pre-processor directives it will
+ leave singe (long) line directives. You have to fix them manually.
+ Known problematic files are option.h and option.c
+
+4.2. After the conversion you can continue building as it has been described
+ above.
+
+5. CTAGS, XXD
+
+5.1. MMS_VIM.EXE is building together with VIM.EXE, but for CTAGS.EXE and
+ XXD.EXE you should change to subdirectory <.CTAGS> or <.XXD> and build
+ them separately.
+
+5.2. In these directories you can found one make file for VMS as well.
+ Please read the detailed build instructions in the related *.MMS file.
+
+6. Deployment
+
+6.1. Copy over all executables to the deployment directory.
+
+6.2. Vim uses a special directory structure to hold the document and runtime
+ files:
+
+ vim (or wherever)
+ |-- doc
+ |-- syntax
+ vimrc (system rc files)
+ gvimrc
+
+6.3 Define logicals VIM
+
+ define/nolog VIM device:[leading-path-here.vim]
+
+ to get vim.exe to find its document, filetype, and syntax files.
+
+ Now, if you are lucky you should have one own built, customized and
+ working Vim.
+
+7. GTK and other features
+
+7.1 General notes
+
+ To be able to build external GUI or language support wyo have to enable
+ related feature in MAKE_VMS.MMS file. Usually it need some extra tuning
+ around include files, shared libraries etc.
+
+ Please note, that leading "," are valuable for MMS/MMK syntax.
+
+ MAKE_VMS.MMS uses defines as described below:
+
+7.1.1 feature_DEF = ,"SOME_FEATURE"
+
+ Submits definition to compiler preprocessor to enable code blocks
+ defined with
+ #ifdef SOME_FEATURE
+ {some code here}
+ #endif
+
+ Example: TCL_DEF = ,"FEAT_TCL"
+
+
+7.1.2 feature_SRC = code1.c code2.c
+
+ Defines source code related with particular feature.
+ Example: TCL_SRC = if_tcl.c
+
+7.1.3 feature_OBJ = code1.obj code2.obj
+
+ Lists objects created from source codes listed in feature_SRC
+ Example: PERL_OBJ = if_perlsfio.obj if_perl.obj
+
+7.1.4 feature_LIB = ,OS_VMS_TCL.OPT/OPT
+
+ Defines the libraries that have to be used for build.
+ If it is an OPT file then MAKE_VMS.MMS creates OPT files
+ in gen_feature procedure.
+
+ Example:
+ PERL_LIB = ,OS_VMS_PERL.OPT/OPT
+
+.IFDEF VIM_PERL
+perl_env :
+ -@ write sys$output "creating OS_VMS_PERL.OPT file."
+ -@ open/write opt_file OS_VMS_PERL.OPT
+ -@ write opt_file "PERLSHR /share"
+ -@ close opt_file
+.ELSE
+perl_env :
+ -@ !
+.ENDIF
+
+
+7.1.5 feature_INC = ,dka0:[tcl80.generic]
+
+ Defines the directory where the necessary include files are.
+ Example: TCL_INC = ,dka0:[tcl80.generic]
+
+7.2 GTK
+
+ To build VIM with GTK you have to install GTK on your OpenVMS.
+ So far it works just on Alphas. More information at:
+ http://www.openvms.compaq.com/openvms/products/ips/gtk.html
+
+ You need also the OpenVMS Porting Library:
+ http://www.openvms.compaq.com/openvms/products/ips/porting.html
+
+ Enable GTK in make_vms.mms file with GTK = YES
+ Define GTK_ROOT that points to your GTK root directory.
+
+ Build it as normally.
+
+ Used sharable images are:
+ gtk_root:[glib]libglib.exe /share,-
+ gtk_root:[glib.gmodule]libgmodule.exe /share,-
+ gtk_root:[gtk.gdk]libgdk.exe /share,-
+ gtk_root:[gtk.gtk]libgtk.exe /share
+
+ During runtime it is suggested to have all these files installed and
+ copyed to SYS$LIBRARY: to be able to use it without problems.
+ Also VMS_JACKETS.EXE from OpenVMS Porting Library.
+
+ Please note, that GTK uses /name=(as_is,short)/float=ieee/ieee=denorm
+ complier directives that is not compatible with "standard" VMS usage,
+ therefore other external features might fail as PERL, PYTHON and TCL
+ support.
+
+7.3 PERL
+
+ You have to install OpenVMS perl package from:
+ http://www.openvms.compaq.com/openvms/products/ips/apache/csws_perl_relnotes.html or build on your own from sources downloaded from http://www.perl.org
+
+ You need defined PERLSHR logical that points to PERL shareable image
+ (or you can just copy over to SYS$LIBRARY:)
+
+ Enable Perl feature at make_vms.mms with VIM_PERL = YES
+
+ Edit PERL_INC = to point to perl includes directory where is extern.h
+
+ Build as usually.
+
+7.4 PYTHON
+
+ You have to install an OpenVMS python package.
+ Set up the normal Python work environment.
+
+ You have to have defined PYTHON_INCLUDE and PYTHON_OLB logicals.
+ PYTHON_INCLUDE should point to Python include files where for ex:
+ python.h is located.
+ Enable Python feature at make_vms.mms with VIM_PYTHON = YES
+
+ Build as usually.
+
+7.5 TCL
+
+ You have to install an OpenVMS TCL package.
+ Set up the normal TCL work environment.
+
+ You have to have defined TCLSHR logical that points to shareable image.
+
+ Enable TCL feature at make_vms.mms with VIM_TCL = YES
+
+ Edit TCL_INC = to point to TCL includes directory where is tcl.h
+
+ Build as usually.
+
+8. Notes
+
+8.1. New Compaq C compiler
+
+ If you are using Compaq C compiler V6.2 or newer, Informational messages
+ of the type QUESTCOMPARE will be displayed. You should ignore those
+ messages ; they are generated only because some test comparisons are done
+ with variables which type vary depending on the OS. Under VMS, those are
+ "unsigned" and the compiler issue a message whenever the comparison is
+ done with '<=' to 0. However, the code is correct and will behave as
+ expected.
+ ( Jerome Lauret <JLAURET@mail.chem.sunysb.edu> Vim 6.0n )
+ NOTE: from version 6.0ad Vim code has been reviewed and these warnings
+ have been corrected.
+
+9. Authors
+
+ Initial version, 2000 Jul 19, Zoltan Arpadffy <arpadffy@polarfox.com>
diff --git a/src/Make_agui.mak b/src/Make_agui.mak
new file mode 100644
index 000000000..7b30a1976
--- /dev/null
+++ b/src/Make_agui.mak
@@ -0,0 +1,356 @@
+#
+# Makefile for VIM on the Amiga, using SAS/Lattice C 6.0 to 6.56
+#
+# Do NOT use the peephole optimizer with a version before 6.55!
+# It messes up all kinds of things:
+# For 6.0 and 6.1, expand_env() will not work correctly.
+# For 6.2 and 6.3 the call to free_line in u_freeentry is wrong.
+# Don't know about 6.50, might work...
+# Version 6.56 seems to be working fine.
+# You should use Manx Aztec C whenever possible.
+#
+# The prototypes from Manx and SAS are incompatible. If the prototypes
+# were generated by Manx, first do "touch *.c; make proto" before "make".
+# The prototypes generated on Unix work for both.
+#
+# Note: Not all dependencies are included. This was done to avoid having
+# to compile everything when a global variable or function is added.
+
+#>>>>> choose options:
+
+#ANSI CODES
+ANSIOFF = *e[0m
+BBOLD = *e[1m
+WBOLD = *e[2m
+ITALIC = *e[3m
+UNDERLI = *e[4m
+ANSIOFF = *e[0m
+FCOL1 = *e[31m
+FCOL2 = *e[32m
+FCOL3 = *e[33m
+FCOL4 = *e[34m
+BCOL1 = *e[41m
+BCOL2 = *e[42m
+BCOL3 = *e[43m
+BCOL4 = *e[44m
+
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+
+DEFINES = DEF=NO_ARP DEF=AMIGA DEF=NEWSASC DEF=FEAT_GUI_AMIGA \
+ DEF="SASC=658" #" this fixes a bug in the syntax highlighting
+
+#>>>>> if HAVE_TGETENT is defined termlib.o has to be used
+#TERMLIB = termlib.o
+TERMLIB =
+
+#>>>>> choose NODEBUG for normal compiling, the other for debugging and
+# profiling
+# don't switch on debugging when generating proto files, it crashes the
+# compiler.
+DBG = NODEBUG
+#DBG = DBG=FULLFLUSH
+#DBG = DBG=LINE
+
+#>>>>> choose NOOPTPEEP for 6.0 to 6.3, NOOPT for debugging
+#OPTIMIZE=NOOPTPEEP OPT
+
+# for 6.58 you can use the line below, but be warned it takes a loooonnnggg time
+#OPTIMIZE=OPT OPTIMIZERSCHEDULER OPTIMIZERTIME NoOPTIMIZERALIAS \
+# OptimizerComplexity=10 OptimizerDepth=10 OptimizerRecurDepth=10 \
+# OptimizerInLocal OPTPEEP
+OPTIMIZE=OPT OPTIMIZERTIME NoOPTIMIZERALIAS \
+ OptimizerComplexity=10 OptimizerDepth=10 OptimizerRecurDepth=10 \
+ OptimizerInLocal OPTPEEP
+#OPTIMIZE = NOOPT
+
+# no optimization, (works on all platforms)
+#OPTIMIZE=NOOPT
+
+#generate code for your processor - note however, that the 060 selection will work for 040's
+# as well.
+#CPU=68000
+#CPU=68020
+#CPU=68030
+#CPU=68040
+CPU=68060
+
+
+#Error reporting - I use rexx for reporting, but console reporting may be more
+#useful for some people.
+#ERROR = ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
+ERROR = ERRORREXX ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
+
+
+#memory types, if you have fast use it :->,
+# ANY = will work on all machines
+# FAST = this is the best option, for speed
+# CHIP = not necessary for this application.
+#MEMORYTYPE=FAST
+MEMORYTYPE=ANY
+
+#MEMSIZE - this is for compile time only for speed of compilation
+#default is LARGE
+MEMSIZE=HUGE
+#MEMSIZE=LARGE
+#MEMSIZE=SMALL
+
+#>>>>> end of choices
+###########################################################################
+
+CC = sc
+
+GST=vim.gst
+DEP = $(GST)
+
+
+CFLAGS = NOLINK $(DBG) CPU=$(CPU) NOSTACKCHECK
+CFLAGS2 = $(OPTIMIZE) $(ERROR) GSTIMMEDIATE GST=$(GST)
+CFLAGS3 =NOSINT SCODE SDATA STRINGMERGE MEMSIZE=$(MEMSIZE)
+CFLAGS4 = $(DEFINES) DATAMEMORY=$(MEMORYTYPE)
+
+PROPT = DEF=PROTO GPROTO GPPARM MAXIMUMERRORS=999 GENPROTOSTATICS GENPROTOPARAMETERS
+
+SRC = \
+ buffer.c \
+ charset.c \
+ diff.c \
+ digraph.c \
+ edit.c \
+ eval.c \
+ ex_cmds.c \
+ ex_cmds2.c \
+ ex_docmd.c \
+ ex_eval.c \
+ ex_getln.c \
+ fileio.c \
+ fold.c \
+ getchar.c \
+ main.c \
+ mark.c \
+ memfile.c \
+ memline.c \
+ menu.c \
+ message.c \
+ misc1.c \
+ misc2.c \
+ move.c \
+ normal.c \
+ ops.c \
+ option.c \
+ os_amiga.c \
+ quickfix.c \
+ regexp.c \
+ screen.c \
+ search.c \
+ syntax.c \
+ tag.c \
+ term.c \
+ ui.c \
+ undo.c \
+ window.c \
+ version.c \
+ gui_amiga.c \
+ gui.c
+
+OBJ = buffer.o charset.o diff.o digraph.o edit.o eval.o ex_cmds.o ex_cmds2.o ex_docmd.o ex_eval.o ex_getln.o \
+ fileio.o fold.o getchar.o main.o mark.o memfile.o memline.o menu.o message.o misc1.o misc2.o move.o \
+ normal.o ops.o option.o os_amiga.o quickfix.o regexp.o screen.o search.o syntax.o \
+ tag.o term.o ui.o undo.o window.o gui_amiga.o gui.o $(TERMLIB)
+
+PRO = \
+ buffer.pro \
+ charset.pro \
+ diff.pro \
+ digraph.pro \
+ edit.pro \
+ eval.pro \
+ ex_cmds.pro \
+ ex_cmds2.pro \
+ ex_docmd.pro \
+ ex_eval.pro \
+ ex_getln.pro \
+ fileio.pro \
+ fold.pro \
+ getchar.pro \
+ main.pro \
+ mark.pro \
+ memfile.pro \
+ memline.pro \
+ menu.pro \
+ message.pro \
+ misc1.pro \
+ misc2.pro \
+ move.pro \
+ normal.pro \
+ ops.pro \
+ option.pro \
+ os_amiga.pro \
+ quickfix.pro \
+ regexp.pro \
+ screen.pro \
+ search.pro \
+ syntax.pro \
+ tag.pro \
+ term.pro \
+ termlib.pro \
+ ui.pro \
+ undo.pro \
+ window.pro \
+ version.pro \
+ gui_amiga.pro \
+ gui.pro
+
+all:
+ @echo "$(BCOL2)building prototypes, this may take some time$(ANSIOFF)"
+ @smake proto
+ @echo "$(BCOL2)building vim production version$(ANSIOFF)"
+ @smake vim
+
+Vim: scoptions proto $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c
+ $(CC) LINK $(OPT) $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
+
+debug: scoption protos $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c
+ $(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
+
+proto: $(PRO)
+
+tags: $(SRC)
+ spat ctags $(SRC) *.h
+ #csh -c ctags $(SRC) *.h
+
+# can't use delete here, too many file names
+clean:
+ @echo removing all object files
+ -delete $(OBJ) >nil:
+
+clobber: clean
+ @echo removing all prototype files
+ -delete $(PRO) SCOPTIONS vim $(GST) > NIL:
+
+
+# generate an options file, as there is no way the amiga command line can handle the
+# lengths that this makefile will impose on the shell.
+scoptions: smakefile
+ @echo "$(BCOL2)Generating $(ANSIOFF)$(FCOL4)- $@$(ANSIOFF)"
+ @echo $(CFLAGS) > scoptions
+ @echo $(CFLAGS1) >> scoptions
+ @echo $(CFLAGS2) >> scoptions
+ @echo $(CFLAGS3) >> scoptions
+ @echo $(CFLAGS4) >> scoptions
+ @echo $(COPTS) >>scoptions
+ @echo scoptions has been built
+
+
+#generate GlobalSymbolTable, which both speeds up the compile time, but also
+#solves some problems with prototypes, and types that are defined in a unixy
+#manner.
+#
+#I use a preprocessing stage here to work arounda bug in the GST generator, in
+#that it does not handle nested makefiles properly in this stage.
+$(GST): scoptions vim.h keymap.h macros.h ascii.h term.h structs.h gui.h gui_amiga.h
+ @echo "$(BCOL2)Generating Global Symbol Table $(ANSIOFF)$(FCOL4) $(GST) $(ANSIOFF)"
+ $(CC) PREPROCESSORONLY gui_amiga.h objectname pre.h
+ $(CC) MGST=$(GST) pre.h ignore=105,316
+ del pre.h
+
+
+###########################################################################
+
+.c.o:
+ @echo "$(BCOL2)Generating object for $(ANSIOFF)$(FCOL4) $*.c -> $@$(ANSIOFF)"
+ $(CC) $*.c
+
+.c.pro:
+ @echo "$(BCOL2)Generating prototypes for $(ANSIOFF)$(FCOL4) $*.c -> $@$(ANSIOFF)"
+ @$(CC) NOERRORREXX GPFILE=$*.pro $(PROPT) $*.c ignore=306,316,317,304
+
+$(PRO): $(GST)
+$(OBJ): $(GST)
+
+# dependancies
+buffer.o: buffer.c $(DEP)
+buffer.pro: buffer.c $(DEP)
+charset.o: charset.c $(DEP)
+charset.pro: charset.c $(DEP)
+diff.o: diff.c $(DEP)
+diff.pro: diff.c $(DEP)
+digraph.o: digraph.c $(DEP)
+digraph.pro: digraph.c $(DEP)
+edit.o: edit.c $(DEP)
+edit.pro: edit.c $(DEP)
+eval.o: eval.c $(DEP)
+eval.pro: eval.c $(DEP)
+ex_cmds.o: ex_cmds.c $(DEP)
+ex_cmds.pro: ex_cmds.c $(DEP)
+ex_cmds2.o: ex_cmds2.c $(DEP)
+ex_cmds2.pro: ex_cmds2.c $(DEP)
+ex_docmd.o: ex_docmd.c ex_cmds.h $(DEP)
+ex_docmd.pro: ex_docmd.c ex_cmds.h $(DEP)
+ex_eval.o: ex_eval.c ex_cmds.h $(DEP)
+ex_eval.pro: ex_eval.c ex_cmds.h $(DEP)
+ex_getln.o: ex_getln.c $(DEP)
+ex_getln.pro: ex_getln.c $(DEP)
+fileio.o: fileio.c $(DEP)
+fileio.pro: fileio.c $(DEP)
+fold.o: fold.c $(DEP)
+fold.pro: fold.c $(DEP)
+getchar.o: getchar.c $(DEP)
+getchar.pro: getchar.c $(DEP)
+main.o: main.c globals.h $(DEP)
+main.pro: main.c globals.h $(DEP)
+mark.o: mark.c $(DEP)
+mark.pro: mark.c $(DEP)
+memfile.o: memfile.c $(DEP)
+memfile.pro: memfile.c $(DEP)
+memline.o: memline.c $(DEP)
+memline.pro: memline.c $(DEP)
+menu.o: menu.c $(DEP)
+menu.pro: menu.c $(DEP)
+message.o: message.c $(DEP)
+message.pro: message.c $(DEP)
+misc1.o: misc1.c $(DEP)
+misc1.pro: misc1.c $(DEP)
+misc2.o: misc2.c $(DEP)
+misc2.pro: misc2.c $(DEP)
+move.o: move.c $(DEP)
+move.pro: move.c $(DEP)
+normal.o: normal.c $(DEP)
+normal.pro: normal.c $(DEP)
+ops.o: ops.c $(DEP)
+ops.pro: ops.c $(DEP)
+option.o: option.c $(DEP)
+option.pro: option.c $(DEP)
+os_amiga.o: os_amiga.c $(DEP)
+os_amiga.pro: os_amiga.c $(DEP)
+quickfix.o: quickfix.c $(DEP)
+quickfix.pro: quickfix.c $(DEP)
+regexp.o: regexp.c $(DEP)
+regexp.pro: regexp.c $(DEP)
+screen.o: screen.c $(DEP)
+screen.pro: screen.c $(DEP)
+search.o: search.c $(DEP)
+search.pro: search.c $(DEP)
+syntax.o: syntax.c $(DEP)
+syntax.pro: syntax.c $(DEP)
+tag.o: tag.c $(DEP)
+tag.pro: tag.c $(DEP)
+term.o: term.c $(DEP)
+term.pro: term.c $(DEP)
+termlib.o: termlib.c $(DEP)
+termlib.pro: termlib.c $(DEP)
+ui.o: ui.c $(DEP)
+ui.pro: ui.c $(DEP)
+undo.o: undo.c $(DEP)
+undo.pro: undo.c $(DEP)
+window.o: window.c $(DEP)
+window.pro: window.c $(DEP)
+gui_amiga.o: gui_amiga.c $(DEP) amiga.h
+#gui_amiga.pro: gui_amiga.c $(DEP) amiga.h
+amiga.o: amiga.c $(DEP) amiga.h
+amiga.pro: amiga.c $(DEP) amiga.h
+gui.o: gui.c $(DEP)
+gui.pro: gui.c $(DEP)
diff --git a/src/Make_aros.mak b/src/Make_aros.mak
new file mode 100644
index 000000000..5d26eef0e
--- /dev/null
+++ b/src/Make_aros.mak
@@ -0,0 +1,29 @@
+# Makefile for AROS
+
+CFLAGS = -pipe -O2 -Wall -Iproto \
+ -DNO_ARP -DUSE_TMPNAM -DFEAT_GUI_AMIGA
+
+PRG = VIM
+LIBS =
+CC = i386-linux-aros-gcc
+LD = i386-linux-aros-gcc
+RM = rm
+
+SRCS = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c \
+ ex_cmds2.c ex_docmd.c ex_eval.c ex_getln.c fileio.c fold.c getchar.c \
+ main.c mark.c mbyte.c memfile.c memline.c menu.c message.c misc1.c \
+ misc2.c move.c normal.c ops.c option.c os_amiga.c quickfix.c \
+ regexp.c screen.c search.c syntax.c tag.c term.c ui.c undo.c \
+ version.c window.c gui_amiga.c gui.c
+
+OBJS = $(SRCS:.c=.o)
+
+
+$(PRG): $(OBJS)
+ ${LD} -o $(PRG) $(OBJS) $(LIBS)
+
+.c.o:
+ ${CC} -c ${CFLAGS} $< -o $@
+
+clean:
+ $(RM) -fv $(OBJS) $(PRG)
diff --git a/src/Make_bc3.mak b/src/Make_bc3.mak
new file mode 100644
index 000000000..1d27081a1
--- /dev/null
+++ b/src/Make_bc3.mak
@@ -0,0 +1,173 @@
+# Makefile for Borland C++ 3.1 or 4.0 to compile a 16 bit version of Vim.
+#
+# There are compilation options at the end of this file.
+#
+# Command line variables:
+# BOR path to root of Borland C (E:\BORLANDC)
+# DEBUG set to "yes" for debugging (no)
+# SPAWNO path to the spawno library directory, empty if you do not have
+# it; use 8.3 filenames! (C:\CC\SPAWN)
+
+.AUTODEPEND
+
+!ifndef BOR
+BOR = E:\BORLANDC
+!endif
+
+!if ("$(DEBUG)" == "yes")
+DEBUG_FLAG = -v
+!else
+DEBUG_FLAG =
+!endif
+
+CC = $(BOR)\bin\bcc.exe +VIM.CFG
+TLINK = $(BOR)\bin\tlink.exe
+
+!ifndef SPAWNO
+SPAWNO = C:\CC\SPAWN
+!endif
+
+!if ("$(SPAWNO)" == "")
+LIBPATH = $(BOR)\LIB
+INCLUDEPATH = $(BOR)\INCLUDE
+SPAWND =
+SPAWNL =
+!else
+LIBPATH = $(BOR)\LIB;$(SPAWNO)
+INCLUDEPATH = $(BOR)\INCLUDE;$(SPAWNO)
+SPAWND = ;SPAWNO
+SPAWNL = spawnl.lib
+!endif
+
+
+# *Implicit Rules*
+#
+# use -v for debugging
+#
+.c.obj:
+ $(CC) -c $(DEBUG_FLAG) {$< }
+
+# *List Macros*
+
+
+EXE_dependencies = \
+ buffer.obj \
+ charset.obj \
+ diff.obj \
+ digraph.obj \
+ edit.obj \
+ eval.obj \
+ ex_cmds.obj \
+ ex_cmds2.obj \
+ ex_docmd.obj \
+ ex_eval.obj \
+ ex_getln.obj \
+ fileio.obj \
+ fold.obj \
+ getchar.obj \
+ main.obj \
+ mark.obj \
+ memfile.obj \
+ memline.obj \
+ menu.obj \
+ message.obj \
+ misc1.obj \
+ misc2.obj \
+ move.obj \
+ os_msdos.obj \
+ normal.obj \
+ ops.obj \
+ option.obj \
+ quickfix.obj \
+ regexp.obj \
+ screen.obj \
+ search.obj \
+ syntax.obj \
+ tag.obj \
+ term.obj \
+ ui.obj \
+ undo.obj \
+ window.obj
+
+all: vim.exe install.exe uninstal.exe xxd/xxd.exe
+
+# *Explicit Rules*
+
+vim.exe: vim.cfg $(EXE_dependencies) version.c
+ $(CC) $(DEBUG_FLAG) -c version.c
+ $(TLINK) /x/c/L$(LIBPATH) $(DEBUG_FLAG) @&&|
+c0l.obj $(EXE_dependencies) version.obj
+vim
+ # no map file
+$(SPAWNL) cl.lib
+|
+
+install.exe: dosinst.c
+ $(CC) -einstall $(DEBUG_FLAG) dosinst.c
+
+uninstal.exe: uninstal.c
+ $(CC) $(DEBUG_FLAG) uninstal.c
+
+# This may fail for older make versions, building xxd will fail anyway then.
+xxd/xxd.exe: xxd/xxd.c
+ cd xxd
+ $(MAKE) -f Make_bc3.mak BOR=$(BOR) DEBUG=$(DEBUG)
+ cd ..
+
+# cleaning up: Delete all generated files
+clean:
+ -del *.obj
+ -del vim.exe
+ -del vim.sym
+ -del install.exe
+ -del uninstal.exe
+ -del xxd\*.obj
+ -del xxd\xxd.exe
+ -del vim.cfg
+ -del testdir\*.out
+
+# Individual File Dependencies (incomplete)
+ex_docmd.obj: ex_docmd.c ex_cmds.h
+
+ex_eval.obj: ex_eval.c ex_cmds.h
+
+main.obj: main.c globals.h option.h
+
+term.obj: term.c term.h
+
+version.obj: version.c version.h
+
+
+# Compiler Configuration File
+#
+# The following compile options can be changed for better machines.
+# replace -1- with -2 to produce code for a 80286 or higher
+# replace -1- with -3 to produce code for a 80386 or higher
+# add -v for source debugging
+vim.cfg: Make_bc3.mak
+ copy &&|
+-ml
+-1-
+-f-
+-C
+-N
+-O
+-Z
+-k-
+-d
+-h
+-vi-
+-H=VIM.SYM
+-w-par
+-weas
+-wpre
+-Iproto
+-I$(INCLUDEPATH)
+-L$(LIBPATH)
+-DMSDOS$(SPAWND)
+| vim.cfg
+
+test:
+ cd testdir
+ $(MAKE) -f Make_dos.mak small
+ cd ..
diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak
new file mode 100644
index 000000000..73d9440d8
--- /dev/null
+++ b/src/Make_bc5.mak
@@ -0,0 +1,1006 @@
+#
+# Makefile for Vim.
+# Compiler: Borland C++ 5.0 and later 32-bit compiler
+# Targets: Dos16 or Win32 (Windows NT and Windows 95) (with/without GUI)
+#
+# Contributed by Ben Singer.
+# Updated 4/1997 by Ron Aaron
+# 6/1997 - added support for 16 bit DOS
+# Note: this has been tested, and works, for BC5. Your mileage may vary.
+# Has been reported NOT to work with BC 4.52. Maybe it can be fixed?
+# 10/1997 - ron - fixed bugs w/ BC 5.02
+# 8/1998 - ron - updated with new targets, fixed some stuff
+# 3/2000 - Bram: Made it work with BC 5.5 free command line compiler,
+# cleaned up variables.
+# 6/2001 - Dan - Added support for compiling Python and TCL
+# 7/2001 - Dan - Added support for compiling Ruby
+#
+# It builds on Windows 95 and NT-Intel, producing the same binary in either
+# case. To build using Microsoft Visual C++, use Make_mvc.mak.
+#
+# This should work with the free Borland command line compiler, version 5.5.
+# You need at least sp1 (service pack 1). With sp2 it compiles faster.
+# Use a command like this:
+# <path>\bin\make /f Make_bc5.mak BOR=<path>
+#
+
+# let the make utility do the hard work:
+.AUTODEPEND
+.CACHEAUTODEPEND
+
+# VARIABLES:
+# name value (default)
+#
+# BOR path to root of Borland C install (c:\bc5)
+# LINK name of the linker ($(BOR)\bin\ilink if OSTYPE is DOS16,
+# $(BOR)\bin\ilink32 otherwise)
+# GUI no or yes: set to yes if you want the GUI version (yes)
+# PERL define to path to Perl dir to get Perl support (not defined)
+# PERL_VER define to version of Perl being used (56)
+# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (no)
+# PYTHON define to path to Python dir to get PYTHON support (not defined)
+# PYTHON_VER define to version of Python being used (22)
+# DYNAMIC_PYTHON no or yes: use yes to load the Python DLL dynamically (no)
+# TCL define to path to TCL dir to get TCL support (not defined)
+# TCL_VER define to version of TCL being used (83)
+# DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (no)
+# RUBY define to path to Ruby dir to get Ruby support (not defined)
+# NOTE: You may have to remove the defines for uid_t and gid_t
+# from the Ruby config.h header file.
+# RUBY_VER define to version of Ruby being used (16)
+# NOTE: compilation on WinNT/2K/XP requires
+# at least version 1.6.5 of Ruby. Earlier versions
+# of Ruby will cause a compile error on these systems.
+# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no)
+# MBYTE no or yes: set to yes for multi-byte support (yes)
+# IME no or yes: set to yes for multi-byte IME support (yes)
+# DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
+# GETTEXT no or yes: set to yes for multi-language support (yes)
+# ICONV no or yes: set to yes for dynamic iconv support (yes)
+# OLE no or yes: set to yes to make OLE gvim (no)
+# OSTYPE DOS16 or WIN32 (WIN32)
+# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
+# CODEGUARD no or yes: set to yes if you want to use CODEGUARD (no)
+# CPUNR 1 through 6: select -CPU argument to compile with (3)
+# 3 for 386, 4 for 486, 5 for pentium, 6 for pentium pro.
+# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
+# For USEDLL=yes the cc3250.dll is required to run Vim.
+# VIMDLL no or yes: create vim32.dll, and stub (g)vim.exe (no)
+# ALIGN 1, 2 or 4: Alignment to use (4 for Win32, 2 for DOS16)
+# FASTCALL no or yes: set to yes to use register-based function protocol (yes)
+# OPTIMIZE SPACE, SPEED, or MAXSPEED: type of optimization (MAXSPEED)
+# POSTSCRIPT no or yes: set to yes for PostScript printing
+# FEATURES TINY, SMALL, NORMAL, BIG or HUGE
+# (BIG for WIN32, SMALL for DOS16)
+# WINVER 0x0400 or 0x0500: minimum Win32 version to support (0x0400)
+# CSCOPE no or yes: include support for Cscope interface (yes)
+# NETBEANS no or yes: include support for Netbeans interface (yes if GUI
+# is yes)
+# XPM define to path to XPM dir to get support for loading XPM images.
+
+### BOR: root of the BC installation
+!if ("$(BOR)"=="")
+BOR = c:\bc5
+!endif
+
+### LINK: Name of the linker: tlink or ilink32 (this is below, depends on
+# $(OSTYPE)
+
+### GUI: yes for GUI version, no for console version
+!if ("$(GUI)"=="")
+GUI = yes
+!endif
+
+### MBYTE: yes for multibyte support, no to disable it.
+!if ("$(MBYTE)"=="")
+MBYTE = yes
+!endif
+
+### IME: yes for multibyte support, no to disable it.
+!if ("$(IME)"=="")
+IME = yes
+!endif
+!if ("$(DYNAMIC_IME)"=="")
+DYNAMIC_IME = yes
+!endif
+
+### GETTEXT: yes for multilanguage support, no to disable it.
+!if ("$(GETTEXT)"=="")
+GETTEXT = yes
+!endif
+
+### ICONV: yes to enable dynamic-iconv support, no to disable it
+!if ("$(ICONV)"=="")
+ICONV = yes
+!endif
+
+### CSCOPE: yes to enable Cscope support, no to disable it
+!if ("$(CSCOPE)"=="")
+CSCOPE = yes
+!endif
+
+### NETBEANS: yes to enable NetBeans interface support, no to disable it
+!if ("$(NETBEANS)"=="") && ("$(GUI)"=="yes")
+NETBEANS = yes
+!endif
+
+### PERL: uncomment this line if you want perl support in vim
+# PERL=c:\perl
+
+### PYTHON: uncomment this line if you want python support in vim
+# PYTHON=c:\python22
+
+### RUBY: uncomment this line if you want ruby support in vim
+# RUBY=c:\ruby
+
+### TCL: uncomment this line if you want tcl support in vim
+# TCL=c:\tcl
+
+### OLE: no for normal gvim, yes for OLE-capable gvim (only works with GUI)
+#OLE = yes
+
+### OSTYPE: DOS16 for Windows 3.1 version, WIN32 for Windows 95/98/NT/2000
+# version
+!if ("$(OSTYPE)"=="")
+OSTYPE = WIN32
+!endif
+
+### DEBUG: Uncomment to make an executable for debugging
+# DEBUG = yes
+!if ("$(DEBUG)"=="yes")
+DEBUG_FLAG = -v
+!endif
+
+### CODEGUARD: Uncomment to use the CODEGUARD stuff (BC 5.0 or later):
+# CODEGUARD = yes
+!if ("$(CODEGUARD)"=="yes")
+CODEGUARD_FLAG = -vG
+!endif
+
+### CPUNR: set your target processor (3 to 6)
+!if ("$(CPUNR)" == "i386") || ("$(CPUNR)" == "3")
+CPUNR = 3
+!elif ("$(CPUNR)" == "i486") || ("$(CPUNR)" == "4")
+CPUNR = 4
+!elif ("$(CPUNR)" == "i586") || ("$(CPUNR)" == "5")
+CPUNR = 5
+!elif ("$(CPUNR)" == "i686") || ("$(CPUNR)" == "6")
+CPUNR = 6
+!else
+CPUNR = 3
+!endif
+
+### Comment out to use precompiled headers (faster, but uses lots of disk!)
+HEADERS = -H -H=vim.csm -Hc
+
+### USEDLL: no for statically linked version of run-time, yes for DLL runtime
+!if ("$(USEDLL)"=="")
+USEDLL = no
+!endif
+
+### VIMDLL: yes for a DLL version of VIM (NOT RECOMMENDED), no otherwise
+#VIMDLL = yes
+
+### ALIGN: alignment you desire: (1,2 or 4: s/b 4 for Win32, 2 for DOS)
+!if ("$(ALIGN)"=="")
+!if ($(OSTYPE)==DOS16)
+ALIGN = 2
+!else
+ALIGN = 4
+!endif
+!endif
+
+### FASTCALL: yes to use FASTCALL calling convention (RECOMMENDED!), no otherwise
+# Incompatible when calling external functions (like MSVC-compiled DLLs), so
+# don't use FASTCALL when linking with external libs.
+!if ("$(FASTCALL)"=="") && \
+ ("$(PYTHON)"=="") && \
+ ("$(PERL)"=="") && \
+ ("$(TCL)"=="") && \
+ ("$(RUBY)"=="") && \
+ ("$(ICONV)"!="yes") && \
+ ("$(IME)"!="yes") && \
+ ("$(MBYTE)"!="yes") && \
+ ("$(XPM)"=="")
+FASTCALL = yes
+!endif
+
+### OPTIMIZE: SPEED to optimize for speed, SPACE otherwise (SPEED RECOMMENDED)
+!if ("$(OPTIMIZE)"=="")
+OPTIMIZE = MAXSPEED
+!endif
+
+### FEATURES: TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32, SMALL for DOS16)
+!if ("$(FEATURES)"=="")
+! if ($(OSTYPE)==DOS16)
+FEATURES = SMALL
+! else
+FEATURES = BIG
+! endif
+!endif
+
+### POSTSCRIPT: uncomment this line if you want PostScript printing
+#POSTSCRIPT = yes
+
+###
+# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
+# default, use these lines.
+#VIMRCLOC = somewhere
+#VIMRUNTIMEDIR = somewhere
+
+### Set the default $(WINVER) to make it work with Bcc 5.5.
+!ifndef WINVER
+WINVER = 0x0400
+!endif
+
+#
+# Sanity checks for the above options:
+#
+
+!if ($(OSTYPE)==DOS16)
+!if (($(CPUNR)+0)>4)
+!error CPUNR Must be less than or equal to 4 for DOS16
+!endif
+
+!if (($(ALIGN)+0)>2)
+!error ALIGN Must be less than or equal to 2 for DOS16
+!endif
+
+!else # not DOS16
+!if (($(CPUNR)+0)<3)
+!error CPUNR Must be greater or equal to 3 for WIN32
+!endif
+!endif
+
+!if ($(OSTYPE)!=WIN32) && ($(OSTYPE)!=DOS16)
+!error Check the OSTYPE variable again: $(OSTYPE) is not supported!
+!endif
+
+#
+# Optimizations: change as desired (RECOMMENDATION: Don't change!):
+#
+!if ("$(DEBUG)"=="yes")
+OPT = -Od -N
+!else
+!if ("$(OPTIMIZE)"=="SPACE")
+OPT = -O1 -f- -d
+!elif ("$(OPTIMIZE)"=="MAXSPEED")
+OPT = -O2 -f- -d -Ocavi -O
+!else
+OPT = -O2 -f- -d -Oc -O
+!endif
+!if ("$(FASTCALL)"=="yes")
+OPT = $(OPT) -pr
+!endif
+!if ("$(CODEGUARD)"!="yes")
+OPT = $(OPT) -vi-
+!endif
+!endif
+!if ($(OSTYPE)==DOS16)
+!undef GUI
+!undef VIMDLL
+!undef USEDLL
+!endif
+# shouldn't have to change:
+LIB = $(BOR)\lib
+INCLUDE = $(BOR)\include;.;proto
+DEFINES = -DFEAT_$(FEATURES) -DWIN32 -DHAVE_PATHDEF \
+ -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
+
+!ifdef PERL
+INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PERL
+INCLUDE = $(PERL)\lib\core;$(INCLUDE)
+! ifndef PERL_VER
+PERL_VER = 56
+! endif
+! if ("$(DYNAMIC_PERL)" == "yes")
+! if ($(PERL_VER) > 55)
+INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
+PERL_LIB_FLAG = /nodefaultlib:
+! else
+! message "Cannot dynamically load Perl versions less than 5.6. Loading statically..."
+! endif
+! endif
+!endif
+
+!ifdef PYTHON
+INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PYTHON
+INCLUDE = $(PYTHON)\include;$(INCLUDE)
+!ifndef PYTHON_VER
+PYTHON_VER = 22
+!endif
+!if "$(DYNAMIC_PYTHON)" == "yes"
+INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
+PYTHON_LIB_FLAG = /nodefaultlib:
+!endif
+!endif
+
+!ifdef RUBY
+!ifndef RUBY_VER
+RUBY_VER = 16
+!endif
+!ifndef RUBY_VER_LONG
+RUBY_VER_LONG = 1.6
+!endif
+
+!if "$(RUBY_VER)" == "16"
+!ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i586-mswin32
+!endif
+!ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
+!endif
+!else
+!ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i386-mswin32
+!endif
+!ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
+!endif
+!endif
+
+INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_RUBY
+INCLUDE = $(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM);$(INCLUDE)
+
+!if "$(DYNAMIC_RUBY)" == "yes"
+INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
+INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+RUBY_LIB_FLAG = /nodefaultlib:
+!endif
+!endif
+
+!ifdef TCL
+INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_TCL
+INCLUDE = $(TCL)\include;$(INCLUDE)
+!ifndef TCL_VER
+TCL_VER = 83
+!endif
+TCL_LIB = $(TCL)\lib\tcl$(TCL_VER).lib
+TCL_LIB_FLAG =
+!if "$(DYNAMIC_TCL)" == "yes"
+INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
+TCL_LIB = tclstub$(TCL_VER)-bor.lib
+TCL_LIB_FLAG =
+!endif
+!endif
+#
+# DO NOT change below:
+#
+CPUARG = -$(CPUNR)
+ALIGNARG = -a$(ALIGN)
+#
+!if ("$(DEBUG)"=="yes")
+DEFINES=$(DEFINES) -DDEBUG
+!endif
+#
+!if ("$(OLE)"=="yes")
+DEFINES = $(DEFINES) -DFEAT_OLE
+!endif
+#
+!if ("$(MBYTE)"=="yes")
+MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE
+!endif
+!if ("$(IME)"=="yes")
+MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE_IME
+!if ("$(DYNAMIC_IME)" == "yes")
+MBDEFINES = $(MBDEFINES) -DDYNAMIC_IME
+!endif
+!endif
+!if ("$(ICONV)"=="yes")
+MBDEFINES = $(MBDEFINES) -DDYNAMIC_ICONV
+!endif
+!if ("$(GETTEXT)"=="yes")
+MBDEFINES = $(MBDEFINES) -DDYNAMIC_GETTEXT
+!endif
+
+!if ("$(CSCOPE)"=="yes")
+DEFINES = $(DEFINES) -DFEAT_CSCOPE
+!endif
+
+!if ("$(NETBEANS)"=="yes")
+DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG
+!if ("$(DEBUG)"=="yes")
+DEFINES = $(DEFINES) -DNBDEBUG
+NBDEBUG_DEP = nbdebug.h nbdebug.c
+!endif
+!endif
+
+!ifdef XPM
+DEFINES = $(DEFINES) -DFEAT_XPM_W32
+INCLUDE = $(XPM)\include;$(INCLUDE)
+!endif
+
+!if ("$(GUI)"=="yes")
+DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+!if ("$(DEBUG)"=="yes")
+TARGET = gvimd.exe
+!else
+TARGET = gvim.exe
+!endif
+!if ("$(VIMDLL)"=="yes")
+EXETYPE=-WD
+DEFINES = $(DEFINES) -DVIMDLL
+!else
+EXETYPE=-W
+!endif
+STARTUPOBJ = c0w32.obj
+LINK2 = -aa
+RESFILE = vim.res
+!else
+!if ("$(DEBUG)"=="yes")
+TARGET = vimd.exe
+!else
+# for now, anyway: VIMDLL is only for the GUI version
+!undef VIMDLL
+TARGET = vim.exe
+!endif
+!if ($(OSTYPE)==DOS16)
+DEFINES= -DFEAT_$(FEATURES) -DMSDOS
+EXETYPE=-ml
+STARTUPOBJ = c0l.obj
+LINK2 =
+!else
+EXETYPE=-WC
+STARTUPOBJ = c0x32.obj
+LINK2 = -ap -OS -o -P
+!endif
+RESFILE = vim.res
+!endif
+
+!if ("$(USEDLL)"=="yes")
+DEFINES = $(DEFINES) -D_RTLDLL
+!endif
+
+!if ("$(DEBUG)"=="yes")
+OBJDIR = $(OSTYPE)\objdbg
+!else
+!if ("$(GUI)"=="yes")
+!if ("$(OLE)"=="yes")
+OBJDIR = $(OSTYPE)\oleobj
+!else
+OBJDIR = $(OSTYPE)\gobj
+!endif
+!else
+OBJDIR = $(OSTYPE)\obj
+!endif
+!endif
+
+!if ("$(POSTSCRIPT)"=="yes")
+DEFINES = $(DEFINES) -DMSWINPS
+!endif
+
+##### BASE COMPILER/TOOLS RULES #####
+MAKE = $(BOR)\bin\make
+CFLAGS = -w-aus -w-par -w-pch -w-ngu -w-csu -I$(INCLUDE)
+!if ($(OSTYPE)==DOS16)
+BRC =
+!if ("$(LINK)"=="")
+LINK = $(BOR)\BIN\TLink
+!endif
+CC = $(BOR)\BIN\Bcc
+LFLAGS = -Tde -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
+LFLAGSDLL =
+CFLAGS = $(CFLAGS) -H- $(HEADERS)
+!else
+BRC = $(BOR)\BIN\brc32
+!if ("$(LINK)"=="")
+LINK = $(BOR)\BIN\ILink32
+!endif
+CC = $(BOR)\BIN\Bcc32
+LFLAGS = -OS -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
+LFLAGSDLL = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
+CFLAGS = $(CFLAGS) -d -RT- -k- -Oi $(HEADERS) -f-
+!endif
+
+CC1 = -c
+CC2 = -o
+CCARG = +$(OBJDIR)\bcc.cfg
+
+# implicit rules:
+
+# Without the following, the implicit rule in BUILTINS.MAK is picked up
+# for a rule for .c.obj rather than the local implicit rule
+.SUFFIXES
+.SUFFIXES .c .obj
+.path.c = .
+
+{.}.c{$(OBJDIR)}.obj:
+ $(CC) $(CCARG) $(CC1) -n$(OBJDIR)\ {$< }
+
+.cpp.obj:
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ $*.cpp
+
+!if ($(OSTYPE)==DOS16)
+!else # win32:
+vimmain = \
+ $(OBJDIR)\os_w32exe.obj
+!if ("$(VIMDLL)"=="yes")
+vimwinmain = \
+ $(OBJDIR)\os_w32dll.obj
+!else
+vimwinmain = \
+ $(OBJDIR)\os_w32exe.obj
+!endif
+!endif
+
+vimobj = \
+ $(OBJDIR)\buffer.obj \
+ $(OBJDIR)\charset.obj \
+ $(OBJDIR)\diff.obj \
+ $(OBJDIR)\digraph.obj \
+ $(OBJDIR)\edit.obj \
+ $(OBJDIR)\eval.obj \
+ $(OBJDIR)\ex_cmds.obj \
+ $(OBJDIR)\ex_cmds2.obj \
+ $(OBJDIR)\ex_docmd.obj \
+ $(OBJDIR)\ex_eval.obj \
+ $(OBJDIR)\ex_getln.obj \
+ $(OBJDIR)\fileio.obj \
+ $(OBJDIR)\fold.obj \
+ $(OBJDIR)\getchar.obj \
+ $(OBJDIR)\main.obj \
+ $(OBJDIR)\mark.obj \
+ $(OBJDIR)\memfile.obj \
+ $(OBJDIR)\memline.obj \
+ $(OBJDIR)\menu.obj \
+ $(OBJDIR)\message.obj \
+ $(OBJDIR)\misc1.obj \
+ $(OBJDIR)\misc2.obj \
+ $(OBJDIR)\move.obj \
+ $(OBJDIR)\mbyte.obj \
+ $(OBJDIR)\normal.obj \
+ $(OBJDIR)\ops.obj \
+ $(OBJDIR)\option.obj \
+ $(OBJDIR)\quickfix.obj \
+ $(OBJDIR)\regexp.obj \
+ $(OBJDIR)\screen.obj \
+ $(OBJDIR)\search.obj \
+ $(OBJDIR)\syntax.obj \
+ $(OBJDIR)\tag.obj \
+ $(OBJDIR)\term.obj \
+ $(OBJDIR)\ui.obj \
+ $(OBJDIR)\undo.obj \
+ $(OBJDIR)\version.obj \
+ $(OBJDIR)\window.obj \
+ $(OBJDIR)\pathdef.obj
+
+!if ("$(OLE)"=="yes")
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_ole.obj
+!endif
+
+!ifdef PERL
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_perl.obj
+!endif
+
+!ifdef PYTHON
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_python.obj
+!endif
+
+!ifdef RUBY
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_ruby.obj
+!endif
+
+!ifdef TCL
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_tcl.obj
+!endif
+
+!if ("$(CSCOPE)"=="yes")
+vimobj = $(vimobj) \
+ $(OBJDIR)\if_cscope.obj
+!endif
+
+!if ("$(NETBEANS)"=="yes")
+vimobj = $(vimobj) \
+ $(OBJDIR)\netbeans.obj $(OBJDIR)\gui_beval.obj
+!endif
+
+!ifdef XPM
+vimobj = $(vimobj) \
+ $(OBJDIR)\xpm_w32.obj
+!endif
+
+!if ("$(VIMDLL)"=="yes")
+vimdllobj = $(vimobj)
+!if ("$(DEBUG)"=="yes")
+DLLTARGET = vim32d.dll
+!else
+DLLTARGET = vim32.dll
+!endif
+!else
+DLLTARGET = joebob
+!endif
+
+!if ("$(GUI)"=="yes")
+vimobj = $(vimobj) \
+ $(vimwinmain) \
+ $(OBJDIR)\gui.obj \
+ $(OBJDIR)\gui_w32.obj
+!endif
+
+!if ($(OSTYPE)==WIN32)
+vimobj = $(vimobj) \
+ $(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj
+!elif ($(OSTYPE)==DOS16)
+vimobj = $(vimobj) \
+ $(OBJDIR)\os_msdos.obj
+!endif
+# Blab what we are going to do:
+MSG = Compiling $(OSTYPE) $(TARGET) $(OLETARGET), with:
+!if ("$(GUI)"=="yes")
+MSG = $(MSG) GUI
+!endif
+!if ("$(OLE)"=="yes")
+MSG = $(MSG) OLE
+!endif
+!if ("$(USEDLL)"=="yes")
+MSG = $(MSG) USEDLL
+!endif
+!if ("$(VIMDLL)"=="yes")
+MSG = $(MSG) VIMDLL
+!endif
+!if ("$(FASTCALL)"=="yes")
+MSG = $(MSG) FASTCALL
+!endif
+!if ("$(MBYTE)"=="yes")
+MSG = $(MSG) MBYTE
+!endif
+!if ("$(IME)"=="yes")
+MSG = $(MSG) IME
+! if "$(DYNAMIC_IME)" == "yes"
+MSG = $(MSG)(dynamic)
+! endif
+!endif
+!if ("$(GETTEXT)"=="yes")
+MSG = $(MSG) GETTEXT
+!endif
+!if ("$(ICONV)"=="yes")
+MSG = $(MSG) ICONV
+!endif
+!if ("$(DEBUG)"=="yes")
+MSG = $(MSG) DEBUG
+!endif
+!if ("$(CODEGUARD)"=="yes")
+MSG = $(MSG) CODEGUARD
+!endif
+!if ("$(CSCOPE)"=="yes")
+MSG = $(MSG) CSCOPE
+!endif
+!if ("$(NETBEANS)"=="yes")
+MSG = $(MSG) NETBEANS
+!endif
+!ifdef XPM
+MSG = $(MSG) XPM
+!endif
+!ifdef PERL
+MSG = $(MSG) PERL
+! if "$(DYNAMIC_PERL)" == "yes"
+MSG = $(MSG)(dynamic)
+! endif
+!endif
+!ifdef PYTHON
+MSG = $(MSG) PYTHON
+! if "$(DYNAMIC_PYTHON)" == "yes"
+MSG = $(MSG)(dynamic)
+! endif
+!endif
+!ifdef RUBY
+MSG = $(MSG) RUBY
+! if "$(DYNAMIC_RUBY)" == "yes"
+MSG = $(MSG)(dynamic)
+! endif
+!endif
+!ifdef TCL
+MSG = $(MSG) TCL
+! if "$(DYNAMIC_TCL)" == "yes"
+MSG = $(MSG)(dynamic)
+! endif
+!endif
+MSG = $(MSG) cpu=$(CPUARG)
+MSG = $(MSG) Align=$(ALIGNARG)
+
+!message $(MSG)
+
+!if ($(OSTYPE)==DOS16)
+TARGETS = $(TARGET)
+!else
+!if ("$(VIMDLL)"=="yes")
+TARGETS = $(DLLTARGET)
+!endif
+TARGETS = $(TARGETS) $(TARGET)
+!endif
+
+# Targets:
+all: vim vimrun.exe install.exe xxd uninstal.exe GvimExt/gvimext.dll
+
+vim: $(OSTYPE) $(OBJDIR) $(OBJDIR)\bcc.cfg $(TARGETS)
+ @if exist $(OBJDIR)\version.obj del $(OBJDIR)\version.obj
+ @if exist auto\pathdef.c del auto\pathdef.c
+
+$(OSTYPE):
+ -@md $(OSTYPE)
+
+$(OBJDIR):
+ -@md $(OBJDIR)
+
+xxd:
+ @cd xxd
+ $(MAKE) /f Make_bc5.mak BOR="$(BOR)" BCC="$(CC)"
+ @cd ..
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ cd GvimExt
+ $(MAKE) /f Make_bc5.mak USEDLL=$(USEDLL) BOR=$(BOR)
+ cd ..
+
+install.exe: dosinst.c $(OBJDIR)\bcc.cfg
+!if ($(OSTYPE)==WIN32)
+ $(CC) $(CCARG) -WC -DWIN32 -einstall dosinst.c
+!else
+ $(CC) $(CCARG) -WC -einstall dosinst.c
+!endif
+
+uninstal.exe: uninstal.c $(OBJDIR)\bcc.cfg
+!if ($(OSTYPE)==WIN32)
+ $(CC) $(CCARG) -WC -DWIN32 -O2 -euninstal uninstal.c
+!else
+ $(CC) $(CCARG) -WC -O2 -euninstal uninstal.c
+!endif
+
+clean:
+!if "$(OS)" == "Windows_NT"
+ # For Windows NT/2000, doesn't work on Windows 95/98...
+ # $(COMSPEC) needed to ensure rmdir.exe is not run
+ -@$(COMSPEC) /C rmdir /Q /S $(OBJDIR)
+!else
+ # For Windows 95/98, doesn't work on Windows NT/2000...
+ -@deltree /y $(OBJDIR)
+!endif
+ -@del *.res
+ -@del vim32*.dll
+ -@del vim32*.lib
+ -@del *vim*.exe
+ -@del *install*.exe
+ -@del *.csm
+ -@del *.map
+ -@del *.ilc
+ -@del *.ild
+ -@del *.ilf
+ -@del *.ils
+ -@del *.tds
+!ifdef PERL
+ -@del perl.lib
+!endif
+!ifdef PYTHON
+ -@del python.lib
+!endif
+!ifdef RUBY
+ -@del ruby.lib
+!endif
+!ifdef TCL
+ -@del tcl.lib
+!endif
+!ifdef XPM
+ -@del xpm.lib
+!endif
+ cd xxd
+ $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
+ cd ..
+ cd GvimExt
+ $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
+ cd ..
+
+$(DLLTARGET): $(OBJDIR) $(vimdllobj)
+ $(LINK) @&&|
+ $(LFLAGSDLL) +
+ c0d32.obj +
+ $(vimdllobj)
+ $<,$*
+!if ("$(CODEGUARD)"=="yes")
+ cg32.lib+
+!endif
+# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
+!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
+ ole2w32.lib +
+!endif
+!if ($(OSTYPE)==WIN32)
+ import32.lib+
+!ifdef PERL
+ $(PERL_LIB_FLAG)perl.lib+
+!endif
+!ifdef PYTHON
+ $(PYTHON_LIB_FLAG)python.lib+
+!endif
+!ifdef RUBY
+ $(RUBY_LIB_FLAG)ruby.lib+
+!endif
+!ifdef TCL
+ $(TCL_LIB_FLAG)tcl.lib+
+!endif
+!ifdef XPM
+ xpm.lib+
+!endif
+!if ("$(USEDLL)"=="yes")
+ cw32i.lib
+!else
+ cw32.lib
+!endif
+ vim.def
+!else
+ cl.lib
+!endif
+|
+
+!if ("$(VIMDLL)"=="yes")
+$(TARGET): $(OBJDIR) $(DLLTARGET) $(vimmain) $(OBJDIR)\$(RESFILE)
+!else
+$(TARGET): $(OBJDIR) $(vimobj) $(OBJDIR)\$(RESFILE)
+!endif
+ $(LINK) @&&|
+ $(LFLAGS) +
+ $(STARTUPOBJ) +
+!if ("$(VIMDLL)"=="yes")
+ $(vimmain)
+!else
+ $(vimobj)
+!endif
+ $<,$*
+!if ($(OSTYPE)==WIN32)
+!if ("$(CODEGUARD)"=="yes")
+ cg32.lib+
+!endif
+# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
+!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
+ ole2w32.lib +
+!endif
+ import32.lib+
+!ifdef PERL
+ $(PERL_LIB_FLAG)perl.lib+
+!endif
+!ifdef PYTHON
+ $(PYTHON_LIB_FLAG)python.lib+
+!endif
+!ifdef RUBY
+ $(RUBY_LIB_FLAG)ruby.lib+
+!endif
+!ifdef TCL
+ $(TCL_LIB_FLAG)tcl.lib+
+!endif
+!ifdef XPM
+ xpm.lib+
+!endif
+!if ("$(USEDLL)"=="yes")
+ cw32i.lib
+!else
+ cw32.lib
+!endif
+
+ $(OBJDIR)\$(RESFILE)
+!else
+ emu.lib + cl.lib
+!endif
+|
+
+test:
+ cd testdir
+ $(MAKE) /NOLOGO -f Make_dos.mak win32
+ cd ..
+
+$(OBJDIR)\ex_docmd.obj: ex_docmd.c ex_cmds.h
+
+$(OBJDIR)\ex_eval.obj: ex_eval.c ex_cmds.h
+
+$(OBJDIR)\if_ole.obj: if_ole.cpp
+
+$(OBJDIR)\if_perl.obj: if_perl.c perl.lib
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_perl.c
+
+if_perl.c: if_perl.xs typemap
+ $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \
+ $(PERL)\lib\ExtUtils\typemap if_perl.xs > $@
+
+$(OBJDIR)\if_python.obj: if_python.c python.lib
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c
+
+$(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_ruby.c
+
+$(OBJDIR)\if_tcl.obj: if_tcl.c tcl.lib
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_tcl.c
+
+$(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc xpm_w32.c
+
+$(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
+
+$(OBJDIR)\vim.res: vim.rc version.h tools.bmp tearoff.bmp \
+ vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
+ $(BRC) -fo$(OBJDIR)\vim.res -i $(BOR)\include -w32 -r vim.rc @&&|
+ $(DEFINES)
+|
+
+$(OBJDIR)\pathdef.obj: auto\pathdef.c
+ $(CC) $(CCARG) $(CC1) $(CC2)$@ auto\pathdef.c
+
+
+# Need to escape both quotes and backslashes in $INTERP_DEFINES
+INTERP_DEFINES_ESC_BKS=$(INTERP_DEFINES:\=\\)
+INTERP_DEFINES_ESC=$(INTERP_DEFINES_ESC_BKS:"=\")
+
+# Note: the silly /*"*/ below are there to trick make into accepting
+# the # character as something other than a comment without messing up
+# the preprocessor directive.
+auto\pathdef.c::
+ -@md auto
+ @echo creating auto/pathdef.c
+ @copy /y &&|
+/* pathdef.c */
+/*"*/#include "vim.h"/*"*/
+
+char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)";
+char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)";
+char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS:\=\\) $(DEFINES) $(MBDEFINES) $(INTERP_DEFINES_ESC) $(OPT) $(EXETYPE) $(CPUARG) $(ALIGNARG) $(DEBUG_FLAG) $(CODEGUARD_FLAG)";
+char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LFLAGS:\=\\)";
+char_u *compiled_user = (char_u *)"$(USERNAME)";
+char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";
+| auto\pathdef.c
+
+perl.lib: $(PERL)\lib\CORE\perl$(PERL_VER).lib
+ coff2omf $(PERL)\lib\CORE\perl$(PERL_VER).lib $@
+
+python.lib: $(PYTHON)\libs\python$(PYTHON_VER).lib
+ coff2omf $(PYTHON)\libs\python$(PYTHON_VER).lib $@
+
+ruby.lib: $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
+ coff2omf $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib $@
+
+# For some reason, the coff2omf method doesn't work on libXpm.lib, so
+# we have to manually generate an import library straight from the DLL.
+xpm.lib: $(XPM)\lib\libXpm.lib
+ implib -a $@ $(XPM)\bin\libXpm.dll
+
+tcl.lib: $(TCL_LIB)
+!if ("$(DYNAMIC_TCL)" == "yes")
+ copy $(TCL_LIB) $@
+!else
+ coff2omf $(TCL_LIB) $@
+!endif
+
+!if ("$(DYNAMIC_TCL)" == "yes")
+tclstub$(TCL_VER)-bor.lib:
+ -@IF NOT EXIST $@ ECHO You must download tclstub$(TCL_VER)-bor.lib separately and\
+ place it in the src directory in order to compile a dynamic TCL-enabled\
+ (g)vim with the Borland compiler. You can get the tclstub$(TCL_VER)-bor.lib file\
+ at http://mywebpage.netscape.com/sharppeople/vim/tclstub$(TCL_VER)-bor.lib
+!endif
+
+# vimrun.exe:
+vimrun.exe: vimrun.c
+!if ("$(USEDLL)"=="yes")
+ $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) -D_RTLDLL vimrun.c cw32mti.lib
+!else
+ $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) vimrun.c
+!endif
+
+# The dependency on $(OBJDIR) is to have bcc.cfg generated each time.
+$(OBJDIR)\bcc.cfg: Make_bc5.mak $(OBJDIR)
+ copy /y &&|
+ $(CFLAGS)
+ -L$(LIB)
+ $(DEFINES)
+ $(MBDEFINES)
+ $(INTERP_DEFINES)
+ $(EXETYPE)
+ $(DEBUG_FLAG)
+ $(OPT)
+ $(CODEGUARD_FLAG)
+ $(CPUARG)
+ $(ALIGNARG)
+| $@
+
+# vi:set sts=4 sw=4:
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
new file mode 100644
index 000000000..e58e3d14c
--- /dev/null
+++ b/src/Make_cyg.mak
@@ -0,0 +1,498 @@
+#
+# Makefile for VIM on Win32, using Cygnus gcc
+# Last updated by Dan Sharp. Last Change: 2004 Apr 23
+#
+# This compiles Vim as a Windows application. If you want Vim to run as a
+# Cygwin application use the Makefile (just like on Unix).
+#
+# GUI no or yes: set to yes if you want the GUI version (yes)
+# PERL define to path to Perl dir to get Perl support (not defined)
+# PERL_VER define to version of Perl being used (56)
+# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (yes)
+# PYTHON define to path to Python dir to get PYTHON support (not defined)
+# PYTHON_VER define to version of Python being used (22)
+# DYNAMIC_PYTHON no or yes: use yes to load the Python DLL dynamically (yes)
+# TCL define to path to TCL dir to get TCL support (not defined)
+# TCL_VER define to version of TCL being used (83)
+# DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes)
+# RUBY define to path to Ruby dir to get Ruby support (not defined)
+# RUBY_VER define to version of Ruby being used (16)
+# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (yes)
+# GETTEXT no or yes: set to yes for dynamic gettext support (yes)
+# ICONV no or yes: set to yes for dynamic iconv support (yes)
+# MBYTE no or yes: set to yes to include multibyte support (yes)
+# IME no or yes: set to yes to include IME support (yes)
+# DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
+# OLE no or yes: set to yes to make OLE gvim (no)
+# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
+# CPUNR i386 through pentium4: select -mcpu argument to compile with (i386)
+# ARCH i386 through pentium4: select -march argument to compile with (i386)
+# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
+# For USEDLL=yes the cygwin1.dll is required to run Vim.
+# POSTSCRIPT no or yes: set to yes for PostScript printing (no)
+# FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG)
+# WINVER Lowest Win32 version to support. (0x0400)
+# CSCOPE no or yes: to include cscope interface support (yes)
+# OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
+# NETBEANS no or yes: to include netbeans interface support (yes when GUI
+# is yes)
+# XPM define to path to XPM dir to get XPM image support (not defined)
+#>>>>> choose options:
+ifndef GUI
+GUI=yes
+endif
+
+ifndef FEATURES
+FEATURES = BIG
+endif
+
+ifndef GETTEXT
+GETTEXT = yes
+endif
+
+ifndef ICONV
+ICONV = yes
+endif
+
+ifndef MBYTE
+MBYTE = yes
+endif
+
+ifndef IME
+IME = yes
+endif
+
+ifndef CPUNR
+CPUNR = i386
+endif
+
+ifndef ARCH
+ARCH = i386
+endif
+
+ifndef WINVER
+WINVER = 0x0400
+endif
+
+ifndef CSCOPE
+CSCOPE = yes
+endif
+
+ifndef NETBEANS
+ifeq ($(GUI),yes)
+NETBEANS = yes
+endif
+endif
+
+ifndef OPTIMIZE
+OPTIMIZE = MAXSPEED
+endif
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+
+DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \
+ -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
+INCLUDES = -mcpu=$(CPUNR) -march=$(ARCH) -Iproto
+
+#>>>>> name of the compiler and linker, name of lib directory
+CC = gcc
+RC = windres
+
+##############################
+# DYNAMIC_PERL=yes and no both work
+##############################
+ifdef PERL
+DEFINES += -DFEAT_PERL
+INCLUDES += -I$(PERL)/lib/CORE
+EXTRA_OBJS += $(OUTDIR)/if_perl.o
+
+ifndef DYNAMIC_PERL
+DYNAMIC_PERL = yes
+endif
+
+ifndef PERL_VER
+PERL_VER = 56
+endif
+
+ifeq (yes, $(DYNAMIC_PERL))
+DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
+else
+EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
+endif
+endif
+
+##############################
+# DYNAMIC_PYTHON=yes works.
+# DYNAMIC_PYTHON=no does not (unresolved externals on link).
+##############################
+ifdef PYTHON
+DEFINES += -DFEAT_PYTHON
+INCLUDES += -I$(PYTHON)/include
+EXTRA_OBJS += $(OUTDIR)/if_python.o
+
+ifndef DYNAMIC_PYTHON
+DYNAMIC_PYTHON = yes
+endif
+
+ifndef PYTHON_VER
+PYTHON_VER = 22
+endif
+
+ifeq (yes, $(DYNAMIC_PYTHON))
+DEFINES += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
+else
+EXTRA_LIBS += $(PYTHON)/libs/python$(PYTHON_VER).lib
+endif
+endif
+
+##############################
+# DYNAMIC_RUBY=yes works.
+# DYNAMIC_RUBY=no does not (process exits).
+##############################
+ifdef RUBY
+
+ifndef RUBY_VER
+RUBY_VER=16
+endif
+
+ifndef RUBY_VER_LONG
+RUBY_VER_LONG=1.6
+endif
+
+ifndef DYNAMIC_RUBY
+DYNAMIC_RUBY = yes
+endif
+
+ifeq ($(RUBY_VER), 16)
+ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i586-mswin32
+endif
+ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
+endif
+else
+ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i386-mswin32
+endif
+ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
+endif
+endif
+
+DEFINES += -DFEAT_RUBY
+INCLUDES += -I$(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+EXTRA_OBJS += $(OUTDIR)/if_ruby.o
+
+ifeq (yes, $(DYNAMIC_RUBY))
+DEFINES += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
+DEFINES += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+else
+EXTRA_LIBS += $(RUBY)/lib/$(RUBY_INSTALL_NAME).lib
+endif
+endif
+
+##############################
+# DYNAMIC_TCL=yes and no both work.
+##############################
+ifdef TCL
+DEFINES += -DFEAT_TCL
+INCLUDES += -I$(TCL)/include
+EXTRA_OBJS += $(OUTDIR)/if_tcl.o
+
+ifndef DYNAMIC_TCL
+DYNAMIC_TCL = yes
+endif
+
+ifndef TCL_VER
+TCL_VER = 83
+endif
+
+ifeq (yes, $(DYNAMIC_TCL))
+DEFINES += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
+EXTRA_LIBS += $(TCL)/lib/tclstub$(TCL_VER).lib
+else
+EXTRA_LIBS += $(TCL)/lib/tcl$(TCL_VER).lib
+endif
+endif
+
+##############################
+ifeq (yes, $(GETTEXT))
+DEFINES += -DDYNAMIC_GETTEXT
+endif
+
+##############################
+ifeq (yes, $(ICONV))
+DEFINES += -DDYNAMIC_ICONV
+endif
+
+##############################
+ifeq (yes, $(MBYTE))
+DEFINES += -DFEAT_MBYTE
+endif
+
+##############################
+ifeq (yes, $(IME))
+DEFINES += -DFEAT_MBYTE_IME
+
+ifndef DYNAMIC_IME
+DYNAMIC_IME = yes
+endif
+
+ifeq (yes, $(DYNAMIC_IME))
+DEFINES += -DDYNAMIC_IME
+else
+EXTRA_LIBS += -limm32
+endif
+endif
+
+##############################
+ifeq (yes, $(DEBUG))
+DEFINES += -DDEBUG
+INCLUDES += -g -fstack-check
+DEBUG_SUFFIX = d
+else
+
+ifeq ($(OPTIMIZE), SIZE)
+OPTFLAG = -Os
+else
+ifeq ($(OPTIMIZE), MAXSPEED)
+OPTFLAG = -O3 -fomit-frame-pointer -freg-struct-return -malign-double
+else
+OPTFLAG = -O2
+endif
+endif
+
+# A bug in the GCC <= 3.2 optimizer can cause a crash. The
+# following option removes the problem optimization.
+OPTFLAG += -fno-strength-reduce
+
+INCLUDES += -s
+
+endif
+
+##############################
+# USEDLL=yes will build a Cygwin32 executable that relies on cygwin1.dll.
+# USEDLL=no will build a Mingw32 executable with no extra dll dependencies.
+##############################
+ifeq (yes, $(USEDLL))
+DEFINES += -D_MAX_PATH=256 -D__CYGWIN__
+else
+INCLUDES += -mno-cygwin
+endif
+
+##############################
+ifeq (yes, $(POSTSCRIPT))
+DEFINES += -DMSWINPS
+endif
+
+##############################
+ifeq (yes, $(CSCOPE))
+DEFINES += -DFEAT_CSCOPE
+EXTRA_OBJS += $(OUTDIR)/if_cscope.o
+endif
+
+##############################
+ifeq (yes, $(NETBEANS))
+DEFINES += -DFEAT_NETBEANS_INTG
+EXTRA_OBJS += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o
+EXTRA_LIBS += -lwsock32
+
+ifeq (yes, $(DEBUG))
+DEFINES += -DNBDEBUG
+NBDEBUG_DEP = nbdebug.h nbdebug.c
+endif
+
+endif
+
+##############################
+ifdef XPM
+DEFINES += -DFEAT_XPM_W32
+INCLUDES += -I$(XPM)/include
+EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
+EXTRA_LIBS += -L$(XPM)/lib -lXpm
+endif
+
+##############################
+ifeq (yes, $(OLE))
+DEFINES += -DFEAT_OLE
+EXTRA_OBJS += $(OUTDIR)/if_ole.o
+EXTRA_LIBS += -loleaut32 -lstdc++
+endif
+
+##############################
+ifeq ($(GUI),yes)
+EXE = gvim$(DEBUG_SUFFIX).exe
+OUTDIR = gobj$(DEBUG_SUFFIX)
+DEFINES += -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+EXTRA_OBJS += $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/os_w32exe.o
+EXTRA_LIBS += -mwindows -lcomctl32
+else
+EXE = vim$(DEBUG_SUFFIX).exe
+OUTDIR = obj$(DEBUG_SUFFIX)
+LIBS += -luser32 -lgdi32 -lcomdlg32
+endif
+
+##############################
+ifneq (sh.exe, $(SHELL))
+DEL = rm
+DIRSLASH = /
+else
+DEL = del
+DIRSLASH = \\
+endif
+
+#>>>>> end of choices
+###########################################################################
+
+INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_win32.h \
+ structs.h version.h
+
+CFLAGS = $(OPTFLAG) $(DEFINES) $(INCLUDES)
+
+RCFLAGS = -O coff $(DEFINES)
+
+OBJ = \
+ $(OUTDIR)/buffer.o \
+ $(OUTDIR)/charset.o \
+ $(OUTDIR)/diff.o \
+ $(OUTDIR)/digraph.o \
+ $(OUTDIR)/edit.o \
+ $(OUTDIR)/eval.o \
+ $(OUTDIR)/ex_cmds.o \
+ $(OUTDIR)/ex_cmds2.o \
+ $(OUTDIR)/ex_docmd.o \
+ $(OUTDIR)/ex_eval.o \
+ $(OUTDIR)/ex_getln.o \
+ $(OUTDIR)/fileio.o \
+ $(OUTDIR)/fold.o \
+ $(OUTDIR)/getchar.o \
+ $(OUTDIR)/main.o \
+ $(OUTDIR)/mark.o \
+ $(OUTDIR)/memfile.o \
+ $(OUTDIR)/memline.o \
+ $(OUTDIR)/menu.o \
+ $(OUTDIR)/message.o \
+ $(OUTDIR)/misc1.o \
+ $(OUTDIR)/misc2.o \
+ $(OUTDIR)/move.o \
+ $(OUTDIR)/mbyte.o \
+ $(OUTDIR)/normal.o \
+ $(OUTDIR)/ops.o \
+ $(OUTDIR)/option.o \
+ $(OUTDIR)/os_win32.o \
+ $(OUTDIR)/os_mswin.o \
+ $(OUTDIR)/pathdef.o \
+ $(OUTDIR)/quickfix.o \
+ $(OUTDIR)/regexp.o \
+ $(OUTDIR)/screen.o \
+ $(OUTDIR)/search.o \
+ $(OUTDIR)/syntax.o \
+ $(OUTDIR)/tag.o \
+ $(OUTDIR)/term.o \
+ $(OUTDIR)/ui.o \
+ $(OUTDIR)/undo.o \
+ $(OUTDIR)/version.o \
+ $(OUTDIR)/vimrc.o \
+ $(OUTDIR)/window.o \
+ $(EXTRA_OBJS)
+
+all: $(EXE) xxd/xxd.exe vimrun.exe install.exe uninstal.exe GvimExt/gvimext.dll
+
+# According to the Cygwin doc 1.2 FAQ, kernel32 should not be specified for
+# linking unless calling ld directly.
+# See /usr/doc/cygwin-doc-1.2/html/faq_toc.html#TOC93 for more information.
+$(EXE): $(OUTDIR) $(OBJ)
+ $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
+
+xxd/xxd.exe: xxd/xxd.c
+ $(MAKE) -C xxd -f Make_cyg.mak USEDLL=$(USEDLL)
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ $(MAKE) -C GvimExt -f Make_ming.mak
+
+vimrun.exe: vimrun.c
+ $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS)
+
+install.exe: dosinst.c
+ $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIBS) -luuid -lole32
+
+uninstal.exe: uninstal.c
+ $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIBS)
+
+$(OUTDIR):
+ mkdir $(OUTDIR)
+
+tags:
+ command /c ctags *.c $(INCL)
+
+clean:
+ -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
+ -rmdir $(OUTDIR)
+ -$(DEL) *.exe
+ifdef PERL
+ -$(DEL) if_perl.c
+endif
+ -$(DEL) pathdef.c
+ $(MAKE) -C xxd -f Make_cyg.mak clean
+ $(MAKE) -C GvimExt -f Make_ming.mak clean
+
+###########################################################################
+
+$(OUTDIR)/%.o : %.c $(INCL)
+ $(CC) -c $(CFLAGS) $< -o $@
+
+$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
+
+$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
+
+$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
+ $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+ $(CC) -c $(CFLAGS) -D__IID_DEFINED__ if_ole.cpp -o $(OUTDIR)/if_ole.o
+
+if_perl.c: if_perl.xs typemap
+ perl $(PERL)/lib/ExtUtils/xsubpp -prototypes -typemap \
+ $(PERL)/lib/ExtUtils/typemap if_perl.xs > $@
+
+$(OUTDIR)/if_perl.o: if_perl.c $(INCL)
+ifeq (yes, $(USEDLL))
+ $(CC) -c $(CFLAGS) -I/usr/include/mingw -D__MINGW32__ if_perl.c -o $(OUTDIR)/if_perl.o
+endif
+
+$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
+ifeq (16, $(RUBY_VER))
+ $(CC) -c $(CFLAGS) -U_WIN32 if_ruby.c -o $(OUTDIR)/if_ruby.o
+endif
+
+$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
+ $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
+
+$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
+ $(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
+
+pathdef.c: $(INCL)
+ifneq (sh.exe, $(SHELL))
+ @echo creating pathdef.c
+ @echo '/* pathdef.c */' > pathdef.c
+ @echo '#include "vim.h"' >> pathdef.c
+ @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
+ @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
+ @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
+ @echo 'char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)";' >> pathdef.c
+ @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
+ @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
+else
+ @echo creating pathdef.c
+ @echo /* pathdef.c */ > pathdef.c
+ @echo #include "vim.h" >> pathdef.c
+ @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
+ @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
+ @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
+ @echo char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)"; >> pathdef.c
+ @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
+ @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
+endif
diff --git a/src/Make_dice.mak b/src/Make_dice.mak
new file mode 100644
index 000000000..77f6cba22
--- /dev/null
+++ b/src/Make_dice.mak
@@ -0,0 +1,209 @@
+#
+# Makefile for VIM, using DICE 3
+#
+
+#>>>>> choose options:
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+DEFINES = -DHAVE_TGETENT -DUP_BC_PC_EXTERN -DOSPEED_EXTERN
+
+#>>>>> if HAVE_TGETENT is defined o/termlib.o has to be used
+TERMLIB = o/termlib.o
+#TERMLIB =
+
+#>>>>> end of choices
+###########################################################################
+
+CFLAGS = -c -DAMIGA -Iproto $(DEFINES)
+
+SYMS = vim.syms
+PRE = -H${SYMS}=vim.h
+LIBS = -la
+CC = dcc
+LD = dcc
+
+.c.o:
+ ${CC} ${PRE} ${CFLAGS} $< -o $@
+
+SRC = \
+ buffer.c \
+ charset.c \
+ diff.c \
+ digraph.c \
+ edit.c \
+ eval.c \
+ ex_cmds.c \
+ ex_cmds2.c \
+ ex_docmd.c \
+ ex_eval.c \
+ ex_getln.c \
+ fileio.c \
+ fold.c \
+ getchar.c \
+ main.c \
+ mark.c \
+ memfile.c \
+ memline.c \
+ menu.c \
+ message.c \
+ misc1.c \
+ misc2.c \
+ move.c \
+ mbyte.c \
+ normal.c \
+ ops.c \
+ option.c \
+ os_amiga.c \
+ quickfix.c \
+ regexp.c \
+ screen.c \
+ search.c \
+ syntax.c \
+ tag.c \
+ term.c \
+ ui.c \
+ undo.c \
+ window.c \
+ version.c
+
+OBJ = o/buffer.o \
+ o/charset.o \
+ o/diff.o \
+ o/digraph.o \
+ o/edit.o \
+ o/eval.o \
+ o/ex_cmds.o \
+ o/ex_cmds2.o \
+ o/ex_docmd.o \
+ o/ex_eval.o \
+ o/ex_getln.o \
+ o/fileio.o \
+ o/fold.o \
+ o/getchar.o \
+ o/main.o \
+ o/mark.o \
+ o/memfile.o \
+ o/memline.o \
+ o/menu.o \
+ o/message.o \
+ o/misc1.o \
+ o/misc2.o \
+ o/move.o \
+ o/mbyte.o \
+ o/normal.o \
+ o/ops.o \
+ o/option.o \
+ o/os_amiga.o \
+ o/quickfix.o \
+ o/regexp.o \
+ o/screen.o \
+ o/search.o \
+ o/syntax.o \
+ o/tag.o \
+ o/term.o \
+ o/ui.o \
+ o/undo.o \
+ o/window.o \
+ $(TERMLIB)
+
+Vim: $(OBJ) version.c version.h
+ ${CC} $(CFLAGS) version.c -o o/version.o
+ ${LD} -o Vim $(OBJ) o/version.o $(LIBS)
+
+debug: $(OBJ) version.c version.h
+ ${CC} $(CFLAGS) version.c -o o/version.o
+ ${LD} -s -o Vim $(OBJ) o/version.o $(LIBS)
+
+tags:
+ csh -c ctags $(SRC) *.h
+
+clean:
+ delete o/*.o Vim $(SYMS)
+
+$(SYMS) : vim.h globals.h keymap.h macros.h ascii.h term.h os_amiga.h structs.h
+ delete $(SYMS)
+
+###########################################################################
+
+o/buffer.o: buffer.c $(SYMS)
+
+o/charset.o: charset.c $(SYMS)
+
+o/diff.o: diff.c $(SYMS)
+
+o/digraph.o: digraph.c $(SYMS)
+
+o/edit.o: edit.c $(SYMS)
+
+o/eval.o: eval.c $(SYMS)
+
+o/ex_cmds.o: ex_cmds.c $(SYMS)
+
+o/ex_cmds2.o: ex_cmds2.c $(SYMS)
+
+o/ex_docmd.o: ex_docmd.c $(SYMS) ex_cmds.h
+
+o/ex_eval.o: ex_eval.c $(SYMS) ex_cmds.h
+
+o/ex_getln.o: ex_getln.c $(SYMS)
+
+o/fileio.o: fileio.c $(SYMS)
+
+o/fold.o: fold.c $(SYMS)
+
+o/getchar.o: getchar.c $(SYMS)
+
+o/main.o: main.c $(SYMS)
+
+o/mark.o: mark.c $(SYMS)
+
+o/memfile.o: memfile.c $(SYMS)
+
+o/memline.o: memline.c $(SYMS)
+
+o/menu.o: menu.c $(SYMS)
+
+o/message.o: message.c $(SYMS)
+
+o/misc1.o: misc1.c $(SYMS)
+
+o/misc2.o: misc2.c $(SYMS)
+
+o/move.o: move.c $(SYMS)
+
+o/mbyte.o: mbyte.c $(SYMS)
+
+o/normal.o: normal.c $(SYMS)
+
+o/ops.o: ops.c $(SYMS)
+
+o/option.o: option.c $(SYMS)
+# Because of a bug in DC1 2.06.40, initialisation of unions does not
+# work correctly. dc1-21 is DC1 2.06.21 which does work.
+# rename dc1-21 dc1
+ ${CC} ${CFLAGS} option.c -o o/option.o
+# rename dc1 dc1-21
+
+o/os_amiga.o: os_amiga.c $(SYMS) os_amiga.h
+
+o/quickfix.o: quickfix.c $(SYMS)
+
+o/regexp.o: regexp.c $(SYMS) regexp.h
+
+o/screen.o: screen.c $(SYMS)
+
+o/search.o: search.c $(SYMS) regexp.h
+
+o/syntax.o: syntax.c $(SYMS)
+
+o/tag.o: tag.c $(SYMS)
+
+o/term.o: term.c $(SYMS) term.h
+
+o/termlib.o: termlib.c $(SYMS)
+
+o/ui.o: ui.c $(SYMS)
+
+o/undo.o: undo.c $(SYMS)
+
+o/window.o: window.c $(SYMS)
diff --git a/src/Make_djg.mak b/src/Make_djg.mak
new file mode 100644
index 000000000..02c42b878
--- /dev/null
+++ b/src/Make_djg.mak
@@ -0,0 +1,102 @@
+#
+# Makefile for VIM on MSDOS, using DJGPP 2.0
+#
+
+#>>>>> choose options:
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+
+DEFINES =
+
+#>>>>> name of the compiler and linker, name of lib directory
+CC = gcc
+
+#>>>>> end of choices
+###########################################################################
+
+INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_msdos.h structs.h
+CFLAGS = -O2 -DMSDOS -Iproto $(DEFINES) -Wall -Dinterrupt= -Dfar= -DMAXMEM=512 -D_NAIVE_DOS_REGS
+
+OBJ = \
+ obj/buffer.o \
+ obj/charset.o \
+ obj/diff.o \
+ obj/digraph.o \
+ obj/edit.o \
+ obj/eval.o \
+ obj/ex_cmds.o \
+ obj/ex_cmds2.o \
+ obj/ex_docmd.o \
+ obj/ex_eval.o \
+ obj/ex_getln.o \
+ obj/fileio.o \
+ obj/fold.o \
+ obj/getchar.o \
+ obj/main.o \
+ obj/mark.o \
+ obj/memfile.o \
+ obj/memline.o \
+ obj/menu.o \
+ obj/message.o \
+ obj/misc1.o \
+ obj/misc2.o \
+ obj/move.o \
+ obj/mbyte.o \
+ obj/normal.o \
+ obj/ops.o \
+ obj/option.o \
+ obj/os_msdos.o \
+ obj/quickfix.o \
+ obj/regexp.o \
+ obj/screen.o \
+ obj/search.o \
+ obj/syntax.o \
+ obj/tag.o \
+ obj/term.o \
+ obj/ui.o \
+ obj/undo.o \
+ obj/window.o \
+ $(TERMLIB)
+
+all: vim.exe install.exe uninstal.exe xxd/xxd.exe
+
+# version.c is compiled each time, so that it sets the build time.
+vim.exe: obj $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) -s -o vim.exe version.c $(OBJ) -lpc
+
+install.exe: dosinst.c
+ $(CC) $(CFLAGS) -s -o install.exe dosinst.c -lpc
+
+uninstal.exe: uninstal.c
+ $(CC) $(CFLAGS) -s -o uninstal.exe uninstal.c -lpc
+
+# This requires GNU make.
+xxd/xxd.exe: xxd/xxd.c
+ $(MAKE) --directory=xxd -f Make_djg.mak
+
+obj:
+ mkdir obj
+
+tags:
+ command /c ctags *.c $(INCL) ex_cmds.h
+
+clean:
+ -del obj\*.o
+ -rmdir obj
+ -del vim.exe
+ -del install.exe
+ -del xxd\xxd.exe
+ -del testdir\*.out
+
+# This requires GNU make.
+test:
+ $(MAKE) --directory=testdir -f Make_dos.mak
+
+###########################################################################
+
+obj/%.o: %.c obj $(INCL)
+ $(CC) -c $(CFLAGS) -o $@ $<
+
+# Extra dependency (there are actually many more...)
+obj/ex_docmd.o: ex_cmds.h
diff --git a/src/Make_dvc.mak b/src/Make_dvc.mak
new file mode 100644
index 000000000..46377f07d
--- /dev/null
+++ b/src/Make_dvc.mak
@@ -0,0 +1,105 @@
+# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Vim - Win32 IDE for Make_mvc.mak
+!MESSAGE No configuration specified. Defaulting to Vim - Win32 IDE for\
+ Make_mvc.mak.
+!ENDIF
+
+!IF "$(CFG)" != "Vim - Win32 IDE for Make_mvc.mak"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Make_dvc.mak" CFG="Vim - Win32 IDE for Make_mvc.mak"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Vim - Win32 IDE for Make_mvc.mak" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "Vim - Win32 IDE for Make_mvc.mak"
+CPP=cl.exe
+RSC=rc.exe
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir ""
+# PROP Target_Dir ""
+OUTDIR=.
+INTDIR=.
+
+ALL : "$(OUTDIR)\vimrun.exe"
+
+CLEAN :
+ -@erase ".\vimrun.exe"
+ -@erase ".\vimrun.obj"
+
+# ADD CPP /nologo /c
+# ADD BASE RSC /l 0x809
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/Make_dvc.bsc"
+BSC32_SBRS=
+LINK32=link.exe
+# ADD BASE LINK32 /machine:IX86
+# ADD LINK32 /nologo /pdb:none /machine:IX86 /out:"vimrun.exe"
+LINK32_FLAGS=/nologo /pdb:none /machine:IX86 /out:"$(OUTDIR)/vimrun.exe"
+LINK32_OBJS= \
+ "$(INTDIR)/vimrun.obj"
+
+"$(OUTDIR)\vimrun.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+CPP_PROJ=/nologo /ML /c
+
+.c.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.c.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Target
+
+# Name "Vim - Win32 IDE for Make_mvc.mak"
+################################################################################
+# Begin Source File
+
+SOURCE=.\vimrun.c
+
+"$(INTDIR)\vimrun.obj" : $(SOURCE) "$(INTDIR)"
+
+
+# End Source File
+# End Target
+# End Project
+################################################################################
diff --git a/src/Make_ivc.mak b/src/Make_ivc.mak
new file mode 100644
index 000000000..94a153060
--- /dev/null
+++ b/src/Make_ivc.mak
@@ -0,0 +1,648 @@
+# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00
+# ** DO NOT EDIT **
+#
+# Make_ivc.mak Makefile to build vim in both IDE and nmake.
+# This file can be imported as a workspace into Visual Studio. It must be in
+# DOS fileformat then!
+#
+# It is worth making the file read-only as the VC4 IDE will try to overwrite
+# it with a HUGELY expanded clone of itself.
+#
+# The following points are worth noting:
+# 1) Comments here are ignored by VC[456].0 IDEs
+# 2) # ADD LINK32 /pdb:.\Dbg/vimd.pdb is written so rather than
+# # ADD LINK32 /pdb:".\Dbg/vimd.pdb" to avoid VC4 -> VC5 conversion failure
+# 3) It is good to delete .pdb file before linking to cope with switch among
+# VC[456] as IDE clean action does not remove that file and link clashes
+# with it. The following works in VC5 but not in VC4 which does not support
+# pre-link actions. The nmake action does such deletions.
+# Begin Special Build Tool
+PreLink_Cmds=@if exist .\oleDbg\gvimd.pdb del .\oleDbg\gvimd.pdb
+# End Special Build Tool
+# 4) I was unable to make !IFDEF OLE, etc. work in the VC4 IDE.
+# I was aiming for 4 configurations with sub-configurations selected by
+# environment variables.
+# 5) Optimisation is not supported by disabled versions of VC. This results in
+# messages for Release builds like:
+# Command line warning D4025 : overriding '/O2' with '/Od'
+# 6) nmake 1.62 and later support batch compilation. I was unable to use this
+# in a manner acceptable to earlier IDEs.
+#
+# History
+#
+# When Who What
+# 2001-07-06 W.Briscoe Original derived from Make_[go]vc.mak with less noise
+# 2001-07-08 W.Briscoe Further noise reduction; consistent .map and .pdb logic
+# Added install.exe rule, etc.; Removed unused libraries.
+# 2001-08-09 W.Briscoe Restored VC4.0-required trailing space in !MESSAGE afore
+# Enhanced if_ole.idl rule to use /out argument.
+# Default rules now relative to . to reduce IDE/nmake difs
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+!IF "$(CFG)" == ""
+CFG=Vim - Win32 Release gvim OLE
+!MESSAGE No configuration specified. Defaulting to Vim - Win32 Release gvim OLE.
+!ENDIF
+
+!IF "$(CFG)" != "Vim - Win32 Release gvim OLE"\
+ && "$(CFG)" != "Vim - Win32 Debug gvim OLE"\
+ && "$(CFG)" != "Vim - Win32 Release gvim"\
+ && "$(CFG)" != "Vim - Win32 Debug gvim"\
+ && "$(CFG)" != "Vim - Win32 Release vim"\
+ && "$(CFG)" != "Vim - Win32 Debug vim"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Make_ivc.mak" CFG="Vim - Win32 Debug vim"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Vim - Win32 Release gvim OLE" (based on "Win32 (x86) Console Application")
+!MESSAGE "Vim - Win32 Debug gvim OLE" (based on "Win32 (x86) Console Application")
+!MESSAGE "Vim - Win32 Release gvim" (based on "Win32 (x86) Console Application")
+!MESSAGE "Vim - Win32 Debug gvim" (based on "Win32 (x86) Console Application")
+!MESSAGE "Vim - Win32 Release vim" (based on "Win32 (x86) Console Application")
+!MESSAGE "Vim - Win32 Debug vim" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+DEL_TREE = rmdir /s /q
+!ELSE
+NULL=nul
+DEL_TREE = deltree /y
+!ENDIF
+
+# Begin Project
+# PROP Target_Last_Scanned "Vim - Win32 Debug vim"
+# PROP Use_MFC 0
+
+RSC=rc.exe
+CPP=cl.exe
+LINK32=link.exe
+
+CPP_PROJ= /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c
+# ADD CPP /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c
+
+LINK32_FLAGS= oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /machine:I386 /nodefaultlib
+# ADD LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib comctl32.lib advapi32.lib shell32.lib ole32.lib uuid.lib /nologo /machine:I386 /nodefaultlib
+# SUBTRACT LINK32 /incremental:yes
+
+RSC_PROJ= /l 0x409 /d "FEAT_GUI_W32"
+# ADD RSC /l 0x409 /d "FEAT_GUI_W32"
+
+!IF "$(CFG)" == "Vim - Win32 Release gvim OLE"
+
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir .\oleRel
+# PROP Intermediate_Dir .\oleRel
+
+INTDIR=.\oleRel
+VIM=gvim
+EXTRAS="$(INTDIR)/if_ole.obj" "$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/os_w32exe.obj"
+
+CPP_PROJ=$(CPP_PROJ) /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
+# ADD CPP /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/
+
+RSC_PROJ=$(RSC_PROJ) /I ".\oleRel" /d "NDEBUG" /d "FEAT_OLE" /fo.\oleRel\vim.res
+# ADD RSC /I ".\oleRel" /d "NDEBUG" /d "FEAT_OLE" /fo.\oleRel\vim.res
+
+LINK32_FLAGS=$(LINK32_FLAGS) /pdb:none libc.lib oleaut32.lib /subsystem:windows /out:.\gvim.exe
+# ADD LINK32 /pdb:none libc.lib oleaut32.lib /subsystem:windows /out:.\gvim.exe
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim OLE"
+
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir .\oleDbg
+# PROP Intermediate_Dir .\oleDbg
+
+INTDIR=.\oleDbg
+VIM=gvimd
+EXTRAS="$(INTDIR)/if_ole.obj" "$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/os_w32exe.obj"
+
+CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
+# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "DYNAMIC_GETTEXT" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/
+
+RSC_PROJ=$(RSC_PROJ) /I .\oleDbg /d "_DEBUG" /d "FEAT_OLE" /fo.\oleDbg\vim.res
+# ADD RSC /I .\oleDbg /d "_DEBUG" /d "FEAT_OLE" /fo.\oleDbg\vim.res
+
+LINK32_FLAGS=$(LINK32_FLAGS) libcd.lib oleaut32.lib /subsystem:windows /debug /profile /pdb:.\oleDbg/gvimd.pdb /map:.\oleDbg\gvimd.map /out:.\gvimd.exe
+# ADD LINK32 libcd.lib oleaut32.lib /subsystem:windows /debug /profile /pdb:.\oleDbg/gvimd.pdb /map:.\oleDbg\gvimd.map /out:.\gvimd.exe
+
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release gvim"
+
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir .\gRel
+# PROP Intermediate_Dir .\gRel
+
+INTDIR=.\gRel
+VIM=gvim
+EXTRAS="$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/os_w32exe.obj"
+
+CPP_PROJ=$(CPP_PROJ) /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /Fd.\gRel/ /Fo.\gRel/
+# ADD CPP /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /Fd.\gRel/ /Fo.\gRel/
+
+RSC_PROJ=$(RSC_PROJ) /d "NDEBUG" /fo.\gRel\vim.res
+# ADD RSC /d "NDEBUG" /fo.\gRel\vim.res
+
+LINK32_FLAGS=$(LINK32_FLAGS) /pdb:none libc.lib /subsystem:windows /out:.\gvim.exe
+# ADD LINK32 /pdb:none libc.lib /subsystem:windows /out:.\gvim.exe
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim"
+
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir .\gDbg
+# PROP Intermediate_Dir .\gDbg
+
+INTDIR=.\gDbg
+VIM=gvimd
+EXTRAS="$(INTDIR)/vim.res" "$(INTDIR)/gui.obj" "$(INTDIR)/gui_w32.obj" "$(INTDIR)/os_w32exe.obj"
+
+CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /Fd.\gDbg/ /Fo.\gDbg/
+# ADD CPP /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /Fd.\gDbg/ /Fo.\gDbg/
+
+RSC_PROJ=$(RSC_PROJ) /d "_DEBUG" /fo.\gDbg\vim.res
+# ADD RSC /d "_DEBUG" /fo.\gDbg\vim.res
+
+LINK32_FLAGS=$(LINK32_FLAGS) libcd.lib /subsystem:windows /debug /profile /pdb:.\gDbg/gvimd.pdb /map:.\gDbg\gvimd.map /out:.\gvimd.exe
+# ADD LINK32 libcd.lib /subsystem:windows /debug /profile /pdb:.\gDbg/gvimd.pdb /map:.\gDbg\gvimd.map /out:.\gvimd.exe
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir .\Rel
+# PROP Intermediate_Dir .\Rel
+
+INTDIR=.\Rel
+VIM=vim
+EXTRAS=
+
+CPP_PROJ=$(CPP_PROJ) /O2 /D "NDEBUG" /Fd.\Rel/ /Fo.\Rel/
+# ADD CPP /O2 /D "NDEBUG" /Fd.\Rel/ /Fo.\Rel/
+
+LINK32_FLAGS=$(LINK32_FLAGS) /pdb:none libc.lib /subsystem:console /out:.\vim.exe
+# ADD LINK32 /pdb:none libc.lib /subsystem:console /out:.\vim.exe
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir .\Dbg
+# PROP Intermediate_Dir .\Dbg
+
+INTDIR=.\Dbg
+VIM=vimd
+EXTRAS=
+
+CPP_PROJ=$(CPP_PROJ) /Zi /Od /D "_DEBUG" /Fd.\Dbg/ /Fo.\Dbg/
+# ADD CPP /Zi /Od /D "_DEBUG" /Fd.\Dbg/ /Fo.\Dbg/
+
+LINK32_FLAGS=$(LINK32_FLAGS) libcd.lib /subsystem:console /debug /profile /pdb:.\Dbg/vimd.pdb /map:.\Dbg/vimd.map /out:.\vimd.exe
+# ADD LINK32 libcd.lib /subsystem:console /debug /profile /pdb:.\Dbg/vimd.pdb /map:.\Dbg/vimd.map /out:.\vimd.exe
+
+!ENDIF
+
+ALL : .\$(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
+
+LINK32_OBJS= \
+ $(EXTRAS) \
+ "$(INTDIR)/buffer.obj" \
+ "$(INTDIR)/charset.obj" \
+ "$(INTDIR)/diff.obj" \
+ "$(INTDIR)/digraph.obj" \
+ "$(INTDIR)/edit.obj" \
+ "$(INTDIR)/eval.obj" \
+ "$(INTDIR)/ex_cmds.obj" \
+ "$(INTDIR)/ex_cmds2.obj" \
+ "$(INTDIR)/ex_docmd.obj" \
+ "$(INTDIR)/ex_eval.obj" \
+ "$(INTDIR)/ex_getln.obj" \
+ "$(INTDIR)/fileio.obj" \
+ "$(INTDIR)/fold.obj" \
+ "$(INTDIR)/getchar.obj" \
+ "$(INTDIR)/main.obj" \
+ "$(INTDIR)/mark.obj" \
+ "$(INTDIR)/mbyte.obj" \
+ "$(INTDIR)/memfile.obj" \
+ "$(INTDIR)/memline.obj" \
+ "$(INTDIR)/menu.obj" \
+ "$(INTDIR)/message.obj" \
+ "$(INTDIR)/misc1.obj" \
+ "$(INTDIR)/misc2.obj" \
+ "$(INTDIR)/move.obj" \
+ "$(INTDIR)/normal.obj" \
+ "$(INTDIR)/ops.obj" \
+ "$(INTDIR)/option.obj" \
+ "$(INTDIR)/os_mswin.obj" \
+ "$(INTDIR)/os_win32.obj" \
+ "$(INTDIR)/quickfix.obj" \
+ "$(INTDIR)/regexp.obj" \
+ "$(INTDIR)/screen.obj" \
+ "$(INTDIR)/search.obj" \
+ "$(INTDIR)/syntax.obj" \
+ "$(INTDIR)/tag.obj" \
+ "$(INTDIR)/term.obj" \
+ "$(INTDIR)/ui.obj" \
+ "$(INTDIR)/undo.obj" \
+ "$(INTDIR)/version.obj" \
+ "$(INTDIR)/window.obj"
+
+".\$(VIM).exe" : "$(INTDIR)" $(EXTRAS) $(LINK32_OBJS)
+ @if exist $(INTDIR)\$(VIM).pdb del $(INTDIR)\$(VIM).pdb
+ $(LINK32) $(LINK32_FLAGS) $(LINK32_OBJS)
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+CLEAN :
+ -@if exist "$(INTDIR)/$(NULL)" $(DEL_TREE) "$(INTDIR)"
+ -@if exist $(VIM).exe erase $(VIM).exe
+ -@if exist $(VIM).ilk erase $(VIM).ilk
+ -@if exist $(VIM).map erase $(VIM).map
+ -@if exist $(VIM).pdb erase $(VIM).pdb
+ -@if exist DLLDATA.C erase DLLDATA.C
+ -@if exist Make_ivc.bak attrib -r Make_ivc.bak
+ -@if exist Make_ivc.bak erase Make_ivc.bak
+ -@if exist Make_ivc.dsp erase Make_ivc.dsp
+ -@if exist Make_ivc.dsw erase Make_ivc.dsw
+ -@if exist Make_ivc.mdp erase Make_ivc.mdp
+ -@if exist Make_ivc.ncb erase Make_ivc.ncb
+ -@if exist Make_ivc.opt erase Make_ivc.opt
+ -@if exist Make_ivc.plg erase Make_ivc.plg
+ -@if exist dosinst.obj erase dosinst.obj
+ -@if exist install.exe erase install.exe
+ -@if exist uninstal.exe erase uninstal.exe
+ -@if exist uninstal.obj erase uninstal.obj
+ -@if exist vimrun.exe erase vimrun.exe
+ -@if exist vimrun.obj erase vimrun.obj
+
+
+install.exe: dosinst.c
+ $(CPP) /Fe$@ /nologo /W3 -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
+
+uninstal.exe: uninstal.c
+ $(CPP) /nologo /W3 -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
+
+vimrun.exe: vimrun.c
+ $(CPP) /nologo /W3 -DNDEBUG vimrun.c
+
+xxd/xxd.exe: xxd/xxd.c
+ cd xxd
+ $(MAKE) /NOLOGO -f Make_mvc.mak
+ cd ..
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ cd GvimExt
+ $(MAKE) /NOLOGO -f Makefile
+ cd ..
+
+{.}.c{$(INTDIR)/}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+{.}.cpp{$(INTDIR)/}.obj:
+ $(CPP) $(CPP_PROJ) /I $(INTDIR) $<
+
+{.}.rc{$(INTDIR)/}.res:
+ $(RSC) $(RSC_PROJ) $<
+
+# Begin Target
+
+# Name "Vim - Win32 Release gvim OLE"
+# Name "Vim - Win32 Debug gvim OLE"
+# Name "Vim - Win32 Release gvim"
+# Name "Vim - Win32 Debug gvim"
+# Name "Vim - Win32 Release vim"
+# Name "Vim - Win32 Debug vim"
+
+# Begin Source File
+
+SOURCE=.\buffer.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\charset.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\diff.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\digraph.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\edit.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\eval.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ex_cmds.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ex_cmds2.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ex_docmd.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ex_eval.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ex_getln.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\fileio.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\fold.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\getchar.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\gui.c
+
+!IF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\gui_w32.c
+
+!IF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_w32exe.c
+
+!IF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\if_ole.cpp
+
+!IF "$(CFG)" == "Vim - Win32 Release gvim OLE"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\if_ole.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
+ cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /O2 /D "NDEBUG" /D "FEAT_GUI_W32" /D "FEAT_OLE" /Fd.\oleRel/ /Fo.\oleRel/ /I ".\oleRel" .\if_ole.cpp
+ @rem This is the default rule with /I "$(IntDir)" added
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim OLE"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\if_ole.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
+ cl.exe /nologo /MT /W3 /GX /I ".\proto" /D "WIN32" /c /Zi /Od /D "_DEBUG" /D "FEAT_GUI_W32" /D "FEAT_OLE" /Fd.\oleDbg/ /Fo.\oleDbg/ /I ".\oleDbg" .\if_ole.cpp
+ @rem This is the default rule with /I "$(IntDir)" added
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release gvim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\if_ole.idl
+
+!IF "$(CFG)" == "Vim - Win32 Release gvim OLE"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\if_ole.h" : $(SOURCE) "$(INTDIR)"
+ if exist .\if_ole.h del .\if_ole.h
+ midl /out .\oleRel /iid iid_ole.c /tlb vim.tlb /proxy nul /header if_ole.h .\if_ole.idl
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim OLE"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\if_ole.h" : $(SOURCE) "$(INTDIR)"
+ if exist .\if_ole.h del .\if_ole.h
+ midl /out .\oleDbg /iid iid_ole.c /tlb vim.tlb /proxy nul /header if_ole.h .\if_ole.idl
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release gvim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mark.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mbyte.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memfile.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\memline.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\menu.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\message.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc1.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc2.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\move.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\normal.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ops.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\option.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_mswin.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\os_win32.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\quickfix.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\regexp.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\screen.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\search.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\syntax.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\tag.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\term.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\ui.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\undo.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\version.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\vim.rc
+
+!IF "$(CFG)" == "Vim - Win32 Release gvim OLE"
+
+"$(INTDIR)\vim.res" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim OLE"
+
+"$(INTDIR)\vim.res" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\if_ole.h"
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release gvim"
+
+"$(INTDIR)\vim.res" : $(SOURCE) "$(INTDIR)"
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug gvim"
+
+"$(INTDIR)\vim.res" : $(SOURCE) "$(INTDIR)"
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Release vim"
+
+# PROP Exclude_From_Build 1
+
+!ELSEIF "$(CFG)" == "Vim - Win32 Debug vim"
+
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\window.c
+# End Source File
+# End Target
+# End Project
diff --git a/src/Make_manx.mak b/src/Make_manx.mak
new file mode 100644
index 000000000..b7c06e986
--- /dev/null
+++ b/src/Make_manx.mak
@@ -0,0 +1,322 @@
+#
+# Makefile for VIM on the Amiga, using Aztec/Manx C 5.0 or later
+#
+# Note: Not all dependencies are included. This was done to avoid having
+# to compile everything when a global variable or function is added.
+# Careful when changing a global struct or variable!
+#
+
+#>>>>> choose options:
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+DEFINES =
+
+#>>>>> if HAVE_TGETENT is defined obj/termlib.o has to be used
+#TERMLIB = obj/termlib.o
+TERMLIB =
+
+#>>>>> choose between debugging (-bs) or optimizing (-so)
+OPTIONS = -so
+#OPTIONS = -bs
+
+#>>>>> end of choices
+###########################################################################
+
+CFLAGS = $(OPTIONS) -wapruq -ps -qf -Iproto $(DEFINES) -DAMIGA
+
+LIBS = -lc16
+SYMS = vim.syms
+CC = cc
+LN = ln
+LNFLAGS = +q
+SHELL = csh
+REN = $(SHELL) -c mv -f
+DEL = $(SHELL) -c rm -f
+
+SRC = buffer.c \
+ charset.c \
+ diff.c \
+ digraph.c \
+ edit.c \
+ eval.c \
+ ex_cmds.c \
+ ex_cmds2.c \
+ ex_docmd.c \
+ ex_eval.c \
+ ex_getln.c \
+ fileio.c \
+ fold.c \
+ getchar.c \
+ main.c \
+ mark.c \
+ memfile.c \
+ memline.c \
+ menu.c \
+ message.c \
+ misc1.c \
+ misc2.c \
+ move.c \
+ mbyte.c \
+ normal.c \
+ ops.c \
+ option.c \
+ os_amiga.c \
+ quickfix.c \
+ regexp.c \
+ screen.c \
+ search.c \
+ syntax.c \
+ tag.c \
+ term.c \
+ ui.c \
+ undo.c \
+ window.c \
+ version.c
+
+INCL = vim.h feature.h keymap.h macros.h ascii.h term.h structs.h os_amiga.h
+
+OBJ = obj/buffer.o \
+ obj/charset.o \
+ obj/diff.o \
+ obj/digraph.o \
+ obj/edit.o \
+ obj/eval.o \
+ obj/ex_cmds.o \
+ obj/ex_cmds2.o \
+ obj/ex_docmd.o \
+ obj/ex_eval.o \
+ obj/ex_getln.o \
+ obj/fileio.o \
+ obj/fold.o \
+ obj/getchar.o \
+ obj/main.o \
+ obj/mark.o \
+ obj/memfile.o \
+ obj/memline.o \
+ obj/menu.o \
+ obj/message.o \
+ obj/misc1.o \
+ obj/misc2.o \
+ obj/move.o \
+ obj/mbyte.o \
+ obj/normal.o \
+ obj/ops.o \
+ obj/option.o \
+ obj/os_amiga.o \
+ obj/quickfix.o \
+ obj/regexp.o \
+ obj/screen.o \
+ obj/search.o \
+ obj/syntax.o \
+ obj/tag.o \
+ obj/term.o \
+ obj/ui.o \
+ obj/undo.o \
+ obj/window.o \
+ $(TERMLIB)
+
+PRO = proto/buffer.pro \
+ proto/charset.pro \
+ proto/diff.pro \
+ proto/digraph.pro \
+ proto/edit.pro \
+ proto/eval.pro \
+ proto/ex_cmds.pro \
+ proto/ex_cmds2.pro \
+ proto/ex_docmd.pro \
+ proto/ex_eval.pro \
+ proto/ex_getln.pro \
+ proto/fileio.pro \
+ proto/fold.pro \
+ proto/getchar.pro \
+ proto/main.pro \
+ proto/mark.pro \
+ proto/memfile.pro \
+ proto/memline.pro \
+ proto/menu.pro \
+ proto/message.pro \
+ proto/misc1.pro \
+ proto/misc2.pro \
+ proto/move.pro \
+ proto/mbyte.pro \
+ proto/normal.pro \
+ proto/ops.pro \
+ proto/option.pro \
+ proto/os_amiga.pro \
+ proto/quickfix.pro \
+ proto/regexp.pro \
+ proto/screen.pro \
+ proto/search.pro \
+ proto/syntax.pro \
+ proto/tag.pro \
+ proto/term.pro \
+ proto/termlib.pro \
+ proto/ui.pro \
+ proto/undo.pro \
+ proto/window.pro
+
+all: Vim xxd/Xxd
+
+Vim: obj $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c -o obj/version.o
+ $(LN) $(LNFLAGS) -m -o Vim $(OBJ) obj/version.o $(LIBS)
+
+debug: obj $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c -o obj/version.o
+ $(LN) $(LNFLAGS) -m -g -o Vim $(OBJ) obj/version.o $(LIBS)
+
+xxd/Xxd: xxd/xxd.c
+ $(SHELL) -c cd xxd; make -f Make_amiga.mak; cd ..
+
+# Making prototypes with Manx has been removed, because it caused too many
+# problems.
+#proto: $(SYMS) $(PRO)
+
+obj:
+ makedir obj
+
+tags: $(SRC) $(INCL)
+ $(SHELL) -c ctags $(SRC) *.h
+
+# can't use delete here, too many file names
+clean:
+ $(DEL) $(OBJ) obj/version.o \
+ obj/termlib.o Vim $(SYMS) xxd/Xxd
+
+test:
+ $(SHELL) -c cd testdir; make -f Make_amiga.mak; cd ..
+
+$(SYMS): $(INCL) $(PRO)
+ $(CC) $(CFLAGS) -ho$(SYMS) vim.h
+
+###########################################################################
+
+# Unfortunately, Manx's make doesn't understand a .c.o rule, so each
+# compilation command has to be given explicitly.
+
+CCSYM = $(CC) $(CFLAGS) -hi$(SYMS) -o
+CCNOSYM = $(CC) $(CFLAGS) -o
+
+$(OBJ): $(SYMS)
+
+obj/buffer.o: buffer.c
+ $(CCSYM) $@ buffer.c
+
+obj/charset.o: charset.c
+ $(CCSYM) $@ charset.c
+
+obj/diff.o: diff.c
+ $(CCSYM) $@ diff.c
+
+obj/digraph.o: digraph.c
+ $(CCSYM) $@ digraph.c
+
+obj/edit.o: edit.c
+ $(CCSYM) $@ edit.c
+
+obj/eval.o: eval.c
+ $(CCSYM) $@ eval.c
+
+obj/ex_cmds.o: ex_cmds.c
+ $(CCSYM) $@ ex_cmds.c
+
+obj/ex_cmds2.o: ex_cmds2.c
+ $(CCSYM) $@ ex_cmds2.c
+
+# Don't use $(SYMS) here, because ex_docmd.c defines DO_DECLARE_EXCMD
+obj/ex_docmd.o: ex_docmd.c ex_cmds.h
+ $(CCNOSYM) $@ ex_docmd.c
+
+obj/ex_eval.o: ex_eval.c ex_cmds.h
+ $(CCSYM) $@ ex_eval.c
+
+obj/ex_getln.o: ex_getln.c
+ $(CCSYM) $@ ex_getln.c
+
+obj/fileio.o: fileio.c
+ $(CCSYM) $@ fileio.c
+
+obj/fold.o: fold.c
+ $(CCSYM) $@ fold.c
+
+obj/getchar.o: getchar.c
+ $(CCSYM) $@ getchar.c
+
+# Don't use $(SYMS) here, because main.c defines EXTERN
+obj/main.o: main.c option.h globals.h
+ $(CCNOSYM) $@ main.c
+
+obj/mark.o: mark.c
+ $(CCSYM) $@ mark.c
+
+obj/memfile.o: memfile.c
+ $(CCSYM) $@ memfile.c
+
+obj/memline.o: memline.c
+ $(CCSYM) $@ memline.c
+
+obj/menu.o: menu.c
+ $(CCSYM) $@ menu.c
+
+# Don't use $(SYMS) here, because message.c defines MESSAGE_FILE
+obj/message.o: message.c
+ $(CCNOSYM) $@ message.c
+
+obj/misc1.o: misc1.c
+ $(CCSYM) $@ misc1.c
+
+obj/misc2.o: misc2.c
+ $(CCSYM) $@ misc2.c
+
+obj/move.o: move.c
+ $(CCSYM) $@ move.c
+
+obj/mbyte.o: mbyte.c
+ $(CCSYM) $@ mbyte.c
+
+obj/normal.o: normal.c
+ $(CCSYM) $@ normal.c
+
+obj/ops.o: ops.c
+ $(CCSYM) $@ ops.c
+
+# Don't use $(SYMS) here, because option.h defines variables here
+obj/option.o: option.c
+ $(CCNOSYM) $@ option.c
+
+obj/os_amiga.o: os_amiga.c
+ $(CCSYM) $@ os_amiga.c
+
+obj/quickfix.o: quickfix.c
+ $(CCSYM) $@ quickfix.c
+
+obj/regexp.o: regexp.c
+ $(CCSYM) $@ regexp.c
+
+obj/screen.o: screen.c
+ $(CCSYM) $@ screen.c
+
+obj/search.o: search.c
+ $(CCSYM) $@ search.c
+
+obj/syntax.o: syntax.c
+ $(CCSYM) $@ syntax.c
+
+obj/tag.o: tag.c
+ $(CCSYM) $@ tag.c
+
+obj/term.o: term.c term.h
+ $(CCSYM) $@ term.c
+
+obj/termlib.o: termlib.c
+ $(CCSYM) $@ termlib.c
+
+obj/ui.o: ui.c
+ $(CCSYM) $@ ui.c
+
+obj/undo.o: undo.c
+ $(CCSYM) $@ undo.c
+
+obj/window.o: window.c
+ $(CCSYM) $@ window.c
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
new file mode 100644
index 000000000..06780627b
--- /dev/null
+++ b/src/Make_ming.mak
@@ -0,0 +1,555 @@
+# Makefile for VIM on Win32, using 'EGCS/mingw32 1.1.2'.
+# Info at http://www.mingw.org
+# Also requires 'GNU make 3.77', which you can get through a link
+# to 'JanJaap's page from the above page.
+# Get missing libraries from http://gnuwin32.sf.net.
+#
+# Tested on Win32 NT 4 and Win95.
+#
+# To make everything, just 'make -f Make_ming.mak'
+# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'
+# After a run, you can 'make -f Make_ming.mak clean' to clean up
+#
+# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
+# it's just run out of memory or something. Run again, and it will continue
+# with 'xxd'.
+#
+# "make upx" makes *compressed* versions of the GUI and console EXEs, using the
+# excellent UPX compressor:
+# http://upx.sourceforge.net/
+#
+# Maintained by Ron Aaron <ronaharon@yahoo.com>
+# updated 2003 Jan 20
+
+#>>>>> choose options:
+# set to yes for a debug build
+DEBUG=no
+# set to SIZE for size, SPEED for speed, MAXSPEED for maximium optimization
+OPTIMIZE=MAXSPEED
+# set to yes to make gvim, no for vim
+GUI=yes
+# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
+# set to TINY to make minimal version (few features)
+FEATURES=BIG
+# set to one of i386, i486, i586, i686 as the *target* processor
+CPUNR=i686
+# set to same choices as 'CPUNR', but will prevent running on 'lower' cpus:
+ARCH=i386
+# set to yes to cross-compile from unix; no=native Windows
+CROSS=no
+# set to path to iconv.h and libiconv.a to enable using 'iconv.dll'
+#ICONV="."
+ICONV=yes
+GETTEXT=yes
+# set to yes to include multibyte support
+MBYTE=yes
+# set to yes to include IME support
+IME=yes
+DYNAMIC_IME=yes
+# set to yes to enable writing a postscript file with :hardcopy
+POSTSCRIPT=no
+# set to yes to enable OLE support
+OLE=no
+# Set the default $(WINVER) to make it work with pre-Win2k
+WINVER = 0x0400
+# Set to yes to enable Cscope support
+CSCOPE=yes
+# Set to yes to enable Netbeans support
+NETBEANS=$(GUI)
+
+
+# If the user doesn't want gettext, undefine it.
+ifeq (no, $(GETTEXT))
+GETTEXT=
+endif
+# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
+# Uncomment the first line and one of the following three if you want Native Language
+# Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
+# Franco Bez <franco.bez@gmx.de>. It may be found at
+# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
+# Tested with mingw32 with GCC-2.95.2 on Win98
+# Updated 2001 Jun 9
+#GETTEXT=c:/gettext.win32.msvcrt
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
+#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
+SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
+# Alternatively, if you uncomment the two following lines, you get a "safe" version
+# without linking the safe_gettext_dll.o object file.
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#GETTEXT_DYNAMIC=gnu_gettext.dll
+INTLPATH=$(GETTEXT)/lib/mingw32
+INTLLIB=gnu_gettext
+
+# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
+# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
+# uncomment the following, but I can't build a static versión with them, ?-(|
+#GETTEXT=c:/gettext-0.10.37-20010430
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#INTLPATH=$(GETTEXT)/lib
+#INTLLIB=intl
+
+# uncomment 'PERL' if you want a perl-enabled version
+#PERL=C:/perl
+ifdef PERL
+ifndef PERL_VER
+PERL_VER=56
+endif
+ifndef DYNAMIC_PERL
+DYNAMIC_PERL=yes
+endif
+# on Linux, for cross-compile, it's here:
+#PERLLIB=/home/ron/ActivePerl/lib
+# on NT, it's here:
+PERLLIB=$(PERL)/lib
+PERLLIBS=$(PERLLIB)/Core
+endif
+
+# Python support -- works with the ActiveState python 2.0 release (and others
+# too, probably)
+#
+# uncomment 'PYTHON' to make python-enabled version
+# Put the path to the python distro here. If cross compiling from Linux, you
+# will also need to convert the header files to unix instead of dos format:
+# for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
+# and also, you will need to make a mingw32 'libpython20.a' to link with:
+# cd $PYTHON/libs
+# pexports python20.dll > python20.def
+# dlltool -d python20.def -l libpython20.a
+# on my Linux box, I put the Python stuff here:
+#PYTHON=/home/ron/ActivePython-2.0.0-202/src/Core
+# on my NT box, it's here:
+#PYTHON=c:/python20
+
+ifdef PYTHON
+ifndef DYNAMIC_PYTHON
+DYNAMIC_PYTHON=yes
+endif
+
+ifndef PYTHON_VER
+PYTHON_VER=22
+endif
+
+ifeq (no,$(DYNAMIC_PYTHON))
+PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
+endif
+# my include files are in 'win32inc' on Linux, and 'include' in the standard
+# NT distro (ActiveState)
+ifeq ($(CROSS),no)
+PYTHONINC=-I $(PYTHON)/include
+else
+PYTHONINC=-I $(PYTHON)/win32inc
+endif
+endif
+
+# TCL interface:
+# TCL=[Path to TCL directory]
+# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
+# TCL_VER=[TCL version, eg 83, 84] (default is 83)
+#TCL=c:/tcl
+ifdef TCL
+ifndef DYNAMIC_TCL
+DYNAMIC_TCL=yes
+endif
+ifndef TCL_VER
+TCL_VER = 83
+endif
+TCLINC += -I$(TCL)/include
+endif
+
+
+# Ruby interface:
+# RUBY=[Path to Ruby directory]
+# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
+# RUBY_VER=[Ruby version, eg 16, 17] (default is 16)
+# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6)
+# You must set RUBY_VER_LONG when change RUBY_VER.
+#RUBY=c:/ruby
+ifdef RUBY
+ifndef DYNAMIC_RUBY
+DYNAMIC_RUBY=yes
+endif
+# Set default value
+ifndef RUBY_VER
+RUBY_VER = 16
+endif
+ifndef RUBY_VER_LONG
+RUBY_VER_LONG = 1.6
+endif
+
+ifeq ($(RUBY_VER), 16)
+ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i586-mswin32
+endif
+ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
+endif
+else
+ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i386-mswin32
+endif
+ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
+endif
+endif
+
+RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+ifeq (no, $(DYNAMIC_RUBY))
+RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
+endif
+
+endif # RUBY
+
+# See feature.h for a list of options.
+# Any other defines can be included here.
+DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
+ -DHAVE_PATHDEF -DFEAT_$(FEATURES)
+ifeq ($(CROSS),yes)
+# cross-compiler:
+CC = i586-pc-mingw32msvc-gcc
+DEL = rm
+WINDRES = i586-pc-mingw32msvc-windres
+else
+# normal (Windows) compilation:
+CC = gcc
+ifneq (sh.exe, $(SHELL))
+DEL = rm
+DIRSLASH = /
+else
+DEL = del
+DIRSLASH = \\
+endif
+WINDRES = windres
+endif
+
+#>>>>> end of choices
+###########################################################################
+
+CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -mcpu=$(CPUNR) -Wall
+
+ifdef GETTEXT
+DEFINES +=-DHAVE_GETTEXT -DHAVE_LOCALE_H
+GETTEXTINCLUDE = $(GETTEXT)/include
+GETTEXTLIB = $(INTLPATH)
+ifeq (yes, $(GETTEXT))
+DEFINES +=-DDYNAMIC_GETTEXT
+else
+ifdef DYNAMIC_GETTEXT
+DEFINES +=-D$(DYNAMIC_GETTEXT)
+ifdef GETTEXT_DYNAMIC
+DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
+endif
+endif
+endif
+endif
+
+ifdef PERL
+CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -L$(PERLLIBS)
+ifeq (yes, $(DYNAMIC_PERL))
+CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
+endif
+endif
+
+ifdef RUBY
+CFLAGS += -DFEAT_RUBY $(RUBYINC)
+ifeq (yes, $(DYNAMIC_RUBY))
+CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
+CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+endif
+endif
+
+ifdef PYTHON
+CFLAGS += -DFEAT_PYTHON $(PYTHONINC)
+ifeq (yes, $(DYNAMIC_PYTHON))
+CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
+endif
+endif
+
+ifdef TCL
+CFLAGS += -DFEAT_TCL $(TCLINC)
+ifeq (yes, $(DYNAMIC_TCL))
+CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
+endif
+endif
+
+ifeq ($(POSTSCRIPT),yes)
+DEFINES += -DMSWINPS
+endif
+
+ifeq (yes, $(OLE))
+DEFINES += -DFEAT_OLE
+endif
+
+ifeq ($(CSCOPE),yes)
+DEFINES += -DFEAT_CSCOPE
+endif
+
+ifeq ($(NETBEANS),yes)
+DEFINES += -DFEAT_NETBEANS_INTG
+ifeq ($(DEBUG), yes)
+DEFINES += -DNBDEBUG
+NBDEBUG_INCL = nbdebug.h
+NBDEBUG_SRC = nbdebug.c
+endif
+endif
+
+ifdef XPM
+CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include
+endif
+
+ifeq ($(DEBUG),yes)
+CFLAGS += -g -fstack-check
+DEBUG_SUFFIX=d
+else
+ifeq ($(OPTIMIZE), SIZE)
+CFLAGS += -Os
+else
+ifeq ($(OPTIMIZE), MAXSPEED)
+CFLAGS += -O3
+CFLAGS += -fomit-frame-pointer -freg-struct-return -malign-double
+else # SPEED
+CFLAGS += -O2
+endif
+endif
+CFLAGS += -s
+endif
+
+LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32
+GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/os_w32exe.o
+OBJ = \
+ $(OUTDIR)/buffer.o \
+ $(OUTDIR)/charset.o \
+ $(OUTDIR)/diff.o \
+ $(OUTDIR)/digraph.o \
+ $(OUTDIR)/edit.o \
+ $(OUTDIR)/eval.o \
+ $(OUTDIR)/ex_cmds.o \
+ $(OUTDIR)/ex_cmds2.o \
+ $(OUTDIR)/ex_docmd.o \
+ $(OUTDIR)/ex_eval.o \
+ $(OUTDIR)/ex_getln.o \
+ $(OUTDIR)/fileio.o \
+ $(OUTDIR)/fold.o \
+ $(OUTDIR)/getchar.o \
+ $(OUTDIR)/main.o \
+ $(OUTDIR)/mark.o \
+ $(OUTDIR)/memfile.o \
+ $(OUTDIR)/memline.o \
+ $(OUTDIR)/menu.o \
+ $(OUTDIR)/message.o \
+ $(OUTDIR)/misc1.o \
+ $(OUTDIR)/misc2.o \
+ $(OUTDIR)/move.o \
+ $(OUTDIR)/mbyte.o \
+ $(OUTDIR)/normal.o \
+ $(OUTDIR)/ops.o \
+ $(OUTDIR)/option.o \
+ $(OUTDIR)/os_win32.o \
+ $(OUTDIR)/os_mswin.o \
+ $(OUTDIR)/pathdef.o \
+ $(OUTDIR)/quickfix.o \
+ $(OUTDIR)/regexp.o \
+ $(OUTDIR)/screen.o \
+ $(OUTDIR)/search.o \
+ $(OUTDIR)/syntax.o \
+ $(OUTDIR)/tag.o \
+ $(OUTDIR)/term.o \
+ $(OUTDIR)/ui.o \
+ $(OUTDIR)/undo.o \
+ $(OUTDIR)/version.o \
+ $(OUTDIR)/vimrc.o \
+ $(OUTDIR)/window.o
+
+ifdef PERL
+OBJ += $(OUTDIR)/if_perl.o
+endif
+ifdef PYTHON
+OBJ += $(OUTDIR)/if_python.o
+endif
+ifdef RUBY
+OBJ += $(OUTDIR)/if_ruby.o
+endif
+ifdef TCL
+OBJ += $(OUTDIR)/if_tcl.o
+endif
+ifeq ($(CSCOPE),yes)
+OBJ += $(OUTDIR)/if_cscope.o
+endif
+ifeq ($(NETBEANS),yes)
+OBJ += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o
+LIB += -lwsock32
+endif
+ifdef XPM
+OBJ += $(OUTDIR)/xpm_w32.o
+# You'll need libXpm.a from http://gnuwin32.sf.net
+LIB += -L $(XPM)/lib -lXpm
+endif
+
+
+ifeq ($(GUI),yes)
+TARGET := gvim$(DEBUG_SUFFIX).exe
+DEFINES += $(DEF_GUI)
+OBJ += $(GUIOBJ)
+LFLAGS += -mwindows
+OUTDIR = gobj$(DEBUG_SUFFIX)
+else
+TARGET := vim$(DEBUG_SUFFIX).exe
+OUTDIR = obj$(DEBUG_SUFFIX)
+endif
+
+ifdef GETTEXT
+ifneq (yes, $(GETTEXT))
+CFLAGS += -I$(GETTEXTINCLUDE)
+ifndef STATIC_GETTEXT
+LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
+ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
+OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
+endif
+else
+LIB += -L$(GETTEXTLIB) -lintl
+endif
+endif
+endif
+
+ifdef PERL
+ifeq (no, $(DYNAMIC_PERL))
+LIB += -lperl$(PERL_VER)
+endif
+endif
+
+ifdef TCL
+LIB += -L$(TCL)/lib
+ifeq (yes, $(DYNAMIC_TCL))
+LIB += -ltclstub$(TCL_VER)
+else
+LIB += -ltcl$(TCL_VER)
+endif
+endif
+
+ifeq (yes, $(OLE))
+LIB += -loleaut32 -lstdc++
+OBJ += $(OUTDIR)/if_ole.o
+endif
+
+ifeq (yes, $(MBYTE))
+DEFINES += -DFEAT_MBYTE
+endif
+
+ifeq (yes, $(IME))
+DEFINES += -DFEAT_MBYTE_IME
+ifeq (yes, $(DYNAMIC_IME))
+DEFINES += -DDYNAMIC_IME
+else
+LIB += -limm32
+endif
+endif
+
+ifdef ICONV
+ifneq (yes, $(ICONV))
+LIB += -L$(ICONV)
+CFLAGS += -I$(ICONV)
+endif
+DEFINES+=-DDYNAMIC_ICONV
+endif
+
+all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
+
+vimrun.exe: vimrun.c
+ $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
+
+install.exe: dosinst.c
+ $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
+
+uninstal.exe: uninstal.c
+ $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
+
+$(TARGET): $(OUTDIR) $(OBJ)
+ $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(PYTHONLIB) $(RUBYLIB)
+
+upx: exes
+ upx gvim.exe
+ upx vim.exe
+
+xxd/xxd.exe: xxd/xxd.c
+ $(MAKE) -C xxd -f Make_cyg.mak
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ $(MAKE) -C GvimExt -f Make_ming.mak
+
+clean:
+ -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
+ -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
+ -rmdir $(OUTDIR)
+ -$(DEL) *.exe
+ -$(DEL) pathdef.c
+ifdef PERL
+ -$(DEL) if_perl.c
+endif
+ $(MAKE) -C GvimExt -f Make_ming.mak clean
+ $(MAKE) -C xxd -f Make_cyg.mak clean
+
+###########################################################################
+INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
+ structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
+ gui.h
+
+$(OUTDIR)/%.o : %.c $(INCL)
+ $(CC) -c $(CFLAGS) $< -o $@
+
+$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
+ $(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
+
+$(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
+ $(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
+
+$(OUTDIR):
+ mkdir $(OUTDIR)
+
+$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
+
+$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
+ $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
+
+$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
+ $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+ $(CC) $(CFLAGS) -D__IID_DEFINED__ -c -o $(OUTDIR)/if_ole.o if_ole.cpp
+
+$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
+ifeq (16, $(RUBY))
+ $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
+endif
+
+if_perl.c: if_perl.xs typemap
+ perl $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
+ $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
+
+$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
+ $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
+
+pathdef.c: $(INCL)
+ifneq (sh.exe, $(SHELL))
+ @echo creating pathdef.c
+ @echo '/* pathdef.c */' > pathdef.c
+ @echo '#include "vim.h"' >> pathdef.c
+ @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
+ @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
+ @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
+ @echo 'char_u *all_lflags = (char_u *)"$(CC) -s -o $(TARGET) $(LIB) -luuid -lole32 $(PYTHONLIB) $(RUBYLIB)";' >> pathdef.c
+ @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
+ @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
+else
+ @echo creating pathdef.c
+ @echo /* pathdef.c */ > pathdef.c
+ @echo #include "vim.h" >> pathdef.c
+ @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
+ @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
+ @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
+ @echo char_u *all_lflags = (char_u *)"$(CC) -s -o $(TARGET) $(LIB) -luuid -lole32 $(PYTHONLIB) $(RUBYLIB)"; >> pathdef.c
+ @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
+ @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
+endif
diff --git a/src/Make_mint.mak b/src/Make_mint.mak
new file mode 100644
index 000000000..6bcaacb84
--- /dev/null
+++ b/src/Make_mint.mak
@@ -0,0 +1,56 @@
+#
+# Makefile for Vim on MiNT vim:ts=8:sw=8:tw=78
+#
+# This is a wrapper around the Unix Makefile. It is configured to accompany
+# the MiNT distribution of Vim.
+#
+# See "Makefile" for instructions how to run "make".
+#
+# BUT: Always run: "make -f Make_mint.mak config",
+# and then: "make -f Make_mint.mak"!
+# Otherwise the postprocessing won't get done.
+#
+
+### This Makefile has been succesfully tested on these systems.
+### Check the (*) column for remarks, listed below.
+### Later code changes may cause small problems, otherwise Vim is supposed to
+### compile and run without problems.
+
+#system: configurations: version (*) tested by:
+#------------- ------------------------ ------- - ----------
+#MiNT 1.12.5 gcc gcc-2.6.1 3.29 Jens Felderhoff
+#MiNT 1.12.6 gcc gcc-2.6.1 -GUI 4.6b Jens Felderhoff
+#MiNT 1.12.6 gcc gcc-2.6.1 -GUI 4.6 Jens Felderhoff
+
+# set this to the pathname prefix of your symbol link editor, i.e. if it is
+# /usr/local/bin/sym-ld set:
+#
+SYMLDPREFIX = /usr/local/bin/sym-
+#SYMLDPREFIX = /gnu/bin/sym-
+
+POSTPROCESS = fixstk 20k $(VIMTARGET)
+DBGPOSTPROCESS = fixstk 20k $(DBGTARGET)
+DBGLDFLAGS = -B$(SYMLDPREFIX)
+DBGTARGET = $(VIMTARGET).sym
+
+
+# Default target is making the executable and then do the post processing
+all: $(VIMTARGET) $(TOOLS)
+ $(POSTPROCESS)
+
+debug: $(DBGTARGET)
+ $(DBGPOSTPROCESS)
+
+#################### include the Unix Makefile ###############
+
+include Makefile
+
+
+### (M) MiNT with gcc 2.6.1 and gdb 3.5
+CC = gcc -mint
+CFLAGS = -g -O -Iproto
+
+$(DBGTARGET): $(OBJ) version.c version.h
+ $(CC) -c $(ALL_CFLAGS) version.c
+ $(CC) $(LDFLAGS) $(DBGLDFLAGS) -o $(DBGTARGET) -g $(OBJ) \
+ version.o $(ALL_LIBS)
diff --git a/src/Make_morph.mak b/src/Make_morph.mak
new file mode 100644
index 000000000..f9ceb50c5
--- /dev/null
+++ b/src/Make_morph.mak
@@ -0,0 +1,88 @@
+#
+# Makefile for VIM, using MorphOS SDK (gcc 2.95.3)
+#
+
+# Uncomment the following two lines and comment the two after in
+# case you want to play with GVIM MorphOS. But it's still known
+# to not work at all. So meanwhile it's better to stick with VIM.
+
+# GVIM = -DFEAT_GUI_AMIGA
+# GVIMSRC = gui_amiga.c gui.c
+
+GVIM =
+GVIMSRC =
+
+CFLAGS = -c \
+ -pipe \
+ -O2 \
+ -Wall \
+ \
+ -DNO_ARP \
+ -DUSE_TMPNAM \
+ ${GVIM} \
+ \
+ -I proto \
+ \
+ -noixemul
+
+PRG = Vim
+LIBS = -noixemul -s
+CC = gcc
+LD = gcc
+OBJDUMP = objdump
+RM = rm
+
+.c.o:
+ ${CC} ${CFLAGS} $< -o $@
+
+SRC = buffer.c \
+ charset.c \
+ diff.c \
+ digraph.c \
+ edit.c \
+ eval.c \
+ ex_cmds.c \
+ ex_cmds2.c \
+ ex_docmd.c \
+ ex_eval.c \
+ ex_getln.c \
+ fileio.c \
+ fold.c \
+ getchar.c \
+ main.c \
+ mark.c \
+ mbyte.c \
+ memfile.c \
+ memline.c \
+ menu.c \
+ message.c \
+ misc1.c \
+ misc2.c \
+ move.c \
+ normal.c \
+ ops.c \
+ option.c \
+ os_amiga.c \
+ quickfix.c \
+ regexp.c \
+ screen.c \
+ search.c \
+ syntax.c \
+ tag.c \
+ term.c \
+ ui.c \
+ undo.c \
+ version.c \
+ window.c \
+ ${GVIMSRC}
+
+OBJ = $(SRC:.c=.o)
+
+$(PRG): $(OBJ)
+ ${LD} -o $(PRG) $(OBJ) $(LIBS)
+
+dump: $(PRG)
+ $(OBJDUMP) --reloc --disassemble-all $(PRG) > $(PRG).s
+
+clean:
+ $(RM) -fv $(OBJ) $(PRG) $(PRG).s
diff --git a/src/Make_mpw.mak b/src/Make_mpw.mak
new file mode 100644
index 000000000..8a98d68a0
--- /dev/null
+++ b/src/Make_mpw.mak
@@ -0,0 +1,3843 @@
+# File: VIm.make
+# Target: VIm
+# Created: Sunday, December 29, 2000 09:55:14 PM
+
+
+MAKEFILE = VIm.make
+¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
+
+ObjDir = :obj:
+Includes = ¶
+ -i :src:proto:
+CFlags = -w 2,35 -enum int
+Sym-PPC = -sym off
+
+PPCCOptions = {Includes} {CFlags} {Sym-PPC}
+
+
+### Source Files ###
+
+SrcFiles = ¶
+ :src:buffer.c ¶
+ :src:charset.c ¶
+ :src:diff.c ¶
+ :src:digraph.c ¶
+ :src:edit.c ¶
+ :src:eval.c ¶
+ :src:ex_cmds.c ¶
+ :src:ex_cmds2.c ¶
+ :src:ex_docmd.c ¶
+ :src:ex_eval.c ¶
+ :src:ex_getln.c ¶
+ :src:fileio.c ¶
+ :src:fold.c ¶
+ :src:getchar.c ¶
+ :src:gui.c ¶
+ :src:gui_mac.c ¶
+ :src:if_cscope.c ¶
+ :src:main.c ¶
+ :src:mark.c ¶
+ :src:memfile.c ¶
+ :src:memline.c ¶
+ :src:menu.c ¶
+ :src:message.c ¶
+ :src:misc1.c ¶
+ :src:misc2.c ¶
+ :src:move.c ¶
+ :src:multibyte.c ¶
+ :src:normal.c ¶
+ :src:ops.c ¶
+ :src:option.c ¶
+ :src:os_mac.c ¶
+ :src:pty.c ¶
+ :src:quickfix.c ¶
+ :src:regexp.c ¶
+ :src:screen.c ¶
+ :src:search.c ¶
+ :src:syntax.c ¶
+ :src:tag.c ¶
+ :src:term.c ¶
+ :src:termlib.c ¶
+ :src:ui.c ¶
+ :src:undo.c ¶
+ :src:version.c ¶
+ :src:window.c ¶
+ :src:wsdebug.c
+
+
+### Object Files ###
+
+ObjFiles-PPC = ¶
+ "{ObjDir}buffer.c.x" ¶
+ "{ObjDir}charset.c.x" ¶
+ "{ObjDir}diff.c.x" ¶
+ "{ObjDir}digraph.c.x" ¶
+ "{ObjDir}edit.c.x" ¶
+ "{ObjDir}eval.c.x" ¶
+ "{ObjDir}ex_cmds.c.x" ¶
+ "{ObjDir}ex_cmds2.c.x" ¶
+ "{ObjDir}ex_docmd.c.x" ¶
+ "{ObjDir}ex_eval.c.x" ¶
+ "{ObjDir}ex_getln.c.x" ¶
+ "{ObjDir}fileio.c.x" ¶
+ "{ObjDir}fold.c.x" ¶
+ "{ObjDir}getchar.c.x" ¶
+ "{ObjDir}gui.c.x" ¶
+ "{ObjDir}gui_mac.c.x" ¶
+ "{ObjDir}if_cscope.c.x" ¶
+ "{ObjDir}main.c.x" ¶
+ "{ObjDir}mark.c.x" ¶
+ "{ObjDir}memfile.c.x" ¶
+ "{ObjDir}memline.c.x" ¶
+ "{ObjDir}menu.c.x" ¶
+ "{ObjDir}message.c.x" ¶
+ "{ObjDir}misc1.c.x" ¶
+ "{ObjDir}misc2.c.x" ¶
+ "{ObjDir}move.c.x" ¶
+ "{ObjDir}multibyte.c.x" ¶
+ "{ObjDir}normal.c.x" ¶
+ "{ObjDir}ops.c.x" ¶
+ "{ObjDir}option.c.x" ¶
+ "{ObjDir}os_mac.c.x" ¶
+ "{ObjDir}pty.c.x" ¶
+ "{ObjDir}quickfix.c.x" ¶
+ "{ObjDir}regexp.c.x" ¶
+ "{ObjDir}screen.c.x" ¶
+ "{ObjDir}search.c.x" ¶
+ "{ObjDir}syntax.c.x" ¶
+ "{ObjDir}tag.c.x" ¶
+ "{ObjDir}term.c.x" ¶
+ "{ObjDir}termlib.c.x" ¶
+ "{ObjDir}ui.c.x" ¶
+ "{ObjDir}undo.c.x" ¶
+ "{ObjDir}version.c.x" ¶
+ "{ObjDir}window.c.x" ¶
+ "{ObjDir}wsdebug.c.x"
+
+
+### Libraries ###
+
+LibFiles-PPC = ¶
+ "{SharedLibraries}InterfaceLib" ¶
+ "{SharedLibraries}MathLib" ¶
+ "{SharedLibraries}StdCLib" ¶
+ "{PPCLibraries}StdCRuntime.o" ¶
+ "{PPCLibraries}PPCStdCLib.o" ¶
+ "{PPCLibraries}PPCCRuntime.o" ¶
+ "{PPCLibraries}PPCToolLibs.o"
+
+
+### Default Rules ###
+
+.c.x Ä .c {¥MondoBuild¥}
+ {PPCC} {depDir}{default}.c -o {targDir}{default}.c.x {PPCCOptions}
+
+
+### Build Rules ###
+
+VIm ÄÄ {ObjFiles-PPC} {LibFiles-PPC} {¥MondoBuild¥}
+ PPCLink ¶
+ -o {Targ} ¶
+ {ObjFiles-PPC} ¶
+ {LibFiles-PPC} ¶
+ {Sym-PPC} ¶
+ -mf -d ¶
+ -t 'APPL' ¶
+ -c 'VIM!'
+
+
+
+### Required Dependencies ###
+
+"{ObjDir}buffer.c.x" Ä :src:buffer.c
+"{ObjDir}charset.c.x" Ä :src:charset.c
+"{ObjDir}diff.c.x" Ä :src:diff.c
+"{ObjDir}digraph.c.x" Ä :src:digraph.c
+"{ObjDir}edit.c.x" Ä :src:edit.c
+"{ObjDir}eval.c.x" Ä :src:eval.c
+"{ObjDir}ex_cmds.c.x" Ä :src:ex_cmds.c
+"{ObjDir}ex_cmds2.c.x" Ä :src:ex_cmds2.c
+"{ObjDir}ex_docmd.c.x" Ä :src:ex_docmd.c
+"{ObjDir}ex_eval.c.x" Ä :src:ex_eval.c
+"{ObjDir}ex_getln.c.x" Ä :src:ex_getln.c
+"{ObjDir}fileio.c.x" Ä :src:fileio.c
+"{ObjDir}fold.c.x" Ä :src:fold.c
+"{ObjDir}getchar.c.x" Ä :src:getchar.c
+"{ObjDir}gui.c.x" Ä :src:gui.c
+"{ObjDir}gui_mac.c.x" Ä :src:gui_mac.c
+"{ObjDir}if_cscope.c.x" Ä :src:if_cscope.c
+"{ObjDir}main.c.x" Ä :src:main.c
+"{ObjDir}mark.c.x" Ä :src:mark.c
+"{ObjDir}memfile.c.x" Ä :src:memfile.c
+"{ObjDir}memline.c.x" Ä :src:memline.c
+"{ObjDir}menu.c.x" Ä :src:menu.c
+"{ObjDir}message.c.x" Ä :src:message.c
+"{ObjDir}misc1.c.x" Ä :src:misc1.c
+"{ObjDir}misc2.c.x" Ä :src:misc2.c
+"{ObjDir}move.c.x" Ä :src:move.c
+"{ObjDir}multibyte.c.x" Ä :src:multibyte.c
+"{ObjDir}normal.c.x" Ä :src:normal.c
+"{ObjDir}ops.c.x" Ä :src:ops.c
+"{ObjDir}option.c.x" Ä :src:option.c
+"{ObjDir}os_mac.c.x" Ä :src:os_mac.c
+"{ObjDir}pty.c.x" Ä :src:pty.c
+"{ObjDir}quickfix.c.x" Ä :src:quickfix.c
+"{ObjDir}regexp.c.x" Ä :src:regexp.c
+"{ObjDir}screen.c.x" Ä :src:screen.c
+"{ObjDir}search.c.x" Ä :src:search.c
+"{ObjDir}syntax.c.x" Ä :src:syntax.c
+"{ObjDir}tag.c.x" Ä :src:tag.c
+"{ObjDir}term.c.x" Ä :src:term.c
+"{ObjDir}termlib.c.x" Ä :src:termlib.c
+"{ObjDir}ui.c.x" Ä :src:ui.c
+"{ObjDir}undo.c.x" Ä :src:undo.c
+"{ObjDir}version.c.x" Ä :src:version.c
+"{ObjDir}window.c.x" Ä :src:window.c
+"{ObjDir}wsdebug.c.x" Ä :src:wsdebug.c
+
+
+### Optional Dependencies ###
+### Build this target to generate "include file" dependencies. ###
+
+Dependencies Ä $OutOfDate
+ MakeDepend ¶
+ -append {MAKEFILE} ¶
+ -ignore "{CIncludes}" ¶
+ -objdir "{ObjDir}" ¶
+ -objext .x ¶
+ {Includes} ¶
+ {SrcFiles}
+
+
+#*** Dependencies: Cut here ***
+# These dependencies were produced at 12:17:02 Uhr on Fre, 29. Dez 2000 by MakeDepend
+
+:obj:buffer.c.x Ä ¶
+ :src:buffer.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:charset.c.x Ä ¶
+ :src:charset.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:diff.c.x Ä ¶
+ :src:diff.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:digraph.c.x Ä ¶
+ :src:digraph.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:edit.c.x Ä ¶
+ :src:edit.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:eval.c.x Ä ¶
+ :src:eval.c ¶
+ :src:vim.h ¶
+ :src:version.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ex_cmds.c.x Ä ¶
+ :src:ex_cmds.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ex_cmds2.c.x Ä ¶
+ :src:ex_cmds2.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ex_docmd.c.x Ä ¶
+ :src:ex_docmd.c ¶
+ :src:vim.h ¶
+ :src:ex_cmds.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ex_eval.c.x Ä ¶
+ :src:ex_eval.c ¶
+ :src:vim.h ¶
+ :src:ex_cmds.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ex_getln.c.x Ä ¶
+ :src:ex_getln.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:fileio.c.x Ä ¶
+ :src:fileio.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:fold.c.x Ä ¶
+ :src:fold.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:getchar.c.x Ä ¶
+ :src:getchar.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:gui.c.x Ä ¶
+ :src:gui.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:gui_mac.c.x Ä ¶
+ :src:gui_mac.c ¶
+ :src:vim.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:farsi.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:src:gui_mac.r Ä ¶
+ :src:gui_mac.r ¶
+ "{RIncludes}"SysTypes.r ¶
+ "{RIncludes}"Types.r ¶
+ :src:version.h ¶
+ "{RIncludes}"Fonts.r ¶
+ "{RIncludes}"IntlResources.r ¶
+ "{RIncludes}"Sound.r ¶
+ "{RIncludes}"ConditionalMacros.r ¶
+ "{RIncludes}"MacTypes.r ¶
+ "{RIncludes}"Controls.r ¶
+ "{RIncludes}"ControlDefinitions.r ¶
+ "{RIncludes}"MacWindows.r ¶
+ "{RIncludes}"Dialogs.r ¶
+ "{RIncludes}"Menus.r ¶
+ "{RIncludes}"Icons.r ¶
+ "{RIncludes}"Finder.r ¶
+ "{RIncludes}"Quickdraw.r ¶
+ "{RIncludes}"Processes.r ¶
+ "{RIncludes}"AppleEvents.r ¶
+ "{RIncludes}"Script.r ¶
+ "{RIncludes}"Collections.r ¶
+ "{RIncludes}"PictUtils.r ¶
+ "{RIncludes}"AEDataModel.r
+
+:obj:if_cscope.c.x Ä ¶
+ :src:if_cscope.c ¶
+ :src:vim.h ¶
+ :src:if_cscope.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:main.c.x Ä ¶
+ :src:main.c ¶
+ :src:vim.h ¶
+ :src:farsi.c ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:mark.c.x Ä ¶
+ :src:mark.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:memfile.c.x Ä ¶
+ :src:memfile.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:memline.c.x Ä ¶
+ :src:memline.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:menu.c.x Ä ¶
+ :src:menu.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:message.c.x Ä ¶
+ :src:message.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:misc1.c.x Ä ¶
+ :src:misc1.c ¶
+ :src:vim.h ¶
+ :src:version.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:misc2.c.x Ä ¶
+ :src:misc2.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:move.c.x Ä ¶
+ :src:move.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:multibyte.c.x Ä ¶
+ :src:multibyte.c ¶
+ :src:vim.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:farsi.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:normal.c.x Ä ¶
+ :src:normal.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ops.c.x Ä ¶
+ :src:ops.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:option.c.x Ä ¶
+ :src:option.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:os_mac.c.x Ä ¶
+ :src:os_mac.c ¶
+ :src:vim.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:farsi.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:pty.c.x Ä ¶
+ :src:pty.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:quickfix.c.x Ä ¶
+ :src:quickfix.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:regexp.c.x Ä ¶
+ :src:regexp.c ¶
+ :src:vim.h ¶
+ :src:option.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:screen.c.x Ä ¶
+ :src:screen.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:search.c.x Ä ¶
+ :src:search.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:syntax.c.x Ä ¶
+ :src:syntax.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:tag.c.x Ä ¶
+ :src:tag.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:term.c.x Ä ¶
+ :src:term.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:termlib.c.x Ä ¶
+ :src:termlib.c ¶
+ :src:vim.h ¶
+ :src:proto:termlib.pro ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:ui.c.x Ä ¶
+ :src:ui.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:undo.c.x Ä ¶
+ :src:undo.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:version.c.x Ä ¶
+ :src:version.c ¶
+ :src:vim.h ¶
+ :src:version.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:window.c.x Ä ¶
+ :src:window.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
+
+:obj:wsdebug.c.x Ä ¶
+ :src:wsdebug.c ¶
+ :src:vim.h ¶
+ :src:auto:config.h ¶
+ :src:feature.h ¶
+ :src:os_unix.h ¶
+ :src:os_mac.h ¶
+ :src:workshop.h ¶
+ :src:ascii.h ¶
+ :src:keymap.h ¶
+ :src:term.h ¶
+ :src:macros.h ¶
+ :src:structs.h ¶
+ :src:globals.h ¶
+ :src:option.h ¶
+ :src:ex_cmds.h ¶
+ :src:proto.h ¶
+ :src:integration.h ¶
+ :src:wsdebug.h ¶
+ :src:regexp.h ¶
+ :src:gui.h ¶
+ :src:farsi.h ¶
+ :src:proto:os_unix.pro ¶
+ :src:proto:os_mac.pro ¶
+ :src:proto:buffer.pro ¶
+ :src:proto:charset.pro ¶
+ :src:proto:if_cscope.pro ¶
+ :src:proto:diff.pro ¶
+ :src:proto:digraph.pro ¶
+ :src:proto:edit.pro ¶
+ :src:proto:eval.pro ¶
+ :src:proto:ex_cmds.pro ¶
+ :src:proto:ex_cmds2.pro ¶
+ :src:proto:ex_docmd.pro ¶
+ :src:proto:ex_eval.pro ¶
+ :src:proto:ex_getln.pro ¶
+ :src:proto:fileio.pro ¶
+ :src:proto:fold.pro ¶
+ :src:proto:getchar.pro ¶
+ :src:proto:hangulin.pro ¶
+ :src:proto:main.pro ¶
+ :src:proto:mark.pro ¶
+ :src:proto:memfile.pro ¶
+ :src:proto:memline.pro ¶
+ :src:proto:menu.pro ¶
+ :src:proto:message.pro ¶
+ :src:proto:misc1.pro ¶
+ :src:proto:misc2.pro ¶
+ :src:proto:move.pro ¶
+ :src:proto:multibyte.pro ¶
+ :src:proto:normal.pro ¶
+ :src:proto:ops.pro ¶
+ :src:proto:option.pro ¶
+ :src:proto:quickfix.pro ¶
+ :src:proto:regexp.pro ¶
+ :src:proto:screen.pro ¶
+ :src:proto:search.pro ¶
+ :src:proto:syntax.pro ¶
+ :src:proto:tag.pro ¶
+ :src:proto:term.pro ¶
+ :src:proto:termlib.pro ¶
+ :src:proto:ui.pro ¶
+ :src:proto:undo.pro ¶
+ :src:proto:version.pro ¶
+ :src:proto:window.pro ¶
+ :src:proto:if_python.pro ¶
+ :src:proto:if_tcl.pro ¶
+ :src:proto:if_ruby.pro ¶
+ :src:proto:gui.pro ¶
+ :src:proto:pty.pro ¶
+ :src:proto:gui_gtk.pro ¶
+ :src:proto:gui_gtk_x11.pro ¶
+ :src:proto:gui_motif.pro ¶
+ :src:proto:gui_athena.pro ¶
+ :src:proto:gui_mac.pro ¶
+ :src:proto:gui_x11.pro ¶
+ :src:proto:workshop.pro ¶
+ :src:proto:if_perl.pro ¶
+ :src:proto:if_perlsfio.pro
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
new file mode 100644
index 000000000..8ee77b63c
--- /dev/null
+++ b/src/Make_mvc.mak
@@ -0,0 +1,888 @@
+# Makefile for Vim on Win32 (Windows NT and Windows 95), using the
+# Microsoft Visual C++ 2.x and MSVC 4.x compilers (or newer).
+# It builds on Windows 95 and all four NT platforms: i386, Alpha, MIPS, and
+# PowerPC. The NT/i386 binary and the Windows 95 binary are identical.
+#
+# This makefile can build the console, GUI, OLE-enable, Perl-enabled and
+# Python-enabled versions of vim for Win32 platforms.
+#
+# When compiling different versions, do "nmake clean" first!
+#
+# The basic command line to build vim is:
+# nmake -f Make_mvc.mak
+# This will build the console version of vim with no additional interfaces.
+# To add interfaces, define any of the following:
+# GUI interface: GUI=yes (default is no)
+# OLE interface: OLE=yes (usually with GUI=yes)
+# Multibyte support: MBYTE=yes
+# IME support: IME=yes (requires GUI=yes)
+# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
+# is yes)
+# Global IME support: GIME=yes (requires GUI=yes)
+# Perl interface:
+# PERL=[Path to Perl directory]
+# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
+# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc] (default is 56)
+# Python interface:
+# PYTHON=[Path to Python directory]
+# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
+# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
+# Ruby interface:
+# RUBY=[Path to Ruby directory]
+# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
+# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
+# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
+# You must set RUBY_VER_LONG when change RUBY_VER.
+# Tcl interface:
+# TCL=[Path to Tcl directory]
+# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
+# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
+# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
+# You must set TCL_VER_LONG when you set TCL_VER.
+# Debug version: DEBUG=yes
+# Mapfile: MAP=[no, yes or lines] (default is yes)
+# no: Don't write a mapfile.
+# yes: Write a normal mapfile.
+# lines: Write a mapfile with line numbers (only for VC6 and later)
+# SNiFF+ interface: SNIFF=yes
+# Cscope support: CSCOPE=yes
+# Iconv library support (always dynamically loaded):
+# ICONV=[yes or no] (default is yes)
+# Intl library support (always dynamically loaded):
+# GETTEXT=[yes or no] (default is yes)
+# See http://sourceforge.net/projects/gettext/
+# PostScript printing: POSTSCRIPT=yes (default is no)
+# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, or HUGE] (default is BIG)
+# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
+# Processor Version: CPUNR=[i386, i486, i586, i686] (default is i386)
+# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
+# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
+# XPM Image Support: XPM=[path to XPM directory]
+#
+# You can combine any of these interfaces
+#
+# Example: To build the non-debug, GUI version with Perl interface:
+# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
+#
+# To build using Borland C++, use Make_bc3.mak or Make_bc5.mak.
+#
+# DEBUG with Make_mvc.mak and Make_dvc.mak:
+# This makefile gives a fineness of control which is not supported in
+# Visual C++ configuration files. Therefore, debugging requires a bit of
+# extra work.
+# Make_dvc.mak is a Visual C++ project to access that support.
+# To use Make_dvc.mak:
+# 1) Build Vim with Make_mvc.mak.
+# Use a "DEBUG=yes" argument to build Vim with debug support.
+# E.g. the following builds gvimd.exe:
+# nmake -f Make_mvc.mak debug=yes gui=yes
+# 2) Use MS Devstudio and set it up to allow that file to be debugged:
+# i) Pass Make_dvc.mak to the IDE.
+# Use the "open workspace" menu entry to load Make_dvc.mak.
+# Alternatively, from the command line:
+# msdev /nologo Make_dvc.mak
+# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
+# this and offer to convert it to their own format. Accept that.
+# It creates a file called Make_dvc.dsw which can then be used
+# for further operations. E.g.
+# msdev /nologo Make_dvc.dsw
+# ii) Set the built executable for debugging:
+# a) Alt+F7/Debug takes you to the Debug dialog.
+# b) Fill "Executable for debug session". e.g. gvimd.exe
+# c) Fill "Program arguments". e.g. -R dosinst.c
+# d) Complete the dialog
+# 3) You can now debug the executable you built with Make_mvc.mak
+#
+# Note: Make_dvc.mak builds vimrun.exe, because it must build something
+# to be a valid makefile..
+
+### See feature.h for a list of optionals.
+# If you want to build some optional features without modifying the source,
+# you can set DEFINES on the command line, e.g.,
+# nmake -f makefile.mvc "DEFINES=-DEMACS_TAGS"
+
+# Build on both Windows NT and Windows 95
+
+TARGETOS = BOTH
+
+# Select one of eight object code directories, depends on GUI, OLE and DEBUG.
+# If you change something else, do "make clean" first!
+!if "$(GUI)" == "yes"
+OBJDIR = .\ObjG
+!else
+OBJDIR = .\ObjC
+!endif
+!if "$(OLE)" == "yes"
+OBJDIR = $(OBJDIR)O
+!endif
+!if "$(DEBUG)" == "yes"
+OBJDIR = $(OBJDIR)d
+!endif
+
+# ntwin32.mak requires that CPU be set appropriately
+
+!ifdef PROCESSOR_ARCHITECTURE
+# We're on Windows NT or using VC 6
+CPU = $(PROCESSOR_ARCHITECTURE)
+! if "$(CPU)" == "x86"
+CPU = i386
+! endif
+!else # !PROCESSOR_ARCHITECTURE
+# We're on Windows 95
+CPU = i386
+!endif # !PROCESSOR_ARCHITECTURE
+
+
+# Build a retail version by default
+
+!if "$(DEBUG)" != "yes"
+NODEBUG = 1
+!else
+MAKEFLAGS_GVIMEXT = DEBUG=yes
+!endif
+
+
+# Build a multithreaded version for the Windows 95 dead keys hack
+# Commented out because it doesn't work.
+# MULTITHREADED = 1
+
+
+# Get all sorts of useful, standard macros from the SDK. (Note that
+# MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
+# directory, but you can find it in \msvc20\include on the CD-ROM.
+# You may also need <win32.mak> from the same place.)
+
+!include <ntwin32.mak>
+
+
+#>>>>> path of the compiler and linker; name of include and lib directories
+# PATH = c:\msvc20\bin;$(PATH)
+# INCLUDE = c:\msvc20\include
+# LIB = c:\msvc20\lib
+
+!ifndef CTAGS
+CTAGS = ctags
+!endif
+
+!if "$(SNIFF)" == "yes"
+# SNIFF - Include support for SNiFF+.
+SNIFF_INCL = if_sniff.h
+SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
+SNIFF_LIB = shell32.lib
+SNIFF_DEFS = -DFEAT_SNIFF
+# The SNiFF integration needs multithreaded libraries!
+MULTITHREADED = yes
+!endif
+
+!ifndef CSCOPE
+CSCOPE = yes
+!endif
+
+!if "$(CSCOPE)" == "yes"
+# CSCOPE - Include support for Cscope
+CSCOPE_INCL = if_cscope.h
+CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
+CSCOPE_DEFS = -DFEAT_CSCOPE
+!endif
+
+!ifndef NETBEANS
+NETBEANS = $(GUI)
+!endif
+
+!if "$(NETBEANS)" == "yes"
+# NETBEANS - Include support for Netbeans integration
+NETBEANS_PRO = proto/netbeans.pro
+NETBEANS_OBJ = $(OBJDIR)/netbeans.obj $(OBJDIR)/gui_beval.obj
+NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
+!if "$(DEBUG)" == "yes"
+NBDEBUG_DEFS = -DNBDEBUG
+NBDEBUG_INCL = nbdebug.h
+NBDEBUG_SRC = nbdebug.c
+!endif
+NETBEANS_LIB = WSock32.lib
+!endif
+
+!ifdef XPM
+# XPM - Include support for XPM signs
+# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
+XPM_OBJ = $(OBJDIR)/xpm_w32.obj
+XPM_DEFS = -DFEAT_XPM_W32
+XPM_LIB = $(XPM)\lib\libXpm.lib
+XPM_INC = -I $(XPM)\include
+!endif
+
+!if defined(USE_MSVCRT)
+CVARS = $(cvarsdll)
+!elseif defined(MULTITHREADED)
+CVARS = $(cvarsmt)
+!else
+CVARS = $(cvars)
+!endif
+
+# need advapi32.lib for GetUserName()
+# need shell32.lib for ExtractIcon()
+# gdi32.lib and comdlg32.lib for printing support
+# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
+CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
+!if "$(VC6)" == "yes"
+CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
+!endif
+
+### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
+# When set to 0x0500 ":browse" stops working.
+!ifndef WINVER
+WINVER = 0x0400
+!endif
+
+# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
+# default, use these lines.
+#VIMRCLOC = somewhere
+#VIMRUNTIMEDIR = somewhere
+
+CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
+ $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
+ $(NBDEBUG_DEFS) $(XPM_DEFS) \
+ $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
+
+#>>>>> end of choices
+###########################################################################
+
+!ifdef OS
+OS_TYPE = winnt
+DEL_TREE = rmdir /s /q
+!else
+OS_TYPE = win95
+DEL_TREE = deltree /y
+!endif
+
+INTDIR=$(OBJDIR)
+OUTDIR=$(OBJDIR)
+
+# Convert processor ID to MVC-compatible number
+!if "$(CPUNR)" == "i386"
+CPUARG = /G3
+!elseif "$(CPUNR)" == "i486"
+CPUARG = /G4
+!elseif "$(CPUNR)" == "i586"
+CPUARG = /G5
+!elseif "$(CPUNR)" == "i686"
+CPUARG = /G6
+!else
+CPUARG =
+!endif
+
+!ifdef NODEBUG
+VIM = vim
+!if "$(OPTIMIZE)" == "SPACE"
+OPTFLAG = /O1
+!elseif "$(OPTIMIZE)" == "SPEED"
+OPTFLAG = /O2
+!else # MAXSPEED
+OPTFLAG = /Ox
+!endif
+CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG /Zi $(CPUARG)
+RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
+PDB = /Fd$(OUTDIR)/
+LINK_PDB = /PDB:$(OUTDIR)/
+! ifdef USE_MSVCRT
+CFLAGS = $(CFLAGS) -MD
+LIBC = msvcrt.lib
+! elseif defined(MULTITHREADED)
+LIBC = libcmt.lib
+! else
+LIBC = libc.lib
+! endif
+!else # DEBUG
+VIM = vimd
+# MSVC 4.1
+PDB = /Fd$(OUTDIR)/
+LINK_PDB = /PDB:$(OUTDIR)/
+# MSVC 2.2
+# PDB = /Fd$(OUTDIR)/vim.pdb
+# LINK_PDB = /PDB:$(OUTDIR)/vim.pdb
+CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Zi /Od
+RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
+# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
+! if "$(_NMAKE_VER)" == ""
+LIBC =
+! else
+LIBC = /fixed:no
+! endif
+
+! ifndef USE_MSVCRT
+LIBC = $(LIBC) libcd.lib
+! else
+CFLAGS = $(CFLAGS) -MDd
+LIBC = $(LIBC) msvcrtd.lib
+! endif
+!endif # DEBUG
+
+INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
+ proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
+ $(NBDEBUG_INCL)
+
+OBJ = \
+ $(OUTDIR)\buffer.obj \
+ $(OUTDIR)\charset.obj \
+ $(OUTDIR)\diff.obj \
+ $(OUTDIR)\digraph.obj \
+ $(OUTDIR)\edit.obj \
+ $(OUTDIR)\eval.obj \
+ $(OUTDIR)\ex_cmds.obj \
+ $(OUTDIR)\ex_cmds2.obj \
+ $(OUTDIR)\ex_docmd.obj \
+ $(OUTDIR)\ex_eval.obj \
+ $(OUTDIR)\ex_getln.obj \
+ $(OUTDIR)\fileio.obj \
+ $(OUTDIR)\fold.obj \
+ $(OUTDIR)\getchar.obj \
+ $(OUTDIR)\main.obj \
+ $(OUTDIR)\mark.obj \
+ $(OUTDIR)\mbyte.obj \
+ $(OUTDIR)\memfile.obj \
+ $(OUTDIR)\memline.obj \
+ $(OUTDIR)\menu.obj \
+ $(OUTDIR)\message.obj \
+ $(OUTDIR)\misc1.obj \
+ $(OUTDIR)\misc2.obj \
+ $(OUTDIR)\move.obj \
+ $(OUTDIR)\normal.obj \
+ $(OUTDIR)\ops.obj \
+ $(OUTDIR)\option.obj \
+ $(OUTDIR)\os_mswin.obj \
+ $(OUTDIR)\os_win32.obj \
+ $(OUTDIR)\pathdef.obj \
+ $(OUTDIR)\quickfix.obj \
+ $(OUTDIR)\regexp.obj \
+ $(OUTDIR)\screen.obj \
+ $(OUTDIR)\search.obj \
+ $(OUTDIR)\syntax.obj \
+ $(OUTDIR)\tag.obj \
+ $(OUTDIR)\term.obj \
+ $(OUTDIR)\ui.obj \
+ $(OUTDIR)\undo.obj \
+ $(OUTDIR)\window.obj \
+ $(OUTDIR)\vim.res
+
+!if "$(OLE)" == "yes"
+CFLAGS = $(CFLAGS) -DFEAT_OLE
+RCFLAGS = $(RCFLAGS) -DFEAT_OLE
+OLE_OBJ = $(OUTDIR)\if_ole.obj
+OLE_IDL = if_ole.idl
+OLE_LIB = oleaut32.lib
+!endif
+
+!if "$(IME)" == "yes"
+CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
+!ifndef DYNAMIC_IME
+DYNAMIC_IME = yes
+!endif
+!if "$(DYNAMIC_IME)" == "yes"
+CFLAGS = $(CFLAGS) -DDYNAMIC_IME
+!else
+IME_LIB = imm32.lib
+!endif
+!endif
+
+!if "$(GIME)" == "yes"
+CFLAGS = $(CFLAGS) -DGLOBAL_IME
+OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
+MBYTE = yes
+!endif
+
+!if "$(MBYTE)" == "yes"
+CFLAGS = $(CFLAGS) -DFEAT_MBYTE
+!endif
+
+!if "$(GUI)" == "yes"
+SUBSYSTEM = windows
+CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
+RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
+VIM = g$(VIM)
+GUI_INCL = \
+ gui.h \
+ regexp.h \
+ ascii.h \
+ ex_cmds.h \
+ farsi.h \
+ feature.h \
+ globals.h \
+ keymap.h \
+ macros.h \
+ option.h \
+ os_dos.h \
+ os_win32.h
+GUI_OBJ = \
+ $(OUTDIR)\gui.obj \
+ $(OUTDIR)\gui_w32.obj \
+ $(OUTDIR)\os_w32exe.obj
+GUI_LIB = \
+ oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
+ winspool.lib comctl32.lib advapi32.lib shell32.lib \
+ /machine:$(CPU) /nodefaultlib
+!else
+SUBSYSTEM = console
+!endif
+
+# iconv.dll library (dynamically loaded)
+!ifndef ICONV
+ICONV = yes
+!endif
+!if "$(ICONV)" == "yes"
+CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
+!endif
+
+# libintl.dll library
+!ifndef GETTEXT
+GETTEXT = yes
+!endif
+!if "$(GETTEXT)" == "yes"
+CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
+!endif
+
+# TCL interface
+!ifdef TCL
+!ifndef TCL_VER
+TCL_VER = 83
+TCL_VER_LONG = 8.3
+!endif
+!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
+!if "$(DYNAMIC_TCL)" == "yes"
+!message Tcl DLL will be loaded dynamically
+TCL_DLL = tcl$(TCL_VER).dll
+CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
+TCL_OBJ = $(OUTDIR)\if_tcl.obj
+TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
+TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
+!else
+CFLAGS = $(CFLAGS) -DFEAT_TCL
+TCL_OBJ = $(OUTDIR)\if_tcl.obj
+TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
+TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
+!endif
+!endif
+
+# PYTHON interface
+!ifdef PYTHON
+!ifndef PYTHON_VER
+PYTHON_VER = 22
+!endif
+!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
+!if "$(DYNAMIC_PYTHON)" == "yes"
+!message Python DLL will be loaded dynamically
+!endif
+CFLAGS = $(CFLAGS) -DFEAT_PYTHON
+PYTHON_OBJ = $(OUTDIR)\if_python.obj
+PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
+!if "$(DYNAMIC_PYTHON)" == "yes"
+CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
+PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
+!else
+PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
+!endif
+!endif
+
+# Perl interface
+!ifdef PERL
+!ifndef PERL_VER
+PERL_VER = 56
+!endif
+!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
+!if "$(DYNAMIC_PERL)" == "yes"
+!if $(PERL_VER) >= 56
+!message Perl DLL will be loaded dynamically
+!else
+!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
+!message Reverting to static loading...
+!undef DYNAMIC_PERL
+!endif
+!endif
+
+# Is Perl installed in architecture-specific directories?
+!if exist($(PERL)\Bin\MSWin32-x86)
+PERL_ARCH = \MSWin32-x86
+!endif
+
+PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
+
+# Version-dependent stuff
+!if $(PERL_VER) == 55
+PERL_LIB = $(PERL_INCDIR)\perl.lib
+!else
+PERL_DLL = perl$(PERL_VER).dll
+PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
+!endif
+
+CFLAGS = $(CFLAGS) -DFEAT_PERL
+
+# Do we want to load Perl dynamically?
+!if "$(DYNAMIC_PERL)" == "yes"
+CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
+!undef PERL_LIB
+!endif
+
+PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
+PERL_INC = /I $(PERL_INCDIR)
+PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
+XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
+XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
+
+!endif
+
+#
+# Support Ruby interface
+#
+!ifdef RUBY
+# Set default value
+!ifndef RUBY_VER
+RUBY_VER = 18
+!endif
+!ifndef RUBY_VER_LONG
+RUBY_VER_LONG = 1.8
+!endif
+
+!if $(RUBY_VER) >= 18
+!ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i386-mswin32
+!endif
+!ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
+!endif
+!else
+!ifndef RUBY_PLATFORM
+RUBY_PLATFORM = i586-mswin32
+!endif
+!ifndef RUBY_INSTALL_NAME
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
+!endif
+!endif # $(RUBY_VER) >= 18
+
+!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
+CFLAGS = $(CFLAGS) -DFEAT_RUBY
+RUBY_OBJ = $(OUTDIR)\if_ruby.obj
+RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
+RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
+# Do we want to load Ruby dynamically?
+!if "$(DYNAMIC_RUBY)" == "yes"
+!message Ruby DLL will be loaded dynamically
+CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+!undef RUBY_LIB
+!endif
+!endif # RUBY
+
+#
+# Support PostScript printing
+#
+!if "$(POSTSCRIPT)" == "yes"
+CFLAGS = $(CFLAGS) -DMSWINPS
+!endif # POSTSCRIPT
+
+#
+# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
+#
+!if "$(FEATURES)"==""
+FEATURES = BIG
+!endif
+CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
+
+#
+# End extra featuare include
+#
+!message
+
+conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
+
+!IF "$(MAP)" == "yes"
+# "/map" is for debugging
+conflags = $(conflags) /map
+!ELSEIF "$(MAP)" == "lines"
+# "/mapinfo:lines" is for debugging, only works for VC6 and later
+conflags = $(conflags) /map /mapinfo:lines
+!ENDIF
+
+LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
+LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
+ $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
+ $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+
+all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
+
+$(VIM): $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
+ $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
+ $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
+ $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
+ $(OUTDIR)\version.obj $(LINKARGS2)
+
+$(VIM).exe: $(VIM)
+
+$(OUTDIR):
+ if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
+
+install.exe: dosinst.c
+ $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
+ - if exist install.exe del install.exe
+ ren dosinst.exe install.exe
+
+uninstal.exe: uninstal.c
+ $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
+
+vimrun.exe: vimrun.c
+ $(CC) /nologo -DNDEBUG vimrun.c
+
+xxd/xxd.exe: xxd/xxd.c
+ cd xxd
+ $(MAKE) /NOLOGO -f Make_mvc.mak
+ cd ..
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+ cd GvimExt
+ $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
+ cd ..
+
+
+tags: notags
+ $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
+
+notags:
+ - if exist tags del tags
+
+clean:
+ - $(DEL_TREE) $(OUTDIR) auto
+ - if exist *.obj del *.obj
+ - if exist $(VIM).exe del $(VIM).exe
+ - if exist $(VIM).ilk del $(VIM).ilk
+ - if exist $(VIM).pdb del $(VIM).pdb
+ - if exist $(VIM).map del $(VIM).map
+ - if exist $(VIM).ncb del $(VIM).ncb
+ - if exist vimrun.exe del vimrun.exe
+ - if exist install.exe del install.exe
+ - if exist uninstal.exe del uninstal.exe
+ - if exist if_perl.c del if_perl.c
+ - if exist dimm.h del dimm.h
+ - if exist dimm_i.c del dimm_i.c
+ - if exist dimm.tlb del dimm.tlb
+ - if exist dosinst.exe del dosinst.exe
+ cd xxd
+ $(MAKE) /NOLOGO -f Make_mvc.mak clean
+ cd ..
+ cd GvimExt
+ $(MAKE) /NOLOGO -f Makefile clean
+ cd ..
+ cd GvimExt
+ $(MAKE) /NOLOGO -f Makefile clean
+ cd ..
+ - if exist testdir\*.out del testdir\*.out
+
+test:
+ cd testdir
+ $(MAKE) /NOLOGO -f Make_dos.mak win32
+ cd ..
+
+###########################################################################
+
+# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
+# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+!IF "$(_NMAKE_VER)" == ""
+.c{$(OUTDIR)/}.obj:
+!ELSE
+.c{$(OUTDIR)/}.obj::
+!ENDIF
+ $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
+
+# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
+# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+!IF "$(_NMAKE_VER)" == ""
+.cpp{$(OUTDIR)/}.obj:
+!ELSE
+.cpp{$(OUTDIR)/}.obj::
+!ENDIF
+ $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
+
+$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
+
+$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
+
+$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
+
+$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
+
+$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
+
+$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
+
+$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
+
+$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
+
+$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
+
+$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
+
+$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
+
+$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
+
+$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
+
+$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
+
+$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
+
+$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
+
+$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
+
+if_perl.c : if_perl.xs typemap
+ $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
+
+$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
+ $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
+
+$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
+ $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
+
+$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
+ $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
+
+$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
+
+$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
+ $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
+
+$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
+ $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
+
+$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
+ $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
+
+$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
+
+$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
+
+$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
+
+$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
+
+$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
+
+$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
+
+$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
+
+$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
+
+$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
+
+$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
+
+$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
+
+$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
+
+$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
+
+$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
+
+$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
+
+$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
+
+$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
+
+$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
+ $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
+
+$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
+
+$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
+
+$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
+
+$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
+
+$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
+
+$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
+
+$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
+
+$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
+
+$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
+
+$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
+
+$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
+ $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
+
+$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
+ $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
+
+iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
+ midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
+
+dimm.h dimm_i.c: dimm.idl
+ midl /nologo /proxy nul dimm.idl
+
+$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
+
+$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
+
+auto/pathdef.c: auto
+ @echo creating auto/pathdef.c
+ @echo /* pathdef.c */ > auto\pathdef.c
+ @echo #include "vim.h" >> auto\pathdef.c
+ @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
+ @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
+ @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS)"; >> auto\pathdef.c
+ @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
+ @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
+ @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
+
+auto:
+ if not exist auto/nul mkdir auto
+
+# End Custom Build
+proto.h: \
+ proto/buffer.pro \
+ proto/charset.pro \
+ proto/diff.pro \
+ proto/digraph.pro \
+ proto/edit.pro \
+ proto/eval.pro \
+ proto/ex_cmds.pro \
+ proto/ex_cmds2.pro \
+ proto/ex_docmd.pro \
+ proto/ex_eval.pro \
+ proto/ex_getln.pro \
+ proto/fileio.pro \
+ proto/getchar.pro \
+ proto/main.pro \
+ proto/mark.pro \
+ proto/memfile.pro \
+ proto/memline.pro \
+ proto/menu.pro \
+ proto/message.pro \
+ proto/misc1.pro \
+ proto/misc2.pro \
+ proto/move.pro \
+ proto/mbyte.pro \
+ proto/normal.pro \
+ proto/ops.pro \
+ proto/option.pro \
+ proto/os_mswin.pro \
+ proto/os_win32.pro \
+ proto/quickfix.pro \
+ proto/regexp.pro \
+ proto/screen.pro \
+ proto/search.pro \
+ proto/syntax.pro \
+ proto/tag.pro \
+ proto/term.pro \
+ proto/ui.pro \
+ proto/undo.pro \
+ proto/window.pro \
+ $(NETBEANS_PRO)
+
+# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:
diff --git a/src/Make_os2.mak b/src/Make_os2.mak
new file mode 100644
index 000000000..4d21dc620
--- /dev/null
+++ b/src/Make_os2.mak
@@ -0,0 +1,147 @@
+#
+# Makefile for VIM on OS/2 using EMX vim:ts=8:sw=8:tw=78
+#
+# Created by: Paul Slootman
+#
+
+### This Makefile has been succesfully tested on these systems.
+### Check the (*) column for remarks, listed below.
+### Later code changes may cause small problems, otherwise Vim is supposed to
+### compile and run without problems.
+### Just to show that this is just like the Unix version!
+
+#system: configurations: version (*) tested by:
+#------------- ------------------------ ------- - ----------
+#OS/2 Warp HPFS gcc-2.7.2+emx-0.9b -GUI 4.5 Paul Slootman
+#OS/2 FAT gcc-2.6.3+emx -GUI 4.5 Karsten Sievert
+
+#>>>>> choose options:
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+
+DEFINES = -DUSE_SYSTEM=1
+
+#>>>>> name of the compiler and linker, name of lib directory
+CC = gcc
+
+#>>>>> end of choices
+
+### Name of target(s)
+TARGET = vim.exe
+
+### Names of the tools that are also made
+TOOLS = xxd/xxd.exe tee/tee.exe
+
+###########################################################################
+
+INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_unix.h structs.h os_os2_cfg.h
+CFLAGS = -O2 -fno-strength-reduce -DOS2 -Wall -Iproto $(DEFINES)
+
+OBJ = \
+ buffer.o \
+ charset.o \
+ diff.o \
+ digraph.o \
+ edit.o \
+ eval.o \
+ ex_cmds.o \
+ ex_cmds2.o \
+ ex_docmd.o \
+ ex_eval.o \
+ ex_getln.o \
+ fileio.o \
+ fold.o \
+ getchar.o \
+ main.o \
+ mark.o \
+ memfile.o \
+ memline.o \
+ menu.o \
+ message.o \
+ misc1.o \
+ misc2.o \
+ move.o \
+ mbyte.o \
+ normal.o \
+ ops.o \
+ option.o \
+ quickfix.o \
+ regexp.o \
+ screen.o \
+ search.o \
+ syntax.o \
+ tag.o \
+ term.o \
+ ui.o \
+ undo.o \
+ window.o \
+ os_unix.o
+
+LIBS = -ltermcap
+
+# Default target is making the executable
+all: $(TARGET) $(TOOLS)
+
+# Link the target for normal use
+LFLAGS = -Zcrtdll -s -o $(TARGET) $(LIBS)
+
+$(TARGET): $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c $(OBJ) $(LFLAGS)
+
+xxd/xxd.exe: xxd/xxd.c
+ cd xxd & $(MAKE) -f Make_os2.mak
+
+tee/tee.exe: tee/tee.c
+ cd tee & $(MAKE) -f Makefile
+
+test:
+ cd testdir & $(MAKE) -f Make_os2.mak
+
+clean:
+ -del *.o
+ -del *.exe
+ -del *.~ *~ *.bak
+ cd xxd & $(MAKE) -f Make_os2.mak clean
+ cd tee & $(MAKE) -f Makefile clean
+
+###########################################################################
+
+os_unix.o: os_unix.c $(INCL)
+buffer.o: buffer.c $(INCL)
+charset.o: charset.c $(INCL)
+diff.o: diff.c $(INCL)
+digraph.o: digraph.c $(INCL)
+edit.o: edit.c $(INCL)
+eval.o: eval.c $(INCL)
+ex_cmds.o: ex_cmds.c $(INCL)
+ex_cmds2.o: ex_cmds2.c $(INCL)
+ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
+ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
+ex_getln.o: ex_getln.c $(INCL)
+fileio.o: fileio.c $(INCL)
+fold.o: fold.c $(INCL)
+getchar.o: getchar.c $(INCL)
+main.o: main.c $(INCL)
+mark.o: mark.c $(INCL)
+memfile.o: memfile.c $(INCL)
+memline.o: memline.c $(INCL)
+menu.o: menu.c $(INCL)
+message.o: message.c $(INCL)
+misc1.o: misc1.c $(INCL)
+misc2.o: misc2.c $(INCL)
+move.o: move.c $(INCL)
+mbyte.o: mbyte.c $(INCL)
+normal.o: normal.c $(INCL)
+ops.o: ops.c $(INCL)
+option.o: option.c $(INCL)
+quickfix.o: quickfix.c $(INCL)
+regexp.o: regexp.c $(INCL)
+screen.o: screen.c $(INCL)
+search.o: search.c $(INCL)
+syntax.o: syntax.c $(INCL)
+tag.o: tag.c $(INCL)
+term.o: term.c $(INCL)
+ui.o: ui.c $(INCL)
+undo.o: undo.c $(INCL)
+window.o: window.c $(INCL)
diff --git a/src/Make_ro.mak b/src/Make_ro.mak
new file mode 100644
index 000000000..6ac2f94b5
--- /dev/null
+++ b/src/Make_ro.mak
@@ -0,0 +1,168 @@
+#
+# Makefile for Vim on RISC OS - Andy Wingate
+#
+
+GCC = gcc -mthrowback
+CFLAGS = -DRISCOS -DFEAT_GUI
+# Optimising on ex_docmd.c seems to cause segfaults on compilation. Needs investigation.
+CCEX_DOCMD = $(GCC) $(CFLAGS)
+CC = $(GCC) $(CFLAGS) -O2
+# -DUP_BC_PC_EXTERN for term.c needed as BC defined in termlib.c and term.c
+
+TERMFLAG = -DUP_BC_PC_EXTERN
+
+ASMFLAGS = -throwback -objasm -gcc
+
+OBJS = o.buffer o.charset o.digraph o.edit o.eval o.ex_cmds o.ex_cmds2 o.diff \
+ o.ex_docmd o.ex_eval o.ex_getln o.fileio o.fold o.getchar o.main o.mark o.mbyte \
+ o.memfile o.memline o.menu o.message o.misc1 o.misc2 o.move \
+ o.normal o.ops o.option o.quickfix o.regexp o.screen o.search \
+ o.syntax o.tag o.term o.termlib o.ui o.undo o.version o.window \
+ o.os_riscos o.swis o.gui o.gui_riscos
+
+Vim: $(OBJS)
+ $(GCC) -o Vim $(OBJS)
+
+install: Vim
+ squeeze -v Vim @.!Vim.Vim
+
+clean:
+ create o.!fake! 0
+ wipe o.* ~cf
+ remove Vim
+
+o.swis: s.swis
+ as $(ASMFLAGS) -o o.swis s.swis
+
+# Rules for object files
+# You shouldn't need to put all this information in as all but term.c have the same
+# rule (and only then to save extra defines) but some versions of make are awkward.
+
+o.buffer: c.buffer
+ $(CC) -c c.buffer -o o.buffer
+
+o.charset: c.charset
+ $(CC) -c c.charset -o o.charset
+
+o.digraph: c.digraph
+ $(CC) -c c.digraph -o o.digraph
+
+o.diff: c.diff
+ $(CC) -c c.diff -o o.diff
+
+o.edit: c.edit
+ $(CC) -c c.edit -o o.edit
+
+o.eval: c.eval
+ $(CC) -c c.eval -o o.eval
+
+o.ex_cmds: c.ex_cmds
+ $(CC) -c c.ex_cmds -o o.ex_cmds
+
+o.ex_cmds2: c.ex_cmds2
+ $(CC) -c c.ex_cmds2 -o o.ex_cmds2
+
+o.ex_docmd: c.ex_docmd
+ $(CCEX_DOCMD) -c c.ex_docmd -o o.ex_docmd
+
+o.ex_eval: c.ex_eval
+ $(CCEX_DOCMD) -c c.ex_eval -o o.ex_eval
+
+o.ex_getln: c.ex_getln
+ $(CC) -c c.ex_getln -o o.ex_getln
+
+o.fileio: c.fileio
+ $(CC) -c c.fileio -o o.fileio
+
+o.fold: c.fold
+ $(CC) -c c.fold -o o.fold
+
+o.getchar: c.getchar
+ $(CC) -c c.getchar -o o.getchar
+
+o.gui: c.gui
+ $(CC) -c c.gui -o o.gui
+
+o.gui_riscos: c.gui_riscos
+ $(CC) -c c.gui_riscos -o o.gui_riscos
+
+o.main: c.main
+ $(CC) -c c.main -o o.main
+
+o.mark: c.mark
+ $(CC) -c c.mark -o o.mark
+
+o.mbyte: c.mbyte
+ $(CC) -c c.mbyte -o o.mbyte
+
+o.memfile: c.memfile
+ $(CC) -c c.memfile -o o.memfile
+
+o.memline: c.memline
+ $(CC) -c c.memline -o o.memline
+
+o.menu: c.menu
+ $(CC) -c c.menu -o o.menu
+
+o.message: c.message
+ $(CC) -c c.message -o o.message
+
+o.misc1: c.misc1
+ $(CC) -c c.misc1 -o o.misc1
+
+o.misc2: c.misc2
+ $(CC) -c c.misc2 -o o.misc2
+
+o.move: c.move
+ $(CC) -c c.move -o o.move
+
+o.normal: c.normal
+ $(CC) -c c.normal -o o.normal
+
+o.ops: c.ops
+ $(CC) -c c.ops -o o.ops
+
+o.option: c.option
+ $(CC) -c c.option -o o.option
+
+o.os_riscos: c.os_riscos
+ $(CC) -c c.os_riscos -o o.os_riscos
+
+o.pty: c.pty
+ $(CC) -c c.pty -o p.pty
+
+o.quickfix: c.quickfix
+ $(CC) -c c.quickfix -o o.quickfix
+
+o.regexp: c.regexp
+ $(CC) -c c.regexp -o o.regexp
+
+o.screen: c.screen
+ $(CC) -c c.screen -o o.screen
+
+o.search: c.search
+ $(CC) -c c.search -o o.search
+
+o.syntax: c.syntax
+ $(CC) -c c.syntax -o o.syntax
+
+o.tag: c.tag
+ $(CC) -c c.tag -o o.tag
+
+o.term: c.term
+ $(CC) $(TERMFLAG) -c c.term -o o.term
+
+o.termlib: c.termlib
+ $(CC) -c c.termlib -o o.termlib
+
+o.ui: c.ui
+ $(CC) -c c.ui -o o.ui
+
+o.undo: c.undo
+ $(CC) -c c.undo -o o.undo
+
+o.version: c.version
+ $(CC) -c c.version -o o.version
+
+o.window: c.window
+ $(CC) -c c.window -o o.window
diff --git a/src/Make_sas.mak b/src/Make_sas.mak
new file mode 100644
index 000000000..827903bbc
--- /dev/null
+++ b/src/Make_sas.mak
@@ -0,0 +1,345 @@
+# vim: set ft=make :
+# Makefile for VIM on the Amiga, using SAS/Lattice C 6.0 to 6.58
+#
+# Do NOT use the peephole optimizer with a version before 6.56!
+# It messes up all kinds of things:
+# For 6.0 and 6.1, expand_env() will not work correctly.
+# For 6.2 and 6.3 the call to free_line in u_freeentry is wrong.
+# The "read.me" file for version 6.56 includes a remark about a fix for the
+# peephole optimizer. Everything before 6.56 will probably fail.
+#
+# You should use Manx Aztec C whenever possible, because it has been tested.
+#
+# The prototypes from Manx and SAS are incompatible. If the prototypes
+# were generated by Manx, first do "touch *.c; make proto" before "make".
+# The prototypes generated on Unix work for both.
+#
+# Note: Not all dependencies are included. This was done to avoid having
+# to compile everything when a global variable or function is added.
+
+#>>>>> choose options:
+
+### See feature.h for a list of optionals.
+### Any other defines can be included here.
+
+# NO_ARP Don't include ARP functions
+# SASC=658 Sas/C version number
+# NEWSASC fixes a bug in the syntax highlighting?
+DEFINES = DEF=NO_ARP DEF=NEWSASC DEF="SASC=658"
+
+#>>>>> if HAVE_TGETENT is defined termlib.o has to be used
+#TERMLIB = termlib.o
+TERMLIB =
+
+#>>>>> choose NODEBUG for normal compiling, the other for debugging and
+# profiling
+# don't switch on debugging when generating proto files, it crashes the
+# compiler.
+DBG = NODEBUG
+#DBG = DBG=SF
+
+#>>>>> choose NOOPTPEEP for 6.0 to 6.3, NOOPT for debugging
+# with version 6.56 and later you can probably use OPT
+OPTIMIZE = OPT
+#OPTIMIZE = NOOPTPEEP
+#OPTIMIZE = NOOPT
+
+# for 6.58 you can use the line below, but be warned it takes a loooonnnggg time
+#OPTIMIZE=OPT OPTIMIZERSCHEDULER OPTIMIZERTIME NoOPTIMIZERALIAS \
+ OptimizerComplexity=10 OptimizerDepth=10 OptimizerRecurDepth=10 \
+ OptimizerInLocal OPTPEEP
+
+#generate code for your processor - 68060 will work for 040's as well.
+CPU=68000
+#CPU=68020
+#CPU=68030
+#CPU=68040
+#CPU=68060
+
+#Error reporting - rexx or console
+ERROR = ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
+#ERROR = ERRORREXX ERRORCONSOLE ERRORSOURCE ERRORHIGHLIGHT
+
+#memory types, if you have fast use it :->,
+# ANY = will work on all machines
+# FAST = this is the best option, for speed
+#MEMORYTYPE=FAST
+MEMORYTYPE=ANY
+
+#MEMSIZE - this is for compile time only for speed of compilation
+#MEMSIZE=HUGE
+MEMSIZE=LARGE
+#MEMSIZE=SMALL
+
+#>>>>> end of choices
+###########################################################################
+
+CC = sc
+GST = vim.gst
+COPTS = SINT SCODE SDATA
+SHELL = csh
+DEL = $(SHELL) -c rm -f
+
+# ignore error messages for uninitialized variables, they are mostly not correct
+CFLAGS = NOLINK $(DBG) CPU=$(CPU) NOSTACKCHECK DEF=AMIGA CODE=FAR idir=proto ignore=317
+CFLAGS2 = $(OPTIMIZE) $(ERROR) GSTIMMEDIATE GST=$(GST)
+CFLAGS3 = $(COPTS) STRINGMERGE MEMSIZE=$(MEMSIZE)
+CFLAGS4 = $(DEFINES) DATAMEMORY=$(MEMORYTYPE)
+
+PROPT = DEF=PROTO GPROTO GPPARM MAXIMUMERRORS=999 GENPROTOSTATICS GENPROTOPARAMETERS
+
+SRC = \
+ buffer.c \
+ charset.c \
+ diff.c \
+ digraph.c \
+ edit.c \
+ eval.c \
+ ex_cmds.c \
+ ex_cmds2.c \
+ ex_docmd.c \
+ ex_eval.c \
+ ex_getln.c \
+ fileio.c \
+ fold.c \
+ getchar.c \
+ main.c \
+ mark.c \
+ memfile.c \
+ memline.c \
+ menu.c \
+ message.c \
+ misc1.c \
+ misc2.c \
+ move.c \
+ mbyte.c \
+ normal.c \
+ ops.c \
+ option.c \
+ os_amiga.c \
+ quickfix.c \
+ regexp.c \
+ screen.c \
+ search.c \
+ syntax.c \
+ tag.c \
+ term.c \
+ ui.c \
+ undo.c \
+ window.c \
+ version.c
+
+OBJ = \
+ buffer.o \
+ charset.o \
+ diff.o \
+ digraph.o \
+ edit.o \
+ eval.o \
+ ex_cmds.o \
+ ex_cmds2.o \
+ ex_docmd.o \
+ ex_eval.o \
+ ex_getln.o \
+ fileio.o \
+ fold.o \
+ getchar.o \
+ main.o \
+ mark.o \
+ memfile.o \
+ memline.o \
+ menu.o \
+ message.o \
+ misc1.o \
+ misc2.o \
+ move.o \
+ mbyte.o \
+ normal.o \
+ ops.o \
+ option.o \
+ os_amiga.o \
+ quickfix.o \
+ regexp.o \
+ screen.o \
+ search.o \
+ syntax.o \
+ tag.o \
+ term.o \
+ ui.o \
+ undo.o \
+ window.o \
+ $(TERMLIB)
+
+PRO = \
+ proto/buffer.pro \
+ proto/charset.pro \
+ proto/diff.pro \
+ proto/digraph.pro \
+ proto/edit.pro \
+ proto/eval.pro \
+ proto/ex_cmds.pro \
+ proto/ex_cmds2.pro \
+ proto/ex_docmd.pro \
+ proto/ex_eval.pro \
+ proto/ex_getln.pro \
+ proto/fileio.pro \
+ proto/fold.pro \
+ proto/getchar.pro \
+ proto/main.pro \
+ proto/mark.pro \
+ proto/memfile.pro \
+ proto/memline.pro \
+ proto/menu.pro \
+ proto/message.pro \
+ proto/misc1.pro \
+ proto/misc2.pro \
+ proto/move.pro \
+ proto/mbyte.pro \
+ proto/normal.pro \
+ proto/ops.pro \
+ proto/option.pro \
+ proto/os_amiga.pro \
+ proto/quickfix.pro \
+ proto/regexp.pro \
+ proto/screen.pro \
+ proto/search.pro \
+ proto/syntax.pro \
+ proto/tag.pro \
+ proto/term.pro \
+ proto/termlib.pro \
+ proto/ui.pro \
+ proto/undo.pro \
+ proto/window.pro
+
+all: proto Vim
+
+Vim: scoptions $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c
+ $(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
+
+debug: scoptions $(OBJ) version.c version.h
+ $(CC) $(CFLAGS) version.c
+ $(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=Vim
+
+proto: $(GST) $(PRO)
+
+tags:
+ spat ctags $(SRC) *.h
+# csh -c ctags $(SRC) *.h
+
+# can't use delete here, too many file names
+clean:
+ $(DEL) *.o Vim $(GST)
+
+# generate GlobalSymbolTable, which speeds up the compile time.
+#
+# A preprocessing stage is used to work arounda bug in the GST generator, in
+# that it does not handle nested makefiles properly in this stage.
+# Ignore error message for not producing any code (105).
+$(GST): scoptions vim.h keymap.h macros.h ascii.h term.h structs.h
+ $(CC) $(CFLAGS) PREPROCESSORONLY vim.h objectname pre.h
+ $(CC) MGST=$(GST) pre.h ignore=105
+ $(DEL) pre.h
+
+# generate an options file, because SAS/C smake can't handle the amiga command
+# line can handle the lengths that this makefile will impose on the shell.
+# (Manx's make can do this).
+scoptions: Make_sas.mak
+ @echo "Generating - $@ ..."
+ @echo $(CFLAGS) > scoptions
+ @echo $(CFLAGS1) >> scoptions
+ @echo $(CFLAGS2) >> scoptions
+ @echo $(CFLAGS3) >> scoptions
+ @echo $(CFLAGS4) >> scoptions
+ @echo $(COPTS) >>scoptions
+ @echo done
+
+###########################################################################
+
+$(OBJ): $(GST) vim.h
+$(PRO): $(GST) vim.h
+
+.c.o:
+ $(CC) $(CFLAGS) $*.c
+
+.c.pro:
+ $(CC) $(CFLAGS) GPFILE=proto/$*.pro $(PROPT) $*.c
+
+# dependancies
+buffer.o: buffer.c
+proto/buffer.pro: buffer.c
+charset.o: charset.c
+proto/charset.pro: charset.c
+diff.o: diff.c
+proto/diff.pro: diff.c
+digraph.o: digraph.c
+proto/digraph.pro: digraph.c
+edit.o: edit.c
+proto/edit.pro: edit.c
+eval.o: eval.c
+proto/eval.pro: eval.c
+ex_cmds.o: ex_cmds.c
+proto/ex_cmds.pro: ex_cmds.c
+ex_cmds2.o: ex_cmds2.c
+proto/ex_cmds2.pro: ex_cmds2.c
+ex_docmd.o: ex_docmd.c ex_cmds.h
+proto/ex_docmd.pro: ex_docmd.c ex_cmds.h
+ex_eval.o: ex_eval.c ex_cmds.h
+proto/ex_eval.pro: ex_eval.c ex_cmds.h
+ex_getln.o: ex_getln.c
+proto/ex_getln.pro: ex_getln.c
+fileio.o: fileio.c
+proto/fileio.pro: fileio.c
+fold.o: fold.c
+proto/fold.pro: fold.c
+getchar.o: getchar.c
+proto/getchar.pro: getchar.c
+main.o: main.c
+proto/main.pro: main.c
+mark.o: mark.c
+proto/mark.pro: mark.c
+memfile.o: memfile.c
+proto/memfile.pro: memfile.c
+memline.o: memline.c
+proto/memline.pro: memline.c
+menu.o: menu.c
+proto/menu.pro: menu.c
+message.o: message.c
+proto/message.pro: message.c
+misc1.o: misc1.c
+proto/misc1.pro: misc1.c
+misc2.o: misc2.c
+proto/misc2.pro: misc2.c
+move.o: move.c
+proto/move.pro: move.c
+mbyte.o: mbyte.c
+proto/mbyte.pro: mbyte.c
+normal.o: normal.c
+proto/normal.pro: normal.c
+ops.o: ops.c
+proto/ops.pro: ops.c
+option.o: option.c
+proto/option.pro: option.c
+os_amiga.o: os_amiga.c
+proto/os_amiga.pro: os_amiga.c
+quickfix.o: quickfix.c
+proto/quickfix.pro: quickfix.c
+regexp.o: regexp.c
+proto/regexp.pro: regexp.c
+screen.o: screen.c
+proto/screen.pro: screen.c
+search.o: search.c
+proto/search.pro: search.c
+syntax.o: syntax.c
+proto/syntax.pro: syntax.c
+tag.o: tag.c
+proto/tag.pro: tag.c
+term.o: term.c
+proto/term.pro: term.c
+termlib.o: termlib.c
+proto/termlib.pro: termlib.c
+ui.o: ui.c
+proto/ui.pro: ui.c
+undo.o: undo.c
+proto/undo.pro: undo.c
+window.o: window.c
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
new file mode 100644
index 000000000..f1ce93a29
--- /dev/null
+++ b/src/Make_vms.mms
@@ -0,0 +1,457 @@
+#
+# Makefile for Vim on OpenVMS
+#
+# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
+# Last change: 2004 May 04
+#
+# This has script been tested on VMS 6.2 to 7.3 on DEC Alpha and VAX
+# with MMS and MMK
+#
+# The following could be built:
+# vim.exe: standard (terminal, GUI/Motif, GUI/GTK)
+# dvim.exe: debug
+#
+# Edit the lines in the Configuration section below for fine tuning.
+#
+# To build: mms/descrip=Make_vms.mms
+# To clean up: mms/descrip=Make_vms.mms clean
+#
+# Hints and detailed description could be found in INSTALLVMS.TXT file.
+#
+######################################################################
+# Configuration section.
+######################################################################
+# Platform selection
+# Define this if you will use the VAX platform to build.
+# VAX = YES
+
+# VMS version
+# Uncomment if you use VMS version 6.2 or older
+# OLD_VMS = YES
+
+# Compiler selection.
+# Comment out if you use the VAXC compiler
+DECC = YES
+
+# Build model selection
+# TINY - Almost no features enabled, not even multiple windows
+# SMALL - Few features enabled, as basic as possible
+# NORMAL - A default selection of features enabled
+# BIG - Many features enabled, as rich as possible. (default)
+# HUGE - All possible featues enabled.
+# Please select one of these alternatives above.
+MODEL = BIG
+
+# GUI or terminal mode executable.
+# Comment out if you want just the character terminal mode only.
+GUI = YES
+
+# GUI with GTK
+# If you have GTK installed you might want to enable this option.
+# GTK = YES
+
+# Comment out if you want the compiler version with :ver command.
+# NOTE: This part can make some complications if you're using some
+# predefined symbols/flags for your compiler. If does, just leave behind
+# the comment varialbe CCVER.
+CCVER = YES
+
+# Uncomment if want a debug version. Resulting executable is DVIM.EXE
+# Development purpose only! Normally, it should not be defined. !!!
+# DEBUG = YES
+
+# Languages support for Perl, Python, TCL etc.
+# If you don't need it really, leave them behind the comment.
+# You will need related libraries, include files etc.
+# VIM_TCL = YES
+# VIM_PERL = YES
+# VIM_PYTHON = YES
+# VIM_RUBY = YES
+# VIM_SNIFF = YES
+
+# X Input Method. For entering special languages like chinese and
+# Japanese. Please define just one: VIM_XIM or VIM_HANGULIN
+# If you don't need it really, leave it behind the comment.
+# VIM_XIM = YES
+
+# Internal Hangul input method. GUI only.
+# If you don't need it really, leave it behind the comment.
+# VIM_HANGULIN = YES
+
+# Allow any white space to separate the fields in a tags file
+# When not defined, only a TAB is allowed.
+# VIM_TAG_ANYWHITE = YES
+
+######################################################################
+# Directory, library and include files configuration section.
+# Normally you need not to change anything below. !
+# These may need to be defined if things are not in standard locations
+#
+# You can find some explanation in INSTALLVMS.TXT
+######################################################################
+
+# Compiler setup
+
+.IFDEF VAX
+.IFDEF DECC # VAX with DECC
+CC_DEF = cc/decc
+PREFIX = /prefix=all
+.ELSE # VAX with VAXC
+CC_DEF = cc
+PREFIX =
+CCVER =
+.ENDIF
+.ELSE # AXP wixh DECC
+CC_DEF = cc
+PREFIX = /prefix=all
+.ENDIF
+
+LD_DEF = link
+C_INC = [.proto]
+
+.IFDEF OLD_VMS
+VMS_DEF = ,"OLD_VMS"
+.ENDIF
+
+.IFDEF DEBUG
+DEBUG_DEF = ,"DEBUG"
+TARGET = dvim.exe
+CFLAGS = /debug/noopt$(PREFIX)
+LDFLAGS = /debug
+.ELSE
+TARGET = vim.exe
+CFLAGS = /opt$(PREFIX)
+LDFLAGS =
+.ENDIF
+
+# Predefined VIM directories
+# Please, use $VIM and $VIMRUNTIME logicals instead
+VIMLOC = ""
+VIMRUN = ""
+
+CONFIG_H = os_vms_conf.h
+
+.IFDEF GTK
+.IFDEF GUI
+.ELSE
+GUI = YES
+.ENDIF
+.ENDIF
+
+.IFDEF GUI
+# X/Motif/GTK executable (also works in terminal mode )
+
+.IFDEF GTK
+GTK_DIR = ALPHA$DKA0:[GTK128.]
+DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK"
+LIBS = ,OS_VMS_GTK.OPT/OPT
+GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm
+GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_gtk_x11.c pty.c
+GUI_OBJ = gui.obj gui_gtk.obj gui_gtk_f.obj gui_gtk_x11.obj pty.obj
+GUI_INC = ,"/gtk_root/gtk","/gtk_root/glib"
+# GUI_INC_VER is used just for :ver information
+# this string should escape from C and DCL in the same time
+GUI_INC_VER= ,\""/gtk_root/gtk\"",\""/gtk_root/glib\""
+.else
+MOTIF = YES
+DEFS = "HAVE_CONFIG_H","FEAT_GUI_MOTIF"
+LIBS = ,OS_VMS_MOTIF.OPT/OPT
+GUI_FLAG =
+GUI_SRC = gui.c gui_motif.c gui_x11.c
+GUI_OBJ = gui.obj gui_motif.obj gui_x11.obj
+GUI_INC =
+.ENDIF
+
+# You need to define these variables if you do not have DECW files
+# at standard location
+GUI_INC_DIR = ,decw$include:
+# GUI_LIB_DIR = ,sys$library:
+
+.ELSE
+# Character terminal only executable
+DEFS = "HAVE_CONFIG_H"
+LIBS =
+.ENDIF
+
+.IFDEF VIM_PERL
+# Perl related setup.
+PERL = perl
+PERL_DEF = ,"FEAT_PERL"
+PERL_SRC = if_perlsfio.c if_perl.xs
+PERL_OBJ = if_perlsfio.obj if_perl.obj
+PERL_LIB = ,OS_VMS_PERL.OPT/OPT
+PERL_INC = ,dka0:[perlbuild.perl.lib.vms_axp.5_6_1.core]
+.ENDIF
+
+.IFDEF VIM_PYTHON
+# Python related setup.
+PYTHON_DEF = ,"FEAT_PYTHON"
+PYTHON_SRC = if_python.c
+PYTHON_OBJ = if_python.obj
+PYTHON_LIB = ,OS_VMS_PYTHON.OPT/OPT
+PYTHON_INC = ,PYTHON_INCLUDE
+.ENDIF
+
+.IFDEF VIM_TCL
+# TCL related setup.
+TCL_DEF = ,"FEAT_TCL"
+TCL_SRC = if_tcl.c
+TCL_OBJ = if_tcl.obj
+TCL_LIB = ,OS_VMS_TCL.OPT/OPT
+TCL_INC = ,dka0:[tcl80.generic]
+.ENDIF
+
+.IFDEF VIM_SNIFF
+# SNIFF related setup.
+SNIFF_DEF = ,"FEAT_SNIFF"
+SNIFF_SRC = if_sniff.c
+SNIFF_OBJ = if_sniff.obj
+SNIFF_LIB =
+SNIFF_INC =
+.ENDIF
+
+.IFDEF VIM_RUBY
+# RUBY related setup.
+RUBY_DEF = ,"FEAT_RUBY"
+RUBY_SRC = if_ruby.c
+RUBY_OBJ = if_ruby.obj
+RUBY_LIB = ,OS_VMS_RUBY.OPT/OPT
+RUBY_INC =
+.ENDIF
+
+.IFDEF VIM_XIM
+# XIM related setup.
+.IFDEF GUI
+XIM_DEF = ,"FEAT_XIM"
+.ENDIF
+.ENDIF
+
+.IFDEF VIM_HANGULIN
+# HANGULIN related setup.
+.IFDEF GUI
+HANGULIN_DEF = ,"FEAT_HANGULIN"
+HANGULIN_SRC = hangulin.c
+HANGULIN_OBJ = hangulin.obj
+.ENDIF
+.ENDIF
+
+.IFDEF VIM_TAG_ANYWHITE
+# TAG_ANYWHITE related setup.
+TAG_DEF = ,"FEAT_TAG_ANYWHITE"
+.ENDIF
+
+
+######################################################################
+# End of configuration section.
+# Please, do not change anything below without programming experience.
+######################################################################
+
+
+MODEL_DEF = "FEAT_$(MODEL)",
+
+# These go into pathdef.c
+VIMUSER = "''F$EDIT(F$GETJPI(" ","USERNAME"),"TRIM")'"
+VIMHOST = "''F$TRNLNM("SYS$NODE")'''F$TRNLNM("UCX$INET_HOST")'.''F$TRNLNM("UCX$INET_DOMAIN")'"
+
+.SUFFIXES : .obj .c
+
+ALL_CFLAGS = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
+ $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)) -
+ $(CFLAGS)$(GUI_FLAG) -
+ /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
+
+# CFLAGS displayed in :ver information
+# It is specially formated for correct display of unix like includes
+# as $(GUI_INC) - replaced with $(GUI_INC_VER)
+# Otherwise should not be any other difference.
+ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(VMS_DEF)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
+ $(TCL_DEF)$(SNIFF_DEF)$(RUBY_DEF)$(XIM_DEF)$(HANGULIN_DEF)$(TAG_DEF)) -
+ $(CFLAGS)$(GUI_FLAG) -
+ /include=($(C_INC)$(GUI_INC_DIR)$(GUI_INC_VER)$(PERL_INC)$(PYTHON_INC)$(TCL_INC))
+
+ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
+ $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB)
+
+SRC = buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
+ ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
+ main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
+ misc2.c move.c normal.c ops.c option.c quickfix.c regexp.c search.c \
+ syntax.c tag.c term.c termlib.c ui.c undo.c version.c screen.c \
+ window.c os_unix.c os_vms.c pathdef.c \
+ $(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
+ $(RUBY_SRC) $(HANGULIN_SRC)
+
+OBJ = buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \
+ ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \
+ if_xcmdsrv.obj fileio.obj fold.obj getchar.obj main.obj mark.obj \
+ menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
+ move.obj mbyte.obj normal.obj ops.obj option.obj quickfix.obj \
+ regexp.obj search.obj syntax.obj tag.obj term.obj termlib.obj \
+ ui.obj undo.obj screen.obj version.obj window.obj os_unix.obj \
+ os_vms.obj pathdef.obj \
+ $(GUI_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
+ $(RUBY_OBJ) $(HANGULIN_OBJ)
+
+# Default target is making the executable
+all : [.auto]config.h mmk_compat motif_env gtk_env perl_env python_env tcl_env ruby_env $(TARGET)
+ ! $@
+
+[.auto]config.h : $(CONFIG_H)
+ copy/nolog $(CONFIG_H) [.auto]config.h
+
+mmk_compat :
+ -@ open/write pd pathdef.c
+ -@ write pd "/* Empty file to satisfy MMK depend. */"
+ -@ write pd "/* It will be owerwritten later on... */"
+ -@ close pd
+clean :
+ -@ if "''F$SEARCH("*.exe")'" .NES. "" then delete/noconfirm/nolog *.exe;*
+ -@ if "''F$SEARCH("*.obj")'" .NES. "" then delete/noconfirm/nolog *.obj;*
+ -@ if "''F$SEARCH("[.auto]config.h")'" .NES. "" then delete/noconfirm/nolog [.auto]config.h;*
+ -@ if "''F$SEARCH("pathdef.c")'" .NES. "" then delete/noconfirm/nolog pathdef.c;*
+ -@ if "''F$SEARCH("if_perl.c")'" .NES. "" then delete/noconfirm/nolog if_perl.c;*
+ -@ if "''F$SEARCH("*.opt")'" .NES. "" then delete/noconfirm/nolog *.opt;*
+
+# Link the target
+$(TARGET) : $(OBJ)
+ $(LD_DEF) $(LDFLAGS) /exe=$(TARGET) $+ $(ALL_LIBS)
+
+.c.obj :
+ $(CC_DEF) $(ALL_CFLAGS) $<
+
+pathdef.c : check_ccver $(CONFIG_H)
+ -@ write sys$output "creating PATHDEF.C file."
+ -@ open/write pd pathdef.c
+ -@ write pd "/* pathdef.c -- DO NOT EDIT! */"
+ -@ write pd "/* This file is automatically created by MAKE_VMS.MMS"
+ -@ write pd " * Change the file MAKE_VMS.MMS Only. */"
+ -@ write pd "typedef unsigned char char_u;"
+ -@ write pd "char_u *default_vim_dir = (char_u *)"$(VIMLOC)";"
+ -@ write pd "char_u *default_vimruntime_dir = (char_u *)"$(VIMRUN)";"
+ -@ write pd "char_u *all_cflags = (char_u *)""$(CC_DEF)$(ALL_CFLAGS_VER)"";"
+ -@ write pd "char_u *all_lflags = (char_u *)""$(LD_DEF)$(LDFLAGS) /exe=$(TARGET) *.OBJ $(ALL_LIBS)"";"
+ -@ write pd "char_u *compiler_version = (char_u *) ""''CC_VER'"";"
+ -@ write pd "char_u *compiled_user = (char_u *) "$(VIMUSER)";"
+ -@ write pd "char_u *compiled_sys = (char_u *) "$(VIMHOST)";"
+ -@ close pd
+
+if_perl.c : if_perl.xs
+ -@ $(PERL) PERL_ROOT:[LIB.ExtUtils]xsubpp -prototypes -typemap -
+ PERL_ROOT:[LIB.ExtUtils]typemap if_perl.xs >> $@
+
+make_vms.mms :
+ -@ write sys$output "The name of the makefile MUST be <MAKE_VMS.MMS> !!!"
+
+.IFDEF CCVER
+# This part can make some complications if you're using some predefined
+# symbols/flags for your compiler. If does, just comment out CCVER variable
+check_ccver :
+ -@ define sys$output cc_ver.tmp
+ -@ $(CC_DEF)/version
+ -@ deassign sys$output
+ -@ open/read file cc_ver.tmp
+ -@ read file CC_VER
+ -@ close file
+ -@ delete/noconfirm/nolog cc_ver.tmp.*
+.ELSE
+check_ccver :
+ -@ !
+.ENDIF
+
+.IFDEF MOTIF
+motif_env :
+ -@ write sys$output "using DECW/Motif environment."
+ -@ write sys$output "creating OS_VMS_MOTIF.OPT file."
+ -@ open/write opt_file OS_VMS_MOTIF.OPT
+ -@ write opt_file "sys$share:decw$xmlibshr12.exe/share,-"
+ -@ write opt_file "sys$share:decw$xtlibshrr5.exe/share,-"
+ -@ write opt_file "sys$share:decw$xlibshr.exe/share"
+ -@ close opt_file
+.ELSE
+motif_env :
+ -@ !
+.ENDIF
+
+
+.IFDEF GTK
+gtk_env :
+ -@ write sys$output "using GTK environment:"
+ -@ define/nolog gtk_root /trans=conc $(GTK_DIR)
+ -@ show logical gtk_root
+ -@ write sys$output " include path: "$(GUI_INC)""
+ -@ write sys$output "creating OS_VMS_GTK.OPT file."
+ -@ open/write opt_file OS_VMS_GTK.OPT
+ -@ write opt_file "gtk_root:[glib]libglib.exe /share,-"
+ -@ write opt_file "gtk_root:[glib.gmodule]libgmodule.exe /share,-"
+ -@ write opt_file "gtk_root:[gtk.gdk]libgdk.exe /share,-"
+ -@ write opt_file "gtk_root:[gtk.gtk]libgtk.exe /share,-"
+ -@ write opt_file "sys$share:decw$xmlibshr12.exe/share,-"
+ -@ write opt_file "sys$share:decw$xtlibshrr5.exe/share,-"
+ -@ write opt_file "sys$share:decw$xlibshr.exe/share"
+ -@ close opt_file
+.ELSE
+gtk_env :
+ -@ !
+.ENDIF
+
+.IFDEF VIM_PERL
+perl_env :
+ -@ write sys$output "using PERL environment:"
+ -@ show logical PERLSHR
+ -@ write sys$output " include path: ""$(PERL_INC)"""
+ -@ show symbol perl
+ -@ open/write pd if_perl.c
+ -@ write pd "/* Empty file to satisfy MMK depend. */"
+ -@ write pd "/* It will be owerwritten later on... */"
+ -@ close pd
+ -@ write sys$output "creating OS_VMS_PERL.OPT file."
+ -@ open/write opt_file OS_VMS_PERL.OPT
+ -@ write opt_file "PERLSHR /share"
+ -@ close opt_file
+.ELSE
+perl_env :
+ -@ !
+.ENDIF
+
+.IFDEF VIM_PYTHON
+python_env :
+ -@ write sys$output "using PYTHON environment:"
+ -@ show logical PYTHON_INCLUDE
+ -@ show logical PYTHON_OLB
+ -@ write sys$output "creating OS_VMS_PYTHON.OPT file."
+ -@ open/write opt_file OS_VMS_PYTHON.OPT
+ -@ write opt_file "PYTHON_OLB:PYTHON.OLB /share"
+ -@ close opt_file
+.ELSE
+python_env :
+ -@ !
+.ENDIF
+
+.IFDEF VIM_TCL
+tcl_env :
+ -@ write sys$output "using TCL environment:"
+ -@ show logical TCLSHR
+ -@ write sys$output " include path: ""$(TCL_INC)"""
+ -@ write sys$output "creating OS_VMS_TCL.OPT file."
+ -@ open/write opt_file OS_VMS_TCL.OPT
+ -@ write opt_file "TCLSHR /share"
+ -@ close opt_file
+.ELSE
+tcl_env :
+ -@ !
+.ENDIF
+
+.IFDEF VIM_RUBY
+ruby_env :
+ -@ write sys$output "using RUBY environment:"
+ -@ write sys$output " include path: ""$(RUBY_INC)"""
+ -@ write sys$output "creating OS_VMS_RUBY.OPT file."
+ -@ open/write opt_file OS_VMS_RUBY.OPT
+ -@ write opt_file "RUBYSHR /share"
+ -@ close opt_file
+.ELSE
+ruby_env :
+ -@ !
+.ENDIF
+
+
diff --git a/src/Make_w16.mak b/src/Make_w16.mak
new file mode 100644
index 000000000..cd425c9c2
--- /dev/null
+++ b/src/Make_w16.mak
@@ -0,0 +1,196 @@
+#
+# Borland C++ 5.0[12] makefile for vim, 16-bit windows gui version
+# By Vince Negri
+# *************************************************************
+# * WARNING!
+# * This was originally produced by the IDE, but has since been
+# * modifed to make it work properly. Adjust with care!
+# * In particular, leave LinkerLocalOptsAtW16_gvim16dexe alone
+# * unless you are a guru.
+# *************************************************************
+#
+# Look for BOR below and either pass a different value or
+# adjust the path as required. For example
+# make -fMake_w16.mak -DBOR=C:\PF\Borland\BC5.01 -B BccW16.cfg
+# make -fMake_w16.mak
+# Note: $(BOR) is effectively ignored unless BccW16.cfg is rebuilt.
+#
+# Does not compile with Borland C++ 4.51 Walter Briscoe 2003-02-24
+# "out of memory" from compiler if gvim16 wildly wrong. WFB 2003-03-04
+#
+# vim16.def must be a DOS-formatted file. (\r\n line endings.)
+# It is a UNIX-formatted file (\n line endings) in vim-*-extra.tar.gz
+
+.AUTODEPEND
+
+#
+# Borland C++ tools
+#
+IMPLIB = Implib
+BCC = Bcc +BccW16.cfg
+TLINK = TLink
+TLIB = TLib
+BRC = Brc
+TASM = Tasm
+#
+# IDE macros
+#
+
+#
+# Options
+#
+!ifndef BOR
+BOR = D:\BC5
+!endif
+
+# !ifndef INTDIR is lethal considering CLEAN below. WFB 2003-03-13
+INTDIR=w16
+
+# /Twe Make the target a Windows .EXE with explicit functions exportable +
+# /x Map file off
+# /l Include source line numbers in object map files`
+# /c case sensitive link
+# /C Case-sensitive exports and imports (16-bit only)
+# /k Produce "No Stack" warning.
+# /Oa Minimise segment alignment
+# /Oc Minimise Chain fixes
+# /Oi Minimise Iterated data
+# /Or Minimise resource alignment
+# /P -P=x Code pack size
+# /V Windows version for application
+# /L Folder to search for library files
+LinkerLocalOptsAtW16_gvim16dexe =/Twe/x/l/c/C/k/Or/Oc/Oa/Oi/P=65535/V3.10
+
+CompInheritOptsAt_gvim16dexe = \
+ -I$(BOR)\INCLUDE;PROTO;. \
+ -DFEAT_GUI;FEAT_GUI_MSWIN;FEAT_GUI_W16;MSWIN;WIN16;MSWIN16_FASTTEXT \
+ -DFEAT_TOOLBAR;WIN16_3DLOOK
+
+#
+# Dependency List
+#
+Dep_Gvim16 = \
+ gvim16.exe
+
+ObjFiles = \
+ $(INTDIR)\buffer.obj\
+ $(INTDIR)\charset.obj\
+ $(INTDIR)\diff.obj\
+ $(INTDIR)\digraph.obj\
+ $(INTDIR)\edit.obj\
+ $(INTDIR)\eval.obj\
+ $(INTDIR)\ex_cmds.obj\
+ $(INTDIR)\ex_cmds2.obj\
+ $(INTDIR)\ex_docmd.obj\
+ $(INTDIR)\ex_eval.obj\
+ $(INTDIR)\ex_getln.obj\
+ $(INTDIR)\fileio.obj\
+ $(INTDIR)\fold.obj\
+ $(INTDIR)\getchar.obj\
+ $(INTDIR)\gui.obj\
+ $(INTDIR)\gui_w16.obj\
+ $(INTDIR)\main.obj\
+ $(INTDIR)\mark.obj\
+ $(INTDIR)\mbyte.obj\
+ $(INTDIR)\memfile.obj\
+ $(INTDIR)\memline.obj\
+ $(INTDIR)\menu.obj\
+ $(INTDIR)\message.obj\
+ $(INTDIR)\misc1.obj\
+ $(INTDIR)\misc2.obj\
+ $(INTDIR)\move.obj\
+ $(INTDIR)\normal.obj\
+ $(INTDIR)\ops.obj\
+ $(INTDIR)\option.obj\
+ $(INTDIR)\os_win16.obj\
+ $(INTDIR)\os_msdos.obj\
+ $(INTDIR)\os_mswin.obj\
+ $(INTDIR)\quickfix.obj\
+ $(INTDIR)\regexp.obj\
+ $(INTDIR)\screen.obj\
+ $(INTDIR)\search.obj\
+ $(INTDIR)\syntax.obj\
+ $(INTDIR)\tag.obj\
+ $(INTDIR)\term.obj\
+ $(INTDIR)\ui.obj\
+ $(INTDIR)\undo.obj\
+ $(INTDIR)\version.obj\
+ $(INTDIR)\window.obj
+
+Dep_gvim16dexe = \
+ vimtbar.lib\
+ vim16.def\
+ $(INTDIR)\vim16.res\
+ $(ObjFiles)
+
+# Without the following, the implicit rule in BUILTINS.MAK is picked up
+# for a rule for .c.obj rather than the local implicit rule
+.SUFFIXES
+.SUFFIXES .c .obj
+.path.c = .
+
+# -P- Force C++ compilation off
+# -c Compilation only
+# -n Place .OBJ files
+{.}.c{$(INTDIR)}.obj:
+ $(BCC) -P- -c -n$(INTDIR)\ {$< }
+
+Gvim16 : BccW16.cfg $(Dep_Gvim16)
+ echo MakeNode
+
+gvim16.exe : $(Dep_gvim16dexe)
+ $(TLINK) $(LinkerLocalOptsAtW16_gvim16dexe) @&&|
+c0wl.obj $(ObjFiles)
+|,$*,,vimtbar ctl3dv2 import cwl, vim16.def,$(INTDIR)\vim16.res
+
+# Force objects to be built if $(BOR) changes
+$(ObjFiles) : Make_w16.mak BccW16.cfg
+
+$(INTDIR)\vim16.res : vim16.rc
+ $(BRC) -R @&&|
+ $(CompInheritOptsAt_gvim16dexe) -fo$*.res $?
+|
+
+
+# Compiler configuration file
+# There is no rule for $(INTDIR) as make always says it does not exist
+BccW16.cfg :
+ -@if not exist $(INTDIR)\$(NULL) mkdir $(INTDIR)
+ Copy &&|
+-3 ; Generate 80386 protected-mode compatible instructions
+-a ; Byte alignment
+-dc ; Move string literals from data segment to code segment
+-ff ; Fast floating point
+-H ; Generate and use precompiled headers
+-H=$(INTDIR)\gvim16.csm ; gvim16.csm is the precompiled header filename
+-k- ; No standard stack frame
+-ml ; Large memory model
+-OW ; Suppress the inc bp/dec bp on windows far functions
+-O1 ; Generate smallest possible code
+-O2 ; Generate fastest possible code (overrides prior -O1 control)
+-pr ; Fastcall calling convention passing parameters in registers
+-R- ; Exclude browser information in generated .OBJ files
+-v- ; Turn off source debugging
+-vi ; Turn inline function expansion on
+-WE ; Only __far _export functions are exported
+-w ; Display warnings
+-w-par ; Suppress: Parameter 'parameter' is never used
+-w-pch ; Cannot create pre-compiled header: initialized data in header
+-w-sig ; identifier' declared but never used
+-w-ucp ; Mixing pointers to different 'char' types
+-wuse ; 'identifier' declared but never used
+ $(CompInheritOptsAt_gvim16dexe)
+| $@
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+DEL_TREE = rmdir /s /q
+!ELSE
+NULL=nul
+DEL_TREE = deltree /y
+!ENDIF
+
+CLEAN:
+ -@if exist $(INTDIR)\$(NULL) $(DEL_TREE) $(INTDIR)
+ -@if exist BccW16.cfg erase BccW16.cfg
+ -@if exist gvim16.exe erase gvim16.exe
diff --git a/src/README.txt b/src/README.txt
new file mode 100644
index 000000000..05b864fa7
--- /dev/null
+++ b/src/README.txt
@@ -0,0 +1,140 @@
+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.
diff --git a/src/VisVim/Commands.cpp b/src/VisVim/Commands.cpp
new file mode 100644
index 000000000..254b7a964
--- /dev/null
+++ b/src/VisVim/Commands.cpp
@@ -0,0 +1,693 @@
+#include "stdafx.h"
+#include <comdef.h> // For _bstr_t
+#include "VisVim.h"
+#include "Commands.h"
+#include "OleAut.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+
+#endif
+
+
+// Change directory before opening file?
+#define CD_SOURCE 0 // Cd to source path
+#define CD_SOURCE_PARENT 1 // Cd to parent directory of source path
+#define CD_NONE 2 // No cd
+
+
+static BOOL g_bEnableVim = TRUE; // Vim enabled
+static BOOL g_bDevStudioEditor = FALSE; // Open file in Dev Studio editor simultaneously
+static int g_ChangeDir = CD_NONE; // CD after file open?
+
+static void VimSetEnableState (BOOL bEnableState);
+static BOOL VimOpenFile (BSTR& FileName, long LineNr);
+static DISPID VimGetDispatchId (COleAutomationControl& VimOle, char* Method);
+static void VimErrDiag (COleAutomationControl& VimOle);
+static void VimChangeDir (COleAutomationControl& VimOle, DISPID DispatchId, BSTR& FileName);
+static void DebugMsg (char* Msg, char* Arg = NULL);
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommands
+
+CCommands::CCommands ()
+{
+ // m_pApplication == NULL; M$ Code generation bug!!!
+ m_pApplication = NULL;
+ m_pApplicationEventsObj = NULL;
+ m_pDebuggerEventsObj = NULL;
+}
+
+CCommands::~CCommands ()
+{
+ ASSERT (m_pApplication != NULL);
+ if (m_pApplication)
+ {
+ m_pApplication->Release ();
+ m_pApplication = NULL;
+ }
+}
+
+void CCommands::SetApplicationObject (IApplication * pApplication)
+{
+ // This function assumes pApplication has already been AddRef'd
+ // for us, which CDSAddIn did in its QueryInterface call
+ // just before it called us.
+ m_pApplication = pApplication;
+ if (! m_pApplication)
+ return;
+
+ // Create Application event handlers
+ XApplicationEventsObj::CreateInstance (&m_pApplicationEventsObj);
+ if (! m_pApplicationEventsObj)
+ {
+ ReportInternalError ("XApplicationEventsObj::CreateInstance");
+ return;
+ }
+ m_pApplicationEventsObj->AddRef ();
+ m_pApplicationEventsObj->Connect (m_pApplication);
+ m_pApplicationEventsObj->m_pCommands = this;
+
+#ifdef NEVER
+ // Create Debugger event handler
+ CComPtr < IDispatch > pDebugger;
+ if (SUCCEEDED (m_pApplication->get_Debugger (&pDebugger))
+ && pDebugger != NULL)
+ {
+ XDebuggerEventsObj::CreateInstance (&m_pDebuggerEventsObj);
+ m_pDebuggerEventsObj->AddRef ();
+ m_pDebuggerEventsObj->Connect (pDebugger);
+ m_pDebuggerEventsObj->m_pCommands = this;
+ }
+#endif
+
+ // Get settings from registry HKEY_CURRENT_USER\Software\Vim\VisVim
+ HKEY hAppKey = GetAppKey ("Vim");
+ if (hAppKey)
+ {
+ HKEY hSectionKey = GetSectionKey (hAppKey, "VisVim");
+ if (hSectionKey)
+ {
+ g_bEnableVim = GetRegistryInt (hSectionKey, "EnableVim",
+ g_bEnableVim);
+ g_bDevStudioEditor = GetRegistryInt(hSectionKey,"DevStudioEditor",
+ g_bDevStudioEditor);
+ g_ChangeDir = GetRegistryInt (hSectionKey, "ChangeDir",
+ g_ChangeDir);
+ RegCloseKey (hSectionKey);
+ }
+ RegCloseKey (hAppKey);
+ }
+}
+
+void CCommands::UnadviseFromEvents ()
+{
+ ASSERT (m_pApplicationEventsObj != NULL);
+ if (m_pApplicationEventsObj)
+ {
+ m_pApplicationEventsObj->Disconnect (m_pApplication);
+ m_pApplicationEventsObj->Release ();
+ m_pApplicationEventsObj = NULL;
+ }
+
+#ifdef NEVER
+ if (m_pDebuggerEventsObj)
+ {
+ // Since we were able to connect to the Debugger events, we
+ // should be able to access the Debugger object again to
+ // unadvise from its events (thus the VERIFY_OK below--see
+ // stdafx.h).
+ CComPtr < IDispatch > pDebugger;
+ VERIFY_OK (m_pApplication->get_Debugger (&pDebugger));
+ ASSERT (pDebugger != NULL);
+ m_pDebuggerEventsObj->Disconnect (pDebugger);
+ m_pDebuggerEventsObj->Release ();
+ m_pDebuggerEventsObj = NULL;
+ }
+#endif
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Event handlers
+
+// Application events
+
+HRESULT CCommands::XApplicationEvents::BeforeBuildStart ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::BuildFinish (long nNumErrors, long nNumWarnings)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::BeforeApplicationShutDown ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+// The open document event handle is the place where the real interface work
+// is done.
+// Vim gets called from here.
+//
+HRESULT CCommands::XApplicationEvents::DocumentOpen (IDispatch * theDocument)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ if (! g_bEnableVim)
+ // Vim not enabled or empty command line entered
+ return S_OK;
+
+ // First get the current file name and line number
+
+ // Get the document object
+ CComQIPtr < ITextDocument, &IID_ITextDocument > pDoc (theDocument);
+ if (! pDoc)
+ return S_OK;
+
+ BSTR FileName;
+ long LineNr = -1;
+
+ // Get the document name
+ if (FAILED (pDoc->get_FullName (&FileName)))
+ return S_OK;
+
+ LPDISPATCH pDispSel;
+
+ // Get a selection object dispatch pointer
+ if (SUCCEEDED (pDoc->get_Selection (&pDispSel)))
+ {
+ // Get the selection object
+ CComQIPtr < ITextSelection, &IID_ITextSelection > pSel (pDispSel);
+
+ if (pSel)
+ // Get the selection line number
+ pSel->get_CurrentLine (&LineNr);
+
+ pDispSel->Release ();
+ }
+
+ // Open the file in Vim and position to the current line
+ if (VimOpenFile (FileName, LineNr))
+ {
+ if (! g_bDevStudioEditor)
+ {
+ // Close the document in developer studio
+ CComVariant vSaveChanges = dsSaveChangesPrompt;
+ DsSaveStatus Saved;
+
+ pDoc->Close (vSaveChanges, &Saved);
+ }
+ }
+
+ // We're done here
+ SysFreeString (FileName);
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::BeforeDocumentClose (IDispatch * theDocument)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::DocumentSave (IDispatch * theDocument)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::NewDocument (IDispatch * theDocument)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ if (! g_bEnableVim)
+ // Vim not enabled or empty command line entered
+ return S_OK;
+
+ // First get the current file name and line number
+
+ CComQIPtr < ITextDocument, &IID_ITextDocument > pDoc (theDocument);
+ if (! pDoc)
+ return S_OK;
+
+ BSTR FileName;
+ HRESULT hr;
+
+ hr = pDoc->get_FullName (&FileName);
+ if (FAILED (hr))
+ return S_OK;
+
+ // Open the file in Vim and position to the current line
+ if (VimOpenFile (FileName, 0))
+ {
+ if (! g_bDevStudioEditor)
+ {
+ // Close the document in developer studio
+ CComVariant vSaveChanges = dsSaveChangesPrompt;
+ DsSaveStatus Saved;
+
+ pDoc->Close (vSaveChanges, &Saved);
+ }
+ }
+
+ SysFreeString (FileName);
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::WindowActivate (IDispatch * theWindow)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::WindowDeactivate (IDispatch * theWindow)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::WorkspaceOpen ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::WorkspaceClose ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+HRESULT CCommands::XApplicationEvents::NewWorkspace ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+// Debugger event
+
+HRESULT CCommands::XDebuggerEvents::BreakpointHit (IDispatch * pBreakpoint)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return S_OK;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// VisVim dialog
+
+class CMainDialog : public CDialog
+{
+ public:
+ CMainDialog (CWnd * pParent = NULL); // Standard constructor
+
+ //{{AFX_DATA(CMainDialog)
+ enum { IDD = IDD_ADDINMAIN };
+ int m_ChangeDir;
+ BOOL m_bDevStudioEditor;
+ //}}AFX_DATA
+
+ //{{AFX_VIRTUAL(CMainDialog)
+ protected:
+ virtual void DoDataExchange (CDataExchange * pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+ protected:
+ //{{AFX_MSG(CMainDialog)
+ afx_msg void OnEnable();
+ afx_msg void OnDisable();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP ()
+};
+
+CMainDialog::CMainDialog (CWnd * pParent /* =NULL */ )
+ : CDialog (CMainDialog::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CMainDialog)
+ m_ChangeDir = -1;
+ m_bDevStudioEditor = FALSE;
+ //}}AFX_DATA_INIT
+}
+
+void CMainDialog::DoDataExchange (CDataExchange * pDX)
+{
+ CDialog::DoDataExchange (pDX);
+ //{{AFX_DATA_MAP(CMainDialog)
+ DDX_Radio(pDX, IDC_CD_SOURCE_PATH, m_ChangeDir);
+ DDX_Check (pDX, IDC_DEVSTUDIO_EDITOR, m_bDevStudioEditor);
+ //}}AFX_DATA_MAP
+}
+
+BEGIN_MESSAGE_MAP (CMainDialog, CDialog)
+ //{{AFX_MSG_MAP(CMainDialog)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP ()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CCommands methods
+
+STDMETHODIMP CCommands::VisVimDialog ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ // Use m_pApplication to access the Developer Studio Application
+ // object,
+ // and VERIFY_OK to see error strings in DEBUG builds of your add-in
+ // (see stdafx.h)
+
+ VERIFY_OK (m_pApplication->EnableModeless (VARIANT_FALSE));
+
+ CMainDialog Dlg;
+
+ Dlg.m_bDevStudioEditor = g_bDevStudioEditor;
+ Dlg.m_ChangeDir = g_ChangeDir;
+ if (Dlg.DoModal () == IDOK)
+ {
+ g_bDevStudioEditor = Dlg.m_bDevStudioEditor;
+ g_ChangeDir = Dlg.m_ChangeDir;
+
+ // Save settings to registry HKEY_CURRENT_USER\Software\Vim\VisVim
+ HKEY hAppKey = GetAppKey ("Vim");
+ if (hAppKey)
+ {
+ HKEY hSectionKey = GetSectionKey (hAppKey, "VisVim");
+ if (hSectionKey)
+ {
+ WriteRegistryInt (hSectionKey, "DevStudioEditor",
+ g_bDevStudioEditor);
+ WriteRegistryInt (hSectionKey, "ChangeDir", g_ChangeDir);
+ RegCloseKey (hSectionKey);
+ }
+ RegCloseKey (hAppKey);
+ }
+ }
+
+ VERIFY_OK (m_pApplication->EnableModeless (VARIANT_TRUE));
+ return S_OK;
+}
+
+STDMETHODIMP CCommands::VisVimEnable ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ VimSetEnableState (true);
+ return S_OK;
+}
+
+STDMETHODIMP CCommands::VisVimDisable ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ VimSetEnableState (false);
+ return S_OK;
+}
+
+STDMETHODIMP CCommands::VisVimToggle ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ VimSetEnableState (! g_bEnableVim);
+ return S_OK;
+}
+
+STDMETHODIMP CCommands::VisVimLoad ()
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ // Use m_pApplication to access the Developer Studio Application object,
+ // and VERIFY_OK to see error strings in DEBUG builds of your add-in
+ // (see stdafx.h)
+
+ CComBSTR bStr;
+ // Define dispatch pointers for document and selection objects
+ CComPtr < IDispatch > pDispDoc, pDispSel;
+
+ // Get a document object dispatch pointer
+ VERIFY_OK (m_pApplication->get_ActiveDocument (&pDispDoc));
+ if (! pDispDoc)
+ return S_OK;
+
+ BSTR FileName;
+ long LineNr = -1;
+
+ // Get the document object
+ CComQIPtr < ITextDocument, &IID_ITextDocument > pDoc (pDispDoc);
+
+ if (! pDoc)
+ return S_OK;
+
+ // Get the document name
+ if (FAILED (pDoc->get_FullName (&FileName)))
+ return S_OK;
+
+ // Get a selection object dispatch pointer
+ if (SUCCEEDED (pDoc->get_Selection (&pDispSel)))
+ {
+ // Get the selection object
+ CComQIPtr < ITextSelection, &IID_ITextSelection > pSel (pDispSel);
+
+ if (pSel)
+ // Get the selection line number
+ pSel->get_CurrentLine (&LineNr);
+ }
+
+ // Open the file in Vim
+ VimOpenFile (FileName, LineNr);
+
+ SysFreeString (FileName);
+ return S_OK;
+}
+
+
+//
+// Here we do the actual processing and communication with Vim
+//
+
+// Set the enable state and save to registry
+//
+static void VimSetEnableState (BOOL bEnableState)
+{
+ g_bEnableVim = bEnableState;
+ HKEY hAppKey = GetAppKey ("Vim");
+ if (hAppKey)
+ {
+ HKEY hSectionKey = GetSectionKey (hAppKey, "VisVim");
+ if (hSectionKey)
+ WriteRegistryInt (hSectionKey, "EnableVim", g_bEnableVim);
+ RegCloseKey (hAppKey);
+ }
+}
+
+// Open the file 'FileName' in Vim and goto line 'LineNr'
+// 'FileName' is expected to contain an absolute DOS path including the drive
+// letter.
+// 'LineNr' must contain a valid line number or 0, e. g. for a new file
+//
+static BOOL VimOpenFile (BSTR& FileName, long LineNr)
+{
+
+ // OLE automation object for com. with Vim
+ // When the object goes out of scope, it's desctructor destroys the OLE connection;
+ // This is imortant to avoid blocking the object
+ // (in this memory corruption would be likely when terminating Vim
+ // while still running DevStudio).
+ // So keep this object local!
+ COleAutomationControl VimOle;
+
+ // :cd D:/Src2/VisVim/
+ //
+ // Get a dispatch id for the SendKeys method of Vim;
+ // enables connection to Vim if necessary
+ DISPID DispatchId;
+ DispatchId = VimGetDispatchId (VimOle, "SendKeys");
+ if (! DispatchId)
+ // OLE error, can't obtain dispatch id
+ goto OleError;
+
+ OLECHAR Buf[MAX_OLE_STR];
+ char FileNameTmp[MAX_OLE_STR];
+ char VimCmd[MAX_OLE_STR];
+ char *s, *p;
+
+ // Prepend CTRL-\ CTRL-N to exit insert mode
+ VimCmd[0] = 0x1c;
+ VimCmd[1] = 0x0e;
+ VimCmd[2] = 0;
+
+#ifdef SINGLE_WINDOW
+ // Update the current file in Vim if it has been modified.
+ // Disabled, because it could write the file when you don't want to.
+ sprintf (VimCmd + 2, ":up\n");
+#endif
+ if (! VimOle.Method (DispatchId, "s", TO_OLE_STR_BUF (VimCmd, Buf)))
+ goto OleError;
+
+ // Change Vim working directory to where the file is if desired
+ if (g_ChangeDir != CD_NONE)
+ VimChangeDir (VimOle, DispatchId, FileName);
+
+ // Make Vim open the file.
+ // In the filename convert all \ to /, put a \ before a space.
+ sprintf(VimCmd, ":drop ");
+ sprintf(FileNameTmp, "%S", (char *)FileName);
+ s = VimCmd + 6;
+ for (p = FileNameTmp; *p != '\0' && s < FileNameTmp + MAX_OLE_STR - 4;
+ ++p)
+ if (*p == '\\')
+ *s++ = '/';
+ else
+ {
+ if (*p == ' ')
+ *s++ = '\\';
+ *s++ = *p;
+ }
+ *s++ = '\n';
+ *s = '\0';
+
+ if (! VimOle.Method (DispatchId, "s", TO_OLE_STR_BUF (VimCmd, Buf)))
+ goto OleError;
+
+ if (LineNr > 0)
+ {
+ // Goto line
+ sprintf (VimCmd, ":%d\n", LineNr);
+ if (! VimOle.Method (DispatchId, "s", TO_OLE_STR_BUF (VimCmd, Buf)))
+ goto OleError;
+ }
+
+ // Make Vim come to the foreground
+ if (! VimOle.Method ("SetForeground"))
+ VimOle.ErrDiag ();
+
+ // We're done
+ return true;
+
+ OleError:
+ // There was an OLE error
+ // Check if it's the "unknown class string" error
+ VimErrDiag (VimOle);
+ return false;
+}
+
+// Return the dispatch id for the Vim method 'Method'
+// Create the Vim OLE object if necessary
+// Returns a valid dispatch id or null on error
+//
+static DISPID VimGetDispatchId (COleAutomationControl& VimOle, char* Method)
+{
+ // Initialize Vim OLE connection if not already done
+ if (! VimOle.IsCreated ())
+ {
+ if (! VimOle.CreateObject ("Vim.Application"))
+ return NULL;
+ }
+
+ // Get the dispatch id for the SendKeys method.
+ // By doing this, we are checking if Vim is still there...
+ DISPID DispatchId = VimOle.GetDispatchId ("SendKeys");
+ if (! DispatchId)
+ {
+ // We can't get a dispatch id.
+ // This means that probably Vim has been terminated.
+ // Don't issue an error message here, instead
+ // destroy the OLE object and try to connect once more
+ //
+ // In fact, this should never happen, because the OLE aut. object
+ // should not be kept long enough to allow the user to terminate Vim
+ // to avoid memory corruption (why the heck is there no system garbage
+ // collection for those damned OLE memory chunks???).
+ VimOle.DeleteObject ();
+ if (! VimOle.CreateObject ("Vim.Application"))
+ // If this create fails, it's time for an error msg
+ return NULL;
+
+ if (! (DispatchId = VimOle.GetDispatchId ("SendKeys")))
+ // There is something wrong...
+ return NULL;
+ }
+
+ return DispatchId;
+}
+
+// Output an error message for an OLE error
+// Check on the classstring error, which probably means Vim wasn't registered.
+//
+static void VimErrDiag (COleAutomationControl& VimOle)
+{
+ SCODE sc = GetScode (VimOle.GetResult ());
+ if (sc == CO_E_CLASSSTRING)
+ {
+ char Buf[256];
+ sprintf (Buf, "There is no registered OLE automation server named "
+ "\"Vim.Application\".\n"
+ "Use the OLE-enabled version of Vim with VisVim and "
+ "make sure to register Vim by running \"vim -register\".");
+ MessageBox (NULL, Buf, "OLE Error", MB_OK);
+ }
+ else
+ VimOle.ErrDiag ();
+}
+
+// Change directory to the directory the file 'FileName' is in or it's parent
+// directory according to the setting of the global 'g_ChangeDir':
+// 'FileName' is expected to contain an absolute DOS path including the drive
+// letter.
+// CD_NONE
+// CD_SOURCE_PATH
+// CD_SOURCE_PARENT
+//
+static void VimChangeDir (COleAutomationControl& VimOle, DISPID DispatchId, BSTR& FileName)
+{
+ // Do a :cd first
+
+ // Get the path name of the file ("dir/")
+ CString StrFileName = FileName;
+ char Drive[_MAX_DRIVE];
+ char Dir[_MAX_DIR];
+ char DirUnix[_MAX_DIR * 2];
+ char *s, *t;
+
+ _splitpath (StrFileName, Drive, Dir, NULL, NULL);
+
+ // Convert to Unix path name format, escape spaces.
+ t = DirUnix;
+ for (s = Dir; *s; ++s)
+ if (*s == '\\')
+ *t++ = '/';
+ else
+ {
+ if (*s == ' ')
+ *t++ = '\\';
+ *t++ = *s;
+ }
+ *t = '\0';
+
+
+ // Construct the cd command; append /.. if cd to parent
+ // directory and not in root directory
+ OLECHAR Buf[MAX_OLE_STR];
+ char VimCmd[MAX_OLE_STR];
+
+ sprintf (VimCmd, ":cd %s%s%s\n", Drive, DirUnix,
+ g_ChangeDir == CD_SOURCE_PARENT && DirUnix[1] ? ".." : "");
+ VimOle.Method (DispatchId, "s", TO_OLE_STR_BUF (VimCmd, Buf));
+}
+
+#ifdef _DEBUG
+// Print out a debug message
+//
+static void DebugMsg (char* Msg, char* Arg)
+{
+ char Buf[400];
+ sprintf (Buf, Msg, Arg);
+ AfxMessageBox (Buf);
+}
+#endif
+
diff --git a/src/VisVim/Commands.h b/src/VisVim/Commands.h
new file mode 100644
index 000000000..e47c81a13
--- /dev/null
+++ b/src/VisVim/Commands.h
@@ -0,0 +1,127 @@
+// Commands.h : header file
+//
+
+#if !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_)
+#define AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_
+
+#include "vsvtypes.h"
+
+class CCommands :
+ public CComDualImpl < ICommands,
+ &IID_ICommands,
+ &LIBID_VisVim >,
+ public CComObjectRoot,
+ public CComCoClass < CCommands,
+ &CLSID_Commands >
+{
+ protected:
+ IApplication * m_pApplication;
+
+ public:
+ CCommands ();
+ ~CCommands ();
+ void SetApplicationObject (IApplication * m_pApplication);
+ IApplication *GetApplicationObject ()
+ {
+ return m_pApplication;
+ }
+ void UnadviseFromEvents ();
+
+ BEGIN_COM_MAP (CCommands)
+ COM_INTERFACE_ENTRY (IDispatch)
+ COM_INTERFACE_ENTRY (ICommands)
+ END_COM_MAP ()
+ DECLARE_NOT_AGGREGATABLE (CCommands)
+
+ protected:
+ // This class template is used as the base class for the Application
+ // event handler object and the Debugger event handler object,
+ // which are declared below.
+ template < class IEvents,
+ const IID * piidEvents,
+ const GUID * plibid,
+ class XEvents,
+ const CLSID * pClsidEvents >
+ class XEventHandler :
+ public CComDualImpl < IEvents,
+ piidEvents,
+ plibid >,
+ public CComObjectRoot,
+ public CComCoClass < XEvents,
+ pClsidEvents >
+ {
+ public:
+ BEGIN_COM_MAP (XEvents)
+ COM_INTERFACE_ENTRY (IDispatch)
+ COM_INTERFACE_ENTRY_IID (*piidEvents, IEvents)
+ END_COM_MAP ()
+ DECLARE_NOT_AGGREGATABLE (XEvents)
+ void Connect (IUnknown * pUnk)
+ {
+ VERIFY (SUCCEEDED (AtlAdvise (pUnk, this, *piidEvents,
+ &m_dwAdvise)));
+ }
+ void Disconnect (IUnknown * pUnk)
+ {
+ AtlUnadvise (pUnk, *piidEvents, m_dwAdvise);
+ }
+
+ CCommands *m_pCommands;
+
+ protected:
+ DWORD m_dwAdvise;
+ };
+
+ // This object handles events fired by the Application object
+ class XApplicationEvents : public XEventHandler < IApplicationEvents,
+ &IID_IApplicationEvents,
+ &LIBID_VisVim,
+ XApplicationEvents,
+ &CLSID_ApplicationEvents >
+ {
+ public:
+ // IApplicationEvents methods
+ STDMETHOD (BeforeBuildStart) (THIS);
+ STDMETHOD (BuildFinish) (THIS_ long nNumErrors, long nNumWarnings);
+ STDMETHOD (BeforeApplicationShutDown) (THIS);
+ STDMETHOD (DocumentOpen) (THIS_ IDispatch * theDocument);
+ STDMETHOD (BeforeDocumentClose) (THIS_ IDispatch * theDocument);
+ STDMETHOD (DocumentSave) (THIS_ IDispatch * theDocument);
+ STDMETHOD (NewDocument) (THIS_ IDispatch * theDocument);
+ STDMETHOD (WindowActivate) (THIS_ IDispatch * theWindow);
+ STDMETHOD (WindowDeactivate) (THIS_ IDispatch * theWindow);
+ STDMETHOD (WorkspaceOpen) (THIS);
+ STDMETHOD (WorkspaceClose) (THIS);
+ STDMETHOD (NewWorkspace) (THIS);
+ };
+ typedef CComObject < XApplicationEvents > XApplicationEventsObj;
+ XApplicationEventsObj *m_pApplicationEventsObj;
+
+ // This object handles events fired by the Application object
+ class XDebuggerEvents : public XEventHandler < IDebuggerEvents,
+ &IID_IDebuggerEvents,
+ &LIBID_VisVim,
+ XDebuggerEvents,
+ &CLSID_DebuggerEvents >
+ {
+ public:
+ // IDebuggerEvents method
+ STDMETHOD (BreakpointHit) (THIS_ IDispatch * pBreakpoint);
+ };
+ typedef CComObject < XDebuggerEvents > XDebuggerEventsObj;
+ XDebuggerEventsObj *m_pDebuggerEventsObj;
+
+ public:
+ // ICommands methods
+ STDMETHOD (VisVimDialog) (THIS);
+ STDMETHOD (VisVimEnable) (THIS);
+ STDMETHOD (VisVimDisable) (THIS);
+ STDMETHOD (VisVimToggle) (THIS);
+ STDMETHOD (VisVimLoad) (THIS);
+};
+
+typedef CComObject < CCommands > CCommandsObj;
+
+//{{AFX_INSERT_LOCATION}}
+
+#endif // !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED)
diff --git a/src/VisVim/DSAddIn.cpp b/src/VisVim/DSAddIn.cpp
new file mode 100644
index 000000000..3e7254461
--- /dev/null
+++ b/src/VisVim/DSAddIn.cpp
@@ -0,0 +1,160 @@
+#include "stdafx.h"
+#include "VisVim.h"
+#include "DSAddIn.h"
+#include "Commands.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+
+#endif
+
+// This is called when the user first loads the add-in, and on start-up
+// of each subsequent Developer Studio session
+STDMETHODIMP CDSAddIn::OnConnection (IApplication * pApp, VARIANT_BOOL bFirstTime,
+ long dwCookie, VARIANT_BOOL * OnConnection)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ *OnConnection = VARIANT_FALSE;
+
+ // Store info passed to us
+ IApplication *pApplication = NULL;
+ HRESULT hr;
+
+ hr = pApp->QueryInterface (IID_IApplication, (void **) &pApplication);
+ if (FAILED (hr))
+ {
+ ReportLastError (hr);
+ return E_UNEXPECTED;
+ }
+ if (pApplication == NULL)
+ {
+ ReportInternalError ("IApplication::QueryInterface");
+ return E_UNEXPECTED;
+ }
+
+ m_dwCookie = dwCookie;
+
+ // Create command dispatch, send info back to DevStudio
+ CCommandsObj::CreateInstance (&m_pCommands);
+ if (! m_pCommands)
+ {
+ ReportInternalError ("CCommandsObj::CreateInstance");
+ return E_UNEXPECTED;
+ }
+ m_pCommands->AddRef ();
+
+ // The QueryInterface above AddRef'd the Application object. It will
+ // be Release'd in CCommand's destructor.
+ m_pCommands->SetApplicationObject (pApplication);
+
+ hr = pApplication->SetAddInInfo ((long) AfxGetInstanceHandle (),
+ (LPDISPATCH) m_pCommands, IDR_TOOLBAR_MEDIUM, IDR_TOOLBAR_LARGE,
+ m_dwCookie);
+ if (FAILED (hr))
+ {
+ ReportLastError (hr);
+ return E_UNEXPECTED;
+ }
+
+ // Inform DevStudio of the commands we implement
+ if (! AddCommand (pApplication, "VisVimDialog", "VisVimDialogCmd",
+ IDS_CMD_DIALOG, 0, bFirstTime))
+ return E_UNEXPECTED;
+ if (! AddCommand (pApplication, "VisVimEnable", "VisVimEnableCmd",
+ IDS_CMD_ENABLE, 1, bFirstTime))
+ return E_UNEXPECTED;
+ if (! AddCommand (pApplication, "VisVimDisable", "VisVimDisableCmd",
+ IDS_CMD_DISABLE, 2, bFirstTime))
+ return E_UNEXPECTED;
+ if (! AddCommand (pApplication, "VisVimToggle", "VisVimToggleCmd",
+ IDS_CMD_TOGGLE, 3, bFirstTime))
+ return E_UNEXPECTED;
+ if (! AddCommand (pApplication, "VisVimLoad", "VisVimLoadCmd",
+ IDS_CMD_LOAD, 4, bFirstTime))
+ return E_UNEXPECTED;
+
+ *OnConnection = VARIANT_TRUE;
+ return S_OK;
+}
+
+// This is called on shut-down, and also when the user unloads the add-in
+STDMETHODIMP CDSAddIn::OnDisconnection (VARIANT_BOOL bLastTime)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ m_pCommands->UnadviseFromEvents ();
+ m_pCommands->Release ();
+ m_pCommands = NULL;
+
+ return S_OK;
+}
+
+// Add a command to DevStudio
+// Creates a toolbar button for the command also.
+// 'MethodName' is the name of the methode specified in the .odl file
+// 'StrResId' the resource id of the descriptive string
+// 'GlyphIndex' the image index into the command buttons bitmap
+// Return true on success
+//
+bool CDSAddIn::AddCommand (IApplication* pApp, char* MethodName, char* CmdName,
+ UINT StrResId, UINT GlyphIndex, VARIANT_BOOL bFirstTime)
+{
+ CString CmdString;
+ CString CmdText;
+
+ CmdText.LoadString (StrResId);
+ CmdString = CmdName;
+ CmdString += CmdText;
+
+ CComBSTR bszCmdString (CmdString);
+ CComBSTR bszMethod (MethodName);
+ CComBSTR bszCmdName (CmdName);
+
+ // (see stdafx.h for the definition of VERIFY_OK)
+
+ VARIANT_BOOL bRet;
+ VERIFY_OK (pApp->AddCommand (bszCmdString, bszMethod, GlyphIndex,
+ m_dwCookie, &bRet));
+ if (bRet == VARIANT_FALSE)
+ {
+ // AddCommand failed because a command with this name already exists.
+ ReportInternalError ("IApplication::AddCommand");
+ return FALSE;
+ }
+
+ // Add toolbar buttons only if this is the first time the add-in
+ // is being loaded. Toolbar buttons are automatically remembered
+ // by Developer Studio from session to session, so we should only
+ // add the toolbar buttons once.
+ if (bFirstTime == VARIANT_TRUE)
+ VERIFY_OK (pApp->AddCommandBarButton (dsGlyph, bszCmdName, m_dwCookie));
+
+ return TRUE;
+}
+
+void ReportLastError (HRESULT Err)
+{
+ char *Buf = NULL;
+ char Msg[512];
+
+ FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, Err,
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ Buf, 400, NULL);
+ sprintf (Msg, "Unexpected error (Error code: %lx)\n%s", Err, Buf);
+
+ ::MessageBox (NULL, Msg, "VisVim", MB_OK | MB_ICONSTOP);
+ if (Buf)
+ LocalFree (Buf);
+}
+
+void ReportInternalError (char* Fct)
+{
+ char Msg[512];
+
+ sprintf (Msg, "Unexpected error\n%s failed", Fct);
+ ::MessageBox (NULL, Msg, "VisVim", MB_OK | MB_ICONSTOP);
+}
+
diff --git a/src/VisVim/DSAddIn.h b/src/VisVim/DSAddIn.h
new file mode 100644
index 000000000..72828722f
--- /dev/null
+++ b/src/VisVim/DSAddIn.h
@@ -0,0 +1,53 @@
+// DSAddIn.h : header file
+//
+
+#if !defined(AFX_DSADDIN_H__AC726715_2977_11D1_B2F3_006008040780__INCLUDED_)
+#define AFX_DSADDIN_H__AC726715_2977_11D1_B2F3_006008040780__INCLUDED_
+
+#include "commands.h"
+
+// {4F9E01C0-406B-11d2-8006-00001C405077}
+DEFINE_GUID (CLSID_DSAddIn,
+ 0x4f9e01c0, 0x406b, 0x11d2, 0x80, 0x6, 0x0, 0x0, 0x1c, 0x40, 0x50, 0x77);
+
+/////////////////////////////////////////////////////////////////////////////
+// CDSAddIn
+
+class CDSAddIn :
+ public IDSAddIn,
+ public CComObjectRoot,
+ public CComCoClass < CDSAddIn,
+ &CLSID_DSAddIn >
+{
+ public:
+ DECLARE_REGISTRY (CDSAddIn, "VisVim.DSAddIn.1",
+ "VisVim Developer Studio Add-in", IDS_VISVIM_LONGNAME,
+ THREADFLAGS_BOTH)
+
+ CDSAddIn ()
+ {
+ }
+
+ BEGIN_COM_MAP (CDSAddIn)
+ COM_INTERFACE_ENTRY (IDSAddIn)
+ END_COM_MAP ()
+ DECLARE_NOT_AGGREGATABLE (CDSAddIn)
+
+ // IDSAddIns
+ public:
+ STDMETHOD (OnConnection) (THIS_ IApplication * pApp, VARIANT_BOOL bFirstTime,
+ long dwCookie, VARIANT_BOOL * OnConnection);
+ STDMETHOD (OnDisconnection) (THIS_ VARIANT_BOOL bLastTime);
+
+ protected:
+ bool AddCommand (IApplication* pApp, char* MethodName, char* CmdName,
+ UINT StrResId, UINT GlyphIndex, VARIANT_BOOL bFirstTime);
+
+ protected:
+ CCommandsObj * m_pCommands;
+ DWORD m_dwCookie;
+};
+
+//{{AFX_INSERT_LOCATION}}
+
+#endif // !defined(AFX_DSADDIN_H__AC726715_2977_11D1_B2F3_006008040780__INCLUDED)
diff --git a/src/VisVim/OleAut.cpp b/src/VisVim/OleAut.cpp
new file mode 100644
index 000000000..0e01b1ec1
--- /dev/null
+++ b/src/VisVim/OleAut.cpp
@@ -0,0 +1,781 @@
+//
+// Class for creating OLE automation controllers.
+//
+// CreateObject() creates an automation object
+// Invoke() will call a property or method of the automation object.
+// GetProperty() returns a property
+// SetProperty() changes a property
+// Method() invokes a method
+//
+// For example, the following VB code will control Microsoft Word:
+//
+// Private Sub Form_Load()
+// Dim wb As Object
+// Set wb = CreateObject("Word.Basic")
+// wb.AppShow
+// wb.FileNewDefault
+// wb.Insert "This is a test"
+// wb.FileSaveAs "c:\sample.doc)"
+// End Sub
+//
+// A C++ automation controller that does the same can be written as follows:
+// the helper functions:
+//
+// Void FormLoad ()
+// {
+// COleAutomationControl Aut;
+// Aut.CreateObject("Word.Basic");
+// Aut.Method ("AppShow");
+// Aut.Method ("FileNewDefault");
+// Aut.Method ("Insert", "s", (LPOLESTR) OLESTR ("This is a test"));
+// Aut.Method ("FileSaveAs", "s", OLESTR ("c:\\sample.doc"));
+// }
+//
+//
+
+#include "stdafx.h"
+#include <stdarg.h>
+#include "oleaut.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+static bool CountArgsInFormat (LPCTSTR Format, UINT* nArgs);
+static LPCTSTR GetNextVarType (LPCTSTR Format, VARTYPE* pVarType);
+
+
+COleAutomationControl::COleAutomationControl ()
+{
+ m_pDispatch = NULL;
+ m_hResult = NOERROR;
+ m_nErrArg = 0;
+ VariantInit (&m_VariantResult);
+}
+
+COleAutomationControl::~COleAutomationControl ()
+{
+ DeleteObject ();
+}
+
+void COleAutomationControl::DeleteObject ()
+{
+ if (m_pDispatch)
+ {
+ m_pDispatch->Release ();
+ m_pDispatch = NULL;
+ }
+}
+
+// Creates an instance of the Automation object and
+// obtains it's IDispatch interface.
+//
+// Parameters:
+// ProgId ProgID of Automation object
+//
+bool COleAutomationControl::CreateObject (char* ProgId)
+{
+ CLSID ClsId; // CLSID of automation object
+ LPUNKNOWN pUnknown = NULL; // IUnknown of automation object
+
+ // Retrieve CLSID from the progID that the user specified
+ LPOLESTR OleProgId = TO_OLE_STR (ProgId);
+ m_hResult = CLSIDFromProgID (OleProgId, &ClsId);
+ if (FAILED (m_hResult))
+ goto error;
+
+ // Create an instance of the automation object and ask for the
+ // IDispatch interface
+ m_hResult = CoCreateInstance (ClsId, NULL, CLSCTX_SERVER,
+ IID_IUnknown, (void**) &pUnknown);
+ if (FAILED (m_hResult))
+ goto error;
+
+ m_hResult = pUnknown->QueryInterface (IID_IDispatch, (void**) &m_pDispatch);
+ if (FAILED (m_hResult))
+ goto error;
+
+ pUnknown->Release ();
+ return true;
+
+error:
+ if (pUnknown)
+ pUnknown->Release ();
+ if (m_pDispatch)
+ m_pDispatch->Release ();
+ return false;
+}
+
+// Return the dispatch id of a named service
+// This id can be used in subsequent calls to GetProperty (), SetProperty () and
+// Method (). This is the prefered method when performance is important.
+//
+DISPID COleAutomationControl::GetDispatchId (char* Name)
+{
+ DISPID DispatchId;
+
+ ASSERT (m_pDispatch);
+
+ // Get DISPID of property/method
+ LPOLESTR OleName = TO_OLE_STR (Name);
+ m_hResult = m_pDispatch->GetIDsOfNames (IID_NULL, &OleName, 1,
+ LOCALE_USER_DEFAULT, &DispatchId);
+ if (FAILED (m_hResult))
+ return NULL;
+ return DispatchId;
+}
+
+// The following functions use these parameters:
+//
+// Parameters:
+//
+// Name Name of property or method.
+//
+// Format Format string that describes the variable list of parameters that
+// follows. The format string can contain the follwoing characters.
+// & = mark the following format character as VT_BYREF
+// B = VT_BOOL
+// i = VT_I2
+// I = VT_I4
+// r = VT_R2
+// R = VT_R4
+// c = VT_CY
+// s = VT_BSTR (string pointer can be passed,
+// BSTR will be allocated by this function).
+// e = VT_ERROR
+// d = VT_DATE
+// v = VT_VARIANT. Use this to pass data types that are not described
+// in the format string. (For example SafeArrays).
+// D = VT_DISPATCH
+// U = VT_UNKNOWN
+//
+// ... Arguments of the property or method.
+// Arguments are described by Format.
+//
+
+bool COleAutomationControl::GetProperty (char* Name)
+{
+ return Invoke (DISPATCH_PROPERTYGET, Name, NULL, NULL);
+}
+
+bool COleAutomationControl::GetProperty (DISPID DispatchId)
+{
+ return Invoke (DISPATCH_PROPERTYGET, DispatchId, NULL, NULL);
+}
+
+bool COleAutomationControl::PutProperty (char* Name, LPCTSTR Format, ...)
+{
+ va_list ArgList;
+
+ va_start (ArgList, Format);
+ bool bRet = Invoke (DISPATCH_PROPERTYPUT, Name, Format, ArgList);
+ va_end (ArgList);
+ return bRet;
+}
+
+bool COleAutomationControl::PutProperty (DISPID DispatchId, LPCTSTR Format, ...)
+{
+ va_list ArgList;
+
+ va_start (ArgList, Format);
+ bool bRet = Invoke (DISPATCH_PROPERTYPUT, DispatchId, Format, ArgList);
+ va_end (ArgList);
+ return bRet;
+}
+
+bool COleAutomationControl::Method (char* Name, LPCTSTR Format, ...)
+{
+ va_list ArgList;
+
+ va_start (ArgList, Format);
+ bool bRet = Invoke (DISPATCH_METHOD, Name, Format, ArgList);
+ va_end (ArgList);
+ return bRet;
+}
+
+bool COleAutomationControl::Method (DISPID DispatchId, LPCTSTR Format, ...)
+{
+ va_list ArgList;
+
+ va_start (ArgList, Format);
+ bool bRet = Invoke (DISPATCH_METHOD, DispatchId, Format, ArgList);
+ va_end (ArgList);
+ return bRet;
+}
+
+bool COleAutomationControl::Invoke (WORD Flags, char* Name,
+ LPCTSTR Format, va_list ArgList)
+{
+ DISPID DispatchId = GetDispatchId (Name);
+ if (! DispatchId)
+ return false;
+ return Invoke (Flags, DispatchId, Format, ArgList);
+}
+
+bool COleAutomationControl::Invoke (WORD Flags, DISPID DispatchId,
+ LPCTSTR Format, va_list ArgList)
+{
+ UINT ArgCount = 0;
+ VARIANTARG* ArgVector = NULL;
+
+ ASSERT (m_pDispatch);
+
+ DISPPARAMS DispatchParams;
+ memset (&DispatchParams, 0, sizeof (DispatchParams));
+
+ // Determine number of arguments
+ if (Format)
+ CountArgsInFormat (Format, &ArgCount);
+
+ // Property puts have a named argument that represents the value that
+ // the property is being assigned.
+ DISPID DispIdNamed = DISPID_PROPERTYPUT;
+ if (Flags & DISPATCH_PROPERTYPUT)
+ {
+ if (ArgCount == 0)
+ {
+ m_hResult = ResultFromScode (E_INVALIDARG);
+ return false;
+ }
+ DispatchParams.cNamedArgs = 1;
+ DispatchParams.rgdispidNamedArgs = &DispIdNamed;
+ }
+
+ if (ArgCount)
+ {
+ // Allocate memory for all VARIANTARG parameters
+ ArgVector = (VARIANTARG*) CoTaskMemAlloc (
+ ArgCount * sizeof (VARIANTARG));
+ if (! ArgVector)
+ {
+ m_hResult = ResultFromScode (E_OUTOFMEMORY);
+ return false;
+ }
+ memset (ArgVector, 0, sizeof (VARIANTARG) * ArgCount);
+
+ // Get ready to walk vararg list
+ LPCTSTR s = Format;
+
+ VARIANTARG *p = ArgVector + ArgCount - 1; // Params go in opposite order
+
+ for (;;)
+ {
+ VariantInit (p);
+ if (! (s = GetNextVarType (s, &p->vt)))
+ break;
+
+ if (p < ArgVector)
+ {
+ m_hResult = ResultFromScode (E_INVALIDARG);
+ goto Cleanup;
+ }
+ switch (p->vt)
+ {
+ case VT_I2:
+ V_I2 (p) = va_arg (ArgList, short);
+ break;
+ case VT_I4:
+ V_I4 (p) = va_arg (ArgList, long);
+ break;
+ case VT_R4:
+ V_R4 (p) = va_arg (ArgList, float);
+ break;
+ case VT_DATE:
+ case VT_R8:
+ V_R8 (p) = va_arg (ArgList, double);
+ break;
+ case VT_CY:
+ V_CY (p) = va_arg (ArgList, CY);
+ break;
+ case VT_BSTR:
+ V_BSTR (p) = SysAllocString (va_arg (ArgList,
+ OLECHAR*));
+ if (! p->bstrVal)
+ {
+ m_hResult = ResultFromScode (E_OUTOFMEMORY);
+ p->vt = VT_EMPTY;
+ goto Cleanup;
+ }
+ break;
+ case VT_DISPATCH:
+ V_DISPATCH (p) = va_arg (ArgList, LPDISPATCH);
+ break;
+ case VT_ERROR:
+ V_ERROR (p) = va_arg (ArgList, SCODE);
+ break;
+ case VT_BOOL:
+ V_BOOL (p) = va_arg (ArgList, BOOL) ? -1 : 0;
+ break;
+ case VT_VARIANT:
+ *p = va_arg (ArgList, VARIANTARG);
+ break;
+ case VT_UNKNOWN:
+ V_UNKNOWN (p) = va_arg (ArgList, LPUNKNOWN);
+ break;
+
+ case VT_I2 | VT_BYREF:
+ V_I2REF (p) = va_arg (ArgList, short*);
+ break;
+ case VT_I4 | VT_BYREF:
+ V_I4REF (p) = va_arg (ArgList, long*);
+ break;
+ case VT_R4 | VT_BYREF:
+ V_R4REF (p) = va_arg (ArgList, float*);
+ break;
+ case VT_R8 | VT_BYREF:
+ V_R8REF (p) = va_arg (ArgList, double*);
+ break;
+ case VT_DATE | VT_BYREF:
+ V_DATEREF (p) = va_arg (ArgList, DATE*);
+ break;
+ case VT_CY | VT_BYREF:
+ V_CYREF (p) = va_arg (ArgList, CY*);
+ break;
+ case VT_BSTR | VT_BYREF:
+ V_BSTRREF (p) = va_arg (ArgList, BSTR*);
+ break;
+ case VT_DISPATCH | VT_BYREF:
+ V_DISPATCHREF (p) = va_arg (ArgList, LPDISPATCH*);
+ break;
+ case VT_ERROR | VT_BYREF:
+ V_ERRORREF (p) = va_arg (ArgList, SCODE*);
+ break;
+ case VT_BOOL | VT_BYREF:
+ {
+ BOOL* pBool = va_arg (ArgList, BOOL*);
+
+ *pBool = 0;
+ V_BOOLREF (p) = (VARIANT_BOOL*) pBool;
+ }
+ break;
+ case VT_VARIANT | VT_BYREF:
+ V_VARIANTREF (p) = va_arg (ArgList, VARIANTARG*);
+ break;
+ case VT_UNKNOWN | VT_BYREF:
+ V_UNKNOWNREF (p) = va_arg (ArgList, LPUNKNOWN*);
+ break;
+
+ default:
+ {
+ m_hResult = ResultFromScode (E_INVALIDARG);
+ goto Cleanup;
+ }
+ break;
+ }
+
+ --p; // Get ready to fill next argument
+ }
+ }
+
+ DispatchParams.cArgs = ArgCount;
+ DispatchParams.rgvarg = ArgVector;
+
+ // Initialize return variant, in case caller forgot. Caller can pass
+ // NULL if return value is not expected.
+ VariantInit (&m_VariantResult);
+
+ // Make the call
+ m_hResult = m_pDispatch->Invoke (DispatchId, IID_NULL, LOCALE_USER_DEFAULT,
+ Flags, &DispatchParams, &m_VariantResult,
+ &m_ExceptionInfo, &m_nErrArg);
+
+ Cleanup:
+ // Cleanup any arguments that need cleanup
+ if (ArgCount)
+ {
+ VARIANTARG* p = ArgVector;
+
+ while (ArgCount--)
+ {
+ switch (p->vt)
+ {
+ case VT_BSTR:
+ VariantClear (p);
+ break;
+ }
+ ++p;
+ }
+ CoTaskMemFree (ArgVector);
+ }
+
+ return FAILED (m_hResult) ? false : true;
+}
+
+#define CASE_SCODE(sc) \
+ case sc: \
+ lstrcpy((char*)ErrName, (char*)#sc); \
+ break;
+
+void COleAutomationControl::ErrDiag ()
+{
+ char ErrName[200];
+
+ SCODE sc = GetScode (m_hResult);
+ switch (sc)
+ {
+ // SCODE's defined in SCODE.H
+ CASE_SCODE (S_OK)
+ CASE_SCODE (S_FALSE)
+ CASE_SCODE (E_UNEXPECTED)
+ CASE_SCODE (E_OUTOFMEMORY)
+ CASE_SCODE (E_INVALIDARG)
+ CASE_SCODE (E_NOINTERFACE)
+ CASE_SCODE (E_POINTER)
+ CASE_SCODE (E_HANDLE)
+ CASE_SCODE (E_ABORT)
+ CASE_SCODE (E_FAIL)
+ CASE_SCODE (E_ACCESSDENIED)
+
+ // SCODE's defined in OLE2.H
+ CASE_SCODE (OLE_E_OLEVERB)
+ CASE_SCODE (OLE_E_ADVF)
+ CASE_SCODE (OLE_E_ENUM_NOMORE)
+ CASE_SCODE (OLE_E_ADVISENOTSUPPORTED)
+ CASE_SCODE (OLE_E_NOCONNECTION)
+ CASE_SCODE (OLE_E_NOTRUNNING)
+ CASE_SCODE (OLE_E_NOCACHE)
+ CASE_SCODE (OLE_E_BLANK)
+ CASE_SCODE (OLE_E_CLASSDIFF)
+ CASE_SCODE (OLE_E_CANT_GETMONIKER)
+ CASE_SCODE (OLE_E_CANT_BINDTOSOURCE)
+ CASE_SCODE (OLE_E_STATIC)
+ CASE_SCODE (OLE_E_PROMPTSAVECANCELLED)
+ CASE_SCODE (OLE_E_INVALIDRECT)
+ CASE_SCODE (OLE_E_WRONGCOMPOBJ)
+ CASE_SCODE (OLE_E_INVALIDHWND)
+ CASE_SCODE (OLE_E_NOT_INPLACEACTIVE)
+ CASE_SCODE (OLE_E_CANTCONVERT)
+ CASE_SCODE (OLE_E_NOSTORAGE)
+
+ CASE_SCODE (DV_E_FORMATETC)
+ CASE_SCODE (DV_E_DVTARGETDEVICE)
+ CASE_SCODE (DV_E_STGMEDIUM)
+ CASE_SCODE (DV_E_STATDATA)
+ CASE_SCODE (DV_E_LINDEX)
+ CASE_SCODE (DV_E_TYMED)
+ CASE_SCODE (DV_E_CLIPFORMAT)
+ CASE_SCODE (DV_E_DVASPECT)
+ CASE_SCODE (DV_E_DVTARGETDEVICE_SIZE)
+ CASE_SCODE (DV_E_NOIVIEWOBJECT)
+
+ CASE_SCODE (OLE_S_USEREG)
+ CASE_SCODE (OLE_S_STATIC)
+ CASE_SCODE (OLE_S_MAC_CLIPFORMAT)
+
+ CASE_SCODE (CONVERT10_E_OLESTREAM_GET)
+ CASE_SCODE (CONVERT10_E_OLESTREAM_PUT)
+ CASE_SCODE (CONVERT10_E_OLESTREAM_FMT)
+ CASE_SCODE (CONVERT10_E_OLESTREAM_BITMAP_TO_DIB)
+ CASE_SCODE (CONVERT10_E_STG_FMT)
+ CASE_SCODE (CONVERT10_E_STG_NO_STD_STREAM)
+ CASE_SCODE (CONVERT10_E_STG_DIB_TO_BITMAP)
+ CASE_SCODE (CONVERT10_S_NO_PRESENTATION)
+
+ CASE_SCODE (CLIPBRD_E_CANT_OPEN)
+ CASE_SCODE (CLIPBRD_E_CANT_EMPTY)
+ CASE_SCODE (CLIPBRD_E_CANT_SET)
+ CASE_SCODE (CLIPBRD_E_BAD_DATA)
+ CASE_SCODE (CLIPBRD_E_CANT_CLOSE)
+
+ CASE_SCODE (DRAGDROP_E_NOTREGISTERED)
+ CASE_SCODE (DRAGDROP_E_ALREADYREGISTERED)
+ CASE_SCODE (DRAGDROP_E_INVALIDHWND)
+ CASE_SCODE (DRAGDROP_S_DROP)
+ CASE_SCODE (DRAGDROP_S_CANCEL)
+ CASE_SCODE (DRAGDROP_S_USEDEFAULTCURSORS)
+
+ CASE_SCODE (OLEOBJ_E_NOVERBS)
+ CASE_SCODE (OLEOBJ_E_INVALIDVERB)
+ CASE_SCODE (OLEOBJ_S_INVALIDVERB)
+ CASE_SCODE (OLEOBJ_S_CANNOT_DOVERB_NOW)
+ CASE_SCODE (OLEOBJ_S_INVALIDHWND)
+ CASE_SCODE (INPLACE_E_NOTUNDOABLE)
+ CASE_SCODE (INPLACE_E_NOTOOLSPACE)
+ CASE_SCODE (INPLACE_S_TRUNCATED)
+
+ // SCODE's defined in COMPOBJ.H
+ CASE_SCODE (CO_E_NOTINITIALIZED)
+ CASE_SCODE (CO_E_ALREADYINITIALIZED)
+ CASE_SCODE (CO_E_CANTDETERMINECLASS)
+ CASE_SCODE (CO_E_CLASSSTRING)
+ CASE_SCODE (CO_E_IIDSTRING)
+ CASE_SCODE (CO_E_APPNOTFOUND)
+ CASE_SCODE (CO_E_APPSINGLEUSE)
+ CASE_SCODE (CO_E_ERRORINAPP)
+ CASE_SCODE (CO_E_DLLNOTFOUND)
+ CASE_SCODE (CO_E_ERRORINDLL)
+ CASE_SCODE (CO_E_WRONGOSFORAPP)
+ CASE_SCODE (CO_E_OBJNOTREG)
+ CASE_SCODE (CO_E_OBJISREG)
+ CASE_SCODE (CO_E_OBJNOTCONNECTED)
+ CASE_SCODE (CO_E_APPDIDNTREG)
+ CASE_SCODE (CLASS_E_NOAGGREGATION)
+ CASE_SCODE (CLASS_E_CLASSNOTAVAILABLE)
+ CASE_SCODE (REGDB_E_READREGDB)
+ CASE_SCODE (REGDB_E_WRITEREGDB)
+ CASE_SCODE (REGDB_E_KEYMISSING)
+ CASE_SCODE (REGDB_E_INVALIDVALUE)
+ CASE_SCODE (REGDB_E_CLASSNOTREG)
+ CASE_SCODE (REGDB_E_IIDNOTREG)
+ CASE_SCODE (RPC_E_CALL_REJECTED)
+ CASE_SCODE (RPC_E_CALL_CANCELED)
+ CASE_SCODE (RPC_E_CANTPOST_INSENDCALL)
+ CASE_SCODE (RPC_E_CANTCALLOUT_INASYNCCALL)
+ CASE_SCODE (RPC_E_CANTCALLOUT_INEXTERNALCALL)
+ CASE_SCODE (RPC_E_CONNECTION_TERMINATED)
+ CASE_SCODE (RPC_E_SERVER_DIED)
+ CASE_SCODE (RPC_E_CLIENT_DIED)
+ CASE_SCODE (RPC_E_INVALID_DATAPACKET)
+ CASE_SCODE (RPC_E_CANTTRANSMIT_CALL)
+ CASE_SCODE (RPC_E_CLIENT_CANTMARSHAL_DATA)
+ CASE_SCODE (RPC_E_CLIENT_CANTUNMARSHAL_DATA)
+ CASE_SCODE (RPC_E_SERVER_CANTMARSHAL_DATA)
+ CASE_SCODE (RPC_E_SERVER_CANTUNMARSHAL_DATA)
+ CASE_SCODE (RPC_E_INVALID_DATA)
+ CASE_SCODE (RPC_E_INVALID_PARAMETER)
+ CASE_SCODE (RPC_E_CANTCALLOUT_AGAIN)
+ CASE_SCODE (RPC_E_UNEXPECTED)
+
+ // SCODE's defined in DVOBJ.H
+ CASE_SCODE (DATA_S_SAMEFORMATETC)
+ CASE_SCODE (VIEW_E_DRAW)
+ CASE_SCODE (VIEW_S_ALREADY_FROZEN)
+ CASE_SCODE (CACHE_E_NOCACHE_UPDATED)
+ CASE_SCODE (CACHE_S_FORMATETC_NOTSUPPORTED)
+ CASE_SCODE (CACHE_S_SAMECACHE)
+ CASE_SCODE (CACHE_S_SOMECACHES_NOTUPDATED)
+
+ // SCODE's defined in STORAGE.H
+ CASE_SCODE (STG_E_INVALIDFUNCTION)
+ CASE_SCODE (STG_E_FILENOTFOUND)
+ CASE_SCODE (STG_E_PATHNOTFOUND)
+ CASE_SCODE (STG_E_TOOMANYOPENFILES)
+ CASE_SCODE (STG_E_ACCESSDENIED)
+ CASE_SCODE (STG_E_INVALIDHANDLE)
+ CASE_SCODE (STG_E_INSUFFICIENTMEMORY)
+ CASE_SCODE (STG_E_INVALIDPOINTER)
+ CASE_SCODE (STG_E_NOMOREFILES)
+ CASE_SCODE (STG_E_DISKISWRITEPROTECTED)
+ CASE_SCODE (STG_E_SEEKERROR)
+ CASE_SCODE (STG_E_WRITEFAULT)
+ CASE_SCODE (STG_E_READFAULT)
+ CASE_SCODE (STG_E_SHAREVIOLATION)
+ CASE_SCODE (STG_E_LOCKVIOLATION)
+ CASE_SCODE (STG_E_FILEALREADYEXISTS)
+ CASE_SCODE (STG_E_INVALIDPARAMETER)
+ CASE_SCODE (STG_E_MEDIUMFULL)
+ CASE_SCODE (STG_E_ABNORMALAPIEXIT)
+ CASE_SCODE (STG_E_INVALIDHEADER)
+ CASE_SCODE (STG_E_INVALIDNAME)
+ CASE_SCODE (STG_E_UNKNOWN)
+ CASE_SCODE (STG_E_UNIMPLEMENTEDFUNCTION)
+ CASE_SCODE (STG_E_INVALIDFLAG)
+ CASE_SCODE (STG_E_INUSE)
+ CASE_SCODE (STG_E_NOTCURRENT)
+ CASE_SCODE (STG_E_REVERTED)
+ CASE_SCODE (STG_E_CANTSAVE)
+ CASE_SCODE (STG_E_OLDFORMAT)
+ CASE_SCODE (STG_E_OLDDLL)
+ CASE_SCODE (STG_E_SHAREREQUIRED)
+ CASE_SCODE (STG_E_NOTFILEBASEDSTORAGE)
+ CASE_SCODE (STG_E_EXTANTMARSHALLINGS)
+ CASE_SCODE (STG_S_CONVERTED)
+
+ // SCODE's defined in STORAGE.H
+ CASE_SCODE (MK_E_CONNECTMANUALLY)
+ CASE_SCODE (MK_E_EXCEEDEDDEADLINE)
+ CASE_SCODE (MK_E_NEEDGENERIC)
+ CASE_SCODE (MK_E_UNAVAILABLE)
+ CASE_SCODE (MK_E_SYNTAX)
+ CASE_SCODE (MK_E_NOOBJECT)
+ CASE_SCODE (MK_E_INVALIDEXTENSION)
+ CASE_SCODE (MK_E_INTERMEDIATEINTERFACENOTSUPPORTED)
+ CASE_SCODE (MK_E_NOTBINDABLE)
+ CASE_SCODE (MK_E_NOTBOUND)
+ CASE_SCODE (MK_E_CANTOPENFILE)
+ CASE_SCODE (MK_E_MUSTBOTHERUSER)
+ CASE_SCODE (MK_E_NOINVERSE)
+ CASE_SCODE (MK_E_NOSTORAGE)
+ CASE_SCODE (MK_E_NOPREFIX)
+ CASE_SCODE (MK_S_REDUCED_TO_SELF)
+ CASE_SCODE (MK_S_ME)
+ CASE_SCODE (MK_S_HIM)
+ CASE_SCODE (MK_S_US)
+ CASE_SCODE (MK_S_MONIKERALREADYREGISTERED)
+
+ // SCODE's defined in DISPATCH.H
+ CASE_SCODE (DISP_E_UNKNOWNINTERFACE)
+ CASE_SCODE (DISP_E_MEMBERNOTFOUND)
+ CASE_SCODE (DISP_E_PARAMNOTFOUND)
+ CASE_SCODE (DISP_E_TYPEMISMATCH)
+ CASE_SCODE (DISP_E_UNKNOWNNAME)
+ CASE_SCODE (DISP_E_NONAMEDARGS)
+ CASE_SCODE (DISP_E_BADVARTYPE)
+ CASE_SCODE (DISP_E_EXCEPTION)
+ CASE_SCODE (DISP_E_OVERFLOW)
+ CASE_SCODE (DISP_E_BADINDEX)
+ CASE_SCODE (DISP_E_UNKNOWNLCID)
+ CASE_SCODE (DISP_E_ARRAYISLOCKED)
+ CASE_SCODE (DISP_E_BADPARAMCOUNT)
+ CASE_SCODE (DISP_E_PARAMNOTOPTIONAL)
+ CASE_SCODE (DISP_E_BADCALLEE)
+ CASE_SCODE (DISP_E_NOTACOLLECTION)
+
+ CASE_SCODE (TYPE_E_BUFFERTOOSMALL)
+ CASE_SCODE (TYPE_E_INVDATAREAD)
+ CASE_SCODE (TYPE_E_UNSUPFORMAT)
+ CASE_SCODE (TYPE_E_REGISTRYACCESS)
+ CASE_SCODE (TYPE_E_LIBNOTREGISTERED)
+ CASE_SCODE (TYPE_E_UNDEFINEDTYPE)
+ CASE_SCODE (TYPE_E_QUALIFIEDNAMEDISALLOWED)
+ CASE_SCODE (TYPE_E_INVALIDSTATE)
+ CASE_SCODE (TYPE_E_WRONGTYPEKIND)
+ CASE_SCODE (TYPE_E_ELEMENTNOTFOUND)
+ CASE_SCODE (TYPE_E_AMBIGUOUSNAME)
+ CASE_SCODE (TYPE_E_NAMECONFLICT)
+ CASE_SCODE (TYPE_E_UNKNOWNLCID)
+ CASE_SCODE (TYPE_E_DLLFUNCTIONNOTFOUND)
+ CASE_SCODE (TYPE_E_BADMODULEKIND)
+ CASE_SCODE (TYPE_E_SIZETOOBIG)
+ CASE_SCODE (TYPE_E_DUPLICATEID)
+ CASE_SCODE (TYPE_E_TYPEMISMATCH)
+ CASE_SCODE (TYPE_E_OUTOFBOUNDS)
+ CASE_SCODE (TYPE_E_IOERROR)
+ CASE_SCODE (TYPE_E_CANTCREATETMPFILE)
+ CASE_SCODE (TYPE_E_CANTLOADLIBRARY)
+ CASE_SCODE (TYPE_E_INCONSISTENTPROPFUNCS)
+ CASE_SCODE (TYPE_E_CIRCULARTYPE)
+
+ default:
+ lstrcpy (ErrName, "UNKNOWN SCODE");
+ }
+
+ char Buf[256];
+ sprintf (Buf, "An OLE error occured:\r\nCode = %s\r\nResult = %lx.",
+ (char*) ErrName, m_hResult);
+ MessageBox (NULL, Buf, "OLE Error", MB_OK);
+}
+
+
+static bool CountArgsInFormat (LPCTSTR Format, UINT* pArgCount)
+{
+ *pArgCount = 0;
+
+ if (! Format)
+ return true;
+
+ while (*Format)
+ {
+ if (*Format == '&')
+ Format++;
+
+ switch (*Format)
+ {
+ case 'b':
+ case 'i':
+ case 'I':
+ case 'r':
+ case 'R':
+ case 'c':
+ case 's':
+ case 'e':
+ case 'd':
+ case 'v':
+ case 'D':
+ case 'U':
+ ++ (*pArgCount);
+ Format++;
+ break;
+ case '\0':
+ default:
+ return false;
+ }
+ }
+ return true;
+}
+
+static LPCTSTR GetNextVarType (LPCTSTR Format, VARTYPE* pVarType)
+{
+ *pVarType = 0;
+ if (*Format == '&')
+ {
+ *pVarType = VT_BYREF;
+ Format++;
+ if (!*Format)
+ return NULL;
+ }
+ switch (*Format)
+ {
+ case 'b':
+ *pVarType |= VT_BOOL;
+ break;
+ case 'i':
+ *pVarType |= VT_I2;
+ break;
+ case 'I':
+ *pVarType |= VT_I4;
+ break;
+ case 'r':
+ *pVarType |= VT_R4;
+ break;
+ case 'R':
+ *pVarType |= VT_R8;
+ break;
+ case 'c':
+ *pVarType |= VT_CY;
+ break;
+ case 's':
+ *pVarType |= VT_BSTR;
+ break;
+ case 'e':
+ *pVarType |= VT_ERROR;
+ break;
+ case 'd':
+ *pVarType |= VT_DATE;
+ break;
+ case 'v':
+ *pVarType |= VT_VARIANT;
+ break;
+ case 'U':
+ *pVarType |= VT_UNKNOWN;
+ break;
+ case 'D':
+ *pVarType |= VT_DISPATCH;
+ break;
+ case '\0':
+ return NULL; // End of Format string
+ default:
+ return NULL;
+ }
+ return ++Format;
+}
+
+#ifndef UNICODE
+char* ConvertToAnsi (OLECHAR* sUnicode)
+{
+ static char BufAscii[MAX_OLE_STR];
+ return ConvertToAnsiBuf (sUnicode, BufAscii);
+}
+
+char* ConvertToAnsiBuf (OLECHAR* sUnicode, char* BufAscii)
+{
+ WideCharToMultiByte (CP_ACP, 0, sUnicode, -1, BufAscii, MAX_OLE_STR, NULL, NULL);
+ return BufAscii;
+}
+
+OLECHAR* ConvertToUnicode (char* sAscii)
+{
+ static OLECHAR BufUnicode[MAX_OLE_STR];
+ return ConvertToUnicodeBuf (sAscii, BufUnicode);
+}
+
+OLECHAR* ConvertToUnicodeBuf (char* sAscii, OLECHAR* BufUnicode)
+{
+ MultiByteToWideChar (CP_ACP, 0, sAscii, -1, BufUnicode, MAX_OLE_STR);
+ return BufUnicode;
+}
+#endif
+
diff --git a/src/VisVim/OleAut.h b/src/VisVim/OleAut.h
new file mode 100644
index 000000000..37de8078b
--- /dev/null
+++ b/src/VisVim/OleAut.h
@@ -0,0 +1,73 @@
+#ifndef __OLEAUT_H__
+#define __OLEAUT_H__
+
+class COleAutomationControl : public CObject
+{
+ public:
+ COleAutomationControl ();
+ ~COleAutomationControl ();
+ bool CreateObject (char* ProgId);
+ DISPID GetDispatchId (char* Name);
+ bool GetProperty (char* Name);
+ bool GetProperty (DISPID DispatchId);
+ bool PutProperty (char* Name, LPCTSTR Format, ...);
+ bool PutProperty (DISPID DispatchId, LPCTSTR Format, ...);
+ bool Method (char* Name, LPCTSTR Format = NULL, ...);
+ bool Method (DISPID DispatchId, LPCTSTR Format = NULL, ...);
+ void DeleteObject ();
+ void ErrDiag ();
+ bool IsCreated ()
+ {
+ return m_pDispatch ? true : false;
+ }
+ bool IsAlive ();
+ HRESULT GetResult ()
+ {
+ return m_hResult;
+ }
+ UINT GetErrArgNr ()
+ {
+ return m_nErrArg;
+ }
+ EXCEPINFO* GetExceptionInfo ()
+ {
+ return &m_ExceptionInfo;
+ }
+ LPVARIANT GetResultVariant ()
+ {
+ return &m_VariantResult;
+ }
+
+ protected:
+ bool Invoke (WORD Flags, char* Name, LPCTSTR Format, va_list ArgList);
+ bool Invoke (WORD Flags, DISPID DispatchId, LPCTSTR Format, va_list ArgList);
+
+ protected:
+ IDispatch* m_pDispatch;
+ HRESULT m_hResult;
+ UINT m_nErrArg;
+ EXCEPINFO m_ExceptionInfo;
+ VARIANTARG m_VariantResult;
+};
+
+#ifdef UNICODE
+ #define FROM_OLE_STRING(str) str
+ #define FROM_OLE_STRING_BUF(str,buf) str
+ #define TO_OLE_STR(str) str
+ #define TO_OLE_STR_BUF(str,buf) str
+ #define MAX_OLE_STR 1
+#else
+ #define FROM_OLE_STR(str) ConvertToAnsi(str)
+ #define FROM_OLE_STR_BUF(str,buf) ConvertToAnsiBuf(str,buf)
+ char* ConvertToAnsi (OLECHAR* sUnicode);
+ char* ConvertToAnsiBuf (OLECHAR* sUnicode, char* Buf);
+ #define TO_OLE_STR(str) ConvertToUnicode(str)
+ #define TO_OLE_STR_BUF(str,buf) ConvertToUnicodeBuf(str,buf)
+ OLECHAR* ConvertToUnicode (char* sAscii);
+ OLECHAR* ConvertToUnicodeBuf (char* sAscii, OLECHAR* Buf);
+ // Maximum length of string that can be converted between Ansi & Unicode
+ #define MAX_OLE_STR 500
+#endif
+
+
+#endif // __OLEAUT_H__
diff --git a/src/VisVim/README_VisVim.txt b/src/VisVim/README_VisVim.txt
new file mode 100644
index 000000000..fe22b12c5
--- /dev/null
+++ b/src/VisVim/README_VisVim.txt
@@ -0,0 +1,322 @@
+===============================
+Visual Studio - Vim Integration
+===============================
+
+Copyright (C) 1997 Heiko Erhardt
+
+VisVim is a Visual Studio Add-In that allows Vim to be integrated
+as the default text editor. It will be used instead of the Visual
+Studio built-in editor when you double-click on a file or press F4
+after compiling (it will go to the proper line in the Vim buffer).
+The file can be loaded exclusively by Vim or additionally to the
+builtin Visual Studio editor (this option can be set in the VisVim
+configuration dialog inside Visual Studio).
+Vim does not replace the Visual Studio editor, it still runs in its
+own window.
+
+VisVim is based upon VisEmacs by Christopher Payne
+(Copyright (C) Christopher Payne 1997).
+
+Author: Heiko Erhardt <Heiko.Erhardt@munich.netsurf.de>
+Based upon: VisEmacs by Christopher Payne <payneca@sagian.com>
+Version: 1.0
+Created: 23 Oct 1997
+Date: 23 Oct 1997
+
+VisVim is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+VisVim is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+
+Requirements
+------------
+
+VisVim works with the *OLE-enabled* version of Vim version 5.0 and higher
+only!!! You must download the extra archive containing the OLE-enabled
+executable from your Vim download site. When building your own Vim
+executable, use the if_ole_vc.mak makefile (Vim 5.1 and higher).
+VisVim needs DevStudio 5.0 or higher. It does not work with DevStudio 4.2.
+
+
+Installation
+------------
+
+1) Close running instances of DevStudio.
+
+2) Copy VisVim.dll into a convenient directory like \vim,
+ \vim\lib, or \vim\addin
+
+3) Register the DLL using regsvr32.exe ... (Skip this on Windows 95/98)
+ Example:
+ > cd \vim\addin
+ > regsvr32 VisVim.dll
+ On NT, you should do this from an administrator account.
+ Before installing a new version of VisVim you should unregister
+ the old one using
+ > regsvr32 -unregister VisVim.dll
+ The batch files register.bat and unregister.bat can do that for you.
+
+3a) If you didn't do this yet: Register the OLE gvim:
+ > gvim -register
+
+4) Start Visual Studio and go to:
+ Tools
+ Customize...
+ Add-Ins and Macro Files
+
+5) Click on Browse, and point Visual Studio to your VisVim.dll file.
+
+6) Click the checkbox to indicate that you want to use the Add-In, and
+ Close the Customize dialog box.
+
+7) You should notice the VisVim Toolbar with the Vim Icon.
+ Click the first item of the toolbar to get to the options dialog.
+
+
+Compiling VisVim
+----------------
+
+Two Options:
+
+1) Load the VisVim.mak file as a Workspace in Visual Studio and compile
+
+2) Use the MSVC command line compiler:
+ vcvars32
+ nmake -f VisVim.mak
+
+
+Using VisVim
+------------
+
+The VisVim DLL exposes several functions to the user. These functions are
+accessible using the toolbar or by assigning hotkeys to them (see below).
+The following functions are visible on the toolbar (from left to right):
+
+1. VisVim settings dialog
+ The settings you adjust here will be saved in the registry and
+ will be reloaded on program startup.
+
+2. Enable Vim
+ Enables Vim as Visual Studio editor. Control will be switched to Vim when:
+ - Clicking a file in the file view
+ - Clicking a compiler error message line
+ - Using the 'File-Open' Dialog
+ - Showing the current source line when encountering a debugger breakpoint.
+ - Using File-New
+
+3. Disable Vim
+ The internal Visual Studio editor will be used to edit files.
+
+4. Toggle enable state
+ Toggles the enable state of VisVim. Use this function if you want to have
+ one button only to activate/deactivate Vim.
+
+5. Load current file in Vim
+ Loads the file shown in the internal editor into Vim. Use this function if
+ you want the internal editor to stay active and just edit one file in Vim.
+ This command works always whether Vim is enabled as default editor or not.
+
+You cannot use DevStudio's debugger commands from inside Vim, so you should
+disable Vim before running the debugger.
+
+You can customize the Vim toolbar itself or add the Vim buttons to other
+toolbars.
+To have fast access to the VisVim options dialog I suggest to create keyboard
+shortcuts:
+
+1) Choose
+ Tools
+ Customize...
+ Keyboard
+2) Choose Category:AddIns and Commands:VisVim.
+3) Choose 'Main' as editor, enter each hotkey and press the Assign button.
+ I suggest:
+ VisVimDialogCmd Alt+Shift+V
+ VisVimEnableCmd Alt+Shift+E
+ VisVimDisableCmd Alt+Shift+D
+ VisVimToggleCmd Alt+Shift+T
+ VisVimLoadCmd Alt+Shift+G
+4) Close the dialog
+
+Now a typical debugging example:
+
+Using "Alt+Shift+d" you turn off Vim before starting the debugger.
+After hitting the breakpoint you single step through your application
+using the internal source code editor and examine variables.
+When you stumble across the line with the null pointer
+assignment, just press "Alt+Shift+g", and correct the error in Vim.
+Save the file, press Alt+Tab to return to DevStudio and press F7 to compile.
+That's it.
+
+
+Troubleshooting
+---------------
+
+1. When opening a file in DevStudio the file is opened in the DevStudio
+ editor and immediately vanishes. No Vim shows up.
+ Cause: Probably you don't have the OLE-enabled Vim or you didn't
+ register it.
+ Explanation: VisVim is notified by DevStudio if an 'open document' event
+ occurs. It then closes the document in the internal editor
+ and tries to start Vim. If Vim isn't properly OLE-registered,
+ this won't work.
+ Workaround: Download and install the OLE-enable version of Vim and
+ execute "gvim -register".
+
+2. Sometimes when clicking on a file, the file won't be opened by Vim but
+ instead the Visual Studio editor comes up.
+ Cause: The file was already loaded by the DevStudio editor.
+ Explanation: VisVim works by hooks exposed by Visual Studio.
+ Most of the functionality works from the OpenDocument hook.
+ If a document is already loaded in the Visual Studio editor,
+ no 'open document' event will be generated when clicking the
+ file in the file list.
+ Workaround: Close the document in Visual Studio first.
+
+3. I can't get VisVim to work. Either the Vim toolbar does not appear at all
+ or weird crashes happen.
+ Cause: The Visual Studio installation is messed up.
+ Explanation: I can't give you one. Ask M$.
+ Workaround: Reinstall DevStudio (I know this is brute, but in some cases
+ it helped). There was one case where the service pack 1 had
+ to be installed, too.
+
+4. If an instance of Vim is already running, VisVim will use that instance
+ and not start a new one.
+ Cause: This is proper OLE behaviour
+ Explanation: Some call it a bug, some a feature. That's just the way OLE
+ works.
+
+5. When being in insert mode in Vim and selecting a file in Visual Studio,
+ the Vim command :e ... is inserted as text instead of being executed.
+ Cause: You probably know...
+ Explanation: The Vim OLE automation interface interpretes the VisVim
+ commands as if they were typed in by the user.
+ So if you're in insert mode Vim considers it to be text.
+ I decided against sending an ESC before the command because
+ it may cause a beep or at least a screen flash when noeb is
+ set.
+ Workaround: Get used to press ESC before switching to DevStudio.
+
+6. I'm tired of VisVim but I can't get rid of it. I can't delete it in
+ Tools-Customize-Add-Ins.
+ Cause: You can't delete an item you once added to the add-ins
+ list box.
+ Explanation: M$ just didn't put a 'delete' button in the dialog box.
+ Unfortunately there is no DEL key accellerator as well...
+ Workaround: You can't kill it, but you can knock it out:
+ 1. Uncheck the check box in front of 'Vim Developer Studio
+ Add-in'.
+ 2. Close Visual Studio.
+ 3. Delete VisVim.dll or move it somewhere it can't be found.
+ 4. Run Visual Studio.
+ 5. Tools -> Cursomize ->Add-ins and Macro-Files.
+ 6. A message appears:
+ ".../VisVim.dll" "This add-in no longer exists. It will
+ no longer be displayed."
+ That's it!
+
+
+Change history
+--------------
+
+1.0a to 1.0
+-----------
+
+- All settings in the VisVim dialog are remembered between DevStudio sessions
+ by keeping them in the registry (HKEY_CURRENT_USER\Software\Vim\VisVim).
+- Added an option to do a :cd before opening the file (having a file opened
+ by clicking it but finding out to be still in C:\Windows\system when trying to
+ open another file by ":e" can be annoying). Change directory can be
+ done to the source file's directory or it's parent directory.
+- Added some explanations to the error message for the CO_E_CLASSSTRING error
+ ("Use OLE Vim and make sure to register...").
+
+1.0 to 1.1a
+-----------
+
+- The VisVim toolbar button now shows the new Vim icon instead of the old one.
+- Made some changes to the documentation, added the troubleshooting chapter
+ and ToDo list.
+- File-New-* now invokes Vim instead of the builtin editor if enabled.
+
+1.1 to 1.1b
+-----------
+
+- Extended the VisVim toolbar to have multiple buttons instead of one.
+- Moved the enable/disable commands from the settings dialog to the toolbar.
+- Added the toggle enable/disable command
+- Added the 'load current file' command.
+
+1.1b to 1.2
+-----------
+
+No new features, just some fine tuning:
+
+- Changed the GUID of the VisVim OLE interface to avoid conflicts with a
+ version of VisEmacs or VisVile on the same computer (Guy Gascoigne)
+- Fixed a bug caused by a bug in the Developer Studio add-in code generator
+ (Clark Morgan)
+- Fixed a memory leak (Clark Morgan)
+- Added an option in the VisVim dialog to prepend ESC before the first command
+ that is sent to Vim. This will avoid inserting the command as text when Vim
+ is still in insert mode.
+- An :update command is sent to Vim before any other command to update the
+ current file if it is modified, or else the following :cd or :e command will fail.
+
+1.2 to 1.3a
+-----------
+
+- Fixed a bug caused by a missing EnableModeless() function call in VimLoad().
+ This seems to reduce VisVim crashing DevStudio on some systems (it
+ occasionally still seems to happen, but it's more stable now).
+ (Vince Negri)
+- Added support for the new CTRL-\ CTRL-N command of Vim 5.4a.
+ This prevents Vim from beeping when a VisVim command is executed an Vim is
+ not in insert mode.
+
+
+ToDo List
+---------
+
+P1 is highest priority, P10 lowest
+
+P9 Switching to DevStudio using ALT-TAB may get annoying. Would be nice to
+ have the option to map ActivateApplication("Visual Studio") in Vim.
+ Vim DLLs would solve that problem.
+
+P8 Execute :tag command in Vim for word under cursor in DevStudio
+
+P7 Controlling the Visual Studio Debugger from inside Vim
+ See message above. Also a 'Debug' highligh group and a
+ command to highlight a certain line would be necessary.
+
+P6 Provide an option to open the current file in VisVim in
+ Visual Studio editor
+ Same as above message. A kind of two way OLE automation would have to be
+ established between VisVim and Vim. Also a 'Debug' highlight group and a
+ command to highlight a certain line would be necessary.
+
+
+Known Problems
+--------------
+
+- Occasional memory corruptions in DevStudio may appear on some systems.
+ Reinstalling DevStudio helped in some cases.
+ The cause of these crashes is unclear; there is no way to debug this.
+ Recompiling VisVim with DevStudio SP3 didn't help.
+ I assume it's a problem deep inside the DevStudio add-in OLE interfaces.
+ This will hopefully be fixed with DevStudio 6.
+
+
+Have fun!
+
+Heiko Erhardt
+Heiko.Erhardt@munich.netsurf.de
+
diff --git a/src/VisVim/Reg.cpp b/src/VisVim/Reg.cpp
new file mode 100644
index 000000000..b4378e545
--- /dev/null
+++ b/src/VisVim/Reg.cpp
@@ -0,0 +1,56 @@
+#include "stdafx.h"
+
+// Returns key for HKEY_CURRENT_USER\"Software"\Company\AppName
+// creating it if it doesn't exist
+// responsibility of the caller to call RegCloseKey() on the returned HKEY
+//
+HKEY GetAppKey (char* AppName)
+{
+ HKEY hAppKey = NULL;
+ HKEY hSoftKey = NULL;
+ if (RegOpenKeyEx (HKEY_CURRENT_USER, "Software", 0, KEY_WRITE | KEY_READ,
+ &hSoftKey) == ERROR_SUCCESS)
+ {
+ DWORD Dummy;
+ RegCreateKeyEx (hSoftKey, AppName, 0, REG_NONE,
+ REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL,
+ &hAppKey, &Dummy);
+ }
+ if (hSoftKey)
+ RegCloseKey (hSoftKey);
+
+ return hAppKey;
+}
+
+// Returns key for
+// HKEY_CURRENT_USER\"Software"\RegistryKey\AppName\Section
+// creating it if it doesn't exist.
+// responsibility of the caller to call RegCloseKey () on the returned HKEY
+//
+HKEY GetSectionKey (HKEY hAppKey, LPCTSTR Section)
+{
+ HKEY hSectionKey = NULL;
+ DWORD Dummy;
+ RegCreateKeyEx (hAppKey, Section, 0, REG_NONE,
+ REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
+ &hSectionKey, &Dummy);
+ return hSectionKey;
+}
+
+int GetRegistryInt (HKEY hSectionKey, LPCTSTR Entry, int Default)
+{
+ DWORD Value;
+ DWORD Type;
+ DWORD Count = sizeof (DWORD);
+ if (RegQueryValueEx (hSectionKey, (LPTSTR) Entry, NULL, &Type,
+ (LPBYTE) &Value, &Count) == ERROR_SUCCESS)
+ return Value;
+ return Default;
+}
+
+bool WriteRegistryInt (HKEY hSectionKey, char* Entry, int nValue)
+{
+ return RegSetValueEx (hSectionKey, Entry, NULL, REG_DWORD,
+ (LPBYTE) &nValue, sizeof (nValue)) == ERROR_SUCCESS;
+}
+
diff --git a/src/VisVim/Register.bat b/src/VisVim/Register.bat
new file mode 100644
index 000000000..baef50b0f
--- /dev/null
+++ b/src/VisVim/Register.bat
@@ -0,0 +1 @@
+regsvr32.exe visvim.dll
diff --git a/src/VisVim/Resource.h b/src/VisVim/Resource.h
new file mode 100644
index 000000000..e098b386a
--- /dev/null
+++ b/src/VisVim/Resource.h
@@ -0,0 +1,29 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by VisVim.rc
+//
+#define IDS_VISVIM_LONGNAME 1
+#define IDS_VISVIM_DESCRIPTION 2
+#define IDS_CMD_DIALOG 3
+#define IDS_CMD_ENABLE 4
+#define IDS_CMD_DISABLE 5
+#define IDS_CMD_TOGGLE 6
+#define IDS_CMD_LOAD 7
+#define IDR_TOOLBAR_MEDIUM 128
+#define IDR_TOOLBAR_LARGE 129
+#define IDD_ADDINMAIN 130
+#define IDC_DEVSTUDIO_EDITOR 1000
+#define IDC_CD_SOURCE_PATH 1001
+#define IDC_CD_SOURCE_PARENT 1002
+#define IDC_CD_NONE 1003
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 131
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1004
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/src/VisVim/StdAfx.cpp b/src/VisVim/StdAfx.cpp
new file mode 100644
index 000000000..f4f6eb51f
--- /dev/null
+++ b/src/VisVim/StdAfx.cpp
@@ -0,0 +1,6 @@
+// Stdafx.cpp : source file that includes just the standard includes
+// VisEmacs.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+#include "atlimpl.cpp"
diff --git a/src/VisVim/StdAfx.h b/src/VisVim/StdAfx.h
new file mode 100644
index 000000000..10bfdc02b
--- /dev/null
+++ b/src/VisVim/StdAfx.h
@@ -0,0 +1,73 @@
+// Stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#if !defined(AFX_STDAFX_H__AC72670E_2977_11D1_B2F3_006008040780__INCLUDED_)
+#define AFX_STDAFX_H__AC72670E_2977_11D1_B2F3_006008040780__INCLUDED_
+
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+
+#include <afxwin.h> // MFC core and standard components
+#include <afxdisp.h>
+
+#include <atlbase.h>
+//You may derive a class from CComModule and use it if you want to override
+//something, but do not change the name of _Module
+extern CComModule _Module;
+
+#include <atlcom.h>
+
+// Developer Studio Object Model
+#include <ObjModel\addauto.h>
+#include <ObjModel\appdefs.h>
+#include <ObjModel\appauto.h>
+#include <ObjModel\blddefs.h>
+#include <ObjModel\bldauto.h>
+#include <ObjModel\textdefs.h>
+#include <ObjModel\textauto.h>
+#include <ObjModel\dbgdefs.h>
+#include <ObjModel\dbgauto.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// Debugging support
+
+// Use VERIFY_OK around all calls to the Developer Studio objects which
+// you expect to return S_OK.
+// In DEBUG builds of your add-in, VERIFY_OK displays an ASSERT dialog box
+// if the expression returns an HRESULT other than S_OK. If the HRESULT
+// is a success code, the ASSERT box will display that HRESULT. If it
+// is a failure code, the ASSERT box will display that HRESULT plus the
+// error description string provided by the object which raised the error.
+// In RETAIL builds of your add-in, VERIFY_OK just evaluates the expression
+// and ignores the returned HRESULT.
+
+#ifdef _DEBUG
+
+void GetLastErrorDescription (CComBSTR & bstr); // Defined in VisVim.cpp
+#define VERIFY_OK(f) \
+ { \
+ HRESULT hr = (f); \
+ if (hr != S_OK) \
+ { \
+ if (FAILED(hr)) \
+ { \
+ CComBSTR bstr; \
+ GetLastErrorDescription(bstr); \
+ _RPTF2(_CRT_ASSERT, "Object call returned %lx\n\n%S", hr, (BSTR) bstr); \
+ } \
+ else \
+ _RPTF1(_CRT_ASSERT, "Object call returned %lx", hr); \
+ } \
+ }
+
+#else //_DEBUG
+
+#define VERIFY_OK(f) (f);
+
+#endif //_DEBUG
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_STDAFX_H__AC72670E_2977_11D1_B2F3_006008040780__INCLUDED)
diff --git a/src/VisVim/UnRegist.bat b/src/VisVim/UnRegist.bat
new file mode 100644
index 000000000..9ea105d26
--- /dev/null
+++ b/src/VisVim/UnRegist.bat
@@ -0,0 +1 @@
+regsvr32.exe -unregister visvim.dll
diff --git a/src/VisVim/VisVim.cpp b/src/VisVim/VisVim.cpp
new file mode 100644
index 000000000..222925a89
--- /dev/null
+++ b/src/VisVim/VisVim.cpp
@@ -0,0 +1,152 @@
+// VisVim.cpp : Defines the initialization routines for the DLL.
+//
+
+#include "stdafx.h"
+#include <initguid.h>
+#include "VisVim.h"
+#include "DSAddIn.h"
+#include "Commands.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+
+#endif
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP (ObjectMap)
+OBJECT_ENTRY (CLSID_DSAddIn, CDSAddIn)
+END_OBJECT_MAP ()
+
+class CVisVimApp : public CWinApp
+{
+ public:
+ CVisVimApp ();
+
+ //{{AFX_VIRTUAL(CVisVimApp)
+ public:
+ virtual BOOL InitInstance ();
+ virtual int ExitInstance ();
+ //}}AFX_VIRTUAL
+
+ //{{AFX_MSG(CVisVimApp)
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP ()
+};
+
+BEGIN_MESSAGE_MAP (CVisVimApp, CWinApp)
+//{{AFX_MSG_MAP(CVisVimApp)
+//}}AFX_MSG_MAP
+END_MESSAGE_MAP ()
+
+// The one and only CVisVimApp object
+CVisVimApp theApp;
+
+CVisVimApp::CVisVimApp ()
+{
+}
+
+BOOL CVisVimApp::InitInstance ()
+{
+ _Module.Init (ObjectMap, m_hInstance);
+ return CWinApp::InitInstance ();
+}
+
+int CVisVimApp::ExitInstance ()
+{
+ _Module.Term ();
+ return CWinApp::ExitInstance ();
+}
+
+// Special entry points required for inproc servers
+//
+
+STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID * ppv)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return _Module.GetClassObject (rclsid, riid, ppv);
+}
+
+STDAPI DllCanUnloadNow (void)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ return (AfxDllCanUnloadNow () == S_OK && _Module.GetLockCount () == 0)
+ ? S_OK : S_FALSE;
+}
+
+// By exporting DllRegisterServer, you can use regsvr32.exe
+//
+STDAPI DllRegisterServer (void)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+ HRESULT hRes;
+
+ // Registers object, typelib and all interfaces in typelib
+ hRes = _Module.RegisterServer (TRUE);
+ if (FAILED (hRes))
+ // Hack: When this fails we might be a normal user, while the
+ // admin already registered the module. Returning S_OK then
+ // makes it work. When the module was never registered it
+ // will soon fail in another way.
+ // old code: return hRes;
+ return S_OK;
+
+ _ATL_OBJMAP_ENTRY *pEntry = _Module.m_pObjMap;
+ CRegKey key;
+ LONG lRes = key.Open (HKEY_CLASSES_ROOT, _T ("CLSID"));
+
+ if (lRes == ERROR_SUCCESS)
+ {
+ USES_CONVERSION;
+ LPOLESTR lpOleStr;
+
+ StringFromCLSID (*pEntry->pclsid, &lpOleStr);
+ LPTSTR lpsz = OLE2T (lpOleStr);
+
+ lRes = key.Open (key, lpsz);
+ if (lRes == ERROR_SUCCESS)
+ {
+ CString strDescription;
+
+ strDescription.LoadString (IDS_VISVIM_DESCRIPTION);
+ key.SetKeyValue (_T ("Description"), strDescription);
+ }
+ CoTaskMemFree (lpOleStr);
+ }
+
+ if (lRes != ERROR_SUCCESS)
+ hRes = HRESULT_FROM_WIN32 (lRes);
+
+ return hRes;
+
+}
+
+// DllUnregisterServer - Removes entries from the system registry
+//
+STDAPI DllUnregisterServer (void)
+{
+ AFX_MANAGE_STATE (AfxGetStaticModuleState ());
+
+ HRESULT hRes = S_OK;
+ _Module.UnregisterServer ();
+ return hRes;
+}
+
+
+// Debugging support
+
+// GetLastErrorDescription is used in the implementation of the VERIFY_OK
+// macro, defined in stdafx.h.
+
+#ifdef _DEBUG
+
+void GetLastErrorDescription (CComBSTR & bstr)
+{
+ CComPtr < IErrorInfo > pErrorInfo;
+ if (GetErrorInfo (0, &pErrorInfo) == S_OK)
+ pErrorInfo->GetDescription (&bstr);
+}
+
+#endif //_DEBUG
diff --git a/src/VisVim/VisVim.def b/src/VisVim/VisVim.def
new file mode 100644
index 000000000..023d478e7
--- /dev/null
+++ b/src/VisVim/VisVim.def
@@ -0,0 +1,11 @@
+; VisVim.def : Declares the module parameters for the DLL.
+
+LIBRARY "VISVIM"
+DESCRIPTION 'VISVIM Windows Dynamic Link Library'
+
+EXPORTS
+ ; Explicit exports can go here
+ DllCanUnloadNow PRIVATE
+ DllGetClassObject PRIVATE
+ DllRegisterServer PRIVATE
+ DllUnregisterServer PRIVATE
diff --git a/src/VisVim/VisVim.dll b/src/VisVim/VisVim.dll
new file mode 100644
index 000000000..017b41780
--- /dev/null
+++ b/src/VisVim/VisVim.dll
Binary files differ
diff --git a/src/VisVim/VisVim.h b/src/VisVim/VisVim.h
new file mode 100644
index 000000000..775977878
--- /dev/null
+++ b/src/VisVim/VisVim.h
@@ -0,0 +1,33 @@
+// VisVIM.h : main header file for the VisVim DLL
+//
+
+#if !defined(AFX_VISVIM_H__AC72670B_2977_11D1_B2F3_006008040780__INCLUDED_)
+#define AFX_VISVIM_H__AC72670B_2977_11D1_B2F3_006008040780__INCLUDED_
+
+#ifndef __AFXWIN_H__
+#error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // Main symbols
+
+#include <ObjModel\addguid.h>
+#include <ObjModel\appguid.h>
+#include <ObjModel\bldguid.h>
+#include <ObjModel\textguid.h>
+#include <ObjModel\dbgguid.h>
+
+//
+// Prototypes
+//
+
+HKEY GetAppKey (char* AppName);
+HKEY GetSectionKey (HKEY hAppKey, LPCTSTR Section);
+int GetRegistryInt (HKEY hSectionKey, LPCTSTR Entry, int Default);
+bool WriteRegistryInt (HKEY hSectionKey, char* Entry, int nValue);
+void ReportLastError (HRESULT Err);
+void ReportInternalError (char* Fct);
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_VISVIM_H__AC72670B_2977_11D1_B2F3_006008040780__INCLUDED)
diff --git a/src/VisVim/VisVim.mak b/src/VisVim/VisVim.mak
new file mode 100644
index 000000000..30a9cf41f
--- /dev/null
+++ b/src/VisVim/VisVim.mak
@@ -0,0 +1,205 @@
+# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00
+# ** DO NOT EDIT **
+#
+# When Who What
+# 1999-08-01 Anon Original VisVim.dsp
+# 2001-08-08 W.Briscoe Back-ported to a condensed VC4 Makefile
+# Reduced inter-dependency of Release and Debug builds.
+#
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+!IF "$(CFG)" == ""
+CFG=VisVim - Win32 Release
+!MESSAGE No configuration specified. Defaulting to VisVim - Win32 Release.
+!ENDIF
+
+!IF "$(CFG)" != "VisVim - Win32 Release" && "$(CFG)" != "VisVim - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "VisVim.mak" CFG="VisVim - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "VisVim - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "VisVim - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+DEL_TREE = rmdir /s /q
+!ELSE
+NULL=nul
+DEL_TREE = deltree /y
+!ENDIF
+# Begin Project
+# PROP Target_Last_Scanned "VisVim - Win32 Release"
+# PROP Use_MFC 2
+CPP=cl.exe
+RSC=rc.exe
+LINK32=link.exe
+
+!IF "$(CFG)" == "VisVim - Win32 Release"
+
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ".\Release"
+# PROP Intermediate_Dir ".\Release"
+# PROP Target_Dir ""
+OUTDIR=.\Release
+INTDIR=.\Release
+CPP_OBJS=.\Release/
+
+# ADD CPP /MD /O2 /D "NDEBUG" /I.\Release
+CPP_PROJ= /MD /O2 /D "NDEBUG" /I.\Release
+# ADD RSC /d "NDEBUG
+RSC_PROJ= /d "NDEBUG"
+# ADD LINK32 /pdb:none
+LINK32_FLAGS=/pdb:none
+
+!ELSEIF "$(CFG)" == "VisVim - Win32 Debug"
+
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ".\Debug"
+# PROP Intermediate_Dir ".\Debug"
+# PROP Target_Dir ""
+OUTDIR=.\Debug
+INTDIR=.\Debug
+CPP_OBJS=.\Debug/
+
+# ADD CPP /MDd /Gm /Zi /Od /D "_DEBUG" /I.\Debug
+CPP_PROJ= /MDd /Gm /Zi /Od /D "_DEBUG" /I.\Debug /Fd"$(INTDIR)/"
+MTL_PROJ= /D "_DEBUG"
+# ADD RSC /d "_DEBUG
+RSC_PROJ= /d "_DEBUG"
+# ADD LINK32 /debug /pdbtype:sept /pdb:".\Debug/VisVim.pdb"
+LINK32_FLAGS=/debug /pdbtype:sept /pdb:"$(OUTDIR)/VisVim.pdb"
+
+!ENDIF
+
+# ADD CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_USRDLL" /c
+CPP_PROJ=$(CPP_PROJ) /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_USRDLL" /c /Fo"$(INTDIR)/"
+# ADD RSC /l 0x409 /d "_AFXDLL"
+RSC_PROJ=$(RSC_PROJ) /l 0x409 /d "_AFXDLL" /fo"$(INTDIR)/VisVim.res"
+# ADD LINK32 /nologo /subsystem:windows /dll /machine:I386 /incremental:no
+LINK32_FLAGS=$(LINK32_FLAGS) /nologo /subsystem:windows /dll /machine:I386\
+ /incremental:no /def:".\VisVim.def"\
+ /out:"$(OUTDIR)/VisVim.dll" /implib:"$(OUTDIR)/VisVim.lib"
+
+ALL : "$(OUTDIR)\VisVim.dll"
+
+CLEAN :
+ -@if exist "$(INTDIR)/$(NULL)" $(DEL_TREE) "$(INTDIR)"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+LINK32_OBJS= \
+ "$(INTDIR)/VisVim.res" \
+ "$(INTDIR)/VisVim.obj" \
+ "$(INTDIR)/StdAfx.obj" \
+ "$(INTDIR)/Reg.obj" \
+ "$(INTDIR)/DSAddIn.obj" \
+ "$(INTDIR)/OleAut.obj" \
+ "$(INTDIR)/Commands.obj"
+
+"$(OUTDIR)\VisVim.dll" : "$(OUTDIR)" ".\VisVim.def" $(LINK32_OBJS)
+ $(LINK32) $(LINK32_FLAGS) $(LINK32_OBJS)
+
+{.}.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+{.}.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+# Begin Target
+
+# Name "VisVim - Win32 Release"
+# Name "VisVim - Win32 Debug"
+
+# Begin Source File
+
+SOURCE=.\VisVim.cpp
+
+"$(INTDIR)\VisVim.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\VisVim.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\VisVim.odl
+
+!IF "$(CFG)" == "VisVim - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\VisVim.tlb" : $(SOURCE) "$(INTDIR)"
+ midl /nologo /mktyplib203 /win32 /tlb VisVim.tlb /h VSVTypes.h .\VisVim.odl /out .\Release /D "NDEBUG"
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "VisVim - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build
+
+"$(INTDIR)\VisVim.tlb" : $(SOURCE) "$(INTDIR)"
+ midl /nologo /mktyplib203 /win32 /tlb VisVim.tlb /h VSVTypes.h .\VisVim.odl /out .\Debug /D "_DEBUG"
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+
+"$(INTDIR)\StdAfx.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\VisVim.rc
+
+"$(INTDIR)\VisVim.res" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\VisVim.tlb"
+ $(RSC) $(RSC_PROJ) /i "$(INTDIR)" $(SOURCE)
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\Reg.cpp
+
+"$(INTDIR)\Reg.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\DSAddIn.cpp
+
+"$(INTDIR)\DSAddIn.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\OleAut.cpp
+
+"$(INTDIR)\OleAut.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\Commands.cpp
+
+"$(INTDIR)\Commands.obj" : $(SOURCE) "$(INTDIR)"
+
+# End Source File
+# End Target
+# End Project
diff --git a/src/VisVim/VisVim.odl b/src/VisVim/VisVim.odl
new file mode 100644
index 000000000..0491b8f34
--- /dev/null
+++ b/src/VisVim/VisVim.odl
@@ -0,0 +1,61 @@
+// VisVim.odl : type library source for VisVim.dll
+
+// This file will be processed by the Make Type Library (mktyplib) tool to
+// produce the type library (VisVim.tlb).
+
+[ uuid(AC726707-2977-11D1-B2F3-006008040780), version(1.0),
+ helpstring ("VisVim Developer Studio Add-in") ]
+library VisVim
+{
+ importlib("stdole32.tlb");
+ importlib("devshl.dll");
+ importlib("ide\devdbg.pkg");
+
+
+ // Dual interface for CCommands
+ //
+ // All commands that your add-in adds to DevStudio
+ // must appear in this interface. You may use the
+ // ClassView to add methods to this interface, which
+ // will cause stub implementations of those methods to
+ // appear in your CCommands class.
+
+ [ uuid(AC726703-2977-11D1-B2F3-006008040780),
+ oleautomation,
+ dual
+ ]
+
+ interface ICommands : IDispatch
+ {
+ // methods
+ [id(1)]
+ HRESULT VisVimDialog();
+ HRESULT VisVimEnable();
+ HRESULT VisVimDisable();
+ HRESULT VisVimToggle();
+ HRESULT VisVimLoad();
+ };
+
+ // Class information for CCommands
+
+ [ uuid(AC726704-2977-11D1-B2F3-006008040780) ]
+ coclass Commands
+ {
+ [default] interface ICommands;
+ };
+
+ [ hidden, uuid(AC726705-2977-11D1-B2F3-006008040780) ]
+ coclass ApplicationEvents
+ {
+ [default] interface IApplicationEvents;
+ }
+
+ [ hidden, uuid(AC726706-2977-11D1-B2F3-006008040780) ]
+ coclass DebuggerEvents
+ {
+ [default] interface IDebuggerEvents;
+ }
+
+ //{{AFX_APPEND_ODL}}
+ //}}AFX_APPEND_ODL}}
+};
diff --git a/src/VisVim/VisVim.rc b/src/VisVim/VisVim.rc
new file mode 100644
index 000000000..f227e53cb
--- /dev/null
+++ b/src/VisVim/VisVim.rc
@@ -0,0 +1,199 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Englisch (USA) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
+ "#define _AFX_NO_OLE_RESOURCES\r\n"
+ "#define _AFX_NO_TRACKER_RESOURCES\r\n"
+ "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
+ "\r\n"
+ "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
+ "#ifdef _WIN32\r\n"
+ "LANGUAGE 9, 1\r\n"
+ "#pragma code_page(1252)\r\n"
+ "#endif\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "1 TYPELIB ""VisVim.tlb""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_TOOLBAR_MEDIUM BITMAP MOVEABLE PURE "res\\ToolbarM.bmp"
+IDR_TOOLBAR_LARGE BITMAP MOVEABLE PURE "res\\ToolbarL.bmp"
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,1,0,1
+ PRODUCTVERSION 1,1,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "VisVim DLL\0"
+ VALUE "FileVersion", "1, 1, 0, 1\0"
+ VALUE "InternalName", "VisVim\0"
+ VALUE "LegalCopyright", "Copyright (C) 1998\0"
+ VALUE "OriginalFilename", "VisVim.DLL\0"
+ VALUE "ProductName", "VisVim Dynamic Link Library\0"
+ VALUE "ProductVersion", "1, 1, 0, 1\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ADDINMAIN DIALOG DISCARDABLE 0, 0, 178, 124
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Vim Add-In 1.4"
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "&Open file in DevStudio editor simultaneously",
+ IDC_DEVSTUDIO_EDITOR,"Button",BS_AUTOCHECKBOX | WS_GROUP |
+ WS_TABSTOP,7,7,153,10
+ GROUPBOX "Current directory",IDC_STATIC,7,35,164,58,WS_GROUP
+ CONTROL "Set to &source file path",IDC_CD_SOURCE_PATH,"Button",
+ BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,17,49,85,10
+ CONTROL "Set to &parent directory of source file path",
+ IDC_CD_SOURCE_PARENT,"Button",BS_AUTORADIOBUTTON,17,63,
+ 143,10
+ CONTROL "Do &not change",IDC_CD_NONE,"Button",BS_AUTORADIOBUTTON,
+ 17,78,63,10
+ DEFPUSHBUTTON "&Ok",IDOK,7,102,74,14,WS_GROUP
+ PUSHBUTTON "&Cancel",IDCANCEL,97,102,74,14,WS_GROUP
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_ADDINMAIN, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 171
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 117
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_VISVIM_LONGNAME "Vim Developer Studio Add-In"
+ IDS_VISVIM_DESCRIPTION "Allows integration of Vim as the text editor in Developer Studio."
+ IDS_CMD_DIALOG "\nVim Add-In Dialog\nDisplays the options dialog box of the Vim Add-In\nVim Add-In Dialog"
+ IDS_CMD_ENABLE "\nEnable Vim Add-In\nEnables Vim as Visual Studio editor\nEnable Vim Add-In"
+ IDS_CMD_DISABLE "\nDisable Vim Add-In\nDisables Vim as Visual Studio editor\nDisable Vim Add-In"
+ IDS_CMD_TOGGLE "\nToggle Vim Add-In State\nToggles the enable state of the Vim Add-In\nToggle Vim Add-In State"
+ IDS_CMD_LOAD "\nVim Add-In Load Document\nLoads the current document in Vim\nVim Add-In Load Document"
+END
+
+#endif // Englisch (USA) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_PROPERTY_RESOURCES
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE 9, 1
+#pragma code_page(1252)
+#endif
+#include "afxres.rc" // Standard components
+#endif
+1 TYPELIB "VisVim.tlb"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/src/VisVim/VsReadMe.txt b/src/VisVim/VsReadMe.txt
new file mode 100644
index 000000000..f480c6be4
--- /dev/null
+++ b/src/VisVim/VsReadMe.txt
@@ -0,0 +1,91 @@
+========================================================================
+ DEVELOPER STUDIO ADD-IN : VisVim
+========================================================================
+
+
+The Add-in Wizard has created this VisVim DLL for you. This DLL not only
+demonstrates the basics of creating a Developer Studio add-in, but it is also
+a starting point for writing your own add-in.
+
+An add-in mainly does two things.
+ (1) It adds commands to Developer Studio, which can then be tied
+ to keystrokes or toolbar buttons by the user or programmatically
+ by the add-in.
+ (2) It responds to events fired by Developer Studio.
+In both cases, the add-in code has access to the full Developer Studio
+Automation Object Model, and may manipulate those objects to affect the
+behavior of Developer Studio.
+
+This file contains a summary of what you will find in each of the files that
+make up your VisVim DLL.
+
+
+VisVim.h
+ This is the main header file for the DLL. It declares the
+ CVisVimApp class.
+
+VisVim.cpp
+ This is the main DLL source file. It contains the class CVisVimApp.
+ It also contains the OLE entry points required of inproc servers.
+
+VisVim.odl
+ This file contains the Object Description Language source code for the
+ type library of your DLL.
+
+VisVim.rc
+ This is a listing of all of the Microsoft Windows resources that the
+ program uses. It includes the sample toolbar bitmap that is stored
+ in the RES subdirectory. This file can be directly edited in Microsoft
+ Developer Studio.
+
+res\VisVim.rc2
+ This file contains resources that are not edited by Microsoft
+ Developer Studio. You should place all resources not
+ editable by the resource editor in this file.
+
+VisVim.def
+ This file contains information about the DLL that must be
+ provided to run with Microsoft Windows. It defines parameters
+ such as the name and description of the DLL. It also exports
+ functions from the DLL.
+
+VisVim.clw
+ This file contains information used by ClassWizard to edit existing
+ classes or add new classes. ClassWizard also uses this file to store
+ information needed to create and edit message maps and dialog data
+ maps and to create prototype member functions.
+
+/////////////////////////////////////////////////////////////////////////////
+Add-in-specific files:
+
+DSAddIn.cpp, DSAddIn.h
+ These files contain the CDSAddIn class, which implements the
+ IDSAddIn interface. This interface contains handlers
+ for connecting and disconnecting the add-in.
+
+Commands.cpp, Commands.h
+ These files contain the CCommands class, which implements your
+ command dispatch interface. This interface contains one method
+ for each command you add to Developer Studio.
+ These files also contain stub implementations of handlers for all events
+ fired by the Developer Studio Application object.
+
+OleAut.cpp
+ These files contain a general OLE automation class used to communicate
+ with vim.
+
+Reg.cpp
+ These files contain functions to access the registry.
+
+
+/////////////////////////////////////////////////////////////////////////////
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+ These files are used to build a precompiled header (PCH) file
+ named VisVim.pch and a precompiled types file named StdAfx.obj.
+
+Resource.h
+ This is the standard header file, which defines new resource IDs.
+ Microsoft Developer Studio reads and updates this file.
+
diff --git a/src/arabic.c b/src/arabic.c
new file mode 100644
index 000000000..8c1f64c40
--- /dev/null
+++ b/src/arabic.c
@@ -0,0 +1,1168 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * arabic.c: functions for Arabic language
+ *
+ * Included by main.c, when FEAT_ARABIC & FEAT_GUI is defined.
+ *
+ * --
+ *
+ * Author: Nadim Shaikli & Isam Bayazidi
+ *
+ */
+
+static int A_is_a __ARGS((int cur_c));
+static int A_is_s __ARGS((int cur_c));
+static int A_is_f __ARGS((int cur_c));
+static int chg_c_a2s __ARGS((int cur_c));
+static int chg_c_a2i __ARGS((int cur_c));
+static int chg_c_a2m __ARGS((int cur_c));
+static int chg_c_a2f __ARGS((int cur_c));
+static int chg_c_i2m __ARGS((int cur_c));
+static int chg_c_f2m __ARGS((int cur_c));
+static int chg_c_laa2i __ARGS((int hid_c));
+static int chg_c_laa2f __ARGS((int hid_c));
+static int half_shape __ARGS((int c));
+static int A_firstc_laa __ARGS((int c1, int c));
+static int A_is_harakat __ARGS((int c));
+static int A_is_iso __ARGS((int c));
+static int A_is_formb __ARGS((int c));
+static int A_is_ok __ARGS((int c));
+static int A_is_valid __ARGS((int c));
+static int A_is_special __ARGS((int c));
+
+
+/*
+ * Returns True if c is an ISO-8859-6 shaped ARABIC letter (user entered)
+ */
+ static int
+A_is_a(cur_c)
+ int cur_c;
+{
+ switch (cur_c)
+ {
+ case a_HAMZA:
+ case a_ALEF_MADDA:
+ case a_ALEF_HAMZA_ABOVE:
+ case a_WAW_HAMZA:
+ case a_ALEF_HAMZA_BELOW:
+ case a_YEH_HAMZA:
+ case a_ALEF:
+ case a_BEH:
+ case a_TEH_MARBUTA:
+ case a_TEH:
+ case a_THEH:
+ case a_JEEM:
+ case a_HAH:
+ case a_KHAH:
+ case a_DAL:
+ case a_THAL:
+ case a_REH:
+ case a_ZAIN:
+ case a_SEEN:
+ case a_SHEEN:
+ case a_SAD:
+ case a_DAD:
+ case a_TAH:
+ case a_ZAH:
+ case a_AIN:
+ case a_GHAIN:
+ case a_TATWEEL:
+ case a_FEH:
+ case a_QAF:
+ case a_KAF:
+ case a_LAM:
+ case a_MEEM:
+ case a_NOON:
+ case a_HEH:
+ case a_WAW:
+ case a_ALEF_MAKSURA:
+ case a_YEH:
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * Returns True if c is an Isolated Form-B ARABIC letter
+ */
+ static int
+A_is_s(cur_c)
+ int cur_c;
+{
+ switch (cur_c)
+ {
+ case a_s_HAMZA:
+ case a_s_ALEF_MADDA:
+ case a_s_ALEF_HAMZA_ABOVE:
+ case a_s_WAW_HAMZA:
+ case a_s_ALEF_HAMZA_BELOW:
+ case a_s_YEH_HAMZA:
+ case a_s_ALEF:
+ case a_s_BEH:
+ case a_s_TEH_MARBUTA:
+ case a_s_TEH:
+ case a_s_THEH:
+ case a_s_JEEM:
+ case a_s_HAH:
+ case a_s_KHAH:
+ case a_s_DAL:
+ case a_s_THAL:
+ case a_s_REH:
+ case a_s_ZAIN:
+ case a_s_SEEN:
+ case a_s_SHEEN:
+ case a_s_SAD:
+ case a_s_DAD:
+ case a_s_TAH:
+ case a_s_ZAH:
+ case a_s_AIN:
+ case a_s_GHAIN:
+ case a_s_FEH:
+ case a_s_QAF:
+ case a_s_KAF:
+ case a_s_LAM:
+ case a_s_MEEM:
+ case a_s_NOON:
+ case a_s_HEH:
+ case a_s_WAW:
+ case a_s_ALEF_MAKSURA:
+ case a_s_YEH:
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * Returns True if c is a Final shape of an ARABIC letter
+ */
+ static int
+A_is_f(cur_c)
+ int cur_c;
+{
+ switch (cur_c)
+ {
+ case a_f_ALEF_MADDA:
+ case a_f_ALEF_HAMZA_ABOVE:
+ case a_f_WAW_HAMZA:
+ case a_f_ALEF_HAMZA_BELOW:
+ case a_f_YEH_HAMZA:
+ case a_f_ALEF:
+ case a_f_BEH:
+ case a_f_TEH_MARBUTA:
+ case a_f_TEH:
+ case a_f_THEH:
+ case a_f_JEEM:
+ case a_f_HAH:
+ case a_f_KHAH:
+ case a_f_DAL:
+ case a_f_THAL:
+ case a_f_REH:
+ case a_f_ZAIN:
+ case a_f_SEEN:
+ case a_f_SHEEN:
+ case a_f_SAD:
+ case a_f_DAD:
+ case a_f_TAH:
+ case a_f_ZAH:
+ case a_f_AIN:
+ case a_f_GHAIN:
+ case a_f_FEH:
+ case a_f_QAF:
+ case a_f_KAF:
+ case a_f_LAM:
+ case a_f_MEEM:
+ case a_f_NOON:
+ case a_f_HEH:
+ case a_f_WAW:
+ case a_f_ALEF_MAKSURA:
+ case a_f_YEH:
+ case a_f_LAM_ALEF_MADDA_ABOVE:
+ case a_f_LAM_ALEF_HAMZA_ABOVE:
+ case a_f_LAM_ALEF_HAMZA_BELOW:
+ case a_f_LAM_ALEF:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/*
+ * Change shape - from ISO-8859-6/Isolated to Form-B Isolated
+ */
+ static int
+chg_c_a2s(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ switch (cur_c)
+ {
+ case a_HAMZA:
+ tempc = a_s_HAMZA;
+ break;
+ case a_ALEF_MADDA:
+ tempc = a_s_ALEF_MADDA;
+ break;
+ case a_ALEF_HAMZA_ABOVE:
+ tempc = a_s_ALEF_HAMZA_ABOVE;
+ break;
+ case a_WAW_HAMZA:
+ tempc = a_s_WAW_HAMZA;
+ break;
+ case a_ALEF_HAMZA_BELOW:
+ tempc = a_s_ALEF_HAMZA_BELOW;
+ break;
+ case a_YEH_HAMZA:
+ tempc = a_s_YEH_HAMZA;
+ break;
+ case a_ALEF:
+ tempc = a_s_ALEF;
+ break;
+ case a_TEH_MARBUTA:
+ tempc = a_s_TEH_MARBUTA;
+ break;
+ case a_DAL:
+ tempc = a_s_DAL;
+ break;
+ case a_THAL:
+ tempc = a_s_THAL;
+ break;
+ case a_REH:
+ tempc = a_s_REH;
+ break;
+ case a_ZAIN:
+ tempc = a_s_ZAIN;
+ break;
+ case a_TATWEEL: /* exceptions */
+ tempc = cur_c;
+ break;
+ case a_WAW:
+ tempc = a_s_WAW;
+ break;
+ case a_ALEF_MAKSURA:
+ tempc = a_s_ALEF_MAKSURA;
+ break;
+ case a_BEH:
+ tempc = a_s_BEH;
+ break;
+ case a_TEH:
+ tempc = a_s_TEH;
+ break;
+ case a_THEH:
+ tempc = a_s_THEH;
+ break;
+ case a_JEEM:
+ tempc = a_s_JEEM;
+ break;
+ case a_HAH:
+ tempc = a_s_HAH;
+ break;
+ case a_KHAH:
+ tempc = a_s_KHAH;
+ break;
+ case a_SEEN:
+ tempc = a_s_SEEN;
+ break;
+ case a_SHEEN:
+ tempc = a_s_SHEEN;
+ break;
+ case a_SAD:
+ tempc = a_s_SAD;
+ break;
+ case a_DAD:
+ tempc = a_s_DAD;
+ break;
+ case a_TAH:
+ tempc = a_s_TAH;
+ break;
+ case a_ZAH:
+ tempc = a_s_ZAH;
+ break;
+ case a_AIN:
+ tempc = a_s_AIN;
+ break;
+ case a_GHAIN:
+ tempc = a_s_GHAIN;
+ break;
+ case a_FEH:
+ tempc = a_s_FEH;
+ break;
+ case a_QAF:
+ tempc = a_s_QAF;
+ break;
+ case a_KAF:
+ tempc = a_s_KAF;
+ break;
+ case a_LAM:
+ tempc = a_s_LAM;
+ break;
+ case a_MEEM:
+ tempc = a_s_MEEM;
+ break;
+ case a_NOON:
+ tempc = a_s_NOON;
+ break;
+ case a_HEH:
+ tempc = a_s_HEH;
+ break;
+ case a_YEH:
+ tempc = a_s_YEH;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from ISO-8859-6/Isolated to Initial
+ */
+ static int
+chg_c_a2i(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ switch (cur_c)
+ {
+ case a_YEH_HAMZA:
+ tempc = a_i_YEH_HAMZA;
+ break;
+ case a_HAMZA: /* exceptions */
+ tempc = a_s_HAMZA;
+ break;
+ case a_ALEF_MADDA: /* exceptions */
+ tempc = a_s_ALEF_MADDA;
+ break;
+ case a_ALEF_HAMZA_ABOVE: /* exceptions */
+ tempc = a_s_ALEF_HAMZA_ABOVE;
+ break;
+ case a_WAW_HAMZA: /* exceptions */
+ tempc = a_s_WAW_HAMZA;
+ break;
+ case a_ALEF_HAMZA_BELOW: /* exceptions */
+ tempc = a_s_ALEF_HAMZA_BELOW;
+ break;
+ case a_ALEF: /* exceptions */
+ tempc = a_s_ALEF;
+ break;
+ case a_TEH_MARBUTA: /* exceptions */
+ tempc = a_s_TEH_MARBUTA;
+ break;
+ case a_DAL: /* exceptions */
+ tempc = a_s_DAL;
+ break;
+ case a_THAL: /* exceptions */
+ tempc = a_s_THAL;
+ break;
+ case a_REH: /* exceptions */
+ tempc = a_s_REH;
+ break;
+ case a_ZAIN: /* exceptions */
+ tempc = a_s_ZAIN;
+ break;
+ case a_TATWEEL: /* exceptions */
+ tempc = cur_c;
+ break;
+ case a_WAW: /* exceptions */
+ tempc = a_s_WAW;
+ break;
+ case a_ALEF_MAKSURA: /* exceptions */
+ tempc = a_s_ALEF_MAKSURA;
+ break;
+ case a_BEH:
+ tempc = a_i_BEH;
+ break;
+ case a_TEH:
+ tempc = a_i_TEH;
+ break;
+ case a_THEH:
+ tempc = a_i_THEH;
+ break;
+ case a_JEEM:
+ tempc = a_i_JEEM;
+ break;
+ case a_HAH:
+ tempc = a_i_HAH;
+ break;
+ case a_KHAH:
+ tempc = a_i_KHAH;
+ break;
+ case a_SEEN:
+ tempc = a_i_SEEN;
+ break;
+ case a_SHEEN:
+ tempc = a_i_SHEEN;
+ break;
+ case a_SAD:
+ tempc = a_i_SAD;
+ break;
+ case a_DAD:
+ tempc = a_i_DAD;
+ break;
+ case a_TAH:
+ tempc = a_i_TAH;
+ break;
+ case a_ZAH:
+ tempc = a_i_ZAH;
+ break;
+ case a_AIN:
+ tempc = a_i_AIN;
+ break;
+ case a_GHAIN:
+ tempc = a_i_GHAIN;
+ break;
+ case a_FEH:
+ tempc = a_i_FEH;
+ break;
+ case a_QAF:
+ tempc = a_i_QAF;
+ break;
+ case a_KAF:
+ tempc = a_i_KAF;
+ break;
+ case a_LAM:
+ tempc = a_i_LAM;
+ break;
+ case a_MEEM:
+ tempc = a_i_MEEM;
+ break;
+ case a_NOON:
+ tempc = a_i_NOON;
+ break;
+ case a_HEH:
+ tempc = a_i_HEH;
+ break;
+ case a_YEH:
+ tempc = a_i_YEH;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from ISO-8859-6/Isolated to Medial
+ */
+ static int
+chg_c_a2m(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ switch (cur_c)
+ {
+ case a_HAMZA: /* exception */
+ tempc = a_s_HAMZA;
+ break;
+ case a_ALEF_MADDA: /* exception */
+ tempc = a_f_ALEF_MADDA;
+ break;
+ case a_ALEF_HAMZA_ABOVE: /* exception */
+ tempc = a_f_ALEF_HAMZA_ABOVE;
+ break;
+ case a_WAW_HAMZA: /* exception */
+ tempc = a_f_WAW_HAMZA;
+ break;
+ case a_ALEF_HAMZA_BELOW: /* exception */
+ tempc = a_f_ALEF_HAMZA_BELOW;
+ break;
+ case a_YEH_HAMZA:
+ tempc = a_m_YEH_HAMZA;
+ break;
+ case a_ALEF: /* exception */
+ tempc = a_f_ALEF;
+ break;
+ case a_BEH:
+ tempc = a_m_BEH;
+ break;
+ case a_TEH_MARBUTA: /* exception */
+ tempc = a_f_TEH_MARBUTA;
+ break;
+ case a_TEH:
+ tempc = a_m_TEH;
+ break;
+ case a_THEH:
+ tempc = a_m_THEH;
+ break;
+ case a_JEEM:
+ tempc = a_m_JEEM;
+ break;
+ case a_HAH:
+ tempc = a_m_HAH;
+ break;
+ case a_KHAH:
+ tempc = a_m_KHAH;
+ break;
+ case a_DAL: /* exception */
+ tempc = a_f_DAL;
+ break;
+ case a_THAL: /* exception */
+ tempc = a_f_THAL;
+ break;
+ case a_REH: /* exception */
+ tempc = a_f_REH;
+ break;
+ case a_ZAIN: /* exception */
+ tempc = a_f_ZAIN;
+ break;
+ case a_SEEN:
+ tempc = a_m_SEEN;
+ break;
+ case a_SHEEN:
+ tempc = a_m_SHEEN;
+ break;
+ case a_SAD:
+ tempc = a_m_SAD;
+ break;
+ case a_DAD:
+ tempc = a_m_DAD;
+ break;
+ case a_TAH:
+ tempc = a_m_TAH;
+ break;
+ case a_ZAH:
+ tempc = a_m_ZAH;
+ break;
+ case a_AIN:
+ tempc = a_m_AIN;
+ break;
+ case a_GHAIN:
+ tempc = a_m_GHAIN;
+ break;
+ case a_TATWEEL: /* exception */
+ tempc = cur_c;
+ break;
+ case a_FEH:
+ tempc = a_m_FEH;
+ break;
+ case a_QAF:
+ tempc = a_m_QAF;
+ break;
+ case a_KAF:
+ tempc = a_m_KAF;
+ break;
+ case a_LAM:
+ tempc = a_m_LAM;
+ break;
+ case a_MEEM:
+ tempc = a_m_MEEM;
+ break;
+ case a_NOON:
+ tempc = a_m_NOON;
+ break;
+ case a_HEH:
+ tempc = a_m_HEH;
+ break;
+ case a_WAW: /* exception */
+ tempc = a_f_WAW;
+ break;
+ case a_ALEF_MAKSURA: /* exception */
+ tempc = a_f_ALEF_MAKSURA;
+ break;
+ case a_YEH:
+ tempc = a_m_YEH;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from ISO-8859-6/Isolated to final
+ */
+ static int
+chg_c_a2f(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ /* NOTE: these encodings need to be accounted for
+
+ a_f_ALEF_MADDA;
+ a_f_ALEF_HAMZA_ABOVE;
+ a_f_ALEF_HAMZA_BELOW;
+ a_f_LAM_ALEF_MADDA_ABOVE;
+ a_f_LAM_ALEF_HAMZA_ABOVE;
+ a_f_LAM_ALEF_HAMZA_BELOW;
+ */
+
+ switch (cur_c)
+ {
+ case a_HAMZA: /* exception */
+ tempc = a_s_HAMZA;
+ break;
+ case a_ALEF_MADDA:
+ tempc = a_f_ALEF_MADDA;
+ break;
+ case a_ALEF_HAMZA_ABOVE:
+ tempc = a_f_ALEF_HAMZA_ABOVE;
+ break;
+ case a_WAW_HAMZA:
+ tempc = a_f_WAW_HAMZA;
+ break;
+ case a_ALEF_HAMZA_BELOW:
+ tempc = a_f_ALEF_HAMZA_BELOW;
+ break;
+ case a_YEH_HAMZA:
+ tempc = a_f_YEH_HAMZA;
+ break;
+ case a_ALEF:
+ tempc = a_f_ALEF;
+ break;
+ case a_BEH:
+ tempc = a_f_BEH;
+ break;
+ case a_TEH_MARBUTA:
+ tempc = a_f_TEH_MARBUTA;
+ break;
+ case a_TEH:
+ tempc = a_f_TEH;
+ break;
+ case a_THEH:
+ tempc = a_f_THEH;
+ break;
+ case a_JEEM:
+ tempc = a_f_JEEM;
+ break;
+ case a_HAH:
+ tempc = a_f_HAH;
+ break;
+ case a_KHAH:
+ tempc = a_f_KHAH;
+ break;
+ case a_DAL:
+ tempc = a_f_DAL;
+ break;
+ case a_THAL:
+ tempc = a_f_THAL;
+ break;
+ case a_REH:
+ tempc = a_f_REH;
+ break;
+ case a_ZAIN:
+ tempc = a_f_ZAIN;
+ break;
+ case a_SEEN:
+ tempc = a_f_SEEN;
+ break;
+ case a_SHEEN:
+ tempc = a_f_SHEEN;
+ break;
+ case a_SAD:
+ tempc = a_f_SAD;
+ break;
+ case a_DAD:
+ tempc = a_f_DAD;
+ break;
+ case a_TAH:
+ tempc = a_f_TAH;
+ break;
+ case a_ZAH:
+ tempc = a_f_ZAH;
+ break;
+ case a_AIN:
+ tempc = a_f_AIN;
+ break;
+ case a_GHAIN:
+ tempc = a_f_GHAIN;
+ break;
+ case a_TATWEEL: /* exception */
+ tempc = cur_c;
+ break;
+ case a_FEH:
+ tempc = a_f_FEH;
+ break;
+ case a_QAF:
+ tempc = a_f_QAF;
+ break;
+ case a_KAF:
+ tempc = a_f_KAF;
+ break;
+ case a_LAM:
+ tempc = a_f_LAM;
+ break;
+ case a_MEEM:
+ tempc = a_f_MEEM;
+ break;
+ case a_NOON:
+ tempc = a_f_NOON;
+ break;
+ case a_HEH:
+ tempc = a_f_HEH;
+ break;
+ case a_WAW:
+ tempc = a_f_WAW;
+ break;
+ case a_ALEF_MAKSURA:
+ tempc = a_f_ALEF_MAKSURA;
+ break;
+ case a_YEH:
+ tempc = a_f_YEH;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from Initial to Medial
+ */
+ static int
+chg_c_i2m(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ switch (cur_c)
+ {
+ case a_i_YEH_HAMZA:
+ tempc = a_m_YEH_HAMZA;
+ break;
+ case a_i_BEH:
+ tempc = a_m_BEH;
+ break;
+ case a_i_TEH:
+ tempc = a_m_TEH;
+ break;
+ case a_i_THEH:
+ tempc = a_m_THEH;
+ break;
+ case a_i_JEEM:
+ tempc = a_m_JEEM;
+ break;
+ case a_i_HAH:
+ tempc = a_m_HAH;
+ break;
+ case a_i_KHAH:
+ tempc = a_m_KHAH;
+ break;
+ case a_i_SEEN:
+ tempc = a_m_SEEN;
+ break;
+ case a_i_SHEEN:
+ tempc = a_m_SHEEN;
+ break;
+ case a_i_SAD:
+ tempc = a_m_SAD;
+ break;
+ case a_i_DAD:
+ tempc = a_m_DAD;
+ break;
+ case a_i_TAH:
+ tempc = a_m_TAH;
+ break;
+ case a_i_ZAH:
+ tempc = a_m_ZAH;
+ break;
+ case a_i_AIN:
+ tempc = a_m_AIN;
+ break;
+ case a_i_GHAIN:
+ tempc = a_m_GHAIN;
+ break;
+ case a_i_FEH:
+ tempc = a_m_FEH;
+ break;
+ case a_i_QAF:
+ tempc = a_m_QAF;
+ break;
+ case a_i_KAF:
+ tempc = a_m_KAF;
+ break;
+ case a_i_LAM:
+ tempc = a_m_LAM;
+ break;
+ case a_i_MEEM:
+ tempc = a_m_MEEM;
+ break;
+ case a_i_NOON:
+ tempc = a_m_NOON;
+ break;
+ case a_i_HEH:
+ tempc = a_m_HEH;
+ break;
+ case a_i_YEH:
+ tempc = a_m_YEH;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from Final to Medial
+ */
+ static int
+chg_c_f2m(cur_c)
+ int cur_c;
+{
+ int tempc;
+
+ switch (cur_c)
+ {
+ /* NOTE: these encodings are multi-positional, no ?
+ case a_f_ALEF_MADDA:
+ case a_f_ALEF_HAMZA_ABOVE:
+ case a_f_ALEF_HAMZA_BELOW:
+ */
+ case a_f_YEH_HAMZA:
+ tempc = a_m_YEH_HAMZA;
+ break;
+ case a_f_WAW_HAMZA: /* exceptions */
+ case a_f_ALEF:
+ case a_f_TEH_MARBUTA:
+ case a_f_DAL:
+ case a_f_THAL:
+ case a_f_REH:
+ case a_f_ZAIN:
+ case a_f_WAW:
+ case a_f_ALEF_MAKSURA:
+ tempc = cur_c;
+ break;
+ case a_f_BEH:
+ tempc = a_m_BEH;
+ break;
+ case a_f_TEH:
+ tempc = a_m_TEH;
+ break;
+ case a_f_THEH:
+ tempc = a_m_THEH;
+ break;
+ case a_f_JEEM:
+ tempc = a_m_JEEM;
+ break;
+ case a_f_HAH:
+ tempc = a_m_HAH;
+ break;
+ case a_f_KHAH:
+ tempc = a_m_KHAH;
+ break;
+ case a_f_SEEN:
+ tempc = a_m_SEEN;
+ break;
+ case a_f_SHEEN:
+ tempc = a_m_SHEEN;
+ break;
+ case a_f_SAD:
+ tempc = a_m_SAD;
+ break;
+ case a_f_DAD:
+ tempc = a_m_DAD;
+ break;
+ case a_f_TAH:
+ tempc = a_m_TAH;
+ break;
+ case a_f_ZAH:
+ tempc = a_m_ZAH;
+ break;
+ case a_f_AIN:
+ tempc = a_m_AIN;
+ break;
+ case a_f_GHAIN:
+ tempc = a_m_GHAIN;
+ break;
+ case a_f_FEH:
+ tempc = a_m_FEH;
+ break;
+ case a_f_QAF:
+ tempc = a_m_QAF;
+ break;
+ case a_f_KAF:
+ tempc = a_m_KAF;
+ break;
+ case a_f_LAM:
+ tempc = a_m_LAM;
+ break;
+ case a_f_MEEM:
+ tempc = a_m_MEEM;
+ break;
+ case a_f_NOON:
+ tempc = a_m_NOON;
+ break;
+ case a_f_HEH:
+ tempc = a_m_HEH;
+ break;
+ case a_f_YEH:
+ tempc = a_m_YEH;
+ break;
+ /* NOTE: these encodings are multi-positional, no ?
+ case a_f_LAM_ALEF_MADDA_ABOVE:
+ case a_f_LAM_ALEF_HAMZA_ABOVE:
+ case a_f_LAM_ALEF_HAMZA_BELOW:
+ case a_f_LAM_ALEF:
+ */
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from Combination (2 char) to an Isolated
+ */
+ static int
+chg_c_laa2i(hid_c)
+ int hid_c;
+{
+ int tempc;
+
+ switch (hid_c)
+ {
+ case a_ALEF_MADDA:
+ tempc = a_s_LAM_ALEF_MADDA_ABOVE;
+ break;
+ case a_ALEF_HAMZA_ABOVE:
+ tempc = a_s_LAM_ALEF_HAMZA_ABOVE;
+ break;
+ case a_ALEF_HAMZA_BELOW:
+ tempc = a_s_LAM_ALEF_HAMZA_BELOW;
+ break;
+ case a_ALEF:
+ tempc = a_s_LAM_ALEF;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+
+/*
+ * Change shape - from Combination-Isolated to Final
+ */
+ static int
+chg_c_laa2f(hid_c)
+ int hid_c;
+{
+ int tempc;
+
+ switch (hid_c)
+ {
+ case a_ALEF_MADDA:
+ tempc = a_f_LAM_ALEF_MADDA_ABOVE;
+ break;
+ case a_ALEF_HAMZA_ABOVE:
+ tempc = a_f_LAM_ALEF_HAMZA_ABOVE;
+ break;
+ case a_ALEF_HAMZA_BELOW:
+ tempc = a_f_LAM_ALEF_HAMZA_BELOW;
+ break;
+ case a_ALEF:
+ tempc = a_f_LAM_ALEF;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ return tempc;
+}
+
+/*
+ * Do "half-shaping" on character "c". Return zero if no shaping.
+ */
+ static int
+half_shape(c)
+ int c;
+{
+ if (A_is_a(c))
+ return chg_c_a2i(c);
+ if (A_is_valid(c) && A_is_f(c))
+ return chg_c_f2m(c);
+ return 0;
+}
+
+/*
+ * Do Arabic shaping on character "c". Returns the shaped character.
+ * out: "ccp" points to the first byte of the character to be shaped.
+ * in/out: "c1p" points to the first composing char for "c".
+ * in: "prev_c" is the previous character (not shaped)
+ * in: "prev_c1" is the first composing char for the previous char
+ * (not shaped)
+ * in: "next_c" is the next character (not shaped).
+ */
+ int
+arabic_shape(c, ccp, c1p, prev_c, prev_c1, next_c)
+ int c;
+ int *ccp;
+ int *c1p;
+ int prev_c;
+ int prev_c1;
+ int next_c;
+{
+ int curr_c;
+ int shape_c;
+ int curr_laa;
+ int prev_laa;
+
+ /* Deal only with Arabic character, pass back all others */
+ if (!A_is_ok(c))
+ return c;
+
+ /* half-shape current and previous character */
+ shape_c = half_shape(prev_c);
+
+ /* Save away current character */
+ curr_c = c;
+
+ curr_laa = A_firstc_laa(c, *c1p);
+ prev_laa = A_firstc_laa(prev_c, prev_c1);
+
+ if (curr_laa)
+ {
+ if (A_is_valid(prev_c) && !A_is_f(shape_c)
+ && !A_is_s(shape_c) && !prev_laa)
+ curr_c = chg_c_laa2f(curr_laa);
+ else
+ curr_c = chg_c_laa2i(curr_laa);
+
+ /* Remove the composing character */
+ *c1p = 0;
+ }
+ else if (!A_is_valid(prev_c) && A_is_valid(next_c))
+ curr_c = chg_c_a2i(c);
+ else if (!shape_c || A_is_f(shape_c) || A_is_s(shape_c) || prev_laa)
+ curr_c = A_is_valid(next_c) ? chg_c_a2i(c) : chg_c_a2s(c);
+ else if (A_is_valid(next_c))
+ curr_c = A_is_iso(c) ? chg_c_a2m(c) : chg_c_i2m(c);
+ else if (A_is_valid(prev_c))
+ curr_c = chg_c_a2f(c);
+ else
+ curr_c = chg_c_a2s(c);
+
+ /* Sanity check -- curr_c should, in the future, never be 0.
+ * We should, in the future, insert a fatal error here. */
+ if (curr_c == NUL)
+ curr_c = c;
+
+ if (curr_c != c && ccp != NULL)
+ {
+ char_u buf[MB_MAXBYTES];
+
+ /* Update the first byte of the character. */
+ (*mb_char2bytes)(curr_c, buf);
+ *ccp = buf[0];
+ }
+
+ /* Return the shaped character */
+ return curr_c;
+}
+
+
+/*
+ * A_firstc_laa returns first character of LAA combination if it exists
+ */
+ static int
+A_firstc_laa(c, c1)
+ int c; /* base character */
+ int c1; /* first composing character */
+{
+ if (c1 != NUL && c == a_LAM && !A_is_harakat(c1))
+ return c1;
+ return 0;
+}
+
+
+/*
+ * A_is_harakat returns TRUE if 'c' is an Arabic Harakat character
+ * (harakat/tanween)
+ */
+ static int
+A_is_harakat(c)
+ int c;
+{
+ return (c >= a_FATHATAN && c <= a_SUKUN);
+}
+
+
+/*
+ * A_is_iso returns TRUE if 'c' is an Arabic ISO-8859-6 character
+ * (alphabet/number/punctuation)
+ */
+ static int
+A_is_iso(c)
+ int c;
+{
+ return ((c >= a_HAMZA && c <= a_GHAIN)
+ || (c >= a_TATWEEL && c <= a_HAMZA_BELOW)
+ || c == a_MINI_ALEF);
+}
+
+
+/*
+ * A_is_formb returns TRUE if 'c' is an Arabic 10646-1 FormB character
+ * (alphabet/number/punctuation)
+ */
+ static int
+A_is_formb(c)
+ int c;
+{
+ return ((c >= a_s_FATHATAN && c <= a_s_DAMMATAN)
+ || c == a_s_KASRATAN
+ || (c >= a_s_FATHA && c <= a_f_LAM_ALEF)
+ || c == a_BYTE_ORDER_MARK);
+}
+
+
+/*
+ * A_is_ok returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
+ */
+ static int
+A_is_ok(c)
+ int c;
+{
+ return (A_is_iso(c) || A_is_formb(c));
+}
+
+
+/*
+ * A_is_valid returns TRUE if 'c' is an Arabic 10646 (8859-6 or Form-B)
+ * with some exceptions/exclusions
+ */
+ static int
+A_is_valid(c)
+ int c;
+{
+ return (A_is_ok(c) && !A_is_special(c));
+}
+
+
+/*
+ * A_is_special returns TRUE if 'c' is not a special Arabic character.
+ * Specials don't adhere to most of the rules.
+ */
+ static int
+A_is_special(c)
+ int c;
+{
+ return (c == a_HAMZA || c == a_s_HAMZA);
+}
diff --git a/src/arabic.h b/src/arabic.h
new file mode 100644
index 000000000..7328fd226
--- /dev/null
+++ b/src/arabic.h
@@ -0,0 +1,258 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Arabic characters are catagorized into following types:
+ *
+ * Isolated - iso-8859-6 form char denoted with a_*
+ * Initial - unicode form-B start char denoted with a_i_*
+ * Medial - unicode form-B middle char denoted with a_m_*
+ * Final - unicode form-B final char denoted with a_f_*
+ * Stand-Alone - unicode form-B isolated char denoted with a_s_* (NOT USED)
+ *
+ * --
+ *
+ * Author: Nadim Shaikli & Isam Bayazidi
+ * - (based on Unicode)
+ *
+ */
+
+/*
+ * Arabic ISO-10646-1 character set definition
+ */
+
+/*
+ * Arabic ISO-8859-6 (subset of 10646; 0600 - 06FF)
+ */
+#define a_COMMA 0x060C
+#define a_SEMICOLON 0x061B
+#define a_QUESTION 0x061F
+#define a_HAMZA 0x0621
+#define a_ALEF_MADDA 0x0622
+#define a_ALEF_HAMZA_ABOVE 0x0623
+#define a_WAW_HAMZA 0x0624
+#define a_ALEF_HAMZA_BELOW 0x0625
+#define a_YEH_HAMZA 0x0626
+#define a_ALEF 0x0627
+#define a_BEH 0x0628
+#define a_TEH_MARBUTA 0x0629
+#define a_TEH 0x062a
+#define a_THEH 0x062b
+#define a_JEEM 0x062c
+#define a_HAH 0x062d
+#define a_KHAH 0x062e
+#define a_DAL 0x062f
+#define a_THAL 0x0630
+#define a_REH 0x0631
+#define a_ZAIN 0x0632
+#define a_SEEN 0x0633
+#define a_SHEEN 0x0634
+#define a_SAD 0x0635
+#define a_DAD 0x0636
+#define a_TAH 0x0637
+#define a_ZAH 0x0638
+#define a_AIN 0x0639
+#define a_GHAIN 0x063a
+#define a_TATWEEL 0x0640
+#define a_FEH 0x0641
+#define a_QAF 0x0642
+#define a_KAF 0x0643
+#define a_LAM 0x0644
+#define a_MEEM 0x0645
+#define a_NOON 0x0646
+#define a_HEH 0x0647
+#define a_WAW 0x0648
+#define a_ALEF_MAKSURA 0x0649
+#define a_YEH 0x064a
+
+#define a_FATHATAN 0x064b
+#define a_DAMMATAN 0x064c
+#define a_KASRATAN 0x064d
+#define a_FATHA 0x064e
+#define a_DAMMA 0x064f
+#define a_KASRA 0x0650
+#define a_SHADDA 0x0651
+#define a_SUKUN 0x0652
+
+#define a_MADDA_ABOVE 0x0653
+#define a_HAMZA_ABOVE 0x0654
+#define a_HAMZA_BELOW 0x0655
+
+#define a_ZERO 0x0660
+#define a_ONE 0x0661
+#define a_TWO 0x0662
+#define a_THREE 0x0663
+#define a_FOUR 0x0664
+#define a_FIVE 0x0665
+#define a_SIX 0x0666
+#define a_SEVEN 0x0667
+#define a_EIGHT 0x0668
+#define a_NINE 0x0669
+#define a_PERCENT 0x066a
+#define a_DECIMAL 0x066b
+#define a_THOUSANDS 0x066c
+#define a_STAR 0x066d
+#define a_MINI_ALEF 0x0670
+/* Rest of 8859-6 does not relate to Arabic */
+
+/*
+ * Arabic Presentation Form-B (subset of 10646; FE70 - FEFF)
+ *
+ * s -> isolated
+ * i -> initial
+ * m -> medial
+ * f -> final
+ *
+ */
+#define a_s_FATHATAN 0xfe70
+#define a_m_TATWEEL_FATHATAN 0xfe71
+#define a_s_DAMMATAN 0xfe72
+
+#define a_s_KASRATAN 0xfe74
+
+#define a_s_FATHA 0xfe76
+#define a_m_FATHA 0xfe77
+#define a_s_DAMMA 0xfe78
+#define a_m_DAMMA 0xfe79
+#define a_s_KASRA 0xfe7a
+#define a_m_KASRA 0xfe7b
+#define a_s_SHADDA 0xfe7c
+#define a_m_SHADDA 0xfe7d
+#define a_s_SUKUN 0xfe7e
+#define a_m_SUKUN 0xfe7f
+
+#define a_s_HAMZA 0xfe80
+#define a_s_ALEF_MADDA 0xfe81
+#define a_f_ALEF_MADDA 0xfe82
+#define a_s_ALEF_HAMZA_ABOVE 0xfe83
+#define a_f_ALEF_HAMZA_ABOVE 0xfe84
+#define a_s_WAW_HAMZA 0xfe85
+#define a_f_WAW_HAMZA 0xfe86
+#define a_s_ALEF_HAMZA_BELOW 0xfe87
+#define a_f_ALEF_HAMZA_BELOW 0xfe88
+#define a_s_YEH_HAMZA 0xfe89
+#define a_f_YEH_HAMZA 0xfe8a
+#define a_i_YEH_HAMZA 0xfe8b
+#define a_m_YEH_HAMZA 0xfe8c
+#define a_s_ALEF 0xfe8d
+#define a_f_ALEF 0xfe8e
+#define a_s_BEH 0xfe8f
+#define a_f_BEH 0xfe90
+#define a_i_BEH 0xfe91
+#define a_m_BEH 0xfe92
+#define a_s_TEH_MARBUTA 0xfe93
+#define a_f_TEH_MARBUTA 0xfe94
+#define a_s_TEH 0xfe95
+#define a_f_TEH 0xfe96
+#define a_i_TEH 0xfe97
+#define a_m_TEH 0xfe98
+#define a_s_THEH 0xfe99
+#define a_f_THEH 0xfe9a
+#define a_i_THEH 0xfe9b
+#define a_m_THEH 0xfe9c
+#define a_s_JEEM 0xfe9d
+#define a_f_JEEM 0xfe9e
+#define a_i_JEEM 0xfe9f
+#define a_m_JEEM 0xfea0
+#define a_s_HAH 0xfea1
+#define a_f_HAH 0xfea2
+#define a_i_HAH 0xfea3
+#define a_m_HAH 0xfea4
+#define a_s_KHAH 0xfea5
+#define a_f_KHAH 0xfea6
+#define a_i_KHAH 0xfea7
+#define a_m_KHAH 0xfea8
+#define a_s_DAL 0xfea9
+#define a_f_DAL 0xfeaa
+#define a_s_THAL 0xfeab
+#define a_f_THAL 0xfeac
+#define a_s_REH 0xfead
+#define a_f_REH 0xfeae
+#define a_s_ZAIN 0xfeaf
+#define a_f_ZAIN 0xfeb0
+#define a_s_SEEN 0xfeb1
+#define a_f_SEEN 0xfeb2
+#define a_i_SEEN 0xfeb3
+#define a_m_SEEN 0xfeb4
+#define a_s_SHEEN 0xfeb5
+#define a_f_SHEEN 0xfeb6
+#define a_i_SHEEN 0xfeb7
+#define a_m_SHEEN 0xfeb8
+#define a_s_SAD 0xfeb9
+#define a_f_SAD 0xfeba
+#define a_i_SAD 0xfebb
+#define a_m_SAD 0xfebc
+#define a_s_DAD 0xfebd
+#define a_f_DAD 0xfebe
+#define a_i_DAD 0xfebf
+#define a_m_DAD 0xfec0
+#define a_s_TAH 0xfec1
+#define a_f_TAH 0xfec2
+#define a_i_TAH 0xfec3
+#define a_m_TAH 0xfec4
+#define a_s_ZAH 0xfec5
+#define a_f_ZAH 0xfec6
+#define a_i_ZAH 0xfec7
+#define a_m_ZAH 0xfec8
+#define a_s_AIN 0xfec9
+#define a_f_AIN 0xfeca
+#define a_i_AIN 0xfecb
+#define a_m_AIN 0xfecc
+#define a_s_GHAIN 0xfecd
+#define a_f_GHAIN 0xfece
+#define a_i_GHAIN 0xfecf
+#define a_m_GHAIN 0xfed0
+#define a_s_FEH 0xfed1
+#define a_f_FEH 0xfed2
+#define a_i_FEH 0xfed3
+#define a_m_FEH 0xfed4
+#define a_s_QAF 0xfed5
+#define a_f_QAF 0xfed6
+#define a_i_QAF 0xfed7
+#define a_m_QAF 0xfed8
+#define a_s_KAF 0xfed9
+#define a_f_KAF 0xfeda
+#define a_i_KAF 0xfedb
+#define a_m_KAF 0xfedc
+#define a_s_LAM 0xfedd
+#define a_f_LAM 0xfede
+#define a_i_LAM 0xfedf
+#define a_m_LAM 0xfee0
+#define a_s_MEEM 0xfee1
+#define a_f_MEEM 0xfee2
+#define a_i_MEEM 0xfee3
+#define a_m_MEEM 0xfee4
+#define a_s_NOON 0xfee5
+#define a_f_NOON 0xfee6
+#define a_i_NOON 0xfee7
+#define a_m_NOON 0xfee8
+#define a_s_HEH 0xfee9
+#define a_f_HEH 0xfeea
+#define a_i_HEH 0xfeeb
+#define a_m_HEH 0xfeec
+#define a_s_WAW 0xfeed
+#define a_f_WAW 0xfeee
+#define a_s_ALEF_MAKSURA 0xfeef
+#define a_f_ALEF_MAKSURA 0xfef0
+#define a_s_YEH 0xfef1
+#define a_f_YEH 0xfef2
+#define a_i_YEH 0xfef3
+#define a_m_YEH 0xfef4
+#define a_s_LAM_ALEF_MADDA_ABOVE 0xfef5
+#define a_f_LAM_ALEF_MADDA_ABOVE 0xfef6
+#define a_s_LAM_ALEF_HAMZA_ABOVE 0xfef7
+#define a_f_LAM_ALEF_HAMZA_ABOVE 0xfef8
+#define a_s_LAM_ALEF_HAMZA_BELOW 0xfef9
+#define a_f_LAM_ALEF_HAMZA_BELOW 0xfefa
+#define a_s_LAM_ALEF 0xfefb
+#define a_f_LAM_ALEF 0xfefc
+
+#define a_BYTE_ORDER_MARK 0xfeff
+
+/* Range of Arabic characters that might be shaped. */
+#define ARABIC_CHAR(c) ((c) >= a_HAMZA && (c) <= a_MINI_ALEF)
diff --git a/src/ascii.h b/src/ascii.h
new file mode 100644
index 000000000..8a344ef55
--- /dev/null
+++ b/src/ascii.h
@@ -0,0 +1,201 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Definitions of various common control characters.
+ * For EBCDIC we have to use different values.
+ */
+
+#ifndef EBCDIC
+
+/* IF_EB(ASCII_constant, EBCDIC_constant) */
+#define IF_EB(a, b) a
+
+#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a')
+#define CharOrdLow(x) ((x) - 'a')
+#define CharOrdUp(x) ((x) - 'A')
+#define ROT13(c, a) (((((c) - (a)) + 13) % 26) + (a))
+
+#define NUL '\000'
+#define BELL '\007'
+#define BS '\010'
+#define TAB '\011'
+#define NL '\012'
+#define NL_STR (char_u *)"\012"
+#define FF '\014'
+#define CAR '\015' /* CR is used by Mac OS X */
+#define ESC '\033'
+#define ESC_STR (char_u *)"\033"
+#define ESC_STR_nc "\033"
+#define DEL 0x7f
+#define DEL_STR (char_u *)"\177"
+#define CSI 0x9b /* Control Sequence Introducer */
+#define CSI_STR "\233"
+#define DCS 0x90 /* Device Control String */
+#define STERM 0x9c /* String Terminator */
+
+#define POUND 0xA3
+
+#define Ctrl_chr(x) (TOUPPER_ASC(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */
+#define Meta(x) ((x) | 0x80)
+
+#define CTRL_F_STR "\006"
+#define CTRL_H_STR "\010"
+#define CTRL_V_STR "\026"
+#define CTRL_W_STR "\027"
+
+#define Ctrl_AT 0 /* @ */
+#define Ctrl_A 1
+#define Ctrl_B 2
+#define Ctrl_C 3
+#define Ctrl_D 4
+#define Ctrl_E 5
+#define Ctrl_F 6
+#define Ctrl_G 7
+#define Ctrl_H 8
+#define Ctrl_I 9
+#define Ctrl_J 10
+#define Ctrl_K 11
+#define Ctrl_L 12
+#define Ctrl_M 13
+#define Ctrl_N 14
+#define Ctrl_O 15
+#define Ctrl_P 16
+#define Ctrl_Q 17
+#define Ctrl_R 18
+#define Ctrl_S 19
+#define Ctrl_T 20
+#define Ctrl_U 21
+#define Ctrl_V 22
+#define Ctrl_W 23
+#define Ctrl_X 24
+#define Ctrl_Y 25
+#define Ctrl_Z 26
+#define Ctrl_LSB 27 /* [ Left Square Bracket */
+#define Ctrl_BSL 28 /* \ BackSLash */
+#define Ctrl_RSB 29 /* ] Right Square Bracket */
+#define Ctrl_HAT 30 /* ^ */
+#define Ctrl__ 31
+
+#else
+
+/* EBCDIC */
+
+/* IF_EB(ASCII_constant, EBCDIC_constant) */
+#define IF_EB(a, b) b
+
+/*
+ * Finding the position in the alphabet is not straightforward in EBCDIC.
+ * There are gaps in the code table.
+ * 'a' + 1 == 'b', but: 'i' + 7 == 'j' and 'r' + 8 == 's'
+ */
+#define CharOrd__(c) ((c) < ('j' - 'a') ? (c) : ((c) < ('s' - 'a') ? (c) - 7 : (c) - 7 - 8))
+#define CharOrdLow(x) (CharOrd__((x) - 'a'))
+#define CharOrdUp(x) (CharOrd__((x) - 'A'))
+#define CharOrd(x) (isupper(x) ? CharOrdUp(x) : CharOrdLow(x))
+
+#define EBCDIC_CHAR_ADD_(x) ((x) < 0?'a':(x)>25?'z':"abcdefghijklmnopqrstuvwxyz"[x])
+#define EBCDIC_CHAR_ADD(c,s) (isupper(c) ? toupper(EBCDIC_CHAR_ADD_(CharOrdUp(c)+(s))) : EBCDIC_CHAR_ADD_(CharOrdLow(c)+(s)))
+
+#define R13_(c) ("abcdefghijklmnopqrstuvwxyz"[((c) + 13) % 26])
+#define ROT13(c, a) (isupper(c) ? toupper(R13_(CharOrdUp(c))) : R13_(CharOrdLow(c)))
+
+#define NUL '\000'
+#define BELL '\x2f'
+#define BS '\x16'
+#define TAB '\x05'
+#define NL '\x15'
+#define NL_STR (char_u *)"\x15"
+#define FF '\x0C'
+#define CAR '\x0D'
+#define ESC '\x27'
+#define ESC_STR (char_u *)"\x27"
+#define ESC_STR_nc "\x27"
+#define DEL 0x07
+#define DEL_STR (char_u *)"\007"
+/* TODO: EBCDIC Code page dependent (here 1047) */
+#define CSI 0x9b /* Control Sequence Introducer */
+#define CSI_STR "\233"
+#define DCS 0x90 /* Device Control String */
+#define STERM 0x9c /* String Terminator */
+
+#define POUND '£'
+
+#define CTRL_F_STR "\056"
+#define CTRL_H_STR "\026"
+#define CTRL_V_STR "\062"
+#define CTRL_W_STR "\046"
+
+#define Ctrl_AT 0x00 /* @ */
+#define Ctrl_A 0x01
+#define Ctrl_B 0x02
+#define Ctrl_C 0x03
+#define Ctrl_D 0x37
+#define Ctrl_E 0x2D
+#define Ctrl_F 0x2E
+#define Ctrl_G 0x2F
+#define Ctrl_H 0x16
+#define Ctrl_I 0x05
+#define Ctrl_J 0x15
+#define Ctrl_K 0x0B
+#define Ctrl_L 0x0C
+#define Ctrl_M 0x0D
+#define Ctrl_N 0x0E
+#define Ctrl_O 0x0F
+#define Ctrl_P 0x10
+#define Ctrl_Q 0x11
+#define Ctrl_R 0x12
+#define Ctrl_S 0x13
+#define Ctrl_T 0x3C
+#define Ctrl_U 0x3D
+#define Ctrl_V 0x32
+#define Ctrl_W 0x26
+#define Ctrl_X 0x18
+#define Ctrl_Y 0x19
+#define Ctrl_Z 0x3F
+#define Ctrl_LSB 0x27 /* [ Left Square Bracket */
+#define Ctrl_RSB 0x1D /* ] Right Square Bracket */
+#define Ctrl_BSL 0x1C /* \ BackSLash */
+#define Ctrl_HAT 0x1E /* ^ */
+#define Ctrl__ 0x1F
+
+#define Ctrl_chr(x) (CtrlTable[(x)])
+extern char CtrlTable[];
+
+#define CtrlChar(x) ((x < ' ') ? CtrlCharTable[(x)] : 0)
+extern char CtrlCharTable[];
+
+#define MetaChar(x) ((x < ' ') ? MetaCharTable[(x)] : 0)
+extern char MetaCharTable[];
+
+#endif /* defined EBCDIC */
+
+/*
+ * Character that separates dir names in a path.
+ * For MS-DOS, WIN32 and OS/2 we use a backslash. A slash mostly works
+ * fine, but there are places where it doesn't (e.g. in a command name).
+ * For Macintosh we use a colon.
+ * For Acorn we use a dot.
+ */
+#ifdef BACKSLASH_IN_FILENAME
+# define PATHSEP psepc
+# define PATHSEPSTR pseps
+#else
+# ifdef COLON_AS_PATHSEP
+# define PATHSEP ':'
+# define PATHSEPSTR ":"
+# else
+# ifdef RISCOS
+# define PATHSEP '.'
+# define PATHSEPSTR "."
+# else
+# define PATHSEP '/'
+# define PATHSEPSTR "/"
+# endif
+# endif
+#endif
diff --git a/src/auto/configure b/src/auto/configure
new file mode 100755
index 000000000..b040a75f5
--- /dev/null
+++ b/src/auto/configure
@@ -0,0 +1,8692 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --disable-darwin Disable Darwin (Mac OS X) support."
+ac_help="$ac_help
+ --with-vim-name=NAME what to call the Vim executable"
+ac_help="$ac_help
+ --with-ex-name=NAME what to call the Ex executable"
+ac_help="$ac_help
+ --with-view-name=NAME what to call the View executable"
+ac_help="$ac_help
+ --with-global-runtime=DIR global runtime directory in 'runtimepath'"
+ac_help="$ac_help
+ --with-modified-by=NAME name of who modified a release version"
+ac_help="$ac_help
+ --with-features=TYPE tiny, small, normal, big or huge (default: normal)"
+ac_help="$ac_help
+ --with-compiledby=NAME name to show in :version message"
+ac_help="$ac_help
+ --disable-xsmp Disable XSMP session management"
+ac_help="$ac_help
+ --disable-xsmp-interact Disable XSMP interaction"
+ac_help="$ac_help
+ --enable-perlinterp Include Perl interpreter."
+ac_help="$ac_help
+ --enable-pythoninterp Include Python interpreter."
+ac_help="$ac_help
+ --with-python-config-dir=PATH Python's config directory"
+ac_help="$ac_help
+ --enable-tclinterp Include Tcl interpreter."
+ac_help="$ac_help
+ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)"
+ac_help="$ac_help
+ --enable-rubyinterp Include Ruby interpreter."
+ac_help="$ac_help
+ --enable-cscope Include cscope interface."
+ac_help="$ac_help
+ --enable-workshop Include Sun Visual Workshop support."
+ac_help="$ac_help
+ --disable-netbeans Disable NetBeans integration support."
+ac_help="$ac_help
+ --enable-sniff Include Sniff interface."
+ac_help="$ac_help
+ --enable-multibyte Include multibyte editing support."
+ac_help="$ac_help
+ --enable-hangulinput Include Hangul input support."
+ac_help="$ac_help
+ --enable-xim Include XIM input support."
+ac_help="$ac_help
+ --enable-fontset Include X fontset output support."
+ac_help="$ac_help
+ --with-x use the X Window System"
+ac_help="$ac_help
+ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/beos/photon/carbon]"
+ac_help="$ac_help
+ --enable-gtk-check If auto-select GUI, check for GTK [default=yes]"
+ac_help="$ac_help
+ --enable-gtk2-check If GTK GUI, check for GTK+ 2 [default=yes]"
+ac_help="$ac_help
+ --enable-gnome-check If GTK GUI, check for GNOME [default=no]"
+ac_help="$ac_help
+ --enable-motif-check If auto-select GUI, check for Motif [default=yes]"
+ac_help="$ac_help
+ --enable-athena-check If auto-select GUI, check for Athena [default=yes]"
+ac_help="$ac_help
+ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]"
+ac_help="$ac_help
+ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]"
+ac_help="$ac_help
+ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)"
+ac_help="$ac_help
+ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)"
+ac_help="$ac_help
+ --disable-gtktest Do not try to compile and run a test GTK program"
+ac_help="$ac_help
+ --with-gnome-includes=DIR Specify location of GNOME headers"
+ac_help="$ac_help
+ --with-gnome-libs=DIR Specify location of GNOME libs"
+ac_help="$ac_help
+ --with-gnome Specify prefix for GNOME files"
+ac_help="$ac_help
+ --with-motif-lib=STRING Library for Motif "
+ac_help="$ac_help
+ --with-tlib=library terminal library to be used "
+ac_help="$ac_help
+ --disable-acl Don't check for ACL support."
+ac_help="$ac_help
+ --disable-gpm Don't use gpm (Linux mouse daemon)."
+ac_help="$ac_help
+ --disable-nls Don't support NLS (gettext())."
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>auto/config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=vim.h
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+cat >> confdefs.h <<\EOF
+#define UNIX 1
+EOF
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:620: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:650: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:680: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:731: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:763: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 774 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:805: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:810: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:838: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:869: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 884 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 901 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 918 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+ cat > conftest.$ac_ext <<EOF
+#line 948 "configure"
+#include "confdefs.h"
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "" >/dev/null 2>&1; then
+ :
+fi
+rm -f conftest*
+ echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:958: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ echo "$ac_t""yes" 1>&6
+ ISC=yes # If later tests want to check for ISC.
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+else
+ echo "$ac_t""no" 1>&6
+ ISC=
+fi
+ for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:982: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_AWK="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+ echo "$ac_t""$AWK" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+# Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1014: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_STRIP="strip"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+ echo "$ac_t""$STRIP" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:1043: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1048 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:1059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:1076: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1081 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:1107: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+
+if test -z "$CFLAGS"; then
+ CFLAGS="-O"
+ test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
+fi
+if test "$GCC" = yes; then
+ gccversion=`"$CC" --version | sed -e '2,$d;s/^[^0-9]*\([0-9]\.[0-9.]*\).*$/\1/g'`
+ if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2"; then
+ echo 'GCC 3.0.x has a bug in the optimizer, disabling "-O#"'
+ CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'`
+ else
+ if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
+ echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
+ CFLAGS="$CFLAGS -fno-strength-reduce"
+ fi
+ fi
+fi
+
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: cannot compile a simple program, check CC and CFLAGS
+ (cross compiling doesn't work)" 1>&2; exit 1; }
+fi
+
+test "$GCC" = yes && CPP_MM=M;
+
+if test -f ./toolcheck; then
+ echo "checking for buggy tools" 1>&6
+echo "configure:1164: checking for buggy tools" >&5
+ sh ./toolcheck 1>&6
+fi
+
+OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
+
+echo $ac_n "checking for BeOS""... $ac_c" 1>&6
+echo "configure:1171: checking for BeOS" >&5
+case `uname` in
+ BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
+ BEOS=yes; echo "$ac_t""yes" 1>&6;;
+ *) BEOS=no; echo "$ac_t""no" 1>&6;;
+esac
+
+echo $ac_n "checking for QNX""... $ac_c" 1>&6
+echo "configure:1179: checking for QNX" >&5
+case `uname` in
+ QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
+ test -z "$with_x" && with_x=no
+ QNX=yes; echo "$ac_t""yes" 1>&6;;
+ *) QNX=no; echo "$ac_t""no" 1>&6;;
+esac
+
+DEFAULT_VIMNAME=vim
+echo $ac_n "checking for Darwin (Mac OS X)""... $ac_c" 1>&6
+echo "configure:1189: checking for Darwin (Mac OS X)" >&5
+if test "`(uname) 2>/dev/null`" = Darwin; then
+ echo "$ac_t""yes" 1>&6
+
+ echo $ac_n "checking --disable-darwin argument""... $ac_c" 1>&6
+echo "configure:1194: checking --disable-darwin argument" >&5
+ # Check whether --enable-darwin or --disable-darwin was given.
+if test "${enable_darwin+set}" = set; then
+ enableval="$enable_darwin"
+ :
+else
+ enable_darwin="yes"
+fi
+
+ if test "$enable_darwin" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking if Darwin files are there""... $ac_c" 1>&6
+echo "configure:1206: checking if Darwin files are there" >&5
+ if test -f os_macosx.c; then
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no, Darwin support disabled" 1>&6
+ enable_darwin=no
+ fi
+ else
+ echo "$ac_t""yes, Darwin support excluded" 1>&6
+ fi
+
+ if test "$enable_darwin" = "yes"; then
+ MACOSX=yes
+ OS_EXTRA_SCR="os_macosx.c";
+ OS_EXTRA_OBJ="objects/os_macosx.o"
+ CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
+
+ ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6
+echo "configure:1225: checking for Carbon/Carbon.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1230 "configure"
+#include "confdefs.h"
+#include <Carbon/Carbon.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ CARBON=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "x$CARBON" = "xyes"; then
+ if test -z "$with_x"; then
+ with_x=no
+ DEFAULT_VIMNAME=Vim
+ fi
+ fi
+ fi
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+have_local_include=''
+have_local_lib=''
+if test "$GCC" = yes; then
+ echo 'void f(){}' > conftest.c
+ have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep '/usr/local/include'`
+ have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep '/usr/local/lib'`
+ rm -f conftest.c conftest.o
+fi
+if test -z "$have_local_lib" -a -d /usr/local/lib; then
+ tt=`echo "$LDFLAGS" | sed -e 's+-L/usr/local/lib ++g' -e 's+-L/usr/local/lib$++g'`
+ if test "$tt" = "$LDFLAGS"; then
+ LDFLAGS="$LDFLAGS -L/usr/local/lib"
+ fi
+fi
+if test -z "$have_local_include" -a -d /usr/local/include; then
+ tt=`echo "$CPPFLAGS" | sed -e 's+-I/usr/local/include ++g' -e 's+-I/usr/local/include$++g'`
+ if test "$tt" = "$CPPFLAGS"; then
+ CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+ fi
+fi
+
+echo $ac_n "checking --with-vim-name argument""... $ac_c" 1>&6
+echo "configure:1292: checking --with-vim-name argument" >&5
+# Check whether --with-vim-name or --without-vim-name was given.
+if test "${with_vim_name+set}" = set; then
+ withval="$with_vim_name"
+ VIMNAME="$withval"; echo "$ac_t""$VIMNAME" 1>&6
+else
+ VIMNAME="$DEFAULT_VIMNAME"; echo "$ac_t""Defaulting to $VIMNAME" 1>&6
+fi
+
+
+echo $ac_n "checking --with-ex-name argument""... $ac_c" 1>&6
+echo "configure:1303: checking --with-ex-name argument" >&5
+# Check whether --with-ex-name or --without-ex-name was given.
+if test "${with_ex_name+set}" = set; then
+ withval="$with_ex_name"
+ EXNAME="$withval"; echo "$ac_t""$EXNAME" 1>&6
+else
+ EXNAME="ex"; echo "$ac_t""Defaulting to ex" 1>&6
+fi
+
+
+echo $ac_n "checking --with-view-name argument""... $ac_c" 1>&6
+echo "configure:1314: checking --with-view-name argument" >&5
+# Check whether --with-view-name or --without-view-name was given.
+if test "${with_view_name+set}" = set; then
+ withval="$with_view_name"
+ VIEWNAME="$withval"; echo "$ac_t""$VIEWNAME" 1>&6
+else
+ VIEWNAME="view"; echo "$ac_t""Defaulting to view" 1>&6
+fi
+
+
+
+echo $ac_n "checking --with-global-runtime argument""... $ac_c" 1>&6
+echo "configure:1326: checking --with-global-runtime argument" >&5
+# Check whether --with-global-runtime or --without-global-runtime was given.
+if test "${with_global_runtime+set}" = set; then
+ withval="$with_global_runtime"
+ echo "$ac_t""$withval" 1>&6; cat >> confdefs.h <<EOF
+#define RUNTIME_GLOBAL "$withval"
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking --with-modified-by argument""... $ac_c" 1>&6
+echo "configure:1340: checking --with-modified-by argument" >&5
+# Check whether --with-modified-by or --without-modified-by was given.
+if test "${with_modified_by+set}" = set; then
+ withval="$with_modified_by"
+ echo "$ac_t""$withval" 1>&6; cat >> confdefs.h <<EOF
+#define MODIFIED_BY "$withval"
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking if character set is EBCDIC""... $ac_c" 1>&6
+echo "configure:1354: checking if character set is EBCDIC" >&5
+cat > conftest.$ac_ext <<EOF
+#line 1356 "configure"
+#include "confdefs.h"
+
+int main() {
+ /* TryCompile function for CharSet.
+ Treat any failure as ASCII for compatibility with existing art.
+ Use compile-time rather than run-time tests for cross-compiler
+ tolerance. */
+#if '0'!=240
+make an error "Character set is not EBCDIC"
+#endif
+; return 0; }
+EOF
+if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # TryCompile action if true
+cf_cv_ebcdic=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ # TryCompile action if false
+cf_cv_ebcdic=no
+fi
+rm -f conftest*
+# end of TryCompile ])
+# end of CacheVal CvEbcdic
+echo "$ac_t""$cf_cv_ebcdic" 1>&6
+case "$cf_cv_ebcdic" in #(vi
+ yes) cat >> confdefs.h <<\EOF
+#define EBCDIC 1
+EOF
+
+ line_break='"\\n"'
+ ;;
+ *) line_break='"\\012"';;
+esac
+
+
+if test "$cf_cv_ebcdic" = "yes"; then
+echo $ac_n "checking for OS/390 Unix""... $ac_c" 1>&6
+echo "configure:1397: checking for OS/390 Unix" >&5
+case `uname` in
+ OS/390) OS390Unix="yes";
+ if test "$CC" = "cc"; then
+ ccm="$_CC_CCMODE"
+ ccn="CC"
+ else
+ if test "$CC" = "c89"; then
+ ccm="$_CC_C89MODE"
+ ccn="C89"
+ else
+ ccm=1
+ fi
+ fi
+ if test "$ccm" != "1"; then
+ echo ""
+ echo "------------------------------------------"
+ echo " On OS/390 Unix, the environment variable"
+ echo " __CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+ CFLAGS="$CFLAGS -D_ALL_SOURCE"; LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ echo "$ac_t""yes" 1>&6
+ ;;
+ *) OS390Unix="no";
+ echo "$ac_t""no" 1>&6
+ ;;
+esac
+fi
+
+
+
+echo $ac_n "checking --with-features argument""... $ac_c" 1>&6
+echo "configure:1434: checking --with-features argument" >&5
+# Check whether --with-features or --without-features was given.
+if test "${with_features+set}" = set; then
+ withval="$with_features"
+ features="$withval"; echo "$ac_t""$features" 1>&6
+else
+ features="normal"; echo "$ac_t""Defaulting to normal" 1>&6
+fi
+
+
+dovimdiff=""
+dogvimdiff=""
+case "$features" in
+ tiny) cat >> confdefs.h <<\EOF
+#define FEAT_TINY 1
+EOF
+ ;;
+ small) cat >> confdefs.h <<\EOF
+#define FEAT_SMALL 1
+EOF
+ ;;
+ normal) cat >> confdefs.h <<\EOF
+#define FEAT_NORMAL 1
+EOF
+ dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ big) cat >> confdefs.h <<\EOF
+#define FEAT_BIG 1
+EOF
+ dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ huge) cat >> confdefs.h <<\EOF
+#define FEAT_HUGE 1
+EOF
+ dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ *) echo "$ac_t""Sorry, $features is not supported" 1>&6 ;;
+esac
+
+
+
+
+echo $ac_n "checking --with-compiledby argument""... $ac_c" 1>&6
+echo "configure:1477: checking --with-compiledby argument" >&5
+# Check whether --with-compiledby or --without-compiledby was given.
+if test "${with_compiledby+set}" = set; then
+ withval="$with_compiledby"
+ compiledby="$withval"; echo "$ac_t""$withval" 1>&6
+else
+ compiledby=""; echo "$ac_t""no" 1>&6
+fi
+
+
+
+echo $ac_n "checking --disable-xsmp argument""... $ac_c" 1>&6
+echo "configure:1489: checking --disable-xsmp argument" >&5
+# Check whether --enable-xsmp or --disable-xsmp was given.
+if test "${enable_xsmp+set}" = set; then
+ enableval="$enable_xsmp"
+ :
+else
+ enable_xsmp="yes"
+fi
+
+
+if test "$enable_xsmp" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking --disable-xsmp-interact argument""... $ac_c" 1>&6
+echo "configure:1502: checking --disable-xsmp-interact argument" >&5
+ # Check whether --enable-xsmp-interact or --disable-xsmp-interact was given.
+if test "${enable_xsmp_interact+set}" = set; then
+ enableval="$enable_xsmp_interact"
+ :
+else
+ enable_xsmp_interact="yes"
+fi
+
+ if test "$enable_xsmp_interact" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ cat >> confdefs.h <<\EOF
+#define USE_XSMP_INTERACT 1
+EOF
+
+ else
+ echo "$ac_t""yes" 1>&6
+ fi
+else
+ echo "$ac_t""yes" 1>&6
+fi
+
+echo $ac_n "checking --enable-perlinterp argument""... $ac_c" 1>&6
+echo "configure:1525: checking --enable-perlinterp argument" >&5
+# Check whether --enable-perlinterp or --disable-perlinterp was given.
+if test "${enable_perlinterp+set}" = set; then
+ enableval="$enable_perlinterp"
+ :
+else
+ enable_perlinterp="no"
+fi
+
+echo "$ac_t""$enable_perlinterp" 1>&6
+if test "$enable_perlinterp" = "yes"; then
+
+ # Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1540: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_perl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_perl" in
+ /*)
+ ac_cv_path_vi_cv_path_perl="$vi_cv_path_perl" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_perl="$vi_cv_path_perl" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_perl="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_perl="$ac_cv_path_vi_cv_path_perl"
+if test -n "$vi_cv_path_perl"; then
+ echo "$ac_t""$vi_cv_path_perl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "X$vi_cv_path_perl" != "X"; then
+ echo $ac_n "checking Perl version""... $ac_c" 1>&6
+echo "configure:1574: checking Perl version" >&5
+ if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
+ eval `$vi_cv_path_perl -V:usethreads`
+ if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
+ badthreads=no
+ else
+ if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
+ eval `$vi_cv_path_perl -V:use5005threads`
+ if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
+ badthreads=no
+ else
+ badthreads=yes
+ echo "$ac_t"">>> Perl > 5.6 with 5.5 threads cannot be used <<<" 1>&6
+ fi
+ else
+ badthreads=yes
+ echo "$ac_t"">>> Perl 5.5 with threads cannot be used <<<" 1>&6
+ fi
+ fi
+ if test $badthreads = no; then
+ echo "$ac_t""OK" 1>&6
+ eval `$vi_cv_path_perl -V:shrpenv`
+ if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
+ shrpenv=""
+ fi
+ vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
+
+ perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
+ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'`
+ perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
+ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
+ -e 's/-bE:perl.exp//' -e 's/-lc //'`
+ perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
+ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
+
+ echo $ac_n "checking if compile and link flags for Perl are sane""... $ac_c" 1>&6
+echo "configure:1610: checking if compile and link flags for Perl are sane" >&5
+ cflags_save=$CFLAGS
+ libs_save=$LIBS
+ ldflags_save=$LDFLAGS
+ CFLAGS="$CFLAGS $perlcppflags"
+ LIBS="$LIBS $perllibs"
+ LDFLAGS="$perlldflags $LDFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 1618 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; perl_ok=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no: PERL DISABLED" 1>&6; perl_ok=no
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+ LIBS=$libs_save
+ LDFLAGS=$ldflags_save
+ if test $perl_ok = yes; then
+ if test "X$perlcppflags" != "X"; then
+ PERL_CFLAGS="$perlcppflags"
+ fi
+ if test "X$perlldflags" != "X"; then
+ LDFLAGS="$perlldflags $LDFLAGS"
+ fi
+ PERL_LIBS=$perllibs
+ PERL_SRC="auto/if_perl.c if_perlsfio.c"
+ PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
+ PERL_PRO="if_perl.pro if_perlsfio.pro"
+ cat >> confdefs.h <<\EOF
+#define FEAT_PERL 1
+EOF
+
+ fi
+ fi
+ else
+ echo "$ac_t"">>> too old; need Perl version 5.003_01 or later <<<" 1>&6
+ fi
+ fi
+
+ if test "x$MACOSX" = "xyes"; then
+ dir=/System/Library/Perl
+ darwindir=$dir/darwin
+ if test -d $darwindir; then
+ PERL=/usr/bin/perl
+ else
+ dir=/System/Library/Perl/5.8.1
+ darwindir=$dir/darwin-thread-multi-2level
+ if test -d $darwindir; then
+ PERL=/usr/bin/perl
+ fi
+ fi
+ if test -n "$PERL"; then
+ PERL_DIR="$dir"
+ PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
+ PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
+ PERL_LIBS="-L$darwindir/CORE -lperl"
+ fi
+ fi
+fi
+
+
+
+
+
+
+
+echo $ac_n "checking --enable-pythoninterp argument""... $ac_c" 1>&6
+echo "configure:1688: checking --enable-pythoninterp argument" >&5
+# Check whether --enable-pythoninterp or --disable-pythoninterp was given.
+if test "${enable_pythoninterp+set}" = set; then
+ enableval="$enable_pythoninterp"
+ :
+else
+ enable_pythoninterp="no"
+fi
+
+echo "$ac_t""$enable_pythoninterp" 1>&6
+if test "$enable_pythoninterp" = "yes"; then
+ # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1702: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_python'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_python" in
+ /*)
+ ac_cv_path_vi_cv_path_python="$vi_cv_path_python" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_python="$vi_cv_path_python" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_python="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_python="$ac_cv_path_vi_cv_path_python"
+if test -n "$vi_cv_path_python"; then
+ echo "$ac_t""$vi_cv_path_python" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "X$vi_cv_path_python" != "X"; then
+
+ echo $ac_n "checking Python version""... $ac_c" 1>&6
+echo "configure:1737: checking Python version" >&5
+if eval "test \"`echo '$''{'vi_cv_var_python_version'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ vi_cv_var_python_version=`
+ ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
+
+fi
+
+echo "$ac_t""$vi_cv_var_python_version" 1>&6
+
+ echo $ac_n "checking Python is 1.4 or better""... $ac_c" 1>&6
+echo "configure:1749: checking Python is 1.4 or better" >&5
+ if ${vi_cv_path_python} -c \
+ "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
+ then
+ echo "$ac_t""yep" 1>&6
+
+ echo $ac_n "checking Python's install prefix""... $ac_c" 1>&6
+echo "configure:1756: checking Python's install prefix" >&5
+if eval "test \"`echo '$''{'vi_cv_path_python_pfx'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ vi_cv_path_python_pfx=`
+ ${vi_cv_path_python} -c \
+ "import sys; print sys.prefix"`
+fi
+
+echo "$ac_t""$vi_cv_path_python_pfx" 1>&6
+
+ echo $ac_n "checking Python's execution prefix""... $ac_c" 1>&6
+echo "configure:1768: checking Python's execution prefix" >&5
+if eval "test \"`echo '$''{'vi_cv_path_python_epfx'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ vi_cv_path_python_epfx=`
+ ${vi_cv_path_python} -c \
+ "import sys; print sys.exec_prefix"`
+fi
+
+echo "$ac_t""$vi_cv_path_python_epfx" 1>&6
+
+
+ if eval "test \"`echo '$''{'vi_cv_path_pythonpath'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ vi_cv_path_pythonpath=`
+ unset PYTHONPATH;
+ ${vi_cv_path_python} -c \
+ "import sys, string; print string.join(sys.path,':')"`
+fi
+
+
+
+ # Check whether --with-python-config-dir or --without-python-config-dir was given.
+if test "${with_python_config_dir+set}" = set; then
+ withval="$with_python_config_dir"
+ vi_cv_path_python_conf="${withval}"
+fi
+
+
+ echo $ac_n "checking Python's configuration directory""... $ac_c" 1>&6
+echo "configure:1799: checking Python's configuration directory" >&5
+if eval "test \"`echo '$''{'vi_cv_path_python_conf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ vi_cv_path_python_conf=
+ for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
+ for subdir in lib share; do
+ d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
+ if test -d "$d" && test -f "$d/config.c"; then
+ vi_cv_path_python_conf="$d"
+ fi
+ done
+ done
+
+fi
+
+echo "$ac_t""$vi_cv_path_python_conf" 1>&6
+
+ PYTHON_CONFDIR="${vi_cv_path_python_conf}"
+
+ if test "X$PYTHON_CONFDIR" = "X"; then
+ echo "$ac_t""can't find it!" 1>&6
+ else
+
+ if eval "test \"`echo '$''{'vi_cv_path_python_plibs'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ tmp_mkf="/tmp/Makefile-conf$$"
+ cat ${PYTHON_CONFDIR}/Makefile - <<'eof' >${tmp_mkf}
+__:
+ @echo "python_MODLIBS='$(MODLIBS)'"
+ @echo "python_LIBS='$(LIBS)'"
+ @echo "python_SYSLIBS='$(SYSLIBS)'"
+ @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
+eof
+ eval "`cd ${PYTHON_CONFDIR} && make -f ${tmp_mkf} __ | sed '/ directory /d'`"
+ rm -f ${tmp_mkf}
+ if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
+ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
+ vi_cv_path_python_plibs="-framework Python"
+ else
+ if test "${vi_cv_var_python_version}" = "1.4"; then
+ vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
+ else
+ vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
+ fi
+ vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_MODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
+ vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
+ fi
+
+fi
+
+
+ PYTHON_LIBS="${vi_cv_path_python_plibs}"
+ if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
+ PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
+ else
+ PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}"
+ fi
+ PYTHON_SRC="if_python.c"
+ if test "x$MACOSX" = "xyes"; then
+ PYTHON_OBJ="objects/if_python.o"
+ else
+ PYTHON_OBJ="objects/if_python.o objects/py_config.o"
+ fi
+ if test "${vi_cv_var_python_version}" = "1.4"; then
+ PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
+ fi
+ PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
+
+ echo $ac_n "checking if -pthread should be used""... $ac_c" 1>&6
+echo "configure:1872: checking if -pthread should be used" >&5
+ threadsafe_flag=
+ thread_lib=
+ if test "x$MACOSX" != "xyes"; then
+ test "$GCC" = yes && threadsafe_flag="-pthread"
+ if test "`(uname) 2>/dev/null`" = FreeBSD; then
+ threadsafe_flag="-D_THREAD_SAFE"
+ thread_lib="-pthread"
+ fi
+ fi
+ libs_save_old=$LIBS
+ if test -n "$threadsafe_flag"; then
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $threadsafe_flag"
+ LIBS="$LIBS $thread_lib"
+ cat > conftest.$ac_ext <<EOF
+#line 1888 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6; LIBS=$libs_save_old
+
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+
+ echo $ac_n "checking if compile and link flags for Python are sane""... $ac_c" 1>&6
+echo "configure:1912: checking if compile and link flags for Python are sane" >&5
+ cflags_save=$CFLAGS
+ libs_save=$LIBS
+ CFLAGS="$CFLAGS $PYTHON_CFLAGS"
+ LIBS="$LIBS $PYTHON_LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 1918 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; python_ok=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no: PYTHON DISABLED" 1>&6; python_ok=no
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+ LIBS=$libs_save
+ if test $python_ok = yes; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_PYTHON 1
+EOF
+
+ else
+ LIBS=$libs_save_old
+ PYTHON_SRC=
+ PYTHON_OBJ=
+ PYTHON_LIBS=
+ PYTHON_CFLAGS=
+ fi
+
+ fi
+ else
+ echo "$ac_t""too old" 1>&6
+ fi
+ fi
+fi
+
+
+
+
+
+
+
+echo $ac_n "checking --enable-tclinterp argument""... $ac_c" 1>&6
+echo "configure:1964: checking --enable-tclinterp argument" >&5
+# Check whether --enable-tclinterp or --disable-tclinterp was given.
+if test "${enable_tclinterp+set}" = set; then
+ enableval="$enable_tclinterp"
+ :
+else
+ enable_tclinterp="no"
+fi
+
+echo "$ac_t""$enable_tclinterp" 1>&6
+
+if test "$enable_tclinterp" = "yes"; then
+
+ echo $ac_n "checking --with-tclsh argument""... $ac_c" 1>&6
+echo "configure:1978: checking --with-tclsh argument" >&5
+ # Check whether --with-tclsh or --without-tclsh was given.
+if test "${with_tclsh+set}" = set; then
+ withval="$with_tclsh"
+ tclsh_name="$withval"; echo "$ac_t""$tclsh_name" 1>&6
+else
+ tclsh_name="tclsh8.0"; echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "$tclsh_name", so it can be a program name with args.
+set dummy $tclsh_name; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1990: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_tcl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_tcl" in
+ /*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_tcl="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_tcl="$ac_cv_path_vi_cv_path_tcl"
+if test -n "$vi_cv_path_tcl"; then
+ echo "$ac_t""$vi_cv_path_tcl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+ if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.0"; then
+ tclsh_name="tclsh8.2"
+ # Extract the first word of "$tclsh_name", so it can be a program name with args.
+set dummy $tclsh_name; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2029: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_tcl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_tcl" in
+ /*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_tcl="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_tcl="$ac_cv_path_vi_cv_path_tcl"
+if test -n "$vi_cv_path_tcl"; then
+ echo "$ac_t""$vi_cv_path_tcl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ if test "X$vi_cv_path_tcl" = "X"; then
+ tclsh_name="tclsh"
+ # Extract the first word of "$tclsh_name", so it can be a program name with args.
+set dummy $tclsh_name; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2067: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_tcl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_tcl" in
+ /*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_tcl="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_tcl="$ac_cv_path_vi_cv_path_tcl"
+if test -n "$vi_cv_path_tcl"; then
+ echo "$ac_t""$vi_cv_path_tcl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ if test "X$vi_cv_path_tcl" != "X"; then
+ echo $ac_n "checking Tcl version""... $ac_c" 1>&6
+echo "configure:2102: checking Tcl version" >&5
+ if echo 'exit [expr [info tclversion] < 8.0]' | $vi_cv_path_tcl - ; then
+ tclver=`echo 'puts [info tclversion]' | $vi_cv_path_tcl -`
+ echo "$ac_t""$tclver - OK" 1>&6;
+ tclloc=`echo 'set l [info library];set i [string last lib $l];incr i -2;puts [string range $l 0 $i]' | $vi_cv_path_tcl -`
+
+ echo $ac_n "checking for location of Tcl include""... $ac_c" 1>&6
+echo "configure:2109: checking for location of Tcl include" >&5
+ if test "x$MACOSX" != "xyes"; then
+ tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include"
+ else
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ echo "$ac_t""$try/tcl.h" 1>&6
+ TCL_INC=$try
+ break
+ fi
+ done
+ if test -z "$TCL_INC"; then
+ echo "$ac_t""<not found>" 1>&6
+ SKIP_TCL=YES
+ fi
+ if test -z "$SKIP_TCL"; then
+ echo $ac_n "checking for location of tclConfig.sh script""... $ac_c" 1>&6
+echo "configure:2128: checking for location of tclConfig.sh script" >&5
+ if test "x$MACOSX" != "xyes"; then
+ tclcnf=`echo $tclinc | sed s/include/lib/g`
+ else
+ tclcnf="/System/Library/Frameworks/Tcl.framework"
+ fi
+ for try in $tclcnf; do
+ if test -f $try/tclConfig.sh; then
+ echo "$ac_t""$try/tclConfig.sh" 1>&6
+ . $try/tclConfig.sh
+ TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
+ TCL_DEFS=`echo $TCL_DEFS | tr ' ' '\012' | sed -e '/^-[^D]/d' -e '/-D[^_]/d' -e 's/-D_/ -D_/' | tr -d '\012'`
+ break
+ fi
+ done
+ if test -z "$TCL_LIBS"; then
+ echo "$ac_t""<not found>" 1>&6
+ echo $ac_n "checking for Tcl library by myself""... $ac_c" 1>&6
+echo "configure:2146: checking for Tcl library by myself" >&5
+ tcllib=`echo $tclinc | sed s/include/lib/g`
+ for ext in .so .a ; do
+ for ver in "" $tclver ; do
+ for try in $tcllib ; do
+ trylib=tcl$ver$ext
+ if test -f $try/lib$trylib ; then
+ echo "$ac_t""$try/lib$trylib" 1>&6
+ TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ TCL_LIBS="$TCL_LIBS -R $try"
+ fi
+ break 3
+ fi
+ done
+ done
+ done
+ if test -z "$TCL_LIBS"; then
+ echo "$ac_t""<not found>" 1>&6
+ SKIP_TCL=YES
+ fi
+ fi
+ if test -z "$SKIP_TCL"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_TCL 1
+EOF
+
+ TCL_SRC=if_tcl.c
+ TCL_OBJ=objects/if_tcl.o
+ TCL_PRO=if_tcl.pro
+ TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
+ fi
+ fi
+ else
+ echo "$ac_t""too old; need Tcl version 8.0 or later" 1>&6
+ fi
+ fi
+fi
+
+
+
+
+
+
+echo $ac_n "checking --enable-rubyinterp argument""... $ac_c" 1>&6
+echo "configure:2192: checking --enable-rubyinterp argument" >&5
+# Check whether --enable-rubyinterp or --disable-rubyinterp was given.
+if test "${enable_rubyinterp+set}" = set; then
+ enableval="$enable_rubyinterp"
+ :
+else
+ enable_rubyinterp="no"
+fi
+
+echo "$ac_t""$enable_rubyinterp" 1>&6
+if test "$enable_rubyinterp" = "yes"; then
+
+ # Extract the first word of "ruby", so it can be a program name with args.
+set dummy ruby; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2207: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_ruby'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$vi_cv_path_ruby" in
+ /*)
+ ac_cv_path_vi_cv_path_ruby="$vi_cv_path_ruby" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_vi_cv_path_ruby="$vi_cv_path_ruby" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_vi_cv_path_ruby="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+vi_cv_path_ruby="$ac_cv_path_vi_cv_path_ruby"
+if test -n "$vi_cv_path_ruby"; then
+ echo "$ac_t""$vi_cv_path_ruby" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "X$vi_cv_path_ruby" != "X"; then
+ echo $ac_n "checking Ruby version""... $ac_c" 1>&6
+echo "configure:2241: checking Ruby version" >&5
+ if $vi_cv_path_ruby -e 'VERSION >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
+ echo "$ac_t""OK" 1>&6
+ echo $ac_n "checking Ruby header files""... $ac_c" 1>&6
+echo "configure:2245: checking Ruby header files" >&5
+ rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null`
+ if test "X$rubyhdrdir" != "X"; then
+ echo "$ac_t""$rubyhdrdir" 1>&6
+ RUBY_CFLAGS="-I$rubyhdrdir"
+ rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LIBS"]'`
+ if test "X$rubylibs" != "X"; then
+ RUBY_LIBS="$rubylibs"
+ fi
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["LIBRUBYARG"])'`
+ if test -f "$rubyhdrdir/$librubyarg"; then
+ librubyarg="$rubyhdrdir/$librubyarg"
+ else
+ rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["libdir"])'`
+ if test -f "$rubylibdir/$librubyarg"; then
+ librubyarg="$rubylibdir/$librubyarg"
+ elif test "$librubyarg" = "libruby.a"; then
+ librubyarg="-lruby"
+ else
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
+ fi
+ fi
+
+ if test "X$librubyarg" != "X"; then
+ RUBY_LIBS="$librubyarg $RUBY_LIBS"
+ fi
+ rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'`
+ if test "X$rubyldflags" != "X"; then
+ LDFLAGS="$rubyldflags $LDFLAGS"
+ fi
+ RUBY_SRC="if_ruby.c"
+ RUBY_OBJ="objects/if_ruby.o"
+ RUBY_PRO="if_ruby.pro"
+ cat >> confdefs.h <<\EOF
+#define FEAT_RUBY 1
+EOF
+
+ else
+ echo "$ac_t""not found" 1>&6
+ fi
+ else
+ echo "$ac_t""too old; need Ruby version 1.6.0 or later" 1>&6
+ fi
+ fi
+fi
+
+
+
+
+
+
+echo $ac_n "checking --enable-cscope argument""... $ac_c" 1>&6
+echo "configure:2297: checking --enable-cscope argument" >&5
+# Check whether --enable-cscope or --disable-cscope was given.
+if test "${enable_cscope+set}" = set; then
+ enableval="$enable_cscope"
+ :
+else
+ enable_cscope="no"
+fi
+
+echo "$ac_t""$enable_cscope" 1>&6
+if test "$enable_cscope" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_CSCOPE 1
+EOF
+
+fi
+
+echo $ac_n "checking --enable-workshop argument""... $ac_c" 1>&6
+echo "configure:2315: checking --enable-workshop argument" >&5
+# Check whether --enable-workshop or --disable-workshop was given.
+if test "${enable_workshop+set}" = set; then
+ enableval="$enable_workshop"
+ :
+else
+ enable_workshop="no"
+fi
+
+echo "$ac_t""$enable_workshop" 1>&6
+if test "$enable_workshop" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_SUN_WORKSHOP 1
+EOF
+
+ WORKSHOP_SRC="workshop.c integration.c"
+
+ WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
+
+ if test "${enable_gui-xxx}" = xxx; then
+ enable_gui=motif
+ fi
+fi
+
+echo $ac_n "checking --disable-netbeans argument""... $ac_c" 1>&6
+echo "configure:2340: checking --disable-netbeans argument" >&5
+# Check whether --enable-netbeans or --disable-netbeans was given.
+if test "${enable_netbeans+set}" = set; then
+ enableval="$enable_netbeans"
+ :
+else
+ enable_netbeans="yes"
+fi
+
+if test "$enable_netbeans" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:2352: checking for socket in -lsocket" >&5
+ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2360 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket();
+
+int main() {
+socket()
+; return 0; }
+EOF
+if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:2399: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2407 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking whether compiling netbeans integration is possible""... $ac_c" 1>&6
+echo "configure:2446: checking whether compiling netbeans integration is possible" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 2448 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+ /* Check bitfields */
+ struct nbbuf {
+ unsigned int initDone:1;
+ ushort signmaplen;
+ };
+
+int main() {
+
+ /* Check creating a socket. */
+ struct sockaddr_in server;
+ (void)socket(AF_INET, SOCK_STREAM, 0);
+ (void)htons(100);
+ (void)gethostbyname("microsoft.com");
+ if (errno == ECONNREFUSED)
+ (void)connect(1, (struct sockaddr *)&server, sizeof(server));
+
+; return 0; }
+EOF
+if { (eval echo configure:2478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6; enable_netbeans="no"
+fi
+rm -f conftest*
+else
+ echo "$ac_t""yes" 1>&6
+fi
+if test "$enable_netbeans" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_NETBEANS_INTG 1
+EOF
+
+ NETBEANS_SRC="netbeans.c"
+
+ NETBEANS_OBJ="objects/netbeans.o"
+
+fi
+
+echo $ac_n "checking --enable-sniff argument""... $ac_c" 1>&6
+echo "configure:2503: checking --enable-sniff argument" >&5
+# Check whether --enable-sniff or --disable-sniff was given.
+if test "${enable_sniff+set}" = set; then
+ enableval="$enable_sniff"
+ :
+else
+ enable_sniff="no"
+fi
+
+echo "$ac_t""$enable_sniff" 1>&6
+if test "$enable_sniff" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_SNIFF 1
+EOF
+
+ SNIFF_SRC="if_sniff.c"
+
+ SNIFF_OBJ="objects/if_sniff.o"
+
+fi
+
+echo $ac_n "checking --enable-multibyte argument""... $ac_c" 1>&6
+echo "configure:2525: checking --enable-multibyte argument" >&5
+# Check whether --enable-multibyte or --disable-multibyte was given.
+if test "${enable_multibyte+set}" = set; then
+ enableval="$enable_multibyte"
+ :
+else
+ enable_multibyte="no"
+fi
+
+echo "$ac_t""$enable_multibyte" 1>&6
+if test "$enable_multibyte" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_MBYTE 1
+EOF
+
+fi
+
+echo $ac_n "checking --enable-hangulinput argument""... $ac_c" 1>&6
+echo "configure:2543: checking --enable-hangulinput argument" >&5
+# Check whether --enable-hangulinput or --disable-hangulinput was given.
+if test "${enable_hangulinput+set}" = set; then
+ enableval="$enable_hangulinput"
+ :
+else
+ enable_hangulinput="no"
+fi
+
+echo "$ac_t""$enable_hangulinput" 1>&6
+
+echo $ac_n "checking --enable-xim argument""... $ac_c" 1>&6
+echo "configure:2555: checking --enable-xim argument" >&5
+# Check whether --enable-xim or --disable-xim was given.
+if test "${enable_xim+set}" = set; then
+ enableval="$enable_xim"
+ echo "$ac_t""$enable_xim" 1>&6
+else
+ enable_xim="auto"; echo "$ac_t""defaulting to auto" 1>&6
+fi
+
+
+echo $ac_n "checking --enable-fontset argument""... $ac_c" 1>&6
+echo "configure:2566: checking --enable-fontset argument" >&5
+# Check whether --enable-fontset or --disable-fontset was given.
+if test "${enable_fontset+set}" = set; then
+ enableval="$enable_fontset"
+ :
+else
+ enable_fontset="no"
+fi
+
+echo "$ac_t""$enable_fontset" 1>&6
+
+test -z "$with_x" && with_x=yes
+test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
+if test "$with_x" = no; then
+ echo "$ac_t""defaulting to: don't HAVE_X11" 1>&6
+else
+
+ # Extract the first word of "xmkmf", so it can be a program name with args.
+set dummy xmkmf; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2586: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_xmkmfpath'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$xmkmfpath" in
+ /*)
+ ac_cv_path_xmkmfpath="$xmkmfpath" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_xmkmfpath="$xmkmfpath" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_xmkmfpath="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+fi
+xmkmfpath="$ac_cv_path_xmkmfpath"
+if test -n "$xmkmfpath"; then
+ echo "$ac_t""$xmkmfpath" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ # If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:2624: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+ withval="$with_x"
+ :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ have_x=yes
+ else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+ cd conftestdir
+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl; do
+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case "$ac_im_incroot" in
+ /usr/include) ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+ esac
+ case "$ac_im_usrlibdir" in
+ /usr/lib | /lib) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+ esac
+ fi
+ cd ..
+ rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 2686 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2760 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:2767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+ /usr/X11/lib \
+ /usr/X11R6/lib \
+ /usr/X11R5/lib \
+ /usr/X11R4/lib \
+ \
+ /usr/lib/X11 \
+ /usr/lib/X11R6 \
+ /usr/lib/X11R5 \
+ /usr/lib/X11R4 \
+ \
+ /usr/local/X11/lib \
+ /usr/local/X11R6/lib \
+ /usr/local/X11R5/lib \
+ /usr/local/X11R4/lib \
+ \
+ /usr/local/lib/X11 \
+ /usr/local/lib/X11R6 \
+ /usr/local/lib/X11R5 \
+ /usr/local/lib/X11R4 \
+ \
+ /usr/X386/lib \
+ /usr/x386/lib \
+ /usr/XFree86/lib/X11 \
+ \
+ /usr/lib \
+ /usr/local/lib \
+ /usr/unsupported/lib \
+ /usr/athena/lib \
+ /usr/local/x11r5/lib \
+ /usr/lpp/Xamples/lib \
+ /lib/usr/lib/X11 \
+ \
+ /usr/openwin/lib \
+ /usr/openwin/share/lib \
+ ; \
+do
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ ac_cv_have_x="have_x=no"
+else
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+ fi
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ echo "$ac_t""$have_x" 1>&6
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+if test "$no_x" = yes; then
+ # Not all programs may use this symbol, but it does not hurt to define it.
+ cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+ if test -n "$x_includes"; then
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ fi
+
+ # It would also be nice to do this for all -L options, not just this one.
+ if test -n "$x_libraries"; then
+ X_LIBS="$X_LIBS -L$x_libraries"
+ # For Solaris; some versions of Sun CC require a space after -R and
+ # others require no space. Words are not sufficient . . . .
+ case "`(uname -sr) 2>/dev/null`" in
+ "SunOS 5"*)
+ echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:2873: checking whether -R must be followed by a space" >&5
+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+ cat > conftest.$ac_ext <<EOF
+#line 2876 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_R_nospace=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_R_nospace=no
+fi
+rm -f conftest*
+ if test $ac_R_nospace = yes; then
+ echo "$ac_t""no" 1>&6
+ X_LIBS="$X_LIBS -R$x_libraries"
+ else
+ LIBS="$ac_xsave_LIBS -R $x_libraries"
+ cat > conftest.$ac_ext <<EOF
+#line 2899 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_R_space=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_R_space=no
+fi
+rm -f conftest*
+ if test $ac_R_space = yes; then
+ echo "$ac_t""yes" 1>&6
+ X_LIBS="$X_LIBS -R $x_libraries"
+ else
+ echo "$ac_t""neither works" 1>&6
+ fi
+ fi
+ LIBS="$ac_xsave_LIBS"
+ esac
+ fi
+
+ # Check for system-dependent libraries X programs must link with.
+ # Do this before checking for the system-independent R6 libraries
+ # (-lICE), since we may need -lsocket or whatever for X linking.
+
+ if test "$ISC" = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+ else
+ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+ # libraries were built with DECnet support. And karl@cs.umb.edu says
+ # the Alpha needs dnet_stub (dnet does not exist).
+ echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:2938: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldnet $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2946 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:2979: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldnet_stub $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2987 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:2998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to dickey@clark.net.
+ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:3027: checking for gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3032 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+gethostbyname();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_gethostbyname=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_gethostbyname=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_gethostbyname = no; then
+ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:3076: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lnsl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3084 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:3095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # lieder@skyler.mavd.honeywell.com says without -lsocket,
+ # socket/setsockopt and other routines are undefined under SCO ODT
+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
+ # on later versions), says simon@lia.di.epfl.ch: it contains
+ # gethostby* variants that don't use the nameserver (or something).
+ # -lsocket must be given before -lnsl if both are needed.
+ # We assume that if connect needs -lnsl, so does gethostbyname.
+ echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:3125: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3130 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_connect=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_connect = no; then
+ echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:3174: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3182 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect();
+
+int main() {
+connect()
+; return 0; }
+EOF
+if { (eval echo configure:3193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
+ echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:3217: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3222 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char remove(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char remove();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_remove=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_remove = no; then
+ echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:3266: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lposix $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3274 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:3285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:3309: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3314 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shmat(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shmat();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_shmat=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_shmat = no; then
+ echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:3358: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lipc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3366 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:3377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ fi
+
+ # Check for libraries that X11R6 Xt/Xaw programs need.
+ ac_save_LDFLAGS="$LDFLAGS"
+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+ # check for ICE first), but we must link in the order -lSM -lICE or
+ # we get undefined symbols. So assume we have SM if we have ICE.
+ # These have to be linked with before -lX11, unlike the other
+ # libraries we check for below, so use a different variable.
+ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+ echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:3410: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3418 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char IceConnectionNumber();
+
+int main() {
+IceConnectionNumber()
+; return 0; }
+EOF
+if { (eval echo configure:3429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ LDFLAGS="$ac_save_LDFLAGS"
+
+fi
+
+
+ if test "$OS390Unix" = "yes"; then
+ CFLAGS="$CFLAGS -W c,dll"
+ LDFLAGS="$LDFLAGS -W l,dll"
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
+ fi
+
+
+ if test -d "$x_includes" && test ! -d "$x_libraries"; then
+ x_libraries=`echo "$x_includes" | sed s/include/lib/`
+ echo "$ac_t""Corrected X libraries to $x_libraries" 1>&6
+ X_LIBS="$X_LIBS -L$x_libraries"
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ X_LIBS="$X_LIBS -R $x_libraries"
+ fi
+ fi
+
+ if test -d "$x_libraries" && test ! -d "$x_includes"; then
+ x_includes=`echo "$x_libraries" | sed s/lib/include/`
+ echo "$ac_t""Corrected X includes to $x_includes" 1>&6
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ fi
+
+ X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
+ X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
+ X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
+
+
+ echo $ac_n "checking if X11 header files can be found""... $ac_c" 1>&6
+echo "configure:3483: checking if X11 header files can be found" >&5
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 3487 "configure"
+#include "confdefs.h"
+#include <X11/Xlib.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6; no_x=yes
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+
+ if test "${no_x-no}" = yes; then
+ with_x=no
+ else
+ cat >> confdefs.h <<\EOF
+#define HAVE_X11 1
+EOF
+
+ X_LIB="-lXt -lX11";
+
+
+ ac_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-L$x_libraries $LDFLAGS"
+
+ echo $ac_n "checking for _XdmcpAuthDoIt in -lXdmcp""... $ac_c" 1>&6
+echo "configure:3520: checking for _XdmcpAuthDoIt in -lXdmcp" >&5
+ac_lib_var=`echo Xdmcp'_'_XdmcpAuthDoIt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXdmcp -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3528 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _XdmcpAuthDoIt();
+
+int main() {
+_XdmcpAuthDoIt()
+; return 0; }
+EOF
+if { (eval echo configure:3539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ echo $ac_n "checking for IceOpenConnection in -lICE""... $ac_c" 1>&6
+echo "configure:3561: checking for IceOpenConnection in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceOpenConnection | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3569 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char IceOpenConnection();
+
+int main() {
+IceOpenConnection()
+; return 0; }
+EOF
+if { (eval echo configure:3580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
+ echo $ac_n "checking for XpmCreatePixmapFromData in -lXpm""... $ac_c" 1>&6
+echo "configure:3603: checking for XpmCreatePixmapFromData in -lXpm" >&5
+ac_lib_var=`echo Xpm'_'XpmCreatePixmapFromData | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXpm -lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3611 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XpmCreatePixmapFromData();
+
+int main() {
+XpmCreatePixmapFromData()
+; return 0; }
+EOF
+if { (eval echo configure:3622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_PRE_LIBS="$X_PRE_LIBS -lXpm"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ echo $ac_n "checking if X11 header files implicitly declare return values""... $ac_c" 1>&6
+echo "configure:3644: checking if X11 header files implicitly declare return values" >&5
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS -Werror"
+ cat > conftest.$ac_ext <<EOF
+#line 3648 "configure"
+#include "confdefs.h"
+#include <X11/Xlib.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CFLAGS="$CFLAGS -Wno-implicit-int"
+ cat > conftest.$ac_ext <<EOF
+#line 3664 "configure"
+#include "confdefs.h"
+#include <X11/Xlib.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cflags_save="$cflags_save -Wno-implicit-int"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""test failed" 1>&6
+
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+
+ LDFLAGS="$ac_save_LDFLAGS"
+
+ fi
+fi
+
+test "x$with_x" = xno -a "x$BEOS" != "xyes" -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
+
+echo $ac_n "checking --enable-gui argument""... $ac_c" 1>&6
+echo "configure:3695: checking --enable-gui argument" >&5
+# Check whether --enable-gui or --disable-gui was given.
+if test "${enable_gui+set}" = set; then
+ enableval="$enable_gui"
+ :
+else
+ enable_gui="auto"
+fi
+
+
+enable_gui_canon=`echo "_$enable_gui" | \
+ sed 's/[ _+-]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+
+SKIP_GTK=YES
+SKIP_GTK2=YES
+SKIP_GNOME=YES
+SKIP_MOTIF=YES
+SKIP_ATHENA=YES
+SKIP_NEXTAW=YES
+SKIP_PHOTON=YES
+SKIP_BEOS=YES
+SKIP_CARBON=YES
+GUITYPE=NONE
+
+if test "x$BEOS" = "xyes"; then
+ SKIP_BEOS=
+ case "$enable_gui_canon" in
+ no) echo "$ac_t""no GUI support" 1>&6
+ SKIP_BEOS=YES ;;
+ yes|"") echo "$ac_t""yes - automatic GUI support" 1>&6 ;;
+ auto) echo "$ac_t""auto - automatic GUI support" 1>&6 ;;
+ beos) echo "$ac_t""BeOS GUI support" 1>&6 ;;
+ *) echo "$ac_t""Sorry, $enable_gui GUI is not supported" 1>&6
+ SKIP_BEOS=YES ;;
+ esac
+
+elif test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
+ SKIP_PHOTON=
+ case "$enable_gui_canon" in
+ no) echo "$ac_t""no GUI support" 1>&6
+ SKIP_PHOTON=YES ;;
+ yes|"") echo "$ac_t""yes - automatic GUI support" 1>&6 ;;
+ auto) echo "$ac_t""auto - automatic GUI support" 1>&6 ;;
+ photon) echo "$ac_t""Photon GUI support" 1>&6 ;;
+ *) echo "$ac_t""Sorry, $enable_gui GUI is not supported" 1>&6
+ SKIP_PHOTON=YES ;;
+ esac
+
+elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
+ SKIP_CARBON=
+ case "$enable_gui_canon" in
+ no) echo "$ac_t""no GUI support" 1>&6
+ SKIP_CARBON=YES ;;
+ yes|"") echo "$ac_t""yes - automatic GUI support" 1>&6 ;;
+ auto) echo "$ac_t""auto - automatic GUI support" 1>&6 ;;
+ carbon) echo "$ac_t""Carbon GUI support" 1>&6 ;;
+ *) echo "$ac_t""Sorry, $enable_gui GUI is not supported" 1>&6
+ SKIP_CARBON=YES ;;
+ esac
+
+else
+
+
+ case "$enable_gui_canon" in
+ no|none) echo "$ac_t""no GUI support" 1>&6 ;;
+ yes|""|auto) echo "$ac_t""yes/auto - automatic GUI support" 1>&6
+ SKIP_GTK=
+ SKIP_GTK2=
+ SKIP_GNOME=
+ SKIP_MOTIF=
+ SKIP_ATHENA=
+ SKIP_NEXTAW=
+ SKIP_CARBON=;;
+ gtk) echo "$ac_t""GTK+ 1.x GUI support" 1>&6
+ SKIP_GTK=;;
+ gtk2) echo "$ac_t""GTK+ 2.x GUI support" 1>&6
+ SKIP_GTK=
+ SKIP_GTK2=;;
+ gnome) echo "$ac_t""GNOME 1.x GUI support" 1>&6
+ SKIP_GNOME=
+ SKIP_GTK=;;
+ gnome2) echo "$ac_t""GNOME 2.x GUI support" 1>&6
+ SKIP_GNOME=
+ SKIP_GTK=
+ SKIP_GTK2=;;
+ motif) echo "$ac_t""Motif GUI support" 1>&6
+ SKIP_MOTIF=;;
+ athena) echo "$ac_t""Athena GUI support" 1>&6
+ SKIP_ATHENA=;;
+ nextaw) echo "$ac_t""neXtaw GUI support" 1>&6
+ SKIP_NEXTAW=;;
+ *) echo "$ac_t""Sorry, $enable_gui GUI is not supported" 1>&6 ;;
+ esac
+
+fi
+
+if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
+ echo $ac_n "checking whether or not to look for GTK""... $ac_c" 1>&6
+echo "configure:3793: checking whether or not to look for GTK" >&5
+ # Check whether --enable-gtk-check or --disable-gtk-check was given.
+if test "${enable_gtk_check+set}" = set; then
+ enableval="$enable_gtk_check"
+ :
+else
+ enable_gtk_check="yes"
+fi
+
+ echo "$ac_t""$enable_gtk_check" 1>&6
+ if test "x$enable_gtk_check" = "xno"; then
+ SKIP_GTK=YES
+ SKIP_GNOME=YES
+ fi
+fi
+
+if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
+ -a "$enable_gui_canon" != "gnome2"; then
+ echo $ac_n "checking whether or not to look for GTK+ 2""... $ac_c" 1>&6
+echo "configure:3812: checking whether or not to look for GTK+ 2" >&5
+ # Check whether --enable-gtk2-check or --disable-gtk2-check was given.
+if test "${enable_gtk2_check+set}" = set; then
+ enableval="$enable_gtk2_check"
+ :
+else
+ enable_gtk2_check="yes"
+fi
+
+ echo "$ac_t""$enable_gtk2_check" 1>&6
+ if test "x$enable_gtk2_check" = "xno"; then
+ SKIP_GTK2=YES
+ fi
+fi
+
+if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome" \
+ -a "$enable_gui_canon" != "gnome2"; then
+ echo $ac_n "checking whether or not to look for GNOME""... $ac_c" 1>&6
+echo "configure:3830: checking whether or not to look for GNOME" >&5
+ # Check whether --enable-gnome-check or --disable-gnome-check was given.
+if test "${enable_gnome_check+set}" = set; then
+ enableval="$enable_gnome_check"
+ :
+else
+ enable_gnome_check="no"
+fi
+
+ echo "$ac_t""$enable_gnome_check" 1>&6
+ if test "x$enable_gnome_check" = "xno"; then
+ SKIP_GNOME=YES
+ fi
+fi
+
+if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
+ echo $ac_n "checking whether or not to look for Motif""... $ac_c" 1>&6
+echo "configure:3847: checking whether or not to look for Motif" >&5
+ # Check whether --enable-motif-check or --disable-motif-check was given.
+if test "${enable_motif_check+set}" = set; then
+ enableval="$enable_motif_check"
+ :
+else
+ enable_motif_check="yes"
+fi
+
+ echo "$ac_t""$enable_motif_check" 1>&6
+ if test "x$enable_motif_check" = "xno"; then
+ SKIP_MOTIF=YES
+ fi
+fi
+
+if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
+ echo $ac_n "checking whether or not to look for Athena""... $ac_c" 1>&6
+echo "configure:3864: checking whether or not to look for Athena" >&5
+ # Check whether --enable-athena-check or --disable-athena-check was given.
+if test "${enable_athena_check+set}" = set; then
+ enableval="$enable_athena_check"
+ :
+else
+ enable_athena_check="yes"
+fi
+
+ echo "$ac_t""$enable_athena_check" 1>&6
+ if test "x$enable_athena_check" = "xno"; then
+ SKIP_ATHENA=YES
+ fi
+fi
+
+if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
+ echo $ac_n "checking whether or not to look for neXtaw""... $ac_c" 1>&6
+echo "configure:3881: checking whether or not to look for neXtaw" >&5
+ # Check whether --enable-nextaw-check or --disable-nextaw-check was given.
+if test "${enable_nextaw_check+set}" = set; then
+ enableval="$enable_nextaw_check"
+ :
+else
+ enable_nextaw_check="yes"
+fi
+
+ echo "$ac_t""$enable_nextaw_check" 1>&6;
+ if test "x$enable_nextaw_check" = "xno"; then
+ SKIP_NEXTAW=YES
+ fi
+fi
+
+if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
+ echo $ac_n "checking whether or not to look for Carbon""... $ac_c" 1>&6
+echo "configure:3898: checking whether or not to look for Carbon" >&5
+ # Check whether --enable-carbon-check or --disable-carbon-check was given.
+if test "${enable_carbon_check+set}" = set; then
+ enableval="$enable_carbon_check"
+ :
+else
+ enable_carbon_check="yes"
+fi
+
+ echo "$ac_t""$enable_carbon_check" 1>&6;
+ if test "x$enable_carbon_check" = "xno"; then
+ SKIP_CARBON=YES
+ fi
+fi
+
+if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
+ echo $ac_n "checking for Carbon GUI""... $ac_c" 1>&6
+echo "configure:3915: checking for Carbon GUI" >&5
+ echo "$ac_t""yes" 1>&6;
+ GUITYPE=CARBONGUI
+ SKIP_GTK=YES;
+ SKIP_GTK2=YES;
+ SKIP_GNOME=YES;
+ SKIP_MOTIF=YES;
+ SKIP_ATHENA=YES;
+ SKIP_NEXTAW=YES;
+ SKIP_PHOTON=YES;
+ SKIP_BEOS=YES;
+ SKIP_CARBON=YES
+fi
+
+
+
+
+
+
+
+
+
+
+if test -z "$SKIP_GTK"; then
+
+ echo $ac_n "checking --with-gtk-prefix argument""... $ac_c" 1>&6
+echo "configure:3941: checking --with-gtk-prefix argument" >&5
+ # Check whether --with-gtk-prefix or --without-gtk-prefix was given.
+if test "${with_gtk_prefix+set}" = set; then
+ withval="$with_gtk_prefix"
+ gtk_config_prefix="$withval"; echo "$ac_t""$gtk_config_prefix" 1>&6
+else
+ gtk_config_prefix=""; echo "$ac_t""no" 1>&6
+fi
+
+
+ echo $ac_n "checking --with-gtk-exec-prefix argument""... $ac_c" 1>&6
+echo "configure:3952: checking --with-gtk-exec-prefix argument" >&5
+ # Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given.
+if test "${with_gtk_exec_prefix+set}" = set; then
+ withval="$with_gtk_exec_prefix"
+ gtk_config_exec_prefix="$withval"; echo "$ac_t""$gtk_config_prefix" 1>&6
+else
+ gtk_config_exec_prefix=""; echo "$ac_t""no" 1>&6
+fi
+
+
+ echo $ac_n "checking --disable-gtktest argument""... $ac_c" 1>&6
+echo "configure:3963: checking --disable-gtktest argument" >&5
+ # Check whether --enable-gtktest or --disable-gtktest was given.
+if test "${enable_gtktest+set}" = set; then
+ enableval="$enable_gtktest"
+ :
+else
+ enable_gtktest=yes
+fi
+
+ if test "x$enable_gtktest" = "xyes" ; then
+ echo "$ac_t""gtk test enabled" 1>&6
+ else
+ echo "$ac_t""gtk test disabled" 1>&6
+ fi
+
+ if test "x$gtk_config_prefix" != "x" ; then
+ gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+ GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+ fi
+ if test "x$gtk_config_exec_prefix" != "x" ; then
+ gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+ GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+ fi
+ if test "X$GTK_CONFIG" = "X"; then
+ # Extract the first word of "gtk-config", so it can be a program name with args.
+set dummy gtk-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3990: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GTK_CONFIG" in
+ /*)
+ ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GTK_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
+ ;;
+esac
+fi
+GTK_CONFIG="$ac_cv_path_GTK_CONFIG"
+if test -n "$GTK_CONFIG"; then
+ echo "$ac_t""$GTK_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "X$GTK_CONFIG" = "Xno"; then
+ # Extract the first word of "gtk12-config", so it can be a program name with args.
+set dummy gtk12-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4027: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GTK12_CONFIG" in
+ /*)
+ ac_cv_path_GTK12_CONFIG="$GTK12_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GTK12_CONFIG="$GTK12_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GTK12_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GTK12_CONFIG" && ac_cv_path_GTK12_CONFIG="no"
+ ;;
+esac
+fi
+GTK12_CONFIG="$ac_cv_path_GTK12_CONFIG"
+if test -n "$GTK12_CONFIG"; then
+ echo "$ac_t""$GTK12_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ GTK_CONFIG="$GTK12_CONFIG"
+ fi
+ else
+ echo "$ac_t""Using GTK configuration program $GTK_CONFIG" 1>&6
+ fi
+ if test "X$PKG_CONFIG" = "X"; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4069: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$PKG_CONFIG" in
+ /*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+if test -n "$PKG_CONFIG"; then
+ echo "$ac_t""$PKG_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
+ if test "X$SKIP_GTK2" != "XYES"; then
+
+ if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
+ {
+ min_gtk_version=2.2.0
+ echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
+echo "configure:4111: checking for GTK - version >= $min_gtk_version" >&5
+ no_gtk=""
+ if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
+ && $PKG_CONFIG --exists gtk+-2.0; then
+ {
+ GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
+ GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
+ gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+ gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+ gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+ }
+ elif test "X$GTK_CONFIG" != "Xno"; then
+ {
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+ gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+ gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+ gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+ }
+ else
+ no_gtk=yes
+ fi
+
+ if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
+ {
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+
+ rm -f conf.gtktest
+ if test "$cross_compiling" = yes; then
+ echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4152 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+int major, minor, micro;
+char *tmp_version;
+
+system ("touch conf.gtktest");
+
+/* HP/UX 9 (%@#!) writes to sscanf strings */
+tmp_version = g_strdup("$min_gtk_version");
+if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gtk_version");
+ exit(1);
+ }
+
+if ((gtk_major_version > major) ||
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) &&
+ (gtk_micro_version >= micro)))
+{
+ return 0;
+}
+return 1;
+}
+
+EOF
+if { (eval echo configure:4184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ no_gtk=yes
+fi
+rm -fr conftest*
+fi
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ }
+ fi
+ if test "x$no_gtk" = x ; then
+ if test "x$enable_gtktest" = "xyes"; then
+ echo "$ac_t""yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" 1>&6
+ else
+ echo "$ac_t""found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" 1>&6
+ fi
+ GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"
+ else
+ {
+ echo "$ac_t""no" 1>&6
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ :
+ }
+ fi
+ }
+ else
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ :
+ fi
+
+
+ rm -f conf.gtktest
+
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
+
+ fi
+ fi
+
+ if test "x$GUITYPE" != "xGTK"; then
+ SKIP_GTK2=YES
+
+ if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
+ {
+ min_gtk_version=1.1.16
+ echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
+echo "configure:4242: checking for GTK - version >= $min_gtk_version" >&5
+ no_gtk=""
+ if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
+ && $PKG_CONFIG --exists gtk+-2.0; then
+ {
+ GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
+ GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
+ gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+ gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+ gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+ }
+ elif test "X$GTK_CONFIG" != "Xno"; then
+ {
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+ gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+ gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+ gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+ }
+ else
+ no_gtk=yes
+ fi
+
+ if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
+ {
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+
+ rm -f conf.gtktest
+ if test "$cross_compiling" = yes; then
+ echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4283 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+int major, minor, micro;
+char *tmp_version;
+
+system ("touch conf.gtktest");
+
+/* HP/UX 9 (%@#!) writes to sscanf strings */
+tmp_version = g_strdup("$min_gtk_version");
+if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gtk_version");
+ exit(1);
+ }
+
+if ((gtk_major_version > major) ||
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) &&
+ (gtk_micro_version >= micro)))
+{
+ return 0;
+}
+return 1;
+}
+
+EOF
+if { (eval echo configure:4315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ no_gtk=yes
+fi
+rm -fr conftest*
+fi
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ }
+ fi
+ if test "x$no_gtk" = x ; then
+ if test "x$enable_gtktest" = "xyes"; then
+ echo "$ac_t""yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" 1>&6
+ else
+ echo "$ac_t""found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" 1>&6
+ fi
+ GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"
+ else
+ {
+ echo "$ac_t""no" 1>&6
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ :
+ }
+ fi
+ }
+ else
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ :
+ fi
+
+
+ rm -f conf.gtktest
+
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
+
+ fi
+ fi
+ fi
+ if test "x$GUITYPE" = "xGTK"; then
+ if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
+ -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
+ echo "$ac_t""this GTK version is old; version 1.2.3 or later is recommended" 1>&6
+ else
+ {
+ if test "0$gtk_major_version" -ge 2; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GTK2 1
+EOF
+
+ if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
+ || test "0$gtk_minor_version" -ge 2 \
+ || test "0$gtk_major_version" -gt 2; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GTK_MULTIHEAD 1
+EOF
+
+ fi
+ fi
+ if test -z "$SKIP_GNOME"; then
+ {
+
+
+
+
+
+ # Check whether --with-gnome-includes or --without-gnome-includes was given.
+if test "${with_gnome_includes+set}" = set; then
+ withval="$with_gnome_includes"
+ CFLAGS="$CFLAGS -I$withval"
+
+fi
+
+
+ # Check whether --with-gnome-libs or --without-gnome-libs was given.
+if test "${with_gnome_libs+set}" = set; then
+ withval="$with_gnome_libs"
+ LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval
+
+fi
+
+
+ # Check whether --with-gnome or --without-gnome was given.
+if test "${with_gnome+set}" = set; then
+ withval="$with_gnome"
+ if test x$withval = xyes; then
+ want_gnome=yes
+ have_gnome=yes
+ else
+ if test "x$withval" = xno; then
+ want_gnome=no
+ else
+ want_gnome=yes
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CFLAGS="$CFLAGS -I$withval/include"
+ gnome_prefix=$withval/lib
+ fi
+ fi
+else
+ want_gnome=yes
+fi
+
+
+ if test "x$want_gnome" = xyes -a "0$gtk_major_version" -ge 2; then
+ {
+ echo $ac_n "checking for libgnomeui-2.0""... $ac_c" 1>&6
+echo "configure:4433: checking for libgnomeui-2.0" >&5
+ if $PKG_CONFIG --exists libgnomeui-2.0; then
+ echo "$ac_t""yes" 1>&6
+ GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
+ GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
+ GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
+ have_gnome=yes
+ else
+ echo "$ac_t""not found" 1>&6
+ if test "x" = xfail; then
+ { echo "configure: error: Could not find libgnomeui-2.0 via pkg-config" 1>&2; exit 1; }
+ fi
+ fi
+ }
+ elif test "x$want_gnome" = xyes; then
+ {
+ # Extract the first word of "gnome-config", so it can be a program name with args.
+set dummy gnome-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4452: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GNOME_CONFIG" in
+ /*)
+ ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GNOME_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GNOME_CONFIG" && ac_cv_path_GNOME_CONFIG="no"
+ ;;
+esac
+fi
+GNOME_CONFIG="$ac_cv_path_GNOME_CONFIG"
+if test -n "$GNOME_CONFIG"; then
+ echo "$ac_t""$GNOME_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$GNOME_CONFIG" = "no"; then
+ no_gnome_config="yes"
+ else
+ echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6
+echo "configure:4489: checking if $GNOME_CONFIG works" >&5
+ if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
+ echo "$ac_t""yes" 1>&6
+ GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
+ GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
+ GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
+ have_gnome=yes
+ else
+ echo "$ac_t""no" 1>&6
+ no_gnome_config="yes"
+ fi
+ fi
+
+ if test x$exec_prefix = xNONE; then
+ if test x$prefix = xNONE; then
+ gnome_prefix=$ac_default_prefix/lib
+ else
+ gnome_prefix=$prefix/lib
+ fi
+ else
+ gnome_prefix=`eval echo \`echo $libdir\``
+ fi
+
+ if test "$no_gnome_config" = "yes"; then
+ echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6
+echo "configure:4514: checking for gnomeConf.sh file in $gnome_prefix" >&5
+ if test -f $gnome_prefix/gnomeConf.sh; then
+ echo "$ac_t""found" 1>&6
+ echo "loading gnome configuration from" \
+ "$gnome_prefix/gnomeConf.sh"
+ . $gnome_prefix/gnomeConf.sh
+ have_gnome=yes
+ else
+ echo "$ac_t""not found" 1>&6
+ if test x = xfail; then
+ { echo "configure: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install" 1>&2; exit 1; }
+ fi
+ fi
+ fi
+ }
+ fi
+
+ if test x$have_gnome = xyes ; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_GUI_GNOME 1
+EOF
+
+ GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
+ GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
+ fi
+ }
+ fi
+ }
+ fi
+ fi
+fi
+
+
+if test -z "$SKIP_MOTIF"; then
+ gui_XXX="/usr/XXX/Motif* /usr/Motif*/XXX /usr/XXX /usr/shlib /usr/X11*/XXX /usr/XXX/X11* /usr/dt/XXX /local/Motif*/XXX /local/XXX/Motif* /usr/local/Motif*/XXX /usr/local/XXX/Motif* /usr/local/XXX /usr/local/X11*/XXX /usr/local/LessTif/Motif*/XXX $MOTIFHOME/XXX"
+ GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
+
+ echo $ac_n "checking for location of Motif GUI includes""... $ac_c" 1>&6
+echo "configure:4552: checking for location of Motif GUI includes" >&5
+ gui_includes="`echo $x_includes|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
+ GUI_INC_LOC=
+ for try in $gui_includes; do
+ if test -f "$try/Xm/Xm.h"; then
+ GUI_INC_LOC=$try
+ fi
+ done
+ if test -n "$GUI_INC_LOC"; then
+ if test "$GUI_INC_LOC" = /usr/include; then
+ GUI_INC_LOC=
+ echo "$ac_t""in default path" 1>&6
+ else
+ echo "$ac_t""$GUI_INC_LOC" 1>&6
+ fi
+ else
+ echo "$ac_t""<not found>" 1>&6
+ SKIP_MOTIF=YES
+ fi
+fi
+
+
+if test -z "$SKIP_MOTIF"; then
+ echo $ac_n "checking --with-motif-lib argument""... $ac_c" 1>&6
+echo "configure:4576: checking --with-motif-lib argument" >&5
+ # Check whether --with-motif-lib or --without-motif-lib was given.
+if test "${with_motif_lib+set}" = set; then
+ withval="$with_motif_lib"
+ MOTIF_LIBNAME="${withval}"
+fi
+
+
+ if test -n "$MOTIF_LIBNAME"; then
+ echo "$ac_t""$MOTIF_LIBNAME" 1>&6
+ GUI_LIB_LOC=
+ else
+ echo "$ac_t""no" 1>&6
+
+ GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
+
+ echo $ac_n "checking for location of Motif GUI libs""... $ac_c" 1>&6
+echo "configure:4593: checking for location of Motif GUI libs" >&5
+ gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC"
+ GUI_LIB_LOC=
+ for try in $gui_libs; do
+ for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl; do
+ if test -f "$libtry"; then
+ GUI_LIB_LOC=$try
+ fi
+ done
+ done
+ if test -n "$GUI_LIB_LOC"; then
+ if test "$GUI_LIB_LOC" = /usr/lib; then
+ GUI_LIB_LOC=
+ echo "$ac_t""in default path" 1>&6
+ else
+ if test -n "$GUI_LIB_LOC"; then
+ echo "$ac_t""$GUI_LIB_LOC" 1>&6
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
+ fi
+ fi
+ fi
+ MOTIF_LIBNAME=-lXm
+ else
+ echo "$ac_t""<not found>" 1>&6
+ SKIP_MOTIF=YES
+ fi
+ fi
+fi
+
+if test -z "$SKIP_MOTIF"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ GUITYPE=MOTIF
+
+fi
+
+
+GUI_X_LIBS=
+
+if test -z "$SKIP_ATHENA"; then
+ echo $ac_n "checking if Athena header files can be found""... $ac_c" 1>&6
+echo "configure:4636: checking if Athena header files can be found" >&5
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 4640 "configure"
+#include "confdefs.h"
+
+#include <X11/Intrinsic.h>
+#include <X11/Xaw/Paned.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6; SKIP_ATHENA=YES
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+fi
+
+if test -z "$SKIP_ATHENA"; then
+ GUITYPE=ATHENA
+fi
+
+if test -z "$SKIP_NEXTAW"; then
+ echo $ac_n "checking if neXtaw header files can be found""... $ac_c" 1>&6
+echo "configure:4668: checking if neXtaw header files can be found" >&5
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+#line 4672 "configure"
+#include "confdefs.h"
+
+#include <X11/Intrinsic.h>
+#include <X11/neXtaw/Paned.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:4681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6; SKIP_NEXTAW=YES
+fi
+rm -f conftest*
+ CFLAGS=$cflags_save
+fi
+
+if test -z "$SKIP_NEXTAW"; then
+ GUITYPE=NEXTAW
+fi
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
+ if test -n "$GUI_INC_LOC"; then
+ GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
+ fi
+ if test -n "$GUI_LIB_LOC"; then
+ GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
+ fi
+
+ ldflags_save=$LDFLAGS
+ LDFLAGS="$X_LIBS $LDFLAGS"
+ echo $ac_n "checking for XShapeQueryExtension in -lXext""... $ac_c" 1>&6
+echo "configure:4709: checking for XShapeQueryExtension in -lXext" >&5
+ac_lib_var=`echo Xext'_'XShapeQueryExtension | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXext -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4717 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XShapeQueryExtension();
+
+int main() {
+XShapeQueryExtension()
+; return 0; }
+EOF
+if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ GUI_X_LIBS="-lXext"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for wslen in -lw""... $ac_c" 1>&6
+echo "configure:4749: checking for wslen in -lw" >&5
+ac_lib_var=`echo w'_'wslen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lw $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4757 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char wslen();
+
+int main() {
+wslen()
+; return 0; }
+EOF
+if { (eval echo configure:4768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6
+echo "configure:4789: checking for dlsym in -ldl" >&5
+ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4797 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlsym();
+
+int main() {
+dlsym()
+; return 0; }
+EOF
+if { (eval echo configure:4808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for XmuCreateStippledPixmap in -lXmu""... $ac_c" 1>&6
+echo "configure:4829: checking for XmuCreateStippledPixmap in -lXmu" >&5
+ac_lib_var=`echo Xmu'_'XmuCreateStippledPixmap | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXmu $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4837 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XmuCreateStippledPixmap();
+
+int main() {
+XmuCreateStippledPixmap()
+; return 0; }
+EOF
+if { (eval echo configure:4848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ GUI_X_LIBS="-lXmu $GUI_X_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$SKIP_MOTIF"; then
+ echo $ac_n "checking for XpEndJob in -lXp""... $ac_c" 1>&6
+echo "configure:4870: checking for XpEndJob in -lXp" >&5
+ac_lib_var=`echo Xp'_'XpEndJob | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXp $GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4878 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XpEndJob();
+
+int main() {
+XpEndJob()
+; return 0; }
+EOF
+if { (eval echo configure:4889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ GUI_X_LIBS="-lXp $GUI_X_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ LDFLAGS=$ldflags_save
+
+ echo $ac_n "checking for extra X11 defines""... $ac_c" 1>&6
+echo "configure:4913: checking for extra X11 defines" >&5
+ NARROW_PROTO=
+ rm -fr conftestdir
+ if mkdir conftestdir; then
+ cd conftestdir
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ fi
+ cd ..
+ rm -fr conftestdir
+ fi
+ if test -z "$NARROW_PROTO"; then
+ echo "$ac_t""no" 1>&6
+ else
+ echo "$ac_t""$NARROW_PROTO" 1>&6
+ fi
+
+fi
+
+if test "$enable_xsmp" = "yes"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ for ac_hdr in X11/SM/SMlib.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4943: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4948 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ CPPFLAGS=$cppflags_save
+fi
+
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ for ac_hdr in X11/xpm.h X11/Sunkeysym.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4990: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4995 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+ if test ! "$enable_xim" = "no"; then
+ echo $ac_n "checking for XIMText in X11/Xlib.h""... $ac_c" 1>&6
+echo "configure:5029: checking for XIMText in X11/Xlib.h" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 5031 "configure"
+#include "confdefs.h"
+#include <X11/Xlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "XIMText" >/dev/null 2>&1; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ rm -rf conftest*
+ echo "$ac_t""no; xim has been disabled" 1>&6; enable_xim = "no"
+fi
+rm -f conftest*
+
+ fi
+ CPPFLAGS=$cppflags_save
+
+ if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
+ -a "x$GUITYPE" != "xNONE" ; then
+ echo "$ac_t""X GUI selected; xim has been enabled" 1>&6
+ enable_xim="yes"
+ fi
+fi
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ for ac_hdr in X11/Xmu/Editres.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5062: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5067 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ CPPFLAGS=$cppflags_save
+fi
+
+if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ for ac_hdr in Xm/Xm.h Xm/XpmP.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5108: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5113 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ CPPFLAGS=$cppflags_save
+fi
+
+if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
+ echo "$ac_t""no GUI selected; xim has been disabled" 1>&6
+ enable_xim="no"
+fi
+if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
+ echo "$ac_t""no GUI selected; fontset has been disabled" 1>&6
+ enable_fontset="no"
+fi
+if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
+ echo "$ac_t""GTK+ 2 GUI selected; fontset has been disabled" 1>&6
+ enable_fontset="no"
+fi
+
+if test -z "$SKIP_BEOS"; then
+ GUITYPE=BEOSGUI
+fi
+
+if test -z "$SKIP_PHOTON"; then
+ GUITYPE=PHOTONGUI
+fi
+
+
+
+
+
+
+if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
+ { echo "configure: error: cannot use workshop without Motif" 1>&2; exit 1; }
+fi
+
+if test "$enable_xim" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_XIM 1
+EOF
+
+fi
+if test "$enable_fontset" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define FEAT_XFONTSET 1
+EOF
+
+fi
+
+
+
+
+if test "$enable_hangulinput" = "yes"; then
+ if test "x$GUITYPE" = "xNONE"; then
+ echo "$ac_t""no GUI selected; hangul input has been disabled" 1>&6
+ enable_hangulinput=no
+ else
+ cat >> confdefs.h <<\EOF
+#define FEAT_HANGULIN 1
+EOF
+
+ HANGULIN_SRC=hangulin.c
+
+ HANGULIN_OBJ=objects/hangulin.o
+
+ fi
+fi
+
+
+echo $ac_n "checking quality of toupper""... $ac_c" 1>&6
+echo "configure:5211: checking quality of toupper" >&5
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5216 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }
+EOF
+if { (eval echo configure:5221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ cat >> confdefs.h <<\EOF
+#define BROKEN_TOUPPER 1
+EOF
+ echo "$ac_t""bad" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""good" 1>&6
+fi
+rm -fr conftest*
+fi
+
+
+echo $ac_n "checking whether __DATE__ and __TIME__ work""... $ac_c" 1>&6
+echo "configure:5238: checking whether __DATE__ and __TIME__ work" >&5
+cat > conftest.$ac_ext <<EOF
+#line 5240 "configure"
+#include "confdefs.h"
+
+int main() {
+printf("(" __DATE__ " " __TIME__ ")");
+; return 0; }
+EOF
+if { (eval echo configure:5247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_DATE_TIME 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+ac_safe=`echo "elf.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for elf.h""... $ac_c" 1>&6
+echo "configure:5263: checking for elf.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5268 "configure"
+#include "confdefs.h"
+#include <elf.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ HAS_ELF=1
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test "$HAS_ELF" = 1; then
+ echo $ac_n "checking for main in -lelf""... $ac_c" 1>&6
+echo "configure:5296: checking for main in -lelf" >&5
+ac_lib_var=`echo elf'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lelf $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5304 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:5311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo elf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lelf $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
+echo "configure:5345: checking for $ac_hdr that defines DIR" >&5
+if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5350 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+int main() {
+DIR *dirp = 0;
+; return 0; }
+EOF
+if { (eval echo configure:5358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_dirent_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ ac_header_dirent=$ac_hdr; break
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
+echo "configure:5383: checking for opendir in -ldir" >&5
+ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldir $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5391 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -ldir"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
+echo "configure:5424: checking for opendir in -lx" >&5
+ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lx $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 5432 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir();
+
+int main() {
+opendir()
+; return 0; }
+EOF
+if { (eval echo configure:5443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lx"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:5467: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5472 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 5497 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 5515 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5536 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:5547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:5571: checking for sys/wait.h that is POSIX.1 compatible" >&5
+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5576 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+int main() {
+int s;
+wait (&s);
+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+; return 0; }
+EOF
+if { (eval echo configure:5592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_sys_wait_h=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_sys_wait_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
+if test $ac_cv_header_sys_wait_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
+EOF
+
+fi
+
+
+if test $ac_cv_header_sys_wait_h = no; then
+ echo $ac_n "checking for sys/wait.h that defines union wait""... $ac_c" 1>&6
+echo "configure:5615: checking for sys/wait.h that defines union wait" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 5617 "configure"
+#include "confdefs.h"
+#include <sys/wait.h>
+int main() {
+union wait xx, yy; xx = yy
+; return 0; }
+EOF
+if { (eval echo configure:5624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_SYS_WAIT_H 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define HAVE_UNION_WAIT 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+fi
+
+for ac_hdr in stdarg.h stdlib.h string.h sys/select.h sys/utsname.h \
+ termcap.h fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h \
+ iconv.h langinfo.h unistd.h stropts.h errno.h \
+ sys/resource.h sys/systeminfo.h locale.h \
+ sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
+ poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
+ libgen.h util/debug.h util/msg18n.h frame.h pthread_np.h \
+ sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5655: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5660 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+if test "x$MACOSX" != "xyes"; then
+ for ac_hdr in strings.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:5697: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5702 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:5707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+fi
+
+echo $ac_n "checking if strings.h can be included after string.h""... $ac_c" 1>&6
+echo "configure:5736: checking if strings.h can be included after string.h" >&5
+cppflags_save=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+cat > conftest.$ac_ext <<EOF
+#line 5740 "configure"
+#include "confdefs.h"
+
+#if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
+# define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
+ /* but don't do it on AIX 5.1 (Uribarri) */
+#endif
+#ifdef HAVE_XM_XM_H
+# include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H)
+# include <strings.h>
+#endif
+
+int main() {
+int i; i = 0;
+; return 0; }
+EOF
+if { (eval echo configure:5761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
+#define NO_STRINGS_WITH_STRING_H 1
+EOF
+
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+CPPFLAGS=$cppflags_save
+
+if test $ac_cv_prog_gcc = yes; then
+ echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+echo "configure:5779: checking whether ${CC-cc} needs -traditional" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat > conftest.$ac_ext <<EOF
+#line 5785 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+Autoconf TIOCGETP
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+else
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat > conftest.$ac_ext <<EOF
+#line 5803 "configure"
+#include "confdefs.h"
+#include <termio.h>
+Autoconf TCGETA
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:5825: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5830 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:5879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for mode_t""... $ac_c" 1>&6
+echo "configure:5900: checking for mode_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5905 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_mode_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_mode_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_mode_t" 1>&6
+if test $ac_cv_type_mode_t = no; then
+ cat >> confdefs.h <<\EOF
+#define mode_t int
+EOF
+
+fi
+
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:5933: checking for off_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5938 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:5966: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 5971 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_pid_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_pid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define pid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:5999: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6004 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:6032: checking for uid_t in sys/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6037 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "uid_t" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_uid_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_uid_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_type_uid_t" 1>&6
+if test $ac_cv_type_uid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define uid_t int
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define gid_t int
+EOF
+
+fi
+
+echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:6066: checking whether time.h and sys/time.h may both be included" >&5
+if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6071 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int main() {
+struct tm *tp;
+; return 0; }
+EOF
+if { (eval echo configure:6080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_header_time=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_time=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_time" 1>&6
+if test $ac_cv_header_time = yes; then
+ cat >> confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+echo $ac_n "checking for ino_t""... $ac_c" 1>&6
+echo "configure:6101: checking for ino_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6106 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_ino_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_ino_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_ino_t" 1>&6
+if test $ac_cv_type_ino_t = no; then
+ cat >> confdefs.h <<\EOF
+#define ino_t long
+EOF
+
+fi
+
+echo $ac_n "checking for dev_t""... $ac_c" 1>&6
+echo "configure:6134: checking for dev_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6139 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])dev_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_dev_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_dev_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_dev_t" 1>&6
+if test $ac_cv_type_dev_t = no; then
+ cat >> confdefs.h <<\EOF
+#define dev_t unsigned
+EOF
+
+fi
+
+
+echo $ac_n "checking for rlim_t""... $ac_c" 1>&6
+echo "configure:6168: checking for rlim_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
+ echo "$ac_t""(cached) $ac_cv_type_rlim_t" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6173 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_rlim_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_rlim_t=no
+fi
+rm -f conftest*
+
+ echo "$ac_t""$ac_cv_type_rlim_t" 1>&6
+fi
+if test $ac_cv_type_rlim_t = no; then
+ cat >> confdefs.h <<\EOF
+#define rlim_t unsigned long
+EOF
+fi
+
+echo $ac_n "checking for stack_t""... $ac_c" 1>&6
+echo "configure:6205: checking for stack_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
+ echo "$ac_t""(cached) $ac_cv_type_stack_t" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6210 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "stack_t" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_stack_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_stack_t=no
+fi
+rm -f conftest*
+
+ echo "$ac_t""$ac_cv_type_stack_t" 1>&6
+fi
+if test $ac_cv_type_stack_t = no; then
+ cat >> confdefs.h <<\EOF
+#define stack_t struct sigaltstack
+EOF
+fi
+
+echo $ac_n "checking whether stack_t has an ss_base field""... $ac_c" 1>&6
+echo "configure:6240: checking whether stack_t has an ss_base field" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6242 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>
+#include "confdefs.h"
+
+int main() {
+stack_t sigstk; sigstk.ss_base = 0;
+; return 0; }
+EOF
+if { (eval echo configure:6257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SS_BASE 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+olibs="$LIBS"
+echo $ac_n "checking --with-tlib argument""... $ac_c" 1>&6
+echo "configure:6273: checking --with-tlib argument" >&5
+# Check whether --with-tlib or --without-tlib was given.
+if test "${with_tlib+set}" = set; then
+ withval="$with_tlib"
+ :
+fi
+
+if test -n "$with_tlib"; then
+ echo "$ac_t""$with_tlib" 1>&6
+ LIBS="$LIBS -l$with_tlib"
+else
+ echo "$ac_t""automatic terminal library selection" 1>&6
+ case "`uname -s 2>/dev/null`" in
+ OSF1) tlibs="ncurses curses termlib termcap";;
+ *) tlibs="ncurses termlib termcap curses";;
+ esac
+ for libname in $tlibs; do
+ echo $ac_n "checking for tgetent in -l${libname}""... $ac_c" 1>&6
+echo "configure:6291: checking for tgetent in -l${libname}" >&5
+ac_lib_var=`echo ${libname}'_'tgetent | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-l${libname} $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 6299 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgetent();
+
+int main() {
+tgetent()
+; return 0; }
+EOF
+if { (eval echo configure:6310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo ${libname} | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-l${libname} $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "x$olibs" != "x$LIBS"; then
+ if test "$cross_compiling" = yes; then
+ res="FAIL"
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6342 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }
+EOF
+if { (eval echo configure:6350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ res="OK"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ res="FAIL"
+fi
+rm -fr conftest*
+fi
+
+ if test "$res" = "OK"; then
+ break
+ fi
+ echo "$ac_t""$libname library is not usable" 1>&6
+ LIBS="$olibs"
+ fi
+ done
+fi
+if test "x$olibs" != "x$LIBS"; then
+ echo $ac_n "checking whether we talk terminfo""... $ac_c" 1>&6
+echo "configure:6372: checking whether we talk terminfo" >&5
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program." 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6377 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main()
+{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }
+EOF
+if { (eval echo configure:6386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ echo "$ac_t""no -- we are in termcap land" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""yes -- terminfo spoken here" 1>&6; cat >> confdefs.h <<\EOF
+#define TERMINFO 1
+EOF
+
+fi
+rm -fr conftest*
+fi
+
+else
+ echo "$ac_t""none found" 1>&6
+fi
+
+if test "x$olibs" != "x$LIBS"; then
+ echo $ac_n "checking what tgetent() returns for an unknown terminal""... $ac_c" 1>&6
+echo "configure:6407: checking what tgetent() returns for an unknown terminal" >&5
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program." 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6412 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main()
+{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
+EOF
+if { (eval echo configure:6421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ echo "$ac_t""zero" 1>&6; cat >> confdefs.h <<\EOF
+#define TGETENT_ZERO_ERR 0
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""non-zero" 1>&6
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo $ac_n "checking whether termcap.h contains ospeed""... $ac_c" 1>&6
+echo "configure:6439: checking whether termcap.h contains ospeed" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6441 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+
+int main() {
+ospeed = 20000
+; return 0; }
+EOF
+if { (eval echo configure:6452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_OSPEED 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking whether ospeed can be extern""... $ac_c" 1>&6
+echo "configure:6464: checking whether ospeed can be extern" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 6466 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+extern short ospeed;
+
+int main() {
+ospeed = 20000
+; return 0; }
+EOF
+if { (eval echo configure:6478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define OSPEED_EXTERN 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+echo $ac_n "checking whether termcap.h contains UP, BC and PC""... $ac_c" 1>&6
+echo "configure:6496: checking whether termcap.h contains UP, BC and PC" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6498 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+
+int main() {
+if (UP == 0 && BC == 0) PC = 1
+; return 0; }
+EOF
+if { (eval echo configure:6509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_UP_BC_PC 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking whether UP, BC and PC can be extern""... $ac_c" 1>&6
+echo "configure:6521: checking whether UP, BC and PC can be extern" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 6523 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+extern char *UP, *BC, PC;
+
+int main() {
+if (UP == 0 && BC == 0) PC = 1
+; return 0; }
+EOF
+if { (eval echo configure:6535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define UP_BC_PC_EXTERN 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+echo $ac_n "checking whether tputs() uses outfuntype""... $ac_c" 1>&6
+echo "configure:6553: checking whether tputs() uses outfuntype" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6555 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+
+int main() {
+extern int xx(); tputs("test", 1, (outfuntype)xx)
+; return 0; }
+EOF
+if { (eval echo configure:6566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_OUTFUNTYPE 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking whether sys/select.h and sys/time.h may both be included""... $ac_c" 1>&6
+echo "configure:6581: checking whether sys/select.h and sys/time.h may both be included" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6583 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/select.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define SYS_SELECT_WITH_SYS_TIME 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+echo $ac_n "checking for /dev/ptc""... $ac_c" 1>&6
+echo "configure:6610: checking for /dev/ptc" >&5
+if test -r /dev/ptc; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DEV_PTC 1
+EOF
+
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for SVR4 ptys""... $ac_c" 1>&6
+echo "configure:6622: checking for SVR4 ptys" >&5
+if test -c /dev/ptmx ; then
+ cat > conftest.$ac_ext <<EOF
+#line 6625 "configure"
+#include "confdefs.h"
+
+int main() {
+ptsname(0);grantpt(0);unlockpt(0);
+; return 0; }
+EOF
+if { (eval echo configure:6632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SVR4_PTYS 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for ptyranges""... $ac_c" 1>&6
+echo "configure:6650: checking for ptyranges" >&5
+if test -d /dev/ptym ; then
+ pdir='/dev/ptym'
+else
+ pdir='/dev'
+fi
+cat > conftest.$ac_ext <<EOF
+#line 6657 "configure"
+#include "confdefs.h"
+#ifdef M_UNIX
+ yes;
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ptys=`echo /dev/ptyp??`
+else
+ rm -rf conftest*
+ ptys=`echo $pdir/pty??`
+fi
+rm -f conftest*
+
+if test "$ptys" != "$pdir/pty??" ; then
+ p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
+ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
+ cat >> confdefs.h <<EOF
+#define PTYRANGE0 "$p0"
+EOF
+
+ cat >> confdefs.h <<EOF
+#define PTYRANGE1 "$p1"
+EOF
+
+ echo "$ac_t""$p0 / $p1" 1>&6
+else
+ echo "$ac_t""don't know" 1>&6
+fi
+
+echo $ac_n "checking default tty permissions/group""... $ac_c" 1>&6
+echo "configure:6691: checking default tty permissions/group" >&5
+rm -f conftest_grp
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6697 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+main()
+{
+ struct stat sb;
+ char *x,*ttyname();
+ int om, m;
+ FILE *fp;
+
+ if (!(x = ttyname(0))) exit(1);
+ if (stat(x, &sb)) exit(1);
+ om = sb.st_mode;
+ if (om & 002) exit(0);
+ m = system("mesg y");
+ if (m == -1 || m == 127) exit(1);
+ if (stat(x, &sb)) exit(1);
+ m = sb.st_mode;
+ if (chmod(x, om)) exit(1);
+ if (m & 002) exit(0);
+ if (sb.st_gid == getgid()) exit(1);
+ if (!(fp=fopen("conftest_grp", "w")))
+ exit(1);
+ fprintf(fp, "%d\n", sb.st_gid);
+ fclose(fp);
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:6729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+
+ if test -f conftest_grp; then
+ ptygrp=`cat conftest_grp`
+ echo "$ac_t""pty mode: 0620, group: $ptygrp" 1>&6
+ cat >> confdefs.h <<\EOF
+#define PTYMODE 0620
+EOF
+
+ cat >> confdefs.h <<EOF
+#define PTYGROUP $ptygrp
+EOF
+
+ else
+ echo "$ac_t""ptys are world accessable" 1>&6
+ fi
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""can't determine - assume ptys are world accessable" 1>&6
+fi
+rm -fr conftest*
+fi
+
+rm -f conftest_grp
+
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:6760: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6765 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:6782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+
+if test $ac_cv_type_signal = void; then
+ cat >> confdefs.h <<\EOF
+#define SIGRETURN return
+EOF
+
+else
+ cat >> confdefs.h <<\EOF
+#define SIGRETURN return 0
+EOF
+
+fi
+
+echo $ac_n "checking for struct sigcontext""... $ac_c" 1>&6
+echo "configure:6814: checking for struct sigcontext" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6816 "configure"
+#include "confdefs.h"
+
+#include <signal.h>
+test_sig()
+{
+ struct sigcontext *scont;
+ scont = (struct sigcontext *)0;
+ return 1;
+}
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:6830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_SIGCONTEXT 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking getcwd implementation""... $ac_c" 1>&6
+echo "configure:6846: checking getcwd implementation" >&5
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6851 "configure"
+#include "confdefs.h"
+
+char *dagger[] = { "IFS=pwd", 0 };
+main()
+{
+ char buffer[500];
+ extern char **environ;
+ environ = dagger;
+ return getcwd(buffer, 500) ? 0 : 1;
+}
+EOF
+if { (eval echo configure:6863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ echo "$ac_t""it is usable" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""it stinks" 1>&6
+ cat >> confdefs.h <<\EOF
+#define BAD_GETCWD 1
+EOF
+
+fi
+rm -fr conftest*
+fi
+
+
+for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+ memset nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec snprintf strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper usleep utime utimes
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:6888: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6893 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:6916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for st_blksize""... $ac_c" 1>&6
+echo "configure:6942: checking for st_blksize" >&5
+cat > conftest.$ac_ext <<EOF
+#line 6944 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+int main() {
+ struct stat st;
+ int n;
+
+ stat("/", &st);
+ n = (int)st.st_blksize;
+; return 0; }
+EOF
+if { (eval echo configure:6956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_ST_BLKSIZE 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking whether stat() ignores a trailing slash""... $ac_c" 1>&6
+echo "configure:6971: checking whether stat() ignores a trailing slash" >&5
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 6976 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+main() {struct stat st; exit(stat("configure/", &st) != 0); }
+EOF
+if { (eval echo configure:6982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define STAT_IGNORES_SLASH 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -fr conftest*
+fi
+
+
+echo $ac_n "checking for iconv_open()""... $ac_c" 1>&6
+echo "configure:6999: checking for iconv_open()" >&5
+save_LIBS="$LIBS"
+LIBS="$LIBS -liconv"
+cat > conftest.$ac_ext <<EOF
+#line 7003 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_ICONV_H
+# include <iconv.h>
+#endif
+
+int main() {
+iconv_open("fr", "to");
+; return 0; }
+EOF
+if { (eval echo configure:7014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes; with -liconv" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_ICONV 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ LIBS="$save_LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 7026 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_ICONV_H
+# include <iconv.h>
+#endif
+
+int main() {
+iconv_open("fr", "to");
+; return 0; }
+EOF
+if { (eval echo configure:7037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_ICONV 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+
+
+echo $ac_n "checking for nl_langinfo(CODESET)""... $ac_c" 1>&6
+echo "configure:7055: checking for nl_langinfo(CODESET)" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7057 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+
+int main() {
+char *cs = nl_langinfo(CODESET);
+; return 0; }
+EOF
+if { (eval echo configure:7068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_NL_LANGINFO_CODESET 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking --disable-acl argument""... $ac_c" 1>&6
+echo "configure:7083: checking --disable-acl argument" >&5
+# Check whether --enable-acl or --disable-acl was given.
+if test "${enable_acl+set}" = set; then
+ enableval="$enable_acl"
+ :
+else
+ enable_acl="yes"
+fi
+
+if test "$enable_acl" = "yes"; then
+echo "$ac_t""no" 1>&6
+echo $ac_n "checking for acl_get_file in -lposix1e""... $ac_c" 1>&6
+echo "configure:7095: checking for acl_get_file in -lposix1e" >&5
+ac_lib_var=`echo posix1e'_'acl_get_file | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lposix1e $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7103 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char acl_get_file();
+
+int main() {
+acl_get_file()
+; return 0; }
+EOF
+if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lposix1e"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for acl_get_file in -lacl""... $ac_c" 1>&6
+echo "configure:7133: checking for acl_get_file in -lacl" >&5
+ac_lib_var=`echo acl'_'acl_get_file | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lacl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7141 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char acl_get_file();
+
+int main() {
+acl_get_file()
+; return 0; }
+EOF
+if { (eval echo configure:7152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lacl"
+ echo $ac_n "checking for fgetxattr in -lattr""... $ac_c" 1>&6
+echo "configure:7169: checking for fgetxattr in -lattr" >&5
+ac_lib_var=`echo attr'_'fgetxattr | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lattr $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7177 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char fgetxattr();
+
+int main() {
+fgetxattr()
+; return 0; }
+EOF
+if { (eval echo configure:7188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lattr"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+echo $ac_n "checking for POSIX ACL support""... $ac_c" 1>&6
+echo "configure:7216: checking for POSIX ACL support" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7218 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+acl_t acl;
+int main() {
+acl = acl_get_file("foo", ACL_TYPE_ACCESS);
+ acl_set_file("foo", ACL_TYPE_ACCESS, acl);
+ acl_free(acl);
+; return 0; }
+EOF
+if { (eval echo configure:7232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_POSIX_ACL 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for Solaris ACL support""... $ac_c" 1>&6
+echo "configure:7247: checking for Solaris ACL support" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7249 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+int main() {
+acl("foo", GETACLCNT, 0, NULL);
+
+; return 0; }
+EOF
+if { (eval echo configure:7260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SOLARIS_ACL 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for AIX ACL support""... $ac_c" 1>&6
+echo "configure:7275: checking for AIX ACL support" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7277 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_ACCESS_H
+# include <sys/access.h>
+#endif
+#define _ALL_SOURCE
+
+#include <sys/stat.h>
+
+int aclsize;
+struct acl *aclent;
+int main() {
+aclsize = sizeof(struct acl);
+ aclent = (void *)malloc(aclsize);
+ statacl("foo", STX_NORMAL, aclent, aclsize);
+
+; return 0; }
+EOF
+if { (eval echo configure:7299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_AIX_ACL 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+else
+ echo "$ac_t""yes" 1>&6
+fi
+
+echo $ac_n "checking --disable-gpm argument""... $ac_c" 1>&6
+echo "configure:7317: checking --disable-gpm argument" >&5
+# Check whether --enable-gpm or --disable-gpm was given.
+if test "${enable_gpm+set}" = set; then
+ enableval="$enable_gpm"
+ :
+else
+ enable_gpm="yes"
+fi
+
+
+if test "$enable_gpm" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking for gpm""... $ac_c" 1>&6
+echo "configure:7330: checking for gpm" >&5
+if eval "test \"`echo '$''{'vi_cv_have_gpm'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ olibs="$LIBS" ; LIBS="-lgpm"
+ cat > conftest.$ac_ext <<EOF
+#line 7336 "configure"
+#include "confdefs.h"
+#include <gpm.h>
+ #include <linux/keyboard.h>
+int main() {
+Gpm_GetLibVersion(NULL);
+; return 0; }
+EOF
+if { (eval echo configure:7344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ vi_cv_have_gpm=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ vi_cv_have_gpm=no
+fi
+rm -f conftest*
+ LIBS="$olibs"
+
+fi
+
+echo "$ac_t""$vi_cv_have_gpm" 1>&6
+ if test $vi_cv_have_gpm = yes; then
+ LIBS="$LIBS -lgpm"
+ cat >> confdefs.h <<\EOF
+#define HAVE_GPM 1
+EOF
+
+ fi
+else
+ echo "$ac_t""yes" 1>&6
+fi
+
+echo $ac_n "checking for vsnprintf()""... $ac_c" 1>&6
+echo "configure:7371: checking for vsnprintf()" >&5
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7376 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+ /* Check use of vsnprintf() */
+ void warn(char *fmt, ...);
+ void warn(char *fmt, ...)
+ {
+ va_list ap; char buf[20];
+ va_start(ap, fmt);
+ vsnprintf(buf, 20, fmt, ap);
+ va_end(ap);
+ }
+ main()
+ {
+ warn("testing %s\n", "a very long string that won't fit");
+ exit(0);
+ }
+
+EOF
+if { (eval echo configure:7397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ cat >> confdefs.h <<\EOF
+#define HAVE_VSNPRINTF 1
+EOF
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -fr conftest*
+fi
+
+
+
+echo $ac_n "checking for rename""... $ac_c" 1>&6
+echo "configure:7415: checking for rename" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7417 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int main() {
+rename("this", "that")
+; return 0; }
+EOF
+if { (eval echo configure:7424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_RENAME 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for sysctl""... $ac_c" 1>&6
+echo "configure:7439: checking for sysctl" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7441 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/sysctl.h>
+int main() {
+ int mib[2], r;
+ size_t len;
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_USERMEM;
+ len = sizeof(r);
+ (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
+
+; return 0; }
+EOF
+if { (eval echo configure:7456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SYSCTL 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""not usable" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for sysinfo""... $ac_c" 1>&6
+echo "configure:7471: checking for sysinfo" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7473 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/sysinfo.h>
+int main() {
+ struct sysinfo sinfo;
+ int t;
+
+ (void)sysinfo(&sinfo);
+ t = sinfo.totalram;
+
+; return 0; }
+EOF
+if { (eval echo configure:7486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SYSINFO 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""not usable" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking for sysconf""... $ac_c" 1>&6
+echo "configure:7501: checking for sysconf" >&5
+cat > conftest.$ac_ext <<EOF
+#line 7503 "configure"
+#include "confdefs.h"
+#include <unistd.h>
+int main() {
+ (void)sysconf(_SC_PAGESIZE);
+ (void)sysconf(_SC_PHYS_PAGES);
+
+; return 0; }
+EOF
+if { (eval echo configure:7512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_SYSCONF 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""not usable" 1>&6
+fi
+rm -f conftest*
+
+
+echo $ac_n "checking size of int""... $ac_c" 1>&6
+echo "configure:7528: checking size of int" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7536 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", (int)sizeof(int));
+ exit(0);
+ }
+EOF
+if { (eval echo configure:7547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_int=`cat conftestval`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_int=0
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_sizeof_int" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+EOF
+
+
+echo $ac_n "checking whether memmove/bcopy/memcpy handle overlaps""... $ac_c" 1>&6
+echo "configure:7568: checking whether memmove/bcopy/memcpy handle overlaps" >&5
+bcopy_test_prog='
+main() {
+ char buf[10];
+ strcpy(buf, "abcdefghi");
+ mch_memmove(buf, buf + 2, 3);
+ if (strncmp(buf, "ababcf", 6))
+ exit(1);
+ strcpy(buf, "abcdefghi");
+ mch_memmove(buf + 2, buf, 3);
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+}'
+
+
+if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7588 "configure"
+#include "confdefs.h"
+#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog
+EOF
+if { (eval echo configure:7592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ cat >> confdefs.h <<\EOF
+#define USEMEMMOVE 1
+EOF
+ echo "$ac_t""memmove does" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7606 "configure"
+#include "confdefs.h"
+#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog
+EOF
+if { (eval echo configure:7610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ cat >> confdefs.h <<\EOF
+#define USEBCOPY 1
+EOF
+ echo "$ac_t""bcopy does" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: failed to compile test program" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7624 "configure"
+#include "confdefs.h"
+#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog
+EOF
+if { (eval echo configure:7628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ cat >> confdefs.h <<\EOF
+#define USEMEMCPY 1
+EOF
+ echo "$ac_t""memcpy does" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -fr conftest*
+fi
+
+fi
+rm -fr conftest*
+fi
+
+fi
+rm -fr conftest*
+fi
+
+
+
+if test "$enable_multibyte" = "yes"; then
+ cflags_save=$CFLAGS
+ ldflags_save=$LDFLAGS
+ if test -n "$x_includes" ; then
+ CFLAGS="$CFLAGS -I$x_includes"
+ LDFLAGS="$X_LIBS $LDFLAGS -lX11"
+ echo $ac_n "checking whether X_LOCALE needed""... $ac_c" 1>&6
+echo "configure:7660: checking whether X_LOCALE needed" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 7662 "configure"
+#include "confdefs.h"
+#include <X11/Xlocale.h>
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:7669: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 7672 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _Xsetlocale();
+
+int main() {
+_Xsetlocale()
+; return 0; }
+EOF
+if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define X_LOCALE 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+ fi
+ CFLAGS=$cflags_save
+ LDFLAGS=$ldflags_save
+fi
+
+echo $ac_n "checking for _xpg4_setrunelocale in -lxpg4""... $ac_c" 1>&6
+echo "configure:7710: checking for _xpg4_setrunelocale in -lxpg4" >&5
+ac_lib_var=`echo xpg4'_'_xpg4_setrunelocale | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lxpg4 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 7718 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char _xpg4_setrunelocale();
+
+int main() {
+_xpg4_setrunelocale()
+; return 0; }
+EOF
+if { (eval echo configure:7729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -lxpg4"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking how to create tags""... $ac_c" 1>&6
+echo "configure:7751: checking how to create tags" >&5
+test -f tags && mv tags tags.save
+if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then
+ TAGPRG="ctags"
+else
+ (eval etags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags"
+ (eval etags -c /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags -c"
+ (eval ctags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="ctags"
+ (eval ctags -t /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="ctags -t"
+ (eval ctags -ts /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="ctags -ts"
+ (eval ctags -tvs /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="ctags -tvs"
+ (eval ctags -i+m /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="ctags -i+m"
+fi
+test -f tags.save && mv tags.save tags
+echo "$ac_t""$TAGPRG" 1>&6
+
+echo $ac_n "checking how to run man with a section nr""... $ac_c" 1>&6
+echo "configure:7768: checking how to run man with a section nr" >&5
+MANDEF="man"
+(eval man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s"
+echo "$ac_t""$MANDEF" 1>&6
+if test "$MANDEF" = "man -s"; then
+ cat >> confdefs.h <<\EOF
+#define USEMAN_S 1
+EOF
+
+fi
+
+echo $ac_n "checking --disable-nls argument""... $ac_c" 1>&6
+echo "configure:7780: checking --disable-nls argument" >&5
+# Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ :
+else
+ enable_nls="yes"
+fi
+
+
+if test "$enable_nls" = "yes"; then
+ echo "$ac_t""no" 1>&6
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:7795: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$MSGFMT"; then
+ ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_MSGFMT="msgfmt"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+MSGFMT="$ac_cv_prog_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for NLS""... $ac_c" 1>&6
+echo "configure:7822: checking for NLS" >&5
+ if test -f po/Makefile; then
+ have_gettext="no"
+ if test -n "$MSGFMT"; then
+ cat > conftest.$ac_ext <<EOF
+#line 7827 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+gettext("Test");
+; return 0; }
+EOF
+if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""gettext() works" 1>&6; have_gettext="yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ olibs=$LIBS
+ LIBS="$LIBS -lintl"
+ cat > conftest.$ac_ext <<EOF
+#line 7844 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+gettext("Test");
+; return 0; }
+EOF
+if { (eval echo configure:7851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""gettext() works with -lintl" 1>&6; have_gettext="yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""gettext() doesn't work" 1>&6;
+ LIBS=$olibs
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ else
+ echo "$ac_t""msgfmt not found - disabled" 1>&6;
+ fi
+ if test $have_gettext = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ MAKEMO=yes
+
+ for ac_func in bind_textdomain_codeset
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:7877: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7882 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:7905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ echo $ac_n "checking for _nl_msg_cat_cntr""... $ac_c" 1>&6
+echo "configure:7930: checking for _nl_msg_cat_cntr" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 7932 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+ extern int _nl_msg_cat_cntr;
+int main() {
+++_nl_msg_cat_cntr;
+; return 0; }
+EOF
+if { (eval echo configure:7940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define HAVE_NL_MSG_CAT_CNTR 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+ fi
+ else
+ echo "$ac_t""no "po/Makefile" - disabled" 1>&6;
+ fi
+else
+ echo "$ac_t""yes" 1>&6
+fi
+
+ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
+echo "configure:7963: checking for dlfcn.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7968 "configure"
+#include "confdefs.h"
+#include <dlfcn.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:7973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ DLL=dlfcn.h
+else
+ echo "$ac_t""no" 1>&6
+ac_safe=`echo "dl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for dl.h""... $ac_c" 1>&6
+echo "configure:7994: checking for dl.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 7999 "configure"
+#include "confdefs.h"
+#include <dl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ DLL=dl.h
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+if test x${DLL} = xdlfcn.h; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DLFCN_H 1
+EOF
+
+ echo $ac_n "checking for dlopen()""... $ac_c" 1>&6
+echo "configure:8033: checking for dlopen()" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 8035 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* dlopen();
+ dlopen();
+
+; return 0; }
+EOF
+if { (eval echo configure:8045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_DLOPEN 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ echo $ac_n "checking for dlopen() in -ldl""... $ac_c" 1>&6
+echo "configure:8058: checking for dlopen() in -ldl" >&5
+ olibs=$LIBS
+ LIBS="$LIBS -ldl"
+ cat > conftest.$ac_ext <<EOF
+#line 8062 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* dlopen();
+ dlopen();
+
+; return 0; }
+EOF
+if { (eval echo configure:8072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_DLOPEN 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ LIBS=$olibs
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ echo $ac_n "checking for dlsym()""... $ac_c" 1>&6
+echo "configure:8090: checking for dlsym()" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 8092 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* dlsym();
+ dlsym();
+
+; return 0; }
+EOF
+if { (eval echo configure:8102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_DLSYM 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ echo $ac_n "checking for dlsym() in -ldl""... $ac_c" 1>&6
+echo "configure:8115: checking for dlsym() in -ldl" >&5
+ olibs=$LIBS
+ LIBS="$LIBS -ldl"
+ cat > conftest.$ac_ext <<EOF
+#line 8119 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* dlsym();
+ dlsym();
+
+; return 0; }
+EOF
+if { (eval echo configure:8129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_DLSYM 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ LIBS=$olibs
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+elif test x${DLL} = xdl.h; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DL_H 1
+EOF
+
+ echo $ac_n "checking for shl_load()""... $ac_c" 1>&6
+echo "configure:8152: checking for shl_load()" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 8154 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* shl_load();
+ shl_load();
+
+; return 0; }
+EOF
+if { (eval echo configure:8164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_SHL_LOAD 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ echo $ac_n "checking for shl_load() in -ldld""... $ac_c" 1>&6
+echo "configure:8177: checking for shl_load() in -ldld" >&5
+ olibs=$LIBS
+ LIBS="$LIBS -ldld"
+ cat > conftest.$ac_ext <<EOF
+#line 8181 "configure"
+#include "confdefs.h"
+
+int main() {
+
+ extern void* shl_load();
+ shl_load();
+
+; return 0; }
+EOF
+if { (eval echo configure:8191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6;
+ cat >> confdefs.h <<\EOF
+#define HAVE_SHL_LOAD 1
+EOF
+
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6;
+ LIBS=$olibs
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+for ac_hdr in setjmp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:8213: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 8218 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:8223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
+ if echo $LIBS | grep -e '-ldl' >/dev/null; then
+ LIBS=`echo $LIBS | sed s/-ldl//`
+ PERL_LIBS="$PERL_LIBS -ldl"
+ fi
+fi
+
+if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \
+ && test "x$GUITYPE" != "xCARBONGUI"; then
+ echo $ac_n "checking whether we need -framework Carbon""... $ac_c" 1>&6
+echo "configure:8260: checking whether we need -framework Carbon" >&5
+ if test "x$enable_multibyte" = "xyes" || test "x$features" == "xbig" \
+ || test "x$features" = "xhuge"; then
+ LIBS="$LIBS -framework Carbon"
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in auto/config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "auto/config.mk:config.mk.in auto/config.h:config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@AWK@%$AWK%g
+s%@STRIP@%$STRIP%g
+s%@EXEEXT@%$EXEEXT%g
+s%@CPP_MM@%$CPP_MM%g
+s%@OS_EXTRA_SRC@%$OS_EXTRA_SRC%g
+s%@OS_EXTRA_OBJ@%$OS_EXTRA_OBJ%g
+s%@VIMNAME@%$VIMNAME%g
+s%@EXNAME@%$EXNAME%g
+s%@VIEWNAME@%$VIEWNAME%g
+s%@line_break@%$line_break%g
+s%@dovimdiff@%$dovimdiff%g
+s%@dogvimdiff@%$dogvimdiff%g
+s%@compiledby@%$compiledby%g
+s%@vi_cv_path_perl@%$vi_cv_path_perl%g
+s%@vi_cv_perllib@%$vi_cv_perllib%g
+s%@shrpenv@%$shrpenv%g
+s%@PERL_SRC@%$PERL_SRC%g
+s%@PERL_OBJ@%$PERL_OBJ%g
+s%@PERL_PRO@%$PERL_PRO%g
+s%@PERL_CFLAGS@%$PERL_CFLAGS%g
+s%@PERL_LIBS@%$PERL_LIBS%g
+s%@vi_cv_path_python@%$vi_cv_path_python%g
+s%@PYTHON_CONFDIR@%$PYTHON_CONFDIR%g
+s%@PYTHON_LIBS@%$PYTHON_LIBS%g
+s%@PYTHON_GETPATH_CFLAGS@%$PYTHON_GETPATH_CFLAGS%g
+s%@PYTHON_CFLAGS@%$PYTHON_CFLAGS%g
+s%@PYTHON_SRC@%$PYTHON_SRC%g
+s%@PYTHON_OBJ@%$PYTHON_OBJ%g
+s%@vi_cv_path_tcl@%$vi_cv_path_tcl%g
+s%@TCL_SRC@%$TCL_SRC%g
+s%@TCL_OBJ@%$TCL_OBJ%g
+s%@TCL_PRO@%$TCL_PRO%g
+s%@TCL_CFLAGS@%$TCL_CFLAGS%g
+s%@TCL_LIBS@%$TCL_LIBS%g
+s%@vi_cv_path_ruby@%$vi_cv_path_ruby%g
+s%@RUBY_SRC@%$RUBY_SRC%g
+s%@RUBY_OBJ@%$RUBY_OBJ%g
+s%@RUBY_PRO@%$RUBY_PRO%g
+s%@RUBY_CFLAGS@%$RUBY_CFLAGS%g
+s%@RUBY_LIBS@%$RUBY_LIBS%g
+s%@WORKSHOP_SRC@%$WORKSHOP_SRC%g
+s%@WORKSHOP_OBJ@%$WORKSHOP_OBJ%g
+s%@NETBEANS_SRC@%$NETBEANS_SRC%g
+s%@NETBEANS_OBJ@%$NETBEANS_OBJ%g
+s%@SNIFF_SRC@%$SNIFF_SRC%g
+s%@SNIFF_OBJ@%$SNIFF_OBJ%g
+s%@xmkmfpath@%$xmkmfpath%g
+s%@X_CFLAGS@%$X_CFLAGS%g
+s%@X_PRE_LIBS@%$X_PRE_LIBS%g
+s%@X_LIBS@%$X_LIBS%g
+s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@X_LIB@%$X_LIB%g
+s%@GTK_CONFIG@%$GTK_CONFIG%g
+s%@GTK12_CONFIG@%$GTK12_CONFIG%g
+s%@PKG_CONFIG@%$PKG_CONFIG%g
+s%@GTK_CFLAGS@%$GTK_CFLAGS%g
+s%@GTK_LIBS@%$GTK_LIBS%g
+s%@GTK_LIBNAME@%$GTK_LIBNAME%g
+s%@GNOME_LIBS@%$GNOME_LIBS%g
+s%@GNOME_LIBDIR@%$GNOME_LIBDIR%g
+s%@GNOME_INCLUDEDIR@%$GNOME_INCLUDEDIR%g
+s%@GNOME_CONFIG@%$GNOME_CONFIG%g
+s%@MOTIF_LIBNAME@%$MOTIF_LIBNAME%g
+s%@NARROW_PROTO@%$NARROW_PROTO%g
+s%@GUI_INC_LOC@%$GUI_INC_LOC%g
+s%@GUI_LIB_LOC@%$GUI_LIB_LOC%g
+s%@GUITYPE@%$GUITYPE%g
+s%@GUI_X_LIBS@%$GUI_X_LIBS%g
+s%@HANGULIN_SRC@%$HANGULIN_SRC%g
+s%@HANGULIN_OBJ@%$HANGULIN_OBJ%g
+s%@TAGPRG@%$TAGPRG%g
+s%@MSGFMT@%$MSGFMT%g
+s%@MAKEMO@%$MAKEMO%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"auto/config.mk:config.mk.in"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="auto/config.h:config.h.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+
diff --git a/src/bigvim.bat b/src/bigvim.bat
new file mode 100644
index 000000000..12b109d10
--- /dev/null
+++ b/src/bigvim.bat
@@ -0,0 +1,3 @@
+:: command to build big Vim with OLE, Perl, Python, Ruby and Tcl
+nmake -f Make_mvc.mak GUI=yes OLE=yes PERL=E:\perl58 DYNAMIC_PERL=yes PERL_VER=58 PYTHON=e:\python23 DYNAMIC_PYTHON=yes PYTHON_VER=23 RUBY=e:\ruby18 DYNAMIC_RUBY=yes RUBY_VER=18 RUBY_VER_LONG=1.8 TCL=e:\tcl DYNAMIC_TCL=yes %1 IME=yes CSCOPE=yes XPM=e:\xpm
+
diff --git a/src/buffer.c b/src/buffer.c
new file mode 100644
index 000000000..83b570f61
--- /dev/null
+++ b/src/buffer.c
@@ -0,0 +1,5071 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * buffer.c: functions for dealing with the buffer structure
+ */
+
+/*
+ * The buffer list is a double linked list of all buffers.
+ * Each buffer can be in one of these states:
+ * never loaded: BF_NEVERLOADED is set, only the file name is valid
+ * not loaded: b_ml.ml_mfp == NULL, no memfile allocated
+ * hidden: b_nwindows == 0, loaded but not displayed in a window
+ * normal: loaded and displayed in a window
+ *
+ * Instead of storing file names all over the place, each file name is
+ * stored in the buffer list. It can be referenced by a number.
+ *
+ * The current implementation remembers all file names ever used.
+ */
+
+
+#include "vim.h"
+
+#if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
+static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
+# define HAVE_BUFLIST_MATCH
+static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
+#endif
+static void buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
+static wininfo_T *find_wininfo __ARGS((buf_T *buf));
+#ifdef UNIX
+static buf_T *buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
+static int otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
+static int buf_same_ino __ARGS((buf_T *buf, struct stat *stp));
+#else
+static int otherfile_buf __ARGS((buf_T *buf, char_u *ffname));
+#endif
+#ifdef FEAT_TITLE
+static int ti_change __ARGS((char_u *str, char_u **last));
+#endif
+static void free_buffer __ARGS((buf_T *));
+static void free_buffer_stuff __ARGS((buf_T *buf, int free_options));
+static void clear_wininfo __ARGS((buf_T *buf));
+
+#ifdef UNIX
+# define dev_T dev_t
+#else
+# define dev_T unsigned
+#endif
+
+#if defined(FEAT_SIGNS)
+static void insert_sign __ARGS((buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr));
+static void buf_delete_signs __ARGS((buf_T *buf));
+#endif
+
+/*
+ * Open current buffer, that is: open the memfile and read the file into memory
+ * return FAIL for failure, OK otherwise
+ */
+ int
+open_buffer(read_stdin, eap)
+ int read_stdin; /* read file from stdin */
+ exarg_T *eap; /* for forced 'ff' and 'fenc' or NULL */
+{
+ int retval = OK;
+#ifdef FEAT_AUTOCMD
+ buf_T *old_curbuf;
+#endif
+
+ /*
+ * The 'readonly' flag is only set when BF_NEVERLOADED is being reset.
+ * When re-entering the same buffer, it should not change, because the
+ * user may have reset the flag by hand.
+ */
+ if (readonlymode && curbuf->b_ffname != NULL
+ && (curbuf->b_flags & BF_NEVERLOADED))
+ curbuf->b_p_ro = TRUE;
+
+ if (ml_open() == FAIL)
+ {
+ /*
+ * There MUST be a memfile, otherwise we can't do anything
+ * If we can't create one for the current buffer, take another buffer
+ */
+ close_buffer(NULL, curbuf, 0);
+ for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
+ if (curbuf->b_ml.ml_mfp != NULL)
+ break;
+ /*
+ * if there is no memfile at all, exit
+ * This is OK, since there are no changes to loose.
+ */
+ if (curbuf == NULL)
+ {
+ EMSG(_("E82: Cannot allocate any buffer, exiting..."));
+ getout(2);
+ }
+ EMSG(_("E83: Cannot allocate buffer, using other one..."));
+ enter_buffer(curbuf);
+ return FAIL;
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* The autocommands in readfile() may change the buffer, but only AFTER
+ * reading the file. */
+ old_curbuf = curbuf;
+ modified_was_set = FALSE;
+#endif
+
+ /* mark cursor position as being invalid */
+ changed_line_abv_curs();
+
+ if (curbuf->b_ffname != NULL
+#ifdef FEAT_NETBEANS_INTG
+ && netbeansReadFile
+#endif
+ )
+ {
+#ifdef FEAT_NETBEANS_INTG
+ int oldFire = netbeansFireChanges;
+
+ netbeansFireChanges = 0;
+#endif
+ retval = readfile(curbuf->b_ffname, curbuf->b_fname,
+ (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap, READ_NEW);
+#ifdef FEAT_NETBEANS_INTG
+ netbeansFireChanges = oldFire;
+#endif
+ /* Help buffer is filtered. */
+ if (curbuf->b_help)
+ fix_help_buffer();
+ }
+ else if (read_stdin)
+ {
+ int save_bin = curbuf->b_p_bin;
+ linenr_T line_count;
+
+ /*
+ * First read the text in binary mode into the buffer.
+ * Then read from that same buffer and append at the end. This makes
+ * it possible to retry when 'fileformat' or 'fileencoding' was
+ * guessed wrong.
+ */
+ curbuf->b_p_bin = TRUE;
+ retval = readfile(NULL, NULL, (linenr_T)0,
+ (linenr_T)0, (linenr_T)MAXLNUM, NULL, READ_NEW + READ_STDIN);
+ curbuf->b_p_bin = save_bin;
+ if (retval == OK)
+ {
+ line_count = curbuf->b_ml.ml_line_count;
+ retval = readfile(NULL, NULL, (linenr_T)line_count,
+ (linenr_T)0, (linenr_T)MAXLNUM, eap, READ_BUFFER);
+ if (retval == OK)
+ {
+ /* Delete the binary lines. */
+ while (--line_count >= 0)
+ ml_delete((linenr_T)1, FALSE);
+ }
+ else
+ {
+ /* Delete the converted lines. */
+ while (curbuf->b_ml.ml_line_count > line_count)
+ ml_delete(line_count, FALSE);
+ }
+ /* Put the cursor on the first line. */
+ curwin->w_cursor.lnum = 1;
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_EVAL
+ apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
+ curbuf, &retval);
+# else
+ apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
+# endif
+#endif
+ }
+ }
+
+ /* if first time loading this buffer, init b_chartab[] */
+ if (curbuf->b_flags & BF_NEVERLOADED)
+ (void)buf_init_chartab(curbuf, FALSE);
+
+ /*
+ * Set/reset the Changed flag first, autocmds may change the buffer.
+ * Apply the automatic commands, before processing the modelines.
+ * So the modelines have priority over auto commands.
+ */
+ /* When reading stdin, the buffer contents always needs writing, so set
+ * the changed flag. Unless in readonly mode: "ls | gview -".
+ * When interrupted and 'cpoptions' contains 'i' set changed flag. */
+ if ((read_stdin && !readonlymode && !bufempty())
+#ifdef FEAT_AUTOCMD
+ || modified_was_set /* ":set modified" used in autocmd */
+# ifdef FEAT_EVAL
+ || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)
+# endif
+#endif
+ || (got_int && vim_strchr(p_cpo, CPO_INTMOD) != NULL))
+ changed();
+ else if (retval != FAIL)
+ unchanged(curbuf, FALSE);
+ save_file_ff(curbuf); /* keep this fileformat */
+
+ /* require "!" to overwrite the file, because it wasn't read completely */
+#ifdef FEAT_EVAL
+ if (aborting())
+#else
+ if (got_int)
+#endif
+ curbuf->b_flags |= BF_READERR;
+
+#ifdef FEAT_AUTOCMD
+ /* need to set w_topline, unless some autocommand already did that. */
+ if (!(curwin->w_valid & VALID_TOPLINE))
+ {
+ curwin->w_topline = 1;
+# ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+# endif
+ }
+# ifdef FEAT_EVAL
+ apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval);
+# else
+ apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+# endif
+#endif
+
+ if (retval != FAIL)
+ {
+#ifdef FEAT_AUTOCMD
+ /*
+ * The autocommands may have changed the current buffer. Apply the
+ * modelines to the correct buffer, if it still exists and is loaded.
+ */
+ if (buf_valid(old_curbuf) && old_curbuf->b_ml.ml_mfp != NULL)
+ {
+ aco_save_T aco;
+
+ /* Go to the buffer that was opened. */
+ aucmd_prepbuf(&aco, old_curbuf);
+#endif
+ do_modelines();
+ curbuf->b_flags &= ~(BF_CHECK_RO | BF_NEVERLOADED);
+
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_EVAL
+ apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf,
+ &retval);
+# else
+ apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
+# endif
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ }
+#endif
+ }
+
+#ifdef FEAT_FOLDING
+ /* Need to update automatic folding. */
+ foldUpdateAll(curwin);
+#endif
+
+ return retval;
+}
+
+/*
+ * Return TRUE if "buf" points to a valid buffer (in the buffer list).
+ */
+ int
+buf_valid(buf)
+ buf_T *buf;
+{
+ buf_T *bp;
+
+ for (bp = firstbuf; bp != NULL; bp = bp->b_next)
+ if (bp == buf)
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Close the link to a buffer.
+ * "action" is used when there is no longer a window for the buffer.
+ * It can be:
+ * 0 buffer becomes hidden
+ * DOBUF_UNLOAD buffer is unloaded
+ * DOBUF_DELETE buffer is unloaded and removed from buffer list
+ * DOBUF_WIPE buffer is unloaded and really deleted
+ * When doing all but the first one on the current buffer, the caller should
+ * get a new buffer very soon!
+ *
+ * The 'bufhidden' option can force freeing and deleting.
+ */
+ void
+close_buffer(win, buf, action)
+ win_T *win; /* if not NULL, set b_last_cursor */
+ buf_T *buf;
+ int action;
+{
+#ifdef FEAT_AUTOCMD
+ int is_curbuf;
+ int nwindows = buf->b_nwindows;
+#endif
+ int unload_buf = (action != 0);
+ int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
+ int wipe_buf = (action == DOBUF_WIPE);
+
+#ifdef FEAT_QUICKFIX
+ /*
+ * Force unloading or deleting when 'bufhidden' says so.
+ * The caller must take care of NOT deleting/freeing when 'bufhidden' is
+ * "hide" (otherwise we could never free or delete a buffer).
+ */
+ if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
+ {
+ del_buf = TRUE;
+ unload_buf = TRUE;
+ wipe_buf = TRUE;
+ }
+ else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
+ unload_buf = TRUE;
+#endif
+
+ if (win != NULL)
+ {
+ /* Set b_last_cursor when closing the last window for the buffer.
+ * Remember the last cursor position and window options of the buffer.
+ * This used to be only for the current window, but then options like
+ * 'foldmethod' may be lost with a ":only" command. */
+ if (buf->b_nwindows == 1)
+ set_last_cursor(win);
+ buflist_setfpos(buf, win,
+ win->w_cursor.lnum == 1 ? 0 : win->w_cursor.lnum,
+ win->w_cursor.col, TRUE);
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* When the buffer is no longer in a window, trigger BufWinLeave */
+ if (buf->b_nwindows == 1)
+ {
+ apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+
+ /* When the buffer becomes hidden, but is not unloaded, trigger
+ * BufHidden */
+ if (!unload_buf)
+ {
+ apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+ if (!buf_valid(buf)) /* autocmds may delete the buffer */
+ return;
+ }
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return;
+# endif
+ }
+ nwindows = buf->b_nwindows;
+#endif
+
+ /* decrease the link count from windows (unless not in any window) */
+ if (buf->b_nwindows > 0)
+ --buf->b_nwindows;
+
+ /* Return when a window is displaying the buffer or when it's not
+ * unloaded. */
+ if (buf->b_nwindows > 0 || !unload_buf)
+ {
+ if (buf == curbuf)
+ u_sync(); /* sync undo before going to another buffer */
+ return;
+ }
+
+ /* Always remove the buffer when there is no file name. */
+ if (buf->b_ffname == NULL)
+ del_buf = TRUE;
+
+ /*
+ * Free all things allocated for this buffer.
+ * Also calls the "BufDelete" autocommands when del_buf is TRUE.
+ */
+#ifdef FEAT_AUTOCMD
+ /* Remember if we are closing the current buffer. Restore the number of
+ * windows, so that autocommands in buf_freeall() don't get confused. */
+ is_curbuf = (buf == curbuf);
+ buf->b_nwindows = nwindows;
+#endif
+
+ buf_freeall(buf, del_buf, wipe_buf);
+
+#ifdef FEAT_AUTOCMD
+ /* Autocommands may have deleted the buffer. */
+ if (!buf_valid(buf))
+ return;
+# ifdef FEAT_EVAL
+ /* Autocommands may abort script processing. */
+ if (aborting())
+ return;
+# endif
+
+ /* Autocommands may have opened or closed windows for this buffer.
+ * Decrement the count for the close we do here. */
+ if (buf->b_nwindows > 0)
+ --buf->b_nwindows;
+
+ /*
+ * It's possible that autocommands change curbuf to the one being deleted.
+ * This might cause the previous curbuf to be deleted unexpectedly. But
+ * in some cases it's OK to delete the curbuf, because a new one is
+ * obtained anyway. Therefore only return if curbuf changed to the
+ * deleted buffer.
+ */
+ if (buf == curbuf && !is_curbuf)
+ return;
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_file_closed(buf);
+#endif
+#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
+ /* Change directories when the acd option is set on. */
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+#endif
+
+ /*
+ * Remove the buffer from the list.
+ */
+ if (wipe_buf)
+ {
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ workshop_file_closed_lineno((char *)buf->b_ffname,
+ (int)buf->b_last_cursor.lnum);
+#endif
+ vim_free(buf->b_ffname);
+ vim_free(buf->b_sfname);
+ if (buf->b_prev == NULL)
+ firstbuf = buf->b_next;
+ else
+ buf->b_prev->b_next = buf->b_next;
+ if (buf->b_next == NULL)
+ lastbuf = buf->b_prev;
+ else
+ buf->b_next->b_prev = buf->b_prev;
+ free_buffer(buf);
+ }
+ else
+ {
+ if (del_buf)
+ {
+ /* Free all internal variables and reset option values, to make
+ * ":bdel" compatible with Vim 5.7. */
+ free_buffer_stuff(buf, TRUE);
+
+ /* Make it look like a new buffer. */
+ buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
+
+ /* Init the options when loaded again. */
+ buf->b_p_initialized = FALSE;
+ }
+ buf_clear_file(buf);
+ if (del_buf)
+ buf->b_p_bl = FALSE;
+ }
+}
+
+/*
+ * Make buffer not contain a file.
+ */
+ void
+buf_clear_file(buf)
+ buf_T *buf;
+{
+ buf->b_ml.ml_line_count = 1;
+ unchanged(buf, TRUE);
+#ifndef SHORT_FNAME
+ buf->b_shortname = FALSE;
+#endif
+ buf->b_p_eol = TRUE;
+ buf->b_start_eol = TRUE;
+#ifdef FEAT_MBYTE
+ buf->b_p_bomb = FALSE;
+#endif
+ buf->b_ml.ml_mfp = NULL;
+ buf->b_ml.ml_flags = ML_EMPTY; /* empty buffer */
+#ifdef FEAT_NETBEANS_INTG
+ netbeans_deleted_all_lines(buf);
+ netbeansOpenFile = 0; /* reset in netbeans_file_opened() */
+#endif
+}
+
+/*
+ * buf_freeall() - free all things allocated for a buffer that are related to
+ * the file.
+ */
+/*ARGSUSED*/
+ void
+buf_freeall(buf, del_buf, wipe_buf)
+ buf_T *buf;
+ int del_buf; /* buffer is going to be deleted */
+ int wipe_buf; /* buffer is going to be wiped out */
+{
+#ifdef FEAT_AUTOCMD
+ int is_curbuf = (buf == curbuf);
+
+ apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+ if (del_buf && buf->b_p_bl)
+ {
+ apply_autocmds(EVENT_BUFDELETE, buf->b_fname, buf->b_fname, FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+ }
+ if (wipe_buf)
+ {
+ apply_autocmds(EVENT_BUFWIPEOUT, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+ }
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return;
+# endif
+
+ /*
+ * It's possible that autocommands change curbuf to the one being deleted.
+ * This might cause curbuf to be deleted unexpectedly. But in some cases
+ * it's OK to delete the curbuf, because a new one is obtained anyway.
+ * Therefore only return if curbuf changed to the deleted buffer.
+ */
+ if (buf == curbuf && !is_curbuf)
+ return;
+#endif
+#ifdef FEAT_DIFF
+ diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */
+#endif
+#ifdef FEAT_TCL
+ tcl_buffer_free(buf);
+#endif
+ u_blockfree(buf); /* free the memory allocated for undo */
+ ml_close(buf, TRUE); /* close and delete the memline/memfile */
+ buf->b_ml.ml_line_count = 0; /* no lines in buffer */
+ u_clearall(buf); /* reset all undo information */
+#ifdef FEAT_SYN_HL
+ syntax_clear(buf); /* reset syntax info */
+#endif
+}
+
+/*
+ * Free a buffer structure and the things it contains related to the buffer
+ * itself (not the file, that must have been done already).
+ */
+ static void
+free_buffer(buf)
+ buf_T *buf;
+{
+ free_buffer_stuff(buf, TRUE);
+#ifdef FEAT_PERL
+ perl_buf_free(buf);
+#endif
+#ifdef FEAT_PYTHON
+ python_buffer_free(buf);
+#endif
+#ifdef FEAT_RUBY
+ ruby_buffer_free(buf);
+#endif
+ vim_free(buf);
+}
+
+/*
+ * Free stuff in the buffer for ":bdel" and when wiping out the buffer.
+ */
+ static void
+free_buffer_stuff(buf, free_options)
+ buf_T *buf;
+ int free_options; /* free options as well */
+{
+ if (free_options)
+ {
+ clear_wininfo(buf); /* including window-local options */
+ free_buf_options(buf, TRUE);
+ }
+#ifdef FEAT_EVAL
+ var_clear(&buf->b_vars); /* free all internal variables */
+#endif
+#ifdef FEAT_USR_CMDS
+ uc_clear(&buf->b_ucmds); /* clear local user commands */
+#endif
+#ifdef FEAT_SIGNS
+ buf_delete_signs(buf); /* delete any signs */
+#endif
+#ifdef FEAT_LOCALMAP
+ map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); /* clear local mappings */
+ map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); /* clear local abbrevs */
+#endif
+#ifdef FEAT_MBYTE
+ vim_free(buf->b_start_fenc);
+ buf->b_start_fenc = NULL;
+#endif
+}
+
+/*
+ * Free the b_wininfo list for buffer "buf".
+ */
+ static void
+clear_wininfo(buf)
+ buf_T *buf;
+{
+ wininfo_T *wip;
+
+ while (buf->b_wininfo != NULL)
+ {
+ wip = buf->b_wininfo;
+ buf->b_wininfo = wip->wi_next;
+ if (wip->wi_optset)
+ {
+ clear_winopt(&wip->wi_opt);
+#ifdef FEAT_FOLDING
+ deleteFoldRecurse(&wip->wi_folds);
+#endif
+ }
+ vim_free(wip);
+ }
+}
+
+#if defined(FEAT_LISTCMDS) || defined(PROTO)
+/*
+ * Go to another buffer. Handles the result of the ATTENTION dialog.
+ */
+ void
+goto_buffer(eap, start, dir, count)
+ exarg_T *eap;
+ int start;
+ int dir;
+ int count;
+{
+# if defined(FEAT_WINDOWS) \
+ && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+ buf_T *old_curbuf = curbuf;
+
+ swap_exists_action = SEA_DIALOG;
+# endif
+ (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO,
+ start, dir, count, eap->forceit);
+# if defined(FEAT_WINDOWS) \
+ && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+ if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
+ {
+ /* Quitting means closing the split window, nothing else. */
+ win_close(curwin, TRUE);
+ swap_exists_action = SEA_NONE;
+ }
+ else
+ handle_swap_exists(old_curbuf);
+# endif
+}
+#endif
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
+/*
+ * Handle the situation of swap_exists_action being set.
+ * It is allowed for "old_curbuf" to be NULL or invalid.
+ */
+ void
+handle_swap_exists(old_curbuf)
+ buf_T *old_curbuf;
+{
+ if (swap_exists_action == SEA_QUIT)
+ {
+ /* User selected Quit at ATTENTION prompt. Go back to previous
+ * buffer. If that buffer is gone or the same as the current one,
+ * open a new, empty buffer. */
+ swap_exists_action = SEA_NONE; /* don't want it again */
+ close_buffer(curwin, curbuf, DOBUF_UNLOAD);
+ if (!buf_valid(old_curbuf) || old_curbuf == curbuf)
+ old_curbuf = buflist_new(NULL, NULL, 1L,
+ BLN_CURBUF | BLN_LISTED | BLN_FORCE);
+ if (old_curbuf != NULL)
+ enter_buffer(old_curbuf);
+ /* If "old_curbuf" is NULL we are in big trouble here... */
+ }
+ else if (swap_exists_action == SEA_RECOVER)
+ {
+ /* User selected Recover at ATTENTION prompt. */
+ msg_scroll = TRUE;
+ ml_recover();
+ MSG_PUTS("\n"); /* don't overwrite the last message */
+ cmdline_row = msg_row;
+ do_modelines();
+ }
+ swap_exists_action = SEA_NONE;
+}
+#endif
+
+#if defined(FEAT_LISTCMDS) || defined(PROTO)
+/*
+ * do_bufdel() - delete or unload buffer(s)
+ *
+ * addr_count == 0: ":bdel" - delete current buffer
+ * addr_count == 1: ":N bdel" or ":bdel N [N ..]" - first delete
+ * buffer "end_bnr", then any other arguments.
+ * addr_count == 2: ":N,N bdel" - delete buffers in range
+ *
+ * command can be DOBUF_UNLOAD (":bunload"), DOBUF_WIPE (":bwipeout") or
+ * DOBUF_DEL (":bdel")
+ *
+ * Returns error message or NULL
+ */
+ char_u *
+do_bufdel(command, arg, addr_count, start_bnr, end_bnr, forceit)
+ int command;
+ char_u *arg; /* pointer to extra arguments */
+ int addr_count;
+ int start_bnr; /* first buffer number in a range */
+ int end_bnr; /* buffer nr or last buffer nr in a range */
+ int forceit;
+{
+ int do_current = 0; /* delete current buffer? */
+ int deleted = 0; /* number of buffers deleted */
+ char_u *errormsg = NULL; /* return value */
+ int bnr; /* buffer number */
+ char_u *p;
+
+#ifdef FEAT_NETBEANS_INTG
+ netbeansCloseFile = 1;
+#endif
+ if (addr_count == 0)
+ {
+ (void)do_buffer(command, DOBUF_CURRENT, FORWARD, 0, forceit);
+ }
+ else
+ {
+ if (addr_count == 2)
+ {
+ if (*arg) /* both range and argument is not allowed */
+ return (char_u *)_(e_trailing);
+ bnr = start_bnr;
+ }
+ else /* addr_count == 1 */
+ bnr = end_bnr;
+
+ for ( ;!got_int; ui_breakcheck())
+ {
+ /*
+ * delete the current buffer last, otherwise when the
+ * current buffer is deleted, the next buffer becomes
+ * the current one and will be loaded, which may then
+ * also be deleted, etc.
+ */
+ if (bnr == curbuf->b_fnum)
+ do_current = bnr;
+ else if (do_buffer(command, DOBUF_FIRST, FORWARD, (int)bnr,
+ forceit) == OK)
+ ++deleted;
+
+ /*
+ * find next buffer number to delete/unload
+ */
+ if (addr_count == 2)
+ {
+ if (++bnr > end_bnr)
+ break;
+ }
+ else /* addr_count == 1 */
+ {
+ arg = skipwhite(arg);
+ if (*arg == NUL)
+ break;
+ if (!VIM_ISDIGIT(*arg))
+ {
+ p = skiptowhite_esc(arg);
+ bnr = buflist_findpat(arg, p, command == DOBUF_WIPE, FALSE);
+ if (bnr < 0) /* failed */
+ break;
+ arg = p;
+ }
+ else
+ bnr = getdigits(&arg);
+ }
+ }
+ if (!got_int && do_current && do_buffer(command, DOBUF_FIRST,
+ FORWARD, do_current, forceit) == OK)
+ ++deleted;
+
+ if (deleted == 0)
+ {
+ if (command == DOBUF_UNLOAD)
+ sprintf((char *)IObuff, _("E515: No buffers were unloaded"));
+ else if (command == DOBUF_DEL)
+ sprintf((char *)IObuff, _("E516: No buffers were deleted"));
+ else
+ sprintf((char *)IObuff, _("E517: No buffers were wiped out"));
+ errormsg = IObuff;
+ }
+ else if (deleted >= p_report)
+ {
+ if (command == DOBUF_UNLOAD)
+ {
+ if (deleted == 1)
+ MSG(_("1 buffer unloaded"));
+ else
+ smsg((char_u *)_("%d buffers unloaded"), deleted);
+ }
+ else if (command == DOBUF_DEL)
+ {
+ if (deleted == 1)
+ MSG(_("1 buffer deleted"));
+ else
+ smsg((char_u *)_("%d buffers deleted"), deleted);
+ }
+ else
+ {
+ if (deleted == 1)
+ MSG(_("1 buffer wiped out"));
+ else
+ smsg((char_u *)_("%d buffers wiped out"), deleted);
+ }
+ }
+ }
+
+#ifdef FEAT_NETBEANS_INTG
+ netbeansCloseFile = 0;
+#endif
+
+ return errormsg;
+}
+
+/*
+ * Implementation of the commands for the buffer list.
+ *
+ * action == DOBUF_GOTO go to specified buffer
+ * action == DOBUF_SPLIT split window and go to specified buffer
+ * action == DOBUF_UNLOAD unload specified buffer(s)
+ * action == DOBUF_DEL delete specified buffer(s) from buffer list
+ * action == DOBUF_WIPE delete specified buffer(s) really
+ *
+ * start == DOBUF_CURRENT go to "count" buffer from current buffer
+ * start == DOBUF_FIRST go to "count" buffer from first buffer
+ * start == DOBUF_LAST go to "count" buffer from last buffer
+ * start == DOBUF_MOD go to "count" modified buffer from current buffer
+ *
+ * Return FAIL or OK.
+ */
+ int
+do_buffer(action, start, dir, count, forceit)
+ int action;
+ int start;
+ int dir; /* FORWARD or BACKWARD */
+ int count; /* buffer number or number of buffers */
+ int forceit; /* TRUE for :...! */
+{
+ buf_T *buf;
+ buf_T *bp;
+ int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
+ || action == DOBUF_WIPE);
+
+ switch (start)
+ {
+ case DOBUF_FIRST: buf = firstbuf; break;
+ case DOBUF_LAST: buf = lastbuf; break;
+ default: buf = curbuf; break;
+ }
+ if (start == DOBUF_MOD) /* find next modified buffer */
+ {
+ while (count-- > 0)
+ {
+ do
+ {
+ buf = buf->b_next;
+ if (buf == NULL)
+ buf = firstbuf;
+ }
+ while (buf != curbuf && !bufIsChanged(buf));
+ }
+ if (!bufIsChanged(buf))
+ {
+ EMSG(_("E84: No modified buffer found"));
+ return FAIL;
+ }
+ }
+ else if (start == DOBUF_FIRST && count) /* find specified buffer number */
+ {
+ while (buf != NULL && buf->b_fnum != count)
+ buf = buf->b_next;
+ }
+ else
+ {
+ bp = NULL;
+ while (count > 0 || (!unload && !buf->b_p_bl && bp != buf))
+ {
+ /* remember the buffer where we start, we come back there when all
+ * buffers are unlisted. */
+ if (bp == NULL)
+ bp = buf;
+ if (dir == FORWARD)
+ {
+ buf = buf->b_next;
+ if (buf == NULL)
+ buf = firstbuf;
+ }
+ else
+ {
+ buf = buf->b_prev;
+ if (buf == NULL)
+ buf = lastbuf;
+ }
+ /* don't count unlisted buffers */
+ if (unload || buf->b_p_bl)
+ {
+ --count;
+ bp = NULL; /* use this buffer as new starting point */
+ }
+ if (bp == buf)
+ {
+ /* back where we started, didn't find anything. */
+ EMSG(_("E85: There is no listed buffer"));
+ return FAIL;
+ }
+ }
+ }
+
+ if (buf == NULL) /* could not find it */
+ {
+ if (start == DOBUF_FIRST)
+ {
+ /* don't warn when deleting */
+ if (!unload)
+ EMSGN(_("E86: Buffer %ld does not exist"), count);
+ }
+ else if (dir == FORWARD)
+ EMSG(_("E87: Cannot go beyond last buffer"));
+ else
+ EMSG(_("E88: Cannot go before first buffer"));
+ return FAIL;
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+#ifdef FEAT_LISTCMDS
+ /*
+ * delete buffer buf from memory and/or the list
+ */
+ if (unload)
+ {
+ int forward;
+ int retval;
+
+ /* When unloading or deleting a buffer that's already unloaded and
+ * unlisted: fail silently. */
+ if (action != DOBUF_WIPE && buf->b_ml.ml_mfp == NULL && !buf->b_p_bl)
+ return FAIL;
+
+ if (!forceit && bufIsChanged(buf))
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && p_write)
+ {
+ dialog_changed(buf, FALSE);
+# ifdef FEAT_AUTOCMD
+ if (!buf_valid(buf))
+ /* Autocommand deleted buffer, oops! It's not changed
+ * now. */
+ return FAIL;
+# endif
+ }
+ if (bufIsChanged(buf))
+#endif
+ {
+ EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"),
+ buf->b_fnum);
+ return FAIL;
+ }
+ }
+
+ /*
+ * If deleting the last (listed) buffer, make it empty.
+ * The last (listed) buffer cannot be unloaded.
+ */
+ for (bp = firstbuf; bp != NULL; bp = bp->b_next)
+ if (bp->b_p_bl && bp != buf)
+ break;
+ if (bp == NULL && buf == curbuf)
+ {
+ if (action == DOBUF_UNLOAD)
+ {
+ EMSG(_("E90: Cannot unload last buffer"));
+ return FAIL;
+ }
+
+ /* Close any other windows on this buffer, then make it empty. */
+#ifdef FEAT_WINDOWS
+ {
+ win_T *wp, *nextwp;
+
+ for (wp = firstwin; wp != NULL; wp = nextwp)
+ {
+ nextwp = wp->w_next;
+ if (wp != curwin && wp->w_buffer == buf)
+ {
+ /* Start all over, autocommands may change the window
+ * layout. */
+ nextwp = firstwin;
+ win_close(wp, FALSE);
+ }
+ }
+ }
+#endif
+ setpcmark();
+ retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
+ forceit ? ECMD_FORCEIT : 0);
+
+ /*
+ * do_ecmd() may create a new buffer, then we have to delete
+ * the old one. But do_ecmd() may have done that already, check
+ * if the buffer still exists.
+ */
+ if (buf != curbuf && buf_valid(buf) && buf->b_nwindows == 0)
+ close_buffer(NULL, buf, action);
+ return retval;
+ }
+
+#ifdef FEAT_WINDOWS
+ /*
+ * If the deleted buffer is the current one, close the current window
+ * (unless it's the only window).
+ */
+ while (buf == curbuf && firstwin != lastwin)
+ win_close(curwin, FALSE);
+#endif
+
+ /*
+ * If the buffer to be deleted is not the current one, delete it here.
+ */
+ if (buf != curbuf)
+ {
+#ifdef FEAT_WINDOWS
+ close_windows(buf);
+#endif
+ if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0)
+ close_buffer(NULL, buf, action);
+ return OK;
+ }
+
+ /*
+ * Deleting the current buffer: Need to find another buffer to go to.
+ * There must be another, otherwise it would have been handled above.
+ * First use au_new_curbuf, if it is valid.
+ * Then prefer the buffer we most recently visited.
+ * Else try to find one that is loaded, after the current buffer,
+ * then before the current buffer.
+ * Finally use any buffer.
+ */
+ buf = NULL; /* selected buffer */
+ bp = NULL; /* used when no loaded buffer found */
+#ifdef FEAT_AUTOCMD
+ if (au_new_curbuf != NULL && buf_valid(au_new_curbuf))
+ buf = au_new_curbuf;
+# ifdef FEAT_JUMPLIST
+ else
+# endif
+#endif
+#ifdef FEAT_JUMPLIST
+ if (curwin->w_jumplistlen > 0)
+ {
+ int jumpidx;
+
+ jumpidx = curwin->w_jumplistidx - 1;
+ if (jumpidx < 0)
+ jumpidx = curwin->w_jumplistlen - 1;
+
+ forward = jumpidx;
+ while (jumpidx != curwin->w_jumplistidx)
+ {
+ buf = buflist_findnr(curwin->w_jumplist[jumpidx].fmark.fnum);
+ if (buf != NULL)
+ {
+ if (buf == curbuf || !buf->b_p_bl)
+ buf = NULL; /* skip current and unlisted bufs */
+ else if (buf->b_ml.ml_mfp == NULL)
+ {
+ /* skip unloaded buf, but may keep it for later */
+ if (bp == NULL)
+ bp = buf;
+ buf = NULL;
+ }
+ }
+ if (buf != NULL) /* found a valid buffer: stop searching */
+ break;
+ /* advance to older entry in jump list */
+ if (!jumpidx && curwin->w_jumplistidx == curwin->w_jumplistlen)
+ break;
+ if (--jumpidx < 0)
+ jumpidx = curwin->w_jumplistlen - 1;
+ if (jumpidx == forward) /* List exhausted for sure */
+ break;
+ }
+ }
+#endif
+
+ if (buf == NULL) /* No previous buffer, Try 2'nd approach */
+ {
+ forward = TRUE;
+ buf = curbuf->b_next;
+ for (;;)
+ {
+ if (buf == NULL)
+ {
+ if (!forward) /* tried both directions */
+ break;
+ buf = curbuf->b_prev;
+ forward = FALSE;
+ continue;
+ }
+ /* in non-help buffer, try to skip help buffers, and vv */
+ if (buf->b_help == curbuf->b_help && buf->b_p_bl)
+ {
+ if (buf->b_ml.ml_mfp != NULL) /* found loaded buffer */
+ break;
+ if (bp == NULL) /* remember unloaded buf for later */
+ bp = buf;
+ }
+ if (forward)
+ buf = buf->b_next;
+ else
+ buf = buf->b_prev;
+ }
+ }
+ if (buf == NULL) /* No loaded buffer, use unloaded one */
+ buf = bp;
+ if (buf == NULL) /* No loaded buffer, find listed one */
+ {
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_p_bl && buf != curbuf)
+ break;
+ }
+ if (buf == NULL) /* Still no buffer, just take one */
+ {
+ if (curbuf->b_next != NULL)
+ buf = curbuf->b_next;
+ else
+ buf = curbuf->b_prev;
+ }
+ }
+
+ /*
+ * make buf current buffer
+ */
+ if (action == DOBUF_SPLIT) /* split window first */
+ {
+# ifdef FEAT_WINDOWS
+ /* jump to first window containing buf if one exists ("useopen") */
+ if (vim_strchr(p_swb, 'u') && buf_jump_open_win(buf))
+ return OK;
+ if (win_split(0, 0) == FAIL)
+# endif
+ return FAIL;
+ }
+#endif
+
+ /* go to current buffer - nothing to do */
+ if (buf == curbuf)
+ return OK;
+
+ /*
+ * Check if the current buffer may be abandoned.
+ */
+ if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit))
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && p_write)
+ {
+ dialog_changed(curbuf, FALSE);
+# ifdef FEAT_AUTOCMD
+ if (!buf_valid(buf))
+ /* Autocommand deleted buffer, oops! */
+ return FAIL;
+# endif
+ }
+ if (bufIsChanged(curbuf))
+#endif
+ {
+ EMSG(_(e_nowrtmsg));
+ return FAIL;
+ }
+ }
+
+ /* Go to the other buffer. */
+ set_curbuf(buf, action);
+
+#if defined(FEAT_LISTCMDS) && defined(FEAT_SCROLLBIND)
+ if (action == DOBUF_SPLIT)
+ curwin->w_p_scb = FALSE; /* reset 'scrollbind' */
+#endif
+
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (aborting()) /* autocmds may abort script processing */
+ return FAIL;
+#endif
+
+ return OK;
+}
+
+#endif /* FEAT_LISTCMDS */
+
+/*
+ * Set current buffer to "buf". Executes autocommands and closes current
+ * buffer. "action" tells how to close the current buffer:
+ * DOBUF_GOTO free or hide it
+ * DOBUF_SPLIT nothing
+ * DOBUF_UNLOAD unload it
+ * DOBUF_DEL delete it
+ * DOBUF_WIPE wipe it out
+ */
+ void
+set_curbuf(buf, action)
+ buf_T *buf;
+ int action;
+{
+ buf_T *prevbuf;
+ int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
+ || action == DOBUF_WIPE);
+
+ setpcmark();
+ curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
+ buflist_altfpos(); /* remember curpos */
+
+#ifdef FEAT_VISUAL
+ /* Don't restart Select mode after switching to another buffer. */
+ VIsual_reselect = FALSE;
+#endif
+
+ /* close_windows() or apply_autocmds() may change curbuf */
+ prevbuf = curbuf;
+
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+# ifdef FEAT_EVAL
+ if (buf_valid(prevbuf) && !aborting())
+# else
+ if (buf_valid(prevbuf))
+# endif
+#endif
+ {
+#ifdef FEAT_WINDOWS
+ if (unload)
+ close_windows(prevbuf);
+#endif
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (buf_valid(prevbuf) && !aborting())
+#else
+ if (buf_valid(prevbuf))
+#endif
+ close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
+ unload ? action : (action == DOBUF_GOTO
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0);
+ }
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_EVAL
+ /* An autocommand may have deleted buf or aborted the script processing! */
+ if (buf_valid(buf) && !aborting())
+# else
+ if (buf_valid(buf)) /* an autocommand may have deleted buf! */
+# endif
+#endif
+ enter_buffer(buf);
+}
+
+/*
+ * Enter a new current buffer.
+ * Old curbuf must have been abandoned already!
+ */
+ void
+enter_buffer(buf)
+ buf_T *buf;
+{
+ /* Copy buffer and window local option values. Not for a help buffer. */
+ buf_copy_options(buf, BCO_ENTER | BCO_NOHELP);
+ if (!buf->b_help)
+ get_winopts(buf);
+#ifdef FEAT_FOLDING
+ else
+ /* Remove all folds in the window. */
+ clearFolding(curwin);
+ foldUpdateAll(curwin); /* update folds (later). */
+#endif
+
+ /* Get the buffer in the current window. */
+ curwin->w_buffer = buf;
+ curbuf = buf;
+ ++curbuf->b_nwindows;
+
+#ifdef FEAT_DIFF
+ diff_new_buffer();
+#endif
+
+ /* Cursor on first line by default. */
+ curwin->w_cursor.lnum = 1;
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+
+ /* Make sure the buffer is loaded. */
+ if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
+ open_buffer(FALSE, NULL);
+ else
+ {
+ need_fileinfo = TRUE; /* display file info after redraw */
+ (void)buf_check_timestamp(curbuf, FALSE); /* check if file changed */
+#ifdef FEAT_AUTOCMD
+ curwin->w_topline = 1;
+# ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+# endif
+ apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+ apply_autocmds(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf);
+#endif
+ }
+
+ /* If autocommands did not change the cursor position, restore cursor lnum
+ * and possibly cursor col. */
+ if (curwin->w_cursor.lnum == 1 && inindent(0))
+ buflist_getfpos();
+
+ check_arg_idx(curwin); /* check for valid arg_idx */
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+#ifdef FEAT_AUTOCMD
+ if (curwin->w_topline == 1) /* when autocmds didn't change it */
+#endif
+ scroll_cursor_halfway(FALSE); /* redisplay at correct position */
+
+#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
+ /* Change directories when the acd option is set on. */
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+#endif
+
+#ifdef FEAT_KEYMAP
+ if (curbuf->b_kmap_state & KEYMAP_INIT)
+ keymap_init();
+#endif
+ redraw_later(NOT_VALID);
+}
+
+/*
+ * functions for dealing with the buffer list
+ */
+
+/*
+ * Add a file name to the buffer list. Return a pointer to the buffer.
+ * If the same file name already exists return a pointer to that buffer.
+ * If it does not exist, or if fname == NULL, a new entry is created.
+ * If (flags & BLN_CURBUF) is TRUE, may use current buffer.
+ * If (flags & BLN_LISTED) is TRUE, add new buffer to buffer list.
+ * If (flags & BLN_DUMMY) is TRUE, don't count it as a real buffer.
+ * If (flags & BLN_FORCE) is TRUE, don't abort on an error.
+ * This is the ONLY way to create a new buffer.
+ */
+static int top_file_num = 1; /* highest file number */
+
+ buf_T *
+buflist_new(ffname, sfname, lnum, flags)
+ char_u *ffname; /* full path of fname or relative */
+ char_u *sfname; /* short fname or NULL */
+ linenr_T lnum; /* preferred cursor line */
+ int flags; /* BLN_ defines */
+{
+ buf_T *buf;
+#ifdef UNIX
+ struct stat st;
+#endif
+
+ fname_expand(curbuf, &ffname, &sfname); /* will allocate ffname */
+
+ /*
+ * If file name already exists in the list, update the entry.
+ */
+#ifdef UNIX
+ /* On Unix we can use inode numbers when the file exists. Works better
+ * for hard links. */
+ if (sfname == NULL || mch_stat((char *)sfname, &st) < 0)
+ st.st_dev = (dev_T)-1;
+#endif
+ if (ffname != NULL && !(flags & BLN_DUMMY) && (buf =
+#ifdef UNIX
+ buflist_findname_stat(ffname, &st)
+#else
+ buflist_findname(ffname)
+#endif
+ ) != NULL)
+ {
+ vim_free(ffname);
+ if (lnum != 0)
+ buflist_setfpos(buf, curwin, lnum, (colnr_T)0, FALSE);
+ /* copy the options now, if 'cpo' doesn't have 's' and not done
+ * already */
+ buf_copy_options(buf, 0);
+ if ((flags & BLN_LISTED) && !buf->b_p_bl)
+ {
+ buf->b_p_bl = TRUE;
+#ifdef FEAT_AUTOCMD
+ if (!(flags & BLN_DUMMY))
+ apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf);
+#endif
+ }
+ return buf;
+ }
+
+ /*
+ * If the current buffer has no name and no contents, use the current
+ * buffer. Otherwise: Need to allocate a new buffer structure.
+ *
+ * This is the ONLY place where a new buffer structure is allocated!
+ */
+ buf = NULL;
+ if ((flags & BLN_CURBUF)
+ && curbuf != NULL
+ && curbuf->b_ffname == NULL
+ && curbuf->b_nwindows <= 1
+ && (curbuf->b_ml.ml_mfp == NULL || bufempty()))
+ {
+ buf = curbuf;
+#ifdef FEAT_AUTOCMD
+ /* It's like this buffer is deleted. Watch out for autocommands that
+ * change curbuf! If that happens, allocate a new buffer anyway. */
+ if (curbuf->b_p_bl)
+ apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
+ if (buf == curbuf)
+ apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
+# ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+ if (!(flags & BLN_FORCE) && aborting())
+ return NULL;
+# endif
+#endif
+#ifdef FEAT_QUICKFIX
+# ifdef FEAT_AUTOCMD
+ if (buf == curbuf)
+# endif
+ {
+ /* Make sure 'bufhidden' and 'buftype' are empty */
+ clear_string_option(&buf->b_p_bh);
+ clear_string_option(&buf->b_p_bt);
+ }
+#endif
+ }
+ if (buf != curbuf || curbuf == NULL)
+ {
+ buf = (buf_T *)alloc_clear((unsigned)sizeof(buf_T));
+ if (buf == NULL)
+ {
+ vim_free(ffname);
+ return NULL;
+ }
+ }
+
+ if (ffname != NULL)
+ {
+ buf->b_ffname = ffname;
+ buf->b_sfname = vim_strsave(sfname);
+ }
+
+ clear_wininfo(buf);
+ buf->b_wininfo = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
+
+ if ((ffname != NULL && (buf->b_ffname == NULL || buf->b_sfname == NULL))
+ || buf->b_wininfo == NULL)
+ {
+ vim_free(buf->b_ffname);
+ buf->b_ffname = NULL;
+ vim_free(buf->b_sfname);
+ buf->b_sfname = NULL;
+ if (buf != curbuf)
+ free_buffer(buf);
+ return NULL;
+ }
+
+ if (buf == curbuf)
+ {
+ /* free all things allocated for this buffer */
+ buf_freeall(buf, FALSE, FALSE);
+ if (buf != curbuf) /* autocommands deleted the buffer! */
+ return NULL;
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ /* autocmds may abort script processing */
+ if (!(flags & BLN_FORCE) && aborting())
+ return NULL;
+#endif
+ /* buf->b_nwindows = 0; why was this here? */
+ free_buffer_stuff(buf, FALSE); /* delete local variables et al. */
+#ifdef FEAT_KEYMAP
+ /* need to reload lmaps and set b:keymap_name */
+ curbuf->b_kmap_state |= KEYMAP_INIT;
+#endif
+ }
+ else
+ {
+ /*
+ * put new buffer at the end of the buffer list
+ */
+ buf->b_next = NULL;
+ if (firstbuf == NULL) /* buffer list is empty */
+ {
+ buf->b_prev = NULL;
+ firstbuf = buf;
+ }
+ else /* append new buffer at end of list */
+ {
+ lastbuf->b_next = buf;
+ buf->b_prev = lastbuf;
+ }
+ lastbuf = buf;
+
+ buf->b_fnum = top_file_num++;
+ if (top_file_num < 0) /* wrap around (may cause duplicates) */
+ {
+ EMSG(_("W14: Warning: List of file names overflow"));
+ if (emsg_silent == 0)
+ {
+ out_flush();
+ ui_delay(3000L, TRUE); /* make sure it is noticed */
+ }
+ top_file_num = 1;
+ }
+
+ /*
+ * Always copy the options from the current buffer.
+ */
+ buf_copy_options(buf, BCO_ALWAYS);
+ }
+
+ buf->b_wininfo->wi_fpos.lnum = lnum;
+ buf->b_wininfo->wi_win = curwin;
+
+#ifdef FEAT_EVAL
+ var_init(&buf->b_vars); /* init internal variables */
+#endif
+
+ buf->b_fname = buf->b_sfname;
+#ifdef UNIX
+ if (st.st_dev == (dev_T)-1)
+ buf->b_dev = -1;
+ else
+ {
+ buf->b_dev = st.st_dev;
+ buf->b_ino = st.st_ino;
+ }
+#endif
+ buf->b_u_synced = TRUE;
+ buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
+ buf_clear_file(buf);
+ clrallmarks(buf); /* clear marks */
+ fmarks_check_names(buf); /* check file marks for this file */
+ buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */
+#ifdef FEAT_AUTOCMD
+ if (!(flags & BLN_DUMMY))
+ {
+ apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, buf);
+ if (flags & BLN_LISTED)
+ apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, buf);
+# ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+ if (!(flags & BLN_FORCE) && aborting())
+ return NULL;
+# endif
+ }
+#endif
+
+ return buf;
+}
+
+/*
+ * Free the memory for the options of a buffer.
+ * If "free_p_ff" is TRUE also free 'fileformat', 'buftype' and
+ * 'fileencoding'.
+ */
+ void
+free_buf_options(buf, free_p_ff)
+ buf_T *buf;
+ int free_p_ff;
+{
+ if (free_p_ff)
+ {
+#ifdef FEAT_MBYTE
+ clear_string_option(&buf->b_p_fenc);
+#endif
+ clear_string_option(&buf->b_p_ff);
+#ifdef FEAT_QUICKFIX
+ clear_string_option(&buf->b_p_bh);
+ clear_string_option(&buf->b_p_bt);
+#endif
+ }
+#ifdef FEAT_FIND_ID
+ clear_string_option(&buf->b_p_def);
+ clear_string_option(&buf->b_p_inc);
+# ifdef FEAT_EVAL
+ clear_string_option(&buf->b_p_inex);
+# endif
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ clear_string_option(&buf->b_p_inde);
+ clear_string_option(&buf->b_p_indk);
+#endif
+#ifdef FEAT_CRYPT
+ clear_string_option(&buf->b_p_key);
+#endif
+ clear_string_option(&buf->b_p_kp);
+ clear_string_option(&buf->b_p_mps);
+ clear_string_option(&buf->b_p_fo);
+ clear_string_option(&buf->b_p_isk);
+#ifdef FEAT_KEYMAP
+ clear_string_option(&buf->b_p_keymap);
+ ga_clear(&buf->b_kmap_ga);
+#endif
+#ifdef FEAT_COMMENTS
+ clear_string_option(&buf->b_p_com);
+#endif
+#ifdef FEAT_FOLDING
+ clear_string_option(&buf->b_p_cms);
+#endif
+ clear_string_option(&buf->b_p_nf);
+#ifdef FEAT_SYN_HL
+ clear_string_option(&buf->b_p_syn);
+#endif
+#ifdef FEAT_SEARCHPATH
+ clear_string_option(&buf->b_p_sua);
+#endif
+#ifdef FEAT_AUTOCMD
+ clear_string_option(&buf->b_p_ft);
+#endif
+#ifdef FEAT_OSFILETYPE
+ clear_string_option(&buf->b_p_oft);
+#endif
+#ifdef FEAT_CINDENT
+ clear_string_option(&buf->b_p_cink);
+ clear_string_option(&buf->b_p_cino);
+#endif
+#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
+ clear_string_option(&buf->b_p_cinw);
+#endif
+#ifdef FEAT_INS_EXPAND
+ clear_string_option(&buf->b_p_cpt);
+#endif
+#ifdef FEAT_QUICKFIX
+ clear_string_option(&buf->b_p_gp);
+ clear_string_option(&buf->b_p_mp);
+ clear_string_option(&buf->b_p_efm);
+#endif
+ clear_string_option(&buf->b_p_ep);
+ clear_string_option(&buf->b_p_path);
+ clear_string_option(&buf->b_p_tags);
+#ifdef FEAT_INS_EXPAND
+ clear_string_option(&buf->b_p_dict);
+ clear_string_option(&buf->b_p_tsr);
+#endif
+ buf->b_p_ar = -1;
+}
+
+/*
+ * get alternate file n
+ * set linenr to lnum or altfpos.lnum if lnum == 0
+ * also set cursor column to altfpos.col if 'startofline' is not set.
+ * if (options & GETF_SETMARK) call setpcmark()
+ * if (options & GETF_ALT) we are jumping to an alternate file.
+ * if (options & GETF_SWITCH) respect 'switchbuf' settings when jumping
+ *
+ * return FAIL for failure, OK for success
+ */
+ int
+buflist_getfile(n, lnum, options, forceit)
+ int n;
+ linenr_T lnum;
+ int options;
+ int forceit;
+{
+ buf_T *buf;
+#ifdef FEAT_WINDOWS
+ win_T *wp = NULL;
+#endif
+ pos_T *fpos;
+ colnr_T col;
+
+ buf = buflist_findnr(n);
+ if (buf == NULL)
+ {
+ if ((options & GETF_ALT) && n == 0)
+ EMSG(_(e_noalt));
+ else
+ EMSGN(_("E92: Buffer %ld not found"), n);
+ return FAIL;
+ }
+
+ /* if alternate file is the current buffer, nothing to do */
+ if (buf == curbuf)
+ return OK;
+
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ return FAIL;
+#endif
+
+ /* altfpos may be changed by getfile(), get it now */
+ if (lnum == 0)
+ {
+ fpos = buflist_findfpos(buf);
+ lnum = fpos->lnum;
+ col = fpos->col;
+ }
+ else
+ col = 0;
+
+#ifdef FEAT_WINDOWS
+ if (options & GETF_SWITCH)
+ {
+ /* use existing open window for buffer if wanted */
+ if (vim_strchr(p_swb, 'u')) /* useopen */
+ wp = buf_jump_open_win(buf);
+ /* split window if wanted ("split") */
+ if (wp == NULL && vim_strchr(p_swb, 't') && !bufempty())
+ {
+ if (win_split(0, 0) == FAIL)
+ return FAIL;
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ }
+ }
+#endif
+
+ ++RedrawingDisabled;
+ if (getfile(buf->b_fnum, NULL, NULL, (options & GETF_SETMARK),
+ lnum, forceit) <= 0)
+ {
+ --RedrawingDisabled;
+
+ /* cursor is at to BOL and w_cursor.lnum is checked due to getfile() */
+ if (!p_sol && col != 0)
+ {
+ curwin->w_cursor.col = col;
+ check_cursor_col();
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+ }
+ return OK;
+ }
+ --RedrawingDisabled;
+ return FAIL;
+}
+
+/*
+ * go to the last know line number for the current buffer
+ */
+ void
+buflist_getfpos()
+{
+ pos_T *fpos;
+
+ fpos = buflist_findfpos(curbuf);
+
+ curwin->w_cursor.lnum = fpos->lnum;
+ check_cursor_lnum();
+
+ if (p_sol)
+ curwin->w_cursor.col = 0;
+ else
+ {
+ curwin->w_cursor.col = fpos->col;
+ check_cursor_col();
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+ }
+}
+
+/*
+ * Find file in buffer list by name (it has to be for the current window).
+ * "ffname" must have a full path.
+ */
+ buf_T *
+buflist_findname(ffname)
+ char_u *ffname;
+{
+#ifdef UNIX
+ struct stat st;
+
+ if (mch_stat((char *)ffname, &st) < 0)
+ st.st_dev = (dev_T)-1;
+ return buflist_findname_stat(ffname, &st);
+}
+
+/*
+ * Same as buflist_findname(), but pass the stat structure to avoid getting it
+ * twice for the same file.
+ */
+ static buf_T *
+buflist_findname_stat(ffname, stp)
+ char_u *ffname;
+ struct stat *stp;
+{
+#endif
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (!otherfile_buf(buf, ffname
+#ifdef UNIX
+ , stp
+#endif
+ ))
+ return buf;
+ return NULL;
+}
+
+#if defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL) || defined(PROTO)
+/*
+ * Find file in buffer list by a regexp pattern.
+ * Return fnum of the found buffer.
+ * Return < 0 for error.
+ */
+/*ARGSUSED*/
+ int
+buflist_findpat(pattern, pattern_end, unlisted, diffmode)
+ char_u *pattern;
+ char_u *pattern_end; /* pointer to first char after pattern */
+ int unlisted; /* find unlisted buffers */
+ int diffmode; /* find diff-mode buffers only */
+{
+ buf_T *buf;
+ regprog_T *prog;
+ int match = -1;
+ int find_listed;
+ char_u *pat;
+ char_u *patend;
+ int attempt;
+ char_u *p;
+ int toggledollar;
+
+ if (pattern_end == pattern + 1 && (*pattern == '%' || *pattern == '#'))
+ {
+ if (*pattern == '%')
+ match = curbuf->b_fnum;
+ else
+ match = curwin->w_alt_fnum;
+#ifdef FEAT_DIFF
+ if (diffmode && !diff_mode_buf(buflist_findnr(match)))
+ match = -1;
+#endif
+ }
+
+ /*
+ * Try four ways of matching a listed buffer:
+ * attempt == 0: without '^' or '$' (at any position)
+ * attempt == 1: with '^' at start (only at postion 0)
+ * attempt == 2: with '$' at end (only match at end)
+ * attempt == 3: with '^' at start and '$' at end (only full match)
+ * Repeat this for finding an unlisted buffer if there was no matching
+ * listed buffer.
+ */
+ else
+ {
+ pat = file_pat_to_reg_pat(pattern, pattern_end, NULL, FALSE);
+ if (pat == NULL)
+ return -1;
+ patend = pat + STRLEN(pat) - 1;
+ toggledollar = (patend > pat && *patend == '$');
+
+ /* First try finding a listed buffer. If not found and "unlisted"
+ * is TRUE, try finding an unlisted buffer. */
+ find_listed = TRUE;
+ for (;;)
+ {
+ for (attempt = 0; attempt <= 3; ++attempt)
+ {
+ /* may add '^' and '$' */
+ if (toggledollar)
+ *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
+ p = pat;
+ if (*p == '^' && !(attempt & 1)) /* add/remove '^' */
+ ++p;
+ prog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
+ if (prog == NULL)
+ {
+ vim_free(pat);
+ return -1;
+ }
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_p_bl == find_listed
+#ifdef FEAT_DIFF
+ && (!diffmode || diff_mode_buf(buf))
+#endif
+ && buflist_match(prog, buf) != NULL)
+ {
+ if (match >= 0) /* already found a match */
+ {
+ match = -2;
+ break;
+ }
+ match = buf->b_fnum; /* remember first match */
+ }
+
+ vim_free(prog);
+ if (match >= 0) /* found one match */
+ break;
+ }
+
+ /* Only search for unlisted buffers if there was no match with
+ * a listed buffer. */
+ if (!unlisted || !find_listed || match != -1)
+ break;
+ find_listed = FALSE;
+ }
+
+ vim_free(pat);
+ }
+
+ if (match == -2)
+ EMSG2(_("E93: More than one match for %s"), pattern);
+ else if (match < 0)
+ EMSG2(_("E94: No matching buffer for %s"), pattern);
+ return match;
+}
+#endif
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+/*
+ * Find all buffer names that match.
+ * For command line expansion of ":buf" and ":sbuf".
+ * Return OK if matches found, FAIL otherwise.
+ */
+ int
+ExpandBufnames(pat, num_file, file, options)
+ char_u *pat;
+ int *num_file;
+ char_u ***file;
+ int options;
+{
+ int count = 0;
+ buf_T *buf;
+ int round;
+ char_u *p;
+ int attempt;
+ regprog_T *prog;
+
+ *num_file = 0; /* return values in case of FAIL */
+ *file = NULL;
+
+ /*
+ * attempt == 1: try match with '^', match at start
+ * attempt == 2: try match without '^', match anywhere
+ */
+ for (attempt = 1; attempt <= 2; ++attempt)
+ {
+ if (attempt == 2)
+ {
+ if (*pat != '^') /* there's no '^', no need to try again */
+ break;
+ ++pat; /* skip the '^' */
+ }
+ prog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
+ if (prog == NULL)
+ return FAIL;
+
+ /*
+ * round == 1: Count the matches.
+ * round == 2: Build the array to keep the matches.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ count = 0;
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (!buf->b_p_bl) /* skip unlisted buffers */
+ continue;
+ p = buflist_match(prog, buf);
+ if (p != NULL)
+ {
+ if (round == 1)
+ ++count;
+ else
+ {
+ if (options & WILD_HOME_REPLACE)
+ p = home_replace_save(buf, p);
+ else
+ p = vim_strsave(p);
+ (*file)[count++] = p;
+ }
+ }
+ }
+ if (count == 0) /* no match found, break here */
+ break;
+ if (round == 1)
+ {
+ *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
+ if (*file == NULL)
+ {
+ vim_free(prog);
+ return FAIL;
+ }
+ }
+ }
+ vim_free(prog);
+ if (count) /* match(es) found, break here */
+ break;
+ }
+
+ *num_file = count;
+ return (count == 0 ? FAIL : OK);
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+#ifdef HAVE_BUFLIST_MATCH
+/*
+ * Check for a match on the file name for buffer "buf" with regprog "prog".
+ */
+ static char_u *
+buflist_match(prog, buf)
+ regprog_T *prog;
+ buf_T *buf;
+{
+ char_u *match;
+
+ /* First try the short file name, then the long file name. */
+ match = fname_match(prog, buf->b_sfname);
+ if (match == NULL)
+ match = fname_match(prog, buf->b_ffname);
+
+ return match;
+}
+
+/*
+ * Try matching the regexp in "prog" with file name "name".
+ * Return "name" when there is a match, NULL when not.
+ */
+ static char_u *
+fname_match(prog, name)
+ regprog_T *prog;
+ char_u *name;
+{
+ char_u *match = NULL;
+ char_u *p;
+ regmatch_T regmatch;
+
+ if (name != NULL)
+ {
+ regmatch.regprog = prog;
+#ifdef CASE_INSENSITIVE_FILENAME
+ regmatch.rm_ic = TRUE; /* Always ignore case */
+#else
+ regmatch.rm_ic = FALSE; /* Never ignore case */
+#endif
+
+ if (vim_regexec(&regmatch, name, (colnr_T)0))
+ match = name;
+ else
+ {
+ /* Replace $(HOME) with '~' and try matching again. */
+ p = home_replace_save(NULL, name);
+ if (p != NULL && vim_regexec(&regmatch, p, (colnr_T)0))
+ match = name;
+ vim_free(p);
+ }
+ }
+
+ return match;
+}
+#endif
+
+/*
+ * find file in buffer list by number
+ */
+ buf_T *
+buflist_findnr(nr)
+ int nr;
+{
+ buf_T *buf;
+
+ if (nr == 0)
+ nr = curwin->w_alt_fnum;
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_fnum == nr)
+ return (buf);
+ return NULL;
+}
+
+/*
+ * Get name of file 'n' in the buffer list.
+ * When the file has no name an empty string is returned.
+ * home_replace() is used to shorten the file name (used for marks).
+ * Returns a pointer to allocated memory, of NULL when failed.
+ */
+ char_u *
+buflist_nr2name(n, fullname, helptail)
+ int n;
+ int fullname;
+ int helptail; /* for help buffers return tail only */
+{
+ buf_T *buf;
+
+ buf = buflist_findnr(n);
+ if (buf == NULL)
+ return NULL;
+ return home_replace_save(helptail ? buf : NULL,
+ fullname ? buf->b_ffname : buf->b_fname);
+}
+
+/*
+ * Set the "lnum" and "col" for the buffer "buf" and the current window.
+ * When "copy_options" is TRUE save the local window option values.
+ * When "lnum" is 0 only do the options.
+ */
+ static void
+buflist_setfpos(buf, win, lnum, col, copy_options)
+ buf_T *buf;
+ win_T *win;
+ linenr_T lnum;
+ colnr_T col;
+ int copy_options;
+{
+ wininfo_T *wip;
+
+ for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
+ if (wip->wi_win == win)
+ break;
+ if (wip == NULL)
+ {
+ /* allocate a new entry */
+ wip = (wininfo_T *)alloc_clear((unsigned)sizeof(wininfo_T));
+ if (wip == NULL)
+ return;
+ wip->wi_win = win;
+ if (lnum == 0) /* set lnum even when it's 0 */
+ lnum = 1;
+ }
+ else
+ {
+ /* remove the entry from the list */
+ if (wip->wi_prev)
+ wip->wi_prev->wi_next = wip->wi_next;
+ else
+ buf->b_wininfo = wip->wi_next;
+ if (wip->wi_next)
+ wip->wi_next->wi_prev = wip->wi_prev;
+ if (copy_options && wip->wi_optset)
+ {
+ clear_winopt(&wip->wi_opt);
+#ifdef FEAT_FOLDING
+ deleteFoldRecurse(&wip->wi_folds);
+#endif
+ }
+ }
+ if (lnum != 0)
+ {
+ wip->wi_fpos.lnum = lnum;
+ wip->wi_fpos.col = col;
+ }
+ if (copy_options)
+ {
+ /* Save the window-specific option values. */
+ copy_winopt(&win->w_onebuf_opt, &wip->wi_opt);
+#ifdef FEAT_FOLDING
+ wip->wi_fold_manual = win->w_fold_manual;
+ cloneFoldGrowArray(&win->w_folds, &wip->wi_folds);
+#endif
+ wip->wi_optset = TRUE;
+ }
+
+ /* insert the entry in front of the list */
+ wip->wi_next = buf->b_wininfo;
+ buf->b_wininfo = wip;
+ wip->wi_prev = NULL;
+ if (wip->wi_next)
+ wip->wi_next->wi_prev = wip;
+
+ return;
+}
+
+/*
+ * Find info for the current window in buffer "buf".
+ * If not found, return the info for the most recently used window.
+ * Returns NULL when there isn't any info.
+ */
+ static wininfo_T *
+find_wininfo(buf)
+ buf_T *buf;
+{
+ wininfo_T *wip;
+
+ for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
+ if (wip->wi_win == curwin)
+ break;
+ if (wip == NULL) /* if no fpos for curwin, use the first in the list */
+ wip = buf->b_wininfo;
+ return wip;
+}
+
+/*
+ * Reset the local window options to the values last used in this window.
+ * If the buffer wasn't used in this window before, use the values from
+ * the most recently used window. If the values were never set, use the
+ * global values for the window.
+ */
+ void
+get_winopts(buf)
+ buf_T *buf;
+{
+ wininfo_T *wip;
+
+ clear_winopt(&curwin->w_onebuf_opt);
+#ifdef FEAT_FOLDING
+ clearFolding(curwin);
+#endif
+
+ wip = find_wininfo(buf);
+ if (wip != NULL && wip->wi_optset)
+ {
+ copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
+#ifdef FEAT_FOLDING
+ curwin->w_fold_manual = wip->wi_fold_manual;
+ curwin->w_foldinvalid = TRUE;
+ cloneFoldGrowArray(&wip->wi_folds, &curwin->w_folds);
+#endif
+ }
+ else
+ copy_winopt(&curwin->w_allbuf_opt, &curwin->w_onebuf_opt);
+
+#ifdef FEAT_FOLDING
+ /* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */
+ if (p_fdls >= 0)
+ curwin->w_p_fdl = p_fdls;
+#endif
+}
+
+/*
+ * Find the position (lnum and col) for the buffer 'buf' for the current
+ * window.
+ * Returns a pointer to no_position if no position is found.
+ */
+ pos_T *
+buflist_findfpos(buf)
+ buf_T *buf;
+{
+ wininfo_T *wip;
+ static pos_T no_position = {1, 0};
+
+ wip = find_wininfo(buf);
+ if (wip != NULL)
+ return &(wip->wi_fpos);
+ else
+ return &no_position;
+}
+
+/*
+ * Find the lnum for the buffer 'buf' for the current window.
+ */
+ linenr_T
+buflist_findlnum(buf)
+ buf_T *buf;
+{
+ return buflist_findfpos(buf)->lnum;
+}
+
+#if defined(FEAT_LISTCMDS) || defined(PROTO)
+/*
+ * List all know file names (for :files and :buffers command).
+ */
+/*ARGSUSED*/
+ void
+buflist_list(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ int len;
+ int i;
+
+ for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
+ {
+ /* skip unlisted buffers, unless ! was used */
+ if (!buf->b_p_bl && !eap->forceit)
+ continue;
+ msg_putchar('\n');
+ if (buf_spname(buf) != NULL)
+ STRCPY(NameBuff, buf_spname(buf));
+ else
+ home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE);
+
+ sprintf((char *)IObuff, "%3d%c%c%c%c%c \"",
+ buf->b_fnum,
+ buf->b_p_bl ? ' ' : 'u',
+ buf == curbuf ? '%' :
+ (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
+ buf->b_ml.ml_mfp == NULL ? ' ' :
+ (buf->b_nwindows == 0 ? 'h' : 'a'),
+ !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '),
+ (buf->b_flags & BF_READERR) ? 'x'
+ : (bufIsChanged(buf) ? '+' : ' ')
+ );
+
+ len = (int)STRLEN(IObuff);
+ STRNCPY(IObuff + len, NameBuff, IOSIZE - 20 - len);
+ IObuff[IOSIZE - 20 - len] = NUL; /* make sure it's terminated */
+
+ len = (int)STRLEN(IObuff);
+ IObuff[len++] = '"';
+
+ /* put "line 999" in column 40 or after the file name */
+ IObuff[len] = NUL;
+ i = 40 - vim_strsize(IObuff);
+ do
+ {
+ IObuff[len++] = ' ';
+ } while (--i > 0 && len < IOSIZE - 18);
+ sprintf((char *)IObuff + len, _("line %ld"),
+ buf == curbuf ? curwin->w_cursor.lnum :
+ (long)buflist_findlnum(buf));
+ msg_outtrans(IObuff);
+ out_flush(); /* output one line at a time */
+ ui_breakcheck();
+ }
+}
+#endif
+
+/*
+ * Get file name and line number for file 'fnum'.
+ * Used by DoOneCmd() for translating '%' and '#'.
+ * Used by insert_reg() and cmdline_paste() for '#' register.
+ * Return FAIL if not found, OK for success.
+ */
+ int
+buflist_name_nr(fnum, fname, lnum)
+ int fnum;
+ char_u **fname;
+ linenr_T *lnum;
+{
+ buf_T *buf;
+
+ buf = buflist_findnr(fnum);
+ if (buf == NULL || buf->b_fname == NULL)
+ return FAIL;
+
+ *fname = buf->b_fname;
+ *lnum = buflist_findlnum(buf);
+
+ return OK;
+}
+
+/*
+ * Set the file name for "buf"' to 'ffname', short file name to 'sfname'.
+ * The file name with the full path is also remembered, for when :cd is used.
+ * Returns FAIL for failure (file name already in use by other buffer)
+ * OK otherwise.
+ */
+ int
+setfname(buf, ffname, sfname, message)
+ buf_T *buf;
+ char_u *ffname, *sfname;
+ int message;
+{
+ buf_T *obuf;
+#ifdef UNIX
+ struct stat st;
+#endif
+
+ if (ffname == NULL || *ffname == NUL)
+ {
+ /* Removing the name. */
+ vim_free(buf->b_ffname);
+ vim_free(buf->b_sfname);
+ buf->b_ffname = NULL;
+ buf->b_sfname = NULL;
+#ifdef UNIX
+ st.st_dev = (dev_T)-1;
+#endif
+ }
+ else
+ {
+ fname_expand(buf, &ffname, &sfname); /* will allocate ffname */
+ if (ffname == NULL) /* out of memory */
+ return FAIL;
+
+ /*
+ * if the file name is already used in another buffer:
+ * - if the buffer is loaded, fail
+ * - if the buffer is not loaded, delete it from the list
+ */
+#ifdef UNIX
+ if (mch_stat((char *)ffname, &st) < 0)
+ st.st_dev = (dev_T)-1;
+ obuf = buflist_findname_stat(ffname, &st);
+#else
+ obuf = buflist_findname(ffname);
+#endif
+ if (obuf != NULL && obuf != buf)
+ {
+ if (obuf->b_ml.ml_mfp != NULL) /* it's loaded, fail */
+ {
+ if (message)
+ EMSG(_("E95: Buffer with this name already exists"));
+ vim_free(ffname);
+ return FAIL;
+ }
+ close_buffer(NULL, obuf, DOBUF_WIPE); /* delete from the list */
+ }
+ sfname = vim_strsave(sfname);
+ if (ffname == NULL || sfname == NULL)
+ {
+ vim_free(sfname);
+ vim_free(ffname);
+ return FAIL;
+ }
+#ifdef USE_FNAME_CASE
+# ifdef USE_LONG_FNAME
+ if (USE_LONG_FNAME)
+# endif
+ fname_case(sfname, 0); /* set correct case for short file name */
+#endif
+ vim_free(buf->b_ffname);
+ vim_free(buf->b_sfname);
+ buf->b_ffname = ffname;
+ buf->b_sfname = sfname;
+ }
+ buf->b_fname = buf->b_sfname;
+#ifdef UNIX
+ if (st.st_dev == (dev_T)-1)
+ buf->b_dev = -1;
+ else
+ {
+ buf->b_dev = st.st_dev;
+ buf->b_ino = st.st_ino;
+ }
+#endif
+
+#ifndef SHORT_FNAME
+ buf->b_shortname = FALSE;
+#endif
+
+ buf_name_changed(buf);
+ return OK;
+}
+
+/*
+ * Take care of what needs to be done when the name of buffer "buf" has
+ * changed.
+ */
+ void
+buf_name_changed(buf)
+ buf_T *buf;
+{
+ /*
+ * If the file name changed, also change the name of the swapfile
+ */
+ if (buf->b_ml.ml_mfp != NULL)
+ ml_setname(buf);
+
+ if (curwin->w_buffer == buf)
+ check_arg_idx(curwin); /* check file name for arg list */
+#ifdef FEAT_TITLE
+ maketitle(); /* set window title */
+#endif
+#ifdef FEAT_WINDOWS
+ status_redraw_all(); /* status lines need to be redrawn */
+#endif
+ fmarks_check_names(buf); /* check named file marks */
+ ml_timestamp(buf); /* reset timestamp */
+}
+
+/*
+ * set alternate file name for current window
+ *
+ * Used by do_one_cmd(), do_write() and do_ecmd().
+ * Return the buffer.
+ */
+ buf_T *
+setaltfname(ffname, sfname, lnum)
+ char_u *ffname;
+ char_u *sfname;
+ linenr_T lnum;
+{
+ buf_T *buf;
+
+ /* Create a buffer. 'buflisted' is not set if it's a new buffer */
+ buf = buflist_new(ffname, sfname, lnum, 0);
+ if (buf != NULL)
+ curwin->w_alt_fnum = buf->b_fnum;
+ return buf;
+}
+
+/*
+ * Get alternate file name for current window.
+ * Return NULL if there isn't any, and give error message if requested.
+ */
+ char_u *
+getaltfname(errmsg)
+ int errmsg; /* give error message */
+{
+ char_u *fname;
+ linenr_T dummy;
+
+ if (buflist_name_nr(0, &fname, &dummy) == FAIL)
+ {
+ if (errmsg)
+ EMSG(_(e_noalt));
+ return NULL;
+ }
+ return fname;
+}
+
+/*
+ * Add a file name to the buflist and return its number.
+ * Uses same flags as buflist_new(), except BLN_DUMMY.
+ *
+ * used by qf_init(), main() and doarglist()
+ */
+ int
+buflist_add(fname, flags)
+ char_u *fname;
+ int flags;
+{
+ buf_T *buf;
+
+ buf = buflist_new(fname, NULL, (linenr_T)0, flags);
+ if (buf != NULL)
+ return buf->b_fnum;
+ return 0;
+}
+
+#if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
+/*
+ * Adjust slashes in file names. Called after 'shellslash' was set.
+ */
+ void
+buflist_slash_adjust()
+{
+ buf_T *bp;
+
+ for (bp = firstbuf; bp != NULL; bp = bp->b_next)
+ {
+ if (bp->b_ffname != NULL)
+ slash_adjust(bp->b_ffname);
+ if (bp->b_sfname != NULL)
+ slash_adjust(bp->b_sfname);
+ }
+}
+#endif
+
+/*
+ * Set alternate cursor position for current window.
+ * Also save the local window option values.
+ */
+ void
+buflist_altfpos()
+{
+ buflist_setfpos(curbuf, curwin, curwin->w_cursor.lnum,
+ curwin->w_cursor.col, TRUE);
+}
+
+/*
+ * Return TRUE if 'ffname' is not the same file as current file.
+ * Fname must have a full path (expanded by mch_FullName()).
+ */
+ int
+otherfile(ffname)
+ char_u *ffname;
+{
+ return otherfile_buf(curbuf, ffname
+#ifdef UNIX
+ , NULL
+#endif
+ );
+}
+
+ static int
+otherfile_buf(buf, ffname
+#ifdef UNIX
+ , stp
+#endif
+ )
+ buf_T *buf;
+ char_u *ffname;
+#ifdef UNIX
+ struct stat *stp;
+#endif
+{
+ /* no name is different */
+ if (ffname == NULL || *ffname == NUL || buf->b_ffname == NULL)
+ return TRUE;
+ if (fnamecmp(ffname, buf->b_ffname) == 0)
+ return FALSE;
+#ifdef UNIX
+ {
+ struct stat st;
+
+ /* If no struct stat given, get it now */
+ if (stp == NULL)
+ {
+ if (buf->b_dev < 0 || mch_stat((char *)ffname, &st) < 0)
+ st.st_dev = (dev_T)-1;
+ stp = &st;
+ }
+ /* Use dev/ino to check if the files are the same, even when the names
+ * are different (possible with links). Still need to compare the
+ * name above, for when the file doesn't exist yet.
+ * Problem: The dev/ino changes when a file is deleted (and created
+ * again) and remains the same when renamed/moved. We don't want to
+ * mch_stat() each buffer each time, that would be too slow. Get the
+ * dev/ino again when they appear to match, but not when they appear
+ * to be different: Could skip a buffer when it's actually the same
+ * file. */
+ if (buf_same_ino(buf, stp))
+ {
+ buf_setino(buf);
+ if (buf_same_ino(buf, stp))
+ return FALSE;
+ }
+ }
+#endif
+ return TRUE;
+}
+
+#if defined(UNIX) || defined(PROTO)
+/*
+ * Set inode and device number for a buffer.
+ * Must always be called when b_fname is changed!.
+ */
+ void
+buf_setino(buf)
+ buf_T *buf;
+{
+ struct stat st;
+
+ if (buf->b_fname != NULL && mch_stat((char *)buf->b_fname, &st) >= 0)
+ {
+ buf->b_dev = st.st_dev;
+ buf->b_ino = st.st_ino;
+ }
+ else
+ buf->b_dev = -1;
+}
+
+/*
+ * Return TRUE if dev/ino in buffer "buf" matches with "stp".
+ */
+ static int
+buf_same_ino(buf, stp)
+ buf_T *buf;
+ struct stat *stp;
+{
+ return (buf->b_dev >= 0
+ && stp->st_dev == buf->b_dev
+ && stp->st_ino == buf->b_ino);
+}
+#endif
+
+ void
+fileinfo(fullname, shorthelp, dont_truncate)
+ int fullname;
+ int shorthelp;
+ int dont_truncate;
+{
+ char_u *name;
+ int n;
+ char_u *p;
+ char_u *buffer;
+
+ buffer = alloc(IOSIZE);
+ if (buffer == NULL)
+ return;
+
+ if (fullname > 1) /* 2 CTRL-G: include buffer number */
+ {
+ sprintf((char *)buffer, "buf %d: ", curbuf->b_fnum);
+ p = buffer + STRLEN(buffer);
+ }
+ else
+ p = buffer;
+
+ *p++ = '"';
+ if (buf_spname(curbuf) != NULL)
+ STRCPY(p, buf_spname(curbuf));
+ else
+ {
+ if (!fullname && curbuf->b_fname != NULL)
+ name = curbuf->b_fname;
+ else
+ name = curbuf->b_ffname;
+ home_replace(shorthelp ? curbuf : NULL, name, p,
+ (int)(IOSIZE - (p - buffer)), TRUE);
+ }
+
+ sprintf((char *)buffer + STRLEN(buffer),
+ "\"%s%s%s%s%s%s",
+ curbufIsChanged() ? (shortmess(SHM_MOD)
+ ? " [+]" : _(" [Modified]")) : " ",
+ (curbuf->b_flags & BF_NOTEDITED)
+#ifdef FEAT_QUICKFIX
+ && !bt_dontwrite(curbuf)
+#endif
+ ? _("[Not edited]") : "",
+ (curbuf->b_flags & BF_NEW)
+#ifdef FEAT_QUICKFIX
+ && !bt_dontwrite(curbuf)
+#endif
+ ? _("[New file]") : "",
+ (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "",
+ curbuf->b_p_ro ? (shortmess(SHM_RO) ? "[RO]"
+ : _("[readonly]")) : "",
+ (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK)
+ || curbuf->b_p_ro) ?
+ " " : "");
+ /* With 32 bit longs and more than 21,474,836 lines multiplying by 100
+ * causes an overflow, thus for large numbers divide instead. */
+ if (curwin->w_cursor.lnum > 1000000L)
+ n = (int)(((long)curwin->w_cursor.lnum) /
+ ((long)curbuf->b_ml.ml_line_count / 100L));
+ else
+ n = (int)(((long)curwin->w_cursor.lnum * 100L) /
+ (long)curbuf->b_ml.ml_line_count);
+ if (curbuf->b_ml.ml_flags & ML_EMPTY)
+ {
+ STRCPY(buffer + STRLEN(buffer), _(no_lines_msg));
+ }
+#ifdef FEAT_CMDL_INFO
+ else if (p_ru)
+ {
+ /* Current line and column are already on the screen -- webb */
+ if (curbuf->b_ml.ml_line_count == 1)
+ sprintf((char *)buffer + STRLEN(buffer), _("1 line --%d%%--"), n);
+ else
+ sprintf((char *)buffer + STRLEN(buffer), _("%ld lines --%d%%--"),
+ (long)curbuf->b_ml.ml_line_count, n);
+ }
+#endif
+ else
+ {
+ sprintf((char *)buffer + STRLEN(buffer),
+ _("line %ld of %ld --%d%%-- col "),
+ (long)curwin->w_cursor.lnum,
+ (long)curbuf->b_ml.ml_line_count,
+ n);
+ validate_virtcol();
+ col_print(buffer + STRLEN(buffer),
+ (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1);
+ }
+
+ (void)append_arg_number(curwin, buffer, !shortmess(SHM_FILE), IOSIZE);
+
+ if (dont_truncate)
+ {
+ /* Temporarily set msg_scroll to avoid the message being truncated.
+ * First call msg_start() to get the message in the right place. */
+ msg_start();
+ n = msg_scroll;
+ msg_scroll = TRUE;
+ msg(buffer);
+ msg_scroll = n;
+ }
+ else
+ {
+ p = msg_trunc_attr(buffer, FALSE, 0);
+ if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
+ {
+ /* Need to repeat the message after redrawing when:
+ * - When restart_edit is set (otherwise there will be a delay
+ * before redrawing).
+ * - When the screen was scrolled but there is no wait-return
+ * prompt. */
+ set_keep_msg(p);
+ keep_msg_attr = 0;
+ }
+ }
+
+ vim_free(buffer);
+}
+
+ void
+col_print(buf, col, vcol)
+ char_u *buf;
+ int col;
+ int vcol;
+{
+ if (col == vcol)
+ sprintf((char *)buf, "%d", col);
+ else
+ sprintf((char *)buf, "%d-%d", col, vcol);
+}
+
+#if defined(FEAT_TITLE) || defined(PROTO)
+/*
+ * put file name in title bar of window and in icon title
+ */
+
+static char_u *lasttitle = NULL;
+static char_u *lasticon = NULL;
+
+ void
+maketitle()
+{
+ char_u *p;
+ char_u *t_str = NULL;
+ char_u *i_name;
+ char_u *i_str = NULL;
+ int maxlen = 0;
+ int len;
+ int mustset;
+ char_u buf[IOSIZE];
+ int off;
+
+ if (!redrawing())
+ {
+ /* Postpone updating the title when 'lazyredraw' is set. */
+ need_maketitle = TRUE;
+ return;
+ }
+
+ need_maketitle = FALSE;
+ if (!p_title && !p_icon)
+ return;
+
+ if (p_title)
+ {
+ if (p_titlelen > 0)
+ {
+ maxlen = p_titlelen * Columns / 100;
+ if (maxlen < 10)
+ maxlen = 10;
+ }
+
+ t_str = buf;
+ if (*p_titlestring != NUL)
+ {
+#ifdef FEAT_STL_OPT
+ if (stl_syntax & STL_IN_TITLE)
+ build_stl_str_hl(curwin, t_str, sizeof(buf),
+ p_titlestring, 0, maxlen, NULL);
+ else
+#endif
+ t_str = p_titlestring;
+ }
+ else
+ {
+ /* format: "fname + (path) (1 of 2) - VIM" */
+
+ if (curbuf->b_fname == NULL)
+ STRCPY(buf, _("[No file]"));
+ else
+ {
+ p = transstr(gettail(curbuf->b_fname));
+ STRNCPY(buf, p, IOSIZE - 100);
+ vim_free(p);
+ buf[IOSIZE - 100] = NUL; /* in case it was too long */
+ }
+
+ switch (bufIsChanged(curbuf)
+ + (curbuf->b_p_ro * 2)
+ + (!curbuf->b_p_ma * 4))
+ {
+ case 1: STRCAT(buf, " +"); break;
+ case 2: STRCAT(buf, " ="); break;
+ case 3: STRCAT(buf, " =+"); break;
+ case 4:
+ case 6: STRCAT(buf, " -"); break;
+ case 5:
+ case 7: STRCAT(buf, " -+"); break;
+ }
+
+ if (curbuf->b_fname != NULL)
+ {
+ /* Get path of file, replace home dir with ~ */
+ off = (int)STRLEN(buf);
+ buf[off++] = ' ';
+ buf[off++] = '(';
+ home_replace(curbuf, curbuf->b_ffname,
+ buf + off, IOSIZE - off, TRUE);
+#ifdef BACKSLASH_IN_FILENAME
+ /* avoid "c:/name" to be reduced to "c" */
+ if (isalpha(buf[off]) && buf[off + 1] == ':')
+ off += 2;
+#endif
+ /* remove the file name */
+ p = gettail(buf + off);
+ if (p == buf + off)
+ {
+ /* must be a help buffer */
+ STRCPY(buf + off, _("help"));
+ }
+ else
+ {
+ while (p > buf + off + 1 && vim_ispathsep(p[-1]))
+ --p;
+#ifdef VMS
+ /* path separator is part of the path */
+ ++p;
+#endif
+ *p = NUL;
+ }
+ /* translate unprintable chars */
+ p = transstr(buf + off);
+ STRNCPY(buf + off, p, IOSIZE - off);
+ vim_free(p);
+ buf[IOSIZE - 1] = NUL; /* in case it was too long */
+ STRCAT(buf, ")");
+ }
+
+ append_arg_number(curwin, buf, FALSE, IOSIZE);
+
+#if defined(FEAT_CLIENTSERVER)
+ if (serverName != NULL)
+ {
+ STRCAT(buf, " - ");
+ STRCAT(buf, serverName);
+ }
+ else
+#endif
+ STRCAT(buf, " - VIM");
+
+ if (maxlen > 0)
+ {
+ /* make it shorter by removing a bit in the middle */
+ len = vim_strsize(buf);
+ if (len > maxlen)
+ trunc_string(buf, buf, maxlen);
+ }
+ }
+ }
+ mustset = ti_change(t_str, &lasttitle);
+
+ if (p_icon)
+ {
+ i_str = buf;
+ if (*p_iconstring != NUL)
+ {
+#ifdef FEAT_STL_OPT
+ if (stl_syntax & STL_IN_ICON)
+ build_stl_str_hl(curwin, i_str, sizeof(buf),
+ p_iconstring, 0, 0, NULL);
+ else
+#endif
+ i_str = p_iconstring;
+ }
+ else
+ {
+ if (buf_spname(curbuf) != NULL)
+ i_name = (char_u *)buf_spname(curbuf);
+ else /* use file name only in icon */
+ i_name = gettail(curbuf->b_ffname);
+ *i_str = NUL;
+ /* Truncate name at 100 bytes. */
+ len = STRLEN(i_name);
+ if (len > 100)
+ {
+ len -= 100;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ len += (*mb_tail_off)(i_name, i_name + len) + 1;
+#endif
+ i_name += len;
+ }
+ STRCPY(i_str, i_name);
+ trans_characters(i_str, IOSIZE);
+ }
+ }
+
+ mustset |= ti_change(i_str, &lasticon);
+
+ if (mustset)
+ resettitle();
+}
+
+/*
+ * Used for title and icon: Check if "str" differs from "*last". Set "*last"
+ * from "str" if it does.
+ * Return TRUE when "*last" changed.
+ */
+ static int
+ti_change(str, last)
+ char_u *str;
+ char_u **last;
+{
+ if ((str == NULL) != (*last == NULL)
+ || (str != NULL && *last != NULL && STRCMP(str, *last) != 0))
+ {
+ vim_free(*last);
+ if (str == NULL)
+ *last = NULL;
+ else
+ *last = vim_strsave(str);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Put current window title back (used after calling a shell)
+ */
+ void
+resettitle()
+{
+ mch_settitle(lasttitle, lasticon);
+}
+#endif /* FEAT_TITLE */
+
+#if defined(FEAT_STL_OPT) || defined(PROTO)
+/*
+ * Build a string from the status line items in fmt.
+ * Return length of string in screen cells.
+ *
+ * Items are drawn interspersed with the text that surrounds it
+ * Specials: %-<wid>(xxx%) => group, %= => middle marker, %< => truncation
+ * Item: %-<minwid>.<maxwid><itemch> All but <itemch> are optional
+ *
+ * If maxwidth is not zero, the string will be filled at any middle marker
+ * or truncated if too long, fillchar is used for all whitespace.
+ */
+ int
+build_stl_str_hl(wp, out, outlen, fmt, fillchar, maxwidth, hl)
+ win_T *wp;
+ char_u *out; /* buffer to write into */
+ size_t outlen; /* length of out[] */
+ char_u *fmt;
+ int fillchar;
+ int maxwidth;
+ struct stl_hlrec *hl;
+{
+ char_u *p;
+ char_u *s;
+ char_u *t;
+ char_u *linecont;
+#ifdef FEAT_EVAL
+ win_T *o_curwin;
+ buf_T *o_curbuf;
+#endif
+ int empty_line;
+ colnr_T virtcol;
+ long l;
+ long n;
+ int prevchar_isflag;
+ int prevchar_isitem;
+ int itemisflag;
+ int fillable;
+ char_u *str;
+ long num;
+ int width;
+ int itemcnt;
+ int curitem;
+ int groupitem[STL_MAX_ITEM];
+ int groupdepth;
+ struct stl_item
+ {
+ char_u *start;
+ int minwid;
+ int maxwid;
+ enum
+ {
+ Normal,
+ Empty,
+ Group,
+ Middle,
+ Highlight,
+ Trunc
+ } type;
+ } item[STL_MAX_ITEM];
+ int minwid;
+ int maxwid;
+ int zeropad;
+ char_u base;
+ char_u opt;
+#define TMPLEN 70
+ char_u tmp[TMPLEN];
+
+ if (fillchar == 0)
+ fillchar = ' ';
+ /*
+ * Get line & check if empty (cursorpos will show "0-1").
+ * If inversion is possible we use it. Else '=' characters are used.
+ */
+ linecont = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE);
+ empty_line = (*linecont == NUL);
+
+ groupdepth = 0;
+ p = out;
+ curitem = 0;
+ prevchar_isflag = TRUE;
+ prevchar_isitem = FALSE;
+ for (s = fmt; *s;)
+ {
+ if (*s != NUL && *s != '%')
+ prevchar_isflag = prevchar_isitem = FALSE;
+
+ /*
+ * Handle up to the next '%' or the end.
+ */
+ while (*s != NUL && *s != '%' && p + 1 < out + outlen)
+ *p++ = *s++;
+ if (*s == NUL || p + 1 >= out + outlen)
+ break;
+
+ /*
+ * Handle one '%' item.
+ */
+ s++;
+ if (*s == '%')
+ {
+ if (p + 1 >= out + outlen)
+ break;
+ *p++ = *s++;
+ prevchar_isflag = prevchar_isitem = FALSE;
+ continue;
+ }
+ if (*s == STL_MIDDLEMARK)
+ {
+ s++;
+ if (groupdepth > 0)
+ continue;
+ item[curitem].type = Middle;
+ item[curitem++].start = p;
+ continue;
+ }
+ if (*s == STL_TRUNCMARK)
+ {
+ s++;
+ item[curitem].type = Trunc;
+ item[curitem++].start = p;
+ continue;
+ }
+ if (*s == ')')
+ {
+ s++;
+ if (groupdepth < 1)
+ continue;
+ groupdepth--;
+
+ t = item[groupitem[groupdepth]].start;
+ *p = NUL;
+ l = vim_strsize(t);
+ if (curitem > groupitem[groupdepth] + 1
+ && item[groupitem[groupdepth]].minwid == 0)
+ {
+ /* remove group if all items are empty */
+ for (n = groupitem[groupdepth] + 1; n < curitem; n++)
+ if (item[n].type == Normal)
+ break;
+ if (n == curitem)
+ {
+ p = t;
+ l = 0;
+ }
+ }
+ if (l > item[groupitem[groupdepth]].maxwid)
+ {
+ /* truncate, remove n bytes of text at the start */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Find the first character that should be included. */
+ n = 0;
+ while (l >= item[groupitem[groupdepth]].maxwid)
+ {
+ l -= ptr2cells(t + n);
+ n += (*mb_ptr2len_check)(t + n);
+ }
+ }
+ else
+#endif
+ n = (p - t) - item[groupitem[groupdepth]].maxwid + 1;
+
+ *t = '<';
+ mch_memmove(t + 1, t + n, p - (t + n));
+ p = p - n + 1;
+#ifdef FEAT_MBYTE
+ /* Fill up space left over by half a double-wide char. */
+ while (++l < item[groupitem[groupdepth]].minwid)
+ *p++ = fillchar;
+#endif
+
+ /* correct the start of the items for the truncation */
+ for (l = groupitem[groupdepth] + 1; l < curitem; l++)
+ {
+ item[l].start -= n;
+ if (item[l].start < t)
+ item[l].start = t;
+ }
+ }
+ else if (abs(item[groupitem[groupdepth]].minwid) > l)
+ {
+ /* fill */
+ n = item[groupitem[groupdepth]].minwid;
+ if (n < 0)
+ {
+ /* fill by appending characters */
+ n = 0 - n;
+ while (l++ < n && p + 1 < out + outlen)
+ *p++ = fillchar;
+ }
+ else
+ {
+ /* fill by inserting characters */
+ mch_memmove(t + n - l, t, p - t);
+ l = n - l;
+ if (p + l >= out + outlen)
+ l = (out + outlen) - p - 1;
+ p += l;
+ for (n = groupitem[groupdepth] + 1; n < curitem; n++)
+ item[n].start += l;
+ for ( ; l > 0; l--)
+ *t++ = fillchar;
+ }
+ }
+ continue;
+ }
+ minwid = 0;
+ maxwid = 9999;
+ zeropad = FALSE;
+ l = 1;
+ if (*s == '0')
+ {
+ s++;
+ zeropad = TRUE;
+ }
+ if (*s == '-')
+ {
+ s++;
+ l = -1;
+ }
+ if (VIM_ISDIGIT(*s))
+ {
+ minwid = (int)getdigits(&s);
+ if (minwid < 0) /* overflow */
+ minwid = 0;
+ }
+ if (*s == STL_HIGHLIGHT)
+ {
+ item[curitem].type = Highlight;
+ item[curitem].start = p;
+ item[curitem].minwid = minwid > 9 ? 1 : minwid;
+ s++;
+ curitem++;
+ continue;
+ }
+ if (*s == '.')
+ {
+ s++;
+ if (VIM_ISDIGIT(*s))
+ {
+ maxwid = (int)getdigits(&s);
+ if (maxwid <= 0) /* overflow */
+ maxwid = 50;
+ }
+ }
+ minwid = (minwid > 50 ? 50 : minwid) * l;
+ if (*s == '(')
+ {
+ groupitem[groupdepth++] = curitem;
+ item[curitem].type = Group;
+ item[curitem].start = p;
+ item[curitem].minwid = minwid;
+ item[curitem].maxwid = maxwid;
+ s++;
+ curitem++;
+ continue;
+ }
+ if (vim_strchr(STL_ALL, *s) == NULL)
+ {
+ s++;
+ continue;
+ }
+ opt = *s++;
+
+ /* OK - now for the real work */
+ base = 'D';
+ itemisflag = FALSE;
+ fillable = TRUE;
+ num = -1;
+ str = NULL;
+ switch (opt)
+ {
+ case STL_FILEPATH:
+ case STL_FULLPATH:
+ case STL_FILENAME:
+ fillable = FALSE; /* don't change ' ' to fillchar */
+ if (buf_spname(wp->w_buffer) != NULL)
+ STRCPY(NameBuff, buf_spname(wp->w_buffer));
+ else
+ {
+ t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname
+ : wp->w_buffer->b_fname;
+ home_replace(wp->w_buffer, t, NameBuff, MAXPATHL, TRUE);
+ }
+ trans_characters(NameBuff, MAXPATHL);
+ if (opt != STL_FILENAME)
+ str = NameBuff;
+ else
+ str = gettail(NameBuff);
+ break;
+
+ case STL_VIM_EXPR: /* '{' */
+ itemisflag = TRUE;
+ t = p;
+ while (*s != '}' && *s != NUL && p + 1 < out + outlen)
+ *p++ = *s++;
+ if (*s != '}') /* missing '}' or out of space */
+ break;
+ s++;
+ *p = 0;
+ p = t;
+
+#ifdef FEAT_EVAL
+ sprintf((char *)tmp, "%d", curbuf->b_fnum);
+ set_internal_string_var((char_u *)"actual_curbuf", tmp);
+
+ o_curbuf = curbuf;
+ o_curwin = curwin;
+ curwin = wp;
+ curbuf = wp->w_buffer;
+
+ str = eval_to_string_safe(p, &t);
+
+ curwin = o_curwin;
+ curbuf = o_curbuf;
+ do_unlet((char_u *)"g:actual_curbuf");
+
+ if (str != NULL && *str != 0)
+ {
+ if (*skipdigits(str) == NUL)
+ {
+ num = atoi((char *)str);
+ vim_free(str);
+ str = NULL;
+ itemisflag = FALSE;
+ }
+ }
+#endif
+ break;
+
+ case STL_LINE:
+ num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY)
+ ? 0L : (long)(wp->w_cursor.lnum);
+ break;
+
+ case STL_NUMLINES:
+ num = wp->w_buffer->b_ml.ml_line_count;
+ break;
+
+ case STL_COLUMN:
+ num = !(State & INSERT) && empty_line
+ ? 0 : (int)wp->w_cursor.col + 1;
+ break;
+
+ case STL_VIRTCOL:
+ case STL_VIRTCOL_ALT:
+ /* In list mode virtcol needs to be recomputed */
+ virtcol = wp->w_virtcol;
+ if (wp->w_p_list && lcs_tab1 == NUL)
+ {
+ wp->w_p_list = FALSE;
+ getvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);
+ wp->w_p_list = TRUE;
+ }
+ ++virtcol;
+ /* Don't display %V if it's the same as %c. */
+ if (opt == STL_VIRTCOL_ALT
+ && (virtcol == (colnr_T)(!(State & INSERT) && empty_line
+ ? 0 : (int)wp->w_cursor.col + 1)))
+ break;
+ num = (long)virtcol;
+ break;
+
+ case STL_PERCENTAGE:
+ num = (int)(((long)wp->w_cursor.lnum * 100L) /
+ (long)wp->w_buffer->b_ml.ml_line_count);
+ break;
+
+ case STL_ALTPERCENT:
+ str = tmp;
+ get_rel_pos(wp, str);
+ break;
+
+ case STL_ARGLISTSTAT:
+ fillable = FALSE;
+ tmp[0] = 0;
+ if (append_arg_number(wp, tmp, FALSE, (int)sizeof(tmp)))
+ str = tmp;
+ break;
+
+ case STL_KEYMAP:
+ fillable = FALSE;
+ if (get_keymap_str(wp, tmp, TMPLEN))
+ str = tmp;
+ break;
+ case STL_PAGENUM:
+#ifdef FEAT_PRINTER
+ num = get_printer_page_num();
+#else
+ num = 0;
+#endif
+ break;
+
+ case STL_BUFNO:
+ num = wp->w_buffer->b_fnum;
+ break;
+
+ case STL_OFFSET_X:
+ base = 'X';
+ case STL_OFFSET:
+#ifdef FEAT_BYTEOFF
+ l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
+ num = (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) || l < 0 ?
+ 0L : l + 1 + (!(State & INSERT) && empty_line ?
+ 0 : (int)wp->w_cursor.col);
+#endif
+ break;
+
+ case STL_BYTEVAL_X:
+ base = 'X';
+ case STL_BYTEVAL:
+ if (((State & INSERT) && wp == curwin) || empty_line)
+ num = 0;
+ else
+ {
+#ifdef FEAT_MBYTE
+ num = (*mb_ptr2char)(linecont + wp->w_cursor.col);
+#else
+ num = linecont[wp->w_cursor.col];
+#endif
+ }
+ if (num == NL)
+ num = 0;
+ else if (num == CAR && get_fileformat(wp->w_buffer) == EOL_MAC)
+ num = NL;
+ break;
+
+ case STL_ROFLAG:
+ case STL_ROFLAG_ALT:
+ itemisflag = TRUE;
+ if (wp->w_buffer->b_p_ro)
+ str = (char_u *)((opt == STL_ROFLAG_ALT) ? ",RO" : "[RO]");
+ break;
+
+ case STL_HELPFLAG:
+ case STL_HELPFLAG_ALT:
+ itemisflag = TRUE;
+ if (wp->w_buffer->b_help)
+ str = (char_u *)((opt == STL_HELPFLAG_ALT) ? ",HLP"
+ : _("[help]"));
+ break;
+
+#ifdef FEAT_AUTOCMD
+ case STL_FILETYPE:
+ if (*wp->w_buffer->b_p_ft != NUL
+ && STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 3)
+ {
+ sprintf((char *)tmp, "[%s]", wp->w_buffer->b_p_ft);
+ str = tmp;
+ }
+ break;
+
+ case STL_FILETYPE_ALT:
+ itemisflag = TRUE;
+ if (*wp->w_buffer->b_p_ft != NUL
+ && STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 2)
+ {
+ sprintf((char *)tmp, ",%s", wp->w_buffer->b_p_ft);
+ for (t = tmp; *t != 0; t++)
+ *t = TOUPPER_LOC(*t);
+ str = tmp;
+ }
+ break;
+#endif
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ case STL_PREVIEWFLAG:
+ case STL_PREVIEWFLAG_ALT:
+ itemisflag = TRUE;
+ if (wp->w_p_pvw)
+ str = (char_u *)((opt == STL_PREVIEWFLAG_ALT) ? ",PRV"
+ : _("[Preview]"));
+ break;
+#endif
+
+ case STL_MODIFIED:
+ case STL_MODIFIED_ALT:
+ itemisflag = TRUE;
+ switch ((opt == STL_MODIFIED_ALT)
+ + bufIsChanged(wp->w_buffer) * 2
+ + (!wp->w_buffer->b_p_ma) * 4)
+ {
+ case 2: str = (char_u *)"[+]"; break;
+ case 3: str = (char_u *)",+"; break;
+ case 4: str = (char_u *)"[-]"; break;
+ case 5: str = (char_u *)",-"; break;
+ case 6: str = (char_u *)"[+-]"; break;
+ case 7: str = (char_u *)",+-"; break;
+ }
+ break;
+ }
+
+ item[curitem].start = p;
+ item[curitem].type = Normal;
+ if (str != NULL && *str)
+ {
+ t = str;
+ if (itemisflag)
+ {
+ if ((t[0] && t[1])
+ && ((!prevchar_isitem && *t == ',')
+ || (prevchar_isflag && *t == ' ')))
+ t++;
+ prevchar_isflag = TRUE;
+ }
+ l = vim_strsize(t);
+ if (l > 0)
+ prevchar_isitem = TRUE;
+ if (l > maxwid)
+ {
+ while (l >= maxwid)
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ l -= ptr2cells(t);
+ t += (*mb_ptr2len_check)(t);
+ }
+ else
+#endif
+ l -= byte2cells(*t++);
+ if (p + 1 >= out + outlen)
+ break;
+ *p++ = '<';
+ }
+ if (minwid > 0)
+ {
+ for (; l < minwid && p + 1 < out + outlen; l++)
+ {
+ /* Don't put a "-" in front of a digit. */
+ if (l + 1 == minwid && fillchar == '-' && VIM_ISDIGIT(*t))
+ *p++ = ' ';
+ else
+ *p++ = fillchar;
+ }
+ minwid = 0;
+ }
+ else
+ minwid *= -1;
+ while (*t && p + 1 < out + outlen)
+ {
+ *p++ = *t++;
+ /* Change a space by fillchar, unless fillchar is '-' and a
+ * digit follows. */
+ if (fillable && p[-1] == ' '
+ && (!VIM_ISDIGIT(*t) || fillchar != '-'))
+ p[-1] = fillchar;
+ }
+ for (; l < minwid && p + 1 < out + outlen; l++)
+ *p++ = fillchar;
+ }
+ else if (num >= 0)
+ {
+ int nbase = (base == 'D' ? 10 : (base == 'O' ? 8 : 16));
+ char_u nstr[20];
+
+ if (p + 20 >= out + outlen)
+ break; /* not sufficient space */
+ prevchar_isitem = TRUE;
+ t = nstr;
+ if (opt == STL_VIRTCOL_ALT)
+ {
+ *t++ = '-';
+ minwid--;
+ }
+ *t++ = '%';
+ if (zeropad)
+ *t++ = '0';
+ *t++ = '*';
+ *t++ = nbase == 16 ? base : (nbase == 8 ? 'o' : 'd');
+ *t = 0;
+
+ for (n = num, l = 1; n >= nbase; n /= nbase)
+ l++;
+ if (opt == STL_VIRTCOL_ALT)
+ l++;
+ if (l > maxwid)
+ {
+ l += 2;
+ n = l - maxwid;
+ while (l-- > maxwid)
+ num /= nbase;
+ *t++ = '>';
+ *t++ = '%';
+ *t = t[-3];
+ *++t = 0;
+ sprintf((char *)p, (char *)nstr, 0, num, n);
+ }
+ else
+ sprintf((char *)p, (char *)nstr, minwid, num);
+ p += STRLEN(p);
+ }
+ else
+ item[curitem].type = Empty;
+
+ if (opt == STL_VIM_EXPR)
+ vim_free(str);
+
+ if (num >= 0 || (!itemisflag && str && *str))
+ prevchar_isflag = FALSE; /* Item not NULL, but not a flag */
+ curitem++;
+ }
+ *p = NUL;
+ itemcnt = curitem;
+
+ width = vim_strsize(out);
+ if (maxwidth > 0 && width > maxwidth)
+ {
+ /* Result is too long, must trunctate somewhere. */
+ l = 0;
+ if (itemcnt == 0)
+ s = out;
+ else
+ {
+ for ( ; l < itemcnt; l++)
+ if (item[l].type == Trunc)
+ {
+ /* Truncate at %< item. */
+ s = item[l].start;
+ break;
+ }
+ if (l == itemcnt)
+ {
+ /* No %< item, truncate first item. */
+ s = item[0].start;
+ l = 0;
+ }
+ }
+
+ if (width - vim_strsize(s) >= maxwidth)
+ {
+ /* Truncation mark is beyond max length */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ s = out;
+ width = 0;
+ for (;;)
+ {
+ width += ptr2cells(s);
+ if (width >= maxwidth)
+ break;
+ s += (*mb_ptr2len_check)(s);
+ }
+ /* Fill up for half a double-wide character. */
+ while (++width < maxwidth)
+ *s++ = fillchar;
+ }
+ else
+#endif
+ s = out + maxwidth - 1;
+ for (l = 0; l < itemcnt; l++)
+ if (item[l].start > s)
+ break;
+ itemcnt = l;
+ *s++ = '>';
+ *s = 0;
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ n = 0;
+ while (width >= maxwidth)
+ {
+ width -= ptr2cells(s + n);
+ n += (*mb_ptr2len_check)(s + n);
+ }
+ }
+ else
+#endif
+ n = width - maxwidth + 1;
+ p = s + n;
+ mch_memmove(s + 1, p, STRLEN(p) + 1);
+ *s = '<';
+
+ /* Fill up for half a double-wide character. */
+ while (++width < maxwidth)
+ {
+ s = s + STRLEN(s);
+ *s++ = fillchar;
+ *s = NUL;
+ }
+
+ --n; /* count the '<' */
+ for (; l < itemcnt; l++)
+ {
+ if (item[l].start - n >= s)
+ item[l].start -= n;
+ else
+ item[l].start = s;
+ }
+ }
+ width = maxwidth;
+ }
+ else if (width < maxwidth && STRLEN(out) + maxwidth - width + 1 < outlen)
+ {
+ /* Apply STL_MIDDLE if any */
+ for (l = 0; l < itemcnt; l++)
+ if (item[l].type == Middle)
+ break;
+ if (l < itemcnt)
+ {
+ p = item[l].start + maxwidth - width;
+ mch_memmove(p, item[l].start, STRLEN(item[l].start) + 1);
+ for (s = item[l].start; s < p; s++)
+ *s = fillchar;
+ for (l++; l < itemcnt; l++)
+ item[l].start += maxwidth - width;
+ width = maxwidth;
+ }
+ }
+
+ if (hl != NULL)
+ {
+ for (l = 0; l < itemcnt; l++)
+ {
+ if (item[l].type == Highlight)
+ {
+ hl->start = item[l].start;
+ hl->userhl = item[l].minwid;
+ hl++;
+ }
+ }
+ hl->start = NULL;
+ hl->userhl = 0;
+ }
+
+ return width;
+}
+#endif /* FEAT_STL_OPT */
+
+#if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) || defined(PROTO)
+/*
+ * Get relative cursor position in window, in the form 99%, using "Top", "Bot"
+ * or "All" when appropriate.
+ */
+ void
+get_rel_pos(wp, str)
+ win_T *wp;
+ char_u *str;
+{
+ long above; /* number of lines above window */
+ long below; /* number of lines below window */
+
+ above = wp->w_topline - 1;
+#ifdef FEAT_DIFF
+ above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill;
+#endif
+ below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1;
+ if (below <= 0)
+ STRCPY(str, above == 0 ? _("All") : _("Bot"));
+ else if (above <= 0)
+ STRCPY(str, _("Top"));
+ else
+ sprintf((char *)str, "%2d%%", above > 1000000L
+ ? (int)(above / ((above + below) / 100L))
+ : (int)(above * 100L / (above + below)));
+}
+#endif
+
+/*
+ * Append (file 2 of 8) to 'buf', if editing more than one file.
+ * Return TRUE if it was appended.
+ */
+ int
+append_arg_number(wp, buf, add_file, maxlen)
+ win_T *wp;
+ char_u *buf;
+ int add_file; /* Add "file" before the arg number */
+ int maxlen; /* maximum nr of chars in buf or zero*/
+{
+ char_u *p;
+
+ if (ARGCOUNT <= 1) /* nothing to do */
+ return FALSE;
+
+ p = buf + STRLEN(buf); /* go to the end of the buffer */
+ if (maxlen && p - buf + 35 >= maxlen) /* getting too long */
+ return FALSE;
+ *p++ = ' ';
+ *p++ = '(';
+ if (add_file)
+ {
+ STRCPY(p, "file ");
+ p += 5;
+ }
+ sprintf((char *)p, wp->w_arg_idx_invalid ? "(%d) of %d)"
+ : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT);
+ return TRUE;
+}
+
+/*
+ * If fname is not a full path, make it a full path.
+ * Returns pointer to allocated memory (NULL for failure).
+ */
+ char_u *
+fix_fname(fname)
+ char_u *fname;
+{
+ /*
+ * Force expanding the path always for Unix, because symbolic links may
+ * mess up the full path name, even though it starts with a '/'.
+ * Also expand when there is ".." in the file name, try to remove it,
+ * because "c:/src/../README" is equal to "c:/README".
+ * For MS-Windows also expand names like "longna~1" to "longname".
+ */
+#ifdef UNIX
+ return FullName_save(fname, TRUE);
+#else
+ if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
+#if defined(MSWIN) || defined(DJGPP)
+ || vim_strchr(fname, '~') != NULL
+#endif
+ )
+ return FullName_save(fname, FALSE);
+
+ fname = vim_strsave(fname);
+
+#ifdef USE_FNAME_CASE
+# ifdef USE_LONG_FNAME
+ if (USE_LONG_FNAME)
+# endif
+ {
+ if (fname != NULL)
+ fname_case(fname, 0); /* set correct case for file name */
+ }
+#endif
+
+ return fname;
+#endif
+}
+
+/*
+ * Make "ffname" a full file name, set "sfname" to "ffname" if not NULL.
+ * "ffname" becomes a pointer to allocated memory (or NULL).
+ */
+/*ARGSUSED*/
+ void
+fname_expand(buf, ffname, sfname)
+ buf_T *buf;
+ char_u **ffname;
+ char_u **sfname;
+{
+ if (*ffname == NULL) /* if no file name given, nothing to do */
+ return;
+ if (*sfname == NULL) /* if no short file name given, use ffname */
+ *sfname = *ffname;
+ *ffname = fix_fname(*ffname); /* expand to full path */
+
+#ifdef FEAT_SHORTCUT
+ if (!buf->b_p_bin)
+ {
+ char_u *rfname = NULL;
+
+ /* If the file name is a shortcut file, use the file it links to. */
+ rfname = mch_resolve_shortcut(*ffname);
+ if (rfname)
+ {
+ vim_free(*ffname);
+ *ffname = rfname;
+ *sfname = rfname;
+ }
+ }
+#endif
+}
+
+/*
+ * Get the file name for an argument list entry.
+ */
+ char_u *
+alist_name(aep)
+ aentry_T *aep;
+{
+ buf_T *bp;
+
+ /* Use the name from the associated buffer if it exists. */
+ bp = buflist_findnr(aep->ae_fnum);
+ if (bp == NULL)
+ return aep->ae_fname;
+ return bp->b_fname;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * do_arg_all(): Open up to 'count' windows, one for each argument.
+ */
+ void
+do_arg_all(count, forceit)
+ int count;
+ int forceit; /* hide buffers in current windows */
+{
+ int i;
+ win_T *wp, *wpnext;
+ char_u *opened; /* array of flags for which args are open */
+ int opened_len; /* lenght of opened[] */
+ int use_firstwin = FALSE; /* use first window for arglist */
+ int split_ret = OK;
+ int p_ea_save;
+ alist_T *alist; /* argument list to be used */
+ buf_T *buf;
+
+ if (ARGCOUNT <= 0)
+ {
+ /* Don't give an error message. We don't want it when the ":all"
+ * command is in the .vimrc. */
+ return;
+ }
+ setpcmark();
+
+ opened_len = ARGCOUNT;
+ opened = alloc_clear((unsigned)opened_len);
+ if (opened == NULL)
+ return;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /*
+ * Try closing all windows that are not in the argument list.
+ * Also close windows that are not full width;
+ * When 'hidden' or "forceit" set the buffer becomes hidden.
+ * Windows that have a changed buffer and can't be hidden won't be closed.
+ */
+ for (wp = firstwin; wp != NULL; wp = wpnext)
+ {
+ wpnext = wp->w_next;
+ buf = wp->w_buffer;
+ if (buf->b_ffname == NULL
+ || buf->b_nwindows > 1
+#ifdef FEAT_VERTSPLIT
+ || wp->w_width != Columns
+#endif
+ )
+ i = ARGCOUNT;
+ else
+ {
+ /* check if the buffer in this window is in the arglist */
+ for (i = 0; i < ARGCOUNT; ++i)
+ {
+ if (ARGLIST[i].ae_fnum == buf->b_fnum
+ || fullpathcmp(alist_name(&ARGLIST[i]),
+ buf->b_ffname, TRUE) & FPC_SAME)
+ {
+ if (i < opened_len)
+ opened[i] = TRUE;
+ if (wp->w_alist != curwin->w_alist)
+ {
+ /* Use the current argument list for all windows
+ * containing a file from it. */
+ alist_unlink(wp->w_alist);
+ wp->w_alist = curwin->w_alist;
+ ++wp->w_alist->al_refcount;
+ }
+ break;
+ }
+ }
+ }
+ wp->w_arg_idx = i;
+
+ if (i == ARGCOUNT) /* close this window */
+ {
+ if (P_HID(buf) || forceit || buf->b_nwindows > 1
+ || !bufIsChanged(buf))
+ {
+ /* If the buffer was changed, and we would like to hide it,
+ * try autowriting. */
+ if (!P_HID(buf) && buf->b_nwindows <= 1 && bufIsChanged(buf))
+ {
+ (void)autowrite(buf, FALSE);
+#ifdef FEAT_AUTOCMD
+ /* check if autocommands removed the window */
+ if (!win_valid(wp) || !buf_valid(buf))
+ {
+ wpnext = firstwin; /* start all over... */
+ continue;
+ }
+#endif
+ }
+#ifdef FEAT_WINDOWS
+ if (firstwin == lastwin) /* can't close last window */
+#endif
+ use_firstwin = TRUE;
+#ifdef FEAT_WINDOWS
+ else
+ {
+ win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
+# ifdef FEAT_AUTOCMD
+ /* check if autocommands removed the next window */
+ if (!win_valid(wpnext))
+ wpnext = firstwin; /* start all over... */
+# endif
+ }
+#endif
+ }
+ }
+ }
+
+ /*
+ * Open a window for files in the argument list that don't have one.
+ * ARGCOUNT may change while doing this, because of autocommands.
+ */
+ if (count > ARGCOUNT || count <= 0)
+ count = ARGCOUNT;
+
+ /* Autocommands may do anything to the argument list. Make sure it's not
+ * freed while we are working here by "locking" it. We still have to
+ * watch out for its size to be changed. */
+ alist = curwin->w_alist;
+ ++alist->al_refcount;
+
+#ifdef FEAT_AUTOCMD
+ /* Don't execute Win/Buf Enter/Leave autocommands here. */
+ ++autocmd_no_enter;
+ ++autocmd_no_leave;
+#endif
+ win_enter(lastwin, FALSE);
+ for (i = 0; i < count && i < alist->al_ga.ga_len && !got_int; ++i)
+ {
+ if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1)
+ arg_had_last = TRUE;
+ if (i < opened_len && opened[i])
+ {
+ /* Move the already present window to below the current window */
+ if (curwin->w_arg_idx != i)
+ {
+ for (wpnext = firstwin; wpnext != NULL; wpnext = wpnext->w_next)
+ {
+ if (wpnext->w_arg_idx == i)
+ {
+ win_move_after(wpnext, curwin);
+ break;
+ }
+ }
+ }
+ }
+ else if (split_ret == OK)
+ {
+ if (!use_firstwin) /* split current window */
+ {
+ p_ea_save = p_ea;
+ p_ea = TRUE; /* use space from all windows */
+ split_ret = win_split(0, WSP_ROOM | WSP_BELOW);
+ p_ea = p_ea_save;
+ if (split_ret == FAIL)
+ continue;
+ }
+#ifdef FEAT_AUTOCMD
+ else /* first window: do autocmd for leaving this buffer */
+ --autocmd_no_leave;
+#endif
+
+ /*
+ * edit file i
+ */
+ curwin->w_arg_idx = i;
+ (void)do_ecmd(0, alist_name(&AARGLIST(alist)[i]), NULL, NULL,
+ ECMD_ONE,
+ ((P_HID(curwin->w_buffer)
+ || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
+ + ECMD_OLDBUF);
+#ifdef FEAT_AUTOCMD
+ if (use_firstwin)
+ ++autocmd_no_leave;
+#endif
+ use_firstwin = FALSE;
+ }
+ ui_breakcheck();
+ }
+
+ /* Remove the "lock" on the argument list. */
+ alist_unlink(alist);
+
+#ifdef FEAT_AUTOCMD
+ --autocmd_no_enter;
+#endif
+ win_enter(firstwin, FALSE); /* back to first window */
+#ifdef FEAT_AUTOCMD
+ --autocmd_no_leave;
+#endif
+ vim_free(opened);
+}
+
+# if defined(FEAT_LISTCMDS) || defined(PROTO)
+/*
+ * Open a window for a number of buffers.
+ */
+ void
+ex_buffer_all(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ win_T *wp, *wpnext;
+ int split_ret = OK;
+ int p_ea_save;
+ int open_wins = 0;
+ int r;
+ int count; /* Maximum number of windows to open. */
+ int all; /* When TRUE also load inactive buffers. */
+
+ if (eap->addr_count == 0) /* make as many windows as possible */
+ count = 9999;
+ else
+ count = eap->line2; /* make as many windows as specified */
+ if (eap->cmdidx == CMD_unhide || eap->cmdidx == CMD_sunhide)
+ all = FALSE;
+ else
+ all = TRUE;
+
+ setpcmark();
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /*
+ * Close superfluous windows (two windows for the same buffer).
+ * Also close windows that are not full-width.
+ */
+ for (wp = firstwin; wp != NULL; wp = wpnext)
+ {
+ wpnext = wp->w_next;
+ if (wp->w_buffer->b_nwindows > 1
+#ifdef FEAT_VERTSPLIT
+ || ((cmdmod.split & WSP_VERT)
+ ? wp->w_height + wp->w_status_height < Rows - p_ch
+ : wp->w_width != Columns)
+#endif
+ )
+ {
+ win_close(wp, FALSE);
+#ifdef FEAT_AUTOCMD
+ wpnext = firstwin; /* just in case an autocommand does something
+ strange with windows */
+ open_wins = 0;
+#endif
+ }
+ else
+ ++open_wins;
+ }
+
+ /*
+ * Go through the buffer list. When a buffer doesn't have a window yet,
+ * open one. Otherwise move the window to the right position.
+ * Watch out for autocommands that delete buffers or windows!
+ */
+#ifdef FEAT_AUTOCMD
+ /* Don't execute Win/Buf Enter/Leave autocommands here. */
+ ++autocmd_no_enter;
+#endif
+ win_enter(lastwin, FALSE);
+#ifdef FEAT_AUTOCMD
+ ++autocmd_no_leave;
+#endif
+ for (buf = firstbuf; buf != NULL && open_wins < count; buf = buf->b_next)
+ {
+ /* Check if this buffer needs a window */
+ if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
+ continue;
+
+ /* Check if this buffer already has a window */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer == buf)
+ break;
+ /* If the buffer already has a window, move it */
+ if (wp != NULL)
+ win_move_after(wp, curwin);
+ else if (split_ret == OK)
+ {
+ /* Split the window and put the buffer in it */
+ p_ea_save = p_ea;
+ p_ea = TRUE; /* use space from all windows */
+ split_ret = win_split(0, WSP_ROOM | WSP_BELOW);
+ ++open_wins;
+ p_ea = p_ea_save;
+ if (split_ret == FAIL)
+ continue;
+
+ /* Open the buffer in this window. */
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ swap_exists_action = SEA_DIALOG;
+#endif
+ set_curbuf(buf, DOBUF_GOTO);
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_EVAL
+ /* Autocommands deleted the buffer or aborted script
+ * processing!!! */
+ if (!buf_valid(buf) || aborting())
+# else
+ if (!buf_valid(buf)) /* autocommands deleted the buffer!!! */
+# endif
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ swap_exists_action = SEA_NONE;
+#endif
+ break;
+ }
+#endif
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (swap_exists_action == SEA_QUIT)
+ {
+ /* User selected Quit at ATTENTION prompt; close this window. */
+ win_close(curwin, TRUE);
+ --open_wins;
+ swap_exists_action = SEA_NONE;
+ }
+ else
+ handle_swap_exists(NULL);
+#endif
+ }
+
+ ui_breakcheck();
+ if (got_int)
+ {
+ (void)vgetc(); /* only break the file loading, not the rest */
+ break;
+ }
+ }
+#ifdef FEAT_AUTOCMD
+ --autocmd_no_enter;
+#endif
+ win_enter(firstwin, FALSE); /* back to first window */
+#ifdef FEAT_AUTOCMD
+ --autocmd_no_leave;
+#endif
+
+ /*
+ * Close superfluous windows.
+ */
+ for (wp = lastwin; open_wins > count; )
+ {
+ r = (P_HID(wp->w_buffer) || !bufIsChanged(wp->w_buffer)
+ || autowrite(wp->w_buffer, FALSE) == OK);
+#ifdef FEAT_AUTOCMD
+ if (!win_valid(wp))
+ {
+ /* BufWrite Autocommands made the window invalid, start over */
+ wp = lastwin;
+ }
+ else
+#endif
+ if (r)
+ {
+ win_close(wp, !P_HID(wp->w_buffer));
+ --open_wins;
+ wp = lastwin;
+ }
+ else
+ {
+ wp = wp->w_prev;
+ if (wp == NULL)
+ break;
+ }
+ }
+}
+# endif /* FEAT_LISTCMDS */
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * do_modelines() - process mode lines for the current file
+ *
+ * Returns immediately if the "ml" option isn't set.
+ */
+static int chk_modeline __ARGS((linenr_T));
+
+ void
+do_modelines()
+{
+ linenr_T lnum;
+ int nmlines;
+ static int entered = 0;
+
+ if (!curbuf->b_p_ml || (nmlines = (int)p_mls) == 0)
+ return;
+
+ /* Disallow recursive entry here. Can happen when executing a modeline
+ * triggers an autocommand, which reloads modelines with a ":do". */
+ if (entered)
+ return;
+
+ ++entered;
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count && lnum <= nmlines;
+ ++lnum)
+ if (chk_modeline(lnum) == FAIL)
+ nmlines = 0;
+
+ for (lnum = curbuf->b_ml.ml_line_count; lnum > 0 && lnum > nmlines
+ && lnum > curbuf->b_ml.ml_line_count - nmlines; --lnum)
+ if (chk_modeline(lnum) == FAIL)
+ nmlines = 0;
+ --entered;
+}
+
+#include "version.h" /* for version number */
+
+/*
+ * chk_modeline() - check a single line for a mode string
+ * Return FAIL if an error encountered.
+ */
+ static int
+chk_modeline(lnum)
+ linenr_T lnum;
+{
+ char_u *s;
+ char_u *e;
+ char_u *linecopy; /* local copy of any modeline found */
+ int prev;
+ int vers;
+ int end;
+ int retval = OK;
+ char_u *save_sourcing_name;
+ linenr_T save_sourcing_lnum;
+#ifdef FEAT_EVAL
+ scid_T save_SID;
+#endif
+
+ prev = -1;
+ for (s = ml_get(lnum); *s != NUL; ++s)
+ {
+ if (prev == -1 || vim_isspace(prev))
+ {
+ if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0)
+ || STRNCMP(s, "vi:", (size_t)3) == 0)
+ break;
+ if (STRNCMP(s, "vim", 3) == 0)
+ {
+ if (s[3] == '<' || s[3] == '=' || s[3] == '>')
+ e = s + 4;
+ else
+ e = s + 3;
+ vers = getdigits(&e);
+ if (*e == ':'
+ && (s[3] == ':'
+ || (VIM_VERSION_100 >= vers && isdigit(s[3]))
+ || (VIM_VERSION_100 < vers && s[3] == '<')
+ || (VIM_VERSION_100 > vers && s[3] == '>')
+ || (VIM_VERSION_100 == vers && s[3] == '=')))
+ break;
+ }
+ }
+ prev = *s;
+ }
+
+ if (*s)
+ {
+ do /* skip over "ex:", "vi:" or "vim:" */
+ ++s;
+ while (s[-1] != ':');
+
+ s = linecopy = vim_strsave(s); /* copy the line, it will change */
+ if (linecopy == NULL)
+ return FAIL;
+
+ save_sourcing_lnum = sourcing_lnum;
+ save_sourcing_name = sourcing_name;
+ sourcing_lnum = lnum; /* prepare for emsg() */
+ sourcing_name = (char_u *)"modelines";
+
+ end = FALSE;
+ while (end == FALSE)
+ {
+ s = skipwhite(s);
+ if (*s == NUL)
+ break;
+
+ /*
+ * Find end of set command: ':' or end of line.
+ * Skip over "\:", replacing it with ":".
+ */
+ for (e = s; *e != ':' && *e != NUL; ++e)
+ if (e[0] == '\\' && e[1] == ':')
+ STRCPY(e, e + 1);
+ if (*e == NUL)
+ end = TRUE;
+
+ /*
+ * If there is a "set" command, require a terminating ':' and
+ * ignore the stuff after the ':'.
+ * "vi:set opt opt opt: foo" -- foo not interpreted
+ * "vi:opt opt opt: foo" -- foo interpreted
+ * Accept "se" for compatibility with Elvis.
+ */
+ if (STRNCMP(s, "set ", (size_t)4) == 0
+ || STRNCMP(s, "se ", (size_t)3) == 0)
+ {
+ if (*e != ':') /* no terminating ':'? */
+ break;
+ end = TRUE;
+ s = vim_strchr(s, ' ') + 1;
+ }
+ *e = NUL; /* truncate the set command */
+
+ if (*s != NUL) /* skip over an empty "::" */
+ {
+#ifdef FEAT_EVAL
+ save_SID = current_SID;
+ current_SID = SID_MODELINE;
+#endif
+ retval = do_set(s, OPT_MODELINE | OPT_LOCAL);
+#ifdef FEAT_EVAL
+ current_SID = save_SID;
+#endif
+ if (retval == FAIL) /* stop if error found */
+ break;
+ }
+ s = e + 1; /* advance to next part */
+ }
+
+ sourcing_lnum = save_sourcing_lnum;
+ sourcing_name = save_sourcing_name;
+
+ vim_free(linecopy);
+ }
+ return retval;
+}
+
+#ifdef FEAT_VIMINFO
+ int
+read_viminfo_bufferlist(virp, writing)
+ vir_T *virp;
+ int writing;
+{
+ char_u *tab;
+ linenr_T lnum;
+ colnr_T col;
+ buf_T *buf;
+ char_u *sfname;
+ char_u *xline;
+
+ /* Handle long line and escaped characters. */
+ xline = viminfo_readstring(virp, 1, FALSE);
+
+ /* don't read in if there are files on the command-line or if writing: */
+ if (xline != NULL && !writing && ARGCOUNT == 0
+ && find_viminfo_parameter('%') != NULL)
+ {
+ /* Format is: <fname> Tab <lnum> Tab <col>.
+ * Watch out for a Tab in the file name, work from the end. */
+ lnum = 0;
+ col = 0;
+ tab = vim_strrchr(xline, '\t');
+ if (tab != NULL)
+ {
+ *tab++ = '\0';
+ col = atoi((char *)tab);
+ tab = vim_strrchr(xline, '\t');
+ if (tab != NULL)
+ {
+ *tab++ = '\0';
+ lnum = atol((char *)tab);
+ }
+ }
+
+ /* Expand "~/" in the file name at "line + 1" to a full path.
+ * Then try shortening it by comparing with the current directory */
+ expand_env(xline, NameBuff, MAXPATHL);
+ mch_dirname(IObuff, IOSIZE);
+ sfname = shorten_fname(NameBuff, IObuff);
+ if (sfname == NULL)
+ sfname = NameBuff;
+
+ buf = buflist_new(NameBuff, sfname, (linenr_T)0, BLN_LISTED);
+ if (buf != NULL) /* just in case... */
+ {
+ buf->b_last_cursor.lnum = lnum;
+ buf->b_last_cursor.col = col;
+ buflist_setfpos(buf, curwin, lnum, col, FALSE);
+ }
+ }
+ vim_free(xline);
+
+ return viminfo_readline(virp);
+}
+
+ void
+write_viminfo_bufferlist(fp)
+ FILE *fp;
+{
+ buf_T *buf;
+#ifdef FEAT_WINDOWS
+ win_T *win;
+#endif
+ char_u *line;
+
+ if (find_viminfo_parameter('%') == NULL)
+ return;
+
+ /* Allocate room for the file name, lnum and col. */
+ line = alloc(MAXPATHL + 30);
+ if (line == NULL)
+ return;
+
+#ifdef FEAT_WINDOWS
+ for (win = firstwin; win != NULL; win = win->w_next)
+ set_last_cursor(win);
+#else
+ set_last_cursor(curwin);
+#endif
+
+ fprintf(fp, _("\n# Buffer list:\n"));
+ for (buf = firstbuf; buf != NULL ; buf = buf->b_next)
+ {
+ if (buf->b_fname == NULL
+ || !buf->b_p_bl
+#ifdef FEAT_QUICKFIX
+ || bt_quickfix(buf)
+#endif
+ || removable(buf->b_ffname))
+ continue;
+
+ putc('%', fp);
+ home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE);
+ sprintf((char *)line + STRLEN(line), "\t%ld\t%d",
+ (long)buf->b_last_cursor.lnum,
+ buf->b_last_cursor.col);
+ viminfo_writestring(fp, line);
+ }
+ vim_free(line);
+}
+#endif
+
+
+/*
+ * Return special buffer name.
+ * Returns NULL when the buffer has a normal file name.
+ */
+ char *
+buf_spname(buf)
+ buf_T *buf;
+{
+#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ if (bt_quickfix(buf))
+ return _("[Error List]");
+#endif
+#ifdef FEAT_QUICKFIX
+ /* There is no _file_ when 'buftype' is "nofile", b_sfname
+ * contains the name as specified by the user */
+ if (bt_nofile(buf))
+ {
+ if (buf->b_sfname != NULL)
+ return (char *)buf->b_sfname;
+ return "[Scratch]";
+ }
+#endif
+ if (buf->b_fname == NULL)
+ return _("[No File]");
+ return NULL;
+}
+
+
+#if defined(FEAT_SIGNS) || defined(PROTO)
+/*
+ * Insert the sign into the signlist.
+ */
+ static void
+insert_sign(buf, prev, next, id, lnum, typenr)
+ buf_T *buf; /* buffer to store sign in */
+ signlist_T *prev; /* previous sign entry */
+ signlist_T *next; /* next sign entry */
+ int id; /* sign ID */
+ linenr_T lnum; /* line number which gets the mark */
+ int typenr; /* typenr of sign we are adding */
+{
+ signlist_T *newsign;
+
+ newsign = (signlist_T *)lalloc((long_u)sizeof(signlist_T), FALSE);
+ if (newsign != NULL)
+ {
+ newsign->id = id;
+ newsign->lnum = lnum;
+ newsign->typenr = typenr;
+ newsign->next = next;
+#ifdef FEAT_NETBEANS_INTG
+ newsign->prev = prev;
+ if (next != NULL)
+ next->prev = newsign;
+#endif
+
+ if (prev == NULL)
+ {
+ /* When adding first sign need to redraw the windows to create the
+ * column for signs. */
+ if (buf->b_signlist == NULL)
+ {
+ redraw_buf_later(buf, NOT_VALID);
+ changed_cline_bef_curs();
+ }
+
+ /* first sign in signlist */
+ buf->b_signlist = newsign;
+ }
+ else
+ prev->next = newsign;
+ }
+}
+
+/*
+ * Add the sign into the signlist. Find the right spot to do it though.
+ */
+ void
+buf_addsign(buf, id, lnum, typenr)
+ buf_T *buf; /* buffer to store sign in */
+ int id; /* sign ID */
+ linenr_T lnum; /* line number which gets the mark */
+ int typenr; /* typenr of sign we are adding */
+{
+ signlist_T *sign; /* a sign in the signlist */
+ signlist_T *prev; /* the previous sign */
+
+ prev = NULL;
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ {
+ if (lnum == sign->lnum && id == sign->id)
+ {
+ sign->typenr = typenr;
+ return;
+ }
+ else if (
+#ifndef FEAT_NETBEANS_INTG /* keep signs sorted by lnum */
+ id < 0 &&
+#endif
+ lnum < sign->lnum)
+ {
+#ifdef FEAT_NETBEANS_INTG /* insert new sign at head of list for this lnum */
+ /* XXX - GRP: Is this because of sign slide problem? Or is it
+ * really needed? Or is it because we allow multiple signs per
+ * line? If so, should I add that feature to FEAT_SIGNS?
+ */
+ while (prev != NULL && prev->lnum == lnum)
+ prev = prev->prev;
+ if (prev == NULL)
+ sign = buf->b_signlist;
+ else
+ sign = prev->next;
+#endif
+ insert_sign(buf, prev, sign, id, lnum, typenr);
+ return;
+ }
+ prev = sign;
+ }
+#ifdef FEAT_NETBEANS_INTG /* insert new sign at head of list for this lnum */
+ /* XXX - GRP: See previous comment */
+ while (prev != NULL && prev->lnum == lnum)
+ prev = prev->prev;
+ if (prev == NULL)
+ sign = buf->b_signlist;
+ else
+ sign = prev->next;
+#endif
+ insert_sign(buf, prev, sign, id, lnum, typenr);
+
+ return;
+}
+
+ int
+buf_change_sign_type(buf, markId, typenr)
+ buf_T *buf; /* buffer to store sign in */
+ int markId; /* sign ID */
+ int typenr; /* typenr of sign we are adding */
+{
+ signlist_T *sign; /* a sign in the signlist */
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ {
+ if (sign->id == markId)
+ {
+ sign->typenr = typenr;
+ return sign->lnum;
+ }
+ }
+
+ return 0;
+}
+
+ int_u
+buf_getsigntype(buf, lnum, type)
+ buf_T *buf;
+ linenr_T lnum;
+ int type; /* SIGN_ICON, SIGN_TEXT, SIGN_ANY, SIGN_LINEHL */
+{
+ signlist_T *sign; /* a sign in a b_signlist */
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ if (sign->lnum == lnum
+ && (type == SIGN_ANY
+# ifdef FEAT_SIGN_ICONS
+ || (type == SIGN_ICON
+ && sign_get_image(sign->typenr) != NULL)
+# endif
+ || (type == SIGN_TEXT
+ && sign_get_text(sign->typenr) != NULL)
+ || (type == SIGN_LINEHL
+ && sign_get_attr(sign->typenr, TRUE) != 0)))
+ return sign->typenr;
+ return 0;
+}
+
+
+ linenr_T
+buf_delsign(buf, id)
+ buf_T *buf; /* buffer sign is stored in */
+ int id; /* sign id */
+{
+ signlist_T **lastp; /* pointer to pointer to current sign */
+ signlist_T *sign; /* a sign in a b_signlist */
+ signlist_T *next; /* the next sign in a b_signlist */
+ linenr_T lnum; /* line number whose sign was deleted */
+
+ lastp = &buf->b_signlist;
+ lnum = 0;
+ for (sign = buf->b_signlist; sign != NULL; sign = next)
+ {
+ next = sign->next;
+ if (sign->id == id)
+ {
+ *lastp = next;
+#ifdef FEAT_NETBEANS_INTG
+ if (next != NULL)
+ next->prev = sign->prev;
+#endif
+ lnum = sign->lnum;
+ vim_free(sign);
+ break;
+ }
+ else
+ lastp = &sign->next;
+ }
+
+ /* When deleted the last sign need to redraw the windows to remove the
+ * sign column. */
+ if (buf->b_signlist == NULL)
+ {
+ redraw_buf_later(buf, NOT_VALID);
+ changed_cline_bef_curs();
+ }
+
+ return lnum;
+}
+
+
+/*
+ * Find the line number of the sign with the requested id. If the sign does
+ * not exist, return 0 as the line number. This will still let the correct file
+ * get loaded.
+ */
+ int
+buf_findsign(buf, id)
+ buf_T *buf; /* buffer to store sign in */
+ int id; /* sign ID */
+{
+ signlist_T *sign; /* a sign in the signlist */
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ if (sign->id == id)
+ return sign->lnum;
+
+ return 0;
+}
+
+ int
+buf_findsign_id(buf, lnum)
+ buf_T *buf; /* buffer whose sign we are searching for */
+ linenr_T lnum; /* line number of sign */
+{
+ signlist_T *sign; /* a sign in the signlist */
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ if (sign->lnum == lnum)
+ return sign->id;
+
+ return 0;
+}
+
+
+# if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
+/* see if a given type of sign exists on a specific line */
+ int
+buf_findsigntype_id(buf, lnum, typenr)
+ buf_T *buf; /* buffer whose sign we are searching for */
+ linenr_T lnum; /* line number of sign */
+ int typenr; /* sign type number */
+{
+ signlist_T *sign; /* a sign in the signlist */
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ if (sign->lnum == lnum && sign->typenr == typenr)
+ return sign->id;
+
+ return 0;
+}
+
+
+# if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+/* return the number of icons on the given line */
+ int
+buf_signcount(buf, lnum)
+ buf_T *buf;
+ linenr_T lnum;
+{
+ signlist_T *sign; /* a sign in the signlist */
+ int count = 0;
+
+ for (sign = buf->b_signlist; sign != NULL; sign = sign->next)
+ if (sign->lnum == lnum)
+ if (sign_get_image(sign->typenr) != NULL)
+ count++;
+
+ return count;
+}
+# endif /* FEAT_SIGN_ICONS */
+# endif /* FEAT_NETBEANS_INTG */
+
+
+/*
+ * Delete signs in buffer "buf".
+ */
+ static void
+buf_delete_signs(buf)
+ buf_T *buf;
+{
+ signlist_T *next;
+
+ while (buf->b_signlist != NULL)
+ {
+ next = buf->b_signlist->next;
+ vim_free(buf->b_signlist);
+ buf->b_signlist = next;
+ }
+}
+
+/*
+ * Delete all signs in all buffers.
+ */
+ void
+buf_delete_all_signs()
+{
+ buf_T *buf; /* buffer we are checking for signs */
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_signlist != NULL)
+ {
+ /* Need to redraw the windows to remove the sign column. */
+ redraw_buf_later(buf, NOT_VALID);
+ buf_delete_signs(buf);
+ }
+}
+
+/*
+ * List placed signs for "rbuf". If "rbuf" is NULL do it for all buffers.
+ */
+ void
+sign_list_placed(rbuf)
+ buf_T *rbuf;
+{
+ buf_T *buf;
+ signlist_T *p;
+ char lbuf[BUFSIZ];
+
+ MSG_PUTS_TITLE(_("\n--- Signs ---"));
+ msg_putchar('\n');
+ if (rbuf == NULL)
+ buf = firstbuf;
+ else
+ buf = rbuf;
+ while (buf != NULL)
+ {
+ if (buf->b_signlist != NULL)
+ {
+#ifdef HAVE_SNPRINTF
+ snprintf
+#else
+ sprintf
+#endif
+ (lbuf,
+#ifdef HAVE_SNPRINTF
+ BUFSIZ,
+#endif
+ _("Signs for %s:"), buf->b_fname);
+ MSG_PUTS_ATTR(lbuf, hl_attr(HLF_D));
+ msg_putchar('\n');
+ }
+ for (p = buf->b_signlist; p != NULL; p = p->next)
+ {
+ sprintf(lbuf, _(" line=%ld id=%d name=%s"),
+ (long)p->lnum, p->id, sign_typenr2name(p->typenr));
+ MSG_PUTS(lbuf);
+ msg_putchar('\n');
+ }
+ if (rbuf != NULL)
+ break;
+ buf = buf->b_next;
+ }
+}
+
+/*
+ * Adjust a placed sign for inserted/deleted lines.
+ */
+ void
+sign_mark_adjust(line1, line2, amount, amount_after)
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ signlist_T *sign; /* a sign in a b_signlist */
+
+ for (sign = curbuf->b_signlist; sign != NULL; sign = sign->next)
+ {
+ if (sign->lnum >= line1 && sign->lnum <= line2)
+ {
+ if (amount == MAXLNUM)
+ sign->lnum = line1;
+ else
+ sign->lnum += amount;
+ }
+ else if (sign->lnum > line2)
+ sign->lnum += amount_after;
+ }
+}
+#endif /* FEAT_SIGNS */
+
+/*
+ * Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
+ */
+ void
+set_buflisted(on)
+ int on;
+{
+ if (on != curbuf->b_p_bl)
+ {
+ curbuf->b_p_bl = on;
+#ifdef FEAT_AUTOCMD
+ if (on)
+ apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf);
+ else
+ apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
+#endif
+ }
+}
+
+/*
+ * Read the file for "buf" again and check if the contents changed.
+ * Return TRUE if it changed or this could not be checked.
+ */
+ int
+buf_contents_changed(buf)
+ buf_T *buf;
+{
+ buf_T *newbuf;
+ int differ = TRUE;
+ linenr_T lnum;
+#ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+#else
+ buf_T *old_curbuf = curbuf;
+#endif
+ exarg_T ea;
+
+ /* Allocate a buffer without putting it in the buffer list. */
+ newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
+ if (newbuf == NULL)
+ return TRUE;
+
+ /* Force the 'fileencoding' and 'fileformat' to be equal. */
+ if (prep_exarg(&ea, buf) == FAIL)
+ {
+ wipe_buffer(newbuf, FALSE);
+ return TRUE;
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, newbuf);
+#else
+ curbuf = newbuf;
+ curwin->w_buffer = newbuf;
+#endif
+
+ if (ml_open() == OK
+ && readfile(buf->b_ffname, buf->b_fname,
+ (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,
+ &ea, READ_NEW | READ_DUMMY) == OK)
+ {
+ /* compare the two files line by line */
+ if (buf->b_ml.ml_line_count == curbuf->b_ml.ml_line_count)
+ {
+ differ = FALSE;
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ if (STRCMP(ml_get_buf(buf, lnum, FALSE), ml_get(lnum)) != 0)
+ {
+ differ = TRUE;
+ break;
+ }
+ }
+ }
+ vim_free(ea.cmd);
+
+#ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+#else
+ curbuf = old_curbuf;
+ curwin->w_buffer = old_curbuf;
+#endif
+
+ if (curbuf != newbuf) /* safety check */
+ wipe_buffer(newbuf, FALSE);
+
+ return differ;
+}
+
+/*
+ * Wipe out a buffer and decrement the last buffer number if it was used for
+ * this buffer. Call this to wipe out a temp buffer that does not contain any
+ * marks.
+ */
+/*ARGSUSED*/
+ void
+wipe_buffer(buf, aucmd)
+ buf_T *buf;
+ int aucmd; /* When TRUE trigger autocommands. */
+{
+ if (buf->b_fnum == top_file_num - 1)
+ --top_file_num;
+
+#ifdef FEAT_AUTOCMD
+ if (!aucmd) /* Don't trigger BufDelete autocommands here. */
+ ++autocmd_block;
+#endif
+ close_buffer(NULL, buf, DOBUF_WIPE);
+#ifdef FEAT_AUTOCMD
+ if (!aucmd)
+ --autocmd_block;
+#endif
+}
diff --git a/src/charset.c b/src/charset.c
new file mode 100644
index 000000000..2424e27ce
--- /dev/null
+++ b/src/charset.c
@@ -0,0 +1,1795 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#ifdef FEAT_LINEBREAK
+static int win_chartabsize __ARGS((win_T *wp, char_u *p, colnr_T col));
+#endif
+
+#ifdef FEAT_MBYTE
+static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
+#endif
+
+static int nr2hex __ARGS((int c));
+
+static int chartab_initialized = FALSE;
+
+/* b_chartab[] is an array of 32 bytes, each bit representing one of the
+ * characters 0-255. */
+#define SET_CHARTAB(buf, c) (buf)->b_chartab[(unsigned)(c) >> 3] |= (1 << ((c) & 0x7))
+#define RESET_CHARTAB(buf, c) (buf)->b_chartab[(unsigned)(c) >> 3] &= ~(1 << ((c) & 0x7))
+#define GET_CHARTAB(buf, c) ((buf)->b_chartab[(unsigned)(c) >> 3] & (1 << ((c) & 0x7)))
+
+/*
+ * Fill chartab[]. Also fills curbuf->b_chartab[] with flags for keyword
+ * characters for current buffer.
+ *
+ * Depends on the option settings 'iskeyword', 'isident', 'isfname',
+ * 'isprint' and 'encoding'.
+ *
+ * The index in chartab[] depends on 'encoding':
+ * - For non-multi-byte index with the byte (same as the character).
+ * - For DBCS index with the first byte.
+ * - For UTF-8 index with the character (when first byte is up to 0x80 it is
+ * the same as the character, if the first byte is 0x80 and above it depends
+ * on further bytes).
+ *
+ * The contents of chartab[]:
+ * - The lower two bits, masked by CT_CELL_MASK, give the number of display
+ * cells the character occupies (1 or 2). Not valid for UTF-8 above 0x80.
+ * - CT_PRINT_CHAR bit is set when the character is printable (no need to
+ * translate the character before displaying it). Note that only DBCS
+ * characters can have 2 display cells and still be printable.
+ * - CT_FNAME_CHAR bit is set when the character can be in a file name.
+ * - CT_ID_CHAR bit is set when the character can be in an identifier.
+ *
+ * Return FAIL if 'iskeyword', 'isident', 'isfname' or 'isprint' option has an
+ * error, OK otherwise.
+ */
+ int
+init_chartab()
+{
+ return buf_init_chartab(curbuf, TRUE);
+}
+
+ int
+buf_init_chartab(buf, global)
+ buf_T *buf;
+ int global; /* FALSE: only set buf->b_chartab[] */
+{
+ int c;
+ int c2;
+ char_u *p;
+ int i;
+ int tilde;
+ int do_isalpha;
+
+ if (global)
+ {
+ /*
+ * Set the default size for printable characters:
+ * From <Space> to '~' is 1 (printable), others are 2 (not printable).
+ * This also inits all 'isident' and 'isfname' flags to FALSE.
+ *
+ * EBCDIC: all chars below ' ' are not printable, all others are
+ * printable.
+ */
+ c = 0;
+ while (c < ' ')
+ chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
+#ifdef EBCDIC
+ while (c < 255)
+#else
+ while (c <= '~')
+#endif
+ chartab[c++] = 1 + CT_PRINT_CHAR;
+#ifdef FEAT_FKMAP
+ if (p_altkeymap)
+ {
+ while (c < YE)
+ chartab[c++] = 1 + CT_PRINT_CHAR;
+ }
+#endif
+ while (c < 256)
+ {
+#ifdef FEAT_MBYTE
+ /* UTF-8: bytes 0xa0 - 0xff are printable (latin1) */
+ if (enc_utf8 && c >= 0xa0)
+ chartab[c++] = CT_PRINT_CHAR + 1;
+ /* euc-jp characters starting with 0x8e are single width */
+ else if (enc_dbcs == DBCS_JPNU && c == 0x8e)
+ chartab[c++] = CT_PRINT_CHAR + 1;
+ /* other double-byte chars can be printable AND double-width */
+ else if (enc_dbcs != 0 && MB_BYTE2LEN(c) == 2)
+ chartab[c++] = CT_PRINT_CHAR + 2;
+ else
+#endif
+ /* the rest is unprintable by default */
+ chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
+ }
+
+#ifdef FEAT_MBYTE
+ /* Assume that every multi-byte char is a filename character. */
+ for (c = 1; c < 256; ++c)
+ if ((enc_dbcs != 0 && MB_BYTE2LEN(c) > 1)
+ || (enc_dbcs == DBCS_JPNU && c == 0x8e)
+ || (enc_utf8 && c >= 0xa0))
+ chartab[c] |= CT_FNAME_CHAR;
+#endif
+ }
+
+ /*
+ * Init word char flags all to FALSE
+ */
+ vim_memset(buf->b_chartab, 0, (size_t)32);
+#ifdef FEAT_MBYTE
+ for (c = 0; c < 256; ++c)
+ {
+ /* double-byte characters are probably word characters */
+ if (enc_dbcs != 0 && MB_BYTE2LEN(c) == 2)
+ SET_CHARTAB(buf, c);
+ }
+#endif
+
+#ifdef FEAT_LISP
+ /*
+ * In lisp mode the '-' character is included in keywords.
+ */
+ if (buf->b_p_lisp)
+ SET_CHARTAB(buf, '-');
+#endif
+
+ /* Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint'
+ * options Each option is a list of characters, character numbers or
+ * ranges, separated by commas, e.g.: "200-210,x,#-178,-"
+ */
+ for (i = global ? 0 : 3; i <= 3; ++i)
+ {
+ if (i == 0)
+ p = p_isi; /* first round: 'isident' */
+ else if (i == 1)
+ p = p_isp; /* second round: 'isprint' */
+ else if (i == 2)
+ p = p_isf; /* third round: 'isfname' */
+ else /* i == 3 */
+ p = buf->b_p_isk; /* fourth round: 'iskeyword' */
+
+ while (*p)
+ {
+ tilde = FALSE;
+ do_isalpha = FALSE;
+ if (*p == '^' && p[1] != NUL)
+ {
+ tilde = TRUE;
+ ++p;
+ }
+ if (VIM_ISDIGIT(*p))
+ c = getdigits(&p);
+ else
+ c = *p++;
+ c2 = -1;
+ if (*p == '-' && p[1] != NUL)
+ {
+ ++p;
+ if (VIM_ISDIGIT(*p))
+ c2 = getdigits(&p);
+ else
+ c2 = *p++;
+ }
+ if (c <= 0 || (c2 < c && c2 != -1) || c2 >= 256
+ || !(*p == NUL || *p == ','))
+ return FAIL;
+
+ if (c2 == -1) /* not a range */
+ {
+ /*
+ * A single '@' (not "@-@"):
+ * Decide on letters being ID/printable/keyword chars with
+ * standard function isalpha(). This takes care of locale for
+ * single-byte characters).
+ */
+ if (c == '@')
+ {
+ do_isalpha = TRUE;
+ c = 1;
+ c2 = 255;
+ }
+ else
+ c2 = c;
+ }
+ while (c <= c2)
+ {
+ if (!do_isalpha || isalpha(c)
+#ifdef FEAT_FKMAP
+ || (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))
+#endif
+ )
+ {
+ if (i == 0) /* (re)set ID flag */
+ {
+ if (tilde)
+ chartab[c] &= ~CT_ID_CHAR;
+ else
+ chartab[c] |= CT_ID_CHAR;
+ }
+ else if (i == 1) /* (re)set printable */
+ {
+ if ((c < ' '
+#ifndef EBCDIC
+ || c > '~'
+#endif
+#ifdef FEAT_FKMAP
+ || (p_altkeymap
+ && (F_isalpha(c) || F_isdigit(c)))
+#endif
+ )
+#ifdef FEAT_MBYTE
+ /* For double-byte we keep the cell width, so
+ * that we can detect it from the first byte. */
+ && !(enc_dbcs && MB_BYTE2LEN(c) == 2)
+#endif
+ )
+ {
+ if (tilde)
+ {
+ chartab[c] = (chartab[c] & ~CT_CELL_MASK)
+ + ((dy_flags & DY_UHEX) ? 4 : 2);
+ chartab[c] &= ~CT_PRINT_CHAR;
+ }
+ else
+ {
+ chartab[c] = (chartab[c] & ~CT_CELL_MASK) + 1;
+ chartab[c] |= CT_PRINT_CHAR;
+ }
+ }
+ }
+ else if (i == 2) /* (re)set fname flag */
+ {
+ if (tilde)
+ chartab[c] &= ~CT_FNAME_CHAR;
+ else
+ chartab[c] |= CT_FNAME_CHAR;
+ }
+ else /* i == 3 */ /* (re)set keyword flag */
+ {
+ if (tilde)
+ RESET_CHARTAB(buf, c);
+ else
+ SET_CHARTAB(buf, c);
+ }
+ }
+ ++c;
+ }
+ p = skip_to_option_part(p);
+ }
+ }
+ chartab_initialized = TRUE;
+ return OK;
+}
+
+/*
+ * Translate any special characters in buf[bufsize] in-place.
+ * The result is a string with only printable characters, but if there is not
+ * enough room, not all characters will be translated.
+ */
+ void
+trans_characters(buf, bufsize)
+ char_u *buf;
+ int bufsize;
+{
+ int len; /* length of string needing translation */
+ int room; /* room in buffer after string */
+ char_u *trs; /* translated character */
+ int trs_len; /* length of trs[] */
+
+ len = (int)STRLEN(buf);
+ room = bufsize - len;
+ while (*buf != 0)
+ {
+# ifdef FEAT_MBYTE
+ /* Assume a multi-byte character doesn't need translation. */
+ if (has_mbyte && (trs_len = (*mb_ptr2len_check)(buf)) > 1)
+ len -= trs_len;
+ else
+# endif
+ {
+ trs = transchar_byte(*buf);
+ trs_len = (int)STRLEN(trs);
+ if (trs_len > 1)
+ {
+ room -= trs_len - 1;
+ if (room <= 0)
+ return;
+ mch_memmove(buf + trs_len, buf + 1, (size_t)len);
+ }
+ mch_memmove(buf, trs, (size_t)trs_len);
+ --len;
+ }
+ buf += trs_len;
+ }
+}
+
+#if defined(FEAT_EVAL) || defined(FEAT_TITLE) || defined(PROTO)
+/*
+ * Translate a string into allocated memory, replacing special chars with
+ * printable chars. Returns NULL when out of memory.
+ */
+ char_u *
+transstr(s)
+ char_u *s;
+{
+ char_u *res;
+ char_u *p;
+#ifdef FEAT_MBYTE
+ int l, len, c;
+ char_u hexbuf[11];
+#endif
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Compute the length of the result, taking account of unprintable
+ * multi-byte characters. */
+ len = 0;
+ p = s;
+ while (*p != NUL)
+ {
+ if ((l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ c = (*mb_ptr2char)(p);
+ p += l;
+ if (vim_isprintc(c))
+ len += l;
+ else
+ {
+ transchar_hex(hexbuf, c);
+ len += STRLEN(hexbuf);
+ }
+ }
+ else
+ {
+ l = byte2cells(*p++);
+ if (l > 0)
+ len += l;
+ else
+ len += 4; /* illegal byte sequence */
+ }
+ }
+ res = alloc((unsigned)(len + 1));
+ }
+ else
+#endif
+ res = alloc((unsigned)(vim_strsize(s) + 1));
+ if (res != NULL)
+ {
+ *res = NUL;
+ p = s;
+ while (*p != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ c = (*mb_ptr2char)(p);
+ if (vim_isprintc(c))
+ STRNCAT(res, p, l); /* append printable multi-byte char */
+ else
+ transchar_hex(res + STRLEN(res), c);
+ p += l;
+ }
+ else
+#endif
+ STRCAT(res, transchar_byte(*p++));
+ }
+ }
+ return res;
+}
+#endif
+
+#if defined(FEAT_SYN_HL) || defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Convert the string "p[len]" to do ignore-case comparing. Uses the current
+ * locale. Returns an allocated string (NULL for out-of-memory).
+ */
+ char_u *
+str_foldcase(str, len)
+ char_u *str;
+ int len;
+{
+ garray_T ga;
+ int i;
+
+#define GA_CHAR(i) ((char_u *)ga.ga_data)[i]
+#define GA_PTR(i) ((char_u *)ga.ga_data + i)
+
+ /* Copy "str" into allocated memory, unmodified. */
+ ga_init2(&ga, 1, 10);
+ if (ga_grow(&ga, len + 1) == FAIL)
+ return NULL;
+ mch_memmove(ga.ga_data, str, (size_t)len);
+ GA_CHAR(len) = NUL;
+ ga.ga_len = len;
+ ga.ga_room -= len;
+
+ /* Make each character lower case. */
+ i = 0;
+ while (GA_CHAR(i) != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8 || (has_mbyte && MB_BYTE2LEN(GA_CHAR(i)) > 1))
+ {
+ if (enc_utf8)
+ {
+ int c, lc;
+
+ c = utf_ptr2char(GA_PTR(i));
+ lc = utf_tolower(c);
+ if (c != lc)
+ {
+ int ol = utf_char2len(c);
+ int nl = utf_char2len(lc);
+
+ /* If the byte length changes need to shift the following
+ * characters forward or backward. */
+ if (ol != nl)
+ {
+ if (nl > ol)
+ if (ga_grow(&ga, nl - ol) == FAIL)
+ {
+ /* out of memory, keep old char */
+ lc = c;
+ nl = ol;
+ }
+ if (ol != nl)
+ {
+ mch_memmove(GA_PTR(i) + nl, GA_PTR(i) + ol,
+ STRLEN(GA_PTR(i) + ol) + 1);
+ ga.ga_len += nl - ol;
+ ga.ga_room -= nl - ol;
+ }
+ }
+ (void)utf_char2bytes(lc, GA_PTR(i));
+ }
+ }
+ /* skip to next multi-byte char */
+ i += (*mb_ptr2len_check)(GA_PTR(i));
+ }
+ else
+#endif
+ {
+ GA_CHAR(i) = TOLOWER_LOC(GA_CHAR(i));
+ ++i;
+ }
+ }
+
+ return (char_u *)ga.ga_data;
+}
+#endif
+
+/*
+ * Catch 22: chartab[] can't be initialized before the options are
+ * initialized, and initializing options may cause transchar() to be called!
+ * When chartab_initialized == FALSE don't use chartab[].
+ * Does NOT work for multi-byte characters, c must be <= 255.
+ * Also doesn't work for the first byte of a multi-byte, "c" must be a
+ * character!
+ */
+static char_u transchar_buf[7];
+
+ char_u *
+transchar(c)
+ int c;
+{
+ int i;
+
+ i = 0;
+ if (IS_SPECIAL(c)) /* special key code, display as ~@ char */
+ {
+ transchar_buf[0] = '~';
+ transchar_buf[1] = '@';
+ i = 2;
+ c = K_SECOND(c);
+ }
+
+ if ((!chartab_initialized && (
+#ifdef EBCDIC
+ (c >= 64 && c < 255)
+#else
+ (c >= ' ' && c <= '~')
+#endif
+#ifdef FEAT_FKMAP
+ || F_ischar(c)
+#endif
+ )) || (c < 256 && vim_isprintc_strict(c)))
+ {
+ /* printable character */
+ transchar_buf[i] = c;
+ transchar_buf[i + 1] = NUL;
+ }
+ else
+ transchar_nonprint(transchar_buf + i, c);
+ return transchar_buf;
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Like transchar(), but called with a byte instead of a character. Checks
+ * for an illegal UTF-8 byte.
+ */
+ char_u *
+transchar_byte(c)
+ int c;
+{
+ if (enc_utf8 && c >= 0x80)
+ {
+ transchar_nonprint(transchar_buf, c);
+ return transchar_buf;
+ }
+ return transchar(c);
+}
+#endif
+
+/*
+ * Convert non-printable character to two or more printable characters in
+ * "buf[]". "buf" needs to be able to hold five bytes.
+ * Does NOT work for multi-byte characters, c must be <= 255.
+ */
+ void
+transchar_nonprint(buf, c)
+ char_u *buf;
+ int c;
+{
+ if (c == NL)
+ c = NUL; /* we use newline in place of a NUL */
+ else if (c == CAR && get_fileformat(curbuf) == EOL_MAC)
+ c = NL; /* we use CR in place of NL in this case */
+
+ if (dy_flags & DY_UHEX) /* 'display' has "uhex" */
+ transchar_hex(buf, c);
+
+#ifdef EBCDIC
+ /* For EBCDIC only the characters 0-63 and 255 are not printable */
+ else if (CtrlChar(c) != 0 || c == DEL)
+#else
+ else if (c <= 0x7f) /* 0x00 - 0x1f and 0x7f */
+#endif
+ {
+ buf[0] = '^';
+#ifdef EBCDIC
+ if (c == DEL)
+ buf[1] = '?'; /* DEL displayed as ^? */
+ else
+ buf[1] = CtrlChar(c);
+#else
+ buf[1] = c ^ 0x40; /* DEL displayed as ^? */
+#endif
+
+ buf[2] = NUL;
+ }
+#ifdef FEAT_MBYTE
+ else if (enc_utf8 && c >= 0x80)
+ {
+ transchar_hex(buf, c);
+ }
+#endif
+#ifndef EBCDIC
+ else if (c >= ' ' + 0x80 && c <= '~' + 0x80) /* 0xa0 - 0xfe */
+ {
+ buf[0] = '|';
+ buf[1] = c - 0x80;
+ buf[2] = NUL;
+ }
+#else
+ else if (c < 64)
+ {
+ buf[0] = '~';
+ buf[1] = MetaChar(c);
+ buf[2] = NUL;
+ }
+#endif
+ else /* 0x80 - 0x9f and 0xff */
+ {
+ /*
+ * TODO: EBCDIC I don't know what to do with this chars, so I display
+ * them as '~?' for now
+ */
+ buf[0] = '~';
+#ifdef EBCDIC
+ buf[1] = '?'; /* 0xff displayed as ~? */
+#else
+ buf[1] = (c - 0x80) ^ 0x40; /* 0xff displayed as ~? */
+#endif
+ buf[2] = NUL;
+ }
+}
+
+ void
+transchar_hex(buf, c)
+ char_u *buf;
+ int c;
+{
+ int i = 0;
+
+ buf[0] = '<';
+#ifdef FEAT_MBYTE
+ if (c > 255)
+ {
+ buf[++i] = nr2hex((unsigned)c >> 12);
+ buf[++i] = nr2hex((unsigned)c >> 8);
+ }
+#endif
+ buf[++i] = nr2hex((unsigned)c >> 4);
+ buf[++i] = nr2hex(c);
+ buf[++i] = '>';
+ buf[++i] = NUL;
+}
+
+/*
+ * Convert the lower 4 bits of byte "c" to its hex character.
+ * Lower case letters are used to avoid the confusion of <F1> being 0xf1 or
+ * function key 1.
+ */
+ static int
+nr2hex(c)
+ int c;
+{
+ if ((c & 0xf) <= 9)
+ return (c & 0xf) + '0';
+ return (c & 0xf) - 10 + 'a';
+}
+
+/*
+ * Return number of display cells occupied by byte "b".
+ * Caller must make sure 0 <= b <= 255.
+ * For multi-byte mode "b" must be the first byte of a character.
+ * A TAB is counted as two cells: "^I".
+ * For UTF-8 mode this will return 0 for bytes >= 0x80, because the number of
+ * cells depends on further bytes.
+ */
+ int
+byte2cells(b)
+ int b;
+{
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && b >= 0x80)
+ return 0;
+#endif
+ return (chartab[b] & CT_CELL_MASK);
+}
+
+/*
+ * Return number of display cells occupied by character "c".
+ * "c" can be a special key (negative number) in which case 3 or 4 is returned.
+ * A TAB is counted as two cells: "^I" or four: "<09>".
+ */
+ int
+char2cells(c)
+ int c;
+{
+ if (IS_SPECIAL(c))
+ return char2cells(K_SECOND(c)) + 2;
+#ifdef FEAT_MBYTE
+ if (c >= 0x80)
+ {
+ /* UTF-8: above 0x80 need to check the value */
+ if (enc_utf8)
+ return utf_char2cells(c);
+ /* DBCS: double-byte means double-width, except for euc-jp with first
+ * byte 0x8e */
+ if (enc_dbcs != 0 && c >= 0x100)
+ {
+ if (enc_dbcs == DBCS_JPNU && ((unsigned)c >> 8) == 0x8e)
+ return 1;
+ return 2;
+ }
+ }
+#endif
+ return (chartab[c & 0xff] & CT_CELL_MASK);
+}
+
+/*
+ * Return number of display cells occupied by character at "*p".
+ * A TAB is counted as two cells: "^I" or four: "<09>".
+ */
+ int
+ptr2cells(p)
+ char_u *p;
+{
+#ifdef FEAT_MBYTE
+ /* For UTF-8 we need to look at more bytes if the first byte is >= 0x80. */
+ if (enc_utf8 && *p >= 0x80)
+ return utf_ptr2cells(p);
+ /* For DBCS we can tell the cell count from the first byte. */
+#endif
+ return (chartab[*p] & CT_CELL_MASK);
+}
+
+/*
+ * Return the number of characters string "s" will take on the screen,
+ * counting TABs as two characters: "^I".
+ */
+ int
+vim_strsize(s)
+ char_u *s;
+{
+ return vim_strnsize(s, (int)MAXCOL);
+}
+
+/*
+ * Return the number of characters string "s[len]" will take on the screen,
+ * counting TABs as two characters: "^I".
+ */
+ int
+vim_strnsize(s, len)
+ char_u *s;
+ int len;
+{
+ int size = 0;
+
+ while (*s != NUL && --len >= 0)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int l = (*mb_ptr2len_check)(s);
+
+ size += ptr2cells(s);
+ s += l;
+ len -= l - 1;
+ }
+ else
+#endif
+ size += byte2cells(*s++);
+ }
+ return size;
+}
+
+/*
+ * Return the number of characters 'c' will take on the screen, taking
+ * into account the size of a tab.
+ * Use a define to make it fast, this is used very often!!!
+ * Also see getvcol() below.
+ */
+
+#define RET_WIN_BUF_CHARTABSIZE(wp, buf, p, col) \
+ if (*(p) == TAB && (!(wp)->w_p_list || lcs_tab1)) \
+ { \
+ int ts; \
+ ts = (buf)->b_p_ts; \
+ return (int)(ts - (col % ts)); \
+ } \
+ else \
+ return ptr2cells(p);
+
+#if defined(FEAT_VREPLACE) || defined(FEAT_EX_EXTRA) || defined(FEAT_GUI) \
+ || defined(FEAT_VIRTUALEDIT) || defined(PROTO)
+ int
+chartabsize(p, col)
+ char_u *p;
+ colnr_T col;
+{
+ RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, p, col)
+}
+#endif
+
+#ifdef FEAT_LINEBREAK
+ static int
+win_chartabsize(wp, p, col)
+ win_T *wp;
+ char_u *p;
+ colnr_T col;
+{
+ RET_WIN_BUF_CHARTABSIZE(wp, wp->w_buffer, p, col)
+}
+#endif
+
+/*
+ * return the number of characters the string 's' will take on the screen,
+ * taking into account the size of a tab
+ */
+ int
+linetabsize(s)
+ char_u *s;
+{
+ colnr_T col = 0;
+
+ while (*s != NUL)
+ col += lbr_chartabsize_adv(&s, col);
+ return (int)col;
+}
+
+/*
+ * Like linetabsize(), but for a given window instead of the current one.
+ */
+ int
+win_linetabsize(wp, p, len)
+ win_T *wp;
+ char_u *p;
+ colnr_T len;
+{
+ colnr_T col = 0;
+ char_u *s;
+
+ for (s = p; *s != NUL && (len == MAXCOL || s < p + len); )
+ {
+ col += win_lbr_chartabsize(wp, s, col, NULL);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+#endif
+ ++s;
+ }
+ return (int)col;
+}
+
+/*
+ * return TRUE if 'c' is a normal identifier character
+ * letters and characters from 'isident' option.
+ */
+ int
+vim_isIDc(c)
+ int c;
+{
+ return (c > 0 && c < 0x100 && (chartab[c] & CT_ID_CHAR));
+}
+
+/*
+ * return TRUE if 'c' is a keyword character: Letters and characters from
+ * 'iskeyword' option for current buffer.
+ * For multi-byte characters mb_get_class() is used (builtin rules).
+ */
+ int
+vim_iswordc(c)
+ int c;
+{
+#ifdef FEAT_MBYTE
+ if (c >= 0x100)
+ {
+ if (enc_dbcs != 0)
+ return dbcs_class((unsigned)c >> 8, c & 0xff) >= 2;
+ if (enc_utf8)
+ return utf_class(c) >= 2;
+ }
+#endif
+ return (c > 0 && c < 0x100 && GET_CHARTAB(curbuf, c) != 0);
+}
+
+/*
+ * Just like vim_iswordc() but uses a pointer to the (multi-byte) character.
+ */
+ int
+vim_iswordp(p)
+ char_u *p;
+{
+#ifdef FEAT_MBYTE
+ if (has_mbyte && MB_BYTE2LEN(*p) > 1)
+ return mb_get_class(p) >= 2;
+#endif
+ return GET_CHARTAB(curbuf, *p) != 0;
+}
+
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+ int
+vim_iswordc_buf(p, buf)
+ char_u *p;
+ buf_T *buf;
+{
+# ifdef FEAT_MBYTE
+ if (has_mbyte && MB_BYTE2LEN(*p) > 1)
+ return mb_get_class(p) >= 2;
+# endif
+ return (GET_CHARTAB(buf, *p) != 0);
+}
+#endif
+
+/*
+ * return TRUE if 'c' is a valid file-name character
+ * Assume characters above 0x100 are valid (multi-byte).
+ */
+ int
+vim_isfilec(c)
+ int c;
+{
+ return (c >= 0x100 || (c > 0 && (chartab[c] & CT_FNAME_CHAR)));
+}
+
+/*
+ * return TRUE if 'c' is a printable character
+ * Assume characters above 0x100 are printable (multi-byte), except for
+ * Unicode.
+ */
+ int
+vim_isprintc(c)
+ int c;
+{
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && c >= 0x100)
+ return utf_printable(c);
+#endif
+ return (c >= 0x100 || (c > 0 && (chartab[c] & CT_PRINT_CHAR)));
+}
+
+/*
+ * Strict version of vim_isprintc(c), don't return TRUE if "c" is the head
+ * byte of a double-byte character.
+ */
+ int
+vim_isprintc_strict(c)
+ int c;
+{
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && c < 0x100 && MB_BYTE2LEN(c) > 1)
+ return FALSE;
+ if (enc_utf8 && c >= 0x100)
+ return utf_printable(c);
+#endif
+ return (c >= 0x100 || (c > 0 && (chartab[c] & CT_PRINT_CHAR)));
+}
+
+/*
+ * like chartabsize(), but also check for line breaks on the screen
+ */
+ int
+lbr_chartabsize(s, col)
+ unsigned char *s;
+ colnr_T col;
+{
+#ifdef FEAT_LINEBREAK
+ if (!curwin->w_p_lbr && *p_sbr == NUL)
+ {
+#endif
+#ifdef FEAT_MBYTE
+ if (curwin->w_p_wrap)
+ return win_nolbr_chartabsize(curwin, s, col, NULL);
+#endif
+ RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, s, col)
+#ifdef FEAT_LINEBREAK
+ }
+ return win_lbr_chartabsize(curwin, s, col, NULL);
+#endif
+}
+
+/*
+ * Call lbr_chartabsize() and advance the pointer.
+ */
+ int
+lbr_chartabsize_adv(s, col)
+ char_u **s;
+ colnr_T col;
+{
+ int retval;
+
+ retval = lbr_chartabsize(*s, col);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ *s += (*mb_ptr2len_check)(*s);
+ else
+#endif
+ ++*s;
+ return retval;
+}
+
+/*
+ * This function is used very often, keep it fast!!!!
+ *
+ * If "headp" not NULL, set *headp to the size of what we for 'showbreak'
+ * string at start of line. Warning: *headp is only set if it's a non-zero
+ * value, init to 0 before calling.
+ */
+/*ARGSUSED*/
+ int
+win_lbr_chartabsize(wp, s, col, headp)
+ win_T *wp;
+ char_u *s;
+ colnr_T col;
+ int *headp;
+{
+#ifdef FEAT_LINEBREAK
+ int c;
+ int size;
+ colnr_T col2;
+ colnr_T colmax;
+ int added;
+# ifdef FEAT_MBYTE
+ int mb_added = 0;
+# else
+# define mb_added 0
+# endif
+ int numberextra;
+ char_u *ps;
+ int tab_corr = (*s == TAB);
+
+ /*
+ * No 'linebreak' and 'showbreak': return quickly.
+ */
+ if (!wp->w_p_lbr && *p_sbr == NUL)
+#endif
+ {
+#ifdef FEAT_MBYTE
+ if (wp->w_p_wrap)
+ return win_nolbr_chartabsize(wp, s, col, headp);
+#endif
+ RET_WIN_BUF_CHARTABSIZE(wp, wp->w_buffer, s, col)
+ }
+
+#ifdef FEAT_LINEBREAK
+ /*
+ * First get normal size, without 'linebreak'
+ */
+ size = win_chartabsize(wp, s, col);
+ c = *s;
+
+ /*
+ * If 'linebreak' set check at a blank before a non-blank if the line
+ * needs a break here
+ */
+ if (wp->w_p_lbr
+ && vim_isbreak(c)
+ && !vim_isbreak(s[1])
+ && !wp->w_p_list
+ && wp->w_p_wrap
+# ifdef FEAT_VERTSPLIT
+ && wp->w_width != 0
+# endif
+ )
+ {
+ /*
+ * Count all characters from first non-blank after a blank up to next
+ * non-blank after a blank.
+ */
+ numberextra = win_col_off(wp);
+ col2 = col;
+ colmax = W_WIDTH(wp) - numberextra;
+ if (col >= colmax)
+ colmax += (((col - colmax)
+ / (colmax + win_col_off2(wp))) + 1)
+ * (colmax + win_col_off2(wp));
+ for (;;)
+ {
+ ps = s;
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+# endif
+ ++s;
+ c = *s;
+ if (!(c != NUL
+ && (vim_isbreak(c)
+ || (!vim_isbreak(c)
+ && (col2 == col || !vim_isbreak(*ps))))))
+ break;
+
+ col2 += win_chartabsize(wp, s, col2);
+ if (col2 >= colmax) /* doesn't fit */
+ {
+ size = colmax - col;
+ tab_corr = FALSE;
+ break;
+ }
+ }
+ }
+# ifdef FEAT_MBYTE
+ else if (has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1
+ && wp->w_p_wrap && in_win_border(wp, col))
+ {
+ ++size; /* Count the ">" in the last column. */
+ mb_added = 1;
+ }
+# endif
+
+ /*
+ * May have to add something for 'showbreak' string at start of line
+ * Set *headp to the size of what we add.
+ */
+ added = 0;
+ if (*p_sbr != NUL && wp->w_p_wrap && col != 0)
+ {
+ numberextra = win_col_off(wp);
+ col += numberextra + mb_added;
+ if (col >= (colnr_T)W_WIDTH(wp))
+ {
+ col -= W_WIDTH(wp);
+ numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
+ if (numberextra > 0)
+ col = col % numberextra;
+ }
+ if (col == 0 || col + size > (colnr_T)W_WIDTH(wp))
+ {
+ added = vim_strsize(p_sbr);
+ if (tab_corr)
+ size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
+ else
+ size += added;
+ if (col != 0)
+ added = 0;
+ }
+ }
+ if (headp != NULL)
+ *headp = added + mb_added;
+ return size;
+#endif
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Like win_lbr_chartabsize(), except that we know 'linebreak' is off and
+ * 'wrap' is on. This means we need to check for a double-byte character that
+ * doesn't fit at the end of the screen line.
+ */
+ static int
+win_nolbr_chartabsize(wp, s, col, headp)
+ win_T *wp;
+ char_u *s;
+ colnr_T col;
+ int *headp;
+{
+ int n;
+
+ if (*s == TAB && (!wp->w_p_list || lcs_tab1))
+ {
+ n = wp->w_buffer->b_p_ts;
+ return (int)(n - (col % n));
+ }
+ n = ptr2cells(s);
+ /* Add one cell for a double-width character in the last column of the
+ * window, displayed with a ">". */
+ if (n == 2 && MB_BYTE2LEN(*s) > 1 && in_win_border(wp, col))
+ {
+ if (headp != NULL)
+ *headp = 1;
+ return 3;
+ }
+ return n;
+}
+
+/*
+ * Return TRUE if virtual column "vcol" is in the rightmost column of window
+ * "wp".
+ */
+ int
+in_win_border(wp, vcol)
+ win_T *wp;
+ colnr_T vcol;
+{
+ colnr_T width1; /* width of first line (after line number) */
+ colnr_T width2; /* width of further lines */
+
+#ifdef FEAT_VERTSPLIT
+ if (wp->w_width == 0) /* there is no border */
+ return FALSE;
+#endif
+ width1 = W_WIDTH(wp) - win_col_off(wp);
+ if (vcol < width1 - 1)
+ return FALSE;
+ if (vcol == width1 - 1)
+ return TRUE;
+ width2 = width1 + win_col_off2(wp);
+ return ((vcol - width1) % width2 == width2 - 1);
+}
+#endif /* FEAT_MBYTE */
+
+/*
+ * Get virtual column number of pos.
+ * start: on the first position of this character (TAB, ctrl)
+ * cursor: where the cursor is on this character (first char, except for TAB)
+ * end: on the last position of this character (TAB, ctrl)
+ *
+ * This is used very often, keep it fast!
+ */
+ void
+getvcol(wp, pos, start, cursor, end)
+ win_T *wp;
+ pos_T *pos;
+ colnr_T *start;
+ colnr_T *cursor;
+ colnr_T *end;
+{
+ colnr_T vcol;
+ char_u *ptr; /* points to current char */
+ char_u *posptr; /* points to char at pos->col */
+ int incr;
+ int head;
+ int ts = wp->w_buffer->b_p_ts;
+ int c;
+
+ vcol = 0;
+ ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
+ posptr = ptr + pos->col;
+
+ /*
+ * This function is used very often, do some speed optimizations.
+ * When 'list', 'linebreak' and 'showbreak' are not set use a simple loop.
+ * Also use this when 'list' is set but tabs take their normal size.
+ */
+ if ((!wp->w_p_list || lcs_tab1 != NUL)
+#ifdef FEAT_LINEBREAK
+ && !wp->w_p_lbr && *p_sbr == NUL
+#endif
+ )
+ {
+#ifndef FEAT_MBYTE
+ head = 0;
+#endif
+ for (;;)
+ {
+#ifdef FEAT_MBYTE
+ head = 0;
+#endif
+ c = *ptr;
+ /* make sure we don't go past the end of the line */
+ if (c == NUL)
+ {
+ incr = 1; /* NUL at end of line only takes one column */
+ break;
+ }
+ /* A tab gets expanded, depending on the current column */
+ if (c == TAB)
+ incr = ts - (vcol % ts);
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* For utf-8, if the byte is >= 0x80, need to look at
+ * further bytes to find the cell width. */
+ if (enc_utf8 && c >= 0x80)
+ incr = utf_ptr2cells(ptr);
+ else
+ incr = CHARSIZE(c);
+
+ /* If a double-cell char doesn't fit at the end of a line
+ * it wraps to the next line, it's like this char is three
+ * cells wide. */
+ if (incr == 2 && wp->w_p_wrap && in_win_border(wp, vcol))
+ {
+ ++incr;
+ head = 1;
+ }
+ }
+ else
+#endif
+ incr = CHARSIZE(c);
+ }
+
+ if (ptr >= posptr) /* character at pos->col */
+ break;
+
+ vcol += incr;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+#endif
+ ++ptr;
+ }
+ }
+ else
+ {
+ for (;;)
+ {
+ /* A tab gets expanded, depending on the current column */
+ head = 0;
+ incr = win_lbr_chartabsize(wp, ptr, vcol, &head);
+ /* make sure we don't go past the end of the line */
+ if (*ptr == NUL)
+ {
+ incr = 1; /* NUL at end of line only takes one column */
+ break;
+ }
+
+ if (ptr >= posptr) /* character at pos->col */
+ break;
+
+ vcol += incr;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+#endif
+ ++ptr;
+ }
+ }
+ if (start != NULL)
+ *start = vcol + head;
+ if (end != NULL)
+ *end = vcol + incr - 1;
+ if (cursor != NULL)
+ {
+ if (*ptr == TAB
+ && (State & NORMAL)
+ && !wp->w_p_list
+ && !virtual_active()
+#ifdef FEAT_VISUAL
+ && !(VIsual_active
+ && (*p_sel == 'e' || ltoreq(*pos, VIsual)))
+#endif
+ )
+ *cursor = vcol + incr - 1; /* cursor at end */
+ else
+ *cursor = vcol + head; /* cursor at start */
+ }
+}
+
+/*
+ * Get virtual cursor column in the current window, pretending 'list' is off.
+ */
+ colnr_T
+getvcol_nolist(posp)
+ pos_T *posp;
+{
+ int list_save = curwin->w_p_list;
+ colnr_T vcol;
+
+ curwin->w_p_list = FALSE;
+ getvcol(curwin, posp, NULL, &vcol, NULL);
+ curwin->w_p_list = list_save;
+ return vcol;
+}
+
+#if defined(FEAT_VIRTUALEDIT) || defined(PROTO)
+/*
+ * Get virtual column in virtual mode.
+ */
+ void
+getvvcol(wp, pos, start, cursor, end)
+ win_T *wp;
+ pos_T *pos;
+ colnr_T *start;
+ colnr_T *cursor;
+ colnr_T *end;
+{
+ colnr_T col;
+ colnr_T coladd;
+ colnr_T endadd;
+# ifdef FEAT_MBYTE
+ char_u *ptr;
+# endif
+
+ if (virtual_active())
+ {
+ /* For virtual mode, only want one value */
+ getvcol(wp, pos, &col, NULL, NULL);
+
+ coladd = pos->coladd;
+ endadd = 0;
+# ifdef FEAT_MBYTE
+ /* Cannot put the cursor on part of a wide character. */
+ ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE);
+ if (pos->col < STRLEN(ptr))
+ {
+ int c = (*mb_ptr2char)(ptr + pos->col);
+
+ if (c != TAB && vim_isprintc(c))
+ {
+ endadd = char2cells(c) - 1;
+ if (coladd >= endadd)
+ coladd -= endadd;
+ else
+ coladd = 0;
+ }
+ }
+# endif
+ col += coladd;
+ if (start != NULL)
+ *start = col;
+ if (cursor != NULL)
+ *cursor = col;
+ if (end != NULL)
+ *end = col + endadd;
+ }
+ else
+ getvcol(wp, pos, start, cursor, end);
+}
+#endif
+
+#if defined(FEAT_VISUAL) || defined(PROTO)
+/*
+ * Get the leftmost and rightmost virtual column of pos1 and pos2.
+ * Used for Visual block mode.
+ */
+ void
+getvcols(wp, pos1, pos2, left, right)
+ win_T *wp;
+ pos_T *pos1, *pos2;
+ colnr_T *left, *right;
+{
+ colnr_T from1, from2, to1, to2;
+
+ if (ltp(pos1, pos2))
+ {
+ getvvcol(wp, pos1, &from1, NULL, &to1);
+ getvvcol(wp, pos2, &from2, NULL, &to2);
+ }
+ else
+ {
+ getvvcol(wp, pos2, &from1, NULL, &to1);
+ getvvcol(wp, pos1, &from2, NULL, &to2);
+ }
+ if (from2 < from1)
+ *left = from2;
+ else
+ *left = from1;
+ if (to2 > to1)
+ {
+ if (*p_sel == 'e' && from2 - 1 >= to1)
+ *right = from2 - 1;
+ else
+ *right = to2;
+ }
+ else
+ *right = to1;
+}
+#endif
+
+/*
+ * skipwhite: skip over ' ' and '\t'.
+ */
+ char_u *
+skipwhite(p)
+ char_u *p;
+{
+ while (vim_iswhite(*p)) /* skip to next non-white */
+ ++p;
+ return p;
+}
+
+/*
+ * skipdigits: skip over digits;
+ */
+ char_u *
+skipdigits(p)
+ char_u *p;
+{
+ while (VIM_ISDIGIT(*p)) /* skip to next non-digit */
+ ++p;
+ return p;
+}
+
+/*
+ * Variant of isdigit() that can handle characters > 0x100.
+ * We don't use isdigit() here, because on some systems it also considers
+ * superscript 1 to be a digit.
+ * Use the VIM_ISDIGIT() macro for simple arguments.
+ */
+ int
+vim_isdigit(c)
+ int c;
+{
+ return (c >= '0' && c <= '9');
+}
+
+/*
+ * Variant of isxdigit() that can handle characters > 0x100.
+ * We don't use isxdigit() here, because on some systems it also considers
+ * superscript 1 to be a digit.
+ */
+ int
+vim_isxdigit(c)
+ int c;
+{
+ return (c >= '0' && c <= '9')
+ || (c >= 'a' && c <= 'f')
+ || (c >= 'A' && c <= 'F');
+}
+
+/*
+ * skiptowhite: skip over text until ' ' or '\t' or NUL.
+ */
+ char_u *
+skiptowhite(p)
+ char_u *p;
+{
+ while (*p != ' ' && *p != '\t' && *p != NUL)
+ ++p;
+ return p;
+}
+
+#if defined(FEAT_LISTCMDS) || defined(FEAT_SIGNS) || defined(FEAT_SNIFF) \
+ || defined(PROTO)
+/*
+ * skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
+ */
+ char_u *
+skiptowhite_esc(p)
+ char_u *p;
+{
+ while (*p != ' ' && *p != '\t' && *p != NUL)
+ {
+ if ((*p == '\\' || *p == Ctrl_V) && *(p + 1) != NUL)
+ ++p;
+ ++p;
+ }
+ return p;
+}
+#endif
+
+/*
+ * Getdigits: Get a number from a string and skip over it.
+ * Note: the argument is a pointer to a char_u pointer!
+ */
+ long
+getdigits(pp)
+ char_u **pp;
+{
+ char_u *p;
+ long retval;
+
+ p = *pp;
+ retval = atol((char *)p);
+ if (*p == '-') /* skip negative sign */
+ ++p;
+ p = skipdigits(p); /* skip to next non-digit */
+ *pp = p;
+ return retval;
+}
+
+/*
+ * Return TRUE if "lbuf" is empty or only contains blanks.
+ */
+ int
+vim_isblankline(lbuf)
+ char_u *lbuf;
+{
+ char_u *p;
+
+ p = skipwhite(lbuf);
+ return (*p == NUL || *p == '\r' || *p == '\n');
+}
+
+/*
+ * Convert a string into a long and/or unsigned long, taking care of
+ * hexadecimal and octal numbers.
+ * If "hexp" is not NULL, returns a flag to indicate the type of the number:
+ * 0 decimal
+ * '0' octal
+ * 'X' hex
+ * 'x' hex
+ * If "len" is not NULL, the length of the number in characters is returned.
+ * If "nptr" is not NULL, the signed result is returned in it.
+ * If "unptr" is not NULL, the unsigned result is returned in it.
+ */
+ void
+vim_str2nr(start, hexp, len, dooct, dohex, nptr, unptr)
+ char_u *start;
+ int *hexp; /* return: type of number 0 = decimal, 'x'
+ or 'X' is hex, '0' = octal */
+ int *len; /* return: detected length of number */
+ int dooct; /* recognize octal number */
+ int dohex; /* recognize hex number */
+ long *nptr; /* return: signed result */
+ unsigned long *unptr; /* return: unsigned result */
+{
+ char_u *ptr = start;
+ int hex = 0; /* default is decimal */
+ int negative = FALSE;
+ long n = 0;
+ unsigned long un = 0;
+
+ if (ptr[0] == '-')
+ {
+ negative = TRUE;
+ ++ptr;
+ }
+
+ if (ptr[0] == '0') /* could be hex or octal */
+ {
+ hex = ptr[1];
+ if (dohex && (hex == 'X' || hex == 'x') && vim_isxdigit(ptr[2]))
+ ptr += 2; /* hexadecimal */
+ else
+ {
+ if (dooct && VIM_ISDIGIT(hex))
+ hex = '0'; /* octal */
+ else
+ hex = 0; /* 0 by itself is decimal */
+ }
+ }
+
+ /*
+ * Do the string-to-numeric conversion "manually" to avoid sscanf quirks.
+ */
+ if (hex)
+ {
+ if (hex == '0')
+ {
+ /* octal */
+ while ('0' <= *ptr && *ptr <= '7')
+ {
+ n = 8 * n + (long)(*ptr - '0');
+ un = 8 * un + (unsigned long)(*ptr - '0');
+ ++ptr;
+ }
+ }
+ else
+ {
+ /* hex */
+ while (vim_isxdigit(*ptr))
+ {
+ n = 16 * n + (long)hex2nr(*ptr);
+ un = 16 * un + (unsigned long)hex2nr(*ptr);
+ ++ptr;
+ }
+ }
+ }
+ else
+ {
+ /* decimal */
+ while (VIM_ISDIGIT(*ptr))
+ {
+ n = 10 * n + (long)(*ptr - '0');
+ un = 10 * un + (unsigned long)(*ptr - '0');
+ ++ptr;
+ }
+ }
+
+ if (!hex && negative) /* account for leading '-' for decimal numbers */
+ n = -n;
+
+ if (hexp != NULL)
+ *hexp = hex;
+ if (len != NULL)
+ *len = (int)(ptr - start);
+ if (nptr != NULL)
+ *nptr = n;
+ if (unptr != NULL)
+ *unptr = un;
+}
+
+/*
+ * Return the value of a single hex character.
+ * Only valid when the argument is '0' - '9', 'A' - 'F' or 'a' - 'f'.
+ */
+ int
+hex2nr(c)
+ int c;
+{
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ if (c >= 'A' && c <= 'F')
+ return c - 'A' + 10;
+ return c - '0';
+}
+
+#if defined(FEAT_TERMRESPONSE) \
+ || (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) || defined(PROTO)
+/*
+ * Convert two hex characters to a byte.
+ * Return -1 if one of the characters is not hex.
+ */
+ int
+hexhex2nr(p)
+ char_u *p;
+{
+ if (!vim_isxdigit(p[0]) || !vim_isxdigit(p[1]))
+ return -1;
+ return (hex2nr(p[0]) << 4) + hex2nr(p[1]);
+}
+#endif
+
+/*
+ * Return TRUE if "str" starts with a backslash that should be removed.
+ * For MS-DOS, WIN32 and OS/2 this is only done when the character after the
+ * backslash is not a normal file name character.
+ * '$' is a valid file name character, we don't remove the backslash before
+ * it. This means it is not possible to use an environment variable after a
+ * backslash. "C:\$VIM\doc" is taken literally, only "$VIM\doc" works.
+ * Although "\ name" is valid, the backslash in "Program\ files" must be
+ * removed. Assume a file name doesn't start with a space.
+ * For multi-byte names, never remove a backslash before a non-ascii
+ * character, assume that all multi-byte characters are valid file name
+ * characters.
+ */
+ int
+rem_backslash(str)
+ char_u *str;
+{
+#ifdef BACKSLASH_IN_FILENAME
+ return (str[0] == '\\'
+# ifdef FEAT_MBYTE
+ && str[1] < 0x80
+# endif
+ && (str[1] == ' '
+ || (str[1] != NUL
+ && str[1] != '*'
+ && str[1] != '?'
+ && !vim_isfilec(str[1]))));
+#else
+ return (str[0] == '\\' && str[1] != NUL);
+#endif
+}
+
+/*
+ * Halve the number of backslashes in a file name argument.
+ * For MS-DOS we only do this if the character after the backslash
+ * is not a normal file character.
+ */
+ void
+backslash_halve(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ if (rem_backslash(p))
+ STRCPY(p, p + 1);
+}
+
+/*
+ * backslash_halve() plus save the result in allocated memory.
+ */
+ char_u *
+backslash_halve_save(p)
+ char_u *p;
+{
+ char_u *res;
+
+ res = vim_strsave(p);
+ if (res == NULL)
+ return p;
+ backslash_halve(res);
+ return res;
+}
+
+#if (defined(EBCDIC) && defined(FEAT_POSTSCRIPT)) || defined(PROTO)
+/*
+ * Table for EBCDIC to ASCII conversion unashamedly taken from xxd.c!
+ * The first 64 entries have been added to map control characters defined in
+ * ascii.h
+ */
+static char_u ebcdic2ascii_tab[256] =
+{
+ 0000, 0001, 0002, 0003, 0004, 0011, 0006, 0177,
+ 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
+ 0020, 0021, 0022, 0023, 0024, 0012, 0010, 0027,
+ 0030, 0031, 0032, 0033, 0033, 0035, 0036, 0037,
+ 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
+ 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
+ 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
+ 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
+ 0040, 0240, 0241, 0242, 0243, 0244, 0245, 0246,
+ 0247, 0250, 0325, 0056, 0074, 0050, 0053, 0174,
+ 0046, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
+ 0260, 0261, 0041, 0044, 0052, 0051, 0073, 0176,
+ 0055, 0057, 0262, 0263, 0264, 0265, 0266, 0267,
+ 0270, 0271, 0313, 0054, 0045, 0137, 0076, 0077,
+ 0272, 0273, 0274, 0275, 0276, 0277, 0300, 0301,
+ 0302, 0140, 0072, 0043, 0100, 0047, 0075, 0042,
+ 0303, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 0150, 0151, 0304, 0305, 0306, 0307, 0310, 0311,
+ 0312, 0152, 0153, 0154, 0155, 0156, 0157, 0160,
+ 0161, 0162, 0136, 0314, 0315, 0316, 0317, 0320,
+ 0321, 0345, 0163, 0164, 0165, 0166, 0167, 0170,
+ 0171, 0172, 0322, 0323, 0324, 0133, 0326, 0327,
+ 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
+ 0340, 0341, 0342, 0343, 0344, 0135, 0346, 0347,
+ 0173, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
+ 0110, 0111, 0350, 0351, 0352, 0353, 0354, 0355,
+ 0175, 0112, 0113, 0114, 0115, 0116, 0117, 0120,
+ 0121, 0122, 0356, 0357, 0360, 0361, 0362, 0363,
+ 0134, 0237, 0123, 0124, 0125, 0126, 0127, 0130,
+ 0131, 0132, 0364, 0365, 0366, 0367, 0370, 0371,
+ 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
+ 0070, 0071, 0372, 0373, 0374, 0375, 0376, 0377
+};
+
+/*
+ * Convert a buffer worth of characters from EBCDIC to ASCII. Only useful if
+ * wanting 7-bit ASCII characters out the other end.
+ */
+ void
+ebcdic2ascii(buffer, len)
+ char_u *buffer;
+ int len;
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ buffer[i] = ebcdic2ascii_tab[buffer[i]];
+}
+#endif
diff --git a/src/config.aap.in b/src/config.aap.in
new file mode 100644
index 000000000..7ec74d249
--- /dev/null
+++ b/src/config.aap.in
@@ -0,0 +1,115 @@
+# config.aap.in: recipe transformed into auto/config.aap by configure.
+
+VIMNAME = @VIMNAME@
+EXNAME = @EXNAME@
+VIEWNAME = @VIEWNAME@
+
+CC = @CC@
+DEFS = @DEFS@
+CONF_CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+srcdir = @srcdir@
+VPATH = @srcdir@
+CONF_LDFLAGS = @LDFLAGS@
+CONF_LIBS = @LIBS@
+TAGPRG = @TAGPRG@
+
+CPP = @CPP@
+CPP_MM = @CPP_MM@
+X_CFLAGS = @X_CFLAGS@
+X_LIBS_DIR = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIB@
+
+PERL = @vi_cv_path_perl@
+PERLLIB = @vi_cv_perllib@
+PERL_LIBS = @PERL_LIBS@
+SHRPENV = @shrpenv@
+PERL_SRC = @PERL_SRC@
+PERL_OBJ = @PERL_OBJ@
+PERL_PRO = @PERL_PRO@
+PERL_CFLAGS = @PERL_CFLAGS@
+
+PYTHON_SRC = @PYTHON_SRC@
+PYTHON_OBJ = @PYTHON_OBJ@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_CONFDIR = @PYTHON_CONFDIR@
+PYTHON_GETPATH_CFLAGS = @PYTHON_GETPATH_CFLAGS@
+
+TCL = @vi_cv_path_tcl@
+TCL_SRC = @TCL_SRC@
+TCL_OBJ = @TCL_OBJ@
+TCL_PRO = @TCL_PRO@
+TCL_CFLAGS = @TCL_CFLAGS@
+TCL_LIBS = @TCL_LIBS@
+
+HANGULIN_SRC = @HANGULIN_SRC@
+HANGULIN_OBJ = @HANGULIN_OBJ@
+
+WORKSHOP_SRC = @WORKSHOP_SRC@
+WORKSHOP_OBJ = @WORKSHOP_OBJ@
+
+NETBEANS_SRC = @NETBEANS_SRC@
+NETBEANS_OBJ = @NETBEANS_OBJ@
+
+RUBY = @vi_cv_path_ruby@
+RUBY_SRC = @RUBY_SRC@
+RUBY_OBJ = @RUBY_OBJ@
+RUBY_PRO = @RUBY_PRO@
+RUBY_CFLAGS = @RUBY_CFLAGS@
+RUBY_LIBS = @RUBY_LIBS@
+
+SNIFF_SRC = @SNIFF_SRC@
+SNIFF_OBJ = @SNIFF_OBJ@
+
+AWK = @AWK@
+
+STRIP = @STRIP@
+
+EXEEXT = @EXEEXT@
+
+COMPILEDBY = @compiledby@
+
+INSTALLVIMDIFF = @dovimdiff@
+INSTALLGVIMDIFF = @dogvimdiff@
+
+### Line break character as octal number for "tr"
+NL = @line_break@
+
+### Top directory for everything
+# Can be overruled with "PREFIX=dir", thus delay using it.
+prefix = @prefix@
+
+### Top directory for the binary
+exec_prefix $= @exec_prefix@
+
+### Prefix for location of data files
+BINDIR $= @bindir@
+
+### Prefix for location of data files
+DATADIR $= @datadir@
+
+### Prefix for location of man pages
+MANDIR $= @mandir@
+
+### Do we have a GUI
+GUI = @GUITYPE@
+NARROW_PROTO = @NARROW_PROTO@
+GTK_LIBNAME = @GTK_LIBNAME@
+MOTIF_LIBNAME = @MOTIF_LIBNAME@
+GUI_INC_LOC = @GUI_INC_LOC@
+GUI_LIB_LOC = @GUI_LIB_LOC@
+GUI_X_LIBS = @GUI_X_LIBS@
+
+### Any OS dependent extra source and object file
+OS_EXTRA_SRC = @OS_EXTRA_SRC@
+OS_EXTRA_OBJ = @OS_EXTRA_OBJ@
+
+### If the *.po files are to be translated to *.mo files.
+MAKEMO = @MAKEMO@
+
+# Make sure that "make first" will run "make all" once configure has done its
+# work. This is needed when using the Makefile in the top directory.
+first: all
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 000000000..bba26623c
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,361 @@
+/*
+ * config.h.in. Generated automatically from configure.in by autoheader, and
+ * manually changed after that.
+ */
+
+/* Define if we have EBCDIC code */
+#undef EBCDIC
+
+/* Define unless no X support found */
+#undef HAVE_X11
+
+/* Define when terminfo support found */
+#undef TERMINFO
+
+/* Define when termcap.h contains ospeed */
+#undef HAVE_OSPEED
+
+/* Define when ospeed can be extern */
+#undef OSPEED_EXTERN
+
+/* Define when termcap.h contains UP, BC and PC */
+#undef HAVE_UP_BC_PC
+
+/* Define when UP, BC and PC can be extern */
+#undef UP_BC_PC_EXTERN
+
+/* Define when termcap.h defines outfuntype */
+#undef HAVE_OUTFUNTYPE
+
+/* Define when __DATE__ " " __TIME__ can be used */
+#undef HAVE_DATE_TIME
+
+/* defined always when using configure */
+#undef UNIX
+
+/* Defined to the size of an int */
+#undef SIZEOF_INT
+
+/*
+ * If we cannot trust one of the following from the libraries, we use our
+ * own safe but probably slower vim_memmove().
+ */
+#undef USEBCOPY
+#undef USEMEMMOVE
+#undef USEMEMCPY
+
+/* Define when "man -s 2" is to be used */
+#undef USEMAN_S
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef mode_t
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef ino_t
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef dev_t
+
+/* Define to `unsigned long' if <sys/types.h> doesn't define. */
+#undef rlim_t
+
+/* Define to `struct sigaltstack' if <signal.h> doesn't define. */
+#undef stack_t
+
+/* Define if stack_t has the ss_base field. */
+#undef HAVE_SS_BASE
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if you can safely include both <sys/time.h> and <sys/select.h>. */
+#undef SYS_SELECT_WITH_SYS_TIME
+
+/* Define if you have /dev/ptc */
+#undef HAVE_DEV_PTC
+
+/* Define if you have Sys4 ptys */
+#undef HAVE_SVR4_PTYS
+
+/* Define to range of pty names to try */
+#undef PTYRANGE0
+#undef PTYRANGE1
+
+/* Define mode for pty */
+#undef PTYMODE
+
+/* Define group for pty */
+#undef PTYGROUP
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define as the command at the end of signal handlers ("" or "return 0;"). */
+#undef SIGRETURN
+
+/* Define if struct sigcontext is present */
+#undef HAVE_SIGCONTEXT
+
+/* Define if touuper/tolower only work on lower/upercase characters */
+#undef BROKEN_TOUPPER
+
+/* Define if stat() ignores a trailing slash */
+#undef STAT_IGNORES_SLASH
+
+/* Define if tgetstr() has a second argument that is (char *) */
+#undef TGETSTR_CHAR_P
+
+/* Define if tgetent() returns zero for an error */
+#undef TGETENT_ZERO_ERR
+
+/* Define if the getcwd() function should not be used. */
+#undef BAD_GETCWD
+
+/* Define if you the function: */
+#undef HAVE_BCMP
+#undef HAVE_FCHDIR
+#undef HAVE_FCHOWN
+#undef HAVE_FSEEKO
+#undef HAVE_FSYNC
+#undef HAVE_FTELLO
+#undef HAVE_GETCWD
+#undef HAVE_GETPSEUDOTTY
+#undef HAVE_GETPWNAM
+#undef HAVE_GETPWUID
+#undef HAVE_GETRLIMIT
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_GETWD
+#undef HAVE_ICONV
+#undef HAVE_NL_LANGINFO_CODESET
+#undef HAVE_LSTAT
+#undef HAVE_MEMCMP
+#undef HAVE_MEMSET
+#undef HAVE_NANOSLEEP
+#undef HAVE_OPENDIR
+#undef HAVE_PUTENV
+#undef HAVE_QSORT
+#undef HAVE_READLINK
+#undef HAVE_RENAME
+#undef HAVE_SELECT
+#undef HAVE_SETENV
+#undef HAVE_SETPGID
+#undef HAVE_SETSID
+#undef HAVE_SIGACTION
+#undef HAVE_SIGALTSTACK
+#undef HAVE_SIGSET
+#undef HAVE_SIGSETJMP
+#undef HAVE_SIGSTACK
+#undef HAVE_SIGVEC
+#undef HAVE_SNPRINTF
+#undef HAVE_STRCASECMP
+#undef HAVE_STRERROR
+#undef HAVE_STRFTIME
+#undef HAVE_STRICMP
+#undef HAVE_STRNCASECMP
+#undef HAVE_STRNICMP
+#undef HAVE_STRPBRK
+#undef HAVE_STRTOL
+#undef HAVE_ST_BLKSIZE
+#undef HAVE_SYSCONF
+#undef HAVE_SYSCTL
+#undef HAVE_SYSINFO
+#undef HAVE_TGETENT
+#undef HAVE_TOWLOWER
+#undef HAVE_TOWUPPER
+#undef HAVE_USLEEP
+#undef HAVE_UTIME
+#undef HAVE_BIND_TEXTDOMAIN_CODESET
+
+/* Define if you do not have utime(), but do have the utimes() function. */
+#undef HAVE_UTIMES
+
+/* Define if you have the header file: */
+#undef HAVE_DIRENT_H
+#undef HAVE_ERRNO_H
+#undef HAVE_FCNTL_H
+#undef HAVE_FRAME_H
+#undef HAVE_ICONV_H
+#undef HAVE_LANGINFO_H
+#undef HAVE_LIBC_H
+#undef HAVE_LIBGEN_H
+#undef HAVE_LIBINTL_H
+#undef HAVE_LOCALE_H
+#undef HAVE_NDIR_H
+#undef HAVE_POLL_H
+#undef HAVE_PTHREAD_NP_H
+#undef HAVE_PWD_H
+#undef HAVE_SETJMP_H
+#undef HAVE_SGTTY_H
+#undef HAVE_STRINGS_H
+#undef HAVE_STROPTS_H
+#undef HAVE_SYS_ACCESS_H
+#undef HAVE_SYS_ACL_H
+#undef HAVE_SYS_DIR_H
+#undef HAVE_SYS_IOCTL_H
+#undef HAVE_SYS_NDIR_H
+#undef HAVE_SYS_PARAM_H
+#undef HAVE_SYS_POLL_H
+#undef HAVE_SYS_PTEM_H
+#undef HAVE_SYS_RESOURCE_H
+#undef HAVE_SYS_SELECT_H
+#undef HAVE_SYS_STATFS_H
+#undef HAVE_SYS_STREAM_H
+#undef HAVE_SYS_SYSCTL_H
+#undef HAVE_SYS_SYSINFO_H
+#undef HAVE_SYS_SYSTEMINFO_H
+#undef HAVE_SYS_TIME_H
+#undef HAVE_SYS_UTSNAME_H
+#undef HAVE_WCHAR_H
+#undef HAVE_TERMCAP_H
+#undef HAVE_TERMIOS_H
+#undef HAVE_TERMIO_H
+#undef HAVE_UNISTD_H
+#undef HAVE_UTIL_DEBUG_H
+#undef HAVE_UTIL_MSGI18N_H
+#undef HAVE_UTIME_H
+#undef HAVE_X11_SUNKEYSYM_H
+#undef HAVE_XM_XM_H
+#undef HAVE_XM_XPMP_H
+#undef HAVE_X11_XPM_H
+#undef HAVE_X11_XMU_EDITRES_H
+#undef HAVE_X11_SM_SMLIB_H
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have a <sys/wait.h> that is not POSIX.1 compatible. */
+#undef HAVE_UNION_WAIT
+
+/* This is currently unused in vim: */
+/* Define if you have the ANSI C header files. */
+/* #undef STDC_HEADERS */
+
+/* instead, we check a few STDC things ourselves */
+#undef HAVE_STDARG_H
+#undef HAVE_STDLIB_H
+#undef HAVE_STRING_H
+
+/* Define if strings.h cannot be included when strings.h already is */
+#undef NO_STRINGS_WITH_STRING_H
+
+/* Define if you want tiny features. */
+#undef FEAT_TINY
+
+/* Define if you want small features. */
+#undef FEAT_SMALL
+
+/* Define if you want normal features. */
+#undef FEAT_NORMAL
+
+/* Define if you want big features. */
+#undef FEAT_BIG
+
+/* Define if you want huge features. */
+#undef FEAT_HUGE
+
+/* Define if you want to include the Perl interpreter. */
+#undef FEAT_PERL
+
+/* Define if you want to include the Python interpreter. */
+#undef FEAT_PYTHON
+
+/* Define if you want to include the Ruby interpreter. */
+#undef FEAT_RUBY
+
+/* Define if you want to include the Tcl interpreter. */
+#undef FEAT_TCL
+
+/* Define if you want to include the Sniff interface. */
+#undef FEAT_SNIFF
+
+/* Define if you want to add support for ACL */
+#undef HAVE_POSIX_ACL
+#undef HAVE_SOLARIS_ACL
+#undef HAVE_AIX_ACL
+
+/* Define if you want to add support of GPM (Linux console mouse daemon) */
+#undef HAVE_GPM
+
+/* Define if you want to include the Cscope interface. */
+#undef FEAT_CSCOPE
+
+/* Define if you want to include multibyte support. */
+#undef FEAT_MBYTE
+
+/* Define if you want to include fontset support. */
+#undef FEAT_XFONTSET
+
+/* Define if you want to include XIM support. */
+#undef FEAT_XIM
+
+/* Define if you want to include Hangul input support. */
+#undef FEAT_HANGULIN
+
+/* Define if you use GTK and want GNOME support. */
+#undef FEAT_GUI_GNOME
+
+/* Define if GTK+ 2 is available. */
+#undef HAVE_GTK2
+
+/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
+#undef HAVE_GTK_MULTIHEAD
+
+/* Define if your X has own locale library */
+#undef X_LOCALE
+
+/* Define if we have dlfcn.h. */
+#undef HAVE_DLFCN_H
+
+/* Define if there is a working gettext(). */
+#undef HAVE_GETTEXT
+
+/* Define if _nl_msg_cat_cntr is present. */
+#undef HAVE_NL_MSG_CAT_CNTR
+
+/* Define if we have dlopen() */
+#undef HAVE_DLOPEN
+
+/* Define if we have dlsym() */
+#undef HAVE_DLSYM
+
+/* Define if we have dl.h. */
+#undef HAVE_DL_H
+
+/* Define if we have shl_load() */
+#undef HAVE_SHL_LOAD
+
+/* Define if you want to include Sun Visual Workshop support. */
+#undef FEAT_SUN_WORKSHOP
+
+/* Define if you want to include NetBeans integration. */
+#undef FEAT_NETBEANS_INTG
+
+/* Define default global runtime path */
+#undef RUNTIME_GLOBAL
+
+/* Define name of who modified a released Vim */
+#undef MODIFIED_BY
+
+/* Define if you want XSMP interaction as well as vanilla swapfile safety */
+#undef USE_XSMP_INTERACT
+
+/* Define if vsnprintf() works */
+#undef HAVE_VSNPRINTF
diff --git a/src/config.mk.dist b/src/config.mk.dist
new file mode 100644
index 000000000..fa7c10850
--- /dev/null
+++ b/src/config.mk.dist
@@ -0,0 +1,5 @@
+the first targets to make vim are: scratch config myself
+srcdir = .
+VIMNAME = vim
+EXNAME = ex
+VIEWNAME = view
diff --git a/src/config.mk.in b/src/config.mk.in
new file mode 100644
index 000000000..046649921
--- /dev/null
+++ b/src/config.mk.in
@@ -0,0 +1,137 @@
+#
+# config.mk.in -- autoconf template for Vim on Unix vim:ts=8:sw=8:
+#
+# DO NOT EDIT config.mk!! It will be overwritten by configure.
+# Edit Makefile and run "make" or run ./configure with other arguments.
+#
+# Configure does not edit the makefile directly. This method is not the
+# standard use of GNU autoconf, but it has two advantages:
+# a) The user can override every choice made by configure.
+# b) Modifications to the makefile are not lost when configure is run.
+#
+# I hope this is worth being nonstandard. jw.
+
+@SET_MAKE@
+
+VIMNAME = @VIMNAME@
+EXNAME = @EXNAME@
+VIEWNAME = @VIEWNAME@
+
+CC = @CC@
+DEFS = @DEFS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+srcdir = @srcdir@
+VPATH = @srcdir@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+TAGPRG = @TAGPRG@
+
+CPP = @CPP@
+CPP_MM = @CPP_MM@
+X_CFLAGS = @X_CFLAGS@
+X_LIBS_DIR = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIB@
+
+PERL = @vi_cv_path_perl@
+PERLLIB = @vi_cv_perllib@
+PERL_LIBS = @PERL_LIBS@
+SHRPENV = @shrpenv@
+PERL_SRC = @PERL_SRC@
+PERL_OBJ = @PERL_OBJ@
+PERL_PRO = @PERL_PRO@
+PERL_CFLAGS = @PERL_CFLAGS@
+
+PYTHON_SRC = @PYTHON_SRC@
+PYTHON_OBJ = @PYTHON_OBJ@
+PYTHON_CFLAGS = @PYTHON_CFLAGS@
+PYTHON_LIBS = @PYTHON_LIBS@
+PYTHON_CONFDIR = @PYTHON_CONFDIR@
+PYTHON_GETPATH_CFLAGS = @PYTHON_GETPATH_CFLAGS@
+
+TCL = @vi_cv_path_tcl@
+TCL_SRC = @TCL_SRC@
+TCL_OBJ = @TCL_OBJ@
+TCL_PRO = @TCL_PRO@
+TCL_CFLAGS = @TCL_CFLAGS@
+TCL_LIBS = @TCL_LIBS@
+
+HANGULIN_SRC = @HANGULIN_SRC@
+HANGULIN_OBJ = @HANGULIN_OBJ@
+
+WORKSHOP_SRC = @WORKSHOP_SRC@
+WORKSHOP_OBJ = @WORKSHOP_OBJ@
+
+NETBEANS_SRC = @NETBEANS_SRC@
+NETBEANS_OBJ = @NETBEANS_OBJ@
+
+RUBY = @vi_cv_path_ruby@
+RUBY_SRC = @RUBY_SRC@
+RUBY_OBJ = @RUBY_OBJ@
+RUBY_PRO = @RUBY_PRO@
+RUBY_CFLAGS = @RUBY_CFLAGS@
+RUBY_LIBS = @RUBY_LIBS@
+
+SNIFF_SRC = @SNIFF_SRC@
+SNIFF_OBJ = @SNIFF_OBJ@
+
+AWK = @AWK@
+
+STRIP = @STRIP@
+
+EXEEXT = @EXEEXT@
+
+COMPILEDBY = @compiledby@
+
+INSTALLVIMDIFF = @dovimdiff@
+INSTALLGVIMDIFF = @dogvimdiff@
+
+### Line break character as octal number for "tr"
+NL = @line_break@
+
+### Top directory for everything
+prefix = @prefix@
+
+### Top directory for the binary
+exec_prefix = @exec_prefix@
+
+### Prefix for location of data files
+BINDIR = @bindir@
+
+### Prefix for location of data files
+DATADIR = @datadir@
+
+### Prefix for location of man pages
+MANDIR = @mandir@
+
+### Do we have a GUI
+GUI_INC_LOC = @GUI_INC_LOC@
+GUI_LIB_LOC = @GUI_LIB_LOC@
+GUI_SRC = $(@GUITYPE@_SRC)
+GUI_OBJ = $(@GUITYPE@_OBJ)
+GUI_DEFS = $(@GUITYPE@_DEFS)
+GUI_IPATH = $(@GUITYPE@_IPATH)
+GUI_LIBS_DIR = $(@GUITYPE@_LIBS_DIR)
+GUI_LIBS1 = $(@GUITYPE@_LIBS1)
+GUI_LIBS2 = $(@GUITYPE@_LIBS2)
+GUI_INSTALL = $(@GUITYPE@_INSTALL)
+GUI_TARGETS = $(@GUITYPE@_TARGETS)
+GUI_MAN_TARGETS = $(@GUITYPE@_MAN_TARGETS)
+GUI_TESTTARGET = $(@GUITYPE@_TESTTARGET)
+NARROW_PROTO = @NARROW_PROTO@
+GUI_X_LIBS = @GUI_X_LIBS@
+MOTIF_LIBNAME = @MOTIF_LIBNAME@
+GTK_LIBNAME = @GTK_LIBNAME@
+
+### Any OS dependent extra source and object file
+OS_EXTRA_SRC = @OS_EXTRA_SRC@
+OS_EXTRA_OBJ = @OS_EXTRA_OBJ@
+
+### If the *.po files are to be translated to *.mo files.
+MAKEMO = @MAKEMO@
+
+# Make sure that "make first" will run "make all" once configure has done its
+# work. This is needed when using the Makefile in the top directory.
+first: all
diff --git a/src/configure b/src/configure
new file mode 100755
index 000000000..be225eda6
--- /dev/null
+++ b/src/configure
@@ -0,0 +1,4 @@
+#! /bin/sh
+# run the automatically generated configure script
+CONFIG_STATUS=auto/config.status \
+ auto/configure "$@" --srcdir="${srcdir-.}" --cache-file=auto/config.cache
diff --git a/src/configure.in b/src/configure.in
new file mode 100644
index 000000000..2c23e0611
--- /dev/null
+++ b/src/configure.in
@@ -0,0 +1,2660 @@
+dnl configure.in: autoconf script for Vim
+
+dnl Process this file with autoconf 2.12 or 2.13 to produce "configure".
+dnl Should also work with autoconf 2.54 and later.
+
+AC_INIT(vim.h)
+AC_CONFIG_HEADER(auto/config.h:config.h.in)
+
+dnl Being able to run configure means the system is Unix (compatible).
+AC_DEFINE(UNIX)
+AC_PROG_MAKE_SET
+
+dnl Checks for programs.
+AC_PROG_CC dnl required by almost everything
+AC_PROG_CPP dnl required by header file checks
+AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
+AC_ISC_POSIX dnl required by AC_C_CROSS
+AC_PROG_AWK dnl required for "make html" in ../doc
+
+dnl Don't strip if we don't have it
+AC_CHECK_PROG(STRIP, strip, strip, :)
+
+dnl Check for extention of executables
+AC_EXEEXT
+
+dnl Set default value for CFLAGS if none is defined or it's empty
+if test -z "$CFLAGS"; then
+ CFLAGS="-O"
+ test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
+fi
+if test "$GCC" = yes; then
+ gccversion=`"$CC" --version | sed -e '2,$d;s/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
+ if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2"; then
+ echo 'GCC 3.0.x has a bug in the optimizer, disabling "-O#"'
+ CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
+ else
+ if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
+ echo 'GCC 3.1 and 3.2 have a bug in the optimizer, adding "-fno-strength-reduce"'
+ CFLAGS="$CFLAGS -fno-strength-reduce"
+ fi
+ fi
+fi
+
+dnl If configure thinks we are cross compiling, there is probably something
+dnl wrong with the CC or CFLAGS settings, give an understandable error message
+if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([cannot compile a simple program, check CC and CFLAGS
+ (cross compiling doesn't work)])
+fi
+
+dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies
+test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
+
+if test -f ./toolcheck; then
+ AC_CHECKING(for buggy tools)
+ sh ./toolcheck 1>&AC_FD_MSG
+fi
+
+OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
+
+dnl Check for BeOS, which needs an extra source file
+AC_MSG_CHECKING(for BeOS)
+case `uname` in
+ BeOS) OS_EXTRA_SRC=os_beos.c; OS_EXTRA_OBJ=objects/os_beos.o
+ BEOS=yes; AC_MSG_RESULT(yes);;
+ *) BEOS=no; AC_MSG_RESULT(no);;
+esac
+
+dnl If QNX is found, assume we don't want to use Xphoton
+dnl unless it was specifically asked for (--with-x)
+AC_MSG_CHECKING(for QNX)
+case `uname` in
+ QNX) OS_EXTRA_SRC=os_qnx.c; OS_EXTRA_OBJ=objects/os_qnx.o
+ test -z "$with_x" && with_x=no
+ QNX=yes; AC_MSG_RESULT(yes);;
+ *) QNX=no; AC_MSG_RESULT(no);;
+esac
+
+dnl Check for Darwin and MacOS X
+dnl We do a check for MacOS X in the very beginning because there
+dnl are a lot of other things we need to change besides GUI stuff
+DEFAULT_VIMNAME=vim
+AC_MSG_CHECKING([for Darwin (Mac OS X)])
+if test "`(uname) 2>/dev/null`" = Darwin; then
+ AC_MSG_RESULT(yes)
+
+ AC_MSG_CHECKING(--disable-darwin argument)
+ AC_ARG_ENABLE(darwin,
+ [ --disable-darwin Disable Darwin (Mac OS X) support.],
+ , [enable_darwin="yes"])
+ if test "$enable_darwin" = "yes"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if Darwin files are there)
+ if test -f os_macosx.c; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT([no, Darwin support disabled])
+ enable_darwin=no
+ fi
+ else
+ AC_MSG_RESULT([yes, Darwin support excluded])
+ fi
+
+ if test "$enable_darwin" = "yes"; then
+ MACOSX=yes
+ OS_EXTRA_SCR="os_macosx.c";
+ OS_EXTRA_OBJ="objects/os_macosx.o"
+ CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
+
+ dnl If Carbon is found, assume we don't want X11
+ dnl unless it was specifically asked for (--with-x)
+ AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
+ if test "x$CARBON" = "xyes"; then
+ if test -z "$with_x"; then
+ with_x=no
+ DEFAULT_VIMNAME=Vim
+ fi
+ fi
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_SUBST(OS_EXTRA_SRC)
+AC_SUBST(OS_EXTRA_OBJ)
+
+dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
+dnl Only when the directory exists and it wasn't there yet.
+dnl For gcc don't do this when it is already in the default search path.
+have_local_include=''
+have_local_lib=''
+if test "$GCC" = yes; then
+ echo 'void f(){}' > conftest.c
+ dnl -no-cpp-precomp is needed for OS X 10.2 (Ben Fowler)
+ have_local_include=`${CC-cc} -no-cpp-precomp -c -v conftest.c 2>&1 | grep '/usr/local/include'`
+ have_local_lib=`${CC-cc} -c -v conftest.c 2>&1 | grep '/usr/local/lib'`
+ rm -f conftest.c conftest.o
+fi
+if test -z "$have_local_lib" -a -d /usr/local/lib; then
+ tt=`echo "$LDFLAGS" | sed -e 's+-L/usr/local/lib ++g' -e 's+-L/usr/local/lib$++g'`
+ if test "$tt" = "$LDFLAGS"; then
+ LDFLAGS="$LDFLAGS -L/usr/local/lib"
+ fi
+fi
+if test -z "$have_local_include" -a -d /usr/local/include; then
+ tt=`echo "$CPPFLAGS" | sed -e 's+-I/usr/local/include ++g' -e 's+-I/usr/local/include$++g'`
+ if test "$tt" = "$CPPFLAGS"; then
+ CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+ fi
+fi
+
+AC_MSG_CHECKING(--with-vim-name argument)
+AC_ARG_WITH(vim-name, [ --with-vim-name=NAME what to call the Vim executable],
+ VIMNAME="$withval"; AC_MSG_RESULT($VIMNAME),
+ VIMNAME="$DEFAULT_VIMNAME"; AC_MSG_RESULT(Defaulting to $VIMNAME))
+AC_SUBST(VIMNAME)
+AC_MSG_CHECKING(--with-ex-name argument)
+AC_ARG_WITH(ex-name, [ --with-ex-name=NAME what to call the Ex executable],
+ EXNAME="$withval"; AC_MSG_RESULT($EXNAME),
+ EXNAME="ex"; AC_MSG_RESULT(Defaulting to ex))
+AC_SUBST(EXNAME)
+AC_MSG_CHECKING(--with-view-name argument)
+AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executable],
+ VIEWNAME="$withval"; AC_MSG_RESULT($VIEWNAME),
+ VIEWNAME="view"; AC_MSG_RESULT(Defaulting to view))
+AC_SUBST(VIEWNAME)
+
+AC_MSG_CHECKING(--with-global-runtime argument)
+AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
+ AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
+ AC_MSG_RESULT(no))
+
+AC_MSG_CHECKING(--with-modified-by argument)
+AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
+ AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
+ AC_MSG_RESULT(no))
+
+dnl Check for EBCDIC stolen from the LYNX port to OS390 Unix
+AC_MSG_CHECKING(if character set is EBCDIC)
+AC_TRY_COMPILE([ ],
+[ /* TryCompile function for CharSet.
+ Treat any failure as ASCII for compatibility with existing art.
+ Use compile-time rather than run-time tests for cross-compiler
+ tolerance. */
+#if '0'!=240
+make an error "Character set is not EBCDIC"
+#endif ],
+[ # TryCompile action if true
+cf_cv_ebcdic=yes ],
+[ # TryCompile action if false
+cf_cv_ebcdic=no])
+# end of TryCompile ])
+# end of CacheVal CvEbcdic
+AC_MSG_RESULT($cf_cv_ebcdic)
+case "$cf_cv_ebcdic" in #(vi
+ yes) AC_DEFINE(EBCDIC)
+ line_break='"\\n"'
+ ;;
+ *) line_break='"\\012"';;
+esac
+AC_SUBST(line_break)
+
+if test "$cf_cv_ebcdic" = "yes"; then
+dnl If we have EBCDIC we most likley have OS390 Unix, let's test it!
+AC_MSG_CHECKING(for OS/390 Unix)
+case `uname` in
+ OS/390) OS390Unix="yes";
+ dnl If using cc the environment variable _CC_CCMODE must be
+ dnl set to "1", so that some compiler extensions are enabled.
+ dnl If using c89 the environment variable is named _CC_C89MODE.
+ dnl Note: compile with c89 never tested.
+ if test "$CC" = "cc"; then
+ ccm="$_CC_CCMODE"
+ ccn="CC"
+ else
+ if test "$CC" = "c89"; then
+ ccm="$_CC_C89MODE"
+ ccn="C89"
+ else
+ ccm=1
+ fi
+ fi
+ if test "$ccm" != "1"; then
+ echo ""
+ echo "------------------------------------------"
+ echo " On OS/390 Unix, the environment variable"
+ echo " __CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+ CFLAGS="$CFLAGS -D_ALL_SOURCE"; LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ AC_MSG_RESULT(yes)
+ ;;
+ *) OS390Unix="no";
+ AC_MSG_RESULT(no)
+ ;;
+esac
+fi
+
+
+dnl Check user requested features.
+
+AC_MSG_CHECKING(--with-features argument)
+AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)],
+ features="$withval"; AC_MSG_RESULT($features),
+ features="normal"; AC_MSG_RESULT(Defaulting to normal))
+
+dovimdiff=""
+dogvimdiff=""
+case "$features" in
+ tiny) AC_DEFINE(FEAT_TINY) ;;
+ small) AC_DEFINE(FEAT_SMALL) ;;
+ normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ huge) AC_DEFINE(FEAT_HUGE) dovimdiff="installvimdiff";
+ dogvimdiff="installgvimdiff" ;;
+ *) AC_MSG_RESULT([Sorry, $features is not supported]) ;;
+esac
+
+AC_SUBST(dovimdiff)
+AC_SUBST(dogvimdiff)
+
+AC_MSG_CHECKING(--with-compiledby argument)
+AC_ARG_WITH(compiledby, [ --with-compiledby=NAME name to show in :version message],
+ compiledby="$withval"; AC_MSG_RESULT($withval),
+ compiledby=""; AC_MSG_RESULT(no))
+AC_SUBST(compiledby)
+
+AC_MSG_CHECKING(--disable-xsmp argument)
+AC_ARG_ENABLE(xsmp,
+ [ --disable-xsmp Disable XSMP session management],
+ , enable_xsmp="yes")
+
+if test "$enable_xsmp" = "yes"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(--disable-xsmp-interact argument)
+ AC_ARG_ENABLE(xsmp-interact,
+ [ --disable-xsmp-interact Disable XSMP interaction],
+ , enable_xsmp_interact="yes")
+ if test "$enable_xsmp_interact" = "yes"; then
+ AC_MSG_RESULT(no)
+ AC_DEFINE(USE_XSMP_INTERACT)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+else
+ AC_MSG_RESULT(yes)
+fi
+
+AC_MSG_CHECKING(--enable-perlinterp argument)
+AC_ARG_ENABLE(perlinterp,
+ [ --enable-perlinterp Include Perl interpreter.], ,
+ [enable_perlinterp="no"])
+AC_MSG_RESULT($enable_perlinterp)
+if test "$enable_perlinterp" = "yes"; then
+ AC_SUBST(vi_cv_path_perl)
+ AC_PATH_PROG(vi_cv_path_perl, perl)
+ if test "X$vi_cv_path_perl" != "X"; then
+ AC_MSG_CHECKING(Perl version)
+ if $vi_cv_path_perl -e 'require 5.003_01' >/dev/null 2>/dev/null; then
+ eval `$vi_cv_path_perl -V:usethreads`
+ if test "X$usethreads" = "XUNKNOWN" -o "X$usethreads" = "Xundef"; then
+ badthreads=no
+ else
+ if $vi_cv_path_perl -e 'require 5.6.0' >/dev/null 2>/dev/null; then
+ eval `$vi_cv_path_perl -V:use5005threads`
+ if test "X$use5005threads" = "XUNKNOWN" -o "X$use5005threads" = "Xundef"; then
+ badthreads=no
+ else
+ badthreads=yes
+ AC_MSG_RESULT(>>> Perl > 5.6 with 5.5 threads cannot be used <<<)
+ fi
+ else
+ badthreads=yes
+ AC_MSG_RESULT(>>> Perl 5.5 with threads cannot be used <<<)
+ fi
+ fi
+ if test $badthreads = no; then
+ AC_MSG_RESULT(OK)
+ eval `$vi_cv_path_perl -V:shrpenv`
+ if test "X$shrpenv" = "XUNKNOWN"; then # pre 5.003_04
+ shrpenv=""
+ fi
+ vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
+ AC_SUBST(vi_cv_perllib)
+ dnl Remove "-fno-something", it breaks using cproto.
+ perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
+ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
+ dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
+ perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
+ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
+ -e 's/-bE:perl.exp//' -e 's/-lc //'`
+ dnl Don't add perl lib to $LIBS: if it's not in LD_LIBRARY_PATH
+ dnl a test in configure may fail because of that.
+ perlldflags=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed \
+ -e 'ccdlflags' | sed -e 's/-bE:perl.exp//'`
+
+ dnl check that compiling a simple program still works with the flags
+ dnl added for Perl.
+ AC_MSG_CHECKING([if compile and link flags for Perl are sane])
+ cflags_save=$CFLAGS
+ libs_save=$LIBS
+ ldflags_save=$LDFLAGS
+ CFLAGS="$CFLAGS $perlcppflags"
+ LIBS="$LIBS $perllibs"
+ LDFLAGS="$perlldflags $LDFLAGS"
+ AC_TRY_LINK(,[ ],
+ AC_MSG_RESULT(yes); perl_ok=yes,
+ AC_MSG_RESULT(no: PERL DISABLED); perl_ok=no)
+ CFLAGS=$cflags_save
+ LIBS=$libs_save
+ LDFLAGS=$ldflags_save
+ if test $perl_ok = yes; then
+ if test "X$perlcppflags" != "X"; then
+ PERL_CFLAGS="$perlcppflags"
+ fi
+ if test "X$perlldflags" != "X"; then
+ LDFLAGS="$perlldflags $LDFLAGS"
+ fi
+ PERL_LIBS=$perllibs
+ PERL_SRC="auto/if_perl.c if_perlsfio.c"
+ PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o"
+ PERL_PRO="if_perl.pro if_perlsfio.pro"
+ AC_DEFINE(FEAT_PERL)
+ fi
+ fi
+ else
+ AC_MSG_RESULT(>>> too old; need Perl version 5.003_01 or later <<<)
+ fi
+ fi
+
+ if test "x$MACOSX" = "xyes"; then
+ dnl Mac OS X 10.2 or 10.3
+ dir=/System/Library/Perl
+ darwindir=$dir/darwin
+ if test -d $darwindir; then
+ PERL=/usr/bin/perl
+ else
+ dnl Mac OS X 10.3
+ dir=/System/Library/Perl/5.8.1
+ darwindir=$dir/darwin-thread-multi-2level
+ if test -d $darwindir; then
+ PERL=/usr/bin/perl
+ fi
+ fi
+ if test -n "$PERL"; then
+ PERL_DIR="$dir"
+ PERL_CFLAGS="-DFEAT_PERL -I$darwindir/CORE"
+ PERL_OBJ="objects/if_perl.o objects/if_perlsfio.o $darwindir/auto/DynaLoader/DynaLoader.a"
+ PERL_LIBS="-L$darwindir/CORE -lperl"
+ fi
+ fi
+fi
+AC_SUBST(shrpenv)
+AC_SUBST(PERL_SRC)
+AC_SUBST(PERL_OBJ)
+AC_SUBST(PERL_PRO)
+AC_SUBST(PERL_CFLAGS)
+AC_SUBST(PERL_LIBS)
+
+AC_MSG_CHECKING(--enable-pythoninterp argument)
+AC_ARG_ENABLE(pythoninterp,
+ [ --enable-pythoninterp Include Python interpreter.], ,
+ [enable_pythoninterp="no"])
+AC_MSG_RESULT($enable_pythoninterp)
+if test "$enable_pythoninterp" = "yes"; then
+ dnl -- find the python executable
+ AC_PATH_PROG(vi_cv_path_python, python)
+ if test "X$vi_cv_path_python" != "X"; then
+
+ dnl -- get its version number
+ AC_CACHE_CHECK(Python version,vi_cv_var_python_version,
+ [[vi_cv_var_python_version=`
+ ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
+ ]])
+
+ dnl -- it must be at least version 1.4
+ AC_MSG_CHECKING(Python is 1.4 or better)
+ if ${vi_cv_path_python} -c \
+ "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
+ then
+ AC_MSG_RESULT(yep)
+
+ dnl -- find where python thinks it was installed
+ AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python_pfx,
+ [ vi_cv_path_python_pfx=`
+ ${vi_cv_path_python} -c \
+ "import sys; print sys.prefix"` ])
+
+ dnl -- and where it thinks it runs
+ AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python_epfx,
+ [ vi_cv_path_python_epfx=`
+ ${vi_cv_path_python} -c \
+ "import sys; print sys.exec_prefix"` ])
+
+ dnl -- python's internal library path
+
+ AC_CACHE_VAL(vi_cv_path_pythonpath,
+ [ vi_cv_path_pythonpath=`
+ unset PYTHONPATH;
+ ${vi_cv_path_python} -c \
+ "import sys, string; print string.join(sys.path,':')"` ])
+
+ dnl -- where the Python implementation library archives are
+
+ AC_ARG_WITH(python-config-dir,
+ [ --with-python-config-dir=PATH Python's config directory],
+ [ vi_cv_path_python_conf="${withval}" ] )
+
+ AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
+ [
+ vi_cv_path_python_conf=
+ for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do
+ for subdir in lib share; do
+ d="${path}/${subdir}/python${vi_cv_var_python_version}/config"
+ if test -d "$d" && test -f "$d/config.c"; then
+ vi_cv_path_python_conf="$d"
+ fi
+ done
+ done
+ ])
+
+ PYTHON_CONFDIR="${vi_cv_path_python_conf}"
+
+ if test "X$PYTHON_CONFDIR" = "X"; then
+ AC_MSG_RESULT([can't find it!])
+ else
+
+ dnl -- we need to examine Python's config/Makefile too
+ dnl see what the interpreter is built from
+ AC_CACHE_VAL(vi_cv_path_python_plibs,
+ [
+ tmp_mkf="/tmp/Makefile-conf$$"
+ cat ${PYTHON_CONFDIR}/Makefile - <<'eof' >${tmp_mkf}
+__:
+ @echo "python_MODLIBS='$(MODLIBS)'"
+ @echo "python_LIBS='$(LIBS)'"
+ @echo "python_SYSLIBS='$(SYSLIBS)'"
+ @echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
+eof
+ dnl -- delete the lines from make about Entering/Leaving directory
+ eval "`cd ${PYTHON_CONFDIR} && make -f ${tmp_mkf} __ | sed '/ directory /d'`"
+ rm -f ${tmp_mkf}
+ if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
+ "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
+ vi_cv_path_python_plibs="-framework Python"
+ else
+ if test "${vi_cv_var_python_version}" = "1.4"; then
+ vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
+ else
+ vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
+ fi
+ vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_MODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
+ dnl remove -ltermcap, it can conflict with an earlier -lncurses
+ vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
+ fi
+ ])
+
+ PYTHON_LIBS="${vi_cv_path_python_plibs}"
+ if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
+ PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version}"
+ else
+ PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version}"
+ fi
+ PYTHON_SRC="if_python.c"
+ dnl For Mac OSX 10.2 config.o is included in the Python library.
+ if test "x$MACOSX" = "xyes"; then
+ PYTHON_OBJ="objects/if_python.o"
+ else
+ PYTHON_OBJ="objects/if_python.o objects/py_config.o"
+ fi
+ if test "${vi_cv_var_python_version}" = "1.4"; then
+ PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
+ fi
+ PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
+
+ dnl On FreeBSD linking with "-pthread" is required to use threads.
+ dnl _THREAD_SAFE must be used for compiling then.
+ dnl The "-pthread" is added to $LIBS, so that the following check for
+ dnl sigaltstack() will look in libc_r (it's there in libc!).
+ dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC
+ dnl will then define target-specific defines, e.g., -D_REENTRANT.
+ dnl Don't do this for Mac OSX, -pthread will generate a warning.
+ AC_MSG_CHECKING([if -pthread should be used])
+ threadsafe_flag=
+ thread_lib=
+ if test "x$MACOSX" != "xyes"; then
+ test "$GCC" = yes && threadsafe_flag="-pthread"
+ if test "`(uname) 2>/dev/null`" = FreeBSD; then
+ threadsafe_flag="-D_THREAD_SAFE"
+ thread_lib="-pthread"
+ fi
+ fi
+ libs_save_old=$LIBS
+ if test -n "$threadsafe_flag"; then
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $threadsafe_flag"
+ LIBS="$LIBS $thread_lib"
+ AC_TRY_LINK(,[ ],
+ AC_MSG_RESULT(yes); PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag",
+ AC_MSG_RESULT(no); LIBS=$libs_save_old
+ )
+ CFLAGS=$cflags_save
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ dnl check that compiling a simple program still works with the flags
+ dnl added for Python.
+ AC_MSG_CHECKING([if compile and link flags for Python are sane])
+ cflags_save=$CFLAGS
+ libs_save=$LIBS
+ CFLAGS="$CFLAGS $PYTHON_CFLAGS"
+ LIBS="$LIBS $PYTHON_LIBS"
+ AC_TRY_LINK(,[ ],
+ AC_MSG_RESULT(yes); python_ok=yes,
+ AC_MSG_RESULT(no: PYTHON DISABLED); python_ok=no)
+ CFLAGS=$cflags_save
+ LIBS=$libs_save
+ if test $python_ok = yes; then
+ AC_DEFINE(FEAT_PYTHON)
+ else
+ LIBS=$libs_save_old
+ PYTHON_SRC=
+ PYTHON_OBJ=
+ PYTHON_LIBS=
+ PYTHON_CFLAGS=
+ fi
+
+ fi
+ else
+ AC_MSG_RESULT(too old)
+ fi
+ fi
+fi
+AC_SUBST(PYTHON_CONFDIR)
+AC_SUBST(PYTHON_LIBS)
+AC_SUBST(PYTHON_GETPATH_CFLAGS)
+AC_SUBST(PYTHON_CFLAGS)
+AC_SUBST(PYTHON_SRC)
+AC_SUBST(PYTHON_OBJ)
+
+AC_MSG_CHECKING(--enable-tclinterp argument)
+AC_ARG_ENABLE(tclinterp,
+ [ --enable-tclinterp Include Tcl interpreter.], ,
+ [enable_tclinterp="no"])
+AC_MSG_RESULT($enable_tclinterp)
+
+if test "$enable_tclinterp" = "yes"; then
+
+ dnl on FreeBSD tclsh is a silly script, look for tclsh8.0 or tclsh8.2
+ AC_MSG_CHECKING(--with-tclsh argument)
+ AC_ARG_WITH(tclsh, [ --with-tclsh=PATH which tclsh to use (default: tclsh8.0)],
+ tclsh_name="$withval"; AC_MSG_RESULT($tclsh_name),
+ tclsh_name="tclsh8.0"; AC_MSG_RESULT(no))
+ AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
+ AC_SUBST(vi_cv_path_tcl)
+
+ dnl when no specific version specified, also try 8.2
+ if test "X$vi_cv_path_tcl" = "X" -a $tclsh_name = "tclsh8.0"; then
+ tclsh_name="tclsh8.2"
+ AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
+ fi
+ dnl still didn't find it, try without version number
+ if test "X$vi_cv_path_tcl" = "X"; then
+ tclsh_name="tclsh"
+ AC_PATH_PROG(vi_cv_path_tcl, $tclsh_name)
+ fi
+ if test "X$vi_cv_path_tcl" != "X"; then
+ AC_MSG_CHECKING(Tcl version)
+ if echo 'exit [[expr [info tclversion] < 8.0]]' | $vi_cv_path_tcl - ; then
+ tclver=`echo 'puts [[info tclversion]]' | $vi_cv_path_tcl -`
+ AC_MSG_RESULT($tclver - OK);
+ tclloc=`echo 'set l [[info library]];set i [[string last lib $l]];incr i -2;puts [[string range $l 0 $i]]' | $vi_cv_path_tcl -`
+
+ AC_MSG_CHECKING(for location of Tcl include)
+ if test "x$MACOSX" != "xyes"; then
+ tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include"
+ else
+ dnl For Mac OS X 10.3, use the OS-provided framework location
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ AC_MSG_RESULT($try/tcl.h)
+ TCL_INC=$try
+ break
+ fi
+ done
+ if test -z "$TCL_INC"; then
+ AC_MSG_RESULT(<not found>)
+ SKIP_TCL=YES
+ fi
+ if test -z "$SKIP_TCL"; then
+ AC_MSG_CHECKING(for location of tclConfig.sh script)
+ if test "x$MACOSX" != "xyes"; then
+ tclcnf=`echo $tclinc | sed s/include/lib/g`
+ else
+ dnl For Mac OS X 10.3, use the OS-provided framework location
+ tclcnf="/System/Library/Frameworks/Tcl.framework"
+ fi
+ for try in $tclcnf; do
+ if test -f $try/tclConfig.sh; then
+ AC_MSG_RESULT($try/tclConfig.sh)
+ . $try/tclConfig.sh
+ dnl use eval, because tcl 8.2 includes ${TCL_DBGX}
+ TCL_LIBS=`eval echo "$TCL_LIB_SPEC $TCL_LIBS"`
+ dnl Use $TCL_DEFS for -D_THREAD_SAFE et al. But only use the
+ dnl "-D_ABC" items.
+ TCL_DEFS=`echo $TCL_DEFS | tr ' ' '\012' | sed -e '/^-[[^D]]/d' -e '/-D[[^_]]/d' -e 's/-D_/ -D_/' | tr -d '\012'`
+ break
+ fi
+ done
+ if test -z "$TCL_LIBS"; then
+ AC_MSG_RESULT(<not found>)
+ AC_MSG_CHECKING(for Tcl library by myself)
+ tcllib=`echo $tclinc | sed s/include/lib/g`
+ for ext in .so .a ; do
+ for ver in "" $tclver ; do
+ for try in $tcllib ; do
+ trylib=tcl$ver$ext
+ if test -f $try/lib$trylib ; then
+ AC_MSG_RESULT($try/lib$trylib)
+ TCL_LIBS="-L$try -ltcl$ver -ldl -lm"
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ TCL_LIBS="$TCL_LIBS -R $try"
+ fi
+ break 3
+ fi
+ done
+ done
+ done
+ if test -z "$TCL_LIBS"; then
+ AC_MSG_RESULT(<not found>)
+ SKIP_TCL=YES
+ fi
+ fi
+ if test -z "$SKIP_TCL"; then
+ AC_DEFINE(FEAT_TCL)
+ TCL_SRC=if_tcl.c
+ TCL_OBJ=objects/if_tcl.o
+ TCL_PRO=if_tcl.pro
+ TCL_CFLAGS="-I$TCL_INC $TCL_DEFS"
+ fi
+ fi
+ else
+ AC_MSG_RESULT(too old; need Tcl version 8.0 or later)
+ fi
+ fi
+fi
+AC_SUBST(TCL_SRC)
+AC_SUBST(TCL_OBJ)
+AC_SUBST(TCL_PRO)
+AC_SUBST(TCL_CFLAGS)
+AC_SUBST(TCL_LIBS)
+
+AC_MSG_CHECKING(--enable-rubyinterp argument)
+AC_ARG_ENABLE(rubyinterp,
+ [ --enable-rubyinterp Include Ruby interpreter.], ,
+ [enable_rubyinterp="no"])
+AC_MSG_RESULT($enable_rubyinterp)
+if test "$enable_rubyinterp" = "yes"; then
+ AC_SUBST(vi_cv_path_ruby)
+ AC_PATH_PROG(vi_cv_path_ruby, ruby)
+ if test "X$vi_cv_path_ruby" != "X"; then
+ AC_MSG_CHECKING(Ruby version)
+ if $vi_cv_path_ruby -e 'VERSION >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
+ AC_MSG_RESULT(OK)
+ AC_MSG_CHECKING(Ruby header files)
+ rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
+ if test "X$rubyhdrdir" != "X"; then
+ AC_MSG_RESULT($rubyhdrdir)
+ RUBY_CFLAGS="-I$rubyhdrdir"
+ rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
+ if test "X$rubylibs" != "X"; then
+ RUBY_LIBS="$rubylibs"
+ fi
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
+ if test -f "$rubyhdrdir/$librubyarg"; then
+ librubyarg="$rubyhdrdir/$librubyarg"
+ else
+ rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
+ if test -f "$rubylibdir/$librubyarg"; then
+ librubyarg="$rubylibdir/$librubyarg"
+ elif test "$librubyarg" = "libruby.a"; then
+ dnl required on Mac OS 10.3 where libruby.a doesn't exist
+ librubyarg="-lruby"
+ else
+ librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
+ fi
+ fi
+
+ if test "X$librubyarg" != "X"; then
+ RUBY_LIBS="$librubyarg $RUBY_LIBS"
+ fi
+ rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
+ if test "X$rubyldflags" != "X"; then
+ LDFLAGS="$rubyldflags $LDFLAGS"
+ fi
+ RUBY_SRC="if_ruby.c"
+ RUBY_OBJ="objects/if_ruby.o"
+ RUBY_PRO="if_ruby.pro"
+ AC_DEFINE(FEAT_RUBY)
+ else
+ AC_MSG_RESULT(not found, disabling Ruby)
+ fi
+ else
+ AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
+ fi
+ fi
+fi
+AC_SUBST(RUBY_SRC)
+AC_SUBST(RUBY_OBJ)
+AC_SUBST(RUBY_PRO)
+AC_SUBST(RUBY_CFLAGS)
+AC_SUBST(RUBY_LIBS)
+
+AC_MSG_CHECKING(--enable-cscope argument)
+AC_ARG_ENABLE(cscope,
+ [ --enable-cscope Include cscope interface.], ,
+ [enable_cscope="no"])
+AC_MSG_RESULT($enable_cscope)
+if test "$enable_cscope" = "yes"; then
+ AC_DEFINE(FEAT_CSCOPE)
+fi
+
+AC_MSG_CHECKING(--enable-workshop argument)
+AC_ARG_ENABLE(workshop,
+ [ --enable-workshop Include Sun Visual Workshop support.], ,
+ [enable_workshop="no"])
+AC_MSG_RESULT($enable_workshop)
+if test "$enable_workshop" = "yes"; then
+ AC_DEFINE(FEAT_SUN_WORKSHOP)
+ WORKSHOP_SRC="workshop.c integration.c"
+ AC_SUBST(WORKSHOP_SRC)
+ WORKSHOP_OBJ="objects/workshop.o objects/integration.o"
+ AC_SUBST(WORKSHOP_OBJ)
+ if test "${enable_gui-xxx}" = xxx; then
+ enable_gui=motif
+ fi
+fi
+
+AC_MSG_CHECKING(--disable-netbeans argument)
+AC_ARG_ENABLE(netbeans,
+ [ --disable-netbeans Disable NetBeans integration support.],
+ , [enable_netbeans="yes"])
+if test "$enable_netbeans" = "yes"; then
+ AC_MSG_RESULT(no)
+ dnl On Solaris we need the socket and nsl library.
+ AC_CHECK_LIB(socket, socket)
+ AC_CHECK_LIB(nsl, gethostbyname)
+ AC_MSG_CHECKING(whether compiling netbeans integration is possible)
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+ /* Check bitfields */
+ struct nbbuf {
+ unsigned int initDone:1;
+ ushort signmaplen;
+ };
+ ], [
+ /* Check creating a socket. */
+ struct sockaddr_in server;
+ (void)socket(AF_INET, SOCK_STREAM, 0);
+ (void)htons(100);
+ (void)gethostbyname("microsoft.com");
+ if (errno == ECONNREFUSED)
+ (void)connect(1, (struct sockaddr *)&server, sizeof(server));
+ ],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); enable_netbeans="no")
+else
+ AC_MSG_RESULT(yes)
+fi
+if test "$enable_netbeans" = "yes"; then
+ AC_DEFINE(FEAT_NETBEANS_INTG)
+ NETBEANS_SRC="netbeans.c"
+ AC_SUBST(NETBEANS_SRC)
+ NETBEANS_OBJ="objects/netbeans.o"
+ AC_SUBST(NETBEANS_OBJ)
+fi
+
+AC_MSG_CHECKING(--enable-sniff argument)
+AC_ARG_ENABLE(sniff,
+ [ --enable-sniff Include Sniff interface.], ,
+ [enable_sniff="no"])
+AC_MSG_RESULT($enable_sniff)
+if test "$enable_sniff" = "yes"; then
+ AC_DEFINE(FEAT_SNIFF)
+ SNIFF_SRC="if_sniff.c"
+ AC_SUBST(SNIFF_SRC)
+ SNIFF_OBJ="objects/if_sniff.o"
+ AC_SUBST(SNIFF_OBJ)
+fi
+
+AC_MSG_CHECKING(--enable-multibyte argument)
+AC_ARG_ENABLE(multibyte,
+ [ --enable-multibyte Include multibyte editing support.], ,
+ [enable_multibyte="no"])
+AC_MSG_RESULT($enable_multibyte)
+if test "$enable_multibyte" = "yes"; then
+ AC_DEFINE(FEAT_MBYTE)
+fi
+
+AC_MSG_CHECKING(--enable-hangulinput argument)
+AC_ARG_ENABLE(hangulinput,
+ [ --enable-hangulinput Include Hangul input support.], ,
+ [enable_hangulinput="no"])
+AC_MSG_RESULT($enable_hangulinput)
+
+AC_MSG_CHECKING(--enable-xim argument)
+AC_ARG_ENABLE(xim,
+ [ --enable-xim Include XIM input support.],
+ AC_MSG_RESULT($enable_xim),
+ [enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
+dnl defining FEAT_XIM is delayed, so that it can be disabled for older GTK
+
+AC_MSG_CHECKING(--enable-fontset argument)
+AC_ARG_ENABLE(fontset,
+ [ --enable-fontset Include X fontset output support.], ,
+ [enable_fontset="no"])
+AC_MSG_RESULT($enable_fontset)
+dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI
+
+test -z "$with_x" && with_x=yes
+test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
+if test "$with_x" = no; then
+ AC_MSG_RESULT(defaulting to: don't HAVE_X11)
+else
+ dnl Do this check early, so that its failure can override user requests.
+
+ AC_PATH_PROG(xmkmfpath, xmkmf)
+
+ AC_PATH_XTRA
+
+ dnl On OS390Unix the X libraries are DLLs. To use them the code must
+ dnl be compiled with a special option.
+ dnl Also add SM, ICE and Xmu to X_EXTRA_LIBS.
+ if test "$OS390Unix" = "yes"; then
+ CFLAGS="$CFLAGS -W c,dll"
+ LDFLAGS="$LDFLAGS -W l,dll"
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE -lXmu"
+ fi
+
+ dnl On my HPUX system the X include dir is found, but the lib dir not.
+ dnl This is a desparate try to fix this.
+
+ if test -d "$x_includes" && test ! -d "$x_libraries"; then
+ x_libraries=`echo "$x_includes" | sed s/include/lib/`
+ AC_MSG_RESULT(Corrected X libraries to $x_libraries)
+ X_LIBS="$X_LIBS -L$x_libraries"
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ X_LIBS="$X_LIBS -R $x_libraries"
+ fi
+ fi
+
+ if test -d "$x_libraries" && test ! -d "$x_includes"; then
+ x_includes=`echo "$x_libraries" | sed s/lib/include/`
+ AC_MSG_RESULT(Corrected X includes to $x_includes)
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ fi
+
+ dnl Remove "-I/usr/include " from X_CFLAGS, should not be needed.
+ X_CFLAGS="`echo $X_CFLAGS\ | sed 's%-I/usr/include %%'`"
+ dnl Remove "-L/usr/lib " from X_LIBS, should not be needed.
+ X_LIBS="`echo $X_LIBS\ | sed 's%-L/usr/lib %%'`"
+ dnl Same for "-R/usr/lib ".
+ X_LIBS="`echo $X_LIBS\ | sed -e 's%-R/usr/lib %%' -e 's%-R /usr/lib %%'`"
+
+
+ dnl Check if the X11 header files are correctly installed. On some systems
+ dnl Xlib.h includes files that don't exist
+ AC_MSG_CHECKING(if X11 header files can be found)
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); no_x=yes)
+ CFLAGS=$cflags_save
+
+ if test "${no_x-no}" = yes; then
+ with_x=no
+ else
+ AC_DEFINE(HAVE_X11)
+ X_LIB="-lXt -lX11";
+ AC_SUBST(X_LIB)
+
+ ac_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-L$x_libraries $LDFLAGS"
+
+ dnl Check for -lXdmcp (needed on SunOS 4.1.4)
+ dnl For HP-UX 10.20 it must be before -lSM -lICE
+ AC_CHECK_LIB(Xdmcp, _XdmcpAuthDoIt, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lXdmcp"],,
+ [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp])
+
+ dnl Some systems need -lnsl -lsocket when testing for ICE.
+ dnl The check above doesn't do this, try here (again). Also needed to get
+ dnl them after Xdmcp. link.sh will remove them when not needed.
+ dnl Check for other function than above to avoid the cached value
+ AC_CHECK_LIB(ICE, IceOpenConnection,
+ [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
+
+ dnl Check for -lXpm (needed for some versions of Motif)
+ LDFLAGS="$X_LIBS $ac_save_LDFLAGS"
+ AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [X_PRE_LIBS="$X_PRE_LIBS -lXpm"],,
+ [-lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS])
+
+ dnl Check that the X11 header files don't use implicit declarations
+ AC_MSG_CHECKING(if X11 header files implicitly declare return values)
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS -Werror"
+ AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
+ AC_MSG_RESULT(no),
+ CFLAGS="$CFLAGS -Wno-implicit-int"
+ AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
+ AC_MSG_RESULT(yes); cflags_save="$cflags_save -Wno-implicit-int",
+ AC_MSG_RESULT(test failed)
+ )
+ )
+ CFLAGS=$cflags_save
+
+ LDFLAGS="$ac_save_LDFLAGS"
+
+ fi
+fi
+
+test "x$with_x" = xno -a "x$BEOS" != "xyes" -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
+
+AC_MSG_CHECKING(--enable-gui argument)
+AC_ARG_ENABLE(gui,
+ [ --enable-gui[=OPTS] X11 GUI [default=auto] [OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/beos/photon/carbon]], , enable_gui="auto")
+
+dnl Canonicalize the --enable-gui= argument so that it can be easily compared.
+dnl Do not use character classes for portability with old tools.
+enable_gui_canon=`echo "_$enable_gui" | \
+ sed 's/[[ _+-]]//g;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+
+dnl Skip everything by default.
+SKIP_GTK=YES
+SKIP_GTK2=YES
+SKIP_GNOME=YES
+SKIP_MOTIF=YES
+SKIP_ATHENA=YES
+SKIP_NEXTAW=YES
+SKIP_PHOTON=YES
+SKIP_BEOS=YES
+SKIP_CARBON=YES
+GUITYPE=NONE
+
+if test "x$BEOS" = "xyes"; then
+ SKIP_BEOS=
+ case "$enable_gui_canon" in
+ no) AC_MSG_RESULT(no GUI support)
+ SKIP_BEOS=YES ;;
+ yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
+ auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
+ beos) AC_MSG_RESULT(BeOS GUI support) ;;
+ *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
+ SKIP_BEOS=YES ;;
+ esac
+
+elif test "x$QNX" = "xyes" -a "x$with_x" = "xno" ; then
+ SKIP_PHOTON=
+ case "$enable_gui_canon" in
+ no) AC_MSG_RESULT(no GUI support)
+ SKIP_PHOTON=YES ;;
+ yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
+ auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
+ photon) AC_MSG_RESULT(Photon GUI support) ;;
+ *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
+ SKIP_PHOTON=YES ;;
+ esac
+
+elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
+ SKIP_CARBON=
+ case "$enable_gui_canon" in
+ no) AC_MSG_RESULT(no GUI support)
+ SKIP_CARBON=YES ;;
+ yes|"") AC_MSG_RESULT(yes - automatic GUI support) ;;
+ auto) AC_MSG_RESULT(auto - automatic GUI support) ;;
+ carbon) AC_MSG_RESULT(Carbon GUI support) ;;
+ *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported])
+ SKIP_CARBON=YES ;;
+ esac
+
+else
+
+
+ case "$enable_gui_canon" in
+ no|none) AC_MSG_RESULT(no GUI support) ;;
+ yes|""|auto) AC_MSG_RESULT(yes/auto - automatic GUI support)
+ SKIP_GTK=
+ SKIP_GTK2=
+ SKIP_GNOME=
+ SKIP_MOTIF=
+ SKIP_ATHENA=
+ SKIP_NEXTAW=
+ SKIP_CARBON=;;
+ gtk) AC_MSG_RESULT(GTK+ 1.x GUI support)
+ SKIP_GTK=;;
+ gtk2) AC_MSG_RESULT(GTK+ 2.x GUI support)
+ SKIP_GTK=
+ SKIP_GTK2=;;
+ gnome) AC_MSG_RESULT(GNOME 1.x GUI support)
+ SKIP_GNOME=
+ SKIP_GTK=;;
+ gnome2) AC_MSG_RESULT(GNOME 2.x GUI support)
+ SKIP_GNOME=
+ SKIP_GTK=
+ SKIP_GTK2=;;
+ motif) AC_MSG_RESULT(Motif GUI support)
+ SKIP_MOTIF=;;
+ athena) AC_MSG_RESULT(Athena GUI support)
+ SKIP_ATHENA=;;
+ nextaw) AC_MSG_RESULT(neXtaw GUI support)
+ SKIP_NEXTAW=;;
+ *) AC_MSG_RESULT([Sorry, $enable_gui GUI is not supported]) ;;
+ esac
+
+fi
+
+if test "x$SKIP_GTK" != "xYES" -a "$enable_gui_canon" != "gtk" -a "$enable_gui_canon" != "gtk2"; then
+ AC_MSG_CHECKING(whether or not to look for GTK)
+ AC_ARG_ENABLE(gtk-check,
+ [ --enable-gtk-check If auto-select GUI, check for GTK [default=yes]],
+ , enable_gtk_check="yes")
+ AC_MSG_RESULT($enable_gtk_check)
+ if test "x$enable_gtk_check" = "xno"; then
+ SKIP_GTK=YES
+ SKIP_GNOME=YES
+ fi
+fi
+
+if test "x$SKIP_GTK2" != "xYES" -a "$enable_gui_canon" != "gtk2" \
+ -a "$enable_gui_canon" != "gnome2"; then
+ AC_MSG_CHECKING(whether or not to look for GTK+ 2)
+ AC_ARG_ENABLE(gtk2-check,
+ [ --enable-gtk2-check If GTK GUI, check for GTK+ 2 [default=yes]],
+ , enable_gtk2_check="yes")
+ AC_MSG_RESULT($enable_gtk2_check)
+ if test "x$enable_gtk2_check" = "xno"; then
+ SKIP_GTK2=YES
+ fi
+fi
+
+if test "x$SKIP_GNOME" != "xYES" -a "$enable_gui_canon" != "gnome" \
+ -a "$enable_gui_canon" != "gnome2"; then
+ AC_MSG_CHECKING(whether or not to look for GNOME)
+ AC_ARG_ENABLE(gnome-check,
+ [ --enable-gnome-check If GTK GUI, check for GNOME [default=no]],
+ , enable_gnome_check="no")
+ AC_MSG_RESULT($enable_gnome_check)
+ if test "x$enable_gnome_check" = "xno"; then
+ SKIP_GNOME=YES
+ fi
+fi
+
+if test "x$SKIP_MOTIF" != "xYES" -a "$enable_gui_canon" != "motif"; then
+ AC_MSG_CHECKING(whether or not to look for Motif)
+ AC_ARG_ENABLE(motif-check,
+ [ --enable-motif-check If auto-select GUI, check for Motif [default=yes]],
+ , enable_motif_check="yes")
+ AC_MSG_RESULT($enable_motif_check)
+ if test "x$enable_motif_check" = "xno"; then
+ SKIP_MOTIF=YES
+ fi
+fi
+
+if test "x$SKIP_ATHENA" != "xYES" -a "$enable_gui_canon" != "athena"; then
+ AC_MSG_CHECKING(whether or not to look for Athena)
+ AC_ARG_ENABLE(athena-check,
+ [ --enable-athena-check If auto-select GUI, check for Athena [default=yes]],
+ , enable_athena_check="yes")
+ AC_MSG_RESULT($enable_athena_check)
+ if test "x$enable_athena_check" = "xno"; then
+ SKIP_ATHENA=YES
+ fi
+fi
+
+if test "x$SKIP_NEXTAW" != "xYES" -a "$enable_gui_canon" != "nextaw"; then
+ AC_MSG_CHECKING(whether or not to look for neXtaw)
+ AC_ARG_ENABLE(nextaw-check,
+ [ --enable-nextaw-check If auto-select GUI, check for neXtaw [default=yes]],
+ , enable_nextaw_check="yes")
+ AC_MSG_RESULT($enable_nextaw_check);
+ if test "x$enable_nextaw_check" = "xno"; then
+ SKIP_NEXTAW=YES
+ fi
+fi
+
+if test "x$SKIP_CARBON" != "xYES" -a "$enable_gui_canon" != "carbon"; then
+ AC_MSG_CHECKING(whether or not to look for Carbon)
+ AC_ARG_ENABLE(carbon-check,
+ [ --enable-carbon-check If auto-select GUI, check for Carbon [default=yes]],
+ , enable_carbon_check="yes")
+ AC_MSG_RESULT($enable_carbon_check);
+ if test "x$enable_carbon_check" = "xno"; then
+ SKIP_CARBON=YES
+ fi
+fi
+
+if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
+ AC_MSG_CHECKING(for Carbon GUI)
+ dnl already did this
+ AC_MSG_RESULT(yes);
+ GUITYPE=CARBONGUI
+ dnl skip everything else
+ SKIP_GTK=YES;
+ SKIP_GTK2=YES;
+ SKIP_GNOME=YES;
+ SKIP_MOTIF=YES;
+ SKIP_ATHENA=YES;
+ SKIP_NEXTAW=YES;
+ SKIP_PHOTON=YES;
+ SKIP_BEOS=YES;
+ SKIP_CARBON=YES
+fi
+
+
+dnl
+dnl Get the cflags and libraries from the gtk-config script
+dnl
+
+dnl define an autoconf function to check for a specified version of GTK, and
+dnl try to compile/link a GTK program. this gets used once for GTK 1.1.16.
+dnl
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
+dnl
+AC_DEFUN(AM_PATH_GTK,
+[
+ if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then
+ {
+ min_gtk_version=ifelse([$1], ,0.99.7,$1)
+ AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
+ no_gtk=""
+ if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \
+ && $PKG_CONFIG --exists gtk+-2.0; then
+ {
+ dnl We should be using PKG_CHECK_MODULES() instead of this hack.
+ dnl But I guess the dependency on pkgconfig.m4 is not wanted or
+ dnl something like that.
+ GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0`
+ GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0`
+ gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+ }
+ elif test "X$GTK_CONFIG" != "Xno"; then
+ {
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+ gtk_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ gtk_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ gtk_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+ }
+ else
+ no_gtk=yes
+ fi
+
+ if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then
+ {
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+
+ dnl
+ dnl Now check if the installed GTK is sufficiently new. (Also sanity
+ dnl checks the results of gtk-config to some extent
+ dnl
+ rm -f conf.gtktest
+ AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+int major, minor, micro;
+char *tmp_version;
+
+system ("touch conf.gtktest");
+
+/* HP/UX 9 (%@#!) writes to sscanf strings */
+tmp_version = g_strdup("$min_gtk_version");
+if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gtk_version");
+ exit(1);
+ }
+
+if ((gtk_major_version > major) ||
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) &&
+ (gtk_micro_version >= micro)))
+{
+ return 0;
+}
+return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ }
+ fi
+ if test "x$no_gtk" = x ; then
+ if test "x$enable_gtktest" = "xyes"; then
+ AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
+ else
+ AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version)
+ fi
+ ifelse([$2], , :, [$2])
+ else
+ {
+ AC_MSG_RESULT(no)
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ ifelse([$3], , :, [$3])
+ }
+ fi
+ }
+ else
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+ rm -f conf.gtktest
+])
+
+dnl ---------------------------------------------------------------------------
+dnl gnome
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([GNOME_INIT_HOOK],
+[
+ AC_SUBST(GNOME_LIBS)
+ AC_SUBST(GNOME_LIBDIR)
+ AC_SUBST(GNOME_INCLUDEDIR)
+
+ AC_ARG_WITH(gnome-includes,
+ [ --with-gnome-includes=DIR Specify location of GNOME headers],
+ [CFLAGS="$CFLAGS -I$withval"]
+ )
+
+ AC_ARG_WITH(gnome-libs,
+ [ --with-gnome-libs=DIR Specify location of GNOME libs],
+ [LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval]
+ )
+
+ AC_ARG_WITH(gnome,
+ [ --with-gnome Specify prefix for GNOME files],
+ if test x$withval = xyes; then
+ want_gnome=yes
+ ifelse([$1], [], :, [$1])
+ else
+ if test "x$withval" = xno; then
+ want_gnome=no
+ else
+ want_gnome=yes
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CFLAGS="$CFLAGS -I$withval/include"
+ gnome_prefix=$withval/lib
+ fi
+ fi,
+ want_gnome=yes)
+
+ if test "x$want_gnome" = xyes -a "0$gtk_major_version" -ge 2; then
+ {
+ AC_MSG_CHECKING(for libgnomeui-2.0)
+ if $PKG_CONFIG --exists libgnomeui-2.0; then
+ AC_MSG_RESULT(yes)
+ GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
+ GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
+ GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
+ $1
+ else
+ AC_MSG_RESULT(not found)
+ if test "x$2" = xfail; then
+ AC_MSG_ERROR(Could not find libgnomeui-2.0 via pkg-config)
+ fi
+ fi
+ }
+ elif test "x$want_gnome" = xyes; then
+ {
+ AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
+ if test "$GNOME_CONFIG" = "no"; then
+ no_gnome_config="yes"
+ else
+ AC_MSG_CHECKING(if $GNOME_CONFIG works)
+ if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome gnomeui`"
+ GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
+ GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
+ $1
+ else
+ AC_MSG_RESULT(no)
+ no_gnome_config="yes"
+ fi
+ fi
+
+ if test x$exec_prefix = xNONE; then
+ if test x$prefix = xNONE; then
+ gnome_prefix=$ac_default_prefix/lib
+ else
+ gnome_prefix=$prefix/lib
+ fi
+ else
+ gnome_prefix=`eval echo \`echo $libdir\``
+ fi
+
+ if test "$no_gnome_config" = "yes"; then
+ AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
+ if test -f $gnome_prefix/gnomeConf.sh; then
+ AC_MSG_RESULT(found)
+ echo "loading gnome configuration from" \
+ "$gnome_prefix/gnomeConf.sh"
+ . $gnome_prefix/gnomeConf.sh
+ $1
+ else
+ AC_MSG_RESULT(not found)
+ if test x$2 = xfail; then
+ AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
+ fi
+ fi
+ fi
+ }
+ fi
+])
+
+AC_DEFUN([GNOME_INIT],[
+ GNOME_INIT_HOOK([],fail)
+])
+
+
+dnl ---------------------------------------------------------------------------
+dnl Check for GTK. First checks for gtk-config, cause it needs that to get the
+dnl correct compiler flags. Then checks for GTK 1.1.16. If that fails, then
+dnl it checks for 1.0.6. If both fail, then continue on for Motif as before...
+dnl ---------------------------------------------------------------------------
+if test -z "$SKIP_GTK"; then
+
+ AC_MSG_CHECKING(--with-gtk-prefix argument)
+ AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
+ gtk_config_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
+ gtk_config_prefix=""; AC_MSG_RESULT(no))
+
+ AC_MSG_CHECKING(--with-gtk-exec-prefix argument)
+ AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
+ gtk_config_exec_prefix="$withval"; AC_MSG_RESULT($gtk_config_prefix),
+ gtk_config_exec_prefix=""; AC_MSG_RESULT(no))
+
+ AC_MSG_CHECKING(--disable-gtktest argument)
+ AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
+ , enable_gtktest=yes)
+ if test "x$enable_gtktest" = "xyes" ; then
+ AC_MSG_RESULT(gtk test enabled)
+ else
+ AC_MSG_RESULT(gtk test disabled)
+ fi
+
+ if test "x$gtk_config_prefix" != "x" ; then
+ gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+ GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+ fi
+ if test "x$gtk_config_exec_prefix" != "x" ; then
+ gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+ GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+ fi
+ if test "X$GTK_CONFIG" = "X"; then
+ AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
+ if test "X$GTK_CONFIG" = "Xno"; then
+ dnl Some distributions call it gtk12-config, annoying!
+ AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no)
+ GTK_CONFIG="$GTK12_CONFIG"
+ fi
+ else
+ AC_MSG_RESULT(Using GTK configuration program $GTK_CONFIG)
+ fi
+ if test "X$PKG_CONFIG" = "X"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+
+ if test "x$GTK_CONFIG:$PKG_CONFIG" != "xno:no"; then
+ dnl First try finding version 2.2.0 or later. The 2.0.x series has
+ dnl problems (bold fonts, --remote doesn't work).
+ if test "X$SKIP_GTK2" != "XYES"; then
+ AM_PATH_GTK(2.2.0,
+ [GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"], )
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
+ AC_SUBST(GTK_LIBNAME)
+ fi
+ fi
+
+ dnl If there is no 2.2.0 or later try the 1.x.x series. We require at
+ dnl least GTK 1.1.16. 1.0.6 doesn't work. 1.1.1 to 1.1.15
+ dnl were test versions.
+ if test "x$GUITYPE" != "xGTK"; then
+ SKIP_GTK2=YES
+ AM_PATH_GTK(1.1.16,
+ [GTK_LIBNAME="$GTK_LIBS"
+ GUI_INC_LOC="$GTK_CFLAGS"], )
+ if test "x$GTK_CFLAGS" != "x"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ SKIP_MOTIF=YES
+ GUITYPE=GTK
+ AC_SUBST(GTK_LIBNAME)
+ fi
+ fi
+ fi
+ dnl Give a warning if GTK is older than 1.2.3
+ if test "x$GUITYPE" = "xGTK"; then
+ if test "$gtk_major_version" = 1 -a "0$gtk_minor_version" -lt 2 \
+ -o "$gtk_major_version" = 1 -a "$gtk_minor_version" = 2 -a "0$gtk_micro_version" -lt 3; then
+ AC_MSG_RESULT(this GTK version is old; version 1.2.3 or later is recommended)
+ else
+ {
+ if test "0$gtk_major_version" -ge 2; then
+ AC_DEFINE(HAVE_GTK2)
+ if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
+ || test "0$gtk_minor_version" -ge 2 \
+ || test "0$gtk_major_version" -gt 2; then
+ AC_DEFINE(HAVE_GTK_MULTIHEAD)
+ fi
+ fi
+ dnl
+ dnl if GTK exists, and it's not the 1.0.x series, then check for GNOME.
+ dnl
+ if test -z "$SKIP_GNOME"; then
+ {
+ GNOME_INIT_HOOK([have_gnome=yes])
+ if test x$have_gnome = xyes ; then
+ AC_DEFINE(FEAT_GUI_GNOME)
+ GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
+ GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
+ fi
+ }
+ fi
+ }
+ fi
+ fi
+fi
+
+dnl Check for Motif include files location.
+dnl The LAST one found is used, this makes the highest version to be used,
+dnl e.g. when Motif1.2 and Motif2.0 are both present.
+
+if test -z "$SKIP_MOTIF"; then
+ gui_XXX="/usr/XXX/Motif* /usr/Motif*/XXX /usr/XXX /usr/shlib /usr/X11*/XXX /usr/XXX/X11* /usr/dt/XXX /local/Motif*/XXX /local/XXX/Motif* /usr/local/Motif*/XXX /usr/local/XXX/Motif* /usr/local/XXX /usr/local/X11*/XXX /usr/local/LessTif/Motif*/XXX $MOTIFHOME/XXX"
+ dnl Remove "-I" from before $GUI_INC_LOC if it's there
+ GUI_INC_LOC="`echo $GUI_INC_LOC|sed 's%-I%%g'`"
+
+ AC_MSG_CHECKING(for location of Motif GUI includes)
+ gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/include/g` $GUI_INC_LOC"
+ GUI_INC_LOC=
+ for try in $gui_includes; do
+ if test -f "$try/Xm/Xm.h"; then
+ GUI_INC_LOC=$try
+ fi
+ done
+ if test -n "$GUI_INC_LOC"; then
+ if test "$GUI_INC_LOC" = /usr/include; then
+ GUI_INC_LOC=
+ AC_MSG_RESULT(in default path)
+ else
+ AC_MSG_RESULT($GUI_INC_LOC)
+ fi
+ else
+ AC_MSG_RESULT(<not found>)
+ SKIP_MOTIF=YES
+ fi
+fi
+
+dnl Check for Motif library files location. In the same order as the include
+dnl files, to avoid a mixup if several versions are present
+
+if test -z "$SKIP_MOTIF"; then
+ AC_MSG_CHECKING(--with-motif-lib argument)
+ AC_ARG_WITH(motif-lib,
+ [ --with-motif-lib=STRING Library for Motif ],
+ [ MOTIF_LIBNAME="${withval}" ] )
+
+ if test -n "$MOTIF_LIBNAME"; then
+ AC_MSG_RESULT($MOTIF_LIBNAME)
+ GUI_LIB_LOC=
+ else
+ AC_MSG_RESULT(no)
+
+ dnl Remove "-L" from before $GUI_LIB_LOC if it's there
+ GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`"
+
+ AC_MSG_CHECKING(for location of Motif GUI libs)
+ gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC"
+ GUI_LIB_LOC=
+ for try in $gui_libs; do
+ for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl; do
+ if test -f "$libtry"; then
+ GUI_LIB_LOC=$try
+ fi
+ done
+ done
+ if test -n "$GUI_LIB_LOC"; then
+ dnl Remove /usr/lib, it causes trouble on some systems
+ if test "$GUI_LIB_LOC" = /usr/lib; then
+ GUI_LIB_LOC=
+ AC_MSG_RESULT(in default path)
+ else
+ if test -n "$GUI_LIB_LOC"; then
+ AC_MSG_RESULT($GUI_LIB_LOC)
+ if test "`(uname) 2>/dev/null`" = SunOS &&
+ uname -r | grep '^5' >/dev/null; then
+ GUI_LIB_LOC="$GUI_LIB_LOC -R $GUI_LIB_LOC"
+ fi
+ fi
+ fi
+ MOTIF_LIBNAME=-lXm
+ else
+ AC_MSG_RESULT(<not found>)
+ SKIP_MOTIF=YES
+ fi
+ fi
+fi
+
+if test -z "$SKIP_MOTIF"; then
+ SKIP_ATHENA=YES
+ SKIP_NEXTAW=YES
+ GUITYPE=MOTIF
+ AC_SUBST(MOTIF_LIBNAME)
+fi
+
+dnl Check if the Athena files can be found
+
+GUI_X_LIBS=
+
+if test -z "$SKIP_ATHENA"; then
+ AC_MSG_CHECKING(if Athena header files can be found)
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ AC_TRY_COMPILE([
+#include <X11/Intrinsic.h>
+#include <X11/Xaw/Paned.h>], ,
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); SKIP_ATHENA=YES )
+ CFLAGS=$cflags_save
+fi
+
+if test -z "$SKIP_ATHENA"; then
+ GUITYPE=ATHENA
+fi
+
+if test -z "$SKIP_NEXTAW"; then
+ AC_MSG_CHECKING(if neXtaw header files can be found)
+ cflags_save=$CFLAGS
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ AC_TRY_COMPILE([
+#include <X11/Intrinsic.h>
+#include <X11/neXtaw/Paned.h>], ,
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); SKIP_NEXTAW=YES )
+ CFLAGS=$cflags_save
+fi
+
+if test -z "$SKIP_NEXTAW"; then
+ GUITYPE=NEXTAW
+fi
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
+ dnl Prepend -I and -L to $GUI_INC_LOC and $GUI_LIB_LOC if not empty
+ dnl Avoid adding it when it twice
+ if test -n "$GUI_INC_LOC"; then
+ GUI_INC_LOC=-I"`echo $GUI_INC_LOC|sed 's%-I%%'`"
+ fi
+ if test -n "$GUI_LIB_LOC"; then
+ GUI_LIB_LOC=-L"`echo $GUI_LIB_LOC|sed 's%-L%%'`"
+ fi
+
+ dnl Check for -lXext and then for -lXmu
+ ldflags_save=$LDFLAGS
+ LDFLAGS="$X_LIBS $LDFLAGS"
+ AC_CHECK_LIB(Xext, XShapeQueryExtension, [GUI_X_LIBS="-lXext"],,
+ [-lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+ dnl For Solaris we need -lw and -ldl before linking with -lXmu works.
+ AC_CHECK_LIB(w, wslen, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lw"],,
+ [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+ AC_CHECK_LIB(dl, dlsym, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldl"],,
+ [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+ AC_CHECK_LIB(Xmu, XmuCreateStippledPixmap, [GUI_X_LIBS="-lXmu $GUI_X_LIBS"],,
+ [$GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+ if test -z "$SKIP_MOTIF"; then
+ AC_CHECK_LIB(Xp, XpEndJob, [GUI_X_LIBS="-lXp $GUI_X_LIBS"],,
+ [$GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
+ fi
+ LDFLAGS=$ldflags_save
+
+ dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
+ AC_MSG_CHECKING(for extra X11 defines)
+ NARROW_PROTO=
+ rm -fr conftestdir
+ if mkdir conftestdir; then
+ cd conftestdir
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ fi
+ cd ..
+ rm -fr conftestdir
+ fi
+ if test -z "$NARROW_PROTO"; then
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT($NARROW_PROTO)
+ fi
+ AC_SUBST(NARROW_PROTO)
+fi
+
+dnl Look for XSMP support - but don't necessarily restrict it to X11 GUIs
+dnl use the X11 include path
+if test "$enable_xsmp" = "yes"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_HEADERS(X11/SM/SMlib.h)
+ CPPFLAGS=$cppflags_save
+fi
+
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF" -o -z "$SKIP_GTK"; then
+ dnl Check for X11/xpm.h and X11/Sunkeysym.h with the GUI include path
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_HEADERS(X11/xpm.h X11/Sunkeysym.h)
+
+ dnl automatically disable XIM when XIMtext isn't in X11/Xlib.h
+ if test ! "$enable_xim" = "no"; then
+ AC_MSG_CHECKING(for XIMText in X11/Xlib.h)
+ AC_EGREP_CPP(XIMText, [#include <X11/Xlib.h>],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no; xim has been disabled); enable_xim = "no")
+ fi
+ CPPFLAGS=$cppflags_save
+
+ dnl automatically enable XIM when hangul input isn't enabled
+ if test "$enable_xim" = "auto" -a "$enable_hangulinput" != "yes" \
+ -a "x$GUITYPE" != "xNONE" ; then
+ AC_MSG_RESULT(X GUI selected; xim has been enabled)
+ enable_xim="yes"
+ fi
+fi
+
+if test -z "$SKIP_ATHENA" -o -z "$SKIP_NEXTAW" -o -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_HEADERS(X11/Xmu/Editres.h)
+ CPPFLAGS=$cppflags_save
+fi
+
+dnl Only use the Xm directory when compiling Motif, don't use it for Athena
+if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h)
+ CPPFLAGS=$cppflags_save
+fi
+
+if test "x$GUITYPE" = "xNONE" -a "$enable_xim" = "yes"; then
+ AC_MSG_RESULT(no GUI selected; xim has been disabled)
+ enable_xim="no"
+fi
+if test "x$GUITYPE" = "xNONE" -a "$enable_fontset" = "yes"; then
+ AC_MSG_RESULT(no GUI selected; fontset has been disabled)
+ enable_fontset="no"
+fi
+if test "x$GUITYPE:$enable_fontset" = "xGTK:yes" -a "0$gtk_major_version" -ge 2; then
+ AC_MSG_RESULT(GTK+ 2 GUI selected; fontset has been disabled)
+ enable_fontset="no"
+fi
+
+dnl There is no test for the BeOS GUI, if it's selected it's used
+if test -z "$SKIP_BEOS"; then
+ GUITYPE=BEOSGUI
+fi
+
+if test -z "$SKIP_PHOTON"; then
+ GUITYPE=PHOTONGUI
+fi
+
+AC_SUBST(GUI_INC_LOC)
+AC_SUBST(GUI_LIB_LOC)
+AC_SUBST(GUITYPE)
+AC_SUBST(GUI_X_LIBS)
+
+if test "$enable_workshop" = "yes" -a -n "$SKIP_MOTIF"; then
+ AC_MSG_ERROR([cannot use workshop without Motif])
+fi
+
+dnl defining FEAT_XIM and FEAT_XFONTSET is delayed, so that they can be disabled
+if test "$enable_xim" = "yes"; then
+ AC_DEFINE(FEAT_XIM)
+fi
+if test "$enable_fontset" = "yes"; then
+ AC_DEFINE(FEAT_XFONTSET)
+fi
+
+
+dnl ---------------------------------------------------------------------------
+dnl end of GUI-checking
+dnl ---------------------------------------------------------------------------
+
+
+dnl Only really enable hangul input when GUI and XFONTSET are available
+if test "$enable_hangulinput" = "yes"; then
+ if test "x$GUITYPE" = "xNONE"; then
+ AC_MSG_RESULT(no GUI selected; hangul input has been disabled)
+ enable_hangulinput=no
+ else
+ AC_DEFINE(FEAT_HANGULIN)
+ HANGULIN_SRC=hangulin.c
+ AC_SUBST(HANGULIN_SRC)
+ HANGULIN_OBJ=objects/hangulin.o
+ AC_SUBST(HANGULIN_OBJ)
+ fi
+fi
+
+dnl Checks for libraries and include files.
+
+AC_MSG_CHECKING(quality of toupper)
+AC_TRY_RUN([#include <ctype.h>
+main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }],
+ AC_DEFINE(BROKEN_TOUPPER) AC_MSG_RESULT(bad),
+ AC_MSG_RESULT(good), AC_MSG_ERROR(failed to compile test program))
+
+AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
+AC_TRY_COMPILE(, [printf("(" __DATE__ " " __TIME__ ")");],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
+ AC_MSG_RESULT(no))
+
+dnl Checks for header files.
+AC_CHECK_HEADER(elf.h, HAS_ELF=1)
+dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
+if test "$HAS_ELF" = 1; then
+ AC_CHECK_LIB(elf, main)
+fi
+
+AC_HEADER_DIRENT
+
+dnl check for standard headers, we don't use this in Vim but other stuff
+dnl in autoconf needs it
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+
+dnl If sys/wait.h is not found it might still exist but not be POSIX
+dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
+if test $ac_cv_header_sys_wait_h = no; then
+ AC_MSG_CHECKING([for sys/wait.h that defines union wait])
+ AC_TRY_COMPILE([#include <sys/wait.h>],
+ [union wait xx, yy; xx = yy],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SYS_WAIT_H)
+ AC_DEFINE(HAVE_UNION_WAIT),
+ AC_MSG_RESULT(no))
+fi
+
+AC_CHECK_HEADERS(stdarg.h stdlib.h string.h sys/select.h sys/utsname.h \
+ termcap.h fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h \
+ iconv.h langinfo.h unistd.h stropts.h errno.h \
+ sys/resource.h sys/systeminfo.h locale.h \
+ sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
+ poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
+ libgen.h util/debug.h util/msg18n.h frame.h pthread_np.h \
+ sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h)
+
+dnl On Mac OS X strings.h exists but produces a warning message :-(
+if test "x$MACOSX" != "xyes"; then
+ AC_CHECK_HEADERS(strings.h)
+fi
+
+dnl Check if strings.h and string.h can both be included when defined.
+AC_MSG_CHECKING([if strings.h can be included after string.h])
+cppflags_save=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+AC_TRY_COMPILE([
+#if defined(_AIX) && !defined(_AIX51) && !defined(_NO_PROTO)
+# define _NO_PROTO /* like in os_unix.h, causes conflict for AIX (Winn) */
+ /* but don't do it on AIX 5.1 (Uribarri) */
+#endif
+#ifdef HAVE_XM_XM_H
+# include <Xm/Xm.h> /* This breaks it for HP-UX 11 (Squassabia) */
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H)
+# include <strings.h>
+#endif
+ ], [int i; i = 0;],
+ AC_MSG_RESULT(yes),
+ AC_DEFINE(NO_STRINGS_WITH_STRING_H)
+ AC_MSG_RESULT(no))
+CPPFLAGS=$cppflags_save
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_PROG_GCC_TRADITIONAL
+AC_C_CONST
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_UID_T
+AC_HEADER_TIME
+AC_CHECK_TYPE(ino_t, long)
+AC_CHECK_TYPE(dev_t, unsigned)
+
+AC_MSG_CHECKING(for rlim_t)
+if eval "test \"`echo '$''{'ac_cv_type_rlim_t'+set}'`\" = set"; then
+ AC_MSG_RESULT([(cached) $ac_cv_type_rlim_t])
+else
+ AC_EGREP_CPP(dnl
+changequote(<<,>>)dnl
+<<(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]>>dnl
+changequote([,]),
+ [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+ ], ac_cv_type_rlim_t=yes, ac_cv_type_rlim_t=no)
+ AC_MSG_RESULT($ac_cv_type_rlim_t)
+fi
+if test $ac_cv_type_rlim_t = no; then
+ cat >> confdefs.h <<\EOF
+#define rlim_t unsigned long
+EOF
+fi
+
+AC_MSG_CHECKING(for stack_t)
+if eval "test \"`echo '$''{'ac_cv_type_stack_t'+set}'`\" = set"; then
+ AC_MSG_RESULT([(cached) $ac_cv_type_stack_t])
+else
+ AC_EGREP_CPP(stack_t,
+ [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>
+ ], ac_cv_type_stack_t=yes, ac_cv_type_stack_t=no)
+ AC_MSG_RESULT($ac_cv_type_stack_t)
+fi
+if test $ac_cv_type_stack_t = no; then
+ cat >> confdefs.h <<\EOF
+#define stack_t struct sigaltstack
+EOF
+fi
+
+dnl BSDI uses ss_base while others use ss_sp for the stack pointer.
+AC_MSG_CHECKING(whether stack_t has an ss_base field)
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <signal.h>
+#include "confdefs.h"
+ ], [stack_t sigstk; sigstk.ss_base = 0; ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SS_BASE),
+ AC_MSG_RESULT(no))
+
+olibs="$LIBS"
+AC_MSG_CHECKING(--with-tlib argument)
+AC_ARG_WITH(tlib, [ --with-tlib=library terminal library to be used ],)
+if test -n "$with_tlib"; then
+ AC_MSG_RESULT($with_tlib)
+ LIBS="$LIBS -l$with_tlib"
+else
+ AC_MSG_RESULT([automatic terminal library selection])
+ dnl On HP-UX 10.10 termcap or termlib should be used instead of
+ dnl curses, because curses is much slower.
+ dnl Newer versions of ncurses are preferred over anything.
+ dnl Older versions of ncurses have bugs, get a new one!
+ dnl Digital Unix (OSF1) should use curses (Ronald Schild).
+ case "`uname -s 2>/dev/null`" in
+ OSF1) tlibs="ncurses curses termlib termcap";;
+ *) tlibs="ncurses termlib termcap curses";;
+ esac
+ for libname in $tlibs; do
+ AC_CHECK_LIB(${libname}, tgetent,,)
+ if test "x$olibs" != "x$LIBS"; then
+ dnl It's possible that a library is found but it doesn't work
+ dnl e.g., shared library that cannot be found
+ dnl compile and run a test program to be sure
+ AC_TRY_RUN([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main() {char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(0); }],
+ res="OK", res="FAIL", res="FAIL")
+ if test "$res" = "OK"; then
+ break
+ fi
+ AC_MSG_RESULT($libname library is not usable)
+ LIBS="$olibs"
+ fi
+ done
+fi
+if test "x$olibs" != "x$LIBS"; then
+ AC_MSG_CHECKING(whether we talk terminfo)
+ AC_TRY_RUN([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main()
+{char *s; s=(char *)tgoto("%p1%d", 0, 1); exit(!strcmp(s==0 ? "" : s, "1")); }],
+ AC_MSG_RESULT([no -- we are in termcap land]),
+ AC_MSG_RESULT([yes -- terminfo spoken here]); AC_DEFINE(TERMINFO),
+ AC_MSG_ERROR(failed to compile test program.))
+else
+ AC_MSG_RESULT(none found)
+fi
+
+if test "x$olibs" != "x$LIBS"; then
+ AC_MSG_CHECKING(what tgetent() returns for an unknown terminal)
+ AC_TRY_RUN([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+main()
+{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }],
+ AC_MSG_RESULT(zero); AC_DEFINE(TGETENT_ZERO_ERR, 0),
+ AC_MSG_RESULT(non-zero),
+ AC_MSG_ERROR(failed to compile test program.))
+fi
+
+AC_MSG_CHECKING(whether termcap.h contains ospeed)
+AC_TRY_LINK([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+ ], [ospeed = 20000],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
+ [AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(whether ospeed can be extern)
+ AC_TRY_LINK([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+extern short ospeed;
+ ], [ospeed = 20000],
+ AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
+ AC_MSG_RESULT(no))]
+ )
+
+AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
+AC_TRY_LINK([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+ ], [if (UP == 0 && BC == 0) PC = 1],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
+ [AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether UP, BC and PC can be extern])
+ AC_TRY_LINK([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+extern char *UP, *BC, PC;
+ ], [if (UP == 0 && BC == 0) PC = 1],
+ AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
+ AC_MSG_RESULT(no))]
+ )
+
+AC_MSG_CHECKING(whether tputs() uses outfuntype)
+AC_TRY_COMPILE([
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+#endif
+ ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
+ AC_MSG_RESULT(no))
+
+dnl On some SCO machines sys/select redefines struct timeval
+AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/select.h>], ,
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
+ AC_MSG_RESULT(no))
+
+dnl AC_DECL_SYS_SIGLIST
+
+dnl Checks for pty.c (copied from screen) ==========================
+AC_MSG_CHECKING(for /dev/ptc)
+if test -r /dev/ptc; then
+ AC_DEFINE(HAVE_DEV_PTC)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING(for SVR4 ptys)
+if test -c /dev/ptmx ; then
+ AC_TRY_LINK([], [ptsname(0);grantpt(0);unlockpt(0);],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SVR4_PTYS),
+ AC_MSG_RESULT(no))
+else
+ AC_MSG_RESULT(no)
+fi
+
+AC_MSG_CHECKING(for ptyranges)
+if test -d /dev/ptym ; then
+ pdir='/dev/ptym'
+else
+ pdir='/dev'
+fi
+dnl SCO uses ptyp%d
+AC_EGREP_CPP(yes,
+[#ifdef M_UNIX
+ yes;
+#endif
+ ], ptys=`echo /dev/ptyp??`, ptys=`echo $pdir/pty??`)
+dnl if test -c /dev/ptyp19; then
+dnl ptys=`echo /dev/ptyp??`
+dnl else
+dnl ptys=`echo $pdir/pty??`
+dnl fi
+if test "$ptys" != "$pdir/pty??" ; then
+ p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
+ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
+ AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
+ AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
+ AC_MSG_RESULT([$p0 / $p1])
+else
+ AC_MSG_RESULT([don't know])
+fi
+
+dnl **** pty mode/group handling ****
+dnl
+dnl support provided by Luke Mewburn <lm@rmit.edu.au>, 931222
+AC_MSG_CHECKING(default tty permissions/group)
+rm -f conftest_grp
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+main()
+{
+ struct stat sb;
+ char *x,*ttyname();
+ int om, m;
+ FILE *fp;
+
+ if (!(x = ttyname(0))) exit(1);
+ if (stat(x, &sb)) exit(1);
+ om = sb.st_mode;
+ if (om & 002) exit(0);
+ m = system("mesg y");
+ if (m == -1 || m == 127) exit(1);
+ if (stat(x, &sb)) exit(1);
+ m = sb.st_mode;
+ if (chmod(x, om)) exit(1);
+ if (m & 002) exit(0);
+ if (sb.st_gid == getgid()) exit(1);
+ if (!(fp=fopen("conftest_grp", "w")))
+ exit(1);
+ fprintf(fp, "%d\n", sb.st_gid);
+ fclose(fp);
+ exit(0);
+}
+],[
+ if test -f conftest_grp; then
+ ptygrp=`cat conftest_grp`
+ AC_MSG_RESULT([pty mode: 0620, group: $ptygrp])
+ AC_DEFINE(PTYMODE, 0620)
+ AC_DEFINE_UNQUOTED(PTYGROUP,$ptygrp)
+ else
+ AC_MSG_RESULT([ptys are world accessable])
+ fi
+],
+ AC_MSG_RESULT([can't determine - assume ptys are world accessable]),
+ AC_MSG_ERROR(failed to compile test program))
+rm -f conftest_grp
+
+dnl Checks for library functions. ===================================
+
+AC_TYPE_SIGNAL
+
+dnl find out what to use at the end of a signal function
+if test $ac_cv_type_signal = void; then
+ AC_DEFINE(SIGRETURN, [return])
+else
+ AC_DEFINE(SIGRETURN, [return 0])
+fi
+
+dnl check if struct sigcontext is defined (used for SGI only)
+AC_MSG_CHECKING(for struct sigcontext)
+AC_TRY_COMPILE([
+#include <signal.h>
+test_sig()
+{
+ struct sigcontext *scont;
+ scont = (struct sigcontext *)0;
+ return 1;
+} ], ,
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SIGCONTEXT),
+ AC_MSG_RESULT(no))
+
+dnl tricky stuff: try to find out if getcwd() is implemented with
+dnl system("sh -c pwd")
+AC_MSG_CHECKING(getcwd implementation)
+AC_TRY_RUN([
+char *dagger[] = { "IFS=pwd", 0 };
+main()
+{
+ char buffer[500];
+ extern char **environ;
+ environ = dagger;
+ return getcwd(buffer, 500) ? 0 : 1;
+}],
+ AC_MSG_RESULT(it is usable),
+ AC_MSG_RESULT(it stinks)
+ AC_DEFINE(BAD_GETCWD),
+ AC_MSG_ERROR(failed to compile test program))
+
+dnl Check for functions in one big call, to reduce the size of configure
+AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+ memset nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec snprintf strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper usleep utime utimes)
+
+dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
+AC_MSG_CHECKING(for st_blksize)
+AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/stat.h>],
+[ struct stat st;
+ int n;
+
+ stat("/", &st);
+ n = (int)st.st_blksize;],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ST_BLKSIZE),
+ AC_MSG_RESULT(no))
+
+AC_MSG_CHECKING(whether stat() ignores a trailing slash)
+AC_TRY_RUN(
+[#include <sys/types.h>
+#include <sys/stat.h>
+main() {struct stat st; exit(stat("configure/", &st) != 0); }],
+ AC_MSG_RESULT(yes); AC_DEFINE(STAT_IGNORES_SLASH),
+ AC_MSG_RESULT(no), AC_MSG_ERROR(failed to compile test program))
+
+dnl Link with iconv for charset translation, if not found without library.
+dnl check for iconv() requires including iconv.h
+dnl Add "-liconv" when possible; Solaris has iconv but use GNU iconv when it
+dnl has been installed.
+AC_MSG_CHECKING(for iconv_open())
+save_LIBS="$LIBS"
+LIBS="$LIBS -liconv"
+AC_TRY_LINK([
+#ifdef HAVE_ICONV_H
+# include <iconv.h>
+#endif
+ ], [iconv_open("fr", "to");],
+ AC_MSG_RESULT(yes; with -liconv); AC_DEFINE(HAVE_ICONV),
+ LIBS="$save_LIBS"
+ AC_TRY_LINK([
+#ifdef HAVE_ICONV_H
+# include <iconv.h>
+#endif
+ ], [iconv_open("fr", "to");],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ICONV),
+ AC_MSG_RESULT(no)))
+
+
+AC_MSG_CHECKING(for nl_langinfo(CODESET))
+AC_TRY_LINK([
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+], [char *cs = nl_langinfo(CODESET);],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NL_LANGINFO_CODESET),
+ AC_MSG_RESULT(no))
+
+dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
+dnl when -lacl works, also try to use -lattr (required for Debian).
+AC_MSG_CHECKING(--disable-acl argument)
+AC_ARG_ENABLE(acl,
+ [ --disable-acl Don't check for ACL support.],
+ , [enable_acl="yes"])
+if test "$enable_acl" = "yes"; then
+AC_MSG_RESULT(no)
+AC_CHECK_LIB(posix1e, acl_get_file, [LIBS="$LIBS -lposix1e"],
+ AC_CHECK_LIB(acl, acl_get_file, [LIBS="$LIBS -lacl"
+ AC_CHECK_LIB(attr, fgetxattr, LIBS="$LIBS -lattr",,)],,),)
+
+AC_MSG_CHECKING(for POSIX ACL support)
+AC_TRY_LINK([
+#include <sys/types.h>
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
+ acl_set_file("foo", ACL_TYPE_ACCESS, acl);
+ acl_free(acl);],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
+ AC_MSG_RESULT(no))
+
+AC_MSG_CHECKING(for Solaris ACL support)
+AC_TRY_LINK([
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif], [acl("foo", GETACLCNT, 0, NULL);
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
+ AC_MSG_RESULT(no))
+
+AC_MSG_CHECKING(for AIX ACL support)
+AC_TRY_LINK([
+#ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_ACCESS_H
+# include <sys/access.h>
+#endif
+#define _ALL_SOURCE
+
+#include <sys/stat.h>
+
+int aclsize;
+struct acl *aclent;], [aclsize = sizeof(struct acl);
+ aclent = (void *)malloc(aclsize);
+ statacl("foo", STX_NORMAL, aclent, aclsize);
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_AIX_ACL),
+ AC_MSG_RESULT(no))
+else
+ AC_MSG_RESULT(yes)
+fi
+
+AC_MSG_CHECKING(--disable-gpm argument)
+AC_ARG_ENABLE(gpm,
+ [ --disable-gpm Don't use gpm (Linux mouse daemon).], ,
+ [enable_gpm="yes"])
+
+if test "$enable_gpm" = "yes"; then
+ AC_MSG_RESULT(no)
+ dnl Checking if gpm support can be compiled
+ AC_CACHE_CHECK([for gpm], vi_cv_have_gpm,
+ [olibs="$LIBS" ; LIBS="-lgpm"]
+ AC_TRY_LINK(
+ [#include <gpm.h>
+ #include <linux/keyboard.h>],
+ [Gpm_GetLibVersion(NULL);],
+ dnl Configure defines HAVE_GPM, if it is defined feature.h defines
+ dnl FEAT_MOUSE_GPM if mouse support is included
+ [vi_cv_have_gpm=yes],
+ [vi_cv_have_gpm=no])
+ [LIBS="$olibs"]
+ )
+ if test $vi_cv_have_gpm = yes; then
+ LIBS="$LIBS -lgpm"
+ AC_DEFINE(HAVE_GPM)
+ fi
+else
+ AC_MSG_RESULT(yes)
+fi
+
+AC_MSG_CHECKING(for vsnprintf())
+AC_TRY_RUN([
+#include <stdio.h>
+#include <stdarg.h>
+ /* Check use of vsnprintf() */
+ void warn(char *fmt, ...);
+ void warn(char *fmt, ...)
+ {
+ va_list ap; char buf[20];
+ va_start(ap, fmt);
+ vsnprintf(buf, 20, fmt, ap);
+ va_end(ap);
+ }
+ main()
+ {
+ warn("testing %s\n", "a very long string that won't fit");
+ exit(0);
+ }
+ ],
+ AC_DEFINE(HAVE_VSNPRINTF) AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no),
+ AC_MSG_ERROR(failed to compile test program))
+
+
+dnl rename needs to be checked separately to work on Nextstep with cc
+AC_MSG_CHECKING(for rename)
+AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
+ AC_MSG_RESULT(no))
+
+dnl sysctl() may exist but not the arguments we use
+AC_MSG_CHECKING(for sysctl)
+AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/sysctl.h>],
+[ int mib[2], r;
+ size_t len;
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_USERMEM;
+ len = sizeof(r);
+ (void)sysctl(mib, 2, &r, &len, (void *)0, (size_t)0);
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
+ AC_MSG_RESULT(not usable))
+
+dnl sysinfo() may exist but not be Linux compatible
+AC_MSG_CHECKING(for sysinfo)
+AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/sysinfo.h>],
+[ struct sysinfo sinfo;
+ int t;
+
+ (void)sysinfo(&sinfo);
+ t = sinfo.totalram;
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO),
+ AC_MSG_RESULT(not usable))
+
+dnl sysconf() may exist but not support what we want to use
+AC_MSG_CHECKING(for sysconf)
+AC_TRY_COMPILE(
+[#include <unistd.h>],
+[ (void)sysconf(_SC_PAGESIZE);
+ (void)sysconf(_SC_PHYS_PAGES);
+ ],
+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCONF),
+ AC_MSG_RESULT(not usable))
+
+dnl Our own version of AC_CHECK_SIZEOF(int); fixes a bug when sizeof() can't
+dnl be printed with "%d", and avoids a warning for cross-compiling.
+
+AC_MSG_CHECKING(size of int)
+AC_CACHE_VAL(ac_cv_sizeof_int,
+ [AC_TRY_RUN([#include <stdio.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", (int)sizeof(int));
+ exit(0);
+ }],
+ ac_cv_sizeof_int=`cat conftestval`,
+ ac_cv_sizeof_int=0,
+ AC_MSG_ERROR(failed to compile test program))])
+AC_MSG_RESULT($ac_cv_sizeof_int)
+AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int)
+
+AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps)
+[bcopy_test_prog='
+main() {
+ char buf[10];
+ strcpy(buf, "abcdefghi");
+ mch_memmove(buf, buf + 2, 3);
+ if (strncmp(buf, "ababcf", 6))
+ exit(1);
+ strcpy(buf, "abcdefghi");
+ mch_memmove(buf + 2, buf, 3);
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+}']
+
+dnl Check for memmove() before bcopy(), makes memmove() be used when both are
+dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
+
+AC_TRY_RUN([#define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog],
+ AC_DEFINE(USEMEMMOVE) AC_MSG_RESULT(memmove does),
+ AC_TRY_RUN([#define mch_memmove(s,d,l) bcopy(d,s,l) $bcopy_test_prog],
+ AC_DEFINE(USEBCOPY) AC_MSG_RESULT(bcopy does),
+ AC_TRY_RUN([#define mch_memmove(s,d,l) memcpy(d,s,l) $bcopy_test_prog],
+ AC_DEFINE(USEMEMCPY) AC_MSG_RESULT(memcpy does), AC_MSG_RESULT(no),
+ AC_MSG_ERROR(failed to compile test program)),
+ AC_MSG_ERROR(failed to compile test program)),
+ AC_MSG_ERROR(failed to compile test program))
+
+dnl Check for multibyte locale functions
+dnl Find out if _Xsetlocale() is supported by libX11.
+dnl Check if X_LOCALE should be defined.
+
+if test "$enable_multibyte" = "yes"; then
+ cflags_save=$CFLAGS
+ ldflags_save=$LDFLAGS
+ if test -n "$x_includes" ; then
+ CFLAGS="$CFLAGS -I$x_includes"
+ LDFLAGS="$X_LIBS $LDFLAGS -lX11"
+ AC_MSG_CHECKING(whether X_LOCALE needed)
+ AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
+ AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
+ AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
+ AC_MSG_RESULT(no))
+ fi
+ CFLAGS=$cflags_save
+ LDFLAGS=$ldflags_save
+fi
+
+dnl Link with xpg4, it is said to make Korean locale working
+AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,)
+
+dnl Check how we can run ctags
+dnl --version for Exuberant ctags (preferred)
+dnl -t for typedefs (many ctags have this)
+dnl -s for static functions (Elvis ctags only?)
+dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
+dnl -i+m to test for older Exuberant ctags
+AC_MSG_CHECKING(how to create tags)
+test -f tags && mv tags tags.save
+if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then
+ TAGPRG="ctags"
+else
+ (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags"
+ (eval etags -c /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags -c"
+ (eval ctags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags"
+ (eval ctags -t /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -t"
+ (eval ctags -ts /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -ts"
+ (eval ctags -tvs /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -tvs"
+ (eval ctags -i+m /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="ctags -i+m"
+fi
+test -f tags.save && mv tags.save tags
+AC_MSG_RESULT($TAGPRG) AC_SUBST(TAGPRG)
+
+dnl Check how we can run man with a section number
+AC_MSG_CHECKING(how to run man with a section nr)
+MANDEF="man"
+(eval man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
+AC_MSG_RESULT($MANDEF)
+if test "$MANDEF" = "man -s"; then
+ AC_DEFINE(USEMAN_S)
+fi
+
+dnl Check if gettext() is working and if it needs -lintl
+AC_MSG_CHECKING(--disable-nls argument)
+AC_ARG_ENABLE(nls,
+ [ --disable-nls Don't support NLS (gettext()).], ,
+ [enable_nls="yes"])
+
+if test "$enable_nls" = "yes"; then
+ AC_MSG_RESULT(no)
+ AC_CHECK_PROG(MSGFMT, msgfmt, msgfmt, )
+ AC_MSG_CHECKING([for NLS])
+ if test -f po/Makefile; then
+ have_gettext="no"
+ if test -n "$MSGFMT"; then
+ AC_TRY_LINK(
+ [#include <libintl.h>],
+ [gettext("Test");],
+ AC_MSG_RESULT([gettext() works]); have_gettext="yes",
+ olibs=$LIBS
+ LIBS="$LIBS -lintl"
+ AC_TRY_LINK(
+ [#include <libintl.h>],
+ [gettext("Test");],
+ AC_MSG_RESULT([gettext() works with -lintl]); have_gettext="yes",
+ AC_MSG_RESULT([gettext() doesn't work]);
+ LIBS=$olibs))
+ else
+ AC_MSG_RESULT([msgfmt not found - disabled]);
+ fi
+ if test $have_gettext = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT)
+ MAKEMO=yes
+ AC_SUBST(MAKEMO)
+ dnl this was added in GNU gettext 0.10.36
+ AC_CHECK_FUNCS(bind_textdomain_codeset)
+ dnl _nl_msg_cat_cntr is required for GNU gettext
+ AC_MSG_CHECKING([for _nl_msg_cat_cntr])
+ AC_TRY_LINK(
+ [#include <libintl.h>
+ extern int _nl_msg_cat_cntr;],
+ [++_nl_msg_cat_cntr;],
+ AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_NL_MSG_CAT_CNTR),
+ AC_MSG_RESULT([no]))
+ fi
+ else
+ AC_MSG_RESULT([no "po/Makefile" - disabled]);
+ fi
+else
+ AC_MSG_RESULT(yes)
+fi
+
+dnl Check for dynamic linking loader
+AC_CHECK_HEADER(dlfcn.h, DLL=dlfcn.h, [AC_CHECK_HEADER(dl.h, DLL=dl.h)])
+if test x${DLL} = xdlfcn.h; then
+ AC_DEFINE(HAVE_DLFCN_H, 1, [ Define if we have dlfcn.h. ])
+ AC_MSG_CHECKING([for dlopen()])
+ AC_TRY_LINK(,[
+ extern void* dlopen();
+ dlopen();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
+ AC_MSG_RESULT(no);
+ AC_MSG_CHECKING([for dlopen() in -ldl])
+ olibs=$LIBS
+ LIBS="$LIBS -ldl"
+ AC_TRY_LINK(,[
+ extern void* dlopen();
+ dlopen();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_DLOPEN, 1, [ Define if we have dlopen() ]),
+ AC_MSG_RESULT(no);
+ LIBS=$olibs))
+ dnl ReliantUNIX has dlopen() in libc but everything else in libdl
+ dnl ick :-)
+ AC_MSG_CHECKING([for dlsym()])
+ AC_TRY_LINK(,[
+ extern void* dlsym();
+ dlsym();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
+ AC_MSG_RESULT(no);
+ AC_MSG_CHECKING([for dlsym() in -ldl])
+ olibs=$LIBS
+ LIBS="$LIBS -ldl"
+ AC_TRY_LINK(,[
+ extern void* dlsym();
+ dlsym();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_DLSYM, 1, [ Define if we have dlsym() ]),
+ AC_MSG_RESULT(no);
+ LIBS=$olibs))
+elif test x${DLL} = xdl.h; then
+ AC_DEFINE(HAVE_DL_H, 1, [ Define if we have dl.h. ])
+ AC_MSG_CHECKING([for shl_load()])
+ AC_TRY_LINK(,[
+ extern void* shl_load();
+ shl_load();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
+ AC_MSG_RESULT(no);
+ AC_MSG_CHECKING([for shl_load() in -ldld])
+ olibs=$LIBS
+ LIBS="$LIBS -ldld"
+ AC_TRY_LINK(,[
+ extern void* shl_load();
+ shl_load();
+ ],
+ AC_MSG_RESULT(yes);
+ AC_DEFINE(HAVE_SHL_LOAD, 1, [ Define if we have shl_load() ]),
+ AC_MSG_RESULT(no);
+ LIBS=$olibs))
+fi
+AC_CHECK_HEADERS(setjmp.h)
+
+if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
+ dnl -ldl must come after DynaLoader.a
+ if echo $LIBS | grep -e '-ldl' >/dev/null; then
+ LIBS=`echo $LIBS | sed s/-ldl//`
+ PERL_LIBS="$PERL_LIBS -ldl"
+ fi
+fi
+
+if test "x$MACOSX" = "xyes" && test "x$CARBON" = "xyes" \
+ && test "x$GUITYPE" != "xCARBONGUI"; then
+ AC_MSG_CHECKING(whether we need -framework Carbon)
+ dnl check for MACOSX without Carbon GUI, but with FEAT_MBYTE
+ if test "x$enable_multibyte" = "xyes" || test "x$features" == "xbig" \
+ || test "x$features" = "xhuge"; then
+ LIBS="$LIBS -framework Carbon"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+
+dnl write output files
+AC_OUTPUT(auto/config.mk:config.mk.in)
+
+dnl vim: set sw=2 tw=78 fo+=l:
diff --git a/src/dehqx.py b/src/dehqx.py
new file mode 100644
index 000000000..9c9cefb4f
--- /dev/null
+++ b/src/dehqx.py
@@ -0,0 +1,40 @@
+# Python script to get both the data and resource fork from a BinHex encoded
+# file.
+# Author: Taro Muraoka
+# Last Change: 2003 Oct 25
+
+import sys
+import binhex
+
+input = sys.argv[1]
+conv = binhex.HexBin(input)
+info = conv.FInfo
+out = conv.FName
+out_data = out
+out_rsrc = out + '.rsrcfork'
+#print 'out_rsrc=' + out_rsrc
+print 'In file: ' + input
+
+outfile = open(out_data, 'wb')
+print ' Out data fork: ' + out_data
+while 1:
+ d = conv.read(128000)
+ if not d: break
+ outfile.write(d)
+outfile.close()
+conv.close_data()
+
+d = conv.read_rsrc(128000)
+if d:
+ print ' Out rsrc fork: ' + out_rsrc
+ outfile = open(out_rsrc, 'wb')
+ outfile.write(d)
+ while 1:
+ d = conv.read_rsrc(128000)
+ if not d: break
+ outfile.write(d)
+ outfile.close()
+
+conv.close()
+
+# vim:set ts=8 sts=4 sw=4 et:
diff --git a/src/diff.c b/src/diff.c
new file mode 100644
index 000000000..580589e47
--- /dev/null
+++ b/src/diff.c
@@ -0,0 +1,2208 @@
+/* vim:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * diff.c: code for diff'ing two or three buffers.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_DIFF) || defined(PROTO)
+
+#define DB_COUNT 4 /* up to four buffers can be diff'ed */
+
+/*
+ * Each diffblock defines where a block of lines starts in each of the buffers
+ * and how many lines it occupies in that buffer. When the lines are missing
+ * in the buffer the df_count[] is zero. This is all counted in
+ * buffer lines.
+ * There is always at least one unchanged line in between the diffs.
+ * Otherwise it would have been included in the diff above or below it.
+ * df_lnum[] + df_count[] is the lnum below the change. When in one buffer
+ * lines have been inserted, in the other buffer df_lnum[] is the line below
+ * the insertion and df_count[] is zero. When appending lines at the end of
+ * the buffer, df_lnum[] is one beyond the end!
+ * This is using a linked list, because the number of differences is expected
+ * to be reasonable small. The list is sorted on lnum.
+ */
+typedef struct diffblock diff_T;
+struct diffblock
+{
+ diff_T *df_next;
+ linenr_T df_lnum[DB_COUNT]; /* line number in buffer */
+ linenr_T df_count[DB_COUNT]; /* nr of inserted/changed lines */
+};
+
+static diff_T *first_diff = NULL;
+
+static buf_T *(diffbuf[DB_COUNT]);
+
+static int diff_invalid = TRUE; /* list of diffs is outdated */
+
+static int diff_busy = FALSE; /* ex_diffgetput() is busy */
+
+/* flags obtained from the 'diffopt' option */
+#define DIFF_FILLER 1 /* display filler lines */
+#define DIFF_ICASE 2 /* ignore case */
+#define DIFF_IWHITE 4 /* ignore change in white space */
+static int diff_flags = DIFF_FILLER;
+
+#define LBUFLEN 50 /* length of line in diff file */
+
+static int diff_a_works = MAYBE; /* TRUE when "diff -a" works, FALSE when it
+ doesn't work, MAYBE when not checked yet */
+#if defined(MSWIN) || defined(MSDOS)
+static int diff_bin_works = MAYBE; /* TRUE when "diff --binary" works, FALSE
+ when it doesn't work, MAYBE when not
+ checked yet */
+#endif
+
+static int diff_buf_idx __ARGS((buf_T *buf));
+static void diff_check_unchanged __ARGS((diff_T *dp));
+static int diff_check_sanity __ARGS((diff_T *dp));
+static void diff_redraw __ARGS((int dofold));
+static int diff_write __ARGS((buf_T *buf, char_u *fname));
+static void diff_file __ARGS((char_u *tmp_orig, char_u *tmp_new, char_u *tmp_diff));
+static void diff_clear __ARGS((void));
+static int diff_equal_entry __ARGS((diff_T *dp, int idx1, int idx2));
+static int diff_cmp __ARGS((char_u *s1, char_u *s2));
+#ifdef FEAT_FOLDING
+static void diff_fold_update __ARGS((diff_T *dp, int skip_idx));
+#endif
+static void diff_read __ARGS((int idx_orig, int idx_new, char_u *fname));
+static void diff_copy_entry __ARGS((diff_T *dprev, diff_T *dp, int idx_orig, int idx_new));
+static diff_T *diff_alloc_new __ARGS((diff_T *dprev, diff_T *dp));
+
+#ifndef USE_CR
+# define tag_fgets vim_fgets
+#endif
+
+/*
+ * Call this when a new buffer is being edited in the current window. curbuf
+ * must already have been set.
+ * Marks the current buffer as being part of the diff and requireing updating.
+ * This must be done before any autocmd, because a command the uses info
+ * about the screen contents.
+ */
+ void
+diff_new_buffer()
+{
+ if (curwin->w_p_diff)
+ diff_buf_add(curbuf);
+}
+
+/*
+ * Called when deleting or unloading a buffer: No longer make a diff with it.
+ * Also called when 'diff' is reset in the last window showing a diff for a
+ * buffer.
+ */
+ void
+diff_buf_delete(buf)
+ buf_T *buf;
+{
+ int i;
+
+ i = diff_buf_idx(buf);
+ if (i != DB_COUNT)
+ {
+ diffbuf[i] = NULL;
+ diff_invalid = TRUE;
+ }
+}
+
+/*
+ * Add a buffer to make diffs for.
+ */
+ void
+diff_buf_add(buf)
+ buf_T *buf;
+{
+ int i;
+
+ if (diff_buf_idx(buf) != DB_COUNT)
+ return; /* It's already there. */
+
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] == NULL)
+ {
+ diffbuf[i] = buf;
+ diff_invalid = TRUE;
+ return;
+ }
+
+ EMSGN(_("E96: Can not diff more than %ld buffers"), DB_COUNT);
+}
+
+/*
+ * Find buffer "buf" in the list of diff buffers.
+ * Return its index or DB_COUNT if not found.
+ */
+ static int
+diff_buf_idx(buf)
+ buf_T *buf;
+{
+ int idx;
+
+ for (idx = 0; idx < DB_COUNT; ++idx)
+ if (diffbuf[idx] == buf)
+ break;
+ return idx;
+}
+
+/*
+ * Mark the diff info as invalid, it will be updated when info is requested.
+ */
+ void
+diff_invalidate()
+{
+ if (curwin->w_p_diff)
+ {
+ diff_invalid = TRUE;
+ diff_redraw(TRUE);
+ }
+}
+
+/*
+ * Called by mark_adjust(): update line numbers.
+ * This attempts to update the changes as much as possible:
+ * When inserting/deleting lines outside of existing change blocks, create a
+ * new change block and update the line numbers in following blocks.
+ * When inserting/deleting lines in existing change blocks, update them.
+ */
+ void
+diff_mark_adjust(line1, line2, amount, amount_after)
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ diff_T *dp;
+ diff_T *dprev;
+ diff_T *dnext;
+ int idx;
+ int i;
+ int inserted, deleted;
+ int n, off;
+ linenr_T last;
+ linenr_T lnum_deleted = line1; /* lnum of remaining deletion */
+ int check_unchanged;
+
+ /* Find the index for the current buffer. */
+ idx = diff_buf_idx(curbuf);
+ if (idx == DB_COUNT)
+ return; /* This buffer doesn't have diffs. */
+
+ if (line2 == MAXLNUM)
+ {
+ /* mark_adjust(99, MAXLNUM, 9, 0): insert lines */
+ inserted = amount;
+ deleted = 0;
+ }
+ else if (amount_after > 0)
+ {
+ /* mark_adjust(99, 98, MAXLNUM, 9): a change that inserts lines*/
+ inserted = amount_after;
+ deleted = 0;
+ }
+ else
+ {
+ /* mark_adjust(98, 99, MAXLNUM, -2): delete lines */
+ inserted = 0;
+ deleted = -amount_after;
+ }
+
+ dprev = NULL;
+ dp = first_diff;
+ for (;;)
+ {
+ /* If the change is after the previous diff block and before the next
+ * diff block, thus not touching an existing change, create a new diff
+ * block. Don't do this when ex_diffgetput() is busy. */
+ if ((dp == NULL || dp->df_lnum[idx] - 1 > line2
+ || (line2 == MAXLNUM && dp->df_lnum[idx] > line1))
+ && (dprev == NULL
+ || dprev->df_lnum[idx] + dprev->df_count[idx] < line1)
+ && !diff_busy)
+ {
+ dnext = diff_alloc_new(dprev, dp);
+ if (dnext == NULL)
+ return;
+
+ dnext->df_lnum[idx] = line1;
+ dnext->df_count[idx] = inserted;
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && i != idx)
+ {
+ if (dprev == NULL)
+ dnext->df_lnum[i] = line1;
+ else
+ dnext->df_lnum[i] = line1
+ + (dprev->df_lnum[i] + dprev->df_count[i])
+ - (dprev->df_lnum[idx] + dprev->df_count[idx]);
+ dnext->df_count[i] = deleted;
+ }
+ }
+
+ /* if at end of the list, quit */
+ if (dp == NULL)
+ break;
+
+ /*
+ * Check for these situations:
+ * 1 2 3
+ * 1 2 3
+ * line1 2 3 4 5
+ * 2 3 4 5
+ * 2 3 4 5
+ * line2 2 3 4 5
+ * 3 5 6
+ * 3 5 6
+ */
+ /* compute last line of this change */
+ last = dp->df_lnum[idx] + dp->df_count[idx] - 1;
+
+ /* 1. change completely above line1: nothing to do */
+ if (last >= line1 - 1)
+ {
+ /* 6. change below line2: only adjust for amount_after; also when
+ * "deleted" became zero when deleted all lines between two diffs */
+ if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2)
+ {
+ if (amount_after == 0)
+ break; /* nothing left to change */
+ dp->df_lnum[idx] += amount_after;
+ }
+ else
+ {
+ check_unchanged = FALSE;
+
+ /* 2. 3. 4. 5.: inserted/deleted lines touching this diff. */
+ if (deleted > 0)
+ {
+ if (dp->df_lnum[idx] >= line1)
+ {
+ off = dp->df_lnum[idx] - lnum_deleted;
+ if (last <= line2)
+ {
+ /* 4. delete all lines of diff */
+ if (dp->df_next != NULL
+ && dp->df_next->df_lnum[idx] - 1 <= line2)
+ {
+ /* delete continues in next diff, only do
+ * lines until that one */
+ n = dp->df_next->df_lnum[idx] - lnum_deleted;
+ deleted -= n;
+ n -= dp->df_count[idx];
+ lnum_deleted = dp->df_next->df_lnum[idx];
+ }
+ else
+ n = deleted - dp->df_count[idx];
+ dp->df_count[idx] = 0;
+ }
+ else
+ {
+ /* 5. delete lines at or just before top of diff */
+ n = off;
+ dp->df_count[idx] -= line2 - dp->df_lnum[idx] + 1;
+ check_unchanged = TRUE;
+ }
+ dp->df_lnum[idx] = line1;
+ }
+ else
+ {
+ off = 0;
+ if (last < line2)
+ {
+ /* 2. delete at end of of diff */
+ dp->df_count[idx] -= last - lnum_deleted + 1;
+ if (dp->df_next != NULL
+ && dp->df_next->df_lnum[idx] - 1 <= line2)
+ {
+ /* delete continues in next diff, only do
+ * lines until that one */
+ n = dp->df_next->df_lnum[idx] - 1 - last;
+ deleted -= dp->df_next->df_lnum[idx]
+ - lnum_deleted;
+ lnum_deleted = dp->df_next->df_lnum[idx];
+ }
+ else
+ n = line2 - last;
+ check_unchanged = TRUE;
+ }
+ else
+ {
+ /* 3. delete lines inside the diff */
+ n = 0;
+ dp->df_count[idx] -= deleted;
+ }
+ }
+
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && i != idx)
+ {
+ dp->df_lnum[i] -= off;
+ dp->df_count[i] += n;
+ }
+ }
+ else
+ {
+ if (dp->df_lnum[idx] <= line1)
+ {
+ /* inserted lines somewhere in this diff */
+ dp->df_count[idx] += inserted;
+ check_unchanged = TRUE;
+ }
+ else
+ /* inserted lines somewhere above this diff */
+ dp->df_lnum[idx] += inserted;
+ }
+
+ if (check_unchanged)
+ /* Check if inserted lines are equal, may reduce the
+ * size of the diff. TODO: also check for equal lines
+ * in the middle and perhaps split the block. */
+ diff_check_unchanged(dp);
+ }
+ }
+
+ /* check if this block touches the previous one, may merge them. */
+ if (dprev != NULL && dprev->df_lnum[idx] + dprev->df_count[idx]
+ == dp->df_lnum[idx])
+ {
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL)
+ dprev->df_count[i] += dp->df_count[i];
+ dprev->df_next = dp->df_next;
+ vim_free(dp);
+ dp = dprev->df_next;
+ }
+ else
+ {
+ /* Advance to next entry. */
+ dprev = dp;
+ dp = dp->df_next;
+ }
+ }
+
+ dprev = NULL;
+ dp = first_diff;
+ while (dp != NULL)
+ {
+ /* All counts are zero, remove this entry. */
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && dp->df_count[i] != 0)
+ break;
+ if (i == DB_COUNT)
+ {
+ dnext = dp->df_next;
+ vim_free(dp);
+ dp = dnext;
+ if (dprev == NULL)
+ first_diff = dnext;
+ else
+ dprev->df_next = dnext;
+ }
+ else
+ {
+ /* Advance to next entry. */
+ dprev = dp;
+ dp = dp->df_next;
+ }
+
+ }
+ diff_redraw(TRUE);
+
+ /* Recompute the scroll binding, may remove or add filler lines (e.g.,
+ * when adding lines above w_topline). */
+ check_scrollbind((linenr_T)0, 0L);
+}
+
+/*
+ * Allocate a new diff block and link it between "dprev" and "dp".
+ */
+ static diff_T *
+diff_alloc_new(dprev, dp)
+ diff_T *dprev;
+ diff_T *dp;
+{
+ diff_T *dnew;
+
+ dnew = (diff_T *)alloc((unsigned)sizeof(diff_T));
+ if (dnew != NULL)
+ {
+ dnew->df_next = dp;
+ if (dprev == NULL)
+ first_diff = dnew;
+ else
+ dprev->df_next = dnew;
+ }
+ return dnew;
+}
+
+/*
+ * Check if the diff block "dp" can be made smaller for lines at the start and
+ * end that are equal. Called after inserting lines.
+ * This may result in a change where all buffers have zero lines, the caller
+ * must take care of removing it.
+ */
+ static void
+diff_check_unchanged(dp)
+ diff_T *dp;
+{
+ int i_org;
+ int i_new;
+ int off_org, off_new;
+ char_u *line_org;
+ int dir = FORWARD;
+
+ /* Find the first buffers, use it as the original, compare the other
+ * buffer lines against this one. */
+ for (i_org = 0; i_org < DB_COUNT; ++i_org)
+ if (diffbuf[i_org] != NULL)
+ break;
+ if (i_org == DB_COUNT) /* safety check */
+ return;
+
+ if (diff_check_sanity(dp) == FAIL)
+ return;
+
+ /* First check lines at the top, then at the bottom. */
+ off_org = 0;
+ off_new = 0;
+ for (;;)
+ {
+ /* Repeat until a line is found which is different or the number of
+ * lines has become zero. */
+ while (dp->df_count[i_org] > 0)
+ {
+ /* Copy the line, the next ml_get() will invalidate it. */
+ if (dir == BACKWARD)
+ off_org = dp->df_count[i_org] - 1;
+ line_org = vim_strsave(ml_get_buf(diffbuf[i_org],
+ dp->df_lnum[i_org] + off_org, FALSE));
+ if (line_org == NULL)
+ return;
+ for (i_new = i_org + 1; i_new < DB_COUNT; ++i_new)
+ {
+ if (diffbuf[i_new] == NULL)
+ continue;
+ if (dir == BACKWARD)
+ off_new = dp->df_count[i_new] - 1;
+ /* if other buffer doesn't have this line, it was inserted */
+ if (off_new < 0 || off_new >= dp->df_count[i_new])
+ break;
+ if (diff_cmp(line_org, ml_get_buf(diffbuf[i_new],
+ dp->df_lnum[i_new] + off_new, FALSE)) != 0)
+ break;
+ }
+ vim_free(line_org);
+
+ /* Stop when a line isn't equal in all diff buffers. */
+ if (i_new != DB_COUNT)
+ break;
+
+ /* Line matched in all buffers, remove it from the diff. */
+ for (i_new = i_org; i_new < DB_COUNT; ++i_new)
+ if (diffbuf[i_new] != NULL)
+ {
+ if (dir == FORWARD)
+ ++dp->df_lnum[i_new];
+ --dp->df_count[i_new];
+ }
+ }
+ if (dir == BACKWARD)
+ break;
+ dir = BACKWARD;
+ }
+}
+
+/*
+ * Check if a diff block doesn't contain invalid line numbers.
+ * This can happen when the diff program returns invalid results.
+ */
+ static int
+diff_check_sanity(dp)
+ diff_T *dp;
+{
+ int i;
+
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL)
+ if (dp->df_lnum[i] + dp->df_count[i] - 1
+ > diffbuf[i]->b_ml.ml_line_count)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Mark all diff buffers for redraw.
+ */
+ static void
+diff_redraw(dofold)
+ int dofold; /* also recompute the folds */
+{
+ win_T *wp;
+ int n;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_p_diff)
+ {
+ redraw_win_later(wp, NOT_VALID);
+#ifdef FEAT_FOLDING
+ if (dofold && foldmethodIsDiff(wp))
+ foldUpdateAll(wp);
+#endif
+ /* A change may have made filler lines invalid, need to take care
+ * of that for other windows. */
+ if (wp != curwin && wp->w_topfill > 0)
+ {
+ n = diff_check(wp, wp->w_topline);
+ if (wp->w_topfill > n)
+ wp->w_topfill = (n < 0 ? 0 : n);
+ }
+ }
+}
+
+/*
+ * Write buffer "buf" to file "name".
+ * Always use 'fileformat' set to "unix".
+ * Return FAIL for failure
+ */
+ static int
+diff_write(buf, fname)
+ buf_T *buf;
+ char_u *fname;
+{
+ int r;
+ char_u *save_ff;
+
+ save_ff = buf->b_p_ff;
+ buf->b_p_ff = vim_strsave((char_u *)FF_UNIX);
+ r = buf_write(buf, fname, NULL, (linenr_T)1, buf->b_ml.ml_line_count,
+ NULL, FALSE, FALSE, FALSE, TRUE);
+ free_string_option(buf->b_p_ff);
+ buf->b_p_ff = save_ff;
+ return r;
+}
+
+/*
+ * Completely update the diffs for the buffers involved.
+ * This uses the ordinary "diff" command.
+ * The buffers are written to a file, also for unmodified buffers (the file
+ * could have been produced by autocommands, e.g. the netrw plugin).
+ */
+/*ARGSUSED*/
+ void
+ex_diffupdate(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ int idx_orig;
+ int idx_new;
+ char_u *tmp_orig;
+ char_u *tmp_new;
+ char_u *tmp_diff;
+ FILE *fd;
+ int ok;
+
+ /* Delete all diffblocks. */
+ diff_clear();
+ diff_invalid = FALSE;
+
+ /* Use the first buffer as the original text. */
+ for (idx_orig = 0; idx_orig < DB_COUNT; ++idx_orig)
+ if (diffbuf[idx_orig] != NULL)
+ break;
+ if (idx_orig == DB_COUNT)
+ return;
+
+ /* Only need to do something when there is another buffer. */
+ for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
+ if (diffbuf[idx_new] != NULL)
+ break;
+ if (idx_new == DB_COUNT)
+ return;
+
+ /* We need three temp file names. */
+ tmp_orig = vim_tempname('o');
+ tmp_new = vim_tempname('n');
+ tmp_diff = vim_tempname('d');
+ if (tmp_orig == NULL || tmp_new == NULL || tmp_diff == NULL)
+ goto theend;
+
+ /*
+ * Do a quick test if "diff" really works. Otherwise it looks like there
+ * are no differences. Can't use the return value, it's non-zero when
+ * there are differences.
+ * May try twice, first with "-a" and then without.
+ */
+ for (;;)
+ {
+ ok = FALSE;
+ fd = fopen((char *)tmp_orig, "w");
+ if (fd != NULL)
+ {
+ fwrite("line1\n", (size_t)6, (size_t)1, fd);
+ fclose(fd);
+ fd = fopen((char *)tmp_new, "w");
+ if (fd != NULL)
+ {
+ fwrite("line2\n", (size_t)6, (size_t)1, fd);
+ fclose(fd);
+ diff_file(tmp_orig, tmp_new, tmp_diff);
+ fd = fopen((char *)tmp_diff, "r");
+ if (fd != NULL)
+ {
+ char_u linebuf[LBUFLEN];
+
+ for (;;)
+ {
+ /* There must be a line that contains "1c1". */
+ if (tag_fgets(linebuf, LBUFLEN, fd))
+ break;
+ if (STRNCMP(linebuf, "1c1", 3) == 0)
+ ok = TRUE;
+ }
+ fclose(fd);
+ }
+ mch_remove(tmp_diff);
+ mch_remove(tmp_new);
+ }
+ mch_remove(tmp_orig);
+ }
+
+#ifdef FEAT_EVAL
+ /* When using 'diffexpr' break here. */
+ if (*p_dex != NUL)
+ break;
+#endif
+
+#if defined(MSWIN) || defined(MSDOS)
+ /* If the "-a" argument works, also check if "--binary" works. */
+ if (ok && diff_a_works == MAYBE && diff_bin_works == MAYBE)
+ {
+ diff_a_works = TRUE;
+ diff_bin_works = TRUE;
+ continue;
+ }
+ if (!ok && diff_a_works == TRUE && diff_bin_works == TRUE)
+ {
+ /* Tried --binary, but it failed. "-a" works though. */
+ diff_bin_works = FALSE;
+ ok = TRUE;
+ }
+#endif
+
+ /* If we checked if "-a" works already, break here. */
+ if (diff_a_works != MAYBE)
+ break;
+ diff_a_works = ok;
+
+ /* If "-a" works break here, otherwise retry without "-a". */
+ if (ok)
+ break;
+ }
+ if (!ok)
+ {
+ EMSG(_("E97: Cannot create diffs"));
+ diff_a_works = MAYBE;
+#if defined(MSWIN) || defined(MSDOS)
+ diff_bin_works = MAYBE;
+#endif
+ goto theend;
+ }
+
+ /* Write the first buffer to a tempfile. */
+ buf = diffbuf[idx_orig];
+ if (diff_write(buf, tmp_orig) == FAIL)
+ goto theend;
+
+ /* Make a difference between the first buffer and every other. */
+ for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
+ {
+ buf = diffbuf[idx_new];
+ if (buf == NULL)
+ continue;
+ if (diff_write(buf, tmp_new) == FAIL)
+ continue;
+ diff_file(tmp_orig, tmp_new, tmp_diff);
+
+ /* Read the diff output and add each entry to the diff list. */
+ diff_read(idx_orig, idx_new, tmp_diff);
+ mch_remove(tmp_diff);
+ mch_remove(tmp_new);
+ }
+ mch_remove(tmp_orig);
+
+ diff_redraw(TRUE);
+
+theend:
+ vim_free(tmp_orig);
+ vim_free(tmp_new);
+ vim_free(tmp_diff);
+}
+
+/*
+ * Make a diff between files "tmp_orig" and "tmp_new", results in "tmp_diff".
+ */
+ static void
+diff_file(tmp_orig, tmp_new, tmp_diff)
+ char_u *tmp_orig;
+ char_u *tmp_new;
+ char_u *tmp_diff;
+{
+ char_u *cmd;
+
+#ifdef FEAT_EVAL
+ if (*p_dex != NUL)
+ /* Use 'diffexpr' to generate the diff file. */
+ eval_diff(tmp_orig, tmp_new, tmp_diff);
+ else
+#endif
+ {
+ cmd = alloc((unsigned)(STRLEN(tmp_orig) + STRLEN(tmp_new)
+ + STRLEN(tmp_diff) + STRLEN(p_srr) + 27));
+ if (cmd != NULL)
+ {
+ /* Build the diff command and execute it. Always use -a, binary
+ * differences are of no use. Ignore errors, diff returns
+ * non-zero when differences have been found. */
+ sprintf((char *)cmd, "diff %s%s%s%s%s %s",
+ diff_a_works == FALSE ? "" : "-a ",
+#if defined(MSWIN) || defined(MSDOS)
+ diff_bin_works == TRUE ? "--binary " : "",
+#else
+ "",
+#endif
+ (diff_flags & DIFF_IWHITE) ? "-b " : "",
+ (diff_flags & DIFF_ICASE) ? "-i " : "",
+ tmp_orig, tmp_new);
+ append_redir(cmd, p_srr, tmp_diff);
+ (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT);
+ vim_free(cmd);
+ }
+ }
+}
+
+/*
+ * Create a new version of a file from the current buffer and a diff file.
+ * The buffer is written to a file, also for unmodified buffers (the file
+ * could have been produced by autocommands, e.g. the netrw plugin).
+ */
+ void
+ex_diffpatch(eap)
+ exarg_T *eap;
+{
+ char_u *tmp_orig; /* name of original temp file */
+ char_u *tmp_new; /* name of patched temp file */
+ char_u *buf = NULL;
+ win_T *old_curwin = curwin;
+ char_u *newname = NULL; /* name of patched file buffer */
+#ifdef UNIX
+ char_u dirbuf[MAXPATHL];
+ char_u *fullname = NULL;
+#endif
+#ifdef FEAT_BROWSE
+ char_u *browseFile = NULL;
+ int browse_flag = cmdmod.browse;
+#endif
+
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ browseFile = do_browse(FALSE, (char_u *)_("Patch file"),
+ eap->arg, NULL, NULL, BROWSE_FILTER_ALL_FILES, NULL);
+ if (browseFile == NULL)
+ return; /* operation cancelled */
+ eap->arg = browseFile;
+ cmdmod.browse = FALSE; /* don't let do_ecmd() browse again */
+ }
+#endif
+
+ /* We need two temp file names. */
+ tmp_orig = vim_tempname('o');
+ tmp_new = vim_tempname('n');
+ if (tmp_orig == NULL || tmp_new == NULL)
+ goto theend;
+
+ /* Write the current buffer to "tmp_orig". */
+ if (buf_write(curbuf, tmp_orig, NULL,
+ (linenr_T)1, curbuf->b_ml.ml_line_count,
+ NULL, FALSE, FALSE, FALSE, TRUE) == FAIL)
+ goto theend;
+
+#ifdef UNIX
+ /* Get the absolute path of the patchfile, changing directory below. */
+ fullname = FullName_save(eap->arg, FALSE);
+#endif
+ buf = alloc((unsigned)(STRLEN(tmp_orig) + (
+# ifdef UNIX
+ fullname != NULL ? STRLEN(fullname) :
+# endif
+ STRLEN(eap->arg)) + STRLEN(tmp_new) + 16));
+ if (buf == NULL)
+ goto theend;
+
+#ifdef UNIX
+ /* Temporaraly chdir to /tmp, to avoid patching files in the current
+ * directory when the patch file contains more than one patch. When we
+ * have our own temp dir use that instead, it will be cleaned up when we
+ * exit (any .rej files created). Don't change directory if we can't
+ * return to the current. */
+ if (mch_dirname(dirbuf, MAXPATHL) != OK || mch_chdir((char *)dirbuf) != 0)
+ dirbuf[0] = NUL;
+ else
+ {
+# ifdef TEMPDIRNAMES
+ if (vim_tempdir != NULL)
+ mch_chdir((char *)vim_tempdir);
+ else
+# endif
+ mch_chdir("/tmp");
+ shorten_fnames(TRUE);
+ }
+#endif
+
+#ifdef FEAT_EVAL
+ if (*p_pex != NUL)
+ /* Use 'patchexpr' to generate the new file. */
+ eval_patch(tmp_orig,
+# ifdef UNIX
+ fullname != NULL ? fullname :
+# endif
+ eap->arg, tmp_new);
+ else
+#endif
+ {
+ /* Build the patch command and execute it. Ignore errors. Switch to
+ * cooked mode to allow the user to respond to prompts. */
+ sprintf((char *)buf, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig,
+# ifdef UNIX
+ fullname != NULL ? fullname :
+# endif
+ eap->arg);
+ (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
+ }
+
+#ifdef UNIX
+ if (dirbuf[0] != NUL)
+ {
+ if (mch_chdir((char *)dirbuf) != 0)
+ EMSG(_(e_prev_dir));
+ shorten_fnames(TRUE);
+ }
+#endif
+
+ /* patch probably has written over the screen */
+ redraw_later(CLEAR);
+
+ /* Delete any .orig or .rej file created. */
+ STRCPY(buf, tmp_new);
+ STRCAT(buf, ".orig");
+ mch_remove(buf);
+ STRCPY(buf, tmp_new);
+ STRCAT(buf, ".rej");
+ mch_remove(buf);
+
+ if (curbuf->b_fname != NULL)
+ {
+ newname = vim_strnsave(curbuf->b_fname,
+ (int)(STRLEN(curbuf->b_fname) + 4));
+ if (newname != NULL)
+ STRCAT(newname, ".new");
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ if (win_split(0, 0) != FAIL)
+ {
+ /* Pretend it was a ":split fname" command */
+ eap->cmdidx = CMD_split;
+ eap->arg = tmp_new;
+ do_exedit(eap, old_curwin);
+
+ if (curwin != old_curwin) /* split must have worked */
+ {
+ /* Set 'diff', 'scrollbind' on and 'wrap' off. */
+ diff_win_options(curwin, TRUE);
+ diff_win_options(old_curwin, TRUE);
+
+ if (newname != NULL)
+ {
+ /* do a ":file filename.new" on the patched buffer */
+ eap->arg = newname;
+ ex_file(eap);
+
+#ifdef FEAT_AUTOCMD
+ /* Do filetype detection with the new name. */
+ do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
+#endif
+ }
+ }
+ }
+
+theend:
+ if (tmp_orig != NULL)
+ mch_remove(tmp_orig);
+ vim_free(tmp_orig);
+ if (tmp_new != NULL)
+ mch_remove(tmp_new);
+ vim_free(tmp_new);
+ vim_free(newname);
+ vim_free(buf);
+#ifdef UNIX
+ vim_free(fullname);
+#endif
+#ifdef FEAT_BROWSE
+ vim_free(browseFile);
+ cmdmod.browse = browse_flag;
+#endif
+}
+
+/*
+ * Split the window and edit another file, setting options to show the diffs.
+ */
+ void
+ex_diffsplit(eap)
+ exarg_T *eap;
+{
+ win_T *old_curwin = curwin;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ if (win_split(0, 0) != FAIL)
+ {
+ /* Pretend it was a ":split fname" command */
+ eap->cmdidx = CMD_split;
+ do_exedit(eap, old_curwin);
+
+ if (curwin != old_curwin) /* split must have worked */
+ {
+ /* Set 'diff', 'scrollbind' on and 'wrap' off. */
+ diff_win_options(curwin, TRUE);
+ diff_win_options(old_curwin, TRUE);
+ }
+ }
+}
+
+/*
+ * Set options to show difs for the current window.
+ */
+/*ARGSUSED*/
+ void
+ex_diffthis(eap)
+ exarg_T *eap;
+{
+ /* Set 'diff', 'scrollbind' on and 'wrap' off. */
+ diff_win_options(curwin, TRUE);
+}
+
+/*
+ * Set options in window "wp" for diff mode.
+ */
+ void
+diff_win_options(wp, addbuf)
+ win_T *wp;
+ int addbuf; /* Add buffer to diff. */
+{
+ wp->w_p_diff = TRUE;
+ wp->w_p_scb = TRUE;
+ wp->w_p_wrap = FALSE;
+# ifdef FEAT_FOLDING
+ {
+ win_T *old_curwin = curwin;
+
+ curwin = wp;
+ curbuf = curwin->w_buffer;
+ set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
+ OPT_LOCAL|OPT_FREE);
+ curwin = old_curwin;
+ curbuf = curwin->w_buffer;
+ wp->w_p_fdc = 2;
+ wp->w_p_fen = TRUE;
+ wp->w_p_fdl = 0;
+ foldUpdateAll(wp);
+ changed_window_setting(); /* make sure topline is not halfway a fold */
+ }
+# endif
+#ifdef FEAT_SCROLLBIND
+ if (vim_strchr(p_sbo, 'h') == NULL)
+ do_cmdline_cmd((char_u *)"set sbo+=hor");
+#endif
+
+ if (addbuf)
+ diff_buf_add(wp->w_buffer);
+ redraw_win_later(wp, NOT_VALID);
+}
+
+/*
+ * Read the diff output and add each entry to the diff list.
+ */
+ static void
+diff_read(idx_orig, idx_new, fname)
+ int idx_orig; /* idx of original file */
+ int idx_new; /* idx of new file */
+ char_u *fname; /* name of diff output file */
+{
+ FILE *fd;
+ diff_T *dprev = NULL;
+ diff_T *dp = first_diff;
+ diff_T *dn, *dpl;
+ long f1, l1, f2, l2;
+ char_u linebuf[LBUFLEN]; /* only need to hold the diff line */
+ int difftype;
+ char_u *p;
+ long off;
+ int i;
+ linenr_T lnum_orig, lnum_new;
+ long count_orig, count_new;
+ int notset = TRUE; /* block "*dp" not set yet */
+
+ fd = fopen((char *)fname, "r");
+ if (fd == NULL)
+ {
+ EMSG(_("E98: Cannot read diff output"));
+ return;
+ }
+
+ for (;;)
+ {
+ if (tag_fgets(linebuf, LBUFLEN, fd))
+ break; /* end of file */
+ if (!isdigit(*linebuf))
+ continue; /* not the start of a diff block */
+
+ /* This line must be one of three formats:
+ * {first}[,{last}]c{first}[,{last}]
+ * {first}a{first}[,{last}]
+ * {first}[,{last}]d{first}
+ */
+ p = linebuf;
+ f1 = getdigits(&p);
+ if (*p == ',')
+ {
+ ++p;
+ l1 = getdigits(&p);
+ }
+ else
+ l1 = f1;
+ if (*p != 'a' && *p != 'c' && *p != 'd')
+ continue; /* invalid diff format */
+ difftype = *p++;
+ f2 = getdigits(&p);
+ if (*p == ',')
+ {
+ ++p;
+ l2 = getdigits(&p);
+ }
+ else
+ l2 = f2;
+ if (l1 < f1 || l2 < f2)
+ continue; /* invalid line range */
+
+ if (difftype == 'a')
+ {
+ lnum_orig = f1 + 1;
+ count_orig = 0;
+ }
+ else
+ {
+ lnum_orig = f1;
+ count_orig = l1 - f1 + 1;
+ }
+ if (difftype == 'd')
+ {
+ lnum_new = f2 + 1;
+ count_new = 0;
+ }
+ else
+ {
+ lnum_new = f2;
+ count_new = l2 - f2 + 1;
+ }
+
+ /* Go over blocks before the change, for which orig and new are equal.
+ * Copy blocks from orig to new. */
+ while (dp != NULL
+ && lnum_orig > dp->df_lnum[idx_orig] + dp->df_count[idx_orig])
+ {
+ if (notset)
+ diff_copy_entry(dprev, dp, idx_orig, idx_new);
+ dprev = dp;
+ dp = dp->df_next;
+ notset = TRUE;
+ }
+
+ if (dp != NULL
+ && lnum_orig <= dp->df_lnum[idx_orig] + dp->df_count[idx_orig]
+ && lnum_orig + count_orig >= dp->df_lnum[idx_orig])
+ {
+ /* New block overlaps with existing block(s).
+ * First find last block that overlaps. */
+ for (dpl = dp; dpl->df_next != NULL; dpl = dpl->df_next)
+ if (lnum_orig + count_orig < dpl->df_next->df_lnum[idx_orig])
+ break;
+
+ /* If the newly found block starts before the old one, set the
+ * start back a number of lines. */
+ off = dp->df_lnum[idx_orig] - lnum_orig;
+ if (off > 0)
+ {
+ for (i = idx_orig; i < idx_new; ++i)
+ if (diffbuf[i] != NULL)
+ dp->df_lnum[i] -= off;
+ dp->df_lnum[idx_new] = lnum_new;
+ dp->df_count[idx_new] = count_new;
+ }
+ else if (notset)
+ {
+ /* new block inside existing one, adjust new block */
+ dp->df_lnum[idx_new] = lnum_new + off;
+ dp->df_count[idx_new] = count_new - off;
+ }
+ else
+ /* second overlap of new block with existing block */
+ dp->df_count[idx_new] += count_new - count_orig;
+
+ /* Adjust the size of the block to include all the lines to the
+ * end of the existing block or the new diff, whatever ends last. */
+ off = (lnum_orig + count_orig)
+ - (dpl->df_lnum[idx_orig] + dpl->df_count[idx_orig]);
+ if (off < 0)
+ {
+ /* new change ends in existing block, adjust the end if not
+ * done already */
+ if (notset)
+ dp->df_count[idx_new] += -off;
+ off = 0;
+ }
+ for (i = idx_orig; i < idx_new + !notset; ++i)
+ if (diffbuf[i] != NULL)
+ dp->df_count[i] = dpl->df_lnum[i] + dpl->df_count[i]
+ - dp->df_lnum[i] + off;
+
+ /* Delete the diff blocks that have been merged into one. */
+ dn = dp->df_next;
+ dp->df_next = dpl->df_next;
+ while (dn != dp->df_next)
+ {
+ dpl = dn->df_next;
+ vim_free(dn);
+ dn = dpl;
+ }
+ }
+ else
+ {
+ /* Allocate a new diffblock. */
+ dp = diff_alloc_new(dprev, dp);
+ if (dp == NULL)
+ return;
+
+ dp->df_lnum[idx_orig] = lnum_orig;
+ dp->df_count[idx_orig] = count_orig;
+ dp->df_lnum[idx_new] = lnum_new;
+ dp->df_count[idx_new] = count_new;
+
+ /* Set values for other buffers, these must be equal to the
+ * original buffer, otherwise there would have been a change
+ * already. */
+ for (i = idx_orig + 1; i < idx_new; ++i)
+ if (diffbuf[i] != NULL)
+ diff_copy_entry(dprev, dp, idx_orig, i);
+ }
+ notset = FALSE; /* "*dp" has been set */
+ }
+
+ /* for remaining diff blocks orig and new are equal */
+ while (dp != NULL)
+ {
+ if (notset)
+ diff_copy_entry(dprev, dp, idx_orig, idx_new);
+ dprev = dp;
+ dp = dp->df_next;
+ notset = TRUE;
+ }
+
+ fclose(fd);
+}
+
+/*
+ * Copy an entry at "dp" from "idx_orig" to "idx_new".
+ */
+ static void
+diff_copy_entry(dprev, dp, idx_orig, idx_new)
+ diff_T *dprev;
+ diff_T *dp;
+ int idx_orig;
+ int idx_new;
+{
+ long off;
+
+ if (dprev == NULL)
+ off = 0;
+ else
+ off = (dprev->df_lnum[idx_orig] + dprev->df_count[idx_orig])
+ - (dprev->df_lnum[idx_new] + dprev->df_count[idx_new]);
+ dp->df_lnum[idx_new] = dp->df_lnum[idx_orig] - off;
+ dp->df_count[idx_new] = dp->df_count[idx_orig];
+}
+
+/*
+ * Clear the list of diffblocks.
+ */
+ static void
+diff_clear()
+{
+ diff_T *p, *next_p;
+
+ for (p = first_diff; p != NULL; p = next_p)
+ {
+ next_p = p->df_next;
+ vim_free(p);
+ }
+ first_diff = NULL;
+}
+
+/*
+ * Check diff status for line "lnum" in buffer "buf":
+ * Returns 0 for nothing special
+ * Returns -1 for a line that should be highlighted as changed.
+ * Returns -2 for a line that should be highlighted as added/deleted.
+ * Returns > 0 for inserting that many filler lines above it (never happens
+ * when 'diffopt' doesn't contain "filler").
+ * This should only be used for windows where 'diff' is set.
+ */
+ int
+diff_check(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ int idx; /* index in diffbuf[] for this buffer */
+ diff_T *dp;
+ int maxcount;
+ int i;
+ buf_T *buf = wp->w_buffer;
+ int cmp;
+
+ if (diff_invalid)
+ ex_diffupdate(NULL); /* update after a big change */
+
+ if (first_diff == NULL || !wp->w_p_diff) /* no diffs at all */
+ return 0;
+
+ /* safety check: "lnum" must be a buffer line */
+ if (lnum < 1 || lnum > buf->b_ml.ml_line_count + 1)
+ return 0;
+
+ idx = diff_buf_idx(buf);
+ if (idx == DB_COUNT)
+ return 0; /* no diffs for buffer "buf" */
+
+#ifdef FEAT_FOLDING
+ /* A closed fold never has filler lines. */
+ if (hasFoldingWin(wp, lnum, NULL, NULL, TRUE, NULL))
+ return 0;
+#endif
+
+ /* search for a change that includes "lnum" in the list of diffblocks. */
+ for (dp = first_diff; dp != NULL; dp = dp->df_next)
+ if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
+ break;
+ if (dp == NULL || lnum < dp->df_lnum[idx])
+ return 0;
+
+ if (lnum < dp->df_lnum[idx] + dp->df_count[idx])
+ {
+ int zero = FALSE;
+
+ /* Changed or inserted line. If the other buffers have a count of
+ * zero, the lines were inserted. If the other buffers have the same
+ * count, check if the lines are identical. */
+ cmp = FALSE;
+ for (i = 0; i < DB_COUNT; ++i)
+ if (i != idx && diffbuf[i] != NULL)
+ {
+ if (dp->df_count[i] == 0)
+ zero = TRUE;
+ else
+ {
+ if (dp->df_count[i] != dp->df_count[idx])
+ return -1; /* nr of lines changed. */
+ cmp = TRUE;
+ }
+ }
+ if (cmp)
+ {
+ /* Compare all lines. If they are equal the lines were inserted
+ * in some buffers, deleted in others, but not changed. */
+ for (i = 0; i < DB_COUNT; ++i)
+ if (i != idx && diffbuf[i] != NULL && dp->df_count[i] != 0)
+ if (!diff_equal_entry(dp, idx, i))
+ return -1;
+ }
+ /* If there is no buffer with zero lines then there is no difference
+ * any longer. Happens when making a change (or undo) that removes
+ * the difference. Can't remove the entry here, we might be halfway
+ * updating the window. Just report the text as unchanged. Other
+ * windows might still show the change though. */
+ if (zero == FALSE)
+ return 0;
+ return -2;
+ }
+
+ /* If 'diffopt' doesn't contain "filler", return 0. */
+ if (!(diff_flags & DIFF_FILLER))
+ return 0;
+
+ /* Insert filler lines above the line just below the change. Will return
+ * 0 when this buf had the max count. */
+ maxcount = 0;
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && dp->df_count[i] > maxcount)
+ maxcount = dp->df_count[i];
+ return maxcount - dp->df_count[idx];
+}
+
+/*
+ * Compare two entries in diff "*dp" and return TRUE if they are equal.
+ */
+ static int
+diff_equal_entry(dp, idx1, idx2)
+ diff_T *dp;
+ int idx1;
+ int idx2;
+{
+ int i;
+ char_u *line;
+ int cmp;
+
+ if (dp->df_count[idx1] != dp->df_count[idx2])
+ return FALSE;
+ if (diff_check_sanity(dp) == FAIL)
+ return FALSE;
+ for (i = 0; i < dp->df_count[idx1]; ++i)
+ {
+ line = vim_strsave(ml_get_buf(diffbuf[idx1],
+ dp->df_lnum[idx1] + i, FALSE));
+ if (line == NULL)
+ return FALSE;
+ cmp = diff_cmp(line, ml_get_buf(diffbuf[idx2],
+ dp->df_lnum[idx2] + i, FALSE));
+ vim_free(line);
+ if (cmp != 0)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Compare strings "s1" and "s2" according to 'diffopt'.
+ * Return non-zero when they are different.
+ */
+ static int
+diff_cmp(s1, s2)
+ char_u *s1;
+ char_u *s2;
+{
+ char_u *p1, *p2;
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+ if ((diff_flags & (DIFF_ICASE | DIFF_IWHITE)) == 0)
+ return STRCMP(s1, s2);
+ if ((diff_flags & DIFF_ICASE) && !(diff_flags & DIFF_IWHITE))
+ return MB_STRICMP(s1, s2);
+
+ /* Ignore white space changes and possibly ignore case. */
+ p1 = s1;
+ p2 = s2;
+ while (*p1 != NUL && *p2 != NUL)
+ {
+ if (vim_iswhite(*p1) && vim_iswhite(*p2))
+ {
+ p1 = skipwhite(p1);
+ p2 = skipwhite(p2);
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ l = (*mb_ptr2len_check)(p1);
+ if (l != (*mb_ptr2len_check)(p2))
+ break;
+ if (l > 1)
+ {
+ if (STRNCMP(p1, p2, l) != 0
+ && (!enc_utf8
+ || !(diff_flags & DIFF_ICASE)
+ || utf_fold(utf_ptr2char(p1))
+ != utf_fold(utf_ptr2char(p2))))
+ break;
+ p1 += l;
+ p2 += l;
+ }
+ else
+#endif
+ {
+ if (*p1 != *p2 && (!(diff_flags & DIFF_ICASE)
+ || TOLOWER_LOC(*p1) != TOLOWER_LOC(*p2)))
+ break;
+ ++p1;
+ ++p2;
+ }
+ }
+ }
+
+ /* Ignore trailing white space. */
+ p1 = skipwhite(p1);
+ p2 = skipwhite(p2);
+ if (*p1 != NUL || *p2 != NUL)
+ return 1;
+ return 0;
+}
+
+/*
+ * Return the number of filler lines above "lnum".
+ */
+ int
+diff_check_fill(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ int n;
+
+ /* be quick when there are no filler lines */
+ if (!(diff_flags & DIFF_FILLER))
+ return 0;
+ n = diff_check(wp, lnum);
+ if (n <= 0)
+ return 0;
+ return n;
+}
+
+/*
+ * Set the topline of "towin" to match the position in "fromwin", so that they
+ * show the same diff'ed lines.
+ */
+ void
+diff_set_topline(fromwin, towin)
+ win_T *fromwin;
+ win_T *towin;
+{
+ buf_T *buf = fromwin->w_buffer;
+ linenr_T lnum = fromwin->w_topline;
+ int idx;
+ diff_T *dp;
+ int i;
+
+ idx = diff_buf_idx(buf);
+ if (idx == DB_COUNT)
+ return; /* safety check */
+
+ if (diff_invalid)
+ ex_diffupdate(NULL); /* update after a big change */
+
+ towin->w_topfill = 0;
+
+ /* search for a change that includes "lnum" in the list of diffblocks. */
+ for (dp = first_diff; dp != NULL; dp = dp->df_next)
+ if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
+ break;
+ if (dp == NULL)
+ {
+ /* After last change, compute topline relative to end of file; no
+ * filler lines. */
+ towin->w_topline = towin->w_buffer->b_ml.ml_line_count
+ - (buf->b_ml.ml_line_count - lnum);
+ }
+ else
+ {
+ /* Find index for "towin". */
+ i = diff_buf_idx(towin->w_buffer);
+ if (i == DB_COUNT)
+ return; /* safety check */
+
+ towin->w_topline = lnum + (dp->df_lnum[i] - dp->df_lnum[idx]);
+ if (lnum >= dp->df_lnum[idx])
+ {
+ /* Inside a change: compute filler lines. */
+ if (dp->df_count[i] == dp->df_count[idx])
+ towin->w_topfill = fromwin->w_topfill;
+ else if (dp->df_count[i] > dp->df_count[idx])
+ {
+ if (lnum == dp->df_lnum[idx] + dp->df_count[idx])
+ towin->w_topline = dp->df_lnum[i] + dp->df_count[i]
+ - fromwin->w_topfill;
+ }
+ else
+ {
+ if (towin->w_topline >= dp->df_lnum[i] + dp->df_count[i])
+ {
+ if (diff_flags & DIFF_FILLER)
+ towin->w_topfill = dp->df_lnum[idx]
+ + dp->df_count[idx] - lnum;
+ towin->w_topline = dp->df_lnum[i] + dp->df_count[i];
+ }
+ }
+ }
+ }
+
+ /* safety check (if diff info gets outdated strange things may happen) */
+ towin->w_botfill = FALSE;
+ if (towin->w_topline > towin->w_buffer->b_ml.ml_line_count)
+ {
+ towin->w_topline = towin->w_buffer->b_ml.ml_line_count;
+ towin->w_botfill = TRUE;
+ }
+ if (towin->w_topline < 1)
+ {
+ towin->w_topline = 1;
+ towin->w_topfill = 0;
+ }
+
+ /* When w_topline changes need to recompute w_botline and cursor position */
+ invalidate_botline_win(towin);
+ changed_line_abv_curs_win(towin);
+
+ check_topfill(towin, FALSE);
+#ifdef FEAT_FOLDING
+ (void)hasFoldingWin(towin, towin->w_topline, &towin->w_topline,
+ NULL, TRUE, NULL);
+#endif
+}
+
+/*
+ * This is called when 'diffopt' is changed.
+ */
+ int
+diffopt_changed()
+{
+ char_u *p;
+ int diff_context_new = 6;
+ int diff_flags_new = 0;
+
+ p = p_dip;
+ while (*p != NUL)
+ {
+ if (STRNCMP(p, "filler", 6) == 0)
+ {
+ p += 6;
+ diff_flags_new |= DIFF_FILLER;
+ }
+ else if (STRNCMP(p, "context:", 8) == 0 && VIM_ISDIGIT(p[8]))
+ {
+ p += 8;
+ diff_context_new = getdigits(&p);
+ }
+ else if (STRNCMP(p, "icase", 5) == 0)
+ {
+ p += 5;
+ diff_flags_new |= DIFF_ICASE;
+ }
+ else if (STRNCMP(p, "iwhite", 6) == 0)
+ {
+ p += 6;
+ diff_flags_new |= DIFF_IWHITE;
+ }
+ if (*p != ',' && *p != NUL)
+ return FAIL;
+ if (*p == ',')
+ ++p;
+ }
+
+ /* If "icase" or "iwhite" was added or removed, need to update the diff. */
+ if (diff_flags != diff_flags_new)
+ diff_invalid = TRUE;
+
+ diff_flags = diff_flags_new;
+ diff_context = diff_context_new;
+
+ diff_redraw(TRUE);
+
+ /* recompute the scroll binding with the new option value, may
+ * remove or add filler lines */
+ check_scrollbind((linenr_T)0, 0L);
+
+ return OK;
+}
+
+/*
+ * Find the difference within a changed line.
+ * Returns TRUE if the line was added, no other buffer has it.
+ */
+ int
+diff_find_change(wp, lnum, startp, endp)
+ win_T *wp;
+ linenr_T lnum;
+ int *startp; /* first char of the change */
+ int *endp; /* last char of the change */
+{
+ char_u *line_org;
+ char_u *line_new;
+ int i;
+ int si, ei_org, ei_new;
+ diff_T *dp;
+ int idx;
+ int off;
+ int added = TRUE;
+
+ /* Make a copy of the line, the next ml_get() will invalidate it. */
+ line_org = vim_strsave(ml_get_buf(wp->w_buffer, lnum, FALSE));
+ if (line_org == NULL)
+ return FALSE;
+
+ idx = diff_buf_idx(wp->w_buffer);
+ if (idx == DB_COUNT) /* cannot happen */
+ return FALSE;
+
+ /* search for a change that includes "lnum" in the list of diffblocks. */
+ for (dp = first_diff; dp != NULL; dp = dp->df_next)
+ if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
+ break;
+ if (dp == NULL || diff_check_sanity(dp) == FAIL)
+ return FALSE;
+
+ off = lnum - dp->df_lnum[idx];
+
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && i != idx)
+ {
+ /* Skip lines that are not in the other change (filler lines). */
+ if (off >= dp->df_count[i])
+ continue;
+ added = FALSE;
+ line_new = ml_get_buf(diffbuf[i], dp->df_lnum[i] + off, FALSE);
+
+ /* Search for start of difference */
+ for (si = 0; line_org[si] != NUL && line_org[si] == line_new[si]; )
+ ++si;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Move back to first byte of character in both lines (may
+ * have "nn^" in line_org and "n^ in line_new). */
+ si -= (*mb_head_off)(line_org, line_org + si);
+ si -= (*mb_head_off)(line_new, line_new + si);
+ }
+#endif
+ if (*startp > si)
+ *startp = si;
+
+ /* Search for end of difference, if any. */
+ if (line_org[si] != NUL || line_new[si] != NUL)
+ {
+ ei_org = (int)STRLEN(line_org);
+ ei_new = (int)STRLEN(line_new);
+ while (ei_org >= *startp && ei_new >= *startp
+ && ei_org >= 0 && ei_new >= 0
+ && line_org[ei_org] == line_new[ei_new])
+ {
+ --ei_org;
+ --ei_new;
+ }
+ if (*endp < ei_org)
+ *endp = ei_org;
+ }
+ }
+
+ vim_free(line_org);
+ return added;
+}
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+/*
+ * Return TRUE if line "lnum" is not close to a diff block, this line should
+ * be in a fold.
+ * Return FALSE if there are no diff blocks at all in this window.
+ */
+ int
+diff_infold(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ int i;
+ int idx = -1;
+ int other = FALSE;
+ diff_T *dp;
+
+ /* Return if 'diff' isn't set. */
+ if (!wp->w_p_diff)
+ return FALSE;
+
+ for (i = 0; i < DB_COUNT; ++i)
+ {
+ if (diffbuf[i] == wp->w_buffer)
+ idx = i;
+ else if (diffbuf[i] != NULL)
+ other = TRUE;
+ }
+
+ /* return here if there are no diffs in the window */
+ if (idx == -1 || !other)
+ return FALSE;
+
+ if (diff_invalid)
+ ex_diffupdate(NULL); /* update after a big change */
+
+ /* Return if there are no diff blocks. All lines will be folded. */
+ if (first_diff == NULL)
+ return TRUE;
+
+ for (dp = first_diff; dp != NULL; dp = dp->df_next)
+ {
+ /* If this change is below the line there can't be any further match. */
+ if (dp->df_lnum[idx] - diff_context > lnum)
+ break;
+ /* If this change ends before the line we have a match. */
+ if (dp->df_lnum[idx] + dp->df_count[idx] + diff_context > lnum)
+ return FALSE;
+ }
+ return TRUE;
+}
+#endif
+
+/*
+ * "dp" and "do" commands.
+ */
+ void
+nv_diffgetput(put)
+ int put;
+{
+ exarg_T ea;
+
+ ea.arg = (char_u *)"";
+ if (put)
+ ea.cmdidx = CMD_diffput;
+ else
+ ea.cmdidx = CMD_diffget;
+ ea.addr_count = 0;
+ ea.line1 = curwin->w_cursor.lnum;
+ ea.line2 = curwin->w_cursor.lnum;
+ ex_diffgetput(&ea);
+}
+
+/*
+ * ":diffget"
+ * ":diffput"
+ */
+ void
+ex_diffgetput(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+ int count;
+ linenr_T off = 0;
+ diff_T *dp;
+ diff_T *dprev;
+ diff_T *dfree;
+ int idx_cur;
+ int idx_other;
+ int idx_from;
+ int idx_to;
+ int i;
+ int added;
+ char_u *p;
+ aco_save_T aco;
+ buf_T *buf;
+ int start_skip, end_skip;
+ int new_count;
+
+ /* Find the current buffer in the list of diff buffers. */
+ idx_cur = diff_buf_idx(curbuf);
+ if (idx_cur == DB_COUNT)
+ {
+ EMSG(_("E99: Current buffer is not in diff mode"));
+ return;
+ }
+
+ if (*eap->arg == NUL)
+ {
+ /* No argument: Find the other buffer in the list of diff buffers. */
+ for (idx_other = 0; idx_other < DB_COUNT; ++idx_other)
+ if (diffbuf[idx_other] != curbuf && diffbuf[idx_other] != NULL)
+ break;
+ if (idx_other == DB_COUNT)
+ {
+ EMSG(_("E100: No other buffer in diff mode"));
+ return;
+ }
+
+ /* Check that there isn't a third buffer in the list */
+ for (i = idx_other + 1; i < DB_COUNT; ++i)
+ if (diffbuf[i] != curbuf && diffbuf[i] != NULL)
+ {
+ EMSG(_("E101: More than two buffers in diff mode, don't know which one to use"));
+ return;
+ }
+ }
+ else
+ {
+ /* Buffer number or pattern given. Ignore trailing white space. */
+ p = eap->arg + STRLEN(eap->arg);
+ while (p > eap->arg && vim_iswhite(p[-1]))
+ --p;
+ for (i = 0; vim_isdigit(eap->arg[i]) && eap->arg + i < p; ++i)
+ ;
+ if (eap->arg + i == p) /* digits only */
+ i = atol((char *)eap->arg);
+ else
+ {
+ i = buflist_findpat(eap->arg, p, FALSE, TRUE);
+ if (i < 0)
+ return; /* error message already given */
+ }
+ buf = buflist_findnr(i);
+ if (buf == NULL)
+ {
+ EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg);
+ return;
+ }
+ idx_other = diff_buf_idx(buf);
+ if (idx_other == DB_COUNT)
+ {
+ EMSG2(_("E103: Buffer \"%s\" is not in diff mode"), eap->arg);
+ return;
+ }
+ }
+
+ diff_busy = TRUE;
+
+ /* When no range given include the line above or below the cursor. */
+ if (eap->addr_count == 0)
+ {
+ /* Make it possible that ":diffget" on the last line gets line below
+ * the cursor line when there is no difference above the cursor. */
+ if (eap->cmdidx == CMD_diffget
+ && eap->line1 == curbuf->b_ml.ml_line_count
+ && diff_check(curwin, eap->line1) == 0
+ && (eap->line1 == 1 || diff_check(curwin, eap->line1 - 1) == 0))
+ ++eap->line2;
+ else if (eap->line1 > 0)
+ --eap->line1;
+ }
+
+ if (eap->cmdidx == CMD_diffget)
+ {
+ idx_from = idx_other;
+ idx_to = idx_cur;
+ }
+ else
+ {
+ idx_from = idx_cur;
+ idx_to = idx_other;
+ /* Need to make the other buffer the current buffer to be able to make
+ * changes in it. */
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, diffbuf[idx_other]);
+ }
+
+ dprev = NULL;
+ for (dp = first_diff; dp != NULL; )
+ {
+ if (dp->df_lnum[idx_cur] > eap->line2 + off)
+ break; /* past the range that was specified */
+
+ dfree = NULL;
+ lnum = dp->df_lnum[idx_to];
+ count = dp->df_count[idx_to];
+ if (dp->df_lnum[idx_cur] + dp->df_count[idx_cur] > eap->line1 + off
+ && u_save(lnum - 1, lnum + count) != FAIL)
+ {
+ /* Inside the specified range and saving for undo worked. */
+ start_skip = 0;
+ end_skip = 0;
+ if (eap->addr_count > 0)
+ {
+ /* A range was specified: check if lines need to be skipped. */
+ start_skip = eap->line1 + off - dp->df_lnum[idx_cur];
+ if (start_skip > 0)
+ {
+ /* range starts below start of current diff block */
+ if (start_skip > count)
+ {
+ lnum += count;
+ count = 0;
+ }
+ else
+ {
+ count -= start_skip;
+ lnum += start_skip;
+ }
+ }
+ else
+ start_skip = 0;
+
+ end_skip = dp->df_lnum[idx_cur] + dp->df_count[idx_cur] - 1
+ - (eap->line2 + off);
+ if (end_skip > 0)
+ {
+ /* range ends above end of current/from diff block */
+ if (idx_cur == idx_from) /* :diffput */
+ {
+ i = dp->df_count[idx_cur] - start_skip - end_skip;
+ if (count > i)
+ count = i;
+ }
+ else /* :diffget */
+ {
+ count -= end_skip;
+ end_skip = dp->df_count[idx_from] - start_skip - count;
+ if (end_skip < 0)
+ end_skip = 0;
+ }
+ }
+ else
+ end_skip = 0;
+ }
+
+ added = 0;
+ for (i = 0; i < count; ++i)
+ {
+ ml_delete(lnum, FALSE);
+ --added;
+ }
+ for (i = 0; i < dp->df_count[idx_from] - start_skip - end_skip; ++i)
+ {
+ linenr_T nr;
+
+ nr = dp->df_lnum[idx_from] + start_skip + i;
+ if (nr > diffbuf[idx_from]->b_ml.ml_line_count)
+ break;
+ p = vim_strsave(ml_get_buf(diffbuf[idx_from], nr, FALSE));
+ if (p != NULL)
+ {
+ ml_append(lnum + i - 1, p, 0, FALSE);
+ vim_free(p);
+ ++added;
+ }
+ }
+ new_count = dp->df_count[idx_to] + added;
+ dp->df_count[idx_to] = new_count;
+
+ if (start_skip == 0 && end_skip == 0)
+ {
+ /* Check if there are any other buffers and if the diff is
+ * equal in them. */
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] != NULL && i != idx_from && i != idx_to
+ && !diff_equal_entry(dp, idx_from, i))
+ break;
+ if (i == DB_COUNT)
+ {
+ /* delete the diff entry, the buffers are now equal here */
+ dfree = dp;
+ dp = dp->df_next;
+ if (dprev == NULL)
+ first_diff = dp;
+ else
+ dprev->df_next = dp;
+ }
+ }
+
+ /* Adjust marks. This will change the following entries! */
+ if (added != 0)
+ {
+ mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added);
+ if (curwin->w_cursor.lnum >= lnum)
+ {
+ /* Adjust the cursor position if it's in/after the changed
+ * lines. */
+ if (curwin->w_cursor.lnum >= lnum + count)
+ curwin->w_cursor.lnum += added;
+ else if (added < 0)
+ curwin->w_cursor.lnum = lnum;
+ }
+ }
+ changed_lines(lnum, 0, lnum + count, (long)added);
+
+ if (dfree != NULL)
+ {
+ /* Diff is deleted, update folds in other windows. */
+#ifdef FEAT_FOLDING
+ diff_fold_update(dfree, idx_to);
+#endif
+ vim_free(dfree);
+ }
+ else
+ /* mark_adjust() may have changed the count in a wrong way */
+ dp->df_count[idx_to] = new_count;
+
+ /* When changing the current buffer, keep track of line numbers */
+ if (idx_cur == idx_to)
+ off += added;
+ }
+
+ /* If before the range or not deleted, go to next diff. */
+ if (dfree == NULL)
+ {
+ dprev = dp;
+ dp = dp->df_next;
+ }
+ }
+
+ /* restore curwin/curbuf and a few other things */
+ if (idx_other == idx_to)
+ {
+ /* Syncing undo only works for the current buffer, but we change
+ * another buffer. Sync undo if the command was typed. This isn't
+ * 100% right when ":diffput" is used in a function or mapping. */
+ if (KeyTyped)
+ u_sync();
+ aucmd_restbuf(&aco);
+ }
+
+ diff_busy = FALSE;
+
+ /* Check that the cursor is on a valid character and update it's position.
+ * When there were filler lines the topline has become invalid. */
+ check_cursor();
+ changed_line_abv_curs();
+
+ /* Also need to redraw the other buffers. */
+ diff_redraw(FALSE);
+}
+
+#ifdef FEAT_FOLDING
+/*
+ * Update folds for all diff buffers for entry "dp".
+ * Skip buffer with index "skip_idx".
+ * When there are no diffs, all folds are removed.
+ */
+ static void
+diff_fold_update(dp, skip_idx)
+ diff_T *dp;
+ int skip_idx;
+{
+ int i;
+ win_T *wp;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ for (i = 0; i < DB_COUNT; ++i)
+ if (diffbuf[i] == wp->w_buffer && i != skip_idx)
+ foldUpdate(wp, dp->df_lnum[i],
+ dp->df_lnum[i] + dp->df_count[i]);
+}
+#endif
+
+/*
+ * Return TRUE if buffer "buf" is in diff-mode.
+ */
+ int
+diff_mode_buf(buf)
+ buf_T *buf;
+{
+ return diff_buf_idx(buf) != DB_COUNT;
+}
+
+/*
+ * Move "count" times in direction "dir" to the next diff block.
+ * Return FAIL if there isn't such a diff block.
+ */
+ int
+diff_move_to(dir, count)
+ int dir;
+ long count;
+{
+ int idx;
+ linenr_T lnum = curwin->w_cursor.lnum;
+ diff_T *dp;
+
+ idx = diff_buf_idx(curbuf);
+ if (idx == DB_COUNT || first_diff == NULL)
+ return FAIL;
+
+ if (diff_invalid)
+ ex_diffupdate(NULL); /* update after a big change */
+
+ if (first_diff == NULL) /* no diffs today */
+ return FAIL;
+
+ while (--count >= 0)
+ {
+ /* Check if already before first diff. */
+ if (dir == BACKWARD && lnum <= first_diff->df_lnum[idx])
+ break;
+
+ for (dp = first_diff; ; dp = dp->df_next)
+ {
+ if (dp == NULL)
+ break;
+ if ((dir == FORWARD && lnum < dp->df_lnum[idx])
+ || (dir == BACKWARD
+ && (dp->df_next == NULL
+ || lnum <= dp->df_next->df_lnum[idx])))
+ {
+ lnum = dp->df_lnum[idx];
+ break;
+ }
+ }
+ }
+
+ /* don't end up past the end of the file */
+ if (lnum > curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count;
+
+ /* When the cursor didn't move at all we fail. */
+ if (lnum == curwin->w_cursor.lnum)
+ return FAIL;
+
+ setpcmark();
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = 0;
+
+ return OK;
+}
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+/*
+ * For line "lnum" in the current window find the equivalent lnum in window
+ * "wp", compensating for inserted/deleted lines.
+ */
+ linenr_T
+diff_lnum_win(lnum, wp)
+ linenr_T lnum;
+ win_T *wp;
+{
+ diff_T *dp;
+ int idx;
+ int i;
+ linenr_T n;
+
+ idx = diff_buf_idx(curbuf);
+ if (idx == DB_COUNT) /* safety check */
+ return (linenr_T)0;
+
+ if (diff_invalid)
+ ex_diffupdate(NULL); /* update after a big change */
+
+ /* search for a change that includes "lnum" in the list of diffblocks. */
+ for (dp = first_diff; dp != NULL; dp = dp->df_next)
+ if (lnum <= dp->df_lnum[idx] + dp->df_count[idx])
+ break;
+
+ /* When after the last change, compute relative to the last line number. */
+ if (dp == NULL)
+ return wp->w_buffer->b_ml.ml_line_count
+ - (curbuf->b_ml.ml_line_count - lnum);
+
+ /* Find index for "wp". */
+ i = diff_buf_idx(wp->w_buffer);
+ if (i == DB_COUNT) /* safety check */
+ return (linenr_T)0;
+
+ n = lnum + (dp->df_lnum[i] - dp->df_lnum[idx]);
+ if (n > dp->df_lnum[i] + dp->df_count[i])
+ n = dp->df_lnum[i] + dp->df_count[i];
+ return n;
+}
+#endif
+
+#endif /* FEAT_DIFF */
diff --git a/src/digraph.c b/src/digraph.c
new file mode 100644
index 000000000..de61ce2c7
--- /dev/null
+++ b/src/digraph.c
@@ -0,0 +1,2513 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * digraph.c: code for digraphs
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_DIGRAPHS) || defined(PROTO)
+
+#ifdef FEAT_MBYTE
+typedef int result_T;
+#else
+typedef char_u result_T;
+#endif
+
+typedef struct digraph
+{
+ char_u char1;
+ char_u char2;
+ result_T result;
+} digr_T;
+
+static int getexactdigraph __ARGS((int, int, int));
+static void printdigraph __ARGS((digr_T *));
+
+/* digraphs added by the user */
+static garray_T user_digraphs = {0, 0, sizeof(digr_T), 10, NULL};
+
+/*
+ * Note: Characters marked with XX are not included literally, because some
+ * compilers cannot handle them (Amiga SAS/C is the most picky one).
+ */
+#if defined(MSDOS) || defined(OS2)
+ /*
+ * MSDOS digraphs.
+ */
+digr_T digraphdefault[] =
+ {{'C', ',', 128}, /* ~@ XX */
+ {'u', '"', 129}, /* */
+ {'e', '\'', 130}, /* ‚ */
+ {'a', '^', 131}, /* ƒ */
+ {'a', '"', 132}, /* „ */
+ {'a', '`', 133}, /* … */
+ {'a', '@', 134}, /* † */
+ {'c', ',', 135}, /* ~G XX */
+ {'e', '^', 136}, /* ~H XX */
+ {'e', '"', 137}, /* ‰ */
+ {'e', '`', 138}, /* Š */
+ {'i', '"', 139}, /* ‹ */
+ {'i', '^', 140}, /* Œ */
+ {'i', '`', 141}, /* */
+ {'A', '"', 142}, /* ~N XX */
+ {'A', '@', 143}, /* */
+ {'E', '\'', 144}, /* */
+ {'a', 'e', 145}, /* ‘ */
+ {'A', 'E', 146}, /* ’ */
+ {'o', '^', 147}, /* “ */
+ {'o', '"', 148}, /* ” */
+ {'o', '`', 149}, /* • */
+ {'u', '^', 150}, /* – */
+ {'u', '`', 151}, /* — */
+ {'y', '"', 152}, /* ˜ */
+ {'O', '"', 153}, /* ™ */
+ {'U', '"', 154}, /* š */
+ {'c', '|', 155}, /* › */
+ {'$', '$', 156}, /* œ */
+ {'Y', '-', 157}, /* ~] XX */
+ {'P', 't', 158}, /* ž */
+ {'f', 'f', 159}, /* Ÿ */
+ {'a', '\'', 160}, /*   */
+ {'i', '\'', 161}, /* ¡ */
+ {'o', '\'', 162}, /* ¢ */
+ {'u', '\'', 163}, /* x XX */
+ {'n', '~', 164}, /* ¤ */
+ {'N', '~', 165}, /* ¥ */
+ {'a', 'a', 166}, /* ¦ */
+ {'o', 'o', 167}, /* § */
+ {'~', '?', 168}, /* ¨ */
+ {'-', 'a', 169}, /* © */
+ {'a', '-', 170}, /* ª */
+ {'1', '2', 171}, /* « */
+ {'1', '4', 172}, /* ¬ */
+ {'~', '!', 173}, /* ­ */
+ {'<', '<', 174}, /* ® */
+ {'>', '>', 175}, /* ¯ */
+
+ {'s', 's', 225}, /* á */
+ {'j', 'u', 230}, /* æ */
+ {'o', '/', 237}, /* í */
+ {'+', '-', 241}, /* ñ */
+ {'>', '=', 242}, /* ò */
+ {'<', '=', 243}, /* ó */
+ {':', '-', 246}, /* ö */
+ {'~', '~', 247}, /* ÷ */
+ {'~', 'o', 248}, /* ø */
+ {'2', '2', 253}, /* ý */
+ {NUL, NUL, NUL}
+ };
+
+#else /* !MSDOS && !OS2 */
+# ifdef __MINT__
+
+ /*
+ * ATARI digraphs
+ */
+digr_T digraphdefault[] =
+ {{'C', ',', 128}, /* ~@ XX */
+ {'u', '"', 129}, /* */
+ {'e', '\'', 130}, /* ‚ */
+ {'a', '^', 131}, /* ƒ */
+ {'a', '"', 132}, /* „ */
+ {'a', '`', 133}, /* … */
+ {'a', '@', 134}, /* † */
+ {'c', ',', 135}, /* ~G XX */
+ {'e', '^', 136}, /* ~H XX */
+ {'e', '"', 137}, /* ‰ */
+ {'e', '`', 138}, /* Š */
+ {'i', '"', 139}, /* ‹ */
+ {'i', '^', 140}, /* Œ */
+ {'i', '`', 141}, /* */
+ {'A', '"', 142}, /* Ž */
+ {'A', '@', 143}, /* */
+ {'E', '\'', 144}, /* */
+ {'a', 'e', 145}, /* ‘ */
+ {'A', 'E', 146}, /* ’ */
+ {'o', '^', 147}, /* “ */
+ {'o', '"', 148}, /* ” */
+ {'o', '`', 149}, /* • */
+ {'u', '^', 150}, /* – */
+ {'u', '`', 151}, /* — */
+ {'y', '"', 152}, /* ˜ */
+ {'O', '"', 153}, /* ™ */
+ {'U', '"', 154}, /* š */
+ {'c', '|', 155}, /* › */
+ {'$', '$', 156}, /* œ */
+ {'Y', '-', 157}, /* ~] XX */
+ {'s', 's', 158}, /* ž */
+ {'f', 'f', 159}, /* Ÿ */
+ {'a', '\'', 160}, /*   */
+ {'i', '\'', 161}, /* ¡ */
+ {'o', '\'', 162}, /* ¢ */
+ {'u', '\'', 163}, /* £ */
+ {'n', '~', 164}, /* ¤ */
+ {'N', '~', 165}, /* ¥ */
+ {'a', 'a', 166}, /* ¦ */
+ {'o', 'o', 167}, /* § */
+ {'~', '?', 168}, /* ¨ */
+ {'-', 'a', 169}, /* © */
+ {'a', '-', 170}, /* ª */
+ {'1', '2', 171}, /* « */
+ {'1', '4', 172}, /* ¬ */
+ {'~', '!', 173}, /* ­ */
+ {'<', '<', 174}, /* ® */
+ {'>', '>', 175}, /* ¯ */
+ {'j', 'u', 230}, /* æ */
+ {'o', '/', 237}, /* í */
+ {'+', '-', 241}, /* ñ */
+ {'>', '=', 242}, /* ò */
+ {'<', '=', 243}, /* ó */
+ {':', '-', 246}, /* ö */
+ {'~', '~', 247}, /* ÷ */
+ {'~', 'o', 248}, /* ø */
+ {'2', '2', 253}, /* ý */
+ {NUL, NUL, NUL}
+ };
+
+# else /* !__MINT__ */
+# ifdef HPUX_DIGRAPHS
+
+ /*
+ * different HPUX digraphs
+ */
+digr_T digraphdefault[] =
+ {{'A', '`', 161}, /* ¡ */
+ {'A', '^', 162}, /* ¢ */
+ {'E', '`', 163}, /* £ */
+ {'E', '^', 164}, /* ¤ */
+ {'E', '"', 165}, /* ¥ */
+ {'I', '^', 166}, /* ¦ */
+ {'I', '"', 167}, /* § */
+ {'\'', '\'', 168}, /* ¨ */
+ {'`', '`', 169}, /* © */
+ {'^', '^', 170}, /* ª */
+ {'"', '"', 171}, /* « */
+ {'~', '~', 172}, /* ¬ */
+ {'U', '`', 173}, /* ­ */
+ {'U', '^', 174}, /* ® */
+ {'L', '=', 175}, /* ¯ */
+ {'~', '_', 176}, /* ° */
+ {'Y', '\'', 177}, /* ± */
+ {'y', '\'', 178}, /* ² */
+ {'~', 'o', 179}, /* ³ */
+ {'C', ',', 180}, /* ´ */
+ {'c', ',', 181}, /* µ */
+ {'N', '~', 182}, /* ¶ */
+ {'n', '~', 183}, /* · */
+ {'~', '!', 184}, /* ¸ */
+ {'~', '?', 185}, /* ¹ */
+ {'o', 'x', 186}, /* º */
+ {'L', '-', 187}, /* » */
+ {'Y', '=', 188}, /* ¼ */
+ {'p', 'p', 189}, /* ½ */
+ {'f', 'l', 190}, /* ¾ */
+ {'c', '|', 191}, /* ¿ */
+ {'a', '^', 192}, /* À */
+ {'e', '^', 193}, /* Á */
+ {'o', '^', 194}, /* Â */
+ {'u', '^', 195}, /* Ã */
+ {'a', '\'', 196}, /* Ä */
+ {'e', '\'', 197}, /* Å */
+ {'o', '\'', 198}, /* Æ */
+ {'u', '\'', 199}, /* Ç */
+ {'a', '`', 200}, /* È */
+ {'e', '`', 201}, /* É */
+ {'o', '`', 202}, /* Ê */
+ {'u', '`', 203}, /* Ë */
+ {'a', '"', 204}, /* Ì */
+ {'e', '"', 205}, /* Í */
+ {'o', '"', 206}, /* Î */
+ {'u', '"', 207}, /* Ï */
+ {'A', 'o', 208}, /* Ð */
+ {'i', '^', 209}, /* Ñ */
+ {'O', '/', 210}, /* Ò */
+ {'A', 'E', 211}, /* Ó */
+ {'a', 'o', 212}, /* Ô */
+ {'i', '\'', 213}, /* Õ */
+ {'o', '/', 214}, /* Ö */
+ {'a', 'e', 215}, /* × */
+ {'A', '"', 216}, /* Ø */
+ {'i', '`', 217}, /* Ù */
+ {'O', '"', 218}, /* Ú */
+ {'U', '"', 219}, /* Û */
+ {'E', '\'', 220}, /* Ü */
+ {'i', '"', 221}, /* Ý */
+ {'s', 's', 222}, /* Þ */
+ {'O', '^', 223}, /* ß */
+ {'A', '\'', 224}, /* à */
+ {'A', '~', 225}, /* á */
+ {'a', '~', 226}, /* â */
+ {'D', '-', 227}, /* ã */
+ {'d', '-', 228}, /* ä */
+ {'I', '\'', 229}, /* å */
+ {'I', '`', 230}, /* æ */
+ {'O', '\'', 231}, /* ç */
+ {'O', '`', 232}, /* è */
+ {'O', '~', 233}, /* é */
+ {'o', '~', 234}, /* ê */
+ {'S', '~', 235}, /* ë */
+ {'s', '~', 236}, /* ì */
+ {'U', '\'', 237}, /* í */
+ {'Y', '"', 238}, /* î */
+ {'y', '"', 239}, /* ï */
+ {'p', '-', 240}, /* ð */
+ {'p', '~', 241}, /* ñ */
+ {'~', '.', 242}, /* ò */
+ {'j', 'u', 243}, /* ó */
+ {'P', 'p', 244}, /* ô */
+ {'3', '4', 245}, /* õ */
+ {'-', '-', 246}, /* ö */
+ {'1', '4', 247}, /* ÷ */
+ {'1', '2', 248}, /* ø */
+ {'a', '_', 249}, /* ù */
+ {'o', '_', 250}, /* ú */
+ {'<', '<', 251}, /* û */
+ {'x', 'x', 252}, /* ü */
+ {'>', '>', 253}, /* ý */
+ {'+', '-', 254}, /* þ */
+ {'n', 'u', 255}, /* x XX */
+ {NUL, NUL, NUL}
+ };
+
+# else /* !HPUX_DIGRAPHS */
+
+# ifdef EBCDIC
+
+ /*
+ * EBCDIC - ISO digraphs
+ * TODO: EBCDIC Table is Code-Page 1047
+ */
+digr_T digraphdefault[] =
+ {{'a', '^', 66}, /* â */
+ {'a', '"', 67}, /* ä */
+ {'a', '`', 68}, /* à */
+ {'a', '\'', 69}, /* á */
+ {'a', '~', 70}, /* ã */
+ {'a', '@', 71}, /* å */
+ {'a', 'a', 71}, /* å */
+ {'c', ',', 72}, /* ç */
+ {'n', '~', 73}, /* ñ */
+ {'c', '|', 74}, /* ¢ */
+ {'e', '\'', 81}, /* é */
+ {'e', '^', 82}, /* ê */
+ {'e', '"', 83}, /* ë */
+ {'e', '`', 84}, /* è */
+ {'i', '\'', 85}, /* í */
+ {'i', '^', 86}, /* î */
+ {'i', '"', 87}, /* ï */
+ {'i', '`', 88}, /* ì */
+ {'s', 's', 89}, /* ß */
+ {'A', '^', 98}, /* Â */
+ {'A', '"', 99}, /* Ä */
+ {'A', '`', 100}, /* À */
+ {'A', '\'', 101}, /* Á */
+ {'A', '~', 102}, /* Ã */
+ {'A', '@', 103}, /* Å */
+ {'A', 'A', 103}, /* Å */
+ {'C', ',', 104}, /* Ç */
+ {'N', '~', 105}, /* Ñ */
+ {'|', '|', 106}, /* ¦ */
+ {'o', '/', 112}, /* ø */
+ {'E', '\'', 113}, /* É */
+ {'E', '^', 114}, /* Ê */
+ {'E', '"', 115}, /* Ë */
+ {'E', '`', 116}, /* È */
+ {'I', '\'', 117}, /* Í */
+ {'I', '^', 118}, /* Î */
+ {'I', '"', 119}, /* Ï */
+ {'I', '`', 120}, /* Ì */
+ {'O', '/', 128}, /* 0/ XX */
+ {'<', '<', 138}, /* « */
+ {'>', '>', 139}, /* » */
+ {'d', '-', 140}, /* ð */
+ {'y', '\'', 141}, /* ý */
+ {'i', 'p', 142}, /* þ */
+ {'+', '-', 143}, /* ± */
+ {'~', 'o', 144}, /* ° */
+ {'a', '-', 154}, /* ª */
+ {'o', '-', 155}, /* º */
+ {'a', 'e', 156}, /* æ */
+ {',', ',', 157}, /* , XX */
+ {'A', 'E', 158}, /* Æ */
+ {'o', 'x', 159}, /* ¤ - currency symbol in ISO 8859-1 */
+ {'e', '=', 159}, /* ¤ - euro symbol in ISO 8859-15 */
+ {'j', 'u', 160}, /* µ */
+ {'y', '"', 167}, /* x XX */
+ {'~', '!', 170}, /* ¡ */
+ {'~', '?', 171}, /* ¿ */
+ {'D', '-', 172}, /* Ð */
+ {'I', 'p', 174}, /* Þ */
+ {'r', 'O', 175}, /* ® */
+ {'-', ',', 176}, /* ¬ */
+ {'$', '$', 177}, /* £ */
+ {'Y', '-', 178}, /* ¥ */
+ {'~', '.', 179}, /* · */
+ {'c', 'O', 180}, /* © */
+ {'p', 'a', 181}, /* § */
+ {'p', 'p', 182}, /* ¶ */
+ {'1', '4', 183}, /* ¼ */
+ {'1', '2', 184}, /* ½ */
+ {'3', '4', 185}, /* ¾ */
+ {'Y', '\'', 186}, /* Ý */
+ {'"', '"', 187}, /* ¨ */
+ {'-', '=', 188}, /* ¯ */
+ {'\'', '\'', 190}, /* ´ */
+ {'O', 'E', 191}, /* × - OE in ISO 8859-15 */
+ {'/', '\\', 191}, /* × - multiplication symbol in ISO 8859-1 */
+ {'-', '-', 202}, /* ­ */
+ {'o', '^', 203}, /* ô */
+ {'o', '"', 204}, /* ö */
+ {'o', '`', 205}, /* ò */
+ {'o', '\'', 206}, /* ó */
+ {'o', '~', 207}, /* õ */
+ {'1', '1', 218}, /* ¹ */
+ {'u', '^', 219}, /* û */
+ {'u', '"', 220}, /* ü */
+ {'u', '`', 221}, /* ù */
+ {'u', '\'', 222}, /* ú */
+ {':', '-', 225}, /* ÷ - division symbol in ISO 8859-1 */
+ {'o', 'e', 225}, /* ÷ - oe in ISO 8859-15 */
+ {'2', '2', 234}, /* ² */
+ {'O', '^', 235}, /* Ô */
+ {'O', '"', 236}, /* Ö */
+ {'O', '`', 237}, /* Ò */
+ {'O', '\'', 238}, /* Ó */
+ {'O', '~', 239}, /* Õ */
+ {'3', '3', 250}, /* ³ */
+ {'U', '^', 251}, /* Û */
+ {'U', '"', 252}, /* Ü */
+ {'U', '`', 253}, /* Ù */
+ {'U', '\'', 254}, /* Ú */
+ {NUL, NUL, NUL}
+ };
+
+# else
+# if defined(MACOS) && !defined(FEAT_MBYTE)
+
+ /*
+ * Macintosh digraphs
+ */
+digr_T digraphdefault[] =
+ {{'a', 't', 64}, /* @ */
+ {'A', '"', 128}, /* ~@ XX */
+ {'A', 'o', 129}, /* Å */
+ {'C', ',', 130}, /* Ç */
+ {'E', '\'', 131}, /* É */
+ {'N', '~', 132}, /* Ñ */
+ {'O', '"', 133}, /* Ö */
+ {'U', '"', 134}, /* Ü */
+ {'a', '\'', 135}, /* ~G XX */
+ {'a', '`', 136}, /* ~H XX */
+ {'a', '^', 137}, /* â */
+ {'a', '"', 138}, /* ä */
+ {'a', '~', 139}, /* ã */
+ {'a', 'o', 140}, /* å */
+ {'c', ',', 141}, /* ç */
+ {'e', '\'', 142}, /* é */
+ {'e', '`', 143}, /* è */
+ {'e', '^', 144}, /* ê */
+ {'e', '"', 145}, /* ë */
+ {'i', '\'', 146}, /* í */
+ {'i', '`', 147}, /* ì */
+ {'i', '^', 148}, /* î */
+ {'i', '"', 149}, /* ï */
+ {'n', '~', 150}, /* ñ */
+ {'o', '\'', 151}, /* ó */
+ {'o', '`', 152}, /* ò */
+ {'o', '^', 153}, /* ô */
+ {'o', '"', 154}, /* ö */
+ {'o', '~', 155}, /* o */
+ {'u', '\'', 156}, /* ú */
+ {'u', '`', 157}, /* ~] XX */
+ {'u', '^', 158}, /* û */
+ {'u', '"', 159}, /* ü */
+ {'+', '_', 160}, /* Ý */
+ {'~', 'o', 161}, /* ° */
+ {'c', '|', 162}, /* ¢ */
+ {'$', '$', 163}, /* £ */
+ {'p', 'a', 164}, /* § */
+ {'.', '.', 165}, /* * */
+ {'P', 'P', 166}, /* ¶ */
+ {'s', 's', 167}, /* ß */
+ {'r', 'O', 168}, /* ® */
+ {'c', 'O', 169}, /* © */
+ {'T', 'M', 170}, /* */
+ {'=', '/', 173}, /* ‚ */
+ {'A', 'E', 174}, /* Æ */
+ {'O', '/', 175}, /* Ø */
+ {'0', '0', 176}, /* ƒ */
+ {'+', '-', 177}, /* ± */
+ {'<', '=', 178}, /* ¾ */
+ {'>', '=', 179}, /* „ */
+ {'Y', '-', 180}, /* ¥ */
+ {'j', 'u', 181}, /* µ */
+ {'m', 'u', 181}, /* µ */
+ {'d', 'd', 182}, /* */
+ {'S', 'S', 183}, /* … */
+ {'S', 'I', 183}, /* … */
+ {'P', 'I', 184}, /* ½ */
+ {'p', 'i', 185}, /* ¼ */
+ {'I', 'I', 186}, /* † */
+ {'a', '-', 187}, /* » */
+ {'o', '-', 188}, /* º */
+ {'O', 'M', 189}, /* ½ */
+ {'a', 'e', 190}, /* æ */
+ {'o', '/', 191}, /* ø */
+ {'~', '?', 192}, /* ¿ */
+ {'~', '!', 193}, /* ¡ */
+ {'-', ',', 194}, /* ¬ */
+ {'v', '-', 195}, /* ~H XX */
+ {'f', '-', 196}, /* Ÿ */
+ {'~', '~', 197}, /* ‰ */
+ {'D', 'E', 198}, /* */
+ {'<', '<', 199}, /* « */
+ {'>', '>', 200}, /* » */
+ {'.', ':', 201}, /* Š */
+ {'A', '`', 203}, /* À */
+ {'A', '~', 204}, /* Ã */
+ {'O', '~', 205}, /* Õ */
+ {'O', 'E', 206}, /* ‘ */
+ {'o', 'e', 207}, /* ¦ */
+ {'-', '.', 208}, /* - */
+ {'-', '-', 209}, /* - */
+ {'`', '`', 210}, /* " */
+ {'\'', '\'', 211}, /* " */
+ {'`', ' ', 212}, /* ' */
+ {'\'', ' ', 213}, /* ' */
+ {'-', ':', 214}, /* ÷ */
+ {'D', 'I', 215}, /* × */
+ {'y', ':', 216}, /* ÿ */
+ {'Y', ':', 217}, /* */
+ {'/', '/', 218}, /* Ž */
+ {'E', '=', 219}, /* ¤ Euro System >=8.5 */
+ {'o', 'x', 219}, /* ¤ Currency System <=8.1*/
+ {'<', ' ', 220}, /* Ð */
+ {'>', ' ', 221}, /* ð */
+ {'f', 'i', 222}, /* Þ */
+ {'f', 'l', 223}, /* þ */
+ {'+', '+', 224}, /* ý */
+ {'~', '.', 225}, /* · */
+ {',', ' ', 226}, /* ’ */
+ {',', ',', 227}, /* “ */
+ {'%', '.', 228}, /* ” */
+ {'%', '0', 228}, /* ” */
+ {'A', '^', 229}, /* Â */
+ {'E', '^', 230}, /* Ê */
+ {'A', '\'', 231}, /* Á */
+ {'E', '"', 232}, /* Ë */
+ {'E', '`', 233}, /* È */
+ {'I', '\'', 234}, /* Í */
+ {'I', '^', 235}, /* Î */
+ {'I', '"', 236}, /* Ï */
+ {'I', '`', 237}, /* Ì */
+ {'O', '\'', 238}, /* Ó */
+ {'O', '^', 239}, /* Ô */
+ {'A', 'P', 240}, /* • */
+ {'O', '`', 241}, /* Ò */
+ {'U', '\'', 242}, /* Ú */
+ {'U', '^', 243}, /* Û */
+ {'U', '`', 244}, /* Ù */
+ {'i', '.', 245}, /* ž */
+ {NUL, NUL, NUL}
+ };
+
+# else /* !MACOS */
+
+# ifdef OLD_DIGRAPHS
+
+ /*
+ * digraphs compatible with Vim 5.x
+ */
+digr_T digraphdefault[] =
+ {{'~', '!', 161}, /* ¡ */
+ {'c', '|', 162}, /* ¢ */
+ {'$', '$', 163}, /* £ */
+ {'o', 'x', 164}, /* ¤ - currency symbol in ISO 8859-1 */
+ {'e', '=', 164}, /* ¤ - euro symbol in ISO 8859-15 */
+ {'Y', '-', 165}, /* ¥ */
+ {'|', '|', 166}, /* ¦ */
+ {'p', 'a', 167}, /* § */
+ {'"', '"', 168}, /* ¨ */
+ {'c', 'O', 169}, /* © */
+ {'a', '-', 170}, /* ª */
+ {'<', '<', 171}, /* « */
+ {'-', ',', 172}, /* ¬ */
+ {'-', '-', 173}, /* ­ */
+ {'r', 'O', 174}, /* ® */
+ {'-', '=', 175}, /* ¯ */
+ {'~', 'o', 176}, /* ° */
+ {'+', '-', 177}, /* ± */
+ {'2', '2', 178}, /* ² */
+ {'3', '3', 179}, /* ³ */
+ {'\'', '\'', 180}, /* ´ */
+ {'j', 'u', 181}, /* µ */
+ {'p', 'p', 182}, /* ¶ */
+ {'~', '.', 183}, /* · */
+ {',', ',', 184}, /* ¸ */
+ {'1', '1', 185}, /* ¹ */
+ {'o', '-', 186}, /* º */
+ {'>', '>', 187}, /* » */
+ {'1', '4', 188}, /* ¼ */
+ {'1', '2', 189}, /* ½ */
+ {'3', '4', 190}, /* ¾ */
+ {'~', '?', 191}, /* ¿ */
+ {'A', '`', 192}, /* À */
+ {'A', '\'', 193}, /* Á */
+ {'A', '^', 194}, /* Â */
+ {'A', '~', 195}, /* Ã */
+ {'A', '"', 196}, /* Ä */
+ {'A', '@', 197}, /* Å */
+ {'A', 'A', 197}, /* Å */
+ {'A', 'E', 198}, /* Æ */
+ {'C', ',', 199}, /* Ç */
+ {'E', '`', 200}, /* È */
+ {'E', '\'', 201}, /* É */
+ {'E', '^', 202}, /* Ê */
+ {'E', '"', 203}, /* Ë */
+ {'I', '`', 204}, /* Ì */
+ {'I', '\'', 205}, /* Í */
+ {'I', '^', 206}, /* Î */
+ {'I', '"', 207}, /* Ï */
+ {'D', '-', 208}, /* Ð */
+ {'N', '~', 209}, /* Ñ */
+ {'O', '`', 210}, /* Ò */
+ {'O', '\'', 211}, /* Ó */
+ {'O', '^', 212}, /* Ô */
+ {'O', '~', 213}, /* Õ */
+ {'O', '"', 214}, /* Ö */
+ {'/', '\\', 215}, /* × - multiplication symbol in ISO 8859-1 */
+ {'O', 'E', 215}, /* × - OE in ISO 8859-15 */
+ {'O', '/', 216}, /* Ø */
+ {'U', '`', 217}, /* Ù */
+ {'U', '\'', 218}, /* Ú */
+ {'U', '^', 219}, /* Û */
+ {'U', '"', 220}, /* Ü */
+ {'Y', '\'', 221}, /* Ý */
+ {'I', 'p', 222}, /* Þ */
+ {'s', 's', 223}, /* ß */
+ {'a', '`', 224}, /* à */
+ {'a', '\'', 225}, /* á */
+ {'a', '^', 226}, /* â */
+ {'a', '~', 227}, /* ã */
+ {'a', '"', 228}, /* ä */
+ {'a', '@', 229}, /* å */
+ {'a', 'a', 229}, /* å */
+ {'a', 'e', 230}, /* æ */
+ {'c', ',', 231}, /* ç */
+ {'e', '`', 232}, /* è */
+ {'e', '\'', 233}, /* é */
+ {'e', '^', 234}, /* ê */
+ {'e', '"', 235}, /* ë */
+ {'i', '`', 236}, /* ì */
+ {'i', '\'', 237}, /* í */
+ {'i', '^', 238}, /* î */
+ {'i', '"', 239}, /* ï */
+ {'d', '-', 240}, /* ð */
+ {'n', '~', 241}, /* ñ */
+ {'o', '`', 242}, /* ò */
+ {'o', '\'', 243}, /* ó */
+ {'o', '^', 244}, /* ô */
+ {'o', '~', 245}, /* õ */
+ {'o', '"', 246}, /* ö */
+ {':', '-', 247}, /* ÷ - division symbol in ISO 8859-1 */
+ {'o', 'e', 247}, /* ÷ - oe in ISO 8859-15 */
+ {'o', '/', 248}, /* ø */
+ {'u', '`', 249}, /* ù */
+ {'u', '\'', 250}, /* ú */
+ {'u', '^', 251}, /* û */
+ {'u', '"', 252}, /* ü */
+ {'y', '\'', 253}, /* ý */
+ {'i', 'p', 254}, /* þ */
+ {'y', '"', 255}, /* x XX */
+ {NUL, NUL, NUL}
+ };
+# else /* OLD_DIGRAPHS */
+
+ /*
+ * digraphs for Unicode from RFC1345
+ * (also work for ISO-8859-1 aka latin1)
+ */
+digr_T digraphdefault[] =
+ {
+ {'N', 'U', 0x0a}, /* LF for NUL */
+ {'S', 'H', 0x01},
+ {'S', 'X', 0x02},
+ {'E', 'X', 0x03},
+ {'E', 'T', 0x04},
+ {'E', 'Q', 0x05},
+ {'A', 'K', 0x06},
+ {'B', 'L', 0x07},
+ {'B', 'S', 0x08},
+ {'H', 'T', 0x09},
+ {'L', 'F', 0x0a},
+ {'V', 'T', 0x0b},
+ {'F', 'F', 0x0c},
+ {'C', 'R', 0x0d},
+ {'S', 'O', 0x0e},
+ {'S', 'I', 0x0f},
+ {'D', 'L', 0x10},
+ {'D', '1', 0x11},
+ {'D', '2', 0x12},
+ {'D', '3', 0x13},
+ {'D', '4', 0x14},
+ {'N', 'K', 0x15},
+ {'S', 'Y', 0x16},
+ {'E', 'B', 0x17},
+ {'C', 'N', 0x18},
+ {'E', 'M', 0x19},
+ {'S', 'B', 0x1a},
+ {'E', 'C', 0x1b},
+ {'F', 'S', 0x1c},
+ {'G', 'S', 0x1d},
+ {'R', 'S', 0x1e},
+ {'U', 'S', 0x1f},
+ {'S', 'P', 0x20},
+ {'N', 'b', 0x23},
+ {'D', 'O', 0x24},
+ {'A', 't', 0x40},
+ {'<', '(', 0x5b},
+ {'/', '/', 0x5c},
+ {')', '>', 0x5d},
+ {'\'', '>', 0x5e},
+ {'\'', '!', 0x60},
+ {'(', '!', 0x7b},
+ {'!', '!', 0x7c},
+ {'!', ')', 0x7d},
+ {'\'', '?', 0x7e},
+ {'D', 'T', 0x7f},
+ {'P', 'A', 0x80},
+ {'H', 'O', 0x81},
+ {'B', 'H', 0x82},
+ {'N', 'H', 0x83},
+ {'I', 'N', 0x84},
+ {'N', 'L', 0x85},
+ {'S', 'A', 0x86},
+ {'E', 'S', 0x87},
+ {'H', 'S', 0x88},
+ {'H', 'J', 0x89},
+ {'V', 'S', 0x8a},
+ {'P', 'D', 0x8b},
+ {'P', 'U', 0x8c},
+ {'R', 'I', 0x8d},
+ {'S', '2', 0x8e},
+ {'S', '3', 0x8f},
+ {'D', 'C', 0x90},
+ {'P', '1', 0x91},
+ {'P', '2', 0x92},
+ {'T', 'S', 0x93},
+ {'C', 'C', 0x94},
+ {'M', 'W', 0x95},
+ {'S', 'G', 0x96},
+ {'E', 'G', 0x97},
+ {'S', 'S', 0x98},
+ {'G', 'C', 0x99},
+ {'S', 'C', 0x9a},
+ {'C', 'I', 0x9b},
+ {'S', 'T', 0x9c},
+ {'O', 'C', 0x9d},
+ {'P', 'M', 0x9e},
+ {'A', 'C', 0x9f},
+ {'N', 'S', 0xa0},
+ {'!', 'I', 0xa1},
+ {'C', 't', 0xa2},
+ {'P', 'd', 0xa3},
+ {'C', 'u', 0xa4},
+ {'Y', 'e', 0xa5},
+ {'B', 'B', 0xa6},
+ {'S', 'E', 0xa7},
+ {'\'', ':', 0xa8},
+ {'C', 'o', 0xa9},
+ {'-', 'a', 0xaa},
+ {'<', '<', 0xab},
+ {'N', 'O', 0xac},
+ {'-', '-', 0xad},
+ {'R', 'g', 0xae},
+ {'\'', 'm', 0xaf},
+ {'D', 'G', 0xb0},
+ {'+', '-', 0xb1},
+ {'2', 'S', 0xb2},
+ {'3', 'S', 0xb3},
+ {'\'', '\'', 0xb4},
+ {'M', 'y', 0xb5},
+ {'P', 'I', 0xb6},
+ {'.', 'M', 0xb7},
+ {'\'', ',', 0xb8},
+ {'1', 'S', 0xb9},
+ {'-', 'o', 0xba},
+ {'>', '>', 0xbb},
+ {'1', '4', 0xbc},
+ {'1', '2', 0xbd},
+ {'3', '4', 0xbe},
+ {'?', 'I', 0xbf},
+ {'A', '!', 0xc0},
+ {'A', '\'', 0xc1},
+ {'A', '>', 0xc2},
+ {'A', '?', 0xc3},
+ {'A', ':', 0xc4},
+ {'A', 'A', 0xc5},
+ {'A', 'E', 0xc6},
+ {'C', ',', 0xc7},
+ {'E', '!', 0xc8},
+ {'E', '\'', 0xc9},
+ {'E', '>', 0xca},
+ {'E', ':', 0xcb},
+ {'I', '!', 0xcc},
+ {'I', '\'', 0xcd},
+ {'I', '>', 0xce},
+ {'I', ':', 0xcf},
+ {'D', '-', 0xd0},
+ {'N', '?', 0xd1},
+ {'O', '!', 0xd2},
+ {'O', '\'', 0xd3},
+ {'O', '>', 0xd4},
+ {'O', '?', 0xd5},
+ {'O', ':', 0xd6},
+ {'*', 'X', 0xd7},
+ {'O', '/', 0xd8},
+ {'U', '!', 0xd9},
+ {'U', '\'', 0xda},
+ {'U', '>', 0xdb},
+ {'U', ':', 0xdc},
+ {'Y', '\'', 0xdd},
+ {'T', 'H', 0xde},
+ {'s', 's', 0xdf},
+ {'a', '!', 0xe0},
+ {'a', '\'', 0xe1},
+ {'a', '>', 0xe2},
+ {'a', '?', 0xe3},
+ {'a', ':', 0xe4},
+ {'a', 'a', 0xe5},
+ {'a', 'e', 0xe6},
+ {'c', ',', 0xe7},
+ {'e', '!', 0xe8},
+ {'e', '\'', 0xe9},
+ {'e', '>', 0xea},
+ {'e', ':', 0xeb},
+ {'i', '!', 0xec},
+ {'i', '\'', 0xed},
+ {'i', '>', 0xee},
+ {'i', ':', 0xef},
+ {'d', '-', 0xf0},
+ {'n', '?', 0xf1},
+ {'o', '!', 0xf2},
+ {'o', '\'', 0xf3},
+ {'o', '>', 0xf4},
+ {'o', '?', 0xf5},
+ {'o', ':', 0xf6},
+ {'-', ':', 0xf7},
+ {'o', '/', 0xf8},
+ {'u', '!', 0xf9},
+ {'u', '\'', 0xfa},
+ {'u', '>', 0xfb},
+ {'u', ':', 0xfc},
+ {'y', '\'', 0xfd},
+ {'t', 'h', 0xfe},
+ {'y', ':', 0xff},
+
+# ifdef FEAT_MBYTE
+# define USE_UNICODE_DIGRAPHS
+
+ {'A', '-', 0x0100},
+ {'a', '-', 0x0101},
+ {'A', '(', 0x0102},
+ {'a', '(', 0x0103},
+ {'A', ';', 0x0104},
+ {'a', ';', 0x0105},
+ {'C', '\'', 0x0106},
+ {'c', '\'', 0x0107},
+ {'C', '>', 0x0108},
+ {'c', '>', 0x0109},
+ {'C', '.', 0x010a},
+ {'c', '.', 0x010b},
+ {'C', '<', 0x010c},
+ {'c', '<', 0x010d},
+ {'D', '<', 0x010e},
+ {'d', '<', 0x010f},
+ {'D', '/', 0x0110},
+ {'d', '/', 0x0111},
+ {'E', '-', 0x0112},
+ {'e', '-', 0x0113},
+ {'E', '(', 0x0114},
+ {'e', '(', 0x0115},
+ {'E', '.', 0x0116},
+ {'e', '.', 0x0117},
+ {'E', ';', 0x0118},
+ {'e', ';', 0x0119},
+ {'E', '<', 0x011a},
+ {'e', '<', 0x011b},
+ {'G', '>', 0x011c},
+ {'g', '>', 0x011d},
+ {'G', '(', 0x011e},
+ {'g', '(', 0x011f},
+ {'G', '.', 0x0120},
+ {'g', '.', 0x0121},
+ {'G', ',', 0x0122},
+ {'g', ',', 0x0123},
+ {'H', '>', 0x0124},
+ {'h', '>', 0x0125},
+ {'H', '/', 0x0126},
+ {'h', '/', 0x0127},
+ {'I', '?', 0x0128},
+ {'i', '?', 0x0129},
+ {'I', '-', 0x012a},
+ {'i', '-', 0x012b},
+ {'I', '(', 0x012c},
+ {'i', '(', 0x012d},
+ {'I', ';', 0x012e},
+ {'i', ';', 0x012f},
+ {'I', '.', 0x0130},
+ {'i', '.', 0x0131},
+ {'I', 'J', 0x0132},
+ {'i', 'j', 0x0133},
+ {'J', '>', 0x0134},
+ {'j', '>', 0x0135},
+ {'K', ',', 0x0136},
+ {'k', ',', 0x0137},
+ {'k', 'k', 0x0138},
+ {'L', '\'', 0x0139},
+ {'l', '\'', 0x013a},
+ {'L', ',', 0x013b},
+ {'l', ',', 0x013c},
+ {'L', '<', 0x013d},
+ {'l', '<', 0x013e},
+ {'L', '.', 0x013f},
+ {'l', '.', 0x0140},
+ {'L', '/', 0x0141},
+ {'l', '/', 0x0142},
+ {'N', '\'', 0x0143},
+ {'n', '\'', 0x0144},
+ {'N', ',', 0x0145},
+ {'n', ',', 0x0146},
+ {'N', '<', 0x0147},
+ {'n', '<', 0x0148},
+ {'\'', 'n', 0x0149},
+ {'N', 'G', 0x014a},
+ {'n', 'g', 0x014b},
+ {'O', '-', 0x014c},
+ {'o', '-', 0x014d},
+ {'O', '(', 0x014e},
+ {'o', '(', 0x014f},
+ {'O', '"', 0x0150},
+ {'o', '"', 0x0151},
+ {'O', 'E', 0x0152},
+ {'o', 'e', 0x0153},
+ {'R', '\'', 0x0154},
+ {'r', '\'', 0x0155},
+ {'R', ',', 0x0156},
+ {'r', ',', 0x0157},
+ {'R', '<', 0x0158},
+ {'r', '<', 0x0159},
+ {'S', '\'', 0x015a},
+ {'s', '\'', 0x015b},
+ {'S', '>', 0x015c},
+ {'s', '>', 0x015d},
+ {'S', ',', 0x015e},
+ {'s', ',', 0x015f},
+ {'S', '<', 0x0160},
+ {'s', '<', 0x0161},
+ {'T', ',', 0x0162},
+ {'t', ',', 0x0163},
+ {'T', '<', 0x0164},
+ {'t', '<', 0x0165},
+ {'T', '/', 0x0166},
+ {'t', '/', 0x0167},
+ {'U', '?', 0x0168},
+ {'u', '?', 0x0169},
+ {'U', '-', 0x016a},
+ {'u', '-', 0x016b},
+ {'U', '(', 0x016c},
+ {'u', '(', 0x016d},
+ {'U', '0', 0x016e},
+ {'u', '0', 0x016f},
+ {'U', '"', 0x0170},
+ {'u', '"', 0x0171},
+ {'U', ';', 0x0172},
+ {'u', ';', 0x0173},
+ {'W', '>', 0x0174},
+ {'w', '>', 0x0175},
+ {'Y', '>', 0x0176},
+ {'y', '>', 0x0177},
+ {'Y', ':', 0x0178},
+ {'Z', '\'', 0x0179},
+ {'z', '\'', 0x017a},
+ {'Z', '.', 0x017b},
+ {'z', '.', 0x017c},
+ {'Z', '<', 0x017d},
+ {'z', '<', 0x017e},
+ {'O', '9', 0x01a0},
+ {'o', '9', 0x01a1},
+ {'O', 'I', 0x01a2},
+ {'o', 'i', 0x01a3},
+ {'y', 'r', 0x01a6},
+ {'U', '9', 0x01af},
+ {'u', '9', 0x01b0},
+ {'Z', '/', 0x01b5},
+ {'z', '/', 0x01b6},
+ {'E', 'D', 0x01b7},
+ {'A', '<', 0x01cd},
+ {'a', '<', 0x01ce},
+ {'I', '<', 0x01cf},
+ {'i', '<', 0x01d0},
+ {'O', '<', 0x01d1},
+ {'o', '<', 0x01d2},
+ {'U', '<', 0x01d3},
+ {'u', '<', 0x01d4},
+ {'A', '1', 0x01de},
+ {'a', '1', 0x01df},
+ {'A', '7', 0x01e0},
+ {'a', '7', 0x01e1},
+ {'A', '3', 0x01e2},
+ {'a', '3', 0x01e3},
+ {'G', '/', 0x01e4},
+ {'g', '/', 0x01e5},
+ {'G', '<', 0x01e6},
+ {'g', '<', 0x01e7},
+ {'K', '<', 0x01e8},
+ {'k', '<', 0x01e9},
+ {'O', ';', 0x01ea},
+ {'o', ';', 0x01eb},
+ {'O', '1', 0x01ec},
+ {'o', '1', 0x01ed},
+ {'E', 'Z', 0x01ee},
+ {'e', 'z', 0x01ef},
+ {'j', '<', 0x01f0},
+ {'G', '\'', 0x01f4},
+ {'g', '\'', 0x01f5},
+ {';', 'S', 0x02bf},
+ {'\'', '<', 0x02c7},
+ {'\'', '(', 0x02d8},
+ {'\'', '.', 0x02d9},
+ {'\'', '0', 0x02da},
+ {'\'', ';', 0x02db},
+ {'\'', '"', 0x02dd},
+ {'A', '%', 0x0386},
+ {'E', '%', 0x0388},
+ {'Y', '%', 0x0389},
+ {'I', '%', 0x038a},
+ {'O', '%', 0x038c},
+ {'U', '%', 0x038e},
+ {'W', '%', 0x038f},
+ {'i', '3', 0x0390},
+ {'A', '*', 0x0391},
+ {'B', '*', 0x0392},
+ {'G', '*', 0x0393},
+ {'D', '*', 0x0394},
+ {'E', '*', 0x0395},
+ {'Z', '*', 0x0396},
+ {'Y', '*', 0x0397},
+ {'H', '*', 0x0398},
+ {'I', '*', 0x0399},
+ {'K', '*', 0x039a},
+ {'L', '*', 0x039b},
+ {'M', '*', 0x039c},
+ {'N', '*', 0x039d},
+ {'C', '*', 0x039e},
+ {'O', '*', 0x039f},
+ {'P', '*', 0x03a0},
+ {'R', '*', 0x03a1},
+ {'S', '*', 0x03a3},
+ {'T', '*', 0x03a4},
+ {'U', '*', 0x03a5},
+ {'F', '*', 0x03a6},
+ {'X', '*', 0x03a7},
+ {'Q', '*', 0x03a8},
+ {'W', '*', 0x03a9},
+ {'J', '*', 0x03aa},
+ {'V', '*', 0x03ab},
+ {'a', '%', 0x03ac},
+ {'e', '%', 0x03ad},
+ {'y', '%', 0x03ae},
+ {'i', '%', 0x03af},
+ {'u', '3', 0x03b0},
+ {'a', '*', 0x03b1},
+ {'b', '*', 0x03b2},
+ {'g', '*', 0x03b3},
+ {'d', '*', 0x03b4},
+ {'e', '*', 0x03b5},
+ {'z', '*', 0x03b6},
+ {'y', '*', 0x03b7},
+ {'h', '*', 0x03b8},
+ {'i', '*', 0x03b9},
+ {'k', '*', 0x03ba},
+ {'l', '*', 0x03bb},
+ {'m', '*', 0x03bc},
+ {'n', '*', 0x03bd},
+ {'c', '*', 0x03be},
+ {'o', '*', 0x03bf},
+ {'p', '*', 0x03c0},
+ {'r', '*', 0x03c1},
+ {'*', 's', 0x03c2},
+ {'s', '*', 0x03c3},
+ {'t', '*', 0x03c4},
+ {'u', '*', 0x03c5},
+ {'f', '*', 0x03c6},
+ {'x', '*', 0x03c7},
+ {'q', '*', 0x03c8},
+ {'w', '*', 0x03c9},
+ {'j', '*', 0x03ca},
+ {'v', '*', 0x03cb},
+ {'o', '%', 0x03cc},
+ {'u', '%', 0x03cd},
+ {'w', '%', 0x03ce},
+ {'\'', 'G', 0x03d8},
+ {',', 'G', 0x03d9},
+ {'T', '3', 0x03da},
+ {'t', '3', 0x03db},
+ {'M', '3', 0x03dc},
+ {'m', '3', 0x03dd},
+ {'K', '3', 0x03de},
+ {'k', '3', 0x03df},
+ {'P', '3', 0x03e0},
+ {'p', '3', 0x03e1},
+ {'\'', '%', 0x03f4},
+ {'j', '3', 0x03f5},
+ {'I', 'O', 0x0401},
+ {'D', '%', 0x0402},
+ {'G', '%', 0x0403},
+ {'I', 'E', 0x0404},
+ {'D', 'S', 0x0405},
+ {'I', 'I', 0x0406},
+ {'Y', 'I', 0x0407},
+ {'J', '%', 0x0408},
+ {'L', 'J', 0x0409},
+ {'N', 'J', 0x040a},
+ {'T', 's', 0x040b},
+ {'K', 'J', 0x040c},
+ {'V', '%', 0x040e},
+ {'D', 'Z', 0x040f},
+ {'A', '=', 0x0410},
+ {'B', '=', 0x0411},
+ {'V', '=', 0x0412},
+ {'G', '=', 0x0413},
+ {'D', '=', 0x0414},
+ {'E', '=', 0x0415},
+ {'Z', '%', 0x0416},
+ {'Z', '=', 0x0417},
+ {'I', '=', 0x0418},
+ {'J', '=', 0x0419},
+ {'K', '=', 0x041a},
+ {'L', '=', 0x041b},
+ {'M', '=', 0x041c},
+ {'N', '=', 0x041d},
+ {'O', '=', 0x041e},
+ {'P', '=', 0x041f},
+ {'R', '=', 0x0420},
+ {'S', '=', 0x0421},
+ {'T', '=', 0x0422},
+ {'U', '=', 0x0423},
+ {'F', '=', 0x0424},
+ {'H', '=', 0x0425},
+ {'C', '=', 0x0426},
+ {'C', '%', 0x0427},
+ {'S', '%', 0x0428},
+ {'S', 'c', 0x0429},
+ {'=', '"', 0x042a},
+ {'Y', '=', 0x042b},
+ {'%', '"', 0x042c},
+ {'J', 'E', 0x042d},
+ {'J', 'U', 0x042e},
+ {'J', 'A', 0x042f},
+ {'a', '=', 0x0430},
+ {'b', '=', 0x0431},
+ {'v', '=', 0x0432},
+ {'g', '=', 0x0433},
+ {'d', '=', 0x0434},
+ {'e', '=', 0x0435},
+ {'z', '%', 0x0436},
+ {'z', '=', 0x0437},
+ {'i', '=', 0x0438},
+ {'j', '=', 0x0439},
+ {'k', '=', 0x043a},
+ {'l', '=', 0x043b},
+ {'m', '=', 0x043c},
+ {'n', '=', 0x043d},
+ {'o', '=', 0x043e},
+ {'p', '=', 0x043f},
+ {'r', '=', 0x0440},
+ {'s', '=', 0x0441},
+ {'t', '=', 0x0442},
+ {'u', '=', 0x0443},
+ {'f', '=', 0x0444},
+ {'h', '=', 0x0445},
+ {'c', '=', 0x0446},
+ {'c', '%', 0x0447},
+ {'s', '%', 0x0448},
+ {'s', 'c', 0x0449},
+ {'=', '\'', 0x044a},
+ {'y', '=', 0x044b},
+ {'%', '\'', 0x044c},
+ {'j', 'e', 0x044d},
+ {'j', 'u', 0x044e},
+ {'j', 'a', 0x044f},
+ {'i', 'o', 0x0451},
+ {'d', '%', 0x0452},
+ {'g', '%', 0x0453},
+ {'i', 'e', 0x0454},
+ {'d', 's', 0x0455},
+ {'i', 'i', 0x0456},
+ {'y', 'i', 0x0457},
+ {'j', '%', 0x0458},
+ {'l', 'j', 0x0459},
+ {'n', 'j', 0x045a},
+ {'t', 's', 0x045b},
+ {'k', 'j', 0x045c},
+ {'v', '%', 0x045e},
+ {'d', 'z', 0x045f},
+ {'Y', '3', 0x0462},
+ {'y', '3', 0x0463},
+ {'O', '3', 0x046a},
+ {'o', '3', 0x046b},
+ {'F', '3', 0x0472},
+ {'f', '3', 0x0473},
+ {'V', '3', 0x0474},
+ {'v', '3', 0x0475},
+ {'C', '3', 0x0480},
+ {'c', '3', 0x0481},
+ {'G', '3', 0x0490},
+ {'g', '3', 0x0491},
+ {'A', '+', 0x05d0},
+ {'B', '+', 0x05d1},
+ {'G', '+', 0x05d2},
+ {'D', '+', 0x05d3},
+ {'H', '+', 0x05d4},
+ {'W', '+', 0x05d5},
+ {'Z', '+', 0x05d6},
+ {'X', '+', 0x05d7},
+ {'T', 'j', 0x05d8},
+ {'J', '+', 0x05d9},
+ {'K', '%', 0x05da},
+ {'K', '+', 0x05db},
+ {'L', '+', 0x05dc},
+ {'M', '%', 0x05dd},
+ {'M', '+', 0x05de},
+ {'N', '%', 0x05df},
+ {'N', '+', 0x05e0},
+ {'S', '+', 0x05e1},
+ {'E', '+', 0x05e2},
+ {'P', '%', 0x05e3},
+ {'P', '+', 0x05e4},
+ {'Z', 'j', 0x05e5},
+ {'Z', 'J', 0x05e6},
+ {'Q', '+', 0x05e7},
+ {'R', '+', 0x05e8},
+ {'S', 'h', 0x05e9},
+ {'T', '+', 0x05ea},
+ {',', '+', 0x060c},
+ {';', '+', 0x061b},
+ {'?', '+', 0x061f},
+ {'H', '\'', 0x0621},
+ {'a', 'M', 0x0622},
+ {'a', 'H', 0x0623},
+ {'w', 'H', 0x0624},
+ {'a', 'h', 0x0625},
+ {'y', 'H', 0x0626},
+ {'a', '+', 0x0627},
+ {'b', '+', 0x0628},
+ {'t', 'm', 0x0629},
+ {'t', '+', 0x062a},
+ {'t', 'k', 0x062b},
+ {'g', '+', 0x062c},
+ {'h', 'k', 0x062d},
+ {'x', '+', 0x062e},
+ {'d', '+', 0x062f},
+ {'d', 'k', 0x0630},
+ {'r', '+', 0x0631},
+ {'z', '+', 0x0632},
+ {'s', '+', 0x0633},
+ {'s', 'n', 0x0634},
+ {'c', '+', 0x0635},
+ {'d', 'd', 0x0636},
+ {'t', 'j', 0x0637},
+ {'z', 'H', 0x0638},
+ {'e', '+', 0x0639},
+ {'i', '+', 0x063a},
+ {'+', '+', 0x0640},
+ {'f', '+', 0x0641},
+ {'q', '+', 0x0642},
+ {'k', '+', 0x0643},
+ {'l', '+', 0x0644},
+ {'m', '+', 0x0645},
+ {'n', '+', 0x0646},
+ {'h', '+', 0x0647},
+ {'w', '+', 0x0648},
+ {'j', '+', 0x0649},
+ {'y', '+', 0x064a},
+ {':', '+', 0x064b},
+ {'"', '+', 0x064c},
+ {'=', '+', 0x064d},
+ {'/', '+', 0x064e},
+ {'\'', '+', 0x064f},
+ {'1', '+', 0x0650},
+ {'3', '+', 0x0651},
+ {'0', '+', 0x0652},
+ {'a', 'S', 0x0670},
+ {'p', '+', 0x067e},
+ {'v', '+', 0x06a4},
+ {'g', 'f', 0x06af},
+ {'0', 'a', 0x06f0},
+ {'1', 'a', 0x06f1},
+ {'2', 'a', 0x06f2},
+ {'3', 'a', 0x06f3},
+ {'4', 'a', 0x06f4},
+ {'5', 'a', 0x06f5},
+ {'6', 'a', 0x06f6},
+ {'7', 'a', 0x06f7},
+ {'8', 'a', 0x06f8},
+ {'9', 'a', 0x06f9},
+ {'B', '.', 0x1e02},
+ {'b', '.', 0x1e03},
+ {'B', '_', 0x1e06},
+ {'b', '_', 0x1e07},
+ {'D', '.', 0x1e0a},
+ {'d', '.', 0x1e0b},
+ {'D', '_', 0x1e0e},
+ {'d', '_', 0x1e0f},
+ {'D', ',', 0x1e10},
+ {'d', ',', 0x1e11},
+ {'F', '.', 0x1e1e},
+ {'f', '.', 0x1e1f},
+ {'G', '-', 0x1e20},
+ {'g', '-', 0x1e21},
+ {'H', '.', 0x1e22},
+ {'h', '.', 0x1e23},
+ {'H', ':', 0x1e26},
+ {'h', ':', 0x1e27},
+ {'H', ',', 0x1e28},
+ {'h', ',', 0x1e29},
+ {'K', '\'', 0x1e30},
+ {'k', '\'', 0x1e31},
+ {'K', '_', 0x1e34},
+ {'k', '_', 0x1e35},
+ {'L', '_', 0x1e3a},
+ {'l', '_', 0x1e3b},
+ {'M', '\'', 0x1e3e},
+ {'m', '\'', 0x1e3f},
+ {'M', '.', 0x1e40},
+ {'m', '.', 0x1e41},
+ {'N', '.', 0x1e44},
+ {'n', '.', 0x1e45},
+ {'N', '_', 0x1e48},
+ {'n', '_', 0x1e49},
+ {'P', '\'', 0x1e54},
+ {'p', '\'', 0x1e55},
+ {'P', '.', 0x1e56},
+ {'p', '.', 0x1e57},
+ {'R', '.', 0x1e58},
+ {'r', '.', 0x1e59},
+ {'R', '_', 0x1e5e},
+ {'r', '_', 0x1e5f},
+ {'S', '.', 0x1e60},
+ {'s', '.', 0x1e61},
+ {'T', '.', 0x1e6a},
+ {'t', '.', 0x1e6b},
+ {'T', '_', 0x1e6e},
+ {'t', '_', 0x1e6f},
+ {'V', '?', 0x1e7c},
+ {'v', '?', 0x1e7d},
+ {'W', '!', 0x1e80},
+ {'w', '!', 0x1e81},
+ {'W', '\'', 0x1e82},
+ {'w', '\'', 0x1e83},
+ {'W', ':', 0x1e84},
+ {'w', ':', 0x1e85},
+ {'W', '.', 0x1e86},
+ {'w', '.', 0x1e87},
+ {'X', '.', 0x1e8a},
+ {'x', '.', 0x1e8b},
+ {'X', ':', 0x1e8c},
+ {'x', ':', 0x1e8d},
+ {'Y', '.', 0x1e8e},
+ {'y', '.', 0x1e8f},
+ {'Z', '>', 0x1e90},
+ {'z', '>', 0x1e91},
+ {'Z', '_', 0x1e94},
+ {'z', '_', 0x1e95},
+ {'h', '_', 0x1e96},
+ {'t', ':', 0x1e97},
+ {'w', '0', 0x1e98},
+ {'y', '0', 0x1e99},
+ {'A', '2', 0x1ea2},
+ {'a', '2', 0x1ea3},
+ {'E', '2', 0x1eba},
+ {'e', '2', 0x1ebb},
+ {'E', '?', 0x1ebc},
+ {'e', '?', 0x1ebd},
+ {'I', '2', 0x1ec8},
+ {'i', '2', 0x1ec9},
+ {'O', '2', 0x1ece},
+ {'o', '2', 0x1ecf},
+ {'U', '2', 0x1ee6},
+ {'u', '2', 0x1ee7},
+ {'Y', '!', 0x1ef2},
+ {'y', '!', 0x1ef3},
+ {'Y', '2', 0x1ef6},
+ {'y', '2', 0x1ef7},
+ {'Y', '?', 0x1ef8},
+ {'y', '?', 0x1ef9},
+ {';', '\'', 0x1f00},
+ {',', '\'', 0x1f01},
+ {';', '!', 0x1f02},
+ {',', '!', 0x1f03},
+ {'?', ';', 0x1f04},
+ {'?', ',', 0x1f05},
+ {'!', ':', 0x1f06},
+ {'?', ':', 0x1f07},
+ {'1', 'N', 0x2002},
+ {'1', 'M', 0x2003},
+ {'3', 'M', 0x2004},
+ {'4', 'M', 0x2005},
+ {'6', 'M', 0x2006},
+ {'1', 'T', 0x2009},
+ {'1', 'H', 0x200a},
+ {'-', '1', 0x2010},
+ {'-', 'N', 0x2013},
+ {'-', 'M', 0x2014},
+ {'-', '3', 0x2015},
+ {'!', '2', 0x2016},
+ {'=', '2', 0x2017},
+ {'\'', '6', 0x2018},
+ {'\'', '9', 0x2019},
+ {'.', '9', 0x201a},
+ {'9', '\'', 0x201b},
+ {'"', '6', 0x201c},
+ {'"', '9', 0x201d},
+ {':', '9', 0x201e},
+ {'9', '"', 0x201f},
+ {'/', '-', 0x2020},
+ {'/', '=', 0x2021},
+ {'.', '.', 0x2025},
+ {'%', '0', 0x2030},
+ {'1', '\'', 0x2032},
+ {'2', '\'', 0x2033},
+ {'3', '\'', 0x2034},
+ {'1', '"', 0x2035},
+ {'2', '"', 0x2036},
+ {'3', '"', 0x2037},
+ {'C', 'a', 0x2038},
+ {'<', '1', 0x2039},
+ {'>', '1', 0x203a},
+ {':', 'X', 0x203b},
+ {'\'', '-', 0x203e},
+ {'/', 'f', 0x2044},
+ {'0', 'S', 0x2070},
+ {'4', 'S', 0x2074},
+ {'5', 'S', 0x2075},
+ {'6', 'S', 0x2076},
+ {'7', 'S', 0x2077},
+ {'8', 'S', 0x2078},
+ {'9', 'S', 0x2079},
+ {'+', 'S', 0x207a},
+ {'-', 'S', 0x207b},
+ {'=', 'S', 0x207c},
+ {'(', 'S', 0x207d},
+ {')', 'S', 0x207e},
+ {'n', 'S', 0x207f},
+ {'0', 's', 0x2080},
+ {'1', 's', 0x2081},
+ {'2', 's', 0x2082},
+ {'3', 's', 0x2083},
+ {'4', 's', 0x2084},
+ {'5', 's', 0x2085},
+ {'6', 's', 0x2086},
+ {'7', 's', 0x2087},
+ {'8', 's', 0x2088},
+ {'9', 's', 0x2089},
+ {'+', 's', 0x208a},
+ {'-', 's', 0x208b},
+ {'=', 's', 0x208c},
+ {'(', 's', 0x208d},
+ {')', 's', 0x208e},
+ {'L', 'i', 0x20a4},
+ {'P', 't', 0x20a7},
+ {'W', '=', 0x20a9},
+ {'o', 'C', 0x2103},
+ {'c', 'o', 0x2105},
+ {'o', 'F', 0x2109},
+ {'N', '0', 0x2116},
+ {'P', 'O', 0x2117},
+ {'R', 'x', 0x211e},
+ {'S', 'M', 0x2120},
+ {'T', 'M', 0x2122},
+ {'O', 'm', 0x2126},
+ {'A', 'O', 0x212b},
+ {'1', '3', 0x2153},
+ {'2', '3', 0x2154},
+ {'1', '5', 0x2155},
+ {'2', '5', 0x2156},
+ {'3', '5', 0x2157},
+ {'4', '5', 0x2158},
+ {'1', '6', 0x2159},
+ {'5', '6', 0x215a},
+ {'1', '8', 0x215b},
+ {'3', '8', 0x215c},
+ {'5', '8', 0x215d},
+ {'7', '8', 0x215e},
+ {'1', 'R', 0x2160},
+ {'2', 'R', 0x2161},
+ {'3', 'R', 0x2162},
+ {'4', 'R', 0x2163},
+ {'5', 'R', 0x2164},
+ {'6', 'R', 0x2165},
+ {'7', 'R', 0x2166},
+ {'8', 'R', 0x2167},
+ {'9', 'R', 0x2168},
+ {'a', 'R', 0x2169},
+ {'b', 'R', 0x216a},
+ {'c', 'R', 0x216b},
+ {'1', 'r', 0x2170},
+ {'2', 'r', 0x2171},
+ {'3', 'r', 0x2172},
+ {'4', 'r', 0x2173},
+ {'5', 'r', 0x2174},
+ {'6', 'r', 0x2175},
+ {'7', 'r', 0x2176},
+ {'8', 'r', 0x2177},
+ {'9', 'r', 0x2178},
+ {'a', 'r', 0x2179},
+ {'b', 'r', 0x217a},
+ {'c', 'r', 0x217b},
+ {'<', '-', 0x2190},
+ {'-', '!', 0x2191},
+ {'-', '>', 0x2192},
+ {'-', 'v', 0x2193},
+ {'<', '>', 0x2194},
+ {'U', 'D', 0x2195},
+ {'<', '=', 0x21d0},
+ {'=', '>', 0x21d2},
+ {'=', '=', 0x21d4},
+ {'F', 'A', 0x2200},
+ {'d', 'P', 0x2202},
+ {'T', 'E', 0x2203},
+ {'/', '0', 0x2205},
+ {'D', 'E', 0x2206},
+ {'N', 'B', 0x2207},
+ {'(', '-', 0x2208},
+ {'-', ')', 0x220b},
+ {'*', 'P', 0x220f},
+ {'+', 'Z', 0x2211},
+ {'-', '2', 0x2212},
+ {'-', '+', 0x2213},
+ {'*', '-', 0x2217},
+ {'O', 'b', 0x2218},
+ {'S', 'b', 0x2219},
+ {'R', 'T', 0x221a},
+ {'0', '(', 0x221d},
+ {'0', '0', 0x221e},
+ {'-', 'L', 0x221f},
+ {'-', 'V', 0x2220},
+ {'P', 'P', 0x2225},
+ {'A', 'N', 0x2227},
+ {'O', 'R', 0x2228},
+ {'(', 'U', 0x2229},
+ {')', 'U', 0x222a},
+ {'I', 'n', 0x222b},
+ {'D', 'I', 0x222c},
+ {'I', 'o', 0x222e},
+ {'.', ':', 0x2234},
+ {':', '.', 0x2235},
+ {':', 'R', 0x2236},
+ {':', ':', 0x2237},
+ {'?', '1', 0x223c},
+ {'C', 'G', 0x223e},
+ {'?', '-', 0x2243},
+ {'?', '=', 0x2245},
+ {'?', '2', 0x2248},
+ {'=', '?', 0x224c},
+ {'H', 'I', 0x2253},
+ {'!', '=', 0x2260},
+ {'=', '3', 0x2261},
+ {'=', '<', 0x2264},
+ {'>', '=', 0x2265},
+ {'<', '*', 0x226a},
+ {'*', '>', 0x226b},
+ {'!', '<', 0x226e},
+ {'!', '>', 0x226f},
+ {'(', 'C', 0x2282},
+ {')', 'C', 0x2283},
+ {'(', '_', 0x2286},
+ {')', '_', 0x2287},
+ {'0', '.', 0x2299},
+ {'0', '2', 0x229a},
+ {'-', 'T', 0x22a5},
+ {'.', 'P', 0x22c5},
+ {':', '3', 0x22ee},
+ {'.', '3', 0x22ef},
+ {'E', 'h', 0x2302},
+ {'<', '7', 0x2308},
+ {'>', '7', 0x2309},
+ {'7', '<', 0x230a},
+ {'7', '>', 0x230b},
+ {'N', 'I', 0x2310},
+ {'(', 'A', 0x2312},
+ {'T', 'R', 0x2315},
+ {'I', 'u', 0x2320},
+ {'I', 'l', 0x2321},
+ {'<', '/', 0x2329},
+ {'/', '>', 0x232a},
+ {'V', 's', 0x2423},
+ {'1', 'h', 0x2440},
+ {'3', 'h', 0x2441},
+ {'2', 'h', 0x2442},
+ {'4', 'h', 0x2443},
+ {'1', 'j', 0x2446},
+ {'2', 'j', 0x2447},
+ {'3', 'j', 0x2448},
+ {'4', 'j', 0x2449},
+ {'1', '.', 0x2488},
+ {'2', '.', 0x2489},
+ {'3', '.', 0x248a},
+ {'4', '.', 0x248b},
+ {'5', '.', 0x248c},
+ {'6', '.', 0x248d},
+ {'7', '.', 0x248e},
+ {'8', '.', 0x248f},
+ {'9', '.', 0x2490},
+ {'h', 'h', 0x2500},
+ {'H', 'H', 0x2501},
+ {'v', 'v', 0x2502},
+ {'V', 'V', 0x2503},
+ {'3', '-', 0x2504},
+ {'3', '_', 0x2505},
+ {'3', '!', 0x2506},
+ {'3', '/', 0x2507},
+ {'4', '-', 0x2508},
+ {'4', '_', 0x2509},
+ {'4', '!', 0x250a},
+ {'4', '/', 0x250b},
+ {'d', 'r', 0x250c},
+ {'d', 'R', 0x250d},
+ {'D', 'r', 0x250e},
+ {'D', 'R', 0x250f},
+ {'d', 'l', 0x2510},
+ {'d', 'L', 0x2511},
+ {'D', 'l', 0x2512},
+ {'L', 'D', 0x2513},
+ {'u', 'r', 0x2514},
+ {'u', 'R', 0x2515},
+ {'U', 'r', 0x2516},
+ {'U', 'R', 0x2517},
+ {'u', 'l', 0x2518},
+ {'u', 'L', 0x2519},
+ {'U', 'l', 0x251a},
+ {'U', 'L', 0x251b},
+ {'v', 'r', 0x251c},
+ {'v', 'R', 0x251d},
+ {'V', 'r', 0x2520},
+ {'V', 'R', 0x2523},
+ {'v', 'l', 0x2524},
+ {'v', 'L', 0x2525},
+ {'V', 'l', 0x2528},
+ {'V', 'L', 0x252b},
+ {'d', 'h', 0x252c},
+ {'d', 'H', 0x252f},
+ {'D', 'h', 0x2530},
+ {'D', 'H', 0x2533},
+ {'u', 'h', 0x2534},
+ {'u', 'H', 0x2537},
+ {'U', 'h', 0x2538},
+ {'U', 'H', 0x253b},
+ {'v', 'h', 0x253c},
+ {'v', 'H', 0x253f},
+ {'V', 'h', 0x2542},
+ {'V', 'H', 0x254b},
+ {'F', 'D', 0x2571},
+ {'B', 'D', 0x2572},
+ {'T', 'B', 0x2580},
+ {'L', 'B', 0x2584},
+ {'F', 'B', 0x2588},
+ {'l', 'B', 0x258c},
+ {'R', 'B', 0x2590},
+ {'.', 'S', 0x2591},
+ {':', 'S', 0x2592},
+ {'?', 'S', 0x2593},
+ {'f', 'S', 0x25a0},
+ {'O', 'S', 0x25a1},
+ {'R', 'O', 0x25a2},
+ {'R', 'r', 0x25a3},
+ {'R', 'F', 0x25a4},
+ {'R', 'Y', 0x25a5},
+ {'R', 'H', 0x25a6},
+ {'R', 'Z', 0x25a7},
+ {'R', 'K', 0x25a8},
+ {'R', 'X', 0x25a9},
+ {'s', 'B', 0x25aa},
+ {'S', 'R', 0x25ac},
+ {'O', 'r', 0x25ad},
+ {'U', 'T', 0x25b2},
+ {'u', 'T', 0x25b3},
+ {'P', 'R', 0x25b6},
+ {'T', 'r', 0x25b7},
+ {'D', 't', 0x25bc},
+ {'d', 'T', 0x25bd},
+ {'P', 'L', 0x25c0},
+ {'T', 'l', 0x25c1},
+ {'D', 'b', 0x25c6},
+ {'D', 'w', 0x25c7},
+ {'L', 'Z', 0x25ca},
+ {'0', 'm', 0x25cb},
+ {'0', 'o', 0x25ce},
+ {'0', 'M', 0x25cf},
+ {'0', 'L', 0x25d0},
+ {'0', 'R', 0x25d1},
+ {'S', 'n', 0x25d8},
+ {'I', 'c', 0x25d9},
+ {'F', 'd', 0x25e2},
+ {'B', 'd', 0x25e3},
+ {'*', '2', 0x2605},
+ {'*', '1', 0x2606},
+ {'<', 'H', 0x261c},
+ {'>', 'H', 0x261e},
+ {'0', 'u', 0x263a},
+ {'0', 'U', 0x263b},
+ {'S', 'U', 0x263c},
+ {'F', 'm', 0x2640},
+ {'M', 'l', 0x2642},
+ {'c', 'S', 0x2660},
+ {'c', 'H', 0x2661},
+ {'c', 'D', 0x2662},
+ {'c', 'C', 0x2663},
+ {'M', 'd', 0x2669},
+ {'M', '8', 0x266a},
+ {'M', '2', 0x266b},
+ {'M', 'b', 0x266d},
+ {'M', 'x', 0x266e},
+ {'M', 'X', 0x266f},
+ {'O', 'K', 0x2713},
+ {'X', 'X', 0x2717},
+ {'-', 'X', 0x2720},
+ {'I', 'S', 0x3000},
+ {',', '_', 0x3001},
+ {'.', '_', 0x3002},
+ {'+', '"', 0x3003},
+ {'+', '_', 0x3004},
+ {'*', '_', 0x3005},
+ {';', '_', 0x3006},
+ {'0', '_', 0x3007},
+ {'<', '+', 0x300a},
+ {'>', '+', 0x300b},
+ {'<', '\'', 0x300c},
+ {'>', '\'', 0x300d},
+ {'<', '"', 0x300e},
+ {'>', '"', 0x300f},
+ {'(', '"', 0x3010},
+ {')', '"', 0x3011},
+ {'=', 'T', 0x3012},
+ {'=', '_', 0x3013},
+ {'(', '\'', 0x3014},
+ {')', '\'', 0x3015},
+ {'(', 'I', 0x3016},
+ {')', 'I', 0x3017},
+ {'-', '?', 0x301c},
+ {'A', '5', 0x3041},
+ {'a', '5', 0x3042},
+ {'I', '5', 0x3043},
+ {'i', '5', 0x3044},
+ {'U', '5', 0x3045},
+ {'u', '5', 0x3046},
+ {'E', '5', 0x3047},
+ {'e', '5', 0x3048},
+ {'O', '5', 0x3049},
+ {'o', '5', 0x304a},
+ {'k', 'a', 0x304b},
+ {'g', 'a', 0x304c},
+ {'k', 'i', 0x304d},
+ {'g', 'i', 0x304e},
+ {'k', 'u', 0x304f},
+ {'g', 'u', 0x3050},
+ {'k', 'e', 0x3051},
+ {'g', 'e', 0x3052},
+ {'k', 'o', 0x3053},
+ {'g', 'o', 0x3054},
+ {'s', 'a', 0x3055},
+ {'z', 'a', 0x3056},
+ {'s', 'i', 0x3057},
+ {'z', 'i', 0x3058},
+ {'s', 'u', 0x3059},
+ {'z', 'u', 0x305a},
+ {'s', 'e', 0x305b},
+ {'z', 'e', 0x305c},
+ {'s', 'o', 0x305d},
+ {'z', 'o', 0x305e},
+ {'t', 'a', 0x305f},
+ {'d', 'a', 0x3060},
+ {'t', 'i', 0x3061},
+ {'d', 'i', 0x3062},
+ {'t', 'U', 0x3063},
+ {'t', 'u', 0x3064},
+ {'d', 'u', 0x3065},
+ {'t', 'e', 0x3066},
+ {'d', 'e', 0x3067},
+ {'t', 'o', 0x3068},
+ {'d', 'o', 0x3069},
+ {'n', 'a', 0x306a},
+ {'n', 'i', 0x306b},
+ {'n', 'u', 0x306c},
+ {'n', 'e', 0x306d},
+ {'n', 'o', 0x306e},
+ {'h', 'a', 0x306f},
+ {'b', 'a', 0x3070},
+ {'p', 'a', 0x3071},
+ {'h', 'i', 0x3072},
+ {'b', 'i', 0x3073},
+ {'p', 'i', 0x3074},
+ {'h', 'u', 0x3075},
+ {'b', 'u', 0x3076},
+ {'p', 'u', 0x3077},
+ {'h', 'e', 0x3078},
+ {'b', 'e', 0x3079},
+ {'p', 'e', 0x307a},
+ {'h', 'o', 0x307b},
+ {'b', 'o', 0x307c},
+ {'p', 'o', 0x307d},
+ {'m', 'a', 0x307e},
+ {'m', 'i', 0x307f},
+ {'m', 'u', 0x3080},
+ {'m', 'e', 0x3081},
+ {'m', 'o', 0x3082},
+ {'y', 'A', 0x3083},
+ {'y', 'a', 0x3084},
+ {'y', 'U', 0x3085},
+ {'y', 'u', 0x3086},
+ {'y', 'O', 0x3087},
+ {'y', 'o', 0x3088},
+ {'r', 'a', 0x3089},
+ {'r', 'i', 0x308a},
+ {'r', 'u', 0x308b},
+ {'r', 'e', 0x308c},
+ {'r', 'o', 0x308d},
+ {'w', 'A', 0x308e},
+ {'w', 'a', 0x308f},
+ {'w', 'i', 0x3090},
+ {'w', 'e', 0x3091},
+ {'w', 'o', 0x3092},
+ {'n', '5', 0x3093},
+ {'v', 'u', 0x3094},
+ {'"', '5', 0x309b},
+ {'0', '5', 0x309c},
+ {'*', '5', 0x309d},
+ {'+', '5', 0x309e},
+ {'a', '6', 0x30a1},
+ {'A', '6', 0x30a2},
+ {'i', '6', 0x30a3},
+ {'I', '6', 0x30a4},
+ {'u', '6', 0x30a5},
+ {'U', '6', 0x30a6},
+ {'e', '6', 0x30a7},
+ {'E', '6', 0x30a8},
+ {'o', '6', 0x30a9},
+ {'O', '6', 0x30aa},
+ {'K', 'a', 0x30ab},
+ {'G', 'a', 0x30ac},
+ {'K', 'i', 0x30ad},
+ {'G', 'i', 0x30ae},
+ {'K', 'u', 0x30af},
+ {'G', 'u', 0x30b0},
+ {'K', 'e', 0x30b1},
+ {'G', 'e', 0x30b2},
+ {'K', 'o', 0x30b3},
+ {'G', 'o', 0x30b4},
+ {'S', 'a', 0x30b5},
+ {'Z', 'a', 0x30b6},
+ {'S', 'i', 0x30b7},
+ {'Z', 'i', 0x30b8},
+ {'S', 'u', 0x30b9},
+ {'Z', 'u', 0x30ba},
+ {'S', 'e', 0x30bb},
+ {'Z', 'e', 0x30bc},
+ {'S', 'o', 0x30bd},
+ {'Z', 'o', 0x30be},
+ {'T', 'a', 0x30bf},
+ {'D', 'a', 0x30c0},
+ {'T', 'i', 0x30c1},
+ {'D', 'i', 0x30c2},
+ {'T', 'U', 0x30c3},
+ {'T', 'u', 0x30c4},
+ {'D', 'u', 0x30c5},
+ {'T', 'e', 0x30c6},
+ {'D', 'e', 0x30c7},
+ {'T', 'o', 0x30c8},
+ {'D', 'o', 0x30c9},
+ {'N', 'a', 0x30ca},
+ {'N', 'i', 0x30cb},
+ {'N', 'u', 0x30cc},
+ {'N', 'e', 0x30cd},
+ {'N', 'o', 0x30ce},
+ {'H', 'a', 0x30cf},
+ {'B', 'a', 0x30d0},
+ {'P', 'a', 0x30d1},
+ {'H', 'i', 0x30d2},
+ {'B', 'i', 0x30d3},
+ {'P', 'i', 0x30d4},
+ {'H', 'u', 0x30d5},
+ {'B', 'u', 0x30d6},
+ {'P', 'u', 0x30d7},
+ {'H', 'e', 0x30d8},
+ {'B', 'e', 0x30d9},
+ {'P', 'e', 0x30da},
+ {'H', 'o', 0x30db},
+ {'B', 'o', 0x30dc},
+ {'P', 'o', 0x30dd},
+ {'M', 'a', 0x30de},
+ {'M', 'i', 0x30df},
+ {'M', 'u', 0x30e0},
+ {'M', 'e', 0x30e1},
+ {'M', 'o', 0x30e2},
+ {'Y', 'A', 0x30e3},
+ {'Y', 'a', 0x30e4},
+ {'Y', 'U', 0x30e5},
+ {'Y', 'u', 0x30e6},
+ {'Y', 'O', 0x30e7},
+ {'Y', 'o', 0x30e8},
+ {'R', 'a', 0x30e9},
+ {'R', 'i', 0x30ea},
+ {'R', 'u', 0x30eb},
+ {'R', 'e', 0x30ec},
+ {'R', 'o', 0x30ed},
+ {'W', 'A', 0x30ee},
+ {'W', 'a', 0x30ef},
+ {'W', 'i', 0x30f0},
+ {'W', 'e', 0x30f1},
+ {'W', 'o', 0x30f2},
+ {'N', '6', 0x30f3},
+ {'V', 'u', 0x30f4},
+ {'K', 'A', 0x30f5},
+ {'K', 'E', 0x30f6},
+ {'V', 'a', 0x30f7},
+ {'V', 'i', 0x30f8},
+ {'V', 'e', 0x30f9},
+ {'V', 'o', 0x30fa},
+ {'.', '6', 0x30fb},
+ {'-', '6', 0x30fc},
+ {'*', '6', 0x30fd},
+ {'+', '6', 0x30fe},
+ {'b', '4', 0x3105},
+ {'p', '4', 0x3106},
+ {'m', '4', 0x3107},
+ {'f', '4', 0x3108},
+ {'d', '4', 0x3109},
+ {'t', '4', 0x310a},
+ {'n', '4', 0x310b},
+ {'l', '4', 0x310c},
+ {'g', '4', 0x310d},
+ {'k', '4', 0x310e},
+ {'h', '4', 0x310f},
+ {'j', '4', 0x3110},
+ {'q', '4', 0x3111},
+ {'x', '4', 0x3112},
+ {'z', 'h', 0x3113},
+ {'c', 'h', 0x3114},
+ {'s', 'h', 0x3115},
+ {'r', '4', 0x3116},
+ {'z', '4', 0x3117},
+ {'c', '4', 0x3118},
+ {'s', '4', 0x3119},
+ {'a', '4', 0x311a},
+ {'o', '4', 0x311b},
+ {'e', '4', 0x311c},
+ {'a', 'i', 0x311e},
+ {'e', 'i', 0x311f},
+ {'a', 'u', 0x3120},
+ {'o', 'u', 0x3121},
+ {'a', 'n', 0x3122},
+ {'e', 'n', 0x3123},
+ {'a', 'N', 0x3124},
+ {'e', 'N', 0x3125},
+ {'e', 'r', 0x3126},
+ {'i', '4', 0x3127},
+ {'u', '4', 0x3128},
+ {'i', 'u', 0x3129},
+ {'v', '4', 0x312a},
+ {'n', 'G', 0x312b},
+ {'g', 'n', 0x312c},
+ {'1', 'c', 0x3220},
+ {'2', 'c', 0x3221},
+ {'3', 'c', 0x3222},
+ {'4', 'c', 0x3223},
+ {'5', 'c', 0x3224},
+ {'6', 'c', 0x3225},
+ {'7', 'c', 0x3226},
+ {'8', 'c', 0x3227},
+ {'9', 'c', 0x3228},
+ {' ', ' ', 0xe000},
+ {'/', 'c', 0xe001},
+ {'U', 'A', 0xe002},
+ {'U', 'B', 0xe003},
+ {'"', '3', 0xe004},
+ {'"', '1', 0xe005},
+ {'"', '!', 0xe006},
+ {'"', '\'', 0xe007},
+ {'"', '>', 0xe008},
+ {'"', '?', 0xe009},
+ {'"', '-', 0xe00a},
+ {'"', '(', 0xe00b},
+ {'"', '.', 0xe00c},
+ {'"', ':', 0xe00d},
+ {'"', '0', 0xe00e},
+ {'"', '"', 0xe00f},
+ {'"', '<', 0xe010},
+ {'"', ',', 0xe011},
+ {'"', ';', 0xe012},
+ {'"', '_', 0xe013},
+ {'"', '=', 0xe014},
+ {'"', '/', 0xe015},
+ {'"', 'i', 0xe016},
+ {'"', 'd', 0xe017},
+ {'"', 'p', 0xe018},
+ {';', ';', 0xe019},
+ {',', ',', 0xe01a},
+ {'b', '3', 0xe01b},
+ {'C', 'i', 0xe01c},
+ {'f', '(', 0xe01d},
+ {'e', 'd', 0xe01e},
+ {'a', 'm', 0xe01f},
+ {'p', 'm', 0xe020},
+ {'F', 'l', 0xe023},
+ {'G', 'F', 0xe024},
+ {'>', 'V', 0xe025},
+ {'!', '*', 0xe026},
+ {'?', '*', 0xe027},
+ {'J', '<', 0xe028},
+ {'f', 'f', 0xfb00},
+ {'f', 'i', 0xfb01},
+ {'f', 'l', 0xfb02},
+ {'f', 't', 0xfb05},
+ {'s', 't', 0xfb06},
+# endif /* FEAT_MBYTE */
+ {NUL, NUL, NUL}
+ };
+
+# endif /* OLD_DIGRAPHS */
+
+# endif /* Macintosh */
+# endif /* EBCDIC */
+# endif /* !HPUX_DIGRAPHS */
+# endif /* !__MINT__ */
+#endif /* !MSDOS && !OS2 */
+
+/*
+ * handle digraphs after typing a character
+ */
+ int
+do_digraph(c)
+ int c;
+{
+ static int backspaced; /* character before K_BS */
+ static int lastchar; /* last typed character */
+
+ if (c == -1) /* init values */
+ {
+ backspaced = -1;
+ }
+ else if (p_dg)
+ {
+ if (backspaced >= 0)
+ c = getdigraph(backspaced, c, FALSE);
+ backspaced = -1;
+ if ((c == K_BS || c == Ctrl_H) && lastchar >= 0)
+ backspaced = lastchar;
+ }
+ lastchar = c;
+ return c;
+}
+
+/*
+ * Get a digraph. Used after typing CTRL-K on the command line or in normal
+ * mode.
+ * Returns composed character, or NUL when ESC was used.
+ */
+ int
+get_digraph(cmdline)
+ int cmdline; /* TRUE when called from the cmdline */
+{
+ int c, cc;
+
+ ++no_mapping;
+ ++allow_keys;
+ c = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (c != ESC) /* ESC cancels CTRL-K */
+ {
+ if (IS_SPECIAL(c)) /* insert special key code */
+ return c;
+ if (cmdline)
+ {
+ if (char2cells(c) == 1
+#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+ && cmdline_star == 0
+#endif
+ )
+ putcmdline(c, TRUE);
+ }
+#ifdef FEAT_CMDL_INFO
+ else
+ add_to_showcmd(c);
+#endif
+ ++no_mapping;
+ ++allow_keys;
+ cc = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (cc != ESC) /* ESC cancels CTRL-K */
+ return getdigraph(c, cc, TRUE);
+ }
+ return NUL;
+}
+
+/*
+ * Lookup the pair "char1", "char2" in the digraph tables.
+ * If no match, return "char2".
+ * If "meta" is TRUE and "char1" is a space, return "char2" | 0x80.
+ */
+ static int
+getexactdigraph(char1, char2, meta)
+ int char1;
+ int char2;
+ int meta;
+{
+ int i;
+ int retval = 0;
+ digr_T *dp;
+
+ if (IS_SPECIAL(char1) || IS_SPECIAL(char2))
+ return char2;
+
+ /*
+ * Search user digraphs first.
+ */
+ dp = (digr_T *)user_digraphs.ga_data;
+ for (i = 0; i < user_digraphs.ga_len; ++i)
+ {
+ if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
+ {
+ retval = dp->result;
+ break;
+ }
+ ++dp;
+ }
+
+ /*
+ * Search default digraphs.
+ */
+ if (retval == 0)
+ {
+ dp = digraphdefault;
+ for (i = 0; dp->char1 != 0; ++i)
+ {
+ if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
+ {
+ retval = dp->result;
+ break;
+ }
+ ++dp;
+ }
+ }
+#ifdef FEAT_MBYTE
+# ifdef USE_UNICODE_DIGRAPHS
+ if (retval != 0 && !enc_utf8)
+ {
+ char_u buf[6], *to;
+ vimconv_T vc;
+
+ /*
+ * Convert the Unicode digraph to 'encoding'.
+ */
+ i = utf_char2bytes(retval, buf);
+ retval = 0;
+ vc.vc_type = CONV_NONE;
+ if (convert_setup(&vc, (char_u *)"utf-8", p_enc) == OK)
+ {
+ vc.vc_fail = TRUE;
+ to = string_convert(&vc, buf, &i);
+ if (to != NULL)
+ {
+ retval = (*mb_ptr2char)(to);
+ vim_free(to);
+ }
+ (void)convert_setup(&vc, NULL, NULL);
+ }
+ }
+# endif
+
+ /* Ignore multi-byte characters when not in multi-byte mode. */
+ if (!has_mbyte && retval > 0xff)
+ retval = 0;
+#endif
+
+ if (retval == 0) /* digraph deleted or not found */
+ {
+ if (char1 == ' ' && meta) /* <space> <char> --> meta-char */
+ return (char2 | 0x80);
+ return char2;
+ }
+ return retval;
+}
+
+/*
+ * Get digraph.
+ * Allow for both char1-char2 and char2-char1
+ */
+ int
+getdigraph(char1, char2, meta)
+ int char1;
+ int char2;
+ int meta;
+{
+ int retval;
+
+ if (((retval = getexactdigraph(char1, char2, meta)) == char2)
+ && (char1 != char2)
+ && ((retval = getexactdigraph(char2, char1, meta)) == char1))
+ return char2;
+ return retval;
+}
+
+/*
+ * Add the digraphs in the argument to the digraph table.
+ * format: {c1}{c2} char {c1}{c2} char ...
+ */
+ void
+putdigraph(str)
+ char_u *str;
+{
+ int char1, char2, n;
+ int i;
+ digr_T *dp;
+
+ while (*str != NUL)
+ {
+ str = skipwhite(str);
+ if (*str == NUL)
+ return;
+ char1 = *str++;
+ char2 = *str++;
+ if (char2 == 0)
+ {
+ EMSG(_(e_invarg));
+ return;
+ }
+ if (char1 == ESC || char2 == ESC)
+ {
+ EMSG(_("E104: Escape not allowed in digraph"));
+ return;
+ }
+ str = skipwhite(str);
+ if (!VIM_ISDIGIT(*str))
+ {
+ EMSG(_(e_number_exp));
+ return;
+ }
+ n = getdigits(&str);
+
+ /* If the digraph already exists, replace the result. */
+ dp = (digr_T *)user_digraphs.ga_data;
+ for (i = 0; i < user_digraphs.ga_len; ++i)
+ {
+ if ((int)dp->char1 == char1 && (int)dp->char2 == char2)
+ {
+ dp->result = n;
+ break;
+ }
+ ++dp;
+ }
+
+ /* Add a new digraph to the table. */
+ if (i == user_digraphs.ga_len)
+ {
+ if (ga_grow(&user_digraphs, 1) == OK)
+ {
+ dp = (digr_T *)user_digraphs.ga_data + user_digraphs.ga_len;
+ dp->char1 = char1;
+ dp->char2 = char2;
+ dp->result = n;
+ ++user_digraphs.ga_len;
+ --user_digraphs.ga_room;
+ }
+ }
+ }
+}
+
+ void
+listdigraphs()
+{
+ int i;
+ digr_T *dp;
+
+ msg_putchar('\n');
+
+ dp = digraphdefault;
+ for (i = 0; dp->char1 != NUL && !got_int; ++i)
+ {
+#if defined(USE_UNICODE_DIGRAPHS) && defined(FEAT_MBYTE)
+ digr_T tmp;
+
+ /* May need to convert the result to 'encoding'. */
+ tmp.char1 = dp->char1;
+ tmp.char2 = dp->char2;
+ tmp.result = getexactdigraph(tmp.char1, tmp.char2, FALSE);
+ if (tmp.result != 0 && tmp.result != tmp.char2
+ && (has_mbyte || tmp.result <= 255))
+ printdigraph(&tmp);
+#else
+
+ if (getexactdigraph(dp->char1, dp->char2, FALSE) == dp->result
+# ifdef FEAT_MBYTE
+ && (has_mbyte || dp->result <= 255)
+# endif
+ )
+ printdigraph(dp);
+#endif
+ ++dp;
+ ui_breakcheck();
+ }
+
+ dp = (digr_T *)user_digraphs.ga_data;
+ for (i = 0; i < user_digraphs.ga_len && !got_int; ++i)
+ {
+ printdigraph(dp);
+ ui_breakcheck();
+ ++dp;
+ }
+ must_redraw = CLEAR; /* clear screen, because some digraphs may be
+ wrong, in which case we messed up ScreenLines */
+}
+
+ static void
+printdigraph(dp)
+ digr_T *dp;
+{
+ char_u buf[30];
+ char_u *p;
+
+ int list_width;
+
+ if ((dy_flags & DY_UHEX)
+#ifdef FEAT_MBYTE
+ || has_mbyte
+#endif
+ )
+ list_width = 13;
+ else
+ list_width = 11;
+
+ if (dp->result != 0)
+ {
+ if (msg_col > Columns - list_width)
+ msg_putchar('\n');
+ if (msg_col)
+ while (msg_col % list_width != 0)
+ msg_putchar(' ');
+
+ p = buf;
+ *p++ = dp->char1;
+ *p++ = dp->char2;
+ *p++ = ' ';
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* add a space to draw a composing char on */
+ if (enc_utf8 && utf_iscomposing(dp->result))
+ *p++ = ' ';
+ p += (*mb_char2bytes)(dp->result, p);
+ }
+ else
+#endif
+ *p++ = dp->result;
+ if (char2cells(dp->result) == 1)
+ *p++ = ' ';
+ sprintf((char *)p, " %3d", dp->result);
+ msg_outtrans(buf);
+ }
+}
+
+#endif /* FEAT_DIGRAPHS */
+
+#if defined(FEAT_KEYMAP) || defined(PROTO)
+
+/* structure used for b_kmap_ga.ga_data */
+typedef struct
+{
+ char_u *from;
+ char_u *to;
+} kmap_T;
+
+#define KMAP_MAXLEN 20 /* maximum length of "from" or "to" */
+
+static void keymap_unload __ARGS((void));
+
+/*
+ * Set up key mapping tables for the 'keymap' option
+ */
+ char_u *
+keymap_init()
+{
+ curbuf->b_kmap_state &= ~KEYMAP_INIT;
+
+ if (*curbuf->b_p_keymap == NUL)
+ {
+ /* Stop any active keymap and clear the table. */
+ keymap_unload();
+ }
+ else
+ {
+ char_u *buf;
+
+ /* Source the keymap file. It will contain a ":loadkeymap" command
+ * which will call ex_loadkeymap() below. */
+ buf = alloc((unsigned)(STRLEN(curbuf->b_p_keymap)
+# ifdef FEAT_MBYTE
+ + STRLEN(p_enc)
+# endif
+ + 14));
+ if (buf == NULL)
+ return e_outofmem;
+
+# ifdef FEAT_MBYTE
+ /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */
+ sprintf((char *)buf, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc);
+ if (cmd_runtime(buf, FALSE) == FAIL)
+# endif
+ {
+ /* try finding "keymap/'keymap'.vim" in 'runtimepath' */
+ sprintf((char *)buf, "keymap/%s.vim", curbuf->b_p_keymap);
+ if (cmd_runtime(buf, FALSE) == FAIL)
+ {
+ vim_free(buf);
+ return (char_u *)N_("E544: Keymap file not found");
+ }
+ }
+ vim_free(buf);
+ }
+
+ return NULL;
+}
+
+/*
+ * ":loadkeymap" command: load the following lines as the keymap.
+ */
+ void
+ex_loadkeymap(eap)
+ exarg_T *eap;
+{
+ char_u *line;
+ char_u *p;
+ char_u *s;
+ kmap_T *kp;
+#define KMAP_LLEN 200 /* max length of "to" and "from" together */
+ char_u buf[KMAP_LLEN + 11];
+ int i;
+ char_u *save_cpo = p_cpo;
+
+ if (!getline_equal(eap->getline, eap->cookie, getsourceline))
+ {
+ EMSG(_("E105: Using :loadkeymap not in a sourced file"));
+ return;
+ }
+
+ /*
+ * Stop any active keymap and clear the table.
+ */
+ keymap_unload();
+
+ curbuf->b_kmap_state = 0;
+ ga_init2(&curbuf->b_kmap_ga, (int)sizeof(kmap_T), 20);
+
+ /* Set 'cpoptions' to "C" to avoid line continuation. */
+ p_cpo = (char_u *)"C";
+
+ /*
+ * Get each line of the sourced file, break at the end.
+ */
+ for (;;)
+ {
+ line = eap->getline(0, eap->cookie, 0);
+ if (line == NULL)
+ break;
+
+ p = skipwhite(line);
+ if (*p != '"' && *p != NUL && ga_grow(&curbuf->b_kmap_ga, 1) == OK)
+ {
+ kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
+ s = skiptowhite(p);
+ kp->from = vim_strnsave(p, (int)(s - p));
+ p = skipwhite(s);
+ s = skiptowhite(p);
+ kp->to = vim_strnsave(p, (int)(s - p));
+
+ if (kp->from == NULL || kp->to == NULL
+ || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN)
+ {
+ vim_free(kp->from);
+ vim_free(kp->to);
+ }
+ else
+ {
+ ++curbuf->b_kmap_ga.ga_len;
+ --curbuf->b_kmap_ga.ga_room;
+ }
+ }
+ vim_free(line);
+ }
+
+ /*
+ * setup ":lnoremap" to map the keys
+ */
+ for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
+ {
+ sprintf((char *)buf, "<buffer> %s %s",
+ ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from,
+ ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].to);
+ (void)do_map(2, buf, LANGMAP, FALSE);
+ }
+
+ p_cpo = save_cpo;
+
+ curbuf->b_kmap_state |= KEYMAP_LOADED;
+#ifdef FEAT_WINDOWS
+ status_redraw_curbuf();
+#endif
+}
+
+/*
+ * Stop using 'keymap'.
+ */
+ static void
+keymap_unload()
+{
+ char_u buf[KMAP_MAXLEN + 10];
+ int i;
+ char_u *save_cpo = p_cpo;
+
+ if (!(curbuf->b_kmap_state & KEYMAP_LOADED))
+ return;
+
+ /* Set 'cpoptions' to "C" to avoid line continuation. */
+ p_cpo = (char_u *)"C";
+
+ /* clear the ":lmap"s */
+ for (i = 0; i < curbuf->b_kmap_ga.ga_len; ++i)
+ {
+ sprintf((char *)buf, "<buffer> %s",
+ ((kmap_T *)curbuf->b_kmap_ga.ga_data)[i].from);
+ (void)do_map(1, buf, LANGMAP, FALSE);
+ }
+
+ p_cpo = save_cpo;
+
+ ga_clear(&curbuf->b_kmap_ga);
+ curbuf->b_kmap_state &= ~KEYMAP_LOADED;
+#ifdef FEAT_WINDOWS
+ status_redraw_curbuf();
+#endif
+}
+
+#endif /* FEAT_KEYMAP */
+
diff --git a/src/dimm.idl b/src/dimm.idl
new file mode 100644
index 000000000..ac449650e
--- /dev/null
+++ b/src/dimm.idl
@@ -0,0 +1,544 @@
+//+-------------------------------------------------------------------------
+//
+// Microsoft Windows
+// Copyright (C) Microsoft Corporation, 1992-2000.
+//
+// File: dimm.idl
+//
+// Contents: ActiveIMM interface definitions
+//
+//
+//--------------------------------------------------------------------------
+
+cpp_quote("//=--------------------------------------------------------------------------=")
+cpp_quote("// dimm.h")
+cpp_quote("//=--------------------------------------------------------------------------=")
+cpp_quote("// (C) Copyright 1995-1998 Microsoft Corporation. All Rights Reserved.")
+cpp_quote("//")
+cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
+cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
+cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
+cpp_quote("// PARTICULAR PURPOSE.")
+cpp_quote("//=--------------------------------------------------------------------------=")
+cpp_quote("")
+cpp_quote("#pragma comment(lib,\"uuid.lib\")")
+cpp_quote("")
+cpp_quote("//--------------------------------------------------------------------------")
+cpp_quote("// IActiveIMM Interfaces.")
+cpp_quote("")
+
+/*
+Disable a warning about lack of polymorphic type support for the following reasons
+- the only reason to have library block in the file is to make midl accept coclass
+ statement and generate CLSID for CActiveIMM.
+- the generated dimm_i.c has the clsid and that file is used to have clsid available
+- the dimm.tlb is not used at all
+- on top of it, there is no plans to port the app using dimm.idl to 64b platform.
+*/
+/*
+ * midl_pragma is unsupported in midl version 3.01 shipped with VC5.0.
+ * It is supported in midl version 5.01 shipped with VC6.0
+ * I could not produce message 2395. Is this needed? W.Briscoe 2001-08-14
+ */
+#if (__midl >= 501)
+midl_pragma warning( disable: 2395) // polymorphic types not supported in the TLB
+#endif
+
+#ifndef DO_NO_IMPORTS
+import "unknwn.idl";
+#endif
+
+[
+ uuid(4955DD30-B159-11d0-8FCF-00AA006BCC59),
+ helpstring("ActiveIMM"),
+ lcid(0x0000),
+ version(0.1)
+]
+library ActiveIMM
+{
+ importlib("stdole2.tlb");
+
+ cpp_quote("#include <imm.h>")
+
+ cpp_quote("#if 0")
+
+ typedef WORD LANGID;
+
+ typedef struct
+ {
+ LPSTR lpReading;
+ LPSTR lpWord;
+ } REGISTERWORDA;
+
+ typedef struct
+ {
+ LPWSTR lpReading;
+ LPWSTR lpWord;
+ } REGISTERWORDW;
+
+ #define LF_FACESIZE 32
+
+ typedef struct
+ {
+ LONG lfHeight;
+ LONG lfWidth;
+ LONG lfEscapement;
+ LONG lfOrientation;
+ LONG lfWeight;
+ BYTE lfItalic;
+ BYTE lfUnderline;
+ BYTE lfStrikeOut;
+ BYTE lfCharSet;
+ BYTE lfOutPrecision;
+ BYTE lfClipPrecision;
+ BYTE lfQuality;
+ BYTE lfPitchAndFamily;
+ CHAR lfFaceName[LF_FACESIZE];
+ } LOGFONTA;
+
+ typedef struct
+ {
+ LONG lfHeight;
+ LONG lfWidth;
+ LONG lfEscapement;
+ LONG lfOrientation;
+ LONG lfWeight;
+ BYTE lfItalic;
+ BYTE lfUnderline;
+ BYTE lfStrikeOut;
+ BYTE lfCharSet;
+ BYTE lfOutPrecision;
+ BYTE lfClipPrecision;
+ BYTE lfQuality;
+ BYTE lfPitchAndFamily;
+ WCHAR lfFaceName[LF_FACESIZE];
+ } LOGFONTW;
+
+ typedef DWORD HIMC;
+ typedef DWORD HIMCC;
+
+ typedef struct
+ {
+ DWORD dwIndex;
+ DWORD dwStyle;
+ POINT ptCurrentPos;
+ RECT rcArea;
+ } CANDIDATEFORM;
+
+ typedef struct
+ {
+ DWORD dwStyle;
+ POINT ptCurrentPos;
+ RECT rcArea;
+ } COMPOSITIONFORM;
+
+ typedef struct
+ {
+ DWORD dwSize;
+ DWORD dwStyle;
+ DWORD dwCount;
+ DWORD dwSelection;
+ DWORD dwPageStart;
+ DWORD dwPageSize;
+ DWORD dwOffset[1];
+ } CANDIDATELIST;
+
+ #define STYLE_DESCRIPTION_SIZE 32
+
+ typedef struct
+ {
+ DWORD dwStyle;
+ CHAR szDescription[STYLE_DESCRIPTION_SIZE];
+ } STYLEBUFA;
+
+ typedef struct
+ {
+ DWORD dwStyle;
+ WCHAR szDescription[STYLE_DESCRIPTION_SIZE];
+ } STYLEBUFW;
+
+ typedef WORD ATOM;
+
+ cpp_quote("#endif")
+
+ cpp_quote("#if (WINVER < 0x040A)")
+
+ #define IMEMENUITEM_STRING_SIZE 80
+
+ typedef struct
+ {
+ UINT cbSize;
+ UINT fType;
+ UINT fState;
+ UINT wID;
+ HBITMAP hbmpChecked;
+ HBITMAP hbmpUnchecked;
+ DWORD dwItemData;
+ CHAR szString[IMEMENUITEM_STRING_SIZE];
+ HBITMAP hbmpItem;
+ } IMEMENUITEMINFOA;
+
+ typedef struct
+ {
+ UINT cbSize;
+ UINT fType;
+ UINT fState;
+ UINT wID;
+ HBITMAP hbmpChecked;
+ HBITMAP hbmpUnchecked;
+ DWORD dwItemData;
+ WCHAR szString[IMEMENUITEM_STRING_SIZE];
+ HBITMAP hbmpItem;
+ } IMEMENUITEMINFOW;
+
+ cpp_quote("#endif")
+
+ cpp_quote("#ifndef _DDKIMM_H_")
+
+ typedef struct
+ {
+ HWND hWnd;
+ BOOL fOpen;
+ POINT ptStatusWndPos;
+ POINT ptSoftKbdPos;
+ DWORD fdwConversion;
+ DWORD fdwSentence;
+ union
+ {
+ LOGFONTA A;
+ LOGFONTW W;
+ } lfFont;
+ COMPOSITIONFORM cfCompForm;
+ CANDIDATEFORM cfCandForm[4];
+ HIMCC hCompStr;
+ HIMCC hCandInfo;
+ HIMCC hGuideLine;
+ HIMCC hPrivate;
+ DWORD dwNumMsgBuf;
+ HIMCC hMsgBuf;
+ DWORD fdwInit;
+ DWORD dwReserve[3];
+ } INPUTCONTEXT;
+
+ typedef struct
+ {
+ DWORD dwPrivateDataSize;
+ DWORD fdwProperty;
+ DWORD fdwConversionCaps;
+ DWORD fdwSentenceCaps;
+ DWORD fdwUICaps;
+ DWORD fdwSCSCaps;
+ DWORD fdwSelectCaps;
+ } IMEINFO;
+
+ cpp_quote("#endif")
+
+ [
+ object,
+ uuid(08C03412-F96B-11d0-A475-00AA006BCC59),
+ pointer_default(unique)
+ ]
+ interface IEnumRegisterWordA : IUnknown
+ {
+ HRESULT Clone([out] IEnumRegisterWordA **ppEnum);
+ HRESULT Next([in] ULONG ulCount, [out] REGISTERWORDA *rgRegisterWord, [out] ULONG *pcFetched);
+ HRESULT Reset();
+ HRESULT Skip([in] ULONG ulCount);
+ };
+
+ [
+ object,
+ uuid(4955DD31-B159-11d0-8FCF-00AA006BCC59),
+ pointer_default(unique)
+ ]
+ interface IEnumRegisterWordW : IUnknown
+ {
+ HRESULT Clone([out] IEnumRegisterWordW **ppEnum);
+ HRESULT Next([in] ULONG ulCount, [out] REGISTERWORDW *rgRegisterWord, [out] ULONG *pcFetched);
+ HRESULT Reset();
+ HRESULT Skip([in] ULONG ulCount);
+ };
+
+
+ [
+ object,
+ uuid(09b5eab0-f997-11d1-93d4-0060b067b86e),
+ pointer_default(unique)
+ ]
+ interface IEnumInputContext : IUnknown
+ {
+ HRESULT Clone([out] IEnumInputContext **ppEnum);
+ HRESULT Next([in] ULONG ulCount, [out] HIMC *rgInputContext, [out] ULONG *pcFetched);
+ HRESULT Reset();
+ HRESULT Skip([in] ULONG ulCount);
+ };
+
+
+ [
+ object,
+ uuid(b3458082-bd00-11d1-939b-0060b067b86e),
+ pointer_default(unique)
+ ]
+ interface IActiveIMMRegistrar : IUnknown
+ {
+ HRESULT RegisterIME([in] REFCLSID rclsid, [in] LANGID lgid, [in] LPCWSTR pszIconFile, [in] LPCWSTR pszDesc);
+ HRESULT UnregisterIME([in] REFCLSID rclsid);
+ };
+
+ [
+ object,
+ uuid(b5cf2cfa-8aeb-11d1-9364-0060b067b86e),
+ pointer_default(unique)
+ ]
+ interface IActiveIMMMessagePumpOwner : IUnknown
+ {
+ HRESULT Start();
+ HRESULT End();
+ HRESULT OnTranslateMessage([in] const MSG *pMsg);
+ HRESULT Pause([out] DWORD *pdwCookie);
+ HRESULT Resume([in] DWORD dwCookie);
+ }
+
+ [
+ object,
+ uuid(08c0e040-62d1-11d1-9326-0060b067b86e),
+ pointer_default(unique)
+ ]
+ interface IActiveIMMApp : IUnknown
+ {
+ HRESULT AssociateContext([in] HWND hWnd, [in] HIMC hIME, [out] HIMC *phPrev);
+ HRESULT ConfigureIMEA([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDA *pData);
+ HRESULT ConfigureIMEW([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pData);
+ HRESULT CreateContext([out] HIMC *phIMC);
+ HRESULT DestroyContext([in] HIMC hIME);
+ HRESULT EnumRegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordA **pEnum);
+ HRESULT EnumRegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **pEnum);
+ HRESULT EscapeA([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult);
+ HRESULT EscapeW([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult);
+ HRESULT GetCandidateListA([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied);
+ HRESULT GetCandidateListW([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied);
+ HRESULT GetCandidateListCountA([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen);
+ HRESULT GetCandidateListCountW([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen);
+ HRESULT GetCandidateWindow([in] HIMC hIMC, [in] DWORD dwIndex, [out] CANDIDATEFORM *pCandidate);
+ HRESULT GetCompositionFontA([in] HIMC hIMC, [out] LOGFONTA *plf);
+ HRESULT GetCompositionFontW([in] HIMC hIMC, [out] LOGFONTW *plf);
+ HRESULT GetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf);
+ HRESULT GetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf);
+ HRESULT GetCompositionWindow([in] HIMC hIMC, [out] COMPOSITIONFORM *pCompForm);
+ HRESULT GetContext([in] HWND hWnd, [out] HIMC *phIMC);
+ HRESULT GetConversionListA([in] HKL hKL, [in] HIMC hIMC, [in] LPSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied);
+ HRESULT GetConversionListW([in] HKL hKL, [in] HIMC hIMC, [in] LPWSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied);
+ HRESULT GetConversionStatus([in] HIMC hIMC, [out] DWORD *pfdwConversion, [out] DWORD *pfdwSentence);
+ HRESULT GetDefaultIMEWnd([in] HWND hWnd, [out] HWND *phDefWnd);
+ HRESULT GetDescriptionA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szDescription, [out] UINT *puCopied);
+ HRESULT GetDescriptionW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szDescription, [out] UINT *puCopied);
+ HRESULT GetGuideLineA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPSTR pBuf, [out] DWORD *pdwResult);
+ HRESULT GetGuideLineW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPWSTR pBuf, [out] DWORD *pdwResult);
+ HRESULT GetIMEFileNameA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szFileName, [out] UINT *puCopied);
+ HRESULT GetIMEFileNameW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szFileName, [out] UINT *puCopied);
+ HRESULT GetOpenStatus([in] HIMC hIMC);
+ HRESULT GetProperty([in] HKL hKL, [in] DWORD fdwIndex, [out] DWORD *pdwProperty);
+ HRESULT GetRegisterWordStyleA([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFA *pStyleBuf, [out] UINT *puCopied);
+ HRESULT GetRegisterWordStyleW([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puCopied);
+ HRESULT GetStatusWindowPos([in] HIMC hIMC, [out] POINT *pptPos);
+ HRESULT GetVirtualKey([in] HWND hWnd, [out] UINT *puVirtualKey);
+ HRESULT InstallIMEA([in] LPSTR szIMEFileName, [in] LPSTR szLayoutText, [out] HKL *phKL);
+ HRESULT InstallIMEW([in] LPWSTR szIMEFileName, [in] LPWSTR szLayoutText, [out] HKL *phKL);
+ HRESULT IsIME([in] HKL hKL);
+ HRESULT IsUIMessageA([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam);
+ HRESULT IsUIMessageW([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam);
+ HRESULT NotifyIME([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue);
+ HRESULT RegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister);
+ HRESULT RegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister);
+ HRESULT ReleaseContext([in] HWND hWnd, [in] HIMC hIMC);
+ HRESULT SetCandidateWindow([in] HIMC hIMC, [in] CANDIDATEFORM *pCandidate);
+ HRESULT SetCompositionFontA([in] HIMC hIMC, [in] LOGFONTA *plf);
+ HRESULT SetCompositionFontW([in] HIMC hIMC, [in] LOGFONTW *plf);
+ HRESULT SetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen);
+ HRESULT SetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen);
+ HRESULT SetCompositionWindow([in] HIMC hIMC, [in] COMPOSITIONFORM *pCompForm);
+ HRESULT SetConversionStatus([in] HIMC hIMC, [in] DWORD fdwConversion, [in] DWORD fdwSentence);
+ HRESULT SetOpenStatus([in] HIMC hIMC, [in] BOOL fOpen);
+ HRESULT SetStatusWindowPos([in] HIMC hIMC, [in] POINT *pptPos);
+ HRESULT SimulateHotKey([in] HWND hWnd, [in] DWORD dwHotKeyID);
+ HRESULT UnregisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szUnregister);
+ HRESULT UnregisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szUnregister);
+
+ HRESULT Activate([in] BOOL fRestoreLayout);
+ HRESULT Deactivate();
+
+ HRESULT OnDefWindowProc([in] HWND hWnd, [in] UINT Msg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult);
+
+ HRESULT FilterClientWindows([in] ATOM *aaClassList, [in] UINT uSize);
+
+ HRESULT GetCodePageA([in] HKL hKL, [out] UINT *uCodePage);
+ HRESULT GetLangId([in] HKL hKL, [out] LANGID *plid);
+
+ // win98/nt5 apis
+ HRESULT AssociateContextEx([in] HWND hWnd, [in] HIMC hIMC, [in] DWORD dwFlags);
+ HRESULT DisableIME([in] DWORD idThread);
+ HRESULT GetImeMenuItemsA([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOA *pImeParentMenu, [out] IMEMENUITEMINFOA *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult);
+ HRESULT GetImeMenuItemsW([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOW *pImeParentMenu, [out] IMEMENUITEMINFOW *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult);
+ HRESULT EnumInputContext([in] DWORD idThread, [out] IEnumInputContext **ppEnum);
+ };
+
+ [
+ object,
+ uuid(08C03411-F96B-11d0-A475-00AA006BCC59),
+ pointer_default(unique)
+ ]
+ interface IActiveIMMIME : IUnknown
+ {
+ HRESULT AssociateContext([in] HWND hWnd, [in] HIMC hIME, [out] HIMC *phPrev);
+ HRESULT ConfigureIMEA([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDA *pData);
+ HRESULT ConfigureIMEW([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pData);
+ HRESULT CreateContext([out] HIMC *phIMC);
+ HRESULT DestroyContext([in] HIMC hIME);
+ HRESULT EnumRegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordA **pEnum);
+ HRESULT EnumRegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **pEnum);
+ HRESULT EscapeA([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult);
+ HRESULT EscapeW([in] HKL hKL, [in] HIMC hIMC, [in] UINT uEscape, [in, out] LPVOID pData, [out] LRESULT *plResult);
+ HRESULT GetCandidateListA([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied);
+ HRESULT GetCandidateListW([in] HIMC hIMC, [in] DWORD dwIndex, [in] UINT uBufLen, [out] CANDIDATELIST *pCandList, [out] UINT *puCopied);
+ HRESULT GetCandidateListCountA([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen);
+ HRESULT GetCandidateListCountW([in] HIMC hIMC, [out] DWORD *pdwListSize, [out] DWORD *pdwBufLen);
+ HRESULT GetCandidateWindow([in] HIMC hIMC, [in] DWORD dwIndex, [out] CANDIDATEFORM *pCandidate);
+ HRESULT GetCompositionFontA([in] HIMC hIMC, [out] LOGFONTA *plf);
+ HRESULT GetCompositionFontW([in] HIMC hIMC, [out] LOGFONTW *plf);
+ HRESULT GetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf);
+ HRESULT GetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LONG *plCopied, [out] LPVOID pBuf);
+ HRESULT GetCompositionWindow([in] HIMC hIMC, [out] COMPOSITIONFORM *pCompForm);
+ HRESULT GetContext([in] HWND hWnd, [out] HIMC *phIMC);
+ HRESULT GetConversionListA([in] HKL hKL, [in] HIMC hIMC, [in] LPSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied);
+ HRESULT GetConversionListW([in] HKL hKL, [in] HIMC hIMC, [in] LPWSTR pSrc, [in] UINT uBufLen, [in] UINT uFlag, [out] CANDIDATELIST *pDst, [out] UINT *puCopied);
+ HRESULT GetConversionStatus([in] HIMC hIMC, [out] DWORD *pfdwConversion, [out] DWORD *pfdwSentence);
+ HRESULT GetDefaultIMEWnd([in] HWND hWnd, [out] HWND *phDefWnd);
+ HRESULT GetDescriptionA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szDescription, [out] UINT *puCopied);
+ HRESULT GetDescriptionW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szDescription, [out] UINT *puCopied);
+ HRESULT GetGuideLineA([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPSTR pBuf, [out] DWORD *pdwResult);
+ HRESULT GetGuideLineW([in] HIMC hIMC, [in] DWORD dwIndex, [in] DWORD dwBufLen, [out] LPWSTR pBuf, [out] DWORD *pdwResult);
+ HRESULT GetIMEFileNameA([in] HKL hKL, [in] UINT uBufLen, [out] LPSTR szFileName, [out] UINT *puCopied);
+ HRESULT GetIMEFileNameW([in] HKL hKL, [in] UINT uBufLen, [out] LPWSTR szFileName, [out] UINT *puCopied);
+ HRESULT GetOpenStatus([in] HIMC hIMC);
+ HRESULT GetProperty([in] HKL hKL, [in] DWORD fdwIndex, [out] DWORD *pdwProperty);
+ HRESULT GetRegisterWordStyleA([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFA *pStyleBuf, [out] UINT *puCopied);
+ HRESULT GetRegisterWordStyleW([in] HKL hKL, [in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puCopied);
+ HRESULT GetStatusWindowPos([in] HIMC hIMC, [out] POINT *pptPos);
+ HRESULT GetVirtualKey([in] HWND hWnd, [out] UINT *puVirtualKey);
+ HRESULT InstallIMEA([in] LPSTR szIMEFileName, [in] LPSTR szLayoutText, [out] HKL *phKL);
+ HRESULT InstallIMEW([in] LPWSTR szIMEFileName, [in] LPWSTR szLayoutText, [out] HKL *phKL);
+ HRESULT IsIME([in] HKL hKL);
+ HRESULT IsUIMessageA([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam);
+ HRESULT IsUIMessageW([in] HWND hWndIME, [in] UINT msg, [in] WPARAM wParam, [in] LPARAM lParam);
+ HRESULT NotifyIME([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue);
+ HRESULT RegisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szRegister);
+ HRESULT RegisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister);
+ HRESULT ReleaseContext([in] HWND hWnd, [in] HIMC hIMC);
+ HRESULT SetCandidateWindow([in] HIMC hIMC, [in] CANDIDATEFORM *pCandidate);
+ HRESULT SetCompositionFontA([in] HIMC hIMC, [in] LOGFONTA *plf);
+ HRESULT SetCompositionFontW([in] HIMC hIMC, [in] LOGFONTW *plf);
+ HRESULT SetCompositionStringA([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen);
+ HRESULT SetCompositionStringW([in] HIMC hIMC, [in] DWORD dwIndex, [in] LPVOID pComp, [in] DWORD dwCompLen, [in] LPVOID pRead, [in] DWORD dwReadLen);
+ HRESULT SetCompositionWindow([in] HIMC hIMC, [in] COMPOSITIONFORM *pCompForm);
+ HRESULT SetConversionStatus([in] HIMC hIMC, [in] DWORD fdwConversion, [in] DWORD fdwSentence);
+ HRESULT SetOpenStatus([in] HIMC hIMC, [in] BOOL fOpen);
+ HRESULT SetStatusWindowPos([in] HIMC hIMC, [in] POINT *pptPos);
+ HRESULT SimulateHotKey([in] HWND hWnd, [in] DWORD dwHotKeyID);
+ HRESULT UnregisterWordA([in] HKL hKL, [in] LPSTR szReading, [in] DWORD dwStyle, [in] LPSTR szUnregister);
+ HRESULT UnregisterWordW([in] HKL hKL, [in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szUnregister);
+
+ // ime helper methods
+ HRESULT GenerateMessage([in] HIMC hIMC);
+
+ // HIMC and HIMCC management api's
+ HRESULT LockIMC([in] HIMC hIMC, [out] INPUTCONTEXT **ppIMC);
+ HRESULT UnlockIMC([in] HIMC hIMC);
+ HRESULT GetIMCLockCount([in] HIMC hIMC, [out] DWORD *pdwLockCount);
+ HRESULT CreateIMCC([in] DWORD dwSize, [out] HIMCC *phIMCC);
+ HRESULT DestroyIMCC([in] HIMCC hIMCC);
+ HRESULT LockIMCC([in] HIMCC hIMCC, [out] void **ppv);
+ HRESULT UnlockIMCC([in] HIMCC hIMCC);
+ HRESULT ReSizeIMCC([in] HIMCC hIMCC, [in] DWORD dwSize, [out] HIMCC *phIMCC);
+ HRESULT GetIMCCSize([in] HIMCC hIMCC, [out] DWORD *pdwSize);
+ HRESULT GetIMCCLockCount([in] HIMCC hIMCC, [out] DWORD *pdwLockCount);
+
+ // hot key manipulation api's
+ HRESULT GetHotKey([in] DWORD dwHotKeyID, [out] UINT *puModifiers, [out] UINT *puVKey, [out] HKL *phKL);
+ HRESULT SetHotKey([in] DWORD dwHotKeyID, [in] UINT uModifiers, [in] UINT uVKey, [in] HKL hKL);
+
+ // soft keyboard api's
+ HRESULT CreateSoftKeyboard([in] UINT uType, [in] HWND hOwner, [in] int x, [in] int y, [out] HWND *phSoftKbdWnd);
+ HRESULT DestroySoftKeyboard([in] HWND hSoftKbdWnd);
+ HRESULT ShowSoftKeyboard([in] HWND hSoftKbdWnd, [in] int nCmdShow);
+
+ HRESULT GetCodePageA([in] HKL hKL, [out] UINT *uCodePage);
+ HRESULT GetLangId([in] HKL hKL, [out] LANGID *plid);
+
+ HRESULT KeybdEvent([in] LANGID lgidIME, [in] BYTE bVk, [in] BYTE bScan, [in] DWORD dwFlags, [in] DWORD dwExtraInfo);
+
+ HRESULT LockModal();
+ HRESULT UnlockModal();
+
+ // win98/nt5 apis
+ HRESULT AssociateContextEx([in] HWND hWnd, [in] HIMC hIMC, [in] DWORD dwFlags);
+ HRESULT DisableIME([in] DWORD idThread);
+ HRESULT GetImeMenuItemsA([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOA *pImeParentMenu, [out] IMEMENUITEMINFOA *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult);
+ HRESULT GetImeMenuItemsW([in] HIMC hIMC, [in] DWORD dwFlags, [in] DWORD dwType, [in] IMEMENUITEMINFOW *pImeParentMenu, [out] IMEMENUITEMINFOW *pImeMenu, [in] DWORD dwSize, [out] DWORD *pdwResult);
+ HRESULT EnumInputContext([in] DWORD idThread, [out] IEnumInputContext **ppEnum);
+ HRESULT RequestMessageA([in] HIMC hIMC, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult);
+ HRESULT RequestMessageW([in] HIMC hIMC, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult);
+
+ HRESULT SendIMCA([in] HWND hWnd, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult);
+ HRESULT SendIMCW([in] HWND hWnd, [in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult);
+
+ HRESULT IsSleeping();
+ };
+
+ [
+ object,
+ uuid(6FE20962-D077-11d0-8FE7-00AA006BCC59),
+ pointer_default(unique)
+ ]
+ interface IActiveIME : IUnknown
+ {
+ HRESULT Inquire([in] DWORD dwSystemInfoFlags, [out] IMEINFO *pIMEInfo, [out] LPWSTR szWndClass, [out] DWORD *pdwPrivate);
+ HRESULT ConversionList([in] HIMC hIMC, [in] LPWSTR szSource, [in] UINT uFlag, [in] UINT uBufLen, [out] CANDIDATELIST *pDest, [out] UINT *puCopied);
+ HRESULT Configure([in] HKL hKL, [in] HWND hWnd, [in] DWORD dwMode, [in] REGISTERWORDW *pRegisterWord);
+ HRESULT Destroy([in] UINT uReserved);
+ HRESULT Escape([in] HIMC hIMC, [in] UINT uEscape, [in, out] void *pData, [out] LRESULT *plResult);
+ HRESULT SetActiveContext([in] HIMC hIMC, [in] BOOL fFlag);
+ HRESULT ProcessKey([in] HIMC hIMC, [in] UINT uVirKey, [in] DWORD lParam, [in] BYTE *pbKeyState);
+ HRESULT Notify([in] HIMC hIMC, [in] DWORD dwAction, [in] DWORD dwIndex, [in] DWORD dwValue);
+ HRESULT Select([in] HIMC hIMC, [in] BOOL fSelect);
+ HRESULT SetCompositionString([in] HIMC hIMC, [in] DWORD dwIndex, [in] void *pComp, [in] DWORD dwCompLen, [in] void *pRead, [in] DWORD dwReadLen);
+ HRESULT ToAsciiEx([in] UINT uVirKey, [in] UINT uScanCode, [in] BYTE *pbKeyState, [in] UINT fuState, [in] HIMC hIMC, [out] DWORD *pdwTransBuf, [out] UINT *puSize);
+ HRESULT RegisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szString);
+ HRESULT UnregisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szString);
+ HRESULT GetRegisterWordStyle([in] UINT nItem, [out] STYLEBUFW *pStyleBuf, [out] UINT *puBufSize);
+ HRESULT EnumRegisterWord([in] LPWSTR szReading, [in] DWORD dwStyle, [in] LPWSTR szRegister, [in] LPVOID pData, [out] IEnumRegisterWordW **ppEnum);
+ HRESULT GetCodePageA([out] UINT *uCodePage);
+ HRESULT GetLangId([out] LANGID *plid);
+ };
+
+ [
+ object,
+ uuid(e1c4bf0e-2d53-11d2-93e1-0060b067b86e),
+ pointer_default(unique)
+ ]
+ interface IActiveIME2 : IActiveIME
+ {
+ HRESULT Sleep();
+ HRESULT Unsleep([in] BOOL fDead);
+ };
+
+ [
+ uuid(4955DD33-B159-11d0-8FCF-00AA006BCC59),
+ ]
+ coclass CActiveIMM
+ {
+ [default] interface IActiveIMMApp;
+ interface IActiveIMMIME;
+ interface IActiveIMMRegistrar;
+ interface IActiveIMMMessagePumpOwner;
+ };
+}
diff --git a/src/dlldata.c b/src/dlldata.c
new file mode 100644
index 000000000..d03124cff
--- /dev/null
+++ b/src/dlldata.c
@@ -0,0 +1,38 @@
+/*********************************************************
+ DllData file -- generated by MIDL compiler
+
+ DO NOT ALTER THIS FILE
+
+ This file is regenerated by MIDL on every IDL file compile.
+
+ To completely reconstruct this file, delete it and rerun MIDL
+ on all the IDL files in this DLL, specifying this file for the
+ /dlldata command line option
+
+*********************************************************/
+
+#define PROXY_DELEGATION
+
+#include <rpcproxy.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EXTERN_PROXY_FILE( if_ole )
+
+
+PROXYFILE_LIST_START
+/* Start of list */
+ REFERENCE_PROXY_FILE( if_ole ),
+/* End of list */
+PROXYFILE_LIST_END
+
+
+DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
+
+#ifdef __cplusplus
+} /*extern "C" */
+#endif
+
+/* end of generated dlldata file */
diff --git a/src/dosinst.c b/src/dosinst.c
new file mode 100644
index 000000000..deaf15f7a
--- /dev/null
+++ b/src/dosinst.c
@@ -0,0 +1,2461 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * dosinst.c: Install program for Vim on MS-DOS and MS-Windows
+ *
+ * Compile with Make_mvc.mak, Make_bc3.mak, Make_bc5.mak or Make_djg.mak.
+ */
+
+/*
+ * Include common code for dosinst.c and uninstal.c.
+ */
+#define DOSINST
+#include "dosinst.h"
+
+/* Macro to do an error check I was typing over and over */
+#define CHECK_REG_ERROR(code) if (code != ERROR_SUCCESS) { printf("%ld error number: %ld\n", (long)__LINE__, (long)code); return 1; }
+
+int has_vim = 0; /* installable vim.exe exists */
+int has_gvim = 0; /* installable gvim.exe exists */
+
+char oldvimrc[BUFSIZE]; /* name of existing vimrc file */
+char vimrc[BUFSIZE]; /* name of vimrc file to create */
+
+char *default_bat_dir = NULL; /* when not NULL, use this as the default
+ directory to write .bat files in */
+char *default_vim_dir = NULL; /* when not NULL, use this as the default
+ install dir for NSIS */
+#if 0
+char homedir[BUFSIZE]; /* home directory or "" */
+#endif
+
+/*
+ * Structure used for each choice the user can make.
+ */
+struct choice
+{
+ int active; /* non-zero when choice is active */
+ char *text; /* text displayed for this choice */
+ void (*changefunc)(int idx); /* function to change this choice */
+ int arg; /* argument for function */
+ void (*installfunc)(int idx); /* function to install this choice */
+};
+
+struct choice choices[30]; /* choices the user can make */
+int choice_count = 0; /* number of choices available */
+
+#define TABLE_SIZE(s) (int)(sizeof(s) / sizeof(*s))
+
+enum
+{
+ compat_vi = 1,
+ compat_some_enhancements,
+ compat_all_enhancements
+};
+char *(compat_choices[]) =
+{
+ "\nChoose the default way to run Vim:",
+ "Vi compatible",
+ "with some Vim ehancements",
+ "with syntax highlighting and other features switched on",
+};
+int compat_choice = (int)compat_all_enhancements;
+char *compat_text = "- run Vim %s";
+
+enum
+{
+ remap_no = 1,
+ remap_win
+};
+char *(remap_choices[]) =
+{
+ "\nChoose:",
+ "Do not remap keys for Windows behavior",
+ "Remap a few keys for Windows behavior (<C-V>, <C-C>, etc)",
+};
+int remap_choice = (int)remap_win;
+char *remap_text = "- %s";
+
+enum
+{
+ mouse_xterm = 1,
+ mouse_mswin
+};
+char *(mouse_choices[]) =
+{
+ "\nChoose the way how Vim uses the mouse:",
+ "right button extends selection (the Unix way)",
+ "right button has a popup menu (the Windows way)",
+};
+int mouse_choice = (int)mouse_mswin;
+char *mouse_text = "- The mouse %s";
+
+enum
+{
+ vimfiles_dir_none = 1,
+ vimfiles_dir_vim,
+ vimfiles_dir_home
+};
+static char *(vimfiles_dir_choices[]) =
+{
+ "\nCreate plugin directories:",
+ "No",
+ "In the VIM directory",
+ "In your HOME directory",
+};
+static int vimfiles_dir_choice;
+
+/* non-zero when selected to install the popup menu entry. */
+static int install_popup = 0;
+
+/* non-zero when selected to install the "Open with" entry. */
+static int install_openwith = 0;
+
+/* non-zero when need to add an uninstall entry in the registry */
+static int need_uninstall_entry = 0;
+
+/*
+ * Definitions of the directory name (under $VIM) of the vimfiles directory
+ * and its subdirectories:
+ */
+static char *(vimfiles_subdirs[]) =
+{
+ "colors",
+ "compiler",
+ "doc",
+ "ftdetect",
+ "ftplugin",
+ "indent",
+ "keymap",
+ "plugin",
+ "syntax",
+};
+
+/*
+ * Copy a directory name from "dir" to "buf", doubling backslashes.
+ * Also make sure it ends in a double backslash.
+ */
+ static void
+double_bs(char *dir, char *buf)
+{
+ char *d = buf;
+ char *s;
+
+ for (s = dir; *s; ++s)
+ {
+ if (*s == '\\')
+ *d++ = '\\';
+ *d++ = *s;
+ }
+ /* when dir is not empty, it must end in a double backslash */
+ if (d > buf && d[-1] != '\\')
+ {
+ *d++ = '\\';
+ *d++ = '\\';
+ }
+ *d = NUL;
+}
+
+/*
+ * Obtain a choice from a table.
+ * First entry is a question, others are choices.
+ */
+ static int
+get_choice(char **table, int entries)
+{
+ int answer;
+ int idx;
+ char dummy[100];
+
+ do
+ {
+ for (idx = 0; idx < entries; ++idx)
+ {
+ if (idx)
+ printf("%2d ", idx);
+ printf(table[idx]);
+ printf("\n");
+ }
+ printf("Choice: ");
+ if (scanf("%d", &answer) != 1)
+ {
+ scanf("%99s", dummy);
+ answer = 0;
+ }
+ }
+ while (answer < 1 || answer >= entries);
+
+ return answer;
+}
+
+/*
+ * Check if the user unpacked the archives properly.
+ * Sets "runtimeidx".
+ */
+ static void
+check_unpack(void)
+{
+ char buf[BUFSIZE];
+ FILE *fd;
+ struct stat st;
+
+ /* check for presence of the correct version number in installdir[] */
+ runtimeidx = strlen(installdir) - strlen(VIM_VERSION_NODOT);
+ if (runtimeidx <= 0
+ || stricmp(installdir + runtimeidx, VIM_VERSION_NODOT) != 0
+ || (installdir[runtimeidx - 1] != '/'
+ && installdir[runtimeidx - 1] != '\\'))
+ {
+ printf("ERROR: Install program not in directory \"%s\"\n",
+ VIM_VERSION_NODOT);
+ printf("This program can only work when it is located in its original directory\n");
+ myexit(1);
+ }
+
+ /* check if filetype.vim is present, which means the runtime archive has
+ * been unpacked */
+ sprintf(buf, "%s\\filetype.vim", installdir);
+ if (stat(buf, &st) < 0)
+ {
+ printf("ERROR: Cannot find filetype.vim in \"%s\"\n", installdir);
+ printf("It looks like you did not unpack the runtime archive.\n");
+ printf("You must unpack the runtime archive \"vim%srt.zip\" before installing.\n",
+ VIM_VERSION_NODOT + 3);
+ myexit(1);
+ }
+
+ /* Check if vim.exe or gvim.exe is in the current directory. */
+ if ((fd = fopen("gvim.exe", "r")) != NULL)
+ {
+ fclose(fd);
+ has_gvim = 1;
+ }
+ if ((fd = fopen("vim.exe", "r")) != NULL)
+ {
+ fclose(fd);
+ has_vim = 1;
+ }
+ if (!has_gvim && !has_vim)
+ {
+ printf("ERROR: Cannot find any Vim executables in \"%s\"\n\n",
+ installdir);
+ myexit(1);
+ }
+}
+
+/*
+ * Compare paths "p[plen]" to "q[qlen]". Return 0 if they match.
+ * Ignores case and differences between '/' and '\'.
+ * "plen" and "qlen" can be negative, strlen() is used then.
+ */
+ static int
+pathcmp(char *p, int plen, char *q, int qlen)
+{
+ int i;
+
+ if (plen < 0)
+ plen = strlen(p);
+ if (qlen < 0)
+ qlen = strlen(q);
+ for (i = 0; ; ++i)
+ {
+ /* End of "p": check if "q" also ends or just has a slash. */
+ if (i == plen)
+ {
+ if (i == qlen) /* match */
+ return 0;
+ if (i == qlen - 1 && (q[i] == '\\' || q[i] == '/'))
+ return 0; /* match with trailing slash */
+ return 1; /* no match */
+ }
+
+ /* End of "q": check if "p" also ends or just has a slash. */
+ if (i == qlen)
+ {
+ if (i == plen) /* match */
+ return 0;
+ if (i == plen - 1 && (p[i] == '\\' || p[i] == '/'))
+ return 0; /* match with trailing slash */
+ return 1; /* no match */
+ }
+
+ if (!(mytoupper(p[i]) == mytoupper(q[i])
+ || ((p[i] == '/' || p[i] == '\\')
+ && (q[i] == '/' || q[i] == '\\'))))
+ return 1; /* no match */
+ }
+ /*NOTREACHED*/
+}
+
+/*
+ * If the executable "**destination" is in the install directory, find another
+ * one in $PATH.
+ * On input "**destination" is the path of an executable in allocated memory
+ * (or NULL).
+ * "*destination" is set to NULL or the location of the file.
+ */
+ static void
+findoldfile(char **destination)
+{
+ char *bp = *destination;
+ size_t indir_l = strlen(installdir);
+ char *cp = bp + indir_l;
+ char *tmpname;
+ char *farname;
+
+ /*
+ * No action needed if exe not found or not in this directory.
+ */
+ if (bp == NULL
+ || strnicmp(bp, installdir, indir_l) != 0
+ || strchr("/\\", *cp++) == NULL
+ || strchr(cp, '\\') != NULL
+ || strchr(cp, '/') != NULL)
+ return;
+
+ tmpname = alloc((int)strlen(cp) + 1);
+ strcpy(tmpname, cp);
+ tmpname[strlen(tmpname) - 1] = 'x'; /* .exe -> .exx */
+
+ if (access(tmpname, 0) == 0)
+ {
+ printf("\nERROR: %s and %s clash. Remove or rename %s.\n",
+ tmpname, cp, tmpname);
+ myexit(1);
+ }
+
+ if (rename(cp, tmpname) != 0)
+ {
+ printf("\nERROR: failed to rename %s to %s: %s\n",
+ cp, tmpname, strerror(0));
+ myexit(1);
+ }
+
+ farname = searchpath_save(cp);
+
+ if (rename(tmpname, cp) != 0)
+ {
+ printf("\nERROR: failed to rename %s back to %s: %s\n",
+ tmpname, cp, strerror(0));
+ myexit(1);
+ }
+
+ free(*destination);
+ free(tmpname);
+ *destination = farname;
+}
+
+/*
+ * Check if there is a vim.[exe|bat|, gvim.[exe|bat|, etc. in the path.
+ * When "check_bat_only" is TRUE, only find "default_bat_dir".
+ */
+ static void
+find_bat_exe(int check_bat_only)
+{
+ int i;
+
+ mch_chdir(sysdrive); /* avoid looking in the "installdir" */
+
+ for (i = 1; i < TARGET_COUNT; ++i)
+ {
+ targets[i].oldbat = searchpath_save(targets[i].batname);
+ if (!check_bat_only)
+ targets[i].oldexe = searchpath_save(targets[i].exename);
+
+ if (default_bat_dir == NULL && targets[i].oldbat != NULL)
+ {
+ default_bat_dir = alloc(strlen(targets[i].oldbat) + 1);
+ strcpy(default_bat_dir, targets[i].oldbat);
+ remove_tail(default_bat_dir);
+ }
+ if (check_bat_only && targets[i].oldbat != NULL)
+ free(targets[i].oldbat);
+ }
+
+ mch_chdir(installdir);
+}
+
+#ifdef WIN3264
+/*
+ * Get the value of $VIMRUNTIME or $VIM and write it in $TEMP/vimini.ini, so
+ * that NSIS can read it.
+ * When not set, use the directory of a previously installed Vim.
+ */
+ static void
+get_vim_env(void)
+{
+ char *vim;
+ char buf[BUFSIZE];
+ FILE *fd;
+ char fname[BUFSIZE];
+
+ /* First get $VIMRUNTIME. If it's set, remove the tail. */
+ vim = getenv("VIMRUNTIME");
+ if (vim != NULL && *vim != 0)
+ {
+ strcpy(buf, vim);
+ remove_tail(buf);
+ vim = buf;
+ }
+ else
+ {
+ vim = getenv("VIM");
+ if (vim == NULL || *vim == 0)
+ {
+ /* Use the directory from an old uninstall entry. */
+ if (default_vim_dir != NULL)
+ vim = default_vim_dir;
+ else
+ /* Let NSIS know there is no default, it should use
+ * $PROGRAMFIlES. */
+ vim = "";
+ }
+ }
+
+ /* NSIS also uses GetTempPath(), thus we should get the same directory
+ * name as where NSIS will look for vimini.ini. */
+ GetTempPath(BUFSIZE, fname);
+ add_pathsep(fname);
+ strcat(fname, "vimini.ini");
+
+ fd = fopen(fname, "w");
+ if (fd != NULL)
+ {
+ /* Make it look like an .ini file, so that NSIS can read it with a
+ * ReadINIStr command. */
+ fprintf(fd, "[vimini]\n");
+ fprintf(fd, "dir=\"%s\"\n", vim);
+ fclose(fd);
+ }
+ else
+ {
+ printf("Failed to open %s\n", fname);
+ Sleep(2000);
+ }
+}
+
+/*
+ * Check for already installed Vims.
+ * Return non-zero when found one.
+ */
+ static int
+uninstall_check(void)
+{
+ HKEY key_handle;
+ HKEY uninstall_key_handle;
+ char *uninstall_key = "software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
+ char subkey_name_buff[BUFSIZE];
+ char temp_string_buffer[BUFSIZE];
+ DWORD local_bufsize = BUFSIZE;
+ FILETIME temp_pfiletime;
+ DWORD key_index;
+ char input;
+ long code;
+ DWORD value_type;
+ DWORD orig_num_keys;
+ DWORD new_num_keys;
+ int foundone = 0;
+
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, uninstall_key, 0, KEY_READ,
+ &key_handle);
+ CHECK_REG_ERROR(code);
+
+ for (key_index = 0;
+ RegEnumKeyEx(key_handle, key_index, subkey_name_buff, &local_bufsize,
+ NULL, NULL, NULL, &temp_pfiletime) != ERROR_NO_MORE_ITEMS;
+ key_index++)
+ {
+ local_bufsize = BUFSIZE;
+ if (strncmp("Vim", subkey_name_buff, 3) == 0)
+ {
+ /* Open the key named Vim* */
+ code = RegOpenKeyEx(key_handle, subkey_name_buff, 0, KEY_READ,
+ &uninstall_key_handle);
+ CHECK_REG_ERROR(code);
+
+ /* get the DisplayName out of it to show the user */
+ code = RegQueryValueEx(uninstall_key_handle, "displayname", 0,
+ &value_type, (LPBYTE)temp_string_buffer,
+ &local_bufsize);
+ local_bufsize = BUFSIZE;
+ CHECK_REG_ERROR(code);
+
+ foundone = 1;
+ printf("\n*********************************************************\n");
+ printf("Vim Install found what looks like an existing Vim version.\n");
+ printf("The name of the entry is:\n");
+ printf("\n \"%s\"\n\n", temp_string_buffer);
+
+ printf("Installing the new version will disable part of the existing version.\n");
+ printf("(The batch files used in a console and the \"Edit with Vim\" entry in\n");
+ printf("the popup menu will use the new version)\n");
+
+ printf("\nDo you want to uninstall \"%s\" now?\n(y)es/(n)o) ", temp_string_buffer);
+ fflush(stdout);
+
+ /* get the UninstallString */
+ code = RegQueryValueEx(uninstall_key_handle, "uninstallstring", 0,
+ &value_type, (LPBYTE)temp_string_buffer, &local_bufsize);
+ local_bufsize = BUFSIZE;
+ CHECK_REG_ERROR(code);
+
+ /* Remember the directory, it is used as the default for NSIS. */
+ default_vim_dir = alloc(strlen(temp_string_buffer) + 1);
+ strcpy(default_vim_dir, temp_string_buffer);
+ remove_tail(default_vim_dir);
+ remove_tail(default_vim_dir);
+
+ input = 'n';
+ do
+ {
+ if (input != 'n')
+ printf("%c is an invalid reply. Please enter either 'y' or 'n'\n", input);
+
+ rewind(stdin);
+ scanf("%c", &input);
+ switch (input)
+ {
+ case 'y':
+ case 'Y':
+ /* save the number of uninstall keys so we can know if
+ * it changed */
+ RegQueryInfoKey(key_handle, NULL, NULL, NULL,
+ &orig_num_keys, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL);
+
+ /* Delete the uninstall key. It has no subkeys, so
+ * this is easy. Do this before uninstalling, that
+ * may try to delete the key as well. */
+ RegDeleteKey(key_handle, subkey_name_buff);
+
+ /* Find existing .bat files before deleting them. */
+ find_bat_exe(TRUE);
+
+ /* Execute the uninstall program. Put it in double
+ * quotes if there is an embedded space. */
+ if (strchr(temp_string_buffer, ' ') != NULL)
+ {
+ char buf[BUFSIZE];
+
+ strcpy(buf, temp_string_buffer);
+ sprintf(temp_string_buffer, "\"%s\"", buf);
+ }
+ run_command(temp_string_buffer);
+
+ /* Check if an unistall reg key was deleted.
+ * if it was, we want to decrement key_index.
+ * if we don't do this, we will skip the key
+ * immediately after any key that we delete. */
+ RegQueryInfoKey(key_handle, NULL, NULL, NULL,
+ &new_num_keys, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL);
+ if (new_num_keys < orig_num_keys)
+ key_index--;
+
+ input = 'y';
+ break;
+
+ case 'n':
+ case 'N':
+ /* Do not uninstall */
+ input = 'n';
+ break;
+
+ default: /* just drop through and redo the loop */
+ break;
+ }
+
+ } while (input != 'n' && input != 'y');
+
+ RegCloseKey(uninstall_key_handle);
+ }
+ }
+ RegCloseKey(key_handle);
+
+ return foundone;
+}
+#endif
+
+/*
+ * Find out information about the system.
+ */
+ static void
+inspect_system(void)
+{
+ char *p;
+ char buf[BUFSIZE];
+ FILE *fd;
+ int i;
+ int foundone;
+
+ /* This may take a little while, let the user know what we're doing. */
+ printf("Inspecting system...\n");
+
+ /*
+ * If $VIM is set, check that it's pointing to our directory.
+ */
+ p = getenv("VIM");
+ if (p != NULL && pathcmp(p, -1, installdir, runtimeidx - 1) != 0)
+ {
+ printf("------------------------------------------------------\n");
+ printf("$VIM is set to \"%s\".\n", p);
+ printf("This is different from where this version of Vim is:\n");
+ strcpy(buf, installdir);
+ *(buf + runtimeidx - 1) = NUL;
+ printf("\"%s\"\n", buf);
+ printf("You must adjust or remove the setting of $VIM,\n");
+ if (interactive)
+ {
+ printf("to be able to use this install program.\n");
+ myexit(1);
+ }
+ printf("otherwise Vim WILL NOT WORK properly!\n");
+ printf("------------------------------------------------------\n");
+ }
+
+ /*
+ * If $VIMRUNTIME is set, check that it's pointing to our runtime directory.
+ */
+ p = getenv("VIMRUNTIME");
+ if (p != NULL && pathcmp(p, -1, installdir, -1) != 0)
+ {
+ printf("------------------------------------------------------\n");
+ printf("$VIMRUNTIME is set to \"%s\".\n", p);
+ printf("This is different from where this version of Vim is:\n");
+ printf("\"%s\"\n", installdir);
+ printf("You must adjust or remove the setting of $VIMRUNTIME,\n");
+ if (interactive)
+ {
+ printf("to be able to use this install program.\n");
+ myexit(1);
+ }
+ printf("otherwise Vim WILL NOT WORK properly!\n");
+ printf("------------------------------------------------------\n");
+ }
+
+ /*
+ * Check if there is a vim.[exe|bat|, gvim.[exe|bat|, etc. in the path.
+ */
+ find_bat_exe(FALSE);
+
+ /*
+ * A .exe in the install directory may be found anyway on Windows 2000.
+ * Check for this situation and find another executable if necessary.
+ * w.briscoe@ponl.com 2001-01-20
+ */
+ foundone = 0;
+ for (i = 1; i < TARGET_COUNT; ++i)
+ {
+ findoldfile(&(targets[i].oldexe));
+ if (targets[i].oldexe != NULL)
+ foundone = 1;
+ }
+
+ if (foundone)
+ {
+ printf("Warning: Found Vim executable(s) in your $PATH:\n");
+ for (i = 1; i < TARGET_COUNT; ++i)
+ if (targets[i].oldexe != NULL)
+ printf("%s\n", targets[i].oldexe);
+ printf("It will be used instead of the version you are installing.\n");
+ printf("Please delete or rename it, or adjust your $PATH setting.\n");
+ }
+
+ /*
+ * Check if there is an existing ../_vimrc or ../.vimrc file.
+ */
+ strcpy(oldvimrc, installdir);
+ strcpy(oldvimrc + runtimeidx, "_vimrc");
+ if ((fd = fopen(oldvimrc, "r")) == NULL)
+ {
+ strcpy(oldvimrc + runtimeidx, "vimrc~1"); /* short version of .vimrc */
+ if ((fd = fopen(oldvimrc, "r")) == NULL)
+ {
+ strcpy(oldvimrc + runtimeidx, ".vimrc");
+ fd = fopen(oldvimrc, "r");
+ }
+ }
+ if (fd != NULL)
+ fclose(fd);
+ else
+ *oldvimrc = NUL;
+
+#if 0 /* currently not used */
+ /*
+ * Get default home directory.
+ * Prefer $HOME if it's set. For Win NT use $HOMEDRIVE and $HOMEPATH.
+ * Otherwise, if there is a "c:" drive use that.
+ */
+ p = getenv("HOME");
+ if (p != NULL && *p != NUL && strlen(p) < BUFSIZE)
+ strcpy(homedir, p);
+ else
+ {
+ p = getenv("HOMEDRIVE");
+ if (p != NULL && *p != NUL && strlen(p) + 2 < BUFSIZE)
+ {
+ strcpy(homedir, p);
+ p = getenv("HOMEPATH");
+ if (p != NULL && *p != NUL && strlen(homedir) + strlen(p) < BUFSIZE)
+ strcat(homedir, p);
+ else
+ strcat(homedir, "\\");
+ }
+ else
+ {
+ struct stat st;
+
+ if (stat("c:\\", &st) == 0)
+ strcpy(homedir, "c:\\");
+ else
+ *homedir = NUL;
+ }
+ }
+#endif
+}
+
+/*
+ * Add a dummy choice to avoid that the numbering changes depending on items
+ * in the environment. The user may type a number he remembered without
+ * looking.
+ */
+ static void
+add_dummy_choice(void)
+{
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = 0;
+ choices[choice_count].changefunc = NULL;
+ choices[choice_count].installfunc = NULL;
+ ++choice_count;
+}
+
+/***********************************************
+ * stuff for creating the batch files.
+ */
+
+/*
+ * Install the vim.bat, gvim.bat, etc. files.
+ */
+ static void
+install_bat_choice(int idx)
+{
+ char *batpath = targets[choices[idx].arg].batpath;
+ char *oldname = targets[choices[idx].arg].oldbat;
+ char *exename = targets[choices[idx].arg].exenamearg;
+ char *vimarg = targets[choices[idx].arg].exearg;
+ FILE *fd;
+ char buf[BUFSIZE];
+
+ if (*batpath != NUL)
+ {
+ fd = fopen(batpath, "w");
+ if (fd == NULL)
+ printf("\nERROR: Cannot open \"%s\" for writing.\n", batpath);
+ else
+ {
+ need_uninstall_entry = 1;
+
+ fprintf(fd, "@echo off\n");
+ fprintf(fd, "rem -- Run Vim --\n\n");
+
+ strcpy(buf, installdir);
+ buf[runtimeidx - 1] = NUL;
+ /* Don't use double quotes for the value here, also when buf
+ * contains a space. The quotes would be included in the value
+ * for MSDOS and NT. */
+ fprintf(fd, "set VIM=%s\n\n", buf);
+
+ strcpy(buf, installdir + runtimeidx);
+ add_pathsep(buf);
+ strcat(buf, exename);
+
+ /* Give an error message when the executable could not be found. */
+ fprintf(fd, "if exist \"%%VIM%%\\%s\" goto havevim\n", buf);
+ fprintf(fd, "echo \"%%VIM%%\\%s\" not found\n", buf);
+ fprintf(fd, "goto eof\n\n");
+ fprintf(fd, ":havevim\n");
+
+ fprintf(fd, "rem collect the arguments in VIMARGS for Win95\n");
+ fprintf(fd, "set VIMARGS=\n");
+ if (*exename == 'g')
+ fprintf(fd, "set VIMNOFORK=\n");
+ fprintf(fd, ":loopstart\n");
+ fprintf(fd, "if .%%1==. goto loopend\n");
+ if (*exename == 'g')
+ {
+ fprintf(fd, "if NOT .%%1==.-f goto noforkarg\n");
+ fprintf(fd, "set VIMNOFORK=1\n");
+ fprintf(fd, ":noforkarg\n");
+ }
+ fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n");
+ fprintf(fd, "shift\n");
+ fprintf(fd, "goto loopstart\n\n");
+ fprintf(fd, ":loopend\n");
+
+ fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n\n");
+
+ /* For gvim.exe use "start" to avoid that the console window stays
+ * open. */
+ if (*exename == 'g')
+ {
+ fprintf(fd, "if .%%VIMNOFORK%%==.1 goto nofork\n");
+ fprintf(fd, "start ");
+ }
+
+ /* Do use quotes here if the path includes a space. */
+ if (strchr(installdir, ' ') != NULL)
+ fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf, vimarg);
+ else
+ fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg);
+ fprintf(fd, "goto eof\n\n");
+
+ if (*exename == 'g')
+ {
+ fprintf(fd, ":nofork\n");
+ fprintf(fd, "start /w ");
+ /* Do use quotes here if the path includes a space. */
+ if (strchr(installdir, ' ') != NULL)
+ fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf,
+ vimarg);
+ else
+ fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg);
+ fprintf(fd, "goto eof\n\n");
+ }
+
+ fprintf(fd, ":ntaction\n");
+ fprintf(fd, "rem for WinNT we can use %%*\n");
+
+ /* For gvim.exe use "start /b" to avoid that the console window
+ * stays open. */
+ if (*exename == 'g')
+ {
+ fprintf(fd, "if .%%VIMNOFORK%%==.1 goto noforknt\n");
+ fprintf(fd, "start \"dummy\" /b ");
+ }
+
+ /* Do use quotes here if the path includes a space. */
+ if (strchr(installdir, ' ') != NULL)
+ fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg);
+ else
+ fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg);
+ fprintf(fd, "goto eof\n\n");
+
+ if (*exename == 'g')
+ {
+ fprintf(fd, ":noforknt\n");
+ fprintf(fd, "start \"dummy\" /b /wait ");
+ /* Do use quotes here if the path includes a space. */
+ if (strchr(installdir, ' ') != NULL)
+ fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg);
+ else
+ fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg);
+ }
+
+ fprintf(fd, "\n:eof\n");
+ fprintf(fd, "set VIMARGS=\n");
+ if (*exename == 'g')
+ fprintf(fd, "set VIMNOFORK=\n");
+
+ fclose(fd);
+ printf("%s has been %s\n", batpath,
+ oldname == NULL ? "created" : "overwritten");
+ }
+ }
+}
+
+/*
+ * Make the text string for choice "idx".
+ * The format "fmt" is must have one %s item, which "arg" is used for.
+ */
+ static void
+alloc_text(int idx, char *fmt, char *arg)
+{
+ if (choices[idx].text != NULL)
+ free(choices[idx].text);
+
+ choices[idx].text = alloc((int)(strlen(fmt) + strlen(arg)) - 1);
+ sprintf(choices[idx].text, fmt, arg);
+}
+
+/*
+ * Toggle the "Overwrite .../vim.bat" to "Don't overwrite".
+ */
+ static void
+toggle_bat_choice(int idx)
+{
+ char *batname = targets[choices[idx].arg].batpath;
+ char *oldname = targets[choices[idx].arg].oldbat;
+
+ if (*batname == NUL)
+ {
+ alloc_text(idx, " Overwrite %s", oldname);
+ strcpy(batname, oldname);
+ }
+ else
+ {
+ alloc_text(idx, " Do NOT overwrite %s", oldname);
+ *batname = NUL;
+ }
+}
+
+/*
+ * Do some work for a batch file entry: Append the batch file name to the path
+ * and set the text for the choice.
+ */
+ static void
+set_bat_text(int idx, char *batpath, char *name)
+{
+ strcat(batpath, name);
+
+ alloc_text(idx, " Create %s", batpath);
+}
+
+/*
+ * Select a directory to write the batch file line.
+ */
+ static void
+change_bat_choice(int idx)
+{
+ char *path;
+ char *batpath;
+ char *name;
+ int n;
+ char *s;
+ char *p;
+ int count;
+ char **names = NULL;
+ int i;
+ int target = choices[idx].arg;
+
+ name = targets[target].batname;
+ batpath = targets[target].batpath;
+
+ path = getenv("PATH");
+ if (path == NULL)
+ {
+ printf("\nERROR: The variable $PATH is not set\n");
+ return;
+ }
+
+ /*
+ * first round: count number of names in path;
+ * second round: save names to names[].
+ */
+ for (;;)
+ {
+ count = 1;
+ for (p = path; *p; )
+ {
+ s = strchr(p, ';');
+ if (s == NULL)
+ s = p + strlen(p);
+ if (names != NULL)
+ {
+ names[count] = alloc((int)(s - p) + 1);
+ strncpy(names[count], p, s - p);
+ names[count][s - p] = NUL;
+ }
+ ++count;
+ p = s;
+ if (*p != NUL)
+ ++p;
+ }
+ if (names != NULL)
+ break;
+ names = alloc((int)(count + 1) * sizeof(char *));
+ }
+ names[0] = alloc(50);
+ sprintf(names[0], "Select directory to create %s in:", name);
+ names[count] = alloc(50);
+ if (choices[idx].arg == 0)
+ sprintf(names[count], "Do not create any .bat file.");
+ else
+ sprintf(names[count], "Do not create a %s file.", name);
+ n = get_choice(names, count + 1);
+
+ if (n == count)
+ {
+ /* Selected last item, don't create bat file. */
+ *batpath = NUL;
+ if (choices[idx].arg != 0)
+ alloc_text(idx, " Do NOT create %s", name);
+ }
+ else
+ {
+ /* Selected one of the paths. For the first item only keep the path,
+ * for the others append the batch file name. */
+ strcpy(batpath, names[n]);
+ add_pathsep(batpath);
+ if (choices[idx].arg != 0)
+ set_bat_text(idx, batpath, name);
+ }
+
+ for (i = 0; i <= count; ++i)
+ free(names[i]);
+ free(names);
+}
+
+char *bat_text_yes = "Install .bat files to use Vim at the command line:";
+char *bat_text_no = "do NOT install .bat files to use Vim at the command line";
+
+ static void
+change_main_bat_choice(int idx)
+{
+ int i;
+
+ /* let the user select a default directory or NONE */
+ change_bat_choice(idx);
+
+ if (targets[0].batpath[0] != NUL)
+ choices[idx].text = bat_text_yes;
+ else
+ choices[idx].text = bat_text_no;
+
+ /* update the individual batch file selections */
+ for (i = 1; i < TARGET_COUNT; ++i)
+ {
+ /* Only make it active when the first item has a path and the vim.exe
+ * or gvim.exe exists (there is a changefunc then). */
+ if (targets[0].batpath[0] != NUL
+ && choices[idx + i].changefunc != NULL)
+ {
+ choices[idx + i].active = 1;
+ if (choices[idx + i].changefunc == change_bat_choice
+ && targets[i].batpath[0] != NUL)
+ {
+ strcpy(targets[i].batpath, targets[0].batpath);
+ set_bat_text(idx + i, targets[i].batpath, targets[i].batname);
+ }
+ }
+ else
+ choices[idx + i].active = 0;
+ }
+}
+
+/*
+ * Initialize a choice for creating a batch file.
+ */
+ static void
+init_bat_choice(int target)
+{
+ char *batpath = targets[target].batpath;
+ char *oldbat = targets[target].oldbat;
+ char *p;
+ int i;
+
+ choices[choice_count].arg = target;
+ choices[choice_count].installfunc = install_bat_choice;
+ choices[choice_count].active = 1;
+ choices[choice_count].text = NULL; /* will be set below */
+ if (oldbat != NULL)
+ {
+ /* A [g]vim.bat exists: Only choice is to overwrite it or not. */
+ choices[choice_count].changefunc = toggle_bat_choice;
+ *batpath = NUL;
+ toggle_bat_choice(choice_count);
+ }
+ else
+ {
+ if (default_bat_dir != NULL)
+ /* Prefer using the same path as an existing .bat file. */
+ strcpy(batpath, default_bat_dir);
+ else
+ {
+ /* No [g]vim.bat exists: Write it to a directory in $PATH. Use
+ * $WINDIR by default, if it's empty the first item in $PATH. */
+ p = getenv("WINDIR");
+ if (p != NULL && *p != NUL)
+ strcpy(batpath, p);
+ else
+ {
+ p = getenv("PATH");
+ if (p == NULL || *p == NUL) /* "cannot happen" */
+ strcpy(batpath, "C:/Windows");
+ else
+ {
+ i = 0;
+ while (*p != NUL && *p != ';')
+ batpath[i++] = *p++;
+ batpath[i] = NUL;
+ }
+ }
+ }
+ add_pathsep(batpath);
+ set_bat_text(choice_count, batpath, targets[target].batname);
+
+ choices[choice_count].changefunc = change_bat_choice;
+ }
+ ++choice_count;
+}
+
+/*
+ * Set up the choices for installing .bat files.
+ * For these items "arg" is the index in targets[].
+ */
+ static void
+init_bat_choices(void)
+{
+ int i;
+
+ /* The first item is used to switch installing batch files on/off and
+ * setting the default path. */
+ choices[choice_count].text = bat_text_yes;
+ choices[choice_count].changefunc = change_main_bat_choice;
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = 1;
+ choices[choice_count].arg = 0;
+ ++choice_count;
+
+ /* Add items for each batch file target. Only used when not disabled by
+ * the first item. When a .exe exists, don't offer to create a .bat. */
+ for (i = 1; i < TARGET_COUNT; ++i)
+ if (targets[i].oldexe == NULL
+ && (targets[i].exenamearg[0] == 'g' ? has_gvim : has_vim))
+ init_bat_choice(i);
+ else
+ add_dummy_choice();
+}
+
+/*
+ * Install the vimrc file.
+ */
+/*ARGSUSED*/
+ static void
+install_vimrc(int idx)
+{
+ FILE *fd, *tfd;
+ char *fname;
+ char *p;
+
+ /* If an old vimrc file exists, overwrite it.
+ * Otherwise create a new one. */
+ if (*oldvimrc != NUL)
+ fname = oldvimrc;
+ else
+ fname = vimrc;
+
+ fd = fopen(fname, "w");
+ if (fd == NULL)
+ {
+ printf("\nERROR: Cannot open \"%s\" for writing.\n", fname);
+ return;
+ }
+ switch (compat_choice)
+ {
+ case compat_vi:
+ fprintf(fd, "set compatible\n");
+ break;
+ case compat_some_enhancements:
+ fprintf(fd, "set nocompatible\n");
+ break;
+ case compat_all_enhancements:
+ fprintf(fd, "set nocompatible\n");
+ fprintf(fd, "source $VIMRUNTIME/vimrc_example.vim\n");
+ break;
+ }
+ switch (remap_choice)
+ {
+ case remap_no:
+ break;
+ case remap_win:
+ fprintf(fd, "source $VIMRUNTIME/mswin.vim\n");
+ break;
+ }
+ switch (mouse_choice)
+ {
+ case mouse_xterm:
+ fprintf(fd, "behave xterm\n");
+ break;
+ case mouse_mswin:
+ fprintf(fd, "behave mswin\n");
+ break;
+ }
+ if ((tfd = fopen("diff.exe", "r")) != NULL)
+ {
+ /* Use the diff.exe that comes with the self-extracting gvim.exe. */
+ fclose(tfd);
+ fprintf(fd, "\n");
+ fprintf(fd, "set diffexpr=MyDiff()\n");
+ fprintf(fd, "function MyDiff()\n");
+ fprintf(fd, " let opt = '-a --binary '\n");
+ fprintf(fd, " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif\n");
+ fprintf(fd, " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif\n");
+ /* Use quotes only when needed, they may cause trouble. */
+ fprintf(fd, " let arg1 = v:fname_in\n");
+ fprintf(fd, " if arg1 =~ ' ' | let arg1 = '\"' . arg1 . '\"' | endif\n");
+ fprintf(fd, " let arg2 = v:fname_new\n");
+ fprintf(fd, " if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif\n");
+ fprintf(fd, " let arg3 = v:fname_out\n");
+ fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
+ p = strchr(installdir, ' ');
+ if (p != NULL)
+ {
+ /* The path has a space. When using cmd.exe (Win NT/2000/XP) put
+ * quotes around the whole command and around the diff command.
+ * Otherwise put a double quote just before the space and at the
+ * end of the command. Putting quotes around the whole thing
+ * doesn't work on Win 95/98/ME. This is mostly guessed! */
+ fprintf(fd, " if &sh =~ '\\<cmd'\n");
+ fprintf(fd, " silent execute '!\"\"%s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '\"'\n", installdir);
+ fprintf(fd, " else\n");
+ *p = NUL;
+ fprintf(fd, " silent execute '!%s\" %s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1);
+ *p = ' ';
+ fprintf(fd, " endif\n");
+ }
+ else
+ fprintf(fd, " silent execute '!%s\\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir);
+ fprintf(fd, "endfunction\n");
+ fprintf(fd, "\n");
+ }
+ fclose(fd);
+ printf("%s has been written\n", fname);
+}
+
+ static void
+change_vimrc_choice(int idx)
+{
+ if (choices[idx].installfunc != NULL)
+ {
+ /* Switch to NOT change or create a vimrc file. */
+ if (*oldvimrc != NUL)
+ alloc_text(idx, "Do NOT change startup file %s", oldvimrc);
+ else
+ alloc_text(idx, "Do NOT create startup file %s", vimrc);
+ choices[idx].installfunc = NULL;
+ choices[idx + 1].active = 0;
+ choices[idx + 2].active = 0;
+ choices[idx + 3].active = 0;
+ }
+ else
+ {
+ /* Switch to change or create a vimrc file. */
+ if (*oldvimrc != NUL)
+ alloc_text(idx, "Overwrite startup file %s with:", oldvimrc);
+ else
+ alloc_text(idx, "Create startup file %s with:", vimrc);
+ choices[idx].installfunc = install_vimrc;
+ choices[idx + 1].active = 1;
+ choices[idx + 2].active = 1;
+ choices[idx + 3].active = 1;
+ }
+}
+
+/*
+ * Change the choice how to run Vim.
+ */
+ static void
+change_run_choice(int idx)
+{
+ compat_choice = get_choice(compat_choices, TABLE_SIZE(compat_choices));
+ alloc_text(idx, compat_text, compat_choices[compat_choice]);
+}
+
+/*
+ * Change the choice if keys are to be remapped.
+ */
+ static void
+change_remap_choice(int idx)
+{
+ remap_choice = get_choice(remap_choices, TABLE_SIZE(remap_choices));
+ alloc_text(idx, remap_text, remap_choices[remap_choice]);
+}
+
+/*
+ * Change the choice how to select text.
+ */
+ static void
+change_mouse_choice(int idx)
+{
+ mouse_choice = get_choice(mouse_choices, TABLE_SIZE(mouse_choices));
+ alloc_text(idx, mouse_text, mouse_choices[mouse_choice]);
+}
+
+ static void
+init_vimrc_choices(void)
+{
+ /* set path for a new _vimrc file (also when not used) */
+ strcpy(vimrc, installdir);
+ strcpy(vimrc + runtimeidx, "_vimrc");
+
+ /* Set opposite value and then toggle it by calling change_vimrc_choice() */
+ if (*oldvimrc == NUL)
+ choices[choice_count].installfunc = NULL;
+ else
+ choices[choice_count].installfunc = install_vimrc;
+ choices[choice_count].text = NULL;
+ change_vimrc_choice(choice_count);
+ choices[choice_count].changefunc = change_vimrc_choice;
+ choices[choice_count].active = 1;
+ ++choice_count;
+
+ /* default way to run Vim */
+ alloc_text(choice_count, compat_text, compat_choices[compat_choice]);
+ choices[choice_count].changefunc = change_run_choice;
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = (*oldvimrc == NUL);
+ ++choice_count;
+
+ /* Whether to remap keys */
+ alloc_text(choice_count, remap_text , remap_choices[remap_choice]);
+ choices[choice_count].changefunc = change_remap_choice;
+ choices[choice_count].installfunc = NULL;;
+ choices[choice_count].active = (*oldvimrc == NUL);
+ ++choice_count;
+
+ /* default way to use the mouse */
+ alloc_text(choice_count, mouse_text, mouse_choices[mouse_choice]);
+ choices[choice_count].changefunc = change_mouse_choice;
+ choices[choice_count].installfunc = NULL;;
+ choices[choice_count].active = (*oldvimrc == NUL);
+ ++choice_count;
+}
+
+/*
+ * Add some entries to the registry:
+ * - to add "Edit with Vim" to the context * menu
+ * - to add Vim to the "Open with..." list
+ * - to uninstall Vim
+ */
+/*ARGSUSED*/
+ static void
+install_registry(void)
+{
+#if defined(DJGPP) || defined(WIN3264) || defined(UNIX_LINT)
+ FILE *fd;
+ const char *vim_ext_ThreadingModel = "Apartment";
+ const char *vim_ext_name = "Vim Shell Extension";
+ const char *vim_ext_clsid = "{51EEE242-AD87-11d3-9C1E-0090278BBD99}";
+ char buf[BUFSIZE];
+
+ fd = fopen("vim.reg", "w");
+ if (fd == NULL)
+ printf("ERROR: Could not open vim.reg for writing\n");
+ else
+ {
+ double_bs(installdir, buf); /* double the backslashes */
+
+ /*
+ * Write the registry entries for the "Edit with Vim" menu.
+ */
+ fprintf(fd, "REGEDIT4\n");
+ fprintf(fd, "\n");
+ if (install_popup)
+ {
+ char bufg[BUFSIZE];
+ struct stat st;
+
+ if (stat("gvimext.dll", &st) >= 0)
+ strcpy(bufg, buf);
+ else
+ /* gvimext.dll is in gvimext subdir */
+ sprintf(bufg, "%sgvimext\\\\", buf);
+
+ printf("Creating \"Edit with Vim\" popup menu entry\n");
+
+ fprintf(fd, "HKEY_CLASSES_ROOT\\CLSID\\%s\n", vim_ext_clsid);
+ fprintf(fd, "@=\"%s\"\n", vim_ext_name);
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\CLSID\\%s\\InProcServer32]\n",
+ vim_ext_clsid);
+ fprintf(fd, "@=\"%sgvimext.dll\"\n", bufg);
+ fprintf(fd, "\"ThreadingModel\"=\"%s\"\n", vim_ext_ThreadingModel);
+ fprintf(fd, "\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\*\\shellex\\ContextMenuHandlers\\gvim]\n");
+ fprintf(fd, "@=\"%s\"\n", vim_ext_clsid);
+ fprintf(fd, "\n");
+ fprintf(fd, "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved]\n");
+ fprintf(fd, "\"%s\"=\"%s\"\n", vim_ext_clsid, vim_ext_name);
+ fprintf(fd, "\n");
+ fprintf(fd, "[HKEY_LOCAL_MACHINE\\Software\\Vim\\Gvim]\n");
+ fprintf(fd, "\"path\"=\"%sgvim.exe\"\n", buf);
+ fprintf(fd, "\n");
+ }
+
+ if (install_openwith)
+ {
+ printf("Creating \"Open with ...\" list entry\n");
+
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\Applications\\gvim.exe]\n\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\Applications\\gvim.exe\\shell]\n\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\Applications\\gvim.exe\\shell\\edit]\n\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\Applications\\gvim.exe\\shell\\edit\\command]\n");
+ fprintf(fd, "@=\"%sgvim.exe \\\"%%1\\\"\"\n\n", buf);
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\.htm\\OpenWithList\\gvim.exe]\n\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\.vim\\OpenWithList\\gvim.exe]\n\n");
+ fprintf(fd, "[HKEY_CLASSES_ROOT\\*\\OpenWithList\\gvim.exe]\n\n");
+ }
+
+ printf("Creating an uninstall entry\n");
+
+ /* The registry entries for uninstalling the menu */
+ fprintf(fd, "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT "]\n");
+
+ /* For the NSIS installer use the generated uninstaller. */
+ if (interactive)
+ {
+ fprintf(fd, "\"DisplayName\"=\"Vim " VIM_VERSION_SHORT "\"\n");
+ fprintf(fd, "\"UninstallString\"=\"%suninstal.exe\"\n", buf);
+ }
+ else
+ {
+ fprintf(fd, "\"DisplayName\"=\"Vim " VIM_VERSION_SHORT " (self-installing)\"\n");
+ fprintf(fd, "\"UninstallString\"=\"%suninstall-gui.exe\"\n", buf);
+ }
+
+ fclose(fd);
+
+ run_command("regedit /s vim.reg");
+
+ remove("vim.reg");
+ }
+#endif /* if defined(DJGPP) || defined(WIN3264) */
+}
+
+ static void
+change_popup_choice(int idx)
+{
+ if (install_popup == 0)
+ {
+ choices[idx].text = "Install an entry for Vim in the popup menu for the right\n mouse button so that you can edit any file with Vim";
+ install_popup = 1;
+ }
+ else
+ {
+ choices[idx].text = "Do NOT install an entry for Vim in the popup menu for the\n right mouse button to edit any file with Vim";
+ install_popup = 0;
+ }
+}
+
+/*
+ * Only add the choice for the popup menu entry when gvim.exe was found and
+ * both gvimext.dll and regedit.exe exist.
+ */
+ static void
+init_popup_choice(void)
+{
+ struct stat st;
+
+ if (has_gvim
+ && (stat("gvimext.dll", &st) >= 0
+ || stat("gvimext/gvimext.dll", &st) >= 0)
+#ifndef WIN3264
+ && searchpath("regedit.exe") != NULL
+#endif
+ )
+ {
+ choices[choice_count].changefunc = change_popup_choice;
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = 1;
+ change_popup_choice(choice_count); /* set the text */
+ ++choice_count;
+ }
+ else
+ add_dummy_choice();
+}
+
+ static void
+change_openwith_choice(int idx)
+{
+ if (install_openwith == 0)
+ {
+ choices[idx].text = "Add Vim to the \"Open With...\" list in the popup menu for the right\n mouse button so that you can edit any file with Vim";
+ install_openwith = 1;
+ }
+ else
+ {
+ choices[idx].text = "Do NOT add Vim to the \"Open With...\" list in the popup menu for the\n right mouse button to edit any file with Vim";
+ install_openwith = 0;
+ }
+}
+
+/*
+ * Only add the choice for the open-with menu entry when gvim.exe was found
+ * and and regedit.exe exist.
+ */
+ static void
+init_openwith_choice(void)
+{
+ if (has_gvim
+#ifndef WIN3264
+ && searchpath("regedit.exe") != NULL
+#endif
+ )
+ {
+ choices[choice_count].changefunc = change_openwith_choice;
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = 1;
+ change_openwith_choice(choice_count); /* set the text */
+ ++choice_count;
+ }
+ else
+ add_dummy_choice();
+}
+
+#ifdef WIN3264
+/* create_shortcut
+ *
+ * Create a shell link.
+ *
+ * returns 0 on failure, non-zero on successful completion.
+ *
+ * NOTE: Currently untested with mingw.
+ */
+ int
+create_shortcut(
+ const char *shortcut_name,
+ const char *iconfile_path,
+ int iconindex,
+ const char *shortcut_target,
+ const char *shortcut_args,
+ const char *workingdir
+ )
+{
+ IShellLink *shelllink_ptr;
+ HRESULT hres;
+ IPersistFile *persistfile_ptr;
+
+ /* Initialize COM library */
+ hres = CoInitialize(NULL);
+ if (!SUCCEEDED(hres))
+ {
+ printf("Error: Could not open the COM library. Not creating shortcut.\n");
+ return FAIL;
+ }
+
+ /* Instantiate a COM object for the ShellLink, store a pointer to it
+ * in shelllink_ptr. */
+ hres = CoCreateInstance(&CLSID_ShellLink,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ &IID_IShellLink,
+ (void **) &shelllink_ptr);
+
+ if (SUCCEEDED(hres)) /* If the instantiation was successful... */
+ {
+ /* ...Then build a PersistFile interface for the ShellLink so we can
+ * save it as a file after we build it. */
+ hres = shelllink_ptr->lpVtbl->QueryInterface(shelllink_ptr,
+ &IID_IPersistFile, (void **) &persistfile_ptr);
+
+ if (SUCCEEDED(hres))
+ {
+ wchar_t wsz[BUFSIZE];
+
+ /* translate the (possibly) multibyte shortcut filename to windows
+ * Unicode so it can be used as a file name.
+ */
+ MultiByteToWideChar(CP_ACP, 0, shortcut_name, -1, wsz, BUFSIZE);
+
+ /* set the attributes */
+ shelllink_ptr->lpVtbl->SetPath(shelllink_ptr, shortcut_target);
+ shelllink_ptr->lpVtbl->SetWorkingDirectory(shelllink_ptr,
+ workingdir);
+ shelllink_ptr->lpVtbl->SetIconLocation(shelllink_ptr,
+ iconfile_path, iconindex);
+ shelllink_ptr->lpVtbl->SetArguments(shelllink_ptr, shortcut_args);
+
+ /* save the shortcut to a file and return the PersistFile object*/
+ persistfile_ptr->lpVtbl->Save(persistfile_ptr, wsz, 1);
+ persistfile_ptr->lpVtbl->Release(persistfile_ptr);
+ }
+ else
+ {
+ printf("QueryInterface Error\n");
+ return FAIL;
+ }
+
+ /* Return the ShellLink object */
+ shelllink_ptr->lpVtbl->Release(shelllink_ptr);
+ }
+ else
+ {
+ printf("CoCreateInstance Error - hres = %08x\n", (int)hres);
+ return FAIL;
+ }
+
+ return OK;
+}
+
+/*
+ * Build a path to where we will put a specified link.
+ *
+ * Return 0 on error, non-zero on success
+ */
+ int
+build_link_name(
+ char *link_path,
+ const char *link_name,
+ const char *shell_folder_name)
+{
+ char shell_folder_path[BUFSIZE];
+
+ if (get_shell_folder_path(shell_folder_path, shell_folder_name) == FAIL)
+ {
+ printf("An error occurred while attempting to find the path to %s.\n",
+ shell_folder_name);
+ return FAIL;
+ }
+
+ /* Make sure the directory exists (create Start Menu\Programs\Vim).
+ * Ignore errors if it already exists. */
+ vim_mkdir(shell_folder_path, 0755);
+
+ /* build the path to the shortcut and the path to gvim.exe */
+ sprintf(link_path, "%s\\%s.lnk", shell_folder_path, link_name);
+
+ return OK;
+}
+
+ static int
+build_shortcut(
+ const char *name, /* Name of the shortcut */
+ const char *exename, /* Name of the executable (e.g., vim.exe) */
+ const char *args,
+ const char *shell_folder,
+ const char *workingdir)
+{
+ char executable_path[BUFSIZE];
+ char link_name[BUFSIZE];
+
+ sprintf(executable_path, "%s\\%s", installdir, exename);
+
+ if (build_link_name(link_name, name, shell_folder) == FAIL)
+ {
+ printf("An error has occurred. A shortcut to %s will not be created %s.\n",
+ name,
+ *shell_folder == 'd' ? "on the desktop" : "in the Start menu");
+ return FAIL;
+ }
+
+ /* Create the shortcut: */
+ return create_shortcut(link_name, executable_path, 0,
+ executable_path, args, workingdir);
+}
+
+/*
+ * We used to use "homedir" as the working directory, but that is a bad choice
+ * on multi-user systems. Not specifying a directory appears to work best.
+ */
+#define WORKDIR ""
+
+/*
+ * Create shortcut(s) in the Start Menu\Programs\Vim folder.
+ */
+ static void
+install_start_menu(int idx)
+{
+ need_uninstall_entry = 1;
+ printf("Creating start menu\n");
+ if (has_vim)
+ {
+ if (build_shortcut("Vim", "vim.exe", "",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ if (build_shortcut("Vim Read-only", "vim.exe", "-R",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ if (build_shortcut("Vim Diff", "vim.exe", "-d",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ }
+ if (has_gvim)
+ {
+ if (build_shortcut("gVim", "gvim.exe", "",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ if (build_shortcut("gVim Easy", "gvim.exe", "-y",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ if (build_shortcut("gVim Read-only", "gvim.exe", "-R",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ if (build_shortcut("gVim Diff", "gvim.exe", "-d",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ }
+ if (build_shortcut("Uninstall",
+ interactive ? "uninstal.exe" : "uninstall-gui.exe", "",
+ VIM_STARTMENU, installdir) == FAIL)
+ return;
+ /* For Windows NT the working dir of the vimtutor.bat must be right,
+ * otherwise gvim.exe won't be found and using gvimbat doesn't work. */
+ if (build_shortcut("Vim tutor", "vimtutor.bat", "",
+ VIM_STARTMENU, installdir) == FAIL)
+ return;
+ if (build_shortcut("Help", has_gvim ? "gvim.exe" : "vim.exe", "-c h",
+ VIM_STARTMENU, WORKDIR) == FAIL)
+ return;
+ {
+ char shell_folder_path[BUFSIZE];
+
+ /* Creating the URL shortcut works a bit differently... */
+ if (get_shell_folder_path(shell_folder_path, VIM_STARTMENU) == FAIL)
+ {
+ printf("Finding the path of the Start menu failed\n");
+ return ;
+ }
+ add_pathsep(shell_folder_path);
+ strcat(shell_folder_path, "Vim Online.url");
+ if (!WritePrivateProfileString("InternetShortcut", "URL",
+ "http://vim.sf.net/", shell_folder_path))
+ {
+ printf("Creating the Vim online URL failed\n");
+ return;
+ }
+ }
+}
+
+ static void
+toggle_startmenu_choice(int idx)
+{
+ if (choices[idx].installfunc == NULL)
+ {
+ choices[idx].installfunc = install_start_menu;
+ choices[idx].text = "Add Vim to the Start menu";
+ }
+ else
+ {
+ choices[idx].installfunc = NULL;
+ choices[idx].text = "Do NOT add Vim to the Start menu";
+ }
+}
+
+/*
+ * Function to actually create the shortcuts
+ *
+ * Currently I am supplying no working directory to the shortcut. This
+ * means that the initial working dir will be:
+ * - the location of the shortcut if no file is supplied
+ * - the location of the file being edited if a file is supplied (ie via
+ * drag and drop onto the shortcut).
+ */
+ void
+install_shortcut_gvim(int idx)
+{
+ /* Create shortcut(s) on the desktop */
+ if (choices[idx].arg)
+ {
+ (void)build_shortcut(icon_names[0], "gvim.exe",
+ "", "desktop", WORKDIR);
+ need_uninstall_entry = 1;
+ }
+}
+
+ void
+install_shortcut_evim(int idx)
+{
+ if (choices[idx].arg)
+ {
+ (void)build_shortcut(icon_names[1], "gvim.exe",
+ "-y", "desktop", WORKDIR);
+ need_uninstall_entry = 1;
+ }
+}
+
+ void
+install_shortcut_gview(int idx)
+{
+ if (choices[idx].arg)
+ {
+ (void)build_shortcut(icon_names[2], "gvim.exe",
+ "-R", "desktop", WORKDIR);
+ need_uninstall_entry = 1;
+ }
+}
+
+ void
+toggle_shortcut_choice(int idx)
+{
+ char *arg;
+
+ if (choices[idx].installfunc == install_shortcut_gvim)
+ arg = "gVim";
+ else if (choices[idx].installfunc == install_shortcut_evim)
+ arg = "gVim Easy";
+ else
+ arg = "gVim Read-only";
+ if (choices[idx].arg)
+ {
+ choices[idx].arg = 0;
+ alloc_text(idx, "Do NOT create a desktop icon for %s", arg);
+ }
+ else
+ {
+ choices[idx].arg = 1;
+ alloc_text(idx, "Create a desktop icon for %s", arg);
+ }
+}
+#endif /* WIN3264 */
+
+ static void
+init_startmenu_choice(void)
+{
+#ifdef WIN3264
+ /* Start menu */
+ choices[choice_count].changefunc = toggle_startmenu_choice;
+ choices[choice_count].installfunc = NULL;
+ choices[choice_count].active = 1;
+ toggle_startmenu_choice(choice_count); /* set the text */
+ ++choice_count;
+#else
+ add_dummy_choice();
+#endif
+}
+
+/*
+ * Add the choice for the desktop shortcuts.
+ */
+ static void
+init_shortcut_choices(void)
+{
+#ifdef WIN3264
+ /* Shortcut to gvim */
+ choices[choice_count].text = NULL;
+ choices[choice_count].arg = 0;
+ choices[choice_count].active = has_gvim;
+ choices[choice_count].changefunc = toggle_shortcut_choice;
+ choices[choice_count].installfunc = install_shortcut_gvim;
+ toggle_shortcut_choice(choice_count);
+ ++choice_count;
+
+ /* Shortcut to evim */
+ choices[choice_count].text = NULL;
+ choices[choice_count].arg = 0;
+ choices[choice_count].active = has_gvim;
+ choices[choice_count].changefunc = toggle_shortcut_choice;
+ choices[choice_count].installfunc = install_shortcut_evim;
+ toggle_shortcut_choice(choice_count);
+ ++choice_count;
+
+ /* Shortcut to gview */
+ choices[choice_count].text = NULL;
+ choices[choice_count].arg = 0;
+ choices[choice_count].active = has_gvim;
+ choices[choice_count].changefunc = toggle_shortcut_choice;
+ choices[choice_count].installfunc = install_shortcut_gview;
+ toggle_shortcut_choice(choice_count);
+ ++choice_count;
+#else
+ add_dummy_choice();
+ add_dummy_choice();
+ add_dummy_choice();
+#endif
+}
+
+#ifdef WIN3264
+/*
+ * Attempt to register OLE for Vim.
+ */
+ static void
+install_OLE_register(void)
+{
+ char register_command_string[BUFSIZE + 30];
+
+ printf("\n--- Attempting to register Vim with OLE ---\n");
+ printf("(There is no message whether this works or not.)\n");
+
+#ifndef __CYGWIN__
+ sprintf(register_command_string, "\"%s\\gvim.exe\" -silent -register", installdir);
+#else
+ /* handle this differently for Cygwin which sometimes has trouble with
+ * Windows-style pathnames here. */
+ sprintf(register_command_string, "./gvim.exe -silent -register");
+#endif
+ system(register_command_string);
+}
+#endif /* WIN3264 */
+
+/*
+ * Remove the last part of directory "path[]" to get its parent, and put the
+ * result in "to[]".
+ */
+ static void
+dir_remove_last(const char *path, char to[BUFSIZE])
+{
+ char c;
+ long last_char_to_copy;
+ long path_length = strlen(path);
+
+ /* skip the last character just in case it is a '\\' */
+ last_char_to_copy = path_length - 2;
+ c = path[last_char_to_copy];
+
+ while (c != '\\')
+ {
+ last_char_to_copy--;
+ c = path[last_char_to_copy];
+ }
+
+ strncpy(to, path, (size_t)last_char_to_copy);
+ to[last_char_to_copy] = NUL;
+}
+
+ static void
+set_directories_text(int idx)
+{
+ if (vimfiles_dir_choice == (int)vimfiles_dir_none)
+ alloc_text(idx, "Do NOT create plugin directories%s", "");
+ else
+ alloc_text(idx, "Create plugin directories: %s",
+ vimfiles_dir_choices[vimfiles_dir_choice]);
+}
+
+/*
+ * Change the directory that the vim plugin directories will be created in:
+ * $HOME, $VIM or nowhere.
+ */
+ static void
+change_directories_choice(int idx)
+{
+ int choice_count = TABLE_SIZE(vimfiles_dir_choices);
+
+ /* Don't offer the $HOME choice if $HOME isn't set. */
+ if (getenv("HOME") == NULL)
+ --choice_count;
+ vimfiles_dir_choice = get_choice(vimfiles_dir_choices, choice_count);
+ set_directories_text(idx);
+}
+
+/*
+ * Create the plugin directories...
+ */
+/*ARGSUSED*/
+ static void
+install_vimfilesdir(int idx)
+{
+ int i;
+ char *p;
+ char vimdir_path[BUFSIZE];
+ char vimfiles_path[BUFSIZE];
+ char tmp_dirname[BUFSIZE];
+
+ /* switch on the location that the user wants the plugin directories
+ * built in */
+ switch (vimfiles_dir_choice)
+ {
+ case vimfiles_dir_vim:
+ {
+ /* Go to the %VIM% directory - check env first, then go one dir
+ * below installdir if there is no %VIM% environment variable.
+ * The accuracy of $VIM is checked in inspect_system(), so we
+ * can be sure it is ok to use here. */
+ p = getenv("VIM");
+ if (p == NULL) /* No $VIM in path */
+ dir_remove_last(installdir, vimdir_path);
+ else
+ strcpy(vimdir_path, p);
+ break;
+ }
+ case vimfiles_dir_home:
+ {
+ /* Find the $HOME directory. Its existence was already checked. */
+ p = getenv("HOME");
+ if (p == NULL)
+ {
+ printf("Internal error: $HOME is NULL\n");
+ p = "c:\\";
+ }
+ strcpy(vimdir_path, p);
+ break;
+ }
+ case vimfiles_dir_none:
+ {
+ /* Do not create vim plugin directory */
+ return;
+ }
+ }
+
+ /* Now, just create the directory. If it already exists, it will fail
+ * silently. */
+ sprintf(vimfiles_path, "%s\\vimfiles", vimdir_path);
+ vim_mkdir(vimfiles_path, 0755);
+
+ printf("Creating the following directories in \"%s\":\n", vimfiles_path);
+ for (i = 0; i < TABLE_SIZE(vimfiles_subdirs); i++)
+ {
+ sprintf(tmp_dirname, "%s\\%s", vimfiles_path, vimfiles_subdirs[i]);
+ printf(" %s", vimfiles_subdirs[i]);
+ vim_mkdir(tmp_dirname, 0755);
+ }
+ printf("\n");
+}
+
+/*
+ * Add the creation of runtime files to the setup sequence.
+ */
+ static void
+init_directories_choice(void)
+{
+ struct stat st;
+ char tmp_dirname[BUFSIZE];
+ char *p;
+
+ choices[choice_count].text = alloc(150);
+ choices[choice_count].changefunc = change_directories_choice;
+ choices[choice_count].installfunc = install_vimfilesdir;
+ choices[choice_count].active = 1;
+
+ /* Check if the "compiler" directory already exists. That's a good
+ * indication that the plugin directories were already created. */
+ if (getenv("HOME") != NULL)
+ {
+ vimfiles_dir_choice = (int)vimfiles_dir_home;
+ sprintf(tmp_dirname, "%s\\vimfiles\\compiler", getenv("HOME"));
+ if (stat(tmp_dirname, &st) == 0)
+ vimfiles_dir_choice = (int)vimfiles_dir_none;
+ }
+ else
+ {
+ vimfiles_dir_choice = (int)vimfiles_dir_vim;
+ p = getenv("VIM");
+ if (p == NULL) /* No $VIM in path, use the install dir */
+ dir_remove_last(installdir, tmp_dirname);
+ else
+ strcpy(tmp_dirname, p);
+ strcat(tmp_dirname, "\\vimfiles\\compiler");
+ if (stat(tmp_dirname, &st) == 0)
+ vimfiles_dir_choice = (int)vimfiles_dir_none;
+ }
+
+ set_directories_text(choice_count);
+ ++choice_count;
+}
+
+/*
+ * Setup the choices and the default values.
+ */
+ static void
+setup_choices(void)
+{
+ /* install the batch files */
+ init_bat_choices();
+
+ /* (over) write _vimrc file */
+ init_vimrc_choices();
+
+ /* Whether to add Vim to the popup menu */
+ init_popup_choice();
+
+ /* Whether to add Vim to the "Open With..." menu */
+ init_openwith_choice();
+
+ /* Whether to add Vim to the Start Menu. */
+ init_startmenu_choice();
+
+ /* Whether to add shortcuts to the Desktop. */
+ init_shortcut_choices();
+
+ /* Whether to create the runtime directories. */
+ init_directories_choice();
+}
+
+ static void
+print_cmd_line_help(void)
+{
+ printf("Vim installer non-interactive command line arguments:\n");
+ printf("\n");
+ printf("-create-batfiles [vim gvim evim view gview vimdiff gvimdiff]\n");
+ printf(" Create .bat files for Vim variants in the Windows directory.\n");
+ printf("-create-vimrc\n");
+ printf(" Create a default _vimrc file if one does not already exist.\n");
+ printf("-install-popup\n");
+ printf(" Install the Edit-with-Vim context menu entry\n");
+ printf("-install-openwith\n");
+ printf(" Add Vim to the \"Open With...\" context menu list\n");
+#ifdef WIN3264
+ printf("-add-start-menu");
+ printf(" Add Vim to the start menu\n");
+ printf("-install-icons");
+ printf(" Create icons for gVim executables on the desktop\n");
+#endif
+ printf("-create-directories [vim|home]\n");
+ printf(" Create runtime directories to drop plugins into; in the $VIM\n");
+ printf(" or $HOME directory\n");
+#ifdef WIN3264
+ printf("-register-OLE");
+ printf(" Register gvim for OLE\n");
+#endif
+ printf("\n");
+}
+
+/*
+ * Setup installation choices based on command line switches
+ */
+ static void
+command_line_setup_choices(int argc, char **argv)
+{
+ int i, j;
+
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp(argv[i], "-create-batfiles") == 0)
+ {
+ if (i + 1 == argc)
+ continue;
+ while (argv[i + 1][0] != '-' && i < argc)
+ {
+ i++;
+ for (j = 1; j < TARGET_COUNT; ++j)
+ if ((targets[j].exenamearg[0] == 'g' ? has_gvim : has_vim)
+ && strcmp(argv[i], targets[j].name) == 0)
+ {
+ init_bat_choice(j);
+ break;
+ }
+ if (j == TARGET_COUNT)
+ printf("%s is not a valid choice for -create-batfiles\n",
+ argv[i]);
+
+ if (i + 1 == argc)
+ break;
+ }
+ }
+ else if (strcmp(argv[i], "-create-vimrc") == 0)
+ {
+ /* Setup default vimrc choices. If there is already a _vimrc file,
+ * it will NOT be overwritten.
+ */
+ init_vimrc_choices();
+ }
+ else if (strcmp(argv[i], "-install-popup") == 0)
+ {
+ init_popup_choice();
+ }
+ else if (strcmp(argv[i], "-install-openwith") == 0)
+ {
+ init_openwith_choice();
+ }
+ else if (strcmp(argv[i], "-add-start-menu") == 0)
+ {
+ init_startmenu_choice();
+ }
+ else if (strcmp(argv[i], "-install-icons") == 0)
+ {
+ init_shortcut_choices();
+ }
+ else if (strcmp(argv[i], "-create-directories") == 0)
+ {
+ init_directories_choice();
+ if (argv[i + 1][0] != '-')
+ {
+ i++;
+ if (strcmp(argv[i], "vim") == 0)
+ vimfiles_dir_choice = (int)vimfiles_dir_vim;
+ else if (strcmp(argv[i], "home") == 0)
+ {
+ if (getenv("HOME") == NULL) /* No $HOME in environment */
+ vimfiles_dir_choice = (int)vimfiles_dir_vim;
+ else
+ vimfiles_dir_choice = (int)vimfiles_dir_home;
+ }
+ else
+ {
+ printf("Unknown argument for -create-directories: %s\n",
+ argv[i]);
+ print_cmd_line_help();
+ }
+ }
+ else /* No choice specified, default to vim directory */
+ vimfiles_dir_choice = (int)vimfiles_dir_vim;
+ }
+#ifdef WIN3264
+ else if (strcmp(argv[i], "-register-OLE") == 0)
+ {
+ /* This is always done when gvim is found */
+ }
+#endif
+ else /* Unknown switch */
+ {
+ printf("Got unknown argument argv[%d] = %s\n", i, argv[i]);
+ print_cmd_line_help();
+ }
+ }
+}
+
+
+/*
+ * Show a few screens full of helpful information.
+ */
+ static void
+show_help(void)
+{
+ static char *(items[]) =
+ {
+"Installing .bat files\n"
+"---------------------\n"
+"The vim.bat file is written in one of the directories in $PATH.\n"
+"This makes it possible to start Vim from the command line.\n"
+"If vim.exe can be found in $PATH, the choice for vim.bat will not be\n"
+"present. It is assumed you will use the existing vim.exe.\n"
+"If vim.bat can already be found in $PATH this is probably for an old\n"
+"version of Vim (but this is not checked!). You can overwrite it.\n"
+"If no vim.bat already exists, you can select one of the directories in\n"
+"$PATH for creating the batch file, or disable creating a vim.bat file.\n"
+"\n"
+"If you choose not to create the vim.bat file, Vim can still be executed\n"
+"in other ways, but not from the command line.\n"
+"\n"
+"The same applies to choices for gvim, evim, (g)view, and (g)vimdiff.\n"
+"The first item can be used to change the path for all of them.\n"
+,
+"Creating a _vimrc file\n"
+"----------------------\n"
+"The _vimrc file is used to set options for how Vim behaves.\n"
+"The install program can create a _vimrc file with a few basic choices.\n"
+"You can edit this file later to tune your preferences.\n"
+"If you already have a _vimrc or .vimrc file it can be overwritten.\n"
+"Don't do that if you have made changes to it.\n"
+,
+"Vim features\n"
+"------------\n"
+"(this choice is only available when creating a _vimrc file)\n"
+"1. Vim can run in Vi-compatible mode. Many nice Vim features are then\n"
+" disabled. In the not-Vi-compatible mode Vim is still mostly Vi\n"
+" compatible, but adds nice features like multi-level undo. Only\n"
+" choose Vi-compatible if you really need full Vi compatibility.\n"
+"2. Running Vim with some enhancements is useful when you want some of\n"
+" the nice Vim features, but have a slow computer and want to keep it\n"
+" really fast.\n"
+"3. Syntax highlighting shows many files in color. Not only does this look\n"
+" nice, it also makes it easier to spot errors and you can work faster.\n"
+" The other features include editing compressed files.\n"
+,
+"Windows key mapping\n"
+"-------------------\n"
+"(this choice is only available when creating a _vimrc file)\n"
+"Under MS-Windows the CTRL-C key copies text to the clipboard and CTRL-V\n"
+"pastes text from the clipboard. There are a few more keys like these.\n"
+"Unfortunately, in Vim these keys normally have another meaning.\n"
+"1. Choose to have the keys like they normally are in Vim (useful if you\n"
+" also use Vim on other systems).\n"
+"2. Choose to have the keys work like they are used on MS-Windows (useful\n"
+" if you mostly work on MS-Windows).\n"
+,
+"Mouse use\n"
+"---------\n"
+"(this choice is only available when creating a _vimrc file)\n"
+"The right mouse button can be used in two ways:\n"
+"1. The Unix way is to extend an existing selection. The popup menu is\n"
+" not available.\n"
+"2. The MS-Windows way is to show a popup menu, which allows you to\n"
+" copy/paste text, undo/redo, etc. Extending the selection can still be\n"
+" done by keeping SHIFT pressed while using the left mouse button\n"
+,
+"Edit-with-Vim context menu entry\n"
+"--------------------------------\n"
+"(this choice is only available when gvim.exe and gvimext.dll are present)\n"
+"You can associate different file types with Vim, so that you can (double)\n"
+"click on a file to edit it with Vim. This means you have to individually\n"
+"select each file type.\n"
+"An alternative is the option offered here: Install an \"Edit with Vim\"\n"
+"entry in the popup menu for the right mouse button. This means you can\n"
+"edit any file with Vim.\n"
+,
+"\"Open With...\" context menu entry\n"
+"--------------------------------\n"
+"(this choice is only available when gvim.exe is present)\n"
+"This option adds Vim to the \"Open With...\" entry in the popup menu for\n"
+"the right mouse button. This also makes it possible to edit HTML files\n"
+"directly from Internet Explorer.\n"
+,
+"Add Vim to the Start menu\n"
+"-------------------------\n"
+"In Windows 95 and later, Vim can be added to the Start menu. This will\n"
+"create a submenu with an entry for vim, gvim, evim, vimdiff, etc..\n"
+,
+"Icons on the desktop\n"
+"--------------------\n"
+"(these choices are only available when installing gvim)\n"
+"In Windows 95 and later, shortcuts (icons) can be created on the Desktop.\n"
+,
+"Create plugin directories\n"
+"-------------------------\n"
+"Plugin directories allow extending Vim by dropping a file into a directory.\n"
+"This choice allows creating them in $HOME (if you have a home directory) or\n"
+"$VIM (used for everybody on the system).\n"
+,
+NULL
+ };
+ int i;
+ int c;
+
+ rewind(stdin);
+ printf("\n");
+ for (i = 0; items[i] != NULL; ++i)
+ {
+ printf(items[i]);
+ printf("\n");
+ printf("Hit Enter to continue, b (back) or q (quit help): ");
+ c = getchar();
+ rewind(stdin);
+ if (c == 'b' || c == 'B')
+ {
+ if (i == 0)
+ --i;
+ else
+ i -= 2;
+ }
+ if (c == 'q' || c == 'Q')
+ break;
+ printf("\n");
+ }
+}
+
+/*
+ * Install the choices.
+ */
+ static void
+install(void)
+{
+ int i;
+
+ /* Install the selected choices. */
+ for (i = 0; i < choice_count; ++i)
+ if (choices[i].installfunc != NULL && choices[i].active)
+ (choices[i].installfunc)(i);
+
+ /* Add some entries to the registry, if needed. */
+ if (install_popup
+ || install_openwith
+ || (need_uninstall_entry && interactive)
+ || !interactive)
+ install_registry();
+
+#ifdef WIN3264
+ /* Register gvim with OLE. */
+ if (has_gvim)
+ install_OLE_register();
+#endif
+}
+
+/*
+ * request_choice
+ */
+ static void
+request_choice(void)
+{
+ int i;
+
+ printf("\n\nInstall will do for you:\n");
+ for (i = 0; i < choice_count; ++i)
+ if (choices[i].active)
+ printf("%2d %s\n", i + 1, choices[i].text);
+ printf("To change an item, enter its number\n\n");
+ printf("Enter item number, h (help), d (do it) or q (quit): ");
+}
+
+ int
+main(int argc, char **argv)
+{
+ int i;
+ char buf[BUFSIZE];
+
+ /*
+ * Run interactively if there are no command line arguments.
+ */
+ if (argc > 1)
+ interactive = 0;
+ else
+ interactive = 1;
+
+ /* Initialize this program. */
+ do_inits(argv);
+
+#ifdef WIN3264
+ if (argc > 1 && strcmp(argv[1], "-uninstall-check") == 0)
+ {
+ /* Only check for already installed Vims. Used by NSIS installer. */
+ i = uninstall_check();
+
+ /* Find the value of $VIM, because NSIS isn't able to do this by
+ * itself. */
+ get_vim_env();
+
+ /* When nothing found exit quietly. If something found wait for
+ * return pressed. */
+ if (i)
+ myexit(0);
+ exit(0);
+ }
+#endif
+
+ printf("This program sets up the installation of Vim "
+ VIM_VERSION_MEDIUM "\n\n");
+
+ /* Check if the user unpacked the archives properly. */
+ check_unpack();
+
+#ifdef WIN3264
+ /* Check for already installed Vims. */
+ if (interactive)
+ uninstall_check();
+#endif
+
+ /* Find out information about the system. */
+ inspect_system();
+
+ if (interactive)
+ {
+ /* Setup all the choices. */
+ setup_choices();
+
+ /* Let the user change choices and finally install (or quit). */
+ for (;;)
+ {
+ request_choice();
+ rewind(stdin);
+ if (scanf("%99s", buf) == 1)
+ {
+ if (isdigit(buf[0]))
+ {
+ /* Change a choice. */
+ i = atoi(buf);
+ if (i > 0 && i <= choice_count && choices[i - 1].active)
+ (choices[i - 1].changefunc)(i - 1);
+ else
+ printf("\nIllegal choice\n");
+ }
+ else if (buf[0] == 'h' || buf[0] == 'H')
+ {
+ /* Help */
+ show_help();
+ }
+ else if (buf[0] == 'd' || buf[0] == 'D')
+ {
+ /* Install! */
+ install();
+ printf("\nThat finishes the installation. Happy Vimming!\n");
+ break;
+ }
+ else if (buf[0] == 'q' || buf[0] == 'Q')
+ {
+ /* Quit */
+ printf("\nExiting without anything done\n");
+ break;
+ }
+ else
+ printf("\nIllegal choice\n");
+ }
+ }
+ printf("\n");
+ }
+ else
+ {
+ /*
+ * Run non-interactive - setup according to the command line switches
+ */
+ command_line_setup_choices(argc, argv);
+ install();
+ }
+
+ myexit(0);
+ /*NOTREACHED*/
+ return 0;
+}
diff --git a/src/dosinst.h b/src/dosinst.h
new file mode 100644
index 000000000..5ff4d67a0
--- /dev/null
+++ b/src/dosinst.h
@@ -0,0 +1,645 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * dosinst.h: Common code for dosinst.c and uninstal.c
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifndef UNIX_LINT
+# include <io.h>
+# include <ctype.h>
+
+# ifndef __CYGWIN__
+# include <direct.h>
+# endif
+
+# if defined(_WIN64) || defined(WIN32)
+# define WIN3264
+# include <windows.h>
+# include <shlobj.h>
+# else
+# include <dir.h>
+# include <bios.h>
+# include <dos.h>
+# endif
+#endif
+
+#ifdef UNIX_LINT
+/* Running lint on Unix: Some things are missing. */
+char *searchpath(char *name);
+#endif
+
+#if defined(DJGPP) || defined(UNIX_LINT)
+# include <unistd.h>
+# include <errno.h>
+#endif
+
+#include "version.h"
+
+#if defined(DJGPP) || defined(UNIX_LINT)
+# define vim_mkdir(x, y) mkdir((char *)(x), y)
+#else
+# if defined(WIN3264) && !defined(__BORLANDC__)
+# define vim_mkdir(x, y) _mkdir((char *)(x))
+# else
+# define vim_mkdir(x, y) mkdir((char *)(x))
+# endif
+#endif
+/* ---------------------------------------- */
+
+
+#define BUFSIZE 512 /* long enough to hold a file name path */
+#define NUL 0
+
+#define FAIL 0
+#define OK 1
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#define VIM_STARTMENU "Programs\\Vim " VIM_VERSION_SHORT
+
+int interactive; /* non-zero when running interactively */
+
+/*
+ * Call malloc() and exit when out of memory.
+ */
+ static void *
+alloc(int len)
+{
+ char *s;
+
+ s = malloc(len);
+ if (s == NULL)
+ {
+ printf("ERROR: out of memory\n");
+ exit(1);
+ }
+ return (void *)s;
+}
+
+/*
+ * The toupper() in Bcc 5.5 doesn't work, use our own implementation.
+ */
+ static int
+mytoupper(int c)
+{
+ if (c >= 'a' && c <= 'z')
+ return c - 'a' + 'A';
+ return c;
+}
+
+ static void
+myexit(int n)
+{
+ if (!interactive)
+ {
+ /* Present a prompt, otherwise error messages can't be read. */
+ printf("Press Enter to continue\n");
+ rewind(stdin);
+ (void)getchar();
+ }
+ exit(n);
+}
+
+#ifdef WIN3264
+/* This symbol is not defined in older versions of the SDK or Visual C++ */
+
+#ifndef VER_PLATFORM_WIN32_WINDOWS
+# define VER_PLATFORM_WIN32_WINDOWS 1
+#endif
+
+static DWORD g_PlatformId;
+
+/*
+ * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
+ * VER_PLATFORM_WIN32_WINDOWS (Win95).
+ */
+ static void
+PlatformId(void)
+{
+ static int done = FALSE;
+
+ if (!done)
+ {
+ OSVERSIONINFO ovi;
+
+ ovi.dwOSVersionInfoSize = sizeof(ovi);
+ GetVersionEx(&ovi);
+
+ g_PlatformId = ovi.dwPlatformId;
+ done = TRUE;
+ }
+}
+
+# ifdef __BORLANDC__
+/* Borland defines its own searchpath() in dir.h */
+# include <dir.h>
+# else
+ static char *
+searchpath(char *name)
+{
+ static char widename[2 * BUFSIZE];
+ static char location[2 * BUFSIZE + 2];
+
+ /* There appears to be a bug in FindExecutableA() on Windows NT.
+ * Use FindExecutableW() instead... */
+ PlatformId();
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
+ (LPWSTR)widename, BUFSIZE);
+ if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
+ (LPWSTR)location) > (HINSTANCE)32)
+ {
+ WideCharToMultiByte(CP_ACP, 0, (LPWSTR)location, -1,
+ (LPSTR)widename, 2 * BUFSIZE, NULL, NULL);
+ return widename;
+ }
+ }
+ else
+ {
+ if (FindExecutableA((LPCTSTR)name, (LPCTSTR)"",
+ (LPTSTR)location) > (HINSTANCE)32)
+ return location;
+ }
+ return NULL;
+}
+# endif
+#endif
+
+/*
+ * Call searchpath() and save the result in allocated memory, or return NULL.
+ */
+ static char *
+searchpath_save(char *name)
+{
+ char *p;
+ char *s;
+
+ p = searchpath(name);
+ if (p == NULL)
+ return NULL;
+ s = alloc(strlen(p) + 1);
+ strcpy(s, p);
+ return s;
+}
+
+#ifdef WIN3264
+/*
+ * Get the path to a requested Windows shell folder.
+ *
+ * Return FAIL on error, OK on success
+ */
+ int
+get_shell_folder_path(
+ char *shell_folder_path,
+ const char *shell_folder_name)
+{
+ /*
+ * The following code was successfully built with make_mvc.mak.
+ * The resulting executable worked on Windows 95, Millennium Edition, and
+ * 2000 Professional. But it was changed after testing...
+ */
+ LPITEMIDLIST pidl = 0; /* Pointer to an Item ID list allocated below */
+ LPMALLOC pMalloc; /* Pointer to an IMalloc interface */
+ int csidl;
+ int alt_csidl = -1;
+ static int desktop_csidl = -1;
+ static int programs_csidl = -1;
+ int *pcsidl;
+ int r;
+
+ if (strcmp(shell_folder_name, "desktop") == 0)
+ {
+ pcsidl = &desktop_csidl;
+#ifdef CSIDL_COMMON_DESKTOPDIRECTORY
+ csidl = CSIDL_COMMON_DESKTOPDIRECTORY;
+ alt_csidl = CSIDL_DESKTOP;
+#else
+ csidl = CSIDL_DESKTOP;
+#endif
+ }
+ else if (strncmp(shell_folder_name, "Programs", 8) == 0)
+ {
+ pcsidl = &programs_csidl;
+#ifdef CSIDL_COMMON_PROGRAMS
+ csidl = CSIDL_COMMON_PROGRAMS;
+ alt_csidl = CSIDL_PROGRAMS;
+#else
+ csidl = CSIDL_PROGRAMS;
+#endif
+ }
+ else
+ {
+ printf("\nERROR (internal) unrecognised shell_folder_name: \"%s\"\n\n",
+ shell_folder_name);
+ return FAIL;
+ }
+
+ /* Did this stuff before, use the same ID again. */
+ if (*pcsidl >= 0)
+ {
+ csidl = *pcsidl;
+ alt_csidl = -1;
+ }
+
+retry:
+ /* Initialize pointer to IMalloc interface */
+ if (NOERROR != SHGetMalloc(&pMalloc))
+ {
+ printf("\nERROR getting interface for shell_folder_name: \"%s\"\n\n",
+ shell_folder_name);
+ return FAIL;
+ }
+
+ /* Get an ITEMIDLIST corresponding to the folder code */
+ if (NOERROR != SHGetSpecialFolderLocation(0, csidl, &pidl))
+ {
+ if (alt_csidl < 0 || NOERROR != SHGetSpecialFolderLocation(0,
+ alt_csidl, &pidl))
+ {
+ printf("\nERROR getting ITEMIDLIST for shell_folder_name: \"%s\"\n\n",
+ shell_folder_name);
+ return FAIL;
+ }
+ csidl = alt_csidl;
+ alt_csidl = -1;
+ }
+
+ /* Translate that ITEMIDLIST to a string */
+ r = SHGetPathFromIDList(pidl, shell_folder_path);
+
+ /* Free the data associated with pidl */
+ pMalloc->lpVtbl->Free(pMalloc, pidl);
+ /* Release the IMalloc interface */
+ pMalloc->lpVtbl->Release(pMalloc);
+
+ if (!r)
+ {
+ if (alt_csidl >= 0)
+ {
+ /* We probably get here for Windows 95: the "all users"
+ * desktop/start menu entry doesn't exist. */
+ csidl = alt_csidl;
+ alt_csidl = -1;
+ goto retry;
+ }
+ printf("\nERROR translating ITEMIDLIST for shell_folder_name: \"%s\"\n\n",
+ shell_folder_name);
+ return FAIL;
+ }
+
+ /* If there is an alternative: verify we can write in this directory.
+ * This should cause a retry when the "all users" directory exists but we
+ * are a normal user and can't write there. */
+ if (alt_csidl >= 0)
+ {
+ char tbuf[BUFSIZE];
+ FILE *fd;
+
+ strcpy(tbuf, shell_folder_path);
+ strcat(tbuf, "\\vim write test");
+ fd = fopen(tbuf, "w");
+ if (fd == NULL)
+ {
+ csidl = alt_csidl;
+ alt_csidl = -1;
+ goto retry;
+ }
+ fclose(fd);
+ unlink(tbuf);
+ }
+
+ /*
+ * Keep the found csidl for next time, so that we don't have to do the
+ * write test every time.
+ */
+ if (*pcsidl < 0)
+ *pcsidl = csidl;
+
+ if (strncmp(shell_folder_name, "Programs\\", 9) == 0)
+ strcat(shell_folder_path, shell_folder_name + 8);
+
+ return OK;
+}
+#endif
+
+/*
+ * List of targets. The first one (index zero) is used for the default path
+ * for the batch files.
+ */
+#define TARGET_COUNT 8
+
+struct
+{
+ char *name; /* Vim exe name (without .exe) */
+ char *batname; /* batch file name */
+ char *lnkname; /* shortcut file name */
+ char *exename; /* exe file name */
+ char *exenamearg; /* exe file name when using exearg */
+ char *exearg; /* argument for vim.exe or gvim.exe */
+ char *oldbat; /* path to existing xxx.bat or NULL */
+ char *oldexe; /* path to existing xxx.exe or NULL */
+ char batpath[BUFSIZE]; /* path of batch file to create; not
+ created when it's empty */
+} targets[TARGET_COUNT] =
+{
+ {"all", "batch files"},
+ {"vim", "vim.bat", "Vim.lnk",
+ "vim.exe", "vim.exe", ""},
+ {"gvim", "gvim.bat", "gVim.lnk",
+ "gvim.exe", "gvim.exe", ""},
+ {"evim", "evim.bat", "gVim Easy.lnk",
+ "evim.exe", "gvim.exe", "-y"},
+ {"view", "view.bat", "Vim Read-only.lnk",
+ "view.exe", "vim.exe", "-R"},
+ {"gview", "gview.bat", "gVim Read-only.lnk",
+ "gview.exe", "gvim.exe", "-R"},
+ {"vimdiff", "vimdiff.bat", "Vim Diff.lnk",
+ "vimdiff.exe","vim.exe", "-d"},
+ {"gvimdiff","gvimdiff.bat", "gVim Diff.lnk",
+ "gvimdiff.exe","gvim.exe", "-d"},
+};
+
+#define ICON_COUNT 3
+char *(icon_names[ICON_COUNT]) =
+ {"gVim " VIM_VERSION_SHORT,
+ "gVim Easy " VIM_VERSION_SHORT,
+ "gVim Read only " VIM_VERSION_SHORT};
+char *(icon_link_names[ICON_COUNT]) =
+ {"gVim " VIM_VERSION_SHORT ".lnk",
+ "gVim Easy " VIM_VERSION_SHORT ".lnk",
+ "gVim Read only " VIM_VERSION_SHORT ".lnk"};
+
+/* This is only used for dosinst.c and for uninstal.c when not being able to
+ * directly access registry entries. */
+#if !defined(WIN3264) || defined(DOSINST)
+/*
+ * Run an external command and wait for it to finish.
+ */
+ static void
+run_command(char *cmd)
+{
+ char *cmd_path;
+ char cmd_buf[BUFSIZE];
+ char *p;
+
+ /* On WinNT, 'start' is a shell built-in for cmd.exe rather than an
+ * executable (start.exe) like in Win9x. DJGPP, being a DOS program,
+ * is given the COMSPEC command.com by WinNT, so we have to find
+ * cmd.exe manually and use it. */
+ cmd_path = searchpath_save("cmd.exe");
+ if (cmd_path != NULL)
+ {
+ /* There is a cmd.exe, so this might be Windows NT. If it is,
+ * we need to call cmd.exe explicitly. If it is a later OS,
+ * calling cmd.exe won't hurt if it is present.
+ * Also, "wait" on NT expects a window title argument.
+ */
+ /* Replace the slashes with backslashes. */
+ while ((p = strchr(cmd_path, '/')) != NULL)
+ *p = '\\';
+ sprintf(cmd_buf, "%s /c start \"vimcmd\" /w %s", cmd_path, cmd);
+ free(cmd_path);
+ }
+ else
+ {
+ /* No cmd.exe, just make the call and let the system handle it. */
+ sprintf(cmd_buf, "start /w %s", cmd);
+ }
+ system(cmd_buf);
+}
+#endif
+
+/*
+ * Append a backslash to "name" if there isn't one yet.
+ */
+ static void
+add_pathsep(char *name)
+{
+ int len = strlen(name);
+
+ if (len > 0 && name[len - 1] != '\\' && name[len - 1] != '/')
+ strcat(name, "\\");
+}
+
+/*
+ * The normal chdir() does not change the default drive. This one does.
+ */
+/*ARGSUSED*/
+ int
+change_drive(int drive)
+{
+#ifdef WIN3264
+ char temp[3] = "-:";
+ temp[0] = (char)(drive + 'A' - 1);
+ return !SetCurrentDirectory(temp);
+#else
+# ifndef UNIX_LINT
+ union REGS regs;
+
+ regs.h.ah = 0x0e;
+ regs.h.dl = drive - 1;
+ intdos(&regs, &regs); /* set default drive */
+ regs.h.ah = 0x19;
+ intdos(&regs, &regs); /* get default drive */
+ if (regs.h.al == drive - 1)
+ return 0;
+# endif
+ return -1;
+#endif
+}
+
+/*
+ * Change directory to "path".
+ * Return 0 for success, -1 for failure.
+ */
+ int
+mch_chdir(char *path)
+{
+ if (path[0] == NUL) /* just checking... */
+ return 0;
+ if (path[1] == ':') /* has a drive name */
+ {
+ if (change_drive(mytoupper(path[0]) - 'A' + 1))
+ return -1; /* invalid drive name */
+ path += 2;
+ }
+ if (*path == NUL) /* drive name only */
+ return 0;
+ return chdir(path); /* let the normal chdir() do the rest */
+}
+
+/*
+ * Expand the executable name into a full path name.
+ */
+#if defined(__BORLANDC__) && !defined(WIN3264)
+
+/* Only Borland C++ has this. */
+# define my_fullpath(b, n, l) _fullpath(b, n, l)
+
+#else
+ static char *
+my_fullpath(char *buf, char *fname, int len)
+{
+# ifdef WIN3264
+ /* Only GetModuleFileName() will get the long file name path.
+ * GetFullPathName() may still use the short (FAT) name. */
+ DWORD len_read = GetModuleFileName(NULL, buf, (size_t)len);
+
+ return (len_read > 0 && len_read < (DWORD)len) ? buf : NULL;
+# else
+ char olddir[BUFSIZE];
+ char *p, *q;
+ int c;
+ char *retval = buf;
+
+ if (strchr(fname, ':') != NULL) /* allready expanded */
+ {
+ strncpy(buf, fname, len);
+ }
+ else
+ {
+ *buf = NUL;
+ /*
+ * change to the directory for a moment,
+ * and then do the getwd() (and get back to where we were).
+ * This will get the correct path name with "../" things.
+ */
+ p = strrchr(fname, '/');
+ q = strrchr(fname, '\\');
+ if (q != NULL && (p == NULL || q > p))
+ p = q;
+ q = strrchr(fname, ':');
+ if (q != NULL && (p == NULL || q > p))
+ p = q;
+ if (p != NULL)
+ {
+ if (getcwd(olddir, BUFSIZE) == NULL)
+ {
+ p = NULL; /* can't get current dir: don't chdir */
+ retval = NULL;
+ }
+ else
+ {
+ if (p == fname) /* /fname */
+ q = p + 1; /* -> / */
+ else if (q + 1 == p) /* ... c:\foo */
+ q = p + 1; /* -> c:\ */
+ else /* but c:\foo\bar */
+ q = p; /* -> c:\foo */
+
+ c = *q; /* truncate at start of fname */
+ *q = NUL;
+ if (mch_chdir(fname)) /* change to the directory */
+ retval = NULL;
+ else
+ {
+ fname = q;
+ if (c == '\\') /* if we cut the name at a */
+ fname++; /* '\', don't add it again */
+ }
+ *q = c;
+ }
+ }
+ if (getcwd(buf, len) == NULL)
+ {
+ retval = NULL;
+ *buf = NUL;
+ }
+ /*
+ * Concatenate the file name to the path.
+ */
+ if (strlen(buf) + strlen(fname) >= len - 1)
+ {
+ printf("ERROR: File name too long!\n");
+ myexit(1);
+ }
+ add_pathsep(buf);
+ strcat(buf, fname);
+ if (p)
+ mch_chdir(olddir);
+ }
+
+ /* Replace forward slashes with backslashes, required for the path to a
+ * command. */
+ while ((p = strchr(buf, '/')) != NULL)
+ *p = '\\';
+
+ return retval;
+# endif
+}
+#endif
+
+/*
+ * Remove the tail from a file or directory name.
+ * Puts a NUL on the last '/' or '\'.
+ */
+ static void
+remove_tail(char *path)
+{
+ int i;
+
+ for (i = strlen(path) - 1; i > 0; --i)
+ if (path[i] == '/' || path[i] == '\\')
+ {
+ path[i] = NUL;
+ break;
+ }
+}
+
+
+char installdir[BUFSIZE]; /* top of the installation dir, where the
+ install.exe is located, E.g.:
+ "c:\vim\vim60" */
+int runtimeidx; /* index in installdir[] where "vim60" starts */
+char *sysdrive; /* system drive or "c:\" */
+
+/*
+ * Setup for using this program.
+ * Sets "installdir[]".
+ */
+ static void
+do_inits(char **argv)
+{
+#ifdef DJGPP
+ /*
+ * Use Long File Names by default, if $LFN not set.
+ */
+ if (getenv("LFN") == NULL)
+ putenv("LFN=y");
+#endif
+
+ /* Find out the full path of our executable. */
+ if (my_fullpath(installdir, argv[0], BUFSIZE) == NULL)
+ {
+ printf("ERROR: Cannot get name of executable\n");
+ myexit(1);
+ }
+ /* remove the tail, the executable name "install.exe" */
+ remove_tail(installdir);
+
+ /* change to the installdir */
+ mch_chdir(installdir);
+
+ /* Find the system drive. Only used for searching the Vim executable, not
+ * very important. */
+ sysdrive = getenv("SYSTEMDRIVE");
+ if (sysdrive == NULL || *sysdrive == NUL)
+ sysdrive = "C:\\";
+}
diff --git a/src/edit.c b/src/edit.c
new file mode 100644
index 000000000..9a42f5ae8
--- /dev/null
+++ b/src/edit.c
@@ -0,0 +1,7614 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * edit.c: functions for Insert mode
+ */
+
+#include "vim.h"
+
+#ifdef FEAT_INS_EXPAND
+/*
+ * definitions used for CTRL-X submode
+ */
+#define CTRL_X_WANT_IDENT 0x100
+
+#define CTRL_X_NOT_DEFINED_YET 1
+#define CTRL_X_SCROLL 2
+#define CTRL_X_WHOLE_LINE 3
+#define CTRL_X_FILES 4
+#define CTRL_X_TAGS (5 + CTRL_X_WANT_IDENT)
+#define CTRL_X_PATH_PATTERNS (6 + CTRL_X_WANT_IDENT)
+#define CTRL_X_PATH_DEFINES (7 + CTRL_X_WANT_IDENT)
+#define CTRL_X_FINISHED 8
+#define CTRL_X_DICTIONARY (9 + CTRL_X_WANT_IDENT)
+#define CTRL_X_THESAURUS (10 + CTRL_X_WANT_IDENT)
+#define CTRL_X_CMDLINE 11
+
+#define CHECK_KEYS_TIME 30
+
+#define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT]
+
+static char *ctrl_x_msgs[] =
+{
+ N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */
+ N_(" ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"),
+ /* Scroll has it's own msgs, in it's place there is the msg for local
+ * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo */
+ N_(" Keyword Local completion (^N^P)"),
+ N_(" Whole line completion (^L^N^P)"),
+ N_(" File name completion (^F^N^P)"),
+ N_(" Tag completion (^]^N^P)"),
+ N_(" Path pattern completion (^N^P)"),
+ N_(" Definition completion (^D^N^P)"),
+ NULL,
+ N_(" Dictionary completion (^K^N^P)"),
+ N_(" Thesaurus completion (^T^N^P)"),
+ N_(" Command-line completion (^V^N^P)")
+};
+
+static char_u e_hitend[] = N_("Hit end of paragraph");
+
+/*
+ * Structure used to store one match for insert completion.
+ */
+struct Completion
+{
+ struct Completion *next;
+ struct Completion *prev;
+ char_u *str; /* matched text */
+ char_u *fname; /* file containing the match */
+ int original; /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */
+ int number; /* sequence number */
+};
+
+/* the original text when the expansion begun */
+#define ORIGINAL_TEXT (1)
+#define FREE_FNAME (2)
+
+/*
+ * All the current matches are stored in a list.
+ * "first_match" points to the start of the list.
+ * "curr_match" points to the currently selected entry.
+ * "shown_match" is different from curr_match during ins_compl_get_exp().
+ */
+static struct Completion *first_match = NULL;
+static struct Completion *curr_match = NULL;
+static struct Completion *shown_match = NULL;
+
+static int started_completion = FALSE;
+static int completion_matches = 0;
+static char_u *complete_pat = NULL;
+static int complete_direction = FORWARD;
+static int shown_direction = FORWARD;
+static int completion_pending = FALSE;
+static pos_T initial_pos;
+static colnr_T complete_col = 0; /* column where the text starts
+ that is being completed */
+static int save_sm;
+static char_u *original_text = NULL; /* text before completion */
+static int continue_mode = 0;
+static expand_T complete_xp;
+
+static int ins_compl_add __ARGS((char_u *str, int len, char_u *, int dir, int reuse));
+static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches, int dir));
+static int ins_compl_make_cyclic __ARGS((void));
+static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
+static void ins_compl_free __ARGS((void));
+static void ins_compl_clear __ARGS((void));
+static void ins_compl_prep __ARGS((int c));
+static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag));
+static int ins_compl_get_exp __ARGS((pos_T *ini, int dir));
+static void ins_compl_delete __ARGS((void));
+static void ins_compl_insert __ARGS((void));
+static int ins_compl_next __ARGS((int allow_get_expansion));
+static int ins_complete __ARGS((int c));
+static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
+#endif /* FEAT_INS_EXPAND */
+
+#define BACKSPACE_CHAR 1
+#define BACKSPACE_WORD 2
+#define BACKSPACE_WORD_NOT_SPACE 3
+#define BACKSPACE_LINE 4
+
+static void ins_redraw __ARGS((void));
+static void ins_ctrl_v __ARGS((void));
+static void undisplay_dollar __ARGS((void));
+static void insert_special __ARGS((int, int, int));
+static void check_auto_format __ARGS((int));
+static void redo_literal __ARGS((int c));
+static void start_arrow __ARGS((pos_T *end_insert_pos));
+static void stop_insert __ARGS((pos_T *end_insert_pos, int esc));
+static int echeck_abbr __ARGS((int));
+static void replace_push_off __ARGS((int c));
+static int replace_pop __ARGS((void));
+static void replace_join __ARGS((int off));
+static void replace_pop_ins __ARGS((void));
+#ifdef FEAT_MBYTE
+static void mb_replace_pop_ins __ARGS((int cc));
+#endif
+static void replace_flush __ARGS((void));
+static void replace_do_bs __ARGS((void));
+#ifdef FEAT_CINDENT
+static int cindent_on __ARGS((void));
+#endif
+static void ins_reg __ARGS((void));
+static void ins_ctrl_g __ARGS((void));
+static int ins_esc __ARGS((long *count, int cmdchar));
+#ifdef FEAT_RIGHTLEFT
+static void ins_ctrl_ __ARGS((void));
+#endif
+#ifdef FEAT_VISUAL
+static int ins_start_select __ARGS((int c));
+#endif
+static void ins_shift __ARGS((int c, int lastc));
+static void ins_del __ARGS((void));
+static int ins_bs __ARGS((int c, int mode, int *inserted_space_p));
+#ifdef FEAT_MOUSE
+static void ins_mouse __ARGS((int c));
+static void ins_mousescroll __ARGS((int up));
+#endif
+static void ins_left __ARGS((void));
+static void ins_home __ARGS((int c));
+static void ins_end __ARGS((int c));
+static void ins_s_left __ARGS((void));
+static void ins_right __ARGS((void));
+static void ins_s_right __ARGS((void));
+static void ins_up __ARGS((int startcol));
+static void ins_pageup __ARGS((void));
+static void ins_down __ARGS((int startcol));
+static void ins_pagedown __ARGS((void));
+#ifdef FEAT_DND
+static void ins_drop __ARGS((void));
+#endif
+static int ins_tab __ARGS((void));
+static int ins_eol __ARGS((int c));
+#ifdef FEAT_DIGRAPHS
+static int ins_digraph __ARGS((void));
+#endif
+static int ins_copychar __ARGS((linenr_T lnum));
+#ifdef FEAT_SMARTINDENT
+static void ins_try_si __ARGS((int c));
+#endif
+static colnr_T get_nolist_virtcol __ARGS((void));
+
+static colnr_T Insstart_textlen; /* length of line when insert started */
+static colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */
+
+static char_u *last_insert = NULL; /* the text of the previous insert,
+ K_SPECIAL and CSI are escaped */
+static int last_insert_skip; /* nr of chars in front of previous insert */
+static int new_insert_skip; /* nr of chars in front of current insert */
+
+#ifdef FEAT_CINDENT
+static int can_cindent; /* may do cindenting on this line */
+#endif
+
+static int old_indent = 0; /* for ^^D command in insert mode */
+
+#ifdef FEAT_RIGHTLEFT
+int revins_on; /* reverse insert mode on */
+int revins_chars; /* how much to skip after edit */
+int revins_legal; /* was the last char 'legal'? */
+int revins_scol; /* start column of revins session */
+#endif
+
+#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
+static short previous_script = smRoman;
+#endif
+
+static int ins_need_undo; /* call u_save() before inserting a
+ char. Set when edit() is called.
+ after that arrow_used is used. */
+
+static int did_add_space = FALSE; /* auto_format() added an extra space
+ under the cursor */
+
+/*
+ * edit(): Start inserting text.
+ *
+ * "cmdchar" can be:
+ * 'i' normal insert command
+ * 'a' normal append command
+ * 'R' replace command
+ * 'r' "r<CR>" command: insert one <CR>. Note: count can be > 1, for redo,
+ * but still only one <CR> is inserted. The <Esc> is not used for redo.
+ * 'g' "gI" command.
+ * 'V' "gR" command for Virtual Replace mode.
+ * 'v' "gr" command for single character Virtual Replace mode.
+ *
+ * This function is not called recursively. For CTRL-O commands, it returns
+ * and lets the caller handle the Normal-mode command.
+ *
+ * Return TRUE if a CTRL-O command caused the return (insert mode pending).
+ */
+ int
+edit(cmdchar, startln, count)
+ int cmdchar;
+ int startln; /* if set, insert at start of line */
+ long count;
+{
+ int c = 0;
+ char_u *ptr;
+ int lastc;
+ colnr_T mincol;
+ static linenr_T o_lnum = 0;
+ static int o_eol = FALSE;
+ int i;
+ int did_backspace = TRUE; /* previous char was backspace */
+#ifdef FEAT_CINDENT
+ int line_is_white = FALSE; /* line is empty before insert */
+#endif
+ linenr_T old_topline = 0; /* topline before insertion */
+#ifdef FEAT_DIFF
+ int old_topfill = -1;
+#endif
+ int inserted_space = FALSE; /* just inserted a space */
+ int replaceState = REPLACE;
+ int did_restart_edit = restart_edit;
+
+ /* sleep before redrawing, needed for "CTRL-O :" that results in an
+ * error message */
+ check_for_delay(TRUE);
+
+#ifdef HAVE_SANDBOX
+ /* Don't allow inserting in the sandbox. */
+ if (sandbox != 0)
+ {
+ EMSG(_(e_sandbox));
+ return FALSE;
+ }
+#endif
+
+#ifdef FEAT_INS_EXPAND
+ ins_compl_clear(); /* clear stuff for CTRL-X mode */
+#endif
+
+#ifdef FEAT_MOUSE
+ /*
+ * When doing a paste with the middle mouse button, Insstart is set to
+ * where the paste started.
+ */
+ if (where_paste_started.lnum != 0)
+ Insstart = where_paste_started;
+ else
+#endif
+ {
+ Insstart = curwin->w_cursor;
+ if (startln)
+ Insstart.col = 0;
+ }
+ Insstart_textlen = linetabsize(ml_get_curline());
+ Insstart_blank_vcol = MAXCOL;
+ if (!did_ai)
+ ai_col = 0;
+
+ if (cmdchar != NUL && restart_edit == 0)
+ {
+ ResetRedobuff();
+ AppendNumberToRedobuff(count);
+#ifdef FEAT_VREPLACE
+ if (cmdchar == 'V' || cmdchar == 'v')
+ {
+ /* "gR" or "gr" command */
+ AppendCharToRedobuff('g');
+ AppendCharToRedobuff((cmdchar == 'v') ? 'r' : 'R');
+ }
+ else
+#endif
+ {
+ AppendCharToRedobuff(cmdchar);
+ if (cmdchar == 'g') /* "gI" command */
+ AppendCharToRedobuff('I');
+ else if (cmdchar == 'r') /* "r<CR>" command */
+ count = 1; /* insert only one <CR> */
+ }
+ }
+
+ if (cmdchar == 'R')
+ {
+#ifdef FEAT_FKMAP
+ if (p_fkmap && p_ri)
+ {
+ beep_flush();
+ EMSG(farsi_text_3); /* encoded in Farsi */
+ State = INSERT;
+ }
+ else
+#endif
+ State = REPLACE;
+ }
+#ifdef FEAT_VREPLACE
+ else if (cmdchar == 'V' || cmdchar == 'v')
+ {
+ State = VREPLACE;
+ replaceState = VREPLACE;
+ orig_line_count = curbuf->b_ml.ml_line_count;
+ vr_lines_changed = 1;
+ }
+#endif
+ else
+ State = INSERT;
+
+ stop_insert_mode = FALSE;
+
+ /*
+ * Need to recompute the cursor position, it might move when the cursor is
+ * on a TAB or special character.
+ */
+ curs_columns(TRUE);
+
+ /*
+ * Enable langmap or IME, indicated by 'iminsert'.
+ * Note that IME may enabled/disabled without us noticing here, thus the
+ * 'iminsert' value may not reflect what is actually used. It is updated
+ * when hitting <Esc>.
+ */
+ if (curbuf->b_p_iminsert == B_IMODE_LMAP)
+ State |= LANGMAP;
+#ifdef USE_IM_CONTROL
+ im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
+#endif
+
+#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
+ KeyScript(previous_script);
+#endif
+
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+#ifdef FEAT_RIGHTLEFT
+ /* there is no reverse replace mode */
+ revins_on = (State == INSERT && p_ri);
+ if (revins_on)
+ undisplay_dollar();
+ revins_chars = 0;
+ revins_legal = 0;
+ revins_scol = -1;
+#endif
+
+ /*
+ * Handle restarting Insert mode.
+ * Don't do this for "CTRL-O ." (repeat an insert): we get here with
+ * restart_edit non-zero, and something in the stuff buffer.
+ */
+ if (restart_edit != 0 && stuff_empty())
+ {
+#ifdef FEAT_MOUSE
+ /*
+ * After a paste we consider text typed to be part of the insert for
+ * the pasted text. You can backspace over the pasted text too.
+ */
+ if (where_paste_started.lnum)
+ arrow_used = FALSE;
+ else
+#endif
+ arrow_used = TRUE;
+ restart_edit = 0;
+
+ /*
+ * If the cursor was after the end-of-line before the CTRL-O and it is
+ * now at the end-of-line, put it after the end-of-line (this is not
+ * correct in very rare cases).
+ * Also do this if curswant is greater than the current virtual
+ * column. Eg after "^O$" or "^O80|".
+ */
+ validate_virtcol();
+ update_curswant();
+ if (((o_eol && curwin->w_cursor.lnum == o_lnum)
+ || curwin->w_curswant > curwin->w_virtcol)
+ && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL)
+ {
+ if (ptr[1] == NUL)
+ ++curwin->w_cursor.col;
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ {
+ i = (*mb_ptr2len_check)(ptr);
+ if (ptr[i] == NUL)
+ curwin->w_cursor.col += i;
+ }
+#endif
+ }
+ o_eol = FALSE;
+ }
+ else
+ arrow_used = FALSE;
+
+ /* we are in insert mode now, don't need to start it anymore */
+ need_start_insertmode = FALSE;
+
+ /* Need to save the line for undo before inserting the first char. */
+ ins_need_undo = TRUE;
+
+#ifdef FEAT_MOUSE
+ where_paste_started.lnum = 0;
+#endif
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+#ifdef FEAT_FOLDING
+ /* The cursor line is not in a closed fold, unless 'insertmode' is set or
+ * restarting. */
+ if (!p_im && did_restart_edit == 0)
+ foldOpenCursor();
+#endif
+
+ /*
+ * If 'showmode' is set, show the current (insert/replace/..) mode.
+ * A warning message for changing a readonly file is given here, before
+ * actually changing anything. It's put after the mode, if any.
+ */
+ i = 0;
+ if (p_smd)
+ i = showmode();
+
+ if (!p_im && did_restart_edit == 0)
+ change_warning(i + 1);
+
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+#ifdef FEAT_DIGRAPHS
+ do_digraph(-1); /* clear digraphs */
+#endif
+
+/*
+ * Get the current length of the redo buffer, those characters have to be
+ * skipped if we want to get to the inserted characters.
+ */
+ ptr = get_inserted();
+ if (ptr == NULL)
+ new_insert_skip = 0;
+ else
+ {
+ new_insert_skip = (int)STRLEN(ptr);
+ vim_free(ptr);
+ }
+
+ old_indent = 0;
+
+ /*
+ * Main loop in Insert mode: repeat until Insert mode is left.
+ */
+ for (;;)
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (!revins_legal)
+ revins_scol = -1; /* reset on illegal motions */
+ else
+ revins_legal = 0;
+#endif
+ if (arrow_used) /* don't repeat insert when arrow key used */
+ count = 0;
+
+ if (stop_insert_mode)
+ {
+ /* ":stopinsert" used or 'insertmode' reset */
+ count = 0;
+ goto doESCkey;
+ }
+
+ /* set curwin->w_curswant for next K_DOWN or K_UP */
+ if (!arrow_used)
+ curwin->w_set_curswant = TRUE;
+
+ /* If there is no typeahead may check for timestamps (e.g., for when a
+ * menu invoked a shell command). */
+ if (stuff_empty())
+ {
+ did_check_timestamps = FALSE;
+ if (need_check_timestamps)
+ check_timestamps(FALSE);
+ }
+
+ /*
+ * When emsg() was called msg_scroll will have been set.
+ */
+ msg_scroll = FALSE;
+
+#ifdef FEAT_GUI
+ /* When 'mousefocus' is set a mouse movement may have taken us to
+ * another window. "need_mouse_correct" may then be set because of an
+ * autocommand. */
+ if (need_mouse_correct)
+ gui_mouse_correct();
+#endif
+
+#ifdef FEAT_FOLDING
+ /* Open fold at the cursor line, according to 'foldopen'. */
+ if (fdo_flags & FDO_INSERT)
+ foldOpenCursor();
+ /* Close folds where the cursor isn't, according to 'foldclose' */
+ if (!char_avail())
+ foldCheckClose();
+#endif
+
+ /*
+ * If we inserted a character at the last position of the last line in
+ * the window, scroll the window one line up. This avoids an extra
+ * redraw.
+ * This is detected when the cursor column is smaller after inserting
+ * something.
+ * Don't do this when the topline changed already, it has
+ * already been adjusted (by insertchar() calling open_line())).
+ */
+ if (curbuf->b_mod_set
+ && curwin->w_p_wrap
+ && !did_backspace
+ && curwin->w_topline == old_topline
+#ifdef FEAT_DIFF
+ && curwin->w_topfill == old_topfill
+#endif
+ )
+ {
+ mincol = curwin->w_wcol;
+ validate_cursor_col();
+
+ if ((int)curwin->w_wcol < (int)mincol - curbuf->b_p_ts
+ && curwin->w_wrow == W_WINROW(curwin)
+ + curwin->w_height - 1 - p_so
+ && (curwin->w_cursor.lnum != curwin->w_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill > 0
+#endif
+ ))
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ --curwin->w_topfill;
+ else
+#endif
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_topline, NULL, &old_topline))
+ set_topline(curwin, old_topline + 1);
+ else
+#endif
+ set_topline(curwin, curwin->w_topline + 1);
+ }
+ }
+
+ /* May need to adjust w_topline to show the cursor. */
+ update_topline();
+
+ did_backspace = FALSE;
+
+ validate_cursor(); /* may set must_redraw */
+
+ /*
+ * Redraw the display when no characters are waiting.
+ * Also shows mode, ruler and positions cursor.
+ */
+ ins_redraw();
+
+#ifdef FEAT_SCROLLBIND
+ if (curwin->w_p_scb)
+ do_check_scrollbind(TRUE);
+#endif
+
+ update_curswant();
+ old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ old_topfill = curwin->w_topfill;
+#endif
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = FALSE; /* allow scrolling here */
+#endif
+
+ /*
+ * Get a character for Insert mode.
+ */
+ lastc = c; /* remember previous char for CTRL-D */
+ c = safe_vgetc();
+
+#ifdef FEAT_RIGHTLEFT
+ if (p_hkmap && KeyTyped)
+ c = hkmap(c); /* Hebrew mode mapping */
+#endif
+#ifdef FEAT_FKMAP
+ if (p_fkmap && KeyTyped)
+ c = fkmap(c); /* Farsi mode mapping */
+#endif
+
+#ifdef FEAT_INS_EXPAND
+ /* Prepare for or stop CTRL-X mode. This doesn't do completion, but
+ * it does fix up the text when finishing completion. */
+ ins_compl_prep(c);
+#endif
+
+ /* CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to mode
+ * selected with 'insertmode'. */
+ if (c == Ctrl_BSL)
+ {
+ /* may need to redraw when no more chars available now */
+ ins_redraw();
+ ++no_mapping;
+ ++allow_keys;
+ c = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (c != Ctrl_N && c != Ctrl_G) /* it's something else */
+ {
+ vungetc(c);
+ c = Ctrl_BSL;
+ }
+ else if (c == Ctrl_G && p_im)
+ continue;
+ else
+ {
+ count = 0;
+ goto doESCkey;
+ }
+ }
+
+#ifdef FEAT_DIGRAPHS
+ c = do_digraph(c);
+#endif
+
+#ifdef FEAT_INS_EXPAND
+ if ((c == Ctrl_V || c == Ctrl_Q) && ctrl_x_mode == CTRL_X_CMDLINE)
+ goto docomplete;
+#endif
+ if (c == Ctrl_V || c == Ctrl_Q)
+ {
+ ins_ctrl_v();
+ c = Ctrl_V; /* pretend CTRL-V is last typed character */
+ continue;
+ }
+
+#ifdef FEAT_CINDENT
+ if (cindent_on()
+# ifdef FEAT_INS_EXPAND
+ && ctrl_x_mode == 0
+# endif
+ )
+ {
+ /* A key name preceded by a bang means this key is not to be
+ * inserted. Skip ahead to the re-indenting below.
+ * A key name preceded by a star means that indenting has to be
+ * done before inserting the key. */
+ line_is_white = inindent(0);
+ if (in_cinkeys(c, '!', line_is_white))
+ goto force_cindent;
+ if (can_cindent && in_cinkeys(c, '*', line_is_white)
+ && stop_arrow() == OK)
+ do_c_expr_indent();
+ }
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl)
+ switch (c)
+ {
+ case K_LEFT: c = K_RIGHT; break;
+ case K_S_LEFT: c = K_S_RIGHT; break;
+ case K_C_LEFT: c = K_C_RIGHT; break;
+ case K_RIGHT: c = K_LEFT; break;
+ case K_S_RIGHT: c = K_S_LEFT; break;
+ case K_C_RIGHT: c = K_C_LEFT; break;
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /*
+ * If 'keymodel' contains "startsel", may start selection. If it
+ * does, a CTRL-O and c will be stuffed, we need to get these
+ * characters.
+ */
+ if (ins_start_select(c))
+ continue;
+#endif
+
+ /*
+ * The big switch to handle a character in insert mode.
+ */
+ switch (c)
+ {
+ /* toggle insert/replace mode */
+ case K_INS:
+ case K_KINS:
+#ifdef FEAT_FKMAP
+ if (p_fkmap && p_ri)
+ {
+ beep_flush();
+ EMSG(farsi_text_3); /* encoded in Farsi */
+ break;
+ }
+#endif
+ if (State & REPLACE_FLAG)
+ State = INSERT | (State & LANGMAP);
+ else
+ State = replaceState | (State & LANGMAP);
+ AppendCharToRedobuff(K_INS);
+ showmode();
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+ break;
+
+#ifdef FEAT_INS_EXPAND
+ /* Enter CTRL-X mode */
+ case Ctrl_X:
+ /* CTRL-X after CTRL-V CTRL-X doesn't do anything, so that CTRL-X
+ * CTRL-V works like CTRL-N */
+ if (ctrl_x_mode != CTRL_X_CMDLINE)
+ {
+ /* if the next ^X<> won't ADD nothing, then reset
+ * continue_status */
+ if (continue_status & CONT_N_ADDS)
+ continue_status = (continue_status | CONT_INTRPT);
+ else
+ continue_status = 0;
+ /* We're not sure which CTRL-X mode it will be yet */
+ ctrl_x_mode = CTRL_X_NOT_DEFINED_YET;
+ edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode));
+ edit_submode_pre = NULL;
+ showmode();
+ }
+ break;
+#endif
+
+ /* end of Select mode mapping - ignore */
+ case K_SELECT:
+ break;
+
+ /* suspend when 'insertmode' set */
+ case Ctrl_Z:
+ if (!p_im)
+ goto normalchar; /* insert CTRL-Z as normal char */
+ stuffReadbuff((char_u *)":st\r");
+ c = Ctrl_O;
+ /*FALLTHROUGH*/
+
+ /* execute one command */
+ case Ctrl_O:
+ if (echeck_abbr(Ctrl_O + ABBR_OFF))
+ break;
+ count = 0;
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ restart_edit = 'V';
+ else
+#endif
+ if (State & REPLACE_FLAG)
+ restart_edit = 'R';
+ else
+ restart_edit = 'I';
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ o_eol = FALSE; /* cursor always keeps its column */
+ else
+#endif
+ o_eol = (gchar_cursor() == NUL);
+ goto doESCkey;
+
+#ifdef FEAT_SNIFF
+ case K_SNIFF:
+ stuffcharReadbuff(K_SNIFF);
+ goto doESCkey;
+#endif
+
+ /* Hitting the help key in insert mode is like <ESC> <Help> */
+ case K_HELP:
+ case K_F1:
+ case K_XF1:
+ stuffcharReadbuff(K_HELP);
+ if (p_im)
+ need_start_insertmode = TRUE;
+ goto doESCkey;
+
+#ifdef FEAT_NETBEANS_INTG
+ case K_F21:
+ ++no_mapping; /* don't map the next key hits */
+ i = safe_vgetc();
+ --no_mapping;
+ netbeans_keycommand(i);
+ break;
+#endif
+
+ /* an escape ends input mode */
+ case ESC:
+ if (echeck_abbr(ESC + ABBR_OFF))
+ break;
+ /*FALLTHROUGH*/
+
+ case Ctrl_C:
+#ifdef FEAT_CMDWIN
+ if (c == Ctrl_C && cmdwin_type != 0)
+ {
+ /* Close the cmdline window. */
+ cmdwin_result = K_IGNORE;
+ got_int = FALSE; /* don't stop executing autocommands et al. */
+ goto doESCkey;
+ }
+#endif
+
+#ifdef UNIX
+do_intr:
+#endif
+ /* when 'insertmode' set, and not halfway a mapping, don't leave
+ * Insert mode */
+ if (goto_im())
+ {
+ if (got_int)
+ {
+ (void)vgetc(); /* flush all buffers */
+ got_int = FALSE;
+ }
+ else
+ vim_beep();
+ break;
+ }
+doESCkey:
+ /*
+ * This is the ONLY return from edit()!
+ */
+ /* Always update o_lnum, so that a "CTRL-O ." that adds a line
+ * still puts the cursor back after the inserted text. */
+ if (o_eol && gchar_cursor() == NUL)
+ o_lnum = curwin->w_cursor.lnum;
+
+ if (ins_esc(&count, cmdchar))
+ return (c == Ctrl_O);
+ continue;
+
+ /*
+ * Insert the previously inserted text.
+ * For ^@ the trailing ESC will end the insert, unless there is an
+ * error.
+ */
+ case K_ZERO:
+ case NUL:
+ case Ctrl_A:
+ if (stuff_inserted(NUL, 1L, (c == Ctrl_A)) == FAIL
+ && c != Ctrl_A && !p_im)
+ goto doESCkey; /* quit insert mode */
+ inserted_space = FALSE;
+ break;
+
+ /* insert the contents of a register */
+ case Ctrl_R:
+ ins_reg();
+ auto_format(FALSE, TRUE);
+ inserted_space = FALSE;
+ break;
+
+ case Ctrl_G:
+ ins_ctrl_g();
+ break;
+
+ case Ctrl_HAT:
+ if (map_to_exists_mode((char_u *)"", LANGMAP))
+ {
+ /* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */
+ if (State & LANGMAP)
+ {
+ curbuf->b_p_iminsert = B_IMODE_NONE;
+ State &= ~LANGMAP;
+ }
+ else
+ {
+ curbuf->b_p_iminsert = B_IMODE_LMAP;
+ State |= LANGMAP;
+#ifdef USE_IM_CONTROL
+ im_set_active(FALSE);
+#endif
+ }
+ }
+#ifdef USE_IM_CONTROL
+ else
+ {
+ /* There are no ":lmap" mappings, toggle IM */
+ if (im_get_status())
+ {
+ curbuf->b_p_iminsert = B_IMODE_NONE;
+ im_set_active(FALSE);
+ }
+ else
+ {
+ curbuf->b_p_iminsert = B_IMODE_IM;
+ State &= ~LANGMAP;
+ im_set_active(TRUE);
+ }
+ }
+#endif
+ set_iminsert_global();
+ showmode();
+#ifdef FEAT_GUI
+ /* may show different cursor shape or color */
+ if (gui.in_use)
+ gui_update_cursor(TRUE, FALSE);
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+ /* Show/unshow value of 'keymap' in status lines. */
+ status_redraw_curbuf();
+#endif
+ break;
+
+#ifdef FEAT_RIGHTLEFT
+ case Ctrl__:
+ if (!p_ari)
+ goto normalchar;
+ ins_ctrl_();
+ break;
+#endif
+
+ /* Make indent one shiftwidth smaller. */
+ case Ctrl_D:
+#if defined(FEAT_INS_EXPAND) && defined(FEAT_FIND_ID)
+ if (ctrl_x_mode == CTRL_X_PATH_DEFINES)
+ goto docomplete;
+#endif
+ /* FALLTHROUGH */
+
+ /* Make indent one shiftwidth greater. */
+ case Ctrl_T:
+# ifdef FEAT_INS_EXPAND
+ if (c == Ctrl_T && ctrl_x_mode == CTRL_X_THESAURUS)
+ {
+ if (*curbuf->b_p_tsr == NUL && *p_tsr == NUL)
+ {
+ ctrl_x_mode = 0;
+ msg_attr((char_u *)_("'thesaurus' option is empty"),
+ hl_attr(HLF_E));
+ if (emsg_silent == 0)
+ {
+ vim_beep();
+ setcursor();
+ out_flush();
+ ui_delay(2000L, FALSE);
+ }
+ break;
+ }
+ goto docomplete;
+ }
+# endif
+ ins_shift(c, lastc);
+ auto_format(FALSE, TRUE);
+ inserted_space = FALSE;
+ break;
+
+ /* delete character under the cursor */
+ case K_DEL:
+ case K_KDEL:
+ ins_del();
+ auto_format(FALSE, TRUE);
+ break;
+
+ /* delete character before the cursor */
+ case K_BS:
+ case Ctrl_H:
+ did_backspace = ins_bs(c, BACKSPACE_CHAR, &inserted_space);
+ auto_format(FALSE, TRUE);
+ break;
+
+ /* delete word before the cursor */
+ case Ctrl_W:
+ did_backspace = ins_bs(c, BACKSPACE_WORD, &inserted_space);
+ auto_format(FALSE, TRUE);
+ break;
+
+ /* delete all inserted text in current line */
+ case Ctrl_U:
+ did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space);
+ auto_format(FALSE, TRUE);
+ inserted_space = FALSE;
+ break;
+
+#ifdef FEAT_MOUSE
+ case K_LEFTMOUSE:
+ case K_LEFTMOUSE_NM:
+ case K_LEFTDRAG:
+ case K_LEFTRELEASE:
+ case K_LEFTRELEASE_NM:
+ case K_MIDDLEMOUSE:
+ case K_MIDDLEDRAG:
+ case K_MIDDLERELEASE:
+ case K_RIGHTMOUSE:
+ case K_RIGHTDRAG:
+ case K_RIGHTRELEASE:
+ case K_X1MOUSE:
+ case K_X1DRAG:
+ case K_X1RELEASE:
+ case K_X2MOUSE:
+ case K_X2DRAG:
+ case K_X2RELEASE:
+ ins_mouse(c);
+ break;
+
+ /* Default action for scroll wheel up: scroll up */
+ case K_MOUSEDOWN:
+ ins_mousescroll(FALSE);
+ break;
+
+ /* Default action for scroll wheel down: scroll down */
+ case K_MOUSEUP:
+ ins_mousescroll(TRUE);
+ break;
+#endif
+
+ case K_IGNORE:
+ break;
+
+#ifdef FEAT_GUI
+ case K_VER_SCROLLBAR:
+ ins_scroll();
+ break;
+
+ case K_HOR_SCROLLBAR:
+ ins_horscroll();
+ break;
+#endif
+
+ case K_HOME:
+ case K_KHOME:
+ case K_XHOME:
+ case K_S_HOME:
+ case K_C_HOME:
+ ins_home(c);
+ break;
+
+ case K_END:
+ case K_KEND:
+ case K_XEND:
+ case K_S_END:
+ case K_C_END:
+ ins_end(c);
+ break;
+
+ case K_LEFT:
+ ins_left();
+ break;
+
+ case K_S_LEFT:
+ case K_C_LEFT:
+ ins_s_left();
+ break;
+
+ case K_RIGHT:
+ ins_right();
+ break;
+
+ case K_S_RIGHT:
+ case K_C_RIGHT:
+ ins_s_right();
+ break;
+
+ case K_UP:
+ ins_up(FALSE);
+ break;
+
+ case K_S_UP:
+ case K_PAGEUP:
+ case K_KPAGEUP:
+ ins_pageup();
+ break;
+
+ case K_DOWN:
+ ins_down(FALSE);
+ break;
+
+ case K_S_DOWN:
+ case K_PAGEDOWN:
+ case K_KPAGEDOWN:
+ ins_pagedown();
+ break;
+
+#ifdef FEAT_DND
+ case K_DROP:
+ ins_drop();
+ break;
+#endif
+
+ /* When <S-Tab> isn't mapped, use it like a normal TAB */
+ case K_S_TAB:
+ c = TAB;
+ /* FALLTHROUGH */
+
+ /* TAB or Complete patterns along path */
+ case TAB:
+#if defined(FEAT_INS_EXPAND) && defined(FEAT_FIND_ID)
+ if (ctrl_x_mode == CTRL_X_PATH_PATTERNS)
+ goto docomplete;
+#endif
+ inserted_space = FALSE;
+ if (ins_tab())
+ goto normalchar; /* insert TAB as a normal char */
+ auto_format(FALSE, TRUE);
+ break;
+
+ case K_KENTER:
+ c = CAR;
+ /* FALLTHROUGH */
+ case CAR:
+ case NL:
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ /* In a quickfix window a <CR> jumps to the error under the
+ * cursor. */
+ if (bt_quickfix(curbuf) && c == CAR)
+ {
+ do_cmdline_cmd((char_u *)".cc");
+ break;
+ }
+#endif
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ /* Execute the command in the cmdline window. */
+ cmdwin_result = CAR;
+ goto doESCkey;
+ }
+#endif
+ if (ins_eol(c) && !p_im)
+ goto doESCkey; /* out of memory */
+ auto_format(FALSE, FALSE);
+ inserted_space = FALSE;
+ break;
+
+#if defined(FEAT_DIGRAPHS) || defined (FEAT_INS_EXPAND)
+ case Ctrl_K:
+# ifdef FEAT_INS_EXPAND
+ if (ctrl_x_mode == CTRL_X_DICTIONARY)
+ {
+ if (*curbuf->b_p_dict == NUL && *p_dict == NUL)
+ {
+ ctrl_x_mode = 0;
+ msg_attr((char_u *)_("'dictionary' option is empty"),
+ hl_attr(HLF_E));
+ if (emsg_silent == 0)
+ {
+ vim_beep();
+ setcursor();
+ out_flush();
+ ui_delay(2000L, FALSE);
+ }
+ break;
+ }
+ goto docomplete;
+ }
+# endif
+# ifdef FEAT_DIGRAPHS
+ c = ins_digraph();
+ if (c == NUL)
+ break;
+# endif
+ goto normalchar;
+#endif /* FEAT_DIGRAPHS || FEAT_INS_EXPAND */
+
+#ifdef FEAT_INS_EXPAND
+ case Ctrl_RSB: /* Tag name completion after ^X */
+ if (ctrl_x_mode != CTRL_X_TAGS)
+ goto normalchar;
+ goto docomplete;
+
+ case Ctrl_F: /* File name completion after ^X */
+ if (ctrl_x_mode != CTRL_X_FILES)
+ goto normalchar;
+ goto docomplete;
+#endif
+
+ case Ctrl_L: /* Whole line completion after ^X */
+#ifdef FEAT_INS_EXPAND
+ if (ctrl_x_mode != CTRL_X_WHOLE_LINE)
+#endif
+ {
+ /* CTRL-L with 'insertmode' set: Leave Insert mode */
+ if (p_im)
+ {
+ if (echeck_abbr(Ctrl_L + ABBR_OFF))
+ break;
+ goto doESCkey;
+ }
+ goto normalchar;
+ }
+#ifdef FEAT_INS_EXPAND
+ /* FALLTHROUGH */
+
+ /* Do previous/next pattern completion */
+ case Ctrl_P:
+ case Ctrl_N:
+ /* if 'complete' is empty then plain ^P is no longer special,
+ * but it is under other ^X modes */
+ if (*curbuf->b_p_cpt == NUL
+ && ctrl_x_mode != 0
+ && !(continue_status & CONT_LOCAL))
+ goto normalchar;
+
+docomplete:
+ if (ins_complete(c) == FAIL)
+ continue_status = 0;
+ break;
+#endif /* FEAT_INS_EXPAND */
+
+ case Ctrl_Y: /* copy from previous line or scroll down */
+ case Ctrl_E: /* copy from next line or scroll up */
+#ifdef FEAT_INS_EXPAND
+ if (ctrl_x_mode == CTRL_X_SCROLL)
+ {
+ if (c == Ctrl_Y)
+ scrolldown_clamp();
+ else
+ scrollup_clamp();
+ redraw_later(VALID);
+ }
+ else
+#endif
+ {
+ c = ins_copychar(curwin->w_cursor.lnum
+ + (c == Ctrl_Y ? -1 : 1));
+ if (c != NUL)
+ {
+ long tw_save;
+
+ /* The character must be taken literally, insert like it
+ * was typed after a CTRL-V, and pretend 'textwidth'
+ * wasn't set. Digits, 'o' and 'x' are special after a
+ * CTRL-V, don't use it for these. */
+ if (c < 256 && !isalnum(c))
+ AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */
+ tw_save = curbuf->b_p_tw;
+ curbuf->b_p_tw = -1;
+ insert_special(c, TRUE, FALSE);
+ curbuf->b_p_tw = tw_save;
+#ifdef FEAT_RIGHTLEFT
+ revins_chars++;
+ revins_legal++;
+#endif
+ c = Ctrl_V; /* pretend CTRL-V is last character */
+ auto_format(FALSE, TRUE);
+ }
+ }
+ break;
+
+ default:
+#ifdef UNIX
+ if (c == intr_char) /* special interrupt char */
+ goto do_intr;
+#endif
+
+ /*
+ * Insert a nomal character.
+ */
+normalchar:
+#ifdef FEAT_SMARTINDENT
+ /* Try to perform smart-indenting. */
+ ins_try_si(c);
+#endif
+
+ if (c == ' ')
+ {
+ inserted_space = TRUE;
+#ifdef FEAT_CINDENT
+ if (inindent(0))
+ can_cindent = FALSE;
+#endif
+ if (Insstart_blank_vcol == MAXCOL
+ && curwin->w_cursor.lnum == Insstart.lnum)
+ Insstart_blank_vcol = get_nolist_virtcol();
+ }
+
+ if (vim_iswordc(c) || !echeck_abbr(
+#ifdef FEAT_MBYTE
+ /* Add ABBR_OFF for characters above 0x100, this is
+ * what check_abbr() expects. */
+ (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) :
+#endif
+ c))
+ {
+ insert_special(c, FALSE, FALSE);
+#ifdef FEAT_RIGHTLEFT
+ revins_legal++;
+ revins_chars++;
+#endif
+ }
+
+ auto_format(FALSE, TRUE);
+
+#ifdef FEAT_FOLDING
+ /* When inserting a character the cursor line must never be in a
+ * closed fold. */
+ foldOpenCursor();
+#endif
+ break;
+ } /* end of switch (c) */
+
+ /* If the cursor was moved we didn't just insert a space */
+ if (arrow_used)
+ inserted_space = FALSE;
+
+#ifdef FEAT_CINDENT
+ if (can_cindent && cindent_on()
+# ifdef FEAT_INS_EXPAND
+ && ctrl_x_mode == 0
+# endif
+ )
+ {
+force_cindent:
+ /*
+ * Indent now if a key was typed that is in 'cinkeys'.
+ */
+ if (in_cinkeys(c, ' ', line_is_white))
+ {
+ if (stop_arrow() == OK)
+ /* re-indent the current line */
+ do_c_expr_indent();
+ }
+ }
+#endif /* FEAT_CINDENT */
+
+ } /* for (;;) */
+ /* NOTREACHED */
+}
+
+/*
+ * Redraw for Insert mode.
+ * This is postponed until getting the next character to make '$' in the 'cpo'
+ * option work correctly.
+ * Only redraw when there are no characters available. This speeds up
+ * inserting sequences of characters (e.g., for CTRL-R).
+ */
+ static void
+ins_redraw()
+{
+ if (!char_avail())
+ {
+ if (must_redraw)
+ update_screen(0);
+ else if (clear_cmdline || redraw_cmdline)
+ showmode(); /* clear cmdline and show mode */
+ showruler(FALSE);
+ setcursor();
+ emsg_on_display = FALSE; /* may remove error message now */
+ }
+}
+
+/*
+ * Handle a CTRL-V or CTRL-Q typed in Insert mode.
+ */
+ static void
+ins_ctrl_v()
+{
+ int c;
+
+ /* may need to redraw when no more chars available now */
+ ins_redraw();
+
+ if (redrawing() && !char_avail())
+ edit_putchar('^', TRUE);
+ AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */
+
+#ifdef FEAT_CMDL_INFO
+ add_to_showcmd_c(Ctrl_V);
+#endif
+
+ c = get_literal();
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+ insert_special(c, FALSE, TRUE);
+#ifdef FEAT_RIGHTLEFT
+ revins_chars++;
+ revins_legal++;
+#endif
+}
+
+/*
+ * Put a character directly onto the screen. It's not stored in a buffer.
+ * Used while handling CTRL-K, CTRL-V, etc. in Insert mode.
+ */
+static int pc_status;
+#define PC_STATUS_UNSET 0 /* pc_bytes was not set */
+#define PC_STATUS_RIGHT 1 /* right halve of double-wide char */
+#define PC_STATUS_LEFT 2 /* left halve of double-wide char */
+#define PC_STATUS_SET 3 /* pc_bytes was filled */
+#ifdef FEAT_MBYTE
+static char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */
+#else
+static char_u pc_bytes[2]; /* saved bytes */
+#endif
+static int pc_attr;
+static int pc_row;
+static int pc_col;
+
+ void
+edit_putchar(c, highlight)
+ int c;
+ int highlight;
+{
+ int attr;
+
+ if (ScreenLines != NULL)
+ {
+ update_topline(); /* just in case w_topline isn't valid */
+ validate_cursor();
+ if (highlight)
+ attr = hl_attr(HLF_8);
+ else
+ attr = 0;
+ pc_row = W_WINROW(curwin) + curwin->w_wrow;
+ pc_col = W_WINCOL(curwin);
+#if defined(FEAT_RIGHTLEFT) || defined(FEAT_MBYTE)
+ pc_status = PC_STATUS_UNSET;
+#endif
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl)
+ {
+ pc_col += W_WIDTH(curwin) - 1 - curwin->w_wcol;
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int fix_col = mb_fix_col(pc_col, pc_row);
+
+ if (fix_col != pc_col)
+ {
+ screen_putchar(' ', pc_row, fix_col, attr);
+ --curwin->w_wcol;
+ pc_status = PC_STATUS_RIGHT;
+ }
+ }
+# endif
+ }
+ else
+#endif
+ {
+ pc_col += curwin->w_wcol;
+#ifdef FEAT_MBYTE
+ if (mb_lefthalve(pc_row, pc_col))
+ pc_status = PC_STATUS_LEFT;
+#endif
+ }
+
+ /* save the character to be able to put it back */
+#if defined(FEAT_RIGHTLEFT) || defined(FEAT_MBYTE)
+ if (pc_status == PC_STATUS_UNSET)
+#endif
+ {
+ screen_getbytes(pc_row, pc_col, pc_bytes, &pc_attr);
+ pc_status = PC_STATUS_SET;
+ }
+ screen_putchar(c, pc_row, pc_col, attr);
+ }
+}
+
+/*
+ * Undo the previous edit_putchar().
+ */
+ void
+edit_unputchar()
+{
+ if (pc_status != PC_STATUS_UNSET && pc_row >= msg_scrolled)
+ {
+#if defined(FEAT_MBYTE)
+ if (pc_status == PC_STATUS_RIGHT)
+ ++curwin->w_wcol;
+ if (pc_status == PC_STATUS_RIGHT || pc_status == PC_STATUS_LEFT)
+ redrawWinline(curwin->w_cursor.lnum, FALSE);
+ else
+#endif
+ screen_puts(pc_bytes, pc_row - msg_scrolled, pc_col, pc_attr);
+ }
+}
+
+/*
+ * Called when p_dollar is set: display a '$' at the end of the changed text
+ * Only works when cursor is in the line that changes.
+ */
+ void
+display_dollar(col)
+ colnr_T col;
+{
+ colnr_T save_col;
+
+ if (!redrawing())
+ return;
+
+ cursor_off();
+ save_col = curwin->w_cursor.col;
+ curwin->w_cursor.col = col;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ char_u *p;
+
+ /* If on the last byte of a multi-byte move to the first byte. */
+ p = ml_get_curline();
+ curwin->w_cursor.col -= (*mb_head_off)(p, p + col);
+ }
+#endif
+ curs_columns(FALSE); /* recompute w_wrow and w_wcol */
+ if (curwin->w_wcol < W_WIDTH(curwin))
+ {
+ edit_putchar('$', FALSE);
+ dollar_vcol = curwin->w_virtcol;
+ }
+ curwin->w_cursor.col = save_col;
+}
+
+/*
+ * Call this function before moving the cursor from the normal insert position
+ * in insert mode.
+ */
+ static void
+undisplay_dollar()
+{
+ if (dollar_vcol)
+ {
+ dollar_vcol = 0;
+ redrawWinline(curwin->w_cursor.lnum, FALSE);
+ }
+}
+
+/*
+ * Insert an indent (for <Tab> or CTRL-T) or delete an indent (for CTRL-D).
+ * Keep the cursor on the same character.
+ * type == INDENT_INC increase indent (for CTRL-T or <Tab>)
+ * type == INDENT_DEC decrease indent (for CTRL-D)
+ * type == INDENT_SET set indent to "amount"
+ * if round is TRUE, round the indent to 'shiftwidth' (only with _INC and _Dec).
+ */
+ void
+change_indent(type, amount, round, replaced)
+ int type;
+ int amount;
+ int round;
+ int replaced; /* replaced character, put on replace stack */
+{
+ int vcol;
+ int last_vcol;
+ int insstart_less; /* reduction for Insstart.col */
+ int new_cursor_col;
+ int i;
+ char_u *ptr;
+ int save_p_list;
+ int start_col;
+ colnr_T vc;
+#ifdef FEAT_VREPLACE
+ colnr_T orig_col = 0; /* init for GCC */
+ char_u *new_line, *orig_line = NULL; /* init for GCC */
+
+ /* VREPLACE mode needs to know what the line was like before changing */
+ if (State & VREPLACE_FLAG)
+ {
+ orig_line = vim_strsave(ml_get_curline()); /* Deal with NULL below */
+ orig_col = curwin->w_cursor.col;
+ }
+#endif
+
+ /* for the following tricks we don't want list mode */
+ save_p_list = curwin->w_p_list;
+ curwin->w_p_list = FALSE;
+ vc = getvcol_nolist(&curwin->w_cursor);
+ vcol = vc;
+
+ /*
+ * For Replace mode we need to fix the replace stack later, which is only
+ * possible when the cursor is in the indent. Remember the number of
+ * characters before the cursor if it's possible.
+ */
+ start_col = curwin->w_cursor.col;
+
+ /* determine offset from first non-blank */
+ new_cursor_col = curwin->w_cursor.col;
+ beginline(BL_WHITE);
+ new_cursor_col -= curwin->w_cursor.col;
+
+ insstart_less = curwin->w_cursor.col;
+
+ /*
+ * If the cursor is in the indent, compute how many screen columns the
+ * cursor is to the left of the first non-blank.
+ */
+ if (new_cursor_col < 0)
+ vcol = get_indent() - vcol;
+
+ if (new_cursor_col > 0) /* can't fix replace stack */
+ start_col = -1;
+
+ /*
+ * Set the new indent. The cursor will be put on the first non-blank.
+ */
+ if (type == INDENT_SET)
+ (void)set_indent(amount, SIN_CHANGED);
+ else
+ {
+#ifdef FEAT_VREPLACE
+ int save_State = State;
+
+ /* Avoid being called recursively. */
+ if (State & VREPLACE_FLAG)
+ State = INSERT;
+#endif
+ shift_line(type == INDENT_DEC, round, 1);
+#ifdef FEAT_VREPLACE
+ State = save_State;
+#endif
+ }
+ insstart_less -= curwin->w_cursor.col;
+
+ /*
+ * Try to put cursor on same character.
+ * If the cursor is at or after the first non-blank in the line,
+ * compute the cursor column relative to the column of the first
+ * non-blank character.
+ * If we are not in insert mode, leave the cursor on the first non-blank.
+ * If the cursor is before the first non-blank, position it relative
+ * to the first non-blank, counted in screen columns.
+ */
+ if (new_cursor_col >= 0)
+ {
+ /*
+ * When changing the indent while the cursor is touching it, reset
+ * Insstart_col to 0.
+ */
+ if (new_cursor_col == 0)
+ insstart_less = MAXCOL;
+ new_cursor_col += curwin->w_cursor.col;
+ }
+ else if (!(State & INSERT))
+ new_cursor_col = curwin->w_cursor.col;
+ else
+ {
+ /*
+ * Compute the screen column where the cursor should be.
+ */
+ vcol = get_indent() - vcol;
+ curwin->w_virtcol = (vcol < 0) ? 0 : vcol;
+
+ /*
+ * Advance the cursor until we reach the right screen column.
+ */
+ vcol = last_vcol = 0;
+ new_cursor_col = -1;
+ ptr = ml_get_curline();
+ while (vcol <= (int)curwin->w_virtcol)
+ {
+ last_vcol = vcol;
+#ifdef FEAT_MBYTE
+ if (has_mbyte && new_cursor_col >= 0)
+ new_cursor_col += (*mb_ptr2len_check)(ptr + new_cursor_col);
+ else
+#endif
+ ++new_cursor_col;
+ vcol += lbr_chartabsize(ptr + new_cursor_col, (colnr_T)vcol);
+ }
+ vcol = last_vcol;
+
+ /*
+ * May need to insert spaces to be able to position the cursor on
+ * the right screen column.
+ */
+ if (vcol != (int)curwin->w_virtcol)
+ {
+ curwin->w_cursor.col = new_cursor_col;
+ i = (int)curwin->w_virtcol - vcol;
+ ptr = alloc(i + 1);
+ if (ptr != NULL)
+ {
+ new_cursor_col += i;
+ ptr[i] = NUL;
+ while (--i >= 0)
+ ptr[i] = ' ';
+ ins_str(ptr);
+ vim_free(ptr);
+ }
+ }
+
+ /*
+ * When changing the indent while the cursor is in it, reset
+ * Insstart_col to 0.
+ */
+ insstart_less = MAXCOL;
+ }
+
+ curwin->w_p_list = save_p_list;
+
+ if (new_cursor_col <= 0)
+ curwin->w_cursor.col = 0;
+ else
+ curwin->w_cursor.col = new_cursor_col;
+ curwin->w_set_curswant = TRUE;
+ changed_cline_bef_curs();
+
+ /*
+ * May have to adjust the start of the insert.
+ */
+ if (State & INSERT)
+ {
+ if (curwin->w_cursor.lnum == Insstart.lnum && Insstart.col != 0)
+ {
+ if ((int)Insstart.col <= insstart_less)
+ Insstart.col = 0;
+ else
+ Insstart.col -= insstart_less;
+ }
+ if ((int)ai_col <= insstart_less)
+ ai_col = 0;
+ else
+ ai_col -= insstart_less;
+ }
+
+ /*
+ * For REPLACE mode, may have to fix the replace stack, if it's possible.
+ * If the number of characters before the cursor decreased, need to pop a
+ * few characters from the replace stack.
+ * If the number of characters before the cursor increased, need to push a
+ * few NULs onto the replace stack.
+ */
+ if (REPLACE_NORMAL(State) && start_col >= 0)
+ {
+ while (start_col > (int)curwin->w_cursor.col)
+ {
+ replace_join(0); /* remove a NUL from the replace stack */
+ --start_col;
+ }
+ while (start_col < (int)curwin->w_cursor.col || replaced)
+ {
+ replace_push(NUL);
+ if (replaced)
+ {
+ replace_push(replaced);
+ replaced = NUL;
+ }
+ ++start_col;
+ }
+ }
+
+#ifdef FEAT_VREPLACE
+ /*
+ * For VREPLACE mode, we also have to fix the replace stack. In this case
+ * it is always possible because we backspace over the whole line and then
+ * put it back again the way we wanted it.
+ */
+ if (State & VREPLACE_FLAG)
+ {
+ /* If orig_line didn't allocate, just return. At least we did the job,
+ * even if you can't backspace. */
+ if (orig_line == NULL)
+ return;
+
+ /* Save new line */
+ new_line = vim_strsave(ml_get_curline());
+ if (new_line == NULL)
+ return;
+
+ /* We only put back the new line up to the cursor */
+ new_line[curwin->w_cursor.col] = NUL;
+
+ /* Put back original line */
+ ml_replace(curwin->w_cursor.lnum, orig_line, FALSE);
+ curwin->w_cursor.col = orig_col;
+
+ /* Backspace from cursor to start of line */
+ backspace_until_column(0);
+
+ /* Insert new stuff into line again */
+ ins_bytes(new_line);
+
+ vim_free(new_line);
+ }
+#endif
+}
+
+/*
+ * Truncate the space at the end of a line. This is to be used only in an
+ * insert mode. It handles fixing the replace stack for REPLACE and VREPLACE
+ * modes.
+ */
+ void
+truncate_spaces(line)
+ char_u *line;
+{
+ int i;
+
+ /* find start of trailing white space */
+ for (i = (int)STRLEN(line) - 1; i >= 0 && vim_iswhite(line[i]); i--)
+ {
+ if (State & REPLACE_FLAG)
+ replace_join(0); /* remove a NUL from the replace stack */
+ }
+ line[i + 1] = NUL;
+}
+
+#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \
+ || defined(FEAT_COMMENTS) || defined(PROTO)
+/*
+ * Backspace the cursor until the given column. Handles REPLACE and VREPLACE
+ * modes correctly. May also be used when not in insert mode at all.
+ */
+ void
+backspace_until_column(col)
+ int col;
+{
+ while ((int)curwin->w_cursor.col > col)
+ {
+ curwin->w_cursor.col--;
+ if (State & REPLACE_FLAG)
+ replace_do_bs();
+ else
+ (void)del_char(FALSE);
+ }
+}
+#endif
+
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Is the character 'c' a valid key to go to or keep us in CTRL-X mode?
+ * This depends on the current mode.
+ */
+ int
+vim_is_ctrl_x_key(c)
+ int c;
+{
+ /* Always allow ^R - let it's results then be checked */
+ if (c == Ctrl_R)
+ return TRUE;
+
+ switch (ctrl_x_mode)
+ {
+ case 0: /* Not in any CTRL-X mode */
+ return (c == Ctrl_N || c == Ctrl_P || c == Ctrl_X);
+ case CTRL_X_NOT_DEFINED_YET:
+ return ( c == Ctrl_X || c == Ctrl_Y || c == Ctrl_E
+ || c == Ctrl_L || c == Ctrl_F || c == Ctrl_RSB
+ || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P
+ || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V
+ || c == Ctrl_Q);
+ case CTRL_X_SCROLL:
+ return (c == Ctrl_Y || c == Ctrl_E);
+ case CTRL_X_WHOLE_LINE:
+ return (c == Ctrl_L || c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_FILES:
+ return (c == Ctrl_F || c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_DICTIONARY:
+ return (c == Ctrl_K || c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_THESAURUS:
+ return (c == Ctrl_T || c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_TAGS:
+ return (c == Ctrl_RSB || c == Ctrl_P || c == Ctrl_N);
+#ifdef FEAT_FIND_ID
+ case CTRL_X_PATH_PATTERNS:
+ return (c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_PATH_DEFINES:
+ return (c == Ctrl_D || c == Ctrl_P || c == Ctrl_N);
+#endif
+ case CTRL_X_CMDLINE:
+ return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N
+ || c == Ctrl_X);
+ }
+ EMSG(_(e_internal));
+ return FALSE;
+}
+
+/*
+ * This is like ins_compl_add(), but if ic and inf are set, then the
+ * case of the originally typed text is used, and the case of the completed
+ * text is infered, ie this tries to work out what case you probably wanted
+ * the rest of the word to be in -- webb
+ */
+ int
+ins_compl_add_infercase(str, len, fname, dir, reuse)
+ char_u *str;
+ int len;
+ char_u *fname;
+ int dir;
+ int reuse;
+{
+ int has_lower = FALSE;
+ int was_letter = FALSE;
+ int idx;
+
+ if (p_ic && curbuf->b_p_inf && len < IOSIZE)
+ {
+ /* Infer case of completed part -- webb */
+ /* Use IObuff, str would change text in buffer! */
+ STRNCPY(IObuff, str, len);
+ IObuff[len] = NUL;
+
+ /* Rule 1: Were any chars converted to lower? */
+ for (idx = 0; idx < completion_length; ++idx)
+ {
+ if (islower(original_text[idx]))
+ {
+ has_lower = TRUE;
+ if (isupper(IObuff[idx]))
+ {
+ /* Rule 1 is satisfied */
+ for (idx = completion_length; idx < len; ++idx)
+ IObuff[idx] = TOLOWER_LOC(IObuff[idx]);
+ break;
+ }
+ }
+ }
+
+ /*
+ * Rule 2: No lower case, 2nd consecutive letter converted to
+ * upper case.
+ */
+ if (!has_lower)
+ {
+ for (idx = 0; idx < completion_length; ++idx)
+ {
+ if (was_letter && isupper(original_text[idx])
+ && islower(IObuff[idx]))
+ {
+ /* Rule 2 is satisfied */
+ for (idx = completion_length; idx < len; ++idx)
+ IObuff[idx] = TOUPPER_LOC(IObuff[idx]);
+ break;
+ }
+ was_letter = isalpha(original_text[idx]);
+ }
+ }
+
+ /* Copy the original case of the part we typed */
+ STRNCPY(IObuff, original_text, completion_length);
+
+ return ins_compl_add(IObuff, len, fname, dir, reuse);
+ }
+ return ins_compl_add(str, len, fname, dir, reuse);
+}
+
+/*
+ * Add a match to the list of matches.
+ * If the given string is already in the list of completions, then return
+ * FAIL, otherwise add it to the list and return OK. If there is an error,
+ * maybe because alloc returns NULL, then RET_ERROR is returned -- webb.
+ */
+ static int
+ins_compl_add(str, len, fname, dir, reuse)
+ char_u *str;
+ int len;
+ char_u *fname;
+ int dir;
+ int reuse;
+{
+ struct Completion *match;
+
+ ui_breakcheck();
+ if (got_int)
+ return RET_ERROR;
+ if (len < 0)
+ len = (int)STRLEN(str);
+
+ /*
+ * If the same match is already present, don't add it.
+ */
+ if (first_match != NULL)
+ {
+ match = first_match;
+ do
+ {
+ if ( !(match->original & ORIGINAL_TEXT)
+ && STRNCMP(match->str, str, (size_t)len) == 0
+ && match->str[len] == NUL)
+ return FAIL;
+ match = match->next;
+ } while (match != NULL && match != first_match);
+ }
+
+ /*
+ * Allocate a new match structure.
+ * Copy the values to the new match structure.
+ */
+ match = (struct Completion *)alloc((unsigned)sizeof(struct Completion));
+ if (match == NULL)
+ return RET_ERROR;
+ match->number = -1;
+ if (reuse & ORIGINAL_TEXT)
+ {
+ match->number = 0;
+ match->str = original_text;
+ }
+ else if ((match->str = vim_strnsave(str, len)) == NULL)
+ {
+ vim_free(match);
+ return RET_ERROR;
+ }
+ /* match-fname is:
+ * - curr_match->fname if it is a string equal to fname.
+ * - a copy of fname, FREE_FNAME is set to free later THE allocated mem.
+ * - NULL otherwise. --Acevedo */
+ if (fname && curr_match && curr_match->fname
+ && STRCMP(fname, curr_match->fname) == 0)
+ match->fname = curr_match->fname;
+ else if (fname && (match->fname = vim_strsave(fname)) != NULL)
+ reuse |= FREE_FNAME;
+ else
+ match->fname = NULL;
+ match->original = reuse;
+
+ /*
+ * Link the new match structure in the list of matches.
+ */
+ if (first_match == NULL)
+ match->next = match->prev = NULL;
+ else if (dir == FORWARD)
+ {
+ match->next = curr_match->next;
+ match->prev = curr_match;
+ }
+ else /* BACKWARD */
+ {
+ match->next = curr_match;
+ match->prev = curr_match->prev;
+ }
+ if (match->next)
+ match->next->prev = match;
+ if (match->prev)
+ match->prev->next = match;
+ else /* if there's nothing before, it is the first match */
+ first_match = match;
+ curr_match = match;
+
+ return OK;
+}
+
+/*
+ * Add an array of matches to the list of matches.
+ * Frees matches[].
+ */
+ static void
+ins_compl_add_matches(num_matches, matches, dir)
+ int num_matches;
+ char_u **matches;
+ int dir;
+{
+ int i;
+ int add_r = OK;
+ int ldir = dir;
+
+ for (i = 0; i < num_matches && add_r != RET_ERROR; i++)
+ if ((add_r = ins_compl_add(matches[i], -1, NULL, ldir, 0)) == OK)
+ /* if dir was BACKWARD then honor it just once */
+ ldir = FORWARD;
+ FreeWild(num_matches, matches);
+}
+
+/* Make the completion list cyclic.
+ * Return the number of matches (excluding the original).
+ */
+ static int
+ins_compl_make_cyclic()
+{
+ struct Completion *match;
+ int count = 0;
+
+ if (first_match != NULL)
+ {
+ /*
+ * Find the end of the list.
+ */
+ match = first_match;
+ /* there's always an entry for the original_text, it doesn't count. */
+ while (match->next != NULL && match->next != first_match)
+ {
+ match = match->next;
+ ++count;
+ }
+ match->next = first_match;
+ first_match->prev = match;
+ }
+ return count;
+}
+
+#define DICT_FIRST (1) /* use just first element in "dict" */
+#define DICT_EXACT (2) /* "dict" is the exact name of a file */
+/*
+ * Add any identifiers that match the given pattern to the list of
+ * completions.
+ */
+ static void
+ins_compl_dictionaries(dict, pat, dir, flags, thesaurus)
+ char_u *dict;
+ char_u *pat;
+ int dir;
+ int flags;
+ int thesaurus;
+{
+ char_u *ptr;
+ char_u *buf;
+ FILE *fp;
+ regmatch_T regmatch;
+ int add_r;
+ char_u **files;
+ int count;
+ int i;
+ int save_p_scs;
+
+ buf = alloc(LSIZE);
+ /* If 'infercase' is set, don't use 'smartcase' here */
+ save_p_scs = p_scs;
+ if (curbuf->b_p_inf)
+ p_scs = FALSE;
+ regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
+ /* ignore case depends on 'ignorecase', 'smartcase' and "pat" */
+ regmatch.rm_ic = ignorecase(pat);
+ while (buf != NULL && regmatch.regprog != NULL && *dict != NUL
+ && !got_int && !completion_interrupted)
+ {
+ /* copy one dictionary file name into buf */
+ if (flags == DICT_EXACT)
+ {
+ count = 1;
+ files = &dict;
+ }
+ else
+ {
+ /* Expand wildcards in the dictionary name, but do not allow
+ * backticks (for security, the 'dict' option may have been set in
+ * a modeline). */
+ copy_option_part(&dict, buf, LSIZE, ",");
+ if (vim_strchr(buf, '`') != NULL
+ || expand_wildcards(1, &buf, &count, &files,
+ EW_FILE|EW_SILENT) != OK)
+ count = 0;
+ }
+
+ for (i = 0; i < count && !got_int && !completion_interrupted; i++)
+ {
+ fp = mch_fopen((char *)files[i], "r"); /* open dictionary file */
+ if (flags != DICT_EXACT)
+ {
+ sprintf((char*)IObuff, _("Scanning dictionary: %s"),
+ (char *)files[i]);
+ msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
+ }
+
+ if (fp != NULL)
+ {
+ /*
+ * Read dictionary file line by line.
+ * Check each line for a match.
+ */
+ while (!got_int && !completion_interrupted
+ && !vim_fgets(buf, LSIZE, fp))
+ {
+ ptr = buf;
+ while (vim_regexec(&regmatch, buf, (colnr_T)(ptr - buf)))
+ {
+ ptr = regmatch.startp[0];
+ ptr = find_word_end(ptr);
+ add_r = ins_compl_add_infercase(regmatch.startp[0],
+ (int)(ptr - regmatch.startp[0]),
+ files[i], dir, 0);
+ if (thesaurus)
+ {
+ char_u *wstart;
+
+ /*
+ * Add the other matches on the line
+ */
+ while (!got_int)
+ {
+ /* Find start of the next word. Skip white
+ * space and punctuation. */
+ ptr = find_word_start(ptr);
+ if (*ptr == NUL || *ptr == NL)
+ break;
+ wstart = ptr;
+
+ /* Find end of the word and add it. */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ /* Japanese words may have characters in
+ * different classes, only separate words
+ * with single-byte non-word characters. */
+ while (*ptr != NUL)
+ {
+ int l = (*mb_ptr2len_check)(ptr);
+
+ if (l < 2 && !vim_iswordc(*ptr))
+ break;
+ ptr += l;
+ }
+ else
+#endif
+ ptr = find_word_end(ptr);
+ add_r = ins_compl_add_infercase(wstart,
+ (int)(ptr - wstart), files[i], dir, 0);
+ }
+ }
+ if (add_r == OK)
+ /* if dir was BACKWARD then honor it just once */
+ dir = FORWARD;
+ else if (add_r == RET_ERROR)
+ break;
+ /* avoid expensive call to vim_regexec() when at end
+ * of line */
+ if (*ptr == '\n' || got_int)
+ break;
+ }
+ line_breakcheck();
+ ins_compl_check_keys();
+ }
+ fclose(fp);
+ }
+ }
+ if (flags != DICT_EXACT)
+ FreeWild(count, files);
+ if (flags)
+ break;
+ }
+ p_scs = save_p_scs;
+ vim_free(regmatch.regprog);
+ vim_free(buf);
+}
+
+/*
+ * Find the start of the next word.
+ * Returns a pointer to the first char of the word. Also stops at a NUL.
+ */
+ char_u *
+find_word_start(ptr)
+ char_u *ptr;
+{
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ while (*ptr != NUL && *ptr != '\n' && mb_get_class(ptr) <= 1)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+#endif
+ while (*ptr != NUL && *ptr != '\n' && !vim_iswordc(*ptr))
+ ++ptr;
+ return ptr;
+}
+
+/*
+ * Find the end of the word. Assumes it starts inside a word.
+ * Returns a pointer to just after the word.
+ */
+ char_u *
+find_word_end(ptr)
+ char_u *ptr;
+{
+#ifdef FEAT_MBYTE
+ int start_class;
+
+ if (has_mbyte)
+ {
+ start_class = mb_get_class(ptr);
+ if (start_class > 1)
+ while (*ptr != NUL)
+ {
+ ptr += (*mb_ptr2len_check)(ptr);
+ if (mb_get_class(ptr) != start_class)
+ break;
+ }
+ }
+ else
+#endif
+ while (vim_iswordc(*ptr))
+ ++ptr;
+ return ptr;
+}
+
+/*
+ * Free the list of completions
+ */
+ static void
+ins_compl_free()
+{
+ struct Completion *match;
+
+ vim_free(complete_pat);
+ complete_pat = NULL;
+
+ if (first_match == NULL)
+ return;
+ curr_match = first_match;
+ do
+ {
+ match = curr_match;
+ curr_match = curr_match->next;
+ vim_free(match->str);
+ /* several entries may use the same fname, free it just once. */
+ if (match->original & FREE_FNAME)
+ vim_free(match->fname);
+ vim_free(match);
+ } while (curr_match != NULL && curr_match != first_match);
+ first_match = curr_match = NULL;
+}
+
+ static void
+ins_compl_clear()
+{
+ continue_status = 0;
+ started_completion = FALSE;
+ completion_matches = 0;
+ vim_free(complete_pat);
+ complete_pat = NULL;
+ save_sm = -1;
+ edit_submode_extra = NULL;
+}
+
+/*
+ * Prepare for Insert mode completion, or stop it.
+ */
+ static void
+ins_compl_prep(c)
+ int c;
+{
+ char_u *ptr;
+ char_u *tmp_ptr;
+ int temp;
+ int want_cindent;
+
+ /* Forget any previous 'special' messages if this is actually
+ * a ^X mode key - bar ^R, in which case we wait to see what it gives us.
+ */
+ if (c != Ctrl_R && vim_is_ctrl_x_key(c))
+ edit_submode_extra = NULL;
+
+ /* Ignore end of Select mode mapping */
+ if (c == K_SELECT)
+ return;
+
+ if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
+ {
+ /*
+ * We have just typed CTRL-X and aren't quite sure which CTRL-X mode
+ * it will be yet. Now we decide.
+ */
+ switch (c)
+ {
+ case Ctrl_E:
+ case Ctrl_Y:
+ ctrl_x_mode = CTRL_X_SCROLL;
+ if (!(State & REPLACE_FLAG))
+ edit_submode = (char_u *)_(" (insert) Scroll (^E/^Y)");
+ else
+ edit_submode = (char_u *)_(" (replace) Scroll (^E/^Y)");
+ edit_submode_pre = NULL;
+ showmode();
+ break;
+ case Ctrl_L:
+ ctrl_x_mode = CTRL_X_WHOLE_LINE;
+ break;
+ case Ctrl_F:
+ ctrl_x_mode = CTRL_X_FILES;
+ break;
+ case Ctrl_K:
+ ctrl_x_mode = CTRL_X_DICTIONARY;
+ break;
+ case Ctrl_R:
+ /* Simply allow ^R to happen without affecting ^X mode */
+ break;
+ case Ctrl_T:
+ ctrl_x_mode = CTRL_X_THESAURUS;
+ break;
+ case Ctrl_RSB:
+ ctrl_x_mode = CTRL_X_TAGS;
+ break;
+#ifdef FEAT_FIND_ID
+ case Ctrl_I:
+ case K_S_TAB:
+ ctrl_x_mode = CTRL_X_PATH_PATTERNS;
+ break;
+ case Ctrl_D:
+ ctrl_x_mode = CTRL_X_PATH_DEFINES;
+ break;
+#endif
+ case Ctrl_V:
+ case Ctrl_Q:
+ ctrl_x_mode = CTRL_X_CMDLINE;
+ break;
+ case Ctrl_P:
+ case Ctrl_N:
+ /* ^X^P means LOCAL expansion if nothing interrupted (eg we
+ * just started ^X mode, or there were enough ^X's to cancel
+ * the previous mode, say ^X^F^X^X^P or ^P^X^X^X^P, see below)
+ * do normal expansion when interrupting a different mode (say
+ * ^X^F^X^P or ^P^X^X^P, see below)
+ * nothing changes if interrupting mode 0, (eg, the flag
+ * doesn't change when going to ADDING mode -- Acevedo */
+ if (!(continue_status & CONT_INTRPT))
+ continue_status |= CONT_LOCAL;
+ else if (continue_mode != 0)
+ continue_status &= ~CONT_LOCAL;
+ /* FALLTHROUGH */
+ default:
+ /* if we have typed at least 2 ^X's... for modes != 0, we set
+ * continue_status = 0 (eg, as if we had just started ^X mode)
+ * for mode 0, we set continue_mode to an impossible value, in
+ * both cases ^X^X can be used to restart the same mode
+ * (avoiding ADDING mode). Undocumented feature:
+ * In a mode != 0 ^X^P and ^X^X^P start 'complete' and local
+ * ^P expansions respectively. In mode 0 an extra ^X is
+ * needed since ^X^P goes to ADDING mode -- Acevedo */
+ if (c == Ctrl_X)
+ {
+ if (continue_mode != 0)
+ continue_status = 0;
+ else
+ continue_mode = CTRL_X_NOT_DEFINED_YET;
+ }
+ ctrl_x_mode = 0;
+ edit_submode = NULL;
+ showmode();
+ break;
+ }
+ }
+ else if (ctrl_x_mode != 0)
+ {
+ /* We're already in CTRL-X mode, do we stay in it? */
+ if (!vim_is_ctrl_x_key(c))
+ {
+ if (ctrl_x_mode == CTRL_X_SCROLL)
+ ctrl_x_mode = 0;
+ else
+ ctrl_x_mode = CTRL_X_FINISHED;
+ edit_submode = NULL;
+ }
+ showmode();
+ }
+
+ if (started_completion || ctrl_x_mode == CTRL_X_FINISHED)
+ {
+ /* Show error message from attempted keyword completion (probably
+ * 'Pattern not found') until another key is hit, then go back to
+ * showing what mode we are in.
+ */
+ showmode();
+ if ((ctrl_x_mode == 0 && c != Ctrl_N && c != Ctrl_P && c != Ctrl_R)
+ || ctrl_x_mode == CTRL_X_FINISHED)
+ {
+ /* Get here when we have finished typing a sequence of ^N and
+ * ^P or other completion characters in CTRL-X mode. Free up
+ * memory that was used, and make sure we can redo the insert.
+ */
+ if (curr_match != NULL)
+ {
+ /*
+ * If any of the original typed text has been changed,
+ * eg when ignorecase is set, we must add back-spaces to
+ * the redo buffer. We add as few as necessary to delete
+ * just the part of the original text that has changed.
+ */
+ ptr = curr_match->str;
+ tmp_ptr = original_text;
+ while (*tmp_ptr && *tmp_ptr == *ptr)
+ {
+ ++tmp_ptr;
+ ++ptr;
+ }
+ for (temp = 0; tmp_ptr[temp]; ++temp)
+ AppendCharToRedobuff(K_BS);
+ AppendToRedobuffLit(ptr);
+ }
+
+#ifdef FEAT_CINDENT
+ want_cindent = (can_cindent && cindent_on());
+#endif
+ /*
+ * When completing whole lines: fix indent for 'cindent'.
+ * Otherwise, break line if it's too long.
+ */
+ if (continue_mode == CTRL_X_WHOLE_LINE)
+ {
+#ifdef FEAT_CINDENT
+ /* re-indent the current line */
+ if (want_cindent)
+ {
+ do_c_expr_indent();
+ want_cindent = FALSE; /* don't do it again */
+ }
+#endif
+ }
+ else
+ {
+ /* put the cursor on the last char, for 'tw' formatting */
+ curwin->w_cursor.col--;
+ if (stop_arrow() == OK)
+ insertchar(NUL, 0, -1);
+ curwin->w_cursor.col++;
+ }
+
+ auto_format(FALSE, TRUE);
+
+ ins_compl_free();
+ started_completion = FALSE;
+ completion_matches = 0;
+ msg_clr_cmdline(); /* necessary for "noshowmode" */
+ ctrl_x_mode = 0;
+ p_sm = save_sm;
+ if (edit_submode != NULL)
+ {
+ edit_submode = NULL;
+ showmode();
+ }
+
+#ifdef FEAT_CINDENT
+ /*
+ * Indent now if a key was typed that is in 'cinkeys'.
+ */
+ if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
+ do_c_expr_indent();
+#endif
+ }
+ }
+
+ /* reset continue_* if we left expansion-mode, if we stay they'll be
+ * (re)set properly in ins_complete() */
+ if (!vim_is_ctrl_x_key(c))
+ {
+ continue_status = 0;
+ continue_mode = 0;
+ }
+}
+
+/*
+ * Loops through the list of windows, loaded-buffers or non-loaded-buffers
+ * (depending on flag) starting from buf and looking for a non-scanned
+ * buffer (other than curbuf). curbuf is special, if it is called with
+ * buf=curbuf then it has to be the first call for a given flag/expansion.
+ *
+ * Returns the buffer to scan, if any, otherwise returns curbuf -- Acevedo
+ */
+ static buf_T *
+ins_compl_next_buf(buf, flag)
+ buf_T *buf;
+ int flag;
+{
+#ifdef FEAT_WINDOWS
+ static win_T *wp;
+#endif
+
+ if (flag == 'w') /* just windows */
+ {
+#ifdef FEAT_WINDOWS
+ if (buf == curbuf) /* first call for this flag/expansion */
+ wp = curwin;
+ while ((wp = wp->w_next != NULL ? wp->w_next : firstwin) != curwin
+ && wp->w_buffer->b_scanned)
+ ;
+ buf = wp->w_buffer;
+#else
+ buf = curbuf;
+#endif
+ }
+ else
+ /* 'b' (just loaded buffers), 'u' (just non-loaded buffers) or 'U'
+ * (unlisted buffers)
+ * When completing whole lines skip unloaded buffers. */
+ while ((buf = buf->b_next != NULL ? buf->b_next : firstbuf) != curbuf
+ && ((flag == 'U'
+ ? buf->b_p_bl
+ : (!buf->b_p_bl
+ || (buf->b_ml.ml_mfp == NULL) != (flag == 'u')))
+ || buf->b_scanned
+ || (buf->b_ml.ml_mfp == NULL
+ && ctrl_x_mode == CTRL_X_WHOLE_LINE)))
+ ;
+ return buf;
+}
+
+/*
+ * Get the next expansion(s) for the text starting at the initial curbuf
+ * position "ini" and in the direction dir.
+ * Return the total of matches or -1 if still unknown -- Acevedo
+ */
+ static int
+ins_compl_get_exp(ini, dir)
+ pos_T *ini;
+ int dir;
+{
+ static pos_T first_match_pos;
+ static pos_T last_match_pos;
+ static char_u *e_cpt = (char_u *)""; /* curr. entry in 'complete' */
+ static int found_all = FALSE; /* Found all matches. */
+ static buf_T *ins_buf = NULL;
+
+ pos_T *pos;
+ char_u **matches;
+ int save_p_scs;
+ int save_p_ws;
+ int save_p_ic;
+ int i;
+ int num_matches;
+ int len;
+ int found_new_match;
+ int type = ctrl_x_mode;
+ char_u *ptr;
+ char_u *tmp_ptr;
+ char_u *dict = NULL;
+ int dict_f = 0;
+ struct Completion *old_match;
+
+ if (!started_completion)
+ {
+ for (ins_buf = firstbuf; ins_buf != NULL; ins_buf = ins_buf->b_next)
+ ins_buf->b_scanned = 0;
+ found_all = FALSE;
+ ins_buf = curbuf;
+ e_cpt = continue_status & CONT_LOCAL ? (char_u *)"." : curbuf->b_p_cpt;
+ last_match_pos = first_match_pos = *ini;
+ }
+
+ old_match = curr_match; /* remember the last current match */
+ pos = (dir == FORWARD) ? &last_match_pos : &first_match_pos;
+ /* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
+ for (;;)
+ {
+ found_new_match = FAIL;
+
+ /* For ^N/^P pick a new entry from e_cpt if started_completion is off,
+ * or if found_all says this entry is done. For ^X^L only use the
+ * entries from 'complete' that look in loaded buffers. */
+ if ((ctrl_x_mode == 0 || ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ && (!started_completion || found_all))
+ {
+ found_all = FALSE;
+ while (*e_cpt == ',' || *e_cpt == ' ')
+ e_cpt++;
+ if (*e_cpt == '.' && !curbuf->b_scanned)
+ {
+ ins_buf = curbuf;
+ first_match_pos = *ini;
+ /* So that ^N can match word immediately after cursor */
+ if (ctrl_x_mode == 0)
+ dec(&first_match_pos);
+ last_match_pos = first_match_pos;
+ type = 0;
+ }
+ else if (vim_strchr((char_u *)"buwU", *e_cpt) != NULL
+ && (ins_buf = ins_compl_next_buf(ins_buf, *e_cpt)) != curbuf)
+ {
+ /* Scan a buffer, but not the current one. */
+ if (ins_buf->b_ml.ml_mfp != NULL) /* loaded buffer */
+ {
+ started_completion = TRUE;
+ first_match_pos.col = last_match_pos.col = 0;
+ first_match_pos.lnum = ins_buf->b_ml.ml_line_count + 1;
+ last_match_pos.lnum = 0;
+ type = 0;
+ }
+ else /* unloaded buffer, scan like dictionary */
+ {
+ found_all = TRUE;
+ if (ins_buf->b_fname == NULL)
+ continue;
+ type = CTRL_X_DICTIONARY;
+ dict = ins_buf->b_fname;
+ dict_f = DICT_EXACT;
+ }
+ sprintf((char *)IObuff, _("Scanning: %s"),
+ ins_buf->b_fname == NULL
+ ? buf_spname(ins_buf)
+ : ins_buf->b_sfname == NULL
+ ? (char *)ins_buf->b_fname
+ : (char *)ins_buf->b_sfname);
+ msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
+ }
+ else if (*e_cpt == NUL)
+ break;
+ else
+ {
+ if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ type = -1;
+ else if (*e_cpt == 'k' || *e_cpt == 's')
+ {
+ if (*e_cpt == 'k')
+ type = CTRL_X_DICTIONARY;
+ else
+ type = CTRL_X_THESAURUS;
+ if (*++e_cpt != ',' && *e_cpt != NUL)
+ {
+ dict = e_cpt;
+ dict_f = DICT_FIRST;
+ }
+ }
+#ifdef FEAT_FIND_ID
+ else if (*e_cpt == 'i')
+ type = CTRL_X_PATH_PATTERNS;
+ else if (*e_cpt == 'd')
+ type = CTRL_X_PATH_DEFINES;
+#endif
+ else if (*e_cpt == ']' || *e_cpt == 't')
+ {
+ type = CTRL_X_TAGS;
+ sprintf((char*)IObuff, _("Scanning tags."));
+ msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
+ }
+ else
+ type = -1;
+
+ /* in any case e_cpt is advanced to the next entry */
+ (void)copy_option_part(&e_cpt, IObuff, IOSIZE, ",");
+
+ found_all = TRUE;
+ if (type == -1)
+ continue;
+ }
+ }
+
+ switch (type)
+ {
+ case -1:
+ break;
+#ifdef FEAT_FIND_ID
+ case CTRL_X_PATH_PATTERNS:
+ case CTRL_X_PATH_DEFINES:
+ find_pattern_in_path(complete_pat, dir,
+ (int)STRLEN(complete_pat), FALSE, FALSE,
+ (type == CTRL_X_PATH_DEFINES
+ && !(continue_status & CONT_SOL))
+ ? FIND_DEFINE : FIND_ANY, 1L, ACTION_EXPAND,
+ (linenr_T)1, (linenr_T)MAXLNUM);
+ break;
+#endif
+
+ case CTRL_X_DICTIONARY:
+ case CTRL_X_THESAURUS:
+ ins_compl_dictionaries(
+ dict ? dict
+ : (type == CTRL_X_THESAURUS
+ ? (*curbuf->b_p_tsr == NUL
+ ? p_tsr
+ : curbuf->b_p_tsr)
+ : (*curbuf->b_p_dict == NUL
+ ? p_dict
+ : curbuf->b_p_dict)),
+ complete_pat, dir,
+ dict ? dict_f : 0, type == CTRL_X_THESAURUS);
+ dict = NULL;
+ break;
+
+ case CTRL_X_TAGS:
+ /* set p_ic according to p_ic, p_scs and pat for find_tags(). */
+ save_p_ic = p_ic;
+ p_ic = ignorecase(complete_pat);
+
+ /* Find up to TAG_MANY matches. Avoids that an enourmous number
+ * of matches is found when complete_pat is empty */
+ if (find_tags(complete_pat, &num_matches, &matches,
+ TAG_REGEXP | TAG_NAMES | TAG_NOIC |
+ TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
+ TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
+ {
+ ins_compl_add_matches(num_matches, matches, dir);
+ }
+ p_ic = save_p_ic;
+ break;
+
+ case CTRL_X_FILES:
+ if (expand_wildcards(1, &complete_pat, &num_matches, &matches,
+ EW_FILE|EW_DIR|EW_ADDSLASH|EW_SILENT) == OK)
+ {
+
+ /* May change home directory back to "~". */
+ tilde_replace(complete_pat, num_matches, matches);
+ ins_compl_add_matches(num_matches, matches, dir);
+ }
+ break;
+
+ case CTRL_X_CMDLINE:
+ if (expand_cmdline(&complete_xp, complete_pat,
+ (int)STRLEN(complete_pat),
+ &num_matches, &matches) == EXPAND_OK)
+ ins_compl_add_matches(num_matches, matches, dir);
+ break;
+
+ default: /* normal ^P/^N and ^X^L */
+ /*
+ * If 'infercase' is set, don't use 'smartcase' here
+ */
+ save_p_scs = p_scs;
+ if (ins_buf->b_p_inf)
+ p_scs = FALSE;
+ /* buffers other than curbuf are scanned from the beginning or the
+ * end but never from the middle, thus setting nowrapscan in this
+ * buffers is a good idea, on the other hand, we always set
+ * wrapscan for curbuf to avoid missing matches -- Acevedo,Webb */
+ save_p_ws = p_ws;
+ if (ins_buf != curbuf)
+ p_ws = FALSE;
+ else if (*e_cpt == '.')
+ p_ws = TRUE;
+ for (;;)
+ {
+ int reuse = 0;
+
+ /* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that has
+ * added a word that was at the beginning of the line */
+ if ( ctrl_x_mode == CTRL_X_WHOLE_LINE
+ || (continue_status & CONT_SOL))
+ found_new_match = search_for_exact_line(ins_buf, pos,
+ dir, complete_pat);
+ else
+ found_new_match = searchit(NULL, ins_buf, pos, dir,
+ complete_pat, 1L, SEARCH_KEEP + SEARCH_NFMSG,
+ RE_LAST);
+ if (!started_completion)
+ {
+ /* set started_completion even on fail */
+ started_completion = TRUE;
+ first_match_pos = *pos;
+ last_match_pos = *pos;
+ }
+ else if (first_match_pos.lnum == last_match_pos.lnum
+ && first_match_pos.col == last_match_pos.col)
+ found_new_match = FAIL;
+ if (found_new_match == FAIL)
+ {
+ if (ins_buf == curbuf)
+ found_all = TRUE;
+ break;
+ }
+
+ /* when ADDING, the text before the cursor matches, skip it */
+ if ( (continue_status & CONT_ADDING) && ins_buf == curbuf
+ && ini->lnum == pos->lnum
+ && ini->col == pos->col)
+ continue;
+ ptr = ml_get_buf(ins_buf, pos->lnum, FALSE) + pos->col;
+ if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ {
+ if (continue_status & CONT_ADDING)
+ {
+ if (pos->lnum >= ins_buf->b_ml.ml_line_count)
+ continue;
+ ptr = ml_get_buf(ins_buf, pos->lnum + 1, FALSE);
+ if (!p_paste)
+ ptr = skipwhite(ptr);
+ }
+ len = (int)STRLEN(ptr);
+ }
+ else
+ {
+ tmp_ptr = ptr;
+ if (continue_status & CONT_ADDING)
+ {
+ tmp_ptr += completion_length;
+ /* Skip if already inside a word. */
+ if (vim_iswordp(tmp_ptr))
+ continue;
+ /* Find start of next word. */
+ tmp_ptr = find_word_start(tmp_ptr);
+ }
+ /* Find end of this word. */
+ tmp_ptr = find_word_end(tmp_ptr);
+ len = (int)(tmp_ptr - ptr);
+
+ if ((continue_status & CONT_ADDING)
+ && len == completion_length)
+ {
+ if (pos->lnum < ins_buf->b_ml.ml_line_count)
+ {
+ /* Try next line, if any. the new word will be
+ * "join" as if the normal command "J" was used.
+ * IOSIZE is always greater than
+ * completion_length, so the next STRNCPY always
+ * works -- Acevedo */
+ STRNCPY(IObuff, ptr, len);
+ ptr = ml_get_buf(ins_buf, pos->lnum + 1, FALSE);
+ tmp_ptr = ptr = skipwhite(ptr);
+ /* Find start of next word. */
+ tmp_ptr = find_word_start(tmp_ptr);
+ /* Find end of next word. */
+ tmp_ptr = find_word_end(tmp_ptr);
+ if (tmp_ptr > ptr)
+ {
+ if (*ptr != ')' && IObuff[len-1] != TAB)
+ {
+ if (IObuff[len-1] != ' ')
+ IObuff[len++] = ' ';
+ /* IObuf =~ "\k.* ", thus len >= 2 */
+ if (p_js
+ && (IObuff[len-2] == '.'
+ || (vim_strchr(p_cpo, CPO_JOINSP)
+ == NULL
+ && (IObuff[len-2] == '?'
+ || IObuff[len-2] == '!'))))
+ IObuff[len++] = ' ';
+ }
+ /* copy as much as posible of the new word */
+ if (tmp_ptr - ptr >= IOSIZE - len)
+ tmp_ptr = ptr + IOSIZE - len - 1;
+ STRNCPY(IObuff + len, ptr, tmp_ptr - ptr);
+ len += (int)(tmp_ptr - ptr);
+ reuse |= CONT_S_IPOS;
+ }
+ IObuff[len] = NUL;
+ ptr = IObuff;
+ }
+ if (len == completion_length)
+ continue;
+ }
+ }
+ if (ins_compl_add_infercase(ptr, len,
+ ins_buf == curbuf ? NULL : ins_buf->b_sfname,
+ dir, reuse) != FAIL)
+ {
+ found_new_match = OK;
+ break;
+ }
+ }
+ p_scs = save_p_scs;
+ p_ws = save_p_ws;
+ }
+ /* check if curr_match has changed, (e.g. other type of expansion
+ * added somenthing) */
+ if (curr_match != old_match)
+ found_new_match = OK;
+
+ /* break the loop for specialized modes (use 'complete' just for the
+ * generic ctrl_x_mode == 0) or when we've found a new match */
+ if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
+ || found_new_match != FAIL)
+ break;
+
+ /* Mark a buffer scanned when it has been scanned completely */
+ if (type == 0 || type == CTRL_X_PATH_PATTERNS)
+ ins_buf->b_scanned = TRUE;
+
+ started_completion = FALSE;
+ }
+ started_completion = TRUE;
+
+ if ((ctrl_x_mode == 0 || ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ && *e_cpt == NUL) /* Got to end of 'complete' */
+ found_new_match = FAIL;
+
+ i = -1; /* total of matches, unknown */
+ if (found_new_match == FAIL
+ || (ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE))
+ i = ins_compl_make_cyclic();
+
+ /* If several matches were added (FORWARD) or the search failed and has
+ * just been made cyclic then we have to move curr_match to the next or
+ * previous entry (if any) -- Acevedo */
+ curr_match = dir == FORWARD ? old_match->next : old_match->prev;
+ if (curr_match == NULL)
+ curr_match = old_match;
+ return i;
+}
+
+/* Delete the old text being completed. */
+ static void
+ins_compl_delete()
+{
+ int i;
+
+ /*
+ * In insert mode: Delete the typed part.
+ * In replace mode: Put the old characters back, if any.
+ */
+ i = complete_col + (continue_status & CONT_ADDING ? completion_length : 0);
+ backspace_until_column(i);
+ changed_cline_bef_curs();
+}
+
+/* Insert the new text being completed. */
+ static void
+ins_compl_insert()
+{
+ ins_bytes(shown_match->str + curwin->w_cursor.col - complete_col);
+}
+
+/*
+ * Fill in the next completion in the current direction.
+ * If allow_get_expansion is TRUE, then we may call ins_compl_get_exp() to get
+ * more completions. If it is FALSE, then we just do nothing when there are
+ * no more completions in a given direction. The latter case is used when we
+ * are still in the middle of finding completions, to allow browsing through
+ * the ones found so far.
+ * Return the total number of matches, or -1 if still unknown -- webb.
+ *
+ * curr_match is currently being used by ins_compl_get_exp(), so we use
+ * shown_match here.
+ *
+ * Note that this function may be called recursively once only. First with
+ * allow_get_expansion TRUE, which calls ins_compl_get_exp(), which in turn
+ * calls this function with allow_get_expansion FALSE.
+ */
+ static int
+ins_compl_next(allow_get_expansion)
+ int allow_get_expansion;
+{
+ int num_matches = -1;
+ int i;
+
+ if (allow_get_expansion)
+ {
+ /* Delete old text to be replaced */
+ ins_compl_delete();
+ }
+ completion_pending = FALSE;
+ if (shown_direction == FORWARD && shown_match->next != NULL)
+ shown_match = shown_match->next;
+ else if (shown_direction == BACKWARD && shown_match->prev != NULL)
+ shown_match = shown_match->prev;
+ else
+ {
+ completion_pending = TRUE;
+ if (allow_get_expansion)
+ {
+ num_matches = ins_compl_get_exp(&initial_pos, complete_direction);
+ if (completion_pending)
+ {
+ if (complete_direction == shown_direction)
+ shown_match = curr_match;
+ }
+ }
+ else
+ return -1;
+ }
+
+ /* Insert the text of the new completion */
+ ins_compl_insert();
+
+ if (!allow_get_expansion)
+ {
+ /* Display the current match. */
+ update_screen(0);
+
+ /* Delete old text to be replaced, since we're still searching and
+ * don't want to match ourselves! */
+ ins_compl_delete();
+ }
+
+ /*
+ * Show the file name for the match (if any)
+ * Truncate the file name to avoid a wait for return.
+ */
+ if (shown_match->fname != NULL)
+ {
+ STRCPY(IObuff, "match in file ");
+ i = (vim_strsize(shown_match->fname) + 16) - sc_col;
+ if (i <= 0)
+ i = 0;
+ else
+ STRCAT(IObuff, "<");
+ STRCAT(IObuff, shown_match->fname + i);
+ msg(IObuff);
+ redraw_cmdline = FALSE; /* don't overwrite! */
+ }
+
+ return num_matches;
+}
+
+/*
+ * Call this while finding completions, to check whether the user has hit a key
+ * that should change the currently displayed completion, or exit completion
+ * mode. Also, when completion_pending is TRUE, show a completion as soon as
+ * possible. -- webb
+ */
+ void
+ins_compl_check_keys()
+{
+ static int count = 0;
+
+ int c;
+
+ /* Don't check when reading keys from a script. That would break the test
+ * scripts */
+ if (using_script())
+ return;
+
+ /* Only do this at regular intervals */
+ if (++count < CHECK_KEYS_TIME)
+ return;
+ count = 0;
+
+ ++no_mapping;
+ c = vpeekc_any();
+ --no_mapping;
+ if (c != NUL)
+ {
+ if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R)
+ {
+ c = safe_vgetc(); /* Eat the character */
+ if (c == Ctrl_P || c == Ctrl_L)
+ shown_direction = BACKWARD;
+ else
+ shown_direction = FORWARD;
+ (void)ins_compl_next(FALSE);
+ }
+ else if (c != Ctrl_R)
+ completion_interrupted = TRUE;
+ }
+ if (completion_pending && !got_int)
+ (void)ins_compl_next(FALSE);
+}
+
+/*
+ * Do Insert mode completion.
+ * Called when character "c" was typed, which has a meaning for completion.
+ * Returns OK if completion was done, FAIL if something failed (out of mem).
+ */
+ static int
+ins_complete(c)
+ int c;
+{
+ char_u *line;
+ char_u *tmp_ptr = NULL; /* init for gcc */
+ int temp = 0;
+
+ if (c == Ctrl_P || c == Ctrl_L)
+ complete_direction = BACKWARD;
+ else
+ complete_direction = FORWARD;
+ if (!started_completion)
+ {
+ /* First time we hit ^N or ^P (in a row, I mean) */
+
+ /* Turn off 'sm' so we don't show matches with ^X^L */
+ save_sm = p_sm;
+ p_sm = FALSE;
+
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+ if (stop_arrow() == FAIL)
+ return FAIL;
+
+ line = ml_get(curwin->w_cursor.lnum);
+ complete_col = curwin->w_cursor.col;
+
+ /* if this same ctrl_x_mode has been interrupted use the text from
+ * "initial_pos" to the cursor as a pattern to add a new word instead
+ * of expand the one before the cursor, in word-wise if "initial_pos"
+ * is not in the same line as the cursor then fix it (the line has
+ * been split because it was longer than 'tw'). if SOL is set then
+ * skip the previous pattern, a word at the beginning of the line has
+ * been inserted, we'll look for that -- Acevedo. */
+ if ((continue_status & CONT_INTRPT) && continue_mode == ctrl_x_mode)
+ {
+ /*
+ * it is a continued search
+ */
+ continue_status &= ~CONT_INTRPT; /* remove INTRPT */
+ if (ctrl_x_mode == 0 || ctrl_x_mode == CTRL_X_PATH_PATTERNS
+ || ctrl_x_mode == CTRL_X_PATH_DEFINES)
+ {
+ if (initial_pos.lnum != curwin->w_cursor.lnum)
+ {
+ /* line (probably) wrapped, set initial_pos to the first
+ * non_blank in the line, if it is not a wordchar include
+ * it to get a better pattern, but then we don't want the
+ * "\\<" prefix, check it bellow */
+ tmp_ptr = skipwhite(line);
+ initial_pos.col = (colnr_T) (tmp_ptr - line);
+ initial_pos.lnum = curwin->w_cursor.lnum;
+ continue_status &= ~CONT_SOL; /* clear SOL if present */
+ }
+ else
+ {
+ /* S_IPOS was set when we inserted a word that was at the
+ * beginning of the line, which means that we'll go to SOL
+ * mode but first we need to redefine initial_pos */
+ if (continue_status & CONT_S_IPOS)
+ {
+ continue_status |= CONT_SOL;
+ initial_pos.col = (colnr_T) (skipwhite(line + completion_length +
+ initial_pos.col) - line);
+ }
+ tmp_ptr = line + initial_pos.col;
+ }
+ temp = curwin->w_cursor.col - (int)(tmp_ptr - line);
+ /* IObuf is used to add a "word from the next line" would we
+ * have enough space? just being paranoic */
+#define MIN_SPACE 75
+ if (temp > (IOSIZE - MIN_SPACE))
+ {
+ continue_status &= ~CONT_SOL;
+ temp = (IOSIZE - MIN_SPACE);
+ tmp_ptr = line + curwin->w_cursor.col - temp;
+ }
+ continue_status |= CONT_ADDING | CONT_N_ADDS;
+ if (temp < 1)
+ continue_status &= CONT_LOCAL;
+ }
+ else if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ continue_status = CONT_ADDING | CONT_N_ADDS;
+ else
+ continue_status = 0;
+ }
+ else
+ continue_status &= CONT_LOCAL;
+
+ if (!(continue_status & CONT_ADDING)) /* normal expansion */
+ {
+ continue_mode = ctrl_x_mode;
+ if (ctrl_x_mode != 0) /* Remove LOCAL if ctrl_x_mode != 0 */
+ continue_status = 0;
+ continue_status |= CONT_N_ADDS;
+ initial_pos = curwin->w_cursor;
+ temp = (int)complete_col;
+ tmp_ptr = line;
+ }
+
+ /* Work out completion pattern and original text -- webb */
+ if (ctrl_x_mode == 0 || (ctrl_x_mode & CTRL_X_WANT_IDENT))
+ {
+ if ( (continue_status & CONT_SOL)
+ || ctrl_x_mode == CTRL_X_PATH_DEFINES)
+ {
+ if (!(continue_status & CONT_ADDING))
+ {
+ while (--temp >= 0 && vim_isIDc(line[temp]))
+ ;
+ tmp_ptr += ++temp;
+ temp = complete_col - temp;
+ }
+ if (p_ic)
+ complete_pat = str_foldcase(tmp_ptr, temp);
+ else
+ complete_pat = vim_strnsave(tmp_ptr, temp);
+ if (complete_pat == NULL)
+ return FAIL;
+ }
+ else if (continue_status & CONT_ADDING)
+ {
+ char_u *prefix = (char_u *)"\\<";
+
+ /* we need 3 extra chars, 1 for the NUL and
+ * 2 >= strlen(prefix) -- Acevedo */
+ complete_pat = alloc(quote_meta(NULL, tmp_ptr, temp) + 3);
+ if (complete_pat == NULL)
+ return FAIL;
+ if (!vim_iswordp(tmp_ptr)
+ || (tmp_ptr > line
+ && (
+#ifdef FEAT_MBYTE
+ vim_iswordp(mb_prevptr(line, tmp_ptr))
+#else
+ vim_iswordc(*(tmp_ptr - 1))
+#endif
+ )))
+ prefix = (char_u *)"";
+ STRCPY((char *)complete_pat, prefix);
+ (void)quote_meta(complete_pat + STRLEN(prefix), tmp_ptr, temp);
+ }
+ else if (
+#ifdef FEAT_MBYTE
+ --temp < 0 || !vim_iswordp(mb_prevptr(line,
+ line + temp + 1))
+#else
+ --temp < 0 || !vim_iswordc(line[temp])
+#endif
+ )
+ {
+ /* Match any word of at least two chars */
+ complete_pat = vim_strsave((char_u *)"\\<\\k\\k");
+ if (complete_pat == NULL)
+ return FAIL;
+ tmp_ptr += complete_col;
+ temp = 0;
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ /* Search the point of change class of multibyte character
+ * or not a word single byte character backward. */
+ if (has_mbyte)
+ {
+ int base_class;
+ int head_off;
+
+ temp -= (*mb_head_off)(line, line + temp);
+ base_class = mb_get_class(line + temp);
+ while (--temp >= 0)
+ {
+ head_off = (*mb_head_off)(line, line + temp);
+ if (base_class != mb_get_class(line + temp - head_off))
+ break;
+ temp -= head_off;
+ }
+ }
+ else
+#endif
+ while (--temp >= 0 && vim_iswordc(line[temp]))
+ ;
+ tmp_ptr += ++temp;
+ if ((temp = (int)complete_col - temp) == 1)
+ {
+ /* Only match word with at least two chars -- webb
+ * there's no need to call quote_meta,
+ * alloc(7) is enough -- Acevedo
+ */
+ complete_pat = alloc(7);
+ if (complete_pat == NULL)
+ return FAIL;
+ STRCPY((char *)complete_pat, "\\<");
+ (void)quote_meta(complete_pat + 2, tmp_ptr, 1);
+ STRCAT((char *)complete_pat, "\\k");
+ }
+ else
+ {
+ complete_pat = alloc(quote_meta(NULL, tmp_ptr, temp) + 3);
+ if (complete_pat == NULL)
+ return FAIL;
+ STRCPY((char *)complete_pat, "\\<");
+ (void)quote_meta(complete_pat + 2, tmp_ptr, temp);
+ }
+ }
+ }
+ else if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ {
+ tmp_ptr = skipwhite(line);
+ temp = (int)complete_col - (int)(tmp_ptr - line);
+ if (temp < 0) /* cursor in indent: empty pattern */
+ temp = 0;
+ if (p_ic)
+ complete_pat = str_foldcase(tmp_ptr, temp);
+ else
+ complete_pat = vim_strnsave(tmp_ptr, temp);
+ if (complete_pat == NULL)
+ return FAIL;
+ }
+ else if (ctrl_x_mode == CTRL_X_FILES)
+ {
+ while (--temp >= 0 && vim_isfilec(line[temp]))
+ ;
+ tmp_ptr += ++temp;
+ temp = (int)complete_col - temp;
+ complete_pat = addstar(tmp_ptr, temp, EXPAND_FILES);
+ if (complete_pat == NULL)
+ return FAIL;
+ }
+ else if (ctrl_x_mode == CTRL_X_CMDLINE)
+ {
+ complete_pat = vim_strnsave(line, complete_col);
+ if (complete_pat == NULL)
+ return FAIL;
+ set_cmd_context(&complete_xp, complete_pat,
+ (int)STRLEN(complete_pat), complete_col);
+ if (complete_xp.xp_context == EXPAND_UNSUCCESSFUL
+ || complete_xp.xp_context == EXPAND_NOTHING)
+ return FAIL;
+ temp = (int)(complete_xp.xp_pattern - complete_pat);
+ tmp_ptr = line + temp;
+ temp = complete_col - temp;
+ }
+ complete_col = (colnr_T) (tmp_ptr - line);
+
+ if (continue_status & CONT_ADDING)
+ {
+ edit_submode_pre = (char_u *)_(" Adding");
+ if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ {
+ /* Insert a new line, keep indentation but ignore 'comments' */
+#ifdef FEAT_COMMENTS
+ char_u *old = curbuf->b_p_com;
+
+ curbuf->b_p_com = (char_u *)"";
+#endif
+ initial_pos.lnum = curwin->w_cursor.lnum;
+ initial_pos.col = complete_col;
+ ins_eol('\r');
+#ifdef FEAT_COMMENTS
+ curbuf->b_p_com = old;
+#endif
+ tmp_ptr = (char_u *)"";
+ temp = 0;
+ complete_col = curwin->w_cursor.col;
+ }
+ }
+ else
+ {
+ edit_submode_pre = NULL;
+ initial_pos.col = complete_col;
+ }
+
+ if (continue_status & CONT_LOCAL)
+ edit_submode = (char_u *)_(ctrl_x_msgs[2]);
+ else
+ edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode));
+
+ completion_length = temp;
+
+ /* Always add completion for the original text. Note that
+ * "original_text" itself (not a copy) is added, it will be freed when
+ * the list of matches is freed. */
+ if ((original_text = vim_strnsave(tmp_ptr, temp)) == NULL
+ || ins_compl_add(original_text, -1, NULL, 0, ORIGINAL_TEXT) != OK)
+ {
+ vim_free(complete_pat);
+ complete_pat = NULL;
+ vim_free(original_text);
+ return FAIL;
+ }
+
+ /* showmode might reset the internal line pointers, so it must
+ * be called before line = ml_get(), or when this address is no
+ * longer needed. -- Acevedo.
+ */
+ edit_submode_extra = (char_u *)_("-- Searching...");
+ edit_submode_highl = HLF_COUNT;
+ showmode();
+ edit_submode_extra = NULL;
+ out_flush();
+ }
+
+ shown_match = curr_match;
+ shown_direction = complete_direction;
+
+ /*
+ * Find next match.
+ */
+ temp = ins_compl_next(TRUE);
+
+ if (temp > 1) /* all matches have been found */
+ completion_matches = temp;
+ curr_match = shown_match;
+ complete_direction = shown_direction;
+ completion_interrupted = FALSE;
+
+ /* eat the ESC to avoid leaving insert mode */
+ if (got_int && !global_busy)
+ {
+ (void)vgetc();
+ got_int = FALSE;
+ }
+
+ /* we found no match if the list has only the original_text-entry */
+ if (first_match == first_match->next)
+ {
+ edit_submode_extra = (continue_status & CONT_ADDING)
+ && completion_length > 1
+ ? (char_u *)_(e_hitend) : (char_u *)_(e_patnotf);
+ edit_submode_highl = HLF_E;
+ /* remove N_ADDS flag, so next ^X<> won't try to go to ADDING mode,
+ * because we couldn't expand anything at first place, but if we used
+ * ^P, ^N, ^X^I or ^X^D we might want to add-expand a single-char-word
+ * (such as M in M'exico) if not tried already. -- Acevedo */
+ if ( completion_length > 1
+ || (continue_status & CONT_ADDING)
+ || (ctrl_x_mode != 0
+ && ctrl_x_mode != CTRL_X_PATH_PATTERNS
+ && ctrl_x_mode != CTRL_X_PATH_DEFINES))
+ continue_status &= ~CONT_N_ADDS;
+ }
+
+ if (curr_match->original & CONT_S_IPOS)
+ continue_status |= CONT_S_IPOS;
+ else
+ continue_status &= ~CONT_S_IPOS;
+
+ if (edit_submode_extra == NULL)
+ {
+ if (curr_match->original & ORIGINAL_TEXT)
+ {
+ edit_submode_extra = (char_u *)_("Back at original");
+ edit_submode_highl = HLF_W;
+ }
+ else if (continue_status & CONT_S_IPOS)
+ {
+ edit_submode_extra = (char_u *)_("Word from other line");
+ edit_submode_highl = HLF_COUNT;
+ }
+ else if (curr_match->next == curr_match->prev)
+ {
+ edit_submode_extra = (char_u *)_("The only match");
+ edit_submode_highl = HLF_COUNT;
+ }
+ else
+ {
+ /* Update completion sequence number when needed. */
+ if (curr_match->number == -1)
+ {
+ int number = 0;
+ struct Completion *match;
+
+ if (complete_direction == FORWARD)
+ {
+ /* search backwards for the first valid (!= -1) number.
+ * This should normally succeed already at the first loop
+ * cycle, so it's fast! */
+ for (match = curr_match->prev; match != NULL
+ && match != first_match; match = match->prev)
+ if (match->number != -1)
+ {
+ number = match->number;
+ break;
+ }
+ if (match != NULL)
+ /* go up and assign all numbers which are not assigned
+ * yet */
+ for (match = match->next; match
+ && match->number == -1; match = match->next)
+ match->number = ++number;
+ }
+ else /* BACKWARD */
+ {
+ /* search forwards (upwards) for the first valid (!= -1)
+ * number. This should normally succeed already at the
+ * first loop cycle, so it's fast! */
+ for (match = curr_match->next; match != NULL
+ && match != first_match; match = match->next)
+ if (match->number != -1)
+ {
+ number = match->number;
+ break;
+ }
+ if (match != NULL)
+ /* go down and assign all numbers which are not
+ * assigned yet */
+ for (match = match->prev; match
+ && match->number == -1; match = match->prev)
+ match->number = ++number;
+ }
+ }
+
+ /* The match should always have a sequnce number now, this is just
+ * a safety check. */
+ if (curr_match->number != -1)
+ {
+ /* Space for 10 text chars. + 2x10-digit no.s */
+ static char_u match_ref[31];
+
+ if (completion_matches > 0)
+ sprintf((char *)IObuff, _("match %d of %d"),
+ curr_match->number, completion_matches);
+ else
+ sprintf((char *)IObuff, _("match %d"), curr_match->number);
+ STRNCPY(match_ref, IObuff, 30 );
+ match_ref[30] = '\0';
+ edit_submode_extra = match_ref;
+ edit_submode_highl = HLF_R;
+ if (dollar_vcol)
+ curs_columns(FALSE);
+ }
+ }
+ }
+
+ /* Show a message about what (completion) mode we're in. */
+ showmode();
+ if (edit_submode_extra != NULL)
+ {
+ if (!p_smd)
+ msg_attr(edit_submode_extra,
+ edit_submode_highl < HLF_COUNT
+ ? hl_attr(edit_submode_highl) : 0);
+ }
+ else
+ msg_clr_cmdline(); /* necessary for "noshowmode" */
+
+ return OK;
+}
+
+/*
+ * Looks in the first "len" chars. of "src" for search-metachars.
+ * If dest is not NULL the chars. are copied there quoting (with
+ * a backslash) the metachars, and dest would be NUL terminated.
+ * Returns the length (needed) of dest
+ */
+ static int
+quote_meta(dest, src, len)
+ char_u *dest;
+ char_u *src;
+ int len;
+{
+ int m;
+
+ for (m = len; --len >= 0; src++)
+ {
+ switch (*src)
+ {
+ case '.':
+ case '*':
+ case '[':
+ if (ctrl_x_mode == CTRL_X_DICTIONARY
+ || ctrl_x_mode == CTRL_X_THESAURUS)
+ break;
+ case '~':
+ if (!p_magic) /* quote these only if magic is set */
+ break;
+ case '\\':
+ if (ctrl_x_mode == CTRL_X_DICTIONARY
+ || ctrl_x_mode == CTRL_X_THESAURUS)
+ break;
+ case '^': /* currently it's not needed. */
+ case '$':
+ m++;
+ if (dest != NULL)
+ *dest++ = '\\';
+ break;
+ }
+ if (dest != NULL)
+ *dest++ = *src;
+#ifdef FEAT_MBYTE
+ /* Copy remaining bytes of a multibyte character. */
+ if (has_mbyte)
+ {
+ int i, mb_len;
+
+ mb_len = (*mb_ptr2len_check)(src) - 1;
+ if (mb_len > 0 && len >= mb_len)
+ for (i = 0; i < mb_len; ++i)
+ {
+ --len;
+ ++src;
+ if (dest != NULL)
+ *dest++ = *src;
+ }
+ }
+#endif
+ }
+ if (dest != NULL)
+ *dest = NUL;
+
+ return m;
+}
+#endif /* FEAT_INS_EXPAND */
+
+/*
+ * Next character is interpreted literally.
+ * A one, two or three digit decimal number is interpreted as its byte value.
+ * If one or two digits are entered, the next character is given to vungetc().
+ * For Unicode a character > 255 may be returned.
+ */
+ int
+get_literal()
+{
+ int cc;
+ int nc;
+ int i;
+ int hex = FALSE;
+ int octal = FALSE;
+#ifdef FEAT_MBYTE
+ int unicode = 0;
+#endif
+
+ if (got_int)
+ return Ctrl_C;
+
+#ifdef FEAT_GUI
+ /*
+ * In GUI there is no point inserting the internal code for a special key.
+ * It is more useful to insert the string "<KEY>" instead. This would
+ * probably be useful in a text window too, but it would not be
+ * vi-compatible (maybe there should be an option for it?) -- webb
+ */
+ if (gui.in_use)
+ ++allow_keys;
+#endif
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ ++no_mapping; /* don't map the next key hits */
+ cc = 0;
+ i = 0;
+ for (;;)
+ {
+ do
+ nc = safe_vgetc();
+ while (nc == K_IGNORE || nc == K_VER_SCROLLBAR
+ || nc == K_HOR_SCROLLBAR);
+#ifdef FEAT_CMDL_INFO
+ if (!(State & CMDLINE)
+# ifdef FEAT_MBYTE
+ && MB_BYTE2LEN_CHECK(nc) == 1
+# endif
+ )
+ add_to_showcmd(nc);
+#endif
+ if (nc == 'x' || nc == 'X')
+ hex = TRUE;
+ else if (nc == 'o' || nc == 'O')
+ octal = TRUE;
+#ifdef FEAT_MBYTE
+ else if (nc == 'u' || nc == 'U')
+ unicode = nc;
+#endif
+ else
+ {
+ if (hex
+#ifdef FEAT_MBYTE
+ || unicode != 0
+#endif
+ )
+ {
+ if (!vim_isxdigit(nc))
+ break;
+ cc = cc * 16 + hex2nr(nc);
+ }
+ else if (octal)
+ {
+ if (nc < '0' || nc > '7')
+ break;
+ cc = cc * 8 + nc - '0';
+ }
+ else
+ {
+ if (!VIM_ISDIGIT(nc))
+ break;
+ cc = cc * 10 + nc - '0';
+ }
+
+ ++i;
+ }
+
+ if (cc > 255
+#ifdef FEAT_MBYTE
+ && unicode == 0
+#endif
+ )
+ cc = 255; /* limit range to 0-255 */
+ nc = 0;
+
+ if (hex) /* hex: up to two chars */
+ {
+ if (i >= 2)
+ break;
+ }
+#ifdef FEAT_MBYTE
+ else if (unicode) /* Unicode: up to four or eight chars */
+ {
+ if ((unicode == 'u' && i >= 4) || (unicode == 'U' && i >= 8))
+ break;
+ }
+#endif
+ else if (i >= 3) /* decimal or octal: up to three chars */
+ break;
+ }
+ if (i == 0) /* no number entered */
+ {
+ if (nc == K_ZERO) /* NUL is stored as NL */
+ {
+ cc = '\n';
+ nc = 0;
+ }
+ else
+ {
+ cc = nc;
+ nc = 0;
+ }
+ }
+
+ if (cc == 0) /* NUL is stored as NL */
+ cc = '\n';
+
+ --no_mapping;
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ --allow_keys;
+#endif
+ if (nc)
+ vungetc(nc);
+ got_int = FALSE; /* CTRL-C typed after CTRL-V is not an interrupt */
+ return cc;
+}
+
+/*
+ * Insert character, taking care of special keys and mod_mask
+ */
+ static void
+insert_special(c, allow_modmask, ctrlv)
+ int c;
+ int allow_modmask;
+ int ctrlv; /* c was typed after CTRL-V */
+{
+ char_u *p;
+ int len;
+
+ /*
+ * Special function key, translate into "<Key>". Up to the last '>' is
+ * inserted with ins_str(), so as not to replace characters in replace
+ * mode.
+ * Only use mod_mask for special keys, to avoid things like <S-Space>,
+ * unless 'allow_modmask' is TRUE.
+ */
+#ifdef MACOS
+ /* Command-key never produces a normal key */
+ if (mod_mask & MOD_MASK_CMD)
+ allow_modmask = TRUE;
+#endif
+ if (IS_SPECIAL(c) || (mod_mask && allow_modmask))
+ {
+ p = get_special_key_name(c, mod_mask);
+ len = (int)STRLEN(p);
+ c = p[len - 1];
+ if (len > 2)
+ {
+ if (stop_arrow() == FAIL)
+ return;
+ p[len - 1] = NUL;
+ ins_str(p);
+ AppendToRedobuffLit(p);
+ ctrlv = FALSE;
+ }
+ }
+ if (stop_arrow() == OK)
+ insertchar(c, ctrlv ? INSCHAR_CTRLV : 0, -1);
+}
+
+/*
+ * Special characters in this context are those that need processing other
+ * than the simple insertion that can be performed here. This includes ESC
+ * which terminates the insert, and CR/NL which need special processing to
+ * open up a new line. This routine tries to optimize insertions performed by
+ * the "redo", "undo" or "put" commands, so it needs to know when it should
+ * stop and defer processing to the "normal" mechanism.
+ * '0' and '^' are special, because they can be followed by CTRL-D.
+ */
+#ifdef EBCDIC
+# define ISSPECIAL(c) ((c) < ' ' || (c) == '0' || (c) == '^')
+#else
+# define ISSPECIAL(c) ((c) < ' ' || (c) >= DEL || (c) == '0' || (c) == '^')
+#endif
+
+#ifdef FEAT_MBYTE
+# define WHITECHAR(cc) (vim_iswhite(cc) && (!enc_utf8 || !utf_iscomposing(utf_ptr2char(ml_get_cursor() + 1))))
+#else
+# define WHITECHAR(cc) vim_iswhite(cc)
+#endif
+
+ void
+insertchar(c, flags, second_indent)
+ int c; /* character to insert or NUL */
+ int flags; /* INSCHAR_FORMAT, etc. */
+ int second_indent; /* indent for second line if >= 0 */
+{
+ int haveto_redraw = FALSE;
+ int textwidth;
+#ifdef FEAT_COMMENTS
+ colnr_T leader_len;
+ char_u *p;
+ int no_leader = FALSE;
+ int do_comments = (flags & INSCHAR_DO_COM);
+#endif
+ int fo_white_par;
+ int first_line = TRUE;
+ int fo_ins_blank;
+#ifdef FEAT_MBYTE
+ int fo_multibyte;
+#endif
+ int save_char = NUL;
+ int cc;
+
+ textwidth = comp_textwidth(flags & INSCHAR_FORMAT);
+ fo_ins_blank = has_format_option(FO_INS_BLANK);
+#ifdef FEAT_MBYTE
+ fo_multibyte = has_format_option(FO_MBYTE_BREAK);
+#endif
+ fo_white_par = has_format_option(FO_WHITE_PAR);
+
+ /*
+ * Try to break the line in two or more pieces when:
+ * - Always do this if we have been called to do formatting only.
+ * - Always do this when 'formatoptions' has the 'a' flag and the line
+ * ends in white space.
+ * - Otherwise:
+ * - Don't do this if inserting a blank
+ * - Don't do this if an existing character is being replaced, unless
+ * we're in VREPLACE mode.
+ * - Do this if the cursor is not on the line where insert started
+ * or - 'formatoptions' doesn't have 'l' or the line was not too long
+ * before the insert.
+ * - 'formatoptions' doesn't have 'b' or a blank was inserted at or
+ * before 'textwidth'
+ */
+ if (textwidth
+ && ((flags & INSCHAR_FORMAT)
+ || (!vim_iswhite(c)
+ && !((State & REPLACE_FLAG)
+#ifdef FEAT_VREPLACE
+ && !(State & VREPLACE_FLAG)
+#endif
+ && *ml_get_cursor() != NUL)
+ && (curwin->w_cursor.lnum != Insstart.lnum
+ || ((!has_format_option(FO_INS_LONG)
+ || Insstart_textlen <= (colnr_T)textwidth)
+ && (!fo_ins_blank
+ || Insstart_blank_vcol <= (colnr_T)textwidth
+ ))))))
+ {
+ /*
+ * When 'ai' is off we don't want a space under the cursor to be
+ * deleted. Replace it with an 'x' temporarily.
+ */
+ if (!curbuf->b_p_ai)
+ {
+ cc = gchar_cursor();
+ if (vim_iswhite(cc))
+ {
+ save_char = cc;
+ pchar_cursor('x');
+ }
+ }
+
+ /*
+ * Repeat breaking lines, until the current line is not too long.
+ */
+ while (!got_int)
+ {
+ int startcol; /* Cursor column at entry */
+ int wantcol; /* column at textwidth border */
+ int foundcol; /* column for start of spaces */
+ int end_foundcol = 0; /* column for start of word */
+ colnr_T len;
+ colnr_T virtcol;
+#ifdef FEAT_VREPLACE
+ int orig_col = 0;
+ char_u *saved_text = NULL;
+#endif
+ colnr_T col;
+
+ virtcol = get_nolist_virtcol();
+ if (virtcol < (colnr_T)textwidth)
+ break;
+
+#ifdef FEAT_COMMENTS
+ if (no_leader)
+ do_comments = FALSE;
+ else if (!(flags & INSCHAR_FORMAT)
+ && has_format_option(FO_WRAP_COMS))
+ do_comments = TRUE;
+
+ /* Don't break until after the comment leader */
+ if (do_comments)
+ leader_len = get_leader_len(ml_get_curline(), NULL, FALSE);
+ else
+ leader_len = 0;
+
+ /* If the line doesn't start with a comment leader, then don't
+ * start one in a following broken line. Avoids that a %word
+ * moved to the start of the next line causes all following lines
+ * to start with %. */
+ if (leader_len == 0)
+ no_leader = TRUE;
+#endif
+ if (!(flags & INSCHAR_FORMAT)
+#ifdef FEAT_COMMENTS
+ && leader_len == 0
+#endif
+ && !has_format_option(FO_WRAP))
+
+ {
+ textwidth = 0;
+ break;
+ }
+ if ((startcol = curwin->w_cursor.col) == 0)
+ break;
+
+ /* find column of textwidth border */
+ coladvance((colnr_T)textwidth);
+ wantcol = curwin->w_cursor.col;
+
+ curwin->w_cursor.col = startcol - 1;
+#ifdef FEAT_MBYTE
+ /* Correct cursor for multi-byte character. */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+ foundcol = 0;
+
+ /*
+ * Find position to break at.
+ * Stop at first entered white when 'formatoptions' has 'v'
+ */
+ while ((!fo_ins_blank && !has_format_option(FO_INS_VI))
+ || curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col >= Insstart.col)
+ {
+ cc = gchar_cursor();
+ if (WHITECHAR(cc))
+ {
+ /* remember position of blank just before text */
+ end_foundcol = curwin->w_cursor.col;
+
+ /* find start of sequence of blanks */
+ while (curwin->w_cursor.col > 0 && WHITECHAR(cc))
+ {
+ dec_cursor();
+ cc = gchar_cursor();
+ }
+ if (curwin->w_cursor.col == 0 && WHITECHAR(cc))
+ break; /* only spaces in front of text */
+#ifdef FEAT_COMMENTS
+ /* Don't break until after the comment leader */
+ if (curwin->w_cursor.col < leader_len)
+ break;
+#endif
+ if (has_format_option(FO_ONE_LETTER))
+ {
+ /* do not break after one-letter words */
+ if (curwin->w_cursor.col == 0)
+ break; /* one-letter word at begin */
+
+ col = curwin->w_cursor.col;
+ dec_cursor();
+ cc = gchar_cursor();
+
+ if (WHITECHAR(cc))
+ continue; /* one-letter, continue */
+ curwin->w_cursor.col = col;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ foundcol = curwin->w_cursor.col
+ + (*mb_ptr2len_check)(ml_get_cursor());
+ else
+#endif
+ foundcol = curwin->w_cursor.col + 1;
+ if (curwin->w_cursor.col < (colnr_T)wantcol)
+ break;
+ }
+#ifdef FEAT_MBYTE
+ else if (cc >= 0x100 && fo_multibyte
+ && curwin->w_cursor.col <= (colnr_T)wantcol)
+ {
+ /* Break after or before a multi-byte character. */
+ foundcol = curwin->w_cursor.col;
+ if (curwin->w_cursor.col < (colnr_T)wantcol)
+ foundcol += (*mb_char2len)(cc);
+ end_foundcol = foundcol;
+ break;
+ }
+#endif
+ if (curwin->w_cursor.col == 0)
+ break;
+ dec_cursor();
+ }
+
+ if (foundcol == 0) /* no spaces, cannot break line */
+ {
+ curwin->w_cursor.col = startcol;
+ break;
+ }
+
+ /* Going to break the line, remove any "$" now. */
+ undisplay_dollar();
+
+ /*
+ * Offset between cursor position and line break is used by replace
+ * stack functions. VREPLACE does not use this, and backspaces
+ * over the text instead.
+ */
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ orig_col = startcol; /* Will start backspacing from here */
+ else
+#endif
+ replace_offset = startcol - end_foundcol - 1;
+
+ /*
+ * adjust startcol for spaces that will be deleted and
+ * characters that will remain on top line
+ */
+ curwin->w_cursor.col = foundcol;
+ while (cc = gchar_cursor(), WHITECHAR(cc))
+ inc_cursor();
+ startcol -= curwin->w_cursor.col;
+ if (startcol < 0)
+ startcol = 0;
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ /*
+ * In VREPLACE mode, we will backspace over the text to be
+ * wrapped, so save a copy now to put on the next line.
+ */
+ saved_text = vim_strsave(ml_get_cursor());
+ curwin->w_cursor.col = orig_col;
+ if (saved_text == NULL)
+ break; /* Can't do it, out of memory */
+ saved_text[startcol] = NUL;
+
+ /* Backspace over characters that will move to the next line */
+ if (!fo_white_par)
+ backspace_until_column(foundcol);
+ }
+ else
+#endif
+ {
+ /* put cursor after pos. to break line */
+ if (!fo_white_par)
+ curwin->w_cursor.col = foundcol;
+ }
+
+ /*
+ * Split the line just before the margin.
+ * Only insert/delete lines, but don't really redraw the window.
+ */
+ open_line(FORWARD, OPENLINE_DELSPACES + OPENLINE_MARKFIX
+ + (fo_white_par ? OPENLINE_KEEPTRAIL : 0)
+#ifdef FEAT_COMMENTS
+ + (do_comments ? OPENLINE_DO_COM : 0)
+#endif
+ , old_indent);
+ old_indent = 0;
+
+ replace_offset = 0;
+ if (first_line)
+ {
+ if (second_indent < 0 && has_format_option(FO_Q_NUMBER))
+ second_indent = get_number_indent(curwin->w_cursor.lnum -1);
+ if (second_indent >= 0)
+ {
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ change_indent(INDENT_SET, second_indent, FALSE, NUL);
+ else
+#endif
+ (void)set_indent(second_indent, SIN_CHANGED);
+ }
+ first_line = FALSE;
+ }
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ /*
+ * In VREPLACE mode we have backspaced over the text to be
+ * moved, now we re-insert it into the new line.
+ */
+ ins_bytes(saved_text);
+ vim_free(saved_text);
+ }
+ else
+#endif
+ {
+ /*
+ * Check if cursor is not past the NUL off the line, cindent
+ * may have added or removed indent.
+ */
+ curwin->w_cursor.col += startcol;
+ len = (colnr_T)STRLEN(ml_get_curline());
+ if (curwin->w_cursor.col > len)
+ curwin->w_cursor.col = len;
+ }
+
+ haveto_redraw = TRUE;
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+ /* moved the cursor, don't autoindent or cindent now */
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+ line_breakcheck();
+ }
+
+ if (save_char) /* put back space after cursor */
+ pchar_cursor(save_char);
+
+ if (c == NUL) /* formatting only */
+ return;
+ if (haveto_redraw)
+ {
+ update_topline();
+ redraw_curbuf_later(VALID);
+ }
+ }
+ if (c == NUL) /* only formatting was wanted */
+ return;
+
+#ifdef FEAT_COMMENTS
+ /* Check whether this character should end a comment. */
+ if (did_ai && (int)c == end_comment_pending)
+ {
+ char_u *line;
+ char_u lead_end[COM_MAX_LEN]; /* end-comment string */
+ int middle_len, end_len;
+ int i;
+
+ /*
+ * Need to remove existing (middle) comment leader and insert end
+ * comment leader. First, check what comment leader we can find.
+ */
+ i = get_leader_len(line = ml_get_curline(), &p, FALSE);
+ if (i > 0 && vim_strchr(p, COM_MIDDLE) != NULL) /* Just checking */
+ {
+ /* Skip middle-comment string */
+ while (*p && p[-1] != ':') /* find end of middle flags */
+ ++p;
+ middle_len = copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
+ /* Don't count trailing white space for middle_len */
+ while (middle_len > 0 && vim_iswhite(lead_end[middle_len - 1]))
+ --middle_len;
+
+ /* Find the end-comment string */
+ while (*p && p[-1] != ':') /* find end of end flags */
+ ++p;
+ end_len = copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
+
+ /* Skip white space before the cursor */
+ i = curwin->w_cursor.col;
+ while (--i >= 0 && vim_iswhite(line[i]))
+ ;
+ i++;
+
+ /* Skip to before the middle leader */
+ i -= middle_len;
+
+ /* Check some expected things before we go on */
+ if (i >= 0 && lead_end[end_len - 1] == end_comment_pending)
+ {
+ /* Backspace over all the stuff we want to replace */
+ backspace_until_column(i);
+
+ /*
+ * Insert the end-comment string, except for the last
+ * character, which will get inserted as normal later.
+ */
+ ins_bytes_len(lead_end, end_len - 1);
+ }
+ }
+ }
+ end_comment_pending = NUL;
+#endif
+
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+
+ /*
+ * If there's any pending input, grab up to INPUT_BUFLEN at once.
+ * This speeds up normal text input considerably.
+ * Don't do this when 'cindent' or 'indentexpr' is set, because we might
+ * need to re-indent at a ':', or any other character (but not what
+ * 'paste' is set)..
+ */
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = FALSE; /* allow scrolling here */
+#endif
+
+ if ( !ISSPECIAL(c)
+#ifdef FEAT_MBYTE
+ && (!has_mbyte || (*mb_char2len)(c) == 1)
+#endif
+ && vpeekc() != NUL
+ && !(State & REPLACE_FLAG)
+#ifdef FEAT_CINDENT
+ && !cindent_on()
+#endif
+#ifdef FEAT_RIGHTLEFT
+ && !p_ri
+#endif
+ )
+ {
+#define INPUT_BUFLEN 100
+ char_u buf[INPUT_BUFLEN + 1];
+ int i;
+ colnr_T virtcol = 0;
+
+ buf[0] = c;
+ i = 1;
+ if (textwidth)
+ virtcol = get_nolist_virtcol();
+ /*
+ * Stop the string when:
+ * - no more chars available
+ * - finding a special character (command key)
+ * - buffer is full
+ * - running into the 'textwidth' boundary
+ * - need to check for abbreviation: A non-word char after a word-char
+ */
+ while ( (c = vpeekc()) != NUL
+ && !ISSPECIAL(c)
+#ifdef FEAT_MBYTE
+ && (!has_mbyte || MB_BYTE2LEN_CHECK(c) == 1)
+#endif
+ && i < INPUT_BUFLEN
+ && (textwidth == 0
+ || (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth)
+ && !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1])))
+ {
+#ifdef FEAT_RIGHTLEFT
+ c = vgetc();
+ if (p_hkmap && KeyTyped)
+ c = hkmap(c); /* Hebrew mode mapping */
+# ifdef FEAT_FKMAP
+ if (p_fkmap && KeyTyped)
+ c = fkmap(c); /* Farsi mode mapping */
+# endif
+ buf[i++] = c;
+#else
+ buf[i++] = vgetc();
+#endif
+ }
+
+#ifdef FEAT_DIGRAPHS
+ do_digraph(-1); /* clear digraphs */
+ do_digraph(buf[i-1]); /* may be the start of a digraph */
+#endif
+ buf[i] = NUL;
+ ins_str(buf);
+ if (flags & INSCHAR_CTRLV)
+ {
+ redo_literal(*buf);
+ i = 1;
+ }
+ else
+ i = 0;
+ if (buf[i] != NUL)
+ AppendToRedobuffLit(buf + i);
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (cc = (*mb_char2len)(c)) > 1)
+ {
+ char_u buf[MB_MAXBYTES + 1];
+
+ (*mb_char2bytes)(c, buf);
+ buf[cc] = NUL;
+ ins_char_bytes(buf, cc);
+ AppendCharToRedobuff(c);
+ }
+ else
+#endif
+ {
+ ins_char(c);
+ if (flags & INSCHAR_CTRLV)
+ redo_literal(c);
+ else
+ AppendCharToRedobuff(c);
+ }
+ }
+}
+
+/*
+ * Called after inserting or deleting text: When 'formatoptions' includes the
+ * 'a' flag format from the current line until the end of the paragraph.
+ * Keep the cursor at the same position relative to the text.
+ * The caller must have saved the cursor line for undo, following ones will be
+ * saved here.
+ */
+ void
+auto_format(trailblank, prev_line)
+ int trailblank; /* when TRUE also format with trailing blank */
+ int prev_line; /* may start in previous line */
+{
+ pos_T pos;
+ colnr_T len;
+ char_u *old;
+ char_u *new, *pnew;
+ int wasatend;
+
+ if (!has_format_option(FO_AUTO))
+ return;
+
+ pos = curwin->w_cursor;
+ old = ml_get_curline();
+
+ /* may remove added space */
+ check_auto_format(FALSE);
+
+ /* Don't format in Insert mode when the cursor is on a trailing blank, the
+ * user might insert normal text next. Also skip formatting when "1" is
+ * in 'formatoptions' and there is a single character before the cursor.
+ * Otherwise the line would be broken and when typing another non-white
+ * next they are not joined back together. */
+ wasatend = (pos.col == STRLEN(old));
+ if (*old != NUL && !trailblank && wasatend)
+ {
+ dec_cursor();
+ if (!WHITECHAR(gchar_cursor())
+ && curwin->w_cursor.col > 0
+ && has_format_option(FO_ONE_LETTER))
+ dec_cursor();
+ if (WHITECHAR(gchar_cursor()))
+ {
+ curwin->w_cursor = pos;
+ return;
+ }
+ curwin->w_cursor = pos;
+ }
+
+#ifdef FEAT_COMMENTS
+ /* With the 'c' flag in 'formatoptions' and 't' missing: only format
+ * comments. */
+ if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP)
+ && get_leader_len(old, NULL, FALSE) == 0)
+ return;
+#endif
+
+ /*
+ * May start formatting in a previous line, so that after "x" a word is
+ * moved to the previous line if it fits there now. Only when this is not
+ * the start of a paragraph.
+ */
+ if (prev_line && !paragraph_start(curwin->w_cursor.lnum))
+ {
+ --curwin->w_cursor.lnum;
+ if (u_save_cursor() == FAIL)
+ return;
+ }
+
+ /*
+ * Do the formatting and restore the cursor position. "saved_cursor" will
+ * be adjusted for the text formatting.
+ */
+ saved_cursor = pos;
+ format_lines((linenr_T)-1);
+ curwin->w_cursor = saved_cursor;
+ saved_cursor.lnum = 0;
+
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ {
+ /* "cannot happen" */
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ coladvance((colnr_T)MAXCOL);
+ }
+ else
+ check_cursor_col();
+
+ /* Insert mode: If the cursor is now after the end of the line while it
+ * previously wasn't, the line was broken. Because of the rule above we
+ * need to add a space when 'w' is in 'formatoptions' to keep a paragraph
+ * formatted. */
+ if (!wasatend && has_format_option(FO_WHITE_PAR))
+ {
+ new = ml_get_curline();
+ len = STRLEN(new);
+ if (curwin->w_cursor.col == len)
+ {
+ pnew = vim_strnsave(new, len + 2);
+ pnew[len] = ' ';
+ pnew[len + 1] = NUL;
+ ml_replace(curwin->w_cursor.lnum, pnew, FALSE);
+ /* remove the space later */
+ did_add_space = TRUE;
+ }
+ else
+ /* may remove added space */
+ check_auto_format(FALSE);
+ }
+
+ check_cursor();
+}
+
+/*
+ * When an extra space was added to continue a paragraph for auto-formatting,
+ * delete it now. The space must be under the cursor, just after the insert
+ * position.
+ */
+ static void
+check_auto_format(end_insert)
+ int end_insert; /* TRUE when ending Insert mode */
+{
+ int c = ' ';
+
+ if (did_add_space)
+ {
+ if (!WHITECHAR(gchar_cursor()))
+ /* Somehow the space was removed already. */
+ did_add_space = FALSE;
+ else
+ {
+ if (!end_insert)
+ {
+ inc_cursor();
+ c = gchar_cursor();
+ dec_cursor();
+ }
+ if (c != NUL)
+ {
+ /* The space is no longer at the end of the line, delete it. */
+ del_char(FALSE);
+ did_add_space = FALSE;
+ }
+ }
+ }
+}
+
+/*
+ * Find out textwidth to be used for formatting:
+ * if 'textwidth' option is set, use it
+ * else if 'wrapmargin' option is set, use W_WIDTH(curwin) - 'wrapmargin'
+ * if invalid value, use 0.
+ * Set default to window width (maximum 79) for "gq" operator.
+ */
+ int
+comp_textwidth(ff)
+ int ff; /* force formatting (for "Q" command) */
+{
+ int textwidth;
+
+ textwidth = curbuf->b_p_tw;
+ if (textwidth == 0 && curbuf->b_p_wm)
+ {
+ /* The width is the window width minus 'wrapmargin' minus all the
+ * things that add to the margin. */
+ textwidth = W_WIDTH(curwin) - curbuf->b_p_wm;
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ textwidth -= 1;
+#endif
+#ifdef FEAT_FOLDING
+ textwidth -= curwin->w_p_fdc;
+#endif
+#ifdef FEAT_SIGNS
+ if (curwin->w_buffer->b_signlist != NULL
+# ifdef FEAT_NETBEANS_INTG
+ || usingNetbeans
+# endif
+ )
+ textwidth -= 1;
+#endif
+ if (curwin->w_p_nu)
+ textwidth -= 8;
+ }
+ if (textwidth < 0)
+ textwidth = 0;
+ if (ff && textwidth == 0)
+ {
+ textwidth = W_WIDTH(curwin) - 1;
+ if (textwidth > 79)
+ textwidth = 79;
+ }
+ return textwidth;
+}
+
+/*
+ * Put a character in the redo buffer, for when just after a CTRL-V.
+ */
+ static void
+redo_literal(c)
+ int c;
+{
+ char_u buf[10];
+
+ /* Only digits need special treatment. Translate them into a string of
+ * three digits. */
+ if (VIM_ISDIGIT(c))
+ {
+ sprintf((char *)buf, "%03d", c);
+ AppendToRedobuff(buf);
+ }
+ else
+ AppendCharToRedobuff(c);
+}
+
+/*
+ * start_arrow() is called when an arrow key is used in insert mode.
+ * It resembles hitting the <ESC> key.
+ */
+ static void
+start_arrow(end_insert_pos)
+ pos_T *end_insert_pos;
+{
+ if (!arrow_used) /* something has been inserted */
+ {
+ AppendToRedobuff(ESC_STR);
+ stop_insert(end_insert_pos, FALSE);
+ arrow_used = TRUE; /* this means we stopped the current insert */
+ }
+}
+
+/*
+ * stop_arrow() is called before a change is made in insert mode.
+ * If an arrow key has been used, start a new insertion.
+ * Returns FAIL if undo is impossible, shouldn't insert then.
+ */
+ int
+stop_arrow()
+{
+ if (arrow_used)
+ {
+ if (u_save_cursor() == OK)
+ {
+ arrow_used = FALSE;
+ ins_need_undo = FALSE;
+ }
+ Insstart = curwin->w_cursor; /* new insertion starts here */
+ Insstart_textlen = linetabsize(ml_get_curline());
+ ai_col = 0;
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ orig_line_count = curbuf->b_ml.ml_line_count;
+ vr_lines_changed = 1;
+ }
+#endif
+ ResetRedobuff();
+ AppendToRedobuff((char_u *)"1i"); /* pretend we start an insertion */
+ }
+ else if (ins_need_undo)
+ {
+ if (u_save_cursor() == OK)
+ ins_need_undo = FALSE;
+ }
+
+#ifdef FEAT_FOLDING
+ /* Always open fold at the cursor line when inserting something. */
+ foldOpenCursor();
+#endif
+
+ return (arrow_used || ins_need_undo ? FAIL : OK);
+}
+
+/*
+ * do a few things to stop inserting
+ */
+ static void
+stop_insert(end_insert_pos, esc)
+ pos_T *end_insert_pos; /* where insert ended */
+ int esc; /* called by ins_esc() */
+{
+ int cc;
+
+ stop_redo_ins();
+ replace_flush(); /* abandon replace stack */
+
+ /*
+ * save the inserted text for later redo with ^@
+ */
+ vim_free(last_insert);
+ last_insert = get_inserted();
+ last_insert_skip = new_insert_skip;
+
+ if (!arrow_used)
+ {
+ /* Auto-format now. It may seem strange to do this when stopping an
+ * insertion (or moving the cursor), but it's required when appending
+ * a line and having it end in a space. But only do it when something
+ * was actually inserted, otherwise undo won't work. */
+ if (!ins_need_undo)
+ {
+ /* When the cursor is at the end of the line after a space the
+ * formatting will move it to the following word. Avoid that by
+ * moving the cursor onto the space. */
+ cc = 'x';
+ if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL)
+ {
+ dec_cursor();
+ cc = gchar_cursor();
+ if (!vim_iswhite(cc))
+ inc_cursor();
+ }
+
+ auto_format(TRUE, FALSE);
+
+ if (vim_iswhite(cc) && gchar_cursor() != NUL)
+ inc_cursor();
+ }
+
+ /* If a space was inserted for auto-formatting, remove it now. */
+ check_auto_format(TRUE);
+
+ /* If we just did an auto-indent, remove the white space from the end
+ * of the line, and put the cursor back. */
+ if (did_ai && esc)
+ {
+ if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
+ --curwin->w_cursor.col;
+ while (cc = gchar_cursor(), vim_iswhite(cc))
+ (void)del_char(TRUE);
+ if (cc != NUL)
+ ++curwin->w_cursor.col; /* put cursor back on the NUL */
+
+#ifdef FEAT_VISUAL
+ /* <C-S-Right> may have started Visual mode, adjust the position for
+ * deleted characters. */
+ if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
+ {
+ cc = STRLEN(ml_get_curline());
+ if (VIsual.col > (colnr_T)cc)
+ {
+ VIsual.col = cc;
+# ifdef FEAT_VIRTUALEDIT
+ VIsual.coladd = 0;
+# endif
+ }
+ }
+#endif
+ }
+ }
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+
+ /* set '[ and '] to the inserted text */
+ curbuf->b_op_start = Insstart;
+ curbuf->b_op_end = *end_insert_pos;
+}
+
+/*
+ * Set the last inserted text to a single character.
+ * Used for the replace command.
+ */
+ void
+set_last_insert(c)
+ int c;
+{
+ char_u *s;
+
+ vim_free(last_insert);
+#ifdef FEAT_MBYTE
+ last_insert = alloc(MB_MAXBYTES * 3 + 5);
+#else
+ last_insert = alloc(6);
+#endif
+ if (last_insert != NULL)
+ {
+ s = last_insert;
+ /* Use the CTRL-V only when entering a special char */
+ if (c < ' ' || c == DEL)
+ *s++ = Ctrl_V;
+ s = add_char2buf(c, s);
+ *s++ = ESC;
+ *s++ = NUL;
+ last_insert_skip = 0;
+ }
+}
+
+/*
+ * Add character "c" to buffer "s". Escape the special meaning of K_SPECIAL
+ * and CSI. Handle multi-byte characters.
+ * Returns a pointer to after the added bytes.
+ */
+ char_u *
+add_char2buf(c, s)
+ int c;
+ char_u *s;
+{
+#ifdef FEAT_MBYTE
+ char_u temp[MB_MAXBYTES];
+ int i;
+ int len;
+
+ len = (*mb_char2bytes)(c, temp);
+ for (i = 0; i < len; ++i)
+ {
+ c = temp[i];
+#endif
+ /* Need to escape K_SPECIAL and CSI like in the typeahead buffer. */
+ if (c == K_SPECIAL)
+ {
+ *s++ = K_SPECIAL;
+ *s++ = KS_SPECIAL;
+ *s++ = KE_FILLER;
+ }
+#ifdef FEAT_GUI
+ else if (c == CSI)
+ {
+ *s++ = CSI;
+ *s++ = KS_EXTRA;
+ *s++ = (int)KE_CSI;
+ }
+#endif
+ else
+ *s++ = c;
+#ifdef FEAT_MBYTE
+ }
+#endif
+ return s;
+}
+
+/*
+ * move cursor to start of line
+ * if flags & BL_WHITE move to first non-white
+ * if flags & BL_SOL move to first non-white if startofline is set,
+ * otherwise keep "curswant" column
+ * if flags & BL_FIX don't leave the cursor on a NUL.
+ */
+ void
+beginline(flags)
+ int flags;
+{
+ if ((flags & BL_SOL) && !p_sol)
+ coladvance(curwin->w_curswant);
+ else
+ {
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+
+ if (flags & (BL_WHITE | BL_SOL))
+ {
+ char_u *ptr;
+
+ for (ptr = ml_get_curline(); vim_iswhite(*ptr)
+ && !((flags & BL_FIX) && ptr[1] == NUL); ++ptr)
+ ++curwin->w_cursor.col;
+ }
+ curwin->w_set_curswant = TRUE;
+ }
+}
+
+/*
+ * oneright oneleft cursor_down cursor_up
+ *
+ * Move one char {right,left,down,up}.
+ * Doesn't move onto the NUL past the end of the line.
+ * Return OK when successful, FAIL when we hit a line of file boundary.
+ */
+
+ int
+oneright()
+{
+ char_u *ptr;
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ {
+ pos_T prevpos = curwin->w_cursor;
+
+ /* Adjust for multi-wide char (excluding TAB) */
+ ptr = ml_get_cursor();
+ coladvance(getviscol() + ((*ptr != TAB && vim_isprintc(
+#ifdef FEAT_MBYTE
+ (*mb_ptr2char)(ptr)
+#else
+ *ptr
+#endif
+ ))
+ ? ptr2cells(ptr) : 1));
+ curwin->w_set_curswant = TRUE;
+ /* Return OK if the cursor moved, FAIL otherwise (at window edge). */
+ return (prevpos.col != curwin->w_cursor.col
+ || prevpos.coladd != curwin->w_cursor.coladd) ? OK : FAIL;
+ }
+#endif
+
+ ptr = ml_get_cursor();
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(ptr)) > 1)
+ {
+ /* The character under the cursor is a multi-byte character, move
+ * several bytes right, but don't end up on the NUL. */
+ if (ptr[l] == NUL)
+ return FAIL;
+ curwin->w_cursor.col += l;
+ }
+ else
+#endif
+ {
+ if (*ptr++ == NUL || *ptr == NUL)
+ return FAIL;
+ ++curwin->w_cursor.col;
+ }
+
+ curwin->w_set_curswant = TRUE;
+ return OK;
+}
+
+ int
+oneleft()
+{
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ {
+ int width;
+ int v = getviscol();
+
+ if (v == 0)
+ return FAIL;
+
+# ifdef FEAT_LINEBREAK
+ /* We might get stuck on 'showbreak', skip over it. */
+ width = 1;
+ for (;;)
+ {
+ coladvance(v - width);
+ /* getviscol() is slow, skip it when 'showbreak' is empty and
+ * there are no multi-byte characters */
+ if ((*p_sbr == NUL
+# ifdef FEAT_MBYTE
+ && !has_mbyte
+# endif
+ ) || getviscol() < v)
+ break;
+ ++width;
+ }
+# else
+ coladvance(v - 1);
+# endif
+
+ if (curwin->w_cursor.coladd == 1)
+ {
+ char_u *ptr;
+
+ /* Adjust for multi-wide char (not a TAB) */
+ ptr = ml_get_cursor();
+ if (*ptr != TAB && vim_isprintc(
+# ifdef FEAT_MBYTE
+ (*mb_ptr2char)(ptr)
+# else
+ *ptr
+# endif
+ ) && ptr2cells(ptr) > 1)
+ curwin->w_cursor.coladd = 0;
+ }
+
+ curwin->w_set_curswant = TRUE;
+ return OK;
+ }
+#endif
+
+ if (curwin->w_cursor.col == 0)
+ return FAIL;
+
+ curwin->w_set_curswant = TRUE;
+ --curwin->w_cursor.col;
+
+#ifdef FEAT_MBYTE
+ /* if the character on the left of the current cursor is a multi-byte
+ * character, move to its first byte */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+ return OK;
+}
+
+ int
+cursor_up(n, upd_topline)
+ long n;
+ int upd_topline; /* When TRUE: update topline */
+{
+ linenr_T lnum;
+
+ if (n > 0)
+ {
+ lnum = curwin->w_cursor.lnum;
+ if (lnum <= 1)
+ return FAIL;
+ if (n >= lnum)
+ lnum = 1;
+ else
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ /*
+ * Count each sequence of folded lines as one logical line.
+ */
+ /* go to the the start of the current fold */
+ (void)hasFolding(lnum, &lnum, NULL);
+
+ while (n--)
+ {
+ /* move up one line */
+ --lnum;
+ if (lnum <= 1)
+ break;
+ /* If we entered a fold, move to the beginning, unless in
+ * Insert mode or when 'foldopen' contains "all": it will open
+ * in a moment. */
+ if (n > 0 || !((State & INSERT) || (fdo_flags & FDO_ALL)))
+ (void)hasFolding(lnum, &lnum, NULL);
+ }
+ if (lnum < 1)
+ lnum = 1;
+ }
+ else
+#endif
+ lnum -= n;
+ curwin->w_cursor.lnum = lnum;
+ }
+
+ /* try to advance to the column we want to be at */
+ coladvance(curwin->w_curswant);
+
+ if (upd_topline)
+ update_topline(); /* make sure curwin->w_topline is valid */
+
+ return OK;
+}
+
+/*
+ * Cursor down a number of logical lines.
+ */
+ int
+cursor_down(n, upd_topline)
+ long n;
+ int upd_topline; /* When TRUE: update topline */
+{
+ linenr_T lnum;
+
+ if (n > 0)
+ {
+ lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_FOLDING
+ /* Move to last line of fold, will fail if it's the end-of-file. */
+ (void)hasFolding(lnum, NULL, &lnum);
+#endif
+ if (lnum >= curbuf->b_ml.ml_line_count)
+ return FAIL;
+ if (lnum + n >= curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count;
+ else
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ linenr_T last;
+
+ /* count each sequence of folded lines as one logical line */
+ while (n--)
+ {
+ if (hasFolding(lnum, NULL, &last))
+ lnum = last + 1;
+ else
+ ++lnum;
+ if (lnum >= curbuf->b_ml.ml_line_count)
+ break;
+ }
+ if (lnum > curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count;
+ }
+ else
+#endif
+ lnum += n;
+ curwin->w_cursor.lnum = lnum;
+ }
+
+ /* try to advance to the column we want to be at */
+ coladvance(curwin->w_curswant);
+
+ if (upd_topline)
+ update_topline(); /* make sure curwin->w_topline is valid */
+
+ return OK;
+}
+
+/*
+ * Stuff the last inserted text in the read buffer.
+ * Last_insert actually is a copy of the redo buffer, so we
+ * first have to remove the command.
+ */
+ int
+stuff_inserted(c, count, no_esc)
+ int c; /* Command character to be inserted */
+ long count; /* Repeat this many times */
+ int no_esc; /* Don't add an ESC at the end */
+{
+ char_u *esc_ptr;
+ char_u *ptr;
+ char_u *last_ptr;
+ char_u last = NUL;
+
+ ptr = get_last_insert();
+ if (ptr == NULL)
+ {
+ EMSG(_(e_noinstext));
+ return FAIL;
+ }
+
+ /* may want to stuff the command character, to start Insert mode */
+ if (c != NUL)
+ stuffcharReadbuff(c);
+ if ((esc_ptr = (char_u *)vim_strrchr(ptr, ESC)) != NULL)
+ *esc_ptr = NUL; /* remove the ESC */
+
+ /* when the last char is either "0" or "^" it will be quoted if no ESC
+ * comes after it OR if it will inserted more than once and "ptr"
+ * starts with ^D. -- Acevedo
+ */
+ last_ptr = (esc_ptr ? esc_ptr : ptr + STRLEN(ptr)) - 1;
+ if (last_ptr >= ptr && (*last_ptr == '0' || *last_ptr == '^')
+ && (no_esc || (*ptr == Ctrl_D && count > 1)))
+ {
+ last = *last_ptr;
+ *last_ptr = NUL;
+ }
+
+ do
+ {
+ stuffReadbuff(ptr);
+ /* a trailing "0" is inserted as "<C-V>048", "^" as "<C-V>^" */
+ if (last)
+ stuffReadbuff((char_u *)(last == '0'
+ ? IF_EB("\026\060\064\070", CTRL_V_STR "xf0")
+ : IF_EB("\026^", CTRL_V_STR "^")));
+ }
+ while (--count > 0);
+
+ if (last)
+ *last_ptr = last;
+
+ if (esc_ptr != NULL)
+ *esc_ptr = ESC; /* put the ESC back */
+
+ /* may want to stuff a trailing ESC, to get out of Insert mode */
+ if (!no_esc)
+ stuffcharReadbuff(ESC);
+
+ return OK;
+}
+
+ char_u *
+get_last_insert()
+{
+ if (last_insert == NULL)
+ return NULL;
+ return last_insert + last_insert_skip;
+}
+
+/*
+ * Get last inserted string, and remove trailing <Esc>.
+ * Returns pointer to allocated memory (must be freed) or NULL.
+ */
+ char_u *
+get_last_insert_save()
+{
+ char_u *s;
+ int len;
+
+ if (last_insert == NULL)
+ return NULL;
+ s = vim_strsave(last_insert + last_insert_skip);
+ if (s != NULL)
+ {
+ len = (int)STRLEN(s);
+ if (len > 0 && s[len - 1] == ESC) /* remove trailing ESC */
+ s[len - 1] = NUL;
+ }
+ return s;
+}
+
+/*
+ * Check the word in front of the cursor for an abbreviation.
+ * Called when the non-id character "c" has been entered.
+ * When an abbreviation is recognized it is removed from the text and
+ * the replacement string is inserted in typebuf.tb_buf[], followed by "c".
+ */
+ static int
+echeck_abbr(c)
+ int c;
+{
+ /* Don't check for abbreviation in paste mode, when disabled and just
+ * after moving around with cursor keys. */
+ if (p_paste || no_abbr || arrow_used)
+ return FALSE;
+
+ return check_abbr(c, ml_get_curline(), curwin->w_cursor.col,
+ curwin->w_cursor.lnum == Insstart.lnum ? Insstart.col : 0);
+}
+
+/*
+ * replace-stack functions
+ *
+ * When replacing characters, the replaced characters are remembered for each
+ * new character. This is used to re-insert the old text when backspacing.
+ *
+ * There is a NUL headed list of characters for each character that is
+ * currently in the file after the insertion point. When BS is used, one NUL
+ * headed list is put back for the deleted character.
+ *
+ * For a newline, there are two NUL headed lists. One contains the characters
+ * that the NL replaced. The extra one stores the characters after the cursor
+ * that were deleted (always white space).
+ *
+ * Replace_offset is normally 0, in which case replace_push will add a new
+ * character at the end of the stack. If replace_offset is not 0, that many
+ * characters will be left on the stack above the newly inserted character.
+ */
+
+char_u *replace_stack = NULL;
+long replace_stack_nr = 0; /* next entry in replace stack */
+long replace_stack_len = 0; /* max. number of entries */
+
+ void
+replace_push(c)
+ int c; /* character that is replaced (NUL is none) */
+{
+ char_u *p;
+
+ if (replace_stack_nr < replace_offset) /* nothing to do */
+ return;
+ if (replace_stack_len <= replace_stack_nr)
+ {
+ replace_stack_len += 50;
+ p = lalloc(sizeof(char_u) * replace_stack_len, TRUE);
+ if (p == NULL) /* out of memory */
+ {
+ replace_stack_len -= 50;
+ return;
+ }
+ if (replace_stack != NULL)
+ {
+ mch_memmove(p, replace_stack,
+ (size_t)(replace_stack_nr * sizeof(char_u)));
+ vim_free(replace_stack);
+ }
+ replace_stack = p;
+ }
+ p = replace_stack + replace_stack_nr - replace_offset;
+ if (replace_offset)
+ mch_memmove(p + 1, p, (size_t)(replace_offset * sizeof(char_u)));
+ *p = c;
+ ++replace_stack_nr;
+}
+
+/*
+ * call replace_push(c) with replace_offset set to the first NUL.
+ */
+ static void
+replace_push_off(c)
+ int c;
+{
+ char_u *p;
+
+ p = replace_stack + replace_stack_nr;
+ for (replace_offset = 1; replace_offset < replace_stack_nr;
+ ++replace_offset)
+ if (*--p == NUL)
+ break;
+ replace_push(c);
+ replace_offset = 0;
+}
+
+/*
+ * Pop one item from the replace stack.
+ * return -1 if stack empty
+ * return replaced character or NUL otherwise
+ */
+ static int
+replace_pop()
+{
+ if (replace_stack_nr == 0)
+ return -1;
+ return (int)replace_stack[--replace_stack_nr];
+}
+
+/*
+ * Join the top two items on the replace stack. This removes to "off"'th NUL
+ * encountered.
+ */
+ static void
+replace_join(off)
+ int off; /* offset for which NUL to remove */
+{
+ int i;
+
+ for (i = replace_stack_nr; --i >= 0; )
+ if (replace_stack[i] == NUL && off-- <= 0)
+ {
+ --replace_stack_nr;
+ mch_memmove(replace_stack + i, replace_stack + i + 1,
+ (size_t)(replace_stack_nr - i));
+ return;
+ }
+}
+
+/*
+ * Pop bytes from the replace stack until a NUL is found, and insert them
+ * before the cursor. Can only be used in REPLACE or VREPLACE mode.
+ */
+ static void
+replace_pop_ins()
+{
+ int cc;
+ int oldState = State;
+
+ State = NORMAL; /* don't want REPLACE here */
+ while ((cc = replace_pop()) > 0)
+ {
+#ifdef FEAT_MBYTE
+ mb_replace_pop_ins(cc);
+#else
+ ins_char(cc);
+#endif
+ dec_cursor();
+ }
+ State = oldState;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Insert bytes popped from the replace stack. "cc" is the first byte. If it
+ * indicates a multi-byte char, pop the other bytes too.
+ */
+ static void
+mb_replace_pop_ins(cc)
+ int cc;
+{
+ int n;
+ char_u buf[MB_MAXBYTES];
+ int i;
+ int c;
+
+ if (has_mbyte && (n = MB_BYTE2LEN(cc)) > 1)
+ {
+ buf[0] = cc;
+ for (i = 1; i < n; ++i)
+ buf[i] = replace_pop();
+ ins_bytes_len(buf, n);
+ }
+ else
+ ins_char(cc);
+
+ if (enc_utf8)
+ /* Handle composing chars. */
+ for (;;)
+ {
+ c = replace_pop();
+ if (c == -1) /* stack empty */
+ break;
+ if ((n = MB_BYTE2LEN(c)) == 1)
+ {
+ /* Not a multi-byte char, put it back. */
+ replace_push(c);
+ break;
+ }
+ else
+ {
+ buf[0] = c;
+ for (i = 1; i < n; ++i)
+ buf[i] = replace_pop();
+ if (utf_iscomposing(utf_ptr2char(buf)))
+ ins_bytes_len(buf, n);
+ else
+ {
+ /* Not a composing char, put it back. */
+ for (i = n - 1; i >= 0; --i)
+ replace_push(buf[i]);
+ break;
+ }
+ }
+ }
+}
+#endif
+
+/*
+ * make the replace stack empty
+ * (called when exiting replace mode)
+ */
+ static void
+replace_flush()
+{
+ vim_free(replace_stack);
+ replace_stack = NULL;
+ replace_stack_len = 0;
+ replace_stack_nr = 0;
+}
+
+/*
+ * Handle doing a BS for one character.
+ * cc < 0: replace stack empty, just move cursor
+ * cc == 0: character was inserted, delete it
+ * cc > 0: character was replaced, put cc (first byte of original char) back
+ * and check for more characters to be put back
+ */
+ static void
+replace_do_bs()
+{
+ int cc;
+#ifdef FEAT_VREPLACE
+ int orig_len = 0;
+ int ins_len;
+ int orig_vcols = 0;
+ colnr_T start_vcol;
+ char_u *p;
+ int i;
+ int vcol;
+#endif
+
+ cc = replace_pop();
+ if (cc > 0)
+ {
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ /* Get the number of screen cells used by the character we are
+ * going to delete. */
+ getvcol(curwin, &curwin->w_cursor, NULL, &start_vcol, NULL);
+ orig_vcols = chartabsize(ml_get_cursor(), start_vcol);
+ }
+#endif
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ del_char(FALSE);
+# ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ orig_len = STRLEN(ml_get_cursor());
+# endif
+ replace_push(cc);
+ }
+ else
+#endif
+ {
+ pchar_cursor(cc);
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ orig_len = STRLEN(ml_get_cursor()) - 1;
+#endif
+ }
+ replace_pop_ins();
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ /* Get the number of screen cells used by the inserted characters */
+ p = ml_get_cursor();
+ ins_len = STRLEN(p) - orig_len;
+ vcol = start_vcol;
+ for (i = 0; i < ins_len; ++i)
+ {
+ vcol += chartabsize(p + i, vcol);
+#ifdef FEAT_MBYTE
+ i += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ vcol -= start_vcol;
+
+ /* Delete spaces that were inserted after the cursor to keep the
+ * text aligned. */
+ curwin->w_cursor.col += ins_len;
+ while (vcol > orig_vcols && gchar_cursor() == ' ')
+ {
+ del_char(FALSE);
+ ++orig_vcols;
+ }
+ curwin->w_cursor.col -= ins_len;
+ }
+#endif
+
+ /* mark the buffer as changed and prepare for displaying */
+ changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
+ }
+ else if (cc == 0)
+ (void)del_char(FALSE);
+}
+
+#ifdef FEAT_CINDENT
+/*
+ * Return TRUE if C-indenting is on.
+ */
+ static int
+cindent_on()
+{
+ return (!p_paste && (curbuf->b_p_cin
+# ifdef FEAT_EVAL
+ || *curbuf->b_p_inde != NUL
+# endif
+ ));
+}
+#endif
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO)
+/*
+ * Re-indent the current line, based on the current contents of it and the
+ * surrounding lines. Fixing the cursor position seems really easy -- I'm very
+ * confused what all the part that handles Control-T is doing that I'm not.
+ * "get_the_indent" should be get_c_indent, get_expr_indent or get_lisp_indent.
+ */
+
+ void
+fixthisline(get_the_indent)
+ int (*get_the_indent) __ARGS((void));
+{
+ change_indent(INDENT_SET, get_the_indent(), FALSE, 0);
+ if (linewhite(curwin->w_cursor.lnum))
+ did_ai = TRUE; /* delete the indent if the line stays empty */
+}
+
+ void
+fix_indent()
+{
+ if (p_paste)
+ return;
+# ifdef FEAT_LISP
+ if (curbuf->b_p_lisp && curbuf->b_p_ai)
+ fixthisline(get_lisp_indent);
+# endif
+# if defined(FEAT_LISP) && defined(FEAT_CINDENT)
+ else
+# endif
+# ifdef FEAT_CINDENT
+ if (cindent_on())
+ do_c_expr_indent();
+# endif
+}
+
+#endif
+
+#ifdef FEAT_CINDENT
+/*
+ * return TRUE if 'cinkeys' contains the key "keytyped",
+ * when == '*': Only if key is preceded with '*' (indent before insert)
+ * when == '!': Only if key is prededed with '!' (don't insert)
+ * when == ' ': Only if key is not preceded with '*'(indent afterwards)
+ *
+ * "keytyped" can have a few special values:
+ * KEY_OPEN_FORW
+ * KEY_OPEN_BACK
+ * KEY_COMPLETE just finished completion.
+ *
+ * If line_is_empty is TRUE accept keys with '0' before them.
+ */
+ int
+in_cinkeys(keytyped, when, line_is_empty)
+ int keytyped;
+ int when;
+ int line_is_empty;
+{
+ char_u *look;
+ int try_match;
+ int try_match_word;
+ char_u *p;
+ char_u *line;
+ int icase;
+ int i;
+
+#ifdef FEAT_EVAL
+ if (*curbuf->b_p_inde != NUL)
+ look = curbuf->b_p_indk; /* 'indentexpr' set: use 'indentkeys' */
+ else
+#endif
+ look = curbuf->b_p_cink; /* 'indentexpr' empty: use 'cinkeys' */
+ while (*look)
+ {
+ /*
+ * Find out if we want to try a match with this key, depending on
+ * 'when' and a '*' or '!' before the key.
+ */
+ switch (when)
+ {
+ case '*': try_match = (*look == '*'); break;
+ case '!': try_match = (*look == '!'); break;
+ default: try_match = (*look != '*'); break;
+ }
+ if (*look == '*' || *look == '!')
+ ++look;
+
+ /*
+ * If there is a '0', only accept a match if the line is empty.
+ * But may still match when typing last char of a word.
+ */
+ if (*look == '0')
+ {
+ try_match_word = try_match;
+ if (!line_is_empty)
+ try_match = FALSE;
+ ++look;
+ }
+ else
+ try_match_word = FALSE;
+
+ /*
+ * does it look like a control character?
+ */
+ if (*look == '^'
+#ifdef EBCDIC
+ && (Ctrl_chr(look[1]) != 0)
+#else
+ && look[1] >= '?' && look[1] <= '_'
+#endif
+ )
+ {
+ if (try_match && keytyped == Ctrl_chr(look[1]))
+ return TRUE;
+ look += 2;
+ }
+ /*
+ * 'o' means "o" command, open forward.
+ * 'O' means "O" command, open backward.
+ */
+ else if (*look == 'o')
+ {
+ if (try_match && keytyped == KEY_OPEN_FORW)
+ return TRUE;
+ ++look;
+ }
+ else if (*look == 'O')
+ {
+ if (try_match && keytyped == KEY_OPEN_BACK)
+ return TRUE;
+ ++look;
+ }
+
+ /*
+ * 'e' means to check for "else" at start of line and just before the
+ * cursor.
+ */
+ else if (*look == 'e')
+ {
+ if (try_match && keytyped == 'e' && curwin->w_cursor.col >= 4)
+ {
+ p = ml_get_curline();
+ if (skipwhite(p) == p + curwin->w_cursor.col - 4 &&
+ STRNCMP(p + curwin->w_cursor.col - 4, "else", 4) == 0)
+ return TRUE;
+ }
+ ++look;
+ }
+
+ /*
+ * ':' only causes an indent if it is at the end of a label or case
+ * statement, or when it was before typing the ':' (to fix
+ * class::method for C++).
+ */
+ else if (*look == ':')
+ {
+ if (try_match && keytyped == ':')
+ {
+ p = ml_get_curline();
+ if (cin_iscase(p) || cin_isscopedecl(p) || cin_islabel(30))
+ return TRUE;
+ if (curwin->w_cursor.col > 2
+ && p[curwin->w_cursor.col - 1] == ':'
+ && p[curwin->w_cursor.col - 2] == ':')
+ {
+ p[curwin->w_cursor.col - 1] = ' ';
+ i = (cin_iscase(p) || cin_isscopedecl(p)
+ || cin_islabel(30));
+ p = ml_get_curline();
+ p[curwin->w_cursor.col - 1] = ':';
+ if (i)
+ return TRUE;
+ }
+ }
+ ++look;
+ }
+
+
+ /*
+ * Is it a key in <>, maybe?
+ */
+ else if (*look == '<')
+ {
+ if (try_match)
+ {
+ /*
+ * make up some named keys <o>, <O>, <e>, <0>, <>>, <<>, <*>,
+ * <:> and <!> so that people can re-indent on o, O, e, 0, <,
+ * >, *, : and ! keys if they really really want to.
+ */
+ if (vim_strchr((char_u *)"<>!*oOe0:", look[1]) != NULL
+ && keytyped == look[1])
+ return TRUE;
+
+ if (keytyped == get_special_key_code(look + 1))
+ return TRUE;
+ }
+ while (*look && *look != '>')
+ look++;
+ while (*look == '>')
+ look++;
+ }
+
+ /*
+ * Is it a word: "=word"?
+ */
+ else if (*look == '=' && look[1] != ',' && look[1] != NUL)
+ {
+ ++look;
+ if (*look == '~')
+ {
+ icase = TRUE;
+ ++look;
+ }
+ else
+ icase = FALSE;
+ p = vim_strchr(look, ',');
+ if (p == NULL)
+ p = look + STRLEN(look);
+ if ((try_match || try_match_word)
+ && curwin->w_cursor.col >= (colnr_T)(p - look))
+ {
+ int match = FALSE;
+
+#ifdef FEAT_INS_EXPAND
+ if (keytyped == KEY_COMPLETE)
+ {
+ char_u *s;
+
+ /* Just completed a word, check if it starts with "look".
+ * search back for the start of a word. */
+ line = ml_get_curline();
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ char_u *n;
+
+ for (s = line + curwin->w_cursor.col; s > line; s = n)
+ {
+ n = mb_prevptr(line, s);
+ if (!vim_iswordp(n))
+ break;
+ }
+ }
+ else
+# endif
+ for (s = line + curwin->w_cursor.col; s > line; --s)
+ if (!vim_iswordc(s[-1]))
+ break;
+ if (s + (p - look) <= line + curwin->w_cursor.col
+ && (icase
+ ? MB_STRNICMP(s, look, p - look)
+ : STRNCMP(s, look, p - look)) == 0)
+ match = TRUE;
+ }
+ else
+#endif
+ /* TODO: multi-byte */
+ if (keytyped == (int)p[-1] || (icase && keytyped < 256
+ && TOLOWER_LOC(keytyped) == TOLOWER_LOC((int)p[-1])))
+ {
+ line = ml_get_cursor();
+ if ((curwin->w_cursor.col == (colnr_T)(p - look)
+ || !vim_iswordc(line[-(p - look) - 1]))
+ && (icase
+ ? MB_STRNICMP(line - (p - look), look, p - look)
+ : STRNCMP(line - (p - look), look, p - look))
+ == 0)
+ match = TRUE;
+ }
+ if (match && try_match_word && !try_match)
+ {
+ /* "0=word": Check if there are only blanks before the
+ * word. */
+ line = ml_get_curline();
+ if ((int)(skipwhite(line) - line) !=
+ (int)(curwin->w_cursor.col - (p - look)))
+ match = FALSE;
+ }
+ if (match)
+ return TRUE;
+ }
+ look = p;
+ }
+
+ /*
+ * ok, it's a boring generic character.
+ */
+ else
+ {
+ if (try_match && *look == keytyped)
+ return TRUE;
+ ++look;
+ }
+
+ /*
+ * Skip over ", ".
+ */
+ look = skip_to_option_part(look);
+ }
+ return FALSE;
+}
+#endif /* FEAT_CINDENT */
+
+#if defined(FEAT_RIGHTLEFT) || defined(PROTO)
+/*
+ * Map Hebrew keyboard when in hkmap mode.
+ */
+ int
+hkmap(c)
+ int c;
+{
+ if (p_hkmapp) /* phonetic mapping, by Ilya Dogolazky */
+ {
+ enum {hALEF=0, BET, GIMEL, DALET, HEI, VAV, ZAIN, HET, TET, IUD,
+ KAFsofit, hKAF, LAMED, MEMsofit, MEM, NUNsofit, NUN, SAMEH, AIN,
+ PEIsofit, PEI, ZADIsofit, ZADI, KOF, RESH, hSHIN, TAV};
+ static char_u map[26] =
+ {(char_u)hALEF/*a*/, (char_u)BET /*b*/, (char_u)hKAF /*c*/,
+ (char_u)DALET/*d*/, (char_u)-1 /*e*/, (char_u)PEIsofit/*f*/,
+ (char_u)GIMEL/*g*/, (char_u)HEI /*h*/, (char_u)IUD /*i*/,
+ (char_u)HET /*j*/, (char_u)KOF /*k*/, (char_u)LAMED /*l*/,
+ (char_u)MEM /*m*/, (char_u)NUN /*n*/, (char_u)SAMEH /*o*/,
+ (char_u)PEI /*p*/, (char_u)-1 /*q*/, (char_u)RESH /*r*/,
+ (char_u)ZAIN /*s*/, (char_u)TAV /*t*/, (char_u)TET /*u*/,
+ (char_u)VAV /*v*/, (char_u)hSHIN/*w*/, (char_u)-1 /*x*/,
+ (char_u)AIN /*y*/, (char_u)ZADI /*z*/};
+
+ if (c == 'N' || c == 'M' || c == 'P' || c == 'C' || c == 'Z')
+ return (int)(map[CharOrd(c)] - 1 + p_aleph);
+ /* '-1'='sofit' */
+ else if (c == 'x')
+ return 'X';
+ else if (c == 'q')
+ return '\''; /* {geresh}={'} */
+ else if (c == 246)
+ return ' '; /* \"o --> ' ' for a german keyboard */
+ else if (c == 228)
+ return ' '; /* \"a --> ' ' -- / -- */
+ else if (c == 252)
+ return ' '; /* \"u --> ' ' -- / -- */
+#ifdef EBCDIC
+ else if (islower(c))
+#else
+ /* NOTE: islower() does not do the right thing for us on Linux so we
+ * do this the same was as 5.7 and previous, so it works correctly on
+ * all systems. Specifically, the e.g. Delete and Arrow keys are
+ * munged and won't work if e.g. searching for Hebrew text.
+ */
+ else if (c >= 'a' && c <= 'z')
+#endif
+ return (int)(map[CharOrdLow(c)] + p_aleph);
+ else
+ return c;
+ }
+ else
+ {
+ switch (c)
+ {
+ case '`': return ';';
+ case '/': return '.';
+ case '\'': return ',';
+ case 'q': return '/';
+ case 'w': return '\'';
+
+ /* Hebrew letters - set offset from 'a' */
+ case ',': c = '{'; break;
+ case '.': c = 'v'; break;
+ case ';': c = 't'; break;
+ default: {
+ static char str[] = "zqbcxlsjphmkwonu ydafe rig";
+
+#ifdef EBCDIC
+ /* see note about islower() above */
+ if (!islower(c))
+#else
+ if (c < 'a' || c > 'z')
+#endif
+ return c;
+ c = str[CharOrdLow(c)];
+ break;
+ }
+ }
+
+ return (int)(CharOrdLow(c) + p_aleph);
+ }
+}
+#endif
+
+ static void
+ins_reg()
+{
+ int need_redraw = FALSE;
+ int regname;
+ int literally = 0;
+
+ /*
+ * If we are going to wait for a character, show a '"'.
+ */
+ pc_status = PC_STATUS_UNSET;
+ if (redrawing() && !char_avail())
+ {
+ /* may need to redraw when no more chars available now */
+ ins_redraw();
+
+ edit_putchar('"', TRUE);
+#ifdef FEAT_CMDL_INFO
+ add_to_showcmd_c(Ctrl_R);
+#endif
+ }
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+
+ /*
+ * Don't map the register name. This also prevents the mode message to be
+ * deleted when ESC is hit.
+ */
+ ++no_mapping;
+ regname = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(regname, TRUE);
+#endif
+ if (regname == Ctrl_R || regname == Ctrl_O || regname == Ctrl_P)
+ {
+ /* Get a third key for literal register insertion */
+ literally = regname;
+#ifdef FEAT_CMDL_INFO
+ add_to_showcmd_c(literally);
+#endif
+ regname = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(regname, TRUE);
+#endif
+ }
+ --no_mapping;
+
+#ifdef FEAT_EVAL
+ /*
+ * Don't call u_sync() while getting the expression,
+ * evaluating it or giving an error message for it!
+ */
+ ++no_u_sync;
+ if (regname == '=')
+ {
+#ifdef USE_IM_CONTROL
+ int im_on = im_get_status();
+#endif
+ regname = get_expr_register();
+#ifdef USE_IM_CONTROL
+ /* Restore the Input Method. */
+ if (im_on)
+ im_set_active(TRUE);
+#endif
+ }
+ if (regname == NUL)
+ need_redraw = TRUE; /* remove the '"' */
+ else
+ {
+#endif
+ if (literally == Ctrl_O || literally == Ctrl_P)
+ {
+ /* Append the command to the redo buffer. */
+ AppendCharToRedobuff(Ctrl_R);
+ AppendCharToRedobuff(literally);
+ AppendCharToRedobuff(regname);
+
+ do_put(regname, BACKWARD, 1L,
+ (literally == Ctrl_P ? PUT_FIXINDENT : 0) | PUT_CURSEND);
+ }
+ else if (insert_reg(regname, literally) == FAIL)
+ {
+ vim_beep();
+ need_redraw = TRUE; /* remove the '"' */
+ }
+#ifdef FEAT_EVAL
+ }
+ --no_u_sync;
+#endif
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+
+ /* If the inserted register is empty, we need to remove the '"' */
+ if (need_redraw || stuff_empty())
+ edit_unputchar();
+}
+
+/*
+ * CTRL-G commands in Insert mode.
+ */
+ static void
+ins_ctrl_g()
+{
+ int c;
+
+#ifdef FEAT_INS_EXPAND
+ /* Right after CTRL-X the cursor will be after the ruler. */
+ setcursor();
+#endif
+
+ /*
+ * Don't map the second key. This also prevents the mode message to be
+ * deleted when ESC is hit.
+ */
+ ++no_mapping;
+ c = safe_vgetc();
+ --no_mapping;
+ switch (c)
+ {
+ /* CTRL-G k and CTRL-G <Up>: cursor up to Insstart.col */
+ case K_UP:
+ case Ctrl_K:
+ case 'k': ins_up(TRUE);
+ break;
+
+ /* CTRL-G j and CTRL-G <Down>: cursor down to Insstart.col */
+ case K_DOWN:
+ case Ctrl_J:
+ case 'j': ins_down(TRUE);
+ break;
+
+ /* CTRL-G u: start new undoable edit */
+ case 'u': u_sync();
+ ins_need_undo = TRUE;
+ break;
+
+ /* Unknown CTRL-G command, reserved for future expansion. */
+ default: vim_beep();
+ }
+}
+
+/*
+ * Handle ESC in insert mode.
+ * Returns TRUE when leaving insert mode, FALSE when going to repeat the
+ * insert.
+ */
+ static int
+ins_esc(count, cmdchar)
+ long *count;
+ int cmdchar;
+{
+ int temp;
+ static int disabled_redraw = FALSE;
+
+#if defined(FEAT_HANGULIN)
+# if defined(ESC_CHG_TO_ENG_MODE)
+ hangul_input_state_set(0);
+# endif
+ if (composing_hangul)
+ {
+ push_raw_key(composing_hangul_buffer, 2);
+ composing_hangul = 0;
+ }
+#endif
+#if defined(FEAT_MBYTE) && defined(MACOS_CLASSIC)
+ previous_script = GetScriptManagerVariable(smKeyScript);
+ KeyScript(smKeyRoman); /* or smKeySysScript */
+#endif
+
+ temp = curwin->w_cursor.col;
+ if (disabled_redraw)
+ {
+ --RedrawingDisabled;
+ disabled_redraw = FALSE;
+ }
+ if (!arrow_used)
+ {
+ /*
+ * Don't append the ESC for "r<CR>" and "grx".
+ */
+ if (cmdchar != 'r' && cmdchar != 'v')
+ AppendToRedobuff(ESC_STR);
+
+ /*
+ * Repeating insert may take a long time. Check for
+ * interrupt now and then.
+ */
+ if (*count > 0)
+ {
+ line_breakcheck();
+ if (got_int)
+ *count = 0;
+ }
+
+ if (--*count > 0) /* repeat what was typed */
+ {
+ (void)start_redo_ins();
+ if (cmdchar == 'r' || cmdchar == 'v')
+ stuffReadbuff(ESC_STR); /* no ESC in redo buffer */
+ ++RedrawingDisabled;
+ disabled_redraw = TRUE;
+ return FALSE; /* repeat the insert */
+ }
+ stop_insert(&curwin->w_cursor, TRUE);
+ undisplay_dollar();
+ }
+
+ /* When an autoindent was removed, curswant stays after the
+ * indent */
+ if (restart_edit == NUL && (colnr_T)temp == curwin->w_cursor.col)
+ curwin->w_set_curswant = TRUE;
+
+ /* Remember the last Insert position in the '^ mark. */
+ if (!cmdmod.keepjumps)
+ curbuf->b_last_insert = curwin->w_cursor;
+
+ /*
+ * The cursor should end up on the last inserted character.
+ */
+ if ((curwin->w_cursor.col != 0
+#ifdef FEAT_VIRTUALEDIT
+ || curwin->w_cursor.coladd > 0
+#endif
+ ) && (restart_edit == NUL
+ || (gchar_cursor() == NUL
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ ))
+#ifdef FEAT_RIGHTLEFT
+ && !revins_on
+#endif
+ )
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (curwin->w_cursor.coladd > 0 || ve_flags == VE_ALL)
+ {
+ oneleft();
+ if (restart_edit != NUL)
+ ++curwin->w_cursor.coladd;
+ }
+ else
+#endif
+ {
+ --curwin->w_cursor.col;
+#ifdef FEAT_MBYTE
+ /* Correct cursor for multi-byte character. */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+ }
+ }
+
+#ifdef USE_IM_CONTROL
+ /* Disable IM to allow typing English directly for Normal mode commands.
+ * When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as
+ * well). */
+ if (!(State & LANGMAP))
+ im_save_status(&curbuf->b_p_iminsert);
+ im_set_active(FALSE);
+#endif
+
+ State = NORMAL;
+ /* need to position cursor again (e.g. when on a TAB ) */
+ changed_cline_bef_curs();
+
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+
+ /*
+ * When recording or for CTRL-O, need to display the new mode.
+ * Otherwise remove the mode message.
+ */
+ if (Recording || restart_edit != NUL)
+ showmode();
+ else if (p_smd)
+ MSG("");
+
+ return TRUE; /* exit Insert mode */
+}
+
+#ifdef FEAT_RIGHTLEFT
+/*
+ * Toggle language: hkmap and revins_on.
+ * Move to end of reverse inserted text.
+ */
+ static void
+ins_ctrl_()
+{
+ if (revins_on && revins_chars && revins_scol >= 0)
+ {
+ while (gchar_cursor() != NUL && revins_chars--)
+ ++curwin->w_cursor.col;
+ }
+ p_ri = !p_ri;
+ revins_on = (State == INSERT && p_ri);
+ if (revins_on)
+ {
+ revins_scol = curwin->w_cursor.col;
+ revins_legal++;
+ revins_chars = 0;
+ undisplay_dollar();
+ }
+ else
+ revins_scol = -1;
+#ifdef FEAT_FKMAP
+ if (p_altkeymap)
+ {
+ /*
+ * to be consistent also for redo command, using '.'
+ * set arrow_used to true and stop it - causing to redo
+ * characters entered in one mode (normal/reverse insert).
+ */
+ arrow_used = TRUE;
+ (void)stop_arrow();
+ p_fkmap = curwin->w_p_rl ^ p_ri;
+ if (p_fkmap && p_ri)
+ State = INSERT;
+ }
+ else
+#endif
+ p_hkmap = curwin->w_p_rl ^ p_ri; /* be consistent! */
+ showmode();
+}
+#endif
+
+#ifdef FEAT_VISUAL
+/*
+ * If 'keymodel' contains "startsel", may start selection.
+ * Returns TRUE when a CTRL-O and other keys stuffed.
+ */
+ static int
+ins_start_select(c)
+ int c;
+{
+ if (km_startsel)
+ switch (c)
+ {
+ case K_KHOME:
+ case K_XHOME:
+ case K_KEND:
+ case K_XEND:
+ case K_PAGEUP:
+ case K_KPAGEUP:
+ case K_PAGEDOWN:
+ case K_KPAGEDOWN:
+# ifdef MACOS
+ case K_LEFT:
+ case K_RIGHT:
+ case K_UP:
+ case K_DOWN:
+ case K_END:
+ case K_HOME:
+# endif
+ if (!(mod_mask & MOD_MASK_SHIFT))
+ break;
+ /* FALLTHROUGH */
+ case K_S_LEFT:
+ case K_S_RIGHT:
+ case K_S_UP:
+ case K_S_DOWN:
+ case K_S_END:
+ case K_S_HOME:
+ /* Start selection right away, the cursor can move with
+ * CTRL-O when beyond the end of the line. */
+ start_selection();
+
+ /* Execute the key in (insert) Select mode. */
+ stuffcharReadbuff(Ctrl_O);
+ if (mod_mask)
+ {
+ char_u buf[4];
+
+ buf[0] = K_SPECIAL;
+ buf[1] = KS_MODIFIER;
+ buf[2] = mod_mask;
+ buf[3] = NUL;
+ stuffReadbuff(buf);
+ }
+ stuffcharReadbuff(c);
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+
+/*
+ * If the cursor is on an indent, ^T/^D insert/delete one
+ * shiftwidth. Otherwise ^T/^D behave like a "<<" or ">>".
+ * Always round the indent to 'shiftwith', this is compatible
+ * with vi. But vi only supports ^T and ^D after an
+ * autoindent, we support it everywhere.
+ */
+ static void
+ins_shift(c, lastc)
+ int c;
+ int lastc;
+{
+ if (stop_arrow() == FAIL)
+ return;
+ AppendCharToRedobuff(c);
+
+ /*
+ * 0^D and ^^D: remove all indent.
+ */
+ if ((lastc == '0' || lastc == '^') && curwin->w_cursor.col)
+ {
+ --curwin->w_cursor.col;
+ (void)del_char(FALSE); /* delete the '^' or '0' */
+ /* In Replace mode, restore the characters that '^' or '0' replaced. */
+ if (State & REPLACE_FLAG)
+ replace_pop_ins();
+ if (lastc == '^')
+ old_indent = get_indent(); /* remember curr. indent */
+ change_indent(INDENT_SET, 0, TRUE, 0);
+ }
+ else
+ change_indent(c == Ctrl_D ? INDENT_DEC : INDENT_INC, 0, TRUE, 0);
+
+ if (did_ai && *skipwhite(ml_get_curline()) != NUL)
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+#ifdef FEAT_CINDENT
+ can_cindent = FALSE; /* no cindenting after ^D or ^T */
+#endif
+}
+
+ static void
+ins_del()
+{
+ int temp;
+
+ if (stop_arrow() == FAIL)
+ return;
+ if (gchar_cursor() == NUL) /* delete newline */
+ {
+ temp = curwin->w_cursor.col;
+ if (!can_bs(BS_EOL) /* only if "eol" included */
+ || u_save((linenr_T)(curwin->w_cursor.lnum - 1),
+ (linenr_T)(curwin->w_cursor.lnum + 2)) == FAIL
+ || do_join(FALSE) == FAIL)
+ vim_beep();
+ else
+ curwin->w_cursor.col = temp;
+ }
+ else if (del_char(FALSE) == FAIL) /* delete char under cursor */
+ vim_beep();
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+ AppendCharToRedobuff(K_DEL);
+}
+
+/*
+ * Handle Backspace, delete-word and delete-line in Insert mode.
+ * Return TRUE when backspace was actually used.
+ */
+ static int
+ins_bs(c, mode, inserted_space_p)
+ int c;
+ int mode;
+ int *inserted_space_p;
+{
+ linenr_T lnum;
+ int cc;
+ int temp = 0; /* init for GCC */
+ colnr_T mincol;
+ int did_backspace = FALSE;
+ int in_indent;
+ int oldState;
+#ifdef FEAT_MBYTE
+ int p1, p2;
+#endif
+
+ /*
+ * can't delete anything in an empty file
+ * can't backup past first character in buffer
+ * can't backup past starting point unless 'backspace' > 1
+ * can backup to a previous line if 'backspace' == 0
+ */
+ if ( bufempty()
+ || (
+#ifdef FEAT_RIGHTLEFT
+ !revins_on &&
+#endif
+ ((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
+ || (!can_bs(BS_START)
+ && (arrow_used
+ || (curwin->w_cursor.lnum == Insstart.lnum
+ && curwin->w_cursor.col <= Insstart.col)))
+ || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
+ && curwin->w_cursor.col <= ai_col)
+ || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0))))
+ {
+ vim_beep();
+ return FALSE;
+ }
+
+ if (stop_arrow() == FAIL)
+ return FALSE;
+ in_indent = inindent(0);
+#ifdef FEAT_CINDENT
+ if (in_indent)
+ can_cindent = FALSE;
+#endif
+#ifdef FEAT_COMMENTS
+ end_comment_pending = NUL; /* After BS, don't auto-end comment */
+#endif
+#ifdef FEAT_RIGHTLEFT
+ if (revins_on) /* put cursor after last inserted char */
+ inc_cursor();
+#endif
+
+#ifdef FEAT_VIRTUALEDIT
+ /* Virtualedit:
+ * BACKSPACE_CHAR eats a virtual space
+ * BACKSPACE_WORD eats all coladd
+ * BACKSPACE_LINE eats all coladd and keeps going
+ */
+ if (curwin->w_cursor.coladd > 0)
+ {
+ if (mode == BACKSPACE_CHAR)
+ {
+ --curwin->w_cursor.coladd;
+ return TRUE;
+ }
+ if (mode == BACKSPACE_WORD)
+ {
+ curwin->w_cursor.coladd = 0;
+ return TRUE;
+ }
+ curwin->w_cursor.coladd = 0;
+ }
+#endif
+
+ /*
+ * delete newline!
+ */
+ if (curwin->w_cursor.col == 0)
+ {
+ lnum = Insstart.lnum;
+ if (curwin->w_cursor.lnum == Insstart.lnum
+#ifdef FEAT_RIGHTLEFT
+ || revins_on
+#endif
+ )
+ {
+ if (u_save((linenr_T)(curwin->w_cursor.lnum - 2),
+ (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
+ return FALSE;
+ --Insstart.lnum;
+ Insstart.col = MAXCOL;
+ }
+ /*
+ * In replace mode:
+ * cc < 0: NL was inserted, delete it
+ * cc >= 0: NL was replaced, put original characters back
+ */
+ cc = -1;
+ if (State & REPLACE_FLAG)
+ cc = replace_pop(); /* returns -1 if NL was inserted */
+ /*
+ * In replace mode, in the line we started replacing, we only move the
+ * cursor.
+ */
+ if ((State & REPLACE_FLAG) && curwin->w_cursor.lnum <= lnum)
+ {
+ dec_cursor();
+ }
+ else
+ {
+#ifdef FEAT_VREPLACE
+ if (!(State & VREPLACE_FLAG)
+ || curwin->w_cursor.lnum > orig_line_count)
+#endif
+ {
+ temp = gchar_cursor(); /* remember current char */
+ --curwin->w_cursor.lnum;
+ (void)do_join(FALSE);
+ if (temp == NUL && gchar_cursor() != NUL)
+ inc_cursor();
+ }
+#ifdef FEAT_VREPLACE
+ else
+ dec_cursor();
+#endif
+
+ /*
+ * In REPLACE mode we have to put back the text that was replaced
+ * by the NL. On the replace stack is first a NUL-terminated
+ * sequence of characters that were deleted and then the
+ * characters that NL replaced.
+ */
+ if (State & REPLACE_FLAG)
+ {
+ /*
+ * Do the next ins_char() in NORMAL state, to
+ * prevent ins_char() from replacing characters and
+ * avoiding showmatch().
+ */
+ oldState = State;
+ State = NORMAL;
+ /*
+ * restore characters (blanks) deleted after cursor
+ */
+ while (cc > 0)
+ {
+ temp = curwin->w_cursor.col;
+#ifdef FEAT_MBYTE
+ mb_replace_pop_ins(cc);
+#else
+ ins_char(cc);
+#endif
+ curwin->w_cursor.col = temp;
+ cc = replace_pop();
+ }
+ /* restore the characters that NL replaced */
+ replace_pop_ins();
+ State = oldState;
+ }
+ }
+ did_ai = FALSE;
+ }
+ else
+ {
+ /*
+ * Delete character(s) before the cursor.
+ */
+#ifdef FEAT_RIGHTLEFT
+ if (revins_on) /* put cursor on last inserted char */
+ dec_cursor();
+#endif
+ mincol = 0;
+ /* keep indent */
+ if (mode == BACKSPACE_LINE && curbuf->b_p_ai
+#ifdef FEAT_RIGHTLEFT
+ && !revins_on
+#endif
+ )
+ {
+ temp = curwin->w_cursor.col;
+ beginline(BL_WHITE);
+ if (curwin->w_cursor.col < (colnr_T)temp)
+ mincol = curwin->w_cursor.col;
+ curwin->w_cursor.col = temp;
+ }
+
+ /*
+ * Handle deleting one 'shiftwidth' or 'softtabstop'.
+ */
+ if ( mode == BACKSPACE_CHAR
+ && ((p_sta && in_indent)
+ || (curbuf->b_p_sts
+ && (*(ml_get_cursor() - 1) == TAB
+ || (*(ml_get_cursor() - 1) == ' '
+ && (!*inserted_space_p
+ || arrow_used))))))
+ {
+ int ts;
+ colnr_T vcol;
+ colnr_T want_vcol;
+ int extra = 0;
+
+ *inserted_space_p = FALSE;
+ if (p_sta)
+ ts = curbuf->b_p_sw;
+ else
+ ts = curbuf->b_p_sts;
+ /* Compute the virtual column where we want to be. Since
+ * 'showbreak' may get in the way, need to get the last column of
+ * the previous character. */
+ getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
+ dec_cursor();
+ getvcol(curwin, &curwin->w_cursor, NULL, NULL, &want_vcol);
+ inc_cursor();
+ want_vcol = (want_vcol / ts) * ts;
+
+ /* delete characters until we are at or before want_vcol */
+ while (vcol > want_vcol
+ && (cc = *(ml_get_cursor() - 1), vim_iswhite(cc)))
+ {
+ dec_cursor();
+ getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
+ if (State & REPLACE_FLAG)
+ {
+ /* Don't delete characters before the insert point when in
+ * Replace mode */
+ if (curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col >= Insstart.col)
+ {
+#if 0 /* what was this for? It causes problems when sw != ts. */
+ if (State == REPLACE && (int)vcol < want_vcol)
+ {
+ (void)del_char(FALSE);
+ extra = 2; /* don't pop too much */
+ }
+ else
+#endif
+ replace_do_bs();
+ }
+ }
+ else
+ (void)del_char(FALSE);
+ }
+
+ /* insert extra spaces until we are at want_vcol */
+ while (vcol < want_vcol)
+ {
+ /* Remember the first char we inserted */
+ if (curwin->w_cursor.lnum == Insstart.lnum
+ && curwin->w_cursor.col < Insstart.col)
+ Insstart.col = curwin->w_cursor.col;
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ ins_char(' ');
+ else
+#endif
+ {
+ ins_str((char_u *)" ");
+ if ((State & REPLACE_FLAG) && extra <= 1)
+ {
+ if (extra)
+ replace_push_off(NUL);
+ else
+ replace_push(NUL);
+ }
+ if (extra == 2)
+ extra = 1;
+ }
+ getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
+ }
+ }
+
+ /*
+ * Delete upto starting point, start of line or previous word.
+ */
+ else do
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (!revins_on) /* put cursor on char to be deleted */
+#endif
+ dec_cursor();
+
+ /* start of word? */
+ if (mode == BACKSPACE_WORD && !vim_isspace(gchar_cursor()))
+ {
+ mode = BACKSPACE_WORD_NOT_SPACE;
+ temp = vim_iswordc(gchar_cursor());
+ }
+ /* end of word? */
+ else if (mode == BACKSPACE_WORD_NOT_SPACE
+ && (vim_isspace(cc = gchar_cursor())
+ || vim_iswordc(cc) != temp))
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (!revins_on)
+#endif
+ inc_cursor();
+#ifdef FEAT_RIGHTLEFT
+ else if (State & REPLACE_FLAG)
+ dec_cursor();
+#endif
+ break;
+ }
+ if (State & REPLACE_FLAG)
+ replace_do_bs();
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && p_deco)
+ (void)utfc_ptr2char(ml_get_cursor(), &p1, &p2);
+#endif
+ (void)del_char(FALSE);
+#ifdef FEAT_MBYTE
+ /*
+ * If p1 or p2 is non-zero, there are combining characters we
+ * need to take account of. Don't back up before the base
+ * character.
+ */
+ if (enc_utf8 && p_deco && (p1 != NUL || p2 != NUL))
+ inc_cursor();
+#endif
+#ifdef FEAT_RIGHTLEFT
+ if (revins_chars)
+ {
+ revins_chars--;
+ revins_legal++;
+ }
+ if (revins_on && gchar_cursor() == NUL)
+ break;
+#endif
+ }
+ /* Just a single backspace?: */
+ if (mode == BACKSPACE_CHAR)
+ break;
+ } while (
+#ifdef FEAT_RIGHTLEFT
+ revins_on ||
+#endif
+ (curwin->w_cursor.col > mincol
+ && (curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col != Insstart.col)));
+ did_backspace = TRUE;
+ }
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+ if (curwin->w_cursor.col <= 1)
+ did_ai = FALSE;
+ /*
+ * It's a little strange to put backspaces into the redo
+ * buffer, but it makes auto-indent a lot easier to deal
+ * with.
+ */
+ AppendCharToRedobuff(c);
+
+ /* If deleted before the insertion point, adjust it */
+ if (curwin->w_cursor.lnum == Insstart.lnum
+ && curwin->w_cursor.col < Insstart.col)
+ Insstart.col = curwin->w_cursor.col;
+
+ /* vi behaviour: the cursor moves backward but the character that
+ * was there remains visible
+ * Vim behaviour: the cursor moves backward and the character that
+ * was there is erased from the screen.
+ * We can emulate the vi behaviour by pretending there is a dollar
+ * displayed even when there isn't.
+ * --pkv Sun Jan 19 01:56:40 EST 2003 */
+ if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == 0)
+ dollar_vcol = curwin->w_virtcol;
+
+ return did_backspace;
+}
+
+#ifdef FEAT_MOUSE
+ static void
+ins_mouse(c)
+ int c;
+{
+ pos_T tpos;
+
+# ifdef FEAT_GUI
+ /* When GUI is active, also move/paste when 'mouse' is empty */
+ if (!gui.in_use)
+# endif
+ if (!mouse_has(MOUSE_INSERT))
+ return;
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (do_mouse(NULL, c, BACKWARD, 1L, 0))
+ {
+ start_arrow(&tpos);
+# ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+# endif
+ }
+
+#ifdef FEAT_WINDOWS
+ /* redraw status lines (in case another window became active) */
+ redraw_statuslines();
+#endif
+}
+
+ static void
+ins_mousescroll(up)
+ int up;
+{
+ pos_T tpos;
+# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+ win_T *old_curwin;
+# endif
+
+ tpos = curwin->w_cursor;
+
+# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+ old_curwin = curwin;
+
+ /* Currently the mouse coordinates are only known in the GUI. */
+ if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
+ {
+ int row, col;
+
+ row = mouse_row;
+ col = mouse_col;
+
+ /* find the window at the pointer coordinates */
+ curwin = mouse_find_win(&row, &col);
+ curbuf = curwin->w_buffer;
+ }
+ if (curwin == old_curwin)
+# endif
+ undisplay_dollar();
+
+ if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
+ scroll_redraw(up, (long)(curwin->w_botline - curwin->w_topline));
+ else
+ scroll_redraw(up, 3L);
+
+# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+ curwin->w_redr_status = TRUE;
+
+ curwin = old_curwin;
+ curbuf = curwin->w_buffer;
+# endif
+
+ if (!equalpos(curwin->w_cursor, tpos))
+ {
+ start_arrow(&tpos);
+# ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+# endif
+ }
+}
+#endif
+
+#ifdef FEAT_GUI
+ void
+ins_scroll()
+{
+ pos_T tpos;
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (gui_do_scroll())
+ {
+ start_arrow(&tpos);
+# ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+# endif
+ }
+}
+
+ void
+ins_horscroll()
+{
+ pos_T tpos;
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (gui_do_horiz_scroll())
+ {
+ start_arrow(&tpos);
+# ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+# endif
+ }
+}
+#endif
+
+ static void
+ins_left()
+{
+ pos_T tpos;
+
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (oneleft() == OK)
+ {
+ start_arrow(&tpos);
+#ifdef FEAT_RIGHTLEFT
+ /* If exit reversed string, position is fixed */
+ if (revins_scol != -1 && (int)curwin->w_cursor.col >= revins_scol)
+ revins_legal++;
+ revins_chars++;
+#endif
+ }
+
+ /*
+ * if 'whichwrap' set for cursor in insert mode may go to
+ * previous line
+ */
+ else if (vim_strchr(p_ww, '[') != NULL && curwin->w_cursor.lnum > 1)
+ {
+ start_arrow(&tpos);
+ --(curwin->w_cursor.lnum);
+ coladvance((colnr_T)MAXCOL);
+ curwin->w_set_curswant = TRUE; /* so we stay at the end */
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_home(c)
+ int c;
+{
+ pos_T tpos;
+
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (c == K_C_HOME)
+ curwin->w_cursor.lnum = 1;
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_curswant = 0;
+ start_arrow(&tpos);
+}
+
+ static void
+ins_end(c)
+ int c;
+{
+ pos_T tpos;
+
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (c == K_C_END)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ coladvance((colnr_T)MAXCOL);
+ curwin->w_curswant = MAXCOL;
+
+ start_arrow(&tpos);
+}
+
+ static void
+ins_s_left()
+{
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ if (curwin->w_cursor.lnum > 1 || curwin->w_cursor.col > 0)
+ {
+ start_arrow(&curwin->w_cursor);
+ (void)bck_word(1L, FALSE, FALSE);
+ curwin->w_set_curswant = TRUE;
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_right()
+{
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ if (gchar_cursor() != NUL || virtual_active()
+ )
+ {
+ start_arrow(&curwin->w_cursor);
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ oneright();
+ else
+#endif
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ curwin->w_cursor.col += (*mb_ptr2len_check)(ml_get_cursor());
+ else
+#endif
+ ++curwin->w_cursor.col;
+ }
+
+#ifdef FEAT_RIGHTLEFT
+ revins_legal++;
+ if (revins_chars)
+ revins_chars--;
+#endif
+ }
+ /* if 'whichwrap' set for cursor in insert mode, may move the
+ * cursor to the next line */
+ else if (vim_strchr(p_ww, ']') != NULL
+ && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+ start_arrow(&curwin->w_cursor);
+ curwin->w_set_curswant = TRUE;
+ ++curwin->w_cursor.lnum;
+ curwin->w_cursor.col = 0;
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_s_right()
+{
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped)
+ foldOpenCursor();
+#endif
+ undisplay_dollar();
+ if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count
+ || gchar_cursor() != NUL)
+ {
+ start_arrow(&curwin->w_cursor);
+ (void)fwd_word(1L, FALSE, 0);
+ curwin->w_set_curswant = TRUE;
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_up(startcol)
+ int startcol; /* when TRUE move to Insstart.col */
+{
+ pos_T tpos;
+ linenr_T old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ int old_topfill = curwin->w_topfill;
+#endif
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (cursor_up(1L, TRUE) == OK)
+ {
+ if (startcol)
+ coladvance(getvcol_nolist(&Insstart));
+ if (old_topline != curwin->w_topline
+#ifdef FEAT_DIFF
+ || old_topfill != curwin->w_topfill
+#endif
+ )
+ redraw_later(VALID);
+ start_arrow(&tpos);
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_pageup()
+{
+ pos_T tpos;
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (onepage(BACKWARD, 1L) == OK)
+ {
+ start_arrow(&tpos);
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_down(startcol)
+ int startcol; /* when TRUE move to Insstart.col */
+{
+ pos_T tpos;
+ linenr_T old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ int old_topfill = curwin->w_topfill;
+#endif
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (cursor_down(1L, TRUE) == OK)
+ {
+ if (startcol)
+ coladvance(getvcol_nolist(&Insstart));
+ if (old_topline != curwin->w_topline
+#ifdef FEAT_DIFF
+ || old_topfill != curwin->w_topfill
+#endif
+ )
+ redraw_later(VALID);
+ start_arrow(&tpos);
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+ }
+ else
+ vim_beep();
+}
+
+ static void
+ins_pagedown()
+{
+ pos_T tpos;
+
+ undisplay_dollar();
+ tpos = curwin->w_cursor;
+ if (onepage(FORWARD, 1L) == OK)
+ {
+ start_arrow(&tpos);
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+ }
+ else
+ vim_beep();
+}
+
+#ifdef FEAT_DND
+ static void
+ins_drop()
+{
+ do_put('~', BACKWARD, 1L, PUT_CURSEND);
+}
+#endif
+
+/*
+ * Handle TAB in Insert or Replace mode.
+ * Return TRUE when the TAB needs to be inserted like a normal character.
+ */
+ static int
+ins_tab()
+{
+ int ind;
+ int i;
+ int temp;
+
+ if (Insstart_blank_vcol == MAXCOL && curwin->w_cursor.lnum == Insstart.lnum)
+ Insstart_blank_vcol = get_nolist_virtcol();
+ if (echeck_abbr(TAB + ABBR_OFF))
+ return FALSE;
+
+ ind = inindent(0);
+#ifdef FEAT_CINDENT
+ if (ind)
+ can_cindent = FALSE;
+#endif
+
+ /*
+ * When nothing special, insert TAB like a normal character
+ */
+ if (!curbuf->b_p_et
+ && !(p_sta && ind && curbuf->b_p_ts != curbuf->b_p_sw)
+ && curbuf->b_p_sts == 0)
+ return TRUE;
+
+ if (stop_arrow() == FAIL)
+ return TRUE;
+
+ did_ai = FALSE;
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+ can_si = FALSE;
+ can_si_back = FALSE;
+#endif
+ AppendToRedobuff((char_u *)"\t");
+
+ if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */
+ temp = (int)curbuf->b_p_sw;
+ else if (curbuf->b_p_sts > 0) /* use 'softtabstop' when set */
+ temp = (int)curbuf->b_p_sts;
+ else /* otherwise use 'tabstop' */
+ temp = (int)curbuf->b_p_ts;
+ temp -= get_nolist_virtcol() % temp;
+
+ /*
+ * Insert the first space with ins_char(). It will delete one char in
+ * replace mode. Insert the rest with ins_str(); it will not delete any
+ * chars. For VREPLACE mode, we use ins_char() for all characters.
+ */
+ ins_char(' ');
+ while (--temp > 0)
+ {
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ ins_char(' ');
+ else
+#endif
+ {
+ ins_str((char_u *)" ");
+ if (State & REPLACE_FLAG) /* no char replaced */
+ replace_push(NUL);
+ }
+ }
+
+ /*
+ * When 'expandtab' not set: Replace spaces by TABs where possible.
+ */
+ if (!curbuf->b_p_et && (curbuf->b_p_sts || (p_sta && ind)))
+ {
+ char_u *ptr;
+#ifdef FEAT_VREPLACE
+ char_u *saved_line = NULL; /* init for GCC */
+ pos_T pos;
+#endif
+ pos_T fpos;
+ pos_T *cursor;
+ colnr_T want_vcol, vcol;
+ int change_col = -1;
+ int save_list = curwin->w_p_list;
+
+ /*
+ * Get the current line. For VREPLACE mode, don't make real changes
+ * yet, just work on a copy of the line.
+ */
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ pos = curwin->w_cursor;
+ cursor = &pos;
+ saved_line = vim_strsave(ml_get_curline());
+ if (saved_line == NULL)
+ return FALSE;
+ ptr = saved_line + pos.col;
+ }
+ else
+#endif
+ {
+ ptr = ml_get_cursor();
+ cursor = &curwin->w_cursor;
+ }
+
+ /* When 'L' is not in 'cpoptions' a tab always takes up 'ts' spaces. */
+ if (vim_strchr(p_cpo, CPO_LISTWM) == NULL)
+ curwin->w_p_list = FALSE;
+
+ /* Find first white before the cursor */
+ fpos = curwin->w_cursor;
+ while (fpos.col > 0 && vim_iswhite(ptr[-1]))
+ {
+ --fpos.col;
+ --ptr;
+ }
+
+ /* In Replace mode, don't change characters before the insert point. */
+ if ((State & REPLACE_FLAG)
+ && fpos.lnum == Insstart.lnum
+ && fpos.col < Insstart.col)
+ {
+ ptr += Insstart.col - fpos.col;
+ fpos.col = Insstart.col;
+ }
+
+ /* compute virtual column numbers of first white and cursor */
+ getvcol(curwin, &fpos, &vcol, NULL, NULL);
+ getvcol(curwin, cursor, &want_vcol, NULL, NULL);
+
+ /* Use as many TABs as possible. Beware of 'showbreak' and
+ * 'linebreak' adding extra virtual columns. */
+ while (vim_iswhite(*ptr))
+ {
+ i = lbr_chartabsize((char_u *)"\t", vcol);
+ if (vcol + i > want_vcol)
+ break;
+ if (*ptr != TAB)
+ {
+ *ptr = TAB;
+ if (change_col < 0)
+ {
+ change_col = fpos.col; /* Column of first change */
+ /* May have to adjust Insstart */
+ if (fpos.lnum == Insstart.lnum && fpos.col < Insstart.col)
+ Insstart.col = fpos.col;
+ }
+ }
+ ++fpos.col;
+ ++ptr;
+ vcol += i;
+ }
+
+ if (change_col >= 0)
+ {
+ int repl_off = 0;
+
+ /* Skip over the spaces we need. */
+ while (vcol < want_vcol && *ptr == ' ')
+ {
+ vcol += lbr_chartabsize(ptr, vcol);
+ ++ptr;
+ ++repl_off;
+ }
+ if (vcol > want_vcol)
+ {
+ /* Must have a char with 'showbreak' just before it. */
+ --ptr;
+ --repl_off;
+ }
+ fpos.col += repl_off;
+
+ /* Delete following spaces. */
+ i = cursor->col - fpos.col;
+ if (i > 0)
+ {
+ mch_memmove(ptr, ptr + i, STRLEN(ptr + i) + 1);
+ /* correct replace stack. */
+ if ((State & REPLACE_FLAG)
+#ifdef FEAT_VREPLACE
+ && !(State & VREPLACE_FLAG)
+#endif
+ )
+ for (temp = i; --temp >= 0; )
+ replace_join(repl_off);
+ }
+ cursor->col -= i;
+
+#ifdef FEAT_VREPLACE
+ /*
+ * In VREPLACE mode, we haven't changed anything yet. Do it now by
+ * backspacing over the changed spacing and then inserting the new
+ * spacing.
+ */
+ if (State & VREPLACE_FLAG)
+ {
+ /* Backspace from real cursor to change_col */
+ backspace_until_column(change_col);
+
+ /* Insert each char in saved_line from changed_col to
+ * ptr-cursor */
+ ins_bytes_len(saved_line + change_col,
+ cursor->col - change_col);
+ }
+#endif
+ }
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ vim_free(saved_line);
+#endif
+ curwin->w_p_list = save_list;
+ }
+
+ return FALSE;
+}
+
+/*
+ * Handle CR or NL in insert mode.
+ * Return TRUE when out of memory or can't undo.
+ */
+ static int
+ins_eol(c)
+ int c;
+{
+ int i;
+
+ if (echeck_abbr(c + ABBR_OFF))
+ return FALSE;
+ if (stop_arrow() == FAIL)
+ return TRUE;
+ undisplay_dollar();
+
+ /*
+ * Strange Vi behaviour: In Replace mode, typing a NL will not delete the
+ * character under the cursor. Only push a NUL on the replace stack,
+ * nothing to put back when the NL is deleted.
+ */
+ if ((State & REPLACE_FLAG)
+#ifdef FEAT_VREPLACE
+ && !(State & VREPLACE_FLAG)
+#endif
+ )
+ replace_push(NUL);
+
+ /*
+ * In VREPLACE mode, a NL replaces the rest of the line, and starts
+ * replacing the next line, so we push all of the characters left on the
+ * line onto the replace stack. This is not done here though, it is done
+ * in open_line().
+ */
+
+#ifdef FEAT_RIGHTLEFT
+# ifdef FEAT_FKMAP
+ if (p_altkeymap && p_fkmap)
+ fkmap(NL);
+# endif
+ /* NL in reverse insert will always start in the end of
+ * current line. */
+ if (revins_on)
+ curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor());
+#endif
+
+ AppendToRedobuff(NL_STR);
+ i = open_line(FORWARD,
+#ifdef FEAT_COMMENTS
+ has_format_option(FO_RET_COMS) ? OPENLINE_DO_COM :
+#endif
+ 0, old_indent);
+ old_indent = 0;
+#ifdef FEAT_CINDENT
+ can_cindent = TRUE;
+#endif
+
+ return (!i);
+}
+
+#ifdef FEAT_DIGRAPHS
+/*
+ * Handle digraph in insert mode.
+ * Returns character still to be inserted, or NUL when nothing remaining to be
+ * done.
+ */
+ static int
+ins_digraph()
+{
+ int c;
+ int cc;
+
+ pc_status = PC_STATUS_UNSET;
+ if (redrawing() && !char_avail())
+ {
+ /* may need to redraw when no more chars available now */
+ ins_redraw();
+
+ edit_putchar('?', TRUE);
+#ifdef FEAT_CMDL_INFO
+ add_to_showcmd_c(Ctrl_K);
+#endif
+ }
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+
+ /* don't map the digraph chars. This also prevents the
+ * mode message to be deleted when ESC is hit */
+ ++no_mapping;
+ ++allow_keys;
+ c = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (IS_SPECIAL(c) || mod_mask) /* special key */
+ {
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+ insert_special(c, TRUE, FALSE);
+ return NUL;
+ }
+ if (c != ESC)
+ {
+ if (redrawing() && !char_avail())
+ {
+ /* may need to redraw when no more chars available now */
+ ins_redraw();
+
+ if (char2cells(c) == 1)
+ {
+ /* first remove the '?', otherwise it's restored when typing
+ * an ESC next */
+ edit_unputchar();
+ ins_redraw();
+ edit_putchar(c, TRUE);
+ }
+#ifdef FEAT_CMDL_INFO
+ add_to_showcmd_c(c);
+#endif
+ }
+ ++no_mapping;
+ ++allow_keys;
+ cc = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ if (cc != ESC)
+ {
+ AppendToRedobuff((char_u *)CTRL_V_STR);
+ c = getdigraph(c, cc, TRUE);
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+ return c;
+ }
+ }
+ edit_unputchar();
+#ifdef FEAT_CMDL_INFO
+ clear_showcmd();
+#endif
+ return NUL;
+}
+#endif
+
+/*
+ * Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line.
+ * Returns the char to be inserted, or NUL if none found.
+ */
+ static int
+ins_copychar(lnum)
+ linenr_T lnum;
+{
+ int c;
+ int temp;
+ char_u *ptr, *prev_ptr;
+
+ if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count)
+ {
+ vim_beep();
+ return NUL;
+ }
+
+ /* try to advance to the cursor column */
+ temp = 0;
+ ptr = ml_get(lnum);
+ prev_ptr = ptr;
+ validate_virtcol();
+ while ((colnr_T)temp < curwin->w_virtcol && *ptr != NUL)
+ {
+ prev_ptr = ptr;
+ temp += lbr_chartabsize_adv(&ptr, (colnr_T)temp);
+ }
+ if ((colnr_T)temp > curwin->w_virtcol)
+ ptr = prev_ptr;
+
+#ifdef FEAT_MBYTE
+ c = (*mb_ptr2char)(ptr);
+#else
+ c = *ptr;
+#endif
+ if (c == NUL)
+ vim_beep();
+ return c;
+}
+
+#ifdef FEAT_SMARTINDENT
+/*
+ * Try to do some very smart auto-indenting.
+ * Used when inserting a "normal" character.
+ */
+ static void
+ins_try_si(c)
+ int c;
+{
+ pos_T *pos, old_pos;
+ char_u *ptr;
+ int i;
+ int temp;
+
+ /*
+ * do some very smart indenting when entering '{' or '}'
+ */
+ if (((did_si || can_si_back) && c == '{') || (can_si && c == '}'))
+ {
+ /*
+ * for '}' set indent equal to indent of line containing matching '{'
+ */
+ if (c == '}' && (pos = findmatch(NULL, '{')) != NULL)
+ {
+ old_pos = curwin->w_cursor;
+ /*
+ * If the matching '{' has a ')' immediately before it (ignoring
+ * white-space), then line up with the start of the line
+ * containing the matching '(' if there is one. This handles the
+ * case where an "if (..\n..) {" statement continues over multiple
+ * lines -- webb
+ */
+ ptr = ml_get(pos->lnum);
+ i = pos->col;
+ if (i > 0) /* skip blanks before '{' */
+ while (--i > 0 && vim_iswhite(ptr[i]))
+ ;
+ curwin->w_cursor.lnum = pos->lnum;
+ curwin->w_cursor.col = i;
+ if (ptr[i] == ')' && (pos = findmatch(NULL, '(')) != NULL)
+ curwin->w_cursor = *pos;
+ i = get_indent();
+ curwin->w_cursor = old_pos;
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ change_indent(INDENT_SET, i, FALSE, NUL);
+ else
+#endif
+ (void)set_indent(i, SIN_CHANGED);
+ }
+ else if (curwin->w_cursor.col > 0)
+ {
+ /*
+ * when inserting '{' after "O" reduce indent, but not
+ * more than indent of previous line
+ */
+ temp = TRUE;
+ if (c == '{' && can_si_back && curwin->w_cursor.lnum > 1)
+ {
+ old_pos = curwin->w_cursor;
+ i = get_indent();
+ while (curwin->w_cursor.lnum > 1)
+ {
+ ptr = skipwhite(ml_get(--(curwin->w_cursor.lnum)));
+
+ /* ignore empty lines and lines starting with '#'. */
+ if (*ptr != '#' && *ptr != NUL)
+ break;
+ }
+ if (get_indent() >= i)
+ temp = FALSE;
+ curwin->w_cursor = old_pos;
+ }
+ if (temp)
+ shift_line(TRUE, FALSE, 1);
+ }
+ }
+
+ /*
+ * set indent of '#' always to 0
+ */
+ if (curwin->w_cursor.col > 0 && can_si && c == '#')
+ {
+ /* remember current indent for next line */
+ old_indent = get_indent();
+ (void)set_indent(0, SIN_CHANGED);
+ }
+
+ /* Adjust ai_col, the char at this position can be deleted. */
+ if (ai_col > curwin->w_cursor.col)
+ ai_col = curwin->w_cursor.col;
+}
+#endif
+
+/*
+ * Get the value that w_virtcol would have when 'list' is off.
+ * Unless 'cpo' contains the 'L' flag.
+ */
+ static colnr_T
+get_nolist_virtcol()
+{
+ if (curwin->w_p_list && vim_strchr(p_cpo, CPO_LISTWM) == NULL)
+ return getvcol_nolist(&curwin->w_cursor);
+ validate_virtcol();
+ return curwin->w_virtcol;
+}
diff --git a/src/eval.c b/src/eval.c
new file mode 100644
index 000000000..2e339e6d0
--- /dev/null
+++ b/src/eval.c
@@ -0,0 +1,10682 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * eval.c: Expression evaluation.
+ */
+#if defined(MSDOS) || defined(MSWIN)
+# include <io.h> /* for mch_open(), must be before vim.h */
+#endif
+
+#include "vim.h"
+
+#ifdef AMIGA
+# include <time.h> /* for strftime() */
+#endif
+
+#ifdef MACOS
+# include <time.h> /* for time_t */
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+#if SIZEOF_INT <= 3 /* use long if int is smaller than 32 bits */
+typedef long varnumber_T;
+#else
+typedef int varnumber_T;
+#endif
+
+/*
+ * Structure to hold an internal variable.
+ */
+typedef struct
+{
+ char_u *var_name; /* name of variable */
+ char var_type; /* VAR_NUMBER or VAR_STRING */
+ union
+ {
+ varnumber_T var_number; /* number value */
+ char_u *var_string; /* string value (Careful: can be NULL!) */
+ } var_val;
+} var;
+
+#define VAR_UNKNOWN 0
+#define VAR_NUMBER 1
+#define VAR_STRING 2
+
+typedef var * VAR;
+
+/*
+ * All user-defined global variables are stored in "variables".
+ */
+garray_T variables = {0, 0, sizeof(var), 4, NULL};
+
+/*
+ * Array to hold an array with variables local to each sourced script.
+ */
+static garray_T ga_scripts = {0, 0, sizeof(garray_T), 4, NULL};
+#define SCRIPT_VARS(id) (((garray_T *)ga_scripts.ga_data)[(id) - 1])
+
+
+#define VAR_ENTRY(idx) (((VAR)(variables.ga_data))[idx])
+#define VAR_GAP_ENTRY(idx, gap) (((VAR)(gap->ga_data))[idx])
+#define BVAR_ENTRY(idx) (((VAR)(curbuf->b_vars.ga_data))[idx])
+#define WVAR_ENTRY(idx) (((VAR)(curwin->w_vars.ga_data))[idx])
+
+static int echo_attr = 0; /* attributes used for ":echo" */
+
+/*
+ * Structure to hold info for a user function.
+ */
+typedef struct ufunc ufunc_T;
+
+struct ufunc
+{
+ ufunc_T *next; /* next function in list */
+ char_u *name; /* name of function; can start with <SNR>123_
+ (<SNR> is K_SPECIAL KS_EXTRA KE_SNR) */
+ int varargs; /* variable nr of arguments */
+ int flags;
+ int calls; /* nr of active calls */
+ garray_T args; /* arguments */
+ garray_T lines; /* function lines */
+ scid_T script_ID; /* ID of script where function was defined,
+ used for s: variables */
+};
+
+/* function flags */
+#define FC_ABORT 1 /* abort function on error */
+#define FC_RANGE 2 /* function accepts range */
+
+/*
+ * All user-defined functions are found in the forward-linked function list.
+ * The first function is pointed at by firstfunc.
+ */
+ufunc_T *firstfunc = NULL;
+
+#define FUNCARG(fp, j) ((char_u **)(fp->args.ga_data))[j]
+#define FUNCLINE(fp, j) ((char_u **)(fp->lines.ga_data))[j]
+
+/* structure to hold info for a function that is currently being executed. */
+struct funccall
+{
+ ufunc_T *func; /* function being called */
+ int linenr; /* next line to be executed */
+ int returned; /* ":return" used */
+ int argcount; /* nr of arguments */
+ VAR argvars; /* arguments */
+ var a0_var; /* "a:0" variable */
+ var firstline; /* "a:firstline" variable */
+ var lastline; /* "a:lastline" variable */
+ garray_T l_vars; /* local function variables */
+ VAR retvar; /* return value variable */
+ linenr_T breakpoint; /* next line with breakpoint or zero */
+ int dbg_tick; /* debug_tick when breakpoint was set */
+ int level; /* top nesting level of executed function */
+};
+
+/*
+ * Return the name of the executed function.
+ */
+ char_u *
+func_name(cookie)
+ void *cookie;
+{
+ return ((struct funccall *)cookie)->func->name;
+}
+
+/*
+ * Return the address holding the next breakpoint line for a funccall cookie.
+ */
+ linenr_T *
+func_breakpoint(cookie)
+ void *cookie;
+{
+ return &((struct funccall *)cookie)->breakpoint;
+}
+
+/*
+ * Return the address holding the debug tick for a funccall cookie.
+ */
+ int *
+func_dbg_tick(cookie)
+ void *cookie;
+{
+ return &((struct funccall *)cookie)->dbg_tick;
+}
+
+/*
+ * Return the nesting level for a funccall cookie.
+ */
+ int
+func_level(cookie)
+ void *cookie;
+{
+ return ((struct funccall *)cookie)->level;
+}
+
+/* pointer to funccal for currently active function */
+struct funccall *current_funccal = NULL;
+
+/*
+ * Return TRUE when a function was ended by a ":return" command.
+ */
+ int
+current_func_returned()
+{
+ return current_funccal->returned;
+}
+
+
+/*
+ * Array to hold the value of v: variables.
+ */
+#include "version.h"
+
+/* values for flags: */
+#define VV_COMPAT 1 /* compatible, also used without "v:" */
+#define VV_RO 2 /* read-only */
+
+struct vimvar
+{
+ char *name; /* name of variable, without v: */
+ int len; /* length of name */
+ char_u *val; /* current value (can also be a number!) */
+ char type; /* VAR_NUMBER or VAR_STRING */
+ char flags; /* VV_COMPAT and VV_RO */
+} vimvars[VV_LEN] =
+{ /* The order here must match the VV_ defines in vim.h! */
+ {"count", sizeof("count") - 1, NULL, VAR_NUMBER, VV_COMPAT+VV_RO},
+ {"count1", sizeof("count1") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"prevcount", sizeof("prevcount") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"errmsg", sizeof("errmsg") - 1, NULL, VAR_STRING, VV_COMPAT},
+ {"warningmsg", sizeof("warningmsg") - 1, NULL, VAR_STRING, 0},
+ {"statusmsg", sizeof("statusmsg") - 1, NULL, VAR_STRING, 0},
+ {"shell_error", sizeof("shell_error") - 1, NULL, VAR_NUMBER,
+ VV_COMPAT+VV_RO},
+ {"this_session", sizeof("this_session") - 1, NULL, VAR_STRING, VV_COMPAT},
+ {"version", sizeof("version") - 1, (char_u *)VIM_VERSION_100,
+ VAR_NUMBER, VV_COMPAT+VV_RO},
+ {"lnum", sizeof("lnum") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"termresponse", sizeof("termresponse") - 1, NULL, VAR_STRING, VV_RO},
+ {"fname", sizeof("fname") - 1, NULL, VAR_STRING, VV_RO},
+ {"lang", sizeof("lang") - 1, NULL, VAR_STRING, VV_RO},
+ {"lc_time", sizeof("lc_time") - 1, NULL, VAR_STRING, VV_RO},
+ {"ctype", sizeof("ctype") - 1, NULL, VAR_STRING, VV_RO},
+ {"charconvert_from", sizeof("charconvert_from") - 1, NULL, VAR_STRING, VV_RO},
+ {"charconvert_to", sizeof("charconvert_to") - 1, NULL, VAR_STRING, VV_RO},
+ {"fname_in", sizeof("fname_in") - 1, NULL, VAR_STRING, VV_RO},
+ {"fname_out", sizeof("fname_out") - 1, NULL, VAR_STRING, VV_RO},
+ {"fname_new", sizeof("fname_new") - 1, NULL, VAR_STRING, VV_RO},
+ {"fname_diff", sizeof("fname_diff") - 1, NULL, VAR_STRING, VV_RO},
+ {"cmdarg", sizeof("cmdarg") - 1, NULL, VAR_STRING, VV_RO},
+ {"foldstart", sizeof("foldstart") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"foldend", sizeof("foldend") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"folddashes", sizeof("folddashes") - 1, NULL, VAR_STRING, VV_RO},
+ {"foldlevel", sizeof("foldlevel") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"progname", sizeof("progname") - 1, NULL, VAR_STRING, VV_RO},
+ {"servername", sizeof("servername") - 1, NULL, VAR_STRING, VV_RO},
+ {"dying", sizeof("dying") - 1, NULL, VAR_NUMBER, VV_RO},
+ {"exception", sizeof("exception") - 1, NULL, VAR_STRING, VV_RO},
+ {"throwpoint", sizeof("throwpoint") - 1, NULL, VAR_STRING, VV_RO},
+ {"register", sizeof("register") - 1, NULL, VAR_STRING, VV_RO},
+ {"cmdbang", sizeof("cmdbang") - 1, NULL, VAR_NUMBER, VV_RO},
+};
+
+static int eval0 __ARGS((char_u *arg, VAR retvar, char_u **nextcmd, int evaluate));
+static int eval1 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval2 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval3 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval4 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval5 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval6 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int eval7 __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int get_option_var __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int get_string_var __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int get_lit_string_var __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int get_env_var __ARGS((char_u **arg, VAR retvar, int evaluate));
+static int find_internal_func __ARGS((char_u *name));
+static int get_func_var __ARGS((char_u *name, int len, VAR retvar, char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate));
+static int call_func __ARGS((char_u *name, int len, VAR retvar, int argcount, VAR argvars, linenr_T firstline, linenr_T lastline, int *doesrange, int evaluate));
+static void f_append __ARGS((VAR argvars, VAR retvar));
+static void f_argc __ARGS((VAR argvars, VAR retvar));
+static void f_argidx __ARGS((VAR argvars, VAR retvar));
+static void f_argv __ARGS((VAR argvars, VAR retvar));
+static void f_browse __ARGS((VAR argvars, VAR retvar));
+static buf_T *find_buffer __ARGS((VAR avar));
+static void f_bufexists __ARGS((VAR argvars, VAR retvar));
+static void f_buflisted __ARGS((VAR argvars, VAR retvar));
+static void f_bufloaded __ARGS((VAR argvars, VAR retvar));
+static buf_T *get_buf_var __ARGS((VAR avar));
+static void f_bufname __ARGS((VAR argvars, VAR retvar));
+static void f_bufnr __ARGS((VAR argvars, VAR retvar));
+static void f_bufwinnr __ARGS((VAR argvars, VAR retvar));
+static void f_byte2line __ARGS((VAR argvars, VAR retvar));
+static void f_char2nr __ARGS((VAR argvars, VAR retvar));
+static void f_cindent __ARGS((VAR argvars, VAR retvar));
+static void f_col __ARGS((VAR argvars, VAR retvar));
+static void f_confirm __ARGS((VAR argvars, VAR retvar));
+static void f_cscope_connection __ARGS((VAR argvars, VAR retvar));
+static void f_cursor __ARGS((VAR argsvars, VAR retvar));
+static void f_delete __ARGS((VAR argvars, VAR retvar));
+static void f_did_filetype __ARGS((VAR argvars, VAR retvar));
+static void f_escape __ARGS((VAR argvars, VAR retvar));
+static void f_eventhandler __ARGS((VAR argvars, VAR retvar));
+static void f_executable __ARGS((VAR argvars, VAR retvar));
+static void f_exists __ARGS((VAR argvars, VAR retvar));
+static void f_expand __ARGS((VAR argvars, VAR retvar));
+static void f_filereadable __ARGS((VAR argvars, VAR retvar));
+static void f_filewritable __ARGS((VAR argvars, VAR retvar));
+static void f_fnamemodify __ARGS((VAR argvars, VAR retvar));
+static void f_foldclosed __ARGS((VAR argvars, VAR retvar));
+static void f_foldclosedend __ARGS((VAR argvars, VAR retvar));
+static void foldclosed_both __ARGS((VAR argvars, VAR retvar, int end));
+static void f_foldlevel __ARGS((VAR argvars, VAR retvar));
+static void f_foldtext __ARGS((VAR argvars, VAR retvar));
+static void f_foreground __ARGS((VAR argvars, VAR retvar));
+static void f_getbufvar __ARGS((VAR argvars, VAR retvar));
+static void f_getchar __ARGS((VAR argvars, VAR retvar));
+static void f_getcharmod __ARGS((VAR argvars, VAR retvar));
+static void f_getcmdline __ARGS((VAR argvars, VAR retvar));
+static void f_getcmdpos __ARGS((VAR argvars, VAR retvar));
+static void f_getcwd __ARGS((VAR argvars, VAR retvar));
+static void f_getfsize __ARGS((VAR argvars, VAR retvar));
+static void f_getftime __ARGS((VAR argvars, VAR retvar));
+static void f_getline __ARGS((VAR argvars, VAR retvar));
+static void f_getreg __ARGS((VAR argvars, VAR retvar));
+static void f_getregtype __ARGS((VAR argvars, VAR retvar));
+static void f_getwinposx __ARGS((VAR argvars, VAR retvar));
+static void f_getwinposy __ARGS((VAR argvars, VAR retvar));
+static void f_getwinvar __ARGS((VAR argvars, VAR retvar));
+static void f_glob __ARGS((VAR argvars, VAR retvar));
+static void f_globpath __ARGS((VAR argvars, VAR retvar));
+static void f_has __ARGS((VAR argvars, VAR retvar));
+static void f_hasmapto __ARGS((VAR argvars, VAR retvar));
+static void f_histadd __ARGS((VAR argvars, VAR retvar));
+static void f_histdel __ARGS((VAR argvars, VAR retvar));
+static void f_histget __ARGS((VAR argvars, VAR retvar));
+static void f_histnr __ARGS((VAR argvars, VAR retvar));
+static void f_hlexists __ARGS((VAR argvars, VAR retvar));
+static void f_hlID __ARGS((VAR argvars, VAR retvar));
+static void f_hostname __ARGS((VAR argvars, VAR retvar));
+static void f_iconv __ARGS((VAR argvars, VAR retvar));
+static void f_indent __ARGS((VAR argvars, VAR retvar));
+static void f_isdirectory __ARGS((VAR argvars, VAR retvar));
+static void f_input __ARGS((VAR argvars, VAR retvar));
+static void f_inputdialog __ARGS((VAR argvars, VAR retvar));
+static void f_inputrestore __ARGS((VAR argvars, VAR retvar));
+static void f_inputsave __ARGS((VAR argvars, VAR retvar));
+static void f_inputsecret __ARGS((VAR argvars, VAR retvar));
+static void f_last_buffer_nr __ARGS((VAR argvars, VAR retvar));
+static void f_libcall __ARGS((VAR argvars, VAR retvar));
+static void f_libcallnr __ARGS((VAR argvars, VAR retvar));
+static void libcall_common __ARGS((VAR argvars, VAR retvar, int type));
+static void f_line __ARGS((VAR argvars, VAR retvar));
+static void f_line2byte __ARGS((VAR argvars, VAR retvar));
+static void f_lispindent __ARGS((VAR argvars, VAR retvar));
+static void f_localtime __ARGS((VAR argvars, VAR retvar));
+static void f_maparg __ARGS((VAR argvars, VAR retvar));
+static void f_mapcheck __ARGS((VAR argvars, VAR retvar));
+static void get_maparg __ARGS((VAR argvars, VAR retvar, int exact));
+static void f_match __ARGS((VAR argvars, VAR retvar));
+static void f_matchend __ARGS((VAR argvars, VAR retvar));
+static void f_matchstr __ARGS((VAR argvars, VAR retvar));
+static void f_mode __ARGS((VAR argvars, VAR retvar));
+static void f_nextnonblank __ARGS((VAR argvars, VAR retvar));
+static void f_nr2char __ARGS((VAR argvars, VAR retvar));
+static void f_prevnonblank __ARGS((VAR argvars, VAR retvar));
+static void f_setbufvar __ARGS((VAR argvars, VAR retvar));
+static void f_setcmdpos __ARGS((VAR argvars, VAR retvar));
+static void f_setwinvar __ARGS((VAR argvars, VAR retvar));
+static void f_rename __ARGS((VAR argvars, VAR retvar));
+static void f_resolve __ARGS((VAR argvars, VAR retvar));
+static void f_search __ARGS((VAR argvars, VAR retvar));
+static void f_searchpair __ARGS((VAR argvars, VAR retvar));
+static int get_search_arg __ARGS((VAR varp, int *flagsp));
+static void f_remote_expr __ARGS((VAR argvars, VAR retvar));
+static void f_remote_foreground __ARGS((VAR argvars, VAR retvar));
+static void f_remote_peek __ARGS((VAR argvars, VAR retvar));
+static void f_remote_read __ARGS((VAR argvars, VAR retvar));
+static void f_remote_send __ARGS((VAR argvars, VAR retvar));
+static void f_server2client __ARGS((VAR argvars, VAR retvar));
+static void f_serverlist __ARGS((VAR argvars, VAR retvar));
+static void f_setline __ARGS((VAR argvars, VAR retvar));
+static void f_setreg __ARGS((VAR argvars, VAR retvar));
+static void f_simplify __ARGS((VAR argvars, VAR retvar));
+static void find_some_match __ARGS((VAR argvars, VAR retvar, int start));
+static void f_strftime __ARGS((VAR argvars, VAR retvar));
+static void f_stridx __ARGS((VAR argvars, VAR retvar));
+static void f_strlen __ARGS((VAR argvars, VAR retvar));
+static void f_strpart __ARGS((VAR argvars, VAR retvar));
+static void f_strridx __ARGS((VAR argvars, VAR retvar));
+static void f_strtrans __ARGS((VAR argvars, VAR retvar));
+static void f_synID __ARGS((VAR argvars, VAR retvar));
+static void f_synIDattr __ARGS((VAR argvars, VAR retvar));
+static void f_synIDtrans __ARGS((VAR argvars, VAR retvar));
+static void f_system __ARGS((VAR argvars, VAR retvar));
+static void f_submatch __ARGS((VAR argvars, VAR retvar));
+static void f_substitute __ARGS((VAR argvars, VAR retvar));
+static void f_tempname __ARGS((VAR argvars, VAR retvar));
+static void f_tolower __ARGS((VAR argvars, VAR retvar));
+static void f_toupper __ARGS((VAR argvars, VAR retvar));
+static void f_type __ARGS((VAR argvars, VAR retvar));
+static void f_virtcol __ARGS((VAR argvars, VAR retvar));
+static void f_visualmode __ARGS((VAR argvars, VAR retvar));
+static void f_winbufnr __ARGS((VAR argvars, VAR retvar));
+static void f_wincol __ARGS((VAR argvars, VAR retvar));
+static void f_winheight __ARGS((VAR argvars, VAR retvar));
+static void f_winline __ARGS((VAR argvars, VAR retvar));
+static void f_winnr __ARGS((VAR argvars, VAR retvar));
+static void f_winrestcmd __ARGS((VAR argvars, VAR retvar));
+static void f_winwidth __ARGS((VAR argvars, VAR retvar));
+static win_T *find_win_by_nr __ARGS((VAR vp));
+static pos_T *var2fpos __ARGS((VAR varp, int lnum));
+static int get_env_len __ARGS((char_u **arg));
+static int get_id_len __ARGS((char_u **arg));
+static int get_func_len __ARGS((char_u **arg, char_u **alias, int evaluate));
+static char_u *find_name_end __ARGS((char_u *arg, char_u **expr_start, char_u **expr_end));
+static int eval_isnamec __ARGS((int c));
+static int find_vim_var __ARGS((char_u *name, int len));
+static int get_var_var __ARGS((char_u *name, int len, VAR retvar));
+static VAR alloc_var __ARGS((void));
+static VAR alloc_string_var __ARGS((char_u *string));
+static void free_var __ARGS((VAR varp));
+static void clear_var __ARGS((VAR varp));
+static long get_var_number __ARGS((VAR varp));
+static linenr_T get_var_lnum __ARGS((VAR argvars));
+static char_u *get_var_string __ARGS((VAR varp));
+static char_u *get_var_string_buf __ARGS((VAR varp, char_u *buf));
+static VAR find_var __ARGS((char_u *name, int writing));
+static VAR find_var_in_ga __ARGS((garray_T *gap, char_u *varname));
+static garray_T *find_var_ga __ARGS((char_u *name, char_u **varname));
+static void var_free_one __ARGS((VAR v));
+static void list_one_var __ARGS((VAR v, char_u *prefix));
+static void list_vim_var __ARGS((int i));
+static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string));
+static void set_var __ARGS((char_u *name, VAR varp));
+static void copy_var __ARGS((VAR from, VAR to));
+static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
+static char_u *trans_function_name __ARGS((char_u **pp, int skip, int internal));
+static int eval_fname_script __ARGS((char_u *p));
+static int eval_fname_sid __ARGS((char_u *p));
+static void list_func_head __ARGS((ufunc_T *fp, int indent));
+static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp));
+static ufunc_T *find_func __ARGS((char_u *name));
+static void call_user_func __ARGS((ufunc_T *fp, int argcount, VAR argvars, VAR retvar, linenr_T firstline, linenr_T lastline));
+
+/* Magic braces are always enabled, otherwise Vim scripts would not be
+ * portable. */
+#define FEAT_MAGIC_BRACES
+
+#ifdef FEAT_MAGIC_BRACES
+static char_u * make_expanded_name __ARGS((char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end));
+#endif
+
+/*
+ * Set an internal variable to a string value. Creates the variable if it does
+ * not already exist.
+ */
+ void
+set_internal_string_var(name, value)
+ char_u *name;
+ char_u *value;
+{
+ char_u *val;
+ VAR varp;
+
+ val = vim_strsave(value);
+ if (val != NULL)
+ {
+ varp = alloc_string_var(val);
+ if (varp != NULL)
+ {
+ set_var(name, varp);
+ free_var(varp);
+ }
+ }
+}
+
+# if defined(FEAT_MBYTE) || defined(PROTO)
+ int
+eval_charconvert(enc_from, enc_to, fname_from, fname_to)
+ char_u *enc_from;
+ char_u *enc_to;
+ char_u *fname_from;
+ char_u *fname_to;
+{
+ int err = FALSE;
+
+ set_vim_var_string(VV_CC_FROM, enc_from, -1);
+ set_vim_var_string(VV_CC_TO, enc_to, -1);
+ set_vim_var_string(VV_FNAME_IN, fname_from, -1);
+ set_vim_var_string(VV_FNAME_OUT, fname_to, -1);
+ if (eval_to_bool(p_ccv, &err, NULL, FALSE))
+ err = TRUE;
+ set_vim_var_string(VV_CC_FROM, NULL, -1);
+ set_vim_var_string(VV_CC_TO, NULL, -1);
+ set_vim_var_string(VV_FNAME_IN, NULL, -1);
+ set_vim_var_string(VV_FNAME_OUT, NULL, -1);
+
+ if (err)
+ return FAIL;
+ return OK;
+}
+# endif
+
+# if defined(FEAT_POSTSCRIPT) || defined(PROTO)
+ int
+eval_printexpr(fname, args)
+ char_u *fname;
+ char_u *args;
+{
+ int err = FALSE;
+
+ set_vim_var_string(VV_FNAME_IN, fname, -1);
+ set_vim_var_string(VV_CMDARG, args, -1);
+ if (eval_to_bool(p_pexpr, &err, NULL, FALSE))
+ err = TRUE;
+ set_vim_var_string(VV_FNAME_IN, NULL, -1);
+ set_vim_var_string(VV_CMDARG, NULL, -1);
+
+ if (err)
+ {
+ mch_remove(fname);
+ return FAIL;
+ }
+ return OK;
+}
+# endif
+
+# if defined(FEAT_DIFF) || defined(PROTO)
+ void
+eval_diff(origfile, newfile, outfile)
+ char_u *origfile;
+ char_u *newfile;
+ char_u *outfile;
+{
+ int err = FALSE;
+
+ set_vim_var_string(VV_FNAME_IN, origfile, -1);
+ set_vim_var_string(VV_FNAME_NEW, newfile, -1);
+ set_vim_var_string(VV_FNAME_OUT, outfile, -1);
+ (void)eval_to_bool(p_dex, &err, NULL, FALSE);
+ set_vim_var_string(VV_FNAME_IN, NULL, -1);
+ set_vim_var_string(VV_FNAME_NEW, NULL, -1);
+ set_vim_var_string(VV_FNAME_OUT, NULL, -1);
+}
+
+ void
+eval_patch(origfile, difffile, outfile)
+ char_u *origfile;
+ char_u *difffile;
+ char_u *outfile;
+{
+ int err;
+
+ set_vim_var_string(VV_FNAME_IN, origfile, -1);
+ set_vim_var_string(VV_FNAME_DIFF, difffile, -1);
+ set_vim_var_string(VV_FNAME_OUT, outfile, -1);
+ (void)eval_to_bool(p_pex, &err, NULL, FALSE);
+ set_vim_var_string(VV_FNAME_IN, NULL, -1);
+ set_vim_var_string(VV_FNAME_DIFF, NULL, -1);
+ set_vim_var_string(VV_FNAME_OUT, NULL, -1);
+}
+# endif
+
+/*
+ * Top level evaluation function, returning a boolean.
+ * Sets "error" to TRUE if there was an error.
+ * Return TRUE or FALSE.
+ */
+ int
+eval_to_bool(arg, error, nextcmd, skip)
+ char_u *arg;
+ int *error;
+ char_u **nextcmd;
+ int skip; /* only parse, don't execute */
+{
+ var retvar;
+ int retval = FALSE;
+
+ if (skip)
+ ++emsg_skip;
+ if (eval0(arg, &retvar, nextcmd, !skip) == FAIL)
+ {
+ *error = TRUE;
+ }
+ else
+ {
+ *error = FALSE;
+ if (!skip)
+ {
+ retval = (get_var_number(&retvar) != 0);
+ clear_var(&retvar);
+ }
+ }
+ if (skip)
+ --emsg_skip;
+
+ return retval;
+}
+
+/*
+ * Top level evaluation function, returning a string. If "skip" is TRUE,
+ * only parsing to "nextcmd" is done, without reporting errors. Return
+ * pointer to allocated memory, or NULL for failure or when "skip" is TRUE.
+ */
+ char_u *
+eval_to_string_skip(arg, nextcmd, skip)
+ char_u *arg;
+ char_u **nextcmd;
+ int skip; /* only parse, don't execute */
+{
+ var retvar;
+ char_u *retval;
+
+ if (skip)
+ ++emsg_skip;
+ if (eval0(arg, &retvar, nextcmd, !skip) == FAIL || skip)
+ retval = NULL;
+ else
+ {
+ retval = vim_strsave(get_var_string(&retvar));
+ clear_var(&retvar);
+ }
+ if (skip)
+ --emsg_skip;
+
+ return retval;
+}
+
+/*
+ * Top level evaluation function, returning a string.
+ * Return pointer to allocated memory, or NULL for failure.
+ */
+ char_u *
+eval_to_string(arg, nextcmd)
+ char_u *arg;
+ char_u **nextcmd;
+{
+ var retvar;
+ char_u *retval;
+
+ if (eval0(arg, &retvar, nextcmd, TRUE) == FAIL)
+ retval = NULL;
+ else
+ {
+ retval = vim_strsave(get_var_string(&retvar));
+ clear_var(&retvar);
+ }
+
+ return retval;
+}
+
+/*
+ * Call eval_to_string() with "sandbox" set and not using local variables.
+ */
+ char_u *
+eval_to_string_safe(arg, nextcmd)
+ char_u *arg;
+ char_u **nextcmd;
+{
+ char_u *retval;
+ void *save_funccalp;
+
+ save_funccalp = save_funccal();
+ ++sandbox;
+ retval = eval_to_string(arg, nextcmd);
+ --sandbox;
+ restore_funccal(save_funccalp);
+ return retval;
+}
+
+#if 0 /* not used */
+/*
+ * Top level evaluation function, returning a string.
+ * Advances "arg" to the first non-blank after the evaluated expression.
+ * Return pointer to allocated memory, or NULL for failure.
+ * Doesn't give error messages.
+ */
+ char_u *
+eval_arg_to_string(arg)
+ char_u **arg;
+{
+ var retvar;
+ char_u *retval;
+ int ret;
+
+ ++emsg_off;
+
+ ret = eval1(arg, &retvar, TRUE);
+ if (ret == FAIL)
+ retval = NULL;
+ else
+ {
+ retval = vim_strsave(get_var_string(&retvar));
+ clear_var(&retvar);
+ }
+
+ --emsg_off;
+
+ return retval;
+}
+#endif
+
+/*
+ * Top level evaluation function, returning a number.
+ * Evaluates "expr" silently.
+ * Returns -1 for an error.
+ */
+ int
+eval_to_number(expr)
+ char_u *expr;
+{
+ var retvar;
+ int retval;
+ char_u *p = expr;
+
+ ++emsg_off;
+
+ if (eval1(&p, &retvar, TRUE) == FAIL)
+ retval = -1;
+ else
+ {
+ retval = get_var_number(&retvar);
+ clear_var(&retvar);
+ }
+ --emsg_off;
+
+ return retval;
+}
+
+#if (defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)) || defined(PROTO)
+/*
+ * Call some vimL function and return the result as a string
+ * Uses argv[argc] for the function arguments.
+ */
+ char_u *
+call_vim_function(func, argc, argv, safe)
+ char_u *func;
+ int argc;
+ char_u **argv;
+ int safe; /* use the sandbox */
+{
+ char_u *retval = NULL;
+ var retvar;
+ VAR argvars;
+ long n;
+ int len;
+ int i;
+ int doesrange;
+ void *save_funccalp = NULL;
+
+ argvars = (VAR)alloc((unsigned)(argc * sizeof(var)));
+ if (argvars == NULL)
+ return NULL;
+
+ for (i = 0; i < argc; i++)
+ {
+ /* Recognize a number argument, the others must be strings. */
+ vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL);
+ if (len != 0 && len == (int)STRLEN(argv[i]))
+ {
+ argvars[i].var_type = VAR_NUMBER;
+ argvars[i].var_val.var_number = n;
+ }
+ else
+ {
+ argvars[i].var_type = VAR_STRING;
+ argvars[i].var_val.var_string = argv[i];
+ }
+ }
+
+ if (safe)
+ {
+ save_funccalp = save_funccal();
+ ++sandbox;
+ }
+
+ retvar.var_type = VAR_UNKNOWN; /* clear_var() uses this */
+ if (call_func(func, (int)STRLEN(func), &retvar, argc, argvars,
+ curwin->w_cursor.lnum, curwin->w_cursor.lnum,
+ &doesrange, TRUE) == OK)
+ retval = vim_strsave(get_var_string(&retvar));
+
+ clear_var(&retvar);
+ vim_free(argvars);
+
+ if (safe)
+ {
+ --sandbox;
+ restore_funccal(save_funccalp);
+ }
+ return retval;
+}
+#endif
+
+/*
+ * Save the current function call pointer, and set it to NULL.
+ * Used when executing autocommands and for ":source".
+ */
+ void *
+save_funccal()
+{
+ struct funccall *fc;
+
+ fc = current_funccal;
+ current_funccal = NULL;
+ return (void *)fc;
+}
+
+ void
+restore_funccal(fc)
+ void *fc;
+{
+ current_funccal = (struct funccall *)fc;
+}
+
+#ifdef FEAT_FOLDING
+/*
+ * Evaluate 'foldexpr'. Returns the foldlevel, and any character preceding
+ * it in "*cp". Doesn't give error messages.
+ */
+ int
+eval_foldexpr(arg, cp)
+ char_u *arg;
+ int *cp;
+{
+ var retvar;
+ int retval;
+ char_u *s;
+
+ ++emsg_off;
+ ++sandbox;
+ *cp = NUL;
+ if (eval0(arg, &retvar, NULL, TRUE) == FAIL)
+ retval = 0;
+ else
+ {
+ /* If the result is a number, just return the number. */
+ if (retvar.var_type == VAR_NUMBER)
+ retval = retvar.var_val.var_number;
+ else if (retvar.var_type == VAR_UNKNOWN
+ || retvar.var_val.var_string == NULL)
+ retval = 0;
+ else
+ {
+ /* If the result is a string, check if there is a non-digit before
+ * the number. */
+ s = retvar.var_val.var_string;
+ if (!VIM_ISDIGIT(*s) && *s != '-')
+ *cp = *s++;
+ retval = atol((char *)s);
+ }
+ clear_var(&retvar);
+ }
+ --emsg_off;
+ --sandbox;
+
+ return retval;
+}
+#endif
+
+#ifdef FEAT_MAGIC_BRACES
+/*
+ * Expands out the 'magic' {}'s in a variable/function name.
+ * Note that this can call itself recursively, to deal with
+ * constructs like foo{bar}{baz}{bam}
+ * The four pointer arguments point to "foo{expre}ss{ion}bar"
+ * "in_start" ^
+ * "expr_start" ^
+ * "expr_end" ^
+ * "in_end" ^
+ *
+ * Returns a new allocated string, which the caller must free.
+ * Returns NULL for failure.
+ */
+ static char_u *
+make_expanded_name(in_start, expr_start, expr_end, in_end)
+ char_u *in_start;
+ char_u *expr_start;
+ char_u *expr_end;
+ char_u *in_end;
+{
+ char_u c1;
+ char_u *retval = NULL;
+ char_u *temp_result;
+ char_u *nextcmd = NULL;
+
+ if (expr_end == NULL || in_end == NULL)
+ return NULL;
+ *expr_start = NUL;
+ *expr_end = NUL;
+ c1 = *in_end;
+ *in_end = NUL;
+
+ temp_result = eval_to_string(expr_start + 1, &nextcmd);
+ if (temp_result != NULL && nextcmd == NULL)
+ {
+ retval = alloc((unsigned)(STRLEN(temp_result) + (expr_start - in_start)
+ + (in_end - expr_end) + 1));
+
+ if (retval != NULL)
+ {
+ STRCPY(retval, in_start);
+ STRCAT(retval, temp_result);
+ STRCAT(retval, expr_end + 1);
+ }
+ }
+ vim_free(temp_result);
+
+ *in_end = c1; /* put char back for error messages */
+ *expr_start = '{';
+ *expr_end = '}';
+
+ if (retval != NULL)
+ {
+ temp_result = find_name_end(retval, &expr_start, &expr_end);
+ if (expr_start != NULL)
+ {
+ /* Further expansion! */
+ temp_result = make_expanded_name(retval, expr_start,
+ expr_end, temp_result);
+ vim_free(retval);
+ retval = temp_result;
+ }
+ }
+
+ return retval;
+
+}
+#endif /* FEAT_MAGIC_BRACES */
+
+/*
+ * ":let var = expr" assignment command.
+ * ":let var" list one variable value
+ * ":let" list all variable values
+ */
+ void
+ex_let(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *expr;
+ char_u *name;
+ VAR varp;
+ var retvar;
+ char_u *p;
+ int c1 = 0, c2;
+ int i;
+ char_u *expr_start;
+ char_u *expr_end;
+ char_u *name_end;
+
+ name_end = find_name_end(arg, &expr_start, &expr_end);
+ expr = vim_strchr(name_end, '=');
+ if (expr == NULL)
+ {
+ if (ends_excmd(*arg))
+ {
+ if (!eap->skip)
+ {
+ /*
+ * List all variables.
+ */
+ for (i = 0; i < variables.ga_len && !got_int; ++i)
+ if (VAR_ENTRY(i).var_name != NULL)
+ list_one_var(&VAR_ENTRY(i), (char_u *)"");
+ for (i = 0; i < curbuf->b_vars.ga_len && !got_int; ++i)
+ if (BVAR_ENTRY(i).var_name != NULL)
+ list_one_var(&BVAR_ENTRY(i), (char_u *)"b:");
+ for (i = 0; i < curwin->w_vars.ga_len && !got_int; ++i)
+ if (WVAR_ENTRY(i).var_name != NULL)
+ list_one_var(&WVAR_ENTRY(i), (char_u *)"w:");
+ for (i = 0; i < VV_LEN && !got_int; ++i)
+ if (vimvars[i].type == VAR_NUMBER || vimvars[i].val != NULL)
+ list_vim_var(i);
+ }
+ }
+ else
+ {
+ int error = FALSE;
+
+ /*
+ * List variables.
+ */
+ while (!ends_excmd(*arg) && !got_int)
+ {
+ char_u *temp_string = NULL;
+ int arg_len;
+
+ /* Find the end of the name. */
+ name_end = find_name_end(arg, &expr_start, &expr_end);
+
+ if (!vim_iswhite(*name_end) && !ends_excmd(*name_end))
+ {
+ emsg_severe = TRUE;
+ EMSG(_(e_trailing));
+ break;
+ }
+ if (!error && !eap->skip)
+ {
+#ifdef FEAT_MAGIC_BRACES
+ if (expr_start != NULL)
+ {
+ temp_string = make_expanded_name(arg, expr_start,
+ expr_end, name_end);
+ if (temp_string == NULL)
+ {
+ /*
+ * Report an invalid expression in braces, unless
+ * the expression evaluation has been cancelled due
+ * to an aborting error, an interrupt, or an
+ * exception.
+ */
+ if (!aborting())
+ {
+ emsg_severe = TRUE;
+ EMSG2(_(e_invarg2), arg);
+ break;
+ }
+ error = TRUE;
+ arg = skipwhite(name_end);
+ continue;
+ }
+ arg = temp_string;
+ arg_len = STRLEN(temp_string);
+ }
+ else
+#endif
+ {
+ c1 = *name_end;
+ *name_end = NUL;
+ arg_len = (int)(name_end - arg);
+ }
+ i = find_vim_var(arg, arg_len);
+ if (i >= 0)
+ list_vim_var(i);
+ else if (STRCMP("b:changedtick", arg) == 0)
+ {
+ char_u numbuf[NUMBUFLEN];
+
+ sprintf((char *)numbuf, "%ld",
+ (long)curbuf->b_changedtick);
+ list_one_var_a((char_u *)"b:", (char_u *)"changedtick",
+ VAR_NUMBER, numbuf);
+ }
+ else
+ {
+ varp = find_var(arg, FALSE);
+ if (varp == NULL)
+ {
+ /* Skip further arguments but do continue to
+ * search for a trailing command. */
+ EMSG2(_("E106: Unknown variable: \"%s\""), arg);
+ error = TRUE;
+ }
+ else
+ {
+ name = vim_strchr(arg, ':');
+ if (name != NULL)
+ {
+ /* "a:" vars have no name stored, use whole
+ * arg */
+ if (arg[0] == 'a' && arg[1] == ':')
+ c2 = NUL;
+ else
+ {
+ c2 = *++name;
+ *name = NUL;
+ }
+ list_one_var(varp, arg);
+ if (c2 != NUL)
+ *name = c2;
+ }
+ else
+ list_one_var(varp, (char_u *)"");
+ }
+ }
+#ifdef FEAT_MAGIC_BRACES
+ if (expr_start != NULL)
+ vim_free(temp_string);
+ else
+#endif
+ *name_end = c1;
+ }
+ arg = skipwhite(name_end);
+ }
+ }
+ eap->nextcmd = check_nextcmd(arg);
+ }
+ else
+ {
+ if (eap->skip)
+ ++emsg_skip;
+ i = eval0(expr + 1, &retvar, &eap->nextcmd, !eap->skip);
+ if (eap->skip)
+ {
+ if (i != FAIL)
+ clear_var(&retvar);
+ --emsg_skip;
+ }
+ else if (i != FAIL)
+ {
+ /*
+ * ":let $VAR = expr": Set environment variable.
+ */
+ if (*arg == '$')
+ {
+ int len;
+ int cc;
+
+ /* Find the end of the name. */
+ ++arg;
+ name = arg;
+ len = get_env_len(&arg);
+ if (len == 0)
+ EMSG2(_(e_invarg2), name - 1);
+ else
+ {
+ if (*skipwhite(arg) != '=')
+ EMSG(_(e_letunexp));
+ else
+ {
+ cc = name[len];
+ name[len] = NUL;
+ p = get_var_string(&retvar);
+ vim_setenv(name, p);
+ if (STRICMP(name, "HOME") == 0)
+ init_homedir();
+ else if (didset_vim && STRICMP(name, "VIM") == 0)
+ didset_vim = FALSE;
+ else if (didset_vimruntime
+ && STRICMP(name, "VIMRUNTIME") == 0)
+ didset_vimruntime = FALSE;
+ name[len] = cc;
+ }
+ }
+ }
+
+ /*
+ * ":let &option = expr": Set option value.
+ * ":let &l:option = expr": Set local option value.
+ * ":let &g:option = expr": Set global option value.
+ */
+ else if (*arg == '&')
+ {
+ int opt_flags;
+
+ /*
+ * Find the end of the name;
+ */
+ p = find_option_end(&arg, &opt_flags);
+ if (p == NULL || *skipwhite(p) != '=')
+ EMSG(_(e_letunexp));
+ else
+ {
+ c1 = *p;
+ *p = NUL;
+ set_option_value(arg, get_var_number(&retvar),
+ get_var_string(&retvar), opt_flags);
+ *p = c1; /* put back for error messages */
+ }
+ }
+
+ /*
+ * ":let @r = expr": Set register contents.
+ */
+ else if (*arg == '@')
+ {
+ ++arg;
+ if (*skipwhite(arg + 1) != '=')
+ EMSG(_(e_letunexp));
+ else
+ write_reg_contents(*arg == '@' ? '"' : *arg,
+ get_var_string(&retvar), -1, FALSE);
+ }
+
+ /*
+ * ":let var = expr": Set internal variable.
+ */
+ else if (eval_isnamec(*arg) && !VIM_ISDIGIT(*arg))
+ {
+ /* Find the end of the name. */
+ p = find_name_end(arg, &expr_start, &expr_end);
+
+ if (*skipwhite(p) != '=')
+ EMSG(_(e_letunexp));
+ else if (p - arg == 13
+ && STRNCMP(arg, "b:changedtick", 13) == 0)
+ EMSG2(_(e_readonlyvar), arg);
+#ifdef FEAT_MAGIC_BRACES
+ else if (expr_start != NULL)
+ {
+ char_u *temp_string;
+
+ temp_string = make_expanded_name(arg, expr_start,
+ expr_end, p);
+ if (temp_string == NULL)
+ {
+ /*
+ * Report an invalid expression in braces, unless the
+ * expression evaluation has been cancelled due to an
+ * aborting error, an interrupt, or an exception.
+ */
+ if (!aborting())
+ EMSG2(_(e_invarg2), arg);
+ }
+ else
+ {
+ set_var(temp_string, &retvar);
+ vim_free(temp_string);
+ }
+ }
+#endif
+ else
+ {
+ c1 = *p;
+ *p = NUL;
+ set_var(arg, &retvar);
+ *p = c1; /* put char back for error messages */
+ }
+ }
+
+ else
+ {
+ EMSG2(_(e_invarg2), arg);
+ }
+
+ clear_var(&retvar);
+ }
+ }
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+ void
+set_context_for_expression(xp, arg, cmdidx)
+ expand_T *xp;
+ char_u *arg;
+ cmdidx_T cmdidx;
+{
+ int got_eq = FALSE;
+ int c;
+
+ xp->xp_context = cmdidx == CMD_let ? EXPAND_USER_VARS
+ : cmdidx == CMD_call ? EXPAND_FUNCTIONS
+ : EXPAND_EXPRESSION;
+ while ((xp->xp_pattern = vim_strpbrk(arg,
+ (char_u *)"\"'+-*/%.=!?~|&$([<>,#")) != NULL)
+ {
+ c = *xp->xp_pattern;
+ if (c == '&')
+ {
+ c = xp->xp_pattern[1];
+ if (c == '&')
+ {
+ ++xp->xp_pattern;
+ xp->xp_context = cmdidx != CMD_let || got_eq
+ ? EXPAND_EXPRESSION : EXPAND_NOTHING;
+ }
+ else if (c != ' ')
+ xp->xp_context = EXPAND_SETTINGS;
+ }
+ else if (c == '$')
+ {
+ /* environment variable */
+ xp->xp_context = EXPAND_ENV_VARS;
+ }
+ else if (c == '=')
+ {
+ got_eq = TRUE;
+ xp->xp_context = EXPAND_EXPRESSION;
+ }
+ else if (c == '<'
+ && xp->xp_context == EXPAND_FUNCTIONS
+ && vim_strchr(xp->xp_pattern, '(') == NULL)
+ {
+ /* Function name can start with "<SNR>" */
+ break;
+ }
+ else if (cmdidx != CMD_let || got_eq)
+ {
+ if (c == '"') /* string */
+ {
+ while ((c = *++xp->xp_pattern) != NUL && c != '"')
+ if (c == '\\' && xp->xp_pattern[1] != NUL)
+ ++xp->xp_pattern;
+ xp->xp_context = EXPAND_NOTHING;
+ }
+ else if (c == '\'') /* literal string */
+ {
+ while ((c = *++xp->xp_pattern) != NUL && c != '\'')
+ /* skip */ ;
+ xp->xp_context = EXPAND_NOTHING;
+ }
+ else if (c == '|')
+ {
+ if (xp->xp_pattern[1] == '|')
+ {
+ ++xp->xp_pattern;
+ xp->xp_context = EXPAND_EXPRESSION;
+ }
+ else
+ xp->xp_context = EXPAND_COMMANDS;
+ }
+ else
+ xp->xp_context = EXPAND_EXPRESSION;
+ }
+ else
+ xp->xp_context = EXPAND_NOTHING;
+ arg = xp->xp_pattern;
+ if (*arg != NUL)
+ while ((c = *++arg) != NUL && (c == ' ' || c == '\t'))
+ /* skip */ ;
+ }
+ xp->xp_pattern = arg;
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * ":1,25call func(arg1, arg2)" function call.
+ */
+ void
+ex_call(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *startarg;
+ char_u *alias;
+ char_u *name;
+ var retvar;
+ int len;
+ linenr_T lnum;
+ int doesrange;
+ int failed = FALSE;
+
+ name = arg;
+ len = get_func_len(&arg, &alias, !eap->skip);
+ if (len == 0)
+ goto end;
+ if (alias != NULL)
+ name = alias;
+
+ startarg = arg;
+ retvar.var_type = VAR_UNKNOWN; /* clear_var() uses this */
+
+ if (*startarg != '(')
+ {
+ EMSG2(_("E107: Missing braces: %s"), name);
+ goto end;
+ }
+
+ /*
+ * When skipping, evaluate the function once, to find the end of the
+ * arguments.
+ * When the function takes a range, this is discovered after the first
+ * call, and the loop is broken.
+ */
+ if (eap->skip)
+ {
+ ++emsg_skip;
+ lnum = eap->line2; /* do it once, also with an invalid range */
+ }
+ else
+ lnum = eap->line1;
+ for ( ; lnum <= eap->line2; ++lnum)
+ {
+ if (!eap->skip && eap->addr_count > 0)
+ {
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = 0;
+ }
+ arg = startarg;
+ if (get_func_var(name, len, &retvar, &arg,
+ eap->line1, eap->line2, &doesrange, !eap->skip) == FAIL)
+ {
+ failed = TRUE;
+ break;
+ }
+ clear_var(&retvar);
+ if (doesrange || eap->skip)
+ break;
+ /* Stop when immediately aborting on error, or when an interrupt
+ * occurred or an exception was thrown but not caught. get_func_var()
+ * returned OK, so that the check for trailing characters below is
+ * executed. */
+ if (aborting())
+ break;
+ }
+ if (eap->skip)
+ --emsg_skip;
+
+ if (!failed)
+ {
+ /* Check for trailing illegal characters and a following command. */
+ if (!ends_excmd(*arg))
+ {
+ emsg_severe = TRUE;
+ EMSG(_(e_trailing));
+ }
+ else
+ eap->nextcmd = check_nextcmd(arg);
+ }
+
+end:
+ if (alias != NULL)
+ vim_free(alias);
+}
+
+/*
+ * ":unlet[!] var1 ... " command.
+ */
+ void
+ex_unlet(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *name_end;
+ char_u cc;
+ char_u *expr_start;
+ char_u *expr_end;
+ int error = FALSE;
+
+ do
+ {
+ /* Find the end of the name. */
+ name_end = find_name_end(arg, &expr_start, &expr_end);
+
+ if (!vim_iswhite(*name_end) && !ends_excmd(*name_end))
+ {
+ emsg_severe = TRUE;
+ EMSG(_(e_trailing));
+ break;
+ }
+
+ if (!error && !eap->skip)
+ {
+#ifdef FEAT_MAGIC_BRACES
+ if (expr_start != NULL)
+ {
+ char_u *temp_string;
+
+ temp_string = make_expanded_name(arg, expr_start,
+ expr_end, name_end);
+ if (temp_string == NULL)
+ {
+ /*
+ * Report an invalid expression in braces, unless the
+ * expression evaluation has been cancelled due to an
+ * aborting error, an interrupt, or an exception.
+ */
+ if (!aborting())
+ {
+ emsg_severe = TRUE;
+ EMSG2(_(e_invarg2), arg);
+ break;
+ }
+ error = TRUE;
+ }
+ else
+ {
+ if (do_unlet(temp_string) == FAIL && !eap->forceit)
+ {
+ EMSG2(_("E108: No such variable: \"%s\""), temp_string);
+ error = TRUE;
+ }
+ vim_free(temp_string);
+ }
+ }
+ else
+#endif
+ {
+ cc = *name_end;
+ *name_end = NUL;
+
+ if (do_unlet(arg) == FAIL && !eap->forceit)
+ {
+ EMSG2(_("E108: No such variable: \"%s\""), arg);
+ error = TRUE;
+ }
+
+ *name_end = cc;
+ }
+ }
+ arg = skipwhite(name_end);
+ } while (!ends_excmd(*arg));
+
+ eap->nextcmd = check_nextcmd(arg);
+}
+
+/*
+ * "unlet" a variable. Return OK if it existed, FAIL if not.
+ */
+ int
+do_unlet(name)
+ char_u *name;
+{
+ VAR v;
+
+ v = find_var(name, TRUE);
+ if (v != NULL)
+ {
+ var_free_one(v);
+ return OK;
+ }
+ return FAIL;
+}
+
+#if (defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)) || defined(PROTO)
+/*
+ * Delete all "menutrans_" variables.
+ */
+ void
+del_menutrans_vars()
+{
+ int i;
+
+ for (i = 0; i < variables.ga_len; ++i)
+ if (VAR_ENTRY(i).var_name != NULL
+ && STRNCMP(VAR_ENTRY(i).var_name, "menutrans_", 10) == 0)
+ var_free_one(&VAR_ENTRY(i));
+}
+#endif
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+/*
+ * Local string buffer for the next two functions to store a variable name
+ * with its prefix. Allocated in cat_prefix_varname(), freed later in
+ * get_user_var_name().
+ */
+
+static char_u *cat_prefix_varname __ARGS((int prefix, char_u *name));
+
+static char_u *varnamebuf = NULL;
+static int varnamebuflen = 0;
+
+/*
+ * Function to concatenate a prefix and a variable name.
+ */
+ static char_u *
+cat_prefix_varname(prefix, name)
+ int prefix;
+ char_u *name;
+{
+ int len;
+
+ len = (int)STRLEN(name) + 3;
+ if (len > varnamebuflen)
+ {
+ vim_free(varnamebuf);
+ len += 10; /* some additional space */
+ varnamebuf = alloc(len);
+ if (varnamebuf == NULL)
+ {
+ varnamebuflen = 0;
+ return NULL;
+ }
+ varnamebuflen = len;
+ }
+ *varnamebuf = prefix;
+ varnamebuf[1] = ':';
+ STRCPY(varnamebuf + 2, name);
+ return varnamebuf;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of user defined
+ * (global/buffer/window/built-in) variable names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_user_var_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static int gidx;
+ static int bidx;
+ static int widx;
+ static int vidx;
+ char_u *name;
+
+ if (idx == 0)
+ gidx = bidx = widx = vidx = 0;
+ if (gidx < variables.ga_len) /* Global variables */
+ {
+ while ((name = VAR_ENTRY(gidx++).var_name) == NULL
+ && gidx < variables.ga_len)
+ /* skip */;
+ if (name != NULL)
+ {
+ if (STRNCMP("g:", xp->xp_pattern, 2) == 0)
+ return cat_prefix_varname('g', name);
+ else
+ return name;
+ }
+ }
+ if (bidx < curbuf->b_vars.ga_len) /* Current buffer variables */
+ {
+ while ((name = BVAR_ENTRY(bidx++).var_name) == NULL
+ && bidx < curbuf->b_vars.ga_len)
+ /* skip */;
+ if (name != NULL)
+ return cat_prefix_varname('b', name);
+ }
+ if (bidx == curbuf->b_vars.ga_len)
+ {
+ ++bidx;
+ return (char_u *)"b:changedtick";
+ }
+ if (widx < curwin->w_vars.ga_len) /* Current window variables */
+ {
+ while ((name = WVAR_ENTRY(widx++).var_name) == NULL
+ && widx < curwin->w_vars.ga_len)
+ /* skip */;
+ if (name != NULL)
+ return cat_prefix_varname('w', name);
+ }
+ if (vidx < VV_LEN) /* Built-in variables */
+ return cat_prefix_varname('v', (char_u *)vimvars[vidx++].name);
+
+ vim_free(varnamebuf);
+ varnamebuf = NULL;
+ varnamebuflen = 0;
+ return NULL;
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * types for expressions.
+ */
+typedef enum
+{
+ TYPE_UNKNOWN = 0
+ , TYPE_EQUAL /* == */
+ , TYPE_NEQUAL /* != */
+ , TYPE_GREATER /* > */
+ , TYPE_GEQUAL /* >= */
+ , TYPE_SMALLER /* < */
+ , TYPE_SEQUAL /* <= */
+ , TYPE_MATCH /* =~ */
+ , TYPE_NOMATCH /* !~ */
+} exptype_T;
+
+/*
+ * The "evaluate" argument: When FALSE, the argument is only parsed but not
+ * executed. The function may return OK, but the retvar will be of type
+ * VAR_UNKNOWN. The function still returns FAIL for a syntax error.
+ */
+
+/*
+ * Handle zero level expression.
+ * This calls eval1() and handles error message and nextcmd.
+ * Return OK or FAIL.
+ */
+ static int
+eval0(arg, retvar, nextcmd, evaluate)
+ char_u *arg;
+ VAR retvar;
+ char_u **nextcmd;
+ int evaluate;
+{
+ int ret;
+ char_u *p;
+
+ p = skipwhite(arg);
+ ret = eval1(&p, retvar, evaluate);
+ if (ret == FAIL || !ends_excmd(*p))
+ {
+ if (ret != FAIL)
+ clear_var(retvar);
+ /*
+ * Report the invalid expression unless the expression evaluation has
+ * been cancelled due to an aborting error, an interrupt, or an
+ * exception.
+ */
+ if (!aborting())
+ EMSG2(_(e_invexpr2), arg);
+ ret = FAIL;
+ }
+ if (nextcmd != NULL)
+ *nextcmd = check_nextcmd(p);
+
+ return ret;
+}
+
+/*
+ * Handle top level expression:
+ * expr1 ? expr0 : expr0
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval1(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ int result;
+ var var2;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval2(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ if ((*arg)[0] == '?')
+ {
+ result = FALSE;
+ if (evaluate)
+ {
+ if (get_var_number(retvar) != 0)
+ result = TRUE;
+ clear_var(retvar);
+ }
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(*arg + 1);
+ if (eval1(arg, retvar, evaluate && result) == FAIL) /* recursive! */
+ return FAIL;
+
+ /*
+ * Check for the ":".
+ */
+ if ((*arg)[0] != ':')
+ {
+ EMSG(_("E109: Missing ':' after '?'"));
+ if (evaluate && result)
+ clear_var(retvar);
+ return FAIL;
+ }
+
+ /*
+ * Get the third variable.
+ */
+ *arg = skipwhite(*arg + 1);
+ if (eval1(arg, &var2, evaluate && !result) == FAIL) /* recursive! */
+ {
+ if (evaluate && result)
+ clear_var(retvar);
+ return FAIL;
+ }
+ if (evaluate && !result)
+ *retvar = var2;
+ }
+
+ return OK;
+}
+
+/*
+ * Handle first level expression:
+ * expr2 || expr2 || expr2 logical OR
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval2(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ long result;
+ int first;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval3(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ /*
+ * Repeat until there is no following "||".
+ */
+ first = TRUE;
+ result = FALSE;
+ while ((*arg)[0] == '|' && (*arg)[1] == '|')
+ {
+ if (evaluate && first)
+ {
+ if (get_var_number(retvar) != 0)
+ result = TRUE;
+ clear_var(retvar);
+ first = FALSE;
+ }
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(*arg + 2);
+ if (eval3(arg, &var2, evaluate && !result) == FAIL)
+ return FAIL;
+
+ /*
+ * Compute the result.
+ */
+ if (evaluate && !result)
+ {
+ if (get_var_number(&var2) != 0)
+ result = TRUE;
+ clear_var(&var2);
+ }
+ if (evaluate)
+ {
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = result;
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Handle second level expression:
+ * expr3 && expr3 && expr3 logical AND
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval3(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ long result;
+ int first;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval4(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ /*
+ * Repeat until there is no following "&&".
+ */
+ first = TRUE;
+ result = TRUE;
+ while ((*arg)[0] == '&' && (*arg)[1] == '&')
+ {
+ if (evaluate && first)
+ {
+ if (get_var_number(retvar) == 0)
+ result = FALSE;
+ clear_var(retvar);
+ first = FALSE;
+ }
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(*arg + 2);
+ if (eval4(arg, &var2, evaluate && result) == FAIL)
+ return FAIL;
+
+ /*
+ * Compute the result.
+ */
+ if (evaluate && result)
+ {
+ if (get_var_number(&var2) == 0)
+ result = FALSE;
+ clear_var(&var2);
+ }
+ if (evaluate)
+ {
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = result;
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Handle third level expression:
+ * var1 == var2
+ * var1 =~ var2
+ * var1 != var2
+ * var1 !~ var2
+ * var1 > var2
+ * var1 >= var2
+ * var1 < var2
+ * var1 <= var2
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval4(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ char_u *p;
+ int i;
+ exptype_T type = TYPE_UNKNOWN;
+ int len = 2;
+ long n1, n2;
+ char_u *s1, *s2;
+ char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
+ regmatch_T regmatch;
+ int ic;
+ char_u *save_cpo;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval5(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ p = *arg;
+ switch (p[0])
+ {
+ case '=': if (p[1] == '=')
+ type = TYPE_EQUAL;
+ else if (p[1] == '~')
+ type = TYPE_MATCH;
+ break;
+ case '!': if (p[1] == '=')
+ type = TYPE_NEQUAL;
+ else if (p[1] == '~')
+ type = TYPE_NOMATCH;
+ break;
+ case '>': if (p[1] != '=')
+ {
+ type = TYPE_GREATER;
+ len = 1;
+ }
+ else
+ type = TYPE_GEQUAL;
+ break;
+ case '<': if (p[1] != '=')
+ {
+ type = TYPE_SMALLER;
+ len = 1;
+ }
+ else
+ type = TYPE_SEQUAL;
+ break;
+ }
+
+ /*
+ * If there is a comparitive operator, use it.
+ */
+ if (type != TYPE_UNKNOWN)
+ {
+ /* extra question mark appended: ignore case */
+ if (p[len] == '?')
+ {
+ ic = TRUE;
+ ++len;
+ }
+ /* extra '#' appended: match case */
+ else if (p[len] == '#')
+ {
+ ic = FALSE;
+ ++len;
+ }
+ /* nothing appened: use 'ignorecase' */
+ else
+ ic = p_ic;
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(p + len);
+ if (eval5(arg, &var2, evaluate) == FAIL)
+ {
+ clear_var(retvar);
+ return FAIL;
+ }
+
+ if (evaluate)
+ {
+ /*
+ * If one of the two variables is a number, compare as a number.
+ * When using "=~" or "!~", always compare as string.
+ */
+ if ((retvar->var_type == VAR_NUMBER || var2.var_type == VAR_NUMBER)
+ && type != TYPE_MATCH && type != TYPE_NOMATCH)
+ {
+ n1 = get_var_number(retvar);
+ n2 = get_var_number(&var2);
+ switch (type)
+ {
+ case TYPE_EQUAL: n1 = (n1 == n2); break;
+ case TYPE_NEQUAL: n1 = (n1 != n2); break;
+ case TYPE_GREATER: n1 = (n1 > n2); break;
+ case TYPE_GEQUAL: n1 = (n1 >= n2); break;
+ case TYPE_SMALLER: n1 = (n1 < n2); break;
+ case TYPE_SEQUAL: n1 = (n1 <= n2); break;
+ case TYPE_UNKNOWN:
+ case TYPE_MATCH:
+ case TYPE_NOMATCH: break; /* avoid gcc warning */
+ }
+ }
+ else
+ {
+ s1 = get_var_string_buf(retvar, buf1);
+ s2 = get_var_string_buf(&var2, buf2);
+ if (type != TYPE_MATCH && type != TYPE_NOMATCH)
+ i = ic ? MB_STRICMP(s1, s2) : STRCMP(s1, s2);
+ else
+ i = 0;
+ n1 = FALSE;
+ switch (type)
+ {
+ case TYPE_EQUAL: n1 = (i == 0); break;
+ case TYPE_NEQUAL: n1 = (i != 0); break;
+ case TYPE_GREATER: n1 = (i > 0); break;
+ case TYPE_GEQUAL: n1 = (i >= 0); break;
+ case TYPE_SMALLER: n1 = (i < 0); break;
+ case TYPE_SEQUAL: n1 = (i <= 0); break;
+
+ case TYPE_MATCH:
+ case TYPE_NOMATCH:
+ /* avoid 'l' flag in 'cpoptions' */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+ regmatch.regprog = vim_regcomp(s2,
+ RE_MAGIC + RE_STRING);
+ regmatch.rm_ic = ic;
+ if (regmatch.regprog != NULL)
+ {
+ n1 = vim_regexec_nl(&regmatch, s1, (colnr_T)0);
+ vim_free(regmatch.regprog);
+ if (type == TYPE_NOMATCH)
+ n1 = !n1;
+ }
+ p_cpo = save_cpo;
+ break;
+
+ case TYPE_UNKNOWN: break; /* avoid gcc warning */
+ }
+ }
+ clear_var(retvar);
+ clear_var(&var2);
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = n1;
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Handle fourth level expression:
+ * + number addition
+ * - number subtraction
+ * . string concatenation
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval5(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ int op;
+ long n1, n2;
+ char_u *s1, *s2;
+ char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
+ char_u *p;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval6(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ /*
+ * Repeat computing, until no '+', '-' or '.' is following.
+ */
+ for (;;)
+ {
+ op = **arg;
+ if (op != '+' && op != '-' && op != '.')
+ break;
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(*arg + 1);
+ if (eval6(arg, &var2, evaluate) == FAIL)
+ {
+ clear_var(retvar);
+ return FAIL;
+ }
+
+ if (evaluate)
+ {
+ /*
+ * Compute the result.
+ */
+ if (op == '.')
+ {
+ s1 = get_var_string_buf(retvar, buf1);
+ s2 = get_var_string_buf(&var2, buf2);
+ op = (int)STRLEN(s1);
+ p = alloc((unsigned)(op + STRLEN(s2) + 1));
+ if (p != NULL)
+ {
+ STRCPY(p, s1);
+ STRCPY(p + op, s2);
+ }
+ clear_var(retvar);
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = p;
+ }
+ else
+ {
+ n1 = get_var_number(retvar);
+ n2 = get_var_number(&var2);
+ clear_var(retvar);
+ if (op == '+')
+ n1 = n1 + n2;
+ else
+ n1 = n1 - n2;
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = n1;
+ }
+ clear_var(&var2);
+ }
+ }
+ return OK;
+}
+
+/*
+ * Handle fifth level expression:
+ * * number multiplication
+ * / number division
+ * % number modulo
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval6(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ int op;
+ long n1, n2;
+
+ /*
+ * Get the first variable.
+ */
+ if (eval7(arg, retvar, evaluate) == FAIL)
+ return FAIL;
+
+ /*
+ * Repeat computing, until no '*', '/' or '%' is following.
+ */
+ for (;;)
+ {
+ op = **arg;
+ if (op != '*' && op != '/' && op != '%')
+ break;
+
+ if (evaluate)
+ {
+ n1 = get_var_number(retvar);
+ clear_var(retvar);
+ }
+ else
+ n1 = 0;
+
+ /*
+ * Get the second variable.
+ */
+ *arg = skipwhite(*arg + 1);
+ if (eval7(arg, &var2, evaluate) == FAIL)
+ return FAIL;
+
+ if (evaluate)
+ {
+ n2 = get_var_number(&var2);
+ clear_var(&var2);
+
+ /*
+ * Compute the result.
+ */
+ if (op == '*')
+ n1 = n1 * n2;
+ else if (op == '/')
+ {
+ if (n2 == 0) /* give an error message? */
+ n1 = 0x7fffffffL;
+ else
+ n1 = n1 / n2;
+ }
+ else
+ {
+ if (n2 == 0) /* give an error message? */
+ n1 = 0;
+ else
+ n1 = n1 % n2;
+ }
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = n1;
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Handle sixth level expression:
+ * number number constant
+ * "string" string contstant
+ * 'string' literal string contstant
+ * &option-name option value
+ * @r register contents
+ * identifier variable value
+ * function() function call
+ * $VAR environment variable
+ * (expression) nested expression
+ *
+ * Also handle:
+ * ! in front logical NOT
+ * - in front unary minus
+ * + in front unary plus (ignored)
+ * trailing [] subscript in String
+ *
+ * "arg" must point to the first non-white of the expression.
+ * "arg" is advanced to the next non-white after the recognized expression.
+ *
+ * Return OK or FAIL.
+ */
+ static int
+eval7(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ var var2;
+ long n;
+ int len;
+ char_u *s;
+ int val;
+ char_u *start_leader, *end_leader;
+ int ret = OK;
+ char_u *alias;
+
+ /*
+ * Initialise variable so that clear_var() can't mistake this for a string
+ * and free a string that isn't there.
+ */
+ retvar->var_type = VAR_UNKNOWN;
+
+ /*
+ * Skip '!' and '-' characters. They are handled later.
+ */
+ start_leader = *arg;
+ while (**arg == '!' || **arg == '-' || **arg == '+')
+ *arg = skipwhite(*arg + 1);
+ end_leader = *arg;
+
+ switch (**arg)
+ {
+ /*
+ * Number constant.
+ */
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ vim_str2nr(*arg, NULL, &len, TRUE, TRUE, &n, NULL);
+ *arg += len;
+ if (evaluate)
+ {
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = n;
+ }
+ break;
+
+ /*
+ * String constant: "string".
+ */
+ case '"': ret = get_string_var(arg, retvar, evaluate);
+ break;
+
+ /*
+ * Literal string constant: 'string'.
+ */
+ case '\'': ret = get_lit_string_var(arg, retvar, evaluate);
+ break;
+
+ /*
+ * Option value: &name
+ */
+ case '&': ret = get_option_var(arg, retvar, evaluate);
+ break;
+
+ /*
+ * Environment variable: $VAR.
+ */
+ case '$': ret = get_env_var(arg, retvar, evaluate);
+ break;
+
+ /*
+ * Register contents: @r.
+ */
+ case '@': ++*arg;
+ if (evaluate)
+ {
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = get_reg_contents(**arg, FALSE);
+ }
+ if (**arg != NUL)
+ ++*arg;
+ break;
+
+ /*
+ * nested expression: (expression).
+ */
+ case '(': *arg = skipwhite(*arg + 1);
+ ret = eval1(arg, retvar, evaluate); /* recursive! */
+ if (**arg == ')')
+ ++*arg;
+ else if (ret == OK)
+ {
+ EMSG(_("E110: Missing ')'"));
+ clear_var(retvar);
+ ret = FAIL;
+ }
+ break;
+
+ /*
+ * Must be a variable or function name then.
+ */
+ default: s = *arg;
+ len = get_func_len(arg, &alias, evaluate);
+ if (alias != NULL)
+ s = alias;
+
+ if (len == 0)
+ ret = FAIL;
+ else
+ {
+ if (**arg == '(') /* recursive! */
+ {
+ ret = get_func_var(s, len, retvar, arg,
+ curwin->w_cursor.lnum, curwin->w_cursor.lnum,
+ &len, evaluate);
+ /* Stop the expression evaluation when immediately
+ * aborting on error, or when an interrupt occurred or
+ * an exception was thrown but not caught. */
+ if (aborting())
+ {
+ if (ret == OK)
+ clear_var(retvar);
+ ret = FAIL;
+ }
+ }
+ else if (evaluate)
+ ret = get_var_var(s, len, retvar);
+ }
+
+ if (alias != NULL)
+ vim_free(alias);
+
+ break;
+ }
+ *arg = skipwhite(*arg);
+
+ /*
+ * Handle expr[expr] subscript.
+ */
+ if (**arg == '[' && ret == OK)
+ {
+ /*
+ * Get the variable from inside the [].
+ */
+ *arg = skipwhite(*arg + 1);
+ if (eval1(arg, &var2, evaluate) == FAIL) /* recursive! */
+ {
+ clear_var(retvar);
+ return FAIL;
+ }
+
+ /* Check for the ']'. */
+ if (**arg != ']')
+ {
+ EMSG(_("E111: Missing ']'"));
+ clear_var(retvar);
+ clear_var(&var2);
+ return FAIL;
+ }
+
+ if (evaluate)
+ {
+ n = get_var_number(&var2);
+ clear_var(&var2);
+
+ /*
+ * The resulting variable is a string of a single character.
+ * If the index is too big or negative, the result is empty.
+ */
+ s = get_var_string(retvar);
+ if (n >= (long)STRLEN(s) || n < 0)
+ s = NULL;
+ else
+ s = vim_strnsave(s + n, 1);
+ clear_var(retvar);
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = s;
+ }
+ *arg = skipwhite(*arg + 1); /* skip the ']' */
+ }
+
+ /*
+ * Apply logical NOT and unary '-', from right to left, ignore '+'.
+ */
+ if (ret == OK && evaluate && end_leader > start_leader)
+ {
+ val = get_var_number(retvar);
+ while (end_leader > start_leader)
+ {
+ --end_leader;
+ if (*end_leader == '!')
+ val = !val;
+ else if (*end_leader == '-')
+ val = -val;
+ }
+ clear_var(retvar);
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = val;
+ }
+
+ return ret;
+}
+
+/*
+ * Get an option value.
+ * "arg" points to the '&' or '+' before the option name.
+ * "arg" is advanced to character after the option name.
+ * Return OK or FAIL.
+ */
+ static int
+get_option_var(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar; /* when NULL, only check if option exists */
+ int evaluate;
+{
+ char_u *option_end;
+ long numval;
+ char_u *stringval;
+ int opt_type;
+ int c;
+ int working = (**arg == '+'); /* has("+option") */
+ int ret = OK;
+ int opt_flags;
+
+ /*
+ * Isolate the option name and find its value.
+ */
+ option_end = find_option_end(arg, &opt_flags);
+ if (option_end == NULL)
+ {
+ if (retvar != NULL)
+ EMSG2(_("E112: Option name missing: %s"), *arg);
+ return FAIL;
+ }
+
+ if (!evaluate)
+ {
+ *arg = option_end;
+ return OK;
+ }
+
+ c = *option_end;
+ *option_end = NUL;
+ opt_type = get_option_value(*arg, &numval,
+ retvar == NULL ? NULL : &stringval, opt_flags);
+
+ if (opt_type == -3) /* invalid name */
+ {
+ if (retvar != NULL)
+ EMSG2(_("E113: Unknown option: %s"), *arg);
+ ret = FAIL;
+ }
+ else if (retvar != NULL)
+ {
+ if (opt_type == -2) /* hidden string option */
+ {
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+ }
+ else if (opt_type == -1) /* hidden number option */
+ {
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = 0;
+ }
+ else if (opt_type == 1) /* number option */
+ {
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = numval;
+ }
+ else /* string option */
+ {
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = stringval;
+ }
+ }
+ else if (working && (opt_type == -2 || opt_type == -1))
+ ret = FAIL;
+
+ *option_end = c; /* put back for error messages */
+ *arg = option_end;
+
+ return ret;
+}
+
+/*
+ * Allocate a variable for a string constant.
+ * Return OK or FAIL.
+ */
+ static int
+get_string_var(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ char_u *p;
+ char_u *name;
+ int i;
+ int extra = 0;
+
+ /*
+ * Find the end of the string, skipping backslashed characters.
+ */
+ for (p = *arg + 1; *p && *p != '"'; ++p)
+ {
+ if (*p == '\\' && p[1] != NUL)
+ {
+ ++p;
+ /* A "\<x>" form occupies at least 4 characters, and produces up
+ * to 6 characters: reserve space for 2 extra */
+ if (*p == '<')
+ extra += 2;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+
+ if (*p != '"')
+ {
+ EMSG2(_("E114: Missing quote: %s"), *arg);
+ return FAIL;
+ }
+
+ /* If only parsing, set *arg and return here */
+ if (!evaluate)
+ {
+ *arg = p + 1;
+ return OK;
+ }
+
+ /*
+ * Copy the string into allocated memory, handling backslashed
+ * characters.
+ */
+ name = alloc((unsigned)(p - *arg + extra));
+ if (name == NULL)
+ return FAIL;
+
+ i = 0;
+ for (p = *arg + 1; *p && *p != '"'; ++p)
+ {
+ if (*p == '\\')
+ {
+ switch (*++p)
+ {
+ case 'b': name[i++] = BS; break;
+ case 'e': name[i++] = ESC; break;
+ case 'f': name[i++] = FF; break;
+ case 'n': name[i++] = NL; break;
+ case 'r': name[i++] = CAR; break;
+ case 't': name[i++] = TAB; break;
+
+ case 'X': /* hex: "\x1", "\x12" */
+ case 'x':
+ case 'u': /* Unicode: "\u0023" */
+ case 'U':
+ if (vim_isxdigit(p[1]))
+ {
+ int n, nr;
+ int c = toupper(*p);
+
+ if (c == 'X')
+ n = 2;
+ else
+ n = 4;
+ nr = 0;
+ while (--n >= 0 && vim_isxdigit(p[1]))
+ {
+ ++p;
+ nr = (nr << 4) + hex2nr(*p);
+ }
+#ifdef FEAT_MBYTE
+ /* For "\u" store the number according to
+ * 'encoding'. */
+ if (c != 'X')
+ i += (*mb_char2bytes)(nr, name + i);
+ else
+#endif
+ name[i++] = nr;
+ }
+ else
+ name[i++] = *p;
+ break;
+
+ /* octal: "\1", "\12", "\123" */
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7': name[i] = *p - '0';
+ if (p[1] >= '0' && p[1] <= '7')
+ {
+ ++p;
+ name[i] = (name[i] << 3) + *p - '0';
+ if (p[1] >= '0' && p[1] <= '7')
+ {
+ ++p;
+ name[i] = (name[i] << 3) + *p - '0';
+ }
+ }
+ ++i;
+ break;
+
+ /* Special key, e.g.: "\<C-W>" */
+ case '<': extra = trans_special(&p, name + i, TRUE);
+ if (extra != 0)
+ {
+ i += extra;
+ --p;
+ break;
+ }
+ /* FALLTHROUGH */
+
+ default: name[i++] = *p;
+ break;
+ }
+ }
+ else
+ name[i++] = *p;
+
+#ifdef FEAT_MBYTE
+ /* For a multi-byte character copy the bytes after the first one. */
+ if (has_mbyte)
+ {
+ int l = (*mb_ptr2len_check)(p);
+
+ while (--l > 0)
+ name[i++] = *++p;
+ }
+#endif
+ }
+ name[i] = NUL;
+ *arg = p + 1;
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = name;
+
+ return OK;
+}
+
+/*
+ * Allocate a variable for an backtick-string constant.
+ * Return OK or FAIL.
+ */
+ static int
+get_lit_string_var(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ char_u *p;
+ char_u *name;
+
+ /*
+ * Find the end of the string.
+ */
+ p = vim_strchr(*arg + 1, '\'');
+ if (p == NULL)
+ {
+ EMSG2(_("E115: Missing quote: %s"), *arg);
+ return FAIL;
+ }
+
+ if (evaluate)
+ {
+ /*
+ * Copy the string into allocated memory.
+ */
+ name = vim_strnsave(*arg + 1, (int)(p - (*arg + 1)));
+ if (name == NULL)
+ return FAIL;
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = name;
+ }
+
+ *arg = p + 1;
+
+ return OK;
+}
+
+/*
+ * Get the value of an environment variable.
+ * "arg" is pointing to the '$'. It is advanced to after the name.
+ * If the environment variable was not set, silently assume it is empty.
+ * Always return OK.
+ */
+ static int
+get_env_var(arg, retvar, evaluate)
+ char_u **arg;
+ VAR retvar;
+ int evaluate;
+{
+ char_u *string = NULL;
+ int len;
+ int cc;
+ char_u *name;
+
+ ++*arg;
+ name = *arg;
+ len = get_env_len(arg);
+ if (evaluate)
+ {
+ if (len != 0)
+ {
+ cc = name[len];
+ name[len] = NUL;
+ /* first try mch_getenv(), fast for normal environment vars */
+ string = mch_getenv(name);
+ if (string != NULL && *string != NUL)
+ string = vim_strsave(string);
+ else
+ {
+ /* next try expanding things like $VIM and ${HOME} */
+ string = expand_env_save(name - 1);
+ if (string != NULL && *string == '$')
+ {
+ vim_free(string);
+ string = NULL;
+ }
+ }
+ name[len] = cc;
+ }
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = string;
+ }
+
+ return OK;
+}
+
+/*
+ * Array with names and number of arguments of all internal functions
+ * MUST BE KEPT SORTED IN strcmp() ORDER FOR BINARY SEARCH!
+ */
+static struct fst
+{
+ char *f_name; /* function name */
+ char f_min_argc; /* minimal number of arguments */
+ char f_max_argc; /* maximal number of arguments */
+ void (*f_func) __ARGS((VAR args, VAR rvar)); /* impl. function */
+} functions[] =
+{
+ {"append", 2, 2, f_append},
+ {"argc", 0, 0, f_argc},
+ {"argidx", 0, 0, f_argidx},
+ {"argv", 1, 1, f_argv},
+ {"browse", 4, 4, f_browse},
+ {"bufexists", 1, 1, f_bufexists},
+ {"buffer_exists", 1, 1, f_bufexists}, /* obsolete */
+ {"buffer_name", 1, 1, f_bufname}, /* obsolete */
+ {"buffer_number", 1, 1, f_bufnr}, /* obsolete */
+ {"buflisted", 1, 1, f_buflisted},
+ {"bufloaded", 1, 1, f_bufloaded},
+ {"bufname", 1, 1, f_bufname},
+ {"bufnr", 1, 1, f_bufnr},
+ {"bufwinnr", 1, 1, f_bufwinnr},
+ {"byte2line", 1, 1, f_byte2line},
+ {"char2nr", 1, 1, f_char2nr},
+ {"cindent", 1, 1, f_cindent},
+ {"col", 1, 1, f_col},
+ {"confirm", 1, 4, f_confirm},
+ {"cscope_connection",0,3, f_cscope_connection},
+ {"cursor", 2, 2, f_cursor},
+ {"delete", 1, 1, f_delete},
+ {"did_filetype", 0, 0, f_did_filetype},
+ {"escape", 2, 2, f_escape},
+ {"eventhandler", 0, 0, f_eventhandler},
+ {"executable", 1, 1, f_executable},
+ {"exists", 1, 1, f_exists},
+ {"expand", 1, 2, f_expand},
+ {"file_readable", 1, 1, f_filereadable}, /* obsolete */
+ {"filereadable", 1, 1, f_filereadable},
+ {"filewritable", 1, 1, f_filewritable},
+ {"fnamemodify", 2, 2, f_fnamemodify},
+ {"foldclosed", 1, 1, f_foldclosed},
+ {"foldclosedend", 1, 1, f_foldclosedend},
+ {"foldlevel", 1, 1, f_foldlevel},
+ {"foldtext", 0, 0, f_foldtext},
+ {"foreground", 0, 0, f_foreground},
+ {"getbufvar", 2, 2, f_getbufvar},
+ {"getchar", 0, 1, f_getchar},
+ {"getcharmod", 0, 0, f_getcharmod},
+ {"getcmdline", 0, 0, f_getcmdline},
+ {"getcmdpos", 0, 0, f_getcmdpos},
+ {"getcwd", 0, 0, f_getcwd},
+ {"getfsize", 1, 1, f_getfsize},
+ {"getftime", 1, 1, f_getftime},
+ {"getline", 1, 1, f_getline},
+ {"getreg", 0, 1, f_getreg},
+ {"getregtype", 0, 1, f_getregtype},
+ {"getwinposx", 0, 0, f_getwinposx},
+ {"getwinposy", 0, 0, f_getwinposy},
+ {"getwinvar", 2, 2, f_getwinvar},
+ {"glob", 1, 1, f_glob},
+ {"globpath", 2, 2, f_globpath},
+ {"has", 1, 1, f_has},
+ {"hasmapto", 1, 2, f_hasmapto},
+ {"highlightID", 1, 1, f_hlID}, /* obsolete */
+ {"highlight_exists",1, 1, f_hlexists}, /* obsolete */
+ {"histadd", 2, 2, f_histadd},
+ {"histdel", 1, 2, f_histdel},
+ {"histget", 1, 2, f_histget},
+ {"histnr", 1, 1, f_histnr},
+ {"hlID", 1, 1, f_hlID},
+ {"hlexists", 1, 1, f_hlexists},
+ {"hostname", 0, 0, f_hostname},
+ {"iconv", 3, 3, f_iconv},
+ {"indent", 1, 1, f_indent},
+ {"input", 1, 2, f_input},
+ {"inputdialog", 1, 3, f_inputdialog},
+ {"inputrestore", 0, 0, f_inputrestore},
+ {"inputsave", 0, 0, f_inputsave},
+ {"inputsecret", 1, 2, f_inputsecret},
+ {"isdirectory", 1, 1, f_isdirectory},
+ {"last_buffer_nr", 0, 0, f_last_buffer_nr},/* obsolete */
+ {"libcall", 3, 3, f_libcall},
+ {"libcallnr", 3, 3, f_libcallnr},
+ {"line", 1, 1, f_line},
+ {"line2byte", 1, 1, f_line2byte},
+ {"lispindent", 1, 1, f_lispindent},
+ {"localtime", 0, 0, f_localtime},
+ {"maparg", 1, 2, f_maparg},
+ {"mapcheck", 1, 2, f_mapcheck},
+ {"match", 2, 3, f_match},
+ {"matchend", 2, 3, f_matchend},
+ {"matchstr", 2, 3, f_matchstr},
+ {"mode", 0, 0, f_mode},
+ {"nextnonblank", 1, 1, f_nextnonblank},
+ {"nr2char", 1, 1, f_nr2char},
+ {"prevnonblank", 1, 1, f_prevnonblank},
+ {"remote_expr", 2, 3, f_remote_expr},
+ {"remote_foreground", 1, 1, f_remote_foreground},
+ {"remote_peek", 1, 2, f_remote_peek},
+ {"remote_read", 1, 1, f_remote_read},
+ {"remote_send", 2, 3, f_remote_send},
+ {"rename", 2, 2, f_rename},
+ {"resolve", 1, 1, f_resolve},
+ {"search", 1, 2, f_search},
+ {"searchpair", 3, 5, f_searchpair},
+ {"server2client", 2, 2, f_server2client},
+ {"serverlist", 0, 0, f_serverlist},
+ {"setbufvar", 3, 3, f_setbufvar},
+ {"setcmdpos", 1, 1, f_setcmdpos},
+ {"setline", 2, 2, f_setline},
+ {"setreg", 2, 3, f_setreg},
+ {"setwinvar", 3, 3, f_setwinvar},
+ {"simplify", 1, 1, f_simplify},
+#ifdef HAVE_STRFTIME
+ {"strftime", 1, 2, f_strftime},
+#endif
+ {"stridx", 2, 2, f_stridx},
+ {"strlen", 1, 1, f_strlen},
+ {"strpart", 2, 3, f_strpart},
+ {"strridx", 2, 2, f_strridx},
+ {"strtrans", 1, 1, f_strtrans},
+ {"submatch", 1, 1, f_submatch},
+ {"substitute", 4, 4, f_substitute},
+ {"synID", 3, 3, f_synID},
+ {"synIDattr", 2, 3, f_synIDattr},
+ {"synIDtrans", 1, 1, f_synIDtrans},
+ {"system", 1, 1, f_system},
+ {"tempname", 0, 0, f_tempname},
+ {"tolower", 1, 1, f_tolower},
+ {"toupper", 1, 1, f_toupper},
+ {"type", 1, 1, f_type},
+ {"virtcol", 1, 1, f_virtcol},
+ {"visualmode", 0, 1, f_visualmode},
+ {"winbufnr", 1, 1, f_winbufnr},
+ {"wincol", 0, 0, f_wincol},
+ {"winheight", 1, 1, f_winheight},
+ {"winline", 0, 0, f_winline},
+ {"winnr", 0, 0, f_winnr},
+ {"winrestcmd", 0, 0, f_winrestcmd},
+ {"winwidth", 1, 1, f_winwidth},
+};
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of internal
+ * or user defined function names.
+ */
+ char_u *
+get_function_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static int intidx = -1;
+ char_u *name;
+
+ if (idx == 0)
+ intidx = -1;
+ if (intidx < 0)
+ {
+ name = get_user_func_name(xp, idx);
+ if (name != NULL)
+ return name;
+ }
+ if (++intidx < (int)(sizeof(functions) / sizeof(struct fst)))
+ {
+ STRCPY(IObuff, functions[intidx].f_name);
+ STRCAT(IObuff, "(");
+ if (functions[intidx].f_max_argc == 0)
+ STRCAT(IObuff, ")");
+ return IObuff;
+ }
+
+ return NULL;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of internal or
+ * user defined variable or function names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_expr_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static int intidx = -1;
+ char_u *name;
+
+ if (idx == 0)
+ intidx = -1;
+ if (intidx < 0)
+ {
+ name = get_function_name(xp, idx);
+ if (name != NULL)
+ return name;
+ }
+ return get_user_var_name(xp, ++intidx);
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * Find internal function in table above.
+ * Return index, or -1 if not found
+ */
+ static int
+find_internal_func(name)
+ char_u *name; /* name of the function */
+{
+ int first = 0;
+ int last = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
+ int cmp;
+ int x;
+
+ /*
+ * Find the function name in the table. Binary search.
+ */
+ while (first <= last)
+ {
+ x = first + ((unsigned)(last - first) >> 1);
+ cmp = STRCMP(name, functions[x].f_name);
+ if (cmp < 0)
+ last = x - 1;
+ else if (cmp > 0)
+ first = x + 1;
+ else
+ return x;
+ }
+ return -1;
+}
+
+/*
+ * Allocate a variable for the result of a function.
+ * Return OK or FAIL.
+ */
+ static int
+get_func_var(name, len, retvar, arg, firstline, lastline, doesrange, evaluate)
+ char_u *name; /* name of the function */
+ int len; /* length of "name" */
+ VAR retvar;
+ char_u **arg; /* argument, pointing to the '(' */
+ linenr_T firstline; /* first line of range */
+ linenr_T lastline; /* last line of range */
+ int *doesrange; /* return: function handled range */
+ int evaluate;
+{
+ char_u *argp;
+ int ret = OK;
+#define MAX_FUNC_ARGS 20
+ var argvars[MAX_FUNC_ARGS]; /* vars for arguments */
+ int argcount = 0; /* number of arguments found */
+
+ /*
+ * Get the arguments.
+ */
+ argp = *arg;
+ while (argcount < MAX_FUNC_ARGS)
+ {
+ argp = skipwhite(argp + 1); /* skip the '(' or ',' */
+ if (*argp == ')' || *argp == ',' || *argp == NUL)
+ break;
+ argvars[argcount].var_name = NULL; /* the name is not stored */
+ if (eval1(&argp, &argvars[argcount], evaluate) == FAIL)
+ {
+ ret = FAIL;
+ break;
+ }
+ ++argcount;
+ if (*argp != ',')
+ break;
+ }
+ if (*argp == ')')
+ ++argp;
+ else
+ ret = FAIL;
+
+ if (ret == OK)
+ ret = call_func(name, len, retvar, argcount, argvars,
+ firstline, lastline, doesrange, evaluate);
+ else if (!aborting())
+ EMSG2(_("E116: Invalid arguments for function %s"), name);
+
+ while (--argcount >= 0)
+ clear_var(&argvars[argcount]);
+
+ *arg = skipwhite(argp);
+ return ret;
+}
+
+
+/*
+ * Call a function with its resolved parameters
+ * Return OK or FAIL.
+ */
+ static int
+call_func(name, len, retvar, argcount, argvars, firstline, lastline,
+ doesrange, evaluate)
+ char_u *name; /* name of the function */
+ int len; /* length of "name" */
+ VAR retvar; /* return value goes here */
+ int argcount; /* number of "argvars" */
+ VAR argvars; /* vars for arguments */
+ linenr_T firstline; /* first line of range */
+ linenr_T lastline; /* last line of range */
+ int *doesrange; /* return: function handled range */
+ int evaluate;
+{
+ int ret = FAIL;
+ static char *errors[] =
+ {N_("E117: Unknown function: %s"),
+ N_("E118: Too many arguments for function: %s"),
+ N_("E119: Not enough arguments for function: %s"),
+ N_("E120: Using <SID> not in a script context: %s"),
+ };
+#define ERROR_UNKNOWN 0
+#define ERROR_TOOMANY 1
+#define ERROR_TOOFEW 2
+#define ERROR_SCRIPT 3
+#define ERROR_NONE 4
+#define ERROR_OTHER 5
+ int error = ERROR_NONE;
+ int i;
+ int llen;
+ ufunc_T *fp;
+ int cc;
+#define FLEN_FIXED 40
+ char_u fname_buf[FLEN_FIXED + 1];
+ char_u *fname;
+
+ /*
+ * In a script change <SID>name() and s:name() to K_SNR 123_name().
+ * Change <SNR>123_name() to K_SNR 123_name().
+ * Use fname_buf[] when it fits, otherwise allocate memory (slow).
+ */
+ cc = name[len];
+ name[len] = NUL;
+ llen = eval_fname_script(name);
+ if (llen > 0)
+ {
+ fname_buf[0] = K_SPECIAL;
+ fname_buf[1] = KS_EXTRA;
+ fname_buf[2] = (int)KE_SNR;
+ i = 3;
+ if (eval_fname_sid(name)) /* "<SID>" or "s:" */
+ {
+ if (current_SID <= 0)
+ error = ERROR_SCRIPT;
+ else
+ {
+ sprintf((char *)fname_buf + 3, "%ld_", (long)current_SID);
+ i = (int)STRLEN(fname_buf);
+ }
+ }
+ if (i + STRLEN(name + llen) < FLEN_FIXED)
+ {
+ STRCPY(fname_buf + i, name + llen);
+ fname = fname_buf;
+ }
+ else
+ {
+ fname = alloc((unsigned)(i + STRLEN(name + llen) + 1));
+ if (fname == NULL)
+ error = ERROR_OTHER;
+ else
+ {
+ mch_memmove(fname, fname_buf, (size_t)i);
+ STRCPY(fname + i, name + llen);
+ }
+ }
+ }
+ else
+ fname = name;
+
+ *doesrange = FALSE;
+
+
+ /* execute the function if no errors detected and executing */
+ if (evaluate && error == ERROR_NONE)
+ {
+ retvar->var_type = VAR_NUMBER; /* default is number retvar */
+ error = ERROR_UNKNOWN;
+
+ if (!ASCII_ISLOWER(fname[0]))
+ {
+ /*
+ * User defined function.
+ */
+ fp = find_func(fname);
+#ifdef FEAT_AUTOCMD
+ if (fp == NULL && apply_autocmds(EVENT_FUNCUNDEFINED,
+ fname, fname, TRUE, NULL)
+#ifdef FEAT_EVAL
+ && !aborting()
+#endif
+ )
+ {
+ /* executed an autocommand, search for function again */
+ fp = find_func(fname);
+ }
+#endif
+ if (fp != NULL)
+ {
+ if (fp->flags & FC_RANGE)
+ *doesrange = TRUE;
+ if (argcount < fp->args.ga_len)
+ error = ERROR_TOOFEW;
+ else if (!fp->varargs && argcount > fp->args.ga_len)
+ error = ERROR_TOOMANY;
+ else
+ {
+ /*
+ * Call the user function.
+ * Save and restore search patterns, script variables and
+ * redo buffer.
+ */
+ save_search_patterns();
+ saveRedobuff();
+ ++fp->calls;
+ call_user_func(fp, argcount, argvars, retvar,
+ firstline, lastline);
+ --fp->calls;
+ restoreRedobuff();
+ restore_search_patterns();
+ error = ERROR_NONE;
+ }
+ }
+ }
+ else
+ {
+ /*
+ * Find the function name in the table, call its implementation.
+ */
+ i = find_internal_func(fname);
+ if (i >= 0)
+ {
+ if (argcount < functions[i].f_min_argc)
+ error = ERROR_TOOFEW;
+ else if (argcount > functions[i].f_max_argc)
+ error = ERROR_TOOMANY;
+ else
+ {
+ argvars[argcount].var_type = VAR_UNKNOWN;
+ functions[i].f_func(argvars, retvar);
+ error = ERROR_NONE;
+ }
+ }
+ }
+ /*
+ * The function call (or "FuncUndefined" autocommand sequence) might
+ * have been aborted by an error, an interrupt, or an explicitly thrown
+ * exception that has not been caught so far. This situation can be
+ * tested for by calling aborting(). For an error in an internal
+ * function or for the "E132" error in call_user_func(), however, the
+ * throw point at which the "force_abort" flag (temporarily reset by
+ * emsg()) is normally updated has not been reached yet. We need to
+ * update that flag first to make aborting() reliable.
+ */
+ update_force_abort();
+ }
+ if (error == ERROR_NONE)
+ ret = OK;
+
+ /*
+ * Report an error unless the argument evaluation or function call has been
+ * cancelled due to an aborting error, an interrupt, or an exception.
+ */
+ if (error < ERROR_NONE && !aborting())
+ EMSG2((char_u *)_(errors[error]), name);
+
+ name[len] = cc;
+ if (fname != name && fname != fname_buf)
+ vim_free(fname);
+
+ return ret;
+}
+
+/*********************************************
+ * Implementation of the built-in functions
+ */
+
+/*
+ * "append(lnum, string)" function
+ */
+ static void
+f_append(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ long lnum;
+
+ lnum = get_var_lnum(argvars);
+ retvar->var_val.var_number = 1; /* Default: Failed */
+
+ if (lnum >= 0
+ && lnum <= curbuf->b_ml.ml_line_count
+ && u_save(lnum, lnum + 1) == OK)
+ {
+ ml_append(lnum, get_var_string(&argvars[1]), (colnr_T)0, FALSE);
+ if (curwin->w_cursor.lnum > lnum)
+ ++curwin->w_cursor.lnum;
+ appended_lines_mark(lnum, 1L);
+ retvar->var_val.var_number = 0;
+ }
+}
+
+/*
+ * "argc()" function
+ */
+/* ARGSUSED */
+ static void
+f_argc(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = ARGCOUNT;
+}
+
+/*
+ * "argidx()" function
+ */
+/* ARGSUSED */
+ static void
+f_argidx(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = curwin->w_arg_idx;
+}
+
+/*
+ * "argv(nr)" function
+ */
+ static void
+f_argv(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int idx;
+
+ idx = get_var_number(&argvars[0]);
+ if (idx >= 0 && idx < ARGCOUNT)
+ retvar->var_val.var_string = vim_strsave(alist_name(&ARGLIST[idx]));
+ else
+ retvar->var_val.var_string = NULL;
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "browse(save, title, initdir, default)" function
+ */
+/* ARGSUSED */
+ static void
+f_browse(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_BROWSE
+ int save;
+ char_u *title;
+ char_u *initdir;
+ char_u *defname;
+ char_u buf[NUMBUFLEN];
+ char_u buf2[NUMBUFLEN];
+
+ save = get_var_number(&argvars[0]);
+ title = get_var_string(&argvars[1]);
+ initdir = get_var_string_buf(&argvars[2], buf);
+ defname = get_var_string_buf(&argvars[3], buf2);
+
+ retvar->var_val.var_string =
+ do_browse(save, title, defname, NULL, initdir, NULL, curbuf);
+#else
+ retvar->var_val.var_string = NULL;
+#endif
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * Find a buffer by number or exact name.
+ */
+ static buf_T *
+find_buffer(avar)
+ VAR avar;
+{
+ buf_T *buf = NULL;
+ char_u *name;
+
+ if (avar->var_type == VAR_NUMBER)
+ buf = buflist_findnr((int)avar->var_val.var_number);
+ else if (avar->var_val.var_string != NULL)
+ {
+ /* First make the name into a full path name */
+ name = FullName_save(avar->var_val.var_string,
+#ifdef UNIX
+ TRUE /* force expansion, get rid of symbolic links */
+#else
+ FALSE
+#endif
+ );
+ if (name != NULL)
+ {
+ buf = buflist_findname(name);
+ vim_free(name);
+ }
+ }
+ return buf;
+}
+
+/*
+ * "bufexists(expr)" function
+ */
+ static void
+f_bufexists(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = (find_buffer(&argvars[0]) != NULL);
+}
+
+/*
+ * "buflisted(expr)" function
+ */
+ static void
+f_buflisted(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+
+ buf = find_buffer(&argvars[0]);
+ retvar->var_val.var_number = (buf != NULL && buf->b_p_bl);
+}
+
+/*
+ * "bufloaded(expr)" function
+ */
+ static void
+f_bufloaded(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+
+ buf = find_buffer(&argvars[0]);
+ retvar->var_val.var_number = (buf != NULL && buf->b_ml.ml_mfp != NULL);
+}
+
+/*
+ * Get buffer by number or pattern.
+ */
+ static buf_T *
+get_buf_var(avar)
+ VAR avar;
+{
+ char_u *name = avar->var_val.var_string;
+ int save_magic;
+ char_u *save_cpo;
+ buf_T *buf;
+
+ if (avar->var_type == VAR_NUMBER)
+ return buflist_findnr((int)avar->var_val.var_number);
+ if (name == NULL || *name == NUL)
+ return curbuf;
+ if (name[0] == '$' && name[1] == NUL)
+ return lastbuf;
+
+ /* Ignore 'magic' and 'cpoptions' here to make scripts portable */
+ save_magic = p_magic;
+ p_magic = TRUE;
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+
+ buf = buflist_findnr(buflist_findpat(name, name + STRLEN(name),
+ TRUE, FALSE));
+
+ p_magic = save_magic;
+ p_cpo = save_cpo;
+
+ /* If not found, try expanding the name, like done for bufexists(). */
+ if (buf == NULL)
+ buf = find_buffer(avar);
+
+ return buf;
+}
+
+/*
+ * "bufname(expr)" function
+ */
+ static void
+f_bufname(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+
+ ++emsg_off;
+ buf = get_buf_var(&argvars[0]);
+ retvar->var_type = VAR_STRING;
+ if (buf != NULL && buf->b_fname != NULL)
+ retvar->var_val.var_string = vim_strsave(buf->b_fname);
+ else
+ retvar->var_val.var_string = NULL;
+ --emsg_off;
+}
+
+/*
+ * "bufnr(expr)" function
+ */
+ static void
+f_bufnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+
+ ++emsg_off;
+ buf = get_buf_var(&argvars[0]);
+ if (buf != NULL)
+ retvar->var_val.var_number = buf->b_fnum;
+ else
+ retvar->var_val.var_number = -1;
+ --emsg_off;
+}
+
+/*
+ * "bufwinnr(nr)" function
+ */
+ static void
+f_bufwinnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+ int winnr = 0;
+#endif
+ buf_T *buf;
+
+ ++emsg_off;
+ buf = get_buf_var(&argvars[0]);
+#ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp; wp = wp->w_next)
+ {
+ ++winnr;
+ if (wp->w_buffer == buf)
+ break;
+ }
+ retvar->var_val.var_number = (wp != NULL ? winnr : -1);
+#else
+ retvar->var_val.var_number = (curwin->w_buffer == buf ? 1 : -1);
+#endif
+ --emsg_off;
+}
+
+/*
+ * "byte2line(byte)" function
+ */
+/*ARGSUSED*/
+ static void
+f_byte2line(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifndef FEAT_BYTEOFF
+ retvar->var_val.var_number = -1;
+#else
+ long boff = 0;
+
+ boff = get_var_number(&argvars[0]) - 1;
+ if (boff < 0)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = ml_find_line_or_offset(curbuf,
+ (linenr_T)0, &boff);
+#endif
+}
+
+/*
+ * "char2nr(string)" function
+ */
+ static void
+f_char2nr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ retvar->var_val.var_number =
+ (*mb_ptr2char)(get_var_string(&argvars[0]));
+ else
+#endif
+ retvar->var_val.var_number = get_var_string(&argvars[0])[0];
+}
+
+/*
+ * "cindent(lnum)" function
+ */
+ static void
+f_cindent(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CINDENT
+ pos_T pos;
+ linenr_T lnum;
+
+ pos = curwin->w_cursor;
+ lnum = get_var_lnum(argvars);
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_cursor.lnum = lnum;
+ retvar->var_val.var_number = get_c_indent();
+ curwin->w_cursor = pos;
+ }
+ else
+#endif
+ retvar->var_val.var_number = -1;
+}
+
+/*
+ * "col(string)" function
+ */
+ static void
+f_col(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ colnr_T col = 0;
+ pos_T *fp;
+
+ fp = var2fpos(&argvars[0], FALSE);
+ if (fp != NULL)
+ {
+ if (fp->col == MAXCOL)
+ {
+ /* '> can be MAXCOL, get the length of the line then */
+ if (fp->lnum <= curbuf->b_ml.ml_line_count)
+ col = STRLEN(ml_get(fp->lnum)) + 1;
+ else
+ col = MAXCOL;
+ }
+ else
+ {
+ col = fp->col + 1;
+#ifdef FEAT_VIRTUALEDIT
+ /* col(".") when the cursor is on the NUL at the end of the line
+ * because of "coladd" can be seen as an extra column. */
+ if (virtual_active() && fp == &curwin->w_cursor)
+ {
+ char_u *p = ml_get_cursor();
+
+ if (curwin->w_cursor.coladd >= (colnr_T)chartabsize(p,
+ curwin->w_virtcol - curwin->w_cursor.coladd))
+ {
+# ifdef FEAT_MBYTE
+ int l;
+
+ if (*p != NUL && p[(l = (*mb_ptr2len_check)(p))] == NUL)
+ col += l;
+# else
+ if (*p != NUL && p[1] == NUL)
+ ++col;
+# endif
+ }
+ }
+#endif
+ }
+ }
+ retvar->var_val.var_number = col;
+}
+
+/*
+ * "confirm(message, buttons[, default [, type]])" function
+ */
+/*ARGSUSED*/
+ static void
+f_confirm(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ char_u *message;
+ char_u *buttons = NULL;
+ char_u buf[NUMBUFLEN];
+ char_u buf2[NUMBUFLEN];
+ int def = 1;
+ int type = VIM_GENERIC;
+ int c;
+
+ message = get_var_string(&argvars[0]);
+ if (argvars[1].var_type != VAR_UNKNOWN)
+ {
+ buttons = get_var_string_buf(&argvars[1], buf);
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ {
+ def = get_var_number(&argvars[2]);
+ if (argvars[3].var_type != VAR_UNKNOWN)
+ {
+ /* avoid that TOUPPER_ASC calls get_var_string_buf() twice */
+ c = *get_var_string_buf(&argvars[3], buf2);
+ switch (TOUPPER_ASC(c))
+ {
+ case 'E': type = VIM_ERROR; break;
+ case 'Q': type = VIM_QUESTION; break;
+ case 'I': type = VIM_INFO; break;
+ case 'W': type = VIM_WARNING; break;
+ case 'G': type = VIM_GENERIC; break;
+ }
+ }
+ }
+ }
+
+ if (buttons == NULL || *buttons == NUL)
+ buttons = (char_u *)_("&Ok");
+
+ retvar->var_val.var_number = do_dialog(type, NULL, message, buttons,
+ def, NULL);
+#else
+ retvar->var_val.var_number = 0;
+#endif
+}
+
+
+/*
+ * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function
+ *
+ * Checks the existence of a cscope connection.
+ */
+/*ARGSUSED*/
+ static void
+f_cscope_connection(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CSCOPE
+ int num = 0;
+ char_u *dbpath = NULL;
+ char_u *prepend = NULL;
+ char_u buf[NUMBUFLEN];
+
+ if (argvars[0].var_type != VAR_UNKNOWN
+ && argvars[1].var_type != VAR_UNKNOWN)
+ {
+ num = (int)get_var_number(&argvars[0]);
+ dbpath = get_var_string(&argvars[1]);
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ prepend = get_var_string_buf(&argvars[2], buf);
+ }
+
+ retvar->var_val.var_number = cs_connection(num, dbpath, prepend);
+#else
+ retvar->var_val.var_number = 0;
+#endif
+}
+
+/*
+ * "cursor(lnum, col)" function
+ *
+ * Moves the cursor to the specified line and column
+ */
+/*ARGSUSED*/
+ static void
+f_cursor(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ long line, col;
+
+ line = get_var_lnum(argvars);
+ if (line > 0)
+ curwin->w_cursor.lnum = line;
+ col = get_var_number(&argvars[1]);
+ if (col > 0)
+ curwin->w_cursor.col = col - 1;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+
+ /* Make sure the cursor is in a valid position. */
+ check_cursor();
+#ifdef FEAT_MBYTE
+ /* Correct cursor for multi-byte character. */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+}
+
+/*
+ * "libcall()" function
+ */
+ static void
+f_libcall(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ libcall_common(argvars, retvar, VAR_STRING);
+}
+
+/*
+ * "libcallnr()" function
+ */
+ static void
+f_libcallnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ libcall_common(argvars, retvar, VAR_NUMBER);
+}
+
+ static void
+libcall_common(argvars, retvar, type)
+ VAR argvars;
+ VAR retvar;
+ int type;
+{
+#ifdef FEAT_LIBCALL
+ char_u *string_in;
+ char_u **string_result;
+ int nr_result;
+#endif
+
+ retvar->var_type = type;
+ if (type == VAR_NUMBER)
+ retvar->var_val.var_number = 0;
+ else
+ retvar->var_val.var_string = NULL;
+
+ if (check_restricted() || check_secure())
+ return;
+
+#ifdef FEAT_LIBCALL
+ /* The first two args must be strings, otherwise its meaningless */
+ if (argvars[0].var_type == VAR_STRING && argvars[1].var_type == VAR_STRING)
+ {
+ if (argvars[2].var_type == VAR_NUMBER)
+ string_in = NULL;
+ else
+ string_in = argvars[2].var_val.var_string;
+ if (type == VAR_NUMBER)
+ string_result = NULL;
+ else
+ string_result = &retvar->var_val.var_string;
+ if (mch_libcall(argvars[0].var_val.var_string,
+ argvars[1].var_val.var_string,
+ string_in,
+ argvars[2].var_val.var_number,
+ string_result,
+ &nr_result) == OK
+ && type == VAR_NUMBER)
+ retvar->var_val.var_number = nr_result;
+ }
+#endif
+}
+
+/*
+ * "delete()" function
+ */
+ static void
+f_delete(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ if (check_restricted() || check_secure())
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = mch_remove(get_var_string(&argvars[0]));
+}
+
+/*
+ * "did_filetype()" function
+ */
+/*ARGSUSED*/
+ static void
+f_did_filetype(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_AUTOCMD
+ retvar->var_val.var_number = did_filetype;
+#else
+ retvar->var_val.var_number = 0;
+#endif
+}
+
+/*
+ * "escape({string}, {chars})" function
+ */
+ static void
+f_escape(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[NUMBUFLEN];
+
+ retvar->var_val.var_string =
+ vim_strsave_escaped(get_var_string(&argvars[0]),
+ get_var_string_buf(&argvars[1], buf));
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "eventhandler()" function
+ */
+/*ARGSUSED*/
+ static void
+f_eventhandler(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = vgetc_busy;
+}
+
+/*
+ * "executable()" function
+ */
+ static void
+f_executable(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = mch_can_exe(get_var_string(&argvars[0]));
+}
+
+/*
+ * "exists()" function
+ */
+ static void
+f_exists(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+ char_u *name;
+ int n = FALSE;
+ int len = 0;
+
+ p = get_var_string(&argvars[0]);
+ if (*p == '$') /* environment variable */
+ {
+ /* first try "normal" environment variables (fast) */
+ if (mch_getenv(p + 1) != NULL)
+ n = TRUE;
+ else
+ {
+ /* try expanding things like $VIM and ${HOME} */
+ p = expand_env_save(p);
+ if (p != NULL && *p != '$')
+ n = TRUE;
+ vim_free(p);
+ }
+ }
+ else if (*p == '&' || *p == '+') /* option */
+ n = (get_option_var(&p, NULL, TRUE) == OK);
+ else if (*p == '*') /* internal or user defined function */
+ {
+ ++p;
+ p = trans_function_name(&p, FALSE, TRUE);
+ if (p != NULL)
+ {
+ if (ASCII_ISUPPER(*p) || p[0] == K_SPECIAL)
+ n = (find_func(p) != NULL);
+ else if (ASCII_ISLOWER(*p))
+ n = (find_internal_func(p) >= 0);
+ vim_free(p);
+ }
+ }
+ else if (*p == ':')
+ {
+ n = cmd_exists(p + 1);
+ }
+ else if (*p == '#')
+ {
+#ifdef FEAT_AUTOCMD
+ name = p + 1;
+ p = vim_strchr(name, '#');
+ if (p != NULL)
+ n = au_exists(name, p, p + 1);
+ else
+ n = au_exists(name, name + STRLEN(name), NULL);
+#endif
+ }
+ else /* internal variable */
+ {
+#ifdef FEAT_MAGIC_BRACES
+ char_u *expr_start;
+ char_u *expr_end;
+ char_u *temp_string = NULL;
+ char_u *s;
+#endif
+ name = p;
+
+#ifdef FEAT_MAGIC_BRACES
+ /* Find the end of the name. */
+ s = find_name_end(name, &expr_start, &expr_end);
+ if (expr_start != NULL)
+ {
+ temp_string = make_expanded_name(name, expr_start, expr_end, s);
+ if (temp_string != NULL)
+ {
+ len = STRLEN(temp_string);
+ name = temp_string;
+ }
+ }
+#endif
+ if (len == 0)
+ len = get_id_len(&p);
+ if (len != 0)
+ n = (get_var_var(name, len, NULL) == OK);
+
+#ifdef FEAT_MAGIC_BRACES
+ vim_free(temp_string);
+#endif
+ }
+
+ retvar->var_val.var_number = n;
+}
+
+/*
+ * "expand()" function
+ */
+ static void
+f_expand(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *s;
+ int len;
+ char_u *errormsg;
+ int flags = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
+ expand_T xpc;
+
+ retvar->var_type = VAR_STRING;
+ s = get_var_string(&argvars[0]);
+ if (*s == '%' || *s == '#' || *s == '<')
+ {
+ ++emsg_off;
+ retvar->var_val.var_string = eval_vars(s, &len, NULL, &errormsg, s);
+ --emsg_off;
+ }
+ else
+ {
+ /* When the optional second argument is non-zero, don't remove matches
+ * for 'suffixes' and 'wildignore' */
+ if (argvars[1].var_type != VAR_UNKNOWN && get_var_number(&argvars[1]))
+ flags |= WILD_KEEP_ALL;
+ ExpandInit(&xpc);
+ xpc.xp_context = EXPAND_FILES;
+ retvar->var_val.var_string = ExpandOne(&xpc, s, NULL, flags, WILD_ALL);
+ ExpandCleanup(&xpc);
+ }
+}
+
+/*
+ * "filereadable()" function
+ */
+ static void
+f_filereadable(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ FILE *fd;
+ char_u *p;
+ int n;
+
+ p = get_var_string(&argvars[0]);
+ if (*p && !mch_isdir(p) && (fd = mch_fopen((char *)p, "r")) != NULL)
+ {
+ n = TRUE;
+ fclose(fd);
+ }
+ else
+ n = FALSE;
+
+ retvar->var_val.var_number = n;
+}
+
+/*
+ * return 0 for not writable, 1 for writable file, 2 for a dir which we have
+ * rights to write into.
+ */
+ static void
+f_filewritable(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+ int retval = 0;
+#if defined(UNIX) || defined(VMS)
+ int perm = 0;
+#endif
+
+ p = get_var_string(&argvars[0]);
+#if defined(UNIX) || defined(VMS)
+ perm = mch_getperm(p);
+#endif
+#ifndef MACOS_CLASSIC /* TODO: get either mch_writable or mch_access */
+ if (
+# ifdef WIN3264
+ mch_writable(p) &&
+# else
+# if defined(UNIX) || defined(VMS)
+ (perm & 0222) &&
+# endif
+# endif
+ mch_access((char *)p, W_OK) == 0
+ )
+#endif
+ {
+ ++retval;
+ if (mch_isdir(p))
+ ++retval;
+ }
+ retvar->var_val.var_number = retval;
+}
+
+/*
+ * "fnamemodify({fname}, {mods})" function
+ */
+ static void
+f_fnamemodify(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *fname;
+ char_u *mods;
+ int usedlen = 0;
+ int len;
+ char_u *fbuf = NULL;
+ char_u buf[NUMBUFLEN];
+
+ fname = get_var_string(&argvars[0]);
+ mods = get_var_string_buf(&argvars[1], buf);
+ len = (int)STRLEN(fname);
+
+ (void)modify_fname(mods, &usedlen, &fname, &fbuf, &len);
+
+ retvar->var_type = VAR_STRING;
+ if (fname == NULL)
+ retvar->var_val.var_string = NULL;
+ else
+ retvar->var_val.var_string = vim_strnsave(fname, len);
+ vim_free(fbuf);
+}
+
+/*
+ * "foldclosed()" function
+ */
+ static void
+f_foldclosed(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ foldclosed_both(argvars, retvar, FALSE);
+}
+
+/*
+ * "foldclosedend()" function
+ */
+ static void
+f_foldclosedend(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ foldclosed_both(argvars, retvar, TRUE);
+}
+
+/*
+ * "foldclosed()" function
+ */
+ static void
+foldclosed_both(argvars, retvar, end)
+ VAR argvars;
+ VAR retvar;
+ int end;
+{
+#ifdef FEAT_FOLDING
+ linenr_T lnum;
+ linenr_T first, last;
+
+ lnum = get_var_lnum(argvars);
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ {
+ if (hasFoldingWin(curwin, lnum, &first, &last, FALSE, NULL))
+ {
+ if (end)
+ retvar->var_val.var_number = (varnumber_T)last;
+ else
+ retvar->var_val.var_number = (varnumber_T)first;
+ return;
+ }
+ }
+#endif
+ retvar->var_val.var_number = -1;
+}
+
+/*
+ * "foldlevel()" function
+ */
+ static void
+f_foldlevel(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_FOLDING
+ linenr_T lnum;
+
+ lnum = get_var_lnum(argvars);
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ retvar->var_val.var_number = foldLevel(lnum);
+ else
+#endif
+ retvar->var_val.var_number = 0;
+}
+
+/*
+ * "foldtext()" function
+ */
+/*ARGSUSED*/
+ static void
+f_foldtext(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_FOLDING
+ linenr_T lnum;
+ char_u *s;
+ char_u *r;
+ int len;
+ char *txt;
+#endif
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+#ifdef FEAT_FOLDING
+ if ((linenr_T)vimvars[VV_FOLDSTART].val > 0
+ && (linenr_T)vimvars[VV_FOLDEND].val <= curbuf->b_ml.ml_line_count
+ && vimvars[VV_FOLDDASHES].val != NULL)
+ {
+ /* Find first non-empty line in the fold. */
+ lnum = (linenr_T)vimvars[VV_FOLDSTART].val;
+ while (lnum < (linenr_T)vimvars[VV_FOLDEND].val)
+ {
+ if (!linewhite(lnum))
+ break;
+ ++lnum;
+ }
+
+ /* Find interesting text in this line. */
+ s = skipwhite(ml_get(lnum));
+ /* skip C comment-start */
+ if (s[0] == '/' && (s[1] == '*' || s[1] == '/'))
+ s = skipwhite(s + 2);
+ txt = _("+-%s%3ld lines: ");
+ r = alloc((unsigned)(STRLEN(txt)
+ + STRLEN(vimvars[VV_FOLDDASHES].val) /* for %s */
+ + 20 /* for %3ld */
+ + STRLEN(s))); /* concatenated */
+ if (r != NULL)
+ {
+ sprintf((char *)r, txt, vimvars[VV_FOLDDASHES].val,
+ (long)((linenr_T)vimvars[VV_FOLDEND].val
+ - (linenr_T)vimvars[VV_FOLDSTART].val + 1));
+ len = (int)STRLEN(r);
+ STRCAT(r, s);
+ /* remove 'foldmarker' and 'commentstring' */
+ foldtext_cleanup(r + len);
+ retvar->var_val.var_string = r;
+ }
+ }
+#endif
+}
+
+/*
+ * "foreground()" function
+ */
+/*ARGSUSED*/
+ static void
+f_foreground(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = 0;
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_mch_set_foreground();
+#else
+# ifdef WIN32
+ win32_set_foreground();
+# endif
+#endif
+}
+
+/*
+ * "getchar()" function
+ */
+ static void
+f_getchar(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ varnumber_T n;
+
+ ++no_mapping;
+ ++allow_keys;
+ if (argvars[0].var_type == VAR_UNKNOWN)
+ /* getchar(): blocking wait. */
+ n = safe_vgetc();
+ else if (get_var_number(&argvars[0]) == 1)
+ /* getchar(1): only check if char avail */
+ n = vpeekc();
+ else if (vpeekc() == NUL)
+ /* getchar(0) and no char avail: return zero */
+ n = 0;
+ else
+ /* getchar(0) and char avail: return char */
+ n = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+
+ retvar->var_val.var_number = n;
+ if (IS_SPECIAL(n) || mod_mask != 0)
+ {
+ char_u temp[10]; /* modifier: 3, mbyte-char: 6, NUL: 1 */
+ int i = 0;
+
+ /* Turn a special key into three bytes, plus modifier. */
+ if (mod_mask != 0)
+ {
+ temp[i++] = K_SPECIAL;
+ temp[i++] = KS_MODIFIER;
+ temp[i++] = mod_mask;
+ }
+ if (IS_SPECIAL(n))
+ {
+ temp[i++] = K_SPECIAL;
+ temp[i++] = K_SECOND(n);
+ temp[i++] = K_THIRD(n);
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ i += (*mb_char2bytes)(n, temp + i);
+#endif
+ else
+ temp[i++] = n;
+ temp[i++] = NUL;
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strsave(temp);
+ }
+}
+
+/*
+ * "getcharmod()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getcharmod(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = mod_mask;
+}
+
+/*
+ * "getcmdline()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getcmdline(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = get_cmdline_str();
+}
+
+/*
+ * "getcmdpos()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getcmdpos(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = get_cmdline_pos() + 1;
+}
+
+/*
+ * "getbufvar()" function
+ */
+ static void
+f_getbufvar(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+ buf_T *save_curbuf;
+ char_u *varname;
+ VAR v;
+
+ ++emsg_off;
+ buf = get_buf_var(&argvars[0]);
+ varname = get_var_string(&argvars[1]);
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+
+ if (buf != NULL && varname != NULL)
+ {
+ if (*varname == '&') /* buffer-local-option */
+ {
+ /* set curbuf to be our buf, temporarily */
+ save_curbuf = curbuf;
+ curbuf = buf;
+
+ get_option_var(&varname, retvar, TRUE);
+
+ /* restore previous notion of curbuf */
+ curbuf = save_curbuf;
+ }
+ else
+ {
+ /* look up the variable */
+ v = find_var_in_ga(&buf->b_vars, varname);
+ if (v != NULL)
+ copy_var(v, retvar);
+ }
+ }
+
+ --emsg_off;
+}
+
+/*
+ * "getcwd()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getcwd(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u cwd[MAXPATHL];
+
+ retvar->var_type = VAR_STRING;
+ if (mch_dirname(cwd, MAXPATHL) == FAIL)
+ retvar->var_val.var_string = NULL;
+ else
+ {
+ retvar->var_val.var_string = vim_strsave(cwd);
+#ifdef BACKSLASH_IN_FILENAME
+ slash_adjust(retvar->var_val.var_string);
+#endif
+ }
+}
+
+/*
+ * "getfsize({fname})" function
+ */
+ static void
+f_getfsize(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *fname;
+ struct stat st;
+
+ fname = get_var_string(&argvars[0]);
+
+ retvar->var_type = VAR_NUMBER;
+
+ if (mch_stat((char *)fname, &st) >= 0)
+ {
+ if (mch_isdir(fname))
+ retvar->var_val.var_number = 0;
+ else
+ retvar->var_val.var_number = (varnumber_T)st.st_size;
+ }
+ else
+ retvar->var_val.var_number = -1;
+}
+
+/*
+ * "getftime({fname})" function
+ */
+ static void
+f_getftime(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *fname;
+ struct stat st;
+
+ fname = get_var_string(&argvars[0]);
+
+ if (mch_stat((char *)fname, &st) >= 0)
+ retvar->var_val.var_number = (varnumber_T)st.st_mtime;
+ else
+ retvar->var_val.var_number = -1;
+}
+
+/*
+ * "getreg()" function
+ */
+ static void
+f_getreg(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *strregname;
+ int regname;
+
+ if (argvars[0].var_type != VAR_UNKNOWN)
+ strregname = get_var_string(&argvars[0]);
+ else
+ strregname = vimvars[VV_REG].val;
+ regname = (strregname == NULL ? '"' : *strregname);
+ if (regname == 0)
+ regname = '"';
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = get_reg_contents(regname, TRUE);
+}
+
+/*
+ * "getregtype()" function
+ */
+ static void
+f_getregtype(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *strregname;
+ int regname;
+ char_u buf[NUMBUFLEN + 2];
+ long reglen = 0;
+
+ if (argvars[0].var_type != VAR_UNKNOWN)
+ strregname = get_var_string(&argvars[0]);
+ else
+ /* Default to v:register */
+ strregname = vimvars[VV_REG].val;
+
+ regname = (strregname == NULL ? '"' : *strregname);
+ if (regname == 0)
+ regname = '"';
+
+ buf[0] = NUL;
+ buf[1] = NUL;
+ switch (get_reg_type(regname, &reglen))
+ {
+ case MLINE: buf[0] = 'V'; break;
+ case MCHAR: buf[0] = 'v'; break;
+#ifdef FEAT_VISUAL
+ case MBLOCK:
+ buf[0] = Ctrl_V;
+ sprintf((char *)buf + 1, "%ld", reglen + 1);
+ break;
+#endif
+ }
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strsave(buf);
+}
+
+/*
+ * "getline(lnum)" function
+ */
+ static void
+f_getline(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum;
+ char_u *p;
+
+ lnum = get_var_lnum(argvars);
+
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ p = ml_get(lnum);
+ else
+ p = (char_u *)"";
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strsave(p);
+}
+
+/*
+ * "getwinposx()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getwinposx(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = -1;
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ int x, y;
+
+ if (gui_mch_get_winpos(&x, &y) == OK)
+ retvar->var_val.var_number = x;
+ }
+#endif
+}
+
+/*
+ * "getwinposy()" function
+ */
+/*ARGSUSED*/
+ static void
+f_getwinposy(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = -1;
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ int x, y;
+
+ if (gui_mch_get_winpos(&x, &y) == OK)
+ retvar->var_val.var_number = y;
+ }
+#endif
+}
+
+/*
+ * "getwinvar()" function
+ */
+ static void
+f_getwinvar(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ win_T *win, *oldcurwin;
+ char_u *varname;
+ VAR v;
+
+ ++emsg_off;
+ win = find_win_by_nr(&argvars[0]);
+ varname = get_var_string(&argvars[1]);
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+
+ if (win != NULL && varname != NULL)
+ {
+ if (*varname == '&') /* window-local-option */
+ {
+ /* set curwin to be our win, temporarily */
+ oldcurwin = curwin;
+ curwin = win;
+
+ get_option_var(&varname, retvar , 1);
+
+ /* restore previous notion of curwin */
+ curwin = oldcurwin;
+ }
+ else
+ {
+ /* look up the variable */
+ v = find_var_in_ga(&win->w_vars, varname);
+ if (v != NULL)
+ copy_var(v, retvar);
+ }
+ }
+
+ --emsg_off;
+}
+
+/*
+ * "glob()" function
+ */
+ static void
+f_glob(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ expand_T xpc;
+
+ ExpandInit(&xpc);
+ xpc.xp_context = EXPAND_FILES;
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = ExpandOne(&xpc, get_var_string(&argvars[0]),
+ NULL, WILD_USE_NL|WILD_SILENT, WILD_ALL);
+ ExpandCleanup(&xpc);
+}
+
+/*
+ * "globpath()" function
+ */
+ static void
+f_globpath(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf1[NUMBUFLEN];
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = globpath(get_var_string(&argvars[0]),
+ get_var_string_buf(&argvars[1], buf1));
+}
+
+/*
+ * "has()" function
+ */
+ static void
+f_has(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int i;
+ char_u *name;
+ int n = FALSE;
+ static char *(has_list[]) =
+ {
+#ifdef AMIGA
+ "amiga",
+# ifdef FEAT_ARP
+ "arp",
+# endif
+#endif
+#ifdef __BEOS__
+ "beos",
+#endif
+#ifdef MSDOS
+# ifdef DJGPP
+ "dos32",
+# else
+ "dos16",
+# endif
+#endif
+#ifdef MACOS /* TODO: Should we add MACOS_CLASSIC, MACOS_X? (Dany) */
+ "mac",
+#endif
+#if defined(MACOS_X_UNIX)
+ "macunix",
+#endif
+#ifdef OS2
+ "os2",
+#endif
+#ifdef __QNX__
+ "qnx",
+#endif
+#ifdef RISCOS
+ "riscos",
+#endif
+#ifdef UNIX
+ "unix",
+#endif
+#ifdef VMS
+ "vms",
+#endif
+#ifdef WIN16
+ "win16",
+#endif
+#ifdef WIN32
+ "win32",
+#endif
+#if defined(UNIX) && (defined(__CYGWIN32__) || defined(__CYGWIN__))
+ "win32unix",
+#endif
+#ifdef WIN64
+ "win64",
+#endif
+#ifdef EBCDIC
+ "ebcdic",
+#endif
+#ifndef CASE_INSENSITIVE_FILENAME
+ "fname_case",
+#endif
+#ifdef FEAT_ARABIC
+ "arabic",
+#endif
+#ifdef FEAT_AUTOCMD
+ "autocmd",
+#endif
+#ifdef FEAT_BEVAL
+ "balloon_eval",
+#endif
+#if defined(SOME_BUILTIN_TCAPS) || defined(ALL_BUILTIN_TCAPS)
+ "builtin_terms",
+# ifdef ALL_BUILTIN_TCAPS
+ "all_builtin_terms",
+# endif
+#endif
+#ifdef FEAT_BYTEOFF
+ "byte_offset",
+#endif
+#ifdef FEAT_CINDENT
+ "cindent",
+#endif
+#ifdef FEAT_CLIENTSERVER
+ "clientserver",
+#endif
+#ifdef FEAT_CLIPBOARD
+ "clipboard",
+#endif
+#ifdef FEAT_CMDL_COMPL
+ "cmdline_compl",
+#endif
+#ifdef FEAT_CMDHIST
+ "cmdline_hist",
+#endif
+#ifdef FEAT_COMMENTS
+ "comments",
+#endif
+#ifdef FEAT_CRYPT
+ "cryptv",
+#endif
+#ifdef FEAT_CSCOPE
+ "cscope",
+#endif
+#ifdef DEBUG
+ "debug",
+#endif
+#ifdef FEAT_CON_DIALOG
+ "dialog_con",
+#endif
+#ifdef FEAT_GUI_DIALOG
+ "dialog_gui",
+#endif
+#ifdef FEAT_DIFF
+ "diff",
+#endif
+#ifdef FEAT_DIGRAPHS
+ "digraphs",
+#endif
+#ifdef FEAT_DND
+ "dnd",
+#endif
+#ifdef FEAT_EMACS_TAGS
+ "emacs_tags",
+#endif
+ "eval", /* always present, of course! */
+#ifdef FEAT_EX_EXTRA
+ "ex_extra",
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ "extra_search",
+#endif
+#ifdef FEAT_FKMAP
+ "farsi",
+#endif
+#ifdef FEAT_SEARCHPATH
+ "file_in_path",
+#endif
+#ifdef FEAT_FIND_ID
+ "find_in_path",
+#endif
+#ifdef FEAT_FOLDING
+ "folding",
+#endif
+#ifdef FEAT_FOOTER
+ "footer",
+#endif
+#if !defined(USE_SYSTEM) && defined(UNIX)
+ "fork",
+#endif
+#ifdef FEAT_GETTEXT
+ "gettext",
+#endif
+#ifdef FEAT_GUI
+ "gui",
+#endif
+#ifdef FEAT_GUI_ATHENA
+# ifdef FEAT_GUI_NEXTAW
+ "gui_neXtaw",
+# else
+ "gui_athena",
+# endif
+#endif
+#ifdef FEAT_GUI_BEOS
+ "gui_beos",
+#endif
+#ifdef FEAT_GUI_GTK
+ "gui_gtk",
+# ifdef HAVE_GTK2
+ "gui_gtk2",
+# endif
+#endif
+#ifdef FEAT_GUI_MAC
+ "gui_mac",
+#endif
+#ifdef FEAT_GUI_MOTIF
+ "gui_motif",
+#endif
+#ifdef FEAT_GUI_PHOTON
+ "gui_photon",
+#endif
+#ifdef FEAT_GUI_W16
+ "gui_win16",
+#endif
+#ifdef FEAT_GUI_W32
+ "gui_win32",
+#endif
+#ifdef FEAT_HANGULIN
+ "hangul_input",
+#endif
+#if defined(HAVE_ICONV_H) && defined(USE_ICONV)
+ "iconv",
+#endif
+#ifdef FEAT_INS_EXPAND
+ "insert_expand",
+#endif
+#ifdef FEAT_JUMPLIST
+ "jumplist",
+#endif
+#ifdef FEAT_KEYMAP
+ "keymap",
+#endif
+#ifdef FEAT_LANGMAP
+ "langmap",
+#endif
+#ifdef FEAT_LIBCALL
+ "libcall",
+#endif
+#ifdef FEAT_LINEBREAK
+ "linebreak",
+#endif
+#ifdef FEAT_LISP
+ "lispindent",
+#endif
+#ifdef FEAT_LISTCMDS
+ "listcmds",
+#endif
+#ifdef FEAT_LOCALMAP
+ "localmap",
+#endif
+#ifdef FEAT_MENU
+ "menu",
+#endif
+#ifdef FEAT_SESSION
+ "mksession",
+#endif
+#ifdef FEAT_MODIFY_FNAME
+ "modify_fname",
+#endif
+#ifdef FEAT_MOUSE
+ "mouse",
+#endif
+#ifdef FEAT_MOUSESHAPE
+ "mouseshape",
+#endif
+#if defined(UNIX) || defined(VMS)
+# ifdef FEAT_MOUSE_DEC
+ "mouse_dec",
+# endif
+# ifdef FEAT_MOUSE_GPM
+ "mouse_gpm",
+# endif
+# ifdef FEAT_MOUSE_JSB
+ "mouse_jsbterm",
+# endif
+# ifdef FEAT_MOUSE_NET
+ "mouse_netterm",
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ "mouse_pterm",
+# endif
+# ifdef FEAT_MOUSE_XTERM
+ "mouse_xterm",
+# endif
+#endif
+#ifdef FEAT_MBYTE
+ "multi_byte",
+#endif
+#ifdef FEAT_MBYTE_IME
+ "multi_byte_ime",
+#endif
+#ifdef FEAT_MULTI_LANG
+ "multi_lang",
+#endif
+#ifdef FEAT_OLE
+ "ole",
+#endif
+#ifdef FEAT_OSFILETYPE
+ "osfiletype",
+#endif
+#ifdef FEAT_PATH_EXTRA
+ "path_extra",
+#endif
+#ifdef FEAT_PERL
+#ifndef DYNAMIC_PERL
+ "perl",
+#endif
+#endif
+#ifdef FEAT_PYTHON
+#ifndef DYNAMIC_PYTHON
+ "python",
+#endif
+#endif
+#ifdef FEAT_POSTSCRIPT
+ "postscript",
+#endif
+#ifdef FEAT_PRINTER
+ "printer",
+#endif
+#ifdef FEAT_QUICKFIX
+ "quickfix",
+#endif
+#ifdef FEAT_RIGHTLEFT
+ "rightleft",
+#endif
+#if defined(FEAT_RUBY) && !defined(DYNAMIC_RUBY)
+ "ruby",
+#endif
+#ifdef FEAT_SCROLLBIND
+ "scrollbind",
+#endif
+#ifdef FEAT_CMDL_INFO
+ "showcmd",
+ "cmdline_info",
+#endif
+#ifdef FEAT_SIGNS
+ "signs",
+#endif
+#ifdef FEAT_SMARTINDENT
+ "smartindent",
+#endif
+#ifdef FEAT_SNIFF
+ "sniff",
+#endif
+#ifdef FEAT_STL_OPT
+ "statusline",
+#endif
+#ifdef FEAT_SUN_WORKSHOP
+ "sun_workshop",
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ "netbeans_intg",
+#endif
+#ifdef FEAT_SYN_HL
+ "syntax",
+#endif
+#if defined(USE_SYSTEM) || !defined(UNIX)
+ "system",
+#endif
+#ifdef FEAT_TAG_BINS
+ "tag_binary",
+#endif
+#ifdef FEAT_TAG_OLDSTATIC
+ "tag_old_static",
+#endif
+#ifdef FEAT_TAG_ANYWHITE
+ "tag_any_white",
+#endif
+#ifdef FEAT_TCL
+# ifndef DYNAMIC_TCL
+ "tcl",
+# endif
+#endif
+#ifdef TERMINFO
+ "terminfo",
+#endif
+#ifdef FEAT_TERMRESPONSE
+ "termresponse",
+#endif
+#ifdef FEAT_TEXTOBJ
+ "textobjects",
+#endif
+#ifdef HAVE_TGETENT
+ "tgetent",
+#endif
+#ifdef FEAT_TITLE
+ "title",
+#endif
+#ifdef FEAT_TOOLBAR
+ "toolbar",
+#endif
+#ifdef FEAT_USR_CMDS
+ "user-commands", /* was accidentally included in 5.4 */
+ "user_commands",
+#endif
+#ifdef FEAT_VIMINFO
+ "viminfo",
+#endif
+#ifdef FEAT_VERTSPLIT
+ "vertsplit",
+#endif
+#ifdef FEAT_VIRTUALEDIT
+ "virtualedit",
+#endif
+#ifdef FEAT_VISUAL
+ "visual",
+#endif
+#ifdef FEAT_VISUALEXTRA
+ "visualextra",
+#endif
+#ifdef FEAT_VREPLACE
+ "vreplace",
+#endif
+#ifdef FEAT_WILDIGN
+ "wildignore",
+#endif
+#ifdef FEAT_WILDMENU
+ "wildmenu",
+#endif
+#ifdef FEAT_WINDOWS
+ "windows",
+#endif
+#ifdef FEAT_WAK
+ "winaltkeys",
+#endif
+#ifdef FEAT_WRITEBACKUP
+ "writebackup",
+#endif
+#ifdef FEAT_XIM
+ "xim",
+#endif
+#ifdef FEAT_XFONTSET
+ "xfontset",
+#endif
+#ifdef USE_XSMP
+ "xsmp",
+#endif
+#ifdef USE_XSMP_INTERACT
+ "xsmp_interact",
+#endif
+#ifdef FEAT_XCLIPBOARD
+ "xterm_clipboard",
+#endif
+#ifdef FEAT_XTERM_SAVE
+ "xterm_save",
+#endif
+#if defined(UNIX) && defined(FEAT_X11)
+ "X11",
+#endif
+ NULL
+ };
+
+ name = get_var_string(&argvars[0]);
+ for (i = 0; has_list[i] != NULL; ++i)
+ if (STRICMP(name, has_list[i]) == 0)
+ {
+ n = TRUE;
+ break;
+ }
+
+ if (n == FALSE)
+ {
+ if (STRNICMP(name, "patch", 5) == 0)
+ n = has_patch(atoi((char *)name + 5));
+ else if (STRICMP(name, "vim_starting") == 0)
+ n = (starting != 0);
+#ifdef DYNAMIC_TCL
+ else if (STRICMP(name, "tcl") == 0)
+ n = tcl_enabled(FALSE);
+#endif
+#if defined(USE_ICONV) && defined(DYNAMIC_ICONV)
+ else if (STRICMP(name, "iconv") == 0)
+ n = iconv_enabled(FALSE);
+#endif
+#ifdef DYNAMIC_RUBY
+ else if (STRICMP(name, "ruby") == 0)
+ n = ruby_enabled(FALSE);
+#endif
+#ifdef DYNAMIC_PYTHON
+ else if (STRICMP(name, "python") == 0)
+ n = python_enabled(FALSE);
+#endif
+#ifdef DYNAMIC_PERL
+ else if (STRICMP(name, "perl") == 0)
+ n = perl_enabled(FALSE);
+#endif
+#ifdef FEAT_GUI
+ else if (STRICMP(name, "gui_running") == 0)
+ n = (gui.in_use || gui.starting);
+# ifdef FEAT_GUI_W32
+ else if (STRICMP(name, "gui_win32s") == 0)
+ n = gui_is_win32s();
+# endif
+# ifdef FEAT_BROWSE
+ else if (STRICMP(name, "browse") == 0)
+ n = gui.in_use; /* gui_mch_browse() works when GUI is running */
+# endif
+#endif
+#ifdef FEAT_SYN_HL
+ else if (STRICMP(name, "syntax_items") == 0)
+ n = syntax_present(curbuf);
+#endif
+#if defined(WIN3264)
+ else if (STRICMP(name, "win95") == 0)
+ n = mch_windows95();
+#endif
+ }
+
+ retvar->var_val.var_number = n;
+}
+
+/*
+ * "hasmapto()" function
+ */
+ static void
+f_hasmapto(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *name;
+ char_u *mode;
+ char_u buf[NUMBUFLEN];
+
+ name = get_var_string(&argvars[0]);
+ if (argvars[1].var_type == VAR_UNKNOWN)
+ mode = (char_u *)"nvo";
+ else
+ mode = get_var_string_buf(&argvars[1], buf);
+
+ if (map_to_exists(name, mode))
+ retvar->var_val.var_number = TRUE;
+ else
+ retvar->var_val.var_number = FALSE;
+}
+
+/*
+ * "histadd()" function
+ */
+/*ARGSUSED*/
+ static void
+f_histadd(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CMDHIST
+ int histype;
+ char_u *str;
+ char_u buf[NUMBUFLEN];
+#endif
+
+ retvar->var_val.var_number = FALSE;
+ if (check_restricted() || check_secure())
+ return;
+#ifdef FEAT_CMDHIST
+ histype = get_histtype(get_var_string(&argvars[0]));
+ if (histype >= 0)
+ {
+ str = get_var_string_buf(&argvars[1], buf);
+ if (*str != NUL)
+ {
+ add_to_history(histype, str, FALSE, NUL);
+ retvar->var_val.var_number = TRUE;
+ return;
+ }
+ }
+#endif
+}
+
+/*
+ * "histdel()" function
+ */
+/*ARGSUSED*/
+ static void
+f_histdel(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CMDHIST
+ int n;
+ char_u buf[NUMBUFLEN];
+
+ if (argvars[1].var_type == VAR_UNKNOWN)
+ /* only one argument: clear entire history */
+ n = clr_history(get_histtype(get_var_string(&argvars[0])));
+ else if (argvars[1].var_type == VAR_NUMBER)
+ /* index given: remove that entry */
+ n = del_history_idx(get_histtype(get_var_string(&argvars[0])),
+ (int)get_var_number(&argvars[1]));
+ else
+ /* string given: remove all matching entries */
+ n = del_history_entry(get_histtype(get_var_string(&argvars[0])),
+ get_var_string_buf(&argvars[1], buf));
+ retvar->var_val.var_number = n;
+#else
+ retvar->var_val.var_number = 0;
+#endif
+}
+
+/*
+ * "histget()" function
+ */
+/*ARGSUSED*/
+ static void
+f_histget(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CMDHIST
+ int type;
+ int idx;
+
+ type = get_histtype(get_var_string(&argvars[0]));
+ if (argvars[1].var_type == VAR_UNKNOWN)
+ idx = get_history_idx(type);
+ else
+ idx = (int)get_var_number(&argvars[1]);
+ retvar->var_val.var_string = vim_strsave(get_history_entry(type, idx));
+#else
+ retvar->var_val.var_string = NULL;
+#endif
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "histnr()" function
+ */
+/*ARGSUSED*/
+ static void
+f_histnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int i;
+
+#ifdef FEAT_CMDHIST
+ i = get_histtype(get_var_string(&argvars[0]));
+ if (i >= HIST_CMD && i < HIST_COUNT)
+ i = get_history_idx(i);
+ else
+#endif
+ i = -1;
+ retvar->var_val.var_number = i;
+}
+
+/*
+ * "highlight_exists()" function
+ */
+ static void
+f_hlexists(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = highlight_exists(get_var_string(&argvars[0]));
+}
+
+/*
+ * "highlightID(name)" function
+ */
+ static void
+f_hlID(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = syn_name2id(get_var_string(&argvars[0]));
+}
+
+/*
+ * "hostname()" function
+ */
+/*ARGSUSED*/
+ static void
+f_hostname(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u hostname[256];
+
+ mch_get_host_name(hostname, 256);
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strsave(hostname);
+}
+
+/*
+ * iconv() function
+ */
+/*ARGSUSED*/
+ static void
+f_iconv(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_MBYTE
+ char_u buf1[NUMBUFLEN];
+ char_u buf2[NUMBUFLEN];
+ char_u *from, *to, *str;
+ vimconv_T vimconv;
+#endif
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+
+#ifdef FEAT_MBYTE
+ str = get_var_string(&argvars[0]);
+ from = enc_canonize(enc_skip(get_var_string_buf(&argvars[1], buf1)));
+ to = enc_canonize(enc_skip(get_var_string_buf(&argvars[2], buf2)));
+ vimconv.vc_type = CONV_NONE;
+ convert_setup(&vimconv, from, to);
+
+ /* If the encodings are equal, no conversion needed. */
+ if (vimconv.vc_type == CONV_NONE)
+ retvar->var_val.var_string = vim_strsave(str);
+ else
+ retvar->var_val.var_string = string_convert(&vimconv, str, NULL);
+
+ convert_setup(&vimconv, NULL, NULL);
+ vim_free(from);
+ vim_free(to);
+#endif
+}
+
+/*
+ * "indent()" function
+ */
+ static void
+f_indent(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum;
+
+ lnum = get_var_lnum(argvars);
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ retvar->var_val.var_number = get_indent_lnum(lnum);
+ else
+ retvar->var_val.var_number = -1;
+}
+
+static int inputsecret_flag = 0;
+
+/*
+ * "input()" function
+ * Also handles inputsecret() when inputsecret is set.
+ */
+ static void
+f_input(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *prompt = get_var_string(&argvars[0]);
+ char_u *p = NULL;
+ int c;
+ char_u buf[NUMBUFLEN];
+ int cmd_silent_save = cmd_silent;
+
+ retvar->var_type = VAR_STRING;
+
+#ifdef NO_CONSOLE_INPUT
+ /* While starting up, there is no place to enter text. */
+ if (no_console_input())
+ {
+ retvar->var_val.var_string = NULL;
+ return;
+ }
+#endif
+
+ cmd_silent = FALSE; /* Want to see the prompt. */
+ if (prompt != NULL)
+ {
+ /* Only the part of the message after the last NL is considered as
+ * prompt for the command line */
+ p = vim_strrchr(prompt, '\n');
+ if (p == NULL)
+ p = prompt;
+ else
+ {
+ ++p;
+ c = *p;
+ *p = NUL;
+ msg_start();
+ msg_clr_eos();
+ msg_puts_attr(prompt, echo_attr);
+ msg_didout = FALSE;
+ msg_starthere();
+ *p = c;
+ }
+ cmdline_row = msg_row;
+ }
+
+ if (argvars[1].var_type != VAR_UNKNOWN)
+ stuffReadbuffSpec(get_var_string_buf(&argvars[1], buf));
+
+ retvar->var_val.var_string =
+ getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr);
+
+ /* since the user typed this, no need to wait for return */
+ need_wait_return = FALSE;
+ msg_didout = FALSE;
+ cmd_silent = cmd_silent_save;
+}
+
+/*
+ * "inputdialog()" function
+ */
+ static void
+f_inputdialog(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#if defined(FEAT_GUI_TEXTDIALOG)
+ /* Use a GUI dialog if the GUI is running and 'c' is not in 'guioptions' */
+ if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL)
+ {
+ char_u *message;
+ char_u buf[NUMBUFLEN];
+
+ message = get_var_string(&argvars[0]);
+ if (argvars[1].var_type != VAR_UNKNOWN)
+ {
+ STRNCPY(IObuff, get_var_string_buf(&argvars[1], buf), IOSIZE);
+ IObuff[IOSIZE - 1] = NUL;
+ }
+ else
+ IObuff[0] = NUL;
+ if (do_dialog(VIM_QUESTION, NULL, message, (char_u *)_("&OK\n&Cancel"),
+ 1, IObuff) == 1)
+ retvar->var_val.var_string = vim_strsave(IObuff);
+ else
+ {
+ if (argvars[1].var_type != VAR_UNKNOWN
+ && argvars[2].var_type != VAR_UNKNOWN)
+ retvar->var_val.var_string = vim_strsave(
+ get_var_string_buf(&argvars[2], buf));
+ else
+ retvar->var_val.var_string = NULL;
+ }
+ retvar->var_type = VAR_STRING;
+ }
+ else
+#endif
+ f_input(argvars, retvar);
+}
+
+static garray_T ga_userinput = {0, 0, sizeof(tasave_T), 4, NULL};
+
+/*
+ * "inputrestore()" function
+ */
+/*ARGSUSED*/
+ static void
+f_inputrestore(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ if (ga_userinput.ga_len > 0)
+ {
+ --ga_userinput.ga_len;
+ ++ga_userinput.ga_room;
+ restore_typeahead((tasave_T *)(ga_userinput.ga_data)
+ + ga_userinput.ga_len);
+ retvar->var_val.var_number = 0; /* OK */
+ }
+ else if (p_verbose > 1)
+ {
+ msg((char_u *)_("called inputrestore() more often than inputsave()"));
+ retvar->var_val.var_number = 1; /* Failed */
+ }
+}
+
+/*
+ * "inputsave()" function
+ */
+/*ARGSUSED*/
+ static void
+f_inputsave(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ /* Add an entry to the stack of typehead storage. */
+ if (ga_grow(&ga_userinput, 1) == OK)
+ {
+ save_typeahead((tasave_T *)(ga_userinput.ga_data)
+ + ga_userinput.ga_len);
+ ++ga_userinput.ga_len;
+ --ga_userinput.ga_room;
+ retvar->var_val.var_number = 0; /* OK */
+ }
+ else
+ retvar->var_val.var_number = 1; /* Failed */
+}
+
+/*
+ * "inputsecret()" function
+ */
+ static void
+f_inputsecret(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ ++cmdline_star;
+ ++inputsecret_flag;
+ f_input(argvars, retvar);
+ --cmdline_star;
+ --inputsecret_flag;
+}
+
+/*
+ * "isdirectory()" function
+ */
+ static void
+f_isdirectory(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = mch_isdir(get_var_string(&argvars[0]));
+}
+
+/*
+ * "last_buffer_nr()" function.
+ */
+/*ARGSUSED*/
+ static void
+f_last_buffer_nr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int n = 0;
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (n < buf->b_fnum)
+ n = buf->b_fnum;
+
+ retvar->var_val.var_number = n;
+}
+
+/*
+ * "line(string)" function
+ */
+ static void
+f_line(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum = 0;
+ pos_T *fp;
+
+ fp = var2fpos(&argvars[0], TRUE);
+ if (fp != NULL)
+ lnum = fp->lnum;
+ retvar->var_val.var_number = lnum;
+}
+
+/*
+ * "line2byte(lnum)" function
+ */
+/*ARGSUSED*/
+ static void
+f_line2byte(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifndef FEAT_BYTEOFF
+ retvar->var_val.var_number = -1;
+#else
+ linenr_T lnum;
+
+ lnum = get_var_lnum(argvars);
+ if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = ml_find_line_or_offset(curbuf, lnum, NULL);
+ if (retvar->var_val.var_number >= 0)
+ ++retvar->var_val.var_number;
+#endif
+}
+
+/*
+ * "lispindent(lnum)" function
+ */
+ static void
+f_lispindent(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_LISP
+ pos_T pos;
+ linenr_T lnum;
+
+ pos = curwin->w_cursor;
+ lnum = get_var_lnum(argvars);
+ if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_cursor.lnum = lnum;
+ retvar->var_val.var_number = get_lisp_indent();
+ curwin->w_cursor = pos;
+ }
+ else
+#endif
+ retvar->var_val.var_number = -1;
+}
+
+/*
+ * "localtime()" function
+ */
+/*ARGSUSED*/
+ static void
+f_localtime(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = (varnumber_T)time(NULL);
+}
+
+/*
+ * "maparg()" function
+ */
+ static void
+f_maparg(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ get_maparg(argvars, retvar, TRUE);
+}
+
+/*
+ * "mapcheck()" function
+ */
+ static void
+f_mapcheck(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ get_maparg(argvars, retvar, FALSE);
+}
+
+ static void
+get_maparg(argvars, retvar, exact)
+ VAR argvars;
+ VAR retvar;
+ int exact;
+{
+ char_u *keys;
+ char_u *which;
+ char_u buf[NUMBUFLEN];
+ char_u *keys_buf = NULL;
+ char_u *rhs;
+ int mode;
+ garray_T ga;
+
+ /* return empty string for failure */
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+
+ keys = get_var_string(&argvars[0]);
+ if (*keys == NUL)
+ return;
+
+ if (argvars[1].var_type != VAR_UNKNOWN)
+ which = get_var_string_buf(&argvars[1], buf);
+ else
+ which = (char_u *)"";
+ mode = get_map_mode(&which, 0);
+
+ keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE);
+ rhs = check_map(keys, mode, exact);
+ vim_free(keys_buf);
+ if (rhs != NULL)
+ {
+ ga_init(&ga);
+ ga.ga_itemsize = 1;
+ ga.ga_growsize = 40;
+
+ while (*rhs != NUL)
+ ga_concat(&ga, str2special(&rhs, FALSE));
+
+ ga_append(&ga, NUL);
+ retvar->var_val.var_string = (char_u *)ga.ga_data;
+ }
+}
+
+/*
+ * "match()" function
+ */
+ static void
+f_match(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ find_some_match(argvars, retvar, 1);
+}
+
+/*
+ * "matchend()" function
+ */
+ static void
+f_matchend(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ find_some_match(argvars, retvar, 0);
+}
+
+/*
+ * "matchstr()" function
+ */
+ static void
+f_matchstr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ find_some_match(argvars, retvar, 2);
+}
+
+ static void
+find_some_match(argvars, retvar, type)
+ VAR argvars;
+ VAR retvar;
+ int type;
+{
+ char_u *str;
+ char_u *pat;
+ regmatch_T regmatch;
+ char_u patbuf[NUMBUFLEN];
+ char_u *save_cpo;
+ long start = 0;
+
+ /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+
+ str = get_var_string(&argvars[0]);
+ pat = get_var_string_buf(&argvars[1], patbuf);
+
+ if (type == 2)
+ {
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+ }
+ else
+ retvar->var_val.var_number = -1;
+
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ {
+ start = get_var_number(&argvars[2]);
+ if (start < 0)
+ start = 0;
+ if (start > (long)STRLEN(str))
+ goto theend;
+ str += start;
+ }
+
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
+ if (regmatch.regprog != NULL)
+ {
+ regmatch.rm_ic = p_ic;
+ if (vim_regexec_nl(&regmatch, str, (colnr_T)0))
+ {
+ if (type == 2)
+ retvar->var_val.var_string = vim_strnsave(regmatch.startp[0],
+ (int)(regmatch.endp[0] - regmatch.startp[0]));
+ else
+ {
+ if (type != 0)
+ retvar->var_val.var_number =
+ (varnumber_T)(regmatch.startp[0] - str);
+ else
+ retvar->var_val.var_number =
+ (varnumber_T)(regmatch.endp[0] - str);
+ retvar->var_val.var_number += start;
+ }
+ }
+ vim_free(regmatch.regprog);
+ }
+
+theend:
+ p_cpo = save_cpo;
+}
+
+/*
+ * "mode()" function
+ */
+/*ARGSUSED*/
+ static void
+f_mode(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[2];
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (VIsual_select)
+ buf[0] = VIsual_mode + 's' - 'v';
+ else
+ buf[0] = VIsual_mode;
+ }
+ else
+#endif
+ if (State == HITRETURN || State == ASKMORE || State == SETWSIZE)
+ buf[0] = 'r';
+ else if (State & INSERT)
+ {
+ if (State & REPLACE_FLAG)
+ buf[0] = 'R';
+ else
+ buf[0] = 'i';
+ }
+ else if (State & CMDLINE)
+ buf[0] = 'c';
+ else
+ buf[0] = 'n';
+
+ buf[1] = NUL;
+ retvar->var_val.var_string = vim_strsave(buf);
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "nr2char()" function
+ */
+ static void
+f_nr2char(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[NUMBUFLEN];
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ buf[(*mb_char2bytes)((int)get_var_number(&argvars[0]), buf)] = NUL;
+ else
+#endif
+ {
+ buf[0] = (char_u)get_var_number(&argvars[0]);
+ buf[1] = NUL;
+ }
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strsave(buf);
+}
+
+/*
+ * "rename({from}, {to})" function
+ */
+ static void
+f_rename(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[NUMBUFLEN];
+
+ if (check_restricted() || check_secure())
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = vim_rename(get_var_string(&argvars[0]),
+ get_var_string_buf(&argvars[1], buf));
+}
+
+/*
+ * "resolve()" function
+ */
+ static void
+f_resolve(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+
+ p = get_var_string(&argvars[0]);
+#ifdef FEAT_SHORTCUT
+ {
+ char_u *v = NULL;
+
+ v = mch_resolve_shortcut(p);
+ if (v != NULL)
+ retvar->var_val.var_string = v;
+ else
+ retvar->var_val.var_string = vim_strsave(p);
+ }
+#else
+# ifdef HAVE_READLINK
+ {
+ char_u buf[MAXPATHL + 1];
+ char_u *cpy;
+ int len;
+ char_u *remain = NULL;
+ char_u *q;
+ int is_relative_to_current = FALSE;
+ int has_trailing_pathsep = FALSE;
+ int limit = 100;
+
+ p = vim_strsave(p);
+
+ if (p[0] == '.' && (vim_ispathsep(p[1])
+ || (p[1] == '.' && (vim_ispathsep(p[2])))))
+ is_relative_to_current = TRUE;
+
+ len = STRLEN(p);
+ if (len > 0 && vim_ispathsep(p[len-1]))
+ has_trailing_pathsep = TRUE;
+
+ q = getnextcomp(p);
+ if (*q != NUL)
+ {
+ /* Separate the first path component in "p", and keep the
+ * remainder (beginning with the path separator). */
+ remain = vim_strsave(q - 1);
+ q[-1] = NUL;
+ }
+
+ for (;;)
+ {
+ for (;;)
+ {
+ len = readlink((char *)p, (char *)buf, MAXPATHL);
+ if (len <= 0)
+ break;
+ buf[len] = NUL;
+
+ if (limit-- == 0)
+ {
+ vim_free(p);
+ vim_free(remain);
+ EMSG(_("E655: Too many symbolic links (cycle?)"));
+ retvar->var_val.var_string = NULL;
+ goto fail;
+ }
+
+ /* Ensure that the result will have a trailing path separator
+ * if the argument has one. */
+ if (remain == NULL && has_trailing_pathsep)
+ add_pathsep(buf);
+
+ /* Separate the first path component in the link value and
+ * concatenate the remainders. */
+ q = getnextcomp(vim_ispathsep(*buf) ? buf + 1 : buf);
+ if (*q != NUL)
+ {
+ if (remain == NULL)
+ remain = vim_strsave(q - 1);
+ else
+ {
+ cpy = vim_strnsave(q-1, STRLEN(q-1)+STRLEN(remain));
+ if (cpy != NULL)
+ {
+ STRCAT(cpy, remain);
+ vim_free(remain);
+ remain = cpy;
+ }
+ }
+ q[-1] = NUL;
+ }
+
+ q = gettail(p);
+ if (q > p && *q == NUL)
+ {
+ /* Ignore trailing path separator. */
+ q[-1] = NUL;
+ q = gettail(p);
+ }
+ if (q > p && !mch_isFullName(buf))
+ {
+ /* symlink is relative to directory of argument */
+ cpy = alloc((unsigned)(STRLEN(p) + STRLEN(buf) + 1));
+ if (cpy != NULL)
+ {
+ STRCPY(cpy, p);
+ STRCPY(gettail(cpy), buf);
+ vim_free(p);
+ p = cpy;
+ }
+ }
+ else
+ {
+ vim_free(p);
+ p = vim_strsave(buf);
+ }
+ }
+
+ if (remain == NULL)
+ break;
+
+ /* Append the first path component of "remain" to "p". */
+ q = getnextcomp(remain + 1);
+ len = q - remain - (*q != NUL);
+ cpy = vim_strnsave(p, STRLEN(p) + len);
+ if (cpy != NULL)
+ {
+ STRNCAT(cpy, remain, len);
+ vim_free(p);
+ p = cpy;
+ }
+ /* Shorten "remain". */
+ if (*q != NUL)
+ STRCPY(remain, q - 1);
+ else
+ {
+ vim_free(remain);
+ remain = NULL;
+ }
+ }
+
+ /* If the result is a relative path name, make it explicitly relative to
+ * the current directory if and only if the argument had this form. */
+ if (!vim_ispathsep(*p))
+ {
+ if (is_relative_to_current
+ && *p != NUL
+ && !(p[0] == '.'
+ && (p[1] == NUL
+ || vim_ispathsep(p[1])
+ || (p[1] == '.'
+ && (p[2] == NUL
+ || vim_ispathsep(p[2]))))))
+ {
+ /* Prepend "./". */
+ cpy = vim_strnsave((char_u *)"./", 2 + STRLEN(p));
+ if (cpy != NULL)
+ {
+ STRCAT(cpy, p);
+ vim_free(p);
+ p = cpy;
+ }
+ }
+ else if (!is_relative_to_current)
+ {
+ /* Strip leading "./". */
+ q = p;
+ while (q[0] == '.' && vim_ispathsep(q[1]))
+ q += 2;
+ if (q > p)
+ mch_memmove(p, p + 2, STRLEN(p + 2) + (size_t)1);
+ }
+ }
+
+ /* Ensure that the result will have no trailing path separator
+ * if the argument had none. But keep "/" or "//". */
+ if (!has_trailing_pathsep)
+ {
+ q = p + STRLEN(p);
+ while ((q > p + 2 || (q == p + 2 && !vim_ispathsep(*p)))
+ && vim_ispathsep(q[-1]))
+ --q;
+ *q = NUL;
+ }
+
+ retvar->var_val.var_string = p;
+ }
+# else
+ retvar->var_val.var_string = vim_strsave(p);
+# endif
+#endif
+
+ simplify_filename(retvar->var_val.var_string);
+
+#ifdef HAVE_READLINK
+fail:
+#endif
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "simplify()" function
+ */
+ static void
+f_simplify(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+
+ p = get_var_string(&argvars[0]);
+ retvar->var_val.var_string = vim_strsave(p);
+ simplify_filename(retvar->var_val.var_string); /* simplify in place */
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "search()" function
+ */
+ static void
+f_search(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *pat;
+ pos_T pos;
+ int save_p_ws = p_ws;
+ int dir;
+
+ pat = get_var_string(&argvars[0]);
+ dir = get_search_arg(&argvars[1], NULL); /* may set p_ws */
+
+ pos = curwin->w_cursor;
+ if (searchit(curwin, curbuf, &pos, dir, pat, 1L,
+ SEARCH_KEEP, RE_SEARCH) != FAIL)
+ {
+ retvar->var_val.var_number = pos.lnum;
+ curwin->w_cursor = pos;
+ /* "/$" will put the cursor after the end of the line, may need to
+ * correct that here */
+ check_cursor();
+ }
+ else
+ retvar->var_val.var_number = 0;
+ p_ws = save_p_ws;
+}
+
+#define SP_NOMOVE 1 /* don't move cursor */
+#define SP_REPEAT 2 /* repeat to find outer pair */
+#define SP_RETCOUNT 4 /* return matchcount */
+
+/*
+ * "searchpair()" function
+ */
+ static void
+f_searchpair(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *spat, *mpat, *epat;
+ char_u *skip;
+ char_u *pat, *pat2, *pat3;
+ pos_T pos;
+ pos_T firstpos;
+ pos_T save_cursor;
+ pos_T save_pos;
+ int save_p_ws = p_ws;
+ char_u *save_cpo;
+ int dir;
+ int flags = 0;
+ char_u nbuf1[NUMBUFLEN];
+ char_u nbuf2[NUMBUFLEN];
+ char_u nbuf3[NUMBUFLEN];
+ int n;
+ int r;
+ int nest = 1;
+ int err;
+
+ retvar->var_val.var_number = 0; /* default: FAIL */
+
+ /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+
+ /* Get the three pattern arguments: start, middle, end. */
+ spat = get_var_string(&argvars[0]);
+ mpat = get_var_string_buf(&argvars[1], nbuf1);
+ epat = get_var_string_buf(&argvars[2], nbuf2);
+
+ /* Make two search patterns: start/end (pat2, for in nested pairs) and
+ * start/middle/end (pat3, for the top pair). */
+ pat2 = alloc((unsigned)(STRLEN(spat) + STRLEN(epat) + 15));
+ pat3 = alloc((unsigned)(STRLEN(spat) + STRLEN(mpat) + STRLEN(epat) + 23));
+ if (pat2 == NULL || pat3 == NULL)
+ goto theend;
+ sprintf((char *)pat2, "\\(%s\\m\\)\\|\\(%s\\m\\)", spat, epat);
+ if (*mpat == NUL)
+ STRCPY(pat3, pat2);
+ else
+ sprintf((char *)pat3, "\\(%s\\m\\)\\|\\(%s\\m\\)\\|\\(%s\\m\\)",
+ spat, epat, mpat);
+
+ /* Handle the optional fourth argument: flags */
+ dir = get_search_arg(&argvars[3], &flags); /* may set p_ws */
+
+ /* Optional fifth argument: skip expresion */
+ if (argvars[3].var_type == VAR_UNKNOWN
+ || argvars[4].var_type == VAR_UNKNOWN)
+ skip = (char_u *)"";
+ else
+ skip = get_var_string_buf(&argvars[4], nbuf3);
+
+ save_cursor = curwin->w_cursor;
+ pos = curwin->w_cursor;
+ firstpos.lnum = 0;
+ pat = pat3;
+ for (;;)
+ {
+ n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
+ SEARCH_KEEP, RE_SEARCH);
+ if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
+ /* didn't find it or found the first match again: FAIL */
+ break;
+
+ if (firstpos.lnum == 0)
+ firstpos = pos;
+
+ /* If the skip pattern matches, ignore this match. */
+ if (*skip != NUL)
+ {
+ save_pos = curwin->w_cursor;
+ curwin->w_cursor = pos;
+ r = eval_to_bool(skip, &err, NULL, FALSE);
+ curwin->w_cursor = save_pos;
+ if (err)
+ {
+ /* Evaluating {skip} caused an error, break here. */
+ curwin->w_cursor = save_cursor;
+ retvar->var_val.var_number = -1;
+ break;
+ }
+ if (r)
+ continue;
+ }
+
+ if ((dir == BACKWARD && n == 3) || (dir == FORWARD && n == 2))
+ {
+ /* Found end when searching backwards or start when searching
+ * forward: nested pair. */
+ ++nest;
+ pat = pat2; /* nested, don't search for middle */
+ }
+ else
+ {
+ /* Found end when searching forward or start when searching
+ * backward: end of (nested) pair; or found middle in outer pair. */
+ if (--nest == 1)
+ pat = pat3; /* outer level, search for middle */
+ }
+
+ if (nest == 0)
+ {
+ /* Found the match: return matchcount or line number. */
+ if (flags & SP_RETCOUNT)
+ ++retvar->var_val.var_number;
+ else
+ retvar->var_val.var_number = pos.lnum;
+ curwin->w_cursor = pos;
+ if (!(flags & SP_REPEAT))
+ break;
+ nest = 1; /* search for next unmatched */
+ }
+ }
+
+ /* If 'n' flag is used or search failed: restore cursor position. */
+ if ((flags & SP_NOMOVE) || retvar->var_val.var_number == 0)
+ curwin->w_cursor = save_cursor;
+
+theend:
+ vim_free(pat2);
+ vim_free(pat3);
+ p_ws = save_p_ws;
+ p_cpo = save_cpo;
+}
+
+ static int
+get_search_arg(varp, flagsp)
+ VAR varp;
+ int *flagsp;
+{
+ int dir = FORWARD;
+ char_u *flags;
+ char_u nbuf[NUMBUFLEN];
+
+ if (varp->var_type != VAR_UNKNOWN)
+ {
+ flags = get_var_string_buf(varp, nbuf);
+ if (vim_strchr(flags, 'b') != NULL)
+ dir = BACKWARD;
+ if (vim_strchr(flags, 'w') != NULL)
+ p_ws = TRUE;
+ if (vim_strchr(flags, 'W') != NULL)
+ p_ws = FALSE;
+ if (flagsp != NULL)
+ {
+ if (vim_strchr(flags, 'n') != NULL)
+ *flagsp |= SP_NOMOVE;
+ if (vim_strchr(flags, 'r') != NULL)
+ *flagsp |= SP_REPEAT;
+ if (vim_strchr(flags, 'm') != NULL)
+ *flagsp |= SP_RETCOUNT;
+ }
+ }
+ return dir;
+}
+
+/*
+ * "setbufvar()" function
+ */
+/*ARGSUSED*/
+ static void
+f_setbufvar(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ buf_T *buf;
+#ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+#else
+ buf_T *save_curbuf;
+#endif
+ char_u *varname, *bufvarname;
+ VAR varp;
+ char_u nbuf[NUMBUFLEN];
+
+ if (check_restricted() || check_secure())
+ return;
+ ++emsg_off;
+ buf = get_buf_var(&argvars[0]);
+ varname = get_var_string(&argvars[1]);
+ varp = &argvars[2];
+
+ if (buf != NULL && varname != NULL && varp != NULL)
+ {
+ /* set curbuf to be our buf, temporarily */
+#ifdef FEAT_AUTOCMD
+ aucmd_prepbuf(&aco, buf);
+#else
+ save_curbuf = curbuf;
+ curbuf = buf;
+#endif
+
+ if (*varname == '&')
+ {
+ ++varname;
+ set_option_value(varname, get_var_number(varp),
+ get_var_string_buf(varp, nbuf), OPT_LOCAL);
+ }
+ else
+ {
+ bufvarname = alloc((unsigned)STRLEN(varname) + 3);
+ if (bufvarname != NULL)
+ {
+ STRCPY(bufvarname, "b:");
+ STRCPY(bufvarname + 2, varname);
+ set_var(bufvarname, varp);
+ vim_free(bufvarname);
+ }
+ }
+
+ /* reset notion of buffer */
+#ifdef FEAT_AUTOCMD
+ aucmd_restbuf(&aco);
+#else
+ curbuf = save_curbuf;
+#endif
+ }
+ --emsg_off;
+}
+
+/*
+ * "setcmdpos()" function
+ */
+ static void
+f_setcmdpos(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = set_cmdline_pos(
+ (int)get_var_number(&argvars[0]) - 1);
+}
+
+/*
+ * "setline()" function
+ */
+ static void
+f_setline(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum;
+ char_u *line;
+
+ lnum = get_var_lnum(argvars);
+ line = get_var_string(&argvars[1]);
+ retvar->var_val.var_number = 1; /* FAIL is default */
+
+ if (lnum >= 1
+ && lnum <= curbuf->b_ml.ml_line_count
+ && u_savesub(lnum) == OK
+ && ml_replace(lnum, line, TRUE) == OK)
+ {
+ changed_bytes(lnum, 0);
+ check_cursor_col();
+ retvar->var_val.var_number = 0;
+ }
+}
+
+/*
+ * "setreg()" function
+ */
+ static void
+f_setreg(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int regname;
+ char_u *strregname;
+ char_u *stropt;
+ int append;
+ char_u yank_type;
+ long block_len;
+
+ block_len = -1;
+ yank_type = MAUTO;
+ append = FALSE;
+
+ strregname = get_var_string(argvars);
+ retvar->var_val.var_number = 1; /* FAIL is default */
+
+ regname = (strregname == NULL ? '"' : *strregname);
+ if (regname == 0 || regname == '@')
+ regname = '"';
+ else if (regname == '=')
+ return;
+
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ {
+ for (stropt = get_var_string(&argvars[2]); *stropt != NUL; ++stropt)
+ switch (*stropt)
+ {
+ case 'a': case 'A': /* append */
+ append = TRUE;
+ break;
+ case 'v': case 'c': /* character-wise selection */
+ yank_type = MCHAR;
+ break;
+ case 'V': case 'l': /* line-wise selection */
+ yank_type = MLINE;
+ break;
+#ifdef FEAT_VISUAL
+ case 'b': case Ctrl_V: /* block-wise selection */
+ yank_type = MBLOCK;
+ if (VIM_ISDIGIT(stropt[1]))
+ {
+ ++stropt;
+ block_len = getdigits(&stropt) - 1;
+ --stropt;
+ }
+ break;
+#endif
+ }
+ }
+
+ write_reg_contents_ex(regname, get_var_string(&argvars[1]), -1,
+ append, yank_type, block_len);
+ retvar->var_val.var_number = 0;
+}
+
+
+/*
+ * "setwinvar(expr)" function
+ */
+/*ARGSUSED*/
+ static void
+f_setwinvar(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ win_T *win;
+#ifdef FEAT_WINDOWS
+ win_T *save_curwin;
+#endif
+ char_u *varname, *winvarname;
+ VAR varp;
+ char_u nbuf[NUMBUFLEN];
+
+ if (check_restricted() || check_secure())
+ return;
+ ++emsg_off;
+ win = find_win_by_nr(&argvars[0]);
+ varname = get_var_string(&argvars[1]);
+ varp = &argvars[2];
+
+ if (win != NULL && varname != NULL && varp != NULL)
+ {
+#ifdef FEAT_WINDOWS
+ /* set curwin to be our win, temporarily */
+ save_curwin = curwin;
+ curwin = win;
+ curbuf = curwin->w_buffer;
+#endif
+
+ if (*varname == '&')
+ {
+ ++varname;
+ set_option_value(varname, get_var_number(varp),
+ get_var_string_buf(varp, nbuf), OPT_LOCAL);
+ }
+ else
+ {
+ winvarname = alloc((unsigned)STRLEN(varname) + 3);
+ if (winvarname != NULL)
+ {
+ STRCPY(winvarname, "w:");
+ STRCPY(winvarname + 2, varname);
+ set_var(winvarname, varp);
+ vim_free(winvarname);
+ }
+ }
+
+#ifdef FEAT_WINDOWS
+ /* Restore current window, if it's still valid (autocomands can make
+ * it invalid). */
+ if (win_valid(save_curwin))
+ {
+ curwin = save_curwin;
+ curbuf = curwin->w_buffer;
+ }
+#endif
+ }
+ --emsg_off;
+}
+
+/*
+ * "nextnonblank()" function
+ */
+ static void
+f_nextnonblank(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum;
+
+ for (lnum = get_var_lnum(argvars); ; ++lnum)
+ {
+ if (lnum > curbuf->b_ml.ml_line_count)
+ {
+ lnum = 0;
+ break;
+ }
+ if (*skipwhite(ml_get(lnum)) != NUL)
+ break;
+ }
+ retvar->var_val.var_number = lnum;
+}
+
+/*
+ * "prevnonblank()" function
+ */
+ static void
+f_prevnonblank(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ linenr_T lnum;
+
+ lnum = get_var_lnum(argvars);
+ if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count)
+ lnum = 0;
+ else
+ while (lnum >= 1 && *skipwhite(ml_get(lnum)) == NUL)
+ --lnum;
+ retvar->var_val.var_number = lnum;
+}
+
+#if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11)
+static void make_connection __ARGS((void));
+static int check_connection __ARGS((void));
+
+ static void
+make_connection()
+{
+ if (X_DISPLAY == NULL
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ {
+ x_force_connect = TRUE;
+ setup_term_clip();
+ x_force_connect = FALSE;
+ }
+}
+
+ static int
+check_connection()
+{
+ make_connection();
+ if (X_DISPLAY == NULL)
+ {
+ EMSG(_("E240: No connection to Vim server"));
+ return FAIL;
+ }
+ return OK;
+}
+#endif
+
+/*ARGSUSED*/
+ static void
+f_serverlist(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *r = NULL;
+
+#ifdef FEAT_CLIENTSERVER
+# ifdef WIN32
+ r = serverGetVimNames();
+# else
+ make_connection();
+ if (X_DISPLAY != NULL)
+ r = serverGetVimNames(X_DISPLAY);
+# endif
+#endif
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = r;
+}
+
+/*ARGSUSED*/
+ static void
+f_remote_peek(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CLIENTSERVER
+ var v;
+ char_u *s = NULL;
+# ifdef WIN32
+ int n = 0;
+# endif
+
+ if (check_restricted() || check_secure())
+ {
+ retvar->var_val.var_number = -1;
+ return;
+ }
+# ifdef WIN32
+ sscanf(get_var_string(&argvars[0]), "%x", &n);
+ if (n == 0)
+ retvar->var_val.var_number = -1;
+ else
+ {
+ s = serverGetReply((HWND)n, FALSE, FALSE, FALSE);
+ retvar->var_val.var_number = (s != NULL);
+ }
+# else
+ retvar->var_val.var_number = 0;
+ if (check_connection() == FAIL)
+ return;
+
+ retvar->var_val.var_number = serverPeekReply(X_DISPLAY,
+ serverStrToWin(get_var_string(&argvars[0])), &s);
+# endif
+
+ if (argvars[1].var_type != VAR_UNKNOWN && retvar->var_val.var_number > 0)
+ {
+ v.var_type = VAR_STRING;
+ v.var_val.var_string = vim_strsave(s);
+ set_var(get_var_string(&argvars[1]), &v);
+ }
+#else
+ retvar->var_val.var_number = -1;
+#endif
+}
+
+/*ARGSUSED*/
+ static void
+f_remote_read(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *r = NULL;
+
+#ifdef FEAT_CLIENTSERVER
+ if (!check_restricted() && !check_secure())
+ {
+# ifdef WIN32
+ /* The server's HWND is encoded in the 'id' parameter */
+ int n = 0;
+
+ sscanf(get_var_string(&argvars[0]), "%x", &n);
+ if (n != 0)
+ r = serverGetReply((HWND)n, FALSE, TRUE, TRUE);
+ if (r == NULL)
+# else
+ if (check_connection() == FAIL || serverReadReply(X_DISPLAY,
+ serverStrToWin(get_var_string(&argvars[0])), &r, FALSE) < 0)
+# endif
+ EMSG(_("E277: Unable to read a server reply"));
+ }
+#endif
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = r;
+}
+
+/*ARGSUSED*/
+ static void
+f_server2client(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_CLIENTSERVER
+ char_u buf[NUMBUFLEN];
+ char_u *server = get_var_string(&argvars[0]);
+ char_u *reply = get_var_string_buf(&argvars[1], buf);
+
+ retvar->var_val.var_number = -1;
+ if (check_restricted() || check_secure())
+ return;
+# ifdef FEAT_X11
+ if (check_connection() == FAIL)
+ return;
+# endif
+
+ if (serverSendReply(server, reply) < 0)
+ {
+ EMSG(_("E258: Unable to send to client"));
+ return;
+ }
+ retvar->var_val.var_number = 0;
+#else
+ retvar->var_val.var_number = -1;
+#endif
+}
+
+#ifdef FEAT_CLIENTSERVER
+static void remote_common __ARGS((VAR argvars, VAR retvar, int expr));
+
+ static void
+remote_common(argvars, retvar, expr)
+ VAR argvars;
+ VAR retvar;
+ int expr;
+{
+ char_u *server_name;
+ char_u *keys;
+ char_u *r = NULL;
+ char_u buf[NUMBUFLEN];
+# ifdef WIN32
+ HWND w;
+# else
+ Window w;
+# endif
+
+ if (check_restricted() || check_secure())
+ return;
+
+# ifdef FEAT_X11
+ if (check_connection() == FAIL)
+ return;
+# endif
+
+ server_name = get_var_string(&argvars[0]);
+ keys = get_var_string_buf(&argvars[1], buf);
+# ifdef WIN32
+ if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0)
+# else
+ if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0, TRUE)
+ < 0)
+# endif
+ {
+ if (r != NULL)
+ EMSG(r); /* sending worked but evaluation failed */
+ else
+ EMSG2(_("E241: Unable to send to %s"), server_name);
+ return;
+ }
+
+ retvar->var_val.var_string = r;
+
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ {
+ var v;
+ char_u str[30];
+
+ sprintf((char *)str, "0x%x", (unsigned int)w);
+ v.var_type = VAR_STRING;
+ v.var_val.var_string = vim_strsave(str);
+ set_var(get_var_string(&argvars[2]), &v);
+ }
+}
+#endif
+
+/*
+ * "remote_expr()" function
+ */
+/*ARGSUSED*/
+ static void
+f_remote_expr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+#ifdef FEAT_CLIENTSERVER
+ remote_common(argvars, retvar, TRUE);
+#endif
+}
+
+/*
+ * "remote_send()" function
+ */
+/*ARGSUSED*/
+ static void
+f_remote_send(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = NULL;
+#ifdef FEAT_CLIENTSERVER
+ remote_common(argvars, retvar, FALSE);
+#endif
+}
+
+/*
+ * "remote_foreground()" function
+ */
+/*ARGSUSED*/
+ static void
+f_remote_foreground(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = 0;
+#ifdef FEAT_CLIENTSERVER
+# ifdef WIN32
+ /* On Win32 it's done in this application. */
+ serverForeground(get_var_string(&argvars[0]));
+# else
+ /* Send a foreground() expression to the server. */
+ argvars[1].var_type = VAR_STRING;
+ argvars[1].var_val.var_string = vim_strsave((char_u *)"foreground()");
+ argvars[2].var_type = VAR_UNKNOWN;
+ remote_common(argvars, retvar, TRUE);
+ vim_free(argvars[1].var_val.var_string);
+# endif
+#endif
+}
+
+#ifdef HAVE_STRFTIME
+/*
+ * "strftime({format}[, {time}])" function
+ */
+ static void
+f_strftime(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u result_buf[256];
+ struct tm *curtime;
+ time_t seconds;
+ char_u *p;
+
+ retvar->var_type = VAR_STRING;
+
+ p = get_var_string(&argvars[0]);
+ if (argvars[1].var_type == VAR_UNKNOWN)
+ seconds = time(NULL);
+ else
+ seconds = (time_t)get_var_number(&argvars[1]);
+ curtime = localtime(&seconds);
+ /* MSVC returns NULL for an invalid value of seconds. */
+ if (curtime == NULL)
+ retvar->var_val.var_string = vim_strsave((char_u *)_("(Invalid)"));
+ else
+ {
+# ifdef FEAT_MBYTE
+ vimconv_T conv;
+ char_u *enc;
+
+ conv.vc_type = CONV_NONE;
+ enc = enc_locale();
+ convert_setup(&conv, p_enc, enc);
+ if (conv.vc_type != CONV_NONE)
+ p = string_convert(&conv, p, NULL);
+# endif
+ if (p != NULL)
+ (void)strftime((char *)result_buf, sizeof(result_buf),
+ (char *)p, curtime);
+ else
+ result_buf[0] = NUL;
+
+# ifdef FEAT_MBYTE
+ if (conv.vc_type != CONV_NONE)
+ vim_free(p);
+ convert_setup(&conv, enc, p_enc);
+ if (conv.vc_type != CONV_NONE)
+ retvar->var_val.var_string =
+ string_convert(&conv, result_buf, NULL);
+ else
+# endif
+ retvar->var_val.var_string = vim_strsave(result_buf);
+
+# ifdef FEAT_MBYTE
+ /* Release conversion descriptors */
+ convert_setup(&conv, NULL, NULL);
+ vim_free(enc);
+# endif
+ }
+}
+#endif
+
+/*
+ * "stridx()" function
+ */
+ static void
+f_stridx(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[NUMBUFLEN];
+ char_u *needle;
+ char_u *haystack;
+ char_u *pos;
+
+ needle = get_var_string(&argvars[1]);
+ haystack = get_var_string_buf(&argvars[0], buf);
+ pos = (char_u *)strstr((char *)haystack, (char *)needle);
+
+ if (pos == NULL)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = (varnumber_T) (pos - haystack);
+}
+
+/*
+ * "strridx()" function
+ */
+ static void
+f_strridx(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u buf[NUMBUFLEN];
+ char_u *needle;
+ char_u *haystack;
+ char_u *rest;
+ char_u *lastmatch = NULL;
+
+ needle = get_var_string(&argvars[1]);
+ haystack = get_var_string_buf(&argvars[0], buf);
+ rest = haystack;
+ while (*haystack != '\0')
+ {
+ rest = (char_u *)strstr((char *)rest, (char *)needle);
+ if (rest == NULL)
+ break;
+ lastmatch = rest++;
+ }
+
+ if (lastmatch == NULL)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = (varnumber_T) (lastmatch - haystack);
+}
+
+/*
+ * "strlen()" function
+ */
+ static void
+f_strlen(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_val.var_number = (varnumber_T) (STRLEN(get_var_string(&argvars[0])));
+}
+
+/*
+ * "strpart()" function
+ */
+ static void
+f_strpart(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+ int n;
+ int len;
+ int slen;
+
+ p = get_var_string(&argvars[0]);
+ slen = (int)STRLEN(p);
+
+ n = get_var_number(&argvars[1]);
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ len = get_var_number(&argvars[2]);
+ else
+ len = slen - n; /* default len: all bytes that are available. */
+
+ /*
+ * Only return the overlap between the specified part and the actual
+ * string.
+ */
+ if (n < 0)
+ {
+ len += n;
+ n = 0;
+ }
+ else if (n > slen)
+ n = slen;
+ if (len < 0)
+ len = 0;
+ else if (n + len > slen)
+ len = slen - n;
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_strnsave(p + n, len);
+}
+
+/*
+ * "strtrans()" function
+ */
+ static void
+f_strtrans(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = transstr(get_var_string(&argvars[0]));
+}
+
+/*
+ * "synID(line, col, trans)" function
+ */
+/*ARGSUSED*/
+ static void
+f_synID(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int id = 0;
+#ifdef FEAT_SYN_HL
+ long line;
+ long col;
+ int trans;
+
+ line = get_var_lnum(argvars);
+ col = get_var_number(&argvars[1]) - 1;
+ trans = get_var_number(&argvars[2]);
+
+ if (line >= 1 && line <= curbuf->b_ml.ml_line_count
+ && col >= 0 && col < (long)STRLEN(ml_get(line)))
+ id = syn_get_id(line, col, trans);
+#endif
+
+ retvar->var_val.var_number = id;
+}
+
+/*
+ * "synIDattr(id, what [, mode])" function
+ */
+/*ARGSUSED*/
+ static void
+f_synIDattr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p = NULL;
+#ifdef FEAT_SYN_HL
+ int id;
+ char_u *what;
+ char_u *mode;
+ char_u modebuf[NUMBUFLEN];
+ int modec;
+
+ id = get_var_number(&argvars[0]);
+ what = get_var_string(&argvars[1]);
+ if (argvars[2].var_type != VAR_UNKNOWN)
+ {
+ mode = get_var_string_buf(&argvars[2], modebuf);
+ modec = TOLOWER_ASC(mode[0]);
+ if (modec != 't' && modec != 'c'
+#ifdef FEAT_GUI
+ && modec != 'g'
+#endif
+ )
+ modec = 0; /* replace invalid with current */
+ }
+ else
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ modec = 'g';
+ else
+#endif
+ if (t_colors > 1)
+ modec = 'c';
+ else
+ modec = 't';
+ }
+
+
+ switch (TOLOWER_ASC(what[0]))
+ {
+ case 'b':
+ if (TOLOWER_ASC(what[1]) == 'g') /* bg[#] */
+ p = highlight_color(id, what, modec);
+ else /* bold */
+ p = highlight_has_attr(id, HL_BOLD, modec);
+ break;
+
+ case 'f': /* fg[#] */
+ p = highlight_color(id, what, modec);
+ break;
+
+ case 'i':
+ if (TOLOWER_ASC(what[1]) == 'n') /* inverse */
+ p = highlight_has_attr(id, HL_INVERSE, modec);
+ else /* italic */
+ p = highlight_has_attr(id, HL_ITALIC, modec);
+ break;
+
+ case 'n': /* name */
+ p = get_highlight_name(NULL, id - 1);
+ break;
+
+ case 'r': /* reverse */
+ p = highlight_has_attr(id, HL_INVERSE, modec);
+ break;
+
+ case 's': /* standout */
+ p = highlight_has_attr(id, HL_STANDOUT, modec);
+ break;
+
+ case 'u': /* underline */
+ p = highlight_has_attr(id, HL_UNDERLINE, modec);
+ break;
+ }
+
+ if (p != NULL)
+ p = vim_strsave(p);
+#endif
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = p;
+}
+
+/*
+ * "synIDtrans(id)" function
+ */
+/*ARGSUSED*/
+ static void
+f_synIDtrans(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int id;
+
+#ifdef FEAT_SYN_HL
+ id = get_var_number(&argvars[0]);
+
+ if (id > 0)
+ id = syn_get_final_id(id);
+ else
+#endif
+ id = 0;
+
+ retvar->var_val.var_number = id;
+}
+
+/*
+ * "system()" function
+ */
+ static void
+f_system(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+
+ p = get_cmd_output(get_var_string(&argvars[0]), SHELL_SILENT);
+#ifdef USE_CR
+ /* translate <CR> into <NL> */
+ if (p != NULL)
+ {
+ char_u *s;
+
+ for (s = p; *s; ++s)
+ {
+ if (*s == CAR)
+ *s = NL;
+ }
+ }
+#else
+# ifdef USE_CRNL
+ /* translate <CR><NL> into <NL> */
+ if (p != NULL)
+ {
+ char_u *s, *d;
+
+ d = p;
+ for (s = p; *s; ++s)
+ {
+ if (s[0] == CAR && s[1] == NL)
+ ++s;
+ *d++ = *s;
+ }
+ *d = NUL;
+ }
+# endif
+#endif
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = p;
+}
+
+/*
+ * "submatch()" function
+ */
+ static void
+f_submatch(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = reg_submatch((int)get_var_number(&argvars[0]));
+}
+
+/*
+ * "substitute()" function
+ */
+ static void
+f_substitute(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u patbuf[NUMBUFLEN];
+ char_u subbuf[NUMBUFLEN];
+ char_u flagsbuf[NUMBUFLEN];
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = do_string_sub(
+ get_var_string(&argvars[0]),
+ get_var_string_buf(&argvars[1], patbuf),
+ get_var_string_buf(&argvars[2], subbuf),
+ get_var_string_buf(&argvars[3], flagsbuf));
+}
+
+/*
+ * "tempname()" function
+ */
+/*ARGSUSED*/
+ static void
+f_tempname(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ static int x = 'A';
+
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = vim_tempname(x);
+
+ /* Advance 'x' to use A-Z and 0-9, so that there are at least 34 different
+ * names. Skip 'I' and 'O', they are used for shell redirection. */
+ do
+ {
+ if (x == 'Z')
+ x = '0';
+ else if (x == '9')
+ x = 'A';
+ else
+ {
+#ifdef EBCDIC
+ if (x == 'I')
+ x = 'J';
+ else if (x == 'R')
+ x = 'S';
+ else
+#endif
+ ++x;
+ }
+ } while (x == 'I' || x == 'O');
+}
+
+/*
+ * "tolower(string)" function
+ */
+ static void
+f_tolower(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+
+ p = vim_strsave(get_var_string(&argvars[0]));
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = p;
+
+ if (p != NULL)
+ while (*p != NUL)
+ {
+#ifdef FEAT_MBYTE
+ int l;
+
+ if (enc_utf8)
+ {
+ int c, lc;
+
+ c = utf_ptr2char(p);
+ lc = utf_tolower(c);
+ l = utf_ptr2len_check(p);
+ /* TODO: reallocate string when byte count changes. */
+ if (utf_char2len(lc) == l)
+ utf_char2bytes(lc, p);
+ p += l;
+ }
+ else if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ p += l; /* skip multi-byte character */
+ else
+#endif
+ {
+ *p = TOLOWER_LOC(*p); /* note that tolower() can be a macro */
+ ++p;
+ }
+ }
+}
+
+/*
+ * "toupper(string)" function
+ */
+ static void
+f_toupper(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ char_u *p;
+
+ p = vim_strsave(get_var_string(&argvars[0]));
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = p;
+
+ if (p != NULL)
+ while (*p != NUL)
+ {
+#ifdef FEAT_MBYTE
+ int l;
+
+ if (enc_utf8)
+ {
+ int c, uc;
+
+ c = utf_ptr2char(p);
+ uc = utf_toupper(c);
+ l = utf_ptr2len_check(p);
+ /* TODO: reallocate string when byte count changes. */
+ if (utf_char2len(uc) == l)
+ utf_char2bytes(uc, p);
+ p += l;
+ }
+ else if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ p += l; /* skip multi-byte character */
+ else
+#endif
+ {
+ *p = TOUPPER_LOC(*p); /* note that toupper() can be a macro */
+ p++;
+ }
+ }
+}
+
+/*
+ * "type(expr)" function
+ */
+ static void
+f_type(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ if (argvars[0].var_type == VAR_NUMBER)
+ retvar->var_val.var_number = 0;
+ else
+ retvar->var_val.var_number = 1;
+}
+
+/*
+ * "virtcol(string)" function
+ */
+ static void
+f_virtcol(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ colnr_T vcol = 0;
+ pos_T *fp;
+
+ fp = var2fpos(&argvars[0], FALSE);
+ if (fp != NULL && fp->lnum <= curbuf->b_ml.ml_line_count)
+ {
+ getvvcol(curwin, fp, NULL, NULL, &vcol);
+ ++vcol;
+ }
+
+ retvar->var_val.var_number = vcol;
+}
+
+/*
+ * "visualmode()" function
+ */
+/*ARGSUSED*/
+ static void
+f_visualmode(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_VISUAL
+ char_u str[2];
+
+ retvar->var_type = VAR_STRING;
+ str[0] = curbuf->b_visual_mode_eval;
+ str[1] = NUL;
+ retvar->var_val.var_string = vim_strsave(str);
+
+ /* A non-zero number or non-empty string argument: reset mode. */
+ if ((argvars[0].var_type == VAR_NUMBER
+ && argvars[0].var_val.var_number != 0)
+ || (argvars[0].var_type == VAR_STRING
+ && *get_var_string(&argvars[0]) != NUL))
+ curbuf->b_visual_mode_eval = NUL;
+#else
+ retvar->var_val.var_number = 0; /* return anything, it won't work anyway */
+#endif
+}
+
+/*
+ * "winbufnr(nr)" function
+ */
+ static void
+f_winbufnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ win_T *wp;
+
+ wp = find_win_by_nr(&argvars[0]);
+ if (wp == NULL)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = wp->w_buffer->b_fnum;
+}
+
+/*
+ * "wincol()" function
+ */
+/*ARGSUSED*/
+ static void
+f_wincol(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ validate_cursor();
+ retvar->var_val.var_number = curwin->w_wcol + 1;
+}
+
+/*
+ * "winheight(nr)" function
+ */
+ static void
+f_winheight(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ win_T *wp;
+
+ wp = find_win_by_nr(&argvars[0]);
+ if (wp == NULL)
+ retvar->var_val.var_number = -1;
+ else
+ retvar->var_val.var_number = wp->w_height;
+}
+
+/*
+ * "winline()" function
+ */
+/*ARGSUSED*/
+ static void
+f_winline(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ validate_cursor();
+ retvar->var_val.var_number = curwin->w_wrow + 1;
+}
+
+/*
+ * "winnr()" function
+ */
+/* ARGSUSED */
+ static void
+f_winnr(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ int nr = 1;
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+
+ for (wp = firstwin; wp != curwin; wp = wp->w_next)
+ ++nr;
+#endif
+ retvar->var_val.var_number = nr;
+}
+
+/*
+ * "winrestcmd()" function
+ */
+/* ARGSUSED */
+ static void
+f_winrestcmd(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+ int winnr = 1;
+ garray_T ga;
+ char_u buf[50];
+
+ ga_init2(&ga, (int)sizeof(char), 70);
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ sprintf((char *)buf, "%dresize %d|", winnr, wp->w_height);
+ ga_concat(&ga, buf);
+# ifdef FEAT_VERTSPLIT
+ sprintf((char *)buf, "vert %dresize %d|", winnr, wp->w_width);
+ ga_concat(&ga, buf);
+# endif
+ ++winnr;
+ }
+
+ retvar->var_val.var_string = ga.ga_data;
+#else
+ retvar->var_val.var_string = NULL;
+#endif
+ retvar->var_type = VAR_STRING;
+}
+
+/*
+ * "winwidth(nr)" function
+ */
+ static void
+f_winwidth(argvars, retvar)
+ VAR argvars;
+ VAR retvar;
+{
+ win_T *wp;
+
+ wp = find_win_by_nr(&argvars[0]);
+ if (wp == NULL)
+ retvar->var_val.var_number = -1;
+ else
+#ifdef FEAT_VERTSPLIT
+ retvar->var_val.var_number = wp->w_width;
+#else
+ retvar->var_val.var_number = Columns;
+#endif
+}
+
+ static win_T *
+find_win_by_nr(vp)
+ VAR vp;
+{
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+#endif
+ int nr;
+
+ nr = get_var_number(vp);
+
+#ifdef FEAT_WINDOWS
+ if (nr == 0)
+ return curwin;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (--nr <= 0)
+ break;
+ return wp;
+#else
+ if (nr == 0 || nr == 1)
+ return curwin;
+ return NULL;
+#endif
+}
+
+/*
+ * Translate a String variable into a position.
+ */
+ static pos_T *
+var2fpos(varp, lnum)
+ VAR varp;
+ int lnum; /* TRUE when $ is last line */
+{
+ char_u *name;
+ static pos_T pos;
+ pos_T *pp;
+
+ name = get_var_string(varp);
+ if (name[0] == '.') /* cursor */
+ return &curwin->w_cursor;
+ if (name[0] == '\'') /* mark */
+ {
+ pp = getmark(name[1], FALSE);
+ if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
+ return NULL;
+ return pp;
+ }
+ if (name[0] == '$') /* last column or line */
+ {
+ if (lnum)
+ {
+ pos.lnum = curbuf->b_ml.ml_line_count;
+ pos.col = 0;
+ }
+ else
+ {
+ pos.lnum = curwin->w_cursor.lnum;
+ pos.col = (colnr_T)STRLEN(ml_get_curline());
+ }
+ return &pos;
+ }
+ return NULL;
+}
+
+/*
+ * Get the length of an environment variable name.
+ * Advance "arg" to the first character after the name.
+ * Return 0 for error.
+ */
+ static int
+get_env_len(arg)
+ char_u **arg;
+{
+ char_u *p;
+ int len;
+
+ for (p = *arg; vim_isIDc(*p); ++p)
+ ;
+ if (p == *arg) /* no name found */
+ return 0;
+
+ len = (int)(p - *arg);
+ *arg = p;
+ return len;
+}
+
+/*
+ * Get the length of the name of a function or internal variable.
+ * "arg" is advanced to the first non-white character after the name.
+ * Return 0 if something is wrong.
+ */
+ static int
+get_id_len(arg)
+ char_u **arg;
+{
+ char_u *p;
+ int len;
+
+ /* Find the end of the name. */
+ for (p = *arg; eval_isnamec(*p); ++p)
+ ;
+ if (p == *arg) /* no name found */
+ return 0;
+
+ len = (int)(p - *arg);
+ *arg = skipwhite(p);
+
+ return len;
+}
+
+/*
+ * Get the length of the name of a function.
+ * "arg" is advanced to the first non-white character after the name.
+ * Return 0 if something is wrong.
+ * If the name contains 'magic' {}'s, expand them and return the
+ * expanded name in an allocated string via 'alias' - caller must free.
+ */
+ static int
+get_func_len(arg, alias, evaluate)
+ char_u **arg;
+ char_u **alias;
+ int evaluate;
+{
+ int len;
+#ifdef FEAT_MAGIC_BRACES
+ char_u *p;
+ char_u *expr_start;
+ char_u *expr_end;
+#endif
+
+ *alias = NULL; /* default to no alias */
+
+ if ((*arg)[0] == K_SPECIAL && (*arg)[1] == KS_EXTRA
+ && (*arg)[2] == (int)KE_SNR)
+ {
+ /* hard coded <SNR>, already translated */
+ *arg += 3;
+ return get_id_len(arg) + 3;
+ }
+ len = eval_fname_script(*arg);
+ if (len > 0)
+ {
+ /* literal "<SID>", "s:" or "<SNR>" */
+ *arg += len;
+ }
+
+#ifdef FEAT_MAGIC_BRACES
+ /*
+ * Find the end of the name;
+ */
+ p = find_name_end(*arg, &expr_start, &expr_end);
+ /* check for {} construction */
+ if (expr_start != NULL)
+ {
+ char_u *temp_string;
+
+ if (!evaluate)
+ {
+ len += (int)(p - *arg);
+ *arg = skipwhite(p);
+ return len;
+ }
+
+ /*
+ * Include any <SID> etc in the expanded string:
+ * Thus the -len here.
+ */
+ temp_string = make_expanded_name(*arg - len, expr_start, expr_end, p);
+ if (temp_string == NULL)
+ return 0;
+ *alias = temp_string;
+ *arg = skipwhite(p);
+ return (int)STRLEN(temp_string);
+ }
+#endif
+
+ len += get_id_len(arg);
+ if (len == 0)
+ EMSG2(_(e_invexpr2), *arg);
+
+ return len;
+}
+
+ static char_u *
+find_name_end(arg, expr_start, expr_end)
+ char_u *arg;
+ char_u **expr_start;
+ char_u **expr_end;
+{
+ int nesting = 0;
+ char_u *p;
+
+ *expr_start = NULL;
+ *expr_end = NULL;
+
+ for (p = arg; (*p != NUL && (eval_isnamec(*p) || nesting != 0)); ++p)
+ {
+#ifdef FEAT_MAGIC_BRACES
+ if (*p == '{')
+ {
+ nesting++;
+ if (*expr_start == NULL)
+ *expr_start = p;
+ }
+ else if (*p == '}')
+ {
+ nesting--;
+ if (nesting == 0 && *expr_end == NULL)
+ *expr_end = p;
+ }
+#endif
+ }
+
+ return p;
+}
+
+/*
+ * Return TRUE if character "c" can be used in a variable or function name.
+ */
+ static int
+eval_isnamec(c)
+ int c;
+{
+ return (ASCII_ISALNUM(c) || c == '_' || c == ':'
+#ifdef FEAT_MAGIC_BRACES
+ || c == '{' || c == '}'
+#endif
+ );
+}
+
+/*
+ * Find a v: variable.
+ * Return it's index, or -1 if not found.
+ */
+ static int
+find_vim_var(name, len)
+ char_u *name;
+ int len; /* length of "name" */
+{
+ char_u *vname;
+ int vlen;
+ int i;
+
+ /*
+ * Ignore "v:" for old built-in variables, require it for new ones.
+ */
+ if (name[0] == 'v' && name[1] == ':')
+ {
+ vname = name + 2;
+ vlen = len - 2;
+ }
+ else
+ {
+ vname = name;
+ vlen = len;
+ }
+ for (i = 0; i < VV_LEN; ++i)
+ if (vlen == vimvars[i].len && STRCMP(vname, vimvars[i].name) == 0
+ && ((vimvars[i].flags & VV_COMPAT) || vname != name))
+ return i;
+ return -1;
+}
+
+/*
+ * Set number v: variable to "val".
+ */
+ void
+set_vim_var_nr(idx, val)
+ int idx;
+ long val;
+{
+ vimvars[idx].val = (char_u *)val;
+}
+
+/*
+ * Get number v: variable value;
+ */
+ long
+get_vim_var_nr(idx)
+ int idx;
+{
+ return (long)vimvars[idx].val;
+}
+
+/*
+ * Set v:count, v:count1 and v:prevcount.
+ */
+ void
+set_vcount(count, count1)
+ long count;
+ long count1;
+{
+ vimvars[VV_PREVCOUNT].val = vimvars[VV_COUNT].val;
+ vimvars[VV_COUNT].val = (char_u *)count;
+ vimvars[VV_COUNT1].val = (char_u *)count1;
+}
+
+/*
+ * Set string v: variable to a copy of "val".
+ */
+ void
+set_vim_var_string(idx, val, len)
+ int idx;
+ char_u *val;
+ int len; /* length of "val" to use or -1 (whole string) */
+{
+ vim_free(vimvars[idx].val);
+ if (val == NULL)
+ vimvars[idx].val = NULL;
+ else if (len == -1)
+ vimvars[idx].val = vim_strsave(val);
+ else
+ vimvars[idx].val = vim_strnsave(val, len);
+}
+
+/*
+ * Set v:register if needed.
+ */
+ void
+set_reg_var(c)
+ int c;
+{
+ char_u regname;
+
+ if (c == 0 || c == ' ')
+ regname = '"';
+ else
+ regname = c;
+ /* Avoid free/alloc when the value is already right. */
+ if (vimvars[VV_REG].val == NULL || vimvars[VV_REG].val[0] != c)
+ set_vim_var_string(VV_REG, &regname, 1);
+}
+
+/*
+ * Get or set v:exception. If "oldval" == NULL, return the current value.
+ * Otherwise, restore the value to "oldval" and return NULL.
+ * Must always be called in pairs to save and restore v:exception! Does not
+ * take care of memory allocations.
+ */
+ char_u *
+v_exception(oldval)
+ char_u *oldval;
+{
+ if (oldval == NULL)
+ return vimvars[VV_EXCEPTION].val;
+
+ vimvars[VV_EXCEPTION].val = oldval;
+ return NULL;
+}
+
+/*
+ * Get or set v:throwpoint. If "oldval" == NULL, return the current value.
+ * Otherwise, restore the value to "oldval" and return NULL.
+ * Must always be called in pairs to save and restore v:throwpoint! Does not
+ * take care of memory allocations.
+ */
+ char_u *
+v_throwpoint(oldval)
+ char_u *oldval;
+{
+ if (oldval == NULL)
+ return vimvars[VV_THROWPOINT].val;
+
+ vimvars[VV_THROWPOINT].val = oldval;
+ return NULL;
+}
+
+#if defined(FEAT_AUTOCMD) || defined(PROTO)
+/*
+ * Set v:cmdarg.
+ * If "eap" != NULL, use "eap" to generate the value and return the old value.
+ * If "oldarg" != NULL, restore the value to "oldarg" and return NULL.
+ * Must always be called in pairs!
+ */
+ char_u *
+set_cmdarg(eap, oldarg)
+ exarg_T *eap;
+ char_u *oldarg;
+{
+ char_u *oldval;
+ char_u *newval;
+ unsigned len;
+
+ oldval = vimvars[VV_CMDARG].val;
+ if (eap != NULL)
+ {
+ if (eap->force_bin == FORCE_BIN)
+ len = 6;
+ else if (eap->force_bin == FORCE_NOBIN)
+ len = 8;
+ else
+ len = 0;
+ if (eap->force_ff != 0)
+ len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6;
+# ifdef FEAT_MBYTE
+ if (eap->force_enc != 0)
+ len += (unsigned)STRLEN(eap->cmd + eap->force_enc) + 7;
+# endif
+
+ newval = alloc(len + 1);
+ if (newval == NULL)
+ return NULL;
+
+ if (eap->force_bin == FORCE_BIN)
+ sprintf((char *)newval, " ++bin");
+ else if (eap->force_bin == FORCE_NOBIN)
+ sprintf((char *)newval, " ++nobin");
+ else
+ *newval = NUL;
+ if (eap->force_ff != 0)
+ sprintf((char *)newval + STRLEN(newval), " ++ff=%s",
+ eap->cmd + eap->force_ff);
+# ifdef FEAT_MBYTE
+ if (eap->force_enc != 0)
+ sprintf((char *)newval + STRLEN(newval), " ++enc=%s",
+ eap->cmd + eap->force_enc);
+# endif
+ vimvars[VV_CMDARG].val = newval;
+ return oldval;
+ }
+
+ vim_free(oldval);
+ vimvars[VV_CMDARG].val = oldarg;
+ return NULL;
+}
+#endif
+
+/*
+ * Get the value of internal variable "name".
+ * Return OK or FAIL.
+ */
+ static int
+get_var_var(name, len, retvar)
+ char_u *name;
+ int len; /* length of "name" */
+ VAR retvar; /* NULL when only checking existence */
+{
+ int ret = OK;
+ int type = VAR_UNKNOWN;
+ long number = 1;
+ char_u *string = NULL;
+ VAR v;
+ int cc;
+ int i;
+
+ /* truncate the name, so that we can use strcmp() */
+ cc = name[len];
+ name[len] = NUL;
+
+ /*
+ * Check for "b:changedtick".
+ */
+ if (STRCMP(name, "b:changedtick") == 0)
+ {
+ type = VAR_NUMBER;
+ number = curbuf->b_changedtick;
+ }
+
+ /*
+ * Check for built-in v: variables.
+ */
+ else if ((i = find_vim_var(name, len)) >= 0)
+ {
+ type = vimvars[i].type;
+ number = (long)vimvars[i].val;
+ string = vimvars[i].val;
+ }
+
+ /*
+ * Check for user-defined variables.
+ */
+ else
+ {
+ v = find_var(name, FALSE);
+ if (v != NULL)
+ {
+ type = v->var_type;
+ number = v->var_val.var_number;
+ string = v->var_val.var_string;
+ }
+ }
+
+ if (type == VAR_UNKNOWN)
+ {
+ if (retvar != NULL)
+ EMSG2(_("E121: Undefined variable: %s"), name);
+ ret = FAIL;
+ }
+ else if (retvar != NULL)
+ {
+ retvar->var_type = type;
+ if (type == VAR_NUMBER)
+ retvar->var_val.var_number = number;
+ else if (type == VAR_STRING)
+ {
+ if (string != NULL)
+ string = vim_strsave(string);
+ retvar->var_val.var_string = string;
+ }
+ }
+
+ name[len] = cc;
+
+ return ret;
+}
+
+/*
+ * Allocate memory for a variable, and make it emtpy (0 or NULL value).
+ */
+ static VAR
+alloc_var()
+{
+ return (VAR)alloc_clear((unsigned)sizeof(var));
+}
+
+/*
+ * Allocate memory for a variable, and assign a string to it.
+ * The string "s" must have been allocated, it is consumed.
+ * Return NULL for out of memory, the variable otherwise.
+ */
+ static VAR
+alloc_string_var(s)
+ char_u *s;
+{
+ VAR retvar;
+
+ retvar = alloc_var();
+ if (retvar != NULL)
+ {
+ retvar->var_type = VAR_STRING;
+ retvar->var_val.var_string = s;
+ }
+ else
+ vim_free(s);
+ return retvar;
+}
+
+/*
+ * Free the memory for a variable.
+ */
+ static void
+free_var(varp)
+ VAR varp;
+{
+ if (varp != NULL)
+ {
+ if (varp->var_type == VAR_STRING)
+ vim_free(varp->var_val.var_string);
+ vim_free(varp->var_name);
+ vim_free(varp);
+ }
+}
+
+/*
+ * Free the memory for a variable value and set the value to NULL or 0.
+ */
+ static void
+clear_var(varp)
+ VAR varp;
+{
+ if (varp != NULL)
+ {
+ if (varp->var_type == VAR_STRING)
+ {
+ vim_free(varp->var_val.var_string);
+ varp->var_val.var_string = NULL;
+ }
+ else
+ varp->var_val.var_number = 0;
+ }
+}
+
+/*
+ * Get the number value of a variable.
+ * If it is a String variable, uses vim_str2nr().
+ */
+ static long
+get_var_number(varp)
+ VAR varp;
+{
+ long n;
+
+ if (varp->var_type == VAR_NUMBER)
+ return (long)(varp->var_val.var_number);
+ else if (varp->var_type == VAR_UNKNOWN || varp->var_val.var_string == NULL)
+ return 0L;
+ else
+ {
+ vim_str2nr(varp->var_val.var_string, NULL, NULL, TRUE, TRUE, &n, NULL);
+ return n;
+ }
+}
+
+/*
+ * Get the lnum from the first argument. Also accepts ".", "$", etc.
+ */
+ static linenr_T
+get_var_lnum(argvars)
+ VAR argvars;
+{
+ var retvar;
+ linenr_T lnum;
+
+ lnum = get_var_number(&argvars[0]);
+ if (lnum == 0) /* no valid number, try using line() */
+ {
+ retvar.var_type = VAR_NUMBER;
+ f_line(argvars, &retvar);
+ lnum = retvar.var_val.var_number;
+ clear_var(&retvar);
+ }
+ return lnum;
+}
+
+/*
+ * Get the string value of a variable.
+ * If it is a Number variable, the number is converted into a string.
+ * get_var_string() uses a single, static buffer. YOU CAN ONLY USE IT ONCE!
+ * get_var_string_buf() uses a given buffer.
+ * If the String variable has never been set, return an empty string.
+ * Never returns NULL;
+ */
+ static char_u *
+get_var_string(varp)
+ VAR varp;
+{
+ static char_u mybuf[NUMBUFLEN];
+
+ return get_var_string_buf(varp, mybuf);
+}
+
+ static char_u *
+get_var_string_buf(varp, buf)
+ VAR varp;
+ char_u *buf;
+{
+ if (varp->var_type == VAR_NUMBER)
+ {
+ sprintf((char *)buf, "%ld", (long)varp->var_val.var_number);
+ return buf;
+ }
+ else if (varp->var_val.var_string == NULL)
+ return (char_u *)"";
+ else
+ return varp->var_val.var_string;
+}
+
+/*
+ * Find variable "name" in the list of variables.
+ * Return a pointer to it if found, NULL if not found.
+ */
+ static VAR
+find_var(name, writing)
+ char_u *name;
+ int writing;
+{
+ int i;
+ char_u *varname;
+ garray_T *gap;
+
+ /* Check for function arguments "a:" */
+ if (name[0] == 'a' && name[1] == ':')
+ {
+ if (writing)
+ {
+ EMSG2(_(e_readonlyvar), name);
+ return NULL;
+ }
+ name += 2;
+ if (current_funccal == NULL)
+ return NULL;
+ if (VIM_ISDIGIT(*name))
+ {
+ i = atol((char *)name);
+ if (i == 0) /* a:0 */
+ return &current_funccal->a0_var;
+ i += current_funccal->func->args.ga_len;
+ if (i > current_funccal->argcount) /* a:999 */
+ return NULL;
+ return &(current_funccal->argvars[i - 1]); /* a:1, a:2, etc. */
+ }
+ if (STRCMP(name, "firstline") == 0)
+ return &(current_funccal->firstline);
+ if (STRCMP(name, "lastline") == 0)
+ return &(current_funccal->lastline);
+ for (i = 0; i < current_funccal->func->args.ga_len; ++i)
+ if (STRCMP(name, ((char_u **)
+ (current_funccal->func->args.ga_data))[i]) == 0)
+ return &(current_funccal->argvars[i]); /* a:name */
+ return NULL;
+ }
+
+ gap = find_var_ga(name, &varname);
+ if (gap == NULL)
+ return NULL;
+ return find_var_in_ga(gap, varname);
+}
+
+ static VAR
+find_var_in_ga(gap, varname)
+ garray_T *gap;
+ char_u *varname;
+{
+ int i;
+
+ for (i = gap->ga_len; --i >= 0; )
+ if (VAR_GAP_ENTRY(i, gap).var_name != NULL
+ && STRCMP(VAR_GAP_ENTRY(i, gap).var_name, varname) == 0)
+ break;
+ if (i < 0)
+ return NULL;
+ return &VAR_GAP_ENTRY(i, gap);
+}
+
+/*
+ * Find the growarray and start of name without ':' for a variable name.
+ */
+ static garray_T *
+find_var_ga(name, varname)
+ char_u *name;
+ char_u **varname;
+{
+ if (name[1] != ':')
+ {
+ /* If not "x:name" there must not be any ":" in the name. */
+ if (vim_strchr(name, ':') != NULL)
+ return NULL;
+ *varname = name;
+ if (current_funccal == NULL)
+ return &variables; /* global variable */
+ return &current_funccal->l_vars; /* local function variable */
+ }
+ *varname = name + 2;
+ if (*name == 'b') /* buffer variable */
+ return &curbuf->b_vars;
+ if (*name == 'w') /* window variable */
+ return &curwin->w_vars;
+ if (*name == 'g') /* global variable */
+ return &variables;
+ if (*name == 'l' && current_funccal != NULL)/* local function variable */
+ return &current_funccal->l_vars;
+ if (*name == 's' /* script variable */
+ && current_SID > 0 && current_SID <= ga_scripts.ga_len)
+ return &SCRIPT_VARS(current_SID);
+ return NULL;
+}
+
+/*
+ * Get the string value of a (global/local) variable.
+ * Returns NULL when it doesn't exist.
+ */
+ char_u *
+get_var_value(name)
+ char_u *name;
+{
+ VAR v;
+
+ v = find_var(name, FALSE);
+ if (v == NULL)
+ return NULL;
+ return get_var_string(v);
+}
+
+/*
+ * Allocate a new growarry for a sourced script. It will be used while
+ * sourcing this script and when executing functions defined in the script.
+ */
+ void
+new_script_vars(id)
+ scid_T id;
+{
+ if (ga_grow(&ga_scripts, (int)(id - ga_scripts.ga_len)) == OK)
+ {
+ while (ga_scripts.ga_len < id)
+ {
+ var_init(&SCRIPT_VARS(ga_scripts.ga_len + 1));
+ ++ga_scripts.ga_len;
+ --ga_scripts.ga_room;
+ }
+ }
+}
+
+/*
+ * Initialize internal variables for use.
+ */
+ void
+var_init(gap)
+ garray_T *gap;
+{
+ ga_init2(gap, (int)sizeof(var), 4);
+}
+
+/*
+ * Clean up a list of internal variables.
+ */
+ void
+var_clear(gap)
+ garray_T *gap;
+{
+ int i;
+
+ for (i = gap->ga_len; --i >= 0; )
+ var_free_one(&VAR_GAP_ENTRY(i, gap));
+ ga_clear(gap);
+}
+
+ static void
+var_free_one(v)
+ VAR v;
+{
+ vim_free(v->var_name);
+ v->var_name = NULL;
+ if (v->var_type == VAR_STRING)
+ vim_free(v->var_val.var_string);
+ v->var_val.var_string = NULL;
+}
+
+/*
+ * List the value of one internal variable.
+ */
+ static void
+list_one_var(v, prefix)
+ VAR v;
+ char_u *prefix;
+{
+ list_one_var_a(prefix, v->var_name, v->var_type, get_var_string(v));
+}
+
+/*
+ * List the value of one "v:" variable.
+ */
+ static void
+list_vim_var(i)
+ int i; /* index in vimvars[] */
+{
+ char_u *p;
+ char_u numbuf[NUMBUFLEN];
+
+ if (vimvars[i].type == VAR_NUMBER)
+ {
+ p = numbuf;
+ sprintf((char *)p, "%ld", (long)vimvars[i].val);
+ }
+ else if (vimvars[i].val == NULL)
+ p = (char_u *)"";
+ else
+ p = vimvars[i].val;
+ list_one_var_a((char_u *)"v:", (char_u *)vimvars[i].name,
+ vimvars[i].type, p);
+}
+
+ static void
+list_one_var_a(prefix, name, type, string)
+ char_u *prefix;
+ char_u *name;
+ int type;
+ char_u *string;
+{
+ msg_attr(prefix, 0); /* don't use msg(), it overwrites "v:statusmsg" */
+ if (name != NULL) /* "a:" vars don't have a name stored */
+ msg_puts(name);
+ msg_putchar(' ');
+ msg_advance(22);
+ if (type == VAR_NUMBER)
+ msg_putchar('#');
+ else
+ msg_putchar(' ');
+ msg_outtrans(string);
+}
+
+/*
+ * Set variable "name" to value in "varp".
+ * If the variable already exists, the value is updated.
+ * Otherwise the variable is created.
+ */
+ static void
+set_var(name, varp)
+ char_u *name;
+ VAR varp;
+{
+ int i;
+ VAR v;
+ char_u *varname;
+ garray_T *gap;
+
+ /*
+ * Handle setting internal v: variables.
+ */
+ i = find_vim_var(name, (int)STRLEN(name));
+ if (i >= 0)
+ {
+ if (vimvars[i].flags & VV_RO)
+ EMSG2(_(e_readonlyvar), name);
+ else
+ {
+ if (vimvars[i].type == VAR_STRING)
+ {
+ vim_free(vimvars[i].val);
+ vimvars[i].val = vim_strsave(get_var_string(varp));
+ }
+ else
+ vimvars[i].val = (char_u *)(long)varp->var_val.var_number;
+ }
+ return;
+ }
+
+ v = find_var(name, TRUE);
+ if (v != NULL) /* existing variable, only need to free string */
+ {
+ if (v->var_type == VAR_STRING)
+ vim_free(v->var_val.var_string);
+ }
+ else /* add a new variable */
+ {
+ gap = find_var_ga(name, &varname);
+ if (gap == NULL) /* illegal name */
+ {
+ EMSG2(_("E461: Illegal variable name: %s"), name);
+ return;
+ }
+
+ /* Try to use an empty entry */
+ for (i = gap->ga_len; --i >= 0; )
+ if (VAR_GAP_ENTRY(i, gap).var_name == NULL)
+ break;
+ if (i < 0) /* need to allocate more room */
+ {
+ if (ga_grow(gap, 1) == FAIL)
+ return;
+ i = gap->ga_len;
+ }
+ v = &VAR_GAP_ENTRY(i, gap);
+ if ((v->var_name = vim_strsave(varname)) == NULL)
+ return;
+ if (i == gap->ga_len)
+ {
+ ++gap->ga_len;
+ --gap->ga_room;
+ }
+ }
+ copy_var(varp, v);
+}
+
+ static void
+copy_var(from, to)
+ VAR from;
+ VAR to;
+{
+ to->var_type = from->var_type;
+ if (from->var_type == VAR_STRING)
+ to->var_val.var_string = vim_strsave(get_var_string(from));
+ else
+ to->var_val.var_number = from->var_val.var_number;
+}
+
+/*
+ * ":echo expr1 ..." print each argument separated with a space, add a
+ * newline at the end.
+ * ":echon expr1 ..." print each argument plain.
+ */
+ void
+ex_echo(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ var retvar;
+ char_u *p;
+ int needclr = TRUE;
+ int atstart = TRUE;
+
+ if (eap->skip)
+ ++emsg_skip;
+ while (*arg != NUL && *arg != '|' && *arg != '\n' && !got_int)
+ {
+ p = arg;
+ if (eval1(&arg, &retvar, !eap->skip) == FAIL)
+ {
+ /*
+ * Report the invalid expression unless the expression evaluation
+ * has been cancelled due to an aborting error, an interrupt, or an
+ * exception.
+ */
+ if (!aborting())
+ EMSG2(_(e_invexpr2), p);
+ break;
+ }
+ if (!eap->skip)
+ {
+ if (atstart)
+ {
+ atstart = FALSE;
+ /* Call msg_start() after eval1(), evaluating the expression
+ * may cause a message to appear. */
+ if (eap->cmdidx == CMD_echo)
+ msg_start();
+ }
+ else if (eap->cmdidx == CMD_echo)
+ msg_puts_attr((char_u *)" ", echo_attr);
+ for (p = get_var_string(&retvar); *p != NUL && !got_int; ++p)
+ if (*p == '\n' || *p == '\r' || *p == TAB)
+ {
+ if (*p != TAB && needclr)
+ {
+ /* remove any text still there from the command */
+ msg_clr_eos();
+ needclr = FALSE;
+ }
+ msg_putchar_attr(*p, echo_attr);
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int i = (*mb_ptr2len_check)(p);
+
+ (void)msg_outtrans_len_attr(p, i, echo_attr);
+ p += i - 1;
+ }
+ else
+#endif
+ (void)msg_outtrans_len_attr(p, 1, echo_attr);
+ }
+ }
+ clear_var(&retvar);
+ arg = skipwhite(arg);
+ }
+ eap->nextcmd = check_nextcmd(arg);
+
+ if (eap->skip)
+ --emsg_skip;
+ else
+ {
+ /* remove text that may still be there from the command */
+ if (needclr)
+ msg_clr_eos();
+ if (eap->cmdidx == CMD_echo)
+ msg_end();
+ }
+}
+
+/*
+ * ":echohl {name}".
+ */
+ void
+ex_echohl(eap)
+ exarg_T *eap;
+{
+ int id;
+
+ id = syn_name2id(eap->arg);
+ if (id == 0)
+ echo_attr = 0;
+ else
+ echo_attr = syn_id2attr(id);
+}
+
+/*
+ * ":execute expr1 ..." execute the result of an expression.
+ * ":echomsg expr1 ..." Print a message
+ * ":echoerr expr1 ..." Print an error
+ * Each gets spaces around each argument and a newline at the end for
+ * echo commands
+ */
+ void
+ex_execute(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ var retvar;
+ int ret = OK;
+ char_u *p;
+ garray_T ga;
+ int len;
+ int save_did_emsg;
+
+ ga_init2(&ga, 1, 80);
+
+ if (eap->skip)
+ ++emsg_skip;
+ while (*arg != NUL && *arg != '|' && *arg != '\n')
+ {
+ p = arg;
+ if (eval1(&arg, &retvar, !eap->skip) == FAIL)
+ {
+ /*
+ * Report the invalid expression unless the expression evaluation
+ * has been cancelled due to an aborting error, an interrupt, or an
+ * exception.
+ */
+ if (!aborting())
+ EMSG2(_(e_invexpr2), p);
+ ret = FAIL;
+ break;
+ }
+
+ if (!eap->skip)
+ {
+ p = get_var_string(&retvar);
+ len = (int)STRLEN(p);
+ if (ga_grow(&ga, len + 2) == FAIL)
+ {
+ clear_var(&retvar);
+ ret = FAIL;
+ break;
+ }
+ if (ga.ga_len)
+ {
+ ((char_u *)(ga.ga_data))[ga.ga_len++] = ' ';
+ --ga.ga_room;
+ }
+ STRCPY((char_u *)(ga.ga_data) + ga.ga_len, p);
+ ga.ga_room -= len;
+ ga.ga_len += len;
+ }
+
+ clear_var(&retvar);
+ arg = skipwhite(arg);
+ }
+
+ if (ret != FAIL && ga.ga_data != NULL)
+ {
+ if (eap->cmdidx == CMD_echomsg)
+ MSG_ATTR(ga.ga_data, echo_attr);
+ else if (eap->cmdidx == CMD_echoerr)
+ {
+ /* We don't want to abort following commands, restore did_emsg. */
+ save_did_emsg = did_emsg;
+ EMSG((char_u *)ga.ga_data);
+ if (!force_abort)
+ did_emsg = save_did_emsg;
+ }
+ else if (eap->cmdidx == CMD_execute)
+ do_cmdline((char_u *)ga.ga_data,
+ eap->getline, eap->cookie, DOCMD_NOWAIT|DOCMD_VERBOSE);
+ }
+
+ ga_clear(&ga);
+
+ if (eap->skip)
+ --emsg_skip;
+
+ eap->nextcmd = check_nextcmd(arg);
+}
+
+/*
+ * Skip over the name of an option: "&option", "&g:option" or "&l:option".
+ * "arg" points to the "&" or '+' when called, to "option" when returning.
+ * Returns NULL when no option name found. Otherwise pointer to the char
+ * after the option name.
+ */
+ static char_u *
+find_option_end(arg, opt_flags)
+ char_u **arg;
+ int *opt_flags;
+{
+ char_u *p = *arg;
+
+ ++p;
+ if (*p == 'g' && p[1] == ':')
+ {
+ *opt_flags = OPT_GLOBAL;
+ p += 2;
+ }
+ else if (*p == 'l' && p[1] == ':')
+ {
+ *opt_flags = OPT_LOCAL;
+ p += 2;
+ }
+ else
+ *opt_flags = 0;
+
+ if (!ASCII_ISALPHA(*p))
+ return NULL;
+ *arg = p;
+
+ if (p[0] == 't' && p[1] == '_' && p[2] != NUL && p[3] != NUL)
+ p += 4; /* termcap option */
+ else
+ while (ASCII_ISALPHA(*p))
+ ++p;
+ return p;
+}
+
+/*
+ * ":function"
+ */
+ void
+ex_function(eap)
+ exarg_T *eap;
+{
+ char_u *theline;
+ int j;
+ int c;
+#ifdef FEAT_MAGIC_BRACES
+ int saved_did_emsg;
+#endif
+ char_u *name = NULL;
+ char_u *p;
+ char_u *arg;
+ garray_T newargs;
+ garray_T newlines;
+ int varargs = FALSE;
+ int mustend = FALSE;
+ int flags = 0;
+ ufunc_T *fp;
+ int indent;
+ int nesting;
+ char_u *skip_until = NULL;
+ static char_u e_funcexts[] = N_("E122: Function %s already exists, add ! to replace it");
+
+ /*
+ * ":function" without argument: list functions.
+ */
+ if (ends_excmd(*eap->arg))
+ {
+ if (!eap->skip)
+ for (fp = firstfunc; fp != NULL && !got_int; fp = fp->next)
+ list_func_head(fp, FALSE);
+ eap->nextcmd = check_nextcmd(eap->arg);
+ return;
+ }
+
+ p = eap->arg;
+ name = trans_function_name(&p, eap->skip, FALSE);
+ if (name == NULL && !eap->skip)
+ {
+ /*
+ * Return on an invalid expression in braces, unless the expression
+ * evaluation has been cancelled due to an aborting error, an
+ * interrupt, or an exception.
+ */
+ if (!aborting())
+ return;
+ else
+ eap->skip = TRUE;
+ }
+#ifdef FEAT_MAGIC_BRACES
+ /* An error in a function call during evaluation of an expression in magic
+ * braces should not cause the function not to be defined. */
+ saved_did_emsg = did_emsg;
+ did_emsg = FALSE;
+#endif
+
+ /*
+ * ":function func" with only function name: list function.
+ */
+ if (vim_strchr(p, '(') == NULL)
+ {
+ if (!ends_excmd(*skipwhite(p)))
+ {
+ EMSG(_(e_trailing));
+ goto erret_name;
+ }
+ eap->nextcmd = check_nextcmd(p);
+ if (eap->nextcmd != NULL)
+ *p = NUL;
+ if (!eap->skip && !got_int)
+ {
+ fp = find_func(name);
+ if (fp != NULL)
+ {
+ list_func_head(fp, TRUE);
+ for (j = 0; j < fp->lines.ga_len && !got_int; ++j)
+ {
+ msg_putchar('\n');
+ msg_outnum((long)(j + 1));
+ if (j < 9)
+ msg_putchar(' ');
+ if (j < 99)
+ msg_putchar(' ');
+ msg_prt_line(FUNCLINE(fp, j));
+ out_flush(); /* show a line at a time */
+ ui_breakcheck();
+ }
+ if (!got_int)
+ {
+ msg_putchar('\n');
+ msg_puts((char_u *)" endfunction");
+ }
+ }
+ else
+ EMSG2(_("E123: Undefined function: %s"), eap->arg);
+ }
+ goto erret_name;
+ }
+
+ /*
+ * ":function name(arg1, arg2)" Define function.
+ */
+ p = skipwhite(p);
+ if (*p != '(')
+ {
+ if (!eap->skip)
+ {
+ EMSG2(_("E124: Missing '(': %s"), eap->arg);
+ goto erret_name;
+ }
+ /* attempt to continue by skipping some text */
+ if (vim_strchr(p, '(') != NULL)
+ p = vim_strchr(p, '(');
+ }
+ p = skipwhite(p + 1);
+
+ ga_init2(&newargs, (int)sizeof(char_u *), 3);
+ ga_init2(&newlines, (int)sizeof(char_u *), 3);
+
+ /*
+ * Isolate the arguments: "arg1, arg2, ...)"
+ */
+ while (*p != ')')
+ {
+ if (p[0] == '.' && p[1] == '.' && p[2] == '.')
+ {
+ varargs = TRUE;
+ p += 3;
+ mustend = TRUE;
+ }
+ else
+ {
+ arg = p;
+ while (ASCII_ISALNUM(*p) || *p == '_')
+ ++p;
+ if (arg == p || isdigit(*arg)
+ || (p - arg == 9 && STRNCMP(arg, "firstline", 9) == 0)
+ || (p - arg == 8 && STRNCMP(arg, "lastline", 8) == 0))
+ {
+ if (!eap->skip)
+ EMSG2(_("E125: Illegal argument: %s"), arg);
+ break;
+ }
+ if (ga_grow(&newargs, 1) == FAIL)
+ goto erret;
+ c = *p;
+ *p = NUL;
+ arg = vim_strsave(arg);
+ if (arg == NULL)
+ goto erret;
+ ((char_u **)(newargs.ga_data))[newargs.ga_len] = arg;
+ *p = c;
+ newargs.ga_len++;
+ newargs.ga_room--;
+ if (*p == ',')
+ ++p;
+ else
+ mustend = TRUE;
+ }
+ p = skipwhite(p);
+ if (mustend && *p != ')')
+ {
+ if (!eap->skip)
+ EMSG2(_(e_invarg2), eap->arg);
+ break;
+ }
+ }
+ ++p; /* skip the ')' */
+
+ /* find extra arguments "range" and "abort" */
+ for (;;)
+ {
+ p = skipwhite(p);
+ if (STRNCMP(p, "range", 5) == 0)
+ {
+ flags |= FC_RANGE;
+ p += 5;
+ }
+ else if (STRNCMP(p, "abort", 5) == 0)
+ {
+ flags |= FC_ABORT;
+ p += 5;
+ }
+ else
+ break;
+ }
+
+ if (*p != NUL && *p != '"' && *p != '\n' && !eap->skip && !did_emsg)
+ EMSG(_(e_trailing));
+
+ /*
+ * Read the body of the function, until ":endfunction" is found.
+ */
+ if (KeyTyped)
+ {
+ /* Check if the function already exists, don't let the user type the
+ * whole function before telling him it doesn't work! For a script we
+ * need to skip the body to be able to find what follows. */
+ if (!eap->skip && !eap->forceit && find_func(name) != NULL)
+ EMSG2(_(e_funcexts), name);
+
+ msg_putchar('\n'); /* don't overwrite the function name */
+ cmdline_row = msg_row;
+ }
+
+ indent = 2;
+ nesting = 0;
+ for (;;)
+ {
+ msg_scroll = TRUE;
+ need_wait_return = FALSE;
+ if (eap->getline == NULL)
+ theline = getcmdline(':', 0L, indent);
+ else
+ theline = eap->getline(':', eap->cookie, indent);
+ if (KeyTyped)
+ lines_left = Rows - 1;
+ if (theline == NULL)
+ {
+ EMSG(_("E126: Missing :endfunction"));
+ goto erret;
+ }
+
+ if (skip_until != NULL)
+ {
+ /* between ":append" and "." and between ":python <<EOF" and "EOF"
+ * don't check for ":endfunc". */
+ if (STRCMP(theline, skip_until) == 0)
+ {
+ vim_free(skip_until);
+ skip_until = NULL;
+ }
+ }
+ else
+ {
+ /* skip ':' and blanks*/
+ for (p = theline; vim_iswhite(*p) || *p == ':'; ++p)
+ ;
+
+ /* Check for "endfunction" (should be more strict...). */
+ if (STRNCMP(p, "endf", 4) == 0 && nesting-- == 0)
+ {
+ vim_free(theline);
+ break;
+ }
+
+ /* Increase indent inside "if", "while", and "try", decrease
+ * at "end". */
+ if (indent > 2 && STRNCMP(p, "end", 3) == 0)
+ indent -= 2;
+ else if (STRNCMP(p, "if", 2) == 0 || STRNCMP(p, "wh", 2) == 0
+ || STRNCMP(p, "try", 3) == 0)
+ indent += 2;
+
+ /* Check for defining a function inside this function. */
+ if (STRNCMP(p, "fu", 2) == 0)
+ {
+ p = skipwhite(skiptowhite(p));
+ p += eval_fname_script(p);
+ if (ASCII_ISALPHA(*p))
+ {
+ vim_free(trans_function_name(&p, TRUE, FALSE));
+ if (*skipwhite(p) == '(')
+ {
+ ++nesting;
+ indent += 2;
+ }
+ }
+ }
+
+ /* Check for ":append" or ":insert". */
+ p = skip_range(p, NULL);
+ if ((p[0] == 'a' && (!ASCII_ISALPHA(p[1]) || p[1] == 'p'))
+ || (p[0] == 'i'
+ && (!ASCII_ISALPHA(p[1]) || (p[1] == 'n'
+ && (!ASCII_ISALPHA(p[2]) || (p[2] == 's'))))))
+ skip_until = vim_strsave((char_u *)".");
+
+ /* Check for ":python <<EOF", ":tcl <<EOF", etc. */
+ arg = skipwhite(skiptowhite(p));
+ if (arg[0] == '<' && arg[1] =='<'
+ && ((p[0] == 'p' && p[1] == 'y'
+ && (!ASCII_ISALPHA(p[2]) || p[2] == 't'))
+ || (p[0] == 'p' && p[1] == 'e'
+ && (!ASCII_ISALPHA(p[2]) || p[2] == 'r'))
+ || (p[0] == 't' && p[1] == 'c'
+ && (!ASCII_ISALPHA(p[2]) || p[2] == 'l'))
+ || (p[0] == 'r' && p[1] == 'u' && p[2] == 'b'
+ && (!ASCII_ISALPHA(p[3]) || p[3] == 'y'))
+ ))
+ {
+ /* ":python <<" continues until a dot, like ":append" */
+ p = skipwhite(arg + 2);
+ if (*p == NUL)
+ skip_until = vim_strsave((char_u *)".");
+ else
+ skip_until = vim_strsave(p);
+ }
+ }
+
+ /* Add the line to the function. */
+ if (ga_grow(&newlines, 1) == FAIL)
+ goto erret;
+ ((char_u **)(newlines.ga_data))[newlines.ga_len] = theline;
+ newlines.ga_len++;
+ newlines.ga_room--;
+ }
+
+ /* Don't define the function when skipping commands or when an error was
+ * detected. */
+ if (eap->skip || did_emsg)
+ goto erret;
+
+ /*
+ * If there are no errors, add the function
+ */
+ fp = find_func(name);
+ if (fp != NULL)
+ {
+ if (!eap->forceit)
+ {
+ EMSG2(_(e_funcexts), name);
+ goto erret;
+ }
+ if (fp->calls)
+ {
+ EMSG2(_("E127: Cannot redefine function %s: It is in use"), name);
+ goto erret;
+ }
+ /* redefine existing function */
+ ga_clear_strings(&(fp->args));
+ ga_clear_strings(&(fp->lines));
+ vim_free(name);
+ }
+ else
+ {
+ fp = (ufunc_T *)alloc((unsigned)sizeof(ufunc_T));
+ if (fp == NULL)
+ goto erret;
+ /* insert the new function in the function list */
+ fp->next = firstfunc;
+ firstfunc = fp;
+ fp->name = name;
+ }
+ fp->args = newargs;
+ fp->lines = newlines;
+ fp->varargs = varargs;
+ fp->flags = flags;
+ fp->calls = 0;
+ fp->script_ID = current_SID;
+#ifdef FEAT_MAGIC_BRACES
+ did_emsg |= saved_did_emsg;
+#endif
+ vim_free(skip_until);
+ return;
+
+erret:
+ vim_free(skip_until);
+ ga_clear_strings(&newargs);
+ ga_clear_strings(&newlines);
+erret_name:
+ vim_free(name);
+#ifdef FEAT_MAGIC_BRACES
+ did_emsg |= saved_did_emsg;
+#endif
+}
+
+/*
+ * Get a function name, translating "<SID>" and "<SNR>".
+ * Returns the function name in allocated memory, or NULL for failure.
+ * Advances "pp" to just after the function name (if no error).
+ */
+ static char_u *
+trans_function_name(pp, skip, internal)
+ char_u **pp;
+ int skip; /* only find the end, don't evaluate */
+ int internal; /* TRUE if internal function name OK */
+{
+ char_u *name;
+ char_u *start;
+ char_u *end;
+ int lead;
+ char_u sid_buf[20];
+ char_u *temp_string = NULL;
+ char_u *expr_start, *expr_end;
+ int len;
+
+ /* A name starting with "<SID>" or "<SNR>" is local to a script. */
+ start = *pp;
+ lead = eval_fname_script(start);
+ if (lead > 0)
+ start += lead;
+ end = find_name_end(start, &expr_start, &expr_end);
+ if (end == start)
+ {
+ if (!skip)
+ EMSG(_("E129: Function name required"));
+ return NULL;
+ }
+#ifdef FEAT_MAGIC_BRACES
+ if (expr_start != NULL && !skip)
+ {
+ /* expand magic curlies */
+ temp_string = make_expanded_name(start, expr_start, expr_end, end);
+ if (temp_string == NULL)
+ {
+ /*
+ * Report an invalid expression in braces, unless the expression
+ * evaluation has been cancelled due to an aborting error, an
+ * interrupt, or an exception.
+ */
+ if (!aborting())
+ EMSG2(_(e_invarg2), start);
+ else
+ *pp = end;
+ return NULL;
+ }
+ start = temp_string;
+ len = (int)STRLEN(temp_string);
+ }
+ else
+#endif
+ len = (int)(end - start);
+
+ /*
+ * Copy the function name to allocated memory.
+ * Accept <SID>name() inside a script, translate into <SNR>123_name().
+ * Accept <SNR>123_name() outside a script.
+ */
+ if (skip)
+ lead = 0; /* do nothing */
+ else if (lead > 0)
+ {
+ lead = 3;
+ if (eval_fname_sid(*pp)) /* If it's "<SID>" */
+ {
+ if (current_SID <= 0)
+ {
+ EMSG(_(e_usingsid));
+ return NULL;
+ }
+ sprintf((char *)sid_buf, "%ld_", (long)current_SID);
+ lead += (int)STRLEN(sid_buf);
+ }
+ }
+ else if (!internal && !ASCII_ISUPPER(*start))
+ {
+ EMSG2(_("E128: Function name must start with a capital: %s"), start);
+ return NULL;
+ }
+ name = alloc((unsigned)(len + lead + 1));
+ if (name != NULL)
+ {
+ if (lead > 0)
+ {
+ name[0] = K_SPECIAL;
+ name[1] = KS_EXTRA;
+ name[2] = (int)KE_SNR;
+ if (eval_fname_sid(*pp)) /* If it's "<SID>" */
+ STRCPY(name + 3, sid_buf);
+ }
+ mch_memmove(name + lead, start, (size_t)len);
+ name[len + lead] = NUL;
+ }
+ *pp = end;
+
+ vim_free(temp_string);
+ return name;
+}
+
+/*
+ * Return 5 if "p" starts with "<SID>" or "<SNR>" (ignoring case).
+ * Return 2 if "p" starts with "s:".
+ * Return 0 otherwise.
+ */
+ static int
+eval_fname_script(p)
+ char_u *p;
+{
+ if (p[0] == '<' && (STRNICMP(p + 1, "SID>", 4) == 0
+ || STRNICMP(p + 1, "SNR>", 4) == 0))
+ return 5;
+ if (p[0] == 's' && p[1] == ':')
+ return 2;
+ return 0;
+}
+
+/*
+ * Return TRUE if "p" starts with "<SID>" or "s:".
+ * Only works if eval_fname_script() returned non-zero for "p"!
+ */
+ static int
+eval_fname_sid(p)
+ char_u *p;
+{
+ return (*p == 's' || TOUPPER_ASC(p[2]) == 'I');
+}
+
+/*
+ * List the head of the function: "name(arg1, arg2)".
+ */
+ static void
+list_func_head(fp, indent)
+ ufunc_T *fp;
+ int indent;
+{
+ int j;
+
+ msg_start();
+ if (indent)
+ MSG_PUTS(" ");
+ MSG_PUTS("function ");
+ if (fp->name[0] == K_SPECIAL)
+ {
+ MSG_PUTS_ATTR("<SNR>", hl_attr(HLF_8));
+ msg_puts(fp->name + 3);
+ }
+ else
+ msg_puts(fp->name);
+ msg_putchar('(');
+ for (j = 0; j < fp->args.ga_len; ++j)
+ {
+ if (j)
+ MSG_PUTS(", ");
+ msg_puts(FUNCARG(fp, j));
+ }
+ if (fp->varargs)
+ {
+ if (j)
+ MSG_PUTS(", ");
+ MSG_PUTS("...");
+ }
+ msg_putchar(')');
+}
+
+/*
+ * Find a function by name, return pointer to it in ufuncs.
+ * Return NULL for unknown function.
+ */
+ static ufunc_T *
+find_func(name)
+ char_u *name;
+{
+ ufunc_T *fp;
+
+ for (fp = firstfunc; fp != NULL; fp = fp->next)
+ if (STRCMP(name, fp->name) == 0)
+ break;
+ return fp;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of user defined
+ * function names.
+ */
+ char_u *
+get_user_func_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static ufunc_T *fp = NULL;
+
+ if (idx == 0)
+ fp = firstfunc;
+ if (fp != NULL)
+ {
+ if (STRLEN(fp->name) + 4 >= IOSIZE)
+ return fp->name; /* prevents overflow */
+
+ cat_func_name(IObuff, fp);
+ if (xp->xp_context != EXPAND_USER_FUNC)
+ {
+ STRCAT(IObuff, "(");
+ if (!fp->varargs && fp->args.ga_len == 0)
+ STRCAT(IObuff, ")");
+ }
+
+ fp = fp->next;
+ return IObuff;
+ }
+ return NULL;
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * Copy the function name of "fp" to buffer "buf".
+ * "buf" must be able to hold the function name plus three bytes.
+ * Takes care of script-local function names.
+ */
+ static void
+cat_func_name(buf, fp)
+ char_u *buf;
+ ufunc_T *fp;
+{
+ if (fp->name[0] == K_SPECIAL)
+ {
+ STRCPY(buf, "<SNR>");
+ STRCAT(buf, fp->name + 3);
+ }
+ else
+ STRCPY(buf, fp->name);
+}
+
+/*
+ * ":delfunction {name}"
+ */
+ void
+ex_delfunction(eap)
+ exarg_T *eap;
+{
+ ufunc_T *fp = NULL, *pfp;
+ char_u *p;
+ char_u *name;
+
+ p = eap->arg;
+ name = trans_function_name(&p, eap->skip, FALSE);
+ if (name == NULL)
+ return;
+ if (!ends_excmd(*skipwhite(p)))
+ {
+ vim_free(name);
+ EMSG(_(e_trailing));
+ return;
+ }
+ eap->nextcmd = check_nextcmd(p);
+ if (eap->nextcmd != NULL)
+ *p = NUL;
+
+ if (!eap->skip)
+ fp = find_func(name);
+ vim_free(name);
+
+ if (!eap->skip)
+ {
+ if (fp == NULL)
+ {
+ EMSG2(_("E130: Undefined function: %s"), eap->arg);
+ return;
+ }
+ if (fp->calls)
+ {
+ EMSG2(_("E131: Cannot delete function %s: It is in use"), eap->arg);
+ return;
+ }
+
+ /* clear this function */
+ vim_free(fp->name);
+ ga_clear_strings(&(fp->args));
+ ga_clear_strings(&(fp->lines));
+
+ /* remove the function from the function list */
+ if (firstfunc == fp)
+ firstfunc = fp->next;
+ else
+ {
+ for (pfp = firstfunc; pfp != NULL; pfp = pfp->next)
+ if (pfp->next == fp)
+ {
+ pfp->next = fp->next;
+ break;
+ }
+ }
+ vim_free(fp);
+ }
+}
+
+/*
+ * Call a user function.
+ */
+ static void
+call_user_func(fp, argcount, argvars, retvar, firstline, lastline)
+ ufunc_T *fp; /* pointer to function */
+ int argcount; /* nr of args */
+ VAR argvars; /* arguments */
+ VAR retvar; /* return value */
+ linenr_T firstline; /* first line of range */
+ linenr_T lastline; /* last line of range */
+{
+ char_u *save_sourcing_name;
+ linenr_T save_sourcing_lnum;
+ scid_T save_current_SID;
+ struct funccall fc;
+ struct funccall *save_fcp = current_funccal;
+ int save_did_emsg;
+ static int depth = 0;
+
+ /* If depth of calling is getting too high, don't execute the function */
+ if (depth >= p_mfd)
+ {
+ EMSG(_("E132: Function call depth is higher than 'maxfuncdepth'"));
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = -1;
+ return;
+ }
+ ++depth;
+
+ line_breakcheck(); /* check for CTRL-C hit */
+
+ /* set local variables */
+ var_init(&fc.l_vars);
+ fc.func = fp;
+ fc.argcount = argcount;
+ fc.argvars = argvars;
+ fc.retvar = retvar;
+ retvar->var_val.var_number = 0;
+ fc.linenr = 0;
+ fc.returned = FALSE;
+ fc.level = ex_nesting_level;
+ fc.a0_var.var_type = VAR_NUMBER;
+ fc.a0_var.var_val.var_number = argcount - fp->args.ga_len;
+ fc.a0_var.var_name = NULL;
+ current_funccal = &fc;
+ fc.firstline.var_type = VAR_NUMBER;
+ fc.firstline.var_val.var_number = firstline;
+ fc.firstline.var_name = NULL;
+ fc.lastline.var_type = VAR_NUMBER;
+ fc.lastline.var_val.var_number = lastline;
+ fc.lastline.var_name = NULL;
+ /* Check if this function has a breakpoint. */
+ fc.breakpoint = dbg_find_breakpoint(FALSE, fp->name, (linenr_T)0);
+ fc.dbg_tick = debug_tick;
+
+ /* Don't redraw while executing the function. */
+ ++RedrawingDisabled;
+ save_sourcing_name = sourcing_name;
+ save_sourcing_lnum = sourcing_lnum;
+ sourcing_lnum = 1;
+ sourcing_name = alloc((unsigned)((save_sourcing_name == NULL ? 0
+ : STRLEN(save_sourcing_name)) + STRLEN(fp->name) + 13));
+ if (sourcing_name != NULL)
+ {
+ if (save_sourcing_name != NULL
+ && STRNCMP(save_sourcing_name, "function ", 9) == 0)
+ sprintf((char *)sourcing_name, "%s..", save_sourcing_name);
+ else
+ STRCPY(sourcing_name, "function ");
+ cat_func_name(sourcing_name + STRLEN(sourcing_name), fp);
+
+ if (p_verbose >= 12)
+ {
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str((char_u *)_("calling %s"), sourcing_name);
+ if (p_verbose >= 14)
+ {
+ int i;
+ char_u buf[MSG_BUF_LEN];
+
+ msg_puts((char_u *)"(");
+ for (i = 0; i < argcount; ++i)
+ {
+ if (i > 0)
+ msg_puts((char_u *)", ");
+ if (argvars[i].var_type == VAR_NUMBER)
+ msg_outnum((long)argvars[i].var_val.var_number);
+ else
+ {
+ trunc_string(get_var_string(&argvars[i]),
+ buf, MSG_BUF_LEN);
+ msg_puts((char_u *)"\"");
+ msg_puts(buf);
+ msg_puts((char_u *)"\"");
+ }
+ }
+ msg_puts((char_u *)")");
+ }
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ }
+ }
+ save_current_SID = current_SID;
+ current_SID = fp->script_ID;
+ save_did_emsg = did_emsg;
+ did_emsg = FALSE;
+
+ /* call do_cmdline() to execute the lines */
+ do_cmdline(NULL, get_func_line, (void *)&fc,
+ DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
+
+ --RedrawingDisabled;
+
+ /* when the function was aborted because of an error, return -1 */
+ if ((did_emsg && (fp->flags & FC_ABORT)) || retvar->var_type == VAR_UNKNOWN)
+ {
+ clear_var(retvar);
+ retvar->var_type = VAR_NUMBER;
+ retvar->var_val.var_number = -1;
+ }
+
+ /* when being verbose, mention the return value */
+ if (p_verbose >= 12)
+ {
+ char_u *sn, *val;
+
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+
+ /* Make sure the output fits in IObuff. */
+ sn = sourcing_name;
+ if (STRLEN(sourcing_name) > IOSIZE / 2 - 50)
+ sn = sourcing_name + STRLEN(sourcing_name) - (IOSIZE / 2 - 50);
+
+ if (aborting())
+ smsg((char_u *)_("%s aborted"), sn);
+ else if (fc.retvar->var_type == VAR_NUMBER)
+ smsg((char_u *)_("%s returning #%ld"), sn,
+ (long)fc.retvar->var_val.var_number);
+ else if (fc.retvar->var_type == VAR_STRING)
+ {
+ val = get_var_string(fc.retvar);
+ if (STRLEN(val) > IOSIZE / 2 - 50)
+ val = val + STRLEN(val) - (IOSIZE / 2 - 50);
+ smsg((char_u *)_("%s returning \"%s\""), sn, val);
+ }
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ }
+
+ vim_free(sourcing_name);
+ sourcing_name = save_sourcing_name;
+ sourcing_lnum = save_sourcing_lnum;
+ current_SID = save_current_SID;
+
+ if (p_verbose >= 12 && sourcing_name != NULL)
+ {
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str((char_u *)_("continuing in %s"), sourcing_name);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ }
+
+ did_emsg |= save_did_emsg;
+ current_funccal = save_fcp;
+
+ var_clear(&fc.l_vars); /* free all local variables */
+ --depth;
+}
+
+/*
+ * ":return [expr]"
+ */
+ void
+ex_return(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ var retvar;
+ int returning = FALSE;
+
+ if (current_funccal == NULL)
+ {
+ EMSG(_("E133: :return not inside a function"));
+ return;
+ }
+
+ if (eap->skip)
+ ++emsg_skip;
+
+ eap->nextcmd = NULL;
+ if ((*arg != NUL && *arg != '|' && *arg != '\n')
+ && eval0(arg, &retvar, &eap->nextcmd, !eap->skip) != FAIL)
+ {
+ if (!eap->skip)
+ returning = do_return(eap, FALSE, TRUE, &retvar);
+ else
+ clear_var(&retvar);
+ }
+ /* It's safer to return also on error. */
+ else if (!eap->skip)
+ {
+ /*
+ * Return unless the expression evaluation has been cancelled due to an
+ * aborting error, an interrupt, or an exception.
+ */
+ if (!aborting())
+ returning = do_return(eap, FALSE, TRUE, NULL);
+ }
+
+ /* When skipping or the return gets pending, advance to the next command
+ * in this line (!returning). Otherwise, ignore the rest of the line.
+ * Following lines will be ignored by get_func_line(). */
+ if (returning)
+ eap->nextcmd = NULL;
+ else if (eap->nextcmd == NULL) /* no argument */
+ eap->nextcmd = check_nextcmd(arg);
+
+ if (eap->skip)
+ --emsg_skip;
+}
+
+/*
+ * Return from a function. Possibly makes the return pending. Also called
+ * for a pending return at the ":endtry" or after returning from an extra
+ * do_cmdline(). "reanimate" is used in the latter case. "is_cmd" is set
+ * when called due to a ":return" command. "value" may point to a variable
+ * with the return value. Returns TRUE when the return can be carried out,
+ * FALSE when the return gets pending.
+ */
+ int
+do_return(eap, reanimate, is_cmd, value)
+ exarg_T *eap;
+ int reanimate;
+ int is_cmd;
+ void *value;
+{
+ int idx;
+ struct condstack *cstack = eap->cstack;
+
+ if (reanimate)
+ /* Undo the return. */
+ current_funccal->returned = FALSE;
+
+ /*
+ * Cleanup (and inactivate) conditionals, but stop when a try conditional
+ * not in its finally clause (which then is to be executed next) is found.
+ * In this case, make the ":return" pending for execution at the ":endtry".
+ * Otherwise, return normally.
+ */
+ idx = cleanup_conditionals(eap->cstack, 0, TRUE);
+ if (idx >= 0)
+ {
+ cstack->cs_pending[idx] = CSTP_RETURN;
+
+ if (!is_cmd && !reanimate)
+ /* A pending return again gets pending. "value" points to an
+ * allocated variable with the value of the original ":return"'s
+ * argument if present or is NULL else. */
+ cstack->cs_retvar[idx] = value;
+ else
+ {
+ /* When undoing a return in order to make it pending, get the stored
+ * return value. */
+ if (reanimate)
+ value = current_funccal->retvar;
+
+ if (value != NULL)
+ {
+ /* Store the value of the pending return. */
+ if ((cstack->cs_retvar[idx] = alloc_var()) != NULL)
+ *(VAR)cstack->cs_retvar[idx] = *(VAR)value;
+ else
+ EMSG(_(e_outofmem));
+ }
+ else
+ cstack->cs_retvar[idx] = NULL;
+
+ if (reanimate)
+ {
+ /* The pending return value could be overwritten by a ":return"
+ * without argument in a finally clause; reset the default
+ * return value. */
+ current_funccal->retvar->var_type = VAR_NUMBER;
+ current_funccal->retvar->var_val.var_number = 0;
+ }
+ }
+ report_make_pending(CSTP_RETURN, value);
+ }
+ else
+ {
+ current_funccal->returned = TRUE;
+
+ /* If the return is carried out now, store the return value. For
+ * a return immediately after reanimation, the value is already
+ * there. */
+ if (!reanimate && value != NULL)
+ {
+ clear_var(current_funccal->retvar);
+ *current_funccal->retvar = *(VAR)value;
+ if (!is_cmd)
+ vim_free(value);
+ }
+ }
+
+ return idx < 0;
+}
+
+/*
+ * Free the variable with a pending return value.
+ */
+ void
+discard_pending_return(retvar)
+ void *retvar;
+{
+ /* The variable was copied from one with an undefined var_name. So we can't
+ * use free_var() to clear and free it. */
+ clear_var((VAR)retvar);
+ vim_free(retvar);
+}
+
+/*
+ * Generate a return command for producing the value of "retvar". The result
+ * is an allocated string. Used by report_pending() for verbose messages.
+ */
+ char_u *
+get_return_cmd(retvar)
+ void *retvar;
+{
+ char_u *s = IObuff;
+
+ if (retvar == NULL || ((VAR)retvar)->var_type == VAR_UNKNOWN)
+ s = (char_u *)":return";
+ else if (((VAR)retvar)->var_type == VAR_STRING)
+ sprintf((char *)IObuff, ":return \"%s\"",
+ ((VAR)retvar)->var_val.var_string);
+ else
+ sprintf((char *)IObuff, ":return %ld",
+ (long)(((VAR)retvar)->var_val.var_number));
+ return vim_strsave(s);
+}
+
+/*
+ * Get next function line.
+ * Called by do_cmdline() to get the next line.
+ * Returns allocated string, or NULL for end of function.
+ */
+/* ARGSUSED */
+ char_u *
+get_func_line(c, cookie, indent)
+ int c; /* not used */
+ void *cookie;
+ int indent; /* not used */
+{
+ struct funccall *fcp = (struct funccall *)cookie;
+ char_u *retval;
+ garray_T *gap; /* growarray with function lines */
+
+ /* If breakpoints have been added/deleted need to check for it. */
+ if (fcp->dbg_tick != debug_tick)
+ {
+ fcp->breakpoint = dbg_find_breakpoint(FALSE, fcp->func->name,
+ sourcing_lnum);
+ fcp->dbg_tick = debug_tick;
+ }
+
+ gap = &fcp->func->lines;
+ if ((fcp->func->flags & FC_ABORT) && did_emsg && !aborted_in_try())
+ retval = NULL;
+ else if (fcp->returned || fcp->linenr >= gap->ga_len)
+ retval = NULL;
+ else
+ {
+ retval = vim_strsave(((char_u **)(gap->ga_data))[fcp->linenr++]);
+ sourcing_lnum = fcp->linenr;
+ }
+
+ /* Did we encounter a breakpoint? */
+ if (fcp->breakpoint != 0 && fcp->breakpoint <= sourcing_lnum)
+ {
+ dbg_breakpoint(fcp->func->name, sourcing_lnum);
+ /* Find next breakpoint. */
+ fcp->breakpoint = dbg_find_breakpoint(FALSE, fcp->func->name,
+ sourcing_lnum);
+ fcp->dbg_tick = debug_tick;
+ }
+
+ return retval;
+}
+
+/*
+ * Return TRUE if the currently active function should be ended, because a
+ * return was encountered or an error occured. Used inside a ":while".
+ */
+ int
+func_has_ended(cookie)
+ void *cookie;
+{
+ struct funccall *fcp = (struct funccall *)cookie;
+
+ /* Ignore the "abort" flag if the abortion behavior has been changed due to
+ * an error inside a try conditional. */
+ return (((fcp->func->flags & FC_ABORT) && did_emsg && !aborted_in_try())
+ || fcp->returned);
+}
+
+/*
+ * return TRUE if cookie indicates a function which "abort"s on errors.
+ */
+ int
+func_has_abort(cookie)
+ void *cookie;
+{
+ return ((struct funccall *)cookie)->func->flags & FC_ABORT;
+}
+
+#if defined(FEAT_VIMINFO) || defined(FEAT_SESSION)
+typedef enum
+{
+ VAR_FLAVOUR_DEFAULT,
+ VAR_FLAVOUR_SESSION,
+ VAR_FLAVOUR_VIMINFO
+} var_flavour_T;
+
+static var_flavour_T var_flavour __ARGS((char_u *varname));
+
+ static var_flavour_T
+var_flavour(varname)
+ char_u *varname;
+{
+ char_u *p = varname;
+
+ if (ASCII_ISUPPER(*p))
+ {
+ while (*(++p))
+ if (ASCII_ISLOWER(*p))
+ return VAR_FLAVOUR_SESSION;
+ return VAR_FLAVOUR_VIMINFO;
+ }
+ else
+ return VAR_FLAVOUR_DEFAULT;
+}
+#endif
+
+#if defined(FEAT_VIMINFO) || defined(PROTO)
+/*
+ * Restore global vars that start with a capital from the viminfo file
+ */
+ int
+read_viminfo_varlist(virp, writing)
+ vir_T *virp;
+ int writing;
+{
+ char_u *tab;
+ int is_string = FALSE;
+ VAR varp = NULL;
+ char_u *val;
+
+ if (!writing && (find_viminfo_parameter('!') != NULL))
+ {
+ tab = vim_strchr(virp->vir_line + 1, '\t');
+ if (tab != NULL)
+ {
+ *tab++ = '\0'; /* isolate the variable name */
+ if (*tab == 'S') /* string var */
+ is_string = TRUE;
+
+ tab = vim_strchr(tab, '\t');
+ if (tab != NULL)
+ {
+ /* create a nameless variable to hold the value */
+ if (is_string)
+ {
+ val = viminfo_readstring(virp,
+ (int)(tab - virp->vir_line + 1), TRUE);
+ if (val != NULL)
+ varp = alloc_string_var(val);
+ }
+ else
+ {
+ varp = alloc_var();
+ if (varp != NULL)
+ {
+ varp->var_type = VAR_NUMBER;
+ varp->var_val.var_number = atol((char *)tab + 1);
+ }
+ }
+ /* assign the value to the variable */
+ if (varp != NULL)
+ {
+ set_var(virp->vir_line + 1, varp);
+ free_var(varp);
+ }
+ }
+ }
+ }
+
+ return viminfo_readline(virp);
+}
+
+/*
+ * Write global vars that start with a capital to the viminfo file
+ */
+ void
+write_viminfo_varlist(fp)
+ FILE *fp;
+{
+ garray_T *gap = &variables; /* global variable */
+ VAR this_var;
+ int i;
+
+ if (find_viminfo_parameter('!') == NULL)
+ return;
+
+ fprintf(fp, _("\n# global variables:\n"));
+ for (i = gap->ga_len; --i >= 0; )
+ {
+ this_var = &VAR_GAP_ENTRY(i, gap);
+ if (this_var->var_name != NULL
+ && var_flavour(this_var->var_name) == VAR_FLAVOUR_VIMINFO)
+ {
+ fprintf(fp, "!%s\t%s\t", this_var->var_name,
+ (this_var->var_type == VAR_STRING) ? "STR" : "NUM");
+ viminfo_writestring(fp, get_var_string(this_var));
+ }
+ }
+}
+#endif
+
+#if defined(FEAT_SESSION) || defined(PROTO)
+ int
+store_session_globals(fd)
+ FILE *fd;
+{
+ garray_T *gap = &variables; /* global variable */
+ VAR this_var;
+ int i;
+ char_u *p, *t;
+
+ for (i = gap->ga_len; --i >= 0; )
+ {
+ this_var = &VAR_GAP_ENTRY(i, gap);
+ if (this_var->var_name != NULL)
+ {
+ if (var_flavour(this_var->var_name) == VAR_FLAVOUR_SESSION)
+ {
+ /* Escapse special characters with a backslash. Turn a LF and
+ * CR into \n and \r. */
+ p = vim_strsave_escaped(get_var_string(this_var),
+ (char_u *)"\\\"\n\r");
+ if (p == NULL) /* out of memory */
+ continue;
+ for (t = p; *t != NUL; ++t)
+ if (*t == '\n')
+ *t = 'n';
+ else if (*t == '\r')
+ *t = 'r';
+ if ((fprintf(fd, "let %s = %c%s%c",
+ this_var->var_name,
+ (this_var->var_type == VAR_STRING) ? '"' : ' ',
+ p,
+ (this_var->var_type == VAR_STRING) ? '"' : ' ') < 0)
+ || put_eol(fd) == FAIL)
+ {
+ vim_free(p);
+ return FAIL;
+ }
+ vim_free(p);
+ }
+
+ }
+ }
+ return OK;
+}
+#endif
+
+#endif /* FEAT_EVAL */
+
+#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
+
+
+#ifdef WIN3264
+/*
+ * Functions for ":8" filename modifier: get 8.3 version of a filename.
+ */
+static int get_short_pathname __ARGS((char_u **fnamep, char_u **bufp, int *fnamelen));
+static int shortpath_for_invalid_fname __ARGS((char_u **fname, char_u **bufp, int *fnamelen));
+static int shortpath_for_partial __ARGS((char_u **fnamep, char_u **bufp, int *fnamelen));
+
+/*
+ * Get the short pathname of a file.
+ * Returns 1 on success. *fnamelen is 0 for nonexistant path.
+ */
+ static int
+get_short_pathname(fnamep, bufp, fnamelen)
+ char_u **fnamep;
+ char_u **bufp;
+ int *fnamelen;
+{
+ int l,len;
+ char_u *newbuf;
+
+ len = *fnamelen;
+
+ l = GetShortPathName(*fnamep, *fnamep, len);
+ if (l > len - 1)
+ {
+ /* If that doesn't work (not enough space), then save the string
+ * and try again with a new buffer big enough
+ */
+ newbuf = vim_strnsave(*fnamep, l);
+ if (newbuf == NULL)
+ return 0;
+
+ vim_free(*bufp);
+ *fnamep = *bufp = newbuf;
+
+ l = GetShortPathName(*fnamep,*fnamep,l+1);
+
+ /* Really should always succeed, as the buffer is big enough */
+ }
+
+ *fnamelen = l;
+ return 1;
+}
+
+/*
+ * Create a short path name. Returns the length of the buffer it needs.
+ * Doesn't copy over the end of the buffer passed in.
+ */
+ static int
+shortpath_for_invalid_fname(fname, bufp, fnamelen)
+ char_u **fname;
+ char_u **bufp;
+ int *fnamelen;
+{
+ char_u *s, *p, *pbuf2, *pbuf3;
+ char_u ch;
+ int l,len,len2,plen,slen;
+
+ /* Make a copy */
+ len2 = *fnamelen;
+ pbuf2 = vim_strnsave(*fname, len2);
+ pbuf3 = NULL;
+
+ s = pbuf2 + len2 - 1; /* Find the end */
+ slen = 1;
+ plen = len2;
+
+ l = 0;
+ if (vim_ispathsep(*s))
+ {
+ --s;
+ ++slen;
+ --plen;
+ }
+
+ do
+ {
+ /* Go back one path-seperator */
+ while (s > pbuf2 && !vim_ispathsep(*s))
+ {
+ --s;
+ ++slen;
+ --plen;
+ }
+ if (s <= pbuf2)
+ break;
+
+ /* Remeber the character that is about to be blatted */
+ ch = *s;
+ *s = 0; /* get_short_pathname requires a null-terminated string */
+
+ /* Try it in situ */
+ p = pbuf2;
+ if (!get_short_pathname(&p, &pbuf3, &plen))
+ {
+ vim_free(pbuf2);
+ return -1;
+ }
+ *s = ch; /* Preserve the string */
+ } while (plen == 0);
+
+ if (plen > 0)
+ {
+ /* Remeber the length of the new string. */
+ *fnamelen = len = plen + slen;
+ vim_free(*bufp);
+ if (len > len2)
+ {
+ /* If there's not enough space in the currently allocated string,
+ * then copy it to a buffer big enough.
+ */
+ *fname= *bufp = vim_strnsave(p, len);
+ if (*fname == NULL)
+ return -1;
+ }
+ else
+ {
+ /* Transfer pbuf2 to being the main buffer (it's big enough) */
+ *fname = *bufp = pbuf2;
+ if (p != pbuf2)
+ strncpy(*fname, p, plen);
+ pbuf2 = NULL;
+ }
+ /* Concat the next bit */
+ strncpy(*fname + plen, s, slen);
+ (*fname)[len] = '\0';
+ }
+ vim_free(pbuf3);
+ vim_free(pbuf2);
+ return 0;
+}
+
+/*
+ * Get a pathname for a partial path.
+ */
+ static int
+shortpath_for_partial(fnamep, bufp, fnamelen)
+ char_u **fnamep;
+ char_u **bufp;
+ int *fnamelen;
+{
+ int sepcount, len, tflen;
+ char_u *p;
+ char_u *pbuf, *tfname;
+ int hasTilde;
+
+ /* Count up the path seperators from the RHS.. so we know which part
+ * of the path to return.
+ */
+ sepcount = 0;
+ for (p = *fnamep + *fnamelen - 1; p >= *fnamep; --p)
+ if (vim_ispathsep(*p))
+ ++sepcount;
+
+ /* Need full path first (use expand_env() to remove a "~/") */
+ hasTilde = (**fnamep == '~');
+ if (hasTilde)
+ pbuf = tfname = expand_env_save(*fnamep);
+ else
+ pbuf = tfname = FullName_save(*fnamep, FALSE);
+
+ len = tflen = STRLEN(tfname);
+
+ if (!get_short_pathname(&tfname, &pbuf, &len))
+ return -1;
+
+ if (len == 0)
+ {
+ /* Don't have a valid filename, so shorten the rest of the
+ * path if we can. This CAN give us invalid 8.3 filenames, but
+ * there's not a lot of point in guessing what it might be.
+ */
+ len = tflen;
+ if (shortpath_for_invalid_fname(&tfname, &pbuf, &len) == -1)
+ return -1;
+ }
+
+ /* Count the paths backward to find the beginning of the desired string. */
+ for (p = tfname + len - 1; p >= tfname; --p)
+ if (vim_ispathsep(*p))
+ {
+ if (sepcount == 0 || (hasTilde && sepcount == 1))
+ break;
+ else
+ sepcount --;
+ }
+ if (hasTilde)
+ {
+ --p;
+ if (p >= tfname)
+ *p = '~';
+ else
+ return -1;
+ }
+ else
+ ++p;
+
+ /* Copy in the string - p indexes into tfname - allocated at pbuf */
+ vim_free(*bufp);
+ *fnamelen = (int)STRLEN(p);
+ *bufp = pbuf;
+ *fnamep = p;
+
+ return 0;
+}
+#endif /* WIN3264 */
+
+/*
+ * Adjust a filename, according to a string of modifiers.
+ * *fnamep must be NUL terminated when called. When returning, the length is
+ * determined by *fnamelen.
+ * Returns valid flags.
+ * When there is an error, *fnamep is set to NULL.
+ */
+ int
+modify_fname(src, usedlen, fnamep, bufp, fnamelen)
+ char_u *src; /* string with modifiers */
+ int *usedlen; /* characters after src that are used */
+ char_u **fnamep; /* file name so far */
+ char_u **bufp; /* buffer for allocated file name or NULL */
+ int *fnamelen; /* length of fnamep */
+{
+ int valid = 0;
+ char_u *tail;
+ char_u *s, *p, *pbuf;
+ char_u dirname[MAXPATHL];
+ int c;
+ int has_fullname = 0;
+#ifdef WIN3264
+ int has_shortname = 0;
+#endif
+
+repeat:
+ /* ":p" - full path/file_name */
+ if (src[*usedlen] == ':' && src[*usedlen + 1] == 'p')
+ {
+ has_fullname = 1;
+
+ valid |= VALID_PATH;
+ *usedlen += 2;
+
+ /* Expand "~/path" for all systems and "~user/path" for Unix and VMS */
+ if ((*fnamep)[0] == '~'
+#if !defined(UNIX) && !(defined(VMS) && defined(USER_HOME))
+ && ((*fnamep)[1] == '/'
+# ifdef BACKSLASH_IN_FILENAME
+ || (*fnamep)[1] == '\\'
+# endif
+ || (*fnamep)[1] == NUL)
+
+#endif
+ )
+ {
+ *fnamep = expand_env_save(*fnamep);
+ vim_free(*bufp); /* free any allocated file name */
+ *bufp = *fnamep;
+ if (*fnamep == NULL)
+ return -1;
+ }
+
+ /* When "/." or "/.." is used: force expansion to get rid of it. */
+ for (p = *fnamep; *p != NUL; ++p)
+ {
+ if (vim_ispathsep(*p)
+ && p[1] == '.'
+ && (p[2] == NUL
+ || vim_ispathsep(p[2])
+ || (p[2] == '.'
+ && (p[3] == NUL || vim_ispathsep(p[3])))))
+ break;
+ }
+
+ /* FullName_save() is slow, don't use it when not needed. */
+ if (*p != NUL || !vim_isAbsName(*fnamep))
+ {
+ *fnamep = FullName_save(*fnamep, *p != NUL);
+ vim_free(*bufp); /* free any allocated file name */
+ *bufp = *fnamep;
+ if (*fnamep == NULL)
+ return -1;
+ }
+
+ /* Append a path separator to a directory. */
+ if (mch_isdir(*fnamep))
+ {
+ /* Make room for one or two extra characters. */
+ *fnamep = vim_strnsave(*fnamep, (int)STRLEN(*fnamep) + 2);
+ vim_free(*bufp); /* free any allocated file name */
+ *bufp = *fnamep;
+ if (*fnamep == NULL)
+ return -1;
+ add_pathsep(*fnamep);
+ }
+ }
+
+ /* ":." - path relative to the current directory */
+ /* ":~" - path relative to the home directory */
+ /* ":8" - shortname path - postponed till after */
+ while (src[*usedlen] == ':'
+ && ((c = src[*usedlen + 1]) == '.' || c == '~' || c == '8'))
+ {
+ *usedlen += 2;
+ if (c == '8')
+ {
+#ifdef WIN3264
+ has_shortname = 1; /* Postpone this. */
+#endif
+ continue;
+ }
+ pbuf = NULL;
+ /* Need full path first (use expand_env() to remove a "~/") */
+ if (!has_fullname)
+ {
+ if (c == '.' && **fnamep == '~')
+ p = pbuf = expand_env_save(*fnamep);
+ else
+ p = pbuf = FullName_save(*fnamep, FALSE);
+ }
+ else
+ p = *fnamep;
+
+ has_fullname = 0;
+
+ if (p != NULL)
+ {
+ if (c == '.')
+ {
+ mch_dirname(dirname, MAXPATHL);
+ s = shorten_fname(p, dirname);
+ if (s != NULL)
+ {
+ *fnamep = s;
+ if (pbuf != NULL)
+ {
+ vim_free(*bufp); /* free any allocated file name */
+ *bufp = pbuf;
+ pbuf = NULL;
+ }
+ }
+ }
+ else
+ {
+ home_replace(NULL, p, dirname, MAXPATHL, TRUE);
+ /* Only replace it when it starts with '~' */
+ if (*dirname == '~')
+ {
+ s = vim_strsave(dirname);
+ if (s != NULL)
+ {
+ *fnamep = s;
+ vim_free(*bufp);
+ *bufp = s;
+ }
+ }
+ }
+ vim_free(pbuf);
+ }
+ }
+
+ tail = gettail(*fnamep);
+ *fnamelen = (int)STRLEN(*fnamep);
+
+ /* ":h" - head, remove "/file_name", can be repeated */
+ /* Don't remove the first "/" or "c:\" */
+ while (src[*usedlen] == ':' && src[*usedlen + 1] == 'h')
+ {
+ valid |= VALID_HEAD;
+ *usedlen += 2;
+ s = get_past_head(*fnamep);
+ while (tail > s && vim_ispathsep(tail[-1]))
+ --tail;
+ *fnamelen = (int)(tail - *fnamep);
+#ifdef VMS
+ if (*fnamelen > 0)
+ *fnamelen += 1; /* the path separator is part of the path */
+#endif
+ while (tail > s && !vim_ispathsep(tail[-1]))
+ --tail;
+ }
+
+ /* ":8" - shortname */
+ if (src[*usedlen] == ':' && src[*usedlen + 1] == '8')
+ {
+ *usedlen += 2;
+#ifdef WIN3264
+ has_shortname = 1;
+#endif
+ }
+
+#ifdef WIN3264
+ /* Check shortname after we have done 'heads' and before we do 'tails'
+ */
+ if (has_shortname)
+ {
+ pbuf = NULL;
+ /* Copy the string if it is shortened by :h */
+ if (*fnamelen < (int)STRLEN(*fnamep))
+ {
+ p = vim_strnsave(*fnamep, *fnamelen);
+ if (p == 0)
+ return -1;
+ vim_free(*bufp);
+ *bufp = *fnamep = p;
+ }
+
+ /* Split into two implementations - makes it easier. First is where
+ * there isn't a full name already, second is where there is.
+ */
+ if (!has_fullname && !vim_isAbsName(*fnamep))
+ {
+ if (shortpath_for_partial(fnamep, bufp, fnamelen) == -1)
+ return -1;
+ }
+ else
+ {
+ int l;
+
+ /* Simple case, already have the full-name
+ * Nearly always shorter, so try first time. */
+ l = *fnamelen;
+ if (!get_short_pathname(fnamep, bufp, &l))
+ return -1;
+
+ if (l == 0)
+ {
+ /* Couldn't find the filename.. search the paths.
+ */
+ l = *fnamelen;
+ if (shortpath_for_invalid_fname(fnamep, bufp, &l ) == -1)
+ return -1;
+ }
+ *fnamelen = l;
+ }
+ }
+#endif /* WIN3264 */
+
+ /* ":t" - tail, just the basename */
+ if (src[*usedlen] == ':' && src[*usedlen + 1] == 't')
+ {
+ *usedlen += 2;
+ *fnamelen -= (int)(tail - *fnamep);
+ *fnamep = tail;
+ }
+
+ /* ":e" - extension, can be repeated */
+ /* ":r" - root, without extension, can be repeated */
+ while (src[*usedlen] == ':'
+ && (src[*usedlen + 1] == 'e' || src[*usedlen + 1] == 'r'))
+ {
+ /* find a '.' in the tail:
+ * - for second :e: before the current fname
+ * - otherwise: The last '.'
+ */
+ if (src[*usedlen + 1] == 'e' && *fnamep > tail)
+ s = *fnamep - 2;
+ else
+ s = *fnamep + *fnamelen - 1;
+ for ( ; s > tail; --s)
+ if (s[0] == '.')
+ break;
+ if (src[*usedlen + 1] == 'e') /* :e */
+ {
+ if (s > tail)
+ {
+ *fnamelen += (int)(*fnamep - (s + 1));
+ *fnamep = s + 1;
+#ifdef VMS
+ /* cut version from the extension */
+ s = *fnamep + *fnamelen - 1;
+ for ( ; s > *fnamep; --s)
+ if (s[0] == ';')
+ break;
+ if (s > *fnamep)
+ *fnamelen = s - *fnamep;
+#endif
+ }
+ else if (*fnamep <= tail)
+ *fnamelen = 0;
+ }
+ else /* :r */
+ {
+ if (s > tail) /* remove one extension */
+ *fnamelen = (int)(s - *fnamep);
+ }
+ *usedlen += 2;
+ }
+
+ /* ":s?pat?foo?" - substitute */
+ /* ":gs?pat?foo?" - global substitute */
+ if (src[*usedlen] == ':'
+ && (src[*usedlen + 1] == 's'
+ || (src[*usedlen + 1] == 'g' && src[*usedlen + 2] == 's')))
+ {
+ char_u *str;
+ char_u *pat;
+ char_u *sub;
+ int sep;
+ char_u *flags;
+ int didit = FALSE;
+
+ flags = (char_u *)"";
+ s = src + *usedlen + 2;
+ if (src[*usedlen + 1] == 'g')
+ {
+ flags = (char_u *)"g";
+ ++s;
+ }
+
+ sep = *s++;
+ if (sep)
+ {
+ /* find end of pattern */
+ p = vim_strchr(s, sep);
+ if (p != NULL)
+ {
+ pat = vim_strnsave(s, (int)(p - s));
+ if (pat != NULL)
+ {
+ s = p + 1;
+ /* find end of substitution */
+ p = vim_strchr(s, sep);
+ if (p != NULL)
+ {
+ sub = vim_strnsave(s, (int)(p - s));
+ str = vim_strnsave(*fnamep, *fnamelen);
+ if (sub != NULL && str != NULL)
+ {
+ *usedlen = (int)(p + 1 - src);
+ s = do_string_sub(str, pat, sub, flags);
+ if (s != NULL)
+ {
+ *fnamep = s;
+ *fnamelen = (int)STRLEN(s);
+ vim_free(*bufp);
+ *bufp = s;
+ didit = TRUE;
+ }
+ }
+ vim_free(sub);
+ vim_free(str);
+ }
+ vim_free(pat);
+ }
+ }
+ /* after using ":s", repeat all the modifiers */
+ if (didit)
+ goto repeat;
+ }
+ }
+
+ return valid;
+}
+
+/*
+ * Perform a substitution on "str" with pattern "pat" and substitute "sub".
+ * "flags" can be "g" to do a global substitute.
+ * Returns an allocated string, NULL for error.
+ */
+ char_u *
+do_string_sub(str, pat, sub, flags)
+ char_u *str;
+ char_u *pat;
+ char_u *sub;
+ char_u *flags;
+{
+ int sublen;
+ regmatch_T regmatch;
+ int i;
+ int do_all;
+ char_u *tail;
+ garray_T ga;
+ char_u *ret;
+ char_u *save_cpo;
+
+ /* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+
+ ga_init2(&ga, 1, 200);
+
+ do_all = (flags[0] == 'g');
+
+ regmatch.rm_ic = p_ic;
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
+ if (regmatch.regprog != NULL)
+ {
+ tail = str;
+ while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str)))
+ {
+ /*
+ * Get some space for a temporary buffer to do the substitution
+ * into. It will contain:
+ * - The text up to where the match is.
+ * - The substituted text.
+ * - The text after the match.
+ */
+ sublen = vim_regsub(&regmatch, sub, tail, FALSE, TRUE, FALSE);
+ if (ga_grow(&ga, (int)(STRLEN(tail) + sublen -
+ (regmatch.endp[0] - regmatch.startp[0]))) == FAIL)
+ {
+ ga_clear(&ga);
+ break;
+ }
+
+ /* copy the text up to where the match is */
+ i = (int)(regmatch.startp[0] - tail);
+ mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i);
+ /* add the substituted text */
+ (void)vim_regsub(&regmatch, sub, (char_u *)ga.ga_data
+ + ga.ga_len + i, TRUE, TRUE, FALSE);
+ ga.ga_len += i + sublen - 1;
+ ga.ga_room -= i + sublen - 1;
+ /* avoid getting stuck on a match with an empty string */
+ if (tail == regmatch.endp[0])
+ {
+ if (*tail == NUL)
+ break;
+ *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
+ ++ga.ga_len;
+ --ga.ga_room;
+ }
+ else
+ {
+ tail = regmatch.endp[0];
+ if (*tail == NUL)
+ break;
+ }
+ if (!do_all)
+ break;
+ }
+
+ if (ga.ga_data != NULL)
+ STRCPY((char *)ga.ga_data + ga.ga_len, tail);
+
+ vim_free(regmatch.regprog);
+ }
+
+ ret = vim_strsave(ga.ga_data == NULL ? str : (char_u *)ga.ga_data);
+ ga_clear(&ga);
+ p_cpo = save_cpo;
+
+ return ret;
+}
+
+#endif /* defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) */
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
new file mode 100644
index 000000000..e6036ca34
--- /dev/null
+++ b/src/ex_cmds.c
@@ -0,0 +1,6198 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ex_cmds.c: some functions for command line commands
+ */
+
+#include "vim.h"
+#include "version.h"
+
+#ifdef FEAT_EX_EXTRA
+static int linelen __ARGS((int *has_tab));
+#endif
+static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
+#ifdef FEAT_VIMINFO
+static char_u *viminfo_filename __ARGS((char_u *));
+static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read));
+static int viminfo_encoding __ARGS((vir_T *virp));
+static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
+#endif
+
+static int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
+static int check_readonly __ARGS((int *forceit, buf_T *buf));
+#ifdef FEAT_AUTOCMD
+static void delbuf_msg __ARGS((char_u *name));
+#endif
+static int do_sub_msg __ARGS((void));
+static int
+#ifdef __BORLANDC__
+ _RTLENTRYF
+#endif
+ help_compare __ARGS((const void *s1, const void *s2));
+
+/*
+ * ":ascii" and "ga".
+ */
+/*ARGSUSED*/
+ void
+do_ascii(eap)
+ exarg_T *eap;
+{
+ int c;
+ char buf1[20];
+ char buf2[20];
+ char_u buf3[7];
+#ifdef FEAT_MBYTE
+ int c1 = 0;
+ int c2 = 0;
+ int len;
+
+ if (enc_utf8)
+ c = utfc_ptr2char(ml_get_cursor(), &c1, &c2);
+ else
+#endif
+ c = gchar_cursor();
+ if (c == NUL)
+ {
+ MSG("NUL");
+ return;
+ }
+
+#ifdef FEAT_MBYTE
+ IObuff[0] = NUL;
+ if (!has_mbyte || (enc_dbcs != 0 && c < 0x100) || c < 0x80)
+#endif
+ {
+ if (c == NL) /* NUL is stored as NL */
+ c = NUL;
+ if (vim_isprintc_strict(c) && (c < ' '
+#ifndef EBCDIC
+ || c > '~'
+#endif
+ ))
+ {
+ transchar_nonprint(buf3, c);
+ sprintf(buf1, " <%s>", (char *)buf3);
+ }
+ else
+ buf1[0] = NUL;
+#ifndef EBCDIC
+ if (c >= 0x80)
+ sprintf(buf2, " <M-%s>", transchar(c & 0x7f));
+ else
+#endif
+ buf2[0] = NUL;
+ sprintf((char *)IObuff, _("<%s>%s%s %d, Hex %02x, Octal %03o"),
+ transchar(c), buf1, buf2, c, c, c);
+#ifdef FEAT_MBYTE
+ c = c1;
+ c1 = c2;
+ c2 = 0;
+#endif
+ }
+
+#ifdef FEAT_MBYTE
+ /* Repeat for combining characters. */
+ while (has_mbyte && (c >= 0x100 || (enc_utf8 && c >= 0x80)))
+ {
+ len = (int)STRLEN(IObuff);
+ /* This assumes every multi-byte char is printable... */
+ if (len > 0)
+ IObuff[len++] = ' ';
+ IObuff[len++] = '<';
+ if (utf_iscomposing(c)
+#ifdef USE_GUI
+ && !gui.in_use
+#endif
+ )
+ IObuff[len++] = ' '; /* draw composing char on top of a space */
+ IObuff[len + (*mb_char2bytes)(c, IObuff + len)] = NUL;
+ sprintf((char *)IObuff + STRLEN(IObuff),
+ c < 0x10000 ? _("> %d, Hex %04x, Octal %o")
+ : _("> %d, Hex %08x, Octal %o"), c, c, c);
+ c = c1;
+ c1 = c2;
+ c2 = 0;
+ }
+#endif
+
+ msg(IObuff);
+}
+
+#if defined(FEAT_EX_EXTRA) || defined(PROTO)
+/*
+ * ":left", ":center" and ":right": align text.
+ */
+ void
+ex_align(eap)
+ exarg_T *eap;
+{
+ pos_T save_curpos;
+ int len;
+ int indent = 0;
+ int new_indent;
+ int has_tab;
+ int width;
+
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl)
+ {
+ /* switch left and right aligning */
+ if (eap->cmdidx == CMD_right)
+ eap->cmdidx = CMD_left;
+ else if (eap->cmdidx == CMD_left)
+ eap->cmdidx = CMD_right;
+ }
+#endif
+
+ width = atoi((char *)eap->arg);
+ save_curpos = curwin->w_cursor;
+ if (eap->cmdidx == CMD_left) /* width is used for new indent */
+ {
+ if (width >= 0)
+ indent = width;
+ }
+ else
+ {
+ /*
+ * if 'textwidth' set, use it
+ * else if 'wrapmargin' set, use it
+ * if invalid value, use 80
+ */
+ if (width <= 0)
+ width = curbuf->b_p_tw;
+ if (width == 0 && curbuf->b_p_wm > 0)
+ width = W_WIDTH(curwin) - curbuf->b_p_wm;
+ if (width <= 0)
+ width = 80;
+ }
+
+ if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL)
+ return;
+
+ for (curwin->w_cursor.lnum = eap->line1;
+ curwin->w_cursor.lnum <= eap->line2; ++curwin->w_cursor.lnum)
+ {
+ if (eap->cmdidx == CMD_left) /* left align */
+ new_indent = indent;
+ else
+ {
+ len = linelen(eap->cmdidx == CMD_right ? &has_tab
+ : NULL) - get_indent();
+
+ if (len <= 0) /* skip blank lines */
+ continue;
+
+ if (eap->cmdidx == CMD_center)
+ new_indent = (width - len) / 2;
+ else
+ {
+ new_indent = width - len; /* right align */
+
+ /*
+ * Make sure that embedded TABs don't make the text go too far
+ * to the right.
+ */
+ if (has_tab)
+ while (new_indent > 0)
+ {
+ (void)set_indent(new_indent, 0);
+ if (linelen(NULL) <= width)
+ {
+ /*
+ * Now try to move the line as much as possible to
+ * the right. Stop when it moves too far.
+ */
+ do
+ (void)set_indent(++new_indent, 0);
+ while (linelen(NULL) <= width);
+ --new_indent;
+ break;
+ }
+ --new_indent;
+ }
+ }
+ }
+ if (new_indent < 0)
+ new_indent = 0;
+ (void)set_indent(new_indent, 0); /* set indent */
+ }
+ changed_lines(eap->line1, 0, eap->line2 + 1, 0L);
+ curwin->w_cursor = save_curpos;
+ beginline(BL_WHITE | BL_FIX);
+}
+
+/*
+ * Get the length of the current line, excluding trailing white space.
+ */
+ static int
+linelen(has_tab)
+ int *has_tab;
+{
+ char_u *line;
+ char_u *first;
+ char_u *last;
+ int save;
+ int len;
+
+ /* find the first non-blank character */
+ line = ml_get_curline();
+ first = skipwhite(line);
+
+ /* find the character after the last non-blank character */
+ for (last = first + STRLEN(first);
+ last > first && vim_iswhite(last[-1]); --last)
+ ;
+ save = *last;
+ *last = NUL;
+ len = linetabsize(line); /* get line length */
+ if (has_tab != NULL) /* check for embedded TAB */
+ *has_tab = (vim_strrchr(first, TAB) != NULL);
+ *last = save;
+
+ return len;
+}
+
+/*
+ * ":retab".
+ */
+ void
+ex_retab(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+ int got_tab = FALSE;
+ long num_spaces = 0;
+ long num_tabs;
+ long len;
+ long col;
+ long vcol;
+ long start_col = 0; /* For start of white-space string */
+ long start_vcol = 0; /* For start of white-space string */
+ int temp;
+ long old_len;
+ char_u *ptr;
+ char_u *new_line = (char_u *)1; /* init to non-NULL */
+ int did_undo; /* called u_save for current line */
+ int new_ts;
+ int save_list;
+ linenr_T first_line = 0; /* first changed line */
+ linenr_T last_line = 0; /* last changed line */
+
+ save_list = curwin->w_p_list;
+ curwin->w_p_list = 0; /* don't want list mode here */
+
+ new_ts = getdigits(&(eap->arg));
+ if (new_ts < 0)
+ {
+ EMSG(_(e_positive));
+ return;
+ }
+ if (new_ts == 0)
+ new_ts = curbuf->b_p_ts;
+ for (lnum = eap->line1; !got_int && lnum <= eap->line2; ++lnum)
+ {
+ ptr = ml_get(lnum);
+ col = 0;
+ vcol = 0;
+ did_undo = FALSE;
+ for (;;)
+ {
+ if (vim_iswhite(ptr[col]))
+ {
+ if (!got_tab && num_spaces == 0)
+ {
+ /* First consecutive white-space */
+ start_vcol = vcol;
+ start_col = col;
+ }
+ if (ptr[col] == ' ')
+ num_spaces++;
+ else
+ got_tab = TRUE;
+ }
+ else
+ {
+ if (got_tab || (eap->forceit && num_spaces > 1))
+ {
+ /* Retabulate this string of white-space */
+
+ /* len is virtual length of white string */
+ len = num_spaces = vcol - start_vcol;
+ num_tabs = 0;
+ if (!curbuf->b_p_et)
+ {
+ temp = new_ts - (start_vcol % new_ts);
+ if (num_spaces >= temp)
+ {
+ num_spaces -= temp;
+ num_tabs++;
+ }
+ num_tabs += num_spaces / new_ts;
+ num_spaces -= (num_spaces / new_ts) * new_ts;
+ }
+ if (curbuf->b_p_et || got_tab ||
+ (num_spaces + num_tabs < len))
+ {
+ if (did_undo == FALSE)
+ {
+ did_undo = TRUE;
+ if (u_save((linenr_T)(lnum - 1),
+ (linenr_T)(lnum + 1)) == FAIL)
+ {
+ new_line = NULL; /* flag out-of-memory */
+ break;
+ }
+ }
+
+ /* len is actual number of white characters used */
+ len = num_spaces + num_tabs;
+ old_len = (long)STRLEN(ptr);
+ new_line = lalloc(old_len - col + start_col + len + 1,
+ TRUE);
+ if (new_line == NULL)
+ break;
+ if (start_col > 0)
+ mch_memmove(new_line, ptr, (size_t)start_col);
+ mch_memmove(new_line + start_col + len,
+ ptr + col, (size_t)(old_len - col + 1));
+ ptr = new_line + start_col;
+ for (col = 0; col < len; col++)
+ ptr[col] = (col < num_tabs) ? '\t' : ' ';
+ ml_replace(lnum, new_line, FALSE);
+ if (first_line == 0)
+ first_line = lnum;
+ last_line = lnum;
+ ptr = new_line;
+ col = start_col + len;
+ }
+ }
+ got_tab = FALSE;
+ num_spaces = 0;
+ }
+ if (ptr[col] == NUL)
+ break;
+ vcol += chartabsize(ptr + col, (colnr_T)vcol);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ col += (*mb_ptr2len_check)(ptr + col);
+ else
+#endif
+ ++col;
+ }
+ if (new_line == NULL) /* out of memory */
+ break;
+ line_breakcheck();
+ }
+ if (got_int)
+ EMSG(_(e_interr));
+
+ if (curbuf->b_p_ts != new_ts)
+ redraw_curbuf_later(NOT_VALID);
+ if (first_line != 0)
+ changed_lines(first_line, 0, last_line + 1, 0L);
+
+ curwin->w_p_list = save_list; /* restore 'list' */
+
+ curbuf->b_p_ts = new_ts;
+ coladvance(curwin->w_curswant);
+
+ u_clearline();
+}
+#endif
+
+/*
+ * :move command - move lines line1-line2 to line dest
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_move(line1, line2, dest)
+ linenr_T line1;
+ linenr_T line2;
+ linenr_T dest;
+{
+ char_u *str;
+ linenr_T l;
+ linenr_T extra; /* Num lines added before line1 */
+ linenr_T num_lines; /* Num lines moved */
+ linenr_T last_line; /* Last line in file after adding new text */
+
+ if (dest >= line1 && dest < line2)
+ {
+ EMSG(_("E134: Move lines into themselves"));
+ return FAIL;
+ }
+
+ num_lines = line2 - line1 + 1;
+
+ /*
+ * First we copy the old text to its new location -- webb
+ * Also copy the flag that ":global" command uses.
+ */
+ if (u_save(dest, dest + 1) == FAIL)
+ return FAIL;
+ for (extra = 0, l = line1; l <= line2; l++)
+ {
+ str = vim_strsave(ml_get(l + extra));
+ if (str != NULL)
+ {
+ ml_append(dest + l - line1, str, (colnr_T)0, FALSE);
+ vim_free(str);
+ if (dest < line1)
+ extra++;
+ }
+ }
+
+ /*
+ * Now we must be careful adjusting our marks so that we don't overlap our
+ * mark_adjust() calls.
+ *
+ * We adjust the marks within the old text so that they refer to the
+ * last lines of the file (temporarily), because we know no other marks
+ * will be set there since these line numbers did not exist until we added
+ * our new lines.
+ *
+ * Then we adjust the marks on lines between the old and new text positions
+ * (either forwards or backwards).
+ *
+ * And Finally we adjust the marks we put at the end of the file back to
+ * their final destination at the new text position -- webb
+ */
+ last_line = curbuf->b_ml.ml_line_count;
+ mark_adjust(line1, line2, last_line - line2, 0L);
+ if (dest >= line2)
+ {
+ mark_adjust(line2 + 1, dest, -num_lines, 0L);
+ curbuf->b_op_start.lnum = dest - num_lines + 1;
+ curbuf->b_op_end.lnum = dest;
+ }
+ else
+ {
+ mark_adjust(dest + 1, line1 - 1, num_lines, 0L);
+ curbuf->b_op_start.lnum = dest + 1;
+ curbuf->b_op_end.lnum = dest + num_lines;
+ }
+ curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
+ mark_adjust(last_line - num_lines + 1, last_line,
+ -(last_line - dest - extra), 0L);
+
+ /*
+ * Now we delete the original text -- webb
+ */
+ if (u_save(line1 + extra - 1, line2 + extra + 1) == FAIL)
+ return FAIL;
+
+ for (l = line1; l <= line2; l++)
+ ml_delete(line1 + extra, TRUE);
+
+ if (!global_busy && num_lines > p_report)
+ {
+ if (num_lines == 1)
+ MSG(_("1 line moved"));
+ else
+ smsg((char_u *)_("%ld lines moved"), num_lines);
+ }
+
+ /*
+ * Leave the cursor on the last of the moved lines.
+ */
+ if (dest >= line1)
+ curwin->w_cursor.lnum = dest;
+ else
+ curwin->w_cursor.lnum = dest + (line2 - line1) + 1;
+
+ if (line1 < dest)
+ changed_lines(line1, 0, dest + num_lines + 1, 0L);
+ else
+ changed_lines(dest + 1, 0, line1 + num_lines, 0L);
+
+ return OK;
+}
+
+/*
+ * ":copy"
+ */
+ void
+ex_copy(line1, line2, n)
+ linenr_T line1;
+ linenr_T line2;
+ linenr_T n;
+{
+ linenr_T count;
+ char_u *p;
+
+ count = line2 - line1 + 1;
+ curbuf->b_op_start.lnum = n + 1;
+ curbuf->b_op_end.lnum = n + count;
+ curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
+
+ /*
+ * there are three situations:
+ * 1. destination is above line1
+ * 2. destination is between line1 and line2
+ * 3. destination is below line2
+ *
+ * n = destination (when starting)
+ * curwin->w_cursor.lnum = destination (while copying)
+ * line1 = start of source (while copying)
+ * line2 = end of source (while copying)
+ */
+ if (u_save(n, n + 1) == FAIL)
+ return;
+
+ curwin->w_cursor.lnum = n;
+ while (line1 <= line2)
+ {
+ /* need to use vim_strsave() because the line will be unlocked within
+ * ml_append() */
+ p = vim_strsave(ml_get(line1));
+ if (p != NULL)
+ {
+ ml_append(curwin->w_cursor.lnum, p, (colnr_T)0, FALSE);
+ vim_free(p);
+ }
+ /* situation 2: skip already copied lines */
+ if (line1 == n)
+ line1 = curwin->w_cursor.lnum;
+ ++line1;
+ if (curwin->w_cursor.lnum < line1)
+ ++line1;
+ if (curwin->w_cursor.lnum < line2)
+ ++line2;
+ ++curwin->w_cursor.lnum;
+ }
+
+ appended_lines_mark(n, count);
+
+ msgmore((long)count);
+}
+
+/*
+ * Handle the ":!cmd" command. Also for ":r !cmd" and ":w !cmd"
+ * Bangs in the argument are replaced with the previously entered command.
+ * Remember the argument.
+ *
+ * RISCOS: Bangs only replaced when followed by a space, since many
+ * pathnames contain one.
+ */
+ void
+do_bang(addr_count, eap, forceit, do_in, do_out)
+ int addr_count;
+ exarg_T *eap;
+ int forceit;
+ int do_in, do_out;
+{
+ char_u *arg = eap->arg; /* command */
+ linenr_T line1 = eap->line1; /* start of range */
+ linenr_T line2 = eap->line2; /* end of range */
+ static char_u *prevcmd = NULL; /* the previous command */
+ char_u *newcmd = NULL; /* the new command */
+ int free_newcmd = FALSE; /* need to free() newcmd */
+ int ins_prevcmd;
+ char_u *t;
+ char_u *p;
+ char_u *trailarg;
+ int len;
+ int scroll_save = msg_scroll;
+
+ /*
+ * Disallow shell commands for "rvim".
+ * Disallow shell commands from .exrc and .vimrc in current directory for
+ * security reasons.
+ */
+ if (check_restricted() || check_secure())
+ return;
+
+ if (addr_count == 0) /* :! */
+ {
+ msg_scroll = FALSE; /* don't scroll here */
+ autowrite_all();
+ msg_scroll = scroll_save;
+ }
+
+ /*
+ * Try to find an embedded bang, like in :!<cmd> ! [args]
+ * (:!! is indicated by the 'forceit' variable)
+ */
+ ins_prevcmd = forceit;
+ trailarg = arg;
+ do
+ {
+ len = (int)STRLEN(trailarg) + 1;
+ if (newcmd != NULL)
+ len += (int)STRLEN(newcmd);
+ if (ins_prevcmd)
+ {
+ if (prevcmd == NULL)
+ {
+ EMSG(_(e_noprev));
+ vim_free(newcmd);
+ return;
+ }
+ len += (int)STRLEN(prevcmd);
+ }
+ if ((t = alloc(len)) == NULL)
+ {
+ vim_free(newcmd);
+ return;
+ }
+ *t = NUL;
+ if (newcmd != NULL)
+ STRCAT(t, newcmd);
+ if (ins_prevcmd)
+ STRCAT(t, prevcmd);
+ p = t + STRLEN(t);
+ STRCAT(t, trailarg);
+ vim_free(newcmd);
+ newcmd = t;
+
+ /*
+ * Scan the rest of the argument for '!', which is replaced by the
+ * previous command. "\!" is replaced by "!" (this is vi compatible).
+ */
+ trailarg = NULL;
+ while (*p)
+ {
+ if (*p == '!'
+#ifdef RISCOS
+ && (p[1] == ' ' || p[1] == NUL)
+#endif
+ )
+ {
+ if (p > newcmd && p[-1] == '\\')
+ mch_memmove(p - 1, p, (size_t)(STRLEN(p) + 1));
+ else
+ {
+ trailarg = p;
+ *trailarg++ = NUL;
+ ins_prevcmd = TRUE;
+ break;
+ }
+ }
+ ++p;
+ }
+ } while (trailarg != NULL);
+
+ vim_free(prevcmd);
+ prevcmd = newcmd;
+
+ if (bangredo) /* put cmd in redo buffer for ! command */
+ {
+ AppendToRedobuffLit(prevcmd);
+ AppendToRedobuff((char_u *)"\n");
+ bangredo = FALSE;
+ }
+ /*
+ * Add quotes around the command, for shells that need them.
+ */
+ if (*p_shq != NUL)
+ {
+ newcmd = alloc((unsigned)(STRLEN(prevcmd) + 2 * STRLEN(p_shq) + 1));
+ if (newcmd == NULL)
+ return;
+ STRCPY(newcmd, p_shq);
+ STRCAT(newcmd, prevcmd);
+ STRCAT(newcmd, p_shq);
+ free_newcmd = TRUE;
+ }
+ if (addr_count == 0) /* :! */
+ {
+ /* echo the command */
+ msg_start();
+ msg_putchar(':');
+ msg_putchar('!');
+ msg_outtrans(newcmd);
+ msg_clr_eos();
+ windgoto(msg_row, msg_col);
+
+ do_shell(newcmd, 0);
+ }
+ else /* :range! */
+ /* Careful: This may recursively call do_bang() again! (because of
+ * autocommands) */
+ do_filter(line1, line2, eap, newcmd, do_in, do_out);
+ if (free_newcmd)
+ vim_free(newcmd);
+}
+
+/*
+ * do_filter: filter lines through a command given by the user
+ *
+ * We use temp files and the call_shell() routine here. This would normally
+ * be done using pipes on a UNIX machine, but this is more portable to
+ * non-unix machines. The call_shell() routine needs to be able
+ * to deal with redirection somehow, and should handle things like looking
+ * at the PATH env. variable, and adding reasonable extensions to the
+ * command name given by the user. All reasonable versions of call_shell()
+ * do this.
+ * We use input redirection if do_in is TRUE.
+ * We use output redirection if do_out is TRUE.
+ */
+ static void
+do_filter(line1, line2, eap, cmd, do_in, do_out)
+ linenr_T line1, line2;
+ exarg_T *eap; /* for forced 'ff' and 'fenc' */
+ char_u *cmd;
+ int do_in, do_out;
+{
+ char_u *itmp = NULL;
+ char_u *otmp = NULL;
+ linenr_T linecount;
+ linenr_T read_linecount;
+ pos_T cursor_save;
+ char_u *cmd_buf;
+#ifdef FEAT_AUTOCMD
+ buf_T *old_curbuf = curbuf;
+#endif
+
+ if (*cmd == NUL) /* no filter command */
+ return;
+
+#ifdef WIN3264
+ /*
+ * Check if external commands are allowed now.
+ */
+ if (can_end_termcap_mode(TRUE) == FALSE)
+ return;
+#endif
+
+ cursor_save = curwin->w_cursor;
+ linecount = line2 - line1 + 1;
+ curwin->w_cursor.lnum = line1;
+ curwin->w_cursor.col = 0;
+ changed_line_abv_curs();
+ invalidate_botline();
+
+ /*
+ * 1. Form temp file names
+ * 2. Write the lines to a temp file
+ * 3. Run the filter command on the temp file
+ * 4. Read the output of the command into the buffer
+ * 5. Delete the original lines to be filtered
+ * 6. Remove the temp files
+ */
+
+ if ((do_in && (itmp = vim_tempname('i')) == NULL)
+ || (do_out && (otmp = vim_tempname('o')) == NULL))
+ {
+ EMSG(_(e_notmp));
+ goto filterend;
+ }
+
+/*
+ * The writing and reading of temp files will not be shown.
+ * Vi also doesn't do this and the messages are not very informative.
+ */
+ ++no_wait_return; /* don't call wait_return() while busy */
+ if (do_in && buf_write(curbuf, itmp, NULL, line1, line2, eap,
+ FALSE, FALSE, FALSE, TRUE) == FAIL)
+ {
+ msg_putchar('\n'); /* keep message from buf_write() */
+ --no_wait_return;
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (!aborting())
+#endif
+ (void)EMSG2(_(e_notcreate), itmp); /* will call wait_return */
+ goto filterend;
+ }
+#ifdef FEAT_AUTOCMD
+ if (curbuf != old_curbuf)
+ goto filterend;
+#endif
+
+ if (!do_out)
+ msg_putchar('\n');
+
+ cmd_buf = make_filter_cmd(cmd, itmp, otmp);
+ if (cmd_buf == NULL)
+ goto filterend;
+
+ windgoto((int)Rows - 1, 0);
+ cursor_on();
+
+ /*
+ * When not redirecting the output the command can write anything to the
+ * screen. If 'shellredir' is equal to ">", screen may be messed up by
+ * stderr output of external command. Clear the screen later.
+ * If do_in is FALSE, this could be something like ":r !cat", which may
+ * also mess up the screen, clear it later.
+ */
+ if (!do_out || STRCMP(p_srr, ">") == 0 || !do_in)
+ redraw_later_clear();
+
+ /*
+ * When call_shell() fails wait_return() is called to give the user a
+ * chance to read the error messages. Otherwise errors are ignored, so you
+ * can see the error messages from the command that appear on stdout; use
+ * 'u' to fix the text
+ * Switch to cooked mode when not redirecting stdin, avoids that something
+ * like ":r !cat" hangs.
+ * Pass on the SHELL_DOOUT flag when the output is being redirected.
+ */
+ if (call_shell(cmd_buf, SHELL_FILTER | SHELL_COOKED
+ | (do_out ? SHELL_DOOUT : 0)))
+ {
+ redraw_later_clear();
+ wait_return(FALSE);
+ }
+ vim_free(cmd_buf);
+
+ did_check_timestamps = FALSE;
+ need_check_timestamps = TRUE;
+
+ /* When interrupting the shell command, it may still have produced some
+ * useful output. Reset got_int here, so that readfile() won't cancel
+ * reading. */
+ ui_breakcheck();
+ got_int = FALSE;
+
+ if (do_out)
+ {
+ if (u_save((linenr_T)(line2), (linenr_T)(line2 + 1)) == FAIL)
+ goto error;
+ redraw_curbuf_later(VALID);
+ read_linecount = curbuf->b_ml.ml_line_count;
+ if (readfile(otmp, NULL, line2, (linenr_T)0, (linenr_T)MAXLNUM, eap,
+ READ_FILTER) == FAIL)
+ {
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (!aborting())
+#endif
+ {
+ msg_putchar('\n');
+ EMSG2(_(e_notread), otmp);
+ }
+ goto error;
+ }
+#ifdef FEAT_AUTOCMD
+ if (curbuf != old_curbuf)
+ goto filterend;
+#endif
+
+ if (do_in)
+ {
+ if (cmdmod.keepmarks || vim_strchr(p_cpo, CPO_REMMARK) == NULL)
+ {
+ read_linecount = curbuf->b_ml.ml_line_count - read_linecount;
+ if (read_linecount >= linecount)
+ /* move all marks from old lines to new lines */
+ mark_adjust(line1, line2, linecount, 0L);
+ else
+ {
+ /* move marks from old lines to new lines, delete marks
+ * that are in deleted lines */
+ mark_adjust(line1, line1 + read_linecount - 1,
+ linecount, 0L);
+ mark_adjust(line1 + read_linecount, line2, MAXLNUM, 0L);
+ }
+ }
+
+ /*
+ * Put cursor on first filtered line for ":range!cmd".
+ * Adjust '[ and '] (set by buf_write()).
+ */
+ curwin->w_cursor.lnum = line1;
+ del_lines(linecount, TRUE);
+ curbuf->b_op_start.lnum -= linecount; /* adjust '[ */
+ curbuf->b_op_end.lnum -= linecount; /* adjust '] */
+ write_lnum_adjust(-linecount); /* adjust last line
+ for next write */
+ }
+ else
+ {
+ /*
+ * Put cursor on last new line for ":r !cmd".
+ */
+ curwin->w_cursor.lnum = curbuf->b_op_end.lnum;
+ linecount = curbuf->b_op_end.lnum - curbuf->b_op_start.lnum + 1;
+ }
+ beginline(BL_WHITE | BL_FIX); /* cursor on first non-blank */
+ --no_wait_return;
+
+ if (linecount > p_report)
+ {
+ if (do_in)
+ {
+ sprintf((char *)msg_buf, _("%ld lines filtered"),
+ (long)linecount);
+ if (msg(msg_buf) && !msg_scroll)
+ {
+ /* save message to display it after redraw */
+ set_keep_msg(msg_buf);
+ keep_msg_attr = 0;
+ }
+ }
+ else
+ msgmore((long)linecount);
+ }
+ }
+ else
+ {
+error:
+ /* put cursor back in same position for ":w !cmd" */
+ curwin->w_cursor = cursor_save;
+ --no_wait_return;
+ wait_return(FALSE);
+ }
+
+filterend:
+
+#ifdef FEAT_AUTOCMD
+ if (curbuf != old_curbuf)
+ {
+ --no_wait_return;
+ EMSG(_("E135: *Filter* Autocommands must not change current buffer"));
+ }
+#endif
+ if (itmp != NULL)
+ mch_remove(itmp);
+ if (otmp != NULL)
+ mch_remove(otmp);
+ vim_free(itmp);
+ vim_free(otmp);
+}
+
+/*
+ * Call a shell to execute a command.
+ * When "cmd" is NULL start an interactive shell.
+ */
+ void
+do_shell(cmd, flags)
+ char_u *cmd;
+ int flags; /* may be SHELL_DOOUT when output is redirected */
+{
+ buf_T *buf;
+#ifndef FEAT_GUI_MSWIN
+ int save_nwr;
+#endif
+#ifdef MSWIN
+ int winstart = FALSE;
+#endif
+
+ /*
+ * Disallow shell commands for "rvim".
+ * Disallow shell commands from .exrc and .vimrc in current directory for
+ * security reasons.
+ */
+ if (check_restricted() || check_secure())
+ {
+ msg_end();
+ return;
+ }
+
+#ifdef MSWIN
+ /*
+ * Check if external commands are allowed now.
+ */
+ if (can_end_termcap_mode(TRUE) == FALSE)
+ return;
+
+ /*
+ * Check if ":!start" is used.
+ */
+ if (cmd != NULL)
+ winstart = (STRNICMP(cmd, "start ", 6) == 0);
+#endif
+
+ /*
+ * For autocommands we want to get the output on the current screen, to
+ * avoid having to type return below.
+ */
+ msg_putchar('\r'); /* put cursor at start of line */
+#ifdef FEAT_AUTOCMD
+ if (!autocmd_busy)
+#endif
+ {
+#ifdef MSWIN
+ if (!winstart)
+#endif
+ stoptermcap();
+ }
+#ifdef MSWIN
+ if (!winstart)
+#endif
+ msg_putchar('\n'); /* may shift screen one line up */
+
+ /* warning message before calling the shell */
+ if (p_warn
+#ifdef FEAT_AUTOCMD
+ && !autocmd_busy
+#endif
+ && msg_silent == 0)
+ for (buf = firstbuf; buf; buf = buf->b_next)
+ if (bufIsChanged(buf))
+ {
+#ifdef FEAT_GUI_MSWIN
+ if (!winstart)
+ starttermcap(); /* don't want a message box here */
+#endif
+ MSG_PUTS(_("[No write since last change]\n"));
+#ifdef FEAT_GUI_MSWIN
+ if (!winstart)
+ stoptermcap();
+#endif
+ break;
+ }
+
+ /* This windgoto is required for when the '\n' resulted in a "delete line
+ * 1" command to the terminal. */
+ if (!swapping_screen())
+ windgoto(msg_row, msg_col);
+ cursor_on();
+ (void)call_shell(cmd, SHELL_COOKED | flags);
+ did_check_timestamps = FALSE;
+ need_check_timestamps = TRUE;
+
+ /*
+ * put the message cursor at the end of the screen, avoids wait_return()
+ * to overwrite the text that the external command showed
+ */
+ if (!swapping_screen())
+ {
+ msg_row = Rows - 1;
+ msg_col = 0;
+ }
+
+#ifdef FEAT_AUTOCMD
+ if (autocmd_busy)
+ {
+ if (msg_silent == 0)
+ redraw_later_clear();
+ }
+ else
+#endif
+ {
+ /*
+ * For ":sh" there is no need to call wait_return(), just redraw.
+ * Also for the Win32 GUI (the output is in a console window).
+ * Otherwise there is probably text on the screen that the user wants
+ * to read before redrawing, so call wait_return().
+ */
+#ifndef FEAT_GUI_MSWIN
+ if (cmd == NULL
+# ifdef WIN3264
+ || (winstart && !need_wait_return)
+# endif
+ )
+ {
+ if (msg_silent == 0)
+ redraw_later_clear();
+ need_wait_return = FALSE;
+ }
+ else
+ {
+ /*
+ * If we switch screens when starttermcap() is called, we really
+ * want to wait for "hit return to continue".
+ */
+ save_nwr = no_wait_return;
+ if (swapping_screen())
+ no_wait_return = FALSE;
+# ifdef AMIGA
+ wait_return(term_console ? -1 : msg_silent == 0); /* see below */
+# else
+ wait_return(msg_silent == 0);
+# endif
+ no_wait_return = save_nwr;
+ }
+#endif /* FEAT_GUI_W32 */
+
+#ifdef MSWIN
+ if (!winstart) /* if winstart==TRUE, never stopped termcap! */
+#endif
+ starttermcap(); /* start termcap if not done by wait_return() */
+
+ /*
+ * In an Amiga window redrawing is caused by asking the window size.
+ * If we got an interrupt this will not work. The chance that the
+ * window size is wrong is very small, but we need to redraw the
+ * screen. Don't do this if ':' hit in wait_return(). THIS IS UGLY
+ * but it saves an extra redraw.
+ */
+#ifdef AMIGA
+ if (skip_redraw) /* ':' hit in wait_return() */
+ {
+ if (msg_silent == 0)
+ redraw_later_clear();
+ }
+ else if (term_console)
+ {
+ OUT_STR(IF_EB("\033[0 q", ESC_STR "[0 q")); /* get window size */
+ if (got_int && msg_silent == 0)
+ redraw_later_clear(); /* if got_int is TRUE, redraw needed */
+ else
+ must_redraw = 0; /* no extra redraw needed */
+ }
+#endif
+ }
+
+ /* display any error messages now */
+ display_errors();
+}
+
+/*
+ * Create a shell command from a command string, input redirection file and
+ * output redirection file.
+ * Returns an allocated string with the shell command, or NULL for failure.
+ */
+ char_u *
+make_filter_cmd(cmd, itmp, otmp)
+ char_u *cmd; /* command */
+ char_u *itmp; /* NULL or name of input file */
+ char_u *otmp; /* NULL or name of output file */
+{
+ char_u *buf;
+ long_u len;
+
+ len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */
+ if (itmp != NULL)
+ len += (long_u)STRLEN(itmp) + 9; /* " { < " + " } " */
+ if (otmp != NULL)
+ len += (long_u)STRLEN(otmp) + (long_u)STRLEN(p_srr) + 2; /* " " */
+ buf = lalloc(len, TRUE);
+ if (buf == NULL)
+ return NULL;
+
+#if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
+ /*
+ * put braces around the command (for concatenated commands)
+ */
+ sprintf((char *)buf, "(%s)", (char *)cmd);
+ if (itmp != NULL)
+ {
+ STRCAT(buf, " < ");
+ STRCAT(buf, itmp);
+ }
+#else
+ /*
+ * for shells that don't understand braces around commands, at least allow
+ * the use of commands in a pipe.
+ */
+ STRCPY(buf, cmd);
+ if (itmp != NULL)
+ {
+ char_u *p;
+
+ /*
+ * If there is a pipe, we have to put the '<' in front of it.
+ * Don't do this when 'shellquote' is not empty, otherwise the
+ * redirection would be inside the quotes.
+ */
+ if (*p_shq == NUL)
+ {
+ p = vim_strchr(buf, '|');
+ if (p != NULL)
+ *p = NUL;
+ }
+# ifdef RISCOS
+ STRCAT(buf, " { < "); /* Use RISC OS notation for input. */
+ STRCAT(buf, itmp);
+ STRCAT(buf, " } ");
+# else
+ STRCAT(buf, " <"); /* " < " causes problems on Amiga */
+ STRCAT(buf, itmp);
+# endif
+ if (*p_shq == NUL)
+ {
+ p = vim_strchr(cmd, '|');
+ if (p != NULL)
+ {
+ STRCAT(buf, " "); /* insert a space before the '|' for DOS */
+ STRCAT(buf, p);
+ }
+ }
+ }
+#endif
+ if (otmp != NULL)
+ append_redir(buf, p_srr, otmp);
+
+ return buf;
+}
+
+/*
+ * Append output redirection for file "fname" to the end of string buffer "buf"
+ * Works with the 'shellredir' and 'shellpipe' options.
+ * The caller should make sure that there is enough room:
+ * STRLEN(opt) + STRLEN(fname) + 3
+ */
+ void
+append_redir(buf, opt, fname)
+ char_u *buf;
+ char_u *opt;
+ char_u *fname;
+{
+ char_u *p;
+
+ buf += STRLEN(buf);
+ /* find "%s", skipping "%%" */
+ for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
+ if (p[1] == 's')
+ break;
+ if (p != NULL)
+ {
+ *buf = ' '; /* not really needed? Not with sh, ksh or bash */
+ sprintf((char *)buf + 1, (char *)opt, (char *)fname);
+ }
+ else
+ sprintf((char *)buf,
+#ifdef FEAT_QUICKFIX
+# ifndef RISCOS
+ opt != p_sp ? " %s%s" :
+# endif
+ " %s %s",
+#else
+# ifndef RISCOS
+ " %s%s", /* " > %s" causes problems on Amiga */
+# else
+ " %s %s", /* But is needed for 'shellpipe' and RISC OS */
+# endif
+#endif
+ (char *)opt, (char *)fname);
+}
+
+#ifdef FEAT_VIMINFO
+
+static int no_viminfo __ARGS((void));
+static int viminfo_errcnt;
+
+ static int
+no_viminfo()
+{
+ /* "vim -i NONE" does not read or write a viminfo file */
+ return (use_viminfo != NULL && STRCMP(use_viminfo, "NONE") == 0);
+}
+
+/*
+ * Report an error for reading a viminfo file.
+ * Count the number of errors. When there are more than 10, return TRUE.
+ */
+ int
+viminfo_error(errnum, message, line)
+ char *errnum;
+ char *message;
+ char_u *line;
+{
+ sprintf((char *)IObuff, _("%sviminfo: %s in line: "), errnum, message);
+ STRNCAT(IObuff, line, IOSIZE - STRLEN(IObuff));
+ emsg(IObuff);
+ if (++viminfo_errcnt >= 10)
+ {
+ EMSG(_("E136: viminfo: Too many errors, skipping rest of file"));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * read_viminfo() -- Read the viminfo file. Registers etc. which are already
+ * set are not over-written unless force is TRUE. -- webb
+ */
+ int
+read_viminfo(file, want_info, want_marks, forceit)
+ char_u *file;
+ int want_info;
+ int want_marks;
+ int forceit;
+{
+ FILE *fp;
+ char_u *fname;
+
+ if (no_viminfo())
+ return FAIL;
+
+ fname = viminfo_filename(file); /* may set to default if NULL */
+ if (fname == NULL)
+ return FAIL;
+ fp = mch_fopen((char *)fname, READBIN);
+
+ if (p_verbose > 0)
+ {
+ char_u *s;
+
+ s = fname;
+ if (STRLEN(fname) > IOSIZE - 100)
+ s = fname + STRLEN(fname) - (IOSIZE - 100);
+ smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"), s,
+ want_info ? _(" info") : "",
+ want_marks ? _(" marks") : "",
+ fp == NULL ? _(" FAILED") : "");
+ }
+
+ vim_free(fname);
+ if (fp == NULL)
+ return FAIL;
+
+ viminfo_errcnt = 0;
+ do_viminfo(fp, NULL, want_info, want_marks, forceit);
+
+ fclose(fp);
+
+ return OK;
+}
+
+/*
+ * write_viminfo() -- Write the viminfo file. The old one is read in first so
+ * that effectively a merge of current info and old info is done. This allows
+ * multiple vims to run simultaneously, without losing any marks etc. If
+ * forceit is TRUE, then the old file is not read in, and only internal info is
+ * written to the file. -- webb
+ */
+ void
+write_viminfo(file, forceit)
+ char_u *file;
+ int forceit;
+{
+ char_u *fname;
+ FILE *fp_in = NULL; /* input viminfo file, if any */
+ FILE *fp_out = NULL; /* output viminfo file */
+ char_u *tempname = NULL; /* name of temp viminfo file */
+ struct stat st_new; /* mch_stat() of potential new file */
+ char_u *wp;
+#if defined(UNIX) || defined(VMS)
+ mode_t umask_save;
+#endif
+#ifdef UNIX
+ int shortname = FALSE; /* use 8.3 file name */
+ struct stat st_old; /* mch_stat() of existing viminfo file */
+#endif
+
+ if (no_viminfo())
+ return;
+
+ fname = viminfo_filename(file); /* may set to default if NULL */
+ if (fname == NULL)
+ return;
+
+ fp_in = mch_fopen((char *)fname, READBIN);
+ if (fp_in == NULL)
+ {
+ /* if it does exist, but we can't read it, don't try writing */
+ if (mch_stat((char *)fname, &st_new) == 0)
+ goto end;
+#if defined(UNIX) || defined(VMS)
+ /*
+ * For Unix we create the .viminfo non-accessible for others,
+ * because it may contain text from non-accessible documents.
+ */
+ umask_save = umask(077);
+#endif
+ fp_out = mch_fopen((char *)fname, WRITEBIN);
+#if defined(UNIX) || defined(VMS)
+ (void)umask(umask_save);
+#endif
+ }
+ else
+ {
+ /*
+ * There is an existing viminfo file. Create a temporary file to
+ * write the new viminfo into, in the same directory as the
+ * existing viminfo file, which will be renamed later.
+ */
+#ifdef UNIX
+ /*
+ * For Unix we check the owner of the file. It's not very nice to
+ * overwrite a user's viminfo file after a "su root", with a
+ * viminfo file that the user can't read.
+ */
+ st_old.st_dev = st_old.st_ino = 0;
+ st_old.st_mode = 0600;
+ if (mch_stat((char *)fname, &st_old) == 0 && getuid() &&
+ !(st_old.st_uid == getuid()
+ ? (st_old.st_mode & 0200)
+ : (st_old.st_gid == getgid()
+ ? (st_old.st_mode & 0020)
+ : (st_old.st_mode & 0002))))
+ {
+ int tt;
+
+ /* avoid a wait_return for this message, it's annoying */
+ tt = msg_didany;
+ EMSG2(_("E137: Viminfo file is not writable: %s"), fname);
+ msg_didany = tt;
+ goto end;
+ }
+#endif
+
+ /*
+ * Make tempname.
+ * May try twice: Once normal and once with shortname set, just in
+ * case somebody puts his viminfo file in an 8.3 filesystem.
+ */
+ for (;;)
+ {
+ tempname = buf_modname(
+#ifdef UNIX
+ shortname,
+#else
+# ifdef SHORT_FNAME
+ TRUE,
+# else
+# ifdef FEAT_GUI_W32
+ gui_is_win32s(),
+# else
+ FALSE,
+# endif
+# endif
+#endif
+ fname,
+#ifdef VMS
+ (char_u *)"-tmp",
+#else
+# ifdef RISCOS
+ (char_u *)"/tmp",
+# else
+ (char_u *)".tmp",
+# endif
+#endif
+ FALSE);
+ if (tempname == NULL) /* out of memory */
+ break;
+
+ /*
+ * Check if tempfile already exists. Never overwrite an
+ * existing file!
+ */
+ if (mch_stat((char *)tempname, &st_new) == 0)
+ {
+#ifdef UNIX
+ /*
+ * Check if tempfile is same as original file. May happen
+ * when modname() gave the same file back. E.g. silly
+ * link, or file name-length reached. Try again with
+ * shortname set.
+ */
+ if (!shortname && st_new.st_dev == st_old.st_dev &&
+ st_new.st_ino == st_old.st_ino)
+ {
+ vim_free(tempname);
+ tempname = NULL;
+ shortname = TRUE;
+ continue;
+ }
+#endif
+ /*
+ * Try another name. Change one character, just before
+ * the extension. This should also work for an 8.3
+ * file name, when after adding the extension it still is
+ * the same file as the original.
+ */
+ wp = tempname + STRLEN(tempname) - 5;
+ if (wp < gettail(tempname)) /* empty file name? */
+ wp = gettail(tempname);
+ for (*wp = 'z'; mch_stat((char *)tempname, &st_new) == 0;
+ --*wp)
+ {
+ /*
+ * They all exist? Must be something wrong! Don't
+ * write the viminfo file then.
+ */
+ if (*wp == 'a')
+ {
+ vim_free(tempname);
+ tempname = NULL;
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ if (tempname != NULL)
+ {
+ fp_out = mch_fopen((char *)tempname, WRITEBIN);
+
+ /*
+ * If we can't create in the same directory, try creating a
+ * "normal" temp file.
+ */
+ if (fp_out == NULL)
+ {
+ vim_free(tempname);
+ if ((tempname = vim_tempname('o')) != NULL)
+ fp_out = mch_fopen((char *)tempname, WRITEBIN);
+ }
+#ifdef UNIX
+ /*
+ * Set file protection same as original file, but strip s-bit
+ * and make sure the owner can read/write it.
+ */
+ if (fp_out != NULL)
+ {
+ (void)mch_setperm(tempname,
+ (long)((st_old.st_mode & 0777) | 0600));
+ /* this only works for root: */
+ (void)chown((char *)tempname, st_old.st_uid, st_old.st_gid);
+ }
+#endif
+ }
+ }
+
+ /*
+ * Check if the new viminfo file can be written to.
+ */
+ if (fp_out == NULL)
+ {
+ EMSG2(_("E138: Can't write viminfo file %s!"),
+ (fp_in == NULL || tempname == NUL) ? fname : tempname);
+ if (fp_in != NULL)
+ fclose(fp_in);
+ goto end;
+ }
+
+ if (p_verbose > 0)
+ msg_str((char_u *)_("Writing viminfo file \"%s\""), fname);
+
+ viminfo_errcnt = 0;
+ do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE);
+
+ fclose(fp_out); /* errors are ignored !? */
+ if (fp_in != NULL)
+ {
+ fclose(fp_in);
+ /*
+ * In case of an error, don't overwrite the original viminfo file.
+ */
+ if (viminfo_errcnt || vim_rename(tempname, fname) == -1)
+ mch_remove(tempname);
+ }
+end:
+ vim_free(fname);
+ vim_free(tempname);
+}
+
+/*
+ * Get the viminfo file name to use.
+ * If "file" is given and not empty, use it (has already been expanded by
+ * cmdline functions).
+ * Otherwise use "-i file_name", value from 'viminfo' or the default, and
+ * expand environment variables.
+ * Returns an allocated string. NULL when out of memory.
+ */
+ static char_u *
+viminfo_filename(file)
+ char_u *file;
+{
+ if (file == NULL || *file == NUL)
+ {
+ if (use_viminfo != NULL)
+ file = use_viminfo;
+ else if ((file = find_viminfo_parameter('n')) == NULL || *file == NUL)
+ {
+#ifdef VIMINFO_FILE2
+ /* don't use $HOME when not defined (turned into "c:/"!). */
+# ifdef VMS
+ if (mch_getenv((char_u *)"SYS$LOGIN") == NULL)
+# else
+ if (mch_getenv((char_u *)"HOME") == NULL)
+# endif
+ {
+ /* don't use $VIM when not available. */
+ expand_env((char_u *)"$VIM", NameBuff, MAXPATHL);
+ if (STRCMP("$VIM", NameBuff) != 0) /* $VIM was expanded */
+ file = (char_u *)VIMINFO_FILE2;
+ else
+ file = (char_u *)VIMINFO_FILE;
+ }
+ else
+#endif
+ file = (char_u *)VIMINFO_FILE;
+ }
+ expand_env(file, NameBuff, MAXPATHL);
+ file = NameBuff;
+ }
+ return vim_strsave(file);
+}
+
+/*
+ * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
+ */
+ static void
+do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
+ FILE *fp_in;
+ FILE *fp_out;
+ int want_info;
+ int want_marks;
+ int force_read;
+{
+ int count = 0;
+ int eof = FALSE;
+ vir_T vir;
+
+ if ((vir.vir_line = alloc(LSIZE)) == NULL)
+ return;
+ vir.vir_fd = fp_in;
+#ifdef FEAT_MBYTE
+ vir.vir_conv.vc_type = CONV_NONE;
+#endif
+
+ if (fp_in != NULL)
+ {
+ if (want_info)
+ eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL);
+ else
+ /* Skip info, find start of marks */
+ while (!(eof = viminfo_readline(&vir))
+ && vir.vir_line[0] != '>')
+ ;
+ }
+ if (fp_out != NULL)
+ {
+ /* Write the info: */
+ fprintf(fp_out, _("# This viminfo file was generated by Vim %s.\n"),
+ VIM_VERSION_MEDIUM);
+ fprintf(fp_out, _("# You may edit it if you're careful!\n\n"));
+#ifdef FEAT_MBYTE
+ fprintf(fp_out, _("# Value of 'encoding' when this file was written\n"));
+ fprintf(fp_out, "*encoding=%s\n\n", p_enc);
+#endif
+ write_viminfo_search_pattern(fp_out);
+ write_viminfo_sub_string(fp_out);
+#ifdef FEAT_CMDHIST
+ write_viminfo_history(fp_out);
+#endif
+ write_viminfo_registers(fp_out);
+#ifdef FEAT_EVAL
+ write_viminfo_varlist(fp_out);
+#endif
+ write_viminfo_filemarks(fp_out);
+ write_viminfo_bufferlist(fp_out);
+ count = write_viminfo_marks(fp_out);
+ }
+ if (fp_in != NULL && want_marks)
+ copy_viminfo_marks(&vir, fp_out, count, eof);
+
+ vim_free(vir.vir_line);
+#ifdef FEAT_MBYTE
+ if (vir.vir_conv.vc_type != CONV_NONE)
+ convert_setup(&vir.vir_conv, NULL, NULL);
+#endif
+}
+
+/*
+ * read_viminfo_up_to_marks() -- Only called from do_viminfo(). Reads in the
+ * first part of the viminfo file which contains everything but the marks that
+ * are local to a file. Returns TRUE when end-of-file is reached. -- webb
+ */
+ static int
+read_viminfo_up_to_marks(virp, forceit, writing)
+ vir_T *virp;
+ int forceit;
+ int writing;
+{
+ int eof;
+ buf_T *buf;
+
+#ifdef FEAT_CMDHIST
+ prepare_viminfo_history(forceit ? 9999 : 0);
+#endif
+ eof = viminfo_readline(virp);
+ while (!eof && virp->vir_line[0] != '>')
+ {
+ switch (virp->vir_line[0])
+ {
+ /* Characters reserved for future expansion, ignored now */
+ case '+': /* "+40 /path/dir file", for running vim without args */
+ case '|': /* to be defined */
+ case '^': /* to be defined */
+ case '<': /* long line - ignored */
+ /* A comment or empty line. */
+ case NUL:
+ case '\r':
+ case '\n':
+ case '#':
+ eof = viminfo_readline(virp);
+ break;
+ case '*': /* "*encoding=value" */
+ eof = viminfo_encoding(virp);
+ break;
+ case '!': /* global variable */
+#ifdef FEAT_EVAL
+ eof = read_viminfo_varlist(virp, writing);
+#else
+ eof = viminfo_readline(virp);
+#endif
+ break;
+ case '%': /* entry for buffer list */
+ eof = read_viminfo_bufferlist(virp, writing);
+ break;
+ case '"':
+ eof = read_viminfo_register(virp, forceit);
+ break;
+ case '/': /* Search string */
+ case '&': /* Substitute search string */
+ case '~': /* Last search string, followed by '/' or '&' */
+ eof = read_viminfo_search_pattern(virp, forceit);
+ break;
+ case '$':
+ eof = read_viminfo_sub_string(virp, forceit);
+ break;
+ case ':':
+ case '?':
+ case '=':
+ case '@':
+#ifdef FEAT_CMDHIST
+ eof = read_viminfo_history(virp);
+#else
+ eof = viminfo_readline(virp);
+#endif
+ break;
+ case '-':
+ case '\'':
+ eof = read_viminfo_filemark(virp, forceit);
+ break;
+ default:
+ if (viminfo_error("E575: ", _("Illegal starting char"),
+ virp->vir_line))
+ eof = TRUE;
+ else
+ eof = viminfo_readline(virp);
+ break;
+ }
+ }
+
+#ifdef FEAT_CMDHIST
+ /* Finish reading history items. */
+ finish_viminfo_history();
+#endif
+
+ /* Change file names to buffer numbers for fmarks. */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ fmarks_check_names(buf);
+
+ return eof;
+}
+
+/*
+ * Compare the 'encoding' value in the viminfo file with the current value of
+ * 'encoding'. If different and the 'c' flag is in 'viminfo', setup for
+ * conversion of text with iconv() in viminfo_readstring().
+ */
+ static int
+viminfo_encoding(virp)
+ vir_T *virp;
+{
+#ifdef FEAT_MBYTE
+ char_u *p;
+ int i;
+
+ if (get_viminfo_parameter('c') != 0)
+ {
+ p = vim_strchr(virp->vir_line, '=');
+ if (p != NULL)
+ {
+ /* remove trailing newline */
+ ++p;
+ for (i = 0; vim_isprintc(p[i]); ++i)
+ ;
+ p[i] = NUL;
+
+ convert_setup(&virp->vir_conv, p, p_enc);
+ }
+ }
+#endif
+ return viminfo_readline(virp);
+}
+
+/*
+ * Read a line from the viminfo file.
+ * Returns TRUE for end-of-file;
+ */
+ int
+viminfo_readline(virp)
+ vir_T *virp;
+{
+ return vim_fgets(virp->vir_line, LSIZE, virp->vir_fd);
+}
+
+/*
+ * check string read from viminfo file
+ * remove '\n' at the end of the line
+ * - replace CTRL-V CTRL-V with CTRL-V
+ * - replace CTRL-V 'n' with '\n'
+ *
+ * Check for a long line as written by viminfo_writestring().
+ *
+ * Return the string in allocated memory (NULL when out of memory).
+ */
+/*ARGSUSED*/
+ char_u *
+viminfo_readstring(virp, off, convert)
+ vir_T *virp;
+ int off; /* offset for virp->vir_line */
+ int convert; /* convert the string */
+{
+ char_u *retval;
+ char_u *s, *d;
+ long len;
+
+ if (virp->vir_line[off] == Ctrl_V && vim_isdigit(virp->vir_line[off + 1]))
+ {
+ len = atol((char *)virp->vir_line + off + 1);
+ retval = lalloc(len, TRUE);
+ if (retval == NULL)
+ {
+ /* Line too long? File messed up? Skip next line. */
+ (void)vim_fgets(virp->vir_line, 10, virp->vir_fd);
+ return NULL;
+ }
+ (void)vim_fgets(retval, (int)len, virp->vir_fd);
+ s = retval + 1; /* Skip the leading '<' */
+ }
+ else
+ {
+ retval = vim_strsave(virp->vir_line + off);
+ if (retval == NULL)
+ return NULL;
+ s = retval;
+ }
+
+ /* Change CTRL-V CTRL-V to CTRL-V and CTRL-V n to \n in-place. */
+ d = retval;
+ while (*s != NUL && *s != '\n')
+ {
+ if (s[0] == Ctrl_V && s[1] != NUL)
+ {
+ if (s[1] == 'n')
+ *d++ = '\n';
+ else
+ *d++ = Ctrl_V;
+ s += 2;
+ }
+ else
+ *d++ = *s++;
+ }
+ *d = NUL;
+
+#ifdef FEAT_MBYTE
+ if (convert && virp->vir_conv.vc_type != CONV_NONE && *retval != NUL)
+ {
+ d = string_convert(&virp->vir_conv, retval, NULL);
+ if (d != NULL)
+ {
+ vim_free(retval);
+ retval = d;
+ }
+ }
+#endif
+
+ return retval;
+}
+
+/*
+ * write string to viminfo file
+ * - replace CTRL-V with CTRL-V CTRL-V
+ * - replace '\n' with CTRL-V 'n'
+ * - add a '\n' at the end
+ *
+ * For a long line:
+ * - write " CTRL-V <length> \n " in first line
+ * - write " < <string> \n " in second line
+ */
+ void
+viminfo_writestring(fd, p)
+ FILE *fd;
+ char_u *p;
+{
+ int c;
+ char_u *s;
+ int len = 0;
+
+ for (s = p; *s != NUL; ++s)
+ {
+ if (*s == Ctrl_V || *s == '\n')
+ ++len;
+ ++len;
+ }
+
+ /* If the string will be too long, write its length and put it in the next
+ * line. Take into account that some room is needed for what comes before
+ * the string (e.g., variable name). Add something to the length for the
+ * '<', NL and trailing NUL. */
+ if (len > LSIZE / 2)
+ fprintf(fd, IF_EB("\026%d\n<", CTRL_V_STR "%d\n<"), len + 3);
+
+ while ((c = *p++) != NUL)
+ {
+ if (c == Ctrl_V || c == '\n')
+ {
+ putc(Ctrl_V, fd);
+ if (c == '\n')
+ c = 'n';
+ }
+ putc(c, fd);
+ }
+ putc('\n', fd);
+}
+#endif /* FEAT_VIMINFO */
+
+/*
+ * Implementation of ":fixdel", also used by get_stty().
+ * <BS> resulting <Del>
+ * ^? ^H
+ * not ^? ^?
+ */
+/*ARGSUSED*/
+ void
+do_fixdel(eap)
+ exarg_T *eap;
+{
+ char_u *p;
+
+ p = find_termcode((char_u *)"kb");
+ add_termcode((char_u *)"kD", p != NULL
+ && *p == DEL ? (char_u *)CTRL_H_STR : DEL_STR, FALSE);
+}
+
+ void
+print_line_no_prefix(lnum, use_number)
+ linenr_T lnum;
+ int use_number;
+{
+ char_u numbuf[20];
+
+ if (curwin->w_p_nu || use_number)
+ {
+ sprintf((char *)numbuf, "%7ld ", (long)lnum);
+ msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
+ }
+ msg_prt_line(ml_get(lnum));
+}
+
+/*
+ * Print a text line. Also in silent mode ("ex -s").
+ */
+ void
+print_line(lnum, use_number)
+ linenr_T lnum;
+ int use_number;
+{
+ int save_silent = silent_mode;
+
+ silent_mode = FALSE;
+ msg_start();
+ print_line_no_prefix(lnum, use_number);
+ if (save_silent)
+ {
+ msg_putchar('\n');
+ cursor_on(); /* msg_start() switches it off */
+ out_flush();
+ silent_mode = save_silent;
+ }
+}
+
+/*
+ * ":file[!] [fname]".
+ */
+ void
+ex_file(eap)
+ exarg_T *eap;
+{
+ char_u *fname, *sfname, *xfname;
+ buf_T *buf;
+
+ if (*eap->arg != NUL)
+ {
+#ifdef FEAT_AUTOCMD
+ buf = curbuf;
+ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
+ /* buffer changed, don't change name now */
+ if (buf != curbuf)
+ return;
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return;
+# endif
+#endif
+ /*
+ * The name of the current buffer will be changed.
+ * A new (unlisted) buffer entry needs to be made to hold the old file
+ * name, which will become the alternate file name.
+ */
+ fname = curbuf->b_ffname;
+ sfname = curbuf->b_sfname;
+ xfname = curbuf->b_fname;
+ curbuf->b_ffname = NULL;
+ curbuf->b_sfname = NULL;
+ if (setfname(curbuf, eap->arg, NULL, TRUE) == FAIL)
+ {
+ curbuf->b_ffname = fname;
+ curbuf->b_sfname = sfname;
+ return;
+ }
+ curbuf->b_flags |= BF_NOTEDITED;
+ buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
+ if (buf != NULL)
+ curwin->w_alt_fnum = buf->b_fnum;
+ vim_free(fname);
+ vim_free(sfname);
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
+#endif
+ }
+ /* print full file name if :cd used */
+ fileinfo(FALSE, FALSE, eap->forceit);
+}
+
+/*
+ * ":update".
+ */
+ void
+ex_update(eap)
+ exarg_T *eap;
+{
+ if (curbufIsChanged())
+ (void)do_write(eap);
+}
+
+/*
+ * ":write" and ":saveas".
+ */
+ void
+ex_write(eap)
+ exarg_T *eap;
+{
+ if (eap->usefilter) /* input lines to shell command */
+ do_bang(1, eap, FALSE, TRUE, FALSE);
+ else
+ (void)do_write(eap);
+}
+
+/*
+ * write current buffer to file 'eap->arg'
+ * if 'eap->append' is TRUE, append to the file
+ *
+ * if *eap->arg == NUL write to current file
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_write(eap)
+ exarg_T *eap;
+{
+ int other;
+ char_u *fname = NULL; /* init to shut up gcc */
+ char_u *ffname;
+ int retval = FAIL;
+ char_u *free_fname = NULL;
+#ifdef FEAT_BROWSE
+ char_u *browse_file = NULL;
+#endif
+ buf_T *alt_buf = NULL;
+
+ if (not_writing()) /* check 'write' option */
+ return FAIL;
+
+ ffname = eap->arg;
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ browse_file = do_browse(TRUE, (char_u *)_("Save As"), ffname,
+ NULL, NULL, NULL, curbuf);
+ if (browse_file == NULL)
+ goto theend;
+ ffname = browse_file;
+ }
+#endif
+ if (*ffname == NUL)
+ {
+ if (eap->cmdidx == CMD_saveas)
+ {
+ EMSG(_(e_argreq));
+ goto theend;
+ }
+ other = FALSE;
+ }
+ else
+ {
+ fname = ffname;
+ free_fname = fix_fname(ffname);
+ /*
+ * When out-of-memory, keep unexpanded file name, because we MUST be
+ * able to write the file in this situation.
+ */
+ if (free_fname != NULL)
+ ffname = free_fname;
+ other = otherfile(ffname);
+ }
+
+ /*
+ * If we have a new file, put its name in the list of alternate file names.
+ */
+ if (other)
+ {
+ if (vim_strchr(p_cpo, CPO_ALTWRITE) != NULL
+ || eap->cmdidx == CMD_saveas)
+ alt_buf = setaltfname(ffname, fname, (linenr_T)1);
+ else
+ alt_buf = buflist_findname(ffname);
+ if (alt_buf != NULL && alt_buf->b_ml.ml_mfp != NULL)
+ {
+ /* Overwriting a file that is loaded in another buffer is not a
+ * good idea. */
+ EMSG(_("E139: File is loaded in another buffer"));
+ goto theend;
+ }
+ }
+
+ /*
+ * Writing to the current file is not allowed in readonly mode
+ * and a file name is required.
+ * "nofile" and "nowrite" buffers cannot be written implicitly either.
+ */
+ if (!other && (
+#ifdef FEAT_QUICKFIX
+ bt_dontwrite_msg(curbuf) ||
+#endif
+ check_fname() == FAIL || check_readonly(&eap->forceit, curbuf)))
+ goto theend;
+
+ if (!other)
+ {
+ ffname = curbuf->b_ffname;
+ fname = curbuf->b_fname;
+ /*
+ * Not writing the whole file is only allowed with '!'.
+ */
+ if ( (eap->line1 != 1
+ || eap->line2 != curbuf->b_ml.ml_line_count)
+ && !eap->forceit
+ && !eap->append
+ && !p_wa)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (p_confirm || cmdmod.confirm)
+ {
+ if (vim_dialog_yesno(VIM_QUESTION, NULL,
+ (char_u *)_("Write partial file?"), 2) != VIM_YES)
+ goto theend;
+ eap->forceit = TRUE;
+ }
+ else
+#endif
+ {
+ EMSG(_("E140: Use ! to write partial buffer"));
+ goto theend;
+ }
+ }
+ }
+
+ if (check_overwrite(eap, curbuf, fname, ffname, other) == OK)
+ {
+ if (eap->cmdidx == CMD_saveas && alt_buf != NULL)
+ {
+#ifdef FEAT_AUTOCMD
+ buf_T *was_curbuf = curbuf;
+
+ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
+# ifdef FEAT_EVAL
+ if (curbuf != was_curbuf || aborting())
+# else
+ if (curbuf != was_curbuf)
+# endif
+ {
+ /* buffer changed, don't change name now */
+ retval = FAIL;
+ goto theend;
+ }
+#endif
+ /* Exchange the file names for the current and the alternate
+ * buffer. This makes it look like we are now editing the buffer
+ * under the new name. Must be done before buf_write(), because
+ * if there is no file name and 'cpo' contains 'F', it will set
+ * the file name. */
+ fname = alt_buf->b_fname;
+ alt_buf->b_fname = curbuf->b_fname;
+ curbuf->b_fname = fname;
+ fname = alt_buf->b_ffname;
+ alt_buf->b_ffname = curbuf->b_ffname;
+ curbuf->b_ffname = fname;
+ fname = alt_buf->b_sfname;
+ alt_buf->b_sfname = curbuf->b_sfname;
+ curbuf->b_sfname = fname;
+ buf_name_changed(curbuf);
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
+ if (!alt_buf->b_p_bl)
+ {
+ alt_buf->b_p_bl = TRUE;
+ apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, alt_buf);
+ }
+# ifdef FEAT_EVAL
+ if (curbuf != was_curbuf || aborting())
+# else
+ if (curbuf != was_curbuf)
+# endif
+ {
+ /* buffer changed, don't write the file */
+ retval = FAIL;
+ goto theend;
+ }
+#endif
+ }
+
+ retval = buf_write(curbuf, ffname, fname, eap->line1, eap->line2,
+ eap, eap->append, eap->forceit, TRUE, FALSE);
+ }
+
+theend:
+#ifdef FEAT_BROWSE
+ vim_free(browse_file);
+#endif
+ vim_free(free_fname);
+ return retval;
+}
+
+/*
+ * Check if it is allowed to overwrite a file. If b_flags has BF_NOTEDITED,
+ * BF_NEW or BF_READERR, check for overwriting current file.
+ * May set eap->forceit if a dialog says it's OK to overwrite.
+ * Return OK if it's OK, FAIL if it is not.
+ */
+/*ARGSUSED*/
+ static int
+check_overwrite(eap, buf, fname, ffname, other)
+ exarg_T *eap;
+ buf_T *buf;
+ char_u *fname; /* file name to be used (can differ from
+ buf->ffname) */
+ char_u *ffname; /* full path version of fname */
+ int other; /* writing under other name */
+{
+ /*
+ * write to other file or b_flags set or not writing the whole file:
+ * overwriting only allowed with '!'
+ */
+ if ( (other
+ || (buf->b_flags & BF_NOTEDITED)
+ || ((buf->b_flags & BF_NEW)
+ && vim_strchr(p_cpo, CPO_OVERNEW) == NULL)
+ || (buf->b_flags & BF_READERR))
+ && !eap->forceit
+ && !eap->append
+ && !p_wa
+ && vim_fexists(ffname))
+ {
+#ifdef UNIX
+ /* with UNIX it is possible to open a directory */
+ if (mch_isdir(ffname))
+ {
+ EMSG2(_(e_isadir2), ffname);
+ return FAIL;
+ }
+#endif
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (p_confirm || cmdmod.confirm)
+ {
+ char_u buff[IOSIZE];
+
+ dialog_msg(buff, _("Overwrite existing file \"%.*s\"?"), fname);
+ if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
+ return FAIL;
+ eap->forceit = TRUE;
+ }
+ else
+#endif
+ {
+ EMSG(_(e_exists));
+ return FAIL;
+ }
+ }
+ return OK;
+}
+
+/*
+ * Handle ":wnext", ":wNext" and ":wprevious" commands.
+ */
+ void
+ex_wnext(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ if (eap->cmd[1] == 'n')
+ i = curwin->w_arg_idx + (int)eap->line2;
+ else
+ i = curwin->w_arg_idx - (int)eap->line2;
+ eap->line1 = 1;
+ eap->line2 = curbuf->b_ml.ml_line_count;
+ if (do_write(eap) != FAIL)
+ do_argfile(eap, i);
+}
+
+/*
+ * ":wall", ":wqall" and ":xall": Write all changed files (and exit).
+ */
+ void
+do_wqall(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ int error = 0;
+ int save_forceit = eap->forceit;
+
+ if (eap->cmdidx == CMD_xall || eap->cmdidx == CMD_wqall)
+ exiting = TRUE;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (bufIsChanged(buf))
+ {
+ /*
+ * Check if there is a reason the buffer cannot be written:
+ * 1. if the 'write' option is set
+ * 2. if there is no file name (even after browsing)
+ * 3. if the 'readonly' is set (even after a dialog)
+ * 4. if overwriting is allowed (even after a dialog)
+ */
+ if (not_writing())
+ {
+ ++error;
+ break;
+ }
+#ifdef FEAT_BROWSE
+ /* ":browse wall": ask for file name if there isn't one */
+ if (buf->b_ffname == NULL && cmdmod.browse)
+ browse_save_fname(buf);
+#endif
+ if (buf->b_ffname == NULL)
+ {
+ EMSGN(_("E141: No file name for buffer %ld"), (long)buf->b_fnum);
+ ++error;
+ }
+ else if (check_readonly(&eap->forceit, buf)
+ || check_overwrite(eap, buf, buf->b_fname, buf->b_ffname,
+ FALSE) == FAIL)
+ {
+ ++error;
+ }
+ else
+ {
+ if (buf_write_all(buf, eap->forceit) == FAIL)
+ ++error;
+#ifdef FEAT_AUTOCMD
+ /* an autocommand may have deleted the buffer */
+ if (!buf_valid(buf))
+ buf = firstbuf;
+#endif
+ }
+ eap->forceit = save_forceit; /* check_overwrite() may set it */
+ }
+ }
+ if (exiting)
+ {
+ if (!error)
+ getout(0); /* exit Vim */
+ not_exiting();
+ }
+}
+
+/*
+ * Check the 'write' option.
+ * Return TRUE and give a message when it's not st.
+ */
+ int
+not_writing()
+{
+ if (p_write)
+ return FALSE;
+ EMSG(_("E142: File not written: Writing is disabled by 'write' option"));
+ return TRUE;
+}
+
+/*
+ * Check if a buffer is read-only. Ask for overruling in a dialog.
+ * Return TRUE and give an error message when the buffer is readonly.
+ */
+ static int
+check_readonly(forceit, buf)
+ int *forceit;
+ buf_T *buf;
+{
+ if (!*forceit && buf->b_p_ro)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
+ {
+ char_u buff[IOSIZE];
+
+ dialog_msg(buff, _("'readonly' option is set for \"%.*s\".\nDo you wish to write anyway?"),
+ buf->b_fname);
+
+ if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES)
+ {
+ /* Set forceit, to force the writing of a readonly file */
+ *forceit = TRUE;
+ return FALSE;
+ }
+ else
+ return TRUE;
+ }
+ else
+#endif
+ EMSG(_(e_readonly));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * try to abandon current file and edit a new or existing file
+ * 'fnum' is the number of the file, if zero use ffname/sfname
+ *
+ * return 1 for "normal" error, 2 for "not written" error, 0 for success
+ * -1 for succesfully opening another file
+ * 'lnum' is the line number for the cursor in the new file (if non-zero).
+ */
+ int
+getfile(fnum, ffname, sfname, setpm, lnum, forceit)
+ int fnum;
+ char_u *ffname;
+ char_u *sfname;
+ int setpm;
+ linenr_T lnum;
+ int forceit;
+{
+ int other;
+ int retval;
+ char_u *free_me = NULL;
+
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ return 1;
+#endif
+
+ if (fnum == 0)
+ {
+ /* make ffname full path, set sfname */
+ fname_expand(curbuf, &ffname, &sfname);
+ other = otherfile(ffname);
+ free_me = ffname; /* has been allocated, free() later */
+ }
+ else
+ other = (fnum != curbuf->b_fnum);
+
+ if (other)
+ ++no_wait_return; /* don't wait for autowrite message */
+ if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf)
+ && curbufIsChanged() && autowrite(curbuf, forceit) == FAIL)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (p_confirm && p_write)
+ dialog_changed(curbuf, FALSE);
+ if (curbufIsChanged())
+#endif
+ {
+ if (other)
+ --no_wait_return;
+ EMSG(_(e_nowrtmsg));
+ retval = 2; /* file has been changed */
+ goto theend;
+ }
+ }
+ if (other)
+ --no_wait_return;
+ if (setpm)
+ setpcmark();
+ if (!other)
+ {
+ if (lnum != 0)
+ curwin->w_cursor.lnum = lnum;
+ check_cursor_lnum();
+ beginline(BL_SOL | BL_FIX);
+ retval = 0; /* it's in the same file */
+ }
+ else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
+ (P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0)) == OK)
+ retval = -1; /* opened another file */
+ else
+ retval = 1; /* error encountered */
+
+theend:
+ vim_free(free_me);
+ return retval;
+}
+
+/*
+ * start editing a new file
+ *
+ * fnum: file number; if zero use ffname/sfname
+ * ffname: the file name
+ * - full path if sfname used,
+ * - any file name if sfname is NULL
+ * - empty string to re-edit with the same file name (but may be
+ * in a different directory)
+ * - NULL to start an empty buffer
+ * sfname: the short file name (or NULL)
+ * eap: contains the command to be executed after loading the file and
+ * forced 'ff' and 'fenc'
+ * newlnum: if > 0: put cursor on this line number (if possible)
+ * if ECMD_LASTL: use last position in loaded file
+ * if ECMD_LAST: use last position in all files
+ * if ECMD_ONE: use first line
+ * flags:
+ * ECMD_HIDE: if TRUE don't free the current buffer
+ * ECMD_SET_HELP: set b_help flag of (new) buffer before opening file
+ * ECMD_OLDBUF: use existing buffer if it exists
+ * ECMD_FORCEIT: ! used for Ex command
+ * ECMD_ADDBUF: don't edit, just add to buffer list
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
+ int fnum;
+ char_u *ffname;
+ char_u *sfname;
+ exarg_T *eap; /* can be NULL! */
+ linenr_T newlnum;
+ int flags;
+{
+ int other_file; /* TRUE if editing another file */
+ int oldbuf; /* TRUE if using existing buffer */
+#ifdef FEAT_AUTOCMD
+ int auto_buf = FALSE; /* TRUE if autocommands brought us
+ into the buffer unexpectedly */
+ char_u *new_name = NULL;
+#endif
+ buf_T *buf;
+#if defined(FEAT_AUTOCMD) || defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ buf_T *old_curbuf = curbuf;
+#endif
+ char_u *free_fname = NULL;
+#ifdef FEAT_BROWSE
+ char_u *browse_file = NULL;
+#endif
+ int retval = FAIL;
+ long n;
+ linenr_T lnum;
+ linenr_T topline = 0;
+ int newcol = -1;
+ int solcol = -1;
+ pos_T *pos;
+#ifdef FEAT_SUN_WORKSHOP
+ char_u *cp;
+#endif
+ char_u *command = NULL;
+
+ if (eap != NULL)
+ command = eap->do_ecmd_cmd;
+
+ if (fnum != 0)
+ {
+ if (fnum == curbuf->b_fnum) /* file is already being edited */
+ return OK; /* nothing to do */
+ other_file = TRUE;
+ }
+ else
+ {
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ browse_file = do_browse(FALSE, (char_u *)_("Edit File"), ffname,
+ NULL, NULL, NULL, curbuf);
+ if (browse_file == NULL)
+ goto theend;
+ ffname = browse_file;
+ }
+#endif
+ /* if no short name given, use ffname for short name */
+ if (sfname == NULL)
+ sfname = ffname;
+#ifdef USE_FNAME_CASE
+# ifdef USE_LONG_FNAME
+ if (USE_LONG_FNAME)
+# endif
+ fname_case(sfname, 0); /* set correct case for short file name */
+#endif
+
+#ifdef FEAT_LISTCMDS
+ if ((flags & ECMD_ADDBUF) && (ffname == NULL || *ffname == NUL))
+ goto theend;
+#endif
+
+ if (ffname == NULL)
+ other_file = TRUE;
+ /* there is no file name */
+ else if (*ffname == NUL && curbuf->b_ffname == NULL)
+ other_file = FALSE;
+ else
+ {
+ if (*ffname == NUL) /* re-edit with same file name */
+ {
+ ffname = curbuf->b_ffname;
+ sfname = curbuf->b_fname;
+ }
+ free_fname = fix_fname(ffname); /* may expand to full path name */
+ if (free_fname != NULL)
+ ffname = free_fname;
+ other_file = otherfile(ffname);
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop && p_acd
+ && (cp = vim_strrchr(sfname, '/')) != NULL)
+ sfname = ++cp;
+#endif
+ }
+ }
+
+ /*
+ * if the file was changed we may not be allowed to abandon it
+ * - if we are going to re-edit the same file
+ * - or if we are the only window on this file and if ECMD_HIDE is FALSE
+ */
+ if ( ((!other_file && !(flags & ECMD_OLDBUF))
+ || (curbuf->b_nwindows == 1
+ && !(flags & (ECMD_HIDE | ECMD_ADDBUF))))
+ && check_changed(curbuf, p_awa, !other_file,
+ (flags & ECMD_FORCEIT), FALSE))
+ {
+ if (fnum == 0 && other_file && ffname != NULL)
+ (void)setaltfname(ffname, sfname, newlnum < 0 ? 0 : newlnum);
+ goto theend;
+ }
+
+#ifdef FEAT_VISUAL
+ /*
+ * End Visual mode before switching to another buffer, so the text can be
+ * copied into the GUI selection buffer.
+ */
+ reset_VIsual();
+#endif
+
+ /*
+ * If we are starting to edit another file, open a (new) buffer.
+ * Otherwise we re-use the current buffer.
+ */
+ if (other_file)
+ {
+#ifdef FEAT_LISTCMDS
+ if (!(flags & ECMD_ADDBUF))
+#endif
+ {
+ curwin->w_alt_fnum = curbuf->b_fnum;
+ buflist_altfpos();
+ }
+
+ if (fnum)
+ buf = buflist_findnr(fnum);
+ else
+ {
+#ifdef FEAT_LISTCMDS
+ if (flags & ECMD_ADDBUF)
+ {
+ linenr_T tlnum = 1L;
+
+ if (command != NULL)
+ {
+ tlnum = atol((char *)command);
+ if (tlnum <= 0)
+ tlnum = 1L;
+ }
+ (void)buflist_new(ffname, sfname, tlnum, BLN_LISTED);
+ goto theend;
+ }
+#endif
+ buf = buflist_new(ffname, sfname, 0L,
+ BLN_CURBUF | ((flags & ECMD_SET_HELP) ? 0 : BLN_LISTED));
+ }
+ if (buf == NULL)
+ goto theend;
+ if (buf->b_ml.ml_mfp == NULL) /* no memfile yet */
+ {
+ oldbuf = FALSE;
+ buf->b_nwindows = 0;
+ }
+ else /* existing memfile */
+ {
+ oldbuf = TRUE;
+ (void)buf_check_timestamp(buf, FALSE);
+ /* Check if autocommands made buffer invalid or changed the current
+ * buffer. */
+ if (!buf_valid(buf)
+#ifdef FEAT_AUTOCMD
+ || curbuf != old_curbuf
+#endif
+ )
+ goto theend;
+#ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ goto theend;
+#endif
+ }
+
+ /* May jump to last used line number for a loaded buffer or when asked
+ * for explicitly */
+ if ((oldbuf && newlnum == ECMD_LASTL) || newlnum == ECMD_LAST)
+ {
+ pos = buflist_findfpos(buf);
+ newlnum = pos->lnum;
+ solcol = pos->col;
+ }
+
+ /*
+ * Make the (new) buffer the one used by the current window.
+ * If the old buffer becomes unused, free it if ECMD_HIDE is FALSE.
+ * If the current buffer was empty and has no file name, curbuf
+ * is returned by buflist_new().
+ */
+ if (buf != curbuf)
+ {
+#ifdef FEAT_AUTOCMD
+ /*
+ * Be careful: The autocommands may delete any buffer and change
+ * the current buffer.
+ * - If the buffer we are going to edit is deleted, give up.
+ * - If the current buffer is deleted, prefer to load the new
+ * buffer when loading a buffer is required. This avoids
+ * loading another buffer which then must be closed again.
+ * - If we ended up in the new buffer already, need to skip a few
+ * things, set auto_buf.
+ */
+ if (buf->b_fname != NULL)
+ new_name = vim_strsave(buf->b_fname);
+ au_new_curbuf = buf;
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+ if (!buf_valid(buf)) /* new buffer has been deleted */
+ {
+ delbuf_msg(new_name); /* frees new_name */
+ goto theend;
+ }
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ {
+ vim_free(new_name);
+ goto theend;
+ }
+# endif
+ if (buf == curbuf) /* already in new buffer */
+ auto_buf = TRUE;
+ else
+ {
+ if (curbuf == old_curbuf)
+#endif
+ buf_copy_options(buf, BCO_ENTER);
+
+ /* close the link to the current buffer */
+ close_buffer(curwin, curbuf,
+ (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
+
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ {
+ vim_free(new_name);
+ goto theend;
+ }
+# endif
+ /* Be careful again, like above. */
+ if (!buf_valid(buf)) /* new buffer has been deleted */
+ {
+ delbuf_msg(new_name); /* frees new_name */
+ goto theend;
+ }
+ if (buf == curbuf) /* already in new buffer */
+ auto_buf = TRUE;
+ else
+#endif
+ {
+ curwin->w_buffer = buf;
+ curbuf = buf;
+ ++curbuf->b_nwindows;
+ /* set 'fileformat' */
+ if (*p_ffs && !oldbuf)
+ set_fileformat(default_fileformat(), OPT_LOCAL);
+ }
+
+ /* May get the window options from the last time this buffer
+ * was in this window (or another window). If not used
+ * before, reset the local window options to the global
+ * values. Also restores old folding stuff. */
+ get_winopts(buf);
+
+#ifdef FEAT_AUTOCMD
+ }
+ vim_free(new_name);
+ au_new_curbuf = NULL;
+#endif
+ }
+ else
+ ++curbuf->b_nwindows;
+
+ curwin->w_pcmark.lnum = 1;
+ curwin->w_pcmark.col = 0;
+ }
+ else /* !other_file */
+ {
+ if (
+#ifdef FEAT_LISTCMDS
+ (flags & ECMD_ADDBUF) ||
+#endif
+ check_fname() == FAIL)
+ goto theend;
+ oldbuf = (flags & ECMD_OLDBUF);
+ }
+
+ if ((flags & ECMD_SET_HELP) || keep_help_flag)
+ {
+ char_u *p;
+
+ curbuf->b_help = TRUE;
+#ifdef FEAT_QUICKFIX
+ set_string_option_direct((char_u *)"buftype", -1,
+ (char_u *)"help", OPT_FREE|OPT_LOCAL);
+#endif
+
+ /*
+ * Always set these options after jumping to a help tag, because the
+ * user may have an autocommand that gets in the way.
+ * Accept all ASCII chars for keywords, except ' ', '*', '"', '|', and
+ * latin1 word characters (for translated help files).
+ * Only set it when needed, buf_init_chartab() is some work.
+ */
+ p =
+#ifdef EBCDIC
+ (char_u *)"65-255,^*,^|,^\"";
+#else
+ (char_u *)"!-~,^*,^|,^\",192-255";
+#endif
+ if (STRCMP(curbuf->b_p_isk, p) != 0)
+ {
+ set_string_option_direct((char_u *)"isk", -1, p,
+ OPT_FREE|OPT_LOCAL);
+ check_buf_options(curbuf);
+ (void)buf_init_chartab(curbuf, FALSE);
+ }
+
+ curbuf->b_p_ts = 8; /* 'tabstop' is 8 */
+ curwin->w_p_list = FALSE; /* no list mode */
+
+ curbuf->b_p_ma = FALSE; /* not modifiable */
+ curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */
+ curwin->w_p_nu = 0; /* no line numbers */
+#ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE; /* no scroll binding */
+#endif
+#ifdef FEAT_ARABIC
+ curwin->w_p_arab = FALSE; /* no arabic mode */
+#endif
+#ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl = FALSE; /* help window is left-to-right */
+#endif
+#ifdef FEAT_FOLDING
+ curwin->w_p_fen = FALSE; /* No folding in the help window */
+#endif
+#ifdef FEAT_DIFF
+ curwin->w_p_diff = FALSE; /* No 'diff' */
+#endif
+
+#ifdef FEAT_AUTOCMD
+ buf = curbuf;
+#endif
+ set_buflisted(FALSE);
+ }
+ else
+ {
+#ifdef FEAT_AUTOCMD
+ buf = curbuf;
+#endif
+ /* Don't make a buffer listed if it's a help buffer. Useful when
+ * using CTRL-O to go back to a help file. */
+ if (!curbuf->b_help)
+ set_buflisted(TRUE);
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* If autocommands change buffers under our fingers, forget about
+ * editing the file. */
+ if (buf != curbuf)
+ goto theend;
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ goto theend;
+# endif
+
+ /* Since we are starting to edit a file, consider the filetype to be
+ * unset. Helps for when an autocommand changes files and expects syntax
+ * highlighting to work in the other file. */
+ did_filetype = FALSE;
+#endif
+
+/*
+ * other_file oldbuf
+ * FALSE FALSE re-edit same file, buffer is re-used
+ * FALSE TRUE re-edit same file, nothing changes
+ * TRUE FALSE start editing new file, new buffer
+ * TRUE TRUE start editing in existing buffer (nothing to do)
+ */
+ if (!other_file && !oldbuf) /* re-use the buffer */
+ {
+ set_last_cursor(curwin); /* may set b_last_cursor */
+ if (newlnum == ECMD_LAST || newlnum == ECMD_LASTL)
+ {
+ newlnum = curwin->w_cursor.lnum;
+ solcol = curwin->w_cursor.col;
+ }
+#ifdef FEAT_AUTOCMD
+ buf = curbuf;
+ if (buf->b_fname != NULL)
+ new_name = vim_strsave(buf->b_fname);
+ else
+ new_name = NULL;
+#endif
+ buf_freeall(curbuf, FALSE, FALSE); /* free all things for buffer */
+#ifdef FEAT_AUTOCMD
+ /* If autocommands deleted the buffer we were going to re-edit, give
+ * up and jump to the end. */
+ if (!buf_valid(buf))
+ {
+ delbuf_msg(new_name); /* frees new_name */
+ goto theend;
+ }
+ vim_free(new_name);
+
+ /* If autocommands change buffers under our fingers, forget about
+ * re-editing the file. Should do the buf_clear_file(), but perhaps
+ * the autocommands changed the buffer... */
+ if (buf != curbuf)
+ goto theend;
+# ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ goto theend;
+# endif
+#endif
+ buf_clear_file(curbuf);
+ curbuf->b_op_start.lnum = 0; /* clear '[ and '] marks */
+ curbuf->b_op_end.lnum = 0;
+ }
+
+/*
+ * If we get here we are sure to start editing
+ */
+ /* don't redraw until the cursor is in the right line */
+ ++RedrawingDisabled;
+
+ /* Assume success now */
+ retval = OK;
+
+ /*
+ * Reset cursor position, could be used by autocommands.
+ */
+ check_cursor();
+
+ /*
+ * Check if we are editing the w_arg_idx file in the argument list.
+ */
+ check_arg_idx(curwin);
+
+#ifdef FEAT_AUTOCMD
+ if (!auto_buf)
+#endif
+ {
+ /*
+ * Set cursor and init window before reading the file and executing
+ * autocommands. This allows for the autocommands to position the
+ * cursor.
+ */
+ win_init(curwin);
+
+#ifdef FEAT_FOLDING
+ /* It's like all lines in the buffer changed. Need to update
+ * automatic folding. */
+ foldUpdateAll(curwin);
+#endif
+
+#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+#endif
+ /*
+ * Careful: open_buffer() and apply_autocmds() may change the current
+ * buffer and window.
+ */
+ lnum = curwin->w_cursor.lnum;
+ topline = curwin->w_topline;
+ if (!oldbuf) /* need to read the file */
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ swap_exists_action = SEA_DIALOG;
+#endif
+ curbuf->b_flags |= BF_CHECK_RO; /* set/reset 'ro' flag */
+
+ /*
+ * Open the buffer and read the file.
+ */
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (should_abort(open_buffer(FALSE, eap)))
+ retval = FAIL;
+#else
+ (void)open_buffer(FALSE, eap);
+#endif
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (swap_exists_action == SEA_QUIT)
+ retval = FAIL;
+ handle_swap_exists(old_curbuf);
+#endif
+ }
+#ifdef FEAT_AUTOCMD
+ else
+ {
+ apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf,
+ &retval);
+ apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf,
+ &retval);
+ }
+ check_arg_idx(curwin);
+#endif
+
+ /*
+ * If autocommands change the cursor position or topline, we should
+ * keep it.
+ */
+ if (curwin->w_cursor.lnum != lnum)
+ {
+ newlnum = curwin->w_cursor.lnum;
+ newcol = curwin->w_cursor.col;
+ }
+ if (curwin->w_topline == topline)
+ topline = 0;
+
+ /* Even when cursor didn't move we need to recompute topline. */
+ changed_line_abv_curs();
+
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+ }
+
+#ifdef FEAT_DIFF
+ /* Tell the diff stuff that this buffer is new and/or needs updating.
+ * Also needed when re-editing the same buffer, because unloading will
+ * have removed it as a diff buffer. */
+ diff_new_buffer();
+ diff_invalidate();
+#endif
+
+ if (command == NULL)
+ {
+ if (newcol >= 0) /* position set by autocommands */
+ {
+ curwin->w_cursor.lnum = newlnum;
+ curwin->w_cursor.col = newcol;
+ check_cursor();
+ }
+ else if (newlnum > 0) /* line number from caller or old position */
+ {
+ curwin->w_cursor.lnum = newlnum;
+ check_cursor_lnum();
+ if (solcol >= 0 && !p_sol)
+ {
+ /* 'sol' is off: Use last known column. */
+ curwin->w_cursor.col = solcol;
+ check_cursor_col();
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+ }
+ else
+ beginline(BL_SOL | BL_FIX);
+ }
+ else /* no line number, go to last line in Ex mode */
+ {
+ if (exmode_active)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ beginline(BL_WHITE | BL_FIX);
+ }
+ }
+
+#ifdef FEAT_WINDOWS
+ /* Check if cursors in other windows on the same buffer are still valid */
+ check_lnums(FALSE);
+#endif
+
+ /*
+ * Did not read the file, need to show some info about the file.
+ * Do this after setting the cursor.
+ */
+ if (oldbuf
+#ifdef FEAT_AUTOCMD
+ && !auto_buf
+#endif
+ )
+ {
+ int msg_scroll_save = msg_scroll;
+
+ /* Obey the 'O' flag in 'cpoptions': overwrite any previous file
+ * message. */
+ if (shortmess(SHM_OVERALL) && !exiting && p_verbose == 0)
+ msg_scroll = FALSE;
+ if (!msg_scroll) /* wait a bit when overwriting an error msg */
+ check_for_delay(FALSE);
+ msg_start();
+ msg_scroll = msg_scroll_save;
+ msg_scrolled_ign = TRUE;
+
+ fileinfo(FALSE, TRUE, FALSE);
+
+ msg_scrolled_ign = FALSE;
+ }
+
+ if (command != NULL)
+ do_cmdline(command, NULL, NULL, DOCMD_VERBOSE);
+
+#ifdef FEAT_KEYMAP
+ if (curbuf->b_kmap_state & KEYMAP_INIT)
+ keymap_init();
+#endif
+
+ --RedrawingDisabled;
+ if (!skip_redraw)
+ {
+ n = p_so;
+ if (topline == 0 && command == NULL)
+ p_so = 999; /* force cursor halfway the window */
+ update_topline();
+#ifdef FEAT_SCROLLBIND
+ curwin->w_scbind_pos = curwin->w_topline;
+#endif
+ p_so = n;
+ redraw_curbuf_later(NOT_VALID); /* redraw this buffer later */
+ }
+
+ if (p_im)
+ need_start_insertmode = TRUE;
+
+#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
+ /* Change directories when the acd option is set on. */
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+
+ if (gui.in_use && curbuf->b_ffname != NULL)
+ {
+# ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ workshop_file_opened((char *)curbuf->b_ffname, curbuf->b_p_ro);
+# endif
+# ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_file_opened((char *)curbuf->b_ffname);
+# endif
+ }
+#endif
+
+theend:
+#ifdef FEAT_BROWSE
+ vim_free(browse_file);
+#endif
+ vim_free(free_fname);
+ return retval;
+}
+
+#ifdef FEAT_AUTOCMD
+ static void
+delbuf_msg(name)
+ char_u *name;
+{
+ EMSG2(_("E143: Autocommands unexpectedly deleted new buffer %s"),
+ name == NULL ? (char_u *)"" : name);
+ vim_free(name);
+ au_new_curbuf = NULL;
+}
+#endif
+
+/*
+ * ":insert" and ":append", also used by ":change"
+ */
+ void
+ex_append(eap)
+ exarg_T *eap;
+{
+ char_u *theline;
+ int did_undo = FALSE;
+ linenr_T lnum = eap->line2;
+
+ if (eap->cmdidx != CMD_append)
+ --lnum;
+
+ State = INSERT; /* behave like in Insert mode */
+ if (curbuf->b_p_iminsert == B_IMODE_LMAP)
+ State |= LANGMAP;
+ while (1)
+ {
+ msg_scroll = TRUE;
+ need_wait_return = FALSE;
+ if (eap->getline == NULL)
+ theline = getcmdline(
+#ifdef FEAT_EVAL
+ eap->cstack->cs_whilelevel > 0 ? -1 :
+#endif
+ NUL, 0L, 0);
+ else
+ theline = eap->getline(
+#ifdef FEAT_EVAL
+ eap->cstack->cs_whilelevel > 0 ? -1 :
+#endif
+ NUL, eap->cookie, 0);
+ lines_left = Rows - 1;
+ if (theline == NULL || (theline[0] == '.' && theline[1] == NUL)
+ || (!did_undo && u_save(lnum, lnum + 1) == FAIL))
+ {
+ vim_free(theline);
+ break;
+ }
+
+ did_undo = TRUE;
+ ml_append(lnum, theline, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+
+ vim_free(theline);
+ ++lnum;
+ msg_didout = TRUE; /* also scroll for empty line */
+ }
+ State = NORMAL;
+
+ /* "start" is set to eap->line2+1 unless that position is invalid (when
+ * eap->line2 pointed to the end of the buffer and nothig was appended)
+ * "end" is set to lnum when something has been appended, otherwise
+ * it is the same than "start" -- Acevedo */
+ curbuf->b_op_start.lnum = (eap->line2 < curbuf->b_ml.ml_line_count) ?
+ eap->line2 + 1 : curbuf->b_ml.ml_line_count;
+ if (eap->cmdidx != CMD_append)
+ --curbuf->b_op_start.lnum;
+ curbuf->b_op_end.lnum = (eap->line2 < lnum)
+ ? lnum : curbuf->b_op_start.lnum;
+ curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
+ curwin->w_cursor.lnum = lnum;
+ check_cursor_lnum();
+ beginline(BL_SOL | BL_FIX);
+
+ need_wait_return = FALSE; /* don't use wait_return() now */
+ ex_no_reprint = TRUE;
+}
+
+/*
+ * ":change"
+ */
+ void
+ex_change(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+
+ if (eap->line2 >= eap->line1
+ && u_save(eap->line1 - 1, eap->line2 + 1) == FAIL)
+ return;
+
+ for (lnum = eap->line2; lnum >= eap->line1; --lnum)
+ {
+ if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */
+ break;
+ ml_delete(eap->line1, FALSE);
+ }
+ deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum));
+
+ /* ":append" on the line above the deleted lines. */
+ eap->line2 = eap->line1;
+ ex_append(eap);
+}
+
+ void
+ex_z(eap)
+ exarg_T *eap;
+{
+ char_u *x;
+ int bigness = curwin->w_height - 3;
+ char_u kind;
+ int numbered = FALSE;
+ int minus = 0;
+ linenr_T start, end, curs, i;
+ int j;
+ linenr_T lnum = eap->line2;
+
+ if (bigness < 1)
+ bigness = 1;
+
+ x = eap->arg;
+ if (*x == '#')
+ {
+ numbered = TRUE;
+ ++x;
+ }
+
+ kind = *x;
+ if (kind == '-' || kind == '+' || kind == '=' || kind == '^' || kind == '.')
+ ++x;
+
+ if (*x != 0)
+ {
+ if (!VIM_ISDIGIT(*x))
+ {
+ EMSG(_("E144: non-numeric argument to :z"));
+ return;
+ }
+ else
+ bigness = atoi((char *)x);
+ }
+
+ switch (kind)
+ {
+ case '-':
+ start = lnum - bigness;
+ end = lnum;
+ curs = lnum;
+ break;
+
+ case '=':
+ start = lnum - bigness / 2 + 1;
+ end = lnum + bigness / 2 - 1;
+ curs = lnum;
+ minus = 1;
+ break;
+
+ case '^':
+ start = lnum - bigness * 2;
+ end = lnum - bigness;
+ curs = lnum - bigness;
+ break;
+
+ case '.':
+ start = lnum - bigness / 2;
+ end = lnum + bigness / 2;
+ curs = end;
+ break;
+
+ default: /* '+' */
+ start = lnum;
+ end = lnum + bigness;
+ curs = end;
+ break;
+ }
+
+ if (start < 1)
+ start = 1;
+
+ if (end > curbuf->b_ml.ml_line_count)
+ end = curbuf->b_ml.ml_line_count;
+
+ if (curs > curbuf->b_ml.ml_line_count)
+ curs = curbuf->b_ml.ml_line_count;
+
+ for (i = start; i <= end; i++)
+ {
+ if (minus && i == lnum)
+ {
+ msg_putchar('\n');
+
+ for (j = 1; j < Columns; j++)
+ msg_putchar('-');
+ }
+
+ print_line(i, numbered);
+
+ if (minus && i == lnum)
+ {
+ msg_putchar('\n');
+
+ for (j = 1; j < Columns; j++)
+ msg_putchar('-');
+ }
+ }
+
+ curwin->w_cursor.lnum = curs;
+ ex_no_reprint = TRUE;
+}
+
+/*
+ * Check if the restricted flag is set.
+ * If so, give an error message and return TRUE.
+ * Otherwise, return FALSE.
+ */
+ int
+check_restricted()
+{
+ if (restricted)
+ {
+ EMSG(_("E145: Shell commands not allowed in rvim"));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Check if the secure flag is set (.exrc or .vimrc in current directory).
+ * If so, give an error message and return TRUE.
+ * Otherwise, return FALSE.
+ */
+ int
+check_secure()
+{
+ if (secure)
+ {
+ secure = 2;
+ EMSG(_(e_curdir));
+ return TRUE;
+ }
+#ifdef HAVE_SANDBOX
+ /*
+ * In the sandbox more things are not allowed, including the things
+ * disallowed in secure mode.
+ */
+ if (sandbox != 0)
+ {
+ EMSG(_(e_sandbox));
+ return TRUE;
+ }
+#endif
+ return FALSE;
+}
+
+static char_u *old_sub = NULL; /* previous substitute pattern */
+static int global_need_beginline; /* call beginline() after ":g" */
+
+/*
+ * When ":global" is used to number of substitutions and changed lines is
+ * accumulated until it's finished.
+ */
+static long sub_nsubs; /* total number of substitutions */
+static linenr_T sub_nlines; /* total number of lines changed */
+
+/* do_sub()
+ *
+ * Perform a substitution from line eap->line1 to line eap->line2 using the
+ * command pointed to by eap->arg which should be of the form:
+ *
+ * /pattern/substitution/{flags}
+ *
+ * The usual escapes are supported as described in the regexp docs.
+ */
+ void
+do_sub(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+ long i = 0;
+ regmmatch_T regmatch;
+ static int do_all = FALSE; /* do multiple substitutions per line */
+ static int do_ask = FALSE; /* ask for confirmation */
+ static int do_error = TRUE; /* if false, ignore errors */
+ static int do_print = FALSE; /* print last line with subs. */
+ static int do_ic = 0; /* ignore case flag */
+ char_u *pat = NULL, *sub = NULL; /* init for GCC */
+ int delimiter;
+ int sublen;
+ int got_quit = FALSE;
+ int got_match = FALSE;
+ int temp;
+ int which_pat;
+ char_u *cmd;
+ int save_State;
+ linenr_T first_line = 0; /* first changed line */
+ linenr_T last_line= 0; /* below last changed line AFTER the
+ * change */
+ linenr_T old_line_count = curbuf->b_ml.ml_line_count;
+ linenr_T line2;
+ long nmatch; /* number of lines in match */
+ linenr_T sub_firstlnum; /* nr of first sub line */
+ char_u *sub_firstline; /* allocated copy of first sub line */
+
+ cmd = eap->arg;
+ if (!global_busy)
+ {
+ sub_nsubs = 0;
+ sub_nlines = 0;
+ }
+
+#ifdef FEAT_FKMAP /* reverse the flow of the Farsi characters */
+ if (p_altkeymap && curwin->w_p_rl)
+ lrF_sub(cmd);
+#endif
+
+ if (eap->cmdidx == CMD_tilde)
+ which_pat = RE_LAST; /* use last used regexp */
+ else
+ which_pat = RE_SUBST; /* use last substitute regexp */
+
+ /* new pattern and substitution */
+ if (eap->cmd[0] == 's' && *cmd != NUL && !vim_iswhite(*cmd)
+ && vim_strchr((char_u *)"0123456789cegriIp|\"", *cmd) == NULL)
+ {
+ /* don't accept alphanumeric for separator */
+ if (isalpha(*cmd))
+ {
+ EMSG(_("E146: Regular expressions can't be delimited by letters"));
+ return;
+ }
+ /*
+ * undocumented vi feature:
+ * "\/sub/" and "\?sub?" use last used search pattern (almost like
+ * //sub/r). "\&sub&" use last substitute pattern (like //sub/).
+ */
+ if (*cmd == '\\')
+ {
+ ++cmd;
+ if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
+ {
+ EMSG(_(e_backslash));
+ return;
+ }
+ if (*cmd != '&')
+ which_pat = RE_SEARCH; /* use last '/' pattern */
+ pat = (char_u *)""; /* empty search pattern */
+ delimiter = *cmd++; /* remember delimiter character */
+ }
+ else /* find the end of the regexp */
+ {
+ which_pat = RE_LAST; /* use last used regexp */
+ delimiter = *cmd++; /* remember delimiter character */
+ pat = cmd; /* remember start of search pat */
+ cmd = skip_regexp(cmd, delimiter, p_magic, &eap->arg);
+ if (cmd[0] == delimiter) /* end delimiter found */
+ *cmd++ = NUL; /* replace it with a NUL */
+ }
+
+ /*
+ * Small incompatibility: vi sees '\n' as end of the command, but in
+ * Vim we want to use '\n' to find/substitute a NUL.
+ */
+ sub = cmd; /* remember the start of the substitution */
+
+ while (cmd[0])
+ {
+ if (cmd[0] == delimiter) /* end delimiter found */
+ {
+ *cmd++ = NUL; /* replace it with a NUL */
+ break;
+ }
+ if (cmd[0] == '\\' && cmd[1] != 0) /* skip escaped characters */
+ ++cmd;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ cmd += (*mb_ptr2len_check)(cmd);
+ else
+#endif
+ ++cmd;
+ }
+
+ if (!eap->skip)
+ {
+ vim_free(old_sub);
+ old_sub = vim_strsave(sub);
+ }
+ }
+ else if (!eap->skip) /* use previous pattern and substitution */
+ {
+ if (old_sub == NULL) /* there is no previous command */
+ {
+ EMSG(_(e_nopresub));
+ return;
+ }
+ pat = NULL; /* search_regcomp() will use previous pattern */
+ sub = old_sub;
+ }
+
+ /*
+ * Find trailing options. When '&' is used, keep old options.
+ */
+ if (*cmd == '&')
+ ++cmd;
+ else
+ {
+ if (!p_ed)
+ {
+ if (p_gd) /* default is global on */
+ do_all = TRUE;
+ else
+ do_all = FALSE;
+ do_ask = FALSE;
+ }
+ do_error = TRUE;
+ do_print = FALSE;
+ do_ic = 0;
+ }
+ while (*cmd)
+ {
+ /*
+ * Note that 'g' and 'c' are always inverted, also when p_ed is off.
+ * 'r' is never inverted.
+ */
+ if (*cmd == 'g')
+ do_all = !do_all;
+ else if (*cmd == 'c')
+ do_ask = !do_ask;
+ else if (*cmd == 'e')
+ do_error = !do_error;
+ else if (*cmd == 'r') /* use last used regexp */
+ which_pat = RE_LAST;
+ else if (*cmd == 'p')
+ do_print = TRUE;
+ else if (*cmd == 'i') /* ignore case */
+ do_ic = 'i';
+ else if (*cmd == 'I') /* don't ignore case */
+ do_ic = 'I';
+ else
+ break;
+ ++cmd;
+ }
+
+ /*
+ * check for a trailing count
+ */
+ cmd = skipwhite(cmd);
+ if (VIM_ISDIGIT(*cmd))
+ {
+ i = getdigits(&cmd);
+ if (i <= 0 && !eap->skip && do_error)
+ {
+ EMSG(_(e_zerocount));
+ return;
+ }
+ eap->line1 = eap->line2;
+ eap->line2 += i - 1;
+ if (eap->line2 > curbuf->b_ml.ml_line_count)
+ eap->line2 = curbuf->b_ml.ml_line_count;
+ }
+
+ /*
+ * check for trailing command or garbage
+ */
+ cmd = skipwhite(cmd);
+ if (*cmd && *cmd != '"') /* if not end-of-line or comment */
+ {
+ eap->nextcmd = check_nextcmd(cmd);
+ if (eap->nextcmd == NULL)
+ {
+ EMSG(_(e_trailing));
+ return;
+ }
+ }
+
+ if (eap->skip) /* not executing commands, only parsing */
+ return;
+
+ if (search_regcomp(pat, RE_SUBST, which_pat, SEARCH_HIS, &regmatch) == FAIL)
+ {
+ if (do_error)
+ EMSG(_(e_invcmd));
+ return;
+ }
+
+ /* the 'i' or 'I' flag overrules 'ignorecase' and 'smartcase' */
+ if (do_ic == 'i')
+ regmatch.rmm_ic = TRUE;
+ else if (do_ic == 'I')
+ regmatch.rmm_ic = FALSE;
+
+ sub_firstline = NULL;
+
+ /*
+ * ~ in the substitute pattern is replaced with the old pattern.
+ * We do it here once to avoid it to be replaced over and over again.
+ * But don't do it when it starts with "\=", then it's an expression.
+ */
+ if (!(sub[0] == '\\' && sub[1] == '='))
+ sub = regtilde(sub, p_magic);
+
+ /*
+ * Check for a match on each line.
+ */
+ line2 = eap->line2;
+ for (lnum = eap->line1; lnum <= line2 && !(got_quit
+#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD)
+ || aborting()
+#endif
+ ); ++lnum)
+ {
+ sub_firstlnum = lnum;
+ nmatch = vim_regexec_multi(&regmatch, curwin, curbuf, lnum, (colnr_T)0);
+ if (nmatch)
+ {
+ colnr_T copycol;
+ colnr_T matchcol;
+ colnr_T prev_matchcol = MAXCOL;
+ char_u *new_end, *new_start = NULL;
+ unsigned new_start_len = 0;
+ char_u *p1;
+ int did_sub = FALSE;
+ int lastone;
+ unsigned len, needed_len;
+ long nmatch_tl = 0; /* nr of lines matched below lnum */
+ int do_again; /* do it again after joining lines */
+
+ /*
+ * The new text is build up step by step, to avoid too much
+ * copying. There are these pieces:
+ * sub_firstline The old text, unmodifed.
+ * copycol Column in the old text where we started
+ * looking for a match; from here old text still
+ * needs to be copied to the new text.
+ * matchcol Column number of the old text where to look
+ * for the next match. It's just after the
+ * previous match or one further.
+ * prev_matchcol Column just after the previous match (if any).
+ * Mostly equal to matchcol, except for the first
+ * match and after skipping an empty match.
+ * regmatch.*pos Where the pattern matched in the old text.
+ * new_start The new text, all that has been produced so
+ * far.
+ * new_end The new text, where to append new text.
+ *
+ * lnum The line number where we were looking for the
+ * first match in the old line.
+ * sub_firstlnum The line number in the buffer where to look
+ * for a match. Can be different from "lnum"
+ * when the pattern or substitute string contains
+ * line breaks.
+ *
+ * Special situations:
+ * - When the substitute string contains a line break, the part up
+ * to the line break is inserted in the text, but the copy of
+ * the original line is kept. "sub_firstlnum" is adjusted for
+ * the inserted lines.
+ * - When the matched pattern contains a line break, the old line
+ * is taken from the line at the end of the pattern. The lines
+ * in the match are deleted later, "sub_firstlnum" is adjusted
+ * accordingly.
+ *
+ * The new text is built up in new_start[]. It has some extra
+ * room to avoid using alloc()/free() too often. new_start_len is
+ * the lenght of the allocated memory at new_start.
+ *
+ * Make a copy of the old line, so it won't be taken away when
+ * updating the screen or handling a multi-line match. The "old_"
+ * pointers point into this copy.
+ */
+ sub_firstline = vim_strsave(ml_get(sub_firstlnum));
+ if (sub_firstline == NULL)
+ {
+ vim_free(new_start);
+ goto outofmem;
+ }
+ copycol = 0;
+ matchcol = 0;
+
+ /* At first match, remember current cursor position. */
+ if (!got_match)
+ {
+ setpcmark();
+ got_match = TRUE;
+ }
+
+ /*
+ * Loop until nothing more to replace in this line.
+ * 1. Handle match with empty string.
+ * 2. If do_ask is set, ask for confirmation.
+ * 3. substitute the string.
+ * 4. if do_all is set, find next match
+ * 5. break if there isn't another match in this line
+ */
+ for (;;)
+ {
+ /* Save the line number of the last change for the final
+ * cursor position (just like Vi). */
+ curwin->w_cursor.lnum = lnum;
+ do_again = FALSE;
+
+ /*
+ * 1. Match empty string does not count, except for first
+ * match. This reproduces the strange vi behaviour.
+ * This also catches endless loops.
+ */
+ if (matchcol == prev_matchcol
+ && regmatch.endpos[0].lnum == 0
+ && matchcol == regmatch.endpos[0].col)
+ {
+ ++matchcol; /* search for a match at next column */
+ goto skip;
+ }
+
+ /* Normally we continue searching for a match just after the
+ * previous match. */
+ matchcol = regmatch.endpos[0].col;
+ prev_matchcol = matchcol;
+
+ /*
+ * 2. If do_ask is set, ask for confirmation.
+ */
+ if (do_ask)
+ {
+ /* change State to CONFIRM, so that the mouse works
+ * properly */
+ save_State = State;
+ State = CONFIRM;
+#ifdef FEAT_MOUSE
+ setmouse(); /* disable mouse in xterm */
+#endif
+ curwin->w_cursor.col = regmatch.startpos[0].col;
+
+ /* When 'cpoptions' contains "u" don't sync undo when
+ * asking for confirmation. */
+ if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
+ ++no_u_sync;
+
+ /*
+ * Loop until 'y', 'n', 'q', CTRL-E or CTRL-Y typed.
+ */
+ while (do_ask)
+ {
+#ifdef FEAT_FOLDING
+ int save_p_fen = curwin->w_p_fen;
+
+ curwin->w_p_fen = FALSE;
+#endif
+ /* Invert the matched string.
+ * Remove the inversion afterwards. */
+ temp = RedrawingDisabled;
+ RedrawingDisabled = 0;
+
+ search_match_lines = regmatch.endpos[0].lnum;
+ search_match_endcol = regmatch.endpos[0].col;
+ highlight_match = TRUE;
+
+ update_topline();
+ validate_cursor();
+ update_screen(NOT_VALID);
+ highlight_match = FALSE;
+ redraw_later(NOT_VALID);
+
+#ifdef FEAT_FOLDING
+ curwin->w_p_fen = save_p_fen;
+#endif
+ if (msg_row == Rows - 1)
+ msg_didout = FALSE; /* avoid a scroll-up */
+ msg_starthere();
+ i = msg_scroll;
+ msg_scroll = 0; /* truncate msg when needed */
+ msg_no_more = TRUE;
+ /* write message same highlighting as for wait_return */
+ smsg_attr(hl_attr(HLF_R),
+ (char_u *)_("replace with %s (y/n/a/q/l/^E/^Y)?"),
+ sub);
+ msg_no_more = FALSE;
+ msg_scroll = i;
+ showruler(TRUE);
+ windgoto(msg_row, msg_col);
+ RedrawingDisabled = temp;
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = FALSE; /* allow scrolling here */
+#endif
+ ++no_mapping; /* don't map this key */
+ ++allow_keys; /* allow special keys */
+ i = safe_vgetc();
+ --allow_keys;
+ --no_mapping;
+
+ /* clear the question */
+ msg_didout = FALSE; /* don't scroll up */
+ msg_col = 0;
+ gotocmdline(TRUE);
+ need_wait_return = FALSE; /* no hit-return prompt */
+ if (i == 'q' || i == ESC || i == Ctrl_C
+#ifdef UNIX
+ || i == intr_char
+#endif
+ )
+ {
+ got_quit = TRUE;
+ break;
+ }
+ if (i == 'n')
+ break;
+ if (i == 'y')
+ break;
+ if (i == 'l')
+ {
+ /* last: replace and then stop */
+ do_all = FALSE;
+ line2 = lnum;
+ break;
+ }
+ if (i == 'a')
+ {
+ do_ask = FALSE;
+ break;
+ }
+#ifdef FEAT_INS_EXPAND
+ if (i == Ctrl_E)
+ scrollup_clamp();
+ else if (i == Ctrl_Y)
+ scrolldown_clamp();
+#endif
+ }
+ State = save_State;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
+ --no_u_sync;
+
+ if (i == 'n')
+ {
+ /* For a multi-line match, put matchcol at the NUL at
+ * the end of the line and set nmatch to one, so that
+ * we continue looking for a match on the next line.
+ * Avoids that ":s/\nB\@=//gc" get stuck. */
+ if (nmatch > 1)
+ {
+ matchcol = STRLEN(sub_firstline);
+ nmatch = 1;
+ }
+ goto skip;
+ }
+ if (got_quit)
+ break;
+ }
+
+ /* Move the cursor to the start of the match, so that we can
+ * use "\=col("."). */
+ curwin->w_cursor.col = regmatch.startpos[0].col;
+
+ /*
+ * 3. substitute the string.
+ */
+ /* get length of substitution part */
+ sublen = vim_regsub_multi(&regmatch, sub_firstlnum,
+ sub, sub_firstline, FALSE, p_magic, TRUE);
+
+ /* Need room for:
+ * - result so far in new_start (not for first sub in line)
+ * - original text up to match
+ * - length of substituted part
+ * - original text after match
+ */
+ if (nmatch == 1)
+ p1 = sub_firstline;
+ else
+ {
+ p1 = ml_get(sub_firstlnum + nmatch - 1);
+ nmatch_tl += nmatch - 1;
+ }
+ i = regmatch.startpos[0].col - copycol;
+ needed_len = i + ((unsigned)STRLEN(p1) - regmatch.endpos[0].col)
+ + sublen + 1;
+ if (new_start == NULL)
+ {
+ /*
+ * Get some space for a temporary buffer to do the
+ * substitution into (and some extra space to avoid
+ * too many calls to alloc()/free()).
+ */
+ new_start_len = needed_len + 50;
+ if ((new_start = alloc_check(new_start_len)) == NULL)
+ goto outofmem;
+ *new_start = NUL;
+ new_end = new_start;
+ }
+ else
+ {
+ /*
+ * Check if the temporary buffer is long enough to do the
+ * substitution into. If not, make it larger (with a bit
+ * extra to avoid too many calls to alloc()/free()).
+ */
+ len = (unsigned)STRLEN(new_start);
+ needed_len += len;
+ if (needed_len > new_start_len)
+ {
+ new_start_len = needed_len + 50;
+ if ((p1 = alloc_check(new_start_len)) == NULL)
+ {
+ vim_free(new_start);
+ goto outofmem;
+ }
+ mch_memmove(p1, new_start, (size_t)(len + 1));
+ vim_free(new_start);
+ new_start = p1;
+ }
+ new_end = new_start + len;
+ }
+
+ /*
+ * copy the text up to the part that matched
+ */
+ mch_memmove(new_end, sub_firstline + copycol, (size_t)i);
+ new_end += i;
+
+ (void)vim_regsub_multi(&regmatch, sub_firstlnum,
+ sub, new_end, TRUE, p_magic, TRUE);
+ sub_nsubs++;
+ did_sub = TRUE;
+
+ /* Move the cursor to the start of the line, to avoid that it
+ * is beyond the end of the line after the substitution. */
+ curwin->w_cursor.col = 0;
+
+ /* For a multi-line match, make a copy of the last matched
+ * line and continue in that one. */
+ if (nmatch > 1)
+ {
+ sub_firstlnum += nmatch - 1;
+ vim_free(sub_firstline);
+ sub_firstline = vim_strsave(ml_get(sub_firstlnum));
+ /* When going beyond the last line, stop substituting. */
+ if (sub_firstlnum <= line2)
+ do_again = TRUE;
+ else
+ do_all = FALSE;
+ }
+
+ /* Remember next character to be copied. */
+ copycol = regmatch.endpos[0].col;
+
+ /*
+ * Now the trick is to replace CTRL-M chars with a real line
+ * break. This would make it impossible to insert a CTRL-M in
+ * the text. The line break can be avoided by preceding the
+ * CTRL-M with a backslash. To be able to insert a backslash,
+ * they must be doubled in the string and are halved here.
+ * That is Vi compatible.
+ */
+ for (p1 = new_end; *p1; ++p1)
+ {
+ if (p1[0] == '\\' && p1[1] != NUL) /* remove backslash */
+ mch_memmove(p1, p1 + 1, STRLEN(p1));
+ else if (*p1 == CAR)
+ {
+ if (u_inssub(lnum) == OK) /* prepare for undo */
+ {
+ *p1 = NUL; /* truncate up to the CR */
+ ml_append(lnum - 1, new_start,
+ (colnr_T)(p1 - new_start + 1), FALSE);
+ mark_adjust(lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
+ if (do_ask)
+ appended_lines(lnum - 1, 1L);
+ else
+ {
+ if (first_line == 0)
+ first_line = lnum;
+ last_line = lnum + 1;
+ }
+ /* All line numbers increase. */
+ ++sub_firstlnum;
+ ++lnum;
+ ++line2;
+ /* move the cursor to the new line, like Vi */
+ ++curwin->w_cursor.lnum;
+ STRCPY(new_start, p1 + 1); /* copy the rest */
+ p1 = new_start - 1;
+ }
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ p1 += (*mb_ptr2len_check)(p1) - 1;
+#endif
+ }
+
+ /*
+ * 4. If do_all is set, find next match.
+ * Prevent endless loop with patterns that match empty
+ * strings, e.g. :s/$/pat/g or :s/[a-z]* /(&)/g.
+ * But ":s/\n/#/" is OK.
+ */
+skip:
+ /* We already know that we did the last subst when we are at
+ * the end of the line, except that a pattern like
+ * "bar\|\nfoo" may match at the NUL. */
+ lastone = ((sub_firstline[matchcol] == NUL && nmatch <= 1
+ && !re_multiline(regmatch.regprog))
+ || got_int || got_quit || !(do_all || do_again));
+ nmatch = -1;
+
+ /*
+ * Replace the line in the buffer when needed. This is
+ * skipped when there are more matches.
+ * The check for nmatch_tl is needed for when multi-line
+ * matching must replace the lines before trying to do another
+ * match, otherwise "\@<=" won't work.
+ * When asking the user we like to show the already replaced
+ * text, but don't do it when "\<@=" or "\<@!" is used, it
+ * changes what matches.
+ */
+ if (lastone
+ || (do_ask && !re_lookbehind(regmatch.regprog))
+ || nmatch_tl > 0
+ || (nmatch = vim_regexec_multi(&regmatch, curwin,
+ curbuf, sub_firstlnum, matchcol)) == 0)
+ {
+ if (new_start != NULL)
+ {
+ /*
+ * Copy the rest of the line, that didn't match.
+ * "matchcol" has to be adjusted, we use the end of
+ * the line as reference, because the substitute may
+ * have changed the number of characters. Same for
+ * "prev_matchcol".
+ */
+ STRCAT(new_start, sub_firstline + copycol);
+ matchcol = (colnr_T)STRLEN(sub_firstline) - matchcol;
+ prev_matchcol = (colnr_T)STRLEN(sub_firstline)
+ - prev_matchcol;
+
+ if (u_savesub(lnum) != OK)
+ break;
+ ml_replace(lnum, new_start, TRUE);
+
+ if (nmatch_tl > 0)
+ {
+ /*
+ * Matched lines have now been substituted and are
+ * useless, delete them. The part after the match
+ * has been appended to new_start, we don't need
+ * it in the buffer.
+ */
+ ++lnum;
+ if (u_savedel(lnum, nmatch_tl) != OK)
+ break;
+ for (i = 0; i < nmatch_tl; ++i)
+ ml_delete(lnum, (int)FALSE);
+ mark_adjust(lnum, lnum + nmatch_tl - 1,
+ (long)MAXLNUM, -nmatch_tl);
+ if (do_ask)
+ deleted_lines(lnum, nmatch_tl);
+ --lnum;
+ line2 -= nmatch_tl; /* nr of lines decreases */
+ nmatch_tl = 0;
+ }
+
+ /* When asking, undo is saved each time, must also set
+ * changed flag each time. */
+ if (do_ask)
+ changed_bytes(lnum, 0);
+ else
+ {
+ if (first_line == 0)
+ first_line = lnum;
+ last_line = lnum + 1;
+ }
+
+ sub_firstlnum = lnum;
+ vim_free(sub_firstline); /* free the temp buffer */
+ sub_firstline = new_start;
+ new_start = NULL;
+ matchcol = (colnr_T)STRLEN(sub_firstline) - matchcol;
+ prev_matchcol = (colnr_T)STRLEN(sub_firstline)
+ - prev_matchcol;
+ copycol = 0;
+ }
+ if (nmatch == -1 && !lastone)
+ nmatch = vim_regexec_multi(&regmatch, curwin, curbuf,
+ sub_firstlnum, matchcol);
+
+ /*
+ * 5. break if there isn't another match in this line
+ */
+ if (nmatch <= 0)
+ break;
+ }
+
+ line_breakcheck();
+ }
+
+ if (did_sub)
+ ++sub_nlines;
+ vim_free(sub_firstline); /* free the copy of the original line */
+ sub_firstline = NULL;
+ }
+
+ line_breakcheck();
+ }
+
+ if (first_line != 0)
+ {
+ /* Need to subtract the number of added lines from "last_line" to get
+ * the line number before the change (same as adding the number of
+ * deleted lines). */
+ i = curbuf->b_ml.ml_line_count - old_line_count;
+ changed_lines(first_line, 0, last_line - i, i);
+ }
+
+outofmem:
+ vim_free(sub_firstline); /* may have to free allocated copy of the line */
+ if (sub_nsubs)
+ {
+ /* Set the '[ and '] marks. */
+ curbuf->b_op_start.lnum = eap->line1;
+ curbuf->b_op_end.lnum = line2;
+ curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
+
+ if (!global_busy)
+ {
+ beginline(BL_WHITE | BL_FIX);
+ if (!do_sub_msg() && do_ask)
+ MSG("");
+ }
+ else
+ global_need_beginline = TRUE;
+ if (do_print)
+ print_line(curwin->w_cursor.lnum, FALSE);
+ }
+ else if (!global_busy)
+ {
+ if (got_int) /* interrupted */
+ EMSG(_(e_interr));
+ else if (got_match) /* did find something but nothing substituted */
+ MSG("");
+ else if (do_error) /* nothing found */
+ EMSG2(_(e_patnotf2), get_search_pat());
+ }
+
+ vim_free(regmatch.regprog);
+}
+
+/*
+ * Give message for number of substitutions.
+ * Can also be used after a ":global" command.
+ * Return TRUE if a message was given.
+ */
+ static int
+do_sub_msg()
+{
+ /*
+ * Only report substitutions when:
+ * - more than 'report' substitutions
+ * - command was typed by user, or number of changed lines > 'report'
+ * - giving messages is not disabled by 'lazyredraw'
+ */
+ if (sub_nsubs > p_report
+ && (KeyTyped || sub_nlines > 1 || p_report < 1)
+ && messaging())
+ {
+ if (got_int)
+ STRCPY(msg_buf, _("(Interrupted) "));
+ else
+ msg_buf[0] = NUL;
+ if (sub_nsubs == 1)
+ STRCAT(msg_buf, _("1 substitution"));
+ else
+ sprintf((char *)msg_buf + STRLEN(msg_buf), _("%ld substitutions"),
+ sub_nsubs);
+ if (sub_nlines == 1)
+ STRCAT(msg_buf, _(" on 1 line"));
+ else
+ sprintf((char *)msg_buf + STRLEN(msg_buf), _(" on %ld lines"),
+ (long)sub_nlines);
+ if (msg(msg_buf))
+ {
+ /* save message to display it after redraw */
+ set_keep_msg(msg_buf);
+ keep_msg_attr = 0;
+ }
+ return TRUE;
+ }
+ if (got_int)
+ {
+ EMSG(_(e_interr));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Execute a global command of the form:
+ *
+ * g/pattern/X : execute X on all lines where pattern matches
+ * v/pattern/X : execute X on all lines where pattern does not match
+ *
+ * where 'X' is an EX command
+ *
+ * The command character (as well as the trailing slash) is optional, and
+ * is assumed to be 'p' if missing.
+ *
+ * This is implemented in two passes: first we scan the file for the pattern and
+ * set a mark for each line that (not) matches. secondly we execute the command
+ * for each line that has a mark. This is required because after deleting
+ * lines we do not know where to search for the next match.
+ */
+ void
+ex_global(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum; /* line number according to old situation */
+ int ndone;
+ int type; /* first char of cmd: 'v' or 'g' */
+ char_u *cmd; /* command argument */
+
+ char_u delim; /* delimiter, normally '/' */
+ char_u *pat;
+ regmmatch_T regmatch;
+ int match;
+ int which_pat;
+
+ if (global_busy)
+ {
+ EMSG(_("E147: Cannot do :global recursive")); /* will increment global_busy */
+ return;
+ }
+
+ if (eap->forceit) /* ":global!" is like ":vglobal" */
+ type = 'v';
+ else
+ type = *eap->cmd;
+ cmd = eap->arg;
+ which_pat = RE_LAST; /* default: use last used regexp */
+ sub_nsubs = 0;
+ sub_nlines = 0;
+
+ /*
+ * undocumented vi feature:
+ * "\/" and "\?": use previous search pattern.
+ * "\&": use previous substitute pattern.
+ */
+ if (*cmd == '\\')
+ {
+ ++cmd;
+ if (vim_strchr((char_u *)"/?&", *cmd) == NULL)
+ {
+ EMSG(_(e_backslash));
+ return;
+ }
+ if (*cmd == '&')
+ which_pat = RE_SUBST; /* use previous substitute pattern */
+ else
+ which_pat = RE_SEARCH; /* use previous search pattern */
+ ++cmd;
+ pat = (char_u *)"";
+ }
+ else if (*cmd == NUL)
+ {
+ EMSG(_("E148: Regular expression missing from global"));
+ return;
+ }
+ else
+ {
+ delim = *cmd; /* get the delimiter */
+ if (delim)
+ ++cmd; /* skip delimiter if there is one */
+ pat = cmd; /* remember start of pattern */
+ cmd = skip_regexp(cmd, delim, p_magic, &eap->arg);
+ if (cmd[0] == delim) /* end delimiter found */
+ *cmd++ = NUL; /* replace it with a NUL */
+ }
+
+#ifdef FEAT_FKMAP /* when in Farsi mode, reverse the character flow */
+ if (p_altkeymap && curwin->w_p_rl)
+ lrFswap(pat,0);
+#endif
+
+ if (search_regcomp(pat, RE_BOTH, which_pat, SEARCH_HIS, &regmatch) == FAIL)
+ {
+ EMSG(_(e_invcmd));
+ return;
+ }
+
+ /*
+ * pass 1: set marks for each (not) matching line
+ */
+ ndone = 0;
+ for (lnum = eap->line1; lnum <= eap->line2 && !got_int; ++lnum)
+ {
+ /* a match on this line? */
+ match = vim_regexec_multi(&regmatch, curwin, curbuf, lnum, (colnr_T)0);
+ if ((type == 'g' && match) || (type == 'v' && !match))
+ {
+ ml_setmarked(lnum);
+ ndone++;
+ }
+ line_breakcheck();
+ }
+
+ /*
+ * pass 2: execute the command for each line that has been marked
+ */
+ if (got_int)
+ MSG(_(e_interr));
+ else if (ndone == 0)
+ {
+ if (type == 'v')
+ msg_str((char_u *)_("Pattern found in every line: %s"), pat);
+ else
+ msg_str((char_u *)_(e_patnotf2), pat);
+ }
+ else
+ global_exe(cmd);
+
+ ml_clearmarked(); /* clear rest of the marks */
+ vim_free(regmatch.regprog);
+}
+
+/*
+ * Execute "cmd" on lines marked with ml_setmarked().
+ */
+ void
+global_exe(cmd)
+ char_u *cmd;
+{
+ linenr_T old_lcount; /* b_ml.ml_line_count before the command */
+ linenr_T lnum; /* line number according to old situation */
+
+ /*
+ * Set current position only once for a global command.
+ * If global_busy is set, setpcmark() will not do anything.
+ * If there is an error, global_busy will be incremented.
+ */
+ setpcmark();
+
+ /* When the command writes a message, don't overwrite the command. */
+ msg_didout = TRUE;
+
+ global_need_beginline = FALSE;
+ global_busy = 1;
+ old_lcount = curbuf->b_ml.ml_line_count;
+ while (!got_int && (lnum = ml_firstmarked()) != 0 && global_busy == 1)
+ {
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = 0;
+ if (*cmd == NUL || *cmd == '\n')
+ do_cmdline((char_u *)"p", NULL, NULL, DOCMD_NOWAIT);
+ else
+ do_cmdline(cmd, NULL, NULL, DOCMD_NOWAIT);
+ ui_breakcheck();
+ }
+
+ global_busy = 0;
+ if (global_need_beginline)
+ beginline(BL_WHITE | BL_FIX);
+ else
+ check_cursor(); /* cursor may be beyond the end of the line */
+
+ /* If it looks like no message was written, allow overwriting the
+ * command with the report for number of changes. */
+ if (msg_col == 0 && msg_scrolled == 0)
+ msg_didout = FALSE;
+
+ /* If subsitutes done, report number of substitues, otherwise report
+ * number of extra or deleted lines. */
+ if (!do_sub_msg())
+ msgmore(curbuf->b_ml.ml_line_count - old_lcount);
+}
+
+#ifdef FEAT_VIMINFO
+ int
+read_viminfo_sub_string(virp, force)
+ vir_T *virp;
+ int force;
+{
+ if (old_sub != NULL && force)
+ vim_free(old_sub);
+ if (force || old_sub == NULL)
+ old_sub = viminfo_readstring(virp, 1, TRUE);
+ return viminfo_readline(virp);
+}
+
+ void
+write_viminfo_sub_string(fp)
+ FILE *fp;
+{
+ if (get_viminfo_parameter('/') != 0 && old_sub != NULL)
+ {
+ fprintf(fp, _("\n# Last Substitute String:\n$"));
+ viminfo_writestring(fp, old_sub);
+ }
+}
+#endif /* FEAT_VIMINFO */
+
+#if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO)
+/*
+ * Set up for a tagpreview.
+ */
+ void
+prepare_tagpreview()
+{
+ win_T *wp;
+
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+
+ /*
+ * If there is already a preview window open, use that one.
+ */
+ if (!curwin->w_p_pvw)
+ {
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_p_pvw)
+ break;
+ if (wp != NULL)
+ win_enter(wp, TRUE);
+ else
+ {
+ /*
+ * There is no preview window open yet. Create one.
+ */
+ if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0)
+ == FAIL)
+ return;
+ curwin->w_p_pvw = TRUE;
+ curwin->w_p_wfh = TRUE;
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE; /* don't take over 'scrollbind' */
+# endif
+# ifdef FEAT_DIFF
+ curwin->w_p_diff = FALSE; /* no 'diff' */
+# endif
+# ifdef FEAT_FOLDING
+ curwin->w_p_fdc = 0; /* no 'foldcolumn' */
+# endif
+ }
+ }
+}
+
+#endif
+
+
+/*
+ * ":help": open a read-only window on a help file
+ */
+ void
+ex_help(eap)
+ exarg_T *eap;
+{
+ char_u *arg;
+ char_u *tag;
+ FILE *helpfd; /* file descriptor of help file */
+ int n;
+ int i;
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+#endif
+ int num_matches;
+ char_u **matches;
+ char_u *p;
+ int empty_fnum = 0;
+ int alt_fnum = 0;
+ buf_T *buf;
+#ifdef FEAT_MULTI_LANG
+ int len;
+ char_u *lang = NULL;
+#endif
+
+ if (eap != NULL)
+ {
+ /*
+ * A ":help" command ends at the first LF, or at a '|' that is
+ * followed by some text. Set nextcmd to the following command.
+ */
+ for (arg = eap->arg; *arg; ++arg)
+ {
+ if (*arg == '\n' || *arg == '\r'
+ || (*arg == '|' && arg[1] != NUL && arg[1] != '|'))
+ {
+ *arg++ = NUL;
+ eap->nextcmd = arg;
+ break;
+ }
+ }
+ arg = eap->arg;
+
+ if (eap->forceit && *arg == NUL)
+ {
+ EMSG(_("E478: Don't panic!"));
+ return;
+ }
+
+ if (eap->skip) /* not executing commands */
+ return;
+ }
+ else
+ arg = (char_u *)"";
+
+ /* remove trailing blanks */
+ p = arg + STRLEN(arg) - 1;
+ while (p > arg && vim_iswhite(*p) && p[-1] != '\\')
+ *p-- = NUL;
+
+#ifdef FEAT_MULTI_LANG
+ /* Check for a specified language */
+ len = STRLEN(arg);
+ if (len >= 3 && arg[len - 3] == '@' && ASCII_ISALPHA(arg[len - 2])
+ && ASCII_ISALPHA(arg[len - 1]))
+ {
+ lang = arg + len - 2;
+ lang[-1] = NUL; /* remove the '@' */
+ }
+#endif
+
+ /* When no argument given go to the index. */
+ if (*arg == NUL)
+ arg = (char_u *)"help.txt";
+
+ /*
+ * Check if there is a match for the argument.
+ */
+ n = find_help_tags(arg, &num_matches, &matches,
+ eap != NULL && eap->forceit);
+
+ i = 0;
+#ifdef FEAT_MULTI_LANG
+ if (n != FAIL && lang != NULL)
+ /* Find first item with the requested language. */
+ for (i = 0; i < num_matches; ++i)
+ {
+ len = STRLEN(matches[i]);
+ if (len > 3 && matches[i][len - 3] == '@'
+ && STRICMP(matches[i] + len - 2, lang) == 0)
+ break;
+ }
+#endif
+ if (i >= num_matches || n == FAIL)
+ {
+#ifdef FEAT_MULTI_LANG
+ if (lang != NULL)
+ EMSG3(_("E661: Sorry, no '%s' help for %s"), lang, arg);
+ else
+#endif
+ EMSG2(_("E149: Sorry, no help for %s"), arg);
+ if (n != FAIL)
+ FreeWild(num_matches, matches);
+ return;
+ }
+
+ /* The first match (in the requested language) is the best match. */
+ tag = vim_strsave(matches[i]);
+ FreeWild(num_matches, matches);
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /*
+ * Re-use an existing help window or open a new one.
+ */
+ if (!curwin->w_buffer->b_help)
+ {
+#ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer != NULL && wp->w_buffer->b_help)
+ break;
+ if (wp != NULL && wp->w_buffer->b_nwindows > 0)
+ win_enter(wp, TRUE);
+ else
+#endif
+ {
+ /*
+ * There is no help window yet.
+ * Try to open the file specified by the "helpfile" option.
+ */
+ if ((helpfd = mch_fopen((char *)p_hf, READBIN)) == NULL)
+ {
+ msg_str((char_u *)_("Sorry, help file \"%s\" not found"),
+ p_hf);
+ goto erret;
+ }
+ fclose(helpfd);
+
+#ifdef FEAT_WINDOWS
+ /* Split off help window; put it at far top if no position
+ * specified, the current window is vertically split and narrow. */
+ n = WSP_HELP;
+# ifdef FEAT_VERTSPLIT
+ if (cmdmod.split == 0 && curwin->w_width != Columns
+ && curwin->w_width < 80)
+ n |= WSP_TOP;
+# endif
+ if (win_split(0, n) == FAIL)
+#else
+ /* use current window */
+ if (!can_abandon(curbuf, FALSE))
+#endif
+ goto erret;
+
+#ifdef FEAT_WINDOWS
+ if (curwin->w_height < p_hh)
+ win_setheight((int)p_hh);
+#endif
+
+ /*
+ * Open help file (do_ecmd() will set b_help flag, readfile() will
+ * set b_p_ro flag).
+ * Set the alternate file to the previously edited file.
+ */
+ alt_fnum = curbuf->b_fnum;
+ (void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
+ ECMD_HIDE + ECMD_SET_HELP);
+ curwin->w_alt_fnum = alt_fnum;
+ empty_fnum = curbuf->b_fnum;
+ }
+ }
+
+ if (!p_im)
+ restart_edit = 0; /* don't want insert mode in help file */
+
+ if (tag != NULL)
+ do_tag(tag, DT_HELP, 1, FALSE, TRUE);
+
+ /* Delete the empty buffer if we're not using it. */
+ if (empty_fnum != 0 && curbuf->b_fnum != empty_fnum)
+ {
+ buf = buflist_findnr(empty_fnum);
+ if (buf != NULL)
+ wipe_buffer(buf, TRUE);
+ }
+
+ /* keep the previous alternate file */
+ if (alt_fnum != 0 && curwin->w_alt_fnum == empty_fnum)
+ curwin->w_alt_fnum = alt_fnum;
+
+erret:
+ vim_free(tag);
+}
+
+
+/*
+ * Return a heuristic indicating how well the given string matches. The
+ * smaller the number, the better the match. This is the order of priorities,
+ * from best match to worst match:
+ * - Match with least alpha-numeric characters is better.
+ * - Match with least total characters is better.
+ * - Match towards the start is better.
+ * - Match starting with "+" is worse (feature instead of command)
+ * Assumption is made that the matched_string passed has already been found to
+ * match some string for which help is requested. webb.
+ */
+ int
+help_heuristic(matched_string, offset, wrong_case)
+ char_u *matched_string;
+ int offset; /* offset for match */
+ int wrong_case; /* no matching case */
+{
+ int num_letters;
+ char_u *p;
+
+ num_letters = 0;
+ for (p = matched_string; *p; p++)
+ if (ASCII_ISALNUM(*p))
+ num_letters++;
+
+ /*
+ * Multiply the number of letters by 100 to give it a much bigger
+ * weighting than the number of characters.
+ * If there only is a match while ignoring case, add 5000.
+ * If the match starts in the middle of a word, add 10000 to put it
+ * somewhere in the last half.
+ * If the match is more than 2 chars from the start, multiply by 200 to
+ * put it after matches at the start.
+ */
+ if (ASCII_ISALNUM(matched_string[offset]) && offset > 0
+ && ASCII_ISALNUM(matched_string[offset - 1]))
+ offset += 10000;
+ else if (offset > 2)
+ offset *= 200;
+ if (wrong_case)
+ offset += 5000;
+ /* Features are less interesting than the subjects themselves, but "+"
+ * alone is not a feature. */
+ if (matched_string[0] == '+' && matched_string[1] != NUL)
+ offset += 100;
+ return (int)(100 * num_letters + STRLEN(matched_string) + offset);
+}
+
+/*
+ * Compare functions for qsort() below, that checks the help heuristics number
+ * that has been put after the tagname by find_tags().
+ */
+ static int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+help_compare(s1, s2)
+ const void *s1;
+ const void *s2;
+{
+ char *p1;
+ char *p2;
+
+ p1 = *(char **)s1 + strlen(*(char **)s1) + 1;
+ p2 = *(char **)s2 + strlen(*(char **)s2) + 1;
+ return strcmp(p1, p2);
+}
+
+/*
+ * Find all help tags matching "arg", sort them and return in matches[], with
+ * the number of matches in num_matches.
+ * The matches will be sorted with a "best" match algorithm.
+ * When "keep_lang" is TRUE try keeping the language of the current buffer.
+ */
+ int
+find_help_tags(arg, num_matches, matches, keep_lang)
+ char_u *arg;
+ int *num_matches;
+ char_u ***matches;
+ int keep_lang;
+{
+ char_u *s, *d;
+ int i;
+ static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
+ "/*", "/\\*", "\"*", "/\\(\\)",
+ "?", ":?", "?<CR>", "g?", "g?g?", "g??",
+ "/\\?", "/\\z(\\)",
+ "[count]", "[quotex]", "[range]",
+ "[pattern]", "\\|", "\\%$"};
+ static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
+ "/star", "/\\\\star", "quotestar", "/\\\\(\\\\)",
+ "?", ":?", "?<CR>", "g?", "g?g?", "g??",
+ "/\\\\?", "/\\\\z(\\\\)",
+ "\\[count]", "\\[quotex]", "\\[range]",
+ "\\[pattern]", "\\\\bar", "/\\\\%\\$"};
+ int flags;
+
+ d = IObuff; /* assume IObuff is long enough! */
+
+ /*
+ * Recognize a few exceptions to the rule. Some strings that contain '*'
+ * with "star". Otherwise '*' is recognized as a wildcard.
+ */
+ for (i = sizeof(mtable) / sizeof(char *); --i >= 0; )
+ if (STRCMP(arg, mtable[i]) == 0)
+ {
+ STRCPY(d, rtable[i]);
+ break;
+ }
+
+ if (i < 0) /* no match in table */
+ {
+ /* Replace "\S" with "/\\S", etc. Otherwise every tag is matched.
+ * Also replace "\%^" and "\%(", they match every tag too.
+ * Also "\zs", "\z1", etc.
+ * Also "\@<", "\@=", "\@<=", etc.
+ * And also "\_$" and "\_^". */
+ if (arg[0] == '\\'
+ && ((arg[1] != NUL && arg[2] == NUL)
+ || (vim_strchr((char_u *)"%_z@", arg[1]) != NULL
+ && arg[2] != NUL)))
+ {
+ STRCPY(d, "/\\\\");
+ STRCPY(d + 3, arg + 1);
+ /* Check for "/\\_$", should be "/\\_\$" */
+ if (d[3] == '_' && d[4] == '$')
+ STRCPY(d + 4, "\\$");
+ }
+ else
+ {
+ /* replace "[:...:]" with "\[:...:]"; "[+...]" with "\[++...]" */
+ if (arg[0] == '[' && (arg[1] == ':'
+ || (arg[1] == '+' && arg[2] == '+')))
+ *d++ = '\\';
+
+ for (s = arg; *s; ++s)
+ {
+ /*
+ * Replace "|" with "bar" and '"' with "quote" to match the name of
+ * the tags for these commands.
+ * Replace "*" with ".*" and "?" with "." to match command line
+ * completion.
+ * Insert a backslash before '~', '$' and '.' to avoid their
+ * special meaning.
+ */
+ if (d - IObuff > IOSIZE - 10) /* getting too long!? */
+ break;
+ switch (*s)
+ {
+ case '|': STRCPY(d, "bar");
+ d += 3;
+ continue;
+ case '"': STRCPY(d, "quote");
+ d += 5;
+ continue;
+ case '*': *d++ = '.';
+ break;
+ case '?': *d++ = '.';
+ continue;
+ case '$':
+ case '.':
+ case '~': *d++ = '\\';
+ break;
+ }
+
+ /*
+ * Replace "^x" by "CTRL-X". Don't do this for "^_" to make
+ * ":help i_^_CTRL-D" work.
+ * Insert '-' before and after "CTRL-X" when applicable.
+ */
+ if (*s < ' ' || (*s == '^' && s[1] && (ASCII_ISALPHA(s[1])
+ || vim_strchr((char_u *)"?@[\\]^", s[1]) != NULL)))
+ {
+ if (d > IObuff && d[-1] != '_')
+ *d++ = '_'; /* prepend a '_' */
+ STRCPY(d, "CTRL-");
+ d += 5;
+ if (*s < ' ')
+ {
+#ifdef EBCDIC
+ *d++ = CtrlChar(*s);
+#else
+ *d++ = *s + '@';
+#endif
+ if (d[-1] == '\\')
+ *d++ = '\\'; /* double a backslash */
+ }
+ else
+ *d++ = *++s;
+ if (s[1] != NUL && s[1] != '_')
+ *d++ = '_'; /* append a '_' */
+ continue;
+ }
+ else if (*s == '^') /* "^" or "CTRL-^" or "^_" */
+ *d++ = '\\';
+
+ /*
+ * Insert a backslash before a backslash after a slash, for search
+ * pattern tags: "/\|" --> "/\\|".
+ */
+ else if (s[0] == '\\' && s[1] != '\\'
+ && *arg == '/' && s == arg + 1)
+ *d++ = '\\';
+
+ /* "CTRL-\_" -> "CTRL-\\_" to avoid the special meaning of "\_" in
+ * "CTRL-\_CTRL-N" */
+ if (STRNICMP(s, "CTRL-\\_", 7) == 0)
+ {
+ STRCPY(d, "CTRL-\\\\");
+ d += 7;
+ s += 6;
+ }
+
+ *d++ = *s;
+
+ /*
+ * If tag starts with ', toss everything after a second '. Fixes
+ * CTRL-] on 'option'. (would include the trailing '.').
+ */
+ if (*s == '\'' && s > arg && *arg == '\'')
+ break;
+ }
+ *d = NUL;
+ }
+ }
+
+ *matches = (char_u **)"";
+ *num_matches = 0;
+ flags = TAG_HELP | TAG_REGEXP | TAG_NAMES | TAG_VERBOSE;
+ if (keep_lang)
+ flags |= TAG_KEEP_LANG;
+ if (find_tags(IObuff, num_matches, matches, flags, (int)MAXCOL, NULL) == OK
+ && *num_matches > 0)
+ /* Sort the matches found on the heuristic number that is after the
+ * tag name. */
+ qsort((void *)*matches, (size_t)*num_matches,
+ sizeof(char_u *), help_compare);
+ return OK;
+}
+
+/*
+ * After reading a help file: May cleanup a help buffer when syntax
+ * highlighting is not used.
+ */
+ void
+fix_help_buffer()
+{
+ linenr_T lnum;
+ char_u *line;
+ int in_example = FALSE;
+ int len;
+ char_u *p;
+ char_u *rt;
+ int mustfree;
+
+ /* set filetype to "help". */
+ set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL);
+
+#ifdef FEAT_SYN_HL
+ if (!syntax_present(curbuf))
+#endif
+ {
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ line = ml_get_buf(curbuf, lnum, FALSE);
+ len = (int)STRLEN(line);
+ if (in_example && len > 0 && !vim_iswhite(line[0]))
+ {
+ /* End of example: non-white or '<' in first column. */
+ if (line[0] == '<')
+ {
+ /* blank-out a '<' in the first column */
+ line = ml_get_buf(curbuf, lnum, TRUE);
+ line[0] = ' ';
+ }
+ in_example = FALSE;
+ }
+ if (!in_example && len > 0)
+ {
+ if (line[len - 1] == '>' && (len == 1 || line[len - 2] == ' '))
+ {
+ /* blank-out a '>' in the last column (start of example) */
+ line = ml_get_buf(curbuf, lnum, TRUE);
+ line[len - 1] = ' ';
+ in_example = TRUE;
+ }
+ else if (line[len - 1] == '~')
+ {
+ /* blank-out a '~' at the end of line (header marker) */
+ line = ml_get_buf(curbuf, lnum, TRUE);
+ line[len - 1] = ' ';
+ }
+ }
+ }
+ }
+
+ /*
+ * In the "help.txt" file, add the locally added help files.
+ * This uses the very first line in the help file.
+ */
+ if (fnamecmp(gettail(curbuf->b_fname), "help.txt") == 0)
+ {
+ for (lnum = 1; lnum < curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ line = ml_get_buf(curbuf, lnum, FALSE);
+ if (strstr((char *)line, "*local-additions*") != NULL)
+ {
+ /* Go through all directories in 'runtimepath', skipping
+ * $VIMRUNTIME. */
+ p = p_rtp;
+ while (*p != NUL)
+ {
+ copy_option_part(&p, NameBuff, MAXPATHL, ",");
+ mustfree = FALSE;
+ rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
+ if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
+ {
+ int fcount;
+ char_u **fnames;
+ FILE *fd;
+ char_u *s;
+ int fi;
+#ifdef FEAT_MBYTE
+ vimconv_T vc;
+ char_u *cp;
+#endif
+
+ /* Find all "doc/ *.txt" files in this directory. */
+ add_pathsep(NameBuff);
+ STRCAT(NameBuff, "doc/*.txt");
+ if (gen_expand_wildcards(1, &NameBuff, &fcount,
+ &fnames, EW_FILE|EW_SILENT) == OK
+ && fcount > 0)
+ {
+ for (fi = 0; fi < fcount; ++fi)
+ {
+ fd = fopen((char *)fnames[fi], "r");
+ if (fd != NULL)
+ {
+ vim_fgets(IObuff, IOSIZE, fd);
+ if (IObuff[0] == '*'
+ && (s = vim_strchr(IObuff + 1, '*'))
+ != NULL)
+ {
+#ifdef FEAT_MBYTE
+ int this_utf = MAYBE;
+#endif
+ /* Change tag definition to a
+ * reference and remove <CR>/<NL>. */
+ IObuff[0] = '|';
+ *s = '|';
+ while (*s != NUL)
+ {
+ if (*s == '\r' || *s == '\n')
+ *s = NUL;
+#ifdef FEAT_MBYTE
+ /* The text is utf-8 when a byte
+ * above 127 is found and no
+ * illegal byte sequence is found.
+ */
+ if (*s >= 0x80 && this_utf != FALSE)
+ {
+ int l;
+
+ this_utf = TRUE;
+ l = utf_ptr2len_check(s);
+ if (l == 1)
+ this_utf = FALSE;
+ s += l - 1;
+ }
+#endif
+ ++s;
+ }
+#ifdef FEAT_MBYTE
+ /* The help file is latin1 or utf-8;
+ * conversion to the current
+ * 'encoding' may be required. */
+ vc.vc_type = CONV_NONE;
+ convert_setup(&vc, (char_u *)(
+ this_utf == TRUE ? "utf-8"
+ : "latin1"), p_enc);
+ if (vc.vc_type == CONV_NONE)
+ /* No conversion needed. */
+ cp = IObuff;
+ else
+ {
+ /* Do the conversion. If it fails
+ * use the unconverted text. */
+ cp = string_convert(&vc, IObuff,
+ NULL);
+ if (cp == NULL)
+ cp = IObuff;
+ }
+ convert_setup(&vc, NULL, NULL);
+
+ ml_append(lnum, cp, (colnr_T)0, FALSE);
+ if (cp != IObuff)
+ vim_free(cp);
+#else
+ ml_append(lnum, IObuff, (colnr_T)0,
+ FALSE);
+#endif
+ ++lnum;
+ }
+ fclose(fd);
+ }
+ }
+ FreeWild(fcount, fnames);
+ }
+ }
+ if (mustfree)
+ vim_free(rt);
+ }
+ break;
+ }
+ }
+ }
+}
+
+#if defined(FEAT_EX_EXTRA) || defined(PROTO)
+static void helptags_one __ARGS((char_u *dir, char_u *ext, char_u *lang));
+
+/*
+ * ":helptags"
+ */
+ void
+ex_helptags(eap)
+ exarg_T *eap;
+{
+ garray_T ga;
+ int i, j;
+ int len;
+ char_u lang[2];
+ char_u ext[5];
+ char_u fname[8];
+ int filecount;
+ char_u **files;
+
+ if (!mch_isdir(eap->arg))
+ {
+ EMSG2(_("E150: Not a directory: %s"), eap->arg);
+ return;
+ }
+
+#ifdef FEAT_MULTI_LANG
+ /* Get a list of all files in the directory. */
+ STRCPY(NameBuff, eap->arg);
+ add_pathsep(NameBuff);
+ STRCAT(NameBuff, "*");
+ if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
+ EW_FILE|EW_SILENT) == FAIL
+ || filecount == 0)
+ {
+ EMSG2("E151: No match: %s", NameBuff);
+ return;
+ }
+
+ /* Go over all files in the directory to find out what languages are
+ * present. */
+ ga_init2(&ga, 1, 10);
+ for (i = 0; i < filecount; ++i)
+ {
+ len = STRLEN(files[i]);
+ if (len > 4)
+ {
+ if (STRICMP(files[i] + len - 4, ".txt") == 0)
+ {
+ /* ".txt" -> language "en" */
+ lang[0] = 'e';
+ lang[1] = 'n';
+ }
+ else if (files[i][len - 4] == '.'
+ && ASCII_ISALPHA(files[i][len - 3])
+ && ASCII_ISALPHA(files[i][len - 2])
+ && TOLOWER_ASC(files[i][len - 1]) == 'x')
+ {
+ /* ".abx" -> language "ab" */
+ lang[0] = TOLOWER_ASC(files[i][len - 3]);
+ lang[1] = TOLOWER_ASC(files[i][len - 2]);
+ }
+ else
+ continue;
+
+ /* Did we find this language already? */
+ for (j = 0; j < ga.ga_len; j += 2)
+ if (STRNCMP(lang, ((char_u *)ga.ga_data) + j, 2) == 0)
+ break;
+ if (j == ga.ga_len)
+ {
+ /* New language, add it. */
+ if (ga_grow(&ga, 2) == FAIL)
+ break;
+ ((char_u *)ga.ga_data)[ga.ga_len++] = lang[0];
+ ((char_u *)ga.ga_data)[ga.ga_len++] = lang[1];
+ ga.ga_room -= 2;
+ }
+ }
+ }
+
+ /*
+ * Loop over the found languages to generate a tags file for each one.
+ */
+ for (j = 0; j < ga.ga_len; j += 2)
+ {
+ STRCPY(fname, "tags-xx");
+ fname[5] = ((char_u *)ga.ga_data)[j];
+ fname[6] = ((char_u *)ga.ga_data)[j + 1];
+ if (fname[5] == 'e' && fname[6] == 'n')
+ {
+ /* English is an exception: use ".txt" and "tags". */
+ fname[4] = NUL;
+ STRCPY(ext, ".txt");
+ }
+ else
+ {
+ /* Language "ab" uses ".abx" and "tags-ab". */
+ STRCPY(ext, ".xxx");
+ ext[1] = fname[5];
+ ext[2] = fname[6];
+ }
+ helptags_one(eap->arg, ext, fname);
+ }
+
+ ga_clear(&ga);
+ FreeWild(filecount, files);
+
+#else
+ /* No language support, just use "*.txt" and "tags". */
+ helptags_one(eap->arg, (char_u *)".txt", (char_u *)"tags");
+#endif
+}
+
+ static void
+helptags_one(dir, ext, tagfname)
+ char_u *dir; /* doc directory */
+ char_u *ext; /* suffix, ".txt", ".itx", ".frx", etc. */
+ char_u *tagfname; /* "tags" for English, "tags-it" for Italian. */
+{
+ FILE *fd_tags;
+ FILE *fd;
+ garray_T ga;
+ int filecount;
+ char_u **files;
+ char_u *p1, *p2;
+ int fi;
+ char_u *s;
+ int i;
+ char_u *fname;
+# ifdef FEAT_MBYTE
+ int utf8 = MAYBE;
+ int this_utf8;
+ int firstline;
+ int mix = FALSE; /* detected mixed encodings */
+# endif
+
+ /*
+ * Find all *.txt files.
+ */
+ STRCPY(NameBuff, dir);
+ add_pathsep(NameBuff);
+ STRCAT(NameBuff, "*");
+ STRCAT(NameBuff, ext);
+ if (gen_expand_wildcards(1, &NameBuff, &filecount, &files,
+ EW_FILE|EW_SILENT) == FAIL
+ || filecount == 0)
+ {
+ if (!got_int)
+ EMSG2("E151: No match: %s", NameBuff);
+ return;
+ }
+
+ /*
+ * Open the tags file for writing.
+ * Do this before scanning through all the files.
+ */
+ STRCPY(NameBuff, dir);
+ add_pathsep(NameBuff);
+ STRCAT(NameBuff, tagfname);
+ fd_tags = fopen((char *)NameBuff, "w");
+ if (fd_tags == NULL)
+ {
+ EMSG2(_("E152: Cannot open %s for writing"), NameBuff);
+ FreeWild(filecount, files);
+ return;
+ }
+
+ /*
+ * If generating tags for "$VIMRUNTIME/doc" add the "help-tags" tag.
+ */
+ ga_init2(&ga, (int)sizeof(char_u *), 100);
+ if (fullpathcmp((char_u *)"$VIMRUNTIME/doc", dir, FALSE) == FPC_SAME)
+ {
+ if (ga_grow(&ga, 1) == FAIL)
+ got_int = TRUE;
+ else
+ {
+ s = alloc(30);
+ if (s == NULL)
+ got_int = TRUE;
+ else
+ {
+ sprintf((char *)s, "help-tags\t%s\t1\n", tagfname);
+ ((char_u **)ga.ga_data)[ga.ga_len] = s;
+ ++ga.ga_len;
+ --ga.ga_room;
+ }
+ }
+ }
+
+ /*
+ * Go over all the files and extract the tags.
+ */
+ for (fi = 0; fi < filecount && !got_int; ++fi)
+ {
+ fd = fopen((char *)files[fi], "r");
+ if (fd == NULL)
+ {
+ EMSG2(_("E153: Unable to open %s for reading"), files[fi]);
+ continue;
+ }
+ fname = gettail(files[fi]);
+
+# ifdef FEAT_MBYTE
+ firstline = TRUE;
+# endif
+ while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int)
+ {
+# ifdef FEAT_MBYTE
+ if (firstline)
+ {
+ /* Detect utf-8 file by a non-ASCII char in the first line. */
+ this_utf8 = MAYBE;
+ for (s = IObuff; *s != NUL; ++s)
+ if (*s >= 0x80)
+ {
+ int l;
+
+ this_utf8 = TRUE;
+ l = utf_ptr2len_check(s);
+ if (l == 1)
+ {
+ /* Illegal UTF-8 byte sequence. */
+ this_utf8 = FALSE;
+ break;
+ }
+ s += l - 1;
+ }
+ if (this_utf8 == MAYBE) /* only ASCII characters found */
+ this_utf8 = FALSE;
+ if (utf8 == MAYBE) /* first file */
+ utf8 = this_utf8;
+ else if (utf8 != this_utf8)
+ {
+ EMSG2(_("E670: Mix of help file encodings within a language: %s"), files[fi]);
+ mix = !got_int;
+ got_int = TRUE;
+ }
+ firstline = FALSE;
+ }
+# endif
+ p1 = vim_strchr(IObuff, '*'); /* find first '*' */
+ while (p1 != NULL)
+ {
+ p2 = vim_strchr(p1 + 1, '*'); /* find second '*' */
+ if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
+ {
+ for (s = p1 + 1; s < p2; ++s)
+ if (*s == ' ' || *s == '\t' || *s == '|')
+ break;
+
+ /*
+ * Only accept a *tag* when it consists of valid
+ * characters, there is white space before it and is
+ * followed by a white character or end-of-line.
+ */
+ if (s == p2
+ && (p1 == IObuff || p1[-1] == ' ' || p1[-1] == '\t')
+ && (vim_strchr((char_u *)" \t\n\r", s[1]) != NULL
+ || s[1] == '\0'))
+ {
+ *p2 = '\0';
+ ++p1;
+ if (ga_grow(&ga, 1) == FAIL)
+ {
+ got_int = TRUE;
+ break;
+ }
+ s = alloc((unsigned)(p2 - p1 + STRLEN(fname) + 2));
+ if (s == NULL)
+ {
+ got_int = TRUE;
+ break;
+ }
+ ((char_u **)ga.ga_data)[ga.ga_len] = s;
+ ++ga.ga_len;
+ --ga.ga_room;
+ sprintf((char *)s, "%s\t%s", p1, fname);
+
+ /* find next '*' */
+ p2 = vim_strchr(p2 + 1, '*');
+ }
+ }
+ p1 = p2;
+ }
+ line_breakcheck();
+ }
+
+ fclose(fd);
+ }
+
+ FreeWild(filecount, files);
+
+ if (!got_int)
+ {
+ /*
+ * Sort the tags.
+ */
+ sort_strings((char_u **)ga.ga_data, ga.ga_len);
+
+ /*
+ * Check for duplicates.
+ */
+ for (i = 1; i < ga.ga_len; ++i)
+ {
+ p1 = ((char_u **)ga.ga_data)[i - 1];
+ p2 = ((char_u **)ga.ga_data)[i];
+ while (*p1 == *p2)
+ {
+ if (*p2 == '\t')
+ {
+ *p2 = NUL;
+ sprintf((char *)NameBuff,
+ _("E154: Duplicate tag \"%s\" in file %s/%s"),
+ ((char_u **)ga.ga_data)[i], dir, p2 + 1);
+ EMSG(NameBuff);
+ *p2 = '\t';
+ break;
+ }
+ ++p1;
+ ++p2;
+ }
+ }
+
+# ifdef FEAT_MBYTE
+ if (utf8 == TRUE)
+ fprintf(fd_tags, "!_TAG_FILE_ENCODING\tutf-8\t//\n");
+# endif
+
+ /*
+ * Write the tags into the file.
+ */
+ for (i = 0; i < ga.ga_len; ++i)
+ {
+ s = ((char_u **)ga.ga_data)[i];
+ if (STRNCMP(s, "help-tags", 9) == 0)
+ /* help-tags entry was added in formatted form */
+ fprintf(fd_tags, (char *)s);
+ else
+ {
+ fprintf(fd_tags, "%s\t/*", s);
+ for (p1 = s; *p1 != '\t'; ++p1)
+ {
+ /* insert backslash before '\\' and '/' */
+ if (*p1 == '\\' || *p1 == '/')
+ putc('\\', fd_tags);
+ putc(*p1, fd_tags);
+ }
+ fprintf(fd_tags, "*\n");
+ }
+ }
+ }
+#ifdef FEAT_MBYTE
+ if (mix)
+ got_int = FALSE; /* continue with other languages */
+#endif
+
+ for (i = 0; i < ga.ga_len; ++i)
+ vim_free(((char_u **)ga.ga_data)[i]);
+ ga_clear(&ga);
+ fclose(fd_tags); /* there is no check for an error... */
+}
+#endif
+
+#if defined(FEAT_SIGNS) || defined(PROTO)
+
+/*
+ * Struct to hold the sign properties.
+ */
+typedef struct sign sign_T;
+
+struct sign
+{
+ sign_T *sn_next; /* next sign in list */
+ int sn_typenr; /* type number of sign (negative if not equal
+ to name) */
+ char_u *sn_name; /* name of sign */
+ char_u *sn_icon; /* name of pixmap */
+#ifdef FEAT_SIGN_ICONS
+ void *sn_image; /* icon image */
+#endif
+ char_u *sn_text; /* text used instead of pixmap */
+ int sn_line_hl; /* highlight ID for line */
+ int sn_text_hl; /* highlight ID for text */
+};
+
+#define MAX_TYPENR 255 /* depends on sattr_T */
+static sign_T *first_sign = NULL;
+static int last_sign_typenr = MAX_TYPENR; /* is decremented */
+
+static void sign_list_defined __ARGS((sign_T *sp));
+
+/*
+ * ":sign" command
+ */
+ void
+ex_sign(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *p;
+ int idx;
+ sign_T *sp;
+ sign_T *sp_prev;
+ buf_T *buf;
+ static char *cmds[] = {
+ "define",
+#define SIGNCMD_DEFINE 0
+ "undefine",
+#define SIGNCMD_UNDEFINE 1
+ "list",
+#define SIGNCMD_LIST 2
+ "place",
+#define SIGNCMD_PLACE 3
+ "unplace",
+#define SIGNCMD_UNPLACE 4
+ "jump",
+#define SIGNCMD_JUMP 5
+#define SIGNCMD_LAST 6
+ };
+
+ /* Parse the subcommand. */
+ p = skiptowhite(arg);
+ if (*p != NUL)
+ *p++ = NUL;
+ for (idx = 0; ; ++idx)
+ {
+ if (idx == SIGNCMD_LAST)
+ {
+ EMSG2(_("E160: Unknown sign command: %s"), arg);
+ return;
+ }
+ if (STRCMP(arg, cmds[idx]) == 0)
+ break;
+ }
+ arg = skipwhite(p);
+
+ if (idx <= SIGNCMD_LIST)
+ {
+ /*
+ * Define, undefine or list signs.
+ */
+ if (idx == SIGNCMD_LIST && *arg == NUL)
+ {
+ /* ":sign list": list all defined signs */
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ sign_list_defined(sp);
+ }
+ else if (*arg == NUL)
+ EMSG(_("E156: Missing sign name"));
+ else
+ {
+ p = skiptowhite(arg);
+ if (*p != NUL)
+ *p++ = NUL;
+ sp_prev = NULL;
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ {
+ if (STRCMP(sp->sn_name, arg) == 0)
+ break;
+ sp_prev = sp;
+ }
+ if (idx == SIGNCMD_DEFINE)
+ {
+ /* ":sign define {name} ...": define a sign */
+ if (sp == NULL)
+ {
+ /* Allocate a new sign. */
+ sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
+ if (sp == NULL)
+ return;
+ if (sp_prev == NULL)
+ first_sign = sp;
+ else
+ sp_prev->sn_next = sp;
+ sp->sn_name = vim_strnsave(arg, (int)(p - arg));
+
+ /* If the name is a number use that for the typenr,
+ * otherwise use a negative number. */
+ if (VIM_ISDIGIT(*arg))
+ sp->sn_typenr = atoi((char *)arg);
+ else
+ {
+ sign_T *lp;
+ int start = last_sign_typenr;
+
+ for (lp = first_sign; lp != NULL; lp = lp->sn_next)
+ {
+ if (lp->sn_typenr == last_sign_typenr)
+ {
+ --last_sign_typenr;
+ if (last_sign_typenr == 0)
+ last_sign_typenr = MAX_TYPENR;
+ if (last_sign_typenr == start)
+ {
+ EMSG(_("E612: Too many signs defined"));
+ return;
+ }
+ lp = first_sign;
+ continue;
+ }
+ }
+
+ sp->sn_typenr = last_sign_typenr--;
+ if (last_sign_typenr == 0)
+ last_sign_typenr = MAX_TYPENR; /* wrap around */
+ }
+ }
+
+ /* set values for a defined sign. */
+ for (;;)
+ {
+ arg = skipwhite(p);
+ if (*arg == NUL)
+ break;
+ p = skiptowhite_esc(arg);
+ if (STRNCMP(arg, "icon=", 5) == 0)
+ {
+ arg += 5;
+ vim_free(sp->sn_icon);
+ sp->sn_icon = vim_strnsave(arg, (int)(p - arg));
+ backslash_halve(sp->sn_icon);
+#ifdef FEAT_SIGN_ICONS
+ if (gui.in_use)
+ {
+ out_flush();
+ if (sp->sn_image != NULL)
+ gui_mch_destroy_sign(sp->sn_image);
+ sp->sn_image = gui_mch_register_sign(sp->sn_icon);
+ }
+#endif
+ }
+ else if (STRNCMP(arg, "text=", 5) == 0)
+ {
+ char_u *s;
+ int cells;
+ int len;
+
+ arg += 5;
+#ifdef FEAT_MBYTE
+ /* Count cells and check for non-printable chars */
+ if (has_mbyte)
+ {
+ cells = 0;
+ for (s = arg; s < p; s += (*mb_ptr2len_check)(s))
+ {
+ if (!vim_isprintc((*mb_ptr2char)(s)))
+ break;
+ cells += (*mb_ptr2cells)(s);
+ }
+ }
+ else
+#endif
+ {
+ for (s = arg; s < p; ++s)
+ if (!vim_isprintc(*s))
+ break;
+ cells = s - arg;
+ }
+ /* Currently must be one or two display cells */
+ if (s != p || cells < 1 || cells > 2)
+ {
+ *p = NUL;
+ EMSG2(_("E239: Invalid sign text: %s"), arg);
+ return;
+ }
+
+ vim_free(sp->sn_text);
+ /* Allocate one byte more if we need to pad up
+ * with a space. */
+ len = p - arg + ((cells == 1) ? 1 : 0);
+ sp->sn_text = vim_strnsave(arg, len);
+
+ if (sp->sn_text != NULL && cells == 1)
+ STRCPY(sp->sn_text + len - 1, " ");
+ }
+ else if (STRNCMP(arg, "linehl=", 7) == 0)
+ {
+ arg += 7;
+ sp->sn_line_hl = syn_check_group(arg, (int)(p - arg));
+ }
+ else if (STRNCMP(arg, "texthl=", 7) == 0)
+ {
+ arg += 7;
+ sp->sn_text_hl = syn_check_group(arg, (int)(p - arg));
+ }
+ else
+ {
+ EMSG2(_(e_invarg2), arg);
+ return;
+ }
+ }
+ }
+ else if (sp == NULL)
+ EMSG2(_("E155: Unknown sign: %s"), arg);
+ else if (idx == SIGNCMD_LIST)
+ /* ":sign list {name}" */
+ sign_list_defined(sp);
+ else
+ {
+ /* ":sign undefine {name}" */
+ vim_free(sp->sn_name);
+ vim_free(sp->sn_icon);
+#ifdef FEAT_SIGN_ICONS
+ if (sp->sn_image != NULL)
+ {
+ out_flush();
+ gui_mch_destroy_sign(sp->sn_image);
+ }
+#endif
+ vim_free(sp->sn_text);
+ if (sp_prev == NULL)
+ first_sign = sp->sn_next;
+ else
+ sp_prev->sn_next = sp->sn_next;
+ vim_free(sp);
+ }
+ }
+ }
+ else
+ {
+ int id = -1;
+ linenr_T lnum = -1;
+ char_u *sign_name = NULL;
+ char_u *arg1;
+
+ if (*arg == NUL)
+ {
+ if (idx == SIGNCMD_PLACE)
+ {
+ /* ":sign place": list placed signs in all buffers */
+ sign_list_placed(NULL);
+ }
+ else if (idx == SIGNCMD_UNPLACE)
+ {
+ /* ":sign unplace": remove placed sign at cursor */
+ id = buf_findsign_id(curwin->w_buffer, curwin->w_cursor.lnum);
+ if (id > 0)
+ {
+ buf_delsign(curwin->w_buffer, id);
+ update_debug_sign(curwin->w_buffer, curwin->w_cursor.lnum);
+ }
+ else
+ EMSG(_("E159: Missing sign number"));
+ }
+ else
+ EMSG(_(e_argreq));
+ return;
+ }
+
+ if (idx == SIGNCMD_UNPLACE && arg[0] == '*' && arg[1] == NUL)
+ {
+ /* ":sign unplace *": remove all placed signs */
+ buf_delete_all_signs();
+ return;
+ }
+
+ /* first arg could be placed sign id */
+ arg1 = arg;
+ if (VIM_ISDIGIT(*arg))
+ {
+ id = getdigits(&arg);
+ if (!vim_iswhite(*arg) && *arg != NUL)
+ {
+ id = -1;
+ arg = arg1;
+ }
+ else
+ {
+ arg = skipwhite(arg);
+ if (idx == SIGNCMD_UNPLACE && *arg == NUL)
+ {
+ /* ":sign unplace {id}": remove placed sign by number */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if ((lnum = buf_delsign(buf, id)) != 0)
+ update_debug_sign(buf, lnum);
+ return;
+ }
+ }
+ }
+
+ /*
+ * Check for line={lnum} name={name} and file={fname} or buffer={nr}.
+ * Leave "arg" pointing to {fname}.
+ */
+ for (;;)
+ {
+ if (STRNCMP(arg, "line=", 5) == 0)
+ {
+ arg += 5;
+ lnum = atoi((char *)arg);
+ arg = skiptowhite(arg);
+ }
+ else if (STRNCMP(arg, "name=", 5) == 0)
+ {
+ arg += 5;
+ sign_name = arg;
+ arg = skiptowhite(arg);
+ if (*arg != NUL)
+ *arg++ = NUL;
+ }
+ else if (STRNCMP(arg, "file=", 5) == 0)
+ {
+ arg += 5;
+ buf = buflist_findname(arg);
+ break;
+ }
+ else if (STRNCMP(arg, "buffer=", 7) == 0)
+ {
+ arg += 7;
+ buf = buflist_findnr((int)getdigits(&arg));
+ if (*skipwhite(arg) != NUL)
+ EMSG(_(e_trailing));
+ break;
+ }
+ else
+ {
+ EMSG(_(e_invarg));
+ return;
+ }
+ arg = skipwhite(arg);
+ }
+
+ if (buf == NULL)
+ {
+ EMSG2(_("E158: Invalid buffer name: %s"), arg);
+ }
+ else if (id <= 0)
+ {
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+ else
+ /* ":sign place file={fname}": list placed signs in one file */
+ sign_list_placed(buf);
+ }
+ else if (idx == SIGNCMD_JUMP)
+ {
+ /* ":sign jump {id} file={fname}" */
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+ else if ((lnum = buf_findsign(buf, id)) > 0)
+ { /* goto a sign ... */
+ if (buf_jump_open_win(buf) != NULL)
+ { /* ... in a current window */
+ curwin->w_cursor.lnum = lnum;
+ check_cursor_lnum();
+ beginline(BL_WHITE);
+ }
+ else
+ { /* ... not currently in a window */
+ char_u *cmd;
+
+ cmd = alloc((unsigned)STRLEN(buf->b_fname) + 25);
+ if (cmd == NULL)
+ return;
+ sprintf((char *)cmd, "e +%ld %s", (long)lnum, buf->b_fname);
+ do_cmdline_cmd(cmd);
+ vim_free(cmd);
+ }
+#ifdef FEAT_FOLDING
+ foldOpenCursor();
+#endif
+ }
+ else
+ EMSGN(_("E157: Invalid sign ID: %ld"), id);
+ }
+ else if (idx == SIGNCMD_UNPLACE)
+ {
+ /* ":sign unplace {id} file={fname}" */
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+ else
+ {
+ lnum = buf_delsign(buf, id);
+ update_debug_sign(buf, lnum);
+ }
+ }
+ /* idx == SIGNCMD_PLACE */
+ else if (sign_name != NULL)
+ {
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (STRCMP(sp->sn_name, sign_name) == 0)
+ break;
+ if (sp == NULL)
+ {
+ EMSG2(_("E155: Unknown sign: %s"), sign_name);
+ return;
+ }
+ if (lnum > 0)
+ /* ":sign place {id} line={lnum} name={name} file={fname}":
+ * place a sign */
+ buf_addsign(buf, id, lnum, sp->sn_typenr);
+ else
+ /* ":sign place {id} file={fname}": change sign type */
+ lnum = buf_change_sign_type(buf, id, sp->sn_typenr);
+ update_debug_sign(buf, lnum);
+ }
+ else
+ EMSG(_(e_invarg));
+ }
+}
+
+#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+/*
+ * Allocate the icons. Called when the GUI has started. Allows defining
+ * signs before it starts.
+ */
+ void
+sign_gui_started()
+{
+ sign_T *sp;
+
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (sp->sn_icon != NULL)
+ sp->sn_image = gui_mch_register_sign(sp->sn_icon);
+}
+#endif
+
+/*
+ * List one sign.
+ */
+ static void
+sign_list_defined(sp)
+ sign_T *sp;
+{
+ char_u *p;
+
+ smsg((char_u *)"sign %s", sp->sn_name);
+ if (sp->sn_icon != NULL)
+ {
+ MSG_PUTS(" icon=");
+ msg_outtrans(sp->sn_icon);
+#ifdef FEAT_SIGN_ICONS
+ if (sp->sn_image == NULL)
+ MSG_PUTS(_(" (NOT FOUND)"));
+#else
+ MSG_PUTS(_(" (not supported)"));
+#endif
+ }
+ if (sp->sn_text != NULL)
+ {
+ MSG_PUTS(" text=");
+ msg_outtrans(sp->sn_text);
+ }
+ if (sp->sn_line_hl > 0)
+ {
+ MSG_PUTS(" linehl=");
+ p = get_highlight_name(NULL, sp->sn_line_hl - 1);
+ if (p == NULL)
+ MSG_PUTS("NONE");
+ else
+ msg_puts(p);
+ }
+ if (sp->sn_text_hl > 0)
+ {
+ MSG_PUTS(" texthl=");
+ p = get_highlight_name(NULL, sp->sn_text_hl - 1);
+ if (p == NULL)
+ MSG_PUTS("NONE");
+ else
+ msg_puts(p);
+ }
+}
+
+/*
+ * Get highlighting attribute for sign "typenr".
+ * If "line" is TRUE: line highl, if FALSE: text highl.
+ */
+ int
+sign_get_attr(typenr, line)
+ int typenr;
+ int line;
+{
+ sign_T *sp;
+
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (sp->sn_typenr == typenr)
+ {
+ if (line)
+ {
+ if (sp->sn_line_hl > 0)
+ return syn_id2attr(sp->sn_line_hl);
+ }
+ else
+ {
+ if (sp->sn_text_hl > 0)
+ return syn_id2attr(sp->sn_text_hl);
+ }
+ break;
+ }
+ return 0;
+}
+
+/*
+ * Get text mark for sign "typenr".
+ * Returns NULL if there isn't one.
+ */
+ char_u *
+sign_get_text(typenr)
+ int typenr;
+{
+ sign_T *sp;
+
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (sp->sn_typenr == typenr)
+ return sp->sn_text;
+ return NULL;
+}
+
+#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+ void *
+sign_get_image(typenr)
+ int typenr; /* the attribute which may have a sign */
+{
+ sign_T *sp;
+
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (sp->sn_typenr == typenr)
+ return sp->sn_image;
+ return NULL;
+}
+#endif
+
+/*
+ * Get the name of a sign by its typenr.
+ */
+ char_u *
+sign_typenr2name(typenr)
+ int typenr;
+{
+ sign_T *sp;
+
+ for (sp = first_sign; sp != NULL; sp = sp->sn_next)
+ if (sp->sn_typenr == typenr)
+ return sp->sn_name;
+ return (char_u *)_("[Deleted]");
+}
+
+#endif
+
+#if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
+/*
+ * ":drop"
+ * Opens the first argument in a window. When there are two or more arguments
+ * the argument list is redefined.
+ */
+ void
+ex_drop(eap)
+ exarg_T *eap;
+{
+ int split = FALSE;
+ int incurwin = FALSE;
+ char_u *arg;
+ char_u *first = NULL;
+ win_T *wp;
+ buf_T *buf;
+
+ /*
+ * Check if the first argument is already being edited in a window. If
+ * so, jump to that window.
+ * We would actually need to check all arguments, but that's complicated
+ * and mostly only one file is dropped.
+ * This also ignores wildcards, since it is very unlikely the user is
+ * editing a file name with a wildcard character.
+ */
+ arg = vim_strsave(eap->arg);
+ if (arg != NULL)
+ {
+ /* Get the first argument, remove quotes, make it a full path. */
+ first = fix_fname(arg);
+ if (first != NULL)
+ {
+ buf = buflist_findname(first);
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer == buf)
+ {
+ incurwin = TRUE;
+# ifdef FEAT_WINDOWS
+ win_enter(wp, TRUE);
+ break;
+# endif
+ }
+ }
+ vim_free(first);
+
+ if (incurwin)
+ {
+ /* Already editing the file. Redefine the argument list. */
+ set_arglist(eap->arg);
+ curwin->w_arg_idx = 0;
+ vim_free(arg);
+ return;
+ }
+ }
+ vim_free(arg);
+ }
+
+ /*
+ * Check whether the current buffer is changed. If so, we will need
+ * to split the current window or data could be lost.
+ * Skip the check if the 'hidden' option is set, as in this case the
+ * buffer won't be lost.
+ */
+ if (!P_HID(curbuf))
+ {
+# ifdef FEAT_WINDOWS
+ ++emsg_off;
+# endif
+ split = check_changed(curbuf, TRUE, FALSE, FALSE, FALSE);
+# ifdef FEAT_WINDOWS
+ --emsg_off;
+# else
+ if (split)
+ return;
+# endif
+ }
+
+ /* Fake a ":snext" or ":next" command, redefine the arglist. */
+ if (split)
+ {
+ eap->cmdidx = CMD_snext;
+ eap->cmd[0] = 's';
+ }
+ else
+ eap->cmdidx = CMD_next;
+ ex_next(eap);
+}
+#endif
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
new file mode 100644
index 000000000..8ffeadf01
--- /dev/null
+++ b/src/ex_cmds.h
@@ -0,0 +1,961 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * This file defines the Ex commands.
+ * When DO_DECLARE_EXCMD is defined, the table with ex command names and
+ * options results.
+ * When DO_DECLARE_EXCMD is NOT defined, the enum with all the Ex commands
+ * results.
+ * This clever trick was invented by Ron Aaron.
+ */
+
+/*
+ * When adding an Ex command:
+ * 1. Add an entry in the table below. Keep it sorted on the shortest
+ * version of the command name that works. If it doesn't start with a
+ * lower case letter, add it at the end.
+ * 2. Add a "case: CMD_xxx" in the big switch in ex_docmd.c.
+ * 3. Add an entry in the index for Ex commands at ":help ex-cmd-index".
+ * 4. Add documentation in ../doc/xxx.txt. Add a tag for both the short and
+ * long name of the command.
+ */
+
+#ifdef RANGE
+# undef RANGE /* SASC on Amiga defines it */
+#endif
+
+#define RANGE 0x001 /* allow a linespecs */
+#define BANG 0x002 /* allow a ! after the command name */
+#define EXTRA 0x004 /* allow extra args after command name */
+#define XFILE 0x008 /* expand wildcards in extra part */
+#define NOSPC 0x010 /* no spaces allowed in the extra part */
+#define DFLALL 0x020 /* default file range is 1,$ */
+#define WHOLEFOLD 0x040 /* extend range to include whole fold also
+ when less than two numbers given */
+#define NEEDARG 0x080 /* argument required */
+#define TRLBAR 0x100 /* check for trailing vertical bar */
+#define REGSTR 0x200 /* allow "x for register designation */
+#define COUNT 0x400 /* allow count in argument, after command */
+#define NOTRLCOM 0x800 /* no trailing comment allowed */
+#define ZEROR 0x1000 /* zero line number allowed */
+#define USECTRLV 0x2000 /* do not remove CTRL-V from argument */
+#define NOTADR 0x4000 /* number before command is not an address */
+#define EDITCMD 0x8000 /* allow "+command" argument */
+#define BUFNAME 0x10000L /* accepts buffer name */
+#define BUFUNL 0x20000L /* accepts unlisted buffer too */
+#define ARGOPT 0x40000L /* allow "++opt=val" argument */
+#define SBOXOK 0x80000L /* allowed in the sandbox */
+#define CMDWIN 0x100000L /* allowed in cmdline window */
+#define MODIFY 0x200000L /* forbidden in non-'modifiable' buffer */
+#define FILES (XFILE | EXTRA) /* multiple extra files allowed */
+#define WORD1 (EXTRA | NOSPC) /* one extra word allowed */
+#define FILE1 (FILES | NOSPC) /* 1 file allowed, defaults to current file */
+
+#ifndef DO_DECLARE_EXCMD
+typedef struct exarg exarg_T;
+#endif
+
+/*
+ * This array maps ex command names to command codes.
+ * The order in which command names are listed below is significant --
+ * ambiguous abbreviations are always resolved to be the first possible match
+ * (e.g. "r" is taken to mean "read", not "rewind", because "read" comes
+ * before "rewind").
+ * Not supported commands are included to avoid ambiguities.
+ */
+#ifdef EX
+# undef EX /* just in case */
+#endif
+#ifdef DO_DECLARE_EXCMD
+# define EX(a, b, c, d) {(char_u *)b, c, d}
+
+typedef void (*ex_func_T) __ARGS((exarg_T *eap));
+
+static struct cmdname
+{
+ char_u *cmd_name; /* name of the command */
+ ex_func_T cmd_func; /* function for this command */
+ long_u cmd_argt; /* flags declared above */
+}
+# if defined(FEAT_GUI_W16)
+_far
+# endif
+cmdnames[] =
+#else
+# define EX(a, b, c, d) a
+enum CMD_index
+#endif
+{
+EX(CMD_append, "append", ex_append,
+ BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_abbreviate, "abbreviate", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_abclear, "abclear", ex_abclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_aboveleft, "aboveleft", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_all, "all", ex_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_amenu, "amenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_anoremenu, "anoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_args, "args", ex_args,
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_argadd, "argadd", ex_argadd,
+ BANG|NEEDARG|RANGE|NOTADR|COUNT|FILES|TRLBAR),
+EX(CMD_argdelete, "argdelete", ex_argdelete,
+ BANG|RANGE|NOTADR|COUNT|FILES|TRLBAR),
+EX(CMD_argdo, "argdo", ex_listdo,
+ BANG|NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_argedit, "argedit", ex_argedit,
+ BANG|NEEDARG|RANGE|NOTADR|COUNT|FILE1|EDITCMD|TRLBAR),
+EX(CMD_argglobal, "argglobal", ex_args,
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_arglocal, "arglocal", ex_args,
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_argument, "argument", ex_argument,
+ BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_ascii, "ascii", do_ascii,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_autocmd, "autocmd", ex_autocmd,
+ BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_augroup, "augroup", ex_autocmd,
+ BANG|WORD1|TRLBAR|CMDWIN),
+EX(CMD_aunmenu, "aunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_buffer, "buffer", ex_buffer,
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+EX(CMD_bNext, "bNext", ex_bprevious,
+ BANG|RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_ball, "ball", ex_buffer_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_badd, "badd", ex_edit,
+ NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN),
+EX(CMD_bdelete, "bdelete", ex_bunload,
+ BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+EX(CMD_behave, "behave", ex_behave,
+ NEEDARG|WORD1|TRLBAR|CMDWIN),
+EX(CMD_belowright, "belowright", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_bfirst, "bfirst", ex_brewind,
+ BANG|RANGE|NOTADR|TRLBAR),
+EX(CMD_blast, "blast", ex_blast,
+ BANG|RANGE|NOTADR|TRLBAR),
+EX(CMD_bmodified, "bmodified", ex_bmodified,
+ BANG|RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_bnext, "bnext", ex_bnext,
+ BANG|RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_botright, "botright", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_bprevious, "bprevious", ex_bprevious,
+ BANG|RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_brewind, "brewind", ex_brewind,
+ BANG|RANGE|NOTADR|TRLBAR),
+EX(CMD_break, "break", ex_break,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_breakadd, "breakadd", ex_breakadd,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_breakdel, "breakdel", ex_breakdel,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_breaklist, "breaklist", ex_breaklist,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_browse, "browse", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+EX(CMD_buffers, "buffers", buflist_list,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_bufdo, "bufdo", ex_listdo,
+ BANG|NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_bunload, "bunload", ex_bunload,
+ BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+EX(CMD_bwipeout, "bwipeout", ex_bunload,
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+EX(CMD_change, "change", ex_change,
+ BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_cNext, "cNext", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cNfile, "cNfile", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cabbrev, "cabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cabclear, "cabclear", ex_abclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_call, "call", ex_call,
+ RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_catch, "catch", ex_catch,
+ EXTRA|SBOXOK|CMDWIN),
+EX(CMD_cc, "cc", ex_cc,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cclose, "cclose", ex_cclose,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_cd, "cd", ex_cd,
+ FILE1|TRLBAR|CMDWIN),
+EX(CMD_center, "center", ex_align,
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_cfile, "cfile", ex_cfile,
+ TRLBAR|FILE1|BANG),
+EX(CMD_cfirst, "cfirst", ex_cc,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cgetfile, "cgetfile", ex_cfile,
+ TRLBAR|FILE1|BANG),
+EX(CMD_chdir, "chdir", ex_cd,
+ FILE1|TRLBAR|CMDWIN),
+EX(CMD_changes, "changes", ex_changes,
+ TRLBAR|CMDWIN),
+EX(CMD_checkpath, "checkpath", ex_checkpath,
+ TRLBAR|BANG|CMDWIN),
+EX(CMD_checktime, "checktime", ex_checktime,
+ RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+EX(CMD_clist, "clist", qf_list,
+ BANG|EXTRA|TRLBAR|CMDWIN),
+EX(CMD_clast, "clast", ex_cc,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_close, "close", ex_close,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_cmap, "cmap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cmapclear, "cmapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_cmenu, "cmenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cnext, "cnext", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cnewer, "cnewer", qf_age,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_cnfile, "cnfile", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cnoremap, "cnoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cnoreabbrev, "cnoreabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cnoremenu, "cnoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_copy, "copy", ex_copymove,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_colder, "colder", qf_age,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_colorscheme, "colorscheme", ex_colorscheme,
+ NEEDARG|WORD1|TRLBAR|CMDWIN),
+EX(CMD_command, "command", ex_command,
+ EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_comclear, "comclear", ex_comclear,
+ TRLBAR|CMDWIN),
+EX(CMD_compiler, "compiler", ex_compiler,
+ BANG|TRLBAR|WORD1),
+EX(CMD_continue, "continue", ex_continue,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_confirm, "confirm", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+EX(CMD_copen, "copen", ex_copen,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_cprevious, "cprevious", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cpfile, "cpfile", ex_cnext,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cquit, "cquit", ex_cquit,
+ TRLBAR|BANG),
+EX(CMD_crewind, "crewind", ex_cc,
+ RANGE|NOTADR|COUNT|TRLBAR|BANG),
+EX(CMD_cscope, "cscope", do_cscope,
+ EXTRA|NOTRLCOM|SBOXOK|XFILE),
+EX(CMD_cstag, "cstag", do_cstag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_cunmap, "cunmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cunabbrev, "cunabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cunmenu, "cunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_cwindow, "cwindow", ex_cwindow,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_delete, "delete", ex_operators,
+ RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_debug, "debug", ex_debug,
+ NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_debuggreedy, "debuggreedy", ex_debuggreedy,
+ RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN),
+EX(CMD_delcommand, "delcommand", ex_delcommand,
+ NEEDARG|WORD1|TRLBAR|CMDWIN),
+EX(CMD_delfunction, "delfunction", ex_delfunction,
+ NEEDARG|WORD1|CMDWIN),
+EX(CMD_display, "display", ex_display,
+ EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_diffupdate, "diffupdate", ex_diffupdate,
+ TRLBAR),
+EX(CMD_diffget, "diffget", ex_diffgetput,
+ RANGE|EXTRA|TRLBAR|MODIFY),
+EX(CMD_diffpatch, "diffpatch", ex_diffpatch,
+ EXTRA|FILE1|TRLBAR|MODIFY),
+EX(CMD_diffput, "diffput", ex_diffgetput,
+ RANGE|EXTRA|TRLBAR),
+EX(CMD_diffsplit, "diffsplit", ex_diffsplit,
+ EXTRA|FILE1|TRLBAR),
+EX(CMD_diffthis, "diffthis", ex_diffthis,
+ TRLBAR),
+EX(CMD_digraphs, "digraphs", ex_digraphs,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_djump, "djump", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+EX(CMD_dlist, "dlist", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+EX(CMD_doautocmd, "doautocmd", ex_doautocmd,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_doautoall, "doautoall", ex_doautoall,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_drop, "drop", ex_drop,
+ FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR),
+EX(CMD_dsearch, "dsearch", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+EX(CMD_dsplit, "dsplit", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+EX(CMD_edit, "edit", ex_edit,
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_echo, "echo", ex_echo,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_echoerr, "echoerr", ex_execute,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_echohl, "echohl", ex_echohl,
+ EXTRA|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_echomsg, "echomsg", ex_execute,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_echon, "echon", ex_echo,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_else, "else", ex_else,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_elseif, "elseif", ex_else,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_emenu, "emenu", ex_emenu,
+ NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN),
+EX(CMD_endif, "endif", ex_endif,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_endfunction, "endfunction", ex_endfunction,
+ TRLBAR|CMDWIN),
+EX(CMD_endtry, "endtry", ex_endtry,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_endwhile, "endwhile", ex_endwhile,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_enew, "enew", ex_edit,
+ BANG|TRLBAR),
+EX(CMD_ex, "ex", ex_edit,
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_execute, "execute", ex_execute,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_exit, "exit", ex_exit,
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+EX(CMD_file, "file", ex_file,
+ BANG|FILE1|TRLBAR),
+EX(CMD_files, "files", buflist_list,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_filetype, "filetype", ex_filetype,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_find, "find", ex_find,
+ RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_finally, "finally", ex_finally,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_finish, "finish", ex_finish,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_first, "first", ex_rewind,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_fixdel, "fixdel", do_fixdel,
+ TRLBAR|CMDWIN),
+EX(CMD_fold, "fold", ex_fold,
+ RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_foldclose, "foldclose", ex_foldopen,
+ RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_folddoopen, "folddoopen", ex_folddo,
+ RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_folddoclosed, "folddoclosed", ex_folddo,
+ RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_foldopen, "foldopen", ex_foldopen,
+ RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_function, "function", ex_function,
+ EXTRA|BANG|CMDWIN),
+EX(CMD_global, "global", ex_global,
+ RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|CMDWIN),
+EX(CMD_goto, "goto", ex_goto,
+ RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_grep, "grep", ex_make,
+ BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+EX(CMD_grepadd, "grepadd", ex_make,
+ BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+EX(CMD_gui, "gui", ex_gui,
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+EX(CMD_gvim, "gvim", ex_gui,
+ BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+EX(CMD_help, "help", ex_help,
+ BANG|EXTRA|NOTRLCOM),
+EX(CMD_helpfind, "helpfind", ex_helpfind,
+ EXTRA|NOTRLCOM),
+EX(CMD_helpgrep, "helpgrep", ex_helpgrep,
+ EXTRA|NOTRLCOM|NEEDARG),
+EX(CMD_helptags, "helptags", ex_helptags,
+ NEEDARG|FILE1|TRLBAR|CMDWIN),
+EX(CMD_hardcopy, "hardcopy", ex_hardcopy,
+ RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG),
+EX(CMD_highlight, "highlight", ex_highlight,
+ BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_hide, "hide", ex_hide,
+ BANG|EXTRA|NOTRLCOM),
+EX(CMD_history, "history", ex_history,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_insert, "insert", ex_append,
+ BANG|RANGE|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_iabbrev, "iabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_iabclear, "iabclear", ex_abclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_if, "if", ex_if,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_ijump, "ijump", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+EX(CMD_ilist, "ilist", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+EX(CMD_imap, "imap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_imapclear, "imapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_imenu, "imenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_inoremap, "inoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_inoreabbrev, "inoreabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_inoremenu, "inoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_intro, "intro", ex_intro,
+ TRLBAR|CMDWIN),
+EX(CMD_isearch, "isearch", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+EX(CMD_isplit, "isplit", ex_findpat,
+ BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+EX(CMD_iunmap, "iunmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_iunabbrev, "iunabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_iunmenu, "iunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_join, "join", ex_join,
+ BANG|RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_jumps, "jumps", ex_jumps,
+ TRLBAR|CMDWIN),
+EX(CMD_k, "k", ex_mark,
+ RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_keepmarks, "keepmarks", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_keepjumps, "keepjumps", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_list, "list", ex_print,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
+EX(CMD_last, "last", ex_last,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_language, "language", ex_language,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_lcd, "lcd", ex_cd,
+ FILE1|TRLBAR|CMDWIN),
+EX(CMD_lchdir, "lchdir", ex_cd,
+ FILE1|TRLBAR|CMDWIN),
+EX(CMD_left, "left", ex_align,
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_let, "let", ex_let,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_lmap, "lmap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_lmapclear, "lmapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_lnoremap, "lnoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_loadview, "loadview", ex_loadview,
+ FILE1|TRLBAR),
+EX(CMD_loadkeymap, "loadkeymap", ex_loadkeymap,
+ CMDWIN),
+EX(CMD_lockmarks, "lockmarks", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_lunmap, "lunmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_ls, "ls", buflist_list,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_move, "move", ex_copymove,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_mark, "mark", ex_mark,
+ RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_make, "make", ex_make,
+ BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+EX(CMD_map, "map", ex_map,
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_mapclear, "mapclear", ex_mapclear,
+ EXTRA|BANG|TRLBAR|CMDWIN),
+EX(CMD_marks, "marks", do_marks,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_match, "match", ex_match,
+ EXTRA|CMDWIN),
+EX(CMD_menu, "menu", ex_menu,
+ RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_menutranslate, "menutranslate", ex_menutranslate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_messages, "messages", ex_messages,
+ TRLBAR|CMDWIN),
+EX(CMD_mkexrc, "mkexrc", ex_mkrc,
+ BANG|FILE1|TRLBAR|CMDWIN),
+EX(CMD_mksession, "mksession", ex_mkrc,
+ BANG|FILE1|TRLBAR),
+EX(CMD_mkvimrc, "mkvimrc", ex_mkrc,
+ BANG|FILE1|TRLBAR|CMDWIN),
+EX(CMD_mkview, "mkview", ex_mkrc,
+ BANG|FILE1|TRLBAR),
+EX(CMD_mode, "mode", ex_mode,
+ WORD1|TRLBAR|CMDWIN),
+EX(CMD_next, "next", ex_next,
+ RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_new, "new", ex_splitview,
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_nmap, "nmap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_nmapclear, "nmapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_nmenu, "nmenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_nnoremap, "nnoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_nnoremenu, "nnoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_noremap, "noremap", ex_map,
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_nohlsearch, "nohlsearch", ex_nohlsearch,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_noreabbrev, "noreabbrev", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_noremenu, "noremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_normal, "normal", ex_normal,
+ RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN),
+EX(CMD_number, "number", ex_print,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
+EX(CMD_nunmap, "nunmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_nunmenu, "nunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_open, "open", ex_ni,
+ TRLBAR), /* not supported */
+EX(CMD_omap, "omap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_omapclear, "omapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_omenu, "omenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_only, "only", ex_only,
+ BANG|TRLBAR),
+EX(CMD_onoremap, "onoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_onoremenu, "onoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_options, "options", ex_options,
+ TRLBAR),
+EX(CMD_ounmap, "ounmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_ounmenu, "ounmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_print, "print", ex_print,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
+EX(CMD_pclose, "pclose", ex_pclose,
+ BANG|TRLBAR),
+EX(CMD_perl, "perl", ex_perl,
+ RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN),
+EX(CMD_perldo, "perldo", ex_perldo,
+ RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN),
+EX(CMD_pedit, "pedit", ex_pedit,
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_pop, "pop", ex_tag,
+ RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+EX(CMD_popup, "popup", ex_popup,
+ NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN),
+EX(CMD_ppop, "ppop", ex_ptag,
+ RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+EX(CMD_preserve, "preserve", ex_preserve,
+ TRLBAR),
+EX(CMD_previous, "previous", ex_previous,
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_promptfind, "promptfind", gui_mch_find_dialog,
+ EXTRA|NOTRLCOM|CMDWIN),
+EX(CMD_promptrepl, "promptrepl", gui_mch_replace_dialog,
+ EXTRA|NOTRLCOM|CMDWIN),
+EX(CMD_psearch, "psearch", ex_psearch,
+ BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA),
+EX(CMD_ptag, "ptag", ex_ptag,
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+EX(CMD_ptNext, "ptNext", ex_ptag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_ptfirst, "ptfirst", ex_ptag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_ptjump, "ptjump", ex_ptag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_ptlast, "ptlast", ex_ptag,
+ BANG|TRLBAR),
+EX(CMD_ptnext, "ptnext", ex_ptag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_ptprevious, "ptprevious", ex_ptag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_ptrewind, "ptrewind", ex_ptag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_ptselect, "ptselect", ex_ptag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_put, "put", ex_put,
+ RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY),
+EX(CMD_pwd, "pwd", ex_pwd,
+ TRLBAR|CMDWIN),
+EX(CMD_python, "python", ex_python,
+ RANGE|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_pyfile, "pyfile", ex_pyfile,
+ RANGE|FILE1|NEEDARG|CMDWIN),
+EX(CMD_quit, "quit", ex_quit,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_quitall, "quitall", ex_quit_all,
+ BANG|TRLBAR),
+EX(CMD_qall, "qall", ex_quit_all,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_read, "read", ex_read,
+ BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY),
+EX(CMD_recover, "recover", ex_recover,
+ BANG|FILE1|TRLBAR),
+EX(CMD_redo, "redo", ex_redo,
+ TRLBAR|CMDWIN),
+EX(CMD_redir, "redir", ex_redir,
+ BANG|FILES|TRLBAR|CMDWIN),
+EX(CMD_redraw, "redraw", ex_redraw,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_redrawstatus, "redrawstatus", ex_redrawstatus,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_registers, "registers", ex_display,
+ EXTRA|NOTRLCOM|TRLBAR|CMDWIN),
+EX(CMD_resize, "resize", ex_resize,
+ RANGE|NOTADR|TRLBAR|WORD1),
+EX(CMD_retab, "retab", ex_retab,
+ TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY),
+EX(CMD_return, "return", ex_return,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_rewind, "rewind", ex_rewind,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_right, "right", ex_align,
+ TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_rightbelow, "rightbelow", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_runtime, "runtime", ex_runtime,
+ BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_ruby, "ruby", ex_ruby,
+ RANGE|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_rubydo, "rubydo", ex_rubydo,
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_rubyfile, "rubyfile", ex_rubyfile,
+ RANGE|FILE1|NEEDARG|CMDWIN),
+EX(CMD_rviminfo, "rviminfo", ex_viminfo,
+ BANG|FILE1|TRLBAR|CMDWIN),
+EX(CMD_substitute, "substitute", do_sub,
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_sNext, "sNext", ex_previous,
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_sargument, "sargument", ex_argument,
+ BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_sall, "sall", ex_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_saveas, "saveas", ex_write,
+ BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
+EX(CMD_sbuffer, "sbuffer", ex_buffer,
+ BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+EX(CMD_sbNext, "sbNext", ex_bprevious,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_sball, "sball", ex_buffer_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_sbfirst, "sbfirst", ex_brewind,
+ TRLBAR),
+EX(CMD_sblast, "sblast", ex_blast,
+ TRLBAR),
+EX(CMD_sbmodified, "sbmodified", ex_bmodified,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_sbnext, "sbnext", ex_bnext,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_sbprevious, "sbprevious", ex_bprevious,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_sbrewind, "sbrewind", ex_brewind,
+ TRLBAR),
+EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
+ TRLBAR|CMDWIN),
+EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,
+ WORD1|TRLBAR|CMDWIN),
+EX(CMD_scscope, "scscope", do_scscope,
+ EXTRA|NOTRLCOM|SBOXOK),
+EX(CMD_set, "set", ex_set,
+ TRLBAR|EXTRA|CMDWIN|SBOXOK),
+EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
+ TRLBAR|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_setglobal, "setglobal", ex_set,
+ TRLBAR|EXTRA|CMDWIN),
+EX(CMD_setlocal, "setlocal", ex_set,
+ TRLBAR|EXTRA|CMDWIN),
+EX(CMD_sfind, "sfind", ex_splitview,
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_sfirst, "sfirst", ex_rewind,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_shell, "shell", ex_shell,
+ TRLBAR|CMDWIN),
+EX(CMD_simalt, "simalt", ex_simalt,
+ NEEDARG|WORD1|TRLBAR|CMDWIN),
+EX(CMD_sign, "sign", ex_sign,
+ NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN),
+EX(CMD_silent, "silent", ex_wrongmodifier,
+ NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_sleep, "sleep", ex_sleep,
+ RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN),
+EX(CMD_slast, "slast", ex_last,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_smagic, "smagic", ex_submagic,
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_snext, "snext", ex_next,
+ RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_sniff, "sniff", ex_sniff,
+ EXTRA|TRLBAR),
+EX(CMD_snomagic, "snomagic", ex_submagic,
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_source, "source", ex_source,
+ BANG|FILE1|TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_split, "split", ex_splitview,
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_sprevious, "sprevious", ex_previous,
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_srewind, "srewind", ex_rewind,
+ EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_stop, "stop", ex_stop,
+ TRLBAR|BANG|CMDWIN),
+EX(CMD_stag, "stag", ex_stag,
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+EX(CMD_startinsert, "startinsert", ex_startinsert,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_stopinsert, "stopinsert", ex_stopinsert,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_stjump, "stjump", ex_stag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_stselect, "stselect", ex_stag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_sunhide, "sunhide", ex_buffer_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_suspend, "suspend", ex_stop,
+ TRLBAR|BANG|CMDWIN),
+EX(CMD_sview, "sview", ex_splitview,
+ NEEDARG|RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_swapname, "swapname", ex_swapname,
+ TRLBAR|CMDWIN),
+EX(CMD_syntax, "syntax", ex_syntax,
+ EXTRA|NOTRLCOM|CMDWIN),
+EX(CMD_syncbind, "syncbind", ex_syncbind,
+ TRLBAR),
+EX(CMD_t, "t", ex_copymove,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_tNext, "tNext", ex_tag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_tag, "tag", ex_tag,
+ RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+EX(CMD_tags, "tags", do_tags,
+ TRLBAR|CMDWIN),
+EX(CMD_tcl, "tcl", ex_tcl,
+ RANGE|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_tcldo, "tcldo", ex_tcldo,
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+EX(CMD_tclfile, "tclfile", ex_tclfile,
+ RANGE|FILE1|NEEDARG|CMDWIN),
+EX(CMD_tearoff, "tearoff", ex_tearoff,
+ NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN),
+EX(CMD_tfirst, "tfirst", ex_tag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_throw, "throw", ex_throw,
+ EXTRA|NEEDARG|SBOXOK|CMDWIN),
+EX(CMD_tjump, "tjump", ex_tag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_tlast, "tlast", ex_tag,
+ BANG|TRLBAR),
+EX(CMD_tmenu, "tmenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_tnext, "tnext", ex_tag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_topleft, "topleft", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_tprevious, "tprevious", ex_tag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_trewind, "trewind", ex_tag,
+ RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+EX(CMD_try, "try", ex_try,
+ TRLBAR|SBOXOK|CMDWIN),
+EX(CMD_tselect, "tselect", ex_tag,
+ BANG|TRLBAR|WORD1),
+EX(CMD_tunmenu, "tunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_undo, "undo", ex_undo,
+ TRLBAR|CMDWIN),
+EX(CMD_unabbreviate, "unabbreviate", ex_abbreviate,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_unhide, "unhide", ex_buffer_all,
+ RANGE|NOTADR|COUNT|TRLBAR),
+EX(CMD_unlet, "unlet", ex_unlet,
+ BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+EX(CMD_unmap, "unmap", ex_unmap,
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_unmenu, "unmenu", ex_menu,
+ BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_update, "update", ex_update,
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+EX(CMD_vglobal, "vglobal", ex_global,
+ RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN),
+EX(CMD_version, "version", ex_version,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_verbose, "verbose", ex_wrongmodifier,
+ NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_vertical, "vertical", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_visual, "visual", ex_edit,
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_view, "view", ex_edit,
+ BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_vmap, "vmap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_vmapclear, "vmapclear", ex_mapclear,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_vmenu, "vmenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_vnoremap, "vnoremap", ex_map,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_vnew, "vnew", ex_splitview,
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_vnoremenu, "vnoremenu", ex_menu,
+ RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_vsplit, "vsplit", ex_splitview,
+ BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_vunmap, "vunmap", ex_unmap,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_vunmenu, "vunmenu", ex_menu,
+ EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+EX(CMD_write, "write", ex_write,
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+EX(CMD_wNext, "wNext", ex_wnext,
+ RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+EX(CMD_wall, "wall", do_wqall,
+ BANG|TRLBAR|CMDWIN),
+EX(CMD_while, "while", ex_while,
+ EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+EX(CMD_winsize, "winsize", ex_winsize,
+ EXTRA|NEEDARG|TRLBAR),
+EX(CMD_wincmd, "wincmd", ex_wincmd,
+ NEEDARG|WORD1|RANGE|NOTADR),
+EX(CMD_windo, "windo", ex_listdo,
+ BANG|NEEDARG|EXTRA|NOTRLCOM),
+EX(CMD_winpos, "winpos", ex_winpos,
+ EXTRA|TRLBAR|CMDWIN),
+EX(CMD_wnext, "wnext", ex_wnext,
+ RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+EX(CMD_wprevious, "wprevious", ex_wnext,
+ RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+EX(CMD_wq, "wq", ex_exit,
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+EX(CMD_wqall, "wqall", do_wqall,
+ BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+EX(CMD_wsverb, "wsverb", ex_wsverb,
+ EXTRA|NOTADR|NEEDARG),
+EX(CMD_wviminfo, "wviminfo", ex_viminfo,
+ BANG|FILE1|TRLBAR|CMDWIN),
+EX(CMD_xit, "xit", ex_exit,
+ RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+EX(CMD_xall, "xall", do_wqall,
+ BANG|TRLBAR),
+EX(CMD_yank, "yank", ex_operators,
+ RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN),
+EX(CMD_z, "z", ex_z,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+
+/* commands that don't start with a lowercase letter */
+EX(CMD_bang, "!", ex_bang,
+ RANGE|WHOLEFOLD|BANG|FILES|CMDWIN),
+EX(CMD_pound, "#", ex_print,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
+EX(CMD_and, "&", do_sub,
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+EX(CMD_star, "*", ex_at,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+EX(CMD_lshift, "<", ex_operators,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_equal, "=", ex_equal,
+ RANGE|TRLBAR|DFLALL|CMDWIN),
+EX(CMD_rshift, ">", ex_operators,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN|MODIFY),
+EX(CMD_at, "@", ex_at,
+ RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+EX(CMD_Next, "Next", ex_previous,
+ EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+EX(CMD_Print, "Print", ex_print,
+ RANGE|WHOLEFOLD|COUNT|TRLBAR|CMDWIN),
+EX(CMD_X, "X", ex_X,
+ TRLBAR),
+EX(CMD_tilde, "~", do_sub,
+ RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+
+#ifndef DO_DECLARE_EXCMD
+#ifdef FEAT_USR_CMDS
+ CMD_SIZE, /* MUST be after all real commands! */
+ CMD_USER = -1, /* User-defined command */
+ CMD_USER_BUF = -2 /* User-defined command local to buffer */
+#else
+ CMD_SIZE /* MUST be the last one! */
+#endif
+#endif
+};
+
+#define USER_CMDIDX(idx) ((int)(idx) < 0)
+
+#ifndef DO_DECLARE_EXCMD
+typedef enum CMD_index cmdidx_T;
+
+/*
+ * Arguments used for Ex commands.
+ */
+struct exarg
+{
+ char_u *arg; /* argument of the command */
+ char_u *nextcmd; /* next command (NULL if none) */
+ char_u *cmd; /* the name of the command (except for :make) */
+ char_u **cmdlinep; /* pointer to pointer of allocated cmdline */
+ cmdidx_T cmdidx; /* the index for the command */
+ long argt; /* flags for the command */
+ int skip; /* don't execute the command, only parse it */
+ int forceit; /* TRUE if ! present */
+ int addr_count; /* the number of addresses given */
+ linenr_T line1; /* the first line number */
+ linenr_T line2; /* the second line number or count */
+ char_u *do_ecmd_cmd; /* +command arg to be used in edited file */
+ linenr_T do_ecmd_lnum; /* the line number in an edited file */
+ int append; /* TRUE with ":w >>file" command */
+ int usefilter; /* TRUE with ":w !command" and ":r!command" */
+ int amount; /* number of '>' or '<' for shift command */
+ int regname; /* register name (NUL if none) */
+ int force_bin; /* 0, FORCE_BIN or FORCE_NOBIN */
+ int force_ff; /* forced 'fileformat' (index in cmd[]) */
+#ifdef FEAT_MBYTE
+ int force_enc; /* forced 'encoding' (index in cmd[]) */
+#endif
+#ifdef FEAT_USR_CMDS
+ int useridx; /* user command index */
+#endif
+ char_u *errmsg; /* returned error message */
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie; /* argument for getline() */
+#ifdef FEAT_EVAL
+ struct condstack *cstack; /* condition stack for ":if" etc. */
+#endif
+};
+
+#define FORCE_BIN 1 /* ":edit ++bin file" */
+#define FORCE_NOBIN 2 /* ":edit ++nobin file" */
+
+#endif
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
new file mode 100644
index 000000000..8ec8be71a
--- /dev/null
+++ b/src/ex_cmds2.c
@@ -0,0 +1,5711 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ex_cmds2.c: some more functions for command line commands
+ */
+
+#if defined(WIN32) && defined(FEAT_CSCOPE)
+# include <io.h>
+#endif
+
+#include "vim.h"
+
+#if defined(WIN32) && defined(FEAT_CSCOPE)
+# include <fcntl.h>
+#endif
+
+#include "version.h"
+
+static void cmd_source __ARGS((char_u *fname, exarg_T *eap));
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+static int debug_greedy = FALSE; /* batch mode debugging: don't save
+ and restore typeahead. */
+
+/*
+ * do_debug(): Debug mode.
+ * Repeatedly get Ex commands, until told to continue normal execution.
+ */
+ void
+do_debug(cmd)
+ char_u *cmd;
+{
+ int save_msg_scroll = msg_scroll;
+ int save_State = State;
+ int save_did_emsg = did_emsg;
+ int save_cmd_silent = cmd_silent;
+ int save_msg_silent = msg_silent;
+ int save_emsg_silent = emsg_silent;
+ int save_redir_off = redir_off;
+ tasave_T typeaheadbuf;
+# ifdef FEAT_EX_EXTRA
+ int save_ex_normal_busy;
+# endif
+ int n;
+ char_u *cmdline = NULL;
+ char_u *p;
+ char *tail = NULL;
+ static int last_cmd = 0;
+#define CMD_CONT 1
+#define CMD_NEXT 2
+#define CMD_STEP 3
+#define CMD_FINISH 4
+#define CMD_QUIT 5
+#define CMD_INTERRUPT 6
+
+#ifdef ALWAYS_USE_GUI
+ /* Can't do this when there is no terminal for input/output. */
+ if (!gui.in_use)
+ {
+ /* Break as soon as possible. */
+ debug_break_level = 9999;
+ return;
+ }
+#endif
+
+ /* Make sure we are in raw mode and start termcap mode. Might have side
+ * effects... */
+ settmode(TMODE_RAW);
+ starttermcap();
+
+ ++RedrawingDisabled; /* don't redisplay the window */
+ ++no_wait_return; /* don't wait for return */
+ did_emsg = FALSE; /* don't use error from debugged stuff */
+ cmd_silent = FALSE; /* display commands */
+ msg_silent = FALSE; /* display messages */
+ emsg_silent = FALSE; /* display error messages */
+ redir_off = TRUE; /* don't redirect debug commands */
+
+ State = NORMAL;
+#ifdef FEAT_SNIFF
+ want_sniff_request = 0; /* No K_SNIFF wanted */
+#endif
+
+ if (!debug_did_msg)
+ MSG(_("Entering Debug mode. Type \"cont\" to continue."));
+ if (sourcing_name != NULL)
+ msg(sourcing_name);
+ if (sourcing_lnum != 0)
+ smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd);
+ else
+ msg_str((char_u *)_("cmd: %s"), cmd);
+
+ /*
+ * Repeat getting a command and executing it.
+ */
+ for (;;)
+ {
+ msg_scroll = TRUE;
+ need_wait_return = FALSE;
+#ifdef FEAT_SNIFF
+ ProcessSniffRequests();
+#endif
+ /* Save the current typeahead buffer and replace it with an empty one.
+ * This makes sure we get input from the user here and don't interfere
+ * with the commands being executed. Reset "ex_normal_busy" to avoid
+ * the side effects of using ":normal". Save the stuff buffer and make
+ * it empty. */
+# ifdef FEAT_EX_EXTRA
+ save_ex_normal_busy = ex_normal_busy;
+ ex_normal_busy = 0;
+# endif
+ if (!debug_greedy)
+ save_typeahead(&typeaheadbuf);
+
+ cmdline = getcmdline_prompt('>', NULL, 0);
+
+ if (!debug_greedy)
+ restore_typeahead(&typeaheadbuf);
+# ifdef FEAT_EX_EXTRA
+ ex_normal_busy = save_ex_normal_busy;
+# endif
+
+ cmdline_row = msg_row;
+ if (cmdline != NULL)
+ {
+ /* If this is a debug command, set "last_cmd".
+ * If not, reset "last_cmd".
+ * For a blank line use previous command. */
+ p = skipwhite(cmdline);
+ if (*p != NUL)
+ {
+ switch (*p)
+ {
+ case 'c': last_cmd = CMD_CONT;
+ tail = "ont";
+ break;
+ case 'n': last_cmd = CMD_NEXT;
+ tail = "ext";
+ break;
+ case 's': last_cmd = CMD_STEP;
+ tail = "tep";
+ break;
+ case 'f': last_cmd = CMD_FINISH;
+ tail = "inish";
+ break;
+ case 'q': last_cmd = CMD_QUIT;
+ tail = "uit";
+ break;
+ case 'i': last_cmd = CMD_INTERRUPT;
+ tail = "nterrupt";
+ break;
+ default: last_cmd = 0;
+ }
+ if (last_cmd != 0)
+ {
+ /* Check that the tail matches. */
+ ++p;
+ while (*p != NUL && *p == *tail)
+ {
+ ++p;
+ ++tail;
+ }
+ if (ASCII_ISALPHA(*p))
+ last_cmd = 0;
+ }
+ }
+
+ if (last_cmd != 0)
+ {
+ /* Execute debug command: decided where to break next and
+ * return. */
+ switch (last_cmd)
+ {
+ case CMD_CONT:
+ debug_break_level = -1;
+ break;
+ case CMD_NEXT:
+ debug_break_level = ex_nesting_level;
+ break;
+ case CMD_STEP:
+ debug_break_level = 9999;
+ break;
+ case CMD_FINISH:
+ debug_break_level = ex_nesting_level - 1;
+ break;
+ case CMD_QUIT:
+ got_int = TRUE;
+ debug_break_level = -1;
+ break;
+ case CMD_INTERRUPT:
+ got_int = TRUE;
+ debug_break_level = 9999;
+ /* Do not repeat ">interrupt" cmd, continue stepping. */
+ last_cmd = CMD_STEP;
+ break;
+ }
+ break;
+ }
+
+ /* don't debug this command */
+ n = debug_break_level;
+ debug_break_level = -1;
+ (void)do_cmdline(cmdline, getexline, NULL,
+ DOCMD_VERBOSE|DOCMD_EXCRESET);
+ debug_break_level = n;
+
+ vim_free(cmdline);
+ }
+ lines_left = Rows - 1;
+ }
+ vim_free(cmdline);
+
+ --RedrawingDisabled;
+ --no_wait_return;
+ redraw_all_later(NOT_VALID);
+ need_wait_return = FALSE;
+ msg_scroll = save_msg_scroll;
+ lines_left = Rows - 1;
+ State = save_State;
+ did_emsg = save_did_emsg;
+ cmd_silent = save_cmd_silent;
+ msg_silent = save_msg_silent;
+ emsg_silent = save_emsg_silent;
+ redir_off = save_redir_off;
+
+ /* Only print the message again when typing a command before coming back
+ * here. */
+ debug_did_msg = TRUE;
+}
+
+/*
+ * ":debug".
+ */
+ void
+ex_debug(eap)
+ exarg_T *eap;
+{
+ int debug_break_level_save = debug_break_level;
+
+ debug_break_level = 9999;
+ do_cmdline_cmd(eap->arg);
+ debug_break_level = debug_break_level_save;
+}
+
+static char_u *debug_breakpoint_name = NULL;
+static linenr_T debug_breakpoint_lnum;
+
+/*
+ * When debugging or a breakpoint is set on a skipped command, no debug prompt
+ * is shown by do_one_cmd(). This situation is indicated by debug_skipped, and
+ * debug_skipped_name is then set to the source name in the breakpoint case. If
+ * a skipped command decides itself that a debug prompt should be displayed, it
+ * can do so by calling dbg_check_skipped().
+ */
+static int debug_skipped;
+static char_u *debug_skipped_name;
+
+/*
+ * Go to debug mode when a breakpoint was encountered or "ex_nesting_level" is
+ * at or below the break level. But only when the line is actually
+ * executed. Return TRUE and set breakpoint_name for skipped commands that
+ * decide to execute something themselves.
+ * Called from do_one_cmd() before executing a command.
+ */
+ void
+dbg_check_breakpoint(eap)
+ exarg_T *eap;
+{
+ char_u *p;
+
+ debug_skipped = FALSE;
+ if (debug_breakpoint_name != NULL)
+ {
+ if (!eap->skip)
+ {
+ /* replace K_SNR with "<SNR>" */
+ if (debug_breakpoint_name[0] == K_SPECIAL
+ && debug_breakpoint_name[1] == KS_EXTRA
+ && debug_breakpoint_name[2] == (int)KE_SNR)
+ p = (char_u *)"<SNR>";
+ else
+ p = (char_u *)"";
+ smsg((char_u *)_("Breakpoint in \"%s%s\" line %ld"), p,
+ debug_breakpoint_name + (*p == NUL ? 0 : 3),
+ (long)debug_breakpoint_lnum);
+ debug_breakpoint_name = NULL;
+ do_debug(eap->cmd);
+ }
+ else
+ {
+ debug_skipped = TRUE;
+ debug_skipped_name = debug_breakpoint_name;
+ debug_breakpoint_name = NULL;
+ }
+ }
+ else if (ex_nesting_level <= debug_break_level)
+ {
+ if (!eap->skip)
+ do_debug(eap->cmd);
+ else
+ {
+ debug_skipped = TRUE;
+ debug_skipped_name = NULL;
+ }
+ }
+}
+
+/*
+ * Go to debug mode if skipped by dbg_check_breakpoint() because eap->skip was
+ * set. Return TRUE when the debug mode is entered this time.
+ */
+ int
+dbg_check_skipped(eap)
+ exarg_T *eap;
+{
+ int prev_got_int;
+
+ if (debug_skipped)
+ {
+ /*
+ * Save the value of got_int and reset it. We don't want a previous
+ * interruption cause flushing the input buffer.
+ */
+ prev_got_int = got_int;
+ got_int = FALSE;
+ debug_breakpoint_name = debug_skipped_name;
+ /* eap->skip is TRUE */
+ eap->skip = FALSE;
+ (void)dbg_check_breakpoint(eap);
+ eap->skip = TRUE;
+ got_int |= prev_got_int;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * The list of breakpoints: dbg_breakp.
+ * This is a grow-array of structs.
+ */
+struct debuggy
+{
+ int dbg_nr; /* breakpoint number */
+ int dbg_type; /* DBG_FUNC or DBG_FILE */
+ char_u *dbg_name; /* function or file name */
+ regprog_T *dbg_prog; /* regexp program */
+ linenr_T dbg_lnum; /* line number in function or file */
+};
+
+static garray_T dbg_breakp = {0, 0, sizeof(struct debuggy), 4, NULL};
+#define BREAKP(idx) (((struct debuggy *)dbg_breakp.ga_data)[idx])
+static int last_breakp = 0; /* nr of last defined breakpoint */
+
+#define DBG_FUNC 1
+#define DBG_FILE 2
+
+static int dbg_parsearg __ARGS((char_u *arg));
+
+/*
+ * Parse the arguments of ":breakadd" or ":breakdel" and put them in the entry
+ * just after the last one in dbg_breakp. Note that "dbg_name" is allocated.
+ * Returns FAIL for failure.
+ */
+ static int
+dbg_parsearg(arg)
+ char_u *arg;
+{
+ char_u *p = arg;
+ char_u *q;
+ struct debuggy *bp;
+
+ if (ga_grow(&dbg_breakp, 1) == FAIL)
+ return FAIL;
+ bp = &BREAKP(dbg_breakp.ga_len);
+
+ /* Find "func" or "file". */
+ if (STRNCMP(p, "func", 4) == 0)
+ bp->dbg_type = DBG_FUNC;
+ else if (STRNCMP(p, "file", 4) == 0)
+ bp->dbg_type = DBG_FILE;
+ else
+ {
+ EMSG2(_(e_invarg2), p);
+ return FAIL;
+ }
+ p = skipwhite(p + 4);
+
+ /* Find optional line number. */
+ if (VIM_ISDIGIT(*p))
+ {
+ bp->dbg_lnum = getdigits(&p);
+ p = skipwhite(p);
+ }
+ else
+ bp->dbg_lnum = 0;
+
+ /* Find the function or file name. Don't accept a function name with (). */
+ if (*p == NUL
+ || (bp->dbg_type == DBG_FUNC && strstr((char *)p, "()") != NULL))
+ {
+ EMSG2(_(e_invarg2), arg);
+ return FAIL;
+ }
+
+ if (bp->dbg_type == DBG_FUNC)
+ bp->dbg_name = vim_strsave(p);
+ else
+ {
+ /* Expand the file name in the same way as do_source(). This means
+ * doing it twice, so that $DIR/file gets expanded when $DIR is
+ * "~/dir". */
+#ifdef RISCOS
+ q = mch_munge_fname(p);
+#else
+ q = expand_env_save(p);
+#endif
+ if (q == NULL)
+ return FAIL;
+#ifdef RISCOS
+ p = mch_munge_fname(q);
+#else
+ p = expand_env_save(q);
+#endif
+ vim_free(q);
+ if (p == NULL)
+ return FAIL;
+ bp->dbg_name = fix_fname(p);
+ vim_free(p);
+#ifdef MACOS_CLASSIC
+ if (bp->dbg_name != NULL)
+ slash_n_colon_adjust(bp->dbg_name);
+#endif
+ }
+
+ if (bp->dbg_name == NULL)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * ":breakadd".
+ */
+ void
+ex_breakadd(eap)
+ exarg_T *eap;
+{
+ struct debuggy *bp;
+ char_u *pat;
+
+ if (dbg_parsearg(eap->arg) == OK)
+ {
+ bp = &BREAKP(dbg_breakp.ga_len);
+ pat = file_pat_to_reg_pat(bp->dbg_name, NULL, NULL, FALSE);
+ if (pat != NULL)
+ {
+ bp->dbg_prog = vim_regcomp(pat, RE_MAGIC + RE_STRING);
+ vim_free(pat);
+ }
+ if (pat == NULL || bp->dbg_prog == NULL)
+ vim_free(bp->dbg_name);
+ else
+ {
+ if (bp->dbg_lnum == 0) /* default line number is 1 */
+ bp->dbg_lnum = 1;
+ BREAKP(dbg_breakp.ga_len++).dbg_nr = ++last_breakp;
+ --dbg_breakp.ga_room;
+ ++debug_tick;
+ }
+ }
+}
+
+/*
+ * ":debuggreedy".
+ */
+ void
+ex_debuggreedy(eap)
+ exarg_T *eap;
+{
+ if (eap->addr_count == 0 || eap->line2 != 0)
+ debug_greedy = TRUE;
+ else
+ debug_greedy = FALSE;
+}
+
+/*
+ * ":breakdel".
+ */
+ void
+ex_breakdel(eap)
+ exarg_T *eap;
+{
+ struct debuggy *bp, *bpi;
+ int nr;
+ int todel = -1;
+ int i;
+ linenr_T best_lnum = 0;
+
+ if (vim_isdigit(*eap->arg))
+ {
+ /* ":breakdel {nr}" */
+ nr = atol((char *)eap->arg);
+ for (i = 0; i < dbg_breakp.ga_len; ++i)
+ if (BREAKP(i).dbg_nr == nr)
+ {
+ todel = i;
+ break;
+ }
+ }
+ else
+ {
+ /* ":breakdel {func|file} [lnum] {name}" */
+ if (dbg_parsearg(eap->arg) == FAIL)
+ return;
+ bp = &BREAKP(dbg_breakp.ga_len);
+ for (i = 0; i < dbg_breakp.ga_len; ++i)
+ {
+ bpi = &BREAKP(i);
+ if (bp->dbg_type == bpi->dbg_type
+ && STRCMP(bp->dbg_name, bpi->dbg_name) == 0
+ && (bp->dbg_lnum == bpi->dbg_lnum
+ || (bp->dbg_lnum == 0
+ && (best_lnum == 0
+ || bpi->dbg_lnum < best_lnum))))
+ {
+ todel = i;
+ best_lnum = bpi->dbg_lnum;
+ }
+ }
+ vim_free(bp->dbg_name);
+ }
+
+ if (todel < 0)
+ EMSG2(_("E161: Breakpoint not found: %s"), eap->arg);
+ else
+ {
+ vim_free(BREAKP(todel).dbg_name);
+ vim_free(BREAKP(todel).dbg_prog);
+ --dbg_breakp.ga_len;
+ ++dbg_breakp.ga_room;
+ if (todel < dbg_breakp.ga_len)
+ mch_memmove(&BREAKP(todel), &BREAKP(todel + 1),
+ (dbg_breakp.ga_len - todel) * sizeof(struct debuggy));
+ ++debug_tick;
+ }
+}
+
+/*
+ * ":breaklist".
+ */
+/*ARGSUSED*/
+ void
+ex_breaklist(eap)
+ exarg_T *eap;
+{
+ struct debuggy *bp;
+ int i;
+
+ if (dbg_breakp.ga_len == 0)
+ MSG(_("No breakpoints defined"));
+ else
+ for (i = 0; i < dbg_breakp.ga_len; ++i)
+ {
+ bp = &BREAKP(i);
+ smsg((char_u *)_("%3d %s %s line %ld"),
+ bp->dbg_nr,
+ bp->dbg_type == DBG_FUNC ? "func" : "file",
+ bp->dbg_name,
+ (long)bp->dbg_lnum);
+ }
+}
+
+/*
+ * Find a breakpoint for a function or sourced file.
+ * Returns line number at which to break; zero when no matching breakpoint.
+ */
+ linenr_T
+dbg_find_breakpoint(file, fname, after)
+ int file; /* TRUE for a file, FALSE for a function */
+ char_u *fname; /* file or function name */
+ linenr_T after; /* after this line number */
+{
+ struct debuggy *bp;
+ int i;
+ linenr_T lnum = 0;
+ regmatch_T regmatch;
+ char_u *name = fname;
+ int prev_got_int;
+
+ /* Replace K_SNR in function name with "<SNR>". */
+ if (!file && fname[0] == K_SPECIAL)
+ {
+ name = alloc((unsigned)STRLEN(fname) + 3);
+ if (name == NULL)
+ name = fname;
+ else
+ {
+ STRCPY(name, "<SNR>");
+ STRCPY(name + 5, fname + 3);
+ }
+ }
+
+ for (i = 0; i < dbg_breakp.ga_len; ++i)
+ {
+ /* skip entries that are not useful or are for a line that is beyond
+ * an already found breakpoint */
+ bp = &BREAKP(i);
+ if ((bp->dbg_type == DBG_FILE) == file
+ && bp->dbg_lnum > after
+ && (lnum == 0 || bp->dbg_lnum < lnum))
+ {
+ regmatch.regprog = bp->dbg_prog;
+ regmatch.rm_ic = FALSE;
+ /*
+ * Save the value of got_int and reset it. We don't want a previous
+ * interruption cancel matching, only hitting CTRL-C while matching
+ * should abort it.
+ */
+ prev_got_int = got_int;
+ got_int = FALSE;
+ if (vim_regexec(&regmatch, name, (colnr_T)0))
+ lnum = bp->dbg_lnum;
+ got_int |= prev_got_int;
+ }
+ }
+ if (name != fname)
+ vim_free(name);
+
+ return lnum;
+}
+
+/*
+ * Called when a breakpoint was encountered.
+ */
+ void
+dbg_breakpoint(name, lnum)
+ char_u *name;
+ linenr_T lnum;
+{
+ /* We need to check if this line is actually executed in do_one_cmd() */
+ debug_breakpoint_name = name;
+ debug_breakpoint_lnum = lnum;
+}
+#endif
+
+/*
+ * If 'autowrite' option set, try to write the file.
+ * Careful: autocommands may make "buf" invalid!
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+autowrite(buf, forceit)
+ buf_T *buf;
+ int forceit;
+{
+ if (!(p_aw || p_awa) || !p_write
+#ifdef FEAT_QUICKFIX
+ /* never autowrite a "nofile" or "nowrite" buffer */
+ || bt_dontwrite(buf)
+#endif
+ || (!forceit && buf->b_p_ro) || buf->b_ffname == NULL)
+ return FAIL;
+ return buf_write_all(buf, forceit);
+}
+
+/*
+ * flush all buffers, except the ones that are readonly
+ */
+ void
+autowrite_all()
+{
+ buf_T *buf;
+
+ if (!(p_aw || p_awa) || !p_write)
+ return;
+ for (buf = firstbuf; buf; buf = buf->b_next)
+ if (bufIsChanged(buf) && !buf->b_p_ro)
+ {
+ (void)buf_write_all(buf, FALSE);
+#ifdef FEAT_AUTOCMD
+ /* an autocommand may have deleted the buffer */
+ if (!buf_valid(buf))
+ buf = firstbuf;
+#endif
+ }
+}
+
+/*
+ * return TRUE if buffer was changed and cannot be abandoned.
+ */
+/*ARGSUSED*/
+ int
+check_changed(buf, checkaw, mult_win, forceit, allbuf)
+ buf_T *buf;
+ int checkaw; /* do autowrite if buffer was changed */
+ int mult_win; /* check also when several wins for the buf */
+ int forceit;
+ int allbuf; /* may write all buffers */
+{
+ if ( !forceit
+ && bufIsChanged(buf)
+ && (mult_win || buf->b_nwindows <= 1)
+ && (!checkaw || autowrite(buf, forceit) == FAIL))
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && p_write)
+ {
+ buf_T *buf2;
+ int count = 0;
+
+ if (allbuf)
+ for (buf2 = firstbuf; buf2 != NULL; buf2 = buf2->b_next)
+ if (bufIsChanged(buf2)
+ && (buf2->b_ffname != NULL
+# ifdef FEAT_BROWSE
+ || cmdmod.browse
+# endif
+ ))
+ ++count;
+# ifdef FEAT_AUTOCMD
+ if (!buf_valid(buf))
+ /* Autocommand deleted buffer, oops! It's not changed now. */
+ return FALSE;
+# endif
+ dialog_changed(buf, count > 1);
+# ifdef FEAT_AUTOCMD
+ if (!buf_valid(buf))
+ /* Autocommand deleted buffer, oops! It's not changed now. */
+ return FALSE;
+# endif
+ return bufIsChanged(buf);
+ }
+#endif
+ EMSG(_(e_nowrtmsg));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
+
+#if defined(FEAT_BROWSE) || defined(PROTO)
+/*
+ * When wanting to write a file without a file name, ask the user for a name.
+ */
+ void
+browse_save_fname(buf)
+ buf_T *buf;
+{
+ if (buf->b_fname == NULL)
+ {
+ char_u *fname;
+
+ fname = do_browse(TRUE, (char_u *)_("Save As"), NULL, NULL, NULL,
+ NULL, buf);
+ if (fname != NULL)
+ {
+ if (setfname(buf, fname, NULL, TRUE) == OK)
+ buf->b_flags |= BF_NOTEDITED;
+ vim_free(fname);
+ }
+ }
+}
+#endif
+
+/*
+ * Ask the user what to do when abondoning a changed buffer.
+ * Must check 'write' option first!
+ */
+ void
+dialog_changed(buf, checkall)
+ buf_T *buf;
+ int checkall; /* may abandon all changed buffers */
+{
+ char_u buff[IOSIZE];
+ int ret;
+ buf_T *buf2;
+
+ dialog_msg(buff, _("Save changes to \"%.*s\"?"),
+ (buf->b_fname != NULL) ?
+ buf->b_fname : (char_u *)_("Untitled"));
+ if (checkall)
+ ret = vim_dialog_yesnoallcancel(VIM_QUESTION, NULL, buff, 1);
+ else
+ ret = vim_dialog_yesnocancel(VIM_QUESTION, NULL, buff, 1);
+
+ if (ret == VIM_YES)
+ {
+#ifdef FEAT_BROWSE
+ /* May get file name, when there is none */
+ browse_save_fname(buf);
+#endif
+ if (buf->b_fname != NULL) /* didn't hit Cancel */
+ (void)buf_write_all(buf, FALSE);
+ }
+ else if (ret == VIM_NO)
+ {
+ unchanged(buf, TRUE);
+ }
+ else if (ret == VIM_ALL)
+ {
+ /*
+ * Write all modified files that can be written.
+ * Skip readonly buffers, these need to be confirmed
+ * individually.
+ */
+ for (buf2 = firstbuf; buf2 != NULL; buf2 = buf2->b_next)
+ {
+ if (bufIsChanged(buf2)
+ && (buf2->b_ffname != NULL
+#ifdef FEAT_BROWSE
+ || cmdmod.browse
+#endif
+ )
+ && !buf2->b_p_ro)
+ {
+#ifdef FEAT_BROWSE
+ /* May get file name, when there is none */
+ browse_save_fname(buf2);
+#endif
+ if (buf2->b_fname != NULL) /* didn't hit Cancel */
+ (void)buf_write_all(buf2, FALSE);
+#ifdef FEAT_AUTOCMD
+ /* an autocommand may have deleted the buffer */
+ if (!buf_valid(buf2))
+ buf2 = firstbuf;
+#endif
+ }
+ }
+ }
+ else if (ret == VIM_DISCARDALL)
+ {
+ /*
+ * mark all buffers as unchanged
+ */
+ for (buf2 = firstbuf; buf2 != NULL; buf2 = buf2->b_next)
+ unchanged(buf2, TRUE);
+ }
+}
+#endif
+
+/*
+ * Return TRUE if the buffer "buf" can be abandoned, either by making it
+ * hidden, autowriting it or unloading it.
+ */
+ int
+can_abandon(buf, forceit)
+ buf_T *buf;
+ int forceit;
+{
+ return ( P_HID(buf)
+ || !bufIsChanged(buf)
+ || buf->b_nwindows > 1
+ || autowrite(buf, forceit) == OK
+ || forceit);
+}
+
+/*
+ * Return TRUE if any buffer was changed and cannot be abandoned.
+ * That changed buffer becomes the current buffer.
+ */
+ int
+check_changed_any(hidden)
+ int hidden; /* Only check hidden buffers */
+{
+ buf_T *buf;
+ int save;
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+#endif
+
+ for (;;)
+ {
+ /* check curbuf first: if it was changed we can't abandon it */
+ if (!hidden && curbufIsChanged())
+ buf = curbuf;
+ else
+ {
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if ((!hidden || buf->b_nwindows == 0) && bufIsChanged(buf))
+ break;
+ }
+ if (buf == NULL) /* No buffers changed */
+ return FALSE;
+
+ if (check_changed(buf, p_awa, TRUE, FALSE, TRUE) && buf_valid(buf))
+ break; /* didn't save - still changes */
+ }
+
+ exiting = FALSE;
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ /*
+ * When ":confirm" used, don't give an error message.
+ */
+ if (!(p_confirm || cmdmod.confirm))
+#endif
+ {
+ /* There must be a wait_return for this message, do_buffer()
+ * may cause a redraw. But wait_return() is a no-op when vgetc()
+ * is busy (Quit used from window menu), then make sure we don't
+ * cause a scroll up. */
+ if (vgetc_busy)
+ {
+ msg_row = cmdline_row;
+ msg_col = 0;
+ msg_didout = FALSE;
+ }
+ if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
+ buf_spname(buf) != NULL ? (char_u *)buf_spname(buf) :
+ buf->b_fname))
+ {
+ save = no_wait_return;
+ no_wait_return = FALSE;
+ wait_return(FALSE);
+ no_wait_return = save;
+ }
+ }
+
+#ifdef FEAT_WINDOWS
+ /* Try to find a window that contains the buffer. */
+ if (buf != curbuf)
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer == buf)
+ {
+ win_goto(wp);
+# ifdef FEAT_AUTOCMD
+ /* Paranoia: did autocms wipe out the buffer with changes? */
+ if (!buf_valid(buf))
+ return TRUE;
+# endif
+ break;
+ }
+#endif
+
+ /* Open the changed buffer in the current window. */
+ if (buf != curbuf)
+ set_curbuf(buf, DOBUF_GOTO);
+
+ return TRUE;
+}
+
+/*
+ * return FAIL if there is no file name, OK if there is one
+ * give error message for FAIL
+ */
+ int
+check_fname()
+{
+ if (curbuf->b_ffname == NULL)
+ {
+ EMSG(_(e_noname));
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * flush the contents of a buffer, unless it has no file name
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+buf_write_all(buf, forceit)
+ buf_T *buf;
+ int forceit;
+{
+ int retval;
+#ifdef FEAT_AUTOCMD
+ buf_T *old_curbuf = curbuf;
+#endif
+
+ retval = (buf_write(buf, buf->b_ffname, buf->b_fname,
+ (linenr_T)1, buf->b_ml.ml_line_count, NULL,
+ FALSE, forceit, TRUE, FALSE));
+#ifdef FEAT_AUTOCMD
+ if (curbuf != old_curbuf)
+ MSG(_("Warning: Entered other buffer unexpectedly (check autocommands)"));
+#endif
+ return retval;
+}
+
+/*
+ * Code to handle the argument list.
+ */
+
+/*
+ * Isolate one argument, taking quotes and backticks.
+ * Changes the argument in-place, puts a NUL after it.
+ * Quotes are removed, backticks remain.
+ * Return a pointer to the start of the next argument.
+ */
+ char_u *
+do_one_arg(str)
+ char_u *str;
+{
+ char_u *p;
+ int inquote;
+ int inbacktick;
+
+ inquote = FALSE;
+ inbacktick = FALSE;
+ for (p = str; *str; ++str)
+ {
+ /*
+ * for MSDOS et.al. a backslash is part of a file name.
+ * Only skip ", space and tab.
+ */
+ if (rem_backslash(str))
+ {
+ *p++ = *str++;
+ *p++ = *str;
+ }
+ else
+ {
+ /* An item ends at a space not in quotes or backticks */
+ if (!inquote && !inbacktick && vim_isspace(*str))
+ break;
+ if (!inquote && *str == '`')
+ inbacktick ^= TRUE;
+ if (!inbacktick && *str == '"')
+ inquote ^= TRUE;
+ else
+ *p++ = *str;
+ }
+ }
+ str = skipwhite(str);
+ *p = NUL;
+
+ return str;
+}
+
+static int do_arglist __ARGS((char_u *str, int what, int after));
+static void alist_check_arg_idx __ARGS((void));
+#ifdef FEAT_LISTCMDS
+static int alist_add_list __ARGS((int count, char_u **files, int after));
+#endif
+#define AL_SET 1
+#define AL_ADD 2
+#define AL_DEL 3
+
+#if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
+/*
+ * Redefine the argument list.
+ */
+ void
+set_arglist(str)
+ char_u *str;
+{
+ do_arglist(str, AL_SET, 0);
+}
+#endif
+
+/*
+ * "what" == AL_SET: Redefine the argument list to 'str'.
+ * "what" == AL_ADD: add files in 'str' to the argument list after "after".
+ * "what" == AL_DEL: remove files in 'str' from the argument list.
+ *
+ * Return FAIL for failure, OK otherwise.
+ */
+/*ARGSUSED*/
+ static int
+do_arglist(str, what, after)
+ char_u *str;
+ int what;
+ int after; /* 0 means before first one */
+{
+ garray_T new_ga;
+ int exp_count;
+ char_u **exp_files;
+ int i;
+#ifdef FEAT_LISTCMDS
+ char_u *p;
+ int match;
+#endif
+
+ /*
+ * Collect all file name arguments in "new_ga".
+ */
+ ga_init2(&new_ga, (int)sizeof(char_u *), 20);
+ while (*str)
+ {
+ if (ga_grow(&new_ga, 1) == FAIL)
+ {
+ ga_clear(&new_ga);
+ return FAIL;
+ }
+ ((char_u **)new_ga.ga_data)[new_ga.ga_len++] = str;
+ --new_ga.ga_room;
+
+ /* Isolate one argument, change it in-place, put a NUL after it. */
+ str = do_one_arg(str);
+ }
+
+#ifdef FEAT_LISTCMDS
+ if (what == AL_DEL)
+ {
+ regmatch_T regmatch;
+ int didone;
+
+ /*
+ * Delete the items: use each item as a regexp and find a match in the
+ * argument list.
+ */
+#ifdef CASE_INSENSITIVE_FILENAME
+ regmatch.rm_ic = TRUE; /* Always ignore case */
+#else
+ regmatch.rm_ic = FALSE; /* Never ignore case */
+#endif
+ for (i = 0; i < new_ga.ga_len && !got_int; ++i)
+ {
+ p = ((char_u **)new_ga.ga_data)[i];
+ p = file_pat_to_reg_pat(p, NULL, NULL, FALSE);
+ if (p == NULL)
+ break;
+ regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
+ if (regmatch.regprog == NULL)
+ {
+ vim_free(p);
+ break;
+ }
+
+ didone = FALSE;
+ for (match = 0; match < ARGCOUNT; ++match)
+ if (vim_regexec(&regmatch, alist_name(&ARGLIST[match]),
+ (colnr_T)0))
+ {
+ didone = TRUE;
+ vim_free(ARGLIST[match].ae_fname);
+ mch_memmove(ARGLIST + match, ARGLIST + match + 1,
+ (ARGCOUNT - match - 1) * sizeof(aentry_T));
+ --ALIST(curwin)->al_ga.ga_len;
+ ++ALIST(curwin)->al_ga.ga_room;
+ if (curwin->w_arg_idx > match)
+ --curwin->w_arg_idx;
+ --match;
+ }
+
+ vim_free(regmatch.regprog);
+ vim_free(p);
+ if (!didone)
+ EMSG2(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]);
+ }
+ ga_clear(&new_ga);
+ }
+ else
+#endif
+ {
+ i = expand_wildcards(new_ga.ga_len, (char_u **)new_ga.ga_data,
+ &exp_count, &exp_files, EW_DIR|EW_FILE|EW_ADDSLASH|EW_NOTFOUND);
+ ga_clear(&new_ga);
+ if (i == FAIL)
+ return FAIL;
+ if (exp_count == 0)
+ {
+ EMSG(_(e_nomatch));
+ return FAIL;
+ }
+
+#ifdef FEAT_LISTCMDS
+ if (what == AL_ADD)
+ {
+ (void)alist_add_list(exp_count, exp_files, after);
+ vim_free(exp_files);
+ }
+ else /* what == AL_SET */
+#endif
+ alist_set(ALIST(curwin), exp_count, exp_files, FALSE);
+ }
+
+ alist_check_arg_idx();
+
+ return OK;
+}
+
+/*
+ * Check the validity of the arg_idx for each other window.
+ */
+ static void
+alist_check_arg_idx()
+{
+#ifdef FEAT_WINDOWS
+ win_T *win;
+
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (win->w_alist == curwin->w_alist)
+ check_arg_idx(win);
+#else
+ check_arg_idx(curwin);
+#endif
+}
+
+/*
+ * Check if window "win" is editing the w_arg_idx file in its argument list.
+ */
+ void
+check_arg_idx(win)
+ win_T *win;
+{
+ if (WARGCOUNT(win) > 1
+ && (win->w_arg_idx >= WARGCOUNT(win)
+ || (win->w_buffer->b_fnum
+ != WARGLIST(win)[win->w_arg_idx].ae_fnum
+ && (win->w_buffer->b_ffname == NULL
+ || !(fullpathcmp(
+ alist_name(&WARGLIST(win)[win->w_arg_idx]),
+ win->w_buffer->b_ffname, TRUE) & FPC_SAME)))))
+ {
+ /* We are not editing the current entry in the argument list.
+ * Set "arg_had_last" if we are editing the last one. */
+ win->w_arg_idx_invalid = TRUE;
+ if (win->w_arg_idx != WARGCOUNT(win) - 1
+ && arg_had_last == FALSE
+#ifdef FEAT_WINDOWS
+ && ALIST(win) == &global_alist
+#endif
+ && GARGCOUNT > 0
+ && win->w_arg_idx < GARGCOUNT
+ && (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
+ || (win->w_buffer->b_ffname != NULL
+ && (fullpathcmp(alist_name(&GARGLIST[GARGCOUNT - 1]),
+ win->w_buffer->b_ffname, TRUE) & FPC_SAME))))
+ arg_had_last = TRUE;
+ }
+ else
+ {
+ /* We are editing the current entry in the argument list.
+ * Set "arg_had_last" if it's also the last one */
+ win->w_arg_idx_invalid = FALSE;
+ if (win->w_arg_idx == WARGCOUNT(win) - 1
+#ifdef FEAT_WINDOWS
+ && win->w_alist == &global_alist
+#endif
+ )
+ arg_had_last = TRUE;
+ }
+}
+
+/*
+ * ":args", ":argslocal" and ":argsglobal".
+ */
+ void
+ex_args(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ if (eap->cmdidx != CMD_args)
+ {
+#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+ alist_unlink(ALIST(curwin));
+ if (eap->cmdidx == CMD_argglobal)
+ ALIST(curwin) = &global_alist;
+ else /* eap->cmdidx == CMD_arglocal */
+ alist_new();
+#else
+ ex_ni(eap);
+ return;
+#endif
+ }
+
+ if (!ends_excmd(*eap->arg))
+ {
+ /*
+ * ":args file ..": define new argument list, handle like ":next"
+ * Also for ":argslocal file .." and ":argsglobal file ..".
+ */
+ ex_next(eap);
+ }
+ else
+#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+ if (eap->cmdidx == CMD_args)
+#endif
+ {
+ /*
+ * ":args": list arguments.
+ */
+ if (ARGCOUNT > 0)
+ {
+ /* Overwrite the command, for a short list there is no scrolling
+ * required and no wait_return(). */
+ gotocmdline(TRUE);
+ for (i = 0; i < ARGCOUNT; ++i)
+ {
+ if (i == curwin->w_arg_idx)
+ msg_putchar('[');
+ msg_outtrans(alist_name(&ARGLIST[i]));
+ if (i == curwin->w_arg_idx)
+ msg_putchar(']');
+ msg_putchar(' ');
+ }
+ }
+ }
+#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
+ else if (eap->cmdidx == CMD_arglocal)
+ {
+ garray_T *gap = &curwin->w_alist->al_ga;
+
+ /*
+ * ":argslocal": make a local copy of the global argument list.
+ */
+ if (ga_grow(gap, GARGCOUNT) == OK)
+ for (i = 0; i < GARGCOUNT; ++i)
+ if (GARGLIST[i].ae_fname != NULL)
+ {
+ AARGLIST(curwin->w_alist)[gap->ga_len].ae_fname =
+ vim_strsave(GARGLIST[i].ae_fname);
+ AARGLIST(curwin->w_alist)[gap->ga_len].ae_fnum =
+ GARGLIST[i].ae_fnum;
+ ++gap->ga_len;
+ --gap->ga_room;
+ }
+ }
+#endif
+}
+
+/*
+ * ":previous", ":sprevious", ":Next" and ":sNext".
+ */
+ void
+ex_previous(eap)
+ exarg_T *eap;
+{
+ /* If past the last one already, go to the last one. */
+ if (curwin->w_arg_idx - (int)eap->line2 >= ARGCOUNT)
+ do_argfile(eap, ARGCOUNT - 1);
+ else
+ do_argfile(eap, curwin->w_arg_idx - (int)eap->line2);
+}
+
+/*
+ * ":rewind", ":first", ":sfirst" and ":srewind".
+ */
+ void
+ex_rewind(eap)
+ exarg_T *eap;
+{
+ do_argfile(eap, 0);
+}
+
+/*
+ * ":last" and ":slast".
+ */
+ void
+ex_last(eap)
+ exarg_T *eap;
+{
+ do_argfile(eap, ARGCOUNT - 1);
+}
+
+/*
+ * ":argument" and ":sargument".
+ */
+ void
+ex_argument(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ if (eap->addr_count > 0)
+ i = eap->line2 - 1;
+ else
+ i = curwin->w_arg_idx;
+ do_argfile(eap, i);
+}
+
+/*
+ * Edit file "argn" of the argument lists.
+ */
+ void
+do_argfile(eap, argn)
+ exarg_T *eap;
+ int argn;
+{
+ int other;
+ char_u *p;
+
+ if (argn < 0 || argn >= ARGCOUNT)
+ {
+ if (ARGCOUNT <= 1)
+ EMSG(_("E163: There is only one file to edit"));
+ else if (argn < 0)
+ EMSG(_("E164: Cannot go before first file"));
+ else
+ EMSG(_("E165: Cannot go beyond last file"));
+ }
+ else
+ {
+ setpcmark();
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+#ifdef FEAT_WINDOWS
+ if (*eap->cmd == 's') /* split window first */
+ {
+ if (win_split(0, 0) == FAIL)
+ return;
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ }
+ else
+#endif
+ {
+ /*
+ * if 'hidden' set, only check for changed file when re-editing
+ * the same buffer
+ */
+ other = TRUE;
+ if (P_HID(curbuf))
+ {
+ p = fix_fname(alist_name(&ARGLIST[argn]));
+ other = otherfile(p);
+ vim_free(p);
+ }
+ if ((!P_HID(curbuf) || !other)
+ && check_changed(curbuf, TRUE, !other, eap->forceit, FALSE))
+ return;
+ }
+
+ curwin->w_arg_idx = argn;
+ if (argn == ARGCOUNT - 1
+#ifdef FEAT_WINDOWS
+ && curwin->w_alist == &global_alist
+#endif
+ )
+ arg_had_last = TRUE;
+
+ /* Edit the file; always use the last known line number. */
+ (void)do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
+ eap, ECMD_LAST,
+ (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) +
+ (eap->forceit ? ECMD_FORCEIT : 0));
+
+ /* like Vi: set the mark where the cursor is in the file. */
+ if (eap->cmdidx != CMD_argdo)
+ setmark('\'');
+ }
+}
+
+/*
+ * ":next", and commands that behave like it.
+ */
+ void
+ex_next(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ /*
+ * check for changed buffer now, if this fails the argument list is not
+ * redefined.
+ */
+ if ( P_HID(curbuf)
+ || eap->cmdidx == CMD_snext
+ || !check_changed(curbuf, TRUE, FALSE, eap->forceit, FALSE))
+ {
+ if (*eap->arg != NUL) /* redefine file list */
+ {
+ if (do_arglist(eap->arg, AL_SET, 0) == FAIL)
+ return;
+ i = 0;
+ }
+ else
+ i = curwin->w_arg_idx + (int)eap->line2;
+ do_argfile(eap, i);
+ }
+}
+
+#ifdef FEAT_LISTCMDS
+/*
+ * ":argedit"
+ */
+ void
+ex_argedit(eap)
+ exarg_T *eap;
+{
+ int fnum;
+ int i;
+ char_u *s;
+
+ /* Add the argument to the buffer list and get the buffer number. */
+ fnum = buflist_add(eap->arg, BLN_LISTED);
+
+ /* Check if this argument is already in the argument list. */
+ for (i = 0; i < ARGCOUNT; ++i)
+ if (ARGLIST[i].ae_fnum == fnum)
+ break;
+ if (i == ARGCOUNT)
+ {
+ /* Can't find it, add it to the argument list. */
+ s = vim_strsave(eap->arg);
+ if (s == NULL)
+ return;
+ i = alist_add_list(1, &s,
+ eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1);
+ if (i < 0)
+ return;
+ curwin->w_arg_idx = i;
+ }
+
+ alist_check_arg_idx();
+
+ /* Edit the argument. */
+ do_argfile(eap, i);
+}
+
+/*
+ * ":argadd"
+ */
+ void
+ex_argadd(eap)
+ exarg_T *eap;
+{
+ do_arglist(eap->arg, AL_ADD,
+ eap->addr_count > 0 ? (int)eap->line2 : curwin->w_arg_idx + 1);
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+}
+
+/*
+ * ":argdelete"
+ */
+ void
+ex_argdelete(eap)
+ exarg_T *eap;
+{
+ int i;
+ int n;
+
+ if (eap->addr_count > 0)
+ {
+ /* ":1,4argdel": Delete all arguments in the range. */
+ if (eap->line2 > ARGCOUNT)
+ eap->line2 = ARGCOUNT;
+ n = eap->line2 - eap->line1 + 1;
+ if (*eap->arg != NUL || n <= 0)
+ EMSG(_(e_invarg));
+ else
+ {
+ for (i = eap->line1; i <= eap->line2; ++i)
+ vim_free(ARGLIST[i - 1].ae_fname);
+ mch_memmove(ARGLIST + eap->line1 - 1, ARGLIST + eap->line2,
+ (size_t)((ARGCOUNT - eap->line2) * sizeof(aentry_T)));
+ ALIST(curwin)->al_ga.ga_len -= n;
+ ALIST(curwin)->al_ga.ga_room += n;
+ if (curwin->w_arg_idx >= eap->line2)
+ curwin->w_arg_idx -= n;
+ else if (curwin->w_arg_idx > eap->line1)
+ curwin->w_arg_idx = eap->line1;
+ }
+ }
+ else if (*eap->arg == NUL)
+ EMSG(_(e_argreq));
+ else
+ do_arglist(eap->arg, AL_DEL, 0);
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+}
+
+/*
+ * ":argdo", ":windo", ":bufdo"
+ */
+ void
+ex_listdo(eap)
+ exarg_T *eap;
+{
+ int i;
+#ifdef FEAT_WINDOWS
+ win_T *win;
+#endif
+ buf_T *buf;
+ int next_fnum = 0;
+#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ char_u *save_ei = NULL;
+ char_u *new_ei;
+#endif
+
+#ifndef FEAT_WINDOWS
+ if (eap->cmdidx == CMD_windo)
+ {
+ ex_ni(eap);
+ return;
+ }
+#endif
+
+#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ if (eap->cmdidx != CMD_windo)
+ {
+ /* Add "Syntax" to 'eventignore' to skip loading syntax highlighting
+ * for every buffer loaded into the window. A considerable speed
+ * improvement. */
+ save_ei = vim_strsave(p_ei);
+ if (save_ei != NULL)
+ {
+ new_ei = vim_strnsave(p_ei, (int)STRLEN(p_ei) + 8);
+ if (new_ei != NULL)
+ {
+ STRCAT(new_ei, ",Syntax");
+ set_string_option_direct((char_u *)"ei", -1, new_ei, OPT_FREE);
+ vim_free(new_ei);
+ }
+ }
+ }
+#endif
+
+ if (eap->cmdidx == CMD_windo
+ || P_HID(curbuf)
+ || !check_changed(curbuf, TRUE, FALSE, eap->forceit, FALSE))
+ {
+ /* start at the first argument/window/buffer */
+ i = 0;
+#ifdef FEAT_WINDOWS
+ win = firstwin;
+#endif
+ /* set pcmark now */
+ if (eap->cmdidx == CMD_bufdo)
+ goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+ else
+ setpcmark();
+ listcmd_busy = TRUE; /* avoids setting pcmark below */
+
+ while (!got_int)
+ {
+ if (eap->cmdidx == CMD_argdo)
+ {
+ /* go to argument "i" */
+ if (i == ARGCOUNT)
+ break;
+ /* Don't call do_argfile() when already there, it will try
+ * reloading the file. */
+ if (curwin->w_arg_idx != i)
+ do_argfile(eap, i);
+ if (curwin->w_arg_idx != i)
+ break;
+ ++i;
+ }
+#ifdef FEAT_WINDOWS
+ else if (eap->cmdidx == CMD_windo)
+ {
+ /* go to window "win" */
+ if (!win_valid(win))
+ break;
+ win_goto(win);
+ win = win->w_next;
+ }
+#endif
+ else if (eap->cmdidx == CMD_bufdo)
+ {
+ /* Remember the number of the next listed buffer, in case
+ * ":bwipe" is used or autocommands do something strange. */
+ next_fnum = -1;
+ for (buf = curbuf->b_next; buf != NULL; buf = buf->b_next)
+ if (buf->b_p_bl)
+ {
+ next_fnum = buf->b_fnum;
+ break;
+ }
+ }
+
+ /* execute the command */
+ do_cmdline(eap->arg, eap->getline, eap->cookie,
+ DOCMD_VERBOSE + DOCMD_NOWAIT);
+
+ if (eap->cmdidx == CMD_bufdo)
+ {
+ /* Done? */
+ if (next_fnum < 0)
+ break;
+ /* Check if the buffer still exists. */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_fnum == next_fnum)
+ break;
+ if (buf == NULL)
+ break;
+ goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum);
+ /* If autocommands took us elsewhere, quit here */
+ if (curbuf->b_fnum != next_fnum)
+ break;
+ }
+
+ if (eap->cmdidx == CMD_windo)
+ {
+ validate_cursor(); /* cursor may have moved */
+#ifdef FEAT_SCROLLBIND
+ /* required when 'scrollbind' has been set */
+ if (curwin->w_p_scb)
+ do_check_scrollbind(TRUE);
+#endif
+ }
+ }
+ listcmd_busy = FALSE;
+ }
+
+#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+ if (save_ei != NULL)
+ {
+ set_string_option_direct((char_u *)"ei", -1, save_ei, OPT_FREE);
+ apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
+ curbuf->b_fname, TRUE, curbuf);
+ vim_free(save_ei);
+ }
+#endif
+}
+
+/*
+ * Add files[count] to the arglist of the current window after arg "after".
+ * The file names in files[count] must have been allocated and are taken over.
+ * Files[] itself is not taken over.
+ * Returns index of first added argument. Returns -1 when failed (out of mem).
+ */
+ static int
+alist_add_list(count, files, after)
+ int count;
+ char_u **files;
+ int after; /* where to add: 0 = before first one */
+{
+ int i;
+
+ if (ga_grow(&ALIST(curwin)->al_ga, count) == OK)
+ {
+ if (after < 0)
+ after = 0;
+ if (after > ARGCOUNT)
+ after = ARGCOUNT;
+ if (after < ARGCOUNT)
+ mch_memmove(&(ARGLIST[after + count]), &(ARGLIST[after]),
+ (ARGCOUNT - after) * sizeof(aentry_T));
+ for (i = 0; i < count; ++i)
+ {
+ ARGLIST[after + i].ae_fname = files[i];
+ ARGLIST[after + i].ae_fnum = buflist_add(files[i], BLN_LISTED);
+ }
+ ALIST(curwin)->al_ga.ga_len += count;
+ ALIST(curwin)->al_ga.ga_room -= count;
+ if (curwin->w_arg_idx >= after)
+ ++curwin->w_arg_idx;
+ return after;
+ }
+
+ for (i = 0; i < count; ++i)
+ vim_free(files[i]);
+ return -1;
+}
+
+#endif /* FEAT_LISTCMDS */
+
+#ifdef FEAT_EVAL
+/*
+ * ":compiler[!] {name}"
+ */
+ void
+ex_compiler(eap)
+ exarg_T *eap;
+{
+ char_u *buf;
+ char_u *old_cur_comp = NULL;
+ char_u *p;
+
+ if (*eap->arg == NUL)
+ {
+ /* List all compiler scripts. */
+ do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')");
+ /* ) keep the indenter happy... */
+ }
+ else
+ {
+ buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
+ if (buf != NULL)
+ {
+ if (eap->forceit)
+ {
+ /* ":compiler! {name}" sets global options */
+ do_cmdline_cmd((char_u *)
+ "command -nargs=* CompilerSet set <args>");
+ }
+ else
+ {
+ /* ":compiler! {name}" sets local options.
+ * To remain backwards compatible "current_compiler" is always
+ * used. A user's compiler plugin may set it, the distributed
+ * plugin will then skip the settings. Afterwards set
+ * "b:current_compiler" and restore "current_compiler". */
+ old_cur_comp = get_var_value((char_u *)"current_compiler");
+ if (old_cur_comp != NULL)
+ old_cur_comp = vim_strsave(old_cur_comp);
+ do_cmdline_cmd((char_u *)
+ "command -nargs=* CompilerSet setlocal <args>");
+ }
+ do_unlet((char_u *)"current_compiler");
+ do_unlet((char_u *)"b:current_compiler");
+
+ sprintf((char *)buf, "compiler/%s.vim", eap->arg);
+ if (cmd_runtime(buf, TRUE) == FAIL)
+ EMSG2(_("E666: compiler not supported: %s"), eap->arg);
+ vim_free(buf);
+
+ do_cmdline_cmd((char_u *)":delcommand CompilerSet");
+
+ /* Set "b:current_compiler" from "current_compiler". */
+ p = get_var_value((char_u *)"current_compiler");
+ if (p != NULL)
+ set_internal_string_var((char_u *)"b:current_compiler", p);
+
+ /* Restore "current_compiler" for ":compiler {name}". */
+ if (!eap->forceit)
+ {
+ if (old_cur_comp != NULL)
+ {
+ set_internal_string_var((char_u *)"current_compiler",
+ old_cur_comp);
+ vim_free(old_cur_comp);
+ }
+ else
+ do_unlet((char_u *)"current_compiler");
+ }
+ }
+ }
+}
+#endif
+
+/*
+ * ":runtime {name}"
+ */
+ void
+ex_runtime(eap)
+ exarg_T *eap;
+{
+ cmd_runtime(eap->arg, eap->forceit);
+}
+
+static void source_callback __ARGS((char_u *fname));
+
+ static void
+source_callback(fname)
+ char_u *fname;
+{
+ (void)do_source(fname, FALSE, FALSE);
+}
+
+/*
+ * Source the file "name" from all directories in 'runtimepath'.
+ * "name" can contain wildcards.
+ * When "all" is TRUE, source all files, otherwise only the first one.
+ * return FAIL when no file could be sourced, OK otherwise.
+ */
+ int
+cmd_runtime(name, all)
+ char_u *name;
+ int all;
+{
+ return do_in_runtimepath(name, all, source_callback);
+}
+
+/*
+ * Find "name" in 'runtimepath'. When found, call the "callback" function for
+ * it.
+ * When "all" is TRUE repeat for all matches, otherwise only the first one is
+ * used.
+ * Returns OK when at least one match found, FAIL otherwise.
+ */
+ int
+do_in_runtimepath(name, all, callback)
+ char_u *name;
+ int all;
+ void (*callback)__ARGS((char_u *fname));
+{
+ char_u *rtp;
+ char_u *np;
+ char_u *buf;
+ char_u *rtp_copy;
+ char_u *tail;
+ int num_files;
+ char_u **files;
+ int i;
+ int did_one = FALSE;
+#ifdef AMIGA
+ struct Process *proc = (struct Process *)FindTask(0L);
+ APTR save_winptr = proc->pr_WindowPtr;
+
+ /* Avoid a requester here for a volume that doesn't exist. */
+ proc->pr_WindowPtr = (APTR)-1L;
+#endif
+
+ /* Make a copy of 'runtimepath'. Invoking the callback may change the
+ * value. */
+ rtp_copy = vim_strsave(p_rtp);
+ buf = alloc(MAXPATHL);
+ if (buf != NULL && rtp_copy != NULL)
+ {
+ if (p_verbose > 1)
+ smsg((char_u *)_("Searching for \"%s\" in \"%s\""),
+ (char *)name, (char *)p_rtp);
+ /* Loop over all entries in 'runtimepath'. */
+ rtp = rtp_copy;
+ while (*rtp != NUL && (all || !did_one))
+ {
+ /* Copy the path from 'runtimepath' to buf[]. */
+ copy_option_part(&rtp, buf, MAXPATHL, ",");
+ if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL)
+ {
+ add_pathsep(buf);
+ tail = buf + STRLEN(buf);
+
+ /* Loop over all patterns in "name" */
+ np = name;
+ while (*np != NUL && (all || !did_one))
+ {
+ /* Append the pattern from "name" to buf[]. */
+ copy_option_part(&np, tail, (int)(MAXPATHL - (tail - buf)),
+ "\t ");
+
+ if (p_verbose > 2)
+ msg_str((char_u *)_("Searching for \"%s\""), buf);
+
+ /* Expand wildcards, invoke the callback for each match. */
+ if (gen_expand_wildcards(1, &buf, &num_files, &files,
+ EW_FILE) == OK)
+ {
+ for (i = 0; i < num_files; ++i)
+ {
+ (*callback)(files[i]);
+ did_one = TRUE;
+ if (!all)
+ break;
+ }
+ FreeWild(num_files, files);
+ }
+ }
+ }
+ }
+ }
+ vim_free(buf);
+ vim_free(rtp_copy);
+ if (p_verbose > 0 && !did_one)
+ msg_str((char_u *)_("not found in 'runtimepath': \"%s\""), name);
+
+#ifdef AMIGA
+ proc->pr_WindowPtr = save_winptr;
+#endif
+
+ return did_one ? OK : FAIL;
+}
+
+#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD)
+/*
+ * ":options"
+ */
+/*ARGSUSED*/
+ void
+ex_options(eap)
+ exarg_T *eap;
+{
+ cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
+}
+#endif
+
+/*
+ * ":source {fname}"
+ */
+ void
+ex_source(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ char_u *fname = NULL;
+
+ fname = do_browse(FALSE, (char_u *)_("Source Vim script"), eap->arg,
+ NULL, NULL, BROWSE_FILTER_MACROS, NULL);
+ if (fname != NULL)
+ {
+ cmd_source(fname, eap);
+ vim_free(fname);
+ }
+ }
+ else
+#endif
+ cmd_source(eap->arg, eap);
+}
+
+ static void
+cmd_source(fname, eap)
+ char_u *fname;
+ exarg_T *eap;
+{
+ if (*fname == NUL)
+ EMSG(_(e_argreq));
+
+ /* ":source!" read vi commands */
+ else if (eap != NULL && eap->forceit)
+ /* Need to execute the commands directly when:
+ * - ":g" command busy
+ * - after ":argdo", ":windo" or ":bufdo"
+ * - another command follows
+ * - inside a loop
+ */
+ openscript(fname, global_busy || listcmd_busy || eap->nextcmd != NULL
+#ifdef FEAT_EVAL
+ || eap->cstack->cs_idx >= 0
+#endif
+ );
+
+ /* ":source" read ex commands */
+ else if (do_source(fname, FALSE, FALSE) == FAIL)
+ EMSG2(_(e_notopen), fname);
+}
+
+/*
+ * ":source" and associated commands.
+ */
+/*
+ * Structure used to store info for each sourced file.
+ * It is shared between do_source() and getsourceline().
+ * This is required, because it needs to be handed to do_cmdline() and
+ * sourcing can be done recursively.
+ */
+struct source_cookie
+{
+ FILE *fp; /* opened file for sourcing */
+ char_u *nextline; /* if not NULL: line that was read ahead */
+ int finished; /* ":finish" used */
+#if defined (USE_CRNL) || defined (USE_CR)
+ int fileformat; /* EOL_UNKNOWN, EOL_UNIX or EOL_DOS */
+ int error; /* TRUE if LF found after CR-LF */
+#endif
+#ifdef FEAT_EVAL
+ linenr_T breakpoint; /* next line with breakpoint or zero */
+ char_u *fname; /* name of sourced file */
+ int dbg_tick; /* debug_tick when breakpoint was set */
+ int level; /* top nesting level of sourced file */
+#endif
+#ifdef FEAT_MBYTE
+ vimconv_T conv; /* type of conversion */
+#endif
+};
+
+#ifdef FEAT_EVAL
+/*
+ * Return the address holding the next breakpoint line for a source cookie.
+ */
+ linenr_T *
+source_breakpoint(cookie)
+ void *cookie;
+{
+ return &((struct source_cookie *)cookie)->breakpoint;
+}
+
+/*
+ * Return the address holding the debug tick for a source cookie.
+ */
+ int *
+source_dbg_tick(cookie)
+ void *cookie;
+{
+ return &((struct source_cookie *)cookie)->dbg_tick;
+}
+
+/*
+ * Return the nesting level for a source cookie.
+ */
+ int
+source_level(cookie)
+ void *cookie;
+{
+ return ((struct source_cookie *)cookie)->level;
+}
+#endif
+
+static char_u *get_one_sourceline __ARGS((struct source_cookie *sp));
+
+#ifdef FEAT_EVAL
+/* Growarray to store the names of sourced scripts.
+ * For Unix also store the dev/ino, so that we don't have to stat() each
+ * script when going through the list. */
+struct scriptstuff
+{
+ char_u *name;
+# ifdef UNIX
+ int dev;
+ ino_t ino;
+# endif
+};
+static garray_T script_names = {0, 0, sizeof(struct scriptstuff), 4, NULL};
+#define SCRIPT_NAME(id) (((struct scriptstuff *)script_names.ga_data)[(id) - 1].name)
+#define SCRIPT_DEV(id) (((struct scriptstuff *)script_names.ga_data)[(id) - 1].dev)
+#define SCRIPT_INO(id) (((struct scriptstuff *)script_names.ga_data)[(id) - 1].ino)
+#endif
+
+#if defined(WIN32) && defined(FEAT_CSCOPE)
+static FILE *fopen_noinh_readbin __ARGS((char *filename));
+
+/*
+ * Special function to open a file without handle inheritance.
+ */
+ static FILE *
+fopen_noinh_readbin(filename)
+ char *filename;
+{
+ int fd_tmp = open(filename, O_RDONLY | O_BINARY | O_NOINHERIT);
+
+ if (fd_tmp == -1)
+ return NULL;
+ return fdopen(fd_tmp, READBIN);
+}
+#endif
+
+
+/*
+ * do_source: Read the file "fname" and execute its lines as EX commands.
+ *
+ * This function may be called recursively!
+ *
+ * return FAIL if file could not be opened, OK otherwise
+ */
+ int
+do_source(fname, check_other, is_vimrc)
+ char_u *fname;
+ int check_other; /* check for .vimrc and _vimrc */
+ int is_vimrc; /* call vimrc_found() when file exists */
+{
+ struct source_cookie cookie;
+ char_u *save_sourcing_name;
+ linenr_T save_sourcing_lnum;
+ char_u *p;
+ char_u *fname_exp;
+ int retval = FAIL;
+#ifdef FEAT_EVAL
+ scid_T save_current_SID;
+ static scid_T last_current_SID = 0;
+ void *save_funccalp;
+ int save_debug_break_level = debug_break_level;
+# ifdef UNIX
+ struct stat st;
+ int stat_ok;
+# endif
+#endif
+#ifdef STARTUPTIME
+ struct timeval tv_rel;
+ struct timeval tv_start;
+#endif
+
+#ifdef RISCOS
+ p = mch_munge_fname(fname);
+#else
+ p = expand_env_save(fname);
+#endif
+ if (p == NULL)
+ return retval;
+ fname_exp = fix_fname(p);
+ vim_free(p);
+ if (fname_exp == NULL)
+ return retval;
+#ifdef MACOS_CLASSIC
+ slash_n_colon_adjust(fname_exp);
+#endif
+ if (mch_isdir(fname_exp))
+ {
+ msg_str((char_u *)_("Cannot source a directory: \"%s\""), fname);
+ goto theend;
+ }
+
+#if defined(WIN32) && defined(FEAT_CSCOPE)
+ cookie.fp = fopen_noinh_readbin((char *)fname_exp);
+#else
+ cookie.fp = mch_fopen((char *)fname_exp, READBIN);
+#endif
+ if (cookie.fp == NULL && check_other)
+ {
+ /*
+ * Try again, replacing file name ".vimrc" by "_vimrc" or vice versa,
+ * and ".exrc" by "_exrc" or vice versa.
+ */
+ p = gettail(fname_exp);
+ if ((*p == '.' || *p == '_')
+ && (STRICMP(p + 1, "vimrc") == 0
+ || STRICMP(p + 1, "gvimrc") == 0
+ || STRICMP(p + 1, "exrc") == 0))
+ {
+ if (*p == '_')
+ *p = '.';
+ else
+ *p = '_';
+#if defined(WIN32) && defined(FEAT_CSCOPE)
+ cookie.fp = fopen_noinh_readbin((char *)fname_exp);
+#else
+ cookie.fp = mch_fopen((char *)fname_exp, READBIN);
+#endif
+ }
+ }
+
+ if (cookie.fp == NULL)
+ {
+ if (p_verbose > 0)
+ {
+ if (sourcing_name == NULL)
+ msg_str((char_u *)_("could not source \"%s\""), fname);
+ else
+ smsg((char_u *)_("line %ld: could not source \"%s\""),
+ sourcing_lnum, fname);
+ }
+ goto theend;
+ }
+
+ /*
+ * The file exists.
+ * - In verbose mode, give a message.
+ * - For a vimrc file, may want to set 'compatible', call vimrc_found().
+ */
+ if (p_verbose > 1)
+ {
+ if (sourcing_name == NULL)
+ msg_str((char_u *)_("sourcing \"%s\""), fname);
+ else
+ smsg((char_u *)_("line %ld: sourcing \"%s\""),
+ sourcing_lnum, fname);
+ }
+ if (is_vimrc)
+ vimrc_found();
+
+#ifdef USE_CRNL
+ /* If no automatic file format: Set default to CR-NL. */
+ if (*p_ffs == NUL)
+ cookie.fileformat = EOL_DOS;
+ else
+ cookie.fileformat = EOL_UNKNOWN;
+ cookie.error = FALSE;
+#endif
+
+#ifdef USE_CR
+ /* If no automatic file format: Set default to CR. */
+ if (*p_ffs == NUL)
+ cookie.fileformat = EOL_MAC;
+ else
+ cookie.fileformat = EOL_UNKNOWN;
+ cookie.error = FALSE;
+#endif
+
+ cookie.nextline = NULL;
+ cookie.finished = FALSE;
+
+#ifdef FEAT_EVAL
+ /*
+ * Check if this script has a breakpoint.
+ */
+ cookie.breakpoint = dbg_find_breakpoint(TRUE, fname_exp, (linenr_T)0);
+ cookie.fname = fname_exp;
+ cookie.dbg_tick = debug_tick;
+
+ cookie.level = ex_nesting_level;
+#endif
+#ifdef FEAT_MBYTE
+ cookie.conv.vc_type = CONV_NONE; /* no conversion */
+
+ /* Try reading the first few bytes to check for a UTF-8 BOM. */
+ {
+ char_u buf[3];
+
+ if (fread((char *)buf, sizeof(char_u), (size_t)3, cookie.fp)
+ == (size_t)3
+ && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
+ /* Found BOM, setup conversion and skip over it. */
+ convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc);
+ else
+ /* No BOM found, rewind. */
+ fseek(cookie.fp, 0L, SEEK_SET);
+ }
+#endif
+
+ /*
+ * Keep the sourcing name/lnum, for recursive calls.
+ */
+ save_sourcing_name = sourcing_name;
+ sourcing_name = fname_exp;
+ save_sourcing_lnum = sourcing_lnum;
+ sourcing_lnum = 0;
+
+#ifdef STARTUPTIME
+ time_push(&tv_rel, &tv_start);
+#endif
+
+#ifdef FEAT_EVAL
+ /*
+ * Check if this script was sourced before to finds its SID.
+ * If it's new, generate a new SID.
+ */
+ save_current_SID = current_SID;
+# ifdef UNIX
+ stat_ok = (mch_stat((char *)fname_exp, &st) >= 0);
+# endif
+ for (current_SID = script_names.ga_len; current_SID > 0; --current_SID)
+ if (SCRIPT_NAME(current_SID) != NULL
+ && (
+# ifdef UNIX
+ /* compare dev/ino when possible, it catches symbolic
+ * links */
+ (stat_ok && SCRIPT_DEV(current_SID) != -1)
+ ? (SCRIPT_DEV(current_SID) == st.st_dev
+ && SCRIPT_INO(current_SID) == st.st_ino) :
+# endif
+ fnamecmp(SCRIPT_NAME(current_SID), fname_exp) == 0))
+ break;
+ if (current_SID == 0)
+ {
+ current_SID = ++last_current_SID;
+ if (ga_grow(&script_names, (int)(current_SID - script_names.ga_len))
+ == OK)
+ {
+ while (script_names.ga_len < current_SID)
+ {
+ SCRIPT_NAME(script_names.ga_len + 1) = NULL;
+ ++script_names.ga_len;
+ --script_names.ga_room;
+ }
+ SCRIPT_NAME(current_SID) = fname_exp;
+# ifdef UNIX
+ if (stat_ok)
+ {
+ SCRIPT_DEV(current_SID) = st.st_dev;
+ SCRIPT_INO(current_SID) = st.st_ino;
+ }
+ else
+ SCRIPT_DEV(current_SID) = -1;
+# endif
+ fname_exp = NULL;
+ }
+ /* Allocate the local script variables to use for this script. */
+ new_script_vars(current_SID);
+ }
+
+ /* Don't use local function variables, if called from a function */
+ save_funccalp = save_funccal();
+#endif
+
+ /*
+ * Call do_cmdline, which will call getsourceline() to get the lines.
+ */
+ do_cmdline(NULL, getsourceline, (void *)&cookie,
+ DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT);
+
+ retval = OK;
+ fclose(cookie.fp);
+ vim_free(cookie.nextline);
+#ifdef FEAT_MBYTE
+ convert_setup(&cookie.conv, NULL, NULL);
+#endif
+
+ if (got_int)
+ EMSG(_(e_interr));
+ sourcing_name = save_sourcing_name;
+ sourcing_lnum = save_sourcing_lnum;
+#ifdef FEAT_EVAL
+ current_SID = save_current_SID;
+ restore_funccal(save_funccalp);
+#endif
+ if (p_verbose > 1)
+ {
+ msg_str((char_u *)_("finished sourcing %s"), fname);
+ if (sourcing_name != NULL)
+ msg_str((char_u *)_("continuing in %s"), sourcing_name);
+ }
+#ifdef STARTUPTIME
+# ifdef HAVE_SNPRINTF
+ snprintf(IObuff, IOSIZE, "sourcing %s", fname);
+# else
+ sprintf(IObuff, "sourcing %s", fname);
+# endif
+ time_msg(IObuff, &tv_start);
+ time_pop(&tv_rel);
+#endif
+
+#ifdef FEAT_EVAL
+ /*
+ * After a "finish" in debug mode, need to break at first command of next
+ * sourced file.
+ */
+ if (save_debug_break_level > ex_nesting_level
+ && debug_break_level == ex_nesting_level)
+ ++debug_break_level;
+#endif
+
+theend:
+ vim_free(fname_exp);
+ return retval;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * ":scriptnames"
+ */
+/*ARGSUSED*/
+ void
+ex_scriptnames(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ for (i = 1; i <= script_names.ga_len && !got_int; ++i)
+ if (SCRIPT_NAME(i) != NULL)
+ smsg((char_u *)"%3d: %s", i, SCRIPT_NAME(i));
+}
+
+# if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
+/*
+ * Fix slashes in the list of script names for 'shellslash'.
+ */
+ void
+scriptnames_slash_adjust()
+{
+ int i;
+
+ for (i = 1; i <= script_names.ga_len; ++i)
+ if (SCRIPT_NAME(i) != NULL)
+ slash_adjust(SCRIPT_NAME(i));
+}
+# endif
+
+/*
+ * Get a pointer to a script name. Used for ":verbose set".
+ */
+ char_u *
+get_scriptname(id)
+ scid_T id;
+{
+ if (id == SID_MODELINE)
+ return (char_u *)"modeline";
+ if (id == SID_CMDARG)
+ return (char_u *)"--cmd argument";
+ if (id == SID_CARG)
+ return (char_u *)"-c argument";
+ if (id == SID_ENV)
+ return (char_u *)"environment variable";
+ return SCRIPT_NAME(id);
+}
+#endif
+
+#if defined(USE_CR) || defined(PROTO)
+
+# if defined(__MSL__) && (__MSL__ >= 22)
+/*
+ * Newer version of the Metrowerks library handle DOS and UNIX files
+ * without help.
+ * Test with earlier versions, MSL 2.2 is the library supplied with
+ * Codewarrior Pro 2.
+ */
+ char *
+fgets_cr(s, n, stream)
+ char *s;
+ int n;
+ FILE *stream;
+{
+ return fgets(s, n, stream);
+}
+# else
+/*
+ * Version of fgets() which also works for lines ending in a <CR> only
+ * (Macintosh format).
+ * For older versions of the Metrowerks library.
+ * At least CodeWarrior 9 needed this code.
+ */
+ char *
+fgets_cr(s, n, stream)
+ char *s;
+ int n;
+ FILE *stream;
+{
+ int c = 0;
+ int char_read = 0;
+
+ while (!feof(stream) && c != '\r' && c != '\n' && char_read < n - 1)
+ {
+ c = fgetc(stream);
+ s[char_read++] = c;
+ /* If the file is in DOS format, we need to skip a NL after a CR. I
+ * thought it was the other way around, but this appears to work... */
+ if (c == '\n')
+ {
+ c = fgetc(stream);
+ if (c != '\r')
+ ungetc(c, stream);
+ }
+ }
+
+ s[char_read] = 0;
+ if (char_read == 0)
+ return NULL;
+
+ if (feof(stream) && char_read == 1)
+ return NULL;
+
+ return s;
+}
+# endif
+#endif
+
+/*
+ * Get one full line from a sourced file.
+ * Called by do_cmdline() when it's called from do_source().
+ *
+ * Return a pointer to the line in allocated memory.
+ * Return NULL for end-of-file or some error.
+ */
+/* ARGSUSED */
+ char_u *
+getsourceline(c, cookie, indent)
+ int c; /* not used */
+ void *cookie;
+ int indent; /* not used */
+{
+ struct source_cookie *sp = (struct source_cookie *)cookie;
+ char_u *line;
+ char_u *p, *s;
+
+#ifdef FEAT_EVAL
+ /* If breakpoints have been added/deleted need to check for it. */
+ if (sp->dbg_tick < debug_tick)
+ {
+ sp->breakpoint = dbg_find_breakpoint(TRUE, sp->fname, sourcing_lnum);
+ sp->dbg_tick = debug_tick;
+ }
+#endif
+ /*
+ * Get current line. If there is a read-ahead line, use it, otherwise get
+ * one now.
+ */
+ if (sp->finished)
+ line = NULL;
+ else if (sp->nextline == NULL)
+ line = get_one_sourceline(sp);
+ else
+ {
+ line = sp->nextline;
+ sp->nextline = NULL;
+ ++sourcing_lnum;
+ }
+
+ /* Only concatenate lines starting with a \ when 'cpoptions' doesn't
+ * contain the 'C' flag. */
+ if (line != NULL && (vim_strchr(p_cpo, CPO_CONCAT) == NULL))
+ {
+ /* compensate for the one line read-ahead */
+ --sourcing_lnum;
+ for (;;)
+ {
+ sp->nextline = get_one_sourceline(sp);
+ if (sp->nextline == NULL)
+ break;
+ p = skipwhite(sp->nextline);
+ if (*p != '\\')
+ break;
+ s = alloc((int)(STRLEN(line) + STRLEN(p)));
+ if (s == NULL) /* out of memory */
+ break;
+ STRCPY(s, line);
+ STRCAT(s, p + 1);
+ vim_free(line);
+ line = s;
+ vim_free(sp->nextline);
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ if (line != NULL && sp->conv.vc_type != CONV_NONE)
+ {
+ /* Convert the encoding of the script line. */
+ s = string_convert(&sp->conv, line, NULL);
+ if (s != NULL)
+ {
+ vim_free(line);
+ line = s;
+ }
+ }
+#endif
+
+#ifdef FEAT_EVAL
+ /* Did we encounter a breakpoint? */
+ if (sp->breakpoint != 0 && sp->breakpoint <= sourcing_lnum)
+ {
+ dbg_breakpoint(sp->fname, sourcing_lnum);
+ /* Find next breakpoint. */
+ sp->breakpoint = dbg_find_breakpoint(TRUE, sp->fname, sourcing_lnum);
+ sp->dbg_tick = debug_tick;
+ }
+#endif
+
+ return line;
+}
+
+ static char_u *
+get_one_sourceline(sp)
+ struct source_cookie *sp;
+{
+ garray_T ga;
+ int len;
+ int c;
+ char_u *buf;
+#ifdef USE_CRNL
+ int has_cr; /* CR-LF found */
+#endif
+#ifdef USE_CR
+ char_u *scan;
+#endif
+ int have_read = FALSE;
+
+ /* use a growarray to store the sourced line */
+ ga_init2(&ga, 1, 200);
+
+ /*
+ * Loop until there is a finished line (or end-of-file).
+ */
+ sourcing_lnum++;
+ for (;;)
+ {
+ /* make room to read at least 80 (more) characters */
+ if (ga_grow(&ga, 80) == FAIL)
+ break;
+ buf = (char_u *)ga.ga_data;
+
+#ifdef USE_CR
+ if (sp->fileformat == EOL_MAC)
+ {
+ if (fgets_cr((char *)buf + ga.ga_len, ga.ga_room, sp->fp) == NULL)
+ break;
+ }
+ else
+#endif
+ if (fgets((char *)buf + ga.ga_len, ga.ga_room, sp->fp) == NULL)
+ break;
+ len = (int)STRLEN(buf);
+#ifdef USE_CRNL
+ /* Ignore a trailing CTRL-Z, when in Dos mode. Only recognize the
+ * CTRL-Z by its own, or after a NL. */
+ if ( (len == 1 || (len >= 2 && buf[len - 2] == '\n'))
+ && sp->fileformat == EOL_DOS
+ && buf[len - 1] == Ctrl_Z)
+ {
+ buf[len - 1] = NUL;
+ break;
+ }
+#endif
+
+#ifdef USE_CR
+ /* If the read doesn't stop on a new line, and there's
+ * some CR then we assume a Mac format */
+ if (sp->fileformat == EOL_UNKNOWN)
+ {
+ if (buf[len - 1] != '\n' && vim_strchr(buf, '\r') != NULL)
+ sp->fileformat = EOL_MAC;
+ else
+ sp->fileformat = EOL_UNIX;
+ }
+
+ if (sp->fileformat == EOL_MAC)
+ {
+ scan = vim_strchr(buf, '\r');
+
+ if (scan != NULL)
+ {
+ *scan = '\n';
+ if (*(scan + 1) != 0)
+ {
+ *(scan + 1) = 0;
+ fseek(sp->fp, (long)(scan - buf - len + 1), SEEK_CUR);
+ }
+ }
+ len = STRLEN(buf);
+ }
+#endif
+
+ have_read = TRUE;
+ ga.ga_room -= len - ga.ga_len;
+ ga.ga_len = len;
+
+ /* If the line was longer than the buffer, read more. */
+ if (ga.ga_room == 1 && buf[len - 1] != '\n')
+ continue;
+
+ if (len >= 1 && buf[len - 1] == '\n') /* remove trailing NL */
+ {
+#ifdef USE_CRNL
+ has_cr = (len >= 2 && buf[len - 2] == '\r');
+ if (sp->fileformat == EOL_UNKNOWN)
+ {
+ if (has_cr)
+ sp->fileformat = EOL_DOS;
+ else
+ sp->fileformat = EOL_UNIX;
+ }
+
+ if (sp->fileformat == EOL_DOS)
+ {
+ if (has_cr) /* replace trailing CR */
+ {
+ buf[len - 2] = '\n';
+ --len;
+ --ga.ga_len;
+ ++ga.ga_room;
+ }
+ else /* lines like ":map xx yy^M" will have failed */
+ {
+ if (!sp->error)
+ EMSG(_("W15: Warning: Wrong line separator, ^M may be missing"));
+ sp->error = TRUE;
+ sp->fileformat = EOL_UNIX;
+ }
+ }
+#endif
+ /* The '\n' is escaped if there is an odd number of ^V's just
+ * before it, first set "c" just before the 'V's and then check
+ * len&c parities (is faster than ((len-c)%2 == 0)) -- Acevedo */
+ for (c = len - 2; c >= 0 && buf[c] == Ctrl_V; c--)
+ ;
+ if ((len & 1) != (c & 1)) /* escaped NL, read more */
+ {
+ sourcing_lnum++;
+ continue;
+ }
+
+ buf[len - 1] = NUL; /* remove the NL */
+ }
+
+ /*
+ * Check for ^C here now and then, so recursive :so can be broken.
+ */
+ line_breakcheck();
+ break;
+ }
+
+ if (have_read)
+ return (char_u *)ga.ga_data;
+
+ vim_free(ga.ga_data);
+ return NULL;
+}
+
+/*
+ * ":scriptencoding": Set encoding conversion for a sourced script.
+ * Without the multi-byte feature it's simply ignored.
+ */
+/*ARGSUSED*/
+ void
+ex_scriptencoding(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_MBYTE
+ struct source_cookie *sp;
+ char_u *name;
+
+ if (!getline_equal(eap->getline, eap->cookie, getsourceline))
+ {
+ EMSG(_("E167: :scriptencoding used outside of a sourced file"));
+ return;
+ }
+
+ if (*eap->arg != NUL)
+ {
+ name = enc_canonize(eap->arg);
+ if (name == NULL) /* out of memory */
+ return;
+ }
+ else
+ name = eap->arg;
+
+ /* Setup for conversion from the specified encoding to 'encoding'. */
+ sp = (struct source_cookie *)getline_cookie(eap->getline, eap->cookie);
+ convert_setup(&sp->conv, name, p_enc);
+
+ if (name != eap->arg)
+ vim_free(name);
+#endif
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * ":finish": Mark a sourced file as finished.
+ */
+ void
+ex_finish(eap)
+ exarg_T *eap;
+{
+ if (getline_equal(eap->getline, eap->cookie, getsourceline))
+ do_finish(eap, FALSE);
+ else
+ EMSG(_("E168: :finish used outside of a sourced file"));
+}
+
+/*
+ * Mark a sourced file as finished. Possibly makes the ":finish" pending.
+ * Also called for a pending finish at the ":endtry" or after returning from
+ * an extra do_cmdline(). "reanimate" is used in the latter case.
+ */
+ void
+do_finish(eap, reanimate)
+ exarg_T *eap;
+ int reanimate;
+{
+ int idx;
+
+ if (reanimate)
+ ((struct source_cookie *)getline_cookie(eap->getline,
+ eap->cookie))->finished = FALSE;
+
+ /*
+ * Cleanup (and inactivate) conditionals, but stop when a try conditional
+ * not in its finally clause (which then is to be executed next) is found.
+ * In this case, make the ":finish" pending for execution at the ":endtry".
+ * Otherwise, finish normally.
+ */
+ idx = cleanup_conditionals(eap->cstack, 0, TRUE);
+ if (idx >= 0)
+ {
+ eap->cstack->cs_pending[idx] = CSTP_FINISH;
+ report_make_pending(CSTP_FINISH, NULL);
+ }
+ else
+ ((struct source_cookie *)getline_cookie(eap->getline,
+ eap->cookie))->finished = TRUE;
+}
+
+
+/*
+ * Return TRUE when a sourced file had the ":finish" command: Don't give error
+ * message for missing ":endif".
+ * Return FALSE when not sourcing a file.
+ */
+ int
+source_finished(getline, cookie)
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie;
+{
+ return (getline_equal(getline, cookie, getsourceline)
+ && ((struct source_cookie *)getline_cookie(
+ getline, cookie))->finished);
+}
+#endif
+
+#if defined(FEAT_LISTCMDS) || defined(PROTO)
+/*
+ * ":checktime [buffer]"
+ */
+ void
+ex_checktime(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ int save_no_check_timestamps = no_check_timestamps;
+
+ no_check_timestamps = 0;
+ if (eap->addr_count == 0) /* default is all buffers */
+ check_timestamps(FALSE);
+ else
+ {
+ buf = buflist_findnr((int)eap->line2);
+ if (buf != NULL) /* cannot happen? */
+ (void)buf_check_timestamp(buf, FALSE);
+ }
+ no_check_timestamps = save_no_check_timestamps;
+}
+#endif
+
+#if defined(FEAT_PRINTER) || defined(PROTO)
+/*
+ * Printing code (Machine-independent.)
+ * To implement printing on a platform, the following functions must be
+ * defined:
+ *
+ * int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
+ * Called once. Code should display printer dialogue (if appropriate) and
+ * determine printer font and margin settings. Reset has_color if the printer
+ * doesn't support colors at all.
+ * Returns FAIL to abort.
+ *
+ * int mch_print_begin(prt_settings_T *settings)
+ * Called to start the print job.
+ * Return FALSE to abort.
+ *
+ * int mch_print_begin_page(char_u *msg)
+ * Called at the start of each page.
+ * "msg" indicates the progress of the print job, can be NULL.
+ * Return FALSE to abort.
+ *
+ * int mch_print_end_page()
+ * Called at the end of each page.
+ * Return FALSE to abort.
+ *
+ * int mch_print_blank_page()
+ * Called to generate a blank page for collated, duplex, multiple copy
+ * document. Return FALSE to abort.
+ *
+ * void mch_print_end(prt_settings_T *psettings)
+ * Called at normal end of print job.
+ *
+ * void mch_print_cleanup()
+ * Called if print job ends normally or is abandoned. Free any memory, close
+ * devices and handles. Also called when mch_print_begin() fails, but not
+ * when mch_print_init() fails.
+ *
+ * void mch_print_set_font(int Bold, int Italic, int Underline);
+ * Called whenever the font style changes.
+ *
+ * void mch_print_set_bg(long bgcol);
+ * Called to set the background color for the following text. Parameter is an
+ * RGB value.
+ *
+ * void mch_print_set_fg(long fgcol);
+ * Called to set the foreground color for the following text. Parameter is an
+ * RGB value.
+ *
+ * mch_print_start_line(int margin, int page_line)
+ * Sets the current position at the start of line "page_line".
+ * If margin is TRUE start in the left margin (for header and line number).
+ *
+ * int mch_print_text_out(char_u *p, int len);
+ * Output one character of text p[len] at the current position.
+ * Return TRUE if there is no room for another character in the same line.
+ *
+ * Note that the generic code has no idea of margins. The machine code should
+ * simply make the page look smaller! The header and the line numbers are
+ * printed in the margin.
+ */
+
+#ifdef FEAT_SYN_HL
+static const long_u cterm_color_8[8] =
+{
+ (long_u)0x000000L, (long_u)0xff0000L, (long_u)0x00ff00L, (long_u)0xffff00L,
+ (long_u)0x0000ffL, (long_u)0xff00ffL, (long_u)0x00ffffL, (long_u)0xffffffL
+};
+
+static const long_u cterm_color_16[16] =
+{
+ (long_u)0x000000L, (long_u)0x0000c0L, (long_u)0x008000L, (long_u)0x004080L,
+ (long_u)0xc00000L, (long_u)0xc000c0L, (long_u)0x808000L, (long_u)0xc0c0c0L,
+ (long_u)0x808080L, (long_u)0x6060ffL, (long_u)0x00ff00L, (long_u)0x00ffffL,
+ (long_u)0xff8080L, (long_u)0xff40ffL, (long_u)0xffff00L, (long_u)0xffffffL
+};
+
+static int current_syn_id;
+#endif
+
+#define PRCOLOR_BLACK (long_u)0
+#define PRCOLOR_WHITE (long_u)0xFFFFFFL
+
+static int curr_italic;
+static int curr_bold;
+static int curr_underline;
+static long_u curr_bg;
+static long_u curr_fg;
+static int page_count;
+
+/*
+ * These values determine the print position on a page.
+ */
+typedef struct
+{
+ int lead_spaces; /* remaining spaces for a TAB */
+ int print_pos; /* virtual column for computing TABs */
+ colnr_T column; /* byte column */
+ linenr_T file_line; /* line nr in the buffer */
+ long_u bytes_printed; /* bytes printed so far */
+ int ff; /* seen form feed character */
+} prt_pos_T;
+
+#ifdef FEAT_SYN_HL
+static long_u darken_rgb __ARGS((long_u rgb));
+static long_u prt_get_term_color __ARGS((int colorindex));
+#endif
+static void prt_set_fg __ARGS((long_u fg));
+static void prt_set_bg __ARGS((long_u bg));
+static void prt_set_font __ARGS((int bold, int italic, int underline));
+static void prt_line_number __ARGS((prt_settings_T *psettings, int page_line, linenr_T lnum));
+static void prt_header __ARGS((prt_settings_T *psettings, int pagenum, linenr_T lnum));
+static void prt_message __ARGS((char_u *s));
+static colnr_T hardcopy_line __ARGS((prt_settings_T *psettings, int page_line, prt_pos_T *ppos));
+static void prt_get_attr __ARGS((int hl_id, prt_text_attr_T* pattr, int modec));
+
+#ifdef FEAT_SYN_HL
+/*
+ * If using a dark background, the colors will probably be too bright to show
+ * up well on white paper, so reduce their brightness.
+ */
+ static long_u
+darken_rgb(rgb)
+ long_u rgb;
+{
+ return ((rgb >> 17) << 16)
+ + (((rgb & 0xff00) >> 9) << 8)
+ + ((rgb & 0xff) >> 1);
+}
+
+ static long_u
+prt_get_term_color(colorindex)
+ int colorindex;
+{
+ /* TODO: Should check for xterm with 88 or 256 colors. */
+ if (t_colors > 8)
+ return cterm_color_16[colorindex % 16];
+ return cterm_color_8[colorindex % 8];
+}
+
+ static void
+prt_get_attr(hl_id, pattr, modec)
+ int hl_id;
+ prt_text_attr_T* pattr;
+ int modec;
+{
+ int colorindex;
+ long_u fg_color;
+ long_u bg_color;
+ char *color;
+
+ pattr->bold = (highlight_has_attr(hl_id, HL_BOLD, modec) != NULL);
+ pattr->italic = (highlight_has_attr(hl_id, HL_ITALIC, modec) != NULL);
+ pattr->underline = (highlight_has_attr(hl_id, HL_UNDERLINE, modec) != NULL);
+
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ bg_color = highlight_gui_color_rgb(hl_id, FALSE);
+ if (bg_color == PRCOLOR_BLACK)
+ bg_color = PRCOLOR_WHITE;
+
+ fg_color = highlight_gui_color_rgb(hl_id, TRUE);
+ }
+ else
+# endif
+ {
+ bg_color = PRCOLOR_WHITE;
+
+ color = (char *)highlight_color(hl_id, (char_u *)"fg", modec);
+ if (color == NULL)
+ colorindex = 0;
+ else
+ colorindex = atoi(color);
+
+ if (colorindex >= 0 && colorindex < t_colors)
+ fg_color = prt_get_term_color(colorindex);
+ else
+ fg_color = PRCOLOR_BLACK;
+ }
+
+ if (fg_color == PRCOLOR_WHITE)
+ fg_color = PRCOLOR_BLACK;
+ else if (*p_bg == 'd')
+ fg_color = darken_rgb(fg_color);
+
+ pattr->fg_color = fg_color;
+ pattr->bg_color = bg_color;
+}
+#endif /* FEAT_SYN_HL */
+
+ static void
+prt_set_fg(fg)
+ long_u fg;
+{
+ if (fg != curr_fg)
+ {
+ curr_fg = fg;
+ mch_print_set_fg(fg);
+ }
+}
+
+ static void
+prt_set_bg(bg)
+ long_u bg;
+{
+ if (bg != curr_bg)
+ {
+ curr_bg = bg;
+ mch_print_set_bg(bg);
+ }
+}
+
+ static void
+prt_set_font(bold, italic, underline)
+ int bold;
+ int italic;
+ int underline;
+{
+ if (curr_bold != bold
+ || curr_italic != italic
+ || curr_underline != underline)
+ {
+ curr_underline = underline;
+ curr_italic = italic;
+ curr_bold = bold;
+ mch_print_set_font(bold, italic, underline);
+ }
+}
+
+/*
+ * Print the line number in the left margin.
+ */
+ static void
+prt_line_number(psettings, page_line, lnum)
+ prt_settings_T *psettings;
+ int page_line;
+ linenr_T lnum;
+{
+ int i;
+ char_u tbuf[20];
+
+ prt_set_fg(psettings->number.fg_color);
+ prt_set_bg(psettings->number.bg_color);
+ prt_set_font(psettings->number.bold, psettings->number.italic, psettings->number.underline);
+ mch_print_start_line(TRUE, page_line);
+
+ /* Leave two spaces between the number and the text; depends on
+ * PRINT_NUMBER_WIDTH. */
+ sprintf((char *)tbuf, "%6ld", (long)lnum);
+ for (i = 0; i < 6; i++)
+ (void)mch_print_text_out(&tbuf[i], 1);
+
+#ifdef FEAT_SYN_HL
+ if (psettings->do_syntax)
+ /* Set colors for next character. */
+ current_syn_id = -1;
+ else
+#endif
+ {
+ /* Set colors and font back to normal. */
+ prt_set_fg(PRCOLOR_BLACK);
+ prt_set_bg(PRCOLOR_WHITE);
+ prt_set_font(FALSE, FALSE, FALSE);
+ }
+}
+
+static linenr_T printer_page_num;
+
+ int
+get_printer_page_num()
+{
+ return printer_page_num;
+}
+
+/*
+ * Get the currently effective header height.
+ */
+ int
+prt_header_height()
+{
+ if (printer_opts[OPT_PRINT_HEADERHEIGHT].present)
+ return printer_opts[OPT_PRINT_HEADERHEIGHT].number;
+ return 2;
+}
+
+/*
+ * Return TRUE if using a line number for printing.
+ */
+ int
+prt_use_number()
+{
+ return (printer_opts[OPT_PRINT_NUMBER].present
+ && TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y');
+}
+
+/*
+ * Return the unit used in a margin item in 'printoptions'.
+ * Returns PRT_UNIT_NONE if not recognized.
+ */
+ int
+prt_get_unit(idx)
+ int idx;
+{
+ int u = PRT_UNIT_NONE;
+ int i;
+ static char *(units[4]) = PRT_UNIT_NAMES;
+
+ if (printer_opts[idx].present)
+ for (i = 0; i < 4; ++i)
+ if (STRNICMP(printer_opts[idx].string, units[i], 2) == 0)
+ {
+ u = i;
+ break;
+ }
+ return u;
+}
+
+/*
+ * Print the page header.
+ */
+/*ARGSUSED*/
+ static void
+prt_header(psettings, pagenum, lnum)
+ prt_settings_T *psettings;
+ int pagenum;
+ linenr_T lnum;
+{
+ int width = psettings->chars_per_line;
+ int page_line;
+ char_u *tbuf;
+ char_u *p;
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+ /* Also use the space for the line number. */
+ if (prt_use_number())
+ width += PRINT_NUMBER_WIDTH;
+
+ tbuf = alloc(width + IOSIZE);
+ if (tbuf == NULL)
+ return;
+
+#ifdef FEAT_STL_OPT
+ if (*p_header != NUL)
+ {
+ linenr_T tmp_lnum, tmp_topline, tmp_botline;
+
+ /*
+ * Need to (temporarily) set current line number and first/last line
+ * number on the 'window'. Since we don't know how long the page is,
+ * set the first and current line number to the top line, and guess
+ * that the page length is 64.
+ */
+ tmp_lnum = curwin->w_cursor.lnum;
+ tmp_topline = curwin->w_topline;
+ tmp_botline = curwin->w_botline;
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_topline = lnum;
+ curwin->w_botline = lnum + 63;
+ printer_page_num = pagenum;
+
+ build_stl_str_hl(curwin, tbuf, (size_t)(width + IOSIZE),
+ p_header, ' ', width, NULL);
+
+ /* Reset line numbers */
+ curwin->w_cursor.lnum = tmp_lnum;
+ curwin->w_topline = tmp_topline;
+ curwin->w_botline = tmp_botline;
+ }
+ else
+#endif
+ sprintf((char *)tbuf, _("Page %d"), pagenum);
+
+ prt_set_fg(PRCOLOR_BLACK);
+ prt_set_bg(PRCOLOR_WHITE);
+ prt_set_font(TRUE, FALSE, FALSE);
+
+ /* Use a negative line number to indicate printing in the top margin. */
+ page_line = 0 - prt_header_height();
+ mch_print_start_line(TRUE, page_line);
+ for (p = tbuf; *p != NUL; )
+ {
+ if (mch_print_text_out(p,
+#ifdef FEAT_MBYTE
+ (l = (*mb_ptr2len_check)(p))
+#else
+ 1
+#endif
+ ))
+ {
+ ++page_line;
+ if (page_line >= 0) /* out of room in header */
+ break;
+ mch_print_start_line(TRUE, page_line);
+ }
+#ifdef FEAT_MBYTE
+ p += l;
+#else
+ p++;
+#endif
+ }
+
+ vim_free(tbuf);
+
+#ifdef FEAT_SYN_HL
+ if (psettings->do_syntax)
+ /* Set colors for next character. */
+ current_syn_id = -1;
+ else
+#endif
+ {
+ /* Set colors and font back to normal. */
+ prt_set_fg(PRCOLOR_BLACK);
+ prt_set_bg(PRCOLOR_WHITE);
+ prt_set_font(FALSE, FALSE, FALSE);
+ }
+}
+
+/*
+ * Display a print status message.
+ */
+ static void
+prt_message(s)
+ char_u *s;
+{
+ screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
+ screen_puts(s, (int)Rows - 1, 0, hl_attr(HLF_R));
+ out_flush();
+}
+
+ void
+ex_hardcopy(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+ int collated_copies, uncollated_copies;
+ prt_settings_T settings;
+ long_u bytes_to_print = 0;
+ int page_line;
+ int jobsplit;
+ int id;
+
+ memset(&settings, 0, sizeof(prt_settings_T));
+ settings.has_color = TRUE;
+
+# ifdef FEAT_POSTSCRIPT
+ if (*eap->arg == '>')
+ {
+ char_u *errormsg = NULL;
+
+ /* Expand things like "%.ps". */
+ if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL)
+ {
+ if (errormsg != NULL)
+ EMSG(errormsg);
+ return;
+ }
+ settings.outfile = skipwhite(eap->arg + 1);
+ }
+ else if (*eap->arg != NUL)
+ settings.arguments = eap->arg;
+# endif
+
+ /*
+ * Initialise for printing. Ask the user for settings, unless forceit is
+ * set.
+ * The mch_print_init() code should set up margins if applicable. (It may
+ * not be a real printer - for example the engine might generate HTML or
+ * PS.)
+ */
+ if (mch_print_init(&settings,
+ curbuf->b_fname == NULL
+ ? (char_u *)buf_spname(curbuf)
+ : curbuf->b_sfname == NULL
+ ? curbuf->b_fname
+ : curbuf->b_sfname,
+ eap->forceit) == FAIL)
+ return;
+
+#ifdef FEAT_SYN_HL
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ settings.modec = 'g';
+ else
+# endif
+ if (t_colors > 1)
+ settings.modec = 'c';
+ else
+ settings.modec = 't';
+
+ if (!syntax_present(curbuf))
+ settings.do_syntax = FALSE;
+ else if (printer_opts[OPT_PRINT_SYNTAX].present
+ && TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) != 'a')
+ settings.do_syntax =
+ (TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) == 'y');
+ else
+ settings.do_syntax = settings.has_color;
+#endif
+
+ /* Set up printing attributes for line numbers */
+ settings.number.fg_color = PRCOLOR_BLACK;
+ settings.number.bg_color = PRCOLOR_WHITE;
+ settings.number.bold = FALSE;
+ settings.number.italic = TRUE;
+ settings.number.underline = FALSE;
+#ifdef FEAT_SYN_HL
+ /*
+ * Syntax highlighting of line numbers.
+ */
+ if (prt_use_number() && settings.do_syntax)
+ {
+ id = syn_name2id((char_u *)"LineNr");
+ if (id > 0)
+ id = syn_get_final_id(id);
+
+ prt_get_attr(id, &settings.number, settings.modec);
+ }
+#endif /* FEAT_SYN_HL */
+
+ /*
+ * Estimate the total lines to be printed
+ */
+ for (lnum = eap->line1; lnum <= eap->line2; lnum++)
+ bytes_to_print += (long_u)STRLEN(skipwhite(ml_get(lnum)));
+ if (bytes_to_print == 0)
+ {
+ MSG(_("No text to be printed"));
+ goto print_fail_no_begin;
+ }
+
+ /* Set colors and font to normal. */
+ curr_bg = (long_u)0xffffffffL;
+ curr_fg = (long_u)0xffffffffL;
+ curr_italic = MAYBE;
+ curr_bold = MAYBE;
+ curr_underline = MAYBE;
+
+ prt_set_fg(PRCOLOR_BLACK);
+ prt_set_bg(PRCOLOR_WHITE);
+ prt_set_font(FALSE, FALSE, FALSE);
+#ifdef FEAT_SYN_HL
+ current_syn_id = -1;
+#endif
+
+ jobsplit = (printer_opts[OPT_PRINT_JOBSPLIT].present
+ && TOLOWER_ASC(printer_opts[OPT_PRINT_JOBSPLIT].string[0]) == 'y');
+
+ if (!mch_print_begin(&settings))
+ goto print_fail_no_begin;
+
+ /*
+ * Loop over collated copies: 1 2 3, 1 2 3, ...
+ */
+ page_count = 0;
+ for (collated_copies = 0;
+ collated_copies < settings.n_collated_copies;
+ collated_copies++)
+ {
+ prt_pos_T prtpos; /* current print position */
+ prt_pos_T page_prtpos; /* print position at page start */
+ int side;
+
+ memset(&page_prtpos, 0, sizeof(prt_pos_T));
+ page_prtpos.file_line = eap->line1;
+ prtpos = page_prtpos;
+
+ if (jobsplit && collated_copies > 0)
+ {
+ /* Splitting jobs: Stop a previous job and start a new one. */
+ mch_print_end(&settings);
+ if (!mch_print_begin(&settings))
+ goto print_fail_no_begin;
+ }
+
+ /*
+ * Loop over all pages in the print job: 1 2 3 ...
+ */
+ for (page_count = 0; prtpos.file_line <= eap->line2; ++page_count)
+ {
+ /*
+ * Loop over uncollated copies: 1 1 1, 2 2 2, 3 3 3, ...
+ * For duplex: 12 12 12 34 34 34, ...
+ */
+ for (uncollated_copies = 0;
+ uncollated_copies < settings.n_uncollated_copies;
+ uncollated_copies++)
+ {
+ /* Set the print position to the start of this page. */
+ prtpos = page_prtpos;
+
+ /*
+ * Do front and rear side of a page.
+ */
+ for (side = 0; side <= settings.duplex; ++side)
+ {
+ /*
+ * Print one page.
+ */
+
+ /* Check for interrupt character every page. */
+ ui_breakcheck();
+ if (got_int || settings.user_abort)
+ goto print_fail;
+
+ sprintf((char *)IObuff, _("Printing page %d (%d%%)"),
+ page_count + 1 + side,
+ prtpos.bytes_printed > 1000000
+ ? (int)(prtpos.bytes_printed /
+ (bytes_to_print / 100))
+ : (int)((prtpos.bytes_printed * 100)
+ / bytes_to_print));
+ if (!mch_print_begin_page(IObuff))
+ goto print_fail;
+
+ if (settings.n_collated_copies > 1)
+ sprintf((char *)IObuff + STRLEN(IObuff),
+ _(" Copy %d of %d"),
+ collated_copies + 1,
+ settings.n_collated_copies);
+ prt_message(IObuff);
+
+ /*
+ * Output header if required
+ */
+ if (prt_header_height() > 0)
+ prt_header(&settings, page_count + 1 + side,
+ prtpos.file_line);
+
+ for (page_line = 0; page_line < settings.lines_per_page;
+ ++page_line)
+ {
+ prtpos.column = hardcopy_line(&settings,
+ page_line, &prtpos);
+ if (prtpos.column == 0)
+ {
+ /* finished a file line */
+ prtpos.bytes_printed +=
+ STRLEN(skipwhite(ml_get(prtpos.file_line)));
+ if (++prtpos.file_line > eap->line2)
+ break; /* reached the end */
+ }
+ else if (prtpos.ff)
+ {
+ /* Line had a formfeed in it - start new page but
+ * stay on the current line */
+ break;
+ }
+ }
+
+ if (!mch_print_end_page())
+ goto print_fail;
+ if (prtpos.file_line > eap->line2)
+ break; /* reached the end */
+ }
+
+ /*
+ * Extra blank page for duplexing with odd number of pages and
+ * more copies to come.
+ */
+ if (prtpos.file_line > eap->line2 && settings.duplex
+ && side == 0
+ && uncollated_copies + 1 < settings.n_uncollated_copies)
+ {
+ if (!mch_print_blank_page())
+ goto print_fail;
+ }
+ }
+ if (settings.duplex && prtpos.file_line <= eap->line2)
+ ++page_count;
+
+ /* Remember the position where the next page starts. */
+ page_prtpos = prtpos;
+ }
+
+ sprintf((char *)IObuff, _("Printed: %s"), settings.jobname);
+ prt_message(IObuff);
+ }
+
+print_fail:
+ if (got_int || settings.user_abort)
+ {
+ sprintf((char *)IObuff, _("Printing aborted"));
+ prt_message(IObuff);
+ }
+ mch_print_end(&settings);
+
+print_fail_no_begin:
+ mch_print_cleanup();
+}
+
+/*
+ * Print one page line.
+ * Return the next column to print, or zero if the line is finished.
+ */
+ static colnr_T
+hardcopy_line(psettings, page_line, ppos)
+ prt_settings_T *psettings;
+ int page_line;
+ prt_pos_T *ppos;
+{
+ colnr_T col;
+ char_u *line;
+ int need_break = FALSE;
+ int outputlen;
+ int tab_spaces;
+ long_u print_pos;
+#ifdef FEAT_SYN_HL
+ prt_text_attr_T attr;
+ int id;
+#endif
+
+ if (ppos->column == 0 || ppos->ff)
+ {
+ print_pos = 0;
+ tab_spaces = 0;
+ if (!ppos->ff && prt_use_number())
+ prt_line_number(psettings, page_line, ppos->file_line);
+ ppos->ff = FALSE;
+ }
+ else
+ {
+ /* left over from wrap halfway a tab */
+ print_pos = ppos->print_pos;
+ tab_spaces = ppos->lead_spaces;
+ }
+
+ mch_print_start_line(0, page_line);
+ line = ml_get(ppos->file_line);
+
+ /*
+ * Loop over the columns until the end of the file line or right margin.
+ */
+ for (col = ppos->column; line[col] != NUL && !need_break; col += outputlen)
+ {
+ outputlen = 1;
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (outputlen = (*mb_ptr2len_check)(line + col)) < 1)
+ outputlen = 1;
+#endif
+#ifdef FEAT_SYN_HL
+ /*
+ * syntax highlighting stuff.
+ */
+ if (psettings->do_syntax)
+ {
+ id = syn_get_id(ppos->file_line, (long)col, 1);
+ if (id > 0)
+ id = syn_get_final_id(id);
+ else
+ id = 0;
+ /* Get the line again, a multi-line regexp may invalidate it. */
+ line = ml_get(ppos->file_line);
+
+ if (id != current_syn_id)
+ {
+ current_syn_id = id;
+ prt_get_attr(id, &attr, psettings->modec);
+ prt_set_font(attr.bold, attr.italic, attr.underline);
+ prt_set_fg(attr.fg_color);
+ prt_set_bg(attr.bg_color);
+ }
+ }
+#endif /* FEAT_SYN_HL */
+
+ /*
+ * Appropriately expand any tabs to spaces.
+ */
+ if (line[col] == TAB || tab_spaces != 0)
+ {
+ if (tab_spaces == 0)
+ tab_spaces = curbuf->b_p_ts - (print_pos % curbuf->b_p_ts);
+
+ while (tab_spaces > 0)
+ {
+ need_break = mch_print_text_out((char_u *)" ", 1);
+ print_pos++;
+ tab_spaces--;
+ if (need_break)
+ break;
+ }
+ /* Keep the TAB if we didn't finish it. */
+ if (need_break && tab_spaces > 0)
+ break;
+ }
+ else if (line[col] == FF
+ && printer_opts[OPT_PRINT_FORMFEED].present
+ && TOLOWER_ASC(printer_opts[OPT_PRINT_FORMFEED].string[0])
+ == 'y')
+ {
+ ppos->ff = TRUE;
+ need_break = 1;
+ }
+ else
+ {
+ need_break = mch_print_text_out(line + col, outputlen);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ print_pos += (*mb_ptr2cells)(line + col);
+ else
+#endif
+ print_pos++;
+ }
+ }
+
+ ppos->lead_spaces = tab_spaces;
+ ppos->print_pos = print_pos;
+
+ /*
+ * Start next line of file if we clip lines, or have reached end of the
+ * line, unless we are doing a formfeed.
+ */
+ if (!ppos->ff
+ && (line[col] == NUL
+ || (printer_opts[OPT_PRINT_WRAP].present
+ && TOLOWER_ASC(printer_opts[OPT_PRINT_WRAP].string[0])
+ == 'n')))
+ return 0;
+ return col;
+}
+
+# if defined(FEAT_POSTSCRIPT) || defined(PROTO)
+
+/*
+ * PS printer stuff.
+ *
+ * Sources of information to help maintain the PS printing code:
+ *
+ * 1. PostScript Language Reference, 3rd Edition,
+ * Addison-Wesley, 1999, ISBN 0-201-37922-8
+ * 2. PostScript Language Program Design,
+ * Addison-Wesley, 1988, ISBN 0-201-14396-8
+ * 3. PostScript Tutorial and Cookbook,
+ * Addison Wesley, 1985, ISBN 0-201-10179-3
+ * 4. PostScript Language Document Structuring Conventions Specification,
+ * version 3.0,
+ * Adobe Technote 5001, 25th September 1992
+ * 5. PostScript Printer Description File Format Specification, Version 4.3,
+ * Adobe technote 5003, 9th February 1996
+ * 6. Adobe Font Metrics File Format Specification, Version 4.1,
+ * Adobe Technote 5007, 7th October 1998
+ *
+ * Some of these documents can be found in PDF form on Adobe's web site -
+ * http://www.adobe.com
+ */
+
+#define PRT_PS_DEFAULT_DPI (72) /* Default user space resolution */
+#define PRT_PS_DEFAULT_FONTSIZE (10)
+#define PRT_PS_DEFAULT_BUFFER_SIZE (80)
+
+struct prt_mediasize_S
+{
+ char *name;
+ float width; /* width and height in points for portrait */
+ float height;
+};
+
+#define PRT_MEDIASIZE_LEN (sizeof(prt_mediasize) / sizeof(struct prt_mediasize_S))
+
+static struct prt_mediasize_S prt_mediasize[] =
+{
+ {"A4", 595.0, 842.0},
+ {"letter", 612.0, 792.0},
+ {"10x14", 720.0, 1008.0},
+ {"A3", 842.0, 1191.0},
+ {"A5", 420.0, 595.0},
+ {"B4", 729.0, 1032.0},
+ {"B5", 516.0, 729.0},
+ {"executive", 522.0, 756.0},
+ {"folio", 595.0, 935.0},
+ {"ledger", 1224.0, 792.0}, /* Yes, it is wider than taller! */
+ {"legal", 612.0, 1008.0},
+ {"quarto", 610.0, 780.0},
+ {"statement", 396.0, 612.0},
+ {"tabloid", 792.0, 1224.0}
+};
+
+/* PS font names, must be in Roman, Bold, Italic, Bold-Italic order */
+struct prt_ps_font_S
+{
+ int wx;
+ int uline_offset;
+ int uline_width;
+ int bbox_min_y;
+ int bbox_max_y;
+ char *(ps_fontname[4]);
+};
+
+#define PRT_PS_FONT_ROMAN (0)
+#define PRT_PS_FONT_BOLD (1)
+#define PRT_PS_FONT_OBLIQUE (2)
+#define PRT_PS_FONT_BOLDOBLIQUE (3)
+
+static struct prt_ps_font_S prt_ps_font =
+{
+ 600,
+ -100, 50,
+ -250, 805,
+ {"Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique"}
+};
+
+struct prt_ps_resource_S
+{
+ char_u name[64];
+ char_u filename[MAXPATHL + 1];
+ int type;
+ char_u title[256];
+ char_u version[256];
+};
+
+/* Types of PS resource file currently used */
+#define PRT_RESOURCE_TYPE_PROCSET (0)
+#define PRT_RESOURCE_TYPE_ENCODING (1)
+
+/* The PS prolog file version number has to match - if the prolog file is
+ * updated, increment the number in the file and here. Version checking was
+ * added as of VIM 6.2.
+ * Table of VIM and prolog versions:
+ *
+ * VIM Prolog
+ * 6.2 1.3
+ */
+#define PRT_PROLOG_VERSION ((char_u *)"1.3")
+
+/* String versions of PS resource types - indexed by constants above so don't
+ * re-order!
+ */
+static char *resource_types[] =
+{
+ "procset",
+ "encoding"
+};
+
+/* Strings to look for in a PS resource file */
+#define PRT_RESOURCE_HEADER "%!PS-Adobe-"
+#define PRT_RESOURCE_RESOURCE "Resource-"
+#define PRT_RESOURCE_PROCSET "ProcSet"
+#define PRT_RESOURCE_ENCODING "Encoding"
+#define PRT_RESOURCE_TITLE "%%Title:"
+#define PRT_RESOURCE_VERSION "%%Version:"
+
+static void prt_write_file_raw_len __ARGS((char_u *buffer, int bytes));
+static void prt_write_file __ARGS((char_u *buffer));
+static void prt_write_file_len __ARGS((char_u *buffer, int bytes));
+static void prt_write_string __ARGS((char *s));
+static void prt_write_int __ARGS((int i));
+static void prt_write_boolean __ARGS((int b));
+static void prt_def_font __ARGS((char *new_name, char *encoding, int height, char *font));
+static void prt_real_bits __ARGS((double real, int precision, int *pinteger, int *pfraction));
+static void prt_write_real __ARGS((double val, int prec));
+static void prt_def_var __ARGS((char *name, double value, int prec));
+static void prt_flush_buffer __ARGS((void));
+static void prt_resource_name __ARGS((char_u *filename));
+static int prt_find_resource __ARGS((char *name, struct prt_ps_resource_S *resource));
+static int prt_open_resource __ARGS((struct prt_ps_resource_S *resource));
+static int prt_check_resource __ARGS((struct prt_ps_resource_S *resource, char_u *version));
+static void prt_dsc_start __ARGS((void));
+static void prt_dsc_noarg __ARGS((char *comment));
+static void prt_dsc_textline __ARGS((char *comment, char *text));
+static void prt_dsc_text __ARGS((char *comment, char *text));
+static void prt_dsc_ints __ARGS((char *comment, int count, int *ints));
+static void prt_dsc_requirements __ARGS((int duplex, int tumble, int collate, int color, int num_copies));
+static void prt_dsc_docmedia __ARGS((char *paper_name, double width, double height, double weight, char *colour, char *type));
+static void prt_dsc_resources __ARGS((char *comment, char *type, int count, char **strings));
+static float to_device_units __ARGS((int idx, double physsize, int def_number));
+static void prt_page_margins __ARGS((double width, double height, double *left, double *right, double *top, double *bottom));
+static void prt_font_metrics __ARGS((int font_scale));
+static int prt_get_cpl __ARGS((void));
+static int prt_get_lpp __ARGS((void));
+static int prt_add_resource __ARGS((struct prt_ps_resource_S *resource));
+
+/*
+ * Variables for the output PostScript file.
+ */
+static FILE *prt_ps_fd;
+static int prt_file_error;
+static char_u *prt_ps_file_name = NULL;
+
+/*
+ * Various offsets and dimensions in default PostScript user space (points).
+ * Used for text positioning calculations
+ */
+static float prt_page_width;
+static float prt_page_height;
+static float prt_left_margin;
+static float prt_right_margin;
+static float prt_top_margin;
+static float prt_bottom_margin;
+static float prt_line_height;
+static float prt_first_line_height;
+static float prt_char_width;
+static float prt_number_width;
+static float prt_bgcol_offset;
+static float prt_pos_x_moveto = 0.0;
+static float prt_pos_y_moveto = 0.0;
+
+/*
+ * Various control variables used to decide when and how to change the
+ * PostScript graphics state.
+ */
+static int prt_need_moveto;
+static int prt_do_moveto;
+static int prt_need_font;
+static int prt_font;
+static int prt_need_underline;
+static int prt_underline;
+static int prt_do_underline;
+static int prt_need_fgcol;
+static int prt_fgcol;
+static int prt_need_bgcol;
+static int prt_do_bgcol;
+static int prt_bgcol;
+static int prt_new_bgcol;
+static int prt_attribute_change;
+static int prt_text_count;
+static int prt_page_num;
+
+/*
+ * Variables controlling physical printing.
+ */
+static int prt_media;
+static int prt_portrait;
+static int prt_num_copies;
+static int prt_duplex;
+static int prt_tumble;
+static int prt_collate;
+
+/*
+ * Buffers used when generating PostScript output
+ */
+static char_u prt_line_buffer[257];
+static garray_T prt_ps_buffer;
+
+# ifdef FEAT_MBYTE
+static int prt_do_conv;
+static vimconv_T prt_conv;
+# endif
+
+ static void
+prt_write_file_raw_len(buffer, bytes)
+ char_u *buffer;
+ int bytes;
+{
+ if (!prt_file_error
+ && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd)
+ != (size_t)bytes)
+ {
+ EMSG(_("E455: Error writing to PostScript output file"));
+ prt_file_error = TRUE;
+ }
+}
+
+ static void
+prt_write_file(buffer)
+ char_u *buffer;
+{
+ prt_write_file_len(buffer, STRLEN(buffer));
+}
+
+ static void
+prt_write_file_len(buffer, bytes)
+ char_u *buffer;
+ int bytes;
+{
+#ifdef EBCDIC
+ ebcdic2ascii(buffer, bytes);
+#endif
+ prt_write_file_raw_len(buffer, bytes);
+}
+
+/*
+ * Write a string.
+ */
+ static void
+prt_write_string(s)
+ char *s;
+{
+ sprintf((char *)prt_line_buffer, "%s", s);
+ prt_write_file(prt_line_buffer);
+}
+
+/*
+ * Write an int and a space.
+ */
+ static void
+prt_write_int(i)
+ int i;
+{
+ sprintf((char *)prt_line_buffer, "%d ", i);
+ prt_write_file(prt_line_buffer);
+}
+
+/*
+ * Write a boolean and a space.
+ */
+ static void
+prt_write_boolean(b)
+ int b;
+{
+ sprintf((char *)prt_line_buffer, "%s ", (b ? "T" : "F"));
+ prt_write_file(prt_line_buffer);
+}
+
+/*
+ * Write a line to define the font.
+ */
+ static void
+prt_def_font(new_name, encoding, height, font)
+ char *new_name;
+ char *encoding;
+ int height;
+ char *font;
+{
+ sprintf((char *)prt_line_buffer, "/_%s /VIM-%s /%s ref\n", new_name, encoding, font);
+ prt_write_file(prt_line_buffer);
+ sprintf((char *)prt_line_buffer, "/%s %d /_%s ffs\n",
+ new_name, height, new_name);
+ prt_write_file(prt_line_buffer);
+}
+
+/*
+ * Convert a real value into an integer and fractional part as integers, with
+ * the fractional part being in the range [0,10^precision). The fractional part
+ * is also rounded based on the precision + 1'th fractional digit.
+ */
+ static void
+prt_real_bits(real, precision, pinteger, pfraction)
+ double real;
+ int precision;
+ int *pinteger;
+ int *pfraction;
+{
+ int i;
+ int integer;
+ float fraction;
+
+ integer = (int)real;
+ fraction = (float)(real - integer);
+ if (real < (double)integer)
+ fraction = -fraction;
+ for (i = 0; i < precision; i++)
+ fraction *= 10.0;
+
+ *pinteger = integer;
+ *pfraction = (int)(fraction + 0.5);
+}
+
+/*
+ * Write a real and a space. Save bytes if real value has no fractional part!
+ * We use prt_real_bits() as %f in sprintf uses the locale setting to decide
+ * what decimal point character to use, but PS always requires a '.'.
+ */
+ static void
+prt_write_real(val, prec)
+ double val;
+ int prec;
+{
+ int integer;
+ int fraction;
+
+ prt_real_bits(val, prec, &integer, &fraction);
+ /* Emit integer part */
+ sprintf((char *)prt_line_buffer, "%d", integer);
+ prt_write_file(prt_line_buffer);
+ /* Only emit fraction if necessary */
+ if (fraction != 0)
+ {
+ /* Remove any trailing zeros */
+ while ((fraction % 10) == 0)
+ {
+ prec--;
+ fraction /= 10;
+ }
+ /* Emit fraction left padded with zeros */
+ sprintf((char *)prt_line_buffer, ".%0*d", prec, fraction);
+ prt_write_file(prt_line_buffer);
+ }
+ sprintf((char *)prt_line_buffer, " ");
+ prt_write_file(prt_line_buffer);
+}
+
+/*
+ * Write a line to define a numeric variable.
+ */
+ static void
+prt_def_var(name, value, prec)
+ char *name;
+ double value;
+ int prec;
+{
+ sprintf((char *)prt_line_buffer, "/%s ", name);
+ prt_write_file(prt_line_buffer);
+ prt_write_real(value, prec);
+ sprintf((char *)prt_line_buffer, "d\n");
+ prt_write_file(prt_line_buffer);
+}
+
+/* Convert size from font space to user space at current font scale */
+#define PRT_PS_FONT_TO_USER(scale, size) ((size) * ((scale)/1000.0))
+
+ static void
+prt_flush_buffer()
+{
+ if (prt_ps_buffer.ga_len > 0)
+ {
+ /* Any background color must be drawn first */
+ if (prt_do_bgcol && (prt_new_bgcol != PRCOLOR_WHITE))
+ {
+ int r, g, b;
+
+ if (prt_do_moveto)
+ {
+ prt_write_real(prt_pos_x_moveto, 2);
+ prt_write_real(prt_pos_y_moveto, 2);
+ prt_write_string("m\n");
+ prt_do_moveto = FALSE;
+ }
+
+ /* Size of rect of background color on which text is printed */
+ prt_write_real(prt_text_count * prt_char_width, 2);
+ prt_write_real(prt_line_height, 2);
+
+ /* Lastly add the color of the background */
+ r = ((unsigned)prt_new_bgcol & 0xff0000) >> 16;
+ g = ((unsigned)prt_new_bgcol & 0xff00) >> 8;
+ b = prt_new_bgcol & 0xff;
+ prt_write_real(r / 255.0, 3);
+ prt_write_real(g / 255.0, 3);
+ prt_write_real(b / 255.0, 3);
+ prt_write_string("bg\n");
+ }
+ /* Draw underlines before the text as it makes it slightly easier to
+ * find the starting point.
+ */
+ if (prt_do_underline)
+ {
+ if (prt_do_moveto)
+ {
+ prt_write_real(prt_pos_x_moveto, 2);
+ prt_write_real(prt_pos_y_moveto, 2);
+ prt_write_string("m\n");
+ prt_do_moveto = FALSE;
+ }
+
+ /* Underlining is easy - just need the number of characters to
+ * print. */
+ prt_write_real(prt_text_count * prt_char_width, 2);
+ prt_write_string("ul\n");
+ }
+ /* Draw the text
+ * Note: we write text out raw - EBCDIC conversion is handled in the
+ * PostScript world via the font encoding vector. */
+ prt_write_string("(");
+ prt_write_file_raw_len(prt_ps_buffer.ga_data, prt_ps_buffer.ga_len);
+ prt_write_string(")");
+ /* Add a moveto if need be and use the appropriate show procedure */
+ if (prt_do_moveto)
+ {
+ prt_write_real(prt_pos_x_moveto, 2);
+ prt_write_real(prt_pos_y_moveto, 2);
+ /* moveto and a show */
+ prt_write_string("ms\n");
+ prt_do_moveto = FALSE;
+ }
+ else /* Simple show */
+ prt_write_string("s\n");
+
+ ga_clear(&prt_ps_buffer);
+ ga_init2(&prt_ps_buffer, (int)sizeof(char), PRT_PS_DEFAULT_BUFFER_SIZE);
+ }
+}
+
+static char_u *resource_filename;
+
+ static void
+prt_resource_name(filename)
+ char_u *filename;
+{
+ if (STRLEN(filename) >= MAXPATHL)
+ *resource_filename = NUL;
+ else
+ STRCPY(resource_filename, filename);
+}
+
+ static int
+prt_find_resource(name, resource)
+ char *name;
+ struct prt_ps_resource_S *resource;
+{
+ char_u buffer[MAXPATHL + 1];
+
+ STRCPY(resource->name, name);
+ /* Look for named resource file in runtimepath */
+ STRCPY(buffer, "print");
+ add_pathsep(buffer);
+ STRCAT(buffer, name);
+ STRCAT(buffer, ".ps");
+ resource_filename = resource->filename;
+ *resource_filename = NUL;
+ return (do_in_runtimepath(buffer, FALSE, prt_resource_name)
+ && resource->filename[0] != NUL);
+}
+
+/* PS CR and LF characters have platform independent values */
+#define PSLF (0x0a)
+#define PSCR (0x0d)
+
+/* Very simple hand crafted parser to get the type, title, and version number of
+ * a PS resource file so the file details can be added to the DSC header
+ * comments. */
+ static int
+prt_open_resource(resource)
+ struct prt_ps_resource_S *resource;
+{
+ FILE *fd_resource;
+ char_u buffer[128];
+ char_u *ch = buffer;
+ char_u *ch2;
+
+ fd_resource = mch_fopen((char *)resource->filename, READBIN);
+ if (fd_resource == NULL)
+ {
+ EMSG2(_("E624: Can't open file \"%s\""), resource->filename);
+ return FALSE;
+ }
+ vim_memset(buffer, NUL, sizeof(buffer));
+
+ /* Parse first line to ensure valid resource file */
+ (void)fread((char *)buffer, sizeof(char_u), sizeof(buffer),
+ fd_resource);
+ if (ferror(fd_resource))
+ {
+ EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+
+ if (STRNCMP(ch, PRT_RESOURCE_HEADER, STRLEN(PRT_RESOURCE_HEADER)) != 0)
+ {
+ EMSG2(_("E618: file \"%s\" is not a PostScript resource file"),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+
+ /* Skip over any version numbers and following ws */
+ ch += STRLEN(PRT_RESOURCE_HEADER);
+ while (!isspace(*ch))
+ ch++;
+ while (isspace(*ch))
+ ch++;
+
+ if (STRNCMP(ch, PRT_RESOURCE_RESOURCE, STRLEN(PRT_RESOURCE_RESOURCE)) != 0)
+ {
+ EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+ ch += STRLEN(PRT_RESOURCE_RESOURCE);
+
+ /* Decide type of resource in the file */
+ if (STRNCMP(ch, PRT_RESOURCE_PROCSET, STRLEN(PRT_RESOURCE_PROCSET)) == 0)
+ {
+ resource->type = PRT_RESOURCE_TYPE_PROCSET;
+ ch += STRLEN(PRT_RESOURCE_PROCSET);
+ }
+ else if (STRNCMP(ch, PRT_RESOURCE_ENCODING, STRLEN(PRT_RESOURCE_ENCODING)) == 0)
+ {
+ resource->type = PRT_RESOURCE_TYPE_ENCODING;
+ ch += STRLEN(PRT_RESOURCE_ENCODING);
+ }
+ else
+ {
+ EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+
+ /* Consume up to and including the CR/LF/CR_LF */
+ while (*ch != PSCR && *ch != PSLF)
+ ch++;
+ while (*ch == PSCR || *ch == PSLF)
+ ch++;
+
+ /* Match %%Title: */
+ if (STRNCMP(ch, PRT_RESOURCE_TITLE, STRLEN(PRT_RESOURCE_TITLE)) != 0)
+ {
+ EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+ ch += STRLEN(PRT_RESOURCE_TITLE);
+
+ /* Skip ws after %%Title: */
+ while (isspace(*ch))
+ ch++;
+
+ /* Copy up to the CR/LF/CR_LF */
+ ch2 = resource->title;
+ while (*ch != PSCR && *ch != PSLF)
+ *ch2++ = *ch++;
+ *ch2 = '\0';
+ while (*ch == PSCR || *ch == PSLF)
+ ch++;
+
+ /* Match %%Version: */
+ if (STRNCMP(ch, PRT_RESOURCE_VERSION, STRLEN(PRT_RESOURCE_VERSION)) != 0)
+ {
+ EMSG2(_("E619: file \"%s\" is not a supported PostScript resource file"),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+ ch += STRLEN(PRT_RESOURCE_VERSION);
+
+ /* Skip ws after %%Version: */
+ while (isspace(*ch))
+ ch++;
+
+ /* Copy up to the CR/LF/CR_LF */
+ ch2 = resource->version;
+ while (*ch != PSCR && *ch != PSLF)
+ *ch2++ = *ch++;
+ *ch2 = '\0';
+
+ fclose(fd_resource);
+
+ return TRUE;
+}
+
+ static int
+prt_check_resource(resource, version)
+ struct prt_ps_resource_S *resource;
+ char_u *version;
+{
+ /* Version number m.n should match, the revision number does not matter */
+ if (STRNCMP(resource->version, version, STRLEN(version)))
+ {
+ EMSG2(_("E621: \"%s\" resource file has wrong version"),
+ resource->name);
+ return FALSE;
+ }
+
+ /* Other checks to be added as needed */
+ return TRUE;
+}
+
+ static void
+prt_dsc_start()
+{
+ prt_write_string("%!PS-Adobe-3.0\n");
+}
+
+ static void
+prt_dsc_noarg(comment)
+ char *comment;
+{
+ sprintf((char *)prt_line_buffer, "%%%%%s\n", comment);
+ prt_write_file(prt_line_buffer);
+}
+
+ static void
+prt_dsc_textline(comment, text)
+ char *comment;
+ char *text;
+{
+ sprintf((char *)prt_line_buffer, "%%%%%s: %s\n", comment, text);
+ prt_write_file(prt_line_buffer);
+}
+
+ static void
+prt_dsc_text(comment, text)
+ char *comment;
+ char *text;
+{
+ /* TODO - should scan 'text' for any chars needing escaping! */
+ sprintf((char *)prt_line_buffer, "%%%%%s: (%s)\n", comment, text);
+ prt_write_file(prt_line_buffer);
+}
+
+#define prt_dsc_atend(c) prt_dsc_text((c), "atend")
+
+ static void
+prt_dsc_ints(comment, count, ints)
+ char *comment;
+ int count;
+ int *ints;
+{
+ int i;
+
+ sprintf((char *)prt_line_buffer, "%%%%%s:", comment);
+ prt_write_file(prt_line_buffer);
+
+ for (i = 0; i < count; i++)
+ {
+ sprintf((char *)prt_line_buffer, " %d", ints[i]);
+ prt_write_file(prt_line_buffer);
+ }
+
+ prt_write_string("\n");
+}
+
+ static void
+prt_dsc_resources(comment, type, count, strings)
+ char *comment; /* if NULL add to previous */
+ char *type;
+ int count;
+ char **strings;
+{
+ int i;
+
+ if (comment != NULL)
+ sprintf((char *)prt_line_buffer, "%%%%%s: %s", comment, type);
+ else
+ sprintf((char *)prt_line_buffer, "%%%%+ %s", type);
+ prt_write_file(prt_line_buffer);
+
+ for (i = 0; i < count; i++)
+ {
+ sprintf((char *)prt_line_buffer, " %s", strings[i]);
+ prt_write_file(prt_line_buffer);
+ }
+
+ prt_write_string("\n");
+}
+
+ static void
+prt_dsc_requirements(duplex, tumble, collate, color, num_copies)
+ int duplex;
+ int tumble;
+ int collate;
+ int color;
+ int num_copies;
+{
+ /* Only output the comment if we need to.
+ * Note: tumble is ignored if we are not duplexing
+ */
+ if (!(duplex || collate || color || (num_copies > 1)))
+ return;
+
+ sprintf((char *)prt_line_buffer, "%%%%Requirements:");
+ prt_write_file(prt_line_buffer);
+
+ if (duplex)
+ {
+ prt_write_string(" duplex");
+ if (tumble)
+ prt_write_string("(tumble)");
+ }
+ if (collate)
+ prt_write_string(" collate");
+ if (color)
+ prt_write_string(" color");
+ if (num_copies > 1)
+ {
+ prt_write_string(" numcopies(");
+ /* Note: no space wanted so dont use prt_write_int() */
+ sprintf((char *)prt_line_buffer, "%d", num_copies);
+ prt_write_file(prt_line_buffer);
+ prt_write_string(")");
+ }
+ prt_write_string("\n");
+}
+
+ static void
+prt_dsc_docmedia(paper_name, width, height, weight, colour, type)
+ char *paper_name;
+ double width;
+ double height;
+ double weight;
+ char *colour;
+ char *type;
+{
+ sprintf((char *)prt_line_buffer, "%%%%DocumentMedia: %s ", paper_name);
+ prt_write_file(prt_line_buffer);
+ prt_write_real(width, 2);
+ prt_write_real(height, 2);
+ prt_write_real(weight, 2);
+ if (colour == NULL)
+ prt_write_string("()");
+ else
+ prt_write_string(colour);
+ prt_write_string(" ");
+ if (type == NULL)
+ prt_write_string("()");
+ else
+ prt_write_string(type);
+ prt_write_string("\n");
+}
+
+ void
+mch_print_cleanup()
+{
+#ifdef FEAT_MBYTE
+ if (prt_do_conv)
+ {
+ convert_setup(&prt_conv, NULL, NULL);
+ prt_do_conv = FALSE;
+ }
+#endif
+ if (prt_ps_fd != NULL)
+ {
+ fclose(prt_ps_fd);
+ prt_ps_fd = NULL;
+ prt_file_error = FALSE;
+ }
+ if (prt_ps_file_name != NULL)
+ {
+ vim_free(prt_ps_file_name);
+ prt_ps_file_name = NULL;
+ }
+}
+
+ static float
+to_device_units(idx, physsize, def_number)
+ int idx;
+ double physsize;
+ int def_number;
+{
+ float ret;
+ int u;
+ int nr;
+
+ u = prt_get_unit(idx);
+ if (u == PRT_UNIT_NONE)
+ {
+ u = PRT_UNIT_PERC;
+ nr = def_number;
+ }
+ else
+ nr = printer_opts[idx].number;
+
+ switch (u)
+ {
+ case PRT_UNIT_INCH:
+ ret = (float)(nr * PRT_PS_DEFAULT_DPI);
+ break;
+ case PRT_UNIT_MM:
+ ret = (float)(nr * PRT_PS_DEFAULT_DPI) / (float)25.4;
+ break;
+ case PRT_UNIT_POINT:
+ ret = (float)nr;
+ break;
+ case PRT_UNIT_PERC:
+ default:
+ ret = (float)(physsize * nr) / 100;
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * Calculate margins for given width and height from printoptions settings.
+ */
+ static void
+prt_page_margins(width, height, left, right, top, bottom)
+ double width;
+ double height;
+ double *left;
+ double *right;
+ double *top;
+ double *bottom;
+{
+ *left = to_device_units(OPT_PRINT_LEFT, width, 10);
+ *right = width - to_device_units(OPT_PRINT_RIGHT, width, 5);
+ *top = height - to_device_units(OPT_PRINT_TOP, height, 5);
+ *bottom = to_device_units(OPT_PRINT_BOT, height, 5);
+}
+
+ static void
+prt_font_metrics(font_scale)
+ int font_scale;
+{
+ prt_line_height = (float)font_scale;
+ prt_char_width = (float)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font.wx);
+}
+
+
+ static int
+prt_get_cpl()
+{
+ if (prt_use_number())
+ {
+ prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width;
+ prt_left_margin += prt_number_width;
+ }
+ else
+ prt_number_width = 0.0;
+
+ return (int)((prt_right_margin - prt_left_margin) / prt_char_width);
+}
+
+/*
+ * Get number of lines of text that fit on a page (excluding the header).
+ */
+ static int
+prt_get_lpp()
+{
+ int lpp;
+
+ /*
+ * Calculate offset to lower left corner of background rect based on actual
+ * font height (based on its bounding box) and the line height, handling the
+ * case where the font height can exceed the line height.
+ */
+ prt_bgcol_offset = (float)PRT_PS_FONT_TO_USER(prt_line_height,
+ prt_ps_font.bbox_min_y);
+ if ((prt_ps_font.bbox_max_y - prt_ps_font.bbox_min_y) < 1000.0)
+ {
+ prt_bgcol_offset -= (float)PRT_PS_FONT_TO_USER(prt_line_height,
+ (1000.0 - (prt_ps_font.bbox_max_y -
+ prt_ps_font.bbox_min_y)) / 2);
+ }
+
+ /* Get height for topmost line based on background rect offset. */
+ prt_first_line_height = prt_line_height + prt_bgcol_offset;
+
+ /* Calculate lpp */
+ lpp = (int)((prt_top_margin - prt_bottom_margin) / prt_line_height);
+
+ /* Adjust top margin if there is a header */
+ prt_top_margin -= prt_line_height * prt_header_height();
+
+ return lpp - prt_header_height();
+}
+
+/*ARGSUSED*/
+ int
+mch_print_init(psettings, jobname, forceit)
+ prt_settings_T *psettings;
+ char_u *jobname;
+ int forceit;
+{
+ int i;
+ char *paper_name;
+ int paper_strlen;
+ int fontsize;
+ char_u *p;
+ double left;
+ double right;
+ double top;
+ double bottom;
+
+#if 0
+ /*
+ * TODO:
+ * If "forceit" is false: pop up a dialog to select:
+ * - printer name
+ * - copies
+ * - collated/uncollated
+ * - duplex off/long side/short side
+ * - paper size
+ * - portrait/landscape
+ * - font size
+ *
+ * If "forceit" is true: use the default printer and settings
+ */
+ if (forceit)
+ s_pd.Flags |= PD_RETURNDEFAULT;
+#endif
+
+ /*
+ * Find the size of the paper and set the margins.
+ */
+ prt_portrait = (!printer_opts[OPT_PRINT_PORTRAIT].present
+ || TOLOWER_ASC(printer_opts[OPT_PRINT_PORTRAIT].string[0]) == 'y');
+ if (printer_opts[OPT_PRINT_PAPER].present)
+ {
+ paper_name = (char *)printer_opts[OPT_PRINT_PAPER].string;
+ paper_strlen = printer_opts[OPT_PRINT_PAPER].strlen;
+ }
+ else
+ {
+ paper_name = "A4";
+ paper_strlen = 2;
+ }
+ for (i = 0; i < PRT_MEDIASIZE_LEN; ++i)
+ if (STRLEN(prt_mediasize[i].name) == (unsigned)paper_strlen
+ && STRNICMP(prt_mediasize[i].name, paper_name,
+ paper_strlen) == 0)
+ break;
+ if (i == PRT_MEDIASIZE_LEN)
+ i = 0;
+ prt_media = i;
+
+ /*
+ * Set PS pagesize based on media dimensions and print orientation.
+ * Note: Media and page sizes have defined meanings in PostScript and should
+ * be kept distinct. Media is the paper (or transparency, or ...) that is
+ * printed on, whereas the page size is the area that the PostScript
+ * interpreter renders into.
+ */
+ if (prt_portrait)
+ {
+ prt_page_width = prt_mediasize[i].width;
+ prt_page_height = prt_mediasize[i].height;
+ }
+ else
+ {
+ prt_page_width = prt_mediasize[i].height;
+ prt_page_height = prt_mediasize[i].width;
+ }
+
+ /*
+ * Set PS page margins based on the PS pagesize, not the mediasize - this
+ * needs to be done before the cpl and lpp are calculated.
+ */
+ prt_page_margins(prt_page_width, prt_page_height, &left, &right, &top,
+ &bottom);
+ prt_left_margin = (float)left;
+ prt_right_margin = (float)right;
+ prt_top_margin = (float)top;
+ prt_bottom_margin = (float)bottom;
+
+ /*
+ * Set up the font size.
+ */
+ fontsize = PRT_PS_DEFAULT_FONTSIZE;
+ for (p = p_pfn; (p = vim_strchr(p, ':')) != NULL; ++p)
+ if (p[1] == 'h' && VIM_ISDIGIT(p[2]))
+ fontsize = atoi((char *)p + 2);
+ prt_font_metrics(fontsize);
+
+ /*
+ * Return the number of characters per line, and lines per page for the
+ * generic print code.
+ */
+ psettings->chars_per_line = prt_get_cpl();
+ psettings->lines_per_page = prt_get_lpp();
+
+ /* Catch margin settings that leave no space for output! */
+ if (psettings->chars_per_line <= 0 || psettings->lines_per_page <= 0)
+ return FAIL;
+
+ /*
+ * Sort out the number of copies to be printed. PS by default will do
+ * uncollated copies for you, so once we know how many uncollated copies are
+ * wanted cache it away and lie to the generic code that we only want one
+ * uncollated copy.
+ */
+ psettings->n_collated_copies = 1;
+ psettings->n_uncollated_copies = 1;
+ prt_num_copies = 1;
+ prt_collate = (!printer_opts[OPT_PRINT_COLLATE].present
+ || TOLOWER_ASC(printer_opts[OPT_PRINT_COLLATE].string[0]) == 'y');
+ if (prt_collate)
+ {
+ /* TODO: Get number of collated copies wanted. */
+ psettings->n_collated_copies = 1;
+ }
+ else
+ {
+ /* TODO: Get number of uncollated copies wanted and update the cached
+ * count.
+ */
+ prt_num_copies = 1;
+ }
+
+ psettings->jobname = jobname;
+
+ /*
+ * Set up printer duplex and tumble based on Duplex option setting - default
+ * is long sided duplex printing (i.e. no tumble).
+ */
+ prt_duplex = TRUE;
+ prt_tumble = FALSE;
+ psettings->duplex = 1;
+ if (printer_opts[OPT_PRINT_DUPLEX].present)
+ {
+ if (STRNICMP(printer_opts[OPT_PRINT_DUPLEX].string, "off", 3) == 0)
+ {
+ prt_duplex = FALSE;
+ psettings->duplex = 0;
+ }
+ else if (STRNICMP(printer_opts[OPT_PRINT_DUPLEX].string, "short", 5)
+ == 0)
+ prt_tumble = TRUE;
+ }
+
+ /* For now user abort not supported */
+ psettings->user_abort = 0;
+
+ /* If the user didn't specify a file name, use a temp file. */
+ if (psettings->outfile == NULL)
+ {
+ prt_ps_file_name = vim_tempname('p');
+ if (prt_ps_file_name == NULL)
+ {
+ EMSG(_(e_notmp));
+ return FAIL;
+ }
+ prt_ps_fd = mch_fopen((char *)prt_ps_file_name, WRITEBIN);
+ }
+ else
+ {
+ p = expand_env_save(psettings->outfile);
+ if (p != NULL)
+ {
+ prt_ps_fd = mch_fopen((char *)p, WRITEBIN);
+ vim_free(p);
+ }
+ }
+ if (prt_ps_fd == NULL)
+ {
+ EMSG(_("E324: Can't open PostScript output file"));
+ mch_print_cleanup();
+ return FAIL;
+ }
+
+ ga_init2(&prt_ps_buffer, (int)sizeof(char), PRT_PS_DEFAULT_BUFFER_SIZE);
+
+ prt_page_num = 0;
+
+ prt_attribute_change = FALSE;
+ prt_need_moveto = FALSE;
+ prt_need_font = FALSE;
+ prt_need_fgcol = FALSE;
+ prt_need_bgcol = FALSE;
+ prt_need_underline = FALSE;
+
+ prt_file_error = FALSE;
+
+ return OK;
+}
+
+ static int
+prt_add_resource(resource)
+ struct prt_ps_resource_S *resource;
+{
+ FILE* fd_resource;
+ char_u resource_buffer[512];
+ char *resource_name[1];
+ size_t bytes_read;
+
+ fd_resource = mch_fopen((char *)resource->filename, READBIN);
+ if (fd_resource == NULL)
+ {
+ EMSG2(_("E456: Can't open file \"%s\""), resource->filename);
+ return FALSE;
+ }
+ resource_name[0] = (char *)resource->title;
+ prt_dsc_resources("BeginResource",
+ resource_types[resource->type], 1, resource_name);
+
+ prt_dsc_textline("BeginDocument", (char *)resource->filename);
+
+ for (;;)
+ {
+ bytes_read = fread((char *)resource_buffer, sizeof(char_u),
+ sizeof(resource_buffer), fd_resource);
+ if (ferror(fd_resource))
+ {
+ EMSG2(_("E457: Can't read PostScript resource file \"%s\""),
+ resource->filename);
+ fclose(fd_resource);
+ return FALSE;
+ }
+ if (bytes_read == 0)
+ break;
+ prt_write_file_raw_len(resource_buffer, bytes_read);
+ if (prt_file_error)
+ {
+ fclose(fd_resource);
+ return FALSE;
+ }
+ }
+ fclose(fd_resource);
+
+ prt_dsc_noarg("EndDocument");
+
+ prt_dsc_noarg("EndResource");
+
+ return TRUE;
+}
+
+ int
+mch_print_begin(psettings)
+ prt_settings_T *psettings;
+{
+ time_t now;
+ int bbox[4];
+ char *p_time;
+ char *resource[1];
+ double left;
+ double right;
+ double top;
+ double bottom;
+ struct prt_ps_resource_S res_prolog;
+ struct prt_ps_resource_S res_encoding;
+ char_u buffer[256];
+ char_u *p_encoding;
+#ifdef FEAT_MBYTE
+ int props;
+#endif
+
+ /*
+ * PS DSC Header comments - no PS code!
+ */
+ prt_dsc_start();
+ prt_dsc_textline("Title", (char *)psettings->jobname);
+ /* TODO - platform dependent user name retrieval */
+ prt_dsc_textline("For", "Unknown");
+ prt_dsc_textline("Creator", VIM_VERSION_LONG);
+ /* Note: to ensure Clean8bit I don't think we can use LC_TIME */
+ now = time(NULL);
+ p_time = ctime(&now);
+ /* Note: ctime() adds a \n so we have to remove it :-( */
+ *(vim_strchr((char_u *)p_time, '\n')) = '\0';
+ prt_dsc_textline("CreationDate", p_time);
+ prt_dsc_textline("DocumentData", "Clean8Bit");
+ prt_dsc_textline("Orientation", "Portrait");
+ prt_dsc_atend("Pages");
+ prt_dsc_textline("PageOrder", "Ascend");
+ /* The bbox does not change with orientation - it is always in the default
+ * user coordinate system! We have to recalculate right and bottom
+ * coordinates based on the font metrics for the bbox to be accurate. */
+ prt_page_margins(prt_mediasize[prt_media].width,
+ prt_mediasize[prt_media].height,
+ &left, &right, &top, &bottom);
+ bbox[0] = (int)left;
+ if (prt_portrait)
+ {
+ /* In portrait printing the fixed point is the top left corner so we
+ * derive the bbox from that point. We have the expected cpl chars
+ * across the media and lpp lines down the media.
+ */
+ bbox[1] = (int)(top - (psettings->lines_per_page + prt_header_height())
+ * prt_line_height);
+ bbox[2] = (int)(left + psettings->chars_per_line * prt_char_width
+ + 0.5);
+ bbox[3] = (int)(top + 0.5);
+ }
+ else
+ {
+ /* In landscape printing the fixed point is the bottom left corner so we
+ * derive the bbox from that point. We have lpp chars across the media
+ * and cpl lines up the media.
+ */
+ bbox[1] = (int)bottom;
+ bbox[2] = (int)(left + ((psettings->lines_per_page
+ + prt_header_height()) * prt_line_height) + 0.5);
+ bbox[3] = (int)(bottom + psettings->chars_per_line * prt_char_width
+ + 0.5);
+ }
+ prt_dsc_ints("BoundingBox", 4, bbox);
+ /* The media width and height does not change with landscape printing! */
+ prt_dsc_docmedia(prt_mediasize[prt_media].name,
+ prt_mediasize[prt_media].width,
+ prt_mediasize[prt_media].height,
+ (double)0, NULL, NULL);
+ prt_dsc_resources("DocumentNeededResources", "font", 4,
+ prt_ps_font.ps_fontname);
+
+ /* Search for external resources we supply */
+ if (!prt_find_resource("prolog", &res_prolog))
+ {
+ EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
+ return FALSE;
+ }
+ if (!prt_open_resource(&res_prolog))
+ return FALSE;
+ if (!prt_check_resource(&res_prolog, PRT_PROLOG_VERSION))
+ return FALSE;
+ /* Find an encoding to use for printing.
+ * Check 'printencoding'. If not set or not found, then use 'encoding'. If
+ * that cannot be found then default to "latin1".
+ * Note: VIM specific encoding header is always skipped.
+ */
+#ifdef FEAT_MBYTE
+ props = enc_canon_props(p_enc);
+#endif
+ p_encoding = enc_skip(p_penc);
+ if (*p_encoding == NUL
+ || !prt_find_resource((char *)p_encoding, &res_encoding))
+ {
+ /* 'printencoding' not set or not supported - find alternate */
+#ifdef FEAT_MBYTE
+ p_encoding = enc_skip(p_enc);
+ if (!(props & ENC_8BIT)
+ || !prt_find_resource((char *)p_encoding, &res_encoding))
+ {
+ /* 8-bit 'encoding' is not supported */
+#endif
+ /* Use latin1 as default printing encoding */
+ p_encoding = (char_u *)"latin1";
+ if (!prt_find_resource((char *)p_encoding, &res_encoding))
+ {
+ EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
+ p_encoding);
+ return FALSE;
+ }
+#ifdef FEAT_MBYTE
+ }
+#endif
+ }
+ if (!prt_open_resource(&res_encoding))
+ return FALSE;
+ /* For the moment there are no checks on encoding resource files to perform */
+#ifdef FEAT_MBYTE
+ /* Set up encoding conversion if starting from multi-byte */
+ props = enc_canon_props(p_enc);
+ if (!(props & ENC_8BIT))
+ {
+ if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding))
+ {
+ EMSG2(_("E620: Unable to convert from multi-byte to \"%s\" encoding"),
+ p_encoding);
+ return FALSE;
+ }
+ prt_do_conv = TRUE;
+ }
+#endif
+
+ /* List resources supplied */
+ resource[0] = (char *)buffer;
+ STRCPY(buffer, res_prolog.title);
+ STRCAT(buffer, " ");
+ STRCAT(buffer, res_prolog.version);
+ prt_dsc_resources("DocumentSuppliedResources", "procset", 1, resource);
+ STRCPY(buffer, res_encoding.title);
+ STRCAT(buffer, " ");
+ STRCAT(buffer, res_encoding.version);
+ prt_dsc_resources(NULL, "encoding", 1, resource);
+ prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate,
+#ifdef FEAT_SYN_HL
+ psettings->do_syntax
+#else
+ 0
+#endif
+ , prt_num_copies);
+ prt_dsc_noarg("EndComments");
+
+ /*
+ * PS Document page defaults
+ */
+ prt_dsc_noarg("BeginDefaults");
+
+ /* List font resources most likely common to all pages */
+ prt_dsc_resources("PageResources", "font", 4, prt_ps_font.ps_fontname);
+ /* Paper will be used for all pages */
+ prt_dsc_textline("PageMedia", prt_mediasize[prt_media].name);
+
+ prt_dsc_noarg("EndDefaults");
+
+ /*
+ * PS Document prolog inclusion - all required procsets.
+ */
+ prt_dsc_noarg("BeginProlog");
+
+ /* For now there is just the one procset to be included in the PS file. */
+ if (!prt_add_resource(&res_prolog))
+ return FALSE;
+
+ /* There will be only one font encoding to be included in the PS file. */
+ if (!prt_add_resource(&res_encoding))
+ return FALSE;
+
+ prt_dsc_noarg("EndProlog");
+
+ /*
+ * PS Document setup - must appear after the prolog
+ */
+ prt_dsc_noarg("BeginSetup");
+
+ /* Device setup - page size and number of uncollated copies */
+ prt_write_int((int)prt_mediasize[prt_media].width);
+ prt_write_int((int)prt_mediasize[prt_media].height);
+ prt_write_int(0);
+ prt_write_string("sps\n");
+ prt_write_int(prt_num_copies);
+ prt_write_string("nc\n");
+ prt_write_boolean(prt_duplex);
+ prt_write_boolean(prt_tumble);
+ prt_write_string("dt\n");
+ prt_write_boolean(prt_collate);
+ prt_write_string("c\n");
+
+ /* Font resource inclusion and definition */
+ prt_dsc_resources("IncludeResource", "font", 1,
+ &prt_ps_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+ prt_def_font("F0", (char *)p_encoding, (int)prt_line_height,
+ prt_ps_font.ps_fontname[PRT_PS_FONT_ROMAN]);
+ prt_dsc_resources("IncludeResource", "font", 1,
+ &prt_ps_font.ps_fontname[PRT_PS_FONT_BOLD]);
+ prt_def_font("F1", (char *)p_encoding, (int)prt_line_height,
+ prt_ps_font.ps_fontname[PRT_PS_FONT_BOLD]);
+ prt_dsc_resources("IncludeResource", "font", 1,
+ &prt_ps_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+ prt_def_font("F2", (char *)p_encoding, (int)prt_line_height,
+ prt_ps_font.ps_fontname[PRT_PS_FONT_OBLIQUE]);
+ prt_dsc_resources("IncludeResource", "font", 1,
+ &prt_ps_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+ prt_def_font("F3", (char *)p_encoding, (int)prt_line_height,
+ prt_ps_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]);
+
+ /* Misc constant vars used for underlining and background rects */
+ prt_def_var("UO", PRT_PS_FONT_TO_USER(prt_line_height,
+ prt_ps_font.uline_offset), 2);
+ prt_def_var("UW", PRT_PS_FONT_TO_USER(prt_line_height,
+ prt_ps_font.uline_width), 2);
+ prt_def_var("BO", prt_bgcol_offset, 2);
+
+ prt_dsc_noarg("EndSetup");
+
+ /* Fail if any problems writing out to the PS file */
+ return !prt_file_error;
+}
+
+ void
+mch_print_end(psettings)
+ prt_settings_T *psettings;
+{
+ prt_dsc_noarg("Trailer");
+
+ /*
+ * Output any info we don't know in toto until we finish
+ */
+ prt_dsc_ints("Pages", 1, &prt_page_num);
+
+ prt_dsc_noarg("EOF");
+
+ if (!prt_file_error && psettings->outfile == NULL
+ && !got_int && !psettings->user_abort)
+ {
+ /* Close the file first. */
+ if (prt_ps_fd != NULL)
+ {
+ fclose(prt_ps_fd);
+ prt_ps_fd = NULL;
+ }
+ prt_message((char_u *)_("Sending to printer..."));
+
+ /* Not printing to a file: use 'printexpr' to print the file. */
+ if (eval_printexpr(prt_ps_file_name, psettings->arguments) == FAIL)
+ EMSG(_("E365: Failed to print PostScript file"));
+ else
+ prt_message((char_u *)_("Print job sent."));
+ }
+
+ mch_print_cleanup();
+}
+
+ int
+mch_print_end_page()
+{
+ prt_flush_buffer();
+
+ prt_write_string("re sp\n");
+
+ prt_dsc_noarg("PageTrailer");
+
+ return !prt_file_error;
+}
+
+/*ARGSUSED*/
+ int
+mch_print_begin_page(str)
+ char_u *str;
+{
+ int page_num[2];
+
+ prt_page_num++;
+
+ page_num[0] = page_num[1] = prt_page_num;
+ prt_dsc_ints("Page", 2, page_num);
+
+ prt_dsc_noarg("BeginPageSetup");
+
+ prt_write_string("sv\n0 g\nF0 sf\n");
+ prt_fgcol = PRCOLOR_BLACK;
+ prt_bgcol = PRCOLOR_WHITE;
+ prt_font = PRT_PS_FONT_ROMAN;
+
+ /* Set up page transformation for landscape printing. */
+ if (!prt_portrait)
+ {
+ prt_write_int(-((int)prt_mediasize[prt_media].width));
+ prt_write_string("sl\n");
+ }
+
+ prt_dsc_noarg("EndPageSetup");
+
+ /* We have reset the font attributes, force setting them again. */
+ curr_bg = (long_u)0xffffffff;
+ curr_fg = (long_u)0xffffffff;
+ curr_bold = MAYBE;
+
+ return !prt_file_error;
+}
+
+ int
+mch_print_blank_page()
+{
+ return (mch_print_begin_page(NULL) ? (mch_print_end_page()) : FALSE);
+}
+
+static float prt_pos_x = 0;
+static float prt_pos_y = 0;
+
+ void
+mch_print_start_line(margin, page_line)
+ int margin;
+ int page_line;
+{
+ prt_pos_x = prt_left_margin;
+ if (margin)
+ prt_pos_x -= prt_number_width;
+
+ prt_pos_y = prt_top_margin - prt_first_line_height -
+ page_line * prt_line_height;
+
+ prt_attribute_change = TRUE;
+ prt_need_moveto = TRUE;
+}
+
+/*ARGSUSED*/
+ int
+mch_print_text_out(p, len)
+ char_u *p;
+ int len;
+{
+ int need_break;
+ char_u ch;
+ char_u ch_buff[8];
+
+ /* Output any required changes to the graphics state, after flushing any
+ * text buffered so far.
+ */
+ if (prt_attribute_change)
+ {
+ prt_flush_buffer();
+ /* Reset count of number of chars that will be printed */
+ prt_text_count = 0;
+
+ if (prt_need_moveto)
+ {
+ prt_pos_x_moveto = prt_pos_x;
+ prt_pos_y_moveto = prt_pos_y;
+ prt_do_moveto = TRUE;
+
+ prt_need_moveto = FALSE;
+ }
+ if (prt_need_font)
+ {
+ prt_write_string("F");
+ prt_write_int(prt_font);
+ prt_write_string("sf\n");
+ prt_need_font = FALSE;
+ }
+ if (prt_need_fgcol)
+ {
+ int r, g, b;
+ r = ((unsigned)prt_fgcol & 0xff0000) >> 16;
+ g = ((unsigned)prt_fgcol & 0xff00) >> 8;
+ b = prt_fgcol & 0xff;
+
+ prt_write_real(r / 255.0, 3);
+ if (r == g && g == b)
+ {
+ prt_write_string("g\n");
+ }
+ else
+ {
+ prt_write_real(g / 255.0, 3);
+ prt_write_real(b / 255.0, 3);
+ prt_write_string("r\n");
+ }
+ prt_need_fgcol = FALSE;
+ }
+
+ if (prt_bgcol != PRCOLOR_WHITE)
+ {
+ prt_new_bgcol = prt_bgcol;
+ if (prt_need_bgcol)
+ prt_do_bgcol = TRUE;
+ }
+ else
+ prt_do_bgcol = FALSE;
+ prt_need_bgcol = FALSE;
+
+ if (prt_need_underline)
+ prt_do_underline = prt_underline;
+ prt_need_underline = FALSE;
+
+ prt_attribute_change = FALSE;
+ }
+
+#ifdef FEAT_MBYTE
+ if (prt_do_conv)
+ {
+ /* Convert from multi-byte to 8-bit encoding */
+ p = string_convert(&prt_conv, p, &len);
+ if (p == NULL)
+ p = (char_u *)"";
+ }
+#endif
+ /* Add next character to buffer of characters to output.
+ * Note: One printed character may require several PS characters to
+ * represent it, but we only count them as one printed character.
+ */
+ ch = *p;
+ if (ch < 32 || ch == '(' || ch == ')' || ch == '\\')
+ {
+ /* Convert non-printing characters to either their escape or octal
+ * sequence, ensures PS sent over a serial line does not interfere with
+ * the comms protocol.
+ * Note: For EBCDIC we need to write out the escape sequences as ASCII
+ * codes!
+ * Note 2: Char codes < 32 are identical in EBCDIC and ASCII AFAIK!
+ */
+ ga_append(&prt_ps_buffer, IF_EB('\\', 0134));
+ switch (ch)
+ {
+ case BS: ga_append(&prt_ps_buffer, IF_EB('b', 0142)); break;
+ case TAB: ga_append(&prt_ps_buffer, IF_EB('t', 0164)); break;
+ case NL: ga_append(&prt_ps_buffer, IF_EB('n', 0156)); break;
+ case FF: ga_append(&prt_ps_buffer, IF_EB('f', 0146)); break;
+ case CAR: ga_append(&prt_ps_buffer, IF_EB('r', 0162)); break;
+ case '(': ga_append(&prt_ps_buffer, IF_EB('(', 0050)); break;
+ case ')': ga_append(&prt_ps_buffer, IF_EB(')', 0051)); break;
+ case '\\': ga_append(&prt_ps_buffer, IF_EB('\\', 0134)); break;
+
+ default:
+ sprintf((char *)ch_buff, "%03o", (unsigned int)ch);
+#ifdef EBCDIC
+ ebcdic2ascii(ch_buff, 3);
+#endif
+ ga_append(&prt_ps_buffer, ch_buff[0]);
+ ga_append(&prt_ps_buffer, ch_buff[1]);
+ ga_append(&prt_ps_buffer, ch_buff[2]);
+ break;
+ }
+ }
+ else
+ ga_append(&prt_ps_buffer, ch);
+
+#ifdef FEAT_MBYTE
+ /* Need to free any translated characters */
+ if (prt_do_conv && (*p != NUL))
+ vim_free(p);
+#endif
+
+ prt_text_count++;
+ prt_pos_x += prt_char_width;
+
+ /* The downside of fp - need a little tolerance in the right margin check */
+ need_break = (prt_pos_x + prt_char_width > (prt_right_margin + 0.01));
+
+ if (need_break)
+ prt_flush_buffer();
+
+ return need_break;
+}
+
+ void
+mch_print_set_font(iBold, iItalic, iUnderline)
+ int iBold;
+ int iItalic;
+ int iUnderline;
+{
+ int font = 0;
+
+ if (iBold)
+ font |= 0x01;
+ if (iItalic)
+ font |= 0x02;
+
+ if (font != prt_font)
+ {
+ prt_font = font;
+ prt_attribute_change = TRUE;
+ prt_need_font = TRUE;
+ }
+ if (prt_underline != iUnderline)
+ {
+ prt_underline = iUnderline;
+ prt_attribute_change = TRUE;
+ prt_need_underline = TRUE;
+ }
+}
+
+ void
+mch_print_set_bg(bgcol)
+ long_u bgcol;
+{
+ prt_bgcol = bgcol;
+ prt_attribute_change = TRUE;
+ prt_need_bgcol = TRUE;
+}
+
+ void
+mch_print_set_fg(fgcol)
+ long_u fgcol;
+{
+ if (fgcol != (long_u)prt_fgcol)
+ {
+ prt_fgcol = fgcol;
+ prt_attribute_change = TRUE;
+ prt_need_fgcol = TRUE;
+ }
+}
+
+# endif /*FEAT_POSTSCRIPT*/
+#endif /*FEAT_PRINTER*/
+
+#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_EVAL) || defined(FEAT_MULTI_LANG))
+static char *get_locale_val __ARGS((int what));
+
+ static char *
+get_locale_val(what)
+ int what;
+{
+ char *loc;
+
+ /* Obtain the locale value from the libraries. For DJGPP this is
+ * redefined and it doesn't use the arguments. */
+ loc = setlocale(what, NULL);
+
+# if defined(__BORLANDC__)
+ if (loc != NULL)
+ {
+ char_u *p;
+
+ /* Borland returns something like "LC_CTYPE=<name>\n"
+ * Let's try to fix that bug here... */
+ p = vim_strchr(loc, '=');
+ if (p != NULL)
+ {
+ loc = ++p;
+ while (*p != NUL) /* remove trailing newline */
+ {
+ if (*p < ' ')
+ {
+ *p = NUL;
+ break;
+ }
+ ++p;
+ }
+ }
+ }
+# endif
+
+ return loc;
+}
+#endif
+
+
+#ifdef WIN32
+/*
+ * On MS-Windows locale names are strings like "German_Germany.1252", but
+ * gettext expects "de". Try to translate one into another here for a few
+ * supported languages.
+ */
+ static char_u *
+gettext_lang(char_u *name)
+{
+ int i;
+ static char *(mtable[]) = {
+ "afrikaans", "af",
+ "czech", "cs",
+ "dutch", "nl",
+ "german", "de",
+ "english_united kingdom", "en_GB",
+ "spanish", "es",
+ "french", "fr",
+ "italian", "it",
+ "japanese", "ja",
+ "korean", "ko",
+ "norwegian", "no",
+ "polish", "pl",
+ "russian", "ru",
+ "slovak", "sk",
+ "swedish", "sv",
+ "ukrainian", "uk",
+ "chinese_china", "zh_CN",
+ "chinese_taiwan", "zh_TW",
+ NULL};
+
+ for (i = 0; mtable[i] != NULL; i += 2)
+ if (STRNICMP(mtable[i], name, STRLEN(mtable[i])) == 0)
+ return mtable[i + 1];
+ return name;
+}
+#endif
+
+#if defined(FEAT_MULTI_LANG) || defined(PROTO)
+/*
+ * Obtain the current messages language. Used to set the default for
+ * 'helplang'. May return NULL or an empty string.
+ */
+ char_u *
+get_mess_lang()
+{
+ char_u *p;
+
+# if (defined(HAVE_LOCALE_H) || defined(X_LOCALE))
+# if defined(LC_MESSAGES)
+ p = (char_u *)get_locale_val(LC_MESSAGES);
+# else
+ /* This is necessary for Win32, where LC_MESSAGES is not defined and $LANG
+ * may be set to the LCID number. */
+ p = (char_u *)get_locale_val(LC_ALL);
+# endif
+# else
+ p = mch_getenv((char_u *)"LC_ALL");
+ if (p == NULL || *p == NUL)
+ {
+ p = mch_getenv((char_u *)"LC_MESSAGES");
+ if (p == NULL || *p == NUL)
+ p = mch_getenv((char_u *)"LANG");
+ }
+# endif
+# ifdef WIN32
+ p = gettext_lang(p);
+# endif
+ return p;
+}
+#endif
+
+#if !defined(LC_MESSAGES) \
+ && (((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))) \
+ || defined(FEAT_EVAL))
+static char_u *get_mess_env __ARGS((void));
+
+/*
+ * Get the language used for messages from the environment.
+ */
+ static char_u *
+get_mess_env()
+{
+ char_u *p;
+
+ p = mch_getenv((char_u *)"LC_ALL");
+ if (p == NULL || *p == NUL)
+ {
+ p = mch_getenv((char_u *)"LC_MESSAGES");
+ if (p == NULL || *p == NUL)
+ {
+ p = mch_getenv((char_u *)"LANG");
+ if (p != NULL && VIM_ISDIGIT(*p))
+ p = NULL; /* ignore something like "1043" */
+# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ if (p == NULL || *p == NUL)
+ p = (char_u *)get_locale_val(LC_CTYPE);
+# endif
+ }
+ }
+ return p;
+}
+#endif
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+/*
+ * Set the "v:lang" variable according to the current locale setting.
+ * Also do "v:lc_time"and "v:ctype".
+ */
+ void
+set_lang_var()
+{
+ char_u *loc;
+
+# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ loc = (char_u *)get_locale_val(LC_CTYPE);
+# else
+ /* setlocale() not supported: use the default value */
+ loc = (char_u *)"C";
+# endif
+ set_vim_var_string(VV_CTYPE, loc, -1);
+
+ /* When LC_MESSAGES isn't defined use the value from $LC_MESSAGES, fall
+ * back to LC_CTYPE if it's empty. */
+# if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) && defined(LC_MESSAGES)
+ loc = (char_u *)get_locale_val(LC_MESSAGES);
+# else
+ loc = get_mess_env();
+# endif
+ set_vim_var_string(VV_LANG, loc, -1);
+
+# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ loc = (char_u *)get_locale_val(LC_TIME);
+# endif
+ set_vim_var_string(VV_LC_TIME, loc, -1);
+}
+#endif
+
+#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+/*
+ * ":language": Set the language (locale).
+ */
+ void
+ex_language(eap)
+ exarg_T *eap;
+{
+ char *loc;
+ char_u *p;
+ char_u *name;
+ int what = LC_ALL;
+ char *whatstr = "";
+#ifdef LC_MESSAGES
+# define VIM_LC_MESSAGES LC_MESSAGES
+#else
+# define VIM_LC_MESSAGES 6789
+#endif
+
+ name = eap->arg;
+
+ /* Check for "messages {name}", "ctype {name}" or "time {name}" argument.
+ * Allow abbreviation, but require at least 3 characters to avoid
+ * confusion with a two letter language name "me" or "ct". */
+ p = skiptowhite(eap->arg);
+ if ((*p == NUL || vim_iswhite(*p)) && p - eap->arg >= 3)
+ {
+ if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0)
+ {
+ what = VIM_LC_MESSAGES;
+ name = skipwhite(p);
+ whatstr = "messages ";
+ }
+ else if (STRNICMP(eap->arg, "ctype", p - eap->arg) == 0)
+ {
+ what = LC_CTYPE;
+ name = skipwhite(p);
+ whatstr = "ctype ";
+ }
+ else if (STRNICMP(eap->arg, "time", p - eap->arg) == 0)
+ {
+ what = LC_TIME;
+ name = skipwhite(p);
+ whatstr = "time ";
+ }
+ }
+
+ if (*name == NUL)
+ {
+#ifndef LC_MESSAGES
+ if (what == VIM_LC_MESSAGES)
+ p = get_mess_env();
+ else
+#endif
+ p = (char_u *)setlocale(what, NULL);
+ if (p == NULL || *p == NUL)
+ p = (char_u *)"Unknown";
+ smsg((char_u *)_("Current %slanguage: \"%s\""), whatstr, p);
+ }
+ else
+ {
+#ifndef LC_MESSAGES
+ if (what == VIM_LC_MESSAGES)
+ loc = "";
+ else
+#endif
+ loc = setlocale(what, (char *)name);
+ if (loc == NULL)
+ EMSG2(_("E197: Cannot set language to \"%s\""), name);
+ else
+ {
+#ifdef HAVE_NL_MSG_CAT_CNTR
+ /* Need to do this for GNU gettext, otherwise cached translations
+ * will be used again. */
+ extern int _nl_msg_cat_cntr;
+
+ ++_nl_msg_cat_cntr;
+#endif
+ /* Reset $LC_ALL, otherwise it would overrule everyting. */
+ vim_setenv((char_u *)"LC_ALL", (char_u *)"");
+
+ if (what != LC_TIME)
+ {
+ /* Tell gettext() what to translate to. It apparently doesn't
+ * use the currently effective locale. Also do this when
+ * FEAT_GETTEXT isn't defined, so that shell commands use this
+ * value. */
+ if (what == LC_ALL)
+ vim_setenv((char_u *)"LANG", name);
+ if (what != LC_CTYPE)
+ {
+ char_u *mname;
+#ifdef WIN32
+ mname = gettext_lang(name);
+#else
+ mname = name;
+#endif
+ vim_setenv((char_u *)"LC_MESSAGES", mname);
+#ifdef FEAT_MULTI_LANG
+ set_helplang_default(mname);
+#endif
+ }
+
+ /* Set $LC_CTYPE, because it overrules $LANG, and
+ * gtk_set_locale() calls setlocale() again. gnome_init()
+ * sets $LC_CTYPE to "en_US" (that's a bug!). */
+ if (what != VIM_LC_MESSAGES)
+ vim_setenv((char_u *)"LC_CTYPE", name);
+# ifdef FEAT_GUI_GTK
+ /* Let GTK know what locale we're using. Not sure this is
+ * really needed... */
+ if (gui.in_use)
+ (void)gtk_set_locale();
+# endif
+ }
+
+# ifdef FEAT_EVAL
+ /* Set v:lang, v:lc_time and v:ctype to the final result. */
+ set_lang_var();
+# endif
+ }
+ }
+}
+
+# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain the possible arguments of the
+ * ":language" command.
+ */
+/*ARGSUSED*/
+ char_u *
+get_lang_arg(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx == 0)
+ return (char_u *)"messages";
+ if (idx == 1)
+ return (char_u *)"ctype";
+ if (idx == 2)
+ return (char_u *)"time";
+ return NULL;
+}
+# endif
+
+#endif
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
new file mode 100644
index 000000000..f1331e918
--- /dev/null
+++ b/src/ex_docmd.c
@@ -0,0 +1,9711 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ex_docmd.c: functions for executing an Ex command line.
+ */
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* for chdir() */
+#endif
+
+static int quitmore = 0;
+static int ex_pressedreturn = FALSE;
+#ifndef FEAT_PRINTER
+# define ex_hardcopy ex_ni
+#endif
+
+#ifdef FEAT_USR_CMDS
+typedef struct ucmd
+{
+ char_u *uc_name; /* The command name */
+ long_u uc_argt; /* The argument type */
+ char_u *uc_rep; /* The command's replacement string */
+ long uc_def; /* The default value for a range/count */
+ scid_T uc_scriptID; /* SID where the command was defined */
+ int uc_compl; /* completion type */
+# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ char_u *uc_compl_arg; /* completion argument if any */
+# endif
+} ucmd_T;
+
+#define UC_BUFFER 1 /* -buffer: local to current buffer */
+
+garray_T ucmds = {0, 0, sizeof(ucmd_T), 4, NULL};
+
+#define USER_CMD(i) (&((ucmd_T *)(ucmds.ga_data))[i])
+#define USER_CMD_GA(gap, i) (&((ucmd_T *)((gap)->ga_data))[i])
+
+static void do_ucmd __ARGS((exarg_T *eap));
+static void ex_command __ARGS((exarg_T *eap));
+static void ex_comclear __ARGS((exarg_T *eap));
+static void ex_delcommand __ARGS((exarg_T *eap));
+# ifdef FEAT_CMDL_COMPL
+static char_u *get_user_command_name __ARGS((int idx));
+# endif
+
+#else
+# define ex_command ex_ni
+# define ex_comclear ex_ni
+# define ex_delcommand ex_ni
+#endif
+
+#ifdef FEAT_EVAL
+static char_u *do_one_cmd __ARGS((char_u **, int, struct condstack *, char_u *(*getline)(int, void *, int), void *cookie));
+#else
+static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*getline)(int, void *, int), void *cookie));
+static int if_level = 0; /* depth in :if */
+#endif
+static int checkforcmd __ARGS((char_u **pp, char *cmd, int len));
+static char_u *find_command __ARGS((exarg_T *eap, int *full));
+
+static void ex_abbreviate __ARGS((exarg_T *eap));
+static void ex_map __ARGS((exarg_T *eap));
+static void ex_unmap __ARGS((exarg_T *eap));
+static void ex_mapclear __ARGS((exarg_T *eap));
+static void ex_abclear __ARGS((exarg_T *eap));
+#ifndef FEAT_MENU
+# define ex_emenu ex_ni
+# define ex_menu ex_ni
+# define ex_menutranslate ex_ni
+#endif
+#ifdef FEAT_AUTOCMD
+static void ex_autocmd __ARGS((exarg_T *eap));
+static void ex_doautocmd __ARGS((exarg_T *eap));
+#else
+# define ex_autocmd ex_ni
+# define ex_doautocmd ex_ni
+# define ex_doautoall ex_ni
+#endif
+#ifdef FEAT_LISTCMDS
+static void ex_bunload __ARGS((exarg_T *eap));
+static void ex_buffer __ARGS((exarg_T *eap));
+static void ex_bmodified __ARGS((exarg_T *eap));
+static void ex_bnext __ARGS((exarg_T *eap));
+static void ex_bprevious __ARGS((exarg_T *eap));
+static void ex_brewind __ARGS((exarg_T *eap));
+static void ex_blast __ARGS((exarg_T *eap));
+#else
+# define ex_bunload ex_ni
+# define ex_buffer ex_ni
+# define ex_bmodified ex_ni
+# define ex_bnext ex_ni
+# define ex_bprevious ex_ni
+# define ex_brewind ex_ni
+# define ex_blast ex_ni
+# define buflist_list ex_ni
+# define ex_checktime ex_ni
+#endif
+#if !defined(FEAT_LISTCMDS) || !defined(FEAT_WINDOWS)
+# define ex_buffer_all ex_ni
+#endif
+static char_u *getargcmd __ARGS((char_u **));
+static char_u *skip_cmd_arg __ARGS((char_u *p, int rembs));
+static int getargopt __ARGS((exarg_T *eap));
+#ifndef FEAT_QUICKFIX
+# define ex_make ex_ni
+# define ex_cc ex_ni
+# define ex_cnext ex_ni
+# define ex_cfile ex_ni
+# define qf_list ex_ni
+# define qf_age ex_ni
+# define ex_helpgrep ex_ni
+#endif
+#if !defined(FEAT_QUICKFIX) || !defined(FEAT_WINDOWS)
+# define ex_cclose ex_ni
+# define ex_copen ex_ni
+# define ex_cwindow ex_ni
+#endif
+
+static int check_more __ARGS((int, int));
+static linenr_T get_address __ARGS((char_u **, int skip, int to_other_file));
+#if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
+ || !defined(FEAT_RUBY)
+static void ex_script_ni __ARGS((exarg_T *eap));
+#endif
+static char_u *invalid_range __ARGS((exarg_T *eap));
+static void correct_range __ARGS((exarg_T *eap));
+static char_u *repl_cmdline __ARGS((exarg_T *eap, char_u *src, int srclen, char_u *repl, char_u **cmdlinep));
+static void ex_highlight __ARGS((exarg_T *eap));
+static void ex_colorscheme __ARGS((exarg_T *eap));
+static void ex_quit __ARGS((exarg_T *eap));
+static void ex_cquit __ARGS((exarg_T *eap));
+static void ex_quit_all __ARGS((exarg_T *eap));
+#ifdef FEAT_WINDOWS
+static void ex_close __ARGS((exarg_T *eap));
+static void ex_win_close __ARGS((exarg_T *eap, win_T *win));
+static void ex_only __ARGS((exarg_T *eap));
+static void ex_all __ARGS((exarg_T *eap));
+static void ex_resize __ARGS((exarg_T *eap));
+static void ex_stag __ARGS((exarg_T *eap));
+#else
+# define ex_close ex_ni
+# define ex_only ex_ni
+# define ex_all ex_ni
+# define ex_resize ex_ni
+# define ex_splitview ex_ni
+# define ex_stag ex_ni
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+static void ex_pclose __ARGS((exarg_T *eap));
+static void ex_ptag __ARGS((exarg_T *eap));
+static void ex_pedit __ARGS((exarg_T *eap));
+#else
+# define ex_pclose ex_ni
+# define ex_ptag ex_ni
+# define ex_pedit ex_ni
+#endif
+static void ex_hide __ARGS((exarg_T *eap));
+static void ex_stop __ARGS((exarg_T *eap));
+static void ex_exit __ARGS((exarg_T *eap));
+static void ex_print __ARGS((exarg_T *eap));
+#ifdef FEAT_BYTEOFF
+static void ex_goto __ARGS((exarg_T *eap));
+#else
+# define ex_goto ex_ni
+#endif
+static void ex_shell __ARGS((exarg_T *eap));
+static void ex_preserve __ARGS((exarg_T *eap));
+static void ex_recover __ARGS((exarg_T *eap));
+#ifndef FEAT_LISTCMDS
+# define ex_argedit ex_ni
+# define ex_argadd ex_ni
+# define ex_argdelete ex_ni
+# define ex_listdo ex_ni
+#endif
+static void ex_mode __ARGS((exarg_T *eap));
+static void ex_wrongmodifier __ARGS((exarg_T *eap));
+static void ex_find __ARGS((exarg_T *eap));
+static void ex_edit __ARGS((exarg_T *eap));
+#if !defined(FEAT_GUI) && !defined(FEAT_CLIENTSERVER)
+# define ex_drop ex_ni
+#endif
+#ifndef FEAT_GUI
+# define ex_gui ex_nogui
+static void ex_nogui __ARGS((exarg_T *eap));
+#endif
+#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+static void ex_tearoff __ARGS((exarg_T *eap));
+#else
+# define ex_tearoff ex_ni
+#endif
+#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
+static void ex_popup __ARGS((exarg_T *eap));
+#else
+# define ex_popup ex_ni
+#endif
+#ifndef FEAT_GUI_MSWIN
+# define ex_simalt ex_ni
+#endif
+#if !defined(FEAT_GUI_MSWIN) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
+# define gui_mch_find_dialog ex_ni
+# define gui_mch_replace_dialog ex_ni
+#endif
+#ifndef FEAT_GUI_GTK
+# define ex_helpfind ex_ni
+#endif
+#ifndef FEAT_CSCOPE
+# define do_cscope ex_ni
+# define do_scscope ex_ni
+# define do_cstag ex_ni
+#endif
+#ifndef FEAT_SYN_HL
+# define ex_syntax ex_ni
+#endif
+#ifndef FEAT_PERL
+# define ex_perl ex_script_ni
+# define ex_perldo ex_ni
+#endif
+#ifndef FEAT_PYTHON
+# define ex_python ex_script_ni
+# define ex_pyfile ex_ni
+#endif
+#ifndef FEAT_TCL
+# define ex_tcl ex_script_ni
+# define ex_tcldo ex_ni
+# define ex_tclfile ex_ni
+#endif
+#ifndef FEAT_RUBY
+# define ex_ruby ex_script_ni
+# define ex_rubydo ex_ni
+# define ex_rubyfile ex_ni
+#endif
+#ifndef FEAT_SNIFF
+# define ex_sniff ex_ni
+#endif
+#ifndef FEAT_KEYMAP
+# define ex_loadkeymap ex_ni
+#endif
+static void ex_swapname __ARGS((exarg_T *eap));
+static void ex_syncbind __ARGS((exarg_T *eap));
+static void ex_read __ARGS((exarg_T *eap));
+static void ex_cd __ARGS((exarg_T *eap));
+static void ex_pwd __ARGS((exarg_T *eap));
+static void ex_equal __ARGS((exarg_T *eap));
+static void ex_sleep __ARGS((exarg_T *eap));
+static void do_exmap __ARGS((exarg_T *eap, int isabbrev));
+static void ex_winsize __ARGS((exarg_T *eap));
+#ifdef FEAT_WINDOWS
+static void ex_wincmd __ARGS((exarg_T *eap));
+#else
+# define ex_wincmd ex_ni
+#endif
+#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS)
+static void ex_winpos __ARGS((exarg_T *eap));
+#else
+# define ex_winpos ex_ni
+#endif
+static void ex_operators __ARGS((exarg_T *eap));
+static void ex_put __ARGS((exarg_T *eap));
+static void ex_copymove __ARGS((exarg_T *eap));
+static void ex_submagic __ARGS((exarg_T *eap));
+static void ex_join __ARGS((exarg_T *eap));
+static void ex_at __ARGS((exarg_T *eap));
+static void ex_bang __ARGS((exarg_T *eap));
+static void ex_undo __ARGS((exarg_T *eap));
+static void ex_redo __ARGS((exarg_T *eap));
+static void ex_redir __ARGS((exarg_T *eap));
+static void ex_redraw __ARGS((exarg_T *eap));
+static void ex_redrawstatus __ARGS((exarg_T *eap));
+static void close_redir __ARGS((void));
+static void ex_mkrc __ARGS((exarg_T *eap));
+static void ex_mark __ARGS((exarg_T *eap));
+#ifdef FEAT_USR_CMDS
+static char_u *uc_fun_cmd __ARGS((void));
+#endif
+#ifdef FEAT_EX_EXTRA
+static void ex_normal __ARGS((exarg_T *eap));
+static void ex_startinsert __ARGS((exarg_T *eap));
+static void ex_stopinsert __ARGS((exarg_T *eap));
+#else
+# define ex_normal ex_ni
+# define ex_align ex_ni
+# define ex_retab ex_ni
+# define ex_startinsert ex_ni
+# define ex_stopinsert ex_ni
+# define ex_helptags ex_ni
+#endif
+#ifdef FEAT_FIND_ID
+static void ex_checkpath __ARGS((exarg_T *eap));
+static void ex_findpat __ARGS((exarg_T *eap));
+#else
+# define ex_findpat ex_ni
+# define ex_checkpath ex_ni
+#endif
+#if defined(FEAT_FIND_ID) && defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+static void ex_psearch __ARGS((exarg_T *eap));
+#else
+# define ex_psearch ex_ni
+#endif
+static void ex_tag __ARGS((exarg_T *eap));
+static void ex_tag_cmd __ARGS((exarg_T *eap, char_u *name));
+#ifndef FEAT_EVAL
+# define ex_scriptnames ex_ni
+# define ex_finish ex_ni
+# define ex_echo ex_ni
+# define ex_echohl ex_ni
+# define ex_execute ex_ni
+# define ex_call ex_ni
+# define ex_if ex_ni
+# define ex_endif ex_ni
+# define ex_else ex_ni
+# define ex_while ex_ni
+# define ex_continue ex_ni
+# define ex_break ex_ni
+# define ex_endwhile ex_ni
+# define ex_throw ex_ni
+# define ex_try ex_ni
+# define ex_catch ex_ni
+# define ex_finally ex_ni
+# define ex_endtry ex_ni
+# define ex_endfunction ex_ni
+# define ex_let ex_ni
+# define ex_unlet ex_ni
+# define ex_function ex_ni
+# define ex_delfunction ex_ni
+# define ex_return ex_ni
+#endif
+static char_u *arg_all __ARGS((void));
+#ifdef FEAT_SESSION
+static int makeopens __ARGS((FILE *fd, char_u *dirnow));
+static int put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp));
+static void ex_loadview __ARGS((exarg_T *eap));
+static char_u *get_view_file __ARGS((int c));
+#else
+# define ex_loadview ex_ni
+#endif
+#ifndef FEAT_EVAL
+# define ex_compiler ex_ni
+#endif
+#ifdef FEAT_VIMINFO
+static void ex_viminfo __ARGS((exarg_T *eap));
+#else
+# define ex_viminfo ex_ni
+#endif
+static void ex_behave __ARGS((exarg_T *eap));
+#ifdef FEAT_AUTOCMD
+static void ex_filetype __ARGS((exarg_T *eap));
+static void ex_setfiletype __ARGS((exarg_T *eap));
+#else
+# define ex_filetype ex_ni
+# define ex_setfiletype ex_ni
+#endif
+#ifndef FEAT_DIFF
+# define ex_diffpatch ex_ni
+# define ex_diffgetput ex_ni
+# define ex_diffsplit ex_ni
+# define ex_diffthis ex_ni
+# define ex_diffupdate ex_ni
+#endif
+static void ex_digraphs __ARGS((exarg_T *eap));
+static void ex_set __ARGS((exarg_T *eap));
+#if !defined(FEAT_EVAL) || !defined(FEAT_AUTOCMD)
+# define ex_options ex_ni
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+static void ex_nohlsearch __ARGS((exarg_T *eap));
+static void ex_match __ARGS((exarg_T *eap));
+#else
+# define ex_nohlsearch ex_ni
+# define ex_match ex_ni
+#endif
+#ifdef FEAT_CRYPT
+static void ex_X __ARGS((exarg_T *eap));
+#else
+# define ex_X ex_ni
+#endif
+#ifdef FEAT_FOLDING
+static void ex_fold __ARGS((exarg_T *eap));
+static void ex_foldopen __ARGS((exarg_T *eap));
+static void ex_folddo __ARGS((exarg_T *eap));
+#else
+# define ex_fold ex_ni
+# define ex_foldopen ex_ni
+# define ex_folddo ex_ni
+#endif
+#if !((defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)))
+# define ex_language ex_ni
+#endif
+#ifndef FEAT_SIGNS
+# define ex_sign ex_ni
+#endif
+#ifndef FEAT_SUN_WORKSHOP
+# define ex_wsverb ex_ni
+#endif
+
+#ifndef FEAT_EVAL
+# define ex_debug ex_ni
+# define ex_breakadd ex_ni
+# define ex_debuggreedy ex_ni
+# define ex_breakdel ex_ni
+# define ex_breaklist ex_ni
+#endif
+
+#ifndef FEAT_CMDHIST
+# define ex_history ex_ni
+#endif
+#ifndef FEAT_JUMPLIST
+# define ex_jumps ex_ni
+# define ex_changes ex_ni
+#endif
+
+/*
+ * Declare cmdnames[].
+ */
+#define DO_DECLARE_EXCMD
+#include "ex_cmds.h"
+
+/*
+ * Table used to quickly search for a command, based on its first character.
+ */
+cmdidx_T cmdidxs[27] =
+{
+ CMD_append,
+ CMD_buffer,
+ CMD_change,
+ CMD_delete,
+ CMD_edit,
+ CMD_file,
+ CMD_global,
+ CMD_help,
+ CMD_insert,
+ CMD_join,
+ CMD_k,
+ CMD_list,
+ CMD_move,
+ CMD_next,
+ CMD_open,
+ CMD_print,
+ CMD_quit,
+ CMD_read,
+ CMD_substitute,
+ CMD_t,
+ CMD_undo,
+ CMD_vglobal,
+ CMD_write,
+ CMD_xit,
+ CMD_yank,
+ CMD_z,
+ CMD_bang
+};
+
+static char_u dollar_command[2] = {'$', 0};
+
+
+#ifdef FEAT_EVAL
+/* Struct for storing a line inside a while loop */
+typedef struct
+{
+ char_u *line; /* command line */
+ linenr_T lnum; /* sourcing_lnum of the line */
+} wcmd_T;
+
+/*
+ * Structure used to store info for line position in a while loop.
+ * This is required, because do_one_cmd() may invoke ex_function(), which
+ * reads more lines that may come from the while loop.
+ */
+struct while_cookie
+{
+ garray_T *lines_gap; /* growarray with line info */
+ int current_line; /* last read line from growarray */
+ int repeating; /* TRUE when looping a second time */
+ /* When "repeating" is FALSE use "getline" and "cookie" to get lines */
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie;
+};
+
+static char_u *get_while_line __ARGS((int c, void *cookie, int indent));
+static int store_while_line __ARGS((garray_T *gap, char_u *line));
+static void free_cmdlines __ARGS((garray_T *gap));
+#endif
+
+
+/*
+ * do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi"
+ * command is given.
+ */
+ void
+do_exmode(improved)
+ int improved; /* TRUE for "improved Ex" mode */
+{
+ int save_msg_scroll;
+ int prev_msg_row;
+ linenr_T prev_line;
+
+ save_msg_scroll = msg_scroll;
+ ++RedrawingDisabled; /* don't redisplay the window */
+ ++no_wait_return; /* don't wait for return */
+ if (improved)
+ exmode_active = EXMODE_VIM;
+ else
+ {
+ settmode(TMODE_COOK);
+ exmode_active = EXMODE_NORMAL;
+ }
+
+ State = NORMAL;
+#ifdef FEAT_GUI
+ /* Ignore scrollbar and mouse events in Ex mode */
+ ++hold_gui_events;
+#endif
+#ifdef FEAT_SNIFF
+ want_sniff_request = 0; /* No K_SNIFF wanted */
+#endif
+
+ MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode."));
+ while (exmode_active)
+ {
+ msg_scroll = TRUE;
+ need_wait_return = FALSE;
+ ex_pressedreturn = FALSE;
+ ex_no_reprint = FALSE;
+ prev_msg_row = msg_row;
+ prev_line = curwin->w_cursor.lnum;
+#ifdef FEAT_SNIFF
+ ProcessSniffRequests();
+#endif
+ if (improved)
+ {
+ cmdline_row = msg_row;
+ do_cmdline(NULL, getexline, NULL, 0);
+ }
+ else
+ do_cmdline(NULL, getexmodeline, NULL, DOCMD_NOWAIT);
+ lines_left = Rows - 1;
+
+ if (prev_line != curwin->w_cursor.lnum && !ex_no_reprint)
+ {
+ if (ex_pressedreturn)
+ {
+ /* go up one line, to overwrite the ":<CR>" line, so the
+ * output doensn't contain empty lines. */
+ msg_row = prev_msg_row;
+ if (prev_msg_row == Rows - 1)
+ msg_row--;
+ }
+ msg_col = 0;
+ print_line_no_prefix(curwin->w_cursor.lnum, FALSE);
+ msg_clr_eos();
+ }
+ else if (ex_pressedreturn) /* must be at EOF */
+ EMSG(_("E501: At end-of-file"));
+ }
+
+#ifdef FEAT_GUI
+ --hold_gui_events;
+#endif
+ if (!improved)
+ settmode(TMODE_RAW);
+ --RedrawingDisabled;
+ --no_wait_return;
+ update_screen(CLEAR);
+ need_wait_return = FALSE;
+ msg_scroll = save_msg_scroll;
+}
+
+/*
+ * Execute a simple command line. Used for translated commands like "*".
+ */
+ int
+do_cmdline_cmd(cmd)
+ char_u *cmd;
+{
+ return do_cmdline(cmd, NULL, NULL,
+ DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
+}
+
+/*
+ * do_cmdline(): execute one Ex command line
+ *
+ * 1. Execute "cmdline" when it is not NULL.
+ * If "cmdline" is NULL, or more lines are needed, getline() is used.
+ * 2. Split up in parts separated with '|'.
+ *
+ * This function can be called recursively!
+ *
+ * flags:
+ * DOCMD_VERBOSE - The command will be included in the error message.
+ * DOCMD_NOWAIT - Don't call wait_return() and friends.
+ * DOCMD_REPEAT - Repeat execution until getline() returns NULL.
+ * DOCMD_KEYTYPED - Don't reset KeyTyped.
+ * DOCMD_EXCRESET - Reset the exception environment (used for debugging).
+ * DOCMD_KEEPLINE - Store first typed line (for repeating with ".").
+ *
+ * return FAIL if cmdline could not be executed, OK otherwise
+ */
+ int
+do_cmdline(cmdline, getline, cookie, flags)
+ char_u *cmdline;
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie; /* argument for getline() */
+ int flags;
+{
+ char_u *next_cmdline; /* next cmd to execute */
+ char_u *cmdline_copy = NULL; /* copy of cmd line */
+ int used_getline = FALSE; /* used "getline" to obtain command */
+ static int recursive = 0; /* recursive depth */
+ int msg_didout_before_start = 0;
+ int count = 0; /* line number count */
+ int did_inc = FALSE; /* incremented RedrawingDisabled */
+ int retval = OK;
+#ifdef FEAT_EVAL
+ struct condstack cstack; /* conditional stack */
+ garray_T lines_ga; /* keep lines for ":while" */
+ int current_line = 0; /* active line in lines_ga */
+ char_u *fname = NULL; /* function or script name */
+ linenr_T *breakpoint = NULL; /* ptr to breakpoint field in cookie */
+ int *dbg_tick = NULL; /* ptr to dbg_tick field in cookie */
+ int saved_trylevel = 0;
+ int saved_force_abort = 0;
+ except_T *saved_caught_stack = NULL;
+ char_u *saved_vv_exception = NULL;
+ char_u *saved_vv_throwpoint = NULL;
+ int saved_did_emsg = 0;
+ int saved_got_int = 0;
+ int saved_did_throw = 0;
+ int saved_need_rethrow = 0;
+ int saved_check_cstack = 0;
+ except_T *saved_current_exception = NULL;
+ int initial_trylevel;
+ struct msglist **saved_msg_list = NULL;
+ struct msglist *private_msg_list;
+
+ /* "getline" and "cookie" passed to do_one_cmd() */
+ char_u *(*cmd_getline) __ARGS((int, void *, int));
+ void *cmd_cookie;
+ struct while_cookie cmd_while_cookie;
+ void *real_cookie;
+#else
+# define cmd_getline getline
+# define cmd_cookie cookie
+#endif
+ static int call_depth = 0; /* recursiveness */
+
+#ifdef FEAT_EVAL
+ /* For every pair of do_cmdline()/do_one_cmd() calls, use an extra memory
+ * location for storing error messages to be converted to an exception.
+ * This ensures that the do_errthrow() call in do_one_cmd() does not combine
+ * the messages stored by an earlier invocation of do_one_cmd() with the
+ * command name of the later one. This would happen when BufWritePost
+ * autocommands are executed after a write error. */
+ saved_msg_list = msg_list;
+ msg_list = &private_msg_list;
+ private_msg_list = NULL;
+#endif
+
+ /* It's possible to create an endless loop with ":execute", catch that
+ * here. The value of 200 allows nested function calls, ":source", etc. */
+ if (call_depth == 200)
+ {
+ EMSG(_("E169: Command too recursive"));
+#ifdef FEAT_EVAL
+ /* When converting to an exception, we do not include the command name
+ * since this is not an error of the specific command. */
+ do_errthrow((struct condstack *)NULL, (char_u *)NULL);
+ msg_list = saved_msg_list;
+#endif
+ return FAIL;
+ }
+ ++call_depth;
+
+#ifdef FEAT_EVAL
+ cstack.cs_idx = -1;
+ cstack.cs_whilelevel = 0;
+ cstack.cs_trylevel = 0;
+ cstack.cs_emsg_silent_list = NULL;
+ cstack.cs_had_while = FALSE;
+ cstack.cs_had_endwhile = FALSE;
+ cstack.cs_had_continue = FALSE;
+ cstack.cs_had_finally = FALSE;
+ ga_init2(&lines_ga, (int)sizeof(wcmd_T), 10);
+
+ real_cookie = getline_cookie(getline, cookie);
+
+ /* Inside a function use a higher nesting level. */
+ if (getline_equal(getline, cookie, get_func_line)
+ && ex_nesting_level == func_level(real_cookie))
+ ++ex_nesting_level;
+
+ /* Get the function or script name and the address where the next breakpoint
+ * line and the debug tick for a function or script are stored. */
+ if (getline_equal(getline, cookie, get_func_line))
+ {
+ fname = func_name(real_cookie);
+ breakpoint = func_breakpoint(real_cookie);
+ dbg_tick = func_dbg_tick(real_cookie);
+ }
+ else if (getline_equal(getline, cookie, getsourceline))
+ {
+ fname = sourcing_name;
+ breakpoint = source_breakpoint(real_cookie);
+ dbg_tick = source_dbg_tick(real_cookie);
+ }
+
+ /*
+ * Initialize "force_abort" and "suppress_errthrow" at the top level.
+ */
+ if (!recursive)
+ {
+ force_abort = FALSE;
+ suppress_errthrow = FALSE;
+ }
+
+ /*
+ * If requested, store and reset the global values controlling the
+ * exception handling (used when debugging).
+ */
+ else if (flags & DOCMD_EXCRESET)
+ {
+ saved_trylevel = trylevel; trylevel = 0;
+ saved_force_abort = force_abort; force_abort = FALSE;
+ saved_caught_stack = caught_stack; caught_stack = NULL;
+ saved_vv_exception = v_exception(NULL);
+ saved_vv_throwpoint = v_throwpoint(NULL);
+ /* Necessary for debugging an inactive ":catch", ":finally", or
+ * ":endtry": */
+ saved_did_emsg = did_emsg, did_emsg = FALSE;
+ saved_got_int = got_int, got_int = FALSE;
+ saved_did_throw = did_throw, did_throw = FALSE;
+ saved_need_rethrow = need_rethrow, need_rethrow = FALSE;
+ saved_check_cstack = check_cstack, check_cstack = FALSE;
+ saved_current_exception = current_exception; current_exception=NULL;
+ }
+
+ initial_trylevel = trylevel;
+
+ /*
+ * "did_throw" will be set to TRUE when an exception is being thrown.
+ */
+ did_throw = FALSE;
+#endif
+ /*
+ * "did_emsg" will be set to TRUE when emsg() is used, in which case we
+ * cancel the whole command line, and any if/endif while/endwhile loop.
+ * If force_abort is set, we cancel everything.
+ */
+ did_emsg = FALSE;
+
+ /*
+ * KeyTyped is only set when calling vgetc(). Reset it here when not
+ * calling vgetc() (sourced command lines).
+ */
+ if (!(flags & DOCMD_KEYTYPED) && !getline_equal(getline, cookie, getexline))
+ KeyTyped = FALSE;
+
+ /*
+ * Continue executing command lines:
+ * - when inside an ":if" or ":while"
+ * - for multiple commands on one line, separated with '|'
+ * - when repeating until there are no more lines (for ":source")
+ */
+ next_cmdline = cmdline;
+ do
+ {
+ /* stop skipping cmds for an error msg after all endifs and endwhiles */
+ if (next_cmdline == NULL
+#ifdef FEAT_EVAL
+ && !force_abort
+ && cstack.cs_idx < 0
+ && !(getline_equal(getline, cookie, get_func_line)
+ && func_has_abort(real_cookie))
+#endif
+ )
+ did_emsg = FALSE;
+
+ /*
+ * 1. If repeating a line with ":while", get a line from lines_ga.
+ * 2. If no line given: Get an allocated line with getline().
+ * 3. If a line is given: Make a copy, so we can mess with it.
+ */
+
+#ifdef FEAT_EVAL
+ /* 1. If repeating, get a previous line from lines_ga. */
+ if (cstack.cs_whilelevel && current_line < lines_ga.ga_len)
+ {
+ /* Each '|' separated command is stored separately in lines_ga, to
+ * be able to jump to it. Don't use next_cmdline now. */
+ vim_free(cmdline_copy);
+ cmdline_copy = NULL;
+
+ /* Check if a function has returned or, unless it has an unclosed
+ * try conditional, aborted. */
+ if (getline_equal(getline, cookie, get_func_line)
+ && func_has_ended(real_cookie))
+ {
+ retval = FAIL;
+ break;
+ }
+
+ /* Check if a sourced file hit a ":finish" command. */
+ if (source_finished(getline, cookie))
+ {
+ retval = FAIL;
+ break;
+ }
+
+ /* If breakpoints have been added/deleted need to check for it. */
+ if (breakpoint != NULL && dbg_tick != NULL
+ && *dbg_tick != debug_tick)
+ {
+ *breakpoint = dbg_find_breakpoint(
+ getline_equal(getline, cookie, getsourceline),
+ fname, sourcing_lnum);
+ *dbg_tick = debug_tick;
+ }
+
+ next_cmdline = ((wcmd_T *)(lines_ga.ga_data))[current_line].line;
+ sourcing_lnum = ((wcmd_T *)(lines_ga.ga_data))[current_line].lnum;
+
+ /* Did we encounter a breakpoint? */
+ if (breakpoint != NULL && *breakpoint != 0
+ && *breakpoint <= sourcing_lnum)
+ {
+ dbg_breakpoint(fname, sourcing_lnum);
+ /* Find next breakpoint. */
+ *breakpoint = dbg_find_breakpoint(
+ getline_equal(getline, cookie, getsourceline),
+ fname, sourcing_lnum);
+ *dbg_tick = debug_tick;
+ }
+ }
+
+ if (cstack.cs_whilelevel)
+ {
+ /* Inside a while loop we need to store the lines and use them
+ * again. Pass a different "getline" function to do_one_cmd()
+ * below, so that it stores lines in or reads them from
+ * "lines_ga". Makes it possible to define a function inside a
+ * while loop. */
+ cmd_getline = get_while_line;
+ cmd_cookie = (void *)&cmd_while_cookie;
+ cmd_while_cookie.lines_gap = &lines_ga;
+ cmd_while_cookie.current_line = current_line;
+ cmd_while_cookie.getline = getline;
+ cmd_while_cookie.cookie = cookie;
+ cmd_while_cookie.repeating = (current_line < lines_ga.ga_len);
+ }
+ else
+ {
+ cmd_getline = getline;
+ cmd_cookie = cookie;
+ }
+#endif
+
+ /* 2. If no line given, get an allocated line with getline(). */
+ if (next_cmdline == NULL)
+ {
+ /*
+ * Need to set msg_didout for the first line after an ":if",
+ * otherwise the ":if" will be overwritten.
+ */
+ if (count == 1 && getline_equal(getline, cookie, getexline))
+ msg_didout = TRUE;
+ if (getline == NULL || (next_cmdline = getline(':', cookie,
+#ifdef FEAT_EVAL
+ cstack.cs_idx < 0 ? 0 : (cstack.cs_idx + 1) * 2
+#else
+ 0
+#endif
+ )) == NULL)
+ {
+ /* Don't call wait_return for aborted command line. The NULL
+ * returned for the end of a sourced file or executed function
+ * doesn't do this. */
+ if (KeyTyped && !(flags & DOCMD_REPEAT))
+ need_wait_return = FALSE;
+ retval = FAIL;
+ break;
+ }
+ used_getline = TRUE;
+
+ /*
+ * Keep the first typed line. Clear it when more lines are typed.
+ */
+ if (flags & DOCMD_KEEPLINE)
+ {
+ vim_free(repeat_cmdline);
+ if (count == 0)
+ repeat_cmdline = vim_strsave(next_cmdline);
+ else
+ repeat_cmdline = NULL;
+ }
+ }
+
+ /* 3. Make a copy of the command so we can mess with it. */
+ else if (cmdline_copy == NULL)
+ {
+ next_cmdline = vim_strsave(next_cmdline);
+ if (next_cmdline == NULL)
+ {
+ EMSG(_(e_outofmem));
+ retval = FAIL;
+ break;
+ }
+ }
+ cmdline_copy = next_cmdline;
+
+#ifdef FEAT_EVAL
+ /*
+ * Save the current line when inside a ":while", and when the command
+ * looks like a ":while", because we may need it later.
+ * When there is a '|' and another command, it is stored separately,
+ * because we need to be able to jump back to it from an :endwhile.
+ */
+ if ( current_line == lines_ga.ga_len
+ && (cstack.cs_whilelevel || has_while_cmd(next_cmdline)))
+ {
+ if (store_while_line(&lines_ga, next_cmdline) == FAIL)
+ {
+ retval = FAIL;
+ break;
+ }
+ }
+ did_endif = FALSE;
+#endif
+
+ if (count++ == 0)
+ {
+ /*
+ * All output from the commands is put below each other, without
+ * waiting for a return. Don't do this when executing commands
+ * from a script or when being called recursive (e.g. for ":e
+ * +command file").
+ */
+ if (!(flags & DOCMD_NOWAIT) && !recursive)
+ {
+ msg_didout_before_start = msg_didout;
+ msg_didany = FALSE; /* no output yet */
+ msg_start();
+ msg_scroll = TRUE; /* put messages below each other */
+ ++no_wait_return; /* dont wait for return until finished */
+ ++RedrawingDisabled;
+ did_inc = TRUE;
+ }
+ }
+
+ if (p_verbose >= 15 && sourcing_name != NULL)
+ {
+ int c = -1;
+
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ /* Truncate long lines, smsg() can't handle that. */
+ if (STRLEN(cmdline_copy) > 200)
+ {
+ c = cmdline_copy[200];
+ cmdline_copy[200] = NUL;
+ }
+ smsg((char_u *)_("line %ld: %s"),
+ (long)sourcing_lnum, cmdline_copy);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ if (c >= 0)
+ cmdline_copy[200] = c;
+ cmdline_row = msg_row;
+ --no_wait_return;
+ }
+
+ /*
+ * 2. Execute one '|' separated command.
+ * do_one_cmd() will return NULL if there is no trailing '|'.
+ * "cmdline_copy" can change, e.g. for '%' and '#' expansion.
+ */
+ ++recursive;
+ next_cmdline = do_one_cmd(&cmdline_copy, flags & DOCMD_VERBOSE,
+#ifdef FEAT_EVAL
+ &cstack,
+#endif
+ cmd_getline, cmd_cookie);
+ --recursive;
+
+#ifdef FEAT_EVAL
+ if (cmd_cookie == (void *)&cmd_while_cookie)
+ /* Use "current_line" from "cmd_while_cookie", it may have been
+ * incremented when defining a function. */
+ current_line = cmd_while_cookie.current_line;
+#endif
+
+ if (next_cmdline == NULL)
+ {
+ vim_free(cmdline_copy);
+ cmdline_copy = NULL;
+#ifdef FEAT_CMDHIST
+ /*
+ * If the command was typed, remember it for the ':' register.
+ * Do this AFTER executing the command to make :@: work.
+ */
+ if (getline_equal(getline, cookie, getexline)
+ && new_last_cmdline != NULL)
+ {
+ vim_free(last_cmdline);
+ last_cmdline = new_last_cmdline;
+ new_last_cmdline = NULL;
+ }
+#endif
+ }
+ else
+ {
+ /* need to copy the command after the '|' to cmdline_copy, for the
+ * next do_one_cmd() */
+ mch_memmove(cmdline_copy, next_cmdline, STRLEN(next_cmdline) + 1);
+ next_cmdline = cmdline_copy;
+ }
+
+
+#ifdef FEAT_EVAL
+ /* reset did_emsg for a function that is not aborted by an error */
+ if (did_emsg && !force_abort
+ && getline_equal(getline, cookie, get_func_line)
+ && !func_has_abort(real_cookie))
+ did_emsg = FALSE;
+
+ if (cstack.cs_whilelevel)
+ {
+ ++current_line;
+
+ /*
+ * An ":endwhile" and ":continue" is handled here.
+ * If we were executing commands, jump back to the ":while".
+ * If we were not executing commands, decrement whilelevel.
+ */
+ if (cstack.cs_had_endwhile || cstack.cs_had_continue)
+ {
+ if (cstack.cs_had_endwhile)
+ cstack.cs_had_endwhile = FALSE;
+ else
+ cstack.cs_had_continue = FALSE;
+
+ /* Jump back to the matching ":while". Be careful not to use
+ * a cs_line[] from an entry that isn't a ":while": It would
+ * make "current_line" invalid and can cause a crash. */
+ if (!did_emsg && !got_int && !did_throw
+ && cstack.cs_idx >= 0
+ && (cstack.cs_flags[cstack.cs_idx] & CSF_WHILE)
+ && cstack.cs_line[cstack.cs_idx] >= 0
+ && (cstack.cs_flags[cstack.cs_idx] & CSF_ACTIVE))
+ {
+ current_line = cstack.cs_line[cstack.cs_idx];
+ cstack.cs_had_while = TRUE; /* note we jumped there */
+ line_breakcheck(); /* check if CTRL-C typed */
+
+ /* Check for the next breakpoint at or after the ":while".*/
+ if (breakpoint != NULL)
+ {
+ *breakpoint = dbg_find_breakpoint(
+ getline_equal(getline, cookie, getsourceline),
+ fname,
+ ((wcmd_T *)lines_ga.ga_data)[current_line].lnum-1);
+ *dbg_tick = debug_tick;
+ }
+ }
+ else /* can only get here with ":endwhile" */
+ {
+ --cstack.cs_whilelevel;
+ if (cstack.cs_idx >= 0)
+ --cstack.cs_idx;
+ }
+ }
+
+ /*
+ * For a ":while" we need to remember the line number.
+ */
+ else if (cstack.cs_had_while)
+ {
+ cstack.cs_had_while = FALSE;
+ cstack.cs_line[cstack.cs_idx] = current_line - 1;
+ }
+ }
+
+ /*
+ * When not inside any ":while" loop, clear remembered lines.
+ */
+ if (!cstack.cs_whilelevel)
+ {
+ if (lines_ga.ga_len > 0)
+ {
+ sourcing_lnum =
+ ((wcmd_T *)lines_ga.ga_data)[lines_ga.ga_len - 1].lnum;
+ free_cmdlines(&lines_ga);
+ }
+ current_line = 0;
+ }
+
+ /*
+ * A ":finally" makes did_emsg, got_int, and did_throw pending for being
+ * restored at the ":endtry". Reset them here and set the ACTIVE and
+ * FINALLY flags, so that the finally clause gets executed. This
+ * includes the case where a missing ":endif" or ":endwhile" was
+ * detected by the ":finally" itself.
+ */
+ if (cstack.cs_had_finally)
+ {
+ cstack.cs_had_finally = FALSE;
+ report_make_pending(cstack.cs_pending[cstack.cs_idx] &
+ (CSTP_ERROR | CSTP_INTERRUPT | CSTP_THROW),
+ did_throw ? (void *)current_exception : NULL);
+ did_emsg = got_int = did_throw = FALSE;
+ cstack.cs_flags[cstack.cs_idx] |= CSF_ACTIVE | CSF_FINALLY;
+ }
+
+ /* Update global "trylevel" for recursive calls to do_cmdline() from
+ * within this loop. */
+ trylevel = initial_trylevel + cstack.cs_trylevel;
+
+ /*
+ * If the outermost try conditional (accross function calls and sourced
+ * files) is aborted because of an error, an interrupt, or an uncaught
+ * exception, cancel everything. If it is left normally, reset
+ * force_abort to get the non-EH compatible abortion behavior for
+ * the rest of the script.
+ */
+ if (trylevel == 0 && !did_emsg && !got_int && !did_throw)
+ force_abort = FALSE;
+
+ /* Convert an interrupt to an exception if appropriate. */
+ (void)do_intthrow(&cstack);
+#endif /* FEAT_EVAL */
+
+ }
+ /*
+ * Continue executing command lines when:
+ * - no CTRL-C typed, no aborting error, no exception thrown or try
+ * conditionals need to be checked for executing finally clauses or
+ * catching an interrupt exception
+ * - didn't get an error message or lines are not typed
+ * - there is a command after '|', inside a :if, :while, or :try, or
+ * looping for ":source" command or function call.
+ */
+ while (!((got_int
+#ifdef FEAT_EVAL
+ || (did_emsg && force_abort) || did_throw
+#endif
+ )
+#ifdef FEAT_EVAL
+ && cstack.cs_trylevel == 0
+#endif
+ )
+ && !(did_emsg && used_getline
+ && (getline_equal(getline, cookie, getexmodeline)
+ || getline_equal(getline, cookie, getexline)))
+ && (next_cmdline != NULL
+#ifdef FEAT_EVAL
+ || cstack.cs_idx >= 0
+#endif
+ || (flags & DOCMD_REPEAT)));
+
+ vim_free(cmdline_copy);
+#ifdef FEAT_EVAL
+ free_cmdlines(&lines_ga);
+ ga_clear(&lines_ga);
+
+ if (cstack.cs_idx >= 0)
+ {
+ /*
+ * If a sourced file or executed function ran to its end, report the
+ * unclosed conditional.
+ */
+ if (!got_int && !did_throw
+ && ((getline_equal(getline, cookie, getsourceline)
+ && !source_finished(getline, cookie))
+ || (getline_equal(getline, cookie, get_func_line)
+ && !func_has_ended(real_cookie))))
+ {
+ if (cstack.cs_flags[cstack.cs_idx] & CSF_TRY)
+ EMSG(_(e_endtry));
+ else if (cstack.cs_flags[cstack.cs_idx] & CSF_WHILE)
+ EMSG(_(e_endwhile));
+ else
+ EMSG(_(e_endif));
+ }
+
+ /*
+ * Reset "trylevel" in case of a ":finish" or ":return" or a missing
+ * ":endtry" in a sourced file or executed function. If the try
+ * conditional is in its finally clause, ignore anything pending.
+ * If it is in a catch clause, finish the caught exception.
+ */
+ do
+ cstack.cs_idx = cleanup_conditionals(&cstack, 0, TRUE);
+ while (--cstack.cs_idx >= 0);
+ trylevel = initial_trylevel;
+ }
+
+ /* If a missing ":endtry", ":endwhile", or ":endif" or a memory lack
+ * was reported above and the error message is to be converted to an
+ * exception, do this now after rewinding the cstack. */
+ do_errthrow(&cstack, getline_equal(getline, cookie, get_func_line)
+ ? (char_u *)"endfunction" : (char_u *)NULL);
+
+ if (trylevel == 0)
+ {
+ /*
+ * When an exception is being thrown out of the outermost try
+ * conditional, discard the uncaught exception, disable the conversion
+ * of interrupts or errors to exceptions, and ensure that no more
+ * commands are executed.
+ */
+ if (did_throw)
+ {
+ void *p = NULL;
+ char_u *saved_sourcing_name;
+ int saved_sourcing_lnum;
+ struct msglist *messages = NULL, *next;
+
+ /*
+ * If the uncaught exception is a user exception, report it as an
+ * error. If it is an error exception, display the saved error
+ * message now. For an interrupt exception, do nothing; the
+ * interrupt message is given elsewhere.
+ */
+ switch (current_exception->type)
+ {
+ case ET_USER:
+ sprintf((char *)IObuff, _("E605: Exception not caught: %s"),
+ current_exception->value);
+ p = vim_strsave(IObuff);
+ break;
+ case ET_ERROR:
+ messages = current_exception->messages;
+ current_exception->messages = NULL;
+ break;
+ case ET_INTERRUPT:
+ break;
+ default:
+ p = vim_strsave((char_u *)_(e_internal));
+ }
+
+ saved_sourcing_name = sourcing_name;
+ saved_sourcing_lnum = sourcing_lnum;
+ sourcing_name = current_exception->throw_name;
+ sourcing_lnum = current_exception->throw_lnum;
+ current_exception->throw_name = NULL;
+
+ discard_current_exception(); /* uses IObuff if 'verbose' */
+ suppress_errthrow = TRUE;
+ force_abort = TRUE;
+
+ if (messages != NULL)
+ {
+ do
+ {
+ next = messages->next;
+ emsg(messages->msg);
+ vim_free(messages->msg);
+ vim_free(messages);
+ messages = next;
+ }
+ while (messages != NULL);
+ }
+ else if (p != NULL)
+ {
+ emsg(p);
+ vim_free(p);
+ }
+ vim_free(sourcing_name);
+ sourcing_name = saved_sourcing_name;
+ sourcing_lnum = saved_sourcing_lnum;
+ }
+
+ /*
+ * On an interrupt or an aborting error not converted to an exception,
+ * disable the conversion of errors to exceptions. (Interrupts are not
+ * converted any more, here.) This enables also the interrupt message
+ * when force_abort is set and did_emsg unset in case of an interrupt
+ * from a finally clause after an error.
+ */
+ else if (got_int || (did_emsg && force_abort))
+ suppress_errthrow = TRUE;
+ }
+
+ /*
+ * The current cstack will be freed when do_cmdline() returns. An uncaught
+ * exception will have to be rethrown in the previous cstack. If a function
+ * has just returned or a script file was just finished and the previous
+ * cstack belongs to the same function or, respectively, script file, it
+ * will have to be checked for finally clauses to be executed due to the
+ * ":return" or ":finish". This is done in do_one_cmd().
+ */
+ if (did_throw)
+ need_rethrow = TRUE;
+ if ((getline_equal(getline, cookie, getsourceline)
+ && ex_nesting_level > source_level(real_cookie))
+ || (getline_equal(getline, cookie, get_func_line)
+ && ex_nesting_level > func_level(real_cookie) + 1))
+ {
+ if (!did_throw)
+ check_cstack = TRUE;
+ }
+ else
+ {
+ /* When leaving a function, reduce nesting level. */
+ if (getline_equal(getline, cookie, get_func_line))
+ --ex_nesting_level;
+ /*
+ * Go to debug mode when returning from a function in which we are
+ * single-stepping.
+ */
+ if ((getline_equal(getline, cookie, getsourceline)
+ || getline_equal(getline, cookie, get_func_line))
+ && ex_nesting_level + 1 <= debug_break_level)
+ do_debug(getline_equal(getline, cookie, getsourceline)
+ ? (char_u *)_("End of sourced file")
+ : (char_u *)_("End of function"));
+ }
+
+ /*
+ * Restore the exception environment (done after returning from the
+ * debugger).
+ */
+ if (flags & DOCMD_EXCRESET)
+ {
+ suppress_errthrow = FALSE;
+ trylevel = saved_trylevel;
+ force_abort = saved_force_abort;
+ caught_stack = saved_caught_stack;
+ (void)v_exception(saved_vv_exception);
+ (void)v_throwpoint(saved_vv_throwpoint);
+ /* Necessary for debugging an inactive ":catch", ":finally", or
+ * ":endtry": */
+ did_emsg = saved_did_emsg;
+ got_int = saved_got_int;
+ did_throw = saved_did_throw;
+ need_rethrow = saved_need_rethrow;
+ check_cstack = saved_check_cstack;
+ current_exception = saved_current_exception;
+ }
+
+ msg_list = saved_msg_list;
+#endif /* FEAT_EVAL */
+
+ /*
+ * If there was too much output to fit on the command line, ask the user to
+ * hit return before redrawing the screen. With the ":global" command we do
+ * this only once after the command is finished.
+ */
+ if (did_inc)
+ {
+ --RedrawingDisabled;
+ --no_wait_return;
+ msg_scroll = FALSE;
+
+ /*
+ * When just finished an ":if"-":else" which was typed, no need to
+ * wait for hit-return. Also for an error situation.
+ */
+ if (retval == FAIL
+#ifdef FEAT_EVAL
+ || (did_endif && KeyTyped && !did_emsg)
+#endif
+ )
+ {
+ need_wait_return = FALSE;
+ msg_didany = FALSE; /* don't wait when restarting edit */
+ }
+ else if (need_wait_return)
+ {
+ /*
+ * The msg_start() above clears msg_didout. The wait_return we do
+ * here should not overwrite the command that may be shown before
+ * doing that.
+ */
+ msg_didout |= msg_didout_before_start;
+ wait_return(FALSE);
+ }
+ }
+
+#ifndef FEAT_EVAL
+ /*
+ * Reset if_level, in case a sourced script file contains more ":if" than
+ * ":endif" (could be ":if x | foo | endif").
+ */
+ if_level = 0;
+#endif
+
+ --call_depth;
+ return retval;
+}
+
+#ifdef FEAT_EVAL
+/*
+ * Obtain a line when inside a ":while" loop.
+ */
+ static char_u *
+get_while_line(c, cookie, indent)
+ int c;
+ void *cookie;
+ int indent;
+{
+ struct while_cookie *cp = (struct while_cookie *)cookie;
+ wcmd_T *wp;
+ char_u *line;
+
+ if (cp->current_line + 1 >= cp->lines_gap->ga_len)
+ {
+ if (cp->repeating)
+ return NULL; /* trying to read past the ":endwhile" */
+
+ /* First time inside the ":while": get line normally. */
+ if (cp->getline == NULL)
+ line = getcmdline(c, 0L, indent);
+ else
+ line = cp->getline(c, cp->cookie, indent);
+ if (store_while_line(cp->lines_gap, line) == OK)
+ ++cp->current_line;
+
+ return line;
+ }
+
+ KeyTyped = FALSE;
+ ++cp->current_line;
+ wp = (wcmd_T *)(cp->lines_gap->ga_data) + cp->current_line;
+ sourcing_lnum = wp->lnum;
+ return vim_strsave(wp->line);
+}
+
+/*
+ * Store a line in "gap" so that a ":while" loop can execute it again.
+ */
+ static int
+store_while_line(gap, line)
+ garray_T *gap;
+ char_u *line;
+{
+ if (ga_grow(gap, 1) == FAIL)
+ return FAIL;
+ ((wcmd_T *)(gap->ga_data))[gap->ga_len].line = vim_strsave(line);
+ ((wcmd_T *)(gap->ga_data))[gap->ga_len].lnum = sourcing_lnum;
+ ++gap->ga_len;
+ --gap->ga_room;
+ return OK;
+}
+
+/*
+ * Free the lines stored for a ":while" loop.
+ */
+ static void
+free_cmdlines(gap)
+ garray_T *gap;
+{
+ while (gap->ga_len > 0)
+ {
+ vim_free(((wcmd_T *)(gap->ga_data))[gap->ga_len - 1].line);
+ --gap->ga_len;
+ ++gap->ga_room;
+ }
+}
+#endif
+
+/*
+ * If "getline" is get_while_line(), return TRUE if the getline it uses equals
+ * "func". * Otherwise return TRUE when "getline" equals "func".
+ */
+/*ARGSUSED*/
+ int
+getline_equal(getline, cookie, func)
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie; /* argument for getline() */
+ char_u *(*func) __ARGS((int, void *, int));
+{
+#ifdef FEAT_EVAL
+ char_u *(*gp) __ARGS((int, void *, int));
+ struct while_cookie *cp;
+
+ /* When "getline" is "get_while_line()" use the "cookie" to find the
+ * function that's orignally used to obtain the lines. This may be nested
+ * several levels. */
+ gp = getline;
+ cp = (struct while_cookie *)cookie;
+ while (gp == get_while_line)
+ {
+ gp = cp->getline;
+ cp = cp->cookie;
+ }
+ return gp == func;
+#else
+ return getline == func;
+#endif
+}
+
+#if defined(FEAT_EVAL) || defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * If "getline" is get_while_line(), return the cookie used by the original
+ * getline function. Otherwise return "cookie".
+ */
+/*ARGSUSED*/
+ void *
+getline_cookie(getline, cookie)
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie; /* argument for getline() */
+{
+# ifdef FEAT_EVAL
+ char_u *(*gp) __ARGS((int, void *, int));
+ struct while_cookie *cp;
+
+ /* When "getline" is "get_while_line()" use the "cookie" to find the
+ * cookie that's orignally used to obtain the lines. This may be nested
+ * several levels. */
+ gp = getline;
+ cp = (struct while_cookie *)cookie;
+ while (gp == get_while_line)
+ {
+ gp = cp->getline;
+ cp = cp->cookie;
+ }
+ return cp;
+# else
+ return cookie;
+# endif
+}
+#endif
+
+/*
+ * Execute one Ex command.
+ *
+ * If 'sourcing' is TRUE, the command will be included in the error message.
+ *
+ * 1. skip comment lines and leading space
+ * 2. handle command modifiers
+ * 3. parse range
+ * 4. parse command
+ * 5. parse arguments
+ * 6. switch on command name
+ *
+ * Note: "getline" can be NULL.
+ *
+ * This function may be called recursively!
+ */
+#if (_MSC_VER == 1200)
+/*
+ * Optimisation bug in VC++ version 6.0
+ * TODO: check this is still present after each service pack
+ */
+# pragma optimize( "g", off )
+#endif
+ static char_u *
+do_one_cmd(cmdlinep, sourcing,
+#ifdef FEAT_EVAL
+ cstack,
+#endif
+ getline, cookie)
+ char_u **cmdlinep;
+ int sourcing;
+#ifdef FEAT_EVAL
+ struct condstack *cstack;
+#endif
+ char_u *(*getline) __ARGS((int, void *, int));
+ void *cookie; /* argument for getline() */
+{
+ char_u *p;
+ linenr_T lnum;
+ long n;
+ char_u *errormsg = NULL; /* error message */
+ exarg_T ea; /* Ex command arguments */
+ long verbose_save = -1;
+ int save_msg_scroll = 0;
+ int did_silent = 0;
+ int did_esilent = 0;
+ cmdmod_T save_cmdmod;
+ int ni; /* set when Not Implemented */
+
+ vim_memset(&ea, 0, sizeof(ea));
+ ea.line1 = 1;
+ ea.line2 = 1;
+#ifdef FEAT_EVAL
+ ++ex_nesting_level;
+#endif
+
+ /* when not editing the last file :q has to be typed twice */
+ if (quitmore
+#ifdef FEAT_EVAL
+ /* avoid that a function call in 'statusline' does this */
+ && !getline_equal(getline, cookie, get_func_line)
+#endif
+ )
+ --quitmore;
+
+ /*
+ * Reset browse, confirm, etc.. They are restored when returning, for
+ * recursive calls.
+ */
+ save_cmdmod = cmdmod;
+ vim_memset(&cmdmod, 0, sizeof(cmdmod));
+
+ /*
+ * Repeat until no more command modifiers are found.
+ */
+ ea.cmd = *cmdlinep;
+ for (;;)
+ {
+/*
+ * 1. skip comment lines and leading white space and colons
+ */
+ while (*ea.cmd == ' ' || *ea.cmd == '\t' || *ea.cmd == ':')
+ ++ea.cmd;
+
+ /* in ex mode, an empty line works like :+ */
+ if (*ea.cmd == NUL && exmode_active
+ && (getline_equal(getline, cookie, getexmodeline)
+ || getline_equal(getline, cookie, getexline)))
+ {
+ ea.cmd = (char_u *)"+";
+ ex_pressedreturn = TRUE;
+ }
+
+ /* ignore comment and empty lines */
+ if (*ea.cmd == '"' || *ea.cmd == NUL)
+ goto doend;
+
+/*
+ * 2. handle command modifiers.
+ */
+ p = ea.cmd;
+ if (VIM_ISDIGIT(*ea.cmd))
+ p = skipwhite(skipdigits(ea.cmd));
+ switch (*p)
+ {
+ /* When adding an entry, also modify cmd_exists(). */
+ case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
+ break;
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_ABOVE;
+#endif
+ continue;
+
+ case 'b': if (checkforcmd(&ea.cmd, "belowright", 3))
+ {
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_BELOW;
+#endif
+ continue;
+ }
+ if (checkforcmd(&ea.cmd, "browse", 3))
+ {
+#ifdef FEAT_BROWSE
+ cmdmod.browse = TRUE;
+#endif
+ continue;
+ }
+ if (!checkforcmd(&ea.cmd, "botright", 2))
+ break;
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_BOT;
+#endif
+ continue;
+
+ case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4))
+ break;
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ cmdmod.confirm = TRUE;
+#endif
+ continue;
+
+ case 'k': if (checkforcmd(&ea.cmd, "keepmarks", 3))
+ {
+ cmdmod.keepmarks = TRUE;
+ continue;
+ }
+ if (!checkforcmd(&ea.cmd, "keepjumps", 5))
+ break;
+ cmdmod.keepjumps = TRUE;
+ continue;
+
+ /* ":hide" and ":hide | cmd" are not modifiers */
+ case 'h': if (p != ea.cmd || !checkforcmd(&p, "hide", 3)
+ || *p == NUL || ends_excmd(*p))
+ break;
+ ea.cmd = p;
+ cmdmod.hide = TRUE;
+ continue;
+
+ case 'l': if (checkforcmd(&ea.cmd, "lockmarks", 3))
+ {
+ cmdmod.lockmarks = TRUE;
+ continue;
+ }
+
+ if (!checkforcmd(&ea.cmd, "leftabove", 5))
+ break;
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_ABOVE;
+#endif
+ continue;
+
+ case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
+ break;
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_BELOW;
+#endif
+ continue;
+
+ case 's': if (!checkforcmd(&ea.cmd, "silent", 3))
+ break;
+ ++did_silent;
+ ++msg_silent;
+ save_msg_scroll = msg_scroll;
+ if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
+ {
+ /* ":silent!", but not "silent !cmd" */
+ ea.cmd = skipwhite(ea.cmd + 1);
+ ++emsg_silent;
+ ++did_esilent;
+ }
+ continue;
+
+ case 't': if (!checkforcmd(&ea.cmd, "topleft", 2))
+ break;
+#ifdef FEAT_WINDOWS
+ cmdmod.split |= WSP_TOP;
+#endif
+ continue;
+
+ case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
+ {
+#ifdef FEAT_VERTSPLIT
+ cmdmod.split |= WSP_VERT;
+#endif
+ continue;
+ }
+ if (!checkforcmd(&p, "verbose", 4))
+ break;
+ if (verbose_save < 0)
+ verbose_save = p_verbose;
+ p_verbose = atoi((char *)ea.cmd);
+ if (p_verbose == 0)
+ p_verbose = 1;
+ ea.cmd = p;
+ continue;
+ }
+ break;
+ }
+
+#ifdef FEAT_EVAL
+ ea.skip = did_emsg || got_int || did_throw || (cstack->cs_idx >= 0
+ && !(cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE));
+#else
+ ea.skip = (if_level > 0);
+#endif
+
+#ifdef FEAT_EVAL
+ /* May go to debug mode. If this happens and the ">quit" debug command is
+ * used, throw an interrupt exception and skip the next command. */
+ dbg_check_breakpoint(&ea);
+ if (!ea.skip && got_int)
+ {
+ ea.skip = TRUE;
+ (void)do_intthrow(cstack);
+ }
+#endif
+
+/*
+ * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ *
+ * where 'addr' is:
+ *
+ * % (entire file)
+ * $ [+-NUM]
+ * 'x [+-NUM] (where x denotes a currently defined mark)
+ * . [+-NUM]
+ * [+-NUM]..
+ * NUM
+ *
+ * The ea.cmd pointer is updated to point to the first character following the
+ * range spec. If an initial address is found, but no second, the upper bound
+ * is equal to the lower.
+ */
+
+ /* repeat for all ',' or ';' separated addresses */
+ for (;;)
+ {
+ ea.line1 = ea.line2;
+ ea.line2 = curwin->w_cursor.lnum; /* default is current line number */
+ ea.cmd = skipwhite(ea.cmd);
+ lnum = get_address(&ea.cmd, ea.skip, ea.addr_count == 0);
+ if (ea.cmd == NULL) /* error detected */
+ goto doend;
+ if (lnum == MAXLNUM)
+ {
+ if (*ea.cmd == '%') /* '%' - all lines */
+ {
+ ++ea.cmd;
+ ea.line1 = 1;
+ ea.line2 = curbuf->b_ml.ml_line_count;
+ ++ea.addr_count;
+ }
+ /* '*' - visual area */
+ else if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
+ {
+ pos_T *fp;
+
+ ++ea.cmd;
+ if (!ea.skip)
+ {
+ fp = getmark('<', FALSE);
+ if (check_mark(fp) == FAIL)
+ goto doend;
+ ea.line1 = fp->lnum;
+ fp = getmark('>', FALSE);
+ if (check_mark(fp) == FAIL)
+ goto doend;
+ ea.line2 = fp->lnum;
+ ++ea.addr_count;
+ }
+ }
+ }
+ else
+ ea.line2 = lnum;
+ ea.addr_count++;
+
+ if (*ea.cmd == ';')
+ {
+ if (!ea.skip)
+ curwin->w_cursor.lnum = ea.line2;
+ }
+ else if (*ea.cmd != ',')
+ break;
+ ++ea.cmd;
+ }
+
+ /* One address given: set start and end lines */
+ if (ea.addr_count == 1)
+ {
+ ea.line1 = ea.line2;
+ /* ... but only implicit: really no address given */
+ if (lnum == MAXLNUM)
+ ea.addr_count = 0;
+ }
+
+ /* Don't leave the cursor on an illegal line (caused by ';') */
+ check_cursor_lnum();
+
+/*
+ * 4. parse command
+ */
+
+ /*
+ * Skip ':' and any white space
+ */
+ ea.cmd = skipwhite(ea.cmd);
+ while (*ea.cmd == ':')
+ ea.cmd = skipwhite(ea.cmd + 1);
+
+ /*
+ * If we got a line, but no command, then go to the line.
+ * If we find a '|' or '\n' we set ea.nextcmd.
+ */
+ if (*ea.cmd == NUL || *ea.cmd == '"' ||
+ (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
+ {
+ /*
+ * strange vi behaviour:
+ * ":3" jumps to line 3
+ * ":3|..." prints line 3
+ * ":|" prints current line
+ */
+ if (ea.skip) /* skip this if inside :if */
+ goto doend;
+ if (*ea.cmd == '|')
+ {
+ ea.cmdidx = CMD_print;
+ ea.argt = RANGE+COUNT+TRLBAR;
+ if ((errormsg = invalid_range(&ea)) == NULL)
+ {
+ correct_range(&ea);
+ ex_print(&ea);
+ }
+ }
+ else if (ea.addr_count != 0)
+ {
+ if (ea.line2 < 0)
+ errormsg = invalid_range(&ea);
+ else
+ {
+ if (ea.line2 == 0)
+ curwin->w_cursor.lnum = 1;
+ else if (ea.line2 > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ else
+ curwin->w_cursor.lnum = ea.line2;
+ beginline(BL_SOL | BL_FIX);
+ }
+ }
+ goto doend;
+ }
+
+ /* Find the command and let "p" point to after it. */
+ p = find_command(&ea, NULL);
+
+#ifdef FEAT_USR_CMDS
+ if (p == NULL)
+ {
+ if (!ea.skip)
+ errormsg = (char_u *)_("E464: Ambiguous use of user-defined command");
+ goto doend;
+ }
+ /* Check for wrong commands. */
+ if (*p == '!' && ea.cmd[1] == 0151 && ea.cmd[0] == 78)
+ {
+ errormsg = uc_fun_cmd();
+ goto doend;
+ }
+#endif
+ if (ea.cmdidx == CMD_SIZE)
+ {
+ if (!ea.skip)
+ {
+ STRCPY(IObuff, _("E492: Not an editor command"));
+ if (!sourcing)
+ {
+ STRCAT(IObuff, ": ");
+ STRNCAT(IObuff, *cmdlinep, 40);
+ }
+ errormsg = IObuff;
+ }
+ goto doend;
+ }
+
+ ni = (
+#ifdef FEAT_USR_CMDS
+ !USER_CMDIDX(ea.cmdidx) &&
+#endif
+ cmdnames[ea.cmdidx].cmd_func == ex_ni);
+
+#ifndef FEAT_EVAL
+ /*
+ * When the expression evaluation is disabled, recognize the ":if" and
+ * ":endif" commands and ignore everything in between it.
+ */
+ if (ea.cmdidx == CMD_if)
+ ++if_level;
+ if (if_level)
+ {
+ if (ea.cmdidx == CMD_endif)
+ --if_level;
+ goto doend;
+ }
+
+#endif
+
+ if (*p == '!' && ea.cmdidx != CMD_substitute) /* forced commands */
+ {
+ ++p;
+ ea.forceit = TRUE;
+ }
+ else
+ ea.forceit = FALSE;
+
+/*
+ * 5. parse arguments
+ */
+#ifdef FEAT_USR_CMDS
+ if (!USER_CMDIDX(ea.cmdidx))
+#endif
+ ea.argt = cmdnames[(int)ea.cmdidx].cmd_argt;
+
+ if (!ea.skip)
+ {
+#ifdef HAVE_SANDBOX
+ if (sandbox != 0 && !(ea.argt & SBOXOK))
+ {
+ /* Command not allowed in sandbox. */
+ errormsg = (char_u *)_(e_sandbox);
+ goto doend;
+ }
+#endif
+ if (!curbuf->b_p_ma && (ea.argt & MODIFY))
+ {
+ /* Command not allowed in non-'modifiable' buffer */
+ errormsg = (char_u *)_(e_modifiable);
+ goto doend;
+ }
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && !(ea.argt & CMDWIN)
+# ifdef FEAT_USR_CMDS
+ && !USER_CMDIDX(ea.cmdidx)
+# endif
+ )
+ {
+ /* Command not allowed in cmdline window. */
+ errormsg = (char_u *)_(e_cmdwin);
+ goto doend;
+ }
+#endif
+
+ if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
+ {
+ /* no range allowed */
+ errormsg = (char_u *)_(e_norange);
+ goto doend;
+ }
+ }
+
+ if (!ni && !(ea.argt & BANG) && ea.forceit) /* no <!> allowed */
+ {
+ errormsg = (char_u *)_(e_nobang);
+ goto doend;
+ }
+
+ /*
+ * Don't complain about the range if it is not used
+ * (could happen if line_count is accidentally set to 0).
+ */
+ if (!ea.skip && !ni)
+ {
+ /*
+ * If the range is backwards, ask for confirmation and, if given, swap
+ * ea.line1 & ea.line2 so it's forwards again.
+ * When global command is busy, don't ask, will fail below.
+ */
+ if (!global_busy && ea.line1 > ea.line2)
+ {
+ if (sourcing)
+ {
+ errormsg = (char_u *)_("E493: Backwards range given");
+ goto doend;
+ }
+ else
+ {
+ int msg_silent_save = msg_silent;
+
+ msg_silent = 0;
+ if (ask_yesno((char_u *)
+ _("Backwards range given, OK to swap"), FALSE) != 'y')
+ goto doend;
+ msg_silent = msg_silent_save;
+ }
+ lnum = ea.line1;
+ ea.line1 = ea.line2;
+ ea.line2 = lnum;
+ }
+ if ((errormsg = invalid_range(&ea)) != NULL)
+ goto doend;
+ }
+
+ if ((ea.argt & NOTADR) && ea.addr_count == 0) /* default is 1, not cursor */
+ ea.line2 = 1;
+
+ correct_range(&ea);
+
+#ifdef FEAT_FOLDING
+ if (((ea.argt & WHOLEFOLD) || ea.addr_count >= 2) && !global_busy)
+ {
+ /* Put the first line at the start of a closed fold, put the last line
+ * at the end of a closed fold. */
+ (void)hasFolding(ea.line1, &ea.line1, NULL);
+ (void)hasFolding(ea.line2, NULL, &ea.line2);
+ }
+#endif
+
+#ifdef FEAT_QUICKFIX
+ /*
+ * For the :make and :grep commands we insert the 'makeprg'/'grepprg'
+ * option here, so things like % get expanded.
+ */
+ if (ea.cmdidx == CMD_make || ea.cmdidx == CMD_grep
+ || ea.cmdidx == CMD_grepadd)
+ {
+ char_u *new_cmdline;
+ char_u *program;
+ char_u *pos;
+ char_u *ptr;
+ int len;
+ int i;
+
+ if (ea.cmdidx == CMD_grep || ea.cmdidx == CMD_grepadd)
+ {
+ if (*curbuf->b_p_gp == NUL)
+ program = p_gp;
+ else
+ program = curbuf->b_p_gp;
+ }
+ else
+ {
+ if (*curbuf->b_p_mp == NUL)
+ program = p_mp;
+ else
+ program = curbuf->b_p_mp;
+ }
+
+ p = skipwhite(p);
+
+ if ((pos = (char_u *)strstr((char *)program, "$*")) != NULL)
+ { /* replace $* by given arguments */
+ i = 1;
+ while ((pos = (char_u *)strstr((char *)pos + 2, "$*")) != NULL)
+ ++i;
+ len = (int)STRLEN(p);
+ new_cmdline = alloc((int)(STRLEN(program) + i * (len - 2) + 1));
+ if (new_cmdline == NULL)
+ goto doend; /* out of memory */
+ ptr = new_cmdline;
+ while ((pos = (char_u *)strstr((char *)program, "$*")) != NULL)
+ {
+ i = (int)(pos - program);
+ STRNCPY(ptr, program, i);
+ STRCPY(ptr += i, p);
+ ptr += len;
+ program = pos + 2;
+ }
+ STRCPY(ptr, program);
+ }
+ else
+ {
+ new_cmdline = alloc((int)(STRLEN(program) + STRLEN(p) + 2));
+ if (new_cmdline == NULL)
+ goto doend; /* out of memory */
+ STRCPY(new_cmdline, program);
+ STRCAT(new_cmdline, " ");
+ STRCAT(new_cmdline, p);
+ }
+ msg_make(p);
+ /* 'ea.cmd' is not set here, because it is not used at CMD_make */
+ vim_free(*cmdlinep);
+ *cmdlinep = new_cmdline;
+ p = new_cmdline;
+ }
+#endif
+
+ /*
+ * Skip to start of argument.
+ * Don't do this for the ":!" command, because ":!! -l" needs the space.
+ */
+ if (ea.cmdidx == CMD_bang)
+ ea.arg = p;
+ else
+ ea.arg = skipwhite(p);
+
+ /*
+ * Check for "++opt=val" argument.
+ * Must be first, allow ":w ++enc=utf8 !cmd"
+ */
+ if (ea.argt & ARGOPT)
+ while (ea.arg[0] == '+' && ea.arg[1] == '+')
+ if (getargopt(&ea) == FAIL && !ni)
+ {
+ errormsg = (char_u *)_(e_invarg);
+ goto doend;
+ }
+
+ if (ea.cmdidx == CMD_write || ea.cmdidx == CMD_update)
+ {
+ if (*ea.arg == '>') /* append */
+ {
+ if (*++ea.arg != '>') /* typed wrong */
+ {
+ errormsg = (char_u *)_("E494: Use w or w>>");
+ goto doend;
+ }
+ ea.arg = skipwhite(ea.arg + 1);
+ ea.append = TRUE;
+ }
+ else if (*ea.arg == '!' && ea.cmdidx == CMD_write) /* :w !filter */
+ {
+ ++ea.arg;
+ ea.usefilter = TRUE;
+ }
+ }
+
+ if (ea.cmdidx == CMD_read)
+ {
+ if (ea.forceit)
+ {
+ ea.usefilter = TRUE; /* :r! filter if ea.forceit */
+ ea.forceit = FALSE;
+ }
+ else if (*ea.arg == '!') /* :r !filter */
+ {
+ ++ea.arg;
+ ea.usefilter = TRUE;
+ }
+ }
+
+ if (ea.cmdidx == CMD_lshift || ea.cmdidx == CMD_rshift)
+ {
+ ea.amount = 1;
+ while (*ea.arg == *ea.cmd) /* count number of '>' or '<' */
+ {
+ ++ea.arg;
+ ++ea.amount;
+ }
+ ea.arg = skipwhite(ea.arg);
+ }
+
+ /*
+ * Check for "+command" argument, before checking for next command.
+ * Don't do this for ":read !cmd" and ":write !cmd".
+ */
+ if ((ea.argt & EDITCMD) && !ea.usefilter)
+ ea.do_ecmd_cmd = getargcmd(&ea.arg);
+
+ /*
+ * Check for '|' to separate commands and '"' to start comments.
+ * Don't do this for ":read !cmd" and ":write !cmd".
+ */
+ if ((ea.argt & TRLBAR) && !ea.usefilter)
+ separate_nextcmd(&ea);
+
+ /*
+ * Check for <newline> to end a shell command.
+ * Also do this for ":read !cmd" and ":write !cmd".
+ */
+ else if (ea.cmdidx == CMD_bang || ea.usefilter)
+ {
+ for (p = ea.arg; *p; ++p)
+ {
+ /* Remove one backslash before a newline, so that it's possible to
+ * pass a newline to the shell and also a newline that is preceded
+ * with a backslash. This makes it impossible to end a shell
+ * command in a backslash, but that doesn't appear useful.
+ * Halving the number of backslashes is incompatible with previous
+ * versions. */
+ if (*p == '\\' && p[1] == '\n')
+ mch_memmove(p, p + 1, STRLEN(p));
+ else if (*p == '\n')
+ {
+ ea.nextcmd = p + 1;
+ *p = NUL;
+ break;
+ }
+ }
+ }
+
+ if ((ea.argt & DFLALL) && ea.addr_count == 0)
+ {
+ ea.line1 = 1;
+ ea.line2 = curbuf->b_ml.ml_line_count;
+ }
+
+ /* accept numbered register only when no count allowed (:put) */
+ if ( (ea.argt & REGSTR)
+ && *ea.arg != NUL
+#ifdef FEAT_USR_CMDS
+ && valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
+ && USER_CMDIDX(ea.cmdidx)))
+ /* Do not allow register = for user commands */
+ && (!USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
+#else
+ && valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put)
+#endif
+ && !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)))
+ {
+ ea.regname = *ea.arg++;
+#ifdef FEAT_EVAL
+ /* for '=' register: accept the rest of the line as an expression */
+ if (ea.arg[-1] == '=' && ea.arg[0] != NUL)
+ {
+ set_expr_line(vim_strsave(ea.arg));
+ ea.arg += STRLEN(ea.arg);
+ }
+#endif
+ ea.arg = skipwhite(ea.arg);
+ }
+
+ /*
+ * Check for a count. When accepting a BUFNAME, don't use "123foo" as a
+ * count, it's a buffer name.
+ */
+ if ((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)
+ && (!(ea.argt & BUFNAME) || *(p = skipdigits(ea.arg)) == NUL
+ || vim_iswhite(*p)))
+ {
+ n = getdigits(&ea.arg);
+ ea.arg = skipwhite(ea.arg);
+ if (n <= 0 && !ni)
+ {
+ errormsg = (char_u *)_(e_zerocount);
+ goto doend;
+ }
+ if (ea.argt & NOTADR) /* e.g. :buffer 2, :sleep 3 */
+ {
+ ea.line2 = n;
+ if (ea.addr_count == 0)
+ ea.addr_count = 1;
+ }
+ else
+ {
+ ea.line1 = ea.line2;
+ ea.line2 += n - 1;
+ ++ea.addr_count;
+ /*
+ * Be vi compatible: no error message for out of range.
+ */
+ if (ea.line2 > curbuf->b_ml.ml_line_count)
+ ea.line2 = curbuf->b_ml.ml_line_count;
+ }
+ }
+ /* no arguments allowed */
+ if (!ni && !(ea.argt & EXTRA) && *ea.arg != NUL &&
+ vim_strchr((char_u *)"|\"", *ea.arg) == NULL)
+ {
+ errormsg = (char_u *)_(e_trailing);
+ goto doend;
+ }
+
+ if (!ni && (ea.argt & NEEDARG) && *ea.arg == NUL)
+ {
+ errormsg = (char_u *)_(e_argreq);
+ goto doend;
+ }
+
+#ifdef FEAT_EVAL
+ /*
+ * Skip the command when it's not going to be executed.
+ * The commands like :if, :endif, etc. always need to be executed.
+ * Also make an exception for commands that handle a trailing command
+ * themselves.
+ */
+ if (ea.skip)
+ {
+ switch (ea.cmdidx)
+ {
+ /* commands that need evaluation */
+ case CMD_while:
+ case CMD_endwhile:
+ case CMD_if:
+ case CMD_elseif:
+ case CMD_else:
+ case CMD_endif:
+ case CMD_try:
+ case CMD_catch:
+ case CMD_finally:
+ case CMD_endtry:
+ case CMD_function:
+ break;
+
+ /* Commands that handle '|' themselves. Check: A command should
+ * either have the TRLBAR flag, appear in this list or appear in
+ * the list at ":help :bar". */
+ case CMD_aboveleft:
+ case CMD_and:
+ case CMD_belowright:
+ case CMD_botright:
+ case CMD_browse:
+ case CMD_call:
+ case CMD_confirm:
+ case CMD_delfunction:
+ case CMD_djump:
+ case CMD_dlist:
+ case CMD_dsearch:
+ case CMD_dsplit:
+ case CMD_echo:
+ case CMD_echoerr:
+ case CMD_echomsg:
+ case CMD_echon:
+ case CMD_execute:
+ case CMD_help:
+ case CMD_hide:
+ case CMD_ijump:
+ case CMD_ilist:
+ case CMD_isearch:
+ case CMD_isplit:
+ case CMD_keepjumps:
+ case CMD_keepmarks:
+ case CMD_leftabove:
+ case CMD_let:
+ case CMD_lockmarks:
+ case CMD_match:
+ case CMD_perl:
+ case CMD_psearch:
+ case CMD_python:
+ case CMD_return:
+ case CMD_rightbelow:
+ case CMD_ruby:
+ case CMD_silent:
+ case CMD_smagic:
+ case CMD_snomagic:
+ case CMD_substitute:
+ case CMD_syntax:
+ case CMD_tcl:
+ case CMD_throw:
+ case CMD_tilde:
+ case CMD_topleft:
+ case CMD_unlet:
+ case CMD_verbose:
+ case CMD_vertical:
+ break;
+
+ default: goto doend;
+ }
+ }
+#endif
+
+ if (ea.argt & XFILE)
+ {
+ if (expand_filename(&ea, cmdlinep, &errormsg) == FAIL)
+ goto doend;
+ }
+
+#ifdef FEAT_LISTCMDS
+ /*
+ * Accept buffer name. Cannot be used at the same time with a buffer
+ * number. Don't do this for a user command.
+ */
+ if ((ea.argt & BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
+# ifdef FEAT_USR_CMDS
+ && !USER_CMDIDX(ea.cmdidx)
+# endif
+ )
+ {
+ /*
+ * :bdelete, :bwipeout and :bunload take several arguments, separated
+ * by spaces: find next space (skipping over escaped characters).
+ * The others take one argument: ignore trailing spaces.
+ */
+ if (ea.cmdidx == CMD_bdelete || ea.cmdidx == CMD_bwipeout
+ || ea.cmdidx == CMD_bunload)
+ p = skiptowhite_esc(ea.arg);
+ else
+ {
+ p = ea.arg + STRLEN(ea.arg);
+ while (p > ea.arg && vim_iswhite(p[-1]))
+ --p;
+ }
+ ea.line2 = buflist_findpat(ea.arg, p, (ea.argt & BUFUNL) != 0, FALSE);
+ if (ea.line2 < 0) /* failed */
+ goto doend;
+ ea.addr_count = 1;
+ ea.arg = skipwhite(p);
+ }
+#endif
+
+/*
+ * 6. switch on command name
+ *
+ * The "ea" structure holds the arguments that can be used.
+ */
+ ea.cmdlinep = cmdlinep;
+ ea.getline = getline;
+ ea.cookie = cookie;
+#ifdef FEAT_EVAL
+ ea.cstack = cstack;
+#endif
+
+#ifdef FEAT_USR_CMDS
+ if (USER_CMDIDX(ea.cmdidx))
+ {
+ /*
+ * Execute a user-defined command.
+ */
+ do_ucmd(&ea);
+ }
+ else
+#endif
+ {
+ /*
+ * Call the function to execute the command.
+ */
+ ea.errmsg = NULL;
+ (cmdnames[ea.cmdidx].cmd_func)(&ea);
+ if (ea.errmsg != NULL)
+ errormsg = (char_u *)_(ea.errmsg);
+ }
+
+#ifdef FEAT_EVAL
+ /*
+ * If the command just executed called do_cmdline(), any throw or ":return"
+ * or ":finish" encountered there must also check the cstack of the still
+ * active do_cmdline() that called this do_one_cmd(). Rethrow an uncaught
+ * exception, or reanimate a returned function or finished script file and
+ * return or finish it again.
+ */
+ if (need_rethrow)
+ do_throw(cstack);
+ else if (check_cstack)
+ {
+ if (source_finished(getline, cookie))
+ do_finish(&ea, TRUE);
+ else if (getline_equal(getline, cookie, get_func_line)
+ && current_func_returned())
+ do_return(&ea, TRUE, FALSE, NULL);
+ }
+ need_rethrow = check_cstack = FALSE;
+#endif
+
+doend:
+ if (curwin->w_cursor.lnum == 0) /* can happen with zero line number */
+ curwin->w_cursor.lnum = 1;
+
+ if (errormsg != NULL && *errormsg != NUL && !did_emsg)
+ {
+ if (sourcing)
+ {
+ if (errormsg != IObuff)
+ {
+ STRCPY(IObuff, errormsg);
+ errormsg = IObuff;
+ }
+ STRCAT(errormsg, ": ");
+ STRNCAT(errormsg, *cmdlinep, IOSIZE - STRLEN(IObuff));
+ }
+ emsg(errormsg);
+ }
+#ifdef FEAT_EVAL
+ do_errthrow(cstack,
+ (ea.cmdidx != CMD_SIZE
+# ifdef FEAT_USR_CMDS
+ && !USER_CMDIDX(ea.cmdidx)
+# endif
+ ) ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
+#endif
+
+ if (verbose_save >= 0)
+ p_verbose = verbose_save;
+
+ cmdmod = save_cmdmod;
+
+ if (did_silent > 0)
+ {
+ /* messages could be enabled for a serious error, need to check if the
+ * counters don't become negative */
+ msg_silent -= did_silent;
+ if (msg_silent < 0)
+ msg_silent = 0;
+ emsg_silent -= did_esilent;
+ if (emsg_silent < 0)
+ emsg_silent = 0;
+ /* Restore msg_scroll, it's set by file I/O commands, even when no
+ * message is actually displayed. */
+ msg_scroll = save_msg_scroll;
+ }
+
+ if (ea.nextcmd && *ea.nextcmd == NUL) /* not really a next command */
+ ea.nextcmd = NULL;
+
+#ifdef FEAT_EVAL
+ --ex_nesting_level;
+#endif
+
+ return ea.nextcmd;
+}
+#if (_MSC_VER == 1200)
+# pragma optimize( "", on )
+#endif
+
+/*
+ * Check for a command modifier command with optional tail.
+ * If there is a match advance "pp" to the argument and return TRUE.
+ */
+ static int
+checkforcmd(pp, cmd, len)
+ char_u **pp; /* start of command line */
+ char *cmd; /* name of command */
+ int len; /* required length */
+{
+ int i;
+
+ for (i = 0; cmd[i] != NUL; ++i)
+ if (cmd[i] != (*pp)[i])
+ break;
+ if (i >= len && !isalpha((*pp)[i]))
+ {
+ *pp = skipwhite(*pp + i);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Find an Ex command by its name, either built-in or user.
+ * Name can be found at eap->cmd.
+ * Returns pointer to char after the command name.
+ * Returns NULL for an ambiguous user command.
+ */
+/*ARGSUSED*/
+ static char_u *
+find_command(eap, full)
+ exarg_T *eap;
+ int *full;
+{
+ int len;
+ char_u *p;
+
+ /*
+ * Isolate the command and search for it in the command table.
+ * Exeptions:
+ * - the 'k' command can directly be followed by any character.
+ * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
+ * but :sre[wind] is another command, as are :scrip[tnames],
+ * :scs[cope], :sim[alt], :sig[ns] and :sil[ent].
+ */
+ p = eap->cmd;
+ if (*p == 'k')
+ {
+ eap->cmdidx = CMD_k;
+ ++p;
+ }
+ else if (p[0] == 's'
+ && ((p[1] == 'c' && p[2] != 's' && p[2] != 'r' && p[3] != 'i' && p[4] != 'p')
+ || p[1] == 'g'
+ || (p[1] == 'i' && p[2] != 'm' && p[2] != 'l' && p[2] != 'g')
+ || p[1] == 'I'
+ || (p[1] == 'r' && p[2] != 'e')))
+ {
+ eap->cmdidx = CMD_substitute;
+ ++p;
+ }
+ else
+ {
+ while (ASCII_ISALPHA(*p))
+ ++p;
+ /* check for non-alpha command */
+ if (p == eap->cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL)
+ ++p;
+ len = (int)(p - eap->cmd);
+
+ if (ASCII_ISLOWER(*eap->cmd))
+ eap->cmdidx = cmdidxs[CharOrdLow(*eap->cmd)];
+ else
+ eap->cmdidx = cmdidxs[26];
+
+ for ( ; (int)eap->cmdidx < (int)CMD_SIZE;
+ eap->cmdidx = (cmdidx_T)((int)eap->cmdidx + 1))
+ if (STRNCMP(cmdnames[(int)eap->cmdidx].cmd_name, (char *)eap->cmd,
+ (size_t)len) == 0)
+ {
+#ifdef FEAT_EVAL
+ if (full != NULL
+ && cmdnames[(int)eap->cmdidx].cmd_name[len] == NUL)
+ *full = TRUE;
+#endif
+ break;
+ }
+
+#ifdef FEAT_USR_CMDS
+ /* Look for a user defined command as a last resort */
+ if (eap->cmdidx == CMD_SIZE && *eap->cmd >= 'A' && *eap->cmd <= 'Z')
+ {
+ ucmd_T *cmd;
+ int j, k, matchlen = 0;
+ int found = FALSE, possible = FALSE;
+ char_u *cp, *np; /* Point into typed cmd and test name */
+ garray_T *gap;
+ int amb_local = FALSE; /* Found ambiguous buffer-local
+ command, only full match global
+ is accepted. */
+
+ /* User defined commands may contain numbers */
+ while (ASCII_ISALNUM(*p))
+ ++p;
+ len = (int)(p - eap->cmd);
+
+ /*
+ * Look for buffer-local user commands first, then global ones.
+ */
+ gap = &curbuf->b_ucmds;
+ for (;;)
+ {
+ for (j = 0; j < gap->ga_len; ++j)
+ {
+ cmd = USER_CMD_GA(gap, j);
+ cp = eap->cmd;
+ np = cmd->uc_name;
+ k = 0;
+ while (k < len && *np != NUL && *cp++ == *np++)
+ k++;
+ if (k == len || (*np == NUL && vim_isdigit(eap->cmd[k])))
+ {
+ /* If finding a second match, the command is
+ * ambiguous. But not if a buffer-local command
+ * wasn't a full match and a global command is a full
+ * match. */
+ if (k == len && found && *np != NUL)
+ {
+ if (gap == &ucmds)
+ return NULL;
+ amb_local = TRUE;
+ }
+
+ if (!found || (k == len && *np == NUL))
+ {
+ /* If we matched up to a digit, then there could
+ * be another command including the digit that we
+ * should use instead.
+ */
+ if (k == len)
+ found = TRUE;
+ else
+ possible = TRUE;
+
+ if (gap == &ucmds)
+ eap->cmdidx = CMD_USER;
+ else
+ eap->cmdidx = CMD_USER_BUF;
+ eap->argt = cmd->uc_argt;
+ eap->useridx = j;
+
+ /* Do not search for further abbreviations
+ * if this is an exact match. */
+ matchlen = k;
+ if (k == len && *np == NUL)
+ {
+ if (full != NULL)
+ *full = TRUE;
+ amb_local = FALSE;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Stop if we found a full match or searched all. */
+ if (j < gap->ga_len || gap == &ucmds)
+ break;
+ gap = &ucmds;
+ }
+
+ /* Only found ambiguous matches. */
+ if (amb_local)
+ return NULL;
+
+ /* The match we found may be followed immediately by a
+ * number. Move *p back to point to it.
+ */
+ if (found || possible)
+ p += matchlen - len;
+ }
+#endif
+
+ if (len == 0)
+ eap->cmdidx = CMD_SIZE;
+ }
+
+ return p;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return > 0 if an Ex command "name" exists.
+ * Return 2 if there is an exact match.
+ * Return 3 if there is an ambiguous match.
+ */
+ int
+cmd_exists(name)
+ char_u *name;
+{
+ exarg_T ea;
+ int full = FALSE;
+ int i;
+ int j;
+ static struct cmdmod
+ {
+ char *name;
+ int minlen;
+ } cmdmods[] = {
+ {"aboveleft", 3},
+ {"belowright", 3},
+ {"botright", 2},
+ {"browse", 3},
+ {"confirm", 4},
+ {"hide", 3},
+ {"keepjumps", 5},
+ {"keepmarks", 3},
+ {"leftabove", 5},
+ {"lockmarks", 3},
+ {"rightbelow", 6},
+ {"silent", 3},
+ {"topleft", 2},
+ {"verbose", 4},
+ {"vertical", 4},
+ };
+
+ /* Check command modifiers. */
+ for (i = 0; i < sizeof(cmdmods) / sizeof(struct cmdmod); ++i)
+ {
+ for (j = 0; name[j] != NUL; ++j)
+ if (name[j] != cmdmods[i].name[j])
+ break;
+ if (name[j] == NUL && j >= cmdmods[i].minlen)
+ return (cmdmods[i].name[j] == NUL ? 2 : 1);
+ }
+
+ /* Check built-in commands and user defined commands. */
+ ea.cmd = name;
+ ea.cmdidx = (cmdidx_T)0;
+ if (find_command(&ea, &full) == NULL)
+ return 3;
+ return (ea.cmdidx == CMD_SIZE ? 0 : (full ? 2 : 1));
+}
+#endif
+
+/*
+ * This is all pretty much copied from do_one_cmd(), with all the extra stuff
+ * we don't need/want deleted. Maybe this could be done better if we didn't
+ * repeat all this stuff. The only problem is that they may not stay
+ * perfectly compatible with each other, but then the command line syntax
+ * probably won't change that much -- webb.
+ */
+ char_u *
+set_one_cmd_context(xp, buff)
+ expand_T *xp;
+ char_u *buff; /* buffer for command string */
+{
+ char_u *p;
+ char_u *cmd, *arg;
+ int i = 0;
+ cmdidx_T cmdidx;
+ long_u argt = 0;
+#if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)
+ int compl = EXPAND_NOTHING;
+#endif
+#ifdef FEAT_CMDL_COMPL
+ int delim;
+#endif
+ int forceit = FALSE;
+ int usefilter = FALSE; /* filter instead of file name */
+
+ xp->xp_pattern = buff;
+ xp->xp_context = EXPAND_COMMANDS; /* Default until we get past command */
+ xp->xp_backslash = XP_BS_NONE;
+#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ xp->xp_arg = NULL;
+#endif
+
+/*
+ * 2. skip comment lines and leading space, colons or bars
+ */
+ for (cmd = buff; vim_strchr((char_u *)" \t:|", *cmd) != NULL; cmd++)
+ ;
+ xp->xp_pattern = cmd;
+
+ if (*cmd == NUL)
+ return NULL;
+ if (*cmd == '"') /* ignore comment lines */
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return NULL;
+ }
+
+/*
+ * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ */
+ cmd = skip_range(cmd, &xp->xp_context);
+
+/*
+ * 4. parse command
+ */
+
+ cmd = skipwhite(cmd);
+ xp->xp_pattern = cmd;
+ if (*cmd == NUL)
+ return NULL;
+ if (*cmd == '"')
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return NULL;
+ }
+
+ if (*cmd == '|' || *cmd == '\n')
+ return cmd + 1; /* There's another command */
+
+ /*
+ * Isolate the command and search for it in the command table.
+ * Exceptions:
+ * - the 'k' command can directly be followed by any character, but
+ * do accept "keepmarks" and "keepjumps".
+ * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
+ */
+ if (*cmd == 'k' && cmd[1] != 'e')
+ {
+ cmdidx = CMD_k;
+ p = cmd + 1;
+ }
+ else
+ {
+ p = cmd;
+ while (ASCII_ISALPHA(*p) || *p == '*') /* Allow * wild card */
+ ++p;
+ /* check for non-alpha command */
+ if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL)
+ ++p;
+ i = (int)(p - cmd);
+
+ if (i == 0)
+ {
+ xp->xp_context = EXPAND_UNSUCCESSFUL;
+ return NULL;
+ }
+ for (cmdidx = (cmdidx_T)0; (int)cmdidx < (int)CMD_SIZE;
+ cmdidx = (cmdidx_T)((int)cmdidx + 1))
+ if (STRNCMP(cmdnames[(int)cmdidx].cmd_name, cmd, (size_t)i) == 0)
+ break;
+
+#ifdef FEAT_USR_CMDS
+ if (cmd[0] >= 'A' && cmd[0] <= 'Z')
+ {
+ while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
+ ++p;
+ i = (int)(p - cmd);
+ }
+#endif
+ }
+
+ /*
+ * If the cursor is touching the command, and it ends in an alpha-numeric
+ * character, complete the command name.
+ */
+ if (*p == NUL && ASCII_ISALNUM(p[-1]))
+ return NULL;
+
+ if (cmdidx == CMD_SIZE)
+ {
+ if (*cmd == 's' && vim_strchr((char_u *)"cgriI", cmd[1]) != NULL)
+ {
+ cmdidx = CMD_substitute;
+ p = cmd + 1;
+ }
+#ifdef FEAT_USR_CMDS
+ else if (cmd[0] >= 'A' && cmd[0] <= 'Z')
+ {
+ /* Look for a user defined command as a last resort */
+ ucmd_T *uc;
+ int j, k, matchlen = 0;
+ int found = FALSE, possible = FALSE;
+ char_u *cp, *np; /* Point into typed cmd and test name */
+ garray_T *gap;
+
+ gap = &curbuf->b_ucmds;
+ for (;;)
+ {
+ uc = USER_CMD_GA(gap, 0);
+ for (j = 0; j < gap->ga_len; ++j, ++uc)
+ {
+ cp = cmd;
+ np = uc->uc_name;
+ k = 0;
+ while (k < i && *np != NUL && *cp++ == *np++)
+ k++;
+ if (k == i || (*np == NUL && VIM_ISDIGIT(cmd[k])))
+ {
+ if (k == i && found)
+ {
+ /* Ambiguous abbreviation */
+ xp->xp_context = EXPAND_UNSUCCESSFUL;
+ return NULL;
+ }
+ if (!found)
+ {
+ /* If we matched up to a digit, then there could
+ * be another command including the digit that we
+ * should use instead.
+ */
+ if (k == i)
+ found = TRUE;
+ else
+ possible = TRUE;
+
+ if (gap == &ucmds)
+ cmdidx = CMD_USER;
+ else
+ cmdidx = CMD_USER_BUF;
+ argt = uc->uc_argt;
+#ifdef FEAT_CMDL_COMPL
+ compl = uc->uc_compl;
+# ifdef FEAT_EVAL
+ xp->xp_arg = uc->uc_compl_arg;
+ xp->xp_scriptID = uc->uc_scriptID;
+# endif
+#endif
+ /* Do not search for further abbreviations
+ * if this is an exact match
+ */
+ matchlen = k;
+ if (k == i && *np == NUL)
+ break;
+ }
+ }
+ }
+ if (gap == &ucmds || j < gap->ga_len)
+ break;
+ gap = &ucmds;
+ }
+
+ /* The match we found may be followed immediately by a
+ * number. Move *p back to point to it.
+ */
+ if (found || possible)
+ p += matchlen - i;
+ }
+#endif
+ }
+ if (cmdidx == CMD_SIZE)
+ {
+ /* Not still touching the command and it was an illegal one */
+ xp->xp_context = EXPAND_UNSUCCESSFUL;
+ return NULL;
+ }
+
+ xp->xp_context = EXPAND_NOTHING; /* Default now that we're past command */
+
+ if (*p == '!') /* forced commands */
+ {
+ forceit = TRUE;
+ ++p;
+ }
+
+/*
+ * 5. parse arguments
+ */
+#ifdef FEAT_USR_CMDS
+ if (!USER_CMDIDX(cmdidx))
+#endif
+ argt = cmdnames[(int)cmdidx].cmd_argt;
+
+ arg = skipwhite(p);
+
+ if (cmdidx == CMD_write || cmdidx == CMD_update)
+ {
+ if (*arg == '>') /* append */
+ {
+ if (*++arg == '>')
+ ++arg;
+ arg = skipwhite(arg);
+ }
+ else if (*arg == '!' && cmdidx == CMD_write) /* :w !filter */
+ {
+ ++arg;
+ usefilter = TRUE;
+ }
+ }
+
+ if (cmdidx == CMD_read)
+ {
+ usefilter = forceit; /* :r! filter if forced */
+ if (*arg == '!') /* :r !filter */
+ {
+ ++arg;
+ usefilter = TRUE;
+ }
+ }
+
+ if (cmdidx == CMD_lshift || cmdidx == CMD_rshift)
+ {
+ while (*arg == *cmd) /* allow any number of '>' or '<' */
+ ++arg;
+ arg = skipwhite(arg);
+ }
+
+ /* Does command allow "+command"? */
+ if ((argt & EDITCMD) && !usefilter && *arg == '+')
+ {
+ /* Check if we're in the +command */
+ p = arg + 1;
+ arg = skip_cmd_arg(arg, FALSE);
+
+ /* Still touching the command after '+'? */
+ if (*arg == NUL)
+ return p;
+
+ /* Skip space(s) after +command to get to the real argument */
+ arg = skipwhite(arg);
+ }
+
+ /*
+ * Check for '|' to separate commands and '"' to start comments.
+ * Don't do this for ":read !cmd" and ":write !cmd".
+ */
+ if ((argt & TRLBAR) && !usefilter)
+ {
+ p = arg;
+ /* ":redir @" is not the start of a comment */
+ if (cmdidx == CMD_redir && p[0] == '@' && p[1] == '"')
+ p += 2;
+ while (*p)
+ {
+ if (*p == Ctrl_V)
+ {
+ if (p[1] != NUL)
+ ++p;
+ }
+ else if ( (*p == '"' && !(argt & NOTRLCOM))
+ || *p == '|' || *p == '\n')
+ {
+ if (*(p - 1) != '\\')
+ {
+ if (*p == '|' || *p == '\n')
+ return p + 1;
+ return NULL; /* It's a comment */
+ }
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+ }
+
+ /* no arguments allowed */
+ if (!(argt & EXTRA) && *arg != NUL &&
+ vim_strchr((char_u *)"|\"", *arg) == NULL)
+ return NULL;
+
+ /* Find start of last argument (argument just before cursor): */
+ p = buff + STRLEN(buff);
+ while (p != arg && *p != ' ' && *p != TAB)
+ p--;
+ if (*p == ' ' || *p == TAB)
+ p++;
+ xp->xp_pattern = p;
+
+ if (argt & XFILE)
+ {
+ int in_quote = FALSE;
+ char_u *bow = NULL; /* Beginning of word */
+
+ /*
+ * Allow spaces within back-quotes to count as part of the argument
+ * being expanded.
+ */
+ xp->xp_pattern = skipwhite(arg);
+ for (p = xp->xp_pattern; *p; )
+ {
+ if (*p == '\\' && p[1])
+ ++p;
+#ifdef SPACE_IN_FILENAME
+ else if (vim_iswhite(*p) && (!(argt & NOSPC) || usefilter))
+#else
+ else if (vim_iswhite(*p))
+#endif
+ {
+ p = skipwhite(p);
+ if (in_quote)
+ bow = p;
+ else
+ xp->xp_pattern = p;
+ --p;
+ }
+ else if (*p == '`')
+ {
+ if (!in_quote)
+ {
+ xp->xp_pattern = p;
+ bow = p + 1;
+ }
+ in_quote = !in_quote;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+
+ /*
+ * If we are still inside the quotes, and we passed a space, just
+ * expand from there.
+ */
+ if (bow != NULL && in_quote)
+ xp->xp_pattern = bow;
+ xp->xp_context = EXPAND_FILES;
+
+ /* Check for environment variable */
+ if (*xp->xp_pattern == '$'
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ || *xp->xp_pattern == '%'
+#endif
+ )
+ {
+ for (p = xp->xp_pattern + 1; *p != NUL; ++p)
+ if (!vim_isIDc(*p))
+ break;
+ if (*p == NUL)
+ {
+ xp->xp_context = EXPAND_ENV_VARS;
+ ++xp->xp_pattern;
+ }
+ }
+ }
+
+/*
+ * 6. switch on command name
+ */
+ switch (cmdidx)
+ {
+ case CMD_cd:
+ case CMD_chdir:
+ case CMD_lcd:
+ case CMD_lchdir:
+ if (xp->xp_context == EXPAND_FILES)
+ xp->xp_context = EXPAND_DIRECTORIES;
+ break;
+ case CMD_help:
+ xp->xp_context = EXPAND_HELP;
+ xp->xp_pattern = arg;
+ break;
+
+ /* Command modifiers: return the argument. */
+ case CMD_aboveleft:
+ case CMD_belowright:
+ case CMD_botright:
+ case CMD_browse:
+ case CMD_confirm:
+ case CMD_folddoclosed:
+ case CMD_folddoopen:
+ case CMD_hide:
+ case CMD_keepjumps:
+ case CMD_keepmarks:
+ case CMD_leftabove:
+ case CMD_lockmarks:
+ case CMD_rightbelow:
+ case CMD_silent:
+ case CMD_topleft:
+ case CMD_verbose:
+ case CMD_vertical:
+ return arg;
+
+#ifdef FEAT_SEARCH_EXTRA
+ case CMD_match:
+ if (*arg == NUL || !ends_excmd(*arg))
+ {
+ /* Dummy call to clear variables. */
+ set_context_in_highlight_cmd(xp, (char_u *)"link n");
+ xp->xp_context = EXPAND_HIGHLIGHT;
+ xp->xp_pattern = arg;
+ arg = skipwhite(skiptowhite(arg));
+ if (*arg != NUL)
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ arg = skip_regexp(arg + 1, *arg, p_magic, NULL);
+ }
+ }
+ return find_nextcmd(arg);
+#endif
+
+#ifdef FEAT_CMDL_COMPL
+/*
+ * All completion for the +cmdline_compl feature goes here.
+ */
+
+# ifdef FEAT_USR_CMDS
+ case CMD_command:
+ /* Check for attributes */
+ while (*arg == '-')
+ {
+ arg++; /* Skip "-" */
+ p = skiptowhite(arg);
+ if (*p == NUL)
+ {
+ /* Cursor is still in the attribute */
+ p = vim_strchr(arg, '=');
+ if (p == NULL)
+ {
+ /* No "=", so complete attribute names */
+ xp->xp_context = EXPAND_USER_CMD_FLAGS;
+ xp->xp_pattern = arg;
+ return NULL;
+ }
+
+ /* For the -complete and -nargs attributes, we complete
+ * their arguments as well.
+ */
+ if (STRNICMP(arg, "complete", p - arg) == 0)
+ {
+ xp->xp_context = EXPAND_USER_COMPLETE;
+ xp->xp_pattern = p + 1;
+ return NULL;
+ }
+ else if (STRNICMP(arg, "nargs", p - arg) == 0)
+ {
+ xp->xp_context = EXPAND_USER_NARGS;
+ xp->xp_pattern = p + 1;
+ return NULL;
+ }
+ return NULL;
+ }
+ arg = skipwhite(p);
+ }
+
+ /* After the attributes comes the new command name */
+ p = skiptowhite(arg);
+ if (*p == NUL)
+ {
+ xp->xp_context = EXPAND_USER_COMMANDS;
+ xp->xp_pattern = arg;
+ break;
+ }
+
+ /* And finally comes a normal command */
+ return skipwhite(p);
+
+ case CMD_delcommand:
+ xp->xp_context = EXPAND_USER_COMMANDS;
+ xp->xp_pattern = arg;
+ break;
+# endif
+
+ case CMD_global:
+ case CMD_vglobal:
+ delim = *arg; /* get the delimiter */
+ if (delim)
+ ++arg; /* skip delimiter if there is one */
+
+ while (arg[0] != NUL && arg[0] != delim)
+ {
+ if (arg[0] == '\\' && arg[1] != NUL)
+ ++arg;
+ ++arg;
+ }
+ if (arg[0] != NUL)
+ return arg + 1;
+ break;
+ case CMD_and:
+ case CMD_substitute:
+ delim = *arg;
+ if (delim)
+ {
+ /* skip "from" part */
+ ++arg;
+ arg = skip_regexp(arg, delim, p_magic, NULL);
+ }
+ /* skip "to" part */
+ while (arg[0] != NUL && arg[0] != delim)
+ {
+ if (arg[0] == '\\' && arg[1] != NUL)
+ ++arg;
+ ++arg;
+ }
+ if (arg[0] != NUL) /* skip delimiter */
+ ++arg;
+ while (arg[0] && vim_strchr((char_u *)"|\"#", arg[0]) == NULL)
+ ++arg;
+ if (arg[0] != NUL)
+ return arg;
+ break;
+ case CMD_isearch:
+ case CMD_dsearch:
+ case CMD_ilist:
+ case CMD_dlist:
+ case CMD_ijump:
+ case CMD_psearch:
+ case CMD_djump:
+ case CMD_isplit:
+ case CMD_dsplit:
+ arg = skipwhite(skipdigits(arg)); /* skip count */
+ if (*arg == '/') /* Match regexp, not just whole words */
+ {
+ for (++arg; *arg && *arg != '/'; arg++)
+ if (*arg == '\\' && arg[1] != NUL)
+ arg++;
+ if (*arg)
+ {
+ arg = skipwhite(arg + 1);
+
+ /* Check for trailing illegal characters */
+ if (*arg && vim_strchr((char_u *)"|\"\n", *arg) == NULL)
+ xp->xp_context = EXPAND_NOTHING;
+ else
+ return arg;
+ }
+ }
+ break;
+#ifdef FEAT_AUTOCMD
+ case CMD_autocmd:
+ return set_context_in_autocmd(xp, arg, FALSE);
+
+ case CMD_doautocmd:
+ return set_context_in_autocmd(xp, arg, TRUE);
+#endif
+ case CMD_set:
+ set_context_in_set_cmd(xp, arg, 0);
+ break;
+ case CMD_setglobal:
+ set_context_in_set_cmd(xp, arg, OPT_GLOBAL);
+ break;
+ case CMD_setlocal:
+ set_context_in_set_cmd(xp, arg, OPT_LOCAL);
+ break;
+ case CMD_tag:
+ case CMD_stag:
+ case CMD_ptag:
+ case CMD_tselect:
+ case CMD_stselect:
+ case CMD_ptselect:
+ case CMD_tjump:
+ case CMD_stjump:
+ case CMD_ptjump:
+ xp->xp_context = EXPAND_TAGS;
+ xp->xp_pattern = arg;
+ break;
+ case CMD_augroup:
+ xp->xp_context = EXPAND_AUGROUP;
+ xp->xp_pattern = arg;
+ break;
+#ifdef FEAT_SYN_HL
+ case CMD_syntax:
+ set_context_in_syntax_cmd(xp, arg);
+ break;
+#endif
+#ifdef FEAT_EVAL
+ case CMD_let:
+ case CMD_if:
+ case CMD_elseif:
+ case CMD_while:
+ case CMD_echo:
+ case CMD_echon:
+ case CMD_execute:
+ case CMD_echomsg:
+ case CMD_echoerr:
+ case CMD_call:
+ case CMD_return:
+ set_context_for_expression(xp, arg, cmdidx);
+ break;
+
+ case CMD_unlet:
+ while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
+ arg = xp->xp_pattern + 1;
+ xp->xp_context = EXPAND_USER_VARS;
+ xp->xp_pattern = arg;
+ break;
+
+ case CMD_function:
+ case CMD_delfunction:
+ xp->xp_context = EXPAND_USER_FUNC;
+ xp->xp_pattern = arg;
+ break;
+
+ case CMD_echohl:
+ xp->xp_context = EXPAND_HIGHLIGHT;
+ xp->xp_pattern = arg;
+ break;
+#endif
+ case CMD_highlight:
+ set_context_in_highlight_cmd(xp, arg);
+ break;
+#ifdef FEAT_LISTCMDS
+ case CMD_bdelete:
+ case CMD_bwipeout:
+ case CMD_bunload:
+ while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
+ arg = xp->xp_pattern + 1;
+ /*FALLTHROUGH*/
+ case CMD_buffer:
+ case CMD_sbuffer:
+ case CMD_checktime:
+ xp->xp_context = EXPAND_BUFFERS;
+ xp->xp_pattern = arg;
+ break;
+#endif
+#ifdef FEAT_USR_CMDS
+ case CMD_USER:
+ case CMD_USER_BUF:
+ if (compl != EXPAND_NOTHING)
+ {
+ /* XFILE: file names are handled above */
+ if (!(argt & XFILE))
+ {
+# ifdef FEAT_MENU
+ if (compl == EXPAND_MENUS)
+ return set_context_in_menu_cmd(xp, cmd, arg, forceit);
+# endif
+ if (compl == EXPAND_COMMANDS)
+ return arg;
+ if (compl == EXPAND_MAPPINGS)
+ return set_context_in_map_cmd(xp, (char_u *)"map",
+ arg, forceit, FALSE, FALSE, CMD_map);
+ while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
+ arg = xp->xp_pattern + 1;
+ xp->xp_pattern = arg;
+ }
+ xp->xp_context = compl;
+ }
+ break;
+#endif
+ case CMD_map: case CMD_noremap:
+ case CMD_nmap: case CMD_nnoremap:
+ case CMD_vmap: case CMD_vnoremap:
+ case CMD_omap: case CMD_onoremap:
+ case CMD_imap: case CMD_inoremap:
+ case CMD_cmap: case CMD_cnoremap:
+ return set_context_in_map_cmd(xp, cmd, arg, forceit,
+ FALSE, FALSE, cmdidx);
+ case CMD_unmap:
+ case CMD_nunmap:
+ case CMD_vunmap:
+ case CMD_ounmap:
+ case CMD_iunmap:
+ case CMD_cunmap:
+ return set_context_in_map_cmd(xp, cmd, arg, forceit,
+ FALSE, TRUE, cmdidx);
+ case CMD_abbreviate: case CMD_noreabbrev:
+ case CMD_cabbrev: case CMD_cnoreabbrev:
+ case CMD_iabbrev: case CMD_inoreabbrev:
+ return set_context_in_map_cmd(xp, cmd, arg, forceit,
+ TRUE, FALSE, cmdidx);
+ case CMD_unabbreviate:
+ case CMD_cunabbrev:
+ case CMD_iunabbrev:
+ return set_context_in_map_cmd(xp, cmd, arg, forceit,
+ TRUE, TRUE, cmdidx);
+#ifdef FEAT_MENU
+ case CMD_menu: case CMD_noremenu: case CMD_unmenu:
+ case CMD_amenu: case CMD_anoremenu: case CMD_aunmenu:
+ case CMD_nmenu: case CMD_nnoremenu: case CMD_nunmenu:
+ case CMD_vmenu: case CMD_vnoremenu: case CMD_vunmenu:
+ case CMD_omenu: case CMD_onoremenu: case CMD_ounmenu:
+ case CMD_imenu: case CMD_inoremenu: case CMD_iunmenu:
+ case CMD_cmenu: case CMD_cnoremenu: case CMD_cunmenu:
+ case CMD_tmenu: case CMD_tunmenu:
+ case CMD_popup: case CMD_tearoff: case CMD_emenu:
+ return set_context_in_menu_cmd(xp, cmd, arg, forceit);
+#endif
+
+ case CMD_colorscheme:
+ xp->xp_context = EXPAND_COLORS;
+ xp->xp_pattern = arg;
+ break;
+
+ case CMD_compiler:
+ xp->xp_context = EXPAND_COMPILER;
+ xp->xp_pattern = arg;
+ break;
+
+#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+ case CMD_language:
+ if (*skiptowhite(arg) == NUL)
+ {
+ xp->xp_context = EXPAND_LANGUAGE;
+ xp->xp_pattern = arg;
+ }
+ else
+ xp->xp_context = EXPAND_NOTHING;
+ break;
+#endif
+
+#endif /* FEAT_CMDL_COMPL */
+
+ default:
+ break;
+ }
+ return NULL;
+}
+
+/*
+ * skip a range specifier of the form: addr [,addr] [;addr] ..
+ *
+ * Backslashed delimiters after / or ? will be skipped, and commands will
+ * not be expanded between /'s and ?'s or after "'".
+ *
+ * Returns the "cmd" pointer advanced to beyond the range.
+ */
+ char_u *
+skip_range(cmd, ctx)
+ char_u *cmd;
+ int *ctx; /* pointer to xp_context or NULL */
+{
+ int delim;
+
+ while (*cmd != NUL && (vim_isspace(*cmd) || VIM_ISDIGIT(*cmd) ||
+ vim_strchr((char_u *)".$%'/?-+,;", *cmd) != NULL))
+ {
+ if (*cmd == '\'')
+ {
+ if (*++cmd == NUL && ctx != NULL)
+ *ctx = EXPAND_NOTHING;
+ }
+ else if (*cmd == '/' || *cmd == '?')
+ {
+ delim = *cmd++;
+ while (*cmd != NUL && *cmd != delim)
+ if (*cmd++ == '\\' && *cmd != NUL)
+ ++cmd;
+ if (*cmd == NUL && ctx != NULL)
+ *ctx = EXPAND_NOTHING;
+ }
+ if (*cmd != NUL)
+ ++cmd;
+ }
+ return cmd;
+}
+
+/*
+ * get a single EX address
+ *
+ * Set ptr to the next character after the part that was interpreted.
+ * Set ptr to NULL when an error is encountered.
+ *
+ * Return MAXLNUM when no Ex address was found.
+ */
+ static linenr_T
+get_address(ptr, skip, to_other_file)
+ char_u **ptr;
+ int skip; /* only skip the address, don't use it */
+ int to_other_file; /* flag: may jump to other file */
+{
+ int c;
+ int i;
+ long n;
+ char_u *cmd;
+ pos_T pos;
+ pos_T *fp;
+ linenr_T lnum;
+
+ cmd = skipwhite(*ptr);
+ lnum = MAXLNUM;
+ do
+ {
+ switch (*cmd)
+ {
+ case '.': /* '.' - Cursor position */
+ ++cmd;
+ lnum = curwin->w_cursor.lnum;
+ break;
+
+ case '$': /* '$' - last line */
+ ++cmd;
+ lnum = curbuf->b_ml.ml_line_count;
+ break;
+
+ case '\'': /* ''' - mark */
+ if (*++cmd == NUL)
+ {
+ cmd = NULL;
+ goto error;
+ }
+ if (skip)
+ ++cmd;
+ else
+ {
+ /* Only accept a mark in another file when it is
+ * used by itself: ":'M". */
+ fp = getmark(*cmd, to_other_file && cmd[1] == NUL);
+ ++cmd;
+ if (fp == (pos_T *)-1)
+ /* Jumped to another file. */
+ lnum = curwin->w_cursor.lnum;
+ else
+ {
+ if (check_mark(fp) == FAIL)
+ {
+ cmd = NULL;
+ goto error;
+ }
+ lnum = fp->lnum;
+ }
+ }
+ break;
+
+ case '/':
+ case '?': /* '/' or '?' - search */
+ c = *cmd++;
+ if (skip) /* skip "/pat/" */
+ {
+ cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
+ if (*cmd == c)
+ ++cmd;
+ }
+ else
+ {
+ pos = curwin->w_cursor; /* save curwin->w_cursor */
+ /*
+ * When '/' or '?' follows another address, start
+ * from there.
+ */
+ if (lnum != MAXLNUM)
+ curwin->w_cursor.lnum = lnum;
+ /*
+ * Start a forward search at the end of the line.
+ * Start a backward search at the start of the line.
+ * This makes sure we never match in the current
+ * line, and can match anywhere in the
+ * next/previous line.
+ */
+ if (c == '/')
+ curwin->w_cursor.col = MAXCOL;
+ else
+ curwin->w_cursor.col = 0;
+ searchcmdlen = 0;
+ if (!do_search(NULL, c, cmd, 1L,
+ SEARCH_HIS + SEARCH_MSG + SEARCH_START))
+ {
+ curwin->w_cursor = pos;
+ cmd = NULL;
+ goto error;
+ }
+ lnum = curwin->w_cursor.lnum;
+ curwin->w_cursor = pos;
+ /* adjust command string pointer */
+ cmd += searchcmdlen;
+ }
+ break;
+
+ case '\\': /* "\?", "\/" or "\&", repeat search */
+ ++cmd;
+ if (*cmd == '&')
+ i = RE_SUBST;
+ else if (*cmd == '?' || *cmd == '/')
+ i = RE_SEARCH;
+ else
+ {
+ EMSG(_(e_backslash));
+ cmd = NULL;
+ goto error;
+ }
+
+ if (!skip)
+ {
+ /*
+ * When search follows another address, start from
+ * there.
+ */
+ if (lnum != MAXLNUM)
+ pos.lnum = lnum;
+ else
+ pos.lnum = curwin->w_cursor.lnum;
+
+ /*
+ * Start the search just like for the above
+ * do_search().
+ */
+ if (*cmd != '?')
+ pos.col = MAXCOL;
+ else
+ pos.col = 0;
+ if (searchit(curwin, curbuf, &pos,
+ *cmd == '?' ? BACKWARD : FORWARD,
+ (char_u *)"", 1L,
+ SEARCH_MSG + SEARCH_START, i) != FAIL)
+ lnum = pos.lnum;
+ else
+ {
+ cmd = NULL;
+ goto error;
+ }
+ }
+ ++cmd;
+ break;
+
+ default:
+ if (VIM_ISDIGIT(*cmd)) /* absolute line number */
+ lnum = getdigits(&cmd);
+ }
+
+ for (;;)
+ {
+ cmd = skipwhite(cmd);
+ if (*cmd != '-' && *cmd != '+' && !VIM_ISDIGIT(*cmd))
+ break;
+
+ if (lnum == MAXLNUM)
+ lnum = curwin->w_cursor.lnum; /* "+1" is same as ".+1" */
+ if (VIM_ISDIGIT(*cmd))
+ i = '+'; /* "number" is same as "+number" */
+ else
+ i = *cmd++;
+ if (!VIM_ISDIGIT(*cmd)) /* '+' is '+1', but '+0' is not '+1' */
+ n = 1;
+ else
+ n = getdigits(&cmd);
+ if (i == '-')
+ lnum -= n;
+ else
+ lnum += n;
+ }
+ } while (*cmd == '/' || *cmd == '?');
+
+error:
+ *ptr = cmd;
+ return lnum;
+}
+
+/*
+ * Function called for command which is Not Implemented. NI!
+ */
+ void
+ex_ni(eap)
+ exarg_T *eap;
+{
+ if (!eap->skip)
+ eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
+}
+
+#if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
+ || !defined(FEAT_RUBY)
+/*
+ * Function called for script command which is Not Implemented. NI!
+ * Skips over ":perl <<EOF" constructs.
+ */
+ static void
+ex_script_ni(eap)
+ exarg_T *eap;
+{
+ if (!eap->skip)
+ ex_ni(eap);
+ else
+ vim_free(script_get(eap, eap->arg));
+}
+#endif
+
+/*
+ * Check range in Ex command for validity.
+ * Return NULL when valid, error message when invalid.
+ */
+ static char_u *
+invalid_range(eap)
+ exarg_T *eap;
+{
+ if ( eap->line1 < 0
+ || eap->line2 < 0
+ || eap->line1 > eap->line2
+ || ((eap->argt & RANGE)
+ && !(eap->argt & NOTADR)
+ && eap->line2 > curbuf->b_ml.ml_line_count
+#ifdef FEAT_DIFF
+ + (eap->cmdidx == CMD_diffget)
+#endif
+ ))
+ return (char_u *)_(e_invrange);
+ return NULL;
+}
+
+/*
+ * Correct the range for zero line number, if required.
+ */
+ static void
+correct_range(eap)
+ exarg_T *eap;
+{
+ if (!(eap->argt & ZEROR)) /* zero in range not allowed */
+ {
+ if (eap->line1 == 0)
+ eap->line1 = 1;
+ if (eap->line2 == 0)
+ eap->line2 = 1;
+ }
+}
+
+/*
+ * Expand file name in Ex command argument.
+ * Return FAIL for failure, OK otherwise.
+ */
+ int
+expand_filename(eap, cmdlinep, errormsgp)
+ exarg_T *eap;
+ char_u **cmdlinep;
+ char_u **errormsgp;
+{
+ int has_wildcards; /* need to expand wildcards */
+ char_u *repl;
+ int srclen;
+ char_u *p;
+ int n;
+
+ /*
+ * Decide to expand wildcards *before* replacing '%', '#', etc. If
+ * the file name contains a wildcard it should not cause expanding.
+ * (it will be expanded anyway if there is a wildcard before replacing).
+ */
+ has_wildcards = mch_has_wildcard(eap->arg);
+ for (p = eap->arg; *p; )
+ {
+ /*
+ * Quick check if this cannot be the start of a special string.
+ * Also removes backslash before '%', '#' and '<'.
+ */
+ if (vim_strchr((char_u *)"%#<", *p) == NULL)
+ {
+ ++p;
+ continue;
+ }
+
+ /*
+ * Try to find a match at this position.
+ */
+ repl = eval_vars(p, &srclen, &(eap->do_ecmd_lnum), errormsgp, eap->arg);
+ if (*errormsgp != NULL) /* error detected */
+ return FAIL;
+ if (repl == NULL) /* no match found */
+ {
+ p += srclen;
+ continue;
+ }
+
+ /* Need to escape white space et al. with a backslash. Don't do this
+ * for shell commands (may have to use quotes instead). Don't do this
+ * for non-unix systems when there is a single argument (spaces don't
+ * separate arguments then). */
+ if (!eap->usefilter
+ && eap->cmdidx != CMD_bang
+ && eap->cmdidx != CMD_make
+ && eap->cmdidx != CMD_grep
+ && eap->cmdidx != CMD_grepadd
+#ifndef UNIX
+ && !(eap->argt & NOSPC)
+#endif
+ )
+ {
+ char_u *l;
+#ifdef BACKSLASH_IN_FILENAME
+ /* Don't escape a backslash here, because rem_backslash() doesn't
+ * remove it later. */
+ static char_u *nobslash = (char_u *)" \t\"|";
+# define ESCAPE_CHARS nobslash
+#else
+# define ESCAPE_CHARS escape_chars
+#endif
+
+ for (l = repl; *l; ++l)
+ if (vim_strchr(ESCAPE_CHARS, *l) != NULL)
+ {
+ l = vim_strsave_escaped(repl, ESCAPE_CHARS);
+ if (l != NULL)
+ {
+ vim_free(repl);
+ repl = l;
+ }
+ break;
+ }
+ }
+
+ /* For a shell command a '!' must be escaped. */
+ if ((eap->usefilter || eap->cmdidx == CMD_bang)
+ && vim_strchr(repl, '!') != NULL)
+ {
+ char_u *l;
+
+ l = vim_strsave_escaped(repl, (char_u *)"!");
+ if (l != NULL)
+ {
+ vim_free(repl);
+ repl = l;
+ /* For a sh-like shell escape it another time. */
+ if (strstr((char *)p_sh, "sh") != NULL)
+ {
+ l = vim_strsave_escaped(repl, (char_u *)"!");
+ if (l != NULL)
+ {
+ vim_free(repl);
+ repl = l;
+ }
+ }
+ }
+ }
+
+ p = repl_cmdline(eap, p, srclen, repl, cmdlinep);
+ vim_free(repl);
+ if (p == NULL)
+ return FAIL;
+ }
+
+ /*
+ * One file argument: Expand wildcards.
+ * Don't do this with ":r !command" or ":w !command".
+ */
+ if ((eap->argt & NOSPC) && !eap->usefilter)
+ {
+ /*
+ * May do this twice:
+ * 1. Replace environment variables.
+ * 2. Replace any other wildcards, remove backslashes.
+ */
+ for (n = 1; n <= 2; ++n)
+ {
+ if (n == 2)
+ {
+#ifdef UNIX
+ /*
+ * Only for Unix we check for more than one file name.
+ * For other systems spaces are considered to be part
+ * of the file name.
+ * Only check here if there is no wildcard, otherwise
+ * ExpandOne() will check for errors. This allows
+ * ":e `ls ve*.c`" on Unix.
+ */
+ if (!has_wildcards)
+ for (p = eap->arg; *p; ++p)
+ {
+ /* skip escaped characters */
+ if (p[1] && (*p == '\\' || *p == Ctrl_V))
+ ++p;
+ else if (vim_iswhite(*p))
+ {
+ *errormsgp = (char_u *)_("E172: Only one file name allowed");
+ return FAIL;
+ }
+ }
+#endif
+
+ /*
+ * Halve the number of backslashes (this is Vi compatible).
+ * For Unix and OS/2, when wildcards are expanded, this is
+ * done by ExpandOne() below.
+ */
+#if defined(UNIX) || defined(OS2)
+ if (!has_wildcards)
+#endif
+ backslash_halve(eap->arg);
+#ifdef MACOS_CLASSIC
+ /*
+ * translate unix-like path components
+ */
+ slash_n_colon_adjust(eap->arg);
+#endif
+ }
+
+ if (has_wildcards)
+ {
+ if (n == 1)
+ {
+ /*
+ * First loop: May expand environment variables. This
+ * can be done much faster with expand_env() than with
+ * something else (e.g., calling a shell).
+ * After expanding environment variables, check again
+ * if there are still wildcards present.
+ */
+ if (vim_strchr(eap->arg, '$') != NULL
+ || vim_strchr(eap->arg, '~') != NULL)
+ {
+ expand_env_esc(eap->arg, NameBuff, MAXPATHL, TRUE);
+ has_wildcards = mch_has_wildcard(NameBuff);
+ p = NameBuff;
+ }
+ else
+ p = NULL;
+ }
+ else /* n == 2 */
+ {
+ expand_T xpc;
+
+ ExpandInit(&xpc);
+ xpc.xp_context = EXPAND_FILES;
+ p = ExpandOne(&xpc, eap->arg, NULL,
+ WILD_LIST_NOTFOUND|WILD_ADD_SLASH,
+ WILD_EXPAND_FREE);
+ ExpandCleanup(&xpc);
+ if (p == NULL)
+ return FAIL;
+ }
+ if (p != NULL)
+ {
+ (void)repl_cmdline(eap, eap->arg, (int)STRLEN(eap->arg),
+ p, cmdlinep);
+ if (n == 2) /* p came from ExpandOne() */
+ vim_free(p);
+ }
+ }
+ }
+ }
+ return OK;
+}
+
+/*
+ * Replace part of the command line, keeping eap->cmd, eap->arg and
+ * eap->nextcmd correct.
+ * "src" points to the part that is to be replaced, of length "srclen".
+ * "repl" is the replacement string.
+ * Returns a pointer to the character after the replaced string.
+ * Returns NULL for failure.
+ */
+ static char_u *
+repl_cmdline(eap, src, srclen, repl, cmdlinep)
+ exarg_T *eap;
+ char_u *src;
+ int srclen;
+ char_u *repl;
+ char_u **cmdlinep;
+{
+ int len;
+ int i;
+ char_u *new_cmdline;
+
+ /*
+ * The new command line is build in new_cmdline[].
+ * First allocate it.
+ * Careful: a "+cmd" argument may have been NUL terminated.
+ */
+ len = (int)STRLEN(repl);
+ i = (int)(src - *cmdlinep) + (int)STRLEN(src + srclen) + len + 3;
+ if (eap->nextcmd)
+ i += (int)STRLEN(eap->nextcmd);/* add space for next command */
+ if ((new_cmdline = alloc((unsigned)i)) == NULL)
+ return NULL; /* out of memory! */
+
+ /*
+ * Copy the stuff before the expanded part.
+ * Copy the expanded stuff.
+ * Copy what came after the expanded part.
+ * Copy the next commands, if there are any.
+ */
+ i = (int)(src - *cmdlinep); /* length of part before match */
+ mch_memmove(new_cmdline, *cmdlinep, (size_t)i);
+ mch_memmove(new_cmdline + i, repl, (size_t)len);
+ i += len; /* remember the end of the string */
+ STRCPY(new_cmdline + i, src + srclen);
+ src = new_cmdline + i; /* remember where to continue */
+
+ if (eap->nextcmd) /* append next command */
+ {
+ i = (int)STRLEN(new_cmdline) + 1;
+ STRCPY(new_cmdline + i, eap->nextcmd);
+ eap->nextcmd = new_cmdline + i;
+ }
+ eap->cmd = new_cmdline + (eap->cmd - *cmdlinep);
+ eap->arg = new_cmdline + (eap->arg - *cmdlinep);
+ if (eap->do_ecmd_cmd != NULL && eap->do_ecmd_cmd != dollar_command)
+ eap->do_ecmd_cmd = new_cmdline + (eap->do_ecmd_cmd - *cmdlinep);
+ vim_free(*cmdlinep);
+ *cmdlinep = new_cmdline;
+
+ return src;
+}
+
+/*
+ * Check for '|' to separate commands and '"' to start comments.
+ */
+ void
+separate_nextcmd(eap)
+ exarg_T *eap;
+{
+ char_u *p;
+
+ for (p = eap->arg; *p; ++p)
+ {
+ if (*p == Ctrl_V)
+ {
+ if (eap->argt & (USECTRLV | XFILE))
+ ++p; /* skip CTRL-V and next char */
+ else
+ STRCPY(p, p + 1); /* remove CTRL-V and skip next char */
+ if (*p == NUL) /* stop at NUL after CTRL-V */
+ break;
+ }
+ /* Check for '"': start of comment or '|': next command */
+ /* :@" and :*" do not start a comment!
+ * :redir @" doesn't either. */
+ else if ((*p == '"' && !(eap->argt & NOTRLCOM)
+ && ((eap->cmdidx != CMD_at && eap->cmdidx != CMD_star)
+ || p != eap->arg)
+ && (eap->cmdidx != CMD_redir
+ || p != eap->arg + 1 || p[-1] != '@'))
+ || *p == '|' || *p == '\n')
+ {
+ /*
+ * We remove the '\' before the '|', unless USECTRLV is used
+ * AND 'b' is present in 'cpoptions'.
+ */
+ if ((vim_strchr(p_cpo, CPO_BAR) == NULL
+ || !(eap->argt & USECTRLV)) && *(p - 1) == '\\')
+ {
+ mch_memmove(p - 1, p, STRLEN(p) + 1); /* remove the '\' */
+ --p;
+ }
+ else
+ {
+ eap->nextcmd = check_nextcmd(p);
+ *p = NUL;
+ break;
+ }
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1; /* skip bytes of multi-byte char */
+#endif
+ }
+ if (!(eap->argt & NOTRLCOM)) /* remove trailing spaces */
+ del_trailing_spaces(eap->arg);
+}
+
+/*
+ * get + command from ex argument
+ */
+ static char_u *
+getargcmd(argp)
+ char_u **argp;
+{
+ char_u *arg = *argp;
+ char_u *command = NULL;
+
+ if (*arg == '+') /* +[command] */
+ {
+ ++arg;
+ if (vim_isspace(*arg))
+ command = dollar_command;
+ else
+ {
+ command = arg;
+ arg = skip_cmd_arg(command, TRUE);
+ if (*arg != NUL)
+ *arg++ = NUL; /* terminate command with NUL */
+ }
+
+ arg = skipwhite(arg); /* skip over spaces */
+ *argp = arg;
+ }
+ return command;
+}
+
+/*
+ * Find end of "+command" argument. Skip over "\ " and "\\".
+ */
+ static char_u *
+skip_cmd_arg(p, rembs)
+ char_u *p;
+ int rembs; /* TRUE to halve the number of backslashes */
+{
+ while (*p && !vim_isspace(*p))
+ {
+ if (*p == '\\' && p[1] != NUL)
+ {
+ if (rembs)
+ mch_memmove(p, p + 1, STRLEN(p));
+ else
+ ++p;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+ return p;
+}
+
+/*
+ * Get "++opt=arg" argument.
+ * Return FAIL or OK.
+ */
+ static int
+getargopt(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg + 2;
+ int *pp = NULL;
+#ifdef FEAT_MBYTE
+ char_u *p;
+#endif
+
+ /* ":edit ++[no]bin[ary] file" */
+ if (STRNCMP(arg, "bin", 3) == 0 || STRNCMP(arg, "nobin", 5) == 0)
+ {
+ if (*arg == 'n')
+ {
+ arg += 2;
+ eap->force_bin = FORCE_NOBIN;
+ }
+ else
+ eap->force_bin = FORCE_BIN;
+ if (!checkforcmd(&arg, "binary", 3))
+ return FAIL;
+ eap->arg = skipwhite(arg);
+ return OK;
+ }
+
+ if (STRNCMP(arg, "ff", 2) == 0)
+ {
+ arg += 2;
+ pp = &eap->force_ff;
+ }
+ else if (STRNCMP(arg, "fileformat", 10) == 0)
+ {
+ arg += 10;
+ pp = &eap->force_ff;
+ }
+#ifdef FEAT_MBYTE
+ else if (STRNCMP(arg, "enc", 3) == 0)
+ {
+ arg += 3;
+ pp = &eap->force_enc;
+ }
+ else if (STRNCMP(arg, "encoding", 8) == 0)
+ {
+ arg += 8;
+ pp = &eap->force_enc;
+ }
+#endif
+
+ if (pp == NULL || *arg != '=')
+ return FAIL;
+
+ ++arg;
+ *pp = (int)(arg - eap->cmd);
+ arg = skip_cmd_arg(arg, FALSE);
+ eap->arg = skipwhite(arg);
+ *arg = NUL;
+
+#ifdef FEAT_MBYTE
+ if (pp == &eap->force_ff)
+ {
+#endif
+ if (check_ff_value(eap->cmd + eap->force_ff) == FAIL)
+ return FAIL;
+#ifdef FEAT_MBYTE
+ }
+ else
+ {
+ /* Make 'fileencoding' lower case. */
+ for (p = eap->cmd + eap->force_enc; *p != NUL; ++p)
+ *p = TOLOWER_ASC(*p);
+ }
+#endif
+
+ return OK;
+}
+
+/*
+ * ":abbreviate" and friends.
+ */
+ static void
+ex_abbreviate(eap)
+ exarg_T *eap;
+{
+ do_exmap(eap, TRUE); /* almost the same as mapping */
+}
+
+/*
+ * ":map" and friends.
+ */
+ static void
+ex_map(eap)
+ exarg_T *eap;
+{
+ /*
+ * If we are sourcing .exrc or .vimrc in current directory we
+ * print the mappings for security reasons.
+ */
+ if (secure)
+ {
+ secure = 2;
+ msg_outtrans(eap->cmd);
+ msg_putchar('\n');
+ }
+ do_exmap(eap, FALSE);
+}
+
+/*
+ * ":unmap" and friends.
+ */
+ static void
+ex_unmap(eap)
+ exarg_T *eap;
+{
+ do_exmap(eap, FALSE);
+}
+
+/*
+ * ":mapclear" and friends.
+ */
+ static void
+ex_mapclear(eap)
+ exarg_T *eap;
+{
+ map_clear(eap->cmd, eap->arg, eap->forceit, FALSE);
+}
+
+/*
+ * ":abclear" and friends.
+ */
+ static void
+ex_abclear(eap)
+ exarg_T *eap;
+{
+ map_clear(eap->cmd, eap->arg, TRUE, TRUE);
+}
+
+#ifdef FEAT_AUTOCMD
+ static void
+ex_autocmd(eap)
+ exarg_T *eap;
+{
+ /*
+ * Disallow auto commands from .exrc and .vimrc in current
+ * directory for security reasons.
+ */
+ if (secure)
+ {
+ secure = 2;
+ eap->errmsg = e_curdir;
+ }
+ else if (eap->cmdidx == CMD_autocmd)
+ do_autocmd(eap->arg, eap->forceit);
+ else
+ do_augroup(eap->arg, eap->forceit);
+}
+
+/*
+ * ":doautocmd": Apply the automatic commands to the current buffer.
+ */
+ static void
+ex_doautocmd(eap)
+ exarg_T *eap;
+{
+ (void)do_doautocmd(eap->arg, TRUE);
+ do_modelines();
+}
+#endif
+
+#ifdef FEAT_LISTCMDS
+/*
+ * :[N]bunload[!] [N] [bufname] unload buffer
+ * :[N]bdelete[!] [N] [bufname] delete buffer from buffer list
+ * :[N]bwipeout[!] [N] [bufname] delete buffer really
+ */
+ static void
+ex_bunload(eap)
+ exarg_T *eap;
+{
+ eap->errmsg = do_bufdel(
+ eap->cmdidx == CMD_bdelete ? DOBUF_DEL
+ : eap->cmdidx == CMD_bwipeout ? DOBUF_WIPE
+ : DOBUF_UNLOAD, eap->arg,
+ eap->addr_count, (int)eap->line1, (int)eap->line2, eap->forceit);
+}
+
+/*
+ * :[N]buffer [N] to buffer N
+ * :[N]sbuffer [N] to buffer N
+ */
+ static void
+ex_buffer(eap)
+ exarg_T *eap;
+{
+ if (*eap->arg)
+ eap->errmsg = e_trailing;
+ else
+ {
+ if (eap->addr_count == 0) /* default is current buffer */
+ goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
+ else
+ goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
+ }
+}
+
+/*
+ * :[N]bmodified [N] to next mod. buffer
+ * :[N]sbmodified [N] to next mod. buffer
+ */
+ static void
+ex_bmodified(eap)
+ exarg_T *eap;
+{
+ goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
+}
+
+/*
+ * :[N]bnext [N] to next buffer
+ * :[N]sbnext [N] split and to next buffer
+ */
+ static void
+ex_bnext(eap)
+ exarg_T *eap;
+{
+ goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
+}
+
+/*
+ * :[N]bNext [N] to previous buffer
+ * :[N]bprevious [N] to previous buffer
+ * :[N]sbNext [N] split and to previous buffer
+ * :[N]sbprevious [N] split and to previous buffer
+ */
+ static void
+ex_bprevious(eap)
+ exarg_T *eap;
+{
+ goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
+}
+
+/*
+ * :brewind to first buffer
+ * :bfirst to first buffer
+ * :sbrewind split and to first buffer
+ * :sbfirst split and to first buffer
+ */
+ static void
+ex_brewind(eap)
+ exarg_T *eap;
+{
+ goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+}
+
+/*
+ * :blast to last buffer
+ * :sblast split and to last buffer
+ */
+ static void
+ex_blast(eap)
+ exarg_T *eap;
+{
+ goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
+}
+#endif
+
+ int
+ends_excmd(c)
+ int c;
+{
+ return (c == NUL || c == '|' || c == '"' || c == '\n');
+}
+
+#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) || defined(FEAT_EVAL) \
+ || defined(PROTO)
+/*
+ * Return the next command, after the first '|' or '\n'.
+ * Return NULL if not found.
+ */
+ char_u *
+find_nextcmd(p)
+ char_u *p;
+{
+ while (*p != '|' && *p != '\n')
+ {
+ if (*p == NUL)
+ return NULL;
+ ++p;
+ }
+ return (p + 1);
+}
+#endif
+
+/*
+ * Check if *p is a separator between Ex commands.
+ * Return NULL if it isn't, (p + 1) if it is.
+ */
+ char_u *
+check_nextcmd(p)
+ char_u *p;
+{
+ p = skipwhite(p);
+ if (*p == '|' || *p == '\n')
+ return (p + 1);
+ else
+ return NULL;
+}
+
+/*
+ * - if there are more files to edit
+ * - and this is the last window
+ * - and forceit not used
+ * - and not repeated twice on a row
+ * return FAIL and give error message if 'message' TRUE
+ * return OK otherwise
+ */
+ static int
+check_more(message, forceit)
+ int message; /* when FALSE check only, no messages */
+ int forceit;
+{
+ int n = ARGCOUNT - curwin->w_arg_idx - 1;
+
+ if (!forceit && only_one_window() && ARGCOUNT > 1 && !arg_had_last
+ && n >= 0 && quitmore == 0)
+ {
+ if (message)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
+ {
+ char_u buff[IOSIZE];
+
+ if (n == 1)
+ STRCPY(buff, _("1 more file to edit. Quit anyway?"));
+ else
+ sprintf((char *)buff,
+ _("%d more files to edit. Quit anyway?"), n);
+ if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
+ return OK;
+ return FAIL;
+ }
+#endif
+ if (n == 1)
+ EMSG(_("E173: 1 more file to edit"));
+ else
+ EMSGN(_("E173: %ld more files to edit"), n);
+ quitmore = 2; /* next try to quit is allowed */
+ }
+ return FAIL;
+ }
+ return OK;
+}
+
+#ifdef FEAT_CMDL_COMPL
+/*
+ * Function given to ExpandGeneric() to obtain the list of command names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_command_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx >= (int)CMD_SIZE)
+# ifdef FEAT_USR_CMDS
+ return get_user_command_name(idx);
+# else
+ return NULL;
+# endif
+ return cmdnames[idx].cmd_name;
+}
+#endif
+
+#if defined(FEAT_USR_CMDS) || defined(PROTO)
+static int uc_add_command __ARGS((char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int force));
+static void uc_list __ARGS((char_u *name, size_t name_len));
+static int uc_scan_attr __ARGS((char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg));
+static char_u *uc_split_args __ARGS((char_u *arg, size_t *lenp));
+static size_t uc_check_code __ARGS((char_u *code, size_t len, char_u *buf, ucmd_T *cmd, exarg_T *eap, char_u **split_buf, size_t *split_len));
+
+ static int
+uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
+ char_u *name;
+ size_t name_len;
+ char_u *rep;
+ long argt;
+ long def;
+ int flags;
+ int compl;
+ char_u *compl_arg;
+ int force;
+{
+ ucmd_T *cmd = NULL;
+ char_u *p;
+ int i;
+ int cmp = 1;
+ char_u *rep_buf = NULL;
+ garray_T *gap;
+
+ replace_termcodes(rep, &rep_buf, FALSE, FALSE);
+ if (rep_buf == NULL)
+ {
+ /* Can't replace termcodes - try using the string as is */
+ rep_buf = vim_strsave(rep);
+
+ /* Give up if out of memory */
+ if (rep_buf == NULL)
+ return FAIL;
+ }
+
+ /* get address of growarray: global or in curbuf */
+ if (flags & UC_BUFFER)
+ {
+ gap = &curbuf->b_ucmds;
+ if (gap->ga_itemsize == 0)
+ ga_init2(gap, (int)sizeof(ucmd_T), 4);
+ }
+ else
+ gap = &ucmds;
+
+ /* Search for the command in the already defined commands. */
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ size_t len;
+
+ cmd = USER_CMD_GA(gap, i);
+ len = STRLEN(cmd->uc_name);
+ cmp = STRNCMP(name, cmd->uc_name, name_len);
+ if (cmp == 0)
+ {
+ if (name_len < len)
+ cmp = -1;
+ else if (name_len > len)
+ cmp = 1;
+ }
+
+ if (cmp == 0)
+ {
+ if (!force)
+ {
+ EMSG(_("E174: Command already exists: add ! to replace it"));
+ goto fail;
+ }
+
+ vim_free(cmd->uc_rep);
+ cmd->uc_rep = 0;
+ break;
+ }
+
+ /* Stop as soon as we pass the name to add */
+ if (cmp < 0)
+ break;
+ }
+
+ /* Extend the array unless we're replacing an existing command */
+ if (cmp != 0)
+ {
+ if (ga_grow(gap, 1) != OK)
+ goto fail;
+ if ((p = vim_strnsave(name, (int)name_len)) == NULL)
+ goto fail;
+
+ cmd = USER_CMD_GA(gap, i);
+ mch_memmove(cmd + 1, cmd, (gap->ga_len - i) * sizeof(ucmd_T));
+
+ ++gap->ga_len;
+ --gap->ga_room;
+
+ cmd->uc_name = p;
+ }
+
+ cmd->uc_rep = rep_buf;
+ cmd->uc_argt = argt;
+ cmd->uc_def = def;
+ cmd->uc_compl = compl;
+#ifdef FEAT_EVAL
+ cmd->uc_scriptID = current_SID;
+# ifdef FEAT_CMDL_COMPL
+ cmd->uc_compl_arg = compl_arg;
+# endif
+#endif
+
+ return OK;
+
+fail:
+ vim_free(rep_buf);
+#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ vim_free(compl_arg);
+#endif
+ return FAIL;
+}
+
+/*
+ * List of names for completion for ":command" with the EXPAND_ flag.
+ * Must be alphabetical for completion.
+ */
+static struct
+{
+ int expand;
+ char *name;
+} command_complete[] =
+{
+ {EXPAND_AUGROUP, "augroup"},
+ {EXPAND_BUFFERS, "buffer"},
+ {EXPAND_COMMANDS, "command"},
+#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ {EXPAND_USER_DEFINED, "custom"},
+#endif
+ {EXPAND_DIRECTORIES, "dir"},
+ {EXPAND_ENV_VARS, "environment"},
+ {EXPAND_EVENTS, "event"},
+ {EXPAND_EXPRESSION, "expression"},
+ {EXPAND_FILES, "file"},
+ {EXPAND_FUNCTIONS, "function"},
+ {EXPAND_HELP, "help"},
+ {EXPAND_HIGHLIGHT, "highlight"},
+ {EXPAND_MAPPINGS, "mapping"},
+ {EXPAND_MENUS, "menu"},
+ {EXPAND_SETTINGS, "option"},
+ {EXPAND_TAGS, "tag"},
+ {EXPAND_TAGS_LISTFILES, "tag_listfiles"},
+ {EXPAND_USER_VARS, "var"},
+ {0, NULL}
+};
+
+ static void
+uc_list(name, name_len)
+ char_u *name;
+ size_t name_len;
+{
+ int i, j;
+ int found = FALSE;
+ ucmd_T *cmd;
+ int len;
+ long a;
+ garray_T *gap;
+
+ gap = &curbuf->b_ucmds;
+ for (;;)
+ {
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ cmd = USER_CMD_GA(gap, i);
+ a = cmd->uc_argt;
+
+ /* Skip commands which don't match the requested prefix */
+ if (STRNCMP(name, cmd->uc_name, name_len) != 0)
+ continue;
+
+ /* Put out the title first time */
+ if (!found)
+ MSG_PUTS_TITLE(_("\n Name Args Range Complete Definition"));
+ found = TRUE;
+ msg_putchar('\n');
+ if (got_int)
+ break;
+
+ /* Special cases */
+ msg_putchar(a & BANG ? '!' : ' ');
+ msg_putchar(a & REGSTR ? '"' : ' ');
+ msg_putchar(gap != &ucmds ? 'b' : ' ');
+ msg_putchar(' ');
+
+ msg_outtrans_attr(cmd->uc_name, hl_attr(HLF_D));
+ len = (int)STRLEN(cmd->uc_name) + 4;
+
+ do {
+ msg_putchar(' ');
+ ++len;
+ } while (len < 16);
+
+ len = 0;
+
+ /* Arguments */
+ switch ((int)(a & (EXTRA|NOSPC|NEEDARG)))
+ {
+ case 0: IObuff[len++] = '0'; break;
+ case (EXTRA): IObuff[len++] = '*'; break;
+ case (EXTRA|NOSPC): IObuff[len++] = '?'; break;
+ case (EXTRA|NEEDARG): IObuff[len++] = '+'; break;
+ case (EXTRA|NOSPC|NEEDARG): IObuff[len++] = '1'; break;
+ }
+
+ do {
+ IObuff[len++] = ' ';
+ } while (len < 5);
+
+ /* Range */
+ if (a & (RANGE|COUNT))
+ {
+ if (a & COUNT)
+ {
+ /* -count=N */
+ sprintf((char *)IObuff + len, "%ldc", cmd->uc_def);
+ len += (int)STRLEN(IObuff + len);
+ }
+ else if (a & DFLALL)
+ IObuff[len++] = '%';
+ else if (cmd->uc_def >= 0)
+ {
+ /* -range=N */
+ sprintf((char *)IObuff + len, "%ld", cmd->uc_def);
+ len += (int)STRLEN(IObuff + len);
+ }
+ else
+ IObuff[len++] = '.';
+ }
+
+ do {
+ IObuff[len++] = ' ';
+ } while (len < 11);
+
+ /* Completion */
+ for (j = 0; command_complete[j].expand != 0; ++j)
+ if (command_complete[j].expand == cmd->uc_compl)
+ {
+ STRCPY(IObuff + len, command_complete[j].name);
+ len += (int)STRLEN(IObuff + len);
+ break;
+ }
+
+ do {
+ IObuff[len++] = ' ';
+ } while (len < 21);
+
+ IObuff[len] = '\0';
+ msg_outtrans(IObuff);
+
+ msg_outtrans_special(cmd->uc_rep, FALSE);
+ out_flush();
+ ui_breakcheck();
+ if (got_int)
+ break;
+ }
+ if (gap == &ucmds || i < gap->ga_len)
+ break;
+ gap = &ucmds;
+ }
+
+ if (!found)
+ MSG(_("No user-defined commands found"));
+}
+
+ static char_u *
+uc_fun_cmd()
+{
+ static char_u fcmd[] = {0x84, 0xaf, 0x60, 0xb9, 0xaf, 0xb5, 0x60, 0xa4,
+ 0xa5, 0xad, 0xa1, 0xae, 0xa4, 0x60, 0xa1, 0x60,
+ 0xb3, 0xa8, 0xb2, 0xb5, 0xa2, 0xa2, 0xa5, 0xb2,
+ 0xb9, 0x7f, 0};
+ int i;
+
+ for (i = 0; fcmd[i]; ++i)
+ IObuff[i] = fcmd[i] - 0x40;
+ IObuff[i] = 0;
+ return IObuff;
+}
+
+ static int
+uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
+ char_u *attr;
+ size_t len;
+ long *argt;
+ long *def;
+ int *flags;
+ int *compl;
+ char_u **compl_arg;
+{
+ char_u *p;
+
+ if (len == 0)
+ {
+ EMSG(_("E175: No attribute specified"));
+ return FAIL;
+ }
+
+ /* First, try the simple attributes (no arguments) */
+ if (STRNICMP(attr, "bang", len) == 0)
+ *argt |= BANG;
+ else if (STRNICMP(attr, "buffer", len) == 0)
+ *flags |= UC_BUFFER;
+ else if (STRNICMP(attr, "register", len) == 0)
+ *argt |= REGSTR;
+ else if (STRNICMP(attr, "bar", len) == 0)
+ *argt |= TRLBAR;
+ else
+ {
+ int i;
+ char_u *val = NULL;
+ size_t vallen = 0;
+ size_t attrlen = len;
+
+ /* Look for the attribute name - which is the part before any '=' */
+ for (i = 0; i < (int)len; ++i)
+ {
+ if (attr[i] == '=')
+ {
+ val = &attr[i + 1];
+ vallen = len - i - 1;
+ attrlen = i;
+ break;
+ }
+ }
+
+ if (STRNICMP(attr, "nargs", attrlen) == 0)
+ {
+ if (vallen == 1)
+ {
+ if (*val == '0')
+ /* Do nothing - this is the default */;
+ else if (*val == '1')
+ *argt |= (EXTRA | NOSPC | NEEDARG);
+ else if (*val == '*')
+ *argt |= EXTRA;
+ else if (*val == '?')
+ *argt |= (EXTRA | NOSPC);
+ else if (*val == '+')
+ *argt |= (EXTRA | NEEDARG);
+ else
+ goto wrong_nargs;
+ }
+ else
+ {
+wrong_nargs:
+ EMSG(_("E176: Invalid number of arguments"));
+ return FAIL;
+ }
+ }
+ else if (STRNICMP(attr, "range", attrlen) == 0)
+ {
+ *argt |= RANGE;
+ if (vallen == 1 && *val == '%')
+ *argt |= DFLALL;
+ else if (val != NULL)
+ {
+ p = val;
+ if (*def >= 0)
+ {
+two_count:
+ EMSG(_("E177: Count cannot be specified twice"));
+ return FAIL;
+ }
+
+ *def = getdigits(&p);
+ *argt |= (ZEROR | NOTADR);
+
+ if (p != val + vallen || vallen == 0)
+ {
+invalid_count:
+ EMSG(_("E178: Invalid default value for count"));
+ return FAIL;
+ }
+ }
+ }
+ else if (STRNICMP(attr, "count", attrlen) == 0)
+ {
+ *argt |= (COUNT | ZEROR | NOTADR);
+
+ if (val != NULL)
+ {
+ p = val;
+ if (*def >= 0)
+ goto two_count;
+
+ *def = getdigits(&p);
+
+ if (p != val + vallen)
+ goto invalid_count;
+ }
+
+ if (*def < 0)
+ *def = 0;
+ }
+ else if (STRNICMP(attr, "complete", attrlen) == 0)
+ {
+ char_u *arg = NULL;
+ size_t arglen = 0;
+
+ if (val == NULL)
+ {
+ EMSG(_("E179: argument required for complete"));
+ return FAIL;
+ }
+ /* Look for any argument part - which is the part after any ',' */
+ for (i = 0; i < (int)vallen; ++i)
+ {
+ if (val[i] == ',')
+ {
+ arg = &val[i + 1];
+ arglen = vallen - i - 1;
+ vallen = i;
+ break;
+ }
+ }
+
+ for (i = 0; command_complete[i].expand != 0; ++i)
+ {
+ if (STRLEN(command_complete[i].name) == vallen
+ && STRNCMP(val, command_complete[i].name, vallen) == 0)
+ {
+ *compl = command_complete[i].expand;
+ if (command_complete[i].expand == EXPAND_BUFFERS)
+ *argt |= BUFNAME;
+ else if (command_complete[i].expand == EXPAND_DIRECTORIES
+ || command_complete[i].expand == EXPAND_FILES)
+ *argt |= XFILE;
+ break;
+ }
+ }
+
+ if (command_complete[i].expand == 0)
+ {
+ EMSG2(_("E180: Invalid complete value: %s"), val);
+ return FAIL;
+ }
+#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ if (*compl != EXPAND_USER_DEFINED && arg != NULL)
+#else
+ if (arg != NULL)
+#endif
+ {
+ EMSG(_("E468: Completion argument only allowed for custom completion"));
+ return FAIL;
+ }
+#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ if (*compl == EXPAND_USER_DEFINED && arg == NULL)
+ {
+ EMSG(_("E467: Custom completion requires a function argument"));
+ return FAIL;
+ }
+ if (arg != NULL)
+ *compl_arg = vim_strnsave(arg, (int)arglen);
+#endif
+ }
+ else
+ {
+ char_u ch = attr[len];
+ attr[len] = '\0';
+ EMSG2(_("E181: Invalid attribute: %s"), attr);
+ attr[len] = ch;
+ return FAIL;
+ }
+ }
+
+ return OK;
+}
+
+ static void
+ex_command(eap)
+ exarg_T *eap;
+{
+ char_u *name;
+ char_u *end;
+ char_u *p;
+ long argt = 0;
+ long def = -1;
+ int flags = 0;
+ int compl = EXPAND_NOTHING;
+ char_u *compl_arg = NULL;
+ int has_attr = (eap->arg[0] == '-');
+
+ p = eap->arg;
+
+ /* Check for attributes */
+ while (*p == '-')
+ {
+ ++p;
+ end = skiptowhite(p);
+ if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg)
+ == FAIL)
+ return;
+ p = skipwhite(end);
+ }
+
+ /* Get the name (if any) and skip to the following argument */
+ name = p;
+ if (ASCII_ISALPHA(*p))
+ while (ASCII_ISALNUM(*p))
+ ++p;
+ if (!ends_excmd(*p) && !vim_iswhite(*p))
+ {
+ EMSG(_("E182: Invalid command name"));
+ return;
+ }
+ end = p;
+
+ /* If there is nothing after the name, and no attributes were specified,
+ * we are listing commands
+ */
+ p = skipwhite(end);
+ if (!has_attr && ends_excmd(*p))
+ {
+ uc_list(name, end - name);
+ }
+ else if (!ASCII_ISUPPER(*name))
+ {
+ EMSG(_("E183: User defined commands must start with an uppercase letter"));
+ return;
+ }
+ else
+ uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
+ eap->forceit);
+}
+
+/*
+ * ":comclear"
+ */
+/*ARGSUSED*/
+/*
+ * Clear all user commands, global and for current buffer.
+ */
+ static void
+ex_comclear(eap)
+ exarg_T *eap;
+{
+ uc_clear(&ucmds);
+ uc_clear(&curbuf->b_ucmds);
+}
+
+/*
+ * Clear all user commands for "gap".
+ */
+ void
+uc_clear(gap)
+ garray_T *gap;
+{
+ int i;
+ ucmd_T *cmd;
+
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ cmd = USER_CMD_GA(gap, i);
+ vim_free(cmd->uc_name);
+ vim_free(cmd->uc_rep);
+# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ vim_free(cmd->uc_compl_arg);
+# endif
+ }
+ ga_clear(gap);
+}
+
+ static void
+ex_delcommand(eap)
+ exarg_T *eap;
+{
+ int i = 0;
+ ucmd_T *cmd = NULL;
+ int cmp = -1;
+ garray_T *gap;
+
+ gap = &curbuf->b_ucmds;
+ for (;;)
+ {
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ cmd = USER_CMD_GA(gap, i);
+ cmp = STRCMP(eap->arg, cmd->uc_name);
+ if (cmp <= 0)
+ break;
+ }
+ if (gap == &ucmds || cmp == 0)
+ break;
+ gap = &ucmds;
+ }
+
+ if (cmp != 0)
+ {
+ EMSG2(_("E184: No such user-defined command: %s"), eap->arg);
+ return;
+ }
+
+ vim_free(cmd->uc_name);
+ vim_free(cmd->uc_rep);
+# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ vim_free(cmd->uc_compl_arg);
+# endif
+
+ --gap->ga_len;
+ ++gap->ga_room;
+
+ if (i < gap->ga_len)
+ mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T));
+}
+
+ static char_u *
+uc_split_args(arg, lenp)
+ char_u *arg;
+ size_t *lenp;
+{
+ char_u *buf;
+ char_u *p;
+ char_u *q;
+ int len;
+
+ /* Precalculate length */
+ p = arg;
+ len = 2; /* Initial and final quotes */
+
+ while (*p)
+ {
+ if (p[0] == '\\' && vim_iswhite(p[1]))
+ {
+ len += 1;
+ p += 2;
+ }
+ else if (*p == '\\' || *p == '"')
+ {
+ len += 2;
+ p += 1;
+ }
+ else if (vim_iswhite(*p))
+ {
+ p = skipwhite(p);
+ if (*p == NUL)
+ break;
+ len += 3; /* "," */
+ }
+ else
+ {
+ ++len;
+ ++p;
+ }
+ }
+
+ buf = alloc(len + 1);
+ if (buf == NULL)
+ {
+ *lenp = 0;
+ return buf;
+ }
+
+ p = arg;
+ q = buf;
+ *q++ = '"';
+ while (*p)
+ {
+ if (p[0] == '\\' && vim_iswhite(p[1]))
+ {
+ *q++ = p[1];
+ p += 2;
+ }
+ else if (*p == '\\' || *p == '"')
+ {
+ *q++ = '\\';
+ *q++ = *p++;
+ }
+ else if (vim_iswhite(*p))
+ {
+ p = skipwhite(p);
+ if (*p == NUL)
+ break;
+ *q++ = '"';
+ *q++ = ',';
+ *q++ = '"';
+ }
+ else
+ {
+ *q++ = *p++;
+ }
+ }
+ *q++ = '"';
+ *q = 0;
+
+ *lenp = len;
+ return buf;
+}
+
+/*
+ * Check for a <> code in a user command.
+ * "code" points to the '<'. "len" the length of the <> (inclusive).
+ * "buf" is where the result is to be added.
+ * "split_buf" points to a buffer used for splitting, caller should free it.
+ * "split_len" is the length of what "split_buf" contains.
+ * Returns the length of the replacement, which has been added to "buf".
+ * Returns -1 if there was no match, and only the "<" has been copied.
+ */
+ static size_t
+uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
+ char_u *code;
+ size_t len;
+ char_u *buf;
+ ucmd_T *cmd; /* the user command we're expanding */
+ exarg_T *eap; /* ex arguments */
+ char_u **split_buf;
+ size_t *split_len;
+{
+ size_t result = 0;
+ char_u *p = code + 1;
+ size_t l = len - 2;
+ int quote = 0;
+ enum { ct_ARGS, ct_BANG, ct_COUNT, ct_LINE1, ct_LINE2, ct_REGISTER,
+ ct_LT, ct_NONE } type = ct_NONE;
+
+ if ((vim_strchr((char_u *)"qQfF", *p) != NULL) && p[1] == '-')
+ {
+ quote = (*p == 'q' || *p == 'Q') ? 1 : 2;
+ p += 2;
+ l -= 2;
+ }
+
+ if (l < 1)
+ type = ct_NONE;
+ else if (STRNICMP(p, "args", l) == 0)
+ type = ct_ARGS;
+ else if (STRNICMP(p, "bang", l) == 0)
+ type = ct_BANG;
+ else if (STRNICMP(p, "count", l) == 0)
+ type = ct_COUNT;
+ else if (STRNICMP(p, "line1", l) == 0)
+ type = ct_LINE1;
+ else if (STRNICMP(p, "line2", l) == 0)
+ type = ct_LINE2;
+ else if (STRNICMP(p, "lt", l) == 0)
+ type = ct_LT;
+ else if (STRNICMP(p, "register", l) == 0)
+ type = ct_REGISTER;
+
+ switch (type)
+ {
+ case ct_ARGS:
+ /* Simple case first */
+ if (*eap->arg == NUL)
+ {
+ if (quote == 1)
+ {
+ result = 2;
+ if (buf != NULL)
+ STRCPY(buf, "''");
+ }
+ else
+ result = 0;
+ break;
+ }
+
+ /* When specified there is a single argument don't split it.
+ * Works for ":Cmd %" when % is "a b c". */
+ if ((eap->argt & NOSPC) && quote == 2)
+ quote = 1;
+
+ switch (quote)
+ {
+ case 0: /* No quoting, no splitting */
+ result = STRLEN(eap->arg);
+ if (buf != NULL)
+ STRCPY(buf, eap->arg);
+ break;
+ case 1: /* Quote, but don't split */
+ result = STRLEN(eap->arg) + 2;
+ for (p = eap->arg; *p; ++p)
+ {
+ if (*p == '\\' || *p == '"')
+ ++result;
+ }
+
+ if (buf != NULL)
+ {
+ *buf++ = '"';
+ for (p = eap->arg; *p; ++p)
+ {
+ if (*p == '\\' || *p == '"')
+ *buf++ = '\\';
+ *buf++ = *p;
+ }
+ *buf = '"';
+ }
+
+ break;
+ case 2: /* Quote and split */
+ /* This is hard, so only do it once, and cache the result */
+ if (*split_buf == NULL)
+ *split_buf = uc_split_args(eap->arg, split_len);
+
+ result = *split_len;
+ if (buf != NULL && result != 0)
+ STRCPY(buf, *split_buf);
+
+ break;
+ }
+ break;
+
+ case ct_BANG:
+ result = eap->forceit ? 1 : 0;
+ if (quote)
+ result += 2;
+ if (buf != NULL)
+ {
+ if (quote)
+ *buf++ = '"';
+ if (eap->forceit)
+ *buf++ = '!';
+ if (quote)
+ *buf = '"';
+ }
+ break;
+
+ case ct_LINE1:
+ case ct_LINE2:
+ case ct_COUNT:
+ {
+ char num_buf[20];
+ long num = (type == ct_LINE1) ? eap->line1 :
+ (type == ct_LINE2) ? eap->line2 :
+ (eap->addr_count > 0) ? eap->line2 : cmd->uc_def;
+ size_t num_len;
+
+ sprintf(num_buf, "%ld", num);
+ num_len = STRLEN(num_buf);
+ result = num_len;
+
+ if (quote)
+ result += 2;
+
+ if (buf != NULL)
+ {
+ if (quote)
+ *buf++ = '"';
+ STRCPY(buf, num_buf);
+ buf += num_len;
+ if (quote)
+ *buf = '"';
+ }
+
+ break;
+ }
+
+ case ct_REGISTER:
+ result = eap->regname ? 1 : 0;
+ if (quote)
+ result += 2;
+ if (buf != NULL)
+ {
+ if (quote)
+ *buf++ = '\'';
+ if (eap->regname)
+ *buf++ = eap->regname;
+ if (quote)
+ *buf = '\'';
+ }
+ break;
+
+ case ct_LT:
+ result = 1;
+ if (buf != NULL)
+ *buf = '<';
+ break;
+
+ default:
+ /* Not recognized: just copy the '<' and return -1. */
+ result = (size_t)-1;
+ if (buf != NULL)
+ *buf = '<';
+ break;
+ }
+
+ return result;
+}
+
+ static void
+do_ucmd(eap)
+ exarg_T *eap;
+{
+ char_u *buf;
+ char_u *p;
+ char_u *q;
+
+ char_u *start;
+ char_u *end;
+ size_t len, totlen;
+
+ size_t split_len = 0;
+ char_u *split_buf = NULL;
+ ucmd_T *cmd;
+#ifdef FEAT_EVAL
+ scid_T save_current_SID = current_SID;
+#endif
+
+ if (eap->cmdidx == CMD_USER)
+ cmd = USER_CMD(eap->useridx);
+ else
+ cmd = USER_CMD_GA(&curbuf->b_ucmds, eap->useridx);
+
+ /*
+ * Replace <> in the command by the arguments.
+ */
+ buf = NULL;
+ for (;;)
+ {
+ p = cmd->uc_rep;
+ q = buf;
+ totlen = 0;
+ while ((start = vim_strchr(p, '<')) != NULL
+ && (end = vim_strchr(start + 1, '>')) != NULL)
+ {
+ /* Include the '>' */
+ ++end;
+
+ /* Take everything up to the '<' */
+ len = start - p;
+ if (buf == NULL)
+ totlen += len;
+ else
+ {
+ mch_memmove(q, p, len);
+ q += len;
+ }
+
+ len = uc_check_code(start, end - start, q, cmd, eap,
+ &split_buf, &split_len);
+ if (len == (size_t)-1)
+ {
+ /* no match, continue after '<' */
+ p = start + 1;
+ len = 1;
+ }
+ else
+ p = end;
+ if (buf == NULL)
+ totlen += len;
+ else
+ q += len;
+ }
+ if (buf != NULL) /* second time here, finished */
+ {
+ STRCPY(q, p);
+ break;
+ }
+
+ totlen += STRLEN(p); /* Add on the trailing characters */
+ buf = alloc((unsigned)(totlen + 1));
+ if (buf == NULL)
+ {
+ vim_free(split_buf);
+ return;
+ }
+ }
+
+#ifdef FEAT_EVAL
+ current_SID = cmd->uc_scriptID;
+#endif
+ (void)do_cmdline(buf, eap->getline, eap->cookie,
+ DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
+#ifdef FEAT_EVAL
+ current_SID = save_current_SID;
+#endif
+ vim_free(buf);
+ vim_free(split_buf);
+}
+
+# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+ static char_u *
+get_user_command_name(idx)
+ int idx;
+{
+ return get_user_commands(NULL, idx - (int)CMD_SIZE);
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of user command names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_user_commands(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx < curbuf->b_ucmds.ga_len)
+ return USER_CMD_GA(&curbuf->b_ucmds, idx)->uc_name;
+ idx -= curbuf->b_ucmds.ga_len;
+ if (idx < ucmds.ga_len)
+ return USER_CMD(idx)->uc_name;
+ return NULL;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of user command
+ * attributes.
+ */
+/*ARGSUSED*/
+ char_u *
+get_user_cmd_flags(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static char *user_cmd_flags[] =
+ {"bang", "bar", "buffer", "complete", "count",
+ "nargs", "range", "register"};
+
+ if (idx >= sizeof(user_cmd_flags) / sizeof(user_cmd_flags[0]))
+ return NULL;
+ return (char_u *)user_cmd_flags[idx];
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of values for -nargs.
+ */
+/*ARGSUSED*/
+ char_u *
+get_user_cmd_nargs(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static char *user_cmd_nargs[] = {"0", "1", "*", "?", "+"};
+
+ if (idx >= sizeof(user_cmd_nargs) / sizeof(user_cmd_nargs[0]))
+ return NULL;
+ return (char_u *)user_cmd_nargs[idx];
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of values for -complete.
+ */
+/*ARGSUSED*/
+ char_u *
+get_user_cmd_complete(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ return (char_u *)command_complete[idx].name;
+}
+# endif /* FEAT_CMDL_COMPL */
+
+#endif /* FEAT_USR_CMDS */
+
+ static void
+ex_colorscheme(eap)
+ exarg_T *eap;
+{
+ if (load_colors(eap->arg) == FAIL)
+ EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
+}
+
+ static void
+ex_highlight(eap)
+ exarg_T *eap;
+{
+ if (*eap->arg == NUL && eap->cmd[2] == '!')
+ MSG(_("Greetings, Vim user!"));
+ do_highlight(eap->arg, eap->forceit, FALSE);
+}
+
+
+/*
+ * Call this function if we thought we were going to exit, but we won't
+ * (because of an error). May need to restore the terminal mode.
+ */
+ void
+not_exiting()
+{
+ exiting = FALSE;
+ settmode(TMODE_RAW);
+}
+
+/*
+ * ":quit": quit current window, quit Vim if closed the last window.
+ */
+ static void
+ex_quit(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ cmdwin_result = Ctrl_C;
+ return;
+ }
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ netbeansForcedQuit = eap->forceit;
+#endif
+
+ /*
+ * If there are more files or windows we won't exit.
+ */
+ if (check_more(FALSE, eap->forceit) == OK && only_one_window())
+ exiting = TRUE;
+ if ((!P_HID(curbuf)
+ && check_changed(curbuf, p_awa, FALSE, eap->forceit, FALSE))
+ || check_more(TRUE, eap->forceit) == FAIL
+ || (only_one_window() && check_changed_any(eap->forceit)))
+ {
+ not_exiting();
+ }
+ else
+ {
+#ifdef FEAT_WINDOWS
+ if (only_one_window()) /* quit last window */
+#endif
+ getout(0);
+#ifdef FEAT_WINDOWS
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+ /* close window; may free buffer */
+ win_close(curwin, !P_HID(curwin->w_buffer) || eap->forceit);
+#endif
+ }
+}
+
+/*
+ * ":cquit".
+ */
+/*ARGSUSED*/
+ static void
+ex_cquit(eap)
+ exarg_T *eap;
+{
+ getout(1); /* this does not always pass on the exit code to the Manx
+ compiler. why? */
+}
+
+/*
+ * ":qall": try to quit all windows
+ */
+ static void
+ex_quit_all(eap)
+ exarg_T *eap;
+{
+# ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ if (eap->forceit)
+ cmdwin_result = K_XF1; /* ex_window() takes care of this */
+ else
+ cmdwin_result = K_XF2;
+ return;
+ }
+# endif
+ exiting = TRUE;
+ if (eap->forceit || !check_changed_any(FALSE))
+ getout(0);
+ not_exiting();
+}
+
+#ifdef FEAT_WINDOWS
+/*
+ * ":close": close current window, unless it is the last one
+ */
+ static void
+ex_close(eap)
+ exarg_T *eap;
+{
+# ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ cmdwin_result = K_IGNORE;
+ else
+# endif
+ ex_win_close(eap, curwin);
+}
+
+ static void
+ex_win_close(eap, win)
+ exarg_T *eap;
+ win_T *win;
+{
+ int need_hide;
+ buf_T *buf = win->w_buffer;
+
+ need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
+ if (need_hide && !P_HID(buf) && !eap->forceit)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if ((p_confirm || cmdmod.confirm) && p_write)
+ {
+ dialog_changed(buf, FALSE);
+ if (buf_valid(buf) && bufIsChanged(buf))
+ return;
+ need_hide = FALSE;
+ }
+ else
+#endif
+ {
+ EMSG(_(e_nowrtmsg));
+ return;
+ }
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ /* free buffer when not hiding it or when it's a scratch buffer */
+ win_close(win, !need_hide && !P_HID(buf));
+}
+
+#ifdef FEAT_QUICKFIX
+/*
+ * ":pclose": Close any preview window.
+ */
+ static void
+ex_pclose(eap)
+ exarg_T *eap;
+{
+ win_T *win;
+
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (win->w_p_pvw)
+ {
+ ex_win_close(eap, win);
+ break;
+ }
+}
+#endif
+
+/*
+ * ":only".
+ */
+ static void
+ex_only(eap)
+ exarg_T *eap;
+{
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+ close_others(TRUE, eap->forceit);
+}
+
+/*
+ * ":all" and ":sall".
+ */
+ static void
+ex_all(eap)
+ exarg_T *eap;
+{
+ if (eap->addr_count == 0)
+ eap->line2 = 9999;
+ do_arg_all((int)eap->line2, eap->forceit);
+}
+#endif /* FEAT_WINDOWS */
+
+ static void
+ex_hide(eap)
+ exarg_T *eap;
+{
+ if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
+ eap->errmsg = e_invarg;
+ else
+ {
+ /* ":hide" or ":hide | cmd": hide current window */
+ eap->nextcmd = check_nextcmd(eap->arg);
+#ifdef FEAT_WINDOWS
+ if (!eap->skip)
+ {
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+ win_close(curwin, FALSE); /* don't free buffer */
+ }
+#endif
+ }
+}
+
+/*
+ * ":stop" and ":suspend": Suspend Vim.
+ */
+ static void
+ex_stop(eap)
+ exarg_T *eap;
+{
+ /*
+ * Disallow suspending for "rvim".
+ */
+ if (!check_restricted()
+#ifdef WIN3264
+ /*
+ * Check if external commands are allowed now.
+ */
+ && can_end_termcap_mode(TRUE)
+#endif
+ )
+ {
+ if (!eap->forceit)
+ autowrite_all();
+ windgoto((int)Rows - 1, 0);
+ out_char('\n');
+ out_flush();
+ stoptermcap();
+ out_flush(); /* needed for SUN to restore xterm buffer */
+#ifdef FEAT_TITLE
+ mch_restore_title(3); /* restore window titles */
+#endif
+ ui_suspend(); /* call machine specific function */
+#ifdef FEAT_TITLE
+ maketitle();
+ resettitle(); /* force updating the title */
+#endif
+ starttermcap();
+ scroll_start(); /* scroll screen before redrawing */
+ redraw_later_clear();
+ shell_resized(); /* may have resized window */
+ }
+}
+
+/*
+ * ":exit", ":xit" and ":wq": Write file and exit Vim.
+ */
+ static void
+ex_exit(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ cmdwin_result = Ctrl_C;
+ return;
+ }
+#endif
+
+ /*
+ * if more files or windows we won't exit
+ */
+ if (check_more(FALSE, eap->forceit) == OK && only_one_window())
+ exiting = TRUE;
+ if ( ((eap->cmdidx == CMD_wq
+ || curbufIsChanged())
+ && do_write(eap) == FAIL)
+ || check_more(TRUE, eap->forceit) == FAIL
+ || (only_one_window() && check_changed_any(eap->forceit)))
+ {
+ not_exiting();
+ }
+ else
+ {
+#ifdef FEAT_WINDOWS
+ if (only_one_window()) /* quit last window, exit Vim */
+#endif
+ getout(0);
+#ifdef FEAT_WINDOWS
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+ /* quit current window, may free buffer */
+ win_close(curwin, !P_HID(curwin->w_buffer));
+#endif
+ }
+}
+
+/*
+ * ":print", ":list", ":number".
+ */
+ static void
+ex_print(eap)
+ exarg_T *eap;
+{
+ int save_list = 0; /* init for GCC */
+
+ if (eap->cmdidx == CMD_list)
+ {
+ save_list = curwin->w_p_list;
+ curwin->w_p_list = 1;
+ }
+
+ for ( ;!got_int; ui_breakcheck())
+ {
+ print_line(eap->line1,
+ (eap->cmdidx == CMD_number || eap->cmdidx == CMD_pound));
+ if (++eap->line1 > eap->line2)
+ break;
+ out_flush(); /* show one line at a time */
+ }
+ setpcmark();
+ /* put cursor at last line */
+ curwin->w_cursor.lnum = eap->line2;
+ beginline(BL_SOL | BL_FIX);
+
+ ex_no_reprint = TRUE;
+
+ if (eap->cmdidx == CMD_list)
+ curwin->w_p_list = save_list;
+}
+
+#ifdef FEAT_BYTEOFF
+ static void
+ex_goto(eap)
+ exarg_T *eap;
+{
+ goto_byte(eap->line2);
+}
+#endif
+
+/*
+ * ":shell".
+ */
+/*ARGSUSED*/
+ static void
+ex_shell(eap)
+ exarg_T *eap;
+{
+ do_shell(NULL, 0);
+}
+
+#if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \
+ || (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \
+ || defined(PROTO)
+
+/*
+ * Handle a file drop. The code is here because a drop is *nearly* like an
+ * :args command, but not quite (we have a list of exact filenames, so we
+ * don't want to (a) parse a command line, or (b) expand wildcards. So the
+ * code is very similar to :args and hence needs access to a lot of the static
+ * functions in this file.
+ *
+ * The list should be allocated using alloc(), as should each item in the
+ * list. This function takes over responsibility for freeing the list.
+ *
+ * XXX The list is made into the arggument list. This is freed using
+ * FreeWild(), which does a series of vim_free() calls, unless the two defines
+ * __EMX__ and __ALWAYS_HAS_TRAILING_NUL_POINTER are set. In this case, a
+ * routine _fnexplodefree() is used. This may cause problems, but as the drop
+ * file functionality is (currently) not in EMX this is not presently a
+ * problem.
+ */
+ void
+handle_drop(filec, filev, split)
+ int filec; /* the number of files dropped */
+ char_u **filev; /* the list of files dropped */
+ int split; /* force splitting the window */
+{
+ exarg_T ea;
+ int save_msg_scroll = msg_scroll;
+
+# ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ return;
+# endif
+
+ /* Check whether the current buffer is changed. If so, we will need
+ * to split the current window or data could be lost.
+ * We don't need to check if the 'hidden' option is set, as in this
+ * case the buffer won't be lost.
+ */
+ if (!P_HID(curbuf) && !split)
+ {
+ ++emsg_off;
+ split = check_changed(curbuf, TRUE, FALSE, FALSE, FALSE);
+ --emsg_off;
+ }
+ if (split)
+ {
+# ifdef FEAT_WINDOWS
+ if (win_split(0, 0) == FAIL)
+ return;
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+
+ /* When splitting the window, create a new alist. Otherwise the
+ * existing one is overwritten. */
+ alist_unlink(curwin->w_alist);
+ alist_new();
+# else
+ return; /* can't split, always fail */
+# endif
+ }
+
+ /*
+ * Set up the new argument list.
+ */
+ alist_set(ALIST(curwin), filec, filev, FALSE);
+
+ /*
+ * Move to the first file.
+ */
+ /* Fake up a minimal "next" command for do_argfile() */
+ vim_memset(&ea, 0, sizeof(ea));
+ ea.cmd = (char_u *)"next";
+ do_argfile(&ea, 0);
+
+ /* do_ecmd() may set need_start_insertmode, but since we never left Insert
+ * mode that is not needed here. */
+ need_start_insertmode = FALSE;
+
+ /* Restore msg_scroll, otherwise a following command may cause scrolling
+ * unexpectedly. The screen will be redrawn by the caller, thus
+ * msg_scroll being set by displaying a message is irrelevant. */
+ msg_scroll = save_msg_scroll;
+}
+#endif
+
+static void alist_clear __ARGS((alist_T *al));
+/*
+ * Clear an argument list: free all file names and reset it to zero entries.
+ */
+ static void
+alist_clear(al)
+ alist_T *al;
+{
+ while (--al->al_ga.ga_len >= 0)
+ vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname);
+ ga_clear(&al->al_ga);
+}
+
+/*
+ * Init an argument list.
+ */
+ void
+alist_init(al)
+ alist_T *al;
+{
+ ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+
+/*
+ * Remove a reference from an argument list.
+ * Ignored when the argument list is the global one.
+ * If the argument list is no longer used by any window, free it.
+ */
+ void
+alist_unlink(al)
+ alist_T *al;
+{
+ if (al != &global_alist && --al->al_refcount <= 0)
+ {
+ alist_clear(al);
+ vim_free(al);
+ }
+}
+
+# if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
+/*
+ * Create a new argument list and use it for the current window.
+ */
+ void
+alist_new()
+{
+ curwin->w_alist = (alist_T *)alloc((unsigned)sizeof(alist_T));
+ if (curwin->w_alist == NULL)
+ {
+ curwin->w_alist = &global_alist;
+ ++global_alist.al_refcount;
+ }
+ else
+ {
+ curwin->w_alist->al_refcount = 1;
+ alist_init(curwin->w_alist);
+ }
+}
+# endif
+#endif
+
+#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE) || defined(PROTO)
+/*
+ * Expand the file names in the global argument list.
+ */
+ void
+alist_expand()
+{
+ char_u **old_arg_files;
+ char_u **new_arg_files;
+ int new_arg_file_count;
+ char_u *save_p_su = p_su;
+ int i;
+
+ /* Don't use 'suffixes' here. This should work like the shell did the
+ * expansion. Also, the vimrc file isn't read yet, thus the user
+ * can't set the options. */
+ p_su = empty_option;
+ old_arg_files = (char_u **)alloc((unsigned)(sizeof(char_u *) * GARGCOUNT));
+ if (old_arg_files != NULL)
+ {
+ for (i = 0; i < GARGCOUNT; ++i)
+ old_arg_files[i] = GARGLIST[i].ae_fname;
+ if (expand_wildcards(GARGCOUNT, old_arg_files,
+ &new_arg_file_count, &new_arg_files,
+ EW_FILE|EW_NOTFOUND|EW_ADDSLASH) == OK
+ && new_arg_file_count > 0)
+ {
+ alist_set(&global_alist, new_arg_file_count, new_arg_files, TRUE);
+ }
+ vim_free(old_arg_files);
+ }
+ p_su = save_p_su;
+}
+#endif
+
+/*
+ * Set the argument list for the current window.
+ * Takes over the allocated files[] and the allocated fnames in it.
+ */
+ void
+alist_set(al, count, files, use_curbuf)
+ alist_T *al;
+ int count;
+ char_u **files;
+ int use_curbuf;
+{
+ int i;
+
+ alist_clear(al);
+ if (ga_grow(&al->al_ga, count) == OK)
+ {
+ for (i = 0; i < count; ++i)
+ alist_add(al, files[i], use_curbuf ? 2 : 1);
+ vim_free(files);
+ }
+ else
+ FreeWild(count, files);
+#ifdef FEAT_WINDOWS
+ if (al == &global_alist)
+#endif
+ arg_had_last = FALSE;
+}
+
+/*
+ * Add file "fname" to argument list "al".
+ * "fname" must have been allocated and "al" must have been checked for room.
+ */
+ void
+alist_add(al, fname, set_fnum)
+ alist_T *al;
+ char_u *fname;
+ int set_fnum; /* 1: set buffer number; 2: re-use curbuf */
+{
+ if (fname == NULL) /* don't add NULL file names */
+ return;
+#ifdef BACKSLASH_IN_FILENAME
+ slash_adjust(fname);
+#endif
+ AARGLIST(al)[al->al_ga.ga_len].ae_fname = fname;
+ if (set_fnum > 0)
+ AARGLIST(al)[al->al_ga.ga_len].ae_fnum =
+ buflist_add(fname, BLN_LISTED | (set_fnum == 2 ? BLN_CURBUF : 0));
+ ++al->al_ga.ga_len;
+ --al->al_ga.ga_room;
+}
+
+#if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
+/*
+ * Adjust slashes in file names. Called after 'shellslash' was set.
+ */
+ void
+alist_slash_adjust()
+{
+ int i;
+# ifdef FEAT_WINDOWS
+ win_T *wp;
+# endif
+
+ for (i = 0; i < GARGCOUNT; ++i)
+ if (GARGLIST[i].ae_fname != NULL)
+ slash_adjust(GARGLIST[i].ae_fname);
+# ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_alist != &global_alist)
+ for (i = 0; i < WARGCOUNT(wp); ++i)
+ if (WARGLIST(wp)[i].ae_fname != NULL)
+ slash_adjust(WARGLIST(wp)[i].ae_fname);
+# endif
+}
+#endif
+
+/*
+ * ":preserve".
+ */
+/*ARGSUSED*/
+ static void
+ex_preserve(eap)
+ exarg_T *eap;
+{
+ ml_preserve(curbuf, TRUE);
+}
+
+/*
+ * ":recover".
+ */
+ static void
+ex_recover(eap)
+ exarg_T *eap;
+{
+ /* Set recoverymode right away to avoid the ATTENTION prompt. */
+ recoverymode = TRUE;
+ if (!check_changed(curbuf, p_awa, TRUE, eap->forceit, FALSE)
+ && (*eap->arg == NUL
+ || setfname(curbuf, eap->arg, NULL, TRUE) == OK))
+ ml_recover();
+ recoverymode = FALSE;
+}
+
+/*
+ * Command modifier used in a wrong way.
+ */
+ static void
+ex_wrongmodifier(eap)
+ exarg_T *eap;
+{
+ eap->errmsg = e_invcmd;
+}
+
+#ifdef FEAT_WINDOWS
+/*
+ * :sview [+command] file split window with new file, read-only
+ * :split [[+command] file] split window with current or new file
+ * :vsplit [[+command] file] split window vertically with current or new file
+ * :new [[+command] file] split window with no or new file
+ * :vnew [[+command] file] split vertically window with no or new file
+ * :sfind [+command] file split window with file in 'path'
+ */
+ void
+ex_splitview(eap)
+ exarg_T *eap;
+{
+ win_T *old_curwin;
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
+ char_u *fname = NULL;
+#endif
+#ifdef FEAT_BROWSE
+ int browse_flag = cmdmod.browse;
+#endif
+
+#ifndef FEAT_VERTSPLIT
+ if (eap->cmdidx == CMD_vsplit || eap->cmdidx == CMD_vnew)
+ {
+ ex_ni(eap);
+ return;
+ }
+#endif
+
+ old_curwin = curwin;
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+#ifdef FEAT_QUICKFIX
+ /* A ":split" in the quickfix window works like ":new". Don't want two
+ * quickfix windows. */
+ if (bt_quickfix(curbuf))
+ {
+ if (eap->cmdidx == CMD_split)
+ eap->cmdidx = CMD_new;
+# ifdef FEAT_VERTSPLIT
+ if (eap->cmdidx == CMD_vsplit)
+ eap->cmdidx = CMD_vnew;
+# endif
+ }
+#endif
+
+#ifdef FEAT_SEARCHPATH
+ if (eap->cmdidx == CMD_sfind)
+ {
+ fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
+ FNAME_MESS, TRUE, curbuf->b_ffname);
+ if (fname == NULL)
+ goto theend;
+ eap->arg = fname;
+ }
+# ifdef FEAT_BROWSE
+ else
+# endif
+#endif
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse
+# ifdef FEAT_VERTSPLIT
+ && eap->cmdidx != CMD_vnew
+#endif
+ && eap->cmdidx != CMD_new)
+ {
+ fname = do_browse(FALSE, (char_u *)_("Edit File in new window"),
+ eap->arg, NULL, NULL, NULL, curbuf);
+ if (fname == NULL)
+ goto theend;
+ eap->arg = fname;
+ }
+ cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
+#endif
+
+ if (win_split(eap->addr_count > 0 ? (int)eap->line2 : 0,
+ *eap->cmd == 'v' ? WSP_VERT : 0) != FAIL)
+ {
+#ifdef FEAT_SCROLLBIND
+ /* Reset 'scrollbind' when editing another file, but keep it when
+ * doing ":split" without arguments. */
+ if (*eap->arg != NUL
+#ifdef FEAT_BROWSE
+ || cmdmod.browse
+#endif
+ )
+ curwin->w_p_scb = FALSE;
+ else
+ do_check_scrollbind(FALSE);
+#endif
+ do_exedit(eap, old_curwin);
+ }
+
+#ifdef FEAT_BROWSE
+ cmdmod.browse = browse_flag;
+#endif
+
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
+theend:
+ vim_free(fname);
+#endif
+}
+#endif
+
+/*
+ * ":mode": Set screen mode.
+ * If no argument given, just get the screen size and redraw.
+ */
+ static void
+ex_mode(eap)
+ exarg_T *eap;
+{
+ if (*eap->arg == NUL)
+ shell_resized();
+ else
+ mch_screenmode(eap->arg);
+}
+
+#ifdef FEAT_WINDOWS
+/*
+ * ":resize".
+ * set, increment or decrement current window height
+ */
+ static void
+ex_resize(eap)
+ exarg_T *eap;
+{
+ int n;
+ win_T *wp = curwin;
+
+ if (eap->addr_count > 0)
+ {
+ n = eap->line2;
+ for (wp = firstwin; wp->w_next != NULL && --n > 0; wp = wp->w_next)
+ ;
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ n = atol((char *)eap->arg);
+#ifdef FEAT_VERTSPLIT
+ if (cmdmod.split & WSP_VERT)
+ {
+ if (*eap->arg == '-' || *eap->arg == '+')
+ n += W_WIDTH(curwin);
+ else if (n == 0 && eap->arg[0] == NUL) /* default is very wide */
+ n = 9999;
+ win_setwidth_win((int)n, wp);
+ }
+ else
+#endif
+ {
+ if (*eap->arg == '-' || *eap->arg == '+')
+ n += curwin->w_height;
+ else if (n == 0 && eap->arg[0] == NUL) /* default is very wide */
+ n = 9999;
+ win_setheight_win((int)n, wp);
+ }
+}
+#endif
+
+/*
+ * ":find [+command] <file>" command.
+ */
+ static void
+ex_find(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_SEARCHPATH
+ char_u *fname;
+ int count;
+
+ fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg), FNAME_MESS,
+ TRUE, curbuf->b_ffname);
+ if (eap->addr_count > 0)
+ {
+ /* Repeat finding the file "count" times. This matters when it
+ * appears several times in the path. */
+ count = eap->line2;
+ while (fname != NULL && --count > 0)
+ {
+ vim_free(fname);
+ fname = find_file_in_path(NULL, 0, FNAME_MESS,
+ FALSE, curbuf->b_ffname);
+ }
+ }
+
+ if (fname != NULL)
+ {
+ eap->arg = fname;
+#endif
+ do_exedit(eap, NULL);
+#ifdef FEAT_SEARCHPATH
+ vim_free(fname);
+ }
+#endif
+}
+
+/*
+ * ":edit", ":badd".
+ */
+ static void
+ex_edit(eap)
+ exarg_T *eap;
+{
+ do_exedit(eap, NULL);
+}
+
+/*
+ * ":edit <file>" command and alikes.
+ */
+/*ARGSUSED*/
+ void
+do_exedit(eap, old_curwin)
+ exarg_T *eap;
+ win_T *old_curwin; /* curwin before doing a split or NULL */
+{
+ int n;
+#ifdef FEAT_WINDOWS
+ int need_hide;
+#endif
+
+ /*
+ * ":vi" command ends Ex mode.
+ */
+ if (exmode_active && (eap->cmdidx == CMD_visual
+ || eap->cmdidx == CMD_view))
+ {
+ exmode_active = FALSE;
+ if (*eap->arg == NUL)
+ return;
+ }
+
+ if ((eap->cmdidx == CMD_new
+#ifdef FEAT_VERTSPLIT
+ || eap->cmdidx == CMD_vnew
+#endif
+ ) && *eap->arg == NUL)
+ {
+ /* ":new" without argument: edit an new empty buffer */
+ setpcmark();
+ (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
+ ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0));
+ }
+ else if ((eap->cmdidx != CMD_split
+#ifdef FEAT_VERTSPLIT
+ && eap->cmdidx != CMD_vsplit
+#endif
+ )
+ || *eap->arg != NUL
+#ifdef FEAT_BROWSE
+ || cmdmod.browse
+#endif
+ )
+ {
+ n = readonlymode;
+ if (eap->cmdidx == CMD_view || eap->cmdidx == CMD_sview)
+ readonlymode = TRUE;
+ else if (eap->cmdidx == CMD_enew)
+ readonlymode = FALSE; /* 'readonly' doesn't make sense in an
+ empty buffer */
+ setpcmark();
+ if (do_ecmd(0, (eap->cmdidx == CMD_enew ? NULL : eap->arg),
+ NULL, eap,
+ /* ":edit" goes to first line if Vi compatible */
+ (*eap->arg == NUL && eap->do_ecmd_lnum == 0
+ && vim_strchr(p_cpo, CPO_GOTO1) != NULL)
+ ? ECMD_ONE : eap->do_ecmd_lnum,
+ (P_HID(curbuf) ? ECMD_HIDE : 0)
+ + (eap->forceit ? ECMD_FORCEIT : 0)
+#ifdef FEAT_LISTCMDS
+ + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
+#endif
+ ) == FAIL)
+ {
+ /* Editing the file failed. If the window was split, close it. */
+#ifdef FEAT_WINDOWS
+ if (old_curwin != NULL)
+ {
+ need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
+ if (!need_hide || P_HID(curbuf))
+ {
+# ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+# endif
+ win_close(curwin, !need_hide && !P_HID(curbuf));
+ }
+ }
+#endif
+ }
+ else if (readonlymode && curbuf->b_nwindows == 1)
+ {
+ /* When editing an already visited buffer, 'readonly' won't be set
+ * but the previous value is kept. With ":view" and ":sview" we
+ * want the file to be readonly, except when another window is
+ * editing the same buffer. */
+ curbuf->b_p_ro = TRUE;
+ }
+ readonlymode = n;
+ }
+ else
+ {
+ if (eap->do_ecmd_cmd != NULL)
+ do_cmdline_cmd(eap->do_ecmd_cmd);
+#ifdef FEAT_TITLE
+ n = curwin->w_arg_idx_invalid;
+#endif
+ check_arg_idx(curwin);
+#ifdef FEAT_TITLE
+ if (n != curwin->w_arg_idx_invalid)
+ maketitle();
+#endif
+ }
+
+#ifdef FEAT_WINDOWS
+ /*
+ * if ":split file" worked, set alternate file name in old window to new
+ * file
+ */
+ if (old_curwin != NULL
+ && *eap->arg != NUL
+ && curwin != old_curwin
+ && win_valid(old_curwin)
+ && old_curwin->w_buffer != curbuf)
+ old_curwin->w_alt_fnum = curbuf->b_fnum;
+#endif
+
+ ex_no_reprint = TRUE;
+}
+
+#ifndef FEAT_GUI
+/*
+ * ":gui" and ":gvim" when there is no GUI.
+ */
+ static void
+ex_nogui(eap)
+ exarg_T *eap;
+{
+ eap->errmsg = e_nogvim;
+}
+#endif
+
+#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+ static void
+ex_tearoff(eap)
+ exarg_T *eap;
+{
+ gui_make_tearoff(eap->arg);
+}
+#endif
+
+#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
+ static void
+ex_popup(eap)
+ exarg_T *eap;
+{
+ gui_make_popup(eap->arg);
+}
+#endif
+
+/*ARGSUSED*/
+ static void
+ex_swapname(eap)
+ exarg_T *eap;
+{
+ if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL)
+ MSG(_("No swap file"));
+ else
+ msg(curbuf->b_ml.ml_mfp->mf_fname);
+}
+
+/*
+ * ":syncbind" forces all 'scrollbind' windows to have the same relative
+ * offset.
+ * (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
+ */
+/*ARGSUSED*/
+ static void
+ex_syncbind(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_SCROLLBIND
+ win_T *wp;
+ long topline;
+ long y;
+ linenr_T old_linenr = curwin->w_cursor.lnum;
+
+ setpcmark();
+
+ /*
+ * determine max topline
+ */
+ if (curwin->w_p_scb)
+ {
+ topline = curwin->w_topline;
+ for (wp = firstwin; wp; wp = wp->w_next)
+ {
+ if (wp->w_p_scb && wp->w_buffer)
+ {
+ y = wp->w_buffer->b_ml.ml_line_count - p_so;
+ if (topline > y)
+ topline = y;
+ }
+ }
+ if (topline < 1)
+ topline = 1;
+ }
+ else
+ {
+ topline = 1;
+ }
+
+
+ /*
+ * set all scrollbind windows to the same topline
+ */
+ wp = curwin;
+ for (curwin = firstwin; curwin; curwin = curwin->w_next)
+ {
+ if (curwin->w_p_scb)
+ {
+ y = topline - curwin->w_topline;
+ if (y > 0)
+ scrollup(y, TRUE);
+ else
+ scrolldown(-y, TRUE);
+ curwin->w_scbind_pos = topline;
+ redraw_later(VALID);
+ cursor_correct();
+#ifdef FEAT_WINDOWS
+ curwin->w_redr_status = TRUE;
+#endif
+ }
+ }
+ curwin = wp;
+ if (curwin->w_p_scb)
+ {
+ did_syncbind = TRUE;
+ checkpcmark();
+ if (old_linenr != curwin->w_cursor.lnum)
+ {
+ char_u ctrl_o[2];
+
+ ctrl_o[0] = Ctrl_O;
+ ctrl_o[1] = 0;
+ ins_typebuf(ctrl_o, REMAP_NONE, 0, TRUE, FALSE);
+ }
+ }
+#endif
+}
+
+
+ static void
+ex_read(eap)
+ exarg_T *eap;
+{
+ int i;
+
+ if (eap->usefilter) /* :r!cmd */
+ do_bang(1, eap, FALSE, FALSE, TRUE);
+ else
+ {
+ if (u_save(eap->line2, (linenr_T)(eap->line2 + 1)) == FAIL)
+ return;
+
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ char_u *browseFile;
+
+ browseFile = do_browse(FALSE, (char_u *)_("Append File"), eap->arg,
+ NULL, NULL, NULL, curbuf);
+ if (browseFile != NULL)
+ {
+ i = readfile(browseFile, NULL,
+ eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
+ vim_free(browseFile);
+ }
+ else
+ i = OK;
+ }
+ else
+#endif
+ if (*eap->arg == NUL)
+ {
+ if (check_fname() == FAIL) /* check for no file name */
+ return;
+ i = readfile(curbuf->b_ffname, curbuf->b_fname,
+ eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
+ }
+ else
+ {
+ if (vim_strchr(p_cpo, CPO_ALTREAD) != NULL)
+ (void)setaltfname(eap->arg, eap->arg, (linenr_T)1);
+ i = readfile(eap->arg, NULL,
+ eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0);
+
+ }
+ if (i == FAIL)
+ {
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (!aborting())
+#endif
+ EMSG2(_(e_notopen), eap->arg);
+ }
+ else
+ redraw_curbuf_later(VALID);
+ }
+}
+
+/*
+ * ":cd", ":lcd", ":chdir" and ":lchdir".
+ */
+ static void
+ex_cd(eap)
+ exarg_T *eap;
+{
+ static char_u *prev_dir = NULL;
+ char_u *new_dir;
+ char_u *tofree;
+
+ new_dir = eap->arg;
+#if !defined(UNIX) && !defined(VMS)
+ /* for non-UNIX ":cd" means: print current directory */
+ if (*new_dir == NUL)
+ ex_pwd(NULL);
+ else
+#endif
+ {
+ /* ":cd -": Change to previous directory */
+ if (STRCMP(new_dir, "-") == 0)
+ {
+ if (prev_dir == NULL)
+ {
+ EMSG(_("E186: No previous directory"));
+ return;
+ }
+ new_dir = prev_dir;
+ }
+
+ /* Save current directory for next ":cd -" */
+ tofree = prev_dir;
+ if (mch_dirname(NameBuff, MAXPATHL) == OK)
+ prev_dir = vim_strsave(NameBuff);
+ else
+ prev_dir = NULL;
+
+#if defined(UNIX) || defined(VMS)
+ /* for UNIX ":cd" means: go to home directory */
+ if (*new_dir == NUL)
+ {
+ /* use NameBuff for home directory name */
+# ifdef VMS
+ char_u *p;
+
+ p = mch_getenv((char_u *)"SYS$LOGIN");
+ if (p == NULL || *p == NUL) /* empty is the same as not set */
+ NameBuff[0] = NUL;
+ else
+ STRNCPY(NameBuff, p, MAXPATHL);
+# else
+ expand_env((char_u *)"$HOME", NameBuff, MAXPATHL);
+# endif
+ new_dir = NameBuff;
+ }
+#endif
+ if (new_dir == NULL || vim_chdir(new_dir))
+ EMSG(_(e_failed));
+ else
+ {
+ vim_free(curwin->w_localdir);
+ if (eap->cmdidx == CMD_lcd || eap->cmdidx == CMD_lchdir)
+ {
+ /* If still in global directory, need to remember current
+ * directory as global directory. */
+ if (globaldir == NULL && prev_dir != NULL)
+ globaldir = vim_strsave(prev_dir);
+ /* Remember this local directory for the window. */
+ if (mch_dirname(NameBuff, MAXPATHL) == OK)
+ curwin->w_localdir = vim_strsave(NameBuff);
+ }
+ else
+ {
+ /* We are now in the global directory, no need to remember its
+ * name. */
+ vim_free(globaldir);
+ globaldir = NULL;
+ curwin->w_localdir = NULL;
+ }
+
+ shorten_fnames(TRUE);
+
+ /* Echo the new current directory if the command was typed. */
+ if (KeyTyped)
+ ex_pwd(eap);
+ }
+ vim_free(tofree);
+ }
+}
+
+/*
+ * ":pwd".
+ */
+/*ARGSUSED*/
+ static void
+ex_pwd(eap)
+ exarg_T *eap;
+{
+ if (mch_dirname(NameBuff, MAXPATHL) == OK)
+ {
+#ifdef BACKSLASH_IN_FILENAME
+ slash_adjust(NameBuff);
+#endif
+ msg(NameBuff);
+ }
+ else
+ EMSG(_("E187: Unknown"));
+}
+
+/*
+ * ":=".
+ */
+ static void
+ex_equal(eap)
+ exarg_T *eap;
+{
+ smsg((char_u *)"%ld", (long)eap->line2);
+}
+
+ static void
+ex_sleep(eap)
+ exarg_T *eap;
+{
+ int n;
+
+ if (cursor_valid())
+ {
+ n = W_WINROW(curwin) + curwin->w_wrow - msg_scrolled;
+ if (n >= 0)
+ windgoto((int)n, curwin->w_wcol);
+ }
+ do_sleep(eap->line2 * (*eap->arg == 'm' ? 1L : 1000L));
+}
+
+/*
+ * Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second.
+ */
+ void
+do_sleep(msec)
+ long msec;
+{
+ long done;
+
+ cursor_on();
+ out_flush();
+ for (done = 0; !got_int && done < msec; done += 1000L)
+ {
+ ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE);
+ ui_breakcheck();
+ }
+}
+
+ static void
+do_exmap(eap, isabbrev)
+ exarg_T *eap;
+ int isabbrev;
+{
+ int mode;
+ char_u *cmdp;
+
+ cmdp = eap->cmd;
+ mode = get_map_mode(&cmdp, eap->forceit || isabbrev);
+
+ switch (do_map((*cmdp == 'n') ? 2 : (*cmdp == 'u'),
+ eap->arg, mode, isabbrev))
+ {
+ case 1: EMSG(_(e_invarg));
+ break;
+ case 2: EMSG(isabbrev ? _(e_noabbr) : _(e_nomap));
+ break;
+ }
+}
+
+/*
+ * ":winsize" command (obsolete).
+ */
+ static void
+ex_winsize(eap)
+ exarg_T *eap;
+{
+ int w, h;
+ char_u *arg = eap->arg;
+ char_u *p;
+
+ w = getdigits(&arg);
+ arg = skipwhite(arg);
+ p = arg;
+ h = getdigits(&arg);
+ if (*p != NUL && *arg == NUL)
+ set_shellsize(w, h, TRUE);
+ else
+ EMSG(_("E465: :winsize requires two number arguments"));
+}
+
+#ifdef FEAT_WINDOWS
+ static void
+ex_wincmd(eap)
+ exarg_T *eap;
+{
+ int xchar = NUL;
+ char_u *p;
+
+ if (*eap->arg == 'g' || *eap->arg == Ctrl_G)
+ {
+ /* CTRL-W g and CTRL-W CTRL-G have an extra command character */
+ if (eap->arg[1] == NUL)
+ {
+ EMSG(_(e_invarg));
+ return;
+ }
+ xchar = eap->arg[1];
+ p = eap->arg + 2;
+ }
+ else
+ p = eap->arg + 1;
+
+ eap->nextcmd = check_nextcmd(p);
+ p = skipwhite(p);
+ if (*p != NUL && *p != '"' && eap->nextcmd == NULL)
+ EMSG(_(e_invarg));
+ else
+ {
+ /* Pass flags on for ":vertical wincmd ]". */
+ postponed_split_flags = cmdmod.split;
+ do_window(*eap->arg, eap->addr_count > 0 ? eap->line2 : 0L, xchar);
+ postponed_split_flags = 0;
+ }
+}
+#endif
+
+#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS)
+/*
+ * ":winpos".
+ */
+ static void
+ex_winpos(eap)
+ exarg_T *eap;
+{
+ int x, y;
+ char_u *arg = eap->arg;
+ char_u *p;
+
+ if (*arg == NUL)
+ {
+# ifdef FEAT_GUI
+ if (gui.in_use && gui_mch_get_winpos(&x, &y) != FAIL)
+ {
+ sprintf((char *)IObuff, _("Window position: X %d, Y %d"), x, y);
+ msg(IObuff);
+ }
+ else
+# endif
+ EMSG(_("E188: Obtaining window position not implemented for this platform"));
+ }
+ else
+ {
+ x = getdigits(&arg);
+ arg = skipwhite(arg);
+ p = arg;
+ y = getdigits(&arg);
+ if (*p == NUL || *arg != NUL)
+ {
+ EMSG(_("E466: :winpos requires two number arguments"));
+ return;
+ }
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_mch_set_winpos(x, y);
+ else if (gui.starting)
+ {
+ /* Remember the coordinates for when the window is opened. */
+ gui_win_x = x;
+ gui_win_y = y;
+ }
+# ifdef HAVE_TGETENT
+ else
+# endif
+# endif
+# ifdef HAVE_TGETENT
+ if (*T_CWP)
+ term_set_winpos(x, y);
+# endif
+ }
+}
+#endif
+
+/*
+ * Handle command that work like operators: ":delete", ":yank", ":>" and ":<".
+ */
+ static void
+ex_operators(eap)
+ exarg_T *eap;
+{
+ oparg_T oa;
+
+ clear_oparg(&oa);
+ oa.regname = eap->regname;
+ oa.start.lnum = eap->line1;
+ oa.end.lnum = eap->line2;
+ oa.line_count = eap->line2 - eap->line1 + 1;
+ oa.motion_type = MLINE;
+#ifdef FEAT_VIRTUALEDIT
+ virtual_op = FALSE;
+#endif
+ if (eap->cmdidx != CMD_yank) /* position cursor for undo */
+ {
+ setpcmark();
+ curwin->w_cursor.lnum = eap->line1;
+ beginline(BL_SOL | BL_FIX);
+ }
+
+ switch (eap->cmdidx)
+ {
+ case CMD_delete:
+ oa.op_type = OP_DELETE;
+ op_delete(&oa);
+ break;
+
+ case CMD_yank:
+ oa.op_type = OP_YANK;
+ (void)op_yank(&oa, FALSE, TRUE);
+ break;
+
+ default: /* CMD_rshift or CMD_lshift */
+ if ((eap->cmdidx == CMD_rshift)
+#ifdef FEAT_RIGHTLEFT
+ ^ curwin->w_p_rl
+#endif
+ )
+ oa.op_type = OP_RSHIFT;
+ else
+ oa.op_type = OP_LSHIFT;
+ op_shift(&oa, FALSE, eap->amount);
+ break;
+ }
+#ifdef FEAT_VIRTUALEDIT
+ virtual_op = MAYBE;
+#endif
+}
+
+/*
+ * ":put".
+ */
+ static void
+ex_put(eap)
+ exarg_T *eap;
+{
+ /* ":0put" works like ":1put!". */
+ if (eap->line2 == 0)
+ {
+ eap->line2 = 1;
+ eap->forceit = TRUE;
+ }
+ curwin->w_cursor.lnum = eap->line2;
+ do_put(eap->regname, eap->forceit ? BACKWARD : FORWARD, 1L, PUT_LINE);
+}
+
+/*
+ * Handle ":copy" and ":move".
+ */
+ static void
+ex_copymove(eap)
+ exarg_T *eap;
+{
+ long n;
+
+ n = get_address(&eap->arg, FALSE, FALSE);
+ if (eap->arg == NULL) /* error detected */
+ {
+ eap->nextcmd = NULL;
+ return;
+ }
+
+ /*
+ * move or copy lines from 'eap->line1'-'eap->line2' to below line 'n'
+ */
+ if (n == MAXLNUM || n < 0 || n > curbuf->b_ml.ml_line_count)
+ {
+ EMSG(_(e_invaddr));
+ return;
+ }
+
+ if (eap->cmdidx == CMD_move)
+ {
+ if (do_move(eap->line1, eap->line2, n) == FAIL)
+ return;
+ }
+ else
+ ex_copy(eap->line1, eap->line2, n);
+ u_clearline();
+ beginline(BL_SOL | BL_FIX);
+}
+
+/*
+ * ":smagic" and ":snomagic".
+ */
+ static void
+ex_submagic(eap)
+ exarg_T *eap;
+{
+ int magic_save = p_magic;
+
+ p_magic = (eap->cmdidx == CMD_smagic);
+ do_sub(eap);
+ p_magic = magic_save;
+}
+
+/*
+ * ":join".
+ */
+ static void
+ex_join(eap)
+ exarg_T *eap;
+{
+ curwin->w_cursor.lnum = eap->line1;
+ if (eap->line1 == eap->line2)
+ {
+ if (eap->addr_count >= 2) /* :2,2join does nothing */
+ return;
+ if (eap->line2 == curbuf->b_ml.ml_line_count)
+ {
+ beep_flush();
+ return;
+ }
+ ++eap->line2;
+ }
+ do_do_join(eap->line2 - eap->line1 + 1, !eap->forceit);
+ beginline(BL_WHITE | BL_FIX);
+}
+
+/*
+ * ":[addr]@r" or ":[addr]*r": execute register
+ */
+ static void
+ex_at(eap)
+ exarg_T *eap;
+{
+ int c;
+
+ curwin->w_cursor.lnum = eap->line2;
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+
+ /* get the register name. No name means to use the previous one */
+ c = *eap->arg;
+ if (c == NUL || (c == '*' && *eap->cmd == '*'))
+ c = '@';
+ /* put the register in mapbuf */
+ if (do_execreg(c, TRUE, vim_strchr(p_cpo, CPO_EXECBUF) != NULL) == FAIL)
+ beep_flush();
+ else
+ {
+ int save_efr = exec_from_reg;
+
+ exec_from_reg = TRUE;
+
+ /*
+ * Execute from the typeahead buffer.
+ * Originally this didn't check for the typeahead buffer to be empty,
+ * thus could read more Ex commands from stdin. It's not clear why,
+ * it is certainly unexpected.
+ */
+ while ((!stuff_empty() || typebuf.tb_len > 0) && vpeekc() == ':')
+ (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
+
+ exec_from_reg = save_efr;
+ }
+}
+
+/*
+ * ":!".
+ */
+ static void
+ex_bang(eap)
+ exarg_T *eap;
+{
+ do_bang(eap->addr_count, eap, eap->forceit, TRUE, TRUE);
+}
+
+/*
+ * ":undo".
+ */
+/*ARGSUSED*/
+ static void
+ex_undo(eap)
+ exarg_T *eap;
+{
+ u_undo(1);
+}
+
+/*
+ * ":redo".
+ */
+/*ARGSUSED*/
+ static void
+ex_redo(eap)
+ exarg_T *eap;
+{
+ u_redo(1);
+}
+
+/*
+ * ":redir": start/stop redirection.
+ */
+ static void
+ex_redir(eap)
+ exarg_T *eap;
+{
+ char *mode;
+ char_u *fname;
+
+ if (STRICMP(eap->arg, "END") == 0)
+ close_redir();
+ else
+ {
+ if (*eap->arg == '>')
+ {
+ ++eap->arg;
+ if (*eap->arg == '>')
+ {
+ ++eap->arg;
+ mode = "a";
+ }
+ else
+ mode = "w";
+ eap->arg = skipwhite(eap->arg);
+
+ close_redir();
+
+ /* Expand environment variables and "~/". */
+ fname = expand_env_save(eap->arg);
+ if (fname == NULL)
+ return;
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ char_u *browseFile;
+
+ browseFile = do_browse(TRUE, (char_u *)_("Save Redirection"),
+ fname, NULL, NULL, BROWSE_FILTER_ALL_FILES, curbuf);
+ if (browseFile == NULL)
+ return; /* operation cancelled */
+ vim_free(fname);
+ fname = browseFile;
+ eap->forceit = TRUE; /* since dialog already asked */
+ }
+#endif
+
+ redir_fd = open_exfile(fname, eap->forceit, mode);
+ vim_free(fname);
+ }
+#ifdef FEAT_EVAL
+ else if (*eap->arg == '@')
+ {
+ /* redirect to a register a-z (resp. A-Z for appending) */
+ close_redir();
+ ++eap->arg;
+ if (ASCII_ISALPHA(*eap->arg)
+# ifdef FEAT_CLIPBOARD
+ || *eap->arg == '*'
+# endif
+ || *eap->arg == '"')
+ {
+ redir_reg = *eap->arg;
+ if (islower(redir_reg)
+# ifdef FEAT_CLIPBOARD
+ || redir_reg == '*'
+# endif
+ || redir_reg == '"')
+ {
+ /* make register empty */
+ write_reg_contents(redir_reg, (char_u *)"", -1, FALSE);
+ }
+ }
+ else
+ EMSG(_(e_invarg));
+ }
+#endif
+
+ /* TODO: redirect to a buffer */
+
+ /* TODO: redirect to an internal variable */
+
+ else
+ EMSG(_(e_invarg));
+ }
+}
+
+/*
+ * ":redraw": force redraw
+ */
+ static void
+ex_redraw(eap)
+ exarg_T *eap;
+{
+ int r = RedrawingDisabled;
+ int p = p_lz;
+
+ RedrawingDisabled = 0;
+ p_lz = FALSE;
+ update_topline();
+ update_screen(eap->forceit ? CLEAR :
+#ifdef FEAT_VISUAL
+ VIsual_active ? INVERTED :
+#endif
+ 0);
+#ifdef FEAT_TITLE
+ if (need_maketitle)
+ maketitle();
+#endif
+ RedrawingDisabled = r;
+ p_lz = p;
+
+ /* Reset msg_didout, so that a message that's there is overwritten. */
+ msg_didout = FALSE;
+ msg_col = 0;
+
+ out_flush();
+}
+
+/*
+ * ":redrawstatus": force redraw of status line(s)
+ */
+/*ARGSUSED*/
+ static void
+ex_redrawstatus(eap)
+ exarg_T *eap;
+{
+#if defined(FEAT_WINDOWS)
+ int r = RedrawingDisabled;
+ int p = p_lz;
+
+ RedrawingDisabled = 0;
+ p_lz = FALSE;
+ if (eap->forceit)
+ status_redraw_all();
+ else
+ status_redraw_curbuf();
+ update_screen(
+# ifdef FEAT_VISUAL
+ VIsual_active ? INVERTED :
+# endif
+ 0);
+ RedrawingDisabled = r;
+ p_lz = p;
+ out_flush();
+#endif
+}
+
+ static void
+close_redir()
+{
+ if (redir_fd != NULL)
+ {
+ fclose(redir_fd);
+ redir_fd = NULL;
+ }
+#ifdef FEAT_EVAL
+ redir_reg = 0;
+#endif
+}
+
+#if defined(FEAT_SESSION) && defined(USE_CRNL)
+# define MKSESSION_NL
+static int mksession_nl = FALSE; /* use NL only in put_eol() */
+#endif
+
+/*
+ * ":mkexrc", ":mkvimrc", ":mkview" and ":mksession".
+ */
+ static void
+ex_mkrc(eap)
+ exarg_T *eap;
+{
+ FILE *fd;
+ int failed = FALSE;
+ char_u *fname;
+#ifdef FEAT_BROWSE
+ char_u *browseFile = NULL;
+#endif
+#ifdef FEAT_SESSION
+ int view_session = FALSE;
+ int using_vdir = FALSE; /* using 'viewdir'? */
+ char_u *viewFile = NULL;
+ unsigned *flagp;
+#endif
+
+ if (eap->cmdidx == CMD_mksession || eap->cmdidx == CMD_mkview)
+ {
+#ifdef FEAT_SESSION
+ view_session = TRUE;
+#else
+ ex_ni(eap);
+ return;
+#endif
+ }
+
+#ifdef FEAT_SESSION
+ /* ":mkview" or ":mkview 9": generate file name with 'viewdir' */
+ if (eap->cmdidx == CMD_mkview
+ && (*eap->arg == NUL
+ || (vim_isdigit(*eap->arg) && eap->arg[1] == NUL)))
+ {
+ eap->forceit = TRUE;
+ fname = get_view_file(*eap->arg);
+ if (fname == NULL)
+ return;
+ viewFile = fname;
+ using_vdir = TRUE;
+ }
+ else
+#endif
+ if (*eap->arg != NUL)
+ fname = eap->arg;
+ else if (eap->cmdidx == CMD_mkvimrc)
+ fname = (char_u *)VIMRC_FILE;
+#ifdef FEAT_SESSION
+ else if (eap->cmdidx == CMD_mksession)
+ fname = (char_u *)SESSION_FILE;
+#endif
+ else
+ fname = (char_u *)EXRC_FILE;
+
+#ifdef FEAT_BROWSE
+ if (cmdmod.browse)
+ {
+ browseFile = do_browse(TRUE,
+# ifdef FEAT_SESSION
+ eap->cmdidx == CMD_mkview ? (char_u *)_("Save View") :
+ eap->cmdidx == CMD_mksession ? (char_u *)_("Save Session") :
+# endif
+ (char_u *)_("Save Setup"),
+ fname, (char_u *)"vim", NULL, BROWSE_FILTER_MACROS, NULL);
+ if (browseFile == NULL)
+ goto theend;
+ fname = browseFile;
+ eap->forceit = TRUE; /* since dialog already asked */
+ }
+#endif
+
+#if defined(FEAT_SESSION) && defined(vim_mkdir)
+ /* When using 'viewdir' may have to create the directory. */
+ if (using_vdir && !mch_isdir(p_vdir))
+ vim_mkdir(p_vdir, 0755); /* ignore errors, open_exfile() will fail */
+#endif
+
+ fd = open_exfile(fname, eap->forceit, WRITEBIN);
+ if (fd != NULL)
+ {
+#ifdef FEAT_SESSION
+ if (eap->cmdidx == CMD_mkview)
+ flagp = &vop_flags;
+ else
+ flagp = &ssop_flags;
+#endif
+
+#ifdef MKSESSION_NL
+ /* "unix" in 'sessionoptions': use NL line separator */
+ if (view_session && (*flagp & SSOP_UNIX))
+ mksession_nl = TRUE;
+#endif
+
+ /* Write the version command for :mkvimrc */
+ if (eap->cmdidx == CMD_mkvimrc)
+ (void)put_line(fd, "version 6.0");
+
+#ifdef FEAT_SESSION
+ if (eap->cmdidx != CMD_mkview)
+#endif
+ {
+ /* Write setting 'compatible' first, because it has side effects.
+ * For that same reason only do it when needed. */
+ if (p_cp)
+ (void)put_line(fd, "if !&cp | set cp | endif");
+ else
+ (void)put_line(fd, "if &cp | set nocp | endif");
+ }
+
+#ifdef FEAT_SESSION
+ if (!view_session
+ || (eap->cmdidx == CMD_mksession
+ && (*flagp & SSOP_OPTIONS)))
+#endif
+ failed |= (makemap(fd, NULL) == FAIL
+ || makeset(fd, OPT_GLOBAL, FALSE) == FAIL);
+
+#ifdef FEAT_SESSION
+ if (!failed && view_session)
+ {
+ if (put_line(fd, "let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0") == FAIL)
+ failed = TRUE;
+ if (eap->cmdidx == CMD_mksession)
+ {
+ char_u dirnow[MAXPATHL]; /* current directory */
+
+ /*
+ * Change to session file's dir.
+ */
+ if (mch_dirname(dirnow, MAXPATHL) == FAIL
+ || mch_chdir((char *)dirnow) != 0)
+ *dirnow = NUL;
+ if (*dirnow != NUL && (ssop_flags & SSOP_SESDIR))
+ {
+ if (vim_chdirfile(fname) == OK)
+ shorten_fnames(TRUE);
+ }
+ else if (*dirnow != NUL
+ && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
+ {
+ (void)mch_chdir((char *)globaldir);
+ shorten_fnames(TRUE);
+ }
+
+ failed |= (makeopens(fd, dirnow) == FAIL);
+
+ /* restore original dir */
+ if (*dirnow != NUL && ((ssop_flags & SSOP_SESDIR)
+ || ((ssop_flags & SSOP_CURDIR) && globaldir != NULL)))
+ {
+ if (mch_chdir((char *)dirnow) != 0)
+ EMSG(_(e_prev_dir));
+ shorten_fnames(TRUE);
+ }
+ }
+ else
+ {
+ failed |= (put_view(fd, curwin, !using_vdir, flagp) == FAIL);
+ }
+ if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save")
+ == FAIL)
+ failed = TRUE;
+ }
+#endif
+ failed |= fclose(fd);
+
+ if (failed)
+ EMSG(_(e_write));
+#if defined(FEAT_EVAL) && defined(FEAT_SESSION)
+ else if (eap->cmdidx == CMD_mksession)
+ {
+ /* successful session write - set this_session var */
+ char_u tbuf[MAXPATHL];
+
+ if (vim_FullName(fname, tbuf, MAXPATHL, FALSE) == OK)
+ set_vim_var_string(VV_THIS_SESSION, tbuf, -1);
+ }
+#endif
+#ifdef MKSESSION_NL
+ mksession_nl = FALSE;
+#endif
+ }
+
+#ifdef FEAT_BROWSE
+theend:
+ vim_free(browseFile);
+#endif
+#ifdef FEAT_SESSION
+ vim_free(viewFile);
+#endif
+}
+
+/*
+ * Open a file for writing for an Ex command, with some checks.
+ * Return file descriptor, or NULL on failure.
+ */
+ FILE *
+open_exfile(fname, forceit, mode)
+ char_u *fname;
+ int forceit;
+ char *mode; /* "w" for create new file or "a" for append */
+{
+ FILE *fd;
+
+#ifdef UNIX
+ /* with Unix it is possible to open a directory */
+ if (mch_isdir(fname))
+ {
+ EMSG2(_(e_isadir2), fname);
+ return NULL;
+ }
+#endif
+ if (!forceit && *mode != 'a' && vim_fexists(fname))
+ {
+ EMSG2(_("E189: \"%s\" exists (add ! to override)"), fname);
+ return NULL;
+ }
+
+ if ((fd = mch_fopen((char *)fname, mode)) == NULL)
+ EMSG2(_("E190: Cannot open \"%s\" for writing"), fname);
+
+ return fd;
+}
+
+/*
+ * ":mark" and ":k".
+ */
+ static void
+ex_mark(eap)
+ exarg_T *eap;
+{
+ pos_T pos;
+
+ if (*eap->arg == NUL) /* No argument? */
+ EMSG(_(e_argreq));
+ else if (eap->arg[1] != NUL) /* more than one character? */
+ EMSG(_(e_trailing));
+ else
+ {
+ pos = curwin->w_cursor; /* save curwin->w_cursor */
+ curwin->w_cursor.lnum = eap->line2;
+ beginline(BL_WHITE | BL_FIX);
+ if (setmark(*eap->arg) == FAIL) /* set mark */
+ EMSG(_("E191: Argument must be a letter or forward/backward quote"));
+ curwin->w_cursor = pos; /* restore curwin->w_cursor */
+ }
+}
+
+/*
+ * Update w_topline, w_leftcol and the cursor position.
+ */
+ void
+update_topline_cursor()
+{
+ check_cursor(); /* put cursor on valid line */
+ update_topline();
+ if (!curwin->w_p_wrap)
+ validate_cursor();
+ update_curswant();
+}
+
+#ifdef FEAT_EX_EXTRA
+/*
+ * ":normal[!] {commands}": Execute normal mode commands.
+ */
+ static void
+ex_normal(eap)
+ exarg_T *eap;
+{
+ oparg_T oa;
+ int save_msg_scroll = msg_scroll;
+ int save_restart_edit = restart_edit;
+ int save_msg_didout = msg_didout;
+ int save_State = State;
+ tasave_T tabuf;
+ int save_insertmode = p_im;
+ int save_finish_op = finish_op;
+#ifdef FEAT_MBYTE
+ char_u *arg = NULL;
+ int l;
+ char_u *p;
+#endif
+
+ if (ex_normal_busy >= p_mmd)
+ {
+ EMSG(_("E192: Recursive use of :normal too deep"));
+ return;
+ }
+ ++ex_normal_busy;
+
+ msg_scroll = FALSE; /* no msg scrolling in Normal mode */
+ restart_edit = 0; /* don't go to Insert mode */
+ p_im = FALSE; /* don't use 'insertmode' */
+
+#ifdef FEAT_MBYTE
+ /*
+ * vgetc() expects a CSI and K_SPECIAL to have been escaped. Don't do
+ * this for the K_SPECIAL leading byte, otherwise special keys will not
+ * work.
+ */
+ if (has_mbyte)
+ {
+ int len = 0;
+
+ /* Count the number of characters to be escaped. */
+ for (p = eap->arg; *p != NUL; ++p)
+ {
+# ifdef FEAT_GUI
+ if (*p == CSI) /* leadbyte CSI */
+ len += 2;
+# endif
+ for (l = (*mb_ptr2len_check)(p) - 1; l > 0; --l)
+ if (*++p == K_SPECIAL /* trailbyte K_SPECIAL or CSI */
+# ifdef FEAT_GUI
+ || *p == CSI
+# endif
+ )
+ len += 2;
+ }
+ if (len > 0)
+ {
+ arg = alloc((unsigned)(STRLEN(eap->arg) + len + 1));
+ if (arg != NULL)
+ {
+ len = 0;
+ for (p = eap->arg; *p != NUL; ++p)
+ {
+ arg[len++] = *p;
+# ifdef FEAT_GUI
+ if (*p == CSI)
+ {
+ arg[len++] = KS_EXTRA;
+ arg[len++] = (int)KE_CSI;
+ }
+# endif
+ for (l = (*mb_ptr2len_check)(p) - 1; l > 0; --l)
+ {
+ arg[len++] = *++p;
+ if (*p == K_SPECIAL)
+ {
+ arg[len++] = KS_SPECIAL;
+ arg[len++] = KE_FILLER;
+ }
+# ifdef FEAT_GUI
+ else if (*p == CSI)
+ {
+ arg[len++] = KS_EXTRA;
+ arg[len++] = (int)KE_CSI;
+ }
+# endif
+ }
+ arg[len] = NUL;
+ }
+ }
+ }
+ }
+#endif
+
+ /*
+ * Save the current typeahead. This is required to allow using ":normal"
+ * from an event handler and makes sure we don't hang when the argument
+ * ends with half a command.
+ */
+ save_typeahead(&tabuf);
+ if (tabuf.typebuf_valid)
+ {
+ /*
+ * Repeat the :normal command for each line in the range. When no
+ * range given, execute it just once, without positioning the cursor
+ * first.
+ */
+ do
+ {
+ clear_oparg(&oa);
+ finish_op = FALSE;
+ if (eap->addr_count != 0)
+ {
+ curwin->w_cursor.lnum = eap->line1++;
+ curwin->w_cursor.col = 0;
+ }
+
+ /*
+ * Stuff the argument into the typeahead buffer.
+ * Execute normal_cmd() until there is no typeahead left.
+ */
+ ins_typebuf(
+#ifdef FEAT_MBYTE
+ arg != NULL ? arg :
+#endif
+ eap->arg, eap->forceit ? REMAP_NONE : REMAP_YES, 0,
+ TRUE, FALSE);
+ while ((!stuff_empty() || (!typebuf_typed() && typebuf.tb_len > 0))
+ && !got_int)
+ {
+ update_topline_cursor();
+ normal_cmd(&oa, FALSE); /* execute a Normal mode cmd */
+ }
+ }
+ while (eap->addr_count > 0 && eap->line1 <= eap->line2 && !got_int);
+ }
+
+ /* Might not return to the main loop when in an event handler. */
+ update_topline_cursor();
+
+ /* Restore the previous typeahead. */
+ restore_typeahead(&tabuf);
+
+ --ex_normal_busy;
+ msg_scroll = save_msg_scroll;
+ restart_edit = save_restart_edit;
+ p_im = save_insertmode;
+ finish_op = save_finish_op;
+ msg_didout |= save_msg_didout; /* don't reset msg_didout now */
+
+ /* Restore the state (needed when called from a function executed for
+ * 'indentexpr'). */
+ State = save_State;
+#ifdef FEAT_MBYTE
+ vim_free(arg);
+#endif
+}
+
+/*
+ * ":startinsert"
+ */
+ static void
+ex_startinsert(eap)
+ exarg_T *eap;
+{
+ if (eap->forceit)
+ {
+ coladvance((colnr_T)MAXCOL);
+ curwin->w_curswant = MAXCOL;
+ curwin->w_set_curswant = FALSE;
+ restart_edit = 'a';
+ }
+ else
+ {
+ restart_edit = 'i';
+ curwin->w_curswant = 0; /* avoid MAXCOL */
+ }
+}
+
+/*
+ * ":stopinsert"
+ */
+/*ARGSUSED*/
+ static void
+ex_stopinsert(eap)
+ exarg_T *eap;
+{
+ restart_edit = 0;
+ stop_insert_mode = TRUE;
+}
+#endif
+
+#ifdef FEAT_FIND_ID
+ static void
+ex_checkpath(eap)
+ exarg_T *eap;
+{
+ find_pattern_in_path(NULL, 0, 0, FALSE, FALSE, CHECK_PATH, 1L,
+ eap->forceit ? ACTION_SHOW_ALL : ACTION_SHOW,
+ (linenr_T)1, (linenr_T)MAXLNUM);
+}
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+/*
+ * ":psearch"
+ */
+ static void
+ex_psearch(eap)
+ exarg_T *eap;
+{
+ g_do_tagpreview = p_pvh;
+ ex_findpat(eap);
+ g_do_tagpreview = 0;
+}
+#endif
+
+ static void
+ex_findpat(eap)
+ exarg_T *eap;
+{
+ int whole = TRUE;
+ long n;
+ char_u *p;
+ int action;
+
+ switch (cmdnames[eap->cmdidx].cmd_name[2])
+ {
+ case 'e': /* ":psearch", ":isearch" and ":dsearch" */
+ if (cmdnames[eap->cmdidx].cmd_name[0] == 'p')
+ action = ACTION_GOTO;
+ else
+ action = ACTION_SHOW;
+ break;
+ case 'i': /* ":ilist" and ":dlist" */
+ action = ACTION_SHOW_ALL;
+ break;
+ case 'u': /* ":ijump" and ":djump" */
+ action = ACTION_GOTO;
+ break;
+ default: /* ":isplit" and ":dsplit" */
+ action = ACTION_SPLIT;
+ break;
+ }
+
+ n = 1;
+ if (vim_isdigit(*eap->arg)) /* get count */
+ {
+ n = getdigits(&eap->arg);
+ eap->arg = skipwhite(eap->arg);
+ }
+ if (*eap->arg == '/') /* Match regexp, not just whole words */
+ {
+ whole = FALSE;
+ ++eap->arg;
+ p = skip_regexp(eap->arg, '/', p_magic, NULL);
+ if (*p)
+ {
+ *p++ = NUL;
+ p = skipwhite(p);
+
+ /* Check for trailing illegal characters */
+ if (!ends_excmd(*p))
+ eap->errmsg = e_trailing;
+ else
+ eap->nextcmd = check_nextcmd(p);
+ }
+ }
+ if (!eap->skip)
+ find_pattern_in_path(eap->arg, 0, (int)STRLEN(eap->arg),
+ whole, !eap->forceit,
+ *eap->cmd == 'd' ? FIND_DEFINE : FIND_ANY,
+ n, action, eap->line1, eap->line2);
+}
+#endif
+
+#ifdef FEAT_WINDOWS
+
+# ifdef FEAT_QUICKFIX
+/*
+ * ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
+ */
+ static void
+ex_ptag(eap)
+ exarg_T *eap;
+{
+ g_do_tagpreview = p_pvh;
+ ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
+}
+
+/*
+ * ":pedit"
+ */
+ static void
+ex_pedit(eap)
+ exarg_T *eap;
+{
+ win_T *curwin_save = curwin;
+
+ g_do_tagpreview = p_pvh;
+ prepare_tagpreview();
+ keep_help_flag = curwin_save->w_buffer->b_help;
+ do_exedit(eap, NULL);
+ keep_help_flag = FALSE;
+ if (curwin != curwin_save && win_valid(curwin_save))
+ {
+ /* Return cursor to where we were */
+ validate_cursor();
+ redraw_later(VALID);
+ win_enter(curwin_save, TRUE);
+ }
+ g_do_tagpreview = 0;
+}
+# endif
+
+/*
+ * ":stag", ":stselect" and ":stjump".
+ */
+ static void
+ex_stag(eap)
+ exarg_T *eap;
+{
+ postponed_split = -1;
+ postponed_split_flags = cmdmod.split;
+ ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
+ postponed_split_flags = 0;
+}
+#endif
+
+/*
+ * ":tag", ":tselect", ":tjump", ":tnext", etc.
+ */
+ static void
+ex_tag(eap)
+ exarg_T *eap;
+{
+ ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name);
+}
+
+ static void
+ex_tag_cmd(eap, name)
+ exarg_T *eap;
+ char_u *name;
+{
+ int cmd;
+
+ switch (name[1])
+ {
+ case 'j': cmd = DT_JUMP; /* ":tjump" */
+ break;
+ case 's': cmd = DT_SELECT; /* ":tselect" */
+ break;
+ case 'p': cmd = DT_PREV; /* ":tprevious" */
+ break;
+ case 'N': cmd = DT_PREV; /* ":tNext" */
+ break;
+ case 'n': cmd = DT_NEXT; /* ":tnext" */
+ break;
+ case 'o': cmd = DT_POP; /* ":pop" */
+ break;
+ case 'f': /* ":tfirst" */
+ case 'r': cmd = DT_FIRST; /* ":trewind" */
+ break;
+ case 'l': cmd = DT_LAST; /* ":tlast" */
+ break;
+ default: /* ":tag" */
+#ifdef FEAT_CSCOPE
+ if (p_cst)
+ {
+ do_cstag(eap);
+ return;
+ }
+#endif
+ cmd = DT_TAG;
+ break;
+ }
+
+ do_tag(eap->arg, cmd, eap->addr_count > 0 ? (int)eap->line2 : 1,
+ eap->forceit, TRUE);
+}
+
+/*
+ * Evaluate cmdline variables.
+ *
+ * change '%' to curbuf->b_ffname
+ * '#' to curwin->w_altfile
+ * '<cword>' to word under the cursor
+ * '<cWORD>' to WORD under the cursor
+ * '<cfile>' to path name under the cursor
+ * '<sfile>' to sourced file name
+ * '<afile>' to file name for autocommand
+ * '<abuf>' to buffer number for autocommand
+ * '<amatch>' to matching name for autocommand
+ *
+ * When an error is detected, "errormsg" is set to a non-NULL pointer (may be
+ * "" for error without a message) and NULL is returned.
+ * Returns an allocated string if a valid match was found.
+ * Returns NULL if no match was found. "usedlen" then still contains the
+ * number of characters to skip.
+ */
+ char_u *
+eval_vars(src, usedlen, lnump, errormsg, srcstart)
+ char_u *src; /* pointer into commandline */
+ int *usedlen; /* characters after src that are used */
+ linenr_T *lnump; /* line number for :e command, or NULL */
+ char_u **errormsg; /* pointer to error message */
+ char_u *srcstart; /* beginning of valid memory for src */
+{
+ int i;
+ char_u *s;
+ char_u *result;
+ char_u *resultbuf = NULL;
+ int resultlen;
+ buf_T *buf;
+ int valid = VALID_HEAD + VALID_PATH; /* assume valid result */
+ int spec_idx;
+#ifdef FEAT_MODIFY_FNAME
+ int skip_mod = FALSE;
+#endif
+ static char *(spec_str[]) =
+ {
+ "%",
+#define SPEC_PERC 0
+ "#",
+#define SPEC_HASH 1
+ "<cword>", /* cursor word */
+#define SPEC_CWORD 2
+ "<cWORD>", /* cursor WORD */
+#define SPEC_CCWORD 3
+ "<cfile>", /* cursor path name */
+#define SPEC_CFILE 4
+ "<sfile>", /* ":so" file name */
+#define SPEC_SFILE 5
+#ifdef FEAT_AUTOCMD
+ "<afile>", /* autocommand file name */
+# define SPEC_AFILE 6
+ "<abuf>", /* autocommand buffer number */
+# define SPEC_ABUF 7
+ "<amatch>", /* autocommand match name */
+# define SPEC_AMATCH 8
+#endif
+#ifdef FEAT_CLIENTSERVER
+ "<client>"
+# define SPEC_CLIENT 9
+#endif
+ };
+#define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
+
+#if defined(FEAT_AUTOCMD) || defined(FEAT_CLIENTSERVER)
+ char_u strbuf[30];
+#endif
+
+ *errormsg = NULL;
+
+ /*
+ * Check if there is something to do.
+ */
+ for (spec_idx = 0; spec_idx < SPEC_COUNT; ++spec_idx)
+ {
+ *usedlen = (int)STRLEN(spec_str[spec_idx]);
+ if (STRNCMP(src, spec_str[spec_idx], *usedlen) == 0)
+ break;
+ }
+ if (spec_idx == SPEC_COUNT) /* no match */
+ {
+ *usedlen = 1;
+ return NULL;
+ }
+
+ /*
+ * Skip when preceded with a backslash "\%" and "\#".
+ * Note: In "\\%" the % is also not recognized!
+ */
+ if (src > srcstart && src[-1] == '\\')
+ {
+ *usedlen = 0;
+ STRCPY(src - 1, src); /* remove backslash */
+ return NULL;
+ }
+
+ /*
+ * word or WORD under cursor
+ */
+ if (spec_idx == SPEC_CWORD || spec_idx == SPEC_CCWORD)
+ {
+ resultlen = find_ident_under_cursor(&result, spec_idx == SPEC_CWORD ?
+ (FIND_IDENT|FIND_STRING) : FIND_STRING);
+ if (resultlen == 0)
+ {
+ *errormsg = (char_u *)"";
+ return NULL;
+ }
+ }
+
+ /*
+ * '#': Alternate file name
+ * '%': Current file name
+ * File name under the cursor
+ * File name for autocommand
+ * and following modifiers
+ */
+ else
+ {
+ switch (spec_idx)
+ {
+ case SPEC_PERC: /* '%': current file */
+ if (curbuf->b_fname == NULL)
+ {
+ result = (char_u *)"";
+ valid = 0; /* Must have ":p:h" to be valid */
+ }
+ else
+#ifdef RISCOS
+ /* Always use the full path for RISC OS if possible. */
+ result = curbuf->b_ffname;
+ if (result == NULL)
+ result = curbuf->b_fname;
+#else
+ result = curbuf->b_fname;
+#endif
+ break;
+
+ case SPEC_HASH: /* '#' or "#99": alternate file */
+ if (src[1] == '#') /* "##": the argument list */
+ {
+ result = arg_all();
+ resultbuf = result;
+ *usedlen = 2;
+#ifdef FEAT_MODIFY_FNAME
+ skip_mod = TRUE;
+#endif
+ break;
+ }
+ s = src + 1;
+ i = (int)getdigits(&s);
+ *usedlen = (int)(s - src); /* length of what we expand */
+
+ buf = buflist_findnr(i);
+ if (buf == NULL)
+ {
+ *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
+ return NULL;
+ }
+ if (lnump != NULL)
+ *lnump = ECMD_LAST;
+ if (buf->b_fname == NULL)
+ {
+ result = (char_u *)"";
+ valid = 0; /* Must have ":p:h" to be valid */
+ }
+ else
+ result = buf->b_fname;
+ break;
+
+#ifdef FEAT_SEARCHPATH
+ case SPEC_CFILE: /* file name under cursor */
+ result = file_name_at_cursor(FNAME_MESS|FNAME_HYP, 1L);
+ if (result == NULL)
+ {
+ *errormsg = (char_u *)"";
+ return NULL;
+ }
+ resultbuf = result; /* remember allocated string */
+ break;
+#endif
+
+#ifdef FEAT_AUTOCMD
+ case SPEC_AFILE: /* file name for autocommand */
+ result = autocmd_fname;
+ if (result == NULL)
+ {
+ *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
+ return NULL;
+ }
+ break;
+
+ case SPEC_ABUF: /* buffer number for autocommand */
+ if (autocmd_bufnr <= 0)
+ {
+ *errormsg = (char_u *)_("E496: no autocommand buffer number to substitute for \"<abuf>\"");
+ return NULL;
+ }
+ sprintf((char *)strbuf, "%d", autocmd_bufnr);
+ result = strbuf;
+ break;
+
+ case SPEC_AMATCH: /* match name for autocommand */
+ result = autocmd_match;
+ if (result == NULL)
+ {
+ *errormsg = (char_u *)_("E497: no autocommand match name to substitute for \"<amatch>\"");
+ return NULL;
+ }
+ break;
+
+#endif
+ case SPEC_SFILE: /* file name for ":so" command */
+ result = sourcing_name;
+ if (result == NULL)
+ {
+ *errormsg = (char_u *)_("E498: no :source file name to substitute for \"<sfile>\"");
+ return NULL;
+ }
+ break;
+#if defined(FEAT_CLIENTSERVER)
+ case SPEC_CLIENT: /* Source of last submitted input */
+ sprintf((char *)strbuf, "0x%x", (unsigned int)clientWindow);
+ result = strbuf;
+ break;
+#endif
+ }
+
+ resultlen = (int)STRLEN(result); /* length of new string */
+ if (src[*usedlen] == '<') /* remove the file name extension */
+ {
+ ++*usedlen;
+#ifdef RISCOS
+ if ((s = vim_strrchr(result, '/')) != NULL && s >= gettail(result))
+#else
+ if ((s = vim_strrchr(result, '.')) != NULL && s >= gettail(result))
+#endif
+ resultlen = (int)(s - result);
+ }
+#ifdef FEAT_MODIFY_FNAME
+ else if (!skip_mod)
+ {
+ valid |= modify_fname(src, usedlen, &result, &resultbuf,
+ &resultlen);
+ if (result == NULL)
+ {
+ *errormsg = (char_u *)"";
+ return NULL;
+ }
+ }
+#endif
+ }
+
+ if (resultlen == 0 || valid != VALID_HEAD + VALID_PATH)
+ {
+ if (valid != VALID_HEAD + VALID_PATH)
+ /* xgettext:no-c-format */
+ *errormsg = (char_u *)_("E499: Empty file name for '%' or '#', only works with \":p:h\"");
+ else
+ *errormsg = (char_u *)_("E500: Evaluates to an empty string");
+ result = NULL;
+ }
+ else
+ result = vim_strnsave(result, resultlen);
+ vim_free(resultbuf);
+ return result;
+}
+
+/*
+ * Concatenate all files in the argument list, separated by spaces, and return
+ * it in one allocated string.
+ * Spaces and backslashes in the file names are escaped with a backslash.
+ * Returns NULL when out of memory.
+ */
+ static char_u *
+arg_all()
+{
+ int len;
+ int idx;
+ char_u *retval = NULL;
+ char_u *p;
+
+ /*
+ * Do this loop two times:
+ * first time: compute the total length
+ * second time: concatenate the names
+ */
+ for (;;)
+ {
+ len = 0;
+ for (idx = 0; idx < ARGCOUNT; ++idx)
+ {
+ p = alist_name(&ARGLIST[idx]);
+ if (p != NULL)
+ {
+ if (len > 0)
+ {
+ /* insert a space in between names */
+ if (retval != NULL)
+ retval[len] = ' ';
+ ++len;
+ }
+ for ( ; *p != NUL; ++p)
+ {
+ if (*p == ' ' || *p == '\\')
+ {
+ /* insert a backslash */
+ if (retval != NULL)
+ retval[len] = '\\';
+ ++len;
+ }
+ if (retval != NULL)
+ retval[len] = *p;
+ ++len;
+ }
+ }
+ }
+
+ /* second time: break here */
+ if (retval != NULL)
+ {
+ retval[len] = NUL;
+ break;
+ }
+
+ /* allocate memory */
+ retval = alloc(len + 1);
+ if (retval == NULL)
+ break;
+ }
+
+ return retval;
+}
+
+#if defined(FEAT_AUTOCMD) || defined(PROTO)
+/*
+ * Expand the <sfile> string in "arg".
+ *
+ * Returns an allocated string, or NULL for any error.
+ */
+ char_u *
+expand_sfile(arg)
+ char_u *arg;
+{
+ char_u *errormsg;
+ int len;
+ char_u *result;
+ char_u *newres;
+ char_u *repl;
+ int srclen;
+ char_u *p;
+
+ result = vim_strsave(arg);
+ if (result == NULL)
+ return NULL;
+
+ for (p = result; *p; )
+ {
+ if (STRNCMP(p, "<sfile>", 7) != 0)
+ ++p;
+ else
+ {
+ /* replace "<sfile>" with the sourced file name, and do ":" stuff */
+ repl = eval_vars(p, &srclen, NULL, &errormsg, result);
+ if (errormsg != NULL)
+ {
+ if (*errormsg)
+ emsg(errormsg);
+ vim_free(result);
+ return NULL;
+ }
+ if (repl == NULL) /* no match (cannot happen) */
+ {
+ p += srclen;
+ continue;
+ }
+ len = (int)STRLEN(result) - srclen + (int)STRLEN(repl) + 1;
+ newres = alloc(len);
+ if (newres == NULL)
+ {
+ vim_free(repl);
+ vim_free(result);
+ return NULL;
+ }
+ mch_memmove(newres, result, (size_t)(p - result));
+ STRCPY(newres + (p - result), repl);
+ len = (int)STRLEN(newres);
+ STRCAT(newres, p + srclen);
+ vim_free(repl);
+ vim_free(result);
+ result = newres;
+ p = newres + len; /* continue after the match */
+ }
+ }
+
+ return result;
+}
+#endif
+
+#ifdef FEAT_SESSION
+static int ses_winsizes __ARGS((FILE *fd, int restore_size));
+static int ses_win_rec __ARGS((FILE *fd, frame_T *fr));
+static frame_T *ses_skipframe __ARGS((frame_T *fr));
+static int ses_do_frame __ARGS((frame_T *fr));
+static int ses_do_win __ARGS((win_T *wp));
+static int ses_arglist __ARGS((FILE *fd, char *cmd, garray_T *gap, int fullname, unsigned *flagp));
+static int ses_put_fname __ARGS((FILE *fd, char_u *name, unsigned *flagp));
+static int ses_fname __ARGS((FILE *fd, buf_T *buf, unsigned *flagp));
+
+/*
+ * Write openfile commands for the current buffers to an .exrc file.
+ * Return FAIL on error, OK otherwise.
+ */
+ static int
+makeopens(fd, dirnow)
+ FILE *fd;
+ char_u *dirnow; /* Current directory name */
+{
+ buf_T *buf;
+ int only_save_windows = TRUE;
+ int nr;
+ int cnr = 1;
+ int restore_size = TRUE;
+ win_T *wp;
+ char_u *sname;
+ win_T *edited_win = NULL;
+
+ if (ssop_flags & SSOP_BUFFERS)
+ only_save_windows = FALSE; /* Save ALL buffers */
+
+ /*
+ * Begin by setting the this_session variable, and then other
+ * sessionable variables.
+ */
+#ifdef FEAT_EVAL
+ if (put_line(fd, "let v:this_session=expand(\"<sfile>:p\")") == FAIL)
+ return FAIL;
+ if (ssop_flags & SSOP_GLOBALS)
+ if (store_session_globals(fd) == FAIL)
+ return FAIL;
+#endif
+
+ /*
+ * Close all windows but one.
+ */
+ if (put_line(fd, "silent only") == FAIL)
+ return FAIL;
+
+ /*
+ * Now a :cd command to the session directory or the current directory
+ */
+ if (ssop_flags & SSOP_SESDIR)
+ {
+ if (put_line(fd, "exe \"cd \" . expand(\"<sfile>:p:h\")") == FAIL)
+ return FAIL;
+ }
+ else if (ssop_flags & SSOP_CURDIR)
+ {
+ sname = home_replace_save(NULL, globaldir != NULL ? globaldir : dirnow);
+ if (sname == NULL
+ || fprintf(fd, "cd %s", sname) < 0 || put_eol(fd) == FAIL)
+ return FAIL;
+ vim_free(sname);
+ }
+
+ /*
+ * Now save the current files, current buffer first.
+ */
+ if (put_line(fd, "set shortmess=aoO") == FAIL)
+ return FAIL;
+
+ /* Now put the other buffers into the buffer list */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (!(only_save_windows && buf->b_nwindows == 0)
+ && !(buf->b_help && !(ssop_flags & SSOP_HELP))
+ && buf->b_fname != NULL
+ && buf->b_p_bl)
+ {
+ if (fprintf(fd, "badd +%ld ", buf->b_wininfo == NULL ? 1L
+ : buf->b_wininfo->wi_fpos.lnum) < 0
+ || ses_fname(fd, buf, &ssop_flags) == FAIL)
+ return FAIL;
+ }
+ }
+
+ /* the global argument list */
+ if (ses_arglist(fd, "args", &global_alist.al_ga,
+ !(ssop_flags & SSOP_CURDIR), &ssop_flags) == FAIL)
+ return FAIL;
+
+ if (ssop_flags & SSOP_RESIZE)
+ {
+ /* Note: after the restore we still check it worked!*/
+ if (fprintf(fd, "set lines=%ld columns=%ld" , Rows, Columns) < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+
+#ifdef FEAT_GUI
+ if (gui.in_use && (ssop_flags & SSOP_WINPOS))
+ {
+ int x, y;
+
+ if (gui_mch_get_winpos(&x, &y) == OK)
+ {
+ /* Note: after the restore we still check it worked!*/
+ if (fprintf(fd, "winpos %d %d", x, y) < 0 || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+ }
+#endif
+
+ /*
+ * Before creating the window layout, try loading one file. If this is
+ * aborted we don't end up with a number of useless windows.
+ * This may have side effects! (e.g., compressed or network file).
+ */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ if (ses_do_win(wp)
+ && wp->w_buffer->b_ffname != NULL
+ && !wp->w_buffer->b_help
+#ifdef FEAT_QUICKFIX
+ && !bt_nofile(wp->w_buffer)
+#endif
+ )
+ {
+ if (fputs("edit ", fd) < 0
+ || ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL)
+ return FAIL;
+ if (!wp->w_arg_idx_invalid)
+ edited_win = wp;
+ break;
+ }
+ }
+
+ /*
+ * Save current window layout.
+ */
+ if (put_line(fd, "set splitbelow splitright") == FAIL)
+ return FAIL;
+ if (ses_win_rec(fd, topframe) == FAIL)
+ return FAIL;
+ if (!p_sb && put_line(fd, "set nosplitbelow") == FAIL)
+ return FAIL;
+ if (!p_spr && put_line(fd, "set nosplitright") == FAIL)
+ return FAIL;
+
+ /*
+ * Check if window sizes can be restored (no windows omitted).
+ * Remember the window number of the current window after restoring.
+ */
+ nr = 0;
+ for (wp = firstwin; wp != NULL; wp = W_NEXT(wp))
+ {
+ if (ses_do_win(wp))
+ ++nr;
+ else
+ restore_size = FALSE;
+ if (curwin == wp)
+ cnr = nr;
+ }
+
+ /* Go to the first window. */
+ if (put_line(fd, "wincmd t") == FAIL)
+ return FAIL;
+
+ /*
+ * If more than one window, see if sizes can be restored.
+ * First set 'winheight' and 'winwidth' to 1 to avoid the windows being
+ * resized when moving between windows.
+ * Do this before restoring the view, so that the topline and the cursor
+ * can be set. This is done again below.
+ */
+ if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
+ return FAIL;
+ if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL)
+ return FAIL;
+
+ /*
+ * Restore the view of the window (options, file, cursor, etc.).
+ */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ if (!ses_do_win(wp))
+ continue;
+ if (put_view(fd, wp, wp != edited_win, &ssop_flags) == FAIL)
+ return FAIL;
+ if (nr > 1 && put_line(fd, "wincmd w") == FAIL)
+ return FAIL;
+ }
+
+ /*
+ * Restore cursor to the current window if it's not the first one.
+ */
+ if (cnr > 1 && (fprintf(fd, "%dwincmd w", cnr) < 0 || put_eol(fd) == FAIL))
+ return FAIL;
+
+ /*
+ * Restore window sizes again after jumping around in windows, because the
+ * current window has a minimum size while others may not.
+ */
+ if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL)
+ return FAIL;
+
+ /* Re-apply 'winheight', 'winwidth' and 'shortmess'. */
+ if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
+ p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
+ return FAIL;
+
+ /*
+ * Lastly, execute the x.vim file if it exists.
+ */
+ if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL
+ || put_line(fd, "if file_readable(s:sx)") == FAIL
+ || put_line(fd, " exe \"source \" . s:sx") == FAIL
+ || put_line(fd, "endif") == FAIL)
+ return FAIL;
+
+ return OK;
+}
+
+ static int
+ses_winsizes(fd, restore_size)
+ FILE *fd;
+ int restore_size;
+{
+ int n = 0;
+ win_T *wp;
+
+ if (restore_size && (ssop_flags & SSOP_WINSIZE))
+ {
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ if (!ses_do_win(wp))
+ continue;
+ ++n;
+
+ /* restore height when not full height */
+ if (wp->w_height + wp->w_status_height < topframe->fr_height
+ && (fprintf(fd,
+ "exe '%dresize ' . ((&lines * %ld + %ld) / %ld)",
+ n, (long)wp->w_height, Rows / 2, Rows) < 0
+ || put_eol(fd) == FAIL))
+ return FAIL;
+
+ /* restore width when not full width */
+ if (wp->w_width < Columns && (fprintf(fd,
+ "exe 'vert %dresize ' . ((&columns * %ld + %ld) / %ld)",
+ n, (long)wp->w_width, Columns / 2, Columns) < 0
+ || put_eol(fd) == FAIL))
+ return FAIL;
+ }
+ }
+ else
+ {
+ /* Just equalise window sizes */
+ if (put_line(fd, "wincmd =") == FAIL)
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * Write commands to "fd" to recursively create windows for frame "fr",
+ * horizontally and vertically split.
+ * After the commands the last window in the frame is the current window.
+ * Returns FAIL when writing the commands to "fd" fails.
+ */
+ static int
+ses_win_rec(fd, fr)
+ FILE *fd;
+ frame_T *fr;
+{
+ frame_T *frc;
+ int count = 0;
+
+ if (fr->fr_layout != FR_LEAF)
+ {
+ /* Find first frame that's not skipped and then create a window for
+ * each following one (first frame is already there). */
+ frc = ses_skipframe(fr->fr_child);
+ if (frc != NULL)
+ while ((frc = ses_skipframe(frc->fr_next)) != NULL)
+ {
+ /* Make window as big as possible so that we have lots of room
+ * to split. */
+ if (put_line(fd, "wincmd _ | wincmd |") == FAIL
+ || put_line(fd, fr->fr_layout == FR_COL
+ ? "split" : "vsplit") == FAIL)
+ return FAIL;
+ ++count;
+ }
+
+ /* Go back to the first window. */
+ if (count > 0 && (fprintf(fd, fr->fr_layout == FR_COL
+ ? "%dwincmd k" : "%dwincmd h", count) < 0
+ || put_eol(fd) == FAIL))
+ return FAIL;
+
+ /* Recursively create frames/windows in each window of this column or
+ * row. */
+ frc = ses_skipframe(fr->fr_child);
+ while (frc != NULL)
+ {
+ ses_win_rec(fd, frc);
+ frc = ses_skipframe(frc->fr_next);
+ /* Go to next window. */
+ if (frc != NULL && put_line(fd, "wincmd w") == FAIL)
+ return FAIL;
+ }
+ }
+ return OK;
+}
+
+/*
+ * Skip frames that don't contain windows we want to save in the Session.
+ * Returns NULL when there none.
+ */
+ static frame_T *
+ses_skipframe(fr)
+ frame_T *fr;
+{
+ frame_T *frc;
+
+ for (frc = fr; frc != NULL; frc = frc->fr_next)
+ if (ses_do_frame(frc))
+ break;
+ return frc;
+}
+
+/*
+ * Return TRUE if frame "fr" has a window somewhere that we want to save in
+ * the Session.
+ */
+ static int
+ses_do_frame(fr)
+ frame_T *fr;
+{
+ frame_T *frc;
+
+ if (fr->fr_layout == FR_LEAF)
+ return ses_do_win(fr->fr_win);
+ for (frc = fr->fr_child; frc != NULL; frc = frc->fr_next)
+ if (ses_do_frame(frc))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Return non-zero if window "wp" is to be stored in the Session.
+ */
+ static int
+ses_do_win(wp)
+ win_T *wp;
+{
+ if (wp->w_buffer->b_fname == NULL
+#ifdef FEAT_QUICKFIX
+ /* When 'buftype' is "nofile" can't restore the window contents. */
+ || bt_nofile(wp->w_buffer)
+#endif
+ )
+ return (ssop_flags & SSOP_BLANK);
+ if (wp->w_buffer->b_help)
+ return (ssop_flags & SSOP_HELP);
+ return TRUE;
+}
+
+/*
+ * Write commands to "fd" to restore the view of a window.
+ * Caller must make sure 'scrolloff' is zero.
+ */
+ static int
+put_view(fd, wp, add_edit, flagp)
+ FILE *fd;
+ win_T *wp;
+ int add_edit; /* add ":edit" command to view */
+ unsigned *flagp; /* vop_flags or ssop_flags */
+{
+ win_T *save_curwin;
+ int f;
+ int do_cursor;
+
+ /* Always restore cursor position for ":mksession". For ":mkview" only
+ * when 'viewoptions' contains "cursor". */
+ do_cursor = (flagp == &ssop_flags || *flagp & SSOP_CURSOR);
+
+ /*
+ * Local argument list.
+ */
+ if (wp->w_alist == &global_alist)
+ {
+ if (put_line(fd, "argglobal") == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ if (ses_arglist(fd, "arglocal", &wp->w_alist->al_ga,
+ flagp == &vop_flags
+ || !(*flagp & SSOP_CURDIR)
+ || wp->w_localdir != NULL, flagp) == FAIL)
+ return FAIL;
+ }
+
+ /* Only when part of a session: restore the argument index. */
+ if (wp->w_arg_idx != 0 && flagp == &ssop_flags)
+ {
+ if (fprintf(fd, "%ldnext", (long)wp->w_arg_idx) < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+
+ /* Edit the file. Skip this when ":next" already did it. */
+ if (add_edit && (wp->w_arg_idx == 0 || flagp != &ssop_flags
+ || wp->w_arg_idx_invalid))
+ {
+ /*
+ * Load the file.
+ */
+ if (wp->w_buffer->b_ffname != NULL
+#ifdef FEAT_QUICKFIX
+ && !bt_nofile(wp->w_buffer)
+#endif
+ )
+ {
+ /*
+ * Editing a file in this buffer: use ":edit file".
+ * This may have side effects! (e.g., compressed or network file).
+ */
+ if (fputs("edit ", fd) < 0
+ || ses_fname(fd, wp->w_buffer, flagp) == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ /* No file in this buffer, just make it empty. */
+ if (put_line(fd, "enew") == FAIL)
+ return FAIL;
+#ifdef FEAT_QUICKFIX
+ if (wp->w_buffer->b_ffname != NULL)
+ {
+ /* The buffer does have a name, but it's not a file name. */
+ if (fputs("file ", fd) < 0
+ || ses_fname(fd, wp->w_buffer, flagp) == FAIL)
+ return FAIL;
+ }
+#endif
+ do_cursor = FALSE;
+ }
+ }
+
+ /*
+ * Local mappings and abbreviations.
+ */
+ if ((*flagp & (SSOP_OPTIONS | SSOP_LOCALOPTIONS))
+ && makemap(fd, wp->w_buffer) == FAIL)
+ return FAIL;
+
+ /*
+ * Local options. Need to go to the window temporarily.
+ * Store only local values when using ":mkview" and when ":mksession" is
+ * used and 'sessionoptions' doesn't include "options".
+ * Some folding options are always stored when "folds" is included,
+ * otherwise the folds would not be restored correctly.
+ */
+ save_curwin = curwin;
+ curwin = wp;
+ curbuf = curwin->w_buffer;
+ if (*flagp & (SSOP_OPTIONS | SSOP_LOCALOPTIONS))
+ f = makeset(fd, OPT_LOCAL,
+ flagp == &vop_flags || !(*flagp & SSOP_OPTIONS));
+#ifdef FEAT_FOLDING
+ else if (*flagp & SSOP_FOLDS)
+ f = makefoldset(fd);
+#endif
+ else
+ f = OK;
+ curwin = save_curwin;
+ curbuf = curwin->w_buffer;
+ if (f == FAIL)
+ return FAIL;
+
+#ifdef FEAT_FOLDING
+ /*
+ * Save Folds when 'buftype' is empty and for help files.
+ */
+ if ((*flagp & SSOP_FOLDS)
+ && wp->w_buffer->b_ffname != NULL
+ && (*wp->w_buffer->b_p_bt == NUL || wp->w_buffer->b_help))
+ {
+ if (put_folds(fd, wp) == FAIL)
+ return FAIL;
+ }
+#endif
+
+ /*
+ * Set the cursor after creating folds, since that moves the cursor.
+ */
+ if (do_cursor)
+ {
+
+ /* Restore the cursor line in the file and relatively in the
+ * window. Don't use "G", it changes the jumplist. */
+ if (fprintf(fd, "let s:l = %ld - ((%ld * winheight(0) + %ld) / %ld)",
+ (long)wp->w_cursor.lnum,
+ (long)(wp->w_cursor.lnum - wp->w_topline),
+ (long)wp->w_height / 2, (long)wp->w_height) < 0
+ || put_eol(fd) == FAIL
+ || put_line(fd, "if s:l < 1 | let s:l = 1 | endif") == FAIL
+ || put_line(fd, "exe s:l") == FAIL
+ || put_line(fd, "normal! zt") == FAIL
+ || fprintf(fd, "%ld", (long)wp->w_cursor.lnum) < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ /* Restore the cursor column and left offset when not wrapping. */
+ if (wp->w_cursor.col == 0)
+ {
+ if (put_line(fd, "normal! 0") == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ if (!wp->w_p_wrap && wp->w_leftcol > 0 && wp->w_width > 0)
+ {
+ if (fprintf(fd,
+ "let s:c = %ld - ((%ld * winwidth(0) + %ld) / %ld)",
+ (long)wp->w_cursor.col,
+ (long)(wp->w_cursor.col - wp->w_leftcol),
+ (long)wp->w_width / 2, (long)wp->w_width) < 0
+ || put_eol(fd) == FAIL
+ || put_line(fd, "if s:c > 0") == FAIL
+ || fprintf(fd,
+ " exe 'normal! 0' . s:c . 'lzs' . (%ld - s:c) . 'l'",
+ (long)wp->w_cursor.col) < 0
+ || put_eol(fd) == FAIL
+ || put_line(fd, "else") == FAIL
+ || fprintf(fd, " normal! 0%dl", wp->w_cursor.col) < 0
+ || put_eol(fd) == FAIL
+ || put_line(fd, "endif") == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ if (fprintf(fd, "normal! 0%dl", wp->w_cursor.col) < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+ }
+ }
+
+ /*
+ * Local directory.
+ */
+ if (wp->w_localdir != NULL)
+ {
+ if (fputs("lcd ", fd) < 0
+ || ses_put_fname(fd, wp->w_localdir, flagp) == FAIL
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+
+ return OK;
+}
+
+/*
+ * Write an argument list to the session file.
+ * Returns FAIL if writing fails.
+ */
+ static int
+ses_arglist(fd, cmd, gap, fullname, flagp)
+ FILE *fd;
+ char *cmd;
+ garray_T *gap;
+ int fullname; /* TRUE: use full path name */
+ unsigned *flagp;
+{
+ int i;
+ char_u buf[MAXPATHL];
+ char_u *s;
+
+ if (gap->ga_len == 0)
+ return put_line(fd, "silent! argdel *");
+ if (fputs(cmd, fd) < 0)
+ return FAIL;
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ /* NULL file names are skipped (only happens when out of memory). */
+ s = alist_name(&((aentry_T *)gap->ga_data)[i]);
+ if (s != NULL)
+ {
+ if (fullname)
+ {
+ (void)vim_FullName(s, buf, MAXPATHL, FALSE);
+ s = buf;
+ }
+ if (fputs(" ", fd) < 0 || ses_put_fname(fd, s, flagp) == FAIL)
+ return FAIL;
+ }
+ }
+ return put_eol(fd);
+}
+
+/*
+ * Write a buffer name to the session file.
+ * Also ends the line.
+ * Returns FAIL if writing fails.
+ */
+ static int
+ses_fname(fd, buf, flagp)
+ FILE *fd;
+ buf_T *buf;
+ unsigned *flagp;
+{
+ char_u *name;
+
+ /* Use the short file name if the current directory is known at the time
+ * the session file will be sourced. Don't do this for ":mkview", we
+ * don't know the current directory. */
+ if (buf->b_sfname != NULL
+ && flagp == &ssop_flags
+ && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR)))
+ name = buf->b_sfname;
+ else
+ name = buf->b_ffname;
+ if (ses_put_fname(fd, name, flagp) == FAIL || put_eol(fd) == FAIL)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Write a file name to the session file.
+ * Takes care of the "slash" option in 'sessionoptions' and escapes special
+ * characters.
+ * Returns FAIL if writing fails.
+ */
+ static int
+ses_put_fname(fd, name, flagp)
+ FILE *fd;
+ char_u *name;
+ unsigned *flagp;
+{
+ char_u *sname;
+ int retval = OK;
+ int c;
+
+ sname = home_replace_save(NULL, name);
+ if (sname != NULL)
+ name = sname;
+ while (*name != NUL)
+ {
+#ifdef FEAT_MBYTE
+ {
+ int l;
+
+ if (has_mbyte && (l = (*mb_ptr2len_check)(name)) > 1)
+ {
+ /* copy a multibyte char */
+ while (--l >= 0)
+ {
+ if (putc(*name, fd) != *name)
+ retval = FAIL;
+ ++name;
+ }
+ continue;
+ }
+ }
+#endif
+ c = *name++;
+ if (c == '\\' && (*flagp & SSOP_SLASH))
+ /* change a backslash to a forward slash */
+ c = '/';
+ else if ((vim_strchr(escape_chars, c) != NULL
+#ifdef BACKSLASH_IN_FILENAME
+ && c != '\\'
+#endif
+ ) || c == '#' || c == '%')
+ {
+ /* escape a special character with a backslash */
+ if (putc('\\', fd) != '\\')
+ retval = FAIL;
+ }
+ if (putc(c, fd) != c)
+ retval = FAIL;
+ }
+ vim_free(sname);
+ return retval;
+}
+
+/*
+ * ":loadview [nr]"
+ */
+ static void
+ex_loadview(eap)
+ exarg_T *eap;
+{
+ char_u *fname;
+
+ fname = get_view_file(*eap->arg);
+ if (fname != NULL)
+ {
+ do_source(fname, FALSE, FALSE);
+ vim_free(fname);
+ }
+}
+
+/*
+ * Get the name of the view file for the current buffer.
+ */
+ static char_u *
+get_view_file(c)
+ int c;
+{
+ int len = 0;
+ char_u *p, *s;
+ char_u *retval;
+ char_u *sname;
+
+ if (curbuf->b_ffname == NULL)
+ {
+ EMSG(_(e_noname));
+ return NULL;
+ }
+ sname = home_replace_save(NULL, curbuf->b_ffname);
+ if (sname == NULL)
+ return NULL;
+
+ /*
+ * We want a file name without separators, because we're not going to make
+ * a directory.
+ * "normal" path separator -> "=+"
+ * "=" -> "=="
+ * ":" path separator -> "=-"
+ */
+ for (p = sname; *p; ++p)
+ if (*p == '=' || vim_ispathsep(*p))
+ ++len;
+ retval = alloc((unsigned)(STRLEN(sname) + len + STRLEN(p_vdir) + 9));
+ if (retval != NULL)
+ {
+ STRCPY(retval, p_vdir);
+ add_pathsep(retval);
+ s = retval + STRLEN(retval);
+ for (p = sname; *p; ++p)
+ {
+ if (*p == '=')
+ {
+ *s++ = '=';
+ *s++ = '=';
+ }
+ else if (vim_ispathsep(*p))
+ {
+ *s++ = '=';
+#ifdef MACOS_CLASSIC /* TODO: Is it also needed for MACOS_X? (Dany) */
+ *s++ = '+';
+#else
+# if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) || defined(RISCOS) \
+ || defined(VMS)
+ if (*p == ':')
+ *s++ = '-';
+ else
+# endif
+ *s++ = '+';
+#endif
+ }
+ else
+ *s++ = *p;
+ }
+ *s++ = '=';
+ *s++ = c;
+ STRCPY(s, ".vim");
+ }
+
+ vim_free(sname);
+ return retval;
+}
+
+#endif /* FEAT_SESSION */
+
+/*
+ * Write end-of-line character(s) for ":mkexrc", ":mkvimrc" and ":mksession".
+ * Return FAIL for a write error.
+ */
+ int
+put_eol(fd)
+ FILE *fd;
+{
+ if (
+#ifdef USE_CRNL
+ (
+# ifdef MKSESSION_NL
+ !mksession_nl &&
+# endif
+ (putc('\r', fd) < 0)) ||
+#endif
+ (putc('\n', fd) < 0))
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Write a line to "fd".
+ * Return FAIL for a write error.
+ */
+ int
+put_line(fd, s)
+ FILE *fd;
+ char *s;
+{
+ if (fputs(s, fd) < 0 || put_eol(fd) == FAIL)
+ return FAIL;
+ return OK;
+}
+
+#ifdef FEAT_VIMINFO
+/*
+ * ":rviminfo" and ":wviminfo".
+ */
+ static void
+ex_viminfo(eap)
+ exarg_T *eap;
+{
+ char_u *save_viminfo;
+
+ save_viminfo = p_viminfo;
+ if (*p_viminfo == NUL)
+ p_viminfo = (char_u *)"'100";
+ if (eap->cmdidx == CMD_rviminfo)
+ {
+ if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL)
+ EMSG(_("E195: Cannot open viminfo file for reading"));
+ }
+ else
+ write_viminfo(eap->arg, eap->forceit);
+ p_viminfo = save_viminfo;
+}
+#endif
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
+ void
+dialog_msg(buff, format, fname)
+ char_u *buff;
+ char *format;
+ char_u *fname;
+{
+ int len;
+
+ if (fname == NULL)
+ fname = (char_u *)_("Untitled");
+ len = (int)STRLEN(format) + (int)STRLEN(fname);
+ if (len >= IOSIZE)
+ sprintf((char *)buff, format, (int)(IOSIZE - STRLEN(format)), fname);
+ else
+ sprintf((char *)buff, format, (int)STRLEN(fname), fname);
+}
+#endif
+
+/*
+ * ":behave {mswin,xterm}"
+ */
+ static void
+ex_behave(eap)
+ exarg_T *eap;
+{
+ if (STRCMP(eap->arg, "mswin") == 0)
+ {
+ set_option_value((char_u *)"selection", 0L, (char_u *)"exclusive", 0);
+ set_option_value((char_u *)"selectmode", 0L, (char_u *)"mouse,key", 0);
+ set_option_value((char_u *)"mousemodel", 0L, (char_u *)"popup", 0);
+ set_option_value((char_u *)"keymodel", 0L,
+ (char_u *)"startsel,stopsel", 0);
+ }
+ else if (STRCMP(eap->arg, "xterm") == 0)
+ {
+ set_option_value((char_u *)"selection", 0L, (char_u *)"inclusive", 0);
+ set_option_value((char_u *)"selectmode", 0L, (char_u *)"", 0);
+ set_option_value((char_u *)"mousemodel", 0L, (char_u *)"extend", 0);
+ set_option_value((char_u *)"keymodel", 0L, (char_u *)"", 0);
+ }
+ else
+ EMSG2(_(e_invarg2), eap->arg);
+}
+
+#ifdef FEAT_AUTOCMD
+static int filetype_detect = FALSE;
+static int filetype_plugin = FALSE;
+static int filetype_indent = FALSE;
+
+/*
+ * ":filetype [plugin] [indent] {on,off,detect}"
+ * on: Load the filetype.vim file to install autocommands for file types.
+ * off: Load the ftoff.vim file to remove all autocommands for file types.
+ * plugin on: load filetype.vim and ftplugin.vim
+ * plugin off: load ftplugof.vim
+ * indent on: load filetype.vim and indent.vim
+ * indent off: load indoff.vim
+ */
+ static void
+ex_filetype(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ int plugin = FALSE;
+ int indent = FALSE;
+
+ if (*eap->arg == NUL)
+ {
+ /* Print current status. */
+ smsg((char_u *)"filetype detection:%s plugin:%s indent:%s",
+ filetype_detect ? "ON" : "OFF",
+ filetype_plugin ? (filetype_detect ? "ON" : "(on)") : "OFF",
+ filetype_indent ? (filetype_detect ? "ON" : "(on)") : "OFF");
+ return;
+ }
+
+ /* Accept "plugin" and "indent" in any order. */
+ for (;;)
+ {
+ if (STRNCMP(arg, "plugin", 6) == 0)
+ {
+ plugin = TRUE;
+ arg = skipwhite(arg + 6);
+ continue;
+ }
+ if (STRNCMP(arg, "indent", 6) == 0)
+ {
+ indent = TRUE;
+ arg = skipwhite(arg + 6);
+ continue;
+ }
+ break;
+ }
+ if (STRCMP(arg, "on") == 0 || STRCMP(arg, "detect") == 0)
+ {
+ if (*arg == 'o' || !filetype_detect)
+ {
+ cmd_runtime((char_u *)FILETYPE_FILE, TRUE);
+ filetype_detect = TRUE;
+ if (plugin)
+ {
+ cmd_runtime((char_u *)FTPLUGIN_FILE, TRUE);
+ filetype_plugin = TRUE;
+ }
+ if (indent)
+ {
+ cmd_runtime((char_u *)INDENT_FILE, TRUE);
+ filetype_indent = TRUE;
+ }
+ }
+ if (*arg == 'd')
+ {
+ (void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE);
+ do_modelines();
+ }
+ }
+ else if (STRCMP(arg, "off") == 0)
+ {
+ if (plugin || indent)
+ {
+ if (plugin)
+ {
+ cmd_runtime((char_u *)FTPLUGOF_FILE, TRUE);
+ filetype_plugin = FALSE;
+ }
+ if (indent)
+ {
+ cmd_runtime((char_u *)INDOFF_FILE, TRUE);
+ filetype_indent = FALSE;
+ }
+ }
+ else
+ {
+ cmd_runtime((char_u *)FTOFF_FILE, TRUE);
+ filetype_detect = FALSE;
+ }
+ }
+ else
+ EMSG2(_(e_invarg2), arg);
+}
+
+/*
+ * ":setfiletype {name}"
+ */
+ static void
+ex_setfiletype(eap)
+ exarg_T *eap;
+{
+ if (!did_filetype)
+ set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
+}
+#endif
+
+/*ARGSUSED*/
+ static void
+ex_digraphs(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_DIGRAPHS
+ if (*eap->arg != NUL)
+ putdigraph(eap->arg);
+ else
+ listdigraphs();
+#else
+ EMSG(_("E196: No digraphs in this version"));
+#endif
+}
+
+ static void
+ex_set(eap)
+ exarg_T *eap;
+{
+ int flags = 0;
+
+ if (eap->cmdidx == CMD_setlocal)
+ flags = OPT_LOCAL;
+ else if (eap->cmdidx == CMD_setglobal)
+ flags = OPT_GLOBAL;
+#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD) && defined(FEAT_BROWSE)
+ if (cmdmod.browse && flags == 0)
+ ex_options(eap);
+ else
+#endif
+ (void)do_set(eap->arg, flags);
+}
+
+#ifdef FEAT_SEARCH_EXTRA
+/*
+ * ":nohlsearch"
+ */
+/*ARGSUSED*/
+ static void
+ex_nohlsearch(eap)
+ exarg_T *eap;
+{
+ no_hlsearch = TRUE;
+ redraw_all_later(NOT_VALID);
+}
+
+/*
+ * ":match {group} {pattern}"
+ * Sets nextcmd to the start of the next command, if any. Also called when
+ * skipping commands to find the next command.
+ */
+ static void
+ex_match(eap)
+ exarg_T *eap;
+{
+ char_u *p;
+ char_u *end;
+ int c;
+
+ /* First clear any old pattern. */
+ if (!eap->skip)
+ {
+ vim_free(curwin->w_match.regprog);
+ curwin->w_match.regprog = NULL;
+ redraw_later(NOT_VALID); /* always need a redraw */
+ }
+
+ if (ends_excmd(*eap->arg))
+ end = eap->arg;
+ else if ((STRNICMP(eap->arg, "none", 4) == 0
+ && (vim_iswhite(eap->arg[4]) || ends_excmd(eap->arg[4]))))
+ end = eap->arg + 4;
+ else
+ {
+ p = skiptowhite(eap->arg);
+ if (!eap->skip)
+ {
+ curwin->w_match_id = syn_namen2id(eap->arg, (int)(p - eap->arg));
+ if (curwin->w_match_id == 0)
+ {
+ EMSG2(_(e_nogroup), eap->arg);
+ return;
+ }
+ }
+ p = skipwhite(p);
+ if (*p == NUL)
+ {
+ /* There must be two arguments. */
+ EMSG2(_(e_invarg2), eap->arg);
+ return;
+ }
+ end = skip_regexp(p + 1, *p, TRUE, NULL);
+ if (!eap->skip)
+ {
+ if (*end != NUL && !ends_excmd(*skipwhite(end + 1)))
+ {
+ eap->errmsg = e_trailing;
+ return;
+ }
+
+ c = *end;
+ *end = NUL;
+ curwin->w_match.regprog = vim_regcomp(p + 1, RE_MAGIC);
+ *end = c;
+ if (curwin->w_match.regprog == NULL)
+ {
+ EMSG2(_(e_invarg2), p);
+ return;
+ }
+ }
+ }
+ eap->nextcmd = find_nextcmd(end);
+}
+#endif
+
+#ifdef FEAT_CRYPT
+/*
+ * ":X": Get crypt key
+ */
+/*ARGSUSED*/
+ static void
+ex_X(eap)
+ exarg_T *eap;
+{
+ (void)get_crypt_key(TRUE, TRUE);
+}
+#endif
+
+#ifdef FEAT_FOLDING
+ static void
+ex_fold(eap)
+ exarg_T *eap;
+{
+ if (foldManualAllowed(TRUE))
+ foldCreate(eap->line1, eap->line2);
+}
+
+ static void
+ex_foldopen(eap)
+ exarg_T *eap;
+{
+ opFoldRange(eap->line1, eap->line2, eap->cmdidx == CMD_foldopen,
+ eap->forceit, FALSE);
+}
+
+ static void
+ex_folddo(eap)
+ exarg_T *eap;
+{
+ linenr_T lnum;
+
+ /* First set the marks for all lines closed/open. */
+ for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
+ if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
+ ml_setmarked(lnum);
+
+ /* Execute the command on the marked lines. */
+ global_exe(eap->arg);
+ ml_clearmarked(); /* clear rest of the marks */
+}
+#endif
diff --git a/src/ex_eval.c b/src/ex_eval.c
new file mode 100644
index 000000000..921d60867
--- /dev/null
+++ b/src/ex_eval.c
@@ -0,0 +1,2004 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ex_eval.c: functions for Ex command line for the +eval feature.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+static void free_msglist __ARGS((struct msglist *l));
+static int throw_exception __ARGS((void *, int, char_u *));
+static void rewind_conditionals __ARGS((struct condstack *,
+ int, int, int *));
+
+/*
+ * Exception handling terms:
+ *
+ * :try ":try" command \
+ * ... try block |
+ * :catch RE ":catch" command |
+ * ... catch clause |- try conditional
+ * :finally ":finally" command |
+ * ... finally clause |
+ * :endtry ":endtry" command /
+ *
+ * The try conditional may have any number of catch clauses and at most one
+ * finally clause. A ":throw" command can be inside the try block, a catch
+ * clause, the finally clause, or in a function called or script sourced from
+ * there or even outside the try conditional. Try conditionals may be nested.
+ */
+
+/*
+ * Configuration whether an exception is thrown on error or interrupt. When
+ * the preprocessor macros below evaluate to FALSE, an error (did_emsg) or
+ * interrupt (got_int) under an active try conditional terminates the script
+ * after the non-active finally clauses of all active try conditionals have been
+ * executed. Otherwise, errors and/or interrupts are converted into catchable
+ * exceptions (did_throw additionally set), which terminate the script only if
+ * not caught. For user exceptions, only did_throw is set. (Note: got_int can
+ * be set asyncronously afterwards by a SIGINT, so did_throw && got_int is not
+ * a reliant test that the exception currently being thrown is an interrupt
+ * exception. Similarly, did_emsg can be set afterwards on an error in an
+ * (unskipped) conditional command inside an inactive conditional, so did_throw
+ * && did_emsg is not a reliant test that the exception currently being thrown
+ * is an error exception.) - The macros can be defined as expressions checking
+ * for a variable that is allowed to be changed during execution of a script.
+ */
+#if 0
+/* Expressions used for testing during the development phase. */
+# define THROW_ON_ERROR (!eval_to_number("$VIMNOERRTHROW"))
+# define THROW_ON_INTERRUPT (!eval_to_number("$VIMNOINTTHROW"))
+# define THROW_TEST
+#else
+/* Values used for the Vim release. */
+# define THROW_ON_ERROR TRUE
+# define THROW_ON_INTERRUPT TRUE
+#endif
+
+static void catch_exception __ARGS((except_T *excp));
+static void finish_exception __ARGS((except_T *excp));
+static void discard_exception __ARGS((except_T *excp, int was_finished));
+static void report_pending __ARGS((int action, int pending, void *value));
+
+/*
+ * When several errors appear in a row, setting "force_abort" is delayed until
+ * the failing command returned. "cause_abort" is set to TRUE meanwhile, in
+ * order to indicate that situation. This is useful when "force_abort" was set
+ * during execution of a function call from an expression: the aborting of the
+ * expression evaluation is done without producing any error messages, but all
+ * error messages on parsing errors during the expression evaluation are given
+ * (even if a try conditional is active).
+ */
+static int cause_abort = FALSE;
+
+/*
+ * Return TRUE when immdediately aborting on error, or when an interrupt
+ * occurred or an exception was thrown but not caught. Use for ":{range}call"
+ * to check whether an aborted function that does not handle a range itself
+ * should be called again for the next line in the range. Also used for
+ * cancelling expression evaluation after a function call caused an immediate
+ * abort. Note that the first emsg() call temporarily resets "force_abort"
+ * until the throw point for error messages has been reached. That is, during
+ * cancellation of an expression evaluation after an aborting function call or
+ * due to a parsing error, aborting() always returns the same value.
+ */
+ int
+aborting()
+{
+ return (did_emsg && force_abort) || got_int || did_throw;
+}
+
+/*
+ * The value of "force_abort" is temporarily reset by the first emsg() call
+ * during an expression evaluation, and "cause_abort" is used instead. It might
+ * be necessary to restore "force_abort" even before the throw point for the
+ * error message has been reached. update_force_abort() should be called then.
+ */
+ void
+update_force_abort()
+{
+ if (cause_abort)
+ force_abort = TRUE;
+}
+
+/*
+ * Return TRUE if a command with a subcommand resulting in "retcode" should
+ * abort the script processing. Can be used to suppress an autocommand after
+ * execution of a failing subcommand as long as the error message has not been
+ * displayed and actually caused the abortion.
+ */
+ int
+should_abort(retcode)
+ int retcode;
+{
+ return ((retcode == FAIL && trylevel != 0 && !emsg_silent) || aborting());
+}
+
+/*
+ * Return TRUE if a function with the "abort" flag should not be considered
+ * ended on an error. This means that parsing commands is continued in order
+ * to find finally clauses to be executed, and that some errors in skipped
+ * commands are still reported.
+ */
+ int
+aborted_in_try()
+{
+ /* This function is only called after an error. In this case, "force_abort"
+ * determines whether searching for finally clauses is necessary. */
+ return force_abort;
+}
+
+/*
+ * cause_errthrow(): Cause a throw of an error exception if appropriate.
+ * Return TRUE if the error message should not be displayed by emsg().
+ * Sets "ignore", if the emsg() call should be ignored completely.
+ *
+ * When several messages appear in the same command, the first is usually the
+ * most specific one and used as the exception value. The "severe" flag can be
+ * set to TRUE, if a later but severer message should be used instead.
+ */
+ int
+cause_errthrow(mesg, severe, ignore)
+ char_u *mesg;
+ int severe;
+ int *ignore;
+{
+ struct msglist *elem;
+ struct msglist **plist;
+
+ /*
+ * Do nothing when displaying the interrupt message or reporting an uncaught
+ * exception (which has already been discarded then) at the top level. Also
+ * when no exception can be thrown. The message will be displayed by
+ * emsg().
+ */
+ if (suppress_errthrow)
+ return FALSE;
+
+ /*
+ * If emsg() has not been called previously, temporarily reset "force_abort"
+ * until the throw point for error messages has been reached. This ensures
+ * that aborting() returns the same value for all errors that appear in the
+ * same command. This means particularly that for parsing errors during
+ * expression evaluation emsg() will be called multiply, even when the
+ * expression is evaluated from a finally clause that was activated due to
+ * an aborting error, interrupt, or exception.
+ */
+ if (!did_emsg)
+ {
+ cause_abort = force_abort;
+ force_abort = FALSE;
+ }
+
+ /*
+ * If no try conditional is active and no exception is being thrown and
+ * there has not been an error in a try conditional or a throw so far, do
+ * nothing (for compatibility of non-EH scripts). The message will then be
+ * displayed by emsg(). When ":silent!" was used and we are not currently
+ * throwing an exception, do nothing. The message text will then be stored
+ * to v:errmsg by emsg() without displaying it.
+ */
+ if (((trylevel == 0 && !cause_abort) || emsg_silent) && !did_throw)
+ return FALSE;
+
+ /*
+ * Ignore an interrupt message when inside a try conditional or when an
+ * exception is being thrown or when an error in a try conditional or throw
+ * has been detected previously. This is important in order that an
+ * interrupt exception is catchable by the innermost try conditional and
+ * not replaced by an interrupt message error exception.
+ */
+ if (mesg == (char_u *)_(e_interr))
+ {
+ *ignore = TRUE;
+ return TRUE;
+ }
+
+ /*
+ * Ensure that all commands in nested function calls and sourced files
+ * are aborted immediately.
+ */
+ cause_abort = TRUE;
+
+ /*
+ * When an exception is being thrown, some commands (like conditionals) are
+ * not skipped. Errors in those commands may affect what of the subsequent
+ * commands are regarded part of catch and finally clauses. Catching the
+ * exception would then cause execution of commands not intended by the
+ * user, who wouldn't even get aware of the problem. Therefor, discard the
+ * exception currently being thrown to prevent it from being caught. Just
+ * execute finally clauses and terminate.
+ */
+ if (did_throw)
+ {
+ /* When discarding an interrupt exception, reset got_int to prevent the
+ * same interrupt being converted to an exception again and discarding
+ * the error exception we are about to throw here. */
+ if (current_exception->type == ET_INTERRUPT)
+ got_int = FALSE;
+ discard_current_exception();
+ }
+
+#ifdef THROW_TEST
+ if (!THROW_ON_ERROR)
+ {
+ /*
+ * Print error message immediately without searching for a matching
+ * catch clause; just finally clauses are executed before the script
+ * is terminated.
+ */
+ return FALSE;
+ }
+ else
+#endif
+ {
+ /*
+ * Prepare the throw of an error exception, so that everything will
+ * be aborted (except for executing finally clauses), until the error
+ * exception is caught; if still uncaught at the top level, the error
+ * message will be displayed and the script processing terminated
+ * then. - This function has no access to the conditional stack.
+ * Thus, the actual throw is made after the failing command has
+ * returned. - Throw only the first of several errors in a row, except
+ * a severe error is following.
+ */
+ if (msg_list != NULL)
+ {
+ plist = msg_list;
+ while (*plist != NULL)
+ plist = &(*plist)->next;
+
+ elem = (struct msglist *)alloc((unsigned)sizeof(struct msglist));
+ if (elem == NULL)
+ {
+ suppress_errthrow = TRUE;
+ EMSG(_(e_outofmem));
+ }
+ else
+ {
+ elem->msg = vim_strsave(mesg);
+ if (elem->msg == NULL)
+ {
+ vim_free(elem);
+ suppress_errthrow = TRUE;
+ EMSG(_(e_outofmem));
+ }
+ else
+ {
+ elem->next = NULL;
+ elem->throw_msg = NULL;
+ *plist = elem;
+ if (plist == msg_list || severe)
+ {
+ char_u *tmsg;
+
+ /* Skip the extra "Vim " prefix for message "E458". */
+ tmsg = elem->msg;
+ if (STRNCMP(tmsg, "Vim E", 5) == 0
+ && VIM_ISDIGIT(tmsg[5])
+ && VIM_ISDIGIT(tmsg[6])
+ && VIM_ISDIGIT(tmsg[7])
+ && tmsg[8] == ':'
+ && tmsg[9] == ' ')
+ (*msg_list)->throw_msg = &tmsg[4];
+ else
+ (*msg_list)->throw_msg = tmsg;
+ }
+ }
+ }
+ }
+ return TRUE;
+ }
+}
+
+/*
+ * Free a "msg_list" and the messages it contains.
+ */
+ static void
+free_msglist(l)
+ struct msglist *l;
+{
+ struct msglist *messages, *next;
+
+ messages = l;
+ while (messages != NULL)
+ {
+ next = messages->next;
+ vim_free(messages->msg);
+ vim_free(messages);
+ messages = next;
+ }
+}
+
+/*
+ * Throw the message specified in the call to cause_errthrow() above as an
+ * error exception. If cstack is NULL, postpone the throw until do_cmdline()
+ * has returned (see do_one_cmd()).
+ */
+ void
+do_errthrow(cstack, cmdname)
+ struct condstack *cstack;
+ char_u *cmdname;
+{
+ /*
+ * Ensure that all commands in nested function calls and sourced files
+ * are aborted immediately.
+ */
+ if (cause_abort)
+ {
+ cause_abort = FALSE;
+ force_abort = TRUE;
+ }
+
+ /* If no exception is to be thrown or the conversion should be done after
+ * returning to a previous invocation of do_one_cmd(), do nothing. */
+ if (*msg_list == NULL)
+ return;
+
+ if (throw_exception(*msg_list, ET_ERROR, cmdname) == FAIL)
+ free_msglist(*msg_list);
+ else
+ {
+ if (cstack != NULL)
+ do_throw(cstack);
+ else
+ need_rethrow = TRUE;
+ }
+ *msg_list = NULL;
+}
+
+/*
+ * do_intthrow(): Replace the current exception by an interrupt or interrupt
+ * exception if appropriate. Return TRUE if the current exception is discarded,
+ * FALSE otherwise.
+ */
+ int
+do_intthrow(cstack)
+ struct condstack *cstack;
+{
+ /*
+ * If no interrupt occurred or no try conditional is active and no exception
+ * is being thrown, do nothing (for compatibility of non-EH scripts).
+ */
+ if (!got_int || (trylevel == 0 && !did_throw))
+ return FALSE;
+
+#ifdef THROW_TEST /* avoid warning for condition always true */
+ if (!THROW_ON_INTERRUPT)
+ {
+ /*
+ * The interrupt aborts everything except for executing finally clauses.
+ * Discard any user or error or interrupt exception currently being
+ * thrown.
+ */
+ if (did_throw)
+ discard_current_exception();
+ }
+ else
+#endif
+ {
+ /*
+ * Throw an interrupt exception, so that everything will be aborted
+ * (except for executing finally clauses), until the interrupt exception
+ * is caught; if still uncaught at the top level, the script processing
+ * will be terminated then. - If an interrupt exception is already
+ * being thrown, do nothing.
+ *
+ */
+ if (did_throw)
+ {
+ if (current_exception->type == ET_INTERRUPT)
+ return FALSE;
+
+ /* An interrupt exception replaces any user or error exception. */
+ discard_current_exception();
+ }
+ if (throw_exception("Vim:Interrupt", ET_INTERRUPT, NULL) != FAIL)
+ do_throw(cstack);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Throw a new exception. Return FAIL when out of memory or it was tried to
+ * throw an illegal user exception. "value" is the exception string for a user
+ * or interrupt exception, or points to a message list in case of an error
+ * exception.
+ */
+ static int
+throw_exception(value, type, cmdname)
+ void *value;
+ int type;
+ char_u *cmdname;
+{
+ except_T *excp;
+ char_u *p, *mesg, *val;
+ int cmdlen;
+
+ /*
+ * Disallow faking Interrupt or error exceptions as user exceptions. They
+ * would be treated differently from real interrupt or error exceptions when
+ * no active try block is found, see do_cmdline().
+ */
+ if (type == ET_USER)
+ {
+ if (STRNCMP((char_u *)value, "Vim", 3) == 0 &&
+ (((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':' ||
+ ((char_u *)value)[3] == '('))
+ {
+ EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
+ goto fail;
+ }
+ }
+
+ excp = (except_T *)alloc((unsigned)sizeof(except_T));
+ if (excp == NULL)
+ goto nomem;
+
+ if (type == ET_ERROR)
+ {
+ /* Store the original message and prefix the exception value with
+ * "Vim:" or, if a command name is given, "Vim(cmdname):". */
+ excp->messages = (struct msglist *)value;
+ mesg = excp->messages->throw_msg;
+ if (cmdname != NULL && *cmdname != NUL)
+ {
+ cmdlen = STRLEN(cmdname);
+ excp->value = vim_strnsave((char_u *)"Vim(",
+ 4 + cmdlen + 2 + (int)STRLEN(mesg));
+ if (excp->value == NULL)
+ goto nomem;
+ STRCPY(&excp->value[4], cmdname);
+ STRCPY(&excp->value[4 + cmdlen], "):");
+ val = excp->value + 4 + cmdlen + 2;
+ }
+ else
+ {
+ excp->value = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
+ if (excp->value == NULL)
+ goto nomem;
+ val = excp->value + 4;
+ }
+
+ /* msg_add_fname may have been used to prefix the message with a file
+ * name in quotes. In the exception value, put the file name in
+ * parentheses and move it to the end. */
+ for (p = mesg; ; p++)
+ {
+ if (*p == NUL
+ || (*p == 'E'
+ && VIM_ISDIGIT(p[1])
+ && (p[2] == ':'
+ || (VIM_ISDIGIT(p[2])
+ && (p[3] == ':'
+ || (VIM_ISDIGIT(p[3])
+ && p[4] == ':'))))))
+ {
+ if (*p == NUL || p == mesg) /* 'E123' missing or at beginning */
+ STRCAT(val, mesg);
+ else
+ {
+ /* '"filename" E123: message text' */
+ if (mesg[0] != '"' || p-2 < &mesg[1] ||
+ p[-2] != '"' || p[-1] != ' ')
+ /* "E123:" is part of the file name. */
+ continue;
+
+ STRCAT(val, p);
+ p[-2] = NUL;
+ sprintf((char *)(val + STRLEN(p)), " (%s)", &mesg[1]);
+ p[-2] = '"';
+ }
+ break;
+ }
+ }
+ }
+ else
+ excp->value = value;
+
+ excp->type = type;
+ excp->throw_name = vim_strsave(sourcing_name == NULL
+ ? (char_u *)"" : sourcing_name);
+ if (excp->throw_name == NULL)
+ {
+ if (type == ET_ERROR)
+ vim_free(excp->value);
+ goto nomem;
+ }
+ excp->throw_lnum = sourcing_lnum;
+
+ if (p_verbose >= 13 || debug_break_level > 0)
+ {
+ int save_msg_silent = msg_silent;
+
+ if (debug_break_level > 0)
+ msg_silent = FALSE; /* display messages */
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str((char_u *)_("Exception thrown: %s"), excp->value);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ if (debug_break_level > 0)
+ msg_silent = save_msg_silent;
+ }
+
+ current_exception = excp;
+ return OK;
+
+nomem:
+ vim_free(excp);
+ suppress_errthrow = TRUE;
+ EMSG(_(e_outofmem));
+fail:
+ current_exception = NULL;
+ return FAIL;
+}
+
+/*
+ * Discard an exception. "was_finished" is set when the exception has been
+ * caught and the catch clause has been ended normally.
+ */
+ static void
+discard_exception(excp, was_finished)
+ except_T *excp;
+ int was_finished;
+{
+ char_u *saved_IObuff;
+
+ if (excp == NULL)
+ {
+ EMSG(_(e_internal));
+ return;
+ }
+
+ if (p_verbose >= 13 || debug_break_level > 0)
+ {
+ int save_msg_silent = msg_silent;
+
+ saved_IObuff = vim_strsave(IObuff);
+ if (debug_break_level > 0)
+ msg_silent = FALSE; /* display messages */
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str(was_finished
+ ? (char_u *)_("Exception finished: %s")
+ : (char_u *)_("Exception discarded: %s"),
+ excp->value);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ if (debug_break_level > 0)
+ msg_silent = save_msg_silent;
+ STRCPY(IObuff, saved_IObuff);
+ vim_free(saved_IObuff);
+ }
+ if (excp->type != ET_INTERRUPT)
+ vim_free(excp->value);
+ if (excp->type == ET_ERROR)
+ free_msglist(excp->messages);
+ vim_free(excp->throw_name);
+ vim_free(excp);
+}
+
+/*
+ * Discard the exception currently being thrown.
+ */
+ void
+discard_current_exception()
+{
+ discard_exception(current_exception, FALSE);
+ current_exception = NULL;
+ did_throw = FALSE;
+ need_rethrow = FALSE;
+}
+
+/*
+ * Put an exception on the caught stack.
+ */
+ static void
+catch_exception(excp)
+ except_T *excp;
+{
+ excp->caught = caught_stack;
+ caught_stack = excp;
+ set_vim_var_string(VV_EXCEPTION, excp->value, -1);
+ if (*excp->throw_name != NUL)
+ {
+ if (excp->throw_lnum != 0)
+ sprintf((char *)IObuff, _("%s, line %ld"), excp->throw_name,
+ (long)excp->throw_lnum);
+ else
+ STRCPY(IObuff, excp->throw_name);
+ set_vim_var_string(VV_THROWPOINT, IObuff, -1);
+ }
+ else
+ /* throw_name not set on an exception from a command that was typed. */
+ set_vim_var_string(VV_THROWPOINT, NULL, -1);
+
+ if (p_verbose >= 13 || debug_break_level > 0)
+ {
+ int save_msg_silent = msg_silent;
+
+ if (debug_break_level > 0)
+ msg_silent = FALSE; /* display messages */
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str((char_u *)_("Exception caught: %s"), excp->value);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ if (debug_break_level > 0)
+ msg_silent = save_msg_silent;
+ }
+}
+
+/*
+ * Remove an exception from the caught stack.
+ */
+ static void
+finish_exception(excp)
+ except_T *excp;
+{
+ if (excp != caught_stack)
+ EMSG(_(e_internal));
+ caught_stack = caught_stack->caught;
+ if (caught_stack != NULL)
+ {
+ set_vim_var_string(VV_EXCEPTION, caught_stack->value, -1);
+ if (*caught_stack->throw_name != NUL)
+ {
+ if (caught_stack->throw_lnum != 0)
+ sprintf((char *)IObuff,
+ _("%s, line %ld"), caught_stack->throw_name,
+ (long)caught_stack->throw_lnum);
+ else
+ STRCPY(IObuff, caught_stack->throw_name);
+ set_vim_var_string(VV_THROWPOINT, IObuff, -1);
+ }
+ else
+ /* throw_name not set on an exception from a command that was
+ * typed. */
+ set_vim_var_string(VV_THROWPOINT, NULL, -1);
+ }
+ else
+ {
+ set_vim_var_string(VV_EXCEPTION, NULL, -1);
+ set_vim_var_string(VV_THROWPOINT, NULL, -1);
+ }
+
+ /* Discard the exception, but use the finish message for 'verbose'. */
+ discard_exception(excp, TRUE);
+}
+
+/*
+ * Flags specifying the message displayed by report_pending.
+ */
+#define RP_MAKE 0
+#define RP_RESUME 1
+#define RP_DISCARD 2
+
+/*
+ * Report information about something pending in a finally clause if required by
+ * the 'verbose' option or when debugging. "action" tells whether something is
+ * made pending or something pending is resumed or discarded. "pending" tells
+ * what is pending. "value" specifies the return value for a pending ":return"
+ * or the exception value for a pending exception.
+ */
+ static void
+report_pending(action, pending, value)
+ int action;
+ int pending;
+ void *value;
+{
+ char_u *mesg;
+ char *s;
+ int save_msg_silent;
+
+
+ switch (action)
+ {
+ case RP_MAKE:
+ mesg = (char_u *)_("%s made pending");
+ break;
+ case RP_RESUME:
+ mesg = (char_u *)_("%s resumed");
+ break;
+ /* case RP_DISCARD: */
+ default:
+ mesg = (char_u *)_("%s discarded");
+ break;
+ }
+
+ switch (pending)
+ {
+ case CSTP_NONE:
+ return;
+
+ case CSTP_CONTINUE:
+ s = ":continue";
+ break;
+ case CSTP_BREAK:
+ s = ":break";
+ break;
+ case CSTP_FINISH:
+ s = ":finish";
+ break;
+ case CSTP_RETURN:
+ /* ":return" command producing value, allocated */
+ s = (char *)get_return_cmd(value);
+ break;
+
+ default:
+ if (pending & CSTP_THROW)
+ {
+ sprintf((char *)IObuff, (char *)mesg, _("Exception"));
+ mesg = vim_strnsave(IObuff, (int)STRLEN(IObuff) + 4);
+ STRCAT(mesg, ": %s");
+ s = (char *)((except_T *)value)->value;
+ }
+ else if ((pending & CSTP_ERROR) && (pending & CSTP_INTERRUPT))
+ s = _("Error and interrupt");
+ else if (pending & CSTP_ERROR)
+ s = _("Error");
+ else /* if (pending & CSTP_INTERRUPT) */
+ s = _("Interrupt");
+ }
+
+ save_msg_silent = msg_silent;
+ if (debug_break_level > 0)
+ msg_silent = FALSE; /* display messages */
+ ++no_wait_return;
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str(mesg, (char_u *)s);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ --no_wait_return;
+ if (debug_break_level > 0)
+ msg_silent = save_msg_silent;
+
+ if (pending == CSTP_RETURN)
+ vim_free(s);
+ else if (pending & CSTP_THROW)
+ vim_free(mesg);
+}
+
+/*
+ * If something is made pending in a finally clause, report it if required by
+ * the 'verbose' option or when debugging.
+ */
+ void
+report_make_pending(pending, value)
+ int pending;
+ void *value;
+{
+ if (p_verbose >= 14 || debug_break_level > 0)
+ report_pending(RP_MAKE, pending, value);
+}
+
+/*
+ * If something pending in a finally clause is resumed at the ":endtry", report
+ * it if required by the 'verbose' option or when debugging.
+ */
+ void
+report_resume_pending(pending, value)
+ int pending;
+ void *value;
+{
+ if (p_verbose >= 14 || debug_break_level > 0)
+ report_pending(RP_RESUME, pending, value);
+}
+
+/*
+ * If something pending in a finally clause is discarded, report it if required
+ * by the 'verbose' option or when debugging.
+ */
+ void
+report_discard_pending(pending, value)
+ int pending;
+ void *value;
+{
+ if (p_verbose >= 14 || debug_break_level > 0)
+ report_pending(RP_DISCARD, pending, value);
+}
+
+
+/*
+ * ":if".
+ */
+ void
+ex_if(eap)
+ exarg_T *eap;
+{
+ int error;
+ int skip;
+ int result;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_idx == CSTACK_LEN - 1)
+ eap->errmsg = (char_u *)N_("E579: :if nesting too deep");
+ else
+ {
+ ++cstack->cs_idx;
+ cstack->cs_flags[cstack->cs_idx] = 0;
+
+ /*
+ * Don't do something after an error, interrupt, or throw, or when there
+ * is a surrounding conditional and it was not active.
+ */
+ skip = did_emsg || got_int || did_throw || (cstack->cs_idx > 0
+ && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE));
+
+ result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+
+ if (!skip && !error)
+ {
+ if (result)
+ cstack->cs_flags[cstack->cs_idx] = CSF_ACTIVE | CSF_TRUE;
+ }
+ else
+ /* set TRUE, so this conditional will never get active */
+ cstack->cs_flags[cstack->cs_idx] = CSF_TRUE;
+ }
+}
+
+/*
+ * ":endif".
+ */
+ void
+ex_endif(eap)
+ exarg_T *eap;
+{
+ did_endif = TRUE;
+ if (eap->cstack->cs_idx < 0
+ || (eap->cstack->cs_flags[eap->cstack->cs_idx] &
+ (CSF_WHILE | CSF_TRY)))
+ eap->errmsg = (char_u *)N_("E580: :endif without :if");
+ else
+ {
+ /*
+ * When debugging or a breakpoint was encountered, display the debug
+ * prompt (if not already done). This shows the user that an ":endif"
+ * is executed when the ":if" or a previous ":elseif" was not TRUE.
+ * Handle a ">quit" debug command as if an interrupt had occurred before
+ * the ":endif". That is, throw an interrupt exception if appropriate.
+ * Doing this here prevents an exception for a parsing error being
+ * discarded by throwing the interrupt exception later on.
+ */
+ if (!(eap->cstack->cs_flags[eap->cstack->cs_idx] & CSF_TRUE) &&
+ dbg_check_skipped(eap))
+ (void)do_intthrow(eap->cstack);
+
+ --eap->cstack->cs_idx;
+ }
+}
+
+/*
+ * ":else" and ":elseif".
+ */
+ void
+ex_else(eap)
+ exarg_T *eap;
+{
+ int error;
+ int skip;
+ int result;
+ struct condstack *cstack = eap->cstack;
+
+ /*
+ * Don't do something after an error, interrupt, or throw, or when there is
+ * a surrounding conditional and it was not active.
+ */
+ skip = did_emsg || got_int || did_throw || (cstack->cs_idx > 0
+ && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE));
+
+ if (cstack->cs_idx < 0
+ || (cstack->cs_flags[cstack->cs_idx] & (CSF_WHILE | CSF_TRY)))
+ {
+ if (eap->cmdidx == CMD_else)
+ {
+ eap->errmsg = (char_u *)N_("E581: :else without :if");
+ return;
+ }
+ eap->errmsg = (char_u *)N_("E582: :elseif without :if");
+ skip = TRUE;
+ }
+ else if (cstack->cs_flags[cstack->cs_idx] & CSF_ELSE)
+ {
+ if (eap->cmdidx == CMD_else)
+ {
+ eap->errmsg = (char_u *)N_("E583: multiple :else");
+ return;
+ }
+ eap->errmsg = (char_u *)N_("E584: :elseif after :else");
+ skip = TRUE;
+ }
+
+ /* if skipping or the ":if" was TRUE, reset ACTIVE, otherwise set it */
+ if (skip || cstack->cs_flags[cstack->cs_idx] & CSF_TRUE)
+ {
+ if (eap->errmsg == NULL)
+ cstack->cs_flags[cstack->cs_idx] = CSF_TRUE;
+ skip = TRUE; /* don't evaluate an ":elseif" */
+ }
+ else
+ cstack->cs_flags[cstack->cs_idx] = CSF_ACTIVE;
+
+ /*
+ * When debugging or a breakpoint was encountered, display the debug prompt
+ * (if not already done). This shows the user that an ":else" or ":elseif"
+ * is executed when the ":if" or previous ":elseif" was not TRUE. Handle
+ * a ">quit" debug command as if an interrupt had occurred before the
+ * ":else" or ":elseif". That is, set "skip" and throw an interrupt
+ * exception if appropriate. Doing this here prevents that an exception
+ * for a parsing errors is discarded when throwing the interrupt exception
+ * later on.
+ */
+ if (!skip && dbg_check_skipped(eap) && got_int)
+ {
+ (void)do_intthrow(cstack);
+ skip = TRUE;
+ }
+
+ if (eap->cmdidx == CMD_elseif)
+ {
+ result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+ /* When throwing error exceptions, we want to throw always the first
+ * of several errors in a row. This is what actually happens when
+ * a conditional error was detected above and there is another failure
+ * when parsing the expression. Since the skip flag is set in this
+ * case, the parsing error will be ignored by emsg(). */
+
+ if (!skip && !error)
+ {
+ if (result)
+ cstack->cs_flags[cstack->cs_idx] = CSF_ACTIVE | CSF_TRUE;
+ else
+ cstack->cs_flags[cstack->cs_idx] = 0;
+ }
+ else if (eap->errmsg == NULL)
+ /* set TRUE, so this conditional will never get active */
+ cstack->cs_flags[cstack->cs_idx] = CSF_TRUE;
+ }
+ else
+ cstack->cs_flags[cstack->cs_idx] |= CSF_ELSE;
+}
+
+/*
+ * Handle ":while".
+ */
+ void
+ex_while(eap)
+ exarg_T *eap;
+{
+ int error;
+ int skip;
+ int result;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_idx == CSTACK_LEN - 1)
+ eap->errmsg = (char_u *)N_("E585: :while nesting too deep");
+ else
+ {
+ /*
+ * cs_had_while is set when we have jumped back from the matching
+ * ":endwhile". When not set, need to initialise this cstack entry.
+ */
+ if (!cstack->cs_had_while)
+ {
+ ++cstack->cs_idx;
+ ++cstack->cs_whilelevel;
+ cstack->cs_line[cstack->cs_idx] = -1;
+ }
+ cstack->cs_flags[cstack->cs_idx] = CSF_WHILE;
+
+ /*
+ * Don't do something after an error, interrupt, or throw, or when there
+ * is a surrounding conditional and it was not active.
+ */
+ skip = did_emsg || got_int || did_throw || (cstack->cs_idx > 0
+ && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE));
+ result = eval_to_bool(eap->arg, &error, &eap->nextcmd, skip);
+
+ /*
+ * If this cstack entry was just initialised and is active, set
+ * cs_had_while flag, so do_cmdline() will set the line number
+ * in cs_line[].
+ */
+ if (!skip && !error && result)
+ {
+ cstack->cs_flags[cstack->cs_idx] |= CSF_ACTIVE | CSF_TRUE;
+ cstack->cs_had_while = !cstack->cs_had_while;
+ }
+ else
+ {
+ cstack->cs_had_while = FALSE;
+ /* If the ":while" evaluates to FALSE, show the debug prompt at the
+ * ":endwhile" as if there was a ":break" in a ":while" evaluating
+ * to TRUE. */
+ if (!skip && !error)
+ cstack->cs_flags[cstack->cs_idx] |= CSF_TRUE;
+ }
+ }
+}
+
+/*
+ * ":continue"
+ */
+ void
+ex_continue(eap)
+ exarg_T *eap;
+{
+ int idx;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_whilelevel <= 0 || cstack->cs_idx < 0)
+ eap->errmsg = (char_u *)N_("E586: :continue without :while");
+ else
+ {
+ /* Try to find the matching ":while". This might stop at a try
+ * conditional not in its finally clause (which is then to be executed
+ * next). Therefor, inactivate all conditionals except the ":while"
+ * itself (if reached). */
+ idx = cleanup_conditionals(cstack, CSF_WHILE, FALSE);
+ if ((cstack->cs_flags[idx] & CSF_WHILE))
+ {
+ if (cstack->cs_idx > idx)
+ rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel);
+
+ /*
+ * Set cs_had_continue, so do_cmdline() will jump back to the
+ * matching ":while".
+ */
+ cstack->cs_had_continue = TRUE; /* let do_cmdline() handle it */
+ }
+ else
+ {
+ /* If a try conditional not in its finally clause is reached first,
+ * make the ":continue" pending for execution at the ":endtry". */
+ cstack->cs_pending[idx] = CSTP_CONTINUE;
+ report_make_pending(CSTP_CONTINUE, NULL);
+ }
+ }
+}
+
+/*
+ * ":break"
+ */
+ void
+ex_break(eap)
+ exarg_T *eap;
+{
+ int idx;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_whilelevel <= 0 || cstack->cs_idx < 0)
+ eap->errmsg = (char_u *)N_("E587: :break without :while");
+ else
+ {
+ /* Inactivate conditionals until the matching ":while" or a try
+ * conditional not in its finally clause (which is then to be
+ * executed next) is found. In the latter case, make the ":break"
+ * pending for execution at the ":endtry". */
+ idx = cleanup_conditionals(cstack, CSF_WHILE, TRUE);
+ if (!(cstack->cs_flags[idx] & CSF_WHILE))
+ {
+ cstack->cs_pending[idx] = CSTP_BREAK;
+ report_make_pending(CSTP_BREAK, NULL);
+ }
+ }
+}
+
+/*
+ * ":endwhile"
+ */
+ void
+ex_endwhile(eap)
+ exarg_T *eap;
+{
+ struct condstack *cstack = eap->cstack;
+ int idx;
+
+ if (cstack->cs_whilelevel <= 0 || cstack->cs_idx < 0)
+ eap->errmsg = e_while;
+ else
+ {
+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_WHILE))
+ {
+ /* Try to find the matching ":while" and report what's missing. */
+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
+ eap->errmsg = e_endif;
+ else if (cstack->cs_flags[cstack->cs_idx] & CSF_FINALLY)
+ eap->errmsg = e_endtry;
+ for (idx = cstack->cs_idx; idx > 0; --idx)
+ {
+ if ((cstack->cs_flags[idx] & CSF_TRY)
+ && !(cstack->cs_flags[idx] & CSF_FINALLY))
+ {
+ /* Give up at a try conditional not in its finally clause.
+ * Ignore the ":endwhile". */
+ eap->errmsg = e_while;
+ return;
+ }
+ if (cstack->cs_flags[idx] & CSF_WHILE)
+ break;
+ }
+ /* Cleanup and rewind all contained (and unclosed) conditionals. */
+ (void)cleanup_conditionals(cstack, CSF_WHILE, FALSE);
+ rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel);
+ }
+
+ /*
+ * When debugging or a breakpoint was encountered, display the debug
+ * prompt (if not already done). This shows the user that an
+ * ":enwhile" is executed when the ":while" was not TRUE or after
+ * a ":break". Handle a ">quit" debug command as if an interrupt
+ * had occurred before the ":endwhile". That is, throw an interrupt
+ * exception if appropriate. Doing this here prevents that an
+ * exception for a parsing error is discarded when throwing the
+ * interrupt exception later on.
+ */
+ else if (cstack->cs_flags[cstack->cs_idx] & CSF_TRUE
+ && !(cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE)
+ && dbg_check_skipped(eap))
+ (void)do_intthrow(cstack);
+
+ /*
+ * Set cs_had_endwhile, so do_cmdline() will jump back to the matching
+ * ":while".
+ */
+ cstack->cs_had_endwhile = TRUE;
+ }
+}
+
+
+/*
+ * ":throw expr"
+ */
+ void
+ex_throw(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *value;
+
+ if (*arg != NUL && *arg != '|' && *arg != '\n')
+ value = eval_to_string_skip(arg, &eap->nextcmd, eap->skip);
+ else
+ {
+ EMSG(_(e_argreq));
+ value = NULL;
+ }
+
+ /* On error or when an exception is thrown during argument evaluation, do
+ * not throw. */
+ if (!eap->skip && value != NULL)
+ {
+ if (throw_exception(value, ET_USER, NULL) == FAIL)
+ vim_free(value);
+ else
+ do_throw(eap->cstack);
+ }
+}
+
+/*
+ * Throw the current exception through the specified cstack. Common routine for
+ * ":throw" (user exception) and error and interrupt exceptions. Also used for
+ * rethrowing an uncaught exception.
+ */
+ void
+do_throw(cstack)
+ struct condstack *cstack;
+{
+ int idx;
+ int inactivate_try = FALSE;
+
+ /*
+ * Cleanup and inactivate up to the next surrounding try conditional that
+ * is not in its finally clause. Normally, do not inactivate the try
+ * conditional itself, so that its ACTIVE flag can be tested below. But
+ * if a previous error or interrupt has not been converted to an exception,
+ * inactivate the try conditional, too, as if the conversion had been done,
+ * and reset the did_emsg or got_int flag, so this won't happen again at the
+ * next surrounding try conditional.
+ */
+ if (did_emsg && !THROW_ON_ERROR)
+ {
+ inactivate_try = TRUE;
+ did_emsg = FALSE;
+ }
+ if (got_int && !THROW_ON_INTERRUPT)
+ {
+ inactivate_try = TRUE;
+ got_int = FALSE;
+ }
+ idx = cleanup_conditionals(cstack, 0, inactivate_try);
+ if (idx >= 0)
+ {
+ /*
+ * If this try conditional is active and we are before its first
+ * ":catch", set THROWN so that the ":catch" commands will check whether
+ * the exception matches. When the exception came from any of the
+ * catch clauses, it will be made pending at the ":finally" (if present)
+ * and rethrown at the ":endtry". This will also happen if the try
+ * conditional is inactive. This is the case when we are throwing an
+ * exception due to an error or interrupt on the way from a preceding
+ * ":continue", ":break", ":return", ":finish", error or interrupt (not
+ * converted to an exception) to the finally clause or from a preceding
+ * throw of a user or error or interrupt exception to the matching catch
+ * clause or the finally clause.
+ */
+ if (!(cstack->cs_flags[idx] & CSF_CAUGHT))
+ {
+ if (cstack->cs_flags[idx] & CSF_ACTIVE)
+ cstack->cs_flags[idx] |= CSF_THROWN;
+ else
+ /* THROWN may have already been set for a catchable exception
+ * that has been discarded. Ensure it is reset for the new
+ * exception. */
+ cstack->cs_flags[idx] &= ~CSF_THROWN;
+ }
+ cstack->cs_flags[idx] &= ~CSF_ACTIVE;
+ cstack->cs_exception[idx] = current_exception;
+ }
+#if 0
+ /* TODO: Add optimization below. Not yet done because of interface problems
+ * to eval.c and ex_cmds2.c. (Servatius) */
+ else
+ {
+ /*
+ * There are no catch clauses to check or finally clauses to execute.
+ * End the current script or function. The exception will be rethrown
+ * in the caller.
+ */
+ if (getline_equal(eap->getline, eap->cookie, get_func_line))
+ current_funccal->returned = TRUE;
+ elseif (eap->get_func_line == getsourceline)
+ ((struct source_cookie *)eap->cookie)->finished = TRUE;
+ }
+#endif
+
+ did_throw = TRUE;
+}
+
+/*
+ * ":try"
+ */
+ void
+ex_try(eap)
+ exarg_T *eap;
+{
+ int skip;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_idx == CSTACK_LEN - 1)
+ eap->errmsg = (char_u *)N_("E601: :try nesting too deep");
+ else
+ {
+ ++cstack->cs_idx;
+ ++cstack->cs_trylevel;
+ cstack->cs_flags[cstack->cs_idx] = CSF_TRY;
+ cstack->cs_pending[cstack->cs_idx] = CSTP_NONE;
+
+ /*
+ * Don't do something after an error, interrupt, or throw, or when there
+ * is a surrounding conditional and it was not active.
+ */
+ skip = did_emsg || got_int || did_throw || (cstack->cs_idx > 0
+ && !(cstack->cs_flags[cstack->cs_idx - 1] & CSF_ACTIVE));
+
+ if (!skip)
+ {
+ /* Set ACTIVE and TRUE. TRUE means that the corresponding ":catch"
+ * commands should check for a match if an exception is thrown and
+ * that the finally clause needs to be executed. */
+ cstack->cs_flags[cstack->cs_idx] |= CSF_ACTIVE | CSF_TRUE;
+
+ /*
+ * ":silent!", even when used in a try conditional, disables
+ * displaying of error messages and conversion of errors to
+ * exceptions. When the silent commands again open a try
+ * conditional, save "emsg_silent" and reset it so that errors are
+ * again converted to exceptions. The value is restored when that
+ * try conditional is left. If it is left normally, the commands
+ * following the ":endtry" are again silent. If it is left by
+ * a ":continue", ":break", ":return", or ":finish", the commands
+ * executed next are again silent. If it is left due to an
+ * aborting error, an interrupt, or an exception, restoring
+ * "emsg_silent" does not matter since we are already in the
+ * aborting state and/or the exception has already been thrown.
+ * The effect is then just freeing the memory that was allocated
+ * to save the value.
+ */
+ if (emsg_silent)
+ {
+ eslist_T *elem;
+
+ elem = (eslist_T *)alloc((unsigned)sizeof(struct eslist_elem));
+ if (elem == NULL)
+ EMSG(_(e_outofmem));
+ else
+ {
+ elem->saved_emsg_silent = emsg_silent;
+ elem->next = cstack->cs_emsg_silent_list;
+ cstack->cs_emsg_silent_list = elem;
+ cstack->cs_flags[cstack->cs_idx] |= CSF_SILENT;
+ emsg_silent = 0;
+ }
+ }
+ }
+
+ }
+}
+
+/*
+ * ":catch /{pattern}/" and ":catch"
+ */
+ void
+ex_catch(eap)
+ exarg_T *eap;
+{
+ int idx = 0;
+ int give_up = FALSE;
+ int skip = FALSE;
+ int caught = FALSE;
+ char_u *end;
+ int save_char = 0;
+ char_u *save_cpo;
+ regmatch_T regmatch;
+ int prev_got_int;
+ struct condstack *cstack = eap->cstack;
+ char_u *pat;
+
+ if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
+ {
+ eap->errmsg = (char_u *)N_("E603: :catch without :try");
+ give_up = TRUE;
+ }
+ else
+ {
+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
+ {
+ /* Report what's missing if the matching ":try" is not in its
+ * finally clause. */
+ if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
+ eap->errmsg = e_endwhile;
+ else
+ eap->errmsg = e_endif;
+ skip = TRUE;
+ }
+ for (idx = cstack->cs_idx; idx > 0; --idx)
+ if (cstack->cs_flags[idx] & CSF_TRY)
+ break;
+ if (cstack->cs_flags[idx] & CSF_FINALLY)
+ {
+ /* Give up for a ":catch" after ":finally" and ignore it.
+ * Just parse. */
+ eap->errmsg = (char_u *)N_("E604: :catch after :finally");
+ give_up = TRUE;
+ }
+ else if (cstack->cs_idx > idx)
+ rewind_conditionals(cstack, idx, CSF_WHILE, &cstack->cs_whilelevel);
+ }
+
+ if (ends_excmd(*eap->arg)) /* no argument, catch all errors */
+ {
+ pat = (char_u *)".*";
+ end = NULL;
+ eap->nextcmd = find_nextcmd(eap->arg);
+ }
+ else
+ {
+ pat = eap->arg + 1;
+ end = skip_regexp(pat, *eap->arg, TRUE, NULL);
+ }
+
+ if (!give_up)
+ {
+ /*
+ * Don't do something when no exception has been thrown or when the
+ * corresponding try block never got active (because of an inactive
+ * surrounding conditional or after an error or interrupt or throw).
+ */
+ if (!did_throw || !(cstack->cs_flags[idx] & CSF_TRUE))
+ skip = TRUE;
+
+ /*
+ * Check for a match only if an exception is thrown but not caught by
+ * a previous ":catch". An exception that has replaced a discarded
+ * exception is not checked (THROWN is not set then).
+ */
+ if (!skip && (cstack->cs_flags[idx] & CSF_THROWN)
+ && !(cstack->cs_flags[idx] & CSF_CAUGHT))
+ {
+ if (end != NULL && *end != NUL && !ends_excmd(*skipwhite(end + 1)))
+ {
+ EMSG(_(e_trailing));
+ return;
+ }
+
+ /* When debugging or a breakpoint was encountered, display the
+ * debug prompt (if not already done) before checking for a match.
+ * This is a helpful hint for the user when the regular expression
+ * matching fails. Handle a ">quit" debug command as if an
+ * interrupt had occurred before the ":catch". That is, discard
+ * the original exception, replace it by an interrupt exception,
+ * and don't catch it in this try block. */
+ if (!dbg_check_skipped(eap) || !do_intthrow(cstack))
+ {
+ /* Terminate the pattern and avoid the 'l' flag in 'cpoptions'
+ * while compiling it. */
+ if (end != NULL)
+ {
+ save_char = *end;
+ *end = NUL;
+ }
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+ regmatch.regprog = vim_regcomp(pat, TRUE);
+ regmatch.rm_ic = FALSE;
+ if (end != NULL)
+ *end = save_char;
+ p_cpo = save_cpo;
+ if (regmatch.regprog == NULL)
+ EMSG2(_(e_invarg2), pat);
+ else
+ {
+ /*
+ * Save the value of got_int and reset it. We don't want
+ * a previous interruption cancel matching, only hitting
+ * CTRL-C while matching should abort it.
+ */
+ prev_got_int = got_int;
+ got_int = FALSE;
+ caught = vim_regexec_nl(&regmatch, current_exception->value,
+ (colnr_T)0);
+ got_int |= prev_got_int;
+ vim_free(regmatch.regprog);
+ }
+ }
+ }
+
+ if (caught)
+ {
+ /* Make this ":catch" clause active and reset did_emsg, got_int,
+ * and did_throw. Put the exception on the caught stack. */
+ cstack->cs_flags[idx] |= CSF_ACTIVE | CSF_CAUGHT;
+ did_emsg = got_int = did_throw = FALSE;
+ catch_exception((except_T *)cstack->cs_exception[idx]);
+ /* It's mandatory that the current exception is stored in the cstack
+ * so that it can be discarded at the next ":catch", ":finally", or
+ * ":endtry" or when the catch clause is left by a ":continue",
+ * ":break", ":return", ":finish", error, interrupt, or another
+ * exception. */
+ if (cstack->cs_exception[cstack->cs_idx] != current_exception)
+ EMSG(_(e_internal));
+ }
+ else
+ {
+ /*
+ * If there is a preceding catch clause and it caught the exception,
+ * finish the exception now. This happens also after errors except
+ * when this ":catch" was after the ":finally" or not within
+ * a ":try". Make the try conditional inactive so that the
+ * following catch clauses are skipped. On an error or interrupt
+ * after the preceding try block or catch clause was left by
+ * a ":continue", ":break", ":return", or ":finish", discard the
+ * pending action.
+ */
+ cleanup_conditionals(cstack, CSF_TRY, TRUE);
+ }
+ }
+
+ if (end != NULL)
+ eap->nextcmd = find_nextcmd(end);
+}
+
+/*
+ * ":finally"
+ */
+ void
+ex_finally(eap)
+ exarg_T *eap;
+{
+ int idx;
+ int skip = FALSE;
+ int pending = CSTP_NONE;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
+ eap->errmsg = (char_u *)N_("E606: :finally without :try");
+ else
+ {
+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
+ {
+ /* Find the matching ":try" and report what's missing. */
+ if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
+ eap->errmsg = e_endwhile;
+ else
+ eap->errmsg = e_endif;
+ for (idx = cstack->cs_idx - 1; idx > 0; --idx)
+ if (cstack->cs_flags[idx] & CSF_TRY)
+ break;
+ /* Make this error pending, so that the commands in the following
+ * finally clause can be executed. This overrules also a pending
+ * ":continue", ":break", ":return", or ":finish". */
+ pending = CSTP_ERROR;
+ }
+ else
+ idx = cstack->cs_idx;
+
+ if (cstack->cs_flags[idx] & CSF_FINALLY)
+ {
+ /* Give up for a multiple ":finally" and ignore it. */
+ eap->errmsg = (char_u *)N_("E607: multiple :finally");
+ return;
+ }
+ if (cstack->cs_idx > idx)
+ rewind_conditionals(cstack, idx, CSF_WHILE, &cstack->cs_whilelevel);
+
+ /*
+ * Don't do something when the corresponding try block never got active
+ * (because of an inactive surrounding conditional or after an error or
+ * interrupt or throw) or for a ":finally" without ":try" or a multiple
+ * ":finally". After every other error (did_emsg or the conditional
+ * errors detected above) or after an interrupt (got_int) or an
+ * exception (did_throw), the finally clause must be executed.
+ */
+ skip = !(cstack->cs_flags[cstack->cs_idx] & CSF_TRUE);
+
+ if (!skip)
+ {
+ /* When debugging or a breakpoint was encountered, display the
+ * debug prompt (if not already done). The user then knows that the
+ * finally clause is executed. */
+ if (dbg_check_skipped(eap))
+ {
+ /* Handle a ">quit" debug command as if an interrupt had
+ * occurred before the ":finally". That is, discard the
+ * original exception and replace it by an interrupt
+ * exception. */
+ (void)do_intthrow(cstack);
+ }
+
+ /*
+ * If there is a preceding catch clause and it caught the exception,
+ * finish the exception now. This happens also after errors except
+ * when this is a multiple ":finally" or one not within a ":try".
+ * After an error or interrupt, this also discards a pending
+ * ":continue", ":break", ":finish", or ":return" from the preceding
+ * try block or catch clause.
+ */
+ cleanup_conditionals(cstack, CSF_TRY, FALSE);
+
+ /*
+ * Make did_emsg, got_int, did_throw pending. If set, they overrule
+ * a pending ":continue", ":break", ":return", or ":finish". Then
+ * we have particularly to discard a pending return value (as done
+ * by the call to cleanup_conditionals() above when did_emsg or
+ * got_int is set). The pending values are restored by the
+ * ":endtry", except if there is a new error, interrupt, exception,
+ * ":continue", ":break", ":return", or ":finish" in the following
+ * finally clause. A missing ":endwhile" or ":endif" detected here
+ * is treated as if did_emsg and did_throw had already been set,
+ * respectively in case that the error is not converted to an
+ * exception, did_throw had already been unset. We must not set
+ * did_emsg here since that would suppress the error message.
+ */
+ if (pending == CSTP_ERROR || did_emsg || got_int || did_throw)
+ {
+ if (cstack->cs_pending[cstack->cs_idx] == CSTP_RETURN)
+ {
+ report_discard_pending(CSTP_RETURN,
+ cstack->cs_retvar[cstack->cs_idx]);
+ discard_pending_return(cstack->cs_retvar[cstack->cs_idx]);
+ }
+ if (pending == CSTP_ERROR && !did_emsg)
+ pending |= (THROW_ON_ERROR) ? CSTP_THROW : 0;
+ else
+ pending |= did_throw ? CSTP_THROW : 0;
+ pending |= did_emsg ? CSTP_ERROR : 0;
+ pending |= got_int ? CSTP_INTERRUPT : 0;
+ cstack->cs_pending[cstack->cs_idx] = pending;
+
+ /* It's mandatory that the current exception is stored in the
+ * cstack so that it can be rethrown at the ":endtry" or be
+ * discarded if the finally clause is left by a ":continue",
+ * ":break", ":return", ":finish", error, interrupt, or another
+ * exception. When emsg() is called for a missing ":endif" or
+ * a missing ":endwhile" detected here, the exception will be
+ * discarded. */
+ if (did_throw && cstack->cs_exception[cstack->cs_idx] !=
+ current_exception)
+ EMSG(_(e_internal));
+ }
+
+ /*
+ * Set cs_had_finally, so do_cmdline() will reset did_emsg, got_int,
+ * and did_throw and make the finally clause active. This will
+ * happen after emsg() has been called for a missing ":endif" or
+ * a missing ":endwhile" detected here, so that the following
+ * finally clause will be executed even then.
+ */
+ cstack->cs_had_finally = TRUE;
+ }
+ }
+}
+
+/*
+ * ":endtry"
+ */
+ void
+ex_endtry(eap)
+ exarg_T *eap;
+{
+ int idx;
+ int skip;
+ int rethrow = FALSE;
+ int pending = CSTP_NONE;
+ void *retvar = NULL;
+ struct condstack *cstack = eap->cstack;
+
+ if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
+ eap->errmsg = (char_u *)N_("E602: :endtry without :try");
+ else
+ {
+ /*
+ * Don't do something after an error, interrupt or throw in the try
+ * block, catch clause, or finally clause preceding this ":endtry" or
+ * when an error or interrupt occurred after a ":continue", ":break",
+ * ":return", or ":finish" in a try block or catch clause preceding this
+ * ":endtry" or when the try block never got active (because of an
+ * inactive surrounding conditional or after an error or interrupt or
+ * throw) or when there is a surrounding conditional and it has been
+ * made inactive by a ":continue", ":break", ":return", or ":finish" in
+ * the finally clause. The latter case need not be tested since then
+ * anything pending has already been discarded. */
+ skip = did_emsg || got_int || did_throw ||
+ !(cstack->cs_flags[cstack->cs_idx] & CSF_TRUE);
+
+ if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
+ {
+ /* Find the matching ":try" and report what's missing. */
+ if (cstack->cs_flags[cstack->cs_idx] & CSF_WHILE)
+ eap->errmsg = e_endwhile;
+ else
+ eap->errmsg = e_endif;
+ idx = cstack->cs_idx;
+ do
+ --idx;
+ while (idx > 0 && !(cstack->cs_flags[idx] & CSF_TRY));
+ rewind_conditionals(cstack, idx, CSF_WHILE, &cstack->cs_whilelevel);
+ skip = TRUE;
+
+ /*
+ * If an exception is being thrown, discard it to prevent it from
+ * being rethrown at the end of this function. It would be
+ * discarded by the error message, anyway. Resets did_throw.
+ * This does not affect the script termination due to the error
+ * since "trylevel" is decremented after emsg() has been called.
+ */
+ if (did_throw)
+ discard_current_exception();
+ }
+ else
+ {
+ idx = cstack->cs_idx;
+
+ /*
+ * If we stopped with the exception currently being thrown at this
+ * try conditional since we didn't know that it doesn't have
+ * a finally clause, we need to rethrow it after closing the try
+ * conditional.
+ */
+ if (did_throw && (cstack->cs_flags[idx] & CSF_TRUE)
+ && !(cstack->cs_flags[idx] & CSF_FINALLY))
+ rethrow = TRUE;
+ }
+
+ /* If there was no finally clause, show the user when debugging or
+ * a breakpoint was encountered that the end of the try conditional has
+ * been reached: display the debug prompt (if not already done). Do
+ * this on normal control flow or when an exception was thrown, but not
+ * on an interrupt or error not converted to an exception or when
+ * a ":break", ":continue", ":return", or ":finish" is pending. These
+ * actions are carried out immediately.
+ */
+ if ((rethrow || (!skip
+ && !(cstack->cs_flags[idx] & CSF_FINALLY)
+ && !cstack->cs_pending[idx]))
+ && dbg_check_skipped(eap))
+ {
+ /* Handle a ">quit" debug command as if an interrupt had occurred
+ * before the ":endtry". That is, throw an interrupt exception and
+ * set "skip" and "rethrow". */
+ if (got_int)
+ {
+ skip = TRUE;
+ (void)do_intthrow(cstack);
+ /* The do_intthrow() call may have reset did_throw or
+ * cstack->cs_pending[idx].*/
+ rethrow = FALSE;
+ if (did_throw && !(cstack->cs_flags[idx] & CSF_FINALLY))
+ rethrow = TRUE;
+ }
+ }
+
+ /*
+ * If a ":return" is pending, we need to resume it after closing the
+ * try conditional; remember the return value. If there was a finally
+ * clause making an exception pending, we need to rethrow it. Make it
+ * the exception currently being thrown.
+ */
+ if (!skip)
+ {
+ pending = cstack->cs_pending[idx];
+ cstack->cs_pending[idx] = CSTP_NONE;
+ if (pending == CSTP_RETURN)
+ retvar = cstack->cs_retvar[idx];
+ else if (pending & CSTP_THROW)
+ current_exception = cstack->cs_exception[idx];
+ }
+
+ /*
+ * Discard anything pending on an error, interrupt, or throw in the
+ * finally clause. If there was no ":finally", discard a pending
+ * ":continue", ":break", ":return", or ":finish" if an error or
+ * interrupt occurred afterwards, but before the ":endtry" was reached.
+ * If an exception was caught by the last of the catch clauses and there
+ * was no finally clause, finish the exception now. This happens also
+ * after errors except when this ":endtry" is not within a ":try".
+ * Restore "emsg_silent" if it has been reset by this try conditional.
+ */
+ cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, TRUE);
+
+ --cstack->cs_idx;
+ --cstack->cs_trylevel;
+
+ if (!skip)
+ {
+ report_resume_pending(pending,
+ (pending == CSTP_RETURN) ? retvar :
+ (pending & CSTP_THROW) ? (void *)current_exception : NULL);
+ switch (pending)
+ {
+ case CSTP_NONE:
+ break;
+
+ /* Reactivate a pending ":continue", ":break", ":return",
+ * ":finish" from the try block or a catch clause of this try
+ * conditional. This is skipped, if there was an error in an
+ * (unskipped) conditional command or an interrupt afterwards
+ * or if the finally clause is present and executed a new error,
+ * interrupt, throw, ":continue", ":break", ":return", or
+ * ":finish". */
+ case CSTP_CONTINUE:
+ ex_continue(eap);
+ break;
+ case CSTP_BREAK:
+ ex_break(eap);
+ break;
+ case CSTP_RETURN:
+ do_return(eap, FALSE, FALSE, retvar);
+ break;
+ case CSTP_FINISH:
+ do_finish(eap, FALSE);
+ break;
+
+ /* When the finally clause was entered due to an error,
+ * interrupt or throw (as opposed to a ":continue", ":break",
+ * ":return", or ":finish"), restore the pending values of
+ * did_emsg, got_int, and did_throw. This is skipped, if there
+ * was a new error, interrupt, throw, ":continue", ":break",
+ * ":return", or ":finish". in the finally clause. */
+ default:
+ if (pending & CSTP_ERROR)
+ did_emsg = TRUE;
+ if (pending & CSTP_INTERRUPT)
+ got_int = TRUE;
+ if (pending & CSTP_THROW)
+ rethrow = TRUE;
+ break;
+ }
+ }
+
+ if (rethrow)
+ /* Rethrow the current exception (within this cstack). */
+ do_throw(cstack);
+ }
+}
+
+/*
+ * Make conditionals inactive and discard what's pending in finally clauses
+ * until the conditional type searched for or a try conditional not in its
+ * finally clause is reached. If this is in an active catch clause, finish the
+ * caught exception. Return the cstack index where the search stopped. Values
+ * used for "searched_cond" are CSF_WHILE or CSF_TRY or 0, the latter meaning
+ * the innermost try conditional not in its finally clause. "inclusive" tells
+ * whether the conditional searched for should be made inactive itself (a try
+ * conditional not in its finally claused possibly find before is always made
+ * inactive). If "inclusive" is TRUE and "searched_cond" is CSF_TRY|CSF_SILENT,
+ * the saved former value of "emsg_silent", if reset when the try conditional
+ * finally reached was entered, is restored (unsed by ex_endtry()). This is
+ * normally done only when such a try conditional is left.
+ */
+ int
+cleanup_conditionals(cstack, searched_cond, inclusive)
+ struct condstack *cstack;
+ int searched_cond;
+ int inclusive;
+{
+ int idx;
+ int stop = FALSE;
+
+ for (idx = cstack->cs_idx; idx >= 0; --idx)
+ {
+ if (cstack->cs_flags[idx] & CSF_TRY)
+ {
+ /*
+ * Discard anything pending in a finally clause and continue the
+ * search. There may also be a pending ":continue", ":break",
+ * ":return", or ":finish" before the finally clause. We must not
+ * discard it, unless an error or interrupt occurred afterwards.
+ */
+ if (did_emsg || got_int ||
+ (cstack->cs_flags[idx] & CSF_FINALLY))
+ {
+ switch (cstack->cs_pending[idx])
+ {
+ case CSTP_NONE:
+ break;
+
+ case CSTP_CONTINUE:
+ case CSTP_BREAK:
+ case CSTP_FINISH:
+ report_discard_pending(cstack->cs_pending[idx], NULL);
+ cstack->cs_pending[idx] = CSTP_NONE;
+ break;
+
+ case CSTP_RETURN:
+ report_discard_pending(CSTP_RETURN,
+ cstack->cs_retvar[idx]);
+ discard_pending_return(cstack->cs_retvar[idx]);
+ cstack->cs_pending[idx] = CSTP_NONE;
+ break;
+
+ default:
+ if (cstack->cs_flags[idx] & CSF_FINALLY)
+ {
+ if (cstack->cs_pending[idx] & CSTP_THROW)
+ {
+ /* Cancel the pending exception. This is in the
+ * finally clause, so that the stack of the
+ * caught exceptions is not involved. */
+ discard_exception((except_T *)
+ cstack->cs_exception[idx],
+ FALSE);
+ }
+ else
+ report_discard_pending(cstack->cs_pending[idx],
+ NULL);
+ cstack->cs_pending[idx] = CSTP_NONE;
+ }
+ break;
+ }
+ }
+
+ /*
+ * Stop at a try conditional not in its finally clause. If this try
+ * conditional is in an active catch clause, finish the caught
+ * exception.
+ */
+ if (!(cstack->cs_flags[idx] & CSF_FINALLY))
+ {
+ if ((cstack->cs_flags[idx] & CSF_ACTIVE)
+ && (cstack->cs_flags[idx] & CSF_CAUGHT))
+ finish_exception((except_T *)cstack->cs_exception[idx]);
+ /* Stop at this try conditional - except the try block never
+ * got active (because of an inactive surrounding conditional
+ * or when the ":try" appeared after an error or interrupt or
+ * throw). */
+ if (cstack->cs_flags[idx] & CSF_TRUE)
+ {
+ if (searched_cond == 0 && !inclusive)
+ break;
+ stop = TRUE;
+ }
+ }
+ }
+
+ /* Stop on the searched conditional type (even when the surrounding
+ * conditional is not active or something has been made pending).
+ * If "inclusive" is TRUE and "searched_cond" is CSF_TRY|CSF_SILENT,
+ * check first whether "emsg_silent" needs to be restored. */
+ if (cstack->cs_flags[idx] & searched_cond)
+ {
+ if (!inclusive)
+ break;
+ stop = TRUE;
+ }
+ cstack->cs_flags[idx] &= ~CSF_ACTIVE;
+ if (stop && searched_cond != (CSF_TRY | CSF_SILENT))
+ break;
+
+ /*
+ * When leaving a try conditinal that reset "emsg_silent" on its entry
+ * after saving the original value, restore that value here and free the
+ * memory used to store it.
+ */
+ if ((cstack->cs_flags[idx] & CSF_TRY)
+ && (cstack->cs_flags[idx] & CSF_SILENT))
+ {
+ eslist_T *elem;
+
+ elem = cstack->cs_emsg_silent_list;
+ cstack->cs_emsg_silent_list = elem->next;
+ emsg_silent = elem->saved_emsg_silent;
+ vim_free(elem);
+ cstack->cs_flags[idx] &= ~CSF_SILENT;
+ }
+ if (stop)
+ break;
+ }
+ return idx;
+}
+
+/*
+ * Rewind conditionals until index "idx" is reached. "cond_type" and
+ * "cond_level" specify a conditional type and the address of a level variable
+ * which is to be decremented with each skipped conditional of the specified
+ * type.
+ */
+ static void
+rewind_conditionals(cstack, idx, cond_type, cond_level)
+ struct condstack *cstack;
+ int idx;
+ int cond_type;
+ int *cond_level;
+{
+ while (cstack->cs_idx > idx)
+ {
+ if (cstack->cs_flags[cstack->cs_idx] & cond_type)
+ --*cond_level;
+ --cstack->cs_idx;
+ }
+}
+
+/*
+ * ":endfunction" when not after a ":function"
+ */
+/*ARGSUSED*/
+ void
+ex_endfunction(eap)
+ exarg_T *eap;
+{
+ EMSG(_("E193: :endfunction not inside a function"));
+}
+
+/*
+ * Return TRUE if the string "p" looks like a ":while" command.
+ */
+ int
+has_while_cmd(p)
+ char_u *p;
+{
+ p = skipwhite(p);
+ while (*p == ':')
+ p = skipwhite(p + 1);
+ if (p[0] == 'w' && p[1] == 'h')
+ return TRUE;
+ return FALSE;
+}
+
+#endif /* FEAT_EVAL */
diff --git a/src/ex_getln.c b/src/ex_getln.c
new file mode 100644
index 000000000..3c242816b
--- /dev/null
+++ b/src/ex_getln.c
@@ -0,0 +1,5371 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ex_getln.c: Functions for entering and editing an Ex command line.
+ */
+
+#include "vim.h"
+
+/*
+ * Variables shared between getcmdline(), redrawcmdline() and others.
+ * These need to be saved when using CTRL-R |, that's why they are in a
+ * structure.
+ */
+struct cmdline_info
+{
+ char_u *cmdbuff; /* pointer to command line buffer */
+ int cmdbufflen; /* length of cmdbuff */
+ int cmdlen; /* number of chars in command line */
+ int cmdpos; /* current cursor position */
+ int cmdspos; /* cursor column on screen */
+ int cmdfirstc; /* ':', '/', '?', '=' or NUL */
+ int cmdindent; /* number of spaces before cmdline */
+ char_u *cmdprompt; /* message in front of cmdline */
+ int cmdattr; /* attributes for prompt */
+ int overstrike; /* Typing mode on the command line. Shared by
+ getcmdline() and put_on_cmdline(). */
+};
+
+static struct cmdline_info ccline; /* current cmdline_info */
+
+static int cmd_showtail; /* Only show path tail in lists ? */
+
+#ifdef FEAT_EVAL
+static int new_cmdpos; /* position set by set_cmdline_pos() */
+#endif
+
+#ifdef FEAT_CMDHIST
+typedef struct hist_entry
+{
+ int hisnum; /* identifying number */
+ char_u *hisstr; /* actual entry, separator char after the NUL */
+} histentry_T;
+
+static histentry_T *(history[HIST_COUNT]) = {NULL, NULL, NULL, NULL, NULL};
+static int hisidx[HIST_COUNT] = {-1, -1, -1, -1, -1}; /* lastused entry */
+static int hisnum[HIST_COUNT] = {0, 0, 0, 0, 0};
+ /* identifying (unique) number of newest history entry */
+static int hislen = 0; /* actual length of history tables */
+
+static int hist_char2type __ARGS((int c));
+static void init_history __ARGS((void));
+
+static int in_history __ARGS((int, char_u *, int));
+# ifdef FEAT_EVAL
+static int calc_hist_idx __ARGS((int histype, int num));
+# endif
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+static int cmd_hkmap = 0; /* Hebrew mapping during command line */
+#endif
+
+#ifdef FEAT_FKMAP
+static int cmd_fkmap = 0; /* Farsi mapping during command line */
+#endif
+
+static int cmdline_charsize __ARGS((int idx));
+static void set_cmdspos __ARGS((void));
+static void set_cmdspos_cursor __ARGS((void));
+#ifdef FEAT_MBYTE
+static void correct_cmdspos __ARGS((int idx, int cells));
+#endif
+static void alloc_cmdbuff __ARGS((int len));
+static int realloc_cmdbuff __ARGS((int len));
+static void draw_cmdline __ARGS((int start, int len));
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+static void redrawcmd_preedit __ARGS((void));
+#endif
+#ifdef FEAT_WILDMENU
+static void cmdline_del __ARGS((int from));
+#endif
+static void redrawcmdprompt __ARGS((void));
+static void cursorcmd __ARGS((void));
+static int ccheck_abbr __ARGS((int));
+static int nextwild __ARGS((expand_T *xp, int type, int options));
+static int showmatches __ARGS((expand_T *xp, int wildmenu));
+static void set_expand_context __ARGS((expand_T *xp));
+static int ExpandFromContext __ARGS((expand_T *xp, char_u *, int *, char_u ***, int));
+static int expand_showtail __ARGS((expand_T *xp));
+#ifdef FEAT_CMDL_COMPL
+static int ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname));
+# if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
+static int ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
+# endif
+#endif
+
+#ifdef FEAT_CMDWIN
+static int ex_window __ARGS((void));
+#endif
+
+/*
+ * getcmdline() - accept a command line starting with firstc.
+ *
+ * firstc == ':' get ":" command line.
+ * firstc == '/' or '?' get search pattern
+ * firstc == '=' get expression
+ * firstc == '@' get text for input() function
+ * firstc == '>' get text for debug mode
+ * firstc == NUL get text for :insert command
+ * firstc == -1 like NUL, and break on CTRL-C
+ *
+ * The line is collected in ccline.cmdbuff, which is reallocated to fit the
+ * command line.
+ *
+ * Careful: getcmdline() can be called recursively!
+ *
+ * Return pointer to allocated string if there is a commandline, NULL
+ * otherwise.
+ */
+/*ARGSUSED*/
+ char_u *
+getcmdline(firstc, count, indent)
+ int firstc;
+ long count; /* only used for incremental search */
+ int indent; /* indent for inside conditionals */
+{
+ int c;
+ int i;
+ int j;
+ int gotesc = FALSE; /* TRUE when <ESC> just typed */
+ int do_abbr; /* when TRUE check for abbr. */
+#ifdef FEAT_CMDHIST
+ char_u *lookfor = NULL; /* string to match */
+ int hiscnt; /* current history line in use */
+ int histype; /* history type to be used */
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ pos_T old_cursor;
+ colnr_T old_curswant;
+ colnr_T old_leftcol;
+ linenr_T old_topline;
+# ifdef FEAT_DIFF
+ int old_topfill;
+# endif
+ linenr_T old_botline;
+ int did_incsearch = FALSE;
+ int incsearch_postponed = FALSE;
+#endif
+ int did_wild_list = FALSE; /* did wild_list() recently */
+ int wim_index = 0; /* index in wim_flags[] */
+ int res;
+ int save_msg_scroll = msg_scroll;
+ int save_State = State; /* remember State when called */
+ int some_key_typed = FALSE; /* one of the keys was typed */
+#ifdef FEAT_MOUSE
+ /* mouse drag and release events are ignored, unless they are
+ * preceded with a mouse down event */
+ int ignore_drag_release = TRUE;
+#endif
+#ifdef FEAT_EVAL
+ int break_ctrl_c = FALSE;
+#endif
+ expand_T xpc;
+ long *b_im_ptr = NULL;
+
+#ifdef FEAT_SNIFF
+ want_sniff_request = 0;
+#endif
+#ifdef FEAT_EVAL
+ if (firstc == -1)
+ {
+ firstc = NUL;
+ break_ctrl_c = TRUE;
+ }
+#endif
+#ifdef FEAT_RIGHTLEFT
+ /* start without Hebrew mapping for a command line */
+ if (firstc == ':' || firstc == '=' || firstc == '>')
+ cmd_hkmap = 0;
+#endif
+
+ ccline.overstrike = FALSE; /* always start in insert mode */
+#ifdef FEAT_SEARCH_EXTRA
+ old_cursor = curwin->w_cursor; /* needs to be restored later */
+ old_curswant = curwin->w_curswant;
+ old_leftcol = curwin->w_leftcol;
+ old_topline = curwin->w_topline;
+# ifdef FEAT_DIFF
+ old_topfill = curwin->w_topfill;
+# endif
+ old_botline = curwin->w_botline;
+#endif
+
+ /*
+ * set some variables for redrawcmd()
+ */
+ ccline.cmdfirstc = (firstc == '@' ? 0 : firstc);
+ ccline.cmdindent = indent;
+ alloc_cmdbuff(exmode_active ? 250 : 0); /* alloc initial ccline.cmdbuff */
+ if (ccline.cmdbuff == NULL)
+ return NULL; /* out of memory */
+ ccline.cmdlen = ccline.cmdpos = 0;
+ ccline.cmdbuff[0] = NUL;
+
+ ExpandInit(&xpc);
+
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl && *curwin->w_p_rlc == 's'
+ && (firstc == '/' || firstc == '?'))
+ cmdmsg_rl = TRUE;
+ else
+ cmdmsg_rl = FALSE;
+#endif
+
+ redir_off = TRUE; /* don't redirect the typed command */
+ if (!cmd_silent)
+ {
+ i = msg_scrolled;
+ msg_scrolled = 0; /* avoid wait_return message */
+ gotocmdline(TRUE);
+ msg_scrolled += i;
+ redrawcmdprompt(); /* draw prompt or indent */
+ set_cmdspos();
+ }
+ xpc.xp_context = EXPAND_NOTHING;
+ xpc.xp_backslash = XP_BS_NONE;
+
+ /*
+ * Avoid scrolling when called by a recursive do_cmdline(), e.g. when
+ * doing ":@0" when register 0 doesn't contain a CR.
+ */
+ msg_scroll = FALSE;
+
+ State = CMDLINE;
+
+ if (firstc == '/' || firstc == '?' || firstc == '@')
+ {
+ /* Use ":lmap" mappings for search pattern and input(). */
+ if (curbuf->b_p_imsearch == B_IMODE_USE_INSERT)
+ b_im_ptr = &curbuf->b_p_iminsert;
+ else
+ b_im_ptr = &curbuf->b_p_imsearch;
+ if (*b_im_ptr == B_IMODE_LMAP)
+ State |= LANGMAP;
+#ifdef USE_IM_CONTROL
+ im_set_active(*b_im_ptr == B_IMODE_IM);
+#endif
+ }
+#ifdef USE_IM_CONTROL
+ else if (p_imcmdline)
+ im_set_active(TRUE);
+#endif
+
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+
+#ifdef FEAT_CMDHIST
+ init_history();
+ hiscnt = hislen; /* set hiscnt to impossible history value */
+ histype = hist_char2type(firstc);
+#endif
+
+#ifdef FEAT_DIGRAPHS
+ do_digraph(-1); /* init digraph typahead */
+#endif
+
+ /*
+ * Collect the command string, handling editing keys.
+ */
+ for (;;)
+ {
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = FALSE; /* allow scrolling here */
+#endif
+ quit_more = FALSE; /* reset after CTRL-D which had a more-prompt */
+
+ cursorcmd(); /* set the cursor on the right spot */
+ c = safe_vgetc();
+ if (KeyTyped)
+ {
+ some_key_typed = TRUE;
+#ifdef FEAT_RIGHTLEFT
+ if (cmd_hkmap)
+ c = hkmap(c);
+# ifdef FEAT_FKMAP
+ if (cmd_fkmap)
+ c = cmdl_fkmap(c);
+# endif
+ if (cmdmsg_rl && !KeyStuffed)
+ {
+ /* Invert horizontal movements and operations. Only when
+ * typed by the user directly, not when the result of a
+ * mapping. */
+ switch (c)
+ {
+ case K_RIGHT: c = K_LEFT; break;
+ case K_S_RIGHT: c = K_S_LEFT; break;
+ case K_C_RIGHT: c = K_C_LEFT; break;
+ case K_LEFT: c = K_RIGHT; break;
+ case K_S_LEFT: c = K_S_RIGHT; break;
+ case K_C_LEFT: c = K_C_RIGHT; break;
+ }
+ }
+#endif
+ }
+
+ /*
+ * Ignore got_int when CTRL-C was typed here.
+ * Don't ignore it in :global, we really need to break then, e.g., for
+ * ":g/pat/normal /pat" (without the <CR>).
+ * Don't ignore it for the input() function.
+ */
+ if ((c == Ctrl_C
+#ifdef UNIX
+ || c == intr_char
+#endif
+ )
+#if defined(FEAT_EVAL) || defined(FEAT_CRYPT)
+ && firstc != '@'
+#endif
+#ifdef FEAT_EVAL
+ && !break_ctrl_c
+#endif
+ && !global_busy)
+ got_int = FALSE;
+
+#ifdef FEAT_CMDHIST
+ /* free old command line when finished moving around in the history
+ * list */
+ if (lookfor != NULL
+ && c != K_S_DOWN && c != K_S_UP && c != K_DOWN && c != K_UP
+ && c != K_PAGEDOWN && c != K_PAGEUP
+ && c != K_KPAGEDOWN && c != K_KPAGEUP
+ && c != K_LEFT && c != K_RIGHT
+ && (xpc.xp_numfiles > 0 || (c != Ctrl_P && c != Ctrl_N)))
+ {
+ vim_free(lookfor);
+ lookfor = NULL;
+ }
+#endif
+
+ /*
+ * <S-Tab> works like CTRL-P (unless 'wc' is <S-Tab>).
+ */
+ if (c != p_wc && c == K_S_TAB && xpc.xp_numfiles != -1)
+ c = Ctrl_P;
+
+#ifdef FEAT_WILDMENU
+ /* Special translations for 'wildmenu' */
+ if (did_wild_list && p_wmnu)
+ {
+ if (c == K_LEFT)
+ c = Ctrl_P;
+ else if (c == K_RIGHT)
+ c = Ctrl_N;
+ }
+ /* Hitting CR after "emenu Name.": complete submenu */
+ if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu
+ && ccline.cmdpos > 1
+ && ccline.cmdbuff[ccline.cmdpos - 1] == '.'
+ && ccline.cmdbuff[ccline.cmdpos - 2] != '\\'
+ && (c == '\n' || c == '\r' || c == K_KENTER))
+ c = K_DOWN;
+#endif
+
+ /* free expanded names when finished walking through matches */
+ if (xpc.xp_numfiles != -1
+ && !(c == p_wc && KeyTyped) && c != p_wcm
+ && c != Ctrl_N && c != Ctrl_P && c != Ctrl_A
+ && c != Ctrl_L)
+ {
+ (void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
+ did_wild_list = FALSE;
+#ifdef FEAT_WILDMENU
+ if (!p_wmnu || (c != K_UP && c != K_DOWN))
+#endif
+ xpc.xp_context = EXPAND_NOTHING;
+ wim_index = 0;
+#ifdef FEAT_WILDMENU
+ if (p_wmnu && wild_menu_showing != 0)
+ {
+ int skt = KeyTyped;
+
+ if (wild_menu_showing == WM_SCROLLED)
+ {
+ /* Entered command line, move it up */
+ cmdline_row--;
+ redrawcmd();
+ }
+ else if (save_p_ls != -1)
+ {
+ /* restore 'laststatus' and 'winminheight' */
+ p_ls = save_p_ls;
+ p_wmh = save_p_wmh;
+ last_status(FALSE);
+ update_screen(VALID); /* redraw the screen NOW */
+ redrawcmd();
+ save_p_ls = -1;
+ }
+ else
+ {
+# ifdef FEAT_VERTSPLIT
+ win_redraw_last_status(topframe);
+# else
+ lastwin->w_redr_status = TRUE;
+# endif
+ redraw_statuslines();
+ }
+ KeyTyped = skt;
+ wild_menu_showing = 0;
+ }
+#endif
+ }
+
+#ifdef FEAT_WILDMENU
+ /* Special translations for 'wildmenu' */
+ if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
+ {
+ /* Hitting <Down> after "emenu Name.": complete submenu */
+ if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
+ c = p_wc;
+ else if (c == K_UP)
+ {
+ /* Hitting <Up>: Remove one submenu name in front of the
+ * cursor */
+ int found = FALSE;
+
+ j = (int)(xpc.xp_pattern - ccline.cmdbuff);
+ i = 0;
+ while (--j > 0)
+ {
+ /* check for start of menu name */
+ if (ccline.cmdbuff[j] == ' '
+ && ccline.cmdbuff[j - 1] != '\\')
+ {
+ i = j + 1;
+ break;
+ }
+ /* check for start of submenu name */
+ if (ccline.cmdbuff[j] == '.'
+ && ccline.cmdbuff[j - 1] != '\\')
+ {
+ if (found)
+ {
+ i = j + 1;
+ break;
+ }
+ else
+ found = TRUE;
+ }
+ }
+ if (i > 0)
+ cmdline_del(i);
+ c = p_wc;
+ xpc.xp_context = EXPAND_NOTHING;
+ }
+ }
+ if (xpc.xp_context == EXPAND_FILES && p_wmnu)
+ {
+ char_u upseg[5];
+
+ upseg[0] = PATHSEP;
+ upseg[1] = '.';
+ upseg[2] = '.';
+ upseg[3] = PATHSEP;
+ upseg[4] = NUL;
+
+ if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
+ && c == K_DOWN
+ && (ccline.cmdbuff[ccline.cmdpos - 2] != '.'
+ || ccline.cmdbuff[ccline.cmdpos - 3] != '.'))
+ {
+ /* go down a directory */
+ c = p_wc;
+ }
+ else if (STRNCMP(xpc.xp_pattern, upseg + 1, 3) == 0 && c == K_DOWN)
+ {
+ /* If in a direct ancestor, strip off one ../ to go down */
+ int found = FALSE;
+
+ j = ccline.cmdpos;
+ i = (int)(xpc.xp_pattern - ccline.cmdbuff);
+ while (--j > i)
+ {
+ if (vim_ispathsep(ccline.cmdbuff[j]))
+ {
+ found = TRUE;
+ break;
+ }
+ }
+ if (found
+ && ccline.cmdbuff[j - 1] == '.'
+ && ccline.cmdbuff[j - 2] == '.'
+ && (vim_ispathsep(ccline.cmdbuff[j - 3]) || j == i + 2))
+ {
+ cmdline_del(j - 2);
+ c = p_wc;
+ }
+ }
+ else if (c == K_UP)
+ {
+ /* go up a directory */
+ int found = FALSE;
+
+ j = ccline.cmdpos - 1;
+ i = (int)(xpc.xp_pattern - ccline.cmdbuff);
+ while (--j > i)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ j -= (*mb_head_off)(ccline.cmdbuff, ccline.cmdbuff + j);
+#endif
+ if (vim_ispathsep(ccline.cmdbuff[j])
+#ifdef BACKSLASH_IN_FILENAME
+ && vim_strchr(" *?[{`$%#", ccline.cmdbuff[j + 1])
+ == NULL
+#endif
+ )
+ {
+ if (found)
+ {
+ i = j + 1;
+ break;
+ }
+ else
+ found = TRUE;
+ }
+ }
+
+ if (!found)
+ j = i;
+ else if (STRNCMP(ccline.cmdbuff + j, upseg, 4) == 0)
+ j += 4;
+ else if (STRNCMP(ccline.cmdbuff + j, upseg + 1, 3) == 0
+ && j == i)
+ j += 3;
+ else
+ j = 0;
+ if (j > 0)
+ {
+ /* TODO this is only for DOS/UNIX systems - need to put in
+ * machine-specific stuff here and in upseg init */
+ cmdline_del(j);
+ put_on_cmdline(upseg + 1, 3, FALSE);
+ }
+ else if (ccline.cmdpos > i)
+ cmdline_del(i);
+ c = p_wc;
+ }
+ }
+#if 0 /* If enabled <Down> on a file takes you _completely_ out of wildmenu */
+ if (p_wmnu
+ && (xpc.xp_context == EXPAND_FILES
+ || xpc.xp_context == EXPAND_MENUNAMES)
+ && (c == K_UP || c == K_DOWN))
+ xpc.xp_context = EXPAND_NOTHING;
+#endif
+
+#endif /* FEAT_WILDMENU */
+
+ /* CTRL-\ CTRL-N goes to Normal mode, CTRL-\ CTRL-G goes to Insert
+ * mode when 'insertmode' is set, CTRL-\ e prompts for an expression. */
+ if (c == Ctrl_BSL)
+ {
+ ++no_mapping;
+ ++allow_keys;
+ c = safe_vgetc();
+ --no_mapping;
+ --allow_keys;
+ /* CTRL-\ e doesn't work when obtaining an expression. */
+ if (c != Ctrl_N && c != Ctrl_G
+ && (c != 'e' || ccline.cmdfirstc == '='))
+ {
+ vungetc(c);
+ c = Ctrl_BSL;
+ }
+#ifdef FEAT_EVAL
+ else if (c == 'e')
+ {
+ struct cmdline_info save_ccline;
+ char_u *p;
+
+ /*
+ * Replace the command line with the result of an expression.
+ * Need to save the current command line, to be able to enter
+ * a new one...
+ */
+ if (ccline.cmdpos == ccline.cmdlen)
+ new_cmdpos = 99999; /* keep it at the end */
+ else
+ new_cmdpos = ccline.cmdpos;
+ save_ccline = ccline;
+ ccline.cmdbuff = NULL;
+ ccline.cmdprompt = NULL;
+ c = get_expr_register();
+ ccline = save_ccline;
+ if (c == '=')
+ {
+ p = get_expr_line();
+ if (p != NULL
+ && realloc_cmdbuff((int)STRLEN(p) + 1) == OK)
+ {
+ ccline.cmdlen = STRLEN(p);
+ STRCPY(ccline.cmdbuff, p);
+ vim_free(p);
+
+ /* Restore the cursor or use the position set with
+ * set_cmdline_pos(). */
+ if (new_cmdpos > ccline.cmdlen)
+ ccline.cmdpos = ccline.cmdlen;
+ else
+ ccline.cmdpos = new_cmdpos;
+
+ KeyTyped = FALSE; /* Don't do p_wc completion. */
+ redrawcmd();
+ goto cmdline_changed;
+ }
+ }
+ beep_flush();
+ c = ESC;
+ }
+#endif
+ else
+ {
+ if (c == Ctrl_G && p_im && restart_edit == 0)
+ restart_edit = 'a';
+ gotesc = TRUE; /* will free ccline.cmdbuff after putting it
+ in history */
+ goto returncmd; /* back to Normal mode */
+ }
+ }
+
+#ifdef FEAT_CMDWIN
+ if (c == cedit_key || c == K_CMDWIN)
+ {
+ /*
+ * Open a window to edit the command line (and history).
+ */
+ c = ex_window();
+ some_key_typed = TRUE;
+ }
+# ifdef FEAT_DIGRAPHS
+ else
+# endif
+#endif
+#ifdef FEAT_DIGRAPHS
+ c = do_digraph(c);
+#endif
+
+ if (c == '\n' || c == '\r' || c == K_KENTER || (c == ESC
+ && (!KeyTyped || vim_strchr(p_cpo, CPO_ESC) != NULL)))
+ {
+ gotesc = FALSE; /* Might have typed ESC previously, don't
+ truncate the cmdline now. */
+ if (ccheck_abbr(c + ABBR_OFF))
+ goto cmdline_changed;
+ if (!cmd_silent)
+ {
+ windgoto(msg_row, 0);
+ out_flush();
+ }
+ break;
+ }
+
+ /*
+ * Completion for 'wildchar' or 'wildcharm' key.
+ * - hitting <ESC> twice means: abandon command line.
+ * - wildcard expansion is only done when the 'wildchar' key is really
+ * typed, not when it comes from a macro
+ */
+ if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm)
+ {
+ if (xpc.xp_numfiles > 0) /* typed p_wc at least twice */
+ {
+ /* if 'wildmode' contains "list" may still need to list */
+ if (xpc.xp_numfiles > 1
+ && !did_wild_list
+ && (wim_flags[wim_index] & WIM_LIST))
+ {
+ (void)showmatches(&xpc, FALSE);
+ redrawcmd();
+ did_wild_list = TRUE;
+ }
+ if (wim_flags[wim_index] & WIM_LONGEST)
+ res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
+ else if (wim_flags[wim_index] & WIM_FULL)
+ res = nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP);
+ else
+ res = OK; /* don't insert 'wildchar' now */
+ }
+ else /* typed p_wc first time */
+ {
+ wim_index = 0;
+ j = ccline.cmdpos;
+ /* if 'wildmode' first contains "longest", get longest
+ * common part */
+ if (wim_flags[0] & WIM_LONGEST)
+ res = nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
+ else
+ res = nextwild(&xpc, WILD_EXPAND_KEEP, WILD_NO_BEEP);
+
+ /* if interrupted while completing, behave like it failed */
+ if (got_int)
+ {
+ (void)vpeekc(); /* remove <C-C> from input stream */
+ got_int = FALSE; /* don't abandon the command line */
+ (void)ExpandOne(&xpc, NULL, NULL, 0, WILD_FREE);
+#ifdef FEAT_WILDMENU
+ xpc.xp_context = EXPAND_NOTHING;
+#endif
+ goto cmdline_changed;
+ }
+
+ /* when more than one match, and 'wildmode' first contains
+ * "list", or no change and 'wildmode' contains "longest,list",
+ * list all matches */
+ if (res == OK && xpc.xp_numfiles > 1)
+ {
+ /* a "longest" that didn't do anything is skipped (but not
+ * "list:longest") */
+ if (wim_flags[0] == WIM_LONGEST && ccline.cmdpos == j)
+ wim_index = 1;
+ if ((wim_flags[wim_index] & WIM_LIST)
+#ifdef FEAT_WILDMENU
+ || (p_wmnu && (wim_flags[wim_index] & WIM_FULL) != 0)
+#endif
+ )
+ {
+ if (!(wim_flags[0] & WIM_LONGEST))
+ {
+#ifdef FEAT_WILDMENU
+ int p_wmnu_save = p_wmnu;
+ p_wmnu = 0;
+#endif
+ nextwild(&xpc, WILD_PREV, 0); /* remove match */
+#ifdef FEAT_WILDMENU
+ p_wmnu = p_wmnu_save;
+#endif
+ }
+#ifdef FEAT_WILDMENU
+ (void)showmatches(&xpc, p_wmnu
+ && ((wim_flags[wim_index] & WIM_LIST) == 0));
+#else
+ (void)showmatches(&xpc, FALSE);
+#endif
+ redrawcmd();
+ did_wild_list = TRUE;
+ if (wim_flags[wim_index] & WIM_LONGEST)
+ nextwild(&xpc, WILD_LONGEST, WILD_NO_BEEP);
+ else if (wim_flags[wim_index] & WIM_FULL)
+ nextwild(&xpc, WILD_NEXT, WILD_NO_BEEP);
+ }
+ else
+ vim_beep();
+ }
+#ifdef FEAT_WILDMENU
+ else if (xpc.xp_numfiles == -1)
+ xpc.xp_context = EXPAND_NOTHING;
+#endif
+ }
+ if (wim_index < 3)
+ ++wim_index;
+ if (c == ESC)
+ gotesc = TRUE;
+ if (res == OK)
+ goto cmdline_changed;
+ }
+
+ gotesc = FALSE;
+
+ /* <S-Tab> goes to last match, in a clumsy way */
+ if (c == K_S_TAB && KeyTyped)
+ {
+ if (nextwild(&xpc, WILD_EXPAND_KEEP, 0) == OK
+ && nextwild(&xpc, WILD_PREV, 0) == OK
+ && nextwild(&xpc, WILD_PREV, 0) == OK)
+ goto cmdline_changed;
+ }
+
+ if (c == NUL || c == K_ZERO) /* NUL is stored as NL */
+ c = NL;
+
+ do_abbr = TRUE; /* default: check for abbreviation */
+
+ /*
+ * Big switch for a typed command line character.
+ */
+ switch (c)
+ {
+ case K_BS:
+ case Ctrl_H:
+ case K_DEL:
+ case K_KDEL:
+ case Ctrl_W:
+#ifdef FEAT_FKMAP
+ if (cmd_fkmap && c == K_BS)
+ c = K_DEL;
+#endif
+ if (c == K_KDEL)
+ c = K_DEL;
+
+ /*
+ * delete current character is the same as backspace on next
+ * character, except at end of line
+ */
+ if (c == K_DEL && ccline.cmdpos != ccline.cmdlen)
+ ++ccline.cmdpos;
+#ifdef FEAT_MBYTE
+ if (has_mbyte && c == K_DEL)
+ ccline.cmdpos += mb_off_next(ccline.cmdbuff,
+ ccline.cmdbuff + ccline.cmdpos);
+#endif
+ if (ccline.cmdpos > 0)
+ {
+ char_u *p;
+
+ j = ccline.cmdpos;
+ p = ccline.cmdbuff + j;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ p = mb_prevptr(ccline.cmdbuff, p);
+ if (c == Ctrl_W)
+ {
+ while (p > ccline.cmdbuff && vim_isspace(*p))
+ p = mb_prevptr(ccline.cmdbuff, p);
+ i = mb_get_class(p);
+ while (p > ccline.cmdbuff && mb_get_class(p) == i)
+ p = mb_prevptr(ccline.cmdbuff, p);
+ if (mb_get_class(p) != i)
+ p += (*mb_ptr2len_check)(p);
+ }
+ }
+ else
+#endif
+ if (c == Ctrl_W)
+ {
+ while (p > ccline.cmdbuff && vim_isspace(p[-1]))
+ --p;
+ i = vim_iswordc(p[-1]);
+ while (p > ccline.cmdbuff && !vim_isspace(p[-1])
+ && vim_iswordc(p[-1]) == i)
+ --p;
+ }
+ else
+ --p;
+ ccline.cmdpos = (int)(p - ccline.cmdbuff);
+ ccline.cmdlen -= j - ccline.cmdpos;
+ i = ccline.cmdpos;
+ while (i < ccline.cmdlen)
+ ccline.cmdbuff[i++] = ccline.cmdbuff[j++];
+
+ /* Truncate at the end, required for multi-byte chars. */
+ ccline.cmdbuff[ccline.cmdlen] = NUL;
+ redrawcmd();
+ }
+ else if (ccline.cmdlen == 0 && c != Ctrl_W
+ && ccline.cmdprompt == NULL && indent == 0)
+ {
+ /* In ex and debug mode it doesn't make sense to return. */
+ if (exmode_active
+#ifdef FEAT_EVAL
+ || ccline.cmdfirstc == '>'
+#endif
+ )
+ goto cmdline_not_changed;
+
+ vim_free(ccline.cmdbuff); /* no commandline to return */
+ ccline.cmdbuff = NULL;
+ if (!cmd_silent)
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ msg_col = Columns;
+ else
+#endif
+ msg_col = 0;
+ msg_putchar(' '); /* delete ':' */
+ }
+ redraw_cmdline = TRUE;
+ goto returncmd; /* back to cmd mode */
+ }
+ goto cmdline_changed;
+
+ case K_INS:
+ case K_KINS:
+#ifdef FEAT_FKMAP
+ /* if Farsi mode set, we are in reverse insert mode -
+ Do not change the mode */
+ if (cmd_fkmap)
+ beep_flush();
+ else
+#endif
+ ccline.overstrike = !ccline.overstrike;
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+ goto cmdline_not_changed;
+
+ case Ctrl_HAT:
+ if (map_to_exists_mode((char_u *)"", LANGMAP))
+ {
+ /* ":lmap" mappings exists, toggle use of mappings. */
+ State ^= LANGMAP;
+#ifdef USE_IM_CONTROL
+ im_set_active(FALSE); /* Disable input method */
+#endif
+ if (b_im_ptr != NULL)
+ {
+ if (State & LANGMAP)
+ *b_im_ptr = B_IMODE_LMAP;
+ else
+ *b_im_ptr = B_IMODE_NONE;
+ }
+ }
+#ifdef USE_IM_CONTROL
+ else
+ {
+ /* There are no ":lmap" mappings, toggle IM. When
+ * 'imdisable' is set don't try getting the status, it's
+ * always off. */
+ if ((p_imdisable && b_im_ptr != NULL)
+ ? *b_im_ptr == B_IMODE_IM : im_get_status())
+ {
+ im_set_active(FALSE); /* Disable input method */
+ if (b_im_ptr != NULL)
+ *b_im_ptr = B_IMODE_NONE;
+ }
+ else
+ {
+ im_set_active(TRUE); /* Enable input method */
+ if (b_im_ptr != NULL)
+ *b_im_ptr = B_IMODE_IM;
+ }
+ }
+#endif
+ if (b_im_ptr != NULL)
+ {
+ if (b_im_ptr == &curbuf->b_p_iminsert)
+ set_iminsert_global();
+ else
+ set_imsearch_global();
+ }
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+ /* Show/unshow value of 'keymap' in status lines later. */
+ status_redraw_curbuf();
+#endif
+ goto cmdline_not_changed;
+
+/* case '@': only in very old vi */
+ case Ctrl_U:
+ /* delete all characters left of the cursor */
+ j = ccline.cmdpos;
+ ccline.cmdlen -= j;
+ i = ccline.cmdpos = 0;
+ while (i < ccline.cmdlen)
+ ccline.cmdbuff[i++] = ccline.cmdbuff[j++];
+ /* Truncate at the end, required for multi-byte chars. */
+ ccline.cmdbuff[ccline.cmdlen] = NUL;
+ redrawcmd();
+ goto cmdline_changed;
+
+#ifdef FEAT_CLIPBOARD
+ case Ctrl_Y:
+ /* Copy the modeless selection, if there is one. */
+ if (clip_star.state != SELECT_CLEARED)
+ {
+ if (clip_star.state == SELECT_DONE)
+ clip_copy_modeless_selection(TRUE);
+ goto cmdline_not_changed;
+ }
+ break;
+#endif
+
+ case ESC: /* get here if p_wc != ESC or when ESC typed twice */
+ case Ctrl_C:
+ /* In exmode it doesn't make sense to return. */
+ if (exmode_active)
+ goto cmdline_not_changed;
+
+ gotesc = TRUE; /* will free ccline.cmdbuff after
+ putting it in history */
+ goto returncmd; /* back to cmd mode */
+
+ case Ctrl_R: /* insert register */
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ putcmdline('"', TRUE);
+ ++no_mapping;
+ i = c = safe_vgetc(); /* CTRL-R <char> */
+ if (i == Ctrl_O)
+ i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */
+ if (i == Ctrl_R)
+ c = safe_vgetc(); /* CTRL-R CTRL-R <char> */
+ --no_mapping;
+#ifdef FEAT_EVAL
+ /*
+ * Insert the result of an expression.
+ * Need to save the current command line, to be able to enter
+ * a new one...
+ */
+ new_cmdpos = -1;
+ if (c == '=')
+ {
+ struct cmdline_info save_ccline;
+
+ if (ccline.cmdfirstc == '=')/* can't do this recursively */
+ {
+ beep_flush();
+ c = ESC;
+ }
+ else
+ {
+ save_ccline = ccline;
+ ccline.cmdbuff = NULL;
+ ccline.cmdprompt = NULL;
+ c = get_expr_register();
+ ccline = save_ccline;
+ }
+ }
+#endif
+ if (c != ESC) /* use ESC to cancel inserting register */
+ {
+ cmdline_paste(c, i == Ctrl_R);
+ KeyTyped = FALSE; /* Don't do p_wc completion. */
+#ifdef FEAT_EVAL
+ if (new_cmdpos >= 0)
+ {
+ /* set_cmdline_pos() was used */
+ if (new_cmdpos > ccline.cmdlen)
+ ccline.cmdpos = ccline.cmdlen;
+ else
+ ccline.cmdpos = new_cmdpos;
+ }
+#endif
+ }
+ redrawcmd();
+ goto cmdline_changed;
+
+ case Ctrl_D:
+ if (showmatches(&xpc, FALSE) == EXPAND_NOTHING)
+ break; /* Use ^D as normal char instead */
+
+ redrawcmd();
+ continue; /* don't do incremental search now */
+
+ case K_RIGHT:
+ case K_S_RIGHT:
+ case K_C_RIGHT:
+ do
+ {
+ if (ccline.cmdpos >= ccline.cmdlen)
+ break;
+ i = cmdline_charsize(ccline.cmdpos);
+ if (KeyTyped && ccline.cmdspos + i >= Columns * Rows)
+ break;
+ ccline.cmdspos += i;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ ccline.cmdpos += (*mb_ptr2len_check)(ccline.cmdbuff
+ + ccline.cmdpos);
+ else
+#endif
+ ++ccline.cmdpos;
+ }
+ while ((c == K_S_RIGHT || c == K_C_RIGHT)
+ && ccline.cmdbuff[ccline.cmdpos] != ' ');
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ set_cmdspos_cursor();
+#endif
+ goto cmdline_not_changed;
+
+ case K_LEFT:
+ case K_S_LEFT:
+ case K_C_LEFT:
+ do
+ {
+ if (ccline.cmdpos == 0)
+ break;
+ --ccline.cmdpos;
+#ifdef FEAT_MBYTE
+ if (has_mbyte) /* move to first byte of char */
+ ccline.cmdpos -= (*mb_head_off)(ccline.cmdbuff,
+ ccline.cmdbuff + ccline.cmdpos);
+#endif
+ ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
+ }
+ while ((c == K_S_LEFT || c == K_C_LEFT)
+ && ccline.cmdbuff[ccline.cmdpos - 1] != ' ');
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ set_cmdspos_cursor();
+#endif
+ goto cmdline_not_changed;
+
+ case K_IGNORE:
+ goto cmdline_not_changed; /* Ignore mouse */
+
+#ifdef FEAT_MOUSE
+ case K_MIDDLEDRAG:
+ case K_MIDDLERELEASE:
+ goto cmdline_not_changed; /* Ignore mouse */
+
+ case K_MIDDLEMOUSE:
+# ifdef FEAT_GUI
+ /* When GUI is active, also paste when 'mouse' is empty */
+ if (!gui.in_use)
+# endif
+ if (!mouse_has(MOUSE_COMMAND))
+ goto cmdline_not_changed; /* Ignore mouse */
+#ifdef FEAT_CLIPBOARD
+ if (clip_star.available)
+ cmdline_paste('*', TRUE);
+ else
+#endif
+ cmdline_paste(0, TRUE);
+ redrawcmd();
+ goto cmdline_changed;
+
+#ifdef FEAT_DND
+ case K_DROP:
+ cmdline_paste('~', TRUE);
+ redrawcmd();
+ goto cmdline_changed;
+#endif
+
+ case K_LEFTDRAG:
+ case K_LEFTRELEASE:
+ case K_RIGHTDRAG:
+ case K_RIGHTRELEASE:
+ /* Ignore drag and release events when the button-down wasn't
+ * seen before. */
+ if (ignore_drag_release)
+ goto cmdline_not_changed;
+ /* FALLTHROUGH */
+ case K_LEFTMOUSE:
+ case K_RIGHTMOUSE:
+ if (c == K_LEFTRELEASE || c == K_RIGHTRELEASE)
+ ignore_drag_release = TRUE;
+ else
+ ignore_drag_release = FALSE;
+# ifdef FEAT_GUI
+ /* When GUI is active, also move when 'mouse' is empty */
+ if (!gui.in_use)
+# endif
+ if (!mouse_has(MOUSE_COMMAND))
+ goto cmdline_not_changed; /* Ignore mouse */
+# ifdef FEAT_CLIPBOARD
+ if (mouse_row < cmdline_row && clip_star.available)
+ {
+ int button, is_click, is_drag;
+
+ /*
+ * Handle modeless selection.
+ */
+ button = get_mouse_button(KEY2TERMCAP1(c),
+ &is_click, &is_drag);
+ if (mouse_model_popup() && button == MOUSE_LEFT
+ && (mod_mask & MOD_MASK_SHIFT))
+ {
+ /* Translate shift-left to right button. */
+ button = MOUSE_RIGHT;
+ mod_mask &= ~MOD_MASK_SHIFT;
+ }
+ clip_modeless(button, is_click, is_drag);
+ goto cmdline_not_changed;
+ }
+# endif
+
+ set_cmdspos();
+ for (ccline.cmdpos = 0; ccline.cmdpos < ccline.cmdlen;
+ ++ccline.cmdpos)
+ {
+ i = cmdline_charsize(ccline.cmdpos);
+ if (mouse_row <= cmdline_row + ccline.cmdspos / Columns
+ && mouse_col < ccline.cmdspos % Columns + i)
+ break;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Count ">" for double-wide char that doesn't fit. */
+ correct_cmdspos(ccline.cmdpos, i);
+ ccline.cmdpos += (*mb_ptr2len_check)(ccline.cmdbuff
+ + ccline.cmdpos) - 1;
+ }
+#endif
+ ccline.cmdspos += i;
+ }
+ goto cmdline_not_changed;
+
+ /* Mouse scroll wheel: ignored here */
+ case K_MOUSEDOWN:
+ case K_MOUSEUP:
+ /* Alternate buttons ignored here */
+ case K_X1MOUSE:
+ case K_X1DRAG:
+ case K_X1RELEASE:
+ case K_X2MOUSE:
+ case K_X2DRAG:
+ case K_X2RELEASE:
+ goto cmdline_not_changed;
+
+#endif /* FEAT_MOUSE */
+
+#ifdef FEAT_GUI
+ case K_LEFTMOUSE_NM: /* mousefocus click, ignored */
+ case K_LEFTRELEASE_NM:
+ goto cmdline_not_changed;
+
+ case K_VER_SCROLLBAR:
+ if (!msg_scrolled)
+ {
+ gui_do_scroll();
+ redrawcmd();
+ }
+ goto cmdline_not_changed;
+
+ case K_HOR_SCROLLBAR:
+ if (!msg_scrolled)
+ {
+ gui_do_horiz_scroll();
+ redrawcmd();
+ }
+ goto cmdline_not_changed;
+#endif
+ case K_SELECT: /* end of Select mode mapping - ignore */
+ goto cmdline_not_changed;
+
+ case Ctrl_B: /* begin of command line */
+ case K_HOME:
+ case K_KHOME:
+ case K_XHOME:
+ case K_S_HOME:
+ case K_C_HOME:
+ ccline.cmdpos = 0;
+ set_cmdspos();
+ goto cmdline_not_changed;
+
+ case Ctrl_E: /* end of command line */
+ case K_END:
+ case K_KEND:
+ case K_XEND:
+ case K_S_END:
+ case K_C_END:
+ ccline.cmdpos = ccline.cmdlen;
+ set_cmdspos_cursor();
+ goto cmdline_not_changed;
+
+ case Ctrl_A: /* all matches */
+ if (nextwild(&xpc, WILD_ALL, 0) == FAIL)
+ break;
+ goto cmdline_changed;
+
+ case Ctrl_L: /* longest common part */
+ if (nextwild(&xpc, WILD_LONGEST, 0) == FAIL)
+ break;
+ goto cmdline_changed;
+
+ case Ctrl_N: /* next match */
+ case Ctrl_P: /* previous match */
+ if (xpc.xp_numfiles > 0)
+ {
+ if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT, 0)
+ == FAIL)
+ break;
+ goto cmdline_changed;
+ }
+
+#ifdef FEAT_CMDHIST
+ case K_UP:
+ case K_DOWN:
+ case K_S_UP:
+ case K_S_DOWN:
+ case K_PAGEUP:
+ case K_KPAGEUP:
+ case K_PAGEDOWN:
+ case K_KPAGEDOWN:
+ if (hislen == 0 || firstc == NUL) /* no history */
+ goto cmdline_not_changed;
+
+ i = hiscnt;
+
+ /* save current command string so it can be restored later */
+ if (lookfor == NULL)
+ {
+ if ((lookfor = vim_strsave(ccline.cmdbuff)) == NULL)
+ goto cmdline_not_changed;
+ lookfor[ccline.cmdpos] = NUL;
+ }
+
+ j = (int)STRLEN(lookfor);
+ for (;;)
+ {
+ /* one step backwards */
+ if (c == K_UP || c == K_S_UP || c == Ctrl_P ||
+ c == K_PAGEUP || c == K_KPAGEUP)
+ {
+ if (hiscnt == hislen) /* first time */
+ hiscnt = hisidx[histype];
+ else if (hiscnt == 0 && hisidx[histype] != hislen - 1)
+ hiscnt = hislen - 1;
+ else if (hiscnt != hisidx[histype] + 1)
+ --hiscnt;
+ else /* at top of list */
+ {
+ hiscnt = i;
+ break;
+ }
+ }
+ else /* one step forwards */
+ {
+ /* on last entry, clear the line */
+ if (hiscnt == hisidx[histype])
+ {
+ hiscnt = hislen;
+ break;
+ }
+
+ /* not on a history line, nothing to do */
+ if (hiscnt == hislen)
+ break;
+ if (hiscnt == hislen - 1) /* wrap around */
+ hiscnt = 0;
+ else
+ ++hiscnt;
+ }
+ if (hiscnt < 0 || history[histype][hiscnt].hisstr == NULL)
+ {
+ hiscnt = i;
+ break;
+ }
+ if ((c != K_UP && c != K_DOWN) || hiscnt == i
+ || STRNCMP(history[histype][hiscnt].hisstr,
+ lookfor, (size_t)j) == 0)
+ break;
+ }
+
+ if (hiscnt != i) /* jumped to other entry */
+ {
+ char_u *p;
+ int len;
+ int old_firstc;
+
+ vim_free(ccline.cmdbuff);
+ if (hiscnt == hislen)
+ p = lookfor; /* back to the old one */
+ else
+ p = history[histype][hiscnt].hisstr;
+
+ if (histype == HIST_SEARCH
+ && p != lookfor
+ && (old_firstc = p[STRLEN(p) + 1]) != firstc)
+ {
+ /* Correct for the separator character used when
+ * adding the history entry vs the one used now.
+ * First loop: count length.
+ * Second loop: copy the characters. */
+ for (i = 0; i <= 1; ++i)
+ {
+ len = 0;
+ for (j = 0; p[j] != NUL; ++j)
+ {
+ /* Replace old sep with new sep, unless it is
+ * escaped. */
+ if (p[j] == old_firstc
+ && (j == 0 || p[j - 1] != '\\'))
+ {
+ if (i > 0)
+ ccline.cmdbuff[len] = firstc;
+ }
+ else
+ {
+ /* Escape new sep, unless it is already
+ * escaped. */
+ if (p[j] == firstc
+ && (j == 0 || p[j - 1] != '\\'))
+ {
+ if (i > 0)
+ ccline.cmdbuff[len] = '\\';
+ ++len;
+ }
+ if (i > 0)
+ ccline.cmdbuff[len] = p[j];
+ }
+ ++len;
+ }
+ if (i == 0)
+ {
+ alloc_cmdbuff(len);
+ if (ccline.cmdbuff == NULL)
+ goto returncmd;
+ }
+ }
+ ccline.cmdbuff[len] = NUL;
+ }
+ else
+ {
+ alloc_cmdbuff((int)STRLEN(p));
+ if (ccline.cmdbuff == NULL)
+ goto returncmd;
+ STRCPY(ccline.cmdbuff, p);
+ }
+
+ ccline.cmdpos = ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);
+ redrawcmd();
+ goto cmdline_changed;
+ }
+ beep_flush();
+ goto cmdline_not_changed;
+#endif
+
+ case Ctrl_V:
+ case Ctrl_Q:
+#ifdef FEAT_MOUSE
+ ignore_drag_release = TRUE;
+#endif
+ putcmdline('^', TRUE);
+ c = get_literal(); /* get next (two) character(s) */
+ do_abbr = FALSE; /* don't do abbreviation now */
+#ifdef FEAT_MBYTE
+ /* may need to remove ^ when composing char was typed */
+ if (enc_utf8 && utf_iscomposing(c) && !cmd_silent)
+ {
+ draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
+ msg_putchar(' ');
+ cursorcmd();
+ }
+#endif
+ break;
+
+#ifdef FEAT_DIGRAPHS
+ case Ctrl_K:
+#ifdef FEAT_MOUSE
+ ignore_drag_release = TRUE;
+#endif
+ putcmdline('?', TRUE);
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ c = get_digraph(TRUE);
+ if (c != NUL)
+ break;
+
+ redrawcmd();
+ goto cmdline_not_changed;
+#endif /* FEAT_DIGRAPHS */
+
+#ifdef FEAT_RIGHTLEFT
+ case Ctrl__: /* CTRL-_: switch language mode */
+ if (!p_ari)
+ break;
+#ifdef FEAT_FKMAP
+ if (p_altkeymap)
+ {
+ cmd_fkmap = !cmd_fkmap;
+ if (cmd_fkmap) /* in Farsi always in Insert mode */
+ ccline.overstrike = FALSE;
+ }
+ else /* Hebrew is default */
+#endif
+ cmd_hkmap = !cmd_hkmap;
+ goto cmdline_not_changed;
+#endif
+
+ default:
+#ifdef UNIX
+ if (c == intr_char)
+ {
+ gotesc = TRUE; /* will free ccline.cmdbuff after
+ putting it in history */
+ goto returncmd; /* back to Normal mode */
+ }
+#endif
+ /*
+ * Normal character with no special meaning. Just set mod_mask
+ * to 0x0 so that typing Shift-Space in the GUI doesn't enter
+ * the string <S-Space>. This should only happen after ^V.
+ */
+ if (!IS_SPECIAL(c))
+ mod_mask = 0x0;
+ break;
+ }
+ /*
+ * End of switch on command line character.
+ * We come here if we have a normal character.
+ */
+
+ if (do_abbr && (IS_SPECIAL(c) || !vim_iswordc(c)) && ccheck_abbr(
+#ifdef FEAT_MBYTE
+ /* Add ABBR_OFF for characters above 0x100, this is
+ * what check_abbr() expects. */
+ (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) :
+#endif
+ c))
+ goto cmdline_changed;
+
+ /*
+ * put the character in the command line
+ */
+ if (IS_SPECIAL(c) || mod_mask != 0)
+ put_on_cmdline(get_special_key_name(c, mod_mask), -1, TRUE);
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ j = (*mb_char2bytes)(c, IObuff);
+ IObuff[j] = NUL; /* exclude composing chars */
+ put_on_cmdline(IObuff, j, TRUE);
+ }
+ else
+#endif
+ {
+ IObuff[0] = c;
+ put_on_cmdline(IObuff, 1, TRUE);
+ }
+ }
+ goto cmdline_changed;
+
+/*
+ * This part implements incremental searches for "/" and "?"
+ * Jump to cmdline_not_changed when a character has been read but the command
+ * line did not change. Then we only search and redraw if something changed in
+ * the past.
+ * Jump to cmdline_changed when the command line did change.
+ * (Sorry for the goto's, I know it is ugly).
+ */
+cmdline_not_changed:
+#ifdef FEAT_SEARCH_EXTRA
+ if (!incsearch_postponed)
+ continue;
+#endif
+
+cmdline_changed:
+#ifdef FEAT_SEARCH_EXTRA
+ /*
+ * 'incsearch' highlighting.
+ */
+ if (p_is && !cmd_silent && (firstc == '/' || firstc == '?'))
+ {
+ /* if there is a character waiting, search and redraw later */
+ if (char_avail())
+ {
+ incsearch_postponed = TRUE;
+ continue;
+ }
+ incsearch_postponed = FALSE;
+ curwin->w_cursor = old_cursor; /* start at old position */
+
+ /* If there is no command line, don't do anything */
+ if (ccline.cmdlen == 0)
+ i = 0;
+ else
+ {
+ cursor_off(); /* so the user knows we're busy */
+ out_flush();
+ ++emsg_off; /* So it doesn't beep if bad expr */
+ i = do_search(NULL, firstc, ccline.cmdbuff, count,
+ SEARCH_KEEP + SEARCH_OPT + SEARCH_NOOF + SEARCH_PEEK);
+ --emsg_off;
+ /* if interrupted while searching, behave like it failed */
+ if (got_int)
+ {
+ (void)vpeekc(); /* remove <C-C> from input stream */
+ got_int = FALSE; /* don't abandon the command line */
+ i = 0;
+ }
+ else if (char_avail())
+ /* cancelled searching because a char was typed */
+ incsearch_postponed = TRUE;
+ }
+ if (i)
+ highlight_match = TRUE; /* highlight position */
+ else
+ highlight_match = FALSE; /* remove highlight */
+
+ /* first restore the old curwin values, so the screen is
+ * positioned in the same way as the actual search command */
+ curwin->w_leftcol = old_leftcol;
+ curwin->w_topline = old_topline;
+# ifdef FEAT_DIFF
+ curwin->w_topfill = old_topfill;
+# endif
+ curwin->w_botline = old_botline;
+ changed_cline_bef_curs();
+ update_topline();
+
+ if (i != 0)
+ {
+ /*
+ * First move cursor to end of match, then to start. This
+ * moves the whole match onto the screen when 'nowrap' is set.
+ */
+ i = curwin->w_cursor.col;
+ curwin->w_cursor.lnum += search_match_lines;
+ curwin->w_cursor.col = search_match_endcol;
+ validate_cursor();
+ curwin->w_cursor.lnum -= search_match_lines;
+ curwin->w_cursor.col = i;
+ }
+ validate_cursor();
+
+ update_screen(NOT_VALID);
+ msg_starthere();
+ redrawcmdline();
+ did_incsearch = TRUE;
+ }
+#else /* FEAT_SEARCH_EXTRA */
+ ;
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl
+# ifdef FEAT_ARABIC
+ || p_arshape
+# endif
+ )
+ /* Always redraw the whole command line to fix shaping and
+ * right-left typing. Not efficient, but it works. */
+ redrawcmd();
+#endif
+ }
+
+returncmd:
+
+#ifdef FEAT_RIGHTLEFT
+ cmdmsg_rl = FALSE;
+#endif
+
+#ifdef FEAT_FKMAP
+ cmd_fkmap = 0;
+#endif
+
+ ExpandCleanup(&xpc);
+
+#ifdef FEAT_SEARCH_EXTRA
+ if (did_incsearch)
+ {
+ curwin->w_cursor = old_cursor;
+ curwin->w_curswant = old_curswant;
+ curwin->w_leftcol = old_leftcol;
+ curwin->w_topline = old_topline;
+# ifdef FEAT_DIFF
+ curwin->w_topfill = old_topfill;
+# endif
+ curwin->w_botline = old_botline;
+ highlight_match = FALSE;
+ validate_cursor(); /* needed for TAB */
+ redraw_later(NOT_VALID);
+ }
+#endif
+
+ if (ccline.cmdbuff != NULL)
+ {
+ /*
+ * Put line in history buffer (":" and "=" only when it was typed).
+ */
+#ifdef FEAT_CMDHIST
+ if (ccline.cmdlen && firstc != NUL
+ && (some_key_typed || histype == HIST_SEARCH))
+ {
+ add_to_history(histype, ccline.cmdbuff, TRUE,
+ histype == HIST_SEARCH ? firstc : NUL);
+ if (firstc == ':')
+ {
+ vim_free(new_last_cmdline);
+ new_last_cmdline = vim_strsave(ccline.cmdbuff);
+ }
+ }
+#endif
+
+ if (gotesc) /* abandon command line */
+ {
+ vim_free(ccline.cmdbuff);
+ ccline.cmdbuff = NULL;
+ if (msg_scrolled == 0)
+ compute_cmdrow();
+ MSG("");
+ redraw_cmdline = TRUE;
+ }
+ }
+
+ /*
+ * If the screen was shifted up, redraw the whole screen (later).
+ * If the line is too long, clear it, so ruler and shown command do
+ * not get printed in the middle of it.
+ */
+ msg_check();
+ msg_scroll = save_msg_scroll;
+ redir_off = FALSE;
+
+ /* When the command line was typed, no need for a wait-return prompt. */
+ if (some_key_typed)
+ need_wait_return = FALSE;
+
+ State = save_State;
+#ifdef USE_IM_CONTROL
+ if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
+ im_save_status(b_im_ptr);
+ im_set_active(FALSE);
+#endif
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef CURSOR_SHAPE
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+
+ return ccline.cmdbuff;
+}
+
+#if (defined(FEAT_CRYPT) || defined(FEAT_EVAL)) || defined(PROTO)
+/*
+ * Get a command line with a prompt.
+ * This is prepared to be called recursively from getcmdline() (e.g. by
+ * f_input() when evaluating an expression from CTRL-R =).
+ * Returns the command line in allocated memory, or NULL.
+ */
+ char_u *
+getcmdline_prompt(firstc, prompt, attr)
+ int firstc;
+ char_u *prompt; /* command line prompt */
+ int attr; /* attributes for prompt */
+{
+ char_u *s;
+ struct cmdline_info save_ccline;
+ int msg_col_save = msg_col;
+
+ save_ccline = ccline;
+ ccline.cmdbuff = NULL;
+ ccline.cmdprompt = prompt;
+ ccline.cmdattr = attr;
+ s = getcmdline(firstc, 1L, 0);
+ ccline = save_ccline;
+ /* Restore msg_col, the prompt from input() may have changed it. */
+ msg_col = msg_col_save;
+
+ return s;
+}
+#endif
+
+ static int
+cmdline_charsize(idx)
+ int idx;
+{
+#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+ if (cmdline_star > 0) /* showing '*', always 1 position */
+ return 1;
+#endif
+ return ptr2cells(ccline.cmdbuff + idx);
+}
+
+/*
+ * Compute the offset of the cursor on the command line for the prompt and
+ * indent.
+ */
+ static void
+set_cmdspos()
+{
+ if (ccline.cmdfirstc)
+ ccline.cmdspos = 1 + ccline.cmdindent;
+ else
+ ccline.cmdspos = 0 + ccline.cmdindent;
+}
+
+/*
+ * Compute the screen position for the cursor on the command line.
+ */
+ static void
+set_cmdspos_cursor()
+{
+ int i, m, c;
+
+ set_cmdspos();
+ if (KeyTyped)
+ m = Columns * Rows;
+ else
+ m = MAXCOL;
+ for (i = 0; i < ccline.cmdlen && i < ccline.cmdpos; ++i)
+ {
+ c = cmdline_charsize(i);
+#ifdef FEAT_MBYTE
+ /* Count ">" for double-wide multi-byte char that doesn't fit. */
+ if (has_mbyte)
+ correct_cmdspos(i, c);
+#endif
+ /* If the cmdline doesn't fit, put cursor on last visible char. */
+ if ((ccline.cmdspos += c) >= m)
+ {
+ ccline.cmdpos = i - 1;
+ ccline.cmdspos -= c;
+ break;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ i += (*mb_ptr2len_check)(ccline.cmdbuff + i) - 1;
+#endif
+ }
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Check if the character at "idx", which is "cells" wide, is a multi-byte
+ * character that doesn't fit, so that a ">" must be displayed.
+ */
+ static void
+correct_cmdspos(idx, cells)
+ int idx;
+ int cells;
+{
+ if ((*mb_ptr2len_check)(ccline.cmdbuff + idx) > 1
+ && (*mb_ptr2cells)(ccline.cmdbuff + idx) > 1
+ && ccline.cmdspos % Columns + cells > Columns)
+ ccline.cmdspos++;
+}
+#endif
+
+/*
+ * Get an Ex command line for the ":" command.
+ */
+/* ARGSUSED */
+ char_u *
+getexline(c, dummy, indent)
+ int c; /* normally ':', NUL for ":append" */
+ void *dummy; /* cookie not used */
+ int indent; /* indent for inside conditionals */
+{
+ /* When executing a register, remove ':' that's in front of each line. */
+ if (exec_from_reg && vpeekc() == ':')
+ (void)vgetc();
+ return getcmdline(c, 1L, indent);
+}
+
+/*
+ * Get an Ex command line for Ex mode.
+ * In Ex mode we only use the OS supplied line editing features and no
+ * mappings or abbreviations.
+ */
+/* ARGSUSED */
+ char_u *
+getexmodeline(c, dummy, indent)
+ int c; /* normally ':', NUL for ":append" */
+ void *dummy; /* cookie not used */
+ int indent; /* indent for inside conditionals */
+{
+ garray_T line_ga;
+ int len;
+ int off = 0;
+ char_u *p;
+ int finished = FALSE;
+#if defined(FEAT_GUI) || defined(NO_COOKED_INPUT)
+ int startcol = 0;
+ int c1;
+ int escaped = FALSE; /* CTRL-V typed */
+ int vcol = 0;
+#endif
+
+ /* Switch cursor on now. This avoids that it happens after the "\n", which
+ * confuses the system function that computes tabstops. */
+ cursor_on();
+
+ /* always start in column 0; write a newline if necessary */
+ compute_cmdrow();
+ if (msg_col)
+ msg_putchar('\n');
+ if (c == ':')
+ {
+ msg_putchar(':');
+ while (indent-- > 0)
+ msg_putchar(' ');
+#if defined(FEAT_GUI) || defined(NO_COOKED_INPUT)
+ startcol = msg_col;
+#endif
+ }
+
+ ga_init2(&line_ga, 1, 30);
+
+ /*
+ * Get the line, one character at a time.
+ */
+ got_int = FALSE;
+ while (!got_int && !finished)
+ {
+ if (ga_grow(&line_ga, 40) == FAIL)
+ break;
+ p = (char_u *)line_ga.ga_data + line_ga.ga_len;
+
+ /* Get one character (inchar gets a third of maxlen characters!) */
+ len = inchar(p + off, 3, -1L, 0);
+ if (len < 0)
+ continue; /* end of input script reached */
+ /* for a special character, we need at least three characters */
+ if ((*p == K_SPECIAL || *p == CSI) && off + len < 3)
+ {
+ off += len;
+ continue;
+ }
+ len += off;
+ off = 0;
+
+ /*
+ * When using the GUI, and for systems that don't have cooked input,
+ * handle line editing here.
+ */
+#if defined(FEAT_GUI) || defined(NO_COOKED_INPUT)
+# ifndef NO_COOKED_INPUT
+ if (gui.in_use)
+# endif
+ {
+ if (got_int)
+ {
+ msg_putchar('\n');
+ break;
+ }
+
+ while (len > 0)
+ {
+ c1 = *p++;
+ --len;
+ if ((c1 == K_SPECIAL
+# if !defined(NO_COOKED_INPUT) || defined(FEAT_GUI)
+ || c1 == CSI
+# endif
+ ) && len >= 2)
+ {
+ c1 = TO_SPECIAL(p[0], p[1]);
+ p += 2;
+ len -= 2;
+ }
+
+ if (!escaped)
+ {
+ /* CR typed means "enter", which is NL */
+ if (c1 == '\r')
+ c1 = '\n';
+
+ if (c1 == BS || c1 == K_BS
+ || c1 == DEL || c1 == K_DEL || c1 == K_KDEL)
+ {
+ if (line_ga.ga_len > 0)
+ {
+ int i, v;
+ char_u *q;
+
+ --line_ga.ga_len;
+ ++line_ga.ga_room;
+ /* compute column that cursor should be in */
+ v = 0;
+ q = ((char_u *)line_ga.ga_data);
+ for (i = 0; i < line_ga.ga_len; ++i)
+ {
+ if (*q == TAB)
+ v += 8 - v % 8;
+ else
+ v += ptr2cells(q);
+ ++q;
+ }
+ /* erase characters to position cursor */
+ while (vcol > v)
+ {
+ msg_putchar('\b');
+ msg_putchar(' ');
+ msg_putchar('\b');
+ --vcol;
+ }
+ }
+ continue;
+ }
+
+ if (c1 == Ctrl_U)
+ {
+ msg_col = startcol;
+ msg_clr_eos();
+ line_ga.ga_room += line_ga.ga_len;
+ line_ga.ga_len = 0;
+ continue;
+ }
+
+ if (c1 == Ctrl_V)
+ {
+ escaped = TRUE;
+ continue;
+ }
+ }
+
+ if (IS_SPECIAL(c1))
+ c1 = '?';
+ ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
+ if (c1 == '\n')
+ msg_putchar('\n');
+ else if (c1 == TAB)
+ {
+ /* Don't use chartabsize(), 'ts' can be different */
+ do
+ {
+ msg_putchar(' ');
+ } while (++vcol % 8);
+ }
+ else
+ {
+ msg_outtrans_len(
+ ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
+ vcol += char2cells(c1);
+ }
+ ++line_ga.ga_len;
+ --line_ga.ga_room;
+ escaped = FALSE;
+ }
+ windgoto(msg_row, msg_col);
+ }
+# ifndef NO_COOKED_INPUT
+ else
+# endif
+#endif
+#ifndef NO_COOKED_INPUT
+ {
+ line_ga.ga_len += len;
+ line_ga.ga_room -= len;
+ }
+#endif
+ p = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
+ if (line_ga.ga_len && p[-1] == '\n')
+ {
+ finished = TRUE;
+ --line_ga.ga_len;
+ --p;
+ *p = NUL;
+ }
+ }
+
+ /* note that cursor has moved, because of the echoed <CR> */
+ screen_down();
+ /* make following messages go to the next line */
+ msg_didout = FALSE;
+ msg_col = 0;
+ if (msg_row < Rows - 1)
+ ++msg_row;
+ emsg_on_display = FALSE; /* don't want ui_delay() */
+
+ if (got_int)
+ ga_clear(&line_ga);
+
+ return (char_u *)line_ga.ga_data;
+}
+
+#ifdef CURSOR_SHAPE
+/*
+ * Return TRUE if ccline.overstrike is on.
+ */
+ int
+cmdline_overstrike()
+{
+ return ccline.overstrike;
+}
+
+/*
+ * Return TRUE if the cursor is at the end of the cmdline.
+ */
+ int
+cmdline_at_end()
+{
+ return (ccline.cmdpos >= ccline.cmdlen);
+}
+#endif
+
+#if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) || defined(PROTO)
+/*
+ * Return the virtual column number at the current cursor position.
+ * This is used by the IM code to obtain the start of the preedit string.
+ */
+ colnr_T
+cmdline_getvcol_cursor()
+{
+ if (ccline.cmdbuff == NULL || ccline.cmdpos > ccline.cmdlen)
+ return MAXCOL;
+
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ colnr_T col;
+ int i = 0;
+
+ for (col = 0; i < ccline.cmdpos; ++col)
+ i += (*mb_ptr2len_check)(ccline.cmdbuff + i);
+
+ return col;
+ }
+ else
+# endif
+ return ccline.cmdpos;
+}
+#endif
+
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+/*
+ * If part of the command line is an IM preedit string, redraw it with
+ * IM feedback attributes. The cursor position is restored after drawing.
+ */
+ static void
+redrawcmd_preedit()
+{
+ if ((State & CMDLINE)
+ && xic != NULL
+ && im_get_status()
+ && !p_imdisable
+ && im_is_preediting())
+ {
+ int cmdpos = 0;
+ int cmdspos;
+ int old_row;
+ int old_col;
+ colnr_T col;
+
+ old_row = msg_row;
+ old_col = msg_col;
+ cmdspos = ((ccline.cmdfirstc) ? 1 : 0) + ccline.cmdindent;
+
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ for (col = 0; col < preedit_start_col
+ && cmdpos < ccline.cmdlen; ++col)
+ {
+ cmdspos += (*mb_ptr2cells)(ccline.cmdbuff + cmdpos);
+ cmdpos += (*mb_ptr2len_check)(ccline.cmdbuff + cmdpos);
+ }
+ }
+ else
+# endif
+ {
+ cmdspos += preedit_start_col;
+ cmdpos += preedit_start_col;
+ }
+
+ msg_row = cmdline_row + (cmdspos / (int)Columns);
+ msg_col = cmdspos % (int)Columns;
+ if (msg_row >= Rows)
+ msg_row = Rows - 1;
+
+ for (col = 0; cmdpos < ccline.cmdlen; ++col)
+ {
+ int char_len;
+ int char_attr;
+
+ char_attr = im_get_feedback_attr(col);
+ if (char_attr < 0)
+ break; /* end of preedit string */
+
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ char_len = (*mb_ptr2len_check)(ccline.cmdbuff + cmdpos);
+ else
+# endif
+ char_len = 1;
+
+ msg_outtrans_len_attr(ccline.cmdbuff + cmdpos, char_len, char_attr);
+ cmdpos += char_len;
+ }
+
+ msg_row = old_row;
+ msg_col = old_col;
+ }
+}
+#endif /* FEAT_XIM && FEAT_GUI_GTK */
+
+/*
+ * Allocate a new command line buffer.
+ * Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen.
+ * Returns the new value of ccline.cmdbuff and ccline.cmdbufflen.
+ */
+ static void
+alloc_cmdbuff(len)
+ int len;
+{
+ /*
+ * give some extra space to avoid having to allocate all the time
+ */
+ if (len < 80)
+ len = 100;
+ else
+ len += 20;
+
+ ccline.cmdbuff = alloc(len); /* caller should check for out-of-memory */
+ ccline.cmdbufflen = len;
+}
+
+/*
+ * Re-allocate the command line to length len + something extra.
+ * return FAIL for failure, OK otherwise
+ */
+ static int
+realloc_cmdbuff(len)
+ int len;
+{
+ char_u *p;
+
+ p = ccline.cmdbuff;
+ alloc_cmdbuff(len); /* will get some more */
+ if (ccline.cmdbuff == NULL) /* out of memory */
+ {
+ ccline.cmdbuff = p; /* keep the old one */
+ return FAIL;
+ }
+ mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen + 1);
+ vim_free(p);
+ return OK;
+}
+
+/*
+ * Draw part of the cmdline at the current cursor position. But draw stars
+ * when cmdline_star is TRUE.
+ */
+ static void
+draw_cmdline(start, len)
+ int start;
+ int len;
+{
+#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+ int i;
+
+ if (cmdline_star > 0)
+ for (i = 0; i < len; ++i)
+ {
+ msg_putchar('*');
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ i += (*mb_ptr2len_check)(ccline.cmdbuff + start + i) - 1;
+# endif
+ }
+ else
+#endif
+#ifdef FEAT_ARABIC
+ if (p_arshape && !p_tbidi && enc_utf8 && len > 0)
+ {
+ static char_u *buf;
+ static int buflen = 0;
+ char_u *p;
+ int j;
+ int newlen = 0;
+ int mb_l;
+ int pc, pc1;
+ int prev_c = 0;
+ int prev_c1 = 0;
+ int u8c, u8c_c1, u8c_c2;
+ int nc = 0;
+ int dummy;
+
+ /*
+ * Do arabic shaping into a temporary buffer. This is very
+ * inefficient!
+ */
+ if (len * 2 > buflen)
+ {
+ /* Re-allocate the buffer. We keep it around to avoid a lot of
+ * alloc()/free() calls. */
+ vim_free(buf);
+ buflen = len * 2;
+ buf = alloc(buflen);
+ if (buf == NULL)
+ return; /* out of memory */
+ }
+
+ for (j = start; j < start + len; j += mb_l)
+ {
+ p = ccline.cmdbuff + j;
+ u8c = utfc_ptr2char_len(p, &u8c_c1, &u8c_c2, start + len - j);
+ mb_l = utfc_ptr2len_check_len(p, start + len - j);
+ if (ARABIC_CHAR(u8c))
+ {
+ /* Do Arabic shaping. */
+ if (cmdmsg_rl)
+ {
+ /* displaying from right to left */
+ pc = prev_c;
+ pc1 = prev_c1;
+ prev_c1 = u8c_c1;
+ if (j + mb_l >= start + len)
+ nc = NUL;
+ else
+ nc = utf_ptr2char(p + mb_l);
+ }
+ else
+ {
+ /* displaying from left to right */
+ if (j + mb_l >= start + len)
+ pc = NUL;
+ else
+ pc = utfc_ptr2char_len(p + mb_l, &pc1, &dummy,
+ start + len - j - mb_l);
+ nc = prev_c;
+ }
+ prev_c = u8c;
+
+ u8c = arabic_shape(u8c, NULL, &u8c_c1, pc, pc1, nc);
+
+ newlen += (*mb_char2bytes)(u8c, buf + newlen);
+ if (u8c_c1 != 0)
+ {
+ newlen += (*mb_char2bytes)(u8c_c1, buf + newlen);
+ if (u8c_c2 != 0)
+ newlen += (*mb_char2bytes)(u8c_c2, buf + newlen);
+ }
+ }
+ else
+ {
+ prev_c = u8c;
+ mch_memmove(buf + newlen, p, mb_l);
+ newlen += mb_l;
+ }
+ }
+
+ msg_outtrans_len(buf, newlen);
+ }
+ else
+#endif
+ msg_outtrans_len(ccline.cmdbuff + start, len);
+}
+
+/*
+ * Put a character on the command line. Shifts the following text to the
+ * right when "shift" is TRUE. Used for CTRL-V, CTRL-K, etc.
+ * "c" must be printable (fit in one display cell)!
+ */
+ void
+putcmdline(c, shift)
+ int c;
+ int shift;
+{
+ if (cmd_silent)
+ return;
+ msg_no_more = TRUE;
+ msg_putchar(c);
+ if (shift)
+ draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
+ msg_no_more = FALSE;
+ cursorcmd();
+}
+
+/*
+ * Undo a putcmdline(c, FALSE).
+ */
+ void
+unputcmdline()
+{
+ if (cmd_silent)
+ return;
+ msg_no_more = TRUE;
+ if (ccline.cmdlen == ccline.cmdpos)
+ msg_putchar(' ');
+ else
+ draw_cmdline(ccline.cmdpos, 1);
+ msg_no_more = FALSE;
+ cursorcmd();
+}
+
+/*
+ * Put the given string, of the given length, onto the command line.
+ * If len is -1, then STRLEN() is used to calculate the length.
+ * If 'redraw' is TRUE then the new part of the command line, and the remaining
+ * part will be redrawn, otherwise it will not. If this function is called
+ * twice in a row, then 'redraw' should be FALSE and redrawcmd() should be
+ * called afterwards.
+ */
+ int
+put_on_cmdline(str, len, redraw)
+ char_u *str;
+ int len;
+ int redraw;
+{
+ int retval;
+ int i;
+ int m;
+ int c;
+
+ if (len < 0)
+ len = (int)STRLEN(str);
+
+ /* Check if ccline.cmdbuff needs to be longer */
+ if (ccline.cmdlen + len + 1 >= ccline.cmdbufflen)
+ retval = realloc_cmdbuff(ccline.cmdlen + len);
+ else
+ retval = OK;
+ if (retval == OK)
+ {
+ if (!ccline.overstrike)
+ {
+ mch_memmove(ccline.cmdbuff + ccline.cmdpos + len,
+ ccline.cmdbuff + ccline.cmdpos,
+ (size_t)(ccline.cmdlen - ccline.cmdpos));
+ ccline.cmdlen += len;
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Count nr of characters in the new string. */
+ m = 0;
+ for (i = 0; i < len; i += (*mb_ptr2len_check)(str + i))
+ ++m;
+ /* Count nr of bytes in cmdline that are overwritten by these
+ * characters. */
+ for (i = ccline.cmdpos; i < ccline.cmdlen && m > 0;
+ i += (*mb_ptr2len_check)(ccline.cmdbuff + i))
+ --m;
+ if (i < ccline.cmdlen)
+ {
+ mch_memmove(ccline.cmdbuff + ccline.cmdpos + len,
+ ccline.cmdbuff + i, (size_t)(ccline.cmdlen - i));
+ ccline.cmdlen += ccline.cmdpos + len - i;
+ }
+ else
+ ccline.cmdlen = ccline.cmdpos + len;
+ }
+ else
+#endif
+ if (ccline.cmdpos + len > ccline.cmdlen)
+ ccline.cmdlen = ccline.cmdpos + len;
+ }
+ mch_memmove(ccline.cmdbuff + ccline.cmdpos, str, (size_t)len);
+ ccline.cmdbuff[ccline.cmdlen] = NUL;
+
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ /* When the inserted text starts with a composing character,
+ * backup to the character before it. There could be two of them.
+ */
+ i = 0;
+ c = utf_ptr2char(ccline.cmdbuff + ccline.cmdpos);
+ while (ccline.cmdpos > 0 && utf_iscomposing(c))
+ {
+ i = (*mb_head_off)(ccline.cmdbuff,
+ ccline.cmdbuff + ccline.cmdpos - 1) + 1;
+ ccline.cmdpos -= i;
+ len += i;
+ c = utf_ptr2char(ccline.cmdbuff + ccline.cmdpos);
+ }
+# ifdef FEAT_ARABIC
+ if (i == 0 && ccline.cmdpos > 0 && arabic_maycombine(c))
+ {
+ /* Check the previous character for Arabic combining pair. */
+ i = (*mb_head_off)(ccline.cmdbuff,
+ ccline.cmdbuff + ccline.cmdpos - 1) + 1;
+ if (arabic_combine(utf_ptr2char(ccline.cmdbuff
+ + ccline.cmdpos - i), c))
+ {
+ ccline.cmdpos -= i;
+ len += i;
+ }
+ else
+ i = 0;
+ }
+# endif
+ if (i != 0)
+ {
+ /* Also backup the cursor position. */
+ i = ptr2cells(ccline.cmdbuff + ccline.cmdpos);
+ ccline.cmdspos -= i;
+ msg_col -= i;
+ if (msg_col < 0)
+ {
+ msg_col += Columns;
+ --msg_row;
+ }
+ }
+ }
+#endif
+
+ if (redraw && !cmd_silent)
+ {
+ msg_no_more = TRUE;
+ i = cmdline_row;
+ draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
+ /* Avoid clearing the rest of the line too often. */
+ if (cmdline_row != i || ccline.overstrike)
+ msg_clr_eos();
+ msg_no_more = FALSE;
+ }
+#ifdef FEAT_FKMAP
+ /*
+ * If we are in Farsi command mode, the character input must be in
+ * Insert mode. So do not advance the cmdpos.
+ */
+ if (!cmd_fkmap)
+#endif
+ {
+ if (KeyTyped)
+ m = Columns * Rows;
+ else
+ m = MAXCOL;
+ for (i = 0; i < len; ++i)
+ {
+ c = cmdline_charsize(ccline.cmdpos);
+#ifdef FEAT_MBYTE
+ /* count ">" for a double-wide char that doesn't fit. */
+ if (has_mbyte)
+ correct_cmdspos(ccline.cmdpos, c);
+#endif
+ /* Stop cursor at the end of the screen */
+ if (ccline.cmdspos + c >= m)
+ break;
+ ccline.cmdspos += c;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ c = (*mb_ptr2len_check)(ccline.cmdbuff + ccline.cmdpos) - 1;
+ if (c > len - i - 1)
+ c = len - i - 1;
+ ccline.cmdpos += c;
+ i += c;
+ }
+#endif
+ ++ccline.cmdpos;
+ }
+ }
+ }
+ if (redraw)
+ msg_check();
+ return retval;
+}
+
+#ifdef FEAT_WILDMENU
+/*
+ * Delete characters on the command line, from "from" to the current
+ * position.
+ */
+ static void
+cmdline_del(from)
+ int from;
+{
+ mch_memmove(ccline.cmdbuff + from, ccline.cmdbuff + ccline.cmdpos,
+ (size_t)(ccline.cmdlen - ccline.cmdpos + 1));
+ ccline.cmdlen -= ccline.cmdpos - from;
+ ccline.cmdpos = from;
+}
+#endif
+
+/*
+ * this fuction is called when the screen size changes and with incremental
+ * search
+ */
+ void
+redrawcmdline()
+{
+ if (cmd_silent)
+ return;
+ need_wait_return = FALSE;
+ compute_cmdrow();
+ redrawcmd();
+ cursorcmd();
+}
+
+ static void
+redrawcmdprompt()
+{
+ int i;
+
+ if (cmd_silent)
+ return;
+ if (ccline.cmdfirstc)
+ msg_putchar(ccline.cmdfirstc);
+ if (ccline.cmdprompt != NULL)
+ {
+ msg_puts_attr(ccline.cmdprompt, ccline.cmdattr);
+ ccline.cmdindent = msg_col + (msg_row - cmdline_row) * Columns;
+ /* do the reverse of set_cmdspos() */
+ if (ccline.cmdfirstc)
+ --ccline.cmdindent;
+ }
+ else
+ for (i = ccline.cmdindent; i > 0; --i)
+ msg_putchar(' ');
+}
+
+/*
+ * Redraw what is currently on the command line.
+ */
+ void
+redrawcmd()
+{
+ if (cmd_silent)
+ return;
+
+ msg_start();
+ redrawcmdprompt();
+
+ /* Don't use more prompt, truncate the cmdline if it doesn't fit. */
+ msg_no_more = TRUE;
+ draw_cmdline(0, ccline.cmdlen);
+ msg_clr_eos();
+ msg_no_more = FALSE;
+
+ set_cmdspos_cursor();
+
+ /*
+ * An emsg() before may have set msg_scroll. This is used in normal mode,
+ * in cmdline mode we can reset them now.
+ */
+ msg_scroll = FALSE; /* next message overwrites cmdline */
+
+ /* Typing ':' at the more prompt may set skip_redraw. We don't want this
+ * in cmdline mode */
+ skip_redraw = FALSE;
+}
+
+ void
+compute_cmdrow()
+{
+ if (exmode_active || msg_scrolled)
+ cmdline_row = Rows - 1;
+ else
+ cmdline_row = W_WINROW(lastwin) + lastwin->w_height
+ + W_STATUS_HEIGHT(lastwin);
+}
+
+ static void
+cursorcmd()
+{
+ if (cmd_silent)
+ return;
+
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ {
+ msg_row = cmdline_row + (ccline.cmdspos / (int)(Columns - 1));
+ msg_col = (int)Columns - (ccline.cmdspos % (int)(Columns - 1)) - 1;
+ if (msg_row <= 0)
+ msg_row = Rows - 1;
+ }
+ else
+#endif
+ {
+ msg_row = cmdline_row + (ccline.cmdspos / (int)Columns);
+ msg_col = ccline.cmdspos % (int)Columns;
+ if (msg_row >= Rows)
+ msg_row = Rows - 1;
+ }
+
+ windgoto(msg_row, msg_col);
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ redrawcmd_preedit();
+#endif
+#ifdef MCH_CURSOR_SHAPE
+ mch_update_cursor();
+#endif
+}
+
+ void
+gotocmdline(clr)
+ int clr;
+{
+ msg_start();
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ msg_col = Columns - 1;
+ else
+#endif
+ msg_col = 0; /* always start in column 0 */
+ if (clr) /* clear the bottom line(s) */
+ msg_clr_eos(); /* will reset clear_cmdline */
+ windgoto(cmdline_row, 0);
+}
+
+/*
+ * Check the word in front of the cursor for an abbreviation.
+ * Called when the non-id character "c" has been entered.
+ * When an abbreviation is recognized it is removed from the text with
+ * backspaces and the replacement string is inserted, followed by "c".
+ */
+ static int
+ccheck_abbr(c)
+ int c;
+{
+ if (p_paste || no_abbr) /* no abbreviations or in paste mode */
+ return FALSE;
+
+ return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0);
+}
+
+/*
+ * Return FAIL if this is not an appropriate context in which to do
+ * completion of anything, return OK if it is (even if there are no matches).
+ * For the caller, this means that the character is just passed through like a
+ * normal character (instead of being expanded). This allows :s/^I^D etc.
+ */
+ static int
+nextwild(xp, type, options)
+ expand_T *xp;
+ int type;
+ int options; /* extra options for ExpandOne() */
+{
+ int i, j;
+ char_u *p1;
+ char_u *p2;
+ int oldlen;
+ int difflen;
+ int v;
+
+ if (xp->xp_numfiles == -1)
+ {
+ set_expand_context(xp);
+ cmd_showtail = expand_showtail(xp);
+ }
+
+ if (xp->xp_context == EXPAND_UNSUCCESSFUL)
+ {
+ beep_flush();
+ return OK; /* Something illegal on command line */
+ }
+ if (xp->xp_context == EXPAND_NOTHING)
+ {
+ /* Caller can use the character as a normal char instead */
+ return FAIL;
+ }
+
+ MSG_PUTS("..."); /* show that we are busy */
+ out_flush();
+
+ i = (int)(xp->xp_pattern - ccline.cmdbuff);
+ oldlen = ccline.cmdpos - i;
+
+ if (type == WILD_NEXT || type == WILD_PREV)
+ {
+ /*
+ * Get next/previous match for a previous expanded pattern.
+ */
+ p2 = ExpandOne(xp, NULL, NULL, 0, type);
+ }
+ else
+ {
+ /*
+ * Translate string into pattern and expand it.
+ */
+ if ((p1 = addstar(&ccline.cmdbuff[i], oldlen, xp->xp_context)) == NULL)
+ p2 = NULL;
+ else
+ {
+ p2 = ExpandOne(xp, p1, vim_strnsave(&ccline.cmdbuff[i], oldlen),
+ WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT|WILD_ESCAPE
+ |options, type);
+ vim_free(p1);
+ /* longest match: make sure it is not shorter (happens with :help */
+ if (p2 != NULL && type == WILD_LONGEST)
+ {
+ for (j = 0; j < oldlen; ++j)
+ if (ccline.cmdbuff[i + j] == '*'
+ || ccline.cmdbuff[i + j] == '?')
+ break;
+ if ((int)STRLEN(p2) < j)
+ {
+ vim_free(p2);
+ p2 = NULL;
+ }
+ }
+ }
+ }
+
+ if (p2 != NULL && !got_int)
+ {
+ difflen = (int)STRLEN(p2) - oldlen;
+ if (ccline.cmdlen + difflen > ccline.cmdbufflen - 4)
+ {
+ v = realloc_cmdbuff(ccline.cmdlen + difflen);
+ xp->xp_pattern = ccline.cmdbuff + i;
+ }
+ else
+ v = OK;
+ if (v == OK)
+ {
+ vim_strncpy(&ccline.cmdbuff[ccline.cmdpos + difflen],
+ &ccline.cmdbuff[ccline.cmdpos],
+ ccline.cmdlen - ccline.cmdpos + 1);
+ STRNCPY(&ccline.cmdbuff[i], p2, STRLEN(p2));
+ ccline.cmdlen += difflen;
+ ccline.cmdpos += difflen;
+ }
+ }
+ vim_free(p2);
+
+ redrawcmd();
+
+ /* When expanding a ":map" command and no matches are found, assume that
+ * the key is supposed to be inserted literally */
+ if (xp->xp_context == EXPAND_MAPPINGS && p2 == NULL)
+ return FAIL;
+
+ if (xp->xp_numfiles <= 0 && p2 == NULL)
+ beep_flush();
+ else if (xp->xp_numfiles == 1)
+ /* free expanded pattern */
+ (void)ExpandOne(xp, NULL, NULL, 0, WILD_FREE);
+
+ return OK;
+}
+
+/*
+ * Do wildcard expansion on the string 'str'.
+ * Chars that should not be expanded must be preceded with a backslash.
+ * Return a pointer to alloced memory containing the new string.
+ * Return NULL for failure.
+ *
+ * Results are cached in xp->xp_files and xp->xp_numfiles.
+ *
+ * mode = WILD_FREE: just free previously expanded matches
+ * mode = WILD_EXPAND_FREE: normal expansion, do not keep matches
+ * mode = WILD_EXPAND_KEEP: normal expansion, keep matches
+ * mode = WILD_NEXT: use next match in multiple match, wrap to first
+ * mode = WILD_PREV: use previous match in multiple match, wrap to first
+ * mode = WILD_ALL: return all matches concatenated
+ * mode = WILD_LONGEST: return longest matched part
+ *
+ * options = WILD_LIST_NOTFOUND: list entries without a match
+ * options = WILD_HOME_REPLACE: do home_replace() for buffer names
+ * options = WILD_USE_NL: Use '\n' for WILD_ALL
+ * options = WILD_NO_BEEP: Don't beep for multiple matches
+ * options = WILD_ADD_SLASH: add a slash after directory names
+ * options = WILD_KEEP_ALL: don't remove 'wildignore' entries
+ * options = WILD_SILENT: don't print warning messages
+ * options = WILD_ESCAPE: put backslash before special chars
+ *
+ * The variables xp->xp_context and xp->xp_backslash must have been set!
+ */
+ char_u *
+ExpandOne(xp, str, orig, options, mode)
+ expand_T *xp;
+ char_u *str;
+ char_u *orig; /* allocated copy of original of expanded string */
+ int options;
+ int mode;
+{
+ char_u *ss = NULL;
+ static int findex;
+ static char_u *orig_save = NULL; /* kept value of orig */
+ int i;
+ long_u len;
+ int non_suf_match; /* number without matching suffix */
+
+ /*
+ * first handle the case of using an old match
+ */
+ if (mode == WILD_NEXT || mode == WILD_PREV)
+ {
+ if (xp->xp_numfiles > 0)
+ {
+ if (mode == WILD_PREV)
+ {
+ if (findex == -1)
+ findex = xp->xp_numfiles;
+ --findex;
+ }
+ else /* mode == WILD_NEXT */
+ ++findex;
+
+ /*
+ * When wrapping around, return the original string, set findex to
+ * -1.
+ */
+ if (findex < 0)
+ {
+ if (orig_save == NULL)
+ findex = xp->xp_numfiles - 1;
+ else
+ findex = -1;
+ }
+ if (findex >= xp->xp_numfiles)
+ {
+ if (orig_save == NULL)
+ findex = 0;
+ else
+ findex = -1;
+ }
+#ifdef FEAT_WILDMENU
+ if (p_wmnu)
+ win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files,
+ findex, cmd_showtail);
+#endif
+ if (findex == -1)
+ return vim_strsave(orig_save);
+ return vim_strsave(xp->xp_files[findex]);
+ }
+ else
+ return NULL;
+ }
+
+/* free old names */
+ if (xp->xp_numfiles != -1 && mode != WILD_ALL && mode != WILD_LONGEST)
+ {
+ FreeWild(xp->xp_numfiles, xp->xp_files);
+ xp->xp_numfiles = -1;
+ vim_free(orig_save);
+ orig_save = NULL;
+ }
+ findex = 0;
+
+ if (mode == WILD_FREE) /* only release file name */
+ return NULL;
+
+ if (xp->xp_numfiles == -1)
+ {
+ vim_free(orig_save);
+ orig_save = orig;
+
+ /*
+ * Do the expansion.
+ */
+ if (ExpandFromContext(xp, str, &xp->xp_numfiles, &xp->xp_files,
+ options) == FAIL)
+ {
+#ifdef FNAME_ILLEGAL
+ /* Illegal file name has been silently skipped. But when there
+ * are wildcards, the real problem is that there was no match,
+ * causing the pattern to be added, which has illegal characters.
+ */
+ if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND))
+ EMSG2(_(e_nomatch2), str);
+#endif
+ }
+ else if (xp->xp_numfiles == 0)
+ {
+ if (!(options & WILD_SILENT))
+ EMSG2(_(e_nomatch2), str);
+ }
+ else
+ {
+ /* Escape the matches for use on the command line. */
+ ExpandEscape(xp, str, xp->xp_numfiles, xp->xp_files, options);
+
+ /*
+ * Check for matching suffixes in file names.
+ */
+ if (mode != WILD_ALL && mode != WILD_LONGEST)
+ {
+ if (xp->xp_numfiles)
+ non_suf_match = xp->xp_numfiles;
+ else
+ non_suf_match = 1;
+ if ((xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_DIRECTORIES)
+ && xp->xp_numfiles > 1)
+ {
+ /*
+ * More than one match; check suffix.
+ * The files will have been sorted on matching suffix in
+ * expand_wildcards, only need to check the first two.
+ */
+ non_suf_match = 0;
+ for (i = 0; i < 2; ++i)
+ if (match_suffix(xp->xp_files[i]))
+ ++non_suf_match;
+ }
+ if (non_suf_match != 1)
+ {
+ /* Can we ever get here unless it's while expanding
+ * interactively? If not, we can get rid of this all
+ * together. Don't really want to wait for this message
+ * (and possibly have to hit return to continue!).
+ */
+ if (!(options & WILD_SILENT))
+ EMSG(_(e_toomany));
+ else if (!(options & WILD_NO_BEEP))
+ beep_flush();
+ }
+ if (!(non_suf_match != 1 && mode == WILD_EXPAND_FREE))
+ ss = vim_strsave(xp->xp_files[0]);
+ }
+ }
+ }
+
+ /* Find longest common part */
+ if (mode == WILD_LONGEST && xp->xp_numfiles > 0)
+ {
+ for (len = 0; xp->xp_files[0][len]; ++len)
+ {
+ for (i = 0; i < xp->xp_numfiles; ++i)
+ {
+#ifdef CASE_INSENSITIVE_FILENAME
+ if (xp->xp_context == EXPAND_DIRECTORIES
+ || xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_BUFFERS)
+ {
+ if (TOLOWER_LOC(xp->xp_files[i][len]) !=
+ TOLOWER_LOC(xp->xp_files[0][len]))
+ break;
+ }
+ else
+#endif
+ if (xp->xp_files[i][len] != xp->xp_files[0][len])
+ break;
+ }
+ if (i < xp->xp_numfiles)
+ {
+ if (!(options & WILD_NO_BEEP))
+ vim_beep();
+ break;
+ }
+ }
+ ss = alloc((unsigned)len + 1);
+ if (ss)
+ {
+ STRNCPY(ss, xp->xp_files[0], len);
+ ss[len] = NUL;
+ }
+ findex = -1; /* next p_wc gets first one */
+ }
+
+ /* Concatenate all matching names */
+ if (mode == WILD_ALL && xp->xp_numfiles > 0)
+ {
+ len = 0;
+ for (i = 0; i < xp->xp_numfiles; ++i)
+ len += (long_u)STRLEN(xp->xp_files[i]) + 1;
+ ss = lalloc(len, TRUE);
+ if (ss != NULL)
+ {
+ *ss = NUL;
+ for (i = 0; i < xp->xp_numfiles; ++i)
+ {
+ STRCAT(ss, xp->xp_files[i]);
+ if (i != xp->xp_numfiles - 1)
+ STRCAT(ss, (options & WILD_USE_NL) ? "\n" : " ");
+ }
+ }
+ }
+
+ if (mode == WILD_EXPAND_FREE || mode == WILD_ALL)
+ ExpandCleanup(xp);
+
+ return ss;
+}
+
+/*
+ * Prepare an expand structure for use.
+ */
+ void
+ExpandInit(xp)
+ expand_T *xp;
+{
+ xp->xp_backslash = XP_BS_NONE;
+ xp->xp_numfiles = -1;
+ xp->xp_files = NULL;
+}
+
+/*
+ * Cleanup an expand structure after use.
+ */
+ void
+ExpandCleanup(xp)
+ expand_T *xp;
+{
+ if (xp->xp_numfiles >= 0)
+ {
+ FreeWild(xp->xp_numfiles, xp->xp_files);
+ xp->xp_numfiles = -1;
+ }
+}
+
+ void
+ExpandEscape(xp, str, numfiles, files, options)
+ expand_T *xp;
+ char_u *str;
+ int numfiles;
+ char_u **files;
+ int options;
+{
+ int i;
+ char_u *p;
+
+ /*
+ * May change home directory back to "~"
+ */
+ if (options & WILD_HOME_REPLACE)
+ tilde_replace(str, numfiles, files);
+
+ if (options & WILD_ESCAPE)
+ {
+ if (xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_BUFFERS
+ || xp->xp_context == EXPAND_DIRECTORIES)
+ {
+ /*
+ * Insert a backslash into a file name before a space, \, %, #
+ * and wildmatch characters, except '~'.
+ */
+ for (i = 0; i < numfiles; ++i)
+ {
+ /* for ":set path=" we need to escape spaces twice */
+ if (xp->xp_backslash == XP_BS_THREE)
+ {
+ p = vim_strsave_escaped(files[i], (char_u *)" ");
+ if (p != NULL)
+ {
+ vim_free(files[i]);
+ files[i] = p;
+#if defined(BACKSLASH_IN_FILENAME) || defined(COLON_AS_PATHSEP)
+ p = vim_strsave_escaped(files[i], (char_u *)" ");
+ if (p != NULL)
+ {
+ vim_free(files[i]);
+ files[i] = p;
+ }
+#endif
+ }
+ }
+#ifdef BACKSLASH_IN_FILENAME
+ {
+ char_u buf[20];
+ int j = 0;
+
+ /* Don't escape '[' and '{' if they are in 'isfname'. */
+ for (p = PATH_ESC_CHARS; *p != NUL; ++p)
+ if ((*p != '[' && *p != '{') || !vim_isfilec(*p))
+ buf[j++] = *p;
+ buf[j] = NUL;
+ p = vim_strsave_escaped(files[i], buf);
+ }
+#else
+ p = vim_strsave_escaped(files[i], PATH_ESC_CHARS);
+#endif
+ if (p != NULL)
+ {
+ vim_free(files[i]);
+ files[i] = p;
+ }
+
+ /* If 'str' starts with "\~", replace "~" at start of
+ * files[i] with "\~". */
+ if (str[0] == '\\' && str[1] == '~' && files[i][0] == '~')
+ {
+ p = alloc((unsigned)(STRLEN(files[i]) + 2));
+ if (p != NULL)
+ {
+ p[0] = '\\';
+ STRCPY(p + 1, files[i]);
+ vim_free(files[i]);
+ files[i] = p;
+ }
+ }
+ }
+ xp->xp_backslash = XP_BS_NONE;
+ }
+ else if (xp->xp_context == EXPAND_TAGS)
+ {
+ /*
+ * Insert a backslash before characters in a tag name that
+ * would terminate the ":tag" command.
+ */
+ for (i = 0; i < numfiles; ++i)
+ {
+ p = vim_strsave_escaped(files[i], (char_u *)"\\|\"");
+ if (p != NULL)
+ {
+ vim_free(files[i]);
+ files[i] = p;
+ }
+ }
+ }
+ }
+}
+
+/*
+ * For each file name in files[num_files]:
+ * If 'orig_pat' starts with "~/", replace the home directory with "~".
+ */
+ void
+tilde_replace(orig_pat, num_files, files)
+ char_u *orig_pat;
+ int num_files;
+ char_u **files;
+{
+ int i;
+ char_u *p;
+
+ if (orig_pat[0] == '~' && vim_ispathsep(orig_pat[1]))
+ {
+ for (i = 0; i < num_files; ++i)
+ {
+ p = home_replace_save(NULL, files[i]);
+ if (p != NULL)
+ {
+ vim_free(files[i]);
+ files[i] = p;
+ }
+ }
+ }
+}
+
+/*
+ * Show all matches for completion on the command line.
+ * Returns EXPAND_NOTHING when the character that triggered expansion should
+ * be inserted like a normal character.
+ */
+/*ARGSUSED*/
+ static int
+showmatches(xp, wildmenu)
+ expand_T *xp;
+ int wildmenu;
+{
+#define L_SHOWFILE(m) (showtail ? sm_gettail(files_found[m]) : files_found[m])
+ int num_files;
+ char_u **files_found;
+ int i, j, k;
+ int maxlen;
+ int lines;
+ int columns;
+ char_u *p;
+ int lastlen;
+ int attr;
+ int showtail;
+
+ if (xp->xp_numfiles == -1)
+ {
+ set_expand_context(xp);
+ i = expand_cmdline(xp, ccline.cmdbuff, ccline.cmdpos,
+ &num_files, &files_found);
+ showtail = expand_showtail(xp);
+ if (i != EXPAND_OK)
+ return i;
+
+ }
+ else
+ {
+ num_files = xp->xp_numfiles;
+ files_found = xp->xp_files;
+ showtail = cmd_showtail;
+ }
+
+#ifdef FEAT_WILDMENU
+ if (!wildmenu)
+ {
+#endif
+ msg_didany = FALSE; /* lines_left will be set */
+ msg_start(); /* prepare for paging */
+ msg_putchar('\n');
+ out_flush();
+ cmdline_row = msg_row;
+ msg_didany = FALSE; /* lines_left will be set again */
+ msg_start(); /* prepare for paging */
+#ifdef FEAT_WILDMENU
+ }
+#endif
+
+ if (got_int)
+ got_int = FALSE; /* only int. the completion, not the cmd line */
+#ifdef FEAT_WILDMENU
+ else if (wildmenu)
+ win_redr_status_matches(xp, num_files, files_found, 0, showtail);
+#endif
+ else
+ {
+ /* find the length of the longest file name */
+ maxlen = 0;
+ for (i = 0; i < num_files; ++i)
+ {
+ if (!showtail && (xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_BUFFERS))
+ {
+ home_replace(NULL, files_found[i], NameBuff, MAXPATHL, TRUE);
+ j = vim_strsize(NameBuff);
+ }
+ else
+ j = vim_strsize(L_SHOWFILE(i));
+ if (j > maxlen)
+ maxlen = j;
+ }
+
+ if (xp->xp_context == EXPAND_TAGS_LISTFILES)
+ lines = num_files;
+ else
+ {
+ /* compute the number of columns and lines for the listing */
+ maxlen += 2; /* two spaces between file names */
+ columns = ((int)Columns + 2) / maxlen;
+ if (columns < 1)
+ columns = 1;
+ lines = (num_files + columns - 1) / columns;
+ }
+
+ attr = hl_attr(HLF_D); /* find out highlighting for directories */
+
+ if (xp->xp_context == EXPAND_TAGS_LISTFILES)
+ {
+ MSG_PUTS_ATTR(_("tagname"), hl_attr(HLF_T));
+ msg_clr_eos();
+ msg_advance(maxlen - 3);
+ MSG_PUTS_ATTR(_(" kind file\n"), hl_attr(HLF_T));
+ }
+
+ /* list the files line by line */
+ for (i = 0; i < lines; ++i)
+ {
+ lastlen = 999;
+ for (k = i; k < num_files; k += lines)
+ {
+ if (xp->xp_context == EXPAND_TAGS_LISTFILES)
+ {
+ msg_outtrans_attr(files_found[k], hl_attr(HLF_D));
+ p = files_found[k] + STRLEN(files_found[k]) + 1;
+ msg_advance(maxlen + 1);
+ msg_puts(p);
+ msg_advance(maxlen + 3);
+ msg_puts_long_attr(p + 2, hl_attr(HLF_D));
+ break;
+ }
+ for (j = maxlen - lastlen; --j >= 0; )
+ msg_putchar(' ');
+ if (xp->xp_context == EXPAND_FILES
+ || xp->xp_context == EXPAND_BUFFERS)
+ {
+ /* highlight directories */
+ j = (mch_isdir(files_found[k]));
+ if (showtail)
+ p = L_SHOWFILE(k);
+ else
+ {
+ home_replace(NULL, files_found[k], NameBuff, MAXPATHL,
+ TRUE);
+ p = NameBuff;
+ }
+ }
+ else
+ {
+ j = FALSE;
+ p = L_SHOWFILE(k);
+ }
+ lastlen = msg_outtrans_attr(p, j ? attr : 0);
+ }
+ if (msg_col > 0) /* when not wrapped around */
+ {
+ msg_clr_eos();
+ msg_putchar('\n');
+ }
+ out_flush(); /* show one line at a time */
+ if (got_int)
+ {
+ got_int = FALSE;
+ break;
+ }
+ }
+
+ /*
+ * we redraw the command below the lines that we have just listed
+ * This is a bit tricky, but it saves a lot of screen updating.
+ */
+ cmdline_row = msg_row; /* will put it back later */
+ }
+
+ if (xp->xp_numfiles == -1)
+ FreeWild(num_files, files_found);
+
+ return EXPAND_OK;
+}
+
+/*
+ * Private gettail for showmatches() (and win_redr_status_matches()):
+ * Find tail of file name path, but ignore trailing "/".
+ */
+ char_u *
+sm_gettail(s)
+ char_u *s;
+{
+ char_u *p;
+ char_u *t = s;
+ int had_sep = FALSE;
+
+ for (p = s; *p != NUL; )
+ {
+ if (vim_ispathsep(*p)
+#ifdef BACKSLASH_IN_FILENAME
+ && !rem_backslash(p)
+#endif
+ )
+ had_sep = TRUE;
+ else if (had_sep)
+ {
+ t = p;
+ had_sep = FALSE;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+ return t;
+}
+
+/*
+ * Return TRUE if we only need to show the tail of completion matches.
+ * When not completing file names or there is a wildcard in the path FALSE is
+ * returned.
+ */
+ static int
+expand_showtail(xp)
+ expand_T *xp;
+{
+ char_u *s;
+ char_u *end;
+
+ /* When not completing file names a "/" may mean something different. */
+ if (xp->xp_context != EXPAND_FILES && xp->xp_context != EXPAND_DIRECTORIES)
+ return FALSE;
+
+ end = gettail(xp->xp_pattern);
+ if (end == xp->xp_pattern) /* there is no path separator */
+ return FALSE;
+
+ for (s = xp->xp_pattern; s < end; s++)
+ {
+ /* Skip escaped wildcards. Only when the backslash is not a path
+ * separator, on DOS the '*' "path\*\file" must not be skipped. */
+ if (rem_backslash(s))
+ ++s;
+ else if (vim_strchr((char_u *)"*?[", *s) != NULL)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Prepare a string for expansion.
+ * When expanding file names: The string will be used with expand_wildcards().
+ * Copy the file name into allocated memory and add a '*' at the end.
+ * When expanding other names: The string will be used with regcomp(). Copy
+ * the name into allocated memory and prepend "^".
+ */
+ char_u *
+addstar(fname, len, context)
+ char_u *fname;
+ int len;
+ int context; /* EXPAND_FILES etc. */
+{
+ char_u *retval;
+ int i, j;
+ int new_len;
+ char_u *tail;
+
+ if (context != EXPAND_FILES && context != EXPAND_DIRECTORIES)
+ {
+ /*
+ * Matching will be done internally (on something other than files).
+ * So we convert the file-matching-type wildcards into our kind for
+ * use with vim_regcomp(). First work out how long it will be:
+ */
+
+ /* For help tags the translation is done in find_help_tags().
+ * For a tag pattern starting with "/" no translation is needed. */
+ if (context == EXPAND_HELP
+ || context == EXPAND_COLORS
+ || context == EXPAND_COMPILER
+ || (context == EXPAND_TAGS && fname[0] == '/'))
+ retval = vim_strnsave(fname, len);
+ else
+ {
+ new_len = len + 2; /* +2 for '^' at start, NUL at end */
+ for (i = 0; i < len; i++)
+ {
+ if (fname[i] == '*' || fname[i] == '~')
+ new_len++; /* '*' needs to be replaced by ".*"
+ '~' needs to be replaced by "\~" */
+
+ /* Buffer names are like file names. "." should be literal */
+ if (context == EXPAND_BUFFERS && fname[i] == '.')
+ new_len++; /* "." becomes "\." */
+
+ /* Custom expansion takes care of special things, match
+ * backslashes literally (perhaps also for other types?) */
+ if (context == EXPAND_USER_DEFINED && fname[i] == '\\')
+ new_len++; /* '\' becomes "\\" */
+ }
+ retval = alloc(new_len);
+ if (retval != NULL)
+ {
+ retval[0] = '^';
+ j = 1;
+ for (i = 0; i < len; i++, j++)
+ {
+ /* Skip backslash. But why? At least keep it for custom
+ * expansion. */
+ if (context != EXPAND_USER_DEFINED
+ && fname[i] == '\\' && ++i == len)
+ break;
+
+ switch (fname[i])
+ {
+ case '*': retval[j++] = '.';
+ break;
+ case '~': retval[j++] = '\\';
+ break;
+ case '?': retval[j] = '.';
+ continue;
+ case '.': if (context == EXPAND_BUFFERS)
+ retval[j++] = '\\';
+ break;
+ case '\\': if (context == EXPAND_USER_DEFINED)
+ retval[j++] = '\\';
+ break;
+ }
+ retval[j] = fname[i];
+ }
+ retval[j] = NUL;
+ }
+ }
+ }
+ else
+ {
+ retval = alloc(len + 4);
+ if (retval != NULL)
+ {
+ STRNCPY(retval, fname, len);
+ retval[len] = NUL;
+
+ /*
+ * Don't add a star to ~, ~user, $var or `cmd`.
+ * ~ would be at the start of the file name, but not the tail.
+ * $ could be anywhere in the tail.
+ * ` could be anywhere in the file name.
+ */
+ tail = gettail(retval);
+ if ((*retval != '~' || tail != retval)
+ && vim_strchr(tail, '$') == NULL
+ && vim_strchr(retval, '`') == NULL)
+ retval[len++] = '*';
+ retval[len] = NUL;
+ }
+ }
+ return retval;
+}
+
+/*
+ * Must parse the command line so far to work out what context we are in.
+ * Completion can then be done based on that context.
+ * This routine sets the variables:
+ * xp->xp_pattern The start of the pattern to be expanded within
+ * the command line (ends at the cursor).
+ * xp->xp_context The type of thing to expand. Will be one of:
+ *
+ * EXPAND_UNSUCCESSFUL Used sometimes when there is something illegal on
+ * the command line, like an unknown command. Caller
+ * should beep.
+ * EXPAND_NOTHING Unrecognised context for completion, use char like
+ * a normal char, rather than for completion. eg
+ * :s/^I/
+ * EXPAND_COMMANDS Cursor is still touching the command, so complete
+ * it.
+ * EXPAND_BUFFERS Complete file names for :buf and :sbuf commands.
+ * EXPAND_FILES After command with XFILE set, or after setting
+ * with P_EXPAND set. eg :e ^I, :w>>^I
+ * EXPAND_DIRECTORIES In some cases this is used instead of the latter
+ * when we know only directories are of interest. eg
+ * :set dir=^I
+ * EXPAND_SETTINGS Complete variable names. eg :set d^I
+ * EXPAND_BOOL_SETTINGS Complete boolean variables only, eg :set no^I
+ * EXPAND_TAGS Complete tags from the files in p_tags. eg :ta a^I
+ * EXPAND_TAGS_LISTFILES As above, but list filenames on ^D, after :tselect
+ * EXPAND_HELP Complete tags from the file 'helpfile'/tags
+ * EXPAND_EVENTS Complete event names
+ * EXPAND_SYNTAX Complete :syntax command arguments
+ * EXPAND_HIGHLIGHT Complete highlight (syntax) group names
+ * EXPAND_AUGROUP Complete autocommand group names
+ * EXPAND_USER_VARS Complete user defined variable names, eg :unlet a^I
+ * EXPAND_MAPPINGS Complete mapping and abbreviation names,
+ * eg :unmap a^I , :cunab x^I
+ * EXPAND_FUNCTIONS Complete internal or user defined function names,
+ * eg :call sub^I
+ * EXPAND_USER_FUNC Complete user defined function names, eg :delf F^I
+ * EXPAND_EXPRESSION Complete internal or user defined function/variable
+ * names in expressions, eg :while s^I
+ * EXPAND_ENV_VARS Complete environment variable names
+ */
+ static void
+set_expand_context(xp)
+ expand_T *xp;
+{
+ /* only expansion for ':' and '>' commands */
+ if (ccline.cmdfirstc != ':'
+#ifdef FEAT_EVAL
+ && ccline.cmdfirstc != '>'
+#endif
+ )
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return;
+ }
+ set_cmd_context(xp, ccline.cmdbuff, ccline.cmdlen, ccline.cmdpos);
+}
+
+ void
+set_cmd_context(xp, str, len, col)
+ expand_T *xp;
+ char_u *str; /* start of command line */
+ int len; /* length of command line (excl. NUL) */
+ int col; /* position of cursor */
+{
+ int old_char = NUL;
+ char_u *nextcomm;
+
+ /*
+ * Avoid a UMR warning from Purify, only save the character if it has been
+ * written before.
+ */
+ if (col < len)
+ old_char = str[col];
+ str[col] = NUL;
+ nextcomm = str;
+ while (nextcomm != NULL)
+ nextcomm = set_one_cmd_context(xp, nextcomm);
+ str[col] = old_char;
+}
+
+/*
+ * Expand the command line "str" from context "xp".
+ * "xp" must have been set by set_cmd_context().
+ * xp->xp_pattern points into "str", to where the text that is to be expanded
+ * starts.
+ * Returns EXPAND_UNSUCCESSFUL when there is something illegal before the
+ * cursor.
+ * Returns EXPAND_NOTHING when there is nothing to expand, might insert the
+ * key that triggered expansion literally.
+ * Returns EXPAND_OK otherwise.
+ */
+ int
+expand_cmdline(xp, str, col, matchcount, matches)
+ expand_T *xp;
+ char_u *str; /* start of command line */
+ int col; /* position of cursor */
+ int *matchcount; /* return: nr of matches */
+ char_u ***matches; /* return: array of pointers to matches */
+{
+ char_u *file_str = NULL;
+
+ if (xp->xp_context == EXPAND_UNSUCCESSFUL)
+ {
+ beep_flush();
+ return EXPAND_UNSUCCESSFUL; /* Something illegal on command line */
+ }
+ if (xp->xp_context == EXPAND_NOTHING)
+ {
+ /* Caller can use the character as a normal char instead */
+ return EXPAND_NOTHING;
+ }
+
+ /* add star to file name, or convert to regexp if not exp. files. */
+ file_str = addstar(xp->xp_pattern,
+ (int)(str + col - xp->xp_pattern), xp->xp_context);
+ if (file_str == NULL)
+ return EXPAND_UNSUCCESSFUL;
+
+ /* find all files that match the description */
+ if (ExpandFromContext(xp, file_str, matchcount, matches,
+ WILD_ADD_SLASH|WILD_SILENT) == FAIL)
+ {
+ *matchcount = 0;
+ *matches = NULL;
+ }
+ vim_free(file_str);
+
+ return EXPAND_OK;
+}
+
+#ifdef FEAT_MULTI_LANG
+/*
+ * Cleanup matches for help tags: remove "@en" if "en" is the only language.
+ */
+static void cleanup_help_tags __ARGS((int num_file, char_u **file));
+
+ static void
+cleanup_help_tags(num_file, file)
+ int num_file;
+ char_u **file;
+{
+ int i, j;
+ int len;
+
+ for (i = 0; i < num_file; ++i)
+ {
+ len = (int)STRLEN(file[i]) - 3;
+ if (len > 0 && STRCMP(file[i] + len, "@en") == 0)
+ {
+ /* Sorting on priority means the same item in another language may
+ * be anywhere. Search all items for a match up to the "@en". */
+ for (j = 0; j < num_file; ++j)
+ if (j != i
+ && (int)STRLEN(file[j]) == len + 3
+ && STRNCMP(file[i], file[j], len + 1) == 0)
+ break;
+ if (j == num_file)
+ file[i][len] = NUL;
+ }
+ }
+}
+#endif
+
+/*
+ * Do the expansion based on xp->xp_context and "pat".
+ */
+ static int
+ExpandFromContext(xp, pat, num_file, file, options)
+ expand_T *xp;
+ char_u *pat;
+ int *num_file;
+ char_u ***file;
+ int options;
+{
+#ifdef FEAT_CMDL_COMPL
+ regmatch_T regmatch;
+#endif
+ int ret;
+ int flags;
+
+ flags = EW_DIR; /* include directories */
+ if (options & WILD_LIST_NOTFOUND)
+ flags |= EW_NOTFOUND;
+ if (options & WILD_ADD_SLASH)
+ flags |= EW_ADDSLASH;
+ if (options & WILD_KEEP_ALL)
+ flags |= EW_KEEPALL;
+ if (options & WILD_SILENT)
+ flags |= EW_SILENT;
+
+ if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_DIRECTORIES)
+ {
+ /*
+ * Expand file or directory names.
+ */
+ int free_pat = FALSE;
+ int i;
+
+ /* for ":set path=" and ":set tags=" halve backslashes for escaped
+ * space */
+ if (xp->xp_backslash != XP_BS_NONE)
+ {
+ free_pat = TRUE;
+ pat = vim_strsave(pat);
+ for (i = 0; pat[i]; ++i)
+ if (pat[i] == '\\')
+ {
+ if (xp->xp_backslash == XP_BS_THREE
+ && pat[i + 1] == '\\'
+ && pat[i + 2] == '\\'
+ && pat[i + 3] == ' ')
+ STRCPY(pat + i, pat + i + 3);
+ if (xp->xp_backslash == XP_BS_ONE
+ && pat[i + 1] == ' ')
+ STRCPY(pat + i, pat + i + 1);
+ }
+ }
+
+ if (xp->xp_context == EXPAND_FILES)
+ flags |= EW_FILE;
+ else
+ flags = (flags | EW_DIR) & ~EW_FILE;
+ ret = expand_wildcards(1, &pat, num_file, file, flags);
+ if (free_pat)
+ vim_free(pat);
+ return ret;
+ }
+
+ *file = (char_u **)"";
+ *num_file = 0;
+ if (xp->xp_context == EXPAND_HELP)
+ {
+ if (find_help_tags(pat, num_file, file, FALSE) == OK)
+ {
+#ifdef FEAT_MULTI_LANG
+ cleanup_help_tags(*num_file, *file);
+#endif
+ return OK;
+ }
+ return FAIL;
+ }
+
+#ifndef FEAT_CMDL_COMPL
+ return FAIL;
+#else
+ if (xp->xp_context == EXPAND_OLD_SETTING)
+ return ExpandOldSetting(num_file, file);
+ if (xp->xp_context == EXPAND_BUFFERS)
+ return ExpandBufnames(pat, num_file, file, options);
+ if (xp->xp_context == EXPAND_TAGS
+ || xp->xp_context == EXPAND_TAGS_LISTFILES)
+ return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);
+ if (xp->xp_context == EXPAND_COLORS)
+ return ExpandRTDir(pat, num_file, file, "colors");
+ if (xp->xp_context == EXPAND_COMPILER)
+ return ExpandRTDir(pat, num_file, file, "compiler");
+
+ regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
+ if (regmatch.regprog == NULL)
+ return FAIL;
+
+ /* set ignore-case according to p_ic, p_scs and pat */
+ regmatch.rm_ic = ignorecase(pat);
+
+ if (xp->xp_context == EXPAND_SETTINGS
+ || xp->xp_context == EXPAND_BOOL_SETTINGS)
+ ret = ExpandSettings(xp, &regmatch, num_file, file);
+ else if (xp->xp_context == EXPAND_MAPPINGS)
+ ret = ExpandMappings(&regmatch, num_file, file);
+# if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
+ else if (xp->xp_context == EXPAND_USER_DEFINED)
+ ret = ExpandUserDefined(xp, &regmatch, num_file, file);
+# endif
+ else
+ {
+ static struct expgen
+ {
+ int context;
+ char_u *((*func)__ARGS((expand_T *, int)));
+ int ic;
+ } tab[] =
+ {
+ {EXPAND_COMMANDS, get_command_name, FALSE},
+#ifdef FEAT_USR_CMDS
+ {EXPAND_USER_COMMANDS, get_user_commands, FALSE},
+ {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
+ {EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE},
+ {EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE},
+#endif
+#ifdef FEAT_EVAL
+ {EXPAND_USER_VARS, get_user_var_name, FALSE},
+ {EXPAND_FUNCTIONS, get_function_name, FALSE},
+ {EXPAND_USER_FUNC, get_user_func_name, FALSE},
+ {EXPAND_EXPRESSION, get_expr_name, FALSE},
+#endif
+#ifdef FEAT_MENU
+ {EXPAND_MENUS, get_menu_name, FALSE},
+ {EXPAND_MENUNAMES, get_menu_names, FALSE},
+#endif
+#ifdef FEAT_SYN_HL
+ {EXPAND_SYNTAX, get_syntax_name, TRUE},
+#endif
+ {EXPAND_HIGHLIGHT, get_highlight_name, TRUE},
+#ifdef FEAT_AUTOCMD
+ {EXPAND_EVENTS, get_event_name, TRUE},
+ {EXPAND_AUGROUP, get_augroup_name, TRUE},
+#endif
+#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
+ && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
+ {EXPAND_LANGUAGE, get_lang_arg, TRUE},
+#endif
+ {EXPAND_ENV_VARS, get_env_name, TRUE},
+ };
+ int i;
+
+ /*
+ * Find a context in the table and call the ExpandGeneric() with the
+ * right function to do the expansion.
+ */
+ ret = FAIL;
+ for (i = 0; i < sizeof(tab) / sizeof(struct expgen); ++i)
+ if (xp->xp_context == tab[i].context)
+ {
+ if (tab[i].ic)
+ regmatch.rm_ic = TRUE;
+ ret = ExpandGeneric(xp, &regmatch, num_file, file, tab[i].func);
+ break;
+ }
+ }
+
+ vim_free(regmatch.regprog);
+
+ return ret;
+#endif /* FEAT_CMDL_COMPL */
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Expand a list of names.
+ *
+ * Generic function for command line completion. It calls a function to
+ * obtain strings, one by one. The strings are matched against a regexp
+ * program. Matching strings are copied into an array, which is returned.
+ *
+ * Returns OK when no problems encountered, FAIL for error (out of memory).
+ */
+ int
+ExpandGeneric(xp, regmatch, num_file, file, func)
+ expand_T *xp;
+ regmatch_T *regmatch;
+ int *num_file;
+ char_u ***file;
+ char_u *((*func)__ARGS((expand_T *, int)));
+ /* returns a string from the list */
+{
+ int i;
+ int count = 0;
+ int loop;
+ char_u *str;
+
+ /* do this loop twice:
+ * loop == 0: count the number of matching names
+ * loop == 1: copy the matching names into allocated memory
+ */
+ for (loop = 0; loop <= 1; ++loop)
+ {
+ for (i = 0; ; ++i)
+ {
+ str = (*func)(xp, i);
+ if (str == NULL) /* end of list */
+ break;
+ if (*str == NUL) /* skip empty strings */
+ continue;
+
+ if (vim_regexec(regmatch, str, (colnr_T)0))
+ {
+ if (loop)
+ {
+ str = vim_strsave_escaped(str, (char_u *)" \t\\.");
+ (*file)[count] = str;
+#ifdef FEAT_MENU
+ if (func == get_menu_names && str != NULL)
+ {
+ /* test for separator added by get_menu_names() */
+ str += STRLEN(str) - 1;
+ if (*str == '\001')
+ *str = '.';
+ }
+#endif
+ }
+ ++count;
+ }
+ }
+ if (loop == 0)
+ {
+ if (count == 0)
+ return OK;
+ *num_file = count;
+ *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
+ if (*file == NULL)
+ {
+ *file = (char_u **)"";
+ return FAIL;
+ }
+ count = 0;
+ }
+ }
+ return OK;
+}
+
+# if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
+/*
+ * Expand names with a function defined by the user.
+ */
+ static int
+ExpandUserDefined(xp, regmatch, num_file, file)
+ expand_T *xp;
+ regmatch_T *regmatch;
+ int *num_file;
+ char_u ***file;
+{
+ char_u *args[3];
+ char_u *all;
+ char_u *s;
+ char_u *e;
+ char_u keep;
+ char_u num[50];
+ garray_T ga;
+ int save_current_SID = current_SID;
+
+ if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0')
+ return FAIL;
+ *num_file = 0;
+ *file = NULL;
+
+ keep = ccline.cmdbuff[ccline.cmdlen];
+ ccline.cmdbuff[ccline.cmdlen] = 0;
+ sprintf((char *)num, "%d", ccline.cmdpos);
+ args[0] = xp->xp_pattern;
+ args[1] = ccline.cmdbuff;
+ args[2] = num;
+
+ current_SID = xp->xp_scriptID;
+ all = call_vim_function(xp->xp_arg, 3, args, FALSE);
+ current_SID = save_current_SID;
+ ccline.cmdbuff[ccline.cmdlen] = keep;
+ if (all == NULL)
+ return FAIL;
+
+ ga_init2(&ga, (int)sizeof(char *), 3);
+ for (s = all; *s != NUL; s = e)
+ {
+ e = vim_strchr(s, '\n');
+ if (e == NULL)
+ e = s + STRLEN(s);
+ keep = *e;
+ *e = 0;
+
+ if (xp->xp_pattern[0] && vim_regexec(regmatch, s, (colnr_T)0) == 0)
+ {
+ *e = keep;
+ if (*e != NUL)
+ ++e;
+ continue;
+ }
+
+ if (ga_grow(&ga, 1) == FAIL)
+ break;
+
+ ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, (int)(e - s));
+ ++ga.ga_len;
+ --ga.ga_room;
+
+ *e = keep;
+ if (*e != NUL)
+ ++e;
+ }
+ vim_free(all);
+ *file = ga.ga_data;
+ *num_file = ga.ga_len;
+ return OK;
+}
+#endif
+
+/*
+ * Expand color scheme names: 'runtimepath'/colors/{pat}.vim
+ * or compiler names.
+ */
+ static int
+ExpandRTDir(pat, num_file, file, dirname)
+ char_u *pat;
+ int *num_file;
+ char_u ***file;
+ char *dirname; /* "colors" or "compiler" */
+{
+ char_u *all;
+ char_u *s;
+ char_u *e;
+ garray_T ga;
+
+ *num_file = 0;
+ *file = NULL;
+ s = alloc((unsigned)(STRLEN(pat) + STRLEN(dirname) + 7));
+ if (s == NULL)
+ return FAIL;
+ sprintf((char *)s, "%s/%s*.vim", dirname, pat);
+ all = globpath(p_rtp, s);
+ vim_free(s);
+ if (all == NULL)
+ return FAIL;
+
+ ga_init2(&ga, (int)sizeof(char *), 3);
+ for (s = all; *s != NUL; s = e)
+ {
+ e = vim_strchr(s, '\n');
+ if (e == NULL)
+ e = s + STRLEN(s);
+ if (ga_grow(&ga, 1) == FAIL)
+ break;
+ if (e - 4 > s && STRNICMP(e - 4, ".vim", 4) == 0)
+ {
+ for (s = e - 4; s > all; --s)
+ if (*s == '\n' || vim_ispathsep(*s))
+ break;
+ ++s;
+ ((char_u **)ga.ga_data)[ga.ga_len] =
+ vim_strnsave(s, (int)(e - s - 4));
+ ++ga.ga_len;
+ --ga.ga_room;
+ }
+ if (*e != NUL)
+ ++e;
+ }
+ vim_free(all);
+ *file = ga.ga_data;
+ *num_file = ga.ga_len;
+ return OK;
+}
+
+#endif
+
+#if defined(FEAT_CMDL_COMPL) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Expand "file" for all comma-separated directories in "path".
+ * Returns an allocated string with all matches concatenated, separated by
+ * newlines. Returns NULL for an error or no matches.
+ */
+ char_u *
+globpath(path, file)
+ char_u *path;
+ char_u *file;
+{
+ expand_T xpc;
+ char_u *buf;
+ garray_T ga;
+ int i;
+ int len;
+ int num_p;
+ char_u **p;
+ char_u *cur = NULL;
+
+ buf = alloc(MAXPATHL);
+ if (buf == NULL)
+ return NULL;
+
+ xpc.xp_context = EXPAND_FILES;
+ xpc.xp_backslash = XP_BS_NONE;
+ ga_init2(&ga, 1, 100);
+
+ /* Loop over all entries in {path}. */
+ while (*path != NUL)
+ {
+ /* Copy one item of the path to buf[] and concatenate the file name. */
+ copy_option_part(&path, buf, MAXPATHL, ",");
+ if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL)
+ {
+ add_pathsep(buf);
+ STRCAT(buf, file);
+ if (ExpandFromContext(&xpc, buf, &num_p, &p, WILD_SILENT) != FAIL
+ && num_p > 0)
+ {
+ ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT);
+ for (len = 0, i = 0; i < num_p; ++i)
+ len += (long_u)STRLEN(p[i]) + 1;
+
+ /* Concatenate new results to previous ones. */
+ if (ga_grow(&ga, len) == OK)
+ {
+ cur = (char_u *)ga.ga_data + ga.ga_len;
+ for (i = 0; i < num_p; ++i)
+ {
+ STRCPY(cur, p[i]);
+ cur += STRLEN(p[i]);
+ *cur++ = '\n';
+ }
+ ga.ga_len += len;
+ ga.ga_room -= len;
+ }
+ FreeWild(num_p, p);
+ }
+ }
+ }
+ if (cur != NULL)
+ *--cur = 0; /* Replace trailing newline with NUL */
+
+ vim_free(buf);
+ return (char_u *)ga.ga_data;
+}
+
+#endif
+
+#if defined(FEAT_CMDHIST) || defined(PROTO)
+
+/*********************************
+ * Command line history stuff *
+ *********************************/
+
+/*
+ * Translate a history character to the associated type number.
+ */
+ static int
+hist_char2type(c)
+ int c;
+{
+ if (c == ':')
+ return HIST_CMD;
+ if (c == '=')
+ return HIST_EXPR;
+ if (c == '@')
+ return HIST_INPUT;
+ if (c == '>')
+ return HIST_DEBUG;
+ return HIST_SEARCH; /* must be '?' or '/' */
+}
+
+/*
+ * Table of history names.
+ * These names are used in :history and various hist...() functions.
+ * It is sufficient to give the significant prefix of a history name.
+ */
+
+static char *(history_names[]) =
+{
+ "cmd",
+ "search",
+ "expr",
+ "input",
+ "debug",
+ NULL
+};
+
+/*
+ * init_history() - Initialize the command line history.
+ * Also used to re-allocate the history when the size changes.
+ */
+ static void
+init_history()
+{
+ int newlen; /* new length of history table */
+ histentry_T *temp;
+ int i;
+ int j;
+ int type;
+
+ /*
+ * If size of history table changed, reallocate it
+ */
+ newlen = (int)p_hi;
+ if (newlen != hislen) /* history length changed */
+ {
+ for (type = 0; type < HIST_COUNT; ++type) /* adjust the tables */
+ {
+ if (newlen)
+ {
+ temp = (histentry_T *)lalloc(
+ (long_u)(newlen * sizeof(histentry_T)), TRUE);
+ if (temp == NULL) /* out of memory! */
+ {
+ if (type == 0) /* first one: just keep the old length */
+ {
+ newlen = hislen;
+ break;
+ }
+ /* Already changed one table, now we can only have zero
+ * length for all tables. */
+ newlen = 0;
+ type = -1;
+ continue;
+ }
+ }
+ else
+ temp = NULL;
+ if (newlen == 0 || temp != NULL)
+ {
+ if (hisidx[type] < 0) /* there are no entries yet */
+ {
+ for (i = 0; i < newlen; ++i)
+ {
+ temp[i].hisnum = 0;
+ temp[i].hisstr = NULL;
+ }
+ }
+ else if (newlen > hislen) /* array becomes bigger */
+ {
+ for (i = 0; i <= hisidx[type]; ++i)
+ temp[i] = history[type][i];
+ j = i;
+ for ( ; i <= newlen - (hislen - hisidx[type]); ++i)
+ {
+ temp[i].hisnum = 0;
+ temp[i].hisstr = NULL;
+ }
+ for ( ; j < hislen; ++i, ++j)
+ temp[i] = history[type][j];
+ }
+ else /* array becomes smaller or 0 */
+ {
+ j = hisidx[type];
+ for (i = newlen - 1; ; --i)
+ {
+ if (i >= 0) /* copy newest entries */
+ temp[i] = history[type][j];
+ else /* remove older entries */
+ vim_free(history[type][j].hisstr);
+ if (--j < 0)
+ j = hislen - 1;
+ if (j == hisidx[type])
+ break;
+ }
+ hisidx[type] = newlen - 1;
+ }
+ vim_free(history[type]);
+ history[type] = temp;
+ }
+ }
+ hislen = newlen;
+ }
+}
+
+/*
+ * Check if command line 'str' is already in history.
+ * If 'move_to_front' is TRUE, matching entry is moved to end of history.
+ */
+ static int
+in_history(type, str, move_to_front)
+ int type;
+ char_u *str;
+ int move_to_front; /* Move the entry to the front if it exists */
+{
+ int i;
+ int last_i = -1;
+
+ if (hisidx[type] < 0)
+ return FALSE;
+ i = hisidx[type];
+ do
+ {
+ if (history[type][i].hisstr == NULL)
+ return FALSE;
+ if (STRCMP(str, history[type][i].hisstr) == 0)
+ {
+ if (!move_to_front)
+ return TRUE;
+ last_i = i;
+ break;
+ }
+ if (--i < 0)
+ i = hislen - 1;
+ } while (i != hisidx[type]);
+
+ if (last_i >= 0)
+ {
+ str = history[type][i].hisstr;
+ while (i != hisidx[type])
+ {
+ if (++i >= hislen)
+ i = 0;
+ history[type][last_i] = history[type][i];
+ last_i = i;
+ }
+ history[type][i].hisstr = str;
+ history[type][i].hisnum = ++hisnum[type];
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Convert history name (from table above) to its HIST_ equivalent.
+ * When "name" is empty, return "cmd" history.
+ * Returns -1 for unknown history name.
+ */
+ int
+get_histtype(name)
+ char_u *name;
+{
+ int i;
+ int len = (int)STRLEN(name);
+
+ /* No argument: use current history. */
+ if (len == 0)
+ return hist_char2type(ccline.cmdfirstc);
+
+ for (i = 0; history_names[i] != NULL; ++i)
+ if (STRNICMP(name, history_names[i], len) == 0)
+ return i;
+
+ if (vim_strchr((char_u *)":=@>?/", name[0]) != NULL && name[1] == NUL)
+ return hist_char2type(name[0]);
+
+ return -1;
+}
+
+static int last_maptick = -1; /* last seen maptick */
+
+/*
+ * Add the given string to the given history. If the string is already in the
+ * history then it is moved to the front. "histype" may be one of he HIST_
+ * values.
+ */
+ void
+add_to_history(histype, new_entry, in_map, sep)
+ int histype;
+ char_u *new_entry;
+ int in_map; /* consider maptick when inside a mapping */
+ int sep; /* separator character used (search hist) */
+{
+ histentry_T *hisptr;
+ int len;
+
+ if (hislen == 0) /* no history */
+ return;
+
+ /*
+ * Searches inside the same mapping overwrite each other, so that only
+ * the last line is kept. Be careful not to remove a line that was moved
+ * down, only lines that were added.
+ */
+ if (histype == HIST_SEARCH && in_map)
+ {
+ if (maptick == last_maptick)
+ {
+ /* Current line is from the same mapping, remove it */
+ hisptr = &history[HIST_SEARCH][hisidx[HIST_SEARCH]];
+ vim_free(hisptr->hisstr);
+ hisptr->hisstr = NULL;
+ hisptr->hisnum = 0;
+ --hisnum[histype];
+ if (--hisidx[HIST_SEARCH] < 0)
+ hisidx[HIST_SEARCH] = hislen - 1;
+ }
+ last_maptick = -1;
+ }
+ if (!in_history(histype, new_entry, TRUE))
+ {
+ if (++hisidx[histype] == hislen)
+ hisidx[histype] = 0;
+ hisptr = &history[histype][hisidx[histype]];
+ vim_free(hisptr->hisstr);
+
+ /* Store the separator after the NUL of the string. */
+ len = STRLEN(new_entry);
+ hisptr->hisstr = vim_strnsave(new_entry, len + 2);
+ if (hisptr->hisstr != NULL)
+ hisptr->hisstr[len + 1] = sep;
+
+ hisptr->hisnum = ++hisnum[histype];
+ if (histype == HIST_SEARCH && in_map)
+ last_maptick = maptick;
+ }
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+/*
+ * Get identifier of newest history entry.
+ * "histype" may be one of the HIST_ values.
+ */
+ int
+get_history_idx(histype)
+ int histype;
+{
+ if (hislen == 0 || histype < 0 || histype >= HIST_COUNT
+ || hisidx[histype] < 0)
+ return -1;
+
+ return history[histype][hisidx[histype]].hisnum;
+}
+
+/*
+ * Get the current command line in allocated memory.
+ * Only works when the command line is being edited.
+ * Returns NULL when something is wrong.
+ */
+ char_u *
+get_cmdline_str()
+{
+ if (ccline.cmdbuff == NULL || (State & CMDLINE) == 0)
+ return NULL;
+ return vim_strnsave(ccline.cmdbuff, ccline.cmdlen);
+}
+
+/*
+ * Get the current command line position, counted in bytes.
+ * Zero is the first position.
+ * Only works when the command line is being edited.
+ * Returns -1 when something is wrong.
+ */
+ int
+get_cmdline_pos()
+{
+ if (ccline.cmdbuff == NULL || (State & CMDLINE) == 0)
+ return -1;
+ return ccline.cmdpos;
+}
+
+/*
+ * Set the command line byte position to "pos". Zero is the first position.
+ * Only works when the command line is being edited.
+ * Returns 1 when failed, 0 when OK.
+ */
+ int
+set_cmdline_pos(pos)
+ int pos;
+{
+ if (ccline.cmdbuff == NULL || (State & CMDLINE) == 0)
+ return 1;
+
+ /* The position is not set directly but after CTRL-\ e or CTRL-R = has
+ * changed the command line. */
+ if (pos < 0)
+ new_cmdpos = 0;
+ else
+ new_cmdpos = pos;
+ return 0;
+}
+
+/*
+ * Calculate history index from a number:
+ * num > 0: seen as identifying number of a history entry
+ * num < 0: relative position in history wrt newest entry
+ * "histype" may be one of the HIST_ values.
+ */
+ static int
+calc_hist_idx(histype, num)
+ int histype;
+ int num;
+{
+ int i;
+ histentry_T *hist;
+ int wrapped = FALSE;
+
+ if (hislen == 0 || histype < 0 || histype >= HIST_COUNT
+ || (i = hisidx[histype]) < 0 || num == 0)
+ return -1;
+
+ hist = history[histype];
+ if (num > 0)
+ {
+ while (hist[i].hisnum > num)
+ if (--i < 0)
+ {
+ if (wrapped)
+ break;
+ i += hislen;
+ wrapped = TRUE;
+ }
+ if (hist[i].hisnum == num && hist[i].hisstr != NULL)
+ return i;
+ }
+ else if (-num <= hislen)
+ {
+ i += num + 1;
+ if (i < 0)
+ i += hislen;
+ if (hist[i].hisstr != NULL)
+ return i;
+ }
+ return -1;
+}
+
+/*
+ * Get a history entry by its index.
+ * "histype" may be one of the HIST_ values.
+ */
+ char_u *
+get_history_entry(histype, idx)
+ int histype;
+ int idx;
+{
+ idx = calc_hist_idx(histype, idx);
+ if (idx >= 0)
+ return history[histype][idx].hisstr;
+ else
+ return (char_u *)"";
+}
+
+/*
+ * Clear all entries of a history.
+ * "histype" may be one of the HIST_ values.
+ */
+ int
+clr_history(histype)
+ int histype;
+{
+ int i;
+ histentry_T *hisptr;
+
+ if (hislen != 0 && histype >= 0 && histype < HIST_COUNT)
+ {
+ hisptr = history[histype];
+ for (i = hislen; i--;)
+ {
+ vim_free(hisptr->hisstr);
+ hisptr->hisnum = 0;
+ hisptr++->hisstr = NULL;
+ }
+ hisidx[histype] = -1; /* mark history as cleared */
+ hisnum[histype] = 0; /* reset identifier counter */
+ return OK;
+ }
+ return FAIL;
+}
+
+/*
+ * Remove all entries matching {str} from a history.
+ * "histype" may be one of the HIST_ values.
+ */
+ int
+del_history_entry(histype, str)
+ int histype;
+ char_u *str;
+{
+ regmatch_T regmatch;
+ histentry_T *hisptr;
+ int idx;
+ int i;
+ int last;
+ int found = FALSE;
+
+ regmatch.regprog = NULL;
+ regmatch.rm_ic = FALSE; /* always match case */
+ if (hislen != 0
+ && histype >= 0
+ && histype < HIST_COUNT
+ && *str != NUL
+ && (idx = hisidx[histype]) >= 0
+ && (regmatch.regprog = vim_regcomp(str, RE_MAGIC + RE_STRING))
+ != NULL)
+ {
+ i = last = idx;
+ do
+ {
+ hisptr = &history[histype][i];
+ if (hisptr->hisstr == NULL)
+ break;
+ if (vim_regexec(&regmatch, hisptr->hisstr, (colnr_T)0))
+ {
+ found = TRUE;
+ vim_free(hisptr->hisstr);
+ hisptr->hisstr = NULL;
+ hisptr->hisnum = 0;
+ }
+ else
+ {
+ if (i != last)
+ {
+ history[histype][last] = *hisptr;
+ hisptr->hisstr = NULL;
+ hisptr->hisnum = 0;
+ }
+ if (--last < 0)
+ last += hislen;
+ }
+ if (--i < 0)
+ i += hislen;
+ } while (i != idx);
+ if (history[histype][idx].hisstr == NULL)
+ hisidx[histype] = -1;
+ }
+ vim_free(regmatch.regprog);
+ return found;
+}
+
+/*
+ * Remove an indexed entry from a history.
+ * "histype" may be one of the HIST_ values.
+ */
+ int
+del_history_idx(histype, idx)
+ int histype;
+ int idx;
+{
+ int i, j;
+
+ i = calc_hist_idx(histype, idx);
+ if (i < 0)
+ return FALSE;
+ idx = hisidx[histype];
+ vim_free(history[histype][i].hisstr);
+
+ /* When deleting the last added search string in a mapping, reset
+ * last_maptick, so that the last added search string isn't deleted again.
+ */
+ if (histype == HIST_SEARCH && maptick == last_maptick && i == idx)
+ last_maptick = -1;
+
+ while (i != idx)
+ {
+ j = (i + 1) % hislen;
+ history[histype][i] = history[histype][j];
+ i = j;
+ }
+ history[histype][i].hisstr = NULL;
+ history[histype][i].hisnum = 0;
+ if (--i < 0)
+ i += hislen;
+ hisidx[histype] = i;
+ return TRUE;
+}
+
+#endif /* FEAT_EVAL */
+
+#if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Very specific function to remove the value in ":set key=val" from the
+ * history.
+ */
+ void
+remove_key_from_history()
+{
+ char_u *p;
+ int i;
+
+ i = hisidx[HIST_CMD];
+ if (i < 0)
+ return;
+ p = history[HIST_CMD][i].hisstr;
+ if (p != NULL)
+ for ( ; *p; ++p)
+ if (STRNCMP(p, "key", 3) == 0 && !isalpha(p[3]))
+ {
+ p = vim_strchr(p + 3, '=');
+ if (p == NULL)
+ break;
+ ++p;
+ for (i = 0; p[i] && !vim_iswhite(p[i]); ++i)
+ if (p[i] == '\\' && p[i + 1])
+ ++i;
+ mch_memmove(p, p + i, STRLEN(p + i) + 1);
+ --p;
+ }
+}
+#endif
+
+#endif /* FEAT_CMDHIST */
+
+#if defined(FEAT_QUICKFIX) || defined(FEAT_CMDHIST) || defined(PROTO)
+/*
+ * Get indices "num1,num2" that specify a range within a list (not a range of
+ * text lines in a buffer!) from a string. Used for ":history" and ":clist".
+ * Returns OK if parsed successfully, otherwise FAIL.
+ */
+ int
+get_list_range(str, num1, num2)
+ char_u **str;
+ int *num1;
+ int *num2;
+{
+ int len;
+ int first = FALSE;
+ long num;
+
+ *str = skipwhite(*str);
+ if (**str == '-' || vim_isdigit(**str)) /* parse "from" part of range */
+ {
+ vim_str2nr(*str, NULL, &len, FALSE, FALSE, &num, NULL);
+ *str += len;
+ *num1 = (int)num;
+ first = TRUE;
+ }
+ *str = skipwhite(*str);
+ if (**str == ',') /* parse "to" part of range */
+ {
+ *str = skipwhite(*str + 1);
+ vim_str2nr(*str, NULL, &len, FALSE, FALSE, &num, NULL);
+ if (len > 0)
+ {
+ *num2 = (int)num;
+ *str = skipwhite(*str + len);
+ }
+ else if (!first) /* no number given at all */
+ return FAIL;
+ }
+ else if (first) /* only one number given */
+ *num2 = *num1;
+ return OK;
+}
+#endif
+
+#if defined(FEAT_CMDHIST) || defined(PROTO)
+/*
+ * :history command - print a history
+ */
+ void
+ex_history(eap)
+ exarg_T *eap;
+{
+ histentry_T *hist;
+ int histype1 = HIST_CMD;
+ int histype2 = HIST_CMD;
+ int hisidx1 = 1;
+ int hisidx2 = -1;
+ int idx;
+ int i, j, k;
+ char_u *end;
+ char_u *arg = eap->arg;
+
+ if (hislen == 0)
+ {
+ MSG(_("'history' option is zero"));
+ return;
+ }
+
+ if (!(VIM_ISDIGIT(*arg) || *arg == '-' || *arg == ','))
+ {
+ end = arg;
+ while (ASCII_ISALPHA(*end)
+ || vim_strchr((char_u *)":=@>/?", *end) != NULL)
+ end++;
+ i = *end;
+ *end = NUL;
+ histype1 = get_histtype(arg);
+ if (histype1 == -1)
+ {
+ if (STRICMP(arg, "all") == 0)
+ {
+ histype1 = 0;
+ histype2 = HIST_COUNT-1;
+ }
+ else
+ {
+ *end = i;
+ EMSG(_(e_trailing));
+ return;
+ }
+ }
+ else
+ histype2 = histype1;
+ *end = i;
+ }
+ else
+ end = arg;
+ if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL)
+ {
+ EMSG(_(e_trailing));
+ return;
+ }
+
+ for (; !got_int && histype1 <= histype2; ++histype1)
+ {
+ STRCPY(IObuff, "\n # ");
+ STRCAT(STRCAT(IObuff, history_names[histype1]), " history");
+ MSG_PUTS_TITLE(IObuff);
+ idx = hisidx[histype1];
+ hist = history[histype1];
+ j = hisidx1;
+ k = hisidx2;
+ if (j < 0)
+ j = (-j > hislen) ? 0 : hist[(hislen+j+idx+1) % hislen].hisnum;
+ if (k < 0)
+ k = (-k > hislen) ? 0 : hist[(hislen+k+idx+1) % hislen].hisnum;
+ if (idx >= 0 && j <= k)
+ for (i = idx + 1; !got_int; ++i)
+ {
+ if (i == hislen)
+ i = 0;
+ if (hist[i].hisstr != NULL
+ && hist[i].hisnum >= j && hist[i].hisnum <= k)
+ {
+ msg_putchar('\n');
+ sprintf((char *)IObuff, "%c%6d ", i == idx ? '>' : ' ',
+ hist[i].hisnum);
+ if (vim_strsize(hist[i].hisstr) > (int)Columns - 10)
+ trunc_string(hist[i].hisstr, IObuff + STRLEN(IObuff),
+ (int)Columns - 10);
+ else
+ STRCAT(IObuff, hist[i].hisstr);
+ msg_outtrans(IObuff);
+ out_flush();
+ }
+ if (i == idx)
+ break;
+ }
+ }
+}
+#endif
+
+#if (defined(FEAT_VIMINFO) && defined(FEAT_CMDHIST)) || defined(PROTO)
+static char_u **viminfo_history[HIST_COUNT] = {NULL, NULL, NULL, NULL};
+static int viminfo_hisidx[HIST_COUNT] = {0, 0, 0, 0};
+static int viminfo_hislen[HIST_COUNT] = {0, 0, 0, 0};
+static int viminfo_add_at_front = FALSE;
+
+static int hist_type2char __ARGS((int type, int use_question));
+
+/*
+ * Translate a history type number to the associated character.
+ */
+ static int
+hist_type2char(type, use_question)
+ int type;
+ int use_question; /* use '?' instead of '/' */
+{
+ if (type == HIST_CMD)
+ return ':';
+ if (type == HIST_SEARCH)
+ {
+ if (use_question)
+ return '?';
+ else
+ return '/';
+ }
+ if (type == HIST_EXPR)
+ return '=';
+ return '@';
+}
+
+/*
+ * Prepare for reading the history from the viminfo file.
+ * This allocates history arrays to store the read history lines.
+ */
+ void
+prepare_viminfo_history(asklen)
+ int asklen;
+{
+ int i;
+ int num;
+ int type;
+ int len;
+
+ init_history();
+ viminfo_add_at_front = (asklen != 0);
+ if (asklen > hislen)
+ asklen = hislen;
+
+ for (type = 0; type < HIST_COUNT; ++type)
+ {
+ /*
+ * Count the number of empty spaces in the history list. If there are
+ * more spaces available than we request, then fill them up.
+ */
+ for (i = 0, num = 0; i < hislen; i++)
+ if (history[type][i].hisstr == NULL)
+ num++;
+ len = asklen;
+ if (num > len)
+ len = num;
+ if (len <= 0)
+ viminfo_history[type] = NULL;
+ else
+ viminfo_history[type] =
+ (char_u **)lalloc((long_u)(len * sizeof(char_u *)), FALSE);
+ if (viminfo_history[type] == NULL)
+ len = 0;
+ viminfo_hislen[type] = len;
+ viminfo_hisidx[type] = 0;
+ }
+}
+
+/*
+ * Accept a line from the viminfo, store it in the history array when it's
+ * new.
+ */
+ int
+read_viminfo_history(virp)
+ vir_T *virp;
+{
+ int type;
+ long_u len;
+ char_u *val;
+ char_u *p;
+
+ type = hist_char2type(virp->vir_line[0]);
+ if (viminfo_hisidx[type] < viminfo_hislen[type])
+ {
+ val = viminfo_readstring(virp, 1, TRUE);
+ if (val != NULL && *val != NUL)
+ {
+ if (!in_history(type, val + (type == HIST_SEARCH),
+ viminfo_add_at_front))
+ {
+ /* Need to re-allocate to append the separator byte. */
+ len = STRLEN(val);
+ p = lalloc(len + 2, TRUE);
+ if (p != NULL)
+ {
+ if (type == HIST_SEARCH)
+ {
+ /* Search entry: Move the separator from the first
+ * column to after the NUL. */
+ mch_memmove(p, val + 1, (size_t)len);
+ p[len] = (*val == ' ' ? NUL : *val);
+ }
+ else
+ {
+ /* Not a search entry: No separator in the viminfo
+ * file, add a NUL separator. */
+ mch_memmove(p, val, (size_t)len + 1);
+ p[len + 1] = NUL;
+ }
+ viminfo_history[type][viminfo_hisidx[type]++] = p;
+ }
+ }
+ }
+ vim_free(val);
+ }
+ return viminfo_readline(virp);
+}
+
+ void
+finish_viminfo_history()
+{
+ int idx;
+ int i;
+ int type;
+
+ for (type = 0; type < HIST_COUNT; ++type)
+ {
+ if (history[type] == NULL)
+ return;
+ idx = hisidx[type] + viminfo_hisidx[type];
+ if (idx >= hislen)
+ idx -= hislen;
+ else if (idx < 0)
+ idx = hislen - 1;
+ if (viminfo_add_at_front)
+ hisidx[type] = idx;
+ else
+ {
+ if (hisidx[type] == -1)
+ hisidx[type] = hislen - 1;
+ do
+ {
+ if (history[type][idx].hisstr != NULL)
+ break;
+ if (++idx == hislen)
+ idx = 0;
+ } while (idx != hisidx[type]);
+ if (idx != hisidx[type] && --idx < 0)
+ idx = hislen - 1;
+ }
+ for (i = 0; i < viminfo_hisidx[type]; i++)
+ {
+ vim_free(history[type][idx].hisstr);
+ history[type][idx].hisstr = viminfo_history[type][i];
+ if (--idx < 0)
+ idx = hislen - 1;
+ }
+ idx += 1;
+ idx %= hislen;
+ for (i = 0; i < viminfo_hisidx[type]; i++)
+ {
+ history[type][idx++].hisnum = ++hisnum[type];
+ idx %= hislen;
+ }
+ vim_free(viminfo_history[type]);
+ viminfo_history[type] = NULL;
+ }
+}
+
+ void
+write_viminfo_history(fp)
+ FILE *fp;
+{
+ int i;
+ int type;
+ int num_saved;
+ char_u *p;
+ int c;
+
+ init_history();
+ if (hislen == 0)
+ return;
+ for (type = 0; type < HIST_COUNT; ++type)
+ {
+ num_saved = get_viminfo_parameter(hist_type2char(type, FALSE));
+ if (num_saved == 0)
+ continue;
+ if (num_saved < 0) /* Use default */
+ num_saved = hislen;
+ fprintf(fp, _("\n# %s History (newest to oldest):\n"),
+ type == HIST_CMD ? _("Command Line") :
+ type == HIST_SEARCH ? _("Search String") :
+ type == HIST_EXPR ? _("Expression") :
+ _("Input Line"));
+ if (num_saved > hislen)
+ num_saved = hislen;
+ i = hisidx[type];
+ if (i >= 0)
+ while (num_saved--)
+ {
+ p = history[type][i].hisstr;
+ if (p != NULL)
+ {
+ putc(hist_type2char(type, TRUE), fp);
+ /* For the search history: put the separator in the second
+ * column; use a space if there isn't one. */
+ if (type == HIST_SEARCH)
+ {
+ c = p[STRLEN(p) + 1];
+ putc(c == NUL ? ' ' : c, fp);
+ }
+ viminfo_writestring(fp, p);
+ }
+ if (--i < 0)
+ i = hislen - 1;
+ }
+ }
+}
+#endif /* FEAT_VIMINFO */
+
+#if defined(FEAT_FKMAP) || defined(PROTO)
+/*
+ * Write a character at the current cursor+offset position.
+ * It is directly written into the command buffer block.
+ */
+ void
+cmd_pchar(c, offset)
+ int c, offset;
+{
+ if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
+ {
+ EMSG(_("E198: cmd_pchar beyond the command length"));
+ return;
+ }
+ ccline.cmdbuff[ccline.cmdpos + offset] = (char_u)c;
+ ccline.cmdbuff[ccline.cmdlen] = NUL;
+}
+
+ int
+cmd_gchar(offset)
+ int offset;
+{
+ if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0)
+ {
+ /* EMSG(_("cmd_gchar beyond the command length")); */
+ return NUL;
+ }
+ return (int)ccline.cmdbuff[ccline.cmdpos + offset];
+}
+#endif
+
+#if defined(FEAT_CMDWIN) || defined(PROTO)
+/*
+ * Open a window on the current command line and history. Allow editing in
+ * the window. Returns when the window is closed.
+ * Returns:
+ * CR if the command is to be executed
+ * Ctrl_C if it is to be abandoned
+ * K_IGNORE if editing continues
+ */
+ static int
+ex_window()
+{
+ struct cmdline_info save_ccline;
+ buf_T *old_curbuf = curbuf;
+ win_T *old_curwin = curwin;
+ buf_T *bp;
+ win_T *wp;
+ int i;
+ linenr_T lnum;
+ int histtype;
+ garray_T winsizes;
+ char_u typestr[2];
+ int save_restart_edit = restart_edit;
+ int save_State = State;
+ int save_exmode = exmode_active;
+
+ /* Can't do this recursively. Can't do it when typing a password. */
+ if (cmdwin_type != 0
+# if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+ || cmdline_star > 0
+# endif
+ )
+ {
+ beep_flush();
+ return K_IGNORE;
+ }
+
+ /* Save current window sizes. */
+ win_size_save(&winsizes);
+
+# ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while creating the window. */
+ ++autocmd_block;
+# endif
+ /* Create a window for the command-line buffer. */
+ if (win_split((int)p_cwh, WSP_BOT) == FAIL)
+ {
+ beep_flush();
+ return K_IGNORE;
+ }
+ cmdwin_type = ccline.cmdfirstc;
+ if (cmdwin_type == NUL)
+ cmdwin_type = '-';
+
+ /* Create the command-line buffer empty. */
+ (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
+ (void)setfname(curbuf, (char_u *)"command-line", NULL, TRUE);
+ set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
+ set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
+ curbuf->b_p_ma = TRUE;
+# ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl = FALSE;
+# endif
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+
+# ifdef FEAT_AUTOCMD
+ /* Do execute autocommands for setting the filetype (load syntax). */
+ --autocmd_block;
+# endif
+
+ histtype = hist_char2type(ccline.cmdfirstc);
+ if (histtype == HIST_CMD || histtype == HIST_DEBUG)
+ {
+ if (p_wc == TAB)
+ {
+ add_map((char_u *)"<buffer> <Tab> <C-X><C-V>", INSERT);
+ add_map((char_u *)"<buffer> <Tab> a<C-X><C-V>", NORMAL);
+ }
+ set_option_value((char_u *)"ft", 0L, (char_u *)"vim", OPT_LOCAL);
+ }
+
+ /* Fill the buffer with the history. */
+ init_history();
+ if (hislen > 0)
+ {
+ i = hisidx[histtype];
+ if (i >= 0)
+ {
+ lnum = 0;
+ do
+ {
+ if (++i == hislen)
+ i = 0;
+ if (history[histtype][i].hisstr != NULL)
+ ml_append(lnum++, history[histtype][i].hisstr,
+ (colnr_T)0, FALSE);
+ }
+ while (i != hisidx[histtype]);
+ }
+ }
+
+ /* Replace the empty last line with the current command-line and put the
+ * cursor there. */
+ ml_replace(curbuf->b_ml.ml_line_count, ccline.cmdbuff, TRUE);
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.col = ccline.cmdpos;
+ redraw_later(NOT_VALID);
+
+ /* Save the command line info, can be used recursively. */
+ save_ccline = ccline;
+ ccline.cmdbuff = NULL;
+ ccline.cmdprompt = NULL;
+
+ /* No Ex mode here! */
+ exmode_active = 0;
+
+ State = NORMAL;
+# ifdef FEAT_MOUSE
+ setmouse();
+# endif
+
+# ifdef FEAT_AUTOCMD
+ /* Trigger CmdwinEnter autocommands. */
+ typestr[0] = cmdwin_type;
+ typestr[1] = NUL;
+ apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf);
+# endif
+
+ i = RedrawingDisabled;
+ RedrawingDisabled = 0;
+
+ /*
+ * Call the main loop until <CR> or CTRL-C is typed.
+ */
+ cmdwin_result = 0;
+ main_loop(TRUE);
+
+ RedrawingDisabled = i;
+
+# ifdef FEAT_AUTOCMD
+ /* Trigger CmdwinLeave autocommands. */
+ apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
+# endif
+
+ /* Restore the comand line info. */
+ ccline = save_ccline;
+ cmdwin_type = 0;
+
+ exmode_active = save_exmode;
+
+ /* Safety check: The old window or buffer was deleted: It's a a bug when
+ * this happens! */
+ if (!win_valid(old_curwin) || !buf_valid(old_curbuf))
+ {
+ cmdwin_result = Ctrl_C;
+ EMSG(_("E199: Active window or buffer deleted"));
+ }
+ else
+ {
+# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ /* autocmds may abort script processing */
+ if (aborting() && cmdwin_result != K_IGNORE)
+ cmdwin_result = Ctrl_C;
+# endif
+ /* Set the new command line from the cmdline buffer. */
+ vim_free(ccline.cmdbuff);
+ if (cmdwin_result == K_XF1) /* :qa! typed */
+ {
+ ccline.cmdbuff = vim_strsave((char_u *)"qa!");
+ cmdwin_result = CAR;
+ }
+ else if (cmdwin_result == K_XF2) /* :qa typed */
+ {
+ ccline.cmdbuff = vim_strsave((char_u *)"qa");
+ cmdwin_result = CAR;
+ }
+ else
+ ccline.cmdbuff = vim_strsave(ml_get_curline());
+ if (ccline.cmdbuff == NULL)
+ cmdwin_result = Ctrl_C;
+ else
+ {
+ ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);
+ ccline.cmdbufflen = ccline.cmdlen + 1;
+ ccline.cmdpos = curwin->w_cursor.col;
+ if (ccline.cmdpos > ccline.cmdlen)
+ ccline.cmdpos = ccline.cmdlen;
+ if (cmdwin_result == K_IGNORE)
+ {
+ set_cmdspos_cursor();
+ redrawcmd();
+ }
+ }
+
+# ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while deleting the window. */
+ ++autocmd_block;
+# endif
+ wp = curwin;
+ bp = curbuf;
+ win_goto(old_curwin);
+ win_close(wp, TRUE);
+ close_buffer(NULL, bp, DOBUF_WIPE);
+
+ /* Restore window sizes. */
+ win_size_restore(&winsizes);
+
+# ifdef FEAT_AUTOCMD
+ --autocmd_block;
+# endif
+ }
+
+ ga_clear(&winsizes);
+ restart_edit = save_restart_edit;
+
+ State = save_State;
+# ifdef FEAT_MOUSE
+ setmouse();
+# endif
+
+ return cmdwin_result;
+}
+#endif /* FEAT_CMDWIN */
+
+/*
+ * Used for commands that either take a simple command string argument, or:
+ * cmd << endmarker
+ * {script}
+ * endmarker
+ * Returns a pointer to allocated memory with {script} or NULL.
+ */
+ char_u *
+script_get(eap, cmd)
+ exarg_T *eap;
+ char_u *cmd;
+{
+ char_u *theline;
+ char *end_pattern = NULL;
+ char dot[] = ".";
+ garray_T ga;
+
+ if (cmd[0] != '<' || cmd[1] != '<' || eap->getline == NULL)
+ return NULL;
+
+ ga_init2(&ga, 1, 0x400);
+
+ if (cmd[2] != NUL)
+ end_pattern = (char *)skipwhite(cmd + 2);
+ else
+ end_pattern = dot;
+
+ for (;;)
+ {
+ theline = eap->getline(
+#ifdef FEAT_EVAL
+ eap->cstack->cs_whilelevel > 0 ? -1 :
+#endif
+ NUL, eap->cookie, 0);
+
+ if (theline == NULL || STRCMP(end_pattern, theline) == 0)
+ break;
+
+ ga_concat(&ga, theline);
+ ga_append(&ga, '\n');
+ vim_free(theline);
+ }
+
+ return (char_u *)ga.ga_data;
+}
diff --git a/src/farsi.c b/src/farsi.c
new file mode 100644
index 000000000..f74447f76
--- /dev/null
+++ b/src/farsi.c
@@ -0,0 +1,2312 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * farsi.c: functions for Farsi language
+ *
+ * Included by main.c, when FEAT_FKMAP is defined.
+ */
+
+static int toF_Xor_X_ __ARGS((int c));
+static int F_is_TyE __ARGS((int c));
+static int F_is_TyC_TyD __ARGS((int c));
+static int F_is_TyB_TyC_TyD __ARGS((int src, int offset));
+static int toF_TyB __ARGS((int c));
+static void put_curr_and_l_to_X __ARGS((int c));
+static void put_and_redo __ARGS((int c));
+static void chg_c_toX_orX __ARGS((void));
+static void chg_c_to_X_orX_ __ARGS((void));
+static void chg_c_to_X_or_X __ARGS((void));
+static void chg_l_to_X_orX_ __ARGS((void));
+static void chg_l_toXor_X __ARGS((void));
+static void chg_r_to_Xor_X_ __ARGS((void));
+static int toF_leading __ARGS((int c));
+static int toF_Rjoin __ARGS((int c));
+static int canF_Ljoin __ARGS((int c));
+static int canF_Rjoin __ARGS((int c));
+static int F_isterm __ARGS((int c));
+static int toF_ending __ARGS((int c));
+static void lrswapbuf __ARGS((char_u *buf, int len));
+
+/*
+** Convert the given Farsi character into a _X or _X_ type
+*/
+ static int
+toF_Xor_X_(c)
+ int c;
+{
+ int tempc;
+
+ switch (c)
+ {
+ case BE:
+ return _BE;
+ case PE:
+ return _PE;
+ case TE:
+ return _TE;
+ case SE:
+ return _SE;
+ case JIM:
+ return _JIM;
+ case CHE:
+ return _CHE;
+ case HE_J:
+ return _HE_J;
+ case XE:
+ return _XE;
+ case SIN:
+ return _SIN;
+ case SHIN:
+ return _SHIN;
+ case SAD:
+ return _SAD;
+ case ZAD:
+ return _ZAD;
+ case AYN:
+ return _AYN;
+ case AYN_:
+ return _AYN_;
+ case GHAYN:
+ return _GHAYN;
+ case GHAYN_:
+ return _GHAYN_;
+ case FE:
+ return _FE;
+ case GHAF:
+ return _GHAF;
+ case KAF:
+ return _KAF;
+ case GAF:
+ return _GAF;
+ case LAM:
+ return _LAM;
+ case MIM:
+ return _MIM;
+ case NOON:
+ return _NOON;
+ case YE:
+ case YE_:
+ return _YE;
+ case YEE:
+ case YEE_:
+ return _YEE;
+ case IE:
+ case IE_:
+ return _IE;
+ case F_HE:
+ tempc = _HE;
+
+ if (p_ri && (curwin->w_cursor.col+1 < STRLEN(ml_get_curline())))
+ {
+ inc_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = _HE_;
+
+ dec_cursor();
+ }
+ if (!p_ri && STRLEN(ml_get_curline()))
+ {
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = _HE_;
+
+ inc_cursor();
+ }
+
+ return tempc;
+ }
+ return 0;
+}
+
+/*
+** Convert the given Farsi character into Farsi capital character .
+*/
+ int
+toF_TyA(c)
+ int c ;
+{
+ switch (c)
+ {
+ case ALEF_:
+ return ALEF;
+ case ALEF_U_H_:
+ return ALEF_U_H;
+ case _BE:
+ return BE;
+ case _PE:
+ return PE;
+ case _TE:
+ return TE;
+ case _SE:
+ return SE;
+ case _JIM:
+ return JIM;
+ case _CHE:
+ return CHE;
+ case _HE_J:
+ return HE_J;
+ case _XE:
+ return XE;
+ case _SIN:
+ return SIN;
+ case _SHIN:
+ return SHIN;
+ case _SAD:
+ return SAD;
+ case _ZAD:
+ return ZAD;
+ case _AYN:
+ case AYN_:
+ case _AYN_:
+ return AYN;
+ case _GHAYN:
+ case GHAYN_:
+ case _GHAYN_:
+ return GHAYN;
+ case _FE:
+ return FE;
+ case _GHAF:
+ return GHAF;
+/* I am not sure what it is !!! case _KAF_H: */
+ case _KAF:
+ return KAF;
+ case _GAF:
+ return GAF;
+ case _LAM:
+ return LAM;
+ case _MIM:
+ return MIM;
+ case _NOON:
+ return NOON;
+ case _YE:
+ case YE_:
+ return YE;
+ case _YEE:
+ case YEE_:
+ return YEE;
+ case TEE_:
+ return TEE;
+ case _IE:
+ case IE_:
+ return IE;
+ case _HE:
+ case _HE_:
+ return F_HE;
+ }
+ return c;
+}
+
+/*
+** Is the character under the cursor+offset in the given buffer a join type.
+** That is a character that is combined with the others.
+** Note: the offset is used only for command line buffer.
+*/
+ static int
+F_is_TyB_TyC_TyD(src, offset)
+ int src, offset;
+{
+ int c;
+
+ if (src == SRC_EDT)
+ c = gchar_cursor();
+ else
+ c = cmd_gchar(AT_CURSOR+offset);
+
+ switch (c)
+ {
+ case _LAM:
+ case _BE:
+ case _PE:
+ case _TE:
+ case _SE:
+ case _JIM:
+ case _CHE:
+ case _HE_J:
+ case _XE:
+ case _SIN:
+ case _SHIN:
+ case _SAD:
+ case _ZAD:
+ case _TA:
+ case _ZA:
+ case _AYN:
+ case _AYN_:
+ case _GHAYN:
+ case _GHAYN_:
+ case _FE:
+ case _GHAF:
+ case _KAF:
+ case _KAF_H:
+ case _GAF:
+ case _MIM:
+ case _NOON:
+ case _YE:
+ case _YEE:
+ case _IE:
+ case _HE_:
+ case _HE:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+** Is the Farsi character one of the terminating only type.
+*/
+ static int
+F_is_TyE(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF_A:
+ case ALEF_D_H:
+ case DAL:
+ case ZAL:
+ case RE:
+ case ZE:
+ case JE:
+ case WAW:
+ case WAW_H:
+ case HAMZE:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+** Is the Farsi character one of the none leading type.
+*/
+ static int
+F_is_TyC_TyD(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF_:
+ case ALEF_U_H_:
+ case _AYN_:
+ case AYN_:
+ case _GHAYN_:
+ case GHAYN_:
+ case _HE_:
+ case YE_:
+ case IE_:
+ case TEE_:
+ case YEE_:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+** Convert a none leading Farsi char into a leading type.
+*/
+ static int
+toF_TyB(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF_: return ALEF;
+ case ALEF_U_H_: return ALEF_U_H;
+ case _AYN_: return _AYN;
+ case AYN_: return AYN; /* exception - there are many of them */
+ case _GHAYN_: return _GHAYN;
+ case GHAYN_: return GHAYN; /* exception - there are many of them */
+ case _HE_: return _HE;
+ case YE_: return YE;
+ case IE_: return IE;
+ case TEE_: return TEE;
+ case YEE_: return YEE;
+ }
+ return c;
+}
+
+/*
+** Overwrite the current redo and cursor characters + left adjust
+*/
+ static void
+put_curr_and_l_to_X(c)
+ int c;
+{
+ int tempc;
+
+ if (curwin->w_p_rl && p_ri)
+ return;
+
+ if ( (curwin->w_cursor.col < STRLEN(ml_get_curline())))
+ {
+ if ((p_ri && curwin->w_cursor.col) || !p_ri)
+ {
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ if (F_is_TyC_TyD((tempc = gchar_cursor())))
+ {
+ pchar_cursor(toF_TyB(tempc));
+ AppendCharToRedobuff(K_BS);
+ AppendCharToRedobuff(tempc);
+ }
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+ }
+ }
+
+ put_and_redo(c);
+}
+
+ static void
+put_and_redo(c)
+ int c;
+{
+ pchar_cursor(c);
+ AppendCharToRedobuff(K_BS);
+ AppendCharToRedobuff(c);
+}
+
+/*
+** Change the char. under the cursor to a X_ or X type
+*/
+ static void
+chg_c_toX_orX()
+{
+ int tempc, curc;
+
+ switch ((curc = gchar_cursor()))
+ {
+ case _BE:
+ tempc = BE;
+ break;
+ case _PE:
+ tempc = PE;
+ break;
+ case _TE:
+ tempc = TE;
+ break;
+ case _SE:
+ tempc = SE;
+ break;
+ case _JIM:
+ tempc = JIM;
+ break;
+ case _CHE:
+ tempc = CHE;
+ break;
+ case _HE_J:
+ tempc = HE_J;
+ break;
+ case _XE:
+ tempc = XE;
+ break;
+ case _SIN:
+ tempc = SIN;
+ break;
+ case _SHIN:
+ tempc = SHIN;
+ break;
+ case _SAD:
+ tempc = SAD;
+ break;
+ case _ZAD:
+ tempc = ZAD;
+ break;
+ case _FE:
+ tempc = FE;
+ break;
+ case _GHAF:
+ tempc = GHAF;
+ break;
+ case _KAF_H:
+ case _KAF:
+ tempc = KAF;
+ break;
+ case _GAF:
+ tempc = GAF;
+ break;
+ case _AYN:
+ tempc = AYN;
+ break;
+ case _AYN_:
+ tempc = AYN_;
+ break;
+ case _GHAYN:
+ tempc = GHAYN;
+ break;
+ case _GHAYN_:
+ tempc = GHAYN_;
+ break;
+ case _LAM:
+ tempc = LAM;
+ break;
+ case _MIM:
+ tempc = MIM;
+ break;
+ case _NOON:
+ tempc = NOON;
+ break;
+ case _HE:
+ case _HE_:
+ tempc = F_HE;
+ break;
+ case _YE:
+ case _IE:
+ case _YEE:
+ if (p_ri)
+ {
+ inc_cursor();
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = (curc == _YE ? YE_ :
+ (curc == _IE ? IE_ : YEE_));
+ else
+ tempc = (curc == _YE ? YE :
+ (curc == _IE ? IE : YEE));
+ dec_cursor();
+ }
+ else
+ {
+ if (curwin->w_cursor.col)
+ {
+ dec_cursor();
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = (curc == _YE ? YE_ :
+ (curc == _IE ? IE_ : YEE_));
+ else
+ tempc = (curc == _YE ? YE :
+ (curc == _IE ? IE : YEE));
+ inc_cursor();
+ }
+ else
+ tempc = (curc == _YE ? YE :
+ (curc == _IE ? IE : YEE));
+ }
+ break;
+ default:
+ tempc = 0;
+ }
+
+ if (tempc)
+ put_and_redo(tempc);
+}
+
+/*
+** Change the char. under the cursor to a _X_ or X_ type
+*/
+
+ static void
+chg_c_to_X_orX_()
+{
+ int tempc;
+
+ switch (gchar_cursor())
+ {
+ case ALEF:
+ tempc = ALEF_;
+ break;
+ case ALEF_U_H:
+ tempc = ALEF_U_H_;
+ break;
+ case _AYN:
+ tempc = _AYN_;
+ break;
+ case AYN:
+ tempc = AYN_;
+ break;
+ case _GHAYN:
+ tempc = _GHAYN_;
+ break;
+ case GHAYN:
+ tempc = GHAYN_;
+ break;
+ case _HE:
+ tempc = _HE_;
+ break;
+ case YE:
+ tempc = YE_;
+ break;
+ case IE:
+ tempc = IE_;
+ break;
+ case TEE:
+ tempc = TEE_;
+ break;
+ case YEE:
+ tempc = YEE_;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ if (tempc)
+ put_and_redo(tempc);
+}
+
+/*
+** Change the char. under the cursor to a _X_ or _X type
+*/
+ static void
+chg_c_to_X_or_X ()
+{
+ int tempc;
+
+ tempc = gchar_cursor();
+
+ if (curwin->w_cursor.col+1 < STRLEN(ml_get_curline()))
+ {
+ inc_cursor();
+
+ if ((tempc == F_HE) && (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR)))
+ {
+ tempc = _HE_;
+
+ dec_cursor();
+
+ put_and_redo(tempc);
+ return;
+ }
+
+ dec_cursor();
+ }
+
+ if ((tempc = toF_Xor_X_(tempc)) != 0)
+ put_and_redo(tempc);
+}
+
+/*
+** Change the character left to the cursor to a _X_ or X_ type
+*/
+ static void
+chg_l_to_X_orX_ ()
+{
+ int tempc;
+
+ if (!curwin->w_cursor.col &&
+ (curwin->w_cursor.col+1 == STRLEN(ml_get_curline())))
+ return;
+
+ if (!curwin->w_cursor.col && p_ri)
+ return;
+
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ switch (gchar_cursor())
+ {
+ case ALEF:
+ tempc = ALEF_;
+ break;
+ case ALEF_U_H:
+ tempc = ALEF_U_H_;
+ break;
+ case _AYN:
+ tempc = _AYN_;
+ break;
+ case AYN:
+ tempc = AYN_;
+ break;
+ case _GHAYN:
+ tempc = _GHAYN_;
+ break;
+ case GHAYN:
+ tempc = GHAYN_;
+ break;
+ case _HE:
+ tempc = _HE_;
+ break;
+ case YE:
+ tempc = YE_;
+ break;
+ case IE:
+ tempc = IE_;
+ break;
+ case TEE:
+ tempc = TEE_;
+ break;
+ case YEE:
+ tempc = YEE_;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ if (tempc)
+ put_and_redo(tempc);
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+}
+
+/*
+** Change the charcter left to the cursor to a X or _X type
+*/
+
+ static void
+chg_l_toXor_X ()
+{
+ int tempc;
+
+ if (!curwin->w_cursor.col &&
+ (curwin->w_cursor.col+1 == STRLEN(ml_get_curline())))
+ return;
+
+ if (!curwin->w_cursor.col && p_ri)
+ return;
+
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ switch (gchar_cursor())
+ {
+ case ALEF_:
+ tempc = ALEF;
+ break;
+ case ALEF_U_H_:
+ tempc = ALEF_U_H;
+ break;
+ case _AYN_:
+ tempc = _AYN;
+ break;
+ case AYN_:
+ tempc = AYN;
+ break;
+ case _GHAYN_:
+ tempc = _GHAYN;
+ break;
+ case GHAYN_:
+ tempc = GHAYN;
+ break;
+ case _HE_:
+ tempc = _HE;
+ break;
+ case YE_:
+ tempc = YE;
+ break;
+ case IE_:
+ tempc = IE;
+ break;
+ case TEE_:
+ tempc = TEE;
+ break;
+ case YEE_:
+ tempc = YEE;
+ break;
+ default:
+ tempc = 0;
+ }
+
+ if (tempc)
+ put_and_redo(tempc);
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+}
+
+/*
+** Change the charcter right to the cursor to a _X or _X_ type
+*/
+
+ static void
+chg_r_to_Xor_X_()
+{
+ int tempc, c;
+
+ if (curwin->w_cursor.col)
+ {
+ if (!p_ri)
+ dec_cursor();
+
+ tempc = gchar_cursor();
+
+ if ((c = toF_Xor_X_(tempc)) != 0)
+ put_and_redo(c);
+
+ if (!p_ri)
+ inc_cursor();
+
+ }
+}
+
+/*
+** Map Farsi keyboard when in fkmap mode.
+*/
+
+ int
+fkmap(c)
+ int c;
+{
+ int tempc;
+ static int revins;
+
+ if (IS_SPECIAL(c))
+ return c;
+
+ if (VIM_ISDIGIT(c) || ((c == '.' || c == '+' || c == '-' ||
+ c == '^' || c == '%' || c == '#' || c == '=') && revins))
+ {
+ if (!revins)
+ {
+ if (curwin->w_cursor.col)
+ {
+ if (!p_ri)
+ dec_cursor();
+
+ chg_c_toX_orX ();
+ chg_l_toXor_X ();
+
+ if (!p_ri)
+ inc_cursor();
+ }
+ }
+
+ arrow_used = TRUE;
+ (void)stop_arrow();
+
+ if (!curwin->w_p_rl && revins)
+ inc_cursor();
+
+ ++revins;
+ p_ri=1;
+ }
+ else
+ {
+ if (revins)
+ {
+ arrow_used = TRUE;
+ (void)stop_arrow();
+
+ revins = 0;
+ if (curwin->w_p_rl)
+ {
+ while ((F_isdigit(gchar_cursor())
+ || (gchar_cursor() == F_PERIOD
+ || gchar_cursor() == F_PLUS
+ || gchar_cursor() == F_MINUS
+ || gchar_cursor() == F_MUL
+ || gchar_cursor() == F_DIVIDE
+ || gchar_cursor() == F_PERCENT
+ || gchar_cursor() == F_EQUALS))
+ && gchar_cursor() != NUL)
+ ++curwin->w_cursor.col;
+ }
+ else
+ {
+ if (curwin->w_cursor.col)
+ while ((F_isdigit(gchar_cursor())
+ || (gchar_cursor() == F_PERIOD
+ || gchar_cursor() == F_PLUS
+ || gchar_cursor() == F_MINUS
+ || gchar_cursor() == F_MUL
+ || gchar_cursor() == F_DIVIDE
+ || gchar_cursor() == F_PERCENT
+ || gchar_cursor() == F_EQUALS))
+ && --curwin->w_cursor.col)
+ ;
+
+ if (!F_isdigit(gchar_cursor()))
+ ++curwin->w_cursor.col;
+ }
+ }
+ }
+
+ if (!revins)
+ {
+ if (curwin->w_p_rl)
+ p_ri=0;
+ if (!curwin->w_p_rl)
+ p_ri=1;
+ }
+
+ if ((c < 0x100) && (isalpha(c) || c == '&' || c == '^' || c == ';' ||
+ c == '\''|| c == ',' || c == '[' ||
+ c == ']' || c == '{' || c == '}' ))
+ chg_r_to_Xor_X_();
+
+ tempc = 0;
+
+ switch (c)
+ {
+ case '`':
+ case ' ':
+ case '.':
+ case '!':
+ case '"':
+ case '$':
+ case '%':
+ case '^':
+ case '&':
+ case '/':
+ case '(':
+ case ')':
+ case '=':
+ case '\\':
+ case '?':
+ case '+':
+ case '-':
+ case '_':
+ case '*':
+ case ':':
+ case '#':
+ case '~':
+ case '@':
+ case '<':
+ case '>':
+ case '{':
+ case '}':
+ case '|':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'B':
+ case 'E':
+ case 'F':
+ case 'H':
+ case 'I':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'T':
+ case 'U':
+ case 'W':
+ case 'Y':
+ case NL:
+ case TAB:
+
+ if (p_ri && c == NL && curwin->w_cursor.col)
+ {
+ /*
+ ** If the char before the cursor is _X_ or X_ do not change
+ ** the one under the cursor with X type.
+ */
+
+ dec_cursor();
+
+ if (F_isalpha(gchar_cursor()))
+ {
+ inc_cursor();
+ return NL;
+ }
+
+ inc_cursor();
+ }
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ {
+ switch (c)
+ {
+ case '0': return FARSI_0;
+ case '1': return FARSI_1;
+ case '2': return FARSI_2;
+ case '3': return FARSI_3;
+ case '4': return FARSI_4;
+ case '5': return FARSI_5;
+ case '6': return FARSI_6;
+ case '7': return FARSI_7;
+ case '8': return FARSI_8;
+ case '9': return FARSI_9;
+ case 'B': return F_PSP;
+ case 'E': return JAZR_N;
+ case 'F': return ALEF_D_H;
+ case 'H': return ALEF_A;
+ case 'I': return TASH;
+ case 'K': return F_LQUOT;
+ case 'L': return F_RQUOT;
+ case 'M': return HAMZE;
+ case 'O': return '[';
+ case 'P': return ']';
+ case 'Q': return OO;
+ case 'R': return MAD_N;
+ case 'T': return OW;
+ case 'U': return MAD;
+ case 'W': return OW_OW;
+ case 'Y': return JAZR;
+ case '`': return F_PCN;
+ case '!': return F_EXCL;
+ case '@': return F_COMMA;
+ case '#': return F_DIVIDE;
+ case '$': return F_CURRENCY;
+ case '%': return F_PERCENT;
+ case '^': return F_MUL;
+ case '&': return F_BCOMMA;
+ case '*': return F_STAR;
+ case '(': return F_LPARENT;
+ case ')': return F_RPARENT;
+ case '-': return F_MINUS;
+ case '_': return F_UNDERLINE;
+ case '=': return F_EQUALS;
+ case '+': return F_PLUS;
+ case '\\': return F_BSLASH;
+ case '|': return F_PIPE;
+ case ':': return F_DCOLON;
+ case '"': return F_SEMICOLON;
+ case '.': return F_PERIOD;
+ case '/': return F_SLASH;
+ case '<': return F_LESS;
+ case '>': return F_GREATER;
+ case '?': return F_QUESTION;
+ case ' ': return F_BLANK;
+ }
+ break;
+ }
+ if (!p_ri)
+ dec_cursor();
+
+ switch ((tempc = gchar_cursor()))
+ {
+ case _BE:
+ case _PE:
+ case _TE:
+ case _SE:
+ case _JIM:
+ case _CHE:
+ case _HE_J:
+ case _XE:
+ case _SIN:
+ case _SHIN:
+ case _SAD:
+ case _ZAD:
+ case _FE:
+ case _GHAF:
+ case _KAF:
+ case _KAF_H:
+ case _GAF:
+ case _LAM:
+ case _MIM:
+ case _NOON:
+ case _HE:
+ case _HE_:
+ case _TA:
+ case _ZA:
+ put_curr_and_l_to_X(toF_TyA(tempc));
+ break;
+ case _AYN:
+ case _AYN_:
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ {
+ put_curr_and_l_to_X(AYN);
+ break;
+ }
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = AYN_;
+ else
+ tempc = AYN;
+
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ put_curr_and_l_to_X(tempc);
+
+ break;
+ case _GHAYN:
+ case _GHAYN_:
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ {
+ put_curr_and_l_to_X(GHAYN);
+ break;
+ }
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = GHAYN_;
+ else
+ tempc = GHAYN;
+
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ put_curr_and_l_to_X(tempc);
+ break;
+ case _YE:
+ case _IE:
+ case _YEE:
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ {
+ put_curr_and_l_to_X((tempc == _YE ? YE :
+ (tempc == _IE ? IE : YEE)));
+ break;
+ }
+
+ if (p_ri)
+ inc_cursor();
+ else
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = (tempc == _YE ? YE_ :
+ (tempc == _IE ? IE_ : YEE_));
+ else
+ tempc = (tempc == _YE ? YE :
+ (tempc == _IE ? IE : YEE));
+
+ if (p_ri)
+ dec_cursor();
+ else
+ inc_cursor();
+
+ put_curr_and_l_to_X(tempc);
+ break;
+ }
+
+ if (!p_ri)
+ inc_cursor();
+
+ tempc = 0;
+
+ switch (c)
+ {
+ case '0': return FARSI_0;
+ case '1': return FARSI_1;
+ case '2': return FARSI_2;
+ case '3': return FARSI_3;
+ case '4': return FARSI_4;
+ case '5': return FARSI_5;
+ case '6': return FARSI_6;
+ case '7': return FARSI_7;
+ case '8': return FARSI_8;
+ case '9': return FARSI_9;
+ case 'B': return F_PSP;
+ case 'E': return JAZR_N;
+ case 'F': return ALEF_D_H;
+ case 'H': return ALEF_A;
+ case 'I': return TASH;
+ case 'K': return F_LQUOT;
+ case 'L': return F_RQUOT;
+ case 'M': return HAMZE;
+ case 'O': return '[';
+ case 'P': return ']';
+ case 'Q': return OO;
+ case 'R': return MAD_N;
+ case 'T': return OW;
+ case 'U': return MAD;
+ case 'W': return OW_OW;
+ case 'Y': return JAZR;
+ case '`': return F_PCN;
+ case '!': return F_EXCL;
+ case '@': return F_COMMA;
+ case '#': return F_DIVIDE;
+ case '$': return F_CURRENCY;
+ case '%': return F_PERCENT;
+ case '^': return F_MUL;
+ case '&': return F_BCOMMA;
+ case '*': return F_STAR;
+ case '(': return F_LPARENT;
+ case ')': return F_RPARENT;
+ case '-': return F_MINUS;
+ case '_': return F_UNDERLINE;
+ case '=': return F_EQUALS;
+ case '+': return F_PLUS;
+ case '\\': return F_BSLASH;
+ case '|': return F_PIPE;
+ case ':': return F_DCOLON;
+ case '"': return F_SEMICOLON;
+ case '.': return F_PERIOD;
+ case '/': return F_SLASH;
+ case '<': return F_LESS;
+ case '>': return F_GREATER;
+ case '?': return F_QUESTION;
+ case ' ': return F_BLANK;
+ }
+ break;
+
+ case 'a':
+ tempc = _SHIN;
+ break;
+ case 'A':
+ tempc = WAW_H;
+ break;
+ case 'b':
+ tempc = ZAL;
+ break;
+ case 'c':
+ tempc = ZE;
+ break;
+ case 'C':
+ tempc = JE;
+ break;
+ case 'd':
+ tempc = _YE;
+ break;
+ case 'D':
+ tempc = _YEE;
+ break;
+ case 'e':
+ tempc = _SE;
+ break;
+ case 'f':
+ tempc = _BE;
+ break;
+ case 'g':
+ tempc = _LAM;
+ break;
+ case 'G':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+
+ if (gchar_cursor() == _LAM)
+ chg_c_toX_orX ();
+ else
+ if (p_ri)
+ chg_c_to_X_or_X ();
+ }
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ return ALEF_U_H;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (gchar_cursor() == _LAM)
+ {
+ chg_c_toX_orX ();
+ chg_l_toXor_X ();
+ tempc = ALEF_U_H;
+ }
+ else
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ {
+ tempc = ALEF_U_H_;
+ chg_l_toXor_X ();
+ }
+ else
+ tempc = ALEF_U_H;
+
+ if (!p_ri)
+ inc_cursor();
+
+ return tempc;
+ case 'h':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (p_ri)
+ chg_c_to_X_or_X ();
+
+ }
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ return ALEF;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (gchar_cursor() == _LAM)
+ {
+ chg_l_toXor_X();
+ del_char(FALSE);
+ AppendCharToRedobuff(K_BS);
+
+ if (!p_ri)
+ dec_cursor();
+
+ tempc = LA;
+ }
+ else
+ {
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ {
+ tempc = ALEF_;
+ chg_l_toXor_X ();
+ }
+ else
+ tempc = ALEF;
+ }
+
+ if (!p_ri)
+ inc_cursor();
+
+ return tempc;
+ case 'i':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (!p_ri && !F_is_TyE(tempc))
+ chg_c_to_X_orX_ ();
+ if (p_ri)
+ chg_c_to_X_or_X ();
+
+ }
+
+ if (!p_ri && !curwin->w_cursor.col)
+ return _HE;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = _HE_;
+ else
+ tempc = _HE;
+
+ if (!p_ri)
+ inc_cursor();
+ break;
+ case 'j':
+ tempc = _TE;
+ break;
+ case 'J':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (p_ri)
+ chg_c_to_X_or_X ();
+
+ }
+
+ if (!p_ri)
+ if (!curwin->w_cursor.col)
+ return TEE;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ {
+ tempc = TEE_;
+ chg_l_toXor_X ();
+ }
+ else
+ tempc = TEE;
+
+ if (!p_ri)
+ inc_cursor();
+
+ return tempc;
+ case 'k':
+ tempc = _NOON;
+ break;
+ case 'l':
+ tempc = _MIM;
+ break;
+ case 'm':
+ tempc = _PE;
+ break;
+ case 'n':
+ case 'N':
+ tempc = DAL;
+ break;
+ case 'o':
+ tempc = _XE;
+ break;
+ case 'p':
+ tempc = _HE_J;
+ break;
+ case 'q':
+ tempc = _ZAD;
+ break;
+ case 'r':
+ tempc = _GHAF;
+ break;
+ case 's':
+ tempc = _SIN;
+ break;
+ case 'S':
+ tempc = _IE;
+ break;
+ case 't':
+ tempc = _FE;
+ break;
+ case 'u':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (!p_ri && !F_is_TyE(tempc))
+ chg_c_to_X_orX_ ();
+ if (p_ri)
+ chg_c_to_X_or_X ();
+
+ }
+
+ if (!p_ri && !curwin->w_cursor.col)
+ return _AYN;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = _AYN_;
+ else
+ tempc = _AYN;
+
+ if (!p_ri)
+ inc_cursor();
+ break;
+ case 'v':
+ case 'V':
+ tempc = RE;
+ break;
+ case 'w':
+ tempc = _SAD;
+ break;
+ case 'x':
+ case 'X':
+ tempc = _TA;
+ break;
+ case 'y':
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (!p_ri && !F_is_TyE(tempc))
+ chg_c_to_X_orX_ ();
+ if (p_ri)
+ chg_c_to_X_or_X ();
+
+ }
+
+ if (!p_ri && !curwin->w_cursor.col)
+ return _GHAYN;
+
+ if (!p_ri)
+ dec_cursor();
+
+ if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
+ tempc = _GHAYN_;
+ else
+ tempc = _GHAYN;
+
+ if (!p_ri)
+ inc_cursor();
+
+ break;
+ case 'z':
+ tempc = _ZA;
+ break;
+ case 'Z':
+ tempc = _KAF_H;
+ break;
+ case ';':
+ tempc = _KAF;
+ break;
+ case '\'':
+ tempc = _GAF;
+ break;
+ case ',':
+ tempc = WAW;
+ break;
+ case '[':
+ tempc = _JIM;
+ break;
+ case ']':
+ tempc = _CHE;
+ break;
+ }
+
+ if ((F_isalpha(tempc) || F_isdigit(tempc)))
+ {
+ if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
+ {
+ if (!p_ri && !F_is_TyE(tempc))
+ chg_c_to_X_orX_ ();
+ if (p_ri)
+ chg_c_to_X_or_X ();
+ }
+
+ if (curwin->w_cursor.col)
+ {
+ if (!p_ri)
+ dec_cursor();
+
+ if (F_is_TyE(tempc))
+ chg_l_toXor_X ();
+ else
+ chg_l_to_X_orX_ ();
+
+ if (!p_ri)
+ inc_cursor();
+ }
+ }
+ if (tempc)
+ return tempc;
+ return c;
+}
+
+/*
+** Convert a none leading Farsi char into a leading type.
+*/
+ static int
+toF_leading(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF_: return ALEF;
+ case ALEF_U_H_: return ALEF_U_H;
+ case BE: return _BE;
+ case PE: return _PE;
+ case TE: return _TE;
+ case SE: return _SE;
+ case JIM: return _JIM;
+ case CHE: return _CHE;
+ case HE_J: return _HE_J;
+ case XE: return _XE;
+ case SIN: return _SIN;
+ case SHIN: return _SHIN;
+ case SAD: return _SAD;
+ case ZAD: return _ZAD;
+
+ case AYN:
+ case AYN_:
+ case _AYN_: return _AYN;
+
+ case GHAYN:
+ case GHAYN_:
+ case _GHAYN_: return _GHAYN;
+
+ case FE: return _FE;
+ case GHAF: return _GHAF;
+ case KAF: return _KAF;
+ case GAF: return _GAF;
+ case LAM: return _LAM;
+ case MIM: return _MIM;
+ case NOON: return _NOON;
+
+ case _HE_:
+ case F_HE: return _HE;
+
+ case YE:
+ case YE_: return _YE;
+
+ case IE_:
+ case IE: return _IE;
+
+ case YEE:
+ case YEE_: return _YEE;
+ }
+ return c;
+}
+
+/*
+** Convert a given Farsi char into right joining type.
+*/
+ static int
+toF_Rjoin(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF: return ALEF_;
+ case ALEF_U_H: return ALEF_U_H_;
+ case BE: return _BE;
+ case PE: return _PE;
+ case TE: return _TE;
+ case SE: return _SE;
+ case JIM: return _JIM;
+ case CHE: return _CHE;
+ case HE_J: return _HE_J;
+ case XE: return _XE;
+ case SIN: return _SIN;
+ case SHIN: return _SHIN;
+ case SAD: return _SAD;
+ case ZAD: return _ZAD;
+
+ case AYN:
+ case AYN_:
+ case _AYN: return _AYN_;
+
+ case GHAYN:
+ case GHAYN_:
+ case _GHAYN_: return _GHAYN_;
+
+ case FE: return _FE;
+ case GHAF: return _GHAF;
+ case KAF: return _KAF;
+ case GAF: return _GAF;
+ case LAM: return _LAM;
+ case MIM: return _MIM;
+ case NOON: return _NOON;
+
+ case _HE:
+ case F_HE: return _HE_;
+
+ case YE:
+ case YE_: return _YE;
+
+ case IE_:
+ case IE: return _IE;
+
+ case TEE: return TEE_;
+
+ case YEE:
+ case YEE_: return _YEE;
+ }
+ return c;
+}
+
+/*
+** Can a given Farsi character join via its left edj.
+*/
+ static int
+canF_Ljoin(c)
+ int c;
+{
+ switch (c)
+ {
+ case _BE:
+ case BE:
+ case PE:
+ case _PE:
+ case TE:
+ case _TE:
+ case SE:
+ case _SE:
+ case JIM:
+ case _JIM:
+ case CHE:
+ case _CHE:
+ case HE_J:
+ case _HE_J:
+ case XE:
+ case _XE:
+ case SIN:
+ case _SIN:
+ case SHIN:
+ case _SHIN:
+ case SAD:
+ case _SAD:
+ case ZAD:
+ case _ZAD:
+ case _TA:
+ case _ZA:
+ case AYN:
+ case _AYN:
+ case _AYN_:
+ case AYN_:
+ case GHAYN:
+ case GHAYN_:
+ case _GHAYN_:
+ case _GHAYN:
+ case FE:
+ case _FE:
+ case GHAF:
+ case _GHAF:
+ case _KAF_H:
+ case KAF:
+ case _KAF:
+ case GAF:
+ case _GAF:
+ case LAM:
+ case _LAM:
+ case MIM:
+ case _MIM:
+ case NOON:
+ case _NOON:
+ case IE:
+ case _IE:
+ case IE_:
+ case YE:
+ case _YE:
+ case YE_:
+ case YEE:
+ case _YEE:
+ case YEE_:
+ case F_HE:
+ case _HE:
+ case _HE_:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+** Can a given Farsi character join via its right edj.
+*/
+ static int
+canF_Rjoin(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF:
+ case ALEF_:
+ case ALEF_U_H:
+ case ALEF_U_H_:
+ case DAL:
+ case ZAL:
+ case RE:
+ case JE:
+ case ZE:
+ case TEE:
+ case TEE_:
+ case WAW:
+ case WAW_H:
+ return TRUE;
+ }
+
+ return canF_Ljoin(c);
+
+}
+
+/*
+** is a given Farsi character a terminating type.
+*/
+ static int
+F_isterm(c)
+ int c;
+{
+ switch (c)
+ {
+ case ALEF:
+ case ALEF_:
+ case ALEF_U_H:
+ case ALEF_U_H_:
+ case DAL:
+ case ZAL:
+ case RE:
+ case JE:
+ case ZE:
+ case WAW:
+ case WAW_H:
+ case TEE:
+ case TEE_:
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+** Convert the given Farsi character into a ending type .
+*/
+ static int
+toF_ending(c)
+ int c;
+{
+
+ switch (c)
+ {
+ case _BE:
+ return BE;
+ case _PE:
+ return PE;
+ case _TE:
+ return TE;
+ case _SE:
+ return SE;
+ case _JIM:
+ return JIM;
+ case _CHE:
+ return CHE;
+ case _HE_J:
+ return HE_J;
+ case _XE:
+ return XE;
+ case _SIN:
+ return SIN;
+ case _SHIN:
+ return SHIN;
+ case _SAD:
+ return SAD;
+ case _ZAD:
+ return ZAD;
+ case _AYN:
+ return AYN;
+ case _AYN_:
+ return AYN_;
+ case _GHAYN:
+ return GHAYN;
+ case _GHAYN_:
+ return GHAYN_;
+ case _FE:
+ return FE;
+ case _GHAF:
+ return GHAF;
+ case _KAF_H:
+ case _KAF:
+ return KAF;
+ case _GAF:
+ return GAF;
+ case _LAM:
+ return LAM;
+ case _MIM:
+ return MIM;
+ case _NOON:
+ return NOON;
+ case _YE:
+ return YE_;
+ case YE_:
+ return YE;
+ case _YEE:
+ return YEE_;
+ case YEE_:
+ return YEE;
+ case TEE:
+ return TEE_;
+ case _IE:
+ return IE_;
+ case IE_:
+ return IE;
+ case _HE:
+ case _HE_:
+ return F_HE;
+ }
+ return c;
+}
+
+/*
+** Convert the Farsi 3342 standard into Farsi VIM.
+*/
+ void
+conv_to_pvim()
+{
+ char_u *ptr;
+ int lnum, llen, i;
+
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ ptr = ml_get((linenr_T)lnum);
+
+ llen = (int)STRLEN(ptr);
+
+ for ( i = 0; i < llen-1; i++)
+ {
+ if (canF_Ljoin(ptr[i]) && canF_Rjoin(ptr[i+1]))
+ {
+ ptr[i] = toF_leading(ptr[i]);
+ ++i;
+
+ while(canF_Rjoin(ptr[i]) && (i < llen))
+ {
+ ptr[i] = toF_Rjoin(ptr[i]);
+ if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
+ break;
+ ++i;
+ }
+ if (!F_isalpha(ptr[i]) || !canF_Rjoin(ptr[i]))
+ ptr[i-1] = toF_ending(ptr[i-1]);
+ }
+ else
+ ptr[i] = toF_TyA(ptr[i]);
+ }
+ }
+
+ /*
+ * Following lines contains Farsi encoded character.
+ */
+
+ do_cmdline_cmd((char_u *)"%s/\202\231/\232/g");
+ do_cmdline_cmd((char_u *)"%s/\201\231/\370\334/g");
+
+ /* Assume the screen has been messed up: clear it and redraw. */
+ redraw_later(CLEAR);
+ MSG_ATTR(farsi_text_1, hl_attr(HLF_S));
+}
+
+/*
+ * Convert the Farsi VIM into Farsi 3342 standad.
+ */
+ void
+conv_to_pstd()
+{
+ char_u *ptr;
+ int lnum, llen, i;
+
+ /*
+ * Following line contains Farsi encoded character.
+ */
+
+ do_cmdline_cmd((char_u *)"%s/\232/\202\231/g");
+
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ ptr = ml_get((linenr_T)lnum);
+
+ llen = (int)STRLEN(ptr);
+
+ for ( i = 0; i < llen; i++)
+ {
+ ptr[i] = toF_TyA(ptr[i]);
+
+ }
+ }
+
+ /* Assume the screen has been messed up: clear it and redraw. */
+ redraw_later(CLEAR);
+ MSG_ATTR(farsi_text_2, hl_attr(HLF_S));
+}
+
+/*
+ * left-right swap the characters in buf[len].
+ */
+ static void
+lrswapbuf(buf, len)
+ char_u *buf;
+ int len;
+{
+ char_u *s, *e;
+ int c;
+
+ s = buf;
+ e = buf + len - 1;
+
+ while (e > s)
+ {
+ c = *s;
+ *s = *e;
+ *e = c;
+ ++s;
+ --e;
+ }
+}
+
+/*
+ * swap all the characters in reverse direction
+ */
+ char_u *
+lrswap(ibuf)
+ char_u *ibuf;
+{
+ if (ibuf != NULL && *ibuf != NUL)
+ lrswapbuf(ibuf, (int)STRLEN(ibuf));
+ return ibuf;
+}
+
+/*
+ * swap all the Farsi characters in reverse direction
+ */
+ char_u *
+lrFswap(cmdbuf, len)
+ char_u *cmdbuf;
+ int len;
+{
+ int i, cnt;
+
+ if (cmdbuf == NULL)
+ return cmdbuf;
+
+ if (len == 0 && (len = (int)STRLEN(cmdbuf)) == 0)
+ return cmdbuf;
+
+ for (i = 0; i < len; i++)
+ {
+ for (cnt = 0; i + cnt < len
+ && (F_isalpha(cmdbuf[i + cnt])
+ || F_isdigit(cmdbuf[i + cnt])
+ || cmdbuf[i + cnt] == ' '); ++cnt)
+ ;
+
+ lrswapbuf(cmdbuf + i, cnt);
+ i += cnt;
+ }
+ return cmdbuf;
+}
+
+/*
+ * Reverse the characters in the seach path and substitude section accordingly
+ */
+ char_u *
+lrF_sub(ibuf)
+ char_u *ibuf;
+{
+ char_u *p, *ep;
+ int i, cnt;
+
+ p = ibuf;
+
+ /* Find the boundry of the search path */
+ while (((p = vim_strchr(++p, '/')) != NULL) && p[-1] == '\\')
+ ;
+
+ if (p == NULL)
+ return ibuf;
+
+ /* Reverse the Farsi characters in the search path. */
+ lrFswap(ibuf, (int)(p-ibuf));
+
+ /* Now find the boundry of the substitute section */
+ if ((ep = (char_u *)strrchr((char *)++p, '/')) != NULL)
+ cnt = (int)(ep - p);
+ else
+ cnt = (int)STRLEN(p);
+
+ /* Reverse the characters in the substitute section and take care of '\' */
+ for (i = 0; i < cnt-1; i++)
+ if (p[i] == '\\')
+ {
+ p[i] = p[i+1] ;
+ p[++i] = '\\';
+ }
+
+ lrswapbuf(p, cnt);
+
+ return ibuf;
+}
+
+/*
+ * Map Farsi keyboard when in cmd_fkmap mode.
+ */
+ int
+cmdl_fkmap(c)
+ int c;
+{
+ int tempc;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '`':
+ case ' ':
+ case '.':
+ case '!':
+ case '"':
+ case '$':
+ case '%':
+ case '^':
+ case '&':
+ case '/':
+ case '(':
+ case ')':
+ case '=':
+ case '\\':
+ case '?':
+ case '+':
+ case '-':
+ case '_':
+ case '*':
+ case ':':
+ case '#':
+ case '~':
+ case '@':
+ case '<':
+ case '>':
+ case '{':
+ case '}':
+ case '|':
+ case 'B':
+ case 'E':
+ case 'F':
+ case 'H':
+ case 'I':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'T':
+ case 'U':
+ case 'W':
+ case 'Y':
+ case NL:
+ case TAB:
+
+ switch ((tempc = cmd_gchar(AT_CURSOR)))
+ {
+ case _BE:
+ case _PE:
+ case _TE:
+ case _SE:
+ case _JIM:
+ case _CHE:
+ case _HE_J:
+ case _XE:
+ case _SIN:
+ case _SHIN:
+ case _SAD:
+ case _ZAD:
+ case _AYN:
+ case _GHAYN:
+ case _FE:
+ case _GHAF:
+ case _KAF:
+ case _GAF:
+ case _LAM:
+ case _MIM:
+ case _NOON:
+ case _HE:
+ case _HE_:
+ cmd_pchar(toF_TyA(tempc), AT_CURSOR);
+ break;
+ case _AYN_:
+ cmd_pchar(AYN_, AT_CURSOR);
+ break;
+ case _GHAYN_:
+ cmd_pchar(GHAYN_, AT_CURSOR);
+ break;
+ case _IE:
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
+ cmd_pchar(IE_, AT_CURSOR);
+ else
+ cmd_pchar(IE, AT_CURSOR);
+ break;
+ case _YEE:
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
+ cmd_pchar(YEE_, AT_CURSOR);
+ else
+ cmd_pchar(YEE, AT_CURSOR);
+ break;
+ case _YE:
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
+ cmd_pchar(YE_, AT_CURSOR);
+ else
+ cmd_pchar(YE, AT_CURSOR);
+ }
+
+ switch (c)
+ {
+ case '0': return FARSI_0;
+ case '1': return FARSI_1;
+ case '2': return FARSI_2;
+ case '3': return FARSI_3;
+ case '4': return FARSI_4;
+ case '5': return FARSI_5;
+ case '6': return FARSI_6;
+ case '7': return FARSI_7;
+ case '8': return FARSI_8;
+ case '9': return FARSI_9;
+ case 'B': return F_PSP;
+ case 'E': return JAZR_N;
+ case 'F': return ALEF_D_H;
+ case 'H': return ALEF_A;
+ case 'I': return TASH;
+ case 'K': return F_LQUOT;
+ case 'L': return F_RQUOT;
+ case 'M': return HAMZE;
+ case 'O': return '[';
+ case 'P': return ']';
+ case 'Q': return OO;
+ case 'R': return MAD_N;
+ case 'T': return OW;
+ case 'U': return MAD;
+ case 'W': return OW_OW;
+ case 'Y': return JAZR;
+ case '`': return F_PCN;
+ case '!': return F_EXCL;
+ case '@': return F_COMMA;
+ case '#': return F_DIVIDE;
+ case '$': return F_CURRENCY;
+ case '%': return F_PERCENT;
+ case '^': return F_MUL;
+ case '&': return F_BCOMMA;
+ case '*': return F_STAR;
+ case '(': return F_LPARENT;
+ case ')': return F_RPARENT;
+ case '-': return F_MINUS;
+ case '_': return F_UNDERLINE;
+ case '=': return F_EQUALS;
+ case '+': return F_PLUS;
+ case '\\': return F_BSLASH;
+ case '|': return F_PIPE;
+ case ':': return F_DCOLON;
+ case '"': return F_SEMICOLON;
+ case '.': return F_PERIOD;
+ case '/': return F_SLASH;
+ case '<': return F_LESS;
+ case '>': return F_GREATER;
+ case '?': return F_QUESTION;
+ case ' ': return F_BLANK;
+ }
+
+ break;
+
+ case 'a': return _SHIN;
+ case 'A': return WAW_H;
+ case 'b': return ZAL;
+ case 'c': return ZE;
+ case 'C': return JE;
+ case 'd': return _YE;
+ case 'D': return _YEE;
+ case 'e': return _SE;
+ case 'f': return _BE;
+ case 'g': return _LAM;
+ case 'G':
+ if (cmd_gchar(AT_CURSOR) == _LAM )
+ {
+ cmd_pchar(LAM, AT_CURSOR);
+ return ALEF_U_H;
+ }
+
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return ALEF_U_H_;
+ else
+ return ALEF_U_H;
+ case 'h':
+ if (cmd_gchar(AT_CURSOR) == _LAM )
+ {
+ cmd_pchar(LA, AT_CURSOR);
+ redrawcmdline();
+ return K_IGNORE;
+ }
+
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return ALEF_;
+ else
+ return ALEF;
+ case 'i':
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return _HE_;
+ else
+ return _HE;
+ case 'j': return _TE;
+ case 'J':
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return TEE_;
+ else
+ return TEE;
+ case 'k': return _NOON;
+ case 'l': return _MIM;
+ case 'm': return _PE;
+ case 'n':
+ case 'N': return DAL;
+ case 'o': return _XE;
+ case 'p': return _HE_J;
+ case 'q': return _ZAD;
+ case 'r': return _GHAF;
+ case 's': return _SIN;
+ case 'S': return _IE;
+ case 't': return _FE;
+ case 'u':
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return _AYN_;
+ else
+ return _AYN;
+ case 'v':
+ case 'V': return RE;
+ case 'w': return _SAD;
+ case 'x':
+ case 'X': return _TA;
+ case 'y':
+ if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
+ return _GHAYN_;
+ else
+ return _GHAYN;
+ case 'z':
+ case 'Z': return _ZA;
+ case ';': return _KAF;
+ case '\'': return _GAF;
+ case ',': return WAW;
+ case '[': return _JIM;
+ case ']': return _CHE;
+ }
+
+ return c;
+}
+
+/*
+ * F_isalpha returns TRUE if 'c' is a Farsi alphabet
+ */
+ int
+F_isalpha(c)
+ int c;
+{
+ return (( c >= TEE_ && c <= _YE)
+ || (c >= ALEF_A && c <= YE)
+ || (c >= _IE && c <= YE_));
+}
+
+/*
+ * F_isdigit returns TRUE if 'c' is a Farsi digit
+ */
+ int
+F_isdigit(c)
+ int c;
+{
+ return (c >= FARSI_0 && c <= FARSI_9);
+}
+
+/*
+ * F_ischar returns TRUE if 'c' is a Farsi character.
+ */
+ int
+F_ischar(c)
+ int c;
+{
+ return (c >= TEE_ && c <= YE_);
+}
+
+ void
+farsi_fkey(cap)
+ cmdarg_T *cap;
+{
+ int c = cap->cmdchar;
+
+ if (c == K_F8)
+ {
+ if (p_altkeymap)
+ {
+ if (curwin->w_farsi & W_R_L)
+ {
+ p_fkmap = 0;
+ do_cmdline_cmd((char_u *)"set norl");
+ MSG("");
+ }
+ else
+ {
+ p_fkmap = 1;
+ do_cmdline_cmd((char_u *)"set rl");
+ MSG("");
+ }
+
+ curwin->w_farsi = curwin->w_farsi ^ W_R_L;
+ }
+ }
+
+ if (c == K_F9)
+ {
+ if (p_altkeymap && curwin->w_p_rl)
+ {
+ curwin->w_farsi = curwin->w_farsi ^ W_CONV;
+ if (curwin->w_farsi & W_CONV)
+ conv_to_pvim();
+ else
+ conv_to_pstd();
+ }
+ }
+}
diff --git a/src/farsi.h b/src/farsi.h
new file mode 100644
index 000000000..8dea422cd
--- /dev/null
+++ b/src/farsi.h
@@ -0,0 +1,234 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Farsi characters are catagorized into following types:
+ *
+ * TyA (for capital letter representation)
+ * TyB (for types that look like _X e.g. AYN)
+ * TyC (for types that look like X_ e.g. YE_)
+ * TyD (for types that look like _X_ e.g. _AYN_)
+ * TyE (for types that look like X e.g. RE)
+ */
+
+/*
+ * Farsi character set definition
+ */
+
+/*
+ * Begin of the non-standard part
+ */
+
+#define TEE_ 0x80
+#define ALEF_U_H_ 0x81
+#define ALEF_ 0x82
+#define _BE 0x83
+#define _PE 0x84
+#define _TE 0x85
+#define _SE 0x86
+#define _JIM 0x87
+#define _CHE 0x88
+#define _HE_J 0x89
+#define _XE 0x8a
+#define _SIN 0x8b
+#define _SHIN 0x8c
+#define _SAD 0x8d
+#define _ZAD 0x8e
+#define _AYN 0x8f
+#define _AYN_ 0x90
+#define AYN_ 0x91
+#define _GHAYN 0x92
+#define _GHAYN_ 0x93
+#define GHAYN_ 0x94
+#define _FE 0x95
+#define _GHAF 0x96
+#define _KAF 0x97
+#define _GAF 0x98
+#define _LAM 0x99
+#define LA 0x9a
+#define _MIM 0x9b
+#define _NOON 0x9c
+#define _HE 0x9d
+#define _HE_ 0x9e
+#define _YE 0x9f
+#define _IE 0xec
+#define IE_ 0xed
+#define IE 0xfb
+#define _YEE 0xee
+#define YEE_ 0xef
+#define YE_ 0xff
+
+/*
+ * End of the non-standard part
+ */
+
+/*
+ * Standard part
+ */
+
+#define F_BLANK 0xa0 /* Farsi ' ' (SP) character */
+#define F_PSP 0xa1 /* PSP for capitalizing of a character */
+#define F_PCN 0xa2 /* PCN for redefining of the hamye meaning */
+#define F_EXCL 0xa3 /* Farsi ! character */
+#define F_CURRENCY 0xa4 /* Farsi Rial character */
+#define F_PERCENT 0xa5 /* Farsi % character */
+#define F_PERIOD 0xa6 /* Farsi '.' character */
+#define F_COMMA 0xa7 /* Farsi ',' character */
+#define F_LPARENT 0xa8 /* Farsi '(' character */
+#define F_RPARENT 0xa9 /* Farsi ')' character */
+#define F_MUL 0xaa /* Farsi 'x' character */
+#define F_PLUS 0xab /* Farsi '+' character */
+#define F_BCOMMA 0xac /* Farsi comma character */
+#define F_MINUS 0xad /* Farsi '-' character */
+#define F_DIVIDE 0xae /* Farsi divide (/) character */
+#define F_SLASH 0xaf /* Farsi '/' character */
+
+#define FARSI_0 0xb0
+#define FARSI_1 0xb1
+#define FARSI_2 0xb2
+#define FARSI_3 0xb3
+#define FARSI_4 0xb4
+#define FARSI_5 0xb5
+#define FARSI_6 0xb6
+#define FARSI_7 0xb7
+#define FARSI_8 0xb8
+#define FARSI_9 0xb9
+
+#define F_DCOLON 0xba /* Farsi ':' character */
+#define F_SEMICOLON 0xbb /* Farsi ';' character */
+#define F_GREATER 0xbc /* Farsi '>' character */
+#define F_EQUALS 0xbd /* Farsi '=' character */
+#define F_LESS 0xbe /* Farsi '<' character */
+#define F_QUESTION 0xbf /* Farsi ? character */
+
+#define ALEF_A 0xc0
+#define ALEF 0xc1
+#define HAMZE 0xc2
+#define BE 0xc3
+#define PE 0xc4
+#define TE 0xc5
+#define SE 0xc6
+#define JIM 0xc7
+#define CHE 0xc8
+#define HE_J 0xc9
+#define XE 0xca
+#define DAL 0xcb
+#define ZAL 0xcc
+#define RE 0xcd
+#define ZE 0xce
+#define JE 0xcf
+#define SIN 0xd0
+#define SHIN 0xd1
+#define SAD 0xd2
+#define ZAD 0xd3
+#define _TA 0xd4
+#define _ZA 0xd5
+#define AYN 0xd6
+#define GHAYN 0xd7
+#define FE 0xd8
+#define GHAF 0xd9
+#define KAF 0xda
+#define GAF 0xdb
+#define LAM 0xdc
+#define MIM 0xdd
+#define NOON 0xde
+#define WAW 0xdf
+#define F_HE 0xe0 /* F_ added for name clash with Perl */
+#define YE 0xe1
+#define TEE 0xfc
+#define _KAF_H 0xfd
+#define YEE 0xfe
+
+#define F_LBRACK 0xe2 /* Farsi '[' character */
+#define F_RBRACK 0xe3 /* Farsi ']' character */
+#define F_LBRACE 0xe4 /* Farsi '{' character */
+#define F_RBRACE 0xe5 /* Farsi '}' character */
+#define F_LQUOT 0xe6 /* Farsi left quotation character */
+#define F_RQUOT 0xe7 /* Farsi right quotation character */
+#define F_STAR 0xe8 /* Farsi '*' character */
+#define F_UNDERLINE 0xe9 /* Farsi '_' character */
+#define F_PIPE 0xea /* Farsi '|' character */
+#define F_BSLASH 0xeb /* Farsi '\' character */
+
+#define MAD 0xf0
+#define JAZR 0xf1
+#define OW 0xf2
+#define MAD_N 0xf3
+#define JAZR_N 0xf4
+#define OW_OW 0xf5
+#define TASH 0xf6
+#define OO 0xf7
+#define ALEF_U_H 0xf8
+#define WAW_H 0xf9
+#define ALEF_D_H 0xfa
+
+/*
+ * global definitions
+ * ==================
+ */
+
+#define SRC_EDT 0
+#define SRC_CMD 1
+
+#define AT_CURSOR 0
+
+/*
+ * definitions for the window dependent functions (w_farsi).
+ */
+#define W_CONV 0x1
+#define W_R_L 0x2
+
+
+/* special Farsi text messages */
+
+EXTERN char_u farsi_text_1[]
+#ifdef DO_INIT
+ = { YE_, _SIN, RE, ALEF_, _FE, ' ', 'V', 'I', 'M',
+ ' ', F_HE, _BE, ' ', SHIN, RE, _GAF, DAL,' ', NOON,
+ ALEF_, _YE, ALEF_, _PE, '\0'}
+#endif
+ ;
+
+EXTERN char_u farsi_text_2[]
+#ifdef DO_INIT
+ = { YE_, _SIN, RE, ALEF_, _FE, ' ', FARSI_3, FARSI_3,
+ FARSI_4, FARSI_2, ' ', DAL, RE, ALEF, DAL, _NOON,
+ ALEF_, _TE, _SIN, ALEF, ' ', F_HE, _BE, ' ', SHIN,
+ RE, _GAF, DAL, ' ', NOON, ALEF_, _YE, ALEF_, _PE, '\0'}
+#endif
+ ;
+
+EXTERN char_u farsi_text_3[]
+#ifdef DO_INIT
+ = { DAL, WAW, _SHIN, _YE, _MIM, _NOON, ' ', YE_, _NOON,
+ ALEF_,_BE, _YE, _TE, _SHIN, _PE, ' ', 'R','E','P','L',
+ 'A','C','E', ' ', NOON, ALEF_, _MIM, RE, _FE, ZE, ALEF,
+ ' ', 'R', 'E', 'V', 'E', 'R', 'S', 'E', ' ', 'I', 'N',
+ 'S', 'E', 'R', 'T', ' ', SHIN, WAW, RE, ' ', ALEF_, _BE,
+ ' ', YE_, _SIN, RE, ALEF_, _FE, ' ', RE, DAL, ' ', RE,
+ ALEF_, _KAF,' ', MIM, ALEF_, _GAF, _NOON, _HE, '\0'}
+#endif
+ ;
+
+#if 0 /* not used */
+EXTERN char_u farsi_text_4[]
+#ifdef DO_INIT
+ = { DAL, WAW, _SHIN, _YE, _MIM, _NOON, ' ', YE_, _NOON,
+ ALEF_, _BE, _YE, _TE, _SHIN, _PE, ' ', '<', 'C','T','R',
+ 'L','-','B','>', ' ', NOON, ALEF_, _MIM, RE, _FE, ZE,
+ ALEF, ' ', YE_, _SIN, RE, ALEF_, _FE, ' ', RE, DAL, ' ',
+ RE, ALEF_, _KAF,' ', MIM, ALEF_, _GAF, _NOON, _HE, '\0'}
+#endif
+ ;
+#endif
+
+EXTERN char_u farsi_text_5[]
+#ifdef DO_INIT
+ = { ' ', YE_, _SIN, RE, ALEF_, _FE, '\0'}
+#endif
+ ;
diff --git a/src/feature.h b/src/feature.h
new file mode 100644
index 000000000..725c0710a
--- /dev/null
+++ b/src/feature.h
@@ -0,0 +1,1184 @@
+/* vi:set ts=8 sts=0 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+/*
+ * feature.h: Defines for optional code and preferences
+ *
+ * Edit this file to include/exclude parts of Vim, before compiling.
+ * The only other file that may be edited is Makefile, it contains machine
+ * specific options.
+ *
+ * To include specific options, change the "#if*" and "#endif" into comments,
+ * or uncomment the "#define".
+ * To exclude specific options, change the "#define" into a comment.
+ */
+
+/*
+ * When adding a new feature:
+ * - Add a #define below.
+ * - Add a message in the table above ex_version().
+ * - Add a string to f_has().
+ * - Add a feature to ":help feature-list" in doc/eval.txt.
+ * - Add feature to ":help +feature-list" in doc/various.txt.
+ * - Add comment for the documentation of commands that use the feature.
+ */
+
+/*
+ * Basic choices:
+ * ==============
+ *
+ * +tiny almost no features enabled, not even multiple windows
+ * +small few features enabled, as basic as possible
+ * +normal A default selection of features enabled
+ * +big many features enabled, as rich as possible.
+ * +huge all possible featues enabled.
+ *
+ * When +small is used, +tiny is also included. +normal implies +small, etc.
+ */
+
+/*
+ * Uncomment one of these to override the default. For unix use a configure
+ * argument, see Makefile.
+ */
+#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
+ && !defined(FEAT_BIG) && !defined(FEAT_HUGE)
+/* #define FEAT_TINY */
+/* #define FEAT_SMALL */
+/* #define FEAT_NORMAL */
+/* #define FEAT_BIG */
+/* #define FEAT_HUGE */
+#endif
+
+/*
+ * These executables are made available with the +big feature, because they
+ * are supposed to have enough RAM: Win32 (console & GUI), dos32, OS/2 and VMS.
+ * The dos16 version has very little RAM available, use +small.
+ */
+#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
+ && !defined(FEAT_BIG) && !defined(FEAT_HUGE)
+# if defined(MSWIN) || defined(DJGPP) || defined(OS2) || defined(VMS) || defined(MACOS) || defined(AMIGA)
+# define FEAT_BIG
+# else
+# ifdef MSDOS
+# define FEAT_SMALL
+# else
+# define FEAT_NORMAL
+# endif
+# endif
+#endif
+
+/*
+ * Each feature implies including the "smaller" ones.
+ */
+#ifdef FEAT_HUGE
+# define FEAT_BIG
+#endif
+#ifdef FEAT_BIG
+# define FEAT_NORMAL
+#endif
+#ifdef FEAT_NORMAL
+# define FEAT_SMALL
+#endif
+#ifdef FEAT_SMALL
+# define FEAT_TINY
+#endif
+
+/*
+ * Optional code (see ":help +feature-list")
+ * =============
+ */
+
+/*
+ * +windows Multiple windows. Without this there is no help
+ * window and no status lines.
+ */
+#ifdef FEAT_SMALL
+# define FEAT_WINDOWS
+#endif
+
+/*
+ * +listcmds Vim commands for the buffer list and the argument
+ * list. Without this there is no ":buffer" ":bnext",
+ * ":bdel", ":argdelete", etc.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_LISTCMDS
+#endif
+
+/*
+ * +vertsplit Vertically split windows.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_VERTSPLIT
+#endif
+#if defined(FEAT_VERTSPLIT) && !defined(FEAT_WINDOWS)
+# define FEAT_WINDOWS
+#endif
+
+/*
+ * +cmdhist Command line history.
+ */
+#ifdef FEAT_SMALL
+# define FEAT_CMDHIST
+#endif
+
+/*
+ * +jumplist Jumplist, CTRL-O and CTRL-I commands.
+ */
+#ifdef FEAT_SMALL
+# define FEAT_JUMPLIST
+#endif
+
+/* the cmdline-window requires FEAT_VERTSPLIT and FEAT_CMDHIST */
+#if defined(FEAT_VERTSPLIT) && defined(FEAT_CMDHIST)
+# define FEAT_CMDWIN
+#endif
+
+/*
+ * +folding Fold lines.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_FOLDING
+#endif
+
+/*
+ * +digraphs Digraphs.
+ * In insert mode and on the command line you will be
+ * able to use digraphs. The CTRL-K command will work.
+ * Define OLD_DIGRAPHS to get digraphs compatible with
+ * Vim 5.x. The new ones are from RFC 1345.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_DIGRAPHS
+/* #define OLD_DIGRAPHS */
+#endif
+
+/*
+ * +langmap 'langmap' option. Only useful when you put your
+ * keyboard in a special language mode, e.g. for typing
+ * greek.
+ */
+#ifdef FEAT_BIG
+# define FEAT_LANGMAP
+#endif
+
+/*
+ * +keymap 'keymap' option. Allows you to map typed keys in
+ * Insert mode for a special language.
+ */
+#ifdef FEAT_BIG
+# define FEAT_KEYMAP
+#endif
+
+/*
+ * +localmap Mappings and abbreviations local to a buffer.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_LOCALMAP
+#endif
+
+/*
+ * +insert_expand CTRL-N/CTRL-P/CTRL-X in insert mode. Takes about
+ * 4Kbyte of code.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_INS_EXPAND
+#endif
+
+/*
+ * +cmdline_compl completion of mappings/abbreviations in cmdline mode.
+ * Takes a few Kbyte of code.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_CMDL_COMPL
+#endif
+
+#ifdef FEAT_NORMAL
+# define VIM_BACKTICK /* internal backtick expansion */
+#endif
+
+/*
+ * +textobjects Text objects: "vaw", "das", etc.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_TEXTOBJ
+#endif
+
+/*
+ * +visual Visual mode.
+ * +visualextra Extra features for Visual mode (mostly block operators).
+ */
+#ifdef FEAT_SMALL
+# define FEAT_VISUAL
+# ifdef FEAT_NORMAL
+# define FEAT_VISUALEXTRA
+# endif
+#else
+# ifdef FEAT_CLIPBOARD
+# undef FEAT_CLIPBOARD /* can't use clipboard without Visual mode */
+# endif
+#endif
+
+/*
+ * +virtualedit 'virtualedit' option and its implementation
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_VIRTUALEDIT
+#endif
+
+/*
+ * +vreplace "gR" and "gr" commands.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_VREPLACE
+#endif
+
+/*
+ * +cmdline_info 'showcmd' and 'ruler' options.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_CMDL_INFO
+#endif
+
+/*
+ * +linebreak 'showbreak', 'breakat' and 'linebreak' options.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_LINEBREAK
+#endif
+
+/*
+ * +ex_extra ":retab", ":right", ":left", ":center", ":normal".
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_EX_EXTRA
+#endif
+
+/*
+ * +extra_search 'hlsearch' and 'incsearch' options.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_SEARCH_EXTRA
+#endif
+
+/*
+ * +quickfix Quickfix commands.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_QUICKFIX
+#endif
+
+/*
+ * +file_in_path "gf" and "<cfile>" commands.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_SEARCHPATH
+#endif
+
+/*
+ * +find_in_path "[I" ":isearch" "^W^I", ":checkpath", etc.
+ */
+#ifdef FEAT_NORMAL
+# ifdef FEAT_SEARCHPATH /* FEAT_SEARCHPATH is required */
+# define FEAT_FIND_ID
+# endif
+#endif
+
+/*
+ * +path_extra up/downwards searching in 'path' and 'tags'.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_PATH_EXTRA
+#endif
+
+/*
+ * +rightleft Right-to-left editing/typing support.
+ */
+#ifdef FEAT_BIG
+# define FEAT_RIGHTLEFT
+#endif
+
+/*
+ * +farsi Farsi (Persian language) Keymap support.
+ * Requires FEAT_RIGHTLEFT.
+ */
+#ifdef FEAT_BIG
+# define FEAT_FKMAP
+#endif
+#ifdef FEAT_FKMAP
+# ifndef FEAT_RIGHTLEFT
+# define FEAT_RIGHTLEFT
+# endif
+#endif
+
+/*
+ * +arabic Arabic keymap and shaping support.
+ * Requires FEAT_RIGHTLEFT and FEAT_MBYTE.
+ */
+#if defined(FEAT_BIG) && !defined(WIN16) && SIZEOF_INT >= 4 && !defined(EBCDIC)
+# define FEAT_ARABIC
+#endif
+#ifdef FEAT_ARABIC
+# ifndef FEAT_RIGHTLEFT
+# define FEAT_RIGHTLEFT
+# endif
+#endif
+
+/*
+ * +emacs_tags When FEAT_EMACS_TAGS defined: Include support for
+ * emacs style TAGS file.
+ */
+#ifdef FEAT_BIG
+# define FEAT_EMACS_TAGS
+#endif
+
+/*
+ * +tag_binary Can use a binary search for the tags file.
+ *
+ * Disabled for EBCDIC:
+ * On OS/390 Unix we have the problem that /bin/sort sorts ASCII instead of
+ * EBCDIC. With this binary search doesn't work, as VIM expects a tag file
+ * sorted by character values. I'm not sure how to fix this. Should we really
+ * do a EBCDIC to ASCII conversion for this??
+ */
+#if defined(FEAT_NORMAL) && !defined(EBCDIC)
+# define FEAT_TAG_BINS
+#endif
+
+/*
+ * +tag_old_static Old style static tags: "file:tag file ..". Slows
+ * down tag searching a bit.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_TAG_OLDSTATIC
+#endif
+
+/*
+ * +tag_any_white Allow any white space to separate the fields in a tags
+ * file. When not defined, only a TAB is allowed.
+ */
+/* #define FEAT_TAG_ANYWHITE */
+
+/*
+ * +cscope Unix only: Cscope support.
+ */
+#if defined(UNIX) && defined(FEAT_BIG) && !defined(FEAT_CSCOPE) && !defined(MACOS_X)
+# define FEAT_CSCOPE
+#endif
+
+/*
+ * +eval Built-in script language and expression evaluation,
+ * ":let", ":if", etc.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_EVAL
+#endif
+
+/*
+ * +user_commands Allow the user to define his own commands.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_USR_CMDS
+#endif
+
+/*
+ * +printer ":hardcopy" command
+ * +postscript Printing uses PostScript file output.
+ */
+#if defined(FEAT_NORMAL) && (defined(MSWIN) || defined(FEAT_EVAL)) \
+ && !defined(AMIGA)
+# define FEAT_PRINTER
+#endif
+#if defined(FEAT_PRINTER) && ((defined(MSWIN) && defined(MSWINPS)) \
+ || (!defined(MSWIN) && defined(FEAT_EVAL)))
+# define FEAT_POSTSCRIPT
+#endif
+
+/*
+ * +modify_fname modifiers for file name. E.g., "%:p:h".
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_MODIFY_FNAME
+#endif
+
+/*
+ * +autocmd ":autocmd" command
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_AUTOCMD
+#endif
+
+/*
+ * +diff Displaying diffs in a nice way.
+ * Requires +windows and +autocmd.
+ */
+#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_AUTOCMD)
+# define FEAT_DIFF
+#endif
+
+/*
+ * +title 'title' and 'icon' options
+ * +statusline 'statusline', 'rulerformat' and special format of
+ * 'titlestring' and 'iconstring' options.
+ * +byte_offset '%o' in 'statusline' and builtin functions line2byte()
+ * and byte2line().
+ * Note: Required for Macintosh.
+ */
+#if defined(FEAT_NORMAL) && !defined(MSDOS)
+# define FEAT_TITLE
+#endif
+
+#ifdef FEAT_NORMAL
+# define FEAT_STL_OPT
+# ifndef FEAT_CMDL_INFO
+# define FEAT_CMDL_INFO /* 'ruler' is required for 'statusline' */
+# endif
+#endif
+
+#ifdef FEAT_NORMAL
+# define FEAT_BYTEOFF
+#endif
+
+/*
+ * +wildignore 'wildignore' and 'backupskip' options
+ * Needed for Unix to make "crontab -e" work.
+ */
+#if defined(FEAT_NORMAL) || defined(UNIX)
+# define FEAT_WILDIGN
+#endif
+
+/*
+ * +wildmenu 'wildmenu' option
+ */
+#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+# define FEAT_WILDMENU
+#endif
+
+/*
+ * +osfiletype filetype checking in autocommand patterns.
+ * Only on systems that support filetypes (RISC OS).
+ */
+#if 0
+# define FEAT_OSFILETYPE
+# define DFLT_OFT "Text"
+#endif
+
+/*
+ * +viminfo reading/writing the viminfo file. Takes about 8Kbyte
+ * of code.
+ * VIMINFO_FILE Location of user .viminfo file (should start with $).
+ * VIMINFO_FILE2 Location of alternate user .viminfo file.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_VIMINFO
+/* #define VIMINFO_FILE "$HOME/foo/.viminfo" */
+/* #define VIMINFO_FILE2 "~/bar/.viminfo" */
+#endif
+
+/*
+ * +syntax syntax highlighting. When using this, it's a good
+ * idea to have +autocmd and +eval too.
+ */
+#if defined(FEAT_NORMAL) || defined(PROTO)
+# define FEAT_SYN_HL
+#endif
+
+/*
+ * +builtin_terms Choose one out of the following four:
+ *
+ * NO_BUILTIN_TCAPS Do not include any builtin termcap entries (used only
+ * with HAVE_TGETENT defined).
+ *
+ * (nothing) Machine specific termcap entries will be included.
+ * This is default for win16 to save static data.
+ *
+ * SOME_BUILTIN_TCAPS Include most useful builtin termcap entries (used only
+ * with NO_BUILTIN_TCAPS not defined).
+ * This is the default.
+ *
+ * ALL_BUILTIN_TCAPS Include all builtin termcap entries
+ * (used only with NO_BUILTIN_TCAPS not defined).
+ */
+#ifdef HAVE_TGETENT
+/* #define NO_BUILTIN_TCAPS */
+#endif
+
+#if !defined(NO_BUILTIN_TCAPS) && !defined(FEAT_GUI_W16)
+# ifdef FEAT_BIG
+# define ALL_BUILTIN_TCAPS
+# else
+# define SOME_BUILTIN_TCAPS /* default */
+# endif
+#endif
+
+/*
+ * +lispindent lisp indenting (From Eric Fischer).
+ * +cindent C code indenting (From Eric Fischer).
+ * +smartindent smart C code indenting when the 'si' option is set.
+ *
+ * These two need to be defined when making prototypes.
+ */
+#if defined(FEAT_NORMAL) || defined(PROTO)
+# define FEAT_LISP
+#endif
+
+#if defined(FEAT_NORMAL) || defined(PROTO)
+# define FEAT_CINDENT
+#endif
+
+#ifdef FEAT_NORMAL
+# define FEAT_SMARTINDENT
+#endif
+
+/*
+ * +comments 'comments' option.
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_COMMENTS
+#endif
+
+/*
+ * +cryptv Encryption (by Mohsin Ahmed <mosh@sasi.com>).
+ */
+#if defined(FEAT_NORMAL) || defined(PROTO)
+# define FEAT_CRYPT
+#endif
+
+/*
+ * +mksession ":mksession" command.
+ * Requires +windows and +vertsplit.
+ */
+#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_VERTSPLIT)
+# define FEAT_SESSION
+#endif
+
+/*
+ * +multi_lang Multi language support. ":menutrans", ":language", etc.
+ * +gettext Message translations (requires +multi_lang)
+ * (only when "lang" archive unpacked)
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_MULTI_LANG
+#endif
+#if defined(HAVE_GETTEXT) && defined(FEAT_MULTI_LANG) \
+ && (defined(HAVE_LOCALE_H) || defined(X_LOCALE))
+# define FEAT_GETTEXT
+#endif
+
+/*
+ * +multi_byte Generic multi-byte character handling. Doesn't work
+ * with 16 bit ints. Required for GTK+ 2.
+ *
+ * Disabled for EBCDIC:
+ * Multibyte support doesn't work on OS390 Unix currently.
+ */
+#if (defined(FEAT_BIG) || defined(HAVE_GTK2) || defined(FEAT_ARABIC)) \
+ && !defined(FEAT_MBYTE) && !defined(WIN16) \
+ && SIZEOF_INT >= 4 && !defined(EBCDIC)
+# define FEAT_MBYTE
+#endif
+
+/*
+ * +multi_byte_ime Win32 IME input method. Requires +multi_byte.
+ * Only for far-east Windows, so IME can be used to input
+ * chars. Not tested much!
+ */
+#if defined(FEAT_GUI_W32) && !defined(FEAT_MBYTE_IME)
+/* #define FEAT_MBYTE_IME */
+# endif
+
+#if defined(FEAT_MBYTE_IME) && !defined(FEAT_MBYTE)
+# define FEAT_MBYTE
+#endif
+
+#if defined(FEAT_MBYTE) && SIZEOF_INT < 4 && !defined(PROTO)
+ Error: Can only handle multi-byte feature with 32 bit int or larger
+#endif
+
+/* Use iconv() when it's available. */
+#if defined(FEAT_MBYTE) && ((defined(HAVE_ICONV_H) && defined(HAVE_ICONV)) \
+ || defined(DYNAMIC_ICONV))
+# define USE_ICONV
+#endif
+
+/*
+ * +xim X Input Method. For entering special languages like
+ * chinese and Japanese.
+ * +hangul_input Internal Hangul input method. Must be included
+ * through configure: "--enable-hangulin"
+ * Both are for Unix and VMS only.
+ */
+#ifndef FEAT_XIM
+/* #define FEAT_XIM */
+#endif
+
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+# define USE_XIM 1 /* needed for GTK include files */
+#endif
+
+#ifdef FEAT_HANGULIN
+# define HANGUL_DEFAULT_KEYBOARD 2 /* 2 or 3 bulsik keyboard */
+# define ESC_CHG_TO_ENG_MODE /* if defined, when ESC pressed,
+ * turn to english mode
+ */
+# if !defined(FEAT_XFONTSET) && defined(HAVE_X11)
+# define FEAT_XFONTSET /* Hangul input requires xfontset */
+# endif
+# if defined(FEAT_XIM) && !defined(LINT)
+ Error: You should select only ONE of XIM and HANGUL INPUT
+# endif
+#endif
+#if defined(FEAT_HANGULIN) || defined(FEAT_XIM)
+/* # define X_LOCALE */ /* for OS with incomplete locale
+ support, like old linux versions. */
+/* # define SLOW_XSERVER */ /* for extremely slow X server */
+#endif
+
+/*
+ * +xfontset X fontset support. For outputting wide characters.
+ */
+#ifndef FEAT_XFONTSET
+# if defined(FEAT_MBYTE) && defined(HAVE_X11) && !defined(HAVE_GTK2)
+# define FEAT_XFONTSET
+# else
+/* # define FEAT_XFONTSET */
+# endif
+#endif
+
+/*
+ * +libcall libcall() function
+ */
+/* Using dlopen() also requires dlsym() to be available. */
+#if defined(HAVE_DLOPEN) && defined(HAVE_DLSYM)
+# define USE_DLOPEN
+#endif
+#if defined(FEAT_EVAL) && (defined(WIN3264) || ((defined(UNIX) || defined(VMS)) \
+ && (defined(USE_DLOPEN) || defined(HAVE_SHL_LOAD))))
+# define FEAT_LIBCALL
+#endif
+
+/*
+ * +scrollbind synchronization of split windows
+ */
+#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
+# define FEAT_SCROLLBIND
+#endif
+
+/*
+ * +menu ":menu" command
+ */
+#ifdef FEAT_NORMAL
+# define FEAT_MENU
+# ifdef FEAT_GUI_W32
+# define FEAT_TEAROFF
+# endif
+#endif
+
+/* There are two ways to use XPM. */
+#if (defined(HAVE_XM_XPMP_H) && defined(FEAT_GUI_MOTIF)) \
+ || defined(HAVE_X11_XPM_H)
+# define HAVE_XPM 1
+#endif
+
+/*
+ * +toolbar Include code for a toolbar (for the Win32 GUI, GTK
+ * always has it). But only if menus are enabled.
+ */
+#if defined(FEAT_NORMAL) && defined(FEAT_MENU) \
+ && (defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_MSWIN) \
+ || ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
+ && defined(HAVE_XPM)) \
+ || defined(FEAT_GUI_PHOTON))
+# define FEAT_TOOLBAR
+#endif
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_MENU)
+# define FEAT_MENU
+#endif
+
+/*
+ * +browse ":browse" command.
+ *
+ * BROWSE_CURRBUF Open file browser in the directory of the current
+ * buffer, instead of the current directory.
+ */
+#if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
+# define FEAT_BROWSE
+#endif
+#if defined(FEAT_NORMAL) && defined(FEAT_GUI_MSWIN)
+# define BROWSE_CURRBUF
+#endif
+
+/*
+ * +dialog_gui Use GUI dialog.
+ * +dialog_con May use Console dialog.
+ * When none of these defined there is no dialog support.
+ */
+#ifdef FEAT_NORMAL
+# if ((defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)) \
+ && defined(HAVE_X11_XPM_H)) \
+ || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_PHOTON) \
+ || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_MAC)
+# define FEAT_CON_DIALOG
+# define FEAT_GUI_DIALOG
+# else
+# define FEAT_CON_DIALOG
+# endif
+#endif
+#if !defined(FEAT_GUI_DIALOG) && (defined(FEAT_GUI_MOTIF) \
+ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK))
+/* need a dialog to show error messages when starting from the desktop */
+# define FEAT_GUI_DIALOG
+#endif
+#if defined(FEAT_GUI_DIALOG) && \
+ (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
+# define FEAT_GUI_TEXTDIALOG
+#endif
+
+/* Mac specific thing: Codewarrior interface. */
+#ifdef FEAT_GUI_MAC
+# define FEAT_CW_EDITOR
+#endif
+
+/*
+ * Preferences:
+ * ============
+ */
+
+/*
+ * +writebackup 'writebackup' is default on:
+ * Use a backup file while overwriting a file. But it's
+ * deleted again when 'backup' is not set. Changing this
+ * is strongly discouraged: You can loose all your
+ * changes when the computer crashes while writing the
+ * file.
+ * VMS note: It does work on VMS as well, but because of
+ * version handling it does not have any purpose.
+ * Overwrite will write to the new version.
+ */
+#ifndef VMS
+# define FEAT_WRITEBACKUP
+#endif
+
+/*
+ * +xterm_save The t_ti and t_te entries for the builtin xterm will
+ * be set to save the screen when starting Vim and
+ * restoring it when exiting.
+ */
+/* #define FEAT_XTERM_SAVE */
+
+/*
+ * DEBUG Output a lot of debugging garbage.
+ */
+/* #define DEBUG */
+
+/*
+ * STARTUPTIME Time the startup process. Writes a "vimstartup" file
+ * with timestamps.
+ */
+/* #define STARTUPTIME "vimstartup" */
+
+/*
+ * MEM_PROFILE Debugging of memory allocation and freeing.
+ */
+/* #define MEM_PROFILE */
+
+/*
+ * VIMRC_FILE Name of the .vimrc file in current dir.
+ */
+/* #define VIMRC_FILE ".vimrc" */
+
+/*
+ * EXRC_FILE Name of the .exrc file in current dir.
+ */
+/* #define EXRC_FILE ".exrc" */
+
+/*
+ * GVIMRC_FILE Name of the .gvimrc file in current dir.
+ */
+/* #define GVIMRC_FILE ".gvimrc" */
+
+/*
+ * VIEW_FILE Name of the default ":mkview" file.
+ */
+#define VIEW_FILE "View.vim"
+
+/*
+ * SESSION_FILE Name of the default ":mksession" file.
+ */
+#define SESSION_FILE "Session.vim"
+
+/*
+ * USR_VIMRC_FILE Name of the user .vimrc file.
+ * USR_VIMRC_FILE2 Name of alternate user .vimrc file.
+ * USR_VIMRC_FILE3 Name of alternate user .vimrc file.
+ */
+/* #define USR_VIMRC_FILE "~/foo/.vimrc" */
+/* #define USR_VIMRC_FILE2 "~/bar/.vimrc" */
+/* #define USR_VIMRC_FILE3 "$VIM/.vimrc" */
+
+/*
+ * EVIM_FILE Name of the evim.vim script file
+ */
+/* #define EVIM_FILE "$VIMRUNTIME/evim.vim" */
+
+/*
+ * USR_EXRC_FILE Name of the user .exrc file.
+ * USR_EXRC_FILE2 Name of the alternate user .exrc file.
+ */
+/* #define USR_EXRC_FILE "~/foo/.exrc" */
+/* #define USR_EXRC_FILE2 "~/bar/.exrc" */
+
+/*
+ * USR_GVIMRC_FILE Name of the user .gvimrc file.
+ * USR_GVIMRC_FILE2 Name of the alternate user .gvimrc file.
+ */
+/* #define USR_GVIMRC_FILE "~/foo/.gvimrc" */
+/* #define USR_GVIMRC_FILE2 "~/bar/.gvimrc" */
+/* #define USR_GVIMRC_FILE3 "$VIM/.gvimrc" */
+
+/*
+ * SYS_VIMRC_FILE Name of the system-wide .vimrc file.
+ */
+/* #define SYS_VIMRC_FILE "/etc/vimrc" */
+
+/*
+ * SYS_GVIMRC_FILE Name of the system-wide .gvimrc file.
+ */
+/* #define SYS_GVIMRC_FILE "/etc/gvimrc" */
+
+/*
+ * DFLT_HELPFILE Name of the help file.
+ */
+/* # define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt.gz" */
+
+/*
+ * File names for:
+ * FILETYPE_FILE switch on file type detection
+ * FTPLUGIN_FILE switch on loading filetype plugin files
+ * INDENT_FILE switch on loading indent files
+ * FTOFF_FILE switch off file type detection
+ * FTPLUGOF_FILE switch off loading settings files
+ * INDOFF_FILE switch off loading indent files
+ */
+/* # define FILETYPE_FILE "filetype.vim" */
+/* # define FTPLUGIN_FILE "ftplugin.vim" */
+/* # define INDENT_FILE "indent.vim" */
+/* # define FTOFF_FILE "ftoff.vim" */
+/* # define FTPLUGOF_FILE "ftplugof.vim" */
+/* # define INDOFF_FILE "indoff.vim" */
+
+/*
+ * SYS_MENU_FILE Name of the default menu.vim file.
+ */
+/* # define SYS_MENU_FILE "$VIMRUNTIME/menu.vim" */
+
+/*
+ * SYS_OPTWIN_FILE Name of the default optwin.vim file.
+ */
+#ifndef SYS_OPTWIN_FILE
+# define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim"
+#endif
+
+/*
+ * SYNTAX_FNAME Name of a syntax file, where %s is the syntax name.
+ */
+/* #define SYNTAX_FNAME "/foo/%s.vim" */
+
+/*
+ * RUNTIME_DIRNAME Generic name for the directory of the runtime files.
+ */
+#ifndef RUNTIME_DIRNAME
+# define RUNTIME_DIRNAME "runtime"
+#endif
+
+/*
+ * RUNTIME_GLOBAL Directory name for global Vim runtime directory.
+ * Don't define this if the preprocessor can't handle
+ * string concatenation.
+ * Also set by "--with-global-runtime" configure argument.
+ */
+/* #define RUNTIME_GLOBAL "/etc/vim" */
+
+/*
+ * MODIFIED_BY Name of who modified Vim. Required when distributing
+ * a modifed version of Vim.
+ * Also from the "--with-modified-by" configure argument.
+ */
+/* #define MODIFIED_BY "John Doe" */
+
+/*
+ * Machine dependent:
+ * ==================
+ */
+
+/*
+ * +fork Unix only: fork() support (detected by configure)
+ * +system Use system() instead of fork/exec for starting a
+ * shell. Doesn't work for the GUI!
+ */
+/* #define USE_SYSTEM */
+
+/*
+ * +X11 Unix only. Include code for xterm title saving and X
+ * clipboard. Only works if HAVE_X11 is also defined.
+ */
+#if defined(FEAT_NORMAL) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
+# define WANT_X11
+#endif
+
+/*
+ * XSMP - X11 Session Management Protocol
+ * It may be preferred to disable this if the GUI supports it (e.g.,
+ * GNOME/KDE) and implement save-yourself etc. through that, but it may also
+ * be cleaner to have all SM-aware vims do the same thing (libSM does not
+ * depend upon X11).
+ * If your GUI wants to support SM itself, change this ifdef.
+ * I'm assuming that any X11 implementation will cope with this for now.
+ */
+#if defined(HAVE_X11) && defined(WANT_X11) && defined(HAVE_X11_SM_SMLIB_H)
+# define USE_XSMP
+#endif
+#if defined(USE_XSMP_INTERACT) && !defined(USE_XSMP)
+# undef USE_XSMP_INTERACT
+#endif
+
+/*
+ * +mouse_xterm Unix only: Include code for xterm mouse handling.
+ * +mouse_dec idem, for Dec mouse handling.
+ * +mouse_jsbterm idem, for Jsbterm mouse handling.
+ * +mouse_netterm idem, for Netterm mouse handling.
+ * (none) MS-DOS mouse support.
+ * +mouse_gpm Unix only: Include code for Linux console mouse
+ * handling.
+ * +mouse_pterm PTerm mouse support for QNX
+ * +mouse Any mouse support (any of the above enabled).
+ */
+/* OS/2 and Amiga console have no mouse support */
+#if (!defined(AMIGA) && !defined(OS2) && !defined(MACOS)) || defined(FEAT_GUI_AMIGA)
+# ifdef FEAT_NORMAL
+# define FEAT_MOUSE_XTERM
+# endif
+# ifdef FEAT_BIG
+# define FEAT_MOUSE_NET
+# endif
+# ifdef FEAT_BIG
+# define FEAT_MOUSE_DEC
+# endif
+# if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264))
+# define DOS_MOUSE
+# endif
+# if defined(FEAT_NORMAL) && defined(__QNX__)
+# define FEAT_MOUSE_PTERM
+# endif
+#endif
+
+#if defined(FEAT_NORMAL) && defined(HAVE_GPM)
+# define FEAT_MOUSE_GPM
+#endif
+/* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */
+#if !defined(FEAT_MOUSE_TTY) && (defined(FEAT_MOUSE_XTERM) \
+ || defined(FEAT_MOUSE_NET) || defined(FEAT_MOUSE_DEC) \
+ || defined(DOS_MOUSE) || defined(FEAT_MOUSE_GPM) \
+ || defined(FEAT_MOUSE_JSB) || defined(FEAT_MOUSE_PTERM))
+# define FEAT_MOUSE_TTY /* include non-GUI mouse support */
+#endif
+#if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
+# define FEAT_MOUSE /* include generic mouse support */
+#endif
+
+/*
+ * +clipboard Clipboard support. Always used for the GUI.
+ * +xterm_clipboard Unix only: Include code for handling the clipboard
+ * in an xterm like in the GUI.
+ */
+#ifdef FEAT_GUI
+# ifndef FEAT_CLIPBOARD
+# define FEAT_CLIPBOARD
+# ifndef FEAT_VISUAL
+# define FEAT_VISUAL
+# endif
+# endif
+#endif
+
+#if defined(FEAT_NORMAL) && defined(FEAT_VISUAL) \
+ && (defined(UNIX) || defined(VMS)) \
+ && defined(WANT_X11) && defined(HAVE_X11)
+# define FEAT_XCLIPBOARD
+# ifndef FEAT_CLIPBOARD
+# define FEAT_CLIPBOARD
+# endif
+#endif
+
+/*
+ * +dnd Drag'n'drop support. Always used for the GTK+ GUI.
+ */
+#if defined(FEAT_CLIPBOARD) && defined(FEAT_GUI_GTK)
+# define FEAT_DND
+#endif
+
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_SMALL)
+# define MSWIN_FIND_REPLACE /* include code for find/replace dialog */
+# define MSWIN_FR_BUFSIZE 256
+#endif
+
+/*
+ * +clientserver Remote control via the remote_send() function
+ * and the --remote argument
+ */
+#if (defined(WIN32) || defined(FEAT_XCLIPBOARD)) && defined(FEAT_EVAL)
+# define FEAT_CLIENTSERVER
+#endif
+
+/*
+ * +termresponse send t_RV to obtain terminal response. Used for xterm
+ * to check if mouse dragging can be used and if term
+ * codes can be obtaind.
+ */
+#if (defined(FEAT_NORMAL) || defined(FEAT_MOUSE)) && defined(HAVE_TGETENT)
+# define FEAT_TERMRESPONSE
+#endif
+
+/*
+ * cursor shape Adjust the shape of the cursor to the mode.
+ * mouse shape Adjust the shape of the mouse pointer to the mode.
+ */
+#ifdef FEAT_NORMAL
+/* MS-DOS console and Win32 console can change cursor shape */
+# if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
+# define MCH_CURSOR_SHAPE
+# endif
+# if defined(FEAT_GUI_W32) || defined(FEAT_GUI_W16) || defined(FEAT_GUI_MOTIF) \
+ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_PHOTON)
+# define FEAT_MOUSESHAPE
+# endif
+#endif
+
+/* GUI and some consoles can change the shape of the cursor. The code is also
+ * needed for the 'mouseshape' option. */
+#if defined(FEAT_GUI) || defined(MCH_CURSOR_SHAPE) || defined(FEAT_MOUSESHAPE)
+# define CURSOR_SHAPE
+#endif
+
+/*
+ * +ARP Amiga only. Use arp.library, DOS 2.0 is not required.
+ */
+#ifndef NO_ARP
+# define FEAT_ARP
+#endif
+
+/*
+ * +GUI_Athena To compile Vim with or without the GUI (gvim) you have
+ * +GUI_BeOS to edit the Makefile.
+ * +GUI_Motif
+ */
+
+/*
+ * +ole Win32 OLE automation: Use Makefile.ovc.
+ */
+
+/*
+ * These features can only be included by using a configure argument. See the
+ * Makefile for a line to uncomment.
+ * +perl Perl interface: "--enable-perlinterp"
+ * +python Python interface: "--enable-pythoninterp"
+ * +tcl TCL interface: "--enable-tclinterp"
+ * +sniff Sniff interface: "--enable-sniff"
+ * +sun_workshop Sun Workshop integegration
+ * +netbeans_intg Netbeans integration
+ */
+
+/*
+ * These features are automatically detected:
+ * +terminfo
+ * +tgetent
+ */
+
+/*
+ * The Sun Workshop features currently only work with Motif.
+ */
+#if !defined(FEAT_GUI_MOTIF) && defined(FEAT_SUN_WORKSHOP)
+# undef FEAT_SUN_WORKSHOP
+#endif
+
+/*
+ * The Netbeans features currently only work with Motif and GTK and Win32.
+ * It also requires +listcmds and +eval.
+ */
+#if ((!defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
+ || !defined(FEAT_LISTCMDS) || !defined(FEAT_EVAL)) \
+ && defined(FEAT_NETBEANS_INTG)
+# undef FEAT_NETBEANS_INTG
+#endif
+
+/*
+ * +signs Allow signs to be displayed to the left of text lines.
+ * Adds the ":sign" command.
+ */
+#if defined(FEAT_BIG) || defined(FEAT_SUN_WORKSHOP) \
+ || defined(FEAT_NETBEANS_INTG)
+# define FEAT_SIGNS
+# if ((defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) \
+ && defined(HAVE_X11_XPM_H)) \
+ || defined(FEAT_GUI_GTK) \
+ || (defined(WIN32) && defined(FEAT_GUI))
+# define FEAT_SIGN_ICONS
+# endif
+#endif
+
+/*
+ * +balloon_eval Allow balloon expression evaluation. Used with a
+ * debugger and for tooltips.
+ * Only for GUIs where it was implemented.
+ */
+#if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)) \
+ && ( (defined(FEAT_TOOLBAR) \
+ && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)) \
+ || defined(FEAT_SUN_WORKSHOP) \
+ || defined(FEAT_NETBEANS_INTG))
+# define FEAT_BEVAL
+# if !defined(FEAT_XFONTSET) && !defined(FEAT_GUI_GTK) \
+ && !defined(FEAT_GUI_W32)
+# define FEAT_XFONTSET
+# endif
+#endif
+
+#if defined(FEAT_BEVAL) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
+# define FEAT_BEVAL_TIP /* balloon eval used for toolbar tooltip */
+#endif
+
+#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
+/*
+ * The following features are (currently) only used by Sun Visual WorkShop 6
+ * and NetBeans. These features could be used with other integrations with
+ * debuggers so I've used separate feature defines.
+ */
+# if !defined(FEAT_MENU)
+# define FEAT_MENU
+# endif
+#endif
+
+#if defined(FEAT_SUN_WORKSHOP)
+/*
+ * Use an alternative method of X input for a secondary
+ * command input.
+ */
+# define ALT_X_INPUT
+
+/*
+ * +footer Motif only: Add a message area at the bottom of the
+ * main window area.
+ */
+# define FEAT_FOOTER
+
+#endif
diff --git a/src/fileio.c b/src/fileio.c
new file mode 100644
index 000000000..22339bf8e
--- /dev/null
+++ b/src/fileio.c
@@ -0,0 +1,8750 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * fileio.c: read from and write to a file
+ */
+
+#if defined(MSDOS) || defined(WIN16) || defined(WIN32) || defined(_WIN64)
+# include <io.h> /* for lseek(), must be before vim.h */
+#endif
+
+#if defined __EMX__
+# include <io.h> /* for mktemp(), CJW 1997-12-03 */
+#endif
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef __TANDEM
+# include <limits.h> /* for SSIZE_MAX */
+#endif
+
+#if defined(HAVE_UTIME) && defined(HAVE_UTIME_H)
+# include <utime.h> /* for struct utimbuf */
+#endif
+
+#define BUFSIZE 8192 /* size of normal write buffer */
+#define SMBUFSIZE 256 /* size of emergency write buffer */
+
+#ifdef FEAT_CRYPT
+# define CRYPT_MAGIC "VimCrypt~01!" /* "01" is the version nr */
+# define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */
+#endif
+
+/* Is there any system that doesn't have access()? */
+#ifndef MACOS_CLASSIC /* Not available on MacOS 9 */
+# define USE_MCH_ACCESS
+#endif
+
+#ifdef FEAT_MBYTE
+static char_u *next_fenc __ARGS((char_u **pp));
+# ifdef FEAT_EVAL
+static char_u *readfile_charconvert __ARGS((char_u *fname, char_u *fenc, int *fdp));
+# endif
+#endif
+#ifdef FEAT_VIMINFO
+static void check_marks_read __ARGS((void));
+#endif
+#ifdef FEAT_CRYPT
+static char_u *check_for_cryptkey __ARGS((char_u *cryptkey, char_u *ptr, long *sizep, long *filesizep, int newfile));
+#endif
+#ifdef UNIX
+static void set_file_time __ARGS((char_u *fname, time_t atime, time_t mtime));
+#endif
+static void msg_add_fname __ARGS((buf_T *, char_u *));
+static int msg_add_fileformat __ARGS((int eol_type));
+static void msg_add_lines __ARGS((int, long, long));
+static void msg_add_eol __ARGS((void));
+static int check_mtime __ARGS((buf_T *buf, struct stat *s));
+static int time_differs __ARGS((long t1, long t2));
+#ifdef FEAT_AUTOCMD
+static int apply_autocmds_exarg __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
+#endif
+
+#if defined(FEAT_CRYPT) || defined(FEAT_MBYTE)
+# define HAS_BW_FLAGS
+# define FIO_LATIN1 0x01 /* convert Latin1 */
+# define FIO_UTF8 0x02 /* convert UTF-8 */
+# define FIO_UCS2 0x04 /* convert UCS-2 */
+# define FIO_UCS4 0x08 /* convert UCS-4 */
+# define FIO_UTF16 0x10 /* convert UTF-16 */
+# ifdef WIN3264
+# define FIO_CODEPAGE 0x20 /* convert MS-Windows codepage */
+# define FIO_PUT_CP(x) (((x) & 0xffff) << 16) /* put codepage in top word */
+# define FIO_GET_CP(x) (((x)>>16) & 0xffff) /* get codepage from top word */
+# endif
+# ifdef MACOS_X
+# define FIO_MACROMAN 0x20 /* convert MacRoman */
+# endif
+# define FIO_ENDIAN_L 0x80 /* little endian */
+# define FIO_ENCRYPTED 0x1000 /* encrypt written bytes */
+# define FIO_NOCONVERT 0x2000 /* skip encoding conversion */
+# define FIO_UCSBOM 0x4000 /* check for BOM at start of file */
+# define FIO_ALL -1 /* allow all formats */
+#endif
+
+/* When converting, a read() or write() may leave some bytes to be converted
+ * for the next call. The value is guessed... */
+#define CONV_RESTLEN 30
+
+/* We have to guess how much a sequence of bytes may expand when converting
+ * with iconv() to be able to allocate a buffer. */
+#define ICONV_MULT 8
+
+/*
+ * Structure to pass arguments from buf_write() to buf_write_bytes().
+ */
+struct bw_info
+{
+ int bw_fd; /* file descriptor */
+ char_u *bw_buf; /* buffer with data to be written */
+ int bw_len; /* lenght of data */
+#ifdef HAS_BW_FLAGS
+ int bw_flags; /* FIO_ flags */
+#endif
+#ifdef FEAT_MBYTE
+ char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */
+ int bw_restlen; /* nr of bytes in bw_rest[] */
+ int bw_first; /* first write call */
+ char_u *bw_conv_buf; /* buffer for writing converted chars */
+ int bw_conv_buflen; /* size of bw_conv_buf */
+ int bw_conv_error; /* set for conversion error */
+# ifdef USE_ICONV
+ iconv_t bw_iconv_fd; /* descriptor for iconv() or -1 */
+# endif
+#endif
+};
+
+static int buf_write_bytes __ARGS((struct bw_info *ip));
+
+#ifdef FEAT_MBYTE
+static int ucs2bytes __ARGS((unsigned c, char_u **pp, int flags));
+static int same_encoding __ARGS((char_u *a, char_u *b));
+static int get_fio_flags __ARGS((char_u *ptr));
+static char_u *check_for_bom __ARGS((char_u *p, long size, int *lenp, int flags));
+static int make_bom __ARGS((char_u *buf, char_u *name));
+# ifdef WIN3264
+static int get_win_fio_flags __ARGS((char_u *ptr));
+# endif
+# ifdef MACOS_X
+static int get_mac_fio_flags __ARGS((char_u *ptr));
+# endif
+#endif
+static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
+
+static linenr_T write_no_eol_lnum = 0; /* non-zero lnum when last line of
+ next binary write should not have
+ an end-of-line */
+
+ void
+filemess(buf, name, s, attr)
+ buf_T *buf;
+ char_u *name;
+ char_u *s;
+ int attr;
+{
+ int msg_scroll_save;
+
+ if (msg_silent != 0)
+ return;
+ msg_add_fname(buf, name); /* put file name in IObuff with quotes */
+ /* If it's extremely long, truncate it. */
+ if (STRLEN(IObuff) > IOSIZE - 80)
+ IObuff[IOSIZE - 80] = NUL;
+ STRCAT(IObuff, s);
+ /*
+ * For the first message may have to start a new line.
+ * For further ones overwrite the previous one, reset msg_scroll before
+ * calling filemess().
+ */
+ msg_scroll_save = msg_scroll;
+ if (shortmess(SHM_OVERALL) && !exiting && p_verbose == 0)
+ msg_scroll = FALSE;
+ if (!msg_scroll) /* wait a bit when overwriting an error msg */
+ check_for_delay(FALSE);
+ msg_start();
+ msg_scroll = msg_scroll_save;
+ msg_scrolled_ign = TRUE;
+ /* may truncate the message to avoid a hit-return prompt */
+ msg_outtrans_attr(msg_may_trunc(FALSE, IObuff), attr);
+ msg_clr_eos();
+ out_flush();
+ msg_scrolled_ign = FALSE;
+}
+
+/*
+ * Read lines from file "fname" into the buffer after line "from".
+ *
+ * 1. We allocate blocks with lalloc, as big as possible.
+ * 2. Each block is filled with characters from the file with a single read().
+ * 3. The lines are inserted in the buffer with ml_append().
+ *
+ * (caller must check that fname != NULL, unless READ_STDIN is used)
+ *
+ * "lines_to_skip" is the number of lines that must be skipped
+ * "lines_to_read" is the number of lines that are appended
+ * When not recovering lines_to_skip is 0 and lines_to_read MAXLNUM.
+ *
+ * flags:
+ * READ_NEW starting to edit a new buffer
+ * READ_FILTER reading filter output
+ * READ_STDIN read from stdin instead of a file
+ * READ_BUFFER read from curbuf instead of a file (converting after reading
+ * stdin)
+ * READ_DUMMY read into a dummy buffer (to check if file contents changed)
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
+ char_u *fname;
+ char_u *sfname;
+ linenr_T from;
+ linenr_T lines_to_skip;
+ linenr_T lines_to_read;
+ exarg_T *eap; /* can be NULL! */
+ int flags;
+{
+ int fd = 0;
+ int newfile = (flags & READ_NEW);
+ int check_readonly;
+ int filtering = (flags & READ_FILTER);
+ int read_stdin = (flags & READ_STDIN);
+ int read_buffer = (flags & READ_BUFFER);
+ linenr_T read_buf_lnum = 1; /* next line to read from curbuf */
+ colnr_T read_buf_col = 0; /* next char to read from this line */
+ char_u c;
+ linenr_T lnum = from;
+ char_u *ptr = NULL; /* pointer into read buffer */
+ char_u *buffer = NULL; /* read buffer */
+ char_u *new_buffer = NULL; /* init to shut up gcc */
+ char_u *line_start = NULL; /* init to shut up gcc */
+ int wasempty; /* buffer was empty before reading */
+ colnr_T len;
+ long size = 0;
+ char_u *p;
+ long filesize = 0;
+ int skip_read = FALSE;
+#ifdef FEAT_CRYPT
+ char_u *cryptkey = NULL;
+#endif
+ int split = 0; /* number of split lines */
+#define UNKNOWN 0x0fffffff /* file size is unknown */
+ linenr_T linecnt;
+ int error = FALSE; /* errors encountered */
+ int ff_error = EOL_UNKNOWN; /* file format with errors */
+ long linerest = 0; /* remaining chars in line */
+#ifdef UNIX
+ int perm = 0;
+ int swap_mode = -1; /* protection bits for swap file */
+#else
+ int perm;
+#endif
+ int fileformat = 0; /* end-of-line format */
+ int keep_fileformat = FALSE;
+ struct stat st;
+ int file_readonly;
+ linenr_T skip_count = 0;
+ linenr_T read_count = 0;
+ int msg_save = msg_scroll;
+ linenr_T read_no_eol_lnum = 0; /* non-zero lnum when last line of
+ * last read was missing the eol */
+ int try_mac = (vim_strchr(p_ffs, 'm') != NULL);
+ int try_dos = (vim_strchr(p_ffs, 'd') != NULL);
+ int try_unix = (vim_strchr(p_ffs, 'x') != NULL);
+ int file_rewind = FALSE;
+#ifdef FEAT_MBYTE
+ int can_retry;
+ int conv_error = FALSE; /* conversion error detected */
+ int keep_dest_enc = FALSE; /* don't retry when char doesn't fit
+ in destination encoding */
+ linenr_T illegal_byte = 0; /* line nr with illegal byte */
+ char_u *tmpname = NULL; /* name of 'charconvert' output file */
+ int fio_flags = 0;
+ char_u *fenc; /* fileencoding to use */
+ int fenc_alloced; /* fenc_next is in allocated memory */
+ char_u *fenc_next = NULL; /* next item in 'fencs' or NULL */
+ int advance_fenc = FALSE;
+ long real_size = 0;
+# ifdef USE_ICONV
+ iconv_t iconv_fd = (iconv_t)-1; /* descriptor for iconv() or -1 */
+# ifdef FEAT_EVAL
+ int did_iconv = FALSE; /* TRUE when iconv() failed and trying
+ 'charconvert' next */
+# endif
+# endif
+ int converted = FALSE; /* TRUE if conversion done */
+ int notconverted = FALSE; /* TRUE if conversion wanted but it
+ wasn't possible */
+ char_u conv_rest[CONV_RESTLEN];
+ int conv_restlen = 0; /* nr of bytes in conv_rest[] */
+#endif
+
+#ifdef FEAT_AUTOCMD
+ write_no_eol_lnum = 0; /* in case it was set by the previous read */
+#endif
+
+ /*
+ * If there is no file name yet, use the one for the read file.
+ * BF_NOTEDITED is set to reflect this.
+ * Don't do this for a read from a filter.
+ * Only do this when 'cpoptions' contains the 'f' flag.
+ */
+ if (curbuf->b_ffname == NULL
+ && !filtering
+ && fname != NULL
+ && vim_strchr(p_cpo, CPO_FNAMER) != NULL
+ && !(flags & READ_DUMMY))
+ {
+ if (setfname(curbuf, fname, sfname, FALSE) == OK)
+ curbuf->b_flags |= BF_NOTEDITED;
+ }
+
+ /*
+ * For Unix: Use the short file name whenever possible.
+ * Avoids problems with networks and when directory names are changed.
+ * Don't do this for MS-DOS, a "cd" in a sub-shell may have moved us to
+ * another directory, which we don't detect.
+ */
+ if (sfname == NULL)
+ sfname = fname;
+#if defined(UNIX) || defined(__EMX__)
+ fname = sfname;
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /*
+ * The BufReadCmd and FileReadCmd events intercept the reading process by
+ * executing the associated commands instead.
+ */
+ if (!filtering && !read_stdin && !read_buffer)
+ {
+ pos_T pos;
+
+ pos = curbuf->b_op_start;
+
+ /* Set '[ mark to the line above where the lines go (line 1 if zero). */
+ curbuf->b_op_start.lnum = ((from == 0) ? 1 : from);
+ curbuf->b_op_start.col = 0;
+
+ if (newfile)
+ {
+ if (apply_autocmds_exarg(EVENT_BUFREADCMD, NULL, sfname,
+ FALSE, curbuf, eap))
+#ifdef FEAT_EVAL
+ return aborting() ? FAIL : OK;
+#else
+ return OK;
+#endif
+ }
+ else if (apply_autocmds_exarg(EVENT_FILEREADCMD, sfname, sfname,
+ FALSE, NULL, eap))
+#ifdef FEAT_EVAL
+ return aborting() ? FAIL : OK;
+#else
+ return OK;
+#endif
+
+ curbuf->b_op_start = pos;
+ }
+#endif
+
+ if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0)
+ msg_scroll = FALSE; /* overwrite previous file message */
+ else
+ msg_scroll = TRUE; /* don't overwrite previous file message */
+
+ /*
+ * If the name ends in a path separator, we can't open it. Check here,
+ * because reading the file may actually work, but then creating the swap
+ * file may destroy it! Reported on MS-DOS and Win 95.
+ * If the name is too long we might crash further on, quit here.
+ */
+ if (fname != NULL
+ && *fname != NUL
+ && (vim_ispathsep(*(fname + STRLEN(fname) - 1))
+ || STRLEN(fname) >= MAXPATHL))
+ {
+ filemess(curbuf, fname, (char_u *)_("Illegal file name"), 0);
+ msg_end();
+ msg_scroll = msg_save;
+ return FAIL;
+ }
+
+#ifdef UNIX
+ /*
+ * On Unix it is possible to read a directory, so we have to
+ * check for it before the mch_open().
+ */
+ if (!read_stdin && !read_buffer)
+ {
+ perm = mch_getperm(fname);
+ if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */
+# ifdef S_ISFIFO
+ && !S_ISFIFO(perm) /* ... or fifo */
+# endif
+# ifdef S_ISSOCK
+ && !S_ISSOCK(perm) /* ... or socket */
+# endif
+ )
+ {
+ if (S_ISDIR(perm))
+ filemess(curbuf, fname, (char_u *)_("is a directory"), 0);
+ else
+ filemess(curbuf, fname, (char_u *)_("is not a file"), 0);
+ msg_end();
+ msg_scroll = msg_save;
+ return FAIL;
+ }
+ }
+#endif
+
+ /* set default 'fileformat' */
+ if (newfile)
+ {
+ if (eap != NULL && eap->force_ff != 0)
+ set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL);
+ else if (*p_ffs != NUL)
+ set_fileformat(default_fileformat(), OPT_LOCAL);
+ }
+
+ /* set or reset 'binary' */
+ if (eap != NULL && eap->force_bin != 0)
+ {
+ int oldval = curbuf->b_p_bin;
+
+ curbuf->b_p_bin = (eap->force_bin == FORCE_BIN);
+ set_options_bin(oldval, curbuf->b_p_bin, OPT_LOCAL);
+ }
+
+ /*
+ * When opening a new file we take the readonly flag from the file.
+ * Default is r/w, can be set to r/o below.
+ * Don't reset it when in readonly mode
+ * Only set/reset b_p_ro when BF_CHECK_RO is set.
+ */
+ check_readonly = (newfile && (curbuf->b_flags & BF_CHECK_RO));
+ if (check_readonly && !readonlymode) /* default: set file not readonly */
+ curbuf->b_p_ro = FALSE;
+
+ if (newfile && !read_stdin && !read_buffer)
+ {
+ /* Remember time of file.
+ * For RISCOS, also remember the filetype.
+ */
+ if (mch_stat((char *)fname, &st) >= 0)
+ {
+ buf_store_time(curbuf, &st, fname);
+ curbuf->b_mtime_read = curbuf->b_mtime;
+
+#if defined(RISCOS) && defined(FEAT_OSFILETYPE)
+ /* Read the filetype into the buffer local filetype option. */
+ mch_read_filetype(fname);
+#endif
+#ifdef UNIX
+ /*
+ * Use the protection bits of the original file for the swap file.
+ * This makes it possible for others to read the name of the
+ * edited file from the swapfile, but only if they can read the
+ * edited file.
+ * Remove the "write" and "execute" bits for group and others
+ * (they must not write the swapfile).
+ * Add the "read" and "write" bits for the user, otherwise we may
+ * not be able to write to the file ourselves.
+ * Setting the bits is done below, after creating the swap file.
+ */
+ swap_mode = (st.st_mode & 0644) | 0600;
+#endif
+#ifdef FEAT_CW_EDITOR
+ /* Get the FSSpec on MacOS
+ * TODO: Update it properly when the buffer name changes
+ */
+ (void)GetFSSpecFromPath(curbuf->b_ffname, &curbuf->b_FSSpec);
+#endif
+#ifdef VMS
+ curbuf->b_fab_rfm = st.st_fab_rfm;
+#endif
+ }
+ else
+ {
+ curbuf->b_mtime = 0;
+ curbuf->b_mtime_read = 0;
+ curbuf->b_orig_size = 0;
+ curbuf->b_orig_mode = 0;
+ }
+
+ /* Reset the "new file" flag. It will be set again below when the
+ * file doesn't exist. */
+ curbuf->b_flags &= ~(BF_NEW | BF_NEW_W);
+ }
+
+/*
+ * for UNIX: check readonly with perm and mch_access()
+ * for RISCOS: same as Unix, otherwise file gets re-datestamped!
+ * for MSDOS and Amiga: check readonly by trying to open the file for writing
+ */
+ file_readonly = FALSE;
+ if (read_stdin)
+ {
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ /* Force binary I/O on stdin to avoid CR-LF -> LF conversion. */
+ setmode(0, O_BINARY);
+#endif
+ }
+ else if (!read_buffer)
+ {
+#ifdef USE_MCH_ACCESS
+ if (
+# ifdef UNIX
+ !(perm & 0222) ||
+# endif
+ mch_access((char *)fname, W_OK))
+ file_readonly = TRUE;
+ fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+#else
+ if (!newfile
+ || readonlymode
+ || (fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0)
+ {
+ file_readonly = TRUE;
+ /* try to open ro */
+ fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+ }
+#endif
+ }
+
+ if (fd < 0) /* cannot open at all */
+ {
+#ifndef UNIX
+ int isdir_f;
+#endif
+ msg_scroll = msg_save;
+#ifndef UNIX
+ /*
+ * On MSDOS and Amiga we can't open a directory, check here.
+ */
+ isdir_f = (mch_isdir(fname));
+ perm = mch_getperm(fname); /* check if the file exists */
+ if (isdir_f)
+ {
+ filemess(curbuf, sfname, (char_u *)_("is a directory"), 0);
+ curbuf->b_p_ro = TRUE; /* must use "w!" now */
+ }
+ else
+#endif
+ if (newfile)
+ {
+ if (perm < 0)
+ {
+ /*
+ * Set the 'new-file' flag, so that when the file has
+ * been created by someone else, a ":w" will complain.
+ */
+ curbuf->b_flags |= BF_NEW;
+
+ /* Create a swap file now, so that other Vims are warned
+ * that we are editing this file. Don't do this for a
+ * "nofile" or "nowrite" buffer type. */
+#ifdef FEAT_QUICKFIX
+ if (!bt_dontwrite(curbuf))
+#endif
+ check_need_swap(newfile);
+ filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
+#ifdef FEAT_VIMINFO
+ /* Even though this is a new file, it might have been
+ * edited before and deleted. Get the old marks. */
+ check_marks_read();
+#endif
+#ifdef FEAT_MBYTE
+ if (eap != NULL && eap->force_enc != 0)
+ {
+ /* set forced 'fileencoding' */
+ fenc = enc_canonize(eap->cmd + eap->force_enc);
+ if (fenc != NULL)
+ set_string_option_direct((char_u *)"fenc", -1,
+ fenc, OPT_FREE|OPT_LOCAL);
+ vim_free(fenc);
+ }
+#endif
+#ifdef FEAT_AUTOCMD
+ apply_autocmds_exarg(EVENT_BUFNEWFILE, sfname, sfname,
+ FALSE, curbuf, eap);
+#endif
+ /* remember the current fileformat */
+ save_file_ff(curbuf);
+
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (aborting()) /* autocmds may abort script processing */
+ return FAIL;
+#endif
+ return OK; /* a new file is not an error */
+ }
+ else
+ {
+ filemess(curbuf, sfname,
+ (char_u *)_("[Permission Denied]"), 0);
+ curbuf->b_p_ro = TRUE; /* must use "w!" now */
+ }
+ }
+
+ return FAIL;
+ }
+
+ /*
+ * Only set the 'ro' flag for readonly files the first time they are
+ * loaded. Help files always get readonly mode
+ */
+ if ((check_readonly && file_readonly) || curbuf->b_help)
+ curbuf->b_p_ro = TRUE;
+
+ if (newfile)
+ {
+ curbuf->b_p_eol = TRUE;
+ curbuf->b_start_eol = TRUE;
+#ifdef FEAT_MBYTE
+ curbuf->b_p_bomb = FALSE;
+#endif
+ }
+
+ /* Create a swap file now, so that other Vims are warned that we are
+ * editing this file.
+ * Don't do this for a "nofile" or "nowrite" buffer type. */
+#ifdef FEAT_QUICKFIX
+ if (!bt_dontwrite(curbuf))
+#endif
+ {
+ check_need_swap(newfile);
+#ifdef UNIX
+ /* Set swap file protection bits after creating it. */
+ if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
+ (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
+#endif
+ }
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ /* If "Quit" selected at ATTENTION dialog, don't load the file */
+ if (swap_exists_action == SEA_QUIT)
+ {
+ if (!read_buffer && !read_stdin)
+ close(fd);
+ return FAIL;
+ }
+#endif
+
+ ++no_wait_return; /* don't wait for return yet */
+
+ /*
+ * Set '[ mark to the line above where the lines go (line 1 if zero).
+ */
+ curbuf->b_op_start.lnum = ((from == 0) ? 1 : from);
+ curbuf->b_op_start.col = 0;
+
+#ifdef FEAT_AUTOCMD
+ if (!read_buffer)
+ {
+ int m = msg_scroll;
+ int n = msg_scrolled;
+ buf_T *old_curbuf = curbuf;
+
+ /*
+ * The file must be closed again, the autocommands may want to change
+ * the file before reading it.
+ */
+ if (!read_stdin)
+ close(fd); /* ignore errors */
+
+ /*
+ * The output from the autocommands should not overwrite anything and
+ * should not be overwritten: Set msg_scroll, restore its value if no
+ * output was done.
+ */
+ msg_scroll = TRUE;
+ if (filtering)
+ apply_autocmds_exarg(EVENT_FILTERREADPRE, NULL, sfname,
+ FALSE, curbuf, eap);
+ else if (read_stdin)
+ apply_autocmds_exarg(EVENT_STDINREADPRE, NULL, sfname,
+ FALSE, curbuf, eap);
+ else if (newfile)
+ apply_autocmds_exarg(EVENT_BUFREADPRE, NULL, sfname,
+ FALSE, curbuf, eap);
+ else
+ apply_autocmds_exarg(EVENT_FILEREADPRE, sfname, sfname,
+ FALSE, NULL, eap);
+ if (msg_scrolled == n)
+ msg_scroll = m;
+
+#ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ {
+ --no_wait_return;
+ msg_scroll = msg_save;
+ curbuf->b_p_ro = TRUE; /* must use "w!" now */
+ return FAIL;
+ }
+#endif
+ /*
+ * Don't allow the autocommands to change the current buffer.
+ * Try to re-open the file.
+ */
+ if (!read_stdin && (curbuf != old_curbuf
+ || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
+ {
+ --no_wait_return;
+ msg_scroll = msg_save;
+ if (fd < 0)
+ EMSG(_("E200: *ReadPre autocommands made the file unreadable"));
+ else
+ EMSG(_("E201: *ReadPre autocommands must not change current buffer"));
+ curbuf->b_p_ro = TRUE; /* must use "w!" now */
+ return FAIL;
+ }
+ }
+#endif /* FEAT_AUTOCMD */
+
+ /* Autocommands may add lines to the file, need to check if it is empty */
+ wasempty = (curbuf->b_ml.ml_flags & ML_EMPTY);
+
+ if (!recoverymode && !filtering && !(flags & READ_DUMMY))
+ {
+ /*
+ * Show the user that we are busy reading the input. Sometimes this
+ * may take a while. When reading from stdin another program may
+ * still be running, don't move the cursor to the last line, unless
+ * always using the GUI.
+ */
+ if (read_stdin)
+ {
+#ifndef ALWAYS_USE_GUI
+ mch_msg(_("Vim: Reading from stdin...\n"));
+#endif
+#ifdef FEAT_GUI
+ /* Also write a message in the GUI window, if there is one. */
+ if (gui.in_use && !gui.dying && !gui.starting)
+ {
+ p = (char_u *)_("Reading from stdin...");
+ gui_write(p, (int)STRLEN(p));
+ }
+#endif
+ }
+ else if (!read_buffer)
+ filemess(curbuf, sfname, (char_u *)"", 0);
+ }
+
+ msg_scroll = FALSE; /* overwrite the file message */
+
+ /*
+ * Set linecnt now, before the "retry" caused by a wrong guess for
+ * fileformat, and after the autocommands, which may change them.
+ */
+ linecnt = curbuf->b_ml.ml_line_count;
+
+#ifdef FEAT_MBYTE
+ /*
+ * Decide which 'encoding' to use first.
+ */
+ if (eap != NULL && eap->force_enc != 0)
+ {
+ fenc = enc_canonize(eap->cmd + eap->force_enc);
+ fenc_alloced = TRUE;
+ }
+ else if (curbuf->b_p_bin)
+ {
+ fenc = (char_u *)""; /* binary: don't convert */
+ fenc_alloced = FALSE;
+ }
+ else if (curbuf->b_help)
+ {
+ char_u firstline[80];
+
+ /* Help files are either utf-8 or latin1. Try utf-8 first, if this
+ * fails it must be latin1.
+ * Always do this when 'encoding' is "utf-8". Otherwise only do
+ * this when needed to avoid [converted] remarks all the time.
+ * It is needed when the first line contains non-ASCII characters.
+ * That is only in *.??x files. */
+ fenc = (char_u *)"latin1";
+ c = enc_utf8;
+ if (!c && !read_stdin && TOLOWER_ASC(fname[STRLEN(fname) - 1]) == 'x')
+ {
+ /* Read the first line (and a bit more). Immediately rewind to
+ * the start of the file. If the read() fails "len" is -1. */
+ len = vim_read(fd, firstline, 80);
+ lseek(fd, (off_t)0L, SEEK_SET);
+ for (p = firstline; p < firstline + len; ++p)
+ if (*p >= 0x80)
+ {
+ c = TRUE;
+ break;
+ }
+ }
+
+ if (c)
+ {
+ fenc_next = fenc;
+ fenc = (char_u *)"utf-8";
+
+ /* When the file is utf-8 but a character doesn't fit in
+ * 'encoding' don't retry. In help text editing utf-8 bytes
+ * doesn't make sense. */
+ keep_dest_enc = TRUE;
+ }
+ fenc_alloced = FALSE;
+ }
+ else if (*p_fencs == NUL)
+ {
+ fenc = curbuf->b_p_fenc; /* use format from buffer */
+ fenc_alloced = FALSE;
+ }
+ else
+ {
+ fenc_next = p_fencs; /* try items in 'fileencodings' */
+ fenc = next_fenc(&fenc_next);
+ fenc_alloced = TRUE;
+ }
+#endif
+
+ /*
+ * Jump back here to retry reading the file in different ways.
+ * Reasons to retry:
+ * - encoding conversion failed: try another one from "fenc_next"
+ * - BOM detected and fenc was set, need to setup conversion
+ * - "fileformat" check failed: try another
+ *
+ * Variables set for special retry actions:
+ * "file_rewind" Rewind the file to start reading it again.
+ * "advance_fenc" Advance "fenc" using "fenc_next".
+ * "skip_read" Re-use already read bytes (BOM detected).
+ * "did_iconv" iconv() conversion failed, try 'charconvert'.
+ * "keep_fileformat" Don't reset "fileformat".
+ *
+ * Other status indicators:
+ * "tmpname" When != NULL did conversion with 'charconvert'.
+ * Output file has to be deleted afterwards.
+ * "iconv_fd" When != -1 did conversion with iconv().
+ */
+retry:
+
+ if (file_rewind)
+ {
+ if (read_buffer)
+ {
+ read_buf_lnum = 1;
+ read_buf_col = 0;
+ }
+ else if (read_stdin || lseek(fd, (off_t)0L, SEEK_SET) != 0)
+ {
+ /* Can't rewind the file, give up. */
+ error = TRUE;
+ goto failed;
+ }
+ /* Delete the previously read lines. */
+ while (lnum > from)
+ ml_delete(lnum--, FALSE);
+ file_rewind = FALSE;
+#ifdef FEAT_MBYTE
+ if (newfile)
+ curbuf->b_p_bomb = FALSE;
+ conv_error = FALSE;
+#endif
+ }
+
+ /*
+ * When retrying with another "fenc" and the first time "fileformat"
+ * will be reset.
+ */
+ if (keep_fileformat)
+ keep_fileformat = FALSE;
+ else
+ {
+ if (eap != NULL && eap->force_ff != 0)
+ fileformat = get_fileformat_force(curbuf, eap);
+ else if (curbuf->b_p_bin)
+ fileformat = EOL_UNIX; /* binary: use Unix format */
+ else if (*p_ffs == NUL)
+ fileformat = get_fileformat(curbuf);/* use format from buffer */
+ else
+ fileformat = EOL_UNKNOWN; /* detect from file */
+ }
+
+#ifdef FEAT_MBYTE
+# ifdef USE_ICONV
+ if (iconv_fd != (iconv_t)-1)
+ {
+ /* aborted conversion with iconv(), close the descriptor */
+ iconv_close(iconv_fd);
+ iconv_fd = (iconv_t)-1;
+ }
+# endif
+
+ if (advance_fenc)
+ {
+ /*
+ * Try the next entry in 'fileencodings'.
+ */
+ advance_fenc = FALSE;
+
+ if (eap != NULL && eap->force_enc != 0)
+ {
+ /* Conversion given with "++cc=" wasn't possible, read
+ * without conversion. */
+ notconverted = TRUE;
+ conv_error = FALSE;
+ if (fenc_alloced)
+ vim_free(fenc);
+ fenc = (char_u *)"";
+ fenc_alloced = FALSE;
+ }
+ else
+ {
+ if (fenc_alloced)
+ vim_free(fenc);
+ if (fenc_next != NULL)
+ {
+ fenc = next_fenc(&fenc_next);
+ fenc_alloced = (fenc_next != NULL);
+ }
+ else
+ {
+ fenc = (char_u *)"";
+ fenc_alloced = FALSE;
+ }
+ }
+ if (tmpname != NULL)
+ {
+ mch_remove(tmpname); /* delete converted file */
+ vim_free(tmpname);
+ tmpname = NULL;
+ }
+ }
+
+ /*
+ * Conversion is required when the encoding of the file is different
+ * from 'encoding' or 'encoding' is UTF-16, UCS-2 or UCS-4 (requires
+ * conversion to UTF-8).
+ */
+ fio_flags = 0;
+ converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
+ if (converted || enc_unicode != 0)
+ {
+
+ /* "ucs-bom" means we need to check the first bytes of the file
+ * for a BOM. */
+ if (STRCMP(fenc, ENC_UCSBOM) == 0)
+ fio_flags = FIO_UCSBOM;
+
+ /*
+ * Check if UCS-2/4 or Latin1 to UTF-8 conversion needs to be
+ * done. This is handled below after read(). Prepare the
+ * fio_flags to avoid having to parse the string each time.
+ * Also check for Unicode to Latin1 conversion, because iconv()
+ * appears not to handle this correctly. This works just like
+ * conversion to UTF-8 except how the resulting character is put in
+ * the buffer.
+ */
+ else if (enc_utf8 || STRCMP(p_enc, "latin1") == 0)
+ fio_flags = get_fio_flags(fenc);
+
+# ifdef WIN3264
+ /*
+ * Conversion from an MS-Windows codepage to UTF-8 or another codepage
+ * is handled with MultiByteToWideChar().
+ */
+ if (fio_flags == 0)
+ fio_flags = get_win_fio_flags(fenc);
+# endif
+
+# ifdef MACOS_X
+ /* Conversion from Apple MacRoman to latin1 or UTF-8 */
+ if (fio_flags == 0)
+ fio_flags = get_mac_fio_flags(fenc);
+# endif
+
+# ifdef USE_ICONV
+ /*
+ * Try using iconv() if we can't convert internally.
+ */
+ if (fio_flags == 0
+# ifdef FEAT_EVAL
+ && !did_iconv
+# endif
+ )
+ iconv_fd = (iconv_t)my_iconv_open(
+ enc_utf8 ? (char_u *)"utf-8" : p_enc, fenc);
+# endif
+
+# ifdef FEAT_EVAL
+ /*
+ * Use the 'charconvert' expression when conversion is required
+ * and we can't do it internally or with iconv().
+ */
+ if (fio_flags == 0 && !read_stdin && !read_buffer && *p_ccv != NUL
+# ifdef USE_ICONV
+ && iconv_fd == (iconv_t)-1
+# endif
+ )
+ {
+# ifdef USE_ICONV
+ did_iconv = FALSE;
+# endif
+ /* Skip conversion when it's already done (retry for wrong
+ * "fileformat"). */
+ if (tmpname == NULL)
+ {
+ tmpname = readfile_charconvert(fname, fenc, &fd);
+ if (tmpname == NULL)
+ {
+ /* Conversion failed. Try another one. */
+ advance_fenc = TRUE;
+ if (fd < 0)
+ {
+ /* Re-opening the original file failed! */
+ EMSG(_("E202: Conversion made file unreadable!"));
+ error = TRUE;
+ goto failed;
+ }
+ goto retry;
+ }
+ }
+ }
+ else
+# endif
+ {
+ if (fio_flags == 0
+# ifdef USE_ICONV
+ && iconv_fd == (iconv_t)-1
+# endif
+ )
+ {
+ /* Conversion wanted but we can't.
+ * Try the next conversion in 'fileencodings' */
+ advance_fenc = TRUE;
+ goto retry;
+ }
+ }
+ }
+
+ /* Set can_retry when it's possible to rewind the file and try with
+ * another "fenc" value. It's FALSE when no other "fenc" to try, reading
+ * stdin or "fenc" was specified with "++enc=". */
+ can_retry = (*fenc != NUL && !read_stdin
+ && (eap == NULL || eap->force_enc == 0));
+#endif
+
+ if (!skip_read)
+ {
+ linerest = 0;
+ filesize = 0;
+ skip_count = lines_to_skip;
+ read_count = lines_to_read;
+#ifdef FEAT_MBYTE
+ conv_restlen = 0;
+#endif
+ }
+
+ while (!error && !got_int)
+ {
+ /*
+ * We allocate as much space for the file as we can get, plus
+ * space for the old line plus room for one terminating NUL.
+ * The amount is limited by the fact that read() only can read
+ * upto max_unsigned characters (and other things).
+ */
+#if SIZEOF_INT <= 2
+ if (linerest >= 0x7ff0)
+ {
+ ++split;
+ *ptr = NL; /* split line by inserting a NL */
+ size = 1;
+ }
+ else
+#endif
+ {
+ if (!skip_read)
+ {
+#if SIZEOF_INT > 2
+# ifdef __TANDEM
+ size = SSIZE_MAX; /* use max I/O size, 52K */
+# else
+ size = 0x10000L; /* use buffer >= 64K */
+# endif
+#else
+ size = 0x7ff0L - linerest; /* limit buffer to 32K */
+#endif
+
+ for ( ; size >= 10; size = (long_u)size >> 1)
+ {
+ if ((new_buffer = lalloc((long_u)(size + linerest + 1),
+ FALSE)) != NULL)
+ break;
+ }
+ if (new_buffer == NULL)
+ {
+ do_outofmem_msg((long_u)(size * 2 + linerest + 1));
+ error = TRUE;
+ break;
+ }
+ if (linerest) /* copy characters from the previous buffer */
+ mch_memmove(new_buffer, ptr - linerest, (size_t)linerest);
+ vim_free(buffer);
+ buffer = new_buffer;
+ ptr = buffer + linerest;
+ line_start = buffer;
+
+#ifdef FEAT_MBYTE
+ /* May need room to translate into.
+ * For iconv() we don't really know the required space, use a
+ * factor ICONV_MULT.
+ * latin1 to utf-8: 1 byte becomes up to 2 bytes
+ * utf-16 to utf-8: 2 bytes become up to 3 bytes, 4 bytes
+ * become up to 4 bytes, size must be multiple of 2
+ * ucs-2 to utf-8: 2 bytes become up to 3 bytes, size must be
+ * multiple of 2
+ * ucs-4 to utf-8: 4 bytes become up to 6 bytes, size must be
+ * multiple of 4 */
+ real_size = size;
+# ifdef USE_ICONV
+ if (iconv_fd != (iconv_t)-1)
+ size = size / ICONV_MULT;
+ else
+# endif
+ if (fio_flags & FIO_LATIN1)
+ size = size / 2;
+ else if (fio_flags & (FIO_UCS2 | FIO_UTF16))
+ size = (size * 2 / 3) & ~1;
+ else if (fio_flags & FIO_UCS4)
+ size = (size * 2 / 3) & ~3;
+ else if (fio_flags == FIO_UCSBOM)
+ size = size / ICONV_MULT; /* worst case */
+# ifdef WIN3264
+ else if (fio_flags & FIO_CODEPAGE)
+ size = size / ICONV_MULT; /* also worst case */
+# endif
+# ifdef MACOS_X
+ else if (fio_flags & FIO_MACROMAN)
+ size = size / ICONV_MULT; /* also worst case */
+# endif
+#endif
+
+#ifdef FEAT_MBYTE
+ if (conv_restlen > 0)
+ {
+ /* Insert unconverted bytes from previous line. */
+ mch_memmove(ptr, conv_rest, conv_restlen);
+ ptr += conv_restlen;
+ size -= conv_restlen;
+ }
+#endif
+
+ if (read_buffer)
+ {
+ /*
+ * Read bytes from curbuf. Used for converting text read
+ * from stdin.
+ */
+ if (read_buf_lnum > from)
+ size = 0;
+ else
+ {
+ int n, ni;
+ long tlen;
+
+ tlen = 0;
+ for (;;)
+ {
+ p = ml_get(read_buf_lnum) + read_buf_col;
+ n = (int)STRLEN(p);
+ if ((int)tlen + n + 1 > size)
+ {
+ /* Filled up to "size", append partial line.
+ * Change NL to NUL to reverse the effect done
+ * below. */
+ n = size - tlen;
+ for (ni = 0; ni < n; ++ni)
+ {
+ if (p[ni] == NL)
+ ptr[tlen++] = NUL;
+ else
+ ptr[tlen++] = p[ni];
+ }
+ read_buf_col += n;
+ break;
+ }
+ else
+ {
+ /* Append whole line and new-line. Change NL
+ * to NUL to reverse the effect done below. */
+ for (ni = 0; ni < n; ++ni)
+ {
+ if (p[ni] == NL)
+ ptr[tlen++] = NUL;
+ else
+ ptr[tlen++] = p[ni];
+ }
+ ptr[tlen++] = NL;
+ read_buf_col = 0;
+ if (++read_buf_lnum > from)
+ {
+ /* When the last line didn't have an
+ * end-of-line don't add it now either. */
+ if (!curbuf->b_p_eol)
+ --tlen;
+ size = tlen;
+ break;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ /*
+ * Read bytes from the file.
+ */
+ size = vim_read(fd, ptr, size);
+ }
+
+ if (size <= 0)
+ {
+ if (size < 0) /* read error */
+ error = TRUE;
+#ifdef FEAT_MBYTE
+ else if (conv_restlen > 0)
+ /* some trailing bytes unconverted */
+ conv_error = TRUE;
+#endif
+ }
+
+#ifdef FEAT_CRYPT
+ /*
+ * At start of file: Check for magic number of encryption.
+ */
+ if (filesize == 0)
+ cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
+ &filesize, newfile);
+ /*
+ * Decrypt the read bytes.
+ */
+ if (cryptkey != NULL && size > 0)
+ for (p = ptr; p < ptr + size; ++p)
+ ZDECODE(*p);
+#endif
+ }
+ skip_read = FALSE;
+
+#ifdef FEAT_MBYTE
+ /*
+ * At start of file (or after crypt magic number): Check for BOM.
+ * Also check for a BOM for other Unicode encodings, but not after
+ * converting with 'charconvert' or when a BOM has already been
+ * found.
+ */
+ if ((filesize == 0
+# ifdef FEAT_CRYPT
+ || (filesize == CRYPT_MAGIC_LEN && cryptkey != NULL)
+# endif
+ )
+ && (fio_flags == FIO_UCSBOM
+ || (!curbuf->b_p_bomb
+ && tmpname == NULL
+ && (*fenc == 'u' || (*fenc == NUL && enc_utf8)))))
+ {
+ char_u *ccname;
+ int blen;
+
+ /* no BOM detection in a short file or in binary mode */
+ if (size < 2 || curbuf->b_p_bin)
+ ccname = NULL;
+ else
+ ccname = check_for_bom(ptr, size, &blen,
+ fio_flags == FIO_UCSBOM ? FIO_ALL : get_fio_flags(fenc));
+ if (ccname != NULL)
+ {
+ /* Remove BOM from the text */
+ filesize += blen;
+ size -= blen;
+ mch_memmove(ptr, ptr + blen, (size_t)size);
+ if (newfile)
+ curbuf->b_p_bomb = TRUE;
+ }
+
+ if (fio_flags == FIO_UCSBOM)
+ {
+ if (ccname == NULL)
+ {
+ /* No BOM detected: retry with next encoding. */
+ advance_fenc = TRUE;
+ }
+ else
+ {
+ /* BOM detected: set "fenc" and jump back */
+ if (fenc_alloced)
+ vim_free(fenc);
+ fenc = ccname;
+ fenc_alloced = FALSE;
+ }
+ /* retry reading without getting new bytes or rewinding */
+ skip_read = TRUE;
+ goto retry;
+ }
+ }
+#endif
+ /*
+ * Break here for a read error or end-of-file.
+ */
+ if (size <= 0)
+ break;
+
+#ifdef FEAT_MBYTE
+
+ /* Include not converted bytes. */
+ ptr -= conv_restlen;
+ size += conv_restlen;
+ conv_restlen = 0;
+
+# ifdef USE_ICONV
+ if (iconv_fd != (iconv_t)-1)
+ {
+ /*
+ * Attempt conversion of the read bytes to 'encoding' using
+ * iconv().
+ */
+ const char *fromp;
+ char *top;
+ size_t from_size;
+ size_t to_size;
+
+ fromp = (char *)ptr;
+ from_size = size;
+ ptr += size;
+ top = (char *)ptr;
+ to_size = real_size - size;
+
+ /*
+ * If there is conversion error or not enough room try using
+ * another conversion.
+ */
+ if ((iconv(iconv_fd, (void *)&fromp, &from_size, &top, &to_size)
+ == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
+ || from_size > CONV_RESTLEN)
+ goto rewind_retry;
+
+ if (from_size > 0)
+ {
+ /* Some remaining characters, keep them for the next
+ * round. */
+ mch_memmove(conv_rest, (char_u *)fromp, from_size);
+ conv_restlen = (int)from_size;
+ }
+
+ /* move the linerest to before the converted characters */
+ line_start = ptr - linerest;
+ mch_memmove(line_start, buffer, (size_t)linerest);
+ size = (long)((char_u *)top - ptr);
+ }
+# endif
+
+# ifdef WIN3264
+ if (fio_flags & FIO_CODEPAGE)
+ {
+ /*
+ * Conversion from an MS-Windows codepage or UTF-8 to UTF-8 or
+ * a codepage, using standard MS-Windows functions.
+ * 1. find out how many ucs-2 characters there are.
+ * 2. convert from 'fileencoding' to ucs-2
+ * 3. convert from ucs-2 to 'encoding'
+ */
+ char_u *ucsp;
+ size_t from_size = size;
+ int needed;
+ char_u *p;
+ int u8c;
+
+ /*
+ * 1. find out how many ucs-2 characters there are.
+ */
+# ifdef CP_UTF8 /* VC 4.1 doesn't define CP_UTF8 */
+ if (FIO_GET_CP(fio_flags) == CP_UTF8)
+ {
+ int l, flen;
+
+ /* Handle CP_UTF8 ourselves to be able to handle trailing
+ * bytes properly. First find out the number of
+ * characters and check for trailing bytes. */
+ needed = 0;
+ p = ptr;
+ for (flen = from_size; flen > 0; flen -= l)
+ {
+ l = utf_ptr2len_check_len(p, flen);
+ if (l > flen) /* incomplete char */
+ {
+ if (l > CONV_RESTLEN)
+ /* weird overlong byte sequence */
+ goto rewind_retry;
+ mch_memmove(conv_rest, p, flen);
+ conv_restlen = flen;
+ from_size -= flen;
+ break;
+ }
+ if (l == 1 && *p >= 0x80) /* illegal byte */
+ goto rewind_retry;
+ ++needed;
+ p += l;
+ }
+ }
+ else
+# endif
+ {
+ /* We can't tell if the last byte of an MBCS string is
+ * valid and MultiByteToWideChar() returns zero if it
+ * isn't. Try the whole string, and if that fails, bump
+ * the last byte into conv_rest and try again. */
+ needed = MultiByteToWideChar(FIO_GET_CP(fio_flags),
+ MB_ERR_INVALID_CHARS, (LPCSTR)ptr, from_size,
+ NULL, 0);
+ if (needed == 0)
+ {
+ conv_rest[0] = ptr[from_size - 1];
+ conv_restlen = 1;
+ --from_size;
+ needed = MultiByteToWideChar(FIO_GET_CP(fio_flags),
+ MB_ERR_INVALID_CHARS, (LPCSTR)ptr, from_size,
+ NULL, 0);
+ }
+
+ /* If there really is a conversion error, try using another
+ * conversion. */
+ if (needed == 0)
+ goto rewind_retry;
+ }
+
+ /*
+ * 2. convert from 'fileencoding' to ucs-2
+ *
+ * Put the result of conversion to UCS-2 at the end of the
+ * buffer, then convert from UCS-2 to UTF-8 or "enc_codepage"
+ * into the start of the buffer. If there is not enough space
+ * just fail, there is probably something wrong.
+ */
+ ucsp = ptr + real_size - (needed * sizeof(WCHAR));
+ if (ucsp < ptr + size)
+ goto rewind_retry;
+
+# ifdef CP_UTF8 /* VC 4.1 doesn't define CP_UTF8 */
+ if (FIO_GET_CP(fio_flags) == CP_UTF8)
+ {
+ int l, flen;
+
+ /* Convert from utf-8 to ucs-2. */
+ needed = 0;
+ p = ptr;
+ for (flen = from_size; flen > 0; flen -= l)
+ {
+ l = utf_ptr2len_check_len(p, flen);
+ u8c = utf_ptr2char(p);
+ ucsp[needed * 2] = (u8c & 0xff);
+ ucsp[needed * 2 + 1] = (u8c >> 8);
+ ++needed;
+ p += l;
+ }
+ }
+ else
+# endif
+ needed = MultiByteToWideChar(FIO_GET_CP(fio_flags),
+ MB_ERR_INVALID_CHARS, (LPCSTR)ptr,
+ from_size, (LPWSTR)ucsp, needed);
+
+ /*
+ * 3. convert from ucs-2 to 'encoding'
+ */
+ if (enc_utf8)
+ {
+ /* From UCS-2 to UTF-8. Cannot fail. */
+ p = ptr;
+ for (; needed > 0; --needed)
+ {
+ u8c = *ucsp++;
+ u8c += (*ucsp++ << 8);
+ p += utf_char2bytes(u8c, p);
+ }
+ size = p - ptr;
+ }
+ else
+ {
+ BOOL bad = FALSE;
+
+ /* From UCS-2 to "enc_codepage". If the conversion uses
+ * the default character "?", the data doesn't fit in this
+ * encoding, so fail (unless forced). */
+ size = WideCharToMultiByte(enc_codepage, 0,
+ (LPCWSTR)ucsp, needed,
+ (LPSTR)ptr, real_size, "?", &bad);
+ if (bad && !keep_dest_enc)
+ goto rewind_retry;
+ }
+ }
+ else
+# endif
+# ifdef MACOS_X
+ if (fio_flags & FIO_MACROMAN)
+ {
+ /*
+ * Conversion from Apple MacRoman char encoding to UTF-8 or
+ * latin1, using standard Carbon framework.
+ */
+ CFStringRef cfstr;
+ CFRange r;
+ CFIndex len = size;
+
+ /* MacRoman is an 8-bit encoding, no need to move bytes to
+ * conv_rest[]. */
+ cfstr = CFStringCreateWithBytes(NULL, ptr, len,
+ kCFStringEncodingMacRoman, 0);
+ /*
+ * If there is a conversion error, try using another
+ * conversion.
+ */
+ if (cfstr == NULL)
+ goto rewind_retry;
+
+ r.location = 0;
+ r.length = CFStringGetLength(cfstr);
+ if (r.length != CFStringGetBytes(cfstr, r,
+ (enc_utf8) ? kCFStringEncodingUTF8
+ : kCFStringEncodingISOLatin1,
+ 0, /* no lossy conversion */
+ 0, /* not external representation */
+ ptr + size, real_size - size, &len))
+ {
+ CFRelease(cfstr);
+ goto rewind_retry;
+ }
+ CFRelease(cfstr);
+ mch_memmove(ptr, ptr + size, len);
+ size = len;
+ }
+ else
+# endif
+ if (fio_flags != 0)
+ {
+ int u8c;
+ char_u *dest;
+ char_u *tail = NULL;
+
+ /*
+ * "enc_utf8" set: Convert Unicode or Latin1 to UTF-8.
+ * "enc_utf8" not set: Convert Unicode to Latin1.
+ * Go from end to start through the buffer, because the number
+ * of bytes may increase.
+ * "dest" points to after where the UTF-8 bytes go, "p" points
+ * to after the next character to convert.
+ */
+ dest = ptr + real_size;
+ if (fio_flags == FIO_LATIN1 || fio_flags == FIO_UTF8)
+ {
+ p = ptr + size;
+ if (fio_flags == FIO_UTF8)
+ {
+ /* Check for a trailing incomplete UTF-8 sequence */
+ tail = ptr + size - 1;
+ while (tail > ptr && (*tail & 0xc0) == 0x80)
+ --tail;
+ if (tail + utf_byte2len(*tail) <= ptr + size)
+ tail = NULL;
+ else
+ p = tail;
+ }
+ }
+ else if (fio_flags & (FIO_UCS2 | FIO_UTF16))
+ {
+ /* Check for a trailing byte */
+ p = ptr + (size & ~1);
+ if (size & 1)
+ tail = p;
+ if ((fio_flags & FIO_UTF16) && p > ptr)
+ {
+ /* Check for a trailing leading word */
+ if (fio_flags & FIO_ENDIAN_L)
+ {
+ u8c = (*--p << 8);
+ u8c += *--p;
+ }
+ else
+ {
+ u8c = *--p;
+ u8c += (*--p << 8);
+ }
+ if (u8c >= 0xd800 && u8c <= 0xdbff)
+ tail = p;
+ else
+ p += 2;
+ }
+ }
+ else /* FIO_UCS4 */
+ {
+ /* Check for trailing 1, 2 or 3 bytes */
+ p = ptr + (size & ~3);
+ if (size & 3)
+ tail = p;
+ }
+
+ /* If there is a trailing incomplete sequence move it to
+ * conv_rest[]. */
+ if (tail != NULL)
+ {
+ conv_restlen = (int)((ptr + size) - tail);
+ mch_memmove(conv_rest, (char_u *)tail, conv_restlen);
+ size -= conv_restlen;
+ }
+
+
+ while (p > ptr)
+ {
+ if (fio_flags & FIO_LATIN1)
+ u8c = *--p;
+ else if (fio_flags & (FIO_UCS2 | FIO_UTF16))
+ {
+ if (fio_flags & FIO_ENDIAN_L)
+ {
+ u8c = (*--p << 8);
+ u8c += *--p;
+ }
+ else
+ {
+ u8c = *--p;
+ u8c += (*--p << 8);
+ }
+ if ((fio_flags & FIO_UTF16)
+ && u8c >= 0xdc00 && u8c <= 0xdfff)
+ {
+ int u16c;
+
+ if (p == ptr)
+ {
+ /* Missing leading word. */
+ if (can_retry)
+ goto rewind_retry;
+ conv_error = TRUE;
+ }
+
+ /* found second word of double-word, get the first
+ * word and compute the resulting character */
+ if (fio_flags & FIO_ENDIAN_L)
+ {
+ u16c = (*--p << 8);
+ u16c += *--p;
+ }
+ else
+ {
+ u16c = *--p;
+ u16c += (*--p << 8);
+ }
+ /* Check if the word is indeed a leading word. */
+ if (u16c < 0xd800 || u16c > 0xdbff)
+ {
+ if (can_retry)
+ goto rewind_retry;
+ conv_error = TRUE;
+ }
+ u8c = 0x10000 + ((u16c & 0x3ff) << 10)
+ + (u8c & 0x3ff);
+ }
+ }
+ else if (fio_flags & FIO_UCS4)
+ {
+ if (fio_flags & FIO_ENDIAN_L)
+ {
+ u8c = (*--p << 24);
+ u8c += (*--p << 16);
+ u8c += (*--p << 8);
+ u8c += *--p;
+ }
+ else /* big endian */
+ {
+ u8c = *--p;
+ u8c += (*--p << 8);
+ u8c += (*--p << 16);
+ u8c += (*--p << 24);
+ }
+ }
+ else /* UTF-8 */
+ {
+ if (*--p < 0x80)
+ u8c = *p;
+ else
+ {
+ len = utf_head_off(ptr, p);
+ if (len == 0)
+ {
+ /* Not a valid UTF-8 character, retry with
+ * another fenc when possible, otherwise just
+ * report the error. */
+ if (can_retry)
+ goto rewind_retry;
+ conv_error = TRUE;
+ }
+ p -= len;
+ u8c = utf_ptr2char(p);
+ }
+ }
+ if (enc_utf8) /* produce UTF-8 */
+ {
+ dest -= utf_char2len(u8c);
+ (void)utf_char2bytes(u8c, dest);
+ }
+ else /* produce Latin1 */
+ {
+ --dest;
+ if (u8c >= 0x100)
+ {
+ /* character doesn't fit in latin1, retry with
+ * another fenc when possible, otherwise just
+ * report the error. */
+ if (can_retry && !keep_dest_enc)
+ goto rewind_retry;
+ *dest = 0xBF;
+ conv_error = TRUE;
+ }
+ else
+ *dest = u8c;
+ }
+ }
+
+ /* move the linerest to before the converted characters */
+ line_start = dest - linerest;
+ mch_memmove(line_start, buffer, (size_t)linerest);
+ size = (long)((ptr + real_size) - dest);
+ ptr = dest;
+ }
+ else if (enc_utf8 && !conv_error && !curbuf->b_p_bin)
+ {
+ /* Reading UTF-8: Check if the bytes are valid UTF-8.
+ * Need to start before "ptr" when part of the character was
+ * read in the previous read() call. */
+ for (p = ptr - utf_head_off(buffer, ptr); p < ptr + size; ++p)
+ {
+ if (*p >= 0x80)
+ {
+ len = utf_ptr2len_check(p);
+ /* A length of 1 means it's an illegal byte. Accept
+ * an incomplete character at the end though, the next
+ * read() will get the next bytes, we'll check it
+ * then. */
+ if (len == 1)
+ {
+ p += utf_byte2len(*p) - 1;
+ break;
+ }
+ p += len - 1;
+ }
+ }
+ if (p < ptr + size)
+ {
+ /* Detected a UTF-8 error. */
+ if (can_retry)
+ {
+rewind_retry:
+ /* Retry reading with another conversion. */
+# if defined(FEAT_EVAL) && defined(USE_ICONV)
+ if (*p_ccv != NUL && iconv_fd != (iconv_t)-1)
+ /* iconv() failed, try 'charconvert' */
+ did_iconv = TRUE;
+ else
+# endif
+ /* use next item from 'fileencodings' */
+ advance_fenc = TRUE;
+ file_rewind = TRUE;
+ goto retry;
+ }
+
+ /* There is no alternative fenc, just report the error. */
+# ifdef USE_ICONV
+ if (iconv_fd != (iconv_t)-1)
+ conv_error = TRUE;
+ else
+# endif
+ {
+ char_u *s;
+
+ /* Estimate the line number. */
+ illegal_byte = curbuf->b_ml.ml_line_count - linecnt + 1;
+ for (s = ptr; s < p; ++s)
+ if (*s == '\n')
+ ++illegal_byte;
+ }
+ }
+ }
+#endif
+
+ /* count the number of characters (after conversion!) */
+ filesize += size;
+
+ /*
+ * when reading the first part of a file: guess EOL type
+ */
+ if (fileformat == EOL_UNKNOWN)
+ {
+ /* First try finding a NL, for Dos and Unix */
+ if (try_dos || try_unix)
+ {
+ for (p = ptr; p < ptr + size; ++p)
+ {
+ if (*p == NL)
+ {
+ if (!try_unix
+ || (try_dos && p > ptr && p[-1] == CAR))
+ fileformat = EOL_DOS;
+ else
+ fileformat = EOL_UNIX;
+ break;
+ }
+ }
+
+ /* Don't give in to EOL_UNIX if EOL_MAC is more likely */
+ if (fileformat == EOL_UNIX && try_mac)
+ {
+ /* Need to reset the counters when retrying fenc. */
+ try_mac = 1;
+ try_unix = 1;
+ for (; p >= ptr && *p != CAR; p--)
+ ;
+ if (p >= ptr)
+ {
+ for (p = ptr; p < ptr + size; ++p)
+ {
+ if (*p == NL)
+ try_unix++;
+ else if (*p == CAR)
+ try_mac++;
+ }
+ if (try_mac > try_unix)
+ fileformat = EOL_MAC;
+ }
+ }
+ }
+
+ /* No NL found: may use Mac format */
+ if (fileformat == EOL_UNKNOWN && try_mac)
+ fileformat = EOL_MAC;
+
+ /* Still nothing found? Use first format in 'ffs' */
+ if (fileformat == EOL_UNKNOWN)
+ fileformat = default_fileformat();
+
+ /* if editing a new file: may set p_tx and p_ff */
+ if (newfile)
+ set_fileformat(fileformat, OPT_LOCAL);
+ }
+ }
+
+ /*
+ * This loop is executed once for every character read.
+ * Keep it fast!
+ */
+ if (fileformat == EOL_MAC)
+ {
+ --ptr;
+ while (++ptr, --size >= 0)
+ {
+ /* catch most common case first */
+ if ((c = *ptr) != NUL && c != CAR && c != NL)
+ continue;
+ if (c == NUL)
+ *ptr = NL; /* NULs are replaced by newlines! */
+ else if (c == NL)
+ *ptr = CAR; /* NLs are replaced by CRs! */
+ else
+ {
+ if (skip_count == 0)
+ {
+ *ptr = NUL; /* end of line */
+ len = (colnr_T) (ptr - line_start + 1);
+ if (ml_append(lnum, line_start, len, newfile) == FAIL)
+ {
+ error = TRUE;
+ break;
+ }
+ ++lnum;
+ if (--read_count == 0)
+ {
+ error = TRUE; /* break loop */
+ line_start = ptr; /* nothing left to write */
+ break;
+ }
+ }
+ else
+ --skip_count;
+ line_start = ptr + 1;
+ }
+ }
+ }
+ else
+ {
+ --ptr;
+ while (++ptr, --size >= 0)
+ {
+ if ((c = *ptr) != NUL && c != NL) /* catch most common case */
+ continue;
+ if (c == NUL)
+ *ptr = NL; /* NULs are replaced by newlines! */
+ else
+ {
+ if (skip_count == 0)
+ {
+ *ptr = NUL; /* end of line */
+ len = (colnr_T)(ptr - line_start + 1);
+ if (fileformat == EOL_DOS)
+ {
+ if (ptr[-1] == CAR) /* remove CR */
+ {
+ ptr[-1] = NUL;
+ --len;
+ }
+ /*
+ * Reading in Dos format, but no CR-LF found!
+ * When 'fileformats' includes "unix", delete all
+ * the lines read so far and start all over again.
+ * Otherwise give an error message later.
+ */
+ else if (ff_error != EOL_DOS)
+ {
+ if ( try_unix
+ && !read_stdin
+ && (read_buffer
+ || lseek(fd, (off_t)0L, SEEK_SET) == 0))
+ {
+ fileformat = EOL_UNIX;
+ if (newfile)
+ set_fileformat(EOL_UNIX, OPT_LOCAL);
+ file_rewind = TRUE;
+ keep_fileformat = TRUE;
+ goto retry;
+ }
+ ff_error = EOL_DOS;
+ }
+ }
+ if (ml_append(lnum, line_start, len, newfile) == FAIL)
+ {
+ error = TRUE;
+ break;
+ }
+ ++lnum;
+ if (--read_count == 0)
+ {
+ error = TRUE; /* break loop */
+ line_start = ptr; /* nothing left to write */
+ break;
+ }
+ }
+ else
+ --skip_count;
+ line_start = ptr + 1;
+ }
+ }
+ }
+ linerest = (long)(ptr - line_start);
+ ui_breakcheck();
+ }
+
+failed:
+ /* not an error, max. number of lines reached */
+ if (error && read_count == 0)
+ error = FALSE;
+
+ /*
+ * If we get EOF in the middle of a line, note the fact and
+ * complete the line ourselves.
+ * In Dos format ignore a trailing CTRL-Z, unless 'binary' set.
+ */
+ if (!error
+ && !got_int
+ && linerest != 0
+ && !(!curbuf->b_p_bin
+ && fileformat == EOL_DOS
+ && *line_start == Ctrl_Z
+ && ptr == line_start + 1))
+ {
+ if (newfile) /* remember for when writing */
+ curbuf->b_p_eol = FALSE;
+ *ptr = NUL;
+ if (ml_append(lnum, line_start,
+ (colnr_T)(ptr - line_start + 1), newfile) == FAIL)
+ error = TRUE;
+ else
+ read_no_eol_lnum = ++lnum;
+ }
+
+ if (newfile)
+ save_file_ff(curbuf); /* remember the current file format */
+
+#ifdef FEAT_CRYPT
+ if (cryptkey != curbuf->b_p_key)
+ vim_free(cryptkey);
+#endif
+
+#ifdef FEAT_MBYTE
+ /* If editing a new file: set 'fenc' for the current buffer. */
+ if (newfile)
+ set_string_option_direct((char_u *)"fenc", -1, fenc,
+ OPT_FREE|OPT_LOCAL);
+ if (fenc_alloced)
+ vim_free(fenc);
+# ifdef USE_ICONV
+ if (iconv_fd != (iconv_t)-1)
+ {
+ iconv_close(iconv_fd);
+ iconv_fd = (iconv_t)-1;
+ }
+# endif
+#endif
+
+ if (!read_buffer && !read_stdin)
+ close(fd); /* errors are ignored */
+ vim_free(buffer);
+
+#ifdef HAVE_DUP
+ if (read_stdin)
+ {
+ /* Use stderr for stdin, makes shell commands work. */
+ close(0);
+ dup(2);
+ }
+#endif
+
+#ifdef FEAT_MBYTE
+ if (tmpname != NULL)
+ {
+ mch_remove(tmpname); /* delete converted file */
+ vim_free(tmpname);
+ }
+#endif
+ --no_wait_return; /* may wait for return now */
+
+ /*
+ * In recovery mode everything but autocommands is skipped.
+ */
+ if (!recoverymode)
+ {
+ /* need to delete the last line, which comes from the empty buffer */
+ if (newfile && wasempty && !(curbuf->b_ml.ml_flags & ML_EMPTY))
+ {
+#ifdef FEAT_NETBEANS_INTG
+ netbeansFireChanges = 0;
+#endif
+ ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+#ifdef FEAT_NETBEANS_INTG
+ netbeansFireChanges = 1;
+#endif
+ --linecnt;
+ }
+ linecnt = curbuf->b_ml.ml_line_count - linecnt;
+ if (filesize == 0)
+ linecnt = 0;
+ if (newfile || read_buffer)
+ redraw_curbuf_later(NOT_VALID);
+ else if (linecnt) /* appended at least one line */
+ appended_lines_mark(from, linecnt);
+
+#ifdef FEAT_DIFF
+ /* After reading the text into the buffer the diff info needs to be
+ * updated. */
+ if ((newfile || read_buffer))
+ diff_invalidate();
+#endif
+#ifndef ALWAYS_USE_GUI
+ /*
+ * If we were reading from the same terminal as where messages go,
+ * the screen will have been messed up.
+ * Switch on raw mode now and clear the screen.
+ */
+ if (read_stdin)
+ {
+ settmode(TMODE_RAW); /* set to raw mode */
+ starttermcap();
+ screenclear();
+ }
+#endif
+
+ if (got_int)
+ {
+ if (!(flags & READ_DUMMY))
+ {
+ filemess(curbuf, sfname, (char_u *)_(e_interr), 0);
+ if (newfile)
+ curbuf->b_p_ro = TRUE; /* must use "w!" now */
+ }
+ msg_scroll = msg_save;
+#ifdef FEAT_VIMINFO
+ check_marks_read();
+#endif
+ return OK; /* an interrupt isn't really an error */
+ }
+
+ if (!filtering && !(flags & READ_DUMMY))
+ {
+ msg_add_fname(curbuf, sfname); /* fname in IObuff with quotes */
+ c = FALSE;
+
+#ifdef UNIX
+# ifdef S_ISFIFO
+ if (S_ISFIFO(perm)) /* fifo or socket */
+ {
+ STRCAT(IObuff, _("[fifo/socket]"));
+ c = TRUE;
+ }
+# else
+# ifdef S_IFIFO
+ if ((perm & S_IFMT) == S_IFIFO) /* fifo */
+ {
+ STRCAT(IObuff, _("[fifo]"));
+ c = TRUE;
+ }
+# endif
+# ifdef S_IFSOCK
+ if ((perm & S_IFMT) == S_IFSOCK) /* or socket */
+ {
+ STRCAT(IObuff, _("[socket]"));
+ c = TRUE;
+ }
+# endif
+# endif
+#endif
+ if (curbuf->b_p_ro)
+ {
+ STRCAT(IObuff, shortmess(SHM_RO) ? _("[RO]") : _("[readonly]"));
+ c = TRUE;
+ }
+ if (read_no_eol_lnum)
+ {
+ msg_add_eol();
+ c = TRUE;
+ }
+ if (ff_error == EOL_DOS)
+ {
+ STRCAT(IObuff, _("[CR missing]"));
+ c = TRUE;
+ }
+ if (ff_error == EOL_MAC)
+ {
+ STRCAT(IObuff, _("[NL found]"));
+ c = TRUE;
+ }
+ if (split)
+ {
+ STRCAT(IObuff, _("[long lines split]"));
+ c = TRUE;
+ }
+#ifdef FEAT_MBYTE
+ if (notconverted)
+ {
+ STRCAT(IObuff, _("[NOT converted]"));
+ c = TRUE;
+ }
+ else if (converted)
+ {
+ STRCAT(IObuff, _("[converted]"));
+ c = TRUE;
+ }
+#endif
+#ifdef FEAT_CRYPT
+ if (cryptkey != NULL)
+ {
+ STRCAT(IObuff, _("[crypted]"));
+ c = TRUE;
+ }
+#endif
+#ifdef FEAT_MBYTE
+ if (conv_error)
+ {
+ STRCAT(IObuff, _("[CONVERSION ERROR]"));
+ c = TRUE;
+ }
+ else if (illegal_byte > 0)
+ {
+ sprintf((char *)IObuff + STRLEN(IObuff),
+ _("[ILLEGAL BYTE in line %ld]"), (long)illegal_byte);
+ c = TRUE;
+ }
+ else
+#endif
+ if (error)
+ {
+ STRCAT(IObuff, _("[READ ERRORS]"));
+ c = TRUE;
+ }
+ if (msg_add_fileformat(fileformat))
+ c = TRUE;
+#ifdef FEAT_CRYPT
+ if (cryptkey != NULL)
+ msg_add_lines(c, (long)linecnt, filesize - CRYPT_MAGIC_LEN);
+ else
+#endif
+ msg_add_lines(c, (long)linecnt, filesize);
+
+ vim_free(keep_msg);
+ keep_msg = NULL;
+ msg_scrolled_ign = TRUE;
+#ifdef ALWAYS_USE_GUI
+ /* Don't show the message when reading stdin, it would end up in a
+ * message box (which might be shown when exiting!) */
+ if (read_stdin || read_buffer)
+ p = msg_may_trunc(FALSE, IObuff);
+ else
+#endif
+ p = msg_trunc_attr(IObuff, FALSE, 0);
+ if (read_stdin || read_buffer || restart_edit != 0
+ || (msg_scrolled && !need_wait_return))
+ {
+ /* Need to repeat the message after redrawing when:
+ * - When reading from stdin (the screen will be cleared next).
+ * - When restart_edit is set (otherwise there will be a delay
+ * before redrawing).
+ * - When the screen was scrolled but there is no wait-return
+ * prompt. */
+ set_keep_msg(p);
+ keep_msg_attr = 0;
+ }
+ msg_scrolled_ign = FALSE;
+ }
+
+ /* with errors writing the file requires ":w!" */
+ if (newfile && (error
+#ifdef FEAT_MBYTE
+ || conv_error
+#endif
+ ))
+ curbuf->b_p_ro = TRUE;
+
+ u_clearline(); /* cannot use "U" command after adding lines */
+
+ /*
+ * In Ex mode: cursor at last new line.
+ * Otherwise: cursor at first new line.
+ */
+ if (exmode_active)
+ curwin->w_cursor.lnum = from + linecnt;
+ else
+ curwin->w_cursor.lnum = from + 1;
+ check_cursor_lnum();
+ beginline(BL_WHITE | BL_FIX); /* on first non-blank */
+
+ /*
+ * Set '[ and '] marks to the newly read lines.
+ */
+ curbuf->b_op_start.lnum = from + 1;
+ curbuf->b_op_start.col = 0;
+ curbuf->b_op_end.lnum = from + linecnt;
+ curbuf->b_op_end.col = 0;
+ }
+ msg_scroll = msg_save;
+
+#ifdef FEAT_VIMINFO
+ /*
+ * Get the marks before executing autocommands, so they can be used there.
+ */
+ check_marks_read();
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /*
+ * Trick: We remember if the last line of the read didn't have
+ * an eol for when writing it again. This is required for
+ * ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work.
+ */
+ write_no_eol_lnum = read_no_eol_lnum;
+
+ if (!read_stdin && !read_buffer)
+ {
+ int m = msg_scroll;
+ int n = msg_scrolled;
+
+ /* Save the fileformat now, otherwise the buffer will be considered
+ * modified if the format/encoding was automatically detected. */
+ if (newfile)
+ save_file_ff(curbuf);
+
+ /*
+ * The output from the autocommands should not overwrite anything and
+ * should not be overwritten: Set msg_scroll, restore its value if no
+ * output was done.
+ */
+ msg_scroll = TRUE;
+ if (filtering)
+ apply_autocmds_exarg(EVENT_FILTERREADPOST, NULL, sfname,
+ FALSE, curbuf, eap);
+ else if (newfile)
+ apply_autocmds_exarg(EVENT_BUFREADPOST, NULL, sfname,
+ FALSE, curbuf, eap);
+ else
+ apply_autocmds_exarg(EVENT_FILEREADPOST, sfname, sfname,
+ FALSE, NULL, eap);
+ if (msg_scrolled == n)
+ msg_scroll = m;
+#ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return FAIL;
+#endif
+ }
+#endif
+
+ if (recoverymode && error)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Fill "*eap" to force the 'fileencoding' and 'fileformat' to be equal to the
+ * buffer "buf". Used for calling readfile().
+ * Returns OK or FAIL.
+ */
+ int
+prep_exarg(eap, buf)
+ exarg_T *eap;
+ buf_T *buf;
+{
+ eap->cmd = alloc((unsigned)(STRLEN(buf->b_p_ff)
+#ifdef FEAT_MBYTE
+ + STRLEN(buf->b_p_fenc)
+#endif
+ + 15));
+ if (eap->cmd == NULL)
+ return FAIL;
+
+#ifdef FEAT_MBYTE
+ sprintf((char *)eap->cmd, "e ++ff=%s ++enc=%s", buf->b_p_ff, buf->b_p_fenc);
+ eap->force_enc = 14 + (int)STRLEN(buf->b_p_ff);
+#else
+ sprintf((char *)eap->cmd, "e ++ff=%s", buf->b_p_ff);
+#endif
+ eap->force_ff = 7;
+ return OK;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Find next fileencoding to use from 'fileencodings'.
+ * "pp" points to fenc_next. It's advanced to the next item.
+ * When there are no more items, an empty string is returned and *pp is set to
+ * NULL.
+ * When *pp is not set to NULL, the result is in allocated memory.
+ */
+ static char_u *
+next_fenc(pp)
+ char_u **pp;
+{
+ char_u *p;
+ char_u *r;
+
+ if (**pp == NUL)
+ {
+ *pp = NULL;
+ return (char_u *)"";
+ }
+ p = vim_strchr(*pp, ',');
+ if (p == NULL)
+ {
+ r = enc_canonize(*pp);
+ *pp += STRLEN(*pp);
+ }
+ else
+ {
+ r = vim_strnsave(*pp, (int)(p - *pp));
+ *pp = p + 1;
+ if (r != NULL)
+ {
+ p = enc_canonize(r);
+ vim_free(r);
+ r = p;
+ }
+ }
+ if (r == NULL) /* out of memory */
+ {
+ r = (char_u *)"";
+ *pp = NULL;
+ }
+ return r;
+}
+
+# ifdef FEAT_EVAL
+/*
+ * Convert a file with the 'charconvert' expression.
+ * This closes the file which is to be read, converts it and opens the
+ * resulting file for reading.
+ * Returns name of the resulting converted file (the caller should delete it
+ * after reading it).
+ * Returns NULL if the conversion failed ("*fdp" is not set) .
+ */
+ static char_u *
+readfile_charconvert(fname, fenc, fdp)
+ char_u *fname; /* name of input file */
+ char_u *fenc; /* converted from */
+ int *fdp; /* in/out: file descriptor of file */
+{
+ char_u *tmpname;
+ char_u *errmsg = NULL;
+
+ tmpname = vim_tempname('r');
+ if (tmpname == NULL)
+ errmsg = (char_u *)_("Can't find temp file for conversion");
+ else
+ {
+ close(*fdp); /* close the input file, ignore errors */
+ *fdp = -1;
+ if (eval_charconvert(fenc, enc_utf8 ? (char_u *)"utf-8" : p_enc,
+ fname, tmpname) == FAIL)
+ errmsg = (char_u *)_("Conversion with 'charconvert' failed");
+ if (errmsg == NULL && (*fdp = mch_open((char *)tmpname,
+ O_RDONLY | O_EXTRA, 0)) < 0)
+ errmsg = (char_u *)_("can't read output of 'charconvert'");
+ }
+
+ if (errmsg != NULL)
+ {
+ /* Don't use emsg(), it breaks mappings, the retry with
+ * another type of conversion might still work. */
+ MSG(errmsg);
+ if (tmpname != NULL)
+ {
+ mch_remove(tmpname); /* delete converted file */
+ vim_free(tmpname);
+ tmpname = NULL;
+ }
+ }
+
+ /* If the input file is closed, open it (caller should check for error). */
+ if (*fdp < 0)
+ *fdp = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+
+ return tmpname;
+}
+# endif
+
+#endif
+
+#ifdef FEAT_VIMINFO
+/*
+ * Read marks for the current buffer from the viminfo file, when we support
+ * buffer marks and the buffer has a name.
+ */
+ static void
+check_marks_read()
+{
+ if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
+ && curbuf->b_ffname != NULL)
+ read_viminfo(NULL, FALSE, TRUE, FALSE);
+
+ /* Always set b_marks_read; needed when 'viminfo' is changed to include
+ * the ' parameter after opening a buffer. */
+ curbuf->b_marks_read = TRUE;
+}
+#endif
+
+#ifdef FEAT_CRYPT
+/*
+ * Check for magic number used for encryption.
+ * If found, the magic number is removed from ptr[*sizep] and *sizep and
+ * *filesizep are updated.
+ * Return the (new) encryption key, NULL for no encryption.
+ */
+ static char_u *
+check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile)
+ char_u *cryptkey; /* previous encryption key or NULL */
+ char_u *ptr; /* pointer to read bytes */
+ long *sizep; /* length of read bytes */
+ long *filesizep; /* nr of bytes used from file */
+ int newfile; /* editing a new buffer */
+{
+ if (*sizep >= CRYPT_MAGIC_LEN
+ && STRNCMP(ptr, CRYPT_MAGIC, CRYPT_MAGIC_LEN) == 0)
+ {
+ if (cryptkey == NULL)
+ {
+ if (*curbuf->b_p_key)
+ cryptkey = curbuf->b_p_key;
+ else
+ {
+ /* When newfile is TRUE, store the typed key
+ * in the 'key' option and don't free it. */
+ cryptkey = get_crypt_key(newfile, FALSE);
+ /* check if empty key entered */
+ if (cryptkey != NULL && *cryptkey == NUL)
+ {
+ if (cryptkey != curbuf->b_p_key)
+ vim_free(cryptkey);
+ cryptkey = NULL;
+ }
+ }
+ }
+
+ if (cryptkey != NULL)
+ {
+ crypt_init_keys(cryptkey);
+
+ /* Remove magic number from the text */
+ *filesizep += CRYPT_MAGIC_LEN;
+ *sizep -= CRYPT_MAGIC_LEN;
+ mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN, (size_t)*sizep);
+ }
+ }
+ /* When starting to edit a new file which does not have
+ * encryption, clear the 'key' option, except when
+ * starting up (called with -x argument) */
+ else if (newfile && *curbuf->b_p_key && !starting)
+ set_option_value((char_u *)"key", 0L, (char_u *)"", OPT_LOCAL);
+
+ return cryptkey;
+}
+#endif
+
+#ifdef UNIX
+ static void
+set_file_time(fname, atime, mtime)
+ char_u *fname;
+ time_t atime; /* access time */
+ time_t mtime; /* modification time */
+{
+# if defined(HAVE_UTIME) && defined(HAVE_UTIME_H)
+ struct utimbuf buf;
+
+ buf.actime = atime;
+ buf.modtime = mtime;
+ (void)utime((char *)fname, &buf);
+# else
+# if defined(HAVE_UTIMES)
+ struct timeval tvp[2];
+
+ tvp[0].tv_sec = atime;
+ tvp[0].tv_usec = 0;
+ tvp[1].tv_sec = mtime;
+ tvp[1].tv_usec = 0;
+# ifdef NeXT
+ (void)utimes((char *)fname, tvp);
+# else
+ (void)utimes((char *)fname, (const struct timeval *)&tvp);
+# endif
+# endif
+# endif
+}
+#endif /* UNIX */
+
+/*
+ * buf_write() - write to file 'fname' lines 'start' through 'end'
+ *
+ * We do our own buffering here because fwrite() is so slow.
+ *
+ * If forceit is true, we don't care for errors when attempting backups (jw).
+ * In case of an error everything possible is done to restore the original file.
+ * But when forceit is TRUE, we risk loosing it.
+ * When reset_changed is TRUE and start == 1 and end ==
+ * curbuf->b_ml.ml_line_count, reset curbuf->b_changed.
+ *
+ * This function must NOT use NameBuff (because it's called by autowrite()).
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+buf_write(buf, fname, sfname, start, end, eap, append, forceit,
+ reset_changed, filtering)
+ buf_T *buf;
+ char_u *fname;
+ char_u *sfname;
+ linenr_T start, end;
+ exarg_T *eap; /* for forced 'ff' and 'fenc', can be
+ NULL! */
+ int append;
+ int forceit;
+ int reset_changed;
+ int filtering;
+{
+ int fd;
+ char_u *backup = NULL;
+ int backup_copy = FALSE; /* copy the original file? */
+ int dobackup;
+ char_u *ffname;
+ char_u *wfname = NULL; /* name of file to write to */
+ char_u *s;
+ char_u *ptr;
+ char_u c;
+ int len;
+ linenr_T lnum;
+ long nchars;
+ char_u *errmsg = NULL;
+ char_u *errnum = NULL;
+ char_u *buffer;
+ char_u smallbuf[SMBUFSIZE];
+ char_u *backup_ext;
+ int bufsize;
+ long perm; /* file permissions */
+ int retval = OK;
+ int newfile = FALSE; /* TRUE if file doesn't exist yet */
+ int msg_save = msg_scroll;
+ int overwriting; /* TRUE if writing over original */
+ int no_eol = FALSE; /* no end-of-line written */
+ int device = FALSE; /* writing to a device */
+ struct stat st_old;
+ int prev_got_int = got_int;
+ int file_readonly = FALSE; /* overwritten file is read-only */
+ static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
+#if defined(UNIX) || defined(__EMX__XX) /*XXX fix me sometime? */
+ int made_writable = FALSE; /* 'w' bit has been set */
+#endif
+ /* writing everything */
+ int whole = (start == 1 && end == buf->b_ml.ml_line_count);
+#ifdef FEAT_AUTOCMD
+ linenr_T old_line_count = buf->b_ml.ml_line_count;
+#endif
+ int attr;
+ int fileformat;
+ int write_bin;
+ struct bw_info write_info; /* info for buf_write_bytes() */
+#ifdef FEAT_MBYTE
+ int converted = FALSE;
+ int notconverted = FALSE;
+ char_u *fenc; /* effective 'fileencoding' */
+ char_u *fenc_tofree = NULL; /* allocated "fenc" */
+#endif
+#ifdef HAS_BW_FLAGS
+ int wb_flags = 0;
+#endif
+#ifdef HAVE_ACL
+ vim_acl_T acl = NULL; /* ACL copied from original file to
+ backup or new file */
+#endif
+
+ if (fname == NULL || *fname == NUL) /* safety check */
+ return FAIL;
+
+ /*
+ * Disallow writing from .exrc and .vimrc in current directory for
+ * security reasons.
+ */
+ if (check_secure())
+ return FAIL;
+
+ /* Avoid a crash for a long name. */
+ if (STRLEN(fname) >= MAXPATHL)
+ {
+ EMSG(_(e_longname));
+ return FAIL;
+ }
+
+#ifdef FEAT_MBYTE
+ /* must init bw_conv_buf and bw_iconv_fd before jumping to "fail" */
+ write_info.bw_conv_buf = NULL;
+ write_info.bw_conv_error = FALSE;
+ write_info.bw_restlen = 0;
+# ifdef USE_ICONV
+ write_info.bw_iconv_fd = (iconv_t)-1;
+# endif
+#endif
+
+ /*
+ * If there is no file name yet, use the one for the written file.
+ * BF_NOTEDITED is set to reflect this (in case the write fails).
+ * Don't do this when the write is for a filter command.
+ * Only do this when 'cpoptions' contains the 'f' flag.
+ */
+ if (reset_changed
+ && whole
+ && buf == curbuf
+ && curbuf->b_ffname == NULL
+ && !filtering
+ && vim_strchr(p_cpo, CPO_FNAMEW) != NULL)
+ {
+#ifdef FEAT_AUTOCMD
+ /* It's like the unnamed buffer is deleted.... */
+ if (curbuf->b_p_bl)
+ apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
+ apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
+#ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return FAIL;
+#endif
+#endif
+ if (setfname(curbuf, fname, sfname, FALSE) == OK)
+ curbuf->b_flags |= BF_NOTEDITED;
+#ifdef FEAT_AUTOCMD
+ /* ....and a new named one is created */
+ apply_autocmds(EVENT_BUFNEW, NULL, NULL, FALSE, curbuf);
+ if (curbuf->b_p_bl)
+ apply_autocmds(EVENT_BUFADD, NULL, NULL, FALSE, curbuf);
+#endif
+ }
+
+ if (sfname == NULL)
+ sfname = fname;
+ /*
+ * For Unix: Use the short file name whenever possible.
+ * Avoids problems with networks and when directory names are changed.
+ * Don't do this for MS-DOS, a "cd" in a sub-shell may have moved us to
+ * another directory, which we don't detect
+ */
+ ffname = fname; /* remember full fname */
+#ifdef UNIX
+ fname = sfname;
+#endif
+
+ if (buf->b_ffname != NULL && fnamecmp(ffname, buf->b_ffname) == 0)
+ overwriting = TRUE;
+ else
+ overwriting = FALSE;
+
+ if (exiting)
+ settmode(TMODE_COOK); /* when exiting allow typahead now */
+
+ ++no_wait_return; /* don't wait for return yet */
+
+ /*
+ * Set '[ and '] marks to the lines to be written.
+ */
+ buf->b_op_start.lnum = start;
+ buf->b_op_start.col = 0;
+ buf->b_op_end.lnum = end;
+ buf->b_op_end.col = 0;
+
+#ifdef FEAT_AUTOCMD
+ {
+ aco_save_T aco;
+ int buf_ffname = FALSE;
+ int buf_sfname = FALSE;
+ int buf_fname_f = FALSE;
+ int buf_fname_s = FALSE;
+ int did_cmd = FALSE;
+
+ /*
+ * Apply PRE aucocommands.
+ * Set curbuf to the buffer to be written.
+ * Careful: The autocommands may call buf_write() recursively!
+ */
+ if (ffname == buf->b_ffname)
+ buf_ffname = TRUE;
+ if (sfname == buf->b_sfname)
+ buf_sfname = TRUE;
+ if (fname == buf->b_ffname)
+ buf_fname_f = TRUE;
+ if (fname == buf->b_sfname)
+ buf_fname_s = TRUE;
+
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, buf);
+
+ if (append)
+ {
+ if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEAPPENDCMD,
+ sfname, sfname, FALSE, curbuf, eap)))
+ apply_autocmds_exarg(EVENT_FILEAPPENDPRE,
+ sfname, sfname, FALSE, curbuf, eap);
+ }
+ else if (filtering)
+ {
+ apply_autocmds_exarg(EVENT_FILTERWRITEPRE,
+ NULL, sfname, FALSE, curbuf, eap);
+ }
+ else if (reset_changed && whole)
+ {
+ if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD,
+ sfname, sfname, FALSE, curbuf, eap)))
+ apply_autocmds_exarg(EVENT_BUFWRITEPRE,
+ sfname, sfname, FALSE, curbuf, eap);
+ }
+ else
+ {
+ if (!(did_cmd = apply_autocmds_exarg(EVENT_FILEWRITECMD,
+ sfname, sfname, FALSE, curbuf, eap)))
+ apply_autocmds_exarg(EVENT_FILEWRITEPRE,
+ sfname, sfname, FALSE, curbuf, eap);
+ }
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+
+ /*
+ * In three situations we return here and don't write the file:
+ * 1. the autocommands deleted or unloaded the buffer.
+ * 2. The autocommands abort script processing.
+ * 3. If one of the "Cmd" autocommands was executed.
+ */
+ if (!buf_valid(buf))
+ buf = NULL;
+ if (buf == NULL || buf->b_ml.ml_mfp == NULL || did_cmd || aborting())
+ {
+ --no_wait_return;
+ msg_scroll = msg_save;
+ if (aborting())
+ /* An aborting error, interrupt or exception in the
+ * autocommands. */
+ return FAIL;
+ if (did_cmd)
+ {
+ if (buf == NULL)
+ /* The buffer was deleted. We assume it was written
+ * (can't retry anyway). */
+ return OK;
+ if (overwriting)
+ {
+ /* Assume the buffer was written, update the timestamp. */
+ ml_timestamp(buf);
+ buf->b_flags &= ~BF_WRITE_MASK;
+ }
+ if (reset_changed && buf->b_changed)
+ /* Buffer still changed, the autocommands didn't work
+ * properly. */
+ return FAIL;
+ return OK;
+ }
+#ifdef FEAT_EVAL
+ if (!aborting())
+#endif
+ EMSG(_("E203: Autocommands deleted or unloaded buffer to be written"));
+ return FAIL;
+ }
+
+ /*
+ * The autocommands may have changed the number of lines in the file.
+ * When writing the whole file, adjust the end.
+ * When writing part of the file, assume that the autocommands only
+ * changed the number of lines that are to be written (tricky!).
+ */
+ if (buf->b_ml.ml_line_count != old_line_count)
+ {
+ if (whole) /* write all */
+ end = buf->b_ml.ml_line_count;
+ else if (buf->b_ml.ml_line_count > old_line_count) /* more lines */
+ end += buf->b_ml.ml_line_count - old_line_count;
+ else /* less lines */
+ {
+ end -= old_line_count - buf->b_ml.ml_line_count;
+ if (end < start)
+ {
+ --no_wait_return;
+ msg_scroll = msg_save;
+ EMSG(_("E204: Autocommand changed number of lines in unexpected way"));
+ return FAIL;
+ }
+ }
+ }
+
+ /*
+ * The autocommands may have changed the name of the buffer, which may
+ * be kept in fname, ffname and sfname.
+ */
+ if (buf_ffname)
+ ffname = buf->b_ffname;
+ if (buf_sfname)
+ sfname = buf->b_sfname;
+ if (buf_fname_f)
+ fname = buf->b_ffname;
+ if (buf_fname_s)
+ fname = buf->b_sfname;
+ }
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans && isNetbeansBuffer(buf))
+ {
+ if (whole)
+ {
+ /*
+ * b_changed can be 0 after an undo, but we still need to write
+ * the buffer to NetBeans.
+ */
+ if (buf->b_changed || isNetbeansModified(buf))
+ {
+ netbeans_save_buffer(buf);
+ return retval;
+ }
+ else
+ {
+ errnum = (char_u *)"E656: ";
+ errmsg = (char_u *)_("NetBeans dissallows writes of unmodified buffers");
+ buffer = NULL;
+ goto fail;
+ }
+ }
+ else
+ {
+ errnum = (char_u *)"E657: ";
+ errmsg = (char_u *)_("Partial writes disallowed for NetBeans buffers");
+ buffer = NULL;
+ goto fail;
+ }
+ }
+#endif
+
+ if (shortmess(SHM_OVER) && !exiting)
+ msg_scroll = FALSE; /* overwrite previous file message */
+ else
+ msg_scroll = TRUE; /* don't overwrite previous file message */
+ if (!filtering)
+ filemess(buf,
+#ifndef UNIX
+ sfname,
+#else
+ fname,
+#endif
+ (char_u *)"", 0); /* show that we are busy */
+ msg_scroll = FALSE; /* always overwrite the file message now */
+
+ buffer = alloc(BUFSIZE);
+ if (buffer == NULL) /* can't allocate big buffer, use small
+ * one (to be able to write when out of
+ * memory) */
+ {
+ buffer = smallbuf;
+ bufsize = SMBUFSIZE;
+ }
+ else
+ bufsize = BUFSIZE;
+
+ /*
+ * Get information about original file (if there is one).
+ */
+#if defined(UNIX) && !defined(ARCHIE)
+ st_old.st_dev = st_old.st_ino = 0;
+ perm = -1;
+ if (mch_stat((char *)fname, &st_old) < 0)
+ newfile = TRUE;
+ else
+ {
+ perm = st_old.st_mode;
+ if (!S_ISREG(st_old.st_mode)) /* not a file */
+ {
+ if (S_ISDIR(st_old.st_mode))
+ {
+ errnum = (char_u *)"E502: ";
+ errmsg = (char_u *)_("is a directory");
+ goto fail;
+ }
+ if (mch_nodetype(fname) != NODE_WRITABLE)
+ {
+ errnum = (char_u *)"E503: ";
+ errmsg = (char_u *)_("is not a file or writable device");
+ goto fail;
+ }
+ /* It's a device of some kind (or a fifo) which we can write to
+ * but for which we can't make a backup. */
+ device = TRUE;
+ newfile = TRUE;
+ perm = -1;
+ }
+ }
+#else /* !UNIX */
+ /*
+ * Check for a writable device name.
+ */
+ c = mch_nodetype(fname);
+ if (c == NODE_OTHER)
+ {
+ errnum = (char_u *)"E503: ";
+ errmsg = (char_u *)_("is not a file or writable device");
+ goto fail;
+ }
+ if (c == NODE_WRITABLE)
+ {
+ device = TRUE;
+ newfile = TRUE;
+ perm = -1;
+ }
+ else
+ {
+ perm = mch_getperm(fname);
+ if (perm < 0)
+ newfile = TRUE;
+ else if (mch_isdir(fname))
+ {
+ errnum = (char_u *)"E502: ";
+ errmsg = (char_u *)_("is a directory");
+ goto fail;
+ }
+ if (overwriting)
+ (void)mch_stat((char *)fname, &st_old);
+ }
+#endif /* !UNIX */
+
+ if (!device && !newfile)
+ {
+ /*
+ * Check if the file is really writable (when renaming the file to
+ * make a backup we won't discover it later).
+ */
+ file_readonly = (
+# ifdef USE_MCH_ACCESS
+# ifdef UNIX
+ (perm & 0222) == 0 ||
+# endif
+ mch_access((char *)fname, W_OK)
+# else
+ (fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0
+ ? TRUE : (close(fd), FALSE)
+# endif
+ );
+ if (!forceit && file_readonly)
+ {
+ if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)
+ {
+ errnum = (char_u *)"E504: ";
+ errmsg = (char_u *)_(err_readonly);
+ }
+ else
+ {
+ errnum = (char_u *)"E505: ";
+ errmsg = (char_u *)_("is read-only (add ! to override)");
+ }
+ goto fail;
+ }
+
+ /*
+ * Check if the timestamp hasn't changed since reading the file.
+ */
+ if (overwriting)
+ {
+ retval = check_mtime(buf, &st_old);
+ if (retval == FAIL)
+ goto fail;
+ }
+ }
+
+#ifdef HAVE_ACL
+ /*
+ * For systems that support ACL: get the ACL from the original file.
+ */
+ if (!newfile)
+ acl = mch_get_acl(fname);
+#endif
+
+ /*
+ * If 'backupskip' is not empty, don't make a backup for some files.
+ */
+ dobackup = (p_wb || p_bk || *p_pm != NUL);
+#ifdef FEAT_WILDIGN
+ if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname))
+ dobackup = FALSE;
+#endif
+
+ /*
+ * Save the value of got_int and reset it. We don't want a previous
+ * interruption cancel writing, only hitting CTRL-C while writing should
+ * abort it.
+ */
+ prev_got_int = got_int;
+ got_int = FALSE;
+
+ /* Mark the buffer as 'being saved' to prevent changed buffer warnings */
+ buf->b_saving = TRUE;
+
+ /*
+ * If we are not appending or filtering, the file exists, and the
+ * 'writebackup', 'backup' or 'patchmode' option is set, need a backup.
+ * When 'patchmode' is set also make a backup when appending.
+ *
+ * Do not make any backup, if 'writebackup' and 'backup' are both switched
+ * off. This helps when editing large files on almost-full disks.
+ */
+ if (!(append && *p_pm == NUL) && !filtering && perm >= 0 && dobackup)
+ {
+#if defined(UNIX) || defined(WIN32)
+ struct stat st;
+#endif
+
+ if ((bkc_flags & BKC_YES) || append) /* "yes" */
+ backup_copy = TRUE;
+#if defined(UNIX) || defined(WIN32)
+ else if ((bkc_flags & BKC_AUTO)) /* "auto" */
+ {
+ int i;
+
+# ifdef UNIX
+ /*
+ * Don't rename the file when:
+ * - it's a hard link
+ * - it's a symbolic link
+ * - we don't have write permission in the directory
+ * - we can't set the owner/group of the new file
+ */
+ if (st_old.st_nlink > 1
+ || mch_lstat((char *)fname, &st) < 0
+ || st.st_dev != st_old.st_dev
+ || st.st_ino != st_old.st_ino)
+ backup_copy = TRUE;
+ else
+# endif
+ {
+ /*
+ * Check if we can create a file and set the owner/group to
+ * the ones from the original file.
+ * First find a file name that doesn't exist yet (use some
+ * arbitrary numbers).
+ */
+ STRCPY(IObuff, fname);
+ for (i = 4913; ; i += 123)
+ {
+ sprintf((char *)gettail(IObuff), "%d", i);
+ if (mch_stat((char *)IObuff, &st) < 0)
+ break;
+ }
+ fd = mch_open((char *)IObuff, O_CREAT|O_WRONLY|O_EXCL, perm);
+ close(fd);
+ if (fd < 0) /* can't write in directory */
+ backup_copy = TRUE;
+ else
+ {
+# ifdef UNIX
+ chown((char *)IObuff, st_old.st_uid, st_old.st_gid);
+ (void)mch_setperm(IObuff, perm);
+ if (mch_stat((char *)IObuff, &st) < 0
+ || st.st_uid != st_old.st_uid
+ || st.st_gid != st_old.st_gid
+ || st.st_mode != perm)
+ backup_copy = TRUE;
+# endif
+ mch_remove(IObuff);
+ }
+ }
+ }
+
+# ifdef UNIX
+ /*
+ * Break symlinks and/or hardlinks if we've been asked to.
+ */
+ if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK))
+ {
+ int lstat_res;
+
+ lstat_res = mch_lstat((char *)fname, &st);
+
+ /* Symlinks. */
+ if ((bkc_flags & BKC_BREAKSYMLINK)
+ && lstat_res == 0
+ && st.st_ino != st_old.st_ino)
+ backup_copy = FALSE;
+
+ /* Hardlinks. */
+ if ((bkc_flags & BKC_BREAKHARDLINK)
+ && st_old.st_nlink > 1
+ && (lstat_res != 0 || st.st_ino == st_old.st_ino))
+ backup_copy = FALSE;
+ }
+#endif
+
+#endif
+
+ /* make sure we have a valid backup extension to use */
+ if (*p_bex == NUL)
+ {
+#ifdef RISCOS
+ backup_ext = (char_u *)"/bak";
+#else
+ backup_ext = (char_u *)".bak";
+#endif
+ }
+ else
+ backup_ext = p_bex;
+
+ if (backup_copy
+ && (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) >= 0)
+ {
+ int bfd;
+ char_u *copybuf, *wp;
+ int some_error = FALSE;
+ struct stat st_new;
+ char_u *dirp;
+ char_u *rootname;
+#ifndef SHORT_FNAME
+ int did_set_shortname;
+#endif
+
+ copybuf = alloc(BUFSIZE + 1);
+ if (copybuf == NULL)
+ {
+ some_error = TRUE; /* out of memory */
+ goto nobackup;
+ }
+
+ /*
+ * Try to make the backup in each directory in the 'bdir' option.
+ *
+ * Unix semantics has it, that we may have a writable file,
+ * that cannot be recreated with a simple open(..., O_CREAT, ) e.g:
+ * - the directory is not writable,
+ * - the file may be a symbolic link,
+ * - the file may belong to another user/group, etc.
+ *
+ * For these reasons, the existing writable file must be truncated
+ * and reused. Creation of a backup COPY will be attempted.
+ */
+ dirp = p_bdir;
+ while (*dirp)
+ {
+#ifdef UNIX
+ st_new.st_ino = 0;
+ st_new.st_dev = 0;
+ st_new.st_gid = 0;
+#endif
+
+ /*
+ * Isolate one directory name, using an entry in 'bdir'.
+ */
+ (void)copy_option_part(&dirp, copybuf, BUFSIZE, ",");
+ rootname = get_file_in_dir(fname, copybuf);
+ if (rootname == NULL)
+ {
+ some_error = TRUE; /* out of memory */
+ goto nobackup;
+ }
+
+#ifndef SHORT_FNAME
+ did_set_shortname = FALSE;
+#endif
+
+ /*
+ * May try twice if 'shortname' not set.
+ */
+ for (;;)
+ {
+ /*
+ * Make backup file name.
+ */
+ backup = buf_modname(
+#ifdef SHORT_FNAME
+ TRUE,
+#else
+ (buf->b_p_sn || buf->b_shortname),
+#endif
+ rootname, backup_ext, FALSE);
+ if (backup == NULL)
+ {
+ vim_free(rootname);
+ some_error = TRUE; /* out of memory */
+ goto nobackup;
+ }
+
+ /*
+ * Check if backup file already exists.
+ */
+ if (mch_stat((char *)backup, &st_new) >= 0)
+ {
+#ifdef UNIX
+ /*
+ * Check if backup file is same as original file.
+ * May happen when modname() gave the same file back.
+ * E.g. silly link, or file name-length reached.
+ * If we don't check here, we either ruin the file
+ * when copying or erase it after writing. jw.
+ */
+ if (st_new.st_dev == st_old.st_dev
+ && st_new.st_ino == st_old.st_ino)
+ {
+ vim_free(backup);
+ backup = NULL; /* no backup file to delete */
+# ifndef SHORT_FNAME
+ /*
+ * may try again with 'shortname' set
+ */
+ if (!(buf->b_shortname || buf->b_p_sn))
+ {
+ buf->b_shortname = TRUE;
+ did_set_shortname = TRUE;
+ continue;
+ }
+ /* setting shortname didn't help */
+ if (did_set_shortname)
+ buf->b_shortname = FALSE;
+# endif
+ break;
+ }
+#endif
+
+ /*
+ * If we are not going to keep the backup file, don't
+ * delete an existing one, try to use another name.
+ * Change one character, just before the extension.
+ */
+ if (!p_bk)
+ {
+ wp = backup + STRLEN(backup) - 1
+ - STRLEN(backup_ext);
+ if (wp < backup) /* empty file name ??? */
+ wp = backup;
+ *wp = 'z';
+ while (*wp > 'a'
+ && mch_stat((char *)backup, &st_new) >= 0)
+ --*wp;
+ /* They all exist??? Must be something wrong. */
+ if (*wp == 'a')
+ {
+ vim_free(backup);
+ backup = NULL;
+ }
+ }
+ }
+ break;
+ }
+ vim_free(rootname);
+
+ /*
+ * Try to create the backup file
+ */
+ if (backup != NULL)
+ {
+ /* remove old backup, if present */
+ mch_remove(backup);
+ /* Open with O_EXCL to avoid the file being created while
+ * we were sleeping (symlink hacker attack?) */
+ bfd = mch_open((char *)backup,
+ O_WRONLY|O_CREAT|O_EXTRA|O_EXCL, 0666);
+ if (bfd < 0)
+ {
+ vim_free(backup);
+ backup = NULL;
+ }
+ else
+ {
+ /* set file protection same as original file, but
+ * strip s-bit */
+ (void)mch_setperm(backup, perm & 0777);
+
+#ifdef UNIX
+ /*
+ * Try to set the group of the backup same as the
+ * original file. If this fails, set the protection
+ * bits for the group same as the protection bits for
+ * others.
+ */
+ if (st_new.st_gid != st_old.st_gid &&
+# ifdef HAVE_FCHOWN /* sequent-ptx lacks fchown() */
+ fchown(bfd, (uid_t)-1, st_old.st_gid) != 0
+# else
+ chown((char *)backup, (uid_t)-1, st_old.st_gid) != 0
+# endif
+ )
+ mch_setperm(backup,
+ (perm & 0707) | ((perm & 07) << 3));
+#endif
+
+ /*
+ * copy the file.
+ */
+ write_info.bw_fd = bfd;
+ write_info.bw_buf = copybuf;
+#ifdef HAS_BW_FLAGS
+ write_info.bw_flags = FIO_NOCONVERT;
+#endif
+ while ((write_info.bw_len = vim_read(fd, copybuf,
+ BUFSIZE)) > 0)
+ {
+ if (buf_write_bytes(&write_info) == FAIL)
+ {
+ errmsg = (char_u *)_("E506: Can't write to backup file (add ! to override)");
+ break;
+ }
+ ui_breakcheck();
+ if (got_int)
+ {
+ errmsg = (char_u *)_(e_interr);
+ break;
+ }
+ }
+
+ if (close(bfd) < 0 && errmsg == NULL)
+ errmsg = (char_u *)_("E507: Close error for backup file (add ! to override)");
+ if (write_info.bw_len < 0)
+ errmsg = (char_u *)_("E508: Can't read file for backup (add ! to override)");
+#ifdef UNIX
+ set_file_time(backup, st_old.st_atime, st_old.st_mtime);
+#endif
+#ifdef HAVE_ACL
+ mch_set_acl(backup, acl);
+#endif
+ break;
+ }
+ }
+ }
+ nobackup:
+ close(fd); /* ignore errors for closing read file */
+ vim_free(copybuf);
+
+ if (backup == NULL && errmsg == NULL)
+ errmsg = (char_u *)_("E509: Cannot create backup file (add ! to override)");
+ /* ignore errors when forceit is TRUE */
+ if ((some_error || errmsg != NULL) && !forceit)
+ {
+ retval = FAIL;
+ goto fail;
+ }
+ errmsg = NULL;
+ }
+ else
+ {
+ char_u *dirp;
+ char_u *p;
+ char_u *rootname;
+
+ /*
+ * Make a backup by renaming the original file.
+ */
+ /*
+ * If 'cpoptions' includes the "W" flag, we don't want to
+ * overwrite a read-only file. But rename may be possible
+ * anyway, thus we need an extra check here.
+ */
+ if (file_readonly && vim_strchr(p_cpo, CPO_FWRITE) != NULL)
+ {
+ errnum = (char_u *)"E504: ";
+ errmsg = (char_u *)_(err_readonly);
+ goto fail;
+ }
+
+ /*
+ *
+ * Form the backup file name - change path/fo.o.h to
+ * path/fo.o.h.bak Try all directories in 'backupdir', first one
+ * that works is used.
+ */
+ dirp = p_bdir;
+ while (*dirp)
+ {
+ /*
+ * Isolate one directory name and make the backup file name.
+ */
+ (void)copy_option_part(&dirp, IObuff, IOSIZE, ",");
+ rootname = get_file_in_dir(fname, IObuff);
+ if (rootname == NULL)
+ backup = NULL;
+ else
+ {
+ backup = buf_modname(
+#ifdef SHORT_FNAME
+ TRUE,
+#else
+ (buf->b_p_sn || buf->b_shortname),
+#endif
+ rootname, backup_ext, FALSE);
+ vim_free(rootname);
+ }
+
+ if (backup != NULL)
+ {
+ /*
+ * If we are not going to keep the backup file, don't
+ * delete an existing one, try to use another name.
+ * Change one character, just before the extension.
+ */
+ if (!p_bk && mch_getperm(backup) >= 0)
+ {
+ p = backup + STRLEN(backup) - 1 - STRLEN(backup_ext);
+ if (p < backup) /* empty file name ??? */
+ p = backup;
+ *p = 'z';
+ while (*p > 'a' && mch_getperm(backup) >= 0)
+ --*p;
+ /* They all exist??? Must be something wrong! */
+ if (*p == 'a')
+ {
+ vim_free(backup);
+ backup = NULL;
+ }
+ }
+ }
+ if (backup != NULL)
+ {
+
+ /*
+ * Delete any existing backup and move the current version to
+ * the backup. For safety, we don't remove the backup until
+ * the write has finished successfully. And if the 'backup'
+ * option is set, leave it around.
+ */
+ /*
+ * If the renaming of the original file to the backup file
+ * works, quit here.
+ */
+ if (vim_rename(fname, backup) == 0)
+ break;
+
+ vim_free(backup); /* don't do the rename below */
+ backup = NULL;
+ }
+ }
+ if (backup == NULL && !forceit)
+ {
+ errmsg = (char_u *)_("E510: Can't make backup file (add ! to override)");
+ goto fail;
+ }
+ }
+ }
+
+#if defined(UNIX) && !defined(ARCHIE)
+ /* When using ":w!" and the file was read-only: make it writable */
+ if (forceit && perm >= 0 && !(perm & 0200) && st_old.st_uid == getuid()
+ && vim_strchr(p_cpo, CPO_FWRITE) == NULL)
+ {
+ perm |= 0200;
+ (void)mch_setperm(fname, perm);
+ made_writable = TRUE;
+ }
+#endif
+
+ /* When using ":w!" and writing to the current file, readonly makes no
+ * sense, reset it */
+ if (forceit && overwriting)
+ {
+ buf->b_p_ro = FALSE;
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE; /* set window title later */
+#endif
+#ifdef FEAT_WINDOWS
+ status_redraw_all(); /* redraw status lines later */
+#endif
+ }
+
+ if (end > buf->b_ml.ml_line_count)
+ end = buf->b_ml.ml_line_count;
+ if (buf->b_ml.ml_flags & ML_EMPTY)
+ start = end + 1;
+
+ /*
+ * If the original file is being overwritten, there is a small chance that
+ * we crash in the middle of writing. Therefore the file is preserved now.
+ * This makes all block numbers positive so that recovery does not need
+ * the original file.
+ * Don't do this if there is a backup file and we are exiting.
+ */
+ if (reset_changed && !newfile && !otherfile(ffname)
+ && !(exiting && backup != NULL))
+ {
+ ml_preserve(buf, FALSE);
+ if (got_int)
+ {
+ errmsg = (char_u *)_(e_interr);
+ goto restore_backup;
+ }
+ }
+
+#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */
+ /*
+ * Before risking to lose the original file verify if there's
+ * a resource fork to preserve, and if cannot be done warn
+ * the users. This happens when overwriting without backups.
+ */
+ if (backup == NULL && overwriting && !append)
+ if (mch_has_resource_fork(fname))
+ {
+ errmsg = (char_u *)_("E460: The resource fork would be lost (add ! to override)");
+ goto restore_backup;
+ }
+#endif
+
+#ifdef VMS
+ vms_remove_version(fname); /* remove version */
+#endif
+ /* Default: write the the file directly. May write to a temp file for
+ * multi-byte conversion. */
+ wfname = fname;
+
+#ifdef FEAT_MBYTE
+ /* Check for forced 'fileencoding' from "++opt=val" argument. */
+ if (eap != NULL && eap->force_enc != 0)
+ {
+ fenc = eap->cmd + eap->force_enc;
+ fenc = enc_canonize(fenc);
+ fenc_tofree = fenc;
+ }
+ else
+ fenc = buf->b_p_fenc;
+
+ /*
+ * The file needs to be converted when 'fileencoding' is set and
+ * 'fileencoding' differs from 'encoding'.
+ */
+ converted = (*fenc != NUL && !same_encoding(p_enc, fenc));
+
+ /*
+ * Check if UTF-8 to UCS-2/4 or Latin1 conversion needs to be done. Or
+ * Latin1 to Unicode conversion. This is handled in buf_write_bytes().
+ * Prepare the flags for it and allocate bw_conv_buf when needed.
+ */
+ if (converted && (enc_utf8 || STRCMP(p_enc, "latin1") == 0))
+ {
+ wb_flags = get_fio_flags(fenc);
+ if (wb_flags & (FIO_UCS2 | FIO_UCS4 | FIO_UTF16 | FIO_UTF8))
+ {
+ /* Need to allocate a buffer to translate into. */
+ if (wb_flags & (FIO_UCS2 | FIO_UTF16 | FIO_UTF8))
+ write_info.bw_conv_buflen = bufsize * 2;
+ else /* FIO_UCS4 */
+ write_info.bw_conv_buflen = bufsize * 4;
+ write_info.bw_conv_buf
+ = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ if (write_info.bw_conv_buf == NULL)
+ end = 0;
+ }
+ }
+
+# ifdef WIN3264
+ if (converted && wb_flags == 0 && (wb_flags = get_win_fio_flags(fenc)) != 0)
+ {
+ /* Convert UTF-8 -> UCS-2 and UCS-2 -> DBCS. Worst-case * 4: */
+ write_info.bw_conv_buflen = bufsize * 4;
+ write_info.bw_conv_buf
+ = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ if (write_info.bw_conv_buf == NULL)
+ end = 0;
+ }
+# endif
+
+# ifdef MACOS_X
+ if (converted && wb_flags == 0 && (wb_flags = get_mac_fio_flags(fenc)) != 0)
+ {
+ write_info.bw_conv_buflen = bufsize * 3;
+ write_info.bw_conv_buf
+ = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ if (write_info.bw_conv_buf == NULL)
+ end = 0;
+ }
+# endif
+
+# if defined(FEAT_EVAL) || defined(USE_ICONV)
+ if (converted && wb_flags == 0)
+ {
+# ifdef USE_ICONV
+ /*
+ * Use iconv() conversion when conversion is needed and it's not done
+ * internally.
+ */
+ write_info.bw_iconv_fd = (iconv_t)my_iconv_open(fenc,
+ enc_utf8 ? (char_u *)"utf-8" : p_enc);
+ if (write_info.bw_iconv_fd != (iconv_t)-1)
+ {
+ /* We're going to use iconv(), allocate a buffer to convert in. */
+ write_info.bw_conv_buflen = bufsize * ICONV_MULT;
+ write_info.bw_conv_buf
+ = lalloc((long_u)write_info.bw_conv_buflen, TRUE);
+ if (write_info.bw_conv_buf == NULL)
+ end = 0;
+ write_info.bw_first = TRUE;
+ }
+# ifdef FEAT_EVAL
+ else
+# endif
+# endif
+
+# ifdef FEAT_EVAL
+ /*
+ * When the file needs to be converted with 'charconvert' after
+ * writing, write to a temp file instead and let the conversion
+ * overwrite the original file.
+ */
+ if (*p_ccv != NUL)
+ {
+ wfname = vim_tempname('w');
+ if (wfname == NULL) /* Can't write without a tempfile! */
+ {
+ errmsg = (char_u *)_("E214: Can't find temp file for writing");
+ goto restore_backup;
+ }
+ }
+# endif
+ }
+# endif
+ if (converted && wb_flags == 0
+# ifdef USE_ICONV
+ && write_info.bw_iconv_fd == (iconv_t)-1
+# endif
+# ifdef FEAT_EVAL
+ && wfname == fname
+# endif
+ )
+ {
+ if (!forceit)
+ {
+ errmsg = (char_u *)_("E213: Cannot convert (add ! to write without conversion)");
+ goto restore_backup;
+ }
+ notconverted = TRUE;
+ }
+#endif
+
+ /*
+ * Open the file "wfname" for writing.
+ * We may try to open the file twice: If we can't write to the
+ * file and forceit is TRUE we delete the existing file and try to create
+ * a new one. If this still fails we may have lost the original file!
+ * (this may happen when the user reached his quotum for number of files).
+ * Appending will fail if the file does not exist and forceit is FALSE.
+ */
+ while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
+ ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
+ : (O_CREAT | O_TRUNC))
+ , 0666)) < 0)
+ {
+ /*
+ * A forced write will try to create a new file if the old one is
+ * still readonly. This may also happen when the directory is
+ * read-only. In that case the mch_remove() will fail.
+ */
+ if (errmsg == NULL)
+ {
+#ifdef UNIX
+ struct stat st;
+
+ /* Don't delete the file when it's a hard or symbolic link. */
+ if ((!newfile && st_old.st_nlink > 1)
+ || (mch_lstat((char *)fname, &st) == 0
+ && (st.st_dev != st_old.st_dev
+ || st.st_ino != st_old.st_ino)))
+ errmsg = (char_u *)_("E166: Can't open linked file for writing");
+ else
+#endif
+ {
+ errmsg = (char_u *)_("E212: Can't open file for writing");
+ if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
+ && perm >= 0)
+ {
+#ifdef UNIX
+ /* we write to the file, thus it should be marked
+ writable after all */
+ if (!(perm & 0200))
+ made_writable = TRUE;
+ perm |= 0200;
+ if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
+ perm &= 0777;
+#endif
+ if (!append) /* don't remove when appending */
+ mch_remove(wfname);
+ continue;
+ }
+ }
+ }
+
+restore_backup:
+ {
+ struct stat st;
+
+ /*
+ * If we failed to open the file, we don't need a backup. Throw it
+ * away. If we moved or removed the original file try to put the
+ * backup in its place.
+ */
+ if (backup != NULL && wfname == fname)
+ {
+ if (backup_copy)
+ {
+ /*
+ * There is a small chance that we removed the original,
+ * try to move the copy in its place.
+ * This may not work if the vim_rename() fails.
+ * In that case we leave the copy around.
+ */
+ /* If file does not exist, put the copy in its place */
+ if (mch_stat((char *)fname, &st) < 0)
+ vim_rename(backup, fname);
+ /* if original file does exist throw away the copy */
+ if (mch_stat((char *)fname, &st) >= 0)
+ mch_remove(backup);
+ }
+ else
+ {
+ /* try to put the original file back */
+ vim_rename(backup, fname);
+ }
+ }
+
+ /* if original file no longer exists give an extra warning */
+ if (!newfile && mch_stat((char *)fname, &st) < 0)
+ end = 0;
+ }
+
+#ifdef FEAT_MBYTE
+ if (wfname != fname)
+ vim_free(wfname);
+#endif
+ goto fail;
+ }
+ errmsg = NULL;
+
+#if defined(MACOS_CLASSIC) || defined(WIN3264)
+ /* TODO: Is it need for MACOS_X? (Dany) */
+ /*
+ * On macintosh copy the original files attributes (i.e. the backup)
+ * This is done in order to preserve the ressource fork and the
+ * Finder attribute (label, comments, custom icons, file creatore)
+ */
+ if (backup != NULL && overwriting && !append)
+ {
+ if (backup_copy)
+ (void)mch_copy_file_attribute(wfname, backup);
+ else
+ (void)mch_copy_file_attribute(backup, wfname);
+ }
+
+ if (!overwriting && !append)
+ {
+ if (buf->b_ffname != NULL)
+ (void)mch_copy_file_attribute(buf->b_ffname, wfname);
+ /* Should copy ressource fork */
+ }
+#endif
+
+ write_info.bw_fd = fd;
+
+#ifdef FEAT_CRYPT
+ if (*buf->b_p_key && !filtering)
+ {
+ crypt_init_keys(buf->b_p_key);
+ /* Write magic number, so that Vim knows that this file is encrypted
+ * when reading it again. This also undergoes utf-8 to ucs-2/4
+ * conversion when needed. */
+ write_info.bw_buf = (char_u *)CRYPT_MAGIC;
+ write_info.bw_len = CRYPT_MAGIC_LEN;
+ write_info.bw_flags = FIO_NOCONVERT;
+ if (buf_write_bytes(&write_info) == FAIL)
+ end = 0;
+ wb_flags |= FIO_ENCRYPTED;
+ }
+#endif
+
+ write_info.bw_buf = buffer;
+ nchars = 0;
+
+ /* use "++bin", "++nobin" or 'binary' */
+ if (eap != NULL && eap->force_bin != 0)
+ write_bin = (eap->force_bin == FORCE_BIN);
+ else
+ write_bin = buf->b_p_bin;
+
+#ifdef FEAT_MBYTE
+ /*
+ * The BOM is written just after the encryption magic number.
+ */
+ if (buf->b_p_bomb && !write_bin)
+ {
+ write_info.bw_len = make_bom(buffer, fenc);
+ if (write_info.bw_len > 0)
+ {
+ /* don't convert, do encryption */
+ write_info.bw_flags = FIO_NOCONVERT | wb_flags;
+ if (buf_write_bytes(&write_info) == FAIL)
+ end = 0;
+ else
+ nchars += write_info.bw_len;
+ }
+ }
+#endif
+
+ write_info.bw_len = bufsize;
+#ifdef HAS_BW_FLAGS
+ write_info.bw_flags = wb_flags;
+#endif
+ fileformat = get_fileformat_force(buf, eap);
+ s = buffer;
+ len = 0;
+ for (lnum = start; lnum <= end; ++lnum)
+ {
+ /*
+ * The next while loop is done once for each character written.
+ * Keep it fast!
+ */
+ ptr = ml_get_buf(buf, lnum, FALSE) - 1;
+ while ((c = *++ptr) != NUL)
+ {
+ if (c == NL)
+ *s = NUL; /* replace newlines with NULs */
+ else if (c == CAR && fileformat == EOL_MAC)
+ *s = NL; /* Mac: replace CRs with NLs */
+ else
+ *s = c;
+ ++s;
+ if (++len != bufsize)
+ continue;
+ if (buf_write_bytes(&write_info) == FAIL)
+ {
+ end = 0; /* write error: break loop */
+ break;
+ }
+ nchars += bufsize;
+ s = buffer;
+ len = 0;
+ }
+ /* write failed or last line has no EOL: stop here */
+ if (end == 0
+ || (lnum == end
+ && write_bin
+ && (lnum == write_no_eol_lnum
+ || (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol))))
+ {
+ ++lnum; /* written the line, count it */
+ no_eol = TRUE;
+ break;
+ }
+ if (fileformat == EOL_UNIX)
+ *s++ = NL;
+ else
+ {
+ *s++ = CAR; /* EOL_MAC or EOL_DOS: write CR */
+ if (fileformat == EOL_DOS) /* write CR-NL */
+ {
+ if (++len == bufsize)
+ {
+ if (buf_write_bytes(&write_info) == FAIL)
+ {
+ end = 0; /* write error: break loop */
+ break;
+ }
+ nchars += bufsize;
+ s = buffer;
+ len = 0;
+ }
+ *s++ = NL;
+ }
+ }
+ if (++len == bufsize && end)
+ {
+ if (buf_write_bytes(&write_info) == FAIL)
+ {
+ end = 0; /* write error: break loop */
+ break;
+ }
+ nchars += bufsize;
+ s = buffer;
+ len = 0;
+
+ ui_breakcheck();
+ if (got_int)
+ {
+ end = 0; /* Interrupted, break loop */
+ break;
+ }
+ }
+#ifdef VMS
+ /*
+ * On VMS there is a problem: newlines get added when writing blocks
+ * at a time. Fix it by writing a line at a time.
+ * This is much slower!
+ * Explanation: Vim can not handle, so far, variable record format.
+ * With $analize/rms filename you can get the rms file structure, and
+ * if the Record format filed is variable, CR will be added after
+ * every written buffer. In other cases it works without this fix.
+ * From other side read is about 5 times slower for "variable record
+ * format" files.
+ */
+ if (buf->b_fab_rfm == FAB$C_VAR)
+ {
+ write_info.bw_len = len;
+ if (buf_write_bytes(&write_info) == FAIL)
+ {
+ end = 0; /* write error: break loop */
+ break;
+ }
+ write_info.bw_len = bufsize;
+ nchars += len;
+ s = buffer;
+ len = 0;
+ }
+#endif
+ }
+ if (len > 0 && end > 0)
+ {
+ write_info.bw_len = len;
+ if (buf_write_bytes(&write_info) == FAIL)
+ end = 0; /* write error */
+ nchars += len;
+ }
+
+#if defined(UNIX) && defined(HAVE_FSYNC)
+ /* On many journalling file systems there is a bug that causes both the
+ * original and the backup file to be lost when halting the system right
+ * after writing the file. That's because only the meta-data is
+ * journalled. Syncing the file slows down the system, but assures it has
+ * been written to disk and we don't lose it. */
+ if (fsync(fd) != 0)
+ {
+ errmsg = (char_u *)_("E667: Fsync failed");
+ end = 0;
+ }
+#endif
+
+ if (close(fd) != 0)
+ {
+ errmsg = (char_u *)_("E512: Close failed");
+ end = 0;
+ }
+
+#ifdef UNIX
+ if (made_writable)
+ perm &= ~0200; /* reset 'w' bit for security reasons */
+#endif
+ if (perm >= 0) /* set perm. of new file same as old file */
+ (void)mch_setperm(wfname, perm);
+#ifdef RISCOS
+ if (!append && !filtering)
+ /* Set the filetype after writing the file. */
+ mch_set_filetype(wfname, buf->b_p_oft);
+#endif
+#ifdef HAVE_ACL
+ /* Probably need to set the ACL before changing the user (can't set the
+ * ACL on a file the user doesn't own). */
+ if (!backup_copy)
+ mch_set_acl(wfname, acl);
+#endif
+
+#ifdef UNIX
+ /* When creating a new file, set its owner/group to that of the original
+ * file. Get the new device and inode number. */
+ if (backup != NULL && !backup_copy)
+ {
+ struct stat st;
+
+ /* don't change the owner when it's already OK, some systems remove
+ * permission or ACL stuff */
+ if (mch_stat((char *)wfname, &st) < 0
+ || st.st_uid != st_old.st_uid
+ || st.st_gid != st_old.st_gid)
+ {
+ chown((char *)wfname, st_old.st_uid, st_old.st_gid);
+ if (perm >= 0) /* set permission again, may have changed */
+ (void)mch_setperm(wfname, perm);
+ }
+ buf_setino(buf);
+ }
+#endif
+
+
+#if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
+ if (wfname != fname)
+ {
+ /*
+ * The file was written to a temp file, now it needs to be converted
+ * with 'charconvert' to (overwrite) the output file.
+ */
+ if (end != 0)
+ {
+ if (eval_charconvert(enc_utf8 ? (char_u *)"utf-8" : p_enc, fenc,
+ wfname, fname) == FAIL)
+ {
+ write_info.bw_conv_error = TRUE;
+ end = 0;
+ }
+ }
+ mch_remove(wfname);
+ vim_free(wfname);
+ }
+#endif
+
+ if (end == 0)
+ {
+ if (errmsg == NULL)
+ {
+#ifdef FEAT_MBYTE
+ if (write_info.bw_conv_error)
+ errmsg = (char_u *)_("E513: write error, conversion failed");
+ else
+#endif
+ if (got_int)
+ errmsg = (char_u *)_(e_interr);
+ else
+ errmsg = (char_u *)_("E514: write error (file system full?)");
+ }
+
+ /*
+ * If we have a backup file, try to put it in place of the new file,
+ * because the new file is probably corrupt. This avoids loosing the
+ * original file when trying to make a backup when writing the file a
+ * second time.
+ * When "backup_copy" is set we need to copy the backup over the new
+ * file. Otherwise rename the backup file.
+ * If this is OK, don't give the extra warning message.
+ */
+ if (backup != NULL)
+ {
+ if (backup_copy)
+ {
+ /* This may take a while, if we were interrupted let the user
+ * know we got the message. */
+ if (got_int)
+ {
+ MSG(_(e_interr));
+ out_flush();
+ }
+ if ((fd = mch_open((char *)backup, O_RDONLY | O_EXTRA, 0)) >= 0)
+ {
+ if ((write_info.bw_fd = mch_open((char *)fname,
+ O_WRONLY | O_CREAT | O_TRUNC | O_EXTRA, 0666)) >= 0)
+ {
+ /* copy the file. */
+ write_info.bw_buf = smallbuf;
+#ifdef HAS_BW_FLAGS
+ write_info.bw_flags = FIO_NOCONVERT;
+#endif
+ while ((write_info.bw_len = vim_read(fd, smallbuf,
+ SMBUFSIZE)) > 0)
+ if (buf_write_bytes(&write_info) == FAIL)
+ break;
+
+ if (close(write_info.bw_fd) >= 0
+ && write_info.bw_len == 0)
+ end = 1; /* success */
+ }
+ close(fd); /* ignore errors for closing read file */
+ }
+ }
+ else
+ {
+ if (vim_rename(backup, fname) == 0)
+ end = 1;
+ }
+ }
+ goto fail;
+ }
+
+ lnum -= start; /* compute number of written lines */
+ --no_wait_return; /* may wait for return now */
+
+#if !(defined(UNIX) || defined(VMS))
+ fname = sfname; /* use shortname now, for the messages */
+#endif
+ if (!filtering)
+ {
+ msg_add_fname(buf, fname); /* put fname in IObuff with quotes */
+ c = FALSE;
+#ifdef FEAT_MBYTE
+ if (write_info.bw_conv_error)
+ {
+ STRCAT(IObuff, _(" CONVERSION ERROR"));
+ c = TRUE;
+ }
+ else if (notconverted)
+ {
+ STRCAT(IObuff, _("[NOT converted]"));
+ c = TRUE;
+ }
+ else if (converted)
+ {
+ STRCAT(IObuff, _("[converted]"));
+ c = TRUE;
+ }
+#endif
+ if (device)
+ {
+ STRCAT(IObuff, _("[Device]"));
+ c = TRUE;
+ }
+ else if (newfile)
+ {
+ STRCAT(IObuff, shortmess(SHM_NEW) ? _("[New]") : _("[New File]"));
+ c = TRUE;
+ }
+ if (no_eol)
+ {
+ msg_add_eol();
+ c = TRUE;
+ }
+ /* may add [unix/dos/mac] */
+ if (msg_add_fileformat(fileformat))
+ c = TRUE;
+#ifdef FEAT_CRYPT
+ if (wb_flags & FIO_ENCRYPTED)
+ {
+ STRCAT(IObuff, _("[crypted]"));
+ c = TRUE;
+ }
+#endif
+ msg_add_lines(c, (long)lnum, nchars); /* add line/char count */
+ if (!shortmess(SHM_WRITE))
+ {
+ if (append)
+ STRCAT(IObuff, shortmess(SHM_WRI) ? _(" [a]") : _(" appended"));
+ else
+ STRCAT(IObuff, shortmess(SHM_WRI) ? _(" [w]") : _(" written"));
+ }
+
+ set_keep_msg(msg_trunc_attr(IObuff, FALSE, 0));
+ keep_msg_attr = 0;
+ }
+
+ if (reset_changed && whole
+#ifdef FEAT_MBYTE
+ && !write_info.bw_conv_error
+#endif
+ ) /* when written everything correctly */
+ {
+ unchanged(buf, TRUE);
+ u_unchanged(buf);
+ }
+
+ /*
+ * If written to the current file, update the timestamp of the swap file
+ * and reset the BF_WRITE_MASK flags. Also sets buf->b_mtime.
+ */
+ if (overwriting)
+ {
+ ml_timestamp(buf);
+ buf->b_flags &= ~BF_WRITE_MASK;
+ }
+
+ /*
+ * If we kept a backup until now, and we are in patch mode, then we make
+ * the backup file our 'original' file.
+ */
+ if (*p_pm && dobackup)
+ {
+ char *org = (char *)buf_modname(
+#ifdef SHORT_FNAME
+ TRUE,
+#else
+ (buf->b_p_sn || buf->b_shortname),
+#endif
+ fname, p_pm, FALSE);
+
+ if (backup != NULL)
+ {
+ struct stat st;
+
+ /*
+ * If the original file does not exist yet
+ * the current backup file becomes the original file
+ */
+ if (org == NULL)
+ EMSG(_("E205: Patchmode: can't save original file"));
+ else if (mch_stat(org, &st) < 0)
+ {
+ vim_rename(backup, (char_u *)org);
+ vim_free(backup); /* don't delete the file */
+ backup = NULL;
+#ifdef UNIX
+ set_file_time((char_u *)org, st_old.st_atime, st_old.st_mtime);
+#endif
+ }
+ }
+ /*
+ * If there is no backup file, remember that a (new) file was
+ * created.
+ */
+ else
+ {
+ int empty_fd;
+
+ if (org == NULL
+ || (empty_fd = mch_open(org, O_CREAT | O_EXTRA | O_EXCL,
+ 0666)) < 0)
+ EMSG(_("E206: patchmode: can't touch empty original file"));
+ else
+ close(empty_fd);
+ }
+ if (org != NULL)
+ {
+ mch_setperm((char_u *)org, mch_getperm(fname) & 0777);
+ vim_free(org);
+ }
+ }
+
+ /*
+ * Remove the backup unless 'backup' option is set
+ */
+ if (!p_bk && backup != NULL && mch_remove(backup) != 0)
+ EMSG(_("E207: Can't delete backup file"));
+
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ workshop_file_saved((char *) ffname);
+#endif
+
+ goto nofail;
+
+ /*
+ * Finish up. We get here either after failure or success.
+ */
+fail:
+ --no_wait_return; /* may wait for return now */
+nofail:
+
+ /* Done saving, we accept changed buffer warnings again */
+ buf->b_saving = FALSE;
+
+ vim_free(backup);
+ if (buffer != smallbuf)
+ vim_free(buffer);
+#ifdef FEAT_MBYTE
+ vim_free(fenc_tofree);
+ vim_free(write_info.bw_conv_buf);
+# ifdef USE_ICONV
+ if (write_info.bw_iconv_fd != (iconv_t)-1)
+ {
+ iconv_close(write_info.bw_iconv_fd);
+ write_info.bw_iconv_fd = (iconv_t)-1;
+ }
+# endif
+#endif
+#ifdef HAVE_ACL
+ mch_free_acl(acl);
+#endif
+
+ if (errmsg != NULL)
+ {
+ int numlen = errnum != NULL ? STRLEN(errnum) : 0;
+
+ attr = hl_attr(HLF_E); /* set highlight for error messages */
+ msg_add_fname(buf,
+#ifndef UNIX
+ sfname
+#else
+ fname
+#endif
+ ); /* put file name in IObuff with quotes */
+ if (STRLEN(IObuff) + STRLEN(errmsg) + numlen >= IOSIZE)
+ IObuff[IOSIZE - STRLEN(errmsg) - numlen - 1] = NUL;
+ /* If the error message has the form "is ...", put the error number in
+ * front of the file name. */
+ if (errnum != NULL)
+ {
+ mch_memmove(IObuff + numlen, IObuff, STRLEN(IObuff) + 1);
+ mch_memmove(IObuff, errnum, (size_t)numlen);
+ }
+ STRCAT(IObuff, errmsg);
+ emsg(IObuff);
+
+ retval = FAIL;
+ if (end == 0)
+ {
+ MSG_PUTS_ATTR(_("\nWARNING: Original file may be lost or damaged\n"),
+ attr | MSG_HIST);
+ MSG_PUTS_ATTR(_("don't quit the editor until the file is successfully written!"),
+ attr | MSG_HIST);
+
+ /* Update the timestamp to avoid an "overwrite changed file"
+ * prompt when writing again. */
+ if (mch_stat((char *)fname, &st_old) >= 0)
+ {
+ buf_store_time(buf, &st_old, fname);
+ buf->b_mtime_read = buf->b_mtime;
+ }
+ }
+ }
+ msg_scroll = msg_save;
+
+#ifdef FEAT_AUTOCMD
+#ifdef FEAT_EVAL
+ if (!should_abort(retval))
+#else
+ if (!got_int)
+#endif
+ {
+ aco_save_T aco;
+
+ write_no_eol_lnum = 0; /* in case it was set by the previous read */
+
+ /*
+ * Apply POST autocommands.
+ * Careful: The autocommands may call buf_write() recursively!
+ */
+ aucmd_prepbuf(&aco, buf);
+
+ if (append)
+ apply_autocmds_exarg(EVENT_FILEAPPENDPOST, fname, fname,
+ FALSE, curbuf, eap);
+ else if (filtering)
+ apply_autocmds_exarg(EVENT_FILTERWRITEPOST, NULL, fname,
+ FALSE, curbuf, eap);
+ else if (reset_changed && whole)
+ apply_autocmds_exarg(EVENT_BUFWRITEPOST, fname, fname,
+ FALSE, curbuf, eap);
+ else
+ apply_autocmds_exarg(EVENT_FILEWRITEPOST, fname, fname,
+ FALSE, curbuf, eap);
+
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+
+#ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ retval = FALSE;
+#endif
+ }
+#endif
+
+ got_int |= prev_got_int;
+
+#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */
+ /* Update machine specific information. */
+ mch_post_buffer_write(buf);
+#endif
+ return retval;
+}
+
+/*
+ * Put file name into IObuff with quotes.
+ */
+ static void
+msg_add_fname(buf, fname)
+ buf_T *buf;
+ char_u *fname;
+{
+ if (fname == NULL)
+ fname = (char_u *)"-stdin-";
+ home_replace(buf, fname, IObuff + 1, IOSIZE - 4, TRUE);
+ IObuff[0] = '"';
+ STRCAT(IObuff, "\" ");
+}
+
+/*
+ * Append message for text mode to IObuff.
+ * Return TRUE if something appended.
+ */
+ static int
+msg_add_fileformat(eol_type)
+ int eol_type;
+{
+#ifndef USE_CRNL
+ if (eol_type == EOL_DOS)
+ {
+ STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[dos]") : _("[dos format]"));
+ return TRUE;
+ }
+#endif
+#ifndef USE_CR
+ if (eol_type == EOL_MAC)
+ {
+ STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[mac]") : _("[mac format]"));
+ return TRUE;
+ }
+#endif
+#if defined(USE_CRNL) || defined(USE_CR)
+ if (eol_type == EOL_UNIX)
+ {
+ STRCAT(IObuff, shortmess(SHM_TEXT) ? _("[unix]") : _("[unix format]"));
+ return TRUE;
+ }
+#endif
+ return FALSE;
+}
+
+/*
+ * Append line and character count to IObuff.
+ */
+ static void
+msg_add_lines(insert_space, lnum, nchars)
+ int insert_space;
+ long lnum;
+ long nchars;
+{
+ char_u *p;
+
+ p = IObuff + STRLEN(IObuff);
+
+ if (insert_space)
+ *p++ = ' ';
+ if (shortmess(SHM_LINES))
+ sprintf((char *)p, "%ldL, %ldC", lnum, nchars);
+ else
+ {
+ if (lnum == 1)
+ STRCPY(p, _("1 line, "));
+ else
+ sprintf((char *)p, _("%ld lines, "), lnum);
+ p += STRLEN(p);
+ if (nchars == 1)
+ STRCPY(p, _("1 character"));
+ else
+ sprintf((char *)p, _("%ld characters"), nchars);
+ }
+}
+
+/*
+ * Append message for missing line separator to IObuff.
+ */
+ static void
+msg_add_eol()
+{
+ STRCAT(IObuff, shortmess(SHM_LAST) ? _("[noeol]") : _("[Incomplete last line]"));
+}
+
+/*
+ * Check modification time of file, before writing to it.
+ * The size isn't checked, because using a tool like "gzip" takes care of
+ * using the same timestamp but can't set the size.
+ */
+ static int
+check_mtime(buf, st)
+ buf_T *buf;
+ struct stat *st;
+{
+ if (buf->b_mtime_read != 0
+ && time_differs((long)st->st_mtime, buf->b_mtime_read))
+ {
+ msg_scroll = TRUE; /* don't overwrite messages here */
+ msg_silent = 0; /* must give this prompt */
+ /* don't use emsg() here, don't want to flush the buffers */
+ MSG_ATTR(_("WARNING: The file has been changed since reading it!!!"),
+ hl_attr(HLF_E));
+ if (ask_yesno((char_u *)_("Do you really want to write to it"),
+ TRUE) == 'n')
+ return FAIL;
+ msg_scroll = FALSE; /* always overwrite the file message now */
+ }
+ return OK;
+}
+
+ static int
+time_differs(t1, t2)
+ long t1, t2;
+{
+#if defined(__linux__) || defined(MSDOS) || defined(MSWIN)
+ /* On a FAT filesystem, esp. under Linux, there are only 5 bits to store
+ * the seconds. Since the roundoff is done when flushing the inode, the
+ * time may change unexpectedly by one second!!! */
+ return (t1 - t2 > 1 || t2 - t1 > 1);
+#else
+ return (t1 != t2);
+#endif
+}
+
+/*
+ * Call write() to write a number of bytes to the file.
+ * Also handles encryption and 'encoding' conversion.
+ *
+ * Return FAIL for failure, OK otherwise.
+ */
+ static int
+buf_write_bytes(ip)
+ struct bw_info *ip;
+{
+ int wlen;
+ char_u *buf = ip->bw_buf; /* data to write */
+ int len = ip->bw_len; /* length of data */
+#ifdef HAS_BW_FLAGS
+ int flags = ip->bw_flags; /* extra flags */
+#endif
+
+#ifdef FEAT_MBYTE
+ /*
+ * Skip conversion when writing the crypt magic number or the BOM.
+ */
+ if (!(flags & FIO_NOCONVERT))
+ {
+ char_u *p;
+ unsigned c;
+ int n;
+
+ if (flags & FIO_UTF8)
+ {
+ /*
+ * Convert latin1 in the buffer to UTF-8 in the file.
+ */
+ p = ip->bw_conv_buf; /* translate to buffer */
+ for (wlen = 0; wlen < len; ++wlen)
+ p += utf_char2bytes(buf[wlen], p);
+ buf = ip->bw_conv_buf;
+ len = (int)(p - ip->bw_conv_buf);
+ }
+ else if (flags & (FIO_UCS4 | FIO_UTF16 | FIO_UCS2 | FIO_LATIN1))
+ {
+ /*
+ * Convert UTF-8 bytes in the buffer to UCS-2, UCS-4, UTF-16 or
+ * Latin1 chars in the file.
+ */
+ if (flags & FIO_LATIN1)
+ p = buf; /* translate in-place (can only get shorter) */
+ else
+ p = ip->bw_conv_buf; /* translate to buffer */
+ for (wlen = 0; wlen < len; wlen += n)
+ {
+ if (wlen == 0 && ip->bw_restlen != 0)
+ {
+ int l;
+
+ /* Use remainder of previous call. Append the start of
+ * buf[] to get a full sequence. Might still be too
+ * short! */
+ l = CONV_RESTLEN - ip->bw_restlen;
+ if (l > len)
+ l = len;
+ mch_memmove(ip->bw_rest + ip->bw_restlen, buf, (size_t)l);
+ n = utf_ptr2len_check_len(ip->bw_rest, ip->bw_restlen + l);
+ if (n > ip->bw_restlen + len)
+ {
+ /* We have an incomplete byte sequence at the end to
+ * be written. We can't convert it without the
+ * remaining bytes. Keep them for the next call. */
+ if (ip->bw_restlen + len > CONV_RESTLEN)
+ return FAIL;
+ ip->bw_restlen += len;
+ break;
+ }
+ if (n > 1)
+ c = utf_ptr2char(ip->bw_rest);
+ else
+ c = ip->bw_rest[0];
+ if (n >= ip->bw_restlen)
+ {
+ n -= ip->bw_restlen;
+ ip->bw_restlen = 0;
+ }
+ else
+ {
+ ip->bw_restlen -= n;
+ mch_memmove(ip->bw_rest, ip->bw_rest + n,
+ (size_t)ip->bw_restlen);
+ n = 0;
+ }
+ }
+ else
+ {
+ n = utf_ptr2len_check_len(buf + wlen, len - wlen);
+ if (n > len - wlen)
+ {
+ /* We have an incomplete byte sequence at the end to
+ * be written. We can't convert it without the
+ * remaining bytes. Keep them for the next call. */
+ if (len - wlen > CONV_RESTLEN)
+ return FAIL;
+ ip->bw_restlen = len - wlen;
+ mch_memmove(ip->bw_rest, buf + wlen,
+ (size_t)ip->bw_restlen);
+ break;
+ }
+ if (n > 1)
+ c = utf_ptr2char(buf + wlen);
+ else
+ c = buf[wlen];
+ }
+
+ ip->bw_conv_error |= ucs2bytes(c, &p, flags);
+ }
+ if (flags & FIO_LATIN1)
+ len = (int)(p - buf);
+ else
+ {
+ buf = ip->bw_conv_buf;
+ len = (int)(p - ip->bw_conv_buf);
+ }
+ }
+
+# ifdef WIN3264
+ else if (flags & FIO_CODEPAGE)
+ {
+ /*
+ * Convert UTF-8 or codepage to UCS-2 and then to MS-Windows
+ * codepage.
+ */
+ char_u *from;
+ size_t fromlen;
+ char_u *to;
+ int u8c;
+ BOOL bad = FALSE;
+ int needed;
+
+ if (ip->bw_restlen > 0)
+ {
+ /* Need to concatenate the remainder of the previous call and
+ * the bytes of the current call. Use the end of the
+ * conversion buffer for this. */
+ fromlen = len + ip->bw_restlen;
+ from = ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
+ mch_memmove(from, ip->bw_rest, (size_t)ip->bw_restlen);
+ mch_memmove(from + ip->bw_restlen, buf, (size_t)len);
+ }
+ else
+ {
+ from = buf;
+ fromlen = len;
+ }
+
+ to = ip->bw_conv_buf;
+ if (enc_utf8)
+ {
+ /* Convert from UTF-8 to UCS-2, to the start of the buffer.
+ * The buffer has been allocated to be big enough. */
+ while (fromlen > 0)
+ {
+ n = utf_ptr2len_check_len(from, fromlen);
+ if (n > (int)fromlen) /* incomplete byte sequence */
+ break;
+ u8c = utf_ptr2char(from);
+ *to++ = (u8c & 0xff);
+ *to++ = (u8c >> 8);
+ fromlen -= n;
+ from += n;
+ }
+
+ /* Copy remainder to ip->bw_rest[] to be used for the next
+ * call. */
+ if (fromlen > CONV_RESTLEN)
+ {
+ /* weird overlong sequence */
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ mch_memmove(ip->bw_rest, from, fromlen);
+ ip->bw_restlen = fromlen;
+ }
+ else
+ {
+ /* Convert from enc_codepage to UCS-2, to the start of the
+ * buffer. The buffer has been allocated to be big enough. */
+ ip->bw_restlen = 0;
+ needed = MultiByteToWideChar(enc_codepage,
+ MB_ERR_INVALID_CHARS, (LPCSTR)from, fromlen,
+ NULL, 0);
+ if (needed == 0)
+ {
+ /* When conversion fails there may be a trailing byte. */
+ needed = MultiByteToWideChar(enc_codepage,
+ MB_ERR_INVALID_CHARS, (LPCSTR)from, fromlen - 1,
+ NULL, 0);
+ if (needed == 0)
+ {
+ /* Conversion doesn't work. */
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ /* Save the trailing byte for the next call. */
+ ip->bw_rest[0] = from[fromlen - 1];
+ ip->bw_restlen = 1;
+ }
+ needed = MultiByteToWideChar(enc_codepage, MB_ERR_INVALID_CHARS,
+ (LPCSTR)from, fromlen - ip->bw_restlen,
+ (LPWSTR)to, needed);
+ if (needed == 0)
+ {
+ /* Safety check: Conversion doesn't work. */
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ to += needed * 2;
+ }
+
+ fromlen = to - ip->bw_conv_buf;
+ buf = to;
+# ifdef CP_UTF8 /* VC 4.1 doesn't define CP_UTF8 */
+ if (FIO_GET_CP(flags) == CP_UTF8)
+ {
+ /* Convert from UCS-2 to UTF-8, using the remainder of the
+ * conversion buffer. Fails when out of space. */
+ for (from = ip->bw_conv_buf; fromlen > 1; fromlen -= 2)
+ {
+ u8c = *from++;
+ u8c += (*from++ << 8);
+ to += utf_char2bytes(u8c, to);
+ if (to + 6 >= ip->bw_conv_buf + ip->bw_conv_buflen)
+ {
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ }
+ len = to - buf;
+ }
+ else
+#endif
+ {
+ /* Convert from UCS-2 to the codepage, using the remainder of
+ * the conversion buffer. If the conversion uses the default
+ * character "0", the data doesn't fit in this encoding, so
+ * fail. */
+ len = WideCharToMultiByte(FIO_GET_CP(flags), 0,
+ (LPCWSTR)ip->bw_conv_buf, (int)fromlen / sizeof(WCHAR),
+ (LPSTR)to, ip->bw_conv_buflen - fromlen, 0, &bad);
+ if (bad)
+ {
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ }
+ }
+# endif
+
+# ifdef MACOS_X
+ else if (flags & FIO_MACROMAN)
+ {
+ /*
+ * Convert UTF-8 or latin1 to Apple MacRoman.
+ */
+ CFStringRef cfstr;
+ CFRange r;
+ CFIndex l;
+ char_u *from;
+ size_t fromlen;
+
+ if (ip->bw_restlen > 0)
+ {
+ /* Need to concatenate the remainder of the previous call and
+ * the bytes of the current call. Use the end of the
+ * conversion buffer for this. */
+ fromlen = len + ip->bw_restlen;
+ from = ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
+ mch_memmove(from, ip->bw_rest, (size_t)ip->bw_restlen);
+ mch_memmove(from + ip->bw_restlen, buf, (size_t)len);
+ }
+ else
+ {
+ from = buf;
+ fromlen = len;
+ }
+
+ ip->bw_restlen = 0;
+ cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
+ (enc_utf8) ?
+ kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
+ 0);
+ while (cfstr == NULL && ip->bw_restlen < 3 && fromlen > 1)
+ {
+ ip->bw_rest[ip->bw_restlen++] = from[--fromlen];
+ cfstr = CFStringCreateWithBytes(NULL, from, fromlen,
+ (enc_utf8) ?
+ kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
+ 0);
+ }
+ if (cfstr == NULL)
+ {
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+
+ r.location = 0;
+ r.length = CFStringGetLength(cfstr);
+ if (r.length != CFStringGetBytes(cfstr, r,
+ kCFStringEncodingMacRoman,
+ 0, /* no lossy conversion */
+ 0, /* not external representation (since vim
+ * handles this internally */
+ ip->bw_conv_buf, ip->bw_conv_buflen, &l))
+ {
+ CFRelease(cfstr);
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+ CFRelease(cfstr);
+ buf = ip->bw_conv_buf;
+ len = l;
+ }
+# endif
+
+# ifdef USE_ICONV
+ if (ip->bw_iconv_fd != (iconv_t)-1)
+ {
+ const char *from;
+ size_t fromlen;
+ char *to;
+ size_t tolen;
+
+ /* Convert with iconv(). */
+ if (ip->bw_restlen > 0)
+ {
+ /* Need to concatenate the remainder of the previous call and
+ * the bytes of the current call. Use the end of the
+ * conversion buffer for this. */
+ fromlen = len + ip->bw_restlen;
+ from = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
+ mch_memmove((void *)from, ip->bw_rest, (size_t)ip->bw_restlen);
+ mch_memmove((void *)(from + ip->bw_restlen), buf, (size_t)len);
+ tolen = ip->bw_conv_buflen - fromlen;
+ }
+ else
+ {
+ from = (const char *)buf;
+ fromlen = len;
+ tolen = ip->bw_conv_buflen;
+ }
+ to = (char *)ip->bw_conv_buf;
+
+ if (ip->bw_first)
+ {
+ size_t save_len = tolen;
+
+ /* output the initial shift state sequence */
+ (void)iconv(ip->bw_iconv_fd, NULL, NULL, &to, &tolen);
+
+ /* There is a bug in iconv() on Linux (which appears to be
+ * wide-spread) which sets "to" to NULL and messes up "tolen".
+ */
+ if (to == NULL)
+ {
+ to = (char *)ip->bw_conv_buf;
+ tolen = save_len;
+ }
+ ip->bw_first = FALSE;
+ }
+
+ /*
+ * If iconv() has an error or there is not enough room, fail.
+ */
+ if ((iconv(ip->bw_iconv_fd, (void *)&from, &fromlen, &to, &tolen)
+ == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
+ || fromlen > CONV_RESTLEN)
+ {
+ ip->bw_conv_error = TRUE;
+ return FAIL;
+ }
+
+ /* copy remainder to ip->bw_rest[] to be used for the next call. */
+ if (fromlen > 0)
+ mch_memmove(ip->bw_rest, (void *)from, fromlen);
+ ip->bw_restlen = (int)fromlen;
+
+ buf = ip->bw_conv_buf;
+ len = (int)((char_u *)to - ip->bw_conv_buf);
+ }
+# endif
+ }
+#endif /* FEAT_MBYTE */
+
+#ifdef FEAT_CRYPT
+ if (flags & FIO_ENCRYPTED) /* encrypt the data */
+ {
+ int ztemp, t, i;
+
+ for (i = 0; i < len; i++)
+ {
+ ztemp = buf[i];
+ buf[i] = ZENCODE(ztemp, t);
+ }
+ }
+#endif
+
+ /* Repeat the write(), it may be interrupted by a signal. */
+ while (len)
+ {
+ wlen = vim_write(ip->bw_fd, buf, len);
+ if (wlen <= 0) /* error! */
+ return FAIL;
+ len -= wlen;
+ buf += wlen;
+ }
+ return OK;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Convert a Unicode character to bytes.
+ */
+ static int
+ucs2bytes(c, pp, flags)
+ unsigned c; /* in: character */
+ char_u **pp; /* in/out: pointer to result */
+ int flags; /* FIO_ flags */
+{
+ char_u *p = *pp;
+ int error = FALSE;
+ int cc;
+
+
+ if (flags & FIO_UCS4)
+ {
+ if (flags & FIO_ENDIAN_L)
+ {
+ *p++ = c;
+ *p++ = (c >> 8);
+ *p++ = (c >> 16);
+ *p++ = (c >> 24);
+ }
+ else
+ {
+ *p++ = (c >> 24);
+ *p++ = (c >> 16);
+ *p++ = (c >> 8);
+ *p++ = c;
+ }
+ }
+ else if (flags & (FIO_UCS2 | FIO_UTF16))
+ {
+ if (c >= 0x10000)
+ {
+ if (flags & FIO_UTF16)
+ {
+ /* Make two words, ten bits of the character in each. First
+ * word is 0xd800 - 0xdbff, second one 0xdc00 - 0xdfff */
+ c -= 0x10000;
+ if (c >= 0x100000)
+ error = TRUE;
+ cc = ((c >> 10) & 0x3ff) + 0xd800;
+ if (flags & FIO_ENDIAN_L)
+ {
+ *p++ = cc;
+ *p++ = ((unsigned)cc >> 8);
+ }
+ else
+ {
+ *p++ = ((unsigned)cc >> 8);
+ *p++ = cc;
+ }
+ c = (c & 0x3ff) + 0xdc00;
+ }
+ else
+ error = TRUE;
+ }
+ if (flags & FIO_ENDIAN_L)
+ {
+ *p++ = c;
+ *p++ = (c >> 8);
+ }
+ else
+ {
+ *p++ = (c >> 8);
+ *p++ = c;
+ }
+ }
+ else /* Latin1 */
+ {
+ if (c >= 0x100)
+ {
+ error = TRUE;
+ *p++ = 0xBF;
+ }
+ else
+ *p++ = c;
+ }
+
+ *pp = p;
+ return error;
+}
+
+/*
+ * Return TRUE if "a" and "b" are the same 'encoding'.
+ * Ignores difference between "ansi" and "latin1", "ucs-4" and "ucs-4be", etc.
+ */
+ static int
+same_encoding(a, b)
+ char_u *a;
+ char_u *b;
+{
+ int f;
+
+ if (STRCMP(a, b) == 0)
+ return TRUE;
+ f = get_fio_flags(a);
+ return (f != 0 && get_fio_flags(b) == f);
+}
+
+/*
+ * Check "ptr" for a unicode encoding and return the FIO_ flags needed for the
+ * internal conversion.
+ * if "ptr" is an empty string, use 'encoding'.
+ */
+ static int
+get_fio_flags(ptr)
+ char_u *ptr;
+{
+ int prop;
+
+ if (*ptr == NUL)
+ ptr = p_enc;
+
+ prop = enc_canon_props(ptr);
+ if (prop & ENC_UNICODE)
+ {
+ if (prop & ENC_2BYTE)
+ {
+ if (prop & ENC_ENDIAN_L)
+ return FIO_UCS2 | FIO_ENDIAN_L;
+ return FIO_UCS2;
+ }
+ if (prop & ENC_4BYTE)
+ {
+ if (prop & ENC_ENDIAN_L)
+ return FIO_UCS4 | FIO_ENDIAN_L;
+ return FIO_UCS4;
+ }
+ if (prop & ENC_2WORD)
+ {
+ if (prop & ENC_ENDIAN_L)
+ return FIO_UTF16 | FIO_ENDIAN_L;
+ return FIO_UTF16;
+ }
+ return FIO_UTF8;
+ }
+ if (prop & ENC_LATIN1)
+ return FIO_LATIN1;
+ /* must be ENC_DBCS, requires iconv() */
+ return 0;
+}
+
+#ifdef WIN3264
+/*
+ * Check "ptr" for a MS-Windows codepage name and return the FIO_ flags needed
+ * for the conversion MS-Windows can do for us. Also accept "utf-8".
+ * Used for conversion between 'encoding' and 'fileencoding'.
+ */
+ static int
+get_win_fio_flags(ptr)
+ char_u *ptr;
+{
+ int cp;
+
+ /* Cannot do this when 'encoding' is not utf-8 and not a codepage. */
+ if (!enc_utf8 && enc_codepage <= 0)
+ return 0;
+
+ cp = encname2codepage(ptr);
+ if (cp == 0)
+ {
+# ifdef CP_UTF8 /* VC 4.1 doesn't define CP_UTF8 */
+ if (STRCMP(ptr, "utf-8") == 0)
+ cp = CP_UTF8;
+ else
+# endif
+ return 0;
+ }
+ return FIO_PUT_CP(cp) | FIO_CODEPAGE;
+}
+#endif
+
+#ifdef MACOS_X
+/*
+ * Check "ptr" for a Carbon supported encoding and return the FIO_ flags
+ * needed for the internal conversion to/from utf-8 or latin1.
+ */
+ static int
+get_mac_fio_flags(ptr)
+ char_u *ptr;
+{
+ if ((enc_utf8 || STRCMP(p_enc, "latin1") == 0)
+ && (enc_canon_props(ptr) & ENC_MACROMAN))
+ return FIO_MACROMAN;
+ return 0;
+}
+#endif
+
+/*
+ * Check for a Unicode BOM (Byte Order Mark) at the start of p[size].
+ * "size" must be at least 2.
+ * Return the name of the encoding and set "*lenp" to the length.
+ * Returns NULL when no BOM found.
+ */
+ static char_u *
+check_for_bom(p, size, lenp, flags)
+ char_u *p;
+ long size;
+ int *lenp;
+ int flags;
+{
+ char *name = NULL;
+ int len = 2;
+
+ if (p[0] == 0xef && p[1] == 0xbb && size >= 3 && p[2] == 0xbf
+ && (flags == FIO_ALL || flags == 0))
+ {
+ name = "utf-8"; /* EF BB BF */
+ len = 3;
+ }
+ else if (p[0] == 0xff && p[1] == 0xfe)
+ {
+ if (size >= 4 && p[2] == 0 && p[3] == 0
+ && (flags == FIO_ALL || flags == (FIO_UCS4 | FIO_ENDIAN_L)))
+ {
+ name = "ucs-4le"; /* FF FE 00 00 */
+ len = 4;
+ }
+ else if (flags == FIO_ALL || flags == (FIO_UCS2 | FIO_ENDIAN_L))
+ name = "ucs-2le"; /* FF FE */
+ else if (flags == (FIO_UTF16 | FIO_ENDIAN_L))
+ name = "utf-16le"; /* FF FE */
+ }
+ else if (p[0] == 0xfe && p[1] == 0xff
+ && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16))
+ {
+ if (flags == FIO_UTF16)
+ name = "utf-16"; /* FE FF */
+ else
+ name = "ucs-2"; /* FE FF */
+ }
+ else if (size >= 4 && p[0] == 0 && p[1] == 0 && p[2] == 0xfe
+ && p[3] == 0xff && (flags == FIO_ALL || flags == FIO_UCS4))
+ {
+ name = "ucs-4"; /* 00 00 FE FF */
+ len = 4;
+ }
+
+ *lenp = len;
+ return (char_u *)name;
+}
+
+/*
+ * Generate a BOM in "buf[4]" for encoding "name".
+ * Return the length of the BOM (zero when no BOM).
+ */
+ static int
+make_bom(buf, name)
+ char_u *buf;
+ char_u *name;
+{
+ int flags;
+ char_u *p;
+
+ flags = get_fio_flags(name);
+
+ /* Can't put a BOM in a non-Unicode file. */
+ if (flags == FIO_LATIN1 || flags == 0)
+ return 0;
+
+ if (flags == FIO_UTF8) /* UTF-8 */
+ {
+ buf[0] = 0xef;
+ buf[1] = 0xbb;
+ buf[2] = 0xbf;
+ return 3;
+ }
+ p = buf;
+ (void)ucs2bytes(0xfeff, &p, flags);
+ return (int)(p - buf);
+}
+#endif
+
+/*
+ * Try to find a shortname by comparing the fullname with the current
+ * directory.
+ * Returns NULL if not shorter name possible, pointer into "full_path"
+ * otherwise.
+ */
+ char_u *
+shorten_fname(full_path, dir_name)
+ char_u *full_path;
+ char_u *dir_name;
+{
+ int len;
+ char_u *p;
+
+ if (full_path == NULL)
+ return NULL;
+ len = (int)STRLEN(dir_name);
+ if (fnamencmp(dir_name, full_path, len) == 0)
+ {
+ p = full_path + len;
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ /*
+ * MSDOS: when a file is in the root directory, dir_name will end in a
+ * slash, since C: by itself does not define a specific dir. In this
+ * case p may already be correct. <negri>
+ */
+ if (!((len > 2) && (*(p - 2) == ':')))
+#endif
+ {
+ if (vim_ispathsep(*p))
+ ++p;
+#ifndef VMS /* the path separator is always part of the path */
+ else
+ p = NULL;
+#endif
+ }
+ }
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ /*
+ * When using a file in the current drive, remove the drive name:
+ * "A:\dir\file" -> "\dir\file". This helps when moving a session file on
+ * a floppy from "A:\dir" to "B:\dir".
+ */
+ else if (len > 3
+ && TOUPPER_LOC(full_path[0]) == TOUPPER_LOC(dir_name[0])
+ && full_path[1] == ':'
+ && vim_ispathsep(full_path[2]))
+ p = full_path + 2;
+#endif
+ else
+ p = NULL;
+ return p;
+}
+
+/*
+ * Shorten filenames for all buffers.
+ * When "force" is TRUE: Use full path from now on for files currently being
+ * edited, both for file name and swap file name. Try to shorten the file
+ * names a bit, if safe to do so.
+ * When "force" is FALSE: Only try to shorten absolute file names.
+ * For buffers that have buftype "nofile" or "scratch": never change the file
+ * name.
+ */
+ void
+shorten_fnames(force)
+ int force;
+{
+ char_u dirname[MAXPATHL];
+ buf_T *buf;
+ char_u *p;
+
+ mch_dirname(dirname, MAXPATHL);
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (buf->b_fname != NULL
+#ifdef FEAT_QUICKFIX
+ && !bt_nofile(buf)
+#endif
+ && !path_with_url(buf->b_fname)
+ && (force
+ || buf->b_sfname == NULL
+ || mch_isFullName(buf->b_sfname)))
+ {
+ vim_free(buf->b_sfname);
+ buf->b_sfname = NULL;
+ p = shorten_fname(buf->b_ffname, dirname);
+ if (p != NULL)
+ {
+ buf->b_sfname = vim_strsave(p);
+ buf->b_fname = buf->b_sfname;
+ }
+ if (p == NULL || buf->b_fname == NULL)
+ buf->b_fname = buf->b_ffname;
+ mf_fullname(buf->b_ml.ml_mfp);
+ }
+ }
+#ifdef FEAT_WINDOWS
+ status_redraw_all();
+#endif
+}
+
+#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
+ || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_MAC) \
+ || defined(PROTO)
+/*
+ * Shorten all filenames in "fnames[count]" by current directory.
+ */
+ void
+shorten_filenames(fnames, count)
+ char_u **fnames;
+ int count;
+{
+ int i;
+ char_u dirname[MAXPATHL];
+ char_u *p;
+
+ if (fnames == NULL || count < 1)
+ return;
+ mch_dirname(dirname, sizeof(dirname));
+ for (i = 0; i < count; ++i)
+ {
+ if ((p = shorten_fname(fnames[i], dirname)) != NULL)
+ {
+ /* shorten_fname() returns pointer in given "fnames[i]". If free
+ * "fnames[i]" first, "p" becomes invalid. So we need to copy
+ * "p" first then free fnames[i]. */
+ p = vim_strsave(p);
+ vim_free(fnames[i]);
+ fnames[i] = p;
+ }
+ }
+}
+#endif
+
+/*
+ * add extention to file name - change path/fo.o.h to path/fo.o.h.ext or
+ * fo_o_h.ext for MSDOS or when shortname option set.
+ *
+ * Assumed that fname is a valid name found in the filesystem we assure that
+ * the return value is a different name and ends in 'ext'.
+ * "ext" MUST be at most 4 characters long if it starts with a dot, 3
+ * characters otherwise.
+ * Space for the returned name is allocated, must be freed later.
+ * Returns NULL when out of memory.
+ */
+ char_u *
+modname(fname, ext, prepend_dot)
+ char_u *fname, *ext;
+ int prepend_dot; /* may prepend a '.' to file name */
+{
+ return buf_modname(
+#ifdef SHORT_FNAME
+ TRUE,
+#else
+ (curbuf->b_p_sn || curbuf->b_shortname),
+#endif
+ fname, ext, prepend_dot);
+}
+
+ char_u *
+buf_modname(shortname, fname, ext, prepend_dot)
+ int shortname; /* use 8.3 file name */
+ char_u *fname, *ext;
+ int prepend_dot; /* may prepend a '.' to file name */
+{
+ char_u *retval;
+ char_u *s;
+ char_u *e;
+ char_u *ptr;
+ int fnamelen, extlen;
+
+ extlen = (int)STRLEN(ext);
+
+ /*
+ * If there is no file name we must get the name of the current directory
+ * (we need the full path in case :cd is used).
+ */
+ if (fname == NULL || *fname == NUL)
+ {
+ retval = alloc((unsigned)(MAXPATHL + extlen + 3));
+ if (retval == NULL)
+ return NULL;
+ if (mch_dirname(retval, MAXPATHL) == FAIL ||
+ (fnamelen = (int)STRLEN(retval)) == 0)
+ {
+ vim_free(retval);
+ return NULL;
+ }
+ if (!vim_ispathsep(retval[fnamelen - 1]))
+ {
+ retval[fnamelen++] = PATHSEP;
+ retval[fnamelen] = NUL;
+ }
+#ifndef SHORT_FNAME
+ prepend_dot = FALSE; /* nothing to prepend a dot to */
+#endif
+ }
+ else
+ {
+ fnamelen = (int)STRLEN(fname);
+ retval = alloc((unsigned)(fnamelen + extlen + 3));
+ if (retval == NULL)
+ return NULL;
+ STRCPY(retval, fname);
+#ifdef VMS
+ vms_remove_version(retval); /* we do not need versions here */
+#endif
+ }
+
+ /*
+ * search backwards until we hit a '/', '\' or ':' replacing all '.'
+ * by '_' for MSDOS or when shortname option set and ext starts with a dot.
+ * Then truncate what is after the '/', '\' or ':' to 8 characters for
+ * MSDOS and 26 characters for AMIGA, a lot more for UNIX.
+ */
+ for (ptr = retval + fnamelen; ptr >= retval; ptr--)
+ {
+#ifndef RISCOS
+ if (*ext == '.'
+#ifdef USE_LONG_FNAME
+ && (!USE_LONG_FNAME || shortname)
+#else
+# ifndef SHORT_FNAME
+ && shortname
+# endif
+#endif
+ )
+ if (*ptr == '.') /* replace '.' by '_' */
+ *ptr = '_';
+#endif /* RISCOS */
+ if (vim_ispathsep(*ptr))
+ break;
+ }
+ ptr++;
+
+ /* the file name has at most BASENAMELEN characters. */
+#ifndef SHORT_FNAME
+ if (STRLEN(ptr) > (unsigned)BASENAMELEN)
+ ptr[BASENAMELEN] = '\0';
+#endif
+
+ s = ptr + STRLEN(ptr);
+
+ /*
+ * For 8.3 file names we may have to reduce the length.
+ */
+#ifdef USE_LONG_FNAME
+ if (!USE_LONG_FNAME || shortname)
+#else
+# ifndef SHORT_FNAME
+ if (shortname)
+# endif
+#endif
+ {
+ /*
+ * If there is no file name, or the file name ends in '/', and the
+ * extension starts with '.', put a '_' before the dot, because just
+ * ".ext" is invalid.
+ */
+ if (fname == NULL || *fname == NUL
+ || vim_ispathsep(fname[STRLEN(fname) - 1]))
+ {
+#ifdef RISCOS
+ if (*ext == '/')
+#else
+ if (*ext == '.')
+#endif
+ *s++ = '_';
+ }
+ /*
+ * If the extension starts with '.', truncate the base name at 8
+ * characters
+ */
+#ifdef RISCOS
+ /* We normally use '/', but swap files are '_' */
+ else if (*ext == '/' || *ext == '_')
+#else
+ else if (*ext == '.')
+#endif
+ {
+ if (s - ptr > (size_t)8)
+ {
+ s = ptr + 8;
+ *s = '\0';
+ }
+ }
+ /*
+ * If the extension doesn't start with '.', and the file name
+ * doesn't have an extension yet, append a '.'
+ */
+#ifdef RISCOS
+ else if ((e = vim_strchr(ptr, '/')) == NULL)
+ *s++ = '/';
+#else
+ else if ((e = vim_strchr(ptr, '.')) == NULL)
+ *s++ = '.';
+#endif
+ /*
+ * If the extension doesn't start with '.', and there already is an
+ * extension, it may need to be tructated
+ */
+ else if ((int)STRLEN(e) + extlen > 4)
+ s = e + 4 - extlen;
+ }
+#if defined(OS2) || defined(USE_LONG_FNAME) || defined(WIN3264)
+ /*
+ * If there is no file name, and the extension starts with '.', put a
+ * '_' before the dot, because just ".ext" may be invalid if it's on a
+ * FAT partition, and on HPFS it doesn't matter.
+ */
+ else if ((fname == NULL || *fname == NUL) && *ext == '.')
+ *s++ = '_';
+#endif
+
+ /*
+ * Append the extention.
+ * ext can start with '.' and cannot exceed 3 more characters.
+ */
+ STRCPY(s, ext);
+
+#ifndef SHORT_FNAME
+ /*
+ * Prepend the dot.
+ */
+ if (prepend_dot && !shortname && *(e = gettail(retval)) !=
+#ifdef RISCOS
+ '/'
+#else
+ '.'
+#endif
+#ifdef USE_LONG_FNAME
+ && USE_LONG_FNAME
+#endif
+ )
+ {
+ mch_memmove(e + 1, e, STRLEN(e) + 1);
+#ifdef RISCOS
+ *e = '/';
+#else
+ *e = '.';
+#endif
+ }
+#endif
+
+ /*
+ * Check that, after appending the extension, the file name is really
+ * different.
+ */
+ if (fname != NULL && STRCMP(fname, retval) == 0)
+ {
+ /* we search for a character that can be replaced by '_' */
+ while (--s >= ptr)
+ {
+ if (*s != '_')
+ {
+ *s = '_';
+ break;
+ }
+ }
+ if (s < ptr) /* fname was "________.<ext>", how tricky! */
+ *ptr = 'v';
+ }
+ return retval;
+}
+
+/*
+ * Like fgets(), but if the file line is too long, it is truncated and the
+ * rest of the line is thrown away. Returns TRUE for end-of-file.
+ */
+ int
+vim_fgets(buf, size, fp)
+ char_u *buf;
+ int size;
+ FILE *fp;
+{
+ char *eof;
+#define FGETS_SIZE 200
+ char tbuf[FGETS_SIZE];
+
+ buf[size - 2] = NUL;
+#ifdef USE_CR
+ eof = fgets_cr((char *)buf, size, fp);
+#else
+ eof = fgets((char *)buf, size, fp);
+#endif
+ if (buf[size - 2] != NUL && buf[size - 2] != '\n')
+ {
+ buf[size - 1] = NUL; /* Truncate the line */
+
+ /* Now throw away the rest of the line: */
+ do
+ {
+ tbuf[FGETS_SIZE - 2] = NUL;
+#ifdef USE_CR
+ fgets_cr((char *)tbuf, FGETS_SIZE, fp);
+#else
+ fgets((char *)tbuf, FGETS_SIZE, fp);
+#endif
+ } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
+ }
+ return (eof == NULL);
+}
+
+#if defined(USE_CR) || defined(PROTO)
+/*
+ * Like vim_fgets(), but accept any line terminator: CR, CR-LF or LF.
+ * Returns TRUE for end-of-file.
+ * Only used for the Mac, because it's much slower than vim_fgets().
+ */
+ int
+tag_fgets(buf, size, fp)
+ char_u *buf;
+ int size;
+ FILE *fp;
+{
+ int i = 0;
+ int c;
+ int eof = FALSE;
+
+ for (;;)
+ {
+ c = fgetc(fp);
+ if (c == EOF)
+ {
+ eof = TRUE;
+ break;
+ }
+ if (c == '\r')
+ {
+ /* Always store a NL for end-of-line. */
+ if (i < size - 1)
+ buf[i++] = '\n';
+ c = fgetc(fp);
+ if (c != '\n') /* Macintosh format: single CR. */
+ ungetc(c, fp);
+ break;
+ }
+ if (i < size - 1)
+ buf[i++] = c;
+ if (c == '\n')
+ break;
+ }
+ buf[i] = NUL;
+ return eof;
+}
+#endif
+
+/*
+ * rename() only works if both files are on the same file system, this
+ * function will (attempts to?) copy the file across if rename fails -- webb
+ * Return -1 for failure, 0 for success.
+ */
+ int
+vim_rename(from, to)
+ char_u *from;
+ char_u *to;
+{
+ int fd_in;
+ int fd_out;
+ int n;
+ char *errmsg = NULL;
+ char *buffer;
+#ifdef AMIGA
+ BPTR flock;
+#endif
+ struct stat st;
+
+ /*
+ * When the names are identical, there is nothing to do.
+ */
+ if (fnamecmp(from, to) == 0)
+ return 0;
+
+ /*
+ * Fail if the "from" file doesn't exist. Avoids that "to" is deleted.
+ */
+ if (mch_stat((char *)from, &st) < 0)
+ return -1;
+
+ /*
+ * Delete the "to" file, this is required on some systems to make the
+ * mch_rename() work, on other systems it makes sure that we don't have
+ * two files when the mch_rename() fails.
+ */
+
+#ifdef AMIGA
+ /*
+ * With MSDOS-compatible filesystems (crossdos, messydos) it is possible
+ * that the name of the "to" file is the same as the "from" file, even
+ * though the names are different. To avoid the chance of accidently
+ * deleting the "from" file (horror!) we lock it during the remove.
+ *
+ * When used for making a backup before writing the file: This should not
+ * happen with ":w", because startscript() should detect this problem and
+ * set buf->b_shortname, causing modname() to return a correct ".bak" file
+ * name. This problem does exist with ":w filename", but then the
+ * original file will be somewhere else so the backup isn't really
+ * important. If autoscripting is off the rename may fail.
+ */
+ flock = Lock((UBYTE *)from, (long)ACCESS_READ);
+#endif
+ mch_remove(to);
+#ifdef AMIGA
+ if (flock)
+ UnLock(flock);
+#endif
+
+ /*
+ * First try a normal rename, return if it works.
+ */
+ if (mch_rename((char *)from, (char *)to) == 0)
+ return 0;
+
+ /*
+ * Rename() failed, try copying the file.
+ */
+ fd_in = mch_open((char *)from, O_RDONLY|O_EXTRA, 0);
+ if (fd_in == -1)
+ return -1;
+ fd_out = mch_open((char *)to, O_CREAT|O_EXCL|O_WRONLY|O_EXTRA, 0666);
+ if (fd_out == -1)
+ {
+ close(fd_in);
+ return -1;
+ }
+
+ buffer = (char *)alloc(BUFSIZE);
+ if (buffer == NULL)
+ {
+ close(fd_in);
+ close(fd_out);
+ return -1;
+ }
+
+ while ((n = vim_read(fd_in, buffer, BUFSIZE)) > 0)
+ if (vim_write(fd_out, buffer, n) != n)
+ {
+ errmsg = _("E208: Error writing to \"%s\"");
+ break;
+ }
+
+ vim_free(buffer);
+ close(fd_in);
+ if (close(fd_out) < 0)
+ errmsg = _("E209: Error closing \"%s\"");
+ if (n < 0)
+ {
+ errmsg = _("E210: Error reading \"%s\"");
+ to = from;
+ }
+ if (errmsg != NULL)
+ {
+ EMSG2(errmsg, to);
+ return -1;
+ }
+ mch_remove(from);
+ return 0;
+}
+
+static int already_warned = FALSE;
+
+/*
+ * Check if any not hidden buffer has been changed.
+ * Postpone the check if there are characters in the stuff buffer, a global
+ * command is being executed, a mapping is being executed or an autocommand is
+ * busy.
+ * Returns TRUE if some message was written (screen should be redrawn and
+ * cursor positioned).
+ */
+ int
+check_timestamps(focus)
+ int focus; /* called for GUI focus event */
+{
+ buf_T *buf;
+ int didit = 0;
+ int n;
+
+ /* Don't check timestamps while system() or another low-level function may
+ * cause us to lose and gain focus. */
+ if (no_check_timestamps > 0)
+ return FALSE;
+
+ /* Avoid doing a check twice. The OK/Reload dialog can cause a focus
+ * event and we would keep on checking if the file is steadily growing.
+ * Do check again after typing something. */
+ if (focus && did_check_timestamps)
+ {
+ need_check_timestamps = TRUE;
+ return FALSE;
+ }
+
+ if (!stuff_empty() || global_busy || !typebuf_typed()
+#ifdef FEAT_AUTOCMD
+ || autocmd_busy
+#endif
+ )
+ need_check_timestamps = TRUE; /* check later */
+ else
+ {
+ ++no_wait_return;
+ did_check_timestamps = TRUE;
+ already_warned = FALSE;
+ for (buf = firstbuf; buf != NULL; )
+ {
+ /* Only check buffers in a window. */
+ if (buf->b_nwindows > 0)
+ {
+ n = buf_check_timestamp(buf, focus);
+ if (didit < n)
+ didit = n;
+ if (n > 0 && !buf_valid(buf))
+ {
+ /* Autocommands have removed the buffer, start at the
+ * first one again. */
+ buf = firstbuf;
+ continue;
+ }
+ }
+ buf = buf->b_next;
+ }
+ --no_wait_return;
+ need_check_timestamps = FALSE;
+ if (need_wait_return && didit == 2)
+ {
+ /* make sure msg isn't overwritten */
+ msg_puts((char_u *)"\n");
+ out_flush();
+ }
+ }
+ return didit;
+}
+
+/*
+ * Move all the lines from buffer "frombuf" to buffer "tobuf".
+ * Return OK or FAIL. When FAIL "tobuf" is incomplete and/or "frombuf" is not
+ * empty.
+ */
+ static int
+move_lines(frombuf, tobuf)
+ buf_T *frombuf;
+ buf_T *tobuf;
+{
+ buf_T *tbuf = curbuf;
+ int retval = OK;
+ linenr_T lnum;
+ char_u *p;
+
+ /* Copy the lines in "frombuf" to "tobuf". */
+ curbuf = tobuf;
+ for (lnum = 1; lnum <= frombuf->b_ml.ml_line_count; ++lnum)
+ {
+ p = vim_strsave(ml_get_buf(frombuf, lnum, FALSE));
+ if (p == NULL || ml_append(lnum - 1, p, 0, FALSE) == FAIL)
+ {
+ vim_free(p);
+ retval = FAIL;
+ break;
+ }
+ vim_free(p);
+ }
+
+ /* Delete all the lines in "frombuf". */
+ if (retval != FAIL)
+ {
+ curbuf = frombuf;
+ while (!bufempty())
+ if (ml_delete(curbuf->b_ml.ml_line_count, FALSE) == FAIL)
+ {
+ /* Oops! We could try putting back the saved lines, but that
+ * might fail again... */
+ retval = FAIL;
+ break;
+ }
+ }
+
+ curbuf = tbuf;
+ return retval;
+}
+
+/*
+ * Check if buffer "buf" has been changed.
+ * Also check if the file for a new buffer unexpectedly appeared.
+ * return 1 if a changed buffer was found.
+ * return 2 if a message has been displayed.
+ * return 0 otherwise.
+ */
+/*ARGSUSED*/
+ int
+buf_check_timestamp(buf, focus)
+ buf_T *buf;
+ int focus; /* called for GUI focus event */
+{
+ struct stat st;
+ int stat_res;
+ int retval = 0;
+ char_u *path;
+ char_u *tbuf;
+ char *mesg = NULL;
+ char *mesg2;
+ int helpmesg = FALSE;
+ int reload = FALSE;
+#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
+ int can_reload = FALSE;
+#endif
+ size_t orig_size = buf->b_orig_size;
+ int orig_mode = buf->b_orig_mode;
+#ifdef FEAT_GUI
+ int save_mouse_correct = need_mouse_correct;
+#endif
+#ifdef FEAT_AUTOCMD
+ static int busy = FALSE;
+#endif
+
+ /* If there is no file name, the buffer is not loaded, 'buftype' is
+ * set, we are in the middle of a save or being called recursively: ignore
+ * this buffer. */
+ if (buf->b_ffname == NULL
+ || buf->b_ml.ml_mfp == NULL
+#if defined(FEAT_QUICKFIX)
+ || *buf->b_p_bt != NUL
+#endif
+ || buf->b_saving
+#ifdef FEAT_AUTOCMD
+ || busy
+#endif
+ )
+ return 0;
+
+ if ( !(buf->b_flags & BF_NOTEDITED)
+ && buf->b_mtime != 0
+ && ((stat_res = mch_stat((char *)buf->b_ffname, &st)) < 0
+ || time_differs((long)st.st_mtime, buf->b_mtime)
+#ifdef HAVE_ST_MODE
+ || (int)st.st_mode != buf->b_orig_mode
+#else
+ || mch_getperm(buf->b_ffname) != buf->b_orig_mode
+#endif
+ ))
+ {
+ retval = 1;
+
+ /* set b_mtime to stop further warnings */
+ if (stat_res < 0)
+ {
+ buf->b_mtime = 0;
+ buf->b_orig_size = 0;
+ buf->b_orig_mode = 0;
+ }
+ else
+ buf_store_time(buf, &st, buf->b_ffname);
+
+ /* Don't do anything for a directory. Might contain the file
+ * explorer. */
+ if (mch_isdir(buf->b_fname))
+ ;
+
+ /*
+ * If 'autoread' is set, the buffer has no changes and the file still
+ * exists, reload the buffer. Use the buffer-local option value if it
+ * was set, the global option value otherwise.
+ */
+ else if ((buf->b_p_ar >= 0 ? buf->b_p_ar : p_ar)
+ && !bufIsChanged(buf) && stat_res >= 0)
+ reload = TRUE;
+ else
+ {
+#ifdef FEAT_AUTOCMD
+ int n;
+
+ /*
+ * Only give the warning if there are no FileChangedShell
+ * autocommands.
+ * Avoid being called recursively by setting "busy".
+ */
+ busy = TRUE;
+ n = apply_autocmds(EVENT_FILECHANGEDSHELL,
+ buf->b_fname, buf->b_fname, FALSE, buf);
+ busy = FALSE;
+ if (n)
+ {
+ if (!buf_valid(buf))
+ EMSG(_("E246: FileChangedShell autocommand deleted buffer"));
+ return 2;
+ }
+ else
+#endif
+ {
+ if (stat_res < 0)
+ mesg = _("E211: Warning: File \"%s\" no longer available");
+ else
+ {
+ helpmesg = TRUE;
+#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
+ can_reload = TRUE;
+#endif
+ /*
+ * Check if the file contents really changed to avoid
+ * giving a warning when only the timestamp was set (e.g.,
+ * checked out of CVS). Always warn when the buffer was
+ * changed.
+ */
+ if (bufIsChanged(buf))
+ mesg = _("W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as well");
+ else if (orig_size != buf->b_orig_size
+ || buf_contents_changed(buf))
+ mesg = _("W11: Warning: File \"%s\" has changed since editing started");
+ else if (orig_mode != buf->b_orig_mode)
+ mesg = _("W16: Warning: Mode of file \"%s\" has changed since editing started");
+ }
+ }
+ }
+
+ }
+ else if ((buf->b_flags & BF_NEW) && !(buf->b_flags & BF_NEW_W)
+ && vim_fexists(buf->b_ffname))
+ {
+ retval = 1;
+ mesg = _("W13: Warning: File \"%s\" has been created after editing started");
+ buf->b_flags |= BF_NEW_W;
+#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
+ can_reload = TRUE;
+#endif
+ }
+
+ if (mesg != NULL)
+ {
+ path = home_replace_save(buf, buf->b_fname);
+ if (path != NULL)
+ {
+ if (helpmesg)
+ mesg2 = _("See \":help W11\" for more info.");
+ else
+ mesg2 = "";
+ tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
+ + STRLEN(mesg2) + 2));
+ sprintf((char *)tbuf, mesg, path);
+#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
+ if (can_reload)
+ {
+ if (*mesg2 != NUL)
+ {
+ STRCAT(tbuf, "\n");
+ STRCAT(tbuf, mesg2);
+ }
+ if (do_dialog(VIM_WARNING, (char_u *)_("Warning"), tbuf,
+ (char_u *)_("&OK\n&Load File"), 1, NULL) == 2)
+ reload = TRUE;
+ }
+ else
+#endif
+ if (State > NORMAL_BUSY || (State & CMDLINE) || already_warned)
+ {
+ if (*mesg2 != NUL)
+ {
+ STRCAT(tbuf, "; ");
+ STRCAT(tbuf, mesg2);
+ }
+ EMSG(tbuf);
+ retval = 2;
+ }
+ else
+ {
+# ifdef VIMBUDDY
+ VimBuddyText(tbuf + 9, 2);
+# else
+# ifdef FEAT_AUTOCMD
+ if (!autocmd_busy)
+# endif
+ {
+ msg_start();
+ msg_puts_attr(tbuf, hl_attr(HLF_E) + MSG_HIST);
+ if (*mesg2 != NUL)
+ msg_puts_attr((char_u *)mesg2,
+ hl_attr(HLF_W) + MSG_HIST);
+ msg_clr_eos();
+ (void)msg_end();
+ if (emsg_silent == 0)
+ {
+ out_flush();
+# ifdef FEAT_GUI
+ if (!focus)
+# endif
+ /* give the user some time to think about it */
+ ui_delay(1000L, TRUE);
+
+ /* don't redraw and erase the message */
+ redraw_cmdline = FALSE;
+ }
+ }
+ already_warned = TRUE;
+# endif
+ }
+
+ vim_free(path);
+ vim_free(tbuf);
+ }
+ }
+
+ if (reload)
+ {
+ exarg_T ea;
+ pos_T old_cursor;
+ linenr_T old_topline;
+ int old_ro = buf->b_p_ro;
+ buf_T *savebuf;
+ int saved = OK;
+#ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+
+ /* set curwin/curbuf for "buf" and save some things */
+ aucmd_prepbuf(&aco, buf);
+#else
+ buf_T *save_curbuf = curbuf;
+
+ curbuf = buf;
+ curwin->w_buffer = buf;
+#endif
+
+ /* We only want to read the text from the file, not reset the syntax
+ * highlighting, clear marks, diff status, etc. Force the fileformat
+ * and encoding to be the same. */
+ if (prep_exarg(&ea, buf) == OK)
+ {
+ old_cursor = curwin->w_cursor;
+ old_topline = curwin->w_topline;
+
+ /*
+ * To behave like when a new file is edited (matters for
+ * BufReadPost autocommands) we first need to delete the current
+ * buffer contents. But if reading the file fails we should keep
+ * the old contents. Can't use memory only, the file might be
+ * too big. Use a hidden buffer to move the buffer contents to.
+ */
+ if (bufempty())
+ savebuf = NULL;
+ else
+ {
+ /* Allocate a buffer without putting it in the buffer list. */
+ savebuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
+ if (savebuf != NULL)
+ {
+ /* Open the memline. */
+ curbuf = savebuf;
+ curwin->w_buffer = savebuf;
+ saved = ml_open();
+ curbuf = buf;
+ curwin->w_buffer = buf;
+ }
+ if (savebuf == NULL || saved == FAIL
+ || move_lines(buf, savebuf) == FAIL)
+ {
+ EMSG2(_("E462: Could not prepare for reloading \"%s\""),
+ buf->b_fname);
+ saved = FAIL;
+ }
+ }
+
+ if (saved == OK)
+ {
+ curbuf->b_flags |= BF_CHECK_RO; /* check for RO again */
+#ifdef FEAT_AUTOCMD
+ keep_filetype = TRUE; /* don't detect 'filetype' */
+#endif
+ if (readfile(buf->b_ffname, buf->b_fname, (linenr_T)0,
+ (linenr_T)0,
+ (linenr_T)MAXLNUM, &ea, READ_NEW) == FAIL)
+ {
+#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
+ if (!aborting())
+#endif
+ EMSG2(_("E321: Could not reload \"%s\""), buf->b_fname);
+ if (savebuf != NULL)
+ {
+ /* Put the text back from the save buffer. First
+ * delete any lines that readfile() added. */
+ while (!bufempty())
+ if (ml_delete(curbuf->b_ml.ml_line_count, FALSE)
+ == FAIL)
+ break;
+ (void)move_lines(savebuf, buf);
+ }
+ }
+ else
+ {
+ /* Mark the buffer as unmodified and free undo info. */
+ unchanged(buf, TRUE);
+ u_blockfree(buf);
+ u_clearall(buf);
+ }
+ }
+ vim_free(ea.cmd);
+
+ if (savebuf != NULL)
+ wipe_buffer(savebuf, FALSE);
+
+#ifdef FEAT_DIFF
+ /* Invalidate diff info if necessary. */
+ diff_invalidate();
+#endif
+
+ /* Restore the topline and cursor position and check it (lines may
+ * have been removed). */
+ if (old_topline > curbuf->b_ml.ml_line_count)
+ curwin->w_topline = curbuf->b_ml.ml_line_count;
+ else
+ curwin->w_topline = old_topline;
+ curwin->w_cursor = old_cursor;
+ check_cursor();
+ update_topline();
+#ifdef FEAT_AUTOCMD
+ keep_filetype = FALSE;
+#endif
+#ifdef FEAT_FOLDING
+ {
+ win_T *wp;
+
+ /* Update folds unless they are defined manually. */
+ FOR_ALL_WINDOWS(wp)
+ if (wp->w_buffer == curwin->w_buffer
+ && !foldmethodIsManual(wp))
+ foldUpdateAll(wp);
+ }
+#endif
+ /* If the mode didn't change and 'readonly' was set, keep the old
+ * value; the user probably used the ":view" command. But don't
+ * reset it, might have had a read error. */
+ if (orig_mode == curbuf->b_orig_mode)
+ curbuf->b_p_ro |= old_ro;
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+ /* Careful: autocommands may have made "buf" invalid! */
+#else
+ curwin->w_buffer = save_curbuf;
+ curbuf = save_curbuf;
+#endif
+ }
+
+#ifdef FEAT_GUI
+ /* restore this in case an autocommand has set it; it would break
+ * 'mousefocus' */
+ need_mouse_correct = save_mouse_correct;
+#endif
+
+ return retval;
+}
+
+/*ARGSUSED*/
+ void
+buf_store_time(buf, st, fname)
+ buf_T *buf;
+ struct stat *st;
+ char_u *fname;
+{
+ buf->b_mtime = (long)st->st_mtime;
+ buf->b_orig_size = (size_t)st->st_size;
+#ifdef HAVE_ST_MODE
+ buf->b_orig_mode = (int)st->st_mode;
+#else
+ buf->b_orig_mode = mch_getperm(fname);
+#endif
+}
+
+/*
+ * Adjust the line with missing eol, used for the next write.
+ * Used for do_filter(), when the input lines for the filter are deleted.
+ */
+ void
+write_lnum_adjust(offset)
+ linenr_T offset;
+{
+ if (write_no_eol_lnum) /* only if there is a missing eol */
+ write_no_eol_lnum += offset;
+}
+
+#if defined(TEMPDIRNAMES) || defined(PROTO)
+static long temp_count = 0; /* Temp filename counter. */
+
+/*
+ * Delete the temp directory and all files it contains.
+ */
+ void
+vim_deltempdir()
+{
+ char_u **files;
+ int file_count;
+ int i;
+
+ if (vim_tempdir != NULL)
+ {
+ sprintf((char *)NameBuff, "%s*", vim_tempdir);
+ if (gen_expand_wildcards(1, &NameBuff, &file_count, &files,
+ EW_DIR|EW_FILE|EW_SILENT) == OK)
+ {
+ for (i = 0; i < file_count; ++i)
+ mch_remove(files[i]);
+ FreeWild(file_count, files);
+ }
+ gettail(NameBuff)[-1] = NUL;
+ (void)mch_rmdir(NameBuff);
+
+ vim_free(vim_tempdir);
+ vim_tempdir = NULL;
+ }
+}
+#endif
+
+/*
+ * vim_tempname(): Return a unique name that can be used for a temp file.
+ *
+ * The temp file is NOT created.
+ *
+ * The returned pointer is to allocated memory.
+ * The returned pointer is NULL if no valid name was found.
+ */
+/*ARGSUSED*/
+ char_u *
+vim_tempname(extra_char)
+ int extra_char; /* character to use in the name instead of '?' */
+{
+#ifdef USE_TMPNAM
+ char_u itmp[L_tmpnam]; /* use tmpnam() */
+#else
+ char_u itmp[TEMPNAMELEN];
+#endif
+
+#ifdef TEMPDIRNAMES
+ static char *(tempdirs[]) = {TEMPDIRNAMES};
+ int i;
+ long nr;
+ long off;
+# ifndef EEXIST
+ struct stat st;
+# endif
+
+ /*
+ * This will create a directory for private use by this instance of Vim.
+ * This is done once, and the same directory is used for all temp files.
+ * This method avoids security problems because of symlink attacks et al.
+ * It's also a bit faster, because we only need to check for an existing
+ * file when creating the directory and not for each temp file.
+ */
+ if (vim_tempdir == NULL)
+ {
+ /*
+ * Try the entries in TEMPDIRNAMES to create the temp directory.
+ */
+ for (i = 0; i < sizeof(tempdirs) / sizeof(char *); ++i)
+ {
+ /* expand $TMP, leave room for "/v1100000/999999999" */
+ expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
+ if (mch_isdir(itmp)) /* directory exists */
+ {
+# ifdef __EMX__
+ /* If $TMP contains a forward slash (perhaps using bash or
+ * tcsh), don't add a backslash, use a forward slash!
+ * Adding 2 backslashes didn't work. */
+ if (vim_strchr(itmp, '/') != NULL)
+ STRCAT(itmp, "/");
+ else
+# endif
+ add_pathsep(itmp);
+
+ /* Get an arbitrary number of up to 6 digits. When it's
+ * unlikely that it already exists it will be faster,
+ * otherwise it doesn't matter. The use of mkdir() avoids any
+ * security problems because of the predictable number. */
+ nr = (mch_get_pid() + (long)time(NULL)) % 1000000L;
+
+ /* Try up to 10000 different values until we find a name that
+ * doesn't exist. */
+ for (off = 0; off < 10000L; ++off)
+ {
+ int r;
+#if defined(UNIX) || defined(VMS)
+ mode_t umask_save;
+#endif
+
+ sprintf((char *)itmp + STRLEN(itmp), "v%ld", nr + off);
+# ifndef EEXIST
+ /* If mkdir() does not set errno to EEXIST, check for
+ * existing file here. There is a race condition then,
+ * although it's fail-safe. */
+ if (mch_stat((char *)itmp, &st) >= 0)
+ continue;
+# endif
+#if defined(UNIX) || defined(VMS)
+ /* Make sure the umask doesn't remove the executable bit.
+ * "repl" has been reported to use "177". */
+ umask_save = umask(077);
+#endif
+ r = vim_mkdir(itmp, 0700);
+#if defined(UNIX) || defined(VMS)
+ (void)umask(umask_save);
+#endif
+ if (r == 0)
+ {
+ char_u *buf;
+
+ /* Directory was created, use this name.
+ * Expand to full path; When using the current
+ * directory a ":cd" would confuse us. */
+ buf = alloc((unsigned)MAXPATHL + 1);
+ if (buf != NULL)
+ {
+ if (vim_FullName(itmp, buf, MAXPATHL, FALSE)
+ == FAIL)
+ STRCPY(buf, itmp);
+# ifdef __EMX__
+ if (vim_strchr(buf, '/') != NULL)
+ STRCAT(buf, "/");
+ else
+# endif
+ add_pathsep(buf);
+ vim_tempdir = vim_strsave(buf);
+ vim_free(buf);
+ }
+ break;
+ }
+# ifdef EEXIST
+ /* If the mkdir() didn't fail because the file/dir exists,
+ * we probably can't create any dir here, try another
+ * place. */
+ if (errno != EEXIST)
+# endif
+ break;
+ }
+ if (vim_tempdir != NULL)
+ break;
+ }
+ }
+ }
+
+ if (vim_tempdir != NULL)
+ {
+ /* There is no need to check if the file exists, because we own the
+ * directory and nobody else creates a file in it. */
+ sprintf((char *)itmp, "%s%ld", vim_tempdir, temp_count++);
+ return vim_strsave(itmp);
+ }
+
+ return NULL;
+
+#else /* TEMPDIRNAMES */
+
+# ifdef WIN3264
+ char szTempFile[_MAX_PATH + 1];
+ char buf4[4];
+ char_u *retval;
+ char_u *p;
+
+ STRCPY(itmp, "");
+ if (GetTempPath(_MAX_PATH, szTempFile) == 0)
+ szTempFile[0] = NUL; /* GetTempPath() failed, use current dir */
+ strcpy(buf4, "VIM");
+ buf4[2] = extra_char; /* make it "VIa", "VIb", etc. */
+ if (GetTempFileName(szTempFile, buf4, 0, itmp) == 0)
+ return NULL;
+ /* GetTempFileName() will create the file, we don't want that */
+ (void)DeleteFile(itmp);
+
+ /* Backslashes in a temp file name cause problems when filtering with
+ * "sh". NOTE: This also checks 'shellcmdflag' to help those people who
+ * didn't set 'shellslash'. */
+ retval = vim_strsave(itmp);
+ if (*p_shcf == '-' || p_ssl)
+ for (p = retval; *p; ++p)
+ if (*p == '\\')
+ *p = '/';
+ return retval;
+
+# else /* WIN3264 */
+
+# ifdef USE_TMPNAM
+ /* tmpnam() will make its own name */
+ if (*tmpnam((char *)itmp) == NUL)
+ return NULL;
+# else
+ char_u *p;
+
+# ifdef VMS_TEMPNAM
+ /* mktemp() is not working on VMS. It seems to be
+ * a do-nothing function. Therefore we use tempnam().
+ */
+ sprintf((char *)itmp, "VIM%c", extra_char);
+ p = (char_u *)tempnam("tmp:", (char *)itmp);
+ if (p != NULL)
+ {
+ /* VMS will use '.LOG' if we don't explicitly specify an extension,
+ * and VIM will then be unable to find the file later */
+ STRCPY(itmp, p);
+ STRCAT(itmp, ".txt");
+ free(p);
+ }
+ else
+ return NULL;
+# else
+ STRCPY(itmp, TEMPNAME);
+ if ((p = vim_strchr(itmp, '?')) != NULL)
+ *p = extra_char;
+ if (mktemp((char *)itmp) == NULL)
+ return NULL;
+# endif
+# endif
+
+ return vim_strsave(itmp);
+# endif /* WIN3264 */
+#endif /* TEMPDIRNAMES */
+}
+
+#if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
+/*
+ * Convert all backslashes in fname to forward slashes in-place.
+ */
+ void
+forward_slash(fname)
+ char_u *fname;
+{
+ char_u *p;
+
+ for (p = fname; *p != NUL; ++p)
+# ifdef FEAT_MBYTE
+ /* The Big5 encoding can have '\' in the trail byte. */
+ if (enc_dbcs != 0 && (*mb_ptr2len_check)(p) > 1)
+ ++p;
+ else
+# endif
+ if (*p == '\\')
+ *p = '/';
+}
+#endif
+
+
+/*
+ * Code for automatic commands.
+ *
+ * Only included when "FEAT_AUTOCMD" has been defined.
+ */
+
+#if defined(FEAT_AUTOCMD) || defined(PROTO)
+
+/*
+ * The autocommands are stored in a list for each event.
+ * Autocommands for the same pattern, that are consecutive, are joined
+ * together, to avoid having to match the pattern too often.
+ * The result is an array of Autopat lists, which point to AutoCmd lists:
+ *
+ * first_autopat[0] --> Autopat.next --> Autopat.next --> NULL
+ * Autopat.cmds Autopat.cmds
+ * | |
+ * V V
+ * AutoCmd.next AutoCmd.next
+ * | |
+ * V V
+ * AutoCmd.next NULL
+ * |
+ * V
+ * NULL
+ *
+ * first_autopat[1] --> Autopat.next --> NULL
+ * Autopat.cmds
+ * |
+ * V
+ * AutoCmd.next
+ * |
+ * V
+ * NULL
+ * etc.
+ *
+ * The order of AutoCmds is important, this is the order in which they were
+ * defined and will have to be executed.
+ */
+typedef struct AutoCmd
+{
+ char_u *cmd; /* The command to be executed (NULL
+ when command has been removed) */
+ char nested; /* If autocommands nest here */
+ char last; /* last command in list */
+#ifdef FEAT_EVAL
+ scid_T scriptID; /* script ID where defined */
+#endif
+ struct AutoCmd *next; /* Next AutoCmd in list */
+} AutoCmd;
+
+typedef struct AutoPat
+{
+ int group; /* group ID */
+ char_u *pat; /* pattern as typed (NULL when pattern
+ has been removed) */
+ int patlen; /* strlen() of pat */
+ char_u *reg_pat; /* pattern converted to regexp */
+ char allow_dirs; /* Pattern may match whole path */
+ char last; /* last pattern for apply_autocmds() */
+ AutoCmd *cmds; /* list of commands to do */
+ struct AutoPat *next; /* next AutoPat in AutoPat list */
+} AutoPat;
+
+static struct event_name
+{
+ char *name; /* event name */
+ EVENT_T event; /* event number */
+} event_names[] =
+{
+ {"BufAdd", EVENT_BUFADD},
+ {"BufCreate", EVENT_BUFADD},
+ {"BufDelete", EVENT_BUFDELETE},
+ {"BufEnter", EVENT_BUFENTER},
+ {"BufFilePost", EVENT_BUFFILEPOST},
+ {"BufFilePre", EVENT_BUFFILEPRE},
+ {"BufHidden", EVENT_BUFHIDDEN},
+ {"BufLeave", EVENT_BUFLEAVE},
+ {"BufNew", EVENT_BUFNEW},
+ {"BufNewFile", EVENT_BUFNEWFILE},
+ {"BufRead", EVENT_BUFREADPOST},
+ {"BufReadCmd", EVENT_BUFREADCMD},
+ {"BufReadPost", EVENT_BUFREADPOST},
+ {"BufReadPre", EVENT_BUFREADPRE},
+ {"BufUnload", EVENT_BUFUNLOAD},
+ {"BufWinEnter", EVENT_BUFWINENTER},
+ {"BufWinLeave", EVENT_BUFWINLEAVE},
+ {"BufWipeout", EVENT_BUFWIPEOUT},
+ {"BufWrite", EVENT_BUFWRITEPRE},
+ {"BufWritePost", EVENT_BUFWRITEPOST},
+ {"BufWritePre", EVENT_BUFWRITEPRE},
+ {"BufWriteCmd", EVENT_BUFWRITECMD},
+ {"CmdwinEnter", EVENT_CMDWINENTER},
+ {"CmdwinLeave", EVENT_CMDWINLEAVE},
+ {"EncodingChanged", EVENT_ENCODINGCHANGED},
+ {"FileEncoding", EVENT_ENCODINGCHANGED},
+ {"CursorHold", EVENT_CURSORHOLD},
+ {"FileAppendPost", EVENT_FILEAPPENDPOST},
+ {"FileAppendPre", EVENT_FILEAPPENDPRE},
+ {"FileAppendCmd", EVENT_FILEAPPENDCMD},
+ {"FileChangedShell",EVENT_FILECHANGEDSHELL},
+ {"FileChangedRO", EVENT_FILECHANGEDRO},
+ {"FileReadPost", EVENT_FILEREADPOST},
+ {"FileReadPre", EVENT_FILEREADPRE},
+ {"FileReadCmd", EVENT_FILEREADCMD},
+ {"FileType", EVENT_FILETYPE},
+ {"FileWritePost", EVENT_FILEWRITEPOST},
+ {"FileWritePre", EVENT_FILEWRITEPRE},
+ {"FileWriteCmd", EVENT_FILEWRITECMD},
+ {"FilterReadPost", EVENT_FILTERREADPOST},
+ {"FilterReadPre", EVENT_FILTERREADPRE},
+ {"FilterWritePost", EVENT_FILTERWRITEPOST},
+ {"FilterWritePre", EVENT_FILTERWRITEPRE},
+ {"FocusGained", EVENT_FOCUSGAINED},
+ {"FocusLost", EVENT_FOCUSLOST},
+ {"FuncUndefined", EVENT_FUNCUNDEFINED},
+ {"GUIEnter", EVENT_GUIENTER},
+ {"RemoteReply", EVENT_REMOTEREPLY},
+ {"StdinReadPost", EVENT_STDINREADPOST},
+ {"StdinReadPre", EVENT_STDINREADPRE},
+ {"Syntax", EVENT_SYNTAX},
+ {"TermChanged", EVENT_TERMCHANGED},
+ {"TermResponse", EVENT_TERMRESPONSE},
+ {"User", EVENT_USER},
+ {"VimEnter", EVENT_VIMENTER},
+ {"VimLeave", EVENT_VIMLEAVE},
+ {"VimLeavePre", EVENT_VIMLEAVEPRE},
+ {"WinEnter", EVENT_WINENTER},
+ {"WinLeave", EVENT_WINLEAVE},
+ {NULL, (EVENT_T)0}
+};
+
+static AutoPat *first_autopat[NUM_EVENTS] =
+{
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+
+/*
+ * struct used to keep status while executing autocommands for an event.
+ */
+typedef struct AutoPatCmd
+{
+ AutoPat *curpat; /* next AutoPat to examine */
+ AutoCmd *nextcmd; /* next AutoCmd to execute */
+ int group; /* group being used */
+ char_u *fname; /* fname to match with */
+ char_u *sfname; /* sfname to match with */
+ char_u *tail; /* tail of fname */
+ EVENT_T event; /* current event */
+} AutoPatCmd;
+
+/*
+ * augroups stores a list of autocmd group names.
+ */
+garray_T augroups = {0, 0, sizeof(char_u *), 10, NULL};
+#define AUGROUP_NAME(i) (((char_u **)augroups.ga_data)[i])
+
+/*
+ * The ID of the current group. Group 0 is the default one.
+ */
+#define AUGROUP_DEFAULT -1 /* default autocmd group */
+#define AUGROUP_ERROR -2 /* errornouse autocmd group */
+#define AUGROUP_ALL -3 /* all autocmd groups */
+static int current_augroup = AUGROUP_DEFAULT;
+
+static int au_need_clean = FALSE; /* need to delete marked patterns */
+
+static void show_autocmd __ARGS((AutoPat *ap, EVENT_T event));
+static void au_remove_pat __ARGS((AutoPat *ap));
+static void au_remove_cmds __ARGS((AutoPat *ap));
+static void au_cleanup __ARGS((void));
+static int au_new_group __ARGS((char_u *name));
+static void au_del_group __ARGS((char_u *name));
+static int au_find_group __ARGS((char_u *name));
+static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end));
+static char_u *event_nr2name __ARGS((EVENT_T event));
+static char_u *find_end_event __ARGS((char_u *arg, int have_group));
+static int event_ignored __ARGS((EVENT_T event));
+static int au_get_grouparg __ARGS((char_u **argp));
+static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
+static char_u *getnextac __ARGS((int c, void *cookie, int indent));
+static int apply_autocmds_group __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
+static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
+
+static EVENT_T last_event;
+static int last_group;
+
+/*
+ * Show the autocommands for one AutoPat.
+ */
+ static void
+show_autocmd(ap, event)
+ AutoPat *ap;
+ EVENT_T event;
+{
+ AutoCmd *ac;
+
+ /* Check for "got_int" (here and at various places below), which is set
+ * when "q" has been hit for the "--more--" prompt */
+ if (got_int)
+ return;
+ if (ap->pat == NULL) /* pattern has been removed */
+ return;
+
+ msg_putchar('\n');
+ if (got_int)
+ return;
+ if (event != last_event || ap->group != last_group)
+ {
+ if (ap->group != AUGROUP_DEFAULT)
+ {
+ if (AUGROUP_NAME(ap->group) == NULL)
+ msg_puts_attr((char_u *)_("--Deleted--"), hl_attr(HLF_E));
+ else
+ msg_puts_attr(AUGROUP_NAME(ap->group), hl_attr(HLF_T));
+ msg_puts((char_u *)" ");
+ }
+ msg_puts_attr(event_nr2name(event), hl_attr(HLF_T));
+ last_event = event;
+ last_group = ap->group;
+ msg_putchar('\n');
+ if (got_int)
+ return;
+ }
+ msg_col = 4;
+ msg_outtrans(ap->pat);
+
+ for (ac = ap->cmds; ac != NULL; ac = ac->next)
+ {
+ if (ac->cmd != NULL) /* skip removed commands */
+ {
+ if (msg_col >= 14)
+ msg_putchar('\n');
+ msg_col = 14;
+ if (got_int)
+ return;
+ msg_outtrans(ac->cmd);
+ if (got_int)
+ return;
+ if (ac->next != NULL)
+ {
+ msg_putchar('\n');
+ if (got_int)
+ return;
+ }
+ }
+ }
+}
+
+/*
+ * Mark an autocommand pattern for deletion.
+ */
+ static void
+au_remove_pat(ap)
+ AutoPat *ap;
+{
+ vim_free(ap->pat);
+ ap->pat = NULL;
+ au_need_clean = TRUE;
+}
+
+/*
+ * Mark all commands for a pattern for deletion.
+ */
+ static void
+au_remove_cmds(ap)
+ AutoPat *ap;
+{
+ AutoCmd *ac;
+
+ for (ac = ap->cmds; ac != NULL; ac = ac->next)
+ {
+ vim_free(ac->cmd);
+ ac->cmd = NULL;
+ }
+ au_need_clean = TRUE;
+}
+
+/*
+ * Cleanup autocommands and patterns that have been deleted.
+ * This is only done when not executing autocommands.
+ */
+ static void
+au_cleanup()
+{
+ AutoPat *ap, **prev_ap;
+ AutoCmd *ac, **prev_ac;
+ EVENT_T event;
+
+ if (autocmd_busy || !au_need_clean)
+ return;
+
+ /* loop over all events */
+ for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
+ event = (EVENT_T)((int)event + 1))
+ {
+ /* loop over all autocommand patterns */
+ prev_ap = &(first_autopat[(int)event]);
+ for (ap = *prev_ap; ap != NULL; ap = *prev_ap)
+ {
+ /* loop over all commands for this pattern */
+ prev_ac = &(ap->cmds);
+ for (ac = *prev_ac; ac != NULL; ac = *prev_ac)
+ {
+ /* remove the command if the pattern is to be deleted or when
+ * the command has been marked for deletion */
+ if (ap->pat == NULL || ac->cmd == NULL)
+ {
+ *prev_ac = ac->next;
+ vim_free(ac->cmd);
+ vim_free(ac);
+ }
+ else
+ prev_ac = &(ac->next);
+ }
+
+ /* remove the pattern if it has been marked for deletion */
+ if (ap->pat == NULL)
+ {
+ *prev_ap = ap->next;
+ vim_free(ap->reg_pat);
+ vim_free(ap);
+ }
+ else
+ prev_ap = &(ap->next);
+ }
+ }
+
+ au_need_clean = FALSE;
+}
+
+/*
+ * Add an autocmd group name.
+ * Return it's ID. Returns AUGROUP_ERROR (< 0) for error.
+ */
+ static int
+au_new_group(name)
+ char_u *name;
+{
+ int i;
+
+ i = au_find_group(name);
+ if (i == AUGROUP_ERROR) /* the group doesn't exist yet, add it */
+ {
+ /* First try using a free entry. */
+ for (i = 0; i < augroups.ga_len; ++i)
+ if (AUGROUP_NAME(i) == NULL)
+ break;
+ if (i == augroups.ga_len && ga_grow(&augroups, 1) == FAIL)
+ return AUGROUP_ERROR;
+
+ AUGROUP_NAME(i) = vim_strsave(name);
+ if (AUGROUP_NAME(i) == NULL)
+ return AUGROUP_ERROR;
+ if (i == augroups.ga_len)
+ {
+ ++augroups.ga_len;
+ --augroups.ga_room;
+ }
+ }
+
+ return i;
+}
+
+ static void
+au_del_group(name)
+ char_u *name;
+{
+ int i;
+
+ i = au_find_group(name);
+ if (i == AUGROUP_ERROR) /* the group doesn't exist */
+ EMSG2(_("E367: No such group: \"%s\""), name);
+ else
+ {
+ vim_free(AUGROUP_NAME(i));
+ AUGROUP_NAME(i) = NULL;
+ }
+}
+
+/*
+ * Find the ID of an autocmd group name.
+ * Return it's ID. Returns AUGROUP_ERROR (< 0) for error.
+ */
+ static int
+au_find_group(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; i < augroups.ga_len; ++i)
+ if (AUGROUP_NAME(i) != NULL && STRCMP(AUGROUP_NAME(i), name) == 0)
+ return i;
+ return AUGROUP_ERROR;
+}
+
+/*
+ * ":augroup {name}".
+ */
+ void
+do_augroup(arg, del_group)
+ char_u *arg;
+ int del_group;
+{
+ int i;
+
+ if (del_group)
+ {
+ if (*arg == NUL)
+ EMSG(_(e_argreq));
+ else
+ au_del_group(arg);
+ }
+ else if (STRICMP(arg, "end") == 0) /* ":aug end": back to group 0 */
+ current_augroup = AUGROUP_DEFAULT;
+ else if (*arg) /* ":aug xxx": switch to group xxx */
+ {
+ i = au_new_group(arg);
+ if (i != AUGROUP_ERROR)
+ current_augroup = i;
+ }
+ else /* ":aug": list the group names */
+ {
+ msg_start();
+ for (i = 0; i < augroups.ga_len; ++i)
+ {
+ if (AUGROUP_NAME(i) != NULL)
+ {
+ msg_puts(AUGROUP_NAME(i));
+ msg_puts((char_u *)" ");
+ }
+ }
+ msg_clr_eos();
+ msg_end();
+ }
+}
+
+/*
+ * Return the event number for event name "start".
+ * Return NUM_EVENTS if the event name was not found.
+ * Return a pointer to the next event name in "end".
+ */
+ static EVENT_T
+event_name2nr(start, end)
+ char_u *start;
+ char_u **end;
+{
+ char_u *p;
+ int i;
+ int len;
+
+ /* the event name ends with end of line, a blank or a comma */
+ for (p = start; *p && !vim_iswhite(*p) && *p != ','; ++p)
+ ;
+ for (i = 0; event_names[i].name != NULL; ++i)
+ {
+ len = (int)STRLEN(event_names[i].name);
+ if (len == p - start && STRNICMP(event_names[i].name, start, len) == 0)
+ break;
+ }
+ if (*p == ',')
+ ++p;
+ *end = p;
+ if (event_names[i].name == NULL)
+ return NUM_EVENTS;
+ return event_names[i].event;
+}
+
+/*
+ * Return the name for event "event".
+ */
+ static char_u *
+event_nr2name(event)
+ EVENT_T event;
+{
+ int i;
+
+ for (i = 0; event_names[i].name != NULL; ++i)
+ if (event_names[i].event == event)
+ return (char_u *)event_names[i].name;
+ return (char_u *)"Unknown";
+}
+
+/*
+ * Scan over the events. "*" stands for all events.
+ */
+ static char_u *
+find_end_event(arg, have_group)
+ char_u *arg;
+ int have_group; /* TRUE when group name was found */
+{
+ char_u *pat;
+ char_u *p;
+
+ if (*arg == '*')
+ {
+ if (arg[1] && !vim_iswhite(arg[1]))
+ {
+ EMSG2(_("E215: Illegal character after *: %s"), arg);
+ return NULL;
+ }
+ pat = arg + 1;
+ }
+ else
+ {
+ for (pat = arg; *pat && !vim_iswhite(*pat); pat = p)
+ {
+ if ((int)event_name2nr(pat, &p) >= (int)NUM_EVENTS)
+ {
+ if (have_group)
+ EMSG2(_("E216: No such event: %s"), pat);
+ else
+ EMSG2(_("E216: No such group or event: %s"), pat);
+ return NULL;
+ }
+ }
+ }
+ return pat;
+}
+
+/*
+ * Return TRUE if "event" is included in 'eventignore'.
+ */
+ static int
+event_ignored(event)
+ EVENT_T event;
+{
+ char_u *p = p_ei;
+
+ if (STRICMP(p_ei, "all") == 0)
+ return TRUE;
+
+ while (*p)
+ if (event_name2nr(p, &p) == event)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+ * Return OK when the contents of p_ei is valid, FAIL otherwise.
+ */
+ int
+check_ei()
+{
+ char_u *p = p_ei;
+
+ if (STRICMP(p_ei, "all") == 0)
+ return OK;
+
+ while (*p)
+ if (event_name2nr(p, &p) == NUM_EVENTS)
+ return FAIL;
+
+ return OK;
+}
+
+/*
+ * do_autocmd() -- implements the :autocmd command. Can be used in the
+ * following ways:
+ *
+ * :autocmd <event> <pat> <cmd> Add <cmd> to the list of commands that
+ * will be automatically executed for <event>
+ * when editing a file matching <pat>, in
+ * the current group.
+ * :autocmd <event> <pat> Show the auto-commands associated with
+ * <event> and <pat>.
+ * :autocmd <event> Show the auto-commands associated with
+ * <event>.
+ * :autocmd Show all auto-commands.
+ * :autocmd! <event> <pat> <cmd> Remove all auto-commands associated with
+ * <event> and <pat>, and add the command
+ * <cmd>, for the current group.
+ * :autocmd! <event> <pat> Remove all auto-commands associated with
+ * <event> and <pat> for the current group.
+ * :autocmd! <event> Remove all auto-commands associated with
+ * <event> for the current group.
+ * :autocmd! Remove ALL auto-commands for the current
+ * group.
+ *
+ * Multiple events and patterns may be given separated by commas. Here are
+ * some examples:
+ * :autocmd bufread,bufenter *.c,*.h set tw=0 smartindent noic
+ * :autocmd bufleave * set tw=79 nosmartindent ic infercase
+ *
+ * :autocmd * *.c show all autocommands for *.c files.
+ */
+ void
+do_autocmd(arg, forceit)
+ char_u *arg;
+ int forceit;
+{
+ char_u *pat;
+ char_u *envpat = NULL;
+ char_u *cmd;
+ EVENT_T event;
+ int need_free = FALSE;
+ int nested = FALSE;
+ int group;
+
+ /*
+ * Check for a legal group name. If not, use AUGROUP_ALL.
+ */
+ group = au_get_grouparg(&arg);
+ if (arg == NULL) /* out of memory */
+ return;
+
+ /*
+ * Scan over the events.
+ * If we find an illegal name, return here, don't do anything.
+ */
+ pat = find_end_event(arg, group != AUGROUP_ALL);
+ if (pat == NULL)
+ return;
+
+ /*
+ * Scan over the pattern. Put a NUL at the end.
+ */
+ pat = skipwhite(pat);
+ cmd = pat;
+ while (*cmd && (!vim_iswhite(*cmd) || cmd[-1] == '\\'))
+ cmd++;
+ if (*cmd)
+ *cmd++ = NUL;
+
+ /* Expand environment variables in the pattern. Set 'shellslash', we want
+ * forward slashes here. */
+ if (vim_strchr(pat, '$') != NULL || vim_strchr(pat, '~') != NULL)
+ {
+#ifdef BACKSLASH_IN_FILENAME
+ int p_ssl_save = p_ssl;
+
+ p_ssl = TRUE;
+#endif
+ envpat = expand_env_save(pat);
+#ifdef BACKSLASH_IN_FILENAME
+ p_ssl = p_ssl_save;
+#endif
+ if (envpat != NULL)
+ pat = envpat;
+ }
+
+ /*
+ * Check for "nested" flag.
+ */
+ cmd = skipwhite(cmd);
+ if (*cmd != NUL && STRNCMP(cmd, "nested", 6) == 0 && vim_iswhite(cmd[6]))
+ {
+ nested = TRUE;
+ cmd = skipwhite(cmd + 6);
+ }
+
+ /*
+ * Find the start of the commands.
+ * Expand <sfile> in it.
+ */
+ if (*cmd != NUL)
+ {
+ cmd = expand_sfile(cmd);
+ if (cmd == NULL) /* some error */
+ return;
+ need_free = TRUE;
+ }
+
+ /*
+ * Print header when showing autocommands.
+ */
+ if (!forceit && *cmd == NUL)
+ {
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n--- Auto-Commands ---"));
+ }
+
+ /*
+ * Loop over the events.
+ */
+ last_event = (EVENT_T)-1; /* for listing the event name */
+ last_group = AUGROUP_ERROR; /* for listing the group name */
+ if (*arg == '*' || *arg == NUL)
+ {
+ for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
+ event = (EVENT_T)((int)event + 1))
+ if (do_autocmd_event(event, pat,
+ nested, cmd, forceit, group) == FAIL)
+ break;
+ }
+ else
+ {
+ while (*arg && !vim_iswhite(*arg))
+ if (do_autocmd_event(event_name2nr(arg, &arg), pat,
+ nested, cmd, forceit, group) == FAIL)
+ break;
+ }
+
+ if (need_free)
+ vim_free(cmd);
+ vim_free(envpat);
+}
+
+/*
+ * Find the group ID in a ":autocmd" or ":doautocmd" argument.
+ * The "argp" argument is advanced to the following argument.
+ *
+ * Returns the group ID, AUGROUP_ERROR for error (out of memory).
+ */
+ static int
+au_get_grouparg(argp)
+ char_u **argp;
+{
+ char_u *group_name;
+ char_u *p;
+ char_u *arg = *argp;
+ int group = AUGROUP_ALL;
+
+ p = skiptowhite(arg);
+ if (p > arg)
+ {
+ group_name = vim_strnsave(arg, (int)(p - arg));
+ if (group_name == NULL) /* out of memory */
+ return AUGROUP_ERROR;
+ group = au_find_group(group_name);
+ if (group == AUGROUP_ERROR)
+ group = AUGROUP_ALL; /* no match, use all groups */
+ else
+ *argp = skipwhite(p); /* match, skip over group name */
+ vim_free(group_name);
+ }
+ return group;
+}
+
+/*
+ * do_autocmd() for one event.
+ * If *pat == NUL do for all patterns.
+ * If *cmd == NUL show entries.
+ * If forceit == TRUE delete entries.
+ * If group is not AUGROUP_ALL, only use this group.
+ */
+ static int
+do_autocmd_event(event, pat, nested, cmd, forceit, group)
+ EVENT_T event;
+ char_u *pat;
+ int nested;
+ char_u *cmd;
+ int forceit;
+ int group;
+{
+ AutoPat *ap;
+ AutoPat **prev_ap;
+ AutoCmd *ac;
+ AutoCmd **prev_ac;
+ int brace_level;
+ char_u *endpat;
+ int findgroup;
+ int allgroups;
+ int patlen;
+
+ if (group == AUGROUP_ALL)
+ findgroup = current_augroup;
+ else
+ findgroup = group;
+ allgroups = (group == AUGROUP_ALL && !forceit && *cmd == NUL);
+
+ /*
+ * Show or delete all patterns for an event.
+ */
+ if (*pat == NUL)
+ {
+ for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
+ {
+ if (forceit) /* delete the AutoPat, if it's in the current group */
+ {
+ if (ap->group == findgroup)
+ au_remove_pat(ap);
+ }
+ else if (group == AUGROUP_ALL || ap->group == group)
+ show_autocmd(ap, event);
+ }
+ }
+
+ /*
+ * Loop through all the specified patterns.
+ */
+ for ( ; *pat; pat = (*endpat == ',' ? endpat + 1 : endpat))
+ {
+ /*
+ * Find end of the pattern.
+ * Watch out for a comma in braces, like "*.\{obj,o\}".
+ */
+ brace_level = 0;
+ for (endpat = pat; *endpat && (*endpat != ',' || brace_level
+ || endpat[-1] == '\\'); ++endpat)
+ {
+ if (*endpat == '{')
+ brace_level++;
+ else if (*endpat == '}')
+ brace_level--;
+ }
+ if (pat == endpat) /* ignore single comma */
+ continue;
+ patlen = (int)(endpat - pat);
+
+ /*
+ * Find AutoPat entries with this pattern.
+ */
+ prev_ap = &first_autopat[(int)event];
+ while ((ap = *prev_ap) != NULL)
+ {
+ if (ap->pat != NULL)
+ {
+ /* Accept a pattern when:
+ * - a group was specified and it's that group, or a group was
+ * not specified and it's the current group, or a group was
+ * not specified and we are listing
+ * - the length of the pattern matches
+ * - the pattern matches
+ */
+ if ((allgroups || ap->group == findgroup)
+ && ap->patlen == patlen
+ && STRNCMP(pat, ap->pat, patlen) == 0)
+ {
+ /*
+ * Remove existing autocommands.
+ * If adding any new autocmd's for this AutoPat, don't
+ * delete the pattern from the autopat list, append to
+ * this list.
+ */
+ if (forceit)
+ {
+ if (*cmd != NUL && ap->next == NULL)
+ {
+ au_remove_cmds(ap);
+ break;
+ }
+ au_remove_pat(ap);
+ }
+
+ /*
+ * Show autocmd's for this autopat
+ */
+ else if (*cmd == NUL)
+ show_autocmd(ap, event);
+
+ /*
+ * Add autocmd to this autopat, if it's the last one.
+ */
+ else if (ap->next == NULL)
+ break;
+ }
+ }
+ prev_ap = &ap->next;
+ }
+
+ /*
+ * Add a new command.
+ */
+ if (*cmd != NUL)
+ {
+ /*
+ * If the pattern we want to add a command to does appear at the
+ * end of the list (or not is not in the list at all), add the
+ * pattern at the end of the list.
+ */
+ if (ap == NULL)
+ {
+ ap = (AutoPat *)alloc((unsigned)sizeof(AutoPat));
+ if (ap == NULL)
+ return FAIL;
+ ap->pat = vim_strnsave(pat, patlen);
+ ap->patlen = patlen;
+ if (ap->pat == NULL)
+ {
+ vim_free(ap);
+ return FAIL;
+ }
+ ap->reg_pat = file_pat_to_reg_pat(pat, endpat,
+ &ap->allow_dirs, TRUE);
+ if (ap->reg_pat == NULL)
+ {
+ vim_free(ap->pat);
+ vim_free(ap);
+ return FAIL;
+ }
+ ap->cmds = NULL;
+ *prev_ap = ap;
+ ap->next = NULL;
+ if (group == AUGROUP_ALL)
+ ap->group = current_augroup;
+ else
+ ap->group = group;
+ }
+
+ /*
+ * Add the autocmd at the end of the AutoCmd list.
+ */
+ prev_ac = &(ap->cmds);
+ while ((ac = *prev_ac) != NULL)
+ prev_ac = &ac->next;
+ ac = (AutoCmd *)alloc((unsigned)sizeof(AutoCmd));
+ if (ac == NULL)
+ return FAIL;
+ ac->cmd = vim_strsave(cmd);
+#ifdef FEAT_EVAL
+ ac->scriptID = current_SID;
+#endif
+ if (ac->cmd == NULL)
+ {
+ vim_free(ac);
+ return FAIL;
+ }
+ ac->next = NULL;
+ *prev_ac = ac;
+ ac->nested = nested;
+ }
+ }
+
+ au_cleanup(); /* may really delete removed patterns/commands now */
+ return OK;
+}
+
+/*
+ * Implementation of ":doautocmd [group] event [fname]".
+ * Return OK for success, FAIL for failure;
+ */
+ int
+do_doautocmd(arg, do_msg)
+ char_u *arg;
+ int do_msg; /* give message for no matching autocmds? */
+{
+ char_u *fname;
+ int nothing_done = TRUE;
+ int group;
+
+ /*
+ * Check for a legal group name. If not, use AUGROUP_ALL.
+ */
+ group = au_get_grouparg(&arg);
+ if (arg == NULL) /* out of memory */
+ return FAIL;
+
+ if (*arg == '*')
+ {
+ EMSG(_("E217: Can't execute autocommands for ALL events"));
+ return FAIL;
+ }
+
+ /*
+ * Scan over the events.
+ * If we find an illegal name, return here, don't do anything.
+ */
+ fname = find_end_event(arg, group != AUGROUP_ALL);
+ if (fname == NULL)
+ return FAIL;
+
+ fname = skipwhite(fname);
+
+ /*
+ * Loop over the events.
+ */
+ while (*arg && !vim_iswhite(*arg))
+ if (apply_autocmds_group(event_name2nr(arg, &arg),
+ fname, NULL, TRUE, group, curbuf, NULL))
+ nothing_done = FALSE;
+
+ if (nothing_done && do_msg)
+ MSG(_("No matching autocommands"));
+
+#ifdef FEAT_EVAL
+ return aborting() ? FAIL : OK;
+#else
+ return OK;
+#endif
+}
+
+/*
+ * ":doautoall": execute autocommands for each loaded buffer.
+ */
+ void
+ex_doautoall(eap)
+ exarg_T *eap;
+{
+ int retval;
+ aco_save_T aco;
+ buf_T *buf;
+
+ /*
+ * This is a bit tricky: For some commands curwin->w_buffer needs to be
+ * equal to curbuf, but for some buffers there may not be a window.
+ * So we change the buffer for the current window for a moment. This
+ * gives problems when the autocommands make changes to the list of
+ * buffers or windows...
+ */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (curbuf->b_ml.ml_mfp != NULL)
+ {
+ /* find a window for this buffer and save some values */
+ aucmd_prepbuf(&aco, buf);
+
+ /* execute the autocommands for this buffer */
+ retval = do_doautocmd(eap->arg, FALSE);
+ do_modelines();
+
+ /* restore the current window */
+ aucmd_restbuf(&aco);
+
+ /* stop if there is some error or buffer was deleted */
+ if (retval == FAIL || !buf_valid(buf))
+ break;
+ }
+ }
+
+ check_cursor(); /* just in case lines got deleted */
+}
+
+/*
+ * Prepare for executing autocommands for (hidden) buffer "buf".
+ * Search a window for the current buffer. Save the cursor position and
+ * screen offset.
+ * Set "curbuf" and "curwin" to match "buf".
+ */
+ void
+aucmd_prepbuf(aco, buf)
+ aco_save_T *aco; /* structure to save values in */
+ buf_T *buf; /* new curbuf */
+{
+ win_T *win;
+
+ aco->new_curbuf = buf;
+
+ /* Find a window that is for the new buffer */
+ if (buf == curbuf) /* be quick when buf is curbuf */
+ win = curwin;
+ else
+#ifdef FEAT_WINDOWS
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (win->w_buffer == buf)
+ break;
+#else
+ win = NULL;
+#endif
+
+ /*
+ * Prefer to use an existing window for the buffer, it has the least side
+ * effects (esp. if "buf" is curbuf).
+ * Otherwise, use curwin for "buf". It might make some items in the
+ * window invalid. At least save the cursor and topline.
+ */
+ if (win != NULL)
+ {
+ /* there is a window for "buf", make it the curwin */
+ aco->save_curwin = curwin;
+ curwin = win;
+ aco->save_buf = win->w_buffer;
+ aco->new_curwin = win;
+ }
+ else
+ {
+ /* there is no window for "buf", use curwin */
+ aco->save_curwin = NULL;
+ aco->save_buf = curbuf;
+ --curbuf->b_nwindows;
+ curwin->w_buffer = buf;
+ ++buf->b_nwindows;
+
+ /* save cursor and topline, set them to safe values */
+ aco->save_cursor = curwin->w_cursor;
+ curwin->w_cursor.lnum = 1;
+ curwin->w_cursor.col = 0;
+ aco->save_topline = curwin->w_topline;
+ curwin->w_topline = 1;
+#ifdef FEAT_DIFF
+ aco->save_topfill = curwin->w_topfill;
+ curwin->w_topfill = 0;
+#endif
+ }
+
+ curbuf = buf;
+}
+
+/*
+ * Cleanup after executing autocommands for a (hidden) buffer.
+ * Restore the window as it was (if possible).
+ */
+ void
+aucmd_restbuf(aco)
+ aco_save_T *aco; /* structure holding saved values */
+{
+ if (aco->save_curwin != NULL)
+ {
+ /* restore curwin */
+#ifdef FEAT_WINDOWS
+ if (win_valid(aco->save_curwin))
+#endif
+ {
+ /* restore the buffer which was previously edited by curwin, if
+ * it's still the same window and it's valid */
+ if (curwin == aco->new_curwin
+ && buf_valid(aco->save_buf)
+ && aco->save_buf->b_ml.ml_mfp != NULL)
+ {
+ --curbuf->b_nwindows;
+ curbuf = aco->save_buf;
+ curwin->w_buffer = curbuf;
+ ++curbuf->b_nwindows;
+ }
+
+ curwin = aco->save_curwin;
+ curbuf = curwin->w_buffer;
+ }
+ }
+ else
+ {
+ /* restore buffer for curwin if it still exists and is loaded */
+ if (buf_valid(aco->save_buf) && aco->save_buf->b_ml.ml_mfp != NULL)
+ {
+ --curbuf->b_nwindows;
+ curbuf = aco->save_buf;
+ curwin->w_buffer = curbuf;
+ ++curbuf->b_nwindows;
+ curwin->w_cursor = aco->save_cursor;
+ check_cursor();
+ /* check topline < line_count, in case lines got deleted */
+ if (aco->save_topline <= curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_topline = aco->save_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = aco->save_topfill;
+#endif
+ }
+ else
+ {
+ curwin->w_topline = curbuf->b_ml.ml_line_count;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ }
+ }
+ }
+}
+
+static int autocmd_nested = FALSE;
+
+/*
+ * Execute autocommands for "event" and file name "fname".
+ * Return TRUE if some commands were executed.
+ */
+ int
+apply_autocmds(event, fname, fname_io, force, buf)
+ EVENT_T event;
+ char_u *fname; /* NULL or empty means use actual file name */
+ char_u *fname_io; /* fname to use for <afile> on cmdline */
+ int force; /* when TRUE, ignore autocmd_busy */
+ buf_T *buf; /* buffer for <abuf> */
+{
+ return apply_autocmds_group(event, fname, fname_io, force,
+ AUGROUP_ALL, buf, NULL);
+}
+
+/*
+ * Like apply_autocmds(), but with extra "eap" argument. This takes care of
+ * setting v:filearg.
+ */
+ static int
+apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
+ EVENT_T event;
+ char_u *fname;
+ char_u *fname_io;
+ int force;
+ buf_T *buf;
+ exarg_T *eap;
+{
+ return apply_autocmds_group(event, fname, fname_io, force,
+ AUGROUP_ALL, buf, eap);
+}
+
+/*
+ * Like apply_autocmds(), but handles the caller's retval. If the script
+ * processing is being aborted or if retval is FAIL when inside a try
+ * conditional, no autocommands are executed. If otherwise the autocommands
+ * cause the script to be aborted, retval is set to FAIL.
+ */
+ int
+apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
+ EVENT_T event;
+ char_u *fname; /* NULL or empty means use actual file name */
+ char_u *fname_io; /* fname to use for <afile> on cmdline */
+ int force; /* when TRUE, ignore autocmd_busy */
+ buf_T *buf; /* buffer for <abuf> */
+ int *retval; /* pointer to caller's retval */
+{
+ int did_cmd;
+
+ if (should_abort(*retval))
+ return FALSE;
+
+ did_cmd = apply_autocmds_group(event, fname, fname_io, force,
+ AUGROUP_ALL, buf, NULL);
+ if (did_cmd && aborting())
+ *retval = FAIL;
+ return did_cmd;
+}
+
+#if defined(FEAT_AUTOCMD) || defined(PROTO)
+ int
+has_cursorhold()
+{
+ return (first_autopat[(int)EVENT_CURSORHOLD] != NULL);
+}
+#endif
+
+ static int
+apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
+ EVENT_T event;
+ char_u *fname; /* NULL or empty means use actual file name */
+ char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means
+ use fname */
+ int force; /* when TRUE, ignore autocmd_busy */
+ int group; /* group ID, or AUGROUP_ALL */
+ buf_T *buf; /* buffer for <abuf> */
+ exarg_T *eap; /* command arguments */
+{
+ char_u *sfname = NULL; /* short file name */
+ char_u *tail;
+ int save_changed;
+ buf_T *old_curbuf;
+ int retval = FALSE;
+ char_u *save_sourcing_name;
+ linenr_T save_sourcing_lnum;
+ char_u *save_autocmd_fname;
+ int save_autocmd_bufnr;
+ char_u *save_autocmd_match;
+ int save_autocmd_busy;
+ int save_autocmd_nested;
+ static int nesting = 0;
+ AutoPatCmd patcmd;
+ AutoPat *ap;
+#ifdef FEAT_EVAL
+ scid_T save_current_SID;
+ void *save_funccalp;
+ char_u *save_cmdarg;
+ long save_cmdbang;
+#endif
+ static int filechangeshell_busy = FALSE;
+
+ /*
+ * Quickly return if there are no autocommands for this event or
+ * autocommands are blocked.
+ */
+ if (first_autopat[(int)event] == NULL || autocmd_block > 0)
+ return retval;
+
+ /*
+ * When autocommands are busy, new autocommands are only executed when
+ * explicitly enabled with the "nested" flag.
+ */
+ if (autocmd_busy && !(force || autocmd_nested))
+ return retval;
+
+#ifdef FEAT_EVAL
+ /*
+ * Quickly return when immdediately aborting on error, or when an interrupt
+ * occurred or an exception was thrown but not caught.
+ */
+ if (aborting())
+ return retval;
+#endif
+
+ /*
+ * FileChangedShell never nests, because it can create an endless loop.
+ */
+ if (filechangeshell_busy && event == EVENT_FILECHANGEDSHELL)
+ return retval;
+
+ /*
+ * Ignore events in 'eventignore'.
+ */
+ if (event_ignored(event))
+ return retval;
+
+ /*
+ * Allow nesting of autocommands, but restrict the depth, because it's
+ * possible to create an endless loop.
+ */
+ if (nesting == 10)
+ {
+ EMSG(_("E218: autocommand nesting too deep"));
+ return retval;
+ }
+
+ /*
+ * Check if these autocommands are disabled. Used when doing ":all" or
+ * ":ball".
+ */
+ if ( (autocmd_no_enter
+ && (event == EVENT_WINENTER || event == EVENT_BUFENTER))
+ || (autocmd_no_leave
+ && (event == EVENT_WINLEAVE || event == EVENT_BUFLEAVE)))
+ return retval;
+
+ /*
+ * Save the autocmd_* variables and info about the current buffer.
+ */
+ save_autocmd_fname = autocmd_fname;
+ save_autocmd_bufnr = autocmd_bufnr;
+ save_autocmd_match = autocmd_match;
+ save_autocmd_busy = autocmd_busy;
+ save_autocmd_nested = autocmd_nested;
+ save_changed = curbuf->b_changed;
+ old_curbuf = curbuf;
+
+ /*
+ * Set the file name to be used for <afile>.
+ */
+ if (fname_io == NULL)
+ {
+ if (fname != NULL && *fname != NUL)
+ autocmd_fname = fname;
+ else if (buf != NULL)
+ autocmd_fname = buf->b_fname;
+ else
+ autocmd_fname = NULL;
+ }
+ else
+ autocmd_fname = fname_io;
+
+ /*
+ * Set the buffer number to be used for <abuf>.
+ */
+ if (buf == NULL)
+ autocmd_bufnr = 0;
+ else
+ autocmd_bufnr = buf->b_fnum;
+
+ /*
+ * When the file name is NULL or empty, use the file name of buffer "buf".
+ * Always use the full path of the file name to match with, in case
+ * "allow_dirs" is set.
+ */
+ if (fname == NULL || *fname == NUL)
+ {
+ if (buf == NULL)
+ fname = NULL;
+ else
+ {
+#ifdef FEAT_SYN_HL
+ if (event == EVENT_SYNTAX)
+ fname = buf->b_p_syn;
+ else
+#endif
+ if (event == EVENT_FILETYPE)
+ fname = buf->b_p_ft;
+ else
+ {
+ if (buf->b_sfname != NULL)
+ sfname = vim_strsave(buf->b_sfname);
+ fname = buf->b_ffname;
+ }
+ }
+ if (fname == NULL)
+ fname = (char_u *)"";
+ fname = vim_strsave(fname); /* make a copy, so we can change it */
+ }
+ else
+ {
+ sfname = vim_strsave(fname);
+ /* Don't try expanding FileType, Syntax or WindowID. */
+ if (event == EVENT_FILETYPE || event == EVENT_SYNTAX
+ || event == EVENT_REMOTEREPLY)
+ fname = vim_strsave(fname);
+ else
+ fname = FullName_save(fname, FALSE);
+ }
+ if (fname == NULL) /* out of memory */
+ {
+ vim_free(sfname);
+ return FALSE;
+ }
+
+#ifdef BACKSLASH_IN_FILENAME
+ /*
+ * Replace all backslashes with forward slashes. This makes the
+ * autocommand patterns portable between Unix and MS-DOS.
+ */
+ if (sfname != NULL)
+ forward_slash(sfname);
+ forward_slash(fname);
+#endif
+
+#ifdef VMS
+ /* remove version for correct match */
+ if (sfname != NULL)
+ vms_remove_version(sfname);
+ vms_remove_version(fname);
+#endif
+
+ /*
+ * Set the name to be used for <amatch>.
+ */
+ autocmd_match = fname;
+
+
+ /* Don't redraw while doing auto commands. */
+ ++RedrawingDisabled;
+ save_sourcing_name = sourcing_name;
+ sourcing_name = NULL; /* don't free this one */
+ save_sourcing_lnum = sourcing_lnum;
+ sourcing_lnum = 0; /* no line number here */
+
+#ifdef FEAT_EVAL
+ save_current_SID = current_SID;
+
+ /* Don't use local function variables, if called from a function */
+ save_funccalp = save_funccal();
+#endif
+
+ /*
+ * When starting to execute autocommands, save the search patterns.
+ */
+ if (!autocmd_busy)
+ {
+ save_search_patterns();
+ saveRedobuff();
+ did_filetype = keep_filetype;
+ }
+
+ /*
+ * Note that we are applying autocmds. Some commands need to know.
+ */
+ autocmd_busy = TRUE;
+ filechangeshell_busy = (event == EVENT_FILECHANGEDSHELL);
+ ++nesting; /* see matching decrement below */
+
+ /* Remember that FileType was triggered. Used for did_filetype(). */
+ if (event == EVENT_FILETYPE)
+ did_filetype = TRUE;
+
+ tail = gettail(fname);
+
+ /* Find first autocommand that matches */
+ patcmd.curpat = first_autopat[(int)event];
+ patcmd.nextcmd = NULL;
+ patcmd.group = group;
+ patcmd.fname = fname;
+ patcmd.sfname = sfname;
+ patcmd.tail = tail;
+ patcmd.event = event;
+ auto_next_pat(&patcmd, FALSE);
+
+ /* found one, start executing the autocommands */
+ if (patcmd.curpat != NULL)
+ {
+#ifdef FEAT_EVAL
+ /* set v:cmdarg (only when there is a matching pattern) */
+ save_cmdbang = get_vim_var_nr(VV_CMDBANG);
+ if (eap != NULL)
+ {
+ save_cmdarg = set_cmdarg(eap, NULL);
+ set_vim_var_nr(VV_CMDBANG, (long)eap->forceit);
+ }
+ else
+ save_cmdarg = NULL; /* avoid gcc warning */
+#endif
+ retval = TRUE;
+ /* mark the last pattern, to avoid an endless loop when more patterns
+ * are added when executing autocommands */
+ for (ap = patcmd.curpat; ap->next != NULL; ap = ap->next)
+ ap->last = FALSE;
+ ap->last = TRUE;
+ check_lnums(TRUE); /* make sure cursor and topline are valid */
+ do_cmdline(NULL, getnextac, (void *)&patcmd,
+ DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT);
+#ifdef FEAT_EVAL
+ if (eap != NULL)
+ {
+ (void)set_cmdarg(NULL, save_cmdarg);
+ set_vim_var_nr(VV_CMDBANG, save_cmdbang);
+ }
+#endif
+ }
+
+ --RedrawingDisabled;
+ autocmd_busy = save_autocmd_busy;
+ filechangeshell_busy = FALSE;
+ autocmd_nested = save_autocmd_nested;
+ vim_free(sourcing_name);
+ sourcing_name = save_sourcing_name;
+ sourcing_lnum = save_sourcing_lnum;
+ autocmd_fname = save_autocmd_fname;
+ autocmd_bufnr = save_autocmd_bufnr;
+ autocmd_match = save_autocmd_match;
+#ifdef FEAT_EVAL
+ current_SID = save_current_SID;
+ restore_funccal(save_funccalp);
+#endif
+ vim_free(fname);
+ vim_free(sfname);
+ --nesting; /* see matching increment above */
+
+ /*
+ * When stopping to execute autocommands, restore the search patterns and
+ * the redo buffer.
+ */
+ if (!autocmd_busy)
+ {
+ restore_search_patterns();
+ restoreRedobuff();
+ did_filetype = FALSE;
+ }
+
+ /*
+ * Some events don't set or reset the Changed flag.
+ * Check if still in the same buffer!
+ */
+ if (curbuf == old_curbuf
+ && (event == EVENT_BUFREADPOST
+ || event == EVENT_BUFWRITEPOST
+ || event == EVENT_FILEAPPENDPOST
+ || event == EVENT_VIMLEAVE
+ || event == EVENT_VIMLEAVEPRE))
+ {
+#ifdef FEAT_TITLE
+ if (curbuf->b_changed != save_changed)
+ need_maketitle = TRUE;
+#endif
+ curbuf->b_changed = save_changed;
+ }
+
+ au_cleanup(); /* may really delete removed patterns/commands now */
+ return retval;
+}
+
+/*
+ * Find next autocommand pattern that matches.
+ */
+ static void
+auto_next_pat(apc, stop_at_last)
+ AutoPatCmd *apc;
+ int stop_at_last; /* stop when 'last' flag is set */
+{
+ AutoPat *ap;
+ AutoCmd *cp;
+ char_u *name;
+ char *s;
+
+ vim_free(sourcing_name);
+ sourcing_name = NULL;
+
+ for (ap = apc->curpat; ap != NULL && !got_int; ap = ap->next)
+ {
+ apc->curpat = NULL;
+
+ /* only use a pattern when it has not been removed, has commands and
+ * the group matches */
+ if (ap->pat != NULL && ap->cmds != NULL
+ && (apc->group == AUGROUP_ALL || apc->group == ap->group))
+ {
+ if (match_file_pat(ap->reg_pat, apc->fname, apc->sfname, apc->tail,
+ ap->allow_dirs))
+ {
+ name = event_nr2name(apc->event);
+ s = _("%s Auto commands for \"%s\"");
+ sourcing_name = alloc((unsigned)(STRLEN(s)
+ + STRLEN(name) + ap->patlen + 1));
+ if (sourcing_name != NULL)
+ {
+ sprintf((char *)sourcing_name, s,
+ (char *)name, (char *)ap->pat);
+ if (p_verbose >= 8)
+ msg_str((char_u *)_("Executing %s"), sourcing_name);
+ }
+
+ apc->curpat = ap;
+ apc->nextcmd = ap->cmds;
+ /* mark last command */
+ for (cp = ap->cmds; cp->next != NULL; cp = cp->next)
+ cp->last = FALSE;
+ cp->last = TRUE;
+ }
+ line_breakcheck();
+ if (apc->curpat != NULL) /* found a match */
+ break;
+ }
+ if (stop_at_last && ap->last)
+ break;
+ }
+}
+
+/*
+ * Get next autocommand command.
+ * Called by do_cmdline() to get the next line for ":if".
+ * Returns allocated string, or NULL for end of autocommands.
+ */
+/* ARGSUSED */
+ static char_u *
+getnextac(c, cookie, indent)
+ int c; /* not used */
+ void *cookie;
+ int indent; /* not used */
+{
+ AutoPatCmd *acp = (AutoPatCmd *)cookie;
+ char_u *retval;
+ AutoCmd *ac;
+
+ /* Can be called again after returning the last line. */
+ if (acp->curpat == NULL)
+ return NULL;
+
+ /* repeat until we find an autocommand to execute */
+ for (;;)
+ {
+ /* skip removed commands */
+ while (acp->nextcmd != NULL && acp->nextcmd->cmd == NULL)
+ if (acp->nextcmd->last)
+ acp->nextcmd = NULL;
+ else
+ acp->nextcmd = acp->nextcmd->next;
+
+ if (acp->nextcmd != NULL)
+ break;
+
+ /* at end of commands, find next pattern that matches */
+ if (acp->curpat->last)
+ acp->curpat = NULL;
+ else
+ acp->curpat = acp->curpat->next;
+ if (acp->curpat != NULL)
+ auto_next_pat(acp, TRUE);
+ if (acp->curpat == NULL)
+ return NULL;
+ }
+
+ ac = acp->nextcmd;
+
+ if (p_verbose >= 9)
+ {
+ msg_scroll = TRUE; /* always scroll up, don't overwrite */
+ msg_str((char_u *)_("autocommand %s"), ac->cmd);
+ msg_puts((char_u *)"\n"); /* don't overwrite this either */
+ cmdline_row = msg_row;
+ }
+ retval = vim_strsave(ac->cmd);
+ autocmd_nested = ac->nested;
+#ifdef FEAT_EVAL
+ current_SID = ac->scriptID;
+#endif
+ if (ac->last)
+ acp->nextcmd = NULL;
+ else
+ acp->nextcmd = ac->next;
+ return retval;
+}
+
+/*
+ * Return TRUE if there is a matching autocommand for "fname".
+ */
+ int
+has_autocmd(event, sfname)
+ EVENT_T event;
+ char_u *sfname;
+{
+ AutoPat *ap;
+ char_u *fname;
+ char_u *tail = gettail(sfname);
+ int retval = FALSE;
+
+ fname = FullName_save(sfname, FALSE);
+ if (fname == NULL)
+ return FALSE;
+
+#ifdef BACKSLASH_IN_FILENAME
+ /*
+ * Replace all backslashes with forward slashes. This makes the
+ * autocommand patterns portable between Unix and MS-DOS.
+ */
+ sfname = vim_strsave(sfname);
+ if (sfname != NULL)
+ forward_slash(sfname);
+ forward_slash(fname);
+#endif
+
+ for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
+ if (ap->pat != NULL && ap->cmds != NULL
+ && match_file_pat(ap->reg_pat, fname, sfname, tail,
+ ap->allow_dirs))
+ {
+ retval = TRUE;
+ break;
+ }
+
+ vim_free(fname);
+#ifdef BACKSLASH_IN_FILENAME
+ vim_free(sfname);
+#endif
+
+ return retval;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain the list of autocommand group
+ * names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_augroup_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx == augroups.ga_len) /* add "END" add the end */
+ return (char_u *)"END";
+ if (idx >= augroups.ga_len) /* end of list */
+ return NULL;
+ if (AUGROUP_NAME(idx) == NULL) /* skip deleted entries */
+ return (char_u *)"";
+ return AUGROUP_NAME(idx); /* return a name */
+}
+
+static int include_groups = FALSE;
+
+ char_u *
+set_context_in_autocmd(xp, arg, doautocmd)
+ expand_T *xp;
+ char_u *arg;
+ int doautocmd; /* TRUE for :doautocmd, FALSE for :autocmd */
+{
+ char_u *p;
+ int group;
+
+ /* check for a group name, skip it if present */
+ include_groups = FALSE;
+ p = arg;
+ group = au_get_grouparg(&arg);
+ if (group == AUGROUP_ERROR)
+ return NULL;
+ /* If there only is a group name that's what we expand. */
+ if (*arg == NUL && group != AUGROUP_ALL && !vim_iswhite(arg[-1]))
+ {
+ arg = p;
+ group = AUGROUP_ALL;
+ }
+
+ /* skip over event name */
+ for (p = arg; *p != NUL && !vim_iswhite(*p); ++p)
+ if (*p == ',')
+ arg = p + 1;
+ if (*p == NUL)
+ {
+ if (group == AUGROUP_ALL)
+ include_groups = TRUE;
+ xp->xp_context = EXPAND_EVENTS; /* expand event name */
+ xp->xp_pattern = arg;
+ return NULL;
+ }
+
+ /* skip over pattern */
+ arg = skipwhite(p);
+ while (*arg && (!vim_iswhite(*arg) || arg[-1] == '\\'))
+ arg++;
+ if (*arg)
+ return arg; /* expand (next) command */
+
+ if (doautocmd)
+ xp->xp_context = EXPAND_FILES; /* expand file names */
+ else
+ xp->xp_context = EXPAND_NOTHING; /* pattern is not expanded */
+ return NULL;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of event names.
+ */
+/*ARGSUSED*/
+ char_u *
+get_event_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx < augroups.ga_len) /* First list group names, if wanted */
+ {
+ if (!include_groups || AUGROUP_NAME(idx) == NULL)
+ return (char_u *)""; /* skip deleted entries */
+ return AUGROUP_NAME(idx); /* return a name */
+ }
+ return (char_u *)event_names[idx - augroups.ga_len].name;
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * Return TRUE if an autocommand is defined for "event" and "pattern".
+ * "pattern" can be NULL to accept any pattern.
+ */
+ int
+au_exists(name, name_end, pattern)
+ char_u *name;
+ char_u *name_end;
+ char_u *pattern;
+{
+ char_u *event_name;
+ char_u *p;
+ EVENT_T event;
+ AutoPat *ap;
+
+ /* find the index (enum) for the event name */
+ event_name = vim_strnsave(name, (int)(name_end - name));
+ if (event_name == NULL)
+ return FALSE;
+ event = event_name2nr(event_name, &p);
+ vim_free(event_name);
+
+ /* return FALSE if the event name is not recognized */
+ if (event == NUM_EVENTS) /* unknown event name */
+ return FALSE;
+
+ /* Find the first autocommand for this event.
+ * If there isn't any, return FALSE;
+ * If there is one and no pattern given, return TRUE; */
+ ap = first_autopat[(int)event];
+ if (ap == NULL)
+ return FALSE;
+ if (pattern == NULL)
+ return TRUE;
+
+ /* Check if there is an autocommand with the given pattern. */
+ for ( ; ap != NULL; ap = ap->next)
+ /* only use a pattern when it has not been removed and has commands */
+ if (ap->pat != NULL && ap->cmds != NULL
+ && fnamecmp(ap->pat, pattern) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+#endif /* FEAT_AUTOCMD */
+
+#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO)
+/*
+ * Try matching a filename with a pattern.
+ * Used for autocommands and 'wildignore'.
+ * Returns TRUE if there is a match, FALSE otherwise.
+ */
+ int
+match_file_pat(pattern, fname, sfname, tail, allow_dirs)
+ char_u *pattern; /* pattern to match with */
+ char_u *fname; /* full path of file name */
+ char_u *sfname; /* short file name or NULL */
+ char_u *tail; /* tail of path */
+ int allow_dirs; /* allow matching with dir */
+{
+ regmatch_T regmatch;
+ int result = FALSE;
+#ifdef FEAT_OSFILETYPE
+ int no_pattern = FALSE; /* TRUE if check is filetype only */
+ char_u *type_start;
+ char_u c;
+ int match = FALSE;
+#endif
+
+#ifdef CASE_INSENSITIVE_FILENAME
+ regmatch.rm_ic = TRUE; /* Always ignore case */
+#else
+ regmatch.rm_ic = FALSE; /* Don't ever ignore case */
+#endif
+#ifdef FEAT_OSFILETYPE
+ if (*pattern == '<')
+ {
+ /* There is a filetype condition specified with this pattern.
+ * Check the filetype matches first. If not, don't bother with the
+ * pattern (set regprog to NULL).
+ * Always use magic for the regexp.
+ */
+
+ for (type_start = pattern + 1; (c = *pattern); pattern++)
+ {
+ if ((c == ';' || c == '>') && match == FALSE)
+ {
+ *pattern = NUL; /* Terminate the string */
+ match = mch_check_filetype(fname, type_start);
+ *pattern = c; /* Restore the terminator */
+ type_start = pattern + 1;
+ }
+ if (c == '>')
+ break;
+ }
+
+ /* (c should never be NUL, but check anyway) */
+ if (match == FALSE || c == NUL)
+ regmatch.regprog = NULL; /* Doesn't match - don't check pat. */
+ else if (*pattern == NUL)
+ {
+ regmatch.regprog = NULL; /* Vim will try to free regprog later */
+ no_pattern = TRUE; /* Always matches - don't check pat. */
+ }
+ else
+ regmatch.regprog = vim_regcomp(pattern + 1, RE_MAGIC);
+ }
+ else
+#endif
+ regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
+
+ /*
+ * Try for a match with the pattern with:
+ * 1. the full file name, when the pattern has a '/'.
+ * 2. the short file name, when the pattern has a '/'.
+ * 3. the tail of the file name, when the pattern has no '/'.
+ */
+ if (
+#ifdef FEAT_OSFILETYPE
+ /* If the check is for a filetype only and we don't care
+ * about the path then skip all the regexp stuff.
+ */
+ no_pattern ||
+#endif
+ (regmatch.regprog != NULL
+ && ((allow_dirs
+ && (vim_regexec(&regmatch, fname, (colnr_T)0)
+ || (sfname != NULL
+ && vim_regexec(&regmatch, sfname, (colnr_T)0))))
+ || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
+ result = TRUE;
+
+ vim_free(regmatch.regprog);
+ return result;
+}
+#endif
+
+#if defined(FEAT_WILDIGN) || defined(PROTO)
+/*
+ * Return TRUE if a file matches with a pattern in "list".
+ * "list" is a comma-separated list of patterns, like 'wildignore'.
+ * "sfname" is the short file name or NULL, "ffname" the long file name.
+ */
+ int
+match_file_list(list, sfname, ffname)
+ char_u *list;
+ char_u *sfname;
+ char_u *ffname;
+{
+ char_u buf[100];
+ char_u *tail;
+ char_u *regpat;
+ char allow_dirs;
+ int match;
+ char_u *p;
+
+ tail = gettail(sfname);
+
+ /* try all patterns in 'wildignore' */
+ p = list;
+ while (*p)
+ {
+ copy_option_part(&p, buf, 100, ",");
+ regpat = file_pat_to_reg_pat(buf, NULL, &allow_dirs, FALSE);
+ if (regpat == NULL)
+ break;
+ match = match_file_pat(regpat, ffname, sfname, tail, (int)allow_dirs);
+ vim_free(regpat);
+ if (match)
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+
+/*
+ * Convert the given pattern "pat" which has shell style wildcards in it, into
+ * a regular expression, and return the result in allocated memory. If there
+ * is a directory path separator to be matched, then TRUE is put in
+ * allow_dirs, otherwise FALSE is put there -- webb.
+ * Handle backslashes before special characters, like "\*" and "\ ".
+ *
+ * If FEAT_OSFILETYPE defined then pass initial <type> through unchanged. Eg:
+ * '<html>myfile' becomes '<html>^myfile$' -- leonard.
+ *
+ * Returns NULL when out of memory.
+ */
+/*ARGSUSED*/
+ char_u *
+file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
+ char_u *pat;
+ char_u *pat_end; /* first char after pattern or NULL */
+ char *allow_dirs; /* Result passed back out in here */
+ int no_bslash; /* Don't use a backward slash as pathsep */
+{
+ int size;
+ char_u *endp;
+ char_u *reg_pat;
+ char_u *p;
+ int i;
+ int nested = 0;
+ int add_dollar = TRUE;
+#ifdef FEAT_OSFILETYPE
+ int check_length = 0;
+#endif
+
+ if (allow_dirs != NULL)
+ *allow_dirs = FALSE;
+ if (pat_end == NULL)
+ pat_end = pat + STRLEN(pat);
+
+#ifdef FEAT_OSFILETYPE
+ /* Find out how much of the string is the filetype check */
+ if (*pat == '<')
+ {
+ /* Count chars until the next '>' */
+ for (p = pat + 1; p < pat_end && *p != '>'; p++)
+ ;
+ if (p < pat_end)
+ {
+ /* Pattern is of the form <.*>.* */
+ check_length = p - pat + 1;
+ if (p + 1 >= pat_end)
+ {
+ /* The 'pattern' is a filetype check ONLY */
+ reg_pat = (char_u *)alloc(check_length + 1);
+ if (reg_pat != NULL)
+ {
+ mch_memmove(reg_pat, pat, (size_t)check_length);
+ reg_pat[check_length] = NUL;
+ }
+ return reg_pat;
+ }
+ }
+ /* else: there was no closing '>' - assume it was a normal pattern */
+
+ }
+ pat += check_length;
+ size = 2 + check_length;
+#else
+ size = 2; /* '^' at start, '$' at end */
+#endif
+
+ for (p = pat; p < pat_end; p++)
+ {
+ switch (*p)
+ {
+ case '*':
+ case '.':
+ case ',':
+ case '{':
+ case '}':
+ case '~':
+ size += 2; /* extra backslash */
+ break;
+#ifdef BACKSLASH_IN_FILENAME
+ case '\\':
+ case '/':
+ size += 4; /* could become "[\/]" */
+ break;
+#endif
+ default:
+ size++;
+# ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && (*mb_ptr2len_check)(p) > 1)
+ {
+ ++p;
+ ++size;
+ }
+# endif
+ break;
+ }
+ }
+ reg_pat = alloc(size + 1);
+ if (reg_pat == NULL)
+ return NULL;
+
+#ifdef FEAT_OSFILETYPE
+ /* Copy the type check in to the start. */
+ if (check_length)
+ mch_memmove(reg_pat, pat - check_length, (size_t)check_length);
+ i = check_length;
+#else
+ i = 0;
+#endif
+
+ if (pat[0] == '*')
+ while (pat[0] == '*' && pat < pat_end - 1)
+ pat++;
+ else
+ reg_pat[i++] = '^';
+ endp = pat_end - 1;
+ if (*endp == '*')
+ {
+ while (endp - pat > 0 && *endp == '*')
+ endp--;
+ add_dollar = FALSE;
+ }
+ for (p = pat; *p && nested >= 0 && p <= endp; p++)
+ {
+ switch (*p)
+ {
+ case '*':
+ reg_pat[i++] = '.';
+ reg_pat[i++] = '*';
+ break;
+ case '.':
+#ifdef RISCOS
+ if (allow_dirs != NULL)
+ *allow_dirs = TRUE;
+ /* FALLTHROUGH */
+#endif
+ case '~':
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = *p;
+ break;
+ case '?':
+#ifdef RISCOS
+ case '#':
+#endif
+ reg_pat[i++] = '.';
+ break;
+ case '\\':
+ if (p[1] == NUL)
+ break;
+#ifdef BACKSLASH_IN_FILENAME
+ if (!no_bslash)
+ {
+ /* translate:
+ * "\x" to "\\x" e.g., "dir\file"
+ * "\*" to "\\.*" e.g., "dir\*.c"
+ * "\?" to "\\." e.g., "dir\??.c"
+ * "\+" to "\+" e.g., "fileX\+.c"
+ */
+ if ((vim_isfilec(p[1]) || p[1] == '*' || p[1] == '?')
+ && p[1] != '+')
+ {
+ reg_pat[i++] = '[';
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = '/';
+ reg_pat[i++] = ']';
+ if (allow_dirs != NULL)
+ *allow_dirs = TRUE;
+ break;
+ }
+ }
+#endif
+ if (*++p == '?'
+#ifdef BACKSLASH_IN_FILENAME
+ && no_bslash
+#endif
+ )
+ reg_pat[i++] = '?';
+ else
+ if (*p == ',')
+ reg_pat[i++] = ',';
+ else
+ {
+ if (allow_dirs != NULL && vim_ispathsep(*p)
+#ifdef BACKSLASH_IN_FILENAME
+ && (!no_bslash || *p != '\\')
+#endif
+ )
+ *allow_dirs = TRUE;
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = *p;
+ }
+ break;
+#ifdef BACKSLASH_IN_FILENAME
+ case '/':
+ reg_pat[i++] = '[';
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = '/';
+ reg_pat[i++] = ']';
+ if (allow_dirs != NULL)
+ *allow_dirs = TRUE;
+ break;
+#endif
+ case '{':
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = '(';
+ nested++;
+ break;
+ case '}':
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = ')';
+ --nested;
+ break;
+ case ',':
+ if (nested)
+ {
+ reg_pat[i++] = '\\';
+ reg_pat[i++] = '|';
+ }
+ else
+ reg_pat[i++] = ',';
+ break;
+ default:
+# ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && (*mb_ptr2len_check)(p) > 1)
+ reg_pat[i++] = *p++;
+ else
+# endif
+ if (allow_dirs != NULL && vim_ispathsep(*p))
+ *allow_dirs = TRUE;
+ reg_pat[i++] = *p;
+ break;
+ }
+ }
+ if (add_dollar)
+ reg_pat[i++] = '$';
+ reg_pat[i] = NUL;
+ if (nested != 0)
+ {
+ if (nested < 0)
+ EMSG(_("E219: Missing {."));
+ else
+ EMSG(_("E220: Missing }."));
+ vim_free(reg_pat);
+ reg_pat = NULL;
+ }
+ return reg_pat;
+}
diff --git a/src/fold.c b/src/fold.c
new file mode 100644
index 000000000..ceac00bbf
--- /dev/null
+++ b/src/fold.c
@@ -0,0 +1,3250 @@
+/* vim:set ts=8 sts=4 sw=4:
+ * vim600:fdm=marker fdl=1 fdc=3:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * fold.c: code for folding
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+
+/* local declarations. {{{1 */
+/* typedef fold_T {{{2 */
+/*
+ * The toplevel folds for each window are stored in the w_folds growarray.
+ * Each toplevel fold can contain an array of second level folds in the
+ * fd_nested growarray.
+ * The info stored in both growarrays is the same: An array of fold_T.
+ */
+typedef struct
+{
+ linenr_T fd_top; /* first line of fold; for nested fold
+ * relative to parent */
+ linenr_T fd_len; /* number of lines in the fold */
+ garray_T fd_nested; /* array of nested folds */
+ char fd_flags; /* see below */
+ char fd_small; /* TRUE, FALSE or MAYBE: fold smaller than
+ 'foldminlines'; MAYBE applies to nested
+ folds too */
+} fold_T;
+
+#define FD_OPEN 0 /* fold is open (nested ones can be closed) */
+#define FD_CLOSED 1 /* fold is closed */
+#define FD_LEVEL 2 /* depends on 'foldlevel' (nested folds too) */
+
+#define MAX_LEVEL 20 /* maximum fold depth */
+
+/* static functions {{{2 */
+static void newFoldLevelWin __ARGS((win_T *wp));
+static int checkCloseRec __ARGS((garray_T *gap, linenr_T lnum, int level));
+static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
+static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
+static void checkupdate __ARGS((win_T *wp));
+static void setFoldRepeat __ARGS((linenr_T lnum, long count, int open));
+static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
+static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
+static void foldOpenNested __ARGS((fold_T *fpr));
+static void deleteFoldEntry __ARGS((garray_T *gap, int idx, int recursive));
+static void foldMarkAdjustRecurse __ARGS((garray_T *gap, linenr_T line1, linenr_T line2, long amount, long amount_after));
+static int getDeepestNestingRecurse __ARGS((garray_T *gap));
+static int check_closed __ARGS((win_T *win, fold_T *fp, int *use_levelp, int level, int *maybe_smallp, linenr_T lnum_off));
+static void checkSmall __ARGS((win_T *wp, fold_T *fp, linenr_T lnum_off));
+static void setSmallMaybe __ARGS((garray_T *gap));
+static void foldCreateMarkers __ARGS((linenr_T start, linenr_T end));
+static void foldAddMarker __ARGS((linenr_T lnum, char_u *marker, int markerlen));
+static void deleteFoldMarkers __ARGS((fold_T *fp, int recursive, linenr_T lnum_off));
+static void foldDelMarker __ARGS((linenr_T lnum, char_u *marker, int markerlen));
+static void foldUpdateIEMS __ARGS((win_T *wp, linenr_T top, linenr_T bot));
+static void parseMarker __ARGS((win_T *wp));
+
+static char *e_nofold = N_("E490: No fold found");
+
+/*
+ * While updating the folds lines between invalid_top and invalid_bot have an
+ * undefined fold level. Only used for the window currently being updated.
+ */
+static linenr_T invalid_top = (linenr_T)0;
+static linenr_T invalid_bot = (linenr_T)0;
+
+/*
+ * When using 'foldexpr' we sometimes get the level of the next line, which
+ * calls foldlevel() to get the level of the current line, which hasn't been
+ * stored yet. To get around this chicken-egg problem the level of the
+ * previous line is stored here when available. prev_lnum is zero when the
+ * level is not available.
+ */
+static linenr_T prev_lnum = 0;
+static int prev_lnum_lvl = -1;
+
+/* Flags used for "done" argument of setManualFold. */
+#define DONE_NOTHING 0
+#define DONE_ACTION 1 /* did close or open a fold */
+#define DONE_FOLD 2 /* did find a fold */
+
+static int foldstartmarkerlen;
+static char_u *foldendmarker;
+static int foldendmarkerlen;
+
+/* Exported folding functions. {{{1 */
+/* copyFoldingState() {{{2 */
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Copy that folding state from window "wp_from" to window "wp_to".
+ */
+ void
+copyFoldingState(wp_from, wp_to)
+ win_T *wp_from;
+ win_T *wp_to;
+{
+ wp_to->w_fold_manual = wp_from->w_fold_manual;
+ wp_to->w_foldinvalid = wp_from->w_foldinvalid;
+ cloneFoldGrowArray(&wp_from->w_folds, &wp_to->w_folds);
+}
+#endif
+
+/* hasAnyFolding() {{{2 */
+/*
+ * Return TRUE if there may be folded lines in the current window.
+ */
+ int
+hasAnyFolding(win)
+ win_T *win;
+{
+ /* very simple now, but can become more complex later */
+ return (win->w_p_fen
+ && (!foldmethodIsManual(win) || win->w_folds.ga_len > 0));
+}
+
+/* hasFolding() {{{2 */
+/*
+ * Return TRUE if line "lnum" in the current window is part of a closed
+ * fold.
+ * When returning TRUE, *firstp and *lastp are set to the first and last
+ * lnum of the sequence of folded lines (skipped when NULL).
+ */
+ int
+hasFolding(lnum, firstp, lastp)
+ linenr_T lnum;
+ linenr_T *firstp;
+ linenr_T *lastp;
+{
+ return hasFoldingWin(curwin, lnum, firstp, lastp, TRUE, NULL);
+}
+
+/* hasFoldingWin() {{{2 */
+ int
+hasFoldingWin(win, lnum, firstp, lastp, cache, infop)
+ win_T *win;
+ linenr_T lnum;
+ linenr_T *firstp;
+ linenr_T *lastp;
+ int cache; /* when TRUE: use cached values of window */
+ foldinfo_T *infop; /* where to store fold info */
+{
+ int had_folded = FALSE;
+ linenr_T first = 0;
+ linenr_T last = 0;
+ linenr_T lnum_rel = lnum;
+ int x;
+ fold_T *fp;
+ int level = 0;
+ int use_level = FALSE;
+ int maybe_small = FALSE;
+ garray_T *gap;
+ int low_level = 0;;
+
+ checkupdate(win);
+ /*
+ * Return quickly when there is no folding at all in this window.
+ */
+ if (!hasAnyFolding(win))
+ {
+ if (infop != NULL)
+ infop->fi_level = 0;
+ return FALSE;
+ }
+
+ if (cache)
+ {
+ /*
+ * First look in cached info for displayed lines. This is probably
+ * the fastest, but it can only be used if the entry is still valid.
+ */
+ x = find_wl_entry(win, lnum);
+ if (x >= 0)
+ {
+ first = win->w_lines[x].wl_lnum;
+ last = win->w_lines[x].wl_lastlnum;
+ had_folded = win->w_lines[x].wl_folded;
+ }
+ }
+
+ if (first == 0)
+ {
+ /*
+ * Recursively search for a fold that contains "lnum".
+ */
+ gap = &win->w_folds;
+ for (;;)
+ {
+ if (!foldFind(gap, lnum_rel, &fp))
+ break;
+
+ /* Remember lowest level of fold that starts in "lnum". */
+ if (lnum_rel == fp->fd_top && low_level == 0)
+ low_level = level + 1;
+
+ first += fp->fd_top;
+ last += fp->fd_top;
+
+ /* is this fold closed? */
+ had_folded = check_closed(win, fp, &use_level, level,
+ &maybe_small, lnum - lnum_rel);
+ if (had_folded)
+ {
+ /* Fold closed: Set last and quit loop. */
+ last += fp->fd_len - 1;
+ break;
+ }
+
+ /* Fold found, but it's open: Check nested folds. Line number is
+ * relative to containing fold. */
+ gap = &fp->fd_nested;
+ lnum_rel -= fp->fd_top;
+ ++level;
+ }
+ }
+
+ if (!had_folded)
+ {
+ if (infop != NULL)
+ {
+ infop->fi_level = level;
+ infop->fi_lnum = lnum - lnum_rel;
+ infop->fi_low_level = low_level == 0 ? level : low_level;
+ }
+ return FALSE;
+ }
+
+ if (lastp != NULL)
+ *lastp = last;
+ if (firstp != NULL)
+ *firstp = first;
+ if (infop != NULL)
+ {
+ infop->fi_level = level + 1;
+ infop->fi_lnum = first;
+ infop->fi_low_level = low_level == 0 ? level + 1 : low_level;
+ }
+ return TRUE;
+}
+
+/* foldLevel() {{{2 */
+/*
+ * Return fold level at line number "lnum" in the current window.
+ */
+ int
+foldLevel(lnum)
+ linenr_T lnum;
+{
+ /* While updating the folds lines between invalid_top and invalid_bot have
+ * an undefined fold level. Otherwise update the folds first. */
+ if (invalid_top == (linenr_T)0)
+ checkupdate(curwin);
+ else if (lnum == prev_lnum && prev_lnum_lvl >= 0)
+ return prev_lnum_lvl;
+ else if (lnum >= invalid_top && lnum <= invalid_bot)
+ return -1;
+
+ /* Return quickly when there is no folding at all in this window. */
+ if (!hasAnyFolding(curwin))
+ return 0;
+
+ return foldLevelWin(curwin, lnum);
+}
+
+/* lineFolded() {{{2 */
+/*
+ * Low level function to check if a line is folded. Doesn't use any caching.
+ * Return TRUE if line is folded.
+ * Return FALSE if line is not folded.
+ * Return MAYBE if the line is folded when next to a folded line.
+ */
+ int
+lineFolded(win, lnum)
+ win_T *win;
+ linenr_T lnum;
+{
+ return foldedCount(win, lnum, NULL) != 0;
+}
+
+/* foldedCount() {{{2 */
+/*
+ * Count the number of lines that are folded at line number "lnum".
+ * Normally "lnum" is the first line of a possible fold, and the returned
+ * number is the number of lines in the fold.
+ * Doesn't use caching from the displayed window.
+ * Returns number of folded lines from "lnum", or 0 if line is not folded.
+ * When "infop" is not NULL, fills *infop with the fold level info.
+ */
+ long
+foldedCount(win, lnum, infop)
+ win_T *win;
+ linenr_T lnum;
+ foldinfo_T *infop;
+{
+ linenr_T last;
+
+ if (hasFoldingWin(win, lnum, NULL, &last, FALSE, infop))
+ return (long)(last - lnum + 1);
+ return 0;
+}
+
+/* foldmethodIsManual() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "manual"
+ */
+ int
+foldmethodIsManual(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[3] == 'u');
+}
+
+/* foldmethodIsIndent() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "indent"
+ */
+ int
+foldmethodIsIndent(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[0] == 'i');
+}
+
+/* foldmethodIsExpr() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "expr"
+ */
+ int
+foldmethodIsExpr(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[1] == 'x');
+}
+
+/* foldmethodIsMarker() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "marker"
+ */
+ int
+foldmethodIsMarker(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[2] == 'r');
+}
+
+/* foldmethodIsSyntax() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "syntax"
+ */
+ int
+foldmethodIsSyntax(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[0] == 's');
+}
+
+/* foldmethodIsDiff() {{{2 */
+/*
+ * Return TRUE if 'foldmethod' is "diff"
+ */
+ int
+foldmethodIsDiff(wp)
+ win_T *wp;
+{
+ return (wp->w_p_fdm[0] == 'd');
+}
+
+/* closeFold() {{{2 */
+/*
+ * Close fold for current window at line "lnum".
+ * Repeat "count" times.
+ */
+ void
+closeFold(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ setFoldRepeat(lnum, count, FALSE);
+}
+
+/* closeFoldRecurse() {{{2 */
+/*
+ * Close fold for current window at line "lnum" recursively.
+ */
+ void
+closeFoldRecurse(lnum)
+ linenr_T lnum;
+{
+ (void)setManualFold(lnum, FALSE, TRUE, NULL);
+}
+
+/* opFoldRange() {{{2 */
+/*
+ * Open or Close folds for current window in lines "first" to "last".
+ * Used for "zo", "zO", "zc" and "zC" in Visual mode.
+ */
+ void
+opFoldRange(first, last, opening, recurse, had_visual)
+ linenr_T first;
+ linenr_T last;
+ int opening; /* TRUE to open, FALSE to close */
+ int recurse; /* TRUE to do it recursively */
+ int had_visual; /* TRUE when Visual selection used */
+{
+ int done = DONE_NOTHING; /* avoid error messages */
+ linenr_T lnum;
+ linenr_T lnum_next;
+
+ for (lnum = first; lnum <= last; lnum = lnum_next + 1)
+ {
+ lnum_next = lnum;
+ /* Opening one level only: next fold to open is after the one going to
+ * be opened. */
+ if (opening && !recurse)
+ (void)hasFolding(lnum, NULL, &lnum_next);
+ (void)setManualFold(lnum, opening, recurse, &done);
+ /* Closing one level only: next line to close a fold is after just
+ * closed fold. */
+ if (!opening && !recurse)
+ (void)hasFolding(lnum, NULL, &lnum_next);
+ }
+ if (done == DONE_NOTHING)
+ EMSG(_(e_nofold));
+#ifdef FEAT_VISUAL
+ /* Force a redraw to remove the Visual highlighting. */
+ if (had_visual)
+ redraw_curbuf_later(INVERTED);
+#endif
+}
+
+/* openFold() {{{2 */
+/*
+ * Open fold for current window at line "lnum".
+ * Repeat "count" times.
+ */
+ void
+openFold(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ setFoldRepeat(lnum, count, TRUE);
+}
+
+/* openFoldRecurse() {{{2 */
+/*
+ * Open fold for current window at line "lnum" recursively.
+ */
+ void
+openFoldRecurse(lnum)
+ linenr_T lnum;
+{
+ (void)setManualFold(lnum, TRUE, TRUE, NULL);
+}
+
+/* foldOpenCursor() {{{2 */
+/*
+ * Open folds until the cursor line is not in a closed fold.
+ */
+ void
+foldOpenCursor()
+{
+ int done;
+
+ checkupdate(curwin);
+ if (hasAnyFolding(curwin))
+ for (;;)
+ {
+ done = DONE_NOTHING;
+ (void)setManualFold(curwin->w_cursor.lnum, TRUE, FALSE, &done);
+ if (!(done & DONE_ACTION))
+ break;
+ }
+}
+
+/* newFoldLevel() {{{2 */
+/*
+ * Set new foldlevel for current window.
+ */
+ void
+newFoldLevel()
+{
+ newFoldLevelWin(curwin);
+
+#ifdef FEAT_DIFF
+ if (foldmethodIsDiff(curwin) && curwin->w_p_scb)
+ {
+ win_T *wp;
+
+ /*
+ * Set the same foldlevel in other windows in diff mode.
+ */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb)
+ {
+ wp->w_p_fdl = curwin->w_p_fdl;
+ newFoldLevelWin(wp);
+ }
+ }
+ }
+#endif
+}
+
+ static void
+newFoldLevelWin(wp)
+ win_T *wp;
+{
+ fold_T *fp;
+ int i;
+
+ checkupdate(wp);
+ if (wp->w_fold_manual)
+ {
+ /* Set all flags for the first level of folds to FD_LEVEL. Following
+ * manual open/close will then change the flags to FD_OPEN or
+ * FD_CLOSED for those folds that don't use 'foldlevel'. */
+ fp = (fold_T *)wp->w_folds.ga_data;
+ for (i = 0; i < wp->w_folds.ga_len; ++i)
+ fp[i].fd_flags = FD_LEVEL;
+ wp->w_fold_manual = FALSE;
+ }
+ changed_window_setting_win(wp);
+}
+
+/* foldCheckClose() {{{2 */
+/*
+ * Apply 'foldlevel' to all folds that don't contain the cursor.
+ */
+ void
+foldCheckClose()
+{
+ if (*p_fcl != NUL) /* can only be "all" right now */
+ {
+ checkupdate(curwin);
+ if (checkCloseRec(&curwin->w_folds, curwin->w_cursor.lnum,
+ (int)curwin->w_p_fdl))
+ changed_window_setting();
+ }
+}
+
+/* checkCloseRec() {{{2 */
+ static int
+checkCloseRec(gap, lnum, level)
+ garray_T *gap;
+ linenr_T lnum;
+ int level;
+{
+ fold_T *fp;
+ int retval = FALSE;
+ int i;
+
+ fp = (fold_T *)gap->ga_data;
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ /* Only manually opened folds may need to be closed. */
+ if (fp[i].fd_flags == FD_OPEN)
+ {
+ if (level <= 0 && (lnum < fp[i].fd_top
+ || lnum >= fp[i].fd_top + fp[i].fd_len))
+ {
+ fp[i].fd_flags = FD_LEVEL;
+ retval = TRUE;
+ }
+ else
+ retval |= checkCloseRec(&fp[i].fd_nested, lnum - fp[i].fd_top,
+ level - 1);
+ }
+ }
+ return retval;
+}
+
+/* foldCreateAllowed() {{{2 */
+/*
+ * Return TRUE if it's allowed to manually create or delete a fold.
+ * Give an error message and return FALSE if not.
+ */
+ int
+foldManualAllowed(create)
+ int create;
+{
+ if (foldmethodIsManual(curwin) || foldmethodIsMarker(curwin))
+ return TRUE;
+ if (create)
+ EMSG(_("E350: Cannot create fold with current 'foldmethod'"));
+ else
+ EMSG(_("E351: Cannot delete fold with current 'foldmethod'"));
+ return FALSE;
+}
+
+/* foldCreate() {{{2 */
+/*
+ * Create a fold from line "start" to line "end" (inclusive) in the current
+ * window.
+ */
+ void
+foldCreate(start, end)
+ linenr_T start;
+ linenr_T end;
+{
+ fold_T *fp;
+ garray_T *gap;
+ garray_T fold_ga;
+ int i, j;
+ int cont;
+ int use_level = FALSE;
+ int closed = FALSE;
+ int level = 0;
+ linenr_T start_rel = start;
+ linenr_T end_rel = end;
+
+ if (start > end)
+ {
+ /* reverse the range */
+ end = start_rel;
+ start = end_rel;
+ start_rel = start;
+ end_rel = end;
+ }
+
+ /* When 'foldmethod' is "marker" add markers, which creates the folds. */
+ if (foldmethodIsMarker(curwin))
+ {
+ foldCreateMarkers(start, end);
+ return;
+ }
+
+ checkupdate(curwin);
+
+ /* Find the place to insert the new fold. */
+ gap = &curwin->w_folds;
+ for (;;)
+ {
+ if (!foldFind(gap, start_rel, &fp))
+ break;
+ if (fp->fd_top + fp->fd_len > end_rel)
+ {
+ /* New fold is completely inside this fold: Go one level deeper. */
+ gap = &fp->fd_nested;
+ start_rel -= fp->fd_top;
+ end_rel -= fp->fd_top;
+ if (use_level || fp->fd_flags == FD_LEVEL)
+ {
+ use_level = TRUE;
+ if (level >= curwin->w_p_fdl)
+ closed = TRUE;
+ }
+ else if (fp->fd_flags == FD_CLOSED)
+ closed = TRUE;
+ ++level;
+ }
+ else
+ {
+ /* This fold and new fold overlap: Insert here and move some folds
+ * inside the new fold. */
+ break;
+ }
+ }
+
+ i = (int)(fp - (fold_T *)gap->ga_data);
+ if (ga_grow(gap, 1) == OK)
+ {
+ fp = (fold_T *)gap->ga_data + i;
+ ga_init2(&fold_ga, (int)sizeof(fold_T), 10);
+
+ /* Count number of folds that will be contained in the new fold. */
+ for (cont = 0; i + cont < gap->ga_len; ++cont)
+ if (fp[cont].fd_top > end_rel)
+ break;
+ if (cont > 0 && ga_grow(&fold_ga, cont) == OK)
+ {
+ /* If the first fold starts before the new fold, let the new fold
+ * start there. Otherwise the existing fold would change. */
+ if (start_rel > fp->fd_top)
+ start_rel = fp->fd_top;
+
+ /* When last contained fold isn't completely contained, adjust end
+ * of new fold. */
+ if (end_rel < fp[cont - 1].fd_top + fp[cont - 1].fd_len - 1)
+ end_rel = fp[cont - 1].fd_top + fp[cont - 1].fd_len - 1;
+ /* Move contained folds to inside new fold. */
+ mch_memmove(fold_ga.ga_data, fp, sizeof(fold_T) * cont);
+ fold_ga.ga_len += cont;
+ fold_ga.ga_room -= cont;
+ i += cont;
+
+ /* Adjust line numbers in contained folds to be relative to the
+ * new fold. */
+ for (j = 0; j < cont; ++j)
+ ((fold_T *)fold_ga.ga_data)[j].fd_top -= start_rel;
+ }
+ /* Move remaining entries to after the new fold. */
+ if (i < gap->ga_len)
+ mch_memmove(fp + 1, (fold_T *)gap->ga_data + i,
+ sizeof(fold_T) * (gap->ga_len - i));
+ gap->ga_len = gap->ga_len + 1 - cont;
+ gap->ga_room = gap->ga_room - 1 + cont;
+
+ /* insert new fold */
+ fp->fd_nested = fold_ga;
+ fp->fd_top = start_rel;
+ fp->fd_len = end_rel - start_rel + 1;
+
+ /* We want the new fold to be closed. If it would remain open because
+ * of using 'foldlevel', need to adjust fd_flags of containing folds.
+ */
+ if (use_level && !closed && level < curwin->w_p_fdl)
+ closeFold(start, 1L);
+ if (!use_level)
+ curwin->w_fold_manual = TRUE;
+ fp->fd_flags = FD_CLOSED;
+ fp->fd_small = MAYBE;
+
+ /* redraw */
+ changed_window_setting();
+ }
+}
+
+/* deleteFold() {{{2 */
+/*
+ * Delete a fold at line "start" in the current window.
+ * When "end" is not 0, delete all folds from "start" to "end".
+ * When "recursive" is TRUE delete recursively.
+ */
+ void
+deleteFold(start, end, recursive, had_visual)
+ linenr_T start;
+ linenr_T end;
+ int recursive;
+ int had_visual; /* TRUE when Visual selection used */
+{
+ garray_T *gap;
+ fold_T *fp;
+ garray_T *found_ga;
+ fold_T *found_fp = NULL;
+ linenr_T found_off = 0;
+ int use_level = FALSE;
+ int maybe_small = FALSE;
+ int level = 0;
+ linenr_T lnum = start;
+ linenr_T lnum_off;
+ int did_one = FALSE;
+ linenr_T first_lnum = MAXLNUM;
+ linenr_T last_lnum = 0;
+
+ checkupdate(curwin);
+
+ while (lnum <= end)
+ {
+ /* Find the deepest fold for "start". */
+ gap = &curwin->w_folds;
+ found_ga = NULL;
+ lnum_off = 0;
+ for (;;)
+ {
+ if (!foldFind(gap, lnum - lnum_off, &fp))
+ break;
+ /* lnum is inside this fold, remember info */
+ found_ga = gap;
+ found_fp = fp;
+ found_off = lnum_off;
+
+ /* if "lnum" is folded, don't check nesting */
+ if (check_closed(curwin, fp, &use_level, level,
+ &maybe_small, lnum_off))
+ break;
+
+ /* check nested folds */
+ gap = &fp->fd_nested;
+ lnum_off += fp->fd_top;
+ ++level;
+ }
+ if (found_ga == NULL)
+ {
+ ++lnum;
+ }
+ else
+ {
+ lnum = found_fp->fd_top + found_fp->fd_len + found_off;
+ did_one = TRUE;
+
+ if (foldmethodIsManual(curwin))
+ deleteFoldEntry(found_ga,
+ (int)(found_fp - (fold_T *)found_ga->ga_data), recursive);
+ else
+ {
+ if (found_fp->fd_top + found_off < first_lnum)
+ first_lnum = found_fp->fd_top;
+ if (lnum > last_lnum)
+ last_lnum = lnum;
+ parseMarker(curwin);
+ deleteFoldMarkers(found_fp, recursive, found_off);
+ }
+
+ /* redraw window */
+ changed_window_setting();
+ }
+ }
+ if (!did_one)
+ {
+ EMSG(_(e_nofold));
+#ifdef FEAT_VISUAL
+ /* Force a redraw to remove the Visual highlighting. */
+ if (had_visual)
+ redraw_curbuf_later(INVERTED);
+#endif
+ }
+ if (last_lnum > 0)
+ changed_lines(first_lnum, (colnr_T)0, last_lnum, 0L);
+}
+
+/* clearFolding() {{{2 */
+/*
+ * Remove all folding for window "win".
+ */
+ void
+clearFolding(win)
+ win_T *win;
+{
+ deleteFoldRecurse(&win->w_folds);
+ win->w_foldinvalid = FALSE;
+}
+
+/* foldUpdate() {{{2 */
+/*
+ * Update folds for changes in the buffer of a window.
+ * Note that inserted/deleted lines must have already been taken care of by
+ * calling foldMarkAdjust().
+ * The changes in lines from top to bot (inclusive).
+ */
+ void
+foldUpdate(wp, top, bot)
+ win_T *wp;
+ linenr_T top;
+ linenr_T bot;
+{
+ fold_T *fp;
+
+ /* Mark all folds from top to bot as maybe-small. */
+ (void)foldFind(&curwin->w_folds, curwin->w_cursor.lnum, &fp);
+ while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len
+ && fp->fd_top < bot)
+ {
+ fp->fd_small = MAYBE;
+ ++fp;
+ }
+
+ if (foldmethodIsIndent(wp)
+ || foldmethodIsExpr(wp)
+ || foldmethodIsMarker(wp)
+#ifdef FEAT_DIFF
+ || foldmethodIsDiff(wp)
+#endif
+ || foldmethodIsSyntax(wp))
+ foldUpdateIEMS(wp, top, bot);
+}
+
+/* foldUpdateAll() {{{2 */
+/*
+ * Update all lines in a window for folding.
+ * Used when a fold setting changes or after reloading the buffer.
+ * The actual updating is postponed until fold info is used, to avoid doing
+ * every time a setting is changed or a syntax item is added.
+ */
+ void
+foldUpdateAll(win)
+ win_T *win;
+{
+ win->w_foldinvalid = TRUE;
+ redraw_win_later(win, NOT_VALID);
+}
+
+/* foldMoveTo() {{{2 */
+/*
+ * If "updown" is FALSE: Move to the start or end of the fold.
+ * If "updown" is TRUE: move to fold at the same level.
+ * If not moved return FAIL.
+ */
+ int
+foldMoveTo(updown, dir, count)
+ int updown;
+ int dir; /* FORWARD or BACKWARD */
+ long count;
+{
+ long n;
+ int retval = FAIL;
+ linenr_T lnum_off;
+ linenr_T lnum_found;
+ linenr_T lnum;
+ int use_level;
+ int maybe_small;
+ garray_T *gap;
+ fold_T *fp;
+ int level;
+ int last;
+
+ /* Repeat "count" times. */
+ for (n = 0; n < count; ++n)
+ {
+ /* Find nested folds. Stop when a fold is closed. The deepest fold
+ * that moves the cursor is used. */
+ lnum_off = 0;
+ gap = &curwin->w_folds;
+ use_level = FALSE;
+ maybe_small = FALSE;
+ lnum_found = curwin->w_cursor.lnum;
+ level = 0;
+ last = FALSE;
+ for (;;)
+ {
+ if (!foldFind(gap, curwin->w_cursor.lnum - lnum_off, &fp))
+ {
+ if (!updown)
+ break;
+
+ /* When moving up, consider a fold above the cursor; when
+ * moving down consider a fold below the cursor. */
+ if (dir == FORWARD)
+ {
+ if (fp - (fold_T *)gap->ga_data >= gap->ga_len)
+ break;
+ --fp;
+ }
+ else
+ {
+ if (fp == (fold_T *)gap->ga_data)
+ break;
+ }
+ /* don't look for contained folds, they will always move
+ * the cursor too far. */
+ last = TRUE;
+ }
+
+ if (!last)
+ {
+ /* Check if this fold is closed. */
+ if (check_closed(curwin, fp, &use_level, level,
+ &maybe_small, lnum_off))
+ last = TRUE;
+
+ /* "[z" and "]z" stop at closed fold */
+ if (last && !updown)
+ break;
+ }
+
+ if (updown)
+ {
+ if (dir == FORWARD)
+ {
+ /* to start of next fold if there is one */
+ if (fp + 1 - (fold_T *)gap->ga_data < gap->ga_len)
+ {
+ lnum = fp[1].fd_top + lnum_off;
+ if (lnum > curwin->w_cursor.lnum)
+ lnum_found = lnum;
+ }
+ }
+ else
+ {
+ /* to end of previous fold if there is one */
+ if (fp > (fold_T *)gap->ga_data)
+ {
+ lnum = fp[-1].fd_top + lnum_off + fp[-1].fd_len - 1;
+ if (lnum < curwin->w_cursor.lnum)
+ lnum_found = lnum;
+ }
+ }
+ }
+ else
+ {
+ /* Open fold found, set cursor to its start/end and then check
+ * nested folds. */
+ if (dir == FORWARD)
+ {
+ lnum = fp->fd_top + lnum_off + fp->fd_len - 1;
+ if (lnum > curwin->w_cursor.lnum)
+ lnum_found = lnum;
+ }
+ else
+ {
+ lnum = fp->fd_top + lnum_off;
+ if (lnum < curwin->w_cursor.lnum)
+ lnum_found = lnum;
+ }
+ }
+
+ if (last)
+ break;
+
+ /* Check nested folds (if any). */
+ gap = &fp->fd_nested;
+ lnum_off += fp->fd_top;
+ ++level;
+ }
+ if (lnum_found != curwin->w_cursor.lnum)
+ {
+ if (retval == FAIL)
+ setpcmark();
+ curwin->w_cursor.lnum = lnum_found;
+ curwin->w_cursor.col = 0;
+ retval = OK;
+ }
+ else
+ break;
+ }
+
+ return retval;
+}
+
+/* foldInitWin() {{{2 */
+/*
+ * Init the fold info in a new window.
+ */
+ void
+foldInitWin(newwin)
+ win_T *newwin;
+{
+ ga_init2(&newwin->w_folds, (int)sizeof(fold_T), 10);
+}
+
+/* find_wl_entry() {{{2 */
+/*
+ * Find an entry in the win->w_lines[] array for buffer line "lnum".
+ * Only valid entries are considered (for entries where wl_valid is FALSE the
+ * line number can be wrong).
+ * Returns index of entry or -1 if not found.
+ */
+ int
+find_wl_entry(win, lnum)
+ win_T *win;
+ linenr_T lnum;
+{
+ int i;
+
+ if (win->w_lines_valid > 0)
+ for (i = 0; i < win->w_lines_valid; ++i)
+ if (win->w_lines[i].wl_valid)
+ {
+ if (lnum < win->w_lines[i].wl_lnum)
+ return -1;
+ if (lnum <= win->w_lines[i].wl_lastlnum)
+ return i;
+ }
+ return -1;
+}
+
+/* foldAdjustVisual() {{{2 */
+#ifdef FEAT_VISUAL
+/*
+ * Adjust the Visual area to include any fold at the start or end completely.
+ */
+ void
+foldAdjustVisual()
+{
+ pos_T *start, *end;
+ char_u *ptr;
+
+ if (!VIsual_active || !hasAnyFolding(curwin))
+ return;
+
+ if (ltoreq(VIsual, curwin->w_cursor))
+ {
+ start = &VIsual;
+ end = &curwin->w_cursor;
+ }
+ else
+ {
+ start = &curwin->w_cursor;
+ end = &VIsual;
+ }
+ if (hasFolding(start->lnum, &start->lnum, NULL))
+ start->col = 0;
+ if (hasFolding(end->lnum, NULL, &end->lnum))
+ {
+ ptr = ml_get(end->lnum);
+ end->col = (colnr_T)STRLEN(ptr);
+ if (end->col > 0 && *p_sel == 'o')
+ --end->col;
+#ifdef FEAT_MBYTE
+ /* prevent cursor from moving on the trail byte */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+ }
+}
+#endif
+
+/* cursor_foldstart() {{{2 */
+/*
+ * Move the cursor to the first line of a closed fold.
+ */
+ void
+foldAdjustCursor()
+{
+ (void)hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL);
+}
+
+/* Internal functions for "fold_T" {{{1 */
+/* cloneFoldGrowArray() {{{2 */
+/*
+ * Will "clone" (i.e deep copy) a garray_T of folds.
+ *
+ * Return FAIL if the operation cannot be completed, otherwise OK.
+ */
+ void
+cloneFoldGrowArray(from, to)
+ garray_T *from;
+ garray_T *to;
+{
+ int i;
+ fold_T *from_p;
+ fold_T *to_p;
+
+ ga_init2(to, from->ga_itemsize, from->ga_growsize);
+ if (from->ga_len == 0 || ga_grow(to, from->ga_len) == FAIL)
+ return;
+
+ from_p = (fold_T *)from->ga_data;
+ to_p = (fold_T *)to->ga_data;
+
+ for (i = 0; i < from->ga_len; i++)
+ {
+ to_p->fd_top = from_p->fd_top;
+ to_p->fd_len = from_p->fd_len;
+ to_p->fd_flags = from_p->fd_flags;
+ to_p->fd_small = from_p->fd_small;
+ cloneFoldGrowArray(&from_p->fd_nested, &to_p->fd_nested);
+ ++to->ga_len;
+ --to->ga_room;
+ ++from_p;
+ ++to_p;
+ }
+}
+
+/* foldFind() {{{2 */
+/*
+ * Search for line "lnum" in folds of growarray "gap".
+ * Set *fpp to the fold struct for the fold that contains "lnum" or
+ * the first fold below it (careful: it can be beyond the end of the array!).
+ * Returns FALSE when there is no fold that contains "lnum".
+ */
+ static int
+foldFind(gap, lnum, fpp)
+ garray_T *gap;
+ linenr_T lnum;
+ fold_T **fpp;
+{
+ linenr_T low, high;
+ fold_T *fp;
+ int i;
+
+ /*
+ * Perform a binary search.
+ * "low" is lowest index of possible match.
+ * "high" is highest index of possible match.
+ */
+ fp = (fold_T *)gap->ga_data;
+ low = 0;
+ high = gap->ga_len - 1;
+ while (low <= high)
+ {
+ i = (low + high) / 2;
+ if (fp[i].fd_top > lnum)
+ /* fold below lnum, adjust high */
+ high = i - 1;
+ else if (fp[i].fd_top + fp[i].fd_len <= lnum)
+ /* fold above lnum, adjust low */
+ low = i + 1;
+ else
+ {
+ /* lnum is inside this fold */
+ *fpp = fp + i;
+ return TRUE;
+ }
+ }
+ *fpp = fp + low;
+ return FALSE;
+}
+
+/* foldLevelWin() {{{2 */
+/*
+ * Return fold level at line number "lnum" in window "wp".
+ */
+ static int
+foldLevelWin(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ fold_T *fp;
+ linenr_T lnum_rel = lnum;
+ int level = 0;
+ garray_T *gap;
+
+ /* Recursively search for a fold that contains "lnum". */
+ gap = &wp->w_folds;
+ for (;;)
+ {
+ if (!foldFind(gap, lnum_rel, &fp))
+ break;
+ /* Check nested folds. Line number is relative to containing fold. */
+ gap = &fp->fd_nested;
+ lnum_rel -= fp->fd_top;
+ ++level;
+ }
+
+ return level;
+}
+
+/* checkupdate() {{{2 */
+/*
+ * Check if the folds in window "wp" are invalid and update them if needed.
+ */
+ static void
+checkupdate(wp)
+ win_T *wp;
+{
+ if (wp->w_foldinvalid)
+ {
+ foldUpdate(wp, (linenr_T)1, (linenr_T)MAXLNUM); /* will update all */
+ wp->w_foldinvalid = FALSE;
+ }
+}
+
+/* setFoldRepeat() {{{2 */
+/*
+ * Open or close fold for current window at line "lnum".
+ * Repeat "count" times.
+ */
+ static void
+setFoldRepeat(lnum, count, open)
+ linenr_T lnum;
+ long count;
+ int open;
+{
+ int done;
+ long n;
+
+ for (n = 0; n < count; ++n)
+ {
+ done = DONE_NOTHING;
+ (void)setManualFold(lnum, open, FALSE, &done);
+ if (!(done & DONE_ACTION))
+ {
+ /* Only give an error message when no fold could be opened. */
+ if (n == 0 && !(done & DONE_FOLD))
+ EMSG(_(e_nofold));
+ break;
+ }
+ }
+}
+
+/* setManualFold() {{{2 */
+/*
+ * Open or close the fold in the current window which contains "lnum".
+ * Also does this for other windows in diff mode when needed.
+ */
+ static linenr_T
+setManualFold(lnum, opening, recurse, donep)
+ linenr_T lnum;
+ int opening; /* TRUE when opening, FALSE when closing */
+ int recurse; /* TRUE when closing/opening recursive */
+ int *donep;
+{
+#ifdef FEAT_DIFF
+ if (foldmethodIsDiff(curwin) && curwin->w_p_scb)
+ {
+ win_T *wp;
+ linenr_T dlnum;
+
+ /*
+ * Do the same operation in other windows in diff mode. Calculate the
+ * line number from the diffs.
+ */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb)
+ {
+ dlnum = diff_lnum_win(curwin->w_cursor.lnum, wp);
+ if (dlnum != 0)
+ (void)setManualFoldWin(wp, dlnum, opening, recurse, NULL);
+ }
+ }
+ }
+#endif
+
+ return setManualFoldWin(curwin, lnum, opening, recurse, donep);
+}
+
+/* setManualFoldWin() {{{2 */
+/*
+ * Open or close the fold in window "wp" which contains "lnum".
+ * "donep", when not NULL, points to flag that is set to DONE_FOLD when some
+ * fold was found and to DONE_ACTION when some fold was opened or closed.
+ * When "donep" is NULL give an error message when no fold was found for
+ * "lnum", but only if "wp" is "curwin".
+ * Return the line number of the next line that could be closed.
+ * It's only valid when "opening" is TRUE!
+ */
+ static linenr_T
+setManualFoldWin(wp, lnum, opening, recurse, donep)
+ win_T *wp;
+ linenr_T lnum;
+ int opening; /* TRUE when opening, FALSE when closing */
+ int recurse; /* TRUE when closing/opening recursive */
+ int *donep;
+{
+ fold_T *fp;
+ fold_T *fp2;
+ fold_T *found = NULL;
+ int j;
+ int level = 0;
+ int use_level = FALSE;
+ int found_fold = FALSE;
+ garray_T *gap;
+ linenr_T next = MAXLNUM;
+ linenr_T off = 0;
+ int done = 0;
+
+ checkupdate(wp);
+
+ /*
+ * Find the fold, open or close it.
+ */
+ gap = &wp->w_folds;
+ for (;;)
+ {
+ if (!foldFind(gap, lnum, &fp))
+ {
+ /* If there is a following fold, continue there next time. */
+ if (fp < (fold_T *)gap->ga_data + gap->ga_len)
+ next = fp->fd_top + off;
+ break;
+ }
+
+ /* lnum is inside this fold */
+ found_fold = TRUE;
+
+ /* If there is a following fold, continue there next time. */
+ if (fp + 1 < (fold_T *)gap->ga_data + gap->ga_len)
+ next = fp[1].fd_top + off;
+
+ /* Change from level-dependent folding to manual. */
+ if (use_level || fp->fd_flags == FD_LEVEL)
+ {
+ use_level = TRUE;
+ if (level >= wp->w_p_fdl)
+ fp->fd_flags = FD_CLOSED;
+ else
+ fp->fd_flags = FD_OPEN;
+ fp2 = (fold_T *)fp->fd_nested.ga_data;
+ for (j = 0; j < fp->fd_nested.ga_len; ++j)
+ fp2[j].fd_flags = FD_LEVEL;
+ }
+
+ /* Simple case: Close recursively means closing the fold. */
+ if (!opening && recurse)
+ {
+ if (fp->fd_flags != FD_CLOSED)
+ {
+ done |= DONE_ACTION;
+ fp->fd_flags = FD_CLOSED;
+ }
+ }
+ else if (fp->fd_flags == FD_CLOSED)
+ {
+ /* When opening, open topmost closed fold. */
+ if (opening)
+ {
+ fp->fd_flags = FD_OPEN;
+ done |= DONE_ACTION;
+ if (recurse)
+ foldOpenNested(fp);
+ }
+ break;
+ }
+
+ /* fold is open, check nested folds */
+ found = fp;
+ gap = &fp->fd_nested;
+ lnum -= fp->fd_top;
+ off += fp->fd_top;
+ ++level;
+ }
+ if (found_fold)
+ {
+ /* When closing and not recurse, close deepest open fold. */
+ if (!opening && found != NULL)
+ {
+ found->fd_flags = FD_CLOSED;
+ done |= DONE_ACTION;
+ }
+ wp->w_fold_manual = TRUE;
+ if (done & DONE_ACTION)
+ changed_window_setting_win(wp);
+ done |= DONE_FOLD;
+ }
+ else if (donep == NULL && wp == curwin)
+ EMSG(_(e_nofold));
+
+ if (donep != NULL)
+ *donep |= done;
+
+ return next;
+}
+
+/* foldOpenNested() {{{2 */
+/*
+ * Open all nested folds in fold "fpr" recursively.
+ */
+ static void
+foldOpenNested(fpr)
+ fold_T *fpr;
+{
+ int i;
+ fold_T *fp;
+
+ fp = (fold_T *)fpr->fd_nested.ga_data;
+ for (i = 0; i < fpr->fd_nested.ga_len; ++i)
+ {
+ foldOpenNested(&fp[i]);
+ fp[i].fd_flags = FD_OPEN;
+ }
+}
+
+/* deleteFoldEntry() {{{2 */
+/*
+ * Delete fold "idx" from growarray "gap".
+ * When "recursive" is TRUE also delete all the folds contained in it.
+ * When "recursive" is FALSE contained folds are moved one level up.
+ */
+ static void
+deleteFoldEntry(gap, idx, recursive)
+ garray_T *gap;
+ int idx;
+ int recursive;
+{
+ fold_T *fp;
+ int i;
+ long moved;
+ fold_T *nfp;
+
+ fp = (fold_T *)gap->ga_data + idx;
+ if (recursive || fp->fd_nested.ga_len == 0)
+ {
+ /* recursively delete the contained folds */
+ deleteFoldRecurse(&fp->fd_nested);
+ --gap->ga_len;
+ ++gap->ga_room;
+ if (idx < gap->ga_len)
+ mch_memmove(fp, fp + 1, sizeof(fold_T) * (gap->ga_len - idx));
+ }
+ else
+ {
+ /* move nested folds one level up, to overwrite the fold that is
+ * deleted. */
+ moved = fp->fd_nested.ga_len;
+ if (ga_grow(gap, (int)(moved - 1)) == OK)
+ {
+ /* adjust fd_top and fd_flags for the moved folds */
+ nfp = (fold_T *)fp->fd_nested.ga_data;
+ for (i = 0; i < moved; ++i)
+ {
+ nfp[i].fd_top += fp->fd_top;
+ if (fp->fd_flags == FD_LEVEL)
+ nfp[i].fd_flags = FD_LEVEL;
+ if (fp->fd_small == MAYBE)
+ nfp[i].fd_small = MAYBE;
+ }
+
+ /* move the existing folds down to make room */
+ if (idx < gap->ga_len)
+ mch_memmove(fp + moved, fp + 1,
+ sizeof(fold_T) * (gap->ga_len - idx));
+ /* move the contained folds one level up */
+ mch_memmove(fp, nfp, (size_t)(sizeof(fold_T) * moved));
+ vim_free(nfp);
+ gap->ga_len += moved - 1;
+ gap->ga_room -= moved - 1;
+ }
+ }
+}
+
+/* deleteFoldRecurse() {{{2 */
+/*
+ * Delete nested folds in a fold.
+ */
+ void
+deleteFoldRecurse(gap)
+ garray_T *gap;
+{
+ int i;
+
+ for (i = 0; i < gap->ga_len; ++i)
+ deleteFoldRecurse(&(((fold_T *)(gap->ga_data))[i].fd_nested));
+ ga_clear(gap);
+}
+
+/* foldMarkAdjust() {{{2 */
+/*
+ * Update line numbers of folds for inserted/deleted lines.
+ */
+ void
+foldMarkAdjust(wp, line1, line2, amount, amount_after)
+ win_T *wp;
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ /* If deleting marks from line1 to line2, but not deleting all those
+ * lines, set line2 so that only deleted lines have their folds removed. */
+ if (amount == MAXLNUM && line2 >= line1 && line2 - line1 >= -amount_after)
+ line2 = line1 - amount_after - 1;
+ /* If appending a line in Insert mode, it should be included in the fold
+ * just above the line. */
+ if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
+ --line1;
+ foldMarkAdjustRecurse(&wp->w_folds, line1, line2, amount, amount_after);
+}
+
+/* foldMarkAdjustRecurse() {{{2 */
+ static void
+foldMarkAdjustRecurse(gap, line1, line2, amount, amount_after)
+ garray_T *gap;
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ fold_T *fp;
+ int i;
+ linenr_T last;
+ linenr_T top;
+
+ /* In Insert mode an inserted line at the top of a fold is considered part
+ * of the fold, otherwise it isn't. */
+ if ((State & INSERT) && amount == (linenr_T)1 && line2 == MAXLNUM)
+ top = line1 + 1;
+ else
+ top = line1;
+
+ /* Find the fold containing or just below "line1". */
+ (void)foldFind(gap, line1, &fp);
+
+ /*
+ * Adjust all folds below "line1" that are affected.
+ */
+ for (i = (int)(fp - (fold_T *)gap->ga_data); i < gap->ga_len; ++i, ++fp)
+ {
+ /*
+ * Check for these situations:
+ * 1 2 3
+ * 1 2 3
+ * line1 2 3 4 5
+ * 2 3 4 5
+ * 2 3 4 5
+ * line2 2 3 4 5
+ * 3 5 6
+ * 3 5 6
+ */
+
+ last = fp->fd_top + fp->fd_len - 1; /* last line of fold */
+
+ /* 1. fold completely above line1: nothing to do */
+ if (last < line1)
+ continue;
+
+ /* 6. fold below line2: only adjust for amount_after */
+ if (fp->fd_top > line2)
+ {
+ if (amount_after == 0)
+ break;
+ fp->fd_top += amount_after;
+ }
+ else
+ {
+ if (fp->fd_top >= top && last <= line2)
+ {
+ /* 4. fold completely contained in range */
+ if (amount == MAXLNUM)
+ {
+ /* Deleting lines: delete the fold completely */
+ deleteFoldEntry(gap, i, TRUE);
+ --i; /* adjust index for deletion */
+ --fp;
+ }
+ else
+ fp->fd_top += amount;
+ }
+ else
+ {
+ /* 2, 3, or 5: need to correct nested folds too */
+ foldMarkAdjustRecurse(&fp->fd_nested, line1 - fp->fd_top,
+ line2 - fp->fd_top, amount, amount_after);
+ if (fp->fd_top < top)
+ {
+ if (last <= line2)
+ {
+ /* 2. fold contains line1, line2 is below fold */
+ if (amount == MAXLNUM)
+ fp->fd_len = line1 - fp->fd_top;
+ else
+ fp->fd_len += amount;
+ }
+ else
+ {
+ /* 3. fold contains line1 and line2 */
+ fp->fd_len += amount_after;
+ }
+ }
+ else
+ {
+ /* 5. fold is below line1 and contains line2 */
+ if (amount == MAXLNUM)
+ {
+ fp->fd_len -= line2 - fp->fd_top + 1;
+ fp->fd_top = line1;
+ }
+ else
+ {
+ fp->fd_len += amount_after - amount;
+ fp->fd_top += amount;
+ }
+ }
+ }
+ }
+ }
+}
+
+/* getDeepestNesting() {{{2 */
+/*
+ * Get the lowest 'foldlevel' value that makes the deepest nested fold in the
+ * current window open.
+ */
+ int
+getDeepestNesting()
+{
+ checkupdate(curwin);
+ return getDeepestNestingRecurse(&curwin->w_folds);
+}
+
+ static int
+getDeepestNestingRecurse(gap)
+ garray_T *gap;
+{
+ int i;
+ int level;
+ int maxlevel = 0;
+ fold_T *fp;
+
+ fp = (fold_T *)gap->ga_data;
+ for (i = 0; i < gap->ga_len; ++i)
+ {
+ level = getDeepestNestingRecurse(&fp[i].fd_nested) + 1;
+ if (level > maxlevel)
+ maxlevel = level;
+ }
+
+ return maxlevel;
+}
+
+/* check_closed() {{{2 */
+/*
+ * Check if a fold is closed and update the info needed to check nested folds.
+ */
+ static int
+check_closed(win, fp, use_levelp, level, maybe_smallp, lnum_off)
+ win_T *win;
+ fold_T *fp;
+ int *use_levelp; /* TRUE: outer fold had FD_LEVEL */
+ int level; /* folding depth */
+ int *maybe_smallp; /* TRUE: outer this had fd_small == MAYBE */
+ linenr_T lnum_off; /* line number offset for fp->fd_top */
+{
+ int closed = FALSE;
+
+ /* Check if this fold is closed. If the flag is FD_LEVEL this
+ * fold and all folds it contains depend on 'foldlevel'. */
+ if (*use_levelp || fp->fd_flags == FD_LEVEL)
+ {
+ *use_levelp = TRUE;
+ if (level >= win->w_p_fdl)
+ closed = TRUE;
+ }
+ else if (fp->fd_flags == FD_CLOSED)
+ closed = TRUE;
+
+ /* Small fold isn't closed anyway. */
+ if (fp->fd_small == MAYBE)
+ *maybe_smallp = TRUE;
+ if (closed)
+ {
+ if (*maybe_smallp)
+ fp->fd_small = MAYBE;
+ checkSmall(win, fp, lnum_off);
+ if (fp->fd_small == TRUE)
+ closed = FALSE;
+ }
+ return closed;
+}
+
+/* checkSmall() {{{2 */
+/*
+ * Update fd_small field of fold "fp".
+ */
+ static void
+checkSmall(wp, fp, lnum_off)
+ win_T *wp;
+ fold_T *fp;
+ linenr_T lnum_off; /* offset for fp->fd_top */
+{
+ int count;
+ int n;
+
+ if (fp->fd_small == MAYBE)
+ {
+ /* Mark any nested folds to maybe-small */
+ setSmallMaybe(&fp->fd_nested);
+
+ if (fp->fd_len > curwin->w_p_fml)
+ fp->fd_small = FALSE;
+ else
+ {
+ count = 0;
+ for (n = 0; n < fp->fd_len; ++n)
+ {
+ count += plines_win_nofold(wp, fp->fd_top + lnum_off + n);
+ if (count > curwin->w_p_fml)
+ {
+ fp->fd_small = FALSE;
+ return;
+ }
+ }
+ fp->fd_small = TRUE;
+ }
+ }
+}
+
+/* setSmallMaybe() {{{2 */
+/*
+ * Set small flags in "gap" to MAYBE.
+ */
+ static void
+setSmallMaybe(gap)
+ garray_T *gap;
+{
+ int i;
+ fold_T *fp;
+
+ fp = (fold_T *)gap->ga_data;
+ for (i = 0; i < gap->ga_len; ++i)
+ fp[i].fd_small = MAYBE;
+}
+
+/* foldCreateMarkers() {{{2 */
+/*
+ * Create a fold from line "start" to line "end" (inclusive) in the current
+ * window by adding markers.
+ */
+ static void
+foldCreateMarkers(start, end)
+ linenr_T start;
+ linenr_T end;
+{
+ if (!curbuf->b_p_ma)
+ {
+ EMSG(_(e_modifiable));
+ return;
+ }
+ parseMarker(curwin);
+
+ foldAddMarker(start, curwin->w_p_fmr, foldstartmarkerlen);
+ foldAddMarker(end, foldendmarker, foldendmarkerlen);
+
+ /* Update both changes here, to avoid all folds after the start are
+ * changed when the start marker is inserted and the end isn't. */
+ changed_lines(start, (colnr_T)0, end, 0L);
+}
+
+/* foldAddMarker() {{{2 */
+/*
+ * Add "marker[markerlen]" in 'commentstring' to line "lnum".
+ */
+ static void
+foldAddMarker(lnum, marker, markerlen)
+ linenr_T lnum;
+ char_u *marker;
+ int markerlen;
+{
+ char_u *cms = curbuf->b_p_cms;
+ char_u *line;
+ int line_len;
+ char_u *newline;
+ char_u *p = (char_u *)strstr((char *)curbuf->b_p_cms, "%s");
+
+ /* Allocate a new line: old-line + 'cms'-start + marker + 'cms'-end */
+ line = ml_get(lnum);
+ line_len = (int)STRLEN(line);
+
+ if (u_save(lnum - 1, lnum + 1) == OK)
+ {
+ newline = alloc((unsigned)(line_len + markerlen + STRLEN(cms) + 1));
+ if (newline == NULL)
+ return;
+ STRCPY(newline, line);
+ if (p == NULL)
+ {
+ STRNCPY(newline + line_len, marker, markerlen);
+ newline[line_len + markerlen] = NUL;
+ }
+ else
+ {
+ STRCPY(newline + line_len, cms);
+ STRNCPY(newline + line_len + (p - cms), marker, markerlen);
+ STRCPY(newline + line_len + (p - cms) + markerlen, p + 2);
+ }
+
+ ml_replace(lnum, newline, FALSE);
+ }
+}
+
+/* deleteFoldMarkers() {{{2 */
+/*
+ * Delete the markers for a fold, causing it to be deleted.
+ */
+ static void
+deleteFoldMarkers(fp, recursive, lnum_off)
+ fold_T *fp;
+ int recursive;
+ linenr_T lnum_off; /* offset for fp->fd_top */
+{
+ int i;
+
+ if (recursive)
+ for (i = 0; i < fp->fd_nested.ga_len; ++i)
+ deleteFoldMarkers((fold_T *)fp->fd_nested.ga_data + i, TRUE,
+ lnum_off + fp->fd_top);
+ foldDelMarker(fp->fd_top + lnum_off, curwin->w_p_fmr, foldstartmarkerlen);
+ foldDelMarker(fp->fd_top + lnum_off + fp->fd_len - 1,
+ foldendmarker, foldendmarkerlen);
+}
+
+/* foldDelMarker() {{{2 */
+/*
+ * Delete marker "marker[markerlen]" at the end of line "lnum".
+ * Delete 'commentstring' if it matches.
+ * If the marker is not found, there is no error message. Could a missing
+ * close-marker.
+ */
+ static void
+foldDelMarker(lnum, marker, markerlen)
+ linenr_T lnum;
+ char_u *marker;
+ int markerlen;
+{
+ char_u *line;
+ char_u *newline;
+ char_u *p;
+ int len;
+ char_u *cms = curbuf->b_p_cms;
+ char_u *cms2;
+
+ line = ml_get(lnum);
+ for (p = line; *p != NUL; ++p)
+ if (STRNCMP(p, marker, markerlen) == 0)
+ {
+ /* Found the marker, include a digit if it's there. */
+ len = markerlen;
+ if (VIM_ISDIGIT(p[len]))
+ ++len;
+ if (*cms != NUL)
+ {
+ /* Also delete 'commentstring' if it matches. */
+ cms2 = (char_u *)strstr((char *)cms, "%s");
+ if (p - line >= cms2 - cms
+ && STRNCMP(p - (cms2 - cms), cms, cms2 - cms) == 0
+ && STRNCMP(p + len, cms2 + 2, STRLEN(cms2 + 2)) == 0)
+ {
+ p -= cms2 - cms;
+ len += (int)STRLEN(cms) - 2;
+ }
+ }
+ if (u_save(lnum - 1, lnum + 1) == OK)
+ {
+ /* Make new line: text-before-marker + text-after-marker */
+ newline = alloc((unsigned)(STRLEN(line) - len + 1));
+ if (newline != NULL)
+ {
+ STRNCPY(newline, line, p - line);
+ STRCPY(newline + (p - line), p + len);
+ ml_replace(lnum, newline, FALSE);
+ }
+ }
+ break;
+ }
+}
+
+/* foldtext_cleanup() {{{2 */
+/*
+ * Remove 'foldmarker' and 'commentstring' from "str" (in-place).
+ */
+ void
+foldtext_cleanup(str)
+ char_u *str;
+{
+ char_u *cms_start; /* first part or the whole comment */
+ int cms_slen = 0; /* length of cms_start */
+ char_u *cms_end; /* last part of the comment or NULL */
+ int cms_elen = 0; /* length of cms_end */
+ char_u *s;
+ int len;
+ int did1 = FALSE;
+ int did2 = FALSE;
+
+ /* Ignore leading and trailing white space in 'commentstring'. */
+ cms_start = skipwhite(curbuf->b_p_cms);
+ cms_slen = STRLEN(cms_start);
+ while (cms_slen > 0 && vim_iswhite(cms_start[cms_slen - 1]))
+ --cms_slen;
+
+ /* locate "%s" in 'commentstring', use the part before and after it. */
+ cms_end = (char_u *)strstr((char *)cms_start, "%s");
+ if (cms_end != NULL)
+ {
+ cms_elen = cms_slen - (cms_end - cms_start);
+ cms_slen = cms_end - cms_start;
+
+ /* exclude white space before "%s" */
+ while (cms_slen > 0 && vim_iswhite(cms_start[cms_slen - 1]))
+ --cms_slen;
+
+ /* skip "%s" and white space after it */
+ s = skipwhite(cms_end + 2);
+ cms_elen -= s - cms_end;
+ cms_end = s;
+ }
+ parseMarker(curwin);
+
+ for (s = str; *s != NUL; )
+ {
+ len = 0;
+ if (STRNCMP(s, curwin->w_p_fmr, foldstartmarkerlen) == 0)
+ {
+ len = foldstartmarkerlen;
+ if (VIM_ISDIGIT(s[len]))
+ ++len;
+ }
+ else if (STRNCMP(s, foldendmarker, foldendmarkerlen) == 0)
+ {
+ len = foldendmarkerlen;
+ if (VIM_ISDIGIT(s[len]))
+ ++len;
+ }
+ else if (cms_end != NULL)
+ {
+ if (!did1 && STRNCMP(s, cms_start, cms_slen) == 0)
+ {
+ len = cms_slen;
+ did1 = TRUE;
+ }
+ else if (!did2 && STRNCMP(s, cms_end, cms_elen) == 0)
+ {
+ len = cms_elen;
+ did2 = TRUE;
+ }
+ }
+ if (len != 0)
+ {
+ while (vim_iswhite(s[len]))
+ ++len;
+ mch_memmove(s, s + len, STRLEN(s + len) + 1);
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+#endif
+ ++s;
+ }
+ }
+}
+
+/* Folding by indent, expr, marker and syntax. {{{1 */
+/* Define "fline_T", passed to get fold level for a line. {{{2 */
+typedef struct
+{
+ win_T *wp; /* window */
+ linenr_T lnum; /* current line number */
+ linenr_T off; /* offset between lnum and real line number */
+ linenr_T lnum_save; /* line nr used by foldUpdateIEMSRecurse() */
+ int lvl; /* current level (-1 for undefined) */
+ int lvl_next; /* level used for next line */
+ int start; /* number of folds that are forced to start at
+ this line. */
+ int end; /* level of fold that is forced to end below
+ this line */
+ int had_end; /* level of fold that is forced to end above
+ this line (copy of "end" of prev. line) */
+} fline_T;
+
+/* Flag is set when redrawing is needed. */
+static int fold_changed;
+
+/* Function declarations. {{{2 */
+static linenr_T foldUpdateIEMSRecurse __ARGS((garray_T *gap, int level, linenr_T startlnum, fline_T *flp, void (*getlevel)__ARGS((fline_T *)), linenr_T bot, int topflags));
+static int foldInsert __ARGS((garray_T *gap, int i));
+static void foldSplit __ARGS((garray_T *gap, int i, linenr_T top, linenr_T bot));
+static void foldRemove __ARGS((garray_T *gap, linenr_T top, linenr_T bot));
+static void foldMerge __ARGS((fold_T *fp1, garray_T *gap, fold_T *fp2));
+static void foldlevelIndent __ARGS((fline_T *flp));
+#ifdef FEAT_DIFF
+static void foldlevelDiff __ARGS((fline_T *flp));
+#endif
+static void foldlevelExpr __ARGS((fline_T *flp));
+static void foldlevelMarker __ARGS((fline_T *flp));
+static void foldlevelSyntax __ARGS((fline_T *flp));
+
+/* foldUpdateIEMS() {{{2 */
+/*
+ * Update the folding for window "wp", at least from lines "top" to "bot".
+ * Return TRUE if any folds did change.
+ */
+ static void
+foldUpdateIEMS(wp, top, bot)
+ win_T *wp;
+ linenr_T top;
+ linenr_T bot;
+{
+ linenr_T start;
+ linenr_T end;
+ fline_T fline;
+ void (*getlevel)__ARGS((fline_T *));
+ int level;
+ fold_T *fp;
+
+ /* Avoid problems when being called recursively. */
+ if (invalid_top != (linenr_T)0)
+ return;
+
+ if (wp->w_foldinvalid)
+ {
+ /* Need to update all folds. */
+ top = 1;
+ bot = wp->w_buffer->b_ml.ml_line_count;
+ wp->w_foldinvalid = FALSE;
+
+ /* Mark all folds a maybe-small. */
+ setSmallMaybe(&wp->w_folds);
+ }
+
+#ifdef FEAT_DIFF
+ /* add the context for "diff" folding */
+ if (foldmethodIsDiff(wp))
+ {
+ if (top > diff_context)
+ top -= diff_context;
+ else
+ top = 1;
+ bot += diff_context;
+ }
+#endif
+
+ /* When deleting lines at the end of the buffer "top" can be past the end
+ * of the buffer. */
+ if (top > wp->w_buffer->b_ml.ml_line_count)
+ top = wp->w_buffer->b_ml.ml_line_count;
+
+ fold_changed = FALSE;
+ fline.wp = wp;
+ fline.off = 0;
+ fline.lvl = 0;
+ fline.lvl_next = -1;
+ fline.start = 0;
+ fline.end = MAX_LEVEL + 1;
+ fline.had_end = MAX_LEVEL + 1;
+
+ invalid_top = top;
+ invalid_bot = bot;
+
+ if (foldmethodIsMarker(wp))
+ {
+ getlevel = foldlevelMarker;
+
+ /* Init marker variables to speed up foldlevelMarker(). */
+ parseMarker(wp);
+
+ /* Need to get the level of the line above top, it is used if there is
+ * no marker at the top. */
+ if (top > 1)
+ {
+ /* Get the fold level at top - 1. */
+ level = foldLevelWin(wp, top - 1);
+
+ /* The fold may end just above the top, check for that. */
+ fline.lnum = top - 1;
+ fline.lvl = level;
+ getlevel(&fline);
+
+ /* If a fold started here, we already had the level, if it stops
+ * here, we need to use lvl_next. Could also start and end a fold
+ * in the same line. */
+ if (fline.lvl > level)
+ fline.lvl = level - (fline.lvl - fline.lvl_next);
+ else
+ fline.lvl = fline.lvl_next;
+ }
+ fline.lnum = top;
+ getlevel(&fline);
+ }
+ else
+ {
+ fline.lnum = top;
+ if (foldmethodIsExpr(wp))
+ {
+ getlevel = foldlevelExpr;
+ /* start one line back, because a "<1" may indicate the end of a
+ * fold in the topline */
+ if (top > 1)
+ --fline.lnum;
+ }
+ else if (foldmethodIsSyntax(wp))
+ getlevel = foldlevelSyntax;
+#ifdef FEAT_DIFF
+ else if (foldmethodIsDiff(wp))
+ getlevel = foldlevelDiff;
+#endif
+ else
+ getlevel = foldlevelIndent;
+
+ /* Backup to a line for which the fold level is defined. Since it's
+ * always defined for line one, we will stop there. */
+ fline.lvl = -1;
+ for ( ; !got_int; --fline.lnum)
+ {
+ /* Reset lvl_next each time, because it will be set to a value for
+ * the next line, but we search backwards here. */
+ fline.lvl_next = -1;
+ getlevel(&fline);
+ if (fline.lvl >= 0)
+ break;
+ }
+ }
+
+ start = fline.lnum;
+ end = bot;
+ /* Do at least one line. */
+ if (start > end && end < wp->w_buffer->b_ml.ml_line_count)
+ end = start;
+ while (!got_int)
+ {
+ /* Always stop at the end of the file ("end" can be past the end of
+ * the file). */
+ if (fline.lnum > wp->w_buffer->b_ml.ml_line_count)
+ break;
+ if (fline.lnum > end)
+ {
+ /* For "marker", "expr" and "syntax" methods: If a change caused
+ * a fold to be removed, we need to continue at least until where
+ * it ended. */
+ if (getlevel != foldlevelMarker
+ && getlevel != foldlevelSyntax
+ && getlevel != foldlevelExpr)
+ break;
+ if ((start <= end
+ && foldFind(&wp->w_folds, end, &fp)
+ && fp->fd_top + fp->fd_len - 1 > end)
+ || (fline.lvl == 0
+ && foldFind(&wp->w_folds, fline.lnum, &fp)
+ && fp->fd_top < fline.lnum))
+ end = fp->fd_top + fp->fd_len - 1;
+ else if (getlevel == foldlevelSyntax
+ && foldLevelWin(wp, fline.lnum) != fline.lvl)
+ /* For "syntax" method: Compare the foldlevel that the syntax
+ * tells us to the foldlevel from the existing folds. If they
+ * don't match continue updating folds. */
+ end = fline.lnum;
+ else
+ break;
+ }
+
+ /* A level 1 fold starts at a line with foldlevel > 0. */
+ if (fline.lvl > 0)
+ {
+ invalid_top = fline.lnum;
+ invalid_bot = end;
+ end = foldUpdateIEMSRecurse(&wp->w_folds,
+ 1, start, &fline, getlevel, end, FD_LEVEL);
+ start = fline.lnum;
+ }
+ else
+ {
+ if (fline.lnum == wp->w_buffer->b_ml.ml_line_count)
+ break;
+ ++fline.lnum;
+ fline.lvl = fline.lvl_next;
+ getlevel(&fline);
+ }
+ }
+
+ /* There can't be any folds from start until end now. */
+ foldRemove(&wp->w_folds, start, end);
+
+ /* If some fold changed, need to redraw and position cursor. */
+ if (fold_changed && wp->w_p_fen)
+ changed_window_setting();
+
+ /* If we updated folds past "bot", need to redraw more lines. Don't do
+ * this in other situations, the changed lines will be redrawn anyway and
+ * this method can cause the whole window to be updated. */
+ if (end != bot)
+ {
+ if (wp->w_redraw_top == 0 || wp->w_redraw_top > top)
+ wp->w_redraw_top = top;
+ if (wp->w_redraw_bot < end)
+ wp->w_redraw_bot = end;
+ }
+
+ invalid_top = (linenr_T)0;
+}
+
+/* foldUpdateIEMSRecurse() {{{2 */
+/*
+ * Update a fold that starts at "flp->lnum". At this line there is always a
+ * valid foldlevel, and its level >= "level".
+ * "flp" is valid for "flp->lnum" when called and it's valid when returning.
+ * "flp->lnum" is set to the lnum just below the fold, if it ends before
+ * "bot", it's "bot" plus one if the fold continues and it's bigger when using
+ * the marker method and a text change made following folds to change.
+ * When returning, "flp->lnum_save" is the line number that was used to get
+ * the level when the level at "flp->lnum" is invalid.
+ * Remove any folds from "startlnum" up to here at this level.
+ * Recursively update nested folds.
+ * Below line "bot" there are no changes in the text.
+ * "flp->lnum", "flp->lnum_save" and "bot" are relative to the start of the
+ * outer fold.
+ * "flp->off" is the offset to the real line number in the buffer.
+ *
+ * All this would be a lot simpler if all folds in the range would be deleted
+ * and then created again. But we would loose all information about the
+ * folds, even when making changes that don't affect the folding (e.g. "vj~").
+ *
+ * Returns bot, which may have been increased for lines that also need to be
+ * updated as a result of a detected change in the fold.
+ */
+ static linenr_T
+foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
+ garray_T *gap;
+ int level;
+ linenr_T startlnum;
+ fline_T *flp;
+ void (*getlevel)__ARGS((fline_T *));
+ linenr_T bot;
+ int topflags; /* flags used by containing fold */
+{
+ linenr_T ll;
+ fold_T *fp = NULL;
+ fold_T *fp2;
+ int lvl = level;
+ linenr_T startlnum2 = startlnum;
+ linenr_T firstlnum = flp->lnum; /* first lnum we got */
+ int i;
+ int finish = FALSE;
+ linenr_T linecount = flp->wp->w_buffer->b_ml.ml_line_count - flp->off;
+ int concat;
+
+ /*
+ * If using the marker method, the start line is not the start of a fold
+ * at the level we're dealing with and the level is non-zero, we must use
+ * the previous fold. But ignore a fold that starts at or below
+ * startlnum, it must be deleted.
+ */
+ if (getlevel == foldlevelMarker && flp->start <= flp->lvl - level
+ && flp->lvl > 0)
+ {
+ foldFind(gap, startlnum - 1, &fp);
+ if (fp >= ((fold_T *)gap->ga_data) + gap->ga_len
+ || fp->fd_top >= startlnum)
+ fp = NULL;
+ }
+
+ /*
+ * Loop over all lines in this fold, or until "bot" is hit.
+ * Handle nested folds inside of this fold.
+ * "flp->lnum" is the current line. When finding the end of the fold, it
+ * is just below the end of the fold.
+ * "*flp" contains the level of the line "flp->lnum" or a following one if
+ * there are lines with an invalid fold level. "flp->lnum_save" is the
+ * line number that was used to get the fold level (below "flp->lnum" when
+ * it has an invalid fold level). When called the fold level is always
+ * valid, thus "flp->lnum_save" is equal to "flp->lnum".
+ */
+ flp->lnum_save = flp->lnum;
+ while (!got_int)
+ {
+ /* Updating folds can be slow, check for CTRL-C. */
+ line_breakcheck();
+
+ /* Set "lvl" to the level of line "flp->lnum". When flp->start is set
+ * and after the first line of the fold, set the level to zero to
+ * force the fold to end. Do the same when had_end is set: Previous
+ * line was marked as end of a fold. */
+ lvl = flp->lvl;
+ if (lvl > MAX_LEVEL)
+ lvl = MAX_LEVEL;
+ if (flp->lnum > firstlnum
+ && (level > lvl - flp->start || level >= flp->had_end))
+ lvl = 0;
+
+ if (flp->lnum > bot && !finish && fp != NULL)
+ {
+ /* For "marker" and "syntax" methods:
+ * - If a change caused a nested fold to be removed, we need to
+ * delete it and continue at least until where it ended.
+ * - If a change caused a nested fold to be created, or this fold
+ * to continue below its original end, need to finish this fold.
+ */
+ if (getlevel != foldlevelMarker
+ && getlevel != foldlevelExpr
+ && getlevel != foldlevelSyntax)
+ break;
+ i = 0;
+ fp2 = fp;
+ if (lvl >= level)
+ {
+ /* Compute how deep the folds currently are, if it's deeper
+ * than "lvl" then some must be deleted, need to update
+ * at least one nested fold. */
+ ll = flp->lnum - fp->fd_top;
+ while (foldFind(&fp2->fd_nested, ll, &fp2))
+ {
+ ++i;
+ ll -= fp2->fd_top;
+ }
+ }
+ if (lvl < level + i)
+ {
+ foldFind(&fp->fd_nested, flp->lnum - fp->fd_top, &fp2);
+ if (fp2 != NULL)
+ bot = fp2->fd_top + fp2->fd_len - 1 + fp->fd_top;
+ }
+ else if (fp->fd_top + fp->fd_len <= flp->lnum && lvl >= level)
+ finish = TRUE;
+ else
+ break;
+ }
+
+ /* At the start of the first nested fold and at the end of the current
+ * fold: check if existing folds at this level, before the current
+ * one, need to be deleted or truncated. */
+ if (fp == NULL
+ && (lvl != level
+ || flp->lnum_save >= bot
+ || flp->start != 0
+ || flp->had_end <= MAX_LEVEL
+ || flp->lnum == linecount))
+ {
+ /*
+ * Remove or update folds that have lines between startlnum and
+ * firstlnum.
+ */
+ while (!got_int)
+ {
+ /* set concat to 1 if it's allowed to concatenated this fold
+ * with a previous one that touches it. */
+ if (flp->start != 0 || flp->had_end <= MAX_LEVEL)
+ concat = 0;
+ else
+ concat = 1;
+
+ /* Find an existing fold to re-use. Preferably one that
+ * includes startlnum, otherwise one that ends just before
+ * startlnum or starts after it. */
+ if (foldFind(gap, startlnum, &fp)
+ || (fp < ((fold_T *)gap->ga_data) + gap->ga_len
+ && fp->fd_top <= firstlnum)
+ || foldFind(gap, firstlnum - concat, &fp)
+ || (fp < ((fold_T *)gap->ga_data) + gap->ga_len
+ && ((lvl < level && fp->fd_top < flp->lnum)
+ || (lvl >= level
+ && fp->fd_top <= flp->lnum_save))))
+ {
+ if (fp->fd_top + fp->fd_len + concat > firstlnum)
+ {
+ /* Use existing fold for the new fold. If it starts
+ * before where we started looking, extend it. If it
+ * starts at another line, update nested folds to keep
+ * their position, compensating for the new fd_top. */
+ if (fp->fd_top >= startlnum && fp->fd_top != firstlnum)
+ {
+ if (fp->fd_top > firstlnum)
+ /* like lines are inserted */
+ foldMarkAdjustRecurse(&fp->fd_nested,
+ (linenr_T)0, (linenr_T)MAXLNUM,
+ (long)(fp->fd_top - firstlnum), 0L);
+ else
+ /* like lines are deleted */
+ foldMarkAdjustRecurse(&fp->fd_nested,
+ (linenr_T)0,
+ (long)(firstlnum - fp->fd_top - 1),
+ (linenr_T)MAXLNUM,
+ (long)(fp->fd_top - firstlnum));
+ fp->fd_len += fp->fd_top - firstlnum;
+ fp->fd_top = firstlnum;
+ fold_changed = TRUE;
+ }
+ else if (flp->start != 0 && lvl == level
+ && fp->fd_top != firstlnum)
+ {
+ /* Existing fold that includes startlnum must stop
+ * if we find the start of a new fold at the same
+ * level. Split it. Delete contained folds at
+ * this point to split them too. */
+ foldRemove(&fp->fd_nested, flp->lnum - fp->fd_top,
+ flp->lnum - fp->fd_top);
+ i = (int)(fp - (fold_T *)gap->ga_data);
+ foldSplit(gap, i, flp->lnum, flp->lnum - 1);
+ fp = (fold_T *)gap->ga_data + i + 1;
+ /* If using the "marker" or "syntax" method, we
+ * need to continue until the end of the fold is
+ * found. */
+ if (getlevel == foldlevelMarker
+ || getlevel == foldlevelExpr
+ || getlevel == foldlevelSyntax)
+ finish = TRUE;
+ }
+ break;
+ }
+ if (fp->fd_top >= startlnum)
+ {
+ /* A fold that starts at or after startlnum and stops
+ * before the new fold must be deleted. Continue
+ * looking for the next one. */
+ deleteFoldEntry(gap,
+ (int)(fp - (fold_T *)gap->ga_data), TRUE);
+ }
+ else
+ {
+ /* A fold has some lines above startlnum, truncate it
+ * to stop just above startlnum. */
+ fp->fd_len = startlnum - fp->fd_top;
+ foldMarkAdjustRecurse(&fp->fd_nested,
+ (linenr_T)fp->fd_len, (linenr_T)MAXLNUM,
+ (linenr_T)MAXLNUM, 0L);
+ fold_changed = TRUE;
+ }
+ }
+ else
+ {
+ /* Insert new fold. Careful: ga_data may be NULL and it
+ * may change! */
+ i = (int)(fp - (fold_T *)gap->ga_data);
+ if (foldInsert(gap, i) != OK)
+ return bot;
+ fp = (fold_T *)gap->ga_data + i;
+ /* The new fold continues until bot, unless we find the
+ * end earlier. */
+ fp->fd_top = firstlnum;
+ fp->fd_len = bot - firstlnum + 1;
+ /* When the containing fold is open, the new fold is open.
+ * The new fold is closed if the fold above it is closed.
+ * The first fold depends on the containing fold. */
+ if (topflags == FD_OPEN)
+ {
+ flp->wp->w_fold_manual = TRUE;
+ fp->fd_flags = FD_OPEN;
+ }
+ else if (i <= 0)
+ {
+ fp->fd_flags = topflags;
+ if (topflags != FD_LEVEL)
+ flp->wp->w_fold_manual = TRUE;
+ }
+ else
+ fp->fd_flags = (fp - 1)->fd_flags;
+ fp->fd_small = MAYBE;
+ /* If using the "marker", "expr" or "syntax" method, we
+ * need to continue until the end of the fold is found. */
+ if (getlevel == foldlevelMarker
+ || getlevel == foldlevelExpr
+ || getlevel == foldlevelSyntax)
+ finish = TRUE;
+ fold_changed = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (lvl < level || flp->lnum > linecount)
+ {
+ /*
+ * Found a line with a lower foldlevel, this fold ends just above
+ * "flp->lnum".
+ */
+ break;
+ }
+
+ /*
+ * The fold includes the line "flp->lnum" and "flp->lnum_save".
+ */
+ if (lvl > level)
+ {
+ /*
+ * There is a nested fold, handle it recursively.
+ */
+ /* At least do one line (can happen when finish is TRUE). */
+ if (bot < flp->lnum)
+ bot = flp->lnum;
+
+ /* Line numbers in the nested fold are relative to the start of
+ * this fold. */
+ flp->lnum = flp->lnum_save - fp->fd_top;
+ flp->off += fp->fd_top;
+ i = (int)(fp - (fold_T *)gap->ga_data);
+ bot = foldUpdateIEMSRecurse(&fp->fd_nested, level + 1,
+ startlnum2 - fp->fd_top, flp, getlevel,
+ bot - fp->fd_top, fp->fd_flags);
+ fp = (fold_T *)gap->ga_data + i;
+ flp->lnum += fp->fd_top;
+ flp->lnum_save += fp->fd_top;
+ flp->off -= fp->fd_top;
+ bot += fp->fd_top;
+ startlnum2 = flp->lnum;
+
+ /* This fold may end at the same line, don't incr. flp->lnum. */
+ }
+ else
+ {
+ /*
+ * Get the level of the next line, then continue the loop to check
+ * if it ends there.
+ * Skip over undefined lines, to find the foldlevel after it.
+ * For the last line in the file the foldlevel is always valid.
+ */
+ flp->lnum = flp->lnum_save;
+ ll = flp->lnum + 1;
+ while (!got_int)
+ {
+ /* Make the previous level available to foldlevel(). */
+ prev_lnum = flp->lnum;
+ prev_lnum_lvl = flp->lvl;
+
+ if (++flp->lnum > linecount)
+ break;
+ flp->lvl = flp->lvl_next;
+ getlevel(flp);
+ if (flp->lvl >= 0 || flp->had_end <= MAX_LEVEL)
+ break;
+ }
+ prev_lnum = 0;
+ if (flp->lnum > linecount)
+ break;
+
+ /* leave flp->lnum_save to lnum of the line that was used to get
+ * the level, flp->lnum to the lnum of the next line. */
+ flp->lnum_save = flp->lnum;
+ flp->lnum = ll;
+ }
+ }
+
+ if (fp == NULL) /* only happens when got_int is set */
+ return bot;
+
+ /*
+ * Get here when:
+ * lvl < level: the folds ends just above "flp->lnum"
+ * lvl >= level: fold continues below "bot"
+ */
+
+ /* Current fold at least extends until lnum. */
+ if (fp->fd_len < flp->lnum - fp->fd_top)
+ {
+ fp->fd_len = flp->lnum - fp->fd_top;
+ fold_changed = TRUE;
+ }
+
+ /* Delete contained folds from the end of the last one found until where
+ * we stopped looking. */
+ foldRemove(&fp->fd_nested, startlnum2 - fp->fd_top,
+ flp->lnum - 1 - fp->fd_top);
+
+ if (lvl < level)
+ {
+ /* End of fold found, update the length when it got shorter. */
+ if (fp->fd_len != flp->lnum - fp->fd_top)
+ {
+ if (fp->fd_top + fp->fd_len > bot + 1)
+ {
+ /* fold coninued below bot */
+ if (getlevel == foldlevelMarker
+ || getlevel == foldlevelExpr
+ || getlevel == foldlevelSyntax)
+ {
+ /* marker method: truncate the fold and make sure the
+ * previously included lines are processed again */
+ bot = fp->fd_top + fp->fd_len - 1;
+ fp->fd_len = flp->lnum - fp->fd_top;
+ }
+ else
+ {
+ /* indent or expr method: split fold to create a new one
+ * below bot */
+ i = (int)(fp - (fold_T *)gap->ga_data);
+ foldSplit(gap, i, flp->lnum, bot);
+ fp = (fold_T *)gap->ga_data + i;
+ }
+ }
+ else
+ fp->fd_len = flp->lnum - fp->fd_top;
+ fold_changed = TRUE;
+ }
+ }
+
+ /* delete following folds that end before the current line */
+ for (;;)
+ {
+ fp2 = fp + 1;
+ if (fp2 >= (fold_T *)gap->ga_data + gap->ga_len
+ || fp2->fd_top > flp->lnum)
+ break;
+ if (fp2->fd_top + fp2->fd_len > flp->lnum)
+ {
+ if (fp2->fd_top < flp->lnum)
+ {
+ /* Make fold that includes lnum start at lnum. */
+ foldMarkAdjustRecurse(&fp2->fd_nested,
+ (linenr_T)0, (long)(flp->lnum - fp2->fd_top - 1),
+ (linenr_T)MAXLNUM, (long)(fp2->fd_top - flp->lnum));
+ fp2->fd_len -= flp->lnum - fp2->fd_top;
+ fp2->fd_top = flp->lnum;
+ fold_changed = TRUE;
+ }
+
+ if (lvl >= level)
+ {
+ /* merge new fold with existing fold that follows */
+ foldMerge(fp, gap, fp2);
+ }
+ break;
+ }
+ fold_changed = TRUE;
+ deleteFoldEntry(gap, (int)(fp2 - (fold_T *)gap->ga_data), TRUE);
+ }
+
+ /* Need to redraw the lines we inspected, which might be further down than
+ * was asked for. */
+ if (bot < flp->lnum - 1)
+ bot = flp->lnum - 1;
+
+ return bot;
+}
+
+/* foldInsert() {{{2 */
+/*
+ * Insert a new fold in "gap" at position "i".
+ * Returns OK for success, FAIL for failure.
+ */
+ static int
+foldInsert(gap, i)
+ garray_T *gap;
+ int i;
+{
+ fold_T *fp;
+
+ if (ga_grow(gap, 1) != OK)
+ return FAIL;
+ fp = (fold_T *)gap->ga_data + i;
+ if (i < gap->ga_len)
+ mch_memmove(fp + 1, fp, sizeof(fold_T) * (gap->ga_len - i));
+ ++gap->ga_len;
+ --gap->ga_room;
+ ga_init2(&fp->fd_nested, (int)sizeof(fold_T), 10);
+ return OK;
+}
+
+/* foldSplit() {{{2 */
+/*
+ * Split the "i"th fold in "gap", which starts before "top" and ends below
+ * "bot" in two pieces, one ending above "top" and the other starting below
+ * "bot".
+ * The caller must first have taken care of any nested folds from "top" to
+ * "bot"!
+ */
+ static void
+foldSplit(gap, i, top, bot)
+ garray_T *gap;
+ int i;
+ linenr_T top;
+ linenr_T bot;
+{
+ fold_T *fp;
+ fold_T *fp2;
+ garray_T *gap1;
+ garray_T *gap2;
+ int idx;
+ int len;
+
+ /* The fold continues below bot, need to split it. */
+ if (foldInsert(gap, i + 1) == FAIL)
+ return;
+ fp = (fold_T *)gap->ga_data + i;
+ fp[1].fd_top = bot + 1;
+ fp[1].fd_len = fp->fd_len - (fp[1].fd_top - fp->fd_top);
+ fp[1].fd_flags = fp->fd_flags;
+
+ /* Move nested folds below bot to new fold. There can't be
+ * any between top and bot, they have been removed by the caller. */
+ gap1 = &fp->fd_nested;
+ gap2 = &fp[1].fd_nested;
+ (void)(foldFind(gap1, bot + 1 - fp->fd_top, &fp2));
+ len = (int)((fold_T *)gap1->ga_data + gap1->ga_len - fp2);
+ if (len > 0 && ga_grow(gap2, len) == OK)
+ {
+ for (idx = 0; idx < len; ++idx)
+ {
+ ((fold_T *)gap2->ga_data)[idx] = fp2[idx];
+ ((fold_T *)gap2->ga_data)[idx].fd_top
+ -= fp[1].fd_top - fp->fd_top;
+ }
+ gap2->ga_len = len;
+ gap2->ga_room -= len;
+ gap1->ga_len -= len;
+ gap1->ga_room += len;
+ }
+ fp->fd_len = top - fp->fd_top;
+ fold_changed = TRUE;
+}
+
+/* foldRemove() {{{2 */
+/*
+ * Remove folds within the range "top" to and including "bot".
+ * Check for these situations:
+ * 1 2 3
+ * 1 2 3
+ * top 2 3 4 5
+ * 2 3 4 5
+ * bot 2 3 4 5
+ * 3 5 6
+ * 3 5 6
+ *
+ * 1: not changed
+ * 2: trunate to stop above "top"
+ * 3: split in two parts, one stops above "top", other starts below "bot".
+ * 4: deleted
+ * 5: made to start below "bot".
+ * 6: not changed
+ */
+ static void
+foldRemove(gap, top, bot)
+ garray_T *gap;
+ linenr_T top;
+ linenr_T bot;
+{
+ fold_T *fp = NULL;
+
+ if (bot < top)
+ return; /* nothing to do */
+
+ for (;;)
+ {
+ /* Find fold that includes top or a following one. */
+ if (foldFind(gap, top, &fp) && fp->fd_top < top)
+ {
+ /* 2: or 3: need to delete nested folds */
+ foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
+ if (fp->fd_top + fp->fd_len > bot + 1)
+ {
+ /* 3: need to split it. */
+ foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);
+ }
+ else
+ {
+ /* 2: truncate fold at "top". */
+ fp->fd_len = top - fp->fd_top;
+ }
+ fold_changed = TRUE;
+ continue;
+ }
+ if (fp >= (fold_T *)(gap->ga_data) + gap->ga_len
+ || fp->fd_top > bot)
+ {
+ /* 6: Found a fold below bot, can stop looking. */
+ break;
+ }
+ if (fp->fd_top >= top)
+ {
+ /* Found an entry below top. */
+ fold_changed = TRUE;
+ if (fp->fd_top + fp->fd_len > bot)
+ {
+ /* 5: Make fold that includes bot start below bot. */
+ foldMarkAdjustRecurse(&fp->fd_nested,
+ (linenr_T)0, (long)(bot - fp->fd_top),
+ (linenr_T)MAXLNUM, (long)(fp->fd_top - bot - 1));
+ fp->fd_len -= bot - fp->fd_top + 1;
+ fp->fd_top = bot + 1;
+ break;
+ }
+
+ /* 4: Delete completely contained fold. */
+ deleteFoldEntry(gap, (int)(fp - (fold_T *)gap->ga_data), TRUE);
+ }
+ }
+}
+
+/* foldMerge() {{{2 */
+/*
+ * Merge two adjecent folds (and the nested ones in them).
+ * This only works correctly when the folds are really adjecent! Thus "fp1"
+ * must end just above "fp2".
+ * The resulting fold is "fp1", nested folds are moved from "fp2" to "fp1".
+ * Fold entry "fp2" in "gap" is deleted.
+ */
+ static void
+foldMerge(fp1, gap, fp2)
+ fold_T *fp1;
+ garray_T *gap;
+ fold_T *fp2;
+{
+ fold_T *fp3;
+ fold_T *fp4;
+ int idx;
+ garray_T *gap1 = &fp1->fd_nested;
+ garray_T *gap2 = &fp2->fd_nested;
+
+ /* If the last nested fold in fp1 touches the first nested fold in fp2,
+ * merge them recursively. */
+ if (foldFind(gap1, fp1->fd_len - 1L, &fp3) && foldFind(gap2, 0L, &fp4))
+ foldMerge(fp3, gap2, fp4);
+
+ /* Move nested folds in fp2 to the end of fp1. */
+ if (gap2->ga_len > 0 && ga_grow(gap1, gap2->ga_len) == OK)
+ {
+ for (idx = 0; idx < gap2->ga_len; ++idx)
+ {
+ ((fold_T *)gap1->ga_data)[gap1->ga_len]
+ = ((fold_T *)gap2->ga_data)[idx];
+ ((fold_T *)gap1->ga_data)[gap1->ga_len].fd_top += fp1->fd_len;
+ ++gap1->ga_len;
+ --gap1->ga_room;
+ }
+ gap2->ga_len = 0;
+ /* fp2->fd_nested.ga_room isn't updated, we delete it below */
+ }
+
+ fp1->fd_len += fp2->fd_len;
+ deleteFoldEntry(gap, (int)(fp2 - (fold_T *)gap->ga_data), TRUE);
+ fold_changed = TRUE;
+}
+
+/* foldlevelIndent() {{{2 */
+/*
+ * Low level function to get the foldlevel for the "indent" method.
+ * Doesn't use any caching.
+ * Returns a level of -1 if the foldlevel depends on surrounding lines.
+ */
+ static void
+foldlevelIndent(flp)
+ fline_T *flp;
+{
+ char_u *s;
+ buf_T *buf;
+ linenr_T lnum = flp->lnum + flp->off;
+
+ buf = flp->wp->w_buffer;
+ s = skipwhite(ml_get_buf(buf, lnum, FALSE));
+
+ /* empty line or lines starting with a character in 'foldignore': level
+ * depends on surrounding lines */
+ if (*s == NUL || vim_strchr(flp->wp->w_p_fdi, *s) != NULL)
+ {
+ /* first and last line can't be undefined, use level 0 */
+ if (lnum == 1 || lnum == buf->b_ml.ml_line_count)
+ flp->lvl = 0;
+ else
+ flp->lvl = -1;
+ }
+ else
+ flp->lvl = get_indent_buf(buf, lnum) / buf->b_p_sw;
+ if (flp->lvl > flp->wp->w_p_fdn)
+ flp->lvl = flp->wp->w_p_fdn;
+}
+
+/* foldlevelDiff() {{{2 */
+#ifdef FEAT_DIFF
+/*
+ * Low level function to get the foldlevel for the "diff" method.
+ * Doesn't use any caching.
+ */
+ static void
+foldlevelDiff(flp)
+ fline_T *flp;
+{
+ if (diff_infold(flp->wp, flp->lnum + flp->off))
+ flp->lvl = 1;
+ else
+ flp->lvl = 0;
+}
+#endif
+
+/* foldlevelExpr() {{{2 */
+/*
+ * Low level function to get the foldlevel for the "expr" method.
+ * Doesn't use any caching.
+ * Returns a level of -1 if the foldlevel depends on surrounding lines.
+ */
+ static void
+foldlevelExpr(flp)
+ fline_T *flp;
+{
+#ifndef FEAT_EVAL
+ flp->start = FALSE;
+ flp->lvl = 0;
+#else
+ win_T *win;
+ int n;
+ int c;
+ linenr_T lnum = flp->lnum + flp->off;
+ int save_keytyped;
+
+ win = curwin;
+ curwin = flp->wp;
+ curbuf = flp->wp->w_buffer;
+ set_vim_var_nr(VV_LNUM, lnum);
+
+ flp->start = 0;
+ flp->had_end = flp->end;
+ flp->end = MAX_LEVEL + 1;
+ if (lnum <= 1)
+ flp->lvl = 0;
+
+ /* KeyTyped may be reset to 0 when calling a function which invokes
+ * do_cmdline(). To make 'foldopen' work correctly restore KeyTyped. */
+ save_keytyped = KeyTyped;
+ n = eval_foldexpr(flp->wp->w_p_fde, &c);
+ KeyTyped = save_keytyped;
+
+ switch (c)
+ {
+ /* "a1", "a2", .. : add to the fold level */
+ case 'a': if (flp->lvl >= 0)
+ {
+ flp->lvl += n;
+ flp->lvl_next = flp->lvl;
+ }
+ flp->start = n;
+ break;
+
+ /* "s1", "s2", .. : subtract from the fold level */
+ case 's': if (flp->lvl >= 0)
+ {
+ if (n > flp->lvl)
+ flp->lvl_next = 0;
+ else
+ flp->lvl_next = flp->lvl - n;
+ flp->end = flp->lvl_next + 1;
+ }
+ break;
+
+ /* ">1", ">2", .. : start a fold with a certain level */
+ case '>': flp->lvl = n;
+ flp->lvl_next = n;
+ flp->start = 1;
+ break;
+
+ /* "<1", "<2", .. : end a fold with a certain level */
+ case '<': flp->lvl_next = n - 1;
+ flp->end = n;
+ break;
+
+ /* "=": No change in level */
+ case '=': flp->lvl_next = flp->lvl;
+ break;
+
+ /* "-1", "0", "1", ..: set fold level */
+ default: if (n < 0)
+ /* Use the current level for the next line, so that "a1"
+ * will work there. */
+ flp->lvl_next = flp->lvl;
+ else
+ flp->lvl_next = n;
+ flp->lvl = n;
+ break;
+ }
+
+ /* If the level is unknown for the first or the last line in the file, use
+ * level 0. */
+ if (flp->lvl < 0)
+ {
+ if (lnum <= 1)
+ {
+ flp->lvl = 0;
+ flp->lvl_next = 0;
+ }
+ if (lnum == curbuf->b_ml.ml_line_count)
+ flp->lvl_next = 0;
+ }
+
+ curwin = win;
+ curbuf = curwin->w_buffer;
+#endif
+}
+
+/* parseMarker() {{{2 */
+/*
+ * Parse 'foldmarker' and set "foldendmarker", "foldstartmarkerlen" and
+ * "foldendmarkerlen".
+ * Relies on the option value to have been checked for correctness already.
+ */
+ static void
+parseMarker(wp)
+ win_T *wp;
+{
+ foldendmarker = vim_strchr(wp->w_p_fmr, ',');
+ foldstartmarkerlen = (int)(foldendmarker++ - wp->w_p_fmr);
+ foldendmarkerlen = (int)STRLEN(foldendmarker);
+}
+
+/* foldlevelMarker() {{{2 */
+/*
+ * Low level function to get the foldlevel for the "marker" method.
+ * "foldendmarker", "foldstartmarkerlen" and "foldendmarkerlen" must have been
+ * set before calling this.
+ * Requires that flp->lvl is set to the fold level of the previous line!
+ * Careful: This means you can't call this function twice on the same line.
+ * Doesn't use any caching.
+ * Sets flp->start when a start marker was found.
+ */
+ static void
+foldlevelMarker(flp)
+ fline_T *flp;
+{
+ char_u *startmarker;
+ int cstart;
+ int cend;
+ int start_lvl = flp->lvl;
+ char_u *s;
+ int n;
+
+ /* cache a few values for speed */
+ startmarker = flp->wp->w_p_fmr;
+ cstart = *startmarker;
+ ++startmarker;
+ cend = *foldendmarker;
+
+ /* Default: no start found, next level is same as current level */
+ flp->start = 0;
+ flp->lvl_next = flp->lvl;
+
+ s = ml_get_buf(flp->wp->w_buffer, flp->lnum + flp->off, FALSE);
+ while (*s)
+ {
+ if (*s == cstart
+ && STRNCMP(s + 1, startmarker, foldstartmarkerlen - 1) == 0)
+ {
+ /* found startmarker: set flp->lvl */
+ s += foldstartmarkerlen;
+ if (VIM_ISDIGIT(*s))
+ {
+ n = atoi((char *)s);
+ if (n > 0)
+ {
+ flp->lvl = n;
+ flp->lvl_next = n;
+ if (n <= start_lvl)
+ flp->start = 1;
+ else
+ flp->start = n - start_lvl;
+ }
+ }
+ else
+ {
+ ++flp->lvl;
+ ++flp->lvl_next;
+ ++flp->start;
+ }
+ }
+ else if (*s == cend
+ && STRNCMP(s + 1, foldendmarker + 1, foldendmarkerlen - 1) == 0)
+ {
+ /* found endmarker: set flp->lvl_next */
+ s += foldendmarkerlen;
+ if (VIM_ISDIGIT(*s))
+ {
+ n = atoi((char *)s);
+ if (n > 0)
+ {
+ flp->lvl = n;
+ flp->lvl_next = n - 1;
+ /* never start a fold with an end marker */
+ if (flp->lvl_next > flp->lvl)
+ flp->lvl_next = flp->lvl;
+ }
+ }
+ else
+ --flp->lvl_next;
+ }
+ else
+ ++s;
+ }
+
+ /* The level can't go negative, must be missing a start marker. */
+ if (flp->lvl_next < 0)
+ flp->lvl_next = 0;
+}
+
+/* foldlevelSyntax() {{{2 */
+/*
+ * Low level function to get the foldlevel for the "syntax" method.
+ * Doesn't use any caching.
+ */
+ static void
+foldlevelSyntax(flp)
+ fline_T *flp;
+{
+#ifndef FEAT_SYN_HL
+ flp->start = 0;
+ flp->lvl = 0;
+#else
+ linenr_T lnum = flp->lnum + flp->off;
+ int n;
+
+ /* Use the maximum fold level at the start of this line and the next. */
+ flp->lvl = syn_get_foldlevel(flp->wp, lnum);
+ flp->start = 0;
+ if (lnum < flp->wp->w_buffer->b_ml.ml_line_count)
+ {
+ n = syn_get_foldlevel(flp->wp, lnum + 1);
+ if (n > flp->lvl)
+ {
+ flp->start = n - flp->lvl; /* fold(s) start here */
+ flp->lvl = n;
+ }
+ }
+#endif
+}
+
+/* functions for storing the fold state in a View {{{1 */
+/* put_folds() {{{2 */
+#if defined(FEAT_SESSION) || defined(PROTO)
+static int put_folds_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
+static int put_foldopen_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
+
+/*
+ * Write commands to "fd" to restore the manual folds in window "wp".
+ * Return FAIL if writing fails.
+ */
+ int
+put_folds(fd, wp)
+ FILE *fd;
+ win_T *wp;
+{
+ if (foldmethodIsManual(wp))
+ {
+ if (put_line(fd, "silent! normal! zE") == FAIL
+ || put_folds_recurse(fd, &wp->w_folds, (linenr_T)0) == FAIL)
+ return FAIL;
+ }
+
+ /* If some folds are manually opened/closed, need to restore that. */
+ if (wp->w_fold_manual)
+ return put_foldopen_recurse(fd, &wp->w_folds, (linenr_T)0);
+
+ return OK;
+}
+
+/* put_folds_recurse() {{{2 */
+/*
+ * Write commands to "fd" to recreate manually created folds.
+ * Returns FAIL when writing failed.
+ */
+ static int
+put_folds_recurse(fd, gap, off)
+ FILE *fd;
+ garray_T *gap;
+ linenr_T off;
+{
+ int i;
+ fold_T *fp;
+
+ fp = (fold_T *)gap->ga_data;
+ for (i = 0; i < gap->ga_len; i++)
+ {
+ /* Do nested folds first, they will be created closed. */
+ if (put_folds_recurse(fd, &fp->fd_nested, off + fp->fd_top) == FAIL)
+ return FAIL;
+ if (fprintf(fd, "%ld,%ldfold", fp->fd_top + off,
+ fp->fd_top + off + fp->fd_len - 1) < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ ++fp;
+ }
+ return OK;
+}
+
+/* put_foldopen_recurse() {{{2 */
+/*
+ * Write commands to "fd" to open and close manually opened/closed folds.
+ * Returns FAIL when writing failed.
+ */
+ static int
+put_foldopen_recurse(fd, gap, off)
+ FILE *fd;
+ garray_T *gap;
+ linenr_T off;
+{
+ int i;
+ fold_T *fp;
+
+ fp = (fold_T *)gap->ga_data;
+ for (i = 0; i < gap->ga_len; i++)
+ {
+ if (fp->fd_flags != FD_LEVEL)
+ {
+ if (fp->fd_nested.ga_len > 0)
+ {
+ /* open/close nested folds while this fold is open */
+ if (fprintf(fd, "%ld", fp->fd_top + off) < 0
+ || put_eol(fd) == FAIL
+ || put_line(fd, "normal zo") == FAIL)
+ return FAIL;
+ if (put_foldopen_recurse(fd, &fp->fd_nested, off + fp->fd_top)
+ == FAIL)
+ return FAIL;
+ }
+ if (fprintf(fd, "%ld", fp->fd_top + off) < 0
+ || put_eol(fd) == FAIL
+ || fprintf(fd, "normal z%c",
+ fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
+ || put_eol(fd) == FAIL)
+ return FAIL;
+ }
+ ++fp;
+ }
+
+ return OK;
+}
+#endif /* FEAT_SESSION */
+
+/* }}}1 */
+#endif /* defined(FEAT_FOLDING) || defined(PROTO) */
diff --git a/src/getchar.c b/src/getchar.c
new file mode 100644
index 000000000..3a8438357
--- /dev/null
+++ b/src/getchar.c
@@ -0,0 +1,4636 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * getchar.c
+ *
+ * functions related with getting a character from the user/mapping/redo/...
+ *
+ * manipulations with redo buffer and stuff buffer
+ * mappings and abbreviations
+ */
+
+#include "vim.h"
+
+/*
+ * These buffers are used for storing:
+ * - stuffed characters: A command that is translated into another command.
+ * - redo characters: will redo the last change.
+ * - recorded chracters: for the "q" command.
+ *
+ * The bytes are stored like in the typeahead buffer:
+ * - K_SPECIAL introduces a special key (two more bytes follow). A literal
+ * K_SPECIAL is stored as K_SPECIAL KS_SPECIAL KE_FILLER.
+ * - CSI introduces a GUI termcap code (also when gui.in_use is FALSE,
+ * otherwise switching the GUI on would make mappings invalid).
+ * A literal CSI is stored as CSI KS_EXTRA KE_CSI.
+ * These translations are also done on multi-byte characters!
+ *
+ * Escaping CSI bytes is done by the system-specific input functions, called
+ * by ui_inchar().
+ * Escaping K_SPECIAL is done by inchar().
+ * Un-escaping is done by vgetc().
+ */
+
+#define MINIMAL_SIZE 20 /* minimal size for b_str */
+
+static struct buffheader redobuff = {{NULL, {NUL}}, NULL, 0, 0};
+static struct buffheader old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
+#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
+static struct buffheader save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
+static struct buffheader save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
+#endif
+static struct buffheader recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
+
+static int typeahead_char = 0; /* typeahead char that's not flushed */
+
+/*
+ * when block_redo is TRUE redo buffer will not be changed
+ * used by edit() to repeat insertions and 'V' command for redoing
+ */
+static int block_redo = FALSE;
+
+/*
+ * Make a hash value for a mapping.
+ * "mode" is the lower 4 bits of the State for the mapping.
+ * "c1" is the first character of the "lhs".
+ * Returns a value between 0 and 255, index in maphash.
+ * Put Normal/Visual mode mappings mostly separately from Insert/Cmdline mode.
+ */
+#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + OP_PENDING)) ? (c1) : ((c1) ^ 0x80))
+
+/*
+ * Each mapping is put in one of the 256 hash lists, to speed up finding it.
+ */
+static mapblock_T *(maphash[256]);
+static int maphash_valid = FALSE;
+
+/*
+ * List used for abbreviations.
+ */
+static mapblock_T *first_abbr = NULL; /* first entry in abbrlist */
+
+static int KeyNoremap = FALSE; /* remapping disabled */
+
+/*
+ * variables used by vgetorpeek() and flush_buffers()
+ *
+ * typebuf.tb_buf[] contains all characters that are not consumed yet.
+ * typebuf.tb_buf[typebuf.tb_off] is the first valid character.
+ * typebuf.tb_buf[typebuf.tb_off + typebuf.tb_len - 1] is the last valid char.
+ * typebuf.tb_buf[typebuf.tb_off + typebuf.tb_len] must be NUL.
+ * The head of the buffer may contain the result of mappings, abbreviations
+ * and @a commands. The length of this part is typebuf.tb_maplen.
+ * typebuf.tb_silent is the part where <silent> applies.
+ * After the head are characters that come from the terminal.
+ * typebuf.tb_no_abbr_cnt is the number of characters in typebuf.tb_buf that
+ * should not be considered for abbreviations.
+ * Some parts of typebuf.tb_buf may not be mapped. These parts are remembered
+ * in typebuf.tb_noremap[], which is the same length as typebuf.tb_buf and
+ * contains RM_NONE for the characters that are not to be remapped.
+ * typebuf.tb_noremap[typebuf.tb_off] is the first valid flag.
+ * (typebuf has been put in globals.h, because check_termcode() needs it).
+ */
+#define RM_YES 0 /* tb_noremap: remap */
+#define RM_NONE 1 /* tb_noremap: don't remap */
+#define RM_SCRIPT 2 /* tb_noremap: remap local script mappings */
+
+/* typebuf.tb_buf has three parts: room in front (for result of mappings), the
+ * middle for typeahead and room for new characters (which needs to be 3 *
+ * MAXMAPLEN) for the Amiga).
+ */
+#define TYPELEN_INIT (5 * (MAXMAPLEN + 3))
+static char_u typebuf_init[TYPELEN_INIT]; /* initial typebuf.tb_buf */
+static char_u noremapbuf_init[TYPELEN_INIT]; /* initial typebuf.tb_noremap */
+
+static int last_recorded_len = 0; /* number of last recorded chars */
+
+static char_u *get_buffcont __ARGS((struct buffheader *, int));
+static void add_buff __ARGS((struct buffheader *, char_u *, long n));
+static void add_num_buff __ARGS((struct buffheader *, long));
+static void add_char_buff __ARGS((struct buffheader *, int));
+static int read_stuff __ARGS((int advance));
+static void start_stuff __ARGS((void));
+static int read_redo __ARGS((int, int));
+static void copy_redo __ARGS((int));
+static void init_typebuf __ARGS((void));
+static void gotchars __ARGS((char_u *, int));
+static void may_sync_undo __ARGS((void));
+static void closescript __ARGS((void));
+static int vgetorpeek __ARGS((int));
+static void map_free __ARGS((mapblock_T **));
+static void validate_maphash __ARGS((void));
+static void showmap __ARGS((mapblock_T *mp, int local));
+
+/*
+ * Free and clear a buffer.
+ */
+ void
+free_buff(buf)
+ struct buffheader *buf;
+{
+ struct buffblock *p, *np;
+
+ for (p = buf->bh_first.b_next; p != NULL; p = np)
+ {
+ np = p->b_next;
+ vim_free(p);
+ }
+ buf->bh_first.b_next = NULL;
+}
+
+/*
+ * Return the contents of a buffer as a single string.
+ * K_SPECIAL and CSI in the returned string are escaped.
+ */
+ static char_u *
+get_buffcont(buffer, dozero)
+ struct buffheader *buffer;
+ int dozero; /* count == zero is not an error */
+{
+ long_u count = 0;
+ char_u *p = NULL;
+ char_u *p2;
+ char_u *str;
+ struct buffblock *bp;
+
+ /* compute the total length of the string */
+ for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
+ count += (long_u)STRLEN(bp->b_str);
+
+ if ((count || dozero) && (p = lalloc(count + 1, TRUE)) != NULL)
+ {
+ p2 = p;
+ for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
+ for (str = bp->b_str; *str; )
+ *p2++ = *str++;
+ *p2 = NUL;
+ }
+ return (p);
+}
+
+/*
+ * Return the contents of the record buffer as a single string
+ * and clear the record buffer.
+ * K_SPECIAL and CSI in the returned string are escaped.
+ */
+ char_u *
+get_recorded()
+{
+ char_u *p;
+ size_t len;
+
+ p = get_buffcont(&recordbuff, TRUE);
+ free_buff(&recordbuff);
+
+ /*
+ * Remove the characters that were added the last time, these must be the
+ * (possibly mapped) characters that stopped the recording.
+ */
+ len = STRLEN(p);
+ if ((int)len >= last_recorded_len)
+ {
+ len -= last_recorded_len;
+ p[len] = NUL;
+ }
+
+ /*
+ * When stopping recording from Insert mode with CTRL-O q, also remove the
+ * CTRL-O.
+ */
+ if (len > 0 && restart_edit != 0 && p[len - 1] == Ctrl_O)
+ p[len - 1] = NUL;
+
+ return (p);
+}
+
+/*
+ * Return the contents of the redo buffer as a single string.
+ * K_SPECIAL and CSI in the returned string are escaped.
+ */
+ char_u *
+get_inserted()
+{
+ return(get_buffcont(&redobuff, FALSE));
+}
+
+/*
+ * add string "s" after the current block of buffer "buf"
+ * K_SPECIAL and CSI should have been escaped already.
+ */
+ static void
+add_buff(buf, s, slen)
+ struct buffheader *buf;
+ char_u *s;
+ long slen; /* length of "s" or -1 */
+{
+ struct buffblock *p;
+ long_u len;
+
+ if (slen < 0)
+ slen = (long)STRLEN(s);
+ if (slen == 0) /* don't add empty strings */
+ return;
+
+ if (buf->bh_first.b_next == NULL) /* first add to list */
+ {
+ buf->bh_space = 0;
+ buf->bh_curr = &(buf->bh_first);
+ }
+ else if (buf->bh_curr == NULL) /* buffer has already been read */
+ {
+ EMSG(_("E222: Add to read buffer"));
+ return;
+ }
+ else if (buf->bh_index != 0)
+ STRCPY(buf->bh_first.b_next->b_str,
+ buf->bh_first.b_next->b_str + buf->bh_index);
+ buf->bh_index = 0;
+
+ if (buf->bh_space >= (int)slen)
+ {
+ len = (long_u)STRLEN(buf->bh_curr->b_str);
+ STRNCPY(buf->bh_curr->b_str + len, s, slen);
+ buf->bh_curr->b_str[len + slen] = NUL;
+ buf->bh_space -= slen;
+ }
+ else
+ {
+ if (slen < MINIMAL_SIZE)
+ len = MINIMAL_SIZE;
+ else
+ len = slen;
+ p = (struct buffblock *)lalloc((long_u)(sizeof(struct buffblock) + len),
+ TRUE);
+ if (p == NULL)
+ return; /* no space, just forget it */
+ buf->bh_space = len - slen;
+ STRNCPY(p->b_str, s, slen);
+ p->b_str[slen] = NUL;
+
+ p->b_next = buf->bh_curr->b_next;
+ buf->bh_curr->b_next = p;
+ buf->bh_curr = p;
+ }
+ return;
+}
+
+/*
+ * Add number "n" to buffer "buf".
+ */
+ static void
+add_num_buff(buf, n)
+ struct buffheader *buf;
+ long n;
+{
+ char_u number[32];
+
+ sprintf((char *)number, "%ld", n);
+ add_buff(buf, number, -1L);
+}
+
+/*
+ * Add character 'c' to buffer "buf".
+ * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
+ */
+ static void
+add_char_buff(buf, c)
+ struct buffheader *buf;
+ int c;
+{
+#ifdef FEAT_MBYTE
+ char_u bytes[MB_MAXBYTES + 1];
+ int len;
+ int i;
+#endif
+ char_u temp[4];
+
+#ifdef FEAT_MBYTE
+ if (IS_SPECIAL(c))
+ len = 1;
+ else
+ len = (*mb_char2bytes)(c, bytes);
+ for (i = 0; i < len; ++i)
+ {
+ if (!IS_SPECIAL(c))
+ c = bytes[i];
+#endif
+
+ if (IS_SPECIAL(c) || c == K_SPECIAL || c == NUL)
+ {
+ /* translate special key code into three byte sequence */
+ temp[0] = K_SPECIAL;
+ temp[1] = K_SECOND(c);
+ temp[2] = K_THIRD(c);
+ temp[3] = NUL;
+ }
+#ifdef FEAT_GUI
+ else if (c == CSI)
+ {
+ /* Translate a CSI to a CSI - KS_EXTRA - KE_CSI sequence */
+ temp[0] = CSI;
+ temp[1] = KS_EXTRA;
+ temp[2] = (int)KE_CSI;
+ temp[3] = NUL;
+ }
+#endif
+ else
+ {
+ temp[0] = c;
+ temp[1] = NUL;
+ }
+ add_buff(buf, temp, -1L);
+#ifdef FEAT_MBYTE
+ }
+#endif
+}
+
+/*
+ * Get one byte from the stuff buffer.
+ * If advance == TRUE go to the next char.
+ * No translation is done K_SPECIAL and CSI are escaped.
+ */
+ static int
+read_stuff(advance)
+ int advance;
+{
+ char_u c;
+ struct buffblock *curr;
+
+ if (stuffbuff.bh_first.b_next == NULL) /* buffer is empty */
+ return NUL;
+
+ curr = stuffbuff.bh_first.b_next;
+ c = curr->b_str[stuffbuff.bh_index];
+
+ if (advance)
+ {
+ if (curr->b_str[++stuffbuff.bh_index] == NUL)
+ {
+ stuffbuff.bh_first.b_next = curr->b_next;
+ vim_free(curr);
+ stuffbuff.bh_index = 0;
+ }
+ }
+ return c;
+}
+
+/*
+ * Prepare the stuff buffer for reading (if it contains something).
+ */
+ static void
+start_stuff()
+{
+ if (stuffbuff.bh_first.b_next != NULL)
+ {
+ stuffbuff.bh_curr = &(stuffbuff.bh_first);
+ stuffbuff.bh_space = 0;
+ }
+}
+
+/*
+ * Return TRUE if the stuff buffer is empty.
+ */
+ int
+stuff_empty()
+{
+ return (stuffbuff.bh_first.b_next == NULL);
+}
+
+/*
+ * Set a typeahead character that won't be flushed.
+ */
+ void
+typeahead_noflush(c)
+ int c;
+{
+ typeahead_char = c;
+}
+
+/*
+ * Remove the contents of the stuff buffer and the mapped characters in the
+ * typeahead buffer (used in case of an error). If 'typeahead' is true,
+ * flush all typeahead characters (used when interrupted by a CTRL-C).
+ */
+ void
+flush_buffers(typeahead)
+ int typeahead;
+{
+ init_typebuf();
+
+ start_stuff();
+ while (read_stuff(TRUE) != NUL)
+ ;
+
+ if (typeahead) /* remove all typeahead */
+ {
+ /*
+ * We have to get all characters, because we may delete the first part
+ * of an escape sequence.
+ * In an xterm we get one char at a time and we have to get them all.
+ */
+ while (inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 10L,
+ typebuf.tb_change_cnt) != 0)
+ ;
+ typebuf.tb_off = MAXMAPLEN;
+ typebuf.tb_len = 0;
+ }
+ else /* remove mapped characters only */
+ {
+ typebuf.tb_off += typebuf.tb_maplen;
+ typebuf.tb_len -= typebuf.tb_maplen;
+ }
+ typebuf.tb_maplen = 0;
+ typebuf.tb_silent = 0;
+ cmd_silent = FALSE;
+ typebuf.tb_no_abbr_cnt = 0;
+}
+
+/*
+ * The previous contents of the redo buffer is kept in old_redobuffer.
+ * This is used for the CTRL-O <.> command in insert mode.
+ */
+ void
+ResetRedobuff()
+{
+ if (!block_redo)
+ {
+ free_buff(&old_redobuff);
+ old_redobuff = redobuff;
+ redobuff.bh_first.b_next = NULL;
+ }
+}
+
+#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
+ * Used before executing autocommands and user functions.
+ */
+static int save_level = 0;
+
+ void
+saveRedobuff()
+{
+ char_u *s;
+
+ if (save_level++ == 0)
+ {
+ save_redobuff = redobuff;
+ redobuff.bh_first.b_next = NULL;
+ save_old_redobuff = old_redobuff;
+ old_redobuff.bh_first.b_next = NULL;
+
+ /* Make a copy, so that ":normal ." in a function works. */
+ s = get_buffcont(&save_redobuff, FALSE);
+ if (s != NULL)
+ {
+ add_buff(&redobuff, s, -1L);
+ vim_free(s);
+ }
+ }
+}
+
+/*
+ * Restore redobuff and old_redobuff from save_redobuff and save_old_redobuff.
+ * Used after executing autocommands and user functions.
+ */
+ void
+restoreRedobuff()
+{
+ if (--save_level == 0)
+ {
+ free_buff(&redobuff);
+ redobuff = save_redobuff;
+ free_buff(&old_redobuff);
+ old_redobuff = save_old_redobuff;
+ }
+}
+#endif
+
+/*
+ * Append "s" to the redo buffer.
+ * K_SPECIAL and CSI should already have been escaped.
+ */
+ void
+AppendToRedobuff(s)
+ char_u *s;
+{
+ if (!block_redo)
+ add_buff(&redobuff, s, -1L);
+}
+
+/*
+ * Append to Redo buffer literally, escaping special characters with CTRL-V.
+ * K_SPECIAL and CSI are escaped as well.
+ */
+ void
+AppendToRedobuffLit(s)
+ char_u *s;
+{
+ int c;
+ char_u *start;
+
+ if (block_redo)
+ return;
+
+ while (*s != NUL)
+ {
+ /* Put a string of normal characters in the redo buffer (that's
+ * faster). */
+ start = s;
+ while (*s >= ' '
+#ifndef EBCDIC
+ && *s < DEL /* EBCDIC: all chars above space are normal */
+#endif
+ )
+ ++s;
+
+ /* Don't put '0' or '^' as last character, just in case a CTRL-D is
+ * typed next. */
+ if (*s == NUL && (s[-1] == '0' || s[-1] == '^'))
+ --s;
+ if (s > start)
+ add_buff(&redobuff, start, (long)(s - start));
+
+ if (*s != NUL)
+ {
+ /* Handle a special or multibyte character. */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ c = (*mb_ptr2char)(s);
+ if (enc_utf8)
+ /* Handle composing chars as well. */
+ s += utf_ptr2len_check(s);
+ else
+ s += (*mb_ptr2len_check)(s);
+ }
+ else
+#endif
+ c = *s++;
+ if (c < ' ' || c == DEL || (*s == NUL && (c == '0' || c == '^')))
+ add_char_buff(&redobuff, Ctrl_V);
+
+ /* CTRL-V '0' must be inserted as CTRL-V 048 (EBCDIC: xf0) */
+ if (*s == NUL && c == '0')
+#ifdef EBCDIC
+ add_buff(&redobuff, (char_u *)"xf0", 3L);
+#else
+ add_buff(&redobuff, (char_u *)"048", 3L);
+#endif
+ else
+ add_char_buff(&redobuff, c);
+ }
+ }
+}
+
+/*
+ * Append a character to the redo buffer.
+ * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
+ */
+ void
+AppendCharToRedobuff(c)
+ int c;
+{
+ if (!block_redo)
+ add_char_buff(&redobuff, c);
+}
+
+/*
+ * Append a number to the redo buffer.
+ */
+ void
+AppendNumberToRedobuff(n)
+ long n;
+{
+ if (!block_redo)
+ add_num_buff(&redobuff, n);
+}
+
+/*
+ * Append string "s" to the stuff buffer.
+ * CSI and K_SPECIAL must already have been escaped.
+ */
+ void
+stuffReadbuff(s)
+ char_u *s;
+{
+ add_buff(&stuffbuff, s, -1L);
+}
+
+ void
+stuffReadbuffLen(s, len)
+ char_u *s;
+ long len;
+{
+ add_buff(&stuffbuff, s, len);
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Stuff "s" into the stuff buffer, leaving special key codes unmodified and
+ * escaping other K_SPECIAL and CSI bytes.
+ */
+ void
+stuffReadbuffSpec(s)
+ char_u *s;
+{
+ while (*s != NUL)
+ {
+ if (*s == K_SPECIAL && s[1] != NUL && s[2] != NUL)
+ {
+ /* Insert special key literally. */
+ stuffReadbuffLen(s, 3L);
+ s += 3;
+ }
+ else
+#ifdef FEAT_MBYTE
+ stuffcharReadbuff(mb_ptr2char_adv(&s));
+#else
+ stuffcharReadbuff(*s++);
+#endif
+ }
+}
+#endif
+
+/*
+ * Append a character to the stuff buffer.
+ * Translates special keys, NUL, CSI, K_SPECIAL and multibyte characters.
+ */
+ void
+stuffcharReadbuff(c)
+ int c;
+{
+ add_char_buff(&stuffbuff, c);
+}
+
+/*
+ * Append a number to the stuff buffer.
+ */
+ void
+stuffnumReadbuff(n)
+ long n;
+{
+ add_num_buff(&stuffbuff, n);
+}
+
+/*
+ * Read a character from the redo buffer. Translates K_SPECIAL, CSI and
+ * multibyte characters.
+ * The redo buffer is left as it is.
+ * if init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
+ * otherwise
+ * if old is TRUE, use old_redobuff instead of redobuff
+ */
+ static int
+read_redo(init, old_redo)
+ int init;
+ int old_redo;
+{
+ static struct buffblock *bp;
+ static char_u *p;
+ int c;
+#ifdef FEAT_MBYTE
+ int n;
+ char_u buf[MB_MAXBYTES];
+ int i;
+#endif
+
+ if (init)
+ {
+ if (old_redo)
+ bp = old_redobuff.bh_first.b_next;
+ else
+ bp = redobuff.bh_first.b_next;
+ if (bp == NULL)
+ return FAIL;
+ p = bp->b_str;
+ return OK;
+ }
+ if ((c = *p) != NUL)
+ {
+ /* Reverse the conversion done by add_char_buff() */
+#ifdef FEAT_MBYTE
+ /* For a multi-byte character get all the bytes and return the
+ * converted character. */
+ if (has_mbyte && (c != K_SPECIAL || p[1] == KS_SPECIAL))
+ n = MB_BYTE2LEN_CHECK(c);
+ else
+ n = 1;
+ for (i = 0; ; ++i)
+#endif
+ {
+ if (c == K_SPECIAL) /* special key or escaped K_SPECIAL */
+ {
+ c = TO_SPECIAL(p[1], p[2]);
+ p += 2;
+ }
+#ifdef FEAT_GUI
+ if (c == CSI) /* escaped CSI */
+ p += 2;
+#endif
+ if (*++p == NUL && bp->b_next != NULL)
+ {
+ bp = bp->b_next;
+ p = bp->b_str;
+ }
+#ifdef FEAT_MBYTE
+ buf[i] = c;
+ if (i == n - 1) /* last byte of a character */
+ {
+ if (n != 1)
+ c = (*mb_ptr2char)(buf);
+ break;
+ }
+ c = *p;
+ if (c == NUL) /* cannot happen? */
+ break;
+#endif
+ }
+ }
+
+ return c;
+}
+
+/*
+ * Copy the rest of the redo buffer into the stuff buffer (in a slow way).
+ * If old_redo is TRUE, use old_redobuff instead of redobuff.
+ * The escaped K_SPECIAL and CSI are copied without translation.
+ */
+ static void
+copy_redo(old_redo)
+ int old_redo;
+{
+ int c;
+
+ while ((c = read_redo(FALSE, old_redo)) != NUL)
+ stuffcharReadbuff(c);
+}
+
+/*
+ * Stuff the redo buffer into the stuffbuff.
+ * Insert the redo count into the command.
+ * If "old_redo" is TRUE, the last but one command is repeated
+ * instead of the last command (inserting text). This is used for
+ * CTRL-O <.> in insert mode
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+start_redo(count, old_redo)
+ long count;
+ int old_redo;
+{
+ int c;
+
+ /* init the pointers; return if nothing to redo */
+ if (read_redo(TRUE, old_redo) == FAIL)
+ return FAIL;
+
+ c = read_redo(FALSE, old_redo);
+
+ /* copy the buffer name, if present */
+ if (c == '"')
+ {
+ add_buff(&stuffbuff, (char_u *)"\"", 1L);
+ c = read_redo(FALSE, old_redo);
+
+ /* if a numbered buffer is used, increment the number */
+ if (c >= '1' && c < '9')
+ ++c;
+ add_char_buff(&stuffbuff, c);
+ c = read_redo(FALSE, old_redo);
+ }
+
+#ifdef FEAT_VISUAL
+ if (c == 'v') /* redo Visual */
+ {
+ VIsual = curwin->w_cursor;
+ VIsual_active = TRUE;
+ VIsual_select = FALSE;
+ VIsual_reselect = TRUE;
+ redo_VIsual_busy = TRUE;
+ c = read_redo(FALSE, old_redo);
+ }
+#endif
+
+ /* try to enter the count (in place of a previous count) */
+ if (count)
+ {
+ while (VIM_ISDIGIT(c)) /* skip "old" count */
+ c = read_redo(FALSE, old_redo);
+ add_num_buff(&stuffbuff, count);
+ }
+
+ /* copy from the redo buffer into the stuff buffer */
+ add_char_buff(&stuffbuff, c);
+ copy_redo(old_redo);
+ return OK;
+}
+
+/*
+ * Repeat the last insert (R, o, O, a, A, i or I command) by stuffing
+ * the redo buffer into the stuffbuff.
+ * return FAIL for failure, OK otherwise
+ */
+ int
+start_redo_ins()
+{
+ int c;
+
+ if (read_redo(TRUE, FALSE) == FAIL)
+ return FAIL;
+ start_stuff();
+
+ /* skip the count and the command character */
+ while ((c = read_redo(FALSE, FALSE)) != NUL)
+ {
+ if (vim_strchr((char_u *)"AaIiRrOo", c) != NULL)
+ {
+ if (c == 'O' || c == 'o')
+ stuffReadbuff(NL_STR);
+ break;
+ }
+ }
+
+ /* copy the typed text from the redo buffer into the stuff buffer */
+ copy_redo(FALSE);
+ block_redo = TRUE;
+ return OK;
+}
+
+ void
+stop_redo_ins()
+{
+ block_redo = FALSE;
+}
+
+/*
+ * Initialize typebuf.tb_buf to point to typebuf_init.
+ * alloc() cannot be used here: In out-of-memory situations it would
+ * be impossible to type anything.
+ */
+ static void
+init_typebuf()
+{
+ if (typebuf.tb_buf == NULL)
+ {
+ typebuf.tb_buf = typebuf_init;
+ typebuf.tb_noremap = noremapbuf_init;
+ typebuf.tb_buflen = TYPELEN_INIT;
+ typebuf.tb_len = 0;
+ typebuf.tb_off = 0;
+ typebuf.tb_change_cnt = 1;
+ }
+}
+
+/*
+ * insert a string in position 'offset' in the typeahead buffer (for "@r"
+ * and ":normal" command, vgetorpeek() and check_termcode())
+ *
+ * If noremap is REMAP_YES, new string can be mapped again.
+ * If noremap is REMAP_NONE, new string cannot be mapped again.
+ * If noremap is REMAP_SCRIPT, new string cannot be mapped again, except for
+ * script-local mappings.
+ * If noremap is > 0, that many characters of the new string cannot be mapped.
+ *
+ * If nottyped is TRUE, the string does not return KeyTyped (don't use when
+ * offset is non-zero!).
+ *
+ * If silent is TRUE, cmd_silent is set when the characters are obtained.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+ins_typebuf(str, noremap, offset, nottyped, silent)
+ char_u *str;
+ int noremap;
+ int offset;
+ int nottyped;
+ int silent;
+{
+ char_u *s1, *s2;
+ int newlen;
+ int addlen;
+ int i;
+ int newoff;
+ int val;
+ int nrm;
+
+ init_typebuf();
+ if (++typebuf.tb_change_cnt == 0)
+ typebuf.tb_change_cnt = 1;
+
+ addlen = (int)STRLEN(str);
+ /*
+ * Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
+ */
+ if (offset == 0 && addlen <= typebuf.tb_off)
+ {
+ typebuf.tb_off -= addlen;
+ mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
+ }
+ /*
+ * Need to allocate new buffer.
+ * In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
+ * characters. We add some extra room to avoid having to allocate too
+ * often.
+ */
+ else
+ {
+ newoff = MAXMAPLEN + 4;
+ newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
+ if (newlen < 0) /* string is getting too long */
+ {
+ EMSG(_(e_toocompl)); /* also calls flush_buffers */
+ setcursor();
+ return FAIL;
+ }
+ s1 = alloc(newlen);
+ if (s1 == NULL) /* out of memory */
+ return FAIL;
+ s2 = alloc(newlen);
+ if (s2 == NULL) /* out of memory */
+ {
+ vim_free(s1);
+ return FAIL;
+ }
+ typebuf.tb_buflen = newlen;
+
+ /* copy the old chars, before the insertion point */
+ mch_memmove(s1 + newoff, typebuf.tb_buf + typebuf.tb_off,
+ (size_t)offset);
+ /* copy the new chars */
+ mch_memmove(s1 + newoff + offset, str, (size_t)addlen);
+ /* copy the old chars, after the insertion point, including the NUL at
+ * the end */
+ mch_memmove(s1 + newoff + offset + addlen,
+ typebuf.tb_buf + typebuf.tb_off + offset,
+ (size_t)(typebuf.tb_len - offset + 1));
+ if (typebuf.tb_buf != typebuf_init)
+ vim_free(typebuf.tb_buf);
+ typebuf.tb_buf = s1;
+
+ mch_memmove(s2 + newoff, typebuf.tb_noremap + typebuf.tb_off,
+ (size_t)offset);
+ mch_memmove(s2 + newoff + offset + addlen,
+ typebuf.tb_noremap + typebuf.tb_off + offset,
+ (size_t)(typebuf.tb_len - offset));
+ if (typebuf.tb_noremap != noremapbuf_init)
+ vim_free(typebuf.tb_noremap);
+ typebuf.tb_noremap = s2;
+
+ typebuf.tb_off = newoff;
+ }
+ typebuf.tb_len += addlen;
+
+ /* If noremap == REMAP_SCRIPT: do remap script-local mappings. */
+ if (noremap == REMAP_SCRIPT)
+ val = RM_SCRIPT;
+ else
+ val = RM_NONE;
+
+ /*
+ * Adjust typebuf.tb_noremap[] for the new characters:
+ * If noremap == REMAP_NONE or REMAP_SCRIPT: new characters are
+ * (sometimes) not remappable
+ * If noremap == REMAP_YES: all the new characters are mappable
+ * If noremap > 0: "noremap" characters are not remappable, the rest
+ * mappable
+ */
+ if (noremap < 0)
+ nrm = addlen;
+ else
+ nrm = noremap;
+ for (i = 0; i < addlen; ++i)
+ typebuf.tb_noremap[typebuf.tb_off + i + offset] =
+ (--nrm >= 0) ? val : RM_YES;
+
+ /* tb_maplen and tb_silent only remember the length of mapped and/or
+ * silent mappings at the start of the buffer, assuming that a mapped
+ * sequence doesn't result in typed characters. */
+ if (nottyped || typebuf.tb_maplen > offset)
+ typebuf.tb_maplen += addlen;
+ if (silent || typebuf.tb_silent > offset)
+ {
+ typebuf.tb_silent += addlen;
+ cmd_silent = TRUE;
+ }
+ if (typebuf.tb_no_abbr_cnt && offset == 0) /* and not used for abbrev.s */
+ typebuf.tb_no_abbr_cnt += addlen;
+
+ return OK;
+}
+
+/*
+ * Return TRUE if the typeahead buffer was changed (while waiting for a
+ * character to arrive). Happens when a message was received from a client.
+ * But check in a more generic way to avoid trouble: When "typebuf.tb_buf"
+ * changed it was reallocated and the old pointer can no longer be used.
+ * Or "typebuf.tb_off" may have been changed and we would overwrite characters
+ * that was just added.
+ */
+ int
+typebuf_changed(tb_change_cnt)
+ int tb_change_cnt; /* old value of typebuf.tb_change_cnt */
+{
+ return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt
+#ifdef FEAT_CLIENTSERVER
+ || received_from_client
+#endif
+ ));
+}
+
+/*
+ * Return TRUE if there are no characters in the typeahead buffer that have
+ * not been typed (result from a mapping or come from ":normal").
+ */
+ int
+typebuf_typed()
+{
+ return typebuf.tb_maplen == 0;
+}
+
+/*
+ * Return the number of characters that are mapped (or not typed).
+ */
+ int
+typebuf_maplen()
+{
+ return typebuf.tb_maplen;
+}
+
+/*
+ * remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset]
+ */
+ void
+del_typebuf(len, offset)
+ int len;
+ int offset;
+{
+ int i;
+
+ if (len == 0)
+ return; /* nothing to do */
+
+ typebuf.tb_len -= len;
+
+ /*
+ * Easy case: Just increase typebuf.tb_off.
+ */
+ if (offset == 0 && typebuf.tb_buflen - (typebuf.tb_off + len)
+ >= 3 * MAXMAPLEN + 3)
+ typebuf.tb_off += len;
+ /*
+ * Have to move the characters in typebuf.tb_buf[] and typebuf.tb_noremap[]
+ */
+ else
+ {
+ i = typebuf.tb_off + offset;
+ /*
+ * Leave some extra room at the end to avoid reallocation.
+ */
+ if (typebuf.tb_off > MAXMAPLEN)
+ {
+ mch_memmove(typebuf.tb_buf + MAXMAPLEN,
+ typebuf.tb_buf + typebuf.tb_off, (size_t)offset);
+ mch_memmove(typebuf.tb_noremap + MAXMAPLEN,
+ typebuf.tb_noremap + typebuf.tb_off, (size_t)offset);
+ typebuf.tb_off = MAXMAPLEN;
+ }
+ /* adjust typebuf.tb_buf (include the NUL at the end) */
+ mch_memmove(typebuf.tb_buf + typebuf.tb_off + offset,
+ typebuf.tb_buf + i + len,
+ (size_t)(typebuf.tb_len - offset + 1));
+ /* adjust typebuf.tb_noremap[] */
+ mch_memmove(typebuf.tb_noremap + typebuf.tb_off + offset,
+ typebuf.tb_noremap + i + len,
+ (size_t)(typebuf.tb_len - offset));
+ }
+
+ if (typebuf.tb_maplen > offset) /* adjust tb_maplen */
+ {
+ if (typebuf.tb_maplen < offset + len)
+ typebuf.tb_maplen = offset;
+ else
+ typebuf.tb_maplen -= len;
+ }
+ if (typebuf.tb_silent > offset) /* adjust tb_silent */
+ {
+ if (typebuf.tb_silent < offset + len)
+ typebuf.tb_silent = offset;
+ else
+ typebuf.tb_silent -= len;
+ }
+ if (typebuf.tb_no_abbr_cnt > offset) /* adjust tb_no_abbr_cnt */
+ {
+ if (typebuf.tb_no_abbr_cnt < offset + len)
+ typebuf.tb_no_abbr_cnt = offset;
+ else
+ typebuf.tb_no_abbr_cnt -= len;
+ }
+
+#ifdef FEAT_CLIENTSERVER
+ /* Reset the flag that text received from a client was inserted in the
+ * typeahead buffer. */
+ received_from_client = FALSE;
+#endif
+ if (++typebuf.tb_change_cnt == 0)
+ typebuf.tb_change_cnt = 1;
+}
+
+/*
+ * Write typed characters to script file.
+ * If recording is on put the character in the recordbuffer.
+ */
+ static void
+gotchars(s, len)
+ char_u *s;
+ int len;
+{
+ int c;
+ char_u buf[2];
+
+ /* remember how many chars were last recorded */
+ if (Recording)
+ last_recorded_len += len;
+
+ buf[1] = NUL;
+ while (len--)
+ {
+ /* Handle one byte at a time; no translation to be done. */
+ c = *s++;
+ updatescript(c);
+
+ if (Recording)
+ {
+ buf[0] = c;
+ add_buff(&recordbuff, buf, 1L);
+ }
+ }
+ may_sync_undo();
+
+#ifdef FEAT_EVAL
+ /* output "debug mode" message next time in debug mode */
+ debug_did_msg = FALSE;
+#endif
+
+ /* Since characters have been typed, consider the following to be in
+ * another mapping. Search string will be kept in history. */
+ ++maptick;
+}
+
+/*
+ * Sync undo. Called when typed characters are obtained from the typeahead
+ * buffer, or when a menu is used.
+ * Do not sync:
+ * - In Insert mode, unless cursor key has been used.
+ * - While reading a script file.
+ * - When no_u_sync is non-zero.
+ */
+ static void
+may_sync_undo()
+{
+ if ((!(State & (INSERT + CMDLINE)) || arrow_used)
+ && scriptin[curscript] == NULL && no_u_sync == 0)
+ u_sync();
+}
+
+/*
+ * Make "typebuf" empty and allocate new buffers.
+ * Returns FAIL when out of memory.
+ */
+ int
+alloc_typebuf()
+{
+ typebuf.tb_buf = alloc(TYPELEN_INIT);
+ typebuf.tb_noremap = alloc(TYPELEN_INIT);
+ if (typebuf.tb_buf == NULL || typebuf.tb_noremap == NULL)
+ {
+ free_typebuf();
+ return FAIL;
+ }
+ typebuf.tb_buflen = TYPELEN_INIT;
+ typebuf.tb_off = 0;
+ typebuf.tb_len = 0;
+ typebuf.tb_maplen = 0;
+ typebuf.tb_silent = 0;
+ typebuf.tb_no_abbr_cnt = 0;
+ if (++typebuf.tb_change_cnt == 0)
+ typebuf.tb_change_cnt = 1;
+ return OK;
+}
+
+/*
+ * Free the buffers of "typebuf".
+ */
+ void
+free_typebuf()
+{
+ vim_free(typebuf.tb_buf);
+ vim_free(typebuf.tb_noremap);
+}
+
+/*
+ * When doing ":so! file", the current typeahead needs to be saved, and
+ * restored when "file" has been read completely.
+ */
+static typebuf_T saved_typebuf[NSCRIPT];
+
+ int
+save_typebuf()
+{
+ init_typebuf();
+ saved_typebuf[curscript] = typebuf;
+ /* If out of memory: restore typebuf and close file. */
+ if (alloc_typebuf() == FAIL)
+ {
+ closescript();
+ return FAIL;
+ }
+ return OK;
+}
+
+#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
+
+/*
+ * Save all three kinds of typeahead, so that the user must type at a prompt.
+ */
+ void
+save_typeahead(tp)
+ tasave_T *tp;
+{
+ tp->save_typebuf = typebuf;
+ tp->typebuf_valid = (alloc_typebuf() == OK);
+ if (!tp->typebuf_valid)
+ typebuf = tp->save_typebuf;
+
+ tp->save_stuffbuff = stuffbuff;
+ stuffbuff.bh_first.b_next = NULL;
+# ifdef USE_INPUT_BUF
+ tp->save_inputbuf = get_input_buf();
+# endif
+}
+
+/*
+ * Restore the typeahead to what it was before calling save_typeahead().
+ * The allocated memory is freed, can only be called once!
+ */
+ void
+restore_typeahead(tp)
+ tasave_T *tp;
+{
+ if (tp->typebuf_valid)
+ {
+ free_typebuf();
+ typebuf = tp->save_typebuf;
+ }
+
+ free_buff(&stuffbuff);
+ stuffbuff = tp->save_stuffbuff;
+# ifdef USE_INPUT_BUF
+ set_input_buf(tp->save_inputbuf);
+# endif
+}
+#endif
+
+/*
+ * Open a new script file for the ":source!" command.
+ */
+ void
+openscript(name, directly)
+ char_u *name;
+ int directly; /* when TRUE execute directly */
+{
+ if (curscript + 1 == NSCRIPT)
+ {
+ EMSG(_(e_nesting));
+ return;
+ }
+
+ if (scriptin[curscript] != NULL) /* already reading script */
+ ++curscript;
+ /* use NameBuff for expanded name */
+ expand_env(name, NameBuff, MAXPATHL);
+ if ((scriptin[curscript] = mch_fopen((char *)NameBuff, READBIN)) == NULL)
+ {
+ EMSG2(_(e_notopen), name);
+ if (curscript)
+ --curscript;
+ return;
+ }
+ if (save_typebuf() == FAIL)
+ return;
+
+ /*
+ * Execute the commands from the file right now when using ":source!"
+ * after ":global" or ":argdo" or in a loop. Also when another command
+ * follows. This means the display won't be updated. Don't do this
+ * always, "make test" would fail.
+ */
+ if (directly)
+ {
+ oparg_T oa;
+ int oldcurscript;
+ int save_State = State;
+ int save_restart_edit = restart_edit;
+ int save_insertmode = p_im;
+ int save_finish_op = finish_op;
+ int save_msg_scroll = msg_scroll;
+
+ State = NORMAL;
+ msg_scroll = FALSE; /* no msg scrolling in Normal mode */
+ restart_edit = 0; /* don't go to Insert mode */
+ p_im = FALSE; /* don't use 'insertmode' */
+ clear_oparg(&oa);
+ finish_op = FALSE;
+
+ oldcurscript = curscript;
+ do
+ {
+ update_topline_cursor(); /* update cursor position and topline */
+ normal_cmd(&oa, FALSE); /* execute one command */
+ vpeekc(); /* check for end of file */
+ }
+ while (scriptin[oldcurscript] != NULL);
+
+ State = save_State;
+ msg_scroll = save_msg_scroll;
+ restart_edit = save_restart_edit;
+ p_im = save_insertmode;
+ finish_op = save_finish_op;
+ }
+}
+
+/*
+ * Close the currently active input script.
+ */
+ static void
+closescript()
+{
+ free_typebuf();
+ typebuf = saved_typebuf[curscript];
+
+ fclose(scriptin[curscript]);
+ scriptin[curscript] = NULL;
+ if (curscript > 0)
+ --curscript;
+}
+
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Return TRUE when reading keys from a script file.
+ */
+ int
+using_script()
+{
+ return scriptin[curscript] != NULL;
+}
+#endif
+
+/*
+ * updatescipt() is called when a character can be written into the script file
+ * or when we have waited some time for a character (c == 0)
+ *
+ * All the changed memfiles are synced if c == 0 or when the number of typed
+ * characters reaches 'updatecount' and 'updatecount' is non-zero.
+ */
+ void
+updatescript(c)
+ int c;
+{
+ static int count = 0;
+
+ if (c && scriptout)
+ putc(c, scriptout);
+ if (c == 0 || (p_uc > 0 && ++count >= p_uc))
+ {
+ ml_sync_all(c == 0, TRUE);
+ count = 0;
+ }
+}
+
+#define KL_PART_KEY -1 /* keylen value for incomplete key-code */
+#define KL_PART_MAP -2 /* keylen value for incomplete mapping */
+
+static int old_char = -1; /* character put back by vungetc() */
+static int old_mod_mask; /* mod_mask for ungotten character */
+
+/*
+ * Get the next input character.
+ * Can return a special key or a multi-byte character.
+ * Can return NUL when called recursively, use safe_vgetc() if that's not
+ * wanted.
+ * This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
+ * Collects the bytes of a multibyte character into the whole character.
+ * Returns the modifers in the global "mod_mask".
+ */
+ int
+vgetc()
+{
+ int c, c2;
+#ifdef FEAT_MBYTE
+ int n;
+ char_u buf[MB_MAXBYTES];
+ int i;
+#endif
+
+ /*
+ * If a character was put back with vungetc, it was already processed.
+ * Return it directly.
+ */
+ if (old_char != -1)
+ {
+ c = old_char;
+ old_char = -1;
+ mod_mask = old_mod_mask;
+ return c;
+ }
+
+ mod_mask = 0x0;
+ last_recorded_len = 0;
+ for (;;) /* this is done twice if there are modifiers */
+ {
+ if (mod_mask) /* no mapping after modifier has been read */
+ {
+ ++no_mapping;
+ ++allow_keys;
+ }
+ c = vgetorpeek(TRUE);
+ if (mod_mask)
+ {
+ --no_mapping;
+ --allow_keys;
+ }
+
+ /* Get two extra bytes for special keys */
+ if (c == K_SPECIAL
+#ifdef FEAT_GUI
+ || c == CSI
+#endif
+ )
+ {
+ ++no_mapping;
+ c2 = vgetorpeek(TRUE); /* no mapping for these chars */
+ c = vgetorpeek(TRUE);
+ --no_mapping;
+ if (c2 == KS_MODIFIER)
+ {
+ mod_mask = c;
+ continue;
+ }
+ c = TO_SPECIAL(c2, c);
+
+#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+ /* Handle K_TEAROFF here, the caller of vgetc() doesn't need to
+ * know that a menu was torn off */
+ if (c == K_TEAROFF)
+ {
+ char_u name[200];
+ int i;
+
+ /* get menu path, it ends with a <CR> */
+ for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
+ {
+ name[i] = c;
+ if (i < 199)
+ ++i;
+ }
+ name[i] = NUL;
+ gui_make_tearoff(name);
+ continue;
+ }
+#endif
+#ifdef FEAT_GUI
+ /* Translate K_CSI to CSI. The special key is only used to avoid
+ * it being recognized as the start of a special key. */
+ if (c == K_CSI)
+ c = CSI;
+#endif
+ }
+#ifdef MSDOS
+ /*
+ * If K_NUL was typed, it is replaced by K_NUL, 3 in mch_inchar().
+ * Delete the 3 here.
+ */
+ else if (c == K_NUL && vpeekc() == 3)
+ (void)vgetorpeek(TRUE);
+#endif
+
+ if (c >= FIRST_KEYPAD && c <= LAST_KEYPAD)
+ {
+ /* a keypad key was not mapped, use it like its ASCII equivalent */
+ switch (c)
+ {
+ case K_KPLUS: c = '+'; break;
+ case K_KMINUS: c = '-'; break;
+ case K_KDIVIDE: c = '/'; break;
+ case K_KMULTIPLY: c = '*'; break;
+ case K_KENTER: c = CAR; break;
+ case K_KPOINT: c = '.'; break;
+ case K_K0: c = '0'; break;
+ case K_K1: c = '1'; break;
+ case K_K2: c = '2'; break;
+ case K_K3: c = '3'; break;
+ case K_K4: c = '4'; break;
+ case K_K5: c = '5'; break;
+ case K_K6: c = '6'; break;
+ case K_K7: c = '7'; break;
+ case K_K8: c = '8'; break;
+ case K_K9: c = '9'; break;
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ /* For a multi-byte character get all the bytes and return the
+ * converted character.
+ * Note: This will loop until enough bytes are received!
+ */
+ if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
+ {
+ ++no_mapping;
+ buf[0] = c;
+ for (i = 1; i < n; ++i)
+ {
+ buf[i] = vgetorpeek(TRUE);
+ if (buf[i] == K_SPECIAL
+#ifdef FEAT_GUI
+ || buf[i] == CSI
+#endif
+ )
+ {
+ /* Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence,
+ * which represents a K_SPECIAL (0x80),
+ * or a CSI - KS_EXTRA - KE_CSI sequence, which represents
+ * a CSI (0x9B),
+ * of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. */
+ c = vgetorpeek(TRUE);
+ if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
+ buf[i] = CSI;
+ }
+ }
+ --no_mapping;
+ c = (*mb_ptr2char)(buf);
+ }
+#endif
+
+ return c;
+ }
+}
+
+/*
+ * Like vgetc(), but never return a NUL when called recursively, get a key
+ * directly from the user (ignoring typeahead).
+ */
+ int
+safe_vgetc()
+{
+ int c;
+
+ c = vgetc();
+ if (c == NUL)
+ c = get_keystroke();
+ return c;
+}
+
+/*
+ * Check if a character is available, such that vgetc() will not block.
+ * If the next character is a special character or multi-byte, the returned
+ * character is not valid!.
+ */
+ int
+vpeekc()
+{
+ if (old_char != -1)
+ return old_char;
+ return vgetorpeek(FALSE);
+}
+
+#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
+/*
+ * Like vpeekc(), but don't allow mapping. Do allow checking for terminal
+ * codes.
+ */
+ int
+vpeekc_nomap()
+{
+ int c;
+
+ ++no_mapping;
+ ++allow_keys;
+ c = vpeekc();
+ --no_mapping;
+ --allow_keys;
+ return c;
+}
+#endif
+
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Check if any character is available, also half an escape sequence.
+ * Trick: when no typeahead found, but there is something in the typeahead
+ * buffer, it must be an ESC that is recognized as the start of a key code.
+ */
+ int
+vpeekc_any()
+{
+ int c;
+
+ c = vpeekc();
+ if (c == NUL && typebuf.tb_len > 0)
+ c = ESC;
+ return c;
+}
+#endif
+
+/*
+ * Call vpeekc() without causing anything to be mapped.
+ * Return TRUE if a character is available, FALSE otherwise.
+ */
+ int
+char_avail()
+{
+ int retval;
+
+ ++no_mapping;
+ retval = vpeekc();
+ --no_mapping;
+ return (retval != NUL);
+}
+
+ void
+vungetc(c) /* unget one character (can only be done once!) */
+ int c;
+{
+ old_char = c;
+ old_mod_mask = mod_mask;
+}
+
+/*
+ * get a character:
+ * 1. from the stuffbuffer
+ * This is used for abbreviated commands like "D" -> "d$".
+ * Also used to redo a command for ".".
+ * 2. from the typeahead buffer
+ * Stores text obtained previously but not used yet.
+ * Also stores the result of mappings.
+ * Also used for the ":normal" command.
+ * 3. from the user
+ * This may do a blocking wait if "advance" is TRUE.
+ *
+ * if "advance" is TRUE (vgetc()):
+ * really get the character.
+ * KeyTyped is set to TRUE in the case the user typed the key.
+ * KeyStuffed is TRUE if the character comes from the stuff buffer.
+ * if "advance" is FALSE (vpeekc()):
+ * just look whether there is a character available.
+ *
+ * When "no_mapping" is zero, checks for mappings in the current mode.
+ * Only returns one byte (of a multi-byte character).
+ * K_SPECIAL and CSI may be escaped, need to get two more bytes then.
+ */
+ static int
+vgetorpeek(advance)
+ int advance;
+{
+ int c, c1;
+ int keylen;
+ char_u *s;
+ mapblock_T *mp;
+#ifdef FEAT_LOCALMAP
+ mapblock_T *mp2;
+#endif
+ mapblock_T *mp_match;
+ int mp_match_len = 0;
+ int timedout = FALSE; /* waited for more than 1 second
+ for mapping to complete */
+ int mapdepth = 0; /* check for recursive mapping */
+ int mode_deleted = FALSE; /* set when mode has been deleted */
+ int local_State;
+ int mlen;
+ int max_mlen;
+#ifdef FEAT_CMDL_INFO
+ int i;
+ int new_wcol, new_wrow;
+#endif
+#ifdef FEAT_GUI
+# ifdef FEAT_MENU
+ int idx;
+# endif
+ int shape_changed = FALSE; /* adjusted cursor shape */
+#endif
+ int n;
+#ifdef FEAT_LANGMAP
+ int nolmaplen;
+#endif
+ int old_wcol, old_wrow;
+
+ /*
+ * This function doesn't work very well when called recursively. This may
+ * happen though, because of:
+ * 1. The call to add_to_showcmd(). char_avail() is then used to check if
+ * there is a character available, which calls this function. In that
+ * case we must return NUL, to indicate no character is available.
+ * 2. A GUI callback function writes to the screen, causing a
+ * wait_return().
+ * Using ":normal" can also do this, but it saves the typeahead buffer,
+ * thus it should be OK. But don't get a key from the user then.
+ */
+ if (vgetc_busy
+#ifdef FEAT_EX_EXTRA
+ && ex_normal_busy == 0
+#endif
+ )
+ return NUL;
+
+ local_State = get_real_state();
+
+ vgetc_busy = TRUE;
+
+ if (advance)
+ KeyStuffed = FALSE;
+
+ init_typebuf();
+ start_stuff();
+ if (advance && typebuf.tb_maplen == 0)
+ Exec_reg = FALSE;
+ do
+ {
+/*
+ * get a character: 1. from the stuffbuffer
+ */
+ if (typeahead_char != 0)
+ {
+ c = typeahead_char;
+ if (advance)
+ typeahead_char = 0;
+ }
+ else
+ c = read_stuff(advance);
+ if (c != NUL && !got_int)
+ {
+ if (advance)
+ {
+ /* KeyTyped = FALSE; When the command that stuffed something
+ * was typed, behave like the stuffed command was typed.
+ * needed for CTRL-W CTRl-] to open a fold, for example. */
+ KeyStuffed = TRUE;
+ }
+ if (typebuf.tb_no_abbr_cnt == 0)
+ typebuf.tb_no_abbr_cnt = 1; /* no abbreviations now */
+ }
+ else
+ {
+ /*
+ * Loop until we either find a matching mapped key, or we
+ * are sure that it is not a mapped key.
+ * If a mapped key sequence is found we go back to the start to
+ * try re-mapping.
+ */
+ for (;;)
+ {
+ /*
+ * ui_breakcheck() is slow, don't use it too often when
+ * inside a mapping. But call it each time for typed
+ * characters.
+ */
+ if (typebuf.tb_maplen)
+ line_breakcheck();
+ else
+ ui_breakcheck(); /* check for CTRL-C */
+ keylen = 0;
+ if (got_int)
+ {
+ /* flush all input */
+ c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L,
+ typebuf.tb_change_cnt);
+ /*
+ * If inchar() returns TRUE (script file was active) or we
+ * are inside a mapping, get out of insert mode.
+ * Otherwise we behave like having gotten a CTRL-C.
+ * As a result typing CTRL-C in insert mode will
+ * really insert a CTRL-C.
+ */
+ if ((c || typebuf.tb_maplen)
+ && (State & (INSERT + CMDLINE)))
+ c = ESC;
+ else
+ c = Ctrl_C;
+ flush_buffers(TRUE); /* flush all typeahead */
+
+ /* Also record this character, it might be needed to
+ * get out of Insert mode. */
+ *typebuf.tb_buf = c;
+ gotchars(typebuf.tb_buf, 1);
+ cmd_silent = FALSE;
+
+ break;
+ }
+ else if (typebuf.tb_len > 0)
+ {
+ /*
+ * Check for a mappable key sequence.
+ * Walk through one maphash[] list until we find an
+ * entry that matches.
+ *
+ * Don't look for mappings if:
+ * - no_mapping set: mapping disabled (e.g. for CTRL-V)
+ * - maphash_valid not set: no mappings present.
+ * - typebuf.tb_buf[typebuf.tb_off] should not be remapped
+ * - in insert or cmdline mode and 'paste' option set
+ * - waiting for "hit return to continue" and CR or SPACE
+ * typed
+ * - waiting for a char with --more--
+ * - in Ctrl-X mode, and we get a valid char for that mode
+ */
+ mp = NULL;
+ max_mlen = 0;
+ c1 = typebuf.tb_buf[typebuf.tb_off];
+ if (no_mapping == 0 && maphash_valid
+ && (no_zero_mapping == 0 || c1 != '0')
+ && (typebuf.tb_maplen == 0
+ || (p_remap
+ && typebuf.tb_noremap[typebuf.tb_off]
+ != RM_NONE))
+ && !(p_paste && (State & (INSERT + CMDLINE)))
+ && !(State == HITRETURN && (c1 == CAR || c1 == ' '))
+ && State != ASKMORE
+ && State != CONFIRM
+#ifdef FEAT_INS_EXPAND
+ && !((ctrl_x_mode != 0 && vim_is_ctrl_x_key(c1))
+ || ((continue_status & CONT_LOCAL)
+ && (c1 == Ctrl_N || c1 == Ctrl_P)))
+#endif
+ )
+ {
+#ifdef FEAT_LANGMAP
+ if (c1 == K_SPECIAL)
+ nolmaplen = 2;
+ else
+ {
+ LANGMAP_ADJUST(c1, TRUE);
+ nolmaplen = 0;
+ }
+#endif
+#ifdef FEAT_LOCALMAP
+ /* First try buffer-local mappings. */
+ mp = curbuf->b_maphash[MAP_HASH(local_State, c1)];
+ mp2 = maphash[MAP_HASH(local_State, c1)];
+ if (mp == NULL)
+ {
+ mp = mp2;
+ mp2 = NULL;
+ }
+#else
+ mp = maphash[MAP_HASH(local_State, c1)];
+#endif
+ /*
+ * Loop until a partly matching mapping is found or
+ * all (local) mappings have been checked.
+ * The longest full match is remembered in "mp_match".
+ * A full match is only accepted if there is no partly
+ * match, so "aa" and "aaa" can both be mapped.
+ */
+ mp_match = NULL;
+ mp_match_len = 0;
+ for ( ; mp != NULL;
+#ifdef FEAT_LOCALMAP
+ mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
+#endif
+ (mp = mp->m_next))
+ {
+ /*
+ * Only consider an entry if the first character
+ * matches and it is for the current state.
+ * Skip ":lmap" mappings if keys were mapped.
+ */
+ if (mp->m_keys[0] == c1
+ && (mp->m_mode & local_State)
+ && ((mp->m_mode & LANGMAP) == 0
+ || typebuf.tb_maplen == 0))
+ {
+#ifdef FEAT_LANGMAP
+ int nomap = nolmaplen;
+ int c2;
+#endif
+ /* find the match length of this mapping */
+ for (mlen = 1; mlen < typebuf.tb_len; ++mlen)
+ {
+#ifdef FEAT_LANGMAP
+ c2 = typebuf.tb_buf[typebuf.tb_off + mlen];
+ if (nomap > 0)
+ --nomap;
+ else if (c2 == K_SPECIAL)
+ nomap = 2;
+ else
+ LANGMAP_ADJUST(c2, TRUE);
+ if (mp->m_keys[mlen] != c2)
+#else
+ if (mp->m_keys[mlen] !=
+ typebuf.tb_buf[typebuf.tb_off + mlen])
+#endif
+ break;
+ }
+
+#ifdef FEAT_MBYTE
+ /* Don't allow mapping the first byte(s) of a
+ * multi-byte char. Happens when mapping
+ * <M-a> and then changing 'encoding'. */
+ if (has_mbyte && MB_BYTE2LEN(c1)
+ > (*mb_ptr2len_check)(mp->m_keys))
+ mlen = 0;
+#endif
+ /*
+ * Check an entry whether it matches.
+ * - Full match: mlen == keylen
+ * - Partly match: mlen == typebuf.tb_len
+ */
+ keylen = mp->m_keylen;
+ if (mlen == keylen
+ || (mlen == typebuf.tb_len
+ && typebuf.tb_len < keylen))
+ {
+ /*
+ * If only script-local mappings are
+ * allowed, check if the mapping starts
+ * with K_SNR.
+ */
+ s = typebuf.tb_noremap + typebuf.tb_off;
+ if (*s == RM_SCRIPT
+ && (mp->m_keys[0] != K_SPECIAL
+ || mp->m_keys[1] != KS_EXTRA
+ || mp->m_keys[2]
+ != (int)KE_SNR))
+ continue;
+ /*
+ * If one of the typed keys cannot be
+ * remapped, skip the entry.
+ */
+ for (n = mlen; --n >= 0; )
+ if (*s++ == RM_NONE)
+ break;
+ if (n >= 0)
+ continue;
+
+ if (keylen > typebuf.tb_len)
+ {
+ if (!timedout)
+ {
+ /* break at a partly match */
+ keylen = KL_PART_MAP;
+ break;
+ }
+ }
+ else if (keylen > mp_match_len)
+ {
+ /* found a longer match */
+ mp_match = mp;
+ mp_match_len = keylen;
+ }
+ }
+ else
+ /* No match; may have to check for
+ * termcode at next character. */
+ if (max_mlen < mlen)
+ max_mlen = mlen;
+ }
+ }
+
+ /* If no partly match found, use the longest full
+ * match. */
+ if (keylen != KL_PART_MAP)
+ {
+ mp = mp_match;
+ keylen = mp_match_len;
+ }
+ }
+
+ /* Check for match with 'pastetoggle' */
+ if (*p_pt != NUL && mp == NULL && (State & (INSERT|NORMAL)))
+ {
+ for (mlen = 0; mlen < typebuf.tb_len && p_pt[mlen];
+ ++mlen)
+ if (p_pt[mlen] != typebuf.tb_buf[typebuf.tb_off
+ + mlen])
+ break;
+ if (p_pt[mlen] == NUL) /* match */
+ {
+ /* write chars to script file(s) */
+ if (mlen > typebuf.tb_maplen)
+ gotchars(typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_maplen,
+ mlen - typebuf.tb_maplen);
+
+ del_typebuf(mlen, 0); /* remove the chars */
+ set_option_value((char_u *)"paste",
+ (long)!p_paste, NULL, 0);
+ if (!(State & INSERT))
+ {
+ msg_col = 0;
+ msg_row = Rows - 1;
+ msg_clr_eos(); /* clear ruler */
+ }
+ showmode();
+ setcursor();
+ continue;
+ }
+ /* Need more chars for partly match. */
+ if (mlen == typebuf.tb_len)
+ keylen = KL_PART_MAP;
+ else if (max_mlen < mlen)
+ /* no match, may have to check for termcode at
+ * next character */
+ max_mlen = mlen + 1;
+ }
+
+ if ((mp == NULL || max_mlen >= mp_match_len)
+ && keylen != KL_PART_MAP)
+ {
+ /*
+ * When no matching mapping found or found a
+ * non-matching mapping that matches at least what the
+ * matching mapping matched:
+ * Check if we have a terminal code, when:
+ * mapping is allowed,
+ * keys have not been mapped,
+ * and not an ESC sequence, not in insert mode or
+ * p_ek is on,
+ * and when not timed out,
+ */
+ if ((no_mapping == 0 || allow_keys != 0)
+ && (typebuf.tb_maplen == 0
+ || (p_remap && typebuf.tb_noremap[
+ typebuf.tb_off] == RM_YES))
+ && !timedout)
+ {
+ keylen = check_termcode(max_mlen + 1, NULL, 0);
+
+ /*
+ * When getting a partial match, but the last
+ * characters were not typed, don't wait for a
+ * typed character to complete the termcode.
+ * This helps a lot when a ":normal" command ends
+ * in an ESC.
+ */
+ if (keylen < 0
+ && typebuf.tb_len == typebuf.tb_maplen)
+ keylen = 0;
+ }
+ else
+ keylen = 0;
+ if (keylen == 0) /* no matching terminal code */
+ {
+#ifdef AMIGA /* check for window bounds report */
+ if (typebuf.tb_maplen == 0 && (typebuf.tb_buf[
+ typebuf.tb_off] & 0xff) == CSI)
+ {
+ for (s = typebuf.tb_buf + typebuf.tb_off + 1;
+ s < typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_len
+ && (VIM_ISDIGIT(*s) || *s == ';'
+ || *s == ' ');
+ ++s)
+ ;
+ if (*s == 'r' || *s == '|') /* found one */
+ {
+ del_typebuf((int)(s + 1 -
+ (typebuf.tb_buf + typebuf.tb_off)), 0);
+ /* get size and redraw screen */
+ shell_resized();
+ continue;
+ }
+ if (*s == NUL) /* need more characters */
+ keylen = KL_PART_KEY;
+ }
+ if (keylen >= 0)
+#endif
+ /* When there was a matching mapping and no
+ * termcode could be replaced after another one,
+ * use that mapping. */
+ if (mp == NULL)
+ {
+/*
+ * get a character: 2. from the typeahead buffer
+ */
+ c = typebuf.tb_buf[typebuf.tb_off] & 255;
+ if (advance) /* remove chars from tb_buf */
+ {
+ cmd_silent = (typebuf.tb_silent > 0);
+ if (typebuf.tb_maplen > 0)
+ KeyTyped = FALSE;
+ else
+ {
+ KeyTyped = TRUE;
+ /* write char to script file(s) */
+ gotchars(typebuf.tb_buf
+ + typebuf.tb_off, 1);
+ }
+ KeyNoremap = (typebuf.tb_noremap[
+ typebuf.tb_off] != REMAP_YES);
+ del_typebuf(1, 0);
+ }
+ break; /* got character, break for loop */
+ }
+ }
+ if (keylen > 0) /* full matching terminal code */
+ {
+#if defined(FEAT_GUI) && defined(FEAT_MENU)
+ if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
+ && typebuf.tb_buf[typebuf.tb_off + 1]
+ == KS_MENU)
+ {
+ /*
+ * Using a menu may cause a break in undo!
+ * It's like using gotchars(), but without
+ * recording or writing to a script file.
+ */
+ may_sync_undo();
+ del_typebuf(3, 0);
+ idx = get_menu_index(current_menu, local_State);
+ if (idx != MENU_INDEX_INVALID)
+ {
+# ifdef FEAT_VISUAL
+ /*
+ * In Select mode, a Visual mode menu is
+ * used. Switch to Visual mode
+ * temporarily. Append K_SELECT to switch
+ * back to Select mode.
+ */
+ if (VIsual_active && VIsual_select)
+ {
+ VIsual_select = FALSE;
+ (void)ins_typebuf(K_SELECT_STRING,
+ REMAP_NONE, 0, TRUE, FALSE);
+ }
+# endif
+ ins_typebuf(current_menu->strings[idx],
+ current_menu->noremap[idx],
+ 0, TRUE,
+ current_menu->silent[idx]);
+ }
+ }
+#endif /* FEAT_GUI */
+ continue; /* try mapping again */
+ }
+
+ /* Partial match: get some more characters. When a
+ * matching mapping was found use that one. */
+ if (mp == NULL || keylen < 0)
+ keylen = KL_PART_KEY;
+ else
+ keylen = mp_match_len;
+ }
+
+ /* complete match */
+ if (keylen >= 0 && keylen <= typebuf.tb_len)
+ {
+ /* write chars to script file(s) */
+ if (keylen > typebuf.tb_maplen)
+ gotchars(typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_maplen,
+ keylen - typebuf.tb_maplen);
+
+ cmd_silent = (typebuf.tb_silent > 0);
+ del_typebuf(keylen, 0); /* remove the mapped keys */
+
+ /*
+ * Put the replacement string in front of mapstr.
+ * The depth check catches ":map x y" and ":map y x".
+ */
+ if (++mapdepth >= p_mmd)
+ {
+ EMSG(_("E223: recursive mapping"));
+ if (State & CMDLINE)
+ redrawcmdline();
+ else
+ setcursor();
+ flush_buffers(FALSE);
+ mapdepth = 0; /* for next one */
+ c = -1;
+ break;
+ }
+
+#ifdef FEAT_VISUAL
+ /*
+ * In Select mode, a Visual mode mapping is used.
+ * Switch to Visual mode temporarily. Append K_SELECT
+ * to switch back to Select mode.
+ */
+ if (VIsual_active && VIsual_select)
+ {
+ VIsual_select = FALSE;
+ (void)ins_typebuf(K_SELECT_STRING, REMAP_NONE,
+ 0, TRUE, FALSE);
+ }
+#endif
+
+ /*
+ * Insert the 'to' part in the typebuf.tb_buf.
+ * If 'from' field is the same as the start of the
+ * 'to' field, don't remap the first character.
+ * If m_noremap is set, don't remap the whole 'to'
+ * part.
+ */
+ if (ins_typebuf(mp->m_str,
+ mp->m_noremap != REMAP_YES
+ ? mp->m_noremap
+ : STRNCMP(mp->m_str, mp->m_keys,
+ (size_t)keylen)
+ ? REMAP_YES : 1,
+ 0, TRUE, cmd_silent || mp->m_silent) == FAIL)
+ {
+ c = -1;
+ break;
+ }
+ continue;
+ }
+ }
+
+/*
+ * get a character: 3. from the user - handle <Esc> in Insert mode
+ */
+ /*
+ * special case: if we get an <ESC> in insert mode and there
+ * are no more characters at once, we pretend to go out of
+ * insert mode. This prevents the one second delay after
+ * typing an <ESC>. If we get something after all, we may
+ * have to redisplay the mode. That the cursor is in the wrong
+ * place does not matter.
+ */
+ c = 0;
+#ifdef FEAT_CMDL_INFO
+ new_wcol = curwin->w_wcol;
+ new_wrow = curwin->w_wrow;
+#endif
+ if ( advance
+ && typebuf.tb_len == 1
+ && typebuf.tb_buf[typebuf.tb_off] == ESC
+ && !no_mapping
+#ifdef FEAT_EX_EXTRA
+ && ex_normal_busy == 0
+#endif
+ && typebuf.tb_maplen == 0
+ && (State & INSERT)
+ && (p_timeout || (keylen == KL_PART_KEY && p_ttimeout))
+ && (c = inchar(typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_len, 3, 25L,
+ typebuf.tb_change_cnt)) == 0)
+ {
+ colnr_T col = 0, vcol;
+ char_u *ptr;
+
+ if (p_smd)
+ {
+ unshowmode(TRUE);
+ mode_deleted = TRUE;
+ }
+#ifdef FEAT_GUI
+ /* may show different cursor shape */
+ if (gui.in_use)
+ {
+ int save_State;
+
+ save_State = State;
+ State = NORMAL;
+ gui_update_cursor(TRUE, FALSE);
+ State = save_State;
+ shape_changed = TRUE;
+ }
+#endif
+ validate_cursor();
+ old_wcol = curwin->w_wcol;
+ old_wrow = curwin->w_wrow;
+
+ /* move cursor left, if possible */
+ if (curwin->w_cursor.col != 0)
+ {
+ if (curwin->w_wcol > 0)
+ {
+ if (did_ai)
+ {
+ /*
+ * We are expecting to truncate the trailing
+ * white-space, so find the last non-white
+ * character -- webb
+ */
+ col = vcol = curwin->w_wcol = 0;
+ ptr = ml_get_curline();
+ while (col < curwin->w_cursor.col)
+ {
+ if (!vim_iswhite(ptr[col]))
+ curwin->w_wcol = vcol;
+ vcol += lbr_chartabsize(ptr + col,
+ (colnr_T)vcol);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ col += (*mb_ptr2len_check)(ptr + col);
+ else
+#endif
+ ++col;
+ }
+ curwin->w_wrow = curwin->w_cline_row
+ + curwin->w_wcol / W_WIDTH(curwin);
+ curwin->w_wcol %= W_WIDTH(curwin);
+ curwin->w_wcol += curwin_col_off();
+#ifdef FEAT_MBYTE
+ col = 0; /* no correction needed */
+#endif
+ }
+ else
+ {
+ --curwin->w_wcol;
+#ifdef FEAT_MBYTE
+ col = curwin->w_cursor.col - 1;
+#endif
+ }
+ }
+ else if (curwin->w_p_wrap && curwin->w_wrow)
+ {
+ --curwin->w_wrow;
+ curwin->w_wcol = W_WIDTH(curwin) - 1;
+#ifdef FEAT_MBYTE
+ col = curwin->w_cursor.col - 1;
+#endif
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte && col > 0 && curwin->w_wcol > 0)
+ {
+ /* Correct when the cursor is on the right halve
+ * of a double-wide character. */
+ ptr = ml_get_curline();
+ col -= (*mb_head_off)(ptr, ptr + col);
+ if ((*mb_ptr2cells)(ptr + col) > 1)
+ --curwin->w_wcol;
+ }
+#endif
+ }
+ setcursor();
+ out_flush();
+#ifdef FEAT_CMDL_INFO
+ new_wcol = curwin->w_wcol;
+ new_wrow = curwin->w_wrow;
+#endif
+ curwin->w_wcol = old_wcol;
+ curwin->w_wrow = old_wrow;
+ }
+ if (c < 0)
+ continue; /* end of input script reached */
+ typebuf.tb_len += c;
+
+ /* buffer full, don't map */
+ if (typebuf.tb_len >= typebuf.tb_maplen + MAXMAPLEN)
+ {
+ timedout = TRUE;
+ continue;
+ }
+
+#ifdef FEAT_EX_EXTRA
+ if (ex_normal_busy > 0)
+ {
+# ifdef FEAT_CMDWIN
+ static int tc = 0;
+# endif
+
+ /* No typeahead left and inside ":normal". Must return
+ * something to avoid getting stuck. When an incomplete
+ * mapping is present, behave like it timed out. */
+ if (typebuf.tb_len > 0)
+ {
+ timedout = TRUE;
+ continue;
+ }
+ /* When 'insertmode' is set, ESC just beeps in Insert
+ * mode. Use CTRL-L to make edit() return.
+ * For the command line only CTRL-C always breaks it.
+ * For the cmdline window: Alternate between ESC and
+ * CTRL-C: ESC for most situations and CTRL-C to close the
+ * cmdline window. */
+ if (p_im && (State & INSERT))
+ c = Ctrl_L;
+ else if ((State & CMDLINE)
+# ifdef FEAT_CMDWIN
+ || (cmdwin_type > 0 && tc == ESC)
+# endif
+ )
+ c = Ctrl_C;
+ else
+ c = ESC;
+# ifdef FEAT_CMDWIN
+ tc = c;
+# endif
+ break;
+ }
+#endif
+
+/*
+ * get a character: 3. from the user - update display
+ */
+ /* In insert mode a screen update is skipped when characters
+ * are still available. But when those available characters
+ * are part of a mapping, and we are going to do a blocking
+ * wait here. Need to update the screen to display the
+ * changed text so far. */
+ if ((State & INSERT) && advance && must_redraw != 0)
+ {
+ update_screen(0);
+ setcursor(); /* put cursor back where it belongs */
+ }
+
+ /*
+ * If we have a partial match (and are going to wait for more
+ * input from the user), show the partially matched characters
+ * to the user with showcmd.
+ */
+#ifdef FEAT_CMDL_INFO
+ i = 0;
+#endif
+ c1 = 0;
+ if (typebuf.tb_len > 0 && advance && !exmode_active)
+ {
+ if (((State & (NORMAL | INSERT)) || State == LANGMAP)
+ && State != HITRETURN)
+ {
+ /* this looks nice when typing a dead character map */
+ if (State & INSERT
+ && ptr2cells(typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_len - 1) == 1)
+ {
+ edit_putchar(typebuf.tb_buf[typebuf.tb_off
+ + typebuf.tb_len - 1], FALSE);
+ setcursor(); /* put cursor back where it belongs */
+ c1 = 1;
+ }
+#ifdef FEAT_CMDL_INFO
+ /* need to use the col and row from above here */
+ old_wcol = curwin->w_wcol;
+ old_wrow = curwin->w_wrow;
+ curwin->w_wcol = new_wcol;
+ curwin->w_wrow = new_wrow;
+ push_showcmd();
+ if (typebuf.tb_len > SHOWCMD_COLS)
+ i = typebuf.tb_len - SHOWCMD_COLS;
+ while (i < typebuf.tb_len)
+ (void)add_to_showcmd(typebuf.tb_buf[typebuf.tb_off
+ + i++]);
+ curwin->w_wcol = old_wcol;
+ curwin->w_wrow = old_wrow;
+#endif
+ }
+
+ /* this looks nice when typing a dead character map */
+ if ((State & CMDLINE)
+#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+ && cmdline_star == 0
+#endif
+ && ptr2cells(typebuf.tb_buf + typebuf.tb_off
+ + typebuf.tb_len - 1) == 1)
+ {
+ putcmdline(typebuf.tb_buf[typebuf.tb_off
+ + typebuf.tb_len - 1], FALSE);
+ c1 = 1;
+ }
+ }
+
+/*
+ * get a character: 3. from the user - get it
+ */
+ c = inchar(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len,
+ typebuf.tb_buflen - typebuf.tb_off - typebuf.tb_len - 1,
+ !advance
+ ? 0
+ : ((typebuf.tb_len == 0
+ || !(p_timeout || (p_ttimeout
+ && keylen == KL_PART_KEY)))
+ ? -1L
+ : ((keylen == KL_PART_KEY && p_ttm >= 0)
+ ? p_ttm
+ : p_tm)), typebuf.tb_change_cnt);
+
+#ifdef FEAT_CMDL_INFO
+ if (i != 0)
+ pop_showcmd();
+#endif
+ if (c1 == 1)
+ {
+ if (State & INSERT)
+ edit_unputchar();
+ if (State & CMDLINE)
+ unputcmdline();
+ setcursor(); /* put cursor back where it belongs */
+ }
+
+ if (c < 0)
+ continue; /* end of input script reached */
+ if (c == NUL) /* no character available */
+ {
+ if (!advance)
+ break;
+ if (typebuf.tb_len > 0) /* timed out */
+ {
+ timedout = TRUE;
+ continue;
+ }
+ }
+ else
+ { /* allow mapping for just typed characters */
+ while (typebuf.tb_buf[typebuf.tb_off
+ + typebuf.tb_len] != NUL)
+ typebuf.tb_noremap[typebuf.tb_off
+ + typebuf.tb_len++] = RM_YES;
+#ifdef USE_IM_CONTROL
+ /* Get IM status right after getting keys, not after the
+ * timeout for a mapping (focus may be lost by then). */
+ vgetc_im_active = im_get_status();
+#endif
+ }
+ } /* for (;;) */
+ } /* if (!character from stuffbuf) */
+
+ /* if advance is FALSE don't loop on NULs */
+ } while (c < 0 || (advance && c == NUL));
+
+ /*
+ * The "INSERT" message is taken care of here:
+ * if we return an ESC to exit insert mode, the message is deleted
+ * if we don't return an ESC but deleted the message before, redisplay it
+ */
+ if (advance && p_smd && (State & INSERT))
+ {
+ if (c == ESC && !mode_deleted && !no_mapping)
+ {
+ if (typebuf.tb_len && !KeyTyped)
+ redraw_cmdline = TRUE; /* delete mode later */
+ else
+ unshowmode(FALSE);
+ }
+ else if (c != ESC && mode_deleted)
+ {
+ if (typebuf.tb_len && !KeyTyped)
+ redraw_cmdline = TRUE; /* show mode later */
+ else
+ showmode();
+ }
+ }
+#ifdef FEAT_GUI
+ /* may unshow different cursor shape */
+ if (gui.in_use && shape_changed)
+ gui_update_cursor(TRUE, FALSE);
+#endif
+
+ vgetc_busy = FALSE;
+
+ return c;
+}
+
+/*
+ * inchar() - get one character from
+ * 1. a scriptfile
+ * 2. the keyboard
+ *
+ * As much characters as we can get (upto 'maxlen') are put in "buf" and
+ * NUL terminated (buffer length must be 'maxlen' + 1).
+ * Minimum for "maxlen" is 3!!!!
+ *
+ * "tb_change_cnt" is the value of typebuf.tb_change_cnt if "buf" points into
+ * it. When typebuf.tb_change_cnt changes (e.g., when a message is received
+ * from a remote client) "buf" can no longer be used. "tb_change_cnt" is 0
+ * otherwise.
+ *
+ * If we got an interrupt all input is read until none is available.
+ *
+ * If wait_time == 0 there is no waiting for the char.
+ * If wait_time == n we wait for n msec for a character to arrive.
+ * If wait_time == -1 we wait forever for a character to arrive.
+ *
+ * Return the number of obtained characters.
+ * Return -1 when end of input script reached.
+ */
+ int
+inchar(buf, maxlen, wait_time, tb_change_cnt)
+ char_u *buf;
+ int maxlen;
+ long wait_time; /* milli seconds */
+ int tb_change_cnt;
+{
+ int len = 0; /* init for GCC */
+ int retesc = FALSE; /* return ESC with gotint */
+ int script_char;
+
+ if (wait_time == -1L || wait_time > 100L) /* flush output before waiting */
+ {
+ cursor_on();
+ out_flush();
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_update_cursor(FALSE, FALSE);
+# ifdef FEAT_MOUSESHAPE
+ if (postponed_mouseshape)
+ update_mouseshape(-1);
+# endif
+ }
+#endif
+ }
+
+ /*
+ * Don't reset these when at the hit-return prompt, otherwise a endless
+ * recursive loop may result (write error in swapfile, hit-return, timeout
+ * on char wait, flush swapfile, write error....).
+ */
+ if (State != HITRETURN)
+ {
+ did_outofmem_msg = FALSE; /* display out of memory message (again) */
+ did_swapwrite_msg = FALSE; /* display swap file write error again */
+ }
+ undo_off = FALSE; /* restart undo now */
+
+ /*
+ * first try script file
+ * If interrupted: Stop reading script files.
+ */
+ script_char = -1;
+ while (scriptin[curscript] != NULL && script_char < 0)
+ {
+ if (got_int || (script_char = getc(scriptin[curscript])) < 0)
+ {
+ /* Reached EOF.
+ * Careful: closescript() frees typebuf.tb_buf[] and buf[] may
+ * point inside typebuf.tb_buf[]. Don't use buf[] after this! */
+ closescript();
+ /*
+ * When reading script file is interrupted, return an ESC to get
+ * back to normal mode.
+ * Otherwise return -1, because typebuf.tb_buf[] has changed.
+ */
+ if (got_int)
+ retesc = TRUE;
+ else
+ return -1;
+ }
+ else
+ {
+ buf[0] = script_char;
+ len = 1;
+ }
+ }
+
+ if (script_char < 0) /* did not get a character from script */
+ {
+ /*
+ * If we got an interrupt, skip all previously typed characters and
+ * return TRUE if quit reading script file.
+ * Stop reading typeahead when a single CTRL-C was read,
+ * fill_input_buf() returns this when not able to read from stdin.
+ * Don't use buf[] here, closescript() may have freed typebuf.tb_buf[]
+ * and buf may be pointing inside typebuf.tb_buf[].
+ */
+ if (got_int)
+ {
+#define DUM_LEN MAXMAPLEN * 3 + 3
+ char_u dum[DUM_LEN + 1];
+
+ for (;;)
+ {
+ len = ui_inchar(dum, DUM_LEN, 0L, 0);
+ if (len == 0 || (len == 1 && dum[0] == 3))
+ break;
+ }
+ return retesc;
+ }
+
+ /*
+ * Always flush the output characters when getting input characters
+ * from the user.
+ */
+ out_flush();
+
+ /*
+ * Fill up to a third of the buffer, because each character may be
+ * tripled below.
+ */
+ len = ui_inchar(buf, maxlen / 3, wait_time, tb_change_cnt);
+ }
+
+ if (typebuf_changed(tb_change_cnt))
+ return 0;
+
+ return fix_input_buffer(buf, len, script_char >= 0);
+}
+
+/*
+ * Fix typed characters for use by vgetc() and check_termcode().
+ * buf[] must have room to triple the number of bytes!
+ * Returns the new length.
+ */
+ int
+fix_input_buffer(buf, len, script)
+ char_u *buf;
+ int len;
+ int script; /* TRUE when reading from a script */
+{
+ int i;
+ char_u *p = buf;
+
+ /*
+ * Two characters are special: NUL and K_SPECIAL.
+ * When compiled With the GUI CSI is also special.
+ * Replace NUL by K_SPECIAL KS_ZERO KE_FILLER
+ * Replace K_SPECIAL by K_SPECIAL KS_SPECIAL KE_FILLER
+ * Replace CSI by K_SPECIAL KS_EXTRA KE_CSI
+ * Don't replace K_SPECIAL when reading a script file.
+ */
+ for (i = len; --i >= 0; ++p)
+ {
+#ifdef FEAT_GUI
+ /* When the GUI is used any character can come after a CSI, don't
+ * escape it. */
+ if (gui.in_use && p[0] == CSI && i >= 2)
+ {
+ p += 2;
+ i -= 2;
+ }
+ /* When the GUI is not used CSI needs to be escaped. */
+ else if (!gui.in_use && p[0] == CSI)
+ {
+ mch_memmove(p + 3, p + 1, (size_t)i);
+ *p++ = K_SPECIAL;
+ *p++ = KS_EXTRA;
+ *p = (int)KE_CSI;
+ len += 2;
+ }
+ else
+#endif
+ if (p[0] == NUL || (p[0] == K_SPECIAL && !script
+#if defined(WIN3264) && !defined(FEAT_GUI)
+ /* Win32 console passes modifiers */
+ && (i < 2 || p[1] != KS_MODIFIER)
+#endif
+ ))
+ {
+ mch_memmove(p + 3, p + 1, (size_t)i);
+ p[2] = K_THIRD(p[0]);
+ p[1] = K_SECOND(p[0]);
+ p[0] = K_SPECIAL;
+ p += 2;
+ len += 2;
+ }
+ }
+ *p = NUL; /* add trailing NUL */
+ return len;
+}
+
+#if defined(USE_INPUT_BUF) || defined(PROTO)
+/*
+ * Return TRUE when bytes are in the input buffer or in the typeahead buffer.
+ * Normally the input buffer would be sufficient, but the server_to_input_buf()
+ * may insert characters in the typeahead buffer while we are waiting for
+ * input to arrive.
+ */
+ int
+input_available()
+{
+ return (!vim_is_input_buf_empty()
+# ifdef FEAT_CLIENTSERVER
+ || received_from_client
+# endif
+ );
+}
+#endif
+
+/*
+ * map[!] : show all key mappings
+ * map[!] {lhs} : show key mapping for {lhs}
+ * map[!] {lhs} {rhs} : set key mapping for {lhs} to {rhs}
+ * noremap[!] {lhs} {rhs} : same, but no remapping for {rhs}
+ * unmap[!] {lhs} : remove key mapping for {lhs}
+ * abbr : show all abbreviations
+ * abbr {lhs} : show abbreviations for {lhs}
+ * abbr {lhs} {rhs} : set abbreviation for {lhs} to {rhs}
+ * noreabbr {lhs} {rhs} : same, but no remapping for {rhs}
+ * unabbr {lhs} : remove abbreviation for {lhs}
+ *
+ * maptype: 0 for :map, 1 for :unmap, 2 for noremap.
+ *
+ * arg is pointer to any arguments. Note: arg cannot be a read-only string,
+ * it will be modified.
+ *
+ * for :map mode is NORMAL + VISUAL + OP_PENDING
+ * for :map! mode is INSERT + CMDLINE
+ * for :cmap mode is CMDLINE
+ * for :imap mode is INSERT
+ * for :lmap mode is LANGMAP
+ * for :nmap mode is NORMAL
+ * for :vmap mode is VISUAL
+ * for :omap mode is OP_PENDING
+ *
+ * for :abbr mode is INSERT + CMDLINE
+ * for :iabbr mode is INSERT
+ * for :cabbr mode is CMDLINE
+ *
+ * Return 0 for success
+ * 1 for invalid arguments
+ * 2 for no match
+ * 4 for out of mem
+ * 5 for entry not unique
+ */
+ int
+do_map(maptype, arg, mode, abbrev)
+ int maptype;
+ char_u *arg;
+ int mode;
+ int abbrev; /* not a mapping but an abbreviation */
+{
+ char_u *keys;
+ mapblock_T *mp, **mpp;
+ char_u *rhs;
+ char_u *p;
+ int n;
+ int len = 0; /* init for GCC */
+ char_u *newstr;
+ int hasarg;
+ int haskey;
+ int did_it = FALSE;
+#ifdef FEAT_LOCALMAP
+ int did_local = FALSE;
+#endif
+ int round;
+ char_u *keys_buf = NULL;
+ char_u *arg_buf = NULL;
+ int retval = 0;
+ int do_backslash;
+ int hash;
+ int new_hash;
+ mapblock_T **abbr_table;
+ mapblock_T **map_table;
+ int unique = FALSE;
+ int silent = FALSE;
+ int noremap;
+
+ keys = arg;
+ map_table = maphash;
+ abbr_table = &first_abbr;
+
+ /* For ":noremap" don't remap, otherwise do remap. */
+ if (maptype == 2)
+ noremap = REMAP_NONE;
+ else
+ noremap = REMAP_YES;
+
+ /* Accept <buffer>, <silent>, <script> and <unique> in any order. */
+ for (;;)
+ {
+#ifdef FEAT_LOCALMAP
+ /*
+ * Check for "<buffer>": mapping local to buffer.
+ */
+ if (STRNCMP(keys, "<buffer>", 8) == 0)
+ {
+ keys = skipwhite(keys + 8);
+ map_table = curbuf->b_maphash;
+ abbr_table = &curbuf->b_first_abbr;
+ continue;
+ }
+#endif
+
+ /*
+ * Check for "<silent>": don't echo commands.
+ */
+ if (STRNCMP(keys, "<silent>", 8) == 0)
+ {
+ keys = skipwhite(keys + 8);
+ silent = TRUE;
+ continue;
+ }
+
+#ifdef FEAT_EVAL
+ /*
+ * Check for "<script>": remap script-local mappings only
+ */
+ if (STRNCMP(keys, "<script>", 8) == 0)
+ {
+ keys = skipwhite(keys + 8);
+ noremap = REMAP_SCRIPT;
+ continue;
+ }
+#endif
+ /*
+ * Check for "<unique>": don't overwrite an existing mapping.
+ */
+ if (STRNCMP(keys, "<unique>", 8) == 0)
+ {
+ keys = skipwhite(keys + 8);
+ unique = TRUE;
+ continue;
+ }
+ break;
+ }
+
+ validate_maphash();
+
+ /*
+ * find end of keys and skip CTRL-Vs (and backslashes) in it
+ * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'.
+ * with :unmap white space is included in the keys, no argument possible
+ */
+ p = keys;
+ do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
+ while (*p && (maptype == 1 || !vim_iswhite(*p)))
+ {
+ if ((p[0] == Ctrl_V || (do_backslash && p[0] == '\\')) &&
+ p[1] != NUL)
+ ++p; /* skip CTRL-V or backslash */
+ ++p;
+ }
+ if (*p != NUL)
+ *p++ = NUL;
+ p = skipwhite(p);
+ rhs = p;
+ hasarg = (*rhs != NUL);
+ haskey = (*keys != NUL);
+
+ /* check for :unmap without argument */
+ if (maptype == 1 && !haskey)
+ {
+ retval = 1;
+ goto theend;
+ }
+
+ /*
+ * If mapping has been given as ^V<C_UP> say, then replace the term codes
+ * with the appropriate two bytes. If it is a shifted special key, unshift
+ * it too, giving another two bytes.
+ * replace_termcodes() may move the result to allocated memory, which
+ * needs to be freed later (*keys_buf and *arg_buf).
+ * replace_termcodes() also removes CTRL-Vs and sometimes backslashes.
+ */
+ if (haskey)
+ keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE);
+ if (hasarg)
+ {
+ if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */
+ rhs = (char_u *)"";
+ else
+ rhs = replace_termcodes(rhs, &arg_buf, FALSE, TRUE);
+ }
+
+#ifdef FEAT_FKMAP
+ /*
+ * when in right-to-left mode and alternate keymap option set,
+ * reverse the character flow in the rhs in Farsi.
+ */
+ if (p_altkeymap && curwin->w_p_rl)
+ lrswap(rhs);
+#endif
+
+ /*
+ * check arguments and translate function keys
+ */
+ if (haskey)
+ {
+ len = (int)STRLEN(keys);
+ if (len > MAXMAPLEN) /* maximum length of MAXMAPLEN chars */
+ {
+ retval = 1;
+ goto theend;
+ }
+
+ if (abbrev && maptype != 1)
+ {
+ /*
+ * If an abbreviation ends in a keyword character, the
+ * rest must be all keyword-char or all non-keyword-char.
+ * Otherwise we won't be able to find the start of it in a
+ * vi-compatible way.
+ */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int first, last;
+ int same = -1;
+
+ first = vim_iswordp(keys);
+ last = first;
+ p = keys + mb_ptr2len_check(keys);
+ n = 1;
+ while (p < keys + len)
+ {
+ ++n; /* nr of (multi-byte) chars */
+ last = vim_iswordp(p); /* type of last char */
+ if (same == -1 && last != first)
+ same = n - 1; /* count of same char type */
+ p += mb_ptr2len_check(p);
+ }
+ if (last && n > 2 && same >= 0 && same < n - 1)
+ {
+ retval = 1;
+ goto theend;
+ }
+ }
+ else
+#endif
+ if (vim_iswordc(keys[len - 1])) /* ends in keyword char */
+ for (n = 0; n < len - 2; ++n)
+ if (vim_iswordc(keys[n]) != vim_iswordc(keys[len - 2]))
+ {
+ retval = 1;
+ goto theend;
+ }
+ /* An abbrevation cannot contain white space. */
+ for (n = 0; n < len; ++n)
+ if (vim_iswhite(keys[n]))
+ {
+ retval = 1;
+ goto theend;
+ }
+ }
+ }
+
+ if (haskey && hasarg && abbrev) /* if we will add an abbreviation */
+ no_abbr = FALSE; /* reset flag that indicates there are
+ no abbreviations */
+
+ if (!haskey || (maptype != 1 && !hasarg))
+ msg_start();
+
+#ifdef FEAT_LOCALMAP
+ /*
+ * Check if a new local mapping wasn't already defined globally.
+ */
+ if (map_table == curbuf->b_maphash && haskey && hasarg && maptype != 1)
+ {
+ /* need to loop over all global hash lists */
+ for (hash = 0; hash < 256 && !got_int; ++hash)
+ {
+ if (abbrev)
+ {
+ if (hash != 0) /* there is only one abbreviation list */
+ break;
+ mp = first_abbr;
+ }
+ else
+ mp = maphash[hash];
+ for ( ; mp != NULL && !got_int; mp = mp->m_next)
+ {
+ /* check entries with the same mode */
+ if ((mp->m_mode & mode) != 0
+ && mp->m_keylen == len
+ && unique
+ && STRNCMP(mp->m_keys, keys, (size_t)len) == 0)
+ {
+ if (abbrev)
+ EMSG2(_("E224: global abbreviation already exists for %s"),
+ mp->m_keys);
+ else
+ EMSG2(_("E225: global mapping already exists for %s"),
+ mp->m_keys);
+ retval = 5;
+ goto theend;
+ }
+ }
+ }
+ }
+
+ /*
+ * When listing global mappings, also list buffer-local ones here.
+ */
+ if (map_table != curbuf->b_maphash && !hasarg && maptype != 1)
+ {
+ /* need to loop over all global hash lists */
+ for (hash = 0; hash < 256 && !got_int; ++hash)
+ {
+ if (abbrev)
+ {
+ if (hash != 0) /* there is only one abbreviation list */
+ break;
+ mp = curbuf->b_first_abbr;
+ }
+ else
+ mp = curbuf->b_maphash[hash];
+ for ( ; mp != NULL && !got_int; mp = mp->m_next)
+ {
+ /* check entries with the same mode */
+ if ((mp->m_mode & mode) != 0)
+ {
+ if (!haskey) /* show all entries */
+ {
+ showmap(mp, TRUE);
+ did_local = TRUE;
+ }
+ else
+ {
+ n = mp->m_keylen;
+ if (STRNCMP(mp->m_keys, keys,
+ (size_t)(n < len ? n : len)) == 0)
+ {
+ showmap(mp, TRUE);
+ did_local = TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
+#endif
+
+ /*
+ * Find an entry in the maphash[] list that matches.
+ * For :unmap we may loop two times: once to try to unmap an entry with a
+ * matching 'from' part, a second time, if the first fails, to unmap an
+ * entry with a matching 'to' part. This was done to allow ":ab foo bar"
+ * to be unmapped by typing ":unab foo", where "foo" will be replaced by
+ * "bar" because of the abbreviation.
+ */
+ for (round = 0; (round == 0 || maptype == 1) && round <= 1
+ && !did_it && !got_int; ++round)
+ {
+ /* need to loop over all hash lists */
+ for (hash = 0; hash < 256 && !got_int; ++hash)
+ {
+ if (abbrev)
+ {
+ if (hash != 0) /* there is only one abbreviation list */
+ break;
+ mpp = abbr_table;
+ }
+ else
+ mpp = &(map_table[hash]);
+ for (mp = *mpp; mp != NULL && !got_int; mp = *mpp)
+ {
+
+ if (!(mp->m_mode & mode)) /* skip entries with wrong mode */
+ {
+ mpp = &(mp->m_next);
+ continue;
+ }
+ if (!haskey) /* show all entries */
+ {
+ showmap(mp, map_table != maphash);
+ did_it = TRUE;
+ }
+ else /* do we have a match? */
+ {
+ if (round) /* second round: Try unmap "rhs" string */
+ {
+ n = (int)STRLEN(mp->m_str);
+ p = mp->m_str;
+ }
+ else
+ {
+ n = mp->m_keylen;
+ p = mp->m_keys;
+ }
+ if (STRNCMP(p, keys, (size_t)(n < len ? n : len)) == 0)
+ {
+ if (maptype == 1) /* delete entry */
+ {
+ /* Only accept a full match. For abbreviations we
+ * ignore trailing space when matching with the
+ * "lhs", since an abbreviation can't have
+ * trailing space. */
+ if (n != len && (!abbrev || round || n > len
+ || *skipwhite(keys + n) != NUL))
+ {
+ mpp = &(mp->m_next);
+ continue;
+ }
+ /*
+ * We reset the indicated mode bits. If nothing is
+ * left the entry is deleted below.
+ */
+ mp->m_mode &= ~mode;
+ did_it = TRUE; /* remember we did something */
+ }
+ else if (!hasarg) /* show matching entry */
+ {
+ showmap(mp, map_table != maphash);
+ did_it = TRUE;
+ }
+ else if (n != len) /* new entry is ambigious */
+ {
+ mpp = &(mp->m_next);
+ continue;
+ }
+ else if (unique)
+ {
+ if (abbrev)
+ EMSG2(_("E226: abbreviation already exists for %s"),
+ p);
+ else
+ EMSG2(_("E227: mapping already exists for %s"), p);
+ retval = 5;
+ goto theend;
+ }
+ else /* new rhs for existing entry */
+ {
+ mp->m_mode &= ~mode; /* remove mode bits */
+ if (mp->m_mode == 0 && !did_it) /* reuse entry */
+ {
+ newstr = vim_strsave(rhs);
+ if (newstr == NULL)
+ {
+ retval = 4; /* no mem */
+ goto theend;
+ }
+ vim_free(mp->m_str);
+ mp->m_str = newstr;
+ mp->m_noremap = noremap;
+ mp->m_silent = silent;
+ mp->m_mode = mode;
+ did_it = TRUE;
+ }
+ }
+ if (mp->m_mode == 0) /* entry can be deleted */
+ {
+ map_free(mpp);
+ continue; /* continue with *mpp */
+ }
+
+ /*
+ * May need to put this entry into another hash list.
+ */
+ new_hash = MAP_HASH(mp->m_mode, mp->m_keys[0]);
+ if (!abbrev && new_hash != hash)
+ {
+ *mpp = mp->m_next;
+ mp->m_next = map_table[new_hash];
+ map_table[new_hash] = mp;
+
+ continue; /* continue with *mpp */
+ }
+ }
+ }
+ mpp = &(mp->m_next);
+ }
+ }
+ }
+
+ if (maptype == 1) /* delete entry */
+ {
+ if (!did_it)
+ retval = 2; /* no match */
+ goto theend;
+ }
+
+ if (!haskey || !hasarg) /* print entries */
+ {
+ if (!did_it
+#ifdef FEAT_LOCALMAP
+ && !did_local
+#endif
+ )
+ {
+ if (abbrev)
+ MSG(_("No abbreviation found"));
+ else
+ MSG(_("No mapping found"));
+ }
+ goto theend; /* listing finished */
+ }
+
+ if (did_it) /* have added the new entry already */
+ goto theend;
+
+ /*
+ * Get here when adding a new entry to the maphash[] list or abbrlist.
+ */
+ mp = (mapblock_T *)alloc((unsigned)sizeof(mapblock_T));
+ if (mp == NULL)
+ {
+ retval = 4; /* no mem */
+ goto theend;
+ }
+
+ /* If CTRL-C has been mapped, don't always use it for Interrupting */
+ if (*keys == Ctrl_C)
+ mapped_ctrl_c = TRUE;
+
+ mp->m_keys = vim_strsave(keys);
+ mp->m_str = vim_strsave(rhs);
+ if (mp->m_keys == NULL || mp->m_str == NULL)
+ {
+ vim_free(mp->m_keys);
+ vim_free(mp->m_str);
+ vim_free(mp);
+ retval = 4; /* no mem */
+ goto theend;
+ }
+ mp->m_keylen = (int)STRLEN(mp->m_keys);
+ mp->m_noremap = noremap;
+ mp->m_silent = silent;
+ mp->m_mode = mode;
+
+ /* add the new entry in front of the abbrlist or maphash[] list */
+ if (abbrev)
+ {
+ mp->m_next = *abbr_table;
+ *abbr_table = mp;
+ }
+ else
+ {
+ n = MAP_HASH(mp->m_mode, mp->m_keys[0]);
+ mp->m_next = map_table[n];
+ map_table[n] = mp;
+ }
+
+theend:
+ vim_free(keys_buf);
+ vim_free(arg_buf);
+ return retval;
+}
+
+/*
+ * Delete one entry from the abbrlist or maphash[].
+ * "mpp" is a pointer to the m_next field of the PREVIOUS entry!
+ */
+ static void
+map_free(mpp)
+ mapblock_T **mpp;
+{
+ mapblock_T *mp;
+
+ mp = *mpp;
+ vim_free(mp->m_keys);
+ vim_free(mp->m_str);
+ *mpp = mp->m_next;
+ vim_free(mp);
+}
+
+/*
+ * Initialize maphash[] for first use.
+ */
+ static void
+validate_maphash()
+{
+ if (!maphash_valid)
+ {
+ vim_memset(maphash, 0, sizeof(maphash));
+ maphash_valid = TRUE;
+ }
+}
+
+/*
+ * Get the mapping mode from the command name.
+ */
+ int
+get_map_mode(cmdp, forceit)
+ char_u **cmdp;
+ int forceit;
+{
+ char_u *p;
+ int modec;
+ int mode;
+
+ p = *cmdp;
+ modec = *p++;
+ if (modec == 'i')
+ mode = INSERT; /* :imap */
+ else if (modec == 'l')
+ mode = LANGMAP; /* :lmap */
+ else if (modec == 'c')
+ mode = CMDLINE; /* :cmap */
+ else if (modec == 'n' && *p != 'o') /* avoid :noremap */
+ mode = NORMAL; /* :nmap */
+ else if (modec == 'v')
+ mode = VISUAL; /* :vmap */
+ else if (modec == 'o')
+ mode = OP_PENDING; /* :omap */
+ else
+ {
+ --p;
+ if (forceit)
+ mode = INSERT + CMDLINE; /* :map ! */
+ else
+ mode = VISUAL + NORMAL + OP_PENDING;/* :map */
+ }
+
+ *cmdp = p;
+ return mode;
+}
+
+/*
+ * Clear all mappings or abbreviations.
+ * 'abbr' should be FALSE for mappings, TRUE for abbreviations.
+ */
+/*ARGSUSED*/
+ void
+map_clear(cmdp, arg, forceit, abbr)
+ char_u *cmdp;
+ char_u *arg;
+ int forceit;
+ int abbr;
+{
+ int mode;
+#ifdef FEAT_LOCALMAP
+ int local;
+
+ local = (STRCMP(arg, "<buffer>") == 0);
+ if (!local && *arg != NUL)
+ {
+ EMSG(_(e_invarg));
+ return;
+ }
+#endif
+
+ mode = get_map_mode(&cmdp, forceit);
+ map_clear_int(curbuf, mode,
+#ifdef FEAT_LOCALMAP
+ local,
+#else
+ FALSE,
+#endif
+ abbr);
+}
+
+/*
+ * Clear all mappings in "mode".
+ */
+/*ARGSUSED*/
+ void
+map_clear_int(buf, mode, local, abbr)
+ buf_T *buf; /* buffer for local mappings */
+ int mode; /* mode in which to delete */
+ int local; /* TRUE for buffer-local mappings */
+ int abbr; /* TRUE for abbreviations */
+{
+ mapblock_T *mp, **mpp;
+ int hash;
+ int new_hash;
+
+ validate_maphash();
+
+ for (hash = 0; hash < 256; ++hash)
+ {
+ if (abbr)
+ {
+ if (hash) /* there is only one abbrlist */
+ break;
+#ifdef FEAT_LOCALMAP
+ if (local)
+ mpp = &buf->b_first_abbr;
+ else
+#endif
+ mpp = &first_abbr;
+ }
+ else
+ {
+#ifdef FEAT_LOCALMAP
+ if (local)
+ mpp = &buf->b_maphash[hash];
+ else
+#endif
+ mpp = &maphash[hash];
+ }
+ while (*mpp != NULL)
+ {
+ mp = *mpp;
+ if (mp->m_mode & mode)
+ {
+ mp->m_mode &= ~mode;
+ if (mp->m_mode == 0) /* entry can be deleted */
+ {
+ map_free(mpp);
+ continue;
+ }
+ /*
+ * May need to put this entry into another hash list.
+ */
+ new_hash = MAP_HASH(mp->m_mode, mp->m_keys[0]);
+ if (!abbr && new_hash != hash)
+ {
+ *mpp = mp->m_next;
+#ifdef FEAT_LOCALMAP
+ if (local)
+ {
+ mp->m_next = buf->b_maphash[new_hash];
+ buf->b_maphash[new_hash] = mp;
+ }
+ else
+#endif
+ {
+ mp->m_next = maphash[new_hash];
+ maphash[new_hash] = mp;
+ }
+ continue; /* continue with *mpp */
+ }
+ }
+ mpp = &(mp->m_next);
+ }
+ }
+}
+
+ static void
+showmap(mp, local)
+ mapblock_T *mp;
+ int local; /* TRUE for buffer-local map */
+{
+ int len = 1;
+
+ if (msg_didout || msg_silent != 0)
+ msg_putchar('\n');
+ if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE)
+ msg_putchar('!'); /* :map! */
+ else if (mp->m_mode & INSERT)
+ msg_putchar('i'); /* :imap */
+ else if (mp->m_mode & LANGMAP)
+ msg_putchar('l'); /* :lmap */
+ else if (mp->m_mode & CMDLINE)
+ msg_putchar('c'); /* :cmap */
+ else if ((mp->m_mode & (NORMAL + VISUAL + OP_PENDING))
+ == NORMAL + VISUAL + OP_PENDING)
+ msg_putchar(' '); /* :map */
+ else
+ {
+ len = 0;
+ if (mp->m_mode & NORMAL)
+ {
+ msg_putchar('n'); /* :nmap */
+ ++len;
+ }
+ if (mp->m_mode & OP_PENDING)
+ {
+ msg_putchar('o'); /* :omap */
+ ++len;
+ }
+ if (mp->m_mode & VISUAL)
+ {
+ msg_putchar('v'); /* :vmap */
+ ++len;
+ }
+ }
+ while (++len <= 3)
+ msg_putchar(' ');
+
+ /* Get length of what we write */
+ len = msg_outtrans_special(mp->m_keys, TRUE);
+ do
+ {
+ msg_putchar(' '); /* padd with blanks */
+ ++len;
+ } while (len < 12);
+
+ if (mp->m_noremap == REMAP_NONE)
+ msg_puts_attr((char_u *)"*", hl_attr(HLF_8));
+ else if (mp->m_noremap == REMAP_SCRIPT)
+ msg_puts_attr((char_u *)"&", hl_attr(HLF_8));
+ else
+ msg_putchar(' ');
+
+ if (local)
+ msg_putchar('@');
+ else
+ msg_putchar(' ');
+
+ /* Use FALSE below if we only want things like <Up> to show up as such on
+ * the rhs, and not M-x etc, TRUE gets both -- webb
+ */
+ if (*mp->m_str == NUL)
+ msg_puts_attr((char_u *)"<Nop>", hl_attr(HLF_8));
+ else
+ msg_outtrans_special(mp->m_str, FALSE);
+ out_flush(); /* show one line at a time */
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return TRUE if a map exists that has "str" in the rhs for mode "modechars".
+ * Recognize termcap codes in "str".
+ * Also checks mappings local to the current buffer.
+ */
+ int
+map_to_exists(str, modechars)
+ char_u *str;
+ char_u *modechars;
+{
+ int mode = 0;
+ char_u *rhs;
+ char_u *buf;
+ int retval;
+
+ rhs = replace_termcodes(str, &buf, FALSE, TRUE);
+
+ if (vim_strchr(modechars, 'n') != NULL)
+ mode |= NORMAL;
+ if (vim_strchr(modechars, 'v') != NULL)
+ mode |= VISUAL;
+ if (vim_strchr(modechars, 'o') != NULL)
+ mode |= OP_PENDING;
+ if (vim_strchr(modechars, 'i') != NULL)
+ mode |= INSERT;
+ if (vim_strchr(modechars, 'l') != NULL)
+ mode |= LANGMAP;
+ if (vim_strchr(modechars, 'c') != NULL)
+ mode |= CMDLINE;
+
+ retval = map_to_exists_mode(rhs, mode);
+ vim_free(buf);
+
+ return retval;
+}
+#endif
+
+/*
+ * Return TRUE if a map exists that has "str" in the rhs for mode "mode".
+ * Also checks mappings local to the current buffer.
+ */
+ int
+map_to_exists_mode(rhs, mode)
+ char_u *rhs;
+ int mode;
+{
+ mapblock_T *mp;
+ int hash;
+# ifdef FEAT_LOCALMAP
+ int expand_buffer = FALSE;
+
+ validate_maphash();
+
+ /* Do it twice: once for global maps and once for local maps. */
+ for (;;)
+ {
+# endif
+ for (hash = 0; hash < 256; ++hash)
+ {
+# ifdef FEAT_LOCALMAP
+ if (expand_buffer)
+ mp = curbuf->b_maphash[hash];
+ else
+# endif
+ mp = maphash[hash];
+ for (; mp; mp = mp->m_next)
+ {
+ if ((mp->m_mode & mode)
+ && strstr((char *)mp->m_str, (char *)rhs) != NULL)
+ return TRUE;
+ }
+ }
+# ifdef FEAT_LOCALMAP
+ if (expand_buffer)
+ break;
+ expand_buffer = TRUE;
+ }
+# endif
+
+ return FALSE;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Used below when expanding mapping/abbreviation names.
+ */
+static int expand_mapmodes = 0;
+static int expand_isabbrev = 0;
+#ifdef FEAT_LOCALMAP
+static int expand_buffer = FALSE;
+#endif
+
+/*
+ * Work out what to complete when doing command line completion of mapping
+ * or abbreviation names.
+ */
+ char_u *
+set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx)
+ expand_T *xp;
+ char_u *cmd;
+ char_u *arg;
+ int forceit; /* TRUE if '!' given */
+ int isabbrev; /* TRUE if abbreviation */
+ int isunmap; /* TRUE if unmap/unabbrev command */
+ cmdidx_T cmdidx;
+{
+ if (forceit && cmdidx != CMD_map && cmdidx != CMD_unmap)
+ xp->xp_context = EXPAND_NOTHING;
+ else
+ {
+ if (isunmap)
+ expand_mapmodes = get_map_mode(&cmd, forceit || isabbrev);
+ else
+ {
+ expand_mapmodes = INSERT + CMDLINE;
+ if (!isabbrev)
+ expand_mapmodes += VISUAL + NORMAL + OP_PENDING;
+ }
+ expand_isabbrev = isabbrev;
+ xp->xp_context = EXPAND_MAPPINGS;
+#ifdef FEAT_LOCALMAP
+ expand_buffer = FALSE;
+#endif
+ for (;;)
+ {
+#ifdef FEAT_LOCALMAP
+ if (STRNCMP(arg, "<buffer>", 8) == 0)
+ {
+ expand_buffer = TRUE;
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+#endif
+ if (STRNCMP(arg, "<unique>", 8) == 0)
+ {
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+ if (STRNCMP(arg, "<silent>", 8) == 0)
+ {
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+ if (STRNCMP(arg, "<script>", 8) == 0)
+ {
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+ break;
+ }
+ xp->xp_pattern = arg;
+ }
+
+ return NULL;
+}
+
+/*
+ * Find all mapping/abbreviation names that match regexp 'prog'.
+ * For command line expansion of ":[un]map" and ":[un]abbrev" in all modes.
+ * Return OK if matches found, FAIL otherwise.
+ */
+ int
+ExpandMappings(regmatch, num_file, file)
+ regmatch_T *regmatch;
+ int *num_file;
+ char_u ***file;
+{
+ mapblock_T *mp;
+ int hash;
+ int count;
+ int round;
+ char_u *p;
+ int i;
+
+ validate_maphash();
+
+ *num_file = 0; /* return values in case of FAIL */
+ *file = NULL;
+
+ /*
+ * round == 1: Count the matches.
+ * round == 2: Build the array to keep the matches.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ count = 0;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if (i == 0)
+ p = (char_u *)"<silent>";
+ else if (i == 1)
+ p = (char_u *)"<unique>";
+#ifdef FEAT_EVAL
+ else if (i == 2)
+ p = (char_u *)"<script>";
+#endif
+#ifdef FEAT_LOCALMAP
+ else if (i == 3 && !expand_buffer)
+ p = (char_u *)"<buffer>";
+#endif
+ else
+ continue;
+
+ if (vim_regexec(regmatch, p, (colnr_T)0))
+ {
+ if (round == 1)
+ ++count;
+ else
+ (*file)[count++] = vim_strsave(p);
+ }
+ }
+
+ for (hash = 0; hash < 256; ++hash)
+ {
+ if (expand_isabbrev)
+ {
+ if (hash) /* only one abbrev list */
+ break; /* for (hash) */
+ mp = first_abbr;
+ }
+#ifdef FEAT_LOCALMAP
+ else if (expand_buffer)
+ mp = curbuf->b_maphash[hash];
+#endif
+ else
+ mp = maphash[hash];
+ for (; mp; mp = mp->m_next)
+ {
+ if (mp->m_mode & expand_mapmodes)
+ {
+ p = translate_mapping(mp->m_keys, TRUE);
+ if (p != NULL && vim_regexec(regmatch, p, (colnr_T)0))
+ {
+ if (round == 1)
+ ++count;
+ else
+ {
+ (*file)[count++] = p;
+ p = NULL;
+ }
+ }
+ vim_free(p);
+ }
+ } /* for (mp) */
+ } /* for (hash) */
+
+ if (count == 0) /* no match found */
+ break; /* for (round) */
+
+ if (round == 1)
+ {
+ *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
+ if (*file == NULL)
+ return FAIL;
+ }
+ } /* for (round) */
+
+ /* Sort the matches */
+ sort_strings(*file, count);
+
+ /* Remove multiple entries */
+ {
+ char_u **ptr1 = *file;
+ char_u **ptr2 = ptr1 + 1;
+ char_u **ptr3 = ptr1 + count;
+
+ while (ptr2 < ptr3)
+ {
+ if (STRCMP(*ptr1, *ptr2))
+ *++ptr1 = *ptr2++;
+ else
+ {
+ vim_free(*ptr2++);
+ count--;
+ }
+ }
+ }
+
+ *num_file = count;
+ return (count == 0 ? FAIL : OK);
+}
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * Check for an abbreviation.
+ * Cursor is at ptr[col]. When inserting, mincol is where insert started.
+ * "c" is the character typed before check_abbr was called. It may have
+ * ABBR_OFF added to avoid prepending a CTRL-V to it.
+ *
+ * Historic vi practice: The last character of an abbreviation must be an id
+ * character ([a-zA-Z0-9_]). The characters in front of it must be all id
+ * characters or all non-id characters. This allows for abbr. "#i" to
+ * "#include".
+ *
+ * Vim addition: Allow for abbreviations that end in a non-keyword character.
+ * Then there must be white space before the abbr.
+ *
+ * return TRUE if there is an abbreviation, FALSE if not
+ */
+ int
+check_abbr(c, ptr, col, mincol)
+ int c;
+ char_u *ptr;
+ int col;
+ int mincol;
+{
+ int len;
+ int scol; /* starting column of the abbr. */
+ int j;
+#ifdef FEAT_MBYTE
+ char_u tb[MB_MAXBYTES + 4];
+#else
+ char_u tb[4];
+#endif
+ mapblock_T *mp;
+#ifdef FEAT_LOCALMAP
+ mapblock_T *mp2;
+#endif
+#ifdef FEAT_MBYTE
+ int clen = 0; /* length in characters */
+#endif
+ int is_id = TRUE;
+ int vim_abbr;
+
+ if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
+ return FALSE;
+ if (KeyNoremap) /* no remapping implies no abbreviation */
+ return FALSE;
+
+ /*
+ * Check for word before the cursor: If it ends in a keyword char all
+ * chars before it must be al keyword chars or non-keyword chars, but not
+ * white space. If it ends in a non-keyword char we accept any characters
+ * before it except white space.
+ */
+ if (col == 0) /* cannot be an abbr. */
+ return FALSE;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ char_u *p;
+
+ p = mb_prevptr(ptr, ptr + col);
+ if (!vim_iswordp(p))
+ vim_abbr = TRUE; /* Vim added abbr. */
+ else
+ {
+ vim_abbr = FALSE; /* vi compatible abbr. */
+ if (p > ptr)
+ is_id = vim_iswordp(mb_prevptr(ptr, p));
+ }
+ clen = 1;
+ while (p > ptr + mincol)
+ {
+ p = mb_prevptr(ptr, p);
+ if (vim_isspace(*p) || (!vim_abbr && is_id != vim_iswordp(p)))
+ {
+ p += (*mb_ptr2len_check)(p);
+ break;
+ }
+ ++clen;
+ }
+ scol = (int)(p - ptr);
+ }
+ else
+#endif
+ {
+ if (!vim_iswordc(ptr[col - 1]))
+ vim_abbr = TRUE; /* Vim added abbr. */
+ else
+ {
+ vim_abbr = FALSE; /* vi compatible abbr. */
+ if (col > 1)
+ is_id = vim_iswordc(ptr[col - 2]);
+ }
+ for (scol = col - 1; scol > 0 && !vim_isspace(ptr[scol - 1])
+ && (vim_abbr || is_id == vim_iswordc(ptr[scol - 1])); --scol)
+ ;
+ }
+
+ if (scol < mincol)
+ scol = mincol;
+ if (scol < col) /* there is a word in front of the cursor */
+ {
+ ptr += scol;
+ len = col - scol;
+#ifdef FEAT_LOCALMAP
+ mp = curbuf->b_first_abbr;
+ mp2 = first_abbr;
+ if (mp == NULL)
+ {
+ mp = mp2;
+ mp2 = NULL;
+ }
+#else
+ mp = first_abbr;
+#endif
+ for ( ; mp;
+#ifdef FEAT_LOCALMAP
+ mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
+#endif
+ (mp = mp->m_next))
+ {
+ /* find entries with right mode and keys */
+ if ( (mp->m_mode & State)
+ && mp->m_keylen == len
+ && !STRNCMP(mp->m_keys, ptr, (size_t)len))
+ break;
+ }
+ if (mp != NULL)
+ {
+ /*
+ * Found a match:
+ * Insert the rest of the abbreviation in typebuf.tb_buf[].
+ * This goes from end to start.
+ *
+ * Characters 0x000 - 0x100: normal chars, may need CTRL-V,
+ * except K_SPECIAL: Becomes K_SPECIAL KS_SPECIAL KE_FILLER
+ * Characters where IS_SPECIAL() == TRUE: key codes, need
+ * K_SPECIAL. Other characters (with ABBR_OFF): don't use CTRL-V.
+ *
+ * Character CTRL-] is treated specially - it completes the
+ * abbreviation, but is not inserted into the input stream.
+ */
+ j = 0;
+ /* special key code, split up */
+ if (c != Ctrl_RSB)
+ {
+ if (IS_SPECIAL(c) || c == K_SPECIAL)
+ {
+ tb[j++] = K_SPECIAL;
+ tb[j++] = K_SECOND(c);
+ tb[j++] = K_THIRD(c);
+ }
+ else
+ {
+ if (c < ABBR_OFF && (c < ' ' || c > '~'))
+ tb[j++] = Ctrl_V; /* special char needs CTRL-V */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* if ABBR_OFF has been added, remove it here */
+ if (c >= ABBR_OFF)
+ c -= ABBR_OFF;
+ j += (*mb_char2bytes)(c, tb + j);
+ }
+ else
+#endif
+ tb[j++] = c;
+ }
+ tb[j] = NUL;
+ /* insert the last typed char */
+ (void)ins_typebuf(tb, 1, 0, TRUE, mp->m_silent);
+ }
+ /* insert the to string */
+ (void)ins_typebuf(mp->m_str, mp->m_noremap, 0, TRUE, mp->m_silent);
+ /* no abbrev. for these chars */
+ typebuf.tb_no_abbr_cnt += (int)STRLEN(mp->m_str) + j + 1;
+
+ tb[0] = Ctrl_H;
+ tb[1] = NUL;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ len = clen; /* Delete characters instead of bytes */
+#endif
+ while (len-- > 0) /* delete the from string */
+ (void)ins_typebuf(tb, 1, 0, TRUE, mp->m_silent);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Write map commands for the current mappings to an .exrc file.
+ * Return FAIL on error, OK otherwise.
+ */
+ int
+makemap(fd, buf)
+ FILE *fd;
+ buf_T *buf; /* buffer for local mappings or NULL */
+{
+ mapblock_T *mp;
+ char_u c1, c2;
+ char_u *p;
+ char *cmd;
+ int abbr;
+ int hash;
+ int did_cpo = FALSE;
+ int i;
+
+ validate_maphash();
+
+ /*
+ * Do the loop twice: Once for mappings, once for abbreviations.
+ * Then loop over all map hash lists.
+ */
+ for (abbr = 0; abbr < 2; ++abbr)
+ for (hash = 0; hash < 256; ++hash)
+ {
+ if (abbr)
+ {
+ if (hash) /* there is only one abbr list */
+ break;
+#ifdef FEAT_LOCALMAP
+ if (buf != NULL)
+ mp = buf->b_first_abbr;
+ else
+#endif
+ mp = first_abbr;
+ }
+ else
+ {
+#ifdef FEAT_LOCALMAP
+ if (buf != NULL)
+ mp = buf->b_maphash[hash];
+ else
+#endif
+ mp = maphash[hash];
+ }
+
+ for ( ; mp; mp = mp->m_next)
+ {
+ /* skip script-local mappings */
+ if (mp->m_noremap == REMAP_SCRIPT)
+ continue;
+
+ /* skip mappings that contain a <SNR> (script-local thing),
+ * they probably don't work when loaded again */
+ for (p = mp->m_str; *p != NUL; ++p)
+ if (p[0] == K_SPECIAL && p[1] == KS_EXTRA
+ && p[2] == (int)KE_SNR)
+ break;
+ if (*p != NUL)
+ continue;
+
+ c1 = NUL;
+ c2 = NUL;
+ if (abbr)
+ cmd = "abbr";
+ else
+ cmd = "map";
+ switch (mp->m_mode)
+ {
+ case NORMAL + VISUAL + OP_PENDING:
+ break;
+ case NORMAL:
+ c1 = 'n';
+ break;
+ case VISUAL:
+ c1 = 'v';
+ break;
+ case OP_PENDING:
+ c1 = 'o';
+ break;
+ case NORMAL + VISUAL:
+ c1 = 'n';
+ c2 = 'v';
+ break;
+ case VISUAL + OP_PENDING:
+ c1 = 'v';
+ c2 = 'o';
+ break;
+ case NORMAL + OP_PENDING:
+ c1 = 'n';
+ c2 = 'o';
+ break;
+ case CMDLINE + INSERT:
+ if (!abbr)
+ cmd = "map!";
+ break;
+ case CMDLINE:
+ c1 = 'c';
+ break;
+ case INSERT:
+ c1 = 'i';
+ break;
+ case LANGMAP:
+ c1 = 'l';
+ break;
+ default:
+ EMSG(_("E228: makemap: Illegal mode"));
+ return FAIL;
+ }
+ do /* may do this twice if c2 is set */
+ {
+ /* When outputting <> form, need to make sure that 'cpo'
+ * is set to the Vim default. */
+ if (!did_cpo)
+ {
+ if (*mp->m_str == NUL) /* will use <Nop> */
+ did_cpo = TRUE;
+ else
+ for (i = 0; i < 2; ++i)
+ for (p = (i ? mp->m_str : mp->m_keys); *p; ++p)
+ if (*p == K_SPECIAL || *p == NL)
+ did_cpo = TRUE;
+ if (did_cpo)
+ {
+ if (fprintf(fd, "let s:cpo_save=&cpo") < 0
+ || put_eol(fd) < 0
+ || fprintf(fd, "set cpo&vim") < 0
+ || put_eol(fd) < 0)
+ return FAIL;
+ }
+ }
+ if (c1 && putc(c1, fd) < 0)
+ return FAIL;
+ if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0)
+ return FAIL;
+ if (fprintf(fd, cmd) < 0)
+ return FAIL;
+ if (buf != NULL && fputs(" <buffer>", fd) < 0)
+ return FAIL;
+ if (mp->m_silent && fputs(" <silent>", fd) < 0)
+ return FAIL;
+
+ if ( putc(' ', fd) < 0
+ || put_escstr(fd, mp->m_keys, 0) == FAIL
+ || putc(' ', fd) < 0
+ || put_escstr(fd, mp->m_str, 1) == FAIL
+ || put_eol(fd) < 0)
+ return FAIL;
+ c1 = c2;
+ c2 = NUL;
+ }
+ while (c1);
+ }
+ }
+
+ if (did_cpo)
+ if (fprintf(fd, "let &cpo=s:cpo_save") < 0
+ || put_eol(fd) < 0
+ || fprintf(fd, "unlet s:cpo_save") < 0
+ || put_eol(fd) < 0)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * write escape string to file
+ * "what": 0 for :map lhs, 1 for :map rhs, 2 for :set
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+put_escstr(fd, strstart, what)
+ FILE *fd;
+ char_u *strstart;
+ int what;
+{
+ char_u *str = strstart;
+ int c;
+ int modifiers;
+
+ /* :map xx <Nop> */
+ if (*str == NUL && what == 1)
+ {
+ if (fprintf(fd, "<Nop>") < 0)
+ return FAIL;
+ return OK;
+ }
+
+ for ( ; *str != NUL; ++str)
+ {
+#ifdef FEAT_MBYTE
+ char_u *p;
+
+ /* Check for a multi-byte character, which may contain escaped
+ * K_SPECIAL and CSI bytes */
+ p = mb_unescape(&str);
+ if (p != NULL)
+ {
+ while (*p != NUL)
+ if (putc(*p++, fd) < 0)
+ return FAIL;
+ --str;
+ continue;
+ }
+#endif
+
+ c = *str;
+ /*
+ * Special key codes have to be translated to be able to make sense
+ * when they are read back.
+ */
+ if (c == K_SPECIAL && what != 2)
+ {
+ modifiers = 0x0;
+ if (str[1] == KS_MODIFIER)
+ {
+ modifiers = str[2];
+ str += 3;
+ c = *str;
+ }
+ if (c == K_SPECIAL)
+ {
+ c = TO_SPECIAL(str[1], str[2]);
+ str += 2;
+ }
+ if (IS_SPECIAL(c) || modifiers) /* special key */
+ {
+ if (fprintf(fd, (char *)get_special_key_name(c, modifiers)) < 0)
+ return FAIL;
+ continue;
+ }
+ }
+
+ /*
+ * A '\n' in a map command should be written as <NL>.
+ * A '\n' in a set command should be written as \^V^J.
+ */
+ if (c == NL)
+ {
+ if (what == 2)
+ {
+ if (fprintf(fd, IF_EB("\\\026\n", "\\" CTRL_V_STR "\n")) < 0)
+ return FAIL;
+ }
+ else
+ {
+ if (fprintf(fd, "<NL>") < 0)
+ return FAIL;
+ }
+ continue;
+ }
+
+ /*
+ * Some characters have to be escaped with CTRL-V to
+ * prevent them from misinterpreted in DoOneCmd().
+ * A space, Tab and '"' has to be escaped with a backslash to
+ * prevent it to be misinterpreted in do_set().
+ * A space has to be escaped with a CTRL-V when it's at the start of a
+ * ":map" rhs.
+ * A '<' has to be escaped with a CTRL-V to prevent it being
+ * interpreted as the start of a special key name.
+ * A space in the lhs of a :map needs a CTRL-V.
+ */
+ if (what == 2 && (vim_iswhite(c) || c == '"' || c == '\\'))
+ {
+ if (putc('\\', fd) < 0)
+ return FAIL;
+ }
+ else if (c < ' ' || c > '~' || c == '|'
+ || (what == 0 && c == ' ')
+ || (what == 1 && str == strstart && c == ' ')
+ || (what != 2 && c == '<'))
+ {
+ if (putc(Ctrl_V, fd) < 0)
+ return FAIL;
+ }
+ if (putc(c, fd) < 0)
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * Check all mappings for the presence of special key codes.
+ * Used after ":set term=xxx".
+ */
+ void
+check_map_keycodes()
+{
+ mapblock_T *mp;
+ char_u *p;
+ int i;
+ char_u buf[3];
+ char_u *save_name;
+ int abbr;
+ int hash;
+#ifdef FEAT_LOCALMAP
+ buf_T *bp;
+#endif
+
+ validate_maphash();
+ save_name = sourcing_name;
+ sourcing_name = (char_u *)"mappings"; /* avoids giving error messages */
+
+#ifdef FEAT_LOCALMAP
+ /* This this once for each buffer, and then once for global
+ * mappings/abbreviations with bp == NULL */
+ for (bp = firstbuf; ; bp = bp->b_next)
+ {
+#endif
+ /*
+ * Do the loop twice: Once for mappings, once for abbreviations.
+ * Then loop over all map hash lists.
+ */
+ for (abbr = 0; abbr <= 1; ++abbr)
+ for (hash = 0; hash < 256; ++hash)
+ {
+ if (abbr)
+ {
+ if (hash) /* there is only one abbr list */
+ break;
+#ifdef FEAT_LOCALMAP
+ if (bp != NULL)
+ mp = bp->b_first_abbr;
+ else
+#endif
+ mp = first_abbr;
+ }
+ else
+ {
+#ifdef FEAT_LOCALMAP
+ if (bp != NULL)
+ mp = bp->b_maphash[hash];
+ else
+#endif
+ mp = maphash[hash];
+ }
+ for ( ; mp != NULL; mp = mp->m_next)
+ {
+ for (i = 0; i <= 1; ++i) /* do this twice */
+ {
+ if (i == 0)
+ p = mp->m_keys; /* once for the "from" part */
+ else
+ p = mp->m_str; /* and once for the "to" part */
+ while (*p)
+ {
+ if (*p == K_SPECIAL)
+ {
+ ++p;
+ if (*p < 128) /* for "normal" tcap entries */
+ {
+ buf[0] = p[0];
+ buf[1] = p[1];
+ buf[2] = NUL;
+ (void)add_termcap_entry(buf, FALSE);
+ }
+ ++p;
+ }
+ ++p;
+ }
+ }
+ }
+ }
+#ifdef FEAT_LOCALMAP
+ if (bp == NULL)
+ break;
+ }
+#endif
+ sourcing_name = save_name;
+}
+
+#ifdef FEAT_EVAL
+/*
+ * Check the string "keys" against the lhs of all mappings
+ * Return pointer to rhs of mapping (mapblock->m_str)
+ * NULL otherwise
+ */
+ char_u *
+check_map(keys, mode, exact)
+ char_u *keys;
+ int mode;
+ int exact; /* require exact match */
+{
+ int hash;
+ int len, minlen;
+ mapblock_T *mp;
+#ifdef FEAT_LOCALMAP
+ int local;
+#endif
+
+ validate_maphash();
+
+ len = (int)STRLEN(keys);
+#ifdef FEAT_LOCALMAP
+ for (local = 1; local >= 0; --local)
+#endif
+ /* loop over all hash lists */
+ for (hash = 0; hash < 256; ++hash)
+ {
+#ifdef FEAT_LOCALMAP
+ if (local)
+ mp = curbuf->b_maphash[hash];
+ else
+#endif
+ mp = maphash[hash];
+ for ( ; mp != NULL; mp = mp->m_next)
+ {
+ /* skip entries with wrong mode, wrong length and not matching
+ * ones */
+ if (mp->m_keylen < len)
+ minlen = mp->m_keylen;
+ else
+ minlen = len;
+ if ((mp->m_mode & mode)
+ && (!exact || mp->m_keylen == len)
+ && STRNCMP(mp->m_keys, keys, minlen) == 0)
+ return mp->m_str;
+ }
+ }
+
+ return NULL;
+}
+#endif
+
+/*
+ * Default mappings for some often used keys.
+ */
+static struct initmap
+{
+ char_u *arg;
+ int mode;
+} initmappings[] =
+{
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ /* Use the Windows (CUA) keybindings. */
+# ifdef FEAT_GUI
+ {(char_u *)"<C-PageUp> H", NORMAL+VISUAL},
+ {(char_u *)"<C-PageUp> <C-O>H",INSERT},
+ {(char_u *)"<C-PageDown> L$", NORMAL+VISUAL},
+ {(char_u *)"<C-PageDown> <C-O>L<C-O>$", INSERT},
+
+ /* paste, copy and cut */
+ {(char_u *)"<S-Insert> \"*P", NORMAL},
+ {(char_u *)"<S-Insert> \"-d\"*P", VISUAL},
+ {(char_u *)"<S-Insert> <C-R><C-O>*", INSERT+CMDLINE},
+ {(char_u *)"<C-Insert> \"*y", VISUAL},
+ {(char_u *)"<S-Del> \"*d", VISUAL},
+ {(char_u *)"<C-Del> \"*d", VISUAL},
+ {(char_u *)"<C-X> \"*d", VISUAL},
+ /* Missing: CTRL-C (cancel) and CTRL-V (block selection) */
+# else
+ {(char_u *)"\316\204 H", NORMAL+VISUAL}, /* CTRL-PageUp is "H" */
+ {(char_u *)"\316\204 \017H",INSERT}, /* CTRL-PageUp is "^OH"*/
+ {(char_u *)"\316v L$", NORMAL+VISUAL}, /* CTRL-PageDown is "L$" */
+ {(char_u *)"\316v \017L\017$", INSERT}, /* CTRL-PageDown ="^OL^O$"*/
+ {(char_u *)"\316w <C-Home>", NORMAL+VISUAL},
+ {(char_u *)"\316w <C-Home>", INSERT+CMDLINE},
+ {(char_u *)"\316u <C-End>", NORMAL+VISUAL},
+ {(char_u *)"\316u <C-End>", INSERT+CMDLINE},
+
+ /* paste, copy and cut */
+# ifdef FEAT_CLIPBOARD
+# ifdef DJGPP
+ {(char_u *)"\316\122 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
+ {(char_u *)"\316\122 \"-d\"*P", VISUAL}, /* SHIFT-Insert is "-d"*P */
+ {(char_u *)"\316\122 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
+ {(char_u *)"\316\222 \"*y", VISUAL}, /* CTRL-Insert is "*y */
+# if 0 /* Shift-Del produces the same code as Del */
+ {(char_u *)"\316\123 \"*d", VISUAL}, /* SHIFT-Del is "*d */
+# endif
+ {(char_u *)"\316\223 \"*d", VISUAL}, /* CTRL-Del is "*d */
+ {(char_u *)"\030 \"-d", VISUAL}, /* CTRL-X is "-d */
+# else
+ {(char_u *)"\316\324 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
+ {(char_u *)"\316\324 \"-d\"*P", VISUAL}, /* SHIFT-Insert is "-d"*P */
+ {(char_u *)"\316\324 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
+ {(char_u *)"\316\325 \"*y", VISUAL}, /* CTRL-Insert is "*y */
+ {(char_u *)"\316\327 \"*d", VISUAL}, /* SHIFT-Del is "*d */
+ {(char_u *)"\316\330 \"*d", VISUAL}, /* CTRL-Del is "*d */
+ {(char_u *)"\030 \"-d", VISUAL}, /* CTRL-X is "-d */
+# endif
+# else
+ {(char_u *)"\316\324 P", NORMAL}, /* SHIFT-Insert is P */
+ {(char_u *)"\316\324 \"-dP", VISUAL}, /* SHIFT-Insert is "-dP */
+ {(char_u *)"\316\324 \022\017\"", INSERT}, /* SHIFT-Insert is ^R^O" */
+ {(char_u *)"\316\325 y", VISUAL}, /* CTRL-Insert is y */
+ {(char_u *)"\316\327 d", VISUAL}, /* SHIFT-Del is d */
+ {(char_u *)"\316\330 d", VISUAL}, /* CTRL-Del is d */
+# endif
+# endif
+#endif
+
+#if defined(MACOS)
+ /* Use the Standard MacOS binding. */
+ /* paste, copy and cut */
+ {(char_u *)"<D-v> \"*P", NORMAL},
+ {(char_u *)"<D-v> \"-d\"*P", VISUAL},
+ {(char_u *)"<D-v> <C-R>*", INSERT+CMDLINE},
+ {(char_u *)"<D-c> \"*y", VISUAL},
+ {(char_u *)"<D-x> \"*d", VISUAL},
+ {(char_u *)"<Backspace> \"-d", VISUAL},
+#endif
+
+ /* Map extra keys to their normal equivalents. */
+ {(char_u *)"<xF1> <F1>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xF1> <F1>", INSERT+CMDLINE},
+ {(char_u *)"<xF2> <F2>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xF2> <F2>", INSERT+CMDLINE},
+ {(char_u *)"<xF3> <F3>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xF3> <F3>", INSERT+CMDLINE},
+ {(char_u *)"<xF4> <F4>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xF4> <F4>", INSERT+CMDLINE},
+ {(char_u *)"<S-xF1> <S-F1>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<S-xF1> <S-F1>", INSERT+CMDLINE},
+ {(char_u *)"<S-xF2> <S-F2>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<S-xF2> <S-F2>", INSERT+CMDLINE},
+ {(char_u *)"<S-xF3> <S-F3>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<S-xF3> <S-F3>", INSERT+CMDLINE},
+ {(char_u *)"<S-xF4> <S-F4>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<S-xF4> <S-F4>", INSERT+CMDLINE},
+ {(char_u *)"<xEND> <END>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xEND> <END>", INSERT+CMDLINE},
+ {(char_u *)"<xHOME> <HOME>", NORMAL+VISUAL+OP_PENDING},
+ {(char_u *)"<xHOME> <HOME>", INSERT+CMDLINE},
+};
+
+/*
+ * Set up default mappings.
+ */
+ void
+init_mappings()
+{
+ int i;
+
+ for (i = 0; i < sizeof(initmappings) / sizeof(struct initmap); ++i)
+ add_map(initmappings[i].arg, initmappings[i].mode);
+}
+
+/*
+ * Add a mapping "map" for mode "mode".
+ * Need to put string in allocated memory, because do_map() will modify it.
+ */
+ void
+add_map(map, mode)
+ char_u *map;
+ int mode;
+{
+ char_u *s;
+ char_u *cpo_save = p_cpo;
+
+ p_cpo = (char_u *)""; /* Allow <> notation */
+ s = vim_strsave(map);
+ if (s != NULL)
+ {
+ (void)do_map(0, s, mode, FALSE);
+ vim_free(s);
+ }
+ p_cpo = cpo_save;
+}
diff --git a/src/glbl_ime.cpp b/src/glbl_ime.cpp
new file mode 100644
index 000000000..f42a218fc
--- /dev/null
+++ b/src/glbl_ime.cpp
@@ -0,0 +1,261 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * DESCRIPTION:
+ * This module produces Global IME for Vim, on Windows with Internet
+ * Explorer 5.01 or higher. You need three files "dimm.idl", "dimm.h", and
+ * "dimm_i.c" when compile this module at your self. "dimm.h", and
+ * "dimm_i.c" are generated from "dimm.idl" by using MIDL.EXE as like
+ * "if_ole.h". You can get "dimm.idl" in MSDN web site. I got it below
+ * URL.
+ *
+ * WHAT IS THE GLOBAL IME?:
+ * Global IME makes capability input Chinese, Japanese, and Korean text into
+ * Vim buffer on any language version of Windows 98, Windows 95, and Windows
+ * NT 4.0. See below URL for detail of Global IME. You can also find
+ * various laguage version of Global IME at same place.
+ *
+ * RUNTIME REQUIREMENTS:
+ * - Internet Exproler 5.01 or higher.
+ * - Global IME (with language pack?).
+ * - Of course Vim for Windows.
+ *
+ * URLS:
+ * - Where you can probably get "dimm.idl".
+ * http://msdn.microsoft.com/downloads/samples/internet/libraries/ie5_lib/sample.asp
+ * - Global IME detailed information.
+ * http://www.microsoft.com/windows/ie/features/ime.asp
+ */
+
+#ifdef GLOBAL_IME
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <objbase.h>
+extern "C" {
+#include "vim.h"
+}
+#include "dimm.h"
+#include "glbl_ime.h"
+
+static IActiveIMMApp *pIApp = NULL;
+static IActiveIMMMessagePumpOwner *pIMsg = NULL;
+static HWND s_hWnd = NULL;
+static BOOL s_bStatus = FALSE; /* for evacuate */
+
+/*
+ * Initialize Global IME.
+ * "atom" must be return value of RegisterClass(Ex).
+ */
+ void
+global_ime_init(ATOM atom, HWND hWnd)
+{
+ IUnknown *pI;
+ HRESULT hr;
+
+ if (pIApp != NULL || pIMsg != NULL)
+ return;
+ OleInitialize(NULL);
+
+ /*
+ * Get interface IUnknown
+ */
+ hr = CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_SERVER,
+ IID_IUnknown, (void**)&pI);
+ if (FAILED(hr) || !pI)
+ return;
+
+ /*
+ * Get interface IActiveIMMApp
+ */
+ hr = pI->QueryInterface(IID_IActiveIMMApp, (void**)&pIApp);
+ if (FAILED(hr))
+ pIApp = NULL;
+
+ /*
+ * Get interface IActiveIMMMessagePumpOwner
+ */
+ hr = pI->QueryInterface(IID_IActiveIMMMessagePumpOwner, (void**)&pIMsg);
+ if (FAILED(hr))
+ pIMsg = NULL;
+
+ if (pIApp != NULL)
+ {
+ pIApp->Activate(TRUE);
+ pIApp->FilterClientWindows(&atom, 1);
+ }
+ if (pIMsg != NULL)
+ pIMsg->Start();
+
+ pI->Release();
+ s_hWnd = hWnd;
+}
+
+/*
+ * Reset and clear Global IME.
+ */
+ void
+global_ime_end()
+{
+ if (pIApp != NULL)
+ {
+ IActiveIMMApp *p = pIApp;
+
+ pIApp = NULL;
+ p->FilterClientWindows(NULL, 0);
+ p->Deactivate();
+ p->Release();
+ }
+ if (pIMsg != NULL)
+ {
+ IActiveIMMMessagePumpOwner *p = pIMsg;
+
+ pIMsg = NULL;
+ p->End();
+ p->Release();
+ }
+ OleUninitialize();
+}
+
+/*
+ * Replacement for DefWindowProc().
+ */
+ LRESULT WINAPI
+global_ime_DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT lResult;
+
+ if (pIApp == NULL || pIApp->OnDefWindowProc(hWnd, Msg,
+ wParam, lParam, &lResult) != S_OK)
+ {
+#if defined(WIN3264) && defined(FEAT_MBYTE)
+ if (wide_WindowProc)
+ lResult = DefWindowProcW(hwnd, Msg, wParam, lParam);
+ else
+#endif
+ lResult = DefWindowProc(hWnd, Msg, wParam, lParam);
+ }
+ return lResult;
+}
+
+/*
+ * Replace with TranslateMessage()
+ */
+ BOOL WINAPI
+global_ime_TranslateMessage(CONST MSG *lpMsg)
+{
+ if (pIMsg == NULL || pIMsg->OnTranslateMessage(lpMsg) == S_FALSE)
+ return TranslateMessage(lpMsg);
+ return TRUE;
+}
+
+/*
+ * Set position of IME compotision window.
+ *
+ * You have to call this before starting composition. If once composition
+ * started, this can take no effect until that composition have finised. So
+ * you should handle WM_IME_STARTCOMPOSITION and call this function.
+ */
+ void WINAPI
+global_ime_set_position(POINT *pPoint)
+{
+ HIMC hImc = NULL;
+
+ if (pIApp == NULL || pPoint == NULL)
+ return;
+
+ if (SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ COMPOSITIONFORM CompForm;
+
+ CompForm.dwStyle = CFS_POINT;
+ CompForm.ptCurrentPos = *pPoint;
+ pIApp->SetCompositionWindow(hImc, &CompForm);
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+}
+
+/*
+ * Set font to Global IME
+ */
+/* GIME_TEST */
+ void WINAPI
+global_ime_set_font(LOGFONT *pFont)
+{
+ HIMC hImc = NULL;
+
+ if (pIApp == NULL || pFont == NULL)
+ return;
+
+ if (SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ pIApp->SetCompositionFontA(hImc, pFont);
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+}
+
+/*
+ * for IME control. Save current status of IME, and set force new-status to
+ * Engllish (turn off).
+ */
+ void WINAPI
+global_ime_status_evacuate()
+{
+ HIMC hImc;
+
+ if (pIApp != NULL && SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ s_bStatus = (pIApp->GetOpenStatus(hImc) == 0) ? TRUE : FALSE;
+ pIApp->SetOpenStatus(hImc, FALSE);
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+}
+
+/*
+ * for IME control. Change IME status to last saved one.
+ */
+ void WINAPI
+global_ime_status_restore()
+{
+ HIMC hImc;
+
+ if (pIApp != NULL && SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ pIApp->SetOpenStatus(hImc, s_bStatus);
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+}
+
+ void WINAPI
+global_ime_set_status(int status)
+{
+ HIMC hImc;
+
+ if (pIApp != NULL && SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ pIApp->SetOpenStatus(hImc, status ? TRUE : FALSE);
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+}
+
+ int WINAPI
+global_ime_get_status()
+{
+ int status = 0;
+ HIMC hImc;
+
+ if (pIApp != NULL && SUCCEEDED(pIApp->GetContext(s_hWnd, &hImc)))
+ {
+ status = pIApp->GetOpenStatus(hImc) ? 1 : 0;
+ pIApp->ReleaseContext(s_hWnd, hImc);
+ }
+ return status;
+}
+
+#endif /* GLOBAL_IME */
diff --git a/src/glbl_ime.h b/src/glbl_ime.h
new file mode 100644
index 000000000..85088366f
--- /dev/null
+++ b/src/glbl_ime.h
@@ -0,0 +1,31 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#ifdef GLOBAL_IME
+#ifndef _INC_GLOBAL_IME
+#define _INC_GLOBAL_IME
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+ void global_ime_init(ATOM, HWND);
+ void global_ime_end();
+ LRESULT WINAPI global_ime_DefWindowProc(HWND, UINT, WPARAM, LPARAM);
+ BOOL WINAPI global_ime_TranslateMessage(CONST MSG *);
+ void WINAPI global_ime_set_position(POINT*);
+ void WINAPI global_ime_set_font(LOGFONT*);
+ void WINAPI global_ime_status_evacuate();
+ void WINAPI global_ime_status_restore();
+ void WINAPI global_ime_set_status(int status);
+ int WINAPI global_ime_get_status();
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _INC_GLOBAL_IME */
+#endif /* GLOBAL_IME */
diff --git a/src/globals.h b/src/globals.h
new file mode 100644
index 000000000..6f53317a6
--- /dev/null
+++ b/src/globals.h
@@ -0,0 +1,1381 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * definition of global variables
+ */
+
+/*
+ * Number of Rows and Columns in the screen.
+ * Must be long to be able to use them as options in option.c.
+ * Note: Use screen_Rows and screen_Columns to access items in ScreenLines[].
+ * They may have different values when the screen wasn't (re)allocated yet
+ * after setting Rows or Columns (e.g., when starting up).
+ */
+EXTERN long Rows /* nr of rows in the screen */
+#ifdef DO_INIT
+# if defined(MSDOS) || defined(WIN3264) || defined(OS2)
+ = 25L
+# else
+ = 24L
+# endif
+#endif
+ ;
+EXTERN long Columns INIT(= 80); /* nr of columns in the screen */
+
+/*
+ * The characters that are currently on the screen are kept in ScreenLines[].
+ * It is a single block of characters, the size of the screen plus one line.
+ * The attributes for those characters are kept in ScreenAttrs[].
+ *
+ * "LineOffset[n]" is the offset from ScreenLines[] for the start of line 'n'.
+ * The same value is used for ScreenLinesUC[] and ScreenAttrs[].
+ */
+EXTERN schar_T *ScreenLines INIT(= NULL);
+EXTERN sattr_T *ScreenAttrs INIT(= NULL);
+EXTERN unsigned *LineOffset INIT(= NULL);
+EXTERN char_u *LineWraps INIT(= NULL);
+
+#ifdef FEAT_MBYTE
+/*
+ * When using Unicode characters (in UTF-8 encoding) the character in
+ * ScreenLinesUC[] contains the Unicode for the character at this position, or
+ * NUL when the character in ScreenLines[] is to be used (ASCII char).
+ * The composing characters are to be drawn on top of the original character.
+ * Note: These three are only allocated when enc_utf8 is set!
+ */
+EXTERN u8char_T *ScreenLinesUC INIT(= NULL); /* decoded UTF-8 characters */
+EXTERN u8char_T *ScreenLinesC1 INIT(= NULL); /* first composing char */
+EXTERN u8char_T *ScreenLinesC2 INIT(= NULL); /* second composing char */
+
+/* Only used for euc-jp: Second byte of a character that starts with 0x8e.
+ * These are single-width. */
+EXTERN schar_T *ScreenLines2 INIT(= NULL);
+#endif
+
+EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
+EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
+
+/*
+ * When vgetc() is called, it sets mod_mask to the set of modifiers that are
+ * held down based on the KSMOD_* symbols that are read first.
+ */
+EXTERN int mod_mask INIT(= 0x0); /* current key modifiers */
+
+/*
+ * Cmdline_row is the row where the command line starts, just below the
+ * last window.
+ * When the cmdline gets longer than the available space the screen gets
+ * scrolled up. After a CTRL-D (show matches), after hitting ':' after
+ * "hit return", and for the :global command, the command line is
+ * temporarily moved. The old position is restored with the next call to
+ * update_screen().
+ */
+EXTERN int cmdline_row;
+
+EXTERN int redraw_cmdline INIT(= FALSE); /* cmdline must be redrawn */
+EXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
+#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
+EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */
+#endif
+EXTERN int exec_from_reg INIT(= FALSE); /* executing register */
+
+EXTERN int global_changedtick INIT(= 0); /* incremented for each
+ change, also for undo */
+EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */
+
+/*
+ * When '$' is included in 'cpoptions' option set:
+ * When a change command is given that deletes only part of a line, a dollar
+ * is put at the end of the changed text. dollar_vcol is set to the virtual
+ * column of this '$'.
+ */
+EXTERN colnr_T dollar_vcol INIT(= 0);
+
+#ifdef FEAT_INS_EXPAND
+/*
+ * used for Insert mode completion
+ */
+EXTERN int completion_length INIT(= 0);
+EXTERN int continue_status INIT(= 0);
+EXTERN int completion_interrupted INIT(= FALSE);
+
+/* flags for continue_status */
+#define CONT_ADDING 1 /* "normal" or "adding" expansion */
+#define CONT_INTRPT (2 + 4) /* a ^X interrupted the current expansion */
+ /* it's set only iff N_ADDS is set */
+#define CONT_N_ADDS 4 /* next ^X<> will add-new or expand-current */
+#define CONT_S_IPOS 8 /* next ^X<> will set initial_pos?
+ * if so, word-wise-expansion will set SOL */
+#define CONT_SOL 16 /* pattern includes start of line, just for
+ * word-wise expansion, not set for ^X^L */
+#define CONT_LOCAL 32 /* for ctrl_x_mode 0, ^X^P/^X^N do a local
+ * expansion, (eg use complete=.) */
+#endif
+
+/*
+ * Functions for putting characters in the command line,
+ * while keeping ScreenLines[] updated.
+ */
+#ifdef FEAT_RIGHTLEFT
+EXTERN int cmdmsg_rl INIT(= FALSE); /* cmdline is drawn right to left */
+#endif
+EXTERN int msg_col;
+EXTERN int msg_row;
+EXTERN int msg_scrolled; /* Number of screen lines that windows have
+ * scrolled because of printing messages. */
+EXTERN int msg_scrolled_ign INIT(= FALSE);
+ /* when TRUE don't set need_wait_return in
+ msg_puts_attr() when msg_scrolled is
+ non-zero */
+
+EXTERN char_u *keep_msg INIT(= NULL); /* msg to be shown after redraw */
+EXTERN int keep_msg_attr INIT(= 0); /* highlight attr for keep_msg */
+EXTERN int need_fileinfo INIT(= FALSE);/* do fileinfo() after redraw */
+EXTERN int msg_scroll INIT(= FALSE); /* msg_start() will scroll */
+EXTERN int msg_didout INIT(= FALSE); /* msg_outstr() was used in line */
+EXTERN int msg_didany INIT(= FALSE); /* msg_outstr() was used at all */
+EXTERN int msg_nowait INIT(= FALSE); /* don't wait for this msg */
+EXTERN int emsg_off INIT(= 0); /* don't display errors for now,
+ unless 'debug' is set. */
+EXTERN int info_message INIT(= FALSE); /* printing informative message */
+#ifdef FEAT_EVAL
+EXTERN int emsg_skip INIT(= 0); /* don't display errors for
+ expression that is skipped */
+EXTERN int emsg_severe INIT(=FALSE); /* use message of next of several
+ emsg() calls for throw */
+EXTERN int did_endif INIT(= FALSE); /* just had ":endif" */
+#endif
+EXTERN int did_emsg; /* set by emsg() when the message
+ is displayed or thrown */
+EXTERN int called_emsg; /* always set by emsg() */
+EXTERN int emsg_on_display INIT(= FALSE); /* there is an error message */
+EXTERN int rc_did_emsg INIT(= FALSE); /* vim_regcomp() called emsg() */
+
+EXTERN int no_wait_return INIT(= 0); /* don't wait for return for now */
+EXTERN int need_wait_return INIT(= 0); /* need to wait for return later */
+EXTERN int did_wait_return INIT(= FALSE); /* wait_return() was used and
+ nothing written since then */
+#ifdef FEAT_TITLE
+EXTERN int need_maketitle INIT(= TRUE); /* call maketitle() soon */
+#endif
+
+EXTERN int quit_more INIT(= FALSE); /* 'q' hit at "--more--" msg */
+EXTERN int more_back INIT(= 0); /* 'b' or 'u' at "--more--" msg */
+EXTERN int more_back_used INIT(= FALSE); /* using more_back */
+#if defined(UNIX) || defined(__EMX__) || defined(VMS) || defined(MACOS_X)
+EXTERN int newline_on_exit INIT(= FALSE); /* did msg in altern. screen */
+EXTERN int intr_char INIT(= 0); /* extra interrupt character */
+#endif
+#if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11)
+EXTERN int x_no_connect INIT(= FALSE); /* don't connect to X server */
+# if defined(FEAT_CLIENTSERVER)
+EXTERN int x_force_connect INIT(= FALSE); /* Do connect to X server.
+ Overrules x_no_connect and
+ "exclude" in 'clipboard'. */
+# endif
+#endif
+EXTERN int vgetc_busy INIT(= FALSE); /* inside vgetc() now */
+
+EXTERN int didset_vim INIT(= FALSE); /* did set $VIM ourselves */
+EXTERN int didset_vimruntime INIT(= FALSE); /* idem for $VIMRUNTIME */
+
+/*
+ * Lines left before a "more" message. Ex mode needs to be able to reset this
+ * after you type something.
+ */
+EXTERN int lines_left INIT(= -1); /* lines left for listing */
+EXTERN int msg_no_more INIT(= FALSE); /* don't use more prompt, truncate
+ messages */
+
+EXTERN char_u *sourcing_name INIT( = NULL);/* name of error message source */
+EXTERN linenr_T sourcing_lnum INIT(= 0); /* line number of the source file */
+
+#ifdef FEAT_EVAL
+EXTERN int ex_nesting_level INIT(= 0); /* nesting level */
+EXTERN int debug_break_level INIT(= -1); /* break below this level */
+EXTERN int debug_did_msg INIT(= FALSE); /* did "debug mode" message */
+EXTERN int debug_tick INIT(= 0); /* breakpoint change count */
+
+/*
+ * The exception currently being thrown. Used to pass an exception to
+ * a different cstack. Also used for discarding an exception before it is
+ * caught or made pending. Only valid when did_throw is TRUE.
+ */
+EXTERN except_T *current_exception;
+
+/*
+ * did_throw: An exception is being thrown. Reset when the exception is caught
+ * or as long as it is pending in a finally clause.
+ */
+EXTERN int did_throw INIT(= FALSE);
+
+/*
+ * need_rethrow: set to TRUE when a throw that cannot be handled in do_cmdline()
+ * must be propagated to the cstack of the previously called do_cmdline().
+ */
+EXTERN int need_rethrow INIT(= FALSE);
+
+/*
+ * check_cstack: set to TRUE when a ":finish" or ":return" that cannot be
+ * handled in do_cmdline() must be propagated to the cstack of the previously
+ * called do_cmdline().
+ */
+EXTERN int check_cstack INIT(= FALSE);
+
+/*
+ * Number of nested try conditionals (across function calls and ":source"
+ * commands).
+ */
+EXTERN int trylevel INIT(= 0);
+
+/*
+ * When "force_abort" is TRUE, always skip commands after an error message,
+ * even after the outermost ":endif" or ":endwhile" or for a function whithout
+ * the "abort" flag. It is set to TRUE when "trylevel" is non-zero (and
+ * ":silent!" was not used) or an exception is being thrown at the time an
+ * error is detected. It is set to FALSE when "trylevel" gets zero again and
+ * there was no error or interrupt or throw.
+ *
+ */
+EXTERN int force_abort INIT(= FALSE);
+
+/*
+ * "msg_list" points to a variable in the stack of do_cmdline() which keeps the
+ * list of arguments of several emsg() calls, one of which is to be converted to
+ * an error exception immediately after the failing command returns. The
+ * message to be used for the exception value is pointed to by the "throw_msg"
+ * field of the first element in the list. It is usually the same as the "msg"
+ * field of that element, but can be identical to the "msg" field of a later
+ * list element, when the "emsg_severe" flag was set when the emsg() call was
+ * made.
+ */
+EXTERN struct msglist **msg_list INIT(= NULL);
+
+/*
+ * suppress_errthrow: When TRUE, don't convert an error to an exception. Used
+ * when displaying the interrupt message or reporting an exception that is still
+ * uncaught at the top level (which has already been discarded then). Also used
+ * for the error message when no exception can be thrown.
+ */
+EXTERN int suppress_errthrow INIT(= FALSE);
+
+/*
+ * The stack of all caught and not finished exceptions. The exception on the
+ * top of the stack is the one got by evaluation of v:exception. The complete
+ * stack of all caught and pending exceptions is embedded in the various
+ * cstacks; the pending exceptions, however, are not on the caught stack.
+ */
+EXTERN except_T *caught_stack INIT(= NULL);
+
+#endif
+
+#ifdef FEAT_EVAL
+EXTERN scid_T current_SID INIT(= 0); /* ID of script being sourced or
+ was sourced to define the
+ current function. */
+#endif
+EXTERN int scroll_region INIT(= FALSE); /* term supports scroll region */
+EXTERN int t_colors INIT(= 0); /* int value of T_CCO */
+
+/*
+ * When highlight_match is TRUE, highlight a match, starting at the cursor
+ * position. Search_match_lines is the number of lines after the match (0 for
+ * a match within one line), search_match_endcol the column number of the
+ * character just after the match in the last line.
+ */
+EXTERN int highlight_match INIT(= FALSE); /* show search match pos */
+EXTERN linenr_T search_match_lines; /* lines of of matched string */
+EXTERN colnr_T search_match_endcol; /* col nr of match end */
+
+EXTERN int no_smartcase INIT(= FALSE); /* don't use 'smartcase' once */
+
+EXTERN int need_check_timestamps INIT(= FALSE); /* need to check file
+ timestamps asap */
+EXTERN int did_check_timestamps INIT(= FALSE); /* did check timestamps
+ recently */
+EXTERN int no_check_timestamps INIT(= 0); /* Don't check timestamps */
+
+EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */
+#ifdef FEAT_STL_OPT
+# define USER_HIGHLIGHT
+#endif
+#ifdef USER_HIGHLIGHT
+EXTERN int highlight_user[9]; /* User[1-9] attributes */
+# ifdef FEAT_STL_OPT
+EXTERN int highlight_stlnc[9]; /* On top of user */
+# endif
+#endif
+#ifdef FEAT_GUI
+EXTERN char_u *use_gvimrc INIT(= NULL); /* "-U" cmdline argument */
+#endif
+EXTERN int cterm_normal_fg_color INIT(= 0);
+EXTERN int cterm_normal_fg_bold INIT(= 0);
+EXTERN int cterm_normal_bg_color INIT(= 0);
+
+#ifdef FEAT_AUTOCMD
+EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */
+EXTERN int autocmd_no_enter INIT(= FALSE); /* *Enter autocmds disabled */
+EXTERN int autocmd_no_leave INIT(= FALSE); /* *Leave autocmds disabled */
+EXTERN int autocmd_block INIT(= 0); /* block all autocmds */
+EXTERN int modified_was_set; /* did ":set modified" */
+EXTERN int did_filetype INIT(= FALSE); /* FileType event found */
+EXTERN int keep_filetype INIT(= FALSE); /* value for did_filetype when
+ starting to execute
+ autocommands */
+
+/* When deleting the current buffer, another one must be loaded. If we know
+ * which one is preferred, au_new_curbuf is set to it */
+EXTERN buf_T *au_new_curbuf INIT(= NULL);
+#endif
+
+#ifdef FEAT_MOUSE
+/*
+ * Mouse coordinates, set by check_termcode()
+ */
+EXTERN int mouse_row;
+EXTERN int mouse_col;
+EXTERN int mouse_past_bottom INIT(= FALSE);/* mouse below last line */
+EXTERN int mouse_past_eol INIT(= FALSE); /* mouse right of line */
+EXTERN int mouse_dragging INIT(= 0); /* extending Visual area with
+ mouse dragging */
+# if defined(FEAT_MOUSE_DEC)
+/*
+ * When the DEC mouse has been pressed but not yet released we enable
+ * automatic querys for the mouse position.
+ */
+EXTERN int WantQueryMouse INIT(= 0);
+# endif
+
+# ifdef FEAT_GUI
+/* When the window layout is about to be changed, need_mouse_correct is set,
+ * so that gui_mouse_correct() is called afterwards, to correct the mouse
+ * pointer when focus-follow-mouse is being used. */
+EXTERN int need_mouse_correct INIT(= FALSE);
+
+/* When double clicking, topline must be the same */
+EXTERN linenr_T gui_prev_topline INIT(= 0);
+# ifdef FEAT_DIFF
+EXTERN int gui_prev_topfill INIT(= 0);
+# endif
+# endif
+
+# ifdef FEAT_MOUSESHAPE
+EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */
+EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the
+ mouse pointer shape */
+# ifdef FEAT_VERTSPLIT
+EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
+# endif
+# endif
+
+#endif
+
+#ifdef FEAT_DIFF
+/* Value set from 'diffopt'. */
+EXTERN int diff_context INIT(= 6); /* context for folds */
+#endif
+
+#ifdef FEAT_MENU
+/* The root of the menu hierarchy. */
+EXTERN vimmenu_T *root_menu INIT(= NULL);
+/*
+ * While defining the system menu, sys_menu is TRUE. This avoids
+ * overruling of menus that the user already defined.
+ */
+EXTERN int sys_menu INIT(= FALSE);
+#endif
+
+/* While redrawing the screen this flag is set. It means the screen size
+ * ('lines' and 'rows') must not be changed. */
+EXTERN int updating_screen INIT(= FALSE);
+
+#ifdef FEAT_GUI
+# ifdef FEAT_MENU
+/* Menu item just selected, set by check_termcode() */
+EXTERN vimmenu_T *current_menu;
+
+/* Set to TRUE after adding/removing menus to ensure they are updated */
+EXTERN int force_menu_update INIT(= FALSE);
+# endif
+
+/* Scrollbar moved and new value, set by check_termcode() */
+EXTERN int current_scrollbar;
+EXTERN long_u scrollbar_value;
+
+/* found "-rv" or "-reverse" in command line args */
+EXTERN int found_reverse_arg INIT(= FALSE);
+
+/* "-fn" or "-font" command line argument */
+EXTERN char *font_argument INIT(= NULL);
+
+# ifdef FEAT_GUI_GTK
+/* "-bg" or "-background" command line argument */
+EXTERN char *background_argument INIT(= NULL);
+
+/* "-fg" or "-foreground" command line argument */
+EXTERN char *foreground_argument INIT(= NULL);
+# endif
+
+/*
+ * While executing external commands or in Ex mode, should not insert GUI
+ * events in the input buffer: Set hold_gui_events to non-zero.
+ */
+EXTERN int hold_gui_events INIT(= 0);
+
+/*
+ * When resizing the shell is postponed, remember the new size, and call
+ * gui_resize_shell() later.
+ */
+EXTERN int new_pixel_width INIT(= 0);
+EXTERN int new_pixel_height INIT(= 0);
+
+/* Window position from ":winpos", to be used when opening the GUI window. */
+EXTERN int gui_win_x INIT(= -1);
+EXTERN int gui_win_y INIT(= -1);
+#endif
+
+#ifdef FEAT_CLIPBOARD
+EXTERN VimClipboard clip_star; /* PRIMARY selection in X11 */
+# ifdef FEAT_X11
+EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */
+# else
+# define clip_plus clip_star /* there is only one clipboard */
+# endif
+#endif
+
+/*
+ * All windows are linked in a list. firstwin points to the first entry,
+ * lastwin to the last entry (can be the same as firstwin) and curwin to the
+ * currently active window.
+ * Without the FEAT_WINDOWS they are all equal.
+ */
+#ifdef FEAT_WINDOWS
+EXTERN win_T *firstwin; /* first window */
+EXTERN win_T *lastwin; /* last window */
+EXTERN win_T *prevwin INIT(= NULL); /* previous window */
+# define W_NEXT(wp) ((wp)->w_next)
+# define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
+#else
+# define firstwin curwin
+# define lastwin curwin
+# define W_NEXT(wp) NULL
+# define FOR_ALL_WINDOWS(wp) wp = curwin;
+#endif
+EXTERN win_T *curwin; /* currently active window */
+
+/*
+ * The window layout is kept in a tree of frames. topframe points to the top
+ * of the tree.
+ */
+EXTERN frame_T *topframe; /* top of the window frame tree */
+
+/*
+ * All buffers are linked in a list. 'firstbuf' points to the first entry,
+ * 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
+ */
+EXTERN buf_T *firstbuf INIT(= NULL); /* first buffer */
+EXTERN buf_T *lastbuf INIT(= NULL); /* last buffer */
+EXTERN buf_T *curbuf INIT(= NULL); /* currently active buffer */
+
+/*
+ * List of files being edited (global argument list). curwin->w_alist points
+ * to this when the window is using the global argument list.
+ */
+EXTERN alist_T global_alist; /* global argument list */
+EXTERN int arg_had_last INIT(= FALSE); /* accessed last file in
+ global_alist */
+
+EXTERN int ru_col; /* column for ruler */
+#ifdef FEAT_STL_OPT
+EXTERN int ru_wid; /* 'rulerfmt' width of ruler when non-zero */
+#endif
+EXTERN int sc_col; /* column for shown command */
+
+#ifdef TEMPDIRNAMES
+EXTERN char_u *vim_tempdir INIT(= NULL); /* Name of Vim's own temp dir.
+ Ends in a slash. */
+#endif
+
+/*
+ * When starting or exiting some things are done differently (e.g. screen
+ * updating).
+ */
+EXTERN int starting INIT(= NO_SCREEN);
+ /* first NO_SCREEN, then NO_BUFFERS and then
+ * set to 0 when starting up finished */
+EXTERN int exiting INIT(= FALSE);
+ /* TRUE when abandoning Vim */
+EXTERN int full_screen INIT(= FALSE);
+ /* TRUE when doing full-screen output
+ * otherwise only writing some messages */
+
+EXTERN int restricted INIT(= FALSE);
+ /* TRUE when started as "rvim" */
+EXTERN int secure INIT(= FALSE);
+ /* non-zero when only "safe" commands are
+ * allowed, e.g. when sourcing .exrc or .vimrc
+ * in current directory */
+
+#ifdef FEAT_EVAL
+# define HAVE_SANDBOX
+EXTERN int sandbox INIT(= 0);
+ /* non-zero when evaluating an expression in a
+ * "sandbox". Not allowed to change the
+ * buffer. */
+#endif
+
+EXTERN int silent_mode INIT(= FALSE);
+ /* set to TRUE when "-s" commandline argument
+ * used for ex */
+
+#ifdef FEAT_VISUAL
+EXTERN pos_T VIsual; /* start position of active Visual selection */
+EXTERN int VIsual_active INIT(= FALSE);
+ /* whether Visual mode is active */
+EXTERN int VIsual_select INIT(= FALSE);
+ /* whether Select mode is active */
+EXTERN int VIsual_reselect;
+ /* whether to restart the selection after a
+ * Select mode mapping or menu */
+
+EXTERN int VIsual_mode INIT(= 'v');
+ /* type of Visual mode */
+
+EXTERN int redo_VIsual_busy INIT(= FALSE);
+ /* TRUE when redoing Visual */
+#endif
+
+#ifdef FEAT_MOUSE
+/*
+ * When pasting text with the middle mouse button in visual mode with
+ * restart_edit set, remember where it started so we can set Insstart.
+ */
+EXTERN pos_T where_paste_started;
+#endif
+
+/*
+ * This flag is used to make auto-indent work right on lines where only a
+ * <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
+ * reset when any other editing is done on the line. If an <ESC> or <RETURN>
+ * is received, and did_ai is TRUE, the line is truncated.
+ */
+EXTERN int did_ai INIT(= FALSE);
+
+/*
+ * Column of first char after autoindent. 0 when no autoindent done. Used
+ * when 'backspace' is 0, to avoid backspacing over autoindent.
+ */
+EXTERN colnr_T ai_col INIT(= 0);
+
+#ifdef FEAT_COMMENTS
+/*
+ * This is a character which will end a start-middle-end comment when typed as
+ * the first character on a new line. It is taken from the last character of
+ * the "end" comment leader when the COM_AUTO_END flag is given for that
+ * comment end in 'comments'. It is only valid when did_ai is TRUE.
+ */
+EXTERN int end_comment_pending INIT(= NUL);
+#endif
+
+#ifdef FEAT_SCROLLBIND
+/*
+ * This flag is set after a ":syncbind" to let the check_scrollbind() function
+ * know that it should not attempt to perform scrollbinding due to the scroll
+ * that was a result of the ":syncbind." (Otherwise, check_scrollbind() will
+ * undo some of the work done by ":syncbind.") -ralston
+ */
+EXTERN int did_syncbind INIT(= FALSE);
+#endif
+
+#ifdef FEAT_SMARTINDENT
+/*
+ * This flag is set when a smart indent has been performed. When the next typed
+ * character is a '{' the inserted tab will be deleted again.
+ */
+EXTERN int did_si INIT(= FALSE);
+
+/*
+ * This flag is set after an auto indent. If the next typed character is a '}'
+ * one indent will be removed.
+ */
+EXTERN int can_si INIT(= FALSE);
+
+/*
+ * This flag is set after an "O" command. If the next typed character is a '{'
+ * one indent will be removed.
+ */
+EXTERN int can_si_back INIT(= FALSE);
+#endif
+
+EXTERN pos_T saved_cursor /* w_cursor before formatting text. */
+# ifdef DO_INIT
+ = INIT_POS_T
+# endif
+ ;
+
+/*
+ * Stuff for insert mode.
+ */
+EXTERN pos_T Insstart; /* This is where the latest
+ * insert/append mode started. */
+#ifdef FEAT_VREPLACE
+/*
+ * Stuff for VREPLACE mode.
+ */
+EXTERN int orig_line_count INIT(= 0); /* Line count when "gR" started */
+EXTERN int vr_lines_changed INIT(= 0); /* #Lines changed by "gR" so far */
+#endif
+
+#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
+/* argument to SETJMP() for handling X IO errors */
+EXTERN JMP_BUF x_jump_env;
+#endif
+
+#if defined(HAVE_SETJMP_H)
+/*
+ * Stuff for setjmp() and longjmp().
+ * Used to protect areas where we could crash.
+ */
+EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */
+#ifdef SIGHASARG
+EXTERN int lc_signal; /* catched signal number, 0 when no was signal
+ catched; used for mch_libcall() */
+#endif
+EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
+#endif
+
+#if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
+/*
+ * These flags are set based upon 'fileencoding'.
+ * Note that "enc_utf8" is also set for "unicode", because the characters are
+ * internally stored as UTF-8 (to avoid trouble with NUL bytes).
+ */
+# define DBCS_JPN 932 /* japan */
+# define DBCS_JPNU 9932 /* euc-jp */
+# define DBCS_KOR 949 /* korea */
+# define DBCS_KORU 9949 /* euc-kr */
+# define DBCS_CHS 936 /* chinese */
+# define DBCS_CHSU 9936 /* euc-cn */
+# define DBCS_CHT 950 /* taiwan */
+# define DBCS_CHTU 9950 /* euc-tw */
+# define DBCS_2BYTE 1 /* 2byte- */
+# define DBCS_DEBUG -1
+#endif
+
+#ifdef FEAT_MBYTE
+EXTERN int enc_dbcs INIT(= 0); /* One of DBCS_xxx values if
+ DBCS encoding */
+EXTERN int enc_unicode INIT(= 0); /* 2: UCS-2 or UTF-16, 4: UCS-4 */
+EXTERN int enc_utf8 INIT(= FALSE); /* UTF-8 encoded Unicode */
+# ifdef WIN3264
+/* Codepage nr of 'encoding'. Negative means it's not been set yet, zero
+ * means 'encoding' is not a valid codepage. */
+EXTERN int enc_codepage INIT(= -1);
+# endif
+EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
+
+#if defined(WIN3264) && defined(FEAT_MBYTE)
+EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
+#endif
+
+/*
+ * To speed up BYTELEN() we fill a table with the byte lengths whenever
+ * enc_utf8 or enc_dbcs changes.
+ */
+EXTERN char mb_bytelen_tab[256];
+
+/* Variables that tell what conversion is used for keyboard input and display
+ * output. */
+EXTERN vimconv_T input_conv; /* type of input conversion */
+EXTERN vimconv_T output_conv; /* type of output conversion */
+
+/*
+ * Function pointers, used to quickly get to the right function. Each has
+ * three possible values: latin_ (8-bit), utfc_ or utf_ (utf-8) and dbcs_
+ * (DBCS).
+ * The value is set in mb_init();
+ */
+EXTERN int (*mb_ptr2len_check) __ARGS((char_u *p)) INIT(= latin_ptr2len_check);
+EXTERN int (*mb_char2len) __ARGS((int c)) INIT(= latin_char2len);
+EXTERN int (*mb_char2bytes) __ARGS((int c, char_u *buf)) INIT(= latin_char2bytes);
+EXTERN int (*mb_ptr2cells) __ARGS((char_u *p)) INIT(= latin_ptr2cells);
+EXTERN int (*mb_char2cells) __ARGS((int c)) INIT(= latin_char2cells);
+EXTERN int (*mb_off2cells) __ARGS((unsigned off)) INIT(= latin_off2cells);
+EXTERN int (*mb_ptr2char) __ARGS((char_u *p)) INIT(= latin_ptr2char);
+EXTERN int (*mb_head_off) __ARGS((char_u *base, char_u *p)) INIT(= latin_head_off);
+
+# if defined(USE_ICONV) && defined(DYNAMIC_ICONV)
+/* Pointers to functions and variables to be loaded at runtime */
+EXTERN size_t (*iconv) (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+EXTERN iconv_t (*iconv_open) (const char *tocode, const char *fromcode);
+EXTERN int (*iconv_close) (iconv_t cd);
+EXTERN int (*iconvctl) (iconv_t cd, int request, void *argument);
+EXTERN int* (*iconv_errno) (void);
+# endif
+
+#endif /* FEAT_MBYTE */
+
+#ifdef FEAT_XIM
+# ifdef FEAT_GUI_GTK
+# ifdef HAVE_GTK2
+EXTERN GtkIMContext *xic INIT(= NULL);
+# else
+EXTERN GdkICAttr *xic_attr INIT(= NULL);
+EXTERN GdkIC *xic INIT(= NULL);
+EXTERN char *draw_feedback INIT(= NULL);
+# endif
+/*
+ * Start and end column of the preedit area in virtual columns from the start
+ * of the text line. When there is no preedit area they are set to MAXCOL.
+ * "preedit_end_col" is needed for coloring the preedited string. Drawing the
+ * color between "preedit_start_col" and curpos did not work, because some XIM
+ * set the cursor position to the first char of the string.
+ */
+EXTERN colnr_T preedit_start_col INIT(= MAXCOL);
+EXTERN colnr_T preedit_end_col INIT(= MAXCOL);
+
+/* "xim_changed_while_preediting" is set when changed() can set the 'modified'
+ * flag even while preediting. */
+EXTERN int xim_changed_while_preediting INIT(= FALSE);
+# else
+EXTERN XIC xic INIT(= NULL);
+# endif
+EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR);
+EXTERN guicolor_T xim_bg_color INIT(= INVALCOLOR);
+#endif
+
+#ifdef FEAT_HANGULIN
+EXTERN int composing_hangul INIT(= 0);
+EXTERN char_u composing_hangul_buffer[5];
+#endif
+
+/*
+ * "State" is the main state of Vim.
+ * There are other variables that modify the state:
+ * "Visual_mode" When State is NORMAL or INSERT.
+ * "finish_op" When State is NORMAL, after typing the operator and before
+ * typing the motion command.
+ */
+EXTERN int State INIT(= NORMAL); /* This is the current state of the
+ * command interpreter. */
+
+EXTERN int finish_op INIT(= FALSE);/* TRUE while an operator is pending */
+
+/*
+ * ex mode (Q) state
+ */
+EXTERN int exmode_active INIT(= 0); /* zero, EXMODE_NORMAL or EXMODE_VIM */
+EXTERN int ex_no_reprint INIT(= FALSE); /* no need to print after z or p */
+
+EXTERN int Recording INIT(= FALSE);/* TRUE when recording into a reg. */
+EXTERN int Exec_reg INIT(= FALSE); /* TRUE when executing a register */
+
+EXTERN int no_mapping INIT(= FALSE); /* currently no mapping allowed */
+EXTERN int no_zero_mapping INIT(= 0); /* mapping zero not allowed */
+EXTERN int allow_keys INIT(= FALSE); /* allow key codes when no_mapping
+ * is set */
+EXTERN int no_u_sync INIT(= 0); /* Don't call u_sync() */
+
+EXTERN int restart_edit INIT(= 0); /* call edit when next cmd finished */
+EXTERN int arrow_used; /* Normally FALSE, set to TRUE after
+ * hitting cursor key in insert mode.
+ * Used by vgetorpeek() to decide when
+ * to call u_sync() */
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u *edit_submode INIT(= NULL); /* msg for CTRL-X submode */
+EXTERN char_u *edit_submode_pre INIT(= NULL); /* prepended to edit_submode */
+EXTERN char_u *edit_submode_extra INIT(= NULL);/* appended to edit_submode */
+EXTERN enum hlf_value edit_submode_highl; /* highl. method for extra info */
+EXTERN int ctrl_x_mode INIT(= 0); /* Which Ctrl-X mode are we in? */
+#endif
+
+EXTERN int no_abbr INIT(= TRUE); /* TRUE when no abbreviations loaded */
+#ifdef MSDOS
+EXTERN int beep_count INIT(= 0); /* nr of beeps since last char typed */
+#endif
+
+#ifdef USE_EXE_NAME
+EXTERN char_u *exe_name; /* the name of the executable */
+#endif
+
+#ifdef USE_ON_FLY_SCROLL
+EXTERN int dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */
+#endif
+EXTERN int mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
+EXTERN int ctrl_c_interrupts INIT(= TRUE); /* CTRL-C sets got_int */
+
+EXTERN cmdmod_T cmdmod; /* Ex command modifiers */
+
+EXTERN int msg_silent INIT(= 0); /* don't print messages */
+EXTERN int emsg_silent INIT(= 0); /* don't print error messages */
+EXTERN int cmd_silent INIT(= FALSE); /* don't echo the command line */
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+EXTERN int swap_exists_action INIT(= 0); /* use dialog when swap file
+ already exists */
+#endif
+
+EXTERN char_u *IObuff; /* sprintf's are done in this buffer,
+ size is IOSIZE */
+EXTERN char_u *NameBuff; /* file names are expanded in this
+ * buffer, size is MAXPATHL */
+EXTERN char_u msg_buf[MSG_BUF_LEN]; /* small buffer for messages */
+
+/* When non-zero, postpone redrawing. */
+EXTERN int RedrawingDisabled INIT(= 0);
+
+EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
+EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
+
+EXTERN struct buffheader stuffbuff /* stuff buffer */
+#ifdef DO_INIT
+ = {{NULL, {NUL}}, NULL, 0, 0}
+#endif
+ ;
+EXTERN typebuf_T typebuf /* typeahead buffer */
+#ifdef DO_INIT
+ = {NULL, NULL}
+#endif
+ ;
+#ifdef FEAT_EX_EXTRA
+EXTERN int ex_normal_busy INIT(= 0); /* recursivenes of ex_normal() */
+#endif
+EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */
+
+EXTERN int KeyTyped; /* TRUE if user typed current char */
+EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */
+#ifdef USE_IM_CONTROL
+EXTERN int vgetc_im_active; /* Input Method was active for last
+ character obtained from vgetc() */
+#endif
+EXTERN int maptick INIT(= 0); /* tick for each non-mapped char */
+
+EXTERN char_u chartab[256]; /* table used in charset.c; See
+ init_chartab() for explanation */
+
+EXTERN int must_redraw INIT(= 0); /* type of redraw necessary */
+EXTERN int skip_redraw INIT(= FALSE); /* skip redraw once */
+EXTERN int do_redraw INIT(= FALSE); /* extra redraw once */
+
+EXTERN int need_highlight_changed INIT(= TRUE);
+EXTERN char_u *use_viminfo INIT(= NULL); /* name of viminfo file to use */
+
+#define NSCRIPT 15
+EXTERN FILE *scriptin[NSCRIPT]; /* streams to read script from */
+EXTERN int curscript INIT(= 0); /* index in scriptin[] */
+EXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */
+EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */
+
+EXTERN int got_int INIT(= FALSE); /* set to TRUE when interrupt
+ signal occurred */
+#ifdef USE_TERM_CONSOLE
+EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */
+#endif
+EXTERN int termcap_active INIT(= FALSE); /* set by starttermcap() */
+EXTERN int cur_tmode INIT(= TMODE_COOK); /* input terminal mode */
+EXTERN int bangredo INIT(= FALSE); /* set to TRUE whith ! command */
+EXTERN int searchcmdlen; /* length of previous search cmd */
+EXTERN int reg_syn INIT(= 0); /* vim_regexec() used for syntax */
+#ifdef FEAT_SYN_HL
+EXTERN int reg_do_extmatch INIT(= 0); /* Used when compiling regexp:
+ * REX_SET to allow \z\(...\),
+ * REX_USE to allow \z\1 et al. */
+EXTERN reg_extmatch_T *re_extmatch_in INIT(= NULL); /* Used by vim_regexec():
+ * strings for \z\1...\z\9 */
+EXTERN reg_extmatch_T *re_extmatch_out INIT(= NULL); /* Set by vim_regexec()
+ * to store \z\(...\) matches */
+#endif
+
+EXTERN int did_outofmem_msg INIT(= FALSE);
+ /* set after out of memory msg */
+EXTERN int did_swapwrite_msg INIT(= FALSE);
+ /* set after swap write error msg */
+EXTERN int undo_off INIT(= FALSE); /* undo switched off for now */
+EXTERN int global_busy INIT(= 0); /* set when :global is executing */
+EXTERN int listcmd_busy INIT(= FALSE); /* set when :argdo, :windo or
+ :bufdo is executing */
+EXTERN int need_start_insertmode INIT(= FALSE);
+ /* start insert mode soon */
+EXTERN char_u *last_cmdline INIT(= NULL); /* last command line (for ":) */
+EXTERN char_u *repeat_cmdline INIT(= NULL); /* command line for "." */
+#ifdef FEAT_CMDHIST
+EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
+#endif
+#ifdef FEAT_AUTOCMD
+EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
+EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
+EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
+#endif
+
+#ifdef FEAT_WINDOWS
+EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */
+EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */
+# ifdef FEAT_QUICKFIX
+EXTERN int g_do_tagpreview INIT(= 0); /* for tag preview commands:
+ height of preview window */
+# endif
+#endif
+EXTERN int replace_offset INIT(= 0); /* offset for replace_push() */
+
+EXTERN char_u *escape_chars INIT(= (char_u *)" \t\\\"|");
+ /* need backslash in cmd line */
+
+EXTERN int keep_help_flag INIT(= FALSE); /* doing :ta from help file */
+
+/*
+ * When a string option is NULL (which only happens in out-of-memory
+ * situations), it is set to empty_option, to avoid having to check for NULL
+ * everywhere.
+ */
+EXTERN char_u *empty_option INIT(= (char_u *)"");
+
+#ifdef DEBUG
+EXTERN FILE *debugfp INIT(= NULL);
+#endif
+
+EXTERN int redir_off INIT(= FALSE); /* no redirection for a moment */
+EXTERN FILE *redir_fd INIT(= NULL); /* message redirection file */
+#ifdef FEAT_EVAL
+EXTERN int redir_reg INIT(= 0); /* message redirection register */
+#endif
+
+#ifdef FEAT_LANGMAP
+EXTERN char_u langmap_mapchar[256]; /* mapping for language keys */
+#endif
+
+#ifdef FEAT_WILDMENU
+EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */
+EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */
+EXTERN int wild_menu_showing INIT(= 0);
+#define WM_SHOWN 1 /* wildmenu showing */
+#define WM_SCROLLED 2 /* wildmenu showing with scroll */
+#endif
+
+#ifdef MSWIN
+EXTERN char_u toupper_tab[256]; /* table for toupper() */
+EXTERN char_u tolower_tab[256]; /* table for tolower() */
+#endif
+
+#ifdef FEAT_LINEBREAK
+EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */
+#endif
+
+/* these are in version.c */
+extern char *Version;
+extern char *mediumVersion;
+#if defined(HAVE_DATE_TIME) && defined(VMS) && defined(VAXC)
+extern char longVersion[];
+#else
+extern char *longVersion;
+#endif
+
+/*
+ * Some file names are stored in pathdef.c, which is generated from the
+ * Makefile to make their value depend on the Makefile.
+ */
+#ifdef HAVE_PATHDEF
+extern char_u *default_vim_dir;
+extern char_u *default_vimruntime_dir;
+extern char_u *all_cflags;
+extern char_u *all_lflags;
+# ifdef VMS
+extern char_u *compiler_version;
+# endif
+extern char_u *compiled_user;
+extern char_u *compiled_sys;
+#endif
+
+/* When a window has a local directory, the absolute path of the global
+ * current directory is stored here (in allocated memory). If the current
+ * directory is not a local directory, globaldir is NULL. */
+EXTERN char_u *globaldir INIT(= NULL);
+
+/* Characters from 'listchars' option */
+EXTERN int lcs_eol INIT(= '$');
+EXTERN int lcs_ext INIT(= NUL);
+EXTERN int lcs_prec INIT(= NUL);
+EXTERN int lcs_tab1 INIT(= NUL);
+EXTERN int lcs_tab2 INIT(= NUL);
+EXTERN int lcs_trail INIT(= NUL);
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
+ || defined(FEAT_FOLDING)
+/* Characters from 'fillchars' option */
+EXTERN int fill_stl INIT(= ' ');
+EXTERN int fill_stlnc INIT(= ' ');
+#endif
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+EXTERN int fill_vert INIT(= ' ');
+EXTERN int fill_fold INIT(= '-');
+EXTERN int fill_diff INIT(= '-');
+#endif
+
+#ifdef FEAT_VISUAL
+/* Whether 'keymodel' contains "stopsel" and "startsel". */
+EXTERN int km_stopsel INIT(= FALSE);
+EXTERN int km_startsel INIT(= FALSE);
+#endif
+
+#ifdef FEAT_CMDWIN
+EXTERN int cedit_key INIT(= -1); /* key value of 'cedit' option */
+EXTERN int cmdwin_type INIT(= 0); /* type of cmdline window or 0 */
+EXTERN int cmdwin_result INIT(= 0); /* result of cmdline window or 0 */
+#endif
+
+EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--"));
+
+/* table to store parsed 'wildmode' */
+EXTERN char_u wim_flags[4];
+
+#if defined(FEAT_TITLE) && defined(FEAT_STL_OPT)
+/* whether titlestring and iconstring contains statusline syntax */
+# define STL_IN_ICON 1
+# define STL_IN_TITLE 2
+EXTERN int stl_syntax INIT(= 0);
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+/* don't use 'hlsearch' temporarily */
+EXTERN int no_hlsearch INIT(= FALSE);
+#endif
+
+#ifdef CURSOR_SHAPE
+/* the table is in misc2.c, because of initializations */
+extern cursorentry_T shape_table[SHAPE_IDX_COUNT];
+#endif
+
+#ifdef FEAT_PRINTER
+# define OPT_PRINT_TOP 0
+# define OPT_PRINT_BOT 1
+# define OPT_PRINT_LEFT 2
+# define OPT_PRINT_RIGHT 3
+# define OPT_PRINT_HEADERHEIGHT 4
+# define OPT_PRINT_SYNTAX 5
+# define OPT_PRINT_NUMBER 6
+# define OPT_PRINT_WRAP 7
+# define OPT_PRINT_DUPLEX 8
+# define OPT_PRINT_PORTRAIT 9
+# define OPT_PRINT_PAPER 10
+# define OPT_PRINT_COLLATE 11
+# define OPT_PRINT_JOBSPLIT 12
+# define OPT_PRINT_FORMFEED 13
+
+# define OPT_PRINT_NUM_OPTIONS 14
+
+EXTERN option_table_T printer_opts[OPT_PRINT_NUM_OPTIONS]
+# ifdef DO_INIT
+ =
+{
+ {"top", TRUE, 0, NULL, 0, FALSE},
+ {"bottom", TRUE, 0, NULL, 0, FALSE},
+ {"left", TRUE, 0, NULL, 0, FALSE},
+ {"right", TRUE, 0, NULL, 0, FALSE},
+ {"header", TRUE, 0, NULL, 0, FALSE},
+ {"syntax", FALSE, 0, NULL, 0, FALSE},
+ {"number", FALSE, 0, NULL, 0, FALSE},
+ {"wrap", FALSE, 0, NULL, 0, FALSE},
+ {"duplex", FALSE, 0, NULL, 0, FALSE},
+ {"portrait", FALSE, 0, NULL, 0, FALSE},
+ {"paper", FALSE, 0, NULL, 0, FALSE},
+ {"collate", FALSE, 0, NULL, 0, FALSE},
+ {"jobsplit", FALSE, 0, NULL, 0, FALSE},
+ {"formfeed", FALSE, 0, NULL, 0, FALSE},
+}
+# endif
+;
+
+/* For prt_get_unit(). */
+# define PRT_UNIT_NONE -1
+# define PRT_UNIT_PERC 0
+# define PRT_UNIT_INCH 1
+# define PRT_UNIT_MM 2
+# define PRT_UNIT_POINT 3
+# define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"}
+#endif
+
+#ifdef FEAT_XCLIPBOARD
+EXTERN char *xterm_display INIT(= NULL); /* xterm display name */
+EXTERN Display *xterm_dpy INIT(= NULL); /* xterm display pointer */
+#endif
+#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11)
+EXTERN XtAppContext app_context INIT(= (XtAppContext)NULL);
+#endif
+
+#ifdef FEAT_GUI_GTK
+EXTERN guint32 gtk_socket_id INIT(= 0);
+EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */
+#endif
+
+#ifdef FEAT_CLIENTSERVER
+EXTERN char_u *serverName INIT(= NULL); /* name of the server */
+EXTERN int received_from_client INIT(= FALSE); /* received text from
+ client */
+# ifdef FEAT_X11
+EXTERN Window commWindow INIT(= None);
+EXTERN Window clientWindow INIT(= None);
+EXTERN Atom commProperty INIT(= None);
+EXTERN char_u *serverDelayedStartName INIT(= NULL);
+# else
+# ifdef PROTO
+typedef int HWND;
+# endif
+EXTERN HWND clientWindow INIT(= 0);
+# endif
+#endif
+
+#if defined(UNIX) || defined(VMS)
+EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */
+#endif
+
+#ifdef BACKSLASH_IN_FILENAME
+EXTERN char psepc INIT(= '\\'); /* normal path separator character */
+EXTERN char psepcN INIT(= '/'); /* abnormal path separator character */
+EXTERN char pseps[2] /* normal path separator string */
+# ifdef DO_INIT
+ = {'\\', 0}
+# endif
+ ;
+EXTERN char psepsN[2] /* abnormal path separator string */
+# ifdef DO_INIT
+ = {'/', 0}
+# endif
+ ;
+#endif
+
+#ifdef FEAT_VIRTUALEDIT
+/* Set to TRUE when an operator is being executed with virtual editing, MAYBE
+ * when no operator is being executed, FALSE otherwise. */
+EXTERN int virtual_op INIT(= MAYBE);
+#endif
+
+#ifdef FEAT_SYN_HL
+/* Display tick, incremented for each call to update_screen() */
+EXTERN disptick_T display_tick INIT(= 0);
+#endif
+
+#ifdef ALT_X_INPUT
+/* we need to be able to go into the displatch loop while processing a command
+ * recevied via alternate input. However, we don't want to process another
+ * command until the first is completed.
+ */
+EXTERN int suppress_alternate_input INIT(= FALSE);
+#endif
+
+#ifdef USE_MCH_ERRMSG
+/* Grow array to collect error messages in until they can be displayed. */
+EXTERN garray_T error_ga
+# ifdef DO_INIT
+ = {0, 0, 0, 0, NULL}
+# endif
+ ;
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+EXTERN char *netbeansArg INIT(= NULL); /* the -nb[:host:port:passwd] arg */
+EXTERN int netbeansCloseFile INIT(= 0); /* send killed if != 0 */
+EXTERN int netbeansFireChanges INIT(= 1); /* send buffer changes if != 0 */
+EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */
+EXTERN int netbeansOpenFile INIT(= 1); /* send fileOpened if != 0 */
+EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */
+EXTERN int netbeansSuppressNoLines INIT(= 0); /* skip "No lines in buffer" */
+EXTERN int usingNetbeans INIT(= 0); /* set if -nb flag is used */
+#endif
+
+/*
+ * The error messages that can be shared are included here.
+ * Excluded are errors that are only used once and debugging messages.
+ */
+EXTERN char_u e_abort[] INIT(=N_("E470: Command aborted"));
+EXTERN char_u e_argreq[] INIT(=N_("E471: Argument required"));
+EXTERN char_u e_backslash[] INIT(=N_("E10: \\ should be followed by /, ? or &"));
+#ifdef FEAT_CMDWIN
+EXTERN char_u e_cmdwin[] INIT(=N_("E11: Invalid in command-line window; <CR> executes, CTRL-C quits"));
+#endif
+EXTERN char_u e_curdir[] INIT(=N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
+#ifdef FEAT_EVAL
+EXTERN char_u e_endif[] INIT(=N_("E171: Missing :endif"));
+EXTERN char_u e_endtry[] INIT(=N_("E600: Missing :endtry"));
+EXTERN char_u e_endwhile[] INIT(=N_("E170: Missing :endwhile"));
+EXTERN char_u e_while[] INIT(=N_("E588: :endwhile without :while"));
+#endif
+EXTERN char_u e_exists[] INIT(=N_("E13: File exists (add ! to override)"));
+EXTERN char_u e_failed[] INIT(=N_("E472: Command failed"));
+#if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
+EXTERN char_u e_fontset[] INIT(=N_("E234: Unknown fontset: %s"));
+#endif
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(MACOS) \
+ || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MSWIN)
+EXTERN char_u e_font[] INIT(=N_("E235: Unknown font: %s"));
+#endif
+#if (defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)) && !defined(HAVE_GTK2)
+EXTERN char_u e_fontwidth[] INIT(=N_("E236: Font \"%s\" is not fixed-width"));
+#endif
+EXTERN char_u e_internal[] INIT(=N_("E473: Internal error"));
+EXTERN char_u e_interr[] INIT(=N_("Interrupted"));
+EXTERN char_u e_invaddr[] INIT(=N_("E14: Invalid address"));
+EXTERN char_u e_invarg[] INIT(=N_("E474: Invalid argument"));
+EXTERN char_u e_invarg2[] INIT(=N_("E475: Invalid argument: %s"));
+#ifdef FEAT_EVAL
+EXTERN char_u e_invexpr2[] INIT(=N_("E15: Invalid expression: %s"));
+#endif
+EXTERN char_u e_invrange[] INIT(=N_("E16: Invalid range"));
+EXTERN char_u e_invcmd[] INIT(=N_("E476: Invalid command"));
+#ifdef UNIX
+EXTERN char_u e_isadir2[] INIT(=N_("E17: \"%s\" is a directory"));
+#endif
+#ifdef FEAT_EVAL
+EXTERN char_u e_letunexp[] INIT(=N_("E18: Unexpected characters before '='"));
+#endif
+#ifdef FEAT_LIBCALL
+EXTERN char_u e_libcall[] INIT(=N_("E364: Library call failed for \"%s()\""));
+#endif
+#if defined(DYNAMIC_PERL) || defined(DYNAMIC_PYTHON) || defined(DYNAMIC_RUBY) \
+ || defined(DYNAMIC_TCL) || defined(DYNAMIC_ICONV) \
+ || defined(DYNAMIC_GETTEXT)
+EXTERN char_u e_loadlib[] INIT(=N_("E370: Could not load library %s"));
+EXTERN char_u e_loadfunc[] INIT(=N_("E448: Could not load library function %s"));
+#endif
+EXTERN char_u e_markinval[] INIT(=N_("E19: Mark has invalid line number"));
+EXTERN char_u e_marknotset[] INIT(=N_("E20: Mark not set"));
+EXTERN char_u e_modifiable[] INIT(=N_("E21: Cannot make changes, 'modifiable' is off"));
+EXTERN char_u e_nesting[] INIT(=N_("E22: Scripts nested too deep"));
+EXTERN char_u e_noalt[] INIT(=N_("E23: No alternate file"));
+EXTERN char_u e_noabbr[] INIT(=N_("E24: No such abbreviation"));
+EXTERN char_u e_nobang[] INIT(=N_("E477: No ! allowed"));
+#ifndef FEAT_GUI
+EXTERN char_u e_nogvim[] INIT(=N_("E25: GUI cannot be used: Not enabled at compile time"));
+#endif
+#ifndef FEAT_RIGHTLEFT
+EXTERN char_u e_nohebrew[] INIT(=N_("E26: Hebrew cannot be used: Not enabled at compile time\n"));
+#endif
+#ifndef FEAT_FKMAP
+EXTERN char_u e_nofarsi[] INIT(=N_("E27: Farsi cannot be used: Not enabled at compile time\n"));
+#endif
+#ifndef FEAT_ARABIC
+EXTERN char_u e_noarabic[] INIT(=N_("E800: Arabic cannot be used: Not enabled at compile time\n"));
+#endif
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_SYN_HL)
+EXTERN char_u e_nogroup[] INIT(=N_("E28: No such highlight group name: %s"));
+#endif
+EXTERN char_u e_noinstext[] INIT(=N_("E29: No inserted text yet"));
+EXTERN char_u e_nolastcmd[] INIT(=N_("E30: No previous command line"));
+EXTERN char_u e_nomap[] INIT(=N_("E31: No such mapping"));
+EXTERN char_u e_nomatch[] INIT(=N_("E479: No match"));
+EXTERN char_u e_nomatch2[] INIT(=N_("E480: No match: %s"));
+EXTERN char_u e_noname[] INIT(=N_("E32: No file name"));
+EXTERN char_u e_nopresub[] INIT(=N_("E33: No previous substitute regular expression"));
+EXTERN char_u e_noprev[] INIT(=N_("E34: No previous command"));
+EXTERN char_u e_noprevre[] INIT(=N_("E35: No previous regular expression"));
+EXTERN char_u e_norange[] INIT(=N_("E481: No range allowed"));
+#ifdef FEAT_WINDOWS
+EXTERN char_u e_noroom[] INIT(=N_("E36: Not enough room"));
+#endif
+#ifdef FEAT_CLIENTSERVER
+EXTERN char_u e_noserver[] INIT(=N_("E247: no registered server named \"%s\""));
+#endif
+EXTERN char_u e_notcreate[] INIT(=N_("E482: Can't create file %s"));
+EXTERN char_u e_notmp[] INIT(=N_("E483: Can't get temp file name"));
+EXTERN char_u e_notopen[] INIT(=N_("E484: Can't open file %s"));
+EXTERN char_u e_notread[] INIT(=N_("E485: Can't read file %s"));
+EXTERN char_u e_nowrtmsg[] INIT(=N_("E37: No write since last change (add ! to override)"));
+EXTERN char_u e_null[] INIT(=N_("E38: Null argument"));
+#ifdef FEAT_DIGRAPHS
+EXTERN char_u e_number_exp[] INIT(=N_("E39: Number expected"));
+#endif
+#ifdef FEAT_QUICKFIX
+EXTERN char_u e_openerrf[] INIT(=N_("E40: Can't open errorfile %s"));
+#endif
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+EXTERN char_u e_opendisp[] INIT(=N_("E233: cannot open display"));
+#endif
+EXTERN char_u e_outofmem[] INIT(=N_("E41: Out of memory!"));
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u e_patnotf[] INIT(=N_("Pattern not found"));
+#endif
+EXTERN char_u e_patnotf2[] INIT(=N_("E486: Pattern not found: %s"));
+EXTERN char_u e_positive[] INIT(=N_("E487: Argument must be positive"));
+#if defined(UNIX) || defined(FEAT_SESSION)
+EXTERN char_u e_prev_dir[] INIT(=N_("E459: Cannot go back to previous directory"));
+#endif
+
+#ifdef FEAT_QUICKFIX
+EXTERN char_u e_quickfix[] INIT(=N_("E42: No Errors"));
+#endif
+EXTERN char_u e_re_damg[] INIT(=N_("E43: Damaged match string"));
+EXTERN char_u e_re_corr[] INIT(=N_("E44: Corrupted regexp program"));
+EXTERN char_u e_readonly[] INIT(=N_("E45: 'readonly' option is set (add ! to override)"));
+#ifdef FEAT_EVAL
+EXTERN char_u e_readonlyvar[] INIT(=N_("E46: Cannot set read-only variable \"%s\""));
+#endif
+#ifdef FEAT_QUICKFIX
+EXTERN char_u e_readerrf[] INIT(=N_("E47: Error while reading errorfile"));
+#endif
+#ifdef HAVE_SANDBOX
+EXTERN char_u e_sandbox[] INIT(=N_("E48: Not allowed in sandbox"));
+#endif
+EXTERN char_u e_secure[] INIT(=N_("E523: Not allowed here"));
+#if defined(AMIGA) || defined(MACOS) || defined(MSWIN) || defined(RISCOS) \
+ || defined(UNIX) || defined(VMS)
+EXTERN char_u e_screenmode[] INIT(=N_("E359: Screen mode setting not supported"));
+#endif
+EXTERN char_u e_scroll[] INIT(=N_("E49: Invalid scroll size"));
+EXTERN char_u e_shellempty[] INIT(=N_("E91: 'shell' option is empty"));
+#if defined(FEAT_SIGN_ICONS) && !defined(HAVE_GTK2)
+EXTERN char_u e_signdata[] INIT(=N_("E255: Couldn't read in sign data!"));
+#endif
+EXTERN char_u e_swapclose[] INIT(=N_("E72: Close error on swap file"));
+EXTERN char_u e_tagstack[] INIT(=N_("E73: tag stack empty"));
+EXTERN char_u e_toocompl[] INIT(=N_("E74: Command too complex"));
+EXTERN char_u e_longname[] INIT(=N_("E75: Name too long"));
+EXTERN char_u e_toomsbra[] INIT(=N_("E76: Too many ["));
+EXTERN char_u e_toomany[] INIT(=N_("E77: Too many file names"));
+EXTERN char_u e_trailing[] INIT(=N_("E488: Trailing characters"));
+EXTERN char_u e_umark[] INIT(=N_("E78: Unknown mark"));
+EXTERN char_u e_wildexpand[] INIT(=N_("E79: Cannot expand wildcards"));
+#ifdef FEAT_WINDOWS
+EXTERN char_u e_winheight[] INIT(=N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
+# ifdef FEAT_VERTSPLIT
+EXTERN char_u e_winwidth[] INIT(=N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
+# endif
+#endif
+EXTERN char_u e_write[] INIT(=N_("E80: Error while writing"));
+EXTERN char_u e_zerocount[] INIT(=N_("Zero count"));
+#ifdef FEAT_EVAL
+EXTERN char_u e_usingsid[] INIT(=N_("E81: Using <SID> not in a script context"));
+#endif
+#ifdef FEAT_CLIENTSERVER
+EXTERN char_u e_invexprmsg[] INIT(=N_("E449: Invalid expression received"));
+#endif
+#ifdef FEAT_NETBEANS_INTG
+EXTERN char_u e_guarded[] INIT(=N_("E463: Region is guarded, cannot modify"));
+#endif
+#ifdef MACOS_X_UNIX
+EXTERN short disallow_gui INIT(= FALSE);
+#endif
+
+/*
+ * Comms. with the session manager (XSMP)
+ */
+#ifdef USE_XSMP
+EXTERN int xsmp_icefd INIT(= -1); /* The actual connection */
+#endif
+
+/*
+ * Optional Farsi support. Include it here, so EXTERN and INIT are defined.
+ */
+#ifdef FEAT_FKMAP
+# include "farsi.h"
+#endif
+
+/*
+ * Optional Arabic support. Include it here, so EXTERN and INIT are defined.
+ */
+#ifdef FEAT_ARABIC
+# include "arabic.h"
+#endif
diff --git a/src/gui.c b/src/gui.c
new file mode 100644
index 000000000..3ffa2257d
--- /dev/null
+++ b/src/gui.c
@@ -0,0 +1,4740 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+/* Structure containing all the GUI information */
+gui_T gui;
+
+#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+static void set_guifontwide __ARGS((char_u *font_name));
+#endif
+static void gui_check_pos __ARGS((void));
+static void gui_position_components __ARGS((int));
+static void gui_outstr __ARGS((char_u *, int));
+static int gui_screenchar __ARGS((int off, int flags, guicolor_T fg, guicolor_T bg, int back));
+#ifdef HAVE_GTK2
+static int gui_screenstr __ARGS((int off, int len, int flags, guicolor_T fg, guicolor_T bg, int back));
+#endif
+static void gui_delete_lines __ARGS((int row, int count));
+static void gui_insert_lines __ARGS((int row, int count));
+static void fill_mouse_coord __ARGS((char_u *p, int col, int row));
+static void gui_do_scrollbar __ARGS((win_T *wp, int which, int enable));
+static colnr_T scroll_line_len __ARGS((linenr_T lnum));
+static void gui_update_horiz_scrollbar __ARGS((int));
+static win_T *xy2win __ARGS((int x, int y));
+
+static int can_update_cursor = TRUE; /* can display the cursor */
+
+/*
+ * The Athena scrollbars can move the thumb to after the end of the scrollbar,
+ * this makes the thumb indicate the part of the text that is shown. Motif
+ * can't do this.
+ */
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MAC)
+# define SCROLL_PAST_END
+#endif
+
+/*
+ * gui_start -- Called when user wants to start the GUI.
+ *
+ * Careful: This function can be called recursively when there is a ":gui"
+ * command in the .gvimrc file. Only the first call should fork, not the
+ * recursive call.
+ */
+ void
+gui_start()
+{
+ char_u *old_term;
+#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOS_X)
+# define MAY_FORK
+ int dofork = TRUE;
+#endif
+ static int recursive = 0;
+
+ old_term = vim_strsave(T_NAME);
+
+ /*
+ * Set_termname() will call gui_init() to start the GUI.
+ * Set the "starting" flag, to indicate that the GUI will start.
+ *
+ * We don't want to open the GUI shell until after we've read .gvimrc,
+ * otherwise we don't know what font we will use, and hence we don't know
+ * what size the shell should be. So if there are errors in the .gvimrc
+ * file, they will have to go to the terminal: Set full_screen to FALSE.
+ * full_screen will be set to TRUE again by a successful termcapinit().
+ */
+ settmode(TMODE_COOK); /* stop RAW mode */
+ if (full_screen)
+ cursor_on(); /* needed for ":gui" in .vimrc */
+ gui.starting = TRUE;
+ full_screen = FALSE;
+
+#ifdef MAY_FORK
+ if (!gui.dofork || vim_strchr(p_go, GO_FORG) || recursive)
+ dofork = FALSE;
+#endif
+ ++recursive;
+
+ termcapinit((char_u *)"builtin_gui");
+ gui.starting = recursive - 1;
+
+ if (!gui.in_use) /* failed to start GUI */
+ {
+ termcapinit(old_term); /* back to old term settings */
+ settmode(TMODE_RAW); /* restart RAW mode */
+#ifdef FEAT_TITLE
+ set_title_defaults(); /* set 'title' and 'icon' again */
+#endif
+ }
+
+ vim_free(old_term);
+
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+ if (gui.in_use)
+ /* Display error messages in a dialog now. */
+ display_errors();
+#endif
+
+#if defined(MAY_FORK) && !defined(__QNXNTO__)
+ /*
+ * Quit the current process and continue in the child.
+ * Makes "gvim file" disconnect from the shell it was started in.
+ * Don't do this when Vim was started with "-f" or the 'f' flag is present
+ * in 'guioptions'.
+ */
+ if (gui.in_use && dofork)
+ {
+ int pipefd[2]; /* pipe between parent and child */
+ int pipe_error;
+ char dummy;
+ pid_t pid = -1;
+
+ /* Setup a pipe between the child and the parent, so that the parent
+ * knows when the child has done the setsid() call and is allowed to
+ * exit. */
+ pipe_error = (pipe(pipefd) < 0);
+ pid = fork();
+ if (pid > 0) /* Parent */
+ {
+ /* Give the child some time to do the setsid(), otherwise the
+ * exit() may kill the child too (when starting gvim from inside a
+ * gvim). */
+ if (pipe_error)
+ ui_delay(300L, TRUE);
+ else
+ {
+ /* The read returns when the child closes the pipe (or when
+ * the child dies for some reason). */
+ close(pipefd[1]);
+ (void)read(pipefd[0], &dummy, (size_t)1);
+ close(pipefd[0]);
+ }
+
+ /* When swapping screens we may need to go to the next line, e.g.,
+ * after a hit-enter prompt and using ":gui". */
+ if (newline_on_exit)
+ mch_errmsg("\r\n");
+
+ /*
+ * The parent must skip the normal exit() processing, the child
+ * will do it. For example, GTK messes up signals when exiting.
+ */
+ _exit(0);
+ }
+
+# if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
+ /*
+ * Change our process group. On some systems/shells a CTRL-C in the
+ * shell where Vim was started would otherwise kill gvim!
+ */
+ if (pid == 0) /* child */
+# if defined(HAVE_SETSID)
+ (void)setsid();
+# else
+ (void)setpgid(0, 0);
+# endif
+# endif
+ if (!pipe_error)
+ {
+ close(pipefd[0]);
+ close(pipefd[1]);
+ }
+
+# if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
+ /* Tell the session manager our new PID */
+ gui_mch_forked();
+# endif
+ }
+#else
+# if defined(__QNXNTO__)
+ if (gui.in_use && dofork)
+ procmgr_daemon(0, PROCMGR_DAEMON_KEEPUMASK | PROCMGR_DAEMON_NOCHDIR |
+ PROCMGR_DAEMON_NOCLOSE | PROCMGR_DAEMON_NODEVNULL);
+# endif
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /* If the GUI started successfully, trigger the GUIEnter event */
+ if (gui.in_use)
+ apply_autocmds(EVENT_GUIENTER, NULL, NULL, FALSE, curbuf);
+#endif
+
+ --recursive;
+}
+
+/*
+ * Call this when vim starts up, whether or not the GUI is started
+ */
+ void
+gui_prepare(argc, argv)
+ int *argc;
+ char **argv;
+{
+ gui.in_use = FALSE; /* No GUI yet (maybe later) */
+ gui.starting = FALSE; /* No GUI yet (maybe later) */
+ gui_mch_prepare(argc, argv);
+}
+
+/*
+ * Try initializing the GUI and check if it can be started.
+ * Used from main() to check early if "vim -g" can start the GUI.
+ * Used from gui_init() to prepare for starting the GUI.
+ * Returns FAIL or OK.
+ */
+ int
+gui_init_check()
+{
+ static int result = MAYBE;
+
+ if (result != MAYBE)
+ {
+ if (result == FAIL)
+ EMSG(_("E229: Cannot start the GUI"));
+ return result;
+ }
+
+ gui.shell_created = FALSE;
+ gui.dying = FALSE;
+ gui.in_focus = TRUE; /* so the guicursor setting works */
+ gui.dragged_sb = SBAR_NONE;
+ gui.dragged_wp = NULL;
+ gui.pointer_hidden = FALSE;
+ gui.col = 0;
+ gui.row = 0;
+ gui.num_cols = Columns;
+ gui.num_rows = Rows;
+
+ gui.cursor_is_valid = FALSE;
+ gui.scroll_region_top = 0;
+ gui.scroll_region_bot = Rows - 1;
+ gui.scroll_region_left = 0;
+ gui.scroll_region_right = Columns - 1;
+ gui.highlight_mask = HL_NORMAL;
+ gui.char_width = 1;
+ gui.char_height = 1;
+ gui.char_ascent = 0;
+ gui.border_width = 0;
+
+ gui.norm_font = NOFONT;
+#ifndef HAVE_GTK2
+ gui.bold_font = NOFONT;
+ gui.ital_font = NOFONT;
+ gui.boldital_font = NOFONT;
+# ifdef FEAT_XFONTSET
+ gui.fontset = NOFONTSET;
+# endif
+#endif
+
+#ifdef FEAT_MENU
+# ifndef HAVE_GTK2
+# ifdef FONTSET_ALWAYS
+ gui.menu_fontset = NOFONTSET;
+# else
+ gui.menu_font = NOFONT;
+# endif
+# endif
+ gui.menu_is_active = TRUE; /* default: include menu */
+# ifndef FEAT_GUI_GTK
+ gui.menu_height = MENU_DEFAULT_HEIGHT;
+ gui.menu_width = 0;
+# endif
+#endif
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
+ gui.toolbar_height = 0;
+#endif
+#if defined(FEAT_FOOTER) && defined(FEAT_GUI_MOTIF)
+ gui.footer_height = 0;
+#endif
+#ifdef FEAT_BEVAL_TIP
+ gui.tooltip_fontset = NOFONTSET;
+#endif
+
+ gui.scrollbar_width = gui.scrollbar_height = SB_DEFAULT_WIDTH;
+ gui.prev_wrap = -1;
+
+#ifdef ALWAYS_USE_GUI
+ result = OK;
+#else
+ result = gui_mch_init_check();
+#endif
+ return result;
+}
+
+/*
+ * This is the call which starts the GUI.
+ */
+ void
+gui_init()
+{
+ win_T *wp;
+ static int recursive = 0;
+
+ /*
+ * It's possible to use ":gui" in a .gvimrc file. The first halve of this
+ * function will then be executed at the first call, the rest by the
+ * recursive call. This allow the shell to be opened halfway reading a
+ * gvimrc file.
+ */
+ if (!recursive)
+ {
+ ++recursive;
+
+ clip_init(TRUE);
+
+ /* If can't initialize, don't try doing the rest */
+ if (gui_init_check() == FAIL)
+ {
+ --recursive;
+ clip_init(FALSE);
+ return;
+ }
+
+ /*
+ * Set up system-wide default menus.
+ */
+#if defined(SYS_MENU_FILE) && defined(FEAT_MENU)
+ if (vim_strchr(p_go, GO_NOSYSMENU) == NULL)
+ {
+ sys_menu = TRUE;
+ do_source((char_u *)SYS_MENU_FILE, FALSE, FALSE);
+ sys_menu = FALSE;
+ }
+#endif
+
+ /*
+ * Switch on the mouse by default, unless the user changed it already.
+ * This can then be changed in the .gvimrc.
+ */
+ if (!option_was_set((char_u *)"mouse"))
+ set_string_option_direct((char_u *)"mouse", -1,
+ (char_u *)"a", OPT_FREE);
+
+ /*
+ * If -U option given, use only the initializations from that file and
+ * nothing else. Skip all initializations for "-U NONE" or "-u NORC".
+ */
+ if (use_gvimrc != NULL)
+ {
+ if (STRCMP(use_gvimrc, "NONE") != 0
+ && STRCMP(use_gvimrc, "NORC") != 0
+ && do_source(use_gvimrc, FALSE, FALSE) != OK)
+ EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc);
+ }
+ else
+ {
+ /*
+ * Get system wide defaults for gvim, only when file name defined.
+ */
+#ifdef SYS_GVIMRC_FILE
+ do_source((char_u *)SYS_GVIMRC_FILE, FALSE, FALSE);
+#endif
+
+ /*
+ * Try to read GUI initialization commands from the following
+ * places:
+ * - environment variable GVIMINIT
+ * - the user gvimrc file (~/.gvimrc)
+ * - the second user gvimrc file ($VIM/.gvimrc for Dos)
+ * - the third user gvimrc file ($VIM/.gvimrc for Amiga)
+ * The first that exists is used, the rest is ignored.
+ */
+ if (process_env((char_u *)"GVIMINIT", FALSE) == FAIL
+ && do_source((char_u *)USR_GVIMRC_FILE, TRUE, FALSE) == FAIL
+#ifdef USR_GVIMRC_FILE2
+ && do_source((char_u *)USR_GVIMRC_FILE2, TRUE, FALSE) == FAIL
+#endif
+ )
+ {
+#ifdef USR_GVIMRC_FILE3
+ (void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, FALSE);
+#endif
+ }
+
+ /*
+ * Read initialization commands from ".gvimrc" in current
+ * directory. This is only done if the 'exrc' option is set.
+ * Because of security reasons we disallow shell and write
+ * commands now, except for unix if the file is owned by the user
+ * or 'secure' option has been reset in environment of global
+ * ".gvimrc".
+ * Only do this if GVIMRC_FILE is not the same as USR_GVIMRC_FILE,
+ * USR_GVIMRC_FILE2, USR_GVIMRC_FILE3 or SYS_GVIMRC_FILE.
+ */
+ if (p_exrc)
+ {
+#ifdef UNIX
+ {
+ struct stat s;
+
+ /* if ".gvimrc" file is not owned by user, set 'secure'
+ * mode */
+ if (mch_stat(GVIMRC_FILE, &s) || s.st_uid != getuid())
+ secure = p_secure;
+ }
+#else
+ secure = p_secure;
+#endif
+
+ if ( fullpathcmp((char_u *)USR_GVIMRC_FILE,
+ (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
+#ifdef SYS_GVIMRC_FILE
+ && fullpathcmp((char_u *)SYS_GVIMRC_FILE,
+ (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
+#endif
+#ifdef USR_GVIMRC_FILE2
+ && fullpathcmp((char_u *)USR_GVIMRC_FILE2,
+ (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
+#endif
+#ifdef USR_GVIMRC_FILE3
+ && fullpathcmp((char_u *)USR_GVIMRC_FILE3,
+ (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
+#endif
+ )
+ do_source((char_u *)GVIMRC_FILE, TRUE, FALSE);
+
+ if (secure == 2)
+ need_wait_return = TRUE;
+ secure = 0;
+ }
+ }
+
+ if (need_wait_return || msg_didany)
+ wait_return(TRUE);
+
+ --recursive;
+ }
+
+ /* If recursive call opened the shell, return here from the first call */
+ if (gui.in_use)
+ return;
+
+ /*
+ * Create the GUI shell.
+ */
+ gui.in_use = TRUE; /* Must be set after menus have been set up */
+ if (gui_mch_init() == FAIL)
+ goto error;
+
+ /* Avoid a delay for an error message that was printed in the terminal
+ * where Vim was started. */
+ emsg_on_display = FALSE;
+ msg_scrolled = 0;
+ need_wait_return = FALSE;
+ msg_didany = FALSE;
+
+ /*
+ * Check validity of any generic resources that may have been loaded.
+ */
+ if (gui.border_width < 0)
+ gui.border_width = 0;
+
+ /*
+ * Set up the fonts. First use a font specified with "-fn" or "-font".
+ */
+ if (font_argument != NULL)
+ set_option_value((char_u *)"gfn", 0L, (char_u *)font_argument, 0);
+ if (
+#ifdef FEAT_XFONTSET
+ (*p_guifontset == NUL
+ || gui_init_font(p_guifontset, TRUE) == FAIL) &&
+#endif
+ gui_init_font(*p_guifont == NUL ? hl_get_font_name()
+ : p_guifont, FALSE) == FAIL)
+ {
+ EMSG(_("E665: Cannot start GUI, no valid font found"));
+ goto error2;
+ }
+#ifdef FEAT_MBYTE
+ if (gui_get_wide_font() == FAIL)
+ EMSG(_("E231: 'guifontwide' invalid"));
+#endif
+
+ gui.num_cols = Columns;
+ gui.num_rows = Rows;
+ gui_reset_scroll_region();
+
+ /* Create initial scrollbars */
+ FOR_ALL_WINDOWS(wp)
+ {
+ gui_create_scrollbar(&wp->w_scrollbars[SBAR_LEFT], SBAR_LEFT, wp);
+ gui_create_scrollbar(&wp->w_scrollbars[SBAR_RIGHT], SBAR_RIGHT, wp);
+ }
+ gui_create_scrollbar(&gui.bottom_sbar, SBAR_BOTTOM, NULL);
+
+#ifdef FEAT_MENU
+ gui_create_initial_menus(root_menu);
+#endif
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ workshop_init();
+#endif
+#ifdef FEAT_SIGN_ICONS
+ sign_gui_started();
+#endif
+
+ /* Configure the desired menu and scrollbars */
+ gui_init_which_components(NULL);
+
+ /* All components of the GUI have been created now */
+ gui.shell_created = TRUE;
+
+#ifndef FEAT_GUI_GTK
+ /* Set the shell size, adjusted for the screen size. For GTK this only
+ * works after the shell has been opened, thus it is further down. */
+ gui_set_shellsize(FALSE, TRUE);
+#endif
+#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
+ /* Need to set the size of the menubar after all the menus have been
+ * created. */
+ gui_mch_compute_menu_height((Widget)0);
+#endif
+
+ /*
+ * Actually open the GUI shell.
+ */
+ if (gui_mch_open() != FAIL)
+ {
+#ifdef FEAT_TITLE
+ maketitle();
+ resettitle();
+#endif
+ init_gui_options();
+#ifdef FEAT_ARABIC
+ /* Our GUI can't do bidi. */
+ p_tbidi = FALSE;
+#endif
+#ifdef FEAT_GUI_GTK
+ /* Give GTK+ a chance to put all widget's into place. */
+ gui_mch_update();
+ /* Now make sure the shell fits on the screen. */
+ gui_set_shellsize(FALSE, TRUE);
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (starting == 0 && usingNetbeans)
+ /* Tell the client that it can start sending commands. */
+ netbeans_startup_done();
+#endif
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ if (!im_xim_isvalid_imactivate())
+ EMSG(_("E599: Value of 'imactivatekey' is invalid"));
+#endif
+
+ return;
+ }
+
+error2:
+#ifdef FEAT_GUI_X11
+ /* undo gui_mch_init() */
+ gui_mch_uninit();
+#endif
+
+error:
+ gui.in_use = FALSE;
+ clip_init(FALSE);
+}
+
+
+ void
+gui_exit(rc)
+ int rc;
+{
+#ifndef __BEOS__
+ /* don't free the fonts, it leads to a BUS error
+ * richard@whitequeen.com Jul 99 */
+ free_highlight_fonts();
+#endif
+ gui.in_use = FALSE;
+ gui_mch_exit(rc);
+}
+
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(PROTO)
+/*
+ * Called when the GUI shell is closed by the user. If there are no changed
+ * files Vim exits, otherwise there will be a dialog to ask the user what to
+ * do.
+ * When this function returns, Vim should NOT exit!
+ */
+ void
+gui_shell_closed()
+{
+ cmdmod_T save_cmdmod;
+
+ save_cmdmod = cmdmod;
+
+ /* Only exit when there are no changed files */
+ exiting = TRUE;
+# ifdef FEAT_BROWSE
+ cmdmod.browse = TRUE;
+# endif
+# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ cmdmod.confirm = TRUE;
+# endif
+ /* If there are changed buffers, present the user with a dialog if
+ * possible, otherwise give an error message. */
+ if (!check_changed_any(FALSE))
+ getout(0);
+
+ exiting = FALSE;
+ cmdmod = save_cmdmod;
+ setcursor(); /* position cursor */
+ out_flush();
+}
+#endif
+
+/*
+ * Set the font. "font_list" is a a comma separated list of font names. The
+ * first font name that works is used. If none is found, use the default
+ * font.
+ * If "fontset" is TRUE, the "font_list" is used as one name for the fontset.
+ * Return OK when able to set the font. When it failed FAIL is returned and
+ * the fonts are unchanged.
+ */
+/*ARGSUSED*/
+ int
+gui_init_font(font_list, fontset)
+ char_u *font_list;
+ int fontset;
+{
+#define FONTLEN 320
+ char_u font_name[FONTLEN];
+ int font_list_empty = FALSE;
+ int ret = FAIL;
+
+ if (!gui.in_use)
+ return FAIL;
+
+ font_name[0] = NUL;
+ if (*font_list == NUL)
+ font_list_empty = TRUE;
+ else
+ {
+#ifdef FEAT_XFONTSET
+ /* When using a fontset, the whole list of fonts is one name. */
+ if (fontset)
+ ret = gui_mch_init_font(font_list, TRUE);
+ else
+#endif
+ while (*font_list != NUL)
+ {
+ /* Isolate one comma separated font name. */
+ (void)copy_option_part(&font_list, font_name, FONTLEN, ",");
+
+ /* Careful!!! The Win32 version of gui_mch_init_font(), when
+ * called with "*" will change p_guifont to the selected font
+ * name, which frees the old value. This makes font_list
+ * invalid. Thus when OK is returned here, font_list must no
+ * longer be used! */
+ if (gui_mch_init_font(font_name, FALSE) == OK)
+ {
+#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+ /* If it's a Unicode font, try setting 'guifontwide' to a
+ * similar double-width font. */
+ if ((p_guifontwide == NULL || *p_guifontwide == NUL)
+ && strstr((char *)font_name, "10646") != NULL)
+ set_guifontwide(font_name);
+#endif
+ ret = OK;
+ break;
+ }
+ }
+ }
+
+ if (ret != OK
+ && STRCMP(font_list, "*") != 0
+ && (font_list_empty || gui.norm_font == NOFONT))
+ {
+ /*
+ * Couldn't load any font in 'font_list', keep the current font if
+ * there is one. If 'font_list' is empty, or if there is no current
+ * font, tell gui_mch_init_font() to try to find a font we can load.
+ */
+ ret = gui_mch_init_font(NULL, FALSE);
+ }
+
+ if (ret == OK)
+ {
+#ifndef HAVE_GTK2
+ /* Set normal font as current font */
+# ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ gui_mch_set_fontset(gui.fontset);
+ else
+# endif
+ gui_mch_set_font(gui.norm_font);
+#endif
+ gui_set_shellsize(FALSE,
+#ifdef MSWIN
+ TRUE
+#else
+ FALSE
+#endif
+ );
+ }
+
+ return ret;
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+# ifndef HAVE_GTK2
+/*
+ * Try setting 'guifontwide' to a font twice as wide as "name".
+ */
+ static void
+set_guifontwide(name)
+ char_u *name;
+{
+ int i = 0;
+ char_u wide_name[FONTLEN + 10]; /* room for 2 * width and '*' */
+ char_u *wp = NULL;
+ char_u *p;
+ GuiFont font;
+
+ wp = wide_name;
+ for (p = name; *p != NUL; ++p)
+ {
+ *wp++ = *p;
+ if (*p == '-')
+ {
+ ++i;
+ if (i == 6) /* font type: change "--" to "-*-" */
+ {
+ if (p[1] == '-')
+ *wp++ = '*';
+ }
+ else if (i == 12) /* found the width */
+ {
+ ++p;
+ i = getdigits(&p);
+ if (i != 0)
+ {
+ /* Double the width specification. */
+ sprintf((char *)wp, "%d%s", i * 2, p);
+ font = gui_mch_get_font(wide_name, FALSE);
+ if (font != NOFONT)
+ {
+ gui.wide_font = font;
+ set_string_option_direct((char_u *)"gfw", -1,
+ wide_name, OPT_FREE);
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+# endif /* !HAVE_GTK2 */
+
+/*
+ * Get the font for 'guifontwide'.
+ * Return FAIL for an invalid font name.
+ */
+ int
+gui_get_wide_font()
+{
+ GuiFont font = NOFONT;
+ char_u font_name[FONTLEN];
+ char_u *p;
+
+ if (!gui.in_use) /* Can't allocate font yet, assume it's OK. */
+ return OK; /* Will give an error message later. */
+
+ if (p_guifontwide != NULL && *p_guifontwide != NUL)
+ {
+ for (p = p_guifontwide; *p != NUL; )
+ {
+ /* Isolate one comma separated font name. */
+ (void)copy_option_part(&p, font_name, FONTLEN, ",");
+ font = gui_mch_get_font(font_name, FALSE);
+ if (font != NOFONT)
+ break;
+ }
+ if (font == NOFONT)
+ return FAIL;
+ }
+
+ gui_mch_free_font(gui.wide_font);
+#ifdef HAVE_GTK2
+ /* Avoid unnecessary overhead if 'guifontwide' is equal to 'guifont'. */
+ if (font != NOFONT && gui.norm_font != NOFONT
+ && pango_font_description_equal(font, gui.norm_font))
+ {
+ gui.wide_font = NOFONT;
+ gui_mch_free_font(font);
+ }
+ else
+#endif
+ gui.wide_font = font;
+ return OK;
+}
+#endif
+
+ void
+gui_set_cursor(row, col)
+ int row;
+ int col;
+{
+ gui.row = row;
+ gui.col = col;
+}
+
+/*
+ * gui_check_pos - check if the cursor is on the screen.
+ */
+ static void
+gui_check_pos()
+{
+ if (gui.row >= screen_Rows)
+ gui.row = screen_Rows - 1;
+ if (gui.col >= screen_Columns)
+ gui.col = screen_Columns - 1;
+ if (gui.cursor_row >= screen_Rows || gui.cursor_col >= screen_Columns)
+ gui.cursor_is_valid = FALSE;
+}
+
+/*
+ * Redraw the cursor if necessary or when forced.
+ * Careful: The contents of ScreenLines[] must match what is on the screen,
+ * otherwise this goes wrong. May need to call out_flush() first.
+ */
+ void
+gui_update_cursor(force, clear_selection)
+ int force; /* when TRUE, update even when not moved */
+ int clear_selection;/* clear selection under cursor */
+{
+ int cur_width = 0;
+ int cur_height = 0;
+ int old_hl_mask;
+ int idx;
+ int id;
+ guicolor_T cfg, cbg, cc; /* cursor fore-/background color */
+ int cattr; /* cursor attributes */
+ int attr;
+ attrentry_T *aep = NULL;
+
+ /* Don't update the cursor when halfway busy scrolling.
+ * ScreenLines[] isn't valid then. */
+ if (!can_update_cursor)
+ return;
+
+ gui_check_pos();
+ if (!gui.cursor_is_valid || force
+ || gui.row != gui.cursor_row || gui.col != gui.cursor_col)
+ {
+ gui_undraw_cursor();
+ if (gui.row < 0)
+ return;
+#ifdef USE_IM_CONTROL
+ if (gui.row != gui.cursor_row || gui.col != gui.cursor_col)
+ im_set_position(gui.row, gui.col);
+#endif
+ gui.cursor_row = gui.row;
+ gui.cursor_col = gui.col;
+
+ /* Only write to the screen after ScreenLines[] has been initialized */
+ if (!screen_cleared || ScreenLines == NULL)
+ return;
+
+ /* Clear the selection if we are about to write over it */
+ if (clear_selection)
+ clip_may_clear_selection(gui.row, gui.row);
+ /* Check that the cursor is inside the shell (resizing may have made
+ * it invalid) */
+ if (gui.row >= screen_Rows || gui.col >= screen_Columns)
+ return;
+
+ gui.cursor_is_valid = TRUE;
+
+ /*
+ * How the cursor is drawn depends on the current mode.
+ */
+ idx = get_shape_idx(FALSE);
+ if (State & LANGMAP)
+ id = shape_table[idx].id_lm;
+ else
+ id = shape_table[idx].id;
+
+ /* get the colors and attributes for the cursor. Default is inverted */
+ cfg = INVALCOLOR;
+ cbg = INVALCOLOR;
+ cattr = HL_INVERSE;
+ gui_mch_set_blinking(shape_table[idx].blinkwait,
+ shape_table[idx].blinkon,
+ shape_table[idx].blinkoff);
+ if (id > 0)
+ {
+ cattr = syn_id2colors(id, &cfg, &cbg);
+#if defined(USE_IM_CONTROL) || defined(FEAT_HANGULIN)
+ {
+ static int iid;
+ guicolor_T fg, bg;
+
+ if (im_get_status())
+ {
+ iid = syn_name2id((char_u *)"CursorIM");
+ if (iid > 0)
+ {
+ syn_id2colors(iid, &fg, &bg);
+ if (bg != INVALCOLOR)
+ cbg = bg;
+ if (fg != INVALCOLOR)
+ cfg = fg;
+ }
+ }
+ }
+#endif
+ }
+
+ /*
+ * Get the attributes for the character under the cursor.
+ * When no cursor color was given, use the character color.
+ */
+ attr = ScreenAttrs[LineOffset[gui.row] + gui.col];
+ if (attr > HL_ALL)
+ aep = syn_gui_attr2entry(attr);
+ if (aep != NULL)
+ {
+ attr = aep->ae_attr;
+ if (cfg == INVALCOLOR)
+ cfg = ((attr & HL_INVERSE) ? aep->ae_u.gui.bg_color
+ : aep->ae_u.gui.fg_color);
+ if (cbg == INVALCOLOR)
+ cbg = ((attr & HL_INVERSE) ? aep->ae_u.gui.fg_color
+ : aep->ae_u.gui.bg_color);
+ }
+ if (cfg == INVALCOLOR)
+ cfg = (attr & HL_INVERSE) ? gui.back_pixel : gui.norm_pixel;
+ if (cbg == INVALCOLOR)
+ cbg = (attr & HL_INVERSE) ? gui.norm_pixel : gui.back_pixel;
+
+#ifdef FEAT_XIM
+ if (aep != NULL)
+ {
+ xim_bg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.fg_color
+ : aep->ae_u.gui.bg_color);
+ xim_fg_color = ((attr & HL_INVERSE) ? aep->ae_u.gui.bg_color
+ : aep->ae_u.gui.fg_color);
+ if (xim_bg_color == INVALCOLOR)
+ xim_bg_color = (attr & HL_INVERSE) ? gui.norm_pixel
+ : gui.back_pixel;
+ if (xim_fg_color == INVALCOLOR)
+ xim_fg_color = (attr & HL_INVERSE) ? gui.back_pixel
+ : gui.norm_pixel;
+ }
+ else
+ {
+ xim_bg_color = (attr & HL_INVERSE) ? gui.norm_pixel
+ : gui.back_pixel;
+ xim_fg_color = (attr & HL_INVERSE) ? gui.back_pixel
+ : gui.norm_pixel;
+ }
+#endif
+
+ attr &= ~HL_INVERSE;
+ if (cattr & HL_INVERSE)
+ {
+ cc = cbg;
+ cbg = cfg;
+ cfg = cc;
+ }
+ cattr &= ~HL_INVERSE;
+
+ /*
+ * When we don't have window focus, draw a hollow cursor.
+ */
+ if (!gui.in_focus)
+ {
+ gui_mch_draw_hollow_cursor(cbg);
+ return;
+ }
+
+ old_hl_mask = gui.highlight_mask;
+ if (shape_table[idx].shape == SHAPE_BLOCK
+#ifdef FEAT_HANGULIN
+ || composing_hangul
+#endif
+ )
+ {
+ /*
+ * Draw the text character with the cursor colors. Use the
+ * character attributes plus the cursor attributes.
+ */
+ gui.highlight_mask = (cattr | attr);
+#ifdef FEAT_HANGULIN
+ if (composing_hangul)
+ (void)gui_outstr_nowrap(composing_hangul_buffer, 2,
+ GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
+ else
+#endif
+ (void)gui_screenchar(LineOffset[gui.row] + gui.col,
+ GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
+ }
+ else
+ {
+#if defined(FEAT_MBYTE) && defined(FEAT_RIGHTLEFT)
+ int col_off = FALSE;
+#endif
+ /*
+ * First draw the partial cursor, then overwrite with the text
+ * character, using a transparent background.
+ */
+ if (shape_table[idx].shape == SHAPE_VER)
+ {
+ cur_height = gui.char_height;
+ cur_width = (gui.char_width * shape_table[idx].percentage
+ + 99) / 100;
+ }
+ else
+ {
+ cur_height = (gui.char_height * shape_table[idx].percentage
+ + 99) / 100;
+ cur_width = gui.char_width;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (*mb_off2cells)(LineOffset[gui.row] + gui.col) > 1)
+ {
+ /* Double wide character. */
+ if (shape_table[idx].shape != SHAPE_VER)
+ cur_width += gui.char_width;
+# ifdef FEAT_RIGHTLEFT
+ if (CURSOR_BAR_RIGHT)
+ {
+ /* gui.col points to the left halve of the character but
+ * the vertical line needs to be on the right halve.
+ * A double-wide horizontal line is also drawn from the
+ * right halve in gui_mch_draw_part_cursor(). */
+ col_off = TRUE;
+ ++gui.col;
+ }
+# endif
+ }
+#endif
+ gui_mch_draw_part_cursor(cur_width, cur_height, cbg);
+#if defined(FEAT_MBYTE) && defined(FEAT_RIGHTLEFT)
+ if (col_off)
+ --gui.col;
+#endif
+
+#ifndef FEAT_GUI_MSWIN /* doesn't seem to work for MSWindows */
+ gui.highlight_mask = ScreenAttrs[LineOffset[gui.row] + gui.col];
+ (void)gui_screenchar(LineOffset[gui.row] + gui.col,
+ GUI_MON_TRS_CURSOR | GUI_MON_NOCLEAR,
+ (guicolor_T)0, (guicolor_T)0, 0);
+#endif
+ }
+ gui.highlight_mask = old_hl_mask;
+ }
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+ void
+gui_position_menu()
+{
+# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
+ if (gui.menu_is_active && gui.in_use)
+ gui_mch_set_menu_pos(0, 0, gui.menu_width, gui.menu_height);
+# endif
+}
+#endif
+
+/*
+ * Position the various GUI components (text area, menu). The vertical
+ * scrollbars are NOT handled here. See gui_update_scrollbars().
+ */
+/*ARGSUSED*/
+ static void
+gui_position_components(total_width)
+ int total_width;
+{
+ int text_area_x;
+ int text_area_y;
+ int text_area_width;
+ int text_area_height;
+
+ /* avoid that moving components around generates events */
+ ++hold_gui_events;
+
+ text_area_x = 0;
+ if (gui.which_scrollbars[SBAR_LEFT])
+ text_area_x += gui.scrollbar_width;
+
+ text_area_y = 0;
+#if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
+ gui.menu_width = total_width;
+ if (gui.menu_is_active)
+ text_area_y += gui.menu_height;
+#endif
+#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_MSWIN)
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
+ text_area_y = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
+#endif
+
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA))
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
+ {
+# ifdef FEAT_GUI_ATHENA
+ gui_mch_set_toolbar_pos(0, text_area_y,
+ gui.menu_width, gui.toolbar_height);
+# endif
+ text_area_y += gui.toolbar_height;
+ }
+#endif
+
+ text_area_width = gui.num_cols * gui.char_width + gui.border_offset * 2;
+ text_area_height = gui.num_rows * gui.char_height + gui.border_offset * 2;
+
+ gui_mch_set_text_area_pos(text_area_x,
+ text_area_y,
+ text_area_width,
+ text_area_height
+#if defined(FEAT_XIM) && !defined(HAVE_GTK2)
+ + xim_get_status_area_height()
+#endif
+ );
+#ifdef FEAT_MENU
+ gui_position_menu();
+#endif
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ gui_mch_set_scrollbar_pos(&gui.bottom_sbar,
+ text_area_x,
+ text_area_y + text_area_height,
+ text_area_width,
+ gui.scrollbar_height);
+ gui.left_sbar_x = 0;
+ gui.right_sbar_x = text_area_x + text_area_width;
+
+ --hold_gui_events;
+}
+
+ int
+gui_get_base_width()
+{
+ int base_width;
+
+ base_width = 2 * gui.border_offset;
+ if (gui.which_scrollbars[SBAR_LEFT])
+ base_width += gui.scrollbar_width;
+ if (gui.which_scrollbars[SBAR_RIGHT])
+ base_width += gui.scrollbar_width;
+ return base_width;
+}
+
+ int
+gui_get_base_height()
+{
+ int base_height;
+
+ base_height = 2 * gui.border_offset;
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ base_height += gui.scrollbar_height;
+#ifdef FEAT_GUI_GTK
+ /* We can't take the sizes properly into account until anything is
+ * realized. Therefore we recalculate all the values here just before
+ * setting the size. (--mdcki) */
+#else
+# ifdef FEAT_MENU
+ if (gui.menu_is_active)
+ base_height += gui.menu_height;
+# endif
+# ifdef FEAT_TOOLBAR
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
+# if defined(FEAT_GUI_MSWIN) && defined(FEAT_TOOLBAR)
+ base_height += (TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT);
+# else
+ base_height += gui.toolbar_height;
+# endif
+# endif
+# ifdef FEAT_FOOTER
+ if (vim_strchr(p_go, GO_FOOTER) != NULL)
+ base_height += gui.footer_height;
+# endif
+# if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
+ base_height += gui_mch_text_area_extra_height();
+# endif
+#endif
+ return base_height;
+}
+
+/*
+ * Should be called after the GUI shell has been resized. Its arguments are
+ * the new width and height of the shell in pixels.
+ */
+ void
+gui_resize_shell(pixel_width, pixel_height)
+ int pixel_width;
+ int pixel_height;
+{
+ static int busy = FALSE;
+
+ if (!gui.shell_created) /* ignore when still initializing */
+ return;
+
+ /*
+ * Can't resize the screen while it is being redrawn. Remember the new
+ * size and handle it later.
+ */
+ if (updating_screen || busy)
+ {
+ new_pixel_width = pixel_width;
+ new_pixel_height = pixel_height;
+ return;
+ }
+
+again:
+ busy = TRUE;
+
+#ifdef FEAT_GUI_BEOS
+ vim_lock_screen();
+#endif
+
+ /* Flush pending output before redrawing */
+ out_flush();
+
+ gui.num_cols = (pixel_width - gui_get_base_width()) / gui.char_width;
+ gui.num_rows = (pixel_height - gui_get_base_height()
+#if !defined(FEAT_GUI_PHOTON) && !defined(FEAT_GUI_MSWIN)
+ + (gui.char_height / 2)
+#endif
+ ) / gui.char_height;
+
+ gui_position_components(pixel_width);
+
+ gui_reset_scroll_region();
+ /*
+ * At the "more" and ":confirm" prompt there is no redraw, put the cursor
+ * at the last line here (why does it have to be one row too low?).
+ */
+ if (State == ASKMORE || State == CONFIRM)
+ gui.row = gui.num_rows;
+
+ /* Only comparing Rows and Columns may be sufficient, but let's stay on
+ * the safe side. */
+ if (gui.num_rows != screen_Rows || gui.num_cols != screen_Columns
+ || gui.num_rows != Rows || gui.num_cols != Columns)
+ shell_resized();
+
+#ifdef FEAT_GUI_BEOS
+ vim_unlock_screen();
+#endif
+
+ gui_update_scrollbars(TRUE);
+ gui_update_cursor(FALSE, TRUE);
+#if defined(FEAT_XIM) && !defined(HAVE_GTK2)
+ xim_set_status_area();
+#endif
+
+ busy = FALSE;
+ /*
+ * We could have been called again while redrawing the screen.
+ * Need to do it all again with the latest size then.
+ */
+ if (new_pixel_height)
+ {
+ pixel_width = new_pixel_width;
+ pixel_height = new_pixel_height;
+ new_pixel_width = 0;
+ new_pixel_height = 0;
+ goto again;
+ }
+}
+
+/*
+ * Check if gui_resize_shell() must be called.
+ */
+ void
+gui_may_resize_shell()
+{
+ int h, w;
+
+ if (new_pixel_height)
+ {
+ /* careful: gui_resize_shell() may postpone the resize again if we
+ * were called indirectly by it */
+ w = new_pixel_width;
+ h = new_pixel_height;
+ new_pixel_width = 0;
+ new_pixel_height = 0;
+ gui_resize_shell(w, h);
+ }
+}
+
+ int
+gui_get_shellsize()
+{
+ Rows = gui.num_rows;
+ Columns = gui.num_cols;
+ return OK;
+}
+
+/*
+ * Set the size of the Vim shell according to Rows and Columns.
+ */
+/*ARGSUSED*/
+ void
+gui_set_shellsize(mustset, fit_to_display)
+ int mustset; /* set by the user */
+ int fit_to_display;
+{
+ int base_width;
+ int base_height;
+ int width;
+ int height;
+ int min_width;
+ int min_height;
+ int screen_w;
+ int screen_h;
+
+ if (!gui.shell_created)
+ return;
+
+#ifdef MSWIN
+ /* If not setting to a user specified size and maximized, calculate the
+ * number of characters that fit in the maximized window. */
+ if (!mustset && gui_mch_maximized())
+ {
+ gui_mch_newfont();
+ return;
+ }
+#endif
+
+ base_width = gui_get_base_width();
+ base_height = gui_get_base_height();
+#ifdef USE_SUN_WORKSHOP
+ if (!mustset && usingSunWorkShop
+ && workshop_get_width_height(&width, &height))
+ {
+ Columns = (width - base_width + gui.char_width - 1) / gui.char_width;
+ Rows = (height - base_height + gui.char_height - 1) / gui.char_height;
+ }
+ else
+#endif
+ {
+ width = Columns * gui.char_width + base_width;
+ height = Rows * gui.char_height + base_height;
+ }
+
+ if (fit_to_display)
+ {
+ gui_mch_get_screen_dimensions(&screen_w, &screen_h);
+ if (width > screen_w)
+ {
+ Columns = (screen_w - base_width) / gui.char_width;
+ if (Columns < MIN_COLUMNS)
+ Columns = MIN_COLUMNS;
+ width = Columns * gui.char_width + base_width;
+ }
+ if (height > screen_h)
+ {
+ Rows = (screen_h - base_height) / gui.char_height;
+ check_shellsize();
+ height = Rows * gui.char_height + base_height;
+ }
+ }
+ gui.num_cols = Columns;
+ gui.num_rows = Rows;
+
+ min_width = base_width + MIN_COLUMNS * gui.char_width;
+ min_height = base_height + MIN_LINES * gui.char_height;
+
+ gui_mch_set_shellsize(width, height, min_width, min_height,
+ base_width, base_height);
+ if (fit_to_display)
+ {
+ int x, y;
+
+ /* Some window managers put the Vim window left of/above the screen. */
+ gui_mch_update();
+ if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0))
+ gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y);
+ }
+
+ gui_position_components(width);
+ gui_update_scrollbars(TRUE);
+ gui_reset_scroll_region();
+}
+
+/*
+ * Called when Rows and/or Columns has changed.
+ */
+ void
+gui_new_shellsize()
+{
+ gui_reset_scroll_region();
+}
+
+/*
+ * Make scroll region cover whole screen.
+ */
+ void
+gui_reset_scroll_region()
+{
+ gui.scroll_region_top = 0;
+ gui.scroll_region_bot = gui.num_rows - 1;
+ gui.scroll_region_left = 0;
+ gui.scroll_region_right = gui.num_cols - 1;
+}
+
+ void
+gui_start_highlight(mask)
+ int mask;
+{
+ if (mask > HL_ALL) /* highlight code */
+ gui.highlight_mask = mask;
+ else /* mask */
+ gui.highlight_mask |= mask;
+}
+
+ void
+gui_stop_highlight(mask)
+ int mask;
+{
+ if (mask > HL_ALL) /* highlight code */
+ gui.highlight_mask = HL_NORMAL;
+ else /* mask */
+ gui.highlight_mask &= ~mask;
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_clear_block(row1, col1, row2, col2)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+{
+ /* Clear the selection if we are about to write over it */
+ clip_may_clear_selection(row1, row2);
+
+ gui_mch_clear_block(row1, col1, row2, col2);
+
+ /* Invalidate cursor if it was in this block */
+ if ( gui.cursor_row >= row1 && gui.cursor_row <= row2
+ && gui.cursor_col >= col1 && gui.cursor_col <= col2)
+ gui.cursor_is_valid = FALSE;
+}
+
+/*
+ * Write code to update the cursor later. This avoids the need to flush the
+ * output buffer before calling gui_update_cursor().
+ */
+ void
+gui_update_cursor_later()
+{
+ OUT_STR(IF_EB("\033|s", ESC_STR "|s"));
+}
+
+ void
+gui_write(s, len)
+ char_u *s;
+ int len;
+{
+ char_u *p;
+ int arg1 = 0, arg2 = 0;
+ /* this doesn't make sense, disabled until someone can explain why it
+ * would be needed */
+#if 0 && (defined(RISCOS) || defined(WIN16))
+ int force_cursor = TRUE; /* JK230798, stop Vim being smart or
+ our redraw speed will suffer */
+#else
+ int force_cursor = FALSE; /* force cursor update */
+#endif
+ int force_scrollbar = FALSE;
+ static win_T *old_curwin = NULL;
+
+/* #define DEBUG_GUI_WRITE */
+#ifdef DEBUG_GUI_WRITE
+ {
+ int i;
+ char_u *str;
+
+ printf("gui_write(%d):\n ", len);
+ for (i = 0; i < len; i++)
+ if (s[i] == ESC)
+ {
+ if (i != 0)
+ printf("\n ");
+ printf("<ESC>");
+ }
+ else
+ {
+ str = transchar_byte(s[i]);
+ if (str[0] && str[1])
+ printf("<%s>", (char *)str);
+ else
+ printf("%s", (char *)str);
+ }
+ printf("\n");
+ }
+#endif
+ while (len)
+ {
+ if (s[0] == ESC && s[1] == '|')
+ {
+ p = s + 2;
+ if (VIM_ISDIGIT(*p))
+ {
+ arg1 = getdigits(&p);
+ if (p > s + len)
+ break;
+ if (*p == ';')
+ {
+ ++p;
+ arg2 = getdigits(&p);
+ if (p > s + len)
+ break;
+ }
+ }
+ switch (*p)
+ {
+ case 'C': /* Clear screen */
+ clip_scroll_selection(9999);
+ gui_mch_clear_all();
+ gui.cursor_is_valid = FALSE;
+ force_scrollbar = TRUE;
+ break;
+ case 'M': /* Move cursor */
+ gui_set_cursor(arg1, arg2);
+ break;
+ case 's': /* force cursor (shape) update */
+ force_cursor = TRUE;
+ break;
+ case 'R': /* Set scroll region */
+ if (arg1 < arg2)
+ {
+ gui.scroll_region_top = arg1;
+ gui.scroll_region_bot = arg2;
+ }
+ else
+ {
+ gui.scroll_region_top = arg2;
+ gui.scroll_region_bot = arg1;
+ }
+ break;
+#ifdef FEAT_VERTSPLIT
+ case 'V': /* Set vertical scroll region */
+ if (arg1 < arg2)
+ {
+ gui.scroll_region_left = arg1;
+ gui.scroll_region_right = arg2;
+ }
+ else
+ {
+ gui.scroll_region_left = arg2;
+ gui.scroll_region_right = arg1;
+ }
+ break;
+#endif
+ case 'd': /* Delete line */
+ gui_delete_lines(gui.row, 1);
+ break;
+ case 'D': /* Delete lines */
+ gui_delete_lines(gui.row, arg1);
+ break;
+ case 'i': /* Insert line */
+ gui_insert_lines(gui.row, 1);
+ break;
+ case 'I': /* Insert lines */
+ gui_insert_lines(gui.row, arg1);
+ break;
+ case '$': /* Clear to end-of-line */
+ gui_clear_block(gui.row, gui.col, gui.row,
+ (int)Columns - 1);
+ break;
+ case 'h': /* Turn on highlighting */
+ gui_start_highlight(arg1);
+ break;
+ case 'H': /* Turn off highlighting */
+ gui_stop_highlight(arg1);
+ break;
+ case 'f': /* flash the window (visual bell) */
+ gui_mch_flash(arg1 == 0 ? 20 : arg1);
+ break;
+ default:
+ p = s + 1; /* Skip the ESC */
+ break;
+ }
+ len -= (int)(++p - s);
+ s = p;
+ }
+ else if (
+#ifdef EBCDIC
+ CtrlChar(s[0]) != 0 /* Ctrl character */
+#else
+ s[0] < 0x20 /* Ctrl character */
+#endif
+#ifdef FEAT_SIGN_ICONS
+ && s[0] != SIGN_BYTE
+# ifdef FEAT_NETBEANS_INTG
+ && s[0] != MULTISIGN_BYTE
+# endif
+#endif
+ )
+ {
+ if (s[0] == '\n') /* NL */
+ {
+ gui.col = 0;
+ if (gui.row < gui.scroll_region_bot)
+ gui.row++;
+ else
+ gui_delete_lines(gui.scroll_region_top, 1);
+ }
+ else if (s[0] == '\r') /* CR */
+ {
+ gui.col = 0;
+ }
+ else if (s[0] == '\b') /* Backspace */
+ {
+ if (gui.col)
+ --gui.col;
+ }
+ else if (s[0] == Ctrl_L) /* cursor-right */
+ {
+ ++gui.col;
+ }
+ else if (s[0] == Ctrl_G) /* Beep */
+ {
+ gui_mch_beep();
+ }
+ /* Other Ctrl character: shouldn't happen! */
+
+ --len; /* Skip this char */
+ ++s;
+ }
+ else
+ {
+ p = s;
+ while (len > 0 && (
+#ifdef EBCDIC
+ CtrlChar(*p) == 0
+#else
+ *p >= 0x20
+#endif
+#ifdef FEAT_SIGN_ICONS
+ || *p == SIGN_BYTE
+# ifdef FEAT_NETBEANS_INTG
+ || *p == MULTISIGN_BYTE
+# endif
+#endif
+ ))
+ {
+ len--;
+ p++;
+ }
+ gui_outstr(s, (int)(p - s));
+ s = p;
+ }
+ }
+
+ /* Postponed update of the cursor (won't work if "can_update_cursor" isn't
+ * set). */
+ if (force_cursor)
+ gui_update_cursor(TRUE, TRUE);
+
+ /* When switching to another window the dragging must have stopped.
+ * Required for GTK, dragged_sb isn't reset. */
+ if (old_curwin != curwin)
+ gui.dragged_sb = SBAR_NONE;
+
+ /* Update the scrollbars after clearing the screen or when switched
+ * to another window.
+ * Update the horizontal scrollbar always, it's difficult to check all
+ * situations where it might change. */
+ if (force_scrollbar || old_curwin != curwin)
+ gui_update_scrollbars(force_scrollbar);
+ else
+ gui_update_horiz_scrollbar(FALSE);
+ old_curwin = curwin;
+
+ /*
+ * We need to make sure this is cleared since Athena doesn't tell us when
+ * he is done dragging. Do the same for GTK.
+ */
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK)
+ gui.dragged_sb = SBAR_NONE;
+#endif
+
+ gui_mch_flush(); /* In case vim decides to take a nap */
+}
+
+/*
+ * When ScreenLines[] is invalid, updating the cursor should not be done, it
+ * produces wrong results. Call gui_dont_update_cursor() before that code and
+ * gui_can_update_cursor() afterwards.
+ */
+ void
+gui_dont_update_cursor()
+{
+ if (gui.in_use)
+ {
+ /* Undraw the cursor now, we probably can't do it after the change. */
+ gui_undraw_cursor();
+ can_update_cursor = FALSE;
+ }
+}
+
+ void
+gui_can_update_cursor()
+{
+ can_update_cursor = TRUE;
+ /* No need to update the cursor right now, there is always more output
+ * after scrolling. */
+}
+
+ static void
+gui_outstr(s, len)
+ char_u *s;
+ int len;
+{
+ int this_len;
+#ifdef FEAT_MBYTE
+ int cells;
+#endif
+
+ if (len == 0)
+ return;
+
+ if (len < 0)
+ len = (int)STRLEN(s);
+
+ while (len > 0)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Find out how many chars fit in the current line. */
+ cells = 0;
+ for (this_len = 0; this_len < len; )
+ {
+ cells += (*mb_ptr2cells)(s + this_len);
+ if (gui.col + cells > Columns)
+ break;
+ this_len += (*mb_ptr2len_check)(s + this_len);
+ }
+ if (this_len > len)
+ this_len = len; /* don't include following composing char */
+ }
+ else
+#endif
+ if (gui.col + len > Columns)
+ this_len = Columns - gui.col;
+ else
+ this_len = len;
+
+ (void)gui_outstr_nowrap(s, this_len,
+ 0, (guicolor_T)0, (guicolor_T)0, 0);
+ s += this_len;
+ len -= this_len;
+#ifdef FEAT_MBYTE
+ /* fill up for a double-width char that doesn't fit. */
+ if (len > 0 && gui.col < Columns)
+ (void)gui_outstr_nowrap((char_u *)" ", 1,
+ 0, (guicolor_T)0, (guicolor_T)0, 0);
+#endif
+ /* The cursor may wrap to the next line. */
+ if (gui.col >= Columns)
+ {
+ gui.col = 0;
+ gui.row++;
+ }
+ }
+}
+
+/*
+ * Output one character (may be one or two display cells).
+ * Caller must check for valid "off".
+ * Returns FAIL or OK, just like gui_outstr_nowrap().
+ */
+ static int
+gui_screenchar(off, flags, fg, bg, back)
+ int off; /* Offset from start of screen */
+ int flags;
+ guicolor_T fg, bg; /* colors for cursor */
+ int back; /* backup this many chars when using bold trick */
+{
+#ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+
+ /* Don't draw right halve of a double-width UTF-8 char. "cannot happen" */
+ if (enc_utf8 && ScreenLines[off] == 0)
+ return OK;
+
+ if (enc_utf8 && ScreenLinesUC[off] != 0)
+ /* Draw UTF-8 multi-byte character. */
+ return gui_outstr_nowrap(buf, utfc_char2bytes(off, buf),
+ flags, fg, bg, back);
+
+ if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
+ {
+ buf[0] = ScreenLines[off];
+ buf[1] = ScreenLines2[off];
+ return gui_outstr_nowrap(buf, 2, flags, fg, bg, back);
+ }
+
+ /* Draw non-multi-byte character or DBCS character. */
+ return gui_outstr_nowrap(ScreenLines + off,
+ enc_dbcs ? (*mb_ptr2len_check)(ScreenLines + off) : 1,
+ flags, fg, bg, back);
+#else
+ return gui_outstr_nowrap(ScreenLines + off, 1, flags, fg, bg, back);
+#endif
+}
+
+#ifdef HAVE_GTK2
+/*
+ * Output the string at the given screen position. This is used in place
+ * of gui_screenchar() where possible because Pango needs as much context
+ * as possible to work nicely. It's a lot faster as well.
+ */
+ static int
+gui_screenstr(off, len, flags, fg, bg, back)
+ int off; /* Offset from start of screen */
+ int len; /* string length in screen cells */
+ int flags;
+ guicolor_T fg, bg; /* colors for cursor */
+ int back; /* backup this many chars when using bold trick */
+{
+ char_u *buf;
+ int outlen = 0;
+ int i;
+ int retval;
+
+ if (len <= 0) /* "cannot happen"? */
+ return OK;
+
+ if (enc_utf8)
+ {
+ buf = alloc((unsigned)(len * MB_MAXBYTES + 1));
+ if (buf == NULL)
+ return OK; /* not much we could do here... */
+
+ for (i = off; i < off + len; ++i)
+ {
+ if (ScreenLines[i] == 0)
+ continue; /* skip second half of double-width char */
+
+ if (ScreenLinesUC[i] == 0)
+ buf[outlen++] = ScreenLines[i];
+ else
+ outlen += utfc_char2bytes(i, buf + outlen);
+ }
+
+ buf[outlen] = NUL; /* only to aid debugging */
+ retval = gui_outstr_nowrap(buf, outlen, flags, fg, bg, back);
+ vim_free(buf);
+
+ return retval;
+ }
+ else if (enc_dbcs == DBCS_JPNU)
+ {
+ buf = alloc((unsigned)(len * 2 + 1));
+ if (buf == NULL)
+ return OK; /* not much we could do here... */
+
+ for (i = off; i < off + len; ++i)
+ {
+ buf[outlen++] = ScreenLines[i];
+
+ /* handle double-byte single-width char */
+ if (ScreenLines[i] == 0x8e)
+ buf[outlen++] = ScreenLines2[i];
+ else if (MB_BYTE2LEN(ScreenLines[i]) == 2)
+ buf[outlen++] = ScreenLines[++i];
+ }
+
+ buf[outlen] = NUL; /* only to aid debugging */
+ retval = gui_outstr_nowrap(buf, outlen, flags, fg, bg, back);
+ vim_free(buf);
+
+ return retval;
+ }
+ else
+ {
+ return gui_outstr_nowrap(&ScreenLines[off], len,
+ flags, fg, bg, back);
+ }
+}
+#endif /* HAVE_GTK2 */
+
+/*
+ * Output the given string at the current cursor position. If the string is
+ * too long to fit on the line, then it is truncated.
+ * "flags":
+ * GUI_MON_IS_CURSOR should only be used when this function is being called to
+ * actually draw (an inverted) cursor.
+ * GUI_MON_TRS_CURSOR is used to draw the cursor text with a transparant
+ * background.
+ * GUI_MON_NOCLEAR is used to avoid clearing the selection when drawing over
+ * it.
+ * Returns OK, unless "back" is non-zero and using the bold trick, then return
+ * FAIL (the caller should start drawing "back" chars back).
+ */
+ int
+gui_outstr_nowrap(s, len, flags, fg, bg, back)
+ char_u *s;
+ int len;
+ int flags;
+ guicolor_T fg, bg; /* colors for cursor */
+ int back; /* backup this many chars when using bold trick */
+{
+ long_u highlight_mask;
+ long_u hl_mask_todo;
+ guicolor_T fg_color;
+ guicolor_T bg_color;
+#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
+ GuiFont font = NOFONT;
+# ifdef FEAT_XFONTSET
+ GuiFontset fontset = NOFONTSET;
+# endif
+#endif
+ attrentry_T *aep = NULL;
+ int draw_flags;
+ int col = gui.col;
+#ifdef FEAT_SIGN_ICONS
+ int draw_sign = FALSE;
+# ifdef FEAT_NETBEANS_INTG
+ int multi_sign = FALSE;
+# endif
+#endif
+
+ if (len < 0)
+ len = (int)STRLEN(s);
+ if (len == 0)
+ return OK;
+
+#ifdef FEAT_SIGN_ICONS
+ if (*s == SIGN_BYTE
+# ifdef FEAT_NETBEANS_INTG
+ || *s == MULTISIGN_BYTE
+# endif
+ )
+ {
+# ifdef FEAT_NETBEANS_INTG
+ if (*s == MULTISIGN_BYTE)
+ multi_sign = TRUE;
+# endif
+ /* draw spaces instead */
+ s = (char_u *)" ";
+ if (len == 1 && col > 0)
+ --col;
+ len = 2;
+ draw_sign = TRUE;
+ highlight_mask = 0;
+ }
+ else
+#endif
+ if (gui.highlight_mask > HL_ALL)
+ {
+ aep = syn_gui_attr2entry(gui.highlight_mask);
+ if (aep == NULL) /* highlighting not set */
+ highlight_mask = 0;
+ else
+ highlight_mask = aep->ae_attr;
+ }
+ else
+ highlight_mask = gui.highlight_mask;
+ hl_mask_todo = highlight_mask;
+
+#if !defined(MSWIN16_FASTTEXT) && !defined(HAVE_GTK2)
+ /* Set the font */
+ if (aep != NULL && aep->ae_u.gui.font != NOFONT)
+ font = aep->ae_u.gui.font;
+# ifdef FEAT_XFONTSET
+ else if (aep != NULL && aep->ae_u.gui.fontset != NOFONTSET)
+ fontset = aep->ae_u.gui.fontset;
+# endif
+ else
+ {
+# ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ fontset = gui.fontset;
+ else
+# endif
+ if (hl_mask_todo & (HL_BOLD | HL_STANDOUT))
+ {
+ if ((hl_mask_todo & HL_ITALIC) && gui.boldital_font != NOFONT)
+ {
+ font = gui.boldital_font;
+ hl_mask_todo &= ~(HL_BOLD | HL_STANDOUT | HL_ITALIC);
+ }
+ else if (gui.bold_font != NOFONT)
+ {
+ font = gui.bold_font;
+ hl_mask_todo &= ~(HL_BOLD | HL_STANDOUT);
+ }
+ else
+ font = gui.norm_font;
+ }
+ else if ((hl_mask_todo & HL_ITALIC) && gui.ital_font != NOFONT)
+ {
+ font = gui.ital_font;
+ hl_mask_todo &= ~HL_ITALIC;
+ }
+ else
+ font = gui.norm_font;
+ }
+# ifdef FEAT_XFONTSET
+ if (fontset != NOFONTSET)
+ gui_mch_set_fontset(fontset);
+ else
+# endif
+ gui_mch_set_font(font);
+#endif
+
+ draw_flags = 0;
+
+ /* Set the color */
+ bg_color = gui.back_pixel;
+ if ((flags & GUI_MON_IS_CURSOR) && gui.in_focus)
+ {
+ draw_flags |= DRAW_CURSOR;
+ fg_color = fg;
+ bg_color = bg;
+ }
+ else if (aep != NULL)
+ {
+ fg_color = aep->ae_u.gui.fg_color;
+ if (fg_color == INVALCOLOR)
+ fg_color = gui.norm_pixel;
+ bg_color = aep->ae_u.gui.bg_color;
+ if (bg_color == INVALCOLOR)
+ bg_color = gui.back_pixel;
+ }
+ else
+ fg_color = gui.norm_pixel;
+
+ if (highlight_mask & (HL_INVERSE | HL_STANDOUT))
+ {
+#if defined(AMIGA) || defined(RISCOS)
+ gui_mch_set_colors(bg_color, fg_color);
+#else
+ gui_mch_set_fg_color(bg_color);
+ gui_mch_set_bg_color(fg_color);
+#endif
+ }
+ else
+ {
+#if defined(AMIGA) || defined(RISCOS)
+ gui_mch_set_colors(fg_color, bg_color);
+#else
+ gui_mch_set_fg_color(fg_color);
+ gui_mch_set_bg_color(bg_color);
+#endif
+ }
+
+ /* Clear the selection if we are about to write over it */
+ if (!(flags & GUI_MON_NOCLEAR))
+ clip_may_clear_selection(gui.row, gui.row);
+
+
+#ifndef MSWIN16_FASTTEXT
+ /* If there's no bold font, then fake it */
+ if (hl_mask_todo & (HL_BOLD | HL_STANDOUT))
+ draw_flags |= DRAW_BOLD;
+#endif
+
+ /*
+ * When drawing bold or italic characters the spill-over from the left
+ * neighbor may be destroyed. Let the caller backup to start redrawing
+ * just after a blank.
+ */
+ if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)))
+ return FAIL;
+
+#if defined(RISCOS) || defined(HAVE_GTK2)
+ /* If there's no italic font, then fake it.
+ * For GTK2, we don't need a different font for italic style. */
+ if (hl_mask_todo & HL_ITALIC)
+ draw_flags |= DRAW_ITALIC;
+
+ /* Do we underline the text? */
+ if (hl_mask_todo & HL_UNDERLINE)
+ draw_flags |= DRAW_UNDERL;
+#else
+ /* Do we underline the text? */
+ if ((hl_mask_todo & HL_UNDERLINE)
+# ifndef MSWIN16_FASTTEXT
+ || (hl_mask_todo & HL_ITALIC)
+# endif
+ )
+ draw_flags |= DRAW_UNDERL;
+#endif
+
+ /* Do we draw transparantly? */
+ if (flags & GUI_MON_TRS_CURSOR)
+ draw_flags |= DRAW_TRANSP;
+
+ /*
+ * Draw the text.
+ */
+#ifdef HAVE_GTK2
+ /* The value returned is the length in display cells */
+ len = gui_gtk2_draw_string(gui.row, col, s, len, draw_flags);
+#else
+# ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ int start; /* index of bytes to be drawn */
+ int cells; /* cellwidth of bytes to be drawn */
+ int thislen; /* length of bytes to be drawin */
+ int cn; /* cellwidth of current char */
+ int i; /* index of current char */
+ int c; /* current char value */
+ int cl; /* byte length of current char */
+ int comping; /* current char is composing */
+ int scol = col; /* screen column */
+ int dowide; /* use 'guifontwide' */
+
+ /* Break the string at a composing character, it has to be drawn on
+ * top of the previous character. */
+ start = 0;
+ cells = 0;
+ for (i = 0; i < len; i += cl)
+ {
+ c = utf_ptr2char(s + i);
+ cn = utf_char2cells(c);
+ if (cn > 1
+# ifdef FEAT_XFONTSET
+ && fontset == NOFONTSET
+# endif
+ && gui.wide_font != NOFONT)
+ dowide = TRUE;
+ else
+ dowide = FALSE;
+ comping = utf_iscomposing(c);
+ if (!comping) /* count cells from non-composing chars */
+ cells += cn;
+ cl = utf_ptr2len_check(s + i);
+ if (cl == 0) /* hit end of string */
+ len = i + cl; /* len must be wrong "cannot happen" */
+
+ /* print the string so far if it's the last character or there is
+ * a composing character. */
+ if (i + cl >= len || (comping && i > start) || dowide
+# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+ || (cn > 1
+# ifdef FEAT_XFONTSET
+ /* No fontset: At least draw char after wide char at
+ * right position. */
+ && fontset == NOFONTSET
+# endif
+ )
+# endif
+ )
+ {
+ if (comping || dowide)
+ thislen = i - start;
+ else
+ thislen = i - start + cl;
+ if (thislen > 0)
+ {
+ gui_mch_draw_string(gui.row, scol, s + start, thislen,
+ draw_flags);
+ start += thislen;
+ }
+ scol += cells;
+ cells = 0;
+ if (dowide)
+ {
+ gui_mch_set_font(gui.wide_font);
+ gui_mch_draw_string(gui.row, scol - cn,
+ s + start, cl, draw_flags);
+ gui_mch_set_font(font);
+ start += cl;
+ }
+
+# if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+ /* No fontset: draw a space to fill the gap after a wide char */
+ if (cn > 1 && (draw_flags & DRAW_TRANSP) == 0
+# ifdef FEAT_XFONTSET
+ && fontset == NOFONTSET
+# endif
+ && !dowide)
+ gui_mch_draw_string(gui.row, scol - 1, (char_u *)" ",
+ 1, draw_flags);
+# endif
+ }
+ /* Draw a composing char on top of the previous char. */
+ if (comping)
+ {
+ gui_mch_draw_string(gui.row, scol - cn, s + i, cl,
+ draw_flags | DRAW_TRANSP);
+ start = i + cl;
+ }
+ }
+ /* The stuff below assumes "len" is the length in screen columns. */
+ len = scol - col;
+ }
+ else
+# endif
+ {
+ gui_mch_draw_string(gui.row, col, s, len, draw_flags);
+# ifdef FEAT_MBYTE
+ if (enc_dbcs == DBCS_JPNU)
+ {
+ int clen = 0;
+ int i;
+
+ /* Get the length in display cells, this can be different from the
+ * number of bytes for "euc-jp". */
+ for (i = 0; i < len; i += (*mb_ptr2len_check)(s + i))
+ clen += (*mb_ptr2cells)(s + i);
+ len = clen;
+ }
+# endif
+ }
+#endif /* !HAVE_GTK2 */
+
+ if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
+ gui.col = col + len;
+
+ /* May need to invert it when it's part of the selection. */
+ if (flags & GUI_MON_NOCLEAR)
+ clip_may_redraw_selection(gui.row, col, len);
+
+ if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
+ {
+ /* Invalidate the old physical cursor position if we wrote over it */
+ if (gui.cursor_row == gui.row
+ && gui.cursor_col >= col
+ && gui.cursor_col < col + len)
+ gui.cursor_is_valid = FALSE;
+ }
+
+#ifdef FEAT_SIGN_ICONS
+ if (draw_sign)
+ /* Draw the sign on top of the spaces. */
+ gui_mch_drawsign(gui.row, col, gui.highlight_mask);
+# ifdef FEAT_NETBEANS_INTG
+ if (multi_sign)
+ netbeans_draw_multisign_indicator(gui.row);
+# endif
+#endif
+
+ return OK;
+}
+
+/*
+ * Un-draw the cursor. Actually this just redraws the character at the given
+ * position. The character just before it too, for when it was in bold.
+ */
+ void
+gui_undraw_cursor()
+{
+ if (gui.cursor_is_valid)
+ {
+#ifdef FEAT_HANGULIN
+ if (composing_hangul
+ && gui.col == gui.cursor_col && gui.row == gui.cursor_row)
+ (void)gui_outstr_nowrap(composing_hangul_buffer, 2,
+ GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
+ gui.norm_pixel, gui.back_pixel, 0);
+ else
+ {
+#endif
+ if (gui_redraw_block(gui.cursor_row, gui.cursor_col,
+ gui.cursor_row, gui.cursor_col, GUI_MON_NOCLEAR)
+ && gui.cursor_col > 0)
+ (void)gui_redraw_block(gui.cursor_row, gui.cursor_col - 1,
+ gui.cursor_row, gui.cursor_col - 1, GUI_MON_NOCLEAR);
+#ifdef FEAT_HANGULIN
+ if (composing_hangul)
+ (void)gui_redraw_block(gui.cursor_row, gui.cursor_col + 1,
+ gui.cursor_row, gui.cursor_col + 1, GUI_MON_NOCLEAR);
+ }
+#endif
+ /* Cursor_is_valid is reset when the cursor is undrawn, also reset it
+ * here in case it wasn't needed to undraw it. */
+ gui.cursor_is_valid = FALSE;
+ }
+}
+
+ void
+gui_redraw(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ int row1, col1, row2, col2;
+
+ row1 = Y_2_ROW(y);
+ col1 = X_2_COL(x);
+ row2 = Y_2_ROW(y + h - 1);
+ col2 = X_2_COL(x + w - 1);
+
+ (void)gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
+
+ /*
+ * We may need to redraw the cursor, but don't take it upon us to change
+ * its location after a scroll.
+ * (maybe be more strict even and test col too?)
+ * These things may be outside the update/clipping region and reality may
+ * not reflect Vims internal ideas if these operations are clipped away.
+ */
+ if (gui.row == gui.cursor_row)
+ gui_update_cursor(TRUE, TRUE);
+}
+
+/*
+ * Draw a rectangular block of characters, from row1 to row2 (inclusive) and
+ * from col1 to col2 (inclusive).
+ * Return TRUE when the character before the first drawn character has
+ * different attributes (may have to be redrawn too).
+ */
+ int
+gui_redraw_block(row1, col1, row2, col2, flags)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+ int flags; /* flags for gui_outstr_nowrap() */
+{
+ int old_row, old_col;
+ long_u old_hl_mask;
+ int off;
+ char_u first_attr;
+ int idx, len;
+ int back, nback;
+ int retval = FALSE;
+#ifdef FEAT_MBYTE
+ int orig_col1, orig_col2;
+#endif
+
+ /* Don't try to update when ScreenLines is not valid */
+ if (!screen_cleared || ScreenLines == NULL)
+ return retval;
+
+ /* Don't try to draw outside the shell! */
+ /* Check everything, strange values may be caused by a big border width */
+ col1 = check_col(col1);
+ col2 = check_col(col2);
+ row1 = check_row(row1);
+ row2 = check_row(row2);
+
+ /* Remember where our cursor was */
+ old_row = gui.row;
+ old_col = gui.col;
+ old_hl_mask = gui.highlight_mask;
+#ifdef FEAT_MBYTE
+ orig_col1 = col1;
+ orig_col2 = col2;
+#endif
+
+ for (gui.row = row1; gui.row <= row2; gui.row++)
+ {
+#ifdef FEAT_MBYTE
+ /* When only half of a double-wide character is in the block, include
+ * the other half. */
+ col1 = orig_col1;
+ col2 = orig_col2;
+ off = LineOffset[gui.row];
+ if (enc_dbcs != 0)
+ {
+ if (col1 > 0)
+ col1 -= dbcs_screen_head_off(ScreenLines + off,
+ ScreenLines + off + col1);
+ col2 += dbcs_screen_tail_off(ScreenLines + off,
+ ScreenLines + off + col2);
+ }
+ else if (enc_utf8)
+ {
+ if (ScreenLines[off + col1] == 0)
+ --col1;
+# ifdef HAVE_GTK2
+ if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0)
+ ++col2;
+# endif
+ }
+#endif
+ gui.col = col1;
+ off = LineOffset[gui.row] + gui.col;
+ len = col2 - col1 + 1;
+
+ /* Find how many chars back this highlighting starts, or where a space
+ * is. Needed for when the bold trick is used */
+ for (back = 0; back < col1; ++back)
+ if (ScreenAttrs[off - 1 - back] != ScreenAttrs[off]
+ || ScreenLines[off - 1 - back] == ' ')
+ break;
+ retval = (col1 > 0 && ScreenAttrs[off - 1] != 0 && back == 0
+ && ScreenLines[off - 1] != ' ');
+
+ /* Break it up in strings of characters with the same attributes. */
+ /* Print UTF-8 characters individually. */
+ while (len > 0)
+ {
+ first_attr = ScreenAttrs[off];
+ gui.highlight_mask = first_attr;
+#if defined(FEAT_MBYTE) && !defined(HAVE_GTK2)
+ if (enc_utf8 && ScreenLinesUC[off] != 0)
+ {
+ /* output multi-byte character separately */
+ nback = gui_screenchar(off, flags,
+ (guicolor_T)0, (guicolor_T)0, back);
+ if (gui.col < Columns && ScreenLines[off + 1] == 0)
+ idx = 2;
+ else
+ idx = 1;
+ }
+ else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
+ {
+ /* output double-byte, single-width character separately */
+ nback = gui_screenchar(off, flags,
+ (guicolor_T)0, (guicolor_T)0, back);
+ idx = 1;
+ }
+ else
+#endif
+ {
+#ifdef HAVE_GTK2
+ for (idx = 0; idx < len; ++idx)
+ {
+ if (enc_utf8 && ScreenLines[off + idx] == 0)
+ continue; /* skip second half of double-width char */
+ if (ScreenAttrs[off + idx] != first_attr)
+ break;
+ }
+ /* gui_screenstr() takes care of multibyte chars */
+ nback = gui_screenstr(off, idx, flags,
+ (guicolor_T)0, (guicolor_T)0, back);
+#else
+ for (idx = 0; idx < len && ScreenAttrs[off + idx] == first_attr;
+ idx++)
+ {
+# ifdef FEAT_MBYTE
+ /* Stop at a multi-byte Unicode character. */
+ if (enc_utf8 && ScreenLinesUC[off + idx] != 0)
+ break;
+ if (enc_dbcs == DBCS_JPNU)
+ {
+ /* Stop at a double-byte single-width char. */
+ if (ScreenLines[off + idx] == 0x8e)
+ break;
+ if (len > 1 && (*mb_ptr2len_check)(ScreenLines
+ + off + idx) == 2)
+ ++idx; /* skip second byte of double-byte char */
+ }
+# endif
+ }
+ nback = gui_outstr_nowrap(ScreenLines + off, idx, flags,
+ (guicolor_T)0, (guicolor_T)0, back);
+#endif
+ }
+ if (nback == FAIL)
+ {
+ /* Must back up to start drawing where a bold or italic word
+ * starts. */
+ off -= back;
+ len += back;
+ gui.col -= back;
+ }
+ else
+ {
+ off += idx;
+ len -= idx;
+ }
+ back = 0;
+ }
+ }
+
+ /* Put the cursor back where it was */
+ gui.row = old_row;
+ gui.col = old_col;
+ gui.highlight_mask = old_hl_mask;
+
+ return retval;
+}
+
+ static void
+gui_delete_lines(row, count)
+ int row;
+ int count;
+{
+ if (count <= 0)
+ return;
+
+ if (row + count > gui.scroll_region_bot)
+ /* Scrolled out of region, just blank the lines out */
+ gui_clear_block(row, gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ else
+ {
+ gui_mch_delete_lines(row, count);
+
+ /* If the cursor was in the deleted lines it's now gone. If the
+ * cursor was in the scrolled lines adjust its position. */
+ if (gui.cursor_row >= row
+ && gui.cursor_col >= gui.scroll_region_left
+ && gui.cursor_col <= gui.scroll_region_right)
+ {
+ if (gui.cursor_row < row + count)
+ gui.cursor_is_valid = FALSE;
+ else if (gui.cursor_row <= gui.scroll_region_bot)
+ gui.cursor_row -= count;
+ }
+ }
+}
+
+ static void
+gui_insert_lines(row, count)
+ int row;
+ int count;
+{
+ if (count <= 0)
+ return;
+
+ if (row + count > gui.scroll_region_bot)
+ /* Scrolled out of region, just blank the lines out */
+ gui_clear_block(row, gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ else
+ {
+ gui_mch_insert_lines(row, count);
+
+ if (gui.cursor_row >= gui.row
+ && gui.cursor_col >= gui.scroll_region_left
+ && gui.cursor_col <= gui.scroll_region_right)
+ {
+ if (gui.cursor_row <= gui.scroll_region_bot - count)
+ gui.cursor_row += count;
+ else if (gui.cursor_row <= gui.scroll_region_bot)
+ gui.cursor_is_valid = FALSE;
+ }
+ }
+}
+
+/*
+ * The main GUI input routine. Waits for a character from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 Don't wait.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_wait_for_chars(wtime)
+ long wtime;
+{
+ int retval;
+#ifdef FEAT_AUTOCMD
+ static int once_already = 0;
+#endif
+
+ /*
+ * If we're going to wait a bit, update the menus and mouse shape for the
+ * current State.
+ */
+ if (wtime != 0)
+ {
+#ifdef FEAT_MENU
+ gui_update_menus(0);
+#endif
+ }
+
+ gui_mch_update();
+ if (input_available()) /* Got char, return immediately */
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return OK;
+ }
+ if (wtime == 0) /* Don't wait for char */
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return FAIL;
+ }
+
+ /* Before waiting, flush any output to the screen. */
+ gui_mch_flush();
+
+ if (wtime > 0)
+ {
+ /* Blink when waiting for a character. Probably only does something
+ * for showmatch() */
+ gui_mch_start_blink();
+ retval = gui_mch_wait_for_chars(wtime);
+ gui_mch_stop_blink();
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return retval;
+ }
+
+ /*
+ * While we are waiting indefenitely for a character, blink the cursor.
+ */
+ gui_mch_start_blink();
+
+
+#ifdef FEAT_AUTOCMD
+ /* If there is no character available within 2 seconds (default),
+ * write the autoscript file to disk */
+ if (once_already == 2)
+ {
+ updatescript(0);
+ retval = gui_mch_wait_for_chars(-1L);
+ once_already = 0;
+ }
+ else if (once_already == 1)
+ {
+ setcursor();
+ once_already = 2;
+ retval = 0;
+ }
+ else
+#endif
+ if (gui_mch_wait_for_chars(p_ut) != OK)
+ {
+#ifdef FEAT_AUTOCMD
+ if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
+ {
+ apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
+ update_screen(VALID);
+ showruler(FALSE);
+ setcursor();
+
+ once_already = 1;
+ retval = 0;
+ }
+ else
+#endif
+ {
+ updatescript(0);
+ retval = gui_mch_wait_for_chars(-1L);
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ }
+ }
+ else
+ retval = OK;
+
+ gui_mch_stop_blink();
+ return retval;
+}
+
+/*
+ * Fill buffer with mouse coordinates encoded for check_termcode().
+ */
+ static void
+fill_mouse_coord(p, col, row)
+ char_u *p;
+ int col;
+ int row;
+{
+ p[0] = (char_u)(col / 128 + ' ' + 1);
+ p[1] = (char_u)(col % 128 + ' ' + 1);
+ p[2] = (char_u)(row / 128 + ' ' + 1);
+ p[3] = (char_u)(row % 128 + ' ' + 1);
+}
+
+/*
+ * Generic mouse support function. Add a mouse event to the input buffer with
+ * the given properties.
+ * button --- may be any of MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT,
+ * MOUSE_X1, MOUSE_X2
+ * MOUSE_DRAG, or MOUSE_RELEASE.
+ * MOUSE_4 and MOUSE_5 are used for a scroll wheel.
+ * x, y --- Coordinates of mouse in pixels.
+ * repeated_click --- TRUE if this click comes only a short time after a
+ * previous click.
+ * modifiers --- Bit field which may be any of the following modifiers
+ * or'ed together: MOUSE_SHIFT | MOUSE_CTRL | MOUSE_ALT.
+ * This function will ignore drag events where the mouse has not moved to a new
+ * character.
+ */
+ void
+gui_send_mouse_event(button, x, y, repeated_click, modifiers)
+ int button;
+ int x;
+ int y;
+ int repeated_click;
+ int_u modifiers;
+{
+ static int prev_row = 0, prev_col = 0;
+ static int prev_button = -1;
+ static int num_clicks = 1;
+ char_u string[10];
+ enum key_extra button_char;
+ int row, col;
+#ifdef FEAT_CLIPBOARD
+ int checkfor;
+ int did_clip = FALSE;
+#endif
+
+ /*
+ * Scrolling may happen at any time, also while a selection is present.
+ */
+ switch (button)
+ {
+ case MOUSE_X1:
+ button_char = KE_X1MOUSE;
+ goto button_set;
+ case MOUSE_X2:
+ button_char = KE_X2MOUSE;
+ goto button_set;
+ case MOUSE_4:
+ button_char = KE_MOUSEDOWN;
+ goto button_set;
+ case MOUSE_5:
+ button_char = KE_MOUSEUP;
+button_set:
+ {
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+ string[3] = CSI;
+ string[4] = KS_EXTRA;
+ string[5] = (int)button_char;
+
+ /* Pass the pointer coordinates of the scroll event so that we
+ * know which window to scroll. */
+ row = gui_xy2colrow(x, y, &col);
+ string[6] = (char_u)(col / 128 + ' ' + 1);
+ string[7] = (char_u)(col % 128 + ' ' + 1);
+ string[8] = (char_u)(row / 128 + ' ' + 1);
+ string[9] = (char_u)(row % 128 + ' ' + 1);
+
+ if (modifiers == 0)
+ add_to_input_buf(string + 3, 7);
+ else
+ {
+ string[0] = CSI;
+ string[1] = KS_MODIFIER;
+ string[2] = 0;
+ if (modifiers & MOUSE_SHIFT)
+ string[2] |= MOD_MASK_SHIFT;
+ if (modifiers & MOUSE_CTRL)
+ string[2] |= MOD_MASK_CTRL;
+ if (modifiers & MOUSE_ALT)
+ string[2] |= MOD_MASK_ALT;
+ add_to_input_buf(string, 10);
+ }
+ return;
+ }
+ }
+
+#ifdef FEAT_CLIPBOARD
+ /* If a clipboard selection is in progress, handle it */
+ if (clip_star.state == SELECT_IN_PROGRESS)
+ {
+ clip_process_selection(button, X_2_COL(x), Y_2_ROW(y), repeated_click);
+ return;
+ }
+
+ /* Determine which mouse settings to look for based on the current mode */
+ switch (get_real_state())
+ {
+ case NORMAL_BUSY:
+ case OP_PENDING:
+ case NORMAL: checkfor = MOUSE_NORMAL; break;
+ case VISUAL: checkfor = MOUSE_VISUAL; break;
+ case REPLACE:
+ case REPLACE+LANGMAP:
+#ifdef FEAT_VREPLACE
+ case VREPLACE:
+ case VREPLACE+LANGMAP:
+#endif
+ case INSERT:
+ case INSERT+LANGMAP: checkfor = MOUSE_INSERT; break;
+ case ASKMORE:
+ case HITRETURN: /* At the more- and hit-enter prompt pass the
+ mouse event for a click on or below the
+ message line. */
+ if (Y_2_ROW(y) >= msg_row)
+ checkfor = MOUSE_NORMAL;
+ else
+ checkfor = MOUSE_RETURN;
+ break;
+
+ /*
+ * On the command line, use the clipboard selection on all lines
+ * but the command line. But not when pasting.
+ */
+ case CMDLINE:
+ case CMDLINE+LANGMAP:
+ if (Y_2_ROW(y) < cmdline_row && button != MOUSE_MIDDLE)
+ checkfor = MOUSE_NONE;
+ else
+ checkfor = MOUSE_COMMAND;
+ break;
+
+ default:
+ checkfor = MOUSE_NONE;
+ break;
+ };
+
+ /*
+ * Allow clipboard selection of text on the command line in "normal"
+ * modes. Don't do this when dragging the status line, or extending a
+ * Visual selection.
+ */
+ if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
+ && Y_2_ROW(y) >= topframe->fr_height
+ && button != MOUSE_DRAG
+# ifdef FEAT_MOUSESHAPE
+ && !drag_status_line
+# ifdef FEAT_VERTSPLIT
+ && !drag_sep_line
+# endif
+# endif
+ )
+ checkfor = MOUSE_NONE;
+
+ /*
+ * Use modeless selection when holding CTRL and SHIFT pressed.
+ */
+ if ((modifiers & MOUSE_CTRL) && (modifiers & MOUSE_SHIFT))
+ checkfor = MOUSE_NONEF;
+
+ /*
+ * In Ex mode, always use modeless selection.
+ */
+ if (exmode_active)
+ checkfor = MOUSE_NONE;
+
+ /*
+ * If the mouse settings say to not use the mouse, use the modeless
+ * selection. But if Visual is active, assume that only the Visual area
+ * will be selected.
+ * Exception: On the command line, both the selection is used and a mouse
+ * key is send.
+ */
+ if (!mouse_has(checkfor) || checkfor == MOUSE_COMMAND)
+ {
+#ifdef FEAT_VISUAL
+ /* Don't do modeless selection in Visual mode. */
+ if (checkfor != MOUSE_NONEF && VIsual_active && (State & NORMAL))
+ return;
+#endif
+
+ /*
+ * When 'mousemodel' is "popup", shift-left is translated to right.
+ * But not when also using Ctrl.
+ */
+ if (mouse_model_popup() && button == MOUSE_LEFT
+ && (modifiers & MOUSE_SHIFT) && !(modifiers & MOUSE_CTRL))
+ {
+ button = MOUSE_RIGHT;
+ modifiers &= ~ MOUSE_SHIFT;
+ }
+
+ /* If the selection is done, allow the right button to extend it.
+ * If the selection is cleared, allow the right button to start it
+ * from the cursor position. */
+ if (button == MOUSE_RIGHT)
+ {
+ if (clip_star.state == SELECT_CLEARED)
+ {
+ if (State & CMDLINE)
+ {
+ col = msg_col;
+ row = msg_row;
+ }
+ else
+ {
+ col = curwin->w_wcol;
+ row = curwin->w_wrow + W_WINROW(curwin);
+ }
+ clip_start_selection(col, row, FALSE);
+ }
+ clip_process_selection(button, X_2_COL(x), Y_2_ROW(y),
+ repeated_click);
+ did_clip = TRUE;
+ }
+ /* Allow the left button to start the selection */
+ else if (button ==
+# ifdef RISCOS
+ /* Only start a drag on a drag event. Otherwise
+ * we don't get a release event. */
+ MOUSE_DRAG
+# else
+ MOUSE_LEFT
+# endif
+ )
+ {
+ clip_start_selection(X_2_COL(x), Y_2_ROW(y), repeated_click);
+ did_clip = TRUE;
+ }
+# ifdef RISCOS
+ else if (button == MOUSE_LEFT)
+ {
+ clip_clear_selection();
+ did_clip = TRUE;
+ }
+# endif
+
+ /* Always allow pasting */
+ if (button != MOUSE_MIDDLE)
+ {
+ if (!mouse_has(checkfor) || button == MOUSE_RELEASE)
+ return;
+ if (checkfor != MOUSE_COMMAND)
+ button = MOUSE_LEFT;
+ }
+ repeated_click = FALSE;
+ }
+
+ if (clip_star.state != SELECT_CLEARED && !did_clip)
+ clip_clear_selection();
+#endif
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+ row = gui_xy2colrow(x, y, &col);
+
+ /*
+ * If we are dragging and the mouse hasn't moved far enough to be on a
+ * different character, then don't send an event to vim.
+ */
+ if (button == MOUSE_DRAG)
+ {
+ if (row == prev_row && col == prev_col)
+ return;
+ /* Dragging above the window, set "row" to -1 to cause a scroll. */
+ if (y < 0)
+ row = -1;
+ }
+
+ /*
+ * If topline has changed (window scrolled) since the last click, reset
+ * repeated_click, because we don't want starting Visual mode when
+ * clicking on a different character in the text.
+ */
+ if (curwin->w_topline != gui_prev_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill != gui_prev_topfill
+#endif
+ )
+ repeated_click = FALSE;
+
+ string[0] = CSI; /* this sequence is recognized by check_termcode() */
+ string[1] = KS_MOUSE;
+ string[2] = KE_FILLER;
+ if (button != MOUSE_DRAG && button != MOUSE_RELEASE)
+ {
+ if (repeated_click)
+ {
+ /*
+ * Handle multiple clicks. They only count if the mouse is still
+ * pointing at the same character.
+ */
+ if (button != prev_button || row != prev_row || col != prev_col)
+ num_clicks = 1;
+ else if (++num_clicks > 4)
+ num_clicks = 1;
+ }
+ else
+ num_clicks = 1;
+ prev_button = button;
+ gui_prev_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ gui_prev_topfill = curwin->w_topfill;
+#endif
+
+ string[3] = (char_u)(button | 0x20);
+ SET_NUM_MOUSE_CLICKS(string[3], num_clicks);
+ }
+ else
+ string[3] = (char_u)button;
+
+ string[3] |= modifiers;
+ fill_mouse_coord(string + 4, col, row);
+ add_to_input_buf(string, 8);
+
+ if (row < 0)
+ prev_row = 0;
+ else
+ prev_row = row;
+ prev_col = col;
+
+ /*
+ * We need to make sure this is cleared since Athena doesn't tell us when
+ * he is done dragging. Neither does GTK+ 2 -- at least for now.
+ */
+#if defined(FEAT_GUI_ATHENA) || defined(HAVE_GTK2)
+ gui.dragged_sb = SBAR_NONE;
+#endif
+}
+
+/*
+ * Convert x and y coordinate to column and row in text window.
+ * Corrects for multi-byte character.
+ * returns column in "*colp" and row as return value;
+ */
+ int
+gui_xy2colrow(x, y, colp)
+ int x;
+ int y;
+ int *colp;
+{
+ int col = check_col(X_2_COL(x));
+ int row = check_row(Y_2_ROW(y));
+
+#ifdef FEAT_MBYTE
+ *colp = mb_fix_col(col, row);
+#else
+ *colp = col;
+#endif
+ return row;
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Callback function for when a menu entry has been selected.
+ */
+ void
+gui_menu_cb(menu)
+ vimmenu_T *menu;
+{
+ char_u bytes[3 + sizeof(long_u)];
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+ bytes[0] = CSI;
+ bytes[1] = KS_MENU;
+ bytes[2] = KE_FILLER;
+ add_long_to_buf((long_u)menu, bytes + 3);
+ add_to_input_buf(bytes, 3 + sizeof(long_u));
+}
+#endif
+
+/*
+ * Set which components are present.
+ * If "oldval" is not NULL, "oldval" is the previous value, the new * value is
+ * in p_go.
+ */
+/*ARGSUSED*/
+ void
+gui_init_which_components(oldval)
+ char_u *oldval;
+{
+ static int prev_which_scrollbars[3] = {-1, -1, -1};
+#ifdef FEAT_MENU
+ static int prev_menu_is_active = -1;
+#endif
+#ifdef FEAT_TOOLBAR
+ static int prev_toolbar = -1;
+ int using_toolbar = FALSE;
+#endif
+#ifdef FEAT_FOOTER
+ static int prev_footer = -1;
+ int using_footer = FALSE;
+#endif
+#if defined(FEAT_MENU) && !defined(WIN16)
+ static int prev_tearoff = -1;
+ int using_tearoff = FALSE;
+#endif
+
+ char_u *p;
+ int i;
+#ifdef FEAT_MENU
+ int grey_old, grey_new;
+ char_u *temp;
+#endif
+ win_T *wp;
+ int need_set_size;
+ int fix_size;
+
+#ifdef FEAT_MENU
+ if (oldval != NULL && gui.in_use)
+ {
+ /*
+ * Check if the menu's go from grey to non-grey or vise versa.
+ */
+ grey_old = (vim_strchr(oldval, GO_GREY) != NULL);
+ grey_new = (vim_strchr(p_go, GO_GREY) != NULL);
+ if (grey_old != grey_new)
+ {
+ temp = p_go;
+ p_go = oldval;
+ gui_update_menus(MENU_ALL_MODES);
+ p_go = temp;
+ }
+ }
+ gui.menu_is_active = FALSE;
+#endif
+
+ for (i = 0; i < 3; i++)
+ gui.which_scrollbars[i] = FALSE;
+ for (p = p_go; *p; p++)
+ switch (*p)
+ {
+ case GO_LEFT:
+ gui.which_scrollbars[SBAR_LEFT] = TRUE;
+ break;
+ case GO_RIGHT:
+ gui.which_scrollbars[SBAR_RIGHT] = TRUE;
+ break;
+#ifdef FEAT_VERTSPLIT
+ case GO_VLEFT:
+ if (win_hasvertsplit())
+ gui.which_scrollbars[SBAR_LEFT] = TRUE;
+ break;
+ case GO_VRIGHT:
+ if (win_hasvertsplit())
+ gui.which_scrollbars[SBAR_RIGHT] = TRUE;
+ break;
+#endif
+ case GO_BOT:
+ gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
+ break;
+#ifdef FEAT_MENU
+ case GO_MENUS:
+ gui.menu_is_active = TRUE;
+ break;
+#endif
+ case GO_GREY:
+ /* make menu's have grey items, ignored here */
+ break;
+#ifdef FEAT_TOOLBAR
+ case GO_TOOLBAR:
+ using_toolbar = TRUE;
+ break;
+#endif
+#ifdef FEAT_FOOTER
+ case GO_FOOTER:
+ using_footer = TRUE;
+ break;
+#endif
+ case GO_TEAROFF:
+#if defined(FEAT_MENU) && !defined(WIN16)
+ using_tearoff = TRUE;
+#endif
+ break;
+ default:
+ /* Ignore options that are not supported */
+ break;
+ }
+ if (gui.in_use)
+ {
+ need_set_size = FALSE;
+ fix_size = FALSE;
+ for (i = 0; i < 3; i++)
+ {
+ if (gui.which_scrollbars[i] != prev_which_scrollbars[i])
+ {
+ if (i == SBAR_BOTTOM)
+ gui_mch_enable_scrollbar(&gui.bottom_sbar,
+ gui.which_scrollbars[i]);
+ else
+ {
+ FOR_ALL_WINDOWS(wp)
+ {
+ gui_do_scrollbar(wp, i, gui.which_scrollbars[i]);
+ }
+ }
+ need_set_size = TRUE;
+ if (gui.which_scrollbars[i])
+ fix_size = TRUE;
+ }
+ prev_which_scrollbars[i] = gui.which_scrollbars[i];
+ }
+
+#ifdef FEAT_MENU
+ if (gui.menu_is_active != prev_menu_is_active)
+ {
+ /* We don't want a resize event change "Rows" here, save and
+ * restore it. Resizing is handled below. */
+ i = Rows;
+ gui_mch_enable_menu(gui.menu_is_active);
+ Rows = i;
+ prev_menu_is_active = gui.menu_is_active;
+ need_set_size = TRUE;
+ if (gui.menu_is_active)
+ fix_size = TRUE;
+ }
+#endif
+
+#ifdef FEAT_TOOLBAR
+ if (using_toolbar != prev_toolbar)
+ {
+ gui_mch_show_toolbar(using_toolbar);
+ prev_toolbar = using_toolbar;
+ need_set_size = TRUE;
+ if (using_toolbar)
+ fix_size = TRUE;
+ }
+#endif
+#ifdef FEAT_FOOTER
+ if (using_footer != prev_footer)
+ {
+ gui_mch_enable_footer(using_footer);
+ prev_footer = using_footer;
+ need_set_size = TRUE;
+ if (using_footer)
+ fix_size = TRUE;
+ }
+#endif
+#if defined(FEAT_MENU) && !defined(WIN16) && !(defined(WIN3264) && !defined(FEAT_TEAROFF))
+ if (using_tearoff != prev_tearoff)
+ {
+ gui_mch_toggle_tearoffs(using_tearoff);
+ prev_tearoff = using_tearoff;
+ }
+#endif
+ if (need_set_size)
+ /* Adjust the size of the window to make the text area keep the
+ * same size and to avoid that part of our window is off-screen
+ * and a scrollbar can't be used, for example. */
+ gui_set_shellsize(FALSE, fix_size);
+ }
+}
+
+
+/*
+ * Scrollbar stuff:
+ */
+
+ void
+gui_create_scrollbar(sb, type, wp)
+ scrollbar_T *sb;
+ int type;
+ win_T *wp;
+{
+ static int sbar_ident = 0;
+
+ sb->ident = sbar_ident++; /* No check for too big, but would it happen? */
+ sb->wp = wp;
+ sb->type = type;
+ sb->value = 0;
+#ifdef FEAT_GUI_ATHENA
+ sb->pixval = 0;
+#endif
+ sb->size = 1;
+ sb->max = 1;
+ sb->top = 0;
+ sb->height = 0;
+#ifdef FEAT_VERTSPLIT
+ sb->width = 0;
+#endif
+ sb->status_height = 0;
+ gui_mch_create_scrollbar(sb, (wp == NULL) ? SBAR_HORIZ : SBAR_VERT);
+}
+
+/*
+ * Find the scrollbar with the given index.
+ */
+ scrollbar_T *
+gui_find_scrollbar(ident)
+ long ident;
+{
+ win_T *wp;
+
+ if (gui.bottom_sbar.ident == ident)
+ return &gui.bottom_sbar;
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_scrollbars[SBAR_LEFT].ident == ident)
+ return &wp->w_scrollbars[SBAR_LEFT];
+ if (wp->w_scrollbars[SBAR_RIGHT].ident == ident)
+ return &wp->w_scrollbars[SBAR_RIGHT];
+ }
+ return NULL;
+}
+
+/*
+ * For most systems: Put a code in the input buffer for a dragged scrollbar.
+ *
+ * For Win32, Macintosh and GTK+ 2:
+ * Scrollbars seem to grab focus and vim doesn't read the input queue until
+ * you stop dragging the scrollbar. We get here each time the scrollbar is
+ * dragged another pixel, but as far as the rest of vim goes, it thinks
+ * we're just hanging in the call to DispatchMessage() in
+ * process_message(). The DispatchMessage() call that hangs was passed a
+ * mouse button click event in the scrollbar window. -- webb.
+ *
+ * Solution: Do the scrolling right here. But only when allowed.
+ * Ignore the scrollbars while executing an external command or when there
+ * are still characters to be processed.
+ */
+ void
+gui_drag_scrollbar(sb, value, still_dragging)
+ scrollbar_T *sb;
+ long value;
+ int still_dragging;
+{
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+#endif
+ int sb_num;
+#ifdef USE_ON_FLY_SCROLL
+ colnr_T old_leftcol = curwin->w_leftcol;
+# ifdef FEAT_SCROLLBIND
+ linenr_T old_topline = curwin->w_topline;
+# endif
+# ifdef FEAT_DIFF
+ int old_topfill = curwin->w_topfill;
+# endif
+#else
+ char_u bytes[4 + sizeof(long_u)];
+ int byte_count;
+#endif
+
+ if (sb == NULL)
+ return;
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && sb->wp != curwin)
+ return;
+#endif
+
+ if (still_dragging)
+ {
+ if (sb->wp == NULL)
+ gui.dragged_sb = SBAR_BOTTOM;
+ else if (sb == &sb->wp->w_scrollbars[SBAR_LEFT])
+ gui.dragged_sb = SBAR_LEFT;
+ else
+ gui.dragged_sb = SBAR_RIGHT;
+ gui.dragged_wp = sb->wp;
+ }
+ else
+ {
+ gui.dragged_sb = SBAR_NONE;
+#ifdef HAVE_GTK2
+ /* Keep the "dragged_wp" value until after the scrolling, for when the
+ * moust button is released. GTK2 doesn't send the button-up event. */
+ gui.dragged_wp = NULL;
+#endif
+ }
+
+ /* Vertical sbar info is kept in the first sbar (the left one) */
+ if (sb->wp != NULL)
+ sb = &sb->wp->w_scrollbars[0];
+
+ /*
+ * Check validity of value
+ */
+ if (value < 0)
+ value = 0;
+#ifdef SCROLL_PAST_END
+ else if (value > sb->max)
+ value = sb->max;
+#else
+ if (value > sb->max - sb->size + 1)
+ value = sb->max - sb->size + 1;
+#endif
+
+ sb->value = value;
+
+#ifdef USE_ON_FLY_SCROLL
+ /* When not allowed to do the scrolling right now, return. */
+ if (dont_scroll || input_available())
+ return;
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (sb->wp == NULL && curwin->w_p_rl)
+ {
+ value = sb->max + 1 - sb->size - value;
+ if (value < 0)
+ value = 0;
+ }
+#endif
+
+ if (sb->wp != NULL) /* vertical scrollbar */
+ {
+ sb_num = 0;
+#ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp != sb->wp && wp != NULL; wp = wp->w_next)
+ sb_num++;
+ if (wp == NULL)
+ return;
+#else
+ if (sb->wp != curwin)
+ return;
+#endif
+
+#ifdef USE_ON_FLY_SCROLL
+ current_scrollbar = sb_num;
+ scrollbar_value = value;
+ if (State & NORMAL)
+ {
+ gui_do_scroll();
+ setcursor();
+ }
+ else if (State & INSERT)
+ {
+ ins_scroll();
+ setcursor();
+ }
+ else if (State & CMDLINE)
+ {
+ if (msg_scrolled == 0)
+ {
+ gui_do_scroll();
+ redrawcmdline();
+ }
+ }
+# ifdef FEAT_FOLDING
+ /* Value may have been changed for closed fold. */
+ sb->value = sb->wp->w_topline - 1;
+# endif
+#else
+ bytes[0] = CSI;
+ bytes[1] = KS_VER_SCROLLBAR;
+ bytes[2] = KE_FILLER;
+ bytes[3] = (char_u)sb_num;
+ byte_count = 4;
+#endif
+ }
+ else
+ {
+#ifdef USE_ON_FLY_SCROLL
+ scrollbar_value = value;
+
+ if (State & NORMAL)
+ gui_do_horiz_scroll();
+ else if (State & INSERT)
+ ins_horscroll();
+ else if (State & CMDLINE)
+ {
+ if (!msg_scrolled)
+ {
+ gui_do_horiz_scroll();
+ redrawcmdline();
+ }
+ }
+ if (old_leftcol != curwin->w_leftcol)
+ {
+ updateWindow(curwin); /* update window, status and cmdline */
+ setcursor();
+ }
+#else
+ bytes[0] = CSI;
+ bytes[1] = KS_HOR_SCROLLBAR;
+ bytes[2] = KE_FILLER;
+ byte_count = 3;
+#endif
+ }
+
+#ifdef USE_ON_FLY_SCROLL
+# ifdef FEAT_SCROLLBIND
+ /*
+ * synchronize other windows, as necessary according to 'scrollbind'
+ */
+ if (curwin->w_p_scb
+ && ((sb->wp == NULL && curwin->w_leftcol != old_leftcol)
+ || (sb->wp == curwin && (curwin->w_topline != old_topline
+# ifdef FEAT_DIFF
+ || curwin->w_topfill != old_topfill
+# endif
+ ))))
+ {
+ do_check_scrollbind(TRUE);
+ /* need to update the window right here */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_redr_type > 0)
+ updateWindow(wp);
+ setcursor();
+ }
+# endif
+ out_flush();
+ gui_update_cursor(FALSE, TRUE);
+#else
+ add_long_to_buf((long)value, bytes + byte_count);
+ add_to_input_buf(bytes, byte_count + sizeof(long_u));
+#endif
+}
+
+/*
+ * Scrollbar stuff:
+ */
+
+ void
+gui_update_scrollbars(force)
+ int force; /* Force all scrollbars to get updated */
+{
+ win_T *wp;
+ scrollbar_T *sb;
+ long val, size, max; /* need 32 bits here */
+ int which_sb;
+ int h, y;
+#ifdef FEAT_VERTSPLIT
+ static win_T *prev_curwin = NULL;
+#endif
+
+ /* Update the horizontal scrollbar */
+ gui_update_horiz_scrollbar(force);
+
+#ifndef WIN3264
+ /* Return straight away if there is neither a left nor right scrollbar.
+ * On MS-Windows this is required anyway for scrollwheel messages. */
+ if (!gui.which_scrollbars[SBAR_LEFT] && !gui.which_scrollbars[SBAR_RIGHT])
+ return;
+#endif
+
+ /*
+ * Don't want to update a scrollbar while we're dragging it. But if we
+ * have both a left and right scrollbar, and we drag one of them, we still
+ * need to update the other one.
+ */
+ if ( (gui.dragged_sb == SBAR_LEFT
+ || gui.dragged_sb == SBAR_RIGHT)
+ && (!gui.which_scrollbars[SBAR_LEFT]
+ || !gui.which_scrollbars[SBAR_RIGHT])
+ && !force)
+ return;
+
+ if (!force && (gui.dragged_sb == SBAR_LEFT || gui.dragged_sb == SBAR_RIGHT))
+ {
+ /*
+ * If we have two scrollbars and one of them is being dragged, just
+ * copy the scrollbar position from the dragged one to the other one.
+ */
+ which_sb = SBAR_LEFT + SBAR_RIGHT - gui.dragged_sb;
+ if (gui.dragged_wp != NULL)
+ gui_mch_set_scrollbar_thumb(
+ &gui.dragged_wp->w_scrollbars[which_sb],
+ gui.dragged_wp->w_scrollbars[0].value,
+ gui.dragged_wp->w_scrollbars[0].size,
+ gui.dragged_wp->w_scrollbars[0].max);
+ return;
+ }
+
+ /* avoid that moving components around generates events */
+ ++hold_gui_events;
+
+ for (wp = firstwin; wp != NULL; wp = W_NEXT(wp))
+ {
+ if (wp->w_buffer == NULL) /* just in case */
+ continue;
+#ifdef SCROLL_PAST_END
+ max = wp->w_buffer->b_ml.ml_line_count - 1;
+#else
+ max = wp->w_buffer->b_ml.ml_line_count + wp->w_height - 2;
+#endif
+ if (max < 0) /* empty buffer */
+ max = 0;
+ val = wp->w_topline - 1;
+ size = wp->w_height;
+#ifdef SCROLL_PAST_END
+ if (val > max) /* just in case */
+ val = max;
+#else
+ if (size > max + 1) /* just in case */
+ size = max + 1;
+ if (val > max - size + 1)
+ val = max - size + 1;
+#endif
+ if (val < 0) /* minimal value is 0 */
+ val = 0;
+
+ /*
+ * Scrollbar at index 0 (the left one) contains all the information.
+ * It would be the same info for left and right so we just store it for
+ * one of them.
+ */
+ sb = &wp->w_scrollbars[0];
+
+ /*
+ * Note: no check for valid w_botline. If it's not valid the
+ * scrollbars will be updated later anyway.
+ */
+ if (size < 1 || wp->w_botline - 2 > max)
+ {
+ /*
+ * This can happen during changing files. Just don't update the
+ * scrollbar for now.
+ */
+ sb->height = 0; /* Force update next time */
+ if (gui.which_scrollbars[SBAR_LEFT])
+ gui_do_scrollbar(wp, SBAR_LEFT, FALSE);
+ if (gui.which_scrollbars[SBAR_RIGHT])
+ gui_do_scrollbar(wp, SBAR_RIGHT, FALSE);
+ continue;
+ }
+ if (force || sb->height != wp->w_height
+#ifdef FEAT_WINDOWS
+ || sb->top != wp->w_winrow
+ || sb->status_height != wp->w_status_height
+# ifdef FEAT_VERTSPLIT
+ || sb->width != wp->w_width
+ || prev_curwin != curwin
+# endif
+#endif
+ )
+ {
+ /* Height, width or position of scrollbar has changed. For
+ * vertical split: curwin changed. */
+ sb->height = wp->w_height;
+#ifdef FEAT_WINDOWS
+ sb->top = wp->w_winrow;
+ sb->status_height = wp->w_status_height;
+# ifdef FEAT_VERTSPLIT
+ sb->width = wp->w_width;
+# endif
+#endif
+
+ /* Calculate height and position in pixels */
+ h = (sb->height + sb->status_height) * gui.char_height;
+ y = sb->top * gui.char_height + gui.border_offset;
+#if defined(FEAT_MENU) && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF) && !defined(FEAT_GUI_PHOTON)
+ if (gui.menu_is_active)
+ y += gui.menu_height;
+#endif
+
+#if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_ATHENA))
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
+# ifdef FEAT_GUI_ATHENA
+ y += gui.toolbar_height;
+# else
+# ifdef FEAT_GUI_MSWIN
+ y += TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
+# endif
+# endif
+#endif
+
+#ifdef FEAT_WINDOWS
+ if (wp->w_winrow == 0)
+#endif
+ {
+ /* Height of top scrollbar includes width of top border */
+ h += gui.border_offset;
+ y -= gui.border_offset;
+ }
+ if (gui.which_scrollbars[SBAR_LEFT])
+ {
+ gui_mch_set_scrollbar_pos(&wp->w_scrollbars[SBAR_LEFT],
+ gui.left_sbar_x, y,
+ gui.scrollbar_width, h);
+ gui_do_scrollbar(wp, SBAR_LEFT, TRUE);
+ }
+ if (gui.which_scrollbars[SBAR_RIGHT])
+ {
+ gui_mch_set_scrollbar_pos(&wp->w_scrollbars[SBAR_RIGHT],
+ gui.right_sbar_x, y,
+ gui.scrollbar_width, h);
+ gui_do_scrollbar(wp, SBAR_RIGHT, TRUE);
+ }
+ }
+
+ /* Reduce the number of calls to gui_mch_set_scrollbar_thumb() by
+ * checking if the thumb moved at least a pixel. Only do this for
+ * Athena, most other GUIs require the update anyway to make the
+ * arrows work. */
+#ifdef FEAT_GUI_ATHENA
+ if (max == 0)
+ y = 0;
+ else
+ y = (val * (sb->height + 2) * gui.char_height + max / 2) / max;
+ if (force || sb->pixval != y || sb->size != size || sb->max != max)
+#else
+ if (force || sb->value != val || sb->size != size || sb->max != max)
+#endif
+ {
+ /* Thumb of scrollbar has moved */
+ sb->value = val;
+#ifdef FEAT_GUI_ATHENA
+ sb->pixval = y;
+#endif
+ sb->size = size;
+ sb->max = max;
+ if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT)
+ gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_LEFT],
+ val, size, max);
+ if (gui.which_scrollbars[SBAR_RIGHT]
+ && gui.dragged_sb != SBAR_RIGHT)
+ gui_mch_set_scrollbar_thumb(&wp->w_scrollbars[SBAR_RIGHT],
+ val, size, max);
+ }
+ }
+#ifdef FEAT_VERTSPLIT
+ prev_curwin = curwin;
+#endif
+ --hold_gui_events;
+}
+
+/*
+ * Enable or disable a scrollbar.
+ * Check for scrollbars for vertically split windows which are not enabled
+ * sometimes.
+ */
+ static void
+gui_do_scrollbar(wp, which, enable)
+ win_T *wp;
+ int which; /* SBAR_LEFT or SBAR_RIGHT */
+ int enable; /* TRUE to enable scrollbar */
+{
+#ifdef FEAT_VERTSPLIT
+ int midcol = curwin->w_wincol + curwin->w_width / 2;
+ int has_midcol = (wp->w_wincol <= midcol
+ && wp->w_wincol + wp->w_width >= midcol);
+
+ /* Only enable scrollbars that contain the middle column of the current
+ * window. */
+ if (gui.which_scrollbars[SBAR_RIGHT] != gui.which_scrollbars[SBAR_LEFT])
+ {
+ /* Scrollbars only on one side. Don't enable scrollbars that don't
+ * contain the middle column of the current window. */
+ if (!has_midcol)
+ enable = FALSE;
+ }
+ else
+ {
+ /* Scrollbars on both sides. Don't enable scrollbars that neither
+ * contain the middle column of the current window nor are on the far
+ * side. */
+ if (midcol > Columns / 2)
+ {
+ if (which == SBAR_LEFT ? wp->w_wincol != 0 : !has_midcol)
+ enable = FALSE;
+ }
+ else
+ {
+ if (which == SBAR_RIGHT ? wp->w_wincol + wp->w_width != Columns
+ : !has_midcol)
+ enable = FALSE;
+ }
+ }
+#endif
+ gui_mch_enable_scrollbar(&wp->w_scrollbars[which], enable);
+}
+
+/*
+ * Scroll a window according to the values set in the globals current_scrollbar
+ * and scrollbar_value. Return TRUE if the cursor in the current window moved
+ * or FALSE otherwise.
+ */
+ int
+gui_do_scroll()
+{
+ win_T *wp, *save_wp;
+ int i;
+ long nlines;
+ pos_T old_cursor;
+ linenr_T old_topline;
+#ifdef FEAT_DIFF
+ int old_topfill;
+#endif
+
+ for (wp = firstwin, i = 0; i < current_scrollbar; wp = W_NEXT(wp), i++)
+ if (wp == NULL)
+ break;
+ if (wp == NULL)
+ /* Couldn't find window */
+ return FALSE;
+
+ /*
+ * Compute number of lines to scroll. If zero, nothing to do.
+ */
+ nlines = (long)scrollbar_value + 1 - (long)wp->w_topline;
+ if (nlines == 0)
+ return FALSE;
+
+ save_wp = curwin;
+ old_topline = wp->w_topline;
+#ifdef FEAT_DIFF
+ old_topfill = wp->w_topfill;
+#endif
+ old_cursor = wp->w_cursor;
+ curwin = wp;
+ curbuf = wp->w_buffer;
+ if (nlines < 0)
+ scrolldown(-nlines, gui.dragged_wp == NULL);
+ else
+ scrollup(nlines, gui.dragged_wp == NULL);
+ /* Reset dragged_wp after using it. "dragged_sb" will have been reset for
+ * the mouse-up event already, but we still want it to behave like when
+ * dragging. But not the next click in an arrow. */
+ if (gui.dragged_sb == SBAR_NONE)
+ gui.dragged_wp = NULL;
+
+ if (old_topline != wp->w_topline
+#ifdef FEAT_DIFF
+ || old_topfill != wp->w_topfill
+#endif
+ )
+ {
+ if (p_so != 0)
+ {
+ cursor_correct(); /* fix window for 'so' */
+ update_topline(); /* avoid up/down jump */
+ }
+ if (old_cursor.lnum != wp->w_cursor.lnum)
+ coladvance(wp->w_curswant);
+#ifdef FEAT_SCROLLBIND
+ wp->w_scbind_pos = wp->w_topline;
+#endif
+ }
+
+ curwin = save_wp;
+ curbuf = save_wp->w_buffer;
+
+ /*
+ * Don't call updateWindow() when nothing has changed (it will overwrite
+ * the status line!).
+ */
+ if (old_topline != wp->w_topline
+#ifdef FEAT_DIFF
+ || old_topfill != wp->w_topfill
+#endif
+ )
+ {
+ redraw_win_later(wp, VALID);
+ updateWindow(wp); /* update window, status line, and cmdline */
+ }
+
+ return (wp == curwin && !equalpos(curwin->w_cursor, old_cursor));
+}
+
+
+/*
+ * Horizontal scrollbar stuff:
+ */
+
+/*
+ * Return length of line "lnum" for horizontal scrolling.
+ */
+ static colnr_T
+scroll_line_len(lnum)
+ linenr_T lnum;
+{
+ char_u *p;
+ colnr_T col;
+ int w;
+
+ p = ml_get(lnum);
+ col = 0;
+ if (*p != NUL)
+ for (;;)
+ {
+ w = chartabsize(p, col);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ if (*p == NUL) /* don't count the last character */
+ break;
+ col += w;
+ }
+ return col;
+}
+
+/* Remember which line is currently the longest, so that we don't have to
+ * search for it when scrolling horizontally. */
+static linenr_T longest_lnum = 0;
+
+ static void
+gui_update_horiz_scrollbar(force)
+ int force;
+{
+ long value, size, max; /* need 32 bit ints here */
+
+ if (!gui.which_scrollbars[SBAR_BOTTOM])
+ return;
+
+ if (!force && gui.dragged_sb == SBAR_BOTTOM)
+ return;
+
+ if (!force && curwin->w_p_wrap && gui.prev_wrap)
+ return;
+
+ /*
+ * It is possible for the cursor to be invalid if we're in the middle of
+ * something (like changing files). If so, don't do anything for now.
+ */
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ {
+ gui.bottom_sbar.value = -1;
+ return;
+ }
+
+ size = W_WIDTH(curwin);
+ if (curwin->w_p_wrap)
+ {
+ value = 0;
+#ifdef SCROLL_PAST_END
+ max = 0;
+#else
+ max = W_WIDTH(curwin) - 1;
+#endif
+ }
+ else
+ {
+ value = curwin->w_leftcol;
+
+ /* Calculate maximum for horizontal scrollbar. Check for reasonable
+ * line numbers, topline and botline can be invalid when displaying is
+ * postponed. */
+ if (vim_strchr(p_go, GO_HORSCROLL) == NULL
+ && curwin->w_topline <= curwin->w_cursor.lnum
+ && curwin->w_botline > curwin->w_cursor.lnum
+ && curwin->w_botline <= curbuf->b_ml.ml_line_count + 1)
+ {
+ linenr_T lnum;
+ colnr_T n;
+
+ /* Use maximum of all visible lines. Remember the lnum of the
+ * longest line, clostest to the cursor line. Used when scrolling
+ * below. */
+ max = 0;
+ for (lnum = curwin->w_topline; lnum < curwin->w_botline; ++lnum)
+ {
+ n = scroll_line_len(lnum);
+ if (n > (colnr_T)max)
+ {
+ max = n;
+ longest_lnum = lnum;
+ }
+ else if (n == (colnr_T)max
+ && abs((int)(lnum - curwin->w_cursor.lnum))
+ < abs((int)(longest_lnum - curwin->w_cursor.lnum)))
+ longest_lnum = lnum;
+ }
+ }
+ else
+ /* Use cursor line only. */
+ max = scroll_line_len(curwin->w_cursor.lnum);
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ {
+ /* May move the cursor even further to the right. */
+ if (curwin->w_virtcol >= (colnr_T)max)
+ max = curwin->w_virtcol;
+ }
+#endif
+
+#ifndef SCROLL_PAST_END
+ max += W_WIDTH(curwin) - 1;
+#endif
+ /* The line number isn't scrolled, thus there is less space when
+ * 'number' is set (also for 'foldcolumn'). */
+ size -= curwin_col_off();
+#ifndef SCROLL_PAST_END
+ max -= curwin_col_off();
+#endif
+ }
+
+#ifndef SCROLL_PAST_END
+ if (value > max - size + 1)
+ value = max - size + 1; /* limit the value to allowable range */
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl)
+ {
+ value = max + 1 - size - value;
+ if (value < 0)
+ {
+ size += value;
+ value = 0;
+ }
+ }
+#endif
+ if (!force && value == gui.bottom_sbar.value && size == gui.bottom_sbar.size
+ && max == gui.bottom_sbar.max)
+ return;
+
+ gui.bottom_sbar.value = value;
+ gui.bottom_sbar.size = size;
+ gui.bottom_sbar.max = max;
+ gui.prev_wrap = curwin->w_p_wrap;
+
+ gui_mch_set_scrollbar_thumb(&gui.bottom_sbar, value, size, max);
+}
+
+/*
+ * Do a horizontal scroll. Return TRUE if the cursor moved, FALSE otherwise.
+ */
+ int
+gui_do_horiz_scroll()
+{
+ /* no wrapping, no scrolling */
+ if (curwin->w_p_wrap)
+ return FALSE;
+
+ if (curwin->w_leftcol == scrollbar_value)
+ return FALSE;
+
+ curwin->w_leftcol = scrollbar_value;
+
+ /* When the line of the cursor is too short, move the cursor to the
+ * longest visible line. Do a sanity check on "longest_lnum", just in
+ * case. */
+ if (vim_strchr(p_go, GO_HORSCROLL) == NULL
+ && longest_lnum >= curwin->w_topline
+ && longest_lnum < curwin->w_botline
+ && !virtual_active())
+ {
+ if (scrollbar_value > scroll_line_len(curwin->w_cursor.lnum))
+ {
+ curwin->w_cursor.lnum = longest_lnum;
+ curwin->w_cursor.col = 0;
+ }
+ }
+
+ return leftcol_changed();
+}
+
+/*
+ * Check that none of the colors are the same as the background color
+ */
+ void
+gui_check_colors()
+{
+ if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
+ {
+ gui_set_bg_color((char_u *)"White");
+ if (gui.norm_pixel == gui.back_pixel || gui.norm_pixel == INVALCOLOR)
+ gui_set_fg_color((char_u *)"Black");
+ }
+}
+
+ void
+gui_set_fg_color(name)
+ char_u *name;
+{
+ gui.norm_pixel = gui_get_color(name);
+ hl_set_fg_color_name(vim_strsave(name));
+}
+
+ void
+gui_set_bg_color(name)
+ char_u *name;
+{
+ gui.back_pixel = gui_get_color(name);
+ hl_set_bg_color_name(vim_strsave(name));
+}
+
+/*
+ * Allocate a color by name.
+ * Returns INVALCOLOR and gives an error message when failed.
+ */
+ guicolor_T
+gui_get_color(name)
+ char_u *name;
+{
+ guicolor_T t;
+
+ if (*name == NUL)
+ return INVALCOLOR;
+ t = gui_mch_get_color(name);
+ if (t == INVALCOLOR
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+ && gui.in_use
+#endif
+ )
+ EMSG2(_("E254: Cannot allocate color %s"), name);
+ return t;
+}
+
+/*
+ * Return the grey value of a color (range 0-255).
+ */
+ int
+gui_get_lightness(pixel)
+ guicolor_T pixel;
+{
+ long_u rgb = gui_mch_get_rgb(pixel);
+
+ return ( (((rgb >> 16) & 0xff) * 299)
+ + (((rgb >> 8) & 0xff) * 587)
+ + ((rgb & 0xff) * 114)) / 1000;
+}
+
+#if defined(FEAT_GUI_X11) || defined(PROTO)
+ void
+gui_new_scrollbar_colors()
+{
+ win_T *wp;
+
+ /* Nothing to do if GUI hasn't started yet. */
+ if (!gui.in_use)
+ return;
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ gui_mch_set_scrollbar_colors(&(wp->w_scrollbars[SBAR_LEFT]));
+ gui_mch_set_scrollbar_colors(&(wp->w_scrollbars[SBAR_RIGHT]));
+ }
+ gui_mch_set_scrollbar_colors(&gui.bottom_sbar);
+}
+#endif
+
+/*
+ * Call this when focus has changed.
+ */
+ void
+gui_focus_change(in_focus)
+ int in_focus;
+{
+/*
+ * Skip this code to avoid drawing the cursor when debugging and switching
+ * between the debugger window and gvim.
+ */
+#if 1
+ gui.in_focus = in_focus;
+ out_flush(); /* make sure output has been written */
+ gui_update_cursor(TRUE, FALSE);
+
+# ifdef FEAT_XIM
+ xim_set_focus(in_focus);
+# endif
+
+ ui_focus_change(in_focus);
+#endif
+}
+
+/*
+ * Called when the mouse moved (but not when dragging).
+ */
+ void
+gui_mouse_moved(x, y)
+ int x;
+ int y;
+{
+ win_T *wp;
+ char_u st[6];
+
+#ifdef FEAT_MOUSESHAPE
+ /* Get window pointer, and update mouse shape as well. */
+ wp = xy2win(x, y);
+#endif
+
+ /* Only handle this when 'mousefocus' set and ... */
+ if (p_mousef
+ && !hold_gui_events /* not holding events */
+ && (State & (NORMAL|INSERT))/* Normal/Visual/Insert mode */
+ && State != HITRETURN /* but not hit-return prompt */
+ && msg_scrolled == 0 /* no scrolled message */
+ && !need_mouse_correct /* not moving the pointer */
+ && gui.in_focus) /* gvim in focus */
+ {
+ /* Don't move the mouse when it's left or right of the Vim window */
+ if (x < 0 || x > Columns * gui.char_width)
+ return;
+#ifndef FEAT_MOUSESHAPE
+ wp = xy2win(x, y);
+#endif
+ if (wp == curwin || wp == NULL)
+ return; /* still in the same old window, or none at all */
+
+ /*
+ * format a mouse click on status line input
+ * ala gui_send_mouse_event(0, x, y, 0, 0);
+ * Trick: Use a column of -1, so that check_termcode will generate a
+ * K_LEFTMOUSE_NM key code.
+ */
+ if (finish_op)
+ {
+ /* abort the current operator first */
+ st[0] = ESC;
+ add_to_input_buf(st, 1);
+ }
+ st[0] = CSI;
+ st[1] = KS_MOUSE;
+ st[2] = KE_FILLER;
+ st[3] = (char_u)MOUSE_LEFT;
+ fill_mouse_coord(st + 4,
+#ifdef FEAT_VERTSPLIT
+ W_WINCOL(wp),
+#else
+ -1,
+#endif
+ wp->w_height + W_WINROW(wp));
+
+ add_to_input_buf(st, 8);
+ st[3] = (char_u)MOUSE_RELEASE;
+ add_to_input_buf(st, 8);
+
+#ifdef FEAT_GUI_GTK
+ /* Need to wake up the main loop */
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+#endif
+ }
+}
+
+/*
+ * Called when mouse should be moved to window with focus.
+ */
+ void
+gui_mouse_correct()
+{
+ int x, y;
+ win_T *wp = NULL;
+
+ need_mouse_correct = FALSE;
+ if (gui.in_use && p_mousef)
+ {
+ x = gui_mch_get_mouse_x();
+ /* Don't move the mouse when it's left or right of the Vim window */
+ if (x < 0 || x > Columns * gui.char_width)
+ return;
+ y = gui_mch_get_mouse_y();
+ if (y >= 0)
+ wp = xy2win(x, y);
+ if (wp != curwin && wp != NULL) /* If in other than current window */
+ {
+ validate_cline_row();
+ gui_mch_setmouse((int)W_ENDCOL(curwin) * gui.char_width - 3,
+ (W_WINROW(curwin) + curwin->w_wrow) * gui.char_height
+ + (gui.char_height) / 2);
+ }
+ }
+}
+
+/*
+ * Find window where the mouse pointer "y" coordinate is in.
+ */
+/*ARGSUSED*/
+ static win_T *
+xy2win(x, y)
+ int x;
+ int y;
+{
+#ifdef FEAT_WINDOWS
+ int row;
+ int col;
+ win_T *wp;
+
+ row = Y_2_ROW(y);
+ col = X_2_COL(x);
+ if (row < 0 || col < 0) /* before first window */
+ return NULL;
+ wp = mouse_find_win(&row, &col);
+# ifdef FEAT_MOUSESHAPE
+ if (State == HITRETURN || State == ASKMORE)
+ {
+ if (Y_2_ROW(y) >= msg_row)
+ update_mouseshape(SHAPE_IDX_MOREL);
+ else
+ update_mouseshape(SHAPE_IDX_MORE);
+ }
+ else if (row > wp->w_height) /* below status line */
+ update_mouseshape(SHAPE_IDX_CLINE);
+# ifdef FEAT_VERTSPLIT
+ else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width
+ && (row != wp->w_height || !stl_connected(wp)))
+ update_mouseshape(SHAPE_IDX_VSEP);
+# endif
+ else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0
+ && row == wp->w_height)
+ update_mouseshape(SHAPE_IDX_STATUS);
+ else
+ update_mouseshape(-2);
+# endif
+ return wp;
+#else
+ return firstwin;
+#endif
+}
+
+/*
+ * ":gui" and ":gvim": Change from the terminal version to the GUI version.
+ * File names may be given to redefine the args list.
+ */
+ void
+ex_gui(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+
+ /*
+ * Check for "-f" argument: foreground, don't fork.
+ * Also don't fork when started with "gvim -f".
+ * Do fork when using "gui -b".
+ */
+ if (arg[0] == '-'
+ && (arg[1] == 'f' || arg[1] == 'b')
+ && (arg[2] == NUL || vim_iswhite(arg[2])))
+ {
+ gui.dofork = (arg[1] == 'b');
+ eap->arg = skipwhite(eap->arg + 2);
+ }
+ if (!gui.in_use)
+ {
+ /* Clear the command. Needed for when forking+exiting, to avoid part
+ * of the argument ending up after the shell prompt. */
+ msg_clr_eos_force();
+ gui_start();
+ }
+ if (!ends_excmd(*eap->arg))
+ ex_next(eap);
+}
+
+#if ((defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32) \
+ || defined(FEAT_GUI_PHOTON)) && defined(FEAT_TOOLBAR)) || defined(PROTO)
+/*
+ * This is shared between Athena, Motif and GTK.
+ */
+static char_u *gfp_buffer;
+
+static void gfp_setname __ARGS((char_u *fname));
+
+/*
+ * Callback function for do_in_runtimepath().
+ */
+ static void
+gfp_setname(fname)
+ char_u *fname;
+{
+ if (STRLEN(fname) >= MAXPATHL)
+ *gfp_buffer = NUL;
+ else
+ STRCPY(gfp_buffer, fname);
+}
+
+/*
+ * Find the path of bitmap "name" with extension "ext" in 'runtimepath'.
+ * Return FAIL for failure and OK if buffer[MAXPATHL] contains the result.
+ */
+ int
+gui_find_bitmap(name, buffer, ext)
+ char_u *name;
+ char_u *buffer;
+ char *ext;
+{
+ if (STRLEN(name) > MAXPATHL - 14)
+ return FAIL;
+ sprintf((char *)buffer, "bitmaps/%s.%s", name, ext);
+ gfp_buffer = buffer;
+ if (do_in_runtimepath(buffer, FALSE, gfp_setname) == FAIL || *buffer == NUL)
+ return FAIL;
+ return OK;
+}
+
+# if !defined(HAVE_GTK2) || defined(PROTO)
+/*
+ * Given the name of the "icon=" argument, try finding the bitmap file for the
+ * icon. If it is an absolute path name, use it as it is. Otherwise append
+ * "ext" and search for it in 'runtimepath'.
+ * The result is put in "buffer[MAXPATHL]". If something fails "buffer"
+ * contains "name".
+ */
+ void
+gui_find_iconfile(name, buffer, ext)
+ char_u *name;
+ char_u *buffer;
+ char *ext;
+{
+ char_u buf[MAXPATHL + 1];
+
+ expand_env(name, buffer, MAXPATHL);
+ if (!mch_isFullName(buffer) && gui_find_bitmap(buffer, buf, ext) == OK)
+ STRCPY(buffer, buf);
+}
+# endif
+#endif
+
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(PROTO)
+ void
+display_errors()
+{
+ char_u *p;
+
+ if (isatty(2))
+ fflush(stderr);
+ else if (error_ga.ga_data != NULL)
+ {
+ /* avoid putting up a message box with blanks only */
+ for (p = (char_u *)error_ga.ga_data; *p != NUL; ++p)
+ if (!isspace(*p))
+ {
+ /* Truncate a very long message, it will go off-screen. */
+ if (STRLEN(p) > 2000)
+ STRCPY(p + 2000 - 14, "...(truncated)");
+ (void)do_dialog(VIM_ERROR, (char_u *)_("Error"),
+ p, (char_u *)_("&Ok"), 1, NULL);
+ break;
+ }
+ ga_clear(&error_ga);
+ }
+}
+#endif
+
+#if defined(NO_CONSOLE_INPUT) || defined(PROTO)
+/*
+ * Return TRUE if still starting up and there is no place to enter text.
+ * For GTK and X11 we check if stderr is not a tty, which means we were
+ * (probably) started from the desktop. Also check stdin, "vim >& file" does
+ * allow typing on stdin.
+ */
+ int
+no_console_input()
+{
+ return ((!gui.in_use || gui.starting)
+# ifndef NO_CONSOLE
+ && !isatty(0) && !isatty(2)
+# endif
+ );
+}
+#endif
+
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
+ || defined(MSWIN_FIND_REPLACE) || defined(FEAT_SUN_WORKSHOP) \
+ || defined(PROTO)
+/*
+ * Update the current window and the screen.
+ */
+ void
+gui_update_screen()
+{
+ update_topline();
+ validate_cursor();
+ update_screen(0); /* may need to update the screen */
+ setcursor();
+ out_flush(); /* make sure output has been written */
+ gui_update_cursor(TRUE, FALSE);
+ gui_mch_flush();
+}
+#endif
+
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \
+ || defined(MSWIN_FIND_REPLACE) || defined(PROTO)
+static void concat_esc __ARGS((garray_T *gap, char_u *text, int what));
+
+/*
+ * Get the text to use in a find/replace dialog. Uses the last search pattern
+ * if the argument is empty.
+ * Returns an allocated string.
+ */
+ char_u *
+get_find_dialog_text(arg, wwordp, mcasep)
+ char_u *arg;
+ int *wwordp; /* return: TRUE if \< \> found */
+ int *mcasep; /* return: TRUE if \C found */
+{
+ char_u *text;
+
+ if (*arg == NUL)
+ text = last_search_pat();
+ else
+ text = arg;
+ if (text != NULL)
+ {
+ text = vim_strsave(text);
+ if (text != NULL)
+ {
+ int len = STRLEN(text);
+ int i;
+
+ /* Remove "\V" */
+ if (len >= 2 && STRNCMP(text, "\\V", 2) == 0)
+ {
+ mch_memmove(text, text + 2, (size_t)(len - 1));
+ len -= 2;
+ }
+
+ /* Recognize "\c" and "\C" and remove. */
+ if (len >= 2 && *text == '\\' && (text[1] == 'c' || text[1] == 'C'))
+ {
+ *mcasep = (text[1] == 'C');
+ mch_memmove(text, text + 2, (size_t)(len - 1));
+ len -= 2;
+ }
+
+ /* Recognize "\<text\>" and remove. */
+ if (len >= 4
+ && STRNCMP(text, "\\<", 2) == 0
+ && STRNCMP(text + len - 2, "\\>", 2) == 0)
+ {
+ *wwordp = TRUE;
+ mch_memmove(text, text + 2, (size_t)(len - 4));
+ text[len - 4] = NUL;
+ }
+
+ /* Recognize "\/" or "\?" and remove. */
+ for (i = 0; i + 1 < len; ++i)
+ if (text[i] == '\\' && (text[i + 1] == '/'
+ || text[i + 1] == '?'))
+ {
+ mch_memmove(text + i, text + i + 1, (size_t)(len - i));
+ --len;
+ }
+ }
+ }
+ return text;
+}
+
+/*
+ * Concatenate "text" to grow array "gap", escaping "what" with a backslash.
+ */
+ static void
+concat_esc(gap, text, what)
+ garray_T *gap;
+ char_u *text;
+ int what;
+{
+ while (*text != NUL)
+ {
+#ifdef FEAT_MBYTE
+ int l = (*mb_ptr2len_check)(text);
+ if (l > 1)
+ {
+ while (--l >= 0)
+ ga_append(gap, *text++);
+ continue;
+ }
+#endif
+ if (*text == what)
+ ga_append(gap, '\\');
+ ga_append(gap, *text);
+ ++text;
+ }
+}
+
+/*
+ * Handle the press of a button in the find-replace dialog.
+ * Return TRUE when something was added to the input buffer.
+ */
+ int
+gui_do_findrepl(flags, find_text, repl_text, down)
+ int flags; /* one of FRD_REPLACE, FRD_FINDNEXT, etc. */
+ char_u *find_text;
+ char_u *repl_text;
+ int down; /* Search downwards. */
+{
+ garray_T ga;
+ int i;
+ int type = (flags & FRD_TYPE_MASK);
+ char_u *p;
+
+ ga_init2(&ga, 1, 100);
+
+ if (type == FRD_REPLACE)
+ {
+ /* Do the replacement when the text under the cursor matches. */
+ i = STRLEN(find_text);
+ p = ml_get_cursor();
+ if (((flags & FRD_MATCH_CASE)
+ ? STRNCMP(p, find_text, i) == 0
+ : STRNICMP(p, find_text, i) == 0)
+ && u_save_cursor() == OK)
+ {
+ /* A button was pressed thus undo should be synced. */
+ if (no_u_sync == 0)
+ u_sync();
+
+ del_bytes((long)i, FALSE);
+ ins_str(repl_text);
+ }
+ }
+ else if (type == FRD_REPLACEALL)
+ ga_concat(&ga, (char_u *)"%s/");
+
+ ga_concat(&ga, (char_u *)"\\V");
+ if (flags & FRD_MATCH_CASE)
+ ga_concat(&ga, (char_u *)"\\C");
+ else
+ ga_concat(&ga, (char_u *)"\\c");
+ if (flags & FRD_WHOLE_WORD)
+ ga_concat(&ga, (char_u *)"\\<");
+ if (type == FRD_REPLACEALL || down)
+ concat_esc(&ga, find_text, '/'); /* escape slashes */
+ else
+ concat_esc(&ga, find_text, '?'); /* escape '?' */
+ if (flags & FRD_WHOLE_WORD)
+ ga_concat(&ga, (char_u *)"\\>");
+
+ if (type == FRD_REPLACEALL)
+ {
+ /* A button was pressed, thus undo should be synced. */
+ if (no_u_sync == 0)
+ u_sync();
+
+ ga_concat(&ga, (char_u *)"/");
+ concat_esc(&ga, repl_text, '/'); /* escape slashes */
+ ga_concat(&ga, (char_u *)"/g");
+ do_cmdline_cmd(ga.ga_data);
+ }
+ else
+ {
+ /* Search for the next match. */
+ i = msg_scroll;
+ do_search(NULL, down ? '/' : '?', ga.ga_data, 1L,
+ SEARCH_MSG + SEARCH_MARK);
+ msg_scroll = i; /* don't let an error message set msg_scroll */
+ }
+
+ if (State & (NORMAL | INSERT))
+ {
+ gui_update_screen(); /* update the screen */
+ msg_didout = 0; /* overwrite any message */
+ need_wait_return = FALSE; /* don't wait for return */
+ }
+
+ vim_free(ga.ga_data);
+ return (ga.ga_len > 0);
+}
+
+#endif
+
+#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
+ || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_MAC) \
+ || defined(PROTO)
+
+#ifdef FEAT_WINDOWS
+static void gui_wingoto_xy __ARGS((int x, int y));
+
+/*
+ * Jump to the window at specified point (x, y).
+ */
+ static void
+gui_wingoto_xy(x, y)
+ int x;
+ int y;
+{
+ int row = Y_2_ROW(y);
+ int col = X_2_COL(x);
+ win_T *wp;
+
+ if (row >= 0 && col >= 0)
+ {
+ wp = mouse_find_win(&row, &col);
+ if (wp != NULL && wp != curwin)
+ win_goto(wp);
+ }
+}
+#endif
+
+/*
+ * Process file drop. Mouse cursor position, key modifiers, name of files
+ * and count of files are given. Argument "fnames[count]" has full pathnames
+ * of dropped files, they will be freed in this function, and caller can't use
+ * fnames after call this function.
+ */
+/*ARGSUSED*/
+ void
+gui_handle_drop(x, y, modifiers, fnames, count)
+ int x;
+ int y;
+ int_u modifiers;
+ char_u **fnames;
+ int count;
+{
+ int i;
+ char_u *p;
+
+ /*
+ * When the cursor is at the command line, add the file names to the
+ * command line, don't edit the files.
+ */
+ if (State & CMDLINE)
+ {
+ shorten_filenames(fnames, count);
+ for (i = 0; i < count; ++i)
+ {
+ if (fnames[i] != NULL)
+ {
+ if (i > 0)
+ add_to_input_buf((char_u*)" ", 1);
+
+ /* We don't know what command is used thus we can't be sure
+ * about which characters need to be escaped. Only escape the
+ * most common ones. */
+# ifdef BACKSLASH_IN_FILENAME
+ p = vim_strsave_escaped(fnames[i], (char_u *)" \t\"|");
+# else
+ p = vim_strsave_escaped(fnames[i], (char_u *)"\\ \t\"|");
+# endif
+ if (p != NULL)
+ add_to_input_buf(p, (int)STRLEN(p));
+ vim_free(p);
+ vim_free(fnames[i]);
+ }
+ }
+ vim_free(fnames);
+ }
+ else
+ {
+ /* Go to the window under mouse cursor, then shorten given "fnames" by
+ * current window, because a window can have local current dir. */
+# ifdef FEAT_WINDOWS
+ gui_wingoto_xy(x, y);
+# endif
+ shorten_filenames(fnames, count);
+
+ /* If Shift held down, remember the first item. */
+ if ((modifiers & MOUSE_SHIFT) != 0)
+ p = vim_strsave(fnames[0]);
+ else
+ p = NULL;
+
+ /* Handle the drop, :edit or :split to get to the file. This also
+ * frees fnames[]. Skip this if there is only one item it's a
+ * directory and Shift is held down. */
+ if (count == 1 && (modifiers & MOUSE_SHIFT) != 0
+ && mch_isdir(fnames[0]))
+ {
+ vim_free(fnames[0]);
+ vim_free(fnames);
+ }
+ else
+ handle_drop(count, fnames, (modifiers & MOUSE_CTRL) != 0);
+
+ /* If Shift held down, change to first file's directory. If the first
+ * item is a directory, change to that directory (and let the explorer
+ * plugin show the contents). */
+ if (p != NULL)
+ {
+ if (mch_isdir(p))
+ {
+ if (mch_chdir((char *)p) == 0)
+ shorten_fnames(TRUE);
+ }
+ else if (vim_chdirfile(p) == OK)
+ shorten_fnames(TRUE);
+ vim_free(p);
+ }
+
+ /* Update the screen display */
+ update_screen(NOT_VALID);
+# ifdef FEAT_MENU
+ gui_update_menus(0);
+# endif
+ setcursor();
+ out_flush();
+ gui_update_cursor(FALSE, FALSE);
+ gui_mch_flush();
+ }
+}
+#endif
diff --git a/src/gui.h b/src/gui.h
new file mode 100644
index 000000000..4357c46aa
--- /dev/null
+++ b/src/gui.h
@@ -0,0 +1,525 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Motif support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/* For debugging */
+/* #define D(x) printf x; */
+#define D(x)
+
+#if defined(FEAT_GUI_AMIGA)
+# include <intuition/intuition.h>
+#endif
+
+#ifdef FEAT_GUI_MOTIF
+# define FEAT_GUI_X11
+# include <Xm/Xm.h>
+#endif
+
+#ifdef FEAT_GUI_ATHENA
+# define FEAT_GUI_X11
+# include <X11/Intrinsic.h>
+# include <X11/StringDefs.h>
+#endif
+
+#ifdef FEAT_BEVAL
+# include "gui_beval.h"
+#endif
+
+#ifdef FEAT_GUI_GTK
+# include <X11/Intrinsic.h>
+# include <gtk/gtk.h>
+#endif
+
+#ifdef FEAT_GUI_BEOS
+# include "gui_beos.h"
+#endif
+
+#ifdef FEAT_GUI_MAC
+# include <Types.h>
+/*# include <Memory.h>*/
+# include <Quickdraw.h>
+# include <Fonts.h>
+# include <Events.h>
+# include <Menus.h>
+# if !(defined (TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
+# include <Windows.h>
+# endif
+# include <Controls.h>
+/*# include <TextEdit.h>*/
+# include <Dialogs.h>
+# include <OSUtils.h>
+/*
+# include <ToolUtils.h>
+# include <SegLoad.h>*/
+#endif
+
+#ifdef RISCOS
+# include "gui_riscos.h"
+#endif
+
+#ifdef FEAT_GUI_PHOTON
+# include <Ph.h>
+# include <Pt.h>
+# include "photon/PxProto.h"
+#endif
+
+/*
+ * On some systems, when we compile with the GUI, we always use it. On Mac
+ * there is no terminal version, and on Windows we can't figure out how to
+ * fork one off with :gui.
+ */
+#if defined(FEAT_GUI_MSWIN) || (defined(FEAT_GUI_MAC) && !defined(MACOS_X_UNIX))
+# define ALWAYS_USE_GUI
+#endif
+
+#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) || defined(HAVE_GTK2)
+# define USE_ON_FLY_SCROLL
+#endif
+
+/*
+ * GUIs that support dropping files on a running Vim.
+ */
+#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MAC) \
+ || defined(FEAT_GUI_BEOS) || defined(FEAT_GUI_GTK)
+# define HAVE_DROP_FILE
+#endif
+
+/*
+ * This define makes menus always use a fontset.
+ * We're not sure if this code always works, thus it can be disabled.
+ */
+#ifdef FEAT_XFONTSET
+# define FONTSET_ALWAYS
+#endif
+
+/*
+ * These macros convert between character row/column and pixel coordinates.
+ * TEXT_X - Convert character column into X pixel coord for drawing strings.
+ * TEXT_Y - Convert character row into Y pixel coord for drawing strings.
+ * FILL_X - Convert character column into X pixel coord for filling the area
+ * under the character.
+ * FILL_Y - Convert character row into Y pixel coord for filling the area
+ * under the character.
+ * X_2_COL - Convert X pixel coord into character column.
+ * Y_2_ROW - Convert Y pixel coord into character row.
+ */
+#ifdef FEAT_GUI_W32
+# define TEXT_X(col) ((col) * gui.char_width)
+# define TEXT_Y(row) ((row) * gui.char_height + gui.char_ascent)
+# define FILL_X(col) ((col) * gui.char_width)
+# define FILL_Y(row) ((row) * gui.char_height)
+# define X_2_COL(x) ((x) / gui.char_width)
+# define Y_2_ROW(y) ((y) / gui.char_height)
+#else
+# define TEXT_X(col) ((col) * gui.char_width + gui.border_offset)
+# define FILL_X(col) ((col) * gui.char_width + gui.border_offset)
+# define X_2_COL(x) (((x) - gui.border_offset) / gui.char_width)
+# define TEXT_Y(row) ((row) * gui.char_height + gui.char_ascent \
+ + gui.border_offset)
+# define FILL_Y(row) ((row) * gui.char_height + gui.border_offset)
+# define Y_2_ROW(y) (((y) - gui.border_offset) / gui.char_height)
+#endif
+
+/* Indices for arrays of scrollbars */
+#define SBAR_NONE -1
+#define SBAR_LEFT 0
+#define SBAR_RIGHT 1
+#define SBAR_BOTTOM 2
+
+/* Orientations for scrollbars */
+#define SBAR_VERT 0
+#define SBAR_HORIZ 1
+
+/* Default size of scrollbar */
+#define SB_DEFAULT_WIDTH 16
+
+/* Default height of the menu bar */
+#define MENU_DEFAULT_HEIGHT 1 /* figure it out at runtime */
+
+/* Flags for gui_mch_outstr_nowrap() */
+#define GUI_MON_WRAP_CURSOR 0x01 /* wrap cursor at end of line */
+#define GUI_MON_INVERT 0x02 /* invert the characters */
+#define GUI_MON_IS_CURSOR 0x04 /* drawing cursor */
+#define GUI_MON_TRS_CURSOR 0x08 /* drawing transparent cursor */
+#define GUI_MON_NOCLEAR 0x10 /* don't clear selection */
+
+/* Flags for gui_mch_draw_string() */
+#define DRAW_TRANSP 0x01 /* draw with transparant bg */
+#define DRAW_BOLD 0x02 /* draw bold text */
+#define DRAW_UNDERL 0x04 /* draw underline text */
+#if defined(RISCOS) || defined(HAVE_GTK2)
+# define DRAW_ITALIC 0x08 /* draw italic text */
+#endif
+#define DRAW_CURSOR 0x10 /* drawing block cursor (win32) */
+
+/* For our own tearoff menu item */
+#define TEAR_STRING "-->Detach"
+#define TEAR_LEN (9) /* length of above string */
+
+/* for the toolbar */
+#ifdef FEAT_GUI_W16
+# define TOOLBAR_BUTTON_HEIGHT 15
+# define TOOLBAR_BUTTON_WIDTH 16
+#else
+# define TOOLBAR_BUTTON_HEIGHT 18
+# define TOOLBAR_BUTTON_WIDTH 18
+#endif
+#define TOOLBAR_BORDER_HEIGHT 12 /* room above+below buttons for MSWindows */
+
+#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+# define NO_CONSOLE_INPUT /* use no_console_input() to check if there
+ is no console input possible */
+#endif
+
+typedef struct GuiScrollbar
+{
+ long ident; /* Unique identifier for each scrollbar */
+ struct window *wp; /* Scrollbar's window, NULL for bottom */
+ int type; /* one of SBAR_{LEFT,RIGHT,BOTTOM} */
+ long value; /* Represents top line number visible */
+#ifdef FEAT_GUI_ATHENA
+ int pixval; /* pixel count of value */
+#endif
+ long size; /* Size of scrollbar thumb */
+ long max; /* Number of lines in buffer */
+
+ /* Values measured in characters: */
+ int top; /* Top of scroll bar (chars from row 0) */
+ int height; /* Current height of scroll bar in rows */
+#ifdef FEAT_VERTSPLIT
+ int width; /* Current width of scroll bar in cols */
+#endif
+ int status_height; /* Height of status line */
+#ifdef FEAT_GUI_X11
+ Widget id; /* Id of real scroll bar */
+#endif
+#ifdef FEAT_GUI_GTK
+ GtkWidget *id; /* Id of real scroll bar */
+ unsigned long handler_id; /* Id of "value_changed" signal handler */
+#endif
+
+#ifdef FEAT_GUI_MSWIN
+ HWND id; /* Id of real scroll bar */
+ int scroll_shift; /* The scrollbar stuff can handle only up to
+ 32767 lines. When the file is longer,
+ scroll_shift is set to the number of shifts
+ to reduce the count. */
+#endif
+#if FEAT_GUI_BEOS
+ VimScrollBar *id; /* Pointer to real scroll bar */
+#endif
+#ifdef FEAT_GUI_MAC
+ ControlHandle id; /* A handle to the scrollbar */
+#endif
+#ifdef RISCOS
+ int id; /* Window handle of scrollbar window */
+#endif
+#ifdef FEAT_GUI_PHOTON
+ PtWidget_t *id;
+#endif
+} scrollbar_T;
+
+typedef long guicolor_T; /* handle for a GUI color; for X11 this should
+ be "Pixel", but that's an unsigned and we
+ need a signed value */
+#define INVALCOLOR (guicolor_T)-11111 /* number for invalid color; on 32 bit
+ displays there is a tiny chance this is an
+ actual color */
+
+#ifdef FEAT_GUI_GTK
+# ifdef HAVE_GTK2
+ typedef PangoFontDescription *GuiFont; /* handle for a GUI font */
+ typedef PangoFontDescription *GuiFontset; /* handle for a GUI fontset */
+# else
+ typedef GdkFont *GuiFont; /* handle for a GUI font */
+ typedef GdkFont *GuiFontset; /* handle for a GUI fontset */
+# endif
+# define NOFONT (GuiFont)NULL
+# define NOFONTSET (GuiFontset)NULL
+#else
+# ifdef FEAT_GUI_PHOTON
+ typedef char *GuiFont;
+ typedef char *GuiFontset;
+# define NOFONT (GuiFont)NULL
+# define NOFONTSET (GuiFontset)NULL
+# else
+# ifdef FEAT_GUI_X11
+ typedef XFontStruct *GuiFont; /* handle for a GUI font */
+ typedef XFontSet GuiFontset; /* handle for a GUI fontset */
+# define NOFONT (GuiFont)0
+# define NOFONTSET (GuiFontset)0
+# else
+ typedef long_u GuiFont; /* handle for a GUI font */
+ typedef long_u GuiFontset; /* handle for a GUI fontset */
+# define NOFONT (GuiFont)0
+# define NOFONTSET (GuiFontset)0
+# endif
+# endif
+#endif
+
+typedef struct Gui
+{
+ int in_focus; /* Vim has input focus */
+ int in_use; /* Is the GUI being used? */
+ int starting; /* GUI will start in a little while */
+ int shell_created; /* Has the shell been created yet? */
+ int dying; /* Is vim dying? Then output to terminal */
+ int dofork; /* Use fork() when GUI is starting */
+ int dragged_sb; /* Which scrollbar being dragged, if any? */
+ win_T *dragged_wp; /* Which WIN's sb being dragged, if any? */
+ int pointer_hidden; /* Is the mouse pointer hidden? */
+ int col; /* Current cursor column in GUI display */
+ int row; /* Current cursor row in GUI display */
+ int cursor_col; /* Physical cursor column in GUI display */
+ int cursor_row; /* Physical cursor row in GUI display */
+ char cursor_is_valid; /* There is a cursor at cursor_row/col */
+ int num_cols; /* Number of columns */
+ int num_rows; /* Number of rows */
+ int scroll_region_top; /* Top (first) line of scroll region */
+ int scroll_region_bot; /* Bottom (last) line of scroll region */
+ int scroll_region_left; /* Left (first) column of scroll region */
+ int scroll_region_right; /* Right (last) col. of scroll region */
+ int highlight_mask; /* Highlight attribute mask */
+ int scrollbar_width; /* Width of vertical scrollbars */
+ int scrollbar_height; /* Height of horizontal scrollbar */
+ int left_sbar_x; /* Calculated x coord for left scrollbar */
+ int right_sbar_x; /* Calculated x coord for right scrollbar */
+
+#ifdef FEAT_MENU
+# ifndef FEAT_GUI_GTK
+ int menu_height; /* Height of the menu bar */
+ int menu_width; /* Width of the menu bar */
+# endif
+ char menu_is_active; /* TRUE if menu is present */
+# ifdef FEAT_GUI_ATHENA
+ char menu_height_fixed; /* TRUE if menu height fixed */
+# endif
+#endif
+
+ scrollbar_T bottom_sbar; /* Bottom scrollbar */
+ int which_scrollbars[3];/* Which scrollbar boxes are active? */
+ int prev_wrap; /* For updating the horizontal scrollbar */
+ int char_width; /* Width of char in pixels */
+ int char_height; /* Height of char in pixels + 'linespace' */
+ int char_ascent; /* Ascent of char in pixels */
+ int border_width; /* Width of our border around text area */
+ int border_offset; /* Total pixel offset for all borders */
+
+ GuiFont norm_font; /* Normal font */
+#ifndef HAVE_GTK2
+ GuiFont bold_font; /* Bold font */
+ GuiFont ital_font; /* Italic font */
+ GuiFont boldital_font; /* Bold-Italic font */
+#else
+ int font_can_bold; /* Whether norm_font supports bold weight.
+ * The styled font variants are not used. */
+#endif
+
+#if defined(FEAT_MENU) && !defined(HAVE_GTK2)
+# ifdef FONTSET_ALWAYS
+ GuiFontset menu_fontset; /* set of fonts for multi-byte chars */
+# else
+ GuiFont menu_font; /* menu item font */
+# endif
+#endif
+#ifdef FEAT_MBYTE
+ GuiFont wide_font; /* 'guifontwide' font */
+#endif
+#ifdef FEAT_XFONTSET
+ GuiFontset fontset; /* set of fonts for multi-byte chars */
+#endif
+ guicolor_T back_pixel; /* Color of background */
+ guicolor_T norm_pixel; /* Color of normal text */
+ guicolor_T def_back_pixel; /* default Color of background */
+ guicolor_T def_norm_pixel; /* default Color of normal text */
+
+#ifdef FEAT_GUI_X11
+ char *rsrc_menu_fg_name; /* Color of menu and dialog foregound */
+ guicolor_T menu_fg_pixel; /* Same in Pixel format */
+ char *rsrc_menu_bg_name; /* Color of menu and dialog backgound */
+ guicolor_T menu_bg_pixel; /* Same in Pixel format */
+ char *rsrc_scroll_fg_name; /* Color of scrollbar foreground */
+ guicolor_T scroll_fg_pixel; /* Same in Pixel format */
+ char *rsrc_scroll_bg_name; /* Color of scrollbar background */
+ guicolor_T scroll_bg_pixel; /* Same in Pixel format */
+
+# ifdef FEAT_GUI_MOTIF
+ guicolor_T menu_def_fg_pixel; /* Default menu foreground */
+ guicolor_T menu_def_bg_pixel; /* Default menu background */
+ guicolor_T scroll_def_fg_pixel; /* Default scrollbar foreground */
+ guicolor_T scroll_def_bg_pixel; /* Default scrollbar background */
+# endif
+ Display *dpy; /* X display */
+ Window wid; /* Window id of text area */
+ int visibility; /* Is shell partially/fully obscured? */
+ GC text_gc;
+ GC back_gc;
+ GC invert_gc;
+ Cursor blank_pointer; /* Blank pointer */
+
+ /* X Resources */
+ char_u *rsrc_font_name; /* Resource font name, used if 'guifont'
+ not set */
+ char_u *rsrc_bold_font_name; /* Resource bold font name */
+ char_u *rsrc_ital_font_name; /* Resource italic font name */
+ char_u *rsrc_boldital_font_name; /* Resource bold-italic font name */
+ char_u *rsrc_menu_font_name; /* Resource menu Font name */
+ Bool rsrc_rev_video; /* Use reverse video? */
+
+ char_u *geom; /* Geometry, eg "80x24" */
+ Bool color_approx; /* Some color was approximated */
+#endif
+
+#ifdef FEAT_GUI_GTK
+ int visibility; /* Is shell partially/fully obscured? */
+ GdkCursor *blank_pointer; /* Blank pointer */
+
+ /* X Resources */
+ char_u *geom; /* Geometry, eg "80x24" */
+
+ GtkWidget *mainwin; /* top level GTK window */
+ GtkWidget *formwin; /* manages all the windows below */
+ GtkWidget *drawarea; /* the "text" area */
+# ifdef FEAT_MENU
+ GtkWidget *menubar; /* menubar */
+# endif
+# ifdef FEAT_TOOLBAR
+ GtkWidget *toolbar; /* toolbar */
+# endif
+# ifdef FEAT_GUI_GNOME
+ GtkWidget *menubar_h; /* menubar handle */
+ GtkWidget *toolbar_h; /* toolbar handle */
+# endif
+ GdkColor *fgcolor; /* GDK-styled foreground color */
+ GdkColor *bgcolor; /* GDK-styled background color */
+# ifndef HAVE_GTK2
+ GuiFont current_font;
+# endif
+ GdkGC *text_gc; /* cached GC for normal text */
+# ifdef HAVE_GTK2
+ PangoContext *text_context; /* the context used for all text */
+ PangoFont *ascii_font; /* cached font for ASCII strings */
+ PangoGlyphString *ascii_glyphs; /* cached code point -> glyph map */
+# endif
+
+ GtkAccelGroup *accel_group;
+# ifndef HAVE_GTK2
+ GtkWidget *fontdlg; /* font selection dialog window */
+ char_u *fontname; /* font name from font selection dialog */
+# endif
+ GtkWidget *filedlg; /* file selection dialog */
+ char_u *browse_fname; /* file name from filedlg */
+#endif /* FEAT_GUI_GTK */
+
+#ifdef FEAT_FOOTER
+ int footer_height; /* height of the message footer */
+#endif
+
+#if defined(FEAT_TOOLBAR) \
+ && (defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF))
+ int toolbar_height; /* height of the toolbar */
+#endif
+
+#ifdef FEAT_BEVAL_TIP
+ /* Tooltip properties; also used for balloon evaluation */
+ char_u *rsrc_tooltip_font_name; /* tooltip font name */
+ char *rsrc_tooltip_fg_name; /* tooltip foreground color name */
+ char *rsrc_tooltip_bg_name; /* tooltip background color name */
+ guicolor_T tooltip_fg_pixel; /* tooltip foreground color */
+ guicolor_T tooltip_bg_pixel; /* tooltip background color */
+ XFontSet tooltip_fontset; /* tooltip fontset */
+#endif
+
+#ifdef FEAT_GUI_MSWIN
+ GuiFont currFont; /* Current font */
+ guicolor_T currFgColor; /* Current foreground text color */
+ guicolor_T currBgColor; /* Current background text color */
+#endif
+
+#ifdef FEAT_GUI_BEOS
+ VimApp *vimApp;
+ VimWindow *vimWindow;
+ VimFormView *vimForm;
+ VimTextAreaView *vimTextArea;
+ int vdcmp; /* Vim Direct Communication Message Port */
+#endif
+
+#ifdef FEAT_GUI_MAC
+ WindowPtr VimWindow;
+ MenuHandle MacOSHelpMenu; /* Help menu provided by the MacOS */
+ int MacOSHelpItems; /* Nr of help-items supplied by MacOS */
+ int MacOSHaveCntxMenu; /* Contextual menu available */
+ WindowPtr wid; /* Window id of text area */
+ int visibility; /* Is window partially/fully obscured? */
+#endif
+
+#if defined(FEAT_GUI_AMIGA)
+ struct Window *window; /* a handle to the amiga window */
+ struct Menu *menu; /* a pointer to the first menu */
+ struct TextFont *textfont; /* a pointer to the font structure */
+#endif
+
+#ifdef RISCOS
+ int window_handle;
+ char_u *window_title;
+ int window_title_size;
+ int fg_colour; /* in 0xBBGGRR format */
+ int bg_colour;
+#endif
+
+#ifdef FEAT_GUI_PHOTON
+ PtWidget_t *vimWindow; /* PtWindow */
+ PtWidget_t *vimTextArea; /* PtRaw */
+ PtWidget_t *vimContainer; /* PtPanel */
+# if defined(FEAT_MENU) || defined(FEAT_TOOLBAR)
+ PtWidget_t *vimToolBarGroup;
+# endif
+# ifdef FEAT_MENU
+ PtWidget_t *vimMenuBar;
+# endif
+# ifdef FEAT_TOOLBAR
+ PtWidget_t *vimToolBar;
+ int toolbar_height;
+# endif
+ PhEvent_t *event_buffer;
+#endif
+
+#ifdef FEAT_XIM
+ char *rsrc_input_method;
+ char *rsrc_preedit_type_name;
+#endif
+} gui_T;
+
+extern gui_T gui; /* this is defined in gui.c */
+
+/* definitions of available window positionings for gui_*_position_in_parent()
+ */
+typedef enum
+{
+ VW_POS_MOUSE,
+ VW_POS_CENTER,
+ VW_POS_TOP_CENTER
+}
+gui_win_pos_T;
+
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
+ || defined(MSWIN_FIND_REPLACE)
+/*
+ * Flags used to distinguish the different contexts in which the
+ * find/replace callback may be called.
+ */
+# define FRD_FINDNEXT 1 /* Find next in find dialog */
+# define FRD_R_FINDNEXT 2 /* Find next in repl dialog */
+# define FRD_REPLACE 3 /* Replace once */
+# define FRD_REPLACEALL 4 /* Replace remaining matches */
+# define FRD_UNDO 5 /* Undo replaced text */
+# define FRD_TYPE_MASK 7 /* Mask for the callback type */
+/* Flags which change the way searching is done. */
+# define FRD_WHOLE_WORD 0x08 /* match whole word only */
+# define FRD_MATCH_CASE 0x10 /* match case */
+#endif
diff --git a/src/gui_amiga.c b/src/gui_amiga.c
new file mode 100644
index 000000000..28786aa6f
--- /dev/null
+++ b/src/gui_amiga.c
@@ -0,0 +1,1795 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Amiga GUI support by Michael Nielsen
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <exec/types.h>
+#include <intuition/intuition.h>
+#include <utility/tagitem.h>
+#include <graphics/text.h>
+#include <graphics/rastport.h>
+#include <graphics/layers.h>
+#include <proto/intuition.h>
+#include <proto/graphics.h>
+#include <proto/layers.h>
+#include <devices/timer.h>
+#include <assert.h>
+#include "vim.h"
+#include "gui_amiga.h"
+#include <math.h>
+#include <limits.h>
+
+#ifdef __AROS__
+#include <aros/debug.h>
+#endif
+
+#include "version.h"
+
+#if defined(FEAT_GUI_AMIGA) || defined(PROTO)
+
+#define KEYUP 76
+#define KEYDOWN 77
+#define KEYRIGHT 78
+#define KEYLEFT 79
+#define KEYBACKSPACE 0x41
+#define KEYDELETE 0x46
+#define KEYINSERT 0x47
+#define KEYHOME 0x70
+#define KEYEND 0x71
+#define KEYWHEELUP 0x7A
+#define KEYWHEELDOWN 0x7B
+
+/* When generating prototypes on Unix, these need to be defined */
+#ifdef PROTO
+# define STRPTR char *
+# define BOOL int
+# define UBYTE int
+#endif
+
+static struct PropInfo Gadget2SInfo = { AUTOKNOB+PROPBORDERLESS+FREEVERT+PROPNEWLOOK, 0, 0, MAXBODY, MAXBODY, };
+//static struct Image Image1 = { 0, 0, 10, 397, 0, NULL, 0x0000, 0x0000, NULL };
+static struct Gadget propGadget = { NULL, -12, 15, 10, -28,
+ GFLG_RELRIGHT+GFLG_RELHEIGHT,
+ GACT_RELVERIFY+GACT_RIGHTBORDER+GACT_IMMEDIATE,
+ GTYP_PROPGADGET+GTYP_GZZGADGET,
+ NULL, NULL,
+ NULL, NULL, (APTR)&Gadget2SInfo, NULL, NULL };
+
+static struct timerequest *TimerIO;
+static struct MsgPort *TimerMP;
+static BOOL TimerSent;
+
+struct GFXBase *gfxBase;
+struct ExecBase *execBase;
+struct LayersBase *layersBase;
+
+struct MyColor
+{
+ WORD pen;
+ BOOL alloced;
+};
+
+struct MyColor MyColorTable[256];
+
+struct TagItem tags[] =
+{
+ {WA_Left, 0},
+ {WA_Top, 0},
+ {WA_Width, 400},
+ {WA_Height, 400},
+ {WA_Title, (ULONG)VIM_VERSION_SHORT},
+ {WA_ScreenTitle, (ULONG)VIM_VERSION_LONG},
+ {WA_DragBar, TRUE}, /* enable dragging of the window */
+ {WA_DepthGadget, TRUE}, /* enable the depth gadget */
+ {WA_CloseGadget, TRUE}, /* enable the close gadget*/
+ {WA_SizeGadget, TRUE}, /* enable the size gadget */
+ {WA_SizeBBottom, TRUE}, /* sizegadget contained in bottom border */
+ {WA_SmartRefresh, TRUE}, /* choose smart refresh, saves us doing a lot of work */
+ {WA_ReportMouse, TRUE}, /* Report the position of the mouse */
+ {WA_GimmeZeroZero, TRUE},
+ {WA_Activate, TRUE}, /* Activate window on startup */
+ {WA_Activate, TRUE}, /* Activate window on startup */
+ {WA_NoCareRefresh, TRUE}, /* Refresh screen, don't tell us */
+ {WA_NewLookMenus, TRUE}, /* use the new options for the menu */
+ {WA_AutoAdjust, TRUE}, /* If window is too big for screen adjust size*/
+ {WA_NoCareRefresh, TRUE}, /* If window is too big for screen adjust size*/
+ {WA_MouseQueue, 1}, /* Limit number of pending mouse movement*/
+ {WA_RptQueue, 10}, /* Limit number of pending keystrokes*/
+ {WA_IDCMP, /* IDCMP, what events interest us */
+ IDCMP_NEWSIZE /* Notify us about size change of window*/
+ |IDCMP_REFRESHWINDOW /* Notify us when the window needs refreshing */
+ |IDCMP_MOUSEBUTTONS /* Notify us when the mouse buttons have been used */
+ |IDCMP_MOUSEMOVE /* Notify us when the mouse is moving */
+ |IDCMP_GADGETDOWN /* Notify us when a gadget has been selected */
+ |IDCMP_GADGETUP /* Notify us when a gadget has been released */
+ |IDCMP_MENUPICK /* Notify us when a menu has been picked */
+ |IDCMP_CLOSEWINDOW /* Notify us when the user tries to close the window */
+ |IDCMP_VANILLAKEY /* Notify us about keystrokes */
+ |IDCMP_RAWKEY /* Notify us when raw key events have been used, ie cursor*/
+ |IDCMP_INTUITICKS /* Simpler timer for the blink option */
+ |IDCMP_MENUHELP /* Allow the help key to be used during menu events */
+ |IDCMP_GADGETHELP /* Allow the help key to be used during gadget events */
+ |IDCMP_INACTIVEWINDOW /* notify of inactive window */
+ |IDCMP_ACTIVEWINDOW /* notify of inactive window */
+ },
+ {TAG_DONE, NULL}
+};
+
+#if defined(D)
+#undef D
+#endif
+
+/*#define D(_msg) fprintf(stderr, "%s\n", _msg)*/
+
+#define D(_A)
+#define kprintf(s, ...)
+
+static void AmigaError(const char *string);
+
+void HandleEvent(unsigned long * object);
+static UBYTE getrealcolor(guicolor_T i);
+
+static struct NewWindow vimNewWindow =
+{
+ 0, 0, /* window XY origin relative to TopLeft of screen */
+ 0, 0, /* window width and height */
+ 0, 1, /* detail and block pens */
+ NULL, /* IDCMP flags */
+ NULL, /* other window flags */
+ &propGadget, /* first gadget in gadget list */
+ NULL, /* custom CHECKMARK imagery */
+ "Amiga Vim gui", /* window title */
+ NULL, /* custom screen pointer */
+ NULL, /* custom bitmap */
+ 50, 50, /* minimum width and height */
+ (unsigned short)-1, (unsigned short)-1, /* maximum width and height */
+ WBENCHSCREEN /* destination screen type */
+};
+
+static struct
+{
+ unsigned int key_sym;
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {0, 0, 0}
+};
+
+#if 0
+ /* not used? */
+ static int
+hex_digit(int c)
+{
+ if (isdigit(c))
+ return c - '0';
+ c = TOLOWER_ASC(c);
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ return -1000;
+}
+#endif
+
+static int characterWidth = -1;
+static int characterHeight = -1;
+static struct
+{
+ BOOL active;
+ enum
+ {
+ CursorOff,
+ CursorOn,
+ CursorWait
+ } state;
+ int onTime;
+ int offTime;
+ int waitTime;
+ int current;
+} cursor =
+{
+ TRUE,
+ CursorWait,
+ 10,
+ 10,
+ 7,
+ 0
+};
+
+enum DrawBoxMode
+{
+ DB_Filled,
+ DB_NotFilled
+};
+
+ static void
+TextDimensions(void)
+{
+ struct TextExtent textExt;
+
+ TextExtent(gui.window->RPort, "s", 1, &textExt);
+
+ characterWidth = textExt.te_Width;
+ characterHeight = textExt.te_Height;
+}
+
+ static int
+posWidthCharToPoint(int width)
+{
+ return (width)*characterWidth;
+}
+
+ static int
+posHeightCharToPoint(int height)
+{
+ return (int)(height)*characterHeight;
+}
+
+ static int
+posWidthPointToChar(int width)
+{
+ //return (int)floor((float)width/(float)characterWidth)-1;
+ return width /characterWidth;
+}
+
+ static int
+posHeightPointToChar(int height)
+{
+ //return (int)floor((float)height/(float)characterHeight)-2;
+ return height / characterHeight;
+}
+
+ static int
+widthCharToPoint(int width)
+{
+ return (width)*(characterWidth);
+}
+
+ static int
+heightCharToPoint(int height)
+{
+ return (height)*characterHeight;
+}
+
+ static int
+widthPointToChar(int width)
+{
+ return (width)/characterWidth;
+}
+
+ static int
+heightPointToChar(int height)
+{
+ return (height)/characterHeight;
+}
+
+ static void
+refreshBorder(void)
+{
+ /*WaitBOVP(gui.window->);*/
+ RefreshWindowFrame(gui.window);
+}
+
+ static void
+drawBox(enum DrawBoxMode mode, unsigned short col, unsigned short row, int w, int h, guicolor_T color)
+{
+ LONG apen = GetAPen(gui.window->RPort);
+ LONG x1, y1, x2, y2;
+
+kprintf(" drawbox %d,%d color %d\n", col, row, color);
+
+ SetAPen(gui.window->RPort, getrealcolor(color));
+
+ x1 = posWidthCharToPoint(col);
+ y1 = posHeightCharToPoint(row + 1) - h;
+ x2 = x1 + w - 1;
+ y2 = posHeightCharToPoint(row + 1) - 1;
+
+ switch(mode)
+ {
+ case DB_Filled:
+ RectFill(gui.window->RPort, x1, y1, x2, y2);
+ break;
+
+ case DB_NotFilled:
+ Move(gui.window->RPort, x1, y1);
+ Draw(gui.window->RPort, x2, y1);
+ Draw(gui.window->RPort, x2, y2);
+ Draw(gui.window->RPort, x1, y2);
+ Draw(gui.window->RPort, x1, y1);
+ break;
+ }
+
+ SetAPen(gui.window->RPort, apen);
+
+}
+
+ static enum event
+EventHandler(void)
+{
+ struct IntuiMessage *msg;
+ enum event returnEvent = ev_Ignore;
+ int class, code;
+ static int dragging = 0;
+ static int mouseX, mouseY;
+ char_u string[40];
+ BOOL quit_request = FALSE;
+
+ msg = (struct IntuiMessage *)GetMsg(gui.window->UserPort);
+
+ if (!msg)
+ {
+ returnEvent = ev_NullEvent;
+ }
+ else
+ {
+
+ class = msg->Class;
+ code = msg->Code;
+
+ switch(class)
+ {
+ case IDCMP_INTUITICKS:
+ /*
+ if (cursor.active)
+ {
+ cursor.current ++;
+ if (cursor.state == CursorOff)
+ {
+ printf("cursor turned on\n");
+ if (cursor.offTime < cursor.current)
+ {
+ gui_undraw_cursor();
+ cursor.state = CursorOn;
+ cursor.current = 0;
+ }
+ }
+ else if (cursor.state == CursorOn)
+ {
+ printf("cursor turned off\n");
+ if (cursor.onTime < cursor.current)
+ {
+ cursor.state = CursorOff;
+ gui_update_cursor(FALSE);
+ cursor.current = 0;
+ }
+ }
+ else if (cursor.state == CursorWait)
+ {
+ printf("cursor turned Wait\n");
+ if (cursor.waitTime < cursor.current)
+ {
+ cursor.state = CursorOn;
+ cursor.current = 0;
+ }
+ }
+ }
+ else
+ {
+ }
+ returnEvent = ev_IntuiTicks;
+ */
+ break;
+
+ case IDCMP_MOUSEBUTTONS:
+ {
+ int vim_modifiers=0;
+ D("Mouse button event detected");
+ switch (msg->Qualifier )
+ {
+ case IEQUALIFIER_LALT:
+ case IEQUALIFIER_RALT:
+ D("detected a Alt key");
+ vim_modifiers|=MOUSE_ALT;
+ break;
+
+ case IEQUALIFIER_LSHIFT:
+ case IEQUALIFIER_RSHIFT:
+ D("detected a Shift key");
+ vim_modifiers|=MOUSE_SHIFT;
+ break;
+ case IEQUALIFIER_CONTROL:
+ D("detected a Control key");
+ vim_modifiers |= MOUSE_CTRL;
+ break;
+ }
+ if (code == SELECTDOWN)
+ {
+ D("Select Down detected\n");
+ dragging = 1;
+ gui_send_mouse_event(MOUSE_LEFT,
+ mouseX = msg->MouseX - gui.window->BorderLeft,
+ mouseY = msg->MouseY - gui.window->BorderTop,
+ FALSE,
+ vim_modifiers);
+ /*gui_start_highlight(HL_ALL);*/
+ }
+ else if (code == SELECTUP)
+ {
+ D("Select UP detected\n");
+ dragging = 0;
+ gui_send_mouse_event(MOUSE_RELEASE,
+ msg->MouseX - gui.window->BorderLeft,
+ msg->MouseY - gui.window->BorderTop,
+ FALSE, vim_modifiers);
+ /*gui_stop_highlight(mask);*/
+ }
+ returnEvent = ev_MouseButtons;
+ break;
+ }
+ case IDCMP_MOUSEMOVE:
+ if ((abs(mouseX-(msg->MouseX - gui.window->BorderLeft)) > characterWidth) ||
+ (abs(mouseY-(msg->MouseY - gui.window->BorderTop))>characterHeight))
+ {
+ int vim_modifiers=0;
+
+ switch (msg->Qualifier )
+ {
+ case IEQUALIFIER_LALT:
+ case IEQUALIFIER_RALT:
+ D("detected a Alt key");
+ vim_modifiers|=MOUSE_ALT;
+ break;
+
+ case IEQUALIFIER_LSHIFT:
+ case IEQUALIFIER_RSHIFT:
+ D("detected a Shift key");
+ vim_modifiers|=MOUSE_SHIFT;
+ break;
+ case IEQUALIFIER_CONTROL:
+ D("detected a Control key");
+ vim_modifiers |= MOUSE_CTRL;
+ break;
+ }
+
+ mouseX = msg->MouseX - gui.window->BorderLeft;
+ mouseY = msg->MouseY - gui.window->BorderTop;
+ if (!dragging)
+ {
+ gui_send_mouse_event(MOUSE_SETPOS, mouseX, mouseY, FALSE, vim_modifiers);
+ break;
+ }
+ else
+ {
+ D("dragging\n");
+ gui_send_mouse_event(MOUSE_DRAG, mouseX, mouseY, FALSE, vim_modifiers);
+ }
+ }
+ returnEvent = ev_MouseMove;
+ break;
+ case IDCMP_VANILLAKEY:
+kprintf("===vanillakey %d\n", code);
+ {
+ string[0] = (char_u)code;
+ if (code == CSI)
+ {
+ /* Insert CSI as K_CSI. Untested! */
+ string[1] = KS_EXTRA;
+ string[2] = (int)KE_CSI;
+ add_to_input_buf(string, 3);
+ }
+ else if (code == 8)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'b';
+ add_to_input_buf(string, 3);
+ }
+ else if (code == 127)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'D';
+ add_to_input_buf(string, 3);
+ }
+ else
+ {
+ int len = 1;
+
+ if (input_conv.vc_type != CONV_NONE)
+ len = convert_input(string, 1, sizeof(string));
+ add_to_input_buf(string, len);
+ }
+ returnEvent = ev_KeyStroke;
+ break;
+
+ case IDCMP_RAWKEY:
+ if (msg->Qualifier & IEQUALIFIER_LSHIFT)
+ {
+ }
+ else if (msg->Qualifier & IEQUALIFIER_RSHIFT)
+ {
+ }
+ else if (msg->Qualifier & IEQUALIFIER_CONTROL)
+ {
+ if (code == 33)
+ {
+ trash_input_buf();
+ }
+ }
+ else if (msg->Code == KEYUP)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'u';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYLEFT)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'l';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYRIGHT)
+ {
+kprintf("## keyright");
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'r';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYDOWN)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'd';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYBACKSPACE)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'b';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYDELETE)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'D';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYINSERT)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'I';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYHOME)
+ {
+ string[0] = CSI;
+ string[1] = 'k';
+ string[2] = 'h';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYEND)
+ {
+ string[0] = CSI;
+ string[1] = '@';
+ string[2] = '7';
+ add_to_input_buf(string, 3);
+ }
+ else if (msg->Code == KEYWHEELUP)
+ {
+ int vim_modifiers=0;
+
+ switch (msg->Qualifier )
+ {
+ case IEQUALIFIER_LALT:
+ case IEQUALIFIER_RALT:
+ D("detected a Alt key");
+ vim_modifiers|=MOUSE_ALT;
+ break;
+
+ case IEQUALIFIER_LSHIFT:
+ case IEQUALIFIER_RSHIFT:
+ D("detected a Shift key");
+ vim_modifiers|=MOUSE_SHIFT;
+ break;
+ case IEQUALIFIER_CONTROL:
+ D("detected a Control key");
+ vim_modifiers |= MOUSE_CTRL;
+ break;
+ }
+ gui_send_mouse_event(MOUSE_4, 0, 1, FALSE, vim_modifiers);
+
+ }
+ else if (msg->Code == KEYWHEELDOWN)
+ {
+ int vim_modifiers=0;
+
+ switch (msg->Qualifier )
+ {
+ case IEQUALIFIER_LALT:
+ case IEQUALIFIER_RALT:
+ D("detected a Alt key");
+ vim_modifiers|=MOUSE_ALT;
+ break;
+
+ case IEQUALIFIER_LSHIFT:
+ case IEQUALIFIER_RSHIFT:
+ D("detected a Shift key");
+ vim_modifiers|=MOUSE_SHIFT;
+ break;
+ case IEQUALIFIER_CONTROL:
+ D("detected a Control key");
+ vim_modifiers |= MOUSE_CTRL;
+ break;
+ }
+ gui_send_mouse_event(MOUSE_5, 0, 1, FALSE, vim_modifiers);
+ }
+
+ returnEvent = ev_KeyStroke;
+ break;
+ }
+ case IDCMP_MENUVERIFY:
+ returnEvent = ev_MenuVerify;
+ /* Menu verification requested */
+ switch (code)
+ {
+ case MENUWAITING:
+ /*
+ ** It's not for us, the user is accessing another
+ ** programs menu, this is a good time to do some
+ ** cleanup etc
+ */
+ break;
+ case MENUHOT:
+ /*
+ ** It is our menu that is going hot, we have kontrol
+ ** Menu action can be cancelled by
+ ** msg->Code = MENUCANCEL;
+ */
+ break;
+ default:
+ break;
+ }
+ break;
+ case IDCMP_MENUPICK:
+ returnEvent = ev_MenuPick;
+ {
+ /*
+ ** one of our menu's have been selected, let's find out which
+ */
+ union myMenuItemUnion *item;
+ int menuNumber;
+
+ menuNumber = code;
+
+ item = (union myMenuItemUnion *) ItemAddress(gui.menu, menuNumber);
+
+
+ if (item)
+ {
+ gui_menu_cb(item->myMenuItem.guiMenu);
+ }
+ }
+ break;
+ case IDCMP_CLOSEWINDOW:
+ quit_request = TRUE;
+ break;
+
+ case IDCMP_NEWSIZE:
+ {
+ int cx, cy;
+ //cx = widthPointToChar(gui.window->GZZWidth);
+ //cy = heightPointToChar(gui.window->GZZHeight);
+
+ cx = gui.window->GZZWidth;
+ cy = gui.window->GZZHeight - characterHeight;
+
+ gui_resize_shell(cx, cy);
+
+ returnEvent = ev_NewSize;
+ break;
+ }
+ case IDCMP_REFRESHWINDOW:
+ refreshBorder();
+ returnEvent = ev_RefreshWindow;
+ break;
+ case IDCMP_GADGETDOWN:
+ returnEvent = ev_GadgetDown;
+ break;
+ case IDCMP_GADGETUP:
+ returnEvent = ev_GadgetUp;
+ break;
+ case IDCMP_MENUHELP:
+ returnEvent = ev_MenuHelp;
+ break;
+ case IDCMP_GADGETHELP:
+ returnEvent = ev_GadgetHelp;
+ break;
+ case IDCMP_INACTIVEWINDOW:
+ gui.in_focus = FALSE;
+ gui_update_cursor(TRUE, FALSE);
+ break;
+
+ case IDCMP_ACTIVEWINDOW:
+ gui.in_focus = TRUE;
+ gui_update_cursor(TRUE, FALSE);
+ break;
+ default:
+ break;
+ }
+ ReplyMsg((struct Message*)msg);
+ }
+
+ if (quit_request)
+ {
+ getout(0); // gui_mch_exit(1);
+ }
+
+ return returnEvent;
+ /* mouse positin gui.window->MoseY, gui.window->MouseX) */
+}
+
+ static int
+checkEventHandler(void)
+{
+ enum event happened;
+
+ do
+ {
+ happened = EventHandler() ;
+ }
+ while (happened != ev_NullEvent);
+
+ return OK;
+}
+
+ static int
+charEventHandler(int wtime)
+{
+ enum event happened;
+ int rc;
+
+ do
+ {
+ Wait(1<<gui.window->UserPort->mp_SigBit);
+
+ happened = EventHandler() ;
+ }
+ while ((happened != ev_IntuiTicks) && (happened != ev_KeyStroke) && (happened != ev_MenuPick) && (happened != ev_MouseMove) &&(happened != ev_MouseButtons) );
+
+ if (happened == ev_KeyStroke || happened == ev_MenuPick)
+ rc = OK;
+ else
+ rc = FAIL;
+
+ return rc;
+}
+
+
+/*
+ * add primary menu
+ */
+ void
+gui_mch_add_menu_item(vimmenu_T *menu, int idx)
+{
+ union myMenuItemUnion *menuItemUnion = NULL;
+ struct IntuiText *menutext = NULL;
+ vimmenu_T *parent;
+
+ assert(menu != NULL);
+ assert(menu->parent != NULL);
+ parent = menu->parent;
+
+ /* Don't add menu separator */
+ if (menu_is_separator(menu->name))
+ return;
+
+ if (parent->menuItemPtr == NULL)
+ return;
+
+ /* TODO: use menu->mnemonic and menu->actext */
+ menutext = (struct IntuiText *) malloc(sizeof(struct IntuiText));
+
+ SetAttrib(menutext, FrontPen, 3);
+ SetAttrib(menutext, BackPen, 1);
+ SetAttrib(menutext, DrawMode, COMPLEMENT);
+ SetAttrib(menutext, LeftEdge, 0);
+ SetAttrib(menutext, TopEdge, 0);
+ SetAttrib(menutext, ITextFont, NULL);
+ SetAttrib(menutext, NextText, NULL);
+
+ menuItemUnion = malloc(sizeof(*menuItemUnion));
+
+ SetAttrib(&menuItemUnion->menuItem, NextItem, parent->menuItemPtr);
+ SetAttrib(&menuItemUnion->menuItem, LeftEdge, 0);
+ SetAttrib(&menuItemUnion->menuItem, Width, characterWidth*strlen(menu->dname));
+ SetAttrib(&menuItemUnion->menuItem, Height, characterHeight+2);
+ SetAttrib(&menuItemUnion->menuItem, Flags, ITEMTEXT+ITEMENABLED+HIGHCOMP);
+ SetAttrib(&menuItemUnion->menuItem, MutualExclude, 0);
+ SetAttrib(&menuItemUnion->menuItem, ItemFill, (APTR)menutext);
+ SetAttrib(&menuItemUnion->menuItem, SelectFill, NULL);
+ SetAttrib(&menuItemUnion->menuItem, Command, NULL);
+ SetAttrib(&menuItemUnion->menuItem, SubItem, NULL);
+ SetAttrib(&menuItemUnion->menuItem, NextSelect, MENUNULL);
+
+ menutext->IText = malloc(strlen(menu->dname) + 1);
+
+ strcpy(menutext->IText, menu->dname);
+
+ menuItemUnion->menuItem.NextItem = NULL;
+
+
+ if (parent)
+ {
+ if (!parent->menuItemPtr)
+ {
+ D("Adding first subElement");
+ SetAttrib(&menuItemUnion->menuItem, TopEdge, 0);
+ parent->menuPtr->FirstItem = &menuItemUnion->menuItem;
+ parent->menuItemPtr = &menuItemUnion->menuItem;
+ }
+ else
+ {
+ struct MenuItem *tmpMenuItem;
+ tmpMenuItem = parent->menuItemPtr;
+ while (tmpMenuItem->NextItem)
+ {
+ tmpMenuItem = tmpMenuItem->NextItem;
+ }
+ tmpMenuItem->NextItem = &menuItemUnion->menuItem;
+ SetAttrib(&menuItemUnion->menuItem, TopEdge, tmpMenuItem->TopEdge+tmpMenuItem->Height);
+ }
+ }
+ menu->menuPtr= NULL;
+ menu->menuItemPtr = &menuItemUnion->menuItem;
+ menuItemUnion->myMenuItem.guiMenu = menu;
+}
+
+
+ static struct Menu *
+getMenu(struct RastPort *rast, int left, STRPTR name)
+{
+ struct Menu *menu;
+ struct TextExtent textExt;
+
+ menu = malloc(sizeof(*menu));
+ menu->NextMenu = NULL;
+ menu->LeftEdge = left;
+
+ TextExtent(rast, name, strlen(name), &textExt);
+
+ menu->TopEdge = 0;
+ menu->Width = textExt.te_Width;
+ menu->Height = textExt.te_Height;
+ menu->Flags = ITEMTEXT+HIGHCOMP+MENUENABLED;
+ menu->MenuName = name;
+ menu->FirstItem = NULL;
+
+ return menu;
+}
+
+/*
+ * add 1st level submenu item
+ */
+ void
+gui_mch_add_menu(vimmenu_T *menu, int idx)
+{
+ struct Menu *newMenu;
+ int pos = 0;
+
+ if (!menu_is_menubar(menu->name))
+ return;
+
+ menu->menuPtr = newMenu = getMenu(gui.window->RPort, 0, menu->dname);
+ menu->menuItemPtr = NULL;
+ newMenu->NextMenu = NULL;
+
+ if (!gui.menu)
+ {
+ D("Adding head menu");
+ gui.menu = newMenu ;
+ }
+ else
+ {
+ struct Menu *tmpMenu;
+
+ tmpMenu = gui.menu;
+ while (tmpMenu->NextMenu)
+ tmpMenu = tmpMenu->NextMenu;
+ tmpMenu->NextMenu = newMenu;
+ pos = tmpMenu->LeftEdge +
+ TextLength(gui.window->RPort, tmpMenu->MenuName,
+ strlen(tmpMenu->MenuName));
+ newMenu->LeftEdge = pos;
+ }
+}
+
+ void
+gui_mch_toggle_tearoffs(enable)
+ int enable;
+{
+ /* no tearoff menus */
+}
+
+ int
+gui_mch_set_blinking(long wait, long on, long off)
+{
+ cursor.waitTime = wait/100;
+ cursor.onTime = on/100;
+ cursor.offTime = off/100;
+ return OK;
+}
+
+ void
+gui_mch_prepare(int *argc, char **argv)
+{
+ D("gui_mch_prepare");
+
+ execBase = (struct ExecBase *)OpenLibrary("exec.library", NULL);
+ gfxBase = (struct GFXBase *)OpenLibrary("graphics.library", NULL);
+ layersBase = (struct LayersBase *)OpenLibrary("layers.library", NULL);
+
+ if (!execBase)
+ {
+ D("Cannot open exec.library, aborting");
+ }
+ if (!gfxBase)
+ {
+ D("Cannot open graphics.library, aborting");
+ }
+ if (!layersBase)
+ {
+ D("Cannot open graphics.library, aborting");
+ }
+ D("gui_mch_prepare done ");
+}
+
+ void
+atexitDoThis(void)
+{
+kprintf("atexitdothis###\n");
+ gui_mch_exit(-1);
+}
+
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check(void)
+{
+ if (execBase && gfxBase && layersBase)
+ return OK;
+ return FAIL;
+}
+
+ int
+gui_mch_init(void)
+{
+ int returnCode = FAIL; /* assume failure*/
+
+ TimerMP = CreateMsgPort();
+ if (!TimerMP) return FAIL;
+
+ TimerIO = (struct timerequest *)CreateIORequest(TimerMP, sizeof(*TimerIO));
+ if (!TimerIO) return FAIL;
+
+ if (OpenDevice("timer.device", UNIT_VBLANK, &TimerIO->tr_node, 0)) return FAIL;
+
+ gui.window = OpenWindowTagList(&vimNewWindow, tags);
+ if (gui.window)
+ {
+ gui.in_use = TRUE;
+ gui.in_focus=TRUE;
+ gui.norm_pixel = gui.def_norm_pixel = 1;
+ gui.back_pixel = gui.def_back_pixel = 0;
+
+ set_normal_colors();
+ gui_check_colors();
+
+ SetDrMd(gui.window->RPort, JAM2);
+ gui_mch_set_colors(gui.norm_pixel, gui.back_pixel);
+
+ atexit(atexitDoThis);
+
+ TextDimensions();
+ returnCode = OK; /* we've had success */
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+ gui_mch_clear_all();
+
+ }
+ gui.menu = NULL;
+
+ return returnCode;
+}
+
+ void
+gui_mch_new_colors(void)
+{
+kprintf("### gui_mch_new_colors\n");
+ SetAPen(gui.window->RPort, getrealcolor(gui.norm_pixel));
+ SetBPen(gui.window->RPort, getrealcolor(gui.back_pixel));
+
+ D("gui_mch_new_colors");
+}
+
+ int
+gui_mch_open(void)
+{
+ D("gui_mch_open");
+
+ highlight_gui_started();
+ return OK;
+}
+
+ void
+gui_mch_exit(int returnCode)
+{
+kprintf("###gui_mch_exit\n");
+ D("****gui_mch_exit");
+
+ if (TimerSent)
+ {
+ if (!CheckIO(&TimerIO->tr_node)) AbortIO(&TimerIO->tr_node);
+ WaitIO(&TimerIO->tr_node);
+ TimerSent = FALSE;
+ }
+
+ if (TimerIO)
+ {
+ CloseDevice(&TimerIO->tr_node);
+ DeleteIORequest(&TimerIO->tr_node);
+ TimerIO = NULL;
+ }
+
+ if (TimerMP)
+ {
+ DeleteMsgPort(TimerMP);
+ TimerMP = NULL;
+ }
+
+ if (gui.window)
+ {
+ int i;
+
+ for(i = 0; i < sizeof(MyColorTable) / sizeof(MyColorTable[0]); i++)
+ {
+ if (MyColorTable[i].alloced)
+ {
+ ReleasePen(gui.window->WScreen->ViewPort.ColorMap, MyColorTable[i].pen);
+ MyColorTable[i].alloced = FALSE;
+ }
+ }
+
+ D("Closeing window ");
+ CloseWindow(gui.window);
+ CloseLibrary((struct Library*)execBase);
+ CloseLibrary((struct Library*)gfxBase);
+ gui.window = NULL;
+ gui.in_use = FALSE;
+ //getout(1);
+ }
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ if (gui.window)
+ {
+ *x = gui.window->LeftEdge;
+ *y = gui.window->TopEdge;
+ }
+ else
+ {
+ return FAIL;
+ }
+
+ return OK;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ if (gui.window)
+ {
+ ChangeWindowBox(gui.window, x, y, gui.window->Width, gui.window->Height);
+ }
+}
+
+ void
+gui_mch_set_shellsize(int width, int height,
+ int min_width, int min_height, int base_width, int base_height)
+{
+ D("gui_mch_set_shellsize");
+
+ ChangeWindowBox(gui.window, gui.window->LeftEdge,
+ gui.window->TopEdge, widthCharToPoint(width) + gui.window->BorderLeft + gui.window->BorderRight,
+ heightCharToPoint(height) + gui.window->BorderTop + gui.window->BorderBottom);
+ checkEventHandler();
+}
+
+ void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+// *screen_w = widthPointToChar(gui.window->GZZWidth);
+// *screen_h = heightPointToChar(gui.window->GZZHeight);
+ *screen_w = gui.window->GZZWidth;
+ *screen_h = gui.window->GZZHeight - characterHeight;
+
+
+kprintf("=== get_screen_dimensions: screen %d,%d character %d,%d console %d,%d\n",
+gui.window->GZZWidth,
+gui.window->GZZHeight,
+characterWidth,
+characterHeight,
+*screen_w,
+*screen_h);
+
+}
+
+ void
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
+{
+ D("gui_mch_set_text_area_pos");
+}
+
+ void
+gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
+{
+ /* done by default */
+ /* TODO: disable scrollbar when it's too small */
+}
+
+ void
+gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)
+{
+ ULONG total = max;
+ ULONG visible = size;
+ ULONG top = val;
+ ULONG hidden;
+ ULONG overlap = 0;
+ UWORD body, pot;
+
+kprintf("__set_scrollbar_thumb val %d size %d max %d\n", val, size, max);
+
+ if (total > visible)
+ hidden = total - visible;
+ else
+ hidden = 0;
+
+ if (top > hidden)
+ top = hidden;
+
+ body = (hidden > 0) ?
+ (UWORD)(((ULONG)(visible - overlap) * MAXBODY) / (total - overlap)) :
+ MAXBODY;
+
+ pot = (hidden > 0) ? (UWORD)(((ULONG) top * MAXPOT) / hidden) : 0;
+
+kprintf("__pot %x body %x\n", pot, body);
+
+ NewModifyProp(&propGadget, gui.window, NULL,
+ Gadget2SInfo.Flags,
+ MAXPOT, pot,
+ MAXBODY, body,
+ 1);
+ return;
+
+}
+
+ void
+gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)
+{
+ D("gui_mch_set_scrollbar_pos");
+ /*NewModifyProp(&propGadget, gui.window, NULL, MAXPOT, MAXPOT/sb->max*y, MAXPOT, MAXBODY/sb->max/sb->size, 1);*/
+}
+
+ void
+gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
+{
+ /* this is done by default */
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
+{
+ /* this is done by default */
+}
+#endif
+
+int gui_mch_init_font(char_u *font_name, int fontset)
+{
+ /*D("gui_mch_init_font");*/
+
+ gui.char_width = characterWidth;
+ gui.char_height = characterHeight;
+ gui.char_ascent = gui.window->RPort->TxBaseline;
+
+ return OK;
+}
+
+ int
+gui_mch_adjust_charsize()
+{
+ return FAIL;
+}
+
+ GuiFont
+gui_mch_get_font( char_u *name, int giveErrorIfMissing)
+{
+ /*D("gui_mch_get_font");*/
+ return NULL;
+}
+
+ void
+gui_mch_set_font(GuiFont font)
+{
+ /*D("gui_mch_set_font");*/
+}
+
+#if 0 /* not used */
+ int
+gui_mch_same_font(GuiFont f1, GuiFont f2)
+{
+ D("gui_mch_same_font");
+}
+#endif
+
+ void
+gui_mch_free_font(GuiFont font)
+{
+ if (font)
+ D("gui_mch_free_font");
+}
+
+#define RGB(a, b, c) ((a && 0xff) * 0x10000 + (b * 0xff) * 0x100 + (c & 0xff))
+
+/*
+ * Get color handle for color "name".
+ * Return INVALCOLOR when not possible.
+ */
+
+ typedef struct guicolor_tTable
+ {
+ char *name;
+ unsigned long color;
+ UBYTE red;
+ UBYTE green;
+ UBYTE blue;
+ } guicolor_tTable;
+
+ static guicolor_tTable table[] =
+ {
+ {"Grey", 0, 190,190,190},
+ {"Black", 1, 0, 0, 0},
+ {"DarkBlue", 2, 0, 0, 139},
+ {"DarkGreen", 3, 0, 100, 0},
+ {"DarkCyan", 4, 0, 139, 139},
+ {"DarkRed", 5, 139, 0, 0},
+ {"DarkMagenta", 6, 139, 0, 139},
+ {"Brown", 7, 165, 42, 42},
+ {"Gray", 8, 190, 190, 190},
+ {"Grey", 9, 190, 190, 190},
+ {"LightGray", 10, 211, 211, 211},
+ {"LightGrey", 11, 211, 211, 211},
+ {"DarkGray", 12, 169, 169, 169},
+ {"DarkGrey", 13, 169, 169, 169},
+ {"Blue", 14, 0, 0, 255},
+ {"LightBlue", 15, 173, 216, 230},
+ {"Green", 16, 0, 255, 0},
+ {"LightGreen", 17, 144, 238, 144},
+ {"Cyan", 18, 0, 255, 255},
+ {"LightCyan", 19, 224, 255, 255},
+ {"Red", 20, 255, 0, 0},
+ {"LightRed", 21, 255, 0, 0}, /*?*/
+ {"Magenta", 22, 255, 0, 255},
+ {"LightMagenta",23, 255, 0, 255}, /*?*/
+ {"Yellow", 24, 255, 255, 0},
+ {"LightYellow", 25, 255, 255, 224}, /* TODO: add DarkYellow */
+ {"White", 26, 255, 255, 255},
+ {"SeaGreen", 27, 46, 139, 87},
+ {"Orange", 28, 255, 165, 0},
+ {"Purple", 30, 160, 32, 240},
+ {"SlateBlue", 31, 106, 90, 205},
+ {"grey90", 32, 229, 229, 229},
+ {"grey95", 33, 242, 242, 242},
+ {"grey80", 34, 204, 204, 204},
+ {NULL, NULL},
+ };
+
+ guicolor_T
+gui_mch_get_color(char_u *name)
+{
+
+ guicolor_T color = INVALCOLOR;
+
+ int i;
+
+ for (i = 0; table[i].name != NULL;i++)
+ {
+ if (stricmp(name, table[i].name) == 0)
+ {
+ //color = table[i].color;
+ color = i;
+ }
+ }
+
+#if 0
+ if (color == INVALCOLOR)
+ {
+ char *looky = NULL;
+
+ color = strtol((char*)name, &looky, 10);
+ if (*looky != NUL)
+ color = INVALCOLOR;
+ }
+#endif
+
+ kprintf("gui_mch_get_color[%s] = %s\n", name, table[color].name);
+
+ return color;
+}
+
+static UBYTE getrealcolor(guicolor_T i)
+{
+ if (!MyColorTable[i].alloced)
+ {
+ MyColorTable[i].pen = ObtainBestPen(gui.window->WScreen->ViewPort.ColorMap,
+ table[i].red * 0x01010101,
+ table[i].green * 0x01010101,
+ table[i].blue * 0x01010101,
+ OBP_FailIfBad, FALSE,
+ OBP_Precision, PRECISION_GUI,
+ TAG_DONE);
+ if (MyColorTable[i].pen != -1)
+ {
+ MyColorTable[i].alloced = TRUE;
+ }
+ }
+
+ return MyColorTable[i].pen;
+}
+
+
+ void
+gui_mch_set_colors(guicolor_T fg, guicolor_T bg)
+{
+#if 0
+ if (fg == 0)
+ {
+ fg = 1;
+ }
+#endif
+ SetABPenDrMd(gui.window->RPort, getrealcolor(fg), getrealcolor(bg), JAM2);
+
+kprintf("gui_mch_set_colors %s,%s\n", table[fg].name, table[bg].name);
+}
+
+ void
+gui_mch_set_fg_color(guicolor_T color)
+{
+#if 0
+ if (color == 0)
+ {
+ color = 1; /* vim sends 0 as default color which is ALWAYS the
+ background on the amiga scrolling with colours as the
+ background is a very bad idea on slow machines*/
+ }
+#endif
+ SetAPen(gui.window->RPort, getrealcolor(color));
+ SetDrMd(gui.window->RPort, JAM2);
+
+kprintf("gui_mch_set_fg_color %s\n", table[color].name);
+
+}
+
+ void
+gui_mch_set_bg_color(guicolor_T color)
+{
+ SetBPen(gui.window->RPort, getrealcolor(color));
+kprintf("gui_mch_set_bg_color %s\n", table[color].name);
+
+}
+
+ void
+gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+#if 1
+ char tempstring[300];
+
+ memcpy(tempstring, s, len);
+ tempstring[len] = '\0';
+
+ kprintf("gui_mch_draw_string(%s) flags %x\n", tempstring, flags);
+#endif
+
+ if (flags & DRAW_TRANSP)
+ {
+ SetDrMd(gui.window->RPort, JAM1);
+ Move(gui.window->RPort, posWidthCharToPoint(col), posHeightCharToPoint(row) + gui.window->RPort->TxBaseline);
+ Text(gui.window->RPort, s, len);
+ }
+ else
+ {
+ SetDrMd(gui.window->RPort, JAM2);
+ Move(gui.window->RPort, posWidthCharToPoint(col), posHeightCharToPoint(row) + gui.window->RPort->TxBaseline);
+ Text(gui.window->RPort, s, len);
+ }
+
+ if (flags & DRAW_BOLD)
+ {
+ SetDrMd(gui.window->RPort, JAM1);
+ Move(gui.window->RPort, posWidthCharToPoint(col)+1, posHeightCharToPoint(row) + gui.window->RPort->TxBaseline);
+ Text(gui.window->RPort, s, len);
+ }
+
+ if (flags & DRAW_UNDERL)
+ {
+ Move(gui.window->RPort, posWidthCharToPoint(col), posHeightCharToPoint(row + 1) - 1);
+ Draw(gui.window->RPort, posWidthCharToPoint(col+len) - 1, posHeightCharToPoint(row + 1) - 1);
+ }
+
+ SetDrMd(gui.window->RPort, JAM2);
+}
+
+ int
+gui_mch_haskey(char_u *name)
+{
+ int i;
+
+ D("gui_mch_haskey");
+
+ for (i = 0; special_keys[i].vim_code1 != NUL; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return OK;
+ return FAIL;
+}
+
+ void
+gui_mch_beep(void)
+{
+ D("gui_mch_beep");
+}
+
+ void
+gui_mch_flash(int msec)
+{
+ D("gui_mch_flash");
+
+ SetDrMd(gui.window->RPort, COMPLEMENT);
+ RectFill(gui.window->RPort, 0, 0, gui.window->GZZWidth - 1, gui.window->GZZHeight - 1);
+ Delay(msec * 50 / 1000);
+ RectFill(gui.window->RPort, 0, 0, gui.window->GZZWidth - 1, gui.window->GZZHeight - 1);
+ SetDrMd(gui.window->RPort, JAM2);
+}
+
+ void
+gui_mch_invert_rectangle( int r, int c, int nr, int nc)
+{
+ printf("gui_mch_invert_rectangle %d %d %d %d\n", r, c, nr, nc);
+}
+
+ void
+gui_mch_iconify(void)
+{
+ D("gui_mch_iconify");
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ WindowToFront(gui.window);
+ D("gui_mch_set_foreground");
+}
+#endif
+
+ void
+gui_mch_settitle(char_u *title, char_u *icon)
+{
+ SetWindowTitles(gui.window, title, (STRPTR)~0);
+ D("gui_mch_settitle");
+}
+
+ void
+gui_mch_stop_blink(void)
+{
+ gui_undraw_cursor();
+ D("gui_mch_stop_blink");
+}
+
+ void
+gui_mch_start_blink(void)
+{
+ gui_update_cursor(FALSE, FALSE);
+ D("gui_mch_start_blink");
+}
+
+ void
+gui_mch_draw_hollow_cursor(guicolor_T color)
+{
+ drawBox(DB_NotFilled, gui.col, gui.row, characterWidth, characterHeight, color);
+}
+
+ void
+gui_mch_draw_part_cursor( int w, int h, guicolor_T color)
+{
+ D("gui_mch_part_cursor");
+ drawBox(DB_Filled, gui.col, gui.row, w, h, color);
+}
+
+ void
+gui_mch_update(void)
+{
+ checkEventHandler();
+ return ;
+}
+
+ int
+gui_mch_wait_for_chars(int wtime)
+{
+ ULONG timermask = 1L << TimerMP->mp_SigBit;
+ ULONG winmask = 1L << gui.window->UserPort->mp_SigBit;
+ int retval = FAIL;
+
+ kprintf("========== gui_mch_wait_for_chars %d\n", wtime);
+
+ if (wtime == -1) wtime = 1000000000;
+ if (wtime < 20) wtime = 20;
+
+ SetSignal(0, timermask);
+ TimerIO->tr_node.io_Command = TR_ADDREQUEST;
+ TimerIO->tr_time.tv_secs = wtime / 1000;
+ TimerIO->tr_time.tv_micro = (wtime % 1000) * 1000;
+ SendIO(&TimerIO->tr_node);
+ TimerSent = TRUE;
+
+ for(;;)
+ {
+ ULONG sigs = Wait(winmask | timermask);
+
+ if (sigs & winmask)
+ {
+ checkEventHandler();
+ if (!vim_is_input_buf_empty())
+ {
+ retval = OK;
+ if (!CheckIO(&TimerIO->tr_node)) AbortIO(&TimerIO->tr_node);
+ WaitIO(&TimerIO->tr_node);
+ TimerSent = FALSE;
+ break;
+ }
+ }
+
+ if (sigs & timermask)
+ {
+ struct Message *msg;
+
+ if ((msg = GetMsg(TimerMP)))
+ {
+ ReplyMsg(msg);
+ TimerSent = FALSE;
+ retval = FAIL;
+ break;
+ }
+ }
+ }
+
+ return retval;
+
+// assert(wtime != 0);
+// return charEventHandler(wtime);
+}
+
+ void
+gui_mch_flush(void)
+{
+}
+
+ void
+gui_mch_clear_block(int row1, int col1, int row2, int col2)
+{
+ UBYTE apen = GetAPen(gui.window->RPort);
+
+ SetAPen(gui.window->RPort, getrealcolor(gui.back_pixel));
+ RectFill(gui.window->RPort,
+ posWidthCharToPoint(col1),
+ posHeightCharToPoint(row1),
+ posWidthCharToPoint(col2 + 1) - 1,
+ posHeightCharToPoint(row2 + 1) - 1);
+ SetAPen(gui.window->RPort, apen);
+
+}
+
+ void
+gui_mch_clear_all(void)
+{
+ SetRast(gui.window->RPort, GetBPen(gui.window->RPort));
+ refreshBorder();
+ D("gui_mch_clear_all");
+}
+
+ void
+gui_mch_delete_lines(int row, int num_lines)
+{
+ ScrollWindowRaster(gui.window,
+ 0,
+ characterHeight * num_lines,
+ posWidthCharToPoint(gui.scroll_region_left),
+ posHeightCharToPoint(row),
+ posWidthCharToPoint(gui.scroll_region_right + 1) - 1,
+ posHeightCharToPoint(gui.scroll_region_bot + 1) - 1);
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot,
+ gui.scroll_region_right);
+
+}
+
+ void
+gui_mch_insert_lines(int row, int num_lines)
+{
+ ScrollWindowRaster(gui.window,
+ 0,
+ -characterHeight*num_lines,
+ posWidthCharToPoint(gui.scroll_region_left),
+ posHeightCharToPoint(row),
+ posWidthCharToPoint(gui.scroll_region_right + 1) - 1,
+ posHeightCharToPoint(gui.scroll_region_bot +1 ) - 1);
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+
+}
+
+ void
+gui_mch_enable_menu(int flag)
+{
+ D("gui_mch_enable_menu");
+}
+
+ void
+gui_mch_set_menu_pos(int x, int y, int w, int h)
+{
+ D("gui_mch_set_menu_pos");
+}
+
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+ D("gui_mch_destroy_menu");
+ ClearMenuStrip(gui.window);
+}
+
+ void
+gui_mch_menu_grey(vimmenu_T *menu, int grey)
+{
+ D("gui_mch_menu_grey");
+}
+
+ void
+gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
+{
+ D("gui_mch_menu_hidden");
+ ClearMenuStrip(gui.window);
+}
+
+ void
+gui_mch_draw_menubar(void)
+{
+ D("gui_mch_draw_menubar");
+ SetMenuStrip(gui.window, gui.menu);
+}
+
+ static void
+AmigaError(const char *string)
+{
+ static struct IntuiText pos = { 3, 0, JAM2, 17, 5, NULL, "Cancel", NULL} ;
+ static struct IntuiText neg = { 3, 0, JAM2, 17, 5, NULL, "Cancel", NULL} ;
+ static struct IntuiText message = { 3, 0, JAM2, 17, 5, NULL, NULL, NULL} ;
+ static char *strptr = 0;
+
+ if (strptr)
+ free(strptr);
+ strptr = malloc(strlen(string)+1);
+
+ message.IText = strptr;
+ strcpy(strptr, string);
+
+ AutoRequest(NULL, &message, &pos, &neg, 0, 0, 300, 300);
+}
+
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ D("clib_mch_own_selection");
+ return OK;
+}
+
+ void
+mch_setmouse(int on)
+{
+}
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x()
+{
+ return gui.window->GZZMouseX;
+}
+
+ int
+gui_mch_get_mouse_y()
+{
+ return gui.window->GZZMouseY;
+}
+
+ void
+gui_mch_setmouse(x, y)
+ int x;
+ int y;
+{
+ /* TODO */
+}
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+ /* TODO */
+}
+
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+ D("clip_mch_lose_selecction");
+}
+
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ D("clip_mch_requst_selection");
+}
+
+ void
+clip_mch_set_selection(VimClipboard *cbd)
+{
+}
+
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ ULONG coltable[3], color;
+
+ GetRGB32(gui.window->WScreen->ViewPort.ColorMap,
+ getrealcolor(pixel),
+ 1,
+ coltable);
+
+ color = ((coltable[0] & 0xFF000000) >> 8) |
+ ((coltable[1] & 0xFF000000) >> 16) |
+ ((coltable[2] & 0xFF000000) >> 24);
+
+ return color;
+}
+
+#endif /* USE_AMIGA_GUI*/
diff --git a/src/gui_amiga.h b/src/gui_amiga.h
new file mode 100644
index 000000000..f70122d75
--- /dev/null
+++ b/src/gui_amiga.h
@@ -0,0 +1,52 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Amiga GUI support by Michael Nielsen
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ *
+ * Amiga GUI header file.
+ */
+
+#if !defined(__GUI_AMIGA__H)
+#define __GUI_AMIGA__H
+
+#define SetAttrib(_ptr,_attrib,_value) ((_ptr)->_attrib=(_value))
+
+#if defined(FEAT_GUI_AMIGA)
+
+#include <intuition/intuition.h>
+
+enum event {
+ ev_NullEvent,
+ ev_MenuVerify,
+ ev_MenuPick,
+ ev_CloseWindow,
+ ev_NewSize,
+ ev_RefreshWindow,
+ ev_MouseButtons,
+ ev_MouseMove,
+ ev_GadgetDown,
+ ev_GadgetUp,
+ ev_KeyStroke,
+ ev_IntuiTicks,
+ ev_MenuHelp,
+ ev_GadgetHelp,
+
+ ev_Ignore
+};
+
+struct MyMenuItem {
+ struct MenuItem menuItem;
+ vimmenu_T *guiMenu;
+};
+
+union myMenuItemUnion {
+ struct MenuItem menuItem;
+ struct MyMenuItem myMenuItem;
+};
+
+#endif /* FEAT_GUI_AMIGA*/
+#endif /* __GUI_AMIGA__H */
+
diff --git a/src/gui_at_fs.c b/src/gui_at_fs.c
new file mode 100644
index 000000000..474967ecb
--- /dev/null
+++ b/src/gui_at_fs.c
@@ -0,0 +1,2880 @@
+/* vi:set ts=8 sts=4 sw=4: */
+
+/*
+ * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Software Research Associates not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Software Research Associates
+ * makes no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+ * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Erik M. van der Poel
+ * Software Research Associates, Inc., Tokyo, Japan
+ * erik@sra.co.jp
+ */
+/*
+ * Author's addresses:
+ * erik@sra.co.jp
+ * erik%sra.co.jp@uunet.uu.net
+ * erik%sra.co.jp@mcvax.uucp
+ * try junet instead of co.jp
+ * Erik M. van der Poel
+ * Software Research Associates, Inc.
+ * 1-1-1 Hirakawa-cho, Chiyoda-ku
+ * Tokyo 102 Japan. TEL +81-3-234-2692
+ */
+
+/*
+ * Heavely modified for Vim by Bram Moolenaar
+ */
+
+#include "vim.h"
+
+/* Only include this when using the file browser */
+
+#ifdef FEAT_BROWSE
+
+/* Weird complication: for "make lint" Text.h doesn't combine with Xm.h */
+#if defined(FEAT_GUI_MOTIF) && defined(FMT8BIT)
+# undef FMT8BIT
+#endif
+
+#ifndef FEAT_GUI_NEXTAW
+# include "gui_at_sb.h"
+#endif
+
+/***************** SFinternal.h */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xos.h>
+#ifdef FEAT_GUI_NEXTAW
+# include <X11/neXtaw/Text.h>
+# include <X11/neXtaw/AsciiText.h>
+# include <X11/neXtaw/Scrollbar.h>
+#else
+# include <X11/Xaw/Text.h>
+# include <X11/Xaw/AsciiText.h>
+#endif
+
+#define SEL_FILE_CANCEL -1
+#define SEL_FILE_OK 0
+#define SEL_FILE_NULL 1
+#define SEL_FILE_TEXT 2
+
+#define SF_DO_SCROLL 1
+#define SF_DO_NOT_SCROLL 0
+
+typedef struct
+{
+ int statDone;
+ char *real;
+ char *shown;
+} SFEntry;
+
+typedef struct
+{
+ char *dir;
+ char *path;
+ SFEntry *entries;
+ int nEntries;
+ int vOrigin;
+ int nChars;
+ int hOrigin;
+ int changed;
+ int beginSelection;
+ int endSelection;
+ time_t mtime;
+} SFDir;
+
+static char SFstartDir[MAXPATHL],
+ SFcurrentPath[MAXPATHL],
+ SFcurrentDir[MAXPATHL];
+
+static Widget selFile,
+ selFileField,
+ selFileForm,
+ selFileHScroll,
+ selFileHScrolls[3],
+ selFileLists[3],
+ selFileOK,
+ selFileCancel,
+ selFilePrompt,
+ selFileVScrolls[3];
+
+static Display *SFdisplay;
+
+static int SFcharWidth, SFcharAscent, SFcharHeight;
+
+static SFDir *SFdirs = NULL;
+
+static int SFdirEnd;
+static int SFdirPtr;
+
+static Pixel SFfore, SFback;
+
+static Atom SFwmDeleteWindow;
+
+static XSegment SFsegs[2], SFcompletionSegs[2];
+
+static XawTextPosition SFtextPos;
+
+static int SFupperX, SFlowerY, SFupperY;
+
+static int SFtextX, SFtextYoffset;
+
+static int SFentryWidth, SFentryHeight;
+
+static int SFlineToTextH = 3;
+static int SFlineToTextV = 3;
+
+static int SFbesideText = 3;
+static int SFaboveAndBelowText = 2;
+
+static int SFcharsPerEntry = 15;
+
+static int SFlistSize = 10;
+
+static int SFcurrentInvert[3] = { -1, -1, -1 };
+
+static int SFworkProcAdded = 0;
+
+static XtAppContext SFapp;
+
+static int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
+
+#ifdef FEAT_XFONTSET
+static char SFtextBuffer[MAXPATHL*sizeof(wchar_t)];
+#else
+static char SFtextBuffer[MAXPATHL];
+#endif
+
+static int SFbuttonPressed = 0;
+
+static XtIntervalId SFdirModTimerId;
+
+static int (*SFfunc)();
+
+static int SFstatus = SEL_FILE_NULL;
+
+/***************** static functions */
+
+static void SFsetText __ARGS((char *path));
+static void SFtextChanged __ARGS((void));
+static char *SFgetText __ARGS((void));
+static void SFupdatePath __ARGS((void));
+static int SFgetDir __ARGS((SFDir *dir));
+static void SFdrawLists __ARGS((int doScroll));
+static void SFdrawList __ARGS((int n, int doScroll));
+static void SFclearList __ARGS((int n, int doScroll));
+static void SFbuttonPressList __ARGS((Widget w, int n, XButtonPressedEvent *event));
+static void SFbuttonReleaseList __ARGS((Widget w, int n, XButtonReleasedEvent *event));
+static void SFdirModTimer __ARGS((XtPointer cl, XtIntervalId *id));
+static char SFstatChar __ARGS((struct stat *statBuf));
+static void SFdrawStrings __ARGS((Window w, SFDir *dir, int from, int to));
+static int SFnewInvertEntry __ARGS((int n, XMotionEvent *event));
+static void SFinvertEntry __ARGS((int n));
+static void SFenterList __ARGS((Widget w, int n, XEnterWindowEvent *event));
+static void SFleaveList __ARGS((Widget w, int n, XEvent *event));
+static void SFmotionList __ARGS((Widget w, int n, XMotionEvent *event));
+static void SFvFloatSliderMovedCallback __ARGS((Widget w, XtPointer n, XtPointer fnew));
+static void SFvSliderMovedCallback __ARGS((Widget w, int n, int nw));
+static void SFvAreaSelectedCallback __ARGS((Widget w, XtPointer n, XtPointer pnew));
+static void SFhSliderMovedCallback __ARGS((Widget w, XtPointer n, XtPointer nw));
+static void SFhAreaSelectedCallback __ARGS((Widget w, XtPointer n, XtPointer pnew));
+static void SFpathSliderMovedCallback __ARGS((Widget w, XtPointer client_data, XtPointer nw));
+static void SFpathAreaSelectedCallback __ARGS((Widget w, XtPointer client_data, XtPointer pnew));
+static Boolean SFworkProc __ARGS((void));
+static int SFcompareEntries __ARGS((const void *p, const void *q));
+static void SFprepareToReturn __ARGS((void));
+static void SFcreateWidgets __ARGS((Widget toplevel, char *prompt, char *ok, char *cancel));
+static void SFsetColors __ARGS((guicolor_T bg, guicolor_T fg, guicolor_T scroll_bg, guicolor_T scrollfg));
+
+/***************** xstat.h */
+
+#ifndef S_IXUSR
+# define S_IXUSR 0100
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0010
+#endif
+#ifndef S_IXOTH
+# define S_IXOTH 0001
+#endif
+
+#define S_ISXXX(m) ((m) & (S_IXUSR | S_IXGRP | S_IXOTH))
+
+/***************** Path.c */
+
+#include <pwd.h>
+
+typedef struct
+{
+ char *name;
+ char *dir;
+} SFLogin;
+
+static int SFdoNotTouchDirPtr = 0;
+
+static int SFdoNotTouchVorigin = 0;
+
+static SFDir SFrootDir, SFhomeDir;
+
+static SFLogin *SFlogins;
+
+static int SFtwiddle = 0;
+
+static int SFchdir __ARGS((char *path));
+
+ static int
+SFchdir(path)
+ char *path;
+{
+ int result;
+
+ result = 0;
+
+ if (strcmp(path, SFcurrentDir))
+ {
+ result = mch_chdir(path);
+ if (!result)
+ (void) strcpy(SFcurrentDir, path);
+ }
+
+ return result;
+}
+
+static void SFfree __ARGS((int i));
+
+ static void
+SFfree(i)
+ int i;
+{
+ SFDir *dir;
+ int j;
+
+ dir = &(SFdirs[i]);
+
+ for (j = dir->nEntries - 1; j >= 0; j--)
+ {
+ if (dir->entries[j].shown != dir->entries[j].real)
+ XtFree(dir->entries[j].shown);
+ XtFree(dir->entries[j].real);
+ }
+
+ XtFree((char *)dir->entries);
+ XtFree(dir->dir);
+
+ dir->dir = NULL;
+}
+
+static void SFstrdup __ARGS((char **s1, char *s2));
+
+ static void
+SFstrdup(s1, s2)
+ char **s1;
+ char *s2;
+{
+ *s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2);
+}
+
+static void SFunreadableDir __ARGS((SFDir *dir));
+
+ static void
+SFunreadableDir(dir)
+ SFDir *dir;
+{
+ char *cannotOpen = _("<cannot open> ");
+
+ dir->entries = (SFEntry *) XtMalloc(sizeof(SFEntry));
+ dir->entries[0].statDone = 1;
+ SFstrdup(&dir->entries[0].real, cannotOpen);
+ dir->entries[0].shown = dir->entries[0].real;
+ dir->nEntries = 1;
+ dir->nChars = strlen(cannotOpen);
+}
+
+static void SFreplaceText __ARGS((SFDir *dir, char *str));
+
+ static void
+SFreplaceText(dir, str)
+ SFDir *dir;
+ char *str;
+{
+ int len;
+
+ *(dir->path) = 0;
+ len = strlen(str);
+ if (str[len - 1] == '/')
+ (void) strcat(SFcurrentPath, str);
+ else
+ (void) strncat(SFcurrentPath, str, len - 1);
+ if (strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir)))
+ SFsetText(SFcurrentPath);
+ else
+ SFsetText(&(SFcurrentPath[strlen(SFstartDir)]));
+
+ SFtextChanged();
+}
+
+static void SFexpand __ARGS((char *str));
+
+ static void
+SFexpand(str)
+ char *str;
+{
+ int len;
+ int cmp;
+ char *name, *growing;
+ SFDir *dir;
+ SFEntry *entry, *max;
+
+ len = strlen(str);
+
+ dir = &(SFdirs[SFdirEnd - 1]);
+
+ if (dir->beginSelection == -1)
+ {
+ SFstrdup(&str, str);
+ SFreplaceText(dir, str);
+ XtFree(str);
+ return;
+ }
+ else if (dir->beginSelection == dir->endSelection)
+ {
+ SFreplaceText(dir, dir->entries[dir->beginSelection].shown);
+ return;
+ }
+
+ max = &(dir->entries[dir->endSelection + 1]);
+
+ name = dir->entries[dir->beginSelection].shown;
+ SFstrdup(&growing, name);
+
+ cmp = 0;
+ while (!cmp)
+ {
+ entry = &(dir->entries[dir->beginSelection]);
+ while (entry < max)
+ {
+ if ((cmp = strncmp(growing, entry->shown, len)))
+ break;
+ entry++;
+ }
+ len++;
+ }
+
+ /*
+ * SFreplaceText() expects filename
+ */
+ growing[len - 2] = ' ';
+
+ growing[len - 1] = 0;
+ SFreplaceText(dir, growing);
+ XtFree(growing);
+}
+
+static int SFfindFile __ARGS((SFDir *dir, char *str));
+
+ static int
+SFfindFile(dir, str)
+ SFDir *dir;
+ char *str;
+{
+ int i, last, max;
+ char *name, save;
+ SFEntry *entries;
+ int len;
+ int begin, end;
+ int result;
+
+ len = strlen(str);
+
+ if (str[len - 1] == ' ')
+ {
+ SFexpand(str);
+ return 1;
+ }
+ else if (str[len - 1] == '/')
+ len--;
+
+ max = dir->nEntries;
+
+ entries = dir->entries;
+
+ i = 0;
+ while (i < max)
+ {
+ name = entries[i].shown;
+ last = strlen(name) - 1;
+ save = name[last];
+ name[last] = 0;
+
+ result = strncmp(str, name, len);
+
+ name[last] = save;
+ if (result <= 0)
+ break;
+ i++;
+ }
+ begin = i;
+ while (i < max)
+ {
+ name = entries[i].shown;
+ last = strlen(name) - 1;
+ save = name[last];
+ name[last] = 0;
+
+ result = strncmp(str, name, len);
+
+ name[last] = save;
+ if (result)
+ break;
+ i++;
+ }
+ end = i;
+
+ if (begin != end)
+ {
+ if ((dir->beginSelection != begin) || (dir->endSelection != end - 1))
+ {
+ dir->changed = 1;
+ dir->beginSelection = begin;
+ if (str[strlen(str) - 1] == '/')
+ dir->endSelection = begin;
+ else
+ dir->endSelection = end - 1;
+ }
+ }
+ else if (dir->beginSelection != -1)
+ {
+ dir->changed = 1;
+ dir->beginSelection = -1;
+ dir->endSelection = -1;
+ }
+
+ if (SFdoNotTouchVorigin
+ || ((begin > dir->vOrigin) && (end < dir->vOrigin + SFlistSize)))
+ {
+ SFdoNotTouchVorigin = 0;
+ return 0;
+ }
+
+ i = begin - 1;
+ if (i > max - SFlistSize)
+ i = max - SFlistSize;
+ if (i < 0)
+ i = 0;
+
+ if (dir->vOrigin != i)
+ {
+ dir->vOrigin = i;
+ dir->changed = 1;
+ }
+
+ return 0;
+}
+
+static void SFunselect __ARGS((void));
+
+ static void
+SFunselect()
+{
+ SFDir *dir;
+
+ dir = &(SFdirs[SFdirEnd - 1]);
+ if (dir->beginSelection != -1)
+ dir->changed = 1;
+ dir->beginSelection = -1;
+ dir->endSelection = -1;
+}
+
+static int SFcompareLogins __ARGS((const void *p, const void *q));
+
+ static int
+SFcompareLogins(p, q)
+ const void *p, *q;
+{
+ return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name);
+}
+
+static void SFgetHomeDirs __ARGS((void));
+
+ static void
+SFgetHomeDirs()
+{
+ struct passwd *pw;
+ int Alloc;
+ int i;
+ SFEntry *entries = NULL;
+ int len;
+ int maxChars;
+
+ Alloc = 1;
+ i = 1;
+ entries = (SFEntry *)XtMalloc(sizeof(SFEntry));
+ SFlogins = (SFLogin *)XtMalloc(sizeof(SFLogin));
+ entries[0].real = XtMalloc(3);
+ (void) strcpy(entries[0].real, "~");
+ entries[0].shown = entries[0].real;
+ entries[0].statDone = 1;
+ SFlogins[0].name = "";
+ pw = getpwuid((int) getuid());
+ SFstrdup(&SFlogins[0].dir, pw ? pw->pw_dir : "/");
+ maxChars = 0;
+
+ (void) setpwent();
+
+ while ((pw = getpwent()) && (*(pw->pw_name)))
+ {
+ if (i >= Alloc)
+ {
+ Alloc *= 2;
+ entries = (SFEntry *) XtRealloc((char *)entries,
+ (unsigned)(Alloc * sizeof(SFEntry)));
+ SFlogins = (SFLogin *) XtRealloc((char *)SFlogins,
+ (unsigned)(Alloc * sizeof(SFLogin)));
+ }
+ len = strlen(pw->pw_name);
+ entries[i].real = XtMalloc((unsigned) (len + 3));
+ (void) strcat(strcpy(entries[i].real, "~"), pw->pw_name);
+ entries[i].shown = entries[i].real;
+ entries[i].statDone = 1;
+ if (len > maxChars)
+ maxChars = len;
+ SFstrdup(&SFlogins[i].name, pw->pw_name);
+ SFstrdup(&SFlogins[i].dir, pw->pw_dir);
+ i++;
+ }
+
+ SFhomeDir.dir = XtMalloc(1);
+ SFhomeDir.dir[0] = 0;
+ SFhomeDir.path = SFcurrentPath;
+ SFhomeDir.entries = entries;
+ SFhomeDir.nEntries = i;
+ SFhomeDir.vOrigin = 0; /* :-) */
+ SFhomeDir.nChars = maxChars + 2;
+ SFhomeDir.hOrigin = 0;
+ SFhomeDir.changed = 1;
+ SFhomeDir.beginSelection = -1;
+ SFhomeDir.endSelection = -1;
+
+ qsort((char *)entries, (size_t)i, sizeof(SFEntry), SFcompareEntries);
+ qsort((char *)SFlogins, (size_t)i, sizeof(SFLogin), SFcompareLogins);
+
+ for (i--; i >= 0; i--)
+ (void)strcat(entries[i].real, "/");
+}
+
+static int SFfindHomeDir __ARGS((char *begin, char *end));
+
+ static int
+SFfindHomeDir(begin, end)
+ char *begin, *end;
+{
+ char save;
+ char *theRest;
+ int i;
+
+ save = *end;
+ *end = 0;
+
+ for (i = SFhomeDir.nEntries - 1; i >= 0; i--)
+ {
+ if (!strcmp(SFhomeDir.entries[i].real, begin))
+ {
+ *end = save;
+ SFstrdup(&theRest, end);
+ (void) strcat(strcat(strcpy(SFcurrentPath,
+ SFlogins[i].dir), "/"), theRest);
+ XtFree(theRest);
+ SFsetText(SFcurrentPath);
+ SFtextChanged();
+ return 1;
+ }
+ }
+
+ *end = save;
+
+ return 0;
+}
+
+ static void
+SFupdatePath()
+{
+ static int Alloc;
+ static int wasTwiddle = 0;
+ char *begin, *end;
+ int i, j;
+ int prevChange;
+ int SFdirPtrSave, SFdirEndSave;
+ SFDir *dir;
+
+ if (!SFdirs)
+ {
+ SFdirs = (SFDir *) XtMalloc((Alloc = 10) * sizeof(SFDir));
+ dir = &(SFdirs[0]);
+ SFstrdup(&dir->dir, "/");
+ (void) SFchdir("/");
+ (void) SFgetDir(dir);
+ for (j = 1; j < Alloc; j++)
+ SFdirs[j].dir = NULL;
+ dir->path = SFcurrentPath + 1;
+ dir->vOrigin = 0;
+ dir->hOrigin = 0;
+ dir->changed = 1;
+ dir->beginSelection = -1;
+ dir->endSelection = -1;
+ SFhomeDir.dir = NULL;
+ }
+
+ SFdirEndSave = SFdirEnd;
+ SFdirEnd = 1;
+
+ SFdirPtrSave = SFdirPtr;
+ SFdirPtr = 0;
+
+ begin = NULL;
+
+ if (SFcurrentPath[0] == '~')
+ {
+ if (!SFtwiddle)
+ {
+ SFtwiddle = 1;
+ dir = &(SFdirs[0]);
+ SFrootDir = *dir;
+ if (!SFhomeDir.dir)
+ SFgetHomeDirs();
+ *dir = SFhomeDir;
+ dir->changed = 1;
+ }
+ end = SFcurrentPath;
+ SFdoNotTouchDirPtr = 1;
+ wasTwiddle = 1;
+ }
+ else
+ {
+ if (SFtwiddle)
+ {
+ SFtwiddle = 0;
+ dir = &(SFdirs[0]);
+ *dir = SFrootDir;
+ dir->changed = 1;
+ }
+ end = SFcurrentPath + 1;
+ }
+
+ i = 0;
+
+ prevChange = 0;
+
+ while (*end)
+ {
+ while (*end++ == '/')
+ ;
+ end--;
+ begin = end;
+ while ((*end) && (*end++ != '/'))
+ ;
+ if ((end - SFcurrentPath <= SFtextPos) && (*(end - 1) == '/'))
+ {
+ SFdirPtr = i - 1;
+ if (SFdirPtr < 0)
+ SFdirPtr = 0;
+ }
+ if (*begin)
+ {
+ if (*(end - 1) == '/')
+ {
+ char save = *end;
+
+ if (SFtwiddle)
+ {
+ if (SFfindHomeDir(begin, end))
+ return;
+ }
+ *end = 0;
+ i++;
+ SFdirEnd++;
+ if (i >= Alloc)
+ {
+ SFdirs = (SFDir *) XtRealloc((char *) SFdirs,
+ (unsigned)((Alloc *= 2) * sizeof(SFDir)));
+ for (j = Alloc / 2; j < Alloc; j++)
+ SFdirs[j].dir = NULL;
+ }
+ dir = &(SFdirs[i]);
+ if ((!(dir->dir)) || prevChange || strcmp(dir->dir, begin))
+ {
+ if (dir->dir)
+ SFfree(i);
+ prevChange = 1;
+ SFstrdup(&dir->dir, begin);
+ dir->path = end;
+ dir->vOrigin = 0;
+ dir->hOrigin = 0;
+ dir->changed = 1;
+ dir->beginSelection = -1;
+ dir->endSelection = -1;
+ (void)SFfindFile(dir - 1, begin);
+ if (SFchdir(SFcurrentPath) || SFgetDir(dir))
+ {
+ SFunreadableDir(dir);
+ break;
+ }
+ }
+ *end = save;
+ if (!save)
+ SFunselect();
+ }
+ else
+ {
+ if (SFfindFile(&(SFdirs[SFdirEnd-1]), begin))
+ return;
+ }
+ }
+ else
+ SFunselect();
+ }
+
+ if ((end == SFcurrentPath + 1) && (!SFtwiddle))
+ SFunselect();
+
+ for (i = SFdirEnd; i < Alloc; i++)
+ if (SFdirs[i].dir)
+ SFfree(i);
+
+ if (SFdoNotTouchDirPtr)
+ {
+ if (wasTwiddle)
+ {
+ wasTwiddle = 0;
+ SFdirPtr = SFdirEnd - 2;
+ if (SFdirPtr < 0)
+ SFdirPtr = 0;
+ }
+ else
+ SFdirPtr = SFdirPtrSave;
+ SFdoNotTouchDirPtr = 0;
+ }
+
+ if ((SFdirPtr != SFdirPtrSave) || (SFdirEnd != SFdirEndSave))
+ {
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb( selFileHScroll,
+ (float) (((double) SFdirPtr) / SFdirEnd),
+ (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) /
+ SFdirEnd));
+#else
+ vim_XawScrollbarSetThumb( selFileHScroll,
+ (float) (((double) SFdirPtr) / SFdirEnd),
+ (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) /
+ SFdirEnd),
+ (double)SFdirEnd);
+#endif
+ }
+
+ if (SFdirPtr != SFdirPtrSave)
+ SFdrawLists(SF_DO_SCROLL);
+ else
+ for (i = 0; i < 3; i++)
+ {
+ if (SFdirPtr + i < SFdirEnd)
+ {
+ if (SFdirs[SFdirPtr + i].changed)
+ {
+ SFdirs[SFdirPtr + i].changed = 0;
+ SFdrawList(i, SF_DO_SCROLL);
+ }
+ }
+ else
+ SFclearList(i, SF_DO_SCROLL);
+ }
+}
+
+#ifdef XtNinternational
+ static int
+WcsLen(p)
+ wchar_t *p;
+{
+ int i = 0;
+ while (*p++ != 0)
+ i++;
+ return i;
+}
+#endif
+
+ static void
+SFsetText(path)
+ char *path;
+{
+ XawTextBlock text;
+
+ text.firstPos = 0;
+ text.length = strlen(path);
+ text.ptr = path;
+ text.format = FMT8BIT;
+
+#ifdef XtNinternational
+ if (_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
+ {
+ XawTextReplace(selFileField, (XawTextPosition)0,
+ (XawTextPosition)WcsLen((wchar_t *)&SFtextBuffer[0]), &text);
+ XawTextSetInsertionPoint(selFileField,
+ (XawTextPosition)WcsLen((wchar_t *)&SFtextBuffer[0]));
+ }
+ else
+ {
+ XawTextReplace(selFileField, (XawTextPosition)0,
+ (XawTextPosition)strlen(SFtextBuffer), &text);
+ XawTextSetInsertionPoint(selFileField,
+ (XawTextPosition)strlen(SFtextBuffer));
+ }
+#else
+ XawTextReplace(selFileField, (XawTextPosition)0,
+ (XawTextPosition)strlen(SFtextBuffer), &text);
+ XawTextSetInsertionPoint(selFileField,
+ (XawTextPosition)strlen(SFtextBuffer));
+#endif
+}
+
+/* ARGSUSED */
+ static void
+SFbuttonPressList(w, n, event)
+ Widget w;
+ int n;
+ XButtonPressedEvent *event;
+{
+ SFbuttonPressed = 1;
+}
+
+/* ARGSUSED */
+ static void
+SFbuttonReleaseList(w, n, event)
+ Widget w;
+ int n;
+ XButtonReleasedEvent *event;
+{
+ SFDir *dir;
+
+ SFbuttonPressed = 0;
+
+ if (SFcurrentInvert[n] != -1)
+ {
+ if (n < 2)
+ SFdoNotTouchDirPtr = 1;
+ SFdoNotTouchVorigin = 1;
+ dir = &(SFdirs[SFdirPtr + n]);
+ SFreplaceText(dir,
+ dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown);
+ SFmotionList(w, n, (XMotionEvent *) event);
+ }
+}
+
+static int SFcheckDir __ARGS((int n, SFDir *dir));
+
+ static int
+SFcheckDir(n, dir)
+ int n;
+ SFDir *dir;
+{
+ struct stat statBuf;
+ int i;
+
+ if ((!mch_stat(".", &statBuf)) && (statBuf.st_mtime != dir->mtime))
+ {
+ /*
+ * If the pointer is currently in the window that we are about
+ * to update, we must warp it to prevent the user from
+ * accidentally selecting the wrong file.
+ */
+ if (SFcurrentInvert[n] != -1)
+ {
+ XWarpPointer(
+ SFdisplay,
+ None,
+ XtWindow(selFileLists[n]),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0);
+ }
+
+ for (i = dir->nEntries - 1; i >= 0; i--)
+ {
+ if (dir->entries[i].shown != dir->entries[i].real)
+ XtFree(dir->entries[i].shown);
+ XtFree(dir->entries[i].real);
+ }
+ XtFree((char *) dir->entries);
+ if (SFgetDir(dir))
+ SFunreadableDir(dir);
+ if (dir->vOrigin > dir->nEntries - SFlistSize)
+ dir->vOrigin = dir->nEntries - SFlistSize;
+ if (dir->vOrigin < 0)
+ dir->vOrigin = 0;
+ if (dir->hOrigin > dir->nChars - SFcharsPerEntry)
+ dir->hOrigin = dir->nChars - SFcharsPerEntry;
+ if (dir->hOrigin < 0)
+ dir->hOrigin = 0;
+ dir->beginSelection = -1;
+ dir->endSelection = -1;
+ SFdoNotTouchVorigin = 1;
+ if ((dir + 1)->dir)
+ (void) SFfindFile(dir, (dir + 1)->dir);
+ else
+ (void) SFfindFile(dir, dir->path);
+
+ if (!SFworkProcAdded)
+ {
+ (void) XtAppAddWorkProc(SFapp, (XtWorkProc)SFworkProc, NULL);
+ SFworkProcAdded = 1;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+static int SFcheckFiles __ARGS((SFDir *dir));
+
+ static int
+SFcheckFiles(dir)
+ SFDir *dir;
+{
+ int from, to;
+ int result;
+ char oldc, newc;
+ int i;
+ char *str;
+ int last;
+ struct stat statBuf;
+
+ result = 0;
+
+ from = dir->vOrigin;
+ to = dir->vOrigin + SFlistSize;
+ if (to > dir->nEntries)
+ to = dir->nEntries;
+
+ for (i = from; i < to; i++)
+ {
+ str = dir->entries[i].real;
+ last = strlen(str) - 1;
+ oldc = str[last];
+ str[last] = 0;
+ if (mch_stat(str, &statBuf))
+ newc = ' ';
+ else
+ newc = SFstatChar(&statBuf);
+ str[last] = newc;
+ if (newc != oldc)
+ result = 1;
+ }
+
+ return result;
+}
+
+/* ARGSUSED */
+ static void
+SFdirModTimer(cl, id)
+ XtPointer cl;
+ XtIntervalId *id;
+{
+ static int n = -1;
+ static int f = 0;
+ char save;
+ SFDir *dir;
+
+ if ((!SFtwiddle) && (SFdirPtr < SFdirEnd))
+ {
+ n++;
+ if ((n > 2) || (SFdirPtr + n >= SFdirEnd))
+ {
+ n = 0;
+ f++;
+ if ((f > 2) || (SFdirPtr + f >= SFdirEnd))
+ f = 0;
+ }
+ dir = &(SFdirs[SFdirPtr + n]);
+ save = *(dir->path);
+ *(dir->path) = 0;
+ if (SFchdir(SFcurrentPath))
+ {
+ *(dir->path) = save;
+
+ /*
+ * force a re-read
+ */
+ *(dir->dir) = 0;
+
+ SFupdatePath();
+ }
+ else
+ {
+ *(dir->path) = save;
+ if (SFcheckDir(n, dir) || ((f == n) && SFcheckFiles(dir)))
+ SFdrawList(n, SF_DO_SCROLL);
+ }
+ }
+
+ SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
+ SFdirModTimer, (XtPointer) NULL);
+}
+
+/* Return a single character describing what kind of file STATBUF is. */
+
+ static char
+SFstatChar(statBuf)
+ struct stat *statBuf;
+{
+ if (S_ISDIR (statBuf->st_mode))
+ return '/';
+ if (S_ISREG (statBuf->st_mode))
+ return S_ISXXX (statBuf->st_mode) ? '*' : ' ';
+#ifdef S_ISSOCK
+ if (S_ISSOCK (statBuf->st_mode))
+ return '=';
+#endif /* S_ISSOCK */
+ return ' ';
+}
+
+/***************** Draw.c */
+
+#ifdef FEAT_GUI_NEXTAW
+# include <X11/neXtaw/Cardinals.h>
+#else
+# include <X11/Xaw/Cardinals.h>
+#endif
+
+#ifdef FEAT_XFONTSET
+# define SF_DEFAULT_FONT "-misc-fixed-medium-r-normal--14-*"
+#else
+# define SF_DEFAULT_FONT "9x15"
+#endif
+
+#ifdef ABS
+# undef ABS
+#endif
+#define ABS(x) (((x) < 0) ? (-(x)) : (x))
+
+typedef struct
+{
+ char *fontname;
+} TextData;
+
+static GC SFlineGC, SFscrollGC, SFinvertGC, SFtextGC;
+
+static XtResource textResources[] =
+{
+#ifdef FEAT_XFONTSET
+ {XtNfontSet, XtCFontSet, XtRString, sizeof (char *),
+ XtOffsetOf(TextData, fontname), XtRString, SF_DEFAULT_FONT},
+#else
+ {XtNfont, XtCFont, XtRString, sizeof (char *),
+ XtOffsetOf(TextData, fontname), XtRString, SF_DEFAULT_FONT},
+#endif
+};
+
+#ifdef FEAT_XFONTSET
+static XFontSet SFfont;
+#else
+static XFontStruct *SFfont;
+#endif
+
+static int SFcurrentListY;
+
+static XtIntervalId SFscrollTimerId;
+
+static void SFinitFont __ARGS((void));
+
+ static void
+SFinitFont()
+{
+ TextData *data;
+#ifdef FEAT_XFONTSET
+ XFontSetExtents *extents;
+ char **missing, *def_str;
+ int num_missing;
+#endif
+
+ data = XtNew(TextData);
+
+ XtGetApplicationResources(selFileForm, (XtPointer) data, textResources,
+ XtNumber(textResources), (Arg *) NULL, ZERO);
+
+#ifdef FEAT_XFONTSET
+ SFfont = XCreateFontSet(SFdisplay, data->fontname,
+ &missing, &num_missing, &def_str);
+#else
+ SFfont = XLoadQueryFont(SFdisplay, data->fontname);
+#endif
+ if (!SFfont)
+ {
+#ifdef FEAT_XFONTSET
+ SFfont = XCreateFontSet(SFdisplay, SF_DEFAULT_FONT,
+ &missing, &num_missing, &def_str);
+#else
+ SFfont = XLoadQueryFont(SFdisplay, SF_DEFAULT_FONT);
+#endif
+ if (!SFfont)
+ {
+ EMSG2(_("E616: vim_SelFile: can't get font %s"), SF_DEFAULT_FONT);
+ SFstatus = SEL_FILE_CANCEL;
+ return;
+ }
+ }
+
+#ifdef FEAT_XFONTSET
+ extents = XExtentsOfFontSet(SFfont);
+ SFcharWidth = extents->max_logical_extent.width;
+ SFcharAscent = -extents->max_logical_extent.y;
+ SFcharHeight = extents->max_logical_extent.height;
+#else
+ SFcharWidth = (SFfont->max_bounds.width + SFfont->min_bounds.width) / 2;
+ SFcharAscent = SFfont->max_bounds.ascent;
+ SFcharHeight = SFcharAscent + SFfont->max_bounds.descent;
+#endif
+}
+
+static void SFcreateGC __ARGS((void));
+
+ static void
+SFcreateGC()
+{
+ XGCValues gcValues;
+ XRectangle rectangles[1];
+
+ gcValues.foreground = SFfore;
+
+ SFlineGC = XtGetGC(
+ selFileLists[0],
+ (XtGCMask)GCForeground,
+ &gcValues);
+
+ SFscrollGC = XtGetGC(
+ selFileLists[0],
+ (XtGCMask)0,
+ &gcValues);
+
+ gcValues.function = GXxor;
+ gcValues.foreground = SFfore ^ SFback;
+ gcValues.background = SFfore ^ SFback;
+
+ SFinvertGC = XtGetGC(
+ selFileLists[0],
+ (XtGCMask)GCFunction | GCForeground | GCBackground,
+ &gcValues);
+
+ gcValues.foreground = SFfore;
+ gcValues.background = SFback;
+#ifndef FEAT_XFONTSET
+ gcValues.font = SFfont->fid;
+#endif
+
+ SFtextGC = XCreateGC(
+ SFdisplay,
+ XtWindow(selFileLists[0]),
+#ifdef FEAT_XFONTSET
+ (unsigned long)GCForeground | GCBackground,
+#else
+ (unsigned long)GCForeground | GCBackground | GCFont,
+#endif
+ &gcValues);
+
+ rectangles[0].x = SFlineToTextH + SFbesideText;
+ rectangles[0].y = 0;
+ rectangles[0].width = SFcharsPerEntry * SFcharWidth;
+ rectangles[0].height = SFupperY + 1;
+
+ XSetClipRectangles(
+ SFdisplay,
+ SFtextGC,
+ 0,
+ 0,
+ rectangles,
+ 1,
+ Unsorted);
+}
+
+ static void
+SFclearList(n, doScroll)
+ int n;
+ int doScroll;
+{
+ SFDir *dir;
+
+ SFcurrentInvert[n] = -1;
+
+ XClearWindow(SFdisplay, XtWindow(selFileLists[n]));
+
+ XDrawSegments(SFdisplay, XtWindow(selFileLists[n]), SFlineGC, SFsegs, 2);
+
+ if (doScroll)
+ {
+ dir = &(SFdirs[SFdirPtr + n]);
+
+ if ((SFdirPtr + n < SFdirEnd) && dir->nEntries && dir->nChars)
+ {
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) /
+ dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize)
+ ? dir->nEntries : SFlistSize)) /
+ dir->nEntries));
+#else
+ vim_XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) /
+ dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize)
+ ? dir->nEntries : SFlistSize)) /
+ dir->nEntries),
+ (double)dir->nEntries);
+#endif
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ selFileHScrolls[n],
+ (float) (((double) dir->hOrigin) / dir->nChars),
+ (float) (((double) ((dir->nChars <
+ SFcharsPerEntry) ? dir->nChars :
+ SFcharsPerEntry)) / dir->nChars));
+#else
+ vim_XawScrollbarSetThumb(
+ selFileHScrolls[n],
+ (float) (((double) dir->hOrigin) / dir->nChars),
+ (float) (((double) ((dir->nChars <
+ SFcharsPerEntry) ? dir->nChars :
+ SFcharsPerEntry)) / dir->nChars),
+ (double)dir->nChars);
+#endif
+ }
+ else
+ {
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(selFileVScrolls[n], (float) 0.0,
+ (float) 1.0);
+#else
+ vim_XawScrollbarSetThumb(selFileVScrolls[n], (float) 0.0,
+ (float) 1.0, 1.0);
+#endif
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(selFileHScrolls[n], (float) 0.0,
+ (float) 1.0);
+#else
+ vim_XawScrollbarSetThumb(selFileHScrolls[n], (float) 0.0,
+ (float) 1.0, 1.0);
+#endif
+ }
+ }
+}
+
+static void SFdeleteEntry __ARGS((SFDir *dir, SFEntry *entry));
+
+ static void
+SFdeleteEntry(dir, entry)
+ SFDir *dir;
+ SFEntry *entry;
+{
+ SFEntry *e;
+ SFEntry *end;
+ int n;
+ int idx;
+
+ idx = entry - dir->entries;
+
+ if (idx < dir->beginSelection)
+ dir->beginSelection--;
+ if (idx <= dir->endSelection)
+ dir->endSelection--;
+ if (dir->beginSelection > dir->endSelection)
+ dir->beginSelection = dir->endSelection = -1;
+
+ if (idx < dir->vOrigin)
+ dir->vOrigin--;
+
+ XtFree(entry->real);
+
+ end = &(dir->entries[dir->nEntries - 1]);
+
+ for (e = entry; e < end; e++)
+ *e = *(e + 1);
+
+ if (!(--dir->nEntries))
+ return;
+
+ n = dir - &(SFdirs[SFdirPtr]);
+ if ((n < 0) || (n > 2))
+ return;
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) / dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries));
+#else
+ vim_XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) / dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries),
+ (double)dir->nEntries);
+#endif
+}
+
+static void SFwriteStatChar __ARGS((char *name, int last, struct stat *statBuf));
+
+ static void
+SFwriteStatChar(name, last, statBuf)
+ char *name;
+ int last;
+ struct stat *statBuf;
+{
+ name[last] = SFstatChar(statBuf);
+}
+
+static int SFstatAndCheck __ARGS((SFDir *dir, SFEntry *entry));
+
+ static int
+SFstatAndCheck(dir, entry)
+ SFDir *dir;
+ SFEntry *entry;
+{
+ struct stat statBuf;
+ char save;
+ int last;
+
+ /*
+ * must be restored before returning
+ */
+ save = *(dir->path);
+ *(dir->path) = 0;
+
+ if (!SFchdir(SFcurrentPath))
+ {
+ last = strlen(entry->real) - 1;
+ entry->real[last] = 0;
+ entry->statDone = 1;
+ if ((!mch_stat(entry->real, &statBuf))
+#ifdef S_IFLNK
+ || (!mch_lstat(entry->real, &statBuf))
+#endif
+ )
+ {
+ if (SFfunc)
+ {
+ char *shown;
+
+ shown = NULL;
+ if (SFfunc(entry->real, &shown, &statBuf))
+ {
+ if (shown)
+ {
+ int len;
+
+ len = strlen(shown);
+ entry->shown = XtMalloc((unsigned) (len + 2));
+ (void) strcpy(entry->shown, shown);
+ SFwriteStatChar(entry->shown, len, &statBuf);
+ entry->shown[len + 1] = 0;
+ }
+ }
+ else
+ {
+ SFdeleteEntry(dir, entry);
+
+ *(dir->path) = save;
+ return 1;
+ }
+ }
+ SFwriteStatChar(entry->real, last, &statBuf);
+ }
+ else
+ entry->real[last] = ' ';
+ }
+
+ *(dir->path) = save;
+ return 0;
+}
+
+
+ static void
+SFdrawStrings(w, dir, from, to)
+ Window w;
+ SFDir *dir;
+ int from;
+ int to;
+{
+ int i;
+ SFEntry *entry;
+ int x;
+
+ x = SFtextX - dir->hOrigin * SFcharWidth;
+
+ if (dir->vOrigin + to >= dir->nEntries)
+ to = dir->nEntries - dir->vOrigin - 1;
+ for (i = from; i <= to; i++)
+ {
+ entry = &(dir->entries[dir->vOrigin + i]);
+ if (!(entry->statDone))
+ {
+ if (SFstatAndCheck(dir, entry))
+ {
+ if (dir->vOrigin + to >= dir->nEntries)
+ to = dir->nEntries - dir->vOrigin - 1;
+ i--;
+ continue;
+ }
+ }
+#ifdef FEAT_XFONTSET
+ XmbDrawImageString(
+ SFdisplay,
+ w,
+ SFfont,
+ SFtextGC,
+ x,
+ SFtextYoffset + i * SFentryHeight,
+ entry->shown,
+ strlen(entry->shown));
+#else
+ XDrawImageString(
+ SFdisplay,
+ w,
+ SFtextGC,
+ x,
+ SFtextYoffset + i * SFentryHeight,
+ entry->shown,
+ strlen(entry->shown));
+#endif
+ if (dir->vOrigin + i == dir->beginSelection)
+ {
+ XDrawLine(
+ SFdisplay,
+ w,
+ SFlineGC,
+ SFlineToTextH + 1,
+ SFlowerY + i * SFentryHeight,
+ SFlineToTextH + SFentryWidth - 2,
+ SFlowerY + i * SFentryHeight);
+ }
+ if ((dir->vOrigin + i >= dir->beginSelection) &&
+ (dir->vOrigin + i <= dir->endSelection))
+ {
+ SFcompletionSegs[0].y1 = SFcompletionSegs[1].y1 =
+ SFlowerY + i * SFentryHeight;
+ SFcompletionSegs[0].y2 = SFcompletionSegs[1].y2 =
+ SFlowerY + (i + 1) * SFentryHeight - 1;
+ XDrawSegments(
+ SFdisplay,
+ w,
+ SFlineGC,
+ SFcompletionSegs,
+ 2);
+ }
+ if (dir->vOrigin + i == dir->endSelection)
+ {
+ XDrawLine(
+ SFdisplay,
+ w,
+ SFlineGC,
+ SFlineToTextH + 1,
+ SFlowerY + (i + 1) * SFentryHeight - 1,
+ SFlineToTextH + SFentryWidth - 2,
+ SFlowerY + (i + 1) * SFentryHeight - 1);
+ }
+ }
+}
+
+ static void
+SFdrawList(n, doScroll)
+ int n;
+ int doScroll;
+{
+ SFDir *dir;
+ Window w;
+
+ SFclearList(n, doScroll);
+
+ if (SFdirPtr + n < SFdirEnd)
+ {
+ dir = &(SFdirs[SFdirPtr + n]);
+ w = XtWindow(selFileLists[n]);
+#ifdef FEAT_XFONTSET
+ XmbDrawImageString(
+ SFdisplay,
+ w,
+ SFfont,
+ SFtextGC,
+ SFtextX - dir->hOrigin * SFcharWidth,
+ SFlineToTextV + SFaboveAndBelowText + SFcharAscent,
+ dir->dir,
+ strlen(dir->dir));
+#else
+ XDrawImageString(
+ SFdisplay,
+ w,
+ SFtextGC,
+ SFtextX - dir->hOrigin * SFcharWidth,
+ SFlineToTextV + SFaboveAndBelowText + SFcharAscent,
+ dir->dir,
+ strlen(dir->dir));
+#endif
+ SFdrawStrings(w, dir, 0, SFlistSize - 1);
+ }
+}
+
+ static void
+SFdrawLists(doScroll)
+ int doScroll;
+{
+ int i;
+
+ for (i = 0; i < 3; i++)
+ SFdrawList(i, doScroll);
+}
+
+ static void
+SFinvertEntry(n)
+ int n;
+{
+ XFillRectangle(
+ SFdisplay,
+ XtWindow(selFileLists[n]),
+ SFinvertGC,
+ SFlineToTextH,
+ SFcurrentInvert[n] * SFentryHeight + SFlowerY,
+ SFentryWidth,
+ SFentryHeight);
+}
+
+static unsigned long SFscrollTimerInterval __ARGS((void));
+
+ static unsigned long
+SFscrollTimerInterval()
+{
+ static int maxVal = 200;
+ static int varyDist = 50;
+ static int minDist = 50;
+ int t;
+ int dist;
+
+ if (SFcurrentListY < SFlowerY)
+ dist = SFlowerY - SFcurrentListY;
+ else if (SFcurrentListY > SFupperY)
+ dist = SFcurrentListY - SFupperY;
+ else
+ return (unsigned long) 1;
+
+ t = maxVal - ((maxVal / varyDist) * (dist - minDist));
+
+ if (t < 1)
+ t = 1;
+
+ if (t > maxVal)
+ t = maxVal;
+
+ return (unsigned long)t;
+}
+
+static void SFscrollTimer __ARGS((XtPointer p, XtIntervalId *id));
+
+/* ARGSUSED */
+ static void
+SFscrollTimer(p, id)
+ XtPointer p;
+ XtIntervalId *id;
+{
+ SFDir *dir;
+ int save;
+ int n;
+
+ n = (long)p;
+
+ dir = &(SFdirs[SFdirPtr + n]);
+ save = dir->vOrigin;
+
+ if (SFcurrentListY < SFlowerY)
+ {
+ if (dir->vOrigin > 0)
+ SFvSliderMovedCallback(selFileVScrolls[n], n, dir->vOrigin - 1);
+ }
+ else if (SFcurrentListY > SFupperY)
+ {
+ if (dir->vOrigin < dir->nEntries - SFlistSize)
+ SFvSliderMovedCallback(selFileVScrolls[n], n, dir->vOrigin + 1);
+ }
+
+ if (dir->vOrigin != save)
+ {
+ if (dir->nEntries)
+ {
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) / dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries));
+#else
+ vim_XawScrollbarSetThumb(
+ selFileVScrolls[n],
+ (float) (((double) dir->vOrigin) / dir->nEntries),
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries),
+ (double)dir->nEntries);
+#endif
+ }
+ }
+
+ if (SFbuttonPressed)
+ SFscrollTimerId = XtAppAddTimeOut(SFapp,
+ SFscrollTimerInterval(), SFscrollTimer, (XtPointer) n);
+}
+
+ static int
+SFnewInvertEntry(n, event)
+ int n;
+ XMotionEvent *event;
+{
+ int x, y;
+ int nw;
+ static int SFscrollTimerAdded = 0;
+
+ x = event->x;
+ y = event->y;
+
+ if (SFdirPtr + n >= SFdirEnd)
+ return -1;
+
+ if ((x >= 0) && (x <= SFupperX) && (y >= SFlowerY) && (y <= SFupperY))
+ {
+ SFDir *dir = &(SFdirs[SFdirPtr + n]);
+
+ if (SFscrollTimerAdded)
+ {
+ SFscrollTimerAdded = 0;
+ XtRemoveTimeOut(SFscrollTimerId);
+ }
+
+ nw = (y - SFlowerY) / SFentryHeight;
+ if (dir->vOrigin + nw >= dir->nEntries)
+ return -1;
+ return nw;
+ }
+ else
+ {
+ if (SFbuttonPressed)
+ {
+ SFcurrentListY = y;
+ if (!SFscrollTimerAdded)
+ {
+ SFscrollTimerAdded = 1;
+ SFscrollTimerId = XtAppAddTimeOut(SFapp,
+ SFscrollTimerInterval(), SFscrollTimer,
+ (XtPointer) n);
+ }
+ }
+ return -1;
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFenterList(w, n, event)
+ Widget w;
+ int n;
+ XEnterWindowEvent *event;
+{
+ int nw;
+
+ /* sanity */
+ if (SFcurrentInvert[n] != -1)
+ {
+ SFinvertEntry(n);
+ SFcurrentInvert[n] = -1;
+ }
+
+ nw = SFnewInvertEntry(n, (XMotionEvent *) event);
+ if (nw != -1)
+ {
+ SFcurrentInvert[n] = nw;
+ SFinvertEntry(n);
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFleaveList(w, n, event)
+ Widget w;
+ int n;
+ XEvent *event;
+{
+ if (SFcurrentInvert[n] != -1)
+ {
+ SFinvertEntry(n);
+ SFcurrentInvert[n] = -1;
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFmotionList(w, n, event)
+ Widget w;
+ int n;
+ XMotionEvent *event;
+{
+ int nw;
+
+ nw = SFnewInvertEntry(n, event);
+
+ if (nw != SFcurrentInvert[n])
+ {
+ if (SFcurrentInvert[n] != -1)
+ SFinvertEntry(n);
+ SFcurrentInvert[n] = nw;
+ if (nw != -1)
+ SFinvertEntry(n);
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFvFloatSliderMovedCallback(w, n, fnew)
+ Widget w;
+ XtPointer n;
+ XtPointer fnew;
+{
+ int nw;
+
+ nw = (*(float *)fnew) * SFdirs[SFdirPtr + (int)(long)n].nEntries;
+ SFvSliderMovedCallback(w, (int)(long)n, nw);
+}
+
+/* ARGSUSED */
+ static void
+SFvSliderMovedCallback(w, n, nw)
+ Widget w;
+ int n;
+ int nw;
+{
+ int old;
+ Window win;
+ SFDir *dir;
+
+ dir = &(SFdirs[SFdirPtr + n]);
+
+ old = dir->vOrigin;
+ dir->vOrigin = nw;
+
+ if (old == nw)
+ return;
+
+ win = XtWindow(selFileLists[n]);
+
+ if (ABS(nw - old) < SFlistSize)
+ {
+ if (nw > old)
+ {
+ XCopyArea(
+ SFdisplay,
+ win,
+ win,
+ SFscrollGC,
+ SFlineToTextH,
+ SFlowerY + (nw - old) * SFentryHeight,
+ SFentryWidth + SFlineToTextH,
+ (SFlistSize - (nw - old)) * SFentryHeight,
+ SFlineToTextH,
+ SFlowerY);
+ XClearArea(
+ SFdisplay,
+ win,
+ SFlineToTextH,
+ SFlowerY + (SFlistSize - (nw - old)) *
+ SFentryHeight,
+ SFentryWidth + SFlineToTextH,
+ (nw - old) * SFentryHeight,
+ False);
+ SFdrawStrings(win, dir, SFlistSize - (nw - old),
+ SFlistSize - 1);
+ }
+ else
+ {
+ XCopyArea(
+ SFdisplay,
+ win,
+ win,
+ SFscrollGC,
+ SFlineToTextH,
+ SFlowerY,
+ SFentryWidth + SFlineToTextH,
+ (SFlistSize - (old - nw)) * SFentryHeight,
+ SFlineToTextH,
+ SFlowerY + (old - nw) * SFentryHeight);
+ XClearArea(
+ SFdisplay,
+ win,
+ SFlineToTextH,
+ SFlowerY,
+ SFentryWidth + SFlineToTextH,
+ (old - nw) * SFentryHeight,
+ False);
+ SFdrawStrings(win, dir, 0, old - nw);
+ }
+ }
+ else
+ {
+ XClearArea(
+ SFdisplay,
+ win,
+ SFlineToTextH,
+ SFlowerY,
+ SFentryWidth + SFlineToTextH,
+ SFlistSize * SFentryHeight,
+ False);
+ SFdrawStrings(win, dir, 0, SFlistSize - 1);
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFvAreaSelectedCallback(w, n, pnew)
+ Widget w;
+ XtPointer n;
+ XtPointer pnew;
+{
+ SFDir *dir;
+ int nw;
+
+ dir = &(SFdirs[SFdirPtr + (int)(long)n]);
+
+#ifdef FEAT_GUI_NEXTAW
+ if ((int)(long)pnew < 0)
+ {
+ if ((int)(long)pnew > -SFvScrollHeight)
+ (int)(long)pnew = -1;
+ else
+ (int)(long)pnew = -SFlistSize;
+ }
+ else if ((int)(long)pnew > 0)
+ {
+ if ((int)(long)pnew < SFvScrollHeight)
+ (int)(long)pnew = 1;
+ else
+ (int)(long)pnew = SFlistSize;
+ }
+#endif
+ nw = dir->vOrigin + (int)(long)pnew;
+
+ if (nw > dir->nEntries - SFlistSize)
+ nw = dir->nEntries - SFlistSize;
+
+ if (nw < 0)
+ nw = 0;
+
+ if (dir->nEntries)
+ {
+ float f;
+
+ f = ((double) nw) / dir->nEntries;
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries));
+#else
+ vim_XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((dir->nEntries < SFlistSize) ?
+ dir->nEntries : SFlistSize)) / dir->nEntries),
+ (double)dir->nEntries);
+#endif
+ }
+
+ SFvSliderMovedCallback(w, (int)(long)n, nw);
+}
+
+/* ARGSUSED */
+ static void
+SFhSliderMovedCallback(w, n, nw)
+ Widget w;
+ XtPointer n;
+ XtPointer nw;
+{
+ SFDir *dir;
+ int save;
+
+ dir = &(SFdirs[SFdirPtr + (int)(long)n]);
+ save = dir->hOrigin;
+ dir->hOrigin = (*(float *)nw) * dir->nChars;
+ if (dir->hOrigin == save)
+ return;
+
+ SFdrawList((int)(long)n, SF_DO_NOT_SCROLL);
+}
+
+/* ARGSUSED */
+ static void
+SFhAreaSelectedCallback(w, n, pnew)
+ Widget w;
+ XtPointer n;
+ XtPointer pnew;
+{
+ SFDir *dir;
+ int nw;
+
+ dir = &(SFdirs[SFdirPtr + (int)(long)n]);
+
+#ifdef FEAT_GUI_NEXTAW
+ if ((int)(long)pnew < 0)
+ {
+ if ((int)(long)pnew > -SFhScrollWidth)
+ (int)(long)pnew = -1;
+ else
+ (int)(long)pnew = -SFcharsPerEntry;
+ }
+ else if ((int)(long)pnew > 0)
+ {
+ if ((int)(long)pnew < SFhScrollWidth)
+ (int)(long)pnew = 1;
+ else
+ (int)(long)pnew = SFcharsPerEntry;
+ }
+#endif
+ nw = dir->hOrigin + (int)(long)pnew;
+
+ if (nw > dir->nChars - SFcharsPerEntry)
+ nw = dir->nChars - SFcharsPerEntry;
+
+ if (nw < 0)
+ nw = 0;
+
+ if (dir->nChars)
+ {
+ float f;
+
+ f = ((double) nw) / dir->nChars;
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((dir->nChars < SFcharsPerEntry) ?
+ dir->nChars : SFcharsPerEntry)) / dir->nChars));
+#else
+ vim_XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((dir->nChars < SFcharsPerEntry) ?
+ dir->nChars : SFcharsPerEntry)) / dir->nChars),
+ (double)dir->nChars);
+#endif
+
+ SFhSliderMovedCallback(w, n, (XtPointer)&f);
+ }
+}
+
+/* ARGSUSED */
+ static void
+SFpathSliderMovedCallback(w, client_data, nw)
+ Widget w;
+ XtPointer client_data;
+ XtPointer nw;
+{
+ SFDir *dir;
+ int n;
+ XawTextPosition pos;
+ int SFdirPtrSave;
+
+ SFdirPtrSave = SFdirPtr;
+ SFdirPtr = (*(float *)nw) * SFdirEnd;
+ if (SFdirPtr == SFdirPtrSave)
+ return;
+
+ SFdrawLists(SF_DO_SCROLL);
+
+ n = 2;
+ while (SFdirPtr + n >= SFdirEnd)
+ n--;
+
+ dir = &(SFdirs[SFdirPtr + n]);
+
+ pos = dir->path - SFcurrentPath;
+
+ if (!strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir)))
+ {
+ pos -= strlen(SFstartDir);
+ if (pos < 0)
+ pos = 0;
+ }
+
+ XawTextSetInsertionPoint(selFileField, pos);
+}
+
+/* ARGSUSED */
+ static void
+SFpathAreaSelectedCallback(w, client_data, pnew)
+ Widget w;
+ XtPointer client_data;
+ XtPointer pnew;
+{
+ int nw;
+ float f;
+
+#ifdef FEAT_GUI_NEXTAW
+ if ((int)(long)pnew < 0)
+ {
+ if ((int)(long)pnew > -SFpathScrollWidth)
+ (int)(long)pnew = -1;
+ else
+ (int)(long)pnew = -3;
+ }
+ else if ((int)(long)pnew > 0)
+ {
+ if ((int)(long)pnew < SFpathScrollWidth)
+ (int)(long)pnew = 1;
+ else
+ (int)(long)pnew = 3;
+ }
+#endif
+ nw = SFdirPtr + (int)(long)pnew;
+
+ if (nw > SFdirEnd - 3)
+ nw = SFdirEnd - 3;
+
+ if (nw < 0)
+ nw = 0;
+
+ f = ((double) nw) / SFdirEnd;
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) / SFdirEnd));
+#else
+ vim_XawScrollbarSetThumb(
+ w,
+ f,
+ (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) / SFdirEnd),
+ (double)SFdirEnd);
+#endif
+
+ SFpathSliderMovedCallback(w, (XtPointer) NULL, (XtPointer)&f);
+}
+
+ static Boolean
+SFworkProc()
+{
+ SFDir *dir;
+ SFEntry *entry;
+
+ for (dir = &(SFdirs[SFdirEnd - 1]); dir >= SFdirs; dir--)
+ {
+ if (!(dir->nEntries))
+ continue;
+ for (entry = &(dir->entries[dir->nEntries - 1]);
+ entry >= dir->entries;
+ entry--)
+ {
+ if (!(entry->statDone))
+ {
+ (void)SFstatAndCheck(dir, entry);
+ return False;
+ }
+ }
+ }
+
+ SFworkProcAdded = 0;
+
+ return True;
+}
+
+/***************** Dir.c */
+
+ static int
+SFcompareEntries(p, q)
+ const void *p;
+ const void *q;
+{
+ return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
+}
+
+ static int
+SFgetDir(dir)
+ SFDir *dir;
+{
+ SFEntry *result = NULL;
+ int Alloc = 0;
+ int i;
+ DIR *dirp;
+ struct dirent *dp;
+ char *str;
+ int len;
+ int maxChars;
+ struct stat statBuf;
+
+ maxChars = strlen(dir->dir) - 1;
+
+ dir->entries = NULL;
+ dir->nEntries = 0;
+ dir->nChars = 0;
+
+ result = NULL;
+ i = 0;
+
+ dirp = opendir(".");
+ if (!dirp)
+ return 1;
+
+ (void)mch_stat(".", &statBuf);
+ dir->mtime = statBuf.st_mtime;
+
+ while ((dp = readdir(dirp)))
+ {
+ /* Ignore "." and ".." */
+ if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
+ continue;
+ if (i >= Alloc)
+ {
+ Alloc = 2 * (Alloc + 1);
+ result = (SFEntry *) XtRealloc((char *) result,
+ (unsigned) (Alloc * sizeof(SFEntry)));
+ }
+ result[i].statDone = 0;
+ str = dp->d_name;
+ len = strlen(str);
+ result[i].real = XtMalloc((unsigned) (len + 2));
+ (void) strcat(strcpy(result[i].real, str), " ");
+ if (len > maxChars)
+ maxChars = len;
+ result[i].shown = result[i].real;
+ i++;
+ }
+
+ qsort((char *) result, (size_t) i, sizeof(SFEntry), SFcompareEntries);
+
+ dir->entries = result;
+ dir->nEntries = i;
+ dir->nChars = maxChars + 1;
+
+ closedir(dirp);
+
+ return 0;
+}
+
+/***************** SFinternal.h */
+
+#include <sys/param.h>
+#include <X11/cursorfont.h>
+#include <X11/Composite.h>
+#include <X11/Shell.h>
+#ifdef FEAT_GUI_NEXTAW
+# include <X11/neXtaw/Form.h>
+# include <X11/neXtaw/Command.h>
+# include <X11/neXtaw/Label.h>
+#else
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Label.h>
+#endif
+
+static char *oneLineTextEditTranslations = "\
+ <Key>Return: redraw-display()\n\
+ Ctrl<Key>M: redraw-display()\n\
+";
+
+static void SFexposeList __ARGS((Widget w, XtPointer n, XEvent *event, Boolean *cont));
+
+/* ARGSUSED */
+ static void
+SFexposeList(w, n, event, cont)
+ Widget w;
+ XtPointer n;
+ XEvent *event;
+ Boolean *cont;
+{
+ if ((event->type == NoExpose) || event->xexpose.count)
+ return;
+
+ SFdrawList((int)(long)n, SF_DO_NOT_SCROLL);
+}
+
+static void SFmodVerifyCallback __ARGS((Widget w, XtPointer client_data, XEvent *event, Boolean *cont));
+
+/* ARGSUSED */
+ static void
+SFmodVerifyCallback(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ char buf[2];
+
+ if ((XLookupString(&(event->xkey), buf, 2, NULL, NULL) == 1) &&
+ ((*buf) == '\r'))
+ SFstatus = SEL_FILE_OK;
+ else
+ SFstatus = SEL_FILE_TEXT;
+}
+
+static void SFokCallback __ARGS((Widget w, XtPointer cl, XtPointer cd));
+
+/* ARGSUSED */
+ static void
+SFokCallback(w, cl, cd)
+ Widget w;
+ XtPointer cl, cd;
+{
+ SFstatus = SEL_FILE_OK;
+}
+
+static XtCallbackRec SFokSelect[] =
+{
+ { SFokCallback, (XtPointer) NULL },
+ { NULL, (XtPointer) NULL },
+};
+
+static void SFcancelCallback __ARGS((Widget w, XtPointer cl, XtPointer cd));
+
+/* ARGSUSED */
+ static void
+SFcancelCallback(w, cl, cd)
+ Widget w;
+ XtPointer cl, cd;
+{
+ SFstatus = SEL_FILE_CANCEL;
+}
+
+static XtCallbackRec SFcancelSelect[] =
+{
+ { SFcancelCallback, (XtPointer) NULL },
+ { NULL, (XtPointer) NULL },
+};
+
+static void SFdismissAction __ARGS((Widget w, XEvent *event, String *params, Cardinal *num_params));
+
+/* ARGSUSED */
+ static void
+SFdismissAction(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ if (event->type == ClientMessage &&
+ event->xclient.data.l[0] != SFwmDeleteWindow)
+ return;
+
+ SFstatus = SEL_FILE_CANCEL;
+}
+
+static char *wmDeleteWindowTranslation = "\
+ <Message>WM_PROTOCOLS: SelFileDismiss()\n\
+";
+
+static XtActionsRec actions[] =
+{
+ {"SelFileDismiss", SFdismissAction},
+};
+
+ static void
+SFsetColors(bg, fg, scroll_bg, scroll_fg)
+ guicolor_T bg;
+ guicolor_T fg;
+ guicolor_T scroll_bg;
+ guicolor_T scroll_fg;
+{
+ if (selFileForm)
+ {
+ XtVaSetValues(selFileForm, XtNbackground, bg,
+ XtNforeground, fg,
+ XtNborderColor, bg,
+ NULL);
+ }
+ {
+ int i;
+
+ for (i = 0; i < 3; ++i)
+ {
+ if (selFileLists[i])
+ {
+ XtVaSetValues(selFileLists[i], XtNbackground, bg,
+ XtNforeground, fg,
+ XtNborderColor, fg,
+ NULL);
+ }
+ }
+ }
+ if (selFileOK)
+ {
+ XtVaSetValues(selFileOK, XtNbackground, bg,
+ XtNforeground, fg,
+ XtNborderColor, fg,
+ NULL);
+ }
+ if (selFileCancel)
+ {
+ XtVaSetValues(selFileCancel, XtNbackground, bg,
+ XtNforeground, fg,
+ XtNborderColor, fg,
+ NULL);
+ }
+ if (selFilePrompt)
+ {
+ XtVaSetValues(selFilePrompt, XtNbackground, bg,
+ XtNforeground, fg,
+ NULL);
+ }
+ if (gui.dpy)
+ {
+ XSetBackground(gui.dpy, SFtextGC, bg);
+ XSetForeground(gui.dpy, SFtextGC, fg);
+ XSetForeground(gui.dpy, SFlineGC, fg);
+
+ /* This is an xor GC, so combine the fg and background */
+ XSetBackground(gui.dpy, SFinvertGC, fg ^ bg);
+ XSetForeground(gui.dpy, SFinvertGC, fg ^ bg);
+ }
+ if (selFileHScroll)
+ {
+ XtVaSetValues(selFileHScroll, XtNbackground, scroll_bg,
+ XtNforeground, scroll_fg,
+ XtNborderColor, fg,
+ NULL);
+ }
+ {
+ int i;
+
+ for (i = 0; i < 3; i++)
+ {
+ XtVaSetValues(selFileVScrolls[i], XtNbackground, scroll_bg,
+ XtNforeground, scroll_fg,
+ XtNborderColor, fg,
+ NULL);
+ XtVaSetValues(selFileHScrolls[i], XtNbackground, scroll_bg,
+ XtNforeground, scroll_fg,
+ XtNborderColor, fg,
+ NULL);
+ }
+ }
+}
+
+ static void
+SFcreateWidgets(toplevel, prompt, ok, cancel)
+ Widget toplevel;
+ char *prompt;
+ char *ok;
+ char *cancel;
+{
+ Cardinal n;
+ int listWidth, listHeight;
+ int listSpacing = 10;
+ int scrollThickness = 15;
+ int hScrollX, hScrollY;
+ int vScrollX, vScrollY;
+
+ selFile = XtVaAppCreateShell("selFile", "SelFile",
+ transientShellWidgetClass, SFdisplay,
+ XtNtransientFor, toplevel,
+ XtNtitle, prompt,
+ NULL);
+
+ /* Add WM_DELETE_WINDOW protocol */
+ XtAppAddActions(XtWidgetToApplicationContext(selFile),
+ actions, XtNumber(actions));
+ XtOverrideTranslations(selFile,
+ XtParseTranslationTable(wmDeleteWindowTranslation));
+
+ selFileForm = XtVaCreateManagedWidget("selFileForm",
+ formWidgetClass, selFile,
+ XtNdefaultDistance, 30,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFback,
+ NULL);
+
+ selFilePrompt = XtVaCreateManagedWidget("selFilePrompt",
+ labelWidgetClass, selFileForm,
+ XtNlabel, prompt,
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNborderWidth, 0,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ NULL);
+
+ /*
+ XtVaGetValues(selFilePrompt,
+ XtNforeground, &SFfore,
+ XtNbackground, &SFback,
+ NULL);
+ */
+
+ SFinitFont();
+
+ SFentryWidth = SFbesideText + SFcharsPerEntry * SFcharWidth +
+ SFbesideText;
+ SFentryHeight = SFaboveAndBelowText + SFcharHeight +
+ SFaboveAndBelowText;
+
+ listWidth = SFlineToTextH + SFentryWidth + SFlineToTextH + 1 +
+ scrollThickness;
+ listHeight = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 +
+ SFlineToTextV + SFlistSize * SFentryHeight +
+ SFlineToTextV + 1 + scrollThickness;
+
+ SFpathScrollWidth = 3 * listWidth + 2 * listSpacing + 4;
+
+ hScrollX = -1;
+ hScrollY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 +
+ SFlineToTextV + SFlistSize * SFentryHeight +
+ SFlineToTextV;
+ SFhScrollWidth = SFlineToTextH + SFentryWidth + SFlineToTextH;
+
+ vScrollX = SFlineToTextH + SFentryWidth + SFlineToTextH;
+ vScrollY = SFlineToTextV + SFentryHeight + SFlineToTextV;
+ SFvScrollHeight = SFlineToTextV + SFlistSize * SFentryHeight +
+ SFlineToTextV;
+
+ SFupperX = SFlineToTextH + SFentryWidth + SFlineToTextH - 1;
+ SFlowerY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 +
+ SFlineToTextV;
+ SFupperY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 +
+ SFlineToTextV + SFlistSize * SFentryHeight - 1;
+
+ SFtextX = SFlineToTextH + SFbesideText;
+ SFtextYoffset = SFlowerY + SFaboveAndBelowText + SFcharAscent;
+
+ SFsegs[0].x1 = 0;
+ SFsegs[0].y1 = vScrollY;
+ SFsegs[0].x2 = vScrollX - 1;
+ SFsegs[0].y2 = vScrollY;
+ SFsegs[1].x1 = vScrollX;
+ SFsegs[1].y1 = 0;
+ SFsegs[1].x2 = vScrollX;
+ SFsegs[1].y2 = vScrollY - 1;
+
+ SFcompletionSegs[0].x1 = SFcompletionSegs[0].x2 = SFlineToTextH;
+ SFcompletionSegs[1].x1 = SFcompletionSegs[1].x2 =
+ SFlineToTextH + SFentryWidth - 1;
+
+ selFileField = XtVaCreateManagedWidget("selFileField",
+ asciiTextWidgetClass, selFileForm,
+ XtNwidth, 3 * listWidth + 2 * listSpacing + 4,
+ XtNborderColor, SFfore,
+ XtNfromVert, selFilePrompt,
+ XtNvertDistance, 10,
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNstring, SFtextBuffer,
+ XtNlength, MAXPATHL,
+ XtNeditType, XawtextEdit,
+ XtNwrap, XawtextWrapWord,
+ XtNresize, XawtextResizeHeight,
+ XtNuseStringInPlace, True,
+ NULL);
+
+ XtOverrideTranslations(selFileField,
+ XtParseTranslationTable(oneLineTextEditTranslations));
+ XtSetKeyboardFocus(selFileForm, selFileField);
+
+ selFileHScroll = XtVaCreateManagedWidget("selFileHScroll",
+#ifdef FEAT_GUI_NEXTAW
+ scrollbarWidgetClass, selFileForm,
+#else
+ vim_scrollbarWidgetClass, selFileForm,
+#endif
+ XtNorientation, XtorientHorizontal,
+ XtNwidth, SFpathScrollWidth,
+ XtNheight, scrollThickness,
+ XtNborderColor, SFfore,
+ XtNfromVert, selFileField,
+ XtNvertDistance, 30,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNforeground, gui.scroll_fg_pixel,
+ XtNbackground, gui.scroll_bg_pixel,
+#ifndef FEAT_GUI_NEXTAW
+ XtNlimitThumb, 1,
+#endif
+ NULL);
+
+ XtAddCallback(selFileHScroll, XtNjumpProc,
+ (XtCallbackProc) SFpathSliderMovedCallback, (XtPointer)NULL);
+ XtAddCallback(selFileHScroll, XtNscrollProc,
+ (XtCallbackProc) SFpathAreaSelectedCallback, (XtPointer)NULL);
+
+ selFileLists[0] = XtVaCreateManagedWidget("selFileList1",
+ compositeWidgetClass, selFileForm,
+ XtNwidth, listWidth,
+ XtNheight, listHeight,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFfore,
+ XtNfromVert, selFileHScroll,
+ XtNvertDistance, 10,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ NULL);
+
+ selFileLists[1] = XtVaCreateManagedWidget("selFileList2",
+ compositeWidgetClass, selFileForm,
+ XtNwidth, listWidth,
+ XtNheight, listHeight,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFfore,
+ XtNfromHoriz, selFileLists[0],
+ XtNfromVert, selFileHScroll,
+ XtNhorizDistance, listSpacing,
+ XtNvertDistance, 10,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ NULL);
+
+ selFileLists[2] = XtVaCreateManagedWidget("selFileList3",
+ compositeWidgetClass, selFileForm,
+ XtNwidth, listWidth,
+ XtNheight, listHeight,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFfore,
+ XtNfromHoriz, selFileLists[1],
+ XtNfromVert, selFileHScroll,
+ XtNhorizDistance, listSpacing,
+ XtNvertDistance, 10,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ NULL);
+
+ for (n = 0; n < 3; n++)
+ {
+ selFileVScrolls[n] = XtVaCreateManagedWidget("selFileVScroll",
+#ifdef FEAT_GUI_NEXTAW
+ scrollbarWidgetClass, selFileLists[n],
+#else
+ vim_scrollbarWidgetClass, selFileLists[n],
+#endif
+ XtNx, vScrollX,
+ XtNy, vScrollY,
+ XtNwidth, scrollThickness,
+ XtNheight, SFvScrollHeight,
+ XtNborderColor, SFfore,
+ XtNforeground, gui.scroll_fg_pixel,
+ XtNbackground, gui.scroll_bg_pixel,
+#ifndef FEAT_GUI_NEXTAW
+ XtNlimitThumb, 1,
+#endif
+ NULL);
+
+ XtAddCallback(selFileVScrolls[n], XtNjumpProc,
+ (XtCallbackProc)SFvFloatSliderMovedCallback, (XtPointer)n);
+ XtAddCallback(selFileVScrolls[n], XtNscrollProc,
+ (XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)n);
+
+ selFileHScrolls[n] = XtVaCreateManagedWidget("selFileHScroll",
+#ifdef FEAT_GUI_NEXTAW
+ scrollbarWidgetClass, selFileLists[n],
+#else
+ vim_scrollbarWidgetClass, selFileLists[n],
+#endif
+ XtNorientation, XtorientHorizontal,
+ XtNx, hScrollX,
+ XtNy, hScrollY,
+ XtNwidth, SFhScrollWidth,
+ XtNheight, scrollThickness,
+ XtNborderColor, SFfore,
+ XtNforeground, gui.scroll_fg_pixel,
+ XtNbackground, gui.scroll_bg_pixel,
+#ifndef FEAT_GUI_NEXTAW
+ XtNlimitThumb, 1,
+#endif
+ NULL);
+
+ XtAddCallback(selFileHScrolls[n], XtNjumpProc,
+ (XtCallbackProc)SFhSliderMovedCallback, (XtPointer)n);
+ XtAddCallback(selFileHScrolls[n], XtNscrollProc,
+ (XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)n);
+ }
+
+ selFileOK = XtVaCreateManagedWidget("selFileOK",
+ commandWidgetClass, selFileForm,
+ XtNlabel, ok,
+ XtNresizable, True,
+ XtNcallback, SFokSelect,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFfore,
+ XtNfromHoriz, selFileLists[0],
+ XtNfromVert, selFileLists[0],
+ XtNvertDistance, 30,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ NULL);
+
+ selFileCancel = XtVaCreateManagedWidget("selFileCancel",
+ commandWidgetClass, selFileForm,
+ XtNlabel, cancel,
+ XtNresizable, True,
+ XtNcallback, SFcancelSelect,
+ XtNforeground, SFfore,
+ XtNbackground, SFback,
+ XtNborderColor, SFfore,
+ XtNfromHoriz, selFileOK,
+ XtNfromVert, selFileLists[0],
+ XtNhorizDistance, 30,
+ XtNvertDistance, 30,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ NULL);
+
+ XtSetMappedWhenManaged(selFile, False);
+ XtRealizeWidget(selFile);
+
+ /* Add WM_DELETE_WINDOW protocol */
+ SFwmDeleteWindow = XInternAtom(SFdisplay, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(SFdisplay, XtWindow(selFile), &SFwmDeleteWindow, 1);
+
+ SFcreateGC();
+
+ for (n = 0; n < 3; n++)
+ {
+ XtAddEventHandler(selFileLists[n], ExposureMask, True,
+ (XtEventHandler)SFexposeList, (XtPointer)n);
+ XtAddEventHandler(selFileLists[n], EnterWindowMask, False,
+ (XtEventHandler)SFenterList, (XtPointer)n);
+ XtAddEventHandler(selFileLists[n], LeaveWindowMask, False,
+ (XtEventHandler)SFleaveList, (XtPointer)n);
+ XtAddEventHandler(selFileLists[n], PointerMotionMask, False,
+ (XtEventHandler)SFmotionList, (XtPointer)n);
+ XtAddEventHandler(selFileLists[n], ButtonPressMask, False,
+ (XtEventHandler)SFbuttonPressList, (XtPointer)n);
+ XtAddEventHandler(selFileLists[n], ButtonReleaseMask, False,
+ (XtEventHandler)SFbuttonReleaseList, (XtPointer)n);
+ }
+
+ XtAddEventHandler(selFileField, KeyPressMask, False,
+ SFmodVerifyCallback, (XtPointer)NULL);
+
+ SFapp = XtWidgetToApplicationContext(selFile);
+}
+
+ static void
+SFtextChanged()
+{
+#if defined(FEAT_XFONTSET) && defined(XtNinternational)
+ if (_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
+ {
+ wchar_t *wcbuf=(wchar_t *)SFtextBuffer;
+
+ if ((wcbuf[0] == L'/') || (wcbuf[0] == L'~'))
+ {
+ (void) wcstombs(SFcurrentPath, wcbuf, MAXPATHL);
+ SFtextPos = XawTextGetInsertionPoint(selFileField);
+ }
+ else
+ {
+ strcpy(SFcurrentPath, SFstartDir);
+ (void) wcstombs(SFcurrentPath + strlen(SFcurrentPath), wcbuf, MAXPATHL);
+
+ SFtextPos = XawTextGetInsertionPoint(selFileField) + strlen(SFstartDir);
+ }
+ }
+ else
+#endif
+ if ((SFtextBuffer[0] == '/') || (SFtextBuffer[0] == '~'))
+ {
+ (void) strcpy(SFcurrentPath, SFtextBuffer);
+ SFtextPos = XawTextGetInsertionPoint(selFileField);
+ }
+ else
+ {
+ (void) strcat(strcpy(SFcurrentPath, SFstartDir), SFtextBuffer);
+
+ SFtextPos = XawTextGetInsertionPoint(selFileField) + strlen(SFstartDir);
+ }
+
+ if (!SFworkProcAdded)
+ {
+ (void) XtAppAddWorkProc(SFapp, (XtWorkProc)SFworkProc, NULL);
+ SFworkProcAdded = 1;
+ }
+
+ SFupdatePath();
+}
+
+ static char *
+SFgetText()
+{
+#if defined(FEAT_XFONTSET) && defined(XtNinternational)
+ char *buf;
+
+ if (_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
+ {
+ wchar_t *wcbuf;
+ int mbslength;
+
+ XtVaGetValues(selFileField,
+ XtNstring, &wcbuf,
+ NULL);
+ mbslength = wcstombs(NULL, wcbuf, 0);
+ /* Hack: some broken wcstombs() returns zero, just get a large buffer */
+ if (mbslength == 0 && wcbuf != NULL && wcbuf[0] != 0)
+ mbslength = MAXPATHL;
+ buf=(char *)XtMalloc(mbslength + 1);
+ wcstombs(buf, wcbuf, mbslength +1);
+ return buf;
+ }
+#endif
+ return (char *)vim_strsave((char_u *)SFtextBuffer);
+}
+
+ static void
+SFprepareToReturn()
+{
+ SFstatus = SEL_FILE_NULL;
+ XtRemoveGrab(selFile);
+ XtUnmapWidget(selFile);
+ XtRemoveTimeOut(SFdirModTimerId);
+ if (SFchdir(SFstartDir))
+ {
+ EMSG(_("E614: vim_SelFile: can't return to current directory"));
+ SFstatus = SEL_FILE_CANCEL;
+ }
+}
+
+ char *
+vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, scroll_bg)
+ Widget toplevel;
+ char *prompt;
+ char *init_path;
+ int (*show_entry)();
+ int x, y;
+ guicolor_T fg, bg;
+ guicolor_T scroll_fg, scroll_bg; /* The "Scrollbar" group colors */
+{
+ static int firstTime = 1;
+ XEvent event;
+ char *name_return;
+
+ if (prompt == NULL)
+ prompt = _("Pathname:");
+ SFfore = fg;
+ SFback = bg;
+
+ if (mch_dirname((char_u *)SFstartDir, MAXPATHL) == FAIL)
+ {
+ EMSG(_("E615: vim_SelFile: can't get current directory"));
+ return NULL;
+ }
+
+ if (firstTime)
+ {
+ firstTime = 0;
+ SFdisplay = XtDisplay(toplevel);
+ SFcreateWidgets(toplevel, prompt, _("OK"), _("Cancel"));
+ }
+ else
+ {
+ XtVaSetValues(selFilePrompt, XtNlabel, prompt, NULL);
+ XtVaSetValues(selFile, XtNtitle, prompt, NULL);
+ SFsetColors(bg, fg, scroll_bg, scroll_fg);
+ }
+
+ XtVaSetValues(selFile, XtNx, x, XtNy, y, NULL);
+ XtMapWidget(selFile);
+
+ (void)strcat(SFstartDir, "/");
+ (void)strcpy(SFcurrentDir, SFstartDir);
+
+ if (init_path)
+ {
+ if (init_path[0] == '/')
+ {
+ (void)strcpy(SFcurrentPath, init_path);
+ if (strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir)))
+ SFsetText(SFcurrentPath);
+ else
+ SFsetText(&(SFcurrentPath[strlen(SFstartDir)]));
+ }
+ else
+ {
+ (void)strcat(strcpy(SFcurrentPath, SFstartDir), init_path);
+ SFsetText(&(SFcurrentPath[strlen(SFstartDir)]));
+ }
+ }
+ else
+ (void)strcpy(SFcurrentPath, SFstartDir);
+
+ SFfunc = show_entry;
+
+ SFtextChanged();
+
+ XtAddGrab(selFile, True, True);
+
+ SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
+ SFdirModTimer, (XtPointer) NULL);
+
+ while (1)
+ {
+ XtAppNextEvent(SFapp, &event);
+ XtDispatchEvent(&event);
+ switch (SFstatus)
+ {
+ case SEL_FILE_TEXT:
+ SFstatus = SEL_FILE_NULL;
+ SFtextChanged();
+ break;
+ case SEL_FILE_OK:
+ name_return = SFgetText();
+ SFprepareToReturn();
+ return name_return;
+ case SEL_FILE_CANCEL:
+ SFprepareToReturn();
+ return NULL;
+ case SEL_FILE_NULL:
+ break;
+ }
+ }
+}
+#endif /* FEAT_BROWSE */
diff --git a/src/gui_at_sb.c b/src/gui_at_sb.c
new file mode 100644
index 000000000..5fe3afbbe
--- /dev/null
+++ b/src/gui_at_sb.c
@@ -0,0 +1,1213 @@
+/* vi:set ts=8 sts=4 sw=4: */
+/*
+ * MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL)
+ * Modifications Copyright 1992 by Mitch Trachtenberg
+ * Rights, permissions, and disclaimer of warranty are as in the DEC and MIT
+ * notice below.
+ * $XConsortium: Scrollbar.c,v 1.72 94/04/17 20:12:40 kaleb Exp $
+ */
+
+/*
+ * Modified for Vim by Bill Foster and Bram Moolenaar
+ */
+
+/*
+
+Copyright (c) 1987, 1988, 1994 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
+CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization from the X Consortium.
+
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted, provided that
+the above copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting documentation, and that
+the name of Digital not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL
+BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+*/
+
+/* ScrollBar.c */
+/* created by weissman, Mon Jul 7 13:20:03 1986 */
+/* converted by swick, Thu Aug 27 1987 */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+
+#include <X11/Xaw/XawInit.h>
+#include "vim.h"
+#include "gui_at_sb.h"
+
+#include <X11/Xmu/Drawing.h>
+
+/* Private definitions. */
+
+static char defaultTranslations[] =
+ "<Btn1Down>: NotifyScroll()\n\
+ <Btn2Down>: MoveThumb() NotifyThumb()\n\
+ <Btn3Down>: NotifyScroll()\n\
+ <Btn4Down>: ScrollOneLineUp()\n\
+ Shift<Btn4Down>: ScrollPageUp()\n\
+ <Btn5Down>: ScrollOneLineDown()\n\
+ Shift<Btn5Down>: ScrollPageDown()\n\
+ <Btn1Motion>: HandleThumb()\n\
+ <Btn3Motion>: HandleThumb()\n\
+ <Btn2Motion>: MoveThumb() NotifyThumb()\n\
+ <BtnUp>: EndScroll()";
+
+static float floatZero = 0.0;
+
+#define Offset(field) XtOffsetOf(ScrollbarRec, field)
+
+static XtResource resources[] =
+{
+ {XtNlength, XtCLength, XtRDimension, sizeof(Dimension),
+ Offset(scrollbar.length), XtRImmediate, (XtPointer) 1},
+ {XtNthickness, XtCThickness, XtRDimension, sizeof(Dimension),
+ Offset(scrollbar.thickness), XtRImmediate, (XtPointer) 14},
+ {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation),
+ Offset(scrollbar.orientation), XtRImmediate, (XtPointer) XtorientVertical},
+ {XtNscrollProc, XtCCallback, XtRCallback, sizeof(XtPointer),
+ Offset(scrollbar.scrollProc), XtRCallback, NULL},
+ {XtNthumbProc, XtCCallback, XtRCallback, sizeof(XtPointer),
+ Offset(scrollbar.thumbProc), XtRCallback, NULL},
+ {XtNjumpProc, XtCCallback, XtRCallback, sizeof(XtPointer),
+ Offset(scrollbar.jumpProc), XtRCallback, NULL},
+ {XtNthumb, XtCThumb, XtRBitmap, sizeof(Pixmap),
+ Offset(scrollbar.thumb), XtRImmediate, (XtPointer) XtUnspecifiedPixmap},
+ {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+ Offset(scrollbar.foreground), XtRString, XtDefaultForeground},
+ {XtNshown, XtCShown, XtRFloat, sizeof(float),
+ Offset(scrollbar.shown), XtRFloat, (XtPointer)&floatZero},
+ {XtNtopOfThumb, XtCTopOfThumb, XtRFloat, sizeof(float),
+ Offset(scrollbar.top), XtRFloat, (XtPointer)&floatZero},
+ {XtNmaxOfThumb, XtCMaxOfThumb, XtRFloat, sizeof(float),
+ Offset(scrollbar.max), XtRFloat, (XtPointer)&floatZero},
+ {XtNminimumThumb, XtCMinimumThumb, XtRDimension, sizeof(Dimension),
+ Offset(scrollbar.min_thumb), XtRImmediate, (XtPointer) 7},
+ {XtNshadowWidth, XtCShadowWidth, XtRDimension, sizeof(Dimension),
+ Offset(scrollbar.shadow_width), XtRImmediate, (XtPointer) 1},
+ {XtNtopShadowPixel, XtCTopShadowPixel, XtRPixel, sizeof(Pixel),
+ Offset(scrollbar.top_shadow_pixel), XtRString, XtDefaultBackground},
+ {XtNbottomShadowPixel, XtCBottomShadowPixel, XtRPixel, sizeof(Pixel),
+ Offset(scrollbar.bot_shadow_pixel), XtRString, XtDefaultForeground},
+ {XtNlimitThumb, XtCLimitThumb, XtRBool, sizeof(Bool),
+ Offset(scrollbar.limit_thumb), XtRImmediate, (XtPointer)0}
+};
+#undef Offset
+
+static void ClassInitialize __ARGS((void));
+static void Initialize __ARGS((Widget, Widget, ArgList, Cardinal *));
+static void Destroy __ARGS((Widget));
+static void Realize __ARGS((Widget, Mask *, XSetWindowAttributes *));
+static void Resize __ARGS((Widget));
+static void Redisplay __ARGS((Widget, XEvent *, Region));
+static Boolean SetValues __ARGS((Widget, Widget, Widget, ArgList, Cardinal *));
+
+static void HandleThumb __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void MoveThumb __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void NotifyThumb __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void NotifyScroll __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void EndScroll __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void ScrollOneLineUp __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void ScrollOneLineDown __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void ScrollPageUp __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void ScrollPageDown __ARGS((Widget, XEvent *, String *, Cardinal *));
+static void ScrollSome __ARGS((Widget w, XEvent *event, int call_data));
+static void _Xaw3dDrawShadows __ARGS((Widget, XEvent *, Region, int));
+static void AllocTopShadowGC __ARGS((Widget));
+static void AllocBotShadowGC __ARGS((Widget));
+
+static XtActionsRec actions[] =
+{
+ {"HandleThumb", HandleThumb},
+ {"MoveThumb", MoveThumb},
+ {"NotifyThumb", NotifyThumb},
+ {"NotifyScroll", NotifyScroll},
+ {"EndScroll", EndScroll},
+ {"ScrollOneLineUp", ScrollOneLineUp},
+ {"ScrollOneLineDown", ScrollOneLineDown},
+ {"ScrollPageUp", ScrollPageUp},
+ {"ScrollPageDown", ScrollPageDown}
+};
+
+
+ScrollbarClassRec vim_scrollbarClassRec =
+{
+ { /* core fields */
+ /* superclass */ (WidgetClass) &simpleClassRec,
+ /* class_name */ "Scrollbar",
+ /* size */ sizeof(ScrollbarRec),
+ /* class_initialize */ ClassInitialize,
+ /* class_part_init */ NULL,
+ /* class_inited */ FALSE,
+ /* initialize */ Initialize,
+ /* initialize_hook */ NULL,
+ /* realize */ Realize,
+ /* actions */ actions,
+ /* num_actions */ XtNumber(actions),
+ /* resources */ resources,
+ /* num_resources */ XtNumber(resources),
+ /* xrm_class */ NULLQUARK,
+ /* compress_motion */ TRUE,
+ /* compress_exposure*/ TRUE,
+ /* compress_enterleave*/ TRUE,
+ /* visible_interest */ FALSE,
+ /* destroy */ Destroy,
+ /* resize */ Resize,
+ /* expose */ Redisplay,
+ /* set_values */ SetValues,
+ /* set_values_hook */ NULL,
+ /* set_values_almost */ XtInheritSetValuesAlmost,
+ /* get_values_hook */ NULL,
+ /* accept_focus */ NULL,
+ /* version */ XtVersion,
+ /* callback_private */ NULL,
+ /* tm_table */ defaultTranslations,
+ /* query_geometry */ XtInheritQueryGeometry,
+ /* display_accelerator*/ XtInheritDisplayAccelerator,
+ /* extension */ NULL
+ },
+ { /* simple fields */
+ /* change_sensitive */ XtInheritChangeSensitive
+ },
+ { /* scrollbar fields */
+ /* ignore */ 0
+ }
+};
+
+WidgetClass vim_scrollbarWidgetClass = (WidgetClass)&vim_scrollbarClassRec;
+
+#define NoButton -1
+#define PICKLENGTH(widget, x, y) \
+ ((widget->scrollbar.orientation == XtorientHorizontal) ? (x) : (y))
+#define AT_MIN(x,y) ((x) < (y) ? (x) : (y))
+#define AT_MAX(x,y) ((x) > (y) ? (x) : (y))
+
+#define LINE_DELAY 300
+#define PAGE_DELAY 300
+#define LINE_REPEAT 50
+#define PAGE_REPEAT 250
+
+ static void
+ClassInitialize()
+{
+ XawInitializeWidgetSet();
+ XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation,
+ (XtConvertArgList)NULL, (Cardinal)0 );
+}
+
+#define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width
+
+ static void
+FillArea(sbw, top, bottom, fill, draw_shadow)
+ ScrollbarWidget sbw;
+ Position top, bottom;
+ int fill;
+ int draw_shadow;
+{
+ int tlen = bottom - top; /* length of thumb in pixels */
+ int sw, margin, floor;
+ int lx, ly, lw, lh;
+
+ if (bottom <= 0 || bottom <= top)
+ return;
+ if ((sw = sbw->scrollbar.shadow_width) < 0)
+ sw = 0;
+ margin = MARGIN (sbw);
+ floor = sbw->scrollbar.length - margin + 2;
+
+ if (sbw->scrollbar.orientation == XtorientHorizontal)
+ {
+ lx = ((top < margin) ? margin : top);
+ ly = sw;
+ lw = (((top + tlen) > floor) ? floor - top : tlen);
+ lh = sbw->core.height - 2 * sw;
+ }
+ else
+ {
+ lx = sw;
+ ly = ((top < margin) ? margin : top);
+ lw = sbw->core.width - 2 * sw;
+ lh = (((top + tlen) > floor) ? floor - top : tlen);
+ }
+ if (lh <= 0 || lw <= 0)
+ return;
+
+ if (draw_shadow)
+ {
+ if (!(sbw->scrollbar.orientation == XtorientHorizontal))
+ {
+ /* Top border */
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ lx, ly, lx + lw - 1, ly);
+
+ /* Bottom border */
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ lx, ly + lh - 1, lx + lw - 1, ly + lh - 1);
+ }
+ else
+ {
+ /* Left border */
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ lx, ly, lx, ly + lh - 1);
+
+ /* Right border */
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ lx + lw - 1, ly, lx + lw - 1, ly + lh - 1);
+ }
+ return;
+ }
+
+ if (fill)
+ {
+ XFillRectangle(XtDisplay((Widget) sbw), XtWindow((Widget) sbw),
+ sbw->scrollbar.gc,
+ lx, ly, (unsigned int) lw, (unsigned int) lh);
+
+ if (!(sbw->scrollbar.orientation == XtorientHorizontal))
+ {
+ /* Left border */
+ XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ lx, ly, lx, ly + lh - 1);
+
+ /* Right border */
+ XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ lx + lw - 1, ly, lx + lw - 1, ly + lh - 1);
+ }
+ else
+ {
+ /* Top border */
+ XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ lx, ly, lx + lw - 1, ly);
+
+ /* Bottom border */
+ XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ lx, ly + lh - 1, lx + lw - 1, ly + lh - 1);
+ }
+ }
+ else
+ {
+ XClearArea(XtDisplay((Widget) sbw), XtWindow((Widget) sbw),
+ lx, ly, (unsigned int) lw, (unsigned int) lh, FALSE);
+ }
+}
+
+/* Paint the thumb in the area specified by sbw->top and
+ sbw->shown. The old area is erased. The painting and
+ erasing is done cleverly so that no flickering will occur.
+ */
+
+ static void
+PaintThumb(sbw)
+ ScrollbarWidget sbw;
+{
+ Position oldtop, oldbot, newtop, newbot;
+ Dimension margin, tzl;
+
+ margin = MARGIN (sbw);
+ tzl = sbw->scrollbar.length - 2 * margin;
+ newtop = margin + (int)(tzl * sbw->scrollbar.top);
+ newbot = newtop + (int)(tzl * sbw->scrollbar.shown) + 1;
+ if (newbot < newtop + (int)sbw->scrollbar.min_thumb)
+ newbot = newtop + sbw->scrollbar.min_thumb;
+
+ oldtop = sbw->scrollbar.topLoc;
+ oldbot = oldtop + sbw->scrollbar.shownLength;
+ sbw->scrollbar.topLoc = newtop;
+ sbw->scrollbar.shownLength = newbot - newtop;
+ if (XtIsRealized ((Widget) sbw))
+ {
+ if (newtop < oldtop)
+ FillArea(sbw, newtop, AT_MIN(newbot, oldtop+1),1,0);
+ if (newtop > oldtop)
+ FillArea(sbw, oldtop, AT_MIN(newtop, oldbot ),0,0);
+ if (newbot < oldbot)
+ FillArea(sbw, AT_MAX(newbot, oldtop), oldbot, 0,0);
+ if (newbot > oldbot)
+ FillArea(sbw, AT_MAX(newtop, oldbot-1), newbot, 1,0);
+
+ /* Only draw the missing shadows */
+ FillArea(sbw, newtop, newbot, 0, 1);
+ }
+}
+
+ static void
+PaintArrows(sbw)
+ ScrollbarWidget sbw;
+{
+ XPoint point[6];
+ Dimension thickness = sbw->scrollbar.thickness - 1;
+ Dimension size;
+ Dimension off;
+
+ if (XtIsRealized((Widget) sbw))
+ {
+ if ((int)thickness * 2 > (int)sbw->scrollbar.length)
+ {
+ size = sbw->scrollbar.length / 2;
+ off = (int)(thickness - size) / 2;
+ }
+ else
+ {
+ size = thickness;
+ off = 0;
+ }
+ point[0].x = off + sbw->scrollbar.shadow_width;
+ point[0].y = size;
+ point[1].x = thickness - off - sbw->scrollbar.shadow_width;
+ point[1].y = size;
+ point[2].x = thickness / 2;
+ point[2].y = sbw->scrollbar.shadow_width;
+
+ point[3].x = off + sbw->scrollbar.shadow_width;
+ point[3].y = sbw->scrollbar.length - size;
+ point[4].x = thickness - off - sbw->scrollbar.shadow_width;
+ point[4].y = sbw->scrollbar.length - size;
+ point[5].x = thickness / 2;
+ point[5].y = sbw->scrollbar.length - sbw->scrollbar.shadow_width - 1;
+
+ /* horizontal arrows require that x and y coordinates be swapped */
+ if (sbw->scrollbar.orientation == XtorientHorizontal)
+ {
+ int n;
+ int swap;
+ for (n = 0; n < 6; n++)
+ {
+ swap = point[n].x;
+ point[n].x = point[n].y;
+ point[n].y = swap;
+ }
+ }
+ /* draw the up/left arrow */
+ XFillPolygon (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.gc,
+ point, 3,
+ Convex, CoordModeOrigin);
+ XDrawLines (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ point, 3,
+ CoordModeOrigin);
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ point[0].x, point[0].y,
+ point[2].x, point[2].y);
+ /* draw the down/right arrow */
+ XFillPolygon (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.gc,
+ point+3, 3,
+ Convex, CoordModeOrigin);
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ point[3].x, point[3].y,
+ point[4].x, point[4].y);
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.top_shadow_GC,
+ point[3].x, point[3].y,
+ point[5].x, point[5].y);
+ XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
+ sbw->scrollbar.bot_shadow_GC,
+ point[4].x, point[4].y,
+ point[5].x, point[5].y);
+ }
+}
+
+ static void
+Destroy(w)
+ Widget w;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ if (sbw->scrollbar.timer_id != (XtIntervalId) 0)
+ XtRemoveTimeOut (sbw->scrollbar.timer_id);
+ XtReleaseGC(w, sbw->scrollbar.gc);
+ XtReleaseGC(w, sbw->scrollbar.top_shadow_GC);
+ XtReleaseGC(w, sbw->scrollbar.bot_shadow_GC);
+}
+
+ static void
+CreateGC(w)
+ Widget w;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ XGCValues gcValues;
+ XtGCMask mask;
+ unsigned int depth = 1;
+
+ if (sbw->scrollbar.thumb == XtUnspecifiedPixmap)
+ {
+ sbw->scrollbar.thumb = XmuCreateStippledPixmap (XtScreen(w),
+ (Pixel) 1, (Pixel) 0, depth);
+ }
+ else if (sbw->scrollbar.thumb != None)
+ {
+ Window root;
+ int x, y;
+ unsigned int width, height, bw;
+
+ if (XGetGeometry (XtDisplay(w), sbw->scrollbar.thumb, &root, &x, &y,
+ &width, &height, &bw, &depth) == 0)
+ EMSG(_("Scrollbar Widget: Could not get geometry of thumb pixmap."));
+ }
+
+ gcValues.foreground = sbw->scrollbar.foreground;
+ gcValues.background = sbw->core.background_pixel;
+ mask = GCForeground | GCBackground;
+
+ if (sbw->scrollbar.thumb != None)
+ {
+ gcValues.fill_style = FillSolid;
+ mask |= GCFillStyle;
+ }
+ /* the creation should be non-caching, because */
+ /* we now set and clear clip masks on the gc returned */
+ sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues);
+}
+
+ static void
+SetDimensions(sbw)
+ ScrollbarWidget sbw;
+{
+ if (sbw->scrollbar.orientation == XtorientVertical)
+ {
+ sbw->scrollbar.length = sbw->core.height;
+ sbw->scrollbar.thickness = sbw->core.width;
+ }
+ else
+ {
+ sbw->scrollbar.length = sbw->core.width;
+ sbw->scrollbar.thickness = sbw->core.height;
+ }
+}
+
+/* ARGSUSED */
+ static void
+Initialize(request, new, args, num_args)
+ Widget request; /* what the client asked for */
+ Widget new; /* what we're going to give him */
+ ArgList args;
+ Cardinal *num_args;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) new;
+
+ CreateGC(new);
+ AllocTopShadowGC(new);
+ AllocBotShadowGC(new);
+
+ if (sbw->core.width == 0)
+ sbw->core.width = (sbw->scrollbar.orientation == XtorientVertical)
+ ? sbw->scrollbar.thickness : sbw->scrollbar.length;
+
+ if (sbw->core.height == 0)
+ sbw->core.height = (sbw->scrollbar.orientation == XtorientHorizontal)
+ ? sbw->scrollbar.thickness : sbw->scrollbar.length;
+
+ SetDimensions(sbw);
+ sbw->scrollbar.scroll_mode = SMODE_NONE;
+ sbw->scrollbar.timer_id = (XtIntervalId)0;
+ sbw->scrollbar.topLoc = 0;
+ sbw->scrollbar.shownLength = sbw->scrollbar.min_thumb;
+}
+
+ static void
+Realize(w, valueMask, attributes)
+ Widget w;
+ Mask *valueMask;
+ XSetWindowAttributes *attributes;
+{
+ /* The Simple widget actually stuffs the value in the valuemask. */
+ (*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize)
+ (w, valueMask, attributes);
+}
+
+/* ARGSUSED */
+ static Boolean
+SetValues(current, request, desired, args, num_args)
+ Widget current, /* what I am */
+ request, /* what he wants me to be */
+ desired; /* what I will become */
+ ArgList args;
+ Cardinal *num_args;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) current;
+ ScrollbarWidget dsbw = (ScrollbarWidget) desired;
+ Boolean redraw = FALSE;
+
+/*
+ * If these values are outside the acceptable range ignore them...
+ */
+ if (dsbw->scrollbar.top < 0.0 || dsbw->scrollbar.top > 1.0)
+ dsbw->scrollbar.top = sbw->scrollbar.top;
+
+ if (dsbw->scrollbar.shown < 0.0 || dsbw->scrollbar.shown > 1.0)
+ dsbw->scrollbar.shown = sbw->scrollbar.shown;
+
+/*
+ * Change colors and stuff...
+ */
+ if (XtIsRealized(desired))
+ {
+ if (sbw->scrollbar.foreground != dsbw->scrollbar.foreground ||
+ sbw->core.background_pixel != dsbw->core.background_pixel ||
+ sbw->scrollbar.thumb != dsbw->scrollbar.thumb)
+ {
+ XtReleaseGC(desired, sbw->scrollbar.gc);
+ CreateGC (desired);
+ redraw = TRUE;
+ }
+ if (sbw->scrollbar.top != dsbw->scrollbar.top ||
+ sbw->scrollbar.shown != dsbw->scrollbar.shown)
+ redraw = TRUE;
+ }
+ return redraw;
+}
+
+ static void
+Resize(w)
+ Widget w;
+{
+ /* ForgetGravity has taken care of background, but thumb may
+ * have to move as a result of the new size. */
+ SetDimensions ((ScrollbarWidget) w);
+ Redisplay(w, (XEvent*) NULL, (Region)NULL);
+}
+
+
+/* ARGSUSED */
+ static void
+Redisplay(w, event, region)
+ Widget w;
+ XEvent *event;
+ Region region;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ int x, y;
+ unsigned int width, height;
+
+ _Xaw3dDrawShadows(w, event, region, FALSE);
+
+ if (sbw->scrollbar.orientation == XtorientHorizontal)
+ {
+ x = sbw->scrollbar.topLoc;
+ y = 1;
+ width = sbw->scrollbar.shownLength;
+ height = sbw->core.height - 2;
+ }
+ else
+ {
+ x = 1;
+ y = sbw->scrollbar.topLoc;
+ width = sbw->core.width - 2;
+ height = sbw->scrollbar.shownLength;
+ }
+ if (region == NULL ||
+ XRectInRegion (region, x, y, width, height) != RectangleOut)
+ {
+ /* Forces entire thumb to be painted. */
+ sbw->scrollbar.topLoc = -(sbw->scrollbar.length + 1);
+ PaintThumb (sbw);
+ }
+ /* we'd like to be region aware here!!!! */
+ PaintArrows(sbw);
+}
+
+
+ static Boolean
+CompareEvents(oldEvent, newEvent)
+ XEvent *oldEvent, *newEvent;
+{
+#define Check(field) if (newEvent->field != oldEvent->field) return False;
+
+ Check(xany.display);
+ Check(xany.type);
+ Check(xany.window);
+
+ switch (newEvent->type)
+ {
+ case MotionNotify:
+ Check(xmotion.state);
+ break;
+ case ButtonPress:
+ case ButtonRelease:
+ Check(xbutton.state);
+ Check(xbutton.button);
+ break;
+ case KeyPress:
+ case KeyRelease:
+ Check(xkey.state);
+ Check(xkey.keycode);
+ break;
+ case EnterNotify:
+ case LeaveNotify:
+ Check(xcrossing.mode);
+ Check(xcrossing.detail);
+ Check(xcrossing.state);
+ break;
+ }
+#undef Check
+
+ return True;
+}
+
+struct EventData
+{
+ XEvent *oldEvent;
+ int count;
+};
+
+ static Bool
+PeekNotifyEvent(dpy, event, args)
+ Display *dpy;
+ XEvent *event;
+ char *args;
+{
+ struct EventData *eventData = (struct EventData*)args;
+
+ return ((++eventData->count == QLength(dpy)) /* since PeekIf blocks */
+ || CompareEvents(event, eventData->oldEvent));
+}
+
+
+ static Boolean
+LookAhead(w, event)
+ Widget w;
+ XEvent *event;
+{
+ XEvent newEvent;
+ struct EventData eventData;
+
+ if (QLength (XtDisplay (w)) == 0)
+ return False;
+
+ eventData.count = 0;
+ eventData.oldEvent = event;
+
+ XPeekIfEvent (XtDisplay (w), &newEvent, PeekNotifyEvent, (char*)&eventData);
+
+ return CompareEvents (event, &newEvent);
+}
+
+
+ static void
+ExtractPosition(event, x, y, state)
+ XEvent *event;
+ Position *x, *y; /* RETURN */
+ unsigned int *state; /* RETURN */
+{
+ switch (event->type)
+ {
+ case MotionNotify:
+ *x = event->xmotion.x;
+ *y = event->xmotion.y;
+ if (state != NULL)
+ *state = event->xmotion.state;
+ break;
+ case ButtonPress:
+ case ButtonRelease:
+ *x = event->xbutton.x;
+ *y = event->xbutton.y;
+ if (state != NULL)
+ *state = event->xbutton.state;
+ break;
+ case KeyPress:
+ case KeyRelease:
+ *x = event->xkey.x;
+ *y = event->xkey.y;
+ if (state != NULL)
+ *state = event->xkey.state;
+ break;
+ case EnterNotify:
+ case LeaveNotify:
+ *x = event->xcrossing.x;
+ *y = event->xcrossing.y;
+ if (state != NULL)
+ *state = event->xcrossing.state;
+ break;
+ default:
+ *x = 0; *y = 0;
+ if (state != NULL)
+ *state = 0;
+ }
+}
+
+ static void
+HandleThumb(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ Position x, y, loc;
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+
+ ExtractPosition(event, &x, &y, (unsigned int *)NULL);
+ loc = PICKLENGTH(sbw, x, y);
+ /* if the motion event puts the pointer in thumb, call Move and Notify */
+ /* also call Move and Notify if we're already in continuous scroll mode */
+ if (sbw->scrollbar.scroll_mode == SMODE_CONT ||
+ (loc >= sbw->scrollbar.topLoc &&
+ loc <= sbw->scrollbar.topLoc + (int)sbw->scrollbar.shownLength))
+ {
+ XtCallActionProc(w, "MoveThumb", event, params, *num_params);
+ XtCallActionProc(w, "NotifyThumb", event, params, *num_params);
+ }
+}
+
+/* ARGSUSED */
+ static void
+RepeatNotify(client_data, idp)
+ XtPointer client_data;
+ XtIntervalId *idp;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) client_data;
+ int call_data;
+ char mode = sbw->scrollbar.scroll_mode;
+ unsigned long rep;
+
+ if (mode == SMODE_NONE || mode == SMODE_CONT)
+ {
+ sbw->scrollbar.timer_id = (XtIntervalId)0;
+ return;
+ }
+
+ if (mode == SMODE_LINE_DOWN || mode == SMODE_LINE_UP)
+ {
+ call_data = ONE_LINE_DATA;
+ rep = LINE_REPEAT;
+ }
+ else
+ {
+ call_data = ONE_PAGE_DATA;
+ rep = PAGE_REPEAT;
+ }
+
+ if (mode == SMODE_PAGE_UP || mode == SMODE_LINE_UP)
+ call_data = -call_data;
+
+ XtCallCallbacks((Widget)sbw, XtNscrollProc, (XtPointer)call_data);
+
+ sbw->scrollbar.timer_id =
+ XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)sbw),
+ rep,
+ RepeatNotify,
+ client_data);
+}
+
+/*
+ * Same as above, but for floating numbers.
+ */
+ static float
+FloatInRange(num, small, big)
+ float num, small, big;
+{
+ return (num < small) ? small : ((num > big) ? big : num);
+}
+
+/* ARGSUSED */
+ static void
+ScrollOneLineUp(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ ScrollSome(w, event, -ONE_LINE_DATA);
+}
+
+/* ARGSUSED */
+ static void
+ScrollOneLineDown(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ ScrollSome(w, event, ONE_LINE_DATA);
+}
+
+/* ARGSUSED */
+ static void
+ScrollPageDown(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ ScrollSome(w, event, ONE_PAGE_DATA);
+}
+
+/* ARGSUSED */
+ static void
+ScrollPageUp(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ ScrollSome(w, event, -ONE_PAGE_DATA);
+}
+
+ static void
+ScrollSome(w, event, call_data)
+ Widget w;
+ XEvent *event;
+ int call_data;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+
+ if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */
+ return;
+
+ if (LookAhead(w, event))
+ return;
+
+ sbw->scrollbar.scroll_mode = SMODE_LINE_UP;
+ XtCallCallbacks(w, XtNscrollProc, (XtPointer)call_data);
+}
+
+/* ARGSUSED */
+ static void
+NotifyScroll(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params;
+ Cardinal *num_params;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ Position x, y, loc;
+ Dimension arrow_size;
+ unsigned long delay = 0;
+ int call_data = 0;
+ unsigned int state;
+
+ if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */
+ return;
+
+ if (LookAhead (w, event))
+ return;
+
+ ExtractPosition(event, &x, &y, &state);
+ loc = PICKLENGTH(sbw, x, y);
+
+ if ((int)sbw->scrollbar.thickness * 2 > (int)sbw->scrollbar.length)
+ arrow_size = sbw->scrollbar.length / 2;
+ else
+ arrow_size = sbw->scrollbar.thickness;
+
+ /*
+ * handle CTRL modifier
+ */
+ if (state & ControlMask)
+ {
+ if (loc > sbw->scrollbar.topLoc + (Position)sbw->scrollbar.shownLength)
+ call_data = END_PAGE_DATA;
+ else
+ call_data = -END_PAGE_DATA;
+ sbw->scrollbar.scroll_mode = SMODE_NONE;
+ }
+ /*
+ * handle first arrow zone
+ */
+ else if (loc < (Position)arrow_size)
+ {
+ call_data = -ONE_LINE_DATA;
+ sbw->scrollbar.scroll_mode = SMODE_LINE_UP;
+ delay = LINE_DELAY;
+ }
+
+ /*
+ * handle last arrow zone
+ */
+ else if (loc > (Position)(sbw->scrollbar.length - arrow_size))
+ {
+ call_data = ONE_LINE_DATA;
+ sbw->scrollbar.scroll_mode = SMODE_LINE_DOWN;
+ delay = LINE_DELAY;
+ }
+
+ /*
+ * handle zone "above" the thumb
+ */
+ else if (loc < sbw->scrollbar.topLoc)
+ {
+ call_data = -ONE_PAGE_DATA;
+ sbw->scrollbar.scroll_mode = SMODE_PAGE_UP;
+ delay = PAGE_DELAY;
+ }
+
+ /*
+ * handle zone "below" the thumb
+ */
+ else if (loc > sbw->scrollbar.topLoc + (Position)sbw->scrollbar.shownLength)
+ {
+ call_data = ONE_PAGE_DATA;
+ sbw->scrollbar.scroll_mode = SMODE_PAGE_DOWN;
+ delay = PAGE_DELAY;
+ }
+
+ if (call_data)
+ XtCallCallbacks(w, XtNscrollProc, (XtPointer)call_data);
+
+ /* establish autoscroll */
+ if (delay)
+ sbw->scrollbar.timer_id =
+ XtAppAddTimeOut(XtWidgetToApplicationContext(w),
+ delay, RepeatNotify, (XtPointer)w);
+}
+
+/* ARGSUSED */
+ static void
+EndScroll(w, event, params, num_params)
+ Widget w;
+ XEvent *event; /* unused */
+ String *params; /* unused */
+ Cardinal *num_params; /* unused */
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+
+ sbw->scrollbar.scroll_mode = SMODE_NONE;
+ /* no need to remove any autoscroll timeout; it will no-op */
+ /* because the scroll_mode is SMODE_NONE */
+ /* but be sure to remove timeout in destroy proc */
+}
+
+ static float
+FractionLoc(sbw, x, y)
+ ScrollbarWidget sbw;
+ int x, y;
+{
+ int margin;
+ float height, width;
+
+ margin = MARGIN(sbw);
+ x -= margin;
+ y -= margin;
+ height = (float)sbw->core.height - 2 * margin;
+ width = (float)sbw->core.width - 2 * margin;
+ return PICKLENGTH(sbw, x / width, y / height);
+}
+
+/* ARGSUSED */
+ static void
+MoveThumb(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params; /* unused */
+ Cardinal *num_params; /* unused */
+{
+ ScrollbarWidget sbw = (ScrollbarWidget)w;
+ Position x, y;
+ float top;
+ char old_mode = sbw->scrollbar.scroll_mode;
+
+ sbw->scrollbar.scroll_mode = SMODE_CONT; /* indicate continuous scroll */
+
+ if (LookAhead(w, event))
+ return;
+
+ if (!event->xmotion.same_screen)
+ return;
+
+ ExtractPosition(event, &x, &y, (unsigned int *)NULL);
+
+ top = FractionLoc(sbw, x, y);
+
+ if (old_mode != SMODE_CONT) /* start dragging: set offset */
+ {
+ if (event->xbutton.button == Button2)
+ sbw->scrollbar.scroll_off = sbw->scrollbar.shown / 2.;
+ else
+ sbw->scrollbar.scroll_off = top - sbw->scrollbar.top;
+ }
+
+ top -= sbw->scrollbar.scroll_off;
+ if (sbw->scrollbar.limit_thumb)
+ top = FloatInRange(top, 0.0,
+ sbw->scrollbar.max - sbw->scrollbar.shown + 0.000001);
+ else
+ top = FloatInRange(top, 0.0, sbw->scrollbar.max);
+
+ sbw->scrollbar.top = top;
+ PaintThumb(sbw);
+ XFlush(XtDisplay(w)); /* re-draw it before Notifying */
+}
+
+
+/* ARGSUSED */
+ static void
+NotifyThumb(w, event, params, num_params)
+ Widget w;
+ XEvent *event;
+ String *params; /* unused */
+ Cardinal *num_params; /* unused */
+{
+ ScrollbarWidget sbw = (ScrollbarWidget)w;
+
+ if (LookAhead(w, event))
+ return;
+
+ /* thumbProc is not pretty, but is necessary for backwards
+ compatibility on those architectures for which it work{s,ed};
+ the intent is to pass a (truncated) float by value. */
+ XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
+ XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
+}
+
+/* ARGSUSED */
+ static void
+AllocTopShadowGC(w)
+ Widget w;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ XtGCMask valuemask;
+ XGCValues myXGCV;
+
+ valuemask = GCForeground;
+ myXGCV.foreground = sbw->scrollbar.top_shadow_pixel;
+ sbw->scrollbar.top_shadow_GC = XtGetGC(w, valuemask, &myXGCV);
+}
+
+/* ARGSUSED */
+ static void
+AllocBotShadowGC(w)
+ Widget w;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+ XtGCMask valuemask;
+ XGCValues myXGCV;
+
+ valuemask = GCForeground;
+ myXGCV.foreground = sbw->scrollbar.bot_shadow_pixel;
+ sbw->scrollbar.bot_shadow_GC = XtGetGC(w, valuemask, &myXGCV);
+}
+
+/* ARGSUSED */
+ static void
+_Xaw3dDrawShadows(gw, event, region, out)
+ Widget gw;
+ XEvent *event;
+ Region region;
+ int out;
+{
+ XPoint pt[6];
+ ScrollbarWidget sbw = (ScrollbarWidget) gw;
+ Dimension s = sbw->scrollbar.shadow_width;
+ /*
+ * draw the shadows using the core part width and height,
+ * and the scrollbar part shadow_width.
+ *
+ * no point to do anything if the shadow_width is 0 or the
+ * widget has not been realized.
+ */
+ if (s > 0 && XtIsRealized(gw))
+ {
+ Dimension h = sbw->core.height;
+ Dimension w = sbw->core.width;
+ Dimension wms = w - s;
+ Dimension hms = h - s;
+ Display *dpy = XtDisplay (gw);
+ Window win = XtWindow (gw);
+ GC top, bot;
+
+ if (out)
+ {
+ top = sbw->scrollbar.top_shadow_GC;
+ bot = sbw->scrollbar.bot_shadow_GC;
+ }
+ else
+ {
+ top = sbw->scrollbar.bot_shadow_GC;
+ bot = sbw->scrollbar.top_shadow_GC;
+ }
+
+ /* top-left shadow */
+ if ((region == NULL) ||
+ (XRectInRegion (region, 0, 0, w, s) != RectangleOut) ||
+ (XRectInRegion (region, 0, 0, s, h) != RectangleOut))
+ {
+ pt[0].x = 0; pt[0].y = h;
+ pt[1].x = pt[1].y = 0;
+ pt[2].x = w; pt[2].y = 0;
+ pt[3].x = wms; pt[3].y = s;
+ pt[4].x = pt[4].y = s;
+ pt[5].x = s; pt[5].y = hms;
+ XFillPolygon (dpy, win, top, pt, 6, Complex, CoordModeOrigin);
+ }
+
+ /* bottom-right shadow */
+ if ((region == NULL) ||
+ (XRectInRegion (region, 0, hms, w, s) != RectangleOut) ||
+ (XRectInRegion (region, wms, 0, s, h) != RectangleOut))
+ {
+ pt[0].x = 0; pt[0].y = h;
+ pt[1].x = w; pt[1].y = h;
+ pt[2].x = w; pt[2].y = 0;
+ pt[3].x = wms; pt[3].y = s;
+ pt[4].x = wms; pt[4].y = hms;
+ pt[5].x = s; pt[5].y = hms;
+ XFillPolygon (dpy, win, bot, pt, 6, Complex, CoordModeOrigin);
+ }
+ }
+}
+
+
+/*
+ * Set the scroll bar to the given location.
+ */
+ void
+vim_XawScrollbarSetThumb(w, top, shown, max)
+ Widget w;
+ double top, shown, max;
+{
+ ScrollbarWidget sbw = (ScrollbarWidget) w;
+
+ if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if still thumbing */
+ return;
+
+ sbw->scrollbar.max = (max > 1.0) ? 1.0 :
+ (max >= 0.0) ? max : sbw->scrollbar.max;
+
+ sbw->scrollbar.top = (top > sbw->scrollbar.max) ? sbw->scrollbar.max :
+ (top >= 0.0) ? top : sbw->scrollbar.top;
+
+ sbw->scrollbar.shown = (shown > 1.0) ? 1.0 :
+ (shown >= 0.0) ? shown : sbw->scrollbar.shown;
+
+ PaintThumb(sbw);
+}
diff --git a/src/gui_at_sb.h b/src/gui_at_sb.h
new file mode 100644
index 000000000..0d3d1967b
--- /dev/null
+++ b/src/gui_at_sb.h
@@ -0,0 +1,161 @@
+/* vi:set ts=8 sts=4 sw=4: */
+/* MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL) */
+/* Modifications Copyright 1992 by Mitch Trachtenberg */
+/* Rights, permissions, and disclaimer of warranty are as in the */
+/* DEC and MIT notice below. See usage warning in .c file. */
+/*
+ * $XConsortium: ScrollbarP.h,v 1.3 94/04/17 20:12:42 jim Exp $
+ */
+
+
+/***********************************************************
+
+Copyright (c) 1987, 1988 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef _Scrollbar_h
+#define _Scrollbar_h
+
+/****************************************************************
+ *
+ * Scrollbar Widget
+ *
+ ****************************************************************/
+
+#include <X11/IntrinsicP.h>
+#include <X11/Xaw/SimpleP.h>
+#include <X11/Xmu/Converters.h>
+
+/*
+ * Most things we need are in StringDefs.h
+ */
+#define XtCMinimumThumb "MinimumThumb"
+#define XtCShown "Shown"
+#define XtCTopOfThumb "TopOfThumb"
+#define XtCMaxOfThumb "MaxOfThumb"
+#define XtCShadowWidth "ShadowWidth"
+#define XtCTopShadowPixel "TopShadowPixel"
+#define XtCBottomShadowPixel "BottomShadowPixel"
+#define XtCLimitThumb "LimitThumb"
+
+#define XtNminimumThumb "minimumThumb"
+#define XtNtopOfThumb "topOfThumb"
+#define XtNmaxOfThumb "maxOfThumb"
+#define XtNshadowWidth "shadowWidth"
+#define XtNtopShadowPixel "topShadowPixel"
+#define XtNbottomShadowPixel "bottomShadowPixel"
+#define XtNlimitThumb "limitThumb"
+
+typedef struct _ScrollbarRec *ScrollbarWidget;
+typedef struct _ScrollbarClassRec *ScrollbarWidgetClass;
+
+extern WidgetClass vim_scrollbarWidgetClass;
+
+extern void vim_XawScrollbarSetThumb __ARGS((Widget, double, double, double));
+
+typedef struct
+{
+ /* public */
+ Pixel foreground; /* thumb foreground color */
+ XtOrientation orientation; /* horizontal or vertical */
+ XtCallbackList scrollProc; /* proportional scroll */
+ XtCallbackList thumbProc; /* jump (to position) scroll */
+ XtCallbackList jumpProc; /* same as thumbProc but pass data by ref */
+ Pixmap thumb; /* thumb color */
+ float top; /* What percent is above the win's top */
+ float shown; /* What percent is shown in the win */
+ float max; /* Maximum value for top */
+ Dimension length; /* either height or width */
+ Dimension thickness; /* either width or height */
+ Dimension min_thumb; /* minium size for the thumb. */
+
+ /* private */
+ XtIntervalId timer_id; /* autorepeat timer; remove on destruction */
+ char scroll_mode; /* see below */
+ float scroll_off; /* offset from event to top of thumb */
+ GC gc; /* a (shared) gc */
+ Position topLoc; /* Pixel that corresponds to top */
+ Dimension shownLength; /* Num pixels corresponding to shown */
+
+ /* From 3d widget */
+ Dimension shadow_width;
+ Pixel top_shadow_pixel;
+ Pixel bot_shadow_pixel;
+ Bool limit_thumb; /* limit thumb to inside scrollbar */
+ int top_shadow_contrast;
+ int bot_shadow_contrast;
+ GC top_shadow_GC;
+ GC bot_shadow_GC;
+} ScrollbarPart;
+
+#define SMODE_NONE 0
+#define SMODE_CONT 1
+#define SMODE_PAGE_UP 2
+#define SMODE_PAGE_DOWN 3
+#define SMODE_LINE_UP 4
+#define SMODE_LINE_DOWN 5
+
+#define ONE_LINE_DATA 1
+#define ONE_PAGE_DATA 10
+#define END_PAGE_DATA 9999
+
+typedef struct _ScrollbarRec {
+ CorePart core;
+ SimplePart simple;
+ ScrollbarPart scrollbar;
+} ScrollbarRec;
+
+typedef struct {int empty;} ScrollbarClassPart;
+
+typedef struct _ScrollbarClassRec {
+ CoreClassPart core_class;
+ SimpleClassPart simple_class;
+ ScrollbarClassPart scrollbar_class;
+} ScrollbarClassRec;
+
+extern ScrollbarClassRec vim_scrollbarClassRec;
+
+#endif /* _Scrollbar_h */
diff --git a/src/gui_athena.c b/src/gui_athena.c
new file mode 100644
index 000000000..51977eddc
--- /dev/null
+++ b/src/gui_athena.c
@@ -0,0 +1,2230 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ * Athena port by Bill Foster
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include <X11/StringDefs.h>
+#include <X11/Intrinsic.h>
+#ifdef FEAT_GUI_NEXTAW
+# include <X11/neXtaw/Form.h>
+# include <X11/neXtaw/SimpleMenu.h>
+# include <X11/neXtaw/MenuButton.h>
+# include <X11/neXtaw/SmeBSB.h>
+# include <X11/neXtaw/SmeLine.h>
+# include <X11/neXtaw/Box.h>
+# include <X11/neXtaw/Dialog.h>
+# include <X11/neXtaw/Text.h>
+# include <X11/neXtaw/AsciiText.h>
+# include <X11/neXtaw/Scrollbar.h>
+#else
+# include <X11/Xaw/Form.h>
+# include <X11/Xaw/SimpleMenu.h>
+# include <X11/Xaw/MenuButton.h>
+# include <X11/Xaw/SmeBSB.h>
+# include <X11/Xaw/SmeLine.h>
+# include <X11/Xaw/Box.h>
+# include <X11/Xaw/Dialog.h>
+# include <X11/Xaw/Text.h>
+# include <X11/Xaw/AsciiText.h>
+#endif /* FEAT_GUI_NEXTAW */
+
+#include "vim.h"
+#ifndef FEAT_GUI_NEXTAW
+# include "gui_at_sb.h"
+#endif
+
+extern Widget vimShell;
+
+static Widget vimForm = (Widget)0;
+static Widget textArea = (Widget)0;
+#ifdef FEAT_MENU
+static Widget menuBar = (Widget)0;
+static XtIntervalId timer = 0; /* 0 = expired, otherwise active */
+
+/* Used to figure out menu ordering */
+static vimmenu_T *a_cur_menu = NULL;
+static Cardinal athena_calculate_ins_pos __ARGS((Widget));
+
+static Pixmap gui_athena_create_pullright_pixmap __ARGS((Widget));
+static void gui_athena_menu_timeout __ARGS((XtPointer, XtIntervalId *));
+static void gui_athena_popup_callback __ARGS((Widget, XtPointer, XtPointer));
+static void gui_athena_delayed_arm_action __ARGS((Widget, XEvent *, String *,
+ Cardinal *));
+static void gui_athena_popdown_submenus_action __ARGS((Widget, XEvent *,
+ String *, Cardinal *));
+static XtActionsRec pullAction[2] = {
+ { "menu-delayedpopup", (XtActionProc)gui_athena_delayed_arm_action},
+ { "menu-popdownsubmenus", (XtActionProc)gui_athena_popdown_submenus_action}
+};
+#endif
+
+#ifdef FEAT_TOOLBAR
+static void gui_mch_reset_focus __ARGS((void));
+static Widget toolBar = (Widget)0;
+#endif
+
+static void gui_athena_scroll_cb_jump __ARGS((Widget, XtPointer, XtPointer));
+static void gui_athena_scroll_cb_scroll __ARGS((Widget, XtPointer, XtPointer));
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_MENU)
+static void gui_athena_menu_colors __ARGS((Widget id));
+#endif
+static void gui_athena_scroll_colors __ARGS((Widget id));
+
+#ifdef FEAT_MENU
+static XtTranslations popupTrans, parentTrans, menuTrans, supermenuTrans;
+static Pixmap pullerBitmap = None;
+static int puller_width = 0;
+#endif
+
+/*
+ * Scrollbar callback (XtNjumpProc) for when the scrollbar is dragged with the
+ * left or middle mouse button.
+ */
+/* ARGSUSED */
+ static void
+gui_athena_scroll_cb_jump(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data, call_data;
+{
+ scrollbar_T *sb, *sb_info;
+ long value;
+
+ sb = gui_find_scrollbar((long)client_data);
+
+ if (sb == NULL)
+ return;
+ else if (sb->wp != NULL) /* Left or right scrollbar */
+ {
+ /*
+ * Careful: need to get scrollbar info out of first (left) scrollbar
+ * for window, but keep real scrollbar too because we must pass it to
+ * gui_drag_scrollbar().
+ */
+ sb_info = &sb->wp->w_scrollbars[0];
+ }
+ else /* Bottom scrollbar */
+ sb_info = sb;
+
+ value = (long)(*((float *)call_data) * (float)(sb_info->max + 1) + 0.001);
+ if (value > sb_info->max)
+ value = sb_info->max;
+
+ gui_drag_scrollbar(sb, value, TRUE);
+}
+
+/*
+ * Scrollbar callback (XtNscrollProc) for paging up or down with the left or
+ * right mouse buttons.
+ */
+/* ARGSUSED */
+ static void
+gui_athena_scroll_cb_scroll(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data, call_data;
+{
+ scrollbar_T *sb, *sb_info;
+ long value;
+ int data = (int)(long)call_data;
+ int page;
+
+ sb = gui_find_scrollbar((long)client_data);
+
+ if (sb == NULL)
+ return;
+ if (sb->wp != NULL) /* Left or right scrollbar */
+ {
+ /*
+ * Careful: need to get scrollbar info out of first (left) scrollbar
+ * for window, but keep real scrollbar too because we must pass it to
+ * gui_drag_scrollbar().
+ */
+ sb_info = &sb->wp->w_scrollbars[0];
+
+ if (sb_info->size > 5)
+ page = sb_info->size - 2; /* use two lines of context */
+ else
+ page = sb_info->size;
+#ifdef FEAT_GUI_NEXTAW
+ if (data < 0)
+ {
+ data = (data - gui.char_height + 1) / gui.char_height;
+ if (data > -sb_info->size)
+ data = -1;
+ else
+ data = -page;
+ }
+ else if (data > 0)
+ {
+ data = (data + gui.char_height - 1) / gui.char_height;
+ if (data < sb_info->size)
+ data = 1;
+ else
+ data = page;
+ }
+#else
+ switch (data)
+ {
+ case ONE_LINE_DATA: data = 1; break;
+ case -ONE_LINE_DATA: data = -1; break;
+ case ONE_PAGE_DATA: data = page; break;
+ case -ONE_PAGE_DATA: data = -page; break;
+ case END_PAGE_DATA: data = sb_info->max; break;
+ case -END_PAGE_DATA: data = -sb_info->max; break;
+ default: data = 0; break;
+ }
+#endif
+ }
+ else /* Bottom scrollbar */
+ {
+ sb_info = sb;
+#ifdef FEAT_GUI_NEXTAW
+ if (data < 0)
+ {
+ data = (data - gui.char_width + 1) / gui.char_width;
+ if (data > -sb->size)
+ data = -1;
+ }
+ else if (data > 0)
+ {
+ data = (data + gui.char_width - 1) / gui.char_width;
+ if (data < sb->size)
+ data = 1;
+ }
+#endif
+ if (data < -1) /* page-width left */
+ {
+ if (sb->size > 8)
+ data = -(sb->size - 5);
+ else
+ data = -sb->size;
+ }
+ else if (data > 1) /* page-width right */
+ {
+ if (sb->size > 8)
+ data = (sb->size - 5);
+ else
+ data = sb->size;
+ }
+ }
+
+ value = sb_info->value + data;
+ if (value > sb_info->max)
+ value = sb_info->max;
+ else if (value < 0)
+ value = 0;
+
+ /* Update the bottom scrollbar an extra time (why is this needed?? */
+ if (sb->wp == NULL) /* Bottom scrollbar */
+ gui_mch_set_scrollbar_thumb(sb, value, sb->size, sb->max);
+
+ gui_drag_scrollbar(sb, value, FALSE);
+}
+
+/*
+ * Create all the Athena widgets necessary.
+ */
+ void
+gui_x11_create_widgets()
+{
+ /*
+ * We don't have any borders handled internally by the textArea to worry
+ * about so only skip over the configured border width.
+ */
+ gui.border_offset = gui.border_width;
+
+#if 0 /* not needed? */
+ XtInitializeWidgetClass(formWidgetClass);
+ XtInitializeWidgetClass(boxWidgetClass);
+ XtInitializeWidgetClass(coreWidgetClass);
+#ifdef FEAT_MENU
+ XtInitializeWidgetClass(menuButtonWidgetClass);
+#endif
+ XtInitializeWidgetClass(simpleMenuWidgetClass);
+#ifdef FEAT_GUI_NEXTAW
+ XtInitializeWidgetClass(scrollbarWidgetClass);
+#else
+ XtInitializeWidgetClass(vim_scrollbarWidgetClass);
+#endif
+#endif
+
+ /* The form containing all the other widgets */
+ vimForm = XtVaCreateManagedWidget("vimForm",
+ formWidgetClass, vimShell,
+ XtNborderWidth, 0,
+ NULL);
+ gui_athena_scroll_colors(vimForm);
+
+#ifdef FEAT_MENU
+ /* The top menu bar */
+ menuBar = XtVaCreateManagedWidget("menuBar",
+ boxWidgetClass, vimForm,
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainRight,
+ XtNinsertPosition, athena_calculate_ins_pos,
+ NULL);
+ gui_athena_menu_colors(menuBar);
+ if (gui.menu_fg_pixel != INVALCOLOR)
+ XtVaSetValues(menuBar, XtNborderColor, gui.menu_fg_pixel, NULL);
+#endif
+
+#ifdef FEAT_TOOLBAR
+ /* Don't create it Managed, it will be managed when creating the first
+ * item. Otherwise an empty toolbar shows up. */
+ toolBar = XtVaCreateWidget("toolBar",
+ boxWidgetClass, vimForm,
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainRight,
+ XtNorientation, XtorientHorizontal,
+ XtNhSpace, 1,
+ XtNvSpace, 3,
+ XtNinsertPosition, athena_calculate_ins_pos,
+ NULL);
+ gui_athena_menu_colors(toolBar);
+#endif
+
+ /* The text area. */
+ textArea = XtVaCreateManagedWidget("textArea",
+ coreWidgetClass, vimForm,
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNbackground, gui.back_pixel,
+ XtNborderWidth, 0,
+ NULL);
+
+ /*
+ * Install the callbacks.
+ */
+ gui_x11_callbacks(textArea, vimForm);
+
+#ifdef FEAT_MENU
+ popupTrans = XtParseTranslationTable(
+ "<EnterWindow>: menu-popdownsubmenus() highlight() menu-delayedpopup()\n"
+ "<LeaveWindow>: unhighlight()\n"
+ "<BtnUp>: menu-popdownsubmenus() XtMenuPopdown() notify() unhighlight()\n"
+ "<Motion>: highlight() menu-delayedpopup()");
+ parentTrans = XtParseTranslationTable("<LeaveWindow>: unhighlight()");
+ menuTrans = XtParseTranslationTable(
+ "<EnterWindow>: menu-popdownsubmenus() highlight() menu-delayedpopup()\n"
+ "<LeaveWindow>: menu-popdownsubmenus() XtMenuPopdown() unhighlight()\n"
+ "<BtnUp>: notify() unhighlight()\n"
+ "<BtnMotion>: highlight() menu-delayedpopup()");
+ supermenuTrans = XtParseTranslationTable(
+ "<EnterWindow>: menu-popdownsubmenus() highlight() menu-delayedpopup()\n"
+ "<LeaveWindow>: unhighlight()\n"
+ "<BtnUp>: menu-popdownsubmenus() XtMenuPopdown() notify() unhighlight()\n"
+ "<BtnMotion>: highlight() menu-delayedpopup()");
+
+ XtAppAddActions(XtWidgetToApplicationContext(vimForm), pullAction,
+ XtNumber(pullAction));
+#endif
+
+ /* Pretend we don't have input focus, we will get an event if we do. */
+ gui.in_focus = FALSE;
+}
+
+#ifdef FEAT_MENU
+/*
+ * Calculates the Pixmap based on the size of the current menu font.
+ */
+ static Pixmap
+gui_athena_create_pullright_pixmap(w)
+ Widget w;
+{
+ Pixmap retval;
+#ifdef FONTSET_ALWAYS
+ XFontSet font = None;
+#else
+ XFontStruct *font = NULL;
+#endif
+
+#ifdef FONTSET_ALWAYS
+ if (gui.menu_fontset == NOFONTSET)
+#else
+ if (gui.menu_font == NOFONT)
+#endif
+ {
+ XrmValue from, to;
+ WidgetList children;
+ Cardinal num_children;
+
+#ifdef FONTSET_ALWAYS
+ from.size = strlen(from.addr = XtDefaultFontSet);
+ to.addr = (XtPointer)&font;
+ to.size = sizeof(XFontSet);
+#else
+ from.size = strlen(from.addr = XtDefaultFont);
+ to.addr = (XtPointer)&font;
+ to.size = sizeof(XFontStruct *);
+#endif
+ /* Assumption: The menuBar children will use the same font as the
+ * pulldown menu items AND they will all be of type
+ * XtNfont.
+ */
+ XtVaGetValues(menuBar, XtNchildren, &children,
+ XtNnumChildren, &num_children,
+ NULL);
+ if (XtConvertAndStore(w ? w :
+ (num_children > 0) ? children[0] : menuBar,
+ XtRString, &from,
+#ifdef FONTSET_ALWAYS
+ XtRFontSet, &to
+#else
+ XtRFontStruct, &to
+#endif
+ ) == False)
+ return None;
+ /* "font" should now contain data */
+ }
+ else
+#ifdef FONTSET_ALWAYS
+ font = (XFontSet)gui.menu_fontset;
+#else
+ font = (XFontStruct *)gui.menu_font;
+#endif
+
+ {
+ int width, height;
+ GC draw_gc, undraw_gc;
+ XGCValues gc_values;
+ XPoint points[3];
+
+#ifdef FONTSET_ALWAYS
+ height = fontset_height2(font);
+#else
+ height = font->max_bounds.ascent + font->max_bounds.descent;
+#endif
+ width = height - 2;
+ puller_width = width + 4;
+ retval = XCreatePixmap(gui.dpy,DefaultRootWindow(gui.dpy),width,
+ height, 1);
+ gc_values.foreground = 1;
+ gc_values.background = 0;
+ draw_gc = XCreateGC(gui.dpy, retval,
+ GCForeground | GCBackground,
+ &gc_values);
+ gc_values.foreground = 0;
+ gc_values.background = 1;
+ undraw_gc = XCreateGC(gui.dpy, retval,
+ GCForeground | GCBackground,
+ &gc_values);
+ points[0].x = 0;
+ points[0].y = 0;
+ points[1].x = width - 1;
+ points[1].y = (height - 1) / 2;
+ points[2].x = 0;
+ points[2].y = height - 1;
+ XFillRectangle(gui.dpy, retval, undraw_gc, 0, 0, height, height);
+ XFillPolygon(gui.dpy, retval, draw_gc, points, XtNumber(points),
+ Convex, CoordModeOrigin);
+ XFreeGC(gui.dpy, draw_gc);
+ XFreeGC(gui.dpy, undraw_gc);
+ }
+ return retval;
+}
+#endif
+
+/*
+ * Called when the GUI is not going to start after all.
+ */
+ void
+gui_x11_destroy_widgets()
+{
+ textArea = NULL;
+#ifdef FEAT_MENU
+ menuBar = NULL;
+#endif
+#ifdef FEAT_TOOLBAR
+ toolBar = NULL;
+#endif
+}
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_set_toolbar_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ Dimension border;
+ int height;
+
+ if (!XtIsManaged(toolBar)) /* nothing to do */
+ return;
+ XtUnmanageChild(toolBar);
+ XtVaGetValues(toolBar,
+ XtNborderWidth, &border,
+ NULL);
+ height = h - 2 * border;
+ if (height < 0)
+ height = 1;
+ XtVaSetValues(toolBar,
+ XtNhorizDistance, x,
+ XtNvertDistance, y,
+ XtNwidth, w - 2 * border,
+ XtNheight, height,
+ NULL);
+ XtManageChild(toolBar);
+}
+#endif
+
+ void
+gui_mch_set_text_area_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ XtUnmanageChild(textArea);
+ XtVaSetValues(textArea,
+ XtNhorizDistance, x,
+ XtNvertDistance, y,
+ XtNwidth, w,
+ XtNheight, h,
+ NULL);
+ XtManageChild(textArea);
+#ifdef FEAT_TOOLBAR
+ /* Give keyboard focus to the textArea instead of the toolbar. */
+ gui_mch_reset_focus();
+#endif
+}
+
+#ifdef FEAT_TOOLBAR
+/*
+ * A toolbar button has been pushed; now reset the input focus
+ * such that the user can type page up/down etc. and have the
+ * input go to the editor window, not the button
+ */
+ static void
+gui_mch_reset_focus()
+{
+ XtSetKeyboardFocus(vimForm, textArea);
+}
+#endif
+
+
+ void
+gui_x11_set_back_color()
+{
+ if (textArea != NULL)
+ XtVaSetValues(textArea,
+ XtNbackground, gui.back_pixel,
+ NULL);
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Menu stuff.
+ */
+
+static char_u *make_pull_name __ARGS((char_u * name));
+static Widget get_popup_entry __ARGS((Widget w));
+static Widget submenu_widget __ARGS((Widget));
+static Boolean has_submenu __ARGS((Widget));
+static void gui_mch_submenu_change __ARGS((vimmenu_T *mp, int colors));
+static void gui_athena_menu_font __ARGS((Widget id));
+static Boolean gui_athena_menu_has_submenus __ARGS((Widget, Widget));
+
+ void
+gui_mch_enable_menu(flag)
+ int flag;
+{
+ if (flag)
+ {
+ XtManageChild(menuBar);
+# ifdef FEAT_TOOLBAR
+ if (XtIsManaged(toolBar))
+ {
+ XtVaSetValues(toolBar,
+ XtNvertDistance, gui.menu_height,
+ NULL);
+ XtVaSetValues(textArea,
+ XtNvertDistance, gui.menu_height + gui.toolbar_height,
+ NULL);
+ }
+# endif
+ }
+ else
+ {
+ XtUnmanageChild(menuBar);
+# ifdef FEAT_TOOLBAR
+ if (XtIsManaged(toolBar))
+ {
+ XtVaSetValues(toolBar,
+ XtNvertDistance, 0,
+ NULL);
+ }
+# endif
+ }
+}
+
+ void
+gui_mch_set_menu_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ Dimension border;
+ int height;
+
+ XtUnmanageChild(menuBar);
+ XtVaGetValues(menuBar, XtNborderWidth, &border, NULL);
+ /* avoid trouble when there are no menu items, and h is 1 */
+ height = h - 2 * border;
+ if (height < 0)
+ height = 1;
+ XtVaSetValues(menuBar,
+ XtNhorizDistance, x,
+ XtNvertDistance, y,
+ XtNwidth, w - 2 * border,
+ XtNheight, height,
+ NULL);
+ XtManageChild(menuBar);
+}
+
+/*
+ * Used to calculate the insertion position of a widget with respect to its
+ * neighbors.
+ *
+ * Valid range of return values is: 0 (beginning of children) to
+ * numChildren (end of children).
+ */
+ static Cardinal
+athena_calculate_ins_pos(widget)
+ Widget widget;
+{
+ /* Assume that if the parent of the vimmenu_T is NULL, then we can get
+ * to this menu by traversing "next", starting at "root_menu".
+ *
+ * This holds true for popup menus, toolbar, and toplevel menu items.
+ */
+
+ /* Popup menus: "id" is NULL. Only submenu_id is valid */
+
+ /* Menus that are not toplevel: "parent" will be non-NULL, "id" &
+ * "submenu_id" will be non-NULL.
+ */
+
+ /* Toplevel menus: "parent" is NULL, id is the widget of the menu item */
+
+ WidgetList children;
+ Cardinal num_children = 0;
+ int retval;
+ Arg args[2];
+ int n = 0;
+ int i;
+
+ XtSetArg(args[n], XtNchildren, &children); n++;
+ XtSetArg(args[n], XtNnumChildren, &num_children); n++;
+ XtGetValues(XtParent(widget), args, n);
+
+ retval = num_children;
+ for (i = 0; i < num_children; ++i)
+ {
+ Widget current = children[i];
+ vimmenu_T *menu = NULL;
+
+ for (menu = (a_cur_menu->parent == NULL)
+ ? root_menu : a_cur_menu->parent->children;
+ menu != NULL;
+ menu = menu->next)
+ if (current == menu->id
+ && a_cur_menu->priority < menu->priority
+ && i < retval)
+ retval = i;
+ }
+ return retval;
+}
+
+/* ARGSUSED */
+ void
+gui_mch_add_menu(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ char_u *pullright_name;
+ Dimension height, space, border;
+ vimmenu_T *parent = menu->parent;
+
+ a_cur_menu = menu;
+ if (parent == NULL)
+ {
+ if (menu_is_popup(menu->dname))
+ {
+ menu->submenu_id = XtVaCreatePopupShell((char *)menu->dname,
+ simpleMenuWidgetClass, vimShell,
+ XtNinsertPosition, athena_calculate_ins_pos,
+ XtNtranslations, popupTrans,
+ NULL);
+ gui_athena_menu_colors(menu->submenu_id);
+ }
+ else if (menu_is_menubar(menu->dname))
+ {
+ menu->id = XtVaCreateManagedWidget((char *)menu->dname,
+ menuButtonWidgetClass, menuBar,
+ XtNmenuName, menu->dname,
+#ifdef FONTSET_ALWAYS
+ XtNinternational, True,
+#endif
+ NULL);
+ if (menu->id == (Widget)0)
+ return;
+ gui_athena_menu_colors(menu->id);
+ gui_athena_menu_font(menu->id);
+
+ menu->submenu_id = XtVaCreatePopupShell((char *)menu->dname,
+ simpleMenuWidgetClass, menu->id,
+ XtNinsertPosition, athena_calculate_ins_pos,
+ XtNtranslations, supermenuTrans,
+ NULL);
+ gui_athena_menu_colors(menu->submenu_id);
+ gui_athena_menu_font(menu->submenu_id);
+
+ /* Don't update the menu height when it was set at a fixed value */
+ if (!gui.menu_height_fixed)
+ {
+ /*
+ * When we add a top-level item to the menu bar, we can figure
+ * out how high the menu bar should be.
+ */
+ XtVaGetValues(menuBar,
+ XtNvSpace, &space,
+ XtNborderWidth, &border,
+ NULL);
+ XtVaGetValues(menu->id,
+ XtNheight, &height,
+ NULL);
+ gui.menu_height = height + 2 * (space + border);
+ }
+ }
+ }
+ else if (parent->submenu_id != (Widget)0)
+ {
+ menu->id = XtVaCreateManagedWidget((char *)menu->dname,
+ smeBSBObjectClass, parent->submenu_id,
+ XtNlabel, menu->dname,
+#ifdef FONTSET_ALWAYS
+ XtNinternational, True,
+#endif
+ NULL);
+ if (menu->id == (Widget)0)
+ return;
+ if (pullerBitmap == None)
+ pullerBitmap = gui_athena_create_pullright_pixmap(menu->id);
+
+ XtVaSetValues(menu->id, XtNrightBitmap, pullerBitmap,
+ NULL);
+ /* If there are other menu items that are not pulldown menus,
+ * we need to adjust the right margins of those, too.
+ */
+ {
+ WidgetList children;
+ Cardinal num_children;
+ int i;
+
+ XtVaGetValues(parent->submenu_id, XtNchildren, &children,
+ XtNnumChildren, &num_children,
+ NULL);
+ for (i = 0; i < num_children; ++i)
+ {
+ XtVaSetValues(children[i],
+ XtNrightMargin, puller_width,
+ NULL);
+ }
+ }
+ gui_athena_menu_colors(menu->id);
+ gui_athena_menu_font(menu->id);
+
+ pullright_name = make_pull_name(menu->dname);
+ menu->submenu_id = XtVaCreatePopupShell((char *)pullright_name,
+ simpleMenuWidgetClass, parent->submenu_id,
+ XtNtranslations, menuTrans,
+ NULL);
+ gui_athena_menu_colors(menu->submenu_id);
+ gui_athena_menu_font(menu->submenu_id);
+ vim_free(pullright_name);
+ XtAddCallback(menu->submenu_id, XtNpopupCallback,
+ gui_athena_popup_callback, (XtPointer)menu);
+
+ if (parent->parent != NULL)
+ XtOverrideTranslations(parent->submenu_id, parentTrans);
+ }
+ a_cur_menu = NULL;
+}
+
+/* Used to determine whether a SimpleMenu has pulldown entries.
+ *
+ * "id" is the parent of the menu items.
+ * Ignore widget "ignore" in the pane.
+ */
+ static Boolean
+gui_athena_menu_has_submenus(id, ignore)
+ Widget id;
+ Widget ignore;
+{
+ WidgetList children;
+ Cardinal num_children;
+ int i;
+
+ XtVaGetValues(id, XtNchildren, &children,
+ XtNnumChildren, &num_children,
+ NULL);
+ for (i = 0; i < num_children; ++i)
+ {
+ if (children[i] == ignore)
+ continue;
+ if (has_submenu(children[i]))
+ return True;
+ }
+ return False;
+}
+
+ static void
+gui_athena_menu_font(id)
+ Widget id;
+{
+#ifdef FONTSET_ALWAYS
+ if (gui.menu_fontset != NOFONTSET)
+ {
+ if (XtIsManaged(id))
+ {
+ XtUnmanageChild(id);
+ XtVaSetValues(id, XtNfontSet, gui.menu_fontset, NULL);
+ /* We should force the widget to recalculate it's
+ * geometry now. */
+ XtManageChild(id);
+ }
+ else
+ XtVaSetValues(id, XtNfontSet, gui.menu_fontset, NULL);
+ if (has_submenu(id))
+ XtVaSetValues(id, XtNrightBitmap, pullerBitmap, NULL);
+ }
+#else
+ int managed = FALSE;
+
+ if (gui.menu_font != NOFONT)
+ {
+ if (XtIsManaged(id))
+ {
+ XtUnmanageChild(id);
+ managed = TRUE;
+ }
+
+# ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ XtVaSetValues(id, XtNfontSet, gui.menu_font, NULL);
+ else
+# endif
+ XtVaSetValues(id, XtNfont, gui.menu_font, NULL);
+ if (has_submenu(id))
+ XtVaSetValues(id, XtNrightBitmap, pullerBitmap, NULL);
+
+ /* Force the widget to recalculate it's geometry now. */
+ if (managed)
+ XtManageChild(id);
+ }
+#endif
+}
+
+
+ void
+gui_mch_new_menu_font()
+{
+ Pixmap oldpuller = None;
+
+ if (menuBar == (Widget)0)
+ return;
+
+ if (pullerBitmap != None)
+ {
+ oldpuller = pullerBitmap;
+ pullerBitmap = gui_athena_create_pullright_pixmap(NULL);
+ }
+ gui_mch_submenu_change(root_menu, FALSE);
+
+ {
+ /* Iterate through the menubar menu items and get the height of
+ * each one. The menu bar height is set to the maximum of all
+ * the heights.
+ */
+ vimmenu_T *mp;
+ int max_height = 9999;
+
+ for (mp = root_menu; mp != NULL; mp = mp->next)
+ {
+ if (menu_is_menubar(mp->dname))
+ {
+ Dimension height;
+
+ XtVaGetValues(mp->id,
+ XtNheight,(XtArgVal *)&height,
+ NULL);
+ if (height < max_height)
+ max_height = height;
+ }
+ }
+ if (max_height != 9999)
+ {
+ /* Don't update the menu height when it was set at a fixed value */
+ if (!gui.menu_height_fixed)
+ {
+ Dimension space, border;
+
+ XtVaGetValues(menuBar,
+ XtNvSpace, &space,
+ XtNborderWidth, &border,
+ NULL);
+ gui.menu_height = max_height + 2 * (space + border);
+ }
+ }
+ }
+ /* Now, to simulate the window being resized. Only, this
+ * will resize the window to it's current state.
+ *
+ * There has to be a better way, but I do not see one at this time.
+ * (David Harrison)
+ */
+ {
+ Position w, h;
+
+ XtVaGetValues(vimShell,
+ XtNwidth, &w,
+ XtNheight, &h,
+ NULL);
+ gui_resize_shell(w, h
+#ifdef FEAT_XIM
+ - xim_get_status_area_height()
+#endif
+ );
+ }
+ gui_set_shellsize(FALSE, TRUE);
+ ui_new_shellsize();
+ if (oldpuller != None)
+ XFreePixmap(gui.dpy, oldpuller);
+}
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+ void
+gui_mch_new_tooltip_font()
+{
+# ifdef FEAT_TOOLBAR
+ vimmenu_T *menu;
+
+ if (toolBar == (Widget)0)
+ return;
+
+ menu = gui_find_menu((char_u *)"ToolBar");
+ if (menu != NULL)
+ gui_mch_submenu_change(menu, FALSE);
+# endif
+}
+
+ void
+gui_mch_new_tooltip_colors()
+{
+# ifdef FEAT_TOOLBAR
+ vimmenu_T *menu;
+
+ if (toolBar == (Widget)0)
+ return;
+
+ menu = gui_find_menu((char_u *)"ToolBar");
+ if (menu != NULL)
+ gui_mch_submenu_change(menu, TRUE);
+# endif
+}
+#endif
+
+ static void
+gui_mch_submenu_change(menu, colors)
+ vimmenu_T *menu;
+ int colors; /* TRUE for colors, FALSE for font */
+{
+ vimmenu_T *mp;
+
+ for (mp = menu; mp != NULL; mp = mp->next)
+ {
+ if (mp->id != (Widget)0)
+ {
+ if (colors)
+ {
+ gui_athena_menu_colors(mp->id);
+#ifdef FEAT_TOOLBAR
+ /* For a toolbar item: Free the pixmap and allocate a new one,
+ * so that the background color is right. */
+ if (mp->image != (Pixmap)0)
+ {
+ XFreePixmap(gui.dpy, mp->image);
+ get_toolbar_pixmap(mp, &mp->image, NULL);
+ if (mp->image != (Pixmap)0)
+ XtVaSetValues(mp->id, XtNbitmap, mp->image, NULL);
+ }
+
+# ifdef FEAT_BEVAL
+ /* If we have a tooltip, then we need to change it's colors */
+ if (mp->tip != NULL)
+ {
+ Arg args[2];
+
+ args[0].name = XtNbackground;
+ args[0].value = gui.tooltip_bg_pixel;
+ args[1].name = XtNforeground;
+ args[1].value = gui.tooltip_fg_pixel;
+ XtSetValues(mp->tip->balloonLabel, &args[0], XtNumber(args));
+ }
+# endif
+#endif
+ }
+ else
+ {
+ gui_athena_menu_font(mp->id);
+#ifdef FEAT_BEVAL
+ /* If we have a tooltip, then we need to change it's font */
+ /* Assume XtNinternational == True (in createBalloonEvalWindow)
+ */
+ if (mp->tip != NULL)
+ {
+ Arg args[1];
+
+ args[0].name = XtNfontSet;
+ args[0].value = (XtArgVal)gui.tooltip_fontset;
+ XtSetValues(mp->tip->balloonLabel, &args[0], XtNumber(args));
+ }
+#endif
+ }
+ }
+
+ if (mp->children != NULL)
+ {
+ /* Set the colors/font for the tear off widget */
+ if (mp->submenu_id != (Widget)0)
+ {
+ if (colors)
+ gui_athena_menu_colors(mp->submenu_id);
+ else
+ gui_athena_menu_font(mp->submenu_id);
+ }
+ /* Set the colors for the children */
+ gui_mch_submenu_change(mp->children, colors);
+ }
+ }
+}
+
+/*
+ * Make a submenu name into a pullright name.
+ * Replace '.' by '_', can't include '.' in the submenu name.
+ */
+ static char_u *
+make_pull_name(name)
+ char_u * name;
+{
+ char_u *pname;
+ char_u *p;
+
+ pname = vim_strnsave(name, STRLEN(name) + strlen("-pullright"));
+ if (pname != NULL)
+ {
+ strcat((char *)pname, "-pullright");
+ while ((p = vim_strchr(pname, '.')) != NULL)
+ *p = '_';
+ }
+ return pname;
+}
+
+/* ARGSUSED */
+ void
+gui_mch_add_menu_item(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ vimmenu_T *parent = menu->parent;
+
+ a_cur_menu = menu;
+# ifdef FEAT_TOOLBAR
+ if (menu_is_toolbar(parent->name))
+ {
+ WidgetClass type;
+ int n;
+ Arg args[21];
+
+ n = 0;
+ if (menu_is_separator(menu->name))
+ {
+ XtSetArg(args[n], XtNlabel, ""); n++;
+ XtSetArg(args[n], XtNborderWidth, 0); n++;
+ }
+ else
+ {
+ get_toolbar_pixmap(menu, &menu->image, NULL);
+ XtSetArg(args[n], XtNlabel, menu->dname); n++;
+ XtSetArg(args[n], XtNinternalHeight, 1); n++;
+ XtSetArg(args[n], XtNinternalWidth, 1); n++;
+ XtSetArg(args[n], XtNborderWidth, 1); n++;
+ if (menu->image != 0)
+ XtSetArg(args[n], XtNbitmap, menu->image); n++;
+ }
+ XtSetArg(args[n], XtNhighlightThickness, 0); n++;
+ type = commandWidgetClass;
+ /* TODO: figure out the position in the toolbar?
+ * This currently works fine for the default toolbar, but
+ * what if we add/remove items during later runtime?
+ */
+
+ /* NOTE: "idx" isn't used here. The position is calculated by
+ * athena_calculate_ins_pos(). The position it calculates
+ * should be equal to "idx".
+ */
+ /* TODO: Could we just store "idx" and use that as the child
+ * placement?
+ */
+
+ if (menu->id == NULL)
+ {
+ menu->id = XtCreateManagedWidget((char *)menu->dname,
+ type, toolBar, args, n);
+ XtAddCallback(menu->id,
+ XtNcallback, gui_x11_menu_cb, menu);
+ }
+ else
+ XtSetValues(menu->id, args, n);
+ gui_athena_menu_colors(menu->id);
+
+#ifdef FEAT_BEVAL
+ gui_mch_menu_set_tip(menu);
+#endif
+
+ menu->parent = parent;
+ menu->submenu_id = NULL;
+ if (!XtIsManaged(toolBar)
+ && vim_strchr(p_go, GO_TOOLBAR) != NULL)
+ gui_mch_show_toolbar(TRUE);
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ return;
+ } /* toolbar menu item */
+# endif
+
+ /* Add menu separator */
+ if (menu_is_separator(menu->name))
+ {
+ menu->submenu_id = (Widget)0;
+ menu->id = XtVaCreateManagedWidget((char *)menu->dname,
+ smeLineObjectClass, parent->submenu_id,
+ NULL);
+ if (menu->id == (Widget)0)
+ return;
+ gui_athena_menu_colors(menu->id);
+ }
+ else
+ {
+ if (parent != NULL && parent->submenu_id != (Widget)0)
+ {
+ menu->submenu_id = (Widget)0;
+ menu->id = XtVaCreateManagedWidget((char *)menu->dname,
+ smeBSBObjectClass, parent->submenu_id,
+ XtNlabel, menu->dname,
+#ifdef FONTSET_ALWAYS
+ XtNinternational, True,
+#endif
+ NULL);
+ if (menu->id == (Widget)0)
+ return;
+
+ /* If there are other "pulldown" items in this pane, then adjust
+ * the right margin to accomodate the arrow pixmap, otherwise
+ * the right margin will be the same as the left margin.
+ */
+ {
+ Dimension left_margin;
+
+ XtVaGetValues(menu->id, XtNleftMargin, &left_margin, NULL);
+ XtVaSetValues(menu->id, XtNrightMargin,
+ gui_athena_menu_has_submenus(parent->submenu_id, NULL) ?
+ puller_width :
+ left_margin,
+ NULL);
+ }
+
+ gui_athena_menu_colors(menu->id);
+ gui_athena_menu_font(menu->id);
+ XtAddCallback(menu->id, XtNcallback, gui_x11_menu_cb,
+ (XtPointer)menu);
+ }
+ }
+ a_cur_menu = NULL;
+}
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_show_toolbar(int showit)
+{
+ Cardinal numChildren; /* how many children toolBar has */
+
+ if (toolBar == (Widget)0)
+ return;
+ XtVaGetValues(toolBar, XtNnumChildren, &numChildren, NULL);
+ if (showit && numChildren > 0)
+ {
+ /* Assume that we want to show the toolbar if p_toolbar contains valid
+ * option settings, therefore p_toolbar must not be NULL.
+ */
+ WidgetList children;
+
+ XtVaGetValues(toolBar, XtNchildren, &children, NULL);
+ {
+ void (*action)(BalloonEval *);
+ int text = 0;
+
+ if (strstr((const char *)p_toolbar, "tooltips"))
+ action = &gui_mch_enable_beval_area;
+ else
+ action = &gui_mch_disable_beval_area;
+ if (strstr((const char *)p_toolbar, "text"))
+ text = 1;
+ else if (strstr((const char *)p_toolbar, "icons"))
+ text = -1;
+ if (text != 0)
+ {
+ vimmenu_T *toolbar;
+ vimmenu_T *cur;
+
+ for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
+ if (menu_is_toolbar(toolbar->dname))
+ break;
+ /* Assumption: toolbar is NULL if there is no toolbar,
+ * otherwise it contains the toolbar menu structure.
+ *
+ * Assumption: "numChildren" == the number of items in the list
+ * of items beginning with toolbar->children.
+ */
+ if (toolbar)
+ {
+ for (cur = toolbar->children; cur; cur = cur->next)
+ {
+ Arg args[2];
+ int n = 0;
+
+ /* Enable/Disable tooltip (OK to enable while currently
+ * enabled)
+ */
+ if (cur->tip != NULL)
+ (*action)(cur->tip);
+ if (text == 1)
+ {
+ XtSetArg(args[n], XtNbitmap, None);
+ n++;
+ XtSetArg(args[n], XtNlabel,
+ menu_is_separator(cur->name) ? "" :
+ (char *)cur->dname);
+ n++;
+ }
+ else
+ {
+ XtSetArg(args[n], XtNbitmap, cur->image);
+ n++;
+ XtSetArg(args[n], XtNlabel, (cur->image == None) ?
+ menu_is_separator(cur->name) ?
+ "" :
+ (char *)cur->dname
+ :
+ (char *)None);
+ n++;
+ }
+ if (cur->id != NULL)
+ {
+ XtUnmanageChild(cur->id);
+ XtSetValues(cur->id, args, n);
+ XtManageChild(cur->id);
+ }
+ }
+ }
+ }
+ }
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ XtManageChild(toolBar);
+ if (XtIsManaged(menuBar))
+ {
+ XtVaSetValues(textArea,
+ XtNvertDistance, gui.toolbar_height + gui.menu_height,
+ NULL);
+ XtVaSetValues(toolBar,
+ XtNvertDistance, gui.menu_height,
+ NULL);
+ }
+ else
+ {
+ XtVaSetValues(textArea,
+ XtNvertDistance, gui.toolbar_height,
+ NULL);
+ XtVaSetValues(toolBar,
+ XtNvertDistance, 0,
+ NULL);
+ }
+ }
+ else
+ {
+ gui.toolbar_height = 0;
+ if (XtIsManaged(menuBar))
+ XtVaSetValues(textArea,
+ XtNvertDistance, gui.menu_height,
+ NULL);
+ else
+ XtVaSetValues(textArea,
+ XtNvertDistance, 0,
+ NULL);
+
+ XtUnmanageChild(toolBar);
+ }
+ gui_set_shellsize(FALSE, FALSE);
+}
+
+
+ int
+gui_mch_compute_toolbar_height()
+{
+ Dimension height; /* total Toolbar height */
+ Dimension whgt; /* height of each widget */
+ Dimension marginHeight; /* XmNmarginHeight of toolBar */
+ Dimension shadowThickness; /* thickness of Xtparent(toolBar) */
+ WidgetList children; /* list of toolBar's children */
+ Cardinal numChildren; /* how many children toolBar has */
+ int i;
+
+ height = 0;
+ shadowThickness = 0;
+ marginHeight = 0;
+ if (toolBar != (Widget)0)
+ {
+ XtVaGetValues(toolBar,
+ XtNborderWidth, &shadowThickness,
+ XtNvSpace, &marginHeight,
+ XtNchildren, &children,
+ XtNnumChildren, &numChildren,
+ NULL);
+ for (i = 0; i < numChildren; i++)
+ {
+ whgt = 0;
+
+ XtVaGetValues(children[i], XtNheight, &whgt, NULL);
+ if (height < whgt)
+ height = whgt;
+ }
+ }
+
+ return (int)(height + (marginHeight << 1) + (shadowThickness << 1));
+}
+
+ void
+gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
+ Pixel *bgp;
+ Pixel *fgp;
+ Pixel *bsp;
+ Pixel *tsp;
+ Pixel *hsp;
+{
+ XtVaGetValues(toolBar, XtNbackground, bgp, XtNborderColor, fgp, NULL);
+ *bsp = *bgp;
+ *tsp = *fgp;
+ *hsp = *tsp;
+}
+#endif
+
+
+/* ARGSUSED */
+ void
+gui_mch_toggle_tearoffs(enable)
+ int enable;
+{
+ /* no tearoff menus */
+}
+
+ void
+gui_mch_new_menu_colors()
+{
+ if (menuBar == (Widget)0)
+ return;
+ if (gui.menu_fg_pixel != INVALCOLOR)
+ XtVaSetValues(menuBar, XtNborderColor, gui.menu_fg_pixel, NULL);
+ gui_athena_menu_colors(menuBar);
+#ifdef FEAT_TOOLBAR
+ gui_athena_menu_colors(toolBar);
+#endif
+
+ gui_mch_submenu_change(root_menu, TRUE);
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(menu)
+ vimmenu_T *menu;
+{
+ Widget parent;
+
+ /* There is no item for the toolbar. */
+ if (menu->id == (Widget)0)
+ return;
+
+ parent = XtParent(menu->id);
+
+ /* When removing the last "pulldown" menu item from a pane, adjust the
+ * right margins of the remaining widgets.
+ */
+ if (menu->submenu_id != (Widget)0)
+ {
+ /* Go through the menu items in the parent of this item and
+ * adjust their margins, if necessary.
+ * This takes care of the case when we delete the last menu item in a
+ * pane that has a submenu. In this case, there will be no arrow
+ * pixmaps shown anymore.
+ */
+ {
+ WidgetList children;
+ Cardinal num_children;
+ int i;
+ Dimension right_margin = 0;
+ Boolean get_left_margin = False;
+
+ XtVaGetValues(parent, XtNchildren, &children,
+ XtNnumChildren, &num_children,
+ NULL);
+ if (gui_athena_menu_has_submenus(parent, menu->id))
+ right_margin = puller_width;
+ else
+ get_left_margin = True;
+
+ for (i = 0; i < num_children; ++i)
+ {
+ if (children[i] == menu->id)
+ continue;
+ if (get_left_margin == True)
+ {
+ Dimension left_margin;
+
+ XtVaGetValues(children[i], XtNleftMargin, &left_margin,
+ NULL);
+ XtVaSetValues(children[i], XtNrightMargin, left_margin,
+ NULL);
+ }
+ else
+ XtVaSetValues(children[i], XtNrightMargin, right_margin,
+ NULL);
+ }
+ }
+ }
+ /* Please be sure to destroy the parent widget first (i.e. menu->id).
+ *
+ * This code should be basically identical to that in the file gui_motif.c
+ * because they are both Xt based.
+ */
+ if (menu->id != (Widget)0)
+ {
+ Cardinal num_children;
+ Dimension height, space, border;
+
+ XtVaGetValues(menuBar,
+ XtNvSpace, &space,
+ XtNborderWidth, &border,
+ NULL);
+ XtVaGetValues(menu->id,
+ XtNheight, &height,
+ NULL);
+#if defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL)
+ if (parent == toolBar && menu->tip != NULL)
+ {
+ /* We try to destroy this before the actual menu, because there are
+ * callbacks, etc. that will be unregistered during the tooltip
+ * destruction.
+ *
+ * If you call "gui_mch_destroy_beval_area()" after destroying
+ * menu->id, then the tooltip's window will have already been
+ * deallocated by Xt, and unknown behaviour will ensue (probably
+ * a core dump).
+ */
+ gui_mch_destroy_beval_area(menu->tip);
+ menu->tip = NULL;
+ }
+#endif
+ /*
+ * This is a hack to stop the Athena simpleMenuWidget from getting a
+ * BadValue error when a menu's last child is destroyed. We check to
+ * see if this is the last child and if so, don't delete it. The parent
+ * will be deleted soon anyway, and it will delete it's children like
+ * all good widgets do.
+ */
+ /* NOTE: The cause of the BadValue X Protocol Error is because when the
+ * last child is destroyed, it is first unmanaged, thus causing a
+ * geometry resize request from the parent Shell widget.
+ * Since the Shell widget has no more children, it is resized to have
+ * width/height of 0. XConfigureWindow() is then called with the
+ * width/height of 0, which generates the BadValue.
+ *
+ * This happens in phase two of the widget destruction process.
+ */
+ {
+ if (parent != menuBar
+#ifdef FEAT_TOOLBAR
+ && parent != toolBar
+#endif
+ )
+ {
+ XtVaGetValues(parent, XtNnumChildren, &num_children, NULL);
+ if (num_children > 1)
+ XtDestroyWidget(menu->id);
+ }
+ else
+ XtDestroyWidget(menu->id);
+ menu->id = (Widget)0;
+ }
+
+ if (parent == menuBar)
+ {
+ if (!gui.menu_height_fixed)
+ gui.menu_height = height + 2 * (space + border);
+ }
+#ifdef FEAT_TOOLBAR
+ else if (parent == toolBar)
+ {
+ /* When removing last toolbar item, don't display the toolbar. */
+ XtVaGetValues(toolBar, XtNnumChildren, &num_children, NULL);
+ if (num_children == 0)
+ gui_mch_show_toolbar(FALSE);
+ else
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ }
+#endif
+ }
+ if (menu->submenu_id != (Widget)0)
+ {
+ XtDestroyWidget(menu->submenu_id);
+ menu->submenu_id = (Widget)0;
+ }
+}
+
+/*ARGSUSED*/
+ static void
+gui_athena_menu_timeout(client_data, id)
+ XtPointer client_data;
+ XtIntervalId *id;
+{
+ Widget w = (Widget)client_data;
+ Widget popup;
+
+ timer = 0;
+ if (XtIsSubclass(w,smeBSBObjectClass))
+ {
+ Pixmap p;
+
+ XtVaGetValues(w, XtNrightBitmap, &p, NULL);
+ if ((p != None) && (p != XtUnspecifiedPixmap))
+ {
+ /* We are dealing with an item that has a submenu */
+ popup = get_popup_entry(XtParent(w));
+ if (popup == (Widget)0)
+ return;
+ XtPopup(popup, XtGrabNonexclusive);
+ }
+ }
+}
+
+/* This routine is used to calculate the position (in screen coordinates)
+ * where a submenu should appear relative to the menu entry that popped it
+ * up. It should appear even with and just slightly to the left of the
+ * rightmost end of the menu entry that caused the popup.
+ *
+ * This is called when XtPopup() is called.
+ */
+/*ARGSUSED*/
+ static void
+gui_athena_popup_callback(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ /* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */
+ vimmenu_T *menu = (vimmenu_T *)client_data;
+ Dimension width;
+ Position root_x, root_y;
+
+ /* First, popdown any siblings that may have menus popped up */
+ {
+ vimmenu_T *i;
+
+ for (i = menu->parent->children; i != NULL; i = i->next)
+ {
+ if (i->submenu_id != NULL && XtIsManaged(i->submenu_id))
+ XtPopdown(i->submenu_id);
+ }
+ }
+ XtVaGetValues(XtParent(w),
+ XtNwidth, &width,
+ NULL);
+ /* Assumption: XawSimpleMenuGetActiveEntry(XtParent(w)) == menu->id */
+ /* i.e. This IS the active entry */
+ XtTranslateCoords(menu->id,width - 5, 0, &root_x, &root_y);
+ XtVaSetValues(w, XtNx, root_x,
+ XtNy, root_y,
+ NULL);
+}
+
+/* ARGSUSED */
+ static void
+gui_athena_popdown_submenus_action(w, event, args, nargs)
+ Widget w;
+ XEvent *event;
+ String *args;
+ Cardinal *nargs;
+{
+ WidgetList children;
+ Cardinal num_children;
+
+ XtVaGetValues(w, XtNchildren, &children,
+ XtNnumChildren, &num_children,
+ NULL);
+ for (; num_children > 0; --num_children)
+ {
+ Widget child = children[num_children - 1];
+
+ if (has_submenu(child))
+ {
+ Widget temp_w;
+
+ temp_w = submenu_widget(child);
+ gui_athena_popdown_submenus_action(temp_w,event,args,nargs);
+ XtPopdown(temp_w);
+ }
+ }
+}
+
+/* Used to determine if the given widget has a submenu that can be popped up. */
+ static Boolean
+has_submenu(widget)
+ Widget widget;
+{
+ if ((widget != NULL) && XtIsSubclass(widget,smeBSBObjectClass))
+ {
+ Pixmap p;
+
+ XtVaGetValues(widget, XtNrightBitmap, &p, NULL);
+ if ((p != None) && (p != XtUnspecifiedPixmap))
+ return True;
+ }
+ return False;
+}
+
+/* ARGSUSED */
+ static void
+gui_athena_delayed_arm_action(w, event, args, nargs)
+ Widget w;
+ XEvent *event;
+ String *args;
+ Cardinal *nargs;
+{
+ Dimension width, height;
+
+ if (event->type != MotionNotify)
+ return;
+
+ XtVaGetValues(w,
+ XtNwidth, &width,
+ XtNheight, &height,
+ NULL);
+
+ if (event->xmotion.x >= (int)width || event->xmotion.y >= (int)height)
+ return;
+
+ {
+ static Widget previous_active_widget = NULL;
+ Widget current;
+
+ current = XawSimpleMenuGetActiveEntry(w);
+ if (current != previous_active_widget)
+ {
+ if (timer)
+ {
+ /* If the timeout hasn't been triggered, remove it */
+ XtRemoveTimeOut(timer);
+ }
+ gui_athena_popdown_submenus_action(w,event,args,nargs);
+ if (has_submenu(current))
+ {
+ XtAppAddTimeOut(XtWidgetToApplicationContext(w), 600L,
+ gui_athena_menu_timeout,
+ (XtPointer)current);
+ }
+ previous_active_widget = current;
+ }
+ }
+}
+
+ static Widget
+get_popup_entry(w)
+ Widget w;
+{
+ Widget menuw;
+
+ /* Get the active entry for the current menu */
+ if ((menuw = XawSimpleMenuGetActiveEntry(w)) == (Widget)0)
+ return NULL;
+
+ return submenu_widget(menuw);
+}
+
+/* Given the widget that has been determined to have a submenu, return the submenu widget
+ * that is to be popped up.
+ */
+ static Widget
+submenu_widget(widget)
+ Widget widget;
+{
+ /* Precondition: has_submenu(widget) == True
+ * XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True
+ */
+
+ char_u *pullright_name;
+ Widget popup;
+
+ pullright_name = make_pull_name((char_u *)XtName(widget));
+ popup = XtNameToWidget(XtParent(widget), (char *)pullright_name);
+ vim_free(pullright_name);
+
+ return popup;
+ /* Postcondition: (popup != NULL) implies
+ * (XtIsSubclass(popup,simpleMenuWidgetClass) == True) */
+}
+
+/* ARGSUSED */
+ void
+gui_mch_show_popupmenu(menu)
+ vimmenu_T *menu;
+{
+ int rootx, rooty, winx, winy;
+ Window root, child;
+ unsigned int mask;
+
+ if (menu->submenu_id == (Widget)0)
+ return;
+
+ /* Position the popup menu at the pointer */
+ if (XQueryPointer(gui.dpy, XtWindow(vimShell), &root, &child,
+ &rootx, &rooty, &winx, &winy, &mask))
+ {
+ rootx -= 30;
+ if (rootx < 0)
+ rootx = 0;
+ rooty -= 5;
+ if (rooty < 0)
+ rooty = 0;
+ XtVaSetValues(menu->submenu_id,
+ XtNx, rootx,
+ XtNy, rooty,
+ NULL);
+ }
+
+ XtOverrideTranslations(menu->submenu_id, popupTrans);
+ XtPopupSpringLoaded(menu->submenu_id);
+}
+
+#endif /* FEAT_MENU */
+
+/*
+ * Set the menu and scrollbar colors to their default values.
+ */
+ void
+gui_mch_def_colors()
+{
+ /*
+ * Get the colors ourselves. Using the automatic conversion doesn't
+ * handle looking for approximate colors.
+ */
+ if (gui.in_use)
+ {
+ gui.menu_fg_pixel = gui_get_color((char_u *)gui.rsrc_menu_fg_name);
+ gui.menu_bg_pixel = gui_get_color((char_u *)gui.rsrc_menu_bg_name);
+ gui.scroll_fg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_fg_name);
+ gui.scroll_bg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_bg_name);
+#ifdef FEAT_BEVAL
+ gui.tooltip_fg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_fg_name);
+ gui.tooltip_bg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_bg_name);
+#endif
+ }
+}
+
+
+/*
+ * Scrollbar stuff.
+ */
+
+ void
+gui_mch_set_scrollbar_thumb(sb, val, size, max)
+ scrollbar_T *sb;
+ long val;
+ long size;
+ long max;
+{
+ double v, s;
+
+ if (sb->id == (Widget)0)
+ return;
+
+ /*
+ * Athena scrollbar must go from 0.0 to 1.0.
+ */
+ if (max == 0)
+ {
+ /* So you can't scroll it at all (normally it scrolls past end) */
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(sb->id, 0.0, 1.0);
+#else
+ vim_XawScrollbarSetThumb(sb->id, 0.0, 1.0, 0.0);
+#endif
+ }
+ else
+ {
+ v = (double)val / (double)(max + 1);
+ s = (double)size / (double)(max + 1);
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(sb->id, v, s);
+#else
+ vim_XawScrollbarSetThumb(sb->id, v, s, 1.0);
+#endif
+ }
+}
+
+ void
+gui_mch_set_scrollbar_pos(sb, x, y, w, h)
+ scrollbar_T *sb;
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ if (sb->id == (Widget)0)
+ return;
+
+ XtUnmanageChild(sb->id);
+ XtVaSetValues(sb->id,
+ XtNhorizDistance, x,
+ XtNvertDistance, y,
+ XtNwidth, w,
+ XtNheight, h,
+ NULL);
+ XtManageChild(sb->id);
+}
+
+ void
+gui_mch_enable_scrollbar(sb, flag)
+ scrollbar_T *sb;
+ int flag;
+{
+ if (sb->id != (Widget)0)
+ {
+ if (flag)
+ XtManageChild(sb->id);
+ else
+ XtUnmanageChild(sb->id);
+ }
+}
+
+ void
+gui_mch_create_scrollbar(sb, orient)
+ scrollbar_T *sb;
+ int orient; /* SBAR_VERT or SBAR_HORIZ */
+{
+ sb->id = XtVaCreateWidget("scrollBar",
+#ifdef FEAT_GUI_NEXTAW
+ scrollbarWidgetClass, vimForm,
+#else
+ vim_scrollbarWidgetClass, vimForm,
+#endif
+ XtNresizable, True,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNborderWidth, 0,
+ XtNorientation, (orient == SBAR_VERT) ? XtorientVertical
+ : XtorientHorizontal,
+ XtNforeground, gui.scroll_fg_pixel,
+ XtNbackground, gui.scroll_bg_pixel,
+ NULL);
+ if (sb->id == (Widget)0)
+ return;
+
+ XtAddCallback(sb->id, XtNjumpProc,
+ gui_athena_scroll_cb_jump, (XtPointer)sb->ident);
+ XtAddCallback(sb->id, XtNscrollProc,
+ gui_athena_scroll_cb_scroll, (XtPointer)sb->ident);
+
+#ifdef FEAT_GUI_NEXTAW
+ XawScrollbarSetThumb(sb->id, 0.0, 1.0);
+#else
+ vim_XawScrollbarSetThumb(sb->id, 0.0, 1.0, 0.0);
+#endif
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(sb)
+ scrollbar_T *sb;
+{
+ if (sb->id != (Widget)0)
+ XtDestroyWidget(sb->id);
+}
+#endif
+
+ void
+gui_mch_set_scrollbar_colors(sb)
+ scrollbar_T *sb;
+{
+ if (sb->id != (Widget)0)
+ XtVaSetValues(sb->id,
+ XtNforeground, gui.scroll_fg_pixel,
+ XtNbackground, gui.scroll_bg_pixel,
+ NULL);
+
+ /* This is needed for the rectangle below the vertical scrollbars. */
+ if (sb == &gui.bottom_sbar && vimForm != (Widget)0)
+ gui_athena_scroll_colors(vimForm);
+}
+
+/*
+ * Miscellaneous stuff:
+ */
+ Window
+gui_x11_get_wid()
+{
+ return XtWindow(textArea);
+}
+
+#if defined(FEAT_BROWSE) || defined(PROTO)
+/*
+ * Put up a file requester.
+ * Returns the selected name in allocated memory, or NULL for Cancel.
+ */
+/* ARGSUSED */
+ char_u *
+gui_mch_browse(saving, title, dflt, ext, initdir, filter)
+ int saving; /* select file to write */
+ char_u *title; /* not used (title for the window) */
+ char_u *dflt; /* not used (default name) */
+ char_u *ext; /* not used (extension added) */
+ char_u *initdir; /* initial directory, NULL for current dir */
+ char_u *filter; /* not used (file name filter) */
+{
+ Position x, y;
+ char_u dirbuf[MAXPATHL];
+
+ /* Concatenate "initdir" and "dflt". */
+ if (initdir == NULL || *initdir == NUL)
+ mch_dirname(dirbuf, MAXPATHL);
+ else if (STRLEN(initdir) + 2 < MAXPATHL)
+ STRCPY(dirbuf, initdir);
+ else
+ dirbuf[0] = NUL;
+ if (dflt != NULL && *dflt != NUL
+ && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
+ {
+ add_pathsep(dirbuf);
+ STRCAT(dirbuf, dflt);
+ }
+
+ /* Position the file selector just below the menubar */
+ XtTranslateCoords(vimShell, (Position)0, (Position)
+#ifdef FEAT_MENU
+ gui.menu_height
+#else
+ 0
+#endif
+ , &x, &y);
+ return (char_u *)vim_SelFile(vimShell, (char *)title, (char *)dirbuf,
+ NULL, (int)x, (int)y, gui.menu_fg_pixel, gui.menu_bg_pixel,
+ gui.scroll_fg_pixel, gui.scroll_bg_pixel);
+}
+#endif
+
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+
+static int dialogStatus;
+static Atom dialogatom;
+
+static void keyhit_callback __ARGS((Widget w, XtPointer client_data, XEvent *event, Boolean *cont));
+static void butproc __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+static void dialog_wm_handler __ARGS((Widget w, XtPointer client_data, XEvent *event, Boolean *dum));
+
+/*
+ * Callback function for the textfield. When CR is hit this works like
+ * hitting the "OK" button, ESC like "Cancel".
+ */
+/* ARGSUSED */
+ static void
+keyhit_callback(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ char buf[2];
+
+ if (XLookupString(&(event->xkey), buf, 2, NULL, NULL) == 1)
+ {
+ if (*buf == CAR)
+ dialogStatus = 1;
+ else if (*buf == ESC)
+ dialogStatus = 0;
+ }
+}
+
+/* ARGSUSED */
+ static void
+butproc(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ dialogStatus = (int)(long)client_data + 1;
+}
+
+/*
+ * Function called when dialog window closed.
+ */
+/*ARGSUSED*/
+ static void
+dialog_wm_handler(w, client_data, event, dum)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *dum;
+{
+ if (event->type == ClientMessage
+ && ((XClientMessageEvent *)event)->data.l[0] == dialogatom)
+ dialogStatus = 0;
+}
+
+/* ARGSUSED */
+ int
+gui_mch_dialog(type, title, message, buttons, dfltbutton, textfield)
+ int type;
+ char_u *title;
+ char_u *message;
+ char_u *buttons;
+ int dfltbutton;
+ char_u *textfield;
+{
+ char_u *buts;
+ char_u *p, *next;
+ XtAppContext app;
+ XEvent event;
+ Position wd, hd;
+ Position wv, hv;
+ Position x, y;
+ Widget dialog;
+ Widget dialogshell;
+ Widget dialogmessage;
+ Widget dialogtextfield = 0;
+ Widget dialogButton;
+ Widget prev_dialogButton = NULL;
+ int butcount;
+ int vertical;
+
+ if (title == NULL)
+ title = (char_u *)_("Vim dialog");
+ dialogStatus = -1;
+
+ /* if our pointer is currently hidden, then we should show it. */
+ gui_mch_mousehide(FALSE);
+
+ /* Check 'v' flag in 'guioptions': vertical button placement. */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+
+ /* The shell is created each time, to make sure it is resized properly */
+ dialogshell = XtVaCreatePopupShell("dialogShell",
+ transientShellWidgetClass, vimShell,
+ XtNtitle, title,
+ NULL);
+ if (dialogshell == (Widget)0)
+ goto error;
+
+ dialog = XtVaCreateManagedWidget("dialog",
+ formWidgetClass, dialogshell,
+ XtNdefaultDistance, 20,
+ NULL);
+ if (dialog == (Widget)0)
+ goto error;
+ gui_athena_menu_colors(dialog);
+ dialogmessage = XtVaCreateManagedWidget("dialogMessage",
+ labelWidgetClass, dialog,
+ XtNlabel, message,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNresizable, True,
+ XtNborderWidth, 0,
+ NULL);
+ gui_athena_menu_colors(dialogmessage);
+
+ if (textfield != NULL)
+ {
+ dialogtextfield = XtVaCreateManagedWidget("textfield",
+ asciiTextWidgetClass, dialog,
+ XtNwidth, 400,
+ XtNtop, XtChainTop,
+ XtNbottom, XtChainTop,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainRight,
+ XtNfromVert, dialogmessage,
+ XtNresizable, True,
+ XtNstring, textfield,
+ XtNlength, IOSIZE,
+ XtNuseStringInPlace, True,
+ XtNeditType, XawtextEdit,
+ XtNwrap, XawtextWrapNever,
+ XtNresize, XawtextResizeHeight,
+ NULL);
+ XtManageChild(dialogtextfield);
+ XtAddEventHandler(dialogtextfield, KeyPressMask, False,
+ (XtEventHandler)keyhit_callback, (XtPointer)NULL);
+ XawTextSetInsertionPoint(dialogtextfield,
+ (XawTextPosition)STRLEN(textfield));
+ XtSetKeyboardFocus(dialog, dialogtextfield);
+ }
+
+ /* make a copy, so that we can insert NULs */
+ buts = vim_strsave(buttons);
+ if (buts == NULL)
+ return -1;
+
+ p = buts;
+ for (butcount = 0; *p; ++butcount)
+ {
+ for (next = p; *next; ++next)
+ {
+ if (*next == DLG_HOTKEY_CHAR)
+ mch_memmove(next, next + 1, STRLEN(next));
+ if (*next == DLG_BUTTON_SEP)
+ {
+ *next++ = NUL;
+ break;
+ }
+ }
+ dialogButton = XtVaCreateManagedWidget("button",
+ commandWidgetClass, dialog,
+ XtNlabel, p,
+ XtNtop, XtChainBottom,
+ XtNbottom, XtChainBottom,
+ XtNleft, XtChainLeft,
+ XtNright, XtChainLeft,
+ XtNfromVert, textfield == NULL ? dialogmessage : dialogtextfield,
+ XtNvertDistance, vertical ? 4 : 20,
+ XtNresizable, False,
+ NULL);
+ gui_athena_menu_colors(dialogButton);
+ if (butcount > 0)
+ XtVaSetValues(dialogButton,
+ vertical ? XtNfromVert : XtNfromHoriz, prev_dialogButton,
+ NULL);
+
+ XtAddCallback(dialogButton, XtNcallback, butproc, (XtPointer)butcount);
+ p = next;
+ prev_dialogButton = dialogButton;
+ }
+ vim_free(buts);
+
+ XtRealizeWidget(dialogshell);
+
+ /* Setup for catching the close-window event, don't let it close Vim! */
+ dialogatom = XInternAtom(gui.dpy, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(gui.dpy, XtWindow(dialogshell), &dialogatom, 1);
+ XtAddEventHandler(dialogshell, NoEventMask, True, dialog_wm_handler, NULL);
+
+ XtVaGetValues(dialogshell,
+ XtNwidth, &wd,
+ XtNheight, &hd,
+ NULL);
+ XtVaGetValues(vimShell,
+ XtNwidth, &wv,
+ XtNheight, &hv,
+ NULL);
+ XtTranslateCoords(vimShell,
+ (Position)((wv - wd) / 2),
+ (Position)((hv - hd) / 2),
+ &x, &y);
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ XtVaSetValues(dialogshell, XtNx, x, XtNy, y, NULL);
+
+ /* Position the mouse pointer in the dialog, required for when focus
+ * follows mouse. */
+ XWarpPointer(gui.dpy, (Window)0, XtWindow(dialogshell), 0, 0, 0, 0, 20, 40);
+
+
+ app = XtWidgetToApplicationContext(dialogshell);
+
+ XtPopup(dialogshell, XtGrabNonexclusive);
+
+ while (1)
+ {
+ XtAppNextEvent(app, &event);
+ XtDispatchEvent(&event);
+ if (dialogStatus >= 0)
+ break;
+ }
+
+ XtPopdown(dialogshell);
+
+ if (textfield != NULL && dialogStatus < 0)
+ *textfield = NUL;
+
+error:
+ XtDestroyWidget(dialogshell);
+
+ return dialogStatus;
+}
+#endif
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_MENU)
+/*
+ * Set the colors of Widget "id" to the menu colors.
+ */
+ static void
+gui_athena_menu_colors(id)
+ Widget id;
+{
+ if (gui.menu_bg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XtNbackground, gui.menu_bg_pixel, NULL);
+ if (gui.menu_fg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XtNforeground, gui.menu_fg_pixel, NULL);
+}
+#endif
+
+/*
+ * Set the colors of Widget "id" to the scroll colors.
+ */
+ static void
+gui_athena_scroll_colors(id)
+ Widget id;
+{
+ if (gui.scroll_bg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XtNbackground, gui.scroll_bg_pixel, NULL);
+ if (gui.scroll_fg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XtNforeground, gui.scroll_fg_pixel, NULL);
+}
diff --git a/src/gui_beos.cc b/src/gui_beos.cc
new file mode 100644
index 000000000..e2c659848
--- /dev/null
+++ b/src/gui_beos.cc
@@ -0,0 +1,3347 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * BeBox GUI support Copyright 1998 by Olaf Seibert.
+ * All Rights Reserved.
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ *
+ * BeOS GUI.
+ *
+ * GUI support for the Buzzword Enhanced Operating System.
+ *
+ * Ported to R4 by Richard Offer <richard@whitequeen.com> Jul 99
+ *
+ */
+
+/*
+ * Structure of the BeOS GUI code:
+ *
+ * There are 3 threads.
+ * 1. The initial thread. In gui_mch_prepare() this gets to run the
+ * BApplication message loop. But before it starts doing that,
+ * it creates thread 2:
+ * 2. The main() thread. This thread is created in gui_mch_prepare()
+ * and its purpose in life is to call main(argc, argv) again.
+ * This thread is doing the bulk of the work.
+ * 3. Sooner or later, a window is opened by the main() thread. This
+ * causes a second message loop to be created: the window thread.
+ *
+ * == alternatively ===
+ *
+ * #if RUN_BAPPLICATION_IN_NEW_THREAD...
+ *
+ * 1. The initial thread. In gui_mch_prepare() this gets to spawn
+ * thread 2. After doing that, it returns to main() to do the
+ * bulk of the work, being the main() thread.
+ * 2. Runs the BApplication.
+ * 3. The window thread, just like in the first case.
+ *
+ * This second alternative is cleaner from Vim's viewpoint. However,
+ * the BeBook seems to assume everywhere that the BApplication *must*
+ * run in the initial thread. So perhaps doing otherwise is very wrong.
+ *
+ * However, from a B_SINGLE_LAUNCH viewpoint, the first is better.
+ * If Vim is marked "Single Launch" in its application resources,
+ * and a file is dropped on the Vim icon, and another Vim is already
+ * running, the file is passed on to the earlier Vim. This happens
+ * in BApplication::Run(). So we want Vim to terminate if
+ * BApplication::Run() terminates. (See the BeBook, on BApplication.
+ * However, it seems that the second copy of Vim isn't even started
+ * in this case... which is for the better since I wouldn't know how
+ * to detect this case.)
+ *
+ * Communication between these threads occurs mostly by translating
+ * BMessages that come in and posting an appropriate translation on
+ * the VDCMP (Vim Direct Communication Message Port). Therefore the
+ * actions required for keypresses and window resizes, etc, are mostly
+ * performed in the main() thread.
+ *
+ * A notable exception to this is the Draw() event. The redrawing of
+ * the window contents is performed asynchronously from the window
+ * thread. To make this work correctly, a locking protocol is used when
+ * any thread is accessing the essential variables that are used by
+ * the window thread.
+ *
+ * This locking protocol consists of locking Vim's window. This is both
+ * convenient and necessary.
+ */
+extern "C" {
+
+#define new xxx_new_xxx
+
+#include <float.h>
+#include <assert.h>
+#include "vim.h"
+#include "globals.h"
+#include "proto.h"
+#include "option.h"
+
+#undef new
+
+} /* extern "C" */
+
+/* ---------------- start of header part ---------------- */
+
+#include <be/app/MessageQueue.h>
+#include <be/app/Clipboard.h>
+#include <be/kernel/OS.h>
+#include <be/support/Beep.h>
+#include <be/interface/View.h>
+#include <be/interface/Window.h>
+#include <be/interface/MenuBar.h>
+#include <be/interface/MenuItem.h>
+#include <be/interface/ScrollBar.h>
+#include <be/interface/Region.h>
+#include <be/interface/Screen.h>
+#include <be/storage/Path.h>
+#include <be/storage/Directory.h>
+#include <be/storage/Entry.h>
+#include <be/app/Application.h>
+#include <be/support/Debug.h>
+
+/*
+ * The macro B_PIXEL_ALIGNMENT shows us which version
+ * of the header files we're using.
+ */
+#if defined(B_PIXEL_ALIGNMENT)
+#define HAVE_R3_OR_LATER 1
+#else
+#define HAVE_R3_OR_LATER 0
+#endif
+
+class VimApp;
+class VimFormView;
+class VimTextAreaView;
+class VimWindow;
+
+extern key_map *keyMap;
+extern char *keyMapChars;
+
+extern int main(int argc, char **argv);
+
+#ifndef B_MAX_PORT_COUNT
+#define B_MAX_PORT_COUNT 100
+#endif
+
+/*
+ * VimApp seems comparable to the X "vimShell"
+ */
+class VimApp: public BApplication
+{
+ typedef BApplication Inherited;
+public:
+ VimApp(const char *appsig);
+ ~VimApp();
+
+ // callbacks:
+#if 0
+ virtual void DispatchMessage(BMessage *m, BHandler *h)
+ {
+ m->PrintToStream();
+ Inherited::DispatchMessage(m, h);
+ }
+#endif
+ virtual void ReadyToRun();
+ virtual void ArgvReceived(int32 argc, char **argv);
+ virtual void RefsReceived(BMessage *m);
+ virtual bool QuitRequested();
+
+ static void SendRefs(BMessage *m, bool changedir);
+private:
+};
+
+class VimWindow: public BWindow
+{
+ typedef BWindow Inherited;
+public:
+ VimWindow();
+ ~VimWindow();
+
+ virtual void DispatchMessage(BMessage *m, BHandler *h);
+ virtual void WindowActivated(bool active);
+ virtual bool QuitRequested();
+
+ VimFormView *formView;
+
+private:
+ void init();
+
+};
+
+class VimFormView: public BView
+{
+ typedef BView Inherited;
+public:
+ VimFormView(BRect frame);
+ ~VimFormView();
+
+ // callbacks:
+ virtual void AllAttached();
+ virtual void FrameResized(float new_width, float new_height);
+
+#define MENUBAR_MARGIN 1
+ float MenuHeight() const
+ { return menuBar ? menuBar->Frame().Height() + MENUBAR_MARGIN: 0; }
+ BMenuBar *MenuBar() const
+ { return menuBar; }
+
+private:
+ void init(BRect);
+
+ BMenuBar *menuBar;
+ VimTextAreaView *textArea;
+};
+
+class VimTextAreaView: public BView
+{
+ typedef BView Inherited;
+public:
+ VimTextAreaView(BRect frame);
+ ~VimTextAreaView();
+
+ // callbacks:
+ virtual void Draw(BRect updateRect);
+ virtual void KeyDown(const char *bytes, int32 numBytes);
+ virtual void MouseDown(BPoint point);
+ virtual void MouseUp(BPoint point);
+ virtual void MouseMoved(BPoint point, uint32 transit, const BMessage *message);
+ virtual void MessageReceived(BMessage *m);
+
+ // own functions:
+ int mchInitFont(char_u *name);
+ void mchDrawString(int row, int col, char_u *s, int len, int flags);
+ void mchClearBlock(int row1, int col1, int row2, int col2);
+ void mchClearAll();
+ void mchDeleteLines(int row, int num_lines);
+ void mchInsertLines(int row, int num_lines);
+
+ static void guiSendMouseEvent(int button, int x, int y, int repeated_click, int_u modifiers);
+ static void guiBlankMouse(bool should_hide);
+ static int_u mouseModifiersToVim(int32 beModifiers);
+
+ int32 mouseDragEventCount;
+
+private:
+ void init(BRect);
+
+ int_u vimMouseButton;
+ int_u vimMouseModifiers;
+};
+
+class VimScrollBar: public BScrollBar
+{
+ typedef BScrollBar Inherited;
+public:
+ VimScrollBar(scrollbar_T *gsb, orientation posture);
+ ~VimScrollBar();
+
+ virtual void ValueChanged(float newValue);
+ virtual void MouseUp(BPoint where);
+ void SetValue(float newval);
+ scrollbar_T *getGsb()
+ { return gsb; }
+
+ int32 scrollEventCount;
+
+private:
+ scrollbar_T *gsb;
+ float ignoreValue;
+};
+
+
+/*
+ * For caching the fonts that are used;
+ * Vim seems rather sloppy in this regard.
+ */
+class VimFont: public BFont
+{
+ typedef BFont Inherited;
+public:
+ VimFont();
+ VimFont(const VimFont *rhs);
+ VimFont(const BFont *rhs);
+ VimFont(const VimFont &rhs);
+ ~VimFont();
+
+ VimFont *next;
+ int refcount;
+ char_u *name;
+
+private:
+ void init();
+};
+
+/* ---------------- end of GUI classes ---------------- */
+
+struct MainArgs {
+ int argc;
+ char **argv;
+};
+
+/*
+ * These messages are copied through the VDCMP.
+ * Therefore they ought not to have anything fancy.
+ * They must be of POD type (Plain Old Data)
+ * as the C++ standard calls them.
+ */
+
+#define KEY_MSG_BUFSIZ 7
+#if KEY_MSG_BUFSIZ < MAX_KEY_CODE_LEN
+#error Increase KEY_MSG_BUFSIZ!
+#endif
+
+struct VimKeyMsg {
+ char_u length;
+ char_u chars[KEY_MSG_BUFSIZ]; /* contains Vim encoding */
+};
+
+struct VimResizeMsg {
+ int width;
+ int height;
+};
+
+struct VimScrollBarMsg {
+ VimScrollBar *sb;
+ long value;
+ int stillDragging;
+};
+
+struct VimMenuMsg {
+ vimmenu_T *guiMenu;
+};
+
+struct VimMouseMsg {
+ int button;
+ int x;
+ int y;
+ int repeated_click;
+ int_u modifiers;
+};
+
+struct VimFocusMsg {
+ bool active;
+};
+
+struct VimRefsMsg {
+ BMessage *message;
+ bool changedir;
+};
+
+struct VimMsg {
+ enum VimMsgType {
+ Key, Resize, ScrollBar, Menu, Mouse, Focus, Refs
+ };
+
+ union {
+ struct VimKeyMsg Key;
+ struct VimResizeMsg NewSize;
+ struct VimScrollBarMsg Scroll;
+ struct VimMenuMsg Menu;
+ struct VimMouseMsg Mouse;
+ struct VimFocusMsg Focus;
+ struct VimRefsMsg Refs;
+ } u;
+};
+
+#define RGB(r, g, b) ((char_u)(r) << 16 | (char_u)(g) << 8 | (char_u)(b) << 0)
+#define GUI_TO_RGB(g) { (g) >> 16, (g) >> 8, (g) >> 0, 255 }
+
+/* ---------------- end of header part ---------------- */
+
+static struct specialkey
+{
+ uint16 BeKeys;
+#define KEY(a,b) ((a)<<8|(b))
+#define K(a) KEY(0,a) // for ASCII codes
+#define F(b) KEY(1,b) // for scancodes
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {K(B_UP_ARROW), 'k', 'u'},
+ {K(B_DOWN_ARROW), 'k', 'd'},
+ {K(B_LEFT_ARROW), 'k', 'l'},
+ {K(B_RIGHT_ARROW), 'k', 'r'},
+ {K(B_BACKSPACE), 'k', 'b'},
+ {K(B_INSERT), 'k', 'I'},
+ {K(B_DELETE), 'k', 'D'},
+ {K(B_HOME), 'k', 'h'},
+ {K(B_END), '@', '7'},
+ {K(B_PAGE_UP), 'k', 'P'}, /* XK_Prior */
+ {K(B_PAGE_DOWN), 'k', 'N'}, /* XK_Next, */
+
+#define FIRST_FUNCTION_KEY 11
+ {F(B_F1_KEY), 'k', '1'},
+ {F(B_F2_KEY), 'k', '2'},
+ {F(B_F3_KEY), 'k', '3'},
+ {F(B_F4_KEY), 'k', '4'},
+ {F(B_F5_KEY), 'k', '5'},
+ {F(B_F6_KEY), 'k', '6'},
+ {F(B_F7_KEY), 'k', '7'},
+ {F(B_F8_KEY), 'k', '8'},
+ {F(B_F9_KEY), 'k', '9'},
+ {F(B_F10_KEY), 'k', ';'},
+
+ {F(B_F11_KEY), 'F', '1'},
+ {F(B_F12_KEY), 'F', '2'},
+// {XK_F13, 'F', '3'}, /* would be print screen/ */
+ /* sysreq */
+ {F(0x0F), 'F', '4'}, /* scroll lock */
+ {F(0x10), 'F', '5'}, /* pause/break */
+// {XK_F16, 'F', '6'},
+// {XK_F17, 'F', '7'},
+// {XK_F18, 'F', '8'},
+// {XK_F19, 'F', '9'},
+// {XK_F20, 'F', 'A'},
+//
+// {XK_F21, 'F', 'B'},
+// {XK_F22, 'F', 'C'},
+// {XK_F23, 'F', 'D'},
+// {XK_F24, 'F', 'E'},
+// {XK_F25, 'F', 'F'},
+// {XK_F26, 'F', 'G'},
+// {XK_F27, 'F', 'H'},
+// {XK_F28, 'F', 'I'},
+// {XK_F29, 'F', 'J'},
+// {XK_F30, 'F', 'K'},
+//
+// {XK_F31, 'F', 'L'},
+// {XK_F32, 'F', 'M'},
+// {XK_F33, 'F', 'N'},
+// {XK_F34, 'F', 'O'},
+// {XK_F35, 'F', 'P'}, /* keysymdef.h defines up to F35 */
+
+// {XK_Help, '%', '1'}, /* XK_Help */
+ {F(B_PRINT_KEY), '%', '9'},
+
+#if 0
+ /* Keypad keys: */
+ {F(0x48), 'k', 'l'}, /* XK_KP_Left */
+ {F(0x4A), 'k', 'r'}, /* XK_KP_Right */
+ {F(0x38), 'k', 'u'}, /* XK_KP_Up */
+ {F(0x59), 'k', 'd'}, /* XK_KP_Down */
+ {F(0x64), 'k', 'I'}, /* XK_KP_Insert */
+ {F(0x65), 'k', 'D'}, /* XK_KP_Delete */
+ {F(0x37), 'k', 'h'}, /* XK_KP_Home */
+ {F(0x58), '@', '7'}, /* XK_KP_End */
+ {F(0x39), 'k', 'P'}, /* XK_KP_Prior */
+ {F(0x60), 'k', 'N'}, /* XK_KP_Next */
+ {F(0x49), '&', '8'}, /* XK_Undo, keypad 5 */
+#endif
+
+ /* End of list marker: */
+ {0, 0, 0}
+};
+
+#define NUM_SPECIAL_KEYS (sizeof(special_keys)/sizeof(special_keys[0]))
+
+/* ---------------- VimApp ---------------- */
+
+ static void
+docd(BPath &path)
+{
+ mch_chdir(path.Path());
+ /* Do this to get the side effects of a :cd command */
+ do_cmdline_cmd((char_u *)"cd .");
+}
+
+/*
+ * Really handle dropped files and folders.
+ */
+ static void
+RefsReceived(BMessage *m, bool changedir)
+{
+ uint32 type;
+ int32 count;
+
+ //m->PrintToStream();
+ switch (m->what) {
+ case B_REFS_RECEIVED:
+ case B_SIMPLE_DATA:
+ m->GetInfo("refs", &type, &count);
+ if (type != B_REF_TYPE)
+ goto bad;
+ break;
+ case B_ARGV_RECEIVED:
+ m->GetInfo("argv", &type, &count);
+ if (type != B_STRING_TYPE)
+ goto bad;
+ if (changedir) {
+ char *dirname;
+ if (m->FindString("cwd", (const char **) &dirname) == B_OK) {
+ chdir(dirname);
+ do_cmdline_cmd((char_u *)"cd .");
+ }
+ }
+ break;
+ default:
+ bad:
+ //fprintf(stderr, "bad!\n");
+ delete m;
+ return;
+ }
+
+#ifdef FEAT_VISUAL
+ reset_VIsual();
+#endif
+
+ char_u **fnames;
+ fnames = (char_u **) alloc(count * sizeof(char_u *));
+ int fname_index = 0;
+
+ switch (m->what) {
+ case B_REFS_RECEIVED:
+ case B_SIMPLE_DATA:
+ //fprintf(stderr, "case B_REFS_RECEIVED\n");
+ for (int i = 0; i < count; ++i)
+ {
+ entry_ref ref;
+ if (m->FindRef("refs", i, &ref) == B_OK) {
+ BEntry entry(&ref, false);
+ BPath path;
+ entry.GetPath(&path);
+
+ /* Change to parent directory? */
+ if (changedir) {
+ BPath parentpath;
+ path.GetParent(&parentpath);
+ docd(parentpath);
+ }
+
+ /* Is it a directory? If so, cd into it. */
+ BDirectory bdir(&ref);
+ if (bdir.InitCheck() == B_OK) {
+ /* don't cd if we already did it */
+ if (!changedir)
+ docd(path);
+ } else {
+ mch_dirname(IObuff, IOSIZE);
+ char_u *fname = shorten_fname((char_u *)path.Path(), IObuff);
+ if (fname == NULL)
+ fname = (char_u *)path.Path();
+ fnames[fname_index++] = vim_strsave(fname);
+ //fprintf(stderr, "%s\n", fname);
+ }
+
+ /* Only do it for the first file/dir */
+ changedir = false;
+ }
+ }
+ break;
+ case B_ARGV_RECEIVED:
+ //fprintf(stderr, "case B_ARGV_RECEIVED\n");
+ for (int i = 1; i < count; ++i)
+ {
+ char *fname;
+
+ if (m->FindString("argv", i, (const char **) &fname) == B_OK) {
+ fnames[fname_index++] = vim_strsave((char_u *)fname);
+ }
+ }
+ break;
+ default:
+ //fprintf(stderr, "case default\n");
+ break;
+ }
+
+ delete m;
+
+ /* Handle the drop, :edit to get to the file */
+ if (fname_index > 0) {
+ handle_drop(fname_index, fnames, FALSE);
+
+ /* Update the screen display */
+ update_screen(NOT_VALID);
+ setcursor();
+ out_flush();
+ } else {
+ vim_free(fnames);
+ }
+}
+
+VimApp::VimApp(const char *appsig):
+ BApplication(appsig)
+{
+}
+
+VimApp::~VimApp()
+{
+}
+
+ void
+VimApp::ReadyToRun()
+{
+ /*
+ * Apparently signals are inherited by the created thread -
+ * disable the most annoying ones.
+ */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
+}
+
+ void
+VimApp::ArgvReceived(int32 arg_argc, char **arg_argv)
+{
+ if (!IsLaunching()) {
+ /*
+ * This can happen if we are set to Single or Exclusive
+ * Launch. Be nice and open the file(s).
+ */
+ if (gui.vimWindow)
+ gui.vimWindow->Minimize(false);
+ BMessage *m = CurrentMessage();
+ DetachCurrentMessage();
+ SendRefs(m, true);
+ }
+}
+
+ void
+VimApp::RefsReceived(BMessage *m)
+{
+ /* Horrible hack!!! XXX XXX XXX
+ * The real problem is that b_start_ffc is set too late for
+ * the initial empty buffer. As a result the window will be
+ * split instead of abandoned.
+ */
+ int limit = 15;
+ while (--limit >= 0 && (curbuf == NULL || curbuf->b_start_ffc == 0))
+ snooze(100000); // 0.1 s
+ if (gui.vimWindow)
+ gui.vimWindow->Minimize(false);
+ DetachCurrentMessage();
+ SendRefs(m, true);
+}
+
+/*
+ * Pass a BMessage on to the main() thread.
+ * Caller must have detached the message.
+ */
+ void
+VimApp::SendRefs(BMessage *m, bool changedir)
+{
+ VimRefsMsg rm;
+ rm.message = m;
+ rm.changedir = changedir;
+
+ write_port(gui.vdcmp, VimMsg::Refs, &rm, sizeof(rm));
+ // calls ::RefsReceived
+}
+
+ bool
+VimApp::QuitRequested()
+{
+ (void)Inherited::QuitRequested();
+ return false;
+}
+
+/* ---------------- VimWindow ---------------- */
+
+VimWindow::VimWindow():
+ BWindow(BRect(40, 40, 150, 150),
+ "Vim",
+ B_TITLED_WINDOW,
+ 0,
+ B_CURRENT_WORKSPACE)
+
+{
+ init();
+}
+
+VimWindow::~VimWindow()
+{
+ if (formView) {
+ RemoveChild(formView);
+ delete formView;
+ }
+ gui.vimWindow = NULL;
+}
+
+ void
+VimWindow::init()
+{
+ /* Attach the VimFormView */
+ formView = new VimFormView(Bounds());
+ if (formView != NULL) {
+ AddChild(formView);
+ }
+}
+
+ void
+VimWindow::DispatchMessage(BMessage *m, BHandler *h)
+{
+ /*
+ * Route B_MOUSE_UP messages to MouseUp(), in
+ * a manner that should be compatible with the
+ * intended future system behaviour.
+ */
+ switch (m->what) {
+ case B_MOUSE_UP:
+ // if (!h) h = PreferredHandler();
+// gcc isn't happy without this extra set of braces, complains about
+// jump to case label crosses init of 'class BView * v'
+// richard@whitequeen.com jul 99
+ {
+ BView *v = dynamic_cast<BView *>(h);
+ if (v) {
+ //m->PrintToStream();
+ BPoint where;
+ m->FindPoint("where", &where);
+ v->MouseUp(where);
+ } else {
+ Inherited::DispatchMessage(m, h);
+ }
+ }
+ break;
+ default:
+ Inherited::DispatchMessage(m, h);
+ }
+}
+
+ void
+VimWindow::WindowActivated(bool active)
+{
+ Inherited::WindowActivated(active);
+ /* the textArea gets the keyboard action */
+ if (active && gui.vimTextArea)
+ gui.vimTextArea->MakeFocus(true);
+
+ struct VimFocusMsg fm;
+ fm.active = active;
+
+ write_port(gui.vdcmp, VimMsg::Focus, &fm, sizeof(fm));
+}
+
+ bool
+VimWindow::QuitRequested()
+{
+ struct VimKeyMsg km;
+ km.length = 5;
+ memcpy((char *)km.chars, "\033:qa\r", km.length);
+
+ write_port(gui.vdcmp, VimMsg::Key, &km, sizeof(km));
+
+ return false;
+}
+
+/* ---------------- VimFormView ---------------- */
+
+VimFormView::VimFormView(BRect frame):
+ BView(frame, "VimFormView", B_FOLLOW_ALL_SIDES,
+ B_WILL_DRAW | B_FRAME_EVENTS),
+ menuBar(NULL),
+ textArea(NULL)
+{
+ init(frame);
+}
+
+VimFormView::~VimFormView()
+{
+ if (menuBar) {
+ RemoveChild(menuBar);
+#ifdef never
+ // deleting the menuBar leads to SEGV on exit
+ // richard@whitequeen.com Jul 99
+ delete menuBar;
+#endif
+ }
+ if (textArea) {
+ RemoveChild(textArea);
+ delete textArea;
+ }
+ gui.vimForm = NULL;
+}
+
+ void
+VimFormView::init(BRect frame)
+{
+ menuBar = new BMenuBar(BRect(0,0,-MENUBAR_MARGIN,-MENUBAR_MARGIN),
+ "VimMenuBar");
+
+ AddChild(menuBar);
+
+ BRect remaining = frame;
+ textArea = new VimTextAreaView(remaining);
+ AddChild(textArea);
+ /* The textArea will be resized later when menus are added */
+
+ gui.vimForm = this;
+}
+
+ void
+VimFormView::AllAttached()
+{
+ /*
+ * Apparently signals are inherited by the created thread -
+ * disable the most annoying ones.
+ */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
+
+ if (menuBar && textArea) {
+ /*
+ * Resize the textArea to fill the space left over by the menu.
+ * This is somewhat futile since it will be done again once
+ * menus are added to the menu bar.
+ */
+ BRect remaining = Bounds();
+ remaining.top = MenuHeight();
+ textArea->ResizeTo(remaining.Width(), remaining.Height());
+ textArea->MoveTo(remaining.left, remaining.top);
+
+#ifdef FEAT_MENU
+ menuBar->ResizeTo(remaining.right, remaining.top);
+ gui.menu_height = (int) remaining.top;
+#endif
+ }
+ Inherited::AllAttached();
+}
+
+ void
+VimFormView::FrameResized(float new_width, float new_height)
+{
+ BWindow *w = Window();
+#if 1
+ /*
+ * Look if there are more resize messages in the queue.
+ * If so, ignore this one. The later one will be handled
+ * eventually.
+ */
+ BMessageQueue *q = w->MessageQueue();
+ if (q->FindMessage(B_VIEW_RESIZED, 0) != NULL) {
+ return;
+ }
+#endif
+ new_width += 1; // adjust from width to number of pixels occupied
+ new_height += 1;
+
+#if !HAVE_R3_OR_LATER
+ int adjust_h, adjust_w;
+
+ adjust_w = ((int)new_width - gui_get_base_width()) % gui.char_width;
+ adjust_h = ((int)new_height - gui_get_base_height()) % gui.char_height;
+
+ if (adjust_w > 0 || adjust_h > 0) {
+ /*
+ * This will generate a new FrameResized() message.
+ * If we're running R3 or later, SetWindowAlignment() should make
+ * sure that this does not happen.
+ */
+ w->ResizeBy(-adjust_w, -adjust_h);
+
+ return;
+ }
+#endif
+
+ struct VimResizeMsg sm;
+ sm.width = (int) new_width;
+ sm.height = (int) new_height;
+
+ write_port(gui.vdcmp, VimMsg::Resize, &sm, sizeof(sm));
+ // calls gui_resize_shell(new_width, new_height);
+
+ return;
+
+ /*
+ * The area below the vertical scrollbar is erased to the colour
+ * set with SetViewColor() automatically, because we had set
+ * B_WILL_DRAW. Resizing the window tight around the vertical
+ * scroll bar also helps to avoid debris.
+ */
+}
+
+/* ---------------- VimTextAreaView ---------------- */
+
+VimTextAreaView::VimTextAreaView(BRect frame):
+ BView(frame, "VimTextAreaView", B_FOLLOW_ALL_SIDES,
+ B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE),
+ mouseDragEventCount(0)
+{
+ init(frame);
+}
+
+VimTextAreaView::~VimTextAreaView()
+{
+ gui.vimTextArea = NULL;
+}
+
+ void
+VimTextAreaView::init(BRect frame)
+{
+ /* set up global var for fast access */
+ gui.vimTextArea = this;
+
+ /*
+ * Tell the app server not to erase the view: we will
+ * fill it in completely by ourselves.
+ * (Does this really work? Even if not, it won't harm either.)
+ */
+ SetViewColor(B_TRANSPARENT_32_BIT);
+#define PEN_WIDTH 1
+ SetPenSize(PEN_WIDTH);
+}
+
+ void
+VimTextAreaView::Draw(BRect updateRect)
+{
+ /*
+ * XXX Other ports call here:
+ * out_flush(); * make sure all output has been processed *
+ * but we can't do that, since it involves too much information
+ * that is owned by other threads...
+ */
+
+ /*
+ * No need to use gui.vimWindow->Lock(): we are locked already.
+ * However, it would not hurt.
+ */
+ gui_redraw((int) updateRect.left, (int) updateRect.top,
+ (int) (updateRect.Width() + PEN_WIDTH), (int) (updateRect.Height() + PEN_WIDTH));
+
+ /* Clear the border areas if needed */
+ rgb_color rgb = GUI_TO_RGB(gui.back_pixel);
+ SetLowColor(rgb);
+
+ if (updateRect.left < FILL_X(0)) // left border
+ FillRect(BRect(updateRect.left, updateRect.top,
+ FILL_X(0)-PEN_WIDTH, updateRect.bottom), B_SOLID_LOW);
+ if (updateRect.top < FILL_Y(0)) // top border
+ FillRect(BRect(updateRect.left, updateRect.top,
+ updateRect.right, FILL_Y(0)-PEN_WIDTH), B_SOLID_LOW);
+ if (updateRect.right >= FILL_X(Columns)) // right border
+ FillRect(BRect(FILL_X((int)Columns), updateRect.top,
+ updateRect.right, updateRect.bottom), B_SOLID_LOW);
+ if (updateRect.bottom >= FILL_Y(Rows)) // bottom border
+ FillRect(BRect(updateRect.left, FILL_Y((int)Rows),
+ updateRect.right, updateRect.bottom), B_SOLID_LOW);
+}
+
+ void
+VimTextAreaView::KeyDown(const char *bytes, int32 numBytes)
+{
+ struct VimKeyMsg km;
+ char_u *dest = km.chars;
+
+ BMessage *msg = Window()->CurrentMessage();
+ assert(msg);
+ //msg->PrintToStream();
+
+ /*
+ * Convert special keys to Vim codes.
+ * I think it is better to do it in the window thread
+ * so we use at least a little bit of the potential
+ * of our 2 CPUs. Besides, due to the fantastic mapping
+ * of special keys to UTF-8, we have quite some work to
+ * do...
+ * TODO: I'm not quite happy with detection of special
+ * keys. Perhaps I should use scan codes after all...
+ */
+ if (numBytes > 1) {
+ /* This cannot be a special key */
+ if (numBytes > KEY_MSG_BUFSIZ)
+ numBytes = KEY_MSG_BUFSIZ; // should never happen... ???
+ km.length = numBytes;
+ memcpy((char *)dest, bytes, numBytes);
+ } else {
+ int32 scancode = 0;
+ msg->FindInt32("key", &scancode);
+
+ int32 beModifiers = 0;
+ msg->FindInt32("modifiers", &beModifiers);
+
+ char_u string[3];
+ int len = 0;
+ km.length = 0;
+
+ bool canHaveVimModifiers = false;
+
+ /*
+ * For normal, printable ASCII characters, don't look them up
+ * to check if they might be a special key. They aren't.
+ */
+ assert(B_BACKSPACE <= 0x20);
+ assert(B_DELETE == 0x7F);
+ if (((char_u)bytes[0] <= 0x20 || (char_u)bytes[0] == 0x7F) &&
+ numBytes == 1) {
+ /*
+ * Due to the great nature of Be's mapping of special keys,
+ * viz. into the range of the control characters,
+ * we can only be sure it is *really* a special key if
+ * if it is special without using ctrl. So, only if ctrl is
+ * used, we need to check it unmodified.
+ */
+ if (beModifiers & B_CONTROL_KEY) {
+ int index = keyMap->normal_map[scancode];
+ int newNumBytes = keyMapChars[index];
+ char_u *newBytes = (char_u *)&keyMapChars[index + 1];
+
+ /*
+ * Check if still special without the control key.
+ * This is needed for BACKSPACE: that key does produce
+ * different values with modifiers (DEL).
+ * Otherwise we could simply have checked for equality.
+ */
+ if (newNumBytes != 1 || (*newBytes > 0x20 &&
+ *newBytes != 0x7F )) {
+ goto notspecial;
+ }
+ bytes = (char *)newBytes;
+ }
+ canHaveVimModifiers = true;
+
+ uint16 beoskey;
+ int first, last;
+
+ /*
+ * If numBytes == 0 that probably always indicates a special key.
+ * (does not happen yet)
+ */
+ if (numBytes == 0 || bytes[0] == B_FUNCTION_KEY) {
+ beoskey = F(scancode);
+ first = FIRST_FUNCTION_KEY;
+ last = NUM_SPECIAL_KEYS;
+ } else if (*bytes == '\n' && scancode == 0x47) {
+ /* remap the (non-keypad) ENTER key from \n to \r. */
+ string[0] = '\r';
+ len = 1;
+ first = last = 0;
+ } else {
+ beoskey = K(bytes[0]);
+ first = 0;
+ last = FIRST_FUNCTION_KEY;
+ }
+
+ for (int i = first; i < last; i++) {
+ if (special_keys[i].BeKeys == beoskey) {
+ string[0] = CSI;
+ string[1] = special_keys[i].vim_code0;
+ string[2] = special_keys[i].vim_code1;
+ len = 3;
+ }
+ }
+ }
+ notspecial:
+ if (len == 0) {
+ string[0] = bytes[0];
+ len = 1;
+ }
+
+ /* Special keys (and a few others) may have modifiers */
+#if 0
+ if (len == 3 ||
+ bytes[0] == B_SPACE || bytes[0] == B_TAB ||
+ bytes[0] == B_RETURN || bytes[0] == '\r' ||
+ bytes[0] == B_ESCAPE)
+#else
+ if (canHaveVimModifiers)
+#endif
+ {
+ int modifiers;
+ modifiers = 0;
+ if (beModifiers & B_SHIFT_KEY)
+ modifiers |= MOD_MASK_SHIFT;
+ if (beModifiers & B_CONTROL_KEY)
+ modifiers |= MOD_MASK_CTRL;
+ if (beModifiers & B_OPTION_KEY)
+ modifiers |= MOD_MASK_ALT;
+
+ /*
+ * For some keys a shift modifier is translated into another key
+ * code. Do we need to handle the case where len != 1 and
+ * string[0] != CSI? (Not for BeOS, since len == 3 implies
+ * string[0] == CSI...)
+ */
+ int key;
+ if (string[0] == CSI && len == 3)
+ key = TO_SPECIAL(string[1], string[2]);
+ else
+ key = string[0];
+ key = simplify_key(key, &modifiers);
+ if (IS_SPECIAL(key))
+ {
+ string[0] = CSI;
+ string[1] = K_SECOND(key);
+ string[2] = K_THIRD(key);
+ len = 3;
+ }
+ else
+ {
+ string[0] = key;
+ len = 1;
+ }
+
+ if (modifiers)
+ {
+ *dest++ = CSI;
+ *dest++ = KS_MODIFIER;
+ *dest++ = modifiers;
+ km.length = 3;
+ }
+ }
+ memcpy((char *)dest, string, len);
+ km.length += len;
+ }
+
+ write_port(gui.vdcmp, VimMsg::Key, &km, sizeof(km));
+
+ /*
+ * blank out the pointer if necessary
+ */
+ if (p_mh && !gui.pointer_hidden)
+ {
+ guiBlankMouse(true);
+ gui.pointer_hidden = TRUE;
+ }
+}
+ void
+VimTextAreaView::guiSendMouseEvent(
+ int button,
+ int x,
+ int y,
+ int repeated_click,
+ int_u modifiers)
+{
+ VimMouseMsg mm;
+
+ mm.button = button;
+ mm.x = x;
+ mm.y = y;
+ mm.repeated_click = repeated_click;
+ mm.modifiers = modifiers;
+
+ write_port(gui.vdcmp, VimMsg::Mouse, &mm, sizeof(mm));
+ // calls gui_send_mouse_event()
+
+ /*
+ * if our pointer is currently hidden, then we should show it.
+ */
+ if (gui.pointer_hidden)
+ {
+ guiBlankMouse(false);
+ gui.pointer_hidden = FALSE;
+ }
+}
+
+ void
+VimTextAreaView::guiBlankMouse(bool should_hide)
+{
+ if (should_hide) {
+ //gui.vimApp->HideCursor();
+ gui.vimApp->ObscureCursor();
+ /*
+ * ObscureCursor() would even be easier, but then
+ * Vim's idea of mouse visibility does not necessarily
+ * correspond to reality.
+ */
+ } else {
+ //gui.vimApp->ShowCursor();
+ }
+}
+
+ int_u
+VimTextAreaView::mouseModifiersToVim(int32 beModifiers)
+{
+ int_u vim_modifiers = 0x0;
+
+ if (beModifiers & B_SHIFT_KEY)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (beModifiers & B_CONTROL_KEY)
+ vim_modifiers |= MOUSE_CTRL;
+ if (beModifiers & B_OPTION_KEY) /* Alt or Meta key */
+ vim_modifiers |= MOUSE_ALT;
+
+ return vim_modifiers;
+}
+
+ void
+VimTextAreaView::MouseDown(BPoint point)
+{
+ BMessage *m = Window()->CurrentMessage();
+ assert(m);
+
+ int32 buttons = 0;
+ m->FindInt32("buttons", &buttons);
+
+ int vimButton;
+
+ if (buttons & B_PRIMARY_MOUSE_BUTTON)
+ vimButton = MOUSE_LEFT;
+ else if (buttons & B_SECONDARY_MOUSE_BUTTON)
+ vimButton = MOUSE_RIGHT;
+ else if (buttons & B_TERTIARY_MOUSE_BUTTON)
+ vimButton = MOUSE_MIDDLE;
+ else
+ return; /* Unknown button */
+
+ vimMouseButton = 1; /* don't care which one */
+
+ /* Handle multiple clicks */
+ int32 clicks = 0;
+ m->FindInt32("clicks", &clicks);
+
+ int32 modifiers = 0;
+ m->FindInt32("modifiers", &modifiers);
+
+ vimMouseModifiers = mouseModifiersToVim(modifiers);
+
+ guiSendMouseEvent(vimButton, point.x, point.y,
+ clicks > 1 /* = repeated_click*/, vimMouseModifiers);
+}
+
+ void
+VimTextAreaView::MouseUp(BPoint point)
+{
+ vimMouseButton = 0;
+
+ BMessage *m = Window()->CurrentMessage();
+ assert(m);
+ //m->PrintToStream();
+
+ int32 modifiers = 0;
+ m->FindInt32("modifiers", &modifiers);
+
+ vimMouseModifiers = mouseModifiersToVim(modifiers);
+
+ guiSendMouseEvent(MOUSE_RELEASE, point.x, point.y,
+ 0 /* = repeated_click*/, vimMouseModifiers);
+
+ Inherited::MouseUp(point);
+}
+
+ void
+VimTextAreaView::MouseMoved(BPoint point, uint32 transit, const BMessage *message)
+{
+ /*
+ * if our pointer is currently hidden, then we should show it.
+ */
+ if (gui.pointer_hidden)
+ {
+ guiBlankMouse(false);
+ gui.pointer_hidden = FALSE;
+ }
+
+ if (!vimMouseButton) /* could also check m->"buttons" */
+ return;
+
+ atomic_add(&mouseDragEventCount, 1);
+
+ /* Don't care much about "transit" */
+ guiSendMouseEvent(MOUSE_DRAG, point.x, point.y, 0, vimMouseModifiers);
+}
+
+ void
+VimTextAreaView::MessageReceived(BMessage *m)
+{
+ switch (m->what) {
+ case 'menu':
+ {
+ VimMenuMsg mm;
+ mm.guiMenu = NULL; /* in case no pointer in msg */
+ m->FindPointer("VimMenu", (void **)&mm.guiMenu);
+
+ write_port(gui.vdcmp, VimMsg::Menu, &mm, sizeof(mm));
+ }
+ break;
+ default:
+ if (m->WasDropped()) {
+ BWindow *w = Window();
+ w->DetachCurrentMessage();
+ w->Minimize(false);
+ VimApp::SendRefs(m, (modifiers() & B_SHIFT_KEY) != 0);
+ } else {
+ Inherited::MessageReceived(m);
+ }
+ break;
+ }
+}
+
+ int
+VimTextAreaView::mchInitFont(char_u *name)
+{
+ VimFont *newFont = (VimFont *)gui_mch_get_font(name, 0);
+
+ gui.norm_font = (GuiFont)newFont;
+ gui_mch_set_font((GuiFont)newFont);
+ if (name)
+ hl_set_font_name(name);
+
+ SetDrawingMode(B_OP_COPY);
+
+ /*
+ * Try to load other fonts for bold, italic, and bold-italic.
+ * We should also try to work out what font to use for these when they are
+ * not specified by X resources, but we don't yet.
+ */
+
+ return OK;
+}
+
+ void
+VimTextAreaView::mchDrawString(int row, int col, char_u *s, int len, int flags)
+{
+ /*
+ * First we must erase the area, because DrawString won't do
+ * that for us. XXX Most of the time this is a waste of effort
+ * since the bachground has been erased already... DRAW_TRANSP
+ * should be set when appropriate!!!
+ * (Rectangles include the bottom and right edge)
+ */
+ if (!(flags & DRAW_TRANSP)) {
+ BRect r(FILL_X(col), FILL_Y(row),
+ FILL_X(col + len) - PEN_WIDTH, FILL_Y(row + 1) - PEN_WIDTH);
+ FillRect(r, B_SOLID_LOW);
+ }
+ BPoint where(TEXT_X(col), TEXT_Y(row));
+ DrawString((char *)s, len, where);
+
+ if (flags & DRAW_BOLD) {
+ where.x += 1.0;
+ SetDrawingMode(B_OP_BLEND);
+ DrawString((char *)s, len, where);
+ SetDrawingMode(B_OP_COPY);
+ }
+ if (flags & DRAW_UNDERL) {
+ BPoint start(FILL_X(col), FILL_Y(row + 1) - PEN_WIDTH);
+ BPoint end(FILL_X(col + len) - PEN_WIDTH, start.y);
+
+ StrokeLine(start, end);
+ }
+}
+
+ void
+VimTextAreaView::mchClearBlock(
+ int row1,
+ int col1,
+ int row2,
+ int col2)
+{
+ BRect r(FILL_X(col1), FILL_Y(row1),
+ FILL_X(col2 + 1) - PEN_WIDTH, FILL_Y(row2 + 1) - PEN_WIDTH);
+ gui_mch_set_bg_color(gui.back_pixel);
+ FillRect(r, B_SOLID_LOW);
+}
+
+ void
+VimTextAreaView::mchClearAll()
+{
+ gui_mch_set_bg_color(gui.back_pixel);
+ FillRect(Bounds(), B_SOLID_LOW);
+}
+
+/*
+ * mchDeleteLines() Lock()s the window by itself.
+ */
+ void
+VimTextAreaView::mchDeleteLines(int row, int num_lines)
+{
+ if (row + num_lines > gui.scroll_region_bot)
+ {
+ /* Scrolled out of region, just blank the lines out */
+ gui_clear_block(row, gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ }
+ else
+ {
+ /* copy one extra pixel, for when bold has spilled over */
+ int width = gui.char_width * (gui.scroll_region_right
+ - gui.scroll_region_left + 1) + 1 - PEN_WIDTH;
+ int height = gui.char_height *
+ (gui.scroll_region_bot - row - num_lines + 1) - PEN_WIDTH;
+
+ BRect source, dest;
+
+ source.left = FILL_X(gui.scroll_region_left);
+ source.top = FILL_Y(row + num_lines);
+ source.right = source.left + width;
+ source.bottom = source.top + height;
+
+ dest.left = FILL_X(gui.scroll_region_left);
+ dest.top = FILL_Y(row);
+ dest.right = dest.left + width;
+ dest.bottom = dest.top + height;
+
+ /* XXX Attempt at a hack: */
+ gui.vimWindow->UpdateIfNeeded();
+#if 0
+ /* XXX Attempt at a hack: */
+ if (gui.vimWindow->NeedsUpdate()) {
+ fprintf(stderr, "mchDeleteLines: NeedsUpdate!\n");
+ gui.vimWindow->UpdateIfNeeded();
+ while (gui.vimWindow->NeedsUpdate()) {
+ if (false && gui.vimWindow->Lock()) {
+ Sync();
+ gui.vimWindow->Unlock();
+ }
+ snooze(2);
+ }
+ }
+#endif
+
+ if (gui.vimWindow->Lock()) {
+ Sync();
+ CopyBits(source, dest);
+ //Sync();
+
+ /* Update gui.cursor_row if the cursor scrolled or copied over */
+ if (gui.cursor_row >= row
+ && gui.cursor_col >= gui.scroll_region_left
+ && gui.cursor_col <= gui.scroll_region_right)
+ {
+ if (gui.cursor_row < row + num_lines)
+ gui.cursor_is_valid = FALSE;
+ else if (gui.cursor_row <= gui.scroll_region_bot)
+ gui.cursor_row -= num_lines;
+ }
+
+ /* Clear one column more for when bold has spilled over */
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+
+ gui.vimWindow->Unlock();
+ /*
+ * The Draw() callback will be called now if some of the source
+ * bits were not in the visible region.
+ */
+
+ //gui_x11_check_copy_area();
+ }
+ }
+}
+
+/*
+ * mchInsertLines() Lock()s the window by itself.
+ */
+ void
+VimTextAreaView::mchInsertLines(int row, int num_lines)
+{
+ if (row + num_lines > gui.scroll_region_bot)
+ {
+ /* Scrolled out of region, just blank the lines out */
+ gui_clear_block(row, gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ }
+ else
+ {
+ /* copy one extra pixel, for when bold has spilled over */
+ int width = gui.char_width * (gui.scroll_region_right
+ - gui.scroll_region_left + 1) + 1 - PEN_WIDTH;
+ int height = gui.char_height *
+ (gui.scroll_region_bot - row - num_lines + 1) - PEN_WIDTH;
+
+ BRect source, dest;
+
+ source.left = FILL_X(gui.scroll_region_left);
+ source.top = FILL_Y(row);
+ source.right = source.left + width;
+ source.bottom = source.top + height;
+
+ dest.left = FILL_X(gui.scroll_region_left);
+ dest.top = FILL_Y(row + num_lines);
+ dest.right = dest.left + width;
+ dest.bottom = dest.top + height;
+
+ /* XXX Attempt at a hack: */
+ gui.vimWindow->UpdateIfNeeded();
+#if 0
+ /* XXX Attempt at a hack: */
+ if (gui.vimWindow->NeedsUpdate())
+ fprintf(stderr, "mchInsertLines: NeedsUpdate!\n");
+ gui.vimWindow->UpdateIfNeeded();
+ while (gui.vimWindow->NeedsUpdate())
+ snooze(2);
+#endif
+
+ if (gui.vimWindow->Lock()) {
+ Sync();
+ CopyBits(source, dest);
+ //Sync();
+
+ /* Update gui.cursor_row if the cursor scrolled or copied over */
+ if (gui.cursor_row >= gui.row
+ && gui.cursor_col >= gui.scroll_region_left
+ && gui.cursor_col <= gui.scroll_region_right)
+ {
+ if (gui.cursor_row <= gui.scroll_region_bot - num_lines)
+ gui.cursor_row += num_lines;
+ else if (gui.cursor_row <= gui.scroll_region_bot)
+ gui.cursor_is_valid = FALSE;
+ }
+ /* Clear one column more for when bold has spilled over */
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+
+ gui.vimWindow->Unlock();
+ /*
+ * The Draw() callback will be called now if some of the source
+ * bits were not in the visible region.
+ * However, if we scroll too fast it can't keep up and the
+ * update region gets messed up. This seems to be because copying
+ * un-Draw()n bits does not generate Draw() calls for the copy...
+ * I moved the hack to before the CopyBits() to reduce the
+ * amount of additional waiting needed.
+ */
+
+ //gui_x11_check_copy_area();
+ }
+ }
+
+}
+
+/* ---------------- VimScrollBar ---------------- */
+
+/* BUG: XXX
+ * It seems that BScrollBar determine their direction not from
+ * "posture" but from if they are "tall" or "wide" in shape...
+ *
+ * Also, place them out of sight, because Vim enables them before
+ * they are positioned.
+ */
+VimScrollBar::VimScrollBar(scrollbar_T *g, orientation posture):
+ BScrollBar(posture == B_HORIZONTAL ? BRect(-100,-100,-10,-90) :
+ BRect(-100,-100,-90,-10),
+ "vim scrollbar", (BView *)NULL,
+ 0.0, 10.0, posture),
+ ignoreValue(-1),
+ scrollEventCount(0)
+{
+ gsb = g;
+ SetResizingMode(B_FOLLOW_NONE);
+}
+
+VimScrollBar::~VimScrollBar()
+{
+}
+
+ void
+VimScrollBar::ValueChanged(float newValue)
+{
+ if (ignoreValue >= 0.0 && newValue == ignoreValue) {
+ ignoreValue = -1;
+ return;
+ }
+ ignoreValue = -1;
+ /*
+ * We want to throttle the amount of scroll messages generated.
+ * Normally I presume you won't get a new message before we've
+ * handled the previous one, but because we're passing them on this
+ * happens very quickly. So instead we keep a counter of how many
+ * scroll events there are (or will be) in the VDCMP, and the
+ * throttling happens at the receiving end.
+ */
+ atomic_add(&scrollEventCount, 1);
+
+ struct VimScrollBarMsg sm;
+
+ sm.sb = this;
+ sm.value = (long) newValue;
+ sm.stillDragging = TRUE;
+
+ write_port(gui.vdcmp, VimMsg::ScrollBar, &sm, sizeof(sm));
+
+ // calls gui_drag_scrollbar(sb, newValue, TRUE);
+}
+
+/*
+ * When the mouse goes up, report that scrolling has stopped.
+ * MouseUp() is NOT called when the mouse-up occurs outside
+ * the window, even though the thumb does move while the mouse
+ * is outside... This has some funny effects... XXX
+ * So we do special processing when the window de/activates.
+ */
+ void
+VimScrollBar::MouseUp(BPoint where)
+{
+ //BMessage *m = Window()->CurrentMessage();
+ //m->PrintToStream();
+
+ atomic_add(&scrollEventCount, 1);
+
+ struct VimScrollBarMsg sm;
+
+ sm.sb = this;
+ sm.value = (long) Value();
+ sm.stillDragging = FALSE;
+
+ write_port(gui.vdcmp, VimMsg::ScrollBar, &sm, sizeof(sm));
+
+ // calls gui_drag_scrollbar(sb, newValue, FALSE);
+
+ Inherited::MouseUp(where);
+}
+
+ void
+VimScrollBar::SetValue(float newValue)
+{
+ if (newValue == Value())
+ return;
+
+ ignoreValue = newValue;
+ Inherited::SetValue(newValue);
+}
+
+/* ---------------- VimFont ---------------- */
+
+VimFont::VimFont(): BFont()
+{
+ init();
+}
+
+VimFont::VimFont(const VimFont *rhs): BFont(rhs)
+{
+ init();
+}
+
+VimFont::VimFont(const BFont *rhs): BFont(rhs)
+{
+ init();
+}
+
+VimFont::VimFont(const VimFont &rhs): BFont(rhs)
+{
+ init();
+}
+
+VimFont::~VimFont()
+{
+}
+
+ void
+VimFont::init()
+{
+ next = NULL;
+ refcount = 1;
+ name = NULL;
+}
+
+/* ---------------- ---------------- */
+
+// some global variables
+static char appsig[] = "application/x-vnd.Rhialto-Vim-5";
+key_map *keyMap;
+char *keyMapChars;
+int main_exitcode = 127;
+
+ status_t
+gui_beos_process_event(bigtime_t timeout)
+{
+ struct VimMsg vm;
+ long what;
+ ssize_t size;
+
+ size = read_port_etc(gui.vdcmp, &what, &vm, sizeof(vm),
+ B_TIMEOUT, timeout);
+
+ if (size >= 0) {
+ switch (what) {
+ case VimMsg::Key:
+ {
+ char_u *string = vm.u.Key.chars;
+ int len = vm.u.Key.length;
+ if (len == 1 && string[0] == Ctrl_chr('C')) {
+ trash_input_buf();
+ got_int = TRUE;
+ }
+ add_to_input_buf(string, len);
+ }
+ break;
+ case VimMsg::Resize:
+ gui_resize_shell(vm.u.NewSize.width, vm.u.NewSize.height);
+ break;
+ case VimMsg::ScrollBar:
+ {
+ /*
+ * If loads of scroll messages queue up, use only the last
+ * one. Always report when the scrollbar stops dragging.
+ * This is not perfect yet anyway: these events are queued
+ * yet again, this time in the keyboard input buffer.
+ */
+ int32 oldCount =
+ atomic_add(&vm.u.Scroll.sb->scrollEventCount, -1);
+ if (oldCount <= 1 || !vm.u.Scroll.stillDragging)
+ gui_drag_scrollbar(vm.u.Scroll.sb->getGsb(),
+ vm.u.Scroll.value, vm.u.Scroll.stillDragging);
+ }
+ break;
+ case VimMsg::Menu:
+ gui_menu_cb(vm.u.Menu.guiMenu);
+ break;
+ case VimMsg::Mouse:
+ {
+ int32 oldCount;
+ if (vm.u.Mouse.button == MOUSE_DRAG)
+ oldCount =
+ atomic_add(&gui.vimTextArea->mouseDragEventCount, -1);
+ else
+ oldCount = 0;
+ if (oldCount <= 1)
+ gui_send_mouse_event(vm.u.Mouse.button, vm.u.Mouse.x,
+ vm.u.Mouse.y, vm.u.Mouse.repeated_click,
+ vm.u.Mouse.modifiers);
+ }
+ break;
+ case VimMsg::Focus:
+ gui.in_focus = vm.u.Focus.active;
+ /* XXX Signal that scrollbar dragging has stopped?
+ * This is needed because we don't get a MouseUp if
+ * that happens while outside the window... :-(
+ */
+ if (gui.dragged_sb) {
+ gui.dragged_sb = SBAR_NONE;
+ }
+ gui_update_cursor(TRUE, FALSE);
+ break;
+ case VimMsg::Refs:
+ ::RefsReceived(vm.u.Refs.message, vm.u.Refs.changedir);
+ break;
+ default:
+ // unrecognised message, ignore it
+ break;
+ }
+ }
+
+ /*
+ * If size < B_OK, it is an error code.
+ */
+ return size;
+}
+
+/*
+ * Here are some functions to protect access to ScreenLines[] and
+ * LineOffset[]. These are used from the window thread to respond
+ * to a Draw() callback. When that occurs, the window is already
+ * locked by the system.
+ *
+ * Other code that needs to lock is any code that changes these
+ * variables. Other read-only access, or access merely to the
+ * contents of the screen buffer, need not be locked.
+ *
+ * If there is no window, don't call Lock() but do succeed.
+ */
+
+ int
+vim_lock_screen()
+{
+ return !gui.vimWindow || gui.vimWindow->Lock();
+}
+
+ void
+vim_unlock_screen()
+{
+ if (gui.vimWindow)
+ gui.vimWindow->Unlock();
+}
+
+#define RUN_BAPPLICATION_IN_NEW_THREAD 0
+
+#if RUN_BAPPLICATION_IN_NEW_THREAD
+
+ int32
+run_vimapp(void *args)
+{
+ VimApp app(appsig);
+
+ gui.vimApp = &app;
+ app.Run(); /* Run until Quit() called */
+
+ return 0;
+}
+
+#else
+
+ int32
+call_main(void *args)
+{
+ struct MainArgs *ma = (MainArgs *)args;
+
+ return main(ma->argc, ma->argv);
+}
+#endif
+
+extern "C" {
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(
+ int *argc,
+ char **argv)
+{
+ /*
+ * We don't have any command line arguments for the BeOS GUI yet,
+ * but this is an excellent place to create our Application object.
+ */
+ if (!gui.vimApp) {
+ thread_info tinfo;
+ get_thread_info(find_thread(NULL), &tinfo);
+
+ /* May need the port very early on to process RefsReceived() */
+ gui.vdcmp = create_port(B_MAX_PORT_COUNT, "vim VDCMP");
+
+#if RUN_BAPPLICATION_IN_NEW_THREAD
+ thread_id tid = spawn_thread(run_vimapp, "vim VimApp",
+ tinfo.priority, NULL);
+ if (tid >= B_OK) {
+ resume_thread(tid);
+ } else {
+ getout(1);
+ }
+#else
+ MainArgs ma = { *argc, argv };
+ thread_id tid = spawn_thread(call_main, "vim main()",
+ tinfo.priority, &ma);
+ if (tid >= B_OK) {
+ VimApp app(appsig);
+
+ gui.vimApp = &app;
+ resume_thread(tid);
+ /*
+ * This is rather horrible.
+ * call_main will call main() again...
+ * There will be no infinite recursion since
+ * gui.vimApp is set now.
+ */
+ app.Run(); /* Run until Quit() called */
+ //fprintf(stderr, "app.Run() returned...\n");
+ status_t dummy_exitcode;
+ (void)wait_for_thread(tid, &dummy_exitcode);
+
+ /*
+ * This path should be the normal one taken to exit Vim.
+ * The main() thread calls mch_exit() which calls
+ * gui_mch_exit() which terminates its thread.
+ */
+ exit(main_exitcode);
+ }
+#endif
+ }
+ /* Don't fork() when starting the GUI. Spawned threads are not
+ * duplicated with a fork(). The result is a mess.
+ */
+ gui.dofork = FALSE;
+ /*
+ * XXX Try to determine whether we were started from
+ * the Tracker or the terminal.
+ * It would be nice to have this work, because the Tracker
+ * follows symlinks, so even if you double-click on gvim,
+ * when it is a link to vim it will still pass a command name
+ * of vim...
+ * We try here to see if stdin comes from /dev/null. If so,
+ * (or if there is an error, which should never happen) start the GUI.
+ * This does the wrong thing for vim - </dev/null, and we're
+ * too early to see the command line parsing. Tough.
+ * On the other hand, it starts the gui for vim file & which is nice.
+ */
+ if (!isatty(0)) {
+ struct stat stat_stdin, stat_dev_null;
+
+ if (fstat(0, &stat_stdin) == -1 ||
+ stat("/dev/null", &stat_dev_null) == -1 ||
+ (stat_stdin.st_dev == stat_dev_null.st_dev &&
+ stat_stdin.st_ino == stat_dev_null.st_ino))
+ gui.starting = TRUE;
+ }
+}
+
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check(void)
+{
+ return OK; /* TODO: GUI can always be started? */
+}
+
+/*
+ * Initialise the GUI. Create all the windows, set up all the call-backs
+ * etc.
+ */
+ int
+gui_mch_init()
+{
+ gui.def_norm_pixel = RGB(0x00, 0x00, 0x00); // black
+ gui.def_back_pixel = RGB(0xFF, 0xFF, 0xFF); // white
+ gui.norm_pixel = gui.def_norm_pixel;
+ gui.back_pixel = gui.def_back_pixel;
+
+ gui.scrollbar_width = (int) B_V_SCROLL_BAR_WIDTH;
+ gui.scrollbar_height = (int) B_H_SCROLL_BAR_HEIGHT;
+#ifdef FEAT_MENU
+ gui.menu_height = 19; // initial guess -
+ // correct for my default settings
+#endif
+ gui.border_offset = 3; // coordinates are inside window borders
+
+ if (gui.vdcmp < B_OK)
+ return FAIL;
+ get_key_map(&keyMap, &keyMapChars);
+
+ gui.vimWindow = new VimWindow(); /* hidden and locked */
+ if (!gui.vimWindow)
+ return FAIL;
+
+ gui.vimWindow->Run(); /* Run() unlocks but does not show */
+
+ /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
+ * file) */
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color
+ */
+ gui_check_colors();
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them) */
+ highlight_gui_started(); /* re-init colors and fonts */
+
+ gui_mch_new_colors(); /* window must exist for this */
+
+ return OK;
+}
+
+/*
+ * Called when the foreground or background color has been changed.
+ */
+ void
+gui_mch_new_colors()
+{
+ rgb_color rgb = GUI_TO_RGB(gui.back_pixel);
+
+ if (gui.vimWindow->Lock()) {
+ gui.vimForm->SetViewColor(rgb);
+ // Does this not have too much effect for those small rectangles?
+ gui.vimForm->Invalidate();
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open()
+{
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+ /* Actually open the window */
+ if (gui.vimWindow->Lock()) {
+ gui.vimWindow->Show();
+ gui.vimWindow->Unlock();
+
+#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
+ /* Kill the thread that may have been created for the Terminal */
+ beos_cleanup_read_thread();
+#endif
+
+ return OK;
+ }
+
+ return FAIL;
+}
+
+ void
+gui_mch_exit(int vim_exitcode)
+{
+ if (gui.vimWindow) {
+ thread_id tid = gui.vimWindow->Thread();
+ gui.vimWindow->Lock();
+ gui.vimWindow->Quit();
+ /* Wait until it is truely gone */
+ int32 exitcode;
+ wait_for_thread(tid, &exitcode);
+ }
+ delete_port(gui.vdcmp);
+#if !RUN_BAPPLICATION_IN_NEW_THREAD
+ /*
+ * We are in the main() thread - quit the App thread and
+ * quit ourselves (passing on the exitcode). Use a global since the
+ * value from exit_thread() is only used if wait_for_thread() is
+ * called in time (race condition).
+ */
+#endif
+ if (gui.vimApp) {
+ VimTextAreaView::guiBlankMouse(false);
+
+ main_exitcode = vim_exitcode;
+#if RUN_BAPPLICATION_IN_NEW_THREAD
+ thread_id tid = gui.vimApp->Thread();
+ int32 exitcode;
+ gui.vimApp->Lock();
+ gui.vimApp->Quit();
+ gui.vimApp->Unlock();
+ wait_for_thread(tid, &exitcode);
+#else
+ gui.vimApp->Lock();
+ gui.vimApp->Quit();
+ gui.vimApp->Unlock();
+ /* suicide */
+ exit_thread(vim_exitcode);
+#endif
+ }
+ /* If we are somehow still here, let mch_exit() handle things. */
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ /* TODO */
+ return FAIL;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ /* TODO */
+}
+
+/*
+ * Set the size of the window to the given width and height in pixels.
+ */
+ void
+gui_mch_set_shellsize(
+ int width,
+ int height,
+ int min_width,
+ int min_height,
+ int base_width,
+ int base_height)
+{
+ /*
+ * We are basically given the size of the VimForm, if I understand
+ * correctly. Since it fills the window completely, this will also
+ * be the size of the window.
+ */
+ if (gui.vimWindow->Lock()) {
+ gui.vimWindow->ResizeTo(width - PEN_WIDTH, height - PEN_WIDTH);
+
+ /* set size limits */
+ float minWidth, maxWidth, minHeight, maxHeight;
+
+ gui.vimWindow->GetSizeLimits(&minWidth, &maxWidth,
+ &minHeight, &maxHeight);
+ gui.vimWindow->SetSizeLimits(min_width, maxWidth,
+ min_height, maxHeight);
+
+#if HAVE_R3_OR_LATER
+ /*
+ * Set the resizing alignment depending on font size.
+ * XXX This is untested, since I don't have R3 yet.
+ */
+ SetWindowAlignment(
+ B_PIXEL_ALIGNMENT, // window_alignment mode,
+ 1, // int32 h,
+ 0, // int32 hOffset = 0,
+ gui.char_width, // int32 width = 0,
+ base_width, // int32 widthOffset = 0,
+ 1, // int32 v = 0,
+ 0, // int32 vOffset = 0,
+ gui.char_height, // int32 height = 0,
+ base_height // int32 heightOffset = 0
+ );
+#else
+ /* don't know what to do with base_{width,height}. */
+#endif
+
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_get_screen_dimensions(
+ int *screen_w,
+ int *screen_h)
+{
+ BRect frame;
+
+ {
+ BScreen screen(gui.vimWindow);
+
+ if (screen.IsValid()) {
+ frame = screen.Frame();
+ } else {
+ frame.right = 640;
+ frame.bottom = 480;
+ }
+ }
+
+ /* XXX approximations... */
+ *screen_w = (int) frame.right - 2 * gui.scrollbar_width - 20;
+ *screen_h = (int) frame.bottom - gui.scrollbar_height
+#ifdef FEAT_MENU
+ - gui.menu_height
+#endif
+ - 30;
+}
+
+ void
+gui_mch_set_text_area_pos(
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ if (!gui.vimTextArea)
+ return;
+
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->MoveTo(x, y);
+ gui.vimTextArea->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH);
+ gui.vimWindow->Unlock();
+ }
+}
+
+
+/*
+ * Scrollbar stuff:
+ */
+
+ void
+gui_mch_enable_scrollbar(
+ scrollbar_T *sb,
+ int flag)
+{
+ VimScrollBar *vsb = sb->id;
+ if (gui.vimWindow->Lock()) {
+ /*
+ * This function is supposed to be idempotent, but Show()/Hide()
+ * is not. Therefore we test if they are needed.
+ */
+ if (flag) {
+ if (vsb->IsHidden()) {
+ vsb->Show();
+ }
+ } else {
+ if (!vsb->IsHidden()) {
+ vsb->Hide();
+ }
+ }
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_set_scrollbar_thumb(
+ scrollbar_T *sb,
+ int val,
+ int size,
+ int max)
+{
+ if (gui.vimWindow->Lock()) {
+ VimScrollBar *s = sb->id;
+ if (max == 0) {
+ s->SetValue(0);
+ s->SetRange(0.0, 0.0);
+ } else {
+ s->SetProportion((float)size / (max + 1.0));
+ s->SetSteps(1.0, size > 5 ? size - 2 : size);
+#ifndef SCROLL_PAST_END // really only defined in gui.c...
+ max = max + 1 - size;
+#endif
+ if (max < s->Value()) {
+ /*
+ * If the new maximum is lower than the current value,
+ * setting it would cause the value to be clipped and
+ * therefore a ValueChanged() call.
+ * We avoid this by setting the value first, because
+ * it presumably is <= max.
+ */
+ s->SetValue(val);
+ s->SetRange(0.0, max);
+ } else {
+ /*
+ * In the other case, set the range first, since the
+ * new value might be higher than the current max.
+ */
+ s->SetRange(0.0, max);
+ s->SetValue(val);
+ }
+ }
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_set_scrollbar_pos(
+ scrollbar_T *sb,
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ if (gui.vimWindow->Lock()) {
+ VimScrollBar *vsb = sb->id;
+ vsb->MoveTo(x, y);
+ vsb->ResizeTo(w - PEN_WIDTH, h - PEN_WIDTH);
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_create_scrollbar(
+ scrollbar_T *sb,
+ int orient) /* SBAR_VERT or SBAR_HORIZ */
+{
+ orientation posture =
+ (orient == SBAR_HORIZ) ? B_HORIZONTAL : B_VERTICAL;
+
+ VimScrollBar *vsb = sb->id = new VimScrollBar(sb, posture);
+ if (gui.vimWindow->Lock()) {
+ vsb->SetTarget(gui.vimTextArea);
+ vsb->Hide();
+ gui.vimForm->AddChild(vsb);
+ gui.vimWindow->Unlock();
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(
+ scrollbar_T *sb)
+{
+ if (gui.vimWindow->Lock()) {
+ sb->id->RemoveSelf();
+ delete sb->id;
+ gui.vimWindow->Unlock();
+ }
+}
+#endif
+
+/*
+ * Cursor blink functions.
+ *
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+
+#define BLINK_NONE 0
+#define BLINK_OFF 1
+#define BLINK_ON 2
+
+static int blink_state = BLINK_NONE;
+static long_u blink_waittime = 700;
+static long_u blink_ontime = 400;
+static long_u blink_offtime = 250;
+static int blink_timer = 0;
+
+ void
+gui_mch_set_blinking(
+ long waittime,
+ long on,
+ long off)
+{
+ /* TODO */
+ blink_waittime = waittime;
+ blink_ontime = on;
+ blink_offtime = off;
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink()
+{
+ /* TODO */
+ if (blink_timer != 0)
+ {
+ //XtRemoveTimeOut(blink_timer);
+ blink_timer = 0;
+ }
+ if (blink_state == BLINK_OFF)
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_NONE;
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink()
+{
+ /* TODO */
+ if (blink_timer != 0)
+ ;//XtRemoveTimeOut(blink_timer);
+ /* Only switch blinking on if none of the times is zero */
+ if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
+ {
+ blink_timer = 1; //XtAppAddTimeOut(app_context, blink_waittime,
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }
+}
+
+/*
+ * Initialise vim to use the font with the given name. Return FAIL if the font
+ * could not be loaded, OK otherwise.
+ */
+ int
+gui_mch_init_font(
+ char_u *font_name,
+ int fontset)
+{
+ if (gui.vimWindow->Lock())
+ {
+ int rc = gui.vimTextArea->mchInitFont(font_name);
+ gui.vimWindow->Unlock();
+
+ return rc;
+ }
+
+ return FAIL;
+}
+
+ int
+gui_mch_adjust_charsize()
+{
+ return FAIL;
+}
+
+ GuiFont
+gui_mch_get_font(
+ char_u *name,
+ int giveErrorIfMissing)
+{
+ VimFont *font = 0;
+ static VimFont *fontList = NULL;
+
+ if (!gui.in_use) /* can't do this when GUI not running */
+ return NOFONT;
+
+ if (!name)
+ name = (char_u *)"be_fixed_font";
+
+ VimFont *flp;
+ for (flp = fontList; flp; flp = flp->next) {
+ if (STRCMP(name, flp->name) == 0) {
+ flp->refcount++;
+ return (GuiFont)flp;
+ }
+ }
+
+ font = new VimFont(be_fixed_font);
+
+ /* Set some universal features: */
+ font->SetSpacing(B_FIXED_SPACING);
+ font->SetEncoding(B_ISO_8859_1);
+
+ /* Remember font for later use */
+ font->name = vim_strsave(name);
+ font->next = fontList;
+ fontList = font;
+
+ font_family family;
+ font_style style;
+ int size;
+ int len;
+ char_u *end;
+
+#ifdef never
+ // This leads to SEGV/BUS on R4+
+ // Replace underscores with spaces, and I can't see why ?
+ // richard@whitequeen.com jul 99
+ while (end = (char_u *)strchr((char *)name, '_'))
+ *end = ' ';
+#endif
+ /*
+ * Parse font names as Family/Style/Size.
+ * On errors, just keep the be_fixed_font.
+ */
+ end = (char_u *)strchr((char *)name, '/');
+ if (!end)
+ goto error;
+ strncpy(family, (char *)name, len = end - name);
+ family[len] = '\0';
+
+ name = end + 1;
+ end = (char_u *)strchr((char *)name, '/');
+ if (!end)
+ goto error;
+ strncpy(style, (char *)name, len = end - name);
+ style[len] = '\0';
+
+ name = end + 1;
+ size = atoi((char *)name);
+ if (size <= 0)
+ goto error;
+
+ font->SetFamilyAndStyle(family, style);
+ font->SetSize(size);
+ font->SetSpacing(B_FIXED_SPACING);
+ font->SetEncoding(B_ISO_8859_1);
+ //font->PrintToStream();
+
+ return (GuiFont)font;
+
+error:
+ if (giveErrorIfMissing)
+ EMSG2("(fe0) Unknown font: %s", name);
+
+ return (GuiFont)font;
+}
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(
+ GuiFont font)
+{
+ if (gui.vimWindow->Lock()) {
+ VimFont *vf = (VimFont *)font;
+
+ gui.vimTextArea->SetFont(vf);
+
+ gui.char_width = (int) vf->StringWidth("n");
+ font_height fh;
+ vf->GetHeight(&fh);
+ gui.char_height = (int)(fh.ascent + 0.9999)
+ + (int)(fh.descent + 0.9999) + (int)(fh.leading + 0.9999);
+ gui.char_ascent = (int)(fh.ascent + 0.9999);
+
+ gui.vimWindow->Unlock();
+ }
+}
+
+#if 0 /* not used */
+/*
+ * Return TRUE if the two fonts given are equivalent.
+ */
+ int
+gui_mch_same_font(
+ GuiFont f1,
+ GuiFont f2)
+{
+ VimFont *vf1 = (VimFont *)f1;
+ VimFont *vf2 = (VimFont *)f2;
+
+ return f1 == f2 ||
+ (vf1->FamilyAndStyle() == vf2->FamilyAndStyle() &&
+ vf1->Size() == vf2->Size());
+}
+#endif
+
+/* XXX TODO This is apparently never called... */
+ void
+gui_mch_free_font(
+ GuiFont font)
+{
+ VimFont *f = (VimFont *)font;
+ if (--f->refcount <= 0) {
+ if (f->refcount < 0)
+ fprintf(stderr, "VimFont: refcount < 0\n");
+ delete f;
+ }
+}
+
+ static int
+hex_digit(int c)
+{
+ if (isdigit(c))
+ return c - '0';
+ c = TOLOWER_ASC(c);
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ return -1000;
+}
+
+/*
+ * This function has been lifted from gui_w32.c and extended a bit.
+ *
+ * Return the Pixel value (color) for the given color name.
+ * Return INVALCOLOR for error.
+ */
+ guicolor_T
+gui_mch_get_color(
+ char_u *name)
+{
+ typedef struct GuiColourTable
+ {
+ char *name;
+ guicolor_T colour;
+ } GuiColourTable;
+
+#define NSTATIC_COLOURS 32
+#define NDYNAMIC_COLOURS 33
+#define NCOLOURS (NSTATIC_COLOURS + NDYNAMIC_COLOURS)
+
+ static GuiColourTable table[NCOLOURS] =
+ {
+ {"Black", RGB(0x00, 0x00, 0x00)},
+ {"DarkGray", RGB(0x80, 0x80, 0x80)},
+ {"DarkGrey", RGB(0x80, 0x80, 0x80)},
+ {"Gray", RGB(0xC0, 0xC0, 0xC0)},
+ {"Grey", RGB(0xC0, 0xC0, 0xC0)},
+ {"LightGray", RGB(0xD3, 0xD3, 0xD3)},
+ {"LightGrey", RGB(0xD3, 0xD3, 0xD3)},
+ {"White", RGB(0xFF, 0xFF, 0xFF)},
+ {"DarkRed", RGB(0x80, 0x00, 0x00)},
+ {"Red", RGB(0xFF, 0x00, 0x00)},
+ {"LightRed", RGB(0xFF, 0xA0, 0xA0)},
+ {"DarkBlue", RGB(0x00, 0x00, 0x80)},
+ {"Blue", RGB(0x00, 0x00, 0xFF)},
+ {"LightBlue", RGB(0xA0, 0xA0, 0xFF)},
+ {"DarkGreen", RGB(0x00, 0x80, 0x00)},
+ {"Green", RGB(0x00, 0xFF, 0x00)},
+ {"LightGreen", RGB(0xA0, 0xFF, 0xA0)},
+ {"DarkCyan", RGB(0x00, 0x80, 0x80)},
+ {"Cyan", RGB(0x00, 0xFF, 0xFF)},
+ {"LightCyan", RGB(0xA0, 0xFF, 0xFF)},
+ {"DarkMagenta", RGB(0x80, 0x00, 0x80)},
+ {"Magenta", RGB(0xFF, 0x00, 0xFF)},
+ {"LightMagenta", RGB(0xFF, 0xA0, 0xFF)},
+ {"Brown", RGB(0x80, 0x40, 0x40)},
+ {"Yellow", RGB(0xFF, 0xFF, 0x00)},
+ {"LightYellow", RGB(0xFF, 0xFF, 0xA0)},
+ {"DarkYellow", RGB(0xBB, 0xBB, 0x00)},
+ {"SeaGreen", RGB(0x2E, 0x8B, 0x57)},
+ {"Orange", RGB(0xFF, 0xA5, 0x00)},
+ {"Purple", RGB(0xA0, 0x20, 0xF0)},
+ {"SlateBlue", RGB(0x6A, 0x5A, 0xCD)},
+ {"Violet", RGB(0xEE, 0x82, 0xEE)},
+ };
+
+ static int endColour = NSTATIC_COLOURS;
+ static int newColour = NSTATIC_COLOURS;
+
+ int r, g, b;
+ int i;
+
+ if (name[0] == '#' && STRLEN(name) == 7)
+ {
+ /* Name is in "#rrggbb" format */
+ r = hex_digit(name[1]) * 16 + hex_digit(name[2]);
+ g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
+ b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
+ if (r < 0 || g < 0 || b < 0)
+ return INVALCOLOR;
+ return RGB(r, g, b);
+ }
+ else
+ {
+ /* Check if the name is one of the colours we know */
+ for (i = 0; i < endColour; i++)
+ if (STRICMP(name, table[i].name) == 0)
+ return table[i].colour;
+ }
+
+ /*
+ * Last attempt. Look in the file "$VIM/rgb.txt".
+ */
+ {
+#define LINE_LEN 100
+ FILE *fd;
+ char line[LINE_LEN];
+ char_u *fname;
+
+ fname = expand_env_save((char_u *)"$VIM/rgb.txt");
+ if (fname == NULL)
+ return INVALCOLOR;
+
+ fd = fopen((char *)fname, "rt");
+ vim_free(fname);
+ if (fd == NULL)
+ return INVALCOLOR;
+
+ while (!feof(fd))
+ {
+ int len;
+ int pos;
+ char *colour;
+
+ fgets(line, LINE_LEN, fd);
+ len = strlen(line);
+
+ if (len <= 1 || line[len-1] != '\n')
+ continue;
+
+ line[len-1] = '\0';
+
+ i = sscanf(line, "%d %d %d %n", &r, &g, &b, &pos);
+ if (i != 3)
+ continue;
+
+ colour = line + pos;
+
+ if (STRICMP(colour, name) == 0)
+ {
+ fclose(fd);
+ /*
+ * Now remember this colour in the table.
+ * A LRU scheme might be better but this is simpler.
+ * Or could use a growing array.
+ */
+ guicolor_T gcolour = RGB(r,g,b);
+
+ vim_free(table[newColour].name);
+ table[newColour].name = (char *)vim_strsave((char_u *)colour);
+ table[newColour].colour = gcolour;
+
+ newColour++;
+ if (newColour >= NCOLOURS)
+ newColour = NSTATIC_COLOURS;
+ if (endColour < NCOLOURS)
+ endColour = newColour;
+
+ return gcolour;
+ }
+ }
+
+ fclose(fd);
+ }
+
+ return INVALCOLOR;
+}
+
+/*
+ * Set the current text foreground color.
+ */
+ void
+gui_mch_set_fg_color(
+ guicolor_T color)
+{
+ rgb_color rgb = GUI_TO_RGB(color);
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->SetHighColor(rgb);
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(
+ guicolor_T color)
+{
+ rgb_color rgb = GUI_TO_RGB(color);
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->SetLowColor(rgb);
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_draw_string(
+ int row,
+ int col,
+ char_u *s,
+ int len,
+ int flags)
+{
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->mchDrawString(row, col, s, len, flags);
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(
+ char_u *name)
+{
+ int i;
+
+ for (i = 0; special_keys[i].BeKeys != 0; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return OK;
+ return FAIL;
+}
+
+ void
+gui_mch_beep()
+{
+ ::beep();
+}
+
+ void
+gui_mch_flash(int msec)
+{
+ /* Do a visual beep by reversing the foreground and background colors */
+
+ if (gui.vimWindow->Lock()) {
+ BRect rect = gui.vimTextArea->Bounds();
+
+ gui.vimTextArea->SetDrawingMode(B_OP_INVERT);
+ gui.vimTextArea->FillRect(rect);
+ gui.vimTextArea->Sync();
+ snooze(msec * 1000); /* wait for a few msec */
+ gui.vimTextArea->FillRect(rect);
+ gui.vimTextArea->SetDrawingMode(B_OP_COPY);
+ gui.vimTextArea->Flush();
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(
+ int r,
+ int c,
+ int nr,
+ int nc)
+{
+ BRect rect;
+ rect.left = FILL_X(c);
+ rect.top = FILL_Y(r);
+ rect.right = rect.left + nc * gui.char_width - PEN_WIDTH;
+ rect.bottom = rect.top + nr * gui.char_height - PEN_WIDTH;
+
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->SetDrawingMode(B_OP_INVERT);
+ gui.vimTextArea->FillRect(rect);
+ gui.vimTextArea->SetDrawingMode(B_OP_COPY);
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify()
+{
+ if (gui.vimWindow->Lock()) {
+ gui.vimWindow->Minimize(true);
+ gui.vimWindow->Unlock();
+ }
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ /* TODO */
+}
+#endif
+
+/*
+ * Set the window title
+ */
+ void
+gui_mch_settitle(
+ char_u *title,
+ char_u *icon)
+{
+ if (gui.vimWindow->Lock()) {
+ gui.vimWindow->SetTitle((char *)title);
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(guicolor_T color)
+{
+ gui_mch_set_fg_color(color);
+
+ BRect r;
+ r.left = FILL_X(gui.col);
+ r.top = FILL_Y(gui.row);
+ r.right = r.left + gui.char_width - PEN_WIDTH;
+ r.bottom = r.top + gui.char_height - PEN_WIDTH;
+
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->StrokeRect(r);
+ gui.vimWindow->Unlock();
+ //gui_mch_flush();
+ }
+}
+
+/*
+ * Draw part of a cursor, only w pixels wide, and h pixels high.
+ */
+ void
+gui_mch_draw_part_cursor(
+ int w,
+ int h,
+ guicolor_T color)
+{
+ gui_mch_set_fg_color(color);
+
+ BRect r;
+ r.left =
+#ifdef FEAT_RIGHTLEFT
+ /* vertical line should be on the right of current point */
+ CURSOR_BAR_RIGHT ? FILL_X(gui.col + 1) - w :
+#endif
+ FILL_X(gui.col);
+ r.right = r.left + w - PEN_WIDTH;
+ r.bottom = FILL_Y(gui.row + 1) - PEN_WIDTH;
+ r.top = r.bottom - h + PEN_WIDTH;
+
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->FillRect(r);
+ gui.vimWindow->Unlock();
+ //gui_mch_flush();
+ }
+}
+
+/*
+ * Catch up with any queued events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the event queue (& no timers pending), then we return
+ * immediately.
+ */
+ void
+gui_mch_update()
+{
+ gui_mch_flush();
+ while (port_count(gui.vdcmp) > 0 &&
+ !vim_is_input_buf_full() &&
+ gui_beos_process_event(0) >= B_OK)
+ /* nothing */ ;
+}
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_mch_wait_for_chars(
+ int wtime)
+{
+ int focus;
+ bigtime_t until, timeout;
+ status_t st;
+
+ if (wtime >= 0) {
+ timeout = wtime * 1000;
+ until = system_time() + timeout;
+ } else {
+ timeout = B_INFINITE_TIMEOUT;
+ }
+
+ focus = gui.in_focus;
+ for (;;)
+ {
+ /* Stop or start blinking when focus changes */
+ if (gui.in_focus != focus)
+ {
+ if (gui.in_focus)
+ gui_mch_start_blink();
+ else
+ gui_mch_stop_blink();
+ focus = gui.in_focus;
+ }
+
+ gui_mch_flush();
+ /*
+ * Don't use gui_mch_update() because then we will spin-lock until a
+ * char arrives, instead we use gui_beos_process_event() to hang until
+ * an event arrives. No need to check for input_buf_full because we
+ * are returning as soon as it contains a single char.
+ */
+ st = gui_beos_process_event(timeout);
+
+ if (input_available())
+ return OK;
+ if (st < B_OK) /* includes B_TIMED_OUT */
+ return FAIL;
+
+ /*
+ * Calculate how much longer we're willing to wait for the
+ * next event.
+ */
+ if (wtime >= 0) {
+ timeout = until - system_time();
+ if (timeout < 0)
+ break;
+ }
+ }
+ return FAIL;
+
+}
+
+/*
+ * Output routines.
+ */
+
+/*
+ * Flush any output to the screen. This is typically called before
+ * the app goes to sleep.
+ */
+ void
+gui_mch_flush()
+{
+ // does this need to lock the window? Apparently not but be safe.
+ if (gui.vimWindow->Lock()) {
+ gui.vimWindow->Flush();
+ gui.vimWindow->Unlock();
+ }
+ return;
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(
+ int row1,
+ int col1,
+ int row2,
+ int col2)
+{
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->mchClearBlock(row1, col1, row2, col2);
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_clear_all()
+{
+ if (gui.vimWindow->Lock()) {
+ gui.vimTextArea->mchClearAll();
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(
+ int row,
+ int num_lines)
+{
+ gui.vimTextArea->mchDeleteLines(row, num_lines);
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(
+ int row,
+ int num_lines)
+{
+ gui.vimTextArea->mchInsertLines(row, num_lines);
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Menu stuff.
+ */
+
+ void
+gui_mch_enable_menu(
+ int flag)
+{
+ if (gui.vimWindow->Lock())
+ {
+ BMenuBar *menubar = gui.vimForm->MenuBar();
+ menubar->SetEnabled(flag);
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_set_menu_pos(
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ /* It will be in the right place anyway */
+}
+
+/*
+ * Add a sub menu to the menu bar.
+ */
+ void
+gui_mch_add_menu(
+ vimmenu_T *menu,
+ int idx)
+{
+ vimmenu_T *parent = menu->parent;
+
+ if (!menu_is_menubar(menu->name)
+ || (parent != NULL && parent->submenu_id == NULL))
+ return;
+
+ if (gui.vimWindow->Lock())
+ {
+/* Major re-write of the menu code, it was failing with memory corruption when
+ * we started loading multiple files (the Buffer menu)
+ *
+ * Note we don't use the preference values yet, all are inserted into the
+ * menubar on a first come-first served basis...
+ *
+ * richard@whitequeen.com jul 99
+ */
+
+ BMenu *tmp;
+
+ if ( parent )
+ tmp = parent->submenu_id;
+ else
+ tmp = gui.vimForm->MenuBar();
+// make sure we don't try and add the same menu twice. The Buffers menu tries to
+// do this and Be starts to crash...
+
+ if ( ! tmp->FindItem((const char *) menu->dname)) {
+
+ BMenu *bmenu = new BMenu((char *)menu->dname);
+
+ menu->submenu_id = bmenu;
+
+// when we add a BMenu to another Menu, it creates the interconnecting BMenuItem
+ tmp->AddItem(bmenu);
+
+// Now its safe to query the menu for the associated MenuItem....
+ menu->id = tmp->FindItem((const char *) menu->dname);
+
+ }
+ gui.vimWindow->Unlock();
+ }
+}
+
+ void
+gui_mch_toggle_tearoffs(int enable)
+{
+ /* no tearoff menus */
+}
+
+ static BMessage *
+MenuMessage(vimmenu_T *menu)
+{
+ BMessage *m = new BMessage('menu');
+ m->AddPointer("VimMenu", (void *)menu);
+
+ return m;
+}
+
+/*
+ * Add a menu item to a menu
+ */
+ void
+gui_mch_add_menu_item(
+ vimmenu_T *menu,
+ int idx)
+{
+ int mnemonic = 0;
+ vimmenu_T *parent = menu->parent;
+
+ if (parent->submenu_id == NULL)
+ return;
+
+#ifdef never
+ /* why not add separators ?
+ * richard
+ */
+ /* Don't add menu separator */
+ if (menu_is_separator(menu->name))
+ return;
+#endif
+
+ /* TODO: use menu->actext */
+ /* This is difficult, since on Be, an accelerator must be a single char
+ * and a lot of Vim ones are the standard VI commands.
+ *
+ * Punt for Now...
+ * richard@whiequeen.com jul 99
+ */
+ if (gui.vimWindow->Lock())
+ {
+ if ( menu_is_separator(menu->name)) {
+ BSeparatorItem *item = new BSeparatorItem();
+ parent->submenu_id->AddItem(item);
+ menu->id = item;
+ menu->submenu_id = NULL;
+ }
+ else {
+ BMenuItem *item = new BMenuItem((char *)menu->dname,
+ MenuMessage(menu));
+ item->SetTarget(gui.vimTextArea);
+ item->SetTrigger((char) menu->mnemonic);
+ parent->submenu_id->AddItem(item);
+ menu->id = item;
+ menu->submenu_id = NULL;
+ }
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(
+ vimmenu_T *menu)
+{
+ if (gui.vimWindow->Lock())
+ {
+ assert(menu->submenu_id == NULL || menu->submenu_id->CountItems() == 0);
+ /*
+ * Detach this menu from its parent, so that it is not deleted
+ * twice once we get to delete that parent.
+ * Deleting a BMenuItem also deletes the associated BMenu, if any
+ * (which does not have any items anymore since they were
+ * removed and deleted before).
+ */
+ BMenu *bmenu = menu->id->Menu();
+ if (bmenu)
+ {
+ bmenu->RemoveItem(menu->id);
+ /*
+ * If we removed the last item from the menu bar,
+ * resize it out of sight.
+ */
+ if (bmenu == gui.vimForm->MenuBar() && bmenu->CountItems() == 0)
+ {
+ bmenu->ResizeTo(-MENUBAR_MARGIN, -MENUBAR_MARGIN);
+ }
+ }
+ delete menu->id;
+ menu->id = NULL;
+ menu->submenu_id = NULL;
+
+ gui.menu_height = (int) gui.vimForm->MenuHeight();
+ gui.vimWindow->Unlock();
+ }
+}
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(
+ vimmenu_T *menu,
+ int grey)
+{
+ if (menu->id != NULL)
+ menu->id->SetEnabled(!grey);
+}
+
+/*
+ * Make menu item hidden or not hidden
+ */
+ void
+gui_mch_menu_hidden(
+ vimmenu_T *menu,
+ int hidden)
+{
+ if (menu->id != NULL)
+ menu->id->SetEnabled(!hidden);
+}
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar()
+{
+ /* Nothing to do in BeOS */
+}
+
+#endif /* FEAT_MENU */
+
+/* Mouse stuff */
+
+#ifdef FEAT_CLIPBOARD
+/*
+ * Clipboard stuff, for cutting and pasting text to other windows.
+ */
+char textplain[] = "text/plain";
+char vimselectiontype[] = "application/x-vnd.Rhialto-Vim-selectiontype";
+
+/*
+ * Get the current selection and put it in the clipboard register.
+ */
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ if (be_clipboard->Lock())
+ {
+ BMessage *m = be_clipboard->Data();
+ //m->PrintToStream();
+
+ char_u *string = NULL;
+ ssize_t stringlen = -1;
+
+ if (m->FindData(textplain, B_MIME_TYPE,
+ (const void **)&string, &stringlen) == B_OK
+ || m->FindString("text", (const char **)&string) == B_OK)
+ {
+ if (stringlen == -1)
+ stringlen = STRLEN(string);
+
+ int type;
+ char *seltype;
+ ssize_t seltypelen;
+
+ /*
+ * Try to get the special vim selection type first
+ */
+ if (m->FindData(vimselectiontype, B_MIME_TYPE,
+ (const void **)&seltype, &seltypelen) == B_OK)
+ {
+ switch (*seltype)
+ {
+ default:
+ case 'L': type = MLINE; break;
+ case 'C': type = MCHAR; break;
+#ifdef FEAT_VISUAL
+ case 'B': type = MBLOCK; break;
+#endif
+ }
+ }
+ else
+ {
+ /* Otherwise use heuristic as documented */
+ type = memchr(string, stringlen, '\n') ? MLINE : MCHAR;
+ }
+ clip_yank_selection(type, string, (long)stringlen, cbd);
+ }
+ be_clipboard->Unlock();
+ }
+}
+/*
+ * Make vim the owner of the current selection.
+ */
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+ /* Nothing needs to be done here */
+}
+
+/*
+ * Make vim the owner of the current selection. Return OK upon success.
+ */
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ /*
+ * Never actually own the clipboard. If another application sets the
+ * clipboard, we don't want to think that we still own it.
+ */
+ return FAIL;
+}
+
+/*
+ * Send the current selection to the clipboard.
+ */
+ void
+clip_mch_set_selection(VimClipboard *cbd)
+{
+ if (be_clipboard->Lock())
+ {
+ be_clipboard->Clear();
+ BMessage *m = be_clipboard->Data();
+ assert(m);
+
+ /* If the '*' register isn't already filled in, fill it in now */
+ cbd->owned = TRUE;
+ clip_get_selection(cbd);
+ cbd->owned = FALSE;
+
+ char_u *str = NULL;
+ long_u count;
+ int type;
+
+ type = clip_convert_selection(&str, &count, cbd);
+
+ if (type < 0)
+ return;
+
+ m->AddData(textplain, B_MIME_TYPE, (void *)str, count);
+
+ /* Add type of selection */
+ char vtype;
+ switch (type)
+ {
+ default:
+ case MLINE: vtype = 'L'; break;
+ case MCHAR: vtype = 'C'; break;
+#ifdef FEAT_VISUAL
+ case MBLOCK: vtype = 'B'; break;
+#endif
+ }
+ m->AddData(vimselectiontype, B_MIME_TYPE, (void *)&vtype, 1);
+
+ vim_free(str);
+
+ be_clipboard->Commit();
+ be_clipboard->Unlock();
+ }
+}
+
+#endif /* FEAT_CLIPBOARD */
+
+/*
+ * Return the RGB value of a pixel as long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ rgb_color rgb = GUI_TO_RGB(pixel);
+
+ return ((rgb.red & 0xff) << 16) + ((rgb.green & 0xff) << 8)
+ + (rgb.blue & 0xff);
+}
+
+ void
+gui_mch_setmouse(int x, int y)
+{
+ TRACE();
+ /* TODO */
+}
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+ TRACE();
+ /* TODO */
+}
+
+int
+gui_mch_get_mouse_x()
+{
+ TRACE();
+ return 0;
+}
+
+
+int
+gui_mch_get_mouse_y()
+{
+ TRACE();
+ return 0;
+}
+
+} /* extern "C" */
diff --git a/src/gui_beos.h b/src/gui_beos.h
new file mode 100644
index 000000000..b2fc45854
--- /dev/null
+++ b/src/gui_beos.h
@@ -0,0 +1,49 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Olaf "Rhialto" Seibert
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ *
+ * BeOS GUI.
+ *
+ * GUI support for the Buzzword Enhanced Operating System for PPC.
+ *
+ */
+
+/*
+ * This file must be acceptable both as C and C++.
+ * The BeOS API is defined in terms of C++, but some classes
+ * should be somewhat known in the common C code.
+ */
+
+/* System classes */
+
+struct BMenu;
+struct BMenuItem;
+
+/* Our own Vim-related classes */
+
+struct VimApp;
+struct VimFormView;
+struct VimTextAreaView;
+struct VimWindow;
+struct VimScrollBar;
+
+/* Locking functions */
+
+extern int vim_lock_screen();
+extern void vim_unlock_screen();
+
+#ifndef __cplusplus
+
+typedef struct BMenu BMenu;
+typedef struct BMenuItem BMenuItem;
+typedef struct VimWindow VimWindow;
+typedef struct VimFormView VimFormView;
+typedef struct VimTextAreaView VimTextAreaView;
+typedef struct VimApp VimApp;
+typedef struct VimScrollBar VimScrollBar;
+
+#endif
diff --git a/src/gui_beval.c b/src/gui_beval.c
new file mode 100644
index 000000000..f19c1e017
--- /dev/null
+++ b/src/gui_beval.c
@@ -0,0 +1,1268 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+
+/* on Win32 only gui_mch_get_beval_info is required */
+#if !defined(FEAT_GUI_W32) || defined(PROTO)
+
+#ifdef FEAT_GUI_GTK
+# include <gdk/gdkkeysyms.h>
+# include <gtk/gtk.h>
+#else
+# include <X11/keysym.h>
+# ifdef FEAT_GUI_MOTIF
+# include <Xm/PushB.h>
+# include <Xm/Separator.h>
+# include <Xm/List.h>
+# include <Xm/Label.h>
+# include <Xm/AtomMgr.h>
+# include <Xm/Protocols.h>
+# else
+ /* Assume Athena */
+# include <X11/Shell.h>
+# include <X11/Xaw/Label.h>
+# endif
+#endif
+
+#include "gui_beval.h"
+
+#ifndef FEAT_GUI_GTK
+extern Widget vimShell;
+
+/*
+ * Currently, we assume that there can be only one BalloonEval showing
+ * on-screen at any given moment. This variable will hold the currently
+ * showing BalloonEval or NULL if none is showing.
+ */
+static BalloonEval *current_beval = NULL;
+#endif
+
+#ifdef FEAT_GUI_GTK
+static void addEventHandler __ARGS((GtkWidget *, BalloonEval *));
+static void removeEventHandler __ARGS((BalloonEval *));
+static gint target_event_cb __ARGS((GtkWidget *, GdkEvent *, gpointer));
+static gint mainwin_event_cb __ARGS((GtkWidget *, GdkEvent *, gpointer));
+static void pointer_event __ARGS((BalloonEval *, int, int, unsigned));
+static void key_event __ARGS((BalloonEval *, unsigned, int));
+static gint timeout_cb __ARGS((gpointer));
+static gint balloon_expose_event_cb __ARGS((GtkWidget *, GdkEventExpose *, gpointer));
+# ifndef HAVE_GTK2
+static void balloon_draw_cb __ARGS((GtkWidget *, GdkRectangle *, gpointer));
+# endif
+#else
+static void addEventHandler __ARGS((Widget, BalloonEval *));
+static void removeEventHandler __ARGS((BalloonEval *));
+static void pointerEventEH __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+static void pointerEvent __ARGS((BalloonEval *, XEvent *));
+static void timerRoutine __ARGS((XtPointer, XtIntervalId *));
+#endif
+static void cancelBalloon __ARGS((BalloonEval *));
+static void requestBalloon __ARGS((BalloonEval *));
+static void drawBalloon __ARGS((BalloonEval *));
+static void undrawBalloon __ARGS((BalloonEval *beval));
+static void createBalloonEvalWindow __ARGS((BalloonEval *));
+
+
+
+/*
+ * Create a balloon-evaluation area for a Widget.
+ * There can be either a "mesg" for a fixed string or "mesgCB" to generate a
+ * message by calling this callback function.
+ * When "mesg" is not NULL it must remain valid for as long as the balloon is
+ * used. It is not freed here.
+ * Returns a pointer to the resulting object (NULL when out of memory).
+ */
+ BalloonEval *
+gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
+ void *target;
+ char_u *mesg;
+ void (*mesgCB)__ARGS((BalloonEval *, int));
+ void *clientData;
+{
+#ifndef FEAT_GUI_GTK
+ char *display_name; /* get from gui.dpy */
+ int screen_num;
+ char *p;
+#endif
+ BalloonEval *beval;
+
+ if (mesg != NULL && mesgCB != NULL)
+ {
+ EMSG(_("E232: Cannot create BalloonEval with both message and callback"));
+ return NULL;
+ }
+
+ beval = (BalloonEval *)alloc(sizeof(BalloonEval));
+ if (beval != NULL)
+ {
+#ifdef FEAT_GUI_GTK
+ beval->target = GTK_WIDGET(target);
+ beval->balloonShell = NULL;
+ beval->timerID = 0;
+#else
+ beval->target = (Widget)target;
+ beval->balloonShell = NULL;
+ beval->timerID = (XtIntervalId)NULL;
+ beval->appContext = XtWidgetToApplicationContext((Widget)target);
+#endif
+ beval->showState = ShS_NEUTRAL;
+ beval->x = 0;
+ beval->y = 0;
+ beval->msg = mesg;
+ beval->msgCB = mesgCB;
+ beval->clientData = clientData;
+
+ /*
+ * Set up event handler which will keep its eyes on the pointer,
+ * and when the pointer rests in a certain spot for a given time
+ * interval, show the beval.
+ */
+ addEventHandler(beval->target, beval);
+ createBalloonEvalWindow(beval);
+
+#ifndef FEAT_GUI_GTK
+ /*
+ * Now create and save the screen width and height. Used in drawing.
+ */
+ display_name = DisplayString(gui.dpy);
+ p = strrchr(display_name, '.');
+ if (p != NULL)
+ screen_num = atoi(++p);
+ else
+ screen_num = 0;
+ beval->screen_width = DisplayWidth(gui.dpy, screen_num);
+ beval->screen_height = DisplayHeight(gui.dpy, screen_num);
+#endif
+ }
+
+ return beval;
+}
+
+#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
+/*
+ * Destroy a ballon-eval and free its associated memory.
+ */
+ void
+gui_mch_destroy_beval_area(beval)
+ BalloonEval *beval;
+{
+ cancelBalloon(beval);
+ removeEventHandler(beval);
+ /* Children will automatically be destroyed */
+# ifdef FEAT_GUI_GTK
+ gtk_widget_destroy(beval->balloonShell);
+# else
+ XtDestroyWidget(beval->balloonShell);
+# endif
+ vim_free(beval);
+}
+#endif
+
+ void
+gui_mch_enable_beval_area(beval)
+ BalloonEval *beval;
+{
+ if (beval != NULL)
+ addEventHandler(beval->target, beval);
+}
+
+ void
+gui_mch_disable_beval_area(beval)
+ BalloonEval *beval;
+{
+ if (beval != NULL)
+ removeEventHandler(beval);
+}
+
+#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
+/*
+ * This function returns the BalloonEval * associated with the currently
+ * displayed tooltip. Returns NULL if there is no tooltip currently showing.
+ *
+ * Assumption: Only one tooltip can be shown at a time.
+ */
+ BalloonEval *
+gui_mch_currently_showing_beval()
+{
+ return current_beval;
+}
+#endif
+#endif /* !FEAT_GUI_W32 */
+
+#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) || defined(PROTO)
+/*
+ * Get the text and position to be evaluated for "beval".
+ * When "usingNetbeans" is set the returned text is in allocated memory.
+ * Returns OK or FAIL.
+ */
+ int
+gui_mch_get_beval_info(beval, filename, line, text, idx)
+ BalloonEval *beval;
+ char_u **filename;
+ int *line;
+ char_u **text;
+ int *idx;
+{
+ win_T *wp;
+ int row, col;
+ char_u *lbuf;
+ linenr_T lnum;
+
+ *text = NULL;
+ row = Y_2_ROW(beval->y);
+ col = X_2_COL(beval->x);
+ wp = mouse_find_win(&row, &col);
+ if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
+ {
+ /* Found a window and the cursor is in the text. Now find the line
+ * number. */
+ if (!mouse_comp_pos(wp, &row, &col, &lnum))
+ {
+ /* Not past end of the file. */
+ lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ if (col <= win_linetabsize(wp, lbuf, (colnr_T)MAXCOL))
+ {
+ /* Not past end of line. */
+# ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ /* For Netbeans we get the relevant part of the line
+ * instead of the whole line. */
+ int len;
+ pos_T *spos = NULL, *epos = NULL;
+
+ if (VIsual_active)
+ {
+ if (lt(VIsual, curwin->w_cursor))
+ {
+ spos = &VIsual;
+ epos = &curwin->w_cursor;
+ }
+ else
+ {
+ spos = &curwin->w_cursor;
+ epos = &VIsual;
+ }
+ }
+
+ col = vcol2col(wp, lnum, col) - 1;
+
+ if (VIsual_active
+ && wp->w_buffer == curwin->w_buffer
+ && (lnum == spos->lnum
+ ? col >= (int)spos->col
+ : lnum > spos->lnum)
+ && (lnum == epos->lnum
+ ? col <= (int)epos->col
+ : lnum < epos->lnum))
+ {
+ /* Visual mode and pointing to the line with the
+ * Visual selection: return selected text, with a
+ * maximum of one line. */
+ if (spos->lnum != epos->lnum || spos->col == epos->col)
+ return FAIL;
+
+ lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
+ lbuf = vim_strnsave(lbuf + spos->col,
+ epos->col - spos->col + (*p_sel != 'e'));
+ lnum = spos->lnum;
+ col = spos->col;
+ }
+ else
+ {
+ /* Find the word under the cursor. */
+ ++emsg_off;
+ len = find_ident_at_pos(wp, lnum, (colnr_T)col, &lbuf,
+ FIND_IDENT + FIND_STRING + FIND_EVAL);
+ --emsg_off;
+ if (len == 0)
+ return FAIL;
+ lbuf = vim_strnsave(lbuf, len);
+ }
+ }
+# endif
+ *filename = wp->w_buffer->b_ffname;
+ *line = (int)lnum;
+ *text = lbuf;
+ *idx = col;
+ beval->ts = wp->w_buffer->b_p_ts;
+ return OK;
+ }
+ }
+ }
+
+ return FAIL;
+}
+
+# if !defined(FEAT_GUI_W32) || defined(PROTO)
+
+/*
+ * Show a balloon with "mesg".
+ */
+ void
+gui_mch_post_balloon(beval, mesg)
+ BalloonEval *beval;
+ char_u *mesg;
+{
+ beval->msg = mesg;
+ if (mesg != NULL)
+ drawBalloon(beval);
+ else
+ undrawBalloon(beval);
+}
+# endif /* FEAT_GUI_W32 */
+#endif /* FEAT_SUN_WORKSHOP || FEAT_NETBEANS_INTG || PROTO */
+
+#if !defined(FEAT_GUI_W32) || defined(PROTO)
+#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
+/*
+ * Hide the given balloon.
+ */
+ void
+gui_mch_unpost_balloon(beval)
+ BalloonEval *beval;
+{
+ undrawBalloon(beval);
+}
+#endif
+
+#ifdef FEAT_GUI_GTK
+/*
+ * We can unconditionally use ANSI-style prototypes here since
+ * GTK+ requires an ANSI C compiler anyway.
+ */
+ static void
+addEventHandler(GtkWidget *target, BalloonEval *beval)
+{
+ /*
+ * Connect to the generic "event" signal instead of the individual
+ * signals for each event type, because the former is emitted earlier.
+ * This allows us to catch events independently of the signal handlers
+ * in gui_gtk_x11.c.
+ */
+ /* Should use GTK_OBJECT() here, but that causes a lint warning... */
+ gtk_signal_connect((GtkObject*)(target), "event",
+ GTK_SIGNAL_FUNC(target_event_cb),
+ beval);
+ /*
+ * Nasty: Key press events go to the main window thus the drawing area
+ * will never see them. This means we have to connect to the main window
+ * as well in order to catch those events.
+ */
+ if (gtk_socket_id == 0 && gui.mainwin != NULL
+ && gtk_widget_is_ancestor(target, gui.mainwin))
+ {
+ gtk_signal_connect((GtkObject*)(gui.mainwin), "event",
+ GTK_SIGNAL_FUNC(mainwin_event_cb),
+ beval);
+ }
+}
+
+ static void
+removeEventHandler(BalloonEval *beval)
+{
+ gtk_signal_disconnect_by_func((GtkObject*)(beval->target),
+ GTK_SIGNAL_FUNC(target_event_cb),
+ beval);
+
+ if (gtk_socket_id == 0 && gui.mainwin != NULL
+ && gtk_widget_is_ancestor(beval->target, gui.mainwin))
+ {
+ gtk_signal_disconnect_by_func((GtkObject*)(gui.mainwin),
+ GTK_SIGNAL_FUNC(mainwin_event_cb),
+ beval);
+ }
+}
+
+ static gint
+target_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+ BalloonEval *beval = (BalloonEval *)data;
+
+ switch (event->type)
+ {
+ case GDK_ENTER_NOTIFY:
+ pointer_event(beval, (int)event->crossing.x,
+ (int)event->crossing.y,
+ event->crossing.state);
+ break;
+ case GDK_MOTION_NOTIFY:
+ if (event->motion.is_hint)
+ {
+ int x;
+ int y;
+ GdkModifierType state;
+ /*
+ * GDK_POINTER_MOTION_HINT_MASK is set, thus we cannot obtain
+ * the coordinates from the GdkEventMotion struct directly.
+ */
+ gdk_window_get_pointer(widget->window, &x, &y, &state);
+ pointer_event(beval, x, y, (unsigned int)state);
+ }
+ else
+ {
+ pointer_event(beval, (int)event->motion.x,
+ (int)event->motion.y,
+ event->motion.state);
+ }
+ break;
+ case GDK_LEAVE_NOTIFY:
+ /*
+ * Ignore LeaveNotify events that are not "normal".
+ * Apparently we also get it when somebody else grabs focus.
+ */
+ if (event->crossing.mode == GDK_CROSSING_NORMAL)
+ cancelBalloon(beval);
+ break;
+ case GDK_BUTTON_PRESS:
+# ifdef HAVE_GTK2
+ case GDK_SCROLL:
+# endif
+ cancelBalloon(beval);
+ break;
+ case GDK_KEY_PRESS:
+ key_event(beval, event->key.keyval, TRUE);
+ break;
+ case GDK_KEY_RELEASE:
+ key_event(beval, event->key.keyval, FALSE);
+ break;
+ default:
+ break;
+ }
+
+ return FALSE; /* continue emission */
+}
+
+/*ARGSUSED*/
+ static gint
+mainwin_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
+{
+ BalloonEval *beval = (BalloonEval *)data;
+
+ switch (event->type)
+ {
+ case GDK_KEY_PRESS:
+ key_event(beval, event->key.keyval, TRUE);
+ break;
+ case GDK_KEY_RELEASE:
+ key_event(beval, event->key.keyval, FALSE);
+ break;
+ default:
+ break;
+ }
+
+ return FALSE; /* continue emission */
+}
+
+ static void
+pointer_event(BalloonEval *beval, int x, int y, unsigned state)
+{
+ int distance;
+
+ distance = ABS(x - beval->x) + ABS(y - beval->y);
+
+ if (distance > 4)
+ {
+ /*
+ * Moved out of the balloon location: cancel it.
+ * Remember button state
+ */
+ beval->state = state;
+ cancelBalloon(beval);
+
+ /* Mouse buttons are pressed - no balloon now */
+ if (!(state & ((int)GDK_BUTTON1_MASK | (int)GDK_BUTTON2_MASK
+ | (int)GDK_BUTTON3_MASK)))
+ {
+ beval->x = x;
+ beval->y = y;
+
+ if (state & (int)GDK_MOD1_MASK)
+ {
+ /*
+ * Alt is pressed -- enter super-evaluate-mode,
+ * where there is no time delay
+ */
+ if (beval->msgCB != NULL)
+ {
+ beval->showState = ShS_PENDING;
+ (*beval->msgCB)(beval, state);
+ }
+ }
+ else
+ {
+ beval->timerID = gtk_timeout_add((guint32)p_bdlay,
+ &timeout_cb, beval);
+ }
+ }
+ }
+}
+
+ static void
+key_event(BalloonEval *beval, unsigned keyval, int is_keypress)
+{
+ if (beval->showState == ShS_SHOWING && beval->msgCB != NULL)
+ {
+ switch (keyval)
+ {
+ case GDK_Shift_L:
+ case GDK_Shift_R:
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, (is_keypress)
+ ? (int)GDK_SHIFT_MASK : 0);
+ break;
+ case GDK_Control_L:
+ case GDK_Control_R:
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, (is_keypress)
+ ? (int)GDK_CONTROL_MASK : 0);
+ break;
+ default:
+ cancelBalloon(beval);
+ break;
+ }
+ }
+ else
+ cancelBalloon(beval);
+}
+
+ static gint
+timeout_cb(gpointer data)
+{
+ BalloonEval *beval = (BalloonEval *)data;
+
+ beval->timerID = 0;
+ /*
+ * If the timer event happens then the mouse has stopped long enough for
+ * a request to be started. The request will only send to the debugger if
+ * there the mouse is pointing at real data.
+ */
+ requestBalloon(beval);
+
+ return FALSE; /* don't call me again */
+}
+
+/*ARGSUSED2*/
+ static gint
+balloon_expose_event_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+{
+ gtk_paint_flat_box(widget->style, widget->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ &event->area, widget, "tooltip",
+ 0, 0, -1, -1);
+
+ return FALSE; /* continue emission */
+}
+
+# ifndef HAVE_GTK2
+/*ARGSUSED2*/
+ static void
+balloon_draw_cb(GtkWidget *widget, GdkRectangle *area, gpointer data)
+{
+ GtkWidget *child;
+ GdkRectangle child_area;
+
+ gtk_paint_flat_box(widget->style, widget->window,
+ GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+ area, widget, "tooltip",
+ 0, 0, -1, -1);
+
+ child = GTK_BIN(widget)->child;
+
+ if (gtk_widget_intersect(child, area, &child_area))
+ gtk_widget_draw(child, &child_area);
+}
+# endif
+
+#else /* !FEAT_GUI_GTK */
+
+ static void
+addEventHandler(target, beval)
+ Widget target;
+ BalloonEval *beval;
+{
+ XtAddEventHandler(target,
+ PointerMotionMask | EnterWindowMask |
+ LeaveWindowMask | ButtonPressMask | KeyPressMask |
+ KeyReleaseMask,
+ False,
+ pointerEventEH, (XtPointer)beval);
+}
+
+ static void
+removeEventHandler(beval)
+ BalloonEval *beval;
+{
+ XtRemoveEventHandler(beval->target,
+ PointerMotionMask | EnterWindowMask |
+ LeaveWindowMask | ButtonPressMask | KeyPressMask |
+ KeyReleaseMask,
+ False,
+ pointerEventEH, (XtPointer)beval);
+}
+
+
+/*
+ * The X event handler. All it does is call the real event handler.
+ */
+/*ARGSUSED*/
+ static void
+pointerEventEH(w, client_data, event, unused)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *unused;
+{
+ BalloonEval *beval = (BalloonEval *)client_data;
+ pointerEvent(beval, event);
+}
+
+
+/*
+ * The real event handler. Called by pointerEventEH() whenever an event we are
+ * interested in ocurrs.
+ */
+
+ static void
+pointerEvent(beval, event)
+ BalloonEval *beval;
+ XEvent *event;
+{
+ Position distance; /* a measure of how much the ponter moved */
+ Position delta; /* used to compute distance */
+
+ switch (event->type)
+ {
+ case EnterNotify:
+ case MotionNotify:
+ delta = event->xmotion.x - beval->x;
+ if (delta < 0)
+ delta = -delta;
+ distance = delta;
+ delta = event->xmotion.y - beval->y;
+ if (delta < 0)
+ delta = -delta;
+ distance += delta;
+ if (distance > 4)
+ {
+ /*
+ * Moved out of the balloon location: cancel it.
+ * Remember button state
+ */
+ beval->state = event->xmotion.state;
+ if (beval->state & (Button1Mask|Button2Mask|Button3Mask))
+ {
+ /* Mouse buttons are pressed - no balloon now */
+ cancelBalloon(beval);
+ }
+ else if (beval->state & (Mod1Mask|Mod2Mask|Mod3Mask))
+ {
+ /*
+ * Alt is pressed -- enter super-evaluate-mode,
+ * where there is no time delay
+ */
+ beval->x = event->xmotion.x;
+ beval->y = event->xmotion.y;
+ beval->x_root = event->xmotion.x_root;
+ beval->y_root = event->xmotion.y_root;
+ cancelBalloon(beval);
+ if (beval->msgCB != NULL)
+ {
+ beval->showState = ShS_PENDING;
+ (*beval->msgCB)(beval, beval->state);
+ }
+ }
+ else
+ {
+ beval->x = event->xmotion.x;
+ beval->y = event->xmotion.y;
+ beval->x_root = event->xmotion.x_root;
+ beval->y_root = event->xmotion.y_root;
+ cancelBalloon(beval);
+ beval->timerID = XtAppAddTimeOut( beval->appContext,
+ (long_u)p_bdlay, timerRoutine, beval);
+ }
+ }
+ break;
+
+ /*
+ * Motif and Athena version: Keystrokes will be caught by the
+ * "textArea" widget, and handled in gui_x11_key_hit_cb().
+ */
+ case KeyPress:
+ if (beval->showState == ShS_SHOWING && beval->msgCB != NULL)
+ {
+ Modifiers modifier;
+ KeySym keysym;
+
+ XtTranslateKeycode(gui.dpy,
+ event->xkey.keycode, event->xkey.state,
+ &modifier, &keysym);
+ if (keysym == XK_Shift_L || keysym == XK_Shift_R)
+ {
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, ShiftMask);
+ }
+ else if (keysym == XK_Control_L || keysym == XK_Control_R)
+ {
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, ControlMask);
+ }
+ else
+ cancelBalloon(beval);
+ }
+ else
+ cancelBalloon(beval);
+ break;
+
+ case KeyRelease:
+ if (beval->showState == ShS_SHOWING && beval->msgCB != NULL)
+ {
+ Modifiers modifier;
+ KeySym keysym;
+
+ XtTranslateKeycode(gui.dpy, event->xkey.keycode,
+ event->xkey.state, &modifier, &keysym);
+ if ((keysym == XK_Shift_L) || (keysym == XK_Shift_R)) {
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, 0);
+ }
+ else if ((keysym == XK_Control_L) || (keysym == XK_Control_R))
+ {
+ beval->showState = ShS_UPDATE_PENDING;
+ (*beval->msgCB)(beval, 0);
+ }
+ else
+ cancelBalloon(beval);
+ }
+ else
+ cancelBalloon(beval);
+ break;
+
+ case LeaveNotify:
+ /* Ignore LeaveNotify events that are not "normal".
+ * Apparently we also get it when somebody else grabs focus.
+ * Happens for me every two seconds (some clipboard tool?) */
+ if (event->xcrossing.mode == NotifyNormal)
+ cancelBalloon(beval);
+ break;
+
+ case ButtonPress:
+ cancelBalloon(beval);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*ARGSUSED*/
+ static void
+timerRoutine(dx, id)
+ XtPointer dx;
+ XtIntervalId *id;
+{
+ BalloonEval *beval = (BalloonEval *)dx;
+
+ beval->timerID = (XtIntervalId)NULL;
+
+ /*
+ * If the timer event happens then the mouse has stopped long enough for
+ * a request to be started. The request will only send to the debugger if
+ * there the mouse is pointing at real data.
+ */
+ requestBalloon(beval);
+}
+
+#endif /* !FEAT_GUI_GTK */
+
+ static void
+requestBalloon(beval)
+ BalloonEval *beval;
+{
+ if (beval->showState != ShS_PENDING)
+ {
+ /* Determine the beval to display */
+ if (beval->msgCB != NULL)
+ {
+ beval->showState = ShS_PENDING;
+ (*beval->msgCB)(beval, beval->state);
+ }
+ else if (beval->msg != NULL)
+ drawBalloon(beval);
+ }
+}
+
+#ifdef FEAT_GUI_GTK
+
+# ifdef HAVE_GTK2
+/*
+ * Convert the string to UTF-8 if 'encoding' is not "utf-8".
+ * Replace any non-printable characters and invalid bytes sequences with
+ * "^X" or "<xx>" escapes, and apply SpecialKey highlighting to them.
+ * TAB and NL are passed through unscathed.
+ */
+# define IS_NONPRINTABLE(c) (((c) < 0x20 && (c) != TAB && (c) != NL) \
+ || (c) == DEL)
+ static void
+set_printable_label_text(GtkLabel *label, char_u *msg)
+{
+ char_u *convbuf = NULL;
+ char_u *buf;
+ char_u *p;
+ char_u *pdest;
+ unsigned int len;
+ int charlen;
+ int uc;
+ PangoAttrList *attr_list;
+
+ /* Convert to UTF-8 if it isn't already */
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ convbuf = string_convert(&output_conv, msg, NULL);
+ if (convbuf != NULL)
+ msg = convbuf;
+ }
+
+ /* First let's see how much we need to allocate */
+ len = 0;
+ for (p = msg; *p != NUL; p += charlen)
+ {
+ if ((*p & 0x80) == 0) /* be quick for ASCII */
+ {
+ charlen = 1;
+ len += IS_NONPRINTABLE(*p) ? 2 : 1; /* nonprintable: ^X */
+ }
+ else
+ {
+ charlen = utf_ptr2len_check(p);
+ uc = utf_ptr2char(p);
+
+ if (charlen != utf_char2len(uc))
+ charlen = 1; /* reject overlong sequences */
+
+ if (charlen == 1 || uc < 0xa0) /* illegal byte or */
+ len += 4; /* control char: <xx> */
+ else if (!utf_printable(uc))
+ /* Note: we assume here that utf_printable() doesn't
+ * care about characters outside the BMP. */
+ len += 6; /* nonprintable: <xxxx> */
+ else
+ len += charlen;
+ }
+ }
+
+ attr_list = pango_attr_list_new();
+ buf = alloc(len + 1);
+
+ /* Now go for the real work */
+ if (buf != NULL)
+ {
+ attrentry_T *aep;
+ PangoAttribute *attr;
+ guicolor_T pixel;
+ GdkColor color = { 0, 0, 0, 0 };
+
+ /* Look up the RGB values of the SpecialKey foreground color. */
+ aep = syn_gui_attr2entry(hl_attr(HLF_8));
+ pixel = (aep != NULL) ? aep->ae_u.gui.fg_color : INVALCOLOR;
+ if (pixel != INVALCOLOR)
+ gdk_colormap_query_color(gtk_widget_get_colormap(gui.drawarea),
+ (unsigned long)pixel, &color);
+
+ pdest = buf;
+ p = msg;
+ while (*p != NUL)
+ {
+ /* Be quick for ASCII */
+ if ((*p & 0x80) == 0 && !IS_NONPRINTABLE(*p))
+ {
+ *pdest++ = *p++;
+ }
+ else
+ {
+ charlen = utf_ptr2len_check(p);
+ uc = utf_ptr2char(p);
+
+ if (charlen != utf_char2len(uc))
+ charlen = 1; /* reject overlong sequences */
+
+ if (charlen == 1 || uc < 0xa0 || !utf_printable(uc))
+ {
+ int outlen;
+
+ /* Careful: we can't just use transchar_byte() here,
+ * since 'encoding' is not necessarily set to "utf-8". */
+ if (*p & 0x80 && charlen == 1)
+ {
+ transchar_hex(pdest, *p); /* <xx> */
+ outlen = 4;
+ }
+ else if (uc >= 0x80)
+ {
+ /* Note: we assume here that utf_printable() doesn't
+ * care about characters outside the BMP. */
+ transchar_hex(pdest, uc); /* <xx> or <xxxx> */
+ outlen = (uc < 0x100) ? 4 : 6;
+ }
+ else
+ {
+ transchar_nonprint(pdest, *p); /* ^X */
+ outlen = 2;
+ }
+ if (pixel != INVALCOLOR)
+ {
+ attr = pango_attr_foreground_new(
+ color.red, color.green, color.blue);
+ attr->start_index = pdest - buf;
+ attr->end_index = pdest - buf + outlen;
+ pango_attr_list_insert(attr_list, attr);
+ }
+ pdest += outlen;
+ p += charlen;
+ }
+ else
+ {
+ do
+ *pdest++ = *p++;
+ while (--charlen != 0);
+ }
+ }
+ }
+ *pdest = NUL;
+ }
+
+ vim_free(convbuf);
+
+ gtk_label_set_text(label, (const char *)buf);
+ vim_free(buf);
+
+ gtk_label_set_attributes(label, attr_list);
+ pango_attr_list_unref(attr_list);
+}
+# undef IS_NONPRINTABLE
+# endif /* HAVE_GTK2 */
+
+/*
+ * Draw a balloon.
+ */
+ static void
+drawBalloon(BalloonEval *beval)
+{
+ if (beval->msg != NULL)
+ {
+ GtkRequisition requisition;
+ int screen_w;
+ int screen_h;
+ int x;
+ int y;
+ int x_offset = EVAL_OFFSET_X;
+ int y_offset = EVAL_OFFSET_Y;
+# ifdef HAVE_GTK2
+ PangoLayout *layout;
+# endif
+# ifdef HAVE_GTK_MULTIHEAD
+ GdkScreen *screen;
+
+ screen = gtk_widget_get_screen(beval->target);
+ gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen);
+ screen_w = gdk_screen_get_width(screen);
+ screen_h = gdk_screen_get_height(screen);
+# else
+ screen_w = gdk_screen_width();
+ screen_h = gdk_screen_height();
+# endif
+ gtk_widget_ensure_style(beval->balloonShell);
+ gtk_widget_ensure_style(beval->balloonLabel);
+
+# ifdef HAVE_GTK2
+ set_printable_label_text(GTK_LABEL(beval->balloonLabel), beval->msg);
+ /*
+ * Dirty trick: Enable wrapping mode on the label's layout behind its
+ * back. This way GtkLabel won't try to constrain the wrap width to a
+ * builtin maximum value of about 65 Latin characters.
+ */
+ layout = gtk_label_get_layout(GTK_LABEL(beval->balloonLabel));
+# ifdef PANGO_WRAP_WORD_CHAR
+ pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
+# else
+ pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
+# endif
+ pango_layout_set_width(layout,
+ /* try to come up with some reasonable width */
+ PANGO_SCALE * CLAMP(gui.num_cols * gui.char_width,
+ screen_w / 2,
+ MAX(20, screen_w - 20)));
+
+ /* Calculate the balloon's width and height. */
+ gtk_widget_size_request(beval->balloonShell, &requisition);
+# else
+ gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), FALSE);
+ gtk_label_set_text(GTK_LABEL(beval->balloonLabel),
+ (const char *)beval->msg);
+
+ /* Calculate the balloon's width and height. */
+ gtk_widget_size_request(beval->balloonShell, &requisition);
+ /*
+ * Unfortunately, the dirty trick used above to get around the builtin
+ * maximum wrap width of GtkLabel doesn't work with GTK+ 1. Thus if
+ * and only if it's absolutely necessary to avoid drawing off-screen,
+ * do enable wrapping now and recalculate the size request.
+ */
+ if (requisition.width > screen_w)
+ {
+ gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), TRUE);
+ gtk_widget_size_request(beval->balloonShell, &requisition);
+ }
+# endif
+
+ /* Compute position of the balloon area */
+ gdk_window_get_origin(beval->target->window, &x, &y);
+ x += beval->x;
+ y += beval->y;
+
+ /* Get out of the way of the mouse pointer */
+ if (x + x_offset + requisition.width > screen_w)
+ y_offset += 15;
+ if (y + y_offset + requisition.height > screen_h)
+ y_offset = -requisition.height - EVAL_OFFSET_Y;
+
+ /* Sanitize values */
+ x = CLAMP(x + x_offset, 0, MAX(0, screen_w - requisition.width));
+ y = CLAMP(y + y_offset, 0, MAX(0, screen_h - requisition.height));
+
+ /* Show the balloon */
+ gtk_widget_set_uposition(beval->balloonShell, x, y);
+ gtk_widget_show(beval->balloonShell);
+
+ beval->showState = ShS_SHOWING;
+ }
+}
+
+/*
+ * Undraw a balloon.
+ */
+ static void
+undrawBalloon(BalloonEval *beval)
+{
+ if (beval->balloonShell != NULL)
+ gtk_widget_hide(beval->balloonShell);
+ beval->showState = ShS_NEUTRAL;
+}
+
+ static void
+cancelBalloon(BalloonEval *beval)
+{
+ if (beval->showState == ShS_SHOWING
+ || beval->showState == ShS_UPDATE_PENDING)
+ undrawBalloon(beval);
+
+ if (beval->timerID != 0)
+ {
+ gtk_timeout_remove(beval->timerID);
+ beval->timerID = 0;
+ }
+ beval->showState = ShS_NEUTRAL;
+}
+
+ static void
+createBalloonEvalWindow(BalloonEval *beval)
+{
+ beval->balloonShell = gtk_window_new(GTK_WINDOW_POPUP);
+
+ gtk_widget_set_app_paintable(beval->balloonShell, TRUE);
+ gtk_window_set_policy(GTK_WINDOW(beval->balloonShell), FALSE, FALSE, TRUE);
+ gtk_widget_set_name(beval->balloonShell, "gtk-tooltips");
+ gtk_container_border_width(GTK_CONTAINER(beval->balloonShell), 4);
+
+ gtk_signal_connect((GtkObject*)(beval->balloonShell), "expose_event",
+ GTK_SIGNAL_FUNC(balloon_expose_event_cb), NULL);
+# ifndef HAVE_GTK2
+ gtk_signal_connect((GtkObject*)(beval->balloonShell), "draw",
+ GTK_SIGNAL_FUNC(balloon_draw_cb), NULL);
+# endif
+ beval->balloonLabel = gtk_label_new(NULL);
+
+ gtk_label_set_line_wrap(GTK_LABEL(beval->balloonLabel), FALSE);
+ gtk_label_set_justify(GTK_LABEL(beval->balloonLabel), GTK_JUSTIFY_LEFT);
+ gtk_misc_set_alignment(GTK_MISC(beval->balloonLabel), 0.5f, 0.5f);
+ gtk_widget_set_name(beval->balloonLabel, "vim-balloon-label");
+ gtk_widget_show(beval->balloonLabel);
+
+ gtk_container_add(GTK_CONTAINER(beval->balloonShell), beval->balloonLabel);
+}
+
+#else /* !FEAT_GUI_GTK */
+
+/*
+ * Draw a balloon.
+ */
+ static void
+drawBalloon(beval)
+ BalloonEval *beval;
+{
+ Dimension w;
+ Dimension h;
+ Position tx;
+ Position ty;
+
+ if (beval->msg != NULL)
+ {
+ /* Show the Balloon */
+
+ /* Calculate the label's width and height */
+#ifdef FEAT_GUI_MOTIF
+ XmString s;
+
+ /* For the callback function we parse NL characters to create a
+ * multi-line label. This doesn't work for all languages, but
+ * XmStringCreateLocalized() doesn't do multi-line labels... */
+ if (beval->msgCB != NULL)
+ s = XmStringCreateLtoR((char *)beval->msg, XmFONTLIST_DEFAULT_TAG);
+ else
+ s = XmStringCreateLocalized((char *)beval->msg);
+ {
+ XmFontList fl;
+
+ fl = gui_motif_fontset2fontlist(&gui.tooltip_fontset);
+ if (fl != NULL)
+ {
+ XmStringExtent(fl, s, &w, &h);
+ XmFontListFree(fl);
+ }
+ }
+ w += gui.border_offset << 1;
+ h += gui.border_offset << 1;
+ XtVaSetValues(beval->balloonLabel, XmNlabelString, s, NULL);
+ XmStringFree(s);
+#else /* Athena */
+ /* Assume XtNinternational == True */
+ XFontSet fset;
+ XFontSetExtents *ext;
+
+ XtVaGetValues(beval->balloonLabel, XtNfontSet, &fset, NULL);
+ ext = XExtentsOfFontSet(fset);
+ h = ext->max_ink_extent.height;
+ w = XmbTextEscapement(fset,
+ (char *)beval->msg,
+ (int)STRLEN(beval->msg));
+ w += gui.border_offset << 1;
+ h += gui.border_offset << 1;
+ XtVaSetValues(beval->balloonLabel, XtNlabel, beval->msg, NULL);
+#endif
+
+ /* Compute position of the balloon area */
+ tx = beval->x_root + EVAL_OFFSET_X;
+ ty = beval->y_root + EVAL_OFFSET_Y;
+ if ((tx + w) > beval->screen_width)
+ tx = beval->screen_width - w;
+ if ((ty + h) > beval->screen_height)
+ ty = beval->screen_height - h;
+#ifdef FEAT_GUI_MOTIF
+ XtVaSetValues(beval->balloonShell,
+ XmNx, tx,
+ XmNy, ty,
+ NULL);
+#else
+ /* Athena */
+ XtVaSetValues(beval->balloonShell,
+ XtNx, tx,
+ XtNy, ty,
+ NULL);
+#endif
+
+ XtPopup(beval->balloonShell, XtGrabNone);
+
+ beval->showState = ShS_SHOWING;
+
+ current_beval = beval;
+ }
+}
+
+/*
+ * Undraw a balloon.
+ */
+ static void
+undrawBalloon(beval)
+ BalloonEval *beval;
+{
+ if (beval->balloonShell != (Widget)0)
+ XtPopdown(beval->balloonShell);
+ beval->showState = ShS_NEUTRAL;
+
+ current_beval = NULL;
+}
+
+ static void
+cancelBalloon(beval)
+ BalloonEval *beval;
+{
+ if (beval->showState == ShS_SHOWING
+ || beval->showState == ShS_UPDATE_PENDING)
+ undrawBalloon(beval);
+
+ if (beval->timerID != (XtIntervalId)NULL)
+ {
+ XtRemoveTimeOut(beval->timerID);
+ beval->timerID = (XtIntervalId)NULL;
+ }
+ beval->showState = ShS_NEUTRAL;
+}
+
+
+ static void
+createBalloonEvalWindow(beval)
+ BalloonEval *beval;
+{
+ Arg args[12];
+ int n;
+
+ n = 0;
+#ifdef FEAT_GUI_MOTIF
+ XtSetArg(args[n], XmNallowShellResize, True); n++;
+ beval->balloonShell = XtAppCreateShell("balloonEval", "BalloonEval",
+ overrideShellWidgetClass, gui.dpy, args, n);
+#else
+ /* Athena */
+ XtSetArg(args[n], XtNallowShellResize, True); n++;
+ beval->balloonShell = XtAppCreateShell("balloonEval", "BalloonEval",
+ overrideShellWidgetClass, gui.dpy, args, n);
+#endif
+
+ n = 0;
+#ifdef FEAT_GUI_MOTIF
+ {
+ XmFontList fl;
+
+ fl = gui_motif_fontset2fontlist(&gui.tooltip_fontset);
+ XtSetArg(args[n], XmNforeground, gui.tooltip_fg_pixel); n++;
+ XtSetArg(args[n], XmNbackground, gui.tooltip_bg_pixel); n++;
+ XtSetArg(args[n], XmNfontList, fl); n++;
+ XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
+ beval->balloonLabel = XtCreateManagedWidget("balloonLabel",
+ xmLabelWidgetClass, beval->balloonShell, args, n);
+ }
+#else /* FEAT_GUI_ATHENA */
+ XtSetArg(args[n], XtNforeground, gui.tooltip_fg_pixel); n++;
+ XtSetArg(args[n], XtNbackground, gui.tooltip_bg_pixel); n++;
+ XtSetArg(args[n], XtNinternational, True); n++;
+ XtSetArg(args[n], XtNfontSet, gui.tooltip_fontset); n++;
+ beval->balloonLabel = XtCreateManagedWidget("balloonLabel",
+ labelWidgetClass, beval->balloonShell, args, n);
+#endif
+}
+
+#endif /* !FEAT_GUI_GTK */
+#endif /* !FEAT_GUI_W32 */
+
+#endif /* FEAT_BEVAL */
diff --git a/src/gui_beval.h b/src/gui_beval.h
new file mode 100644
index 000000000..75d5a18fc
--- /dev/null
+++ b/src/gui_beval.h
@@ -0,0 +1,76 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#if !defined(GUI_BEVAL_H) && (defined(FEAT_BEVAL) || defined(PROTO))
+#define GUI_BEVAL_H
+
+#ifdef FEAT_GUI_GTK
+# include <gtk/gtkwidget.h>
+#else
+# if defined(FEAT_GUI_X11)
+# include <X11/Intrinsic.h>
+# endif
+#endif
+
+typedef enum
+{
+ ShS_NEUTRAL, /* nothing showing or pending */
+ ShS_PENDING, /* data requested from debugger */
+ ShS_UPDATE_PENDING, /* switching information displayed */
+ ShS_SHOWING /* the balloon is being displayed */
+} BeState;
+
+typedef struct BalloonEvalStruct
+{
+#ifdef FEAT_GUI_GTK
+ GtkWidget *target; /* widget we are monitoring */
+ GtkWidget *balloonShell;
+ GtkWidget *balloonLabel;
+ unsigned int timerID; /* timer for run */
+ BeState showState; /* tells us whats currently going on */
+ int x;
+ int y;
+ unsigned int state; /* Button/Modifier key state */
+#else
+# if !defined(FEAT_GUI_W32)
+ Widget target; /* widget we are monitoring */
+ Widget balloonShell;
+ Widget balloonLabel;
+ XtIntervalId timerID; /* timer for run */
+ BeState showState; /* tells us whats currently going on */
+ XtAppContext appContext; /* used in event handler */
+ Position x;
+ Position y;
+ Position x_root;
+ Position y_root;
+ int state; /* Button/Modifier key state */
+# else
+ HWND target;
+ HWND balloon;
+ int x;
+ int y;
+ BeState showState; /* tells us whats currently going on */
+# endif
+#endif
+ int ts; /* tabstop setting for this buffer */
+ char_u *msg;
+ void (*msgCB)__ARGS((struct BalloonEvalStruct *, int));
+ void *clientData; /* For callback */
+#if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
+ Dimension screen_width; /* screen width in pixels */
+ Dimension screen_height; /* screen height in pixels */
+#endif
+} BalloonEval;
+
+#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
+#define EVAL_OFFSET_Y 10
+
+#include "gui_beval.pro"
+
+#endif /* GUI_BEVAL_H and FEAT_BEVAL */
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
new file mode 100644
index 000000000..0d552c05f
--- /dev/null
+++ b/src/gui_gtk.c
@@ -0,0 +1,3035 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Porting to GTK+ was done by:
+ *
+ * (C) 1998,1999,2000 by Marcin Dalecki <dalecki@evision.ag>
+ *
+ * With GREAT support and continuous encouragements by Andy Kahn and of
+ * course Bram Moolenaar!
+ *
+ * Support for GTK+ 2 was added by:
+ *
+ * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
+ * Daniel Elstner <daniel.elstner@gmx.net>
+ *
+ * Best supporting actor (He helped somewhat, aesthetically speaking):
+ * Maxime Romano <verbophobe@hotmail.com>
+ */
+
+#ifdef FEAT_GUI_GTK
+# include "gui_gtk_f.h"
+#endif
+
+/* GTK defines MAX and MIN, but some system header files as well. Undefine
+ * them and don't use them. */
+#ifdef MIN
+# undef MIN
+#endif
+#ifdef MAX
+# undef MAX
+#endif
+
+#include "vim.h"
+
+#ifdef FEAT_GUI_GNOME
+/* Gnome redefines _() and N_(). Grrr... */
+# ifdef _
+# undef _
+# endif
+# ifdef N_
+# undef N_
+# endif
+# ifdef textdomain
+# undef textdomain
+# endif
+# ifdef bindtextdomain
+# undef bindtextdomain
+# endif
+# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
+# define ENABLE_NLS /* so the texts in the dialog boxes are translated */
+# endif
+# include <gnome.h>
+#endif
+
+#if defined(FEAT_GUI_DIALOG) && !defined(HAVE_GTK2)
+# include "../pixmaps/alert.xpm"
+# include "../pixmaps/error.xpm"
+# include "../pixmaps/generic.xpm"
+# include "../pixmaps/info.xpm"
+# include "../pixmaps/quest.xpm"
+#endif
+
+#if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
+/*
+ * Icons used by the toolbar code.
+ */
+#include "../pixmaps/tb_new.xpm"
+#include "../pixmaps/tb_open.xpm"
+#include "../pixmaps/tb_close.xpm"
+#include "../pixmaps/tb_save.xpm"
+#include "../pixmaps/tb_print.xpm"
+#include "../pixmaps/tb_cut.xpm"
+#include "../pixmaps/tb_copy.xpm"
+#include "../pixmaps/tb_paste.xpm"
+#include "../pixmaps/tb_find.xpm"
+#include "../pixmaps/tb_find_next.xpm"
+#include "../pixmaps/tb_find_prev.xpm"
+#include "../pixmaps/tb_find_help.xpm"
+#include "../pixmaps/tb_exit.xpm"
+#include "../pixmaps/tb_undo.xpm"
+#include "../pixmaps/tb_redo.xpm"
+#include "../pixmaps/tb_help.xpm"
+#include "../pixmaps/tb_macro.xpm"
+#include "../pixmaps/tb_make.xpm"
+#include "../pixmaps/tb_save_all.xpm"
+#include "../pixmaps/tb_jump.xpm"
+#include "../pixmaps/tb_ctags.xpm"
+#include "../pixmaps/tb_load_session.xpm"
+#include "../pixmaps/tb_save_session.xpm"
+#include "../pixmaps/tb_new_session.xpm"
+#include "../pixmaps/tb_blank.xpm"
+#include "../pixmaps/tb_maximize.xpm"
+#include "../pixmaps/tb_split.xpm"
+#include "../pixmaps/tb_minimize.xpm"
+#include "../pixmaps/tb_shell.xpm"
+#include "../pixmaps/tb_replace.xpm"
+#include "../pixmaps/tb_vsplit.xpm"
+#include "../pixmaps/tb_maxwidth.xpm"
+#include "../pixmaps/tb_minwidth.xpm"
+#endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
+
+#ifdef FEAT_GUI_GTK
+# include <gdk/gdkkeysyms.h>
+# include <gdk/gdk.h>
+# ifdef WIN3264
+# include <gdk/gdkwin32.h>
+# else
+# include <gdk/gdkx.h>
+# endif
+
+# include <gtk/gtk.h>
+#else
+/* define these items to be able to generate prototypes without GTK */
+typedef int GtkWidget;
+# define gpointer int
+# define guint8 int
+# define GdkPixmap int
+# define GdkBitmap int
+# define GtkIconFactory int
+# define GtkToolbar int
+# define GtkAdjustment int
+# define gboolean int
+# define GdkEventKey int
+# define CancelData int
+#endif
+
+#ifdef HAVE_GTK2
+/*
+ * Convenience macros to convert from 'encoding' to 'termencoding' and
+ * vice versa. If no conversion is necessary the passed-in pointer is
+ * returned as is, without allocating any memory. Thus additional _FREE()
+ * macros are provided. The _FREE() macros also set the pointer to NULL,
+ * in order to avoid bugs due to illegal memory access only happening if
+ * 'encoding' != utf-8...
+ *
+ * Defining these macros as pure expressions looks a bit tricky but
+ * avoids depending on the context of the macro expansion. One of the
+ * rare occasions where the comma operator comes in handy :)
+ *
+ * Note: Do NOT keep the result around when handling control back to
+ * the main Vim! The user could change 'encoding' at any time.
+ */
+# define CONVERT_TO_UTF8(String) \
+ ((output_conv.vc_type == CONV_NONE || (String) == NULL) \
+ ? (String) \
+ : string_convert(&output_conv, (String), NULL))
+
+# define CONVERT_TO_UTF8_FREE(String) \
+ ((String) = ((output_conv.vc_type == CONV_NONE) \
+ ? (char_u *)NULL \
+ : (vim_free(String), (char_u *)NULL)))
+
+# define CONVERT_FROM_UTF8(String) \
+ ((input_conv.vc_type == CONV_NONE || (String) == NULL) \
+ ? (String) \
+ : string_convert(&input_conv, (String), NULL))
+
+# define CONVERT_FROM_UTF8_FREE(String) \
+ ((String) = ((input_conv.vc_type == CONV_NONE) \
+ ? (char_u *)NULL \
+ : (vim_free(String), (char_u *)NULL)))
+
+#endif /* HAVE_GTK2 */
+
+static void entry_activate_cb(GtkWidget *widget, gpointer data);
+static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
+static void find_replace_cb(GtkWidget *widget, gpointer data);
+
+#if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)
+/*
+ * Table from BuiltIn## icon indices to GTK+ stock IDs. Order must exactly
+ * match toolbar_names[] in menu.c! All stock icons including the "vim-*"
+ * ones can be overridden in your gtkrc file.
+ */
+static const char * const menu_stock_ids[] =
+{
+ /* 00 */ GTK_STOCK_NEW,
+ /* 01 */ GTK_STOCK_OPEN,
+ /* 02 */ GTK_STOCK_SAVE,
+ /* 03 */ GTK_STOCK_UNDO,
+ /* 04 */ GTK_STOCK_REDO,
+ /* 05 */ GTK_STOCK_CUT,
+ /* 06 */ GTK_STOCK_COPY,
+ /* 07 */ GTK_STOCK_PASTE,
+ /* 08 */ GTK_STOCK_PRINT,
+ /* 09 */ GTK_STOCK_HELP,
+ /* 10 */ GTK_STOCK_FIND,
+ /* 11 */ "vim-save-all",
+ /* 12 */ "vim-session-save",
+ /* 13 */ "vim-session-new",
+ /* 14 */ "vim-session-load",
+ /* 15 */ GTK_STOCK_EXECUTE,
+ /* 16 */ GTK_STOCK_FIND_AND_REPLACE,
+ /* 17 */ GTK_STOCK_CLOSE, /* FIXME: fuzzy */
+ /* 18 */ "vim-window-maximize",
+ /* 19 */ "vim-window-minimize",
+ /* 20 */ "vim-window-split",
+ /* 21 */ "vim-shell",
+ /* 22 */ GTK_STOCK_GO_BACK,
+ /* 23 */ GTK_STOCK_GO_FORWARD,
+ /* 24 */ "vim-find-help",
+ /* 25 */ GTK_STOCK_CONVERT,
+ /* 26 */ GTK_STOCK_JUMP_TO,
+ /* 27 */ "vim-build-tags",
+ /* 28 */ "vim-window-split-vertical",
+ /* 29 */ "vim-window-maximize-width",
+ /* 30 */ "vim-window-minimize-width",
+ /* 31 */ GTK_STOCK_QUIT
+};
+
+ static void
+add_stock_icon(GtkIconFactory *factory,
+ const char *stock_id,
+ const guint8 *inline_data,
+ int data_length)
+{
+ GdkPixbuf *pixbuf;
+ GtkIconSet *icon_set;
+
+ pixbuf = gdk_pixbuf_new_from_inline(data_length, inline_data, FALSE, NULL);
+ icon_set = gtk_icon_set_new_from_pixbuf(pixbuf);
+
+ gtk_icon_factory_add(factory, stock_id, icon_set);
+
+ gtk_icon_set_unref(icon_set);
+ g_object_unref(pixbuf);
+}
+
+ static int
+lookup_menu_iconfile(char_u *iconfile, char_u *dest)
+{
+ expand_env(iconfile, dest, MAXPATHL);
+
+ if (mch_isFullName(dest))
+ {
+ return vim_fexists(dest);
+ }
+ else
+ {
+ static const char suffixes[][4] = {"png", "xpm", "bmp"};
+ char_u buf[MAXPATHL];
+ unsigned int i;
+
+ for (i = 0; i < G_N_ELEMENTS(suffixes); ++i)
+ if (gui_find_bitmap(dest, buf, (char *)suffixes[i]) == OK)
+ {
+ STRCPY(dest, buf);
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+}
+
+ static GtkWidget *
+load_menu_iconfile(char_u *name, GtkIconSize icon_size)
+{
+ GtkWidget *image = NULL;
+ GtkIconSet *icon_set;
+ GtkIconSource *icon_source;
+
+ /*
+ * Rather than loading the icon directly into a GtkImage, create
+ * a new GtkIconSet and put it in there. This way we can easily
+ * scale the toolbar icons on the fly when needed.
+ */
+ icon_set = gtk_icon_set_new();
+ icon_source = gtk_icon_source_new();
+
+ gtk_icon_source_set_filename(icon_source, (const char *)name);
+ gtk_icon_set_add_source(icon_set, icon_source);
+
+ image = gtk_image_new_from_icon_set(icon_set, icon_size);
+
+ gtk_icon_source_free(icon_source);
+ gtk_icon_set_unref(icon_set);
+
+ return image;
+}
+
+ static GtkWidget *
+create_menu_icon(vimmenu_T *menu, GtkIconSize icon_size)
+{
+ GtkWidget *image = NULL;
+ char_u buf[MAXPATHL];
+
+ /* First use a specified "icon=" argument. */
+ if (menu->iconfile != NULL && lookup_menu_iconfile(menu->iconfile, buf))
+ image = load_menu_iconfile(buf, icon_size);
+
+ /* If not found and not builtin specified try using the menu name. */
+ if (image == NULL && !menu->icon_builtin
+ && lookup_menu_iconfile(menu->name, buf))
+ image = load_menu_iconfile(buf, icon_size);
+
+ /* Still not found? Then use a builtin icon, a blank one as fallback. */
+ if (image == NULL)
+ {
+ const char *stock_id;
+ const int n_ids = G_N_ELEMENTS(menu_stock_ids);
+
+ if (menu->iconidx >= 0 && menu->iconidx < n_ids)
+ stock_id = menu_stock_ids[menu->iconidx];
+ else
+ stock_id = GTK_STOCK_MISSING_IMAGE;
+
+ image = gtk_image_new_from_stock(stock_id, icon_size);
+ }
+
+ return image;
+}
+
+#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
+
+#if (defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)) || defined(PROTO)
+
+ void
+gui_gtk_register_stock_icons(void)
+{
+# include "../pixmaps/stock_icons.h"
+ GtkIconFactory *factory;
+
+ factory = gtk_icon_factory_new();
+# define ADD_ICON(Name, Data) add_stock_icon(factory, Name, Data, (int)sizeof(Data))
+
+ ADD_ICON("vim-build-tags", stock_vim_build_tags);
+ ADD_ICON("vim-find-help", stock_vim_find_help);
+ ADD_ICON("vim-save-all", stock_vim_save_all);
+ ADD_ICON("vim-session-load", stock_vim_session_load);
+ ADD_ICON("vim-session-new", stock_vim_session_new);
+ ADD_ICON("vim-session-save", stock_vim_session_save);
+ ADD_ICON("vim-shell", stock_vim_shell);
+ ADD_ICON("vim-window-maximize", stock_vim_window_maximize);
+ ADD_ICON("vim-window-maximize-width", stock_vim_window_maximize_width);
+ ADD_ICON("vim-window-minimize", stock_vim_window_minimize);
+ ADD_ICON("vim-window-minimize-width", stock_vim_window_minimize_width);
+ ADD_ICON("vim-window-split", stock_vim_window_split);
+ ADD_ICON("vim-window-split-vertical", stock_vim_window_split_vertical);
+
+# undef ADD_ICON
+ gtk_icon_factory_add_default(factory);
+ g_object_unref(factory);
+}
+
+#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
+
+
+/*
+ * Only use accelerators when gtk_menu_ensure_uline_accel_group() is
+ * available, which is in version 1.2.1. That was the first version where
+ * accelerators properly worked (according to the change log).
+ */
+#ifdef GTK_CHECK_VERSION
+# if GTK_CHECK_VERSION(1, 2, 1)
+# define GTK_USE_ACCEL
+# endif
+#endif
+
+#if defined(FEAT_MENU) || defined(PROTO)
+
+/*
+ * Translate Vim's mnemonic tagging to GTK+ style and convert to UTF-8
+ * if necessary. The caller must vim_free() the returned string.
+ *
+ * Input Output
+ * _ __
+ * && &
+ * & _ stripped if use_mnemonic == FALSE
+ * <Tab> end of menu label text
+ */
+ static char_u *
+translate_mnemonic_tag(char_u *name, int use_mnemonic)
+{
+ char_u *buf;
+ char_u *psrc;
+ char_u *pdest;
+ int n_underscores = 0;
+
+# ifdef HAVE_GTK2
+ name = CONVERT_TO_UTF8(name);
+# endif
+ if (name == NULL)
+ return NULL;
+
+ for (psrc = name; *psrc != NUL && *psrc != TAB; ++psrc)
+ if (*psrc == '_')
+ ++n_underscores;
+
+ buf = alloc((unsigned)(psrc - name + n_underscores + 1));
+ if (buf != NULL)
+ {
+ pdest = buf;
+ for (psrc = name; *psrc != NUL && *psrc != TAB; ++psrc)
+ {
+ if (*psrc == '_')
+ {
+ *pdest++ = '_';
+ *pdest++ = '_';
+ }
+ else if (*psrc != '&')
+ {
+ *pdest++ = *psrc;
+ }
+ else if (*(psrc + 1) == '&')
+ {
+ *pdest++ = *psrc++;
+ }
+ else if (use_mnemonic)
+ {
+ *pdest++ = '_';
+ }
+ }
+ *pdest = NUL;
+ }
+
+# ifdef HAVE_GTK2
+ CONVERT_TO_UTF8_FREE(name);
+# endif
+ return buf;
+}
+
+# ifdef HAVE_GTK2
+
+ static void
+menu_item_new(vimmenu_T *menu, GtkWidget *parent_widget)
+{
+ GtkWidget *box;
+ char_u *text;
+ int use_mnemonic;
+
+ /* It would be neat to have image menu items, but that would require major
+ * changes to Vim's menu system. Not to mention that all the translations
+ * had to be updated. */
+ menu->id = gtk_menu_item_new();
+ box = gtk_hbox_new(FALSE, 20);
+
+ use_mnemonic = (p_wak[0] != 'n' || !GTK_IS_MENU_BAR(parent_widget));
+ text = translate_mnemonic_tag(menu->name, use_mnemonic);
+
+ menu->label = gtk_label_new_with_mnemonic((const char *)text);
+ vim_free(text);
+
+ gtk_box_pack_start(GTK_BOX(box), menu->label, FALSE, FALSE, 0);
+
+ if (menu->actext != NULL && menu->actext[0] != NUL)
+ {
+ text = CONVERT_TO_UTF8(menu->actext);
+
+ gtk_box_pack_end(GTK_BOX(box),
+ gtk_label_new((const char *)text),
+ FALSE, FALSE, 0);
+
+ CONVERT_TO_UTF8_FREE(text);
+ }
+
+ gtk_container_add(GTK_CONTAINER(menu->id), box);
+ gtk_widget_show_all(menu->id);
+}
+
+# else /* !HAVE_GTK2 */
+
+/*
+ * Create a highly customized menu item by hand instead of by using:
+ *
+ * gtk_menu_item_new_with_label(menu->dname);
+ *
+ * This is neccessary, since there is no other way in GTK+ 1 to get the
+ * not automatically parsed accellerator stuff right.
+ */
+ static void
+menu_item_new(vimmenu_T *menu, GtkWidget *parent_widget)
+{
+ GtkWidget *widget;
+ GtkWidget *bin;
+ GtkWidget *label;
+ char_u *name;
+ guint accel_key;
+
+ widget = gtk_widget_new(GTK_TYPE_MENU_ITEM,
+ "GtkWidget::visible", TRUE,
+ "GtkWidget::sensitive", TRUE,
+ /* "GtkWidget::parent", parent->submenu_id, */
+ NULL);
+ bin = gtk_widget_new(GTK_TYPE_HBOX,
+ "GtkWidget::visible", TRUE,
+ "GtkWidget::parent", widget,
+ "GtkBox::spacing", 16,
+ NULL);
+ label = gtk_widget_new(GTK_TYPE_ACCEL_LABEL,
+ "GtkWidget::visible", TRUE,
+ "GtkWidget::parent", bin,
+ "GtkAccelLabel::accel_widget", widget,
+ "GtkMisc::xalign", 0.0,
+ NULL);
+ menu->label = label;
+
+ if (menu->actext)
+ gtk_widget_new(GTK_TYPE_LABEL,
+ "GtkWidget::visible", TRUE,
+ "GtkWidget::parent", bin,
+ "GtkLabel::label", menu->actext,
+ "GtkMisc::xalign", 1.0,
+ NULL);
+
+ /*
+ * Translate VIM accelerator tagging into GTK+'s. Note that since GTK uses
+ * underscores as the accelerator key, we need to add an additional under-
+ * score for each understore that appears in the menu name.
+ */
+# ifdef GTK_USE_ACCEL
+ name = translate_mnemonic_tag(menu->name,
+ (p_wak[0] != 'n' || !GTK_IS_MENU_BAR(parent_widget)));
+# else
+ name = translate_mnemonic_tag(menu->name, FALSE);
+# endif
+
+ /* let GTK do its thing */
+ accel_key = gtk_label_parse_uline(GTK_LABEL(label), (const char *)name);
+ vim_free(name);
+
+# ifdef GTK_USE_ACCEL
+ /* Don't add accelator if 'winaltkeys' is "no". */
+ if (accel_key != GDK_VoidSymbol)
+ {
+ if (GTK_IS_MENU_BAR(parent_widget))
+ {
+ if (*p_wak != 'n')
+ gtk_widget_add_accelerator(widget,
+ "activate_item",
+ gui.accel_group,
+ accel_key, GDK_MOD1_MASK,
+ (GtkAccelFlags)0);
+ }
+ else
+ {
+ gtk_widget_add_accelerator(widget,
+ "activate_item",
+ gtk_menu_ensure_uline_accel_group(GTK_MENU(parent_widget)),
+ accel_key, 0,
+ (GtkAccelFlags)0);
+ }
+ }
+# endif /* GTK_USE_ACCEL */
+
+ menu->id = widget;
+}
+
+# endif /* !HAVE_GTK2 */
+
+ void
+gui_mch_add_menu(vimmenu_T *menu, int idx)
+{
+ vimmenu_T *parent;
+ GtkWidget *parent_widget;
+
+ if (menu->name[0] == ']' || menu_is_popup(menu->name))
+ {
+ menu->submenu_id = gtk_menu_new();
+ return;
+ }
+
+ parent = menu->parent;
+
+ if ((parent != NULL && parent->submenu_id == NULL)
+ || !menu_is_menubar(menu->name))
+ return;
+
+ parent_widget = (parent != NULL) ? parent->submenu_id : gui.menubar;
+ menu_item_new(menu, parent_widget);
+
+ /* since the tearoff should always appear first, increment idx */
+ if (parent != NULL && !menu_is_popup(parent->name))
+ ++idx;
+
+ gtk_menu_shell_insert(GTK_MENU_SHELL(parent_widget), menu->id, idx);
+
+#ifndef HAVE_GTK2
+ /*
+ * The "Help" menu is a special case, and should be placed at the far
+ * right hand side of the menu-bar. It's detected by its high priority.
+ *
+ * Right-aligning "Help" is considered bad UI design nowadays.
+ * Thus lets disable this for GTK+ 2 to match the environment.
+ */
+ if (parent == NULL && menu->priority >= 9999)
+ gtk_menu_item_right_justify(GTK_MENU_ITEM(menu->id));
+#endif
+
+ menu->submenu_id = gtk_menu_new();
+
+ gtk_menu_set_accel_group(GTK_MENU(menu->submenu_id), gui.accel_group);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu->id), menu->submenu_id);
+
+ menu->tearoff_handle = gtk_tearoff_menu_item_new();
+ if (vim_strchr(p_go, GO_TEAROFF) != NULL)
+ gtk_widget_show(menu->tearoff_handle);
+ gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
+}
+
+/*ARGSUSED*/
+ static void
+menu_item_activate(GtkWidget *widget, gpointer data)
+{
+ gui_menu_cb((vimmenu_T *)data);
+
+# ifndef HAVE_GTK2
+ /* Work around a bug in GTK+ 1: we don't seem to get a focus-in
+ * event after clicking a menu item shown via :popup. */
+ if (!gui.in_focus)
+ gui_focus_change(TRUE);
+# endif
+
+ /* make sure the menu action is taken immediately */
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+# if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
+/*
+ * These are the pixmaps used for the default buttons.
+ * Order must exactly match toolbar_names[] in menu.c!
+ */
+static char **(built_in_pixmaps[]) =
+{
+ tb_new_xpm,
+ tb_open_xpm,
+ tb_save_xpm,
+ tb_undo_xpm,
+ tb_redo_xpm,
+ tb_cut_xpm,
+ tb_copy_xpm,
+ tb_paste_xpm,
+ tb_print_xpm,
+ tb_help_xpm,
+ tb_find_xpm,
+ tb_save_all_xpm,
+ tb_save_session_xpm,
+ tb_new_session_xpm,
+ tb_load_session_xpm,
+ tb_macro_xpm,
+ tb_replace_xpm,
+ tb_close_xpm,
+ tb_maximize_xpm,
+ tb_minimize_xpm,
+ tb_split_xpm,
+ tb_shell_xpm,
+ tb_find_prev_xpm,
+ tb_find_next_xpm,
+ tb_find_help_xpm,
+ tb_make_xpm,
+ tb_jump_xpm,
+ tb_ctags_xpm,
+ tb_vsplit_xpm,
+ tb_maxwidth_xpm,
+ tb_minwidth_xpm,
+ tb_exit_xpm
+};
+
+/*
+ * creates a blank pixmap using tb_blank
+ */
+ static void
+pixmap_create_from_xpm(char **xpm, GdkPixmap **pixmap, GdkBitmap **mask)
+{
+ *pixmap = gdk_pixmap_colormap_create_from_xpm_d(
+ NULL,
+ gtk_widget_get_colormap(gui.mainwin),
+ mask,
+ NULL,
+ xpm);
+}
+
+/*
+ * creates a pixmap by using a built-in number
+ */
+ static void
+pixmap_create_by_num(int pixmap_num, GdkPixmap **pixmap, GdkBitmap **mask)
+{
+ if (pixmap_num >= 0 && pixmap_num < (sizeof(built_in_pixmaps)
+ / sizeof(built_in_pixmaps[0])))
+ pixmap_create_from_xpm(built_in_pixmaps[pixmap_num], pixmap, mask);
+}
+
+/*
+ * Creates a pixmap by using the pixmap "name" found in 'runtimepath'/bitmaps/
+ */
+ static void
+pixmap_create_by_dir(char_u *name, GdkPixmap **pixmap, GdkBitmap **mask)
+{
+ char_u full_pathname[MAXPATHL + 1];
+
+ if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
+ *pixmap = gdk_pixmap_colormap_create_from_xpm(
+ NULL,
+ gtk_widget_get_colormap(gui.mainwin),
+ mask,
+ &gui.mainwin->style->bg[GTK_STATE_NORMAL],
+ (const char *)full_pathname);
+}
+
+/*
+ * Creates a pixmap by using the pixmap "fname".
+ */
+ static void
+pixmap_create_from_file(char_u *fname, GdkPixmap **pixmap, GdkBitmap **mask)
+{
+ *pixmap = gdk_pixmap_colormap_create_from_xpm(
+ NULL,
+ gtk_widget_get_colormap(gui.mainwin),
+ mask,
+ &gui.mainwin->style->bg[GTK_STATE_NORMAL],
+ (const char *)fname);
+}
+
+# endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
+
+ void
+gui_mch_add_menu_item(vimmenu_T *menu, int idx)
+{
+ vimmenu_T *parent;
+
+ parent = menu->parent;
+
+# ifdef FEAT_TOOLBAR
+ if (menu_is_toolbar(parent->name))
+ {
+ GtkToolbar *toolbar;
+
+ toolbar = GTK_TOOLBAR(gui.toolbar);
+ menu->submenu_id = NULL;
+
+ if (menu_is_separator(menu->name))
+ {
+ gtk_toolbar_insert_space(toolbar, idx);
+ menu->id = NULL;
+ }
+ else
+ {
+# ifdef HAVE_GTK2
+ char_u *text;
+ char_u *tooltip;
+
+ text = CONVERT_TO_UTF8(menu->dname);
+ tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
+
+ menu->id = gtk_toolbar_insert_item(
+ toolbar,
+ (const char *)text,
+ (const char *)tooltip,
+ NULL,
+ create_menu_icon(menu, gtk_toolbar_get_icon_size(toolbar)),
+ G_CALLBACK(&menu_item_activate),
+ menu,
+ idx);
+
+ CONVERT_TO_UTF8_FREE(text);
+ CONVERT_TO_UTF8_FREE(tooltip);
+
+# else /* !HAVE_GTK2 */
+
+ GdkPixmap *pixmap = NULL;
+ GdkBitmap *mask = NULL;
+
+ /* First try user specified bitmap, then builtin, the a blank. */
+ if (menu->iconfile != NULL)
+ {
+ char_u buf[MAXPATHL + 1];
+
+ gui_find_iconfile(menu->iconfile, buf, "xpm");
+ pixmap_create_from_file(buf, &pixmap, &mask);
+ }
+ if (pixmap == NULL && !menu->icon_builtin)
+ pixmap_create_by_dir(menu->name, &pixmap, &mask);
+ if (pixmap == NULL && menu->iconidx >= 0)
+ pixmap_create_by_num(menu->iconidx, &pixmap, &mask);
+ if (pixmap == NULL)
+ pixmap_create_from_xpm(tb_blank_xpm, &pixmap, &mask);
+ if (pixmap == NULL)
+ return; /* should at least have blank pixmap, but if not... */
+
+ menu->id = gtk_toolbar_insert_item(
+ toolbar,
+ (char *)(menu->dname),
+ (char *)(menu->strings[MENU_INDEX_TIP]),
+ (char *)(menu->dname),
+ gtk_pixmap_new(pixmap, mask),
+ GTK_SIGNAL_FUNC(menu_item_activate),
+ (gpointer)menu,
+ idx);
+# endif /* !HAVE_GTK2 */
+ }
+ }
+ else
+# endif /* FEAT_TOOLBAR */
+ {
+ /* No parent, must be a non-menubar menu */
+ if (parent->submenu_id == NULL)
+ return;
+
+ /* Make place for the possible tearoff handle item. Not in the popup
+ * menu, it doesn't have a tearoff item. */
+ if (parent != NULL && !menu_is_popup(parent->name))
+ ++idx;
+
+ if (menu_is_separator(menu->name))
+ {
+ /* Separator: Just add it */
+ menu->id = gtk_menu_item_new();
+ gtk_widget_set_sensitive(menu->id, FALSE);
+ gtk_widget_show(menu->id);
+ gtk_menu_insert(GTK_MENU(parent->submenu_id), menu->id, idx);
+
+ return;
+ }
+
+ /* Add textual menu item. */
+ menu_item_new(menu, parent->submenu_id);
+ gtk_widget_show(menu->id);
+ gtk_menu_insert(GTK_MENU(parent->submenu_id), menu->id, idx);
+
+ if (menu->id != NULL)
+ gtk_signal_connect(GTK_OBJECT(menu->id), "activate",
+ GTK_SIGNAL_FUNC(menu_item_activate), menu);
+ }
+}
+#endif /* FEAT_MENU */
+
+
+ void
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
+{
+ gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h);
+}
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Enable or disable accelators for the toplevel menus.
+ */
+ void
+gui_gtk_set_mnemonics(int enable)
+{
+ vimmenu_T *menu;
+ char_u *name;
+# if !defined(HAVE_GTK2) && defined(GTK_USE_ACCEL)
+ guint accel_key;
+# endif
+
+ for (menu = root_menu; menu != NULL; menu = menu->next)
+ {
+ if (menu->id == NULL)
+ continue;
+
+# if defined(HAVE_GTK2)
+ name = translate_mnemonic_tag(menu->name, enable);
+ gtk_label_set_text_with_mnemonic(GTK_LABEL(menu->label),
+ (const char *)name);
+ vim_free(name);
+# elif defined(GTK_USE_ACCEL)
+ name = translate_mnemonic_tag(menu->name, TRUE);
+ if (name != NULL)
+ {
+ accel_key = gtk_label_parse_uline(GTK_LABEL(menu->label),
+ (const char *)name);
+ if (accel_key != GDK_VoidSymbol)
+ gtk_widget_remove_accelerator(menu->id, gui.accel_group,
+ accel_key, GDK_MOD1_MASK);
+ if (enable && accel_key != GDK_VoidSymbol)
+ gtk_widget_add_accelerator(menu->id, "activate_item",
+ gui.accel_group,
+ accel_key, GDK_MOD1_MASK,
+ (GtkAccelFlags)0);
+ vim_free(name);
+ }
+ if (!enable)
+ {
+ name = translate_mnemonic_tag(menu->name, FALSE);
+ gtk_label_parse_uline(GTK_LABEL(menu->label), (const char *)name);
+ vim_free(name);
+ }
+# endif
+ }
+}
+
+ static void
+recurse_tearoffs(vimmenu_T *menu, int val)
+{
+ for (; menu != NULL; menu = menu->next)
+ {
+ if (menu->submenu_id != NULL && menu->tearoff_handle != NULL
+ && menu->name[0] != ']' && !menu_is_popup(menu->name))
+ {
+ if (val)
+ gtk_widget_show(menu->tearoff_handle);
+ else
+ gtk_widget_hide(menu->tearoff_handle);
+ }
+ recurse_tearoffs(menu->children, val);
+ }
+}
+
+ void
+gui_mch_toggle_tearoffs(int enable)
+{
+ recurse_tearoffs(root_menu, enable);
+}
+#endif /* FEAT_MENU */
+
+
+#if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
+/*
+ * Seems like there's a hole in the GTK Toolbar API: there's no provision for
+ * removing an item from the toolbar. Therefore I need to resort to going
+ * really deeply into the internal widget structures.
+ *
+ * <danielk> I'm not sure the statement above is true -- at least with
+ * GTK+ 2 one can just call gtk_widget_destroy() and be done with it.
+ * It is true though that you couldn't remove space items before GTK+ 2
+ * (without digging into the internals that is). But the code below
+ * doesn't seem to handle those either. Well, it's obsolete anyway.
+ */
+ static void
+toolbar_remove_item_by_text(GtkToolbar *tb, const char *text)
+{
+ GtkContainer *container;
+ GList *childl;
+ GtkToolbarChild *gtbc;
+
+ g_return_if_fail(tb != NULL);
+ g_return_if_fail(GTK_IS_TOOLBAR(tb));
+ container = GTK_CONTAINER(&tb->container);
+
+ for (childl = tb->children; childl; childl = childl->next)
+ {
+ gtbc = (GtkToolbarChild *)childl->data;
+
+ if (gtbc->type != GTK_TOOLBAR_CHILD_SPACE
+ && strcmp(GTK_LABEL(gtbc->label)->label, text) == 0)
+ {
+ gboolean was_visible;
+
+ was_visible = GTK_WIDGET_VISIBLE(gtbc->widget);
+ gtk_widget_unparent(gtbc->widget);
+
+ tb->children = g_list_remove_link(tb->children, childl);
+ g_free(gtbc);
+ g_list_free(childl);
+ tb->num_children--;
+
+ if (was_visible && GTK_WIDGET_VISIBLE(container))
+ gtk_widget_queue_resize(GTK_WIDGET(container));
+
+ break;
+ }
+ }
+}
+#endif /* FEAT_TOOLBAR && !HAVE_GTK2 */
+
+
+#if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)
+ static int
+get_menu_position(vimmenu_T *menu)
+{
+ vimmenu_T *node;
+ int index = 0;
+
+ for (node = menu->parent->children; node != menu; node = node->next)
+ {
+ g_return_val_if_fail(node != NULL, -1);
+ ++index;
+ }
+
+ return index;
+}
+#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
+
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_menu_set_tip(vimmenu_T *menu)
+{
+ if (menu->id != NULL && menu->parent != NULL
+ && gui.toolbar != NULL && menu_is_toolbar(menu->parent->name))
+ {
+ char_u *tooltip;
+
+# ifdef HAVE_GTK2
+ tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
+# else
+ tooltip = menu->strings[MENU_INDEX_TIP];
+# endif
+ gtk_tooltips_set_tip(GTK_TOOLBAR(gui.toolbar)->tooltips,
+ menu->id, (const char *)tooltip, NULL);
+# ifdef HAVE_GTK2
+ CONVERT_TO_UTF8_FREE(tooltip);
+# endif
+ }
+}
+#endif /* FEAT_TOOLBAR */
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+# ifdef FEAT_TOOLBAR
+ if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
+ {
+# ifdef HAVE_GTK2
+ if (menu_is_separator(menu->name))
+ gtk_toolbar_remove_space(GTK_TOOLBAR(gui.toolbar),
+ get_menu_position(menu));
+ else if (menu->id != NULL)
+ gtk_widget_destroy(menu->id);
+# else
+ toolbar_remove_item_by_text(GTK_TOOLBAR(gui.toolbar),
+ (const char *)menu->dname);
+# endif
+ }
+ else
+# endif /* FEAT_TOOLBAR */
+ {
+ if (menu->submenu_id != NULL)
+ gtk_widget_destroy(menu->submenu_id);
+
+ if (menu->id != NULL)
+ gtk_widget_destroy(menu->id);
+ }
+
+ menu->submenu_id = NULL;
+ menu->id = NULL;
+}
+#endif /* FEAT_MENU */
+
+
+/*
+ * Scrollbar stuff.
+ */
+ void
+gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)
+{
+ if (sb->id != NULL)
+ {
+ GtkAdjustment *adjustment;
+
+ adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id));
+
+ adjustment->lower = 0.0;
+ adjustment->value = val;
+ adjustment->upper = max + 1;
+ adjustment->page_size = size;
+ adjustment->page_increment = size < 3L ? 1L : size - 2L;
+ adjustment->step_increment = 1.0;
+
+#ifdef HAVE_GTK2
+ g_signal_handler_block(GTK_OBJECT(adjustment),
+ (gulong)sb->handler_id);
+#else
+ gtk_signal_handler_block(GTK_OBJECT(adjustment),
+ (guint)sb->handler_id);
+#endif
+ gtk_adjustment_changed(adjustment);
+#ifdef HAVE_GTK2
+ g_signal_handler_unblock(GTK_OBJECT(adjustment),
+ (gulong)sb->handler_id);
+#else
+ gtk_signal_handler_unblock(GTK_OBJECT(adjustment),
+ (guint)sb->handler_id);
+#endif
+ }
+}
+
+ void
+gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)
+{
+ if (sb->id != NULL)
+ gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h);
+}
+
+/*
+ * Take action upon scrollbar dragging.
+ */
+ static void
+adjustment_value_changed(GtkAdjustment *adjustment, gpointer data)
+{
+ scrollbar_T *sb;
+ long value;
+ int dragging = FALSE;
+
+#ifdef FEAT_XIM
+ /* cancel any preediting */
+ if (im_is_preediting())
+ xim_reset();
+#endif
+
+ sb = gui_find_scrollbar((long)data);
+ value = (long)adjustment->value;
+ /*
+ * The dragging argument must be right for the scrollbar to work with
+ * closed folds. This isn't documented, hopefully this will keep on
+ * working in later GTK versions.
+ *
+ * FIXME: Well, it doesn't work in GTK2. :)
+ * HACK: Get the mouse pointer position, if it appears to be on an arrow
+ * button set "dragging" to FALSE. This assumes square buttons!
+ */
+ if (sb != NULL)
+ {
+#ifdef HAVE_GTK2
+ dragging = TRUE;
+
+ if (sb->wp != NULL)
+ {
+ int x;
+ int y;
+ GdkModifierType state;
+ int width;
+ int height;
+
+ /* vertical scrollbar: need to set "dragging" properly in case
+ * there are closed folds. */
+ gdk_window_get_pointer(sb->id->window, &x, &y, &state);
+ gdk_window_get_size(sb->id->window, &width, &height);
+ if (x >= 0 && x < width && y >= 0 && y < height)
+ {
+ if (y < width)
+ {
+ /* up arrow: move one (closed fold) line up */
+ dragging = FALSE;
+ value = sb->wp->w_topline - 2;
+ }
+ else if (y > height - width)
+ {
+ /* down arrow: move one (closed fold) line down */
+ dragging = FALSE;
+ value = sb->wp->w_topline;
+ }
+ }
+ }
+#else
+ dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
+#endif
+ }
+
+ gui_drag_scrollbar(sb, value, dragging);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/* SBAR_VERT or SBAR_HORIZ */
+ void
+gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
+{
+ if (orient == SBAR_HORIZ)
+ sb->id = gtk_hscrollbar_new(NULL);
+ else if (orient == SBAR_VERT)
+ sb->id = gtk_vscrollbar_new(NULL);
+
+ if (sb->id != NULL)
+ {
+ GtkAdjustment *adjustment;
+
+ GTK_WIDGET_UNSET_FLAGS(sb->id, GTK_CAN_FOCUS);
+ gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0);
+
+ adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id));
+
+ sb->handler_id = gtk_signal_connect(
+ GTK_OBJECT(adjustment), "value_changed",
+ GTK_SIGNAL_FUNC(adjustment_value_changed),
+ GINT_TO_POINTER(sb->ident));
+ gui_mch_update();
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
+{
+ if (sb->id != NULL)
+ {
+ gtk_widget_destroy(sb->id);
+ sb->id = NULL;
+ }
+ gui_mch_update();
+}
+#endif
+
+#if defined(FEAT_BROWSE) || defined(PROTO)
+/*
+ * Implementation of the file selector related stuff
+ */
+
+/*ARGSUSED*/
+ static void
+browse_ok_cb(GtkWidget *widget, gpointer cbdata)
+{
+ gui_T *vw = (gui_T *)cbdata;
+
+ if (vw->browse_fname != NULL)
+ g_free(vw->browse_fname);
+
+ vw->browse_fname = (char_u *)g_strdup(gtk_file_selection_get_filename(
+ GTK_FILE_SELECTION(vw->filedlg)));
+ gtk_widget_hide(vw->filedlg);
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*ARGSUSED*/
+ static void
+browse_cancel_cb(GtkWidget *widget, gpointer cbdata)
+{
+ gui_T *vw = (gui_T *)cbdata;
+
+ if (vw->browse_fname != NULL)
+ {
+ g_free(vw->browse_fname);
+ vw->browse_fname = NULL;
+ }
+ gtk_widget_hide(vw->filedlg);
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*ARGSUSED*/
+ static gboolean
+browse_destroy_cb(GtkWidget * widget)
+{
+ if (gui.browse_fname != NULL)
+ {
+ g_free(gui.browse_fname);
+ gui.browse_fname = NULL;
+ }
+ gui.filedlg = NULL;
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ return FALSE;
+}
+
+/*
+ * Put up a file requester.
+ * Returns the selected name in allocated memory, or NULL for Cancel.
+ * saving, select file to write
+ * title title for the window
+ * dflt default name
+ * ext not used (extension added)
+ * initdir initial directory, NULL for current dir
+ * filter not used (file name filter)
+ */
+/*ARGSUSED*/
+ char_u *
+gui_mch_browse(int saving,
+ char_u *title,
+ char_u *dflt,
+ char_u *ext,
+ char_u *initdir,
+ char_u *filter)
+{
+ GtkFileSelection *fs; /* shortcut */
+ char_u dirbuf[MAXPATHL];
+ char_u *p;
+
+# ifdef HAVE_GTK2
+ title = CONVERT_TO_UTF8(title);
+# endif
+
+ if (!gui.filedlg)
+ {
+ gui.filedlg = gtk_file_selection_new((const gchar *)title);
+ gtk_window_set_modal(GTK_WINDOW(gui.filedlg), TRUE);
+ gtk_window_set_transient_for(GTK_WINDOW(gui.filedlg),
+ GTK_WINDOW(gui.mainwin));
+ fs = GTK_FILE_SELECTION(gui.filedlg);
+
+ gtk_container_border_width(GTK_CONTAINER(fs), 4);
+
+ gtk_signal_connect(GTK_OBJECT(fs->ok_button),
+ "clicked", GTK_SIGNAL_FUNC(browse_ok_cb), &gui);
+ gtk_signal_connect(GTK_OBJECT(fs->cancel_button),
+ "clicked", GTK_SIGNAL_FUNC(browse_cancel_cb), &gui);
+ /* gtk_signal_connect() doesn't work for destroy, it causes a hang */
+ gtk_signal_connect_object(GTK_OBJECT(gui.filedlg),
+ "destroy", GTK_SIGNAL_FUNC(browse_destroy_cb),
+ GTK_OBJECT(gui.filedlg));
+ }
+ else
+ gtk_window_set_title(GTK_WINDOW(gui.filedlg), (const gchar *)title);
+
+# ifdef HAVE_GTK2
+ CONVERT_TO_UTF8_FREE(title);
+# endif
+
+ /* if our pointer is currently hidden, then we should show it. */
+ gui_mch_mousehide(FALSE);
+
+ /* Concatenate "initdir" and "dflt". */
+ if (initdir == NULL || *initdir == NUL)
+ mch_dirname(dirbuf, MAXPATHL);
+ else if (STRLEN(initdir) + 2 < MAXPATHL)
+ STRCPY(dirbuf, initdir);
+ else
+ dirbuf[0] = NUL;
+ /* Always need a trailing slash for a directory. */
+ add_pathsep(dirbuf);
+ if (dflt != NULL && *dflt != NUL
+ && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
+ STRCAT(dirbuf, dflt);
+
+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
+ (const gchar *)dirbuf);
+# ifndef HAVE_GTK2
+ gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
+ GTK_WIDGET(gui.filedlg), VW_POS_MOUSE);
+# endif
+
+ gtk_widget_show(gui.filedlg);
+ while (gui.filedlg && GTK_WIDGET_DRAWABLE(gui.filedlg))
+ gtk_main_iteration_do(TRUE);
+
+ if (gui.browse_fname == NULL)
+ return NULL;
+
+ /* shorten the file name if possible */
+ mch_dirname(dirbuf, MAXPATHL);
+ p = shorten_fname(gui.browse_fname, dirbuf);
+ if (p == NULL)
+ p = gui.browse_fname;
+ return vim_strsave(p);
+}
+
+#endif /* FEAT_BROWSE */
+
+#if (defined(FEAT_GUI_DIALOG) && !defined(HAVE_GTK2)) || defined(PROTO)
+
+static char_u *dialog_textfield = NULL;
+static GtkWidget *dialog_textentry;
+
+ static void
+dlg_destroy(GtkWidget *dlg)
+{
+ if (dialog_textfield != NULL)
+ {
+ const char *text;
+
+ text = gtk_entry_get_text(GTK_ENTRY(dialog_textentry));
+ STRNCPY(dialog_textfield, text, IOSIZE);
+ dialog_textfield[IOSIZE - 1] = NUL;
+ }
+
+ /* Destroy the dialog, will break the waiting loop. */
+ gtk_widget_destroy(dlg);
+}
+
+# ifdef FEAT_GUI_GNOME
+/* ARGSUSED */
+ static int
+gui_gnome_dialog( int type,
+ char_u *title,
+ char_u *message,
+ char_u *buttons,
+ int dfltbutton,
+ char_u *textfield)
+{
+ GtkWidget *dlg;
+ char *gdtype;
+ char_u *buttons_copy, *p, *next;
+ char **buttons_list;
+ int butcount, cur;
+
+ /* make a copy, so that we can insert NULs */
+ if ((buttons_copy = vim_strsave(buttons)) == NULL)
+ return -1;
+
+ /* determine exact number of buttons and allocate array to hold them */
+ for (butcount = 0, p = buttons; *p; p++)
+ {
+ if (*p == '\n')
+ butcount++;
+ }
+ butcount++;
+ buttons_list = g_new0(char *, butcount + 1);
+
+ /* Add pixmap */
+ switch (type)
+ {
+ case VIM_ERROR:
+ gdtype = GNOME_MESSAGE_BOX_ERROR;
+ break;
+ case VIM_WARNING:
+ gdtype = GNOME_MESSAGE_BOX_WARNING;
+ break;
+ case VIM_INFO:
+ gdtype = GNOME_MESSAGE_BOX_INFO;
+ break;
+ case VIM_QUESTION:
+ gdtype = GNOME_MESSAGE_BOX_QUESTION;
+ break;
+ default:
+ gdtype = GNOME_MESSAGE_BOX_GENERIC;
+ };
+
+ p = buttons_copy;
+ for (cur = 0; cur < butcount; ++cur)
+ {
+ for (next = p; *next; ++next)
+ {
+ if (*next == DLG_HOTKEY_CHAR)
+ mch_memmove(next, next + 1, STRLEN(next));
+ if (*next == DLG_BUTTON_SEP)
+ {
+ *next++ = NUL;
+ break;
+ }
+ }
+
+ /* this should probably go into a table, but oh well */
+ if (g_strcasecmp((char *)p, "Ok") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_OK);
+ else if (g_strcasecmp((char *)p, "Cancel") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_CANCEL);
+ else if (g_strcasecmp((char *)p, "Yes") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_YES);
+ else if (g_strcasecmp((char *)p, "No") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_NO);
+ else if (g_strcasecmp((char *)p, "Close") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_CLOSE);
+ else if (g_strcasecmp((char *)p, "Help") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_HELP);
+ else if (g_strcasecmp((char *)p, "Apply") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_APPLY);
+#if 0
+ /*
+ * these aren't really used that often anyway, but are listed here as
+ * placeholders in case we need them.
+ */
+ else if (g_strcasecmp((char *)p, "Next") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_NEXT);
+ else if (g_strcasecmp((char *)p, "Prev") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_PREV);
+ else if (g_strcasecmp((char *)p, "Up") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_UP);
+ else if (g_strcasecmp((char *)p, "Down") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_DOWN);
+ else if (g_strcasecmp((char *)p, "Font") == 0)
+ buttons_list[cur] = g_strdup(GNOME_STOCK_BUTTON_FONT);
+#endif
+ else
+ buttons_list[cur] = g_strdup((char *)p);
+
+ if (*next == NUL)
+ break;
+
+ p = next;
+ }
+ vim_free(buttons_copy);
+
+ dlg = gnome_message_box_newv((const char *)message,
+ (const char *)gdtype,
+ (const char **)buttons_list);
+ for (cur = 0; cur < butcount; ++cur)
+ g_free(buttons_list[cur]);
+ g_free(buttons_list);
+
+ dialog_textfield = textfield;
+ if (textfield != NULL)
+ {
+ /* Add text entry field */
+ dialog_textentry = gtk_entry_new();
+ gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dlg)->vbox), dialog_textentry,
+ TRUE, TRUE, 0);
+ gtk_entry_set_text(GTK_ENTRY(dialog_textentry),
+ (const gchar *)textfield);
+ gtk_entry_select_region(GTK_ENTRY(dialog_textentry), 0,
+ STRLEN(textfield));
+ gtk_entry_set_max_length(GTK_ENTRY(dialog_textentry), IOSIZE - 1);
+ gtk_entry_set_position(GTK_ENTRY(dialog_textentry), STRLEN(textfield));
+ gtk_widget_show(dialog_textentry);
+ gtk_window_set_focus(GTK_WINDOW(dlg), dialog_textentry);
+ }
+
+ gtk_signal_connect_object(GTK_OBJECT(dlg), "destroy",
+ GTK_SIGNAL_FUNC(dlg_destroy), GTK_OBJECT(dlg));
+ gnome_dialog_set_default(GNOME_DIALOG(dlg), dfltbutton + 1);
+ gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
+ GTK_WIDGET(dlg), VW_POS_MOUSE);
+
+ return (1 + gnome_dialog_run_and_close(GNOME_DIALOG(dlg)));
+}
+
+# endif /* FEAT_GUI_GNOME */
+
+typedef struct _ButtonData
+{
+ int *status;
+ int index;
+ GtkWidget *dialog;
+} ButtonData;
+
+typedef struct _CancelData
+{
+ int *status;
+ int ignore_enter;
+ GtkWidget *dialog;
+} CancelData;
+
+/* ARGSUSED */
+ static void
+dlg_button_clicked(GtkWidget * widget, ButtonData *data)
+{
+ *(data->status) = data->index + 1;
+ dlg_destroy(data->dialog);
+}
+
+/*
+ * This makes the Escape key equivalent to the cancel button.
+ */
+/*ARGSUSED*/
+ static int
+dlg_key_press_event(GtkWidget * widget, GdkEventKey * event, CancelData *data)
+{
+ /* Ignore hitting Enter when there is no default button. */
+ if (data->ignore_enter && event->keyval == GDK_Return)
+ return TRUE;
+
+ if (event->keyval != GDK_Escape && event->keyval != GDK_Return)
+ return FALSE;
+
+ /* The result value of 0 from a dialog is signaling cancelation.
+ * 1 means OK. */
+ *(data->status) = (event->keyval == GDK_Return);
+ dlg_destroy(data->dialog);
+
+ return TRUE;
+}
+
+/*
+ * Callback function for when the dialog was destroyed by a window manager.
+ */
+ static void
+dlg_destroy_cb(int *p)
+{
+ *p = TRUE; /* set dialog_destroyed to break out of the loop */
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/* ARGSUSED */
+ int
+gui_mch_dialog( int type, /* type of dialog */
+ char_u *title, /* title of dialog */
+ char_u *message, /* message text */
+ char_u *buttons, /* names of buttons */
+ int def_but, /* default button */
+ char_u *textfield) /* text for textfield or NULL */
+{
+ char_u *names;
+ char_u *p;
+ int i;
+ int butcount;
+ int dialog_status = -1;
+ int dialog_destroyed = FALSE;
+ int vertical;
+
+ GtkWidget *dialog;
+ GtkWidget *frame;
+ GtkWidget *vbox;
+ GtkWidget *table;
+ GtkWidget *dialogmessage;
+ GtkWidget *action_area;
+ GtkWidget *sub_area;
+ GtkWidget *separator;
+ GtkAccelGroup *accel_group;
+ GtkWidget *pixmap;
+ GdkPixmap *icon = NULL;
+ GdkBitmap *mask = NULL;
+ char **icon_data = NULL;
+
+ GtkWidget **button;
+ ButtonData *data;
+ CancelData cancel_data;
+
+ /* if our pointer is currently hidden, then we should show it. */
+ gui_mch_mousehide(FALSE);
+
+# ifdef FEAT_GUI_GNOME
+ /* If Gnome is available, use it for the dialog. */
+ if (gtk_socket_id == 0)
+ return gui_gnome_dialog(type, title, message, buttons, def_but,
+ textfield);
+# endif
+
+ if (title == NULL)
+ title = (char_u *)_("Vim dialog...");
+
+ if ((type < 0) || (type > VIM_LAST_TYPE))
+ type = VIM_GENERIC;
+
+ /* Check 'v' flag in 'guioptions': vertical button placement. */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+
+ dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_title(GTK_WINDOW(dialog), (const gchar *)title);
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(gui.mainwin));
+ gtk_widget_realize(dialog);
+ gdk_window_set_decorations(dialog->window, GDK_DECOR_BORDER);
+ gdk_window_set_functions(dialog->window, GDK_FUNC_MOVE);
+
+ cancel_data.status = &dialog_status;
+ cancel_data.dialog = dialog;
+ gtk_signal_connect_after(GTK_OBJECT(dialog), "key_press_event",
+ GTK_SIGNAL_FUNC(dlg_key_press_event),
+ (gpointer) &cancel_data);
+ /* Catch the destroy signal, otherwise we don't notice a window manager
+ * destroying the dialog window. */
+ gtk_signal_connect_object(GTK_OBJECT(dialog), "destroy",
+ GTK_SIGNAL_FUNC(dlg_destroy_cb),
+ (gpointer)&dialog_destroyed);
+
+ gtk_grab_add(dialog);
+
+ /* this makes it look beter on Motif style window managers */
+ frame = gtk_frame_new(NULL);
+ gtk_container_add(GTK_CONTAINER(dialog), frame);
+ gtk_widget_show(frame);
+
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+
+ table = gtk_table_new(1, 3, FALSE);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+ gtk_container_border_width(GTK_CONTAINER(table), 4);
+ gtk_box_pack_start(GTK_BOX(vbox), table, 4, 4, 0);
+ gtk_widget_show(table);
+
+ /* Add pixmap */
+ switch (type)
+ {
+ case VIM_GENERIC:
+ icon_data = generic_xpm;
+ break;
+ case VIM_ERROR:
+ icon_data = error_xpm;
+ break;
+ case VIM_WARNING:
+ icon_data = alert_xpm;
+ break;
+ case VIM_INFO:
+ icon_data = info_xpm;
+ break;
+ case VIM_QUESTION:
+ icon_data = quest_xpm;
+ break;
+ default:
+ icon_data = generic_xpm;
+ };
+ icon = gdk_pixmap_colormap_create_from_xpm_d(NULL,
+ gtk_widget_get_colormap(dialog),
+ &mask, NULL, icon_data);
+ if (icon)
+ {
+ pixmap = gtk_pixmap_new(icon, mask);
+ /* gtk_misc_set_alignment(GTK_MISC(pixmap), 0.5, 0.5); */
+ gtk_table_attach_defaults(GTK_TABLE(table), pixmap, 0, 1, 0, 1);
+ gtk_widget_show(pixmap);
+ }
+
+ /* Add label */
+ dialogmessage = gtk_label_new((const gchar *)message);
+ gtk_table_attach_defaults(GTK_TABLE(table), dialogmessage, 1, 2, 0, 1);
+ gtk_widget_show(dialogmessage);
+
+ dialog_textfield = textfield;
+ if (textfield != NULL)
+ {
+ /* Add text entry field */
+ dialog_textentry = gtk_entry_new();
+ gtk_widget_set_usize(dialog_textentry, 400, -2);
+ gtk_box_pack_start(GTK_BOX(vbox), dialog_textentry, TRUE, TRUE, 0);
+ gtk_entry_set_text(GTK_ENTRY(dialog_textentry),
+ (const gchar *)textfield);
+ gtk_entry_select_region(GTK_ENTRY(dialog_textentry), 0,
+ STRLEN(textfield));
+ gtk_entry_set_max_length(GTK_ENTRY(dialog_textentry), IOSIZE - 1);
+ gtk_entry_set_position(GTK_ENTRY(dialog_textentry), STRLEN(textfield));
+ gtk_widget_show(dialog_textentry);
+ }
+
+ /* Add box for buttons */
+ action_area = gtk_hbox_new(FALSE, 0);
+ gtk_container_border_width(GTK_CONTAINER(action_area), 4);
+ gtk_box_pack_end(GTK_BOX(vbox), action_area, FALSE, TRUE, 0);
+ gtk_widget_show(action_area);
+
+ /* Add a [vh]box in the hbox to center the buttons in the dialog. */
+ if (vertical)
+ sub_area = gtk_vbox_new(FALSE, 0);
+ else
+ sub_area = gtk_hbox_new(FALSE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(sub_area), 0);
+ gtk_box_pack_start(GTK_BOX(action_area), sub_area, TRUE, FALSE, 0);
+ gtk_widget_show(sub_area);
+
+ /*
+ * Create the buttons.
+ */
+
+ /*
+ * Translate the Vim accelerator character into an underscore for GTK+.
+ * Double underscores to keep them in the label.
+ */
+ /* count the number of underscores */
+ i = 1;
+ for (p = buttons; *p; ++p)
+ if (*p == '_')
+ ++i;
+
+ /* make a copy of "buttons" with the translated characters */
+ names = alloc(STRLEN(buttons) + i);
+ if (names == NULL)
+ return -1;
+
+ p = names;
+ for (i = 0; buttons[i]; ++i)
+ {
+ if (buttons[i] == DLG_HOTKEY_CHAR)
+ *p++ = '_';
+ else
+ {
+ if (buttons[i] == '_')
+ *p++ = '_';
+ *p++ = buttons[i];
+ }
+ }
+ *p = NUL;
+
+ /* Count the number of buttons and allocate button[] and data[]. */
+ butcount = 1;
+ for (p = names; *p; ++p)
+ if (*p == DLG_BUTTON_SEP)
+ ++butcount;
+ button = (GtkWidget **)alloc((unsigned)(butcount * sizeof(GtkWidget *)));
+ data = (ButtonData *)alloc((unsigned)(butcount * sizeof(ButtonData)));
+ if (button == NULL || data == NULL)
+ {
+ vim_free(names);
+ vim_free(button);
+ vim_free(data);
+ return -1;
+ }
+
+ /* Attach the new accelerator group to the window. */
+ accel_group = gtk_accel_group_new();
+ gtk_accel_group_attach(accel_group, GTK_OBJECT(dialog));
+
+ p = names;
+ for (butcount = 0; *p; ++butcount)
+ {
+ char_u *next;
+ GtkWidget *label;
+# ifdef GTK_USE_ACCEL
+ guint accel_key;
+# endif
+
+ /* Chunk out this single button. */
+ for (next = p; *next; ++next)
+ {
+ if (*next == DLG_BUTTON_SEP)
+ {
+ *next++ = NUL;
+ break;
+ }
+ }
+
+ button[butcount] = gtk_button_new();
+ GTK_WIDGET_SET_FLAGS(button[butcount], GTK_CAN_DEFAULT);
+
+ label = gtk_accel_label_new("");
+ gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(label), dialog);
+
+# ifdef GTK_USE_ACCEL
+ accel_key = gtk_label_parse_uline(GTK_LABEL(label), (const gchar *)p);
+ /* Don't add accelator if 'winaltkeys' is "no". */
+ if (accel_key != GDK_VoidSymbol)
+ {
+ gtk_widget_add_accelerator(button[butcount],
+ "clicked",
+ accel_group,
+ accel_key, 0,
+ 0);
+ }
+# else
+ (void)gtk_label_parse_uline(GTK_LABEL(label), (const gchar *)p);
+# endif
+
+ gtk_container_add(GTK_CONTAINER(button[butcount]), label);
+ gtk_widget_show_all(button[butcount]);
+
+ data[butcount].status = &dialog_status;
+ data[butcount].index = butcount;
+ data[butcount].dialog = dialog;
+ gtk_signal_connect(GTK_OBJECT(button[butcount]),
+ (const char *)"clicked",
+ GTK_SIGNAL_FUNC(dlg_button_clicked),
+ (gpointer) &data[butcount]);
+
+ gtk_box_pack_start(GTK_BOX(sub_area), button[butcount],
+ TRUE, FALSE, 0);
+ p = next;
+ }
+
+ vim_free(names);
+
+ cancel_data.ignore_enter = FALSE;
+ if (butcount > 0)
+ {
+ --def_but; /* 1 is first button */
+ if (def_but >= butcount)
+ def_but = -1;
+ if (def_but >= 0)
+ {
+ gtk_widget_grab_focus(button[def_but]);
+ gtk_widget_grab_default(button[def_but]);
+ }
+ else
+ /* No default, ignore hitting Enter. */
+ cancel_data.ignore_enter = TRUE;
+ }
+
+ if (textfield != NULL)
+ gtk_window_set_focus(GTK_WINDOW(dialog), dialog_textentry);
+
+ separator = gtk_hseparator_new();
+ gtk_box_pack_end(GTK_BOX(vbox), separator, FALSE, TRUE, 0);
+ gtk_widget_show(separator);
+
+ dialog_status = -1;
+
+ gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
+ GTK_WIDGET(dialog), VW_POS_MOUSE);
+
+ gtk_widget_show(dialog);
+
+ /* loop here until the dialog goes away */
+ while (dialog_status == -1 && !dialog_destroyed
+ && GTK_WIDGET_DRAWABLE(dialog))
+ gtk_main_iteration_do(TRUE);
+
+ if (dialog_status < 0)
+ dialog_status = 0;
+ if (dialog_status != 1 && textfield != NULL)
+ *textfield = NUL; /* dialog was cancelled */
+
+ /* let the garbage collector know that we don't need it any longer */
+ gtk_accel_group_unref(accel_group);
+
+ vim_free(button);
+ vim_free(data);
+
+ return dialog_status;
+}
+
+#endif /* FEAT_GUI_DIALOG && !HAVE_GTK2 */
+
+
+#if defined(FEAT_GUI_DIALOG) && defined(HAVE_GTK2)
+
+ static GtkWidget *
+create_message_dialog(int type, char_u *title, char_u *message)
+{
+ GtkWidget *dialog;
+ GtkMessageType message_type;
+
+ switch (type)
+ {
+ case VIM_ERROR: message_type = GTK_MESSAGE_ERROR; break;
+ case VIM_WARNING: message_type = GTK_MESSAGE_WARNING; break;
+ case VIM_QUESTION: message_type = GTK_MESSAGE_QUESTION; break;
+ default: message_type = GTK_MESSAGE_INFO; break;
+ }
+
+ message = CONVERT_TO_UTF8(message);
+ dialog = gtk_message_dialog_new(GTK_WINDOW(gui.mainwin),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ message_type,
+ GTK_BUTTONS_NONE,
+ "%s", (const char *)message);
+ CONVERT_TO_UTF8_FREE(message);
+
+ if (title != NULL)
+ {
+ title = CONVERT_TO_UTF8(title);
+ gtk_window_set_title(GTK_WINDOW(dialog), (const char *)title);
+ CONVERT_TO_UTF8_FREE(title);
+ }
+ else if (type == VIM_GENERIC)
+ {
+ gtk_window_set_title(GTK_WINDOW(dialog), "VIM");
+ }
+
+ return dialog;
+}
+
+/*
+ * Split up button_string into individual button labels by inserting
+ * NUL bytes. Also replace the Vim-style mnemonic accelerator prefix
+ * '&' with '_'. button_string must point to allocated memory!
+ * Return an allocated array of pointers into button_string.
+ */
+ static char **
+split_button_string(char_u *button_string, int *n_buttons)
+{
+ char **array;
+ char_u *p;
+ unsigned int count = 1;
+
+ for (p = button_string; *p != NUL; ++p)
+ if (*p == DLG_BUTTON_SEP)
+ ++count;
+
+ array = (char **)alloc((count + 1) * sizeof(char *));
+ count = 0;
+
+ if (array != NULL)
+ {
+ array[count++] = (char *)button_string;
+ for (p = button_string; *p != NUL; ++p)
+ {
+ if (*p == DLG_BUTTON_SEP)
+ {
+ *p = NUL;
+ array[count++] = (char *)p + 1;
+ }
+ else if (*p == DLG_HOTKEY_CHAR)
+ *p = '_';
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ array[count] = NULL; /* currently not relied upon, but doesn't hurt */
+ }
+
+ *n_buttons = count;
+ return array;
+}
+
+ static char **
+split_button_translation(const char *message)
+{
+ char **buttons = NULL;
+ char_u *str;
+ int n_buttons = 0;
+ int n_expected = 1;
+
+ for (str = (char_u *)message; *str != NUL; ++str)
+ if (*str == DLG_BUTTON_SEP)
+ ++n_expected;
+
+ str = (char_u *)_(message);
+ if (str != NULL)
+ {
+ if (output_conv.vc_type != CONV_NONE)
+ str = string_convert(&output_conv, str, NULL);
+ else
+ str = vim_strsave(str);
+
+ if (str != NULL)
+ buttons = split_button_string(str, &n_buttons);
+ }
+ /*
+ * Uh-oh... this should never ever happen. But we don't wanna crash
+ * if the translation is broken, thus fall back to the untranslated
+ * buttons string in case of emergency.
+ */
+ if (buttons == NULL || n_buttons != n_expected)
+ {
+ vim_free(buttons);
+ vim_free(str);
+ buttons = NULL;
+ str = vim_strsave((char_u *)message);
+
+ if (str != NULL)
+ buttons = split_button_string(str, &n_buttons);
+ if (buttons == NULL)
+ vim_free(str);
+ }
+
+ return buttons;
+}
+
+ static int
+button_equal(const char *a, const char *b)
+{
+ while (*a != '\0' && *b != '\0')
+ {
+ if (*a == '_' && *++a == '\0')
+ break;
+ if (*b == '_' && *++b == '\0')
+ break;
+
+ if (g_unichar_tolower(g_utf8_get_char(a))
+ != g_unichar_tolower(g_utf8_get_char(b)))
+ return FALSE;
+
+ a = g_utf8_next_char(a);
+ b = g_utf8_next_char(b);
+ }
+
+ return (*a == '\0' && *b == '\0');
+}
+
+ static void
+dialog_add_buttons(GtkDialog *dialog, char_u *button_string)
+{
+ char **ok;
+ char **ync; /* "yes no cancel" */
+ char **buttons;
+ int n_buttons = 0;
+ int index;
+
+ button_string = vim_strsave(button_string); /* must be writable */
+ if (button_string == NULL)
+ return;
+
+ /* Check 'v' flag in 'guioptions': vertical button placement. */
+ if (vim_strchr(p_go, GO_VERTICAL) != NULL)
+ {
+ GtkWidget *vbutton_box;
+
+ vbutton_box = gtk_vbutton_box_new();
+ gtk_widget_show(vbutton_box);
+ gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->vbox),
+ vbutton_box, TRUE, FALSE, 0);
+ /* Overrule the "action_area" value, hopefully this works... */
+ GTK_DIALOG(dialog)->action_area = vbutton_box;
+ }
+
+ /*
+ * Yes this is ugly, I don't particularly like it either. But doing it
+ * this way has the compelling advantage that translations need not to
+ * be touched at all. See below what 'ok' and 'ync' are used for.
+ */
+ ok = split_button_translation(N_("&Ok"));
+ ync = split_button_translation(N_("&Yes\n&No\n&Cancel"));
+ buttons = split_button_string(button_string, &n_buttons);
+
+ /*
+ * Yes, the buttons are in reversed order to match the GNOME 2 desktop
+ * environment. Don't hit me -- it's all about consistency.
+ * Well, apparently somebody changed his mind: with GTK 2.2.4 it works the
+ * other way around...
+ */
+ for (index = 1; index <= n_buttons; ++index)
+ {
+ char *label;
+ char_u *label8;
+
+ label = buttons[index - 1];
+ /*
+ * Perform some guesswork to find appropriate stock items for the
+ * buttons. We have to compare with a sample of the translated
+ * button string to get things right. Yes, this is hackish :/
+ *
+ * But even the common button labels aren't necessarily translated,
+ * since anyone can create their own dialogs using Vim functions.
+ * Thus we have to check for those too.
+ */
+ if (ok != NULL && ync != NULL) /* almost impossible to fail */
+ {
+ if (button_equal(label, ok[0])) label = GTK_STOCK_OK;
+ else if (button_equal(label, ync[0])) label = GTK_STOCK_YES;
+ else if (button_equal(label, ync[1])) label = GTK_STOCK_NO;
+ else if (button_equal(label, ync[2])) label = GTK_STOCK_CANCEL;
+ else if (button_equal(label, "Ok")) label = GTK_STOCK_OK;
+ else if (button_equal(label, "Yes")) label = GTK_STOCK_YES;
+ else if (button_equal(label, "No")) label = GTK_STOCK_NO;
+ else if (button_equal(label, "Cancel")) label = GTK_STOCK_CANCEL;
+ }
+ label8 = CONVERT_TO_UTF8((char_u *)label);
+ gtk_dialog_add_button(dialog, (const gchar *)label8, index);
+ CONVERT_TO_UTF8_FREE(label8);
+ }
+
+ if (ok != NULL)
+ vim_free(*ok);
+ if (ync != NULL)
+ vim_free(*ync);
+ vim_free(ok);
+ vim_free(ync);
+ vim_free(buttons);
+ vim_free(button_string);
+}
+
+/*
+ * Allow mnemonic accelerators to be activated without pressing <Alt>.
+ * I'm not sure if it's a wise idea to do this. However, the old GTK+ 1.2
+ * GUI used to work this way, and I consider the impact on UI consistency
+ * low enough to justify implementing this as a special Vim feature.
+ */
+typedef struct _DialogInfo
+{
+ int ignore_enter; /* no default button, ignore "Enter" */
+ int noalt; /* accept accelerators without Alt */
+ GtkDialog *dialog; /* Widget of the dialog */
+} DialogInfo;
+
+/*ARGSUSED2*/
+ static gboolean
+dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+ DialogInfo *di = (DialogInfo *)data;
+
+ /* Ignore hitting "Enter" if there is no default button. */
+ if (di->ignore_enter && event->keyval == GDK_Return)
+ return TRUE;
+
+ /* Close the dialog when hitting "Esc". */
+ if (event->keyval == GDK_Escape)
+ {
+ gtk_dialog_response(di->dialog, GTK_RESPONSE_REJECT);
+ return TRUE;
+ }
+
+ if (di->noalt
+ && (event->state & gtk_accelerator_get_default_mod_mask()) == 0)
+ {
+ return gtk_window_mnemonic_activate(
+ GTK_WINDOW(widget), event->keyval,
+ gtk_window_get_mnemonic_modifier(GTK_WINDOW(widget)));
+ }
+
+ return FALSE; /* continue emission */
+}
+
+ int
+gui_mch_dialog(int type, /* type of dialog */
+ char_u *title, /* title of dialog */
+ char_u *message, /* message text */
+ char_u *buttons, /* names of buttons */
+ int def_but, /* default button */
+ char_u *textfield) /* text for textfield or NULL */
+{
+ GtkWidget *dialog;
+ GtkWidget *entry = NULL;
+ char_u *text;
+ int response;
+ DialogInfo dialoginfo;
+
+ dialog = create_message_dialog(type, title, message);
+ dialoginfo.dialog = GTK_DIALOG(dialog);
+ dialog_add_buttons(GTK_DIALOG(dialog), buttons);
+
+ if (textfield != NULL)
+ {
+ GtkWidget *alignment;
+
+ entry = gtk_entry_new();
+ gtk_widget_show(entry);
+
+ text = CONVERT_TO_UTF8(textfield);
+ gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text);
+ CONVERT_TO_UTF8_FREE(text);
+
+ alignment = gtk_alignment_new((float)0.5, (float)0.5,
+ (float)1.0, (float)1.0);
+ gtk_container_add(GTK_CONTAINER(alignment), entry);
+ gtk_container_set_border_width(GTK_CONTAINER(alignment), 5);
+ gtk_widget_show(alignment);
+
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
+ alignment, TRUE, FALSE, 0);
+ dialoginfo.noalt = FALSE;
+ }
+ else
+ dialoginfo.noalt = TRUE;
+
+ /* Allow activation of mnemonic accelerators without pressing <Alt> when
+ * there is no textfield. Handle pressing Enter and Esc. */
+ g_signal_connect(G_OBJECT(dialog), "key_press_event",
+ G_CALLBACK(&dialog_key_press_event_cb), &dialoginfo);
+
+ if (def_but > 0)
+ {
+ gtk_dialog_set_default_response(GTK_DIALOG(dialog), def_but);
+ dialoginfo.ignore_enter = FALSE;
+ }
+ else
+ /* No default button, ignore pressing Enter. */
+ dialoginfo.ignore_enter = TRUE;
+
+ /* Show the mouse pointer if it's currently hidden. */
+ gui_mch_mousehide(FALSE);
+
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+
+ /* GTK_RESPONSE_NONE means the dialog was programmatically destroyed. */
+ if (response != GTK_RESPONSE_NONE)
+ {
+ if (textfield != NULL)
+ {
+ text = (char_u *)gtk_entry_get_text(GTK_ENTRY(entry));
+ text = CONVERT_FROM_UTF8(text);
+
+ STRNCPY(textfield, text, IOSIZE);
+ textfield[IOSIZE - 1] = NUL;
+
+ CONVERT_FROM_UTF8_FREE(text);
+ }
+ gtk_widget_destroy(dialog);
+ }
+
+ /* Terrible hack: When the text area still has focus when we remove the
+ * dialog, somehow gvim loses window focus. This is with "point to type"
+ * in the KDE 3.1 window manager. Warp the mouse pointer to outside the
+ * window and back to avoid that. */
+ if (!gui.in_focus)
+ {
+ int x, y;
+
+ gdk_window_get_pointer(gui.drawarea->window, &x, &y, NULL);
+ gui_mch_setmouse(-100, -100);
+ gui_mch_setmouse(x, y);
+ }
+
+ return response > 0 ? response : 0;
+}
+
+#endif /* FEAT_GUI_DIALOG && HAVE_GTK2 */
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+# if defined(FEAT_XIM) && defined(HAVE_GTK2)
+ /*
+ * Append a submenu for selecting an input method. This is
+ * currently the only way to switch input methods at runtime.
+ */
+ if (xic != NULL && g_object_get_data(G_OBJECT(menu->submenu_id),
+ "vim-has-im-menu") == NULL)
+ {
+ GtkWidget *menuitem;
+ GtkWidget *submenu;
+ char_u *name;
+
+ menuitem = gtk_separator_menu_item_new();
+ gtk_widget_show(menuitem);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu->submenu_id), menuitem);
+
+ name = (char_u *)_("Input _Methods");
+ name = CONVERT_TO_UTF8(name);
+ menuitem = gtk_menu_item_new_with_mnemonic((const char *)name);
+ CONVERT_TO_UTF8_FREE(name);
+ gtk_widget_show(menuitem);
+
+ submenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu->submenu_id), menuitem);
+
+ gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(xic),
+ GTK_MENU_SHELL(submenu));
+ g_object_set_data(G_OBJECT(menu->submenu_id),
+ "vim-has-im-menu", GINT_TO_POINTER(TRUE));
+ }
+# endif /* FEAT_XIM && HAVE_GTK2 */
+
+ gtk_menu_popup(GTK_MENU(menu->submenu_id),
+ NULL, NULL,
+ (GtkMenuPositionFunc)NULL, NULL,
+ 3U, (guint32)GDK_CURRENT_TIME);
+}
+
+/*
+ * Menu position callback; used by gui_make_popup() to place the menu
+ * at the current text cursor position.
+ *
+ * Note: The push_in output argument seems to affect scrolling of huge
+ * menus that don't fit on the screen. Leave it at the default for now.
+ */
+/*ARGSUSED0*/
+ static void
+popup_menu_position_func(GtkMenu *menu,
+ gint *x, gint *y,
+# ifdef HAVE_GTK2
+ gboolean *push_in,
+# endif
+ gpointer user_data)
+{
+ if (curwin != NULL && gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
+ gdk_window_get_origin(gui.drawarea->window, x, y);
+
+ /* Find the cursor position in the current window */
+ *x += FILL_X(W_WINCOL(curwin) + curwin->w_wcol + 1) + 1;
+ *y += FILL_Y(W_WINROW(curwin) + curwin->w_wrow + 1) + 1;
+ }
+}
+
+ void
+gui_make_popup(char_u *path_name)
+{
+ vimmenu_T *menu;
+
+ menu = gui_find_menu(path_name);
+
+ if (menu != NULL && menu->submenu_id != NULL)
+ {
+ gtk_menu_popup(GTK_MENU(menu->submenu_id),
+ NULL, NULL,
+ &popup_menu_position_func, NULL,
+ 0U, (guint32)GDK_CURRENT_TIME);
+ }
+}
+
+#endif /* FEAT_MENU */
+
+
+/*
+ * We don't create it twice.
+ */
+
+typedef struct _SharedFindReplace
+{
+ GtkWidget *dialog; /* the main dialog widget */
+ GtkWidget *wword; /* 'Whole word only' check button */
+ GtkWidget *mcase; /* 'Match case' check button */
+ GtkWidget *up; /* search direction 'Up' radio button */
+ GtkWidget *down; /* search direction 'Down' radio button */
+ GtkWidget *what; /* 'Find what' entry text widget */
+ GtkWidget *with; /* 'Replace with' entry text widget */
+ GtkWidget *find; /* 'Find Next' action button */
+ GtkWidget *replace; /* 'Replace With' action button */
+ GtkWidget *all; /* 'Replace All' action button */
+} SharedFindReplace;
+
+static SharedFindReplace find_widgets = { NULL, };
+static SharedFindReplace repl_widgets = { NULL, };
+
+/* ARGSUSED */
+ static int
+find_key_press_event(
+ GtkWidget *widget,
+ GdkEventKey *event,
+ SharedFindReplace *frdp)
+{
+ /* If the user is holding one of the key modifiers we will just bail out,
+ * thus preserving the possibility of normal focus traversal.
+ */
+ if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
+ return FALSE;
+
+ /* the Escape key synthesizes a cancellation action */
+ if (event->keyval == GDK_Escape)
+ {
+ gtk_widget_hide(frdp->dialog);
+
+ return TRUE;
+ }
+ /*
+ * What the **** is this for? Disabled for GTK+ 2 because due to
+ * gtk_signal_connect_after() it doesn't have any effect anyway.
+ * (Fortunately.)
+ */
+#ifndef HAVE_GTK2
+ /* block traversal resulting from those keys */
+ if (event->keyval == GDK_Left
+ || event->keyval == GDK_Right
+ || event->keyval == GDK_space)
+ return TRUE;
+#endif
+
+ /* It would be delightfull if it where possible to do search history
+ * operations on the K_UP and K_DOWN keys here.
+ */
+
+ return FALSE;
+}
+
+#ifdef HAVE_GTK2
+ static GtkWidget *
+create_image_button(const char *stock_id, const char *label)
+{
+ char_u *text;
+ GtkWidget *box;
+ GtkWidget *alignment;
+ GtkWidget *button;
+
+ text = CONVERT_TO_UTF8((char_u *)label);
+
+ box = gtk_hbox_new(FALSE, 3);
+ gtk_box_pack_start(GTK_BOX(box),
+ gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_BUTTON),
+ FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(box),
+ gtk_label_new((const char *)text),
+ FALSE, FALSE, 0);
+
+ CONVERT_TO_UTF8_FREE(text);
+
+ alignment = gtk_alignment_new((float)0.5, (float)0.5,
+ (float)0.0, (float)0.0);
+ gtk_container_add(GTK_CONTAINER(alignment), box);
+ gtk_widget_show_all(alignment);
+
+ button = gtk_button_new();
+ gtk_container_add(GTK_CONTAINER(button), alignment);
+
+ return button;
+}
+
+/*
+ * This is currently only used by find_replace_dialog_create(), and
+ * I'd really like to keep it at that. In other words: don't spread
+ * this nasty hack all over the code. Think twice.
+ */
+ static const char *
+convert_localized_message(char_u **buffer, const char *message)
+{
+ if (output_conv.vc_type == CONV_NONE)
+ return message;
+
+ vim_free(*buffer);
+ *buffer = string_convert(&output_conv, (char_u *)message, NULL);
+
+ return (const char *)*buffer;
+}
+#endif /* HAVE_GTK2 */
+
+ static void
+find_replace_dialog_create(char_u *arg, int do_replace)
+{
+#ifndef HAVE_GTK2
+ GtkWidget *frame;
+#endif
+ GtkWidget *hbox; /* main top down box */
+ GtkWidget *actionarea;
+ GtkWidget *table;
+ GtkWidget *tmp;
+ GtkWidget *vbox;
+ gboolean sensitive;
+ SharedFindReplace *frdp;
+ char_u *entry_text;
+ int wword = FALSE;
+ int mcase = !p_ic;
+#ifdef HAVE_GTK2
+ char_u *conv_buffer = NULL;
+# define CONV(message) convert_localized_message(&conv_buffer, (message))
+#else
+# define CONV(message) (message)
+#endif
+
+ frdp = (do_replace) ? (&repl_widgets) : (&find_widgets);
+
+ /* Get the search string to use. */
+ entry_text = get_find_dialog_text(arg, &wword, &mcase);
+
+#ifdef HAVE_GTK2
+ if (entry_text != NULL && output_conv.vc_type != CONV_NONE)
+ {
+ char_u *old_text = entry_text;
+ entry_text = string_convert(&output_conv, entry_text, NULL);
+ vim_free(old_text);
+ }
+#endif
+
+ /*
+ * If the dialog already exists, just raise it.
+ */
+ if (frdp->dialog)
+ {
+#ifndef HAVE_GTK2
+ /* always make the dialog appear where you want it even if the mainwin
+ * has moved -- dbv */
+ gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
+ GTK_WIDGET(frdp->dialog), VW_POS_MOUSE);
+ gui_gtk_synch_fonts();
+
+ if (!GTK_WIDGET_VISIBLE(frdp->dialog))
+ {
+ gtk_widget_grab_focus(frdp->what);
+ gtk_widget_show(frdp->dialog);
+ }
+#endif
+ if (entry_text != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(frdp->what), (char *)entry_text);
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(frdp->wword),
+ (gboolean)wword);
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(frdp->mcase),
+ (gboolean)mcase);
+ }
+#ifdef HAVE_GTK2
+ gtk_window_present(GTK_WINDOW(frdp->dialog));
+#else
+ gdk_window_raise(frdp->dialog->window);
+#endif
+ vim_free(entry_text);
+ return;
+ }
+
+#ifdef HAVE_GTK2
+ frdp->dialog = gtk_dialog_new();
+ gtk_dialog_set_has_separator(GTK_DIALOG(frdp->dialog), FALSE);
+ gtk_window_set_transient_for(GTK_WINDOW(frdp->dialog), GTK_WINDOW(gui.mainwin));
+ gtk_window_set_destroy_with_parent(GTK_WINDOW(frdp->dialog), TRUE);
+#else
+ frdp->dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+#endif
+
+ if (do_replace)
+ {
+#ifndef HAVE_GTK2
+ gtk_window_set_wmclass(GTK_WINDOW(frdp->dialog), "searchrepl", "gvim");
+#endif
+ gtk_window_set_title(GTK_WINDOW(frdp->dialog),
+ CONV(_("VIM - Search and Replace...")));
+ }
+ else
+ {
+#ifndef HAVE_GTK2
+ gtk_window_set_wmclass(GTK_WINDOW(frdp->dialog), "search", "gvim");
+#endif
+ gtk_window_set_title(GTK_WINDOW(frdp->dialog),
+ CONV(_("VIM - Search...")));
+ }
+
+#ifndef HAVE_GTK2 /* Utter crack. Shudder. */
+ gtk_widget_realize(frdp->dialog);
+ gdk_window_set_decorations(frdp->dialog->window,
+ GDK_DECOR_TITLE | GDK_DECOR_BORDER | GDK_DECOR_RESIZEH);
+ gdk_window_set_functions(frdp->dialog->window,
+ GDK_FUNC_RESIZE | GDK_FUNC_MOVE);
+#endif
+
+#ifndef HAVE_GTK2
+ /* this makes it look better on Motif style window managers */
+ frame = gtk_frame_new(NULL);
+ gtk_container_add(GTK_CONTAINER(frdp->dialog), frame);
+#endif
+
+ hbox = gtk_hbox_new(FALSE, 0);
+#ifdef HAVE_GTK2
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 10);
+ gtk_container_add(GTK_CONTAINER(GTK_DIALOG(frdp->dialog)->vbox), hbox);
+#else
+ gtk_container_add(GTK_CONTAINER(frame), hbox);
+#endif
+
+ if (do_replace)
+ table = gtk_table_new(1024, 4, FALSE);
+ else
+ table = gtk_table_new(1024, 3, FALSE);
+ gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
+ gtk_container_border_width(GTK_CONTAINER(table), 4);
+
+ tmp = gtk_label_new(CONV(_("Find what:")));
+ gtk_misc_set_alignment(GTK_MISC(tmp), (gfloat)0.0, (gfloat)0.5);
+ gtk_table_attach(GTK_TABLE(table), tmp, 0, 1, 0, 1,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+ frdp->what = gtk_entry_new();
+ sensitive = (entry_text != NULL && entry_text[0] != NUL);
+ if (entry_text != NULL)
+ gtk_entry_set_text(GTK_ENTRY(frdp->what), (char *)entry_text);
+ gtk_signal_connect(GTK_OBJECT(frdp->what), "changed",
+ GTK_SIGNAL_FUNC(entry_changed_cb), frdp->dialog);
+ gtk_signal_connect_after(GTK_OBJECT(frdp->what), "key_press_event",
+ GTK_SIGNAL_FUNC(find_key_press_event),
+ (gpointer) frdp);
+ gtk_table_attach(GTK_TABLE(table), frdp->what, 1, 1024, 0, 1,
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND, 2, 2);
+
+ if (do_replace)
+ {
+ tmp = gtk_label_new(CONV(_("Replace with:")));
+ gtk_misc_set_alignment(GTK_MISC(tmp), (gfloat)0.0, (gfloat)0.5);
+ gtk_table_attach(GTK_TABLE(table), tmp, 0, 1, 1, 2,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+ frdp->with = gtk_entry_new();
+ gtk_signal_connect(GTK_OBJECT(frdp->with), "activate",
+ GTK_SIGNAL_FUNC(find_replace_cb),
+ GINT_TO_POINTER(FRD_R_FINDNEXT));
+ gtk_signal_connect_after(GTK_OBJECT(frdp->with), "key_press_event",
+ GTK_SIGNAL_FUNC(find_key_press_event),
+ (gpointer) frdp);
+ gtk_table_attach(GTK_TABLE(table), frdp->with, 1, 1024, 1, 2,
+ GTK_EXPAND | GTK_FILL, GTK_EXPAND, 2, 2);
+
+ /*
+ * Make the entry activation only change the input focus onto the
+ * with item.
+ */
+ gtk_signal_connect(GTK_OBJECT(frdp->what), "activate",
+ GTK_SIGNAL_FUNC(entry_activate_cb), frdp->with);
+ }
+ else
+ {
+ /*
+ * Make the entry activation do the search.
+ */
+ gtk_signal_connect(GTK_OBJECT(frdp->what), "activate",
+ GTK_SIGNAL_FUNC(find_replace_cb),
+ GINT_TO_POINTER(FRD_FINDNEXT));
+ }
+
+ /* whole word only button */
+ frdp->wword = gtk_check_button_new_with_label(CONV(_("Match whole word only")));
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(frdp->wword),
+ (gboolean)wword);
+ if (do_replace)
+ gtk_table_attach(GTK_TABLE(table), frdp->wword, 0, 1023, 2, 3,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+ else
+ gtk_table_attach(GTK_TABLE(table), frdp->wword, 0, 1023, 1, 2,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+
+ /* match case button */
+ frdp->mcase = gtk_check_button_new_with_label(CONV(_("Match case")));
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(frdp->mcase),
+ (gboolean)mcase);
+ if (do_replace)
+ gtk_table_attach(GTK_TABLE(table), frdp->mcase, 0, 1023, 3, 4,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+ else
+ gtk_table_attach(GTK_TABLE(table), frdp->mcase, 0, 1023, 2, 3,
+ GTK_FILL, GTK_EXPAND, 2, 2);
+
+ tmp = gtk_frame_new(CONV(_("Direction")));
+ if (do_replace)
+ gtk_table_attach(GTK_TABLE(table), tmp, 1023, 1024, 2, 4,
+ GTK_FILL, GTK_FILL, 2, 2);
+ else
+ gtk_table_attach(GTK_TABLE(table), tmp, 1023, 1024, 1, 3,
+ GTK_FILL, GTK_FILL, 2, 2);
+ vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_border_width(GTK_CONTAINER(vbox), 0);
+ gtk_container_add(GTK_CONTAINER(tmp), vbox);
+
+ /* 'Up' and 'Down' buttons */
+ frdp->up = gtk_radio_button_new_with_label(NULL, CONV(_("Up")));
+ gtk_box_pack_start(GTK_BOX(vbox), frdp->up, TRUE, TRUE, 0);
+ frdp->down = gtk_radio_button_new_with_label(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(frdp->up)),
+ CONV(_("Down")));
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(frdp->down), TRUE);
+#ifdef HAVE_GTK2
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
+#endif
+ gtk_box_pack_start(GTK_BOX(vbox), frdp->down, TRUE, TRUE, 0);
+
+ /* vbox to hold the action buttons */
+ actionarea = gtk_vbutton_box_new();
+ gtk_container_border_width(GTK_CONTAINER(actionarea), 2);
+#ifndef HAVE_GTK2
+ if (do_replace)
+ {
+ gtk_button_box_set_layout(GTK_BUTTON_BOX(actionarea),
+ GTK_BUTTONBOX_END);
+ gtk_button_box_set_spacing(GTK_BUTTON_BOX(actionarea), 0);
+ }
+#endif
+ gtk_box_pack_end(GTK_BOX(hbox), actionarea, FALSE, FALSE, 0);
+
+ /* 'Find Next' button */
+#ifdef HAVE_GTK2
+ frdp->find = create_image_button(GTK_STOCK_FIND, _("Find Next"));
+#else
+ frdp->find = gtk_button_new_with_label(_("Find Next"));
+#endif
+ gtk_widget_set_sensitive(frdp->find, sensitive);
+
+ gtk_signal_connect(GTK_OBJECT(frdp->find), "clicked",
+ GTK_SIGNAL_FUNC(find_replace_cb),
+ (do_replace) ? GINT_TO_POINTER(FRD_R_FINDNEXT)
+ : GINT_TO_POINTER(FRD_FINDNEXT));
+
+ GTK_WIDGET_SET_FLAGS(frdp->find, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(actionarea), frdp->find, FALSE, FALSE, 0);
+ gtk_widget_grab_default(frdp->find);
+
+ if (do_replace)
+ {
+ /* 'Replace' button */
+#ifdef HAVE_GTK2
+ frdp->replace = create_image_button(GTK_STOCK_CONVERT, _("Replace"));
+#else
+ frdp->replace = gtk_button_new_with_label(_("Replace"));
+#endif
+ gtk_widget_set_sensitive(frdp->replace, sensitive);
+ GTK_WIDGET_SET_FLAGS(frdp->replace, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(actionarea), frdp->replace, FALSE, FALSE, 0);
+ gtk_signal_connect(GTK_OBJECT(frdp->replace), "clicked",
+ GTK_SIGNAL_FUNC(find_replace_cb),
+ GINT_TO_POINTER(FRD_REPLACE));
+
+ /* 'Replace All' button */
+#ifdef HAVE_GTK2
+ frdp->all = create_image_button(GTK_STOCK_CONVERT, _("Replace All"));
+#else
+ frdp->all = gtk_button_new_with_label(_("Replace All"));
+#endif
+ gtk_widget_set_sensitive(frdp->all, sensitive);
+ GTK_WIDGET_SET_FLAGS(frdp->all, GTK_CAN_DEFAULT);
+ gtk_box_pack_start(GTK_BOX(actionarea), frdp->all, FALSE, FALSE, 0);
+ gtk_signal_connect(GTK_OBJECT(frdp->all), "clicked",
+ GTK_SIGNAL_FUNC(find_replace_cb),
+ GINT_TO_POINTER(FRD_REPLACEALL));
+ }
+
+ /* 'Cancel' button */
+#ifdef HAVE_GTK2
+ tmp = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+#else
+ tmp = gtk_button_new_with_label(_("Cancel"));
+#endif
+ GTK_WIDGET_SET_FLAGS(tmp, GTK_CAN_DEFAULT);
+ gtk_box_pack_end(GTK_BOX(actionarea), tmp, FALSE, FALSE, 0);
+ gtk_signal_connect_object(GTK_OBJECT(tmp),
+ "clicked", GTK_SIGNAL_FUNC(gtk_widget_hide),
+ GTK_OBJECT(frdp->dialog));
+ gtk_signal_connect_object(GTK_OBJECT(frdp->dialog),
+ "delete_event", GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
+ GTK_OBJECT(frdp->dialog));
+
+ tmp = gtk_vseparator_new();
+#ifdef HAVE_GTK2
+ gtk_box_pack_end(GTK_BOX(hbox), tmp, FALSE, FALSE, 10);
+#else
+ gtk_box_pack_end(GTK_BOX(hbox), tmp, FALSE, TRUE, 0);
+#endif
+
+#ifndef HAVE_GTK2
+ gtk_widget_grab_focus(frdp->what);
+
+ /* show the frame and realize the frdp->dialog this gives us a window size
+ * request that we'll use to position the window within the boundary of
+ * the mainwin --dbv */
+ gtk_widget_show_all(frame);
+ gui_gtk_position_in_parent(GTK_WIDGET(gui.mainwin),
+ GTK_WIDGET(frdp->dialog), VW_POS_MOUSE);
+ gui_gtk_synch_fonts();
+ gtk_widget_show_all(frdp->dialog);
+#endif
+
+#ifdef HAVE_GTK2
+ /* Suppress automatic show of the unused action area */
+ gtk_widget_hide(GTK_DIALOG(frdp->dialog)->action_area);
+ gtk_widget_show_all(hbox);
+ gtk_widget_show(frdp->dialog);
+#endif
+
+ vim_free(entry_text);
+#ifdef HAVE_GTK2
+ vim_free(conv_buffer);
+#endif
+#undef CONV
+}
+
+ void
+gui_mch_find_dialog(exarg_T *eap)
+{
+ if (gui.in_use)
+ find_replace_dialog_create(eap->arg, FALSE);
+}
+
+ void
+gui_mch_replace_dialog(exarg_T *eap)
+{
+ if (gui.in_use)
+ find_replace_dialog_create(eap->arg, TRUE);
+}
+
+
+#if !defined(HAVE_GTK2) || defined(PROTO)
+/*
+ * Synchronize all gui elements, which are dependant upon the
+ * main text font used. Those are in esp. the find/replace dialogs.
+ * If you don't understand why this should be needed, please try to
+ * search for "pięść" in iso8859-2.
+ *
+ * (<danielk> I converted the comment above to UTF-8 to put
+ * a stopper to the encoding mess. Forgive me :)
+ *
+ * Obsolete with GTK2.
+ */
+ void
+gui_gtk_synch_fonts(void)
+{
+ SharedFindReplace *frdp;
+ int do_replace;
+
+ /* OK this loop is a bit tricky... */
+ for (do_replace = 0; do_replace <= 1; ++do_replace)
+ {
+ frdp = (do_replace) ? (&repl_widgets) : (&find_widgets);
+ if (frdp->dialog)
+ {
+ GtkStyle *style;
+
+ /* synch the font with whats used by the text itself */
+ style = gtk_style_copy(gtk_widget_get_style(frdp->what));
+ gdk_font_unref(style->font);
+# ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ style->font = gui.fontset;
+ else
+# endif
+ style->font = gui.norm_font;
+ gdk_font_ref(style->font);
+ gtk_widget_set_style(frdp->what, style);
+ gtk_style_unref(style);
+ if (do_replace)
+ {
+ style = gtk_style_copy(gtk_widget_get_style(frdp->with));
+ gdk_font_unref(style->font);
+# ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ style->font = gui.fontset;
+ else
+# endif
+ style->font = gui.norm_font;
+ gdk_font_ref(style->font);
+ gtk_widget_set_style(frdp->with, style);
+ gtk_style_unref(style);
+ }
+ }
+ }
+}
+#endif /* !HAVE_GTK2 */
+
+
+/*
+ * Callback for actions of the find and replace dialogs
+ */
+/*ARGSUSED*/
+ static void
+find_replace_cb(GtkWidget *widget, gpointer data)
+{
+ int flags;
+ char_u *find_text;
+ char_u *repl_text;
+ gboolean direction_down;
+ SharedFindReplace *sfr;
+ int rc;
+
+ flags = (int)(long)data; /* avoid a lint warning here */
+
+ /* Get the search/replace strings from the dialog */
+ if (flags == FRD_FINDNEXT)
+ {
+ repl_text = NULL;
+ sfr = &find_widgets;
+ }
+ else
+ {
+ repl_text = (char_u *)gtk_entry_get_text(GTK_ENTRY(repl_widgets.with));
+ sfr = &repl_widgets;
+ }
+
+ find_text = (char_u *)gtk_entry_get_text(GTK_ENTRY(sfr->what));
+ direction_down = GTK_TOGGLE_BUTTON(sfr->down)->active;
+
+ if (GTK_TOGGLE_BUTTON(sfr->wword)->active)
+ flags |= FRD_WHOLE_WORD;
+ if (GTK_TOGGLE_BUTTON(sfr->mcase)->active)
+ flags |= FRD_MATCH_CASE;
+
+#ifdef HAVE_GTK2
+ repl_text = CONVERT_FROM_UTF8(repl_text);
+ find_text = CONVERT_FROM_UTF8(find_text);
+#endif
+ rc = gui_do_findrepl(flags, find_text, repl_text, direction_down);
+#ifdef HAVE_GTK2
+ CONVERT_FROM_UTF8_FREE(repl_text);
+ CONVERT_FROM_UTF8_FREE(find_text);
+#endif
+
+ if (rc && gtk_main_level() > 0)
+ gtk_main_quit(); /* make sure cmd will be handled immediately */
+}
+
+/* our usual callback function */
+/*ARGSUSED*/
+ static void
+entry_activate_cb(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_grab_focus(GTK_WIDGET(data));
+}
+
+/*
+ * Syncing the find/replace dialogs on the fly is utterly useless crack,
+ * and causes nothing but problems. Please tell me a use case for which
+ * you'd need both a find dialog and a find/replace one at the same time,
+ * without being able to actually use them separately since they're syncing
+ * all the time. I don't think it's worthwhile to fix this nonsense,
+ * particularly evil incarnation of braindeadness, whatever; I'd much rather
+ * see it extinguished from this planet. Thanks for listening. Sorry.
+ */
+ static void
+entry_changed_cb(GtkWidget * entry, GtkWidget * dialog)
+{
+ const gchar *entry_text;
+ gboolean nonempty;
+
+ entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
+
+ if (!entry_text)
+ return; /* shouldn't happen */
+
+ nonempty = (entry_text[0] != '\0');
+
+ if (dialog == find_widgets.dialog)
+ {
+ gtk_widget_set_sensitive(find_widgets.find, nonempty);
+ }
+
+ if (dialog == repl_widgets.dialog)
+ {
+ gtk_widget_set_sensitive(repl_widgets.find, nonempty);
+ gtk_widget_set_sensitive(repl_widgets.replace, nonempty);
+ gtk_widget_set_sensitive(repl_widgets.all, nonempty);
+ }
+}
+
+/*
+ * ":helpfind"
+ */
+/*ARGSUSED*/
+ void
+ex_helpfind(eap)
+ exarg_T *eap;
+{
+ /* This will fail when menus are not loaded. Well, it's only for
+ * backwards compatibility anyway. */
+ do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
+}
+
+#if !defined(HAVE_GTK2) || defined(PROTO) /* Crack crack crack. Brrrr. */
+
+/* gui_gtk_position_in_parent
+ *
+ * this function causes a child window to be placed within the boundary of
+ * the parent (mainwin) window.
+ *
+ * you can specify where the window will be positioned by the third argument
+ * (defined in gui.h):
+ * VW_POS_CENTER at center of parent window
+ * VW_POS_MOUSE center of child at mouse position
+ * VW_POS_TOP_CENTER top of child at top of parent centered
+ * horizontally about the mouse.
+ *
+ * NOTE: for this function to act as desired the child window must have a
+ * window size requested. this can be accomplished by packing/placing
+ * child widgets onto a gtk_frame widget rather than the gtk_window
+ * widget...
+ *
+ * brent -- dbv
+ */
+ void
+gui_gtk_position_in_parent(
+ GtkWidget *parent,
+ GtkWidget *child,
+ gui_win_pos_T where)
+{
+ GtkRequisition c_size;
+ gint xPm, yPm;
+ gint xP, yP, wP, hP, pos_x, pos_y;
+
+ /* make sure the child widget is set up then get its size. */
+ gtk_widget_size_request(child, &c_size);
+
+ /* get origin and size of parent window */
+ gdk_window_get_origin((GdkWindow *)(parent->window), &xP, &yP);
+ gdk_window_get_size((GdkWindow *)(parent->window), &wP, &hP);
+
+ if (c_size.width > wP || c_size.height > hP)
+ {
+ /* doh! maybe the user should consider giving gVim a little more
+ * screen real estate */
+ gtk_widget_set_uposition(child , xP + 2 , yP + 2);
+ return;
+ }
+
+ if (where == VW_POS_MOUSE)
+ {
+ /* position window at mouse pointer */
+ gtk_widget_get_pointer(parent, &xPm, &yPm);
+ pos_x = xP + xPm - (c_size.width) / 2;
+ pos_y = yP + yPm - (c_size.height) / 2;
+ }
+ else
+ {
+ /* set child x origin so it is in center of Vim window */
+ pos_x = xP + (wP - c_size.width) / 2;
+
+ if (where == VW_POS_TOP_CENTER)
+ pos_y = yP + 2;
+ else
+ /* where == VW_POS_CENTER */
+ pos_y = yP + (hP - c_size.height) / 2;
+ }
+
+ /* now, make sure the window will be inside the Vim window... */
+ if (pos_x < xP)
+ pos_x = xP + 2;
+ if (pos_y < yP)
+ pos_y = yP + 2;
+ if ((pos_x + c_size.width) > (wP + xP))
+ pos_x = xP + wP - c_size.width - 2;
+ /* Assume 'guiheadroom' indicates the title bar height... */
+ if ((pos_y + c_size.height + p_ghr / 2) > (hP + yP))
+ pos_y = yP + hP - c_size.height - 2 - p_ghr / 2;
+
+ gtk_widget_set_uposition(child, pos_x, pos_y);
+}
+
+#endif /* !HAVE_GTK2 */
+
diff --git a/src/gui_gtk_f.c b/src/gui_gtk_f.c
new file mode 100644
index 000000000..2cb82d646
--- /dev/null
+++ b/src/gui_gtk_f.c
@@ -0,0 +1,942 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * (C) 1998,1999 by Marcin Dalecki <dalecki@cs.net.pl>
+ *
+ * "I'm a one-man software company. If you have anything UNIX, net or
+ * embedded systems related, which seems to cause some serious trouble for
+ * your's in-house developers, maybe we need to talk badly with each other
+ * :-) <dalecki@cs.net.pl> (My native language is polish and I speak
+ * native grade german too. I'm living in Göttingen.de.)
+ * --mdcki"
+ *
+ * Support for GTK+ 2 was added by:
+ *
+ * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
+ * Daniel Elstner <daniel.elstner@gmx.net>
+ *
+ * This is a special purspose container widget, which manages arbitrary childs
+ * at arbitrary positions width arbitrary sizes. This finally puts an end on
+ * our resizement problems with which we where struggling for such a long time.
+ */
+
+#include "vim.h"
+#include <gtk/gtk.h> /* without this it compiles, but gives errors at
+ runtime! */
+#include "gui_gtk_f.h"
+#include <gtk/gtksignal.h>
+#ifdef WIN3264
+# include <gdk/gdkwin32.h>
+#else
+# include <gdk/gdkx.h>
+#endif
+
+typedef struct _GtkFormChild GtkFormChild;
+
+struct _GtkFormChild
+{
+ GtkWidget *widget;
+ GdkWindow *window;
+ gint x; /* relative subwidget x position */
+ gint y; /* relative subwidget y position */
+ gint mapped;
+};
+
+
+static void gtk_form_class_init(GtkFormClass *klass);
+static void gtk_form_init(GtkForm *form);
+
+static void gtk_form_realize(GtkWidget *widget);
+static void gtk_form_unrealize(GtkWidget *widget);
+static void gtk_form_map(GtkWidget *widget);
+static void gtk_form_size_request(GtkWidget *widget,
+ GtkRequisition *requisition);
+static void gtk_form_size_allocate(GtkWidget *widget,
+ GtkAllocation *allocation);
+#ifndef HAVE_GTK2 /* this isn't needed in gtk2 */
+static void gtk_form_draw(GtkWidget *widget,
+ GdkRectangle *area);
+#endif
+static gint gtk_form_expose(GtkWidget *widget,
+ GdkEventExpose *event);
+
+static void gtk_form_remove(GtkContainer *container,
+ GtkWidget *widget);
+static void gtk_form_forall(GtkContainer *container,
+ gboolean include_internals,
+ GtkCallback callback,
+ gpointer callback_data);
+
+static void gtk_form_attach_child_window(GtkForm *form,
+ GtkFormChild *child);
+static void gtk_form_realize_child(GtkForm *form,
+ GtkFormChild *child);
+static void gtk_form_position_child(GtkForm *form,
+ GtkFormChild *child,
+ gboolean force_allocate);
+static void gtk_form_position_children(GtkForm *form);
+
+static GdkFilterReturn gtk_form_filter(GdkXEvent *gdk_xevent,
+ GdkEvent *event,
+ gpointer data);
+static GdkFilterReturn gtk_form_main_filter(GdkXEvent *gdk_xevent,
+ GdkEvent *event,
+ gpointer data);
+
+static void gtk_form_set_static_gravity(GdkWindow *window,
+ gboolean use_static);
+
+static void gtk_form_send_configure(GtkForm *form);
+
+static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
+static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data);
+
+static GtkWidgetClass *parent_class = NULL;
+
+/* Public interface
+ */
+
+ GtkWidget *
+gtk_form_new(void)
+{
+ GtkForm *form;
+
+ form = gtk_type_new(gtk_form_get_type());
+
+ return GTK_WIDGET(form);
+}
+
+ void
+gtk_form_put(GtkForm *form,
+ GtkWidget *child_widget,
+ gint x,
+ gint y)
+{
+ GtkFormChild *child;
+
+ g_return_if_fail(GTK_IS_FORM(form));
+
+ child = g_new(GtkFormChild, 1);
+
+ child->widget = child_widget;
+ child->window = NULL;
+ child->x = x;
+ child->y = y;
+ child->widget->requisition.width = 0;
+ child->widget->requisition.height = 0;
+ child->mapped = FALSE;
+
+ form->children = g_list_append(form->children, child);
+
+ /* child->window must be created and attached to the widget _before_
+ * it has been realized, or else things will break with GTK2. Note
+ * that gtk_widget_set_parent() realizes the widget if it's visible
+ * and its parent is mapped.
+ */
+ if (GTK_WIDGET_REALIZED(form))
+ gtk_form_attach_child_window(form, child);
+
+ gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
+ gtk_widget_size_request(child->widget, NULL);
+
+ if (GTK_WIDGET_REALIZED(form) && !GTK_WIDGET_REALIZED(child_widget))
+ gtk_form_realize_child(form, child);
+
+ gtk_form_position_child(form, child, TRUE);
+}
+
+ void
+gtk_form_move(GtkForm *form,
+ GtkWidget *child_widget,
+ gint x,
+ gint y)
+{
+ GList *tmp_list;
+ GtkFormChild *child;
+
+ g_return_if_fail(GTK_IS_FORM(form));
+
+ for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
+ {
+ child = tmp_list->data;
+ if (child->widget == child_widget)
+ {
+ child->x = x;
+ child->y = y;
+
+ gtk_form_position_child(form, child, TRUE);
+ return;
+ }
+ }
+}
+
+ void
+gtk_form_set_size(GtkForm *form, guint width, guint height)
+{
+ g_return_if_fail(GTK_IS_FORM(form));
+
+ /* prevent unneccessary calls */
+ if (form->width == width && form->height == height)
+ return;
+ form->width = width;
+ form->height = height;
+
+ /* signal the change */
+#ifdef HAVE_GTK2
+ gtk_widget_queue_resize(gtk_widget_get_parent(GTK_WIDGET(form)));
+#else
+ gtk_container_queue_resize(GTK_CONTAINER(GTK_WIDGET(form)->parent));
+#endif
+}
+
+ void
+gtk_form_freeze(GtkForm *form)
+{
+ g_return_if_fail(GTK_IS_FORM(form));
+
+ ++form->freeze_count;
+}
+
+ void
+gtk_form_thaw(GtkForm *form)
+{
+ g_return_if_fail(GTK_IS_FORM(form));
+
+ if (form->freeze_count)
+ {
+ if (!(--form->freeze_count))
+ {
+ gtk_form_position_children(form);
+#ifdef HAVE_GTK2
+ gtk_widget_queue_draw(GTK_WIDGET(form));
+#else
+ gtk_widget_draw(GTK_WIDGET(form), NULL);
+#endif
+ }
+ }
+}
+
+/* Basic Object handling procedures
+ */
+ GtkType
+gtk_form_get_type(void)
+{
+ static GtkType form_type = 0;
+
+ if (!form_type)
+ {
+ GtkTypeInfo form_info =
+ {
+ "GtkForm",
+ sizeof(GtkForm),
+ sizeof(GtkFormClass),
+ (GtkClassInitFunc) gtk_form_class_init,
+ (GtkObjectInitFunc) gtk_form_init
+ };
+
+ form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
+ }
+ return form_type;
+}
+
+ static void
+gtk_form_class_init(GtkFormClass *klass)
+{
+ GtkWidgetClass *widget_class;
+ GtkContainerClass *container_class;
+
+ widget_class = (GtkWidgetClass *) klass;
+ container_class = (GtkContainerClass *) klass;
+
+ parent_class = gtk_type_class(gtk_container_get_type());
+
+ widget_class->realize = gtk_form_realize;
+ widget_class->unrealize = gtk_form_unrealize;
+ widget_class->map = gtk_form_map;
+ widget_class->size_request = gtk_form_size_request;
+ widget_class->size_allocate = gtk_form_size_allocate;
+#ifndef HAVE_GTK2 /* not needed for GTK2 */
+ widget_class->draw = gtk_form_draw;
+#endif
+ widget_class->expose_event = gtk_form_expose;
+
+ container_class->remove = gtk_form_remove;
+ container_class->forall = gtk_form_forall;
+}
+
+ static void
+gtk_form_init(GtkForm *form)
+{
+ form->children = NULL;
+
+ form->width = 1;
+ form->height = 1;
+
+ form->bin_window = NULL;
+
+ form->configure_serial = 0;
+ form->visibility = GDK_VISIBILITY_PARTIAL;
+
+ form->freeze_count = 0;
+}
+
+/*
+ * Widget methods
+ */
+
+ static void
+gtk_form_realize(GtkWidget *widget)
+{
+ GList *tmp_list;
+ GtkForm *form;
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ form = GTK_FORM(widget);
+ GTK_WIDGET_SET_FLAGS(form, GTK_REALIZED);
+
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.x = widget->allocation.x;
+ attributes.y = widget->allocation.y;
+ attributes.width = widget->allocation.width;
+ attributes.height = widget->allocation.height;
+ attributes.wclass = GDK_INPUT_OUTPUT;
+ attributes.visual = gtk_widget_get_visual(widget);
+ attributes.colormap = gtk_widget_get_colormap(widget);
+ attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
+
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+
+ widget->window = gdk_window_new(gtk_widget_get_parent_window(widget),
+ &attributes, attributes_mask);
+ gdk_window_set_user_data(widget->window, widget);
+
+ attributes.x = 0;
+ attributes.y = 0;
+ attributes.event_mask = gtk_widget_get_events(widget);
+
+ form->bin_window = gdk_window_new(widget->window,
+ &attributes, attributes_mask);
+ gdk_window_set_user_data(form->bin_window, widget);
+
+ gtk_form_set_static_gravity(form->bin_window, TRUE);
+
+ widget->style = gtk_style_attach(widget->style, widget->window);
+ gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
+ gtk_style_set_background(widget->style, form->bin_window, GTK_STATE_NORMAL);
+
+ gdk_window_add_filter(widget->window, gtk_form_main_filter, form);
+ gdk_window_add_filter(form->bin_window, gtk_form_filter, form);
+
+ for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
+ {
+ GtkFormChild *child = tmp_list->data;
+
+ gtk_form_attach_child_window(form, child);
+
+ if (GTK_WIDGET_VISIBLE(child->widget))
+ gtk_form_realize_child(form, child);
+ }
+}
+
+
+/* After reading the documentation at
+ * http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
+ * I think it should be possible to remove this function when compiling
+ * against gtk-2.0. It doesn't seem to cause problems, though.
+ *
+ * Well, I reckon at least the gdk_window_show(form->bin_window)
+ * is necessary. GtkForm is anything but a usual container widget.
+ */
+ static void
+gtk_form_map(GtkWidget *widget)
+{
+ GList *tmp_list;
+ GtkForm *form;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ form = GTK_FORM(widget);
+
+ GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED);
+
+ gdk_window_show(widget->window);
+ gdk_window_show(form->bin_window);
+
+ for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
+ {
+ GtkFormChild *child = tmp_list->data;
+
+ if (GTK_WIDGET_VISIBLE(child->widget)
+ && !GTK_WIDGET_MAPPED(child->widget))
+ gtk_widget_map(child->widget);
+ }
+}
+
+ static void
+gtk_form_unrealize(GtkWidget *widget)
+{
+ GList *tmp_list;
+ GtkForm *form;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ form = GTK_FORM(widget);
+
+ tmp_list = form->children;
+
+ gdk_window_set_user_data(form->bin_window, NULL);
+ gdk_window_destroy(form->bin_window);
+ form->bin_window = NULL;
+
+ while (tmp_list)
+ {
+ GtkFormChild *child = tmp_list->data;
+
+ if (child->window != NULL)
+ {
+ gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
+ GTK_SIGNAL_FUNC(gtk_form_child_map),
+ child);
+ gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
+ GTK_SIGNAL_FUNC(gtk_form_child_unmap),
+ child);
+
+ gdk_window_set_user_data(child->window, NULL);
+ gdk_window_destroy(child->window);
+
+ child->window = NULL;
+ }
+
+ tmp_list = tmp_list->next;
+ }
+
+ if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+ (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
+}
+
+#ifndef HAVE_GTK2
+ static void
+gtk_form_draw(GtkWidget *widget, GdkRectangle *area)
+{
+ GtkForm *form;
+ GList *children;
+ GtkFormChild *child;
+ GdkRectangle child_area;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ if (GTK_WIDGET_DRAWABLE(widget))
+ {
+ form = GTK_FORM(widget);
+
+ children = form->children;
+
+ while (children)
+ {
+ child = children->data;
+
+ if (GTK_WIDGET_DRAWABLE(child->widget)
+ && gtk_widget_intersect(child->widget, area, &child_area))
+ gtk_widget_draw(child->widget, &child_area);
+
+ children = children->next;
+ }
+ }
+}
+#endif /* !HAVE_GTK2 */
+
+ static void
+gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
+{
+ GList *tmp_list;
+ GtkForm *form;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ form = GTK_FORM(widget);
+
+ requisition->width = form->width;
+ requisition->height = form->height;
+
+ tmp_list = form->children;
+
+ while (tmp_list)
+ {
+ GtkFormChild *child = tmp_list->data;
+ gtk_widget_size_request(child->widget, NULL);
+ tmp_list = tmp_list->next;
+ }
+}
+
+ static void
+gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
+{
+ GList *tmp_list;
+ GtkForm *form;
+ gboolean need_reposition;
+
+ g_return_if_fail(GTK_IS_FORM(widget));
+
+ if (widget->allocation.x == allocation->x
+ && widget->allocation.y == allocation->y
+ && widget->allocation.width == allocation->width
+ && widget->allocation.height == allocation->height)
+ return;
+
+ need_reposition = widget->allocation.width != allocation->width
+ || widget->allocation.height != allocation->height;
+ form = GTK_FORM(widget);
+
+ if (need_reposition)
+ {
+ tmp_list = form->children;
+
+ while (tmp_list)
+ {
+ GtkFormChild *child = tmp_list->data;
+ gtk_form_position_child(form, child, TRUE);
+
+ tmp_list = tmp_list->next;
+ }
+ }
+
+ if (GTK_WIDGET_REALIZED(widget))
+ {
+ gdk_window_move_resize(widget->window,
+ allocation->x, allocation->y,
+ allocation->width, allocation->height);
+ gdk_window_move_resize(GTK_FORM(widget)->bin_window,
+ 0, 0,
+ allocation->width, allocation->height);
+ }
+ widget->allocation = *allocation;
+ if (need_reposition)
+ gtk_form_send_configure(form);
+}
+
+ static gint
+gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
+{
+ GList *tmp_list;
+ GtkForm *form;
+
+ g_return_val_if_fail(GTK_IS_FORM(widget), FALSE);
+
+ form = GTK_FORM(widget);
+
+ if (event->window == form->bin_window)
+ return FALSE;
+
+ for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
+ {
+#ifdef HAVE_GTK2
+ GtkFormChild *formchild = tmp_list->data;
+ GtkWidget *child = formchild->widget;
+ /*
+ * The following chunk of code is taken from gtkcontainer.c. The
+ * gtk1.x code synthesized expose events directly on the child widgets,
+ * which can't be done in gtk2
+ */
+ if (GTK_WIDGET_DRAWABLE(child) && GTK_WIDGET_NO_WINDOW(child)
+ && child->window == event->window)
+ {
+ GdkEventExpose child_event;
+ child_event = *event;
+
+ child_event.region = gtk_widget_region_intersect(child, event->region);
+ if (!gdk_region_empty(child_event.region))
+ {
+ gdk_region_get_clipbox(child_event.region, &child_event.area);
+ gtk_widget_send_expose(child, (GdkEvent *)&child_event);
+ }
+ }
+#else /* !HAVE_GTK2 */
+ GtkFormChild *child = tmp_list->data;
+
+ if (event->window == child->window)
+ return gtk_widget_event(child->widget, (GdkEvent *) event);
+#endif /* !HAVE_GTK2 */
+ }
+
+ return FALSE;
+}
+
+/* Container method
+ */
+ static void
+gtk_form_remove(GtkContainer *container, GtkWidget *widget)
+{
+ GList *tmp_list;
+ GtkForm *form;
+ GtkFormChild *child = NULL; /* init for gcc */
+
+ g_return_if_fail(GTK_IS_FORM(container));
+
+ form = GTK_FORM(container);
+
+ tmp_list = form->children;
+ while (tmp_list)
+ {
+ child = tmp_list->data;
+ if (child->widget == widget)
+ break;
+ tmp_list = tmp_list->next;
+ }
+
+ if (tmp_list)
+ {
+ if (child->window)
+ {
+ gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
+ GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
+ gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
+ GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
+
+ /* FIXME: This will cause problems for reparenting NO_WINDOW
+ * widgets out of a GtkForm
+ */
+ gdk_window_set_user_data(child->window, NULL);
+ gdk_window_destroy(child->window);
+ }
+ gtk_widget_unparent(widget);
+
+ form->children = g_list_remove_link(form->children, tmp_list);
+ g_list_free_1(tmp_list);
+ g_free(child);
+ }
+}
+
+/*ARGSUSED1*/
+ static void
+gtk_form_forall(GtkContainer *container,
+ gboolean include_internals,
+ GtkCallback callback,
+ gpointer callback_data)
+{
+ GtkForm *form;
+ GtkFormChild *child;
+ GList *tmp_list;
+
+ g_return_if_fail(GTK_IS_FORM(container));
+ g_return_if_fail(callback != NULL);
+
+ form = GTK_FORM(container);
+
+ tmp_list = form->children;
+ while (tmp_list)
+ {
+ child = tmp_list->data;
+ tmp_list = tmp_list->next;
+
+ (*callback) (child->widget, callback_data);
+ }
+}
+
+/* Operations on children
+ */
+
+ static void
+gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
+{
+ if (child->window != NULL)
+ return; /* been there, done that */
+
+ if (GTK_WIDGET_NO_WINDOW(child->widget))
+ {
+ GtkWidget *widget;
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ widget = GTK_WIDGET(form);
+
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.x = child->x;
+ attributes.y = child->y;
+ attributes.width = child->widget->requisition.width;
+ attributes.height = child->widget->requisition.height;
+ attributes.wclass = GDK_INPUT_OUTPUT;
+ attributes.visual = gtk_widget_get_visual(widget);
+ attributes.colormap = gtk_widget_get_colormap(widget);
+ attributes.event_mask = GDK_EXPOSURE_MASK;
+
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+ child->window = gdk_window_new(form->bin_window,
+ &attributes, attributes_mask);
+ gdk_window_set_user_data(child->window, widget);
+
+ gtk_style_set_background(widget->style,
+ child->window,
+ GTK_STATE_NORMAL);
+
+ gtk_widget_set_parent_window(child->widget, child->window);
+ gtk_form_set_static_gravity(child->window, TRUE);
+ /*
+ * Install signal handlers to map/unmap child->window
+ * alongside with the actual widget.
+ */
+ gtk_signal_connect(GTK_OBJECT(child->widget), "map",
+ GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
+ gtk_signal_connect(GTK_OBJECT(child->widget), "unmap",
+ GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
+ }
+ else if (!GTK_WIDGET_REALIZED(child->widget))
+ {
+ gtk_widget_set_parent_window(child->widget, form->bin_window);
+ }
+}
+
+ static void
+gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
+{
+ gtk_form_attach_child_window(form, child);
+ gtk_widget_realize(child->widget);
+
+ if (child->window == NULL) /* might be already set, see above */
+ gtk_form_set_static_gravity(child->widget->window, TRUE);
+}
+
+ static void
+gtk_form_position_child(GtkForm *form, GtkFormChild *child,
+ gboolean force_allocate)
+{
+ gint x;
+ gint y;
+
+ x = child->x;
+ y = child->y;
+
+ if ((x >= G_MINSHORT) && (x <= G_MAXSHORT) &&
+ (y >= G_MINSHORT) && (y <= G_MAXSHORT))
+ {
+ if (!child->mapped)
+ {
+ if (GTK_WIDGET_MAPPED(form) && GTK_WIDGET_VISIBLE(child->widget))
+ {
+ if (!GTK_WIDGET_MAPPED(child->widget))
+ gtk_widget_map(child->widget);
+
+ child->mapped = TRUE;
+ force_allocate = TRUE;
+ }
+ }
+
+ if (force_allocate)
+ {
+ GtkAllocation allocation;
+
+ if (GTK_WIDGET_NO_WINDOW(child->widget))
+ {
+ if (child->window)
+ {
+ gdk_window_move_resize(child->window,
+ x, y,
+ child->widget->requisition.width,
+ child->widget->requisition.height);
+ }
+
+ allocation.x = 0;
+ allocation.y = 0;
+ }
+ else
+ {
+ allocation.x = x;
+ allocation.y = y;
+ }
+
+ allocation.width = child->widget->requisition.width;
+ allocation.height = child->widget->requisition.height;
+
+ gtk_widget_size_allocate(child->widget, &allocation);
+ }
+ }
+ else
+ {
+ if (child->mapped)
+ {
+ child->mapped = FALSE;
+
+ if (GTK_WIDGET_MAPPED(child->widget))
+ gtk_widget_unmap(child->widget);
+ }
+ }
+}
+
+ static void
+gtk_form_position_children(GtkForm *form)
+{
+ GList *tmp_list;
+
+ for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
+ gtk_form_position_child(form, tmp_list->data, FALSE);
+}
+
+/* Callbacks */
+
+/* The main event filter. Actually, we probably don't really need
+ * to install this as a filter at all, since we are calling it
+ * directly above in the expose-handling hack.
+ *
+ * This routine identifies expose events that are generated when
+ * we've temporarily moved the bin_window_origin, and translates
+ * them or discards them, depending on whether we are obscured
+ * or not.
+ */
+/*ARGSUSED1*/
+ static GdkFilterReturn
+gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
+{
+ XEvent *xevent;
+ GtkForm *form;
+
+ xevent = (XEvent *) gdk_xevent;
+ form = GTK_FORM(data);
+
+ switch (xevent->type)
+ {
+ case Expose:
+ if (xevent->xexpose.serial == form->configure_serial)
+ {
+ if (form->visibility == GDK_VISIBILITY_UNOBSCURED)
+ return GDK_FILTER_REMOVE;
+ else
+ break;
+ }
+ break;
+
+ case ConfigureNotify:
+ if ((xevent->xconfigure.x != 0) || (xevent->xconfigure.y != 0))
+ form->configure_serial = xevent->xconfigure.serial;
+ break;
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
+ * there is no corresponding event in GTK, so we have
+ * to get the events from a filter
+ */
+/*ARGSUSED1*/
+ static GdkFilterReturn
+gtk_form_main_filter(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
+{
+ XEvent *xevent;
+ GtkForm *form;
+
+ xevent = (XEvent *) gdk_xevent;
+ form = GTK_FORM(data);
+
+ if (xevent->type == VisibilityNotify)
+ {
+ switch (xevent->xvisibility.state)
+ {
+ case VisibilityFullyObscured:
+ form->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
+ break;
+
+ case VisibilityPartiallyObscured:
+ form->visibility = GDK_VISIBILITY_PARTIAL;
+ break;
+
+ case VisibilityUnobscured:
+ form->visibility = GDK_VISIBILITY_UNOBSCURED;
+ break;
+ }
+
+ return GDK_FILTER_REMOVE;
+ }
+ return GDK_FILTER_CONTINUE;
+}
+
+/* Routines to set the window gravity, and check whether it is
+ * functional. Extra capabilities need to be added to GDK, so
+ * we don't have to use Xlib here.
+ */
+ static void
+gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
+{
+#ifdef HAVE_GTK2
+ gboolean static_gravity_supported;
+
+ static_gravity_supported = gdk_window_set_static_gravities(window,
+ use_static);
+ g_return_if_fail(static_gravity_supported);
+#else
+ XSetWindowAttributes xattributes;
+
+ xattributes.win_gravity = (use_static) ? StaticGravity : NorthWestGravity;
+ xattributes.bit_gravity = (use_static) ? StaticGravity : NorthWestGravity;
+
+ XChangeWindowAttributes(GDK_WINDOW_XDISPLAY(window),
+ GDK_WINDOW_XWINDOW(window),
+ CWBitGravity | CWWinGravity,
+ &xattributes);
+#endif
+}
+
+ void
+gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
+ gint x, gint y, gint w, gint h)
+{
+ widget->requisition.width = w;
+ widget->requisition.height = h;
+
+ gtk_form_move(form, widget, x, y);
+}
+
+ static void
+gtk_form_send_configure(GtkForm *form)
+{
+ GtkWidget *widget;
+ GdkEventConfigure event;
+
+ widget = GTK_WIDGET(form);
+
+ event.type = GDK_CONFIGURE;
+ event.window = widget->window;
+ event.x = widget->allocation.x;
+ event.y = widget->allocation.y;
+ event.width = widget->allocation.width;
+ event.height = widget->allocation.height;
+
+#ifdef HAVE_GTK2
+ gtk_main_do_event((GdkEvent*)&event);
+#else
+ gtk_widget_event(widget, (GdkEvent*)&event);
+#endif
+}
+
+/*ARGSUSED0*/
+ static void
+gtk_form_child_map(GtkWidget *widget, gpointer user_data)
+{
+ GtkFormChild *child;
+
+ child = (GtkFormChild *)user_data;
+
+ child->mapped = TRUE;
+ gdk_window_show(child->window);
+}
+
+/*ARGSUSED0*/
+ static void
+gtk_form_child_unmap(GtkWidget *widget, gpointer user_data)
+{
+ GtkFormChild *child;
+
+ child = (GtkFormChild *)user_data;
+
+ child->mapped = FALSE;
+ gdk_window_hide(child->window);
+}
+
diff --git a/src/gui_gtk_f.h b/src/gui_gtk_f.h
new file mode 100644
index 000000000..06c7ecdf7
--- /dev/null
+++ b/src/gui_gtk_f.h
@@ -0,0 +1,83 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#ifndef __GTK_FORM_H__
+#define __GTK_FORM_H__
+
+#ifdef VMS
+# include "gui_gtk_vms.h"
+#endif
+
+#include <gdk/gdk.h>
+#include <gtk/gtkcontainer.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GTK_TYPE_FORM (gtk_form_get_type ())
+#define GTK_FORM(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FORM, GtkForm))
+#define GTK_FORM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FORM, GtkFormClass))
+#define GTK_IS_FORM(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FORM))
+#define GTK_IS_FORM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FORM))
+
+
+typedef struct _GtkForm GtkForm;
+typedef struct _GtkFormClass GtkFormClass;
+
+struct _GtkForm
+{
+ GtkContainer container;
+
+ GList *children;
+
+ guint width;
+ guint height;
+
+ GdkWindow *bin_window;
+
+ GdkVisibilityState visibility;
+ gulong configure_serial;
+
+ gint freeze_count;
+};
+
+struct _GtkFormClass
+{
+ GtkContainerClass parent_class;
+};
+
+GtkType gtk_form_get_type(void);
+
+GtkWidget *gtk_form_new(void);
+
+void gtk_form_put(GtkForm * form, GtkWidget * widget,
+ gint x, gint y);
+
+void gtk_form_move(GtkForm *form, GtkWidget * widget,
+ gint x, gint y);
+
+void gtk_form_move_resize(GtkForm * form, GtkWidget * widget,
+ gint x, gint y,
+ gint w, gint h);
+void gtk_form_set_size(GtkForm * form, guint width, guint height);
+
+/* These disable and enable moving and repainting respectively. If you
+ * want to update the layout's offsets but do not want it to repaint
+ * itself, you should use these functions.
+ */
+
+void gtk_form_freeze(GtkForm *form);
+void gtk_form_thaw(GtkForm *form);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __GTK_FORM_H__ */
diff --git a/src/gui_gtk_vms.h b/src/gui_gtk_vms.h
new file mode 100644
index 000000000..e88728f98
--- /dev/null
+++ b/src/gui_gtk_vms.h
@@ -0,0 +1,734 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributedi.
+ *
+ * File MOTIF_REDEFINES.H originally delivers together with
+ * OpenVMS Porting Library
+ * http://www.openvms.compaq.com/openvms/products/ips/porting.html
+ *
+ * This file has been modified for Vim development.
+ * Original file contains just defines that GTK for OpenVMS uses,
+ * but not all functions that DECW library has. Therefore it has been expanded
+ * with necessary defines for Vim on OpenVMS with GTK GUI.
+ *
+ * Zoltan Arpadffy <arpadffy@polarhome.com>
+ */
+
+/*
+ *************************************************************************
+ * *
+ * Copyright 2000 Compaq Computer Corporation *
+ * *
+ * COMPAQ Registered in U.S. Patent and Trademark Office. *
+ * *
+ *************************************************************************
+ * IMPORTANT: Carefully read the License Terms below before *
+ * proceeding. By use of these materials you agree to these terms. *
+ * If you do not agree to these terms, you may not use this software or *
+ * the accompanying documentation. *
+ *************************************************************************
+ * LICENSE TERMS *
+ * 1. GRANT *
+ * Compaq Computer Corporation ("COMPAQ") grants you the right to use, *
+ * modify, and distribute the following source code (the "Software") *
+ * on any number of computers. You may use the Software as part of *
+ * creating a software program or product intended for commercial or *
+ * non-commercial distribution in machine-readable source code, binary, *
+ * or executable formats. You may distribute the Software as *
+ * machine-readable source code provided this license is not removed *
+ * from the Software and any modifications are conspicuously indicated. *
+ * 2. COPYRIGHT *
+ * The Software is owned by COMPAQ and its suppliers and is protected by *
+ * copyright laws and international treaties. Your use of the Software *
+ * and associated documentation is subject to the applicable copyright *
+ * laws and the express rights and restrictions of these terms. *
+ * 3. RESTRICTIONS *
+ * You may not remove any copyright, trademark, or other proprietary *
+ * notices from the Software or the associated documentation. *
+ * You are responsible for compliance with all applicable export or *
+ * re-export control laws and regulations if you export the Software. *
+ * This license is governed by and is to be construed under the laws *
+ * of the State of Texas. *
+ * *
+ * DISCLAIMER OF WARRANTY AND LIABILITY *
+ * Compaq shall not be liable for technical or editorial errors or *
+ * omissions contained herein. The information contained herein is *
+ * subject to change without notice. *
+ * *
+ * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. *
+ * THE ENTIRE RISK ARISING OUT OF THE USE OF THIS SOFTWARE REMAINS WITH *
+ * RECIPIENT. IN NO EVENT SHALL COMPAQ BE LIABLE FOR ANY DIRECT, *
+ * CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE OR OTHER DAMAGES *
+ * WHATSOEVER (INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS *
+ * PROFITS, BUSINESS INTERRUPTION, OR LOSS OF BUSINESS INFORMATION), *
+ * EVEN IF COMPAQ HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES *
+ * AND WHETHER IN AN ACTION OF CONTRACT OR TORT INCLUDING NEGLIGENCE. *
+ * *
+ * If you have any questions concerning this license, please contact: *
+ * Compaq Computer Corporation, Software Business Practices, ZKO1-2/D22, *
+ * 110 Spit Brook Road, Nashua, NH. 03062-2698. *
+ * *
+ *************************************************************************
+ */
+
+/* INTRINSIC.H omits proto if XtFree is defined */
+/* VMS_BEGIN_C_PLUS_PLUS */
+extern void XtFree(char*);
+/* VMS_END_C_PLUS_PLUS */
+
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
+
+#define XAllocClassHint XALLOCCLASSHINT
+#define XAllocColor XALLOCCOLOR
+#define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocWMHints XALLOCWMHINTS
+#define XAutoRepeatOff XAUTOREPEATOFF
+#define XAutoRepeatOn XAUTOREPEATON
+#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
+#define XBell XBELL
+#define XBitmapPad XBITMAPPAD
+#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
+#define XChangeGC XCHANGEGC
+#define XChangeProperty XCHANGEPROPERTY
+#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
+#define XCheckIfEvent XCHECKIFEVENT
+#define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedEvent XCHECKTYPEDEVENT
+#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
+#define XCheckWindowEvent XCHECKWINDOWEVENT
+#define XClearArea XCLEARAREA
+#define XClearWindow XCLEARWINDOW
+#define XClipBox XCLIPBOX
+#define XCloseDisplay XCLOSEDISPLAY
+#define XCloseIM XCLOSEIM
+#define XConfigureWindow XCONFIGUREWINDOW
+#define XConvertSelection XCONVERTSELECTION
+#define XCopyArea XCOPYAREA
+#define XCopyGC XCOPYGC
+#define XCopyPlane XCOPYPLANE
+#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
+#define XCreateColormap XCREATECOLORMAP
+#define XCreateFontCursor XCREATEFONTCURSOR
+#define XCreateFontSet XCREATEFONTSET
+#define XCreateGC XCREATEGC
+#define XCreateIC XCREATEIC
+#define XCreateImage XCREATEIMAGE
+#define XCreatePixmap XCREATEPIXMAP
+#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
+#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
+#define XCreateRegion XCREATEREGION
+#define XCreateSimpleWindow XCREATESIMPLEWINDOW
+#define XCreateWindow XCREATEWINDOW
+#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefineCursor XDEFINECURSOR
+#define XDeleteProperty XDELETEPROPERTY
+#define XDestroyIC XDESTROYIC
+#define XDestroyRegion XDESTROYREGION
+#define XDestroyWindow XDESTROYWINDOW
+#define XDisplayName XDISPLAYNAME
+#define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDisplayString XDISPLAYSTRING
+#define XDrawArc XDRAWARC
+#define XDrawImageString XDRAWIMAGESTRING
+#define XDrawImageString16 XDRAWIMAGESTRING16
+#define XDrawLine XDRAWLINE
+#define XDrawLines XDRAWLINES
+#define XDrawPoint XDRAWPOINT
+#define XDrawPoints XDRAWPOINTS
+#define XDrawRectangle XDRAWRECTANGLE
+#define XDrawSegments XDRAWSEGMENTS
+#define XDrawString XDRAWSTRING
+#define XDrawString16 XDRAWSTRING16
+#define XEmptyRegion XEMPTYREGION
+#define XEqualRegion XEQUALREGION
+#define XEventsQueued XEVENTSQUEUED
+#define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFetchBuffer XFETCHBUFFER
+#define XFillArc XFILLARC
+#define XFillPolygon XFILLPOLYGON
+#define XFillRectangle XFILLRECTANGLE
+#define XFillRectangles XFILLRECTANGLES
+#define XFilterEvent XFILTEREVENT
+#define XFlush XFLUSH
+#define XFontsOfFontSet XFONTSOFFONTSET
+#define XFree XFREE
+#define XFreeColormap XFREECOLORMAP
+#define XFreeColors XFREECOLORS
+#define XFreeCursor XFREECURSOR
+#define XFreeFont XFREEFONT
+#define XFreeFontInfo XFREEFONTINFO
+#define XFreeFontNames XFREEFONTNAMES
+#define XFreeFontSet XFREEFONTSET
+#define XFreeGC XFREEGC
+#define XFreeModifiermap XFREEMODIFIERMAP
+#define XFreePixmap XFREEPIXMAP
+#define XFreeStringList XFREESTRINGLIST
+#define XGetAtomName XGETATOMNAME
+#define XGetDefault XGETDEFAULT
+#define XGetErrorDatabaseText XGETERRORDATABASETEXT
+#define XGetErrorText XGETERRORTEXT
+#define XGetFontProperty XGETFONTPROPERTY
+#define XGetGCValues XGETGCVALUES
+#define XGetGeometry XGETGEOMETRY
+#define XGetIconSizes XGETICONSIZES
+#define XGetICValues XGETICVALUES
+#define XGetIMValues XGETIMVALUES
+#define XGetImage XGETIMAGE
+#define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetModifierMapping XGETMODIFIERMAPPING
+#define XGetMotionEvents XGETMOTIONEVENTS
+#define XGetNormalHints XGETNORMALHINTS
+#define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetSubImage XGETSUBIMAGE
+#define XGetVisualInfo XGETVISUALINFO
+#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
+#define XGetWMProtocols XGETWMPROTOCOLS
+#define XGetWMHints XGETWMHINTS
+#define XGetWMName XGETWMNAME
+#define XGetWMNormalHints XGETWMNORMALHINTS
+#define XGetWindowAttributes XGETWINDOWATTRIBUTES
+#define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabKeyboard XGRABKEYBOARD
+#define XGrabPointer XGRABPOINTER
+#define XGrabServer XGRABSERVER
+#define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIconifyWindow XICONIFYWINDOW
+#define XIfEvent XIFEVENT
+#define XInternAtom XINTERNATOM
+#define XIntersectRegion XINTERSECTREGION
+#define XKeycodeToKeysym XKEYCODETOKEYSYM
+#define XKeysymToKeycode XKEYSYMTOKEYCODE
+#define XKeysymToString XKEYSYMTOSTRING
+#define XListFonts XLISTFONTS
+#define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListPixmapFormats XLISTPIXMAPFORMATS
+#define XListProperties XLISTPROPERTIES
+#define XLoadQueryFont XLOADQUERYFONT
+#define XLookupString XLOOKUPSTRING
+#define XLowerWindow XLOWERWINDOW
+#define XMapRaised XMAPRAISED
+#define XMapWindow XMAPWINDOW
+#define XMatchVisualInfo XMATCHVISUALINFO
+#define XMoveResizeWindow XMOVERESIZEWINDOW
+#define XMoveWindow XMOVEWINDOW
+#define XNextEvent XNEXTEVENT
+#define XOffsetRegion XOFFSETREGION
+#define XOpenDisplay XOPENDISPLAY
+#define XOpenIM XOPENIM
+#define XParseColor XPARSECOLOR
+#define XParseGeometry XPARSEGEOMETRY
+#define XPeekEvent XPEEKEVENT
+#define XPending XPENDING
+#define XPointInRegion XPOINTINREGION
+#define XPolygonRegion XPOLYGONREGION
+#define XPutBackEvent XPUTBACKEVENT
+#define XPutImage XPUTIMAGE
+#define XRootWindow XROOTWINDOW
+#define XQueryColor XQUERYCOLOR
+#define XQueryColors XQUERYCOLORS
+#define XQueryExtension XQUERYEXTENSION
+#define XQueryPointer XQUERYPOINTER
+#define XQueryTree XQUERYTREE
+#define XRaiseWindow XRAISEWINDOW
+#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
+#define XRectInRegion XRECTINREGION
+#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XReparentWindow XREPARENTWINDOW
+#define XResizeWindow XRESIZEWINDOW
+#define XRestackWindows XRESTACKWINDOWS
+#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XSelectAsyncEvent XSELECTASYNCEVENT
+#define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectInput XSELECTINPUT
+#define XSendEvent XSENDEVENT
+#define XServerVendor XSERVERVENDOR
+#define XSetBackground XSETBACKGROUND
+#define XSetClassHint XSETCLASSHINT
+#define XSetClipMask XSETCLIPMASK
+#define XSetClipOrigin XSETCLIPORIGIN
+#define XSetClipRectangles XSETCLIPRECTANGLES
+#define XSetCloseDownMode XSETCLOSEDOWNMODE
+#define XSetCommand XSETCOMMAND
+#define XSetDashes XSETDASHES
+#define XSetErrorHandler XSETERRORHANDLER
+#define XSetFillStyle XSETFILLSTYLE
+#define XSetFont XSETFONT
+#define XSetForeground XSETFOREGROUND
+#define XSetFunction XSETFUNCTION
+#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
+#define XSetICFocus XSETICFOCUS
+#define XSetICValues XSETICVALUES
+#define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetInputFocus XSETINPUTFOCUS
+#define XSetLineAttributes XSETLINEATTRIBUTES
+#define XSetLocaleModifiers XSETLOCALEMODIFIERS
+#define XSetNormalHints XSETNORMALHINTS
+#define XSetRegion XSETREGION
+#define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStipple XSETSTIPPLE
+#define XSetSubwindowMode XSETSUBWINDOWMODE
+#define XSetTSOrigin XSETTSORIGIN
+#define XSetTile XSETTILE
+#define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
+#define XSetWMHints XSETWMHINTS
+#define XSetWMIconName XSETWMICONNAME
+#define XSetWMName XSETWMNAME
+#define XSetWMNormalHints XSETWMNORMALHINTS
+#define XSetWMProperties XSETWMPROPERTIES
+#define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWindowBackground XSETWINDOWBACKGROUND
+#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowColormap XSETWINDOWCOLORMAP
+#define XShapeCombineMask XSHAPECOMBINEMASK
+#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
+#define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShrinkRegion XSHRINKREGION
+#define XStoreColor XSTORECOLOR
+#define XStoreColors XSTORECOLORS
+#define XStoreName XSTORENAME
+#define XStringToKeysym XSTRINGTOKEYSYM
+#define XSubtractRegion XSUBTRACTREGION
+#define XSupportsLocale XSUPPORTSLOCALE
+#define XSync XSYNC
+#define XSynchronize XSYNCHRONIZE
+#define XTextExtents XTEXTEXTENTS
+#define XTextExtents16 XTEXTEXTENTS16
+#define XTextWidth XTEXTWIDTH
+#define XTextWidth16 XTEXTWIDTH16
+#define XTranslateCoordinates XTRANSLATECOORDINATES
+#define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabKeyboard XUNGRABKEYBOARD
+#define XUngrabPointer XUNGRABPOINTER
+#define XUngrabServer XUNGRABSERVER
+#define XUnionRectWithRegion XUNIONRECTWITHREGION
+#define XUnionRegion XUNIONREGION
+#define XUnmapWindow XUNMAPWINDOW
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define XUnsetICFocus XUNSETICFOCUS
+#define XVaCreateNestedList XVACREATENESTEDLIST
+#define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWarpPointer XWARPPOINTER
+#define XWidthOfScreen XWIDTHOFSCREEN
+#define XWindowEvent XWINDOWEVENT
+#define XWithdrawWindow XWITHDRAWWINDOW
+#define XXorRegion XXORREGION
+#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
+#define XmAddProtocols XMADDPROTOCOLS
+#define XmChangeColor XMCHANGECOLOR
+#define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
+#define XmClipboardLock XMCLIPBOARDLOCK
+#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
+#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCreateArrowButton XMCREATEARROWBUTTON
+#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateDialogShell XMCREATEDIALOGSHELL
+#define XmCreateDragIcon XMCREATEDRAGICON
+#define XmCreateDrawingArea XMCREATEDRAWINGAREA
+#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
+#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
+#define XmCreateForm XMCREATEFORM
+#define XmCreateFormDialog XMCREATEFORMDIALOG
+#define XmCreateFrame XMCREATEFRAME
+#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateMainWindow XMCREATEMAINWINDOW
+#define XmCreateMenuBar XMCREATEMENUBAR
+#define XmCreateMessageBox XMCREATEMESSAGEBOX
+#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
+#define XmCreateOptionMenu XMCREATEOPTIONMENU
+#define XmCreatePanedWindow XMCREATEPANEDWINDOW
+#define XmCreatePopupMenu XMCREATEPOPUPMENU
+#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
+#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
+#define XmCreatePushButton XMCREATEPUSHBUTTON
+#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
+#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
+#define XmCreateRadioBox XMCREATERADIOBOX
+#define XmCreateRowColumn XMCREATEROWCOLUMN
+#define XmCreateScale XMCREATESCALE
+#define XmCreateScrollBar XMCREATESCROLLBAR
+#define XmCreateScrolledList XMCREATESCROLLEDLIST
+#define XmCreateScrolledText XMCREATESCROLLEDTEXT
+#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
+#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
+#define XmCreateSeparator XMCREATESEPARATOR
+#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
+#define XmCreateText XMCREATETEXT
+#define XmCreateTextField XMCREATETEXTFIELD
+#define XmCreateToggleButton XMCREATETOGGLEBUTTON
+#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmDragStart XMDRAGSTART
+#define XmDropSiteRegister XMDROPSITEREGISTER
+#define XmDropSiteUnregister XMDROPSITEUNREGISTER
+#define XmDropSiteUpdate XMDROPSITEUPDATE
+#define XmDropTransferStart XMDROPTRANSFERSTART
+#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
+#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
+#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
+#define XmFontListCopy XMFONTLISTCOPY
+#define XmFontListCreate XMFONTLISTCREATE
+#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
+#define XmFontListEntryFree XMFONTLISTENTRYFREE
+#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
+#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
+#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
+#define XmFontListFree XMFONTLISTFREE
+#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
+#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
+#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
+#define XmFontListNextEntry XMFONTLISTNEXTENTRY
+#define XmGetColors XMGETCOLORS
+#define XmGetFocusWidget XMGETFOCUSWIDGET
+#define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
+#define XmGetTearOffControl XMGETTEAROFFCONTROL
+#define XmGetXmDisplay XMGETXMDISPLAY
+#define XmImMbLookupString XMIMMBLOOKUPSTRING
+#define XmImRegister XMIMREGISTER
+#define XmImSetFocusValues XMIMSETFOCUSVALUES
+#define XmImSetValues XMIMSETVALUES
+#define XmImUnregister XMIMUNREGISTER
+#define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInternAtom XMINTERNATOM
+#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
+#define XmListAddItem XMLISTADDITEM
+#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
+#define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
+#define XmListDeletePos XMLISTDELETEPOS
+#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
+#define XmListDeselectPos XMLISTDESELECTPOS
+#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
+#define XmListGetMatchPos XMLISTGETMATCHPOS
+#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListPosSelected XMLISTPOSSELECTED
+#define XmListSelectItem XMLISTSELECTITEM
+#define XmListSelectPos XMLISTSELECTPOS
+#define XmListSetBottomPos XMLISTSETBOTTOMPOS
+#define XmListSetItem XMLISTSETITEM
+#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
+#define XmListSetPos XMLISTSETPOS
+#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
+#define XmMenuPosition XMMENUPOSITION
+#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
+#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
+#define XmOptionLabelGadget XMOPTIONLABELGADGET
+#define XmProcessTraversal XMPROCESSTRAVERSAL
+#define XmQmotif XMQMOTIF
+#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRepTypeGetId XMREPTYPEGETID
+#define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeRegister XMREPTYPEREGISTER
+#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarSetValues XMSCROLLBARSETVALUES
+#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
+#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmStringByteCompare XMSTRINGBYTECOMPARE
+#define XmStringCompare XMSTRINGCOMPARE
+#define XmStringConcat XMSTRINGCONCAT
+#define XmStringCopy XMSTRINGCOPY
+#define XmStringCreate XMSTRINGCREATE
+#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
+#define XmStringCreateLtoR XMSTRINGCREATELTOR
+#define XmStringCreateSimple XMSTRINGCREATESIMPLE
+#define XmStringDraw XMSTRINGDRAW
+#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
+#define XmStringExtent XMSTRINGEXTENT
+#define XmStringFree XMSTRINGFREE
+#define XmStringFreeContext XMSTRINGFREECONTEXT
+#define XmStringGetLtoR XMSTRINGGETLTOR
+#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
+#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
+#define XmStringInitContext XMSTRINGINITCONTEXT
+#define XmStringLength XMSTRINGLENGTH
+#define XmStringLtoRCreate XMSTRINGLTORCREATE
+#define XmStringNConcat XMSTRINGNCONCAT
+#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringWidth XMSTRINGWIDTH
+#define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
+#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
+#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetString XMTEXTFIELDGETSTRING
+#define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
+#define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
+#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
+#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
+#define XmTextGetSelection XMTEXTGETSELECTION
+#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
+#define XmTextGetString XMTEXTGETSTRING
+#define XmTextInsert XMTEXTINSERT
+#define XmTextRemove XMTEXTREMOVE
+#define XmTextReplace XMTEXTREPLACE
+#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
+#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
+#define XmTextSetSelection XMTEXTSETSELECTION
+#define XmTextSetString XMTEXTSETSTRING
+#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
+#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
+#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
+#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUpdateDisplay XMUPDATEDISPLAY
+#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
+#define XmbDrawString XMBDRAWSTRING
+#define XmbLookupString XMBLOOKUPSTRING
+#define XmbResetIC XMBRESETIC
+#define XmbSetWMProperties XMBSETWMPROPERTIES
+#define XmbTextEscapement XMBTEXTESCAPEMENT
+#define XmbTextExtents XMBTEXTEXTENTS
+#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
+#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmuClientWindow XMUCLIENTWINDOW
+#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmGetDatabase XRMGETDATABASE
+#define XrmGetResource XRMGETRESOURCE
+#define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmStringToQuark XRMSTRINGTOQUARK
+#define XtAddCallback XTADDCALLBACK
+#define XtAddCallbacks XTADDCALLBACKS
+#define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddGrab XTADDGRAB
+#define XtAllocateGC XTALLOCATEGC
+#define XtAppAddActions XTAPPADDACTIONS
+#define XtAppAddInput XTAPPADDINPUT
+#define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppInitialize XTAPPINITIALIZE
+#define XtAppNextEvent XTAPPNEXTEVENT
+#define XtAppPeekEvent XTAPPPEEKEVENT
+#define XtAppPending XTAPPPENDING
+#define XtAppProcessEvent XTAPPPROCESSEVENT
+#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
+#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
+#define XtAppWarning XTAPPWARNING
+#define XtCallActionProc XTCALLACTIONPROC
+#define XtCallCallbackList XTCALLCALLBACKLIST
+#define XtCallCallbacks XTCALLCALLBACKS
+#define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvertAndStore XTCONVERTANDSTORE
+#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
+#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
+#define XtCreatePopupShell XTCREATEPOPUPSHELL
+#define XtCreateWidget XTCREATEWIDGET
+#define XtDatabase XTDATABASE
+#define XtDestroyWidget XTDESTROYWIDGET
+#define XtDisownSelection XTDISOWNSELECTION
+#define XtDispatchEvent XTDISPATCHEVENT
+#define XtDisplayOfObject XTDISPLAYOFOBJECT
+#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
+#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
+#define XtFree XTFREE
+#define XtGetActionKeysym XTGETACTIONKEYSYM
+#define XtGetActionList XTGETACTIONLIST
+#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
+#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetGC XTGETGC
+#define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetSelectionValue XTGETSELECTIONVALUE
+#define XtGetSelectionValues XTGETSELECTIONVALUES
+#define XtGetSubresources XTGETSUBRESOURCES
+#define XtGetValues XTGETVALUES
+#define XtGrabKeyboard XTGRABKEYBOARD
+#define XtGrabPointer XTGRABPOINTER
+#define XtHasCallbacks XTHASCALLBACKS
+#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
+#define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtIsManaged XTISMANAGED
+#define XtIsObject XTISOBJECT
+#define XtIsSensitive XTISSENSITIVE
+#define XtIsSubclass XTISSUBCLASS
+#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
+#define XtMakeResizeRequest XTMAKERESIZEREQUEST
+#define XtMalloc XTMALLOC
+#define XtManageChild XTMANAGECHILD
+#define XtManageChildren XTMANAGECHILDREN
+#define XtMergeArgLists XTMERGEARGLISTS
+#define XtMoveWidget XTMOVEWIDGET
+#define XtName XTNAME
+#define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenDisplay XTOPENDISPLAY
+#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
+#define XtOwnSelection XTOWNSELECTION
+#define XtParent XTPARENT
+#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
+#define XtPopdown XTPOPDOWN
+#define XtPopup XTPOPUP
+#define XtQueryGeometry XTQUERYGEOMETRY
+#define XtRealizeWidget XTREALIZEWIDGET
+#define XtRealloc XTREALLOC
+#define XtReleaseGC XTRELEASEGC
+#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
+#define XtRemoveCallback XTREMOVECALLBACK
+#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
+#define XtRemoveGrab XTREMOVEGRAB
+#define XtRemoveInput XTREMOVEINPUT
+#define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtResizeWidget XTRESIZEWIDGET
+#define XtResolvePathname XTRESOLVEPATHNAME
+#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
+#define XtSetSensitive XTSETSENSITIVE
+#define XtSetTypeConverter XTSETTYPECONVERTER
+#define XtSetValues XTSETVALUES
+#define XtShellStrings XTSHELLSTRINGS
+#define XtStrings XTSTRINGS
+#define XtToolkitInitialize XTTOOLKITINITIALIZE
+#define XtTranslateCoords XTTRANSLATECOORDS
+#define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabKeyboard XTUNGRABKEYBOARD
+#define XtUngrabPointer XTUNGRABPOINTER
+#define XtUnmanageChild XTUNMANAGECHILD
+#define XtUnmanageChildren XTUNMANAGECHILDREN
+#define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetValues XTVAGETVALUES
+#define XtVaSetValues XTVASETVALUES
+#define XtWarning XTWARNING
+#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#define XtWindow XTWINDOW
+#define XtWindowOfObject XTWINDOWOFOBJECT
+#define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawString XWCDRAWSTRING
+#define XwcFreeStringList XWCFREESTRINGLIST
+#define XwcTextEscapement XWCTEXTESCAPEMENT
+#define XwcTextExtents XWCTEXTEXTENTS
+#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
+#define _XmClearBorder _XMCLEARBORDER
+#define _XmConfigureObject _XMCONFIGUREOBJECT
+#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
+#define _XmDrawArrow _XMDRAWARROW
+#define _XmDrawShadows _XMDRAWSHADOWS
+#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
+#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
+#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
+#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
+#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
+#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
+#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
+#define _XmGrabKeyboard _XMGRABKEYBOARD
+#define _XmGrabPointer _XMGRABPOINTER
+#define _XmInheritClass _XMINHERITCLASS
+#define _XmInputInGadget _XMINPUTINGADGET
+#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
+#define _XmMenuPopDown _XMMENUPOPDOWN
+#define _XmMoveObject _XMMOVEOBJECT
+#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
+#define _XmOSBuildFileList _XMOSBUILDFILELIST
+#define _XmOSFileCompare _XMOSFILECOMPARE
+#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
+#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
+#define _XmPostPopupMenu _XMPOSTPOPUPMENU
+#define _XmPrimitiveEnter _XMPRIMITIVEENTER
+#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
+#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
+#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
+#define _XmStringDraw _XMSTRINGDRAW
+#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
+#define _XmStrings _XMSTRINGS
+#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
+#define _XmToVerticalPixels _XMTOVERTICALPIXELS
+#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
+#define _Xm_fastPtr _XM_FASTPTR
+#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtInherit _XTINHERIT
+#define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+
+/*
+** XtRegisterDrawable and XtUnregisterDrawable don't exist until R6.
+** So we have to fake it for R5 and earlier. It would be real nice to
+** include X11.h here and then test for R6 by checking
+** XlibSpecificationRelease. But including X11.h defines the symbol "None"
+** and there's Mozilla code in gfx/src/gtk that defines an enum element
+** named None. So for now hard code this is R5....
+*/
+#ifndef VMS_X11R6
+/* R5 or earlier */
+#define _XtRegisterWindow _XTREGISTERWINDOW
+#define _XtUnregisterWindow _XTUNREGISTERWINDOW
+/* original code is fixed so we don't need this now */
+#if 0
+#define XtRegisterDrawable(display,drawable,widget) \
+{ extern void _XtRegisterWindow(Window,Widget); \
+ _XtRegisterWindow(drawable,widget); \
+}
+#define XtUnregisterDrawable(display,drawable) \
+{ extern void _XtUnregisterWindow(Window,Widget); \
+ _XtUnregisterWindow(drawable,XtWindowToWidget(display,drawable)); \
+}
+#endif
+#else
+/* R6 or later */
+#define XtRegisterDrawable XTREGISTERDRAWABLE
+#define XtUnregisterDrawable XTUNREGISTERDRAWABLE
+#endif
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
new file mode 100644
index 000000000..e36c85827
--- /dev/null
+++ b/src/gui_gtk_x11.c
@@ -0,0 +1,6589 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Porting to GTK+ was done by:
+ *
+ * (C) 1998,1999,2000 by Marcin Dalecki <dalecki@evision.ag>
+ *
+ * With GREAT support and continuous encouragements by Andy Kahn and of
+ * course Bram Moolenaar!
+ *
+ * Support for GTK+ 2 was added by:
+ *
+ * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
+ * Daniel Elstner <daniel.elstner@gmx.net>
+ */
+
+#include "vim.h"
+#ifdef FEAT_GUI_GNOME
+/* Gnome redefines _() and N_(). Grrr... */
+# ifdef _
+# undef _
+# endif
+# ifdef N_
+# undef N_
+# endif
+# ifdef textdomain
+# undef textdomain
+# endif
+# ifdef bindtextdomain
+# undef bindtextdomain
+# endif
+# if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
+# define ENABLE_NLS /* so the texts in the dialog boxes are translated */
+# endif
+# include <gnome.h>
+# include "version.h"
+#endif
+
+#if !defined(FEAT_GUI_GTK) && defined(PROTO)
+/* When generating prototypes we don't want syntax errors. */
+# define GdkAtom int
+# define GdkEventExpose int
+# define GdkEventFocus int
+# define GdkEventVisibility int
+# define GdkEventProperty int
+# define GtkContainer int
+# define GtkTargetEntry int
+# define GtkType int
+# define GtkWidget int
+# define gint int
+# define gpointer int
+# define guint int
+# define GdkEventKey int
+# define GdkEventSelection int
+# define GtkSelectionData int
+# define GdkEventMotion int
+# define GdkEventButton int
+# define GdkDragContext int
+# define GdkEventConfigure int
+# define GdkEventClient int
+#else
+# include <gdk/gdkkeysyms.h>
+# include <gdk/gdk.h>
+# ifdef WIN3264
+# include <gdk/gdkwin32.h>
+# else
+# include <gdk/gdkx.h>
+# endif
+
+# include <gtk/gtk.h>
+# include "gui_gtk_f.h"
+#endif
+
+#ifdef HAVE_X11_SUNKEYSYM_H
+# include <X11/Sunkeysym.h>
+#endif
+
+/*
+ * Easy-to-use macro for multihead support.
+ */
+#ifdef HAVE_GTK_MULTIHEAD
+# define GET_X_ATOM(atom) gdk_x11_atom_to_xatom_for_display( \
+ gtk_widget_get_display(gui.mainwin), atom)
+#else
+# define GET_X_ATOM(atom) ((Atom)(atom))
+#endif
+
+/* Selection type distinguishers */
+enum
+{
+ TARGET_TYPE_NONE,
+ TARGET_UTF8_STRING,
+ TARGET_STRING,
+ TARGET_COMPOUND_TEXT,
+ TARGET_TEXT,
+ TARGET_TEXT_URI_LIST,
+ TARGET_TEXT_PLAIN,
+ TARGET_VIM,
+ TARGET_VIMENC
+};
+
+/*
+ * Table of selection targets supported by Vim.
+ * Note: Order matters, preferred types should come first.
+ */
+static const GtkTargetEntry selection_targets[] =
+{
+ {VIMENC_ATOM_NAME, 0, TARGET_VIMENC},
+ {VIM_ATOM_NAME, 0, TARGET_VIM},
+#ifdef FEAT_MBYTE
+ {"UTF8_STRING", 0, TARGET_UTF8_STRING},
+#endif
+ {"COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT},
+ {"TEXT", 0, TARGET_TEXT},
+ {"STRING", 0, TARGET_STRING}
+};
+#define N_SELECTION_TARGETS (sizeof(selection_targets) / sizeof(selection_targets[0]))
+
+#ifdef FEAT_DND
+/*
+ * Table of DnD targets supported by Vim.
+ * Note: Order matters, preferred types should come first.
+ */
+static const GtkTargetEntry dnd_targets[] =
+{
+ {"text/uri-list", 0, TARGET_TEXT_URI_LIST},
+# ifdef FEAT_MBYTE
+ {"UTF8_STRING", 0, TARGET_UTF8_STRING},
+# endif
+ {"STRING", 0, TARGET_STRING},
+ {"text/plain", 0, TARGET_TEXT_PLAIN}
+};
+# define N_DND_TARGETS (sizeof(dnd_targets) / sizeof(dnd_targets[0]))
+#endif
+
+
+#ifdef HAVE_GTK2
+/*
+ * "Monospace" is a standard font alias that should be present
+ * on all proper Pango/fontconfig installations.
+ */
+# define DEFAULT_FONT "Monospace 10"
+
+#else /* !HAVE_GTK2 */
+/*
+ * This is the single only fixed width font in X11, which seems to be present
+ * on all servers and available in all the variants we need.
+ */
+# define DEFAULT_FONT "-adobe-courier-medium-r-normal-*-14-*-*-*-m-*-*-*"
+
+#endif /* !HAVE_GTK2 */
+
+#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
+/*
+ * Atoms used to communicate save-yourself from the X11 session manager. There
+ * is no need to move them into the GUI struct, since they should be constant.
+ */
+static GdkAtom wm_protocols_atom = GDK_NONE;
+static GdkAtom save_yourself_atom = GDK_NONE;
+#endif
+
+/*
+ * Atoms used to control/reference X11 selections.
+ */
+#ifdef FEAT_MBYTE
+static GdkAtom utf8_string_atom = GDK_NONE;
+#endif
+#ifndef HAVE_GTK2
+static GdkAtom compound_text_atom = GDK_NONE;
+static GdkAtom text_atom = GDK_NONE;
+#endif
+static GdkAtom vim_atom = GDK_NONE; /* Vim's own special selection format */
+#ifdef FEAT_MBYTE
+static GdkAtom vimenc_atom = GDK_NONE; /* Vim's extended selection format */
+#endif
+
+/*
+ * Keycodes recognized by vim.
+ * NOTE: when changing this, the table in gui_x11.c probably needs the same
+ * change!
+ */
+static struct special_key
+{
+ guint key_sym;
+ char_u code0;
+ char_u code1;
+}
+const special_keys[] =
+{
+ {GDK_Up, 'k', 'u'},
+ {GDK_Down, 'k', 'd'},
+ {GDK_Left, 'k', 'l'},
+ {GDK_Right, 'k', 'r'},
+ {GDK_F1, 'k', '1'},
+ {GDK_F2, 'k', '2'},
+ {GDK_F3, 'k', '3'},
+ {GDK_F4, 'k', '4'},
+ {GDK_F5, 'k', '5'},
+ {GDK_F6, 'k', '6'},
+ {GDK_F7, 'k', '7'},
+ {GDK_F8, 'k', '8'},
+ {GDK_F9, 'k', '9'},
+ {GDK_F10, 'k', ';'},
+ {GDK_F11, 'F', '1'},
+ {GDK_F12, 'F', '2'},
+ {GDK_F13, 'F', '3'},
+ {GDK_F14, 'F', '4'},
+ {GDK_F15, 'F', '5'},
+ {GDK_F16, 'F', '6'},
+ {GDK_F17, 'F', '7'},
+ {GDK_F18, 'F', '8'},
+ {GDK_F19, 'F', '9'},
+ {GDK_F20, 'F', 'A'},
+ {GDK_F21, 'F', 'B'},
+ {GDK_Pause, 'F', 'B'}, /* Pause == F21 according to netbeans.txt */
+ {GDK_F22, 'F', 'C'},
+ {GDK_F23, 'F', 'D'},
+ {GDK_F24, 'F', 'E'},
+ {GDK_F25, 'F', 'F'},
+ {GDK_F26, 'F', 'G'},
+ {GDK_F27, 'F', 'H'},
+ {GDK_F28, 'F', 'I'},
+ {GDK_F29, 'F', 'J'},
+ {GDK_F30, 'F', 'K'},
+ {GDK_F31, 'F', 'L'},
+ {GDK_F32, 'F', 'M'},
+ {GDK_F33, 'F', 'N'},
+ {GDK_F34, 'F', 'O'},
+ {GDK_F35, 'F', 'P'},
+#ifdef SunXK_F36
+ {SunXK_F36, 'F', 'Q'},
+ {SunXK_F37, 'F', 'R'},
+#endif
+ {GDK_Help, '%', '1'},
+ {GDK_Undo, '&', '8'},
+ {GDK_BackSpace, 'k', 'b'},
+ {GDK_Insert, 'k', 'I'},
+ {GDK_Delete, 'k', 'D'},
+ {GDK_3270_BackTab, 'k', 'B'},
+ {GDK_Clear, 'k', 'C'},
+ {GDK_Home, 'k', 'h'},
+ {GDK_End, '@', '7'},
+ {GDK_Prior, 'k', 'P'},
+ {GDK_Next, 'k', 'N'},
+ {GDK_Print, '%', '9'},
+ /* Keypad keys: */
+ {GDK_KP_Left, 'k', 'l'},
+ {GDK_KP_Right, 'k', 'r'},
+ {GDK_KP_Up, 'k', 'u'},
+ {GDK_KP_Down, 'k', 'd'},
+ {GDK_KP_Insert, KS_EXTRA, (char_u)KE_KINS},
+ {GDK_KP_Delete, KS_EXTRA, (char_u)KE_KDEL},
+ {GDK_KP_Home, 'K', '1'},
+ {GDK_KP_End, 'K', '4'},
+ {GDK_KP_Prior, 'K', '3'}, /* page up */
+ {GDK_KP_Next, 'K', '5'}, /* page down */
+
+ {GDK_KP_Add, 'K', '6'},
+ {GDK_KP_Subtract, 'K', '7'},
+ {GDK_KP_Divide, 'K', '8'},
+ {GDK_KP_Multiply, 'K', '9'},
+ {GDK_KP_Enter, 'K', 'A'},
+ {GDK_KP_Decimal, 'K', 'B'},
+
+ {GDK_KP_0, 'K', 'C'},
+ {GDK_KP_1, 'K', 'D'},
+ {GDK_KP_2, 'K', 'E'},
+ {GDK_KP_3, 'K', 'F'},
+ {GDK_KP_4, 'K', 'G'},
+ {GDK_KP_5, 'K', 'H'},
+ {GDK_KP_6, 'K', 'I'},
+ {GDK_KP_7, 'K', 'J'},
+ {GDK_KP_8, 'K', 'K'},
+ {GDK_KP_9, 'K', 'L'},
+
+ /* End of list marker: */
+ {0, 0, 0}
+};
+
+/*
+ * Flags for command line options table below.
+ */
+#define ARG_FONT 1
+#define ARG_GEOMETRY 2
+#define ARG_REVERSE 3
+#define ARG_NOREVERSE 4
+#define ARG_BACKGROUND 5
+#define ARG_FOREGROUND 6
+#define ARG_ICONIC 7
+#define ARG_ROLE 8
+#define ARG_NETBEANS 9
+#define ARG_XRM 10 /* ignored */
+#define ARG_MENUFONT 11 /* ignored */
+#define ARG_INDEX_MASK 0x00ff
+#define ARG_HAS_VALUE 0x0100 /* a value is expected after the argument */
+#define ARG_NEEDS_GUI 0x0200 /* need to initialize the GUI for this */
+#define ARG_FOR_GTK 0x0400 /* argument is handled by GTK+ or GNOME */
+#define ARG_COMPAT_LONG 0x0800 /* accept -foo but substitute with --foo */
+#define ARG_KEEP 0x1000 /* don't remove argument from argv[] */
+
+/*
+ * This table holds all the X GUI command line options allowed. This includes
+ * the standard ones so that we can skip them when Vim is started without the
+ * GUI (but the GUI might start up later).
+ *
+ * When changing this, also update doc/gui_x11.txt and the usage message!!!
+ */
+typedef struct
+{
+ const char *name;
+ unsigned int flags;
+}
+cmdline_option_T;
+
+static const cmdline_option_T cmdline_options[] =
+{
+ /* We handle these options ourselves */
+ {"-fn", ARG_FONT|ARG_HAS_VALUE},
+ {"-font", ARG_FONT|ARG_HAS_VALUE},
+ {"-geom", ARG_GEOMETRY|ARG_HAS_VALUE},
+ {"-geometry", ARG_GEOMETRY|ARG_HAS_VALUE},
+ {"-rv", ARG_REVERSE},
+ {"-reverse", ARG_REVERSE},
+ {"+rv", ARG_NOREVERSE},
+ {"+reverse", ARG_NOREVERSE},
+ {"-bg", ARG_BACKGROUND|ARG_HAS_VALUE},
+ {"-background", ARG_BACKGROUND|ARG_HAS_VALUE},
+ {"-fg", ARG_FOREGROUND|ARG_HAS_VALUE},
+ {"-foreground", ARG_FOREGROUND|ARG_HAS_VALUE},
+ {"-iconic", ARG_ICONIC},
+#ifdef HAVE_GTK2
+ {"--role", ARG_ROLE|ARG_HAS_VALUE},
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ {"-nb", ARG_NETBEANS}, /* non-standard value format */
+ {"-xrm", ARG_XRM|ARG_HAS_VALUE}, /* not implemented */
+ {"-mf", ARG_MENUFONT|ARG_HAS_VALUE}, /* not implemented */
+ {"-menufont", ARG_MENUFONT|ARG_HAS_VALUE}, /* not implemented */
+#endif
+#if 0 /* not implemented; these arguments don't make sense for GTK+ */
+ {"-boldfont", ARG_HAS_VALUE},
+ {"-italicfont", ARG_HAS_VALUE},
+ {"-bw", ARG_HAS_VALUE},
+ {"-borderwidth", ARG_HAS_VALUE},
+ {"-sw", ARG_HAS_VALUE},
+ {"-scrollbarwidth", ARG_HAS_VALUE},
+#endif
+ /* Arguments handled by GTK (and GNOME) internally. */
+ {"--g-fatal-warnings", ARG_FOR_GTK},
+ {"--gdk-debug", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gdk-no-debug", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gtk-debug", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gtk-no-debug", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gtk-module", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--sync", ARG_FOR_GTK},
+ {"--display", ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
+ {"--name", ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
+ {"--class", ARG_FOR_GTK|ARG_HAS_VALUE|ARG_COMPAT_LONG},
+#ifdef HAVE_GTK2
+ {"--screen", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gxid-host", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gxid-port", ARG_FOR_GTK|ARG_HAS_VALUE},
+#else /* these don't seem to exist anymore */
+ {"--no-xshm", ARG_FOR_GTK},
+ {"--xim-preedit", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--xim-status", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gxid_host", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--gxid_port", ARG_FOR_GTK|ARG_HAS_VALUE},
+#endif
+#ifdef FEAT_GUI_GNOME
+ {"--load-modules", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--sm-client-id", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--sm-config-prefix", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--sm-disable", ARG_FOR_GTK},
+ {"--oaf-ior-fd", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--oaf-activate-iid", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"--oaf-private", ARG_FOR_GTK},
+ {"--enable-sound", ARG_FOR_GTK},
+ {"--disable-sound", ARG_FOR_GTK},
+ {"--espeaker", ARG_FOR_GTK|ARG_HAS_VALUE},
+ {"-?", ARG_FOR_GTK|ARG_NEEDS_GUI},
+ {"--help", ARG_FOR_GTK|ARG_NEEDS_GUI|ARG_KEEP},
+ {"--usage", ARG_FOR_GTK|ARG_NEEDS_GUI},
+# if 0 /* conflicts with Vim's own --version argument */
+ {"--version", ARG_FOR_GTK|ARG_NEEDS_GUI},
+# endif
+ {"--disable-crash-dialog", ARG_FOR_GTK},
+#endif
+ {NULL, 0}
+};
+
+static int gui_argc = 0;
+static char **gui_argv = NULL;
+
+#ifdef HAVE_GTK2
+static const char *role_argument = NULL;
+#endif
+#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
+static const char *restart_command = NULL;
+#endif
+static int found_iconic_arg = FALSE;
+
+#ifdef FEAT_GUI_GNOME
+/*
+ * Can't use Gnome if --socketid given
+ */
+static int using_gnome = 0;
+#else
+# define using_gnome 0
+#endif
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(int *argc, char **argv)
+{
+ const cmdline_option_T *option;
+ int i = 0;
+ int len = 0;
+
+#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
+ /*
+ * Determine the command used to invoke Vim, to be passed as restart
+ * command to the session manager. If argv[0] contains any directory
+ * components try building an absolute path, otherwise leave it as is.
+ */
+ restart_command = argv[0];
+
+ if (strchr(argv[0], G_DIR_SEPARATOR) != NULL)
+ {
+ char_u buf[MAXPATHL];
+
+ if (mch_FullName((char_u *)argv[0], buf, (int)sizeof(buf), TRUE) == OK)
+ /* Tiny leak; doesn't matter, and usually we don't even get here */
+ restart_command = (char *)vim_strsave(buf);
+ }
+#endif
+
+ /*
+ * Move all the entries in argv which are relevant to GTK+ and GNOME
+ * into gui_argv. Freed later in gui_mch_init().
+ */
+ gui_argc = 0;
+ gui_argv = (char **)alloc((unsigned)((*argc + 1) * sizeof(char *)));
+
+ g_return_if_fail(gui_argv != NULL);
+
+ gui_argv[gui_argc++] = argv[i++];
+
+ while (i < *argc)
+ {
+ /* Don't waste CPU cycles on non-option arguments. */
+ if (argv[i][0] != '-' && argv[i][0] != '+')
+ {
+ ++i;
+ continue;
+ }
+
+ /* Look for argv[i] in cmdline_options[] table. */
+ for (option = &cmdline_options[0]; option->name != NULL; ++option)
+ {
+ len = strlen(option->name);
+
+ if (strncmp(argv[i], option->name, len) == 0)
+ {
+ if (argv[i][len] == '\0')
+ break;
+ /* allow --foo=bar style */
+ if (argv[i][len] == '=' && (option->flags & ARG_HAS_VALUE))
+ break;
+#ifdef FEAT_NETBEANS_INTG
+ /* darn, -nb has non-standard syntax */
+ if (vim_strchr((char_u *)":=", argv[i][len]) != NULL
+ && (option->flags & ARG_INDEX_MASK) == ARG_NETBEANS)
+ break;
+#endif
+ }
+ else if ((option->flags & ARG_COMPAT_LONG)
+ && strcmp(argv[i], option->name + 1) == 0)
+ {
+ /* Replace the standard X arguments "-name" and "-display"
+ * with their GNU-style long option counterparts. */
+ argv[i] = (char *)option->name;
+ break;
+ }
+ }
+ if (option->name == NULL) /* no match */
+ {
+ ++i;
+ continue;
+ }
+
+ if (option->flags & ARG_FOR_GTK)
+ {
+ /* Move the argument into gui_argv, which
+ * will later be passed to gtk_init_check() */
+ gui_argv[gui_argc++] = argv[i];
+ }
+ else
+ {
+ char *value = NULL;
+
+ /* Extract the option's value if there is one.
+ * Accept both "--foo bar" and "--foo=bar" style. */
+ if (option->flags & ARG_HAS_VALUE)
+ {
+ if (argv[i][len] == '=')
+ value = &argv[i][len + 1];
+ else if (i + 1 < *argc && strcmp(argv[i + 1], "--") != 0)
+ value = argv[i + 1];
+ }
+
+ /* Check for options handled by Vim itself */
+ switch (option->flags & ARG_INDEX_MASK)
+ {
+ case ARG_REVERSE:
+ found_reverse_arg = TRUE;
+ break;
+ case ARG_NOREVERSE:
+ found_reverse_arg = FALSE;
+ break;
+ case ARG_FONT:
+ font_argument = value;
+ break;
+ case ARG_GEOMETRY:
+ if (value != NULL)
+ gui.geom = vim_strsave((char_u *)value);
+ break;
+ case ARG_BACKGROUND:
+ background_argument = value;
+ break;
+ case ARG_FOREGROUND:
+ foreground_argument = value;
+ break;
+ case ARG_ICONIC:
+ found_iconic_arg = TRUE;
+ break;
+#ifdef HAVE_GTK2
+ case ARG_ROLE:
+ role_argument = value; /* used later in gui_mch_open() */
+ break;
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ case ARG_NETBEANS:
+ ++usingNetbeans;
+ gui.dofork = FALSE; /* don't fork() when starting GUI */
+ netbeansArg = argv[i];
+ break;
+#endif
+ default:
+ break;
+ }
+ }
+
+ /* These arguments make gnome_program_init() print a message and exit.
+ * Must start the GUI for this, otherwise ":gui" will exit later! */
+ if (option->flags & ARG_NEEDS_GUI)
+ gui.starting = TRUE;
+
+ if (option->flags & ARG_KEEP)
+ ++i;
+ else
+ {
+ /* Remove the flag from the argument vector. */
+ if (--*argc > i)
+ {
+ int n_strip = 1;
+
+ /* Move the argument's value as well, if there is one. */
+ if ((option->flags & ARG_HAS_VALUE)
+ && argv[i][len] != '='
+ && strcmp(argv[i + 1], "--") != 0)
+ {
+ ++n_strip;
+ --*argc;
+ if (option->flags & ARG_FOR_GTK)
+ gui_argv[gui_argc++] = argv[i + 1];
+ }
+
+ if (*argc > i)
+ mch_memmove(&argv[i], &argv[i + n_strip],
+ (*argc - i) * sizeof(char *));
+ }
+ argv[*argc] = NULL;
+ }
+ }
+
+ gui_argv[gui_argc] = NULL;
+}
+
+/*
+ * This should be maybe completely removed.
+ * Doesn't seem possible, since check_copy_area() relies on
+ * this information. --danielk
+ */
+/*ARGSUSED*/
+ static gint
+visibility_event(GtkWidget *widget, GdkEventVisibility *event, gpointer data)
+{
+ gui.visibility = event->state;
+ /*
+ * When we do an gdk_window_copy_area(), and the window is partially
+ * obscured, we want to receive an event to tell us whether it worked
+ * or not.
+ */
+ if (gui.text_gc != NULL)
+ gdk_gc_set_exposures(gui.text_gc,
+ gui.visibility != GDK_VISIBILITY_UNOBSCURED);
+ return FALSE;
+}
+
+/*
+ * Redraw the corresponding portions of the screen.
+ */
+/*ARGSUSED*/
+ static gint
+expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+{
+ /* Skip this when the GUI isn't set up yet, will redraw later. */
+ if (gui.starting)
+ return FALSE;
+
+ out_flush(); /* make sure all output has been processed */
+ gui_redraw(event->area.x, event->area.y,
+ event->area.width, event->area.height);
+
+ /* Clear the border areas if needed */
+ if (event->area.x < FILL_X(0))
+ gdk_window_clear_area(gui.drawarea->window, 0, 0, FILL_X(0), 0);
+ if (event->area.y < FILL_Y(0))
+ gdk_window_clear_area(gui.drawarea->window, 0, 0, 0, FILL_Y(0));
+ if (event->area.x > FILL_X(Columns))
+ gdk_window_clear_area(gui.drawarea->window,
+ FILL_X((int)Columns), 0, 0, 0);
+ if (event->area.y > FILL_Y(Rows))
+ gdk_window_clear_area(gui.drawarea->window, 0, FILL_Y((int)Rows), 0, 0);
+
+ return FALSE;
+}
+
+#ifdef FEAT_CLIENTSERVER
+/*
+ * Handle changes to the "Comm" property
+ */
+/*ARGSUSED2*/
+ static gint
+property_event(GtkWidget *widget, GdkEventProperty *event, gpointer data)
+{
+ if (event->type == GDK_PROPERTY_NOTIFY
+ && event->state == (int)GDK_PROPERTY_NEW_VALUE
+ && GDK_WINDOW_XWINDOW(event->window) == commWindow
+ && GET_X_ATOM(event->atom) == commProperty)
+ {
+ XEvent xev;
+
+ /* Translate to XLib */
+ xev.xproperty.type = PropertyNotify;
+ xev.xproperty.atom = commProperty;
+ xev.xproperty.window = commWindow;
+ xev.xproperty.state = PropertyNewValue;
+ serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+ }
+ return FALSE;
+}
+#endif
+
+
+/****************************************************************************
+ * Focus handlers:
+ */
+
+
+/*
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+
+#define BLINK_NONE 0
+#define BLINK_OFF 1
+#define BLINK_ON 2
+
+static int blink_state = BLINK_NONE;
+static long_u blink_waittime = 700;
+static long_u blink_ontime = 400;
+static long_u blink_offtime = 250;
+static guint blink_timer = 0;
+
+ void
+gui_mch_set_blinking(long waittime, long on, long off)
+{
+ blink_waittime = waittime;
+ blink_ontime = on;
+ blink_offtime = off;
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink(void)
+{
+ if (blink_timer)
+ {
+ gtk_timeout_remove(blink_timer);
+ blink_timer = 0;
+ }
+ if (blink_state == BLINK_OFF)
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_NONE;
+}
+
+/*ARGSUSED*/
+ static gint
+blink_cb(gpointer data)
+{
+ if (blink_state == BLINK_ON)
+ {
+ gui_undraw_cursor();
+ blink_state = BLINK_OFF;
+ blink_timer = gtk_timeout_add((guint32)blink_offtime,
+ (GtkFunction) blink_cb, NULL);
+ }
+ else
+ {
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_ON;
+ blink_timer = gtk_timeout_add((guint32)blink_ontime,
+ (GtkFunction) blink_cb, NULL);
+ }
+
+ return FALSE; /* don't happen again */
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink(void)
+{
+ if (blink_timer)
+ gtk_timeout_remove(blink_timer);
+ /* Only switch blinking on if none of the times is zero */
+ if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
+ {
+ blink_timer = gtk_timeout_add((guint32)blink_waittime,
+ (GtkFunction) blink_cb, NULL);
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }
+}
+
+/*ARGSUSED*/
+ static gint
+enter_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
+{
+ if (blink_state == BLINK_NONE)
+ gui_mch_start_blink();
+
+ /* make sure keyboard input goes there */
+ if (gtk_socket_id == 0 || !GTK_WIDGET_HAS_FOCUS(gui.drawarea))
+ gtk_widget_grab_focus(gui.drawarea);
+
+ return FALSE;
+}
+
+/*ARGSUSED*/
+ static gint
+leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
+{
+ if (blink_state != BLINK_NONE)
+ gui_mch_stop_blink();
+
+ return FALSE;
+}
+
+/*ARGSUSED*/
+ static gint
+focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
+{
+ gui_focus_change(TRUE);
+
+ if (blink_state == BLINK_NONE)
+ gui_mch_start_blink();
+
+ /* make sure keyboard input goes there */
+ if (gtk_socket_id == 0)
+ gtk_widget_grab_focus(gui.drawarea);
+
+ return TRUE;
+}
+
+/*ARGSUSED*/
+ static gint
+focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
+{
+ gui_focus_change(FALSE);
+
+ if (blink_state != BLINK_NONE)
+ gui_mch_stop_blink();
+
+ return TRUE;
+}
+
+
+#ifdef HAVE_GTK2
+/*
+ * Translate a GDK key value to UTF-8 independently of the current locale.
+ * The output is written to string, which must have room for at least 6 bytes
+ * plus the NUL terminator. Returns the length in bytes.
+ *
+ * This function is used in the GTK+ 2 GUI only. The GTK+ 1 code makes use
+ * of GdkEventKey::string instead. But event->string is evil; see here why:
+ * http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html#GdkEventKey
+ */
+ static int
+keyval_to_string(unsigned int keyval, unsigned int state, char_u *string)
+{
+ int len;
+ guint32 uc;
+
+ uc = gdk_keyval_to_unicode(keyval);
+ if (uc != 0)
+ {
+ /* Check for CTRL-foo */
+ if ((state & GDK_CONTROL_MASK) && uc >= 0x20 && uc < 0x80)
+ {
+ /* These mappings look arbitrary at the first glance, but in fact
+ * resemble quite exactly the behaviour of the GTK+ 1.2 GUI on my
+ * machine. The only difference is BS vs. DEL for CTRL-8 (makes
+ * more sense and is consistent with usual terminal behaviour). */
+ if (uc >= '@')
+ string[0] = uc & 0x1F;
+ else if (uc == '2')
+ string[0] = NUL;
+ else if (uc >= '3' && uc <= '7')
+ string[0] = uc ^ 0x28;
+ else if (uc == '8')
+ string[0] = BS;
+ else if (uc == '?')
+ string[0] = DEL;
+ else
+ string[0] = uc;
+ len = 1;
+ }
+ else
+ {
+ /* Translate a normal key to UTF-8. This doesn't work for dead
+ * keys of course, you _have_ to use an input method for that. */
+ len = utf_char2bytes((int)uc, string);
+ }
+ }
+ else
+ {
+ /* Translate keys which are represented by ASCII control codes in Vim.
+ * There are only a few of those; most control keys are translated to
+ * special terminal-like control sequences. */
+ len = 1;
+ switch (keyval)
+ {
+ case GDK_Tab: case GDK_KP_Tab: case GDK_ISO_Left_Tab:
+ string[0] = TAB;
+ break;
+ case GDK_Linefeed:
+ string[0] = NL;
+ break;
+ case GDK_Return: case GDK_ISO_Enter: case GDK_3270_Enter:
+ string[0] = CAR;
+ break;
+ case GDK_Escape:
+ string[0] = ESC;
+ break;
+ default:
+ len = 0;
+ break;
+ }
+ }
+ string[len] = NUL;
+
+ return len;
+}
+#endif /* HAVE_GTK2 */
+
+/*
+ * Main keyboard handler:
+ */
+/*ARGSUSED*/
+ static gint
+key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+#ifdef HAVE_GTK2
+ /* 256 bytes is way over the top, but for safety let's reduce it only
+ * for GTK+ 2 where we know for sure how large the string might get.
+ * (That is, up to 6 bytes + NUL + CSI escapes + safety measure.) */
+ char_u string[32], string2[32];
+#else
+ char_u string[256], string2[256];
+#endif
+ guint key_sym;
+ int len;
+ int i;
+ int modifiers;
+ int key;
+ guint state;
+ char_u *s, *d;
+
+ key_sym = event->keyval;
+ state = event->state;
+#ifndef HAVE_GTK2 /* deprecated */
+ len = event->length;
+ g_assert(len <= sizeof(string));
+#endif
+
+#ifndef HAVE_GTK2
+ /*
+ * It appears as if we always want to consume a key-press (there currently
+ * aren't any 'return FALSE's), so we always do this: when running in a
+ * GtkPlug and not a window, we must prevent emission of the key_press
+ * EVENT from continuing (which is 'beyond' the level of stopping mere
+ * signals by returning FALSE), otherwise things like tab/cursor-keys are
+ * processed by the GtkPlug default handler, which moves input focus away
+ * from us!
+ * Note: This should no longer be necessary with GTK+ 2.
+ */
+ if (gtk_socket_id != 0)
+ gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event");
+#endif
+
+#ifdef FEAT_XIM
+ if (xim_queue_key_press_event(event, TRUE))
+ return TRUE;
+#endif
+
+#ifdef FEAT_HANGULIN
+ if (key_sym == GDK_space && (state & GDK_SHIFT_MASK))
+ {
+ hangul_input_state_toggle();
+ return TRUE;
+ }
+#endif
+
+#ifdef SunXK_F36
+ /*
+ * These keys have bogus lookup strings, and trapping them here is
+ * easier than trying to XRebindKeysym() on them with every possible
+ * combination of modifiers.
+ */
+ if (key_sym == SunXK_F36 || key_sym == SunXK_F37)
+ len = 0;
+ else
+#endif
+ {
+#ifdef HAVE_GTK2
+ len = keyval_to_string(key_sym, state, string2);
+
+ /* Careful: convert_input() doesn't handle the NUL character.
+ * No need to convert pure ASCII anyway, thus the len > 1 check. */
+ if (len > 1 && input_conv.vc_type != CONV_NONE)
+ len = convert_input(string2, len, sizeof(string2));
+
+ s = string2;
+#else
+# ifdef FEAT_MBYTE
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ mch_memmove(string2, event->string, len);
+ len = convert_input(string2, len, sizeof(string2));
+ s = string2;
+ }
+ else
+# endif
+ s = (char_u *)event->string;
+#endif
+
+ d = string;
+ for (i = 0; i < len; ++i)
+ {
+ *d++ = s[i];
+ if (d[-1] == CSI && d + 2 < string + sizeof(string))
+ {
+ /* Turn CSI into K_CSI. */
+ *d++ = KS_EXTRA;
+ *d++ = (int)KE_CSI;
+ }
+ }
+ len = d - string;
+ }
+
+ /* Shift-Tab results in Left_Tab, but we want <S-Tab> */
+ if (key_sym == GDK_ISO_Left_Tab)
+ {
+ key_sym = GDK_Tab;
+ state |= GDK_SHIFT_MASK;
+ }
+
+#ifndef HAVE_GTK2 /* for GTK+ 2, we handle this in keyval_to_string() */
+ if ((key_sym == GDK_2 || key_sym == GDK_at) && (state & GDK_CONTROL_MASK))
+ {
+ string[0] = NUL; /* CTRL-2 and CTRL-@ is NUL */
+ len = 1;
+ }
+ else if (len == 0 && (key_sym == GDK_space || key_sym == GDK_Tab))
+ {
+ /* When there are modifiers, these keys get zero length; we need the
+ * original key here to be able to add a modifier below. */
+ string[0] = (key_sym & 0xff);
+ len = 1;
+ }
+#endif
+
+#ifdef FEAT_MENU
+ /* If there is a menu and 'wak' is "yes", or 'wak' is "menu" and the key
+ * is a menu shortcut, we ignore everything with the ALT modifier. */
+ if ((state & GDK_MOD1_MASK)
+ && gui.menu_is_active
+ && (*p_wak == 'y'
+ || (*p_wak == 'm'
+ && len == 1
+ && gui_is_menu_shortcut(string[0]))))
+# ifdef HAVE_GTK2
+ /* For GTK2 we return false to signify that we haven't handled the
+ * keypress, so that gtk will handle the mnemonic or accelerator. */
+ return FALSE;
+# else
+ return TRUE;
+# endif
+#endif
+
+ /* Check for Alt/Meta key (Mod1Mask), but not for a BS, DEL or character
+ * that already has the 8th bit set.
+ * Don't do this for <S-M-Tab>, that should become K_S_TAB with ALT.
+ * Don't do this for double-byte encodings, it turns the char into a lead
+ * byte. */
+ if (len == 1
+ && (state & GDK_MOD1_MASK)
+ && !(key_sym == GDK_BackSpace || key_sym == GDK_Delete)
+ && (string[0] & 0x80) == 0
+ && !(key_sym == GDK_Tab && (state & GDK_SHIFT_MASK))
+#ifdef FEAT_MBYTE
+ && !enc_dbcs
+#endif
+ )
+ {
+ string[0] |= 0x80;
+ state &= ~GDK_MOD1_MASK; /* don't use it again */
+#ifdef FEAT_MBYTE
+ if (enc_utf8) /* convert to utf-8 */
+ {
+ string[1] = string[0] & 0xbf;
+ string[0] = ((unsigned)string[0] >> 6) + 0xc0;
+ if (string[1] == CSI)
+ {
+ string[2] = KS_EXTRA;
+ string[3] = (int)KE_CSI;
+ len = 4;
+ }
+ else
+ len = 2;
+ }
+#endif
+ }
+
+ /* Check for special keys. Also do this when len == 1 (key has an ASCII
+ * value) to detect backspace, delete and keypad keys. */
+ if (len == 0 || len == 1)
+ {
+ for (i = 0; special_keys[i].key_sym != 0; i++)
+ {
+ if (special_keys[i].key_sym == key_sym)
+ {
+ string[0] = CSI;
+ string[1] = special_keys[i].code0;
+ string[2] = special_keys[i].code1;
+ len = -3;
+ break;
+ }
+ }
+ }
+
+ if (len == 0) /* Unrecognized key */
+ return TRUE;
+
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) && !defined(HAVE_GTK2)
+ /* Cancel or type backspace. For GTK2, im_commit_cb() does the same. */
+ preedit_start_col = MAXCOL;
+ xim_changed_while_preediting = TRUE;
+#endif
+
+ /* Special keys (and a few others) may have modifiers. Also when using a
+ * double-byte encoding (can't set the 8th bit). */
+ if (len == -3 || key_sym == GDK_space || key_sym == GDK_Tab
+ || key_sym == GDK_Return || key_sym == GDK_Linefeed
+ || key_sym == GDK_Escape || key_sym == GDK_KP_Tab
+ || key_sym == GDK_ISO_Enter || key_sym == GDK_3270_Enter
+#ifdef FEAT_MBYTE
+ || (enc_dbcs && len == 1 && (state & GDK_MOD1_MASK))
+#endif
+ )
+ {
+ modifiers = 0;
+ if (state & GDK_SHIFT_MASK)
+ modifiers |= MOD_MASK_SHIFT;
+ if (state & GDK_CONTROL_MASK)
+ modifiers |= MOD_MASK_CTRL;
+ if (state & GDK_MOD1_MASK)
+ modifiers |= MOD_MASK_ALT;
+
+ /*
+ * For some keys a shift modifier is translated into another key
+ * code.
+ */
+ if (len == -3)
+ key = TO_SPECIAL(string[1], string[2]);
+ else
+ key = string[0];
+
+ key = simplify_key(key, &modifiers);
+ if (key == CSI)
+ key = K_CSI;
+ if (IS_SPECIAL(key))
+ {
+ string[0] = CSI;
+ string[1] = K_SECOND(key);
+ string[2] = K_THIRD(key);
+ len = 3;
+ }
+ else
+ {
+ string[0] = key;
+ len = 1;
+ }
+
+ if (modifiers != 0)
+ {
+ string2[0] = CSI;
+ string2[1] = KS_MODIFIER;
+ string2[2] = modifiers;
+ add_to_input_buf(string2, 3);
+ }
+ }
+
+ if (len == 1 && ((string[0] == Ctrl_C && ctrl_c_interrupts)
+ || (string[0] == intr_char && intr_char != Ctrl_C)))
+ {
+ trash_input_buf();
+ got_int = TRUE;
+ }
+
+ add_to_input_buf(string, len);
+
+ /* blank out the pointer if necessary */
+ if (p_mh)
+ gui_mch_mousehide(TRUE);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ return TRUE;
+}
+
+#if defined(FEAT_XIM) && defined(HAVE_GTK2)
+/*ARGSUSED0*/
+ static gboolean
+key_release_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+ /*
+ * GTK+ 2 input methods may do fancy stuff on key release events too.
+ * With the default IM for instance, you can enter any UCS code point
+ * by holding down CTRL-SHIFT and typing hexadecimal digits.
+ */
+ return xim_queue_key_press_event(event, FALSE);
+}
+#endif
+
+
+/****************************************************************************
+ * Selection handlers:
+ */
+
+/*ARGSUSED*/
+ static gint
+selection_clear_event(GtkWidget *widget,
+ GdkEventSelection *event,
+ gpointer user_data)
+{
+ if (event->selection == clip_plus.gtk_sel_atom)
+ clip_lose_selection(&clip_plus);
+ else
+ clip_lose_selection(&clip_star);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ return TRUE;
+}
+
+#define RS_NONE 0 /* selection_received_cb() not called yet */
+#define RS_OK 1 /* selection_received_cb() called and OK */
+#define RS_FAIL 2 /* selection_received_cb() called and failed */
+static int received_selection = RS_NONE;
+
+/*ARGSUSED*/
+ static void
+selection_received_cb(GtkWidget *widget,
+ GtkSelectionData *data,
+ guint time_,
+ gpointer user_data)
+{
+ VimClipboard *cbd;
+ char_u *text;
+ char_u *tmpbuf = NULL;
+#ifdef HAVE_GTK2
+ guchar *tmpbuf_utf8 = NULL;
+#endif
+ int len;
+ int motion_type;
+
+ if (data->selection == clip_plus.gtk_sel_atom)
+ cbd = &clip_plus;
+ else
+ cbd = &clip_star;
+
+ text = (char_u *)data->data;
+ len = data->length;
+ motion_type = MCHAR;
+
+ if (text == NULL || len <= 0)
+ {
+ received_selection = RS_FAIL;
+ /* clip_free_selection(cbd); ??? */
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ return;
+ }
+
+ if (data->type == vim_atom)
+ {
+ motion_type = *text++;
+ --len;
+ }
+
+#ifdef FEAT_MBYTE
+ else if (data->type == vimenc_atom)
+ {
+ char_u *enc;
+ vimconv_T conv;
+
+ motion_type = *text++;
+ --len;
+
+ enc = text;
+ text += STRLEN(text) + 1;
+ len -= text - enc;
+
+ /* If the encoding of the text is different from 'encoding', attempt
+ * converting it. */
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, enc, p_enc);
+ if (conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&conv, text, &len);
+ if (tmpbuf != NULL)
+ text = tmpbuf;
+ convert_setup(&conv, NULL, NULL);
+ }
+ }
+#endif
+
+#ifdef HAVE_GTK2
+ /* gtk_selection_data_get_text() handles all the nasty details
+ * and targets and encodings etc. This rocks so hard. */
+ else
+ {
+ tmpbuf_utf8 = gtk_selection_data_get_text(data);
+ if (tmpbuf_utf8 != NULL)
+ {
+ len = STRLEN(tmpbuf_utf8);
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&input_conv, tmpbuf_utf8, &len);
+ if (tmpbuf != NULL)
+ text = tmpbuf;
+ }
+ else
+ text = tmpbuf_utf8;
+ }
+ }
+#else /* !HAVE_GTK2 */
+# ifdef FEAT_MBYTE
+ else if (data->type == utf8_string_atom)
+ {
+ vimconv_T conv;
+
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, (char_u *)"utf-8", p_enc);
+
+ if (conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&conv, text, &len);
+ convert_setup(&conv, NULL, NULL);
+ }
+ if (tmpbuf != NULL)
+ text = tmpbuf;
+ }
+# endif
+ else if (data->type == compound_text_atom || data->type == text_atom)
+ {
+ char **list = NULL;
+ int count;
+ int i;
+ unsigned tmplen = 0;
+
+ count = gdk_text_property_to_text_list(data->type, data->format,
+ data->data, data->length,
+ &list);
+ for (i = 0; i < count; ++i)
+ tmplen += strlen(list[i]);
+
+ tmpbuf = alloc(tmplen + 1);
+ if (tmpbuf != NULL)
+ {
+ tmpbuf[0] = NUL;
+ for (i = 0; i < count; ++i)
+ STRCAT(tmpbuf, list[i]);
+ text = tmpbuf;
+ len = tmplen;
+ }
+
+ if (list != NULL)
+ gdk_free_text_list(list);
+ }
+#endif /* !HAVE_GTK2 */
+
+ clip_yank_selection(motion_type, text, (long)len, cbd);
+ received_selection = RS_OK;
+ vim_free(tmpbuf);
+#ifdef HAVE_GTK2
+ g_free(tmpbuf_utf8);
+#endif
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * Prepare our selection data for passing it to the external selection
+ * client.
+ */
+/*ARGSUSED*/
+ static void
+selection_get_cb(GtkWidget *widget,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time_,
+ gpointer user_data)
+{
+ char_u *string;
+ char_u *tmpbuf;
+ long_u tmplen;
+ int length;
+ int motion_type;
+ GdkAtom type;
+ VimClipboard *cbd;
+
+ if (selection_data->selection == clip_plus.gtk_sel_atom)
+ cbd = &clip_plus;
+ else
+ cbd = &clip_star;
+
+ if (!cbd->owned)
+ return; /* Shouldn't ever happen */
+
+ if (info != (guint)TARGET_STRING
+#ifdef FEAT_MBYTE
+ && info != (guint)TARGET_UTF8_STRING
+ && info != (guint)TARGET_VIMENC
+#endif
+ && info != (guint)TARGET_VIM
+ && info != (guint)TARGET_COMPOUND_TEXT
+ && info != (guint)TARGET_TEXT)
+ return;
+
+ /* get the selection from the '*'/'+' register */
+ clip_get_selection(cbd);
+
+ motion_type = clip_convert_selection(&string, &tmplen, cbd);
+ if (motion_type < 0 || string == NULL)
+ return;
+ /* Due to int arguments we can't handle more than G_MAXINT. Also
+ * reserve one extra byte for NUL or the motion type; just in case.
+ * (Not that pasting 2G of text is ever going to work, but... ;-) */
+ length = MIN(tmplen, (long_u)(G_MAXINT - 1));
+
+ if (info == (guint)TARGET_VIM)
+ {
+ tmpbuf = alloc((unsigned)length + 1);
+ if (tmpbuf != NULL)
+ {
+ tmpbuf[0] = motion_type;
+ mch_memmove(tmpbuf + 1, string, (size_t)length);
+ }
+ /* For our own format, the first byte contains the motion type */
+ ++length;
+ vim_free(string);
+ string = tmpbuf;
+ type = vim_atom;
+ }
+
+#ifdef FEAT_MBYTE
+ else if (info == (guint)TARGET_VIMENC)
+ {
+ int l = STRLEN(p_enc);
+
+ /* contents: motion_type 'encoding' NUL text */
+ tmpbuf = alloc((unsigned)length + l + 2);
+ if (tmpbuf != NULL)
+ {
+ tmpbuf[0] = motion_type;
+ STRCPY(tmpbuf + 1, p_enc);
+ mch_memmove(tmpbuf + l + 2, string, (size_t)length);
+ }
+ length += l + 2;
+ vim_free(string);
+ string = tmpbuf;
+ type = vimenc_atom;
+ }
+#endif
+
+#ifdef HAVE_GTK2
+ /* gtk_selection_data_set_text() handles everything for us. This is
+ * so easy and simple and cool, it'd be insane not to use it. */
+ else
+ {
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&output_conv, string, &length);
+ vim_free(string);
+ if (tmpbuf == NULL)
+ return;
+ string = tmpbuf;
+ }
+ /* Validate the string to avoid runtime warnings */
+ if (g_utf8_validate((const char *)string, (gssize)length, NULL))
+ {
+ gtk_selection_data_set_text(selection_data,
+ (const char *)string, length);
+ }
+ vim_free(string);
+ return;
+ }
+#else /* !HAVE_GTK2 */
+# ifdef FEAT_MBYTE
+ else if (info == (guint)TARGET_UTF8_STRING)
+ {
+ vimconv_T conv;
+
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, p_enc, (char_u *)"utf-8");
+
+ if (conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&conv, string, &length);
+ convert_setup(&conv, NULL, NULL);
+ vim_free(string);
+ string = tmpbuf;
+ }
+ type = utf8_string_atom;
+ }
+# endif
+ else if (info == (guint)TARGET_COMPOUND_TEXT
+ || info == (guint)TARGET_TEXT)
+ {
+ int format;
+
+ /* Copy the string to ensure NUL-termination */
+ tmpbuf = vim_strnsave(string, length);
+ vim_free(string);
+ if (tmpbuf != NULL)
+ {
+ gdk_string_to_compound_text((const char *)tmpbuf,
+ &type, &format, &string, &length);
+ vim_free(tmpbuf);
+ selection_data->type = type;
+ selection_data->format = format;
+ gtk_selection_data_set(selection_data, type, format, string, length);
+ gdk_free_compound_text(string);
+ }
+ return;
+ }
+ else
+ {
+ type = GDK_TARGET_STRING;
+ }
+#endif /* !HAVE_GTK2 */
+
+ if (string != NULL)
+ {
+ selection_data->type = selection_data->target;
+ selection_data->format = 8; /* 8 bits per char */
+
+ gtk_selection_data_set(selection_data, type, 8, string, length);
+ vim_free(string);
+ }
+}
+
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check(void)
+{
+#ifndef HAVE_GTK2
+ /* This is needed to make the locale handling consistant between the GUI
+ * and the rest of VIM. */
+ gtk_set_locale();
+#endif
+
+#ifdef FEAT_GUI_GNOME
+ if (gtk_socket_id == 0)
+ using_gnome = 1;
+#endif
+
+ /* Don't use gtk_init() or gnome_init(), it exits on failure. */
+ if (!gtk_init_check(&gui_argc, &gui_argv))
+ {
+ gui.dying = TRUE;
+ EMSG(_(e_opendisp));
+ return FAIL;
+ }
+
+ return OK;
+}
+
+
+/****************************************************************************
+ * Mouse handling callbacks
+ */
+
+
+static guint mouse_click_timer = 0;
+static int mouse_timed_out = TRUE;
+
+/*
+ * Timer used to recognize multiple clicks of the mouse button
+ */
+ static gint
+mouse_click_timer_cb(gpointer data)
+{
+ /* we don't use this information currently */
+ int *timed_out = (int *) data;
+
+ *timed_out = TRUE;
+ return FALSE; /* don't happen again */
+}
+
+static guint motion_repeat_timer = 0;
+static int motion_repeat_offset = FALSE;
+static gint motion_repeat_timer_cb(gpointer);
+
+ static void
+process_motion_notify(int x, int y, GdkModifierType state)
+{
+ int button;
+ int_u vim_modifiers;
+
+ button = (state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
+ GDK_BUTTON3_MASK | GDK_BUTTON4_MASK |
+ GDK_BUTTON5_MASK))
+ ? MOUSE_DRAG : ' ';
+
+ /* If our pointer is currently hidden, then we should show it. */
+ gui_mch_mousehide(FALSE);
+
+ /* Just moving the rodent above the drawing area without any button
+ * being pressed. */
+ if (button != MOUSE_DRAG)
+ {
+ gui_mouse_moved(x, y);
+ return;
+ }
+
+ /* translate modifier coding between the main engine and GTK */
+ vim_modifiers = 0x0;
+ if (state & GDK_SHIFT_MASK)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (state & GDK_CONTROL_MASK)
+ vim_modifiers |= MOUSE_CTRL;
+ if (state & GDK_MOD1_MASK)
+ vim_modifiers |= MOUSE_ALT;
+
+ /* inform the editor engine about the occurence of this event */
+ gui_send_mouse_event(button, x, y, FALSE, vim_modifiers);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ /*
+ * Auto repeat timer handling.
+ */
+ if (x < 0 || y < 0
+ || x >= gui.drawarea->allocation.width
+ || y >= gui.drawarea->allocation.height)
+ {
+
+ int dx;
+ int dy;
+ int offshoot;
+ int delay = 10;
+
+ /* Calculate the maximal distance of the cursor from the drawing area.
+ * (offshoot can't become negative here!).
+ */
+ dx = x < 0 ? -x : x - gui.drawarea->allocation.width;
+ dy = y < 0 ? -y : y - gui.drawarea->allocation.height;
+
+ offshoot = dx > dy ? dx : dy;
+
+ /* Make a linearly declaying timer delay with a threshold of 5 at a
+ * distance of 127 pixels from the main window.
+ *
+ * One could think endlessly about the most ergonomic variant here.
+ * For example it could make sense to calculate the distance from the
+ * drags start instead...
+ *
+ * Maybe a parabolic interpolation would suite us better here too...
+ */
+ if (offshoot > 127)
+ {
+ /* 5 appears to be somehow near to my perceptual limits :-). */
+ delay = 5;
+ }
+ else
+ {
+ delay = (130 * (127 - offshoot)) / 127 + 5;
+ }
+
+ /* shoot again */
+ if (!motion_repeat_timer)
+ motion_repeat_timer = gtk_timeout_add((guint32)delay,
+ motion_repeat_timer_cb, NULL);
+ }
+}
+
+/*
+ * Timer used to recognize multiple clicks of the mouse button.
+ */
+/*ARGSUSED0*/
+ static gint
+motion_repeat_timer_cb(gpointer data)
+{
+ int x;
+ int y;
+ GdkModifierType state;
+
+ gdk_window_get_pointer(gui.drawarea->window, &x, &y, &state);
+
+ if (!(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
+ GDK_BUTTON3_MASK | GDK_BUTTON4_MASK |
+ GDK_BUTTON5_MASK)))
+ {
+ motion_repeat_timer = 0;
+ return FALSE;
+ }
+
+ /* If there already is a mouse click in the input buffer, wait another
+ * time (otherwise we would create a backlog of clicks) */
+ if (vim_used_in_input_buf() > 10)
+ return TRUE;
+
+ motion_repeat_timer = 0;
+
+ /*
+ * Fake a motion event.
+ * Trick: Pretend the mouse moved to the next character on every other
+ * event, otherwise drag events will be discarded, because they are still
+ * in the same character.
+ */
+ if (motion_repeat_offset)
+ x += gui.char_width;
+
+ motion_repeat_offset = !motion_repeat_offset;
+ process_motion_notify(x, y, state);
+
+ /* Don't happen again. We will get reinstalled in the synthetic event
+ * if needed -- thus repeating should still work. */
+ return FALSE;
+}
+
+/*ARGSUSED2*/
+ static gint
+motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
+{
+ if (event->is_hint)
+ {
+ int x;
+ int y;
+ GdkModifierType state;
+
+ gdk_window_get_pointer(widget->window, &x, &y, &state);
+ process_motion_notify(x, y, state);
+ }
+ else
+ {
+ process_motion_notify((int)event->x, (int)event->y,
+ (GdkModifierType)event->state);
+ }
+
+ return TRUE; /* handled */
+}
+
+
+/*
+ * Mouse button handling. Note please that we are capturing multiple click's
+ * by our own timeout mechanism instead of the one provided by GTK+ itself.
+ * This is due to the way the generic VIM code is recognizing multiple clicks.
+ */
+/*ARGSUSED2*/
+ static gint
+button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ int button;
+ int repeated_click = FALSE;
+ int x, y;
+ int_u vim_modifiers;
+
+ /* Make sure we have focus now we've been selected */
+ if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
+ gtk_widget_grab_focus(widget);
+
+ /*
+ * Don't let additional events about multiple clicks send by GTK to us
+ * after the initial button press event confuse us.
+ */
+ if (event->type != GDK_BUTTON_PRESS)
+ return FALSE;
+
+ x = event->x;
+ y = event->y;
+
+ /* Handle multiple clicks */
+ if (!mouse_timed_out && mouse_click_timer)
+ {
+ gtk_timeout_remove(mouse_click_timer);
+ mouse_click_timer = 0;
+ repeated_click = TRUE;
+ }
+
+ mouse_timed_out = FALSE;
+ mouse_click_timer = gtk_timeout_add((guint32)p_mouset,
+ mouse_click_timer_cb, &mouse_timed_out);
+
+ switch (event->button)
+ {
+ case 1:
+ button = MOUSE_LEFT;
+ break;
+ case 2:
+ button = MOUSE_MIDDLE;
+ break;
+ case 3:
+ button = MOUSE_RIGHT;
+ break;
+#ifndef HAVE_GTK2
+ case 4:
+ button = MOUSE_4;
+ break;
+ case 5:
+ button = MOUSE_5;
+ break;
+#endif
+ default:
+ return FALSE; /* Unknown button */
+ }
+
+#ifdef FEAT_XIM
+ /* cancel any preediting */
+ if (im_is_preediting())
+ xim_reset();
+#endif
+
+ vim_modifiers = 0x0;
+ if (event->state & GDK_SHIFT_MASK)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (event->state & GDK_CONTROL_MASK)
+ vim_modifiers |= MOUSE_CTRL;
+ if (event->state & GDK_MOD1_MASK)
+ vim_modifiers |= MOUSE_ALT;
+
+ gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
+ if (gtk_main_level() > 0)
+ gtk_main_quit(); /* make sure the above will be handled immediately */
+
+ return TRUE;
+}
+
+#ifdef HAVE_GTK2
+/*
+ * GTK+ 2 doesn't handle mouse buttons 4, 5, 6 and 7 the same way as GTK+ 1.
+ * Instead, it abstracts scrolling via the new GdkEventScroll.
+ */
+/*ARGSUSED2*/
+ static gboolean
+scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data)
+{
+ int button;
+ int_u vim_modifiers = 0;
+
+ if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
+ gtk_widget_grab_focus(widget);
+
+ switch (event->direction)
+ {
+ case GDK_SCROLL_UP:
+ button = MOUSE_4;
+ break;
+ case GDK_SCROLL_DOWN:
+ button = MOUSE_5;
+ break;
+ default: /* We don't care about left and right... Yet. */
+ return FALSE;
+ }
+
+# ifdef FEAT_XIM
+ /* cancel any preediting */
+ if (im_is_preediting())
+ xim_reset();
+# endif
+
+ if (event->state & GDK_SHIFT_MASK)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (event->state & GDK_CONTROL_MASK)
+ vim_modifiers |= MOUSE_CTRL;
+ if (event->state & GDK_MOD1_MASK)
+ vim_modifiers |= MOUSE_ALT;
+
+ gui_send_mouse_event(button, (int)event->x, (int)event->y,
+ FALSE, vim_modifiers);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit(); /* make sure the above will be handled immediately */
+
+ return TRUE;
+}
+#endif /* HAVE_GTK2 */
+
+
+/*ARGSUSED*/
+ static gint
+button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ int x, y;
+ int_u vim_modifiers;
+
+ /* Remove any motion "machine gun" timers used for automatic further
+ extension of allocation areas if outside of the applications window
+ area .*/
+ if (motion_repeat_timer)
+ {
+ gtk_timeout_remove(motion_repeat_timer);
+ motion_repeat_timer = 0;
+ }
+
+ x = event->x;
+ y = event->y;
+
+ vim_modifiers = 0x0;
+ if (event->state & GDK_SHIFT_MASK)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (event->state & GDK_CONTROL_MASK)
+ vim_modifiers |= MOUSE_CTRL;
+ if (event->state & GDK_MOD1_MASK)
+ vim_modifiers |= MOUSE_ALT;
+
+ gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, vim_modifiers);
+ if (gtk_main_level() > 0)
+ gtk_main_quit(); /* make sure it will be handled immediately */
+
+ return TRUE;
+}
+
+
+#ifdef FEAT_DND
+/****************************************************************************
+ * Drag aNd Drop support handlers.
+ */
+
+/*
+ * Count how many items there may be and separate them with a NUL.
+ * Apparently the items are separated with \r\n. This is not documented,
+ * thus be careful not to go past the end. Also allow separation with
+ * NUL characters.
+ */
+ static int
+count_and_decode_uri_list(char_u *out, char_u *raw, int len)
+{
+ int i;
+ char_u *p = out;
+ int count = 0;
+
+ for (i = 0; i < len; ++i)
+ {
+ if (raw[i] == NUL || raw[i] == '\n' || raw[i] == '\r')
+ {
+ if (p > out && p[-1] != NUL)
+ {
+ ++count;
+ *p++ = NUL;
+ }
+ }
+ else if (raw[i] == '%' && i + 2 < len && hexhex2nr(raw + i + 1) > 0)
+ {
+ *p++ = hexhex2nr(raw + i + 1);
+ i += 2;
+ }
+ else
+ *p++ = raw[i];
+ }
+ if (p > out && p[-1] != NUL)
+ {
+ *p = NUL; /* last item didn't have \r or \n */
+ ++count;
+ }
+ return count;
+}
+
+/*
+ * Parse NUL separated "src" strings. Make it an array "outlist" form. On
+ * this process, URI which protocol is not "file:" are removed. Return
+ * length of array (less than "max").
+ */
+ static int
+filter_uri_list(char_u **outlist, int max, char_u *src)
+{
+ int i, j;
+
+ for (i = j = 0; i < max; ++i)
+ {
+ outlist[i] = NULL;
+ if (STRNCMP(src, "file:", 5) == 0)
+ {
+ src += 5;
+ if (STRNCMP(src, "//localhost", 11) == 0)
+ src += 11;
+ while (src[0] == '/' && src[1] == '/')
+ ++src;
+ outlist[j++] = vim_strsave(src);
+ }
+ src += STRLEN(src) + 1;
+ }
+ return j;
+}
+
+ static char_u **
+parse_uri_list(int *count, char_u *data, int len)
+{
+ int n = 0;
+ char_u *tmp = NULL;
+ char_u **array = NULL;;
+
+ if (data != NULL && len > 0 && (tmp = (char_u *)alloc(len + 1)) != NULL)
+ {
+ n = count_and_decode_uri_list(tmp, data, len);
+ if (n > 0 && (array = (char_u **)alloc(n * sizeof(char_u *))) != NULL)
+ n = filter_uri_list(array, n, tmp);
+ }
+ vim_free(tmp);
+ *count = n;
+ return array;
+}
+
+ static void
+drag_handle_uri_list(GdkDragContext *context,
+ GtkSelectionData *data,
+ guint time_,
+ GdkModifierType state,
+ gint x,
+ gint y)
+{
+ char_u **fnames;
+ int nfiles = 0;
+
+ fnames = parse_uri_list(&nfiles, data->data, data->length);
+
+ if (fnames != NULL && nfiles > 0)
+ {
+ int_u modifiers = 0;
+
+ gtk_drag_finish(context, TRUE, FALSE, time_); /* accept */
+
+ if (state & GDK_SHIFT_MASK)
+ modifiers |= MOUSE_SHIFT;
+ if (state & GDK_CONTROL_MASK)
+ modifiers |= MOUSE_CTRL;
+ if (state & GDK_MOD1_MASK)
+ modifiers |= MOUSE_ALT;
+
+ gui_handle_drop(x, y, modifiers, fnames, nfiles);
+ }
+}
+
+ static void
+drag_handle_text(GdkDragContext *context,
+ GtkSelectionData *data,
+ guint time_,
+ GdkModifierType state)
+{
+ char_u dropkey[6] = {CSI, KS_MODIFIER, 0, CSI, KS_EXTRA, (char_u)KE_DROP};
+ char_u *text;
+ int len;
+# ifdef FEAT_MBYTE
+ char_u *tmpbuf = NULL;
+# endif
+
+ text = data->data;
+ len = data->length;
+
+# ifdef FEAT_MBYTE
+ if (data->type == utf8_string_atom)
+ {
+# ifdef HAVE_GTK2
+ if (input_conv.vc_type != CONV_NONE)
+ tmpbuf = string_convert(&input_conv, text, &len);
+# else
+ vimconv_T conv;
+
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, (char_u *)"utf-8", p_enc);
+
+ if (conv.vc_type != CONV_NONE)
+ {
+ tmpbuf = string_convert(&conv, text, &len);
+ convert_setup(&conv, NULL, NULL);
+ }
+# endif
+ if (tmpbuf != NULL)
+ text = tmpbuf;
+ }
+# endif /* FEAT_MBYTE */
+
+ dnd_yank_drag_data(text, (long)len);
+ gtk_drag_finish(context, TRUE, FALSE, time_); /* accept */
+# ifdef FEAT_MBYTE
+ vim_free(tmpbuf);
+# endif
+
+ if (state & GDK_SHIFT_MASK)
+ dropkey[2] |= MOD_MASK_SHIFT;
+ if (state & GDK_CONTROL_MASK)
+ dropkey[2] |= MOD_MASK_CTRL;
+ if (state & GDK_MOD1_MASK)
+ dropkey[2] |= MOD_MASK_ALT;
+
+ if (dropkey[2] != 0)
+ add_to_input_buf(dropkey, (int)sizeof(dropkey));
+ else
+ add_to_input_buf(dropkey + 3, (int)(sizeof(dropkey) - 3));
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * DND receiver.
+ */
+/*ARGSUSED2*/
+ static void
+drag_data_received_cb(GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint info,
+ guint time_,
+ gpointer user_data)
+{
+ GdkModifierType state;
+
+ /* Guard against trash */
+ if (data->data == NULL
+ || data->length <= 0
+ || data->format != 8
+ || data->data[data->length] != '\0')
+ {
+ gtk_drag_finish(context, FALSE, FALSE, time_);
+ return;
+ }
+
+ /* Get the current modifier state for proper distinguishment between
+ * different operations later. */
+ gdk_window_get_pointer(widget->window, NULL, NULL, &state);
+
+ /* Not sure about the role of "text/plain" here... */
+ if (info == (guint)TARGET_TEXT_URI_LIST)
+ drag_handle_uri_list(context, data, time_, state, x, y);
+ else
+ drag_handle_text(context, data, time_, state);
+
+}
+#endif /* FEAT_DND */
+
+
+#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
+/*
+ * GnomeClient interact callback. Check for unsaved buffers that cannot
+ * be abandoned and pop up a dialog asking the user for confirmation if
+ * necessary.
+ */
+/*ARGSUSED0*/
+ static void
+sm_client_check_changed_any(GnomeClient *client,
+ gint key,
+ GnomeDialogType type,
+ gpointer data)
+{
+ cmdmod_T save_cmdmod;
+ gboolean shutdown_cancelled;
+
+ save_cmdmod = cmdmod;
+
+# ifdef FEAT_BROWSE
+ cmdmod.browse = TRUE;
+# endif
+# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ cmdmod.confirm = TRUE;
+# endif
+ /*
+ * If there are changed buffers, present the user with
+ * a dialog if possible, otherwise give an error message.
+ */
+ shutdown_cancelled = check_changed_any(FALSE);
+
+ exiting = FALSE;
+ cmdmod = save_cmdmod;
+ setcursor(); /* position the cursor */
+ out_flush();
+ /*
+ * If the user hit the [Cancel] button the whole shutdown
+ * will be cancelled. Wow, quite powerful feature (:
+ */
+ gnome_interaction_key_return(key, shutdown_cancelled);
+}
+
+/*
+ * Generate a script that can be used to restore the current editing session.
+ * Save the value of v:this_session before running :mksession in order to make
+ * automagic session save fully transparent. Return TRUE on success.
+ */
+ static int
+write_session_file(char_u *filename)
+{
+ char_u *escaped_filename;
+ char *mksession_cmdline;
+ unsigned int save_ssop_flags;
+ int failed;
+
+ /*
+ * Build an ex command line to create a script that restores the current
+ * session if executed. Escape the filename to avoid nasty surprises.
+ */
+ escaped_filename = vim_strsave_escaped(filename, escape_chars);
+ if (escaped_filename == NULL)
+ return FALSE;
+ mksession_cmdline = g_strconcat("mksession ", (char *)escaped_filename, NULL);
+ vim_free(escaped_filename);
+ /*
+ * Use a reasonable hardcoded set of 'sessionoptions' flags to avoid
+ * unpredictable effects when the session is saved automatically. Also,
+ * we definitely need SSOP_GLOBALS to be able to restore v:this_session.
+ * Don't use SSOP_BUFFERS to prevent the buffer list from becoming
+ * enormously large if the GNOME session feature is used regularly.
+ */
+ save_ssop_flags = ssop_flags;
+ ssop_flags = (SSOP_BLANK|SSOP_CURDIR|SSOP_FOLDS|SSOP_GLOBALS
+ |SSOP_HELP|SSOP_OPTIONS|SSOP_WINSIZE);
+
+ do_cmdline_cmd((char_u *)"let Save_VV_this_session = v:this_session");
+ failed = (do_cmdline_cmd((char_u *)mksession_cmdline) == FAIL);
+ do_cmdline_cmd((char_u *)"let v:this_session = Save_VV_this_session");
+ do_unlet((char_u *)"Save_VV_this_session");
+
+ ssop_flags = save_ssop_flags;
+ g_free(mksession_cmdline);
+ /*
+ * Reopen the file and append a command to restore v:this_session,
+ * as if this save never happened. This is to avoid conflicts with
+ * the user's own sessions. FIXME: It's probably less hackish to add
+ * a "stealth" flag to 'sessionoptions' -- gotta ask Bram.
+ */
+ if (!failed)
+ {
+ FILE *fd;
+
+ fd = open_exfile(filename, TRUE, APPENDBIN);
+
+ failed = (fd == NULL
+ || put_line(fd, "let v:this_session = Save_VV_this_session") == FAIL
+ || put_line(fd, "unlet Save_VV_this_session") == FAIL);
+
+ if (fd != NULL && fclose(fd) != 0)
+ failed = TRUE;
+
+ if (failed)
+ mch_remove(filename);
+ }
+
+ return !failed;
+}
+
+/*
+ * "save_yourself" signal handler. Initiate an interaction to ask the user
+ * for confirmation if necessary. Save the current editing session and tell
+ * the session manager how to restart Vim.
+ */
+/*ARGSUSED1*/
+ static gboolean
+sm_client_save_yourself(GnomeClient *client,
+ gint phase,
+ GnomeSaveStyle save_style,
+ gboolean shutdown,
+ GnomeInteractStyle interact_style,
+ gboolean fast,
+ gpointer data)
+{
+ static const char suffix[] = "-session.vim";
+ char *session_file;
+ unsigned int len;
+ gboolean success;
+
+ /* Always request an interaction if possible. check_changed_any()
+ * won't actually show a dialog unless any buffers have been modified.
+ * There doesn't seem to be an obvious way to check that without
+ * automatically firing the dialog. Anyway, it works just fine. */
+ if (interact_style == GNOME_INTERACT_ANY)
+ gnome_client_request_interaction(client, GNOME_DIALOG_NORMAL,
+ &sm_client_check_changed_any,
+ NULL);
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+
+ /* The path is unique for each session save. We do neither know nor care
+ * which session script will actually be used later. This decision is in
+ * the domain of the session manager. */
+ session_file = gnome_config_get_real_path(
+ gnome_client_get_config_prefix(client));
+ len = strlen(session_file);
+
+ if (len > 0 && session_file[len-1] == G_DIR_SEPARATOR)
+ --len; /* get rid of the superfluous trailing '/' */
+
+ session_file = g_renew(char, session_file, len + sizeof(suffix));
+ memcpy(session_file + len, suffix, sizeof(suffix));
+
+ success = write_session_file((char_u *)session_file);
+
+ if (success)
+ {
+ const char *argv[8];
+ int i;
+
+ /* Tell the session manager how to wipe out the stored session data.
+ * This isn't as dangerous as it looks, don't worry :) session_file
+ * is a unique absolute filename. Usually it'll be something like
+ * `/home/user/.gnome2/vim-XXXXXX-session.vim'. */
+ i = 0;
+ argv[i++] = "rm";
+ argv[i++] = session_file;
+ argv[i] = NULL;
+
+ gnome_client_set_discard_command(client, i, (char **)argv);
+
+ /* Tell the session manager how to restore the just saved session.
+ * This is easily done thanks to Vim's -S option. Pass the -f flag
+ * since there's no need to fork -- it might even cause confusion.
+ * Also pass the window role to give the WM something to match on.
+ * The role is set in gui_mch_open(), thus should _never_ be NULL. */
+ i = 0;
+ argv[i++] = restart_command;
+ argv[i++] = "-f";
+ argv[i++] = "-g";
+# ifdef HAVE_GTK2
+ argv[i++] = "--role";
+ argv[i++] = gtk_window_get_role(GTK_WINDOW(gui.mainwin));
+# endif
+ argv[i++] = "-S";
+ argv[i++] = session_file;
+ argv[i] = NULL;
+
+ gnome_client_set_restart_command(client, i, (char **)argv);
+ gnome_client_set_clone_command(client, 0, NULL);
+ }
+
+ g_free(session_file);
+
+ return success;
+}
+
+/*
+ * Called when the session manager wants us to die. There isn't much to save
+ * here since "save_yourself" has been emitted before (unless serious trouble
+ * is happening).
+ */
+/*ARGSUSED0*/
+ static void
+sm_client_die(GnomeClient *client, gpointer data)
+{
+ /* Don't write messages to the GUI anymore */
+ full_screen = FALSE;
+
+ STRNCPY(IObuff, _("Vim: Received \"die\" request from session manager\n"),
+ IOSIZE);
+ IObuff[IOSIZE - 1] = NUL;
+ preserve_exit();
+}
+
+/*
+ * Connect our signal handlers to be notified on session save and shutdown.
+ */
+ static void
+setup_save_yourself(void)
+{
+ GnomeClient *client;
+
+ client = gnome_master_client();
+
+ if (client != NULL)
+ {
+ /* Must use the deprecated gtk_signal_connect() for compatibility
+ * with GNOME 1. Arrgh, zombies! */
+ gtk_signal_connect(GTK_OBJECT(client), "save_yourself",
+ GTK_SIGNAL_FUNC(&sm_client_save_yourself), NULL);
+ gtk_signal_connect(GTK_OBJECT(client), "die",
+ GTK_SIGNAL_FUNC(&sm_client_die), NULL);
+ }
+}
+
+#else /* !(FEAT_GUI_GNOME && FEAT_SESSION) */
+
+# ifdef USE_XSMP
+/*
+ * GTK tells us that XSMP needs attention
+ */
+/*ARGSUSED*/
+ static gboolean
+local_xsmp_handle_requests(source, condition, data)
+ GIOChannel *source;
+ GIOCondition condition;
+ gpointer data;
+{
+ if (condition == G_IO_IN)
+ {
+ /* Do stuff; maybe close connection */
+ if (xsmp_handle_requests() == FAIL)
+ g_io_channel_unref((GIOChannel *)data);
+ return TRUE;
+ }
+ /* Error */
+ g_io_channel_unref((GIOChannel *)data);
+ xsmp_close();
+ return TRUE;
+}
+# endif /* USE_XSMP */
+
+/*
+ * Setup the WM_PROTOCOLS to indicate we want the WM_SAVE_YOURSELF event.
+ * This is an ugly use of X functions. GTK doesn't offer an alternative.
+ */
+ static void
+setup_save_yourself(void)
+{
+ Atom *existing_atoms = NULL;
+ int count = 0;
+
+#ifdef USE_XSMP
+ if (xsmp_icefd != -1)
+ {
+ /*
+ * Use XSMP is preference to legacy WM_SAVE_YOURSELF;
+ * set up GTK IO monitor
+ */
+ GIOChannel *g_io = g_io_channel_unix_new(xsmp_icefd);
+
+ g_io_add_watch(g_io, G_IO_IN | G_IO_ERR | G_IO_HUP,
+ local_xsmp_handle_requests, (gpointer)g_io);
+ }
+ else
+#endif
+ {
+ /* Fall back to old method */
+
+ /* first get the existing value */
+ if (XGetWMProtocols(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window),
+ &existing_atoms, &count))
+ {
+ Atom *new_atoms;
+ Atom save_yourself_xatom;
+ int i;
+
+ save_yourself_xatom = GET_X_ATOM(save_yourself_atom);
+
+ /* check if WM_SAVE_YOURSELF isn't there yet */
+ for (i = 0; i < count; ++i)
+ if (existing_atoms[i] == save_yourself_xatom)
+ break;
+
+ if (i == count)
+ {
+ /* allocate an Atoms array which is one item longer */
+ new_atoms = (Atom *)alloc((unsigned)((count + 1)
+ * sizeof(Atom)));
+ if (new_atoms != NULL)
+ {
+ memcpy(new_atoms, existing_atoms, count * sizeof(Atom));
+ new_atoms[count] = save_yourself_xatom;
+ XSetWMProtocols(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window),
+ new_atoms, count + 1);
+ vim_free(new_atoms);
+ }
+ }
+ XFree(existing_atoms);
+ }
+ }
+}
+
+# ifdef HAVE_GTK2
+/*
+ * Installing a global event filter seems to be the only way to catch
+ * client messages of type WM_PROTOCOLS without overriding GDK's own
+ * client message event filter. Well, that's still better than trying
+ * to guess what the GDK filter had done if it had been invoked instead
+ * (This is what we did for GTK+ 1.2, see below).
+ *
+ * GTK2_FIXME: This doesn't seem to work. For some reason we never
+ * receive WM_SAVE_YOURSELF even though everything is set up correctly.
+ * I have the nasty feeling modern session managers just don't send this
+ * deprecated message anymore. Addition: confirmed by several people.
+ *
+ * The GNOME session support is much cooler anyway. Unlike this ugly
+ * WM_SAVE_YOURSELF hack it actually stores the session... And yes,
+ * it should work with KDE as well.
+ */
+/*ARGSUSED1*/
+ static GdkFilterReturn
+global_event_filter(GdkXEvent *xev, GdkEvent *event, gpointer data)
+{
+ XEvent *xevent = (XEvent *)xev;
+
+ if (xevent != NULL
+ && xevent->type == ClientMessage
+ && xevent->xclient.message_type == GET_X_ATOM(wm_protocols_atom)
+ && xevent->xclient.data.l[0] == GET_X_ATOM(save_yourself_atom))
+ {
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+ /*
+ * Set the window's WM_COMMAND property, to let the window manager
+ * know we are done saving ourselves. We don't want to be
+ * restarted, thus set argv to NULL.
+ */
+ XSetCommand(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window),
+ NULL, 0);
+ return GDK_FILTER_REMOVE;
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+# else /* !HAVE_GTK2 */
+
+/*
+ * GDK handler for X ClientMessage events.
+ */
+/*ARGSUSED2*/
+ static GdkFilterReturn
+gdk_wm_protocols_filter(GdkXEvent *xev, GdkEvent *event, gpointer data)
+{
+ /* From example in gdkevents.c/gdk_wm_protocols_filter */
+ XEvent *xevent = (XEvent *)xev;
+
+ if (xevent != NULL)
+ {
+ if (xevent->xclient.data.l[0] == GET_X_ATOM(save_yourself_atom))
+ {
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+
+ /* Set the window's WM_COMMAND property, to let the window manager
+ * know we are done saving ourselves. We don't want to be
+ * restarted, thus set argv to NULL. */
+ XSetCommand(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window),
+ NULL, 0);
+ }
+ /*
+ * Functionality from gdkevents.c/gdk_wm_protocols_filter;
+ * Registering this filter apparently overrides the default GDK one,
+ * so we need to perform its functionality. There seems no way to
+ * register for WM_PROTOCOLS, and only process the WM_SAVE_YOURSELF
+ * bit; it's all or nothing. Update: No, there is a way -- but it
+ * only works with GTK+ 2 apparently. See above.
+ */
+ else if (xevent->xclient.data.l[0] == GET_X_ATOM(gdk_wm_delete_window))
+ {
+ event->any.type = GDK_DELETE;
+ return GDK_FILTER_TRANSLATE;
+ }
+ }
+
+ return GDK_FILTER_REMOVE;
+}
+# endif /* !HAVE_GTK2 */
+
+#endif /* !(FEAT_GUI_GNOME && FEAT_SESSION) */
+
+
+/*
+ * Setup the window icon & xcmdsrv comm after the main window has been realized.
+ */
+/*ARGSUSED*/
+ static void
+mainwin_realize(GtkWidget *widget, gpointer data)
+{
+/* If you get an error message here, you still need to unpack the runtime
+ * archive! */
+#ifdef magick
+# undef magick
+#endif
+#ifdef HAVE_GTK2
+ /* A bit hackish, but avoids casting later and allows optimization */
+# define static static const
+#endif
+#define magick vim32x32
+#include "../runtime/vim32x32.xpm"
+#undef magick
+#define magick vim16x16
+#include "../runtime/vim16x16.xpm"
+#undef magick
+#define magick vim48x48
+#include "../runtime/vim48x48.xpm"
+#undef magick
+#ifdef HAVE_GTK2
+# undef static
+#endif
+
+ /* When started with "--echo-wid" argument, write window ID on stdout. */
+ if (echo_wid_arg)
+ {
+ printf("WID: %ld\n", (long)GDK_WINDOW_XWINDOW(gui.mainwin->window));
+ fflush(stdout);
+ }
+
+ if (vim_strchr(p_go, GO_ICON) != NULL)
+ {
+ /*
+ * Add an icon to the main window. For fun and convenience of the user.
+ */
+#ifdef HAVE_GTK2
+ GList *icons = NULL;
+
+ icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data(vim16x16));
+ icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data(vim32x32));
+ icons = g_list_prepend(icons, gdk_pixbuf_new_from_xpm_data(vim48x48));
+
+ gtk_window_set_icon_list(GTK_WINDOW(gui.mainwin), icons);
+
+ g_list_foreach(icons, (GFunc)&g_object_unref, NULL);
+ g_list_free(icons);
+
+#else /* !HAVE_GTK2 */
+
+ GdkPixmap *icon;
+ GdkBitmap *icon_mask = NULL;
+ char **magick = vim32x32;
+ Display *xdisplay;
+ Window root_window;
+ XIconSize *size;
+ int number_sizes;
+ /*
+ * Adjust the icon to the preferences of the actual window manager.
+ * This is once again a workaround for a defficiency in GTK+ 1.2.
+ */
+ xdisplay = GDK_WINDOW_XDISPLAY(gui.mainwin->window);
+ root_window = XRootWindow(xdisplay, DefaultScreen(xdisplay));
+ if (XGetIconSizes(xdisplay, root_window, &size, &number_sizes))
+ {
+ if (number_sizes > 0)
+ {
+ if (size->max_height >= 48 && size->max_height >= 48)
+ magick = vim48x48;
+ else if (size->max_height >= 32 && size->max_height >= 32)
+ magick = vim32x32;
+ else if (size->max_height >= 16 && size->max_height >= 16)
+ magick = vim16x16;
+ }
+ XFree(size);
+ }
+ icon = gdk_pixmap_create_from_xpm_d(gui.mainwin->window,
+ &icon_mask, NULL, magick);
+ if (icon != NULL)
+ /* Note: for some reason gdk_window_set_icon() doesn't acquire
+ * a reference on the pixmap, thus we _have_ to leak it. */
+ gdk_window_set_icon(gui.mainwin->window, NULL, icon, icon_mask);
+
+#endif /* !HAVE_GTK2 */
+ }
+
+#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
+ /* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */
+# ifdef HAVE_GTK2
+ gdk_window_add_filter(NULL, &global_event_filter, NULL);
+# else
+ gdk_add_client_message_filter(wm_protocols_atom,
+ &gdk_wm_protocols_filter, NULL);
+# endif
+#endif
+ /* Setup to indicate to the window manager that we want to catch the
+ * WM_SAVE_YOURSELF event. For GNOME, this connects to the session
+ * manager instead. */
+#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
+ if (using_gnome)
+#endif
+ setup_save_yourself();
+
+#ifdef FEAT_CLIENTSERVER
+ if (serverName == NULL && serverDelayedStartName != NULL)
+ {
+ /* This is a :gui command in a plain vim with no previous server */
+ commWindow = GDK_WINDOW_XWINDOW(gui.mainwin->window);
+
+ (void)serverRegisterName(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ serverDelayedStartName);
+ }
+ else
+ {
+ /*
+ * Cannot handle "XLib-only" windows with gtk event routines, we'll
+ * have to change the "server" registration to that of the main window
+ * If we have not registered a name yet, remember the window
+ */
+ serverChangeRegisteredWindow(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window));
+ }
+ gtk_widget_add_events(gui.mainwin, GDK_PROPERTY_CHANGE_MASK);
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "property_notify_event",
+ GTK_SIGNAL_FUNC(property_event), NULL);
+#endif
+}
+
+ static GdkCursor *
+create_blank_pointer(void)
+{
+ GdkWindow *root_window = NULL;
+ GdkPixmap *blank_mask;
+ GdkCursor *cursor;
+ GdkColor color = { 0, 0, 0, 0 };
+ char blank_data[] = { 0x0 };
+
+#ifdef HAVE_GTK_MULTIHEAD
+ root_window = gtk_widget_get_root_window(gui.mainwin);
+#endif
+
+ /* Create a pseudo blank pointer, which is in fact one pixel by one pixel
+ * in size. */
+ blank_mask = gdk_bitmap_create_from_data(root_window, blank_data, 1, 1);
+ cursor = gdk_cursor_new_from_pixmap(blank_mask, blank_mask,
+ &color, &color, 0, 0);
+ gdk_bitmap_unref(blank_mask);
+
+ return cursor;
+}
+
+#ifdef HAVE_GTK_MULTIHEAD
+/*ARGSUSED1*/
+ static void
+mainwin_screen_changed_cb(GtkWidget *widget,
+ GdkScreen *previous_screen,
+ gpointer data)
+{
+ if (!gtk_widget_has_screen(widget))
+ return;
+
+ /*
+ * Recreate the invisble mouse cursor.
+ */
+ if (gui.blank_pointer != NULL)
+ gdk_cursor_unref(gui.blank_pointer);
+
+ gui.blank_pointer = create_blank_pointer();
+
+ if (gui.pointer_hidden && gui.drawarea->window != NULL)
+ gdk_window_set_cursor(gui.drawarea->window, gui.blank_pointer);
+
+ /*
+ * Create a new PangoContext for this screen, and initialize it
+ * with the current font if necessary.
+ */
+ if (gui.text_context != NULL)
+ g_object_unref(gui.text_context);
+
+ gui.text_context = gtk_widget_create_pango_context(widget);
+ pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
+
+ if (gui.norm_font != NULL)
+ {
+ gui_mch_init_font(p_guifont, 0);
+ gui_set_shellsize(FALSE, FALSE);
+ }
+}
+#endif /* HAVE_GTK_MULTIHEAD */
+
+/*
+ * After the drawing area comes up, we calculate all colors and create the
+ * dummy blank cursor.
+ *
+ * Don't try to set any VIM scrollbar sizes anywhere here. I'm relying on the
+ * fact that the main VIM engine doesn't take them into account anywhere.
+ */
+/*ARGSUSED1*/
+ static void
+drawarea_realize_cb(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *sbar;
+
+#ifdef FEAT_XIM
+ xim_init();
+#endif
+ gui_mch_new_colors();
+ gui.text_gc = gdk_gc_new(gui.drawarea->window);
+
+ gui.blank_pointer = create_blank_pointer();
+ if (gui.pointer_hidden)
+ gdk_window_set_cursor(widget->window, gui.blank_pointer);
+
+ /* get the actual size of the scrollbars, if they are realized */
+ sbar = firstwin->w_scrollbars[SBAR_LEFT].id;
+ if (!sbar || (!gui.which_scrollbars[SBAR_LEFT]
+ && firstwin->w_scrollbars[SBAR_RIGHT].id))
+ sbar = firstwin->w_scrollbars[SBAR_RIGHT].id;
+ if (sbar && GTK_WIDGET_REALIZED(sbar) && sbar->allocation.width)
+ gui.scrollbar_width = sbar->allocation.width;
+
+ sbar = gui.bottom_sbar.id;
+ if (sbar && GTK_WIDGET_REALIZED(sbar) && sbar->allocation.height)
+ gui.scrollbar_height = sbar->allocation.height;
+}
+
+/*
+ * Properly clean up on shutdown.
+ */
+/*ARGSUSED0*/
+ static void
+drawarea_unrealize_cb(GtkWidget *widget, gpointer data)
+{
+ /* Don't write messages to the GUI anymore */
+ full_screen = FALSE;
+
+#ifdef FEAT_XIM
+ im_shutdown();
+#endif
+#ifdef HAVE_GTK2
+ if (gui.ascii_glyphs != NULL)
+ {
+ pango_glyph_string_free(gui.ascii_glyphs);
+ gui.ascii_glyphs = NULL;
+ }
+ if (gui.ascii_font != NULL)
+ {
+ g_object_unref(gui.ascii_font);
+ gui.ascii_font = NULL;
+ }
+ g_object_unref(gui.text_context);
+ gui.text_context = NULL;
+
+ g_object_unref(gui.text_gc);
+ gui.text_gc = NULL;
+
+ gdk_cursor_unref(gui.blank_pointer);
+ gui.blank_pointer = NULL;
+#else
+ gdk_gc_unref(gui.text_gc);
+ gui.text_gc = NULL;
+
+ gdk_cursor_destroy(gui.blank_pointer);
+ gui.blank_pointer = NULL;
+#endif
+}
+
+/*ARGSUSED0*/
+ static void
+drawarea_style_set_cb(GtkWidget *widget,
+ GtkStyle *previous_style,
+ gpointer data)
+{
+ gui_mch_new_colors();
+}
+
+/*
+ * Callback routine for the "delete_event" signal on the toplevel window.
+ * Tries to vim gracefully, or refuses to exit with changed buffers.
+ */
+/*ARGSUSED*/
+ static gint
+delete_event_cb(GtkWidget *widget, GdkEventAny *event, gpointer data)
+{
+ gui_shell_closed();
+ return TRUE;
+}
+
+#ifdef FEAT_TOOLBAR
+
+# ifdef HAVE_GTK2
+/*
+ * This extra effort wouldn't be necessary if we only used stock icons in the
+ * toolbar, as we do for all builtin icons. But user-defined toolbar icons
+ * shouldn't be treated differently, thus we do need this.
+ */
+ static void
+icon_size_changed_foreach(GtkWidget *widget, gpointer user_data)
+{
+ if (GTK_IS_IMAGE(widget))
+ {
+ GtkImage *image = (GtkImage *)widget;
+
+ /* User-defined icons are stored in a GtkIconSet */
+ if (gtk_image_get_storage_type(image) == GTK_IMAGE_ICON_SET)
+ {
+ GtkIconSet *icon_set;
+ GtkIconSize icon_size;
+
+ gtk_image_get_icon_set(image, &icon_set, &icon_size);
+ icon_size = (GtkIconSize)(long)user_data;
+
+ gtk_icon_set_ref(icon_set);
+ gtk_image_set_from_icon_set(image, icon_set, icon_size);
+ gtk_icon_set_unref(icon_set);
+ }
+ }
+ else if (GTK_IS_CONTAINER(widget))
+ {
+ gtk_container_foreach((GtkContainer *)widget,
+ &icon_size_changed_foreach,
+ user_data);
+ }
+}
+# endif /* HAVE_GTK2 */
+
+ static void
+set_toolbar_style(GtkToolbar *toolbar)
+{
+ GtkToolbarStyle style;
+# ifdef HAVE_GTK2
+ GtkIconSize size;
+ GtkIconSize oldsize;
+# endif
+
+# ifdef HAVE_GTK2
+ if ((toolbar_flags & (TOOLBAR_TEXT | TOOLBAR_ICONS | TOOLBAR_HORIZ))
+ == (TOOLBAR_TEXT | TOOLBAR_ICONS | TOOLBAR_HORIZ))
+ style = GTK_TOOLBAR_BOTH_HORIZ;
+ else
+# endif
+ if ((toolbar_flags & (TOOLBAR_TEXT | TOOLBAR_ICONS))
+ == (TOOLBAR_TEXT | TOOLBAR_ICONS))
+ style = GTK_TOOLBAR_BOTH;
+ else if (toolbar_flags & TOOLBAR_TEXT)
+ style = GTK_TOOLBAR_TEXT;
+ else
+ style = GTK_TOOLBAR_ICONS;
+
+ gtk_toolbar_set_style(toolbar, style);
+ gtk_toolbar_set_tooltips(toolbar, (toolbar_flags & TOOLBAR_TOOLTIPS) != 0);
+
+# ifdef HAVE_GTK2
+ switch (tbis_flags)
+ {
+ case TBIS_TINY: size = GTK_ICON_SIZE_MENU; break;
+ case TBIS_SMALL: size = GTK_ICON_SIZE_SMALL_TOOLBAR; break;
+ case TBIS_MEDIUM: size = GTK_ICON_SIZE_BUTTON; break;
+ case TBIS_LARGE: size = GTK_ICON_SIZE_LARGE_TOOLBAR; break;
+ default: size = GTK_ICON_SIZE_INVALID; break;
+ }
+ oldsize = gtk_toolbar_get_icon_size(toolbar);
+
+ if (size == GTK_ICON_SIZE_INVALID)
+ {
+ /* Let global user preferences decide the icon size. */
+ gtk_toolbar_unset_icon_size(toolbar);
+ size = gtk_toolbar_get_icon_size(toolbar);
+ }
+ if (size != oldsize)
+ {
+ gtk_container_foreach(GTK_CONTAINER(toolbar),
+ &icon_size_changed_foreach,
+ GINT_TO_POINTER((int)size));
+ }
+ gtk_toolbar_set_icon_size(toolbar, size);
+# endif
+}
+
+#endif /* FEAT_TOOLBAR */
+
+/*
+ * Initialize the GUI. Create all the windows, set up all the callbacks etc.
+ * Returns OK for success, FAIL when the GUI can't be started.
+ */
+ int
+gui_mch_init(void)
+{
+ GtkWidget *vbox;
+
+#ifdef FEAT_GUI_GNOME
+ /* Initialize the GNOME libraries. gnome_program_init()/gnome_init()
+ * exits on failure, but that's a non-issue because we already called
+ * gtk_init_check() in gui_mch_init_check(). */
+ if (using_gnome)
+# ifdef HAVE_GTK2
+ gnome_program_init(VIMPACKAGE, VIM_VERSION_SHORT,
+ LIBGNOMEUI_MODULE, gui_argc, gui_argv, NULL);
+# else
+ gnome_init(VIMPACKAGE, VIM_VERSION_SHORT, gui_argc, gui_argv);
+# endif
+#endif
+ vim_free(gui_argv);
+ gui_argv = NULL;
+
+#ifdef HAVE_GTK2
+# if GLIB_CHECK_VERSION(2,1,3)
+ /* Set the human-readable application name */
+ g_set_application_name("Vim");
+# endif
+ /*
+ * Force UTF-8 output no matter what the value of 'encoding' is.
+ * did_set_string_option() in option.c prohibits changing 'termencoding'
+ * to something else than UTF-8 if the GUI is in use.
+ */
+ set_option_value((char_u *)"termencoding", 0L, (char_u *)"utf-8", 0);
+
+# ifdef FEAT_TOOLBAR
+ gui_gtk_register_stock_icons();
+# endif
+ /* FIXME: Need to install the classic icons and a gtkrc.classic file.
+ * The hard part is deciding install locations and the Makefile magic. */
+# if 0
+ gtk_rc_parse("gtkrc");
+# endif
+#endif
+
+ /* Initialize values */
+ gui.border_width = 2;
+ gui.scrollbar_width = SB_DEFAULT_WIDTH;
+ gui.scrollbar_height = SB_DEFAULT_WIDTH;
+ gui.fgcolor = g_new0(GdkColor, 1);
+ gui.bgcolor = g_new0(GdkColor, 1);
+
+ /* Initialise atoms */
+#ifdef FEAT_MBYTE
+ utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
+#endif
+#ifndef HAVE_GTK2
+ compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
+ text_atom = gdk_atom_intern("TEXT", FALSE);
+#endif
+
+ /* Set default foreground and background colors. */
+ gui.norm_pixel = gui.def_norm_pixel;
+ gui.back_pixel = gui.def_back_pixel;
+
+ if (gtk_socket_id != 0)
+ {
+ GtkWidget *plug;
+
+ /* Use GtkSocket from another app. */
+#ifdef HAVE_GTK_MULTIHEAD
+ plug = gtk_plug_new_for_display(gdk_display_get_default(),
+ gtk_socket_id);
+#else
+ plug = gtk_plug_new(gtk_socket_id);
+#endif
+ if (plug != NULL && GTK_PLUG(plug)->socket_window != NULL)
+ {
+ gui.mainwin = plug;
+ }
+ else
+ {
+ g_warning("Connection to GTK+ socket (ID %u) failed",
+ (unsigned int)gtk_socket_id);
+ /* Pretend we never wanted it if it failed (get own window) */
+ gtk_socket_id = 0;
+ }
+ }
+
+ if (gtk_socket_id == 0)
+ {
+#ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ {
+ gui.mainwin = gnome_app_new("Vim", NULL);
+# ifdef USE_XSMP
+ /* Use the GNOME save-yourself functionality now. */
+ xsmp_close();
+# endif
+ }
+ else
+#endif
+ gui.mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ }
+
+ gtk_widget_set_name(gui.mainwin, "vim-main-window");
+
+#ifdef HAVE_GTK2
+ /* Create the PangoContext used for drawing all text. */
+ gui.text_context = gtk_widget_create_pango_context(gui.mainwin);
+ pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
+#endif
+
+#ifndef HAVE_GTK2
+ gtk_window_set_policy(GTK_WINDOW(gui.mainwin), TRUE, TRUE, TRUE);
+#endif
+ gtk_container_border_width(GTK_CONTAINER(gui.mainwin), 0);
+ gtk_widget_add_events(gui.mainwin, GDK_VISIBILITY_NOTIFY_MASK);
+
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "delete_event",
+ GTK_SIGNAL_FUNC(&delete_event_cb), NULL);
+
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "realize",
+ GTK_SIGNAL_FUNC(&mainwin_realize), NULL);
+#ifdef HAVE_GTK_MULTIHEAD
+ g_signal_connect(G_OBJECT(gui.mainwin), "screen_changed",
+ G_CALLBACK(&mainwin_screen_changed_cb), NULL);
+#endif
+#ifdef HAVE_GTK2
+ gui.accel_group = gtk_accel_group_new();
+ gtk_window_add_accel_group(GTK_WINDOW(gui.mainwin), gui.accel_group);
+#else
+ gui.accel_group = gtk_accel_group_get_default();
+#endif
+
+ vbox = gtk_vbox_new(FALSE, 0);
+
+#ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ {
+# if defined(HAVE_GTK2) && defined(FEAT_MENU)
+ /* automagically restore menubar/toolbar placement */
+ gnome_app_enable_layout_config(GNOME_APP(gui.mainwin), TRUE);
+# endif
+ gnome_app_set_contents(GNOME_APP(gui.mainwin), vbox);
+ }
+ else
+#endif
+ {
+ gtk_container_add(GTK_CONTAINER(gui.mainwin), vbox);
+ gtk_widget_show(vbox);
+ }
+
+#ifdef FEAT_MENU
+ /*
+ * Create the menubar and handle
+ */
+ gui.menubar = gtk_menu_bar_new();
+ gtk_widget_set_name(gui.menubar, "vim-menubar");
+
+# ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ {
+# ifdef HAVE_GTK2
+ BonoboDockItem *dockitem;
+
+ gnome_app_set_menus(GNOME_APP(gui.mainwin), GTK_MENU_BAR(gui.menubar));
+ dockitem = gnome_app_get_dock_item_by_name(GNOME_APP(gui.mainwin),
+ GNOME_APP_MENUBAR_NAME);
+ gui.menubar_h = GTK_WIDGET(dockitem);
+# else
+ gui.menubar_h = gnome_dock_item_new("VimMainMenu",
+ GNOME_DOCK_ITEM_BEH_EXCLUSIVE |
+ GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
+ gtk_container_add(GTK_CONTAINER(gui.menubar_h), gui.menubar);
+
+ gnome_dock_add_item(GNOME_DOCK(GNOME_APP(gui.mainwin)->dock),
+ GNOME_DOCK_ITEM(gui.menubar_h),
+ GNOME_DOCK_TOP, /* placement */
+ 1, /* band_num */
+ 0, /* band_position */
+ 0, /* offset */
+ TRUE);
+ gtk_widget_show(gui.menubar);
+# endif
+ }
+ else
+# endif /* FEAT_GUI_GNOME */
+ {
+ if (vim_strchr(p_go, GO_MENUS) != NULL)
+ gtk_widget_show(gui.menubar);
+ gtk_box_pack_start(GTK_BOX(vbox), gui.menubar, FALSE, FALSE, 0);
+ }
+#endif /* FEAT_MENU */
+
+#ifdef FEAT_TOOLBAR
+ /*
+ * Create the toolbar and handle
+ */
+# ifdef HAVE_GTK2
+ /* some aesthetics on the toolbar */
+ gtk_rc_parse_string(
+ "style \"vim-toolbar-style\" {\n"
+ " GtkToolbar::button_relief = GTK_RELIEF_NONE\n"
+ "}\n"
+ "widget \"*.vim-toolbar\" style \"vim-toolbar-style\"\n");
+ gui.toolbar = gtk_toolbar_new();
+ gtk_widget_set_name(gui.toolbar, "vim-toolbar");
+# else
+ gui.toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,
+ GTK_TOOLBAR_ICONS);
+ gtk_toolbar_set_button_relief(GTK_TOOLBAR(gui.toolbar), GTK_RELIEF_NONE);
+# endif
+ set_toolbar_style(GTK_TOOLBAR(gui.toolbar));
+
+# ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ {
+# ifdef HAVE_GTK2
+ BonoboDockItem *dockitem;
+
+ gnome_app_set_toolbar(GNOME_APP(gui.mainwin), GTK_TOOLBAR(gui.toolbar));
+ dockitem = gnome_app_get_dock_item_by_name(GNOME_APP(gui.mainwin),
+ GNOME_APP_TOOLBAR_NAME);
+ gui.toolbar_h = GTK_WIDGET(dockitem);
+ gtk_container_set_border_width(GTK_CONTAINER(gui.toolbar), 0);
+# else
+ GtkWidget *dockitem;
+
+ dockitem = gnome_dock_item_new("VimToolBar",
+ GNOME_DOCK_ITEM_BEH_EXCLUSIVE);
+ gtk_container_add(GTK_CONTAINER(dockitem), GTK_WIDGET(gui.toolbar));
+ gui.toolbar_h = dockitem;
+
+ gnome_dock_add_item(GNOME_DOCK(GNOME_APP(gui.mainwin)->dock),
+ GNOME_DOCK_ITEM(dockitem),
+ GNOME_DOCK_TOP, /* placement */
+ 1, /* band_num */
+ 1, /* band_position */
+ 0, /* offset */
+ TRUE);
+ gtk_container_border_width(GTK_CONTAINER(gui.toolbar), 2);
+ gtk_widget_show(gui.toolbar);
+# endif
+ }
+ else
+# endif /* FEAT_GUI_GNOME */
+ {
+# ifndef HAVE_GTK2
+ gtk_container_border_width(GTK_CONTAINER(gui.toolbar), 1);
+# endif
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL
+ && (toolbar_flags & (TOOLBAR_TEXT | TOOLBAR_ICONS)))
+ gtk_widget_show(gui.toolbar);
+ gtk_box_pack_start(GTK_BOX(vbox), gui.toolbar, FALSE, FALSE, 0);
+ }
+#endif /* FEAT_TOOLBAR */
+
+ gui.formwin = gtk_form_new();
+ gtk_container_border_width(GTK_CONTAINER(gui.formwin), 0);
+ gtk_widget_set_events(gui.formwin, GDK_EXPOSURE_MASK);
+
+ gui.drawarea = gtk_drawing_area_new();
+
+ /* Determine which events we will filter. */
+ gtk_widget_set_events(gui.drawarea,
+ GDK_EXPOSURE_MASK |
+ GDK_ENTER_NOTIFY_MASK |
+ GDK_LEAVE_NOTIFY_MASK |
+ GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK |
+#ifdef HAVE_GTK2
+ GDK_SCROLL_MASK |
+#endif
+ GDK_KEY_PRESS_MASK |
+ GDK_KEY_RELEASE_MASK |
+ GDK_POINTER_MOTION_MASK |
+ GDK_POINTER_MOTION_HINT_MASK);
+
+ gtk_widget_show(gui.drawarea);
+ gtk_form_put(GTK_FORM(gui.formwin), gui.drawarea, 0, 0);
+ gtk_widget_show(gui.formwin);
+ gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0);
+
+ /* For GtkSockets, key-presses must go to the focus widget (drawarea)
+ * and not the window. */
+ gtk_signal_connect((gtk_socket_id == 0) ? GTK_OBJECT(gui.mainwin)
+ : GTK_OBJECT(gui.drawarea),
+ "key_press_event",
+ GTK_SIGNAL_FUNC(key_press_event), NULL);
+#if defined(FEAT_XIM) && defined(HAVE_GTK2)
+ /* Also forward key release events for the benefit of GTK+ 2 input
+ * modules. Try CTRL-SHIFT-xdigits to enter a Unicode code point. */
+ g_signal_connect((gtk_socket_id == 0) ? G_OBJECT(gui.mainwin)
+ : G_OBJECT(gui.drawarea),
+ "key_release_event",
+ G_CALLBACK(&key_release_event), NULL);
+#endif
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "realize",
+ GTK_SIGNAL_FUNC(drawarea_realize_cb), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "unrealize",
+ GTK_SIGNAL_FUNC(drawarea_unrealize_cb), NULL);
+
+ gtk_signal_connect_after(GTK_OBJECT(gui.drawarea), "style_set",
+ GTK_SIGNAL_FUNC(&drawarea_style_set_cb), NULL);
+
+ gui.visibility = GDK_VISIBILITY_UNOBSCURED;
+
+#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
+ wm_protocols_atom = gdk_atom_intern("WM_PROTOCOLS", FALSE);
+ save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE);
+#endif
+
+ if (gtk_socket_id != 0)
+ /* make sure keybord input can go to the drawarea */
+ GTK_WIDGET_SET_FLAGS(gui.drawarea, GTK_CAN_FOCUS);
+
+ /*
+ * Set clipboard specific atoms
+ */
+ vim_atom = gdk_atom_intern(VIM_ATOM_NAME, FALSE);
+#ifdef FEAT_MBYTE
+ vimenc_atom = gdk_atom_intern(VIMENC_ATOM_NAME, FALSE);
+#endif
+ clip_star.gtk_sel_atom = GDK_SELECTION_PRIMARY;
+ clip_plus.gtk_sel_atom = gdk_atom_intern("CLIPBOARD", FALSE);
+
+ /*
+ * Start out by adding the configured border width into the border offset.
+ */
+ gui.border_offset = gui.border_width;
+
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "visibility_notify_event",
+ GTK_SIGNAL_FUNC(visibility_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "expose_event",
+ GTK_SIGNAL_FUNC(expose_event), NULL);
+
+ /*
+ * Only install these enter/leave callbacks when 'p' in 'guioptions'.
+ * Only needed for some window managers.
+ */
+ if (vim_strchr(p_go, GO_POINTER) != NULL)
+ {
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "leave_notify_event",
+ GTK_SIGNAL_FUNC(leave_notify_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "enter_notify_event",
+ GTK_SIGNAL_FUNC(enter_notify_event), NULL);
+ }
+
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
+ GTK_SIGNAL_FUNC(focus_out_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
+ GTK_SIGNAL_FUNC(focus_in_event), NULL);
+
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "motion_notify_event",
+ GTK_SIGNAL_FUNC(motion_notify_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "button_press_event",
+ GTK_SIGNAL_FUNC(button_press_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "button_release_event",
+ GTK_SIGNAL_FUNC(button_release_event), NULL);
+#ifdef HAVE_GTK2
+ g_signal_connect(G_OBJECT(gui.drawarea), "scroll_event",
+ G_CALLBACK(&scroll_event), NULL);
+#endif
+
+ /*
+ * Add selection handler functions.
+ */
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_clear_event",
+ GTK_SIGNAL_FUNC(selection_clear_event), NULL);
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_received",
+ GTK_SIGNAL_FUNC(selection_received_cb), NULL);
+
+ /*
+ * Add selection targets for PRIMARY and CLIPBOARD selections.
+ */
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)GDK_SELECTION_PRIMARY,
+ selection_targets, N_SELECTION_TARGETS);
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)clip_plus.gtk_sel_atom,
+ selection_targets, N_SELECTION_TARGETS);
+
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get",
+ GTK_SIGNAL_FUNC(selection_get_cb), NULL);
+
+ /* Pretend we don't have input focus, we will get an event if we do. */
+ gui.in_focus = FALSE;
+
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_gtk_connect();
+# endif
+
+ return OK;
+}
+
+#if (defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) || defined(PROTO)
+/*
+ * This is called from gui_start() after a fork() has been done.
+ * We have to tell the session manager our new PID.
+ */
+ void
+gui_mch_forked(void)
+{
+ if (using_gnome)
+ {
+ GnomeClient *client;
+
+ client = gnome_master_client();
+
+ if (client != NULL)
+ gnome_client_set_process_id(client, getpid());
+ }
+}
+#endif /* FEAT_GUI_GNOME && FEAT_SESSION */
+
+/*
+ * Called when the foreground or background color has been changed.
+ * This used to change the graphics contexts directly but we are
+ * currently manipulating them where desired.
+ */
+ void
+gui_mch_new_colors(void)
+{
+ if (gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
+ GdkColor color = { 0, 0, 0, 0 };
+
+ color.pixel = gui.back_pixel;
+ gdk_window_set_background(gui.drawarea->window, &color);
+ }
+}
+
+#if defined(FEAT_MENU) || defined(FEAT_TOOLBAR)
+ static int
+get_item_dimensions(GtkWidget *widget, GtkOrientation orientation)
+{
+ GtkOrientation item_orientation = GTK_ORIENTATION_HORIZONTAL;
+
+#ifdef FEAT_GUI_GNOME
+ if (using_gnome && widget != NULL)
+ {
+# ifdef HAVE_GTK2
+ BonoboDockItem *dockitem;
+
+ widget = gtk_widget_get_parent(widget);
+ dockitem = BONOBO_DOCK_ITEM(widget);
+
+ if (dockitem == NULL || dockitem->is_floating)
+ return 0;
+ item_orientation = bonobo_dock_item_get_orientation(dockitem);
+# else
+ GnomeDockItem *dockitem;
+
+ widget = widget->parent;
+ dockitem = GNOME_DOCK_ITEM(widget);
+
+ if (dockitem == NULL || dockitem->is_floating)
+ return 0;
+ item_orientation = gnome_dock_item_get_orientation(dockitem);
+# endif
+ }
+#endif
+ if (widget != NULL
+ && item_orientation == orientation
+ && GTK_WIDGET_REALIZED(widget)
+ && GTK_WIDGET_VISIBLE(widget))
+ {
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ return widget->allocation.height;
+ else
+ return widget->allocation.width;
+ }
+ return 0;
+}
+#endif
+
+ static int
+get_menu_tool_width(void)
+{
+ int width = 0;
+
+#ifdef FEAT_GUI_GNOME /* these are never vertical without GNOME */
+# ifdef FEAT_MENU
+ width += get_item_dimensions(gui.menubar, GTK_ORIENTATION_VERTICAL);
+# endif
+# ifdef FEAT_TOOLBAR
+ width += get_item_dimensions(gui.toolbar, GTK_ORIENTATION_VERTICAL);
+# endif
+#endif
+
+ return width;
+}
+
+ static int
+get_menu_tool_height(void)
+{
+ int height = 0;
+
+#ifdef FEAT_MENU
+ height += get_item_dimensions(gui.menubar, GTK_ORIENTATION_HORIZONTAL);
+#endif
+#ifdef FEAT_TOOLBAR
+ height += get_item_dimensions(gui.toolbar, GTK_ORIENTATION_HORIZONTAL);
+#endif
+
+ return height;
+}
+
+ static void
+update_window_manager_hints(void)
+{
+ static int old_width = 0;
+ static int old_height = 0;
+ static int old_char_width = 0;
+ static int old_char_height = 0;
+
+ int width;
+ int height;
+
+ /* This also needs to be done when the main window isn't there yet,
+ * otherwise the hints don't work. */
+ width = gui_get_base_width();
+ height = gui_get_base_height();
+# ifdef HAVE_GTK2
+ width += get_menu_tool_width();
+ height += get_menu_tool_height();
+# endif
+
+ /* Avoid an expose event when the size didn't change. */
+ if (width != old_width
+ || height != old_height
+ || gui.char_width != old_char_width
+ || gui.char_height != old_char_height)
+ {
+ GdkGeometry geometry;
+ GdkWindowHints geometry_mask;
+
+ geometry.width_inc = gui.char_width;
+ geometry.height_inc = gui.char_height;
+ geometry.base_width = width;
+ geometry.base_height = height;
+ geometry.min_width = width + MIN_COLUMNS * gui.char_width;
+ geometry.min_height = height + MIN_LINES * gui.char_height;
+ geometry_mask = GDK_HINT_BASE_SIZE|GDK_HINT_RESIZE_INC
+ |GDK_HINT_MIN_SIZE;
+# ifdef HAVE_GTK2
+ /* Using gui.formwin as geometry widget doesn't work as expected
+ * with GTK+ 2 -- dunno why. Presumably all the resizing hacks
+ * in Vim confuse GTK+. */
+ gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.mainwin,
+ &geometry, geometry_mask);
+# else
+ gtk_window_set_geometry_hints(GTK_WINDOW(gui.mainwin), gui.formwin,
+ &geometry, geometry_mask);
+# endif
+ old_width = width;
+ old_height = height;
+ old_char_width = gui.char_width;
+ old_char_height = gui.char_height;
+ }
+}
+
+/*
+ * This signal informs us about the need to rearrange our sub-widgets.
+ */
+/*ARGSUSED*/
+ static gint
+form_configure_event(GtkWidget *widget, GdkEventConfigure *event,
+ gpointer data)
+{
+ gtk_form_freeze(GTK_FORM(gui.formwin));
+ gui_resize_shell(event->width, event->height);
+ gtk_form_thaw(GTK_FORM(gui.formwin));
+
+ return TRUE;
+}
+
+/*
+ * Function called when window already closed.
+ * We can't do much more here than to trying to preserve what had been done,
+ * since the window is already inevitably going away.
+ */
+/*ARGSUSED0*/
+ static void
+mainwin_destroy_cb(GtkObject *object, gpointer data)
+{
+ /* Don't write messages to the GUI anymore */
+ full_screen = FALSE;
+
+ gui.mainwin = NULL;
+ gui.drawarea = NULL;
+
+ if (!exiting) /* only do anything if the destroy was unexpected */
+ {
+ STRNCPY(IObuff, _("Vim: Main window unexpectedly destroyed\n"),
+ IOSIZE);
+ IObuff[IOSIZE - 1] = NUL;
+ preserve_exit();
+ }
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open(void)
+{
+ guicolor_T fg_pixel = INVALCOLOR;
+ guicolor_T bg_pixel = INVALCOLOR;
+
+#ifdef HAVE_GTK2
+ /*
+ * Allow setting a window role on the command line, or invent one
+ * if none was specified. This is mainly useful for GNOME session
+ * support; allowing the WM to restore window placement.
+ */
+ if (role_argument != NULL)
+ {
+ gtk_window_set_role(GTK_WINDOW(gui.mainwin), role_argument);
+ }
+ else
+ {
+ char *role;
+
+ /* Invent a unique-enough ID string for the role */
+ role = g_strdup_printf("vim-%u-%u-%u",
+ (unsigned)mch_get_pid(),
+ (unsigned)g_random_int(),
+ (unsigned)time(NULL));
+
+ gtk_window_set_role(GTK_WINDOW(gui.mainwin), role);
+ g_free(role);
+ }
+#endif
+
+ if (gui_win_x != -1 && gui_win_y != -1)
+#ifdef HAVE_GTK2
+ gtk_window_move(GTK_WINDOW(gui.mainwin), gui_win_x, gui_win_y);
+#else
+ gtk_widget_set_uposition(gui.mainwin, gui_win_x, gui_win_y);
+#endif
+
+ /* Determine user specified geometry, if present. */
+ if (gui.geom != NULL)
+ {
+ int mask;
+ unsigned int w, h;
+ int x = 0;
+ int y = 0;
+
+ mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h);
+
+ if (mask & WidthValue)
+ Columns = w;
+ if (mask & HeightValue)
+ Rows = h;
+ if (mask & (XValue | YValue))
+#ifdef HAVE_GTK2
+ gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
+#else
+ gtk_widget_set_uposition(gui.mainwin, x, y);
+#endif
+ vim_free(gui.geom);
+ gui.geom = NULL;
+ }
+
+ gtk_form_set_size(GTK_FORM(gui.formwin),
+ (guint)(gui_get_base_width() + Columns * gui.char_width),
+ (guint)(gui_get_base_height() + Rows * gui.char_height));
+ update_window_manager_hints();
+
+ if (foreground_argument != NULL)
+ fg_pixel = gui_get_color((char_u *)foreground_argument);
+ if (fg_pixel == INVALCOLOR)
+ fg_pixel = gui_get_color((char_u *)"Black");
+
+ if (background_argument != NULL)
+ bg_pixel = gui_get_color((char_u *)background_argument);
+ if (bg_pixel == INVALCOLOR)
+ bg_pixel = gui_get_color((char_u *)"White");
+
+ if (found_reverse_arg)
+ {
+ gui.def_norm_pixel = bg_pixel;
+ gui.def_back_pixel = fg_pixel;
+ }
+ else
+ {
+ gui.def_norm_pixel = fg_pixel;
+ gui.def_back_pixel = bg_pixel;
+ }
+
+ /* Get the colors from the "Normal" and "Menu" group (set in syntax.c or
+ * in a vimrc file) */
+ set_normal_colors();
+
+ /* Check that none of the colors are the same as the background color */
+ gui_check_colors();
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them). */
+ highlight_gui_started(); /* re-init colors and fonts */
+
+ gtk_signal_connect(GTK_OBJECT(gui.mainwin), "destroy",
+ GTK_SIGNAL_FUNC(mainwin_destroy_cb), NULL);
+
+#ifdef FEAT_HANGULIN
+ hangul_keyboard_set();
+#endif
+
+ /*
+ * Notify the fixed area about the need to resize the contents of the
+ * gui.formwin, which we use for random positioning of the included
+ * components.
+ *
+ * We connect this signal deferred finally after anything is in place,
+ * since this is intended to handle resizements coming from the window
+ * manager upon us and should not interfere with what VIM is requesting
+ * upon startup.
+ */
+ gtk_signal_connect(GTK_OBJECT(gui.formwin), "configure_event",
+ GTK_SIGNAL_FUNC(form_configure_event), NULL);
+
+#ifdef FEAT_DND
+ /*
+ * Set up for receiving DND items.
+ */
+ gtk_drag_dest_set(gui.drawarea,
+ GTK_DEST_DEFAULT_ALL,
+ dnd_targets, N_DND_TARGETS,
+ GDK_ACTION_COPY);
+
+ gtk_signal_connect(GTK_OBJECT(gui.drawarea), "drag_data_received",
+ GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
+#endif
+
+#ifdef HAVE_GTK2
+ /* With GTK+ 2, we need to iconify the window before calling show()
+ * to avoid mapping the window for a short time. This is just as one
+ * would expect it to work, but it's different in GTK+ 1. The funny
+ * thing is that iconifying after show() _does_ work with GTK+ 1.
+ * (BTW doing this in the "realize" handler makes no difference.) */
+ if (found_iconic_arg && gtk_socket_id == 0)
+ gui_mch_iconify();
+#endif
+
+ {
+#if defined(FEAT_GUI_GNOME) && defined(HAVE_GTK2) && defined(FEAT_MENU)
+ unsigned long menu_handler = 0;
+# ifdef FEAT_TOOLBAR
+ unsigned long tool_handler = 0;
+# endif
+ /*
+ * Urgh hackish :/ For some reason BonoboDockLayout always forces a
+ * show when restoring the saved layout configuration. We can't just
+ * hide the widgets again after gtk_widget_show(gui.mainwin) since it's
+ * a toplevel window and thus will be realized immediately. Instead,
+ * connect signal handlers to hide the widgets just after they've been
+ * marked visible, but before the main window is realized.
+ */
+ if (using_gnome && vim_strchr(p_go, GO_MENUS) == NULL)
+ menu_handler = g_signal_connect_after(gui.menubar_h, "show",
+ G_CALLBACK(&gtk_widget_hide),
+ NULL);
+# ifdef FEAT_TOOLBAR
+ if (using_gnome && vim_strchr(p_go, GO_TOOLBAR) == NULL
+ && (toolbar_flags & (TOOLBAR_TEXT | TOOLBAR_ICONS)))
+ tool_handler = g_signal_connect_after(gui.toolbar_h, "show",
+ G_CALLBACK(&gtk_widget_hide),
+ NULL);
+# endif
+#endif
+ gtk_widget_show(gui.mainwin);
+
+#if defined(FEAT_GUI_GNOME) && defined(HAVE_GTK2) && defined(FEAT_MENU)
+ if (menu_handler != 0)
+ g_signal_handler_disconnect(gui.menubar_h, menu_handler);
+# ifdef FEAT_TOOLBAR
+ if (tool_handler != 0)
+ g_signal_handler_disconnect(gui.toolbar_h, tool_handler);
+# endif
+#endif
+ }
+
+#ifndef HAVE_GTK2
+ /* With GTK+ 1, we need to iconify the window after calling show().
+ * See the comment above for details. */
+ if (found_iconic_arg && gtk_socket_id == 0)
+ gui_mch_iconify();
+#endif
+
+ return OK;
+}
+
+
+/*ARGSUSED0*/
+ void
+gui_mch_exit(int rc)
+{
+ if (gui.mainwin != NULL)
+ gtk_widget_destroy(gui.mainwin);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+#ifdef HAVE_GTK2
+ gtk_window_get_position(GTK_WINDOW(gui.mainwin), x, y);
+#else
+ /* For some people this must be gdk_window_get_origin() for a correct
+ * result. Where is the documentation! */
+ gdk_window_get_root_origin(gui.mainwin->window, x, y);
+#endif
+ return OK;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+#ifdef HAVE_GTK2
+ gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
+#else
+ gdk_window_move(gui.mainwin->window, x, y);
+#endif
+}
+
+#ifdef HAVE_GTK2
+#if 0
+static int resize_idle_installed = FALSE;
+/*
+ * Idle handler to force resize. Used by gui_mch_set_shellsize() to ensure
+ * the shell size doesn't exceed the window size, i.e. if the window manager
+ * ignored our size request. Usually this happens if the window is maximized.
+ *
+ * FIXME: It'd be nice if we could find a little more orthodox solution.
+ * See also the remark below in gui_mch_set_shellsize().
+ *
+ * DISABLED: When doing ":set lines+=1" this function would first invoke
+ * gui_resize_shell() with the old size, then the normal callback would
+ * report the new size through form_configure_event(). That caused the window
+ * layout to be messed up.
+ */
+/*ARGSUSED0*/
+ static gboolean
+force_shell_resize_idle(gpointer data)
+{
+ if (gui.mainwin != NULL
+ && GTK_WIDGET_REALIZED(gui.mainwin)
+ && GTK_WIDGET_VISIBLE(gui.mainwin))
+ {
+ int width;
+ int height;
+
+ gtk_window_get_size(GTK_WINDOW(gui.mainwin), &width, &height);
+
+ width -= get_menu_tool_width();
+ height -= get_menu_tool_height();
+
+ gui_resize_shell(width, height);
+ }
+
+ resize_idle_installed = FALSE;
+ return FALSE; /* don't call me again */
+}
+#endif
+#endif /* HAVE_GTK2 */
+
+/*
+ * Set the windows size.
+ */
+/*ARGSUSED2*/
+ void
+gui_mch_set_shellsize(int width, int height,
+ int min_width, int min_height,
+ int base_width, int base_height)
+{
+#ifndef HAVE_GTK2
+ /* Hack: When the form already is at the desired size, the window might
+ * have been resized with the mouse. Force a resize by setting a
+ * different size first. */
+ if (GTK_FORM(gui.formwin)->width == width
+ && GTK_FORM(gui.formwin)->height == height)
+ {
+ gtk_form_set_size(GTK_FORM(gui.formwin), width + 1, height + 1);
+ gui_mch_update();
+ }
+ gtk_form_set_size(GTK_FORM(gui.formwin), width, height);
+#endif
+
+ /* give GTK+ a chance to put all widget's into place */
+ gui_mch_update();
+
+ /* this will cause the proper resizement to happen too */
+ update_window_manager_hints();
+
+#ifdef HAVE_GTK2
+ /* With GTK+ 2, changing the size of the form widget doesn't resize
+ * the window. So lets do it the other way around and resize the
+ * main window instead. */
+ width += get_menu_tool_width();
+ height += get_menu_tool_height();
+
+ gtk_window_resize(GTK_WINDOW(gui.mainwin), width, height);
+
+#if 0
+ if (!resize_idle_installed)
+ {
+ g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
+ &force_shell_resize_idle, NULL, NULL);
+ resize_idle_installed = TRUE;
+ }
+#endif
+ /*
+ * Wait until all events are processed to prevent a crash because the
+ * real size of the drawing area doesn't reflect Vim's internal ideas.
+ *
+ * This is a bit of a hack, since Vim is a terminal application with a GUI
+ * on top, while the GUI expects to be the boss.
+ */
+ gui_mch_update();
+#endif
+}
+
+
+/*
+ * The screen size is used to make sure the initial window doesn't get bigger
+ * than the screen. This subtracts some room for menubar, toolbar and window
+ * decorations.
+ */
+ void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+#ifdef HAVE_GTK_MULTIHEAD
+ GdkScreen* screen;
+
+ if (gui.mainwin != NULL && gtk_widget_has_screen(gui.mainwin))
+ screen = gtk_widget_get_screen(gui.mainwin);
+ else
+ screen = gdk_screen_get_default();
+
+ *screen_w = gdk_screen_get_width(screen);
+ *screen_h = gdk_screen_get_height(screen) - p_ghr;
+#else
+ *screen_w = gdk_screen_width();
+ /* Subtract 'guiheadroom' from the height to allow some room for the
+ * window manager (task list and window title bar). */
+ *screen_h = gdk_screen_height() - p_ghr;
+#endif
+
+ /*
+ * FIXME: dirty trick: Because the gui_get_base_height() doesn't include
+ * the toolbar and menubar for GTK, we subtract them from the screen
+ * hight, so that the window size can be made to fit on the screen.
+ * This should be completely changed later.
+ */
+ *screen_w -= get_menu_tool_width();
+ *screen_h -= get_menu_tool_height();
+}
+
+#if defined(FEAT_TITLE) || defined(PROTO)
+/*ARGSUSED*/
+ void
+gui_mch_settitle(char_u *title, char_u *icon)
+{
+# ifdef HAVE_GTK2
+ if (title != NULL && output_conv.vc_type != CONV_NONE)
+ title = string_convert(&output_conv, title, NULL);
+# endif
+
+ gtk_window_set_title(GTK_WINDOW(gui.mainwin), (const char *)title);
+
+# ifdef HAVE_GTK2
+ if (output_conv.vc_type != CONV_NONE)
+ vim_free(title);
+# endif
+}
+#endif /* FEAT_TITLE */
+
+#if defined(FEAT_MENU) || defined(PROTO)
+ void
+gui_mch_enable_menu(int showit)
+{
+ GtkWidget *widget;
+
+# ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ widget = gui.menubar_h;
+ else
+# endif
+ widget = gui.menubar;
+
+ if (!showit != !GTK_WIDGET_VISIBLE(widget))
+ {
+ if (showit)
+ gtk_widget_show(widget);
+ else
+ gtk_widget_hide(widget);
+
+ update_window_manager_hints();
+ }
+}
+#endif /* FEAT_MENU */
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_show_toolbar(int showit)
+{
+ GtkWidget *widget;
+
+ if (gui.toolbar == NULL)
+ return;
+
+# ifdef FEAT_GUI_GNOME
+ if (using_gnome)
+ widget = gui.toolbar_h;
+ else
+# endif
+ widget = gui.toolbar;
+
+ if (showit)
+ set_toolbar_style(GTK_TOOLBAR(gui.toolbar));
+
+ if (!showit != !GTK_WIDGET_VISIBLE(widget))
+ {
+ if (showit)
+ gtk_widget_show(widget);
+ else
+ gtk_widget_hide(widget);
+
+ update_window_manager_hints();
+ }
+}
+#endif /* FEAT_TOOLBAR */
+
+#ifndef HAVE_GTK2
+/*
+ * Get a font structure for highlighting.
+ * "cbdata" is a pointer to the global gui structure.
+ */
+/*ARGSUSED*/
+ static void
+font_sel_ok(GtkWidget *wgt, gpointer cbdata)
+{
+ gui_T *vw = (gui_T *)cbdata;
+ GtkFontSelectionDialog *fs = (GtkFontSelectionDialog *)vw->fontdlg;
+
+ if (vw->fontname)
+ g_free(vw->fontname);
+
+ vw->fontname = (char_u *)gtk_font_selection_dialog_get_font_name(fs);
+ gtk_widget_hide(vw->fontdlg);
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*ARGSUSED*/
+ static void
+font_sel_cancel(GtkWidget *wgt, gpointer cbdata)
+{
+ gui_T *vw = (gui_T *)cbdata;
+
+ gtk_widget_hide(vw->fontdlg);
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*ARGSUSED*/
+ static void
+font_sel_destroy(GtkWidget *wgt, gpointer cbdata)
+{
+ gui_T *vw = (gui_T *)cbdata;
+
+ vw->fontdlg = NULL;
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+#endif /* !HAVE_GTK2 */
+
+#ifdef HAVE_GTK2
+/*
+ * Check if a given font is a CJK font. This is done in a very crude manner. It
+ * just see if U+04E00 for zh and ja and U+AC00 for ko are covered in a given
+ * font. Consequently, this function cannot be used as a general purpose check
+ * for CJK-ness for which fontconfig APIs should be used. This is only used by
+ * gui_mch_init_font() to deal with 'CJK fixed width fonts'.
+ */
+ static int
+is_cjk_font(PangoFontDescription *font_desc)
+{
+ static const char * const cjk_langs[] =
+ {"zh_CN", "zh_TW", "zh_HK", "ja", "ko"};
+
+ PangoFont *font;
+ unsigned i;
+ int is_cjk = FALSE;
+
+ font = pango_context_load_font(gui.text_context, font_desc);
+
+ if (font == NULL)
+ return FALSE;
+
+ for (i = 0; !is_cjk && i < G_N_ELEMENTS(cjk_langs); ++i)
+ {
+ PangoCoverage *coverage;
+ gunichar uc;
+
+ coverage = pango_font_get_coverage(
+ font, pango_language_from_string(cjk_langs[i]));
+
+ if (coverage != NULL)
+ {
+ uc = (cjk_langs[i][0] == 'k') ? 0xAC00 : 0x4E00;
+ is_cjk = (pango_coverage_get(coverage, uc) == PANGO_COVERAGE_EXACT);
+ pango_coverage_unref(coverage);
+ }
+ }
+
+ g_object_unref(font);
+
+ return is_cjk;
+}
+#endif /* HAVE_GTK2 */
+
+ int
+gui_mch_adjust_charsize(void)
+{
+#ifdef HAVE_GTK2
+ PangoFontMetrics *metrics;
+ int ascent;
+ int descent;
+
+ metrics = pango_context_get_metrics(gui.text_context, gui.norm_font,
+ pango_context_get_language(gui.text_context));
+ ascent = pango_font_metrics_get_ascent(metrics);
+ descent = pango_font_metrics_get_descent(metrics);
+
+ pango_font_metrics_unref(metrics);
+
+ gui.char_height = (ascent + descent + PANGO_SCALE - 1) / PANGO_SCALE
+ + p_linespace;
+ gui.char_ascent = PANGO_PIXELS(ascent + p_linespace * PANGO_SCALE / 2);
+
+#else /* !HAVE_GTK2 */
+
+ gui.char_height = gui.current_font->ascent + gui.current_font->descent
+ + p_linespace;
+ gui.char_ascent = gui.current_font->ascent + p_linespace / 2;
+
+#endif /* !HAVE_GTK2 */
+
+ /* A not-positive value of char_height may crash Vim. Only happens
+ * if 'linespace' is negative (which does make sense sometimes). */
+ gui.char_ascent = MAX(gui.char_ascent, 0);
+ gui.char_height = MAX(gui.char_height, gui.char_ascent + 1);
+
+ return OK;
+}
+
+#if defined(FEAT_XFONTSET) || defined(PROTO)
+/*
+ * Try to load the requested fontset.
+ */
+/*ARGSUSED2*/
+ GuiFontset
+gui_mch_get_fontset(char_u *name, int report_error, int fixed_width)
+{
+ GdkFont *font;
+
+ if (!gui.in_use || name == NULL)
+ return NOFONT;
+
+ font = gdk_fontset_load((gchar *)name);
+
+ if (font == NULL)
+ {
+ if (report_error)
+ EMSG2(_(e_fontset), name);
+ return NOFONT;
+ }
+ /* TODO: check if the font is fixed width. */
+
+ /* reference this font as being in use */
+ gdk_font_ref(font);
+
+ return (GuiFontset)font;
+}
+#endif /* FEAT_XFONTSET */
+
+#ifndef HAVE_GTK2
+/*
+ * Put up a font dialog and return the selected font name in allocated memory.
+ * "oldval" is the previous value.
+ * Return NULL when cancelled.
+ */
+ char_u *
+gui_mch_font_dialog(char_u *oldval)
+{
+ char_u *fontname = NULL;
+
+ if (!gui.fontdlg)
+ {
+ GtkFontSelectionDialog *fsd = NULL;
+
+ gui.fontdlg = gtk_font_selection_dialog_new(_("Font Selection"));
+ fsd = GTK_FONT_SELECTION_DIALOG(gui.fontdlg);
+ gtk_window_set_modal(GTK_WINDOW(gui.fontdlg), TRUE);
+ gtk_window_set_transient_for(GTK_WINDOW(gui.fontdlg),
+ GTK_WINDOW(gui.mainwin));
+ gtk_signal_connect(GTK_OBJECT(gui.fontdlg), "destroy",
+ GTK_SIGNAL_FUNC(font_sel_destroy), &gui);
+ gtk_signal_connect(GTK_OBJECT(fsd->ok_button), "clicked",
+ GTK_SIGNAL_FUNC(font_sel_ok), &gui);
+ gtk_signal_connect(GTK_OBJECT(fsd->cancel_button), "clicked",
+ GTK_SIGNAL_FUNC(font_sel_cancel), &gui);
+ }
+
+ if (oldval != NULL && *oldval != NUL)
+ gtk_font_selection_dialog_set_font_name(
+ GTK_FONT_SELECTION_DIALOG(gui.fontdlg), (char *)oldval);
+
+ if (gui.fontname)
+ {
+ g_free(gui.fontname);
+ gui.fontname = NULL;
+ }
+ gtk_window_position(GTK_WINDOW(gui.fontdlg), GTK_WIN_POS_MOUSE);
+ gtk_widget_show(gui.fontdlg);
+ {
+ static gchar *spacings[] = {"c", "m", NULL};
+
+ /* In GTK 1.2.3 this must be after the gtk_widget_show() call,
+ * otherwise everything is blocked for ten seconds. */
+ gtk_font_selection_dialog_set_filter(
+ GTK_FONT_SELECTION_DIALOG(gui.fontdlg),
+ GTK_FONT_FILTER_BASE,
+ GTK_FONT_ALL, NULL, NULL,
+ NULL, NULL, spacings, NULL);
+ }
+
+ /* Wait for the font dialog to be closed. */
+ while (gui.fontdlg && GTK_WIDGET_DRAWABLE(gui.fontdlg))
+ gtk_main_iteration_do(TRUE);
+
+ if (gui.fontname != NULL)
+ {
+ fontname = vim_strsave(gui.fontname);
+ g_free(gui.fontname);
+ gui.fontname = NULL;
+ }
+ return fontname;
+}
+#endif /* !HAVE_GTK2 */
+
+#ifdef HAVE_GTK2
+/*
+ * Put up a font dialog and return the selected font name in allocated memory.
+ * "oldval" is the previous value. Return NULL when cancelled.
+ * This should probably go into gui_gtk.c. Hmm.
+ * FIXME:
+ * The GTK2 font selection dialog has no filtering API. So we could either
+ * a) implement our own (possibly copying the code from somewhere else) or
+ * b) just live with it.
+ */
+ char_u *
+gui_mch_font_dialog(char_u *oldval)
+{
+ GtkWidget *dialog;
+ int response;
+ char_u *fontname = NULL;
+ char_u *oldname;
+
+ dialog = gtk_font_selection_dialog_new(NULL);
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(gui.mainwin));
+ gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
+
+ if (oldval != NULL && oldval[0] != NUL)
+ {
+ if (output_conv.vc_type != CONV_NONE)
+ oldname = string_convert(&output_conv, oldval, NULL);
+ else
+ oldname = oldval;
+
+ /* Annoying bug in GTK (or Pango): if the font name does not include a
+ * size, zero is used. Use default point size ten. */
+ if (!vim_isdigit(oldname[STRLEN(oldname) - 1]))
+ {
+ char_u *p = vim_strnsave(oldname, STRLEN(oldname) + 3);
+
+ if (p != NULL)
+ {
+ STRCPY(p + STRLEN(p), " 10");
+ if (oldname != oldval)
+ vim_free(oldname);
+ oldname = p;
+ }
+ }
+
+ gtk_font_selection_dialog_set_font_name(
+ GTK_FONT_SELECTION_DIALOG(dialog), (const char *)oldname);
+
+ if (oldname != oldval)
+ vim_free(oldval);
+ }
+
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+
+ if (response == GTK_RESPONSE_OK)
+ {
+ char *name;
+
+ name = gtk_font_selection_dialog_get_font_name(
+ GTK_FONT_SELECTION_DIALOG(dialog));
+ if (name != NULL)
+ {
+ if (input_conv.vc_type != CONV_NONE)
+ fontname = string_convert(&input_conv, (char_u *)name, NULL);
+ else
+ fontname = vim_strsave((char_u *)name);
+ g_free(name);
+ }
+ }
+
+ if (response != GTK_RESPONSE_NONE)
+ gtk_widget_destroy(dialog);
+
+ return fontname;
+}
+
+/*
+ * Some monospace fonts don't support a bold weight, and fall back
+ * silently to the regular weight. But this is no good since our text
+ * drawing function can emulate bold by overstriking. So let's try
+ * to detect whether bold weight is actually available and emulate it
+ * otherwise.
+ *
+ * Note that we don't need to check for italic style since Xft can
+ * emulate italic on its own, provided you have a proper fontconfig
+ * setup. We wouldn't be able to emulate it in Vim anyway.
+ */
+ static void
+get_styled_font_variants(void)
+{
+ PangoFontDescription *bold_font_desc;
+ PangoFont *plain_font;
+ PangoFont *bold_font;
+
+ gui.font_can_bold = FALSE;
+
+ plain_font = pango_context_load_font(gui.text_context, gui.norm_font);
+
+ if (plain_font == NULL)
+ return;
+
+ bold_font_desc = pango_font_description_copy_static(gui.norm_font);
+ pango_font_description_set_weight(bold_font_desc, PANGO_WEIGHT_BOLD);
+
+ bold_font = pango_context_load_font(gui.text_context, bold_font_desc);
+ /*
+ * The comparison relies on the unique handle nature of a PangoFont*,
+ * i.e. it's assumed that a different PangoFont* won't refer to the
+ * same font. Seems to work, and failing here isn't critical anyway.
+ */
+ if (bold_font != NULL)
+ {
+ gui.font_can_bold = (bold_font != plain_font);
+ g_object_unref(bold_font);
+ }
+
+ pango_font_description_free(bold_font_desc);
+ g_object_unref(plain_font);
+}
+
+#else /* !HAVE_GTK2 */
+
+/*
+ * There is only one excuse I can give for the following attempt to manage font
+ * styles:
+ *
+ * I HATE THE BRAIN DEAD WAY X11 IS HANDLING FONTS (--mdcki)
+ * (Me too. --danielk)
+ */
+ static void
+get_styled_font_variants(char_u * font_name)
+{
+ char *chunk[32];
+ char *sdup;
+ char *tmp;
+ int len, i;
+ GuiFont *styled_font[3];
+
+ styled_font[0] = &gui.bold_font;
+ styled_font[1] = &gui.ital_font;
+ styled_font[2] = &gui.boldital_font;
+
+ /* First free whatever was freviously there. */
+ for (i = 0; i < 3; ++i)
+ if (*styled_font[i])
+ {
+ gdk_font_unref(*styled_font[i]);
+ *styled_font[i] = NULL;
+ }
+
+ if ((sdup = g_strdup((const char *)font_name)) == NULL)
+ return;
+
+ /* split up the whole */
+ i = 0;
+ for (tmp = sdup; *tmp != '\0'; ++tmp)
+ {
+ if (*tmp == '-')
+ {
+ *tmp = '\0';
+
+ if (i == 32)
+ break;
+
+ chunk[i] = tmp + 1;
+ ++i;
+ }
+ }
+
+ if (i == 14)
+ {
+ GdkFont *font = NULL;
+ const char *bold_chunk[3] = { "bold", NULL, "bold" };
+ const char *italic_chunk[3] = { NULL, "o", "o" };
+
+ /* font name was complete */
+ len = strlen((const char *)font_name) + 32;
+
+ for (i = 0; i < 3; ++i)
+ {
+ char *styled_name;
+ int j;
+
+ styled_name = (char *)alloc(len);
+ if (styled_name == NULL)
+ {
+ g_free(sdup);
+ return;
+ }
+
+ *styled_name = '\0';
+
+ for (j = 0; j < 14; ++j)
+ {
+ strcat(styled_name, "-");
+ if (j == 2 && bold_chunk[i] != NULL)
+ strcat(styled_name, bold_chunk[i]);
+ else if (j == 3 && italic_chunk[i] != NULL)
+ strcat(styled_name, italic_chunk[i]);
+ else
+ strcat(styled_name, chunk[j]);
+ }
+
+ font = gui_mch_get_font((char_u *)styled_name, FALSE);
+ if (font != NULL)
+ *styled_font[i] = font;
+
+ vim_free(styled_name);
+ }
+ }
+
+ g_free(sdup);
+}
+#endif /* !HAVE_GTK2 */
+
+#ifdef HAVE_GTK2
+static PangoEngineShape *default_shape_engine = NULL;
+
+/*
+ * Create a map from ASCII characters in the range [32,126] to glyphs
+ * of the current font. This is used by gui_gtk2_draw_string() to skip
+ * the itemize and shaping process for the most common case.
+ */
+ static void
+ascii_glyph_table_init(void)
+{
+ char_u ascii_chars[128];
+ PangoAttrList *attr_list;
+ GList *item_list;
+ int i;
+
+ if (gui.ascii_glyphs != NULL)
+ pango_glyph_string_free(gui.ascii_glyphs);
+ if (gui.ascii_font != NULL)
+ g_object_unref(gui.ascii_font);
+
+ gui.ascii_glyphs = NULL;
+ gui.ascii_font = NULL;
+
+ /* For safety, fill in question marks for the control characters. */
+ for (i = 0; i < 32; ++i)
+ ascii_chars[i] = '?';
+ for (; i < 127; ++i)
+ ascii_chars[i] = i;
+ ascii_chars[i] = '?';
+
+ attr_list = pango_attr_list_new();
+ item_list = pango_itemize(gui.text_context, (const char *)ascii_chars,
+ 0, sizeof(ascii_chars), attr_list, NULL);
+
+ if (item_list != NULL && item_list->next == NULL) /* play safe */
+ {
+ PangoItem *item;
+ int width;
+
+ item = (PangoItem *)item_list->data;
+ width = gui.char_width * PANGO_SCALE;
+
+ /* Remember the shape engine used for ASCII. */
+ default_shape_engine = item->analysis.shape_engine;
+
+ gui.ascii_font = item->analysis.font;
+ g_object_ref(gui.ascii_font);
+
+ gui.ascii_glyphs = pango_glyph_string_new();
+
+ pango_shape((const char *)ascii_chars, sizeof(ascii_chars),
+ &item->analysis, gui.ascii_glyphs);
+
+ g_return_if_fail(gui.ascii_glyphs->num_glyphs == sizeof(ascii_chars));
+
+ for (i = 0; i < gui.ascii_glyphs->num_glyphs; ++i)
+ {
+ PangoGlyphGeometry *geom;
+
+ geom = &gui.ascii_glyphs->glyphs[i].geometry;
+ geom->x_offset += MAX(0, width - geom->width) / 2;
+ geom->width = width;
+ }
+ }
+
+ g_list_foreach(item_list, (GFunc)&pango_item_free, NULL);
+ g_list_free(item_list);
+ pango_attr_list_unref(attr_list);
+}
+#endif /* HAVE_GTK2 */
+
+/*
+ * Initialize Vim to use the font or fontset with the given name.
+ * Return FAIL if the font could not be loaded, OK otherwise.
+ */
+/*ARGSUSED1*/
+ int
+gui_mch_init_font(char_u *font_name, int fontset)
+{
+#ifdef HAVE_GTK2
+ PangoFontDescription *font_desc;
+ PangoLayout *layout;
+ int width;
+
+ /* If font_name is NULL, this means to use the default, which should
+ * be present on all proper Pango/fontconfig installations. */
+ if (font_name == NULL)
+ font_name = (char_u *)DEFAULT_FONT;
+
+ font_desc = gui_mch_get_font(font_name, FALSE);
+
+ if (font_desc == NULL)
+ return FAIL;
+
+ gui_mch_free_font(gui.norm_font);
+ gui.norm_font = font_desc;
+
+ pango_context_set_font_description(gui.text_context, font_desc);
+
+ layout = pango_layout_new(gui.text_context);
+ pango_layout_set_text(layout, "MW", 2);
+ pango_layout_get_size(layout, &width, NULL);
+ /*
+ * Set char_width to half the width obtained from pango_layout_get_size()
+ * for CJK fixed_width/bi-width fonts. An unpatched version of Xft leads
+ * Pango to use the same width for both non-CJK characters (e.g. Latin
+ * letters and numbers) and CJK characters. This results in 's p a c e d
+ * o u t' rendering when a CJK 'fixed width' font is used. To work around
+ * that, divide the width returned by Pango by 2 if cjk_width is equal to
+ * width for CJK fonts.
+ *
+ * For related bugs, see:
+ * http://bugzilla.gnome.org/show_bug.cgi?id=106618
+ * http://bugzilla.gnome.org/show_bug.cgi?id=106624
+ *
+ * With this, for all four of the following cases, Vim works fine:
+ * guifont=CJK_fixed_width_font
+ * guifont=Non_CJK_fixed_font
+ * guifont=Non_CJK_fixed_font,CJK_Fixed_font
+ * guifont=Non_CJK_fixed_font guifontwide=CJK_fixed_font
+ */
+ if (is_cjk_font(gui.norm_font))
+ {
+ int cjk_width;
+
+ /* Measure the text extent of U+4E00 and U+4E8C */
+ pango_layout_set_text(layout, "\344\270\200\344\272\214", -1);
+ pango_layout_get_size(layout, &cjk_width, NULL);
+
+ if (width == cjk_width) /* Xft not patched */
+ width /= 2;
+ }
+ g_object_unref(layout);
+
+ gui.char_width = (width / 2 + PANGO_SCALE - 1) / PANGO_SCALE;
+
+ /* A zero width may cause a crash. Happens for semi-invalid fontsets. */
+ if (gui.char_width <= 0)
+ gui.char_width = 8;
+
+ gui_mch_adjust_charsize();
+
+ /* Set the fontname, which will be used for information purposes */
+ hl_set_font_name(font_name);
+
+ get_styled_font_variants();
+ ascii_glyph_table_init();
+
+ /* Avoid unnecessary overhead if 'guifontwide' is equal to 'guifont'. */
+ if (gui.wide_font != NULL
+ && pango_font_description_equal(gui.norm_font, gui.wide_font))
+ {
+ pango_font_description_free(gui.wide_font);
+ gui.wide_font = NULL;
+ }
+
+#else /* !HAVE_GTK2 */
+
+ GdkFont *font = NULL;
+
+# ifdef FEAT_XFONTSET
+ /* Try loading a fontset. If this fails we try loading a normal font. */
+ if (fontset && font_name != NULL)
+ font = gui_mch_get_fontset(font_name, TRUE, TRUE);
+
+ if (font == NULL)
+# endif
+ {
+ /* If font_name is NULL, this means to use the default, which should
+ * be present on all X11 servers. */
+ if (font_name == NULL)
+ font_name = (char_u *)DEFAULT_FONT;
+ font = gui_mch_get_font(font_name, FALSE);
+ }
+
+ if (font == NULL)
+ return FAIL;
+
+ gui_mch_free_font(gui.norm_font);
+# ifdef FEAT_XFONTSET
+ gui_mch_free_fontset(gui.fontset);
+ if (font->type == GDK_FONT_FONTSET)
+ {
+ gui.norm_font = NOFONT;
+ gui.fontset = (GuiFontset)font;
+ /* Use two bytes, this works around the problem that the result would
+ * be zero if no 8-bit font was found. */
+ gui.char_width = gdk_string_width(font, "xW") / 2;
+ }
+ else
+# endif
+ {
+ gui.norm_font = font;
+# ifdef FEAT_XFONTSET
+ gui.fontset = NOFONTSET;
+# endif
+ gui.char_width = ((XFontStruct *)
+ GDK_FONT_XFONT(font))->max_bounds.width;
+ }
+
+ /* A zero width may cause a crash. Happens for semi-invalid fontsets. */
+ if (gui.char_width <= 0)
+ gui.char_width = 8;
+
+ gui.char_height = font->ascent + font->descent + p_linespace;
+ gui.char_ascent = font->ascent + p_linespace / 2;
+
+ /* A not-positive value of char_height may crash Vim. Only happens
+ * if 'linespace' is negative (which does make sense sometimes). */
+ gui.char_ascent = MAX(gui.char_ascent, 0);
+ gui.char_height = MAX(gui.char_height, gui.char_ascent + 1);
+
+ /* Set the fontname, which will be used for information purposes */
+ hl_set_font_name(font_name);
+
+ if (font->type != GDK_FONT_FONTSET)
+ get_styled_font_variants(font_name);
+
+ /* Synchronize the fonts used in user input dialogs, since otherwise
+ * search/replace will be esp. annoying in case of international font
+ * usage.
+ */
+ gui_gtk_synch_fonts();
+
+# ifdef FEAT_XIM
+ /* Adjust input management behaviour to the capabilities of the new
+ * fontset */
+ xim_decide_input_style();
+ if (xim_get_status_area_height())
+ {
+ /* Status area is required. Just create the empty container so that
+ * mainwin will allocate the extra space for status area. */
+ GtkWidget *alignment = gtk_alignment_new((gfloat)0.5, (gfloat)0.5,
+ (gfloat)1.0, (gfloat)1.0);
+
+ gtk_widget_set_usize(alignment, 20, gui.char_height + 2);
+ gtk_box_pack_end(GTK_BOX(GTK_BIN(gui.mainwin)->child),
+ alignment, FALSE, FALSE, 0);
+ gtk_widget_show(alignment);
+ }
+# endif
+#endif /* !HAVE_GTK2 */
+
+ /* Preserve the logical dimensions of the screen. */
+ update_window_manager_hints();
+
+ return OK;
+}
+
+/*
+ * Get a reference to the font "name".
+ * Return zero for failure.
+ */
+ GuiFont
+gui_mch_get_font(char_u *name, int report_error)
+{
+#ifdef HAVE_GTK2
+ PangoFontDescription *font;
+#else
+ GdkFont *font;
+#endif
+
+ /* can't do this when GUI is not running */
+ if (!gui.in_use || name == NULL)
+ return NULL;
+
+#ifdef HAVE_GTK2
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ char_u *buf;
+
+ buf = string_convert(&output_conv, name, NULL);
+ if (buf != NULL)
+ {
+ font = pango_font_description_from_string((const char *)buf);
+ vim_free(buf);
+ }
+ else
+ font = NULL;
+ }
+ else
+ font = pango_font_description_from_string((const char *)name);
+
+ if (font != NULL)
+ {
+ PangoFont *real_font;
+
+ /* pango_context_load_font() bails out if no font size is set */
+ if (pango_font_description_get_size(font) <= 0)
+ pango_font_description_set_size(font, 10 * PANGO_SCALE);
+
+ real_font = pango_context_load_font(gui.text_context, font);
+
+ if (real_font == NULL)
+ {
+ pango_font_description_free(font);
+ font = NULL;
+ }
+ else
+ g_object_unref(real_font);
+ }
+#else
+ font = gdk_font_load((const gchar *)name);
+#endif
+
+ if (font == NULL)
+ {
+ if (report_error)
+ EMSG2(_(e_font), name);
+ return NULL;
+ }
+
+#ifdef HAVE_GTK2
+ /*
+ * The fixed-width check has been disabled for GTK+ 2. Rationale:
+ *
+ * - The check tends to report false positives, particularly
+ * in non-Latin locales or with old X fonts.
+ * - Thanks to our fixed-width hack in gui_gtk2_draw_string(),
+ * GTK+ 2 Vim is actually capable of displaying variable width
+ * fonts. Those will just be spaced out like in AA xterm.
+ * - Failing here for the default font causes GUI startup to fail
+ * even with wiped out configuration files.
+ * - The font dialog displays all fonts unfiltered, and it's rather
+ * annoying if 95% of the listed fonts produce an error message.
+ */
+# if 0
+ {
+ /* Check that this is a mono-spaced font. Naturally, this is a bit
+ * hackish -- fixed-width isn't really suitable for i18n text :/ */
+ PangoLayout *layout;
+ unsigned int i;
+ int last_width = -1;
+ const char test_chars[] = { 'W', 'i', ',', 'x' }; /* arbitrary */
+
+ layout = pango_layout_new(gui.text_context);
+ pango_layout_set_font_description(layout, font);
+
+ for (i = 0; i < G_N_ELEMENTS(test_chars); ++i)
+ {
+ int width;
+
+ pango_layout_set_text(layout, &test_chars[i], 1);
+ pango_layout_get_size(layout, &width, NULL);
+
+ if (last_width >= 0 && width != last_width)
+ {
+ pango_font_description_free(font);
+ font = NULL;
+ break;
+ }
+
+ last_width = width;
+ }
+
+ g_object_unref(layout);
+ }
+# endif
+#else /* !HAVE_GTK2 */
+ {
+ XFontStruct *xfont;
+
+ /* reference this font as being in use */
+ gdk_font_ref(font);
+
+ /* Check that this is a mono-spaced font.
+ */
+ xfont = (XFontStruct *) GDK_FONT_XFONT(font);
+
+ if (xfont->max_bounds.width != xfont->min_bounds.width)
+ {
+ gdk_font_unref(font);
+ font = NULL;
+ }
+ }
+#endif /* !HAVE_GTK2 */
+
+#if !defined(HAVE_GTK2) || 0 /* disabled for GTK+ 2, see above */
+ if (font == NULL && report_error)
+ EMSG2(_(e_fontwidth), name);
+#endif
+
+ return font;
+}
+
+#if !defined(HAVE_GTK2) || defined(PROTO)
+/*
+ * Set the current text font.
+ * Since we create all GC on demand, we use just gui.current_font to
+ * indicate the desired current font.
+ */
+ void
+gui_mch_set_font(GuiFont font)
+{
+ gui.current_font = font;
+}
+#endif
+
+#if defined(FEAT_XFONTSET) || defined(PROTO)
+/*
+ * Set the current text fontset.
+ */
+ void
+gui_mch_set_fontset(GuiFontset fontset)
+{
+ gui.current_font = fontset;
+}
+#endif
+
+/*
+ * If a font is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_font(GuiFont font)
+{
+ if (font != NOFONT)
+#ifdef HAVE_GTK2
+ pango_font_description_free(font);
+#else
+ gdk_font_unref(font);
+#endif
+}
+
+#if defined(FEAT_XFONTSET) || defined(PROTO)
+/*
+ * If a fontset is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_fontset(GuiFontset fontset)
+{
+ if (fontset != NOFONTSET)
+ gdk_font_unref(fontset);
+}
+#endif
+
+
+/*
+ * Return the Pixel value (color) for the given color name. This routine was
+ * pretty much taken from example code in the Silicon Graphics OSF/Motif
+ * Programmer's Guide.
+ * Return INVALCOLOR for error.
+ */
+ guicolor_T
+gui_mch_get_color(char_u *name)
+{
+ /* A number of colors that some X11 systems don't have */
+ static const char *const vimnames[][2] =
+ {
+ {"LightRed", "#FFBBBB"},
+ {"LightGreen", "#88FF88"},
+ {"LightMagenta", "#FFBBFF"},
+ {"DarkCyan", "#008888"},
+ {"DarkBlue", "#0000BB"},
+ {"DarkRed", "#BB0000"},
+ {"DarkMagenta", "#BB00BB"},
+ {"DarkGrey", "#BBBBBB"},
+ {"DarkYellow", "#BBBB00"},
+ {NULL, NULL}
+ };
+
+ if (!gui.in_use) /* can't do this when GUI not running */
+ return INVALCOLOR;
+
+ while (name != NULL)
+ {
+ GdkColor color;
+ int parsed;
+ int i;
+
+ parsed = gdk_color_parse((const char *)name, &color);
+
+#ifndef HAVE_GTK2 /* ohh, lovely GTK+ 2, eases our pain :) */
+ /*
+ * Since we have already called gtk_set_locale here the bugger
+ * XParseColor will accept only explicit color names in the language
+ * of the current locale. However this will interferre with:
+ * 1. Vim's global startup files
+ * 2. Explicit color names in .vimrc
+ *
+ * Therefore we first try to parse the color in the current locale and
+ * if it fails, we fall back to the portable "C" one.
+ */
+ if (!parsed)
+ {
+ char *current;
+
+ current = setlocale(LC_ALL, NULL);
+ if (current != NULL)
+ {
+ char *saved;
+
+ saved = g_strdup(current);
+ setlocale(LC_ALL, "C");
+
+ parsed = gdk_color_parse((const gchar *)name, &color);
+
+ setlocale(LC_ALL, saved);
+ gtk_set_locale();
+
+ g_free(saved);
+ }
+ }
+#endif /* !HAVE_GTK2 */
+
+ if (parsed)
+ {
+#ifdef HAVE_GTK2
+ gdk_colormap_alloc_color(gtk_widget_get_colormap(gui.drawarea),
+ &color, FALSE, TRUE);
+#else
+ gdk_color_alloc(gtk_widget_get_colormap(gui.drawarea), &color);
+#endif
+ return (guicolor_T)color.pixel;
+ }
+ /* add a few builtin names and try again */
+ for (i = 0; ; ++i)
+ {
+ if (vimnames[i][0] == NULL)
+ {
+ name = NULL;
+ break;
+ }
+ if (STRICMP(name, vimnames[i][0]) == 0)
+ {
+ name = (char_u *)vimnames[i][1];
+ break;
+ }
+ }
+ }
+
+ return INVALCOLOR;
+}
+
+/*
+ * Set the current text foreground color.
+ */
+ void
+gui_mch_set_fg_color(guicolor_T color)
+{
+ gui.fgcolor->pixel = (unsigned long)color;
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(guicolor_T color)
+{
+ gui.bgcolor->pixel = (unsigned long)color;
+}
+
+#ifdef HAVE_GTK2
+/*
+ * Function-like convenience macro for the sake of efficiency.
+ */
+#define INSERT_PANGO_ATTR(Attribute, AttrList, Start, End) \
+ G_STMT_START{ \
+ PangoAttribute *tmp_attr_; \
+ tmp_attr_ = (Attribute); \
+ tmp_attr_->start_index = (Start); \
+ tmp_attr_->end_index = (End); \
+ pango_attr_list_insert((AttrList), tmp_attr_); \
+ }G_STMT_END
+
+ static void
+apply_wide_font_attr(char_u *s, int len, PangoAttrList *attr_list)
+{
+ char_u *start = NULL;
+ char_u *p;
+ int uc;
+
+ for (p = s; p < s + len; p += utf_byte2len(*p))
+ {
+ uc = utf_ptr2char(p);
+
+ if (start == NULL)
+ {
+ if (uc >= 0x80 && utf_char2cells(uc) == 2)
+ start = p;
+ }
+ else if (uc < 0x80 /* optimization shortcut */
+ || (utf_char2cells(uc) != 2 && !utf_iscomposing(uc)))
+ {
+ INSERT_PANGO_ATTR(pango_attr_font_desc_new(gui.wide_font),
+ attr_list, start - s, p - s);
+ start = NULL;
+ }
+ }
+
+ if (start != NULL)
+ INSERT_PANGO_ATTR(pango_attr_font_desc_new(gui.wide_font),
+ attr_list, start - s, len);
+}
+
+ static int
+count_cluster_cells(char_u *s, PangoItem *item,
+ PangoGlyphString* glyphs, int i,
+ int *cluster_width,
+ int *last_glyph_rbearing)
+{
+ char_u *p;
+ int next; /* glyph start index of next cluster */
+ int start, end; /* string segment of current cluster */
+ int width; /* real cluster width in Pango units */
+ int uc;
+ int cellcount = 0;
+
+ width = glyphs->glyphs[i].geometry.width;
+
+ for (next = i + 1; next < glyphs->num_glyphs; ++next)
+ {
+ if (glyphs->glyphs[next].attr.is_cluster_start)
+ break;
+ else if (glyphs->glyphs[next].geometry.width > width)
+ width = glyphs->glyphs[next].geometry.width;
+ }
+
+ start = item->offset + glyphs->log_clusters[i];
+ end = item->offset + ((next < glyphs->num_glyphs) ?
+ glyphs->log_clusters[next] : item->length);
+
+ for (p = s + start; p < s + end; p += utf_byte2len(*p))
+ {
+ uc = utf_ptr2char(p);
+ if (uc < 0x80)
+ ++cellcount;
+ else if (!utf_iscomposing(uc))
+ cellcount += utf_char2cells(uc);
+ }
+
+ if (last_glyph_rbearing != NULL
+ && cellcount > 0 && next == glyphs->num_glyphs)
+ {
+ PangoRectangle ink_rect;
+ /*
+ * If a certain combining mark had to be taken from a non-monospace
+ * font, we have to compensate manually by adapting x_offset according
+ * to the ink extents of the previous glyph.
+ */
+ pango_font_get_glyph_extents(item->analysis.font,
+ glyphs->glyphs[i].glyph,
+ &ink_rect, NULL);
+
+ if (PANGO_RBEARING(ink_rect) > 0)
+ *last_glyph_rbearing = PANGO_RBEARING(ink_rect);
+ }
+
+ if (cellcount > 0)
+ *cluster_width = width;
+
+ return cellcount;
+}
+
+/*
+ * If there are only combining characters in the cluster, we cannot just
+ * change the width of the previous glyph since there is none. Therefore
+ * some guesswork is needed.
+ *
+ * If ink_rect.x is negative Pango apparently has taken care of the composing
+ * by itself. Actually setting x_offset = 0 should be sufficient then, but due
+ * to problems with composing from different fonts we still need to fine-tune
+ * x_offset to avoid uglyness.
+ *
+ * If ink_rect.x is not negative, force overstriking by pointing x_offset to
+ * the position of the previous glyph. Apparently this happens only with old
+ * X fonts which don't provide the special combining information needed by
+ * Pango.
+ */
+ static void
+setup_zero_width_cluster(PangoItem *item, PangoGlyphInfo *glyph,
+ int last_cellcount, int last_cluster_width,
+ int last_glyph_rbearing)
+{
+ PangoRectangle ink_rect;
+ PangoRectangle logical_rect;
+ int width;
+
+ width = last_cellcount * gui.char_width * PANGO_SCALE;
+ glyph->geometry.x_offset = -width + MAX(0, width - last_cluster_width) / 2;
+ glyph->geometry.width = 0;
+
+ pango_font_get_glyph_extents(item->analysis.font,
+ glyph->glyph,
+ &ink_rect, &logical_rect);
+ if (ink_rect.x < 0)
+ {
+ glyph->geometry.x_offset += last_glyph_rbearing;
+ glyph->geometry.y_offset = logical_rect.height
+ - (gui.char_height - p_linespace) * PANGO_SCALE;
+ }
+}
+
+ static void
+draw_glyph_string(int row, int col, int num_cells, int flags,
+ PangoFont *font, PangoGlyphString *glyphs)
+{
+ if (!(flags & DRAW_TRANSP))
+ {
+ gdk_gc_set_foreground(gui.text_gc, gui.bgcolor);
+
+ gdk_draw_rectangle(gui.drawarea->window,
+ gui.text_gc,
+ TRUE,
+ FILL_X(col),
+ FILL_Y(row),
+ num_cells * gui.char_width,
+ gui.char_height);
+ }
+
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+
+ gdk_draw_glyphs(gui.drawarea->window,
+ gui.text_gc,
+ font,
+ TEXT_X(col),
+ TEXT_Y(row),
+ glyphs);
+
+ /* redraw the contents with an offset of 1 to emulate bold */
+ if ((flags & DRAW_BOLD) && !gui.font_can_bold)
+ gdk_draw_glyphs(gui.drawarea->window,
+ gui.text_gc,
+ font,
+ TEXT_X(col) + 1,
+ TEXT_Y(row),
+ glyphs);
+}
+
+#endif /* HAVE_GTK2 */
+
+#if defined(HAVE_GTK2) || defined(PROTO)
+ int
+gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+ GdkRectangle area; /* area for clip mask */
+ PangoGlyphString *glyphs; /* glyphs of current item */
+ int column_offset = 0; /* column offset in cells */
+ int i;
+ char_u *conv_buf = NULL; /* result of UTF-8 conversion */
+ char_u *new_conv_buf;
+ int convlen;
+ char_u *sp, *bp;
+ int plen;
+
+ if (gui.text_context == NULL || gui.drawarea->window == NULL)
+ return len;
+
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ /*
+ * Convert characters from 'encoding' to 'termencoding', which is set
+ * to UTF-8 by gui_mch_init(). did_set_string_option() in option.c
+ * prohibits changing this to something else than UTF-8 if the GUI is
+ * in use.
+ */
+ convlen = len;
+ conv_buf = string_convert(&output_conv, s, &convlen);
+ g_return_val_if_fail(conv_buf != NULL, len);
+
+ /* Correct for differences in char width: some chars are
+ * double-wide in 'encoding' but single-wide in utf-8. Add a space to
+ * compensate for that. */
+ for (sp = s, bp = conv_buf; sp < s + len && bp < conv_buf + convlen; )
+ {
+ plen = utf_ptr2len_check(bp);
+ if ((*mb_ptr2cells)(sp) == 2 && utf_ptr2cells(bp) == 1)
+ {
+ new_conv_buf = alloc(convlen + 2);
+ if (new_conv_buf == NULL)
+ return len;
+ plen += bp - conv_buf;
+ mch_memmove(new_conv_buf, conv_buf, plen);
+ new_conv_buf[plen] = ' ';
+ mch_memmove(new_conv_buf + plen + 1, conv_buf + plen,
+ convlen - plen + 1);
+ vim_free(conv_buf);
+ conv_buf = new_conv_buf;
+ ++convlen;
+ bp = conv_buf + plen;
+ plen = 1;
+ }
+ sp += (*mb_ptr2len_check)(sp);
+ bp += plen;
+ }
+ s = conv_buf;
+ len = convlen;
+ }
+
+ /*
+ * Restrict all drawing to the current screen line in order to prevent
+ * fuzzy font lookups from messing up the screen.
+ */
+ area.x = gui.border_offset;
+ area.y = FILL_Y(row);
+ area.width = gui.num_cols * gui.char_width;
+ area.height = gui.char_height;
+
+ gdk_gc_set_clip_origin(gui.text_gc, 0, 0);
+ gdk_gc_set_clip_rectangle(gui.text_gc, &area);
+
+ glyphs = pango_glyph_string_new();
+
+ /*
+ * Optimization hack: If possible, skip the itemize and shaping process
+ * for pure ASCII strings. This optimization is particularly effective
+ * because Vim draws space characters to clear parts of the screen.
+ */
+ if (!(flags & DRAW_ITALIC)
+ && !((flags & DRAW_BOLD) && gui.font_can_bold)
+ && gui.ascii_glyphs != NULL)
+ {
+ char_u *p;
+
+ for (p = s; p < s + len; ++p)
+ if (*p & 0x80)
+ goto not_ascii;
+
+ pango_glyph_string_set_size(glyphs, len);
+
+ for (i = 0; i < len; ++i)
+ {
+ glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[s[i]];
+ glyphs->log_clusters[i] = i;
+ }
+
+ draw_glyph_string(row, col, len, flags, gui.ascii_font, glyphs);
+
+ column_offset = len;
+ }
+ else
+not_ascii:
+ {
+ PangoAttrList *attr_list;
+ GList *item_list;
+ int cluster_width;
+ int last_glyph_rbearing;
+ int cells = 0; /* cells occupied by current cluster */
+
+ /* original width of the current cluster */
+ cluster_width = PANGO_SCALE * gui.char_width;
+
+ /* right bearing of the last non-composing glyph */
+ last_glyph_rbearing = PANGO_SCALE * gui.char_width;
+
+ attr_list = pango_attr_list_new();
+
+ /* If 'guifontwide' is set then use that for double-width characters.
+ * Otherwise just go with 'guifont' and let Pango do its thing. */
+ if (gui.wide_font != NULL)
+ apply_wide_font_attr(s, len, attr_list);
+
+ if ((flags & DRAW_BOLD) && gui.font_can_bold)
+ INSERT_PANGO_ATTR(pango_attr_weight_new(PANGO_WEIGHT_BOLD),
+ attr_list, 0, len);
+ if (flags & DRAW_ITALIC)
+ INSERT_PANGO_ATTR(pango_attr_style_new(PANGO_STYLE_ITALIC),
+ attr_list, 0, len);
+ /*
+ * Break the text into segments with consistent directional level
+ * and shaping engine. Pure Latin text needs only a single segment,
+ * so there's no need to worry about the loop's efficiency. Better
+ * try to optimize elsewhere, e.g. reducing exposes and stuff :)
+ */
+ item_list = pango_itemize(gui.text_context,
+ (const char *)s, 0, len, attr_list, NULL);
+
+ while (item_list != NULL)
+ {
+ PangoItem *item;
+ int item_cells = 0; /* item length in cells */
+
+ item = (PangoItem *)item_list->data;
+ item_list = g_list_delete_link(item_list, item_list);
+ /*
+ * Increment the bidirectional embedding level by 1 if it is not
+ * even. An odd number means the output will be RTL, but we don't
+ * want that since Vim handles right-to-left text on its own. It
+ * would probably be sufficient to just set level = 0, but you can
+ * never know :)
+ *
+ * Unfortunately we can't take advantage of Pango's ability to
+ * render both LTR and RTL at the same time. In order to support
+ * that, Vim's main screen engine would have to make use of Pango
+ * functionality.
+ */
+ item->analysis.level = (item->analysis.level + 1) & (~1U);
+
+ /* HACK: Overrule the shape engine, we don't want shaping to be
+ * done, because drawing the cursor would change the display. */
+ item->analysis.shape_engine = default_shape_engine;
+
+ pango_shape((const char *)s + item->offset, item->length,
+ &item->analysis, glyphs);
+ /*
+ * Fixed-width hack: iterate over the array and assign a fixed
+ * width to each glyph, thus overriding the choice made by the
+ * shaping engine. We use utf_char2cells() to determine the
+ * number of cells needed.
+ *
+ * Also perform all kind of dark magic to get composing
+ * characters right (and pretty too of course).
+ */
+ for (i = 0; i < glyphs->num_glyphs; ++i)
+ {
+ PangoGlyphInfo *glyph;
+
+ glyph = &glyphs->glyphs[i];
+
+ if (glyph->attr.is_cluster_start)
+ {
+ int cellcount;
+
+ cellcount = count_cluster_cells(
+ s, item, glyphs, i, &cluster_width,
+ (item_list != NULL) ? &last_glyph_rbearing : NULL);
+
+ if (cellcount > 0)
+ {
+ int width;
+
+ width = cellcount * gui.char_width * PANGO_SCALE;
+ glyph->geometry.x_offset +=
+ MAX(0, width - cluster_width) / 2;
+ glyph->geometry.width = width;
+ }
+ else
+ {
+ /* If there are only combining characters in the
+ * cluster, we cannot just change the width of the
+ * previous glyph since there is none. Therefore
+ * some guesswork is needed. */
+ setup_zero_width_cluster(item, glyph, cells,
+ cluster_width,
+ last_glyph_rbearing);
+ }
+
+ item_cells += cellcount;
+ cells = cellcount;
+ }
+ else if (i > 0)
+ {
+ int width;
+
+ /* There is a previous glyph, so we deal with combining
+ * characters the canonical way. That is, setting the
+ * width of the previous glyph to 0. */
+ glyphs->glyphs[i - 1].geometry.width = 0;
+
+ width = cells * gui.char_width * PANGO_SCALE;
+ glyph->geometry.x_offset +=
+ MAX(0, width - cluster_width) / 2;
+ glyph->geometry.width = width;
+ }
+ else /* i == 0 "cannot happen" */
+ {
+ glyph->geometry.width = 0;
+ }
+ }
+
+ /*** Aaaaand action! ***/
+ draw_glyph_string(row, col + column_offset, item_cells,
+ flags, item->analysis.font, glyphs);
+
+ pango_item_free(item);
+
+ column_offset += item_cells;
+ }
+
+ pango_attr_list_unref(attr_list);
+ }
+
+ if (flags & DRAW_UNDERL)
+ gdk_draw_line(gui.drawarea->window,
+ gui.text_gc,
+ FILL_X(col),
+ FILL_Y(row + 1) - 1,
+ FILL_X(col + column_offset) - 1,
+ FILL_Y(row + 1) - 1);
+
+ pango_glyph_string_free(glyphs);
+ vim_free(conv_buf);
+
+ gdk_gc_set_clip_rectangle(gui.text_gc, NULL);
+
+ return column_offset;
+}
+#endif /* HAVE_GTK2 */
+
+#if !defined(HAVE_GTK2) || defined(PROTO)
+ void
+gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+ static XChar2b *buf = NULL;
+ static int buflen = 0;
+ int is_wide;
+ XChar2b *text;
+ int textlen;
+ XFontStruct *xfont;
+ char_u *p;
+# ifdef FEAT_MBYTE
+ unsigned c;
+# endif
+ int width;
+
+ if (gui.current_font == NULL || gui.drawarea->window == NULL)
+ return;
+
+ /*
+ * Yeah yeah apparently the font support in GTK+ 1.2 only cares for either:
+ * asians or 8-bit fonts. It is broken there, but no wonder the whole font
+ * stuff is broken in X11 in first place. And the internationalization API
+ * isn't something you would really like to use.
+ */
+
+ xfont = (XFontStruct *)((GdkFontPrivate*)gui.current_font)->xfont;
+ is_wide = ((xfont->min_byte1 != 0 || xfont->max_byte1 != 0)
+# ifdef FEAT_XFONTSET
+ && gui.fontset == NOFONTSET
+# endif
+ );
+
+ if (is_wide)
+ {
+ /* Convert a byte sequence to 16 bit characters for the Gdk functions.
+ * Need a buffer for the 16 bit characters. Keep it between calls,
+ * because allocating it each time is slow. */
+ if (buflen < len)
+ {
+ XtFree((char *)buf);
+ buf = (XChar2b *)XtMalloc(len * sizeof(XChar2b));
+ buflen = len;
+ }
+
+ p = s;
+ textlen = 0;
+ width = 0;
+ while (p < s + len)
+ {
+# ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ c = utf_ptr2char(p);
+ if (c >= 0x10000) /* show chars > 0xffff as ? */
+ c = 0xbf;
+ buf[textlen].byte1 = c >> 8;
+ buf[textlen].byte2 = c;
+ p += utf_ptr2len_check(p);
+ width += utf_char2cells(c);
+ }
+ else
+# endif
+ {
+ buf[textlen].byte1 = '\0'; /* high eight bits */
+ buf[textlen].byte2 = *p; /* low eight bits */
+ ++p;
+ ++width;
+ }
+ ++textlen;
+ }
+ text = buf;
+ textlen = textlen * 2;
+ }
+ else
+ {
+ text = (XChar2b *)s;
+ textlen = len;
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ width = 0;
+ for (p = s; p < s + len; p += (*mb_ptr2len_check)(p))
+ width += (*mb_ptr2cells)(p);
+ }
+ else
+# endif
+ width = len;
+ }
+
+ if (!(flags & DRAW_TRANSP))
+ {
+ gdk_gc_set_foreground(gui.text_gc, gui.bgcolor);
+ gdk_draw_rectangle(gui.drawarea->window,
+ gui.text_gc,
+ TRUE,
+ FILL_X(col), FILL_Y(row),
+ width * gui.char_width, gui.char_height);
+ }
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+ gdk_draw_text(gui.drawarea->window,
+ gui.current_font,
+ gui.text_gc,
+ TEXT_X(col), TEXT_Y(row),
+ (const gchar *)text, textlen);
+
+ /* redraw the contents with an offset of 1 to emulate bold */
+ if (flags & DRAW_BOLD)
+ gdk_draw_text(gui.drawarea->window,
+ gui.current_font,
+ gui.text_gc,
+ TEXT_X(col) + 1, TEXT_Y(row),
+ (const gchar *)text, textlen);
+
+ if (flags & DRAW_UNDERL)
+ {
+ gdk_draw_line(gui.drawarea->window,
+ gui.text_gc, FILL_X(col),
+ FILL_Y(row + 1) - 1, FILL_X(col + width) - 1, FILL_Y(row + 1) - 1);
+ }
+}
+#endif /* !HAVE_GTK2 */
+
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(char_u *name)
+{
+ int i;
+
+ for (i = 0; special_keys[i].key_sym != 0; i++)
+ if (name[0] == special_keys[i].code0
+ && name[1] == special_keys[i].code1)
+ return OK;
+ return FAIL;
+}
+
+#if defined(FEAT_TITLE) \
+ || (defined(FEAT_XIM) && !defined(HAVE_GTK2)) \
+ || defined(PROTO)
+/*
+ * Return the text window-id and display. Only required for X-based GUI's
+ */
+ int
+gui_get_x11_windis(Window *win, Display **dis)
+{
+ if (gui.mainwin != NULL && gui.mainwin->window != NULL)
+ {
+ *dis = GDK_WINDOW_XDISPLAY(gui.mainwin->window);
+ *win = GDK_WINDOW_XWINDOW(gui.mainwin->window);
+ return OK;
+ }
+
+ *dis = NULL;
+ *win = 0;
+ return FAIL;
+}
+#endif
+
+#if defined(FEAT_CLIENTSERVER) \
+ || (defined(FEAT_X11) && defined(FEAT_CLIPBOARD)) || defined(PROTO)
+
+ Display *
+gui_mch_get_display(void)
+{
+ if (gui.mainwin != NULL && gui.mainwin->window != NULL)
+ return GDK_WINDOW_XDISPLAY(gui.mainwin->window);
+ else
+ return NULL;
+}
+#endif
+
+ void
+gui_mch_beep(void)
+{
+#ifdef HAVE_GTK_MULTIHEAD
+ GdkDisplay *display;
+
+ if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
+ display = gtk_widget_get_display(gui.mainwin);
+ else
+ display = gdk_display_get_default();
+
+ if (display != NULL)
+ gdk_display_beep(display);
+#else
+ gdk_beep();
+#endif
+}
+
+ void
+gui_mch_flash(int msec)
+{
+ GdkGCValues values;
+ GdkGC *invert_gc;
+
+ if (gui.drawarea->window == NULL)
+ return;
+
+ values.foreground.pixel = gui.norm_pixel ^ gui.back_pixel;
+ values.background.pixel = gui.norm_pixel ^ gui.back_pixel;
+ values.function = GDK_XOR;
+ invert_gc = gdk_gc_new_with_values(gui.drawarea->window,
+ &values,
+ GDK_GC_FOREGROUND |
+ GDK_GC_BACKGROUND |
+ GDK_GC_FUNCTION);
+ gdk_gc_set_exposures(invert_gc,
+ gui.visibility != GDK_VISIBILITY_UNOBSCURED);
+ /*
+ * Do a visual beep by changing back and forth in some undetermined way,
+ * the foreground and background colors. This is due to the fact that
+ * there can't be really any prediction about the effects of XOR on
+ * arbitrary X11 servers. However this seems to be enough for what we
+ * intend it to do.
+ */
+ gdk_draw_rectangle(gui.drawarea->window, invert_gc,
+ TRUE,
+ 0, 0,
+ FILL_X((int)Columns) + gui.border_offset,
+ FILL_Y((int)Rows) + gui.border_offset);
+
+ gui_mch_flush();
+ ui_delay((long)msec, TRUE); /* wait so many msec */
+
+ gdk_draw_rectangle(gui.drawarea->window, invert_gc,
+ TRUE,
+ 0, 0,
+ FILL_X((int)Columns) + gui.border_offset,
+ FILL_Y((int)Rows) + gui.border_offset);
+
+ gdk_gc_destroy(invert_gc);
+}
+
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(int r, int c, int nr, int nc)
+{
+ GdkGCValues values;
+ GdkGC *invert_gc;
+ GdkColor foreground;
+ GdkColor background;
+
+ if (gui.drawarea->window == NULL)
+ return;
+
+ foreground.pixel = gui.norm_pixel ^ gui.back_pixel;
+ background.pixel = gui.norm_pixel ^ gui.back_pixel;
+
+ values.foreground = foreground;
+ values.background = background;
+ values.function = GDK_XOR;
+ invert_gc = gdk_gc_new_with_values(gui.drawarea->window,
+ &values,
+ GDK_GC_FOREGROUND |
+ GDK_GC_BACKGROUND |
+ GDK_GC_FUNCTION);
+ gdk_gc_set_exposures(invert_gc, gui.visibility != GDK_VISIBILITY_UNOBSCURED);
+ gdk_draw_rectangle(gui.drawarea->window, invert_gc,
+ TRUE,
+ FILL_X(c), FILL_Y(r),
+ (nc) * gui.char_width, (nr) * gui.char_height);
+ gdk_gc_destroy(invert_gc);
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify(void)
+{
+#ifdef HAVE_GTK2
+ gtk_window_iconify(GTK_WINDOW(gui.mainwin));
+#else
+ XIconifyWindow(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ GDK_WINDOW_XWINDOW(gui.mainwin->window),
+ DefaultScreen(GDK_WINDOW_XDISPLAY(gui.mainwin->window)));
+#endif
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground(void)
+{
+# ifdef HAVE_GTK2
+ gtk_window_present(GTK_WINDOW(gui.mainwin));
+# else
+ gdk_window_raise(gui.mainwin->window);
+# endif
+}
+#endif
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(guicolor_T color)
+{
+ int i = 1;
+
+ if (gui.drawarea->window == NULL)
+ return;
+
+ gui_mch_set_fg_color(color);
+
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+#ifdef FEAT_MBYTE
+ if (mb_lefthalve(gui.row, gui.col))
+ i = 2;
+#endif
+ gdk_draw_rectangle(gui.drawarea->window, gui.text_gc,
+ FALSE,
+ FILL_X(gui.col), FILL_Y(gui.row),
+ i * gui.char_width - 1, gui.char_height - 1);
+}
+
+/*
+ * Draw part of a cursor, "w" pixels wide, and "h" pixels high, using
+ * color "color".
+ */
+ void
+gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
+{
+ if (gui.drawarea->window == NULL)
+ return;
+
+ gui_mch_set_fg_color(color);
+
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+ gdk_draw_rectangle(gui.drawarea->window, gui.text_gc,
+ TRUE,
+#ifdef FEAT_RIGHTLEFT
+ /* vertical line should be on the right of current point */
+ CURSOR_BAR_RIGHT ? FILL_X(gui.col + 1) - w :
+#endif
+ FILL_X(gui.col),
+ FILL_Y(gui.row) + gui.char_height - h,
+ w, h);
+}
+
+
+/*
+ * Catch up with any queued X11 events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the X11 event queue (& no timers pending), then we return
+ * immediately.
+ */
+ void
+gui_mch_update(void)
+{
+ while (gtk_events_pending() && !vim_is_input_buf_full())
+ gtk_main_iteration_do(FALSE);
+}
+
+ static gint
+input_timer_cb(gpointer data)
+{
+ int *timed_out = (int *) data;
+
+ /* Just inform the caller about the occurence of it */
+ *timed_out = TRUE;
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
+ return FALSE; /* don't happen again */
+}
+
+#ifdef FEAT_SNIFF
+/*
+ * Callback function, used when data is available on the SNiFF connection.
+ */
+/* ARGSUSED */
+ static void
+sniff_request_cb(
+ gpointer data,
+ gint source_fd,
+ GdkInputCondition condition)
+{
+ static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
+
+ add_to_input_buf(bytes, 3);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+#endif
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_mch_wait_for_chars(long wtime)
+{
+ int focus;
+ guint timer;
+ static int timed_out;
+#ifdef FEAT_SNIFF
+ static int sniff_on = 0;
+ static gint sniff_input_id = 0;
+#endif
+
+#ifdef FEAT_SNIFF
+ if (sniff_on && !want_sniff_request)
+ {
+ if (sniff_input_id)
+ gdk_input_remove(sniff_input_id);
+ sniff_on = 0;
+ }
+ else if (!sniff_on && want_sniff_request)
+ {
+ /* Add fd_from_sniff to watch for available data in main loop. */
+ sniff_input_id = gdk_input_add(fd_from_sniff,
+ GDK_INPUT_READ, sniff_request_cb, NULL);
+ sniff_on = 1;
+ }
+#endif
+
+ timed_out = FALSE;
+
+ /* this timeout makes sure that we will return if no characters arrived in
+ * time */
+
+ if (wtime > 0)
+ timer = gtk_timeout_add((guint32)wtime, input_timer_cb, &timed_out);
+ else
+ timer = 0;
+
+ focus = gui.in_focus;
+
+ do
+ {
+ /* Stop or start blinking when focus changes */
+ if (gui.in_focus != focus)
+ {
+ if (gui.in_focus)
+ gui_mch_start_blink();
+ else
+ gui_mch_stop_blink();
+ focus = gui.in_focus;
+ }
+
+ /*
+ * Loop in GTK+ processing until a timeout or input occurs.
+ */
+ gtk_main();
+
+ /* Got char, return immediately */
+ if (input_available())
+ {
+ if (timer != 0 && !timed_out)
+ gtk_timeout_remove(timer);
+ return OK;
+ }
+ } while (wtime < 0 || !timed_out);
+
+ /*
+ * Flush all eventually pending (drawing) events.
+ */
+ gui_mch_update();
+
+ return FAIL;
+}
+
+
+/****************************************************************************
+ * Output drawing routines.
+ ****************************************************************************/
+
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush(void)
+{
+#ifdef HAVE_GTK_MULTIHEAD
+ if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
+ gdk_display_sync(gtk_widget_get_display(gui.mainwin));
+#else
+ gdk_flush(); /* historical misnomer: calls XSync(), not XFlush() */
+#endif
+#ifdef HAVE_GTK2
+ /* This happens to actually do what gui_mch_flush() is supposed to do,
+ * according to the comment above. */
+ if (gui.drawarea != NULL && gui.drawarea->window != NULL)
+ gdk_window_process_updates(gui.drawarea->window, FALSE);
+#endif
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(int row1, int col1, int row2, int col2)
+{
+ GdkColor color;
+
+ if (gui.drawarea->window == NULL)
+ return;
+
+ color.pixel = gui.back_pixel;
+
+ gdk_gc_set_foreground(gui.text_gc, &color);
+
+ /* Clear one extra pixel at the far right, for when bold characters have
+ * spilled over to the window border. */
+ gdk_draw_rectangle(gui.drawarea->window, gui.text_gc, TRUE,
+ FILL_X(col1), FILL_Y(row1),
+ (col2 - col1 + 1) * gui.char_width
+ + (col2 == Columns - 1),
+ (row2 - row1 + 1) * gui.char_height);
+}
+
+ void
+gui_mch_clear_all(void)
+{
+ if (gui.drawarea->window != NULL)
+ gdk_window_clear(gui.drawarea->window);
+}
+
+/*
+ * Redraw any text revealed by scrolling up/down.
+ */
+ static void
+check_copy_area(void)
+{
+ GdkEvent *event;
+ int expose_count;
+
+ if (gui.visibility != GDK_VISIBILITY_PARTIAL)
+ return;
+
+ /* Avoid redrawing the cursor while scrolling or it'll end up where
+ * we don't want it to be. I'm not sure if it's correct to call
+ * gui_dont_update_cursor() at this point but it works as a quick
+ * fix for now. */
+ gui_dont_update_cursor();
+
+ do
+ {
+ /* Wait to check whether the scroll worked or not. */
+ event = gdk_event_get_graphics_expose(gui.drawarea->window);
+
+ if (event == NULL)
+ break; /* received NoExpose event */
+
+ gui_redraw(event->expose.area.x, event->expose.area.y,
+ event->expose.area.width, event->expose.area.height);
+
+ expose_count = event->expose.count;
+ gdk_event_free(event);
+ }
+ while (expose_count > 0); /* more events follow */
+
+ gui_can_update_cursor();
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(int row, int num_lines)
+{
+ if (gui.visibility == GDK_VISIBILITY_FULLY_OBSCURED)
+ return; /* Can't see the window */
+
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+ gdk_gc_set_background(gui.text_gc, gui.bgcolor);
+
+ /* copy one extra pixel, for when bold has spilled over */
+ gdk_window_copy_area(gui.drawarea->window, gui.text_gc,
+ FILL_X(gui.scroll_region_left), FILL_Y(row),
+ gui.drawarea->window,
+ FILL_X(gui.scroll_region_left),
+ FILL_Y(row + num_lines),
+ gui.char_width * (gui.scroll_region_right
+ - gui.scroll_region_left + 1) + 1,
+ gui.char_height * (gui.scroll_region_bot - row - num_lines + 1));
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ check_copy_area();
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(int row, int num_lines)
+{
+ if (gui.visibility == GDK_VISIBILITY_FULLY_OBSCURED)
+ return; /* Can't see the window */
+
+ gdk_gc_set_foreground(gui.text_gc, gui.fgcolor);
+ gdk_gc_set_background(gui.text_gc, gui.bgcolor);
+
+ /* copy one extra pixel, for when bold has spilled over */
+ gdk_window_copy_area(gui.drawarea->window, gui.text_gc,
+ FILL_X(gui.scroll_region_left), FILL_Y(row + num_lines),
+ gui.drawarea->window,
+ FILL_X(gui.scroll_region_left), FILL_Y(row),
+ gui.char_width * (gui.scroll_region_right
+ - gui.scroll_region_left + 1) + 1,
+ gui.char_height * (gui.scroll_region_bot - row - num_lines + 1));
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+ check_copy_area();
+}
+
+/*
+ * X Selection stuff, for cutting and pasting text to other windows.
+ */
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ GdkAtom target;
+ unsigned i;
+ int nbytes;
+ char_u *buffer;
+
+ for (i = 0; i < N_SELECTION_TARGETS; ++i)
+ {
+ received_selection = RS_NONE;
+ target = gdk_atom_intern(selection_targets[i].target, FALSE);
+
+ gtk_selection_convert(gui.drawarea,
+ cbd->gtk_sel_atom, target,
+ (guint32)GDK_CURRENT_TIME);
+
+ while (received_selection == RS_NONE)
+ gtk_main(); /* wait for selection_received_cb */
+
+ if (received_selection != RS_FAIL)
+ return;
+ }
+
+ /* Final fallback position - use the X CUT_BUFFER0 store */
+ nbytes = 0;
+ buffer = (char_u *)XFetchBuffer(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
+ &nbytes, 0);
+ if (nbytes > 0)
+ {
+ /* Got something */
+ clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
+ if (p_verbose > 0)
+ smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
+ }
+ if (buffer != NULL)
+ XFree(buffer);
+}
+
+/*
+ * Disown the selection.
+ */
+/*ARGSUSED*/
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+ /* WEIRD: when using NULL to actually disown the selection, we lose the
+ * selection the first time we own it. */
+ /*
+ gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, (guint32)GDK_CURRENT_TIME);
+ gui_mch_update();
+ */
+}
+
+/*
+ * Own the selection and return OK if it worked.
+ */
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ int success;
+
+ success = gtk_selection_owner_set(gui.drawarea, cbd->gtk_sel_atom,
+ (guint32)GDK_CURRENT_TIME);
+ gui_mch_update();
+ return (success) ? OK : FAIL;
+}
+
+/*
+ * Send the current selection to the clipboard. Do nothing for X because we
+ * will fill in the selection only when requested by another app.
+ */
+/*ARGSUSED*/
+ void
+clip_mch_set_selection(VimClipboard *cbd)
+{
+}
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Make a menu item appear either active or not active (grey or not grey).
+ */
+ void
+gui_mch_menu_grey(vimmenu_T *menu, int grey)
+{
+ if (menu->id == NULL)
+ return;
+
+ if (menu_is_separator(menu->name))
+ grey = TRUE;
+
+ gui_mch_menu_hidden(menu, FALSE);
+ /* Be clever about bitfields versus true booleans here! */
+ if (!GTK_WIDGET_SENSITIVE(menu->id) == !grey)
+ {
+ gtk_widget_set_sensitive(menu->id, !grey);
+ gui_mch_update();
+ }
+}
+
+/*
+ * Make menu item hidden or not hidden.
+ */
+ void
+gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
+{
+ if (menu->id == 0)
+ return;
+
+ if (hidden)
+ {
+ if (GTK_WIDGET_VISIBLE(menu->id))
+ {
+ gtk_widget_hide(menu->id);
+ gui_mch_update();
+ }
+ }
+ else
+ {
+ if (!GTK_WIDGET_VISIBLE(menu->id))
+ {
+ gtk_widget_show(menu->id);
+ gui_mch_update();
+ }
+ }
+}
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar(void)
+{
+ /* just make sure that the visual changes get effect immediately */
+ gui_mch_update();
+}
+#endif /* FEAT_MENU */
+
+/*
+ * Scrollbar stuff.
+ */
+ void
+gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
+{
+ if (sb->id == NULL)
+ return;
+
+ if (flag)
+ gtk_widget_show(sb->id);
+ else
+ gtk_widget_hide(sb->id);
+
+ update_window_manager_hints();
+}
+
+
+/*
+ * Return the RGB value of a pixel as long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ GdkColor color;
+#ifndef HAVE_GTK2
+ GdkColorContext *cc;
+
+ cc = gdk_color_context_new(gtk_widget_get_visual(gui.drawarea),
+ gtk_widget_get_colormap(gui.drawarea));
+ color.pixel = pixel;
+ gdk_color_context_query_color(cc, &color);
+
+ gdk_color_context_free(cc);
+#else
+ gdk_colormap_query_color(gtk_widget_get_colormap(gui.drawarea),
+ (unsigned long)pixel, &color);
+#endif
+
+ return (((unsigned)color.red & 0xff00) << 8)
+ | ((unsigned)color.green & 0xff00)
+ | (((unsigned)color.blue & 0xff00) >> 8);
+}
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x(void)
+{
+ int win_x;
+
+ gdk_window_get_pointer(gui.drawarea->window, &win_x, NULL, NULL);
+ return win_x;
+}
+
+ int
+gui_mch_get_mouse_y(void)
+{
+ int win_y;
+
+ gdk_window_get_pointer(gui.drawarea->window, NULL, &win_y, NULL);
+ return win_y;
+}
+
+ void
+gui_mch_setmouse(int x, int y)
+{
+ /* Sorry for the Xlib call, but we can't avoid it, since there is no
+ * internal GDK mechanism present to accomplish this. (and for good
+ * reason...) */
+ XWarpPointer(GDK_WINDOW_XDISPLAY(gui.drawarea->window),
+ (Window)0, GDK_WINDOW_XWINDOW(gui.drawarea->window),
+ 0, 0, 0U, 0U, x, y);
+}
+
+
+#ifdef FEAT_MOUSESHAPE
+/* The last set mouse pointer shape is remembered, to be used when it goes
+ * from hidden to not hidden. */
+static int last_shape = 0;
+#endif
+
+/*
+ * Use the blank mouse pointer or not.
+ *
+ * hide: TRUE = use blank ptr, FALSE = use parent ptr
+ */
+ void
+gui_mch_mousehide(int hide)
+{
+ if (gui.pointer_hidden != hide)
+ {
+ gui.pointer_hidden = hide;
+ if (gui.drawarea->window && gui.blank_pointer != NULL)
+ {
+ if (hide)
+ gdk_window_set_cursor(gui.drawarea->window, gui.blank_pointer);
+ else
+#ifdef FEAT_MOUSESHAPE
+ mch_set_mouse_shape(last_shape);
+#else
+ gdk_window_set_cursor(gui.drawarea->window, NULL);
+#endif
+ }
+ }
+}
+
+#if defined(FEAT_MOUSESHAPE) || defined(PROTO)
+
+/* Table for shape IDs. Keep in sync with the mshape_names[] table in
+ * misc2.c! */
+static const int mshape_ids[] =
+{
+ GDK_LEFT_PTR, /* arrow */
+ GDK_CURSOR_IS_PIXMAP, /* blank */
+ GDK_XTERM, /* beam */
+ GDK_SB_V_DOUBLE_ARROW, /* updown */
+ GDK_SIZING, /* udsizing */
+ GDK_SB_H_DOUBLE_ARROW, /* leftright */
+ GDK_SIZING, /* lrsizing */
+ GDK_WATCH, /* busy */
+ GDK_X_CURSOR, /* no */
+ GDK_CROSSHAIR, /* crosshair */
+ GDK_HAND1, /* hand1 */
+ GDK_HAND2, /* hand2 */
+ GDK_PENCIL, /* pencil */
+ GDK_QUESTION_ARROW, /* question */
+ GDK_RIGHT_PTR, /* right-arrow */
+ GDK_CENTER_PTR, /* up-arrow */
+ GDK_LEFT_PTR /* last one */
+};
+
+ void
+mch_set_mouse_shape(int shape)
+{
+ int id;
+ GdkCursor *c;
+
+ if (gui.drawarea->window == NULL)
+ return;
+
+ if (shape == MSHAPE_HIDE || gui.pointer_hidden)
+ gdk_window_set_cursor(gui.drawarea->window, gui.blank_pointer);
+ else
+ {
+ if (shape >= MSHAPE_NUMBERED)
+ {
+ id = shape - MSHAPE_NUMBERED;
+ if (id >= GDK_LAST_CURSOR)
+ id = GDK_LEFT_PTR;
+ else
+ id &= ~1; /* they are always even (why?) */
+ }
+ else
+ id = mshape_ids[shape];
+# ifdef HAVE_GTK_MULTIHEAD
+ c = gdk_cursor_new_for_display(
+ gtk_widget_get_display(gui.drawarea), id);
+# else
+ c = gdk_cursor_new(id);
+# endif
+ gdk_window_set_cursor(gui.drawarea->window, c);
+ gdk_cursor_destroy(c); /* Unref, actually. Bloody GTK+ 1. */
+ }
+ if (shape != MSHAPE_HIDE)
+ last_shape = shape;
+}
+#endif /* FEAT_MOUSESHAPE */
+
+
+#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+/*
+ * Signs are currently always 2 chars wide. With GTK+ 2, the image will be
+ * scaled down if the current font is not big enough, or scaled up if the image
+ * size is less than 3/4 of the maximum sign size. With GTK+ 1, the pixmap
+ * will be cut off if the current font is not big enough, or centered if it's
+ * too small.
+ */
+# define SIGN_WIDTH (2 * gui.char_width)
+# define SIGN_HEIGHT (gui.char_height)
+# define SIGN_ASPECT ((double)SIGN_HEIGHT / (double)SIGN_WIDTH)
+
+# ifdef HAVE_GTK2
+
+ void
+gui_mch_drawsign(int row, int col, int typenr)
+{
+ GdkPixbuf *sign;
+
+ sign = (GdkPixbuf *)sign_get_image(typenr);
+
+ if (sign != NULL && gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
+ int width;
+ int height;
+ int xoffset;
+ int yoffset;
+ int need_scale;
+
+ width = gdk_pixbuf_get_width(sign);
+ height = gdk_pixbuf_get_height(sign);
+ /*
+ * Decide whether we need to scale. Allow one pixel of border
+ * width to be cut off, in order to avoid excessive scaling for
+ * tiny differences in font size.
+ */
+ need_scale = (width > SIGN_WIDTH + 2
+ || height > SIGN_HEIGHT + 2
+ || (width < 3 * SIGN_WIDTH / 4
+ && height < 3 * SIGN_HEIGHT / 4));
+ if (need_scale)
+ {
+ double aspect;
+
+ /* Keep the original aspect ratio */
+ aspect = (double)height / (double)width;
+ width = (double)SIGN_WIDTH * SIGN_ASPECT / aspect;
+ width = MIN(width, SIGN_WIDTH);
+ height = (double)width * aspect;
+
+ /* This doesn't seem to be worth caching, and doing so
+ * would complicate the code quite a bit. */
+ sign = gdk_pixbuf_scale_simple(sign, width, height,
+ GDK_INTERP_BILINEAR);
+ if (sign == NULL)
+ return; /* out of memory */
+ }
+
+ /* The origin is the upper-left corner of the pixmap. Therefore
+ * these offset may become negative if the pixmap is smaller than
+ * the 2x1 cells reserved for the sign icon. */
+ xoffset = (width - SIGN_WIDTH) / 2;
+ yoffset = (height - SIGN_HEIGHT) / 2;
+
+ gdk_gc_set_foreground(gui.text_gc, gui.bgcolor);
+
+ gdk_draw_rectangle(gui.drawarea->window,
+ gui.text_gc,
+ TRUE,
+ FILL_X(col),
+ FILL_Y(row),
+ SIGN_WIDTH,
+ SIGN_HEIGHT);
+
+# if GTK_CHECK_VERSION(2,1,1)
+ gdk_draw_pixbuf(gui.drawarea->window,
+ NULL,
+ sign,
+ MAX(0, xoffset),
+ MAX(0, yoffset),
+ FILL_X(col) - MIN(0, xoffset),
+ FILL_Y(row) - MIN(0, yoffset),
+ MIN(width, SIGN_WIDTH),
+ MIN(height, SIGN_HEIGHT),
+ GDK_RGB_DITHER_NORMAL,
+ 0, 0);
+# else
+ gdk_pixbuf_render_to_drawable_alpha(sign,
+ gui.drawarea->window,
+ MAX(0, xoffset),
+ MAX(0, yoffset),
+ FILL_X(col) - MIN(0, xoffset),
+ FILL_Y(row) - MIN(0, yoffset),
+ MIN(width, SIGN_WIDTH),
+ MIN(height, SIGN_HEIGHT),
+ GDK_PIXBUF_ALPHA_BILEVEL,
+ 127,
+ GDK_RGB_DITHER_NORMAL,
+ 0, 0);
+# endif
+ if (need_scale)
+ g_object_unref(sign);
+ }
+}
+
+ void *
+gui_mch_register_sign(char_u *signfile)
+{
+ if (signfile[0] != NUL && signfile[0] != '-' && gui.in_use)
+ {
+ GdkPixbuf *sign;
+ GError *error = NULL;
+ char_u *message;
+
+ sign = gdk_pixbuf_new_from_file((const char *)signfile, &error);
+
+ if (error == NULL)
+ return sign;
+
+ message = (char_u *)error->message;
+
+ if (message != NULL && input_conv.vc_type != CONV_NONE)
+ message = string_convert(&input_conv, message, NULL);
+
+ if (message != NULL)
+ {
+ /* The error message is already translated and will be more
+ * descriptive than anything we could possibly do ourselves. */
+ EMSG2("E255: %s", message);
+
+ if (input_conv.vc_type != CONV_NONE)
+ vim_free(message);
+ }
+ g_error_free(error);
+ }
+
+ return NULL;
+}
+
+ void
+gui_mch_destroy_sign(void *sign)
+{
+ if (sign != NULL)
+ g_object_unref(sign);
+}
+
+# else /* !HAVE_GTK2 */
+
+typedef struct
+{
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+}
+signicon_T;
+
+ void
+gui_mch_drawsign(int row, int col, int typenr)
+{
+ signicon_T *sign;
+
+ sign = (signicon_T *)sign_get_image(typenr);
+
+ if (sign != NULL && sign->pixmap != NULL
+ && gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
+ int width;
+ int height;
+ int xoffset;
+ int yoffset;
+
+ gdk_window_get_size(sign->pixmap, &width, &height);
+
+ /* The origin is the upper-left corner of the pixmap. Therefore
+ * these offset may become negative if the pixmap is smaller than
+ * the 2x1 cells reserved for the sign icon. */
+ xoffset = (width - SIGN_WIDTH) / 2;
+ yoffset = (height - SIGN_HEIGHT) / 2;
+
+ gdk_gc_set_foreground(gui.text_gc, gui.bgcolor);
+
+ gdk_draw_rectangle(gui.drawarea->window,
+ gui.text_gc,
+ TRUE,
+ FILL_X(col),
+ FILL_Y(row),
+ SIGN_WIDTH,
+ SIGN_HEIGHT);
+
+ /* Set the clip mask for bilevel transparency */
+ if (sign->mask != NULL)
+ {
+ gdk_gc_set_clip_origin(gui.text_gc,
+ FILL_X(col) - xoffset,
+ FILL_Y(row) - yoffset);
+ gdk_gc_set_clip_mask(gui.text_gc, sign->mask);
+ }
+
+ gdk_draw_pixmap(gui.drawarea->window,
+ gui.text_gc,
+ sign->pixmap,
+ MAX(0, xoffset),
+ MAX(0, yoffset),
+ FILL_X(col) - MIN(0, xoffset),
+ FILL_Y(row) - MIN(0, yoffset),
+ MIN(width, SIGN_WIDTH),
+ MIN(height, SIGN_HEIGHT));
+
+ gdk_gc_set_clip_mask(gui.text_gc, NULL);
+ }
+}
+
+ void *
+gui_mch_register_sign(char_u *signfile)
+{
+ signicon_T *sign = NULL;
+
+ if (signfile[0] != NUL && signfile[0] != '-'
+ && gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
+ sign = (signicon_T *)alloc(sizeof(signicon_T));
+
+ if (sign != NULL) /* NULL == OOM == "cannot really happen" */
+ {
+ sign->mask = NULL;
+ sign->pixmap = gdk_pixmap_colormap_create_from_xpm(
+ gui.drawarea->window, NULL,
+ &sign->mask, NULL,
+ (const char *)signfile);
+
+ if (sign->pixmap == NULL)
+ {
+ vim_free(sign);
+ sign = NULL;
+ EMSG(_(e_signdata));
+ }
+ }
+ }
+ return sign;
+}
+
+ void
+gui_mch_destroy_sign(void *sign)
+{
+ if (sign != NULL)
+ {
+ signicon_T *signicon = (signicon_T *)sign;
+
+ if (signicon->pixmap != NULL)
+ gdk_pixmap_unref(signicon->pixmap);
+ if (signicon->mask != NULL)
+ gdk_bitmap_unref(signicon->mask);
+
+ vim_free(signicon);
+ }
+}
+# endif /* !HAVE_GTK2 */
+
+#endif /* FEAT_SIGN_ICONS */
+
diff --git a/src/gui_mac.c b/src/gui_mac.c
new file mode 100644
index 000000000..2b74c6328
--- /dev/null
+++ b/src/gui_mac.c
@@ -0,0 +1,5820 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ * Macintosh port by Dany St-Amant
+ * and Axel Kielhorn
+ * Port to MPW by Bernhard PrŸmmer
+ * Initial Carbon port by Ammon Skidmore
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * NOTE: Comment mentionning FAQ refer to the book:
+ * "Macworld Mac Programming FAQs" from "IDG Books"
+ */
+
+/*
+ * WARNING: Vim must be able to compile without Carbon
+ * As the desired minimum requirement are circa System 7
+ * (I want to run it on my Mac Classic) (Dany)
+ */
+
+/*
+ * TODO: Change still to merge from the macvim's iDisk
+ *
+ * error_ga, mch_errmsg, Navigation's changes in gui_mch_browse
+ * uses of MenuItemIndex, changes in gui_mch_set_shellsize,
+ * ScrapManager error handling.
+ * Comments about function remaining to Carbonize.
+ *
+ */
+
+/* TODO: find the best place for this (Dany) */
+#if 0
+# if ! TARGET_API_MAC_CARBON
+/* Enable the new API functions even when not compiling for Carbon */
+/* Apple recomends Universal Interface 3.3.2 or later */
+# define OPAQUE_TOOLBOX_STRUCTS 1
+# define ACCESSOR_CALLS_ARE_FUNCTIONS 1
+/* Help Menu not supported by Carbon */
+# define USE_HELPMENU
+# endif
+#endif
+
+#include <Devices.h> /* included first to avoid CR problems */
+#include "vim.h"
+
+/* Enable Contextual Menu Support */
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0320
+# define USE_CTRLCLICKMENU
+#endif
+
+/* Put Vim Help in MacOS Help */
+#define USE_HELPMENU
+
+/* Enable AEVENT */
+#define USE_AEVENT
+
+/* Compile as CodeWarior External Editor */
+#if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT)
+# define USE_AEVENT /* Need Apple Event Support */
+#endif
+
+/* The VIM creator is CodeWarior specific */
+#if !(defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__))
+# define USE_VIM_CREATOR_ID
+#else
+# if 0 /* Was this usefull for some compiler? (Dany) */
+static OSType _fcreator = 'VIM!';
+static OSType _ftype = 'TEXT';
+# endif
+#endif
+
+/* CARBON version only tested with Project Builder under MacOS X */
+#undef USE_CARBONIZED
+#if (defined(__APPLE_CC__) || defined(__MRC__)) && defined(TARGET_API_MAC_CARBON)
+# if TARGET_API_MAC_CARBON
+# define USE_CARBONIZED
+# endif
+#endif
+
+#undef USE_MOUSEWHEEL
+#if defined(MACOS_X) && defined(USE_CARBONIZED)
+# define USE_MOUSEWHEEL
+static EventHandlerUPP mouseWheelHandlerUPP = NULL;
+#endif
+
+/* Debugging feature: start Vim window OFFSETed */
+#undef USE_OFFSETED_WINDOW
+
+/* Debugging feature: use CodeWarior SIOUX */
+#undef USE_SIOUX
+
+
+/* Include some file. TODO: move into os_mac.h */
+#include <Menus.h>
+#include <Resources.h>
+#if !TARGET_API_MAC_CARBON
+#include <StandardFile.h>
+#include <Traps.h>
+#endif
+#include <Balloons.h>
+#include <Processes.h>
+#ifdef USE_AEVENT
+# include <AppleEvents.h>
+# include <AERegistry.h>
+#endif
+#ifdef USE_CTRLCLICKMENU
+# include <Gestalt.h>
+#endif
+#ifdef USE_SIOUX
+# include <stdio.h>
+# include <sioux.h>
+# include <console.h>
+#endif
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0330
+# include <ControlDefinitions.h>
+# include <Navigation.h> /* Navigation only part of ?? */
+#endif
+
+#if TARGET_API_MAC_CARBON && 0
+/* New Help Interface for Mac, not implemented yet.*/
+# include <MacHelp.h>
+#endif
+
+/*
+ * Translate new name to old ones
+ * New function only available in MacOS 8.5,
+ * So use old one to be compatible back to System 7
+ */
+#ifndef USE_CARBONIZED
+# undef EnableMenuItem
+# define EnableMenuItem EnableItem
+# undef DisableMenuItem
+# define DisableMenuItem DisableItem
+#endif
+
+/* Carbon does not support the Get/SetControll functions,
+ * use Get/SetControl32Bit instead and rename for non-carbon
+ * systems.
+ */
+
+#ifndef USE_CARBONIZED
+# undef SetControl32BitMaximum
+# define SetControl32BitMaximum SetControlMaximum
+# undef SetControl32BitMinimum
+# define SetControl32BitMinimum SetControlMinimum
+# undef SetControl32BitValue
+# define SetControl32BitValue SetControlValue
+# undef GetControl32BitValue
+# define GetControl32BitValue GetControlValue
+#endif
+
+/*
+ * ???
+ */
+
+#define kNothing 0
+#define kCreateEmpty 2 /*1*/
+#define kCreateRect 2
+#define kDestroy 3
+
+/*
+ * Dany: Don't like those...
+ */
+
+#define topLeft(r) (((Point*)&(r))[0])
+#define botRight(r) (((Point*)&(r))[1])
+
+
+/* Time of last mouse click, to detect double-click */
+static long lastMouseTick = 0;
+
+/* ??? */
+static RgnHandle cursorRgn;
+static RgnHandle dragRgn;
+static Rect dragRect;
+static short dragRectEnbl;
+static short dragRectControl;
+
+/* This variable is set when waiting for an event, which is the only moment
+ * scrollbar dragging can be done directly. It's not allowed while commands
+ * are executed, because it may move the cursor and that may cause unexpected
+ * problems (e.g., while ":s" is working).
+ */
+static int allow_scrollbar = FALSE;
+
+/* Last mouse click caused contextual menu, (to provide proper release) */
+#ifdef USE_CTRLCLICKMENU
+static short clickIsPopup;
+#endif
+
+/* Feedback Action for Scrollbar */
+ControlActionUPP gScrollAction;
+ControlActionUPP gScrollDrag;
+
+/* Keeping track of which scrollbar is being dragged */
+static ControlHandle dragged_sb = NULL;
+
+/*
+ * The Quickdraw global is predefined in CodeWarior
+ * but is not in Apple MPW
+ */
+#if (defined(__MRC__) || defined(__SC__))
+# if !(defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON)
+QDGlobals qd;
+# endif
+#endif
+
+/* Colors Macros */
+#define RGB(r,g,b) ((r) << 16) + ((g) << 8) + (b)
+#define Red(c) ((c & 0x00FF0000) >> 16)
+#define Green(c) ((c & 0x0000FF00) >> 8)
+#define Blue(c) ((c & 0x000000FF) >> 0)
+
+/* Key mapping */
+
+#define vk_Esc 0x35 /* -> 1B */
+
+#define vk_F1 0x7A /* -> 10 */
+#define vk_F2 0x78 /*0x63*/
+#define vk_F3 0x63 /*0x76*/
+#define vk_F4 0x76 /*0x60*/
+#define vk_F5 0x60 /*0x61*/
+#define vk_F6 0x61 /*0x62*/
+#define vk_F7 0x62 /*0x63*/ /*?*/
+#define vk_F8 0x64
+#define vk_F9 0x65
+#define vk_F10 0x6D
+#define vk_F11 0x67
+#define vk_F12 0x6F
+#define vk_F13 0x69
+#define vk_F14 0x6B
+#define vk_F15 0x71
+
+#define vk_Clr 0x47 /* -> 1B (ESC) */
+#define vk_Enter 0x4C /* -> 03 */
+
+#define vk_Space 0x31 /* -> 20 */
+#define vk_Tab 0x30 /* -> 09 */
+#define vk_Return 0x24 /* -> 0D */
+/* This is wrong for OSX, what is it for? */
+#define vk_Delete 0X08 /* -> 08 BackSpace */
+
+#define vk_Help 0x72 /* -> 05 */
+#define vk_Home 0x73 /* -> 01 */
+#define vk_PageUp 0x74 /* -> 0D */
+#define vk_FwdDelete 0x75 /* -> 7F */
+#define vk_End 0x77 /* -> 04 */
+#define vk_PageDown 0x79 /* -> 0C */
+
+#define vk_Up 0x7E /* -> 1E */
+#define vk_Down 0x7D /* -> 1F */
+#define vk_Left 0x7B /* -> 1C */
+#define vk_Right 0x7C /* -> 1D */
+
+#define vk_Undo vk_F1
+#define vk_Cut vk_F2
+#define vk_Copy vk_F3
+#define vk_Paste vk_F4
+#define vk_PrintScreen vk_F13
+#define vk_SCrollLock vk_F14
+#define vk_Pause vk_F15
+#define vk_NumLock vk_Clr
+#define vk_Insert vk_Help
+
+#define KeySym char
+
+static struct
+{
+ KeySym key_sym;
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {vk_Up, 'k', 'u'},
+ {vk_Down, 'k', 'd'},
+ {vk_Left, 'k', 'l'},
+ {vk_Right, 'k', 'r'},
+
+ {vk_F1, 'k', '1'},
+ {vk_F2, 'k', '2'},
+ {vk_F3, 'k', '3'},
+ {vk_F4, 'k', '4'},
+ {vk_F5, 'k', '5'},
+ {vk_F6, 'k', '6'},
+ {vk_F7, 'k', '7'},
+ {vk_F8, 'k', '8'},
+ {vk_F9, 'k', '9'},
+ {vk_F10, 'k', ';'},
+
+ {vk_F11, 'F', '1'},
+ {vk_F12, 'F', '2'},
+ {vk_F13, 'F', '3'},
+ {vk_F14, 'F', '4'},
+ {vk_F15, 'F', '5'},
+
+/* {XK_Help, '%', '1'}, */
+/* {XK_Undo, '&', '8'}, */
+/* {XK_BackSpace, 'k', 'b'}, */
+#ifndef MACOS_X
+ {vk_Delete, 'k', 'b'},
+#endif
+ {vk_Insert, 'k', 'I'},
+ {vk_FwdDelete, 'k', 'D'},
+ {vk_Home, 'k', 'h'},
+ {vk_End, '@', '7'},
+/* {XK_Prior, 'k', 'P'}, */
+/* {XK_Next, 'k', 'N'}, */
+/* {XK_Print, '%', '9'}, */
+
+ {vk_PageUp, 'k', 'P'},
+ {vk_PageDown, 'k', 'N'},
+
+ /* End of list marker: */
+ {(KeySym)0, 0, 0}
+};
+
+/*
+ * ------------------------------------------------------------
+ * Forward declaration (for those needed)
+ * ------------------------------------------------------------
+ */
+
+#ifdef USE_AEVENT
+OSErr HandleUnusedParms (const AppleEvent *theAEvent);
+#endif
+
+/*
+ * ------------------------------------------------------------
+ * Conversion Utility
+ * ------------------------------------------------------------
+ */
+
+/*
+ * C2Pascal_save
+ *
+ * Allocate memory and convert the C-String passed in
+ * into a pascal string
+ *
+ */
+
+char_u *C2Pascal_save(char_u *Cstring)
+{
+ char_u *PascalString;
+ int len;
+
+ if (Cstring == NULL)
+ return NULL;
+
+ len = STRLEN(Cstring);
+
+ if (len > 255) /* Truncate if necessary */
+ len = 255;
+
+ PascalString = alloc(len + 1);
+ if (PascalString != NULL)
+ {
+ mch_memmove(PascalString + 1, Cstring, len);
+ PascalString[0] = len;
+ }
+
+ return PascalString;
+}
+
+/*
+ * C2Pascal_save_and_remove_backslash
+ *
+ * Allocate memory and convert the C-String passed in
+ * into a pascal string. Also remove the backslash at the same time
+ *
+ */
+
+char_u *C2Pascal_save_and_remove_backslash(char_u *Cstring)
+{
+ char_u *PascalString;
+ int len;
+ char_u *p, *c;
+
+ len = STRLEN(Cstring);
+
+ if (len > 255) /* Truncate if necessary */
+ len = 255;
+
+ PascalString = alloc(len + 1);
+ if (PascalString != NULL)
+ {
+ for (c = Cstring, p = PascalString+1, len = 0; (*c != 0) && (len < 255); c++)
+ {
+ if ((*c == '\\') && (c[1] != 0))
+ {
+ c++;
+ }
+ *p = *c;
+ p++;
+ len++;
+ }
+ PascalString[0] = len;
+ }
+
+ return PascalString;
+}
+
+/*
+ * Convert the modifiers of an Event into vim's modifiers (mouse)
+ */
+
+ int_u
+EventModifiers2VimMouseModifiers(EventModifiers macModifiers)
+{
+ int_u vimModifiers = 0x00;
+
+ if (macModifiers & (shiftKey | rightShiftKey))
+ vimModifiers |= MOUSE_SHIFT;
+ if (macModifiers & (controlKey | rightControlKey))
+ vimModifiers |= MOUSE_CTRL;
+ if (macModifiers & (optionKey | rightOptionKey))
+ vimModifiers |= MOUSE_ALT;
+#if 0
+ /* Not yet supported */
+ if (macModifiers & (cmdKey)) /* There's no rightCmdKey */
+ vimModifiers |= MOUSE_CMD;
+#endif
+ return (vimModifiers);
+}
+
+/*
+ * Convert the modifiers of an Event into vim's modifiers (keys)
+ */
+
+ static int_u
+EventModifiers2VimModifiers(EventModifiers macModifiers)
+{
+ int_u vimModifiers = 0x00;
+
+ if (macModifiers & (shiftKey | rightShiftKey))
+ vimModifiers |= MOD_MASK_SHIFT;
+ if (macModifiers & (controlKey | rightControlKey))
+ vimModifiers |= MOD_MASK_CTRL;
+ if (macModifiers & (optionKey | rightOptionKey))
+ vimModifiers |= MOD_MASK_ALT;
+#ifdef USE_CMD_KEY
+ if (macModifiers & (cmdKey)) /* There's no rightCmdKey */
+ vimModifiers |= MOD_MASK_CMD;
+#endif
+ return (vimModifiers);
+}
+
+/* Convert a string representing a point size into pixels. The string should
+ * be a positive decimal number, with an optional decimal point (eg, "12", or
+ * "10.5"). The pixel value is returned, and a pointer to the next unconverted
+ * character is stored in *end. The flag "vertical" says whether this
+ * calculation is for a vertical (height) size or a horizontal (width) one.
+ *
+ * From gui_w48.c
+ */
+ static int
+points_to_pixels(char_u *str, char_u **end, int vertical)
+{
+ int pixels;
+ int points = 0;
+ int divisor = 0;
+
+ while (*str)
+ {
+ if (*str == '.' && divisor == 0)
+ {
+ /* Start keeping a divisor, for later */
+ divisor = 1;
+ continue;
+ }
+
+ if (!isdigit(*str))
+ break;
+
+ points *= 10;
+ points += *str - '0';
+ divisor *= 10;
+
+ ++str;
+ }
+
+ if (divisor == 0)
+ divisor = 1;
+
+ pixels = points/divisor;
+ *end = str;
+ return pixels;
+}
+
+/*
+ * Convert a list of FSSpec aliases into a list of fullpathname
+ * character strings.
+ */
+
+char_u **new_fnames_from_AEDesc(AEDesc *theList, long *numFiles, OSErr *error)
+{
+ char_u **fnames = NULL;
+ OSErr newError;
+ long fileCount;
+ FSSpec fileToOpen;
+ long actualSize;
+ AEKeyword dummyKeyword;
+ DescType dummyType;
+
+ /* Get number of files in list */
+ *error = AECountItems(theList, numFiles);
+ if (*error)
+ {
+#ifdef USE_SIOUX
+ printf ("fname_from_AEDesc: AECountItems error: %d\n", error);
+#endif
+ return(fnames);
+ }
+
+ /* Allocate the pointer list */
+ fnames = (char_u **) alloc(*numFiles * sizeof(char_u *));
+
+ /* Empty out the list */
+ for (fileCount = 0; fileCount < *numFiles; fileCount++)
+ fnames[fileCount] = NULL;
+
+ /* Scan the list of FSSpec */
+ for (fileCount = 1; fileCount <= *numFiles; fileCount++)
+ {
+ /* Get the alias for the nth file, convert to an FSSpec */
+ newError = AEGetNthPtr(theList, fileCount, typeFSS,
+ &dummyKeyword, &dummyType,
+ (Ptr) &fileToOpen, sizeof(FSSpec), &actualSize);
+ if (newError)
+ {
+ /* Caller is able to clean up */
+ /* TODO: Should be clean up or not? For safety. */
+#ifdef USE_SIOUX
+ printf ("aevt_odoc: AEGetNthPtr error: %d\n", newError);
+#endif
+ return(fnames);
+ }
+
+ /* Convert the FSSpec to a pathname */
+ fnames[fileCount - 1] = FullPathFromFSSpec_save (fileToOpen);
+ }
+
+ return (fnames);
+}
+
+/*
+ * ------------------------------------------------------------
+ * CodeWarrior External Editor Support
+ * ------------------------------------------------------------
+ */
+#ifdef FEAT_CW_EDITOR
+
+/*
+ * Handle the Window Search event from CodeWarrior
+ *
+ * Description
+ * -----------
+ *
+ * The IDE sends the Window Search AppleEvent to the editor when it
+ * needs to know whether a particular file is open in the editor.
+ *
+ * Event Reply
+ * -----------
+ *
+ * None. Put data in the location specified in the structure received.
+ *
+ * Remarks
+ * -------
+ *
+ * When the editor receives this event, determine whether the specified
+ * file is open. If it is, return the modification date/time for that file
+ * in the appropriate location specified in the structure. If the file is
+ * not opened, put the value fnfErr (file not found) in that location.
+ *
+ */
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=mac68k
+#endif
+typedef struct WindowSearch WindowSearch;
+struct WindowSearch /* for handling class 'KAHL', event 'SRCH', keyDirectObject typeChar*/
+{
+ FSSpec theFile; // identifies the file
+ long *theDate; // where to put the modification date/time
+};
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=reset
+#endif
+
+pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+ buf_T *buf;
+ int foundFile = false;
+ DescType typeCode;
+ WindowSearch SearchData;
+ Size actualSize;
+
+ error = AEGetParamPtr(theAEvent, keyDirectObject, typeChar, &typeCode, (Ptr) &SearchData, sizeof(WindowSearch), &actualSize);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_SRCH: AEGetParamPtr error: %d\n", error);
+#endif
+ return(error);
+ }
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_SRCH: HandleUnusedParms error: %d\n", error);
+#endif
+ return(error);
+ }
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_ml.ml_mfp != NULL
+ && SearchData.theFile.parID == buf->b_FSSpec.parID
+ && SearchData.theFile.name[0] == buf->b_FSSpec.name[0]
+ && STRNCMP(SearchData.theFile.name, buf->b_FSSpec.name, buf->b_FSSpec.name[0] + 1) == 0)
+ {
+ foundFile = true;
+ break;
+ }
+
+ if (foundFile == false)
+ *SearchData.theDate = fnfErr;
+ else
+ *SearchData.theDate = buf->b_mtime;
+
+#ifdef USE_SIOUX
+ printf ("KAHL_SRCH: file \"%#s\" {%d}", SearchData.theFile.name,SearchData.theFile.parID);
+ if (foundFile == false)
+ printf (" NOT");
+ printf (" found. [date %lx, %lx]\n", *SearchData.theDate, buf->b_mtime_read);
+#endif
+
+ return error;
+};
+
+/*
+ * Handle the Modified (from IDE to Editor) event from CodeWarrior
+ *
+ * Description
+ * -----------
+ *
+ * The IDE sends this event to the external editor when it wants to
+ * know which files that are open in the editor have been modified.
+ *
+ * Parameters None.
+ * ----------
+ *
+ * Event Reply
+ * -----------
+ * The reply for this event is:
+ *
+ * keyDirectObject typeAEList required
+ * each element in the list is a structure of typeChar
+ *
+ * Remarks
+ * -------
+ *
+ * When building the reply event, include one element in the list for
+ * each open file that has been modified.
+ *
+ */
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=mac68k
+#endif
+typedef struct ModificationInfo ModificationInfo;
+struct ModificationInfo /* for replying to class 'KAHL', event 'MOD ', keyDirectObject typeAEList*/
+{
+ FSSpec theFile; // identifies the file
+ long theDate; // the date/time the file was last modified
+ short saved; // set this to zero when replying, unused
+};
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=reset
+#endif
+
+pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+ AEDescList replyList;
+ long numFiles;
+ ModificationInfo theFile;
+ buf_T *buf;
+
+ theFile.saved = 0;
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_MOD: HandleUnusedParms error: %d\n", error);
+#endif
+ return(error);
+ }
+
+ /* Send the reply */
+/* replyObject.descriptorType = typeNull;
+ replyObject.dataHandle = nil;*/
+
+/* AECreateDesc(typeChar, (Ptr)&title[1], title[0], &data) */
+ error = AECreateList(nil, 0, false, &replyList);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_MOD: AECreateList error: %d\n", error);
+#endif
+ return(error);
+ }
+
+#if 0
+ error = AECountItems(&replyList, &numFiles);
+#ifdef USE_SIOUX
+ printf ("KAHL_MOD ReplyList: %x %x\n", replyList.descriptorType, replyList.dataHandle);
+ printf ("KAHL_MOD ItemInList: %d\n", numFiles);
+#endif
+
+ /* AEPutKeyDesc (&replyList, keyAEPnject, &aDesc)
+ * AEPutKeyPtr (&replyList, keyAEPosition, typeChar, (Ptr)&theType,
+ * sizeof(DescType))
+ */
+
+ /* AEPutDesc */
+#endif
+
+ numFiles = 0;
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_ml.ml_mfp != NULL)
+ {
+ /* Add this file to the list */
+ theFile.theFile = buf->b_FSSpec;
+ theFile.theDate = buf->b_mtime;
+/* theFile.theDate = time (NULL) & (time_t) 0xFFFFFFF0; */
+ error = AEPutPtr (&replyList, numFiles, typeChar, (Ptr) &theFile, sizeof(theFile));
+#ifdef USE_SIOUX
+ if (numFiles == 0)
+ printf ("KAHL_MOD: ");
+ else
+ printf (", ");
+ printf ("\"%#s\" {%d} [date %lx, %lx]", theFile.theFile.name, theFile.theFile.parID, theFile.theDate, buf->b_mtime_read);
+ if (error)
+ printf (" (%d)", error);
+ numFiles++;
+#endif
+ };
+
+#ifdef USE_SIOUX
+ printf ("\n");
+#endif
+
+#if 0
+ error = AECountItems(&replyList, &numFiles);
+#ifdef USE_SIOUX
+ printf ("KAHL_MOD ItemInList: %d\n", numFiles);
+#endif
+#endif
+
+ /* We can add data only if something to reply */
+ error = AEPutParamDesc (theReply, keyDirectObject, &replyList);
+
+#ifdef USE_SIOUX
+ if (error)
+ printf ("KAHL_MOD: AEPutParamDesc error: %d\n", error);
+#endif
+
+ if (replyList.dataHandle)
+ AEDisposeDesc(&replyList);
+
+ return error;
+};
+
+/*
+ * Handle the Get Text event from CodeWarrior
+ *
+ * Description
+ * -----------
+ *
+ * The IDE sends the Get Text AppleEvent to the editor when it needs
+ * the source code from a file. For example, when the user issues a
+ * Check Syntax or Compile command, the compiler needs access to
+ * the source code contained in the file.
+ *
+ * Event Reply
+ * -----------
+ *
+ * None. Put data in locations specified in the structure received.
+ *
+ * Remarks
+ * -------
+ *
+ * When the editor receives this event, it must set the size of the handle
+ * in theText to fit the data in the file. It must then copy the entire
+ * contents of the specified file into the memory location specified in
+ * theText.
+ *
+ */
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=mac68k
+#endif
+typedef struct CW_GetText CW_GetText;
+struct CW_GetText /* for handling class 'KAHL', event 'GTTX', keyDirectObject typeChar*/
+{
+ FSSpec theFile; /* identifies the file */
+ Handle theText; /* the location where you return the text (must be resized properly) */
+ long *unused; /* 0 (not used) */
+ long *theDate; /* where to put the modification date/time */
+};
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=reset
+#endif
+
+pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+ buf_T *buf;
+ int foundFile = false;
+ DescType typeCode;
+ CW_GetText GetTextData;
+ Size actualSize;
+ char_u *line;
+ char_u *fullbuffer = NULL;
+ long linesize;
+ long lineStart;
+ long BufferSize;
+ long lineno;
+
+ error = AEGetParamPtr(theAEvent, keyDirectObject, typeChar, &typeCode, (Ptr) &GetTextData, sizeof(GetTextData), &actualSize);
+
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_GTTX: AEGetParamPtr error: %d\n", error);
+#endif
+ return(error);
+ }
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_ml.ml_mfp != NULL)
+ if (GetTextData.theFile.parID == buf->b_FSSpec.parID)
+ {
+ foundFile = true;
+ break;
+ }
+
+ if (foundFile)
+ {
+ BufferSize = 0; /* GetHandleSize (GetTextData.theText); */
+ for (lineno = 0; lineno <= buf->b_ml.ml_line_count; lineno++)
+ {
+ /* Must use the right buffer */
+ line = ml_get_buf(buf, (linenr_T) lineno, FALSE);
+ linesize = STRLEN(line) + 1;
+ lineStart = BufferSize;
+ BufferSize += linesize;
+ /* Resize handle to linesize+1 to include the linefeed */
+ SetHandleSize (GetTextData.theText, BufferSize);
+ if (GetHandleSize (GetTextData.theText) != BufferSize)
+ {
+ #ifdef USE_SIOUX
+ printf ("KAHL_GTTX: SetHandleSize increase: %d, size %d\n",
+ linesize, BufferSize);
+ #endif
+ break; /* Simple handling for now */
+ }
+ else
+ {
+ HLock (GetTextData.theText);
+ fullbuffer = (char_u *) *GetTextData.theText;
+ STRCPY ((char_u *) (fullbuffer + lineStart), line);
+ fullbuffer[BufferSize-1] = '\r';
+ HUnlock (GetTextData.theText);
+ }
+ }
+ if (fullbuffer != NULL)
+ {
+ HLock (GetTextData.theText);
+ fullbuffer[BufferSize-1] = 0;
+ HUnlock (GetTextData.theText);
+ }
+ if (foundFile == false)
+ *GetTextData.theDate = fnfErr;
+ else
+/* *GetTextData.theDate = time (NULL) & (time_t) 0xFFFFFFF0;*/
+ *GetTextData.theDate = buf->b_mtime;
+ }
+#ifdef USE_SIOUX
+ printf ("KAHL_GTTX: file \"%#s\" {%d} [date %lx, %lx]", GetTextData.theFile.name, GetTextData.theFile.parID, *GetTextData.theDate, buf->b_mtime_read);
+ if (foundFile == false)
+ printf (" NOT");
+ printf (" found. (BufferSize = %d)\n", BufferSize);
+#endif
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_GTTX: HandleUnusedParms error: %d\n", error);
+#endif
+ return(error);
+ }
+
+ return(error);
+}
+
+/*
+ *
+ */
+
+/* Taken from MoreAppleEvents:ProcessHelpers*/
+pascal OSErr FindProcessBySignature( const OSType targetType,
+ const OSType targetCreator,
+ ProcessSerialNumberPtr psnPtr )
+{
+ OSErr anErr = noErr;
+ Boolean lookingForProcess = true;
+
+ ProcessInfoRec infoRec;
+
+ infoRec.processInfoLength = sizeof( ProcessInfoRec );
+ infoRec.processName = nil;
+ infoRec.processAppSpec = nil;
+
+ psnPtr->lowLongOfPSN = kNoProcess;
+ psnPtr->highLongOfPSN = kNoProcess;
+
+ while ( lookingForProcess )
+ {
+ anErr = GetNextProcess( psnPtr );
+ if ( anErr != noErr )
+ {
+ lookingForProcess = false;
+ }
+ else
+ {
+ anErr = GetProcessInformation( psnPtr, &infoRec );
+ if ( ( anErr == noErr )
+ && ( infoRec.processType == targetType )
+ && ( infoRec.processSignature == targetCreator ) )
+ {
+ lookingForProcess = false;
+ }
+ }
+ }
+
+ return anErr;
+}//end FindProcessBySignature
+
+void Send_KAHL_MOD_AE (buf_T *buf)
+{
+ OSErr anErr = noErr;
+ AEDesc targetAppDesc = { typeNull, nil };
+ ProcessSerialNumber psn = { kNoProcess, kNoProcess };
+ AppleEvent theReply = { typeNull, nil };
+ AESendMode sendMode;
+ AppleEvent theEvent = {typeNull, nil };
+ AEIdleUPP idleProcUPP = nil;
+ ModificationInfo ModData;
+
+
+ anErr = FindProcessBySignature( 'APPL', 'CWIE', &psn );
+#ifdef USE_SIOUX
+ printf ("CodeWarrior is");
+ if (anErr != noErr)
+ printf (" NOT");
+ printf (" running\n");
+#endif
+ if ( anErr == noErr )
+ {
+ anErr = AECreateDesc (typeProcessSerialNumber, &psn,
+ sizeof( ProcessSerialNumber ), &targetAppDesc);
+
+ if ( anErr == noErr )
+ {
+ anErr = AECreateAppleEvent( 'KAHL', 'MOD ', &targetAppDesc,
+ kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
+ }
+
+ AEDisposeDesc( &targetAppDesc );
+
+ /* Add the parms */
+ ModData.theFile = buf->b_FSSpec;
+ ModData.theDate = buf->b_mtime;
+
+ if (anErr == noErr)
+ anErr =AEPutParamPtr (&theEvent, keyDirectObject, typeChar, &ModData, sizeof(ModData));
+
+ if ( idleProcUPP == nil )
+ sendMode = kAENoReply;
+ else
+ sendMode = kAEWaitReply;
+
+ if ( anErr == noErr )
+ anErr = AESend( &theEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, idleProcUPP, nil );
+ if ( anErr == noErr && sendMode == kAEWaitReply )
+ {
+#ifdef USE_SIOUX
+ printf ("KAHL_MOD: Send error: %d\n", anErr);
+#endif
+/* anErr = AEHGetHandlerError( &theReply );*/
+ }
+ (void) AEDisposeDesc( &theReply );
+ }
+}
+#endif /* FEAT_CW_EDITOR */
+
+/*
+ * ------------------------------------------------------------
+ * Apple Event Handling procedure
+ * ------------------------------------------------------------
+ */
+#ifdef USE_AEVENT
+
+/*
+ * Handle the Unused parms of an AppleEvent
+ */
+
+OSErr HandleUnusedParms (const AppleEvent *theAEvent)
+{
+ OSErr error;
+ long actualSize;
+ DescType dummyType;
+ AEKeyword missedKeyword;
+
+ /* Get the "missed keyword" attribute from the AppleEvent. */
+ error = AEGetAttributePtr(theAEvent, keyMissedKeywordAttr,
+ typeKeyword, &dummyType,
+ (Ptr)&missedKeyword, sizeof(missedKeyword),
+ &actualSize);
+
+ /* If the descriptor isn't found, then we got the required parameters. */
+ if (error == errAEDescNotFound)
+ {
+ error = noErr;
+ }
+ else
+ {
+#if 0
+ /* Why is this removed? */
+ error = errAEEventNotHandled;
+#endif
+ }
+
+ return error;
+}
+
+
+/*
+ * Handle the ODoc AppleEvent
+ *
+ * Deals with all files dragged to the application icon.
+ *
+ */
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=mac68k
+#endif
+typedef struct SelectionRange SelectionRange;
+struct SelectionRange /* for handling kCoreClassEvent:kOpenDocuments:keyAEPosition typeChar */
+{
+ short unused1; // 0 (not used)
+ short lineNum; // line to select (<0 to specify range)
+ long startRange; // start of selection range (if line < 0)
+ long endRange; // end of selection range (if line < 0)
+ long unused2; // 0 (not used)
+ long theDate; // modification date/time
+};
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma options align=reset
+#endif
+
+/* The IDE uses the optional keyAEPosition parameter to tell the ed-
+ itor the selection range. If lineNum is zero or greater, scroll the text
+ to the specified line. If lineNum is less than zero, use the values in
+ startRange and endRange to select the specified characters. Scroll
+ the text to display the selection. If lineNum, startRange, and
+ endRange are all negative, there is no selection range specified.
+ */
+
+pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ /*
+ * TODO: Clean up the code with convert the AppleEvent into
+ * a ":args"
+ */
+ OSErr error = noErr;
+// OSErr firstError = noErr;
+// short numErrors = 0;
+ AEDesc theList;
+ DescType typeCode;
+ long numFiles;
+ // long fileCount;
+ char_u **fnames;
+// char_u fname[256];
+ Size actualSize;
+ SelectionRange thePosition;
+ short gotPosition = false;
+ long lnum;
+
+#ifdef USE_SIOUX
+ printf ("aevt_odoc:\n");
+#endif
+
+ /* the direct object parameter is the list of aliases to files (one or more) */
+ error = AEGetParamDesc(theAEvent, keyDirectObject, typeAEList, &theList);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("aevt_odoc: AEGetParamDesc error: %d\n", error);
+#endif
+ return(error);
+ }
+
+
+ error = AEGetParamPtr(theAEvent, keyAEPosition, typeChar, &typeCode, (Ptr) &thePosition, sizeof(SelectionRange), &actualSize);
+ if (error == noErr)
+ gotPosition = true;
+ if (error == errAEDescNotFound)
+ error = noErr;
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("aevt_odoc: AEGetParamPtr error: %d\n", error);
+#endif
+ return(error);
+ }
+
+#ifdef USE_SIOUX
+ printf ("aevt_odoc: lineNum: %d, startRange %d, endRange %d, [date %lx]\n",
+ thePosition.lineNum, thePosition.startRange, thePosition.endRange,
+ thePosition.theDate);
+#endif
+/*
+ error = AEGetParamDesc(theAEvent, keyAEPosition, typeChar, &thePosition);
+
+ if (^error) then
+ {
+ if (thePosition.lineNum >= 0)
+ {
+ // Goto this line
+ }
+ else
+ {
+ // Set the range char wise
+ }
+ }
+ */
+
+
+#ifdef FEAT_VISUAL
+ reset_VIsual();
+#endif
+
+ fnames = new_fnames_from_AEDesc(&theList, &numFiles, &error);
+
+ if (error)
+ {
+ /* TODO: empty fnames[] first */
+ vim_free(fnames);
+ return (error);
+ }
+
+ if (starting > 0)
+ {
+ int i;
+ char_u *p;
+
+ /* these are the initial files dropped on the Vim icon */
+ for (i = 0 ; i < numFiles; i++)
+ {
+ if (ga_grow(&global_alist.al_ga, 1) == FAIL
+ || (p = vim_strsave(fnames[i])) == NULL)
+ mch_exit(2);
+ else
+ alist_add(&global_alist, p, 2);
+ }
+ goto finished;
+ }
+
+ /* Handle the drop, :edit to get to the file */
+ handle_drop(numFiles, fnames, FALSE);
+
+ /* TODO: Handle the goto/select line more cleanly */
+ if ((numFiles == 1) & (gotPosition))
+ {
+ if (thePosition.lineNum >= 0)
+ {
+ lnum = thePosition.lineNum;
+ /* oap->motion_type = MLINE;
+ setpcmark();*/
+ if (lnum < 1L)
+ lnum = 1L;
+ else if (lnum > curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.lnum = lnum;
+ /* beginline(BL_SOL | BL_FIX);*/
+ }
+ else
+ goto_byte(thePosition.startRange + 1);
+ }
+
+ /* Update the screen display */
+ update_screen(NOT_VALID);
+ setcursor();
+ out_flush();
+
+ finished:
+ AEDisposeDesc(&theList); /* dispose what we allocated */
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+#ifdef USE_SIOUX
+ printf ("aevt_odoc: HandleUnusedParms error: %d\n", error);
+#endif
+ return(error);
+ }
+ return(error);
+}
+
+/*
+ *
+ */
+
+pascal OSErr Handle_aevt_oapp_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+
+#ifdef USE_SIOUX
+ printf ("aevt_oapp:\n");
+#endif
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+ return(error);
+ }
+
+ return(error);
+}
+
+/*
+ *
+ */
+
+pascal OSErr Handle_aevt_quit_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+
+#ifdef USE_SIOUX
+ printf ("aevt_quit\n");
+#endif
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+ return(error);
+ }
+
+ /* Need to fake a :confirm qa */
+ do_cmdline_cmd((char_u *)"confirm qa");
+
+ return(error);
+}
+
+/*
+ *
+ */
+
+pascal OSErr Handle_aevt_pdoc_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+
+#ifdef USE_SIOUX
+ printf ("aevt_pdoc:\n");
+#endif
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+ return(error);
+ }
+
+ return(error);
+}
+
+/*
+ * Handling of unknown AppleEvent
+ *
+ * (Just get rid of all the parms)
+ */
+pascal OSErr Handle_unknown_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon)
+{
+ OSErr error = noErr;
+
+#ifdef USE_SIOUX
+ printf ("Unknown Event: %x\n", theAEvent->descriptorType);
+#endif
+
+ error = HandleUnusedParms (theAEvent);
+ if (error)
+ {
+ return(error);
+ }
+
+ return(error);
+}
+
+
+
+#if TARGET_API_MAC_CARBON
+# define NewAEEventHandlerProc(x) NewAEEventHandlerUPP(x)
+#endif
+
+/*
+ * Install the various AppleEvent Handlers
+ */
+OSErr InstallAEHandlers (void)
+{
+ OSErr error;
+
+ /* install open application handler */
+ error = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
+ NewAEEventHandlerProc(Handle_aevt_oapp_AE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+
+ /* install quit application handler */
+ error = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
+ NewAEEventHandlerProc(Handle_aevt_quit_AE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+
+ /* install open document handler */
+ error = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
+ NewAEEventHandlerProc(HandleODocAE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+
+ /* install print document handler */
+ error = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
+ NewAEEventHandlerProc(Handle_aevt_pdoc_AE), 0, false);
+
+/* Install Core Suite */
+/* error = AEInstallEventHandler(kAECoreSuite, kAEClone,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEClose,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAECountElements,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAECreateElement,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEDelete,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEDoObjectsExist,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEGetData,
+ NewAEEventHandlerProc(Handle_unknown_AE), kAEGetData, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEGetDataSize,
+ NewAEEventHandlerProc(Handle_unknown_AE), kAEGetDataSize, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEGetClassInfo,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEGetEventInfo,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAEMove,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAESave,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+
+ error = AEInstallEventHandler(kAECoreSuite, kAESetData,
+ NewAEEventHandlerProc(Handle_unknown_AE), nil, false);
+*/
+
+#ifdef FEAT_CW_EDITOR
+ /*
+ * Bind codewarrior support handlers
+ */
+ error = AEInstallEventHandler('KAHL', 'GTTX',
+ NewAEEventHandlerProc(Handle_KAHL_GTTX_AE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+ error = AEInstallEventHandler('KAHL', 'SRCH',
+ NewAEEventHandlerProc(Handle_KAHL_SRCH_AE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+ error = AEInstallEventHandler('KAHL', 'MOD ',
+ NewAEEventHandlerProc(Handle_KAHL_MOD_AE), 0, false);
+ if (error)
+ {
+ return error;
+ }
+#endif
+
+ return error;
+
+}
+#endif /* USE_AEVENT */
+
+/*
+ * ------------------------------------------------------------
+ * Unfiled yet
+ * ------------------------------------------------------------
+ */
+
+/*
+ * gui_mac_get_menu_item_index
+ *
+ * Returns the index inside the menu wher
+ */
+ short /* Shoulde we return MenuItemIndex? */
+gui_mac_get_menu_item_index (pMenu)
+ vimmenu_T *pMenu;
+{
+ short index;
+ short itemIndex = -1;
+ vimmenu_T *pBrother;
+
+ /* Only menu without parent are the:
+ * -menu in the menubar
+ * -popup menu
+ * -toolbar (guess)
+ *
+ * Which are not items anyway.
+ */
+ if (pMenu->parent)
+ {
+ /* Start from the Oldest Brother */
+ pBrother = pMenu->parent->children;
+ index = 1;
+ while ((pBrother) && (itemIndex == -1))
+ {
+ if (pBrother == pMenu)
+ itemIndex = index;
+ index++;
+ pBrother = pBrother->next;
+ }
+#ifdef USE_HELPMENU
+ /* Adjust index in help menu (for predefined ones) */
+ if (itemIndex != -1)
+ if (pMenu->parent->submenu_id == kHMHelpMenuID)
+ itemIndex += gui.MacOSHelpItems;
+#endif
+ }
+ return itemIndex;
+}
+
+ static vimmenu_T *
+gui_mac_get_vim_menu (menuID, itemIndex, pMenu)
+ short menuID;
+ short itemIndex;
+ vimmenu_T *pMenu;
+{
+ short index;
+ vimmenu_T *pChildMenu;
+ vimmenu_T *pElder = pMenu->parent;
+
+
+ /* Only menu without parent are the:
+ * -menu in the menubar
+ * -popup menu
+ * -toolbar (guess)
+ *
+ * Which are not items anyway.
+ */
+
+ if ((pElder) && (pElder->submenu_id == menuID))
+ {
+#ifdef USE_HELPMENU
+ if (menuID == kHMHelpMenuID)
+ itemIndex -= gui.MacOSHelpItems;
+#endif
+
+ for (index = 1; (index != itemIndex) && (pMenu != NULL); index++)
+ pMenu = pMenu->next;
+ }
+ else
+ {
+ for (; pMenu != NULL; pMenu = pMenu->next)
+ {
+ if (pMenu->children != NULL)
+ {
+ pChildMenu = gui_mac_get_vim_menu
+ (menuID, itemIndex, pMenu->children);
+ if (pChildMenu)
+ {
+ pMenu = pChildMenu;
+ break;
+ }
+ }
+ }
+ }
+ return pMenu;
+}
+
+/*
+ * ------------------------------------------------------------
+ * MacOS Feedback procedures
+ * ------------------------------------------------------------
+ */
+ pascal
+ void
+gui_mac_drag_thumb (ControlHandle theControl, short partCode)
+{
+ scrollbar_T *sb;
+ int value, dragging;
+ ControlHandle theControlToUse;
+ int dont_scroll_save = dont_scroll;
+
+ theControlToUse = dragged_sb;
+
+ sb = gui_find_scrollbar((long) GetControlReference (theControlToUse));
+
+ if (sb == NULL)
+ return;
+
+ /* Need to find value by diff between Old Poss New Pos */
+ value = GetControl32BitValue (theControlToUse);
+ dragging = (partCode != 0);
+
+ /* When "allow_scrollbar" is FALSE still need to remember the new
+ * position, but don't actually scroll by setting "dont_scroll". */
+ dont_scroll = !allow_scrollbar;
+ gui_drag_scrollbar(sb, value, dragging);
+ dont_scroll = dont_scroll_save;
+}
+
+ pascal
+ void
+gui_mac_scroll_action (ControlHandle theControl, short partCode)
+{
+ /* TODO: have live support */
+ scrollbar_T *sb, *sb_info;
+ long data;
+ long value;
+ int page;
+ int dragging = FALSE;
+ int dont_scroll_save = dont_scroll;
+
+ sb = gui_find_scrollbar((long) GetControlReference (theControl));
+
+ if (sb == NULL)
+ return;
+
+ if (sb->wp != NULL) /* Left or right scrollbar */
+ {
+ /*
+ * Careful: need to get scrollbar info out of first (left) scrollbar
+ * for window, but keep real scrollbar too because we must pass it to
+ * gui_drag_scrollbar().
+ */
+ sb_info = &sb->wp->w_scrollbars[0];
+
+ if (sb_info->size > 5)
+ page = sb_info->size - 2; /* use two lines of context */
+ else
+ page = sb_info->size;
+ }
+ else /* Bottom scrollbar */
+ {
+ sb_info = sb;
+ page = W_WIDTH(curwin) - 5;
+ }
+
+ switch (partCode)
+ {
+ case kControlUpButtonPart: data = -1; break;
+ case kControlDownButtonPart: data = 1; break;
+ case kControlPageDownPart: data = page; break;
+ case kControlPageUpPart: data = -page; break;
+ default: data = 0; break;
+ }
+
+ value = sb_info->value + data;
+/* if (value > sb_info->max)
+ value = sb_info->max;
+ else if (value < 0)
+ value = 0;*/
+
+ /* When "allow_scrollbar" is FALSE still need to remember the new
+ * position, but don't actually scroll by setting "dont_scroll". */
+ dont_scroll = !allow_scrollbar;
+ gui_drag_scrollbar(sb, value, dragging);
+ dont_scroll = dont_scroll_save;
+
+ out_flush();
+ gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max);
+
+/* if (sb_info->wp != NULL)
+ {
+ win_T *wp;
+ int sb_num;
+
+ sb_num = 0;
+ for (wp = firstwin; wp != sb->wp && wp != NULL; wp = W_NEXT(wp))
+ sb_num++;
+
+ if (wp != NULL)
+ {
+ current_scrollbar = sb_num;
+ scrollbar_value = value;
+ gui_do_scroll();
+ gui_mch_set_scrollbar_thumb(sb, value, sb_info->size, sb_info->max);
+ }
+ }*/
+}
+
+/*
+ * ------------------------------------------------------------
+ * MacOS Click Handling procedures
+ * ------------------------------------------------------------
+ */
+
+
+/*
+ * Handle a click inside the window, it may happens in the
+ * scrollbar or the contents.
+ *
+ * TODO: Add support for potential TOOLBAR
+ */
+ void
+gui_mac_doInContentClick (theEvent, whichWindow)
+ EventRecord *theEvent;
+ WindowPtr whichWindow;
+{
+ Point thePoint;
+ int_u vimModifiers;
+ short thePortion;
+ ControlHandle theControl;
+ int vimMouseButton;
+ short dblClick;
+
+ thePoint = theEvent->where;
+ GlobalToLocal (&thePoint);
+ SelectWindow (whichWindow);
+
+ thePortion = FindControl (thePoint, whichWindow, &theControl);
+
+ if (theControl != NUL)
+ {
+ /* We hit a scollbar */
+
+ if (thePortion != kControlIndicatorPart)
+ {
+ dragged_sb = theControl;
+ TrackControl(theControl, thePoint, gScrollAction);
+ dragged_sb = NULL;
+ }
+ else
+ {
+ dragged_sb = theControl;
+#if 1
+ TrackControl(theControl, thePoint, gScrollDrag);
+#else
+ TrackControl(theControl, thePoint, NULL);
+#endif
+ /* pass 0 as the part to tell gui_mac_drag_thumb, that the mouse
+ * button has been released */
+ gui_mac_drag_thumb (theControl, 0); /* Should it be thePortion ? (Dany) */
+ dragged_sb = NULL;
+ }
+ }
+ else
+ {
+ /* We are inside the contents */
+
+ /* Convert the CTRL, OPTION, SHIFT and CMD key */
+ vimModifiers = EventModifiers2VimMouseModifiers(theEvent->modifiers);
+
+ /* Defaults to MOUSE_LEFT as there's only one mouse button */
+ vimMouseButton = MOUSE_LEFT;
+
+#ifdef USE_CTRLCLICKMENU
+ /* Convert the CTRL_MOUSE_LEFT to MOUSE_RIGHT */
+ clickIsPopup = FALSE;
+
+ if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup()))
+ if (IsShowContextualMenuClick(theEvent))
+ {
+ vimMouseButton = MOUSE_RIGHT;
+ vimModifiers &= ~MOUSE_CTRL;
+ clickIsPopup = TRUE;
+ }
+#endif
+
+ /* Is it a double click ? */
+ dblClick = ((theEvent->when - lastMouseTick) < GetDblTime());
+
+ /* Send the mouse clicj to Vim */
+ gui_send_mouse_event(vimMouseButton, thePoint.h,
+ thePoint.v, dblClick, vimModifiers);
+
+ /* Create the rectangle around the cursor to detect
+ * the mouse dragging
+ */
+#ifdef USE_CTRLCLICKMENU
+#if 0
+ /* TODO: Do we need to this even for the contextual menu?
+ * It may be require for popup_setpos, but for popup?
+ */
+ if (vimMouseButton == MOUSE_LEFT)
+#endif
+#endif
+ {
+ SetRect (&dragRect, FILL_X(X_2_COL(thePoint.h)),
+ FILL_Y(Y_2_ROW(thePoint.v)),
+ FILL_X(X_2_COL(thePoint.h)+1),
+ FILL_Y(Y_2_ROW(thePoint.v)+1));
+
+ dragRectEnbl = TRUE;
+ dragRectControl = kCreateRect;
+ }
+ }
+}
+
+/*
+ * Handle the click in the titlebar (to move the window)
+ */
+ void
+gui_mac_doInDragClick (where, whichWindow)
+ Point where;
+ WindowPtr whichWindow;
+{
+ Rect movingLimits;
+ Rect *movingLimitsPtr = &movingLimits;
+
+ /* TODO: may try to prevent move outside screen? */
+#ifdef USE_CARBONIZED
+ movingLimitsPtr = GetRegionBounds ( GetGrayRgn(), &movingLimits );
+#else
+ movingLimitsPtr = &(*GetGrayRgn())->rgnBBox;
+#endif
+ DragWindow (whichWindow, where, movingLimitsPtr);
+}
+
+/*
+ * Handle the click in the grow box
+ */
+ void
+gui_mac_doInGrowClick(where, whichWindow)
+ Point where;
+ WindowPtr whichWindow;
+{
+
+ long newSize;
+ unsigned short newWidth;
+ unsigned short newHeight;
+ Rect resizeLimits;
+ Rect *resizeLimitsPtr = &resizeLimits;
+#ifdef USE_CARBONIZED
+ Rect NewContentRect;
+
+ resizeLimitsPtr = GetRegionBounds ( GetGrayRgn(), &resizeLimits );
+#else
+ resizeLimits = qd.screenBits.bounds;
+#endif
+
+ /* Set the minimun size */
+ /* TODO: Should this come from Vim? */
+ resizeLimits.top = 100;
+ resizeLimits.left = 100;
+
+#ifdef USE_CARBONIZED
+ newSize = ResizeWindow(whichWindow, where, &resizeLimits, &NewContentRect);
+ newWidth = NewContentRect.right - NewContentRect.left;
+ newHeight = NewContentRect.bottom - NewContentRect.top;
+ gui_resize_shell(newWidth, newHeight);
+ gui_mch_set_bg_color(gui.back_pixel);
+ gui_set_shellsize(TRUE, FALSE);
+#else
+ newSize = GrowWindow(whichWindow, where, &resizeLimits);
+ if (newSize != 0)
+ {
+ newWidth = newSize & 0x0000FFFF;
+ newHeight = (newSize >> 16) & 0x0000FFFF;
+
+ gui_mch_set_bg_color(gui.back_pixel);
+
+ gui_resize_shell(newWidth, newHeight);
+
+ /*
+ * We need to call gui_set_shellsize as the size
+ * used by Vim may be smaller than the size selected
+ * by the user. This cause some overhead
+ * TODO: add a check inside gui_resize_shell?
+ */
+ gui_set_shellsize(TRUE, FALSE);
+
+ /*
+ * Origin of the code below is unknown.
+ * Functionality is unknown.
+ * Time of commented out is unknown.
+ */
+/* SetPort(wp);
+ InvalRect(&wp->portRect);
+ if (isUserWindow(wp)) {
+ DrawingWindowPeek aWindow = (DrawingWindowPeek)wp;
+
+ if (aWindow->toolRoutines.toolWindowResizedProc)
+ CallToolWindowResizedProc(aWindow->toolRoutines.toolWindowResizedProc, wp);
+ }*/
+ };
+#endif
+
+}
+
+/*
+ * Handle the click in the zoom box
+ */
+#ifdef USE_CARBONIZED
+ static void
+gui_mac_doInZoomClick(theEvent, whichWindow)
+ EventRecord *theEvent;
+ WindowPtr whichWindow;
+{
+ Rect r;
+ Point p;
+ short thePart;
+
+ /* ideal width is current */
+ p.h = Columns * gui.char_width + 2 * gui.border_offset;
+ if (gui.which_scrollbars[SBAR_LEFT])
+ p.h += gui.scrollbar_width;
+ if (gui.which_scrollbars[SBAR_RIGHT])
+ p.h += gui.scrollbar_width;
+ /* ideal height is as heigh as we can get */
+ p.v = 15 * 1024;
+
+ thePart = IsWindowInStandardState(whichWindow, &p, &r)
+ ? inZoomIn : inZoomOut;
+
+ if (!TrackBox(whichWindow, theEvent->where, thePart))
+ return;
+
+ /* use returned width */
+ p.h = r.right - r.left;
+ /* adjust returned height */
+ p.v = r.bottom - r.top - 2 * gui.border_offset;
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ p.v -= gui.scrollbar_height;
+ p.v -= p.v % gui.char_height;
+ p.v += 2 * gui.border_width;
+ if (gui.which_scrollbars[SBAR_BOTTOM]);
+ p.v += gui.scrollbar_height;
+
+ ZoomWindowIdeal(whichWindow, thePart, &p);
+
+ GetWindowBounds(whichWindow, kWindowContentRgn, &r);
+ gui_resize_shell(r.right - r.left, r.bottom - r.top);
+ gui_mch_set_bg_color(gui.back_pixel);
+ gui_set_shellsize(TRUE, FALSE);
+}
+#endif /* defined(USE_CARBONIZED) */
+
+/*
+ * ------------------------------------------------------------
+ * MacOS Event Handling procedure
+ * ------------------------------------------------------------
+ */
+
+/*
+ * Handle the Update Event
+ */
+
+ void
+gui_mac_doUpdateEvent(event)
+ EventRecord *event;
+{
+ WindowPtr whichWindow;
+ GrafPtr savePort;
+ RgnHandle updateRgn;
+#ifdef USE_CARBONIZED
+ Rect updateRect;
+#endif
+ Rect *updateRectPtr;
+ Rect rc;
+ Rect growRect;
+ RgnHandle saveRgn;
+
+
+#ifdef USE_CARBONIZED
+ updateRgn = NewRgn();
+ if (updateRgn == NULL)
+ return;
+#endif
+
+ /* This could be done by the caller as we
+ * don't require anything else out of the event
+ */
+ whichWindow = (WindowPtr) event->message;
+
+ /* Save Current Port */
+ GetPort (&savePort);
+
+ /* Select the Window's Port */
+#ifdef USE_CARBONIZED
+ SetPortWindowPort (whichWindow);
+#else
+ SetPort (whichWindow);
+#endif
+
+ /* Let's update the window */
+ BeginUpdate (whichWindow);
+ /* Redraw the biggest rectangle covering the area
+ * to be updated.
+ */
+#ifdef USE_CARBONIZED
+ GetPortVisibleRegion(GetWindowPort(whichWindow), updateRgn);
+# if 0
+ /* Would be more appropriate to use the follwing but doesn't
+ * seem to work under MacOS X (Dany)
+ */
+ GetWindowRegion(whichWindow, kWindowUpdateRgn, updateRgn);
+# endif
+#else
+ updateRgn = whichWindow->visRgn;
+#endif
+ /* Use the HLock useless in Carbon? Is it harmful?*/
+ HLock ((Handle) updateRgn);
+#ifdef USE_CARBONIZED
+ updateRectPtr = GetRegionBounds ( updateRgn, &updateRect );
+# if 0
+ /* Code from original Carbon Port (using GetWindowRegion.
+ * I believe the UpdateRgn is already in local (Dany)
+ */
+ GlobalToLocal(&topLeft(updateRect)); /* preCarbon? */
+ GlobalToLocal(&botRight(updateRect));
+# endif
+#else
+ updateRectPtr = &(*updateRgn)->rgnBBox;
+#endif
+ /* Update the content (i.e. the text) */
+ gui_redraw(updateRectPtr->left, updateRectPtr->top,
+ updateRectPtr->right - updateRectPtr->left,
+ updateRectPtr->bottom - updateRectPtr->top);
+ /* Clear the border areas if needed */
+ gui_mch_set_bg_color(gui.back_pixel);
+ if (updateRectPtr->left < FILL_X(0))
+ {
+ SetRect (&rc, 0, 0, FILL_X(0), FILL_Y(Rows));
+ EraseRect (&rc);
+ }
+ if (updateRectPtr->top < FILL_Y(0))
+ {
+ SetRect (&rc, 0, 0, FILL_X(Columns), FILL_Y(0));
+ EraseRect (&rc);
+ }
+ if (updateRectPtr->right > FILL_X(Columns))
+ {
+ SetRect (&rc, FILL_X(Columns), 0,
+ FILL_X(Columns) + gui.border_offset, FILL_Y(Rows));
+ EraseRect (&rc);
+ }
+ if (updateRectPtr->bottom > FILL_Y(Rows))
+ {
+ SetRect (&rc, 0, FILL_Y(Rows), FILL_X(Columns) + gui.border_offset,
+ FILL_Y(Rows) + gui.border_offset);
+ EraseRect (&rc);
+ }
+ HUnlock ((Handle) updateRgn);
+#ifdef USE_CARBONIZED
+ DisposeRgn (updateRgn);
+#endif
+
+ /* Update scrollbars */
+ DrawControls (whichWindow);
+
+ /* Update the GrowBox */
+ /* Taken from FAQ 33-27 */
+ saveRgn = NewRgn();
+#ifdef USE_CARBONIZED
+ GetWindowBounds(whichWindow, kWindowGrowRgn, &growRect);
+#else
+ growRect = whichWindow->portRect;
+ growRect.top = growRect.bottom - 15;
+ growRect.left = growRect.right - 15;
+#endif
+ GetClip (saveRgn);
+ ClipRect (&growRect);
+ DrawGrowIcon (whichWindow);
+ SetClip (saveRgn);
+ DisposeRgn (saveRgn);
+ EndUpdate (whichWindow);
+
+ /* Restore original Port */
+ SetPort (savePort);
+}
+
+/*
+ * Handle the activate/deactivate event
+ * (apply to a window)
+ */
+ void
+gui_mac_doActivateEvent(event)
+ EventRecord *event;
+{
+ WindowPtr whichWindow;
+
+ whichWindow = (WindowPtr) event->message;
+ if ((event->modifiers) & activeFlag)
+ /* Activate */
+ gui_focus_change(TRUE);
+ else
+ {
+ /* Deactivate */
+ gui_focus_change(FALSE);
+/* DON'T KNOW what the code below was doing
+ found in the deactivate clause, but the
+ clause writting TRUE into in_focus (BUG)
+ */
+
+#if 0 /* Removed by Dany as per above June 2001 */
+ a_bool = false;
+ SetPreserveGlyph (a_bool);
+ SetOutlinePreferred (a_bool);
+#endif
+ }
+}
+
+
+/*
+ * Handle the suspend/resume event
+ * (apply to the application)
+ */
+ void
+gui_mac_doSuspendEvent(event)
+ EventRecord *event;
+{
+ /* The frontmost application just changed */
+
+ /* NOTE: the suspend may happen before the deactivate
+ * seen on MacOS X
+ */
+
+ /* May not need to change focus as the window will
+ * get an activate/desactivate event
+ */
+ if (event->message & 1)
+ /* Resume */
+ gui_focus_change(TRUE);
+ else
+ /* Suspend */
+ gui_focus_change(FALSE);
+}
+
+/*
+ * Handle the key
+ */
+
+ void
+gui_mac_doKeyEvent(EventRecord *theEvent)
+{
+ /* TODO: add support for COMMAND KEY */
+ long menu;
+ unsigned char string[20];
+ short num, i;
+ short len = 0;
+ KeySym key_sym;
+ int key_char;
+ int modifiers;
+
+ /* Mask the mouse (as per user setting) */
+ if (p_mh)
+ ObscureCursor();
+
+ /* Get the key code and it's ASCII representation */
+ key_sym = ((theEvent->message & keyCodeMask) >> 8);
+ key_char = theEvent->message & charCodeMask;
+ num = 1;
+
+ /* Intercept CTRL-C */
+ if (theEvent->modifiers & controlKey)
+ if (key_char == Ctrl_C && ctrl_c_interrupts)
+ got_int = TRUE;
+
+ /* Intercept CMD-. */
+ if (theEvent->modifiers & cmdKey)
+ if (key_char == '.')
+ got_int = TRUE;
+
+ /* Handle command key as per menu */
+ /* TODO: should override be allowed? Require YAO or could use 'winaltkey' */
+ if (theEvent->modifiers & cmdKey)
+ /* Only accept CMD alone or with CAPLOCKS and the mouse button.
+ * Why the mouse button? */
+ if ((theEvent->modifiers & (~(cmdKey | btnState | alphaLock))) == 0)
+ {
+ menu = MenuKey(key_char);
+ if (HiWord(menu))
+ {
+ gui_mac_handle_menu(menu);
+ return;
+ }
+ }
+
+ /* Convert the modifiers */
+ modifiers = EventModifiers2VimModifiers(theEvent->modifiers);
+
+
+ /* Handle special keys. */
+#if 0
+ /* Why have this been removed? */
+ if (!(theEvent->modifiers & (cmdKey | controlKey | rightControlKey)))
+#endif
+ {
+ /* Find the special key (for non-printable keyt_char) */
+ if ((key_char < 0x20) || (key_char == 0x7f))
+ for (i = 0; special_keys[i].key_sym != (KeySym)0; i++)
+ if (special_keys[i].key_sym == key_sym)
+ {
+# if 0
+ /* We currently don't have not so special key */
+ if (special_keys[i].vim_code1 == NUL)
+ key_char = special_keys[i].vim_code0;
+ else
+# endif
+ key_char = TO_SPECIAL( special_keys[i].vim_code0,
+ special_keys[i].vim_code1 );
+ key_char = simplify_key(key_char,&modifiers);
+ break;
+ }
+ }
+
+
+ /* Add the modifier to the input bu if needed */
+ /* Do not want SHIFT-A or CTRL-A with modifier */
+ if (!IS_SPECIAL(key_char)
+ && key_sym != vk_Space
+ && key_sym != vk_Tab
+ && key_sym != vk_Return
+ && key_sym != vk_Enter
+ && key_sym != vk_Esc)
+ {
+#if 1
+ /* Clear modifiers when only one modifier is set */
+ if( (modifiers == MOD_MASK_SHIFT) ||
+ (modifiers == MOD_MASK_CTRL) ||
+ (modifiers == MOD_MASK_ALT))
+ modifiers = 0;
+#else
+ if( modifiers & MOD_MASK_CTRL)
+ modifiers = modifiers & ~MOD_MASK_CTRL;
+ if( modifiers & MOD_MASK_ALT)
+ modifiers = modifiers & ~MOD_MASK_ALT;
+ if( modifiers & MOD_MASK_SHIFT)
+ modifiers = modifiers & ~MOD_MASK_SHIFT;
+#endif
+ }
+ if( modifiers )
+ {
+ string[ len++ ] = CSI;
+ string[ len++ ] = KS_MODIFIER;
+ string[ len++ ] = modifiers;
+ }
+
+ if( IS_SPECIAL( key_char ) )
+ {
+ string[ len++ ] = CSI;
+ string[ len++ ] = K_SECOND( key_char );
+ string[ len++ ] = K_THIRD( key_char );
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ char_u from[2], *to;
+ int l;
+
+ from[0] = key_char;
+ from[1] = NUL;
+ l = 1;
+ to = string_convert(&input_conv, from, &l);
+ if (to != NULL)
+ {
+ for (i = 0; i < l && len < 19; i++)
+ {
+ if (to[i] == CSI)
+ {
+ string[len++] = KS_EXTRA;
+ string[len++] = KE_CSI;
+ }
+ else
+ string[len++] = to[i];
+ }
+ vim_free(to);
+ }
+ else
+ string[len++] = key_char;
+ }
+ else
+#endif
+ string[len++] = key_char;
+ }
+
+ if (len == 1 && string[0] == CSI)
+ {
+ /* Turn CSI into K_CSI. */
+ string[ len++ ] = KS_EXTRA;
+ string[ len++ ] = KE_CSI;
+ }
+
+ add_to_input_buf(string, len);
+}
+
+/*
+ * Handle MouseClick
+ */
+ void
+gui_mac_doMouseDownEvent (theEvent)
+ EventRecord *theEvent;
+{
+ short thePart;
+ WindowPtr whichWindow;
+
+ thePart = FindWindow (theEvent->where, &whichWindow);
+
+ switch (thePart)
+ {
+ case (inDesk):
+ /* TODO: what to do? */
+ break;
+
+ case (inMenuBar):
+ gui_mac_handle_menu(MenuSelect (theEvent->where));
+ break;
+
+ case (inContent):
+ gui_mac_doInContentClick (theEvent, whichWindow);
+ break;
+
+ case (inDrag):
+ gui_mac_doInDragClick (theEvent->where, whichWindow);
+ break;
+
+ case (inGrow):
+ gui_mac_doInGrowClick (theEvent->where, whichWindow);
+ break;
+
+ case (inGoAway):
+ if (TrackGoAway(whichWindow, theEvent->where))
+ gui_shell_closed();
+ break;
+
+ case (inZoomIn):
+ case (inZoomOut):
+#ifdef USE_CARBONIZED
+ gui_mac_doInZoomClick(theEvent, whichWindow);
+#endif
+ break;
+ }
+}
+
+/*
+ * Handle MouseMoved
+ * [this event is a moving in and out of a region]
+ */
+ void
+gui_mac_doMouseMovedEvent (event)
+ EventRecord *event;
+{
+ Point thePoint;
+ int_u vimModifiers;
+
+ thePoint = event->where;
+ GlobalToLocal (&thePoint);
+ vimModifiers = EventModifiers2VimMouseModifiers(event->modifiers);
+
+ if (!Button())
+ gui_mouse_moved (thePoint.h, thePoint.v);
+ else
+#ifdef USE_CTRLCLICKMENU
+ if (!clickIsPopup)
+#endif
+ gui_send_mouse_event(MOUSE_DRAG, thePoint.h,
+ thePoint.v, FALSE, vimModifiers);
+
+ /* Reset the region from which we move in and out */
+ SetRect (&dragRect, FILL_X(X_2_COL(thePoint.h)),
+ FILL_Y(Y_2_ROW(thePoint.v)),
+ FILL_X(X_2_COL(thePoint.h)+1),
+ FILL_Y(Y_2_ROW(thePoint.v)+1));
+
+ if (dragRectEnbl)
+ dragRectControl = kCreateRect;
+
+}
+
+/*
+ * Handle the mouse release
+ */
+ void
+gui_mac_doMouseUpEvent (theEvent)
+ EventRecord *theEvent;
+{
+ Point thePoint;
+ int_u vimModifiers;
+
+ /* TODO: Properly convert the Contextual menu mouse-up */
+ /* Potential source of the double menu */
+ lastMouseTick = theEvent->when;
+ dragRectEnbl = FALSE;
+ dragRectControl = kCreateEmpty;
+ thePoint = theEvent->where;
+ GlobalToLocal (&thePoint);
+
+ vimModifiers = EventModifiers2VimMouseModifiers(theEvent->modifiers);
+#ifdef USE_CTRLCLICKMENU
+ if (clickIsPopup)
+ {
+ vimModifiers &= ~MOUSE_CTRL;
+ clickIsPopup = FALSE;
+ }
+#endif
+ gui_send_mouse_event
+ (MOUSE_RELEASE, thePoint.h, thePoint.v, FALSE, vimModifiers);
+}
+
+#ifdef USE_MOUSEWHEEL
+ static pascal OSStatus
+gui_mac_mouse_wheel(EventHandlerCallRef nextHandler, EventRef theEvent,
+ void *data)
+{
+ EventRef bogusEvent;
+ Point point;
+ Rect bounds;
+ UInt32 mod;
+ SInt32 delta;
+ int_u vim_mod;
+
+ if (noErr != GetEventParameter(theEvent, kEventParamMouseWheelDelta,
+ typeSInt32, NULL, sizeof(SInt32), NULL, &delta))
+ goto bail;
+ if (noErr != GetEventParameter(theEvent, kEventParamMouseLocation,
+ typeQDPoint, NULL, sizeof(Point), NULL, &point))
+ goto bail;
+ if (noErr != GetEventParameter(theEvent, kEventParamKeyModifiers,
+ typeUInt32, NULL, sizeof(UInt32), NULL, &mod))
+ goto bail;
+
+ vim_mod = 0;
+ if (mod & shiftKey)
+ vim_mod |= MOUSE_SHIFT;
+ if (mod & controlKey)
+ vim_mod |= MOUSE_CTRL;
+ if (mod & optionKey)
+ vim_mod |= MOUSE_ALT;
+
+ /* post a bogus event to wake up WaitNextEvent */
+ if (noErr != CreateEvent(NULL, kEventClassMouse, kEventMouseMoved, 0,
+ kEventAttributeNone, &bogusEvent))
+ goto bail;
+ if (noErr != PostEventToQueue(GetMainEventQueue(), bogusEvent,
+ kEventPriorityLow))
+ goto bail;
+
+ if (noErr == GetWindowBounds(gui.VimWindow, kWindowContentRgn, &bounds))
+ {
+ point.h -= bounds.left;
+ point.v -= bounds.top;
+ }
+
+ gui_send_mouse_event((delta > 0) ? MOUSE_4 : MOUSE_5,
+ point.h, point.v, FALSE, vim_mod);
+
+ return noErr;
+
+ bail:
+ /*
+ * when we fail give any additional callback handler a chance to perform
+ * it's actions
+ */
+ return CallNextEventHandler(nextHandler, theEvent);
+}
+#endif /* defined(USE_MOUSEWHEEL) */
+
+#if 0
+
+/*
+ * This would be the normal way of invoking the contextual menu
+ * but the Vim API doesn't seem to a support a request to get
+ * the menu that we should display
+ */
+ void
+gui_mac_handle_contextual_menu(event)
+ EventRecord *event;
+{
+/*
+ * Clone PopUp to use menu
+ * Create a object descriptor for the current selection
+ * Call the procedure
+ */
+
+// Call to Handle Popup
+ OSStatus status = ContextualMenuSelect(CntxMenu, event->where, false, kCMHelpItemNoHelp, "", NULL, &CntxType, &CntxMenuID, &CntxMenuItem);
+
+ if (status != noErr)
+ return;
+
+ if (CntxType == kCMMenuItemSelected)
+ {
+ /* Handle the menu CntxMenuID, CntxMenuItem */
+ /* The submenu can be handle directly by gui_mac_handle_menu */
+ /* But what about the current menu, is the meny changed by ContextualMenuSelect */
+ gui_mac_handle_menu ((CntxMenuID << 16) + CntxMenuItem);
+ }
+ else if (CntxMenuID == kCMShowHelpSelected)
+ {
+ /* Should come up with the help */
+ }
+
+}
+#endif
+
+/*
+ * Handle menubar selection
+ */
+ void
+gui_mac_handle_menu(menuChoice)
+ long menuChoice;
+{
+ short menu = HiWord(menuChoice);
+ short item = LoWord(menuChoice);
+ vimmenu_T *theVimMenu = root_menu;
+#ifndef USE_CARBONIZED
+ MenuHandle appleMenu;
+ Str255 itemName;
+#endif
+
+ if (menu == 256) /* TODO: use constant or gui.xyz */
+ {
+ if (item == 1)
+ gui_mch_beep(); /* TODO: Popup dialog or do :intro */
+ else
+ {
+#ifndef USE_CARBONIZED
+ /* Desk Accessory doesn't exist in Carbon */
+ appleMenu = GetMenuHandle (menu);
+ GetMenuItemText (appleMenu, item, itemName);
+ (void) OpenDeskAcc (itemName);
+#endif
+ }
+ }
+ else if (item != 0)
+ {
+ theVimMenu = gui_mac_get_vim_menu(menu, item, root_menu);
+
+ if (theVimMenu)
+ gui_menu_cb(theVimMenu);
+ }
+ HiliteMenu (0);
+}
+
+/*
+ * Dispatch the event to proper handler
+ */
+
+ void
+gui_mac_handle_event (event)
+ EventRecord *event;
+{
+ OSErr error;
+
+ /* Handle contextual menu right now (if needed) */
+#ifdef USE_CTRLCLICKMENU
+ if (gui.MacOSHaveCntxMenu)
+ if (IsShowContextualMenuClick(event))
+ {
+# if 0
+ gui_mac_handle_contextual_menu(event);
+# else
+ gui_mac_doMouseDownEvent(event);
+# endif
+ return;
+ }
+#endif
+
+ /* Handle normal event */
+ switch (event->what)
+ {
+ case (keyDown):
+ case (autoKey):
+ gui_mac_doKeyEvent (event);
+ break;
+
+ case (keyUp):
+ /* We don't care about when the key get release */
+ break;
+
+ case (mouseDown):
+ gui_mac_doMouseDownEvent(event);
+ break;
+
+ case (mouseUp):
+ gui_mac_doMouseUpEvent(event);
+ break;
+
+ case (updateEvt):
+ gui_mac_doUpdateEvent (event);
+ break;
+
+ case (diskEvt):
+ /* We don't need special handling for disk insertion */
+ break;
+
+ case (activateEvt):
+ gui_mac_doActivateEvent (event);
+ break;
+
+ case (osEvt):
+ switch ((event->message >> 24) & 0xFF)
+ {
+ case (0xFA): /* mouseMovedMessage */
+ gui_mac_doMouseMovedEvent (event);
+ break;
+ case (0x01): /* suspendResumeMessage */
+ gui_mac_doSuspendEvent (event);
+ break;
+ }
+ break;
+
+#ifdef USE_AEVENT
+ case (kHighLevelEvent):
+ /* Someone's talking to us, through AppleEvents */
+ error = AEProcessAppleEvent(event); /* TODO: Error Handling */
+ break;
+#endif
+ }
+}
+
+/*
+ * ------------------------------------------------------------
+ * Unknown Stuff
+ * ------------------------------------------------------------
+ */
+
+
+ GuiFont
+gui_mac_find_font (font_name)
+ char_u *font_name;
+{
+ char_u c;
+ char_u *p;
+ char_u pFontName[256];
+ Str255 systemFontname;
+ short font_id;
+ short size=9;
+ GuiFont font;
+#if 0
+ char_u *fontNamePtr;
+#endif
+
+ for (p = font_name; ((*p != 0) && (*p != ':')); p++)
+ ;
+
+ c = *p;
+ *p = 0;
+
+#if 1
+ STRCPY(&pFontName[1], font_name);
+ pFontName[0] = STRLEN(font_name);
+ *p = c;
+
+ GetFNum (pFontName, &font_id);
+#else
+ /* name = C2Pascal_save(menu->dname); */
+ fontNamePtr = C2Pascal_save_and_remove_backslash(font_name);
+
+ GetFNum (fontNamePtr, &font_id);
+#endif
+
+
+ if (font_id == 0)
+ {
+ /* Oups, the system font was it the one the user want */
+
+ GetFontName (0, systemFontname);
+ if (!EqualString(pFontName, systemFontname, false, false))
+ return NOFONT;
+ }
+ if (*p == ':')
+ {
+ p++;
+ /* Set the values found after ':' */
+ while (*p)
+ {
+ switch (*p++)
+ {
+ case 'h':
+ size = points_to_pixels(p, &p, TRUE);
+ break;
+ /*
+ * TODO: Maybe accept width and styles
+ */
+ }
+ while (*p == ':')
+ p++;
+ }
+ }
+
+ if (size < 1)
+ size = 1; /* Avoid having a size of 0 with system font */
+
+ font = (size << 16) + ((long) font_id & 0xFFFF);
+
+ return font;
+}
+
+/*
+ * ------------------------------------------------------------
+ * GUI_MCH functionnality
+ * ------------------------------------------------------------
+ */
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(argc, argv)
+ int *argc;
+ char **argv;
+{
+ /* TODO: Move most of this stuff toward gui_mch_init */
+#ifdef USE_EXE_NAME
+ FSSpec applDir;
+# ifndef USE_FIND_BUNDLE_PATH
+ short applVRefNum;
+ long applDirID;
+ Str255 volName;
+# else
+ ProcessSerialNumber psn;
+ FSRef applFSRef;
+# endif
+#endif
+
+#ifndef USE_CARBONIZED
+ MaxApplZone(); /* What could replace thos */
+ /* In Carbon, all shared library are automatically load in
+ * there's no need to init them
+ */
+ InitGraf(&qd.thePort);
+ InitFonts();
+ InitWindows();
+ InitMenus();
+ TEInit();
+ InitDialogs(nil);
+#else
+ /* Why did I put that in? (Dany) */
+ MoreMasterPointers (0x40 * 3); /* we love handles */
+#endif
+
+#if 0
+ InitCursor();
+
+#ifdef USE_CARBONIZED
+ RegisterAppearanceClient();
+#endif
+
+#ifdef USE_AEVENT
+ (void) InstallAEHandlers();
+#endif
+
+#ifdef USE_CTRLCLICKMENU
+ if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
+ gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
+ else
+ gui.MacOSHaveCntxMenu = false;
+
+ if (gui.MacOSHaveCntxMenu)
+ gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
+#endif
+
+#ifdef USE_SIOUX
+ SIOUXSettings.standalone = false;
+ SIOUXSettings.initializeTB = false;
+ SIOUXSettings.setupmenus = false;
+ SIOUXSettings.asktosaveonclose = false;
+ SIOUXSettings.showstatusline = true;
+ SIOUXSettings.toppixel = 300;
+ SIOUXSettings.leftpixel = 10;
+ InstallConsole (1); /* fileno(stdout) = 1, on page 430 of MSL C */
+ printf ("Debugging console enabled\n");
+ /* SIOUXSetTitle ((char_u *) "Vim Stdout"); */
+#endif
+
+ pomme = NewMenu (256, "\p\024"); /* 0x14= = Apple Menu */
+
+ AppendMenu (pomme, "\pAbout VIM");
+#ifndef USE_CARBONIZED
+ AppendMenu (pomme, "\p-");
+ AppendResMenu (pomme, 'DRVR');
+#endif
+
+ InsertMenu (pomme, 0);
+
+ DrawMenuBar();
+
+
+#ifndef USE_OFFSETED_WINDOW
+ SetRect (&windRect, 10, 48, 10+80*7 + 16, 48+24*11);
+#else
+ SetRect (&windRect, 300, 40, 300+80*7 + 16, 40+24*11);
+#endif
+
+
+#ifdef USE_CARBONIZED
+ CreateNewWindow(kDocumentWindowClass,
+ kWindowResizableAttribute | kWindowCollapseBoxAttribute,
+ &windRect, &gui.VimWindow );
+ SetPortWindowPort ( gui.VimWindow );
+#else
+ gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, documentProc,
+ (WindowPtr) -1L, false, 0);
+ SetPort(gui.VimWindow);
+#endif
+
+ gui.char_width = 7;
+ gui.char_height = 11;
+ gui.char_ascent = 6;
+ gui.num_rows = 24;
+ gui.num_cols = 80;
+ gui.in_focus = TRUE; /* For the moment -> syn. of front application */
+
+#if TARGET_API_MAC_CARBON
+ gScrollAction = NewControlActionUPP (gui_mac_scroll_action);
+ gScrollDrag = NewControlActionUPP (gui_mac_drag_thumb);
+#else
+ gScrollAction = NewControlActionProc (gui_mac_scroll_action);
+ gScrollDrag = NewControlActionProc (gui_mac_drag_thumb);
+#endif
+
+ /* Getting a handle to the Help menu */
+#ifdef USE_HELPMENU
+# ifdef USE_CARBONIZED
+ HMGetHelpMenu(&gui.MacOSHelpMenu, NULL);
+# else
+ (void) HMGetHelpMenuHandle(&gui.MacOSHelpMenu);
+# endif
+
+ if (gui.MacOSHelpMenu != nil)
+ gui.MacOSHelpItems = CountMenuItems (gui.MacOSHelpMenu);
+ else
+ gui.MacOSHelpItems = 0;
+#endif
+
+ dragRectEnbl = FALSE;
+ dragRgn = NULL;
+ dragRectControl = kCreateEmpty;
+ cursorRgn = NewRgn();
+#endif
+#ifdef USE_EXE_NAME
+# ifndef USE_FIND_BUNDLE_PATH
+ HGetVol (volName, &applVRefNum, &applDirID);
+ /* TN2015: mention a possible bad VRefNum */
+ FSMakeFSSpec (applVRefNum, applDirID, "\p", &applDir);
+# else
+ /* OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr)
+ * of TN2015
+ * This technic remove the ../Contents/MacOS/etc part
+ */
+ (void) GetCurrentProcess(&psn);
+ /* if (err != noErr) return err; */
+
+ (void) GetProcessBundleLocation(&psn, &applFSRef);
+ /* if (err != noErr) return err; */
+
+ (void) FSGetCatalogInfo(&applFSRef, kFSCatInfoNone, NULL, NULL, &applDir, NULL);
+
+ /* This technic return NIL when we disallow_gui */
+# endif
+ exe_name = FullPathFromFSSpec_save (applDir);
+#endif
+
+#ifdef USE_VIM_CREATOR_ID
+ _fcreator = 'VIM!';
+ _ftype = 'TEXT';
+#endif
+}
+
+#ifndef ALWAYS_USE_GUI
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check(void)
+{
+ /* TODO: For MacOS X find a way to return FAIL, if the user logged in
+ * using the >console
+ */
+ if (disallow_gui) /* see main.c for reason to disallow */
+ return FAIL;
+ return OK;
+}
+#endif
+
+ static OSErr
+receiveHandler(WindowRef theWindow, void* handlerRefCon, DragRef theDrag)
+{
+ int x, y;
+ int_u modifiers;
+ char_u **fnames = NULL;
+ int count;
+ int i, j;
+
+ /* Get drop position, modifiers and count of items */
+ {
+ Point point;
+ SInt16 mouseUpModifiers;
+ UInt16 countItem;
+
+ GetDragMouse(theDrag, &point, NULL);
+ GlobalToLocal(&point);
+ x = point.h;
+ y = point.v;
+ GetDragModifiers(theDrag, NULL, NULL, &mouseUpModifiers);
+ modifiers = EventModifiers2VimMouseModifiers(mouseUpModifiers);
+ CountDragItems(theDrag, &countItem);
+ count = countItem;
+ }
+
+ fnames = (char_u **)alloc(count * sizeof(char_u *));
+ if (fnames == NULL)
+ return dragNotAcceptedErr;
+
+ /* Get file names dropped */
+ for (i = j = 0; i < count; ++i)
+ {
+ DragItemRef item;
+ OSErr err;
+ Size size;
+ FlavorType type = flavorTypeHFS;
+ HFSFlavor hfsFlavor;
+
+ fnames[i] = NULL;
+ GetDragItemReferenceNumber(theDrag, i + 1, &item);
+ err = GetFlavorDataSize(theDrag, item, type, &size);
+ if (err != noErr || size > sizeof(hfsFlavor))
+ continue;
+ err = GetFlavorData(theDrag, item, type, &hfsFlavor, &size, 0);
+ if (err != noErr)
+ continue;
+ fnames[j++] = FullPathFromFSSpec_save(hfsFlavor.fileSpec);
+ }
+ count = j;
+
+ gui_handle_drop(x, y, modifiers, fnames, count);
+ return noErr;
+}
+
+/*
+ * Initialise the GUI. Create all the windows, set up all the call-backs
+ * etc.
+ */
+ int
+gui_mch_init()
+{
+ /* TODO: Move most of this stuff toward gui_mch_init */
+ Rect windRect;
+ MenuHandle pomme;
+#ifdef USE_CTRLCLICKMENU
+ long gestalt_rc;
+#endif
+#ifdef USE_MOUSEWHEEL
+ EventTypeSpec eventTypeSpec;
+ EventHandlerRef mouseWheelHandlerRef;
+#endif
+#if 1
+ InitCursor();
+
+#ifdef USE_CARBONIZED
+ RegisterAppearanceClient();
+#endif
+
+#ifdef USE_AEVENT
+ (void) InstallAEHandlers();
+#endif
+
+#ifdef USE_CTRLCLICKMENU
+ if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr)
+ gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable);
+ else
+ gui.MacOSHaveCntxMenu = false;
+
+ if (gui.MacOSHaveCntxMenu)
+ gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr);
+#endif
+
+#ifdef USE_SIOUX
+ SIOUXSettings.standalone = false;
+ SIOUXSettings.initializeTB = false;
+ SIOUXSettings.setupmenus = false;
+ SIOUXSettings.asktosaveonclose = false;
+ SIOUXSettings.showstatusline = true;
+ SIOUXSettings.toppixel = 300;
+ SIOUXSettings.leftpixel = 10;
+ InstallConsole (1); /* fileno(stdout) = 1, on page 430 of MSL C */
+ printf ("Debugging console enabled\n");
+ /* SIOUXSetTitle ((char_u *) "Vim Stdout"); */
+#endif
+
+ pomme = NewMenu (256, "\p\024"); /* 0x14= = Apple Menu */
+
+ AppendMenu (pomme, "\pAbout VIM");
+#ifndef USE_CARBONIZED
+ AppendMenu (pomme, "\p-");
+ AppendResMenu (pomme, 'DRVR');
+#endif
+
+ InsertMenu (pomme, 0);
+
+ DrawMenuBar();
+
+
+#ifndef USE_OFFSETED_WINDOW
+ SetRect (&windRect, 10, 48, 10+80*7 + 16, 48+24*11);
+#else
+ SetRect (&windRect, 300, 40, 300+80*7 + 16, 40+24*11);
+#endif
+
+ gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true,
+#ifdef USE_CARBONIZED
+ zoomDocProc,
+#else
+ documentProc,
+#endif
+ (WindowPtr)-1L, true, 0);
+ InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler,
+ gui.VimWindow, NULL);
+#ifdef USE_CARBONIZED
+ SetPortWindowPort ( gui.VimWindow );
+#else
+ SetPort(gui.VimWindow);
+#endif
+
+ gui.char_width = 7;
+ gui.char_height = 11;
+ gui.char_ascent = 6;
+ gui.num_rows = 24;
+ gui.num_cols = 80;
+ gui.in_focus = TRUE; /* For the moment -> syn. of front application */
+
+#if TARGET_API_MAC_CARBON
+ gScrollAction = NewControlActionUPP (gui_mac_scroll_action);
+ gScrollDrag = NewControlActionUPP (gui_mac_drag_thumb);
+#else
+ gScrollAction = NewControlActionProc (gui_mac_scroll_action);
+ gScrollDrag = NewControlActionProc (gui_mac_drag_thumb);
+#endif
+
+ /* Getting a handle to the Help menu */
+#ifdef USE_HELPMENU
+# ifdef USE_CARBONIZED
+ HMGetHelpMenu(&gui.MacOSHelpMenu, NULL);
+# else
+ (void) HMGetHelpMenuHandle(&gui.MacOSHelpMenu);
+# endif
+
+ if (gui.MacOSHelpMenu != nil)
+ gui.MacOSHelpItems = CountMenuItems (gui.MacOSHelpMenu);
+ else
+ gui.MacOSHelpItems = 0;
+#endif
+
+ dragRectEnbl = FALSE;
+ dragRgn = NULL;
+ dragRectControl = kCreateEmpty;
+ cursorRgn = NewRgn();
+#endif
+ /* Display any pending error messages */
+ display_errors();
+
+ /* Get background/foreground colors from system */
+ /* TODO: do the approriate call to get real defaults */
+ gui.norm_pixel = 0x00000000;
+ gui.back_pixel = 0x00FFFFFF;
+
+ /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
+ * file). */
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color.
+ * Then store the current values as the defaults.
+ */
+ gui_check_colors();
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them) */
+ highlight_gui_started();
+
+ /*
+ * Setting the gui constants
+ */
+#ifdef FEAT_MENU
+ gui.menu_height = 0;
+#endif
+ gui.scrollbar_height = gui.scrollbar_width = 15; /* cheat 1 overlap */
+ gui.border_offset = gui.border_width = 2;
+
+#if defined(FEAT_GUI) && defined(MACOS_X)
+ /* If Quartz-style text antialiasing is available (see
+ gui_mch_draw_string() below), enable it for all font sizes. */
+ vim_setenv((char_u *)"QDTEXT_MINSIZE", (char_u *)"1");
+#endif
+
+#ifdef USE_MOUSEWHEEL
+ eventTypeSpec.eventClass = kEventClassMouse;
+ eventTypeSpec.eventKind = kEventMouseWheelMoved;
+ mouseWheelHandlerUPP = NewEventHandlerUPP(gui_mac_mouse_wheel);
+ if (noErr != InstallApplicationEventHandler(mouseWheelHandlerUPP, 1,
+ &eventTypeSpec, NULL, &mouseWheelHandlerRef))
+ {
+ mouseWheelHandlerRef = NULL;
+ DisposeEventHandlerUPP(mouseWheelHandlerUPP);
+ mouseWheelHandlerUPP = NULL;
+ }
+#endif
+
+#ifdef FEAT_MBYTE
+ set_option_value((char_u *)"termencoding", 0L, (char_u *)"macroman", 0);
+#endif
+
+ /* TODO: Load bitmap if using TOOLBAR */
+ return OK;
+}
+
+/*
+ * Called when the foreground or background color has been changed.
+ */
+ void
+gui_mch_new_colors()
+{
+ /* TODO:
+ * This proc is called when Normal is set to a value
+ * so what msut be done? I don't know
+ */
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open()
+{
+ ShowWindow(gui.VimWindow);
+
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+#ifdef USE_CARBONIZED
+ /*
+ * Make the GUI the foreground process (in case it was launched
+ * from the Terminal or via :gui).
+ */
+ {
+ ProcessSerialNumber psn;
+ if (GetCurrentProcess(&psn) == noErr)
+ SetFrontProcess(&psn);
+ }
+#endif
+
+ return OK;
+}
+
+ void
+gui_mch_exit(int rc)
+{
+ /* TODO: find out all what is missing here? */
+ DisposeRgn(cursorRgn);
+
+#ifdef USE_MOUSEWHEEL
+ if (mouseWheelHandlerUPP != NULL)
+ DisposeEventHandlerUPP(mouseWheelHandlerUPP);
+#endif
+
+ /* Exit to shell? */
+ exit(rc);
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ /* TODO */
+#ifdef USE_CARBONIZED
+ Rect bounds;
+ OSStatus status;
+
+ /* Carbon >= 1.0.2, MacOS >= 8.5 */
+ status = GetWindowBounds (gui.VimWindow, kWindowStructureRgn, &bounds);
+
+ if (status != noErr)
+ return FAIL;
+ *x = bounds.left;
+ *y = bounds.top;
+ return OK;
+#endif
+ return FAIL;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ /* TODO: Should make sure the window is move within range
+ * e.g.: y > ~16 [Menu bar], x > 0, x < screen width
+ */
+ MoveWindow(gui.VimWindow, x, y, TRUE);
+}
+
+ void
+gui_mch_set_shellsize(
+ int width,
+ int height,
+ int min_width,
+ int min_height,
+ int base_width,
+ int base_height)
+{
+#ifdef USE_CARBONIZED
+ CGrafPtr VimPort;
+ Rect VimBound;
+#endif
+
+ if (gui.which_scrollbars[SBAR_LEFT])
+ {
+#ifdef USE_CARBONIZED
+ VimPort = GetWindowPort ( gui.VimWindow );
+ GetPortBounds (VimPort, &VimBound);
+ VimBound.left = -gui.scrollbar_width; /* + 1;*/
+ SetPortBounds (VimPort, &VimBound);
+ /* GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??*/
+#else
+ gui.VimWindow->portRect.left = -gui.scrollbar_width; /* + 1;*/
+ /* SetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &winPortRect); ??*/
+#endif
+ }
+ else
+ {
+#ifdef USE_CARBONIZED
+ VimPort = GetWindowPort ( gui.VimWindow );
+ GetPortBounds (VimPort, &VimBound);
+ VimBound.left = 0;
+ SetPortBounds (VimPort, &VimBound);
+#else
+ gui.VimWindow->portRect.left = 0;
+#endif;
+ }
+
+ SizeWindow(gui.VimWindow, width, height, TRUE);
+
+ gui_resize_shell(width, height);
+}
+
+/*
+ * Get the screen dimensions.
+ * Allow 10 pixels for horizontal borders, 40 for vertical borders.
+ * Is there no way to find out how wide the borders really are?
+ * TODO: Add live udate of those value on suspend/resume.
+ */
+ void
+gui_mch_get_screen_dimensions(screen_w, screen_h)
+ int *screen_w;
+ int *screen_h;
+{
+ GDHandle dominantDevice = GetMainDevice();
+ Rect screenRect = (**dominantDevice).gdRect;
+
+ *screen_w = screenRect.right - 10;
+ *screen_h = screenRect.bottom - 40;
+}
+
+
+
+/*
+ * Initialise vim to use the font with the given name. Return FAIL if the font
+ * could not be loaded, OK otherwise.
+ */
+ int
+gui_mch_init_font(font_name, fontset)
+ char_u *font_name;
+ int fontset; /* not used */
+{
+ /* TODO: Add support for bold italic underline proportional etc... */
+ Str255 suggestedFont = "\pMonaco";
+ int suggestedSize = 9;
+ FontInfo font_info;
+ short font_id;
+ GuiFont font;
+
+ if (font_name == NULL)
+ {
+ /* First try to get the suggested font */
+ GetFNum(suggestedFont, &font_id);
+
+ if (font_id == 0)
+ {
+ /* Then pickup the standard application font */
+ font_id = GetAppFont();
+ }
+ font = (suggestedSize << 16) + ((long) font_id & 0xFFFF);
+ }
+ else
+ {
+ font = gui_mac_find_font (font_name);
+
+ if (font == NOFONT)
+ return FAIL;
+ }
+ gui.norm_font = font;
+
+ TextSize (font >> 16);
+ TextFont (font & 0xFFFF);
+
+ GetFontInfo (&font_info);
+
+ gui.char_ascent = font_info.ascent;
+ gui.char_width = CharWidth ('_');
+ gui.char_height = font_info.ascent + font_info.descent + p_linespace;
+
+ return OK;
+
+}
+
+ int
+gui_mch_adjust_charsize()
+{
+ FontInfo font_info;
+
+ GetFontInfo (&font_info);
+ gui.char_height = font_info.ascent + font_info.descent + p_linespace;
+ gui.char_ascent = font_info.ascent + p_linespace / 2;
+ return OK;
+}
+
+/*
+ * Get a font structure for highlighting.
+ */
+ GuiFont
+gui_mch_get_font(name, giveErrorIfMissing)
+ char_u *name;
+ int giveErrorIfMissing;
+{
+ GuiFont font;
+
+ font = gui_mac_find_font(name);
+
+ if (font == NOFONT)
+ {
+ if (giveErrorIfMissing)
+ EMSG2(_(e_font), name);
+ return NOFONT;
+ }
+ /*
+ * TODO : Accept only monospace
+ */
+
+ return font;
+}
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(font)
+ GuiFont font;
+{
+ /*
+ * TODO: maybe avoid set again the current font.
+ */
+ TextSize(font >> 16);
+ TextFont(font & 0xFFFF);
+}
+
+#if 0 /* not used */
+/*
+ * Return TRUE if the two fonts given are equivalent.
+ */
+ int
+gui_mch_same_font(f1, f2)
+ GuiFont f1;
+ GuiFont f2;
+{
+ return f1 == f2;
+}
+#endif
+
+/*
+ * If a font is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_font(font)
+ GuiFont font;
+{
+ /*
+ * Free font when "font" is not 0.
+ * Nothing to do in the current implementation, since
+ * nothing is allocated for each font used.
+ */
+}
+
+ static int
+hex_digit(c)
+ int c;
+{
+ if (isdigit(c))
+ return c - '0';
+ c = TOLOWER_ASC(c);
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ return -1000;
+}
+
+/*
+ * Return the Pixel value (color) for the given color name. This routine was
+ * pretty much taken from example code in the Silicon Graphics OSF/Motif
+ * Programmer's Guide.
+ * Return INVALCOLOR when failed.
+ */
+ guicolor_T
+gui_mch_get_color(name)
+ char_u *name;
+{
+ /* TODO: Add support for the new named color of MacOS 8
+ */
+ RGBColor MacColor;
+// guicolor_T color = 0;
+
+ typedef struct guicolor_tTable
+ {
+ char *name;
+ guicolor_T color;
+ } guicolor_tTable;
+
+ /*
+ * The comment at the end of each line is the source
+ * (Mac, Window, Unix) and the number is the unix rgb.txt value
+ */
+ static guicolor_tTable table[] =
+ {
+ {"Black", RGB(0x00, 0x00, 0x00)},
+ {"darkgray", RGB(0x80, 0x80, 0x80)}, /*W*/
+ {"darkgrey", RGB(0x80, 0x80, 0x80)}, /*W*/
+ {"Gray", RGB(0xC0, 0xC0, 0xC0)}, /*W*/
+ {"Grey", RGB(0xC0, 0xC0, 0xC0)}, /*W*/
+ {"lightgray", RGB(0xE0, 0xE0, 0xE0)}, /*W*/
+ {"lightgrey", RGB(0xE0, 0xE0, 0xE0)}, /*W*/
+ {"white", RGB(0xFF, 0xFF, 0xFF)},
+ {"darkred", RGB(0x80, 0x00, 0x00)}, /*W*/
+ {"red", RGB(0xDD, 0x08, 0x06)}, /*M*/
+ {"lightred", RGB(0xFF, 0xA0, 0xA0)}, /*W*/
+ {"DarkBlue", RGB(0x00, 0x00, 0x80)}, /*W*/
+ {"Blue", RGB(0x00, 0x00, 0xD4)}, /*M*/
+ {"lightblue", RGB(0xA0, 0xA0, 0xFF)}, /*W*/
+ {"DarkGreen", RGB(0x00, 0x80, 0x00)}, /*W*/
+ {"Green", RGB(0x00, 0x64, 0x11)}, /*M*/
+ {"lightgreen", RGB(0xA0, 0xFF, 0xA0)}, /*W*/
+ {"DarkCyan", RGB(0x00, 0x80, 0x80)}, /*W ?0x307D7E */
+ {"cyan", RGB(0x02, 0xAB, 0xEA)}, /*M*/
+ {"lightcyan", RGB(0xA0, 0xFF, 0xFF)}, /*W*/
+ {"darkmagenta", RGB(0x80, 0x00, 0x80)}, /*W*/
+ {"magenta", RGB(0xF2, 0x08, 0x84)}, /*M*/
+ {"lightmagenta",RGB(0xF0, 0xA0, 0xF0)}, /*W*/
+ {"brown", RGB(0x80, 0x40, 0x40)}, /*W*/
+ {"yellow", RGB(0xFC, 0xF3, 0x05)}, /*M*/
+ {"lightyellow", RGB(0xFF, 0xFF, 0xA0)}, /*M*/
+ {"SeaGreen", RGB(0x2E, 0x8B, 0x57)}, /*W 0x4E8975 */
+ {"orange", RGB(0xFC, 0x80, 0x00)}, /*W 0xF87A17 */
+ {"Purple", RGB(0xA0, 0x20, 0xF0)}, /*W 0x8e35e5 */
+ {"SlateBlue", RGB(0x6A, 0x5A, 0xCD)}, /*W 0x737CA1 */
+ {"Violet", RGB(0x8D, 0x38, 0xC9)}, /*U*/
+ };
+
+ int r, g, b;
+ int i;
+
+ if (name[0] == '#' && strlen((char *) name) == 7)
+ {
+ /* Name is in "#rrggbb" format */
+ r = hex_digit(name[1]) * 16 + hex_digit(name[2]);
+ g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
+ b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
+ if (r < 0 || g < 0 || b < 0)
+ return INVALCOLOR;
+ return RGB(r, g, b);
+ }
+ else
+ {
+ if (STRICMP (name, "hilite") == 0)
+ {
+ LMGetHiliteRGB (&MacColor);
+ return (RGB (MacColor.red >> 8, MacColor.green >> 8, MacColor.blue >> 8));
+ }
+ /* Check if the name is one of the colors we know */
+ for (i = 0; i < sizeof(table) / sizeof(table[0]); i++)
+ if (STRICMP(name, table[i].name) == 0)
+ return table[i].color;
+ }
+
+
+ /*
+ * Last attempt. Look in the file "$VIM/rgb.txt".
+ */
+ {
+#define LINE_LEN 100
+ FILE *fd;
+ char line[LINE_LEN];
+ char_u *fname;
+
+#ifdef COLON_AS_PATHSEP
+ fname = expand_env_save((char_u *)"$VIMRUNTIME:rgb.txt");
+#else
+ fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
+#endif
+ if (fname == NULL)
+ return INVALCOLOR;
+
+ fd = fopen((char *)fname, "rt");
+ vim_free(fname);
+ if (fd == NULL)
+ return INVALCOLOR;
+
+ while (!feof(fd))
+ {
+ int len;
+ int pos;
+ char *color;
+
+ fgets(line, LINE_LEN, fd);
+ len = strlen(line);
+
+ if (len <= 1 || line[len-1] != '\n')
+ continue;
+
+ line[len-1] = '\0';
+
+ i = sscanf(line, "%d %d %d %n", &r, &g, &b, &pos);
+ if (i != 3)
+ continue;
+
+ color = line + pos;
+
+ if (STRICMP(color, name) == 0)
+ {
+ fclose(fd);
+ return (guicolor_T) RGB(r, g, b);
+ }
+ }
+ fclose(fd);
+ }
+
+ return INVALCOLOR;
+}
+
+/*
+ * Set the current text foreground color.
+ */
+ void
+gui_mch_set_fg_color(color)
+ guicolor_T color;
+{
+ RGBColor TheColor;
+
+ TheColor.red = Red(color) * 0x0101;
+ TheColor.green = Green(color) * 0x0101;
+ TheColor.blue = Blue(color) * 0x0101;
+
+ RGBForeColor (&TheColor);
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(color)
+ guicolor_T color;
+{
+ RGBColor TheColor;
+
+ TheColor.red = Red(color) * 0x0101;
+ TheColor.green = Green(color) * 0x0101;
+ TheColor.blue = Blue(color) * 0x0101;
+
+ RGBBackColor (&TheColor);
+}
+
+ void
+gui_mch_draw_string(row, col, s, len, flags)
+ int row;
+ int col;
+ char_u *s;
+ int len;
+ int flags;
+{
+#if defined(FEAT_GUI) && defined(MACOS_X)
+ SInt32 sys_version;
+#endif
+#ifdef FEAT_MBYTE
+ char_u *tofree = NULL;
+
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ tofree = string_convert(&output_conv, s, &len);
+ if (tofree != NULL)
+ s = tofree;
+ }
+#endif
+
+#if defined(FEAT_GUI) && defined(MACOS_X)
+ /*
+ * On OS X, try using Quartz-style text antialiasing.
+ */
+ sys_version = 0;
+
+ Gestalt(gestaltSystemVersion, &sys_version);
+ if (sys_version >= 0x1020)
+ {
+ /* Quartz antialiasing is available only in OS 10.2 and later. */
+ UInt32 qd_flags = (p_antialias ?
+ kQDUseCGTextRendering | kQDUseCGTextMetrics : 0);
+ (void)SwapQDTextFlags(qd_flags);
+ }
+
+ if (sys_version >= 0x1020 && p_antialias)
+ {
+ StyleParameter face;
+
+ face = normal;
+ if (flags & DRAW_BOLD)
+ face |= bold;
+ if (flags & DRAW_UNDERL)
+ face |= underline;
+ TextFace(face);
+
+ /* Quartz antialiasing works only in srcOr transfer mode. */
+ TextMode(srcOr);
+
+ if (!(flags & DRAW_TRANSP))
+ {
+ /*
+ * Since we're using srcOr mode, we have to clear the block
+ * before drawing the text. The following is like calling
+ * gui_mch_clear_block(row, col, row, col + len - 1),
+ * but without setting the bg color to gui.back_pixel.
+ */
+ Rect rc;
+ rc.left = FILL_X(col);
+ rc.top = FILL_Y(row);
+ rc.right = FILL_X(col + len) + (col + len == Columns);
+ rc.bottom = FILL_Y(row + 1);
+ EraseRect(&rc);
+ }
+
+ MoveTo(TEXT_X(col), TEXT_Y(row));
+ DrawText((char*)s, 0, len);
+ }
+ else
+#endif
+ {
+ /* Use old-style, non-antialiased QuickDraw text rendering. */
+ TextMode (srcCopy);
+ TextFace (normal);
+
+ /* SelectFont(hdc, gui.currFont); */
+
+ if (flags & DRAW_TRANSP)
+ {
+ TextMode (srcOr);
+ }
+
+ MoveTo (TEXT_X(col), TEXT_Y(row));
+ DrawText ((char *)s, 0, len);
+
+
+ if (flags & DRAW_BOLD)
+ {
+ TextMode (srcOr);
+ MoveTo (TEXT_X(col) + 1, TEXT_Y(row));
+ DrawText ((char *)s, 0, len);
+ }
+
+ if (flags & DRAW_UNDERL)
+ {
+ MoveTo (FILL_X(col), FILL_Y(row + 1) - 1);
+ LineTo (FILL_X(col + len) - 1, FILL_Y(row + 1) - 1);
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ vim_free(tofree);
+#endif
+}
+
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; special_keys[i].key_sym != (KeySym)0; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return OK;
+ return FAIL;
+}
+
+ void
+gui_mch_beep()
+{
+ SysBeep (1); /* Should this be 0? (????) */
+}
+
+ void
+gui_mch_flash(msec)
+ int msec;
+{
+ /* Do a visual beep by reversing the foreground and background colors */
+ Rect rc;
+
+ /*
+ * Note: InvertRect() excludes right and bottom of rectangle.
+ */
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = gui.num_cols * gui.char_width;
+ rc.bottom = gui.num_rows * gui.char_height;
+ InvertRect(&rc);
+
+ ui_delay((long)msec, TRUE); /* wait for some msec */
+
+ InvertRect(&rc);
+}
+
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(r, c, nr, nc)
+ int r;
+ int c;
+ int nr;
+ int nc;
+{
+ Rect rc;
+
+ /*
+ * Note: InvertRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(c);
+ rc.top = FILL_Y(r);
+ rc.right = rc.left + nc * gui.char_width;
+ rc.bottom = rc.top + nr * gui.char_height;
+ InvertRect(&rc);
+
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify()
+{
+ /* TODO: find out what could replace iconify
+ * -window shade?
+ * -hide application?
+ */
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ /* TODO */
+}
+#endif
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(color)
+ guicolor_T color;
+{
+ Rect rc;
+
+ gui_mch_set_fg_color(color);
+
+ /*
+ * Note: FrameRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(gui.col);
+ rc.top = FILL_Y(gui.row);
+ rc.right = rc.left + gui.char_width;
+ rc.bottom = rc.top + gui.char_height;
+
+ gui_mch_set_fg_color(color);
+
+ FrameRect (&rc);
+}
+
+/*
+ * Draw part of a cursor, only w pixels wide, and h pixels high.
+ */
+ void
+gui_mch_draw_part_cursor(w, h, color)
+ int w;
+ int h;
+ guicolor_T color;
+{
+ Rect rc;
+
+#ifdef FEAT_RIGHTLEFT
+ /* vertical line should be on the right of current point */
+ if (CURSOR_BAR_RIGHT)
+ rc.left = FILL_X(gui.col + 1) - w;
+ else
+#endif
+ rc.left = FILL_X(gui.col);
+ rc.top = FILL_Y(gui.row) + gui.char_height - h;
+ rc.right = rc.left + w;
+ rc.bottom = rc.top + h;
+
+ gui_mch_set_fg_color(color);
+
+ PaintRect (&rc);
+}
+
+
+
+/*
+ * Catch up with any queued X events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the X event queue (& no timers pending), then we return
+ * immediately.
+ */
+ void
+gui_mch_update()
+{
+ /* TODO: find what to do
+ * maybe call gui_mch_wait_for_chars (0)
+ * more like look at EventQueue then
+ * call heart of gui_mch_wait_for_chars;
+ *
+ * if (eventther)
+ * gui_mac_handle_event(&event);
+ */
+ EventRecord theEvent;
+
+ if (EventAvail (everyEvent, &theEvent))
+ if (theEvent.what != nullEvent)
+ gui_mch_wait_for_chars(0);
+}
+
+/*
+ * Simple wrapper to neglect more easily the time
+ * spent inside WaitNextEvent while profiling.
+ */
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma profile reset
+#endif
+ pascal
+ Boolean
+WaitNextEventWrp (EventMask eventMask, EventRecord *theEvent, UInt32 sleep, RgnHandle mouseRgn)
+{
+ if (((long) sleep) < -1)
+ sleep = 32767;
+ return WaitNextEvent(eventMask, theEvent, sleep, mouseRgn);
+}
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma profile reset
+#endif
+ int
+gui_mch_wait_for_chars(wtime)
+ int wtime;
+{
+ EventMask mask = (everyEvent);
+ EventRecord event;
+ long entryTick;
+ long currentTick;
+ long sleeppyTick;
+
+ /* If we are providing life feedback with the scrollbar,
+ * we don't want to try to wait for an event, or else
+ * there won't be any life feedback.
+ */
+ if (dragged_sb != NULL)
+ return FAIL;
+ /* TODO: Check if FAIL is the proper return code */
+
+ entryTick = TickCount();
+
+ allow_scrollbar = TRUE;
+
+ do
+ {
+/* if (dragRectControl == kCreateEmpty)
+ {
+ dragRgn = NULL;
+ dragRectControl = kNothing;
+ }
+ else*/ if (dragRectControl == kCreateRect)
+ {
+ dragRgn = cursorRgn;
+ RectRgn (dragRgn, &dragRect);
+ dragRectControl = kNothing;
+ }
+ /*
+ * Don't use gui_mch_update() because then we will spin-lock until a
+ * char arrives, instead we use WaitNextEventWrp() to hang until an
+ * event arrives. No need to check for input_buf_full because we are
+ * returning as soon as it contains a single char.
+ */
+ /* TODO: reduce wtime accordinly??? */
+ if (wtime > -1)
+ sleeppyTick = 60*wtime/1000;
+ else
+ sleeppyTick = 32767;
+ if (WaitNextEventWrp (mask, &event, sleeppyTick, dragRgn))
+ {
+#ifdef USE_SIOUX
+ if (!SIOUXHandleOneEvent(&event))
+#endif
+ gui_mac_handle_event (&event);
+ if (input_available())
+ {
+ allow_scrollbar = FALSE;
+ return OK;
+ }
+ }
+ currentTick = TickCount();
+ }
+ while ((wtime == -1) || ((currentTick - entryTick) < 60*wtime/1000));
+
+ allow_scrollbar = FALSE;
+ return FAIL;
+}
+
+#if defined(__MWERKS__) /* only in Codewarrior */
+# pragma profile reset
+#endif
+
+/*
+ * Output routines.
+ */
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush()
+{
+ /* TODO: Is anything needed here? */
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(row1, col1, row2, col2)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+{
+ Rect rc;
+
+ /*
+ * Clear one extra pixel at the far right, for when bold characters have
+ * spilled over to the next column.
+ */
+ rc.left = FILL_X(col1);
+ rc.top = FILL_Y(row1);
+ rc.right = FILL_X(col2 + 1) + (col2 == Columns - 1);
+ rc.bottom = FILL_Y(row2 + 1);
+
+ gui_mch_set_bg_color(gui.back_pixel);
+ EraseRect (&rc);
+}
+
+/*
+ * Clear the whole text window.
+ */
+ void
+gui_mch_clear_all()
+{
+ Rect rc;
+
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = Columns * gui.char_width + 2 * gui.border_width;
+ rc.bottom = Rows * gui.char_height + 2 * gui.border_width;
+
+ gui_mch_set_bg_color(gui.back_pixel);
+ EraseRect(&rc);
+/* gui_mch_set_fg_color(gui.norm_pixel);
+ FrameRect(&rc);
+*/
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(row, num_lines)
+ int row;
+ int num_lines;
+{
+ Rect rc;
+
+ /* changed without checking! */
+ rc.left = FILL_X(gui.scroll_region_left);
+ rc.right = FILL_X(gui.scroll_region_right + 1);
+ rc.top = FILL_Y(row);
+ rc.bottom = FILL_Y(gui.scroll_region_bot + 1);
+
+ gui_mch_set_bg_color(gui.back_pixel);
+ ScrollRect (&rc, 0, -num_lines * gui.char_height, (RgnHandle) nil);
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(row, num_lines)
+ int row;
+ int num_lines;
+{
+ Rect rc;
+
+ rc.left = FILL_X(gui.scroll_region_left);
+ rc.right = FILL_X(gui.scroll_region_right + 1);
+ rc.top = FILL_Y(row);
+ rc.bottom = FILL_Y(gui.scroll_region_bot + 1);
+
+ gui_mch_set_bg_color(gui.back_pixel);
+
+ ScrollRect (&rc, 0, gui.char_height * num_lines, (RgnHandle) nil);
+
+ /* Update gui.cursor_row if the cursor scrolled or copied over */
+ if (gui.cursor_row >= gui.row
+ && gui.cursor_col >= gui.scroll_region_left
+ && gui.cursor_col <= gui.scroll_region_right)
+ {
+ if (gui.cursor_row <= gui.scroll_region_bot - num_lines)
+ gui.cursor_row += num_lines;
+ else if (gui.cursor_row <= gui.scroll_region_bot)
+ gui.cursor_is_valid = FALSE;
+ }
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+}
+
+ /*
+ * TODO: add a vim format to the clipboard which remember
+ * LINEWISE, CHARWISE, BLOCKWISE
+ */
+
+ void
+clip_mch_request_selection(cbd)
+ VimClipboard *cbd;
+{
+
+ Handle textOfClip;
+#ifdef USE_CARBONIZED
+ Size scrapSize;
+ ScrapFlavorFlags scrapFlags;
+ ScrapRef scrap = nil;
+ OSStatus error;
+#else
+ long scrapOffset;
+ long scrapSize;
+#endif
+ int type;
+ char *searchCR;
+ char_u *tempclip;
+
+
+#ifdef USE_CARBONIZED
+ error = GetCurrentScrap (&scrap);
+ if (error != noErr)
+ return;
+
+ error = GetScrapFlavorFlags(scrap, kScrapFlavorTypeText, &scrapFlags);
+ if (error != noErr)
+ return;
+
+ error = GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &scrapSize);
+ if (error != noErr)
+ return;
+
+ ReserveMem (scrapSize);
+#else
+ /* Call to LoadScrap seem to avoid problem with crash on first paste */
+ scrapSize = LoadScrap();
+ scrapSize = GetScrap(nil, 'TEXT', &scrapOffset);
+
+ if (scrapSize > 0)
+#endif
+ {
+#ifdef USE_CARBONIZED
+ /* In CARBON we don't need a Handle, a pointer is good */
+ textOfClip = NewHandle (scrapSize);
+ /* tempclip = lalloc(scrapSize+1, TRUE); */
+#else
+ textOfClip = NewHandle(0);
+#endif
+ HLock (textOfClip);
+#ifdef USE_CARBONIZED
+ error = GetScrapFlavorData (scrap, kScrapFlavorTypeText, &scrapSize, *textOfClip);
+#else
+ scrapSize = GetScrap(textOfClip, 'TEXT', &scrapOffset);
+#endif
+
+ type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR;
+
+ tempclip = lalloc(scrapSize+1, TRUE);
+ STRNCPY(tempclip, *textOfClip, scrapSize);
+ tempclip[scrapSize] = 0;
+
+ searchCR = (char *)tempclip;
+ while (searchCR != NULL)
+ {
+ searchCR = strchr(searchCR, '\r');
+
+ if (searchCR != NULL)
+ searchCR[0] = '\n';
+
+ }
+
+#ifdef FEAT_MBYTE
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ char_u *to;
+ int l = scrapSize;
+
+ to = string_convert(&input_conv, tempclip, &l);
+ if (to != NULL)
+ {
+ vim_free(tempclip);
+ tempclip = to;
+ scrapSize = l;
+ }
+ }
+#endif
+ clip_yank_selection(type, tempclip, scrapSize, cbd);
+
+ vim_free(tempclip);
+ HUnlock(textOfClip);
+
+ DisposeHandle(textOfClip);
+ }
+}
+
+ void
+clip_mch_lose_selection(cbd)
+ VimClipboard *cbd;
+{
+ /*
+ * TODO: Really nothing to do?
+ */
+}
+
+ int
+clip_mch_own_selection(cbd)
+ VimClipboard *cbd;
+{
+ return OK;
+}
+
+/*
+ * Send the current selection to the clipboard.
+ */
+ void
+clip_mch_set_selection(cbd)
+ VimClipboard *cbd;
+{
+ Handle textOfClip;
+ long scrapSize;
+ int type;
+#ifdef USE_CARBONIZED
+ ScrapRef scrap;
+#endif
+
+ char_u *str = NULL;
+
+ if (!cbd->owned)
+ return;
+
+ clip_get_selection(cbd);
+
+ /*
+ * Once we set the clipboard, lose ownership. If another application sets
+ * the clipboard, we don't want to think that we still own it.
+ *
+ */
+
+ cbd->owned = FALSE;
+
+ type = clip_convert_selection(&str, (long_u *) &scrapSize, cbd);
+
+#ifdef FEAT_MBYTE
+ if (str != NULL && output_conv.vc_type != CONV_NONE)
+ {
+ char_u *to;
+ int l = scrapSize;
+
+ to = string_convert(&output_conv, str, &l);
+ if (to != NULL)
+ {
+ vim_free(str);
+ str = to;
+ scrapSize = l;
+ }
+ }
+#endif
+
+ if (type >= 0)
+ {
+#ifdef USE_CARBONIZED
+ ClearCurrentScrap();
+#else
+ ZeroScrap();
+#endif
+
+ textOfClip = NewHandle(scrapSize);
+ HLock(textOfClip);
+
+ STRNCPY(*textOfClip, str, scrapSize);
+#ifdef USE_CARBONIZED
+ GetCurrentScrap (&scrap);
+ PutScrapFlavor(scrap, kScrapFlavorTypeText, kScrapFlavorMaskNone,
+ scrapSize, *textOfClip);
+#else
+ PutScrap(scrapSize, 'TEXT', *textOfClip);
+#endif
+ HUnlock(textOfClip);
+ DisposeHandle(textOfClip);
+ }
+
+ vim_free(str);
+}
+
+ void
+gui_mch_set_text_area_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ Rect VimBound;
+
+/* HideWindow (gui.VimWindow); */
+#ifdef USE_CARBONIZED
+ GetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &VimBound);
+#else
+ VimBound = gui.VimWindow->portRect;
+#endif
+
+ if (gui.which_scrollbars[SBAR_LEFT])
+ {
+ VimBound.left = -gui.scrollbar_width + 1;
+ }
+ else
+ {
+ VimBound.left = 0;
+ }
+
+#ifdef USE_CARBONIZED
+ SetWindowBounds(gui.VimWindow, kWindowGlobalPortRgn, &VimBound);
+#endif
+
+ ShowWindow (gui.VimWindow);
+}
+
+/*
+ * Menu stuff.
+ */
+
+ void
+gui_mch_enable_menu(flag)
+ int flag;
+{
+ /*
+ * Menu is always active in itself
+ * (maybe we should only disable a vim menu
+ * and keep standard menu)
+ *
+ */
+}
+
+ void
+gui_mch_set_menu_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ /*
+ * The menu is always at the top of the screen
+ * Maybe a futur version will permit a menu in the window
+ *
+ */
+}
+
+/*
+ * Add a sub menu to the menu bar.
+ */
+ void
+gui_mch_add_menu(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ /*
+ * TODO: Try to use only menu_id instead of both menu_id and menu_handle.
+ * TODO: use menu->mnemonic and menu->actext
+ * TODO: Try to reuse menu id
+ * Carbon Help suggest to use only id between 1 and 235
+ */
+ static long next_avail_id = 128;
+ long menu_after_me = 0; /* Default to the end */
+ char_u *name;
+ short index;
+ vimmenu_T *parent = menu->parent;
+ vimmenu_T *brother = menu->next;
+
+ /* Cannot add a menu if ... */
+ if ((parent != NULL && parent->submenu_id == 0))
+ return;
+
+ /* menu ID greater than 1024 are reserved for ??? */
+ if (next_avail_id == 1024)
+ return;
+
+ /* My brother could be the PopUp, find my real brother */
+ while ((brother != NULL) && (!menu_is_menubar(brother->name)))
+ brother = brother->next;
+
+ /* Find where to insert the menu (for MenuBar) */
+ if ((parent == NULL) && (brother != NULL))
+ menu_after_me = brother->submenu_id;
+
+ /* If the menu is not part of the menubar (and its submenus), add it 'nowhere' */
+ if (!menu_is_menubar(menu->name))
+ menu_after_me = hierMenu;
+
+ /* Convert the name */
+ name = C2Pascal_save(menu->dname);
+ if (name == NULL)
+ return;
+
+ /* Create the menu unless it's the help menu */
+#ifdef USE_HELPMENU
+ if (STRNCMP(name, "\4Help", 5) == 0)
+ {
+ menu->submenu_id = kHMHelpMenuID;
+ menu->submenu_handle = gui.MacOSHelpMenu;
+ }
+ else
+#endif
+ {
+ /* Carbon suggest use of
+ * OSStatus CreateNewMenu ( MenuID, MenuAttributes, MenuRef *);
+ * OSStatus SetMenuTitle ( MenuRef, ConstStr255Param title );
+ */
+ menu->submenu_id = next_avail_id;
+ menu->submenu_handle = NewMenu (menu->submenu_id, name);
+ next_avail_id++;
+ }
+
+ if (parent == NULL)
+ {
+ /* Adding a menu to the menubar, or in the no mans land (for PopUp) */
+
+ /* TODO: Verify if we could only Insert Menu if really part of the
+ * menubar The Inserted menu are scanned or the Command-key combos
+ */
+
+ /* Insert the menu unless it's the Help menu */
+#ifdef USE_HELPMENU
+ if (menu->submenu_id != kHMHelpMenuID)
+#endif
+ InsertMenu (menu->submenu_handle, menu_after_me); /* insert before */
+#if 1
+ /* Vim should normally update it. TODO: verify */
+ DrawMenuBar();
+#endif
+ }
+ else
+ {
+ /* Adding as a submenu */
+
+ index = gui_mac_get_menu_item_index (menu);
+
+ /* Call InsertMenuItem followed by SetMenuItemText
+ * to avoid special character recognition by InsertMenuItem
+ */
+ InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
+ SetMenuItemText(parent->submenu_handle, idx+1, name);
+ SetItemCmd(parent->submenu_handle, idx+1, 0x1B);
+ SetItemMark(parent->submenu_handle, idx+1, menu->submenu_id);
+ InsertMenu(menu->submenu_handle, hierMenu);
+ }
+
+ vim_free (name);
+
+#if 0
+ /* Done by Vim later on */
+ DrawMenuBar();
+#endif
+}
+
+/*
+ * Add a menu item to a menu
+ */
+ void
+gui_mch_add_menu_item(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ char_u *name;
+ vimmenu_T *parent = menu->parent;
+ int menu_inserted;
+
+ /* Cannot add item, if the menu have not been created */
+ if (parent->submenu_id == 0)
+ return;
+
+ /* Could call SetMenuRefCon [CARBON] to associate with the Menu,
+ for older OS call GetMenuItemData (menu, item, isCommandID?, data) */
+
+ /* Convert the name */
+ name = C2Pascal_save(menu->dname);
+
+ /* Where are just a menu item, so no handle, no id */
+ menu->submenu_id = 0;
+ menu->submenu_handle = NULL;
+
+#ifdef USE_HELPMENU
+ /* The index in the help menu are offseted */
+ if (parent->submenu_id == kHMHelpMenuID)
+ idx += gui.MacOSHelpItems;
+#endif
+
+ menu_inserted = 0;
+ if (menu->actext)
+ {
+ /* If the accelerator text for the menu item looks like it describes
+ * a command key (e.g., "<D-S-t>" or "<C-7>"), display it as the
+ * item's command equivalent.
+ */
+ int key = 0;
+ int modifiers = 0;
+ char_u *p_actext;
+
+ p_actext = menu->actext;
+ key = find_special_key(&p_actext, &modifiers, /*keycode=*/0);
+ if (*p_actext != 0)
+ key = 0; /* error: trailing text */
+ /* find_special_key() returns a keycode with as many of the
+ * specified modifiers as appropriate already applied (e.g., for
+ * "<D-C-x>" it returns Ctrl-X as the keycode and MOD_MASK_CMD
+ * as the only modifier). Since we want to display all of the
+ * modifiers, we need to convert the keycode back to a printable
+ * character plus modifiers.
+ * TODO: Write an alternative find_special_key() that doesn't
+ * apply modifiers.
+ */
+ if (key > 0 && key < 32)
+ {
+ /* Convert a control key to an uppercase letter. Note that
+ * by this point it is no longer possible to distinguish
+ * between, e.g., Ctrl-S and Ctrl-Shift-S.
+ */
+ modifiers |= MOD_MASK_CTRL;
+ key += '@';
+ }
+ /* If the keycode is an uppercase letter, set the Shift modifier.
+ * If it is a lowercase letter, don't set the modifier, but convert
+ * the letter to uppercase for display in the menu.
+ */
+ else if (key >= 'A' && key <= 'Z')
+ modifiers |= MOD_MASK_SHIFT;
+ else if (key >= 'a' && key <= 'z')
+ key += 'A' - 'a';
+ /* Note: keycodes below 0x22 are reserved by Apple. */
+ if (key >= 0x22 && vim_isprintc_strict(key))
+ {
+ int valid = 1;
+ char_u mac_mods = kMenuNoModifiers;
+ /* Convert Vim modifier codes to Menu Manager equivalents. */
+ if (modifiers & MOD_MASK_SHIFT)
+ mac_mods |= kMenuShiftModifier;
+ if (modifiers & MOD_MASK_CTRL)
+ mac_mods |= kMenuControlModifier;
+ if (!(modifiers & MOD_MASK_CMD))
+ mac_mods |= kMenuNoCommandModifier;
+ if (modifiers & MOD_MASK_ALT || modifiers & MOD_MASK_MULTI_CLICK)
+ valid = 0; /* TODO: will Alt someday map to Option? */
+ if (valid)
+ {
+ char_u item_txt[10];
+ /* Insert the menu item after idx, with its command key. */
+ item_txt[0] = 3; item_txt[1] = ' '; item_txt[2] = '/';
+ item_txt[3] = key;
+ InsertMenuItem(parent->submenu_handle, item_txt, idx);
+ /* Set the modifier keys. */
+ SetMenuItemModifiers(parent->submenu_handle, idx+1, mac_mods);
+ menu_inserted = 1;
+ }
+ }
+ }
+ /* Call InsertMenuItem followed by SetMenuItemText
+ * to avoid special character recognition by InsertMenuItem
+ */
+ if (!menu_inserted)
+ InsertMenuItem(parent->submenu_handle, "\p ", idx); /* afterItem */
+ /* Set the menu item name. */
+ SetMenuItemText(parent->submenu_handle, idx+1, name);
+
+#if 0
+ /* Called by Vim */
+ DrawMenuBar();
+#endif
+
+ /* TODO: Can name be freed? */
+ vim_free(name);
+}
+
+ void
+gui_mch_toggle_tearoffs(enable)
+ int enable;
+{
+ /* no tearoff menus */
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(menu)
+ vimmenu_T *menu;
+{
+ short index = gui_mac_get_menu_item_index (menu);
+
+ if (index > 0)
+ {
+ if (menu->parent)
+ {
+#ifdef USE_HELPMENU
+ if (menu->parent->submenu_handle != nil) /*gui.MacOSHelpMenu)*/
+#endif
+ {
+ /* For now just don't delete help menu items. (Huh? Dany) */
+ DeleteMenuItem (menu->parent->submenu_handle, index);
+
+ /* Delete the Menu if it was a hierarchical Menu */
+ if (menu->submenu_id != 0)
+ {
+ DeleteMenu (menu->submenu_id);
+ DisposeMenu (menu->submenu_handle);
+ }
+ }
+#ifdef USE_HELPMENU
+# ifdef DEBUG_MAC_MENU
+ else
+ {
+ printf ("gmdm 1\n");
+ }
+# endif
+#endif
+ }
+#ifdef DEBUG_MAC_MENU
+ else
+ {
+ printf ("gmdm 2\n");
+ }
+#endif
+ }
+ else
+ {
+ /* Do not delete the Help Menu */
+#ifdef USE_HELPMENU
+ if (menu->submenu_id != kHMHelpMenuID)
+#endif
+ {
+ DeleteMenu (menu->submenu_id);
+ DisposeMenu (menu->submenu_handle);
+ }
+ }
+ /* Shouldn't this be already done by Vim. TODO: Check */
+ DrawMenuBar();
+}
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(menu, grey)
+ vimmenu_T *menu;
+ int grey;
+{
+ /* TODO: Check if menu really exists */
+ short index = gui_mac_get_menu_item_index (menu);
+/*
+ index = menu->index;
+*/
+ if (grey)
+ {
+ if (menu->children)
+ DisableMenuItem(menu->submenu_handle, index);
+ if (menu->parent)
+ if (menu->parent->submenu_handle)
+ DisableMenuItem(menu->parent->submenu_handle, index);
+ }
+ else
+ {
+ if (menu->children)
+ EnableMenuItem(menu->submenu_handle, index);
+ if (menu->parent)
+ if (menu->parent->submenu_handle)
+ EnableMenuItem(menu->parent->submenu_handle, index);
+ }
+}
+
+/*
+ * Make menu item hidden or not hidden
+ */
+ void
+gui_mch_menu_hidden(menu, hidden)
+ vimmenu_T *menu;
+ int hidden;
+{
+ /* There's no hidden mode on MacOS */
+ gui_mch_menu_grey (menu, hidden);
+}
+
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar()
+{
+ DrawMenuBar();
+}
+
+
+/*
+ * Scrollbar stuff.
+ */
+
+ void
+gui_mch_enable_scrollbar(sb, flag)
+ scrollbar_T *sb;
+ int flag;
+{
+ if (flag)
+ ShowControl(sb->id);
+ else
+ HideControl(sb->id);
+
+#ifdef DEBUG_MAC_SB
+ printf ("enb_sb (%x) %x\n",sb->id, flag);
+#endif
+}
+
+ void
+gui_mch_set_scrollbar_thumb(sb, val, size, max)
+ scrollbar_T *sb;
+ long val;
+ long size;
+ long max;
+{
+ SetControl32BitMaximum (sb->id, max);
+ SetControl32BitMinimum (sb->id, 0);
+ SetControl32BitValue (sb->id, val);
+#ifdef DEBUG_MAC_SB
+ printf ("thumb_sb (%x) %x, %x,%x\n",sb->id, val, size, max);
+#endif
+}
+
+ void
+gui_mch_set_scrollbar_pos(sb, x, y, w, h)
+ scrollbar_T *sb;
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ gui_mch_set_bg_color(gui.back_pixel);
+/* if (gui.which_scrollbars[SBAR_LEFT])
+ {
+ MoveControl (sb->id, x-16, y);
+ SizeControl (sb->id, w + 1, h);
+ }
+ else
+ {
+ MoveControl (sb->id, x, y);
+ SizeControl (sb->id, w + 1, h);
+ }*/
+ if (sb == &gui.bottom_sbar)
+ h += 1;
+ else
+ w += 1;
+
+ if (gui.which_scrollbars[SBAR_LEFT])
+ x -= 15;
+
+ MoveControl (sb->id, x, y);
+ SizeControl (sb->id, w, h);
+#ifdef DEBUG_MAC_SB
+ printf ("size_sb (%x) %x, %x, %x, %x\n",sb->id, x, y, w, h);
+#endif
+}
+
+ void
+gui_mch_create_scrollbar(sb, orient)
+ scrollbar_T *sb;
+ int orient; /* SBAR_VERT or SBAR_HORIZ */
+{
+ Rect bounds;
+
+ bounds.top = -16;
+ bounds.bottom = -10;
+ bounds.right = -10;
+ bounds.left = -16;
+
+ sb->id = NewControl (gui.VimWindow,
+ &bounds,
+ "\pScrollBar",
+ TRUE,
+ 0, /* current*/
+ 0, /* top */
+ 0, /* bottom */
+#ifdef USE_CARBONIZED
+ kControlScrollBarLiveProc,
+#else
+ scrollBarProc,
+#endif
+ (long) sb->ident);
+#ifdef DEBUG_MAC_SB
+ printf ("create_sb (%x) %x\n",sb->id, orient);
+#endif
+}
+
+ void
+gui_mch_destroy_scrollbar(sb)
+ scrollbar_T *sb;
+{
+ gui_mch_set_bg_color(gui.back_pixel);
+ DisposeControl (sb->id);
+#ifdef DEBUG_MAC_SB
+ printf ("dest_sb (%x) \n",sb->id);
+#endif
+}
+
+
+/*
+ * Cursor blink functions.
+ *
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+ void
+gui_mch_set_blinking(long wait, long on, long off)
+{
+ /* TODO: TODO: TODO: TODO: */
+/* blink_waittime = wait;
+ blink_ontime = on;
+ blink_offtime = off;*/
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink()
+{
+ gui_update_cursor(TRUE, FALSE);
+ /* TODO: TODO: TODO: TODO: */
+/* gui_w32_rm_blink_timer();
+ if (blink_state == BLINK_OFF)
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_NONE;*/
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink()
+{
+ gui_update_cursor(TRUE, FALSE);
+ /* TODO: TODO: TODO: TODO: */
+/* gui_w32_rm_blink_timer(); */
+
+ /* Only switch blinking on if none of the times is zero */
+/* if (blink_waittime && blink_ontime && blink_offtime)
+ {
+ blink_timer = SetTimer(NULL, 0, (UINT)blink_waittime,
+ (TIMERPROC)_OnBlinkTimer);
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }*/
+}
+
+/*
+ * Return the RGB value of a pixel as long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ return (Red(pixel) << 16) + (Green(pixel) << 8) + Blue(pixel);
+}
+
+
+
+#ifdef FEAT_BROWSE
+/*
+ * Pop open a file browser and return the file selected, in allocated memory,
+ * or NULL if Cancel is hit.
+ * saving - TRUE if the file will be saved to, FALSE if it will be opened.
+ * title - Title message for the file browser dialog.
+ * dflt - Default name of file.
+ * ext - Default extension to be added to files without extensions.
+ * initdir - directory in which to open the browser (NULL = current dir)
+ * filter - Filter for matched files to choose from.
+ * Has a format like this:
+ * "C Files (*.c)\0*.c\0"
+ * "All Files\0*.*\0\0"
+ * If these two strings were concatenated, then a choice of two file
+ * filters will be selectable to the user. Then only matching files will
+ * be shown in the browser. If NULL, the default allows all files.
+ *
+ * *NOTE* - the filter string must be terminated with TWO nulls.
+ */
+ char_u *
+gui_mch_browse(
+ int saving,
+ char_u *title,
+ char_u *dflt,
+ char_u *ext,
+ char_u *initdir,
+ char_u *filter)
+{
+#if defined (USE_NAVIGATION_SERVICE) || defined (USE_CARBONIZED)
+ /* TODO: Add Ammon's safety checl (Dany) */
+ NavReplyRecord reply;
+ char_u *fname = NULL;
+ char_u **fnames = NULL;
+ long numFiles;
+ NavDialogOptions navOptions;
+ OSErr error;
+
+ /* Get Navigation Service Defaults value */
+ NavGetDefaultDialogOptions (&navOptions);
+
+
+ /* TODO: If we get a :browse args, set the Multiple bit. */
+ navOptions.dialogOptionFlags = kNavAllowInvisibleFiles
+ | kNavDontAutoTranslate
+ | kNavDontAddTranslateItems
+ /* | kNavAllowMultipleFiles */
+ | kNavAllowStationery;
+
+ (void) C2PascalString (title, &navOptions.message);
+ (void) C2PascalString (dflt, &navOptions.savedFileName);
+ /* Could set clientName?
+ * windowTitle? (there's no title bar?)
+ */
+
+ if (saving)
+ {
+ /* Change first parm AEDesc (typeFSS) *defaultLocation to match dflt */
+ NavPutFile (NULL, &reply, &navOptions, NULL, 'TEXT', 'VIM!', NULL);
+ if (!reply.validRecord)
+ return NULL;
+ }
+ else
+ {
+ /* Change first parm AEDesc (typeFSS) *defaultLocation to match dflt */
+ NavGetFile(NULL, &reply, &navOptions, NULL, NULL, NULL, NULL, NULL);
+ if (!reply.validRecord)
+ return NULL;
+ }
+
+ fnames = new_fnames_from_AEDesc(&reply.selection, &numFiles, &error);
+
+ NavDisposeReply (&reply);
+
+ if (fnames)
+ {
+ fname = fnames[0];
+ vim_free(fnames);
+ }
+
+ /* TODO: Shorten the file name if possible */
+ return fname;
+#else
+ SFTypeList fileTypes;
+ StandardFileReply reply;
+ Str255 Prompt;
+ Str255 DefaultName;
+ Str255 Directory;
+
+ /* TODO: split dflt in path and filename */
+
+ (void) C2PascalString (title, &Prompt);
+ (void) C2PascalString (dflt, &DefaultName);
+ (void) C2PascalString (initdir, &Directory);
+
+ if (saving)
+ {
+ /* Use a custon filter instead of nil FAQ 9-4 */
+ StandardPutFile (Prompt, DefaultName, &reply);
+ if (!reply.sfGood)
+ return NULL;
+ }
+ else
+ {
+ StandardGetFile (nil, -1, fileTypes, &reply);
+ if (!reply.sfGood)
+ return NULL;
+ }
+
+ /* Work fine but append a : for new file */
+ return (FullPathFromFSSpec_save (reply.sfFile));
+
+ /* Shorten the file name if possible */
+/* mch_dirname(IObuff, IOSIZE);
+ p = shorten_fname(fileBuf, IObuff);
+ if (p == NULL)
+ p = fileBuf;
+ return vim_strsave(p);
+*/
+#endif
+}
+#endif /* FEAT_BROWSE */
+
+#ifdef FEAT_GUI_DIALOG
+/*
+ * Stuff for dialogues
+ */
+
+/*
+ * Create a dialogue dynamically from the parameter strings.
+ * type = type of dialogue (question, alert, etc.)
+ * title = dialogue title. may be NULL for default title.
+ * message = text to display. Dialogue sizes to accommodate it.
+ * buttons = '\n' separated list of button captions, default first.
+ * dfltbutton = number of default button.
+ *
+ * This routine returns 1 if the first button is pressed,
+ * 2 for the second, etc.
+ *
+ * 0 indicates Esc was pressed.
+ * -1 for unexpected error
+ *
+ * If stubbing out this fn, return 1.
+ */
+
+typedef struct
+{
+ short idx;
+ short width; /* Size of the text in pixel */
+ Rect box;
+} vgmDlgItm; /* Vim Gui_Mac.c Dialog Item */
+
+#define MoveRectTo(r,x,y) OffsetRect(r,x-r->left,y-r->top)
+
+ static void
+macMoveDialogItem(
+ DialogRef theDialog,
+ short itemNumber,
+ short X,
+ short Y,
+ Rect *inBox)
+{
+#if 0 /* USE_CARBONIZED */
+ /* Untested */
+ MoveDialogItem (theDialog, itemNumber, X, Y);
+ if (inBox != nil)
+ GetDialogItem (theDialog, itemNumber, &itemType, &itemHandle, inBox);
+#else
+ short itemType;
+ Handle itemHandle;
+ Rect localBox;
+ Rect *itemBox = &localBox;
+
+ if (inBox != nil)
+ itemBox = inBox;
+
+ GetDialogItem (theDialog, itemNumber, &itemType, &itemHandle, itemBox);
+ OffsetRect (itemBox, -itemBox->left, -itemBox->top);
+ OffsetRect (itemBox, X, Y);
+ /* To move a control (like a button) we need to call both
+ * MoveControl and SetDialogItem. FAQ 6-18 */
+ if (1) /*(itemType & kControlDialogItem) */
+ MoveControl ((ControlRef) itemHandle, X, Y);
+ SetDialogItem (theDialog, itemNumber, itemType, itemHandle, itemBox);
+#endif
+}
+
+ static void
+macSizeDialogItem(
+ DialogRef theDialog,
+ short itemNumber,
+ short width,
+ short height)
+{
+ short itemType;
+ Handle itemHandle;
+ Rect itemBox;
+
+ GetDialogItem (theDialog, itemNumber, &itemType, &itemHandle, &itemBox);
+
+ /* When width or height is zero do not change it */
+ if (width == 0)
+ width = itemBox.right - itemBox.left;
+ if (height == 0)
+ height = itemBox.bottom - itemBox.top;
+
+#if 0 /* USE_CARBONIZED */
+ SizeDialogItem (theDialog, itemNumber, width, height); /* Untested */
+#else
+ /* Resize the bounding box */
+ itemBox.right = itemBox.left + width;
+ itemBox.bottom = itemBox.top + height;
+
+ /* To resize a control (like a button) we need to call both
+ * SizeControl and SetDialogItem. (deducted from FAQ 6-18) */
+ if (itemType & kControlDialogItem)
+ SizeControl ((ControlRef) itemHandle, width, height);
+
+ /* Configure back the item */
+ SetDialogItem (theDialog, itemNumber, itemType, itemHandle, &itemBox);
+#endif
+}
+
+ static void
+macSetDialogItemText(
+ DialogRef theDialog,
+ short itemNumber,
+ Str255 itemName)
+{
+ short itemType;
+ Handle itemHandle;
+ Rect itemBox;
+
+ GetDialogItem (theDialog, itemNumber, &itemType, &itemHandle, &itemBox);
+
+ if (itemType & kControlDialogItem)
+ SetControlTitle ((ControlRef) itemHandle, itemName);
+ else
+ SetDialogItemText (itemHandle, itemName);
+}
+
+ int
+gui_mch_dialog(
+ int type,
+ char_u *title,
+ char_u *message,
+ char_u *buttons,
+ int dfltbutton,
+ char_u *textfield)
+{
+ Handle buttonDITL;
+ Handle iconDITL;
+ Handle inputDITL;
+ Handle messageDITL;
+ Handle itemHandle;
+ Handle iconHandle;
+ DialogPtr theDialog;
+ char_u len;
+ char_u PascalTitle[256]; /* place holder for the title */
+ char_u name[256];
+ GrafPtr oldPort;
+ short itemHit;
+ char_u *buttonChar;
+ Rect box;
+ short button;
+ short lastButton;
+ short itemType;
+ short useIcon;
+ short width;
+ short totalButtonWidth = 0; /* the width of all button together incuding spacing */
+ short widestButton = 0;
+ short dfltButtonEdge = 20; /* gut feeling */
+ short dfltElementSpacing = 13; /* from IM:V.2-29 */
+ short dfltIconSideSpace = 23; /* from IM:V.2-29 */
+ short maximumWidth = 400; /* gut feeling */
+ short maxButtonWidth = 175; /* gut feeling */
+
+ short vertical;
+ short dialogHeight;
+ short messageLines = 3;
+ FontInfo textFontInfo;
+
+ vgmDlgItm iconItm;
+ vgmDlgItm messageItm;
+ vgmDlgItm inputItm;
+ vgmDlgItm buttonItm;
+
+ WindowRef theWindow;
+
+ /* Check 'v' flag in 'guioptions': vertical button placement. */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+
+ /* Create a new Dialog Box from template. */
+ theDialog = GetNewDialog (129, nil, (WindowRef) -1);
+
+ /* Get the WindowRef */
+ theWindow = GetDialogWindow(theDialog);
+
+ /* Hide the window.
+ * 1. to avoid seeing slow drawing
+ * 2. to prevent a problem seen while moving dialog item
+ * within a visible window. (non-Carbon MacOS 9)
+ * Could be avoided by changing the resource.
+ */
+ HideWindow (theWindow);
+
+ /* Change the graphical port to the dialog,
+ * so we can measure the text with the proper font */
+ GetPort (&oldPort);
+#ifdef USE_CARBONIZED
+ SetPortDialogPort (theDialog);
+#else
+ SetPort (theDialog);
+#endif
+
+ /* Get the info about the default text,
+ * used to calculate the height of the message
+ * and of the text field */
+ GetFontInfo(&textFontInfo);
+
+ /* Set the dialog title */
+ if (title != NULL)
+ {
+ (void) C2PascalString (title, &PascalTitle);
+ SetWTitle (theWindow, PascalTitle);
+ }
+
+ /* Creates the buttons and add them to the Dialog Box. */
+ buttonDITL = GetResource ('DITL', 130);
+ buttonChar = buttons;
+ button = 0;
+
+ for (;*buttonChar != 0;)
+ {
+ /* Get the name of the button */
+ button++;
+ len = 0;
+ for (;((*buttonChar != DLG_BUTTON_SEP) && (*buttonChar != 0) && (len < 255)); buttonChar++)
+ {
+ if (*buttonChar != DLG_HOTKEY_CHAR)
+ name[++len] = *buttonChar;
+ }
+ if (*buttonChar != 0)
+ buttonChar++;
+ name[0] = len;
+
+ /* Add the button */
+ AppendDITL (theDialog, buttonDITL, overlayDITL); /* appendDITLRight); */
+
+ /* Change the button's name */
+ macSetDialogItemText (theDialog, button, name);
+
+ /* Resize the button to fit its name */
+ width = StringWidth (name) + 2 * dfltButtonEdge;
+ /* Limite the size of any button to an acceptable value. */
+ /* TODO: Should be based on the message width */
+ if (width > maxButtonWidth)
+ width = maxButtonWidth;
+ macSizeDialogItem (theDialog, button, width, 0);
+
+ totalButtonWidth += width;
+
+ if (width > widestButton)
+ widestButton = width;
+ }
+ ReleaseResource (buttonDITL);
+ lastButton = button;
+
+ /* Add the icon to the Dialog Box. */
+ iconItm.idx = lastButton + 1;
+ iconDITL = GetResource ('DITL', 131);
+ switch (type)
+ {
+ case VIM_GENERIC: useIcon = kNoteIcon;
+ case VIM_ERROR: useIcon = kStopIcon;
+ case VIM_WARNING: useIcon = kCautionIcon;
+ case VIM_INFO: useIcon = kNoteIcon;
+ case VIM_QUESTION: useIcon = kNoteIcon;
+ default: useIcon = kStopIcon;
+ };
+ AppendDITL (theDialog, iconDITL, overlayDITL);
+ ReleaseResource (iconDITL);
+ GetDialogItem (theDialog, iconItm.idx, &itemType, &itemHandle, &box);
+ /* TODO: Should the item be freed? */
+ iconHandle = GetIcon (useIcon);
+ SetDialogItem (theDialog, iconItm.idx, itemType, iconHandle, &box);
+
+ /* Add the message to the Dialog box. */
+ messageItm.idx = lastButton + 2;
+ messageDITL = GetResource ('DITL', 132);
+ AppendDITL (theDialog, messageDITL, overlayDITL);
+ ReleaseResource (messageDITL);
+ GetDialogItem (theDialog, messageItm.idx, &itemType, &itemHandle, &box);
+ (void) C2PascalString (message, &name);
+ SetDialogItemText (itemHandle, name);
+ messageItm.width = StringWidth (name);
+
+ /* Add the input box if needed */
+ if (textfield != NULL)
+ {
+ /* Cheat for now reuse the message and convet to text edit */
+ inputItm.idx = lastButton + 3;
+ inputDITL = GetResource ('DITL', 132);
+ AppendDITL (theDialog, inputDITL, overlayDITL);
+ ReleaseResource (inputDITL);
+ GetDialogItem (theDialog, inputItm.idx, &itemType, &itemHandle, &box);
+/* SetDialogItem (theDialog, inputItm.idx, kEditTextDialogItem, itemHandle, &box);*/
+ (void) C2PascalString (textfield, &name);
+ SetDialogItemText (itemHandle, name);
+ inputItm.width = StringWidth (name);
+ }
+
+ /* Set the <ENTER> and <ESC> button. */
+ SetDialogDefaultItem (theDialog, dfltbutton);
+ SetDialogCancelItem (theDialog, 0);
+
+ /* Reposition element */
+
+ /* Check if we need to force vertical */
+ if (totalButtonWidth > maximumWidth)
+ vertical = TRUE;
+
+ /* Place icon */
+ macMoveDialogItem (theDialog, iconItm.idx, dfltIconSideSpace, dfltElementSpacing, &box);
+ iconItm.box.right = box.right;
+ iconItm.box.bottom = box.bottom;
+
+ /* Place Message */
+ messageItm.box.left = iconItm.box.right + dfltIconSideSpace;
+ macSizeDialogItem (theDialog, messageItm.idx, 0, messageLines * (textFontInfo.ascent + textFontInfo.descent));
+ macMoveDialogItem (theDialog, messageItm.idx, messageItm.box.left, dfltElementSpacing, &messageItm.box);
+
+ /* Place Input */
+ if (textfield != NULL)
+ {
+ inputItm.box.left = messageItm.box.left;
+ inputItm.box.top = messageItm.box.bottom + dfltElementSpacing;
+ macSizeDialogItem (theDialog, inputItm.idx, 0, textFontInfo.ascent + textFontInfo.descent);
+ macMoveDialogItem (theDialog, inputItm.idx, inputItm.box.left, inputItm.box.top, &inputItm.box);
+ /* Convert the static text into a text edit.
+ * For some reason this change need to be done last (Dany) */
+ GetDialogItem (theDialog, inputItm.idx, &itemType, &itemHandle, &inputItm.box);
+ SetDialogItem (theDialog, inputItm.idx, kEditTextDialogItem, itemHandle, &inputItm.box);
+ SelectDialogItemText(theDialog, inputItm.idx, 0, 32767);
+ }
+
+ /* Place Button */
+ if (textfield != NULL)
+ {
+ buttonItm.box.left = inputItm.box.left;
+ buttonItm.box.top = inputItm.box.bottom + dfltElementSpacing;
+ }
+ else
+ {
+ buttonItm.box.left = messageItm.box.left;
+ buttonItm.box.top = messageItm.box.bottom + dfltElementSpacing;
+ }
+
+ for (button=1; button <= lastButton; button++)
+ {
+
+ macMoveDialogItem (theDialog, button, buttonItm.box.left, buttonItm.box.top, &box);
+ /* With vertical, it's better to have all button the same lenght */
+ if (vertical)
+ {
+ macSizeDialogItem (theDialog, button, widestButton, 0);
+ GetDialogItem (theDialog, button, &itemType, &itemHandle, &box);
+ }
+ /* Calculate position of next button */
+ if (vertical)
+ buttonItm.box.top = box.bottom + dfltElementSpacing;
+ else
+ buttonItm.box.left = box.right + dfltElementSpacing;
+ }
+
+ /* Resize the dialog box */
+ dialogHeight = box.bottom + dfltElementSpacing;
+ SizeWindow(theWindow, maximumWidth, dialogHeight, TRUE);
+
+#ifdef USE_CARBONIZED
+ /* Magic resize */
+ AutoSizeDialog (theDialog);
+ /* Need a horizontal resize anyway so not that useful */
+#endif
+
+ /* Display it */
+ ShowWindow(theWindow);
+/* BringToFront(theWindow); */
+ SelectWindow(theWindow);
+
+/* DrawDialog (theDialog); */
+#if 0
+ GetPort (&oldPort);
+#ifdef USE_CARBONIZED
+ SetPortDialogPort (theDialog);
+#else
+ SetPort (theDialog);
+#endif
+#endif
+
+ /* Hang until one of the button is hit */
+ do
+ {
+ ModalDialog (nil, &itemHit);
+ } while ((itemHit < 1) || (itemHit > lastButton));
+
+ /* Copy back the text entered by the user into the param */
+ if (textfield != NULL)
+ {
+ GetDialogItem (theDialog, inputItm.idx, &itemType, &itemHandle, &box);
+ GetDialogItemText (itemHandle, (char_u *) &name);
+#if IOSIZE < 256
+ /* Truncate the name to IOSIZE if needed */
+ if (name[0] > IOSIZE)
+ name[0] = IOSIZE - 1;
+#endif
+ STRNCPY(textfield, &name[1], name[0]);
+ textfield[name[0]] = NUL;
+ }
+
+ /* Restore the original graphical port */
+ SetPort (oldPort);
+
+ /* Get ride of th edialog (free memory) */
+ DisposeDialog (theDialog);
+
+ return itemHit;
+/*
+ * Usefull thing which could be used
+ * SetDialogTimeout(): Auto click a button after timeout
+ * SetDialogTracksCursor() : Get the I-beam cursor over input box
+ * MoveDialogItem(): Probably better than SetDialogItem
+ * SizeDialogItem(): (but is it Carbon Only?)
+ * AutoSizeDialog(): Magic resize of dialog based on text lenght
+ */
+}
+#endif /* FEAT_DIALOG_GUI */
+
+/*
+ * Display the saved error message(s).
+ */
+#ifdef USE_MCH_ERRMSG
+ void
+display_errors()
+{
+ char *p;
+ char_u pError[256];
+
+ if (error_ga.ga_data != NULL)
+ {
+ /* avoid putting up a message box with blanks only */
+ for (p = (char *)error_ga.ga_data; *p; ++p)
+ if (!isspace(*p))
+ {
+ if (STRLEN(p) > 255)
+ pError[0] = 255;
+ else
+ pError[0] = STRLEN(p);
+
+ STRNCPY(&pError[1], p, pError[0]);
+ ParamText (pError, nil, nil, nil);
+ Alert (128, nil);
+ break;
+ /* TODO: handled message longer than 256 chars
+ * use auto-sizeable alert
+ * or dialog with scrollbars (TextEdit zone)
+ */
+ }
+ ga_clear(&error_ga);
+ }
+}
+#endif
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x()
+{
+ Point where;
+
+ GetMouse(&where);
+
+ return (where.h);
+}
+
+ int
+gui_mch_get_mouse_y()
+{
+ Point where;
+
+ GetMouse(&where);
+
+ return (where.v);
+}
+
+ void
+gui_mch_setmouse(x, y)
+ int x;
+ int y;
+{
+ /* TODO */
+#if 0
+ /* From FAQ 3-11 */
+
+ CursorDevicePtr myMouse;
+ Point where;
+
+ if ( NGetTrapAddress (_CursorDeviceDispatch, ToolTrap)
+ != NGetTrapAddress (_Unimplemented, ToolTrap) )
+ {
+ /* New way */
+
+ /*
+ * Get first devoice with one button.
+ * This will probably be the standad mouse
+ * startat head of cursor dev list
+ *
+ */
+
+ myMouse = nil;
+
+ do
+ {
+ /* Get the next cursor device */
+ CursorDeviceNextDevice(&myMouse);
+ }
+ while ( (myMouse != nil) && (myMouse->cntButtons != 1) );
+
+ CursorDeviceMoveTo (myMouse, x, y);
+ }
+ else
+ {
+ /* Old way */
+ where.h = x;
+ where.v = y;
+
+ *(Point *)RawMouse = where;
+ *(Point *)MTemp = where;
+ *(Ptr) CrsrNew = 0xFFFF;
+ }
+#endif
+}
+
+ void
+gui_mch_show_popupmenu(menu)
+ vimmenu_T *menu;
+{
+#ifdef USE_CTRLCLICKMENU
+/*
+ * Clone PopUp to use menu
+ * Create a object descriptor for the current selection
+ * Call the procedure
+ */
+
+ MenuHandle CntxMenu;
+ Point where;
+ OSStatus status;
+ UInt32 CntxType;
+ SInt16 CntxMenuID;
+ UInt16 CntxMenuItem;
+ Str255 HelpName = "";
+ GrafPtr savePort;
+
+ /* Save Current Port: On MacOS X we seem to lose the port */
+ GetPort (&savePort); /*OSX*/
+
+ GetMouse (&where);
+ LocalToGlobal (&where); /*OSX*/
+ CntxMenu = menu->submenu_handle;
+
+ /* TODO: Get the text selection from Vim */
+
+ /* Call to Handle Popup */
+ status = ContextualMenuSelect(CntxMenu, where, false, kCMHelpItemNoHelp, HelpName, NULL, &CntxType, &CntxMenuID, &CntxMenuItem);
+
+ if (status == noErr)
+ {
+ if (CntxType == kCMMenuItemSelected)
+ {
+ /* Handle the menu CntxMenuID, CntxMenuItem */
+ /* The submenu can be handle directly by gui_mac_handle_menu */
+ /* But what about the current menu, is the menu changed by ContextualMenuSelect */
+ gui_mac_handle_menu ((CntxMenuID << 16) + CntxMenuItem);
+ }
+ else if (CntxMenuID == kCMShowHelpSelected)
+ {
+ /* Should come up with the help */
+ }
+ }
+
+ /* Restore original Port */
+ SetPort (savePort); /*OSX*/
+#endif
+}
+
+#if defined(FEAT_CW_EDITOR) || defined(PROTO)
+/* TODO: Is it need for MACOS_X? (Dany) */
+ void
+mch_post_buffer_write(buf_T *buf)
+{
+# ifdef USE_SIOUX
+ printf ("Writing Buf...\n");
+# endif
+ GetFSSpecFromPath (buf->b_ffname, &buf->b_FSSpec);
+ Send_KAHL_MOD_AE (buf);
+}
+#endif
+
+#ifdef FEAT_TITLE
+/*
+ * Set the window title and icon.
+ * (The icon is not taken care of).
+ */
+ void
+gui_mch_settitle(title, icon)
+ char_u *title;
+ char_u *icon;
+{
+ /* TODO: Get vim to make sure maxlen (from p_titlelen) is smaller
+ * that 256. Even better get it to fit nicely in the titlebar.
+ */
+ char_u *pascalTitle;
+
+ if (title == NULL) /* nothing to do */
+ return;
+
+ pascalTitle = C2Pascal_save(title);
+ if (pascalTitle != NULL)
+ {
+ SetWTitle(gui.VimWindow, pascalTitle);
+ vim_free(pascalTitle);
+ }
+}
+#endif
+
+/*
+ * Transfered from os_mac.c for MacOS X using os_unix.c prep work
+ */
+
+ int
+C2PascalString (CString, PascalString)
+ char_u *CString;
+ Str255 *PascalString;
+{
+ char_u *PascalPtr = (char_u *) PascalString;
+ int len;
+ int i;
+
+ PascalPtr[0] = 0;
+ if (CString == NULL)
+ return 0;
+
+ len = STRLEN(CString);
+ if (len > 255)
+ len = 255;
+
+ for (i = 0; i < len; i++)
+ PascalPtr[i+1] = CString[i];
+
+ PascalPtr[0] = len;
+
+ return 0;
+}
+
+ int
+GetFSSpecFromPath (file, fileFSSpec)
+ char_u *file;
+ FSSpec *fileFSSpec;
+{
+ /* From FAQ 8-12 */
+ Str255 filePascal;
+ CInfoPBRec myCPB;
+ OSErr err;
+
+ (void) C2PascalString (file, &filePascal);
+
+ myCPB.dirInfo.ioNamePtr = filePascal;
+ myCPB.dirInfo.ioVRefNum = 0;
+ myCPB.dirInfo.ioFDirIndex = 0;
+ myCPB.dirInfo.ioDrDirID = 0;
+
+ err= PBGetCatInfo (&myCPB, false);
+
+ /* vRefNum, dirID, name */
+ FSMakeFSSpec (0, 0, filePascal, fileFSSpec);
+
+ /* TODO: Use an error code mechanism */
+ return 0;
+}
+
+/*
+ * Convert a FSSpec to a fuill path
+ */
+
+char_u *FullPathFromFSSpec_save (FSSpec file)
+{
+ /*
+ * TODO: Add protection for 256 char max.
+ */
+
+ CInfoPBRec theCPB;
+ char_u fname[256];
+ char_u *filenamePtr = fname;
+ OSErr error;
+ int folder = 1;
+#ifdef USE_UNIXFILENAME
+ SInt16 dfltVol_vRefNum;
+ SInt32 dfltVol_dirID;
+ FSRef refFile;
+ OSStatus status;
+ UInt32 pathSize = 256;
+ char_u pathname[256];
+ char_u *path = pathname;
+#else
+ Str255 directoryName;
+ char_u temporary[255];
+ char_u *temporaryPtr = temporary;
+#endif
+
+#ifdef USE_UNIXFILENAME
+ /* Get the default volume */
+ /* TODO: Remove as this only work if Vim is on the Boot Volume*/
+ error=HGetVol ( NULL, &dfltVol_vRefNum, &dfltVol_dirID );
+
+ if (error)
+ return NULL;
+#endif
+
+ /* Start filling fname with file.name */
+ STRNCPY(filenamePtr, &file.name[1], file.name[0]);
+ filenamePtr[file.name[0]] = 0; /* NULL terminate the string */
+
+ /* Get the info about the file specified in FSSpec */
+ theCPB.dirInfo.ioFDirIndex = 0;
+ theCPB.dirInfo.ioNamePtr = file.name;
+ theCPB.dirInfo.ioVRefNum = file.vRefNum;
+ /*theCPB.hFileInfo.ioDirID = 0;*/
+ theCPB.dirInfo.ioDrDirID = file.parID;
+
+ /* As ioFDirIndex = 0, get the info of ioNamePtr,
+ which is relative to ioVrefNum, ioDirID */
+ error = PBGetCatInfo (&theCPB, false);
+
+ /* If we are called for a new file we expect fnfErr */
+ if ((error) && (error != fnfErr))
+ return NULL;
+
+ /* Check if it's a file or folder */
+ /* default to file if file don't exist */
+ if (((theCPB.hFileInfo.ioFlAttrib & ioDirMask) == 0) || (error))
+ folder = 0; /* It's not a folder */
+ else
+ folder = 1;
+
+#ifdef USE_UNIXFILENAME
+ /*
+ * The function used here are available in Carbon, but
+ * do nothing une MacOS 8 and 9
+ */
+ if (error == fnfErr)
+ {
+ /* If the file to be saved does not already exist, it isn't possible
+ to convert its FSSpec into an FSRef. But we can construct an
+ FSSpec for the file's parent folder (since we have its volume and
+ directory IDs), and since that folder does exist, we can convert
+ that FSSpec into an FSRef, convert the FSRef in turn into a path,
+ and, finally, append the filename. */
+ FSSpec dirSpec;
+ FSRef dirRef;
+ Str255 emptyFilename = "\p";
+ error = FSMakeFSSpec(theCPB.dirInfo.ioVRefNum,
+ theCPB.dirInfo.ioDrDirID, emptyFilename, &dirSpec);
+ if (error)
+ return NULL;
+
+ error = FSpMakeFSRef(&dirSpec, &dirRef);
+ if (error)
+ return NULL;
+
+ status = FSRefMakePath(&dirRef, (UInt8*)path, pathSize);
+ if (status)
+ return NULL;
+
+ STRCAT(path, "/");
+ STRCAT(path, filenamePtr);
+ }
+ else
+ {
+ /* If the file to be saved already exists, we can get its full path
+ by converting its FSSpec into an FSRef. */
+ error=FSpMakeFSRef (&file, &refFile);
+ if (error)
+ return NULL;
+
+ status=FSRefMakePath (&refFile, (UInt8 *) path, pathSize);
+ if (status)
+ return NULL;
+ }
+
+ /* Add a slash at the end if needed */
+ if (folder)
+ STRCAT (path, "/");
+
+ return (vim_strsave (path));
+#else
+ /* TODO: Get rid of all USE_UNIXFILENAME below */
+ /* Set ioNamePtr, it's the same area which is always reused. */
+ theCPB.dirInfo.ioNamePtr = directoryName;
+
+ /* Trick for first entry, set ioDrParID to the first value
+ * we want for ioDrDirID*/
+ theCPB.dirInfo.ioDrParID = file.parID;
+ theCPB.dirInfo.ioDrDirID = file.parID;
+
+ if ((TRUE) && (file.parID != fsRtDirID /*fsRtParID*/ ))
+ do
+ {
+ theCPB.dirInfo.ioFDirIndex = -1;
+ /* theCPB.dirInfo.ioNamePtr = directoryName; Already done above. */
+ theCPB.dirInfo.ioVRefNum = file.vRefNum;
+ /* theCPB.dirInfo.ioDirID = irrevelant when ioFDirIndex = -1 */
+ theCPB.dirInfo.ioDrDirID = theCPB.dirInfo.ioDrParID;
+
+ /* As ioFDirIndex = -1, get the info of ioDrDirID, */
+ /* *ioNamePtr[0 TO 31] will be updated */
+ error = PBGetCatInfo (&theCPB,false);
+
+ if (error)
+ return NULL;
+
+ /* Put the new directoryName in front of the current fname */
+ STRCPY(temporaryPtr, filenamePtr);
+ STRNCPY(filenamePtr, &directoryName[1], directoryName[0]);
+ filenamePtr[directoryName[0]] = 0; /* NULL terminate the string */
+ STRCAT(filenamePtr, ":");
+ STRCAT(filenamePtr, temporaryPtr);
+ }
+#if 1 /* def USE_UNIXFILENAME */
+ while ((theCPB.dirInfo.ioDrParID != fsRtDirID) /* && */
+ /* (theCPB.dirInfo.ioDrDirID != fsRtDirID)*/);
+#else
+ while (theCPB.dirInfo.ioDrDirID != fsRtDirID);
+#endif
+
+ /* Get the information about the volume on which the file reside */
+ theCPB.dirInfo.ioFDirIndex = -1;
+ /* theCPB.dirInfo.ioNamePtr = directoryName; Already done above. */
+ theCPB.dirInfo.ioVRefNum = file.vRefNum;
+ /* theCPB.dirInfo.ioDirID = irrevelant when ioFDirIndex = -1 */
+ theCPB.dirInfo.ioDrDirID = theCPB.dirInfo.ioDrParID;
+
+ /* As ioFDirIndex = -1, get the info of ioDrDirID, */
+ /* *ioNamePtr[0 TO 31] will be updated */
+ error = PBGetCatInfo (&theCPB,false);
+
+ if (error)
+ return NULL;
+
+ /* For MacOS Classic always add the volume name */
+ /* For MacOS X add the volume name preceded by "Volumes" */
+ /* when we are not refering to the boot volume */
+#ifdef USE_UNIXFILENAME
+ if (file.vRefNum != dfltVol_vRefNum)
+#endif
+ {
+ /* Add the volume name */
+ STRCPY(temporaryPtr, filenamePtr);
+ STRNCPY(filenamePtr, &directoryName[1], directoryName[0]);
+ filenamePtr[directoryName[0]] = 0; /* NULL terminate the string */
+ STRCAT(filenamePtr, ":");
+ STRCAT(filenamePtr, temporaryPtr);
+
+#ifdef USE_UNIXFILENAME
+ STRCPY(temporaryPtr, filenamePtr);
+ filenamePtr[0] = 0; /* NULL terminate the string */
+ STRCAT(filenamePtr, "Volumes:");
+ STRCAT(filenamePtr, temporaryPtr);
+#endif
+ }
+
+ /* Append final path separator if it's a folder */
+ if (folder)
+ STRCAT (fname, ":");
+
+ /* As we use Unix File Name for MacOS X convert it */
+#ifdef USE_UNIXFILENAME
+ /* Need to insert leading / */
+ /* TODO: get the above code to use directly the / */
+ STRCPY(&temporaryPtr[1], filenamePtr);
+ temporaryPtr[0] = '/';
+ STRCPY(filenamePtr, temporaryPtr);
+ {
+ char *p;
+ for (p = fname; *p; p++)
+ if (*p == ':')
+ *p = '/';
+ }
+#endif
+
+ return (vim_strsave (fname));
+#endif
+}
+
+#if defined(USE_IM_CONTROL) || defined(PROTO)
+/*
+ * Input Method Control functions.
+ */
+
+/*
+ * Notify cursor position to IM.
+ */
+ void
+im_set_position(int row, int col)
+{
+ /* TODO: Implement me! */
+}
+
+/*
+ * Set IM status on ("active" is TRUE) or off ("active" is FALSE).
+ */
+ void
+im_set_active(int active)
+{
+ KeyScript(active ? smKeySysScript : smKeyRoman);
+}
+
+/*
+ * Get IM status. When IM is on, return not 0. Else return 0.
+ */
+ int
+im_get_status()
+{
+ SInt32 script = GetScriptManagerVariable(smKeyScript);
+ return (script != smRoman
+ && script == GetScriptManagerVariable(smSysScript)) ? 1 : 0;
+}
+#endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
diff --git a/src/gui_mac.icns b/src/gui_mac.icns
new file mode 100644
index 000000000..b65fa11d8
--- /dev/null
+++ b/src/gui_mac.icns
Binary files differ
diff --git a/src/gui_mac.r b/src/gui_mac.r
new file mode 100644
index 000000000..7a1916bd0
--- /dev/null
+++ b/src/gui_mac.r
@@ -0,0 +1,33 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read a list of people who contributed.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#ifdef environ_os_mac /* or 1 for Carbon, 0 for non-Carbon */
+# include <Carbon/Carbon.r>
+#else
+# include <SysTypes.r>
+# include <Types.r>
+#endif
+#include "version.h"
+
+/* Used as application version */
+resource 'vers' (1) {
+ VIM_VERSION_MAJOR, VIM_VERSION_BUILD_BCD, VIM_VERSION_RELEASE, VIM_VERSION_PATCHLEVEL,
+ verUS,
+ VIM_VERSION_MEDIUM,
+ VIM_VERSION_LONG_DATE $$date " " $$time ")"
+};
+
+/* Used as application group version */
+resource 'vers' (2) {
+ VIM_VERSION_MAJOR, VIM_VERSION_BUILD_BCD, VIM_VERSION_RELEASE, VIM_VERSION_PATCHLEVEL,
+ verUS,
+ VIM_VERSION_MEDIUM,
+ VIM_VERSION_LONG
+};
+
+/* TODO: Small About box with compile time */
diff --git a/src/gui_motif.c b/src/gui_motif.c
new file mode 100644
index 000000000..4fe26ec57
--- /dev/null
+++ b/src/gui_motif.c
@@ -0,0 +1,3090 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include <Xm/Form.h>
+#include <Xm/RowColumn.h>
+#include <Xm/PushB.h>
+#include <Xm/Text.h>
+#include <Xm/TextF.h>
+#include <Xm/Separator.h>
+#include <Xm/Label.h>
+#include <Xm/CascadeB.h>
+#include <Xm/ScrollBar.h>
+#include <Xm/MenuShell.h>
+#include <Xm/DrawingA.h>
+#if (XmVersion >= 1002)
+# include <Xm/RepType.h>
+#endif
+#include <Xm/Frame.h>
+#include <Xm/LabelG.h>
+#include <Xm/ToggleBG.h>
+#include <Xm/SeparatoG.h>
+
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include <X11/StringDefs.h>
+#include <X11/Intrinsic.h>
+
+#include "vim.h"
+
+#ifdef HAVE_X11_XPM_H
+# include <X11/xpm.h>
+#else
+# ifdef HAVE_XM_XPMP_H
+# include <Xm/XpmP.h>
+# endif
+#endif
+
+#if defined(FEAT_GUI_DIALOG) && defined(HAVE_XPM)
+# include "../pixmaps/alert.xpm"
+# include "../pixmaps/error.xpm"
+# include "../pixmaps/generic.xpm"
+# include "../pixmaps/info.xpm"
+# include "../pixmaps/quest.xpm"
+#endif
+
+#define MOTIF_POPUP
+
+extern Widget vimShell;
+
+static Widget vimForm;
+static Widget textAreaForm;
+Widget textArea;
+#ifdef FEAT_TOOLBAR
+static Widget toolBarFrame;
+static Widget toolBar;
+#endif
+#ifdef FEAT_FOOTER
+static Widget footer;
+#endif
+#ifdef FEAT_MENU
+# if (XmVersion >= 1002)
+/* remember the last set value for the tearoff item */
+static int tearoff_val = (int)XmTEAR_OFF_ENABLED;
+# endif
+static Widget menuBar;
+#endif
+
+static void scroll_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+#ifdef FEAT_TOOLBAR
+# if 0
+static void toolbar_enter_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+static void toolbar_leave_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+# endif
+# ifdef FEAT_FOOTER
+static void toolbarbutton_enter_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+static void toolbarbutton_leave_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+# endif
+static void gui_mch_reset_focus __ARGS((void));
+#endif
+#ifdef FEAT_FOOTER
+static int gui_mch_compute_footer_height __ARGS((void));
+#endif
+#ifdef WSDEBUG
+static void attachDump(Widget, char *);
+#endif
+
+static void gui_motif_menu_colors __ARGS((Widget id));
+static void gui_motif_scroll_colors __ARGS((Widget id));
+#ifdef FEAT_MENU
+static void gui_motif_menu_fontlist __ARGS((Widget id));
+#endif
+
+#if (XmVersion >= 1002)
+# define STRING_TAG XmFONTLIST_DEFAULT_TAG
+#else
+# define STRING_TAG XmSTRING_DEFAULT_CHARSET
+#endif
+
+/*
+ * Call-back routines.
+ */
+
+/* ARGSUSED */
+ static void
+scroll_cb(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data, call_data;
+{
+ scrollbar_T *sb;
+ long value;
+ int dragging;
+
+ sb = gui_find_scrollbar((long)client_data);
+
+ value = ((XmScrollBarCallbackStruct *)call_data)->value;
+ dragging = (((XmScrollBarCallbackStruct *)call_data)->reason ==
+ (int)XmCR_DRAG);
+ gui_drag_scrollbar(sb, value, dragging);
+}
+
+
+/*
+ * End of call-back routines
+ */
+
+/*
+ * Create all the motif widgets necessary.
+ */
+ void
+gui_x11_create_widgets()
+{
+ /*
+ * Start out by adding the configured border width into the border offset
+ */
+ gui.border_offset = gui.border_width;
+
+ /*
+ * Install the tearOffModel resource converter.
+ */
+#if (XmVersion >= 1002)
+ XmRepTypeInstallTearOffModelConverter();
+#endif
+
+ /* Make sure the "Quit" menu entry of the window manager is ignored */
+ XtVaSetValues(vimShell, XmNdeleteResponse, XmDO_NOTHING, NULL);
+
+ vimForm = XtVaCreateManagedWidget("vimForm",
+ xmFormWidgetClass, vimShell,
+ XmNborderWidth, 0,
+ XmNhighlightThickness, 0,
+ XmNshadowThickness, 0,
+ XmNmarginWidth, 0,
+ XmNmarginHeight, 0,
+ XmNresizePolicy, XmRESIZE_ANY,
+ NULL);
+ gui_motif_menu_colors(vimForm);
+
+#ifdef FEAT_MENU
+ {
+ Arg al[7]; /* Make sure there is enough room for arguments! */
+ int ac = 0;
+
+# if (XmVersion >= 1002)
+ XtSetArg(al[ac], XmNtearOffModel, tearoff_val); ac++;
+# endif
+ XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
+ XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
+ XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
+# ifndef FEAT_TOOLBAR
+ /* Always stick to right hand side. */
+ XtSetArg(al[ac], XmNrightOffset, 0); ac++;
+# endif
+ menuBar = XmCreateMenuBar(vimForm, "menuBar", al, ac);
+ XtManageChild(menuBar);
+
+ /* Remember the default colors, needed for ":hi clear". */
+ XtVaGetValues(menuBar,
+ XmNbackground, &gui.menu_def_bg_pixel,
+ XmNforeground, &gui.menu_def_fg_pixel,
+ NULL);
+ gui_motif_menu_colors(menuBar);
+ }
+#endif
+
+#ifdef FEAT_TOOLBAR
+ /*
+ * Create an empty ToolBar. We should get buttons defined from menu.vim.
+ */
+ toolBarFrame = XtVaCreateWidget("toolBarFrame",
+ xmFrameWidgetClass, vimForm,
+ XmNshadowThickness, 0,
+ XmNmarginHeight, 0,
+ XmNmarginWidth, 0,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ gui_motif_menu_colors(toolBarFrame);
+
+ toolBar = XtVaCreateManagedWidget("toolBar",
+ xmRowColumnWidgetClass, toolBarFrame,
+ XmNchildType, XmFRAME_WORKAREA_CHILD,
+ XmNrowColumnType, XmWORK_AREA,
+ XmNorientation, XmHORIZONTAL,
+ XmNtraversalOn, False,
+ XmNisHomogeneous, False,
+ XmNpacking, XmPACK_TIGHT,
+ XmNspacing, 0,
+ XmNshadowThickness, 0,
+ XmNhighlightThickness, 0,
+ XmNmarginHeight, 0,
+ XmNmarginWidth, 0,
+ XmNadjustLast, True,
+ NULL);
+ gui_motif_menu_colors(toolBar);
+
+# if 0 /* these don't work, because of the XmNtraversalOn above. */
+ XtAddEventHandler(toolBar, EnterWindowMask, False,
+ toolbar_enter_cb, NULL);
+ XtAddEventHandler(toolBar, LeaveWindowMask, False,
+ toolbar_leave_cb, NULL);
+# endif
+#endif
+
+ textAreaForm = XtVaCreateManagedWidget("textAreaForm",
+ xmFormWidgetClass, vimForm,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNmarginWidth, 0,
+ XmNmarginHeight, 0,
+ XmNresizePolicy, XmRESIZE_ANY,
+ NULL);
+ gui_motif_scroll_colors(textAreaForm);
+
+ textArea = XtVaCreateManagedWidget("textArea",
+ xmDrawingAreaWidgetClass, textAreaForm,
+ XmNforeground, gui.norm_pixel,
+ XmNbackground, gui.back_pixel,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNbottomAttachment, XmATTACH_FORM,
+
+ /*
+ * These take some control away from the user, but avoids making them
+ * add resources to get a decent looking setup.
+ */
+ XmNborderWidth, 0,
+ XmNhighlightThickness, 0,
+ XmNshadowThickness, 0,
+ NULL);
+
+#ifdef FEAT_FOOTER
+ /*
+ * Create the Footer.
+ */
+ footer = XtVaCreateWidget("footer",
+ xmLabelGadgetClass, vimForm,
+ XmNalignment, XmALIGNMENT_BEGINNING,
+ XmNmarginHeight, 0,
+ XmNmarginWidth, 0,
+ XmNtraversalOn, False,
+ XmNrecomputeSize, False,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 5,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+ gui_mch_set_footer((char_u *) "");
+#endif
+
+ /*
+ * Install the callbacks.
+ */
+ gui_x11_callbacks(textArea, vimForm);
+
+ /* Pretend we don't have input focus, we will get an event if we do. */
+ gui.in_focus = FALSE;
+}
+
+/*
+ * Called when the GUI is not going to start after all.
+ */
+ void
+gui_x11_destroy_widgets()
+{
+ textArea = NULL;
+#ifdef FEAT_MENU
+ menuBar = NULL;
+#endif
+}
+
+/*ARGSUSED*/
+ void
+gui_mch_set_text_area_pos(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+#ifdef FEAT_TOOLBAR
+ /* Give keyboard focus to the textArea instead of the toolbar. */
+ gui_mch_reset_focus();
+#endif
+}
+
+ void
+gui_x11_set_back_color()
+{
+ if (textArea != NULL)
+#if (XmVersion >= 1002)
+ XmChangeColor(textArea, gui.back_pixel);
+#else
+ XtVaSetValues(textArea,
+ XmNbackground, gui.back_pixel,
+ NULL);
+#endif
+}
+
+/*
+ * Manage dialog centered on pointer. This could be used by the Athena code as
+ * well.
+ */
+static void manage_centered __ARGS((Widget dialog_child));
+
+static void
+manage_centered(dialog_child)
+ Widget dialog_child;
+{
+ Widget shell = XtParent(dialog_child);
+ Window root, child;
+ unsigned int mask;
+ unsigned int width, height, border_width, depth;
+ int x, y, win_x, win_y, maxX, maxY;
+ Boolean mappedWhenManaged;
+
+ /* Temporarily set value of XmNmappedWhenManaged
+ to stop the dialog from popping up right away */
+ XtVaGetValues(shell, XmNmappedWhenManaged, &mappedWhenManaged, 0);
+ XtVaSetValues(shell, XmNmappedWhenManaged, False, 0);
+
+ XtManageChild(dialog_child);
+
+ /* Get the pointer position (x, y) */
+ XQueryPointer(XtDisplay(shell), XtWindow(shell), &root, &child,
+ &x, &y, &win_x, &win_y, &mask);
+
+ /* Translate the pointer position (x, y) into a position for the new
+ window that will place the pointer at its center */
+ XGetGeometry(XtDisplay(shell), XtWindow(shell), &root, &win_x, &win_y,
+ &width, &height, &border_width, &depth);
+ width += 2 * border_width;
+ height += 2 * border_width;
+ x -= width / 2;
+ y -= height / 2;
+
+ /* Ensure that the dialog remains on screen */
+ maxX = XtScreen(shell)->width - width;
+ maxY = XtScreen(shell)->height - height;
+ if (x < 0)
+ x = 0;
+ if (x > maxX)
+ x = maxX;
+ if (y < 0)
+ y = 0;
+ if (y > maxY)
+ y = maxY;
+
+ /* Set desired window position in the DialogShell */
+ XtVaSetValues(shell, XmNx, x, XmNy, y, NULL);
+
+ /* Map the widget */
+ XtMapWidget(shell);
+
+ /* Restore the value of XmNmappedWhenManaged */
+ XtVaSetValues(shell, XmNmappedWhenManaged, mappedWhenManaged, 0);
+}
+
+#if defined(FEAT_MENU) || defined(FEAT_SUN_WORKSHOP) \
+ || defined(FEAT_GUI_DIALOG) || defined(PROTO)
+
+/*
+ * Encapsulate the way an XmFontList is created.
+ */
+ XmFontList
+gui_motif_create_fontlist(font)
+ XFontStruct *font;
+{
+ XmFontList font_list;
+
+# if (XmVersion <= 1001)
+ /* Motif 1.1 method */
+ font_list = XmFontListCreate(font, STRING_TAG);
+# else
+ /* Motif 1.2 method */
+ XmFontListEntry font_list_entry;
+
+ font_list_entry = XmFontListEntryCreate(STRING_TAG, XmFONT_IS_FONT,
+ (XtPointer)font);
+ font_list = XmFontListAppendEntry(NULL, font_list_entry);
+ XmFontListEntryFree(&font_list_entry);
+# endif
+ return font_list;
+}
+
+# if ((XmVersion > 1001) && defined(FEAT_XFONTSET)) || defined(PROTO)
+ XmFontList
+gui_motif_fontset2fontlist(fontset)
+ XFontSet *fontset;
+{
+ XmFontList font_list;
+
+ /* Motif 1.2 method */
+ XmFontListEntry font_list_entry;
+
+ font_list_entry = XmFontListEntryCreate(STRING_TAG,
+ XmFONT_IS_FONTSET,
+ (XtPointer)*fontset);
+ font_list = XmFontListAppendEntry(NULL, font_list_entry);
+ XmFontListEntryFree(&font_list_entry);
+ return font_list;
+}
+# endif
+
+#endif
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Menu stuff.
+ */
+
+static void gui_motif_add_actext __ARGS((vimmenu_T *menu));
+#if (XmVersion >= 1002)
+static void toggle_tearoff __ARGS((Widget wid));
+static void gui_mch_recurse_tearoffs __ARGS((vimmenu_T *menu));
+#endif
+static void gui_mch_submenu_change __ARGS((vimmenu_T *mp, int colors));
+
+static void do_set_mnemonics __ARGS((int enable));
+static int menu_enabled = TRUE;
+
+ void
+gui_mch_enable_menu(flag)
+ int flag;
+{
+ if (flag)
+ {
+ XtManageChild(menuBar);
+#ifdef FEAT_TOOLBAR
+ if (XtIsManaged(XtParent(toolBar)))
+ {
+ /* toolBar is attached to top form */
+ XtVaSetValues(XtParent(toolBar),
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, menuBar,
+ NULL);
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, XtParent(toolBar),
+ NULL);
+ }
+ else
+#endif
+ {
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, menuBar,
+ NULL);
+ }
+ }
+ else
+ {
+ XtUnmanageChild(menuBar);
+#ifdef FEAT_TOOLBAR
+ if (XtIsManaged(XtParent(toolBar)))
+ {
+ XtVaSetValues(XtParent(toolBar),
+ XmNtopAttachment, XmATTACH_FORM,
+ NULL);
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, XtParent(toolBar),
+ NULL);
+ }
+ else
+#endif
+ {
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_FORM,
+ NULL);
+ }
+ }
+
+}
+
+/*
+ * Enable or disable mnemonics for the toplevel menus.
+ */
+ void
+gui_motif_set_mnemonics(enable)
+ int enable;
+{
+ /*
+ * Don't enable menu mnemonics when the menu bar is disabled, LessTif
+ * crashes when using a mnemonic then.
+ */
+ if (!menu_enabled)
+ enable = FALSE;
+ do_set_mnemonics(enable);
+}
+
+ static void
+do_set_mnemonics(enable)
+ int enable;
+{
+ vimmenu_T *menu;
+
+ for (menu = root_menu; menu != NULL; menu = menu->next)
+ if (menu->id != (Widget)0)
+ XtVaSetValues(menu->id,
+ XmNmnemonic, enable ? menu->mnemonic : NUL,
+ NULL);
+}
+
+ void
+gui_mch_add_menu(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ XmString label;
+ Widget shell;
+ vimmenu_T *parent = menu->parent;
+
+#ifdef MOTIF_POPUP
+ if (menu_is_popup(menu->name))
+ {
+ Arg arg[2];
+ int n = 0;
+
+ /* Only create the popup menu when it's actually used, otherwise there
+ * is a delay when using the right mouse button. */
+# if (XmVersion <= 1002)
+ if (mouse_model_popup())
+# endif
+ {
+ if (gui.menu_bg_pixel != INVALCOLOR)
+ {
+ XtSetArg(arg[0], XmNbackground, gui.menu_bg_pixel); n++;
+ }
+ if (gui.menu_fg_pixel != INVALCOLOR)
+ {
+ XtSetArg(arg[1], XmNforeground, gui.menu_fg_pixel); n++;
+ }
+ menu->submenu_id = XmCreatePopupMenu(textArea, "contextMenu",
+ arg, n);
+ menu->id = (Widget)0;
+ }
+ return;
+ }
+#endif
+
+ if (!menu_is_menubar(menu->name)
+ || (parent != NULL && parent->submenu_id == (Widget)0))
+ return;
+
+ label = XmStringCreate((char *)menu->dname, STRING_TAG);
+ if (label == NULL)
+ return;
+ menu->id = XtVaCreateWidget("subMenu",
+ xmCascadeButtonWidgetClass,
+ (parent == NULL) ? menuBar : parent->submenu_id,
+ XmNlabelString, label,
+ XmNmnemonic, p_wak[0] == 'n' ? NUL : menu->mnemonic,
+#if (XmVersion >= 1002)
+ /* submenu: count the tearoff item (needed for LessTif) */
+ XmNpositionIndex, idx + (parent != NULL
+ && tearoff_val == (int)XmTEAR_OFF_ENABLED ? 1 : 0),
+#endif
+ NULL);
+ gui_motif_menu_colors(menu->id);
+ gui_motif_menu_fontlist(menu->id);
+ XmStringFree(label);
+
+ if (menu->id == (Widget)0) /* failed */
+ return;
+
+ /* add accelerator text */
+ gui_motif_add_actext(menu);
+
+ shell = XtVaCreateWidget("subMenuShell",
+ xmMenuShellWidgetClass, menu->id,
+ XmNwidth, 1,
+ XmNheight, 1,
+ NULL);
+ gui_motif_menu_colors(shell);
+ menu->submenu_id = XtVaCreateWidget("rowColumnMenu",
+ xmRowColumnWidgetClass, shell,
+ XmNrowColumnType, XmMENU_PULLDOWN,
+ NULL);
+ gui_motif_menu_colors(menu->submenu_id);
+
+ if (menu->submenu_id == (Widget)0) /* failed */
+ return;
+
+#if (XmVersion >= 1002)
+ /* Set the colors for the tear off widget */
+ toggle_tearoff(menu->submenu_id);
+#endif
+
+ XtVaSetValues(menu->id,
+ XmNsubMenuId, menu->submenu_id,
+ NULL);
+
+ /*
+ * The "Help" menu is a special case, and should be placed at the far
+ * right hand side of the menu-bar. It's recognized by its high priority.
+ */
+ if (parent == NULL && menu->priority >= 9999)
+ XtVaSetValues(menuBar,
+ XmNmenuHelpWidget, menu->id,
+ NULL);
+
+ /*
+ * When we add a top-level item to the menu bar, we can figure out how
+ * high the menu bar should be.
+ */
+ if (parent == NULL)
+ gui_mch_compute_menu_height(menu->id);
+}
+
+
+/*
+ * Add mnemonic and accelerator text to a menu button.
+ */
+ static void
+gui_motif_add_actext(menu)
+ vimmenu_T *menu;
+{
+ XmString label;
+
+ /* Add accelrator text, if there is one */
+ if (menu->actext != NULL && menu->id != (Widget)0)
+ {
+ label = XmStringCreate((char *)menu->actext, STRING_TAG);
+ if (label == NULL)
+ return;
+ XtVaSetValues(menu->id, XmNacceleratorText, label, NULL);
+ XmStringFree(label);
+ }
+}
+
+ void
+gui_mch_toggle_tearoffs(enable)
+ int enable;
+{
+#if (XmVersion >= 1002)
+ if (enable)
+ tearoff_val = (int)XmTEAR_OFF_ENABLED;
+ else
+ tearoff_val = (int)XmTEAR_OFF_DISABLED;
+ toggle_tearoff(menuBar);
+ gui_mch_recurse_tearoffs(root_menu);
+#endif
+}
+
+#if (XmVersion >= 1002)
+/*
+ * Set the tearoff for one menu widget on or off, and set the color of the
+ * tearoff widget.
+ */
+ static void
+toggle_tearoff(wid)
+ Widget wid;
+{
+ Widget w;
+
+ XtVaSetValues(wid, XmNtearOffModel, tearoff_val, NULL);
+ if (tearoff_val == (int)XmTEAR_OFF_ENABLED
+ && (w = XmGetTearOffControl(wid)) != (Widget)0)
+ gui_motif_menu_colors(w);
+}
+
+ static void
+gui_mch_recurse_tearoffs(menu)
+ vimmenu_T *menu;
+{
+ while (menu != NULL)
+ {
+ if (!menu_is_popup(menu->name))
+ {
+ if (menu->submenu_id != (Widget)0)
+ toggle_tearoff(menu->submenu_id);
+ gui_mch_recurse_tearoffs(menu->children);
+ }
+ menu = menu->next;
+ }
+}
+#endif
+
+ int
+gui_mch_text_area_extra_height()
+{
+ Dimension shadowHeight;
+
+ XtVaGetValues(textAreaForm, XmNshadowThickness, &shadowHeight, NULL);
+ return shadowHeight;
+}
+
+/*
+ * Compute the height of the menu bar.
+ * We need to check all the items for their position and height, for the case
+ * there are several rows, and/or some characters extend higher or lower.
+ */
+ void
+gui_mch_compute_menu_height(id)
+ Widget id; /* can be NULL when deleting menu */
+{
+ Dimension y, maxy;
+ Dimension margin, shadow;
+ vimmenu_T *mp;
+ static Dimension height = 21; /* normal height of a menu item */
+
+ /*
+ * Get the height of the new item, before managing it, because it will
+ * still reflect the font size. After managing it depends on the menu
+ * height, which is what we just wanted to get!.
+ */
+ if (id != (Widget)0)
+ XtVaGetValues(id, XmNheight, &height, NULL);
+
+ /* Find any menu Widget, to be able to call XtManageChild() */
+ else
+ for (mp = root_menu; mp != NULL; mp = mp->next)
+ if (mp->id != (Widget)0 && menu_is_menubar(mp->name))
+ {
+ id = mp->id;
+ break;
+ }
+
+ /*
+ * Now manage the menu item, to make them all be positioned (makes an
+ * extra row when needed, removes it when not needed).
+ */
+ if (id != (Widget)0)
+ XtManageChild(id);
+
+ /*
+ * Now find the menu item that is the furthest down, and get it's position.
+ */
+ maxy = 0;
+ for (mp = root_menu; mp != NULL; mp = mp->next)
+ {
+ if (mp->id != (Widget)0 && menu_is_menubar(mp->name))
+ {
+ XtVaGetValues(mp->id, XmNy, &y, NULL);
+ if (y > maxy)
+ maxy = y;
+ }
+ }
+
+ XtVaGetValues(menuBar,
+ XmNmarginHeight, &margin,
+ XmNshadowThickness, &shadow,
+ NULL);
+
+ /*
+ * This computation is the result of trial-and-error:
+ * maxy = The maximum position of an item; required for when there are
+ * two or more rows
+ * height = height of an item, before managing it; Hopefully this will
+ * change with the font height. Includes shadow-border.
+ * shadow = shadow-border; must be subtracted from the height.
+ * margin = margin around the menu buttons; Must be added.
+ * Add 4 for the underlining of shortcut keys.
+ */
+ gui.menu_height = maxy + height - 2 * shadow + 2 * margin + 4;
+
+#ifdef LESSTIF_VERSION
+ /* Somehow the menu bar doesn't resize automatically. Set it here,
+ * even though this is a catch 22. Don't do this when starting up,
+ * somehow the menu gets very high then. */
+ if (gui.shell_created)
+ XtVaSetValues(menuBar, XmNheight, gui.menu_height, NULL);
+#endif
+}
+
+ void
+gui_mch_add_menu_item(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ XmString label;
+ vimmenu_T *parent = menu->parent;
+
+# ifdef EBCDIC
+ menu->mnemonic = 0;
+# endif
+
+# if (XmVersion <= 1002)
+ /* Don't add Popup menu items when the popup menu isn't used. */
+ if (menu_is_child_of_popup(menu) && !mouse_model_popup())
+ return;
+# endif
+
+# ifdef FEAT_TOOLBAR
+ if (menu_is_toolbar(parent->name))
+ {
+ WidgetClass type;
+ XmString xms = NULL; /* fallback label if pixmap not found */
+ int n;
+ Arg args[18];
+
+ n = 0;
+ if (menu_is_separator(menu->name))
+ {
+ char *cp;
+ Dimension wid;
+
+ /*
+ * A separator has the format "-sep%d[:%d]-". The optional :%d is
+ * a width specifier. If no width is specified then we choose one.
+ */
+ cp = (char *)vim_strchr(menu->name, ':');
+ if (cp != NULL)
+ wid = (Dimension)atoi(++cp);
+ else
+ wid = 4;
+
+#if 0
+ /* We better use a FormWidget here, since it's far more
+ * flexible in terms of size. */
+ type = xmFormWidgetClass;
+ XtSetArg(args[n], XmNwidth, wid); n++;
+#else
+ type = xmSeparatorWidgetClass;
+ XtSetArg(args[n], XmNwidth, wid); n++;
+ XtSetArg(args[n], XmNminWidth, wid); n++;
+ XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
+ XtSetArg(args[n], XmNseparatorType, XmNO_LINE); n++;
+#endif
+ }
+ else
+ {
+ get_toolbar_pixmap(menu, &menu->image, &menu->image_ins);
+ /* Set the label here, so that we can switch between icons/text
+ * by changing the XmNlabelType resource. */
+ xms = XmStringCreate((char *)menu->dname, STRING_TAG);
+ XtSetArg(args[n], XmNlabelString, xms); n++;
+
+#ifndef FEAT_SUN_WORKSHOP
+
+ /* Without shadows one can't sense whatever the button has been
+ * pressed or not! However we wan't to save a bit of space...
+ */
+ XtSetArg(args[n], XmNhighlightThickness, 0); n++;
+ XtSetArg(args[n], XmNhighlightOnEnter, True); n++;
+ XtSetArg(args[n], XmNmarginWidth, 0); n++;
+ XtSetArg(args[n], XmNmarginHeight, 0); n++;
+#endif
+ if (menu->image == 0)
+ {
+ XtSetArg(args[n], XmNlabelType, XmSTRING); n++;
+ XtSetArg(args[n], XmNlabelPixmap, 0); n++;
+ XtSetArg(args[n], XmNlabelInsensitivePixmap, 0); n++;
+ }
+ else
+ {
+ XtSetArg(args[n], XmNlabelPixmap, menu->image); n++;
+ XtSetArg(args[n], XmNlabelInsensitivePixmap, menu->image_ins); n++;
+ XtSetArg(args[n], XmNlabelType, XmPIXMAP); n++;
+ }
+ type = xmPushButtonWidgetClass;
+ XtSetArg(args[n], XmNwidth, 80); n++;
+ }
+
+ XtSetArg(args[n], XmNpositionIndex, idx); n++;
+ if (menu->id == NULL)
+ {
+ menu->id = XtCreateManagedWidget((char *)menu->dname,
+ type, toolBar, args, n);
+ if (menu->id != NULL && type == xmPushButtonWidgetClass)
+ {
+ XtAddCallback(menu->id,
+ XmNactivateCallback, gui_x11_menu_cb, menu);
+
+# ifdef FEAT_FOOTER
+ XtAddEventHandler(menu->id, EnterWindowMask, False,
+ toolbarbutton_enter_cb, menu);
+ XtAddEventHandler(menu->id, LeaveWindowMask, False,
+ toolbarbutton_leave_cb, menu);
+# endif
+ }
+ }
+ else
+ XtSetValues(menu->id, args, n);
+ if (xms != NULL)
+ XmStringFree(xms);
+
+#ifdef FEAT_BEVAL
+ gui_mch_menu_set_tip(menu);
+#endif
+
+ menu->parent = parent;
+ menu->submenu_id = NULL;
+ /* When adding first item to toolbar it might have to be enabled .*/
+ if (!XtIsManaged(XtParent(toolBar))
+ && vim_strchr(p_go, GO_TOOLBAR) != NULL)
+ gui_mch_show_toolbar(TRUE);
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ return;
+ } /* toolbar menu item */
+# endif
+
+ /* No parent, must be a non-menubar menu */
+ if (parent->submenu_id == (Widget)0)
+ return;
+
+ menu->submenu_id = (Widget)0;
+
+ /* Add menu separator */
+ if (menu_is_separator(menu->name))
+ {
+ menu->id = XtVaCreateWidget("subMenu",
+ xmSeparatorGadgetClass, parent->submenu_id,
+#if (XmVersion >= 1002)
+ /* count the tearoff item (needed for LessTif) */
+ XmNpositionIndex, idx + (tearoff_val == (int)XmTEAR_OFF_ENABLED
+ ? 1 : 0),
+#endif
+ NULL);
+ gui_motif_menu_colors(menu->id);
+ return;
+ }
+
+ label = XmStringCreate((char *)menu->dname, STRING_TAG);
+ if (label == NULL)
+ return;
+ menu->id = XtVaCreateWidget("subMenu",
+ xmPushButtonWidgetClass, parent->submenu_id,
+ XmNlabelString, label,
+ XmNmnemonic, menu->mnemonic,
+#if (XmVersion >= 1002)
+ /* count the tearoff item (needed for LessTif) */
+ XmNpositionIndex, idx + (tearoff_val == (int)XmTEAR_OFF_ENABLED
+ ? 1 : 0),
+#endif
+ NULL);
+ gui_motif_menu_colors(menu->id);
+ gui_motif_menu_fontlist(menu->id);
+ XmStringFree(label);
+
+ if (menu->id != (Widget)0)
+ {
+ XtAddCallback(menu->id, XmNactivateCallback, gui_x11_menu_cb,
+ (XtPointer)menu);
+ /* add accelerator text */
+ gui_motif_add_actext(menu);
+ }
+}
+
+#if (XmVersion <= 1002) || defined(PROTO)
+/*
+ * This function will destroy/create the popup menus dynamically,
+ * according to the value of 'mousemodel'.
+ * This will fix the "right mouse button freeze" that occurs when
+ * there exists a popup menu but it isn't managed.
+ */
+ void
+gui_motif_update_mousemodel(menu)
+ vimmenu_T *menu;
+{
+ int idx = 0;
+
+ /* When GUI hasn't started the menus have not been created. */
+ if (!gui.in_use)
+ return;
+
+ while (menu)
+ {
+ if (menu->children != NULL)
+ {
+ if (menu_is_popup(menu->name))
+ {
+ if (mouse_model_popup())
+ {
+ /* Popup menu will be used. Create the popup menus. */
+ gui_mch_add_menu(menu, idx);
+ gui_motif_update_mousemodel(menu->children);
+ }
+ else
+ {
+ /* Popup menu will not be used. Destroy the popup menus. */
+ gui_motif_update_mousemodel(menu->children);
+ gui_mch_destroy_menu(menu);
+ }
+ }
+ }
+ else if (menu_is_child_of_popup(menu))
+ {
+ if (mouse_model_popup())
+ gui_mch_add_menu_item(menu, idx);
+ else
+ gui_mch_destroy_menu(menu);
+ }
+ menu = menu->next;
+ ++idx;
+ }
+}
+#endif
+
+ void
+gui_mch_new_menu_colors()
+{
+ if (menuBar == (Widget)0)
+ return;
+ gui_motif_menu_colors(menuBar);
+#ifdef FEAT_TOOLBAR
+ gui_motif_menu_colors(toolBarFrame);
+ gui_motif_menu_colors(toolBar);
+#endif
+
+ gui_mch_submenu_change(root_menu, TRUE);
+}
+
+ void
+gui_mch_new_menu_font()
+{
+ if (menuBar == (Widget)0)
+ return;
+ gui_mch_submenu_change(root_menu, FALSE);
+ {
+ Dimension height;
+ Position w, h;
+
+ XtVaGetValues(menuBar, XmNheight, &height, NULL);
+ gui.menu_height = height;
+
+ XtVaGetValues(vimShell, XtNwidth, &w, XtNheight, &h, NULL);
+ gui_resize_shell(w, h
+#ifdef FEAT_XIM
+ - xim_get_status_area_height()
+#endif
+ );
+ }
+ gui_set_shellsize(FALSE, TRUE);
+ ui_new_shellsize();
+}
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+ void
+gui_mch_new_tooltip_font()
+{
+# ifdef FEAT_TOOLBAR
+ vimmenu_T *menu;
+
+ if (toolBar == (Widget)0)
+ return;
+
+ menu = gui_find_menu((char_u *)"ToolBar");
+ if (menu != NULL)
+ gui_mch_submenu_change(menu, FALSE);
+# endif
+}
+
+ void
+gui_mch_new_tooltip_colors()
+{
+# ifdef FEAT_TOOLBAR
+ vimmenu_T *toolbar;
+
+ if (toolBar == (Widget)0)
+ return;
+
+ toolbar = gui_find_menu((char_u *)"ToolBar");
+ if (toolbar != NULL)
+ gui_mch_submenu_change(toolbar, TRUE);
+# endif
+}
+#endif
+
+ static void
+gui_mch_submenu_change(menu, colors)
+ vimmenu_T *menu;
+ int colors; /* TRUE for colors, FALSE for font */
+{
+ vimmenu_T *mp;
+
+ for (mp = menu; mp != NULL; mp = mp->next)
+ {
+ if (mp->id != (Widget)0)
+ {
+ if (colors)
+ {
+ gui_motif_menu_colors(mp->id);
+#ifdef FEAT_TOOLBAR
+ /* For a toolbar item: Free the pixmap and allocate a new one,
+ * so that the background color is right. */
+ if (mp->image != (Pixmap)0)
+ {
+ XFreePixmap(gui.dpy, mp->image);
+ XFreePixmap(gui.dpy, mp->image_ins);
+ get_toolbar_pixmap(mp, &mp->image, &mp->image_ins);
+ if (mp->image != (Pixmap)0)
+ XtVaSetValues(mp->id,
+ XmNlabelPixmap, mp->image,
+ XmNlabelInsensitivePixmap, mp->image_ins,
+ NULL);
+ }
+# ifdef FEAT_BEVAL
+ /* If we have a tooltip, then we need to change it's font */
+ if (mp->tip != NULL)
+ {
+ Arg args[2];
+
+ args[0].name = XmNbackground;
+ args[0].value = gui.tooltip_bg_pixel;
+ args[1].name = XmNforeground;
+ args[1].value = gui.tooltip_fg_pixel;
+ XtSetValues(mp->tip->balloonLabel, &args[0], XtNumber(args));
+ }
+# endif
+#endif
+ }
+ else
+ {
+ gui_motif_menu_fontlist(mp->id);
+#ifdef FEAT_BEVAL
+ /* If we have a tooltip, then we need to change it's font */
+ if (mp->tip != NULL)
+ {
+ Arg args[1];
+
+ args[0].name = XmNfontList;
+ args[0].value = (XtArgVal)gui_motif_fontset2fontlist(
+ &gui.tooltip_fontset);
+ XtSetValues(mp->tip->balloonLabel, &args[0], XtNumber(args));
+ }
+#endif
+ }
+ }
+
+ if (mp->children != NULL)
+ {
+#if (XmVersion >= 1002)
+ /* Set the colors/font for the tear off widget */
+ if (mp->submenu_id != (Widget)0)
+ {
+ if (colors)
+ gui_motif_menu_colors(mp->submenu_id);
+ else
+ gui_motif_menu_fontlist(mp->submenu_id);
+ toggle_tearoff(mp->submenu_id);
+ }
+#endif
+ /* Set the colors for the children */
+ gui_mch_submenu_change(mp->children, colors);
+ }
+ }
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(menu)
+ vimmenu_T *menu;
+{
+ /* Please be sure to destroy the parent widget first (i.e. menu->id).
+ * On the other hand, problems have been reported that the submenu must be
+ * deleted first...
+ *
+ * This code should be basically identical to that in the file gui_athena.c
+ * because they are both Xt based.
+ */
+ if (menu->submenu_id != (Widget)0)
+ {
+ XtDestroyWidget(menu->submenu_id);
+ menu->submenu_id = (Widget)0;
+ }
+
+ if (menu->id != (Widget)0)
+ {
+ Widget parent;
+
+ parent = XtParent(menu->id);
+#if defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL)
+ if ((parent == toolBar) && (menu->tip != NULL))
+ {
+ /* We try to destroy this before the actual menu, because there are
+ * callbacks, etc. that will be unregistered during the tooltip
+ * destruction.
+ *
+ * If you call "gui_mch_destroy_beval_area()" after destroying
+ * menu->id, then the tooltip's window will have already been
+ * deallocated by Xt, and unknown behaviour will ensue (probably
+ * a core dump).
+ */
+ gui_mch_destroy_beval_area(menu->tip);
+ menu->tip = NULL;
+ }
+#endif
+ XtDestroyWidget(menu->id);
+ menu->id = (Widget)0;
+ if (parent == menuBar)
+ gui_mch_compute_menu_height((Widget)0);
+#ifdef FEAT_TOOLBAR
+ else if (parent == toolBar)
+ {
+ Cardinal num_children;
+
+ /* When removing last toolbar item, don't display the toolbar. */
+ XtVaGetValues(toolBar, XmNnumChildren, &num_children, NULL);
+ if (num_children == 0)
+ gui_mch_show_toolbar(FALSE);
+ else
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ }
+#endif
+ }
+}
+
+/* ARGSUSED */
+ void
+gui_mch_show_popupmenu(menu)
+ vimmenu_T *menu;
+{
+#ifdef MOTIF_POPUP
+ XmMenuPosition(menu->submenu_id, gui_x11_get_last_mouse_event());
+ XtManageChild(menu->submenu_id);
+#endif
+}
+
+#endif /* FEAT_MENU */
+
+/*
+ * Set the menu and scrollbar colors to their default values.
+ */
+ void
+gui_mch_def_colors()
+{
+ if (gui.in_use)
+ {
+ /* Use the values saved when starting up. These should come from the
+ * window manager or a resources file. */
+ gui.menu_fg_pixel = gui.menu_def_fg_pixel;
+ gui.menu_bg_pixel = gui.menu_def_bg_pixel;
+ gui.scroll_fg_pixel = gui.scroll_def_fg_pixel;
+ gui.scroll_bg_pixel = gui.scroll_def_bg_pixel;
+#ifdef FEAT_BEVAL
+ gui.tooltip_fg_pixel =
+ gui_get_color((char_u *)gui.rsrc_tooltip_fg_name);
+ gui.tooltip_bg_pixel =
+ gui_get_color((char_u *)gui.rsrc_tooltip_bg_name);
+#endif
+ }
+}
+
+
+/*
+ * Scrollbar stuff.
+ */
+
+ void
+gui_mch_set_scrollbar_thumb(sb, val, size, max)
+ scrollbar_T *sb;
+ long val;
+ long size;
+ long max;
+{
+ if (sb->id != (Widget)0)
+ XtVaSetValues(sb->id,
+ XmNvalue, val,
+ XmNsliderSize, size,
+ XmNpageIncrement, (size > 2 ? size - 2 : 1),
+ XmNmaximum, max + 1, /* Motif has max one past the end */
+ NULL);
+}
+
+ void
+gui_mch_set_scrollbar_pos(sb, x, y, w, h)
+ scrollbar_T *sb;
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ if (sb->id != (Widget)0)
+ {
+ if (sb->type == SBAR_LEFT || sb->type == SBAR_RIGHT)
+ {
+ if (y == 0)
+ h -= gui.border_offset;
+ else
+ y -= gui.border_offset;
+ XtVaSetValues(sb->id,
+ XmNtopOffset, y,
+ XmNbottomOffset, -y - h,
+ XmNwidth, w,
+ NULL);
+ }
+ else
+ XtVaSetValues(sb->id,
+ XmNtopOffset, y,
+ XmNleftOffset, x,
+ XmNrightOffset, gui.which_scrollbars[SBAR_RIGHT]
+ ? gui.scrollbar_width : 0,
+ XmNheight, h,
+ NULL);
+ XtManageChild(sb->id);
+ }
+}
+
+ void
+gui_mch_enable_scrollbar(sb, flag)
+ scrollbar_T *sb;
+ int flag;
+{
+ Arg args[16];
+ int n;
+
+ if (sb->id != (Widget)0)
+ {
+ n = 0;
+ if (flag)
+ {
+ switch (sb->type)
+ {
+ case SBAR_LEFT:
+ XtSetArg(args[n], XmNleftOffset, gui.scrollbar_width); n++;
+ break;
+
+ case SBAR_RIGHT:
+ XtSetArg(args[n], XmNrightOffset, gui.scrollbar_width); n++;
+ break;
+
+ case SBAR_BOTTOM:
+ XtSetArg(args[n], XmNbottomOffset, gui.scrollbar_height);n++;
+ break;
+ }
+ XtSetValues(textArea, args, n);
+ XtManageChild(sb->id);
+ }
+ else
+ {
+ if (!gui.which_scrollbars[sb->type])
+ {
+ /* The scrollbars of this type are all disabled, adjust the
+ * textArea attachment offset. */
+ switch (sb->type)
+ {
+ case SBAR_LEFT:
+ XtSetArg(args[n], XmNleftOffset, 0); n++;
+ break;
+
+ case SBAR_RIGHT:
+ XtSetArg(args[n], XmNrightOffset, 0); n++;
+ break;
+
+ case SBAR_BOTTOM:
+ XtSetArg(args[n], XmNbottomOffset, 0);n++;
+ break;
+ }
+ XtSetValues(textArea, args, n);
+ }
+ XtUnmanageChild(sb->id);
+ }
+ }
+}
+
+ void
+gui_mch_create_scrollbar(sb, orient)
+ scrollbar_T *sb;
+ int orient; /* SBAR_VERT or SBAR_HORIZ */
+{
+ Arg args[16];
+ int n;
+
+ n = 0;
+ XtSetArg(args[n], XmNshadowThickness, 1); n++;
+ XtSetArg(args[n], XmNminimum, 0); n++;
+ XtSetArg(args[n], XmNorientation,
+ (orient == SBAR_VERT) ? XmVERTICAL : XmHORIZONTAL); n++;
+
+ switch (sb->type)
+ {
+ case SBAR_LEFT:
+ XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); n++;
+ XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
+ break;
+
+ case SBAR_RIGHT:
+ XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_OPPOSITE_FORM); n++;
+ XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
+ break;
+
+ case SBAR_BOTTOM:
+ XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
+ break;
+ }
+
+ sb->id = XtCreateWidget("scrollBar",
+ xmScrollBarWidgetClass, textAreaForm, args, n);
+
+ /* Remember the default colors, needed for ":hi clear". */
+ if (gui.scroll_def_bg_pixel == (guicolor_T)0
+ && gui.scroll_def_fg_pixel == (guicolor_T)0)
+ XtVaGetValues(sb->id,
+ XmNbackground, &gui.scroll_def_bg_pixel,
+ XmNforeground, &gui.scroll_def_fg_pixel,
+ NULL);
+
+ if (sb->id != (Widget)0)
+ {
+ gui_mch_set_scrollbar_colors(sb);
+ XtAddCallback(sb->id, XmNvalueChangedCallback,
+ scroll_cb, (XtPointer)sb->ident);
+ XtAddCallback(sb->id, XmNdragCallback,
+ scroll_cb, (XtPointer)sb->ident);
+ XtAddEventHandler(sb->id, KeyPressMask, FALSE, gui_x11_key_hit_cb,
+ (XtPointer)0);
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(sb)
+ scrollbar_T *sb;
+{
+ if (sb->id != (Widget)0)
+ XtDestroyWidget(sb->id);
+}
+#endif
+
+ void
+gui_mch_set_scrollbar_colors(sb)
+ scrollbar_T *sb;
+{
+ if (sb->id != (Widget)0)
+ {
+ if (gui.scroll_bg_pixel != INVALCOLOR)
+ {
+#if (XmVersion>=1002)
+ XmChangeColor(sb->id, gui.scroll_bg_pixel);
+#else
+ XtVaSetValues(sb->id,
+ XmNtroughColor, gui.scroll_bg_pixel,
+ NULL);
+#endif
+ }
+
+ if (gui.scroll_fg_pixel != INVALCOLOR)
+ XtVaSetValues(sb->id,
+ XmNforeground, gui.scroll_fg_pixel,
+#if (XmVersion<1002)
+ XmNbackground, gui.scroll_fg_pixel,
+#endif
+ NULL);
+ }
+
+ /* This is needed for the rectangle below the vertical scrollbars. */
+ if (sb == &gui.bottom_sbar && textAreaForm != (Widget)0)
+ gui_motif_scroll_colors(textAreaForm);
+}
+
+/*
+ * Miscellaneous stuff:
+ */
+
+ Window
+gui_x11_get_wid()
+{
+ return(XtWindow(textArea));
+}
+
+
+#if defined(FEAT_BROWSE) || defined(PROTO)
+
+/*
+ * file selector related stuff
+ */
+
+#include <Xm/FileSB.h>
+#include <Xm/XmStrDefs.h>
+
+typedef struct dialog_callback_arg
+{
+ char * args; /* not used right now */
+ int id;
+} dcbarg_T;
+
+static Widget dialog_wgt;
+static char *browse_fname = NULL;
+static XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET;
+ /* used to set up XmStrings */
+
+static void DialogCancelCB __ARGS((Widget, XtPointer, XtPointer));
+static void DialogAcceptCB __ARGS((Widget, XtPointer, XtPointer));
+
+/*
+ * This function is used to translate the predefined label text of the
+ * precomposed dialogs. We do this explicitly to allow:
+ *
+ * - usage of gettext for translation, as in all the other places.
+ *
+ * - equalize the messages between different GUI implementations as far as
+ * possible.
+ */
+static void set_predefined_label __ARGS((Widget parent, String name, char * new_label));
+
+static void
+set_predefined_label(parent, name, new_label)
+ Widget parent;
+ String name;
+ char * new_label;
+{
+ XmString str;
+ Widget w;
+
+ w = XtNameToWidget(parent, name);
+
+ if (!w)
+ return;
+
+ str = XmStringCreate(new_label, STRING_TAG);
+
+ if (str)
+ {
+ XtVaSetValues(w, XmNlabelString, str, NULL);
+ XmStringFree(str);
+ }
+}
+
+/*
+ * Put up a file requester.
+ * Returns the selected name in allocated memory, or NULL for Cancel.
+ */
+/* ARGSUSED */
+ char_u *
+gui_mch_browse(saving, title, dflt, ext, initdir, filter)
+ int saving; /* select file to write */
+ char_u *title; /* title for the window */
+ char_u *dflt; /* default name */
+ char_u *ext; /* not used (extension added) */
+ char_u *initdir; /* initial directory, NULL for current dir */
+ char_u *filter; /* file name filter */
+{
+ char_u dirbuf[MAXPATHL];
+ char_u dfltbuf[MAXPATHL];
+ char_u *pattern;
+ char_u *tofree = NULL;
+
+ dialog_wgt = XmCreateFileSelectionDialog(vimShell, (char *)title, NULL, 0);
+
+ if (initdir == NULL || *initdir == NUL)
+ {
+ mch_dirname(dirbuf, MAXPATHL);
+ initdir = dirbuf;
+ }
+
+ if (dflt == NULL)
+ dflt = (char_u *)"";
+ else if (STRLEN(initdir) + STRLEN(dflt) + 2 < MAXPATHL)
+ {
+ /* The default selection should be the full path, "dflt" is only the
+ * file name. */
+ STRCPY(dfltbuf, initdir);
+ add_pathsep(dfltbuf);
+ STRCAT(dfltbuf, dflt);
+ dflt = dfltbuf;
+ }
+
+ /* Can only use one pattern for a file name. Get the first pattern out of
+ * the filter. An empty pattern means everything matches. */
+ if (filter == NULL)
+ pattern = (char_u *)"";
+ else
+ {
+ char_u *s, *p;
+
+ s = filter;
+ for (p = filter; *p != NUL; ++p)
+ {
+ if (*p == '\t') /* end of description, start of pattern */
+ s = p + 1;
+ if (*p == ';' || *p == '\n') /* end of (first) pattern */
+ break;
+ }
+ pattern = vim_strnsave(s, p - s);
+ tofree = pattern;
+ if (pattern == NULL)
+ pattern = (char_u *)"";
+ }
+
+ XtVaSetValues(dialog_wgt,
+ XtVaTypedArg,
+ XmNdirectory, XmRString, (char *)initdir, STRLEN(initdir) + 1,
+ XtVaTypedArg,
+ XmNdirSpec, XmRString, (char *)dflt, STRLEN(dflt) + 1,
+ XtVaTypedArg,
+ XmNpattern, XmRString, (char *)pattern, STRLEN(pattern) + 1,
+ XtVaTypedArg,
+ XmNdialogTitle, XmRString, (char *)title, STRLEN(title) + 1,
+ NULL);
+
+ set_predefined_label(dialog_wgt, "Apply", _("Filter"));
+ set_predefined_label(dialog_wgt, "Cancel", _("Cancel"));
+ set_predefined_label(dialog_wgt, "Dir", _("Directories"));
+ set_predefined_label(dialog_wgt, "FilterLabel", _("Filter"));
+ set_predefined_label(dialog_wgt, "Help", _("Help"));
+ set_predefined_label(dialog_wgt, "Items", _("Files"));
+ set_predefined_label(dialog_wgt, "OK", _("OK"));
+ set_predefined_label(dialog_wgt, "Selection", _("Selection"));
+
+ gui_motif_menu_colors(dialog_wgt);
+ if (gui.scroll_bg_pixel != INVALCOLOR)
+ XtVaSetValues(dialog_wgt, XmNtroughColor, gui.scroll_bg_pixel, NULL);
+
+ XtAddCallback(dialog_wgt, XmNokCallback, DialogAcceptCB, (XtPointer)0);
+ XtAddCallback(dialog_wgt, XmNcancelCallback, DialogCancelCB, (XtPointer)0);
+ /* We have no help in this window, so hide help button */
+ XtUnmanageChild(XmFileSelectionBoxGetChild(dialog_wgt,
+ (unsigned char)XmDIALOG_HELP_BUTTON));
+
+ manage_centered(dialog_wgt);
+
+ /* sit in a loop until the dialog box has gone away */
+ do
+ {
+ XtAppProcessEvent(XtWidgetToApplicationContext(dialog_wgt),
+ (XtInputMask)XtIMAll);
+ } while (XtIsManaged(dialog_wgt));
+
+ XtDestroyWidget(dialog_wgt);
+ vim_free(tofree);
+
+ if (browse_fname == NULL)
+ return NULL;
+ return vim_strsave((char_u *)browse_fname);
+}
+
+/*
+ * The code below was originally taken from
+ * /usr/examples/motif/xmsamplers/xmeditor.c
+ * on Digital Unix 4.0d, but heavily modified.
+ */
+
+/*
+ * Process callback from Dialog cancel actions.
+ */
+/* ARGSUSED */
+ static void
+DialogCancelCB(w, client_data, call_data)
+ Widget w; /* widget id */
+ XtPointer client_data; /* data from application */
+ XtPointer call_data; /* data from widget class */
+{
+ if (browse_fname != NULL)
+ {
+ XtFree(browse_fname);
+ browse_fname = NULL;
+ }
+ XtUnmanageChild(dialog_wgt);
+}
+
+/*
+ * Process callback from Dialog actions.
+ */
+/* ARGSUSED */
+ static void
+DialogAcceptCB(w, client_data, call_data)
+ Widget w; /* widget id */
+ XtPointer client_data; /* data from application */
+ XtPointer call_data; /* data from widget class */
+{
+ XmFileSelectionBoxCallbackStruct *fcb;
+
+ if (browse_fname != NULL)
+ {
+ XtFree(browse_fname);
+ browse_fname = NULL;
+ }
+ fcb = (XmFileSelectionBoxCallbackStruct *)call_data;
+
+ /* get the filename from the file selection box */
+ XmStringGetLtoR(fcb->value, charset, &browse_fname);
+
+ /* popdown the file selection box */
+ XtUnmanageChild(dialog_wgt);
+}
+
+#endif /* FEAT_BROWSE */
+
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+
+static int dialogStatus;
+
+static void keyhit_callback __ARGS((Widget w, XtPointer client_data, XEvent *event, Boolean *cont));
+static void butproc __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+
+/*
+ * Callback function for the textfield. When CR is hit this works like
+ * hitting the "OK" button, ESC like "Cancel".
+ */
+/* ARGSUSED */
+ static void
+keyhit_callback(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ char buf[2];
+ KeySym key_sym;
+
+ if (XLookupString(&(event->xkey), buf, 2, &key_sym, NULL) == 1)
+ {
+ if (*buf == CAR)
+ dialogStatus = 1;
+ else if (*buf == ESC)
+ dialogStatus = 2;
+ }
+ if ((key_sym == XK_Left || key_sym == XK_Right)
+ && !(event->xkey.state & ShiftMask))
+ XmTextFieldClearSelection(w, XtLastTimestampProcessed(gui.dpy));
+}
+
+/* ARGSUSED */
+ static void
+butproc(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ dialogStatus = (int)(long)client_data + 1;
+}
+
+static void gui_motif_set_fontlist __ARGS((Widget wg));
+
+/*
+ * Use the 'guifont' or 'guifontset' as a fontlist for a dialog widget.
+ */
+ static void
+gui_motif_set_fontlist(wg)
+ Widget wg;
+{
+ XmFontList fl;
+
+ fl =
+#ifdef FEAT_XFONTSET
+ gui.fontset != NOFONTSET ?
+ gui_motif_fontset2fontlist((XFontSet *)&gui.fontset)
+ :
+#endif
+ gui_motif_create_fontlist((XFontStruct *)gui.norm_font);
+ if (fl != NULL)
+ {
+ XtVaSetValues(wg, XmNfontList, fl, NULL);
+ XmFontListFree(fl);
+ }
+}
+
+#ifdef HAVE_XPM
+
+static Widget create_pixmap_label(Widget parent, String name, char **data, ArgList args, Cardinal arg);
+
+ static Widget
+create_pixmap_label(parent, name, data, args, arg)
+ Widget parent;
+ String name;
+ char **data;
+ ArgList args;
+ Cardinal arg;
+{
+ Widget label;
+ Display *dsp;
+ Screen *scr;
+ int depth;
+ Pixmap pixmap = 0;
+ XpmAttributes attr;
+ Boolean rs;
+ XpmColorSymbol color[5] =
+ {
+ {"none", NULL, 0},
+ {"iconColor1", NULL, 0},
+ {"bottomShadowColor", NULL, 0},
+ {"topShadowColor", NULL, 0},
+ {"selectColor", NULL, 0}
+ };
+
+ label = XmCreateLabelGadget(parent, name, args, arg);
+
+ /*
+ * We need to be carefull here, since in case of gadgets, there is
+ * no way to get the background color directly from the widget itself.
+ * In such cases we get it from The Core part of his parent instead.
+ */
+ dsp = XtDisplayOfObject(label);
+ scr = XtScreenOfObject(label);
+ XtVaGetValues(XtIsSubclass(label, coreWidgetClass)
+ ? label : XtParent(label),
+ XmNdepth, &depth,
+ XmNbackground, &color[0].pixel,
+ XmNforeground, &color[1].pixel,
+ XmNbottomShadowColor, &color[2].pixel,
+ XmNtopShadowColor, &color[3].pixel,
+ XmNhighlight, &color[4].pixel,
+ NULL);
+
+ attr.valuemask = XpmColorSymbols | XpmCloseness | XpmDepth;
+ attr.colorsymbols = color;
+ attr.numsymbols = 5;
+ attr.closeness = 65535;
+ attr.depth = depth;
+ XpmCreatePixmapFromData(dsp, RootWindowOfScreen(scr),
+ data, &pixmap, NULL, &attr);
+
+ XtVaGetValues(label, XmNrecomputeSize, &rs, NULL);
+ XtVaSetValues(label, XmNrecomputeSize, True, NULL);
+ XtVaSetValues(label,
+ XmNlabelType, XmPIXMAP,
+ XmNlabelPixmap, pixmap,
+ NULL);
+ XtVaSetValues(label, XmNrecomputeSize, rs, NULL);
+
+ return label;
+}
+#endif
+
+/* ARGSUSED */
+ int
+gui_mch_dialog(type, title, message, button_names, dfltbutton, textfield)
+ int type;
+ char_u *title;
+ char_u *message;
+ char_u *button_names;
+ int dfltbutton;
+ char_u *textfield; /* buffer of size IOSIZE */
+{
+ char_u *buts;
+ char_u *p, *next;
+ XtAppContext app;
+ XmString label;
+ int butcount;
+ Widget dialogform = NULL;
+ Widget form = NULL;
+ Widget dialogtextfield = NULL;
+ Widget *buttons;
+ Widget sep_form = NULL;
+ Boolean vertical;
+ Widget separator = NULL;
+ int n;
+ Arg args[6];
+#ifdef HAVE_XPM
+ char **icon_data = NULL;
+ Widget dialogpixmap = NULL;
+#endif
+
+ if (title == NULL)
+ title = (char_u *)_("Vim dialog");
+
+ /* if our pointer is currently hidden, then we should show it. */
+ gui_mch_mousehide(FALSE);
+
+ dialogform = XmCreateFormDialog(vimShell, (char *)"dialog", NULL, 0);
+
+ /* Check 'v' flag in 'guioptions': vertical button placement. */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+
+ /* Set the title of the Dialog window */
+ label = XmStringCreateSimple((char *)title);
+ if (label == NULL)
+ return -1;
+ XtVaSetValues(dialogform,
+ XmNdialogTitle, label,
+ XmNhorizontalSpacing, 4,
+ XmNverticalSpacing, vertical ? 0 : 4,
+ NULL);
+ XmStringFree(label);
+
+ /* make a copy, so that we can insert NULs */
+ buts = vim_strsave(button_names);
+ if (buts == NULL)
+ return -1;
+
+ /* Count the number of buttons and allocate buttons[]. */
+ butcount = 1;
+ for (p = buts; *p; ++p)
+ if (*p == DLG_BUTTON_SEP)
+ ++butcount;
+ buttons = (Widget *)alloc((unsigned)(butcount * sizeof(Widget)));
+ if (buttons == NULL)
+ {
+ vim_free(buts);
+ return -1;
+ }
+
+ /*
+ * Create the buttons.
+ */
+ sep_form = (Widget) 0;
+ p = buts;
+ for (butcount = 0; *p; ++butcount)
+ {
+ for (next = p; *next; ++next)
+ {
+ if (*next == DLG_HOTKEY_CHAR)
+ mch_memmove(next, next + 1, STRLEN(next));
+ if (*next == DLG_BUTTON_SEP)
+ {
+ *next++ = NUL;
+ break;
+ }
+ }
+ label = XmStringCreate(_((char *)p), STRING_TAG);
+ if (label == NULL)
+ break;
+
+ buttons[butcount] = XtVaCreateManagedWidget("button",
+ xmPushButtonWidgetClass, dialogform,
+ XmNlabelString, label,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ XmNshowAsDefault, butcount == dfltbutton - 1,
+ XmNdefaultButtonShadowThickness, 1,
+ NULL);
+ XmStringFree(label);
+
+ /* Layout properly. */
+
+ if (butcount > 0)
+ {
+ if (vertical)
+ XtVaSetValues(buttons[butcount],
+ XmNtopWidget, buttons[butcount - 1],
+ NULL);
+ else
+ {
+ if (*next == NUL)
+ {
+ XtVaSetValues(buttons[butcount],
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNrightOffset, 4,
+ NULL);
+
+ /* fill in a form as invisible separator */
+ sep_form = XtVaCreateWidget("separatorForm",
+ xmFormWidgetClass, dialogform,
+ XmNleftAttachment, XmATTACH_WIDGET,
+ XmNleftWidget, buttons[butcount - 1],
+ XmNrightAttachment, XmATTACH_WIDGET,
+ XmNrightWidget, buttons[butcount],
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ NULL);
+ XtManageChild(sep_form);
+ }
+ else
+ {
+ XtVaSetValues(buttons[butcount],
+ XmNleftAttachment, XmATTACH_WIDGET,
+ XmNleftWidget, buttons[butcount - 1],
+ NULL);
+ }
+ }
+ }
+ else if (!vertical)
+ {
+ if (*next == NUL)
+ {
+ XtVaSetValues(buttons[0],
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNrightOffset, 4,
+ NULL);
+
+ /* fill in a form as invisible separator */
+ sep_form = XtVaCreateWidget("separatorForm",
+ xmFormWidgetClass, dialogform,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ XmNrightAttachment, XmATTACH_WIDGET,
+ XmNrightWidget, buttons[0],
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ NULL);
+ XtManageChild(sep_form);
+ }
+ else
+ XtVaSetValues(buttons[0],
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ NULL);
+ }
+
+ XtAddCallback(buttons[butcount], XmNactivateCallback,
+ (XtCallbackProc)butproc, (XtPointer)(long)butcount);
+ p = next;
+ }
+ vim_free(buts);
+
+ separator = (Widget) 0;
+ if (butcount > 0)
+ {
+ /* Create the separator for beauty. */
+ n = 0;
+ XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++;
+ XtSetArg(args[n], XmNbottomWidget, buttons[0]); n++;
+ XtSetArg(args[n], XmNbottomOffset, 4); n++;
+ XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
+ separator = XmCreateSeparatorGadget(dialogform, "separator", args, n);
+ XtManageChild(separator);
+ }
+
+ if (textfield != NULL)
+ {
+ dialogtextfield = XtVaCreateWidget("textField",
+ xmTextFieldWidgetClass, dialogform,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ if (butcount > 0)
+ XtVaSetValues(dialogtextfield,
+ XmNbottomAttachment, XmATTACH_WIDGET,
+ XmNbottomWidget, separator,
+ NULL);
+ else
+ XtVaSetValues(dialogtextfield,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+
+ gui_motif_set_fontlist(dialogtextfield);
+ XmTextFieldSetString(dialogtextfield, (char *)textfield);
+ XtManageChild(dialogtextfield);
+ XtAddEventHandler(dialogtextfield, KeyPressMask, False,
+ (XtEventHandler)keyhit_callback, (XtPointer)NULL);
+ }
+
+ /* Form holding both message and pixmap labels */
+ form = XtVaCreateWidget("separatorForm",
+ xmFormWidgetClass, dialogform,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNtopAttachment, XmATTACH_FORM,
+ NULL);
+ XtManageChild(form);
+
+#ifdef HAVE_XPM
+ /* Add a pixmap, left of the message. */
+ switch (type)
+ {
+ case VIM_GENERIC:
+ icon_data = generic_xpm;
+ break;
+ case VIM_ERROR:
+ icon_data = error_xpm;
+ break;
+ case VIM_WARNING:
+ icon_data = alert_xpm;
+ break;
+ case VIM_INFO:
+ icon_data = info_xpm;
+ break;
+ case VIM_QUESTION:
+ icon_data = quest_xpm;
+ break;
+ default:
+ icon_data = generic_xpm;
+ }
+
+ n = 0;
+ XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNtopOffset, 8); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNbottomOffset, 8); n++;
+ XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNleftOffset, 8); n++;
+
+ dialogpixmap = create_pixmap_label(form, "dialogPixmap",
+ icon_data, args, n);
+ XtManageChild(dialogpixmap);
+#endif
+
+ /* Create the dialog message. */
+ label = XmStringLtoRCreate((char *)message, STRING_TAG);
+ if (label == NULL)
+ return -1;
+ (void)XtVaCreateManagedWidget("dialogMessage",
+ xmLabelGadgetClass, form,
+ XmNlabelString, label,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNtopOffset, 8,
+#ifdef HAVE_XPM
+ XmNleftAttachment, XmATTACH_WIDGET,
+ XmNleftWidget, dialogpixmap,
+#else
+ XmNleftAttachment, XmATTACH_FORM,
+#endif
+ XmNleftOffset, 8,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNrightOffset, 8,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 8,
+ NULL);
+ XmStringFree(label);
+
+ if (textfield != NULL)
+ {
+ XtVaSetValues(form,
+ XmNbottomAttachment, XmATTACH_WIDGET,
+ XmNbottomWidget, dialogtextfield,
+ NULL);
+ }
+ else
+ {
+ if (butcount > 0)
+ XtVaSetValues(form,
+ XmNbottomAttachment, XmATTACH_WIDGET,
+ XmNbottomWidget, separator,
+ NULL);
+ else
+ XtVaSetValues(form,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+ }
+
+ if (dfltbutton < 1)
+ dfltbutton = 1;
+ if (dfltbutton > butcount)
+ dfltbutton = butcount;
+ XtVaSetValues(dialogform,
+ XmNdefaultButton, buttons[dfltbutton - 1], NULL);
+ if (textfield != NULL)
+ XtVaSetValues(dialogform, XmNinitialFocus, dialogtextfield, NULL);
+ else
+ XtVaSetValues(dialogform, XmNinitialFocus, buttons[dfltbutton - 1],
+ NULL);
+
+ manage_centered(dialogform);
+
+ if (textfield != NULL && *textfield != NUL)
+ {
+ /* This only works after the textfield has been realised. */
+ XmTextFieldSetSelection(dialogtextfield,
+ (XmTextPosition)0, (XmTextPosition)STRLEN(textfield),
+ XtLastTimestampProcessed(gui.dpy));
+ XmTextFieldSetCursorPosition(dialogtextfield,
+ (XmTextPosition)STRLEN(textfield));
+ }
+
+ app = XtWidgetToApplicationContext(dialogform);
+
+ /* Loop until a button is pressed or the dialog is killed somehow. */
+ dialogStatus = -1;
+ for (;;)
+ {
+ XtAppProcessEvent(app, (XtInputMask)XtIMAll);
+ if (dialogStatus >= 0 || !XtIsManaged(dialogform))
+ break;
+ }
+
+ vim_free(buttons);
+
+ if (textfield != NULL)
+ {
+ p = (char_u *)XmTextGetString(dialogtextfield);
+ if (p == NULL || dialogStatus < 0)
+ *textfield = NUL;
+ else
+ {
+ STRNCPY(textfield, p, IOSIZE);
+ textfield[IOSIZE - 1] = NUL;
+ }
+ }
+
+ XtDestroyWidget(dialogform);
+
+ return dialogStatus;
+}
+#endif /* FEAT_GUI_DIALOG */
+
+#if defined(FEAT_FOOTER) || defined(PROTO)
+
+ static int
+gui_mch_compute_footer_height()
+{
+ Dimension height; /* total Toolbar height */
+ Dimension top; /* XmNmarginTop */
+ Dimension bottom; /* XmNmarginBottom */
+ Dimension shadow; /* XmNshadowThickness */
+
+ XtVaGetValues(footer,
+ XmNheight, &height,
+ XmNmarginTop, &top,
+ XmNmarginBottom, &bottom,
+ XmNshadowThickness, &shadow,
+ NULL);
+
+ return (int) height + top + bottom + (shadow << 1);
+}
+
+#if 0 /* not used */
+ void
+gui_mch_set_footer_pos(h)
+ int h; /* textArea height */
+{
+ XtVaSetValues(footer,
+ XmNtopOffset, h + 7,
+ NULL);
+}
+#endif
+
+ void
+gui_mch_enable_footer(showit)
+ int showit;
+{
+ if (showit)
+ {
+ gui.footer_height = gui_mch_compute_footer_height();
+ XtManageChild(footer);
+ }
+ else
+ {
+ gui.footer_height = 0;
+ XtUnmanageChild(footer);
+ }
+ XtVaSetValues(textAreaForm, XmNbottomOffset, gui.footer_height, NULL);
+}
+
+ void
+gui_mch_set_footer(s)
+ char_u *s;
+{
+ XmString xms;
+
+ xms = XmStringCreate((char *)s, STRING_TAG);
+ XtVaSetValues(footer, XmNlabelString, xms, NULL);
+ XmStringFree(xms);
+}
+
+#endif
+
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_show_toolbar(int showit)
+{
+ Cardinal numChildren; /* how many children toolBar has */
+
+ if (toolBar == (Widget)0)
+ return;
+ XtVaGetValues(toolBar, XmNnumChildren, &numChildren, NULL);
+ if (showit && numChildren > 0)
+ {
+ /* Assume that we want to show the toolbar if p_toolbar contains
+ * valid option settings, therefore p_toolbar must not be NULL.
+ */
+ WidgetList children;
+
+ XtVaGetValues(toolBar, XmNchildren, &children, NULL);
+ {
+ void (*action)(BalloonEval *);
+ int text = 0;
+
+ if (strstr((const char *)p_toolbar, "tooltips"))
+ action = &gui_mch_enable_beval_area;
+ else
+ action = &gui_mch_disable_beval_area;
+ if (strstr((const char *)p_toolbar, "text"))
+ text = 1;
+ else if (strstr((const char *)p_toolbar, "icons"))
+ text = -1;
+ if (text != 0)
+ {
+ vimmenu_T *toolbar;
+ vimmenu_T *cur;
+
+ for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
+ if (menu_is_toolbar(toolbar->dname))
+ break;
+ /* Assumption: toolbar is NULL if there is no toolbar,
+ * otherwise it contains the toolbar menu structure.
+ *
+ * Assumption: "numChildren" == the number of items in the list
+ * of items beginning with toolbar->children.
+ */
+ if (toolbar)
+ {
+ for (cur = toolbar->children; cur; cur = cur->next)
+ {
+ Arg args[1];
+ int n = 0;
+
+ /* Enable/Disable tooltip (OK to enable while
+ * currently enabled)
+ */
+ if (cur->tip != NULL)
+ (*action)(cur->tip);
+ if (!menu_is_separator(cur->name))
+ {
+ if (text == 1 || cur->image == 0)
+ XtSetArg(args[n], XmNlabelType, XmSTRING);
+ else
+ XtSetArg(args[n], XmNlabelType, XmPIXMAP);
+ n++;
+ if (cur->id != NULL)
+ {
+ XtUnmanageChild(cur->id);
+ XtSetValues(cur->id, args, n);
+ XtManageChild(cur->id);
+ }
+ }
+ }
+ }
+ }
+ }
+ gui.toolbar_height = gui_mch_compute_toolbar_height();
+ XtManageChild(XtParent(toolBar));
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, XtParent(toolBar),
+ NULL);
+ if (XtIsManaged(menuBar))
+ XtVaSetValues(XtParent(toolBar),
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, menuBar,
+ NULL);
+ else
+ XtVaSetValues(XtParent(toolBar),
+ XmNtopAttachment, XmATTACH_FORM,
+ NULL);
+ }
+ else
+ {
+ gui.toolbar_height = 0;
+ if (XtIsManaged(menuBar))
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, menuBar,
+ NULL);
+ else
+ XtVaSetValues(textAreaForm,
+ XmNtopAttachment, XmATTACH_FORM,
+ NULL);
+
+ XtUnmanageChild(XtParent(toolBar));
+ }
+ gui_set_shellsize(FALSE, FALSE);
+}
+
+/*
+ * A toolbar button has been pushed; now reset the input focus
+ * such that the user can type page up/down etc. and have the
+ * input go to the editor window, not the button
+ */
+ static void
+gui_mch_reset_focus()
+{
+ if (textArea != NULL)
+ XmProcessTraversal(textArea, XmTRAVERSE_CURRENT);
+}
+
+ int
+gui_mch_compute_toolbar_height()
+{
+ Dimension height; /* total Toolbar height */
+ Dimension whgt; /* height of each widget */
+ Dimension marginHeight; /* XmNmarginHeight of toolBar */
+ Dimension shadowThickness; /* thickness of Xtparent(toolBar) */
+ WidgetList children; /* list of toolBar's children */
+ Cardinal numChildren; /* how many children toolBar has */
+ int i;
+
+ height = 0;
+ shadowThickness = 0;
+ marginHeight = 0;
+ if (toolBar != (Widget)0 && toolBarFrame != (Widget)0)
+ { /* get height of XmFrame parent */
+ XtVaGetValues(toolBarFrame,
+ XmNshadowThickness, &shadowThickness,
+ NULL);
+ XtVaGetValues(toolBar,
+ XmNmarginHeight, &marginHeight,
+ XmNchildren, &children,
+ XmNnumChildren, &numChildren, NULL);
+ for (i = 0; i < numChildren; i++)
+ {
+ whgt = 0;
+ XtVaGetValues(children[i], XmNheight, &whgt, NULL);
+ if (height < whgt)
+ height = whgt;
+ }
+ }
+
+ return (int)(height + (marginHeight << 1) + (shadowThickness << 1));
+}
+
+#if 0 /* these are never called. */
+/*
+ * The next toolbar enter/leave callbacks make sure the text area gets the
+ * keyboard focus when the pointer is not in the toolbar.
+ */
+/*ARGSUSED*/
+ static void
+toolbar_enter_cb(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ XmProcessTraversal(toolBar, XmTRAVERSE_CURRENT);
+}
+
+/*ARGSUSED*/
+ static void
+toolbar_leave_cb(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ XmProcessTraversal(textArea, XmTRAVERSE_CURRENT);
+}
+#endif
+
+# ifdef FEAT_FOOTER
+/*
+ * The next toolbar enter/leave callbacks should really do balloon help. But
+ * I have to use footer help for backwards compatability. Hopefully both will
+ * get implemented and the user will have a choice.
+ */
+/*ARGSUSED*/
+ static void
+toolbarbutton_enter_cb(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ vimmenu_T *menu = (vimmenu_T *) client_data;
+
+ if (menu->strings[MENU_INDEX_TIP] != NULL)
+ {
+ if (vim_strchr(p_go, GO_FOOTER) != NULL)
+ gui_mch_set_footer(menu->strings[MENU_INDEX_TIP]);
+ }
+}
+
+/*ARGSUSED*/
+ static void
+toolbarbutton_leave_cb(w, client_data, event, cont)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *cont;
+{
+ gui_mch_set_footer((char_u *) "");
+}
+# endif
+
+ void
+gui_mch_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp)
+ Pixel *bgp;
+ Pixel *fgp;
+ Pixel *bsp;
+ Pixel *tsp;
+ Pixel *hsp;
+{
+ XtVaGetValues(toolBar,
+ XmNbackground, bgp,
+ XmNforeground, fgp,
+ XmNbottomShadowColor, bsp,
+ XmNtopShadowColor, tsp,
+ XmNhighlightColor, hsp,
+ NULL);
+}
+#endif
+
+/*
+ * Set the colors of Widget "id" to the menu colors.
+ */
+ static void
+gui_motif_menu_colors(id)
+ Widget id;
+{
+ if (gui.menu_bg_pixel != INVALCOLOR)
+#if (XmVersion >= 1002)
+ XmChangeColor(id, gui.menu_bg_pixel);
+#else
+ XtVaSetValues(id, XmNbackground, gui.menu_bg_pixel, NULL);
+#endif
+ if (gui.menu_fg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XmNforeground, gui.menu_fg_pixel, NULL);
+}
+
+/*
+ * Set the colors of Widget "id" to the scrollbar colors.
+ */
+ static void
+gui_motif_scroll_colors(id)
+ Widget id;
+{
+ if (gui.scroll_bg_pixel != INVALCOLOR)
+#if (XmVersion >= 1002)
+ XmChangeColor(id, gui.scroll_bg_pixel);
+#else
+ XtVaSetValues(id, XmNbackground, gui.scroll_bg_pixel, NULL);
+#endif
+ if (gui.scroll_fg_pixel != INVALCOLOR)
+ XtVaSetValues(id, XmNforeground, gui.scroll_fg_pixel, NULL);
+}
+
+#ifdef FEAT_MENU
+/*
+ * Set the fontlist for Widget "id" to use gui.menu_fontset or gui.menu_font.
+ */
+ static void
+gui_motif_menu_fontlist(id)
+ Widget id;
+{
+#ifdef FONTSET_ALWAYS
+ if (gui.menu_fontset != NOFONTSET)
+ {
+ XmFontList fl;
+
+ fl = gui_motif_fontset2fontlist((XFontSet *)&gui.menu_fontset);
+ if (fl != NULL)
+ {
+ if (XtIsManaged(id))
+ {
+ XtUnmanageChild(id);
+ XtVaSetValues(id, XmNfontList, fl, NULL);
+ /* We should force the widget to recalculate it's
+ * geometry now. */
+ XtManageChild(id);
+ }
+ else
+ XtVaSetValues(id, XmNfontList, fl, NULL);
+ XmFontListFree(fl);
+ }
+ }
+#else
+ if (gui.menu_font != NOFONT)
+ {
+ XmFontList fl;
+
+ fl = gui_motif_create_fontlist((XFontStruct *)gui.menu_font);
+ if (fl != NULL)
+ {
+ if (XtIsManaged(id))
+ {
+ XtUnmanageChild(id);
+ XtVaSetValues(id, XmNfontList, fl, NULL);
+ /* We should force the widget to recalculate it's
+ * geometry now. */
+ XtManageChild(id);
+ }
+ else
+ XtVaSetValues(id, XmNfontList, fl, NULL);
+ XmFontListFree(fl);
+ }
+ }
+#endif
+}
+
+#endif
+
+/*
+ * We don't create it twice for the sake of speed.
+ */
+
+typedef struct _SharedFindReplace
+{
+ Widget dialog; /* the main dialog widget */
+ Widget wword; /* 'Exact match' check button */
+ Widget mcase; /* 'match case' check button */
+ Widget up; /* search direction 'Up' radio button */
+ Widget down; /* search direction 'Down' radio button */
+ Widget what; /* 'Find what' entry text widget */
+ Widget with; /* 'Replace with' entry text widget */
+ Widget find; /* 'Find Next' action button */
+ Widget replace; /* 'Replace With' action button */
+ Widget all; /* 'Replace All' action button */
+ Widget undo; /* 'Undo' action button */
+
+ Widget cancel;
+} SharedFindReplace;
+
+static SharedFindReplace find_widgets = { NULL };
+static SharedFindReplace repl_widgets = { NULL };
+
+static void find_replace_destroy_callback __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+static void find_replace_dismiss_callback __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+static void entry_activate_callback __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+static void find_replace_callback __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+static void find_replace_keypress __ARGS((Widget w, SharedFindReplace * frdp, XKeyEvent * event));
+static void find_replace_dialog_create __ARGS((char_u *entry_text, int do_replace));
+
+/*ARGSUSED*/
+ static void
+find_replace_destroy_callback(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ SharedFindReplace *cd = (SharedFindReplace *)client_data;
+
+ if (cd != NULL)
+ cd->dialog = (Widget)0;
+}
+
+/*ARGSUSED*/
+ static void
+find_replace_dismiss_callback(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ SharedFindReplace *cd = (SharedFindReplace *)client_data;
+
+ if (cd != NULL)
+ XtUnmanageChild(cd->dialog);
+}
+
+/*ARGSUSED*/
+ static void
+entry_activate_callback(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ XmProcessTraversal((Widget)client_data, XmTRAVERSE_CURRENT);
+}
+
+/*ARGSUSED*/
+ static void
+find_replace_callback(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ long_u flags = (long_u)client_data;
+ char *find_text, *repl_text;
+ Boolean direction_down = TRUE;
+ Boolean wword;
+ Boolean mcase;
+ SharedFindReplace *sfr;
+
+ if (flags == FRD_UNDO)
+ {
+ char_u *save_cpo = p_cpo;
+
+ /* No need to be Vi compatible here. */
+ p_cpo = (char_u *)"";
+ u_undo(1);
+ p_cpo = save_cpo;
+ gui_update_screen();
+ return;
+ }
+
+ /* Get the search/replace strings from the dialog */
+ if (flags == FRD_FINDNEXT)
+ {
+ repl_text = NULL;
+ sfr = &find_widgets;
+ }
+ else
+ {
+ repl_text = XmTextFieldGetString(repl_widgets.with);
+ sfr = &repl_widgets;
+ }
+ find_text = XmTextFieldGetString(sfr->what);
+ XtVaGetValues(sfr->down, XmNset, &direction_down, NULL);
+ XtVaGetValues(sfr->wword, XmNset, &wword, NULL);
+ XtVaGetValues(sfr->mcase, XmNset, &mcase, NULL);
+ if (wword)
+ flags |= FRD_WHOLE_WORD;
+ if (mcase)
+ flags |= FRD_MATCH_CASE;
+
+ (void)gui_do_findrepl((int)flags, (char_u *)find_text, (char_u *)repl_text,
+ direction_down);
+
+ if (find_text != NULL)
+ XtFree(find_text);
+ if (repl_text != NULL)
+ XtFree(repl_text);
+}
+
+/*ARGSUSED*/
+ static void
+find_replace_keypress(w, frdp, event)
+ Widget w;
+ SharedFindReplace *frdp;
+ XKeyEvent *event;
+{
+ KeySym keysym;
+
+ if (frdp == NULL)
+ return;
+
+ keysym = XLookupKeysym(event, 0);
+
+ /* the scape key pops the whole dialog down */
+ if (keysym == XK_Escape)
+ XtUnmanageChild(frdp->dialog);
+}
+
+ static void
+find_replace_dialog_create(arg, do_replace)
+ char_u *arg;
+ int do_replace;
+{
+ SharedFindReplace *frdp;
+ Widget separator;
+ Widget input_form;
+ Widget button_form;
+ Widget toggle_form;
+ Widget frame;
+ XmString str;
+ int n;
+ Arg args[6];
+ int wword = FALSE;
+ int mcase = !p_ic;
+ Dimension width;
+ Dimension widest;
+ char_u *entry_text;
+
+ frdp = do_replace ? &repl_widgets : &find_widgets;
+
+ /* Get the search string to use. */
+ entry_text = get_find_dialog_text(arg, &wword, &mcase);
+
+ /* If the dialog already exists, just raise it. */
+ if (frdp->dialog)
+ {
+ /* If the window is already up, just pop it to the top */
+ if (XtIsManaged(frdp->dialog))
+ XMapRaised(XtDisplay(frdp->dialog),
+ XtWindow(XtParent(frdp->dialog)));
+ else
+ XtManageChild(frdp->dialog);
+ XtPopup(XtParent(frdp->dialog), XtGrabNone);
+ XmProcessTraversal(frdp->what, XmTRAVERSE_CURRENT);
+
+ if (entry_text != NULL)
+ XmTextFieldSetString(frdp->what, (char *)entry_text);
+ vim_free(entry_text);
+
+ XtVaSetValues(frdp->wword, XmNset, wword, NULL);
+ return;
+ }
+
+ /* Create a fresh new dialog window */
+ if (do_replace)
+ str = XmStringCreateSimple(_("VIM - Search and Replace..."));
+ else
+ str = XmStringCreateSimple(_("VIM - Search..."));
+
+ n = 0;
+ XtSetArg(args[n], XmNautoUnmanage, False); n++;
+ XtSetArg(args[n], XmNnoResize, True); n++;
+ XtSetArg(args[n], XmNdialogTitle, str); n++;
+
+ frdp->dialog = XmCreateFormDialog(vimShell, "findReplaceDialog", args, n);
+ XmStringFree(str);
+ XtAddCallback(frdp->dialog, XmNdestroyCallback,
+ find_replace_destroy_callback, frdp);
+
+ button_form = XtVaCreateWidget("buttonForm",
+ xmFormWidgetClass, frdp->dialog,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNrightOffset, 4,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNtopOffset, 4,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ NULL);
+
+ str = XmStringCreateSimple(_("Find Next"));
+ frdp->find = XtVaCreateManagedWidget("findButton",
+ xmPushButtonWidgetClass, button_form,
+ XmNlabelString, str,
+ XmNsensitive, True,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+
+ XtAddCallback(frdp->find, XmNactivateCallback,
+ find_replace_callback,
+ (XtPointer) (do_replace ? FRD_R_FINDNEXT : FRD_FINDNEXT));
+
+ if (do_replace)
+ {
+ str = XmStringCreateSimple(_("Replace"));
+ frdp->replace = XtVaCreateManagedWidget("replaceButton",
+ xmPushButtonWidgetClass, button_form,
+ XmNlabelString, str,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->find,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+ XtAddCallback(frdp->replace, XmNactivateCallback,
+ find_replace_callback, (XtPointer)FRD_REPLACE);
+
+ str = XmStringCreateSimple(_("Replace All"));
+ frdp->all = XtVaCreateManagedWidget("replaceAllButton",
+ xmPushButtonWidgetClass, button_form,
+ XmNlabelString, str,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->replace,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+ XtAddCallback(frdp->all, XmNactivateCallback,
+ find_replace_callback, (XtPointer)FRD_REPLACEALL);
+
+ str = XmStringCreateSimple(_("Undo"));
+ frdp->undo = XtVaCreateManagedWidget("undoButton",
+ xmPushButtonWidgetClass, button_form,
+ XmNlabelString, str,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->all,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+ XtAddCallback(frdp->undo, XmNactivateCallback,
+ find_replace_callback, (XtPointer)FRD_UNDO);
+ }
+
+ str = XmStringCreateSimple(_("Cancel"));
+ frdp->cancel = XtVaCreateManagedWidget("closeButton",
+ xmPushButtonWidgetClass, button_form,
+ XmNlabelString, str,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+ XtAddCallback(frdp->cancel, XmNactivateCallback,
+ find_replace_dismiss_callback, frdp);
+
+ XtManageChild(button_form);
+
+ n = 0;
+ XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
+ XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET); n++;
+ XtSetArg(args[n], XmNrightWidget, button_form); n++;
+ XtSetArg(args[n], XmNrightOffset, 4); n++;
+ XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
+ XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
+ separator = XmCreateSeparatorGadget(frdp->dialog, "separator", args, n);
+ XtManageChild(separator);
+
+ input_form = XtVaCreateWidget("inputForm",
+ xmFormWidgetClass, frdp->dialog,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ XmNrightAttachment, XmATTACH_WIDGET,
+ XmNrightWidget, separator,
+ XmNrightOffset, 4,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNtopOffset, 4,
+ NULL);
+
+ {
+ Widget label_what;
+ Widget label_with = (Widget)0;
+
+ str = XmStringCreateSimple(_("Find what:"));
+ label_what = XtVaCreateManagedWidget("whatLabel",
+ xmLabelGadgetClass, input_form,
+ XmNlabelString, str,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNtopOffset, 4,
+ NULL);
+ XmStringFree(str);
+
+ frdp->what = XtVaCreateManagedWidget("whatText",
+ xmTextFieldWidgetClass, input_form,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ NULL);
+
+ if (do_replace)
+ {
+ frdp->with = XtVaCreateManagedWidget("withText",
+ xmTextFieldWidgetClass, input_form,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->what,
+ XmNtopOffset, 4,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+
+ XtAddCallback(frdp->with, XmNactivateCallback,
+ find_replace_callback, (XtPointer) FRD_R_FINDNEXT);
+
+ str = XmStringCreateSimple(_("Replace with:"));
+ label_with = XtVaCreateManagedWidget("withLabel",
+ xmLabelGadgetClass, input_form,
+ XmNlabelString, str,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->what,
+ XmNtopOffset, 4,
+ XmNbottomAttachment, XmATTACH_FORM,
+ NULL);
+ XmStringFree(str);
+
+ /*
+ * Make the entry activation only change the input focus onto the
+ * with item.
+ */
+ XtAddCallback(frdp->what, XmNactivateCallback,
+ entry_activate_callback, frdp->with);
+ XtAddEventHandler(frdp->with, KeyPressMask, False,
+ (XtEventHandler)find_replace_keypress,
+ (XtPointer) frdp);
+
+ }
+ else
+ {
+ /*
+ * Make the entry activation do the search.
+ */
+ XtAddCallback(frdp->what, XmNactivateCallback,
+ find_replace_callback, (XtPointer)FRD_FINDNEXT);
+ }
+ XtAddEventHandler(frdp->what, KeyPressMask, False,
+ (XtEventHandler)find_replace_keypress,
+ (XtPointer)frdp);
+
+ /* Get the maximum width between the label widgets and line them up.
+ */
+ n = 0;
+ XtSetArg(args[n], XmNwidth, &width); n++;
+ XtGetValues(label_what, args, n);
+ widest = width;
+ if (do_replace)
+ {
+ XtGetValues(label_with, args, n);
+ if (width > widest)
+ widest = width;
+ }
+
+ XtVaSetValues(frdp->what, XmNleftOffset, widest, NULL);
+ if (do_replace)
+ XtVaSetValues(frdp->with, XmNleftOffset, widest, NULL);
+
+ }
+
+ XtManageChild(input_form);
+
+ {
+ Widget radio_box;
+
+ frame = XtVaCreateWidget("directionFrame",
+ xmFrameWidgetClass, frdp->dialog,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, input_form,
+ XmNtopOffset, 4,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET,
+ XmNrightWidget, input_form,
+ NULL);
+
+ str = XmStringCreateSimple(_("Direction"));
+ (void)XtVaCreateManagedWidget("directionFrameLabel",
+ xmLabelGadgetClass, frame,
+ XmNlabelString, str,
+ XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING,
+ XmNchildType, XmFRAME_TITLE_CHILD,
+ NULL);
+ XmStringFree(str);
+
+ radio_box = XmCreateRadioBox(frame, "radioBox",
+ (ArgList)NULL, 0);
+
+ str = XmStringCreateSimple( _("Up"));
+ frdp->up = XtVaCreateManagedWidget("upRadioButton",
+ xmToggleButtonGadgetClass, radio_box,
+ XmNlabelString, str,
+ XmNset, False,
+ NULL);
+ XmStringFree(str);
+
+ str = XmStringCreateSimple(_("Down"));
+ frdp->down = XtVaCreateManagedWidget("downRadioButton",
+ xmToggleButtonGadgetClass, radio_box,
+ XmNlabelString, str,
+ XmNset, True,
+ NULL);
+ XmStringFree(str);
+
+ XtManageChild(radio_box);
+ XtManageChild(frame);
+ }
+
+ toggle_form = XtVaCreateWidget("toggleForm",
+ xmFormWidgetClass, frdp->dialog,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ XmNrightAttachment, XmATTACH_WIDGET,
+ XmNrightWidget, frame,
+ XmNrightOffset, 4,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, input_form,
+ XmNtopOffset, 4,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNbottomOffset, 4,
+ NULL);
+
+ str = XmStringCreateSimple(_("Match whole word only"));
+ frdp->wword = XtVaCreateManagedWidget("wordToggle",
+ xmToggleButtonGadgetClass, toggle_form,
+ XmNlabelString, str,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNtopOffset, 4,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ XmNset, wword,
+ NULL);
+ XmStringFree(str);
+
+ str = XmStringCreateSimple(_("Match case"));
+ frdp->mcase = XtVaCreateManagedWidget("caseToggle",
+ xmToggleButtonGadgetClass, toggle_form,
+ XmNlabelString, str,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNleftOffset, 4,
+ XmNtopAttachment, XmATTACH_WIDGET,
+ XmNtopWidget, frdp->wword,
+ XmNtopOffset, 4,
+ XmNset, mcase,
+ NULL);
+ XmStringFree(str);
+
+ XtManageChild(toggle_form);
+
+ if (entry_text != NULL)
+ XmTextFieldSetString(frdp->what, (char *)entry_text);
+ vim_free(entry_text);
+
+ XtManageChild(frdp->dialog);
+ XmProcessTraversal(frdp->what, XmTRAVERSE_CURRENT);
+}
+
+ void
+gui_mch_find_dialog(eap)
+ exarg_T *eap;
+{
+ if (!gui.in_use)
+ return;
+
+ find_replace_dialog_create(eap->arg, FALSE);
+}
+
+
+ void
+gui_mch_replace_dialog(eap)
+ exarg_T *eap;
+{
+ if (!gui.in_use)
+ return;
+
+ find_replace_dialog_create(eap->arg, TRUE);
+}
diff --git a/src/gui_photon.c b/src/gui_photon.c
new file mode 100644
index 000000000..f2bd5f09b
--- /dev/null
+++ b/src/gui_photon.c
@@ -0,0 +1,3060 @@
+/* vi:set ts=8 sw=4 sts=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Photon GUI support by Julian Kinraid
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ *
+ *
+ * Clipboard support is in os_qnx.c
+ * PhAttach() is called in os_qnx.c:qnx_init()
+ */
+
+#include "vim.h"
+
+#ifdef FEAT_TOOLBAR
+# include <photon/PxImage.h>
+#endif
+
+#if !defined(__QNX__)
+/* Used when generating prototypes. */
+# define PgColor_t int
+# define PhEvent_t int
+# define PhPoint_t int
+# define PtWidget_t int
+# define Pg_BLACK 0
+# define PtCallbackF_t int
+# define PtCallbackInfo_t int
+# define PhTile_t int
+# define PtWidget_t int
+# define PhImage_t int
+#endif
+
+#define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a[0]))
+#define RGB(r,g,b) PgRGB(r,g,b)
+
+#define EVENT_BUFFER_SIZE sizeof( PhEvent_t ) + 1000
+
+/* Some defines for gui_mch_mousehide() */
+#define MOUSE_HIDE TRUE
+#define MOUSE_SHOW FALSE
+
+/* Optional support for using a PtPanelGroup widget, needs work */
+#undef USE_PANEL_GROUP
+
+#ifdef USE_PANEL_GROUP
+static char *empty_title = " ";
+static char **panel_titles = NULL;
+static ushort_t num_panels = 0;
+static short pg_margin_left, pg_margin_right, pg_margin_top, pg_margin_bottom;
+#endif
+
+#define GUI_PH_MARGIN 4 /* Size of the bevel */
+
+#define GUI_PH_MOUSE_TYPE Ph_CURSOR_INSERT
+static PgColor_t gui_ph_mouse_color = Pg_BLACK;
+
+static PhPoint_t gui_ph_raw_offset;
+static PtWidget_t *gui_ph_timer_cursor; /* handle cursor blinking */
+static PtWidget_t *gui_ph_timer_timeout; /* used in gui_mch_wait_for_chars */
+static short is_timeout; /* Has the timeout occured? */
+
+/*
+ * This is set inside the mouse callback for a right mouse
+ * button click, and used for the popup menus
+ */
+static PhPoint_t abs_mouse;
+
+/* Try and avoid redraws while a resize is in progress */
+static int is_ignore_draw = FALSE;
+
+/* Used for converting to/from utf-8 and other charsets */
+static struct PxTransCtrl *charset_translate;
+
+/*
+ * Cursor blink functions.
+ *
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+static enum {
+ BLINK_NONE,
+ BLINK_OFF,
+ BLINK_ON
+} blink_state = BLINK_NONE;
+
+static long_u blink_waittime = 700;
+static long_u blink_ontime = 400;
+static long_u blink_offtime = 250;
+
+static struct
+{
+ int key_sym;
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {Pk_Up, 'k', 'u'},
+ {Pk_Down, 'k', 'd'},
+ {Pk_Left, 'k', 'l'},
+ {Pk_Right, 'k', 'r'},
+
+ {Pk_F1, 'k', '1'},
+ {Pk_F2, 'k', '2'},
+ {Pk_F3, 'k', '3'},
+ {Pk_F4, 'k', '4'},
+ {Pk_F5, 'k', '5'},
+ {Pk_F6, 'k', '6'},
+ {Pk_F7, 'k', '7'},
+ {Pk_F8, 'k', '8'},
+ {Pk_F9, 'k', '9'},
+ {Pk_F10, 'k', ';'},
+
+ {Pk_F11, 'F', '1'},
+ {Pk_F12, 'F', '2'},
+ {Pk_F13, 'F', '3'},
+ {Pk_F14, 'F', '4'},
+ {Pk_F15, 'F', '5'},
+ {Pk_F16, 'F', '6'},
+ {Pk_F17, 'F', '7'},
+ {Pk_F18, 'F', '8'},
+ {Pk_F19, 'F', '9'},
+ {Pk_F20, 'F', 'A'},
+
+ {Pk_F21, 'F', 'B'},
+ {Pk_F22, 'F', 'C'},
+ {Pk_F23, 'F', 'D'},
+ {Pk_F24, 'F', 'E'},
+ {Pk_F25, 'F', 'F'},
+ {Pk_F26, 'F', 'G'},
+ {Pk_F27, 'F', 'H'},
+ {Pk_F28, 'F', 'I'},
+ {Pk_F29, 'F', 'J'},
+
+ {Pk_F30, 'F', 'K'},
+ {Pk_F31, 'F', 'L'},
+ {Pk_F32, 'F', 'M'},
+ {Pk_F33, 'F', 'N'},
+ {Pk_F34, 'F', 'O'},
+ {Pk_F35, 'F', 'P'},
+
+ {Pk_Help, '%', '1'},
+ {Pk_BackSpace, 'k', 'b'},
+ {Pk_Insert, 'k', 'I'},
+ {Pk_Delete, 'k', 'D'},
+ {Pk_Home, 'k', 'h'},
+ {Pk_End, '@', '7'},
+ {Pk_Prior, 'k', 'P'},
+ {Pk_Next, 'k', 'N'},
+ {Pk_Print, '%', '9'},
+
+ {Pk_KP_Add, 'K', '6'},
+ {Pk_KP_Subtract,'K', '7'},
+ {Pk_KP_Divide, 'K', '8'},
+ {Pk_KP_Multiply,'K', '9'},
+ {Pk_KP_Enter, 'K', 'A'},
+
+ {Pk_KP_0, KS_EXTRA, KE_KINS}, /* Insert */
+ {Pk_KP_Decimal, KS_EXTRA, KE_KDEL}, /* Delete */
+
+ {Pk_KP_4, 'k', 'l'}, /* Left */
+ {Pk_KP_6, 'k', 'r'}, /* Right */
+ {Pk_KP_8, 'k', 'u'}, /* Up */
+ {Pk_KP_2, 'k', 'd'}, /* Down */
+
+ {Pk_KP_7, 'K', '1'}, /* Home */
+ {Pk_KP_1, 'K', '4'}, /* End */
+
+ {Pk_KP_9, 'K', '3'}, /* Page Up */
+ {Pk_KP_3, 'K', '5'}, /* Page Down */
+
+ {Pk_KP_5, '&', '8'}, /* Undo */
+
+ /* Keys that we want to be able to use any modifier with: */
+ {Pk_Return, CAR, NUL},
+ {Pk_space, ' ', NUL},
+ {Pk_Tab, TAB, NUL},
+ {Pk_Escape, ESC, NUL},
+ {NL, NL, NUL},
+ {CAR, CAR, NUL},
+
+ /* End of list marker: */
+ {0, 0, 0}
+};
+
+
+/****************************************************************************/
+
+static PtCallbackF_t gui_ph_handle_timer_cursor;
+static PtCallbackF_t gui_ph_handle_timer_timeout;
+
+static PtCallbackF_t gui_ph_handle_window_cb;
+
+static PtCallbackF_t gui_ph_handle_scrollbar;
+static PtCallbackF_t gui_ph_handle_keyboard;
+static PtCallbackF_t gui_ph_handle_mouse;
+static PtCallbackF_t gui_ph_handle_pulldown_menu;
+static PtCallbackF_t gui_ph_handle_menu;
+static PtCallbackF_t gui_ph_handle_focus; /* focus change of text area */
+
+static PtCallbackF_t gui_ph_handle_menu_resize;
+
+/* When a menu is unrealized, give focus back to vimTextArea */
+static PtCallbackF_t gui_ph_handle_menu_unrealized;
+
+#ifdef USE_PANEL_GROUP
+static void gui_ph_get_panelgroup_margins( short*, short*, short*, short* );
+#endif
+
+#ifdef FEAT_TOOLBAR
+static PhImage_t *gui_ph_toolbar_find_icon( vimmenu_T *menu );
+#endif
+
+static void gui_ph_draw_start( void );
+static void gui_ph_draw_end( void );
+
+/* Set the text for the balloon */
+static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window,
+ PtWidget_t *widget,
+ int position,
+ char *text,
+ char *font,
+ PgColor_t fill_color,
+ PgColor_t text_color );
+
+/****************************************************************************/
+
+static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window,
+ PtWidget_t *widget,
+ int position,
+ char *text,
+ char *font,
+ PgColor_t fill_color,
+ PgColor_t text_color )
+{
+ PtArg_t arg;
+ vimmenu_T *menu;
+ char_u *tooltip;
+
+ PtSetArg( &arg, Pt_ARG_POINTER, &menu, 0 );
+ PtGetResources( widget, 1, &arg );
+
+ /* Override the text and position */
+
+ tooltip = text;
+ if( menu != NULL )
+ {
+ int index = MENU_INDEX_TIP;
+ if( menu->strings[ index ] != NULL )
+ tooltip = menu->strings[ index ];
+ }
+
+ return( PtInflateBalloon(
+ window,
+ widget,
+ /* Don't put the balloon at the bottom,
+ * it gets drawn over by gfx done in the PtRaw */
+ Pt_BALLOON_TOP,
+ tooltip,
+ font,
+ fill_color,
+ text_color ) );
+}
+
+ static void
+gui_ph_resize_container( void )
+{
+ PhArea_t area;
+
+ PtWidgetArea( gui.vimWindow, &area );
+ PtWidgetPos ( gui.vimContainer, &area.pos );
+
+ PtSetResource( gui.vimContainer, Pt_ARG_AREA, &area, 0 );
+}
+
+ static int
+gui_ph_handle_menu_resize(
+ PtWidget_t *widget,
+ void *other,
+ PtCallbackInfo_t *info )
+{
+ PtContainerCallback_t *sizes = info->cbdata;
+ PtWidget_t *container;
+ PhPoint_t below_menu;
+ int_u height;
+
+ height = sizes->new_dim.h;
+
+ /* Because vim treats the toolbar and menubar separatly,
+ * and here they're lumped together into a PtToolbarGroup,
+ * we only need either menu_height or toolbar_height set at once */
+ if( gui.menu_is_active )
+ {
+ gui.menu_height = height;
+ gui.toolbar_height = 0;
+ }
+#ifdef FEAT_TOOLBAR
+ else
+ gui.toolbar_height = height;
+#endif
+
+ below_menu.x = 0;
+ below_menu.y = height;
+
+#ifdef USE_PANEL_GROUP
+ container = gui.vimPanelGroup;
+#else
+ container = gui.vimContainer;
+#endif
+
+ PtSetResource( container, Pt_ARG_POS, &below_menu, 0 );
+
+ gui_ph_resize_container();
+
+#ifdef USE_PANEL_GROUP
+ gui_ph_get_panelgroup_margins(
+ &pg_margin_top, &pg_margin_bottom,
+ &pg_margin_left, &pg_margin_right );
+#endif
+ return( Pt_CONTINUE );
+}
+
+/*
+ * Pt_ARG_TIMER_REPEAT isn't used because the on & off times
+ * are different
+ */
+ static int
+gui_ph_handle_timer_cursor(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ if( blink_state == BLINK_ON )
+ {
+ gui_undraw_cursor();
+ blink_state = BLINK_OFF;
+ PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
+ blink_offtime, 0 );
+ }
+ else
+ {
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_ON;
+ PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
+ blink_ontime, 0 );
+ }
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_timer_timeout(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
+{
+ is_timeout = TRUE;
+
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ PhWindowEvent_t *we = info->cbdata;
+ ushort_t *width, *height;
+
+ switch( we->event_f ) {
+ case Ph_WM_CLOSE:
+ gui_shell_closed();
+ break;
+
+ case Ph_WM_FOCUS:
+ /* Just in case it's hidden and needs to be shown */
+ gui_mch_mousehide( MOUSE_SHOW );
+
+ if( we->event_state == Ph_WM_EVSTATE_FOCUS )
+ {
+ gui_focus_change(TRUE);
+ gui_mch_start_blink();
+ }
+ else
+ {
+ gui_focus_change(FALSE);
+ gui_mch_stop_blink();
+ }
+ break;
+
+ case Ph_WM_RESIZE:
+ PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 );
+ PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 );
+#ifdef USE_PANEL_GROUP
+ width -= (pg_margin_left + pg_margin_right);
+ height -= (pg_margin_top + pg_margin_bottom);
+#endif
+ gui_resize_shell( *width, *height );
+ gui_set_shellsize( FALSE, FALSE );
+ is_ignore_draw = FALSE;
+ PtEndFlux( gui.vimContainer );
+ PtContainerRelease( gui.vimContainer );
+ break;
+
+ default:
+ break;
+ }
+
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ PtScrollbarCallback_t *scroll;
+ scrollbar_T *sb;
+ int value, dragging = FALSE;
+
+ scroll = info->cbdata;
+
+ sb = (scrollbar_T *) data;
+ if( sb != NULL )
+ {
+ value = scroll->position;
+ switch( scroll->action )
+ {
+ case Pt_SCROLL_DRAGGED:
+ dragging = TRUE;
+ break;
+
+ case Pt_SCROLL_SET:
+ /* FIXME: return straight away here? */
+ return( Pt_CONTINUE );
+ break;
+ }
+
+ gui_drag_scrollbar(sb, value, dragging);
+ }
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ PhKeyEvent_t *key;
+ unsigned char string[6];
+ int len, i;
+ int ch, modifiers;
+
+ key = PhGetData( info->event );
+
+ ch = modifiers = len = 0;
+
+ if( p_mh )
+ gui_mch_mousehide( MOUSE_HIDE );
+
+ /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
+ if( key->key_flags & Pk_KF_Compose )
+ {
+ return( Pt_CONTINUE );
+ }
+
+ if( (key->key_flags & Pk_KF_Cap_Valid) &&
+ PkIsKeyDown( key->key_flags ) )
+ {
+#ifdef FEAT_MENU
+ /*
+ * Only show the menu if the Alt key is down, and the Shift & Ctrl
+ * keys aren't down, as well as the other conditions
+ */
+ if( ( ( key->key_mods & Pk_KM_Alt ) &&
+ !( key->key_mods & Pk_KM_Shift ) &&
+ !( key->key_mods & Pk_KM_Ctrl ) ) &&
+ gui.menu_is_active &&
+ ( *p_wak == 'y' ||
+ ( *p_wak == 'm' &&
+ gui_is_menu_shortcut( key->key_cap ) ) ) )
+ {
+ /* Fallthrough and let photon look for the hotkey */
+ return( Pt_CONTINUE );
+ }
+#endif
+
+ for( i = 0; special_keys[i].key_sym != 0; i++ )
+ {
+ if( special_keys[i].key_sym == key->key_cap )
+ {
+ len = 0;
+ if( special_keys[i].vim_code1 == NUL )
+ ch = special_keys[i].vim_code0;
+ else
+ {
+ /* Detect if a keypad number key has been pressed
+ * and change the key if Num Lock is on */
+ if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9
+ && ( key->key_mods & Pk_KM_Num_Lock ) )
+ {
+ /* FIXME: For now, just map the key to a ascii value
+ * (see <photon/PkKeyDef.h>) */
+ ch = key->key_cap - 0xf080;
+ }
+ else
+ ch = TO_SPECIAL( special_keys[i].vim_code0,
+ special_keys[i].vim_code1 );
+ }
+ break;
+ }
+ }
+
+ if( key->key_mods & Pk_KM_Ctrl )
+ modifiers |= MOD_MASK_CTRL;
+ if( key->key_mods & Pk_KM_Alt )
+ modifiers |= MOD_MASK_ALT;
+ if( key->key_mods & Pk_KM_Shift )
+ modifiers |= MOD_MASK_SHIFT;
+
+ /* Is this not a special key? */
+ if( special_keys[i].key_sym == 0 )
+ {
+ ch = PhTo8859_1( key );
+ if( ch == -1
+#ifdef FEAT_MBYTE
+ || ( enc_utf8 && ch > 127 )
+#endif
+ )
+ {
+#ifdef FEAT_MBYTE
+ len = PhKeyToMb( string, key );
+ if( len > 0 )
+ {
+ static char buf[6];
+ int src_taken, dst_made;
+ if( enc_utf8 != TRUE )
+ {
+ PxTranslateFromUTF(
+ charset_translate,
+ string,
+ len,
+ &src_taken,
+ buf,
+ 6,
+ &dst_made );
+
+ add_to_input_buf( buf, dst_made );
+ }
+ else
+ {
+ add_to_input_buf( string, len );
+ }
+
+ return( Pt_CONSUME );
+ }
+ len = 0;
+#endif
+ ch = key->key_cap;
+ if( ch < 0xff )
+ {
+ /* FIXME: is this the right thing to do? */
+ if( modifiers & MOD_MASK_CTRL )
+ {
+ modifiers &= ~MOD_MASK_CTRL;
+
+ if( ( ch >= 'a' && ch <= 'z' ) ||
+ ch == '[' ||
+ ch == ']' ||
+ ch == '\\' )
+ ch = Ctrl_chr( ch );
+ else if( ch == '2' )
+ ch = NUL;
+ else if( ch == '6' )
+ ch = 0x1e;
+ else if( ch == '-' )
+ ch = 0x1f;
+ else
+ modifiers |= MOD_MASK_CTRL;
+ }
+
+ if( modifiers & MOD_MASK_ALT )
+ {
+ ch = Meta( ch );
+ modifiers &= ~MOD_MASK_ALT;
+ }
+ }
+ else
+ {
+ return( Pt_CONTINUE );
+ }
+ }
+ else
+ modifiers &= ~MOD_MASK_SHIFT;
+ }
+
+ ch = simplify_key( ch, &modifiers );
+ if( modifiers )
+ {
+ string[ len++ ] = CSI;
+ string[ len++ ] = KS_MODIFIER;
+ string[ len++ ] = modifiers;
+ }
+
+ if( IS_SPECIAL( ch ) )
+ {
+ string[ len++ ] = CSI;
+ string[ len++ ] = K_SECOND( ch );
+ string[ len++ ] = K_THIRD( ch );
+ }
+ else
+ {
+ string[ len++ ] = ch;
+ }
+
+ if (len == 1 && ((ch == Ctrl_C && ctrl_c_interrupts)
+ || ch == intr_char))
+ {
+ trash_input_buf();
+ got_int = TRUE;
+ }
+
+ if (len == 1 && string[0] == CSI)
+ {
+ /* Turn CSI into K_CSI. */
+ string[ len++ ] = KS_EXTRA;
+ string[ len++ ] = KE_CSI;
+ }
+
+ if( len > 0 )
+ {
+ add_to_input_buf( string, len );
+ return( Pt_CONSUME );
+ }
+ }
+
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_mouse( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ PhPointerEvent_t *pointer;
+ PhRect_t *pos;
+ int button = 0, repeated_click, modifiers = 0x0;
+ short mouse_x, mouse_y;
+
+ pointer = PhGetData( info->event );
+ pos = PhGetRects( info->event );
+
+ gui_mch_mousehide( MOUSE_SHOW );
+
+ /*
+ * Coordinates need to be relative to the base window,
+ * not relative to the vimTextArea widget
+ */
+ mouse_x = pos->ul.x + gui.border_width;
+ mouse_y = pos->ul.y + gui.border_width;
+
+ if( info->event->type == Ph_EV_PTR_MOTION_NOBUTTON )
+ {
+ gui_mouse_moved( mouse_x, mouse_y );
+ return( Pt_CONTINUE );
+ }
+
+ if( pointer->key_mods & Pk_KM_Shift )
+ modifiers |= MOUSE_SHIFT;
+ if( pointer->key_mods & Pk_KM_Ctrl )
+ modifiers |= MOUSE_CTRL;
+ if( pointer->key_mods & Pk_KM_Alt )
+ modifiers |= MOUSE_ALT;
+
+ /*
+ * FIXME More than one button may be involved, but for
+ * now just deal with one
+ */
+ if( pointer->buttons & Ph_BUTTON_SELECT )
+ button = MOUSE_LEFT;
+
+ if( pointer->buttons & Ph_BUTTON_MENU )
+ {
+ button = MOUSE_RIGHT;
+ /* Need the absolute coordinates for the popup menu */
+ abs_mouse.x = pointer->pos.x;
+ abs_mouse.y = pointer->pos.y;
+ }
+
+ if( pointer->buttons & Ph_BUTTON_ADJUST )
+ button = MOUSE_MIDDLE;
+
+ /* Catch a real release (not phantom or other releases */
+ if( info->event->type == Ph_EV_BUT_RELEASE )
+ button = MOUSE_RELEASE;
+
+ if( info->event->type & Ph_EV_PTR_MOTION_BUTTON )
+ button = MOUSE_DRAG;
+
+#if 0
+ /* Vim doesn't use button repeats */
+ if( info->event->type & Ph_EV_BUT_REPEAT )
+ button = MOUSE_DRAG;
+#endif
+
+ /* Don't do anything if it is one of the phantom mouse release events */
+ if( ( button != MOUSE_RELEASE ) ||
+ ( info->event->subtype == Ph_EV_RELEASE_REAL ) )
+ {
+ repeated_click = (pointer->click_count >= 2) ? TRUE : FALSE;
+
+ gui_send_mouse_event( button , mouse_x, mouse_y, repeated_click, modifiers );
+ }
+
+ return( Pt_CONTINUE );
+}
+
+/* Handle a focus change of the PtRaw widget */
+ static int
+gui_ph_handle_focus( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ if( info->reason == Pt_CB_LOST_FOCUS )
+ {
+ PtRemoveEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
+ gui_ph_handle_mouse, NULL );
+
+ gui_mch_mousehide( MOUSE_SHOW );
+ }
+ else
+ {
+ PtAddEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
+ gui_ph_handle_mouse, NULL );
+ }
+ return( Pt_CONTINUE );
+}
+
+ static void
+gui_ph_handle_raw_draw( PtWidget_t *widget, PhTile_t *damage )
+{
+ PhRect_t *r;
+ PhPoint_t offset;
+ PhPoint_t translation;
+
+ if( is_ignore_draw == TRUE )
+ return;
+
+ PtSuperClassDraw( PtBasic, widget, damage );
+ PgGetTranslation( &translation );
+ PgClearTranslation();
+
+#if 0
+ /*
+ * This causes some wierd probems, with drawing being done from
+ * within this raw drawing function (rather than just simple clearing
+ * and text drawing done by gui_redraw)
+ *
+ * The main problem is when PhBlit is used, and the cursor appearing
+ * in places where it shouldn't
+ */
+ out_flush();
+#endif
+
+ PtWidgetOffset( widget, &offset );
+ PhTranslatePoint( &offset, PtWidgetPos( gui.vimTextArea, NULL ) );
+
+#if 1
+ /* Redraw individual damage regions */
+ if( damage->next != NULL )
+ damage = damage->next;
+
+ while( damage != NULL )
+ {
+ r = &damage->rect;
+ gui_redraw(
+ r->ul.x - offset.x, r->ul.y - offset.y,
+ r->lr.x - r->ul.x + 1,
+ r->lr.y - r->ul.y + 1 );
+ damage = damage->next;
+ }
+#else
+ /* Redraw the rectangle that covers all the damaged regions */
+ r = &damage->rect;
+ gui_redraw(
+ r->ul.x - offset.x, r->ul.y - offset.y,
+ r->lr.x - r->ul.x + 1,
+ r->lr.y - r->ul.y + 1 );
+#endif
+
+ PgSetTranslation( &translation, 0 );
+}
+
+ static int
+gui_ph_handle_pulldown_menu(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ if( data != NULL )
+ {
+ vimmenu_T *menu = (vimmenu_T *) data;
+
+ PtPositionMenu( menu->submenu_id, NULL );
+ PtRealizeWidget( menu->submenu_id );
+ }
+
+ return( Pt_CONTINUE );
+}
+
+/* This is used for pulldown/popup menus and also toolbar buttons */
+ static int
+gui_ph_handle_menu( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ if( data != NULL )
+ {
+ vimmenu_T *menu = (vimmenu_T *) data;
+ gui_menu_cb( menu );
+ }
+ return( Pt_CONTINUE );
+}
+
+/* Stop focus from disappearing into the menubar... */
+ static int
+gui_ph_handle_menu_unrealized(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ PtGiveFocus( gui.vimTextArea, NULL );
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_handle_window_open(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ gui_set_shellsize( FALSE, TRUE );
+ return( Pt_CONTINUE );
+}
+
+/****************************************************************************/
+
+#define DRAW_START gui_ph_draw_start()
+#define DRAW_END gui_ph_draw_end()
+
+/* TODO: Set a clipping rect? */
+ static void
+gui_ph_draw_start( void )
+{
+ PgSetRegion( PtWidgetRid( PtFindDisjoint( gui.vimTextArea ) ) );
+
+ PtWidgetOffset( gui.vimTextArea, &gui_ph_raw_offset );
+ PhTranslatePoint( &gui_ph_raw_offset, PtWidgetPos( gui.vimTextArea, NULL ) );
+
+ PgSetTranslation( &gui_ph_raw_offset, Pg_RELATIVE );
+}
+
+ static void
+gui_ph_draw_end( void )
+{
+ gui_ph_raw_offset.x = -gui_ph_raw_offset.x;
+ gui_ph_raw_offset.y = -gui_ph_raw_offset.y;
+ PgSetTranslation( &gui_ph_raw_offset, Pg_RELATIVE );
+}
+
+#ifdef USE_PANEL_GROUP
+ static vimmenu_T *
+gui_ph_find_buffer_item( char_u *name )
+{
+ vimmenu_T *top_level = root_menu;
+ vimmenu_T *items = NULL;
+
+ while( top_level != NULL &&
+ ( STRCMP( top_level->dname, "Buffers" ) != 0 ) )
+ top_level = top_level->next;
+
+ if( top_level != NULL )
+ {
+ items = top_level->children;
+
+ while( items != NULL &&
+ ( STRCMP( items->dname, name ) != 0 ) )
+ items = items->next;
+ }
+ return( items );
+}
+
+ static void
+gui_ph_pg_set_buffer_num( int_u buf_num )
+{
+ int i;
+ char search[16];
+ char *mark;
+
+ if( gui.vimTextArea == NULL || buf_num == 0 )
+ return;
+
+ search[0] = '(';
+ ultoa( buf_num, &search[1], 10 );
+ STRCAT( search, ")" );
+
+ for( i = 0; i < num_panels; i++ )
+ {
+ /* find the last "(" in the panel title and see if the buffer
+ * number in the title matches the one we're looking for */
+ mark = STRRCHR( panel_titles[ i ], '(' );
+ if( mark != NULL && STRCMP( mark, search ) == 0 )
+ {
+ PtSetResource( gui.vimPanelGroup, Pt_ARG_PG_CURRENT_INDEX,
+ i, 0 );
+ }
+ }
+}
+
+ static int
+gui_ph_handle_pg_change(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ vimmenu_T *menu;
+ PtPanelGroupCallback_t *panel;
+
+ if( info->event != NULL )
+ {
+ panel = info->cbdata;
+ if( panel->new_panel != NULL )
+ {
+ menu = gui_ph_find_buffer_item( panel->new_panel );
+ if( menu )
+ gui_menu_cb( menu );
+ }
+ }
+ return( Pt_CONTINUE );
+}
+
+ static void
+gui_ph_get_panelgroup_margins(
+ short *top,
+ short *bottom,
+ short *left,
+ short *right )
+{
+ unsigned short abs_raw_x, abs_raw_y, abs_panel_x, abs_panel_y;
+ const unsigned short *margin_top, *margin_bottom;
+ const unsigned short *margin_left, *margin_right;
+
+ PtGetAbsPosition( gui.vimTextArea, &abs_raw_x, &abs_raw_y );
+ PtGetAbsPosition( gui.vimPanelGroup, &abs_panel_x, &abs_panel_y );
+
+ PtGetResource( gui.vimPanelGroup, Pt_ARG_MARGIN_RIGHT, &margin_right, 0 );
+ PtGetResource( gui.vimPanelGroup, Pt_ARG_MARGIN_BOTTOM, &margin_bottom, 0 );
+
+ abs_raw_x -= abs_panel_x;
+ abs_raw_y -= abs_panel_y;
+
+ *top = abs_raw_y;
+ *bottom = *margin_bottom;
+
+ *left = abs_raw_x;
+ *right = *margin_right;
+}
+
+/* Used for the tabs for PtPanelGroup */
+ static int
+gui_ph_is_buffer_item( vimmenu_T *menu, vimmenu_T *parent )
+{
+ char *mark;
+
+ if( STRCMP( parent->dname, "Buffers" ) == 0 )
+ {
+ /* Look for '(' digits ')' */
+ mark = vim_strchr( menu->dname, '(' );
+ if( mark != NULL )
+ {
+ mark++;
+ while( isdigit( *mark ) )
+ mark++;
+
+ if( *mark == ')' )
+ return( TRUE);
+ }
+ }
+ return( FALSE );
+}
+
+ static void
+gui_ph_pg_add_buffer(char *name )
+{
+ char **new_titles = NULL;
+
+ new_titles = (char **) alloc( ( num_panels + 1 ) * sizeof( char ** ) );
+ if( new_titles != NULL )
+ {
+ if( num_panels > 0 )
+ memcpy( new_titles, panel_titles, num_panels * sizeof( char ** ) );
+
+ new_titles[ num_panels++ ] = name;
+
+ PtSetResource( gui.vimPanelGroup, Pt_ARG_PG_PANEL_TITLES, new_titles,
+ num_panels );
+
+ vim_free( panel_titles );
+ panel_titles = new_titles;
+ }
+}
+
+ static void
+gui_ph_pg_remove_buffer( char *name )
+{
+ int i;
+ char **new_titles = NULL;
+
+ /* If there is only 1 panel, we just use the temporary place holder */
+ if( num_panels > 1 )
+ {
+ new_titles = (char **) alloc( ( num_panels - 1 ) * sizeof( char ** ) );
+ if( new_titles != NULL )
+ {
+ char **s = new_titles;
+ /* Copy all the titles except the one we're removing */
+ for( i = 0; i < num_panels; i++ )
+ {
+ if( STRCMP( panel_titles[ i ], name ) != 0 )
+ {
+ *s++ = panel_titles[ i ];
+ }
+ }
+ num_panels--;
+
+ PtSetResource( gui.vimPanelGroup, Pt_ARG_PG_PANEL_TITLES, new_titles,
+ num_panels );
+
+ vim_free( panel_titles );
+ panel_titles = new_titles;
+ }
+ }
+ else
+ {
+ num_panels--;
+ PtSetResource( gui.vimPanelGroup, Pt_ARG_PG_PANEL_TITLES, &empty_title,
+ 1 );
+
+ vim_free( panel_titles );
+ panel_titles = NULL;
+ }
+}
+
+/* When a buffer item is deleted from the buffer menu */
+ static int
+gui_ph_handle_buffer_remove(
+ PtWidget_t *widget,
+ void *data,
+ PtCallbackInfo_t *info )
+{
+ vimmenu_T *menu;
+
+ if( data != NULL )
+ {
+ menu = (vimmenu_T *) data;
+ gui_ph_pg_remove_buffer( menu->dname );
+ }
+
+ return( Pt_CONTINUE );
+}
+#endif
+
+ static int
+gui_ph_pane_resize( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ if( PtWidgetIsRealized( widget ) )
+ {
+ is_ignore_draw = TRUE;
+ PtStartFlux( gui.vimContainer );
+ PtContainerHold( gui.vimContainer );
+ }
+
+ return( Pt_CONTINUE );
+}
+
+/****************************************************************************/
+
+#ifdef FEAT_MBYTE
+ void
+gui_ph_encoding_changed( int new_encoding )
+{
+ /* Default encoding is latin1 */
+ char *charset = "latin1";
+ int i;
+
+ struct {
+ int encoding;
+ char *name;
+ } charsets[] = {
+ { DBCS_JPN, "SHIFT_JIS" },
+ { DBCS_KOR, "csEUCKR" },
+ { DBCS_CHT, "big5" },
+ { DBCS_CHS, "gb" }
+ };
+
+ for( i = 0; i < ARRAY_LENGTH( charsets ); i++ )
+ {
+ if( new_encoding == charsets[ i ].encoding )
+ charset = charsets[ i ].name;
+ }
+
+ charset_translate = PxTranslateSet( charset_translate, charset );
+}
+#endif
+
+/****************************************************************************/
+/****************************************************************************/
+
+ void
+gui_mch_prepare(argc, argv)
+ int *argc;
+ char **argv;
+{
+ PtInit( NULL );
+}
+
+ int
+gui_mch_init(void)
+{
+ PtArg_t args[10];
+ int flags = 0, n = 0;
+
+ PhDim_t window_size = {100, 100}; /* Abitrary values */
+ PhPoint_t pos = {0, 0};
+
+ gui.event_buffer = (PhEvent_t *) alloc( EVENT_BUFFER_SIZE );
+ if( gui.event_buffer == NULL )
+ return( FAIL );
+
+ /* Get a translation so we can convert from ISO Latin-1 to UTF */
+ charset_translate = PxTranslateSet( NULL, "latin1" );
+
+ /* The +2 is for the 1 pixel dark line on each side */
+ gui.border_offset = gui.border_width = GUI_PH_MARGIN + 2;
+
+ /* Handle close events ourselves */
+ PtSetArg( &args[ n++ ], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE );
+ PtSetArg( &args[ n++ ], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE,
+ Ph_WM_CLOSE | Ph_WM_RESIZE | Ph_WM_FOCUS );
+ PtSetArg( &args[ n++ ], Pt_ARG_DIM, &window_size, 0 );
+ gui.vimWindow = PtCreateWidget( PtWindow, NULL, n, args );
+ if( gui.vimWindow == NULL )
+ return( FAIL );
+
+ PtAddCallback( gui.vimWindow, Pt_CB_WINDOW, gui_ph_handle_window_cb, NULL );
+ PtAddCallback( gui.vimWindow, Pt_CB_WINDOW_OPENING,
+ gui_ph_handle_window_open, NULL );
+
+ n = 0;
+ PtSetArg( &args[ n++ ], Pt_ARG_ANCHOR_FLAGS, Pt_ANCHOR_ALL, Pt_IS_ANCHORED );
+ PtSetArg( &args[ n++ ], Pt_ARG_DIM, &window_size, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_POS, &pos, 0 );
+
+#ifdef USE_PANEL_GROUP
+ /* Put in a temprary place holder title */
+ PtSetArg( &args[ n++ ], Pt_ARG_PG_PANEL_TITLES, &empty_title, 1 );
+
+ gui.vimPanelGroup = PtCreateWidget( PtPanelGroup, gui.vimWindow, n, args );
+ if( gui.vimPanelGroup == NULL )
+ return( FAIL );
+
+ PtAddCallback( gui.vimPanelGroup, Pt_CB_PG_PANEL_SWITCHING,
+ gui_ph_handle_pg_change, NULL );
+#else
+ /* Turn off all edge decorations */
+ PtSetArg( &args[ n++ ], Pt_ARG_BASIC_FLAGS, Pt_FALSE, Pt_ALL );
+ PtSetArg( &args[ n++ ], Pt_ARG_BEVEL_WIDTH, 0, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_MARGIN_WIDTH, 0, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_MARGIN_HEIGHT, 0, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_CONTAINER_FLAGS, Pt_TRUE, Pt_AUTO_EXTENT );
+
+ gui.vimContainer = PtCreateWidget( PtPane, gui.vimWindow, n, args );
+ if( gui.vimContainer == NULL )
+ return( FAIL );
+
+ PtAddCallback( gui.vimContainer, Pt_CB_RESIZE, gui_ph_pane_resize, NULL );
+#endif
+
+ /* Size for the text area is set in gui_mch_set_text_area_pos */
+ n = 0;
+
+ PtSetArg( &args[ n++ ], Pt_ARG_RAW_DRAW_F, gui_ph_handle_raw_draw, 1 );
+ PtSetArg( &args[ n++ ], Pt_ARG_BEVEL_WIDTH, GUI_PH_MARGIN, 0 );
+ /*
+ * Using focus render also causes the whole widget to be redrawn
+ * whenever it changes focus, which is very annoying :p
+ */
+ PtSetArg( &args[ n++ ], Pt_ARG_FLAGS, Pt_TRUE,
+ Pt_GETS_FOCUS | Pt_HIGHLIGHTED );
+#ifndef FEAT_MOUSESHAPE
+ PtSetArg( &args[ n++ ], Pt_ARG_CURSOR_TYPE, GUI_PH_MOUSE_TYPE, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_CURSOR_COLOR, gui_ph_mouse_color, 0 );
+#endif
+
+ gui.vimTextArea = PtCreateWidget( PtRaw, Pt_DFLT_PARENT, n, args );
+ if( gui.vimTextArea == NULL)
+ return( FAIL );
+
+ /* TODO: use PtAddEventHandlers instead? */
+ /* Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway */
+ PtAddEventHandler( gui.vimTextArea,
+ Ph_EV_BUT_PRESS | Ph_EV_BUT_RELEASE | Ph_EV_PTR_MOTION_BUTTON,
+ gui_ph_handle_mouse, NULL );
+ PtAddEventHandler( gui.vimTextArea, Ph_EV_KEY,
+ gui_ph_handle_keyboard, NULL );
+ PtAddCallback( gui.vimTextArea, Pt_CB_GOT_FOCUS,
+ gui_ph_handle_focus, NULL );
+ PtAddCallback( gui.vimTextArea, Pt_CB_LOST_FOCUS,
+ gui_ph_handle_focus, NULL );
+
+ /*
+ * Now that the text area widget has been created, set up the colours,
+ * which wil call PtSetResource from gui_mch_new_colors
+ */
+
+ /*
+ * Create the two timers, not as accurate as using the kernel timer
+ * functions, but good enough
+ */
+ gui_ph_timer_cursor = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
+ if( gui_ph_timer_cursor == NULL )
+ return( FAIL );
+
+ gui_ph_timer_timeout = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
+ if( gui_ph_timer_timeout == NULL )
+ return( FAIL );
+
+ PtAddCallback( gui_ph_timer_cursor, Pt_CB_TIMER_ACTIVATE,
+ gui_ph_handle_timer_cursor, NULL);
+ PtAddCallback( gui_ph_timer_timeout, Pt_CB_TIMER_ACTIVATE,
+ gui_ph_handle_timer_timeout, NULL);
+
+#ifdef FEAT_MENU
+ n = 0;
+ PtSetArg( &args[ n++ ], Pt_ARG_WIDTH, window_size.w, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_ANCHOR_FLAGS, Pt_ANCHOR_LEFT_RIGHT,
+ Pt_IS_ANCHORED );
+ gui.vimToolBarGroup = PtCreateWidget( PtToolbarGroup, gui.vimWindow,
+ n, args );
+ if( gui.vimToolBarGroup == NULL )
+ return( FAIL );
+
+ PtAddCallback( gui.vimToolBarGroup, Pt_CB_RESIZE,
+ gui_ph_handle_menu_resize, NULL );
+
+ n = 0;
+ flags = 0;
+ PtSetArg( &args[ n++ ], Pt_ARG_WIDTH, window_size.w, 0 );
+ if( ! vim_strchr( p_go, GO_MENUS ) )
+ {
+ flags |= Pt_DELAY_REALIZE;
+ PtSetArg( &args[ n++ ], Pt_ARG_FLAGS, Pt_TRUE, flags );
+ }
+ gui.vimMenuBar = PtCreateWidget( PtMenuBar, gui.vimToolBarGroup, n, args );
+ if( gui.vimMenuBar == NULL )
+ return( FAIL );
+
+# ifdef FEAT_TOOLBAR
+ n = 0;
+
+ PtSetArg( &args[ n++ ], Pt_ARG_ANCHOR_FLAGS,
+ Pt_ANCHOR_LEFT_RIGHT |Pt_TOP_ANCHORED_TOP, Pt_IS_ANCHORED );
+ PtSetArg( &args[ n++ ], Pt_ARG_RESIZE_FLAGS, Pt_TRUE,
+ Pt_RESIZE_Y_AS_REQUIRED );
+ PtSetArg( &args[ n++ ], Pt_ARG_WIDTH, window_size.w, 0 );
+
+ flags = Pt_GETS_FOCUS;
+ if( ! vim_strchr( p_go, GO_TOOLBAR ) )
+ flags |= Pt_DELAY_REALIZE;
+
+ PtSetArg( &args[ n++ ], Pt_ARG_FLAGS, Pt_DELAY_REALIZE, flags );
+
+ gui.vimToolBar = PtCreateWidget( PtToolbar, gui.vimToolBarGroup, n, args );
+ if( gui.vimToolBar == NULL )
+ return( FAIL );
+
+ /*
+ * Size for the toolbar is fetched in gui_mch_show_toolbar, after
+ * the buttons have been added and the toolbar has resized it's height
+ * for the buttons to fit
+ */
+# endif
+
+#endif
+
+ return( OK );
+}
+
+ int
+gui_mch_init_check(void)
+{
+ return( (is_photon_available == TRUE) ? OK : FAIL );
+}
+
+ int
+gui_mch_open(void)
+{
+ gui.norm_pixel = Pg_BLACK;
+ gui.back_pixel = Pg_WHITE;
+
+ set_normal_colors();
+
+ gui_check_colors();
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+
+ highlight_gui_started();
+
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+ return( (PtRealizeWidget( gui.vimWindow ) == 0) ? OK : FAIL );
+}
+
+ void
+gui_mch_exit(int rc)
+{
+ PtDestroyWidget( gui.vimWindow );
+
+ PxTranslateSet( charset_translate, NULL );
+
+ vim_free( gui.event_buffer );
+
+#ifdef USE_PANEL_GROUPS
+ vim_free( panel_titles );
+#endif
+}
+
+/****************************************************************************/
+/* events */
+
+/* When no events are available, photon will call this function, working is
+ * set to FALSE, and the gui_mch_update loop will exit. */
+ static int
+exit_gui_mch_update( void *data )
+{
+ *(int *)data = FALSE;
+ return( Pt_END );
+}
+
+ void
+gui_mch_update(void)
+{
+ int working = TRUE;
+
+ PtAppAddWorkProc( NULL, exit_gui_mch_update, &working );
+ while( ( working == TRUE ) && !vim_is_input_buf_full())
+ {
+ PtProcessEvent();
+ }
+}
+
+ int
+gui_mch_wait_for_chars(int wtime)
+{
+ is_timeout = FALSE;
+
+ if( wtime > 0 )
+ PtSetResource( gui_ph_timer_timeout, Pt_ARG_TIMER_INITIAL, wtime, 0 );
+
+ while( 1 )
+ {
+ PtProcessEvent();
+ if( input_available() )
+ {
+ PtSetResource( gui_ph_timer_timeout, Pt_ARG_TIMER_INITIAL, 0, 0 );
+ return( OK );
+ }
+ else if( is_timeout == TRUE )
+ return( FAIL );
+ }
+}
+
+#if defined( FEAT_BROWSE ) || defined( PROTO )
+/*
+ * Put up a file requester.
+ * Returns the selected name in allocated memory, or NULL for Cancel.
+ * saving, select file to write
+ * title title for the window
+ * default_name default name (well duh!)
+ * ext not used (extension added)
+ * initdir initial directory, NULL for current dir
+ * filter not used (file name filter)
+ */
+ char_u *
+gui_mch_browse(
+ int saving,
+ char_u *title,
+ char_u *default_name,
+ char_u *ext,
+ char_u *initdir,
+ char_u *filter)
+{
+ PtFileSelectionInfo_t file;
+ int flags;
+ char_u *default_path;
+ char_u *open_text = NULL;
+
+ flags = 0;
+ memset( &file, 0, sizeof( file ) );
+
+ default_path = alloc( MAXPATHL + 1 + NAME_MAX + 1 );
+ if( default_path != NULL )
+ {
+ if( saving == TRUE )
+ {
+ /* Don't need Pt_FSR_CONFIRM_EXISTING, vim will ask anyway */
+ flags |= Pt_FSR_NO_FCHECK;
+ open_text = "&Save";
+ }
+
+ /* combine the directory and filename into a single path */
+ if( initdir == NULL || *initdir == NUL )
+ {
+ mch_dirname( default_path, MAXPATHL );
+ initdir = default_path;
+ }
+ else
+ {
+ STRCPY( default_path, initdir );
+ initdir = default_path;
+ }
+
+ if( default_name != NULL )
+ {
+ if( default_path[ STRLEN( default_path ) - 1 ] != '/' )
+ STRCAT( default_path, "/" );
+
+ STRCAT( default_path, default_name );
+ }
+
+ /* TODO: add a filter? */
+ PtFileSelection(
+ gui.vimWindow,
+ NULL,
+ title,
+ default_path,
+ NULL,
+ open_text,
+ NULL,
+ NULL,
+ &file,
+ flags );
+
+ vim_free( default_path );
+
+ if( file.ret == Pt_FSDIALOG_BTN1 )
+ return( vim_strsave( file.path ) );
+ }
+ return( NULL );
+}
+#endif
+
+#if defined( FEAT_GUI_DIALOG ) || defined( PROTO )
+static PtWidget_t *gui_ph_dialog_text = NULL;
+
+ static int
+gui_ph_dialog_close( int button, void *data )
+{
+ PtModalCtrl_t *modal_ctrl = data;
+ char_u *dialog_text, *vim_text;
+
+ if( gui_ph_dialog_text != NULL )
+ {
+ PtGetResource( gui_ph_dialog_text, Pt_ARG_TEXT_STRING, &dialog_text, 0 );
+ PtGetResource( gui_ph_dialog_text, Pt_ARG_POINTER, &vim_text, 0 );
+ STRNCPY( vim_text, dialog_text, IOSIZE - 1 );
+ }
+
+ PtModalUnblock( modal_ctrl, (void *) button );
+
+ return( Pt_TRUE );
+}
+
+ static int
+gui_ph_dialog_text_enter( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ if( info->reason_subtype == Pt_EDIT_ACTIVATE )
+ gui_ph_dialog_close( 1, data );
+ return( Pt_CONTINUE );
+}
+
+ static int
+gui_ph_dialog_esc( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
+{
+ PhKeyEvent_t *key;
+
+ key = PhGetData( info->event );
+ if( ( key->key_flags & Pk_KF_Cap_Valid ) && ( key->key_cap == Pk_Escape ) )
+ {
+ gui_ph_dialog_close( 0, data );
+ return( Pt_CONSUME );
+ }
+ return( Pt_PROCESS );
+}
+
+ int
+gui_mch_dialog(
+ int type,
+ char_u *title,
+ char_u *message,
+ char_u *buttons,
+ int default_button,
+ char_u *textfield)
+{
+ char_u *str;
+ char_u **button_array;
+ char_u *buttons_copy;
+
+ int button_count;
+ int i, len;
+ int dialog_result = -1;
+
+ /* FIXME: the vertical option in guioptions is blatantly ignored */
+ /* FIXME: so is the type */
+
+ button_count = len = i = 0;
+
+ if( buttons == NULL || *buttons == NUL )
+ return( -1 );
+
+ /* There is one less separator than buttons, so bump up the button count */
+ button_count = 1;
+
+ /* Count string length and number of seperators */
+ for( str = buttons; *str; str++ )
+ {
+ len++;
+ if( *str == DLG_BUTTON_SEP )
+ button_count++;
+ }
+
+ if ( title == NULL )
+ title = "Vim";
+
+ buttons_copy = alloc( len + 1 );
+ button_array = (char_u **) alloc( button_count * sizeof( char_u * ) );
+ if( buttons_copy != NULL && button_array != NULL )
+ {
+ STRCPY( buttons_copy, buttons );
+
+ /*
+ * Convert DLG_BUTTON_SEP into NUL's and fill in
+ * button_array with the pointer to each NUL terminated string
+ */
+ str = buttons_copy;
+ for( i = 0; i < button_count; i++ )
+ {
+ button_array[ i ] = str;
+ for( ; *str; str++ )
+ {
+ if( *str == DLG_BUTTON_SEP )
+ {
+ *str++ = NUL;
+ break;
+ }
+ }
+ }
+#ifndef FEAT_GUI_TEXTDIALOG
+ dialog_result = PtAlert(
+ gui.vimWindow, NULL,
+ title,
+ NULL,
+ message, NULL,
+ button_count, (const char **) button_array, NULL,
+ default_button, 0, Pt_MODAL );
+#else
+ /* Writing the dialog ourselves lets us add extra features, like
+ * trapping the escape key and returning 0 to vim */
+ {
+ int n;
+ PtArg_t args[5];
+ PtWidget_t *dialog, *pane;
+ PtModalCtrl_t modal_ctrl;
+ PtDialogInfo_t di;
+
+ memset( &di, 0, sizeof( di ) );
+ memset( &modal_ctrl, 0, sizeof( modal_ctrl ) );
+
+ n = 0;
+ PtSetArg( &args[n++], Pt_ARG_GROUP_ROWS_COLS, 0, 0 );
+ PtSetArg( &args[n++], Pt_ARG_WIDTH, 350, 0 );
+ PtSetArg( &args[n++], Pt_ARG_GROUP_ORIENTATION,
+ Pt_GROUP_VERTICAL, 0 );
+ PtSetArg( &args[n++], Pt_ARG_GROUP_FLAGS,
+ Pt_TRUE, Pt_GROUP_NO_KEYS | Pt_GROUP_STRETCH_HORIZONTAL );
+ PtSetArg( &args[n++], Pt_ARG_CONTAINER_FLAGS, Pt_FALSE, Pt_TRUE );
+ pane = PtCreateWidget( PtGroup, NULL, n, args );
+
+ n = 0;
+ PtSetArg( &args[n++], Pt_ARG_TEXT_STRING, message, 0 );
+ PtCreateWidget( PtLabel, pane, n, args );
+
+ if( textfield != NULL )
+ {
+ n = 0;
+ PtSetArg( &args[n++], Pt_ARG_MAX_LENGTH, IOSIZE - 1, 0 );
+ PtSetArg( &args[n++], Pt_ARG_TEXT_STRING, textfield, 0 );
+ PtSetArg( &args[n++], Pt_ARG_POINTER, textfield, 0 );
+ gui_ph_dialog_text = PtCreateWidget( PtText, pane, n, args );
+ PtAddCallback( gui_ph_dialog_text, Pt_CB_ACTIVATE,
+ gui_ph_dialog_text_enter, &modal_ctrl );
+ }
+
+ di.parent = gui.vimWindow;
+ di.pane = pane;
+ di.title = title;
+ di.buttons = (const char **) button_array;
+ di.nbtns = button_count;
+ di.def_btn = default_button;
+ /* This is just to give the dialog the close button.
+ * We check for the Escape key ourselves and return 0 */
+ di.esc_btn = button_count;
+ di.callback = gui_ph_dialog_close;
+ di.data = &modal_ctrl;
+
+ dialog = PtCreateDialog( &di );
+ PtAddFilterCallback( dialog, Ph_EV_KEY,
+ gui_ph_dialog_esc, &modal_ctrl );
+
+ if( gui_ph_dialog_text != NULL )
+ PtGiveFocus( gui_ph_dialog_text, NULL );
+
+ /* Open dialog, block the vim window and wait for the dialog to close */
+ PtRealizeWidget( dialog );
+ PtMakeModal( dialog, Ph_CURSOR_NOINPUT, Ph_CURSOR_DEFAULT_COLOR );
+ dialog_result = (int) PtModalBlock( &modal_ctrl, 0 );
+
+ PtDestroyWidget( dialog );
+ gui_ph_dialog_text = NULL;
+ }
+#endif
+ }
+
+ vim_free( button_array );
+ vim_free( buttons_copy );
+
+ return( dialog_result );
+}
+#endif
+/****************************************************************************/
+/* window size/position/state */
+
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ PhPoint_t *pos;
+
+ pos = PtWidgetPos( gui.vimWindow, NULL );
+
+ *x = pos->x;
+ *y = pos->y;
+
+ return( OK );
+}
+
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ PhPoint_t pos = { x, y };
+
+ PtSetResource( gui.vimWindow, Pt_ARG_POS, &pos, 0 );
+}
+
+ void
+gui_mch_set_shellsize(int width, int height,
+ int min_width, int min_height, int base_width, int base_height)
+{
+ PhDim_t window_size = { width, height };
+ PhDim_t min_size = { min_width, min_height };
+
+#ifdef USE_PANEL_GROUP
+ window_size.w += pg_margin_left + pg_margin_right;
+ window_size.h += pg_margin_top + pg_margin_bottom;
+#endif
+
+ PtSetResource( gui.vimWindow, Pt_ARG_MINIMUM_DIM, &min_size, 0 );
+ PtSetResource( gui.vimWindow, Pt_ARG_DIM, &window_size, 0 );
+
+ if( ! PtWidgetIsRealized( gui.vimWindow ) )
+ gui_ph_resize_container();
+}
+
+/*
+ * Return the amount of screen space that hasn't been allocated (such as
+ * by the shelf).
+ */
+ void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+ PhRect_t console;
+
+ PhWindowQueryVisible( Ph_QUERY_WORKSPACE, 0,
+ PhInputGroup( NULL ), &console );
+
+ *screen_w = console.lr.x - console.ul.x + 1;
+ *screen_h = console.lr.y - console.ul.y + 1;
+}
+
+ void
+gui_mch_iconify(void)
+{
+ PhWindowEvent_t event;
+
+ memset( &event, 0, sizeof (event) );
+ event.event_f = Ph_WM_HIDE;
+ event.event_state = Ph_WM_EVSTATE_HIDE;
+ event.rid = PtWidgetRid( gui.vimWindow );
+ PtForwardWindowEvent( &event );
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ PhWindowEvent_t event;
+
+ memset( &event, 0, sizeof (event) );
+ event.event_f = Ph_WM_TOFRONT;
+ event.event_state = Ph_WM_EVSTATE_FFRONT;
+ event.rid = PtWidgetRid( gui.vimWindow );
+ PtForwardWindowEvent( &event );
+}
+#endif
+
+ void
+gui_mch_settitle(char_u *title, char_u *icon)
+{
+#ifdef USE_PANEL_GROUP
+ gui_ph_pg_set_buffer_num( curwin->w_buffer->b_fnum );
+#endif
+ PtSetResource( gui.vimWindow, Pt_ARG_WINDOW_TITLE, title, 0 );
+ /* Not sure what to do with the icon text, set balloon text somehow? */
+}
+
+/****************************************************************************/
+/* Scrollbar */
+
+ void
+gui_mch_set_scrollbar_thumb(scrollbar_T *sb, int val, int size, int max)
+{
+ int n = 0;
+ PtArg_t args[3];
+
+ PtSetArg( &args[ n++ ], Pt_ARG_MAXIMUM, max, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_SLIDER_SIZE, size, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_GAUGE_VALUE, val, 0 );
+ PtSetResources( sb->id, n, args );
+}
+
+ void
+gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)
+{
+ PhArea_t area = {{ x, y }, { w, h }};
+
+ PtSetResource( sb->id, Pt_ARG_AREA, &area, 0 );
+}
+
+ void
+gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
+{
+ int n = 0;
+/* int anchor_flags = 0;*/
+ PtArg_t args[4];
+
+ /*
+ * Stop the scrollbar from being realized when the parent
+ * is realized, so it can be explicitly realized by vim.
+ *
+ * Also, don't let the scrollbar get focus
+ */
+ PtSetArg( &args[ n++ ], Pt_ARG_FLAGS, Pt_DELAY_REALIZE,
+ Pt_DELAY_REALIZE | Pt_GETS_FOCUS );
+ PtSetArg( &args[ n++ ], Pt_ARG_SCROLLBAR_FLAGS, Pt_SCROLLBAR_SHOW_ARROWS, 0);
+#if 0
+ /* Don't need this anchoring for the scrollbars */
+ if( orient == SBAR_HORIZ )
+ {
+ anchor_flags = Pt_BOTTOM_ANCHORED_BOTTOM |
+ Pt_LEFT_ANCHORED_LEFT | Pt_RIGHT_ANCHORED_RIGHT;
+ }
+ else
+ {
+ anchor_flags = Pt_BOTTOM_ANCHORED_BOTTOM | Pt_TOP_ANCHORED_TOP;
+ if( sb->wp != NULL )
+ {
+ if( sb == &sb->wp->w_scrollbars[ SBAR_LEFT ] )
+ anchor_flags |= Pt_LEFT_ANCHORED_LEFT;
+ else
+ anchor_flags |= Pt_RIGHT_ANCHORED_RIGHT;
+ }
+ }
+ PtSetArg( &args[ n++ ], Pt_ARG_ANCHOR_FLAGS, anchor_flags, Pt_IS_ANCHORED );
+#endif
+ PtSetArg( &args[ n++ ], Pt_ARG_ORIENTATION,
+ (orient == SBAR_HORIZ) ? Pt_HORIZONTAL : Pt_VERTICAL, 0 );
+#ifdef USE_PANEL_GROUP
+ sb->id = PtCreateWidget( PtScrollbar, gui.vimPanelGroup, n, args );
+#else
+ sb->id = PtCreateWidget( PtScrollbar, gui.vimContainer, n, args );
+#endif
+
+ PtAddCallback( sb->id, Pt_CB_SCROLLBAR_MOVE, gui_ph_handle_scrollbar, sb );
+}
+
+ void
+gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
+{
+ if( flag != 0 )
+ PtRealizeWidget( sb->id );
+ else
+ PtUnrealizeWidget( sb->id );
+}
+
+ void
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
+{
+ PtDestroyWidget( sb->id );
+ sb->id = NULL;
+}
+
+/****************************************************************************/
+/* Mouse functions */
+
+#if defined(FEAT_MOUSESHAPE) || defined(PROTO)
+/* The last set mouse pointer shape is remembered, to be used when it goes
+ * from hidden to not hidden. */
+static int last_shape = 0;
+
+/* Table for shape IDs. Keep in sync with the mshape_names[] table in
+ * misc2.c! */
+static int mshape_ids[] =
+{
+ Ph_CURSOR_POINTER, /* arrow */
+ Ph_CURSOR_NONE, /* blank */
+ Ph_CURSOR_INSERT, /* beam */
+ Ph_CURSOR_DRAG_VERTICAL, /* updown */
+ Ph_CURSOR_DRAG_VERTICAL, /* udsizing */
+ Ph_CURSOR_DRAG_HORIZONTAL, /* leftright */
+ Ph_CURSOR_DRAG_HORIZONTAL, /* lrsizing */
+ Ph_CURSOR_WAIT, /* busy */
+ Ph_CURSOR_DONT, /* no */
+ Ph_CURSOR_CROSSHAIR, /* crosshair */
+ Ph_CURSOR_FINGER, /* hand1 */
+ Ph_CURSOR_FINGER, /* hand2 */
+ Ph_CURSOR_FINGER, /* pencil */
+ Ph_CURSOR_QUESTION_POINT, /* question */
+ Ph_CURSOR_POINTER, /* right-arrow */
+ Ph_CURSOR_POINTER, /* up-arrow */
+ Ph_CURSOR_POINTER /* last one */
+};
+
+ void
+mch_set_mouse_shape(shape)
+ int shape;
+{
+ int id;
+
+ if (!gui.in_use)
+ return;
+
+ if (shape == MSHAPE_HIDE || gui.pointer_hidden)
+ PtSetResource( gui.vimTextArea, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE,
+ 0 );
+ else
+ {
+ if (shape >= MSHAPE_NUMBERED)
+ id = Ph_CURSOR_POINTER;
+ else
+ id = mshape_ids[shape];
+
+ PtSetResource( gui.vimTextArea, Pt_ARG_CURSOR_TYPE, id, 0 );
+ }
+ if (shape != MSHAPE_HIDE)
+ last_shape = shape;
+}
+#endif
+
+ void
+gui_mch_mousehide(int hide)
+{
+ if( gui.pointer_hidden != hide )
+ {
+ gui.pointer_hidden = hide;
+#ifdef FEAT_MOUSESHAPE
+ if( hide )
+ PtSetResource( gui.vimTextArea, Pt_ARG_CURSOR_TYPE,
+ Ph_CURSOR_NONE, 0 );
+ else
+ mch_set_mouse_shape( last_shape );
+#else
+ PtSetResource( gui.vimTextArea, Pt_ARG_CURSOR_TYPE,
+ ( hide == MOUSE_SHOW ) ? GUI_PH_MOUSE_TYPE : Ph_CURSOR_NONE,
+ 0 );
+#endif
+ }
+}
+
+ int
+gui_mch_get_mouse_x(void)
+{
+ PhCursorInfo_t info;
+ short x, y;
+
+ /* FIXME: does this return the correct position,
+ * with respect to the border? */
+ PhQueryCursor( PhInputGroup( NULL ), &info );
+ PtGetAbsPosition( gui.vimTextArea , &x, &y );
+
+ return( info.pos.x - x );
+}
+
+ int
+gui_mch_get_mouse_y(void)
+{
+ PhCursorInfo_t info;
+ short x, y;
+
+ PhQueryCursor( PhInputGroup( NULL ), &info );
+ PtGetAbsPosition( gui.vimTextArea , &x, &y );
+ /* TODO: Add border offset? */
+ return( info.pos.y - y );
+}
+
+ void
+gui_mch_setmouse(int x, int y)
+{
+ short abs_x, abs_y;
+
+ PtGetAbsPosition( gui.vimTextArea, &abs_x, &abs_y );
+ /* Add the border offset? */
+ PhMoveCursorAbs( PhInputGroup( NULL ), abs_x + x, abs_y + y );
+}
+
+/****************************************************************************/
+/* Colours */
+
+/*
+ * Return the RGB value of a pixel as a long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ return PgRGB(PgRedValue(pixel), PgGreenValue(pixel), PgBlueValue(pixel));
+}
+
+ void
+gui_mch_new_colors(void)
+{
+#if 0 /* Don't bother changing the cursor colour */
+ short color_diff;
+
+ /*
+ * If there isn't enough difference between the background colour and
+ * the mouse pointer colour then change the mouse pointer colour
+ */
+ color_diff = gui_get_lightness(gui_ph_mouse_color)
+ - gui_get_lightness(gui.back_pixel);
+
+ if( abs( color_diff ) < 64 )
+ {
+ short r, g, b;
+ /* not a great algorithm... */
+ r = PgRedValue( gui_ph_mouse_color ) ^ 255;
+ g = PgGreenValue( gui_ph_mouse_color ) ^ 255;
+ b = PgBlueValue( gui_ph_mouse_color ) ^ 255;
+
+#ifndef FEAT_MOUSESHAPE
+ gui_ph_mouse_color = PgRGB( r, g, b );
+ PtSetResource( gui.vimTextArea, Pt_ARG_CURSOR_COLOR,
+ gui_ph_mouse_color, 0 );
+#endif
+ }
+#endif
+
+ PtSetResource( gui.vimTextArea, Pt_ARG_FILL_COLOR, gui.back_pixel, 0 );
+}
+
+ static int
+hex_digit(int c)
+{
+ if (VIM_ISDIGIT(c))
+ return( c - '0' );
+ c = TOLOWER_ASC(c);
+ if (c >= 'a' && c <= 'f')
+ return( c - 'a' + 10 );
+ return( -1000 );
+}
+
+
+/*
+ * This should be split out into a seperate file,
+ * every port does basically the same thing.
+ *
+ * This is the gui_w32.c version (i think..)
+ * Return INVALCOLOR when failed.
+ */
+
+ guicolor_T
+gui_mch_get_color(char_u *name)
+{
+ int i;
+ int r, g, b;
+
+
+ typedef struct GuiColourTable
+ {
+ char *name;
+ guicolor_T colour;
+ } GuiColourTable;
+
+ static GuiColourTable table[] =
+ {
+ {"Black", RGB(0x00, 0x00, 0x00)},
+ {"DarkGray", RGB(0x80, 0x80, 0x80)},
+ {"DarkGrey", RGB(0x80, 0x80, 0x80)},
+ {"Gray", RGB(0xC0, 0xC0, 0xC0)},
+ {"Grey", RGB(0xC0, 0xC0, 0xC0)},
+ {"LightGray", RGB(0xD3, 0xD3, 0xD3)},
+ {"LightGrey", RGB(0xD3, 0xD3, 0xD3)},
+ {"White", RGB(0xFF, 0xFF, 0xFF)},
+ {"DarkRed", RGB(0x80, 0x00, 0x00)},
+ {"Red", RGB(0xFF, 0x00, 0x00)},
+ {"LightRed", RGB(0xFF, 0xA0, 0xA0)},
+ {"DarkBlue", RGB(0x00, 0x00, 0x80)},
+ {"Blue", RGB(0x00, 0x00, 0xFF)},
+ {"LightBlue", RGB(0xA0, 0xA0, 0xFF)},
+ {"DarkGreen", RGB(0x00, 0x80, 0x00)},
+ {"Green", RGB(0x00, 0xFF, 0x00)},
+ {"LightGreen", RGB(0xA0, 0xFF, 0xA0)},
+ {"DarkCyan", RGB(0x00, 0x80, 0x80)},
+ {"Cyan", RGB(0x00, 0xFF, 0xFF)},
+ {"LightCyan", RGB(0xA0, 0xFF, 0xFF)},
+ {"DarkMagenta", RGB(0x80, 0x00, 0x80)},
+ {"Magenta", RGB(0xFF, 0x00, 0xFF)},
+ {"LightMagenta", RGB(0xFF, 0xA0, 0xFF)},
+ {"Brown", RGB(0x80, 0x40, 0x40)},
+ {"Yellow", RGB(0xFF, 0xFF, 0x00)},
+ {"LightYellow", RGB(0xFF, 0xFF, 0xA0)},
+ {"SeaGreen", RGB(0x2E, 0x8B, 0x57)},
+ {"Orange", RGB(0xFF, 0xA5, 0x00)},
+ {"Purple", RGB(0xA0, 0x20, 0xF0)},
+ {"SlateBlue", RGB(0x6A, 0x5A, 0xCD)},
+ {"Violet", RGB(0xEE, 0x82, 0xEE)},
+ };
+
+ /* is name #rrggbb format? */
+ if( name[0] == '#' && STRLEN( name ) == 7 )
+ {
+ r = hex_digit( name[1] ) * 16 + hex_digit( name[2] );
+ g = hex_digit( name[3] ) * 16 + hex_digit( name[4] );
+ b = hex_digit( name[5] ) * 16 + hex_digit( name[6] );
+ if( r < 0 || g < 0 || b < 0 )
+ return INVALCOLOR;
+ return( RGB( r, g, b ) );
+ }
+
+ for( i = 0; i < ARRAY_LENGTH( table ); i++ )
+ {
+ if( STRICMP( name, table[i].name ) == 0 )
+ return( table[i].colour );
+ }
+
+ /*
+ * Last attempt. Look in the file "$VIMRUNTIME/rgb.txt".
+ */
+ {
+#define LINE_LEN 100
+ FILE *fd;
+ char line[LINE_LEN];
+ char_u *fname;
+
+ fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
+ if (fname == NULL)
+ return INVALCOLOR;
+
+ fd = fopen((char *)fname, "rt");
+ vim_free(fname);
+ if (fd == NULL)
+ return INVALCOLOR;
+
+ while (!feof(fd))
+ {
+ int len;
+ int pos;
+ char *color;
+
+ fgets(line, LINE_LEN, fd);
+ len = STRLEN(line);
+
+ if (len <= 1 || line[len-1] != '\n')
+ continue;
+
+ line[len-1] = '\0';
+
+ i = sscanf(line, "%d %d %d %n", &r, &g, &b, &pos);
+ if (i != 3)
+ continue;
+
+ color = line + pos;
+
+ if (STRICMP(color, name) == 0)
+ {
+ fclose(fd);
+ return( (guicolor_T) RGB(r,g,b) );
+ }
+ }
+
+ fclose(fd);
+ }
+
+
+ return INVALCOLOR;
+}
+
+ void
+gui_mch_set_fg_color(guicolor_T color)
+{
+ PgSetTextColor( color );
+}
+
+ void
+gui_mch_set_bg_color(guicolor_T color)
+{
+ PgSetFillColor( color );
+}
+
+ void
+gui_mch_invert_rectangle(int row, int col, int nr, int nc)
+{
+ PhRect_t rect;
+
+ rect.ul.x = FILL_X( col );
+ rect.ul.y = FILL_Y( row );
+
+ /* FIXME: This has an off by one pixel problem */
+ rect.lr.x = rect.ul.x + nc * gui.char_width;
+ rect.lr.y = rect.ul.y + nr * gui.char_height;
+ if( nc > 0 )
+ rect.lr.x -= 1;
+ if( nr > 0 )
+ rect.lr.y -= 1;
+
+ DRAW_START;
+ PgSetDrawMode( Pg_DrawModeDSTINVERT );
+ PgDrawRect( &rect, Pg_DRAW_FILL );
+ PgSetDrawMode( Pg_DrawModeSRCCOPY );
+ DRAW_END;
+}
+
+ void
+gui_mch_clear_block(int row1, int col1, int row2, int col2)
+{
+ PhRect_t block = {
+ { FILL_X( col1 ), FILL_Y( row1 ) },
+ { FILL_X( col2 + 1 ) - 1, FILL_Y( row2 + 1 ) - 1}
+ };
+
+ DRAW_START;
+ gui_mch_set_bg_color( gui.back_pixel );
+ PgDrawRect( &block, Pg_DRAW_FILL );
+ DRAW_END;
+}
+
+ void
+gui_mch_clear_all()
+{
+ PhRect_t text_rect = {
+ { gui.border_width, gui.border_width },
+ { Columns * gui.char_width + gui.border_width - 1 ,
+ Rows * gui.char_height + gui.border_width - 1 }
+ };
+
+ if( is_ignore_draw == TRUE )
+ return;
+
+ DRAW_START;
+ gui_mch_set_bg_color( gui.back_pixel );
+ PgDrawRect( &text_rect, Pg_DRAW_FILL );
+ DRAW_END;
+}
+
+ void
+gui_mch_delete_lines(int row, int num_lines)
+{
+ PhRect_t rect;
+ PhPoint_t delta;
+
+ rect.ul.x = FILL_X( gui.scroll_region_left );
+ rect.ul.y = FILL_Y( row + num_lines );
+
+ rect.lr.x = FILL_X( gui.scroll_region_right + 1 ) - 1;
+ rect.lr.y = FILL_Y( gui.scroll_region_bot + 1) - 1;
+
+ PtWidgetOffset( gui.vimTextArea, &gui_ph_raw_offset );
+ PhTranslatePoint( &gui_ph_raw_offset, PtWidgetPos(gui.vimTextArea, NULL));
+ PhTranslateRect( &rect, &gui_ph_raw_offset );
+
+ delta.x = 0;
+ delta.y = -num_lines * gui.char_height;
+
+ PgFlush();
+
+ PhBlit( PtWidgetRid( PtFindDisjoint( gui.vimTextArea ) ), &rect, &delta );
+
+ gui_clear_block(
+ gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot,
+ gui.scroll_region_right );
+}
+
+ void
+gui_mch_insert_lines(int row, int num_lines)
+{
+ PhRect_t rect;
+ PhPoint_t delta;
+
+ rect.ul.x = FILL_X( gui.scroll_region_left );
+ rect.ul.y = FILL_Y( row );
+
+ rect.lr.x = FILL_X( gui.scroll_region_right + 1 ) - 1;
+ rect.lr.y = FILL_Y( gui.scroll_region_bot - num_lines + 1 ) - 1;
+
+ PtWidgetOffset( gui.vimTextArea, &gui_ph_raw_offset );
+ PhTranslatePoint( &gui_ph_raw_offset, PtWidgetPos( gui.vimTextArea, NULL ) );
+ PhTranslateRect( &rect, &gui_ph_raw_offset );
+
+ delta.x = 0;
+ delta.y = num_lines * gui.char_height;
+
+ PgFlush();
+
+ PhBlit( PtWidgetRid( PtFindDisjoint( gui.vimTextArea ) ) , &rect, &delta );
+
+ gui_clear_block( row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right );
+}
+
+ void
+gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+ static char *utf8_buffer = NULL;
+ static int utf8_len = 0;
+
+ PhPoint_t pos = { TEXT_X( col ), TEXT_Y( row ) };
+ PhRect_t rect;
+
+ if( is_ignore_draw == TRUE )
+ return;
+
+ DRAW_START;
+
+ if( !( flags & DRAW_TRANSP ) )
+ {
+ PgDrawIRect(
+ FILL_X( col ), FILL_Y( row ),
+ FILL_X( col + len ) - 1, FILL_Y( row + 1 ) - 1,
+ Pg_DRAW_FILL );
+ }
+
+ if( flags & DRAW_UNDERL )
+ PgSetUnderline( gui.norm_pixel, Pg_TRANSPARENT, 0 );
+
+ if( charset_translate != NULL
+#ifdef FEAT_MBYTE
+ && enc_utf8 == 0
+#endif
+ )
+ {
+ int src_taken, dst_made;
+
+ /* Use a static buffer to avoid large amounts of de/allocations */
+ if( utf8_len < len )
+ {
+ utf8_buffer = realloc( utf8_buffer, len * MB_LEN_MAX );
+ utf8_len = len;
+ }
+
+ PxTranslateToUTF(
+ charset_translate,
+ s,
+ len,
+ &src_taken,
+ utf8_buffer,
+ utf8_len,
+ &dst_made );
+ s = utf8_buffer;
+ len = dst_made;
+ }
+
+ PgDrawText( s, len, &pos, 0 );
+
+ if( flags & DRAW_BOLD )
+ {
+ /* FIXME: try and only calculate these values once... */
+ rect.ul.x = FILL_X( col ) + 1;
+ rect.ul.y = FILL_Y( row );
+ rect.lr.x = FILL_X( col + len ) - 1;
+ rect.lr.y = FILL_Y( row + 1) - 1;
+ /* PgSetUserClip( NULL ) causes the scrollbar to not redraw... */
+#if 0
+ pos.x++;
+
+ PgSetUserClip( &rect );
+ PgDrawText( s, len, &pos, 0 );
+ PgSetUserClip( NULL );
+#else
+ rect.lr.y -= ( p_linespace + 1 ) / 2;
+ /* XXX: DrawTextArea doesn't work with phditto */
+ PgDrawTextArea( s, len, &rect, Pg_TEXT_BOTTOM );
+#endif
+ }
+
+ if( flags & DRAW_UNDERL )
+ PgSetUnderline( Pg_TRANSPARENT, Pg_TRANSPARENT, 0 );
+
+ DRAW_END;
+}
+
+/****************************************************************************/
+/* Cursor */
+
+ void
+gui_mch_draw_hollow_cursor(guicolor_T color)
+{
+ PhRect_t r;
+
+ /* FIXME: Double width characters */
+
+ r.ul.x = FILL_X( gui.col );
+ r.ul.y = FILL_Y( gui.row );
+ r.lr.x = r.ul.x + gui.char_width - 1;
+ r.lr.y = r.ul.y + gui.char_height - 1;
+
+ DRAW_START;
+ PgSetStrokeColor( color );
+ PgDrawRect( &r, Pg_DRAW_STROKE );
+ DRAW_END;
+}
+
+ void
+gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
+{
+ PhRect_t r;
+
+ r.ul.x = FILL_X( gui.col );
+ r.ul.y = FILL_Y( gui.row ) + gui.char_height - h;
+ r.lr.x = r.ul.x + w - 1;
+ r.lr.y = r.ul.y + h - 1;
+
+ DRAW_START;
+ gui_mch_set_bg_color( color );
+ PgDrawRect( &r, Pg_DRAW_FILL );
+ DRAW_END;
+}
+
+ void
+gui_mch_set_blinking(long wait, long on, long off)
+{
+ blink_waittime = wait;
+ blink_ontime = on;
+ blink_offtime = off;
+}
+
+ void
+gui_mch_start_blink(void)
+{
+ /* Only turn on the timer on if none of the times are zero */
+ if( blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
+ {
+ PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
+ blink_waittime, 0 );
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }
+}
+
+ void
+gui_mch_stop_blink(void)
+{
+ PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL, 0, 0 );
+
+ if( blink_state == BLINK_OFF )
+ gui_update_cursor(TRUE, FALSE);
+
+ blink_state = BLINK_NONE;
+}
+
+/****************************************************************************/
+/* miscellaneous functions */
+
+ void
+gui_mch_beep(void)
+{
+ PtBeep();
+}
+
+ void
+gui_mch_flash(int msec)
+{
+ PgSetFillXORColor( Pg_BLACK, Pg_WHITE );
+ PgSetDrawMode( Pg_DRAWMODE_XOR );
+ gui_mch_clear_all();
+ gui_mch_flush();
+
+ ui_delay( (long) msec, TRUE );
+
+ gui_mch_clear_all();
+ PgSetDrawMode( Pg_DRAWMODE_OPAQUE );
+ gui_mch_flush();
+}
+
+ void
+gui_mch_flush(void)
+{
+ PgFlush();
+}
+
+ void
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
+{
+ PhArea_t area = {{x, y}, {w, h}};
+
+ PtSetResource( gui.vimTextArea, Pt_ARG_AREA, &area, 0 );
+}
+
+ int
+gui_mch_haskey(char_u *name)
+{
+ int i;
+
+ for (i = 0; special_keys[i].key_sym != 0; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return( OK );
+ return( FAIL );
+}
+
+/****************************************************************************/
+/* Menu */
+
+#ifdef FEAT_TOOLBAR
+#include "toolbar.phi"
+
+static PhImage_t *gui_ph_toolbar_images[] = {
+ &tb_new_phi,
+ &tb_open_phi,
+ &tb_save_phi,
+ &tb_undo_phi,
+ &tb_redo_phi,
+ &tb_cut_phi,
+ &tb_copy_phi,
+ &tb_paste_phi,
+ &tb_print_phi,
+ &tb_help_phi,
+ &tb_find_phi,
+ &tb_save_all_phi,
+ &tb_save_session_phi,
+ &tb_new_session_phi,
+ &tb_load_session_phi,
+ &tb_macro_phi,
+ &tb_replace_phi,
+ &tb_close_phi,
+ &tb_maximize_phi,
+ &tb_minimize_phi,
+ &tb_split_phi,
+ &tb_shell_phi,
+ &tb_find_prev_phi,
+ &tb_find_next_phi,
+ &tb_find_help_phi,
+ &tb_make_phi,
+ &tb_jump_phi,
+ &tb_ctags_phi,
+ &tb_vsplit_phi,
+ &tb_maxwidth_phi,
+ &tb_minwidth_phi
+};
+
+static PhImage_t *
+gui_ph_toolbar_load_icon( char_u *iconfile )
+{
+ static PhImage_t external_icon;
+ PhImage_t *temp_phi = NULL;
+
+ temp_phi = PxLoadImage( iconfile, NULL );
+ if( temp_phi != NULL )
+ {
+ /* The label widget will free the image/palette/etc. for us when
+ * it's destroyed */
+ temp_phi->flags |= Ph_RELEASE_IMAGE_ALL;
+ memcpy( &external_icon, temp_phi, sizeof( external_icon ) );
+ free( temp_phi );
+
+ temp_phi = &external_icon;
+ }
+ return( temp_phi );
+}
+
+/*
+ * This returns either a builtin icon image, an external image or NULL
+ * if it can't find either. The caller can't and doesn't need to try and
+ * free() the returned image, and it can't store the image pointer.
+ * (When setting the Pt_ARG_LABEL_IMAGE resource, the contents of the
+ * PhImage_t are copied, and the original PhImage_t aren't needed anymore).
+ */
+static PhImage_t *
+gui_ph_toolbar_find_icon( vimmenu_T *menu )
+{
+ char_u full_pathname[ MAXPATHL + 1 ];
+ PhImage_t *icon = NULL;
+
+ if( menu->icon_builtin == FALSE )
+ {
+ if( menu->iconfile != NULL )
+ /* TODO: use gui_find_iconfile() */
+ icon = gui_ph_toolbar_load_icon( menu->iconfile );
+
+ /* TODO: Restrict loading to just .png? Search for any format? */
+ if( ( icon == NULL ) &&
+ ( ( gui_find_bitmap( menu->name, full_pathname, "gif" ) == OK ) ||
+ ( gui_find_bitmap( menu->name, full_pathname, "png" ) == OK ) ) )
+ icon = gui_ph_toolbar_load_icon( full_pathname );
+
+ if( icon != NULL )
+ return( icon );
+ }
+
+ if( menu->iconidx >= 0 &&
+ ( menu->iconidx < ARRAY_LENGTH( gui_ph_toolbar_images ) ) )
+ {
+ return( gui_ph_toolbar_images[ menu->iconidx ] );
+ }
+
+ return( NULL );
+}
+#endif
+
+#if defined( FEAT_MENU ) || defined( PROTO )
+ void
+gui_mch_enable_menu(int flag)
+{
+ if( flag != 0 )
+ PtRealizeWidget( gui.vimMenuBar );
+ else
+ PtUnrealizeWidget( gui.vimMenuBar );
+}
+
+ void
+gui_mch_set_menu_pos(int x, int y, int w, int h)
+{
+ /* Nothing */
+}
+
+/* Change the position of a menu button in the parent */
+ static void
+gui_ph_position_menu( PtWidget_t *widget, int priority )
+{
+ PtWidget_t *traverse;
+ vimmenu_T *menu;
+
+ traverse = PtWidgetChildBack( PtWidgetParent( widget ) );
+
+ /* Iterate through the list of widgets in traverse, until
+ * we find the position we want to insert our widget into */
+ /* TODO: traverse from front to back, possible speedup? */
+ while( traverse != NULL )
+ {
+ PtGetResource( traverse, Pt_ARG_POINTER, &menu, 0 );
+
+ if( menu != NULL &&
+ priority < menu->priority &&
+ widget != traverse )
+ {
+ /* Insert the widget before the current traverse widget */
+ PtWidgetInsert( widget, traverse, 1 );
+ return;
+ }
+
+ traverse = PtWidgetBrotherInFront( traverse );
+ }
+}
+
+/* the index is ignored because it's not useful for our purposes */
+ void
+gui_mch_add_menu(vimmenu_T *menu, int index)
+{
+ vimmenu_T *parent = menu->parent;
+ char_u *accel_key;
+ char_u mnemonic_str[MB_LEN_MAX];
+ int n;
+ PtArg_t args[5];
+
+ menu->submenu_id = menu->id = NULL;
+
+ if( menu_is_menubar( menu->name ) )
+ {
+
+ accel_key = vim_strchr( menu->name, '&' );
+ if( accel_key != NULL )
+ {
+ mnemonic_str[0] = accel_key[1];
+ mnemonic_str[1] = NUL;
+ }
+
+ /* Create the menu button */
+ n = 0;
+ PtSetArg( &args[ n++ ], Pt_ARG_TEXT_STRING, menu->dname, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_ACCEL_TEXT, menu->actext, 0 );
+ if( accel_key != NULL )
+ PtSetArg( &args[ n++ ], Pt_ARG_ACCEL_KEY, mnemonic_str, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_POINTER, menu, 0 );
+
+ if( parent != NULL )
+ PtSetArg( &args[ n++ ], Pt_ARG_BUTTON_TYPE, Pt_MENU_RIGHT, 0 );
+
+ menu->id = PtCreateWidget( PtMenuButton,
+ (parent == NULL) ? gui.vimMenuBar : parent->submenu_id,
+ n, args );
+
+ PtAddCallback( menu->id, Pt_CB_ARM, gui_ph_handle_pulldown_menu, menu );
+
+ /* Create the actual menu */
+ n = 0;
+ if( parent != NULL )
+ PtSetArg( &args[ n++ ], Pt_ARG_MENU_FLAGS, Pt_TRUE, Pt_MENU_CHILD );
+
+ menu->submenu_id = PtCreateWidget( PtMenu, menu->id, n, args );
+
+ if( parent == NULL )
+ {
+ PtAddCallback( menu->submenu_id, Pt_CB_UNREALIZED,
+ gui_ph_handle_menu_unrealized, menu );
+
+ if( menu->mnemonic != 0 )
+ {
+ PtAddHotkeyHandler( gui.vimWindow, tolower( menu->mnemonic ),
+ Pk_KM_Alt, 0, menu, gui_ph_handle_pulldown_menu );
+ }
+ }
+
+ gui_ph_position_menu( menu->id, menu->priority );
+
+ /* Redraw menubar here instead of gui_mch_draw_menubar */
+ if( gui.menu_is_active )
+ PtRealizeWidget( menu->id );
+ }
+ else if( menu_is_popup( menu->name ) )
+ {
+ menu->submenu_id = PtCreateWidget( PtMenu, gui.vimWindow, 0, NULL );
+ PtAddCallback( menu->submenu_id, Pt_CB_UNREALIZED,
+ gui_ph_handle_menu_unrealized, menu );
+ }
+}
+
+ void
+gui_mch_add_menu_item(vimmenu_T *menu, int index)
+{
+ vimmenu_T *parent = menu->parent;
+ char_u *accel_key;
+ char_u mnemonic_str[MB_LEN_MAX];
+ int n;
+ PtArg_t args[13];
+
+ n = 0;
+ PtSetArg( &args[ n++ ], Pt_ARG_POINTER, menu, 0 );
+
+#ifdef FEAT_TOOLBAR
+ if( menu_is_toolbar( parent->name ) )
+ {
+ if( menu_is_separator( menu->name ) )
+ {
+ PtSetArg( &args[ n++ ], Pt_ARG_SEP_FLAGS,
+ Pt_SEP_VERTICAL, Pt_SEP_ORIENTATION );
+ PtSetArg( &args[ n++ ], Pt_ARG_SEP_TYPE, Pt_ETCHED_IN, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_ANCHOR_FLAGS,
+ Pt_TRUE, Pt_ANCHOR_TOP_BOTTOM );
+ PtSetArg( &args[ n++ ], Pt_ARG_WIDTH, 2, 0 );
+ menu->id = PtCreateWidget( PtSeparator, gui.vimToolBar, n, args );
+ }
+ else
+ {
+ if( strstr( (const char *) p_toolbar, "text" ) != NULL )
+ {
+ PtSetArg( &args[ n++ ], Pt_ARG_BALLOON_POSITION,
+ Pt_BALLOON_BOTTOM, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_TEXT_STRING, menu->dname, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_TEXT_FONT, "TextFont08", 0 );
+ }
+ if( ( strstr( (const char *) p_toolbar, "icons" ) != NULL ) &&
+ ( gui_ph_toolbar_images != NULL ) )
+ {
+ PtSetArg( &args[ n++ ], Pt_ARG_LABEL_IMAGE,
+ gui_ph_toolbar_find_icon( menu ), 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_LABEL_TYPE, Pt_TEXT_IMAGE, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_TEXT_IMAGE_SPACING, 0, 0 );
+ }
+ if( strstr( (const char *) p_toolbar, "tooltips" ) != NULL )
+ {
+ PtSetArg( &args[ n++ ], Pt_ARG_LABEL_BALLOON,
+ gui_ph_show_tooltip, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_LABEL_FLAGS,
+ Pt_TRUE, Pt_SHOW_BALLOON );
+ }
+ PtSetArg( &args[ n++ ], Pt_ARG_MARGIN_HEIGHT, 1, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_MARGIN_WIDTH, 1, 0 );
+ PtSetArg( &args[ n++ ], Pt_ARG_FLAGS, Pt_FALSE,
+ Pt_HIGHLIGHTED | Pt_GETS_FOCUS );
+ PtSetArg( &args[ n++ ], Pt_ARG_FILL_COLOR, Pg_TRANSPARENT, 0 );
+ menu->id = PtCreateWidget( PtButton, gui.vimToolBar, n, args );
+
+ PtAddCallback( menu->id, Pt_CB_ACTIVATE, gui_ph_handle_menu, menu );
+ }
+ /* Update toolbar if it's open */
+ if( PtWidgetIsRealized( gui.vimToolBar ) )
+ PtRealizeWidget( menu->id );
+ }
+ else
+#endif
+ if( menu_is_separator( menu->name ) )
+ {
+ menu->id = PtCreateWidget( PtSeparator, parent->submenu_id, n, args );
+ }
+ else
+ {
+ accel_key = vim_strchr( menu->name, '&' );
+ if( accel_key != NULL )
+ {
+ mnemonic_str[0] = accel_key[1];
+ mnemonic_str[1] = NUL;
+ }
+
+ PtSetArg( &args[ n++ ], Pt_ARG_TEXT_STRING, menu->dname, 0 );
+ if( accel_key != NULL )
+ PtSetArg( &args[ n++ ], Pt_ARG_ACCEL_KEY, mnemonic_str,
+ 0 );
+
+ PtSetArg( &args[ n++ ], Pt_ARG_ACCEL_TEXT, menu->actext, 0 );
+
+ menu->id = PtCreateWidget( PtMenuButton, parent->submenu_id, n, args );
+
+ PtAddCallback( menu->id, Pt_CB_ACTIVATE, gui_ph_handle_menu, menu );
+
+#ifdef USE_PANEL_GROUP
+ if( gui_ph_is_buffer_item( menu, parent ) == TRUE )
+ {
+ PtAddCallback( menu->id, Pt_CB_DESTROYED,
+ gui_ph_handle_buffer_remove, menu );
+ gui_ph_pg_add_buffer( menu->dname );
+ }
+#endif
+ }
+
+ gui_ph_position_menu( menu->id, menu->priority );
+}
+
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+ if( menu->submenu_id != NULL )
+ PtDestroyWidget( menu->submenu_id );
+ if( menu->id != NULL )
+ PtDestroyWidget( menu->id );
+
+ menu->submenu_id = NULL;
+ menu->id = NULL;
+}
+
+ void
+gui_mch_menu_grey(vimmenu_T *menu, int grey)
+{
+ long flags, mask, fields;
+
+ if( menu->id == NULL )
+ return;
+
+ flags = PtWidgetFlags( menu->id );
+ if( PtWidgetIsClass( menu->id, PtMenuButton ) &&
+ PtWidgetIsClass( PtWidgetParent( menu->id ), PtMenu ) )
+ {
+ fields = Pt_FALSE;
+ mask = Pt_SELECTABLE | Pt_HIGHLIGHTED;
+ }
+ else
+ {
+ fields = Pt_TRUE;
+ mask = Pt_BLOCKED | Pt_GHOST;
+ }
+
+ if( ! grey )
+ fields = ~fields;
+
+ PtSetResource( menu->id, Pt_ARG_FLAGS, fields,
+ mask );
+}
+
+ void
+gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
+{
+ /* TODO: [un]realize the widget? */
+}
+
+ void
+gui_mch_draw_menubar(void)
+{
+ /* The only time a redraw is needed is when a menu button
+ * is added to the menubar, and that is detected and the bar
+ * redrawn in gui_mch_add_menu_item
+ */
+}
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+ PtSetResource( menu->submenu_id, Pt_ARG_POS, &abs_mouse, 0 );
+ PtRealizeWidget( menu->submenu_id );
+}
+
+ void
+gui_mch_toggle_tearoffs(int enable)
+{
+ /* No tearoffs yet */
+}
+
+#endif
+
+#if defined( FEAT_TOOLBAR ) || defined( PROTO )
+ void
+gui_mch_show_toolbar(int showit)
+{
+ if( showit )
+ PtRealizeWidget( gui.vimToolBar );
+ else
+ PtUnrealizeWidget( gui.vimToolBar );
+}
+#endif
+
+/****************************************************************************/
+/* Fonts */
+
+ static GuiFont
+gui_ph_get_font(
+ char_u *font_name,
+ int_u font_flags,
+ int_u font_size,
+ /* Check whether the resulting font has the font flags and size that
+ * was asked for */
+ int_u enforce
+ )
+{
+ char_u *font_tag;
+ FontQueryInfo info;
+ int_u style;
+
+ font_tag = alloc( MAX_FONT_TAG );
+ if( font_tag != NULL )
+ {
+ if( PfGenerateFontName( font_name, font_flags, font_size,
+ font_tag ) != NULL )
+ {
+ /* Enforce some limits on the font used */
+ style = PHFONT_INFO_FIXED;
+
+ if( enforce & PF_STYLE_BOLD )
+ style |= PHFONT_INFO_BOLD;
+ if( enforce & PF_STYLE_ANTIALIAS )
+ style |= PHFONT_INFO_ALIAS;
+ if( enforce & PF_STYLE_ITALIC )
+ style |= PHFONT_INFO_ITALIC;
+
+ PfQueryFontInfo( font_tag, &info );
+
+ if( info.size == 0 )
+ font_size = 0;
+
+ /* Make sure font size matches, and that the font style
+ * at least has the bits we're checking for */
+ if( font_size == info.size &&
+ style == (info.style & style) )
+ return( (GuiFont) font_tag );
+ }
+ vim_free( font_tag );
+ }
+ return( NULL );
+}
+
+/*
+ * Split up the vim font name
+ *
+ * vim_font is in the form of
+ * <name>:s<height>:a:b:i
+ *
+ * a = antialias
+ * b = bold
+ * i = italic
+ *
+ */
+
+ static int
+gui_ph_parse_font_name(
+ char_u *vim_font,
+ char_u **font_name,
+ int_u *font_flags,
+ int_u *font_size )
+{
+ char_u *mark;
+ int_u name_len, size;
+
+ mark = vim_strchr( vim_font, ':' );
+ if( mark == NULL )
+ name_len = STRLEN( vim_font );
+ else
+ name_len = (int_u) ( mark - vim_font );
+
+ *font_name = vim_strnsave( vim_font, name_len );
+ if( *font_name != NULL )
+ {
+ if( mark != NULL )
+ {
+ while( *mark != NUL && *mark++ == ':')
+ {
+ switch( tolower( *mark++ ) )
+ {
+ case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break;
+ case 'b': *font_flags |= PF_STYLE_BOLD; break;
+ case 'i': *font_flags |= PF_STYLE_ITALIC; break;
+
+ case 's':
+ size = getdigits( &mark );
+ /* Restrict the size to some vague limits */
+ if( size < 1 || size > 100 )
+ size = 8;
+
+ *font_size = size;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ return( TRUE );
+ }
+ return( FALSE );
+}
+
+ int
+gui_mch_init_font(char_u *vim_font_name, int fontset)
+{
+ char_u *font_tag;
+ char_u *font_name = NULL;
+ int_u font_flags = 0;
+ int_u font_size = 12;
+
+ FontQueryInfo info;
+ PhRect_t extent;
+
+ if( vim_font_name == NULL )
+ {
+ /* Default font */
+ vim_font_name = "PC Term";
+ }
+
+ if( STRCMP( vim_font_name, "*" ) == 0 )
+ {
+ font_tag = PtFontSelection( gui.vimWindow, NULL, NULL,
+ "pcterm12", -1, PHFONT_FIXED, NULL );
+
+ if( font_tag == NULL )
+ return( FAIL );
+
+ gui_mch_free_font( gui.norm_font );
+ gui.norm_font = font_tag;
+
+ PfQueryFontInfo( font_tag, &info );
+ font_name = vim_strsave( info.font );
+ }
+ else
+ {
+ if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
+ &font_size ) == FALSE )
+ return( FAIL );
+
+ font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
+ if( font_tag == NULL )
+ {
+ vim_free( font_name );
+ return( FAIL );
+ }
+ gui_mch_free_font( gui.norm_font );
+ gui.norm_font = font_tag;
+ }
+
+ gui_mch_free_font( gui.bold_font );
+ gui.bold_font = gui_ph_get_font( font_name, font_flags | PF_STYLE_BOLD,
+ font_size, PF_STYLE_BOLD );
+
+ gui_mch_free_font( gui.ital_font );
+ gui.ital_font = gui_ph_get_font( font_name, font_flags | PF_STYLE_ITALIC,
+ font_size, PF_STYLE_ITALIC );
+
+ /* This extent was brought to you by the letter 'g' */
+ PfExtentText( &extent, NULL, font_tag, "g", 1 );
+
+ gui.char_width = extent.lr.x - extent.ul.x + 1;
+ gui.char_height = (- extent.ul.y) + extent.lr.y + 1;
+ gui.char_ascent = - extent.ul.y;
+
+ vim_free( font_name );
+ return( OK );
+}
+
+ int
+gui_mch_adjust_charsize(void)
+{
+ FontQueryInfo info;
+
+ PfQueryFontInfo( gui.norm_font, &info );
+
+ gui.char_height = - info.ascender + info.descender + p_linespace;
+ gui.char_ascent = - info.ascender + p_linespace / 2;
+
+ return( OK );
+}
+
+ GuiFont
+gui_mch_get_font(char_u *vim_font_name, int report_error)
+{
+ char_u *font_name;
+ char_u *font_tag;
+ int_u font_size = 12;
+ int_u font_flags = 0;
+
+ if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
+ &font_size ) != FALSE )
+ {
+ font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 );
+ vim_free( font_name );
+
+ if( font_tag != NULL )
+ return( (GuiFont) font_tag );
+ }
+
+ if( report_error )
+ EMSG2(e_font, vim_font_name );
+
+ return( FAIL );
+}
+
+ void
+gui_mch_set_font(GuiFont font)
+{
+ PgSetFont( font );
+}
+
+ void
+gui_mch_free_font(GuiFont font)
+{
+ vim_free( font );
+}
+
diff --git a/src/gui_riscos.c b/src/gui_riscos.c
new file mode 100644
index 000000000..b823a79f8
--- /dev/null
+++ b/src/gui_riscos.c
@@ -0,0 +1,3547 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+#include <string.h>
+
+/*
+ * gui_riscos.c
+ *
+ * Thomas Leonard <tal197@ecs.soton.ac.uk>
+ * Updated by Andy Wingate <andy@sparse.net>
+ */
+
+extern int time_of_last_poll;
+
+int task_handle = 0; /* Zero means we are not yet a Wimp task */
+int child_handle = 0; /* Task handle of our child process (zero if none). */
+int *wimp_menu = (int *) -1; /* Pointer to a Wimp menu structure (or -1) */
+int save_window = -1; /* Save As window handle */
+
+int *redraw_block = NULL; /* NULL means not in a redraw loop. */
+int ro_return_early = FALSE; /* Break out of gui_mch_wait_for_chars() */
+
+int leaf_ref = 0; /* Wimp message number - send via Wimp$Scrap */
+char_u *leaf_name = NULL; /* Leaf name from DataSave */
+
+int default_columns = 120; /* These values are used if the --rows and --columns */
+int default_rows = 32; /* options aren't used on startup. */
+
+#define DRAG_FALSE 0
+#define DRAG_SELECTION 1
+#define DRAG_RESIZE_WINDOW 2
+int ro_dragging = DRAG_FALSE;
+int drag_button;
+int drag_modifiers;
+int drag_x_offset;
+int drag_y_offset;
+
+int nested_wimp = FALSE; /* Bool - can we use the new wimp? */
+
+int changed_mode = FALSE;
+int x_eigen_factor;
+int y_eigen_factor;
+
+/* If ro_current_font is non-zero then use the outline font with that handle,
+ * otherwise, if zap_redraw is TRUE then use ZapRedraw, otherwise use the
+ * system font.
+ *
+ * If zap_redraw is TRUE then zap_file[] contains valid Zap font file
+ * pointers (or NULLs).
+ */
+int ro_current_font = 0; /* 0 is system font, or ZapRedraw */
+int font_x_offset = 0; /* Where to position each char in its box */
+int font_y_offset = 0;
+
+int zap_redraw = FALSE;
+int double_height = FALSE; /* Plot each line twice? */
+
+#define grgb(r,g,b) ((b<<16) + (g<<8) + (r))
+#define UNUSED_COLOUR (gui.back_pixel)
+
+#define RO_LOAD_CLIPBOARD -2 /* Internal handle for DataSave message. */
+
+/* Changes by John Kortink, 22-23 July 1998
+ *
+ * Stuff to make redraw a lot faster. Almost all of it is right here below,
+ * elsewhere changes are marked with 'JK230798'. Apart from a small change in
+ * 'gui.c' all changes are limited to this file, 'gui_riscos.c'. The change in
+ * 'gui.c' is to make Vim stop being 'smart' not redrawing characters that are
+ * 'already there' (i.e. from the previous line, by coincidence). This caused a
+ * lot more calls to the redraw code, which we want to avoid because a few nice
+ * big strings at a time is a lot faster than a truckload of small ones. ('Dear
+ * Bram ...').
+ */
+
+/* The ZapRedraw structure */
+
+static struct
+{
+ int r_flags;
+ int r_minx;
+ int r_miny;
+ int r_maxx;
+ int r_maxy;
+ int r_screen;
+ int r_bpl;
+ int r_bpp;
+ int r_charw;
+ int r_charh;
+ char *r_caddr;
+ int r_cbpl;
+ int r_cbpc;
+ int r_linesp;
+ int r_data;
+ int r_scrollx;
+ int r_scrolly;
+ int *r_palette;
+ int r_for;
+ int r_bac;
+ char *r_workarea;
+ int r_magx;
+ int r_magy;
+ int r_xsize;
+ int r_ysize;
+ int r_mode;
+}
+zap_redraw_block;
+
+/* Other globals */
+
+static int zap_redraw_initialised = FALSE;
+static int zap_redraw_update_colours;
+static int zap_redraw_colours[2];
+static int zap_redraw_palette[16];
+
+/* Holds the current Zap font file(s).
+ * The font is recreated from this block on a mode change.
+ * When using zap, element ZAP_NORMAL is always valid, but
+ * the others can be NULL.
+ */
+
+#define ZAP_NORMAL 0
+#define ZAP_BOLD 1
+#define ZAP_ITALIC 2
+#define ZAP_BITALIC 3
+#define ZAP_STYLES 4
+
+/* Zap font file format data */
+static char *zap_file[ZAP_STYLES] = {NULL, NULL, NULL, NULL};
+
+/* r_caddr format for current mode */
+static char *zap_caddr[ZAP_STYLES] = {NULL, NULL, NULL, NULL};
+
+static void ro_remove_menu(int *menu);
+
+/*
+ * Initialise all the ZapRedraw stuff.
+ * Call this when changing font and after each mode change.
+ * zap_redraw_bitmap must contain a valid Zap font file (possibly
+ * created from the system font).
+ *
+ * Return FAIL to revert to system font (if we can't use ZapRedraw).
+ */
+ int
+ro_zap_redraw_initialise()
+{
+ int bytes_per_bitmap_char;
+ int first, last;
+ int i;
+
+ /* Can't have initialisers for struct members :-(, ok, this way then ... */
+ if (!zap_redraw_initialised)
+ {
+ zap_redraw_block.r_workarea = NULL;
+ zap_redraw_initialised = TRUE;
+ }
+
+ /* We redraw in DSA mode */
+ zap_redraw_block.r_flags = 0x0;
+
+ /* Let ZapRedraw get the screen address for us */
+ zap_redraw_block.r_screen = 0;
+
+ /* Read the font width and height from the font file header.
+ * Assume that all styles are the same size.
+ * ZAP_NORMAL is always present.
+ */
+ zap_redraw_block.r_charw = ((int *) zap_file[ZAP_NORMAL])[2];
+ zap_redraw_block.r_charh = ((int *) zap_file[ZAP_NORMAL])[3];
+
+ /* We have no linespacing */
+ zap_redraw_block.r_linesp = 0;
+
+ /* Fix foreground = colour 1 */
+ zap_redraw_block.r_for = 1;
+
+ /* Fix background = colour 0 */
+ zap_redraw_block.r_bac = 0;
+
+ /* Colour mask buffer */
+ zap_redraw_block.r_palette = zap_redraw_palette;
+
+ /* Allocate local workspace (for the few calls following here) */
+ if (zap_redraw_block.r_workarea != NULL)
+ free(zap_redraw_block.r_workarea);
+ zap_redraw_block.r_workarea = (char*) malloc(128);
+ if (!zap_redraw_block.r_workarea)
+ return FAIL; /* Out of memory */
+
+ /* Fill in VDU variables */
+ if (xswi(ZapRedraw_ReadVduVars, 0, &zap_redraw_block) & v_flag)
+ return FAIL; /* Can't find ZapRedraw module - use VDU instead */
+
+ /* Determine cbpl and cbpc */
+ swi(ZapRedraw_CachedCharSize, zap_redraw_block.r_bpp, 0,
+ zap_redraw_block.r_charw, zap_redraw_block.r_charh);
+ zap_redraw_block.r_cbpl = r2;
+ zap_redraw_block.r_cbpc = r3;
+
+ /* Allocate general workspace (for the calls outside) */
+ if (zap_redraw_block.r_workarea != NULL)
+ free(zap_redraw_block.r_workarea);
+ zap_redraw_block.r_workarea = (char*) malloc(128 + zap_redraw_block.r_cbpl);
+ if (!zap_redraw_block.r_workarea)
+ return FAIL; /* Out of memory */
+
+ /* Now convert the 1 bpp character data ready for the current mode */
+
+ bytes_per_bitmap_char = (zap_redraw_block.r_charw * zap_redraw_block.r_charh + 7) / 8;
+
+ /* Convert the fonts from 1bpp to a format suitable for the
+ * current mode.
+ */
+ for (i = 0; i < ZAP_STYLES; i++)
+ {
+ first = ((int *) zap_file[i])[4];
+ last = ((int *) zap_file[i])[5];
+
+ if (last > 255)
+ last = 255; /* Don't convert cursors (overwrites memory!) */
+
+ /* Allocate the font cache */
+ vim_free(zap_caddr[i]);
+ if (zap_file[i])
+ zap_caddr[i] = (char*) malloc(zap_redraw_block.r_cbpc * 256);
+ else
+ zap_caddr[i] = NULL; /* No file for this style */
+
+ if (zap_caddr[i])
+ {
+ zap_redraw_block.r_caddr = zap_caddr[i];
+
+ swi(ZapRedraw_ConvertBitmap, 0, &zap_redraw_block,
+ first, last, /* Range of characters to convert */
+ zap_file[i] + 0x20 /* Addr of first char provided by font */
+ - first * bytes_per_bitmap_char);
+ }
+ }
+
+ if (!zap_caddr[ZAP_NORMAL])
+ {
+ zap_redraw = FALSE; /* Out of memory */
+ return FAIL;
+ }
+
+ /* Next time we need them, we have to update the colour masks */
+ zap_redraw_update_colours = TRUE;
+
+ return OK;
+}
+
+/*
+ * Redraw a string at OS coordinates <x,y> (top-left, x inclusive, y exclusive).
+ * Graphics clip window is window[0..3] as in R1+28..40 of Wimp_RedrawWindow.
+ * Returns (possibly modified) flags.
+ */
+ int
+ro_zap_redraw_draw_string(x, y, string, length, flags, clip)
+ int x;
+ int y;
+ char *string;
+ int length;
+ int flags; /* DRAW_TRANSP, DRAW_BOLD, DRAW_UNDERL, DRAW_ITALIC */
+ int *clip;
+{
+ char redraw_data[1024];
+ int clip_minx;
+ int clip_miny;
+ int clip_maxx;
+ int clip_maxy;
+ int os_xshift = zap_redraw_block.r_magx;
+ int os_yshift = zap_redraw_block.r_magy;
+
+ if (flags & DRAW_TRANSP)
+ return flags; /* We don't do transparent plotting yet. */
+
+ if (flags & DRAW_BOLD)
+ {
+ if (flags & DRAW_ITALIC && zap_caddr[ZAP_BITALIC])
+ zap_redraw_block.r_caddr = zap_caddr[ZAP_BITALIC];
+ else
+ zap_redraw_block.r_caddr = zap_caddr[ZAP_BOLD];
+ }
+ else
+ {
+ if (flags & DRAW_ITALIC)
+ zap_redraw_block.r_caddr = zap_caddr[ZAP_ITALIC];
+ else
+ zap_redraw_block.r_caddr = zap_caddr[ZAP_NORMAL];
+ }
+ if (!zap_redraw_block.r_caddr)
+ {
+ zap_redraw_block.r_caddr = zap_caddr[ZAP_NORMAL];
+ flags |= DRAW_UNDERL; /* Style missing - we can always underline */
+ }
+
+ /* Set the vertical scaling flag */
+ if (double_height)
+ zap_redraw_block.r_flags = 1 << 1;
+ else
+ zap_redraw_block.r_flags = 0;
+
+ /* Update the colour masks (if needed) */
+ if (zap_redraw_update_colours)
+ {
+ swi(ZapRedraw_CreatePalette, 2,
+ &zap_redraw_block,
+ zap_redraw_colours,
+ zap_redraw_block.r_palette, 2);
+ zap_redraw_update_colours = FALSE;
+ }
+
+ /* Target rectangle in ZapRedraw rectangle coordinates (pixels, Y-min/max reversed !!!) */
+ zap_redraw_block.r_minx = x >> os_xshift; /* inclusive */
+ zap_redraw_block.r_miny = zap_redraw_block.r_ysize - (y >> os_yshift); /* inclusive */
+ zap_redraw_block.r_maxx = (x + length * gui.char_width) >> os_xshift; /* exclusive */
+ zap_redraw_block.r_maxy = zap_redraw_block.r_ysize - ((y - gui.char_height) >> os_yshift);
+ /* exclusive */
+
+ /* Clip rectangle in ZapRedraw rectangle coordinates (pixels, Y-min/max reversed !!!) */
+ clip_minx = clip[0] >> os_xshift; /* inclusive */
+ clip_miny = zap_redraw_block.r_ysize - (clip[3] >> os_yshift); /* inclusive */
+ clip_maxx = clip[2] >> os_xshift; /* exclusive */
+ clip_maxy = zap_redraw_block.r_ysize - (clip[1] >> os_yshift); /* exclusive */
+
+ /* Clip target rectangle against the current graphics window */
+ if (zap_redraw_block.r_minx < clip_minx)
+ {
+ zap_redraw_block.r_scrollx = clip_minx - zap_redraw_block.r_minx;
+ zap_redraw_block.r_minx = clip_minx;
+ }
+ else
+ zap_redraw_block.r_scrollx = 0;
+ if (zap_redraw_block.r_miny < clip_miny)
+ {
+ zap_redraw_block.r_scrolly = clip_miny - zap_redraw_block.r_miny;
+ zap_redraw_block.r_miny = clip_miny;
+ }
+ else
+ zap_redraw_block.r_scrolly = 0;
+ if (zap_redraw_block.r_maxx > clip_maxx)
+ zap_redraw_block.r_maxx = clip_maxx;
+ if (zap_redraw_block.r_maxy > clip_maxy)
+ zap_redraw_block.r_maxy = clip_maxy;
+
+ /* Fill in the character data structure */
+ if (length > (sizeof(redraw_data) - 2 * 4 - 2))
+ length = sizeof(redraw_data) - 2 * 4 - 2;
+ ((int*) redraw_data)[0] = 2 * 4;
+ ((int*) redraw_data)[1] = 0;
+ strncpy(redraw_data + 2 * 4, string, length);
+ redraw_data[2 * 4 + length + 0] = '\0';
+ redraw_data[2 * 4 + length + 1] = '\x2';
+ zap_redraw_block.r_data = (int) redraw_data;
+
+ /* Perform the draw */
+ swi(ZapRedraw_RedrawArea, 0, &zap_redraw_block);
+
+ return flags;
+}
+
+/*
+ * Okay that was it from me, back to Thomas ...
+ */
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(int *argc, char **argv)
+{
+ int arg = 1;
+
+ while (arg < *argc - 1)
+ {
+ if (strcmp(argv[arg], "--rows") == 0 || strcmp(argv[arg], "--columns") == 0)
+ {
+ int value;
+
+ value = atoi(argv[arg + 1]);
+
+ if (argv[arg][2] == 'r')
+ default_rows = value;
+ else
+ default_columns = value;
+
+ /* Delete argument from argv[]. (hope this is read/write!) */
+
+ *argc -= 2;
+ if (*argc > arg)
+ mch_memmove(&argv[arg], &argv[arg + 2], (*argc - arg)
+ * sizeof(char *));
+ }
+ else
+ arg++;
+ }
+}
+
+/* Fatal error on initialisation - report it and die. */
+ void
+ro_die(error)
+ char_u *error; /* RISC OS error block */
+{
+ swi(Wimp_ReportError, error, 5, "GVim");
+ exit(EXIT_FAILURE);
+}
+
+/* Find the sizes of the window tools:
+ *
+ * Create a test window.
+ * Find inner and outer sizes.
+ * Find the difference.
+ * Delete window.
+ *
+ * While we're here, find the eigen values too.
+ */
+ void
+ro_measure_tools()
+{
+ int block[10];
+ int vdu[] = { 4, 5, -1};
+ int test_window[] =
+ {
+ -100, -100, /* Visible area : min X,Y */
+ -50, -50, /* max X,Y */
+ 0, 0, /* Scroll offsets */
+ -1, /* Window in front */
+ 0xd0800150, /* Window flags */
+ 0xff070207, /* Colours */
+ 0x000c0103, /* More colours */
+ 0, -0x4000, /* Workarea extent */
+ 0x4000, 0, /* max X,Y */
+ 0x00000000, /* No title */
+ 0 << 12, /* No workarea button type */
+ 1, /* Wimp sprite area */
+ 0x00010001, /* Minimum width, height */
+ 0, 0, 0, /* Title data (none) */
+ 0 /* No icons */
+ };
+ int inner_max_x, inner_min_y;
+
+ swi(Wimp_CreateWindow, 0, test_window);
+
+ block[0] = r0;
+ /* Open the window (and read state).
+ * GetWindowOutline needs it too if the wimp isn't nested.
+ */
+ swi(Wimp_OpenWindow, 0, block);
+ inner_max_x = block[3];
+ inner_min_y = block[2];
+
+ swi(Wimp_GetWindowOutline, 0, block);
+
+ gui.scrollbar_width = block[3] - inner_max_x;
+ gui.scrollbar_height = inner_min_y - block[2];
+
+ swi(Wimp_DeleteWindow, 0, block);
+
+ /* Read the size of one pixel. */
+ swi(OS_ReadVduVariables, vdu, vdu);
+ x_eigen_factor = vdu[0];
+ y_eigen_factor = vdu[1];
+}
+
+/* Load a template from the current templates file.
+ * Create the window and return its handle.
+ */
+ int
+ro_load_template(str_name, title, title_size)
+ char_u *str_name; /* Identifier of window in file (max 12 chars) */
+ char_u **title; /* If not NULL then return pointer to title here */
+ int *title_size; /* If not NULL then return the title length here */
+{
+ int *window;
+ char *data;
+ int name[4];
+
+ strcpy( (char *) name, str_name);
+
+ /* Find how big we must make the buffers */
+
+ if (xswi(Wimp_LoadTemplate, 0, 0, 0, 0, -1, name, 0) & v_flag)
+ ro_die( (char *) r0);
+
+ window = malloc(r1); /* Don't print text messages from alloc() */
+ data = malloc(r2);
+ if (window == NULL || data == NULL)
+ ro_die("\0\0\0\0Out of memory - Can't load templates");
+
+ /* Load the template into the buffers */
+
+ swi(Wimp_LoadTemplate, 0,
+ window, /* Temp block */
+ data, /* Icon data */
+ data + r2 + 1, /* End of icon data */
+ -1, /* No fonts */
+ name, 0); /* First match */
+ if (r6 == 0)
+ ro_die("\0\0\0\0Can't find window in Templates file");
+
+ /* Create the window */
+
+ if (xswi(Wimp_CreateWindow, 0, window) & v_flag)
+ ro_die( (char *) r0);
+
+ if (title)
+ *title = (char_u *) window[18];
+ if (title_size)
+ *title_size = window[20];
+
+ free(window); /* Free temp block */
+ return r0; /* Return the window handle */
+}
+
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check()
+{
+ return OK; /* TODO: GUI can always be started? */
+}
+
+/*
+ * Initialise the RISC OS GUI.
+ * Create all the windows.
+ * Returns OK for success, FAIL when the GUI can't be started.
+ */
+ int
+gui_mch_init()
+{
+ int messages[] = {
+ 1, 2, 3, 4, /* DataSave, DataSaveAck, DataLoad, DataLoadAck */
+ 8, /* PreQuit */
+ 0xf, /* ClaimEntity (for clipboard) */
+ 0x10, /* DataRequest (for clipboard) */
+ 0x400c1, /* Mode change */
+ 0x400c3, /* TaskCloseDown */
+ 0x400c9, /* MenusDeleted */
+ 0x808c1, /* TW_Output */
+ 0x808c2, /* TW_Ego */
+ 0x808c3, /* TW_Morio */
+ 0x808c4, /* TW_Morite */
+ 0}; /* End-of-list. */
+
+
+ /* There may have been some errors reported in the
+ * command window before we get here. Wait if so.
+ */
+ swi(Wimp_ReadSysInfo, 3);
+ if (r0 == 0)
+ swi(Wimp_CommandWindow, 0); /* Window opened - close with prompt */
+
+ if (xswi(Wimp_Initialise, 310, 0x4b534154, "GVim", messages) & v_flag)
+ return FAIL;
+ nested_wimp = r0 >= 397;
+ task_handle = r1;
+
+ /* Load the templates. */
+
+ if (xswi(Wimp_OpenTemplate, 0, "Vim:Templates") & v_flag)
+ ro_die( (char *) r0);
+
+ gui.window_handle = ro_load_template("editor",
+ &gui.window_title,
+ &gui.window_title_size);
+
+ save_window = ro_load_template("save", NULL, NULL);
+
+ swi(Wimp_CloseTemplate);
+
+ /* Set default foreground and background colours. */
+
+ gui.norm_pixel = gui.def_norm_pixel;
+ gui.back_pixel = gui.def_back_pixel;
+
+ /* Get the colours from the "Normal" and "Menu" group (set in syntax.c or
+ * in a vimrc file) */
+
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color
+ */
+
+ gui_check_colors();
+
+ /* Get the colours for the highlight groups (gui_check_colors() might have
+ * changed them) */
+
+ highlight_gui_started(); /* re-init colours and fonts */
+
+ /* Set geometry based on values read on initialisation. */
+
+ gui.num_cols = Columns = default_columns;
+ gui.num_rows = Rows = default_rows;
+
+ /* Get some information about our environment. */
+
+ ro_measure_tools();
+
+ return OK;
+}
+
+/*
+ * Called when the foreground or background colour has been changed.
+ */
+ void
+gui_mch_new_colors()
+{
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open(void)
+{
+ int block[10];
+
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ block[7] = -1; /* Open at the top of the stack */
+ swi(Wimp_OpenWindow, 0, block);
+
+ /* Give the new window the input focus */
+ swi(Wimp_SetCaretPosition, gui.window_handle, -1, 0, 0, -1, -1);
+
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+ return OK;
+}
+
+ void
+gui_mch_exit(int rc)
+{
+ int block[64];
+
+ /* Close window. Stops us from getting troublesome events
+ * if we take a while to die.
+ */
+ block[0] = gui.window_handle;
+ swi(Wimp_CloseWindow, 0, block);
+
+ if (child_handle)
+ {
+ /* We still have a sub-task running - kill it */
+ block[0] = 20;
+ block[3] = 0;
+ block[4] = 0; /* Quit */
+ if ((xswi(Wimp_SendMessage, 17, block, child_handle) & v_flag) == 0)
+ {
+ /* Idle until child dies. */
+ while (child_handle)
+ {
+ process_event(wimp_poll(1, block), block);
+ }
+ }
+ }
+
+ exit(rc);
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ /* TODO */
+ return FAIL;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ /* TODO */
+}
+
+ void
+gui_mch_set_shellsize(width, height, min_width, min_height, base_width, base_height)
+ int width; /* In OS units */
+ int height;
+ int min_width; /* Smallest permissable window size (ignored) */
+ int min_height;
+ int base_width; /* Space for scroll bars, etc */
+ int base_height;
+{
+ int s_width, s_height;
+ int block[] = {
+ gui.window_handle,
+ 0,
+ -height + 1,
+ width,
+ 1};
+
+ gui_mch_get_screen_dimensions(&s_width, &s_height);
+ s_width -= base_width;
+ s_height -= base_height; /* Underestimate - ignores titlebar */
+
+ swi(Wimp_GetWindowState, 0, block);
+ block[3] = block[1] + width;
+ block[2] = block[4] - height;
+ if (block[3] > s_width)
+ {
+ block[3] = s_width;
+ block[1] = block[3] - width;
+ }
+ if (block[2] < gui.scrollbar_height)
+ {
+ block[2] = gui.scrollbar_height;
+ block[4] = block[2] + height;
+ }
+ swi(Wimp_OpenWindow, 0, block);
+ swi(Wimp_ForceRedraw, gui.window_handle, 0, -height, width, 0);
+}
+
+ void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+ int block[] = {4, 5, 11, 12, -1};
+
+ swi(OS_ReadVduVariables, block, block);
+ *screen_w = (block[2] + 1) << block[0];
+ *screen_h = (block[3] + 1) << block[1];
+}
+
+/* Take a font name with options and return a font handle, or
+ * zero for failure.
+ * Replace extension with 'Bold' or 'Italic' depending on modifiers.
+ */
+ int
+ro_get_font(fullname, weight)
+ char_u *fullname;
+ int weight; /* Initial weights:
+ * BIT MEANING
+ * 0 bold
+ * 1 italic
+ */
+{
+ char_u *arg;
+ char_u font[41];
+ int width = -1;
+ int height = -1;
+ int name_len;
+ int i;
+ char_u c;
+
+ for (i = 0; i < 39;)
+ {
+ c = fullname[i];
+ if (c == ':' || c == NUL || c == '.')
+ break;
+ font[i++] = c;
+ }
+
+ /* find the first modifier, NULL if none */
+ arg = strchr(fullname + i, ':');
+
+ while (arg)
+ {
+ switch (*++arg)
+ {
+ case 'h':
+ height = strtol(arg + 1, (char **) &arg, 10);
+ break;
+ case 'w':
+ width = strtol(arg + 1, (char **) &arg, 10);
+ break;
+ case 'b':
+ weight |= 1;
+ break;
+ case 'i':
+ weight |= 2;
+ break;
+ default:
+ return 0;
+ }
+ arg = strchr(arg, ':');
+ }
+
+ if ((weight & 1) && i < 35)
+ {
+ /* Bold goes instead of given suffix */
+ strncpy(font + i, ".Bold", 5);
+ i += 5;
+ }
+ else
+ {
+ /* Copy rest of name unless we are using Bold */
+ while (i < 39)
+ {
+ c = fullname[i];
+ if (c == ':' || c == NUL)
+ break;
+ font[i++] = c;
+ }
+ }
+ if ((weight & 2) && i < 32)
+ {
+ strncpy(font + i, ".Oblique", 8);
+ i += 8;
+ }
+
+ font[i] = 0;
+
+ if (height < 1 && width < 1)
+ height = width = 10; /* Default to 10pt */
+ else if (height < 1)
+ height = width;
+ else if (width < 1)
+ width = height;
+
+ if (xswi(Font_FindFont, 0, font, width << 4, height << 4, 0, 0) & v_flag)
+ return NOFONT; /* Can't find font */
+
+ return r0;
+}
+
+/* Load a file into allocated memory and check it is valid.
+ * Return a pointer to the allocated block on success.
+ */
+ char *
+zap_load_file(name, style)
+ char_u *name; /* Name of directory containing styles */
+ char_u *style; /* Name of style within directory */
+{
+ char_u fname[256];
+ char_u *file;
+
+ if (strlen(name) + strlen(style) > 254)
+ return NULL; /* Names too long */
+
+ sprintf(fname, "%s.%s", name, style);
+
+ /* Load the named font in 1bpp format. */
+ if (xswi(OS_File, 13, fname, 0, 0, "VimFonts:") & v_flag || r0 != 1)
+ return NULL; /* Error reading file info, or not a file */
+
+ /* Allocate enough memory to load the whole file */
+ file = (char *) alloc(r4);
+ if (!file)
+ return NULL; /* Out of memory */
+
+ if (xswi(OS_File, 12, fname, file, 0, "VimFonts:") & v_flag)
+ return NULL; /* Unable to load file */
+
+ if (strncmp(file, "ZapFont\015", 8) == 0)
+ return file; /* Loaded OK! */
+
+ free(file);
+ return NULL; /* Not a valid font file */
+}
+
+/* Load and convert the named font.
+ * If name is NULL or a null string then convert the system font.
+ * Return OK on success; FAIL and we revert to using the VDU drivers.
+ *
+ * 'name' is the name of a directory.
+ * Tries to load 'name.0', 'name.B', 'name.I' and 'name.IB'.
+ */
+ int
+zap_load_font(name)
+ char_u *name;
+{
+ int i;
+
+ /* Free the existing font files, if any */
+ for (i = 0; i < ZAP_STYLES; i++)
+ {
+ vim_free(zap_file[i]);
+ zap_file[i] = NULL;
+ }
+
+ if (name && *name == '!')
+ {
+ name++;
+ double_height = TRUE;
+ }
+ else
+ double_height = FALSE;
+
+ if (name && *name)
+ {
+ zap_file[ZAP_NORMAL] = zap_load_file(name, "0");
+ if (!zap_file[ZAP_NORMAL])
+ return FAIL; /* Can't load the 'normal' style - error */
+
+ zap_file[ZAP_BOLD] = zap_load_file(name, "B");
+ zap_file[ZAP_ITALIC] = zap_load_file(name, "I");
+ zap_file[ZAP_BITALIC] = zap_load_file(name, "IB");
+ }
+ else
+ {
+ int *header;
+ char workarea[16];
+ char *old_wa;
+
+ /* Allocate memory for system font (8 x 8 x 256 bits, plus header) */
+ header = (int *) alloc(0x20 + 8 * 256);
+ if (header == NULL)
+ return FAIL;
+ zap_file[ZAP_NORMAL] = (char *) header;
+
+ /* Store details about the system font */
+ header[2] = 8; /* Width */
+ header[3] = 8; /* Height */
+ header[4] = 0; /* First char */
+ header[5] = 255; /* Last char */
+ header[6] = header[7] = 0; /* Reserved */
+
+ /* Get system font bitmap */
+ old_wa = zap_redraw_block.r_workarea;
+ zap_redraw_block.r_workarea = workarea;
+ swi(ZapRedraw_ReadSystemChars, zap_file[ZAP_NORMAL] + 0x20, &zap_redraw_block);
+ zap_redraw_block.r_workarea = old_wa;
+ }
+
+ return ro_zap_redraw_initialise();
+}
+
+/*
+ * Initialise vim to use the font with the given name.
+ * Return FAIL if the font could not be loaded, OK otherwise.
+ */
+ int
+gui_mch_init_font(char_u *font_name, int fontset)
+{
+ int new_handle = 0; /* Use the system font by default */
+
+ if (font_name[0] == '!')
+ {
+ /* Select a ZapRedraw font */
+ if (zap_load_font(font_name + 1))
+ zap_redraw = TRUE;
+ else
+ {
+ EMSG2(_("E610: Can't load Zap font '%s'"), font_name);
+ font_name = "System"; /* Error - use system font */
+ zap_redraw = FALSE;
+ }
+ }
+ else
+ {
+ zap_redraw = FALSE;
+
+ if (font_name)
+ {
+ /* Extract any extra details about the font */
+ new_handle = ro_get_font(font_name, 0);
+ if (!new_handle)
+ return FAIL;
+ }
+ else
+ font_name = "System";
+ }
+
+ /* Free the previous font, if any */
+ gui_mch_free_font(gui.norm_font);
+ gui.norm_font = new_handle;
+ gui.char_ascent = 0;
+
+ if (new_handle)
+ {
+ /* Read details about the chosen font */
+ swi(Font_ReadInfo, new_handle);
+
+ gui.char_width = r3 - r1;
+ gui.char_height = r4 - r2;
+
+ font_x_offset = -r1; /* Where to position each char in its box */
+ font_y_offset = -r4;
+
+ /* Try to load other fonts for bold, italic, and bold-italic */
+ gui_mch_free_font(gui.bold_font);
+ gui.bold_font = ro_get_font(font_name, 1);
+ gui_mch_free_font(gui.ital_font);
+ gui.ital_font = ro_get_font(font_name, 2);
+ gui_mch_free_font(gui.boldital_font);
+ gui.boldital_font = ro_get_font(font_name, 3);
+ }
+ else
+ {
+ /* Use the system font or ZapRedraw. */
+ if (zap_redraw)
+ {
+ gui.char_width = zap_redraw_block.r_charw << zap_redraw_block.r_magx;
+ gui.char_height = zap_redraw_block.r_charh << zap_redraw_block.r_magy;
+ if (double_height)
+ gui.char_height <<= 1;
+ }
+ else
+ {
+ gui.char_width = 16;
+ gui.char_height = 32;
+ }
+
+ gui_mch_free_font(gui.bold_font);
+ gui.bold_font = 0;
+ gui_mch_free_font(gui.ital_font);
+ gui.ital_font = 0;
+ gui_mch_free_font(gui.boldital_font);
+ gui.boldital_font = 0;
+ }
+ hl_set_font_name(font_name);
+
+ must_redraw = CLEAR;
+ return OK;
+}
+
+ int
+gui_mch_adjust_charsize()
+{
+ return FAIL;
+}
+
+/*
+ * Get a font structure for highlighting.
+ */
+ GuiFont
+gui_mch_get_font(name, giveErrorIfMissing)
+ char_u *name;
+ int giveErrorIfMissing;
+{
+ int handle;
+
+ if (!name)
+ return NOFONT; /* System font if no name */
+
+ handle = ro_get_font(name, 0);
+ if (!handle)
+ {
+ if (giveErrorIfMissing)
+ EMSG2(_("E611: Can't use font %s"), name);
+ return NOFONT;
+ }
+
+ return handle;
+}
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(GuiFont font)
+{
+ ro_current_font = font;
+
+ if (font)
+ {
+ /* Not the system font or ZapRedraw font - select it */
+ swi(Font_SetFont, font);
+ }
+}
+
+#if 0 /* not used */
+/*
+ * Return TRUE if the two fonts given are equivalent.
+ */
+ int
+gui_mch_same_font(GuiFont f1, GuiFont f2)
+{
+ return f1 == f2;
+}
+#endif
+
+/*
+ * If a font is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_font(GuiFont font)
+{
+ if (font)
+ swi(Font_LoseFont, font);
+}
+
+/*
+ * Return the Pixel value (colour) for the given colour name.
+ * Return INVALCOLOR for error.
+ * NB: I've changed Green for now, since it looked really sick
+ */
+ guicolor_T
+gui_mch_get_color(char_u *name)
+{
+ int i;
+ struct colour
+ {
+ char_u *name;
+ guicolor_T value;
+ } colours[] =
+ {
+ { "Red", grgb(255, 0, 0) },
+ { "LightRed", grgb(255, 0, 0) },
+ { "DarkRed", grgb(139, 0, 0) },
+
+ { "Green", grgb(50, 200, 50) },
+ { "LightGreen", grgb(144, 238, 144) },
+ { "DarkGreen", grgb(0, 100, 0) },
+ { "SeaGreen", grgb(46, 139, 87) },
+
+ { "Blue", grgb(0, 0, 255) },
+ { "LightBlue", grgb(173, 216, 230) },
+ { "DarkBlue", grgb(0, 0, 139) },
+ { "SlateBlue", grgb(160, 90, 205) },
+
+ { "Cyan", grgb(0, 255, 255) },
+ { "LightCyan", grgb(224, 255, 255) },
+ { "DarkCyan", grgb(0, 139, 139) },
+
+ { "Magenta", grgb(255, 0, 255) },
+ { "LightMagenta", grgb(255, 224, 255) },
+ { "DarkMagenta", grgb(139, 0, 139) },
+
+ { "Yellow", grgb(255, 255, 0) },
+ { "LightYellow", grgb(255, 255, 224) },
+ { "DarkYellow", grgb(139, 139, 0) },
+ { "Brown", grgb(165, 42, 42) },
+
+ { "Gray", grgb(190, 190, 190) },
+ { "Grey", grgb(190, 190, 190) },
+ { "LightGray", grgb(211, 211, 211) },
+ { "LightGrey", grgb(211, 211, 211) },
+ { "DarkGray", grgb(169, 169, 169) },
+ { "DarkGrey", grgb(169, 169, 169) },
+
+ { "Black", grgb(0, 0, 0) },
+ { "White", grgb(255, 255, 255) },
+
+ { "Orange", grgb(255, 165, 0) },
+ { "Purple", grgb(160, 32, 240) },
+ { "Violet", grgb(238, 130, 238) },
+ {NULL, 0}
+ };
+
+ if (name[0] == '#')
+ {
+ char *end;
+ int c;
+
+ c = strtol(name + 1, &end, 16);
+ return (guicolor_T) ((c >> 16) & 0xff) | (c & 0xff00) | ((c & 0xff) << 16);
+ }
+
+ for (i = 0; colours[i].name != NULL; i++)
+ {
+ if (STRICMP(name, colours[i].name) == 0)
+ return colours[i].value;
+ }
+ if (strnicmp(name, "grey", 4) == 0 || strnicmp(name, "gray", 4) == 0)
+ {
+ int level = (255 * atoi(name + 4)) / 100;
+ return (guicolor_T) grgb(level, level, level);
+ }
+ return INVALCOLOR;
+}
+
+/*
+ * Set the current text colours.
+ * If we are using fonts then set the antialiasing colours too.
+ */
+ void
+gui_mch_set_colors(guicolor_T fg, guicolor_T bg)
+{
+ zap_redraw_colours[0] = bg << 8; /* JK230798, register new background colour */
+ zap_redraw_colours[1] = fg << 8; /* JK230798, register new foreground colour */
+ zap_redraw_update_colours = TRUE; /* JK230798, need update of colour masks */
+
+ swi(ColourTrans_ReturnGCOL, fg << 8);
+ gui.fg_colour = r0;
+ swi(ColourTrans_ReturnGCOL, bg << 8);
+ gui.bg_colour = r0;
+
+ if (ro_current_font)
+ swi(ColourTrans_SetFontColours, 0, bg << 8, fg << 8, 14);
+}
+
+ void
+ro_draw_string(x, y, s, len, flags, clip)
+ int x; /* Top-left coord to plot at (x incl, y excl) */
+ int y; /* (screen coords) */
+ char_u *s; /* String to plot */
+ int len; /* Length of string */
+ int flags; /* DRAW_TRANSP, DRAW_BOLD, DRAW_UNDERL */
+ int* clip; /* JK230798, added clip window */
+{
+ if (ro_current_font)
+ {
+ int fx;
+ int flen = len; /* Preserve for underline */
+
+ /* Use the Font manager to paint the string.
+ * Must do one char at a time to get monospacing.
+ */
+
+ if (flags & DRAW_ITALIC && !gui.ital_font)
+ flags |= DRAW_UNDERL; /* No italic - underline instead */
+
+ if ((flags & DRAW_TRANSP) == 0)
+ {
+ swi(ColourTrans_SetColour, gui.bg_colour, 0, 0, 0, 0);
+ swi(OS_Plot, 4, x, y - gui.char_height);
+ swi(OS_Plot, 96 + 5, x + len * gui.char_width - 1, y - 1);
+ }
+
+ fx = x + font_x_offset;
+ while (flen--)
+ {
+ swi(Font_Paint, 0, s++, 0x90, fx, y + font_y_offset, 0, 0, 1);
+ fx += gui.char_width;
+ }
+ }
+ else
+ {
+ if (zap_redraw)
+ {
+ /* Using fast Zap redraw. */
+ flags = ro_zap_redraw_draw_string(x, y, s, len, flags, clip);
+ }
+ else
+ {
+ /* Using the system font */
+ if (flags & DRAW_ITALIC)
+ flags |= DRAW_UNDERL;
+
+ if ((flags & DRAW_TRANSP) == 0)
+ {
+ swi(ColourTrans_SetColour, gui.bg_colour, 0, 0, 0, 0);
+ swi(OS_Plot, 4, x, y - gui.char_height);
+ swi(OS_Plot, 96 + 5, x + len * gui.char_width - 1, y - 1);
+ }
+ swi(OS_Plot, 4, /* Move the drawing cursor */
+ x,
+ y - 1);
+ swi(ColourTrans_SetColour, gui.fg_colour, 0, 0, 0, 0);
+ swi(OS_WriteN, s, len);
+
+ if (flags & DRAW_BOLD)
+ {
+ swi(OS_Plot, 4, x + (1 << x_eigen_factor), y - 1);
+ swi(OS_WriteN, s, len);
+ }
+ }
+ }
+
+ if (flags & DRAW_UNDERL)
+ {
+ if (ro_current_font || zap_redraw)
+ swi(ColourTrans_SetColour, gui.fg_colour, 0, 0, 0, 0);
+ /* Underlined is the same with all plotting methods */
+ swi(OS_Plot, 4, x, y - gui.char_height);
+ swi(OS_Plot, 1, gui.char_width * len, 0);
+ }
+}
+
+ void
+gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+{
+ int x, y; /* Workarea x,y */
+ x = col * gui.char_width;
+ y = -row * gui.char_height;
+
+ if (redraw_block)
+ {
+ ro_draw_string(x + redraw_block[1], y + redraw_block[4],
+ s, len, flags, &redraw_block[7]); /* JK230798, added clip window */
+ }
+ else
+ {
+ int block[44];
+ block[0] = gui.window_handle;
+ block[1] = x;
+ block[2] = y - gui.char_height;
+ block[3] = (col + len) * gui.char_width;
+ block[4] = y;
+ swi(Wimp_UpdateWindow, 0, block);
+ while (r0)
+ {
+ ro_draw_string(x + block[1], y + block[4],
+ s, len, flags, &block[7]); /* JK230798, added clip window */
+ swi(Wimp_GetRectangle, 0, block);
+ }
+ }
+}
+
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(char_u *name)
+{
+ return FAIL;
+}
+
+ void
+gui_mch_beep(void)
+{
+ swi(OS_WriteI + 7);
+}
+
+/*
+ * Visual bell.
+ */
+ void
+gui_mch_flash(int msec)
+{
+ /* TODO */
+}
+
+
+/*
+ * Plot a solid rectangle using the given plot action and colour.
+ * Coordinates are inclusive and window-relative.
+ */
+ void
+plot_rectangle(plot, colour, minx, miny, maxx, maxy)
+ int plot; /* OS_Plot action */
+ int colour;
+ int minx;
+ int miny;
+ int maxx;
+ int maxy;
+{
+ if (redraw_block)
+ {
+ swi(ColourTrans_SetColour, colour, 0, 0, 0, 0);
+ swi(OS_Plot, 4, minx + redraw_block[1], miny + redraw_block[4]);
+ swi(OS_Plot, plot, maxx + redraw_block[1], maxy + redraw_block[4]);
+ }
+ else
+ {
+ int block[44];
+ block[0] = gui.window_handle;
+ block[1] = minx;
+ block[2] = miny;
+ block[3] = maxx + 1;
+ block[4] = maxy + 1;
+ swi(Wimp_UpdateWindow, 0, block);
+ while (r0)
+ {
+ swi(ColourTrans_SetColour, colour, 0, 0, 0, 0);
+ swi(OS_Plot, 4, minx + block[1], miny + block[4]);
+ swi(OS_Plot, plot, maxx + block[1], maxy + block[4]);
+ swi(Wimp_GetRectangle, 0, block);
+ }
+ }
+}
+
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(int r, int c, int nr, int nc)
+{
+ plot_rectangle(96 + 6, 0, FILL_X(c), -FILL_Y(r + nr), FILL_X(c + nc), -FILL_Y(r));
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify(void)
+{
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ /* TODO */
+}
+#endif
+
+/* Draw a hollow rectangle relative to the current
+ * graphics cursor position, with the given width
+ * and height. Start position is top-left.
+ */
+ void
+draw_hollow(w, h)
+ int w;
+ int h;
+{
+ swi(OS_Plot, 1, w - 1, 0);
+ swi(OS_Plot, 1, 0, 1 - h);
+ swi(OS_Plot, 1, 1 - w, 0);
+ swi(OS_Plot, 1, 0, h - 1);
+}
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(guicolor_T colour)
+{
+ int x = FILL_X(gui.cursor_col); /* Window relative, top-left */
+ int y = -FILL_Y(gui.cursor_row);
+ if (redraw_block == NULL)
+ {
+ int block[11];
+
+ block[0] = gui.window_handle;
+ block[1] = x;
+ block[2] = y - gui.char_height;
+ block[3] = x + gui.char_width;
+ block[4] = y;
+ swi(Wimp_UpdateWindow, 0, block);
+ while (r0)
+ {
+ swi(ColourTrans_SetGCOL, colour << 8, 0, 0, 0, 0);
+
+ swi(OS_Plot, 4, x + block[1], y + block[4] - 1);
+ draw_hollow(gui.char_width, gui.char_height);
+
+ swi(Wimp_GetRectangle, 0, block);
+ }
+ }
+ else
+ {
+ swi(ColourTrans_SetGCOL, colour << 8, 0, 0, 0, 0);
+
+ swi(OS_Plot, 4, x + redraw_block[1], y + redraw_block[4] - 1);
+ draw_hollow(gui.char_width, gui.char_height);
+ }
+}
+
+/*
+ * Draw part of a cursor, "w" pixels wide, and "h" pixels high, using
+ * color "color".
+ */
+ void
+gui_mch_draw_part_cursor(w, h, colour)
+ int w;
+ int h;
+ guicolor_T colour;
+{
+ int x = FILL_X(gui.cursor_col);
+ int y = -FILL_Y(gui.cursor_row);
+ swi(ColourTrans_ReturnGCOL, colour << 8);
+ plot_rectangle(96 + 5, r0, x, y - h, x + w - 1, y - 1);
+}
+
+/*
+ * Catch up with any queued events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc.
+ * If there is nothing in the event queue(& no timers pending), then we return
+ * immediately (well, after a Wimp_Poll).
+ */
+ void
+gui_mch_update(void)
+{
+ int block[64];
+ int reason;
+
+ swi(OS_ReadMonotonicTime);
+ if ((r0 - time_of_last_poll) < 50)
+ return; /* Don't return too often */
+
+ reason = wimp_poll(0, block);
+ if (reason)
+ process_event(reason, block);
+ ro_return_early = FALSE; /* We're returning anyway. */
+}
+
+ void
+redraw_window(block)
+ int *block;
+{
+ int x, y; /* Vim workarea coords */
+ int width, height;
+ int blank_col;
+
+ swi(ColourTrans_ReturnGCOL, UNUSED_COLOUR << 8, 0, 0, 1<<7, 0);
+ blank_col = r0;
+
+ swi(Wimp_RedrawWindow, 0, block);
+ redraw_block = block;
+ while (r0)
+ {
+ x = block[7] - block[1];
+ y = block[4] - block[10];
+ width = block[9] - block[7];
+ height = block[10] - block[8];
+
+ if (height + y > Rows * gui.char_height)
+ {
+ /* Blank everything off the bottom. */
+ plot_rectangle(96 + 5, blank_col,
+ 0, block[8] - block[4],
+ block[9] - block[1], -FILL_Y(Rows) - 1);
+ height = Rows * gui.char_height;
+ }
+ if (width + x> Columns * gui.char_width)
+ {
+ /* Blank everything off to the right. */
+ plot_rectangle(96 + 5, blank_col,
+ FILL_X(Columns), block[8] - block[4],
+ block[9] - block[1], 0);
+ width = Columns * gui.char_width;
+ }
+ gui_redraw(x , y, width, height);
+ swi(Wimp_GetRectangle, 0, block);
+ }
+ redraw_block = NULL;
+}
+
+/* Check if we have modified data.
+ * If we do then ack the message to stop the shutdown.
+ * Otherwise, ignore the message.
+ */
+ void
+ro_prequit(block)
+ int *block;
+{
+ if (!ro_ok_to_quit())
+ {
+ /* Not OK to quit - stop shutdown */
+ block[3] = block[2];
+ swi(Wimp_SendMessage, 19, block, block[1]);
+ }
+ /* Do nothing. We may get a Message_Quit later. */
+}
+
+/* If there is unsaved data then ask the user if they mind losing it.
+ * Return TRUE if we can quit without saving, FALSE to halt the
+ * shutdown.
+ */
+ int
+ro_ok_to_quit()
+{
+ int old_confirm = cmdmod.confirm;
+
+ cmdmod.confirm = FALSE; /* Use our own, single tasking, box */
+
+ if (check_changed_any(FALSE))
+ {
+ swi(Wimp_ReportError,
+ "\0\0\0\0Vim contains unsaved data - quit anyway?",
+ 0x17,
+ "Vim");
+ cmdmod.confirm = old_confirm;
+ if (r1 != 1)
+ return FALSE;
+ }
+ cmdmod.confirm = old_confirm;
+ return TRUE;
+}
+
+/* Quit without checking for unsaved data. */
+ void
+ro_quit()
+{
+ exiting = TRUE;
+ getout(0);
+
+ exiting = FALSE; /* probably can't get here */
+ setcursor(); /* position cursor */
+ out_flush();
+}
+
+/* Insent the given vim special code into the input buffer */
+ void
+ro_press(a, b, modifier)
+ char a;
+ char b;
+ int modifier; /* %<Ctrl><Shift> 0000 0000 */
+{
+ char_u buf[6];
+ int vim_mod;
+ int key;
+
+
+ /* Convert RISC OS modifier to Vim modifier. */
+ vim_mod = ((modifier & 0x10) ? MOD_MASK_SHIFT : 0)
+ | ((modifier & 0x20) ? MOD_MASK_CTRL : 0);
+ key = simplify_key(TERMCAP2KEY(a, b), &vim_mod);
+
+ buf[3] = CSI;
+ buf[4] = KEY2TERMCAP0(key);
+ buf[5] = KEY2TERMCAP1(key);
+ if (vim_mod)
+ {
+ buf[0] = CSI;
+ buf[1] = KS_MODIFIER;
+ buf[2] = vim_mod;
+ add_to_input_buf(buf, 6);
+ }
+ else
+ add_to_input_buf(buf + 3, 3);
+}
+
+/* Take a wimp key code and insert the vim equivalent
+ * into vim's input buffer.
+ * CTRL-C also sets got_int.
+ */
+ void
+ro_insert_key(code)
+ char_u *code; /* Wimp_ProcessKey code (4 bytes) */
+{
+ char a = code[0];
+ char b = code[1];
+ int base, modifier;
+
+ if (a == 3 && ctrl_c_interrupts)
+ got_int = TRUE;
+
+ /* Is it a normal key? */
+ if (a > 31 && a < 127)
+ {
+ add_to_input_buf(code, 1);
+ return;
+ }
+
+ /* We should pass any unrecognised keys on, but
+ * for now just pass on F12 combinations.
+ */
+ switch (b)
+ {
+ case 0:
+ /* Home and Delete are the only special cases */
+ switch (a)
+ {
+ case 0x1e:
+ ro_press('k','h', 0); /* Home */
+ return;
+ case 0x7f:
+ ro_press('k','D', 0); /* Delete */
+ return;
+ case CSI:
+ {
+ /* Turn CSI into K_CSI. Untested! */
+ char_u string[3] = {CSI, KS_EXTRA, KE_CSI};
+
+ add_to_input_buf(string, 3);
+ return;
+ }
+ default:
+ add_to_input_buf(code, 1);
+ return;
+ }
+ case 1:
+ if ((a & 0xcf) == 0xcc)
+ {
+ /* F12 pressed - pass it on (quick hack) */
+ swi(Wimp_ProcessKey, a | 0x100);
+ return;
+ }
+ base = a & 0xcf;
+ modifier = a & 0x30;
+ switch (base)
+ {
+ case 0x8a: /* Tab */
+ add_to_input_buf("\011", 1);
+ return;
+ case 0x8b: /* Copy (End) */
+ return ro_press('@', '7', modifier);
+ case 0x8c: /* Left */
+ return ro_press('k', 'l', modifier);
+ case 0x8d: /* Right */
+ return ro_press('k', 'r', modifier);
+ case 0x8e: /* Down */
+ if (modifier & 0x10)
+ return ro_press('k', 'N', modifier ^ 0x10);
+ else
+ return ro_press('k', 'd', modifier);
+ case 0x8f: /* Up */
+ if (modifier & 0x10)
+ return ro_press('k', 'P', modifier ^ 0x10);
+ else
+ return ro_press('k', 'u', modifier);
+ case 0xca: /* F10 */
+ return ro_press('k', ';', modifier);
+ case 0xcb: /* F11 */
+ return ro_press('F', '1', modifier);
+ case 0xcd: /* Insert */
+ return ro_press('k', 'I', modifier);
+ default:
+ if (base > 0x80 && base < 0x18a)
+ {
+ /* One of the other function keys */
+ return ro_press('k', '0' + (base & 15), modifier);
+ }
+ }
+ }
+}
+
+/* Process a mouse event. */
+ void
+ro_mouse(block)
+ int *block;
+{
+ int x, y, button, vim_button;
+ int modifiers = 0;
+ int min_x, min_y; /* Visible area of editor window */
+ int max_x, max_y;
+
+ if (block[3] != gui.window_handle || ro_dragging)
+ return; /* Not our window or ignoring clicks*/
+
+ x = block[0]; /* Click position - screen coords */
+ y = block[1];
+ button = block[2];
+
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ min_x = block[1];
+ min_y = block[2];
+ max_x = block[3];
+ max_y = block[4];
+
+ if (block[3] - x < gui.scrollbar_width)
+ {
+ /* Click in that blank area under the scrollbars */
+
+ if (button & 0x444)
+ {
+ int front_block[10];
+ /* Dragging with Select - bring window to front first */
+ front_block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, front_block);
+ front_block[7] = -1;
+ ro_open_main(front_block);
+ }
+
+ block[0] = gui.window_handle;
+ block[1] = 7; /* Drag point */
+ block[2] = block[4] = 0; /* Coords of point. */
+ block[3] = block[5] = 0;
+ drag_x_offset = max_x - x;
+ drag_y_offset = min_y - y;
+
+ /* Parent box. */
+ block[6] = min_x +
+ gui.scrollbar_width * 2 +
+ MIN_COLUMNS * gui.char_width;
+ block[7] = 0;
+ gui_mch_get_screen_dimensions(&block[8], &block[9]);
+ block[9] = max_y -
+ 4 * gui.char_height -
+ gui.scrollbar_height;
+
+ swi(Wimp_DragBox, 0, block);
+ ro_dragging = DRAG_RESIZE_WINDOW;
+ drag_button = vim_button;
+ drag_modifiers = modifiers;
+ return;
+ }
+
+ if (button & 0x111)
+ vim_button = MOUSE_RIGHT;
+ else if (button & 0x222)
+ vim_button = MOUSE_MIDDLE;
+ else
+ vim_button = MOUSE_LEFT;
+
+ swi(OS_Byte, 121, 0x80);
+ if (r1 == 0xff)
+ modifiers |= MOUSE_SHIFT;
+ swi(OS_Byte, 121, 0x81);
+ if (r1 == 0xff)
+ modifiers |= MOUSE_CTRL;
+ swi(OS_Byte, 121, 0x82);
+ if (r1 == 0xff)
+ modifiers |= MOUSE_ALT;
+
+ if (button == 2)
+ {
+ /* Menu click:
+ * If shift was pressed then do the paste action.
+ * If not, then open the pop-up menu.
+ */
+ modifiers ^= MOUSE_SHIFT;
+ if (modifiers && MOUSE_SHIFT)
+ {
+ vimmenu_T main;
+ /* Shift was NOT pressed - show menu */
+ main.dname = (char_u *) "Vim";
+ main.children = root_menu;
+ gui_mch_show_popupmenu(&main);
+ return;
+ }
+ }
+
+ /* Gain the input focus */
+ swi(Wimp_SetCaretPosition, gui.window_handle, -1, 0, 0, -1, -1);
+
+ if (button & 0xf0)
+ {
+ /* Drag operation:
+ *
+ * Tell the Wimp to start a drag.
+ * Monitor null events.
+ */
+ block[1] = 7; /* Drag a point. */
+ block[2] = block[4] = x; /* Coords of point. */
+ block[3] = block[5] = y;
+ block[6] = 0; /* Coords of bounding box. */
+ block[7] = 0;
+ gui_mch_get_screen_dimensions(&block[8], &block[9]);
+
+ drag_x_offset = drag_y_offset = 0;
+
+ swi(Wimp_DragBox, 0, block);
+ ro_dragging = DRAG_SELECTION;
+ drag_button = vim_button;
+ drag_modifiers = modifiers;
+
+ vim_button |= MOUSE_DRAG;
+ }
+
+ gui_send_mouse_event(
+ vim_button,
+ x - min_x,
+ max_y - y,
+ button & 0xf ? TRUE : FALSE, /* dclick */
+ modifiers);
+}
+
+ void
+ro_continue_drag(block)
+ int *block; /* Just used as scrap. */
+{
+ int x, y;
+
+ /* Get screen coords of pointer. */
+ swi(Wimp_GetPointerInfo, 0, block);
+ x = block[0] + drag_x_offset;
+ y = block[1] + drag_y_offset;
+
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+
+ if (ro_dragging == DRAG_RESIZE_WINDOW)
+ {
+ /* Resizeing the main window. */
+ block[2] = y;
+ block[3] = x;
+ ro_open_main(block);
+ }
+ else
+ {
+ /* Selecting some text. */
+ gui_send_mouse_event(
+ drag_button | MOUSE_DRAG, /* Always report the same button */
+ x - block[1],
+ block[4] - y,
+ FALSE, /* Not a double click. */
+ drag_modifiers);
+ }
+}
+
+/* User has released all mouse buttons, marking the end of a drag. */
+ void
+ro_drag_finished(block)
+ int *block;
+{
+ int x;
+ int y;
+ int width, height;
+
+ /* I don't trust the box returned by Wimp_Poll; look at the pointer
+ * ourselves.
+ */
+ swi(Wimp_GetPointerInfo, 0, block);
+ x = block[0] + drag_x_offset;
+ y = block[1] + drag_y_offset;
+
+ if (ro_dragging == DRAG_RESIZE_WINDOW)
+ {
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ block[2] = y;
+ block[3] = x;
+ ro_open_main(block);
+
+ width = (block[3] - block[1]);
+ height = (block[4] - block[2]);
+
+ swi(Wimp_ForceRedraw, gui.window_handle, 0, -height, width, 0);
+ gui_resize_shell(width, height);
+ }
+ else
+ {
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ gui_send_mouse_event(
+ MOUSE_RELEASE,
+ x - block[1],
+ block[4] - y,
+ FALSE, /* not a double click */
+ drag_modifiers);
+ }
+ ro_dragging = DRAG_FALSE;
+}
+
+/* Load the file/pathname given in block into a [new] buffer.
+ *
+ * Modifier Action
+ *
+ * None :confirm e <file>
+ * Ctrl :sp <file>
+ * Shift <file>
+ *
+ * Insert into typebuf, at the start.
+ * If loading from !Scrap then use saved leafname instead, and
+ * delete the scrap file. Also, ignore shift key.
+ *
+ * NB: Doesn't send DataLoadAck (other app might delete temp file?).
+ */
+ void
+ro_dataload(block)
+ int *block;
+{
+ char_u new_path[MAXPATHL];
+ char_u *path = ((char_u *) block) + 44;
+ int scrap = FALSE;
+
+ if (block[3] == leaf_ref && leaf_name)
+ scrap = TRUE;
+
+ switch (get_real_state() & 0xff)
+ {
+ case INSERT:
+ case CMDLINE:
+ case CMDLINE+LANGMAP:
+ /* For insert mode we can only insert the pathname (currently)
+ * Make sure Shift is pressed.
+ */
+ swi(OS_Byte, 121, 0x80); /* Is Shift pressed? */
+ if (r1 == 0xff)
+ {
+ ins_typebuf(" ", REMAP_NONE, 0, TRUE, FALSE);
+ ins_typebuf(path, REMAP_NONE, 0, TRUE, FALSE);
+ ro_return_early = TRUE; /* Return even though nothing was typed. */
+ }
+ else
+ swi(Wimp_ReportError,
+ "\0\0\0\0Sorry, you can only load text in normal mode", 5, "Vim");
+ break;
+
+ case NORMAL:
+ ro_return_early = TRUE; /* Return even though nothing was typed. */
+
+ if (scrap) /* Remove <Wimp$Scrap>. Later. */
+ ins_typebuf(":!~remove <Wimp$Scrap>\r", REMAP_NONE, 0, TRUE, FALSE);
+
+ /* Insert {:sp ,:confirm e }[+f\ <leaf> ]<file><CR> */
+ ins_typebuf("\r", REMAP_NONE, 0, TRUE, FALSE);
+ ins_typebuf(path, REMAP_NONE, 0, TRUE, FALSE);
+ ins_typebuf(" ", REMAP_NONE, 0, TRUE, FALSE);
+
+ if (scrap)
+ {
+ /* Loading via !Scrap - change pathname to stored leafname */
+ ins_typebuf(leaf_name, REMAP_NONE, 0, TRUE, FALSE);
+ ins_typebuf(" +f\\ ", REMAP_NONE, 0, TRUE, FALSE);
+ leaf_ref = 0;
+ vim_free(leaf_name);
+ leaf_name = NULL;
+ }
+
+ swi(OS_Byte, 121, 0x81); /* Is Ctrl pressed? */
+ if (r1 == 0xff)
+ /* Yes, split window */
+ ins_typebuf(":sp", REMAP_NONE, 0, TRUE, FALSE);
+ else
+ ins_typebuf(":confirm e", REMAP_NONE, 0, TRUE, FALSE);
+ break;
+
+ default:
+ swi(Wimp_ReportError, "\0\0\0\0You can only load text in normal mode.", 5, "Vim");
+ }
+ /* Send DataSaveAck so other program doesn't think we died
+ * and delete <Wimp$Scrap>.
+ */
+ block[3] = block[2];
+ block[4] = 4;
+ swi(Wimp_SendMessage, 17, block, block[1]);
+}
+
+ void
+ro_datasave(block)
+ int *block;
+{
+ char_u *path = ((char_u *) block) + 44;
+
+ /* Preserve the name given so we can use it, not <Wimp$Scrap> */
+ if (leaf_name)
+ vim_free(leaf_name);
+ leaf_name = vim_strsave(path);
+
+ block[9] = -1; /* File is unsafe. */
+ strcpy(path, "<Wimp$Scrap>");
+ block[0] = 60;
+ block[3] = block[2];
+ block[4] = 2;
+ swi(Wimp_SendMessage, 17, block, block[1]);
+
+ leaf_ref = block[2];
+}
+
+ void
+ro_message(block)
+ int *block;
+{
+ char_u *buffer;
+ long_u len;
+
+ if (block[1] == task_handle)
+ return; /* Don't talk to ourself! */
+ switch (block[4])
+ {
+ case 0: /* Quit. */
+ if (block[4] == 0)
+ ro_quit();
+ break;
+ case 1: /* DataSave */
+ ro_datasave(block);
+ break;
+ case 2: /* DataSaveAck. */
+ if (clip_convert_selection(&buffer, &len, &clip_star) == -1)
+ return;
+
+ /* Save the clipboard contents to a file. */
+ swi(OS_File, 10, ((char_u *) block) + 44, 0xfff, 0, buffer, buffer + len);
+
+ /* Ack with DataLoad message. */
+ block[3] = block[2];
+ block[4] = 3;
+ block[9] = len;
+ swi(Wimp_SendMessage, 17, block, block[1]);
+
+ vim_free(buffer);
+ break;
+ case 3: /* DataLoad */
+ ro_dataload(block);
+ break;
+ case 8: /* PreQuit */
+ ro_prequit(block);
+ break;
+ case 0xf: /* Lose clipboard. */
+ if (block[5] & 4)
+ {
+ clip_free_selection(&clip_star);
+ clip_star.owned = FALSE;
+ }
+ break;
+ case 0x10: /* DataRequest (clip_star) */
+ if (clip_star.owned)
+ {
+ int rows;
+
+ /* Tell other program that we have the clipboard. */
+ block[0] = 52;
+ block[3] = block[2]; /* Copy myref to yourref. */
+ block[4] = 1; /* DataSave message. */
+ /* Create an estimate for the size (larger or same as true
+ * value) */
+ rows = clip_star.end.lnum - clip_star.start.lnum;
+ if (rows < 0)
+ rows = -rows;
+ block[9] = (rows + 1) * Columns + 1; /* Add one for possible
+ final newline. */
+ block[10] = 0xfff; /* Clipboard is text. */
+ strcpy( ((char_u *) block) + 44, "VimClip");
+ swi(Wimp_SendMessage, 17, block, block[1]);
+ }
+ break;
+ case 0x400c1: /* Mode change */
+ changed_mode = TRUE; /* Flag - update on next OpenWindow */
+ if (zap_redraw)
+ {
+ /* JK230798, re-initialise ZapRedraw stuff */
+ if (ro_zap_redraw_initialise() == FAIL)
+ zap_redraw = FALSE;
+ }
+ break;
+ case 0x400c3: /* TaskCloseDown */
+ if (block[1] == child_handle)
+ child_handle = 0;
+ break;
+ }
+}
+
+/*
+ * Converts a scrollbar's window handle into a scrollbar pointer.
+ * NULL on failure.
+ */
+ scrollbar_T *
+ro_find_sbar(id)
+ int id;
+{
+ win_T *wp;
+
+ if (gui.bottom_sbar.id == id)
+ return &gui.bottom_sbar;
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_scrollbars[SBAR_LEFT].id == id)
+ return &wp->w_scrollbars[SBAR_LEFT];
+ if (wp->w_scrollbars[SBAR_RIGHT].id == id)
+ return &wp->w_scrollbars[SBAR_RIGHT];
+ }
+ return NULL;
+}
+
+ void
+scroll_to(line, sb)
+ int sb; /* Scrollbar number */
+ int line;
+{
+ char_u code[8];
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+ /* Send a scroll event:
+ *
+ * A scrollbar event is CSI (NOT K_SPECIAL), KS_VER_SCROLLBAR,
+ * KE_FILLER followed by:
+ * one byte representing the scrollbar number, and then four bytes
+ * representing a long_u which is the new value of the scrollbar.
+ */
+ code[0] = CSI;
+ code[1] = KS_VER_SCROLLBAR;
+ code[2] = KE_FILLER;
+ code[3] = sb;
+ code[4] = line >> 24;
+ code[5] = line >> 16;
+ code[6] = line >> 8;
+ code[7] = line;
+ add_to_input_buf(code, 8);
+}
+
+ void
+h_scroll_to(col)
+ int col;
+{
+ char_u code[8];
+
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return;
+
+ /* Send a scroll event:
+ *
+ * A scrollbar event is CSI (NOT K_SPECIAL)
+ *
+ * A horizontal scrollbar event is K_SPECIAL, KS_HOR_SCROLLBAR,
+ * KE_FILLER followed by four bytes representing a long_u which is the
+ * new value of the scrollbar.
+ */
+ code[0] = CSI;
+ code[1] = KS_HOR_SCROLLBAR;
+ code[2] = KE_FILLER;
+ code[4] = col >> 24;
+ code[5] = col >> 16;
+ code[6] = col >> 8;
+ code[7] = col;
+ add_to_input_buf(code, 8);
+}
+
+ void
+ro_scroll(block)
+ int *block;
+{
+ scrollbar_T *sb;
+ int offset;
+ win_T *wp;
+
+ /* Block is ready for Wimp_OpenWindow, and also contains:
+ *
+ * +32 = scroll X direction (-2 .. +2)
+ * +36 = scroll Y direction (-2 .. +2)
+ */
+
+ sb = ro_find_sbar(block[0]);
+ if (!sb)
+ return; /* Window not found (error). */
+
+ wp = sb-> wp;
+
+ if (wp == NULL)
+ {
+ /* Horizontal bar. */
+ offset = block[8];
+ if (offset == -2)
+ offset = (block[1] - block[3]) / gui.char_width;
+ else if (offset == 2)
+ offset = (block[3] - block[1]) / gui.char_width;
+
+ block[5] += offset * gui.char_width;
+
+ gui_drag_scrollbar(sb, block[5] / gui.char_width, FALSE);
+
+ swi(Wimp_OpenWindow, 0, block);
+ }
+ else
+ {
+ offset = -block[9];
+ if (offset == -2)
+ offset = -(wp -> w_height - 1);
+ else if (offset == 2)
+ offset = wp -> w_height - 1;
+
+ /* Possibly we should reposition the scrollbar?
+ * Vim seems to update the bar anyway...
+ */
+ gui_drag_scrollbar(sb, offset - (block[6] / gui.char_height), FALSE);
+ }
+}
+
+/* Move a window by a given offset. Used to simulate the function of the
+ * nested wimp.
+ */
+ void
+ro_move_child(window, x, y, pos_wanted, pos_got)
+ int window;
+ int x,y; /* offset to move by */
+ int pos_wanted, pos_got;
+{
+ int block[10];
+
+ block[0] = window;
+ swi(Wimp_GetWindowState, 0, block);
+ block[1] += x;
+ block[2] += y;
+ block[3] += x;
+ block[4] += y;
+ if (pos_wanted == -1)
+ block[7] = -1;
+ else if (pos_wanted == -2)
+ block[7] = pos_got;
+ swi(Wimp_OpenWindow, 0, block);
+}
+
+/* Open the main window. Also updates scrollbars if we are not
+ * using the nested Wimp.
+ * If we have just changed mode then re-read all values.
+ */
+ void
+ro_open_main(block)
+ int *block;
+{
+ int toggle_size;
+
+ /* Find out if the user clicked on the toggle size icon. */
+ block[20] = block[0];
+ swi(Wimp_GetWindowState, 0, block + 20);
+ toggle_size = block[28] & (1 << 19);
+
+ if (nested_wimp)
+ {
+ swi(Wimp_OpenWindow, 0, block);
+ }
+ else
+ {
+ int old[10];
+ int x_offset, y_offset; /* Move children same as parent. */
+ int pos_wanted, pos_got;
+ int left_bar = gui.which_scrollbars[SBAR_LEFT];
+ int right_bar = gui.which_scrollbars[SBAR_RIGHT];
+ win_T *wp;
+
+ /* Three cases to think about:
+ * 1) Move to top. Open each window at the top.
+ * 2) Same stack position. Open each with same position.
+ * 3) Open at bottom. Open children with parent's new position.
+ */
+
+ old[0] = block[0];
+ swi(Wimp_GetWindowState, 0, old);
+ pos_wanted = block[7];
+ swi(Wimp_OpenWindow, 0, block);
+ /* Block updated by OpenWindow? I don't think so! */
+ swi(Wimp_GetWindowState, 0, block);
+ pos_got = block[7];
+
+ x_offset = block[1] - old[1];
+ y_offset = block[4] - old[4];
+ if (x_offset || y_offset || pos_wanted == -1 || pos_wanted == -2)
+ {
+ /* If parent has moved, re-open all the child windows. */
+ FOR_ALL_WINDOWS(wp)
+ {
+ /* Reopen scrollbars for this window. */
+ if (left_bar)
+ ro_move_child(wp -> w_scrollbars[SBAR_LEFT].id,
+ x_offset, y_offset,
+ pos_wanted, pos_got);
+ if (right_bar)
+ ro_move_child(wp -> w_scrollbars[SBAR_RIGHT].id,
+ x_offset, y_offset,
+ pos_wanted, pos_got);
+ }
+ }
+ }
+ if (changed_mode || toggle_size)
+ {
+ int width, height;
+
+ if (changed_mode)
+ ro_measure_tools();
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+
+ width = block[3] - block[1];
+ height = block[4] - block[2];
+ swi(Wimp_ForceRedraw, gui.window_handle, 0, -height, width, 0);
+ gui_resize_shell(width, height);
+ changed_mode = FALSE;
+ }
+}
+
+ void
+ro_open_window(block)
+ int *block;
+{
+ int pos;
+ scrollbar_T *sb;
+
+ if (block[0] == gui.window_handle)
+ ro_open_main(block);
+ else
+ {
+ swi(Wimp_OpenWindow, 0, block);
+ if (block[0] != gui.window_handle)
+ {
+ sb = ro_find_sbar(block[0]);
+ if (sb)
+ {
+ if (sb-> wp != NULL)
+ gui_drag_scrollbar(sb, -block[6] / gui.char_height, FALSE);
+ else
+ gui_drag_scrollbar(sb, block[5] / gui.char_width, FALSE);
+ }
+ }
+ }
+}
+
+ void
+ro_menu_selection(block)
+ int *block;
+{
+ int *item = wimp_menu + 7;
+ vimmenu_T *menu;
+ /* wimp_menu points to a wimp menu structure */
+
+ for (;;)
+ {
+ while (block[0]--)
+ item += 6;
+ if (block[1] == -1)
+ break;
+ item = ((int *) item[1]) + 7;
+ block++;
+ }
+ /* item points to the wimp menu item structure chosen */
+ menu = (vimmenu_T *) item[5];
+
+ swi(Wimp_GetPointerInfo, 0, block);
+ if (block[2] == 1)
+ /* Adjust used - keep menu open */
+ swi(Wimp_CreateMenu, 0, wimp_menu);
+
+ if (menu-> cb)
+ menu-> cb(menu);
+}
+
+ void
+ro_open_parent()
+{
+ int head;
+ char_u *i = curbuf-> b_ffname;
+ char_u buffer[256];
+
+ head = 0;
+ for (; *i; i++)
+ {
+ if (*i == '.')
+ head = i - curbuf-> b_ffname;
+ }
+
+ /* Append head chars to buffer */
+ if (head < 240 && curbuf-> b_ffname && head)
+ {
+ strcpy(buffer, "%filer_opendir ");
+ strncpy(buffer + 15, curbuf-> b_ffname, head);
+ buffer[15 + head] = '\0';
+ swi(OS_CLI, buffer);
+ }
+}
+
+ void
+process_event(event, block)
+ int event;
+ int *block;
+{
+ switch (event)
+ {
+ case 0: /* Nothing - update drag state. */
+ if (ro_dragging)
+ ro_continue_drag(block);
+ break;
+ case 1: /* Redraw window. */
+ redraw_window(block);
+ break;
+ case 2: /* Open window. */
+ ro_open_window(block);
+ break;
+ case 3: /* Close window. */
+ swi(Wimp_GetPointerInfo, 0, block + 1);
+ if (block[3] == 1)
+ ro_open_parent();
+ else
+ if (ro_ok_to_quit())
+ ro_quit();
+ break;
+ case 6: /* Mouse click. */
+ ro_mouse(block);
+ break;
+ case 7: /* Finished drag. */
+ ro_drag_finished(block);
+ break;
+ case 8: /* Key pressed. */
+ ro_insert_key((char_u *) &block[6]);
+ break;
+ case 9:
+ ro_menu_selection(block);
+ break;
+ case 10: /* Scroll request. */
+ ro_scroll(block);
+ break;
+ case 11: /* Lose caret. */
+ if (block[0] == gui.window_handle)
+ gui_focus_change(FALSE);
+ break;
+ case 12: /* Gain caret. */
+ if (block[0] == gui.window_handle)
+ gui_focus_change(TRUE);
+ break;
+ case 17: /* User message. */
+ case 18: /* User message recorded. */
+ ro_message(block);
+ break;
+ }
+}
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_mch_wait_for_chars(long wtime)
+{
+ int block[64];
+ int reason;
+ int start_time = -1;
+ int ctime = wtime / 10; /* delay in cs */
+
+ if (wtime != -1)
+ {
+ swi(OS_ReadMonotonicTime);
+ start_time = r0;
+ }
+
+ for (;;)
+ {
+ if (ro_dragging)
+ reason = wimp_poll(0, block); /* Always return immediately */
+ else if (wtime == -1)
+ reason = wimp_poll(1, block);
+ else
+ reason = wimp_pollidle(0, block, start_time + ctime);
+
+ process_event(reason, block);
+
+ if (input_available() || ro_return_early)
+ {
+ ro_return_early = FALSE;
+ return OK; /* There is something to process (key / menu event) */
+ }
+
+ if (wtime != -1)
+ {
+ swi(OS_ReadMonotonicTime);
+ if (r0 - start_time > ctime)
+ return FAIL; /* We've been waiting too long - return failure */
+ }
+ }
+}
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush(void)
+{
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos(row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(int row1, int col1, int row2, int col2)
+{
+ swi(ColourTrans_ReturnGCOL, gui.back_pixel << 8, 0, 0, 1<<7, 0);
+ plot_rectangle(96 + 5, r0,
+ FILL_X(col1), -FILL_Y(row2 + 1),
+ FILL_X(col2 + 1), -FILL_Y(row1));
+}
+
+ void
+gui_mch_clear_all(void)
+{
+ if (redraw_block)
+ {
+ swi(ColourTrans_SetGCOL, gui.back_pixel << 8, 0, 0, 1<<7, 0);
+ swi(OS_WriteI + 16);
+ }
+ else
+ {
+ int block[44];
+ block[0] = gui.window_handle;
+ block[1] = 0;
+ block[2] = -gui.num_rows * gui.char_height;
+ block[3] = gui.num_cols * gui.char_width;
+ block[4] = 0;
+ swi(Wimp_UpdateWindow, 0, block);
+ while (r0)
+ {
+ swi(ColourTrans_SetGCOL, gui.back_pixel << 8, 0, 0, 1<<7, 0);
+ swi(OS_WriteI + 16);
+ swi(Wimp_GetRectangle, 0, block);
+ }
+ }
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(int row, int num_lines)
+{
+ int top_from = -row - num_lines;
+ int bot_from = -gui.scroll_region_bot - 1;
+ int bot_to = bot_from + num_lines;
+
+ swi(ColourTrans_SetGCOL, gui.back_pixel << 8, 0, 0, 0x80, 0);
+
+ /* Changed without checking! */
+ swi(Wimp_BlockCopy, gui.window_handle,
+ gui.scroll_region_left * gui.char_width,
+ bot_from * gui.char_height,
+ (gui.scroll_region_right - gui.scroll_region_left
+ + 1) * gui.char_width,
+ top_from * gui.char_height,
+
+ gui.scroll_region_left * gui.char_width,
+ bot_to * gui.char_height);
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(int row, int num_lines)
+{
+ int top_from = -row;
+ int bot_to = -gui.scroll_region_bot - 1;
+ int bot_from = bot_to + num_lines;
+
+ swi(ColourTrans_SetGCOL, gui.back_pixel << 8, 0, 0, 0x80, 0);
+
+ swi(Wimp_BlockCopy, gui.window_handle,
+ gui.scroll_region_left * gui.char_width,
+ bot_from * gui.char_height,
+ (gui.scroll_region_right - gui.scroll_region_left
+ + 1) * gui.char_width,
+ top_from * gui.char_height,
+
+ gui.scroll_region_left * gui.char_width,
+ bot_to * gui.char_height);
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+}
+
+/* Put selection in clipboard buffer.
+ * Should we become the new owner?
+ */
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ int block[64]; /* Will be used in Wimp_Poll. */
+ int reason;
+ char_u *buffer;
+ long_u length;
+
+ block[0] = 48; /* Size of block. */
+ block[3] = 0; /* Orinial message. */
+ block[4] = 0x10; /* Data request. */
+ block[5] = gui.window_handle;
+ block[6] = RO_LOAD_CLIPBOARD; /* Internal handle. */
+ block[7] = block[8] = 0; /* (x,y) not used. */
+ block[9] = 4;
+ block[10] = 0xfff; /* We want text files if possible, I think. */
+ block[11] = -1; /* End of list. */
+ swi(Wimp_SendMessage, 17, block, 0); /* Broadcast request. */
+
+ /* OK, we've sent the request. Poll until we get a null poll (failure) or
+ * we load the clipboard.
+ * If we receive a DataSave event with icon handle = -2 then put it on the
+ * clipboard. RISC OS should ensure that key events will not be delivered
+ * until the clipboard operation completes (unless the owner starts idling
+ * - we can't wait forever!).
+ */
+ for (;;)
+ {
+ reason = wimp_poll(0, block);
+ if (reason == 0)
+ return; /* Failed to get clipboard. */
+ if ((reason == 17 || reason == 18) &&
+ block[4] == 1 && block[6] == RO_LOAD_CLIPBOARD)
+ break; /* Got it - stop waiting. */
+ process_event(reason, block);
+ if (ro_return_early)
+ return;
+ }
+ /* Tell owner to save data in <Wimp$Scrap>. */
+ block[0] = 60;
+ block[3] = block[2]; /* Copy myref -> yourref */
+ block[4] = 2; /* DataSaveAck. */
+ block[9] = -1; /* Data is unsafe. */
+ strcpy( ((char_u *) block) + 44, "<Wimp$Scrap>");
+ swi(Wimp_SendMessage, 17, block, block[1]);
+
+ /* Wait again for reply. */
+ for (;;)
+ {
+ reason = wimp_poll(0, block);
+ if (reason == 0)
+ return; /* Other program has given up! */
+ if ((reason == 17 || reason == 18) && block[4] == 3 && block[6] == RO_LOAD_CLIPBOARD)
+ break; /* Clipboard data saved to <Wimp$Scrap> */
+ process_event(reason, block);
+ if (ro_return_early)
+ return;
+ }
+
+ /* <Wimp$Scrap> contains clipboard - load it. */
+ if (xswi(OS_File, 17, "<Wimp$Scrap>") & v_flag)
+ return; /* Error! */
+ if (r0 != 1 && r0 != 3)
+ return;
+ length = r4;
+
+ buffer = lalloc(length, TRUE); /* Claim memory (and report errors). */
+ if (buffer == NULL)
+ return;
+
+ if (xswi(OS_File, 16, "<Wimp$Scrap>", buffer, 0) & v_flag)
+ return;
+
+ clip_yank_selection(MCHAR, buffer, length, cbd);
+
+ vim_free(buffer);
+
+ swi(OS_FSControl, 27, "<Wimp$Scrap>", 0, 0); /* Delete temp file. */
+
+ block[4] = 4; /* Send DataLoadAck. */
+ block[3] = block[2]; /* Copy myref -> yourref. */
+ swi(Wimp_SendMessage, 17, block, block[1]);
+}
+
+/* Not sure what this means under RISC OS. */
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+}
+
+/* Tell everyone that we now own the clipboard.
+ * Return OK if our claim is accepted (always, under RISC OS)
+ */
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ int block[6];
+ block[0] = 24; /* Length of block. */
+ block[3] = 0; /* Original message. */
+ block[4] = 0xf; /* ClaimEntity. */
+ block[5] = 0x4; /* Claim clipboard only. */
+ swi(Wimp_SendMessage, 17, block, 0);
+ return OK;
+}
+
+/*
+ * Send the current selection to the clipboard. Do nothing for X because we
+ * will fill in the selection only when requested by another app. Sounds good
+ * for RISC OS too.
+ */
+ void
+clip_mch_set_selection(VimClipboard *cbd)
+{
+ clip_get_selection(cbd);
+}
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(vimmenu_T *menu, int grey)
+{
+ menu-> greyed_out = grey;
+}
+
+/*
+ * Make menu item hidden or not hidden
+ */
+ void
+gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
+{
+ menu-> hidden = hidden;
+}
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar(void)
+{
+ swi(Wimp_CreateMenu, 0, -1);
+ if (wimp_menu != (int *) -1)
+ {
+ ro_remove_menu(wimp_menu);
+ wimp_menu = (int *) -1;
+ }
+}
+
+/* Add or remove a scrollbar. Note that this is only called when
+ * the scrollbar state is changing.
+ * The scroll bar window has already been created.
+ * We can't do anything except remove the scroll bar
+ * until we know what size to use.
+ */
+ void
+gui_mch_enable_scrollbar(sb, flag)
+ scrollbar_T *sb;
+ int flag;
+{
+ if (!flag)
+ swi(Wimp_CloseWindow, 0, & (sb->id) );
+ return;
+}
+
+ void
+gui_mch_set_blinking(long waittime, long on, long off)
+{
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink(void)
+{
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink(void)
+{
+}
+
+/*
+ * Return the RGB value of a pixel as a long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ return (long_u)pixel;
+}
+
+ void
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
+{
+}
+
+ void
+gui_mch_enable_menu(int flag)
+{
+}
+
+ void
+gui_mch_set_menu_pos(int x, int y, int w, int h)
+{
+}
+
+ void
+gui_mch_add_menu(vimmenu_T *menu, int idx)
+{
+}
+
+ void
+gui_mch_add_menu_item(vimmenu_T *menu, int idx)
+{
+}
+
+ void
+gui_mch_new_menu_colors(void)
+{
+}
+
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+}
+
+/* Size of buffer has changed.
+ * Add one to max since gui.c substracts one more than it should!
+ */
+ void
+gui_mch_set_scrollbar_thumb(sb, val, size, max)
+ scrollbar_T *sb;
+ long val;
+ long size;
+ long max;
+{
+ int block[10], width, height;
+
+ width = (max + 1) * gui.char_width;
+ height = (max + 1 + W_STATUS_HEIGHT(sb->wp)) * gui.char_height;
+
+ block[0] = block[3] = 0;
+ block[1] = -height + (1 << y_eigen_factor);
+ block[2] = width;
+
+ swi(Wimp_SetExtent, sb -> id, block);
+
+ block[0] = sb -> id;
+ swi(Wimp_GetWindowState, 0, block);
+ block[5] = val * gui.char_width;
+ block[6] = -val * gui.char_height;
+ swi(Wimp_OpenWindow, 0, block, 0x4b534154,
+ gui.window_handle, /* Parent window handle. */
+ (CHILD_FIX_TO_RIGHT << CHILD_LEFT ) |
+ (CHILD_FIX_TO_RIGHT << CHILD_RIGHT ) |
+ (CHILD_FIX_TO_BOTTOM << CHILD_TOP ) |
+ (CHILD_FIX_TO_BOTTOM << CHILD_BOTTOM) |
+ (CHILD_SELF_SCROLL << CHILD_SCROLL_X) |
+ (CHILD_SELF_SCROLL << CHILD_SCROLL_Y)
+ );
+}
+
+/* Set the position of the scrollbar within the editor
+ * window. Note that, for vertical scrollbars, x and w
+ * are ignored. For horizontal bars y and h are ignored.
+ */
+ void
+gui_mch_set_scrollbar_pos(sb, x, y, w, h)
+ scrollbar_T *sb;
+ int x; /* Horizontal sb position */
+ int y; /* Top of scroll bar */
+ int w; /* Width */
+ int h; /* Height */
+{
+ int block[24];
+ int px1, py1; /* Parent window min coords */
+ int px2, py2; /* Parent window max coords */
+
+ /* Find where the parent window is. */
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ px1 = block[1];
+ py1 = block[2];
+ px2 = block[3];
+ py2 = block[4];
+
+ block[0] = sb -> id;
+
+ /* Find out how big the scroll window is at the moment. */
+ swi(Wimp_GetWindowInfo, 0, ((char_u *)block) + 1);
+
+ if (block[13] < w || block[12] > -h)
+ {
+ /* Current window is too small! */
+ if (block[12] > -h)
+ block[12] = -h;
+ if (block[13] < w)
+ block[13] = w;
+ swi(Wimp_SetExtent, block[0], block + 11);
+ }
+
+ /* This works better on the nested_wimp. */
+ if (sb-> wp)
+ {
+ /* This is a vertical scrollbar. */
+ block[1] = block[3] = px2 - gui.scrollbar_width + (1 << x_eigen_factor);
+ block[2] = 1 + py2 - (y + h) + (1 << y_eigen_factor);
+ block[4] = 1 + py2 - y;
+ }
+ else
+ {
+ /* This is a horizontal scrollbar. */
+ block[2] = block[4] = py1 + gui.scrollbar_height;
+ block[1] = px1;
+ block[3] = px2 - gui.scrollbar_width;
+ }
+
+ block[5] = 0;
+ block[6] = 0;
+ block[7] = -1;
+
+ swi(Wimp_OpenWindow, 0, block, 0x4b534154,
+ gui.window_handle, /* Parent window handle. */
+ (CHILD_FIX_TO_RIGHT << CHILD_LEFT ) |
+ (CHILD_FIX_TO_RIGHT << CHILD_RIGHT ) |
+ (CHILD_FIX_TO_BOTTOM << CHILD_TOP ) |
+ (CHILD_FIX_TO_BOTTOM << CHILD_BOTTOM) |
+ (CHILD_SELF_SCROLL << CHILD_SCROLL_X) |
+ (CHILD_SELF_SCROLL << CHILD_SCROLL_Y)
+ );
+}
+
+/* Create a window with no workarea to place inside editor window.
+ * (what happens without the nested wimp?)
+ * Data for scrollbar is invalid.
+ */
+ void
+gui_mch_create_scrollbar(sb, orient)
+ scrollbar_T *sb;
+ int orient; /* orient is SBAR_HORIZ or SBAR_VERT */
+{
+ int bar[] =
+ {
+ 0, 0, /* Visible area : min X,Y */
+ 100, 100, /* max X,Y */
+ 0, 0, /* Scroll offsets */
+ -1, /* Window in front */
+ 0x80800150 | (orient == SBAR_HORIZ ? (1 << 30) : (1 << 28)),
+ 0xff070207, /* Colours */
+ 0x000c0103, /* More colours */
+ 0, -0x4000, /* Workarea extent */
+ 0x4000, 0, /* max X,Y */
+ 0x00000000, /* No title */
+ 0 << 12, /* No workarea button type */
+ 1, /* Wimp sprite area */
+ 0x00010001, /* Minimum width, height */
+ 0, 0, 0, /* Title data (none) */
+ 0 /* No icons */
+ };
+ swi(Wimp_CreateWindow, 0, bar);
+ sb -> id = r0;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
+{
+ swi(Wimp_DeleteWindow, 0, & (sb->id));
+ sb -> id = -1;
+}
+#endif
+
+ void
+gui_mch_set_scrollbar_colors(scrollbar_T *sb)
+{
+ /* Always use default RO colour scheme. */
+}
+
+/*
+ * Get current x mouse coordinate in text window.
+ * Note: (0,0) is the bottom left corner, positive y is UP.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x()
+{
+ int left;
+ int block[10];
+
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ left = block[1];
+
+ swi(Wimp_GetPointerInfo, 0, block);
+ return block[0] - left;
+}
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_y()
+{
+ int top;
+ int block[10];
+
+ block[0] = gui.window_handle;
+ swi(Wimp_GetWindowState, 0, block);
+ top = block[4];
+
+ swi(Wimp_GetPointerInfo, 0, block);
+ return top - block[1];
+}
+
+/* MouseTo(x, y) */
+ void
+gui_mch_setmouse(x, y)
+ int x;
+ int y;
+{
+}
+
+ void
+gui_mch_toggle_tearoffs(enable)
+ int enable;
+{
+ /* no tearoff menus */
+}
+
+/* Redraw a window's title.
+ * For the nested wimp we use the new 'redraw-title-bar' reason code.
+ * For older wimps we mark the area of the screen where the title bar
+ * is as invalid.
+ */
+ void
+ro_redraw_title(window)
+ int window;
+{
+ if (nested_wimp)
+ {
+ swi(Wimp_ForceRedraw, window, 0x4b534154, 3);
+ }
+ else
+ {
+ int block[10];
+ int miny;
+
+ block[0] = window;
+ swi(Wimp_GetWindowState, 0, block);
+ miny = block[4];
+ swi(Wimp_GetWindowOutline, 0, block);
+ swi(Wimp_ForceRedraw, -1,
+ block[1], miny,
+ block[3], block[4]);
+ }
+}
+
+/* Turn a vimmenu_T structure into a wimp menu structure.
+ * -1 if resulting menu is empty.
+ * Only the children and dname items in the root menu are used.
+ */
+ int *
+ro_build_menu(menu)
+ vimmenu_T *menu;
+{
+ int *wimp_menu;
+ int width = 4;
+ int w;
+ int size = 28;
+ vimmenu_T *item;
+ int *wimp_item;
+
+ /* Find out how big the menu is so we can allocate memory for it */
+ for (item = menu-> children; item; item = item-> next)
+ {
+ if (item-> hidden == FALSE && !menu_is_separator(item->name))
+ size += 24;
+ }
+
+ if (size <= 28)
+ return (int *) -1; /* No children - shouldn't happen */
+
+ wimp_menu = (int *) alloc(size);
+
+ wimp_menu[0] = (int) menu-> dname;
+ wimp_menu[1] = -1;
+ wimp_menu[2] = 0;
+ wimp_menu[3] = 0x00070207;
+ wimp_menu[5] = 44;
+ wimp_menu[6] = 0;
+
+ wimp_item = wimp_menu + 7;
+
+ for (item = menu-> children; item; item = item-> next)
+ {
+ if (menu_is_separator(item-> name))
+ {
+ /* This menu entry is actually a separator. If it is not the first
+ * menu entry then mark the previous menu item as needing a dotted
+ * line after it.
+ */
+ if (wimp_item > wimp_menu + 7)
+ wimp_item[-6] |= 0x2;
+ }
+ else if (item-> hidden == FALSE)
+ {
+ wimp_item[0] = 0;
+ wimp_item[1] = item-> children ? (int) ro_build_menu(item) : -1;
+ wimp_item[2] = 0x07009131 | (item-> greyed_out << 22);
+ wimp_item[3] = (int) item-> dname;
+ wimp_item[4] = -1;
+ wimp_item[5] = (int) item; /* Stuff the menu address in this unused space */
+
+ w = strlen(item-> dname) + 1;
+ if (w > width)
+ width = w;
+ wimp_item += 6;
+ }
+ }
+
+ wimp_menu[4] = (width + 2) * 16;
+ wimp_menu[7] |= 0x100; /* Menu title is indirected */
+ wimp_item[-6] |= 0x080; /* Last entry in menu */
+ return wimp_menu;
+}
+
+ static void
+ro_remove_menu(menu)
+ int *menu;
+{
+ int *item = menu + 7;
+
+ if (menu == NULL || menu == (int *) -1)
+ return;
+
+ for (;;)
+ {
+ if (item[1] != -1)
+ ro_remove_menu((int *) item[1]); /* Remove sub-menu */
+ if (item[0] & 0x80)
+ break; /* This was the last entry */
+ item += 6;
+ }
+ vim_free(menu);
+}
+
+ void
+gui_mch_show_popupmenu(menu)
+ vimmenu_T *menu;
+{
+ int block[10];
+
+ /* Remove the existing menu, if any */
+ if (wimp_menu != (int *) -1)
+ {
+ swi(Wimp_CreateMenu, 0, -1);
+ ro_remove_menu(wimp_menu);
+ wimp_menu = (int *) -1;
+ }
+
+ wimp_menu = ro_build_menu(menu);
+ if (wimp_menu != (int *) -1)
+ {
+ swi(Wimp_GetPointerInfo, 0, block);
+ swi(Wimp_CreateMenu, 0, wimp_menu, block[0] - 64, block[1] + 64);
+ }
+}
+
+/* Run a command using the TaskWindow module.
+ * If SHELL_FILTER is set then output is not echoed to the screen,
+ * If it is not set, then \r is not sent to the output file.
+ */
+ int
+gui_mch_call_shell(cmd, options)
+ char_u *cmd;
+ int options; /* SHELL_FILTER if called by do_filter() */
+ /* SHELL_COOKED if term needs cooked mode */
+{
+ char_u task_cmd[256]; /* Contains *TaskWindow command. */
+ int block[64];
+ int reason;
+ char_u *out;
+ char_u c;
+ int old_msg_col;
+ char_u *out_redir;
+ int length;
+ FILE *out_file = NULL;
+
+ out_redir = strstr(cmd, " > ");
+ if (out_redir == NULL)
+ length = strlen(cmd); /* No redirection. */
+ else
+ {
+ length = out_redir - cmd;
+ out_file = fopen(out_redir + 3, "wb");
+ if (out_file == NULL)
+ msg_str("WARNING : Can't open file %s for writing\n",
+ out_redir + 3);
+ }
+
+ if (length > 180)
+ {
+ if (out_file)
+ fclose(out_file);
+ return FAIL; /* Command too long. */
+ }
+
+ strcpy(task_cmd, "TaskWindow \"");
+ strncpy(task_cmd + 12, cmd, length);
+ sprintf(task_cmd + 12 + length,
+ "\" -task &%08x -ctrl -quit -name \"Vim command\"",
+ task_handle);
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK);
+
+ if (xswi(Wimp_StartTask, task_cmd) & v_flag)
+ {
+ /* Failed to even start a new task (out of memory?) */
+ settmode(TMODE_RAW);
+ if (out_file)
+ fclose(out_file);
+ return FAIL;
+ }
+
+ /* Wait for the child process to initialise. */
+ child_handle = 0;
+ while (!child_handle)
+ {
+ reason = wimp_poll(0, block);
+ if ((reason == 17 || reason == 18) && block[4] == 0x808c2)
+ child_handle = block[1];
+ else
+ process_event(reason, block);
+ }
+
+ /* Block until finished */
+ while (child_handle)
+ {
+ reason = wimp_poll(1, block);
+ if (reason == 3 || (reason == 8 && block[6] == 3))
+ {
+ /* Close window request or CTRL-C - kill child task. */
+ block[0] = 20;
+ block[3] = 0;
+ block[4] = 0x808c4; /* Morite */
+ swi(Wimp_SendMessage, 17, block, child_handle);
+ MSG_PUTS(_("\nSending message to terminate child process.\n"));
+ continue;
+ }
+ else if (reason == 8)
+ {
+ block[0] = 28;
+ block[3] = 0;
+ block[4] = 0x808c0; /* Input */
+ block[5] = 1;
+ /* Block[6] is OK as it is! */
+ swi(Wimp_SendMessage, 17, block, child_handle);
+ continue;
+ }
+ else if (reason == 17 || reason == 18)
+ {
+ if (block[4] == 0x808c1)
+ {
+ /* Ack message. */
+ block[3] = block[2];
+ swi(Wimp_SendMessage, 19, block, block[1]);
+ out = (char_u *)block + 24;
+ old_msg_col = msg_col;
+ while (block[5]--)
+ {
+ c = *out++;
+ if (out_file && (c != '\r' || (options & SHELL_FILTER)))
+ fputc(c, out_file);
+ if ((options & SHELL_FILTER) == 0)
+ {
+ if (c == 127)
+ msg_puts("\b \b");
+ else if (c > 31)
+ msg_putchar(c);
+ else if (c == 10)
+ {
+ lines_left = 8; /* Don't do More prompt! */
+ msg_putchar(10);
+ }
+ }
+ }
+ /* Flush output to the screen. */
+ windgoto(msg_row, msg_col);
+ out_flush();
+ continue;
+ }
+ }
+ process_event(reason, block);
+ }
+ msg_putchar('\n');
+ settmode(TMODE_RAW);
+ if (out_file)
+ fclose(out_file);
+ return OK;
+}
+
+/* Like strsave(), but stops at any control char */
+ char_u *
+wimp_strsave(str)
+ char *str;
+{
+ int strlen = 0;
+ char_u *retval;
+ while (str[strlen] > 31)
+ strlen++;
+ retval = alloc(strlen + 1);
+ if (retval)
+ {
+ memcpy(retval, str, strlen);
+ retval[strlen] = '\0';
+ }
+ return retval;
+}
+
+/* If we are saving then pop up a standard RISC OS save box.
+ * Otherwise, open a directory viewer on the given directory (and return NULL)
+ * The string we return will be freed later.
+ */
+ char_u *
+gui_mch_browse(saving, title, dflt, ext, initdir, filter)
+ int saving; /* write action */
+ char_u *title; /* title for the window */
+ char_u *dflt; /* default file name */
+ char_u *ext; /* extension added */
+ char_u *initdir; /* initial directory, NULL for current dir */
+ char_u *filter; /* file name filter */
+{
+ char command[256];
+ int length;
+
+ if (saving)
+ {
+ int block[64];
+ int reason;
+ int done_save = FALSE;
+ char_u *retval = NULL;
+ char_u *sprname;
+ char_u *fname;
+ int dragging_icon = FALSE;
+ int filetype;
+
+ if (!dflt)
+ dflt = "TextFile";
+
+ block[0] = save_window;
+ block[1] = 0;
+ swi(Wimp_GetIconState, 0, block);
+ sprname = ((char_u *) block[7]);
+ block[1] = 1;
+ swi(Wimp_GetIconState, 0, block);
+ fname = ((char *) block[7]);
+ strncpy(fname, dflt, 255);
+
+ if (xswi(OS_FSControl, 31, curbuf->b_p_oft) & v_flag)
+ {
+ filetype = 0xfff;
+ strcpy(sprname + 5, "xxx");
+ }
+ else
+ {
+ filetype = r2;
+ sprintf(sprname + 5, "%03x", filetype);
+ }
+
+ /* Open the save box */
+
+ swi(Wimp_GetPointerInfo, 0, block);
+ swi(Wimp_CreateMenu, 0, save_window, block[0] - 64, block[1] + 64);
+ swi(Wimp_SetCaretPosition, save_window, 1, 0, 0, -1, -1);
+
+ while (!done_save)
+ {
+ reason = wimp_poll(1, block);
+ switch (reason)
+ {
+ case 1:
+ redraw_window(block);
+ break;
+ case 2:
+ if (block[0] == save_window)
+ swi(Wimp_OpenWindow, 0, block);
+ else
+ ro_open_window(block);
+ break;
+ case 3:
+ done_save = TRUE;
+ break;
+ case 6:
+ if (block[3] != save_window)
+ done_save = TRUE;
+ else
+ {
+ int drag_box[4];
+ int min_x, max_y;
+
+ switch (block[4])
+ {
+ case 0: /* Start drag */
+ block[0] = save_window;
+ swi(Wimp_GetWindowState, 0, block);
+ min_x = block[1];
+ max_y = block[4];
+ block[1] = 0;
+ swi(Wimp_GetIconState, 0, block);
+ drag_box[0] = block[2] + min_x;
+ drag_box[1] = block[3] + max_y;
+ drag_box[2] = block[4] + min_x;
+ drag_box[3] = block[5] + max_y;
+
+ swi(DragASprite_Start,
+ 0x45,
+ 1,
+ sprname,
+ drag_box);
+ dragging_icon = TRUE;
+ break;
+ case 2: /* OK */
+ retval = wimp_strsave(fname);
+ done_save = TRUE;
+ break;
+ case 3: /* Cancel */
+ done_save = TRUE;
+ break;
+ }
+ }
+ break;
+ case 7:
+ if (dragging_icon)
+ {
+ int len = 0;
+
+ dragging_icon = FALSE;
+ swi(Wimp_GetPointerInfo, 0, block);
+ block[5] = block[3];
+ block[6] = block[4];
+ block[7] = block[0];
+ block[8] = block[1];
+ block[9] = 0; /* Don't know the size */
+ block[10] = filetype;
+
+ while (fname[len] > 31)
+ {
+ if (fname[len] == '.')
+ {
+ fname += len + 1;
+ len = 0;
+ }
+ else
+ len++;
+ }
+ if (len > 211)
+ len = 211;
+
+ memcpy(((char_u *) block) + 44, fname, len);
+ ((char_u *)block)[44 + len] = '\0';
+
+ block[0] = (len + 48) & 0xfc;
+ block[3] = 0;
+ block[4] = 1; /* DataSave */
+
+ swi(Wimp_SendMessage, 17, block, block[5], block[6]);
+ }
+ else
+ ro_drag_finished(block);
+ break;
+ case 8:
+ if (block[6] == 13)
+ {
+ retval = wimp_strsave(fname);
+ done_save = TRUE;
+ }
+ else if (block[6] == 0x1b)
+ done_save = TRUE;
+ else
+ swi(Wimp_ProcessKey, block[6]);
+ break;
+ case 17:
+ case 18:
+ if (block[4] == 2 && block[9] != -1)
+ {
+ /* DataSaveAck from dragging icon. */
+ retval = wimp_strsave(((char_u *) block) + 44);
+ done_save = TRUE;
+ }
+ else if (block[4] == 0x400c9)
+ {
+ /* MenusDeleted */
+ done_save = TRUE;
+ }
+ else
+ ro_message(block);
+ break;
+ }
+ }
+ block[0] = save_window;
+ swi(Wimp_CloseWindow, 0, block);
+ swi(Wimp_GetCaretPosition, 0, block);
+ if (block[0] == -1)
+ swi(Wimp_SetCaretPosition, gui.window_handle, -1, 0, 0, -1, -1);
+
+ return retval;
+ }
+ else if (initdir)
+ {
+ /* Open a directory viewer */
+ length = strlen(initdir);
+
+ if (length > 240)
+ return NULL; /* Path too long! */
+
+ length = sprintf(command, "Filer_OpenDir %s", initdir);
+ while (command[length - 1] == '.')
+ length--;
+ command[length] = '\0';
+ swi(OS_CLI, command);
+ }
+ return NULL;
+}
+
diff --git a/src/gui_riscos.h b/src/gui_riscos.h
new file mode 100644
index 000000000..fe22e6a81
--- /dev/null
+++ b/src/gui_riscos.h
@@ -0,0 +1,32 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#define FEAT_BROWSE
+
+#define TASK 0x4b534154
+
+/* Nested wimp flags: */
+#define CHILD_FIX_TO_WORKAREA 0
+#define CHILD_FIX_TO_LEFT 1
+#define CHILD_FIX_TO_BOTTOM 1
+#define CHILD_FIX_TO_RIGHT 2
+#define CHILD_FIX_TO_TOP 2
+
+#define CHILD_SELF_SCROLL 0
+#define CHILD_PARENT_SCROLL 1
+
+#define CHILD_LEFT 16
+#define CHILD_BOTTOM 18
+#define CHILD_RIGHT 20
+#define CHILD_TOP 22
+#define CHILD_SCROLL_X 24
+#define CHILD_SCROLL_Y 26
+
+int wimp_poll(int mask, int *block);
+int wimp_poll_idle(int mask, int *block, int end_time);
+void ro_open_main(int *block);
diff --git a/src/gui_w16.c b/src/gui_w16.c
new file mode 100644
index 000000000..e6aa85057
--- /dev/null
+++ b/src/gui_w16.c
@@ -0,0 +1,1524 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * gui_w16.c
+ *
+ * GUI support for Microsoft Windows 3.1x
+ *
+ * George V. Reilly <george@reilly.org> wrote the original Win32 GUI.
+ * Robert Webb reworked it to use the existing GUI stuff and added menu,
+ * scrollbars, etc.
+ *
+ * Vince Negri then butchered the code to get it compiling for
+ * 16-bit windows.
+ *
+ */
+
+/*
+ * Include the common stuff for MS-Windows GUI.
+ */
+#include "gui_w48.c"
+
+#include "guiw16rc.h"
+
+/* Undocumented Windows Message - not even defined in some SDK headers */
+#define WM_EXITSIZEMOVE 0x0232
+
+
+#ifdef FEAT_TOOLBAR
+# define CMD_TB_BASE (99)
+# include <vimtbar.h>
+#endif
+
+#ifdef PROTO
+# define WINAPI
+#endif
+
+#define HANDLE_WM_DROPFILES(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HDROP)(wParam)), 0L)
+
+
+/* Local variables: */
+
+#ifdef FEAT_MENU
+static UINT s_menu_id = 100;
+#endif
+
+
+#define VIM_NAME "vim"
+#define VIM_CLASS "Vim"
+
+#define DLG_ALLOC_SIZE 16 * 1024
+
+/*
+ * stuff for dialogs, menus, tearoffs etc.
+ */
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+static BOOL CALLBACK dialog_callback(HWND, UINT, WPARAM, LPARAM);
+
+static LPWORD
+add_dialog_element(
+ LPWORD p,
+ DWORD lStyle,
+ WORD x,
+ WORD y,
+ WORD w,
+ WORD h,
+ WORD Id,
+ BYTE clss,
+ const char *caption);
+
+static int dialog_default_button = -1;
+#endif
+
+static void get_dialog_font_metrics(void);
+
+#ifdef FEAT_TOOLBAR
+static void initialise_toolbar(void);
+#endif
+
+
+#ifdef FEAT_MENU
+/*
+ * Figure out how high the menu bar is at the moment.
+ */
+ static int
+gui_mswin_get_menu_height(
+ int fix_window) /* If TRUE, resize window if menu height changed */
+{
+ static int old_menu_height = -1;
+
+ int num;
+ int menu_height;
+
+ if (gui.menu_is_active)
+ num = GetMenuItemCount(s_menuBar);
+ else
+ num = 0;
+
+ if (num == 0)
+ menu_height = 0;
+ else if (gui.starting)
+ menu_height = GetSystemMetrics(SM_CYMENU);
+ else
+ {
+ RECT r1, r2;
+ int frameht = GetSystemMetrics(SM_CYFRAME);
+ int capht = GetSystemMetrics(SM_CYCAPTION);
+
+ /* get window rect of s_hwnd
+ * get client rect of s_hwnd
+ * get cap height
+ * subtract from window rect, the sum of client height,
+ * (if not maximized)frame thickness, and caption height.
+ */
+ GetWindowRect(s_hwnd, &r1);
+ GetClientRect(s_hwnd, &r2);
+ menu_height = r1.bottom - r1.top - (r2.bottom-r2.top +
+ 2 * frameht * (!IsZoomed(s_hwnd)) + capht);
+ }
+
+ if (fix_window && menu_height != old_menu_height)
+ {
+ old_menu_height = menu_height;
+ gui_set_shellsize(FALSE, FALSE);
+ }
+
+ return menu_height;
+}
+#endif /*FEAT_MENU*/
+
+
+/*
+ * Even though we have _DuringSizing() which makes the rubber band a valid
+ * size, we need this for when the user maximises the window.
+ * TODO: Doesn't seem to adjust the width though for some reason.
+ */
+ static BOOL
+_OnWindowPosChanging(
+ HWND hwnd,
+ LPWINDOWPOS lpwpos)
+{
+
+ if (!IsIconic(hwnd) && !(lpwpos->flags & SWP_NOSIZE))
+ {
+ gui_mswin_get_valid_dimensions(lpwpos->cx, lpwpos->cy,
+ &lpwpos->cx, &lpwpos->cy);
+ }
+ return 0;
+}
+
+
+
+
+
+ static LRESULT CALLBACK
+_WndProc(
+ HWND hwnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ /*
+ TRACE("WndProc: hwnd = %08x, msg = %x, wParam = %x, lParam = %x\n",
+ hwnd, uMsg, wParam, lParam);
+ */
+
+ HandleMouseHide(uMsg, lParam);
+
+ s_uMsg = uMsg;
+ s_wParam = wParam;
+ s_lParam = lParam;
+
+ switch (uMsg)
+ {
+ HANDLE_MSG(hwnd, WM_DEADCHAR, _OnDeadChar);
+ HANDLE_MSG(hwnd, WM_SYSDEADCHAR, _OnDeadChar);
+ /* HANDLE_MSG(hwnd, WM_ACTIVATE, _OnActivate); */
+ HANDLE_MSG(hwnd, WM_CHAR, _OnChar);
+ HANDLE_MSG(hwnd, WM_CLOSE, _OnClose);
+ /* HANDLE_MSG(hwnd, WM_COMMAND, _OnCommand); */
+ HANDLE_MSG(hwnd, WM_DESTROY, _OnDestroy);
+ HANDLE_MSG(hwnd, WM_DROPFILES, _OnDropFiles);
+ HANDLE_MSG(hwnd, WM_HSCROLL, _OnScroll);
+ HANDLE_MSG(hwnd, WM_KILLFOCUS, _OnKillFocus);
+#ifdef FEAT_MENU
+ HANDLE_MSG(hwnd, WM_COMMAND, _OnMenu);
+#endif
+ /* HANDLE_MSG(hwnd, WM_MOVE, _OnMove); */
+ /* HANDLE_MSG(hwnd, WM_NCACTIVATE, _OnNCActivate); */
+ HANDLE_MSG(hwnd, WM_SETFOCUS, _OnSetFocus);
+ HANDLE_MSG(hwnd, WM_SIZE, _OnSize);
+ /* HANDLE_MSG(hwnd, WM_SYSCOMMAND, _OnSysCommand); */
+ /* HANDLE_MSG(hwnd, WM_SYSKEYDOWN, _OnAltKey); */
+ HANDLE_MSG(hwnd, WM_VSCROLL, _OnScroll);
+ HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGING, _OnWindowPosChanging);
+ HANDLE_MSG(hwnd, WM_ACTIVATEAPP, _OnActivateApp);
+
+ case WM_QUERYENDSESSION: /* System wants to go down. */
+ gui_shell_closed(); /* Will exit when no changed buffers. */
+ return FALSE; /* Do NOT allow system to go down. */
+
+ case WM_ENDSESSION:
+ if (wParam) /* system only really goes down when wParam is TRUE */
+ _OnEndSession();
+ break;
+
+ case WM_SYSCHAR:
+ /*
+ * if 'winaltkeys' is "no", or it's "menu" and it's not a menu
+ * shortcut key, handle like a typed ALT key, otherwise call Windows
+ * ALT key handling.
+ */
+#ifdef FEAT_MENU
+ if ( !gui.menu_is_active
+ || p_wak[0] == 'n'
+ || (p_wak[0] == 'm' && !gui_is_menu_shortcut((int)wParam))
+ )
+#endif
+ return HANDLE_WM_SYSCHAR((hwnd), (wParam), (lParam), (_OnSysChar));
+#ifdef FEAT_MENU
+ else
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+#endif
+
+ case WM_SYSKEYUP:
+#ifdef FEAT_MENU
+ /* Only when menu is active, ALT key is used for that. */
+ if (gui.menu_is_active)
+ {
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ }
+ else
+#endif
+ return 0;
+
+#if defined(MENUHINTS) && defined(FEAT_MENU)
+ case WM_MENUSELECT:
+ if (((UINT) LOWORD(lParam)
+ & (0xffff ^ (MF_MOUSESELECT + MF_BITMAP + MF_POPUP)))
+ == MF_HILITE
+ && (State & CMDLINE) == 0)
+ {
+ UINT idButton;
+ int idx;
+ vimmenu_T *pMenu;
+
+ idButton = (UINT)LOWORD(wParam);
+ pMenu = gui_mswin_find_menu(root_menu, idButton);
+ if (pMenu)
+ {
+ idx = MENU_INDEX_TIP;
+ msg_clr_cmdline();
+ if (pMenu->strings[idx])
+ msg(pMenu->strings[idx]);
+ else
+ msg("");
+ setcursor();
+ out_flush();
+ }
+ }
+ break;
+#endif
+ case WM_NCHITTEST:
+ {
+ LRESULT result;
+ int x, y;
+ int xPos = GET_X_LPARAM(lParam);
+
+ result = MyWindowProc(hwnd, uMsg, wParam, lParam);
+ if (result == HTCLIENT)
+ {
+ gui_mch_get_winpos(&x, &y);
+ xPos -= x;
+
+ if (xPos < 48) /*<VN> TODO should use system metric?*/
+ return HTBOTTOMLEFT;
+ else
+ return HTBOTTOMRIGHT;
+ }
+ else
+ return result;
+ }
+ /* break; */
+ default:
+#ifdef MSWIN_FIND_REPLACE
+ if (uMsg == s_findrep_msg && s_findrep_msg != 0)
+ {
+ _OnFindRepl();
+ }
+#endif
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ }
+
+ return 1;
+}
+
+
+
+/*
+ * End of call-back routines
+ */
+
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(int *argc, char **argv)
+{
+ /* No special args for win16 GUI at the moment. */
+
+}
+
+/*
+ * Initialise the GUI. Create all the windows, set up all the call-backs
+ * etc.
+ */
+ int
+gui_mch_init(void)
+{
+ const char szVimWndClass[] = VIM_CLASS;
+ const char szTextAreaClass[] = "VimTextArea";
+ WNDCLASS wndclass;
+
+#ifdef WIN16_3DLOOK
+ Ctl3dRegister(s_hinst);
+ Ctl3dAutoSubclass(s_hinst);
+#endif
+
+ /* Display any pending error messages */
+ display_errors();
+
+ gui.scrollbar_width = GetSystemMetrics(SM_CXVSCROLL);
+ gui.scrollbar_height = GetSystemMetrics(SM_CYHSCROLL);
+#ifdef FEAT_MENU
+ gui.menu_height = 0; /* Windows takes care of this */
+#endif
+ gui.border_width = 0;
+
+ gui.currBgColor = INVALCOLOR;
+
+ s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
+
+ if (GetClassInfo(s_hinst, szVimWndClass, &wndclass) == 0) {
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = _WndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = s_hinst;
+ wndclass.hIcon = LoadIcon(wndclass.hInstance, MAKEINTRESOURCE(IDR_VIM));
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = s_brush;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = szVimWndClass;
+
+ if ((
+#ifdef GLOBAL_IME
+ atom =
+#endif
+ RegisterClass(&wndclass)) == 0)
+ return FAIL;
+ }
+
+ s_hwnd = CreateWindow(
+ szVimWndClass, "Vim MSWindows GUI",
+ WS_OVERLAPPEDWINDOW,
+ gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
+ gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
+ 100, /* Any value will do */
+ 100, /* Any value will do */
+ NULL, NULL,
+ s_hinst, NULL);
+
+ if (s_hwnd == NULL)
+ return FAIL;
+
+#ifdef GLOBAL_IME
+ global_ime_init(atom, s_hwnd);
+#endif
+
+ /* Create the text area window */
+ if (GetClassInfo(s_hinst, szTextAreaClass, &wndclass) == 0) {
+ wndclass.style = CS_OWNDC;
+ wndclass.lpfnWndProc = _TextAreaWndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = s_hinst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = NULL;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = szTextAreaClass;
+
+ if (RegisterClass(&wndclass) == 0)
+ return FAIL;
+ }
+ s_textArea = CreateWindow(
+ szTextAreaClass, "Vim text area",
+ WS_CHILD | WS_VISIBLE, 0, 0,
+ 100, /* Any value will do for now */
+ 100, /* Any value will do for now */
+ s_hwnd, NULL,
+ s_hinst, NULL);
+
+ if (s_textArea == NULL)
+ return FAIL;
+
+#ifdef FEAT_MENU
+ s_menuBar = CreateMenu();
+#endif
+ s_hdc = GetDC(s_textArea);
+
+#ifdef MSWIN16_FASTTEXT
+ SetBkMode(s_hdc, OPAQUE);
+#endif
+
+ DragAcceptFiles(s_hwnd, TRUE);
+
+ /* Do we need to bother with this? */
+ /* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
+
+ /* Get background/foreground colors from the system */
+ gui_mch_def_colors();
+
+ /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
+ * file) */
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color.
+ * Then store the current values as the defaults.
+ */
+ gui_check_colors();
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them) */
+ highlight_gui_started();
+
+ /*
+ * Start out by adding the configured border width into the border offset
+ */
+ gui.border_offset = gui.border_width;
+
+
+ /*
+ * compute a couple of metrics used for the dialogs
+ */
+ get_dialog_font_metrics();
+#ifdef FEAT_TOOLBAR
+ /*
+ * Create the toolbar
+ */
+ initialise_toolbar();
+#endif
+#ifdef MSWIN_FIND_REPLACE
+ /*
+ * Initialise the dialog box stuff
+ */
+ s_findrep_msg = RegisterWindowMessage(FINDMSGSTRING);
+
+ /* Initialise the struct */
+ s_findrep_struct.lStructSize = sizeof(s_findrep_struct);
+ s_findrep_struct.lpstrFindWhat = alloc(MSWIN_FR_BUFSIZE);
+ s_findrep_struct.lpstrFindWhat[0] = NUL;
+ s_findrep_struct.lpstrReplaceWith = alloc(MSWIN_FR_BUFSIZE);
+ s_findrep_struct.lpstrReplaceWith[0] = NUL;
+ s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
+ s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
+#endif
+
+ return OK;
+}
+
+
+/*
+ * Set the size of the window to the given width and height in pixels.
+ */
+ void
+gui_mch_set_shellsize(int width, int height,
+ int min_width, int min_height, int base_width, int base_height)
+{
+ RECT workarea_rect;
+ int win_width, win_height;
+ int win_xpos, win_ypos;
+ WINDOWPLACEMENT wndpl;
+
+ /* try to keep window completely on screen */
+ /* get size of the screen work area - use SM_CYFULLSCREEN
+ * instead of SM_CYSCREEN so that we don't overlap the
+ * taskbar if someone fires us up on Win95/NT */
+ workarea_rect.left = 0;
+ workarea_rect.top = 0;
+ workarea_rect.right = GetSystemMetrics(SM_CXSCREEN);
+ workarea_rect.bottom = GetSystemMetrics(SM_CYFULLSCREEN);
+
+ /* get current posision of our window */
+ wndpl.length = sizeof(WINDOWPLACEMENT);
+ GetWindowPlacement(s_hwnd, &wndpl);
+ if (wndpl.showCmd == SW_SHOWNORMAL)
+ {
+ win_xpos = wndpl.rcNormalPosition.left;
+ win_ypos = wndpl.rcNormalPosition.top;
+ }
+ else
+ {
+ win_xpos = workarea_rect.left;
+ win_ypos = workarea_rect.top;
+ }
+
+ /* compute the size of the outside of the window */
+ win_width = width + GetSystemMetrics(SM_CXFRAME) * 2;
+ win_height = height + GetSystemMetrics(SM_CYFRAME) * 2
+ + GetSystemMetrics(SM_CYCAPTION)
+#ifdef FEAT_MENU
+ + gui_mswin_get_menu_height(FALSE)
+#endif
+ ;
+
+ /* if the window is going off the screen, move it on to the screen */
+ if (win_xpos + win_width > workarea_rect.right)
+ win_xpos = workarea_rect.right - win_width;
+
+ if (win_xpos < workarea_rect.left)
+ win_xpos = workarea_rect.left;
+
+ if (win_ypos + win_height > workarea_rect.bottom)
+ win_ypos = workarea_rect.bottom - win_height;
+
+ if (win_ypos < workarea_rect.top)
+ win_ypos = workarea_rect.top;
+
+ /* set window position */
+ SetWindowPos(s_hwnd, NULL, win_xpos, win_ypos, win_width, win_height,
+ SWP_NOZORDER | SWP_NOACTIVATE);
+
+#ifdef FEAT_MENU
+ /* Menu may wrap differently now */
+ gui_mswin_get_menu_height(!gui.starting);
+#endif
+}
+
+ void
+gui_mch_set_scrollbar_thumb(
+ scrollbar_T *sb,
+ long val,
+ long size,
+ long max)
+{
+ sb->scroll_shift = 0;
+ while (max > 32767)
+ {
+ max = (max + 1) >> 1;
+ val >>= 1;
+ size >>= 1;
+ ++sb->scroll_shift;
+ }
+
+ if (sb->scroll_shift > 0)
+ ++size;
+
+ SetScrollRange(sb->id, SB_CTL, 0, (int) max, FALSE);
+ SetScrollPos(sb->id, SB_CTL, (int) val, TRUE);
+}
+
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(GuiFont font)
+{
+ gui.currFont = font;
+ SelectFont(s_hdc, gui.currFont);
+}
+
+
+
+
+/*
+ * Set the current text foreground color.
+ */
+ void
+gui_mch_set_fg_color(guicolor_T color)
+{
+ gui.currFgColor = color;
+ SetTextColor(s_hdc, gui.currFgColor);
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(guicolor_T color)
+{
+ if (gui.currBgColor == color)
+ return;
+
+ gui.currBgColor = color;
+ SetBkColor(s_hdc, gui.currBgColor);
+}
+
+
+
+ void
+gui_mch_draw_string(
+ int row,
+ int col,
+ char_u *text,
+ int len,
+ int flags)
+{
+#ifndef MSWIN16_FASTTEXT
+ static int *padding = NULL;
+ static int pad_size = 0;
+ int i;
+#endif
+ HPEN hpen, old_pen;
+ int y;
+
+#ifndef MSWIN16_FASTTEXT
+ /*
+ * Italic and bold text seems to have an extra row of pixels at the bottom
+ * (below where the bottom of the character should be). If we draw the
+ * characters with a solid background, the top row of pixels in the
+ * character below will be overwritten. We can fix this by filling in the
+ * background ourselves, to the correct character proportions, and then
+ * writing the character in transparent mode. Still have a problem when
+ * the character is "_", which gets written on to the character below.
+ * New fix: set gui.char_ascent to -1. This shifts all characters up one
+ * pixel in their slots, which fixes the problem with the bottom row of
+ * pixels. We still need this code because otherwise the top row of pixels
+ * becomes a problem. - webb.
+ */
+ HBRUSH hbr;
+ RECT rc;
+
+ if (!(flags & DRAW_TRANSP))
+ {
+ /*
+ * Clear background first.
+ * Note: FillRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(col);
+ rc.top = FILL_Y(row);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int cell_len = 0;
+
+ /* Compute the length in display cells. */
+ for (n = 0; n < len; n += MB_BYTE2LEN(text[n]))
+ cell_len += (*mb_ptr2cells)(text + n);
+ rc.right = FILL_X(col + cell_len);
+ }
+ else
+#endif
+ rc.right = FILL_X(col + len);
+ rc.bottom = FILL_Y(row + 1);
+ hbr = CreateSolidBrush(gui.currBgColor);
+ FillRect(s_hdc, &rc, hbr);
+ DeleteBrush(hbr);
+
+ SetBkMode(s_hdc, TRANSPARENT);
+
+ /*
+ * When drawing block cursor, prevent inverted character spilling
+ * over character cell (can happen with bold/italic)
+ */
+ if (flags & DRAW_CURSOR)
+ {
+ pcliprect = &rc;
+ foptions = ETO_CLIPPED;
+ }
+ }
+#else
+ /*
+ * Alternative: write the characters in opaque mode, since we have blocked
+ * bold or italic fonts.
+ */
+ /* The OPAQUE mode and backcolour have already been set */
+#endif
+ /* The forecolor and font have already been set */
+
+#ifndef MSWIN16_FASTTEXT
+
+ if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width)
+ {
+ vim_free(padding);
+ pad_size = Columns;
+
+ padding = (int *)alloc(pad_size * sizeof(int));
+ if (padding != NULL)
+ for (i = 0; i < pad_size; i++)
+ padding[i] = gui.char_width;
+ }
+#endif
+
+ /*
+ * We have to provide the padding argument because italic and bold versions
+ * of fixed-width fonts are often one pixel or so wider than their normal
+ * versions.
+ * No check for DRAW_BOLD, Windows will have done it already.
+ */
+#ifndef MSWIN16_FASTTEXT
+ ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row), 0, NULL,
+ (char *)text, len, padding);
+#else
+ TextOut(s_hdc, TEXT_X(col), TEXT_Y(row), (char *)text, len);
+#endif
+
+ if (flags & DRAW_UNDERL)
+ {
+ hpen = CreatePen(PS_SOLID, 1, gui.currFgColor);
+ old_pen = SelectObject(s_hdc, hpen);
+ /* When p_linespace is 0, overwrite the bottom row of pixels.
+ * Otherwise put the line just below the character. */
+ y = FILL_Y(row + 1) - 1;
+#ifndef MSWIN16_FASTTEXT
+ if (p_linespace > 1)
+ y -= p_linespace - 1;
+#endif
+ MoveToEx(s_hdc, FILL_X(col), y, NULL);
+ /* Note: LineTo() excludes the last pixel in the line. */
+ LineTo(s_hdc, FILL_X(col + len), y);
+ DeleteObject(SelectObject(s_hdc, old_pen));
+ }
+}
+
+
+/*
+ * Output routines.
+ */
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush(void)
+{
+ /* Is anything needed here? */
+}
+
+ static void
+clear_rect(RECT *rcp)
+{
+ /* Use trick for fast rect clear */
+ gui_mch_set_bg_color(gui.back_pixel);
+ ExtTextOut(s_hdc, 0, 0, ETO_CLIPPED | ETO_OPAQUE, rcp, NULL, 0, NULL);
+}
+
+
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Add a sub menu to the menu bar.
+ */
+ void
+gui_mch_add_menu(
+ vimmenu_T *menu,
+ int pos)
+{
+ vimmenu_T *parent = menu->parent;
+
+ menu->submenu_id = CreatePopupMenu();
+ menu->id = s_menu_id++;
+
+ if (menu_is_menubar(menu->name))
+ {
+ InsertMenu((parent == NULL) ? s_menuBar : parent->submenu_id,
+ (UINT)pos, MF_POPUP | MF_STRING | MF_BYPOSITION,
+ (UINT)menu->submenu_id, menu->name);
+ }
+
+ /* Fix window size if menu may have wrapped */
+ if (parent == NULL)
+ gui_mswin_get_menu_height(!gui.starting);
+}
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+ POINT mp;
+
+ (void)GetCursorPos((LPPOINT)&mp);
+ gui_mch_show_popupmenu_at(menu, (int)mp.x, (int)mp.y);
+}
+
+ void
+gui_make_popup(char_u *path_name)
+{
+ vimmenu_T *menu = gui_find_menu(path_name);
+
+ if (menu != NULL)
+ {
+ /* Find the position of the current cursor */
+ DWORD temp_p;
+ POINT p;
+ temp_p = GetDCOrg(s_hdc);
+ p.x = LOWORD(temp_p);
+ p.y = HIWORD(temp_p);
+ if (curwin!=NULL)
+ {
+ p.x+= TEXT_X(W_WINCOL(curwin) + curwin->w_wcol +1);
+ p.y+= TEXT_Y(W_WINROW(curwin) + curwin->w_wrow +1);
+ }
+ msg_scroll = FALSE;
+ gui_mch_show_popupmenu_at(menu, (int)p.x, (int)p.y);
+ }
+}
+
+/*
+ * Add a menu item to a menu
+ */
+ void
+gui_mch_add_menu_item(
+ vimmenu_T *menu,
+ int idx)
+{
+ vimmenu_T *parent = menu->parent;
+
+ menu->id = s_menu_id++;
+ menu->submenu_id = NULL;
+
+#ifdef FEAT_TOOLBAR
+ if (menu_is_toolbar(parent->name))
+ {
+ TBBUTTON newtb;
+
+ vim_memset(&newtb, 0, sizeof(newtb));
+ if (menu_is_separator(menu->name))
+ {
+ newtb.iBitmap = 0;
+ newtb.fsStyle = TBSTYLE_SEP;
+ }
+ else
+ {
+ if (menu->iconidx >= TOOLBAR_BITMAP_COUNT)
+ newtb.iBitmap = -1;
+ else
+ newtb.iBitmap = menu->iconidx;
+ newtb.fsStyle = TBSTYLE_BUTTON;
+ }
+ newtb.idCommand = menu->id;
+ newtb.fsState = TBSTATE_ENABLED;
+ SendMessage(s_toolbarhwnd, TB_INSERTBUTTON, (WPARAM)idx,
+ (LPARAM)&newtb);
+ menu->submenu_id = (HMENU)-1;
+ }
+ else
+#endif
+ {
+ InsertMenu(parent->submenu_id, (UINT)idx,
+ (menu_is_separator(menu->name) ? MF_SEPARATOR : MF_STRING)
+ | MF_BYPOSITION,
+ (UINT)menu->id, menu->name);
+ }
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+ UINT i, j;
+ char pants[80]; /*<VN> hack*/
+#ifdef FEAT_TOOLBAR
+ /*
+ * is this a toolbar button?
+ */
+ if (menu->submenu_id == (HMENU)-1)
+ {
+ int iButton;
+
+ iButton = SendMessage(s_toolbarhwnd, TB_COMMANDTOINDEX, (WPARAM)menu->id, 0);
+ SendMessage(s_toolbarhwnd, TB_DELETEBUTTON, (WPARAM)iButton, 0);
+ }
+ else
+#endif
+ {
+ /*
+ * negri: horrible API bug when running 16-bit programs under Win9x or
+ * NT means that we can't use MF_BYCOMMAND for menu items which have
+ * submenus, including the top-level headings. We have to find the menu
+ * item and use MF_BYPOSITION instead. :-p
+ */
+ if (menu->parent != NULL
+ && menu_is_popup(menu->parent->dname)
+ && menu->parent->submenu_id != NULL)
+ RemoveMenu(menu->parent->submenu_id, menu->id, MF_BYCOMMAND);
+ else if (menu->submenu_id == NULL)
+ RemoveMenu(s_menuBar, menu->id, MF_BYCOMMAND);
+ else if (menu->parent != NULL)
+ {
+ i = GetMenuItemCount(menu->parent->submenu_id);
+ for (j = 0; j < i; ++j)
+ {
+ GetMenuString(menu->parent->submenu_id, j,
+ pants, 80, MF_BYPOSITION);
+ if (strcmp(pants, menu->name) == 0)
+ {
+ RemoveMenu(menu->parent->submenu_id, j, MF_BYPOSITION);
+ break;
+ }
+ }
+ }
+ else
+ {
+ i = GetMenuItemCount(s_menuBar);
+ for (j = 0; j < i; ++j)
+ {
+ GetMenuString(s_menuBar, j, pants, 80, MF_BYPOSITION);
+ if (strcmp(pants, menu->name) == 0)
+ {
+ RemoveMenu(s_menuBar, j, MF_BYPOSITION);
+ break;
+ }
+ }
+ }
+
+ if (menu->submenu_id != NULL)
+ DestroyMenu(menu->submenu_id);
+ }
+ DrawMenuBar(s_hwnd);
+}
+
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(
+ vimmenu_T *menu,
+ int grey)
+{
+#ifdef FEAT_TOOLBAR
+ /*
+ * is this a toolbar button?
+ */
+ if (menu->submenu_id == (HMENU)-1)
+ {
+ SendMessage(s_toolbarhwnd, TB_ENABLEBUTTON,
+ (WPARAM)menu->id, (LPARAM) MAKELONG((grey ? FALSE : TRUE), 0) );
+ }
+ else
+#endif
+ if (grey)
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_GRAYED);
+ else
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_ENABLED);
+
+}
+
+
+#endif /*FEAT_MENU*/
+
+
+/* define some macros used to make the dialogue creation more readable */
+
+#define add_string(s) strcpy((LPSTR)p, s); (LPSTR)p += (strlen((LPSTR)p) + 1)
+#define add_word(x) *p++ = (x)
+#define add_byte(x) *((LPSTR)p)++ = (x)
+#define add_long(x) *((LPDWORD)p)++ = (x)
+
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+/*
+ * stuff for dialogs
+ */
+
+/*
+ * The callback routine used by all the dialogs. Very simple. First,
+ * acknowledges the INITDIALOG message so that Windows knows to do standard
+ * dialog stuff (Return = default, Esc = cancel....) Second, if a button is
+ * pressed, return that button's ID - IDCANCEL (2), which is the button's
+ * number.
+ */
+ static BOOL CALLBACK
+dialog_callback(
+ HWND hwnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ if (message == WM_INITDIALOG)
+ {
+ CenterWindow(hwnd, GetWindow(hwnd, GW_OWNER));
+ /* Set focus to the dialog. Set the default button, if specified. */
+ (void)SetFocus(hwnd);
+ if (dialog_default_button > IDCANCEL)
+ (void)SetFocus(GetDlgItem(hwnd, dialog_default_button));
+// if (dialog_default_button > 0)
+// (void)SetFocus(GetDlgItem(hwnd, dialog_default_button + IDCANCEL));
+ return FALSE;
+ }
+
+ if (message == WM_COMMAND)
+ {
+ int button = LOWORD(wParam);
+
+ /* Don't end the dialog if something was selected that was
+ * not a button.
+ */
+ if (button >= DLG_NONBUTTON_CONTROL)
+ return TRUE;
+
+ /* If the edit box exists, copy the string. */
+ if (s_textfield != NULL)
+ GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2,
+ s_textfield, IOSIZE);
+
+ /*
+ * Need to check for IDOK because if the user just hits Return to
+ * accept the default value, some reason this is what we get.
+ */
+ if (button == IDOK)
+ EndDialog(hwnd, dialog_default_button);
+ else
+ EndDialog(hwnd, button - IDCANCEL);
+ return TRUE;
+ }
+
+ if ((message == WM_SYSCOMMAND) && (wParam == SC_CLOSE))
+ {
+ EndDialog(hwnd, 0);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Create a dialog dynamically from the parameter strings.
+ * type = type of dialog (question, alert, etc.)
+ * title = dialog title. may be NULL for default title.
+ * message = text to display. Dialog sizes to accommodate it.
+ * buttons = '\n' separated list of button captions, default first.
+ * dfltbutton = number of default button.
+ *
+ * This routine returns 1 if the first button is pressed,
+ * 2 for the second, etc.
+ *
+ * 0 indicates Esc was pressed.
+ * -1 for unexpected error
+ *
+ * If stubbing out this fn, return 1.
+ */
+
+static const char_u dlg_icons[] = /* must match names in resource file */
+{
+ IDR_VIM,
+ IDR_VIM_ERROR,
+ IDR_VIM_ALERT,
+ IDR_VIM_INFO,
+ IDR_VIM_QUESTION
+};
+
+ int
+gui_mch_dialog(
+ int type,
+ char_u *title,
+ char_u *message,
+ char_u *buttons,
+ int dfltbutton,
+ char_u *textfield)
+{
+ FARPROC dp;
+ LPWORD p, pnumitems;
+ int numButtons;
+ int *buttonWidths, *buttonPositions;
+ int buttonYpos;
+ int nchar, i;
+ DWORD lStyle;
+ int dlgwidth = 0;
+ int dlgheight;
+ int editboxheight;
+ int horizWidth;
+ int msgheight;
+ char_u *pstart;
+ char_u *pend;
+ char_u *tbuffer;
+ RECT rect;
+ HWND hwnd;
+ HDC hdc;
+ HFONT oldFont;
+ TEXTMETRIC fontInfo;
+ int fontHeight;
+ int textWidth, minButtonWidth, messageWidth;
+ int maxDialogWidth;
+ int vertical;
+ int dlgPaddingX;
+ int dlgPaddingY;
+ HGLOBAL hglbDlgTemp;
+
+#ifndef NO_CONSOLE
+ /* Don't output anything in silent mode ("ex -s") */
+ if (silent_mode)
+ return dfltbutton; /* return default option */
+#endif
+
+ /* If there is no window yet, open it. */
+ if (s_hwnd == NULL && gui_mch_init() == FAIL)
+ return dfltbutton;
+
+ if ((type < 0) || (type > VIM_LAST_TYPE))
+ type = 0;
+
+ /* allocate some memory for dialog template */
+ /* TODO should compute this really*/
+
+ hglbDlgTemp = GlobalAlloc(GHND, DLG_ALLOC_SIZE);
+ if (hglbDlgTemp == NULL)
+ return -1;
+
+ p = (LPWORD) GlobalLock(hglbDlgTemp);
+
+ if (p == NULL)
+ return -1;
+
+ /*
+ * make a copy of 'buttons' to fiddle with it. complier grizzles because
+ * vim_strsave() doesn't take a const arg (why not?), so cast away the
+ * const.
+ */
+ tbuffer = vim_strsave(buttons);
+ if (tbuffer == NULL)
+ return -1;
+
+ --dfltbutton; /* Change from one-based to zero-based */
+
+ /* Count buttons */
+ numButtons = 1;
+ for (i = 0; tbuffer[i] != '\0'; i++)
+ {
+ if (tbuffer[i] == DLG_BUTTON_SEP)
+ numButtons++;
+ }
+ if (dfltbutton >= numButtons)
+ dfltbutton = 0;
+
+ /* Allocate array to hold the width of each button */
+ buttonWidths = (int *) lalloc(numButtons * sizeof(int), TRUE);
+ if (buttonWidths == NULL)
+ return -1;
+
+ /* Allocate array to hold the X position of each button */
+ buttonPositions = (int *) lalloc(numButtons * sizeof(int), TRUE);
+ if (buttonPositions == NULL)
+ return -1;
+
+ /*
+ * Calculate how big the dialog must be.
+ */
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+ oldFont = SelectFont(hdc, GetStockObject(SYSTEM_FONT));
+ dlgPaddingX = DLG_OLD_STYLE_PADDING_X;
+ dlgPaddingY = DLG_OLD_STYLE_PADDING_Y;
+
+ GetTextMetrics(hdc, &fontInfo);
+ fontHeight = fontInfo.tmHeight;
+
+ /* Minimum width for horizontal button */
+ minButtonWidth = GetTextWidth(hdc, "Cancel", 6);
+
+ /* Maximum width of a dialog, if possible */
+ GetWindowRect(s_hwnd, &rect);
+ maxDialogWidth = rect.right - rect.left
+ - GetSystemMetrics(SM_CXFRAME) * 2;
+ if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
+ maxDialogWidth = DLG_MIN_MAX_WIDTH;
+
+ /* Set dlgwidth to width of message */
+ pstart = message;
+ messageWidth = 0;
+ msgheight = 0;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); /* Last line of message. */
+ msgheight += fontHeight;
+ textWidth = GetTextWidth(hdc, pstart, pend - pstart);
+ if (textWidth > messageWidth)
+ messageWidth = textWidth;
+ pstart = pend + 1;
+ } while (*pend != NUL);
+ dlgwidth = messageWidth;
+
+ /* Add width of icon to dlgwidth, and some space */
+ dlgwidth += DLG_ICON_WIDTH + 3 * dlgPaddingX;
+
+ if (msgheight < DLG_ICON_HEIGHT)
+ msgheight = DLG_ICON_HEIGHT;
+
+ /*
+ * Check button names. A long one will make the dialog wider.
+ */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+ if (!vertical)
+ {
+ // Place buttons horizontally if they fit.
+ horizWidth = dlgPaddingX;
+ pstart = tbuffer;
+ i = 0;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); // Last button name.
+ textWidth = GetTextWidth(hdc, pstart, pend - pstart);
+ if (textWidth < minButtonWidth)
+ textWidth = minButtonWidth;
+ textWidth += dlgPaddingX; /* Padding within button */
+ buttonWidths[i] = textWidth;
+ buttonPositions[i++] = horizWidth;
+ horizWidth += textWidth + dlgPaddingX; /* Pad between buttons */
+ pstart = pend + 1;
+ } while (*pend != NUL);
+
+ if (horizWidth > maxDialogWidth)
+ vertical = TRUE; // Too wide to fit on the screen.
+ else if (horizWidth > dlgwidth)
+ dlgwidth = horizWidth;
+ }
+
+ if (vertical)
+ {
+ // Stack buttons vertically.
+ pstart = tbuffer;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); // Last button name.
+ textWidth = GetTextWidth(hdc, pstart, pend - pstart);
+ textWidth += dlgPaddingX; /* Padding within button */
+ textWidth += DLG_VERT_PADDING_X * 2; /* Padding around button */
+ if (textWidth > dlgwidth)
+ dlgwidth = textWidth;
+ pstart = pend + 1;
+ } while (*pend != NUL);
+ }
+
+ if (dlgwidth < DLG_MIN_WIDTH)
+ dlgwidth = DLG_MIN_WIDTH; /* Don't allow a really thin dialog!*/
+
+ /* start to fill in the dlgtemplate information. addressing by WORDs */
+ lStyle = DS_MODALFRAME | WS_CAPTION | WS_VISIBLE ;
+
+ add_long(lStyle);
+ pnumitems = p; /*save where the number of items must be stored*/
+ add_byte(0); // NumberOfItems(will change later)
+ add_word(10); // x
+ add_word(10); // y
+ add_word(PixelToDialogX(dlgwidth));
+
+ // Dialog height.
+ if (vertical)
+ dlgheight = msgheight + 2 * dlgPaddingY +
+ DLG_VERT_PADDING_Y + 2 * fontHeight * numButtons;
+ else
+ dlgheight = msgheight + 3 * dlgPaddingY + 2 * fontHeight;
+
+ // Dialog needs to be taller if contains an edit box.
+ editboxheight = fontHeight + dlgPaddingY + 4 * DLG_VERT_PADDING_Y;
+ if (textfield != NULL)
+ dlgheight += editboxheight;
+
+ add_word(PixelToDialogY(dlgheight));
+
+ add_byte(0); //menu
+ add_byte(0); //class
+
+ /* copy the title of the dialog */
+ add_string(title ? title : ("Vim"VIM_VERSION_MEDIUM));
+
+ buttonYpos = msgheight + 2 * dlgPaddingY;
+
+ if (textfield != NULL)
+ buttonYpos += editboxheight;
+
+ pstart = tbuffer; //dflt_text
+ horizWidth = (dlgwidth - horizWidth) / 2; /* Now it's X offset */
+ for (i = 0; i < numButtons; i++)
+ {
+ /* get end of this button. */
+ for ( pend = pstart;
+ *pend && (*pend != DLG_BUTTON_SEP);
+ pend++)
+ ;
+
+ if (*pend)
+ *pend = '\0';
+
+ /*
+ * NOTE:
+ * setting the BS_DEFPUSHBUTTON style doesn't work because Windows sets
+ * the focus to the first tab-able button and in so doing makes that
+ * the default!! Grrr. Workaround: Make the default button the only
+ * one with WS_TABSTOP style. Means user can't tab between buttons, but
+ * he/she can use arrow keys.
+ *
+ * NOTE (Thore): Setting BS_DEFPUSHBUTTON works fine when it's the
+ * first one, so I changed the correct button to be this style. This
+ * is necessary because when an edit box is added, we need a button to
+ * be default. The edit box will be the default control, and when the
+ * user presses enter from the edit box we want the default button to
+ * be pressed.
+ */
+ if (vertical)
+ {
+ p = add_dialog_element(p,
+ ((i == dfltbutton || dfltbutton < 0) && textfield != NULL
+ ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP,
+ PixelToDialogX(DLG_VERT_PADDING_X),
+ PixelToDialogY(buttonYpos /* TBK */
+ + 2 * fontHeight * i),
+ PixelToDialogX(dlgwidth - 2 * DLG_VERT_PADDING_X),
+ (WORD)(PixelToDialogY(2 * fontHeight) - 1),
+ (WORD)(IDCANCEL + 1 + i), (BYTE)0x80, pstart);
+ }
+ else
+ {
+ p = add_dialog_element(p,
+ ((i == dfltbutton || dfltbutton < 0) && textfield != NULL
+ ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP,
+ PixelToDialogX(horizWidth + buttonPositions[i]),
+ PixelToDialogY(buttonYpos), /* TBK */
+ PixelToDialogX(buttonWidths[i]),
+ (WORD)(PixelToDialogY(2 * fontHeight) - 1),
+ (WORD)(IDCANCEL + 1 + i), (BYTE)0x80, pstart);
+ }
+
+ pstart = pend + 1; /*next button*/
+
+ }
+ *pnumitems += numButtons;
+
+ /* Vim icon */
+ p = add_dialog_element(p, SS_ICON,
+ PixelToDialogX(dlgPaddingX),
+ PixelToDialogY(dlgPaddingY),
+ PixelToDialogX(DLG_ICON_WIDTH),
+ PixelToDialogY(DLG_ICON_HEIGHT),
+ DLG_NONBUTTON_CONTROL + 0, (BYTE)0x82,
+ &dlg_icons[type]);
+
+
+ /* Dialog message */
+ p = add_dialog_element(p, SS_LEFT,
+ PixelToDialogX(2 * dlgPaddingX + DLG_ICON_WIDTH),
+ PixelToDialogY(dlgPaddingY),
+ (WORD)(PixelToDialogX(messageWidth) + 1),
+ PixelToDialogY(msgheight),
+ DLG_NONBUTTON_CONTROL + 1, (BYTE)0x82, message);
+
+ /* Edit box */
+ if (textfield != NULL)
+ {
+ p = add_dialog_element(p, ES_LEFT | ES_AUTOHSCROLL | WS_TABSTOP | WS_BORDER,
+ PixelToDialogX(2 * dlgPaddingX),
+ PixelToDialogY(2 * dlgPaddingY + msgheight),
+ PixelToDialogX(dlgwidth - 4 * dlgPaddingX),
+ PixelToDialogY(fontHeight + dlgPaddingY),
+ DLG_NONBUTTON_CONTROL + 2, (BYTE)0x81, textfield);
+ *pnumitems += 1;
+ }
+
+ *pnumitems += 2;
+
+ SelectFont(hdc, oldFont);
+ ReleaseDC(hwnd, hdc);
+ dp = MakeProcInstance((FARPROC)dialog_callback, s_hinst);
+
+
+ /* Let the dialog_callback() function know which button to make default
+ * If we have an edit box, make that the default. We also need to tell
+ * dialog_callback() if this dialog contains an edit box or not. We do
+ * this by setting s_textfield if it does.
+ */
+ if (textfield != NULL)
+ {
+ dialog_default_button = DLG_NONBUTTON_CONTROL + 2;
+ s_textfield = textfield;
+ }
+ else
+ {
+ dialog_default_button = IDCANCEL + 1 + dfltbutton;
+ s_textfield = NULL;
+ }
+
+ /*show the dialog box modally and get a return value*/
+ nchar = DialogBoxIndirect(
+ s_hinst,
+ (HGLOBAL) hglbDlgTemp,
+ s_hwnd,
+ (DLGPROC)dp);
+
+ FreeProcInstance( dp );
+ GlobalUnlock(hglbDlgTemp);
+ GlobalFree(hglbDlgTemp);
+ vim_free(tbuffer);
+ vim_free(buttonWidths);
+ vim_free(buttonPositions);
+
+
+ return nchar;
+}
+
+/*
+ * Put a simple element (basic class) onto a dialog template in memory.
+ * return a pointer to where the next item should be added.
+ *
+ * parameters:
+ * lStyle = additional style flags
+ * x,y = x & y positions IN DIALOG UNITS
+ * w,h = width and height IN DIALOG UNITS
+ * Id = ID used in messages
+ * clss = class ID, e.g 0x80 for a button, 0x82 for a static
+ * caption = usually text or resource name
+ *
+ * TODO: use the length information noted here to enable the dialog creation
+ * routines to work out more exactly how much memory they need to alloc.
+ */
+ static LPWORD
+add_dialog_element(
+ LPWORD p,
+ DWORD lStyle,
+ WORD x,
+ WORD y,
+ WORD w,
+ WORD h,
+ WORD Id,
+ BYTE clss,
+ const char *caption)
+{
+
+ lStyle = lStyle | WS_VISIBLE | WS_CHILD;
+
+ add_word(x);
+ add_word(y);
+ add_word(w);
+ add_word(h);
+ add_word(Id);
+ add_long(lStyle);
+ add_byte(clss);
+ if (((lStyle & SS_ICON) != 0) && (clss == 0x82))
+ {
+ /* Use resource ID */
+ add_byte(0xff);
+ add_byte(*caption);
+ }
+ else
+ add_string(caption);
+
+ add_byte(0); //# of extra bytes following
+
+
+ return p;
+}
+
+#undef add_byte
+#undef add_string
+#undef add_long
+#undef add_word
+
+#endif /* FEAT_GUI_DIALOG */
+
+ static void
+get_dialog_font_metrics(void)
+{
+ DWORD dlgFontSize;
+ dlgFontSize = GetDialogBaseUnits(); /* fall back to big old system*/
+ s_dlgfntwidth = LOWORD(dlgFontSize);
+ s_dlgfntheight = HIWORD(dlgFontSize);
+}
+
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+#include "gui_w3~1.h"
+/*
+ * Create the toolbar, initially unpopulated.
+ * (just like the menu, there are no defaults, it's all
+ * set up through menu.vim)
+ */
+ static void
+initialise_toolbar(void)
+{
+ s_toolbarhwnd = CreateToolbar(
+ s_hwnd,
+ WS_CHILD | WS_VISIBLE,
+ CMD_TB_BASE, /*<vn>*/
+ 31, //number of images in inital bitmap
+ s_hinst,
+ IDR_TOOLBAR1, // id of initial bitmap
+ NULL,
+ 0 // initial number of buttons
+ );
+
+ gui_mch_show_toolbar(vim_strchr(p_go, GO_TOOLBAR) != NULL);
+}
+#endif
+
+#if defined(FEAT_OLE) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Make the GUI window come to the foreground.
+ */
+ void
+gui_mch_set_foreground(void)
+{
+ if (IsIconic(s_hwnd))
+ SendMessage(s_hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+ SetActiveWindow(s_hwnd);
+}
+#endif
diff --git a/src/gui_w32.c b/src/gui_w32.c
new file mode 100644
index 000000000..df079538a
--- /dev/null
+++ b/src/gui_w32.c
@@ -0,0 +1,4077 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * Windows GUI.
+ *
+ * GUI support for Microsoft Windows. Win32 initially; maybe Win16 later
+ *
+ * George V. Reilly <george@reilly.org> wrote the original Win32 GUI.
+ * Robert Webb reworked it to use the existing GUI stuff and added menu,
+ * scrollbars, etc.
+ *
+ * Note: Clipboard stuff, for cutting and pasting text to other windows, is in
+ * os_win32.c. (It can also be done from the terminal version).
+ *
+ * TODO: Some of the function signatures ought to be updated for Win64;
+ * e.g., replace LONG with LONG_PTR, etc.
+ */
+
+/*
+ * These are new in Windows ME/XP, only defined in recent compilers.
+ */
+#ifndef HANDLE_WM_XBUTTONUP
+# define HANDLE_WM_XBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+#endif
+#ifndef HANDLE_WM_XBUTTONDOWN
+# define HANDLE_WM_XBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+#endif
+#ifndef HANDLE_WM_XBUTTONDBLCLK
+# define HANDLE_WM_XBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+#endif
+
+/*
+ * Include the common stuff for MS-Windows GUI.
+ */
+#include "gui_w48.c"
+
+#ifdef FEAT_XPM_W32
+# include "xpm_w32.h"
+#endif
+
+#ifdef PROTO
+# define WINAPI
+#endif
+
+#ifdef __MINGW32__
+/*
+ * Add a lot of missing defines.
+ * They are not always missing, we need the #ifndef's.
+ */
+# ifndef _cdecl
+# define _cdecl
+# endif
+# ifndef IsMinimized
+# define IsMinimized(hwnd) IsIconic(hwnd)
+# endif
+# ifndef IsMaximized
+# define IsMaximized(hwnd) IsZoomed(hwnd)
+# endif
+# ifndef SelectFont
+# define SelectFont(hdc, hfont) ((HFONT)SelectObject((hdc), (HGDIOBJ)(HFONT)(hfont)))
+# endif
+# ifndef GetStockBrush
+# define GetStockBrush(i) ((HBRUSH)GetStockObject(i))
+# endif
+# ifndef DeleteBrush
+# define DeleteBrush(hbr) DeleteObject((HGDIOBJ)(HBRUSH)(hbr))
+# endif
+
+# ifndef HANDLE_WM_RBUTTONDBLCLK
+# define HANDLE_WM_RBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_MBUTTONUP
+# define HANDLE_WM_MBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_MBUTTONDBLCLK
+# define HANDLE_WM_MBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_LBUTTONDBLCLK
+# define HANDLE_WM_LBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_RBUTTONDOWN
+# define HANDLE_WM_RBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_MOUSEMOVE
+# define HANDLE_WM_MOUSEMOVE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_RBUTTONUP
+# define HANDLE_WM_RBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_MBUTTONDOWN
+# define HANDLE_WM_MBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_LBUTTONUP
+# define HANDLE_WM_LBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_LBUTTONDOWN
+# define HANDLE_WM_LBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam), (UINT)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_SYSCHAR
+# define HANDLE_WM_SYSCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
+# endif
+# ifndef HANDLE_WM_ACTIVATEAPP
+# define HANDLE_WM_ACTIVATEAPP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam), (DWORD)(lParam)), 0L)
+# endif
+# ifndef HANDLE_WM_WINDOWPOSCHANGING
+# define HANDLE_WM_WINDOWPOSCHANGING(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (LPWINDOWPOS)(lParam))
+# endif
+# ifndef HANDLE_WM_VSCROLL
+# define HANDLE_WM_VSCROLL(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(lParam), (UINT)(LOWORD(wParam)), (int)(short)HIWORD(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_SETFOCUS
+# define HANDLE_WM_SETFOCUS(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_KILLFOCUS
+# define HANDLE_WM_KILLFOCUS(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_HSCROLL
+# define HANDLE_WM_HSCROLL(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(lParam), (UINT)(LOWORD(wParam)), (int)(short)HIWORD(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_DROPFILES
+# define HANDLE_WM_DROPFILES(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HDROP)(wParam)), 0L)
+# endif
+# ifndef HANDLE_WM_CHAR
+# define HANDLE_WM_CHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
+# endif
+# ifndef HANDLE_WM_SYSDEADCHAR
+# define HANDLE_WM_SYSDEADCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
+# endif
+# ifndef HANDLE_WM_DEADCHAR
+# define HANDLE_WM_DEADCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (TCHAR)(wParam), (int)(short)LOWORD(lParam)), 0L)
+# endif
+#endif /* __MINGW32__ */
+
+
+/* Some parameters for tearoff menus. All in pixels. */
+#define TEAROFF_PADDING_X 2
+#define TEAROFF_BUTTON_PAD_X 8
+#define TEAROFF_MIN_WIDTH 200
+#define TEAROFF_SUBMENU_LABEL ">>"
+#define TEAROFF_COLUMN_PADDING 3 // # spaces to pad column with.
+
+
+/* For the Intellimouse: */
+#ifndef WM_MOUSEWHEEL
+#define WM_MOUSEWHEEL 0x20a
+#endif
+
+
+#ifdef FEAT_BEVAL
+# define ID_BEVAL_TOOLTIP 200
+# define BEVAL_TEXT_LEN MAXPATHL
+
+static void make_tooltip __ARGS((BalloonEval *beval, char *text, POINT pt));
+static void delete_tooltip __ARGS((BalloonEval *beval));
+static VOID CALLBACK BevalTimerProc __ARGS((HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime));
+
+static BalloonEval *cur_beval = NULL;
+static UINT BevalTimerId = 0;
+static DWORD LastActivity = 0;
+#endif
+
+/* Local variables: */
+
+#ifdef FEAT_MENU
+static UINT s_menu_id = 100;
+
+/*
+ * Use the system font for dialogs and tear-off menus. Remove this line to
+ * use DLG_FONT_NAME.
+ */
+# define USE_SYSMENU_FONT
+#endif
+
+#define VIM_NAME "vim"
+#define VIM_CLASS "Vim"
+#define VIM_CLASSW L"Vim"
+
+/* Initial size for the dialog template. For gui_mch_dialog() it's fixed,
+ * thus there should be room for every dialog. For tearoffs it's made bigger
+ * when needed. */
+#define DLG_ALLOC_SIZE 16 * 1024
+
+/*
+ * stuff for dialogs, menus, tearoffs etc.
+ */
+static LRESULT APIENTRY dialog_callback(HWND, UINT, WPARAM, LPARAM);
+static LRESULT APIENTRY tearoff_callback(HWND, UINT, WPARAM, LPARAM);
+static PWORD
+add_dialog_element(
+ PWORD p,
+ DWORD lStyle,
+ WORD x,
+ WORD y,
+ WORD w,
+ WORD h,
+ WORD Id,
+ WORD clss,
+ const char *caption);
+static LPWORD lpwAlign(LPWORD);
+static int nCopyAnsiToWideChar(LPWORD, LPSTR);
+static void gui_mch_tearoff(char_u *title, vimmenu_T *menu, int initX, int initY);
+static void get_dialog_font_metrics(void);
+
+static int dialog_default_button = -1;
+
+/* Intellimouse support */
+static int mouse_scroll_lines = 0;
+static UINT msh_msgmousewheel = 0;
+
+static int s_usenewlook; /* emulate W95/NT4 non-bold dialogs */
+#ifdef FEAT_TOOLBAR
+static void initialise_toolbar(void);
+static int get_toolbar_bitmap(vimmenu_T *menu);
+#endif
+
+#ifdef FEAT_MBYTE_IME
+static LRESULT _OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param);
+static char_u *GetResultStr(HWND hwnd, int GCS, int *lenp);
+#endif
+#if defined(FEAT_MBYTE_IME) && defined(DYNAMIC_IME)
+# ifdef NOIME
+typedef struct tagCOMPOSITIONFORM {
+ DWORD dwStyle;
+ POINT ptCurrentPos;
+ RECT rcArea;
+} COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, FAR *LPCOMPOSITIONFORM;
+typedef HANDLE HIMC;
+# endif
+
+HINSTANCE hLibImm = NULL;
+LONG (WINAPI *pImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD);
+LONG (WINAPI *pImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD);
+HIMC (WINAPI *pImmGetContext)(HWND);
+HIMC (WINAPI *pImmAssociateContext)(HWND, HIMC);
+BOOL (WINAPI *pImmReleaseContext)(HWND, HIMC);
+BOOL (WINAPI *pImmGetOpenStatus)(HIMC);
+BOOL (WINAPI *pImmSetOpenStatus)(HIMC, BOOL);
+BOOL (WINAPI *pImmGetCompositionFont)(HIMC, LPLOGFONTA);
+BOOL (WINAPI *pImmSetCompositionFont)(HIMC, LPLOGFONTA);
+BOOL (WINAPI *pImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
+BOOL (WINAPI *pImmGetConversionStatus)(HIMC, LPDWORD, LPDWORD);
+static void dyn_imm_load(void);
+#else
+# define pImmGetCompositionStringA ImmGetCompositionStringA
+# define pImmGetCompositionStringW ImmGetCompositionStringW
+# define pImmGetContext ImmGetContext
+# define pImmAssociateContext ImmAssociateContext
+# define pImmReleaseContext ImmReleaseContext
+# define pImmGetOpenStatus ImmGetOpenStatus
+# define pImmSetOpenStatus ImmSetOpenStatus
+# define pImmGetCompositionFont ImmGetCompositionFontA
+# define pImmSetCompositionFont ImmSetCompositionFontA
+# define pImmSetCompositionWindow ImmSetCompositionWindow
+# define pImmGetConversionStatus ImmGetConversionStatus
+#endif
+
+#ifndef ETO_IGNORELANGUAGE
+# define ETO_IGNORELANGUAGE 0x1000
+#endif
+
+/* multi monitor support */
+typedef struct _MONITORINFOstruct
+{
+ DWORD cbSize;
+ RECT rcMonitor;
+ RECT rcWork;
+ DWORD dwFlags;
+} _MONITORINFO;
+
+typedef HANDLE _HMONITOR;
+typedef _HMONITOR (WINAPI *TMonitorFromWindow)(HWND, DWORD);
+typedef BOOL (WINAPI *TGetMonitorInfo)(_HMONITOR, _MONITORINFO *);
+
+static TMonitorFromWindow pMonitorFromWindow = NULL;
+static TGetMonitorInfo pGetMonitorInfo = NULL;
+static HANDLE user32_lib = NULL;
+#ifdef FEAT_NETBEANS_INTG
+int WSInitialized = FALSE; /* WinSock is initialized */
+#endif
+/*
+ * Return TRUE when running under Windows NT 3.x or Win32s, both of which have
+ * less fancy GUI APIs.
+ */
+ static int
+is_winnt_3(void)
+{
+ return ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && os_version.dwMajorVersion == 3)
+ || (os_version.dwPlatformId == VER_PLATFORM_WIN32s));
+}
+
+/*
+ * Return TRUE when running under Win32s.
+ */
+ int
+gui_is_win32s(void)
+{
+ return (os_version.dwPlatformId == VER_PLATFORM_WIN32s);
+}
+
+#ifdef FEAT_MENU
+/*
+ * Figure out how high the menu bar is at the moment.
+ */
+ static int
+gui_mswin_get_menu_height(
+ int fix_window) /* If TRUE, resize window if menu height changed */
+{
+ static int old_menu_height = -1;
+
+ RECT rc1, rc2;
+ int num;
+ int menu_height;
+
+ if (gui.menu_is_active)
+ num = GetMenuItemCount(s_menuBar);
+ else
+ num = 0;
+
+ if (num == 0)
+ menu_height = 0;
+ else
+ {
+ if (is_winnt_3()) /* for NT 3.xx */
+ {
+ if (gui.starting)
+ menu_height = GetSystemMetrics(SM_CYMENU);
+ else
+ {
+ RECT r1, r2;
+ int frameht = GetSystemMetrics(SM_CYFRAME);
+ int capht = GetSystemMetrics(SM_CYCAPTION);
+
+ /* get window rect of s_hwnd
+ * get client rect of s_hwnd
+ * get cap height
+ * subtract from window rect, the sum of client height,
+ * (if not maximized)frame thickness, and caption height.
+ */
+ GetWindowRect(s_hwnd, &r1);
+ GetClientRect(s_hwnd, &r2);
+ menu_height = r1.bottom - r1.top - (r2.bottom - r2.top
+ + 2 * frameht * (!IsZoomed(s_hwnd)) + capht);
+ }
+ }
+ else /* win95 and variants (NT 4.0, I guess) */
+ {
+ /*
+ * In case 'lines' is set in _vimrc/_gvimrc window width doesn't
+ * seem to have been set yet, so menu wraps in default window
+ * width which is very narrow. Instead just return height of a
+ * single menu item. Will still be wrong when the menu really
+ * should wrap over more than one line.
+ */
+ GetMenuItemRect(s_hwnd, s_menuBar, 0, &rc1);
+ if (gui.starting)
+ menu_height = rc1.bottom - rc1.top + 1;
+ else
+ {
+ GetMenuItemRect(s_hwnd, s_menuBar, num - 1, &rc2);
+ menu_height = rc2.bottom - rc1.top + 1;
+ }
+ }
+ }
+
+ if (fix_window && menu_height != old_menu_height)
+ {
+ old_menu_height = menu_height;
+ gui_set_shellsize(FALSE, FALSE);
+ }
+
+ return menu_height;
+}
+#endif /*FEAT_MENU*/
+
+
+/*
+ * Setup for the Intellimouse
+ */
+ static void
+init_mouse_wheel(void)
+{
+
+#ifndef SPI_GETWHEELSCROLLLINES
+# define SPI_GETWHEELSCROLLLINES 104
+#endif
+
+#define VMOUSEZ_CLASSNAME "MouseZ" /* hidden wheel window class */
+#define VMOUSEZ_TITLE "Magellan MSWHEEL" /* hidden wheel window title */
+#define VMSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
+#define VMSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
+
+ HWND hdl_mswheel;
+ UINT msh_msgscrolllines;
+
+ msh_msgmousewheel = 0;
+ mouse_scroll_lines = 3; /* reasonable default */
+
+ if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && os_version.dwMajorVersion >= 4)
+ || (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
+ && ((os_version.dwMajorVersion == 4
+ && os_version.dwMinorVersion >= 10)
+ || os_version.dwMajorVersion >= 5)))
+ {
+ /* if NT 4.0+ (or Win98) get scroll lines directly from system */
+ SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
+ &mouse_scroll_lines, 0);
+ }
+ else if (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
+ || (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && os_version.dwMajorVersion < 4))
+ { /*
+ * If Win95 or NT 3.51,
+ * try to find the hidden point32 window.
+ */
+ hdl_mswheel = FindWindow(VMOUSEZ_CLASSNAME, VMOUSEZ_TITLE);
+ if (hdl_mswheel)
+ {
+ msh_msgscrolllines = RegisterWindowMessage(VMSH_SCROLL_LINES);
+ if (msh_msgscrolllines)
+ {
+ mouse_scroll_lines = (int)SendMessage(hdl_mswheel,
+ msh_msgscrolllines, 0, 0);
+ msh_msgmousewheel = RegisterWindowMessage(VMSH_MOUSEWHEEL);
+ }
+ }
+ }
+}
+
+
+/* Intellimouse wheel handler */
+ static void
+_OnMouseWheel(
+ HWND hwnd,
+ short zDelta)
+{
+/* Treat a mouse wheel event as if it were a scroll request */
+ int i;
+ int size;
+ HWND hwndCtl;
+
+ if (curwin->w_scrollbars[SBAR_RIGHT].id != 0)
+ {
+ hwndCtl = curwin->w_scrollbars[SBAR_RIGHT].id;
+ size = curwin->w_scrollbars[SBAR_RIGHT].size;
+ }
+ else if (curwin->w_scrollbars[SBAR_LEFT].id != 0)
+ {
+ hwndCtl = curwin->w_scrollbars[SBAR_LEFT].id;
+ size = curwin->w_scrollbars[SBAR_LEFT].size;
+ }
+ else
+ return;
+
+ size = curwin->w_height;
+ if (mouse_scroll_lines == 0)
+ init_mouse_wheel();
+
+ if (mouse_scroll_lines > 0
+ && mouse_scroll_lines < (size > 2 ? size - 2 : 1))
+ {
+ for (i = mouse_scroll_lines; i > 0; --i)
+ _OnScroll(hwnd, hwndCtl, zDelta >= 0 ? SB_LINEUP : SB_LINEDOWN, 0);
+ }
+ else
+ _OnScroll(hwnd, hwndCtl, zDelta >= 0 ? SB_PAGEUP : SB_PAGEDOWN, 0);
+}
+
+#if 0 /* disabled, a gap appears below and beside the window, and the window
+ can be moved (in a strange way) */
+/*
+ * Even though we have _DuringSizing() which makes the rubber band a valid
+ * size, we need this for when the user maximises the window.
+ * TODO: Doesn't seem to adjust the width though for some reason.
+ */
+ static BOOL
+_OnWindowPosChanging(
+ HWND hwnd,
+ LPWINDOWPOS lpwpos)
+{
+ RECT workarea_rect;
+
+ if (!(lpwpos->flags & SWP_NOSIZE))
+ {
+ if (IsMaximized(hwnd)
+ && (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
+ || (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && os_version.dwMajorVersion >= 4)))
+ {
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ lpwpos->x = workarea_rect.left;
+ lpwpos->y = workarea_rect.top;
+ lpwpos->cx = workarea_rect.right - workarea_rect.left;
+ lpwpos->cy = workarea_rect.bottom - workarea_rect.top;
+ }
+ gui_mswin_get_valid_dimensions(lpwpos->cx, lpwpos->cy,
+ &lpwpos->cx, &lpwpos->cy);
+ }
+ return 0;
+}
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ static void
+_OnWindowPosChanged(
+ HWND hwnd,
+ const LPWINDOWPOS lpwpos)
+{
+ static int x = 0, y = 0, cx = 0, cy = 0;
+
+ if (WSInitialized && (lpwpos->x != x || lpwpos->y != y
+ || lpwpos->cx != cx || lpwpos->cy != cy))
+ {
+ x = lpwpos->x;
+ y = lpwpos->y;
+ cx = lpwpos->cx;
+ cy = lpwpos->cy;
+ netbeans_frame_moved(x, y);
+ }
+ /* Allow to send WM_SIZE and WM_MOVE */
+ FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, MyWindowProc);
+}
+#endif
+
+ static int
+_DuringSizing(
+ HWND hwnd,
+ UINT fwSide,
+ LPRECT lprc)
+{
+ int w, h;
+ int valid_w, valid_h;
+ int w_offset, h_offset;
+
+ w = lprc->right - lprc->left;
+ h = lprc->bottom - lprc->top;
+ gui_mswin_get_valid_dimensions(w, h, &valid_w, &valid_h);
+ w_offset = w - valid_w;
+ h_offset = h - valid_h;
+
+ if (fwSide == WMSZ_LEFT || fwSide == WMSZ_TOPLEFT
+ || fwSide == WMSZ_BOTTOMLEFT)
+ lprc->left += w_offset;
+ else if (fwSide == WMSZ_RIGHT || fwSide == WMSZ_TOPRIGHT
+ || fwSide == WMSZ_BOTTOMRIGHT)
+ lprc->right -= w_offset;
+
+ if (fwSide == WMSZ_TOP || fwSide == WMSZ_TOPLEFT
+ || fwSide == WMSZ_TOPRIGHT)
+ lprc->top += h_offset;
+ else if (fwSide == WMSZ_BOTTOM || fwSide == WMSZ_BOTTOMLEFT
+ || fwSide == WMSZ_BOTTOMRIGHT)
+ lprc->bottom -= h_offset;
+ return TRUE;
+}
+
+
+
+ static LRESULT CALLBACK
+_WndProc(
+ HWND hwnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ /*
+ TRACE("WndProc: hwnd = %08x, msg = %x, wParam = %x, lParam = %x\n",
+ hwnd, uMsg, wParam, lParam);
+ */
+
+ HandleMouseHide(uMsg, lParam);
+
+ s_uMsg = uMsg;
+ s_wParam = wParam;
+ s_lParam = lParam;
+
+ switch (uMsg)
+ {
+ HANDLE_MSG(hwnd, WM_DEADCHAR, _OnDeadChar);
+ HANDLE_MSG(hwnd, WM_SYSDEADCHAR, _OnDeadChar);
+ /* HANDLE_MSG(hwnd, WM_ACTIVATE, _OnActivate); */
+ HANDLE_MSG(hwnd, WM_CLOSE, _OnClose);
+ /* HANDLE_MSG(hwnd, WM_COMMAND, _OnCommand); */
+ HANDLE_MSG(hwnd, WM_DESTROY, _OnDestroy);
+ HANDLE_MSG(hwnd, WM_DROPFILES, _OnDropFiles);
+ HANDLE_MSG(hwnd, WM_HSCROLL, _OnScroll);
+ HANDLE_MSG(hwnd, WM_KILLFOCUS, _OnKillFocus);
+#ifdef FEAT_MENU
+ HANDLE_MSG(hwnd, WM_COMMAND, _OnMenu);
+#endif
+ /* HANDLE_MSG(hwnd, WM_MOVE, _OnMove); */
+ /* HANDLE_MSG(hwnd, WM_NCACTIVATE, _OnNCActivate); */
+ HANDLE_MSG(hwnd, WM_SETFOCUS, _OnSetFocus);
+ HANDLE_MSG(hwnd, WM_SIZE, _OnSize);
+ /* HANDLE_MSG(hwnd, WM_SYSCOMMAND, _OnSysCommand); */
+ /* HANDLE_MSG(hwnd, WM_SYSKEYDOWN, _OnAltKey); */
+ HANDLE_MSG(hwnd, WM_VSCROLL, _OnScroll);
+ // HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGING, _OnWindowPosChanging);
+ HANDLE_MSG(hwnd, WM_ACTIVATEAPP, _OnActivateApp);
+#ifdef FEAT_NETBEANS_INTG
+ HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGED, _OnWindowPosChanged);
+#endif
+
+ case WM_QUERYENDSESSION: /* System wants to go down. */
+ gui_shell_closed(); /* Will exit when no changed buffers. */
+ return FALSE; /* Do NOT allow system to go down. */
+
+ case WM_ENDSESSION:
+ if (wParam) /* system only really goes down when wParam is TRUE */
+ _OnEndSession();
+ break;
+
+ case WM_CHAR:
+ /* Don't use HANDLE_MSG() for WM_CHAR, it truncates wParam to a single
+ * byte while we want the UTF-16 character value. */
+ _OnChar(hwnd, wParam, (int)(short)LOWORD(lParam));
+ return 0L;
+
+ case WM_SYSCHAR:
+ /*
+ * if 'winaltkeys' is "no", or it's "menu" and it's not a menu
+ * shortcut key, handle like a typed ALT key, otherwise call Windows
+ * ALT key handling.
+ */
+#ifdef FEAT_MENU
+ if ( !gui.menu_is_active
+ || p_wak[0] == 'n'
+ || (p_wak[0] == 'm' && !gui_is_menu_shortcut((int)wParam))
+ )
+#endif
+ {
+ _OnSysChar(hwnd, wParam, (int)(short)LOWORD(lParam));
+ return 0L;
+ }
+#ifdef FEAT_MENU
+ else
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+#endif
+
+ case WM_SYSKEYUP:
+#ifdef FEAT_MENU
+ /* This used to be done only when menu is active: ALT key is used for
+ * that. But that caused problems when menu is disabled and using
+ * Alt-Tab-Esc: get into a strange state where no mouse-moved events
+ * are received, mouse pointer remains hidden. */
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+#else
+ return 0;
+#endif
+
+ case WM_SIZING: /* HANDLE_MSG doesn't seem to handle this one */
+ return _DuringSizing(hwnd, (UINT)wParam, (LPRECT)lParam);
+
+ case WM_MOUSEWHEEL:
+ _OnMouseWheel(hwnd, HIWORD(wParam));
+ break;
+
+#ifdef FEAT_TOOLBAR
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->code)
+ {
+ case TTN_NEEDTEXT:
+ {
+ LPTOOLTIPTEXT lpttt;
+ UINT idButton;
+ int idx;
+ vimmenu_T *pMenu;
+
+ lpttt = (LPTOOLTIPTEXT)lParam;
+ idButton = (UINT) lpttt->hdr.idFrom;
+ pMenu = gui_mswin_find_menu(root_menu, idButton);
+ if (pMenu)
+ {
+ idx = MENU_INDEX_TIP;
+ if (pMenu->strings[idx])
+ {
+ lpttt->hinst = NULL; /* string, not resource */
+ lpttt->lpszText = pMenu->strings[idx];
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+#endif
+#if defined(MENUHINTS) && defined(FEAT_MENU)
+ case WM_MENUSELECT:
+ if (((UINT) HIWORD(wParam)
+ & (0xffff ^ (MF_MOUSESELECT + MF_BITMAP + MF_POPUP)))
+ == MF_HILITE
+ && (State & CMDLINE) == 0)
+ {
+ UINT idButton;
+ vimmenu_T *pMenu;
+ static int did_menu_tip = FALSE;
+
+ if (did_menu_tip)
+ {
+ msg_clr_cmdline();
+ setcursor();
+ out_flush();
+ did_menu_tip = FALSE;
+ }
+
+ idButton = (UINT)LOWORD(wParam);
+ pMenu = gui_mswin_find_menu(root_menu, idButton);
+ if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != 0
+ && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1)
+ {
+ msg(pMenu->strings[MENU_INDEX_TIP]);
+ setcursor();
+ out_flush();
+ did_menu_tip = TRUE;
+ }
+ }
+ break;
+#endif
+ case WM_NCHITTEST:
+ {
+ LRESULT result;
+ int x, y;
+ int xPos = GET_X_LPARAM(lParam);
+
+ result = MyWindowProc(hwnd, uMsg, wParam, lParam);
+ if (result == HTCLIENT)
+ {
+ gui_mch_get_winpos(&x, &y);
+ xPos -= x;
+
+ if (xPos < 48) /* <VN> TODO should use system metric? */
+ return HTBOTTOMLEFT;
+ else
+ return HTBOTTOMRIGHT;
+ }
+ else
+ return result;
+ }
+ /* break; notreached */
+
+#ifdef FEAT_MBYTE_IME
+ case WM_IME_NOTIFY:
+ if (!_OnImeNotify(hwnd, (DWORD)wParam, (DWORD)lParam))
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ break;
+ case WM_IME_COMPOSITION:
+ if (!_OnImeComposition(hwnd, wParam, lParam))
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ break;
+#endif
+
+ default:
+ if (uMsg == msh_msgmousewheel && msh_msgmousewheel != 0)
+ { /* handle MSH_MOUSEWHEEL messages for Intellimouse */
+ _OnMouseWheel(hwnd, HIWORD(wParam));
+ break;
+ }
+#ifdef MSWIN_FIND_REPLACE
+ else
+ if (uMsg == s_findrep_msg && s_findrep_msg != 0)
+ {
+ _OnFindRepl();
+ }
+#endif
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ }
+
+ return 1;
+}
+
+/*
+ * End of call-back routines
+ */
+
+/* parent window, if specified with -P */
+HWND vim_parent_hwnd = NULL;
+
+ static BOOL CALLBACK
+FindWindowTitle(HWND hwnd, LPARAM lParam)
+{
+ char buf[2048];
+ char *title = (char *)lParam;
+
+ if (GetWindowText(hwnd, buf, sizeof(buf)))
+ {
+ if (strstr(buf, title) != NULL)
+ {
+ /* Found it. Store the window ref. and quit searching. */
+ vim_parent_hwnd = FindWindowEx(hwnd, NULL, "MDIClient", NULL);
+ return FALSE;
+ }
+ }
+ return TRUE; /* continue searching */
+}
+
+/*
+ * Invoked for '-P "title"' argument: search for parent application to open
+ * our window in.
+ */
+ void
+gui_mch_set_parent(char *title)
+{
+ EnumWindows(FindWindowTitle, (LPARAM)title);
+ if (vim_parent_hwnd == NULL)
+ {
+ EMSG2(_("E671: Cannot find window title \"%s\""), title);
+ mch_exit(2);
+ }
+}
+
+ static void
+ole_error(char *arg)
+{
+ EMSG2(_("E243: Argument not supported: \"-%s\"; Use the OLE version."),
+ arg);
+}
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(int *argc, char **argv)
+{
+ int silent = FALSE;
+ int idx;
+
+ /* Check for special OLE command line parameters */
+ if ((*argc == 2 || *argc == 3) && (argv[1][0] == '-' || argv[1][0] == '/'))
+ {
+ /* Check for a "-silent" argument first. */
+ if (*argc == 3 && STRICMP(argv[1] + 1, "silent") == 0
+ && (argv[2][0] == '-' || argv[2][0] == '/'))
+ {
+ silent = TRUE;
+ idx = 2;
+ }
+ else
+ idx = 1;
+
+ /* Register Vim as an OLE Automation server */
+ if (STRICMP(argv[idx] + 1, "register") == 0)
+ {
+#ifdef FEAT_OLE
+ RegisterMe(silent);
+ mch_exit(0);
+#else
+ if (!silent)
+ ole_error("register");
+ mch_exit(2);
+#endif
+ }
+
+ /* Unregister Vim as an OLE Automation server */
+ if (STRICMP(argv[idx] + 1, "unregister") == 0)
+ {
+#ifdef FEAT_OLE
+ UnregisterMe(!silent);
+ mch_exit(0);
+#else
+ if (!silent)
+ ole_error("unregister");
+ mch_exit(2);
+#endif
+ }
+
+ /* Ignore an -embedding argument. It is only relevant if the
+ * application wants to treat the case when it is started manually
+ * differently from the case where it is started via automation (and
+ * we don't).
+ */
+ if (STRICMP(argv[idx] + 1, "embedding") == 0)
+ {
+#ifdef FEAT_OLE
+ *argc = 1;
+#else
+ ole_error("embedding");
+ mch_exit(2);
+#endif
+ }
+ }
+
+#ifdef FEAT_OLE
+ {
+ int bDoRestart = FALSE;
+
+ InitOLE(&bDoRestart);
+ /* automatically exit after registering */
+ if (bDoRestart)
+ mch_exit(0);
+ }
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ {
+ /* stolen from gui_x11.x */
+ int arg;
+
+ for (arg = 1; arg < *argc; arg++)
+ if (strncmp("-nb", argv[arg], 3) == 0)
+ {
+ usingNetbeans++;
+ netbeansArg = argv[arg];
+ mch_memmove(&argv[arg], &argv[arg + 1],
+ (--*argc - arg) * sizeof(char *));
+ argv[*argc] = NULL;
+ break; /* enough? */
+ }
+
+ if (usingNetbeans)
+ {
+ WSADATA wsaData;
+ int wsaerr;
+
+ /* Init WinSock */
+ wsaerr = WSAStartup(MAKEWORD(2, 2), &wsaData);
+ if (wsaerr == 0)
+ WSInitialized = TRUE;
+ }
+ }
+#endif
+
+ /* get the OS version info */
+ os_version.dwOSVersionInfoSize = sizeof(os_version);
+ GetVersionEx(&os_version); /* this call works on Win32s, Win95 and WinNT */
+
+ /* try and load the user32.dll library and get the entry points for
+ * multi-monitor-support. */
+ if ((user32_lib = LoadLibrary("User32.dll")) != NULL)
+ {
+ pMonitorFromWindow = (TMonitorFromWindow)GetProcAddress(user32_lib,
+ "MonitorFromWindow");
+
+ /* there are ...A and ...W version of GetMonitorInfo - looking at
+ * winuser.h, they have exactly the same declaration. */
+ pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib,
+ "GetMonitorInfoA");
+ }
+}
+
+/*
+ * Initialise the GUI. Create all the windows, set up all the call-backs
+ * etc.
+ */
+ int
+gui_mch_init(void)
+{
+ const char szVimWndClass[] = VIM_CLASS;
+ const char szTextAreaClass[] = "VimTextArea";
+ WNDCLASS wndclass;
+#ifdef FEAT_MBYTE
+ const WCHAR szVimWndClassW[] = VIM_CLASSW;
+ WNDCLASSW wndclassw;
+#endif
+#ifdef GLOBAL_IME
+ ATOM atom;
+#endif
+
+ /* Display any pending error messages */
+ display_errors();
+
+ /* Return here if the window was already opened (happens when
+ * gui_mch_dialog() is called early). */
+ if (s_hwnd != NULL)
+ return OK;
+
+ /*
+ * Load the tearoff bitmap
+ */
+#ifdef FEAT_TEAROFF
+ s_htearbitmap = LoadBitmap(s_hinst, "IDB_TEAROFF");
+#endif
+
+ gui.scrollbar_width = GetSystemMetrics(SM_CXVSCROLL);
+ gui.scrollbar_height = GetSystemMetrics(SM_CYHSCROLL);
+#ifdef FEAT_MENU
+ gui.menu_height = 0; /* Windows takes care of this */
+#endif
+ gui.border_width = 0;
+
+ s_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
+
+#ifdef FEAT_MBYTE
+ /* First try using the wide version, so that we can use any title.
+ * Otherwise only characters in the active codepage will work. */
+ if (GetClassInfoW(s_hinst, szVimWndClassW, &wndclassw) == 0)
+ {
+ wndclassw.style = 0;
+ wndclassw.lpfnWndProc = _WndProc;
+ wndclassw.cbClsExtra = 0;
+ wndclassw.cbWndExtra = 0;
+ wndclassw.hInstance = s_hinst;
+ wndclassw.hIcon = LoadIcon(wndclassw.hInstance, "IDR_VIM");
+ wndclassw.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclassw.hbrBackground = s_brush;
+ wndclassw.lpszMenuName = NULL;
+ wndclassw.lpszClassName = szVimWndClassW;
+
+ if ((
+#ifdef GLOBAL_IME
+ atom =
+#endif
+ RegisterClassW(&wndclassw)) == 0)
+ {
+ if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return FAIL;
+
+ /* Must be Windows 98, fall back to non-wide function. */
+ }
+ else
+ wide_WindowProc = TRUE;
+ }
+
+ if (!wide_WindowProc)
+#endif
+
+ if (GetClassInfo(s_hinst, szVimWndClass, &wndclass) == 0)
+ {
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = _WndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = s_hinst;
+ wndclass.hIcon = LoadIcon(wndclass.hInstance, "IDR_VIM");
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = s_brush;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = szVimWndClass;
+
+ if ((
+#ifdef GLOBAL_IME
+ atom =
+#endif
+ RegisterClass(&wndclass)) == 0)
+ return FAIL;
+ }
+
+ if (vim_parent_hwnd != NULL)
+ {
+#ifdef HAVE_TRY_EXCEPT
+ __try
+ {
+#endif
+ /* Open inside the specified parent window.
+ * TODO: last argument should point to a CLIENTCREATESTRUCT
+ * structure. */
+ s_hwnd = CreateWindowEx(
+ WS_EX_MDICHILD,
+ szVimWndClass, "Vim MSWindows GUI",
+ WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | 0xC000,
+ gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
+ gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
+ 100, /* Any value will do */
+ 100, /* Any value will do */
+ vim_parent_hwnd, NULL,
+ s_hinst, NULL);
+#ifdef HAVE_TRY_EXCEPT
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* NOP */
+ }
+#endif
+ if (s_hwnd == NULL)
+ {
+ EMSG(_("E672: Unable to open window inside MDI application"));
+ mch_exit(2);
+ }
+ }
+ else
+ /* Open toplevel window. */
+ s_hwnd = CreateWindow(
+ szVimWndClass, "Vim MSWindows GUI",
+ WS_OVERLAPPEDWINDOW,
+ gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
+ gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
+ 100, /* Any value will do */
+ 100, /* Any value will do */
+ NULL, NULL,
+ s_hinst, NULL);
+
+ if (s_hwnd == NULL)
+ return FAIL;
+
+#ifdef GLOBAL_IME
+ global_ime_init(atom, s_hwnd);
+#endif
+#if defined(FEAT_MBYTE_IME) && defined(DYNAMIC_IME)
+ dyn_imm_load();
+#endif
+
+ /* Create the text area window */
+ if (GetClassInfo(s_hinst, szTextAreaClass, &wndclass) == 0)
+ {
+ wndclass.style = CS_OWNDC;
+ wndclass.lpfnWndProc = _TextAreaWndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = s_hinst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = NULL;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = szTextAreaClass;
+
+ if (RegisterClass(&wndclass) == 0)
+ return FAIL;
+ }
+ s_textArea = CreateWindowEx(
+ WS_EX_CLIENTEDGE,
+ szTextAreaClass, "Vim text area",
+ WS_CHILD | WS_VISIBLE, 0, 0,
+ 100, /* Any value will do for now */
+ 100, /* Any value will do for now */
+ s_hwnd, NULL,
+ s_hinst, NULL);
+
+ if (s_textArea == NULL)
+ return FAIL;
+
+#ifdef FEAT_MENU
+ s_menuBar = CreateMenu();
+#endif
+ s_hdc = GetDC(s_textArea);
+
+#ifdef MSWIN16_FASTTEXT
+ SetBkMode(s_hdc, OPAQUE);
+#endif
+
+#ifdef FEAT_WINDOWS
+ DragAcceptFiles(s_hwnd, TRUE);
+#endif
+
+ /* Do we need to bother with this? */
+ /* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
+
+ /* Get background/foreground colors from the system */
+ gui_mch_def_colors();
+
+ /* Get the colors from the "Normal" group (set in syntax.c or in a vimrc
+ * file) */
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color.
+ * Then store the current values as the defaults.
+ */
+ gui_check_colors();
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them) */
+ highlight_gui_started();
+
+ /*
+ * Start out by adding the configured border width into the border offset
+ */
+ gui.border_offset = gui.border_width + 2; /*CLIENT EDGE*/
+
+ /*
+ * Set up for Intellimouse processing
+ */
+ init_mouse_wheel();
+
+ /*
+ * compute a couple of metrics used for the dialogs
+ */
+ get_dialog_font_metrics();
+#ifdef FEAT_TOOLBAR
+ /*
+ * Create the toolbar
+ */
+ initialise_toolbar();
+#endif
+#ifdef MSWIN_FIND_REPLACE
+ /*
+ * Initialise the dialog box stuff
+ */
+ s_findrep_msg = RegisterWindowMessage(FINDMSGSTRING);
+
+ /* Initialise the struct */
+ s_findrep_struct.lStructSize = sizeof(s_findrep_struct);
+ s_findrep_struct.lpstrFindWhat = alloc(MSWIN_FR_BUFSIZE);
+ s_findrep_struct.lpstrFindWhat[0] = NUL;
+ s_findrep_struct.lpstrReplaceWith = alloc(MSWIN_FR_BUFSIZE);
+ s_findrep_struct.lpstrReplaceWith[0] = NUL;
+ s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
+ s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_w32_connect();
+#endif
+
+ return OK;
+}
+
+/*
+ * Get the size of the screen, taking position on multiple monitors into
+ * account (if supported).
+ */
+ static void
+get_work_area(RECT *spi_rect)
+{
+ _HMONITOR mon;
+ _MONITORINFO moninfo;
+
+ /* use these functions only if available */
+ if (pMonitorFromWindow != NULL && pGetMonitorInfo != NULL)
+ {
+ /* work out which monitor the window is on, and get *it's* work area */
+ mon = pMonitorFromWindow(s_hwnd, 1 /*MONITOR_DEFAULTTOPRIMARY*/);
+ if (mon != NULL)
+ {
+ moninfo.cbSize = sizeof(_MONITORINFO);
+ if (pGetMonitorInfo(mon, &moninfo))
+ {
+ *spi_rect = moninfo.rcWork;
+ return;
+ }
+ }
+ }
+ /* this is the old method... */
+ SystemParametersInfo(SPI_GETWORKAREA, 0, spi_rect, 0);
+}
+
+/*
+ * Set the size of the window to the given width and height in pixels.
+ */
+ void
+gui_mch_set_shellsize(int width, int height,
+ int min_width, int min_height, int base_width, int base_height)
+{
+ RECT workarea_rect;
+ int win_width, win_height;
+ int win_xpos, win_ypos;
+ WINDOWPLACEMENT wndpl;
+
+ /* try to keep window completely on screen */
+ /* get size of the screen work area (excludes taskbar, appbars) */
+ get_work_area(&workarea_rect);
+
+ /* get current posision of our window */
+ wndpl.length = sizeof(WINDOWPLACEMENT);
+ GetWindowPlacement(s_hwnd, &wndpl);
+
+ /* Resizing a maximized window looks very strange, unzoom it first.
+ * But don't do it when still starting up, it may have been requested in
+ * the shortcut. */
+ if (wndpl.showCmd == SW_SHOWMAXIMIZED && starting == 0)
+ {
+ ShowWindow(s_hwnd, SW_SHOWNORMAL);
+ /* Need to get the settings of the normal window. */
+ GetWindowPlacement(s_hwnd, &wndpl);
+ }
+
+ win_xpos = wndpl.rcNormalPosition.left;
+ win_ypos = wndpl.rcNormalPosition.top;
+
+ /* compute the size of the outside of the window */
+ win_width = width + GetSystemMetrics(SM_CXFRAME) * 2;
+ win_height = height + GetSystemMetrics(SM_CYFRAME) * 2
+ + GetSystemMetrics(SM_CYCAPTION)
+#ifdef FEAT_MENU
+ + gui_mswin_get_menu_height(FALSE)
+#endif
+ ;
+
+ /* if the window is going off the screen, move it on to the screen */
+ if (win_xpos + win_width > workarea_rect.right)
+ win_xpos = workarea_rect.right - win_width;
+
+ if (win_xpos < workarea_rect.left)
+ win_xpos = workarea_rect.left;
+
+ if (win_ypos + win_height > workarea_rect.bottom)
+ win_ypos = workarea_rect.bottom - win_height;
+
+ if (win_ypos < workarea_rect.top)
+ win_ypos = workarea_rect.top;
+
+ /* When the taskbar is placed on the left or top of the screen,
+ * SetWindowPlacement() adds its width or height automatically, compensate
+ * for that. When the offset is over 400 it's probably something else,
+ * skip it then (just in case). */
+ if (workarea_rect.left > 0 && workarea_rect.left < 400)
+ win_xpos -= workarea_rect.left;
+ if (workarea_rect.top > 0 && workarea_rect.top < 400)
+ win_ypos -= workarea_rect.top;
+
+ wndpl.rcNormalPosition.left = win_xpos;
+ wndpl.rcNormalPosition.right = win_xpos + win_width;
+ wndpl.rcNormalPosition.top = win_ypos;
+ wndpl.rcNormalPosition.bottom = win_ypos + win_height;
+
+ /* set window position - we should use SetWindowPlacement rather than
+ * SetWindowPos as the MSDN docs say the coord systems returned by
+ * these two are not compatible. */
+ SetWindowPlacement(s_hwnd, &wndpl);
+
+ SetActiveWindow(s_hwnd);
+ SetFocus(s_hwnd);
+
+#ifdef FEAT_MENU
+ /* Menu may wrap differently now */
+ gui_mswin_get_menu_height(!gui.starting);
+#endif
+}
+
+
+ void
+gui_mch_set_scrollbar_thumb(
+ scrollbar_T *sb,
+ long val,
+ long size,
+ long max)
+{
+ SCROLLINFO info;
+
+ sb->scroll_shift = 0;
+ while (max > 32767)
+ {
+ max = (max + 1) >> 1;
+ val >>= 1;
+ size >>= 1;
+ ++sb->scroll_shift;
+ }
+
+ if (sb->scroll_shift > 0)
+ ++size;
+
+ info.cbSize = sizeof(info);
+ info.fMask = SIF_POS | SIF_RANGE | SIF_PAGE;
+ info.nPos = val;
+ info.nMin = 0;
+ info.nMax = max;
+ info.nPage = size;
+ SetScrollInfo(sb->id, SB_CTL, &info, TRUE);
+}
+
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(GuiFont font)
+{
+ gui.currFont = font;
+}
+
+
+/*
+ * Set the current text foreground color.
+ */
+ void
+gui_mch_set_fg_color(guicolor_T color)
+{
+ gui.currFgColor = color;
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(guicolor_T color)
+{
+ gui.currBgColor = color;
+}
+
+#if defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)
+/*
+ * Multi-byte handling, originally by Sung-Hoon Baek.
+ * First static functions (no prototypes generated).
+ */
+#ifdef _MSC_VER
+# include <ime.h> /* Apparently not needed for Cygwin, MingW or Borland. */
+#endif
+#include <imm.h>
+
+/*
+ * display composition string(korean)
+ */
+ static void
+DisplayCompStringOpaque(char_u *s, int len)
+{
+ int OldBkMode = GetBkMode(s_hdc);
+
+ SetBkMode(s_hdc, OPAQUE);
+ gui_outstr_nowrap(s, len, GUI_MON_TRS_CURSOR,
+ (guicolor_T)0, (guicolor_T)0, 0);
+ SetBkMode(s_hdc, OldBkMode);
+}
+
+/*
+ * handle WM_IME_NOTIFY message
+ */
+ static LRESULT
+_OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData)
+{
+ LRESULT lResult = 0;
+ HIMC hImc;
+
+ if (!pImmGetContext || (hImc = pImmGetContext(hWnd)) == (HIMC)0)
+ return lResult;
+ switch (dwCommand)
+ {
+ case IMN_SETOPENSTATUS:
+ if (pImmGetOpenStatus(hImc))
+ {
+ pImmSetCompositionFont(hImc, &norm_logfont);
+ im_set_position(gui.row, gui.col);
+
+ /* Disable langmap */
+ State &= ~LANGMAP;
+ if (State & INSERT)
+ {
+#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+ /* Unshown 'keymap' in status lines */
+ if (curbuf->b_p_iminsert == B_IMODE_LMAP)
+ {
+ /* Save cursor position */
+ int old_row = gui.row;
+ int old_col = gui.col;
+
+ // This must be called here before
+ // status_redraw_curbuf(), otherwise the mode
+ // message may appear in the wrong position.
+ showmode();
+ status_redraw_curbuf();
+ update_screen(0);
+ /* Restore cursor position */
+ gui.row = old_row;
+ gui.col = old_col;
+ }
+#endif
+ }
+ }
+ gui_update_cursor(TRUE, FALSE);
+ lResult = 0;
+ break;
+ }
+ pImmReleaseContext(hWnd, hImc);
+ return lResult;
+}
+
+ static LRESULT
+_OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param)
+{
+ char_u *ret;
+ int len;
+
+ if ((param & GCS_RESULTSTR) == 0) /* Composition unfinished. */
+ return 0;
+
+ ret = GetResultStr(hwnd, GCS_RESULTSTR, &len);
+ if (ret != NULL)
+ {
+ add_to_input_buf_csi(ret, len);
+ vim_free(ret);
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ * get the current composition string, in UCS-2; *lenp is the number of
+ * *lenp is the number of Unicode characters.
+ */
+ static short_u *
+GetCompositionString_inUCS2(HIMC hIMC, DWORD GCS, int *lenp)
+{
+ LONG ret;
+ LPWSTR wbuf = NULL;
+ char_u *buf;
+
+ if (!pImmGetContext)
+ return NULL; /* no imm32.dll */
+
+ /* Try Unicode; this'll always work on NT regardless of codepage. */
+ ret = pImmGetCompositionStringW(hIMC, GCS, NULL, 0);
+ if (ret == 0)
+ return NULL; /* empty */
+
+ if (ret > 0)
+ {
+ /* Allocate the requested buffer plus space for the NUL character. */
+ wbuf = (LPWSTR)alloc(ret + sizeof(WCHAR));
+ if (wbuf != NULL)
+ {
+ pImmGetCompositionStringW(hIMC, GCS, wbuf, ret);
+ *lenp = ret / sizeof(WCHAR);
+ }
+ return (short_u *)wbuf;
+ }
+
+ /* ret < 0; we got an error, so try the ANSI version. This'll work
+ * on 9x/ME, but only if the codepage happens to be set to whatever
+ * we're inputting. */
+ ret = pImmGetCompositionStringA(hIMC, GCS, NULL, 0);
+ if (ret <= 0)
+ return NULL; /* empty or error */
+
+ buf = alloc(ret);
+ if (buf == NULL)
+ return NULL;
+ pImmGetCompositionStringA(hIMC, GCS, buf, ret);
+
+ /* convert from codepage to UCS-2 */
+ MultiByteToWideChar_alloc(GetACP(), 0, buf, ret, &wbuf, lenp);
+ vim_free(buf);
+
+ return (short_u *)wbuf;
+}
+
+/*
+ * void GetResultStr()
+ *
+ * This handles WM_IME_COMPOSITION with GCS_RESULTSTR flag on.
+ * get complete composition string
+ */
+ static char_u *
+GetResultStr(HWND hwnd, int GCS, int *lenp)
+{
+ HIMC hIMC; /* Input context handle. */
+ short_u *buf = NULL;
+ char_u *convbuf = NULL;
+
+ if (!pImmGetContext || (hIMC = pImmGetContext(hwnd)) == (HIMC)0)
+ return NULL;
+
+ /* Reads in the composition string. */
+ buf = GetCompositionString_inUCS2(hIMC, GCS, lenp);
+ if (buf == NULL)
+ return NULL;
+
+ convbuf = ucs2_to_enc(buf, lenp);
+ pImmReleaseContext(hwnd, hIMC);
+ vim_free(buf);
+ return convbuf;
+}
+#endif
+
+/* For global functions we need prototypes. */
+#if (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) || defined(PROTO)
+
+/*
+ * set font to IM.
+ */
+ void
+im_set_font(LOGFONT *lf)
+{
+ HIMC hImc;
+
+ if (pImmGetContext && (hImc = pImmGetContext(s_hwnd)) != (HIMC)0)
+ {
+ pImmSetCompositionFont(hImc, lf);
+ pImmReleaseContext(s_hwnd, hImc);
+ }
+}
+
+/*
+ * Notify cursor position to IM.
+ */
+ void
+im_set_position(int row, int col)
+{
+ HIMC hImc;
+
+ if (pImmGetContext && (hImc = pImmGetContext(s_hwnd)) != (HIMC)0)
+ {
+ COMPOSITIONFORM cfs;
+
+ cfs.dwStyle = CFS_POINT;
+ cfs.ptCurrentPos.x = FILL_X(col);
+ cfs.ptCurrentPos.y = FILL_Y(row);
+ MapWindowPoints(s_textArea, s_hwnd, &cfs.ptCurrentPos, 1);
+ pImmSetCompositionWindow(hImc, &cfs);
+
+ pImmReleaseContext(s_hwnd, hImc);
+ }
+}
+
+/*
+ * Set IM status on ("active" is TRUE) or off ("active" is FALSE).
+ */
+ void
+im_set_active(int active)
+{
+ HIMC hImc;
+ static HIMC hImcOld = (HIMC)0;
+
+ if (pImmGetContext) /* if NULL imm32.dll wasn't loaded (yet) */
+ {
+ if (p_imdisable)
+ {
+ if (hImcOld == (HIMC)0)
+ {
+ hImcOld = pImmGetContext(s_hwnd);
+ if (hImcOld)
+ pImmAssociateContext(s_hwnd, (HIMC)0);
+ }
+ active = FALSE;
+ }
+ else if (hImcOld != (HIMC)0)
+ {
+ pImmAssociateContext(s_hwnd, hImcOld);
+ hImcOld = (HIMC)0;
+ }
+
+ hImc = pImmGetContext(s_hwnd);
+ if (hImc)
+ {
+ pImmSetOpenStatus(hImc, active);
+ pImmReleaseContext(s_hwnd, hImc);
+ }
+ }
+}
+
+/*
+ * Get IM status. When IM is on, return not 0. Else return 0.
+ */
+ int
+im_get_status()
+{
+ int status = 0;
+ HIMC hImc;
+
+ if (pImmGetContext && (hImc = pImmGetContext(s_hwnd)) != (HIMC)0)
+ {
+ status = pImmGetOpenStatus(hImc) ? 1 : 0;
+ pImmReleaseContext(s_hwnd, hImc);
+ }
+ return status;
+}
+
+#endif /* FEAT_MBYTE && FEAT_MBYTE_IME */
+
+#if defined(FEAT_MBYTE) && !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
+/* Win32 with GLOBAL IME */
+
+/*
+ * Notify cursor position to IM.
+ */
+ void
+im_set_position(int row, int col)
+{
+ /* Win32 with GLOBAL IME */
+ POINT p;
+
+ p.x = FILL_X(col);
+ p.y = FILL_Y(row);
+ MapWindowPoints(s_textArea, s_hwnd, &p, 1);
+ global_ime_set_position(&p);
+}
+
+/*
+ * Set IM status on ("active" is TRUE) or off ("active" is FALSE).
+ */
+ void
+im_set_active(int active)
+{
+ global_ime_set_status(active);
+}
+
+/*
+ * Get IM status. When IM is on, return not 0. Else return 0.
+ */
+ int
+im_get_status()
+{
+ return global_ime_get_status();
+}
+#endif
+
+
+#ifdef FEAT_RIGHTLEFT
+/*
+ * What is this for? In the case where you are using Win98 or Win2K or later,
+ * and you are using a Hebrew font (or Arabic!), Windows does you a favor and
+ * reverses the string sent to the TextOut... family. This sucks, because we
+ * go to a lot of effort to do the right thing, and there doesn't seem to be a
+ * way to tell Windblows not to do this!
+ *
+ * The short of it is that this 'RevOut' only gets called if you are running
+ * one of the new, "improved" MS OSes, and only if you are running in
+ * 'rightleft' mode. It makes display take *slightly* longer, but not
+ * noticeably so.
+ */
+ static void
+RevOut( HDC s_hdc,
+ int col,
+ int row,
+ UINT foptions,
+ CONST RECT *pcliprect,
+ LPCTSTR text,
+ UINT len,
+ CONST INT *padding)
+{
+ int ix;
+ static int special = -1;
+
+ if (special == -1)
+ {
+ /* Check windows version: special treatment is needed if it is NT 5 or
+ * Win98 or higher. */
+ if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && os_version.dwMajorVersion >= 5)
+ || (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
+ && (os_version.dwMajorVersion > 4
+ || (os_version.dwMajorVersion == 4
+ && os_version.dwMinorVersion > 0))))
+ special = 1;
+ else
+ special = 0;
+ }
+
+ if (special)
+ for (ix = 0; ix < (int)len; ++ix)
+ ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
+ pcliprect, text + ix, 1, padding);
+ else
+ ExtTextOut(s_hdc, col, row, foptions, pcliprect, text, len, padding);
+}
+#endif
+
+ void
+gui_mch_draw_string(
+ int row,
+ int col,
+ char_u *text,
+ int len,
+ int flags)
+{
+ static int *padding = NULL;
+ static int pad_size = 0;
+ int i;
+ const RECT *pcliprect = NULL;
+ UINT foptions = 0;
+#ifdef FEAT_MBYTE
+ static WCHAR *unicodebuf = NULL;
+ static int *unicodepdy = NULL;
+ int unibuflen = 0;
+ int n = 0;
+#endif
+ HPEN hpen, old_pen;
+ int y;
+
+#ifndef MSWIN16_FASTTEXT
+ /*
+ * Italic and bold text seems to have an extra row of pixels at the bottom
+ * (below where the bottom of the character should be). If we draw the
+ * characters with a solid background, the top row of pixels in the
+ * character below will be overwritten. We can fix this by filling in the
+ * background ourselves, to the correct character proportions, and then
+ * writing the character in transparent mode. Still have a problem when
+ * the character is "_", which gets written on to the character below.
+ * New fix: set gui.char_ascent to -1. This shifts all characters up one
+ * pixel in their slots, which fixes the problem with the bottom row of
+ * pixels. We still need this code because otherwise the top row of pixels
+ * becomes a problem. - webb.
+ */
+ static HBRUSH hbr_cache[2] = {NULL, NULL};
+ static guicolor_T brush_color[2] = {INVALCOLOR, INVALCOLOR};
+ static int brush_lru = 0;
+ HBRUSH hbr;
+ RECT rc;
+
+ if (!(flags & DRAW_TRANSP))
+ {
+ /*
+ * Clear background first.
+ * Note: FillRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(col);
+ rc.top = FILL_Y(row);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int cell_len = 0;
+
+ /* Compute the length in display cells. */
+ for (n = 0; n < len; n += MB_BYTE2LEN(text[n]))
+ cell_len += (*mb_ptr2cells)(text + n);
+ rc.right = FILL_X(col + cell_len);
+ }
+ else
+#endif
+ rc.right = FILL_X(col + len);
+ rc.bottom = FILL_Y(row + 1);
+
+ /* Cache the created brush, that saves a lot of time. We need two:
+ * one for cursor background and one for the normal background. */
+ if (gui.currBgColor == brush_color[0])
+ {
+ hbr = hbr_cache[0];
+ brush_lru = 1;
+ }
+ else if (gui.currBgColor == brush_color[1])
+ {
+ hbr = hbr_cache[1];
+ brush_lru = 0;
+ }
+ else
+ {
+ if (hbr_cache[brush_lru] != NULL)
+ DeleteBrush(hbr_cache[brush_lru]);
+ hbr_cache[brush_lru] = CreateSolidBrush(gui.currBgColor);
+ brush_color[brush_lru] = gui.currBgColor;
+ hbr = hbr_cache[brush_lru];
+ brush_lru = !brush_lru;
+ }
+ FillRect(s_hdc, &rc, hbr);
+
+ SetBkMode(s_hdc, TRANSPARENT);
+
+ /*
+ * When drawing block cursor, prevent inverted character spilling
+ * over character cell (can happen with bold/italic)
+ */
+ if (flags & DRAW_CURSOR)
+ {
+ pcliprect = &rc;
+ foptions = ETO_CLIPPED;
+ }
+ }
+#else
+ /*
+ * The alternative would be to write the characters in opaque mode, but
+ * when the text is not exactly the same proportions as normal text, too
+ * big or too little a rectangle gets drawn for the background.
+ */
+ SetBkMode(s_hdc, OPAQUE);
+ SetBkColor(s_hdc, gui.currBgColor);
+#endif
+ SetTextColor(s_hdc, gui.currFgColor);
+ SelectFont(s_hdc, gui.currFont);
+
+ if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width)
+ {
+ vim_free(padding);
+ pad_size = Columns;
+
+ padding = (int *)alloc(pad_size * sizeof(int));
+ if (padding != NULL)
+ for (i = 0; i < pad_size; i++)
+ padding[i] = gui.char_width;
+ }
+
+ /* On NT, tell the font renderer not to "help" us with Hebrew and Arabic
+ * text. This doesn't work in 9x, so we have to deal with it manually on
+ * those systems. */
+ if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ foptions |= ETO_IGNORELANGUAGE;
+
+ /*
+ * We have to provide the padding argument because italic and bold versions
+ * of fixed-width fonts are often one pixel or so wider than their normal
+ * versions.
+ * No check for DRAW_BOLD, Windows will have done it already.
+ */
+
+#ifdef FEAT_MBYTE
+ /* Check if there are any UTF-8 characters. If not, use normal text
+ * output to speed up output. */
+ if (enc_utf8)
+ for (n = 0; n < len; ++n)
+ if (text[n] >= 0x80)
+ break;
+
+ /* Check if the Unicode buffer exists and is big enough. Create it
+ * with the same lengt as the multi-byte string, the number of wide
+ * characters is always equal or smaller. */
+ if ((enc_utf8 || (enc_codepage > 0 && (int)GetACP() != enc_codepage))
+ && (unicodebuf == NULL || len > unibuflen))
+ {
+ vim_free(unicodebuf);
+ unicodebuf = (WCHAR *)alloc(len * sizeof(WCHAR));
+
+ vim_free(unicodepdy);
+ unicodepdy = (int *)alloc(len * sizeof(int));
+
+ unibuflen = len;
+ }
+
+ if (enc_utf8 && n < len && unicodebuf != NULL)
+ {
+ /* Output UTF-8 characters. Caller has already separated
+ * composing characters. */
+ int i = 0;
+ int clen; /* string length up to composing char */
+ int cells; /* cell width of string up to composing char */
+ int cw; /* width of current cell */
+
+ cells = 0;
+ for (clen = 0; i < len; )
+ {
+ unicodebuf[clen] = utf_ptr2char(text + i);
+ cw = utf_char2cells(unicodebuf[clen]);
+ if (cw > 2) /* don't use 4 for unprintable char */
+ cw = 1;
+ if (unicodepdy != NULL)
+ {
+ /* Use unicodepdy to make characters fit as we expect, even
+ * when the font uses different widths (e.g., bold character
+ * is wider). */
+ unicodepdy[clen] = cw * gui.char_width;
+ }
+ cells += cw;
+ i += utfc_ptr2len_check_len(text + i, len - i);
+ ++clen;
+ }
+ ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
+ foptions, pcliprect, unicodebuf, clen, unicodepdy);
+ len = cells; /* used for underlining */
+ }
+ else if (enc_codepage > 0 && (int)GetACP() != enc_codepage)
+ {
+ /* If we want to display codepage data, and the current CP is not the
+ * ANSI one, we need to go via Unicode. */
+ if (unicodebuf != NULL)
+ {
+ len = MultiByteToWideChar(enc_codepage,
+ MB_PRECOMPOSED,
+ (char *)text, len,
+ (LPWSTR)unicodebuf, unibuflen);
+ if (len != 0)
+ ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
+ foptions, pcliprect, unicodebuf, len, NULL);
+ }
+ }
+ else
+#endif
+ {
+#ifdef FEAT_RIGHTLEFT
+ /* If we can't use ETO_IGNORELANGUAGE, we can't tell Windows not to
+ * mess up RL text, so we have to draw it character-by-character.
+ * Only do this if RL is on, since it's slow. */
+ if (curwin->w_p_rl && !(foptions & ETO_IGNORELANGUAGE))
+ RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
+ foptions, pcliprect, (char *)text, len, padding);
+ else
+#endif
+ ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
+ foptions, pcliprect, (char *)text, len, padding);
+ }
+
+ if (flags & DRAW_UNDERL)
+ {
+ hpen = CreatePen(PS_SOLID, 1, gui.currFgColor);
+ old_pen = SelectObject(s_hdc, hpen);
+ /* When p_linespace is 0, overwrite the bottom row of pixels.
+ * Otherwise put the line just below the character. */
+ y = FILL_Y(row + 1) - 1;
+#ifndef MSWIN16_FASTTEXT
+ if (p_linespace > 1)
+ y -= p_linespace - 1;
+#endif
+ MoveToEx(s_hdc, FILL_X(col), y, NULL);
+ /* Note: LineTo() excludes the last pixel in the line. */
+ LineTo(s_hdc, FILL_X(col + len), y);
+ DeleteObject(SelectObject(s_hdc, old_pen));
+ }
+}
+
+
+/*
+ * Output routines.
+ */
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush(void)
+{
+# if defined(__BORLANDC__)
+ /*
+ * The GdiFlush declaration (in Borland C 5.01 <wingdi.h>) is not a
+ * prototype declaration.
+ * The compiler complains if __stdcall is not used in both declarations.
+ */
+ BOOL __stdcall GdiFlush(void);
+# endif
+
+ GdiFlush();
+}
+
+ static void
+clear_rect(RECT *rcp)
+{
+ HBRUSH hbr;
+
+ hbr = CreateSolidBrush(gui.back_pixel);
+ FillRect(s_hdc, rcp, hbr);
+ DeleteBrush(hbr);
+}
+
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Add a sub menu to the menu bar.
+ */
+ void
+gui_mch_add_menu(
+ vimmenu_T *menu,
+ int pos)
+{
+ vimmenu_T *parent = menu->parent;
+
+ menu->submenu_id = CreatePopupMenu();
+ menu->id = s_menu_id++;
+
+ if (menu_is_menubar(menu->name))
+ {
+ if (is_winnt_3())
+ {
+ InsertMenu((parent == NULL) ? s_menuBar : parent->submenu_id,
+ (UINT)pos, MF_POPUP | MF_STRING | MF_BYPOSITION,
+ (UINT)menu->submenu_id, (LPCTSTR) menu->name);
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ WCHAR *wn = NULL;
+ int n;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ /* 'encoding' differs from active codepage: convert menu name
+ * and use wide function */
+ wn = enc_to_ucs2(menu->name, NULL);
+ if (wn != NULL)
+ {
+ MENUITEMINFOW infow;
+
+ infow.cbSize = sizeof(infow);
+ infow.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID
+ | MIIM_SUBMENU;
+ infow.dwItemData = (DWORD)menu;
+ infow.wID = menu->id;
+ infow.fType = MFT_STRING;
+ infow.dwTypeData = wn;
+ infow.cch = wcslen(wn);
+ infow.hSubMenu = menu->submenu_id;
+ n = InsertMenuItemW((parent == NULL)
+ ? s_menuBar : parent->submenu_id,
+ (UINT)pos, TRUE, &infow);
+ vim_free(wn);
+ if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ /* Failed, try using non-wide function. */
+ wn = NULL;
+ }
+ }
+
+ if (wn == NULL)
+#endif
+ {
+ MENUITEMINFO info;
+
+ info.cbSize = sizeof(info);
+ info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID | MIIM_SUBMENU;
+ info.dwItemData = (DWORD)menu;
+ info.wID = menu->id;
+ info.fType = MFT_STRING;
+ info.dwTypeData = (LPTSTR)menu->name;
+ info.cch = (UINT)STRLEN(menu->name);
+ info.hSubMenu = menu->submenu_id;
+ InsertMenuItem((parent == NULL)
+ ? s_menuBar : parent->submenu_id,
+ (UINT)pos, TRUE, &info);
+ }
+ }
+ }
+
+ /* Fix window size if menu may have wrapped */
+ if (parent == NULL)
+ gui_mswin_get_menu_height(!gui.starting);
+#ifdef FEAT_TEAROFF
+ else if (IsWindow(parent->tearoff_handle))
+ rebuild_tearoff(parent);
+#endif
+}
+
+ void
+gui_mch_show_popupmenu(vimmenu_T *menu)
+{
+ POINT mp;
+
+ (void)GetCursorPos((LPPOINT)&mp);
+ gui_mch_show_popupmenu_at(menu, (int)mp.x, (int)mp.y);
+}
+
+ void
+gui_make_popup(char_u *path_name)
+{
+ vimmenu_T *menu = gui_find_menu(path_name);
+
+ if (menu != NULL)
+ {
+ POINT p;
+
+ /* Find the position of the current cursor */
+ GetDCOrgEx(s_hdc, &p);
+ if (curwin != NULL)
+ {
+ p.x += TEXT_X(W_WINCOL(curwin) + curwin->w_wcol + 1);
+ p.y += TEXT_Y(W_WINROW(curwin) + curwin->w_wrow + 1);
+ }
+ msg_scroll = FALSE;
+ gui_mch_show_popupmenu_at(menu, (int)p.x, (int)p.y);
+ }
+}
+
+#if defined(FEAT_TEAROFF) || defined(PROTO)
+/*
+ * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and
+ * create it as a pseudo-"tearoff menu".
+ */
+ void
+gui_make_tearoff(char_u *path_name)
+{
+ vimmenu_T *menu = gui_find_menu(path_name);
+
+ /* Found the menu, so tear it off. */
+ if (menu != NULL)
+ gui_mch_tearoff(menu->dname, menu, 0xffffL, 0xffffL);
+}
+#endif
+
+/*
+ * Add a menu item to a menu
+ */
+ void
+gui_mch_add_menu_item(
+ vimmenu_T *menu,
+ int idx)
+{
+ vimmenu_T *parent = menu->parent;
+
+ menu->id = s_menu_id++;
+ menu->submenu_id = NULL;
+
+#ifdef FEAT_TEAROFF
+ if (STRNCMP(menu->name, TEAR_STRING, TEAR_LEN) == 0)
+ {
+ InsertMenu(parent->submenu_id, (UINT)idx, MF_BITMAP|MF_BYPOSITION,
+ (UINT)menu->id, (LPCTSTR) s_htearbitmap);
+ }
+ else
+#endif
+#ifdef FEAT_TOOLBAR
+ if (menu_is_toolbar(parent->name))
+ {
+ TBBUTTON newtb;
+
+ vim_memset(&newtb, 0, sizeof(newtb));
+ if (menu_is_separator(menu->name))
+ {
+ newtb.iBitmap = 0;
+ newtb.fsStyle = TBSTYLE_SEP;
+ }
+ else
+ {
+ newtb.iBitmap = get_toolbar_bitmap(menu);
+ newtb.fsStyle = TBSTYLE_BUTTON;
+ }
+ newtb.idCommand = menu->id;
+ newtb.fsState = TBSTATE_ENABLED;
+ newtb.iString = 0;
+ SendMessage(s_toolbarhwnd, TB_INSERTBUTTON, (WPARAM)idx,
+ (LPARAM)&newtb);
+ menu->submenu_id = (HMENU)-1;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_MBYTE
+ WCHAR *wn = NULL;
+ int n;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ /* 'encoding' differs from active codepage: convert menu item name
+ * and use wide function */
+ wn = enc_to_ucs2(menu->name, NULL);
+ if (wn != NULL)
+ {
+ n = InsertMenuW(parent->submenu_id, (UINT)idx,
+ (menu_is_separator(menu->name)
+ ? MF_SEPARATOR : MF_STRING) | MF_BYPOSITION,
+ (UINT)menu->id, wn);
+ vim_free(wn);
+ if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ /* Failed, try using non-wide function. */
+ wn = NULL;
+ }
+ }
+ if (wn == NULL)
+#endif
+ InsertMenu(parent->submenu_id, (UINT)idx,
+ (menu_is_separator(menu->name) ? MF_SEPARATOR : MF_STRING)
+ | MF_BYPOSITION,
+ (UINT)menu->id, (LPCTSTR)menu->name);
+#ifdef FEAT_TEAROFF
+ if (IsWindow(parent->tearoff_handle))
+ rebuild_tearoff(parent);
+#endif
+ }
+}
+
+/*
+ * Destroy the machine specific menu widget.
+ */
+ void
+gui_mch_destroy_menu(vimmenu_T *menu)
+{
+#ifdef FEAT_TOOLBAR
+ /*
+ * is this a toolbar button?
+ */
+ if (menu->submenu_id == (HMENU)-1)
+ {
+ int iButton;
+
+ iButton = (int)SendMessage(s_toolbarhwnd, TB_COMMANDTOINDEX,
+ (WPARAM)menu->id, 0);
+ SendMessage(s_toolbarhwnd, TB_DELETEBUTTON, (WPARAM)iButton, 0);
+ }
+ else
+#endif
+ {
+ if (menu->parent != NULL
+ && menu_is_popup(menu->parent->dname)
+ && menu->parent->submenu_id != NULL)
+ RemoveMenu(menu->parent->submenu_id, menu->id, MF_BYCOMMAND);
+ else
+ RemoveMenu(s_menuBar, menu->id, MF_BYCOMMAND);
+ if (menu->submenu_id != NULL)
+ DestroyMenu(menu->submenu_id);
+#ifdef FEAT_TEAROFF
+ if (IsWindow(menu->tearoff_handle))
+ DestroyWindow(menu->tearoff_handle);
+ if (menu->parent != NULL
+ && menu->parent->children != NULL
+ && IsWindow(menu->parent->tearoff_handle))
+ {
+ /* This menu must not show up when rebuilding the tearoff window. */
+ menu->modes = 0;
+ rebuild_tearoff(menu->parent);
+ }
+#endif
+ }
+}
+
+#ifdef FEAT_TEAROFF
+ static void
+rebuild_tearoff(vimmenu_T *menu)
+{
+ /*hackish*/
+ char_u tbuf[128];
+ RECT trect;
+ RECT rct;
+ RECT roct;
+ int x, y;
+
+ HWND thwnd = menu->tearoff_handle;
+
+ GetWindowText(thwnd, tbuf, 127);
+ if (GetWindowRect(thwnd, &trect)
+ && GetWindowRect(s_hwnd, &rct)
+ && GetClientRect(s_hwnd, &roct))
+ {
+ x = trect.left - rct.left;
+ y = (trect.top - rct.bottom + roct.bottom);
+ }
+ else
+ {
+ x = y = 0xffffL;
+ }
+ DestroyWindow(thwnd);
+ if (menu->children != NULL)
+ {
+ gui_mch_tearoff(tbuf, menu, x, y);
+ if (IsWindow(menu->tearoff_handle))
+ (void) SetWindowPos(menu->tearoff_handle,
+ NULL,
+ (int)trect.left,
+ (int)trect.top,
+ 0, 0,
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ }
+}
+#endif /* FEAT_TEAROFF */
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(
+ vimmenu_T *menu,
+ int grey)
+{
+#ifdef FEAT_TOOLBAR
+ /*
+ * is this a toolbar button?
+ */
+ if (menu->submenu_id == (HMENU)-1)
+ {
+ SendMessage(s_toolbarhwnd, TB_ENABLEBUTTON,
+ (WPARAM)menu->id, (LPARAM) MAKELONG((grey ? FALSE : TRUE), 0) );
+ }
+ else
+#endif
+ if (grey)
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_GRAYED);
+ else
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_ENABLED);
+
+#ifdef FEAT_TEAROFF
+ if ((menu->parent != NULL) && (IsWindow(menu->parent->tearoff_handle)))
+ {
+ WORD menuID;
+ HWND menuHandle;
+
+ /*
+ * A tearoff button has changed state.
+ */
+ if (menu->children == NULL)
+ menuID = (WORD)(menu->id);
+ else
+ menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000);
+ menuHandle = GetDlgItem(menu->parent->tearoff_handle, menuID);
+ if (menuHandle)
+ EnableWindow(menuHandle, !grey);
+
+ }
+#endif
+}
+
+#endif /* FEAT_MENU */
+
+
+/* define some macros used to make the dialogue creation more readable */
+
+#define add_string(s) strcpy((LPSTR)p, s); (LPSTR)p += (strlen((LPSTR)p) + 1)
+#define add_word(x) *p++ = (x)
+#define add_byte(x) *((LPSTR)p)++ = (x)
+#define add_long(x) *((LPDWORD)p)++ = (x)
+
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+/*
+ * stuff for dialogs
+ */
+
+/*
+ * The callback routine used by all the dialogs. Very simple. First,
+ * acknowledges the INITDIALOG message so that Windows knows to do standard
+ * dialog stuff (Return = default, Esc = cancel....) Second, if a button is
+ * pressed, return that button's ID - IDCANCEL (2), which is the button's
+ * number.
+ */
+ static LRESULT CALLBACK
+dialog_callback(
+ HWND hwnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ if (message == WM_INITDIALOG)
+ {
+ CenterWindow(hwnd, GetWindow(hwnd, GW_OWNER));
+ /* Set focus to the dialog. Set the default button, if specified. */
+ (void)SetFocus(hwnd);
+ if (dialog_default_button > IDCANCEL)
+ (void)SetFocus(GetDlgItem(hwnd, dialog_default_button));
+ return FALSE;
+ }
+
+ if (message == WM_COMMAND)
+ {
+ int button = LOWORD(wParam);
+
+ /* Don't end the dialog if something was selected that was
+ * not a button.
+ */
+ if (button >= DLG_NONBUTTON_CONTROL)
+ return TRUE;
+
+ /* If the edit box exists, copy the string. */
+ if (s_textfield != NULL)
+ GetDlgItemText(hwnd, DLG_NONBUTTON_CONTROL + 2,
+ s_textfield, IOSIZE);
+
+ /*
+ * Need to check for IDOK because if the user just hits Return to
+ * accept the default value, some reason this is what we get.
+ */
+ if (button == IDOK)
+ {
+ if (dialog_default_button > IDCANCEL)
+ EndDialog(hwnd, dialog_default_button);
+ }
+ else
+ EndDialog(hwnd, button - IDCANCEL);
+ return TRUE;
+ }
+
+ if ((message == WM_SYSCOMMAND) && (wParam == SC_CLOSE))
+ {
+ EndDialog(hwnd, 0);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Create a dialog dynamically from the parameter strings.
+ * type = type of dialog (question, alert, etc.)
+ * title = dialog title. may be NULL for default title.
+ * message = text to display. Dialog sizes to accommodate it.
+ * buttons = '\n' separated list of button captions, default first.
+ * dfltbutton = number of default button.
+ *
+ * This routine returns 1 if the first button is pressed,
+ * 2 for the second, etc.
+ *
+ * 0 indicates Esc was pressed.
+ * -1 for unexpected error
+ *
+ * If stubbing out this fn, return 1.
+ */
+
+static const char_u *dlg_icons[] = /* must match names in resource file */
+{
+ "IDR_VIM",
+ "IDR_VIM_ERROR",
+ "IDR_VIM_ALERT",
+ "IDR_VIM_INFO",
+ "IDR_VIM_QUESTION"
+};
+
+#ifdef USE_SYSMENU_FONT
+/*
+ * Get Menu Font.
+ * Return OK or FAIL.
+ */
+ static int
+gui_w32_get_menu_font(LOGFONT *lf)
+{
+ NONCLIENTMETRICS nm;
+
+ nm.cbSize = sizeof(NONCLIENTMETRICS);
+ if (!SystemParametersInfo(
+ SPI_GETNONCLIENTMETRICS,
+ sizeof(NONCLIENTMETRICS),
+ &nm,
+ 0))
+ return FAIL;
+ *lf = nm.lfMenuFont;
+ return OK;
+}
+#endif
+
+ int
+gui_mch_dialog(
+ int type,
+ char_u *title,
+ char_u *message,
+ char_u *buttons,
+ int dfltbutton,
+ char_u *textfield)
+{
+ WORD *p, *pdlgtemplate, *pnumitems;
+ int numButtons;
+ int *buttonWidths, *buttonPositions;
+ int buttonYpos;
+ int nchar, i;
+ DWORD lStyle;
+ int dlgwidth = 0;
+ int dlgheight;
+ int editboxheight;
+ int horizWidth = 0;
+ int msgheight;
+ char_u *pstart;
+ char_u *pend;
+ char_u *tbuffer;
+ RECT rect;
+ HWND hwnd;
+ HDC hdc;
+ HFONT font, oldFont;
+ TEXTMETRIC fontInfo;
+ int fontHeight;
+ int textWidth, minButtonWidth, messageWidth;
+ int maxDialogWidth;
+ int vertical;
+ int dlgPaddingX;
+ int dlgPaddingY;
+#ifdef USE_SYSMENU_FONT
+ LOGFONT lfSysmenu;
+ int use_lfSysmenu = FALSE;
+#endif
+
+#ifndef NO_CONSOLE
+ /* Don't output anything in silent mode ("ex -s") */
+ if (silent_mode)
+ return dfltbutton; /* return default option */
+#endif
+
+ /* If there is no window yet, open it. */
+ if (s_hwnd == NULL && gui_mch_init() == FAIL)
+ return dfltbutton;
+
+ if ((type < 0) || (type > VIM_LAST_TYPE))
+ type = 0;
+
+ /* allocate some memory for dialog template */
+ /* TODO should compute this really*/
+ pdlgtemplate = p = (PWORD)LocalAlloc(LPTR, DLG_ALLOC_SIZE);
+
+ if (p == NULL)
+ return -1;
+
+ /*
+ * make a copy of 'buttons' to fiddle with it. complier grizzles because
+ * vim_strsave() doesn't take a const arg (why not?), so cast away the
+ * const.
+ */
+ tbuffer = vim_strsave(buttons);
+ if (tbuffer == NULL)
+ return -1;
+
+ --dfltbutton; /* Change from one-based to zero-based */
+
+ /* Count buttons */
+ numButtons = 1;
+ for (i = 0; tbuffer[i] != '\0'; i++)
+ {
+ if (tbuffer[i] == DLG_BUTTON_SEP)
+ numButtons++;
+ }
+ if (dfltbutton >= numButtons)
+ dfltbutton = -1;
+
+ /* Allocate array to hold the width of each button */
+ buttonWidths = (int *) lalloc(numButtons * sizeof(int), TRUE);
+ if (buttonWidths == NULL)
+ return -1;
+
+ /* Allocate array to hold the X position of each button */
+ buttonPositions = (int *) lalloc(numButtons * sizeof(int), TRUE);
+ if (buttonPositions == NULL)
+ return -1;
+
+ /*
+ * Calculate how big the dialog must be.
+ */
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+#ifdef USE_SYSMENU_FONT
+ if (gui_w32_get_menu_font(&lfSysmenu) == OK)
+ {
+ font = CreateFontIndirect(&lfSysmenu);
+ use_lfSysmenu = TRUE;
+ }
+ else
+#endif
+ font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ VARIABLE_PITCH , DLG_FONT_NAME);
+ if (s_usenewlook)
+ {
+ oldFont = SelectFont(hdc, font);
+ dlgPaddingX = DLG_PADDING_X;
+ dlgPaddingY = DLG_PADDING_Y;
+ }
+ else
+ {
+ oldFont = SelectFont(hdc, GetStockObject(SYSTEM_FONT));
+ dlgPaddingX = DLG_OLD_STYLE_PADDING_X;
+ dlgPaddingY = DLG_OLD_STYLE_PADDING_Y;
+ }
+ GetTextMetrics(hdc, &fontInfo);
+ fontHeight = fontInfo.tmHeight;
+
+ /* Minimum width for horizontal button */
+ minButtonWidth = GetTextWidth(hdc, "Cancel", 6);
+
+ /* Maximum width of a dialog, if possible */
+ GetWindowRect(s_hwnd, &rect);
+ maxDialogWidth = rect.right - rect.left
+ - GetSystemMetrics(SM_CXFRAME) * 2;
+ if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
+ maxDialogWidth = DLG_MIN_MAX_WIDTH;
+
+ /* Set dlgwidth to width of message */
+ pstart = message;
+ messageWidth = 0;
+ msgheight = 0;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); /* Last line of message. */
+ msgheight += fontHeight;
+ textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart));
+ if (textWidth > messageWidth)
+ messageWidth = textWidth;
+ pstart = pend + 1;
+ } while (*pend != NUL);
+ dlgwidth = messageWidth;
+
+ /* Add width of icon to dlgwidth, and some space */
+ dlgwidth += DLG_ICON_WIDTH + 3 * dlgPaddingX;
+
+ if (msgheight < DLG_ICON_HEIGHT)
+ msgheight = DLG_ICON_HEIGHT;
+
+ /*
+ * Check button names. A long one will make the dialog wider.
+ */
+ vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
+ if (!vertical)
+ {
+ // Place buttons horizontally if they fit.
+ horizWidth = dlgPaddingX;
+ pstart = tbuffer;
+ i = 0;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); // Last button name.
+ textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart));
+ if (textWidth < minButtonWidth)
+ textWidth = minButtonWidth;
+ textWidth += dlgPaddingX; /* Padding within button */
+ buttonWidths[i] = textWidth;
+ buttonPositions[i++] = horizWidth;
+ horizWidth += textWidth + dlgPaddingX; /* Pad between buttons */
+ pstart = pend + 1;
+ } while (*pend != NUL);
+
+ if (horizWidth > maxDialogWidth)
+ vertical = TRUE; // Too wide to fit on the screen.
+ else if (horizWidth > dlgwidth)
+ dlgwidth = horizWidth;
+ }
+
+ if (vertical)
+ {
+ // Stack buttons vertically.
+ pstart = tbuffer;
+ do
+ {
+ pend = vim_strchr(pstart, DLG_BUTTON_SEP);
+ if (pend == NULL)
+ pend = pstart + STRLEN(pstart); // Last button name.
+ textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart));
+ textWidth += dlgPaddingX; /* Padding within button */
+ textWidth += DLG_VERT_PADDING_X * 2; /* Padding around button */
+ if (textWidth > dlgwidth)
+ dlgwidth = textWidth;
+ pstart = pend + 1;
+ } while (*pend != NUL);
+ }
+
+ if (dlgwidth < DLG_MIN_WIDTH)
+ dlgwidth = DLG_MIN_WIDTH; /* Don't allow a really thin dialog!*/
+
+ /* start to fill in the dlgtemplate information. addressing by WORDs */
+ if (s_usenewlook)
+ lStyle = DS_MODALFRAME | WS_CAPTION |DS_3DLOOK| WS_VISIBLE |DS_SETFONT;
+ else
+ lStyle = DS_MODALFRAME | WS_CAPTION |DS_3DLOOK| WS_VISIBLE;
+
+ add_long(lStyle);
+ add_long(0); // (lExtendedStyle)
+ pnumitems = p; /*save where the number of items must be stored*/
+ add_word(0); // NumberOfItems(will change later)
+ add_word(10); // x
+ add_word(10); // y
+ add_word(PixelToDialogX(dlgwidth)); // cx
+
+ // Dialog height.
+ if (vertical)
+ dlgheight = msgheight + 2 * dlgPaddingY +
+ DLG_VERT_PADDING_Y + 2 * fontHeight * numButtons;
+ else
+ dlgheight = msgheight + 3 * dlgPaddingY + 2 * fontHeight;
+
+ // Dialog needs to be taller if contains an edit box.
+ editboxheight = fontHeight + dlgPaddingY + 4 * DLG_VERT_PADDING_Y;
+ if (textfield != NULL)
+ dlgheight += editboxheight;
+
+ add_word(PixelToDialogY(dlgheight));
+
+ add_word(0); // Menu
+ add_word(0); // Class
+
+ /* copy the title of the dialog */
+ nchar = nCopyAnsiToWideChar(p, (title ?
+ (LPSTR)title :
+ (LPSTR)("Vim "VIM_VERSION_MEDIUM)));
+ p += nchar;
+
+ if (s_usenewlook)
+ {
+ /* do the font, since DS_3DLOOK doesn't work properly */
+#ifdef USE_SYSMENU_FONT
+ if (use_lfSysmenu)
+ {
+ /* point size */
+ *p++ = -MulDiv(lfSysmenu.lfHeight, 72,
+ GetDeviceCaps(hdc, LOGPIXELSY));
+ nchar = nCopyAnsiToWideChar(p, TEXT(lfSysmenu.lfFaceName));
+ }
+ else
+#endif
+ {
+ *p++ = DLG_FONT_POINT_SIZE; // point size
+ nchar = nCopyAnsiToWideChar(p, TEXT(DLG_FONT_NAME));
+ }
+ p += nchar;
+ }
+
+ buttonYpos = msgheight + 2 * dlgPaddingY;
+
+ if (textfield != NULL)
+ buttonYpos += editboxheight;
+
+ pstart = tbuffer;
+ if (!vertical)
+ horizWidth = (dlgwidth - horizWidth) / 2; /* Now it's X offset */
+ for (i = 0; i < numButtons; i++)
+ {
+ /* get end of this button. */
+ for ( pend = pstart;
+ *pend && (*pend != DLG_BUTTON_SEP);
+ pend++)
+ ;
+
+ if (*pend)
+ *pend = '\0';
+
+ /*
+ * old NOTE:
+ * setting the BS_DEFPUSHBUTTON style doesn't work because Windows sets
+ * the focus to the first tab-able button and in so doing makes that
+ * the default!! Grrr. Workaround: Make the default button the only
+ * one with WS_TABSTOP style. Means user can't tab between buttons, but
+ * he/she can use arrow keys.
+ *
+ * new NOTE: BS_DEFPUSHBUTTON is required to be able to select the
+ * right buttun when hitting <Enter>. E.g., for the ":confirm quit"
+ * dialog. Also needed for when the textfield is the default control.
+ * It appears to work now (perhaps not on Win95?).
+ */
+ if (vertical)
+ {
+ p = add_dialog_element(p,
+ (i == dfltbutton
+ ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP,
+ PixelToDialogX(DLG_VERT_PADDING_X),
+ PixelToDialogY(buttonYpos /* TBK */
+ + 2 * fontHeight * i),
+ PixelToDialogX(dlgwidth - 2 * DLG_VERT_PADDING_X),
+ (WORD)(PixelToDialogY(2 * fontHeight) - 1),
+ (WORD)(IDCANCEL + 1 + i), (WORD)0x0080, pstart);
+ }
+ else
+ {
+ p = add_dialog_element(p,
+ (i == dfltbutton
+ ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP,
+ PixelToDialogX(horizWidth + buttonPositions[i]),
+ PixelToDialogY(buttonYpos), /* TBK */
+ PixelToDialogX(buttonWidths[i]),
+ (WORD)(PixelToDialogY(2 * fontHeight) - 1),
+ (WORD)(IDCANCEL + 1 + i), (WORD)0x0080, pstart);
+ }
+ pstart = pend + 1; /*next button*/
+ }
+ *pnumitems += numButtons;
+
+ /* Vim icon */
+ p = add_dialog_element(p, SS_ICON,
+ PixelToDialogX(dlgPaddingX),
+ PixelToDialogY(dlgPaddingY),
+ PixelToDialogX(DLG_ICON_WIDTH),
+ PixelToDialogY(DLG_ICON_HEIGHT),
+ DLG_NONBUTTON_CONTROL + 0, (WORD)0x0082,
+ dlg_icons[type]);
+
+ /* Dialog message */
+ p = add_dialog_element(p, SS_LEFT,
+ PixelToDialogX(2 * dlgPaddingX + DLG_ICON_WIDTH),
+ PixelToDialogY(dlgPaddingY),
+ (WORD)(PixelToDialogX(messageWidth) + 1),
+ PixelToDialogY(msgheight),
+ DLG_NONBUTTON_CONTROL + 1, (WORD)0x0082, message);
+
+ /* Edit box */
+ if (textfield != NULL)
+ {
+ p = add_dialog_element(p, ES_LEFT|ES_AUTOHSCROLL|WS_TABSTOP|WS_BORDER,
+ PixelToDialogX(2 * dlgPaddingX),
+ PixelToDialogY(2 * dlgPaddingY + msgheight),
+ PixelToDialogX(dlgwidth - 4 * dlgPaddingX),
+ PixelToDialogY(fontHeight + dlgPaddingY),
+ DLG_NONBUTTON_CONTROL + 2, (WORD)0x0081, textfield);
+ *pnumitems += 1;
+ }
+
+ *pnumitems += 2;
+
+ SelectFont(hdc, oldFont);
+ DeleteObject(font);
+ ReleaseDC(hwnd, hdc);
+
+ /* Let the dialog_callback() function know which button to make default
+ * If we have an edit box, make that the default. We also need to tell
+ * dialog_callback() if this dialog contains an edit box or not. We do
+ * this by setting s_textfield if it does.
+ */
+ if (textfield != NULL)
+ {
+ dialog_default_button = DLG_NONBUTTON_CONTROL + 2;
+ s_textfield = textfield;
+ }
+ else
+ {
+ dialog_default_button = IDCANCEL + 1 + dfltbutton;
+ s_textfield = NULL;
+ }
+
+ /* show the dialog box modally and get a return value */
+ nchar = (int)DialogBoxIndirect(
+ s_hinst,
+ (LPDLGTEMPLATE)pdlgtemplate,
+ s_hwnd,
+ (DLGPROC)dialog_callback);
+
+ LocalFree(LocalHandle(pdlgtemplate));
+ vim_free(tbuffer);
+ vim_free(buttonWidths);
+ vim_free(buttonPositions);
+
+ /* Focus back to our window (for when MDI is used). */
+ (void)SetFocus(s_hwnd);
+
+ return nchar;
+}
+
+#endif /* FEAT_GUI_DIALOG */
+/*
+ * Put a simple element (basic class) onto a dialog template in memory.
+ * return a pointer to where the next item should be added.
+ *
+ * parameters:
+ * lStyle = additional style flags
+ * (be careful, NT3.51 & Win32s will ignore the new ones)
+ * x,y = x & y positions IN DIALOG UNITS
+ * w,h = width and height IN DIALOG UNITS
+ * Id = ID used in messages
+ * clss = class ID, e.g 0x0080 for a button, 0x0082 for a static
+ * caption = usually text or resource name
+ *
+ * TODO: use the length information noted here to enable the dialog creation
+ * routines to work out more exactly how much memory they need to alloc.
+ */
+ static PWORD
+add_dialog_element(
+ PWORD p,
+ DWORD lStyle,
+ WORD x,
+ WORD y,
+ WORD w,
+ WORD h,
+ WORD Id,
+ WORD clss,
+ const char *caption)
+{
+ int nchar;
+
+ p = lpwAlign(p); /* Align to dword boundary*/
+ lStyle = lStyle | WS_VISIBLE | WS_CHILD;
+ *p++ = LOWORD(lStyle);
+ *p++ = HIWORD(lStyle);
+ *p++ = 0; // LOWORD (lExtendedStyle)
+ *p++ = 0; // HIWORD (lExtendedStyle)
+ *p++ = x;
+ *p++ = y;
+ *p++ = w;
+ *p++ = h;
+ *p++ = Id; //9 or 10 words in all
+
+ *p++ = (WORD)0xffff;
+ *p++ = clss; //2 more here
+
+ nchar = nCopyAnsiToWideChar(p, (LPSTR)caption); //strlen(caption)+1
+ p += nchar;
+
+ *p++ = 0; // advance pointer over nExtraStuff WORD - 2 more
+
+ return p; //total = 15+ (strlen(caption)) words
+ // = 30 + 2(strlen(caption) bytes reqd
+}
+
+
+/*
+ * Helper routine. Take an input pointer, return closest pointer that is
+ * aligned on a DWORD (4 byte) boundary. Taken from the Win32SDK samples.
+ */
+ static LPWORD
+lpwAlign(
+ LPWORD lpIn)
+{
+ ULONG ul;
+
+ ul = (ULONG)lpIn;
+ ul += 3;
+ ul >>= 2;
+ ul <<= 2;
+ return (LPWORD)ul;
+}
+
+/*
+ * Helper routine. Takes second parameter as Ansi string, copies it to first
+ * parameter as wide character (16-bits / char) string, and returns integer
+ * number of wide characters (words) in string (including the trailing wide
+ * char NULL). Partly taken from the Win32SDK samples.
+ */
+ static int
+nCopyAnsiToWideChar(
+ LPWORD lpWCStr,
+ LPSTR lpAnsiIn)
+{
+ int nChar = 0;
+#ifdef FEAT_MBYTE
+ int len = lstrlen(lpAnsiIn) + 1; /* include NUL character */
+ int i;
+ WCHAR *wn;
+
+ if (enc_codepage == 0 && (int)GetACP() != enc_codepage)
+ {
+ /* Not a codepage, use our own conversion function. */
+ wn = enc_to_ucs2(lpAnsiIn, NULL);
+ if (wn != NULL)
+ {
+ wcscpy(lpWCStr, wn);
+ nChar = wcslen(wn) + 1;
+ vim_free(wn);
+ }
+ }
+ if (nChar == 0)
+ /* Use Win32 conversion function. */
+ nChar = MultiByteToWideChar(
+ enc_codepage > 0 ? enc_codepage : CP_ACP,
+ MB_PRECOMPOSED,
+ lpAnsiIn, len,
+ lpWCStr, len);
+ for (i = 0; i < nChar; ++i)
+ if (lpWCStr[i] == (WORD)'\t') /* replace tabs with spaces */
+ lpWCStr[i] = (WORD)' ';
+#else
+ do
+ {
+ if (*lpAnsiIn == '\t')
+ *lpWCStr++ = (WORD)' ';
+ else
+ *lpWCStr++ = (WORD)*lpAnsiIn;
+ nChar++;
+ } while (*lpAnsiIn++);
+#endif
+
+ return nChar;
+}
+
+
+#ifdef FEAT_TEAROFF
+/*
+ * The callback function for all the modeless dialogs that make up the
+ * "tearoff menus" Very simple - forward button presses (to fool Vim into
+ * thinking its menus have been clicked), and go away when closed.
+ */
+ static LRESULT CALLBACK
+tearoff_callback(
+ HWND hwnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ if (message == WM_INITDIALOG)
+ return (TRUE);
+
+ /* May show the mouse pointer again. */
+ HandleMouseHide(message, lParam);
+
+ if (message == WM_COMMAND)
+ {
+ if ((WORD)(LOWORD(wParam)) & 0x8000)
+ {
+ POINT mp;
+ RECT rect;
+
+ if (GetCursorPos(&mp) && GetWindowRect(hwnd, &rect))
+ {
+ (void)TrackPopupMenu(
+ (HMENU)(LOWORD(wParam) ^ 0x8000),
+ TPM_LEFTALIGN | TPM_LEFTBUTTON,
+ (int)rect.right - 8,
+ (int)mp.y,
+ (int)0, /*reserved param*/
+ s_hwnd,
+ NULL);
+ /*
+ * NOTE: The pop-up menu can eat the mouse up event.
+ * We deal with this in normal.c.
+ */
+ }
+ }
+ else
+ /* Pass on messages to the main Vim window */
+ PostMessage(s_hwnd, WM_COMMAND, LOWORD(wParam), 0);
+ /*
+ * Give main window the focus back: this is so after
+ * choosing a tearoff button you can start typing again
+ * straight away.
+ */
+ (void)SetFocus(s_hwnd);
+ return TRUE;
+ }
+ if ((message == WM_SYSCOMMAND) && (wParam == SC_CLOSE))
+ {
+ DestroyWindow(hwnd);
+ return TRUE;
+ }
+
+ /* When moved around, give main window the focus back. */
+ if (message == WM_EXITSIZEMOVE)
+ (void)SetActiveWindow(s_hwnd);
+
+ return FALSE;
+}
+#endif
+
+
+/*
+ * Decide whether to use the "new look" (small, non-bold font) or the "old
+ * look" (big, clanky font) for dialogs, and work out a few values for use
+ * later accordingly.
+ */
+ static void
+get_dialog_font_metrics(void)
+{
+ HDC hdc;
+ HFONT hfontTools = 0;
+ DWORD dlgFontSize;
+ SIZE size;
+#ifdef USE_SYSMENU_FONT
+ LOGFONT lfSysmenu;
+#endif
+
+ s_usenewlook = FALSE;
+
+ /*
+ * For NT3.51 and Win32s, we stick with the old look
+ * because it matches everything else.
+ */
+ if (!is_winnt_3())
+ {
+#ifdef USE_SYSMENU_FONT
+ if (gui_w32_get_menu_font(&lfSysmenu) == OK)
+ hfontTools = CreateFontIndirect(&lfSysmenu);
+ else
+#endif
+ hfontTools = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME);
+
+ if (hfontTools)
+ {
+ hdc = GetDC(s_hwnd);
+ SelectObject(hdc, hfontTools);
+ /*
+ * GetTextMetrics() doesn't return the right value in
+ * tmAveCharWidth, so we have to figure out the dialog base units
+ * ourselves.
+ */
+ GetTextExtentPoint(hdc,
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+ 52, &size);
+ ReleaseDC(s_hwnd, hdc);
+
+ s_dlgfntwidth = (WORD)((size.cx / 26 + 1) / 2);
+ s_dlgfntheight = (WORD)size.cy;
+ s_usenewlook = TRUE;
+ }
+ }
+
+ if (!s_usenewlook)
+ {
+ dlgFontSize = GetDialogBaseUnits(); /* fall back to big old system*/
+ s_dlgfntwidth = LOWORD(dlgFontSize);
+ s_dlgfntheight = HIWORD(dlgFontSize);
+ }
+}
+
+#if defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+/*
+ * Create a pseudo-"tearoff menu" based on the child
+ * items of a given menu pointer.
+ */
+ static void
+gui_mch_tearoff(
+ char_u *title,
+ vimmenu_T *menu,
+ int initX,
+ int initY)
+{
+ WORD *p, *pdlgtemplate, *pnumitems, *ptrueheight;
+ int template_len;
+ int nchar, textWidth, submenuWidth;
+ DWORD lStyle;
+ DWORD lExtendedStyle;
+ WORD dlgwidth;
+ WORD menuID;
+ vimmenu_T *pmenu;
+ vimmenu_T *the_menu = menu;
+ HWND hwnd;
+ HDC hdc;
+ HFONT font, oldFont;
+ int col, spaceWidth, len;
+ int columnWidths[2];
+ char_u *label, *text;
+ int acLen = 0;
+ int nameLen;
+ int padding0, padding1, padding2 = 0;
+ int sepPadding=0;
+#ifdef USE_SYSMENU_FONT
+ LOGFONT lfSysmenu;
+ int use_lfSysmenu = FALSE;
+#endif
+
+ /*
+ * If this menu is already torn off, move it to the mouse position.
+ */
+ if (IsWindow(menu->tearoff_handle))
+ {
+ POINT mp;
+ if (GetCursorPos((LPPOINT)&mp))
+ {
+ SetWindowPos(menu->tearoff_handle, NULL, mp.x, mp.y, 0, 0,
+ SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
+ }
+ return;
+ }
+
+ /*
+ * Create a new tearoff.
+ */
+ if (*title == MNU_HIDDEN_CHAR)
+ title++;
+
+ /* Allocate memory to store the dialog template. It's made bigger when
+ * needed. */
+ template_len = DLG_ALLOC_SIZE;
+ pdlgtemplate = p = (WORD *)LocalAlloc(LPTR, template_len);
+ if (p == NULL)
+ return;
+
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+#ifdef USE_SYSMENU_FONT
+ if (gui_w32_get_menu_font(&lfSysmenu) == OK)
+ {
+ font = CreateFontIndirect(&lfSysmenu);
+ use_lfSysmenu = TRUE;
+ }
+ else
+#endif
+ font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ VARIABLE_PITCH , DLG_FONT_NAME);
+ if (s_usenewlook)
+ oldFont = SelectFont(hdc, font);
+ else
+ oldFont = SelectFont(hdc, GetStockObject(SYSTEM_FONT));
+
+ /* Calculate width of a single space. Used for padding columns to the
+ * right width. */
+ spaceWidth = GetTextWidth(hdc, " ", 1);
+
+ /* Figure out max width of the text column, the accelerator column and the
+ * optional submenu column. */
+ submenuWidth = 0;
+ for (col = 0; col < 2; col++)
+ {
+ columnWidths[col] = 0;
+ for (pmenu = menu->children; pmenu != NULL; pmenu = pmenu->next)
+ {
+ /* Use "dname" here to compute the width of the visible text. */
+ text = (col == 0) ? pmenu->dname : pmenu->actext;
+ if (text != NULL && *text != NUL)
+ {
+ textWidth = GetTextWidthEnc(hdc, text, (int)STRLEN(text));
+ if (textWidth > columnWidths[col])
+ columnWidths[col] = textWidth;
+ }
+ if (pmenu->children != NULL)
+ submenuWidth = TEAROFF_COLUMN_PADDING * spaceWidth;
+ }
+ }
+ if (columnWidths[1] == 0)
+ {
+ /* no accelerators */
+ if (submenuWidth != 0)
+ columnWidths[0] += submenuWidth;
+ else
+ columnWidths[0] += spaceWidth;
+ }
+ else
+ {
+ /* there is an accelerator column */
+ columnWidths[0] += TEAROFF_COLUMN_PADDING * spaceWidth;
+ columnWidths[1] += submenuWidth;
+ }
+
+ /*
+ * Now find the total width of our 'menu'.
+ */
+ textWidth = columnWidths[0] + columnWidths[1];
+ if (submenuWidth != 0)
+ {
+ submenuWidth = GetTextWidth(hdc, TEAROFF_SUBMENU_LABEL,
+ (int)STRLEN(TEAROFF_SUBMENU_LABEL));
+ textWidth += submenuWidth;
+ }
+ dlgwidth = GetTextWidthEnc(hdc, title, (int)STRLEN(title));
+ if (textWidth > dlgwidth)
+ dlgwidth = textWidth;
+ dlgwidth += 2 * TEAROFF_PADDING_X + TEAROFF_BUTTON_PAD_X;
+
+ /* W95 can't do thin dialogs, they look v. weird! */
+ if (mch_windows95() && dlgwidth < TEAROFF_MIN_WIDTH)
+ dlgwidth = TEAROFF_MIN_WIDTH;
+
+ /* start to fill in the dlgtemplate information. addressing by WORDs */
+ if (s_usenewlook)
+ lStyle = DS_MODALFRAME | WS_CAPTION| WS_SYSMENU |DS_SETFONT| WS_VISIBLE;
+ else
+ lStyle = DS_MODALFRAME | WS_CAPTION| WS_SYSMENU | WS_VISIBLE;
+
+ lExtendedStyle = WS_EX_TOOLWINDOW|WS_EX_STATICEDGE;
+ *p++ = LOWORD(lStyle);
+ *p++ = HIWORD(lStyle);
+ *p++ = LOWORD(lExtendedStyle);
+ *p++ = HIWORD(lExtendedStyle);
+ pnumitems = p; /* save where the number of items must be stored */
+ *p++ = 0; // NumberOfItems(will change later)
+ if (initX == 0xffffL)
+ *p++ = PixelToDialogX(gui_mch_get_mouse_x()); // x
+ else
+ *p++ = PixelToDialogX(initX); // x
+ if (initY == 0xffffL)
+ *p++ = PixelToDialogY(gui_mch_get_mouse_y()); // y
+ else
+ *p++ = PixelToDialogY(initY); // y
+ *p++ = PixelToDialogX(dlgwidth); // cx
+ ptrueheight = p;
+ *p++ = 0; // dialog height: changed later anyway
+ *p++ = 0; // Menu
+ *p++ = 0; // Class
+
+ /* copy the title of the dialog */
+ nchar = nCopyAnsiToWideChar(p, ((*title)
+ ? (LPSTR)title
+ : (LPSTR)("Vim "VIM_VERSION_MEDIUM)));
+ p += nchar;
+
+ if (s_usenewlook)
+ {
+ /* do the font, since DS_3DLOOK doesn't work properly */
+#ifdef USE_SYSMENU_FONT
+ if (use_lfSysmenu)
+ {
+ /* point size */
+ *p++ = -MulDiv(lfSysmenu.lfHeight, 72,
+ GetDeviceCaps(hdc, LOGPIXELSY));
+ nchar = nCopyAnsiToWideChar(p, TEXT(lfSysmenu.lfFaceName));
+ }
+ else
+#endif
+ {
+ *p++ = DLG_FONT_POINT_SIZE; // point size
+ nchar = nCopyAnsiToWideChar (p, TEXT(DLG_FONT_NAME));
+ }
+ p += nchar;
+ }
+
+ /*
+ * Loop over all the items in the menu.
+ * But skip over the tearbar.
+ */
+ if (STRCMP(menu->children->name, TEAR_STRING) == 0)
+ menu = menu->children->next;
+ else
+ menu = menu->children;
+ for ( ; menu != NULL; menu = menu->next)
+ {
+ if (menu->modes == 0) /* this menu has just been deleted */
+ continue;
+ if (menu_is_separator(menu->dname))
+ {
+ sepPadding += 3;
+ continue;
+ }
+
+ /* Check if there still is plenty of room in the template. Make it
+ * larger when needed. */
+ if (((char *)p - (char *)pdlgtemplate) + 1000 > template_len)
+ {
+ WORD *newp;
+
+ newp = (WORD *)LocalAlloc(LPTR, template_len + 4096);
+ if (newp != NULL)
+ {
+ template_len += 4096;
+ mch_memmove(newp, pdlgtemplate,
+ (char *)p - (char *)pdlgtemplate);
+ p = newp + (p - pdlgtemplate);
+ pnumitems = newp + (pnumitems - pdlgtemplate);
+ ptrueheight = newp + (ptrueheight - pdlgtemplate);
+ LocalFree(LocalHandle(pdlgtemplate));
+ pdlgtemplate = newp;
+ }
+ }
+
+ /* Figure out minimal length of this menu label. Use "name" for the
+ * actual text, "dname" for estimating the displayed size. "name"
+ * has "&a" for mnemonic and includes the accelerator. */
+ len = nameLen = (int)STRLEN(menu->name);
+ padding0 = (columnWidths[0] - GetTextWidthEnc(hdc, menu->dname,
+ (int)STRLEN(menu->dname))) / spaceWidth;
+ len += padding0;
+
+ if (menu->actext != NULL)
+ {
+ acLen = (int)STRLEN(menu->actext);
+ len += acLen;
+ textWidth = GetTextWidthEnc(hdc, menu->actext, acLen);
+ }
+ else
+ textWidth = 0;
+ padding1 = (columnWidths[1] - textWidth) / spaceWidth;
+ len += padding1;
+
+ if (menu->children == NULL)
+ {
+ padding2 = submenuWidth / spaceWidth;
+ len += padding2;
+ menuID = (WORD)(menu->id);
+ }
+ else
+ {
+ len += (int)STRLEN(TEAROFF_SUBMENU_LABEL);
+ menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000);
+ }
+
+ /* Allocate menu label and fill it in */
+ text = label = alloc((unsigned)len + 1);
+ if (label == NULL)
+ break;
+
+ STRNCPY(text, menu->name, nameLen);
+ text[nameLen] = NUL;
+ text = vim_strchr(text, TAB); /* stop at TAB before actext */
+ if (text == NULL)
+ text = label + nameLen; /* no actext, use whole name */
+ while (padding0-- > 0)
+ *text++ = ' ';
+ if (menu->actext != NULL)
+ {
+ STRNCPY(text, menu->actext, acLen);
+ text += acLen;
+ }
+ while (padding1-- > 0)
+ *text++ = ' ';
+ if (menu->children != NULL)
+ {
+ STRCPY(text, TEAROFF_SUBMENU_LABEL);
+ text += STRLEN(TEAROFF_SUBMENU_LABEL);
+ }
+ else
+ {
+ while (padding2-- > 0)
+ *text++ = ' ';
+ }
+ *text = NUL;
+
+ /*
+ * BS_LEFT will just be ignored on Win32s/NT3.5x - on
+ * W95/NT4 it makes the tear-off look more like a menu.
+ */
+ p = add_dialog_element(p,
+ BS_PUSHBUTTON|BS_LEFT,
+ (WORD)PixelToDialogX(TEAROFF_PADDING_X),
+ (WORD)(sepPadding + 1 + 13 * (*pnumitems)),
+ (WORD)PixelToDialogX(dlgwidth - 2 * TEAROFF_PADDING_X),
+ (WORD)12,
+ menuID, (WORD)0x0080, label);
+ vim_free(label);
+ (*pnumitems)++;
+ }
+
+ *ptrueheight = (WORD)(sepPadding + 1 + 13 * (*pnumitems));
+
+
+ /* show modelessly */
+ the_menu->tearoff_handle = CreateDialogIndirect(
+ s_hinst,
+ (LPDLGTEMPLATE)pdlgtemplate,
+ s_hwnd,
+ (DLGPROC)tearoff_callback);
+
+ LocalFree(LocalHandle(pdlgtemplate));
+ SelectFont(hdc, oldFont);
+ DeleteObject(font);
+ ReleaseDC(hwnd, hdc);
+
+ /*
+ * Reassert ourselves as the active window. This is so that after creating
+ * a tearoff, the user doesn't have to click with the mouse just to start
+ * typing again!
+ */
+ (void)SetActiveWindow(s_hwnd);
+
+ /* make sure the right buttons are enabled */
+ force_menu_update = TRUE;
+}
+#endif
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+#include "gui_w32_rc.h"
+
+/* This not defined in older SDKs */
+# ifndef TBSTYLE_FLAT
+# define TBSTYLE_FLAT 0x0800
+# endif
+
+/*
+ * Create the toolbar, initially unpopulated.
+ * (just like the menu, there are no defaults, it's all
+ * set up through menu.vim)
+ */
+ static void
+initialise_toolbar(void)
+{
+ InitCommonControls();
+ s_toolbarhwnd = CreateToolbarEx(
+ s_hwnd,
+ WS_CHILD | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT,
+ 4000, //any old big number
+ 31, //number of images in inital bitmap
+ s_hinst,
+ IDR_TOOLBAR1, // id of initial bitmap
+ NULL,
+ 0, // initial number of buttons
+ TOOLBAR_BUTTON_WIDTH, //api guide is wrong!
+ TOOLBAR_BUTTON_HEIGHT,
+ TOOLBAR_BUTTON_WIDTH,
+ TOOLBAR_BUTTON_HEIGHT,
+ sizeof(TBBUTTON)
+ );
+
+ gui_mch_show_toolbar(vim_strchr(p_go, GO_TOOLBAR) != NULL);
+}
+
+ static int
+get_toolbar_bitmap(vimmenu_T *menu)
+{
+ int i = -1;
+
+ /*
+ * Check user bitmaps first, unless builtin is specified.
+ */
+ if (!is_winnt_3() && !menu->icon_builtin)
+ {
+ char_u fname[MAXPATHL];
+ HANDLE hbitmap = NULL;
+
+ if (menu->iconfile != NULL)
+ {
+ gui_find_iconfile(menu->iconfile, fname, "bmp");
+ hbitmap = LoadImage(
+ NULL,
+ fname,
+ IMAGE_BITMAP,
+ TOOLBAR_BUTTON_WIDTH,
+ TOOLBAR_BUTTON_HEIGHT,
+ LR_LOADFROMFILE |
+ LR_LOADMAP3DCOLORS
+ );
+ }
+
+ /*
+ * If the LoadImage call failed, or the "icon=" file
+ * didn't exist or wasn't specified, try the menu name
+ */
+ if (hbitmap == NULL
+ && (gui_find_bitmap(menu->name, fname, "bmp") == OK))
+ hbitmap = LoadImage(
+ NULL,
+ fname,
+ IMAGE_BITMAP,
+ TOOLBAR_BUTTON_WIDTH,
+ TOOLBAR_BUTTON_HEIGHT,
+ LR_LOADFROMFILE |
+ LR_LOADMAP3DCOLORS
+ );
+
+ if (hbitmap != NULL)
+ {
+ TBADDBITMAP tbAddBitmap;
+
+ tbAddBitmap.hInst = NULL;
+ tbAddBitmap.nID = (UINT)hbitmap;
+
+ i = (int)SendMessage(s_toolbarhwnd, TB_ADDBITMAP,
+ (WPARAM)1, (LPARAM)&tbAddBitmap);
+ /* i will be set to -1 if it fails */
+ }
+ }
+ if (i == -1 && menu->iconidx >= 0 && menu->iconidx < TOOLBAR_BITMAP_COUNT)
+ i = menu->iconidx;
+
+ return i;
+}
+#endif
+
+#if defined(FEAT_OLE) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Make the GUI window come to the foreground.
+ */
+ void
+gui_mch_set_foreground(void)
+{
+ if (IsIconic(s_hwnd))
+ SendMessage(s_hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+ SetForegroundWindow(s_hwnd);
+}
+#endif
+
+#if defined(FEAT_MBYTE_IME) && defined(DYNAMIC_IME)
+ static void
+dyn_imm_load(void)
+{
+ hLibImm = LoadLibrary("imm32.dll");
+ if (hLibImm == NULL)
+ return;
+
+ pImmGetCompositionStringA
+ = (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringA");
+ pImmGetCompositionStringW
+ = (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringW");
+ pImmGetContext
+ = (void *)GetProcAddress(hLibImm, "ImmGetContext");
+ pImmAssociateContext
+ = (void *)GetProcAddress(hLibImm, "ImmAssociateContext");
+ pImmReleaseContext
+ = (void *)GetProcAddress(hLibImm, "ImmReleaseContext");
+ pImmGetOpenStatus
+ = (void *)GetProcAddress(hLibImm, "ImmGetOpenStatus");
+ pImmSetOpenStatus
+ = (void *)GetProcAddress(hLibImm, "ImmSetOpenStatus");
+ pImmGetCompositionFont
+ = (void *)GetProcAddress(hLibImm, "ImmGetCompositionFontA");
+ pImmSetCompositionFont
+ = (void *)GetProcAddress(hLibImm, "ImmSetCompositionFontA");
+ pImmSetCompositionWindow
+ = (void *)GetProcAddress(hLibImm, "ImmSetCompositionWindow");
+ pImmGetConversionStatus
+ = (void *)GetProcAddress(hLibImm, "ImmGetConversionStatus");
+
+ if ( pImmGetCompositionStringA == NULL
+ || pImmGetCompositionStringW == NULL
+ || pImmGetContext == NULL
+ || pImmAssociateContext == NULL
+ || pImmReleaseContext == NULL
+ || pImmGetOpenStatus == NULL
+ || pImmSetOpenStatus == NULL
+ || pImmGetCompositionFont == NULL
+ || pImmSetCompositionFont == NULL
+ || pImmSetCompositionWindow == NULL
+ || pImmGetConversionStatus == NULL)
+ {
+ FreeLibrary(hLibImm);
+ hLibImm = NULL;
+ pImmGetContext = NULL;
+ return;
+ }
+
+ return;
+}
+
+# if 0 /* not used */
+ int
+dyn_imm_unload(void)
+{
+ if (!hLibImm)
+ return FALSE;
+ FreeLibrary(hLibImm);
+ hLibImm = NULL;
+ return TRUE;
+}
+# endif
+
+#endif
+
+#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+
+# ifdef FEAT_XPM_W32
+# define IMAGE_XPM 100
+# endif
+
+typedef struct _signicon_t
+{
+ HANDLE hImage;
+ UINT uType;
+#ifdef FEAT_XPM_W32
+ HANDLE hShape; /* Mask bitmap handle */
+#endif
+} signicon_t;
+
+ void
+gui_mch_drawsign(row, col, typenr)
+ int row;
+ int col;
+ int typenr;
+{
+ signicon_t *sign;
+ int x, y, w, h;
+
+ if (!gui.in_use || (sign = (signicon_t *)sign_get_image(typenr)) == NULL)
+ return;
+
+ x = TEXT_X(col);
+ y = TEXT_Y(row);
+ w = gui.char_width * 2;
+ h = gui.char_height;
+ switch (sign->uType)
+ {
+ case IMAGE_BITMAP:
+ {
+ HDC hdcMem;
+ HBITMAP hbmpOld;
+
+ hdcMem = CreateCompatibleDC(s_hdc);
+ hbmpOld = (HBITMAP)SelectObject(hdcMem, sign->hImage);
+ BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCCOPY);
+ SelectObject(hdcMem, hbmpOld);
+ DeleteDC(hdcMem);
+ }
+ break;
+ case IMAGE_ICON:
+ case IMAGE_CURSOR:
+ DrawIconEx(s_hdc, x, y, (HICON)sign->hImage, w, h, 0, NULL, DI_NORMAL);
+ break;
+#ifdef FEAT_XPM_W32
+ case IMAGE_XPM:
+ {
+ HDC hdcMem;
+ HBITMAP hbmpOld;
+
+ hdcMem = CreateCompatibleDC(s_hdc);
+ hbmpOld = (HBITMAP)SelectObject(hdcMem, sign->hShape);
+ /* Make hole */
+ BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCAND);
+
+ SelectObject(hdcMem, sign->hImage);
+ /* Paint sign */
+ BitBlt(s_hdc, x, y, w, h, hdcMem, 0, 0, SRCPAINT);
+ SelectObject(hdcMem, hbmpOld);
+ DeleteDC(hdcMem);
+ }
+ break;
+#endif
+ }
+}
+
+ static void
+close_signicon_image(signicon_t *sign)
+{
+ if (sign)
+ switch (sign->uType)
+ {
+ case IMAGE_BITMAP:
+ DeleteObject((HGDIOBJ)sign->hImage);
+ break;
+ case IMAGE_CURSOR:
+ DestroyCursor((HCURSOR)sign->hImage);
+ break;
+ case IMAGE_ICON:
+ DestroyIcon((HICON)sign->hImage);
+ break;
+#ifdef FEAT_XPM_W32
+ case IMAGE_XPM:
+ DeleteObject((HBITMAP)sign->hImage);
+ DeleteObject((HBITMAP)sign->hShape);
+ break;
+#endif
+ }
+}
+
+ void *
+gui_mch_register_sign(signfile)
+ char_u *signfile;
+{
+ signicon_t sign, *psign;
+ char_u *ext;
+
+ if (is_winnt_3())
+ {
+ EMSG(_(e_signdata));
+ return NULL;
+ }
+
+ sign.hImage = NULL;
+ ext = signfile + STRLEN(signfile) - 4; /* get extention */
+ if (ext > signfile)
+ {
+ int do_load = 1;
+
+ if (!STRICMP(ext, ".bmp"))
+ sign.uType = IMAGE_BITMAP;
+ else if (!STRICMP(ext, ".ico"))
+ sign.uType = IMAGE_ICON;
+ else if (!STRICMP(ext, ".cur") || !STRICMP(ext, ".ani"))
+ sign.uType = IMAGE_CURSOR;
+ else
+ do_load = 0;
+
+ if (do_load)
+ sign.hImage = (HANDLE)LoadImage(NULL, signfile, sign.uType,
+ gui.char_width * 2, gui.char_height,
+ LR_LOADFROMFILE | LR_CREATEDIBSECTION);
+#ifdef FEAT_XPM_W32
+ if (!STRICMP(ext, ".xpm"))
+ {
+ sign.uType = IMAGE_XPM;
+ LoadXpmImage(signfile, (HBITMAP *)&sign.hImage, (HBITMAP *)&sign.hShape);
+ }
+#endif
+ }
+
+ psign = NULL;
+ if (sign.hImage && (psign = (signicon_t *)alloc(sizeof(signicon_t)))
+ != NULL)
+ *psign = sign;
+
+ if (!psign)
+ {
+ if (sign.hImage)
+ close_signicon_image(&sign);
+ EMSG(_(e_signdata));
+ }
+ return (void *)psign;
+
+}
+
+ void
+gui_mch_destroy_sign(sign)
+ void *sign;
+{
+ if (sign)
+ {
+ close_signicon_image((signicon_t *)sign);
+ vim_free(sign);
+ }
+}
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+
+/* BALLOON-EVAL IMPLEMENTATION FOR WINDOWS.
+ * Added by Sergey Khorev
+ *
+ * The only reused thing is gui_beval.h and gui_mch_get_beval_info()
+ * from gui_beval.c (note it uses x and y of the BalloonEval struct
+ * to get current mouse position).
+ *
+ * Trying to use as more Windows services as possible, and as less
+ * IE version as possible :)).
+ *
+ * 1) Don't create ToolTip in gui_mch_create_beval_area, only initialize
+ * BalloonEval struct.
+ * 2) Enable/Disable simply create/kill BalloonEval Timer
+ * 3) When there was enough inactivity, timer procedure posts
+ * async request to debugger
+ * 4) gui_mch_post_balloon (invoked from netbeans.c) creates tooltip control
+ * and performs some actions to show it ASAP
+ * 5) WM_NOTOFY:TTN_POP destroys created tooltip
+ */
+
+ static void
+make_tooltip(beval, text, pt)
+ BalloonEval *beval;
+ char *text;
+ POINT pt;
+{
+ TOOLINFO ti;
+
+ beval->balloon = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS,
+ NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ beval->target, NULL, s_hinst, NULL);
+
+ SetWindowPos(beval->balloon, HWND_TOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
+ ti.cbSize = sizeof(TOOLINFO);
+ ti.uFlags = TTF_SUBCLASS;
+ ti.hwnd = beval->target;
+ ti.hinst = 0; /* Don't use string resources */
+ ti.uId = ID_BEVAL_TOOLTIP;
+ ti.lpszText = text;
+
+ /* Limit ballooneval bounding rect to CursorPos neighbourhood */
+ ti.rect.left = pt.x - 3;
+ ti.rect.top = pt.y - 3;
+ ti.rect.right = pt.x + 3;
+ ti.rect.bottom = pt.y + 3;
+
+ SendMessage(beval->balloon, TTM_ADDTOOL, 0, (LPARAM)&ti);
+ /* Make tooltip appear sooner */
+ SendMessage(beval->balloon, TTM_SETDELAYTIME, TTDT_INITIAL, 10);
+ /*
+ * HACK: force tooltip to appear, because it'll not appear until
+ * first mouse move. D*mn M$
+ */
+ mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0);
+ mouse_event(MOUSEEVENTF_MOVE, (DWORD)-1, (DWORD)-1, 0, 0);
+}
+
+ static void
+delete_tooltip(beval)
+ BalloonEval *beval;
+{
+ DestroyWindow(beval->balloon);
+}
+
+ static VOID CALLBACK
+BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
+ HWND hwnd;
+ UINT uMsg;
+ UINT idEvent;
+ DWORD dwTime;
+{
+ POINT pt;
+ RECT rect;
+
+ if (cur_beval == NULL || cur_beval->showState == ShS_SHOWING || !p_beval)
+ return;
+
+ GetCursorPos(&pt);
+ if (WindowFromPoint(pt) != s_textArea)
+ return;
+
+ ScreenToClient(s_textArea, &pt);
+ GetClientRect(s_textArea, &rect);
+ if (!PtInRect(&rect, pt))
+ return;
+
+ if (LastActivity > 0
+ && (dwTime - LastActivity) >= (DWORD)p_bdlay
+ && (cur_beval->showState != ShS_PENDING
+ || abs(cur_beval->x - pt.x) > 3
+ || abs(cur_beval->y - pt.y) > 3))
+ {
+ /* Pointer resting in one place long enough, it's time to show
+ * the tooltip. */
+ cur_beval->showState = ShS_PENDING;
+ cur_beval->x = pt.x;
+ cur_beval->y = pt.y;
+
+ TRACE0("BevalTimerProc: sending request");
+
+ if (cur_beval->msgCB != NULL)
+ (*cur_beval->msgCB)(cur_beval, 0);
+ }
+}
+
+ void
+gui_mch_disable_beval_area(beval)
+ BalloonEval *beval;
+{
+ TRACE0("gui_mch_disable_beval_area {{{");
+ KillTimer(s_textArea, BevalTimerId);
+ TRACE0("gui_mch_disable_beval_area }}}");
+}
+
+ void
+gui_mch_enable_beval_area(beval)
+ BalloonEval *beval;
+{
+ TRACE0("gui_mch_enable_beval_area |||");
+ if (beval == NULL)
+ return;
+ TRACE0("gui_mch_enable_beval_area {{{");
+ BevalTimerId = SetTimer(s_textArea, 0, p_bdlay / 2, (TIMERPROC)BevalTimerProc);
+ TRACE0("gui_mch_enable_beval_area }}}");
+}
+
+ void
+gui_mch_post_balloon(beval, mesg)
+ BalloonEval *beval;
+ char_u *mesg;
+{
+ POINT pt;
+ TRACE0("gui_mch_post_balloon {{{");
+ if (beval->showState == ShS_SHOWING)
+ return;
+ GetCursorPos(&pt);
+ ScreenToClient(s_textArea, &pt);
+
+ if (abs(beval->x - pt.x) < 3 && abs(beval->y - pt.y) < 3)
+ /* cursor is still here */
+ {
+ gui_mch_disable_beval_area(cur_beval);
+ beval->showState = ShS_SHOWING;
+ make_tooltip(beval, mesg, pt);
+ }
+ TRACE0("gui_mch_post_balloon }}}");
+}
+
+ BalloonEval *
+gui_mch_create_beval_area(target, mesg, mesgCB, clientData)
+ void *target; /* ignored, always use s_textArea */
+ char_u *mesg;
+ void (*mesgCB)__ARGS((BalloonEval *, int));
+ void *clientData;
+{
+ /* partially stolen from gui_beval.c */
+ BalloonEval *beval;
+
+ if (mesg != NULL && mesgCB != NULL)
+ {
+ EMSG(_("E232: Cannot create BalloonEval with both message and callback"));
+ return NULL;
+ }
+
+ beval = (BalloonEval *)alloc(sizeof(BalloonEval));
+ if (beval != NULL)
+ {
+ beval->target = s_textArea;
+ beval->balloon = NULL;
+
+ beval->showState = ShS_NEUTRAL;
+ beval->x = 0;
+ beval->y = 0;
+ beval->msg = mesg;
+ beval->msgCB = mesgCB;
+ beval->clientData = clientData;
+
+ InitCommonControls();
+
+ cur_beval = beval;
+
+ if (p_beval)
+ gui_mch_enable_beval_area(beval);
+
+ }
+ return beval;
+}
+
+ static void
+Handle_WM_Notify(hwnd, pnmh)
+ HWND hwnd;
+ LPNMHDR pnmh;
+{
+ if (pnmh->idFrom != ID_BEVAL_TOOLTIP) /* it is not our tooltip */
+ return;
+
+ if (cur_beval != NULL)
+ {
+ if (pnmh->code == TTN_SHOW)
+ {
+ TRACE0("TTN_SHOW {{{");
+ TRACE0("TTN_SHOW }}}");
+ }
+ else if (pnmh->code == TTN_POP) /* Before tooltip disappear */
+ {
+ TRACE0("TTN_POP {{{");
+ delete_tooltip(cur_beval);
+ gui_mch_enable_beval_area(cur_beval);
+ TRACE0("TTN_POP }}}");
+
+ cur_beval->showState = ShS_NEUTRAL;
+ }
+ }
+}
+
+ static void
+TrackUserActivity(UINT uMsg)
+{
+ if ((uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
+ || (uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST))
+ LastActivity = GetTickCount();
+}
+
+ void
+gui_mch_destroy_beval_area(beval)
+ BalloonEval *beval;
+{
+ vim_free(beval);
+}
+#endif /* FEAT_BEVAL */
+
+#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
+/*
+ * We have multiple signs to draw at the same location. Draw the
+ * multi-sign indicator (down-arrow) instead. This is the Win32 version.
+ */
+ void
+netbeans_draw_multisign_indicator(int row)
+{
+ int i;
+ int y;
+ int x;
+
+ x = 0;
+ y = TEXT_Y(row);
+
+ for (i = 0; i < gui.char_height - 3; i++)
+ SetPixel(s_hdc, x+2, y++, gui.currFgColor);
+
+ SetPixel(s_hdc, x+0, y, gui.currFgColor);
+ SetPixel(s_hdc, x+2, y, gui.currFgColor);
+ SetPixel(s_hdc, x+4, y++, gui.currFgColor);
+ SetPixel(s_hdc, x+1, y, gui.currFgColor);
+ SetPixel(s_hdc, x+2, y, gui.currFgColor);
+ SetPixel(s_hdc, x+3, y++, gui.currFgColor);
+ SetPixel(s_hdc, x+2, y, gui.currFgColor);
+}
+#endif
+
+#endif
diff --git a/src/gui_w32_rc.h b/src/gui_w32_rc.h
new file mode 100644
index 000000000..6c0d77341
--- /dev/null
+++ b/src/gui_w32_rc.h
@@ -0,0 +1,8 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Script1.rc
+//
+#define IDR_TOOLBAR1 101
+//#define ID_TB_BLOB 40001
+//#define ID_TB_CIRCLE 40002
+
diff --git a/src/gui_w48.c b/src/gui_w48.c
new file mode 100644
index 000000000..761c1af16
--- /dev/null
+++ b/src/gui_w48.c
@@ -0,0 +1,3402 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * gui_w48.c: This file is included in gui_w16.c and gui_w32.c.
+ *
+ * GUI support for Microsoft Windows (Win16 + Win32 = Win48 :-)
+ *
+ * The combined efforts of:
+ * George V. Reilly <george@reilly.org>
+ * Robert Webb
+ * Vince Negri
+ * ...and contributions from many others
+ *
+ */
+
+#include "vim.h"
+#include "version.h" /* used by dialog box routine for default title */
+#ifdef DEBUG
+# include <tchar.h>
+#endif
+#ifndef __MINGW32__
+# include <shellapi.h>
+#endif
+#if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL)
+# include <commctrl.h>
+#endif
+#ifdef WIN16
+# include <commdlg.h>
+# include <shellapi.h>
+# ifdef WIN16_3DLOOK
+# include <ctl3d.h>
+# endif
+#endif
+#include <windowsx.h>
+
+#ifdef GLOBAL_IME
+# include "glbl_ime.h"
+#endif
+
+#ifdef FEAT_MENU
+# define MENUHINTS /* show menu hints in command line */
+#endif
+
+/* Some parameters for dialog boxes. All in pixels. */
+#define DLG_PADDING_X 10
+#define DLG_PADDING_Y 10
+#define DLG_OLD_STYLE_PADDING_X 5
+#define DLG_OLD_STYLE_PADDING_Y 5
+#define DLG_VERT_PADDING_X 4 /* For vertical buttons */
+#define DLG_VERT_PADDING_Y 4
+#define DLG_ICON_WIDTH 34
+#define DLG_ICON_HEIGHT 34
+#define DLG_MIN_WIDTH 150
+#define DLG_FONT_NAME "MS Sans Serif"
+#define DLG_FONT_POINT_SIZE 8
+#define DLG_MIN_MAX_WIDTH 400
+
+#define DLG_NONBUTTON_CONTROL 5000 /* First ID of non-button controls */
+
+#ifndef WM_XBUTTONDOWN /* For Win2K / winME ONLY */
+# define WM_XBUTTONDOWN 0x020B
+# define WM_XBUTTONUP 0x020C
+# define WM_XBUTTONDBLCLK 0x020D
+# define MK_XBUTTON1 0x0020
+# define MK_XBUTTON2 0x0040
+#endif
+
+#ifdef PROTO
+/*
+ * Define a few things for generating prototypes. This is just to avoid
+ * syntax errors, the defines do not need to be correct.
+ */
+# define APIENTRY
+# define CALLBACK
+# define CONST
+# define FAR
+# define NEAR
+# define _cdecl
+typedef int BOOL;
+typedef int BYTE;
+typedef int DWORD;
+typedef int WCHAR;
+typedef int ENUMLOGFONT;
+typedef int FINDREPLACE;
+typedef int HANDLE;
+typedef int HBITMAP;
+typedef int HBRUSH;
+typedef int HDROP;
+typedef int INT;
+typedef int LOGFONT[];
+typedef int LPARAM;
+typedef int LPCREATESTRUCT;
+typedef int LPCSTR;
+typedef int LPCTSTR;
+typedef int LPRECT;
+typedef int LPSTR;
+typedef int LPWINDOWPOS;
+typedef int LPWORD;
+typedef int LRESULT;
+# undef MSG
+typedef int MSG;
+typedef int NEWTEXTMETRIC;
+typedef int OSVERSIONINFO;
+typedef int PWORD;
+typedef int RECT;
+typedef int UINT;
+typedef int WORD;
+typedef int WPARAM;
+typedef int POINT;
+typedef void *HINSTANCE;
+typedef void *HMENU;
+typedef void *HWND;
+typedef void *HDC;
+typedef void VOID;
+typedef int LPNMHDR;
+typedef int LONG;
+#endif
+
+#ifndef GET_X_LPARAM
+# define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
+#endif
+
+static void _OnPaint( HWND hwnd);
+static void clear_rect(RECT *rcp);
+static int gui_mswin_get_menu_height(int fix_window);
+
+static WORD s_dlgfntheight; /* height of the dialog font */
+static WORD s_dlgfntwidth; /* width of the dialog font */
+
+#ifdef FEAT_MENU
+static HMENU s_menuBar = NULL;
+#endif
+#ifdef FEAT_TEAROFF
+static void rebuild_tearoff(vimmenu_T *menu);
+static HBITMAP s_htearbitmap; /* bitmap used to indicate tearoff */
+#endif
+
+/* Flag that is set while processing a message that must not be interupted by
+ * processing another message. */
+static int s_busy_processing = FALSE;
+
+static int destroying = FALSE; /* call DestroyWindow() ourselves */
+
+#ifdef MSWIN_FIND_REPLACE
+static UINT s_findrep_msg = 0; /* set in gui_w[16/32].c */
+static FINDREPLACE s_findrep_struct;
+static HWND s_findrep_hwnd = NULL;
+static int s_findrep_is_find; /* TRUE for find dialog, FALSE
+ for find/replace dialog */
+#endif
+
+static HINSTANCE s_hinst = NULL;
+#if !defined(FEAT_SNIFF) && !defined(FEAT_GUI)
+static
+#endif
+HWND s_hwnd = NULL;
+static HDC s_hdc = NULL;
+static HBRUSH s_brush = NULL;
+
+#ifdef FEAT_TOOLBAR
+static HWND s_toolbarhwnd = NULL;
+#endif
+
+static WPARAM s_wParam = 0;
+static LPARAM s_lParam = 0;
+
+static HWND s_textArea = NULL;
+static UINT s_uMsg = 0;
+
+static char_u *s_textfield; /* Used by dialogs to pass back strings */
+
+static int s_need_activate = FALSE;
+
+/* This variable is set when waiting for an event, which is the only moment
+ * scrollbar dragging can be done directly. It's not allowed while commands
+ * are executed, because it may move the cursor and that may cause unexpected
+ * problems (e.g., while ":s" is working).
+ */
+static int allow_scrollbar = FALSE;
+
+#ifdef GLOBAL_IME
+# define MyTranslateMessage(x) global_ime_TranslateMessage(x)
+#else
+# define MyTranslateMessage(x) TranslateMessage(x)
+#endif
+
+#if (defined(WIN3264) && defined(FEAT_MBYTE)) || defined(GLOBAL_IME)
+ /* use of WindowProc depends on wide_WindowProc */
+# define MyWindowProc vim_WindowProc
+#else
+ /* use ordinary WindowProc */
+# define MyWindowProc DefWindowProc
+#endif
+
+extern int current_font_height; /* this is in os_mswin.c */
+
+static struct
+{
+ UINT key_sym;
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {VK_UP, 'k', 'u'},
+ {VK_DOWN, 'k', 'd'},
+ {VK_LEFT, 'k', 'l'},
+ {VK_RIGHT, 'k', 'r'},
+
+ {VK_F1, 'k', '1'},
+ {VK_F2, 'k', '2'},
+ {VK_F3, 'k', '3'},
+ {VK_F4, 'k', '4'},
+ {VK_F5, 'k', '5'},
+ {VK_F6, 'k', '6'},
+ {VK_F7, 'k', '7'},
+ {VK_F8, 'k', '8'},
+ {VK_F9, 'k', '9'},
+ {VK_F10, 'k', ';'},
+
+ {VK_F11, 'F', '1'},
+ {VK_F12, 'F', '2'},
+ {VK_F13, 'F', '3'},
+ {VK_F14, 'F', '4'},
+ {VK_F15, 'F', '5'},
+ {VK_F16, 'F', '6'},
+ {VK_F17, 'F', '7'},
+ {VK_F18, 'F', '8'},
+ {VK_F19, 'F', '9'},
+ {VK_F20, 'F', 'A'},
+
+ {VK_F21, 'F', 'B'},
+#ifdef FEAT_NETBEANS_INTG
+ {VK_PAUSE, 'F', 'B'}, /* Pause == F21 (see gui_gtk_x11.c) */
+#endif
+ {VK_F22, 'F', 'C'},
+ {VK_F23, 'F', 'D'},
+ {VK_F24, 'F', 'E'}, /* winuser.h defines up to F24 */
+
+ {VK_HELP, '%', '1'},
+ {VK_BACK, 'k', 'b'},
+ {VK_INSERT, 'k', 'I'},
+ {VK_DELETE, 'k', 'D'},
+ {VK_HOME, 'k', 'h'},
+ {VK_END, '@', '7'},
+ {VK_PRIOR, 'k', 'P'},
+ {VK_NEXT, 'k', 'N'},
+ {VK_PRINT, '%', '9'},
+ {VK_ADD, 'K', '6'},
+ {VK_SUBTRACT, 'K', '7'},
+ {VK_DIVIDE, 'K', '8'},
+ {VK_MULTIPLY, 'K', '9'},
+ {VK_SEPARATOR, 'K', 'A'}, /* Keypad Enter */
+ {VK_DECIMAL, 'K', 'B'},
+
+ {VK_NUMPAD0, 'K', 'C'},
+ {VK_NUMPAD1, 'K', 'D'},
+ {VK_NUMPAD2, 'K', 'E'},
+ {VK_NUMPAD3, 'K', 'F'},
+ {VK_NUMPAD4, 'K', 'G'},
+ {VK_NUMPAD5, 'K', 'H'},
+ {VK_NUMPAD6, 'K', 'I'},
+ {VK_NUMPAD7, 'K', 'J'},
+ {VK_NUMPAD8, 'K', 'K'},
+ {VK_NUMPAD9, 'K', 'L'},
+
+ /* Keys that we want to be able to use any modifier with: */
+ {VK_SPACE, ' ', NUL},
+ {VK_TAB, TAB, NUL},
+ {VK_ESCAPE, ESC, NUL},
+ {NL, NL, NUL},
+ {CAR, CAR, NUL},
+
+ /* End of list marker: */
+ {0, 0, 0}
+};
+
+/* Local variables */
+static int s_button_pending = -1;
+static int s_x_pending;
+static int s_y_pending;
+static UINT s_kFlags_pending;
+static UINT s_wait_timer = 0; /* Timer for get char from user */
+static int s_timed_out = FALSE;
+static int dead_key = 0; /* 0 - no dead key, 1 - dead key pressed */
+
+#ifdef WIN3264
+static OSVERSIONINFO os_version; /* like it says. Init in gui_mch_init() */
+#endif
+
+#ifdef FEAT_BEVAL
+/* balloon-eval WM_NOTIFY_HANDLER */
+static void Handle_WM_Notify __ARGS((HWND hwnd, LPNMHDR pnmh));
+static void TrackUserActivity __ARGS((UINT uMsg));
+#endif
+
+/*
+ * For control IME.
+ */
+#ifdef FEAT_MBYTE
+# ifdef USE_IM_CONTROL
+static LOGFONT norm_logfont;
+# endif
+#endif
+
+#ifdef FEAT_MBYTE_IME
+static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
+#endif
+
+#ifdef DEBUG
+/*
+ * Print out the last Windows error message
+ */
+ static void
+print_windows_error(void)
+{
+ LPVOID lpMsgBuf;
+
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR) &lpMsgBuf, 0, NULL);
+ TRACE1("Error: %s\n", lpMsgBuf);
+ LocalFree(lpMsgBuf);
+}
+#endif /* DEBUG */
+
+/*
+ * Cursor blink functions.
+ *
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+
+#define BLINK_NONE 0
+#define BLINK_OFF 1
+#define BLINK_ON 2
+
+static int blink_state = BLINK_NONE;
+static long_u blink_waittime = 700;
+static long_u blink_ontime = 400;
+static long_u blink_offtime = 250;
+static UINT blink_timer = 0;
+
+ void
+gui_mch_set_blinking(long wait, long on, long off)
+{
+ blink_waittime = wait;
+ blink_ontime = on;
+ blink_offtime = off;
+}
+
+/* ARGSUSED */
+ static VOID CALLBACK
+_OnBlinkTimer(
+ HWND hwnd,
+ UINT uMsg,
+ UINT idEvent,
+ DWORD dwTime)
+{
+ MSG msg;
+
+ /*
+ TRACE2("Got timer event, id %d, blink_timer %d\n", idEvent, blink_timer);
+ */
+
+ KillTimer(NULL, idEvent);
+
+ /* Eat spurious WM_TIMER messages */
+ while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+ ;
+
+ if (blink_state == BLINK_ON)
+ {
+ gui_undraw_cursor();
+ blink_state = BLINK_OFF;
+ blink_timer = (UINT) SetTimer(NULL, 0, (UINT)blink_offtime,
+ (TIMERPROC)_OnBlinkTimer);
+ }
+ else
+ {
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_ON;
+ blink_timer = (UINT) SetTimer(NULL, 0, (UINT)blink_ontime,
+ (TIMERPROC)_OnBlinkTimer);
+ }
+}
+
+ static void
+gui_mswin_rm_blink_timer(void)
+{
+ MSG msg;
+
+ if (blink_timer != 0)
+ {
+ KillTimer(NULL, blink_timer);
+ /* Eat spurious WM_TIMER messages */
+ while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+ ;
+ blink_timer = 0;
+ }
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink(void)
+{
+ gui_mswin_rm_blink_timer();
+ if (blink_state == BLINK_OFF)
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_NONE;
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink(void)
+{
+ gui_mswin_rm_blink_timer();
+
+ /* Only switch blinking on if none of the times is zero */
+ if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
+ {
+ blink_timer = (UINT)SetTimer(NULL, 0, (UINT)blink_waittime,
+ (TIMERPROC)_OnBlinkTimer);
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }
+}
+
+/*
+ * Call-back routines.
+ */
+
+ static VOID CALLBACK
+_OnTimer(
+ HWND hwnd,
+ UINT uMsg,
+ UINT idEvent,
+ DWORD dwTime)
+{
+ MSG msg;
+
+ /*
+ TRACE2("Got timer event, id %d, s_wait_timer %d\n", idEvent, s_wait_timer);
+ */
+ KillTimer(NULL, idEvent);
+ s_timed_out = TRUE;
+
+ /* Eat spurious WM_TIMER messages */
+ while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+ ;
+ if (idEvent == s_wait_timer)
+ s_wait_timer = 0;
+}
+
+ static void
+_OnDeadChar(
+ HWND hwnd,
+ UINT ch,
+ int cRepeat)
+{
+ dead_key = 1;
+}
+
+/*
+ * Convert Unicode character "ch" to bytes in "string[slen]".
+ * Return the length.
+ */
+ static int
+char_to_string(int ch, char_u *string, int slen)
+{
+ int len;
+ int i;
+#ifdef FEAT_MBYTE
+ WCHAR wstring[2];
+ char_u *ws = NULL;;
+
+ /* "ch" is a UTF-16 character. Convert it to a string of bytes. When
+ * "enc_codepage" is non-zero use the standard Win32 function, otherwise
+ * use our own conversion function (e.g., for UTF-8). */
+ wstring[0] = ch;
+ if (enc_codepage > 0)
+ len = WideCharToMultiByte(enc_codepage, 0, wstring, 1, string, slen,
+ 0, NULL);
+ else
+ {
+ len = 1;
+ ws = ucs2_to_enc(wstring, &len);
+ if (ws == NULL)
+ len = 0;
+ else
+ {
+ if (len > slen) /* just in case */
+ len = slen;
+ mch_memmove(string, ws, len);
+ vim_free(ws);
+ }
+ }
+ if (len == 0)
+#endif
+ {
+ string[0] = ch;
+ len = 1;
+ }
+
+ for (i = 0; i < len; ++i)
+ if (string[i] == CSI && len <= slen - 2)
+ {
+ /* Insert CSI as K_CSI. */
+ mch_memmove(string + i + 3, string + i + 1, len - i - 1);
+ string[++i] = KS_EXTRA;
+ string[++i] = (int)KE_CSI;
+ len += 2;
+ }
+
+ return len;
+}
+
+/*
+ * Key hit, add it to the input buffer.
+ */
+ static void
+_OnChar(
+ HWND hwnd,
+ UINT ch,
+ int cRepeat)
+{
+ char_u string[40];
+ int len = 0;
+
+ len = char_to_string(ch, string, 40);
+ if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts)
+ {
+ trash_input_buf();
+ got_int = TRUE;
+ }
+
+ add_to_input_buf(string, len);
+}
+
+/*
+ * Alt-Key hit, add it to the input buffer.
+ */
+ static void
+_OnSysChar(
+ HWND hwnd,
+ UINT cch,
+ int cRepeat)
+{
+ char_u string[40]; /* Enough for multibyte character */
+ int len;
+ int modifiers;
+ int ch = cch; /* special keys are negative */
+
+ /* TRACE("OnSysChar(%d, %c)\n", ch, ch); */
+
+ /* OK, we have a character key (given by ch) which was entered with the
+ * ALT key pressed. Eg, if the user presses Alt-A, then ch == 'A'. Note
+ * that the system distinguishes Alt-a and Alt-A (Alt-Shift-a unless
+ * CAPSLOCK is pressed) at this point.
+ */
+ modifiers = MOD_MASK_ALT;
+ if (GetKeyState(VK_SHIFT) & 0x8000)
+ modifiers |= MOD_MASK_SHIFT;
+ if (GetKeyState(VK_CONTROL) & 0x8000)
+ modifiers |= MOD_MASK_CTRL;
+
+ ch = simplify_key(ch, &modifiers);
+ /* remove the SHIFT modifier for keys where it's already included, e.g.,
+ * '(' and '*' */
+ if (ch < 0x100 && !isalpha(ch) && isprint(ch))
+ modifiers &= ~MOD_MASK_SHIFT;
+
+ /* Interpret the ALT key as making the key META, include SHIFT, etc. */
+ ch = extract_modifiers(ch, &modifiers);
+ if (ch == CSI)
+ ch = K_CSI;
+
+ len = 0;
+ if (modifiers)
+ {
+ string[len++] = CSI;
+ string[len++] = KS_MODIFIER;
+ string[len++] = modifiers;
+ }
+
+ if (IS_SPECIAL((int)ch))
+ {
+ string[len++] = CSI;
+ string[len++] = K_SECOND((int)ch);
+ string[len++] = K_THIRD((int)ch);
+ }
+ else
+ {
+ /* Although the documentation isn't clear about it, we assume "ch" is
+ * a Unicode character. */
+ len += char_to_string(ch, string + len, 40 - len);
+ }
+
+ add_to_input_buf(string, len);
+}
+
+ static void
+_OnMouseEvent(
+ int button,
+ int x,
+ int y,
+ int repeated_click,
+ UINT keyFlags)
+{
+ int vim_modifiers = 0x0;
+
+ if (keyFlags & MK_SHIFT)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (keyFlags & MK_CONTROL)
+ vim_modifiers |= MOUSE_CTRL;
+ if (GetKeyState(VK_MENU) & 0x8000)
+ vim_modifiers |= MOUSE_ALT;
+
+ gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
+}
+
+ static void
+_OnMouseButtonDown(
+ HWND hwnd,
+ BOOL fDoubleClick,
+ int x,
+ int y,
+ UINT keyFlags)
+{
+ static LONG s_prevTime = 0;
+
+ LONG currentTime = GetMessageTime();
+ int button = -1;
+ int repeated_click;
+
+ /* Give main window the focus: this is so the cursor isn't hollow. */
+ (void)SetFocus(s_hwnd);
+
+ if (s_uMsg == WM_LBUTTONDOWN || s_uMsg == WM_LBUTTONDBLCLK)
+ button = MOUSE_LEFT;
+ else if (s_uMsg == WM_MBUTTONDOWN || s_uMsg == WM_MBUTTONDBLCLK)
+ button = MOUSE_MIDDLE;
+ else if (s_uMsg == WM_RBUTTONDOWN || s_uMsg == WM_RBUTTONDBLCLK)
+ button = MOUSE_RIGHT;
+#ifndef WIN16 /*<VN>*/
+ else if (s_uMsg == WM_XBUTTONDOWN || s_uMsg == WM_XBUTTONDBLCLK)
+ {
+#ifndef GET_XBUTTON_WPARAM
+# define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
+#endif
+ button = ((GET_XBUTTON_WPARAM(s_wParam) == 1) ? MOUSE_X1 : MOUSE_X2);
+ }
+ else if (s_uMsg == WM_CAPTURECHANGED)
+ {
+ /* on W95/NT4, somehow you get in here with an odd Msg
+ * if you press one button while holding down the other..*/
+ if (s_button_pending == MOUSE_LEFT)
+ button = MOUSE_RIGHT;
+ else
+ button = MOUSE_LEFT;
+ }
+#endif
+ if (button >= 0)
+ {
+ repeated_click = ((int)(currentTime - s_prevTime) < p_mouset);
+
+ /*
+ * Holding down the left and right buttons simulates pushing the middle
+ * button.
+ */
+ if (repeated_click &&
+ ((button == MOUSE_LEFT && s_button_pending == MOUSE_RIGHT) ||
+ (button == MOUSE_RIGHT && s_button_pending == MOUSE_LEFT)))
+ {
+ /*
+ * Hmm, gui.c will ignore more than one button down at a time, so
+ * pretend we let go of it first.
+ */
+ gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, 0x0);
+ button = MOUSE_MIDDLE;
+ repeated_click = FALSE;
+ s_button_pending = -1;
+ _OnMouseEvent(button, x, y, repeated_click, keyFlags);
+ }
+ else if ((repeated_click)
+ || (mouse_model_popup() && (button == MOUSE_RIGHT)))
+ {
+ if (s_button_pending > -1)
+ {
+ _OnMouseEvent(s_button_pending, x, y, FALSE, keyFlags);
+ s_button_pending = -1;
+ }
+ /* TRACE("Button down at x %d, y %d\n", x, y); */
+ _OnMouseEvent(button, x, y, repeated_click, keyFlags);
+ }
+ else
+ {
+ /*
+ * If this is the first press (i.e. not a multiple click) don't
+ * action immediately, but store and wait for:
+ * i) button-up
+ * ii) mouse move
+ * iii) another button press
+ * before using it.
+ * This enables us to make left+right simulate middle button,
+ * without left or right being actioned first. The side-effect is
+ * that if you click and hold the mouse without dragging, the
+ * cursor doesn't move until you release the button. In practice
+ * this is hardly a problem.
+ */
+ s_button_pending = button;
+ s_x_pending = x;
+ s_y_pending = y;
+ s_kFlags_pending = keyFlags;
+ }
+
+ s_prevTime = currentTime;
+ }
+}
+
+ static void
+_OnMouseMoveOrRelease(
+ HWND hwnd,
+ int x,
+ int y,
+ UINT keyFlags)
+{
+ int button;
+
+ if (s_button_pending > -1)
+ {
+ /* Delayed action for mouse down event */
+ _OnMouseEvent(s_button_pending, s_x_pending,
+ s_y_pending, FALSE, s_kFlags_pending);
+ s_button_pending = -1;
+ }
+ if (s_uMsg == WM_MOUSEMOVE)
+ {
+ /*
+ * It's only a MOUSE_DRAG if one or more mouse buttons are being held
+ * down.
+ */
+ if (!(keyFlags & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON
+ | MK_XBUTTON1 | MK_XBUTTON2)))
+ {
+ gui_mouse_moved(x, y);
+ return;
+ }
+
+ /*
+ * While button is down, keep grabbing mouse move events when
+ * the mouse goes outside the window
+ */
+ SetCapture(s_textArea);
+ button = MOUSE_DRAG;
+ /* TRACE(" move at x %d, y %d\n", x, y); */
+ }
+ else
+ {
+ ReleaseCapture();
+ button = MOUSE_RELEASE;
+ /* TRACE(" up at x %d, y %d\n", x, y); */
+ }
+
+ _OnMouseEvent(button, x, y, FALSE, keyFlags);
+}
+
+#ifdef FEAT_MENU
+/*
+ * Find the vimmenu_T with the given id
+ */
+ static vimmenu_T *
+gui_mswin_find_menu(
+ vimmenu_T *pMenu,
+ int id)
+{
+ vimmenu_T *pChildMenu;
+
+ while (pMenu)
+ {
+ if (pMenu->id == (UINT)id)
+ break;
+ if (pMenu->children != NULL)
+ {
+ pChildMenu = gui_mswin_find_menu(pMenu->children, id);
+ if (pChildMenu)
+ {
+ pMenu = pChildMenu;
+ break;
+ }
+ }
+ pMenu = pMenu->next;
+ }
+ return pMenu;
+}
+
+ static void
+_OnMenu(
+ HWND hwnd,
+ int id,
+ HWND hwndCtl,
+ UINT codeNotify)
+{
+ vimmenu_T *pMenu;
+
+ pMenu = gui_mswin_find_menu(root_menu, id);
+ if (pMenu)
+ gui_menu_cb(pMenu);
+}
+#endif
+
+#ifdef MSWIN_FIND_REPLACE
+/*
+ * Handle a Find/Replace window message.
+ */
+ static void
+_OnFindRepl(void)
+{
+ int flags = 0;
+ int down;
+
+ if (s_findrep_struct.Flags & FR_DIALOGTERM)
+ /* Give main window the focus back. */
+ (void)SetFocus(s_hwnd);
+
+ if (s_findrep_struct.Flags & FR_FINDNEXT)
+ {
+ flags = FRD_FINDNEXT;
+
+ /* Give main window the focus back: this is so the cursor isn't
+ * hollow. */
+ (void)SetFocus(s_hwnd);
+ }
+ else if (s_findrep_struct.Flags & FR_REPLACE)
+ {
+ flags = FRD_REPLACE;
+
+ /* Give main window the focus back: this is so the cursor isn't
+ * hollow. */
+ (void)SetFocus(s_hwnd);
+ }
+ else if (s_findrep_struct.Flags & FR_REPLACEALL)
+ {
+ flags = FRD_REPLACEALL;
+ }
+
+ if (flags != 0)
+ {
+ /* Call the generic GUI function to do the actual work. */
+ if (s_findrep_struct.Flags & FR_WHOLEWORD)
+ flags |= FRD_WHOLE_WORD;
+ if (s_findrep_struct.Flags & FR_MATCHCASE)
+ flags |= FRD_MATCH_CASE;
+ down = (s_findrep_struct.Flags & FR_DOWN) != 0;
+ gui_do_findrepl(flags, s_findrep_struct.lpstrFindWhat,
+ s_findrep_struct.lpstrReplaceWith, down);
+ }
+}
+#endif
+
+ static void
+HandleMouseHide(UINT uMsg, LPARAM lParam)
+{
+ static LPARAM last_lParam = 0L;
+
+ /* We sometimes get a mousemove when the mouse didn't move... */
+ if (uMsg == WM_MOUSEMOVE)
+ {
+ if (lParam == last_lParam)
+ return;
+ last_lParam = lParam;
+ }
+
+ /* Handle specially, to centralise coding. We need to be sure we catch all
+ * possible events which should cause us to restore the cursor (as it is a
+ * shared resource, we take full responsibility for it).
+ */
+ switch (uMsg)
+ {
+ case WM_KEYUP:
+ case WM_CHAR:
+ /*
+ * blank out the pointer if necessary
+ */
+ if (p_mh)
+ gui_mch_mousehide(TRUE);
+ break;
+
+ case WM_SYSKEYUP: /* show the pointer when a system-key is pressed */
+ case WM_SYSCHAR:
+ case WM_MOUSEMOVE: /* show the pointer on any mouse action */
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONUP:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP:
+ case WM_NCMOUSEMOVE:
+ case WM_NCLBUTTONDOWN:
+ case WM_NCLBUTTONUP:
+ case WM_NCMBUTTONDOWN:
+ case WM_NCMBUTTONUP:
+ case WM_NCRBUTTONDOWN:
+ case WM_NCRBUTTONUP:
+ case WM_KILLFOCUS:
+ /*
+ * if the pointer is currently hidden, then we should show it.
+ */
+ gui_mch_mousehide(FALSE);
+ break;
+ }
+}
+
+ static LRESULT CALLBACK
+_TextAreaWndProc(
+ HWND hwnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ /*
+ TRACE("TextAreaWndProc: hwnd = %08x, msg = %x, wParam = %x, lParam = %x\n",
+ hwnd, uMsg, wParam, lParam);
+ */
+
+ HandleMouseHide(uMsg, lParam);
+
+ s_uMsg = uMsg;
+ s_wParam = wParam;
+ s_lParam = lParam;
+
+#ifdef FEAT_BEVAL
+ TrackUserActivity(uMsg);
+#endif
+
+ switch (uMsg)
+ {
+ HANDLE_MSG(hwnd, WM_LBUTTONDBLCLK,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_LBUTTONDOWN,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_LBUTTONUP, _OnMouseMoveOrRelease);
+ HANDLE_MSG(hwnd, WM_MBUTTONDBLCLK,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_MBUTTONDOWN,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_MBUTTONUP, _OnMouseMoveOrRelease);
+ HANDLE_MSG(hwnd, WM_MOUSEMOVE, _OnMouseMoveOrRelease);
+ HANDLE_MSG(hwnd, WM_PAINT, _OnPaint);
+ HANDLE_MSG(hwnd, WM_RBUTTONDBLCLK,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_RBUTTONDOWN,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_RBUTTONUP, _OnMouseMoveOrRelease);
+#ifndef WIN16 /*<VN>*/
+ HANDLE_MSG(hwnd, WM_XBUTTONDBLCLK,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_XBUTTONDOWN,_OnMouseButtonDown);
+ HANDLE_MSG(hwnd, WM_XBUTTONUP, _OnMouseMoveOrRelease);
+#endif
+
+#ifdef FEAT_BEVAL
+ case WM_NOTIFY: Handle_WM_Notify(hwnd, (LPNMHDR)lParam);
+ return TRUE;
+#endif
+
+ default:
+ return MyWindowProc(hwnd, uMsg, wParam, lParam);
+ }
+}
+
+#if (defined(WIN3264) && defined(FEAT_MBYTE)) \
+ || defined(GLOBAL_IME) \
+ || defined(PROTO)
+# ifdef PROTO
+typedef int WINAPI;
+# endif
+
+ LRESULT WINAPI
+vim_WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+# ifdef GLOBAL_IME
+ return global_ime_DefWindowProc(hwnd, message, wParam, lParam);
+# else
+ if (wide_WindowProc)
+ return DefWindowProcW(hwnd, message, wParam, lParam);
+ return DefWindowProc(hwnd, message, wParam, lParam);
+#endif
+}
+#endif
+
+/*
+ * Called when the foreground or background color has been changed.
+ */
+ void
+gui_mch_new_colors(void)
+{
+ /* nothing to do? */
+}
+
+/*
+ * Set the colors to their default values.
+ */
+ void
+gui_mch_def_colors()
+{
+ gui.norm_pixel = GetSysColor(COLOR_WINDOWTEXT);
+ gui.back_pixel = GetSysColor(COLOR_WINDOW);
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open(void)
+{
+#ifndef SW_SHOWDEFAULT
+# define SW_SHOWDEFAULT 10 /* Borland 5.0 doesn't have it */
+#endif
+ /* Actually open the window, if not already visible
+ * (may be done already in gui_mch_set_shellsize) */
+ if (!IsWindowVisible(s_hwnd))
+ ShowWindow(s_hwnd, SW_SHOWDEFAULT);
+
+ return OK;
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(int *x, int *y)
+{
+ RECT rect;
+
+ GetWindowRect(s_hwnd, &rect);
+ *x = rect.left;
+ *y = rect.top;
+ return OK;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(int x, int y)
+{
+ SetWindowPos(s_hwnd, NULL, x, y, 0, 0,
+ SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+}
+ void
+gui_mch_set_text_area_pos(int x, int y, int w, int h)
+{
+ static int oldx = 0;
+ static int oldy = 0;
+
+ SetWindowPos(s_textArea, NULL, x, y, w, h, SWP_NOZORDER | SWP_NOACTIVATE);
+
+#ifdef FEAT_TOOLBAR
+ if (vim_strchr(p_go, GO_TOOLBAR) != NULL)
+ SendMessage(s_toolbarhwnd, WM_SIZE,
+ (WPARAM)0, (LPARAM)(w + ((long)(TOOLBAR_BUTTON_HEIGHT+8)<<16)));
+#endif
+ /* When side scroll bar is unshown, the size of window will change.
+ * then, the text area move left or right. thus client rect should be
+ * forcely redraw. (Yasuhiro Matsumoto) */
+ if (oldx != x || oldy != y)
+ {
+ InvalidateRect(s_hwnd, NULL, FALSE);
+ oldx = x;
+ oldy = y;
+ }
+
+}
+
+
+/*
+ * Scrollbar stuff:
+ */
+
+ void
+gui_mch_enable_scrollbar(
+ scrollbar_T *sb,
+ int flag)
+{
+ ShowScrollBar(sb->id, SB_CTL, flag);
+
+ /* TODO: When the window is maximized, the size of the window stays the
+ * same, thus the size of the text area changes. On Win98 it's OK, on Win
+ * NT 4.0 it's not... */
+}
+
+ void
+gui_mch_set_scrollbar_pos(
+ scrollbar_T *sb,
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ SetWindowPos(sb->id, NULL, x, y, w, h, SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);
+}
+
+ void
+gui_mch_create_scrollbar(
+ scrollbar_T *sb,
+ int orient) /* SBAR_VERT or SBAR_HORIZ */
+{
+ sb->id = CreateWindow(
+ "SCROLLBAR", "Scrollbar",
+ WS_CHILD | ((orient == SBAR_VERT) ? SBS_VERT : SBS_HORZ), 0, 0,
+ 10, /* Any value will do for now */
+ 10, /* Any value will do for now */
+ s_hwnd, NULL,
+ s_hinst, NULL);
+}
+
+/*
+ * Find the scrollbar with the given hwnd.
+ */
+ static scrollbar_T *
+gui_mswin_find_scrollbar(HWND hwnd)
+{
+ win_T *wp;
+
+ if (gui.bottom_sbar.id == hwnd)
+ return &gui.bottom_sbar;
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_scrollbars[SBAR_LEFT].id == hwnd)
+ return &wp->w_scrollbars[SBAR_LEFT];
+ if (wp->w_scrollbars[SBAR_RIGHT].id == hwnd)
+ return &wp->w_scrollbars[SBAR_RIGHT];
+ }
+ return NULL;
+}
+
+/*
+ * Get the character size of a font.
+ */
+ static void
+GetFontSize(GuiFont font)
+{
+ HWND hwnd = GetDesktopWindow();
+ HDC hdc = GetWindowDC(hwnd);
+ HFONT hfntOld = SelectFont(hdc, (HFONT)font);
+ TEXTMETRIC tm;
+
+ GetTextMetrics(hdc, &tm);
+ gui.char_width = tm.tmAveCharWidth + tm.tmOverhang;
+
+ gui.char_height = tm.tmHeight
+#ifndef MSWIN16_FASTTEXT
+ + p_linespace
+#endif
+ ;
+
+ SelectFont(hdc, hfntOld);
+
+ ReleaseDC(hwnd, hdc);
+}
+
+ int
+gui_mch_adjust_charsize(void)
+{
+ GetFontSize(gui.norm_font);
+ return OK;
+}
+
+ static GuiFont
+get_font_handle(LOGFONT *lf)
+{
+ HFONT font = NULL;
+
+ /* Load the font */
+ font = CreateFontIndirect(lf);
+
+ if (font == NULL)
+ return NOFONT;
+
+ return (GuiFont)font;
+}
+
+ static int
+pixels_to_points(int pixels, int vertical)
+{
+ int points;
+ HWND hwnd;
+ HDC hdc;
+
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+
+ points = MulDiv(pixels, 72,
+ GetDeviceCaps(hdc, vertical ? LOGPIXELSY : LOGPIXELSX));
+
+ ReleaseDC(hwnd, hdc);
+
+ return points;
+}
+
+ GuiFont
+gui_mch_get_font(
+ char_u *name,
+ int giveErrorIfMissing)
+{
+ LOGFONT lf;
+ GuiFont font;
+
+ get_logfont(&lf, name, NULL);
+ font = get_font_handle(&lf);
+ if (font == NOFONT && giveErrorIfMissing)
+ EMSG2(_(e_font), name);
+ return font;
+}
+ void
+gui_mch_free_font(GuiFont font)
+{
+ if (font)
+ DeleteObject((HFONT)font);
+}
+
+ static int
+hex_digit(int c)
+{
+ if (VIM_ISDIGIT(c))
+ return c - '0';
+ c = TOLOWER_ASC(c);
+ if (c >= 'a' && c <= 'f')
+ return c - 'a' + 10;
+ return -1000;
+}
+/*
+ * Return the Pixel value (color) for the given color name.
+ * Return INVALCOLOR for error.
+ */
+ guicolor_T
+gui_mch_get_color(char_u *name)
+{
+ typedef struct guicolor_tTable
+ {
+ char *name;
+ COLORREF color;
+ } guicolor_tTable;
+
+ static guicolor_tTable table[] =
+ {
+ {"Black", RGB(0x00, 0x00, 0x00)},
+ {"DarkGray", RGB(0x80, 0x80, 0x80)},
+ {"DarkGrey", RGB(0x80, 0x80, 0x80)},
+ {"Gray", RGB(0xC0, 0xC0, 0xC0)},
+ {"Grey", RGB(0xC0, 0xC0, 0xC0)},
+ {"LightGray", RGB(0xE0, 0xE0, 0xE0)},
+ {"LightGrey", RGB(0xE0, 0xE0, 0xE0)},
+ {"White", RGB(0xFF, 0xFF, 0xFF)},
+ {"DarkRed", RGB(0x80, 0x00, 0x00)},
+ {"Red", RGB(0xFF, 0x00, 0x00)},
+ {"LightRed", RGB(0xFF, 0xA0, 0xA0)},
+ {"DarkBlue", RGB(0x00, 0x00, 0x80)},
+ {"Blue", RGB(0x00, 0x00, 0xFF)},
+ {"LightBlue", RGB(0xA0, 0xA0, 0xFF)},
+ {"DarkGreen", RGB(0x00, 0x80, 0x00)},
+ {"Green", RGB(0x00, 0xFF, 0x00)},
+ {"LightGreen", RGB(0xA0, 0xFF, 0xA0)},
+ {"DarkCyan", RGB(0x00, 0x80, 0x80)},
+ {"Cyan", RGB(0x00, 0xFF, 0xFF)},
+ {"LightCyan", RGB(0xA0, 0xFF, 0xFF)},
+ {"DarkMagenta", RGB(0x80, 0x00, 0x80)},
+ {"Magenta", RGB(0xFF, 0x00, 0xFF)},
+ {"LightMagenta", RGB(0xFF, 0xA0, 0xFF)},
+ {"Brown", RGB(0x80, 0x40, 0x40)},
+ {"Yellow", RGB(0xFF, 0xFF, 0x00)},
+ {"LightYellow", RGB(0xFF, 0xFF, 0xA0)},
+ {"DarkYellow", RGB(0xBB, 0xBB, 0x00)},
+ {"SeaGreen", RGB(0x2E, 0x8B, 0x57)},
+ {"Orange", RGB(0xFF, 0xA5, 0x00)},
+ {"Purple", RGB(0xA0, 0x20, 0xF0)},
+ {"SlateBlue", RGB(0x6A, 0x5A, 0xCD)},
+ {"Violet", RGB(0xEE, 0x82, 0xEE)},
+ };
+
+ typedef struct SysColorTable
+ {
+ char *name;
+ int color;
+ } SysColorTable;
+
+ static SysColorTable sys_table[] =
+ {
+#ifdef WIN3264
+ {"SYS_3DDKSHADOW", COLOR_3DDKSHADOW},
+ {"SYS_3DHILIGHT", COLOR_3DHILIGHT},
+#ifndef __MINGW32__
+ {"SYS_3DHIGHLIGHT", COLOR_3DHIGHLIGHT},
+#endif
+ {"SYS_BTNHILIGHT", COLOR_BTNHILIGHT},
+ {"SYS_BTNHIGHLIGHT", COLOR_BTNHIGHLIGHT},
+ {"SYS_3DLIGHT", COLOR_3DLIGHT},
+ {"SYS_3DSHADOW", COLOR_3DSHADOW},
+ {"SYS_DESKTOP", COLOR_DESKTOP},
+ {"SYS_INFOBK", COLOR_INFOBK},
+ {"SYS_INFOTEXT", COLOR_INFOTEXT},
+ {"SYS_3DFACE", COLOR_3DFACE},
+#endif
+ {"SYS_BTNFACE", COLOR_BTNFACE},
+ {"SYS_BTNSHADOW", COLOR_BTNSHADOW},
+ {"SYS_ACTIVEBORDER", COLOR_ACTIVEBORDER},
+ {"SYS_ACTIVECAPTION", COLOR_ACTIVECAPTION},
+ {"SYS_APPWORKSPACE", COLOR_APPWORKSPACE},
+ {"SYS_BACKGROUND", COLOR_BACKGROUND},
+ {"SYS_BTNTEXT", COLOR_BTNTEXT},
+ {"SYS_CAPTIONTEXT", COLOR_CAPTIONTEXT},
+ {"SYS_GRAYTEXT", COLOR_GRAYTEXT},
+ {"SYS_HIGHLIGHT", COLOR_HIGHLIGHT},
+ {"SYS_HIGHLIGHTTEXT", COLOR_HIGHLIGHTTEXT},
+ {"SYS_INACTIVEBORDER", COLOR_INACTIVEBORDER},
+ {"SYS_INACTIVECAPTION", COLOR_INACTIVECAPTION},
+ {"SYS_INACTIVECAPTIONTEXT", COLOR_INACTIVECAPTIONTEXT},
+ {"SYS_MENU", COLOR_MENU},
+ {"SYS_MENUTEXT", COLOR_MENUTEXT},
+ {"SYS_SCROLLBAR", COLOR_SCROLLBAR},
+ {"SYS_WINDOW", COLOR_WINDOW},
+ {"SYS_WINDOWFRAME", COLOR_WINDOWFRAME},
+ {"SYS_WINDOWTEXT", COLOR_WINDOWTEXT}
+ };
+
+ int r, g, b;
+ int i;
+
+ if (name[0] == '#' && strlen(name) == 7)
+ {
+ /* Name is in "#rrggbb" format */
+ r = hex_digit(name[1]) * 16 + hex_digit(name[2]);
+ g = hex_digit(name[3]) * 16 + hex_digit(name[4]);
+ b = hex_digit(name[5]) * 16 + hex_digit(name[6]);
+ if (r < 0 || g < 0 || b < 0)
+ return INVALCOLOR;
+ return RGB(r, g, b);
+ }
+ else
+ {
+ /* Check if the name is one of the colors we know */
+ for (i = 0; i < sizeof(table) / sizeof(table[0]); i++)
+ if (STRICMP(name, table[i].name) == 0)
+ return table[i].color;
+ }
+
+ /*
+ * Try to look up a system colour.
+ */
+ for (i = 0; i < sizeof(sys_table) / sizeof(sys_table[0]); i++)
+ if (STRICMP(name, sys_table[i].name) == 0)
+ return GetSysColor(sys_table[i].color);
+
+ /*
+ * Last attempt. Look in the file "$VIMRUNTIME/rgb.txt".
+ */
+ {
+#define LINE_LEN 100
+ FILE *fd;
+ char line[LINE_LEN];
+ char_u *fname;
+
+ fname = expand_env_save((char_u *)"$VIMRUNTIME/rgb.txt");
+ if (fname == NULL)
+ return INVALCOLOR;
+
+ fd = fopen((char *)fname, "rt");
+ vim_free(fname);
+ if (fd == NULL)
+ return INVALCOLOR;
+
+ while (!feof(fd))
+ {
+ int len;
+ int pos;
+ char *color;
+
+ fgets(line, LINE_LEN, fd);
+ len = (int)STRLEN(line);
+
+ if (len <= 1 || line[len-1] != '\n')
+ continue;
+
+ line[len-1] = '\0';
+
+ i = sscanf(line, "%d %d %d %n", &r, &g, &b, &pos);
+ if (i != 3)
+ continue;
+
+ color = line + pos;
+
+ if (STRICMP(color, name) == 0)
+ {
+ fclose(fd);
+ return (guicolor_T) RGB(r, g, b);
+ }
+ }
+
+ fclose(fd);
+ }
+
+ return INVALCOLOR;
+}
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(char_u *name)
+{
+ int i;
+
+ for (i = 0; special_keys[i].vim_code1 != NUL; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return OK;
+ return FAIL;
+}
+
+ void
+gui_mch_beep(void)
+{
+ MessageBeep(MB_OK);
+}
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(
+ int r,
+ int c,
+ int nr,
+ int nc)
+{
+ RECT rc;
+
+ /*
+ * Note: InvertRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(c);
+ rc.top = FILL_Y(r);
+ rc.right = rc.left + nc * gui.char_width;
+ rc.bottom = rc.top + nr * gui.char_height;
+ InvertRect(s_hdc, &rc);
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify(void)
+{
+ ShowWindow(s_hwnd, SW_MINIMIZE);
+}
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(guicolor_T color)
+{
+ HBRUSH hbr;
+ RECT rc;
+
+ /*
+ * Note: FrameRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(gui.col);
+ rc.top = FILL_Y(gui.row);
+ rc.right = rc.left + gui.char_width;
+#ifdef FEAT_MBYTE
+ if (mb_lefthalve(gui.row, gui.col))
+ rc.right += gui.char_width;
+#endif
+ rc.bottom = rc.top + gui.char_height;
+ hbr = CreateSolidBrush(color);
+ FrameRect(s_hdc, &rc, hbr);
+ DeleteBrush(hbr);
+}
+/*
+ * Draw part of a cursor, "w" pixels wide, and "h" pixels high, using
+ * color "color".
+ */
+ void
+gui_mch_draw_part_cursor(
+ int w,
+ int h,
+ guicolor_T color)
+{
+ HBRUSH hbr;
+ RECT rc;
+
+ /*
+ * Note: FillRect() excludes right and bottom of rectangle.
+ */
+ rc.left =
+#ifdef FEAT_RIGHTLEFT
+ /* vertical line should be on the right of current point */
+ CURSOR_BAR_RIGHT ? FILL_X(gui.col + 1) - w :
+#endif
+ FILL_X(gui.col);
+ rc.top = FILL_Y(gui.row) + gui.char_height - h;
+ rc.right = rc.left + w;
+ rc.bottom = rc.top + h;
+ hbr = CreateSolidBrush(color);
+ FillRect(s_hdc, &rc, hbr);
+ DeleteBrush(hbr);
+}
+
+/*
+ * Process a single Windows message.
+ * If one is not available we hang until one is.
+ */
+ static void
+process_message(void)
+{
+ MSG msg;
+ UINT vk = 0; /* Virtual key */
+ char_u string[40];
+ int i;
+ int modifiers = 0;
+ int key;
+
+ GetMessage(&msg, NULL, 0, 0);
+
+#ifdef FEAT_OLE
+ /* Look after OLE Automation commands */
+ if (msg.message == WM_OLE)
+ {
+ char_u *str = (char_u *)msg.lParam;
+ add_to_input_buf(str, (int)STRLEN(str));
+ vim_free(str);
+ return;
+ }
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ if (msg.message == WM_NETBEANS)
+ {
+ messageFromNetbeansW32();
+ return;
+ }
+#endif
+
+#ifdef FEAT_SNIFF
+ if (sniff_request_waiting && want_sniff_request)
+ {
+ static char_u bytes[3] = {CSI, (char_u)KS_EXTRA, (char_u)KE_SNIFF};
+ add_to_input_buf(bytes, 3); /* K_SNIFF */
+ sniff_request_waiting = 0;
+ want_sniff_request = 0;
+ /* request is handled in normal.c */
+ }
+ if (msg.message == WM_USER)
+ return;
+#endif
+
+#ifdef MSWIN_FIND_REPLACE
+ /* Don't process messages used by the dialog */
+ if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg))
+ {
+ HandleMouseHide(msg.message, msg.lParam);
+ return;
+ }
+#endif
+
+ /*
+ * Check if it's a special key that we recognise. If not, call
+ * TranslateMessage().
+ */
+ if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
+ {
+ vk = (int) msg.wParam;
+ /* handle key after dead key, but ignore shift, alt and control */
+ if (dead_key && vk != VK_SHIFT && vk != VK_MENU && vk != VK_CONTROL)
+ {
+ dead_key = 0;
+ /* handle non-alphabetic keys (ones that hopefully cannot generate
+ * umlaut-characters), unless when control is down */
+ if (vk < 'A' || vk > 'Z' || (GetKeyState(VK_CONTROL) & 0x8000))
+ {
+ MSG dm;
+
+ dm.message = msg.message;
+ dm.hwnd = msg.hwnd;
+ dm.wParam = VK_SPACE;
+ MyTranslateMessage(&dm); /* generate dead character */
+ if (vk != VK_SPACE) /* and send current character once more */
+ PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
+ return;
+ }
+ }
+
+ /* Check for CTRL-BREAK */
+ if (vk == VK_CANCEL)
+ {
+ trash_input_buf();
+ got_int = TRUE;
+ string[0] = Ctrl_C;
+ add_to_input_buf(string, 1);
+ }
+
+ for (i = 0; special_keys[i].key_sym != 0; i++)
+ {
+ /* ignore VK_SPACE when ALT key pressed: system menu */
+ if (special_keys[i].key_sym == vk
+ && (vk != VK_SPACE || !(GetKeyState(VK_MENU) & 0x8000)))
+ {
+#ifdef FEAT_MENU
+ /* Check for <F10>: Windows selects the menu. Ignore it when
+ * 'winaltkeys' is "yes" or "menu" */
+ if (vk == VK_F10
+ && gui.menu_is_active
+ && (*p_wak == 'y' || *p_wak == 'm'))
+ break;
+#endif
+ if (GetKeyState(VK_SHIFT) & 0x8000)
+ modifiers |= MOD_MASK_SHIFT;
+ /*
+ * Don't use caps-lock as shift, because these are special keys
+ * being considered here, and we only want letters to get
+ * shifted -- webb
+ */
+ /*
+ if (GetKeyState(VK_CAPITAL) & 0x0001)
+ modifiers ^= MOD_MASK_SHIFT;
+ */
+ if (GetKeyState(VK_CONTROL) & 0x8000)
+ modifiers |= MOD_MASK_CTRL;
+ if (GetKeyState(VK_MENU) & 0x8000)
+ modifiers |= MOD_MASK_ALT;
+
+ if (special_keys[i].vim_code1 == NUL)
+ key = special_keys[i].vim_code0;
+ else
+ key = TO_SPECIAL(special_keys[i].vim_code0,
+ special_keys[i].vim_code1);
+ key = simplify_key(key, &modifiers);
+ if (key == CSI)
+ key = K_CSI;
+
+ if (modifiers)
+ {
+ string[0] = CSI;
+ string[1] = KS_MODIFIER;
+ string[2] = modifiers;
+ add_to_input_buf(string, 3);
+ }
+
+ if (IS_SPECIAL(key))
+ {
+ string[0] = CSI;
+ string[1] = K_SECOND(key);
+ string[2] = K_THIRD(key);
+ add_to_input_buf(string, 3);
+ }
+ else
+ {
+ int len;
+
+ /* Handle "key" as a Unicode character. */
+ len = char_to_string(key, string, 40);
+ add_to_input_buf(string, len);
+ }
+ break;
+ }
+ }
+ if (special_keys[i].key_sym == 0)
+ {
+ /* Some keys need C-S- where they should only need C-.
+ * Ignore 0xff, Windows XP sends it when NUMLOCK has changed since
+ * system startup (Helmut Stiegler, 2003 Oct 3). */
+ if (vk != 0xff
+ && (GetKeyState(VK_CONTROL) & 0x8000)
+ && !(GetKeyState(VK_SHIFT) & 0x8000)
+ && !(GetKeyState(VK_MENU) & 0x8000))
+ {
+ /* CTRL-6 is '^'; Japanese keyboard maps '^' to vk == 0xDE */
+ if (vk == '6' || MapVirtualKey(vk, 2) == (UINT)'^')
+ {
+ string[0] = Ctrl_HAT;
+ add_to_input_buf(string, 1);
+ }
+ /* vk == 0xBD AZERTY for CTRL-'-', but CTRL-[ for * QWERTY! */
+ else if (vk == 0xBD) /* QWERTY for CTRL-'-' */
+ {
+ string[0] = Ctrl__;
+ add_to_input_buf(string, 1);
+ }
+ /* CTRL-2 is '@'; Japanese keyboard maps '@' to vk == 0xC0 */
+ else if (vk == '2' || MapVirtualKey(vk, 2) == (UINT)'@')
+ {
+ string[0] = Ctrl_AT;
+ add_to_input_buf(string, 1);
+ }
+ else
+ MyTranslateMessage(&msg);
+ }
+ else
+ MyTranslateMessage(&msg);
+ }
+ }
+#ifdef FEAT_MBYTE_IME
+ else if (msg.message == WM_IME_NOTIFY)
+ _OnImeNotify(msg.hwnd, (DWORD)msg.wParam, (DWORD)msg.lParam);
+ else if (msg.message == WM_KEYUP && im_get_status())
+ /* added for non-MS IME (Yasuhiro Matsumoto) */
+ MyTranslateMessage(&msg);
+#endif
+#if !defined(FEAT_MBYTE_IME) && defined(GLOBAL_IME)
+/* GIME_TEST */
+ else if (msg.message == WM_IME_STARTCOMPOSITION)
+ {
+ POINT point;
+
+ global_ime_set_font(&norm_logfont);
+ point.x = FILL_X(gui.col);
+ point.y = FILL_Y(gui.row);
+ MapWindowPoints(s_textArea, s_hwnd, &point, 1);
+ global_ime_set_position(&point);
+ }
+#endif
+
+#ifdef FEAT_MENU
+ /* Check for <F10>: Windows selects the menu. Don't let Windows handle it
+ * when 'winaltkeys' is "no" */
+ if (vk != VK_F10 || *p_wak != 'n')
+#endif
+ DispatchMessage(&msg);
+}
+
+/*
+ * Catch up with any queued events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the event queue (& no timers pending), then we return
+ * immediately.
+ */
+ void
+gui_mch_update(void)
+{
+ MSG msg;
+
+ if (!s_busy_processing)
+ while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)
+ && !vim_is_input_buf_full())
+ process_message();
+}
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_mch_wait_for_chars(int wtime)
+{
+ MSG msg;
+ int focus;
+
+ s_timed_out = FALSE;
+
+ if (wtime > 0)
+ {
+ /* Don't do anything while processing a (scroll) message. */
+ if (s_busy_processing)
+ return FAIL;
+ s_wait_timer = (UINT)SetTimer(NULL, 0, (UINT)wtime,
+ (TIMERPROC)_OnTimer);
+ }
+
+ allow_scrollbar = TRUE;
+
+ focus = gui.in_focus;
+ while (!s_timed_out)
+ {
+ /* Stop or start blinking when focus changes */
+ if (gui.in_focus != focus)
+ {
+ if (gui.in_focus)
+ gui_mch_start_blink();
+ else
+ gui_mch_stop_blink();
+ focus = gui.in_focus;
+ }
+
+ if (s_need_activate)
+ {
+#ifdef WIN32
+ (void)SetForegroundWindow(s_hwnd);
+#else
+ (void)SetActiveWindow(s_hwnd);
+#endif
+ s_need_activate = FALSE;
+ }
+
+ /*
+ * Don't use gui_mch_update() because then we will spin-lock until a
+ * char arrives, instead we use GetMessage() to hang until an
+ * event arrives. No need to check for input_buf_full because we are
+ * returning as soon as it contains a single char -- webb
+ */
+ process_message();
+
+ if (input_available())
+ {
+ if (s_wait_timer != 0 && !s_timed_out)
+ {
+ KillTimer(NULL, s_wait_timer);
+
+ /* Eat spurious WM_TIMER messages */
+ while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE))
+ ;
+ s_wait_timer = 0;
+ }
+ allow_scrollbar = FALSE;
+ return OK;
+ }
+ }
+ allow_scrollbar = FALSE;
+ return FAIL;
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(
+ int row1,
+ int col1,
+ int row2,
+ int col2)
+{
+ RECT rc;
+
+ /*
+ * Clear one extra pixel at the far right, for when bold characters have
+ * spilled over to the window border.
+ * Note: FillRect() excludes right and bottom of rectangle.
+ */
+ rc.left = FILL_X(col1);
+ rc.top = FILL_Y(row1);
+ rc.right = FILL_X(col2 + 1) + (col2 == Columns - 1);
+ rc.bottom = FILL_Y(row2 + 1);
+ clear_rect(&rc);
+}
+
+/*
+ * Clear the whole text window.
+ */
+ void
+gui_mch_clear_all(void)
+{
+ RECT rc;
+
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = Columns * gui.char_width + 2 * gui.border_width;
+ rc.bottom = Rows * gui.char_height + 2 * gui.border_width;
+ clear_rect(&rc);
+}
+/*
+ * Menu stuff.
+ */
+
+ void
+gui_mch_enable_menu(int flag)
+{
+#ifdef FEAT_MENU
+ SetMenu(s_hwnd, flag ? s_menuBar : NULL);
+#endif
+}
+
+ void
+gui_mch_set_menu_pos(
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ /* It will be in the right place anyway */
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Make menu item hidden or not hidden
+ */
+ void
+gui_mch_menu_hidden(
+ vimmenu_T *menu,
+ int hidden)
+{
+ /*
+ * This doesn't do what we want. Hmm, just grey the menu items for now.
+ */
+ /*
+ if (hidden)
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_DISABLED);
+ else
+ EnableMenuItem(s_menuBar, menu->id, MF_BYCOMMAND | MF_ENABLED);
+ */
+ gui_mch_menu_grey(menu, hidden);
+}
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar(void)
+{
+ DrawMenuBar(s_hwnd);
+}
+#endif /*FEAT_MENU*/
+
+#ifndef PROTO
+void
+#ifdef VIMDLL
+_export
+#endif
+_cdecl
+SaveInst(HINSTANCE hInst)
+{
+ s_hinst = hInst;
+}
+#endif
+
+/*
+ * Return the RGB value of a pixel as a long.
+ */
+ long_u
+gui_mch_get_rgb(guicolor_T pixel)
+{
+ return (GetRValue(pixel) << 16) + (GetGValue(pixel) << 8)
+ + GetBValue(pixel);
+}
+
+#if defined(FEAT_GUI_DIALOG) || defined(PROTO)
+/* Convert pixels in X to dialog units */
+ static WORD
+PixelToDialogX(int numPixels)
+{
+ return (WORD)((numPixels * 4) / s_dlgfntwidth);
+}
+
+/* Convert pixels in Y to dialog units */
+ static WORD
+PixelToDialogY(int numPixels)
+{
+ return (WORD)((numPixels * 8) / s_dlgfntheight);
+}
+
+/* Return the width in pixels of the given text in the given DC. */
+ static int
+GetTextWidth(HDC hdc, char_u *str, int len)
+{
+ SIZE size;
+
+ GetTextExtentPoint(hdc, str, len, &size);
+ return size.cx;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Return the width in pixels of the given text in the given DC, taking care
+ * of 'encoding' to active codepage conversion.
+ */
+ static int
+GetTextWidthEnc(HDC hdc, char_u *str, int len)
+{
+ SIZE size;
+ WCHAR *wstr;
+ int n;
+ int wlen = len;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ /* 'encoding' differs from active codepage: convert text and use wide
+ * function */
+ wstr = enc_to_ucs2(str, &wlen);
+ if (wstr != NULL)
+ {
+ n = GetTextExtentPointW(hdc, wstr, wlen, &size);
+ vim_free(wstr);
+ if (n)
+ return size.cx;
+ }
+ }
+
+ return GetTextWidth(hdc, str, len);
+}
+#else
+# define GetTextWidthEnc(h, s, l) GetTextWidth((h), (s), (l))
+#endif
+
+/*
+ * A quick little routine that will center one window over another, handy for
+ * dialog boxes. Taken from the Win32SDK samples.
+ */
+ static BOOL
+CenterWindow(
+ HWND hwndChild,
+ HWND hwndParent)
+{
+ RECT rChild, rParent;
+ int wChild, hChild, wParent, hParent;
+ int wScreen, hScreen, xNew, yNew;
+ HDC hdc;
+
+ GetWindowRect(hwndChild, &rChild);
+ wChild = rChild.right - rChild.left;
+ hChild = rChild.bottom - rChild.top;
+
+ /* If Vim is minimized put the window in the middle of the screen. */
+ if (IsMinimized(hwndParent))
+ {
+#ifdef WIN16
+ rParent.left = 0;
+ rParent.top = 0;
+ rParent.right = GetSystemMetrics(SM_CXSCREEN);
+ rParent.bottom = GetSystemMetrics(SM_CYFULLSCREEN);
+#else
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rParent, 0);
+#endif
+ }
+ else
+ GetWindowRect(hwndParent, &rParent);
+ wParent = rParent.right - rParent.left;
+ hParent = rParent.bottom - rParent.top;
+
+ hdc = GetDC(hwndChild);
+ wScreen = GetDeviceCaps (hdc, HORZRES);
+ hScreen = GetDeviceCaps (hdc, VERTRES);
+ ReleaseDC(hwndChild, hdc);
+
+ xNew = rParent.left + ((wParent - wChild) /2);
+ if (xNew < 0)
+ {
+ xNew = 0;
+ }
+ else if ((xNew+wChild) > wScreen)
+ {
+ xNew = wScreen - wChild;
+ }
+
+ yNew = rParent.top + ((hParent - hChild) /2);
+ if (yNew < 0)
+ yNew = 0;
+ else if ((yNew+hChild) > hScreen)
+ yNew = hScreen - hChild;
+
+ return SetWindowPos(hwndChild, NULL, xNew, yNew, 0, 0,
+ SWP_NOSIZE | SWP_NOZORDER);
+}
+#endif /* FEAT_GUI_DIALOG */
+
+void
+gui_mch_activate_window(void)
+{
+ (void)SetActiveWindow(s_hwnd);
+}
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+ void
+gui_mch_show_toolbar(int showit)
+{
+ if (s_toolbarhwnd == NULL)
+ return;
+
+ if (showit)
+ ShowWindow(s_toolbarhwnd, SW_SHOW);
+ else
+ ShowWindow(s_toolbarhwnd, SW_HIDE);
+}
+
+/* Then number of bitmaps is fixed. Exit is missing! */
+#define TOOLBAR_BITMAP_COUNT 31
+
+#endif
+
+/*
+ * ":simalt" command.
+ */
+ void
+ex_simalt(exarg_T *eap)
+{
+ char_u *keys = eap->arg;
+
+ PostMessage(s_hwnd, WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)0);
+ while (*keys)
+ {
+ if (*keys == '~')
+ *keys = ' '; /* for showing system menu */
+ PostMessage(s_hwnd, WM_CHAR, (WPARAM)*keys, (LPARAM)0);
+ keys++;
+ }
+}
+
+/*
+ * Create the find & replace dialogs.
+ * You can't have both at once: ":find" when replace is showing, destroys
+ * the replace dialog first, and the other way around.
+ */
+#ifdef MSWIN_FIND_REPLACE
+ static void
+initialise_findrep(char_u *initial_string)
+{
+ int wword = FALSE;
+ int mcase = !p_ic;
+ char_u *entry_text;
+
+ /* Get the search string to use. */
+ entry_text = get_find_dialog_text(initial_string, &wword, &mcase);
+
+ s_findrep_struct.hwndOwner = s_hwnd;
+ s_findrep_struct.Flags = FR_DOWN;
+ if (mcase)
+ s_findrep_struct.Flags |= FR_MATCHCASE;
+ if (wword)
+ s_findrep_struct.Flags |= FR_WHOLEWORD;
+ if (entry_text != NULL && *entry_text != NUL)
+ {
+ STRNCPY(s_findrep_struct.lpstrFindWhat, entry_text,
+ s_findrep_struct.wFindWhatLen);
+ s_findrep_struct.lpstrFindWhat[s_findrep_struct.wFindWhatLen - 1] = NUL;
+ s_findrep_struct.lpstrReplaceWith[0] = NUL;
+ }
+ vim_free(entry_text);
+}
+#endif
+
+ void
+gui_mch_find_dialog(exarg_T *eap)
+{
+#ifdef MSWIN_FIND_REPLACE
+ if (s_findrep_msg != 0)
+ {
+ if (IsWindow(s_findrep_hwnd) && !s_findrep_is_find)
+ DestroyWindow(s_findrep_hwnd);
+
+ if (!IsWindow(s_findrep_hwnd))
+ {
+ initialise_findrep(eap->arg);
+ s_findrep_hwnd = FindText((LPFINDREPLACE) &s_findrep_struct);
+ }
+
+ (void)SetWindowText(s_findrep_hwnd,
+ (LPCSTR)_("Find string (use '\\\\' to find a '\\')"));
+ (void)SetFocus(s_findrep_hwnd);
+
+ s_findrep_is_find = TRUE;
+ }
+#endif
+}
+
+
+ void
+gui_mch_replace_dialog(exarg_T *eap)
+{
+#ifdef MSWIN_FIND_REPLACE
+ if (s_findrep_msg != 0)
+ {
+ if (IsWindow(s_findrep_hwnd) && s_findrep_is_find)
+ DestroyWindow(s_findrep_hwnd);
+
+ if (!IsWindow(s_findrep_hwnd))
+ {
+ initialise_findrep(eap->arg);
+ s_findrep_hwnd = ReplaceText((LPFINDREPLACE) &s_findrep_struct);
+ }
+
+ (void)SetWindowText(s_findrep_hwnd,
+ (LPCSTR)_("Find & Replace (use '\\\\' to find a '\\')"));
+ (void)SetFocus(s_findrep_hwnd);
+
+ s_findrep_is_find = FALSE;
+ }
+#endif
+}
+
+
+/*
+ * Set visibility of the pointer.
+ */
+ void
+gui_mch_mousehide(int hide)
+{
+ if (hide != gui.pointer_hidden)
+ {
+ ShowCursor(!hide);
+ gui.pointer_hidden = hide;
+ }
+}
+
+#ifdef FEAT_MENU
+ static void
+gui_mch_show_popupmenu_at(vimmenu_T *menu, int x, int y)
+{
+ /* Unhide the mouse, we don't get move events here. */
+ gui_mch_mousehide(FALSE);
+
+ (void)TrackPopupMenu(
+ (HMENU)menu->submenu_id,
+ TPM_LEFTALIGN | TPM_LEFTBUTTON,
+ x, y,
+ (int)0, /*reserved param*/
+ s_hwnd,
+ NULL);
+ /*
+ * NOTE: The pop-up menu can eat the mouse up event.
+ * We deal with this in normal.c.
+ */
+}
+#endif
+
+/*
+ * Got a message when the system will go down.
+ */
+ static void
+_OnEndSession(void)
+{
+ getout_preserve_modified(1);
+}
+
+/*
+ * Get this message when the user clicks on the cross in the top right corner
+ * of a Windows95 window.
+ */
+ static void
+_OnClose(
+ HWND hwnd)
+{
+ gui_shell_closed();
+}
+
+/*
+ * Get a message when the window is being destroyed.
+ */
+ static void
+_OnDestroy(
+ HWND hwnd)
+{
+#ifdef WIN16_3DLOOK
+ Ctl3dUnregister(s_hinst);
+#endif
+ if (!destroying)
+ _OnClose(hwnd);
+}
+
+ static void
+_OnPaint(
+ HWND hwnd)
+{
+ if (!IsMinimized(hwnd))
+ {
+ PAINTSTRUCT ps;
+
+ out_flush(); /* make sure all output has been processed */
+ (void)BeginPaint(hwnd, &ps);
+
+#ifdef FEAT_MBYTE
+ /* prevent multi-byte characters from misprinting on an invalid
+ * rectangle */
+ if (has_mbyte)
+ {
+ RECT rect;
+
+ GetClientRect(hwnd, &rect);
+ ps.rcPaint.left = rect.left;
+ ps.rcPaint.right = rect.right;
+ }
+#endif
+
+ if (!IsRectEmpty(&ps.rcPaint))
+ gui_redraw(ps.rcPaint.left, ps.rcPaint.top,
+ ps.rcPaint.right - ps.rcPaint.left + 1,
+ ps.rcPaint.bottom - ps.rcPaint.top + 1);
+ EndPaint(hwnd, &ps);
+ }
+}
+
+ static void
+_OnSize(
+ HWND hwnd,
+ UINT state,
+ int cx,
+ int cy)
+{
+ if (!IsMinimized(hwnd))
+ {
+ gui_resize_shell(cx, cy);
+
+#ifdef FEAT_MENU
+ /* Menu bar may wrap differently now */
+ gui_mswin_get_menu_height(TRUE);
+#endif
+ }
+}
+
+ static void
+_OnSetFocus(
+ HWND hwnd,
+ HWND hwndOldFocus)
+{
+ gui_focus_change(TRUE);
+ (void)MyWindowProc(hwnd, WM_SETFOCUS, (WPARAM)hwndOldFocus, 0);
+}
+
+ static void
+_OnKillFocus(
+ HWND hwnd,
+ HWND hwndNewFocus)
+{
+ gui_focus_change(FALSE);
+ (void)MyWindowProc(hwnd, WM_KILLFOCUS, (WPARAM)hwndNewFocus, 0);
+}
+
+/*
+ * Get a message when the user switches back to vim
+ */
+#ifdef WIN16
+ static BOOL
+#else
+ static LRESULT
+#endif
+_OnActivateApp(
+ HWND hwnd,
+ BOOL fActivate,
+#ifdef WIN16
+ HTASK dwThreadId
+#else
+ DWORD dwThreadId
+#endif
+ )
+{
+ /* we call gui_focus_change() in _OnSetFocus() */
+ /* gui_focus_change((int)fActivate); */
+ return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+gui_mch_destroy_scrollbar(scrollbar_T *sb)
+{
+ DestroyWindow(sb->id);
+}
+#endif
+
+/*
+ * Get current x mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x(void)
+{
+ RECT rct;
+ POINT mp;
+
+ (void)GetWindowRect(s_textArea, &rct);
+ (void)GetCursorPos((LPPOINT)&mp);
+ return (int)(mp.x - rct.left);
+}
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_y(void)
+{
+ RECT rct;
+ POINT mp;
+
+ (void)GetWindowRect(s_textArea, &rct);
+ (void)GetCursorPos((LPPOINT)&mp);
+ return (int)(mp.y - rct.top);
+}
+
+/*
+ * Move mouse pointer to character at (x, y).
+ */
+ void
+gui_mch_setmouse(int x, int y)
+{
+ RECT rct;
+
+ (void)GetWindowRect(s_textArea, &rct);
+ (void)SetCursorPos(x + gui.border_offset + rct.left,
+ y + gui.border_offset + rct.top);
+}
+
+ static void
+gui_mswin_get_valid_dimensions(
+ int w,
+ int h,
+ int *valid_w,
+ int *valid_h)
+{
+ int base_width, base_height;
+
+ base_width = gui_get_base_width()
+ + GetSystemMetrics(SM_CXFRAME) * 2;
+ base_height = gui_get_base_height()
+ + GetSystemMetrics(SM_CYFRAME) * 2
+ + GetSystemMetrics(SM_CYCAPTION)
+#ifdef FEAT_MENU
+ + gui_mswin_get_menu_height(FALSE)
+#endif
+ ;
+ *valid_w = base_width +
+ ((w - base_width) / gui.char_width) * gui.char_width;
+ *valid_h = base_height +
+ ((h - base_height) / gui.char_height) * gui.char_height;
+}
+
+ void
+gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
+{
+
+ *screen_w = GetSystemMetrics(SM_CXFULLSCREEN)
+ - GetSystemMetrics(SM_CXFRAME) * 2;
+ /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
+ * the menubar for MSwin, we subtract it from the screen height, so that
+ * the window size can be made to fit on the screen. */
+ *screen_h = GetSystemMetrics(SM_CYFULLSCREEN)
+ - GetSystemMetrics(SM_CYFRAME) * 2
+#ifdef FEAT_MENU
+ - gui_mswin_get_menu_height(FALSE)
+#endif
+ ;
+}
+
+ void
+gui_mch_flash(int msec)
+{
+ RECT rc;
+
+ /*
+ * Note: InvertRect() excludes right and bottom of rectangle.
+ */
+ rc.left = 0;
+ rc.top = 0;
+ rc.right = gui.num_cols * gui.char_width;
+ rc.bottom = gui.num_rows * gui.char_height;
+ InvertRect(s_hdc, &rc);
+ gui_mch_flush(); /* make sure it's displayed */
+
+ ui_delay((long)msec, TRUE); /* wait for a few msec */
+
+ InvertRect(s_hdc, &rc);
+}
+
+/*
+ * Return flags used for scrolling.
+ * The SW_INVALIDATE is required when part of the window is covered or
+ * off-screen. Refer to MS KB Q75236.
+ */
+ static int
+get_scroll_flags(void)
+{
+ HWND hwnd;
+ RECT rcVim, rcOther, rcDest;
+
+ GetWindowRect(s_hwnd, &rcVim);
+ for (hwnd = s_hwnd; (hwnd = GetWindow(hwnd, GW_HWNDPREV)) != (HWND)0; )
+ if (IsWindowVisible(hwnd))
+ {
+ GetWindowRect(hwnd, &rcOther);
+ if (IntersectRect(&rcDest, &rcVim, &rcOther))
+ return SW_INVALIDATE;
+ }
+ return 0;
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(
+ int row,
+ int num_lines)
+{
+ RECT rc;
+
+ rc.left = FILL_X(gui.scroll_region_left);
+ rc.right = FILL_X(gui.scroll_region_right + 1);
+ rc.top = FILL_Y(row);
+ rc.bottom = FILL_Y(gui.scroll_region_bot + 1);
+
+ ScrollWindowEx(s_textArea, 0, -num_lines * gui.char_height,
+ &rc, &rc, NULL, NULL, get_scroll_flags());
+
+ UpdateWindow(s_textArea);
+ /* This seems to be required to avoid the cursor disappearing when
+ * scrolling such that the cursor ends up in the top-left character on
+ * the screen... But why? (Webb) */
+ /* It's probably fixed by disabling drawing the cursor while scrolling. */
+ /* gui.cursor_is_valid = FALSE; */
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(
+ int row,
+ int num_lines)
+{
+ RECT rc;
+
+ rc.left = FILL_X(gui.scroll_region_left);
+ rc.right = FILL_X(gui.scroll_region_right + 1);
+ rc.top = FILL_Y(row);
+ rc.bottom = FILL_Y(gui.scroll_region_bot + 1);
+ /* The SW_INVALIDATE is required when part of the window is covered or
+ * off-screen. How do we avoid it when it's not needed? */
+ ScrollWindowEx(s_textArea, 0, num_lines * gui.char_height,
+ &rc, &rc, NULL, NULL, get_scroll_flags());
+
+ UpdateWindow(s_textArea);
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+}
+
+
+ void
+gui_mch_exit(int rc)
+{
+ ReleaseDC(s_textArea, s_hdc);
+ DeleteObject(s_brush);
+
+#ifdef FEAT_TEAROFF
+ /* Unload the tearoff bitmap */
+ (void)DeleteObject((HGDIOBJ)s_htearbitmap);
+#endif
+
+ /* Destroy our window (if we have one). */
+ if (s_hwnd != NULL)
+ {
+ destroying = TRUE; /* ignore WM_DESTROY message now */
+ DestroyWindow(s_hwnd);
+ }
+
+#ifdef GLOBAL_IME
+ global_ime_end();
+#endif
+}
+
+/*
+ * Initialise vim to use the font with the given name. Return FAIL if the font
+ * could not be loaded, OK otherwise.
+ */
+ int
+gui_mch_init_font(char_u *font_name, int fontset)
+{
+ LOGFONT lf;
+ GuiFont font = NOFONT;
+
+ /* Load the font */
+ if (get_logfont(&lf, font_name, NULL))
+ font = get_font_handle(&lf);
+ if (font == NOFONT)
+ return FAIL;
+ if (font_name == NULL)
+ font_name = lf.lfFaceName;
+#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
+ norm_logfont = lf;
+#endif
+#ifdef FEAT_MBYTE_IME
+ im_set_font(&lf);
+#endif
+ gui_mch_free_font(gui.norm_font);
+ gui.norm_font = font;
+ current_font_height = lf.lfHeight;
+ GetFontSize(font);
+ hl_set_font_name(lf.lfFaceName);
+
+ /* When setting 'guifont' to "*" replace it with the actual font name. */
+ if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
+ {
+ char *charset_name;
+ char_u *p;
+
+ charset_name = charset_id2name((int)lf.lfCharSet);
+ p = alloc((unsigned)(strlen(lf.lfFaceName) + 20
+ + (charset_name == NULL ? 0 : strlen(charset_name) + 2)));
+ if (p != NULL)
+ {
+ /* make a normal font string out of the lf thing:*/
+ sprintf((char *)p, "%s:h%d", lf.lfFaceName, pixels_to_points(
+ lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight, TRUE));
+ vim_free(p_guifont);
+ p_guifont = p;
+ while (*p)
+ {
+ if (*p == ' ')
+ *p = '_';
+ ++p;
+ }
+#ifndef MSWIN16_FASTTEXT
+ if (lf.lfItalic)
+ STRCAT(p, ":i");
+ if (lf.lfWeight >= FW_BOLD)
+ STRCAT(p, ":b");
+#endif
+ if (lf.lfUnderline)
+ STRCAT(p, ":u");
+ if (lf.lfStrikeOut)
+ STRCAT(p, ":s");
+ if (charset_name != NULL)
+ {
+ STRCAT(p, ":c");
+ STRCAT(p, charset_name);
+ }
+ }
+ }
+
+#ifndef MSWIN16_FASTTEXT
+ gui_mch_free_font(gui.ital_font);
+ gui.ital_font = NOFONT;
+ gui_mch_free_font(gui.bold_font);
+ gui.bold_font = NOFONT;
+ gui_mch_free_font(gui.boldital_font);
+ gui.boldital_font = NOFONT;
+
+ if (!lf.lfItalic)
+ {
+ lf.lfItalic = TRUE;
+ gui.ital_font = get_font_handle(&lf);
+ lf.lfItalic = FALSE;
+ }
+ if (lf.lfWeight < FW_BOLD)
+ {
+ lf.lfWeight = FW_BOLD;
+ gui.bold_font = get_font_handle(&lf);
+ if (!lf.lfItalic)
+ {
+ lf.lfItalic = TRUE;
+ gui.boldital_font = get_font_handle(&lf);
+ }
+ }
+#endif
+
+ return OK;
+}
+
+/*
+ * Return TRUE if the GUI window is maximized, filling the whole screen.
+ */
+ int
+gui_mch_maximized()
+{
+ return IsZoomed(s_hwnd);
+}
+
+/*
+ * Called when the font changed while the window is maximized. Compute the
+ * new Rows and Columns. This is like resizing the window.
+ */
+ void
+gui_mch_newfont()
+{
+ RECT rect;
+
+ GetWindowRect(s_hwnd, &rect);
+ gui_resize_shell(rect.right - rect.left
+ - GetSystemMetrics(SM_CXFRAME) * 2,
+ rect.bottom - rect.top
+ - GetSystemMetrics(SM_CYFRAME) * 2
+ - GetSystemMetrics(SM_CYCAPTION)
+#ifdef FEAT_MENU
+ - gui_mswin_get_menu_height(FALSE)
+#endif
+ );
+}
+
+/*
+ * Set the window title
+ */
+ void
+gui_mch_settitle(
+ char_u *title,
+ char_u *icon)
+{
+#ifdef FEAT_MBYTE
+ if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
+ {
+ WCHAR *wbuf;
+ int n;
+
+ /* Convert the title from 'encoding' to ucs2. */
+ wbuf = (WCHAR *)enc_to_ucs2(title, NULL);
+ if (wbuf != NULL)
+ {
+ n = SetWindowTextW(s_hwnd, wbuf);
+ vim_free(wbuf);
+ if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return;
+ /* Retry with non-wide function (for Windows 98). */
+ }
+ }
+#endif
+ SetWindowText(s_hwnd, (LPCSTR)(title == NULL ? "VIM" : (char *)title));
+}
+
+#ifdef FEAT_MOUSESHAPE
+/* Table for shape IDCs. Keep in sync with the mshape_names[] table in
+ * misc2.c! */
+static LPCSTR mshape_idcs[] =
+{
+ MAKEINTRESOURCE(IDC_ARROW), /* arrow */
+ MAKEINTRESOURCE(0), /* blank */
+ MAKEINTRESOURCE(IDC_IBEAM), /* beam */
+ MAKEINTRESOURCE(IDC_SIZENS), /* updown */
+ MAKEINTRESOURCE(IDC_SIZENS), /* udsizing */
+ MAKEINTRESOURCE(IDC_SIZEWE), /* leftright */
+ MAKEINTRESOURCE(IDC_SIZEWE), /* lrsizing */
+ MAKEINTRESOURCE(IDC_WAIT), /* busy */
+#ifdef WIN3264
+ MAKEINTRESOURCE(IDC_NO), /* no */
+#else
+ MAKEINTRESOURCE(IDC_ICON), /* no */
+#endif
+ MAKEINTRESOURCE(IDC_ARROW), /* crosshair */
+ MAKEINTRESOURCE(IDC_ARROW), /* hand1 */
+ MAKEINTRESOURCE(IDC_ARROW), /* hand2 */
+ MAKEINTRESOURCE(IDC_ARROW), /* pencil */
+ MAKEINTRESOURCE(IDC_ARROW), /* question */
+ MAKEINTRESOURCE(IDC_ARROW), /* right-arrow */
+ MAKEINTRESOURCE(IDC_UPARROW), /* up-arrow */
+ MAKEINTRESOURCE(IDC_ARROW) /* last one */
+};
+
+ void
+mch_set_mouse_shape(int shape)
+{
+ LPCSTR idc;
+
+ if (shape == MSHAPE_HIDE)
+ ShowCursor(FALSE);
+ else
+ {
+ if (shape >= MSHAPE_NUMBERED)
+ idc = MAKEINTRESOURCE(IDC_ARROW);
+ else
+ idc = mshape_idcs[shape];
+#ifdef _WIN64
+ SetClassLongPtr(s_textArea, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, idc));
+#else
+# ifdef WIN32
+ SetClassLong(s_textArea, GCL_HCURSOR, (LONG)LoadCursor(NULL, idc));
+# else
+ SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc));
+# endif
+#endif
+ if (!p_mh)
+ {
+ POINT mp;
+
+ /* Set the position to make it redrawn with the new shape. */
+ (void)GetCursorPos((LPPOINT)&mp);
+ (void)SetCursorPos(mp.x, mp.y);
+ ShowCursor(TRUE);
+ }
+ }
+}
+#endif
+
+#ifdef FEAT_BROWSE
+/*
+ * The file browser exists in two versions: with "W" uses wide characters,
+ * without "W" the current codepage. When FEAT_MBYTE is defined and on
+ * Windows NT/2000/XP the "W" functions are used.
+ */
+
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+/*
+ * Wide version of convert_filter(). Keep in sync!
+ */
+ static WCHAR *
+convert_filterW(char_u *s)
+{
+ WCHAR *res;
+ unsigned s_len = (unsigned)STRLEN(s);
+ unsigned i;
+
+ res = (WCHAR *)alloc((s_len + 3) * sizeof(WCHAR));
+ if (res != NULL)
+ {
+ for (i = 0; i < s_len; ++i)
+ if (s[i] == '\t' || s[i] == '\n')
+ res[i] = '\0';
+ else
+ res[i] = s[i];
+ res[s_len] = NUL;
+ /* Add two extra NULs to make sure it's properly terminated. */
+ res[s_len + 1] = NUL;
+ res[s_len + 2] = NUL;
+ }
+ return res;
+}
+
+/*
+ * Wide version of gui_mch_browse(). Keep in sync!
+ */
+ static char_u *
+gui_mch_browseW(
+ int saving,
+ char_u *title,
+ char_u *dflt,
+ char_u *ext,
+ char_u *initdir,
+ char_u *filter)
+{
+ /* We always use the wide function. This means enc_to_ucs2() must work,
+ * otherwise it fails miserably! */
+ OPENFILENAMEW fileStruct;
+ WCHAR fileBuf[MAXPATHL];
+ WCHAR *wp;
+ int i;
+ WCHAR *titlep = NULL;
+ WCHAR *extp = NULL;
+ WCHAR *initdirp = NULL;
+ WCHAR *filterp;
+ char_u *p;
+
+ if (dflt == NULL)
+ fileBuf[0] = NUL;
+ else
+ {
+ wp = enc_to_ucs2(dflt, NULL);
+ if (wp == NULL)
+ fileBuf[0] = NUL;
+ else
+ {
+ for (i = 0; wp[i] != NUL && i < MAXPATHL - 1; ++i)
+ fileBuf[i] = wp[i];
+ fileBuf[i] = NUL;
+ vim_free(wp);
+ }
+ }
+
+ /* Convert the filter to Windows format. */
+ filterp = convert_filterW(filter);
+
+ memset(&fileStruct, 0, sizeof(OPENFILENAMEW));
+#ifdef OPENFILENAME_SIZE_VERSION_400
+ /* be compatible with Windows NT 4.0 */
+ /* TODO: what to use for OPENFILENAMEW??? */
+ fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400);
+#else
+ fileStruct.lStructSize = sizeof(fileStruct);
+#endif
+
+ if (title != NULL)
+ titlep = enc_to_ucs2(title, NULL);
+ fileStruct.lpstrTitle = titlep;
+
+ if (ext != NULL)
+ extp = enc_to_ucs2(ext, NULL);
+ fileStruct.lpstrDefExt = extp;
+
+ fileStruct.lpstrFile = fileBuf;
+ fileStruct.nMaxFile = MAXPATHL;
+ fileStruct.lpstrFilter = filterp;
+ fileStruct.hwndOwner = s_hwnd; /* main Vim window is owner*/
+ /* has an initial dir been specified? */
+ if (initdir != NULL && *initdir != NUL)
+ {
+ /* Must have backslashes here, no matter what 'shellslash' says */
+ initdirp = enc_to_ucs2(initdir, NULL);
+ if (initdirp != NULL)
+ {
+ for (wp = initdirp; *wp != NUL; ++wp)
+ if (*wp == '/')
+ *wp = '\\';
+ }
+ fileStruct.lpstrInitialDir = initdirp;
+ }
+
+ /*
+ * TODO: Allow selection of multiple files. Needs another arg to this
+ * function to ask for it, and need to use OFN_ALLOWMULTISELECT below.
+ * Also, should we use OFN_FILEMUSTEXIST when opening? Vim can edit on
+ * files that don't exist yet, so I haven't put it in. What about
+ * OFN_PATHMUSTEXIST?
+ * Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
+ */
+ fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
+#ifdef FEAT_SHORTCUT
+ if (curbuf->b_p_bin)
+ fileStruct.Flags |= OFN_NODEREFERENCELINKS;
+#endif
+ if (saving)
+ {
+ if (!GetSaveFileNameW(&fileStruct))
+ return NULL;
+ }
+ else
+ {
+ if (!GetOpenFileNameW(&fileStruct))
+ return NULL;
+ }
+
+ vim_free(filterp);
+ vim_free(initdirp);
+ vim_free(titlep);
+ vim_free(extp);
+
+ /* Convert from UCS2 to 'encoding'. */
+ p = ucs2_to_enc(fileBuf, NULL);
+ if (p != NULL)
+ /* when out of memory we get garbage for non-ASCII chars */
+ STRCPY(fileBuf, p);
+ vim_free(p);
+
+ /* Give focus back to main window (when using MDI). */
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+ mch_dirname(IObuff, IOSIZE);
+ p = shorten_fname((char_u *)fileBuf, IObuff);
+ if (p == NULL)
+ p = (char_u *)fileBuf;
+ return vim_strsave(p);
+}
+# endif /* FEAT_MBYTE */
+
+
+/*
+ * Convert the string s to the proper format for a filter string by replacing
+ * the \t and \n delimeters with \0.
+ * Returns the converted string in allocated memory.
+ *
+ * Keep in sync with convert_filterW() above!
+ */
+ static char_u *
+convert_filter(char_u *s)
+{
+ char_u *res;
+ unsigned s_len = (unsigned)STRLEN(s);
+ unsigned i;
+
+ res = alloc(s_len + 3);
+ if (res != NULL)
+ {
+ for (i = 0; i < s_len; ++i)
+ if (s[i] == '\t' || s[i] == '\n')
+ res[i] = '\0';
+ else
+ res[i] = s[i];
+ res[s_len] = NUL;
+ /* Add two extra NULs to make sure it's properly terminated. */
+ res[s_len + 1] = NUL;
+ res[s_len + 2] = NUL;
+ }
+ return res;
+}
+
+/*
+ * Pop open a file browser and return the file selected, in allocated memory,
+ * or NULL if Cancel is hit.
+ * saving - TRUE if the file will be saved to, FALSE if it will be opened.
+ * title - Title message for the file browser dialog.
+ * dflt - Default name of file.
+ * ext - Default extension to be added to files without extensions.
+ * initdir - directory in which to open the browser (NULL = current dir)
+ * filter - Filter for matched files to choose from.
+ *
+ * Keep in sync with gui_mch_browseW() above!
+ */
+ char_u *
+gui_mch_browse(
+ int saving,
+ char_u *title,
+ char_u *dflt,
+ char_u *ext,
+ char_u *initdir,
+ char_u *filter)
+{
+ OPENFILENAME fileStruct;
+ char_u fileBuf[MAXPATHL];
+ char_u *initdirp = NULL;
+ char_u *filterp;
+ char_u *p;
+
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ return gui_mch_browseW(saving, title, dflt, ext, initdir, filter);
+# endif
+
+ if (dflt == NULL)
+ fileBuf[0] = NUL;
+ else
+ {
+ STRNCPY(fileBuf, dflt, MAXPATHL - 1);
+ fileBuf[MAXPATHL - 1] = NUL;
+ }
+
+ /* Convert the filter to Windows format. */
+ filterp = convert_filter(filter);
+
+ memset(&fileStruct, 0, sizeof(OPENFILENAME));
+#ifdef OPENFILENAME_SIZE_VERSION_400
+ /* be compatible with Windows NT 4.0 */
+ fileStruct.lStructSize = sizeof(OPENFILENAME_SIZE_VERSION_400);
+#else
+ fileStruct.lStructSize = sizeof(fileStruct);
+#endif
+
+ fileStruct.lpstrTitle = title;
+ fileStruct.lpstrDefExt = ext;
+
+ fileStruct.lpstrFile = fileBuf;
+ fileStruct.nMaxFile = MAXPATHL;
+ fileStruct.lpstrFilter = filterp;
+ fileStruct.hwndOwner = s_hwnd; /* main Vim window is owner*/
+ /* has an initial dir been specified? */
+ if (initdir != NULL && *initdir != NUL)
+ {
+ /* Must have backslashes here, no matter what 'shellslash' says */
+ initdirp = vim_strsave(initdir);
+ if (initdirp != NULL)
+ for (p = initdirp; *p != NUL; ++p)
+ if (*p == '/')
+ *p = '\\';
+ fileStruct.lpstrInitialDir = initdirp;
+ }
+
+ /*
+ * TODO: Allow selection of multiple files. Needs another arg to this
+ * function to ask for it, and need to use OFN_ALLOWMULTISELECT below.
+ * Also, should we use OFN_FILEMUSTEXIST when opening? Vim can edit on
+ * files that don't exist yet, so I haven't put it in. What about
+ * OFN_PATHMUSTEXIST?
+ * Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
+ */
+ fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
+#ifdef FEAT_SHORTCUT
+ if (curbuf->b_p_bin)
+ fileStruct.Flags |= OFN_NODEREFERENCELINKS;
+#endif
+ if (saving)
+ {
+ if (!GetSaveFileName(&fileStruct))
+ return NULL;
+ }
+ else
+ {
+ if (!GetOpenFileName(&fileStruct))
+ return NULL;
+ }
+
+ vim_free(filterp);
+ vim_free(initdirp);
+
+ /* Give focus back to main window (when using MDI). */
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+ mch_dirname(IObuff, IOSIZE);
+ p = shorten_fname((char_u *)fileBuf, IObuff);
+ if (p == NULL)
+ p = (char_u *)fileBuf;
+ return vim_strsave(p);
+}
+#endif /* FEAT_BROWSE */
+
+ static void
+_OnDropFiles(
+ HWND hwnd,
+ HDROP hDrop)
+{
+#ifdef FEAT_WINDOWS
+#ifdef WIN3264
+# define BUFPATHLEN _MAX_PATH
+# define DRAGQVAL 0xFFFFFFFF
+#else
+# define BUFPATHLEN MAXPATHL
+# define DRAGQVAL 0xFFFF
+#endif
+#ifdef FEAT_MBYTE
+ WCHAR wszFile[BUFPATHLEN];
+#endif
+ char szFile[BUFPATHLEN];
+ UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
+ UINT i;
+ char_u **fnames;
+ POINT pt;
+ int_u modifiers = 0;
+
+ /* TRACE("_OnDropFiles: %d files dropped\n", cFiles); */
+
+ /* Obtain dropped position */
+ DragQueryPoint(hDrop, &pt);
+ MapWindowPoints(s_hwnd, s_textArea, &pt, 1);
+
+# ifdef FEAT_VISUAL
+ reset_VIsual();
+# endif
+
+ fnames = (char_u **)alloc(cFiles * sizeof(char_u *));
+
+ if (fnames != NULL)
+ for (i = 0; i < cFiles; ++i)
+ {
+#ifdef FEAT_MBYTE
+ if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
+ fnames[i] = ucs2_to_enc(wszFile, NULL);
+ else
+#endif
+ {
+ DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
+ fnames[i] = vim_strsave(szFile);
+ }
+ }
+
+ DragFinish(hDrop);
+
+ if (fnames != NULL)
+ {
+ if ((GetKeyState(VK_SHIFT) & 0x8000) != 0)
+ modifiers |= MOUSE_SHIFT;
+ if ((GetKeyState(VK_CONTROL) & 0x8000) != 0)
+ modifiers |= MOUSE_CTRL;
+ if ((GetKeyState(VK_MENU) & 0x8000) != 0)
+ modifiers |= MOUSE_ALT;
+
+ gui_handle_drop(pt.x, pt.y, modifiers, fnames, cFiles);
+
+ s_need_activate = TRUE;
+ }
+#endif
+}
+
+ static int
+_OnScroll(
+ HWND hwnd,
+ HWND hwndCtl,
+ UINT code,
+ int pos)
+{
+ static UINT prev_code = 0; /* code of previous call */
+ scrollbar_T *sb, *sb_info;
+ long val;
+ int dragging = FALSE;
+ int dont_scroll_save = dont_scroll;
+#ifndef WIN3264
+ int nPos;
+#else
+ SCROLLINFO si;
+
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_POS;
+#endif
+
+ sb = gui_mswin_find_scrollbar(hwndCtl);
+ if (sb == NULL)
+ return 0;
+
+ if (sb->wp != NULL) /* Left or right scrollbar */
+ {
+ /*
+ * Careful: need to get scrollbar info out of first (left) scrollbar
+ * for window, but keep real scrollbar too because we must pass it to
+ * gui_drag_scrollbar().
+ */
+ sb_info = &sb->wp->w_scrollbars[0];
+ }
+ else /* Bottom scrollbar */
+ sb_info = sb;
+ val = sb_info->value;
+
+ switch (code)
+ {
+ case SB_THUMBTRACK:
+ val = pos;
+ dragging = TRUE;
+ if (sb->scroll_shift > 0)
+ val <<= sb->scroll_shift;
+ break;
+ case SB_LINEDOWN:
+ val++;
+ break;
+ case SB_LINEUP:
+ val--;
+ break;
+ case SB_PAGEDOWN:
+ val += (sb_info->size > 2 ? sb_info->size - 2 : 1);
+ break;
+ case SB_PAGEUP:
+ val -= (sb_info->size > 2 ? sb_info->size - 2 : 1);
+ break;
+ case SB_TOP:
+ val = 0;
+ break;
+ case SB_BOTTOM:
+ val = sb_info->max;
+ break;
+ case SB_ENDSCROLL:
+ if (prev_code == SB_THUMBTRACK)
+ {
+ /*
+ * "pos" only gives us 16-bit data. In case of large file,
+ * use GetScrollPos() which returns 32-bit. Unfortunately it
+ * is not valid while the scrollbar is being dragged.
+ */
+ val = GetScrollPos(hwndCtl, SB_CTL);
+ if (sb->scroll_shift > 0)
+ val <<= sb->scroll_shift;
+ }
+ break;
+
+ default:
+ /* TRACE("Unknown scrollbar event %d\n", code); */
+ return 0;
+ }
+ prev_code = code;
+
+#ifdef WIN3264
+ si.nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
+ SetScrollInfo(hwndCtl, SB_CTL, &si, TRUE);
+#else
+ nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
+ SetScrollPos(hwndCtl, SB_CTL, nPos, TRUE);
+#endif
+
+ /*
+ * When moving a vertical scrollbar, move the other vertical scrollbar too.
+ */
+ if (sb->wp != NULL)
+ {
+ scrollbar_T *sba = sb->wp->w_scrollbars;
+ HWND id = sba[ (sb == sba + SBAR_LEFT) ? SBAR_RIGHT : SBAR_LEFT].id;
+
+#ifdef WIN3264
+ SetScrollInfo(id, SB_CTL, &si, TRUE);
+#else
+ SetScrollPos(id, SB_CTL, nPos, TRUE);
+#endif
+ }
+
+ /* Don't let us be interrupted here by another message. */
+ s_busy_processing = TRUE;
+
+ /* When "allow_scrollbar" is FALSE still need to remember the new
+ * position, but don't actually scroll by setting "dont_scroll". */
+ dont_scroll = !allow_scrollbar;
+
+ gui_drag_scrollbar(sb, val, dragging);
+
+ s_busy_processing = FALSE;
+ dont_scroll = dont_scroll_save;
+
+ return 0;
+}
+
+/*
+ * Get command line arguments.
+ * Use "prog" as the name of the program and "cmdline" as the arguments.
+ * Copy the arguments to allocated memory.
+ * Return the number of arguments (including program name).
+ * Return pointers to the arguments in "argvp".
+ * Return pointer to buffer in "tofree".
+ * Returns zero when out of memory.
+ */
+ int
+get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree)
+{
+ int i;
+ char *p;
+ char *progp;
+ char *pnew = NULL;
+ char *newcmdline;
+ int inquote;
+ int argc;
+ char **argv = NULL;
+ int round;
+
+ /* Handle the program name. Remove the ".exe" extension, and find the 1st
+ * non-space. */
+ p = strrchr(prog, '.');
+ if (p != NULL)
+ *p = NUL;
+ for (progp = prog; *progp == ' '; ++progp)
+ ;
+
+ /* The command line is copied to allocated memory, so that we can change
+ * it. Add the size of the string, the separating NUL and a terminating
+ * NUL. */
+ newcmdline = malloc(STRLEN(cmdline) + STRLEN(progp) + 2);
+ if (newcmdline == NULL)
+ return 0;
+
+ /*
+ * First round: count the number of arguments ("pnew" == NULL).
+ * Second round: produce the arguments.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ /* First argument is the program name. */
+ if (pnew != NULL)
+ {
+ argv[0] = pnew;
+ strcpy(pnew, progp);
+ pnew += strlen(pnew);
+ *pnew++ = NUL;
+ }
+
+ /*
+ * Isolate each argument and put it in argv[].
+ */
+ p = cmdline;
+ argc = 1;
+ while (*p != NUL)
+ {
+ inquote = FALSE;
+ if (pnew != NULL)
+ argv[argc] = pnew;
+ ++argc;
+ while (*p != NUL && (inquote || (*p != ' ' && *p != '\t')))
+ {
+ /* Backslashes are only special when followed by a double
+ * quote. */
+ i = strspn(p, "\\");
+ if (p[i] == '"')
+ {
+ /* Halve the number of backslashes. */
+ if (i > 1 && pnew != NULL)
+ {
+ memset(pnew, '\\', i / 2);
+ pnew += i / 2;
+ }
+
+ /* Even nr of backslashes toggles quoting, uneven copies
+ * the double quote. */
+ if ((i & 1) == 0)
+ inquote = !inquote;
+ else if (pnew != NULL)
+ *pnew++ = '"';
+ p += i + 1;
+ }
+ else if (i > 0)
+ {
+ /* Copy span of backslashes unmodified. */
+ if (pnew != NULL)
+ {
+ memset(pnew, '\\', i);
+ pnew += i;
+ }
+ p += i;
+ }
+ else
+ {
+ if (pnew != NULL)
+ *pnew++ = *p;
+ ++p;
+ }
+ }
+
+ if (pnew != NUL)
+ *pnew++ = NUL;
+ while (*p == ' ' || *p == '\t')
+ ++p; /* advance until a non-space */
+ }
+
+ if (round == 1)
+ {
+ argv = (char **)malloc((argc + 1) * sizeof(char *));
+ if (argv == NULL )
+ return 0; /* malloc error */
+ pnew = newcmdline;
+ }
+ }
+
+ argv[argc] = NULL; /* NULL-terminated list */
+
+ *argvp = argv;
+ return argc;
+}
diff --git a/src/gui_x11.c b/src/gui_x11.c
new file mode 100644
index 000000000..7087e0208
--- /dev/null
+++ b/src/gui_x11.c
@@ -0,0 +1,3748 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * Common code for the Motif and Athena GUI.
+ * Not used for GTK.
+ */
+
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include <X11/StringDefs.h>
+#include <X11/Intrinsic.h>
+#include <X11/Shell.h>
+#include <X11/cursorfont.h>
+
+#include "vim.h"
+
+/*
+ * For Workshop XpmP.h is preferred, because it makes the signs drawn with a
+ * transparent background instead of black.
+ */
+#if defined(HAVE_XM_XPMP_H) && defined(FEAT_GUI_MOTIF) \
+ && (!defined(HAVE_X11_XPM_H) || defined(FEAT_SUN_WORKSHOP))
+# include <Xm/XpmP.h>
+#else
+# ifdef HAVE_X11_XPM_H
+# include <X11/xpm.h>
+# endif
+#endif
+
+#ifdef FEAT_XFONTSET
+# ifdef X_LOCALE
+# include <X11/Xlocale.h>
+# else
+# include <locale.h>
+# endif
+#endif
+
+#ifdef HAVE_X11_SUNKEYSYM_H
+# include <X11/Sunkeysym.h>
+#endif
+
+#ifdef HAVE_X11_XMU_EDITRES_H
+# include <X11/Xmu/Editres.h>
+#endif
+
+#ifdef FEAT_BEVAL_TIP
+# include "gui_beval.h"
+#endif
+
+#define VIM_NAME "vim"
+#define VIM_CLASS "Vim"
+
+/* Default resource values */
+#define DFLT_FONT "7x13"
+#ifdef FONTSET_ALWAYS
+# define DFLT_MENU_FONT XtDefaultFontSet
+#else
+# define DFLT_MENU_FONT XtDefaultFont
+#endif
+#define DFLT_TOOLTIP_FONT XtDefaultFontSet
+
+#ifdef FEAT_GUI_ATHENA
+# define DFLT_MENU_BG_COLOR "gray77"
+# define DFLT_MENU_FG_COLOR "black"
+# define DFLT_SCROLL_BG_COLOR "gray60"
+# define DFLT_SCROLL_FG_COLOR "gray77"
+# define DFLT_TOOLTIP_BG_COLOR "#ffffffff9191"
+# define DFLT_TOOLTIP_FG_COLOR "#000000000000"
+#else
+/* use the default (CDE) colors */
+# define DFLT_MENU_BG_COLOR ""
+# define DFLT_MENU_FG_COLOR ""
+# define DFLT_SCROLL_BG_COLOR ""
+# define DFLT_SCROLL_FG_COLOR ""
+# define DFLT_TOOLTIP_BG_COLOR "#ffffffff9191"
+# define DFLT_TOOLTIP_FG_COLOR "#000000000000"
+#endif
+
+Widget vimShell = (Widget)0;
+
+static Atom wm_atoms[2]; /* Window Manager Atoms */
+#define DELETE_WINDOW_IDX 0 /* index in wm_atoms[] for WM_DELETE_WINDOW */
+#define SAVE_YOURSELF_IDX 1 /* index in wm_atoms[] for WM_SAVE_YOURSELF */
+
+#ifdef FEAT_XFONTSET
+/*
+ * We either draw with a fontset (when current_fontset != NULL) or with a
+ * normal font (current_fontset == NULL, use gui.text_gc and gui.back_gc).
+ */
+static XFontSet current_fontset = NULL;
+
+#define XDrawString(dpy, win, gc, x, y, str, n) \
+ do \
+ { \
+ if (current_fontset != NULL) \
+ XmbDrawString(dpy, win, current_fontset, gc, x, y, str, n); \
+ else \
+ XDrawString(dpy, win, gc, x, y, str, n); \
+ } while (0)
+
+#define XDrawString16(dpy, win, gc, x, y, str, n) \
+ do \
+ { \
+ if (current_fontset != NULL) \
+ XwcDrawString(dpy, win, current_fontset, gc, x, y, (wchar_t *)str, n); \
+ else \
+ XDrawString16(dpy, win, gc, x, y, str, n); \
+ } while (0)
+
+static int check_fontset_sanity __ARGS((XFontSet fs));
+static int fontset_width __ARGS((XFontSet fs));
+static int fontset_ascent __ARGS((XFontSet fs));
+#endif
+
+static guicolor_T prev_fg_color = INVALCOLOR;
+static guicolor_T prev_bg_color = INVALCOLOR;
+
+#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
+static XButtonPressedEvent last_mouse_event;
+#endif
+
+static int find_closest_color __ARGS((Colormap colormap, XColor *colorPtr));
+static void gui_x11_timer_cb __ARGS((XtPointer timed_out, XtIntervalId *interval_id));
+static void gui_x11_visibility_cb __ARGS((Widget w, XtPointer dud, XEvent *event, Boolean *dum));
+static void gui_x11_expose_cb __ARGS((Widget w, XtPointer dud, XEvent *event, Boolean *dum));
+static void gui_x11_resize_window_cb __ARGS((Widget w, XtPointer dud, XEvent *event, Boolean *dum));
+static void gui_x11_focus_change_cb __ARGS((Widget w, XtPointer data, XEvent *event, Boolean *dum));
+static void gui_x11_enter_cb __ARGS((Widget w, XtPointer data, XEvent *event, Boolean *dum));
+static void gui_x11_leave_cb __ARGS((Widget w, XtPointer data, XEvent *event, Boolean *dum));
+static void gui_x11_mouse_cb __ARGS((Widget w, XtPointer data, XEvent *event, Boolean *dum));
+#ifdef FEAT_SNIFF
+static void gui_x11_sniff_request_cb __ARGS((XtPointer closure, int *source, XtInputId *id));
+#endif
+static void gui_x11_check_copy_area __ARGS((void));
+#ifdef FEAT_CLIENTSERVER
+static void gui_x11_send_event_handler __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+#endif
+static void gui_x11_wm_protocol_handler __ARGS((Widget, XtPointer, XEvent *, Boolean *));
+static void gui_x11_blink_cb __ARGS((XtPointer timed_out, XtIntervalId *interval_id));
+static Cursor gui_x11_create_blank_mouse __ARGS((void));
+
+
+/*
+ * Keycodes recognized by vim.
+ * NOTE: when changing this, the table in gui_gtk_x11.c probably needs the
+ * same change!
+ */
+static struct specialkey
+{
+ KeySym key_sym;
+ char_u vim_code0;
+ char_u vim_code1;
+} special_keys[] =
+{
+ {XK_Up, 'k', 'u'},
+ {XK_Down, 'k', 'd'},
+ {XK_Left, 'k', 'l'},
+ {XK_Right, 'k', 'r'},
+
+ {XK_F1, 'k', '1'},
+ {XK_F2, 'k', '2'},
+ {XK_F3, 'k', '3'},
+ {XK_F4, 'k', '4'},
+ {XK_F5, 'k', '5'},
+ {XK_F6, 'k', '6'},
+ {XK_F7, 'k', '7'},
+ {XK_F8, 'k', '8'},
+ {XK_F9, 'k', '9'},
+ {XK_F10, 'k', ';'},
+
+ {XK_F11, 'F', '1'},
+ {XK_F12, 'F', '2'},
+ {XK_F13, 'F', '3'},
+ {XK_F14, 'F', '4'},
+ {XK_F15, 'F', '5'},
+ {XK_F16, 'F', '6'},
+ {XK_F17, 'F', '7'},
+ {XK_F18, 'F', '8'},
+ {XK_F19, 'F', '9'},
+ {XK_F20, 'F', 'A'},
+
+ {XK_F21, 'F', 'B'},
+ {XK_F22, 'F', 'C'},
+ {XK_F23, 'F', 'D'},
+ {XK_F24, 'F', 'E'},
+ {XK_F25, 'F', 'F'},
+ {XK_F26, 'F', 'G'},
+ {XK_F27, 'F', 'H'},
+ {XK_F28, 'F', 'I'},
+ {XK_F29, 'F', 'J'},
+ {XK_F30, 'F', 'K'},
+
+ {XK_F31, 'F', 'L'},
+ {XK_F32, 'F', 'M'},
+ {XK_F33, 'F', 'N'},
+ {XK_F34, 'F', 'O'},
+ {XK_F35, 'F', 'P'}, /* keysymdef.h defines up to F35 */
+#ifdef SunXK_F36
+ {SunXK_F36, 'F', 'Q'},
+ {SunXK_F37, 'F', 'R'},
+#endif
+
+ {XK_Help, '%', '1'},
+ {XK_Undo, '&', '8'},
+ {XK_BackSpace, 'k', 'b'},
+ {XK_Insert, 'k', 'I'},
+ {XK_Delete, 'k', 'D'},
+ {XK_Home, 'k', 'h'},
+ {XK_End, '@', '7'},
+ {XK_Prior, 'k', 'P'},
+ {XK_Next, 'k', 'N'},
+ {XK_Print, '%', '9'},
+
+ /* Keypad keys: */
+#ifdef XK_KP_Left
+ {XK_KP_Left, 'k', 'l'},
+ {XK_KP_Right, 'k', 'r'},
+ {XK_KP_Up, 'k', 'u'},
+ {XK_KP_Down, 'k', 'd'},
+ {XK_KP_Insert, KS_EXTRA, (char_u)KE_KINS},
+ {XK_KP_Delete, KS_EXTRA, (char_u)KE_KDEL},
+ {XK_KP_Home, 'K', '1'},
+ {XK_KP_End, 'K', '4'},
+ {XK_KP_Prior, 'K', '3'},
+ {XK_KP_Next, 'K', '5'},
+
+ {XK_KP_Add, 'K', '6'},
+ {XK_KP_Subtract, 'K', '7'},
+ {XK_KP_Divide, 'K', '8'},
+ {XK_KP_Multiply, 'K', '9'},
+ {XK_KP_Enter, 'K', 'A'},
+ {XK_KP_Decimal, 'K', 'B'},
+
+ {XK_KP_0, 'K', 'C'},
+ {XK_KP_1, 'K', 'D'},
+ {XK_KP_2, 'K', 'E'},
+ {XK_KP_3, 'K', 'F'},
+ {XK_KP_4, 'K', 'G'},
+ {XK_KP_5, 'K', 'H'},
+ {XK_KP_6, 'K', 'I'},
+ {XK_KP_7, 'K', 'J'},
+ {XK_KP_8, 'K', 'K'},
+ {XK_KP_9, 'K', 'L'},
+#endif
+
+ /* End of list marker: */
+ {(KeySym)0, 0, 0}
+};
+
+#define XtNboldFont "boldFont"
+#define XtCBoldFont "BoldFont"
+#define XtNitalicFont "italicFont"
+#define XtCItalicFont "ItalicFont"
+#define XtNboldItalicFont "boldItalicFont"
+#define XtCBoldItalicFont "BoldItalicFont"
+#define XtNscrollbarWidth "scrollbarWidth"
+#define XtCScrollbarWidth "ScrollbarWidth"
+#define XtNmenuHeight "menuHeight"
+#define XtCMenuHeight "MenuHeight"
+#define XtNmenuFont "menuFont"
+#define XtCMenuFont "MenuFont"
+#define XtNmenuFontSet "menuFontSet"
+#define XtCMenuFontSet "MenuFontSet"
+
+
+/* Resources for setting the foreground and background colors of menus */
+#define XtNmenuBackground "menuBackground"
+#define XtCMenuBackground "MenuBackground"
+#define XtNmenuForeground "menuForeground"
+#define XtCMenuForeground "MenuForeground"
+
+/* Resources for setting the foreground and background colors of scrollbars */
+#define XtNscrollBackground "scrollBackground"
+#define XtCScrollBackground "ScrollBackground"
+#define XtNscrollForeground "scrollForeground"
+#define XtCScrollForeground "ScrollForeground"
+
+/* Resources for setting the foreground and background colors of tooltip */
+#define XtNtooltipBackground "tooltipBackground"
+#define XtCTooltipBackground "TooltipBackground"
+#define XtNtooltipForeground "tooltipForeground"
+#define XtCTooltipForeground "TooltipForeground"
+#define XtNtooltipFont "tooltipFont"
+#define XtCTooltipFont "TooltipFont"
+
+/*
+ * X Resources:
+ */
+static XtResource vim_resources[] =
+{
+ {
+ XtNforeground,
+ XtCForeground,
+ XtRPixel,
+ sizeof(Pixel),
+ XtOffsetOf(gui_T, def_norm_pixel),
+ XtRString,
+ XtDefaultForeground
+ },
+ {
+ XtNbackground,
+ XtCBackground,
+ XtRPixel,
+ sizeof(Pixel),
+ XtOffsetOf(gui_T, def_back_pixel),
+ XtRString,
+ XtDefaultBackground
+ },
+ {
+ XtNfont,
+ XtCFont,
+ XtRString,
+ sizeof(String *),
+ XtOffsetOf(gui_T, rsrc_font_name),
+ XtRImmediate,
+ XtDefaultFont
+ },
+ {
+ XtNboldFont,
+ XtCBoldFont,
+ XtRString,
+ sizeof(String *),
+ XtOffsetOf(gui_T, rsrc_bold_font_name),
+ XtRImmediate,
+ ""
+ },
+ {
+ XtNitalicFont,
+ XtCItalicFont,
+ XtRString,
+ sizeof(String *),
+ XtOffsetOf(gui_T, rsrc_ital_font_name),
+ XtRImmediate,
+ ""
+ },
+ {
+ XtNboldItalicFont,
+ XtCBoldItalicFont,
+ XtRString,
+ sizeof(String *),
+ XtOffsetOf(gui_T, rsrc_boldital_font_name),
+ XtRImmediate,
+ ""
+ },
+ {
+ XtNgeometry,
+ XtCGeometry,
+ XtRString,
+ sizeof(String *),
+ XtOffsetOf(gui_T, geom),
+ XtRImmediate,
+ ""
+ },
+ {
+ XtNreverseVideo,
+ XtCReverseVideo,
+ XtRBool,
+ sizeof(Bool),
+ XtOffsetOf(gui_T, rsrc_rev_video),
+ XtRImmediate,
+ (XtPointer)False
+ },
+ {
+ XtNborderWidth,
+ XtCBorderWidth,
+ XtRInt,
+ sizeof(int),
+ XtOffsetOf(gui_T, border_width),
+ XtRImmediate,
+ (XtPointer)2
+ },
+ {
+ XtNscrollbarWidth,
+ XtCScrollbarWidth,
+ XtRInt,
+ sizeof(int),
+ XtOffsetOf(gui_T, scrollbar_width),
+ XtRImmediate,
+ (XtPointer)SB_DEFAULT_WIDTH
+ },
+#ifdef FEAT_MENU
+# ifdef FEAT_GUI_ATHENA /* with Motif the height is always computed */
+ {
+ XtNmenuHeight,
+ XtCMenuHeight,
+ XtRInt,
+ sizeof(int),
+ XtOffsetOf(gui_T, menu_height),
+ XtRImmediate,
+ (XtPointer)MENU_DEFAULT_HEIGHT /* Should figure out at run time */
+ },
+# endif
+ {
+# ifdef FONTSET_ALWAYS
+ XtNmenuFontSet,
+ XtCMenuFontSet,
+#else
+ XtNmenuFont,
+ XtCMenuFont,
+#endif
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_menu_font_name),
+ XtRString,
+ DFLT_MENU_FONT
+ },
+#endif
+ {
+ XtNmenuForeground,
+ XtCMenuForeground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_menu_fg_name),
+ XtRString,
+ DFLT_MENU_FG_COLOR
+ },
+ {
+ XtNmenuBackground,
+ XtCMenuBackground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_menu_bg_name),
+ XtRString,
+ DFLT_MENU_BG_COLOR
+ },
+ {
+ XtNscrollForeground,
+ XtCScrollForeground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_scroll_fg_name),
+ XtRString,
+ DFLT_SCROLL_FG_COLOR
+ },
+ {
+ XtNscrollBackground,
+ XtCScrollBackground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_scroll_bg_name),
+ XtRString,
+ DFLT_SCROLL_BG_COLOR
+ },
+#ifdef FEAT_BEVAL
+ {
+ XtNtooltipForeground,
+ XtCTooltipForeground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_tooltip_fg_name),
+ XtRString,
+ DFLT_TOOLTIP_FG_COLOR
+ },
+ {
+ XtNtooltipBackground,
+ XtCTooltipBackground,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_tooltip_bg_name),
+ XtRString,
+ DFLT_TOOLTIP_BG_COLOR
+ },
+ {
+ XtNtooltipFont,
+ XtCTooltipFont,
+ XtRString,
+ sizeof(char *),
+ XtOffsetOf(gui_T, rsrc_tooltip_font_name),
+ XtRString,
+ DFLT_TOOLTIP_FONT
+ },
+ /* This one isn't really needed, keep for Sun Workshop? */
+ {
+ "balloonEvalFontSet",
+ XtCFontSet,
+ XtRFontSet,
+ sizeof(XFontSet),
+ XtOffsetOf(gui_T, tooltip_fontset),
+ XtRImmediate,
+ (XtPointer)NOFONTSET
+ },
+#endif /* FEAT_BEVAL */
+#ifdef FEAT_XIM
+ {
+ "preeditType",
+ "PreeditType",
+ XtRString,
+ sizeof(char*),
+ XtOffsetOf(gui_T, rsrc_preedit_type_name),
+ XtRString,
+ (XtPointer)"OverTheSpot,OffTheSpot,Root"
+ },
+ {
+ "inputMethod",
+ "InputMethod",
+ XtRString,
+ sizeof(char*),
+ XtOffsetOf(gui_T, rsrc_input_method),
+ XtRString,
+ NULL
+ },
+#endif /* FEAT_XIM */
+};
+
+/*
+ * This table holds all the X GUI command line options allowed. This includes
+ * the standard ones so that we can skip them when vim is started without the
+ * GUI (but the GUI might start up later).
+ * When changing this, also update doc/vim_gui.txt and the usage message!!!
+ */
+static XrmOptionDescRec cmdline_options[] =
+{
+ /* We handle these options ourselves */
+ {"-bg", ".background", XrmoptionSepArg, NULL},
+ {"-background", ".background", XrmoptionSepArg, NULL},
+ {"-fg", ".foreground", XrmoptionSepArg, NULL},
+ {"-foreground", ".foreground", XrmoptionSepArg, NULL},
+ {"-fn", ".font", XrmoptionSepArg, NULL},
+ {"-font", ".font", XrmoptionSepArg, NULL},
+ {"-boldfont", ".boldFont", XrmoptionSepArg, NULL},
+ {"-italicfont", ".italicFont", XrmoptionSepArg, NULL},
+ {"-geom", ".geometry", XrmoptionSepArg, NULL},
+ {"-geometry", ".geometry", XrmoptionSepArg, NULL},
+ {"-reverse", "*reverseVideo", XrmoptionNoArg, "True"},
+ {"-rv", "*reverseVideo", XrmoptionNoArg, "True"},
+ {"+reverse", "*reverseVideo", XrmoptionNoArg, "False"},
+ {"+rv", "*reverseVideo", XrmoptionNoArg, "False"},
+ {"-display", ".display", XrmoptionSepArg, NULL},
+ {"-iconic", "*iconic", XrmoptionNoArg, "True"},
+ {"-name", ".name", XrmoptionSepArg, NULL},
+ {"-bw", ".borderWidth", XrmoptionSepArg, NULL},
+ {"-borderwidth", ".borderWidth", XrmoptionSepArg, NULL},
+ {"-sw", ".scrollbarWidth", XrmoptionSepArg, NULL},
+ {"-scrollbarwidth", ".scrollbarWidth", XrmoptionSepArg, NULL},
+ {"-mh", ".menuHeight", XrmoptionSepArg, NULL},
+ {"-menuheight", ".menuHeight", XrmoptionSepArg, NULL},
+#ifdef FONTSET_ALWAYS
+ {"-mf", ".menuFontSet", XrmoptionSepArg, NULL},
+ {"-menufont", ".menuFontSet", XrmoptionSepArg, NULL},
+ {"-menufontset", ".menuFontSet", XrmoptionSepArg, NULL},
+#else
+ {"-mf", ".menuFont", XrmoptionSepArg, NULL},
+ {"-menufont", ".menuFont", XrmoptionSepArg, NULL},
+#endif
+ {"-xrm", NULL, XrmoptionResArg, NULL}
+};
+
+static int gui_argc = 0;
+static char **gui_argv = NULL;
+
+/*
+ * Call-back routines.
+ */
+
+/* ARGSUSED */
+ static void
+gui_x11_timer_cb(timed_out, interval_id)
+ XtPointer timed_out;
+ XtIntervalId *interval_id;
+{
+ *((int *)timed_out) = TRUE;
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_visibility_cb(w, dud, event, dum)
+ Widget w;
+ XtPointer dud;
+ XEvent *event;
+ Boolean *dum;
+{
+ if (event->type != VisibilityNotify)
+ return;
+
+ gui.visibility = event->xvisibility.state;
+
+ /*
+ * When we do an XCopyArea(), and the window is partially obscured, we want
+ * to receive an event to tell us whether it worked or not.
+ */
+ XSetGraphicsExposures(gui.dpy, gui.text_gc,
+ gui.visibility != VisibilityUnobscured);
+
+ /* This is needed for when redrawing is slow. */
+ gui_mch_update();
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_expose_cb(w, dud, event, dum)
+ Widget w;
+ XtPointer dud;
+ XEvent *event;
+ Boolean *dum;
+{
+ XExposeEvent *gevent;
+ int new_x;
+
+ if (event->type != Expose)
+ return;
+
+ out_flush(); /* make sure all output has been processed */
+
+ gevent = (XExposeEvent *)event;
+ gui_redraw(gevent->x, gevent->y, gevent->width, gevent->height);
+
+ new_x = FILL_X(0);
+
+ /* Clear the border areas if needed */
+ if (gevent->x < new_x)
+ XClearArea(gui.dpy, gui.wid, 0, 0, new_x, 0, False);
+ if (gevent->y < FILL_Y(0))
+ XClearArea(gui.dpy, gui.wid, 0, 0, 0, FILL_Y(0), False);
+ if (gevent->x > FILL_X(Columns))
+ XClearArea(gui.dpy, gui.wid, FILL_X((int)Columns), 0, 0, 0, False);
+ if (gevent->y > FILL_Y(Rows))
+ XClearArea(gui.dpy, gui.wid, 0, FILL_Y((int)Rows), 0, 0, False);
+
+ /* This is needed for when redrawing is slow. */
+ gui_mch_update();
+}
+
+#if (defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)) \
+ || defined(PROTO)
+/*
+ * This function fills in the XRectangle object with the current
+ * x,y coordinates and height, width so that an XtVaSetValues to
+ * the same shell of those resources will restore the window to its
+ * formar position and dimensions.
+ *
+ * Note: This function may fail, in which case the XRectangle will
+ * be unchanged. Be sure to have the XRectangle set with the
+ * proper values for a failed condition prior to calling this
+ * function.
+ */
+ static void
+shellRectangle(Widget shell, XRectangle *r)
+{
+ Window rootw, shellw, child, parentw;
+ int absx, absy;
+ XWindowAttributes a;
+ Window *children;
+ unsigned int childrenCount;
+
+ shellw = XtWindow(shell);
+ if (shellw == 0)
+ return;
+ for (;;)
+ {
+ XQueryTree(XtDisplay(shell), shellw, &rootw, &parentw,
+ &children, &childrenCount);
+ XFree(children);
+ if (parentw == rootw)
+ break;
+ shellw = parentw;
+ }
+ XGetWindowAttributes(XtDisplay(shell), shellw, &a);
+ XTranslateCoordinates(XtDisplay(shell), shellw, a.root, 0, 0,
+ &absx, &absy, &child);
+ r->x = absx;
+ r->y = absy;
+ XtVaGetValues(shell, XmNheight, &r->height, XmNwidth, &r->width, NULL);
+}
+#endif
+
+/* ARGSUSED */
+ static void
+gui_x11_resize_window_cb(w, dud, event, dum)
+ Widget w;
+ XtPointer dud;
+ XEvent *event;
+ Boolean *dum;
+{
+ static int lastWidth, lastHeight;
+
+ if (event->type != ConfigureNotify)
+ return;
+
+ if (event->xconfigure.width != lastWidth
+ || event->xconfigure.height != lastHeight)
+ {
+ lastWidth = event->xconfigure.width;
+ lastHeight = event->xconfigure.height;
+ gui_resize_shell(event->xconfigure.width, event->xconfigure.height
+#ifdef FEAT_XIM
+ - xim_get_status_area_height()
+#endif
+ );
+ }
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ {
+ XRectangle rec;
+
+ shellRectangle(w, &rec);
+ workshop_frame_moved(rec.x, rec.y, rec.width, rec.height);
+ }
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ XRectangle rec;
+
+ shellRectangle(w, &rec);
+ netbeans_frame_moved(rec.x, rec.y);
+ }
+#endif
+#ifdef FEAT_XIM
+ xim_set_preedit();
+#endif
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_focus_change_cb(w, data, event, dum)
+ Widget w;
+ XtPointer data;
+ XEvent *event;
+ Boolean *dum;
+{
+ gui_focus_change(event->type == FocusIn);
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_enter_cb(w, data, event, dum)
+ Widget w;
+ XtPointer data;
+ XEvent *event;
+ Boolean *dum;
+{
+ gui_focus_change(TRUE);
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_leave_cb(w, data, event, dum)
+ Widget w;
+ XtPointer data;
+ XEvent *event;
+ Boolean *dum;
+{
+ gui_focus_change(FALSE);
+}
+
+#if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
+# if X_HAVE_UTF8_STRING
+# define USE_UTF8LOOKUP
+# endif
+#endif
+
+/* ARGSUSED */
+ void
+gui_x11_key_hit_cb(w, dud, event, dum)
+ Widget w;
+ XtPointer dud;
+ XEvent *event;
+ Boolean *dum;
+{
+ XKeyPressedEvent *ev_press;
+#ifdef FEAT_XIM
+ char_u string2[256];
+ char_u string_shortbuf[256];
+ char_u *string = string_shortbuf;
+ Boolean string_alloced = False;
+ Status status;
+#else
+ char_u string[4], string2[3];
+#endif
+ KeySym key_sym, key_sym2;
+ int len, len2;
+ int i;
+ int modifiers;
+ int key;
+
+ ev_press = (XKeyPressedEvent *)event;
+
+#ifdef FEAT_XIM
+ if (xic)
+ {
+# ifdef USE_UTF8LOOKUP
+ /* XFree86 4.0.2 or newer: Be able to get UTF-8 characters even when
+ * the locale isn't utf-8. */
+ if (enc_utf8)
+ len = Xutf8LookupString(xic, ev_press, (char *)string,
+ sizeof(string_shortbuf), &key_sym, &status);
+ else
+# endif
+ len = XmbLookupString(xic, ev_press, (char *)string,
+ sizeof(string_shortbuf), &key_sym, &status);
+ if (status == XBufferOverflow)
+ {
+ string = (char_u *)XtMalloc(len + 1);
+ string_alloced = True;
+# ifdef USE_UTF8LOOKUP
+ /* XFree86 4.0.2 or newer: Be able to get UTF-8 characters even
+ * when the locale isn't utf-8. */
+ if (enc_utf8)
+ len = Xutf8LookupString(xic, ev_press, (char *)string,
+ len, &key_sym, &status);
+ else
+# endif
+ len = XmbLookupString(xic, ev_press, (char *)string,
+ len, &key_sym, &status);
+ }
+ if (status == XLookupNone || status == XLookupChars)
+ key_sym = XK_VoidSymbol;
+
+# ifdef FEAT_MBYTE
+ /* Do conversion from 'termencoding' to 'encoding'. When using
+ * Xutf8LookupString() it has already been done. */
+ if (len > 0 && input_conv.vc_type != CONV_NONE
+# ifdef USE_UTF8LOOKUP
+ && !enc_utf8
+# endif
+ )
+ {
+ int maxlen = len * 4 + 40; /* guessed */
+ char_u *p = (char_u *)XtMalloc(maxlen);
+
+ mch_memmove(p, string, len);
+ if (string_alloced)
+ XtFree((char *)string);
+ string = p;
+ string_alloced = True;
+ len = convert_input(p, len, maxlen);
+ }
+# endif
+
+ /* Translate CSI to K_CSI, otherwise it could be recognized as the
+ * start of a special key. */
+ for (i = 0; i < len; ++i)
+ if (string[i] == CSI)
+ {
+ char_u *p = (char_u *)XtMalloc(len + 3);
+
+ mch_memmove(p, string, i + 1);
+ p[i + 1] = KS_EXTRA;
+ p[i + 2] = (int)KE_CSI;
+ mch_memmove(p + i + 3, string + i + 1, len - i);
+ if (string_alloced)
+ XtFree((char *)string);
+ string = p;
+ string_alloced = True;
+ i += 2;
+ len += 2;
+ }
+ }
+ else
+#endif
+ len = XLookupString(ev_press, (char *)string, sizeof(string),
+ &key_sym, NULL);
+
+#ifdef SunXK_F36
+ /*
+ * These keys have bogus lookup strings, and trapping them here is
+ * easier than trying to XRebindKeysym() on them with every possible
+ * combination of modifiers.
+ */
+ if (key_sym == SunXK_F36 || key_sym == SunXK_F37)
+ len = 0;
+#endif
+
+#ifdef FEAT_HANGULIN
+ if ((key_sym == XK_space) && (ev_press->state & ShiftMask))
+ {
+ hangul_input_state_toggle();
+ goto theend;
+ }
+#endif
+
+ if (key_sym == XK_space)
+ string[0] = ' '; /* Otherwise Ctrl-Space doesn't work */
+
+ /*
+ * Only on some machines ^_ requires Ctrl+Shift+minus. For consistency,
+ * allow just Ctrl+minus too.
+ */
+ if (key_sym == XK_minus && (ev_press->state & ControlMask))
+ string[0] = Ctrl__;
+
+#ifdef XK_ISO_Left_Tab
+ /* why do we get XK_ISO_Left_Tab instead of XK_Tab for shift-tab? */
+ if (key_sym == XK_ISO_Left_Tab)
+ {
+ key_sym = XK_Tab;
+ string[0] = TAB;
+ len = 1;
+ }
+#endif
+
+ /* Check for Alt/Meta key (Mod1Mask), but not for a BS, DEL or character
+ * that already has the 8th bit set. And not when using a double-byte
+ * encoding, setting the 8th bit may make it the lead byte of a
+ * double-byte character. */
+ if (len == 1
+ && (ev_press->state & Mod1Mask)
+ && !(key_sym == XK_BackSpace || key_sym == XK_Delete)
+ && (string[0] & 0x80) == 0
+#ifdef FEAT_MBYTE
+ && !enc_dbcs
+#endif
+ )
+ {
+#if defined(FEAT_MENU) && defined(FEAT_GUI_MOTIF)
+ /* Ignore ALT keys when they are used for the menu only */
+ if (gui.menu_is_active
+ && (p_wak[0] == 'y'
+ || (p_wak[0] == 'm' && gui_is_menu_shortcut(string[0]))))
+ goto theend;
+#endif
+ /*
+ * Before we set the 8th bit, check to make sure the user doesn't
+ * already have a mapping defined for this sequence. We determine this
+ * by checking to see if the input would be the same without the
+ * Alt/Meta key.
+ * Don't do this for <S-M-Tab>, that should become K_S_TAB with ALT.
+ */
+ ev_press->state &= ~Mod1Mask;
+ len2 = XLookupString(ev_press, (char *)string2, sizeof(string2),
+ &key_sym2, NULL);
+ if (key_sym2 == XK_space)
+ string2[0] = ' '; /* Otherwise Meta-Ctrl-Space doesn't work */
+ if ( len2 == 1
+ && string[0] == string2[0]
+ && !(key_sym == XK_Tab && (ev_press->state & ShiftMask)))
+ {
+ string[0] |= 0x80;
+#ifdef FEAT_MBYTE
+ if (enc_utf8) /* convert to utf-8 */
+ {
+ string[1] = string[0] & 0xbf;
+ string[0] = ((unsigned)string[0] >> 6) + 0xc0;
+ if (string[1] == CSI)
+ {
+ string[2] = KS_EXTRA;
+ string[3] = (int)KE_CSI;
+ len = 4;
+ }
+ else
+ len = 2;
+ }
+#endif
+ }
+ else
+ ev_press->state |= Mod1Mask;
+ }
+
+ if (len == 1 && string[0] == CSI)
+ {
+ string[1] = KS_EXTRA;
+ string[2] = (int)KE_CSI;
+ len = -3;
+ }
+
+ /* Check for special keys. Also do this when len == 1 (key has an ASCII
+ * value) to detect backspace, delete and keypad keys. */
+ if (len == 0 || len == 1)
+ {
+ for (i = 0; special_keys[i].key_sym != (KeySym)0; i++)
+ {
+ if (special_keys[i].key_sym == key_sym)
+ {
+ string[0] = CSI;
+ string[1] = special_keys[i].vim_code0;
+ string[2] = special_keys[i].vim_code1;
+ len = -3;
+ break;
+ }
+ }
+ }
+
+ /* Unrecognised key is ignored. */
+ if (len == 0)
+ goto theend;
+
+ /* Special keys (and a few others) may have modifiers. Also when using a
+ * double-byte encoding (can't set the 8th bit). */
+ if (len == -3 || key_sym == XK_space || key_sym == XK_Tab
+ || key_sym == XK_Return || key_sym == XK_Linefeed
+ || key_sym == XK_Escape
+#ifdef FEAT_MBYTE
+ || (enc_dbcs && len == 1 && (ev_press->state & Mod1Mask))
+#endif
+ )
+ {
+ modifiers = 0;
+ if (ev_press->state & ShiftMask)
+ modifiers |= MOD_MASK_SHIFT;
+ if (ev_press->state & ControlMask)
+ modifiers |= MOD_MASK_CTRL;
+ if (ev_press->state & Mod1Mask)
+ modifiers |= MOD_MASK_ALT;
+
+ /*
+ * For some keys a shift modifier is translated into another key
+ * code.
+ */
+ if (len == -3)
+ key = TO_SPECIAL(string[1], string[2]);
+ else
+ key = string[0];
+ key = simplify_key(key, &modifiers);
+ if (key == CSI)
+ key = K_CSI;
+ if (IS_SPECIAL(key))
+ {
+ string[0] = CSI;
+ string[1] = K_SECOND(key);
+ string[2] = K_THIRD(key);
+ len = 3;
+ }
+ else
+ {
+ string[0] = key;
+ len = 1;
+ }
+
+ if (modifiers != 0)
+ {
+ string2[0] = CSI;
+ string2[1] = KS_MODIFIER;
+ string2[2] = modifiers;
+ add_to_input_buf(string2, 3);
+ }
+ }
+
+ if (len == 1 && ((string[0] == Ctrl_C && ctrl_c_interrupts)
+#ifdef UNIX
+ || (intr_char != 0 && string[0] == intr_char)
+#endif
+ ))
+ {
+ trash_input_buf();
+ got_int = TRUE;
+ }
+
+ add_to_input_buf(string, len);
+
+ /*
+ * blank out the pointer if necessary
+ */
+ if (p_mh)
+ gui_mch_mousehide(TRUE);
+
+#if defined(FEAT_BEVAL_TIP)
+ {
+ BalloonEval *be;
+
+ if ((be = gui_mch_currently_showing_beval()) != NULL)
+ gui_mch_unpost_balloon(be);
+ }
+#endif
+theend:
+ {} /* some compilers need a statement here */
+#ifdef FEAT_XIM
+ if (string_alloced)
+ XtFree((char *)string);
+#endif
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_mouse_cb(w, dud, event, dum)
+ Widget w;
+ XtPointer dud;
+ XEvent *event;
+ Boolean *dum;
+{
+ static XtIntervalId timer = (XtIntervalId)0;
+ static int timed_out = TRUE;
+
+ int button;
+ int repeated_click = FALSE;
+ int x, y;
+ int_u x_modifiers;
+ int_u vim_modifiers;
+
+ if (event->type == MotionNotify)
+ {
+ /* Get the latest position, avoids lagging behind on a drag. */
+ x = event->xmotion.x;
+ y = event->xmotion.y;
+ x_modifiers = event->xmotion.state;
+ button = (x_modifiers & (Button1Mask | Button2Mask | Button3Mask))
+ ? MOUSE_DRAG : ' ';
+
+ /*
+ * if our pointer is currently hidden, then we should show it.
+ */
+ gui_mch_mousehide(FALSE);
+
+ if (button != MOUSE_DRAG) /* just moving the rodent */
+ {
+#ifdef FEAT_MENU
+ if (dud) /* moved in vimForm */
+ y -= gui.menu_height;
+#endif
+ gui_mouse_moved(x, y);
+ return;
+ }
+ }
+ else
+ {
+ x = event->xbutton.x;
+ y = event->xbutton.y;
+ if (event->type == ButtonPress)
+ {
+ /* Handle multiple clicks */
+ if (!timed_out)
+ {
+ XtRemoveTimeOut(timer);
+ repeated_click = TRUE;
+ }
+ timed_out = FALSE;
+ timer = XtAppAddTimeOut(app_context, (long_u)p_mouset,
+ gui_x11_timer_cb, &timed_out);
+ switch (event->xbutton.button)
+ {
+ case Button1: button = MOUSE_LEFT; break;
+ case Button2: button = MOUSE_MIDDLE; break;
+ case Button3: button = MOUSE_RIGHT; break;
+ case Button4: button = MOUSE_4; break;
+ case Button5: button = MOUSE_5; break;
+ default:
+ return; /* Unknown button */
+ }
+ }
+ else if (event->type == ButtonRelease)
+ button = MOUSE_RELEASE;
+ else
+ return; /* Unknown mouse event type */
+
+ x_modifiers = event->xbutton.state;
+#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
+ last_mouse_event = event->xbutton;
+#endif
+ }
+
+ vim_modifiers = 0x0;
+ if (x_modifiers & ShiftMask)
+ vim_modifiers |= MOUSE_SHIFT;
+ if (x_modifiers & ControlMask)
+ vim_modifiers |= MOUSE_CTRL;
+ if (x_modifiers & Mod1Mask) /* Alt or Meta key */
+ vim_modifiers |= MOUSE_ALT;
+
+ gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
+}
+
+#ifdef FEAT_SNIFF
+/* ARGSUSED */
+ static void
+gui_x11_sniff_request_cb(closure, source, id)
+ XtPointer closure;
+ int *source;
+ XtInputId *id;
+{
+ static char_u bytes[3] = {CSI, (int)KS_EXTRA, (int)KE_SNIFF};
+
+ add_to_input_buf(bytes, 3);
+}
+#endif
+
+/*
+ * End of call-back routines
+ */
+
+/*
+ * Parse the GUI related command-line arguments. Any arguments used are
+ * deleted from argv, and *argc is decremented accordingly. This is called
+ * when vim is started, whether or not the GUI has been started.
+ */
+ void
+gui_mch_prepare(argc, argv)
+ int *argc;
+ char **argv;
+{
+ int arg;
+ int i;
+
+ /*
+ * Move all the entries in argv which are relevant to X into gui_argv.
+ */
+ gui_argc = 0;
+ gui_argv = (char **)lalloc((long_u)(*argc * sizeof(char *)), FALSE);
+ if (gui_argv == NULL)
+ return;
+ gui_argv[gui_argc++] = argv[0];
+ arg = 1;
+ while (arg < *argc)
+ {
+ /* Look for argv[arg] in cmdline_options[] table */
+ for (i = 0; i < XtNumber(cmdline_options); i++)
+ if (strcmp(argv[arg], cmdline_options[i].option) == 0)
+ break;
+
+ if (i < XtNumber(cmdline_options))
+ {
+ /* Remember finding "-rv" or "-reverse" */
+ if (strcmp("-rv", argv[arg]) == 0
+ || strcmp("-reverse", argv[arg]) == 0)
+ found_reverse_arg = TRUE;
+ else if ((strcmp("-fn", argv[arg]) == 0
+ || strcmp("-font", argv[arg]) == 0)
+ && arg + 1 < *argc)
+ font_argument = argv[arg + 1];
+
+ /* Found match in table, so move it into gui_argv */
+ gui_argv[gui_argc++] = argv[arg];
+ if (--*argc > arg)
+ {
+ mch_memmove(&argv[arg], &argv[arg + 1], (*argc - arg)
+ * sizeof(char *));
+ if (cmdline_options[i].argKind != XrmoptionNoArg)
+ {
+ /* Move the options argument as well */
+ gui_argv[gui_argc++] = argv[arg];
+ if (--*argc > arg)
+ mch_memmove(&argv[arg], &argv[arg + 1], (*argc - arg)
+ * sizeof(char *));
+ }
+ }
+ argv[*argc] = NULL;
+ }
+ else
+#ifdef FEAT_SUN_WORKSHOP
+ if (strcmp("-ws", argv[arg]) == 0)
+ {
+ usingSunWorkShop++;
+ p_acd = TRUE;
+ gui.dofork = FALSE; /* don't fork() when starting GUI */
+ mch_memmove(&argv[arg], &argv[arg + 1],
+ (--*argc - arg) * sizeof(char *));
+ argv[*argc] = NULL;
+# ifdef WSDEBUG
+ wsdebug_wait(WT_ENV | WT_WAIT | WT_STOP, "SPRO_GVIM_WAIT", 20);
+ wsdebug_log_init("SPRO_GVIM_DEBUG", "SPRO_GVIM_DLEVEL");
+# endif
+ }
+ else
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (strncmp("-nb", argv[arg], 3) == 0)
+ {
+ usingNetbeans++;
+ gui.dofork = FALSE; /* don't fork() when starting GUI */
+ netbeansArg = argv[arg];
+ mch_memmove(&argv[arg], &argv[arg + 1],
+ (--*argc - arg) * sizeof(char *));
+ argv[*argc] = NULL;
+ }
+ else
+#endif
+ arg++;
+ }
+}
+
+#ifndef XtSpecificationRelease
+# define CARDINAL (Cardinal *)
+#else
+# if XtSpecificationRelease == 4
+# define CARDINAL (Cardinal *)
+# else
+# define CARDINAL (int *)
+# endif
+#endif
+
+/*
+ * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+gui_mch_init_check()
+{
+#ifdef FEAT_XIM
+ XtSetLanguageProc(NULL, NULL, NULL);
+#endif
+ open_app_context();
+ if (app_context != NULL)
+ gui.dpy = XtOpenDisplay(app_context, 0, VIM_NAME, VIM_CLASS,
+ cmdline_options, XtNumber(cmdline_options),
+ CARDINAL &gui_argc, gui_argv);
+
+ if (app_context == NULL || gui.dpy == NULL)
+ {
+ gui.dying = TRUE;
+ EMSG(_(e_opendisp));
+ return FAIL;
+ }
+ return OK;
+}
+
+
+#ifdef USE_XSMP
+/*
+ * Handle XSMP processing, de-registering the attachment upon error
+ */
+static XtInputId _xsmp_xtinputid;
+
+static void local_xsmp_handle_requests __ARGS((XtPointer c, int *s, XtInputId *i));
+
+/*ARGSUSED*/
+ static void
+local_xsmp_handle_requests(c, s, i)
+ XtPointer c;
+ int *s;
+ XtInputId *i;
+{
+ if (xsmp_handle_requests() == FAIL)
+ XtRemoveInput(_xsmp_xtinputid);
+}
+#endif
+
+
+/*
+ * Initialise the X GUI. Create all the windows, set up all the call-backs etc.
+ * Returns OK for success, FAIL when the GUI can't be started.
+ */
+ int
+gui_mch_init()
+{
+ XtGCMask gc_mask;
+ XGCValues gc_vals;
+ int x, y, mask;
+ unsigned w, h;
+
+#if 0
+ /* Uncomment this to enable synchronous mode for debugging */
+ XSynchronize(gui.dpy, True);
+#endif
+
+ vimShell = XtVaAppCreateShell(VIM_NAME, VIM_CLASS,
+ applicationShellWidgetClass, gui.dpy, NULL);
+
+ /*
+ * Get the application resources
+ */
+ XtVaGetApplicationResources(vimShell, (XtPointer)&gui,
+ vim_resources, XtNumber(vim_resources), NULL);
+
+ gui.scrollbar_height = gui.scrollbar_width;
+
+ /*
+ * Get the colors ourselves. Using the automatic conversion doesn't
+ * handle looking for approximate colors.
+ */
+ /* NOTE: These next few lines are an exact duplicate of gui_athena.c's
+ * gui_mch_def_colors(). Why?
+ */
+ gui.menu_fg_pixel = gui_get_color((char_u *)gui.rsrc_menu_fg_name);
+ gui.menu_bg_pixel = gui_get_color((char_u *)gui.rsrc_menu_bg_name);
+ gui.scroll_fg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_fg_name);
+ gui.scroll_bg_pixel = gui_get_color((char_u *)gui.rsrc_scroll_bg_name);
+#ifdef FEAT_BEVAL
+ gui.tooltip_fg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_fg_name);
+ gui.tooltip_bg_pixel = gui_get_color((char_u *)gui.rsrc_tooltip_bg_name);
+#endif
+
+#if defined(FEAT_MENU) && defined(FEAT_GUI_ATHENA)
+ /* If the menu height was set, don't change it at runtime */
+ if (gui.menu_height != MENU_DEFAULT_HEIGHT)
+ gui.menu_height_fixed = TRUE;
+#endif
+
+ /* Set default foreground and background colours */
+ gui.norm_pixel = gui.def_norm_pixel;
+ gui.back_pixel = gui.def_back_pixel;
+
+ /* Check if reverse video needs to be applied (on Sun it's done by X) */
+ if (gui.rsrc_rev_video && gui_get_lightness(gui.back_pixel)
+ > gui_get_lightness(gui.norm_pixel))
+ {
+ gui.norm_pixel = gui.def_back_pixel;
+ gui.back_pixel = gui.def_norm_pixel;
+ gui.def_norm_pixel = gui.norm_pixel;
+ gui.def_back_pixel = gui.back_pixel;
+ }
+
+ /* Get the colors from the "Normal", "Tooltip", "Scrollbar" and "Menu"
+ * group (set in syntax.c or in a vimrc file) */
+ set_normal_colors();
+
+ /*
+ * Check that none of the colors are the same as the background color
+ */
+ gui_check_colors();
+
+ /*
+ * Set up the GCs. The font attributes will be set in gui_init_font().
+ */
+ gc_mask = GCForeground | GCBackground;
+ gc_vals.foreground = gui.norm_pixel;
+ gc_vals.background = gui.back_pixel;
+ gui.text_gc = XtGetGC(vimShell, gc_mask, &gc_vals);
+
+ gc_vals.foreground = gui.back_pixel;
+ gc_vals.background = gui.norm_pixel;
+ gui.back_gc = XtGetGC(vimShell, gc_mask, &gc_vals);
+
+ gc_mask |= GCFunction;
+ gc_vals.foreground = gui.norm_pixel ^ gui.back_pixel;
+ gc_vals.background = gui.norm_pixel ^ gui.back_pixel;
+ gc_vals.function = GXxor;
+ gui.invert_gc = XtGetGC(vimShell, gc_mask, &gc_vals);
+
+ gui.visibility = VisibilityUnobscured;
+ x11_setup_atoms(gui.dpy);
+
+ if (gui_win_x != -1 && gui_win_y != -1)
+ gui_mch_set_winpos(gui_win_x, gui_win_y);
+
+ /* Now adapt the supplied(?) geometry-settings */
+ /* Added by Kjetil Jacobsen <kjetilja@stud.cs.uit.no> */
+ if (gui.geom != NULL && *gui.geom != NUL)
+ {
+ mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h);
+ if (mask & WidthValue)
+ Columns = w;
+ if (mask & HeightValue)
+ Rows = h;
+ /*
+ * Set the (x,y) position of the main window only if specified in the
+ * users geometry, so we get good defaults when they don't. This needs
+ * to be done before the shell is popped up.
+ */
+ if (mask & (XValue|YValue))
+ XtVaSetValues(vimShell, XtNgeometry, gui.geom, NULL);
+ }
+
+ gui_x11_create_widgets();
+
+ /*
+ * Add an icon to Vim (Marcel Douben: 11 May 1998).
+ */
+ if (vim_strchr(p_go, GO_ICON) != NULL)
+ {
+#ifndef HAVE_XPM
+# include "vim_icon.xbm"
+# include "vim_mask.xbm"
+
+ Arg arg[2];
+
+ XtSetArg(arg[0], XtNiconPixmap,
+ XCreateBitmapFromData(gui.dpy,
+ DefaultRootWindow(gui.dpy),
+ (char *)vim_icon_bits,
+ vim_icon_width,
+ vim_icon_height));
+ XtSetArg(arg[1], XtNiconMask,
+ XCreateBitmapFromData(gui.dpy,
+ DefaultRootWindow(gui.dpy),
+ (char *)vim_mask_icon_bits,
+ vim_mask_icon_width,
+ vim_mask_icon_height));
+ XtSetValues(vimShell, arg, (Cardinal)2);
+#else
+/* Use Pixmaps, looking much nicer. */
+
+/* If you get an error message here, you still need to unpack the runtime
+ * archive! */
+# ifdef magick
+# undef magick
+# endif
+# define magick vim32x32
+# include "../runtime/vim32x32.xpm"
+# undef magick
+# define magick vim16x16
+# include "../runtime/vim16x16.xpm"
+# undef magick
+# define magick vim48x48
+# include "../runtime/vim48x48.xpm"
+# undef magick
+
+ static Pixmap icon = 0;
+ static Pixmap icon_mask = 0;
+ static char **magick = vim32x32;
+ Window root_window;
+ XIconSize *size;
+ int number_sizes;
+ Display *dsp;
+ Screen *scr;
+ XpmAttributes attr;
+ Colormap cmap;
+
+ /*
+ * Adjust the icon to the preferences of the actual window manager.
+ */
+ root_window = XRootWindowOfScreen(XtScreen(vimShell));
+ if (XGetIconSizes(XtDisplay(vimShell), root_window,
+ &size, &number_sizes) != 0)
+ {
+
+ if (number_sizes > 0)
+ {
+ if (size->max_height >= 48 && size->max_height >= 48)
+ magick = vim48x48;
+ else if (size->max_height >= 32 && size->max_height >= 32)
+ magick = vim32x32;
+ else if (size->max_height >= 16 && size->max_height >= 16)
+ magick = vim16x16;
+ }
+ }
+
+ dsp = XtDisplay(vimShell);
+ scr = XtScreen(vimShell);
+
+ cmap = DefaultColormap(dsp, DefaultScreen(dsp));
+ XtVaSetValues(vimShell, XtNcolormap, cmap, NULL);
+
+ attr.valuemask = 0L;
+ attr.valuemask = XpmCloseness | XpmReturnPixels | XpmColormap | XpmDepth;
+ attr.closeness = 65535; /* accuracy isn't crucial */
+ attr.colormap = cmap;
+ attr.depth = DefaultDepthOfScreen(scr);
+
+ if (!icon)
+ XpmCreatePixmapFromData(dsp, root_window, magick, &icon,
+ &icon_mask, &attr);
+
+# ifdef FEAT_GUI_ATHENA
+ XtVaSetValues(vimShell, XtNiconPixmap, icon, XtNiconMask, icon_mask, NULL);
+# else
+ XtVaSetValues(vimShell, XmNiconPixmap, icon, XmNiconMask, icon_mask, NULL);
+# endif
+#endif
+ }
+
+ if (gui.color_approx)
+ EMSG(_("Vim E458: Cannot allocate colormap entry, some colors may be incorrect"));
+
+#ifdef FEAT_SUN_WORKSHOP
+ if (usingSunWorkShop)
+ workshop_connect(app_context);
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_Xt_connect(app_context);
+#endif
+
+#ifdef FEAT_BEVAL
+ gui_init_tooltip_font();
+#endif
+#ifdef FEAT_MENU
+ gui_init_menu_font();
+#endif
+
+#ifdef USE_XSMP
+ /* Attach listener on ICE connection */
+ if (-1 != xsmp_icefd)
+ _xsmp_xtinputid = XtAppAddInput(app_context, xsmp_icefd,
+ (XtPointer)XtInputReadMask, local_xsmp_handle_requests, NULL);
+#endif
+
+ return OK;
+}
+
+/*
+ * Called when starting the GUI fails after calling gui_mch_init().
+ */
+ void
+gui_mch_uninit()
+{
+ gui_x11_destroy_widgets();
+#ifndef LESSTIF_VERSION
+ XtCloseDisplay(gui.dpy);
+#endif
+ gui.dpy = NULL;
+ vimShell = (Widget)0;
+}
+
+/*
+ * Called when the foreground or background color has been changed.
+ */
+ void
+gui_mch_new_colors()
+{
+ long_u gc_mask;
+ XGCValues gc_vals;
+
+ gc_mask = GCForeground | GCBackground;
+ gc_vals.foreground = gui.norm_pixel;
+ gc_vals.background = gui.back_pixel;
+ if (gui.text_gc != NULL)
+ XChangeGC(gui.dpy, gui.text_gc, gc_mask, &gc_vals);
+
+ gc_vals.foreground = gui.back_pixel;
+ gc_vals.background = gui.norm_pixel;
+ if (gui.back_gc != NULL)
+ XChangeGC(gui.dpy, gui.back_gc, gc_mask, &gc_vals);
+
+ gc_mask |= GCFunction;
+ gc_vals.foreground = gui.norm_pixel ^ gui.back_pixel;
+ gc_vals.background = gui.norm_pixel ^ gui.back_pixel;
+ gc_vals.function = GXxor;
+ if (gui.invert_gc != NULL)
+ XChangeGC(gui.dpy, gui.invert_gc, gc_mask, &gc_vals);
+
+ gui_x11_set_back_color();
+}
+
+/*
+ * Open the GUI window which was created by a call to gui_mch_init().
+ */
+ int
+gui_mch_open()
+{
+ /* Actually open the window */
+ XtPopup(vimShell, XtGrabNone);
+
+ gui.wid = gui_x11_get_wid();
+ gui.blank_pointer = gui_x11_create_blank_mouse();
+
+ /*
+ * Add a callback for the Close item on the window managers menu, and the
+ * save-yourself event.
+ */
+ wm_atoms[SAVE_YOURSELF_IDX] =
+ XInternAtom(gui.dpy, "WM_SAVE_YOURSELF", False);
+ wm_atoms[DELETE_WINDOW_IDX] =
+ XInternAtom(gui.dpy, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(gui.dpy, XtWindow(vimShell), wm_atoms, 2);
+ XtAddEventHandler(vimShell, NoEventMask, True, gui_x11_wm_protocol_handler,
+ NULL);
+#ifdef HAVE_X11_XMU_EDITRES_H
+ /*
+ * Enable editres protocol (see "man editres").
+ * Usually will need to add -lXmu to the linker line as well.
+ */
+ XtAddEventHandler(vimShell, (EventMask)0, True, _XEditResCheckMessages,
+ (XtPointer)NULL);
+#endif
+
+#ifdef FEAT_CLIENTSERVER
+ if (serverName == NULL && serverDelayedStartName != NULL)
+ {
+ /* This is a :gui command in a plain vim with no previous server */
+ commWindow = XtWindow(vimShell);
+ (void)serverRegisterName(gui.dpy, serverDelayedStartName);
+ }
+ else
+ {
+ /*
+ * Cannot handle "widget-less" windows with XtProcessEvent() we'll
+ * have to change the "server" registration to that of the main window
+ * If we have not registered a name yet, remember the window
+ */
+ serverChangeRegisteredWindow(gui.dpy, XtWindow(vimShell));
+ }
+ XtAddEventHandler(vimShell, PropertyChangeMask, False,
+ gui_x11_send_event_handler, NULL);
+#endif
+
+
+#if defined(FEAT_MENU) && defined(FEAT_GUI_ATHENA)
+ /* The Athena GUI needs this again after opening the window */
+ gui_position_menu();
+# ifdef FEAT_TOOLBAR
+ gui_mch_set_toolbar_pos(0, gui.menu_height, gui.menu_width,
+ gui.toolbar_height);
+# endif
+#endif
+
+ /* Get the colors for the highlight groups (gui_check_colors() might have
+ * changed them) */
+ highlight_gui_started(); /* re-init colors and fonts */
+
+#ifdef FEAT_HANGULIN
+ hangul_keyboard_set();
+#endif
+#ifdef FEAT_XIM
+ xim_init();
+#endif
+#ifdef FEAT_SUN_WORKSHOP
+ workshop_postinit();
+#endif
+
+ return OK;
+}
+
+#if defined(FEAT_BEVAL) || defined(PROTO)
+/*
+ * Convert the tooltip fontset name to an XFontSet.
+ */
+ void
+gui_init_tooltip_font()
+{
+ XrmValue from, to;
+
+ from.addr = (char *)gui.rsrc_tooltip_font_name;
+ from.size = strlen(from.addr);
+ to.addr = (XtPointer)&gui.tooltip_fontset;
+ to.size = sizeof(XFontSet);
+
+ if (XtConvertAndStore(vimShell, XtRString, &from, XtRFontSet, &to) == False)
+ {
+ /* Failed. What to do? */
+ }
+}
+#endif
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/* Convert the menu font/fontset name to an XFontStruct/XFontset */
+ void
+gui_init_menu_font()
+{
+ XrmValue from, to;
+
+#ifdef FONTSET_ALWAYS
+ from.addr = (char *)gui.rsrc_menu_font_name;
+ from.size = strlen(from.addr);
+ to.addr = (XtPointer)&gui.menu_fontset;
+ to.size = sizeof(GuiFontset);
+
+ if (XtConvertAndStore(vimShell, XtRString, &from, XtRFontSet, &to) == False)
+ {
+ /* Failed. What to do? */
+ }
+#else
+ from.addr = (char *)gui.rsrc_menu_font_name;
+ from.size = strlen(from.addr);
+ to.addr = (XtPointer)&gui.menu_font;
+ to.size = sizeof(GuiFont);
+
+ if (XtConvertAndStore(vimShell, XtRString, &from, XtRFontStruct, &to) == False)
+ {
+ /* Failed. What to do? */
+ }
+#endif
+}
+#endif
+
+/*ARGSUSED*/
+ void
+gui_mch_exit(rc)
+ int rc;
+{
+#if 0
+ /* Lesstif gives an error message here, and so does Solaris. The man page
+ * says that this isn't needed when exiting, so just skip it. */
+ XtCloseDisplay(gui.dpy);
+#endif
+}
+
+/*
+ * Get the position of the top left corner of the window.
+ */
+ int
+gui_mch_get_winpos(x, y)
+ int *x, *y;
+{
+ Dimension xpos, ypos;
+
+ XtVaGetValues(vimShell,
+ XtNx, &xpos,
+ XtNy, &ypos,
+ NULL);
+ *x = xpos;
+ *y = ypos;
+ return OK;
+}
+
+/*
+ * Set the position of the top left corner of the window to the given
+ * coordinates.
+ */
+ void
+gui_mch_set_winpos(x, y)
+ int x, y;
+{
+ XtVaSetValues(vimShell,
+ XtNx, x,
+ XtNy, y,
+ NULL);
+}
+
+ void
+gui_mch_set_shellsize(width, height, min_width, min_height,
+ base_width, base_height)
+ int width;
+ int height;
+ int min_width;
+ int min_height;
+ int base_width;
+ int base_height;
+{
+ XtVaSetValues(vimShell,
+ XtNwidthInc, gui.char_width,
+ XtNheightInc, gui.char_height,
+#if defined(XtSpecificationRelease) && XtSpecificationRelease >= 4
+ XtNbaseWidth, base_width,
+ XtNbaseHeight, base_height,
+#endif
+ XtNminWidth, min_width,
+ XtNminHeight, min_height,
+ XtNwidth, width,
+#ifdef FEAT_XIM
+ XtNheight, height + xim_get_status_area_height(),
+#else
+ XtNheight, height,
+#endif
+ NULL);
+}
+
+/*
+ * Allow 10 pixels for horizontal borders, 30 for vertical borders.
+ * Is there no way in X to find out how wide the borders really are?
+ */
+ void
+gui_mch_get_screen_dimensions(screen_w, screen_h)
+ int *screen_w;
+ int *screen_h;
+{
+ *screen_w = DisplayWidth(gui.dpy, DefaultScreen(gui.dpy)) - 10;
+ *screen_h = DisplayHeight(gui.dpy, DefaultScreen(gui.dpy)) - p_ghr;
+}
+
+/*
+ * Initialise vim to use the font "font_name". If it's NULL, pick a default
+ * font.
+ * If "fontset" is TRUE, load the "font_name" as a fontset.
+ * Return FAIL if the font could not be loaded, OK otherwise.
+ */
+/*ARGSUSED*/
+ int
+gui_mch_init_font(font_name, do_fontset)
+ char_u *font_name;
+ int do_fontset;
+{
+ XFontStruct *font = NULL;
+
+#ifdef FEAT_XFONTSET
+ XFontSet fontset = NULL;
+
+ if (do_fontset)
+ {
+ /* If 'guifontset' is set, VIM treats all font specifications as if
+ * they were fontsets, and 'guifontset' becomes the default. */
+ if (font_name != NULL)
+ {
+ fontset = (XFontSet)gui_mch_get_fontset(font_name, FALSE, TRUE);
+ if (fontset == NULL)
+ return FAIL;
+ }
+ }
+ else
+#endif
+ {
+ if (font_name == NULL)
+ {
+ /*
+ * If none of the fonts in 'font' could be loaded, try the one set
+ * in the X resource, and finally just try using DFLT_FONT, which
+ * will hopefully always be there.
+ */
+ font_name = gui.rsrc_font_name;
+ font = (XFontStruct *)gui_mch_get_font(font_name, FALSE);
+ if (font == NULL)
+ font_name = (char_u *)DFLT_FONT;
+ }
+ if (font == NULL)
+ font = (XFontStruct *)gui_mch_get_font(font_name, FALSE);
+ if (font == NULL)
+ return FAIL;
+ }
+
+ gui_mch_free_font(gui.norm_font);
+#ifdef FEAT_XFONTSET
+ gui_mch_free_fontset(gui.fontset);
+
+ if (fontset != NULL)
+ {
+ gui.norm_font = NOFONT;
+ gui.fontset = (GuiFontset)fontset;
+ gui.char_width = fontset_width(fontset);
+ gui.char_height = fontset_height(fontset) + p_linespace;
+ gui.char_ascent = fontset_ascent(fontset) + p_linespace / 2;
+ }
+ else
+#endif
+ {
+ gui.norm_font = (GuiFont)font;
+#ifdef FEAT_XFONTSET
+ gui.fontset = NOFONTSET;
+#endif
+ gui.char_width = font->max_bounds.width;
+ gui.char_height = font->ascent + font->descent + p_linespace;
+ gui.char_ascent = font->ascent + p_linespace / 2;
+ }
+
+ hl_set_font_name(font_name);
+
+ /*
+ * Try to load other fonts for bold, italic, and bold-italic.
+ * We should also try to work out what font to use for these when they are
+ * not specified by X resources, but we don't yet.
+ */
+ if (font_name == gui.rsrc_font_name)
+ {
+ if (gui.bold_font == NOFONT
+ && gui.rsrc_bold_font_name != NULL
+ && *gui.rsrc_bold_font_name != NUL)
+ gui.bold_font = gui_mch_get_font(gui.rsrc_bold_font_name, FALSE);
+ if (gui.ital_font == NOFONT
+ && gui.rsrc_ital_font_name != NULL
+ && *gui.rsrc_ital_font_name != NUL)
+ gui.ital_font = gui_mch_get_font(gui.rsrc_ital_font_name, FALSE);
+ if (gui.boldital_font == NOFONT
+ && gui.rsrc_boldital_font_name != NULL
+ && *gui.rsrc_boldital_font_name != NUL)
+ gui.boldital_font = gui_mch_get_font(gui.rsrc_boldital_font_name,
+ FALSE);
+ }
+ else
+ {
+ /* When not using the font specified by the resources, also don't use
+ * the bold/italic fonts, otherwise setting 'guifont' will look very
+ * strange. */
+ if (gui.bold_font != NOFONT)
+ {
+ XFreeFont(gui.dpy, (XFontStruct *)gui.bold_font);
+ gui.bold_font = NOFONT;
+ }
+ if (gui.ital_font != NOFONT)
+ {
+ XFreeFont(gui.dpy, (XFontStruct *)gui.ital_font);
+ gui.ital_font = NOFONT;
+ }
+ if (gui.boldital_font != NOFONT)
+ {
+ XFreeFont(gui.dpy, (XFontStruct *)gui.boldital_font);
+ gui.boldital_font = NOFONT;
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Get a font structure for highlighting.
+ */
+ GuiFont
+gui_mch_get_font(name, giveErrorIfMissing)
+ char_u *name;
+ int giveErrorIfMissing;
+{
+ XFontStruct *font;
+
+ if (!gui.in_use || name == NULL) /* can't do this when GUI not running */
+ return NOFONT;
+
+ font = XLoadQueryFont(gui.dpy, (char *)name);
+
+ if (font == NULL)
+ {
+ if (giveErrorIfMissing)
+ EMSG2(_(e_font), name);
+ return NOFONT;
+ }
+
+#ifdef DEBUG
+ printf("Font Information for '%s':\n", name);
+ printf(" w = %d, h = %d, ascent = %d, descent = %d\n",
+ font->max_bounds.width, font->ascent + font->descent,
+ font->ascent, font->descent);
+ printf(" max ascent = %d, max descent = %d, max h = %d\n",
+ font->max_bounds.ascent, font->max_bounds.descent,
+ font->max_bounds.ascent + font->max_bounds.descent);
+ printf(" min lbearing = %d, min rbearing = %d\n",
+ font->min_bounds.lbearing, font->min_bounds.rbearing);
+ printf(" max lbearing = %d, max rbearing = %d\n",
+ font->max_bounds.lbearing, font->max_bounds.rbearing);
+ printf(" leftink = %d, rightink = %d\n",
+ (font->min_bounds.lbearing < 0),
+ (font->max_bounds.rbearing > font->max_bounds.width));
+ printf("\n");
+#endif
+
+ if (font->max_bounds.width != font->min_bounds.width)
+ {
+ EMSG2(_(e_fontwidth), name);
+ XFreeFont(gui.dpy, font);
+ return NOFONT;
+ }
+ return (GuiFont)font;
+}
+
+ int
+gui_mch_adjust_charsize()
+{
+#ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ {
+ gui.char_height = fontset_height((XFontSet)gui.fontset) + p_linespace;
+ gui.char_ascent = fontset_ascent((XFontSet)gui.fontset)
+ + p_linespace / 2;
+ }
+ else
+#endif
+ {
+ XFontStruct *font = (XFontStruct *)gui.norm_font;
+
+ gui.char_height = font->ascent + font->descent + p_linespace;
+ gui.char_ascent = font->ascent + p_linespace / 2;
+ }
+ return OK;
+}
+
+/*
+ * Set the current text font.
+ */
+ void
+gui_mch_set_font(font)
+ GuiFont font;
+{
+ static Font prev_font = (Font)-1;
+ Font fid = ((XFontStruct *)font)->fid;
+
+ if (fid != prev_font)
+ {
+ XSetFont(gui.dpy, gui.text_gc, fid);
+ XSetFont(gui.dpy, gui.back_gc, fid);
+ prev_font = fid;
+ gui.char_ascent = ((XFontStruct *)font)->ascent + p_linespace / 2;
+ }
+#ifdef FEAT_XFONTSET
+ current_fontset = (XFontSet)NULL;
+#endif
+}
+
+#if defined(FEAT_XFONTSET) || defined(PROTO)
+/*
+ * Set the current text fontset.
+ * Adjust the ascent, in case it's different.
+ */
+ void
+gui_mch_set_fontset(fontset)
+ GuiFontset fontset;
+{
+ current_fontset = (XFontSet)fontset;
+ gui.char_ascent = fontset_ascent(current_fontset) + p_linespace / 2;
+}
+#endif
+
+#if 0 /* not used */
+/*
+ * Return TRUE if the two fonts given are equivalent.
+ */
+ int
+gui_mch_same_font(f1, f2)
+ GuiFont f1;
+ GuiFont f2;
+{
+#ifdef FEAT_XFONTSET
+ if (gui.fontset != NULL)
+ return f1 == f2;
+ else
+#endif
+ return ((XFontStruct *)f1)->fid == ((XFontStruct *)f2)->fid;
+}
+#endif
+
+/*
+ * If a font is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_font(font)
+ GuiFont font;
+{
+ if (font != NOFONT)
+ XFreeFont(gui.dpy, (XFontStruct *)font);
+}
+
+#if defined(FEAT_XFONTSET) || defined(PROTO)
+/*
+ * If a fontset is not going to be used, free its structure.
+ */
+ void
+gui_mch_free_fontset(fontset)
+ GuiFontset fontset;
+{
+ if (fontset != NOFONTSET)
+ XFreeFontSet(gui.dpy, (XFontSet)fontset);
+}
+
+/*
+ * Load the fontset "name".
+ * Return a reference to the fontset, or NOFONTSET when failing.
+ */
+ GuiFontset
+gui_mch_get_fontset(name, giveErrorIfMissing, fixed_width)
+ char_u *name;
+ int giveErrorIfMissing;
+ int fixed_width;
+{
+ XFontSet fontset;
+ char **missing, *def_str;
+ int num_missing;
+
+ if (!gui.in_use || name == NULL)
+ return NOFONTSET;
+
+ fontset = XCreateFontSet(gui.dpy, (char *)name, &missing, &num_missing,
+ &def_str);
+ if (num_missing > 0)
+ {
+ int i;
+
+ if (giveErrorIfMissing)
+ {
+ EMSG2(_("E250: Fonts for the following charsets are missing in fontset %s:"), name);
+ for (i = 0; i < num_missing; i++)
+ EMSG2("%s", missing[i]);
+ }
+ XFreeStringList(missing);
+ }
+
+ if (fontset == NULL)
+ {
+ if (giveErrorIfMissing)
+ EMSG2(_(e_fontset), name);
+ return NOFONTSET;
+ }
+
+ if (fixed_width && check_fontset_sanity(fontset) == FAIL)
+ {
+ XFreeFontSet(gui.dpy, fontset);
+ return NOFONTSET;
+ }
+ return (GuiFontset)fontset;
+}
+
+/*
+ * Check if fontset "fs" is fixed width.
+ */
+ static int
+check_fontset_sanity(fs)
+ XFontSet fs;
+{
+ XFontStruct **xfs;
+ char **font_name;
+ int fn;
+ char *base_name;
+ int i;
+ int min_width;
+ int min_font_idx = 0;
+
+ base_name = XBaseFontNameListOfFontSet(fs);
+ fn = XFontsOfFontSet(fs, &xfs, &font_name);
+ for (i = 0; i < fn; i++)
+ {
+ if (xfs[i]->max_bounds.width != xfs[i]->min_bounds.width)
+ {
+ EMSG2(_("E252: Fontset name: %s"), base_name);
+ EMSG2(_("Font '%s' is not fixed-width"), font_name[i]);
+ return FAIL;
+ }
+ }
+ /* scan base font width */
+ min_width = 32767;
+ for (i = 0; i < fn; i++)
+ {
+ if (xfs[i]->max_bounds.width<min_width)
+ {
+ min_width = xfs[i]->max_bounds.width;
+ min_font_idx = i;
+ }
+ }
+ for (i = 0; i < fn; i++)
+ {
+ if ( xfs[i]->max_bounds.width != 2 * min_width
+ && xfs[i]->max_bounds.width != min_width)
+ {
+ EMSG2(_("E253: Fontset name: %s\n"), base_name);
+ EMSG2(_("Font0: %s\n"), font_name[min_font_idx]);
+ EMSG2(_("Font1: %s\n"), font_name[i]);
+ EMSGN(_("Font%ld width is not twice that of font0\n"), i);
+ EMSGN(_("Font0 width: %ld\n"), xfs[min_font_idx]->max_bounds.width);
+ EMSGN(_("Font1 width: %ld\n\n"), xfs[i]->max_bounds.width);
+ return FAIL;
+ }
+ }
+ /* it seems ok. Good Luck!! */
+ return OK;
+}
+
+ static int
+fontset_width(fs)
+ XFontSet fs;
+{
+ return XmbTextEscapement(fs, "Vim", 3) / 3;
+}
+
+ int
+fontset_height(fs)
+ XFontSet fs;
+{
+ XFontSetExtents *extents;
+
+ extents = XExtentsOfFontSet(fs);
+ return extents->max_logical_extent.height;
+}
+
+#if (defined(FONTSET_ALWAYS) && defined(FEAT_GUI_ATHENA) \
+ && defined(FEAT_MENU)) || defined(PROTO)
+/*
+ * Returns the bounding box height around the actual glyph image of all
+ * characters in all fonts of the fontset.
+ */
+ int
+fontset_height2(fs)
+ XFontSet fs;
+{
+ XFontSetExtents *extents;
+
+ extents = XExtentsOfFontSet(fs);
+ return extents->max_ink_extent.height;
+}
+#endif
+
+/* NOT USED YET
+ static int
+fontset_descent(fs)
+ XFontSet fs;
+{
+ XFontSetExtents *extents;
+
+ extents = XExtentsOfFontSet (fs);
+ return extents->max_logical_extent.height + extents->max_logical_extent.y;
+}
+*/
+
+ static int
+fontset_ascent(fs)
+ XFontSet fs;
+{
+ XFontSetExtents *extents;
+
+ extents = XExtentsOfFontSet(fs);
+ return -extents->max_logical_extent.y;
+}
+
+#endif /* FEAT_XFONTSET */
+
+/*
+ * Return the Pixel value (color) for the given color name.
+ * Return INVALCOLOR for error.
+ */
+ guicolor_T
+gui_mch_get_color(reqname)
+ char_u *reqname;
+{
+ int i;
+ char_u *name = reqname;
+ Colormap colormap;
+ XColor color;
+ static char *(vimnames[][2]) =
+ {
+ /* A number of colors that some X11 systems don't have */
+ {"LightRed", "#FFBBBB"},
+ {"LightGreen", "#88FF88"},
+ {"LightMagenta","#FFBBFF"},
+ {"DarkCyan", "#008888"},
+ {"DarkBlue", "#0000BB"},
+ {"DarkRed", "#BB0000"},
+ {"DarkMagenta", "#BB00BB"},
+ {"DarkGrey", "#BBBBBB"},
+ {"DarkYellow", "#BBBB00"},
+ {NULL, NULL}
+ };
+
+ /* can't do this when GUI not running */
+ if (!gui.in_use || *reqname == NUL)
+ return INVALCOLOR;
+
+ colormap = DefaultColormap(gui.dpy, XDefaultScreen(gui.dpy));
+
+ /* Do this twice if the name isn't recognized. */
+ while (name != NULL)
+ {
+ i = XParseColor(gui.dpy, colormap, (char *)name, &color);
+
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ if (i == 0)
+ {
+ char *old;
+
+ /* The X11 system is trying to resolve named colors only by names
+ * corresponding to the current locale language. But Vim scripts
+ * usually contain the English color names. Therefore we have to
+ * try a second time here with the native "C" locale set.
+ * Hopefully, restoring the old locale this way works on all
+ * systems...
+ */
+ old = setlocale(LC_ALL, NULL);
+ if (old != NULL && STRCMP(old, "C") != 0)
+ {
+ old = (char *)vim_strsave((char_u *)old);
+ setlocale(LC_ALL, "C");
+ i = XParseColor(gui.dpy, colormap, (char *)name, &color);
+ setlocale(LC_ALL, old);
+ vim_free(old);
+ }
+ }
+#endif
+ if (i != 0 && (XAllocColor(gui.dpy, colormap, &color) != 0
+ || find_closest_color(colormap, &color) == OK))
+ return (guicolor_T)color.pixel;
+
+ /* check for a few builtin names */
+ for (i = 0; ; ++i)
+ {
+ if (vimnames[i][0] == NULL)
+ {
+ name = NULL;
+ break;
+ }
+ if (STRICMP(name, vimnames[i][0]) == 0)
+ {
+ name = (char_u *)vimnames[i][1];
+ break;
+ }
+ }
+ }
+
+ return INVALCOLOR;
+}
+
+/*
+ * Find closest color for "colorPtr" in "colormap". set "colorPtr" to the
+ * resulting color.
+ * Based on a similar function in TCL.
+ * Return FAIL if not able to find or allocate a color.
+ */
+ static int
+find_closest_color(colormap, colorPtr)
+ Colormap colormap;
+ XColor *colorPtr;
+{
+ double tmp, distance, closestDistance;
+ int i, closest, numFound, cmap_size;
+ XColor *colortable;
+ XVisualInfo template, *visInfoPtr;
+
+ template.visualid = XVisualIDFromVisual(DefaultVisual(gui.dpy,
+ XDefaultScreen(gui.dpy)));
+ visInfoPtr = XGetVisualInfo(gui.dpy, (long)VisualIDMask,
+ &template, &numFound);
+ if (numFound < 1)
+ /* FindClosestColor couldn't lookup visual */
+ return FAIL;
+
+ cmap_size = visInfoPtr->colormap_size;
+ XFree((char *)visInfoPtr);
+ colortable = (XColor *)alloc((unsigned)(cmap_size * sizeof(XColor)));
+ if (!colortable)
+ return FAIL; /* out of memory */
+
+ for (i = 0; i < cmap_size; i++)
+ colortable[i].pixel = (unsigned long)i;
+ XQueryColors (gui.dpy, colormap, colortable, cmap_size);
+
+ /*
+ * Find the color that best approximates the desired one, then
+ * try to allocate that color. If that fails, it must mean that
+ * the color was read-write (so we can't use it, since it's owner
+ * might change it) or else it was already freed. Try again,
+ * over and over again, until something succeeds.
+ */
+ closestDistance = 1e30;
+ closest = 0;
+ for (i = 0; i < cmap_size; i++)
+ {
+ /*
+ * Use Euclidean distance in RGB space, weighted by Y (of YIQ)
+ * as the objective function; this accounts for differences
+ * in the color sensitivity of the eye.
+ */
+ tmp = .30 * (((int)colorPtr->red) - (int)colortable[i].red);
+ distance = tmp * tmp;
+ tmp = .61 * (((int)colorPtr->green) - (int)colortable[i].green);
+ distance += tmp * tmp;
+ tmp = .11 * (((int)colorPtr->blue) - (int)colortable[i].blue);
+ distance += tmp * tmp;
+ if (distance < closestDistance)
+ {
+ closest = i;
+ closestDistance = distance;
+ }
+ }
+
+ if (XAllocColor(gui.dpy, colormap, &colortable[closest]) != 0)
+ {
+ gui.color_approx = TRUE;
+ *colorPtr = colortable[closest];
+ }
+
+ free(colortable);
+ return OK;
+}
+
+ void
+gui_mch_set_fg_color(color)
+ guicolor_T color;
+{
+ if (color != prev_fg_color)
+ {
+ XSetForeground(gui.dpy, gui.text_gc, (Pixel)color);
+ prev_fg_color = color;
+ }
+}
+
+/*
+ * Set the current text background color.
+ */
+ void
+gui_mch_set_bg_color(color)
+ guicolor_T color;
+{
+ if (color != prev_bg_color)
+ {
+ XSetBackground(gui.dpy, gui.text_gc, (Pixel)color);
+ prev_bg_color = color;
+ }
+}
+
+/*
+ * create a mouse pointer that is blank
+ */
+ static Cursor
+gui_x11_create_blank_mouse()
+{
+ Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1);
+ GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0);
+ XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0);
+ XFreeGC(gui.dpy, gc);
+ return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap,
+ (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0);
+}
+
+ void
+gui_mch_draw_string(row, col, s, len, flags)
+ int row;
+ int col;
+ char_u *s;
+ int len;
+ int flags;
+{
+ int cells = len;
+#ifdef FEAT_MBYTE
+ static XChar2b *buf = NULL;
+ static int buflen = 0;
+ char_u *p;
+ int wlen = 0;
+ int c;
+
+ if (enc_utf8)
+ {
+ /* Convert UTF-8 byte sequence to 16 bit characters for the X
+ * functions. Need a buffer for the 16 bit characters. Keep it
+ * between calls, because allocating it each time is slow. */
+ if (buflen < len)
+ {
+ XtFree((char *)buf);
+ buf = (XChar2b *)XtMalloc(len * sizeof(XChar2b));
+ buflen = len;
+ }
+ p = s;
+ cells = 0;
+ while (p < s + len)
+ {
+ c = utf_ptr2char(p);
+ if (c >= 0x10000) /* show chars > 0xffff as ? */
+ c = 0xbf;
+ buf[wlen].byte1 = (unsigned)c >> 8;
+ buf[wlen].byte2 = c;
+ ++wlen;
+ cells += utf_char2cells(c);
+ p += utf_ptr2len_check(p);
+ }
+ }
+ else if (has_mbyte)
+ {
+ cells = 0;
+ for (p = s; p < s + len; )
+ {
+ cells += ptr2cells(p);
+ p += (*mb_ptr2len_check)(p);
+ }
+ }
+
+#endif
+
+#ifdef FEAT_XFONTSET
+ if (current_fontset != NULL)
+ {
+ /* Setup a clip rectangle to avoid spilling over in the next or
+ * previous line. This is apparently needed for some fonts which are
+ * used in a fontset. */
+ XRectangle clip;
+
+ clip.x = 0;
+ clip.y = 0;
+ clip.height = gui.char_height;
+ clip.width = gui.char_width * cells + 1;
+ XSetClipRectangles(gui.dpy, gui.text_gc, FILL_X(col), FILL_Y(row),
+ &clip, 1, Unsorted);
+ }
+#endif
+
+ if (flags & DRAW_TRANSP)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ XDrawString16(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), buf, wlen);
+ else
+#endif
+ XDrawString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), (char *)s, len);
+ }
+ else if (p_linespace != 0
+#ifdef FEAT_XFONTSET
+ || current_fontset != NULL
+#endif
+ )
+ {
+ XSetForeground(gui.dpy, gui.text_gc, prev_bg_color);
+ XFillRectangle(gui.dpy, gui.wid, gui.text_gc, FILL_X(col),
+ FILL_Y(row), gui.char_width * cells, gui.char_height);
+ XSetForeground(gui.dpy, gui.text_gc, prev_fg_color);
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ XDrawString16(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), buf, wlen);
+ else
+#endif
+ XDrawString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), (char *)s, len);
+ }
+ else
+ {
+ /* XmbDrawImageString has bug, don't use it for fontset. */
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ XDrawImageString16(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), buf, wlen);
+ else
+#endif
+ XDrawImageString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col),
+ TEXT_Y(row), (char *)s, len);
+ }
+
+ /* Bold trick: draw the text again with a one-pixel offset. */
+ if (flags & DRAW_BOLD)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ XDrawString16(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col) + 1,
+ TEXT_Y(row), buf, wlen);
+ else
+#endif
+ XDrawString(gui.dpy, gui.wid, gui.text_gc, TEXT_X(col) + 1,
+ TEXT_Y(row), (char *)s, len);
+ }
+
+ /* Underline: draw a line at the bottom of the character cell. */
+ if (flags & DRAW_UNDERL)
+ XDrawLine(gui.dpy, gui.wid, gui.text_gc, FILL_X(col),
+ FILL_Y(row + 1) - 1, FILL_X(col + cells) - 1, FILL_Y(row + 1) - 1);
+
+#ifdef FEAT_XFONTSET
+ if (current_fontset != NULL)
+ XSetClipMask(gui.dpy, gui.text_gc, None);
+#endif
+}
+
+/*
+ * Return OK if the key with the termcap name "name" is supported.
+ */
+ int
+gui_mch_haskey(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; special_keys[i].key_sym != (KeySym)0; i++)
+ if (name[0] == special_keys[i].vim_code0 &&
+ name[1] == special_keys[i].vim_code1)
+ return OK;
+ return FAIL;
+}
+
+/*
+ * Return the text window-id and display. Only required for X-based GUI's
+ */
+ int
+gui_get_x11_windis(win, dis)
+ Window *win;
+ Display **dis;
+{
+ *win = XtWindow(vimShell);
+ *dis = gui.dpy;
+ return OK;
+}
+
+ void
+gui_mch_beep()
+{
+ XBell(gui.dpy, 0);
+}
+
+ void
+gui_mch_flash(msec)
+ int msec;
+{
+ /* Do a visual beep by reversing the foreground and background colors */
+ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
+ FILL_X((int)Columns) + gui.border_offset,
+ FILL_Y((int)Rows) + gui.border_offset);
+ XSync(gui.dpy, False);
+ ui_delay((long)msec, TRUE); /* wait for a few msec */
+ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc, 0, 0,
+ FILL_X((int)Columns) + gui.border_offset,
+ FILL_Y((int)Rows) + gui.border_offset);
+}
+
+/*
+ * Invert a rectangle from row r, column c, for nr rows and nc columns.
+ */
+ void
+gui_mch_invert_rectangle(r, c, nr, nc)
+ int r;
+ int c;
+ int nr;
+ int nc;
+{
+ XFillRectangle(gui.dpy, gui.wid, gui.invert_gc,
+ FILL_X(c), FILL_Y(r), (nc) * gui.char_width, (nr) * gui.char_height);
+}
+
+/*
+ * Iconify the GUI window.
+ */
+ void
+gui_mch_iconify()
+{
+ XIconifyWindow(gui.dpy, XtWindow(vimShell), DefaultScreen(gui.dpy));
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Bring the Vim window to the foreground.
+ */
+ void
+gui_mch_set_foreground()
+{
+ XMapRaised(gui.dpy, XtWindow(vimShell));
+}
+#endif
+
+/*
+ * Draw a cursor without focus.
+ */
+ void
+gui_mch_draw_hollow_cursor(color)
+ guicolor_T color;
+{
+ int w = 1;
+
+#ifdef FEAT_MBYTE
+ if (mb_lefthalve(gui.row, gui.col))
+ w = 2;
+#endif
+ gui_mch_set_fg_color(color);
+ XDrawRectangle(gui.dpy, gui.wid, gui.text_gc, FILL_X(gui.col),
+ FILL_Y(gui.row), w * gui.char_width - 1, gui.char_height - 1);
+}
+
+/*
+ * Draw part of a cursor, "w" pixels wide, and "h" pixels high, using
+ * color "color".
+ */
+ void
+gui_mch_draw_part_cursor(w, h, color)
+ int w;
+ int h;
+ guicolor_T color;
+{
+ gui_mch_set_fg_color(color);
+
+ XFillRectangle(gui.dpy, gui.wid, gui.text_gc,
+#ifdef FEAT_RIGHTLEFT
+ /* vertical line should be on the right of current point */
+ CURSOR_BAR_RIGHT ? FILL_X(gui.col + 1) - w :
+#endif
+ FILL_X(gui.col),
+ FILL_Y(gui.row) + gui.char_height - h,
+ w, h);
+}
+
+/*
+ * Catch up with any queued X events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the X event queue (& no timers pending), then we return
+ * immediately.
+ */
+ void
+gui_mch_update()
+{
+ XtInputMask mask, desired;
+
+#ifdef ALT_X_INPUT
+ if (suppress_alternate_input)
+ desired = (XtIMXEvent | XtIMTimer);
+ else
+#endif
+ desired = (XtIMAll);
+ while ((mask = XtAppPending(app_context)) && (mask & desired)
+ && !vim_is_input_buf_full())
+ XtAppProcessEvent(app_context, desired);
+}
+
+/*
+ * GUI input routine called by gui_wait_for_chars(). Waits for a character
+ * from the keyboard.
+ * wtime == -1 Wait forever.
+ * wtime == 0 This should never happen.
+ * wtime > 0 Wait wtime milliseconds for a character.
+ * Returns OK if a character was found to be available within the given time,
+ * or FAIL otherwise.
+ */
+ int
+gui_mch_wait_for_chars(wtime)
+ long wtime;
+{
+ int focus;
+
+ /*
+ * Make this static, in case gui_x11_timer_cb is called after leaving
+ * this function (otherwise a random value on the stack may be changed).
+ */
+ static int timed_out;
+ XtIntervalId timer = (XtIntervalId)0;
+ XtInputMask desired;
+#ifdef FEAT_SNIFF
+ static int sniff_on = 0;
+ static XtInputId sniff_input_id = 0;
+#endif
+
+ timed_out = FALSE;
+
+#ifdef FEAT_SNIFF
+ if (sniff_on && !want_sniff_request)
+ {
+ if (sniff_input_id)
+ XtRemoveInput(sniff_input_id);
+ sniff_on = 0;
+ }
+ else if (!sniff_on && want_sniff_request)
+ {
+ sniff_input_id = XtAppAddInput(app_context, fd_from_sniff,
+ (XtPointer)XtInputReadMask, gui_x11_sniff_request_cb, 0);
+ sniff_on = 1;
+ }
+#endif
+
+ if (wtime > 0)
+ timer = XtAppAddTimeOut(app_context, (long_u)wtime, gui_x11_timer_cb,
+ &timed_out);
+
+ focus = gui.in_focus;
+#ifdef ALT_X_INPUT
+ if (suppress_alternate_input)
+ desired = (XtIMXEvent | XtIMTimer);
+ else
+#endif
+ desired = (XtIMAll);
+ while (!timed_out)
+ {
+ /* Stop or start blinking when focus changes */
+ if (gui.in_focus != focus)
+ {
+ if (gui.in_focus)
+ gui_mch_start_blink();
+ else
+ gui_mch_stop_blink();
+ focus = gui.in_focus;
+ }
+
+ /*
+ * Don't use gui_mch_update() because then we will spin-lock until a
+ * char arrives, instead we use XtAppProcessEvent() to hang until an
+ * event arrives. No need to check for input_buf_full because we are
+ * returning as soon as it contains a single char. Note that
+ * XtAppNextEvent() may not be used because it will not return after a
+ * timer event has arrived -- webb
+ */
+ XtAppProcessEvent(app_context, desired);
+
+ if (input_available())
+ {
+ if (timer != (XtIntervalId)0 && !timed_out)
+ XtRemoveTimeOut(timer);
+ return OK;
+ }
+ }
+ return FAIL;
+}
+
+/*
+ * Output routines.
+ */
+
+/* Flush any output to the screen */
+ void
+gui_mch_flush()
+{
+ XFlush(gui.dpy);
+}
+
+/*
+ * Clear a rectangular region of the screen from text pos (row1, col1) to
+ * (row2, col2) inclusive.
+ */
+ void
+gui_mch_clear_block(row1, col1, row2, col2)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+{
+ int x;
+
+ x = FILL_X(col1);
+
+ /* Clear one extra pixel at the far right, for when bold characters have
+ * spilled over to the next column. */
+ XFillRectangle(gui.dpy, gui.wid, gui.back_gc, x, FILL_Y(row1),
+ (col2 - col1 + 1) * gui.char_width + (col2 == Columns - 1),
+ (row2 - row1 + 1) * gui.char_height);
+}
+
+ void
+gui_mch_clear_all()
+{
+ XClearArea(gui.dpy, gui.wid, 0, 0, 0, 0, False);
+}
+
+/*
+ * Delete the given number of lines from the given row, scrolling up any
+ * text further down within the scroll region.
+ */
+ void
+gui_mch_delete_lines(row, num_lines)
+ int row;
+ int num_lines;
+{
+ if (gui.visibility == VisibilityFullyObscured)
+ return; /* Can't see the window */
+
+ /* copy one extra pixel at the far right, for when bold has spilled
+ * over */
+ XCopyArea(gui.dpy, gui.wid, gui.wid, gui.text_gc,
+ FILL_X(gui.scroll_region_left), FILL_Y(row + num_lines),
+ gui.char_width * (gui.scroll_region_right - gui.scroll_region_left + 1)
+ + (gui.scroll_region_right == Columns - 1),
+ gui.char_height * (gui.scroll_region_bot - row - num_lines + 1),
+ FILL_X(gui.scroll_region_left), FILL_Y(row));
+
+ gui_clear_block(gui.scroll_region_bot - num_lines + 1,
+ gui.scroll_region_left,
+ gui.scroll_region_bot, gui.scroll_region_right);
+ gui_x11_check_copy_area();
+}
+
+/*
+ * Insert the given number of lines before the given row, scrolling down any
+ * following text within the scroll region.
+ */
+ void
+gui_mch_insert_lines(row, num_lines)
+ int row;
+ int num_lines;
+{
+ if (gui.visibility == VisibilityFullyObscured)
+ return; /* Can't see the window */
+
+ /* copy one extra pixel at the far right, for when bold has spilled
+ * over */
+ XCopyArea(gui.dpy, gui.wid, gui.wid, gui.text_gc,
+ FILL_X(gui.scroll_region_left), FILL_Y(row),
+ gui.char_width * (gui.scroll_region_right - gui.scroll_region_left + 1)
+ + (gui.scroll_region_right == Columns - 1),
+ gui.char_height * (gui.scroll_region_bot - row - num_lines + 1),
+ FILL_X(gui.scroll_region_left), FILL_Y(row + num_lines));
+
+ gui_clear_block(row, gui.scroll_region_left,
+ row + num_lines - 1, gui.scroll_region_right);
+ gui_x11_check_copy_area();
+}
+
+/*
+ * Update the region revealed by scrolling up/down.
+ */
+ static void
+gui_x11_check_copy_area()
+{
+ XEvent event;
+ XGraphicsExposeEvent *gevent;
+
+ if (gui.visibility != VisibilityPartiallyObscured)
+ return;
+
+ XFlush(gui.dpy);
+
+ /* Wait to check whether the scroll worked or not */
+ for (;;)
+ {
+ if (XCheckTypedEvent(gui.dpy, NoExpose, &event))
+ return; /* The scroll worked. */
+
+ if (XCheckTypedEvent(gui.dpy, GraphicsExpose, &event))
+ {
+ gevent = (XGraphicsExposeEvent *)&event;
+ gui_redraw(gevent->x, gevent->y, gevent->width, gevent->height);
+ if (gevent->count == 0)
+ return; /* This was the last expose event */
+ }
+ XSync(gui.dpy, False);
+ }
+}
+
+/*
+ * X Selection stuff, for cutting and pasting text to other windows.
+ */
+
+ void
+clip_mch_lose_selection(cbd)
+ VimClipboard *cbd;
+{
+ clip_x11_lose_selection(vimShell, cbd);
+}
+
+ int
+clip_mch_own_selection(cbd)
+ VimClipboard *cbd;
+{
+ return clip_x11_own_selection(vimShell, cbd);
+}
+
+ void
+clip_mch_request_selection(cbd)
+ VimClipboard *cbd;
+{
+ clip_x11_request_selection(vimShell, gui.dpy, cbd);
+}
+
+ void
+clip_mch_set_selection(cbd)
+ VimClipboard *cbd;
+{
+ clip_x11_set_selection(cbd);
+}
+
+#if defined(FEAT_MENU) || defined(PROTO)
+/*
+ * Menu stuff.
+ */
+
+/*
+ * Make a menu either grey or not grey.
+ */
+ void
+gui_mch_menu_grey(menu, grey)
+ vimmenu_T *menu;
+ int grey;
+{
+ if (menu->id != (Widget)0)
+ {
+ gui_mch_menu_hidden(menu, False);
+ if (grey
+#ifdef FEAT_GUI_MOTIF
+ || !menu->sensitive
+#endif
+ )
+ XtSetSensitive(menu->id, False);
+ else
+ XtSetSensitive(menu->id, True);
+ }
+}
+
+/*
+ * Make menu item hidden or not hidden
+ */
+ void
+gui_mch_menu_hidden(menu, hidden)
+ vimmenu_T *menu;
+ int hidden;
+{
+ if (menu->id != (Widget)0)
+ {
+ if (hidden)
+ XtUnmanageChild(menu->id);
+ else
+ XtManageChild(menu->id);
+ }
+}
+
+/*
+ * This is called after setting all the menus to grey/hidden or not.
+ */
+ void
+gui_mch_draw_menubar()
+{
+ /* Nothing to do in X */
+}
+
+/* ARGSUSED */
+ void
+gui_x11_menu_cb(w, client_data, call_data)
+ Widget w;
+ XtPointer client_data, call_data;
+{
+ gui_menu_cb((vimmenu_T *)client_data);
+}
+
+#endif /* FEAT_MENU */
+
+
+
+/*
+ * Function called when window closed. Works like ":qa".
+ * Should put up a requester!
+ */
+/*ARGSUSED*/
+ static void
+gui_x11_wm_protocol_handler(w, client_data, event, dum)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *dum;
+{
+ /*
+ * Only deal with Client messages.
+ */
+ if (event->type != ClientMessage)
+ return;
+
+ /*
+ * The WM_SAVE_YOURSELF event arrives when the window manager wants to
+ * exit. That can be cancelled though, thus Vim shouldn't exit here.
+ * Just sync our swap files.
+ */
+ if (((XClientMessageEvent *)event)->data.l[0] ==
+ wm_atoms[SAVE_YOURSELF_IDX])
+ {
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+
+ /* Set the window's WM_COMMAND property, to let the window manager
+ * know we are done saving ourselves. We don't want to be restarted,
+ * thus set argv to NULL. */
+ XSetCommand(gui.dpy, XtWindow(vimShell), NULL, 0);
+ return;
+ }
+
+ if (((XClientMessageEvent *)event)->data.l[0] !=
+ wm_atoms[DELETE_WINDOW_IDX])
+ return;
+
+ gui_shell_closed();
+}
+
+#ifdef FEAT_CLIENTSERVER
+/*
+ * Function called when property changed. Check for incoming commands
+ */
+/*ARGSUSED*/
+ static void
+gui_x11_send_event_handler(w, client_data, event, dum)
+ Widget w;
+ XtPointer client_data;
+ XEvent *event;
+ Boolean *dum;
+{
+ XPropertyEvent *e = (XPropertyEvent *) event;
+
+ if (e->type == PropertyNotify && e->window == commWindow
+ && e->atom == commProperty && e->state == PropertyNewValue)
+ {
+ serverEventProc(gui.dpy, event);
+ }
+}
+#endif
+
+/*
+ * Cursor blink functions.
+ *
+ * This is a simple state machine:
+ * BLINK_NONE not blinking at all
+ * BLINK_OFF blinking, cursor is not shown
+ * BLINK_ON blinking, cursor is shown
+ */
+
+#define BLINK_NONE 0
+#define BLINK_OFF 1
+#define BLINK_ON 2
+
+static int blink_state = BLINK_NONE;
+static long_u blink_waittime = 700;
+static long_u blink_ontime = 400;
+static long_u blink_offtime = 250;
+static XtIntervalId blink_timer = (XtIntervalId)0;
+
+ void
+gui_mch_set_blinking(waittime, on, off)
+ long waittime, on, off;
+{
+ blink_waittime = waittime;
+ blink_ontime = on;
+ blink_offtime = off;
+}
+
+/*
+ * Stop the cursor blinking. Show the cursor if it wasn't shown.
+ */
+ void
+gui_mch_stop_blink()
+{
+ if (blink_timer != (XtIntervalId)0)
+ {
+ XtRemoveTimeOut(blink_timer);
+ blink_timer = (XtIntervalId)0;
+ }
+ if (blink_state == BLINK_OFF)
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_NONE;
+}
+
+/*
+ * Start the cursor blinking. If it was already blinking, this restarts the
+ * waiting time and shows the cursor.
+ */
+ void
+gui_mch_start_blink()
+{
+ if (blink_timer != (XtIntervalId)0)
+ XtRemoveTimeOut(blink_timer);
+ /* Only switch blinking on if none of the times is zero */
+ if (blink_waittime && blink_ontime && blink_offtime && gui.in_focus)
+ {
+ blink_timer = XtAppAddTimeOut(app_context, blink_waittime,
+ gui_x11_blink_cb, NULL);
+ blink_state = BLINK_ON;
+ gui_update_cursor(TRUE, FALSE);
+ }
+}
+
+/* ARGSUSED */
+ static void
+gui_x11_blink_cb(timed_out, interval_id)
+ XtPointer timed_out;
+ XtIntervalId *interval_id;
+{
+ if (blink_state == BLINK_ON)
+ {
+ gui_undraw_cursor();
+ blink_state = BLINK_OFF;
+ blink_timer = XtAppAddTimeOut(app_context, blink_offtime,
+ gui_x11_blink_cb, NULL);
+ }
+ else
+ {
+ gui_update_cursor(TRUE, FALSE);
+ blink_state = BLINK_ON;
+ blink_timer = XtAppAddTimeOut(app_context, blink_ontime,
+ gui_x11_blink_cb, NULL);
+ }
+}
+
+/*
+ * Return the RGB value of a pixel as a long.
+ */
+ long_u
+gui_mch_get_rgb(pixel)
+ guicolor_T pixel;
+{
+ XColor xc;
+ Colormap colormap;
+
+ colormap = DefaultColormap(gui.dpy, XDefaultScreen(gui.dpy));
+ xc.pixel = pixel;
+ XQueryColor(gui.dpy, colormap, &xc);
+
+ return ((xc.red & 0xff00) << 8) + (xc.green & 0xff00)
+ + ((unsigned)xc.blue >> 8);
+}
+
+/*
+ * Add the callback functions.
+ */
+ void
+gui_x11_callbacks(textArea, vimForm)
+ Widget textArea;
+ Widget vimForm;
+{
+ XtAddEventHandler(textArea, VisibilityChangeMask, FALSE,
+ gui_x11_visibility_cb, (XtPointer)0);
+
+ XtAddEventHandler(textArea, ExposureMask, FALSE, gui_x11_expose_cb,
+ (XtPointer)0);
+
+ XtAddEventHandler(vimShell, StructureNotifyMask, FALSE,
+ gui_x11_resize_window_cb, (XtPointer)0);
+
+ XtAddEventHandler(vimShell, FocusChangeMask, FALSE, gui_x11_focus_change_cb,
+ (XtPointer)0);
+ /*
+ * Only install these enter/leave callbacks when 'p' in 'guioptions'.
+ * Only needed for some window managers.
+ */
+ if (vim_strchr(p_go, GO_POINTER) != NULL)
+ {
+ XtAddEventHandler(vimShell, LeaveWindowMask, FALSE, gui_x11_leave_cb,
+ (XtPointer)0);
+ XtAddEventHandler(textArea, LeaveWindowMask, FALSE, gui_x11_leave_cb,
+ (XtPointer)0);
+ XtAddEventHandler(textArea, EnterWindowMask, FALSE, gui_x11_enter_cb,
+ (XtPointer)0);
+ XtAddEventHandler(vimShell, EnterWindowMask, FALSE, gui_x11_enter_cb,
+ (XtPointer)0);
+ }
+
+ XtAddEventHandler(vimForm, KeyPressMask, FALSE, gui_x11_key_hit_cb,
+ (XtPointer)0);
+ XtAddEventHandler(textArea, KeyPressMask, FALSE, gui_x11_key_hit_cb,
+ (XtPointer)0);
+
+ /* get pointer moved events from scrollbar, needed for 'mousefocus' */
+ XtAddEventHandler(vimForm, PointerMotionMask,
+ FALSE, gui_x11_mouse_cb, (XtPointer)1);
+ XtAddEventHandler(textArea, ButtonPressMask | ButtonReleaseMask |
+ ButtonMotionMask | PointerMotionMask,
+ FALSE, gui_x11_mouse_cb, (XtPointer)0);
+}
+
+/*
+ * Get current y mouse coordinate in text window.
+ * Return -1 when unknown.
+ */
+ int
+gui_mch_get_mouse_x()
+{
+ int rootx, rooty, winx, winy;
+ Window root, child;
+ unsigned int mask;
+
+ if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child,
+ &rootx, &rooty, &winx, &winy, &mask))
+ return winx;
+ return -1;
+}
+
+ int
+gui_mch_get_mouse_y()
+{
+ int rootx, rooty, winx, winy;
+ Window root, child;
+ unsigned int mask;
+
+ if (gui.wid && XQueryPointer(gui.dpy, gui.wid, &root, &child,
+ &rootx, &rooty, &winx, &winy, &mask))
+ return winy;
+ return -1;
+}
+
+ void
+gui_mch_setmouse(x, y)
+ int x;
+ int y;
+{
+ if (gui.wid)
+ XWarpPointer(gui.dpy, (Window)0, gui.wid, 0, 0, 0, 0, x, y);
+}
+
+#if (defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)) || defined(PROTO)
+ XButtonPressedEvent *
+gui_x11_get_last_mouse_event()
+{
+ return &last_mouse_event;
+}
+#endif
+
+#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
+
+/* Signs are currently always 2 chars wide. Hopefully the font is big enough
+ * to provide room for the bitmap! */
+# define SIGN_WIDTH (gui.char_width * 2)
+
+#if 0 /* not used */
+ void
+gui_mch_clearsign(row)
+ int row;
+{
+ if (gui.in_use)
+ XClearArea(gui.dpy, gui.wid, 0, TEXT_Y(row) - gui.char_height,
+ SIGN_WIDTH, gui.char_height, FALSE);
+}
+#endif
+
+ void
+gui_mch_drawsign(row, col, typenr)
+ int row;
+ int col;
+ int typenr;
+{
+ XImage *sign;
+
+ if (gui.in_use && (sign = (XImage *)sign_get_image(typenr)) != NULL)
+ {
+ XClearArea(gui.dpy, gui.wid, TEXT_X(col), TEXT_Y(row) - sign->height,
+ SIGN_WIDTH, gui.char_height, FALSE);
+ XPutImage(gui.dpy, gui.wid, gui.text_gc, sign, 0, 0,
+ TEXT_X(col) + (SIGN_WIDTH - sign->width) / 2,
+ TEXT_Y(row) - sign->height,
+ sign->width, sign->height);
+ }
+}
+
+ void *
+gui_mch_register_sign(signfile)
+ char_u *signfile;
+{
+ XpmAttributes attrs;
+ XImage *sign;
+ int status;
+
+ /*
+ * Setup the color substitution table.
+ */
+ sign = NULL;
+ if (signfile[0] != NUL && signfile[0] != '-')
+ {
+ sign = (XImage *)alloc(sizeof(XImage));
+ if (sign != NULL)
+ {
+ XpmColorSymbol color[5] =
+ {
+ {"none", NULL, 0},
+ {"iconColor1", NULL, 0},
+ {"bottomShadowColor", NULL, 0},
+ {"topShadowColor", NULL, 0},
+ {"selectColor", NULL, 0}
+ };
+ attrs.valuemask = XpmColorSymbols;
+ attrs.numsymbols = 2;
+ attrs.colorsymbols = color;
+ attrs.colorsymbols[0].pixel = gui.back_pixel;
+ attrs.colorsymbols[1].pixel = gui.norm_pixel;
+ status = XpmReadFileToImage(gui.dpy, (char *)signfile,
+ &sign, NULL, &attrs);
+
+ if (status == 0)
+ {
+ /* Sign width is fixed at two columns now.
+ if (sign->width > gui.sign_width)
+ gui.sign_width = sign->width + 8; */
+ }
+ else
+ {
+ vim_free(sign);
+ sign = NULL;
+ EMSG(_(e_signdata));
+ }
+ }
+ }
+
+ return (void *)sign;
+}
+
+ void
+gui_mch_destroy_sign(sign)
+ void *sign;
+{
+ XFree(((XImage *)sign)->data);
+ vim_free(sign);
+}
+#endif
+
+
+#ifdef FEAT_MOUSESHAPE
+/* The last set mouse pointer shape is remembered, to be used when it goes
+ * from hidden to not hidden. */
+static int last_shape = 0;
+#endif
+
+/*
+ * Use the blank mouse pointer or not.
+ */
+ void
+gui_mch_mousehide(hide)
+ int hide; /* TRUE = use blank ptr, FALSE = use parent ptr */
+{
+ if (gui.pointer_hidden != hide)
+ {
+ gui.pointer_hidden = hide;
+ if (hide)
+ XDefineCursor(gui.dpy, gui.wid, gui.blank_pointer);
+ else
+#ifdef FEAT_MOUSESHAPE
+ mch_set_mouse_shape(last_shape);
+#else
+ XUndefineCursor(gui.dpy, gui.wid);
+#endif
+ }
+}
+
+#if defined(FEAT_MOUSESHAPE) || defined(PROTO)
+
+/* Table for shape IDs. Keep in sync with the mshape_names[] table in
+ * misc2.c! */
+static int mshape_ids[] =
+{
+ XC_left_ptr, /* arrow */
+ 0, /* blank */
+ XC_xterm, /* beam */
+ XC_sb_v_double_arrow, /* updown */
+ XC_sizing, /* udsizing */
+ XC_sb_h_double_arrow, /* leftright */
+ XC_sizing, /* lrsizing */
+ XC_watch, /* busy */
+ XC_X_cursor, /* no */
+ XC_crosshair, /* crosshair */
+ XC_hand1, /* hand1 */
+ XC_hand2, /* hand2 */
+ XC_pencil, /* pencil */
+ XC_question_arrow, /* question */
+ XC_right_ptr, /* right-arrow */
+ XC_center_ptr, /* up-arrow */
+ XC_left_ptr /* last one */
+};
+
+ void
+mch_set_mouse_shape(shape)
+ int shape;
+{
+ int id;
+
+ if (!gui.in_use)
+ return;
+
+ if (shape == MSHAPE_HIDE || gui.pointer_hidden)
+ XDefineCursor(gui.dpy, gui.wid, gui.blank_pointer);
+ else
+ {
+ if (shape >= MSHAPE_NUMBERED)
+ {
+ id = shape - MSHAPE_NUMBERED;
+ if (id >= XC_num_glyphs)
+ id = XC_left_ptr;
+ else
+ id &= ~1; /* they are always even (why?) */
+ }
+ else
+ id = mshape_ids[shape];
+
+ XDefineCursor(gui.dpy, gui.wid, XCreateFontCursor(gui.dpy, id));
+ }
+ if (shape != MSHAPE_HIDE)
+ last_shape = shape;
+}
+#endif
+
+#if defined(FEAT_TOOLBAR) || defined(PROTO)
+/*
+ * Icons used by the toolbar code.
+ */
+#include "../pixmaps/tb_new.xpm"
+#include "../pixmaps/tb_open.xpm"
+#include "../pixmaps/tb_close.xpm"
+#include "../pixmaps/tb_save.xpm"
+#include "../pixmaps/tb_print.xpm"
+#include "../pixmaps/tb_cut.xpm"
+#include "../pixmaps/tb_copy.xpm"
+#include "../pixmaps/tb_paste.xpm"
+#include "../pixmaps/tb_find.xpm"
+#include "../pixmaps/tb_find_next.xpm"
+#include "../pixmaps/tb_find_prev.xpm"
+#include "../pixmaps/tb_find_help.xpm"
+#include "../pixmaps/tb_exit.xpm"
+#include "../pixmaps/tb_undo.xpm"
+#include "../pixmaps/tb_redo.xpm"
+#include "../pixmaps/tb_help.xpm"
+#include "../pixmaps/tb_macro.xpm"
+#include "../pixmaps/tb_make.xpm"
+#include "../pixmaps/tb_save_all.xpm"
+#include "../pixmaps/tb_jump.xpm"
+#include "../pixmaps/tb_ctags.xpm"
+#include "../pixmaps/tb_load_session.xpm"
+#include "../pixmaps/tb_save_session.xpm"
+#include "../pixmaps/tb_new_session.xpm"
+#include "../pixmaps/tb_blank.xpm"
+#include "../pixmaps/tb_maximize.xpm"
+#include "../pixmaps/tb_split.xpm"
+#include "../pixmaps/tb_minimize.xpm"
+#include "../pixmaps/tb_shell.xpm"
+#include "../pixmaps/tb_replace.xpm"
+#include "../pixmaps/tb_vsplit.xpm"
+#include "../pixmaps/tb_maxwidth.xpm"
+#include "../pixmaps/tb_minwidth.xpm"
+
+/*
+ * Those are the pixmaps used for the default buttons.
+ */
+static char **(built_in_pixmaps[]) =
+{
+ tb_new_xpm,
+ tb_open_xpm,
+ tb_save_xpm,
+ tb_undo_xpm,
+ tb_redo_xpm,
+ tb_cut_xpm,
+ tb_copy_xpm,
+ tb_paste_xpm,
+ tb_print_xpm,
+ tb_help_xpm,
+ tb_find_xpm,
+ tb_save_all_xpm,
+ tb_save_session_xpm,
+ tb_new_session_xpm,
+ tb_load_session_xpm,
+ tb_macro_xpm,
+ tb_replace_xpm,
+ tb_close_xpm,
+ tb_maximize_xpm,
+ tb_minimize_xpm,
+ tb_split_xpm,
+ tb_shell_xpm,
+ tb_find_prev_xpm,
+ tb_find_next_xpm,
+ tb_find_help_xpm,
+ tb_make_xpm,
+ tb_jump_xpm,
+ tb_ctags_xpm,
+ tb_vsplit_xpm,
+ tb_maxwidth_xpm,
+ tb_minwidth_xpm,
+ tb_exit_xpm
+};
+
+static void createXpmImages __ARGS((char_u *path, char **xpm, Pixmap *sen, Pixmap *insen));
+
+/*
+ * Allocated a pixmap for toolbar menu "menu".
+ * Return in "sen" and "insen". "insen" can be NULL.
+ */
+ void
+get_toolbar_pixmap(menu, sen, insen)
+ vimmenu_T *menu;
+ Pixmap *sen;
+ Pixmap *insen;
+{
+ char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
+ char **xpm = NULL; /* xpm array */
+
+ buf[0] = NUL; /* start with NULL path */
+
+ if (menu->iconfile != NULL)
+ {
+ /* Use the "icon=" argument. */
+ gui_find_iconfile(menu->iconfile, buf, "xpm");
+ createXpmImages(buf, NULL, sen, insen);
+
+ /* If it failed, try using the menu name. */
+ if (*sen == (Pixmap)0 && gui_find_bitmap(menu->name, buf, "xpm") == OK)
+ createXpmImages(buf, NULL, sen, insen);
+ if (*sen != (Pixmap)0)
+ return;
+ }
+
+ if (menu->icon_builtin || gui_find_bitmap(menu->name, buf, "xpm") == FAIL)
+ {
+ if (menu->iconidx >= 0 && menu->iconidx
+ < (sizeof(built_in_pixmaps) / sizeof(built_in_pixmaps[0])))
+ xpm = built_in_pixmaps[menu->iconidx];
+ else
+ xpm = tb_blank_xpm;
+ }
+
+ if (xpm != NULL || buf[0] != NUL)
+ createXpmImages(buf, xpm, sen, insen);
+}
+
+/* Indices for named colors */
+#define BACKGROUND 0
+#define FOREGROUND 1
+#define BOTTOM_SHADOW 2
+#define TOP_SHADOW 3
+#define HIGHLIGHT 4
+
+/*
+ * Read an Xpm file, doing color substitutions for the foreground and
+ * background colors. If there is an error reading a color xpm file,
+ * drop back and read the monochrome file. If successful, create the
+ * insensitive Pixmap too.
+ */
+ static void
+createXpmImages(path, xpm, sen, insen)
+ char_u *path;
+ char **xpm;
+ Pixmap *sen;
+ Pixmap *insen; /* can be NULL */
+{
+ Window rootWindow;
+ XpmAttributes attrs;
+ XpmColorSymbol color[5] =
+ {
+ {"none", "none", 0},
+ {"iconColor1", NULL, 0},
+ {"bottomShadowColor", NULL, 0},
+ {"topShadowColor", NULL, 0},
+ {"selectColor", NULL, 0}
+ };
+ int screenNum;
+ int status;
+ Pixmap mask;
+ Pixmap map;
+
+ gui_mch_get_toolbar_colors(
+ &color[BACKGROUND].pixel,
+ &color[FOREGROUND].pixel,
+ &color[BOTTOM_SHADOW].pixel,
+ &color[TOP_SHADOW].pixel,
+ &color[HIGHLIGHT].pixel);
+
+ /* Setup the color subsititution table */
+ attrs.valuemask = XpmColorSymbols;
+ attrs.colorsymbols = color;
+ attrs.numsymbols = 5;
+
+ screenNum = DefaultScreen(gui.dpy);
+ rootWindow = RootWindow(gui.dpy, screenNum);
+
+ /* Create the "sensitive" pixmap */
+ if (xpm != NULL)
+ status = XpmCreatePixmapFromData(gui.dpy, rootWindow, xpm,
+ &map, &mask, &attrs);
+ else
+ status = XpmReadFileToPixmap(gui.dpy, rootWindow, (char *)path,
+ &map, &mask, &attrs);
+ if (status == XpmSuccess && map != 0)
+ {
+ XGCValues gcvalues;
+ GC back_gc;
+ GC mask_gc;
+
+ /* Need to create new Pixmaps with the mask applied. */
+ gcvalues.foreground = color[BACKGROUND].pixel;
+ back_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
+ mask_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
+ XSetClipMask(gui.dpy, mask_gc, mask);
+
+ /* Create the "sensitive" pixmap. */
+ *sen = XCreatePixmap(gui.dpy, rootWindow,
+ attrs.width, attrs.height,
+ DefaultDepth(gui.dpy, screenNum));
+ XFillRectangle(gui.dpy, *sen, back_gc, 0, 0,
+ attrs.width, attrs.height);
+ XCopyArea(gui.dpy, map, *sen, mask_gc, 0, 0,
+ attrs.width, attrs.height, 0, 0);
+
+#ifdef FEAT_GUI_MOTIF /* not used for Athena */
+ if (insen != NULL)
+ {
+ int x, y;
+ int startX;
+
+ /* Create the "insensitive" pixmap. It's a copy of the "sensitive"
+ * pixmap with half the pixels set to the background color. */
+ *insen = XCreatePixmap(gui.dpy, rootWindow,
+ attrs.width, attrs.height,
+ DefaultDepth(gui.dpy, screenNum));
+ XCopyArea(gui.dpy, *sen, *insen, back_gc, 0, 0,
+ attrs.width, attrs.height, 0, 0);
+ for (y = 0; y < attrs.height; y++)
+ {
+ if (y % 2 == 0)
+ startX = 0;
+ else
+ startX = 1;
+ for (x = startX; x < attrs.width; x += 2)
+ XDrawPoint(gui.dpy, *insen, back_gc, x, y);
+ }
+
+ }
+#endif
+ XFreeGC(gui.dpy, back_gc);
+ XFreeGC(gui.dpy, mask_gc);
+ XFreePixmap(gui.dpy, map);
+ }
+ else
+ {
+ *sen = 0;
+ if (insen != NULL)
+ *insen = 0;
+ }
+
+ XpmFreeAttributes(&attrs);
+}
+#endif
+
+#if (defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL)) || defined(PROTO)
+/*
+ * Set the balloon-eval used for the tooltip of a toolbar menu item.
+ * The check for a non-toolbar item was added, because there is a crash when
+ * passing a normal menu item here. Can't explain that, but better avoid it.
+ */
+ void
+gui_mch_menu_set_tip(menu)
+ vimmenu_T *menu;
+{
+ if (menu->id != NULL && menu->parent != NULL
+ && menu_is_toolbar(menu->parent->name))
+ {
+ /* Always destroy and create the balloon, in case the string was
+ * changed. */
+ if (menu->tip != NULL)
+ {
+ gui_mch_destroy_beval_area(menu->tip);
+ menu->tip = NULL;
+ }
+ if (menu->strings[MENU_INDEX_TIP] != NULL)
+ menu->tip = gui_mch_create_beval_area(
+ menu->id,
+ menu->strings[MENU_INDEX_TIP],
+ NULL,
+ NULL);
+ }
+}
+#endif
diff --git a/src/guiw16rc.h b/src/guiw16rc.h
new file mode 100644
index 000000000..1e55200bd
--- /dev/null
+++ b/src/guiw16rc.h
@@ -0,0 +1,17 @@
+
+#define IDR_VIM 150
+
+#define IDR_VIM_ERROR 151
+#define IDR_VIM_ALERT 152
+#define IDR_VIM_INFO 153
+#define IDR_VIM_QUESTION 154
+
+#define IDR_ICOBUDDYBASE 200
+
+#define IDR_ICOBUDDY_DEF1 (IDR_ICOBUDDYBASE + 3)
+#define IDR_ICOBUDDY_DEF2 (IDR_ICOBUDDYBASE + 0)
+#define IDR_ICOBUDDY_DEF3 (IDR_ICOBUDDYBASE + 1)
+#define IDR_ICOBUDDY_DEF4 (IDR_ICOBUDDYBASE + 2)
+
+#define IDR_ICOBUDDY_GRIN (IDR_ICOBUDDYBASE + 4)
+#define IDR_ICOBUDDY_ALARM (IDR_ICOBUDDYBASE + 5)
diff --git a/src/gvim.exe.mnf b/src/gvim.exe.mnf
new file mode 100644
index 000000000..70358c1e2
--- /dev/null
+++ b/src/gvim.exe.mnf
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity
+ processorArchitecture="X86"
+ version="6.2.0.0"
+ type="win32"
+ name="Vim"
+ />
+ <description>Vi Improved - A Text Editor</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ processorArchitecture="X86"
+ />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/src/hangulin.c b/src/hangulin.c
new file mode 100644
index 000000000..4ae16a18e
--- /dev/null
+++ b/src/hangulin.c
@@ -0,0 +1,1621 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#ifndef HANGUL_DEFAULT_KEYBOARD
+# define HANGUL_DEFAULT_KEYBOARD 3
+#endif
+
+#define AUTOMATA_NEW 0
+#define AUTOMATA_CORRECT 1
+#define AUTOMATA_SPECIAL 2
+#define AUTOMATA_CORRECT_NEW 3
+#define AUTOMATA_ERROR 4
+#define AUTOMATA_NULL 5
+
+#define F_F 0x1 /* Ãʼº (initial sound) */
+#define F_M 0x2 /* Áß¼º (medial vowel) */
+#define F_L 0x4 /* Á¾¼º (final consonant) */
+#define F_A 0x8 /* ASCII */
+#define F_NULL 1
+#define M_NULL 2
+#define L_NULL 1
+
+static int hangul_input_state = 0;
+static int f=F_NULL, m=M_NULL, l=L_NULL;
+static int sp=0;
+static char_u stack[20] = {0};
+static int last_l = -1, last_ll = -1;
+static int hangul_keyboard_type = HANGUL_DEFAULT_KEYBOARD;
+
+static void convert_ks_to_3 __ARGS((const char_u *src, int *fp, int *mp, int *lp));
+static int convert_3_to_ks __ARGS((int fv, int mv, int lv, char_u *des));
+static int hangul_automata2 __ARGS((char_u *buf, unsigned int *c));
+static int hangul_automata3 __ARGS((char_u *buf, unsigned int *c));
+
+#define push(x) {stack[ sp++ ] = *(x); stack[sp++] = *((x)+1);}
+#define pop(x) {*((x) + 1) = stack[--sp]; *(x) = stack[--sp];}
+#define query(x) {*((x) + 1) = stack[sp - 1]; *(x) = stack[sp - 2];}
+
+#define convert_3_to_code convert_3_to_ks
+
+
+/**********************************************************************/
+/****** 3 ¹ú½ÄÀÚÆÇÀ» À§ÇÑ ·çƾ (Routines for 3 bulsik keyboard) ******/
+/**********************************************************************/
+
+/* 3 ¹ú½Ä¿¡¼­ ÀÚÆÇ º¯È¯ (3 bulsik keyboard conversion) */
+
+static char_u value_table_for_3[] =
+{
+ 24 , '"' , '#' , '$' , '%' , '&' , /* ! " # $ % & */
+ 18 , '(' , ')' , '*' , '+' , ',' , /* ' ( ) * + , */
+ '-' , '.' , 13 , 17 , 29 , 22 , /* - . / 0 1 2 */
+ 19 , 19 , 26 , 5 , 12 , 28 , /* 3 4 5 6 7 8 */
+ 20 , ':' , 9 , '2' , '=' , '3' , /* 9 : ; < = > */
+ '?' , '@' , 8 , '!' , 11 , 10 , /* ? @ A B C D */
+ 26 , 3 , '/' , 39 , '8' , '4' , /* E F G H I J */
+ '5' , '6' , '1' , '0' , '9' , '>' , /* K L M N O P */
+ 28 , 6 , 7 , ';' , '7' , 16 , /* Q R S T U V */
+ 27 , 20 , '<' , 25 , '[' , 92 , /* W X Y Z [ \ */
+ ']' , '^' , '_' , '`' , 23 , 20 , /* ] ^ _ ` a b */
+ 10 , 29 , 11 , 3 , 27 , 4 , /* c d e f g h */
+ 8 , 13 , 2 , 14 , 20 , 11 , /* i j k l m n */
+ 16 , 19 , 21 , 4 , 5 , 7 , /* o p q r s t */
+ 5 , 13 , 9 , 2 , 7 , 17 , /* u v w x y z */
+};
+
+static short_u kind_table_for_3[] =
+{
+ F_L, F_A, F_A, F_A, F_A, F_A, /* ! " # $ % & */
+ F_F, F_A, F_A, F_A, F_A, F_A, /* ' ( ) * + , */
+ F_A, F_A, F_M, F_F, F_L, F_L, /* - . / 0 1 2 */
+ F_L, F_M, F_M, F_M, F_M, F_M, /* 3 4 5 6 7 8 */
+ F_M, F_A, F_F, F_A, F_A, F_A, /* 9 : ; < = > */
+ F_A, F_A, F_L, F_A, F_L, F_L, /* ? @ A B C D */
+ F_L, F_L, F_A, F_A, F_A, F_A, /* E F G H I J */
+ F_A, F_A, F_A, F_A, F_A, F_A, /* K L M N O P */
+ F_L, F_M, F_L, F_A, F_A, F_L, /* Q R S T U V */
+ F_L, F_L, F_A, F_L, F_A, F_A, /* W X Y Z [ \ */
+ F_A, F_A, F_A, F_A, F_L, F_M, /* ] ^ _ ` a b */
+ F_M, F_M, F_M, F_M, F_M, F_F, /* c d e f g h */
+ F_F, F_F, F_F, F_F, F_F, F_F, /* i j k l m n */
+ F_F, F_F, F_L, F_M, F_L, F_M, /* o p q r s t */
+ F_F, F_M, F_L, F_L, F_F, F_L, /* u v w x y z */
+};
+
+/* 3 ¹ú½Ä¿¡¼­ (ÇöÀçÃʼº, ÀԷ¿µ¹®) -> º¹ÇÕÃʼº ó¸®
+ * 3 bulsik: (current initial sound, input english) -> compound initial sound.
+ */
+
+ static int
+comfcon3(v, c)
+ int v;
+ int c;
+{
+ if (v == 2 && c == 2)
+ return 3;
+ if (v == 5 && c == 5)
+ return 6;
+ if (v == 9 && c == 9)
+ return 10;
+ if (v == 11 && c == 11)
+ return 12;
+ if (v == 14 && c == 14)
+ return 15;
+ return 0;
+}
+
+/* 3 ¹ú½Ä¿¡¼­ (ÇöÀç¸ðÀ½, ÀÔ·Â ¿µ¹®) -> º¹ÇÕ ¸ðÀ½ ó¸®
+ * 3 bulsik: (current vowel, input english) -> compound vowel.
+ */
+
+ static int
+comvow3(v, c)
+ int v;
+ int c;
+{
+ switch (v)
+ {
+ case 13: /* ¤Ç */
+ switch (c) {
+ case 3: /* ¤Ç¤¿ */
+ return 14;
+ case 4: /* ¤Ç¤À */
+ return 15;
+ case 29: /* ¤Ç¤Ó */
+ return 18;
+ }
+ break;
+
+ case 20: /* ¤Ì */
+ switch (c) {
+ case 7: /* ¤Ì¤Ã */
+ return 21;
+ case 10: /* ¤Ì¤Ä */
+ return 22;
+ case 29: /* ¤Ì¤Ó */
+ return 23;
+ }
+ break;
+
+ /* 3 ¹ú½Ä ÀÚÆÇÀº ¤Ñ¤Ó °¡ ÀÖÀ¸¹Ç·Î ... */
+ }
+ return 0;
+}
+
+/* 3 ¹ú½Ä¿¡¼­ (ÇöÀç ¹Þħ, ¿µ¹®ÀÚ ÀÔ·Â) -> ¹Þħ
+ * 3 bulsik: (current prop(?), input english) -> prop(?).
+ * I want to say, the 'prop' is similar to 'final consonant', but not vowel.
+ * (I cannot find the real english from my dictionary. Sorry!)
+ * VIM: V = initial sound, I = medial vowel, M = final consonant.
+ */
+
+ static int
+comcon3(k, c)
+ int k;
+ int c;
+{
+ switch (k)
+ {
+ case 2: /* ¤¡ */
+ switch (c) {
+ case 2:
+ return 3; /* ¤¡¤¡ */
+ case 21:
+ return 4; /* ¤¡¤µ */
+ }
+ break;
+
+ case 5: /* ¤¤ */
+ switch (c) {
+ case 24: /* ¤¤¤¸ */
+ return 6;
+ case 29:
+ return 7; /* ¤¤¤¾ */
+ }
+ break;
+
+ case 9: /* ¤© */
+ switch (c) {
+ case 2: /* ¤©¤¡ */
+ return 10;
+ case 17: /* ¤©¤± */
+ return 11;
+ case 19: /* ¤©¤² */
+ return 12;
+ case 21: /* ¤©¤µ */
+ return 13;
+ case 27: /* ¤©¤¼ */
+ return 14;
+ case 28: /* ¤©¤½ */
+ return 15;
+ case 29: /* ¤©¤¾ */
+ return 16;
+ }
+ break;
+
+ case 19:
+ switch (c) {
+ case 21: /* ¤²¤µ */
+ return 20;
+ }
+ break;
+ }
+ return 0;
+}
+
+/**********************************************************************/
+/****** 2 ¹ú½ÄÀÚÆÇÀ» À§ÇÑ ·çƾ (Routines for 2 bulsik keyboard) ******/
+/**********************************************************************/
+
+ static int
+kind_table_for_2(c)
+ int c;
+{
+ static char_u table[] =
+ {
+ /* a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s */
+ 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0,
+ /* t, u, v, w, x, y, z */
+ 0, 1, 0, 0, 0, 1, 0
+ };
+
+ if (c <= 'Z')
+ c -= 'A';
+ else
+ c -= 'a';
+
+ return table[c];
+}
+
+/* 2 ¹ú½Ä¿¡¼­ ¿µ¹®ÀÚ -> Á¶ÇÕÇü Ãʼº º¯È¯
+ * (2 bulsik: conversion english char. to initial sound of compound type)
+ * °á°ú: ÃʼºÀÌ ¾Æ´Ï¸é 0 (If it is not initial sound, return 0).
+ */
+ static int
+fcon(c)
+ int c;
+{
+ static char_u table[] =
+ {
+ /*E */ 6 , /*F */ 0 , /*G */ 0 , /*H */ 0 , /*I */ 0 , /*J */ 0 , /*K */ 0 ,
+ /*L */ 0 , /*M */ 0 , /*N */ 0 , /*O */ 0 , /*P */ 0 , /*Q */ 10, /*R */ 3 ,
+ /*S */ 0 , /*T */ 12, /*U */ 0 , /*V */ 0 , /*W */ 15, /*X */ 0 , /*Y */ 0 ,
+ /*Z */ 0 , /*[ */ 0 , /*\ */ 0 , /*] */ 0 , /*^ */ 0 , /*_ */ 0 , /*` */ 0 ,
+ /*a */ 8 , /*b */ 0 , /*c */ 16, /*d */ 13, /*e */ 5 , /*f */ 7 , /*g */ 20,
+ /*h */ 0 , /*i */ 0 , /*j */ 0 , /*k */ 0 , /*l */ 0 , /*m */ 0 , /*n */ 0 ,
+ /*o */ 0 , /*p */ 0 , /*q */ 9 , /*r */ 2 , /*s */ 4 , /*t */ 11, /*u */ 0 ,
+ /*v */ 19, /*w */ 14, /*x */ 18, /*y */ 0 , /*z */ 17
+ };
+
+ if (c < 'E' || c > 'z')
+ return 0;
+ return table[c - 'E'];
+}
+
+/* 2 ¹ú½Ä¿¡¼­ ¿µ¹®ÀÚ -> Áß¼º º¯È¯
+ * (2 bulsik: conversion english char. to medial vowel)
+ * °á°ú: Áß¼ºÀÌ ¾Æ´Ï¸é 0 (If it is not medial vowel, return 0).
+ */
+ static int
+vow(c)
+ int c;
+{
+ static char_u table[] =
+ {
+ /*O */ 6 , /*P */ 12, /*Q */ 0 , /*R */ 0 , /*S */ 0 , /*T */ 0 , /*U */ 0 ,
+ /*V */ 0 , /*W */ 0 , /*X */ 0 , /*Y */ 0 , /*Z */ 0 , /*[ */ 0 , /*\ */ 0 ,
+ /*] */ 0 , /*^ */ 0 , /*_ */ 0 , /*` */ 0 , /*a */ 0 , /*b */ 26, /*c */ 0 ,
+ /*d */ 0 , /*e */ 0 , /*f */ 0 , /*g */ 0 , /*h */ 13, /*i */ 5 , /*j */ 7 ,
+ /*k */ 3 , /*l */ 29, /*m */ 27, /*n */ 20, /*o */ 4 , /*p */ 10, /*q */ 0 ,
+ /*r */ 0 , /*s */ 0 , /*t */ 0 , /*u */ 11, /*v */ 0 , /*w */ 0 , /*x */ 0 ,
+ /*y */ 19};
+
+ if (c < 'O' || c > 'y')
+ return 0;
+ return table[c - 'O'];
+}
+
+/* 2¹ú½Ä¿¡¼­ ¿µ¹®ÀÚ -> ¹Þħ º¯È¯
+ * (2 bulsik: conversion english char. to prop)
+ * °á°ú: ¹ÞħÀÌ ¾Æ´Ï¸é 0 (If not prop, return 0)
+ */
+ static int
+lcon(c)
+ int c;
+{
+ static char_u table[] =
+ {
+ /*R */ 3 , /*S */ 0 , /*T */ 22, /*U */ 0 , /*V */ 0 , /*W */ 0 , /*X */ 0 ,
+ /*Y */ 0 , /*Z */ 0 , /*[ */ 0 , /*\ */ 0 , /*] */ 0 , /*^ */ 0 , /*_ */ 0 ,
+ /*` */ 0 , /*a */ 17, /*b */ 0 , /*c */ 25, /*d */ 23, /*e */ 8 , /*f */ 9 ,
+ /*g */ 29, /*h */ 0 , /*i */ 0 , /*j */ 0 , /*k */ 0 , /*l */ 0 , /*m */ 0 ,
+ /*n */ 0 , /*o */ 0 , /*p */ 0 , /*q */ 19, /*r */ 2 , /*s */ 5 , /*t */ 21,
+ /*u */ 0 , /*v */ 28, /*w */ 24, /*x */ 27, /*y */ 0 , /*z */ 26
+ };
+
+ if (c < 'R' || c > 'z')
+ return 0;
+ return table[c - 'R'];
+}
+
+/* 2 ¹ú½Ä¿¡¼­ (ÇöÀç ¹Þħ, ¿µ¹®ÀÚ ÀÔ·Â) -> ¹Þħ º¯È¯
+ * (2 bulsik: conversion (curr. prop, input english) to prop)
+ */
+
+ static int
+comcon2(k, c)
+ int k;
+ int c;
+{
+ switch (k)
+ {
+ case 2: /* ¤¡ */
+ switch (c) {
+ case 't':
+ return 4; /* ¤¡¤µ */
+ }
+ break;
+
+ case 5: /* ¤¤ */
+ switch (c) {
+ case 'w': /* ¤¤¤¸ */
+ return 6;
+ case 'g': /* ¤¤¤¾ */
+ return 7;
+ }
+ break;
+
+ case 9: /* ¤© */
+ switch (c) {
+ case 'r': /* ¤©¤¡ */
+ return 10;
+ case 'a': /* ¤©¤± */
+ return 11;
+ case 'q': /* ¤©¤² */
+ return 12;
+ case 't': /* ¤©¤µ */
+ return 13;
+ case 'x': /* ¤©¤¼ */
+ return 14;
+ case 'v': /* ¤©¤½ */
+ return 15;
+ case 'g': /* ¤©¤¾ */
+ return 16;
+ }
+ break;
+
+ case 19: /* ¤² */
+ switch (c) {
+ case 't': /* ¤²¤µ */
+ return 20;
+ }
+ break;
+ }
+ return 0;
+}
+
+/* 2¹ú½Ä¿¡¼­ (ÇöÀç Áß¼º, ¿µ¹® ÀÔ·Â) -> Áß¼º º¯È¯
+ * (2 bulsik: conversion (curr. medial vowel, input english) to medial
+ * vowel)
+ */
+
+ static int
+comvow2(v, c)
+ int v;
+ int c;
+{
+ switch (v)
+ {
+ case 13: /* ¤Ç */
+ switch (c) {
+ case 'k': /* ¤Ç¤¿ */
+ return 14;
+ case 'o': /* ¤Ç¤À */
+ return 15;
+ case 'l': /* ¤Ç¤Ó */
+ return 18;
+ }
+ break;
+
+ case 20: /* ¤Ì */
+ switch (c) {
+ case 'j': /* ¤Ì¤Ã */
+ return 21;
+ case 'p': /* ¤Ì¤Ä */
+ return 22;
+ case 'l': /* ¤Ì¤Ó */
+ return 23;
+ }
+ break;
+
+ case 27: /* ¤Ñ */
+ switch (c) {
+ case 'l': /* ¤Ñ¤Ó */
+ return 28;
+ }
+ break;
+ }
+ return 0;
+}
+
+ int
+hangul_input_state_get()
+{
+ return hangul_input_state;
+}
+
+ void
+hangul_input_state_set(state)
+ int state;
+{
+ hangul_input_state = state;
+ hangul_input_clear();
+}
+
+ int
+im_get_status()
+{
+ return hangul_input_state_get();
+}
+
+ void
+hangul_input_state_toggle()
+{
+ if (hangul_input_state_get())
+ {
+ hangul_input_state_set(0);
+ if (composing_hangul)
+ {
+ push_raw_key(composing_hangul_buffer, 2);
+ composing_hangul = 0;
+ }
+ }
+ else
+ hangul_input_state_set(1);
+
+ if (showmode())
+ {
+ setcursor();
+ out_flush();
+ }
+
+ gui_update_cursor(TRUE, FALSE);
+}
+
+ static int
+hangul_automata2(buf, c)
+ char_u *buf;
+ int_u *c;
+{
+ int t,t2;
+
+ if (*c == BS)
+ {
+ if (sp == 0)
+ return AUTOMATA_SPECIAL;
+ else if (sp < 4)
+ {
+ hangul_input_clear();
+ return AUTOMATA_NULL;
+ }
+ pop(buf);
+ query(buf);
+ convert_ks_to_3(buf, &f, &m, &l);
+ last_l = last_ll;
+ last_ll = -1;
+ return AUTOMATA_CORRECT;
+ }
+ if ((!(*c >= 'A' && *c <= 'Z')) && (!(*c >= 'a' && *c <= 'z')))
+ {
+ hangul_input_clear();
+ return AUTOMATA_SPECIAL;
+ }
+ t = *c;
+ switch (kind_table_for_2(t))
+ {
+ case 0: /* ÀÚÀ½ (consonant) */
+ if (f == F_NULL)
+ {
+ if (m != M_NULL)
+ hangul_input_clear();
+ f = fcon(t);
+ convert_3_to_code(f, M_NULL, L_NULL, buf);
+ push(buf);
+ last_ll = last_l = -1;
+ return AUTOMATA_NEW;
+ }
+ if (m == M_NULL)
+ return AUTOMATA_ERROR;
+ if (l == L_NULL)
+ {
+ t2 = lcon(t);
+ if (!t2) /* ¹ÞħÀ¸·Î ÀûÇÕÇÏÁö¾Ê´Ù (cannot use it as a prop) */
+ {
+ hangul_input_clear();
+ last_ll = last_l = -1;
+ f = fcon(t);
+ convert_3_to_code(f, m, l, buf);
+ push(buf);
+ return AUTOMATA_NEW;
+ }
+ if (2 == convert_3_to_code(f, m, t2, buf))
+ {
+ last_ll = -1;
+ last_l = t;
+ l = t2;
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ else /* ¹ÞħÀ¸·Î ¾²·ÁÇÏ¿´À¸³ª code¿¡ ¾ø´Â ±ÛÀÚÀÌ´Ù */
+ { /* cannot find such a prop in the code table */
+ last_ll = last_l = -1;
+ hangul_input_clear();
+ f = fcon(t);
+ convert_3_to_code(f, m, l, buf);
+ push(buf);
+ return AUTOMATA_NEW;
+ }
+ }
+ /* ÃÊ Áß Á¾¼ºÀÌ ¸ðµÎ °®Ãß¾îÁ® ÀÖ´Ù
+ * I have all the 'initial sound' and 'medial vowel' and 'final
+ * consonant'.
+ */
+ t2 = comcon2(l, t);
+ if (t2)
+ {
+ if (2 == convert_3_to_code(f, m, t2, buf))
+ {
+ l = t2;
+ last_ll = last_l;
+ last_l = t;
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ }
+ last_ll = last_l = -1;
+ hangul_input_clear();
+ f = fcon(t);
+ convert_3_to_code(f, m, l, buf);
+ push(buf);
+ return AUTOMATA_NEW;
+
+ case 1:
+ if (f == F_NULL)
+ {
+ hangul_input_clear();
+ m = vow(t);
+ convert_3_to_code (f, m, L_NULL, buf);
+ push (buf);
+ last_ll = last_l = -1;
+ return AUTOMATA_NEW;
+ }
+ if (m == M_NULL)
+ {
+ m = vow(t);
+ if (2 == convert_3_to_code(f, m, L_NULL, buf))
+ {
+ last_ll = last_l = -1;
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ m = M_NULL;
+ return AUTOMATA_ERROR;
+ }
+ if (l == L_NULL)
+ {
+ t2 = comvow2(m, t);
+ if (t2)
+ {
+ if (2 != convert_3_to_code(f, t2, L_NULL, buf))
+ return AUTOMATA_ERROR;
+
+ m = t2;
+ push(buf);
+ last_ll = last_l = -1;
+ return AUTOMATA_CORRECT;
+ }
+ return AUTOMATA_ERROR;
+ }
+ pop(buf);
+ pop(buf);
+ sp = 0;
+ if (last_l == -1)
+ {
+ /* À½... ÀÌ°Ô ÇÊ¿äÇϳª?? (Hmm... Is it needed?) */
+ convert_ks_to_3(buf, &f, &m, &l);
+ }
+ else
+ {
+ char_u tmp[3];
+ f = fcon(last_l);
+ convert_3_to_code (f, M_NULL, L_NULL, tmp);
+ push (tmp);
+ }
+ m = vow(t);
+ l = L_NULL;
+ convert_3_to_code(f, m, l, buf + 2);
+ push(buf + 2);
+ return AUTOMATA_CORRECT_NEW;
+
+ default:
+ EMSG(_("E256: Hangul automata ERROR"));
+ break;
+ }
+ return AUTOMATA_ERROR; /* RrEeAaLlLlYy EeRrRrOoRr */
+}
+
+ static int
+hangul_automata3(buf, c)
+ char_u *buf;
+ int_u *c;
+{
+ int t, t2;
+
+ if (*c >= '!' && *c <= 'z')
+ {
+ *c -= '!';
+ t = value_table_for_3[*c];
+ switch (kind_table_for_3[*c])
+ {
+ case F_F: /* Ãʼº¹®ÀÚ (char. of an initial sound) */
+ if (m != M_NULL || sp == 0)
+ {
+ /* ÃʼºÀÌ ºñ¾ú°Å³ª ´ÙÀ½ ±ÛÀÚ ¸ðÀ¸±â ½ÃÀÛ
+ * Empty 'initial sound', so starting automata.
+ */
+ hangul_input_clear();
+ f = t;
+ convert_3_to_code(f, M_NULL, L_NULL, buf);
+ push(buf);
+ return AUTOMATA_NEW;
+ }
+ if ((t2 = comfcon3(f,t)) != 0) /* º¹ÀÚÀ½ (double? consonant) */
+ {
+ f=t2;
+ convert_3_to_code(f, M_NULL, L_NULL, buf);
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ return AUTOMATA_ERROR;
+
+ case F_M: /* ¸ðÀ½ (vowel) */
+ if (m == M_NULL)
+ {
+ if (2 != convert_3_to_code(f, t, L_NULL,buf))
+ return AUTOMATA_ERROR;
+
+ m = t;
+ push(buf);
+ if (f == F_NULL)
+ return AUTOMATA_NEW;
+ else
+ return AUTOMATA_CORRECT;
+ }
+ if ((t2 = comvow3(m,t))) /* º¹¸ðÀ½ (a diphthong) */
+ {
+ m = t2;
+ convert_3_to_code(f, m, L_NULL, buf);
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ return AUTOMATA_ERROR;
+
+ case F_L: /* ¹Þħ (prop?) */
+ if (m == M_NULL)
+ return AUTOMATA_ERROR; /* Áß¼º¾ø´Â Á¾¼º */
+ if (l == L_NULL)
+ {
+ if (2 != convert_3_to_code(f, m, t, buf))
+ {
+ l = L_NULL;
+ return AUTOMATA_ERROR;
+ }
+ push(buf);
+ l = t;
+ return AUTOMATA_CORRECT;
+ }
+ if ((t2 = comcon3(l,t)) != 0) /* º¹ ¹Þħ ?? (double prop?) */
+ {
+ if (2 != convert_3_to_code(f, m, t2, buf))
+ return AUTOMATA_ERROR;
+
+ push(buf);
+ l = t2;
+ return AUTOMATA_CORRECT;
+ }
+ return AUTOMATA_ERROR;
+
+ case F_A: /* Ư¼ö¹®ÀÚ³ª ¼ýÀÚ (special char. or number) */
+ hangul_input_clear();
+ *c = t;
+ return AUTOMATA_SPECIAL;
+ }
+ }
+ if (*c == BS)
+ {
+ if (sp >= 4)
+ {
+ pop(buf);
+ pop(buf);
+ convert_ks_to_3(buf, &f, &m, &l);
+ push(buf);
+ return AUTOMATA_CORRECT;
+ }
+ else if (sp == 0)
+ {
+ return AUTOMATA_SPECIAL;
+ }
+ else
+ {
+ hangul_input_clear();
+ return AUTOMATA_NULL;
+ }
+ }
+ hangul_input_clear();
+ return AUTOMATA_SPECIAL;
+}
+
+ void
+hangul_keyboard_set()
+{
+ int keyboard;
+ char *s;
+
+ hangul_input_clear();
+
+ if ((s = getenv("VIM_KEYBOARD")) == NULL)
+ s = getenv("HANGUL_KEYBOARD_TYPE");
+
+ if (s)
+ {
+ if (*s == '2')
+ keyboard = 2;
+ else
+ keyboard = 3;
+ hangul_keyboard_type = keyboard;
+ }
+}
+
+ int
+hangul_input_process(s, len)
+ char_u *s;
+ int len;
+{
+ int n;
+ unsigned int c;
+ char_u hanbuf[20];
+
+ if (len == 1)
+ /* normal key press */
+ c = *s;
+ else if (len == 3 && s[0] == CSI && s[1] == 'k' && s[2] == 'b')
+ {
+ /* backspace */
+ if (composing_hangul)
+ c = Ctrl_H;
+ else
+ return len;
+ }
+ else
+ {
+ if (composing_hangul)
+ push_raw_key(composing_hangul_buffer, 2);
+ hangul_input_clear();
+ composing_hangul = 0;
+ return len;
+ }
+
+ if (hangul_keyboard_type == 2)
+ n = hangul_automata2(hanbuf, &c);
+ else
+ n = hangul_automata3(hanbuf, &c);
+
+ if (n == AUTOMATA_CORRECT)
+ {
+ STRNCPY(composing_hangul_buffer, hanbuf, 2);
+ gui_update_cursor(TRUE, FALSE);
+ return 0;
+ }
+ else if (n == AUTOMATA_NEW)
+ {
+ if (composing_hangul)
+ push_raw_key(composing_hangul_buffer, 2);
+ STRNCPY(composing_hangul_buffer, hanbuf, 2);
+ composing_hangul = 1;
+ gui_update_cursor(TRUE, FALSE);
+ return 0;
+ }
+ else if (n == AUTOMATA_CORRECT_NEW)
+ {
+ if (composing_hangul)
+ push_raw_key(hanbuf, 2);
+ STRNCPY(composing_hangul_buffer, hanbuf+2, 2);
+ composing_hangul = 1;
+ gui_update_cursor(TRUE, FALSE);
+ return 0;
+ }
+ else if (n == AUTOMATA_NULL)
+ {
+ composing_hangul = 0;
+ gui_redraw_block(gui.cursor_row, gui.cursor_col,
+ gui.cursor_row, gui.cursor_col + 1,
+ GUI_MON_NOCLEAR);
+ gui_update_cursor(TRUE, FALSE);
+ return 0;
+ }
+ else if (n == AUTOMATA_SPECIAL)
+ {
+ if (composing_hangul)
+ {
+ push_raw_key(composing_hangul_buffer, 2);
+ composing_hangul = 0;
+ }
+ *s = c;
+ return 1;
+ }
+ else if (n == AUTOMATA_ERROR)
+ {
+ vim_beep();
+ return 0;
+ }
+ return len;
+}
+
+ void
+hangul_input_clear()
+{
+ sp = 0;
+ f = F_NULL;
+ m = M_NULL;
+ l = L_NULL;
+}
+
+#define han_index(h, l) (((h)-0xb0)*(0xff-0xa1)+((l)-0xa1))
+
+static const char_u ks_table1[][3] =
+{
+ { 2, 3, 1}, { 2, 3, 2}, { 2, 3, 5}, { 2, 3, 8},
+ { 2, 3, 9}, { 2, 3, 10}, { 2, 3, 11}, { 2, 3, 17},
+ { 2, 3, 19}, { 2, 3, 20}, { 2, 3, 21}, { 2, 3, 22},
+ { 2, 3, 23}, { 2, 3, 24}, { 2, 3, 25}, { 2, 3, 27},
+ { 2, 3, 28}, { 2, 3, 29}, { 2, 4, 1}, { 2, 4, 2},
+ { 2, 4, 5}, { 2, 4, 9}, { 2, 4, 17}, { 2, 4, 19},
+ { 2, 4, 21}, { 2, 4, 22}, { 2, 4, 23}, { 2, 5, 1},
+ { 2, 5, 2}, { 2, 5, 5}, { 2, 5, 9}, { 2, 5, 21},
+ { 2, 5, 23}, { 2, 6, 1}, { 2, 6, 5}, { 2, 6, 9},
+ { 2, 7, 1}, { 2, 7, 2}, { 2, 7, 5}, { 2, 7, 8},
+ { 2, 7, 9}, { 2, 7, 11}, { 2, 7, 17}, { 2, 7, 19},
+ { 2, 7, 21}, { 2, 7, 22}, { 2, 7, 23}, { 2, 7, 24},
+ { 2, 7, 27}, { 2, 7, 28}, { 2, 7, 29}, { 2, 10, 1},
+ { 2, 10, 5}, { 2, 10, 9}, { 2, 10, 17}, { 2, 10, 19},
+ { 2, 10, 21}, { 2, 10, 22}, { 2, 10, 23}, { 2, 11, 1},
+ { 2, 11, 2}, { 2, 11, 3}, { 2, 11, 5}, { 2, 11, 8},
+ { 2, 11, 9}, { 2, 11, 17}, { 2, 11, 19}, { 2, 11, 21},
+ { 2, 11, 22}, { 2, 11, 23}, { 2, 11, 27}, { 2, 12, 1},
+ { 2, 12, 5}, { 2, 12, 9}, { 2, 12, 19}, { 2, 12, 21},
+ { 2, 13, 1}, { 2, 13, 2}, { 2, 13, 5}, { 2, 13, 8},
+ { 2, 13, 9}, { 2, 13, 11}, { 2, 13, 13}, { 2, 13, 16},
+ { 2, 13, 17}, { 2, 13, 19}, { 2, 13, 21}, { 2, 13, 23},
+ { 2, 13, 24}, { 2, 14, 1}, { 2, 14, 2}, { 2, 14, 5},
+ { 2, 14, 9}, { 2, 14, 11}, { 2, 14, 17}, { 2, 14, 19},
+ { 2, 14, 21}, { 2, 14, 23}, { 2, 15, 1}, { 2, 15, 5},
+ { 2, 15, 9}, { 2, 15, 19}, { 2, 15, 22}, { 2, 15, 23},
+ { 2, 18, 1}, { 2, 18, 2}, { 2, 18, 5}, { 2, 18, 9},
+ { 2, 18, 17}, { 2, 18, 19}, { 2, 18, 21}, { 2, 18, 23},
+ { 2, 19, 1}, { 2, 19, 5}, { 2, 19, 9}, { 2, 19, 19},
+ { 2, 19, 21}, { 2, 20, 1}, { 2, 20, 2}, { 2, 20, 5},
+ { 2, 20, 8}, { 2, 20, 9}, { 2, 20, 10}, { 2, 20, 11},
+ { 2, 20, 16}, { 2, 20, 17}, { 2, 20, 19}, { 2, 20, 21},
+ { 2, 20, 23}, { 2, 20, 24}, { 2, 21, 1}, { 2, 21, 2},
+ { 2, 21, 5}, { 2, 21, 9}, { 2, 21, 22}, { 2, 21, 23},
+ { 2, 22, 1}, { 2, 22, 21}, { 2, 23, 1}, { 2, 23, 2},
+ { 2, 23, 5}, { 2, 23, 9}, { 2, 23, 17}, { 2, 23, 19},
+ { 2, 23, 21}, { 2, 26, 1}, { 2, 26, 5}, { 2, 26, 9},
+ { 2, 27, 1}, { 2, 27, 2}, { 2, 27, 5}, { 2, 27, 8},
+ { 2, 27, 9}, { 2, 27, 10}, { 2, 27, 17}, { 2, 27, 19},
+ { 2, 27, 21}, { 2, 27, 23}, { 2, 28, 1}, { 2, 29, 1},
+ { 2, 29, 2}, { 2, 29, 5}, { 2, 29, 8}, { 2, 29, 9},
+ { 2, 29, 11}, { 2, 29, 17}, { 2, 29, 19}, { 2, 29, 21},
+ { 2, 29, 23}, { 2, 29, 24}, { 2, 29, 28}, { 3, 3, 1},
+ { 3, 3, 2}, { 3, 3, 3}, { 3, 3, 5}, { 3, 3, 9},
+ { 3, 3, 11}, { 3, 3, 17}, { 3, 3, 19}, { 3, 3, 21},
+ { 3, 3, 22}, { 3, 3, 23}, { 3, 3, 27}, { 3, 4, 1},
+ { 3, 4, 2}, { 3, 4, 5}, { 3, 4, 9}, { 3, 4, 17},
+ { 3, 4, 19}, { 3, 4, 21}, { 3, 4, 22}, { 3, 4, 23},
+ { 3, 5, 1}, { 3, 5, 2}, { 3, 5, 9}, { 3, 7, 1},
+ { 3, 7, 2}, { 3, 7, 3}, { 3, 7, 5}, { 3, 7, 9},
+ { 3, 7, 17}, { 3, 7, 19}, { 3, 7, 21}, { 3, 7, 22},
+ { 3, 7, 23}, { 3, 10, 1}, { 3, 10, 2}, { 3, 10, 5},
+ { 3, 10, 17}, { 3, 10, 21}, { 3, 10, 23}, { 3, 11, 1},
+ { 3, 11, 5}, { 3, 11, 9}, { 3, 11, 21}, { 3, 11, 22},
+ { 3, 11, 27}, { 3, 12, 1}, { 3, 13, 1}, { 3, 13, 2},
+ { 3, 13, 5}, { 3, 13, 7}, { 3, 13, 9}, { 3, 13, 17},
+ { 3, 13, 19}, { 3, 13, 21}, { 3, 13, 23}, { 3, 13, 24},
+ { 3, 13, 25}, { 3, 14, 1}, { 3, 14, 2}, { 3, 14, 9},
+ { 3, 14, 22}, { 3, 14, 23}, { 3, 15, 1}, { 3, 15, 2},
+ { 3, 15, 23}, { 3, 18, 1}, { 3, 18, 5}, { 3, 18, 9},
+ { 3, 18, 17}, { 3, 18, 19}, { 3, 18, 23}, { 3, 19, 1},
+ { 3, 20, 1}, { 3, 20, 2}, { 3, 20, 5}, { 3, 20, 9},
+ { 3, 20, 16}, { 3, 20, 17}, { 3, 20, 19}, { 3, 20, 21},
+ { 3, 20, 23}, { 3, 20, 24}, { 3, 21, 1}, { 3, 21, 9},
+ { 3, 21, 22}, { 3, 21, 23}, { 3, 22, 1}, { 3, 22, 2},
+ { 3, 22, 5}, { 3, 22, 9}, { 3, 22, 17}, { 3, 22, 19},
+ { 3, 22, 22}, { 3, 23, 1}, { 3, 23, 5}, { 3, 23, 9},
+ { 3, 23, 17}, { 3, 23, 19}, { 3, 26, 1}, { 3, 27, 1},
+ { 3, 27, 2}, { 3, 27, 5}, { 3, 27, 7}, { 3, 27, 9},
+ { 3, 27, 11}, { 3, 27, 16}, { 3, 27, 17}, { 3, 27, 19},
+ { 3, 27, 21}, { 3, 27, 23}, { 3, 27, 27}, { 3, 29, 1},
+ { 3, 29, 2}, { 3, 29, 5}, { 3, 29, 9}, { 3, 29, 17},
+ { 3, 29, 19}, { 3, 29, 21}, { 3, 29, 23}, { 4, 3, 1},
+ { 4, 3, 2}, { 4, 3, 3}, { 4, 3, 5}, { 4, 3, 8},
+ { 4, 3, 9}, { 4, 3, 10}, { 4, 3, 11}, { 4, 3, 17},
+ { 4, 3, 19}, { 4, 3, 21}, { 4, 3, 22}, { 4, 3, 23},
+ { 4, 3, 24}, { 4, 3, 25}, { 4, 3, 27}, { 4, 3, 29},
+ { 4, 4, 1}, { 4, 4, 2}, { 4, 4, 5}, { 4, 4, 9},
+ { 4, 4, 17}, { 4, 4, 19}, { 4, 4, 21}, { 4, 4, 22},
+ { 4, 4, 23}, { 4, 5, 1}, { 4, 5, 2}, { 4, 5, 5},
+ { 4, 5, 9}, { 4, 5, 17}, { 4, 5, 23}, { 4, 7, 1},
+ { 4, 7, 2}, { 4, 7, 4}, { 4, 7, 5}, { 4, 7, 9},
+ { 4, 7, 11}, { 4, 7, 12}, { 4, 7, 17}, { 4, 7, 19},
+ { 4, 7, 21}, { 4, 7, 22}, { 4, 7, 23}, { 4, 7, 29},
+ { 4, 10, 1}, { 4, 10, 2}, { 4, 10, 5}, { 4, 10, 9},
+ { 4, 10, 17}, { 4, 10, 19}, { 4, 10, 21}, { 4, 10, 22},
+ { 4, 10, 23}, { 4, 11, 1}, { 4, 11, 2}, { 4, 11, 5},
+ { 4, 11, 9}, { 4, 11, 17}, { 4, 11, 19}, { 4, 11, 22},
+ { 4, 11, 23}, { 4, 11, 26}, { 4, 12, 1}, { 4, 12, 5},
+ { 4, 13, 1}, { 4, 13, 2}, { 4, 13, 5}, { 4, 13, 9},
+ { 4, 13, 11}, { 4, 13, 17}, { 4, 13, 19}, { 4, 13, 21},
+ { 4, 13, 23}, { 4, 13, 28}, { 4, 13, 29}, { 4, 14, 1},
+ { 4, 14, 5}, { 4, 14, 9}, { 4, 14, 22}, { 4, 18, 1},
+ { 4, 18, 5}, { 4, 18, 9}, { 4, 18, 17}, { 4, 18, 19},
+ { 4, 18, 21}, { 4, 19, 1}, { 4, 19, 2}, { 4, 19, 5},
+ { 4, 19, 9}, { 4, 19, 19}, { 4, 19, 21}, { 4, 19, 23},
+ { 4, 20, 1}, { 4, 20, 2}, { 4, 20, 5}, { 4, 20, 8},
+ { 4, 20, 9}, { 4, 20, 17}, { 4, 20, 19}, { 4, 20, 21},
+ { 4, 20, 23}, { 4, 21, 1}, { 4, 21, 22}, { 4, 22, 1},
+ { 4, 23, 1}, { 4, 23, 5}, { 4, 23, 9}, { 4, 23, 17},
+ { 4, 23, 19}, { 4, 26, 1}, { 4, 26, 2}, { 4, 26, 9},
+ { 4, 26, 17}, { 4, 26, 19}, { 4, 26, 23}, { 4, 27, 1},
+ { 4, 27, 2}, { 4, 27, 5}, { 4, 27, 9}, { 4, 27, 10},
+ { 4, 27, 11}, { 4, 27, 17}, { 4, 27, 19}, { 4, 27, 21},
+ { 4, 27, 23}, { 4, 27, 24}, { 4, 27, 28}, { 4, 28, 1},
+ { 4, 28, 5}, { 4, 28, 9}, { 4, 29, 1}, { 4, 29, 2},
+ { 4, 29, 5}, { 4, 29, 9}, { 4, 29, 11}, { 4, 29, 17},
+ { 4, 29, 19}, { 4, 29, 21}, { 4, 29, 23}, { 4, 29, 28},
+ { 5, 3, 1}, { 5, 3, 2}, { 5, 3, 3}, { 5, 3, 5},
+ { 5, 3, 8}, { 5, 3, 9}, { 5, 3, 10}, { 5, 3, 11},
+ { 5, 3, 12}, { 5, 3, 16}, { 5, 3, 17}, { 5, 3, 19},
+ { 5, 3, 21}, { 5, 3, 22}, { 5, 3, 23}, { 5, 3, 24},
+ { 5, 3, 25}, { 5, 3, 29}, { 5, 4, 1}, { 5, 4, 2},
+ { 5, 4, 5}, { 5, 4, 9}, { 5, 4, 17}, { 5, 4, 19},
+ { 5, 4, 21}, { 5, 4, 22}, { 5, 4, 23}, { 5, 5, 1},
+ { 5, 7, 1}, { 5, 7, 2}, { 5, 7, 3}, { 5, 7, 5},
+ { 5, 7, 8}, { 5, 7, 9}, { 5, 7, 11}, { 5, 7, 12},
+ { 5, 7, 17}, { 5, 7, 19}, { 5, 7, 21}, { 5, 7, 23},
+ { 5, 7, 25}, { 5, 7, 28}, { 5, 10, 1}, { 5, 10, 2},
+ { 5, 10, 5}, { 5, 10, 9}, { 5, 10, 17}, { 5, 10, 19},
+ { 5, 10, 21}, { 5, 10, 22}, { 5, 10, 23}, { 5, 11, 1},
+ { 5, 11, 5}, { 5, 11, 9}, { 5, 11, 22}, { 5, 11, 23},
+ { 5, 12, 1}, { 5, 12, 5}, { 5, 13, 1}, { 5, 13, 2},
+ { 5, 13, 5}, { 5, 13, 8}, { 5, 13, 9}, { 5, 13, 11},
+ { 5, 13, 13}, { 5, 13, 17}, { 5, 13, 19}, { 5, 13, 21},
+ { 5, 13, 23}, { 5, 13, 25}, { 5, 13, 27}, { 5, 14, 1},
+ { 5, 14, 5}, { 5, 14, 9}, { 5, 15, 1}, { 5, 15, 22},
+ { 5, 18, 1}, { 5, 18, 5}, { 5, 18, 9}, { 5, 18, 17},
+ { 5, 18, 19}, { 5, 18, 21}, { 5, 19, 1}, { 5, 20, 1},
+ { 5, 20, 2}, { 5, 20, 5}, { 5, 20, 9}, { 5, 20, 17},
+ { 5, 20, 19}, { 5, 20, 21}, { 5, 20, 23}, { 5, 21, 1},
+ { 5, 21, 22}, { 5, 22, 1}, { 5, 22, 23}, { 5, 23, 1},
+ { 5, 23, 5}, { 5, 23, 9}, { 5, 23, 19}, { 5, 23, 21},
+ { 5, 23, 23}, { 5, 26, 1}, { 5, 26, 5}, { 5, 26, 9},
+ { 5, 26, 17}, { 5, 26, 23}, { 5, 27, 1}, { 5, 27, 2},
+ { 5, 27, 5}, { 5, 27, 8}, { 5, 27, 9}, { 5, 27, 11},
+ { 5, 27, 17}, { 5, 27, 19}, { 5, 27, 21}, { 5, 27, 23},
+ { 5, 28, 1}, { 5, 29, 1}, { 5, 29, 2}, { 5, 29, 5},
+ { 5, 29, 8}, { 5, 29, 9}, { 5, 29, 17}, { 5, 29, 19},
+ { 5, 29, 21}, { 5, 29, 22}, { 5, 29, 23}, { 5, 29, 24},
+ { 6, 3, 1}, { 6, 3, 2}, { 6, 3, 5}, { 6, 3, 9},
+ { 6, 3, 17}, { 6, 3, 19}, { 6, 3, 21}, { 6, 3, 22},
+ { 6, 3, 23}, { 6, 3, 29}, { 6, 4, 1}, { 6, 4, 2},
+ { 6, 4, 5}, { 6, 4, 9}, { 6, 4, 17}, { 6, 4, 19},
+ { 6, 4, 21}, { 6, 4, 22}, { 6, 4, 23}, { 6, 7, 1},
+ { 6, 7, 2}, { 6, 7, 5}, { 6, 7, 9}, { 6, 7, 11},
+ { 6, 7, 12}, { 6, 7, 17}, { 6, 7, 19}, { 6, 7, 21},
+ { 6, 7, 22}, { 6, 7, 23}, { 6, 7, 29}, { 6, 10, 1},
+ { 6, 10, 2}, { 6, 10, 5}, { 6, 10, 9}, { 6, 10, 17},
+ { 6, 10, 19}, { 6, 10, 21}, { 6, 10, 22}, { 6, 10, 23},
+ { 6, 11, 1}, { 6, 11, 22}, { 6, 13, 1}, { 6, 13, 2},
+ { 6, 13, 5}, { 6, 13, 9}, { 6, 13, 23}, { 6, 14, 1},
+ { 6, 14, 9}, { 6, 15, 1}, { 6, 18, 1}, { 6, 18, 5},
+ { 6, 20, 1}, { 6, 20, 2}, { 6, 20, 5}, { 6, 20, 9},
+ { 6, 20, 16}, { 6, 20, 17}, { 6, 20, 23}, { 6, 22, 1},
+ { 6, 23, 1}, { 6, 23, 5}, { 6, 23, 9}, { 6, 23, 17},
+ { 6, 23, 19}, { 6, 23, 23}, { 6, 27, 1}, { 6, 27, 2},
+ { 6, 27, 5}, { 6, 27, 8}, { 6, 27, 9}, { 6, 27, 17},
+ { 6, 27, 19}, { 6, 27, 21}, { 6, 28, 1}, { 6, 28, 5},
+ { 6, 28, 9}, { 6, 28, 17}, { 6, 28, 19}, { 6, 29, 1},
+ { 6, 29, 5}, { 6, 29, 9}, { 6, 29, 17}, { 6, 29, 19},
+ { 6, 29, 21}, { 6, 29, 23}, { 7, 3, 1}, { 7, 3, 2},
+ { 7, 3, 5}, { 7, 3, 9}, { 7, 3, 17}, { 7, 3, 19},
+ { 7, 3, 21}, { 7, 3, 22}, { 7, 3, 23}, { 7, 3, 24},
+ { 7, 3, 28}, { 7, 3, 29}, { 7, 4, 1}, { 7, 4, 2},
+ { 7, 4, 5}, { 7, 4, 9}, { 7, 4, 17}, { 7, 4, 19},
+ { 7, 4, 21}, { 7, 4, 22}, { 7, 4, 23}, { 7, 5, 1},
+ { 7, 5, 2}, { 7, 5, 5}, { 7, 5, 21}, { 7, 5, 23},
+ { 7, 7, 1}, { 7, 7, 2}, { 7, 7, 5}, { 7, 7, 9},
+ { 7, 7, 17}, { 7, 7, 19}, { 7, 7, 21}, { 7, 7, 22},
+ { 7, 7, 23}, { 7, 7, 29}, { 7, 10, 1}, { 7, 10, 2},
+ { 7, 10, 5}, { 7, 10, 9}, { 7, 10, 17}, { 7, 10, 19},
+ { 7, 10, 21}, { 7, 10, 23}, { 7, 11, 1}, { 7, 11, 2},
+ { 7, 11, 5}, { 7, 11, 9}, { 7, 11, 17}, { 7, 11, 19},
+ { 7, 11, 21}, { 7, 11, 22}, { 7, 11, 23}, { 7, 12, 1},
+ { 7, 12, 5}, { 7, 12, 19}, { 7, 12, 21}, { 7, 13, 1},
+ { 7, 13, 2}, { 7, 13, 5}, { 7, 13, 9}, { 7, 13, 17},
+ { 7, 13, 19}, { 7, 13, 21}, { 7, 13, 23}, { 7, 14, 1},
+ { 7, 14, 5}, { 7, 14, 23}, { 7, 15, 22}, { 7, 18, 1},
+ { 7, 18, 5}, { 7, 18, 9}, { 7, 18, 17}, { 7, 18, 19},
+ { 7, 18, 21}, { 7, 18, 23}, { 7, 19, 1}, { 7, 19, 5},
+ { 7, 19, 9}, { 7, 19, 19}, { 7, 19, 21}, { 7, 19, 23},
+ { 7, 20, 1}, { 7, 20, 2}, { 7, 20, 5}, { 7, 20, 9},
+ { 7, 20, 17}, { 7, 20, 19}, { 7, 20, 21}, { 7, 20, 23},
+ { 7, 21, 1}, { 7, 21, 22}, { 7, 22, 1}, { 7, 23, 1},
+ { 7, 23, 2}, { 7, 23, 5}, { 7, 23, 9}, { 7, 23, 17},
+ { 7, 23, 21}, { 7, 23, 23}, { 7, 26, 1}, { 7, 26, 2},
+ { 7, 26, 5}, { 7, 26, 9}, { 7, 26, 17}, { 7, 26, 19},
+ { 7, 26, 21}, { 7, 26, 23}, { 7, 27, 1}, { 7, 27, 2},
+ { 7, 27, 5}, { 7, 27, 9}, { 7, 27, 17}, { 7, 27, 19},
+ { 7, 27, 21}, { 7, 27, 23}, { 7, 27, 24}, { 7, 27, 27},
+ { 7, 27, 28}, { 7, 29, 1}, { 7, 29, 2}, { 7, 29, 5},
+ { 7, 29, 9}, { 7, 29, 17}, { 7, 29, 19}, { 7, 29, 21},
+ { 7, 29, 23}, { 8, 3, 1}, { 8, 3, 2}, { 8, 3, 5},
+ { 8, 3, 7}, { 8, 3, 8}, { 8, 3, 9}, { 8, 3, 10},
+ { 8, 3, 11}, { 8, 3, 17}, { 8, 3, 19}, { 8, 3, 21},
+ { 8, 3, 23}, { 8, 3, 24}, { 8, 3, 27}, { 8, 3, 29},
+ { 8, 4, 1}, { 8, 4, 2}, { 8, 4, 5}, { 8, 4, 9},
+ { 8, 4, 17}, { 8, 4, 19}, { 8, 4, 21}, { 8, 4, 22},
+ { 8, 4, 23}, { 8, 4, 24}, { 8, 5, 1}, { 8, 5, 2},
+ { 8, 5, 9}, { 8, 5, 23}, { 8, 7, 1}, { 8, 7, 2},
+ { 8, 7, 5}, { 8, 7, 9}, { 8, 7, 11}, { 8, 7, 17},
+ { 8, 7, 19}, { 8, 7, 21}, { 8, 7, 23}, { 8, 7, 24},
+ { 8, 7, 29}, { 8, 10, 1}, { 8, 10, 2}, { 8, 10, 5},
+ { 8, 10, 9}, { 8, 10, 17}, { 8, 10, 19}, { 8, 10, 21},
+ { 8, 10, 22}, { 8, 10, 23}, { 8, 11, 1}, { 8, 11, 2},
+ { 8, 11, 5}, { 8, 11, 9}, { 8, 11, 21}, { 8, 11, 22},
+ { 8, 11, 23}, { 8, 11, 25}, { 8, 12, 1}, { 8, 13, 1},
+ { 8, 13, 2}, { 8, 13, 4}, { 8, 13, 5}, { 8, 13, 9},
+ { 8, 13, 11}, { 8, 13, 17}, { 8, 13, 19}, { 8, 13, 21},
+ { 8, 13, 23}, { 8, 14, 1}, { 8, 14, 5}, { 8, 14, 22},
+ { 8, 14, 23}, { 8, 18, 1}, { 8, 18, 5}, { 8, 18, 9},
+ { 8, 18, 19}, { 8, 18, 21}, { 8, 18, 23}, { 8, 19, 1},
+ { 8, 19, 5}, { 8, 19, 9}, { 8, 19, 19}, { 8, 19, 21},
+ { 8, 20, 1}, { 8, 20, 2}, { 8, 20, 3}, { 8, 20, 5},
+ { 8, 20, 8}, { 8, 20, 9}, { 8, 20, 10}, { 8, 20, 11},
+ { 8, 20, 17}, { 8, 20, 19}, { 8, 20, 21}, { 8, 20, 23},
+ { 8, 20, 27}, { 8, 20, 29}, { 8, 21, 1}, { 8, 21, 5},
+ { 8, 21, 9}, { 8, 21, 19}, { 8, 21, 21}, { 8, 22, 1},
+ { 8, 23, 1}, { 8, 23, 5}, { 8, 23, 9}, { 8, 26, 1},
+ { 8, 26, 5}, { 8, 26, 9}, { 8, 26, 17}, { 8, 26, 21},
+ { 8, 27, 1}, { 8, 27, 5}, { 8, 27, 9}, { 8, 27, 17},
+ { 8, 27, 21}, { 8, 29, 1}, { 8, 29, 2}, { 8, 29, 5},
+ { 8, 29, 8}, { 8, 29, 9}, { 8, 29, 11}, { 8, 29, 17},
+ { 8, 29, 19}, { 8, 29, 21}, { 8, 29, 22}, { 8, 29, 23},
+ { 8, 29, 25}, { 8, 29, 27}, { 9, 3, 1}, { 9, 3, 2},
+ { 9, 3, 3}, { 9, 3, 4}, { 9, 3, 5}, { 9, 3, 8},
+ { 9, 3, 9}, { 9, 3, 10}, { 9, 3, 11}, { 9, 3, 12},
+ { 9, 3, 17}, { 9, 3, 19}, { 9, 3, 21}, { 9, 3, 23},
+ { 9, 3, 27}, { 9, 4, 1}, { 9, 4, 2}, { 9, 4, 5},
+ { 9, 4, 9}, { 9, 4, 17}, { 9, 4, 19}, { 9, 4, 21},
+ { 9, 4, 22}, { 9, 4, 23}, { 9, 4, 27}, { 9, 5, 1},
+ { 9, 5, 2}, { 9, 5, 5}, { 9, 5, 19}, { 9, 7, 1},
+ { 9, 7, 2}, { 9, 7, 5}, { 9, 7, 8}, { 9, 7, 9},
+ { 9, 7, 11}, { 9, 7, 17}, { 9, 7, 19}, { 9, 7, 21},
+ { 9, 7, 23}, { 9, 7, 24}, { 9, 10, 1}, { 9, 10, 2},
+ { 9, 10, 5}, { 9, 10, 8}, { 9, 10, 9}, { 9, 10, 17},
+ { 9, 10, 19}, { 9, 10, 21}, { 9, 10, 22}, { 9, 10, 23},
+ { 9, 11, 1}, { 9, 11, 2}, { 9, 11, 5}, { 9, 11, 9},
+ { 9, 11, 19}, { 9, 11, 21}, { 9, 11, 22}, { 9, 11, 23},
+ { 9, 11, 27}, { 9, 12, 1}, { 9, 12, 5}, { 9, 13, 1},
+ { 9, 13, 2}, { 9, 13, 3}, { 9, 13, 5}, { 9, 13, 9},
+ { 9, 13, 17}, { 9, 13, 19}, { 9, 13, 21}, { 9, 13, 23},
+ { 9, 14, 1}, { 9, 14, 5}, { 9, 14, 22}, { 9, 15, 1},
+ { 9, 15, 22}, { 9, 18, 1}, { 9, 18, 2}, { 9, 18, 5},
+ { 9, 18, 9}, { 9, 18, 17}, { 9, 18, 19}, { 9, 19, 1},
+ { 9, 19, 5}, { 9, 20, 1}, { 9, 20, 2}, { 9, 20, 5},
+ { 9, 20, 8}, { 9, 20, 9}, { 9, 20, 10}, { 9, 20, 11},
+ { 9, 20, 17}, { 9, 20, 19}, { 9, 20, 21}, { 9, 20, 23},
+ { 9, 20, 27}, { 9, 20, 28}, { 9, 21, 1}, { 9, 21, 9},
+ { 9, 21, 22}, { 9, 22, 1}, { 9, 23, 1}, { 9, 23, 2},
+ { 9, 23, 5}, { 9, 23, 9}, { 9, 23, 23}, { 9, 26, 1},
+ { 9, 26, 5}, { 9, 26, 9}, { 9, 26, 17}, { 9, 26, 21},
+ { 9, 26, 23}, { 9, 27, 1}, { 9, 27, 2}, { 9, 27, 5},
+ { 9, 27, 9}, { 9, 27, 17}, { 9, 27, 19}, { 9, 27, 21},
+ { 9, 29, 1}, { 9, 29, 2}, { 9, 29, 5}, { 9, 29, 9},
+ { 9, 29, 11}, { 9, 29, 17}, { 9, 29, 19}, { 9, 29, 21},
+ { 9, 29, 23}, { 9, 29, 24}, { 9, 29, 25}, { 10, 3, 1},
+ { 10, 3, 2}, { 10, 3, 5}, { 10, 3, 9}, { 10, 3, 11},
+ { 10, 3, 17}, { 10, 3, 19}, { 10, 3, 21}, { 10, 3, 22},
+ { 10, 3, 23}, { 10, 3, 29}, { 10, 4, 1}, { 10, 4, 2},
+ { 10, 4, 5}, { 10, 4, 9}, { 10, 4, 17}, { 10, 4, 19},
+ { 10, 4, 21}, { 10, 4, 22}, { 10, 4, 23}, { 10, 5, 1},
+ { 10, 5, 2}, { 10, 5, 17}, { 10, 7, 1}, { 10, 7, 2},
+ { 10, 7, 5}, { 10, 7, 8}, { 10, 7, 9}, { 10, 7, 17},
+ { 10, 7, 21}, { 10, 7, 22}, { 10, 7, 23}, { 10, 10, 1},
+ { 10, 10, 23}, { 10, 11, 1}, { 10, 11, 2}, { 10, 11, 17},
+ { 10, 11, 19}, { 10, 11, 21}, { 10, 11, 22}, { 10, 11, 23},
+ { 10, 13, 1}, { 10, 13, 2}, { 10, 13, 5}, { 10, 13, 9},
+ { 10, 13, 17}, { 10, 13, 19}, { 10, 13, 23}, { 10, 18, 1},
+ { 10, 19, 1}, { 10, 19, 23}, { 10, 20, 1}, { 10, 20, 2},
+ { 10, 20, 5}, { 10, 20, 9}, { 10, 20, 17}, { 10, 20, 21},
+ { 10, 20, 23}, { 10, 26, 1}, { 10, 26, 23}, { 10, 27, 1},
+ { 10, 27, 5}, { 10, 27, 9}, { 10, 27, 17}, { 10, 27, 19},
+ { 10, 29, 1}, { 10, 29, 2}, { 10, 29, 5}, { 10, 29, 9},
+ { 10, 29, 17}, { 10, 29, 19}, { 10, 29, 21}, { 10, 29, 23},
+ { 11, 3, 1}, { 11, 3, 2}, { 11, 3, 4}, { 11, 3, 5},
+ { 11, 3, 8}, { 11, 3, 9}, { 11, 3, 10}, { 11, 3, 11},
+ { 11, 3, 17}, { 11, 3, 19}, { 11, 3, 21}, { 11, 3, 22},
+ { 11, 3, 23}, { 11, 3, 27}, { 11, 4, 1}, { 11, 4, 2},
+ { 11, 4, 5}, { 11, 4, 9}, { 11, 4, 17}, { 11, 4, 19},
+ { 11, 4, 21}, { 11, 4, 22}, { 11, 4, 23}, { 11, 5, 1},
+ { 11, 5, 2}, { 11, 5, 5}, { 11, 5, 9}, { 11, 5, 17},
+ { 11, 5, 19}, { 11, 5, 21}, { 11, 5, 23}, { 11, 6, 1},
+ { 11, 6, 5}, { 11, 6, 9}, { 11, 6, 17}, { 11, 6, 23},
+ { 11, 7, 1}, { 11, 7, 2}, { 11, 7, 3}, { 11, 7, 4},
+ { 11, 7, 5}, { 11, 7, 8}, { 11, 7, 9}, { 11, 7, 11},
+ { 11, 7, 12}, { 11, 7, 17}, { 11, 7, 19}, { 11, 7, 21},
+ { 11, 7, 22}, { 11, 7, 23}, { 11, 7, 28}, { 11, 10, 1},
+ { 11, 10, 2}, { 11, 10, 5}, { 11, 10, 9}, { 11, 10, 17},
+ { 11, 10, 19}, { 11, 10, 21}, { 11, 10, 22}, { 11, 10, 23},
+ { 11, 11, 1}, { 11, 11, 2}, { 11, 11, 5}, { 11, 11, 9},
+ { 11, 11, 17}, { 11, 11, 19}, { 11, 11, 21}, { 11, 11, 22},
+ { 11, 11, 23}, { 11, 12, 1}, { 11, 12, 5}, { 11, 12, 9},
+ { 11, 12, 23}, { 11, 13, 1}, { 11, 13, 2}, { 11, 13, 3},
+ { 11, 13, 5}, { 11, 13, 9}, { 11, 13, 11}, { 11, 13, 17},
+ { 11, 13, 19}, { 11, 13, 21}, { 11, 13, 23}, { 11, 13, 27},
+ { 11, 14, 1}, { 11, 14, 2}, { 11, 14, 5}, { 11, 14, 9},
+ { 11, 14, 23}, { 11, 15, 1}, { 11, 15, 5}, { 11, 15, 9},
+ { 11, 15, 17}, { 11, 15, 21}, { 11, 15, 22}, { 11, 18, 1},
+ { 11, 18, 5}, { 11, 18, 9}, { 11, 18, 17}, { 11, 18, 19},
+ { 11, 18, 21}, { 11, 19, 1}, { 11, 19, 2}, { 11, 19, 5},
+ { 11, 19, 9}, { 11, 19, 17}, { 11, 19, 19}, { 11, 19, 21},
+ { 11, 19, 23}, { 11, 20, 1}, { 11, 20, 2}, { 11, 20, 5},
+ { 11, 20, 8}, { 11, 20, 9}, { 11, 20, 17}, { 11, 20, 19},
+ { 11, 20, 21}, { 11, 20, 23}, { 11, 20, 25}, { 11, 20, 27},
+ { 11, 20, 28}, { 11, 21, 1}, { 11, 21, 22}, { 11, 22, 1},
+ { 11, 22, 2}, { 11, 22, 5}, { 11, 22, 9}, { 11, 22, 17},
+ { 11, 22, 23}, { 11, 23, 1}, { 11, 23, 2}, { 11, 23, 5},
+ { 11, 23, 9}, { 11, 23, 17}, { 11, 23, 19}, { 11, 23, 21},
+ { 11, 23, 23}, { 11, 26, 1}, { 11, 26, 2}, { 11, 26, 9},
+ { 11, 26, 17}, { 11, 26, 21}, { 11, 26, 23}, { 11, 27, 1},
+ { 11, 27, 2}, { 11, 27, 5}, { 11, 27, 9}, { 11, 27, 10},
+ { 11, 27, 17}, { 11, 27, 19}, { 11, 27, 21}, { 11, 27, 23},
+ { 11, 29, 1}, { 11, 29, 2}, { 11, 29, 5}, { 11, 29, 8},
+ { 11, 29, 9}, { 11, 29, 16}, { 11, 29, 17}, { 11, 29, 19},
+ { 11, 29, 21}, { 11, 29, 23}, { 11, 29, 28}, { 12, 3, 1},
+ { 12, 3, 2}, { 12, 3, 4}, { 12, 3, 5}, { 12, 3, 9},
+ { 12, 3, 17}, { 12, 3, 19}, { 12, 3, 22}, { 12, 3, 23},
+ { 12, 3, 29}, { 12, 4, 1}, { 12, 4, 2}, { 12, 4, 5},
+ { 12, 4, 9}, { 12, 4, 17}, { 12, 4, 19}, { 12, 4, 22},
+ { 12, 4, 23}, { 12, 5, 23}, { 12, 7, 1}, { 12, 7, 2},
+ { 12, 7, 5}, { 12, 7, 9}, { 12, 7, 11}, { 12, 7, 17},
+ { 12, 7, 19}, { 12, 7, 22}, { 12, 7, 23}, { 12, 10, 1},
+ { 12, 10, 5}, { 12, 10, 9}, { 12, 12, 5}, { 12, 13, 1},
+ { 12, 13, 2}, { 12, 13, 5}, { 12, 13, 8}, { 12, 13, 9},
+ { 12, 13, 11}, { 12, 13, 17}, { 12, 13, 19}, { 12, 13, 23},
+ { 12, 14, 1}, { 12, 14, 2}, { 12, 14, 5}, { 12, 14, 22},
+ { 12, 15, 1}, { 12, 15, 22}, { 12, 18, 1}, { 12, 18, 5},
+ { 12, 18, 9}, { 12, 18, 17}, { 12, 18, 19}, { 12, 19, 1},
+ { 12, 20, 1}, { 12, 20, 2}, { 12, 20, 5}, { 12, 20, 9},
+ { 12, 20, 17}, { 12, 20, 19}, { 12, 20, 23}, { 12, 21, 1},
+ { 12, 21, 22}, { 12, 22, 1}, { 12, 23, 1}, { 12, 23, 5},
+ { 12, 26, 23}, { 12, 27, 1}, { 12, 27, 2}, { 12, 27, 5},
+ { 12, 27, 9}, { 12, 27, 11}, { 12, 27, 16}, { 12, 27, 17},
+ { 12, 27, 19}, { 12, 28, 1}, { 12, 28, 5}, { 12, 28, 9},
+ { 12, 28, 17}, { 12, 29, 1}, { 12, 29, 2}, { 12, 29, 5},
+ { 12, 29, 9}, { 12, 29, 17}, { 12, 29, 19}, { 12, 29, 21},
+ { 12, 29, 23}, { 13, 3, 1}, { 13, 3, 2}, { 13, 3, 5},
+ { 13, 3, 6}, { 13, 3, 7}, { 13, 3, 9}, { 13, 3, 10},
+ { 13, 3, 11}, { 13, 3, 16}, { 13, 3, 17}, { 13, 3, 19},
+ { 13, 3, 21}, { 13, 3, 22}, { 13, 3, 23}, { 13, 3, 27},
+ { 13, 3, 28}, { 13, 4, 1}, { 13, 4, 2}, { 13, 4, 5},
+ { 13, 4, 9}, { 13, 4, 17}, { 13, 4, 19}, { 13, 4, 21},
+ { 13, 4, 22}, { 13, 4, 23}, { 13, 5, 1}, { 13, 5, 2},
+ { 13, 5, 5}, { 13, 5, 9}, { 13, 5, 12}, { 13, 5, 17},
+ { 13, 5, 19}, { 13, 5, 21}, { 13, 5, 23}, { 13, 5, 27},
+ { 13, 5, 29}, { 13, 6, 1}, { 13, 6, 5}, { 13, 6, 9},
+ { 13, 6, 19}, { 13, 7, 1}, { 13, 7, 2}, { 13, 7, 5},
+ { 13, 7, 6}, { 13, 7, 8}, { 13, 7, 9}, { 13, 7, 10},
+ { 13, 7, 11}, { 13, 7, 17}, { 13, 7, 19}, { 13, 7, 20},
+ { 13, 7, 21}, { 13, 7, 22}, { 13, 7, 23}, { 13, 7, 24},
+ { 13, 7, 26}, { 13, 7, 28}, { 13, 10, 1}, { 13, 10, 2},
+ { 13, 10, 5}, { 13, 10, 9}, { 13, 10, 17}, { 13, 10, 19},
+ { 13, 10, 21}, { 13, 10, 23}, { 13, 11, 1}, { 13, 11, 2},
+ { 13, 11, 3}, { 13, 11, 5}, { 13, 11, 9}, { 13, 11, 11},
+ { 13, 11, 12}, { 13, 11, 17}, { 13, 11, 19}, { 13, 11, 20},
+ { 13, 11, 21}, { 13, 11, 22}, { 13, 11, 23}, { 13, 11, 27},
+ { 13, 11, 28}, { 13, 11, 29}, { 13, 12, 1}, { 13, 12, 5},
+ { 13, 12, 9}, { 13, 12, 17}, { 13, 12, 19}, { 13, 12, 21},
+ { 13, 12, 22}, { 13, 13, 1}, { 13, 13, 2}, { 13, 13, 5},
+ { 13, 13, 9}, { 13, 13, 10}, { 13, 13, 11}, { 13, 13, 13},
+ { 13, 13, 16}, { 13, 13, 17}, { 13, 13, 19}, { 13, 13, 21},
+ { 13, 13, 23}, { 13, 13, 25}, { 13, 14, 1}, { 13, 14, 2},
+ { 13, 14, 5}, { 13, 14, 9}, { 13, 14, 17}, { 13, 14, 19},
+ { 13, 14, 21}, { 13, 14, 22}, { 13, 14, 23}, { 13, 15, 1},
+ { 13, 15, 2}, { 13, 15, 5}, { 13, 15, 17}, { 13, 15, 21},
+ { 13, 15, 23}, { 13, 18, 1}, { 13, 18, 2}, { 13, 18, 5},
+ { 13, 18, 9}, { 13, 18, 17}, { 13, 18, 19}, { 13, 18, 21},
+ { 13, 18, 23}, { 13, 19, 1}, { 13, 19, 2}, { 13, 19, 5},
+ { 13, 19, 9}, { 13, 19, 17}, { 13, 19, 19}, { 13, 19, 21},
+ { 13, 19, 23}, { 13, 20, 1}, { 13, 20, 2}, { 13, 20, 5},
+ { 13, 20, 9}, { 13, 20, 10}, { 13, 20, 11}, { 13, 20, 17},
+ { 13, 20, 19}, { 13, 20, 21}, { 13, 20, 23}, { 13, 21, 1},
+ { 13, 21, 2}, { 13, 21, 5}, { 13, 21, 9}, { 13, 21, 17},
+ { 13, 21, 19}, { 13, 21, 22}, { 13, 21, 23}, { 13, 22, 1},
+ { 13, 22, 2}, { 13, 22, 5}, { 13, 22, 9}, { 13, 22, 17},
+ { 13, 22, 19}, { 13, 22, 23}, { 13, 23, 1}, { 13, 23, 2},
+ { 13, 23, 5}, { 13, 23, 9}, { 13, 23, 17}, { 13, 23, 19},
+ { 13, 23, 21}, { 13, 23, 23}, { 13, 26, 1}, { 13, 26, 2},
+ { 13, 26, 5}, { 13, 26, 9}, { 13, 26, 17}, { 13, 26, 19},
+ { 13, 26, 21}, { 13, 26, 23}, { 13, 26, 25}, { 13, 27, 1},
+ { 13, 27, 2}, { 13, 27, 5}, { 13, 27, 9}, { 13, 27, 15},
+ { 13, 27, 17}, { 13, 27, 19}, { 13, 27, 21}, { 13, 27, 23},
+ { 13, 27, 24}, { 13, 27, 25}, { 13, 27, 26}, { 13, 27, 27},
+ { 13, 27, 28}, { 13, 27, 29}, { 13, 28, 1}, { 13, 28, 5},
+ { 13, 28, 9}, { 13, 28, 17}, { 13, 28, 21}, { 13, 29, 1},
+ { 13, 29, 2}, { 13, 29, 5}, { 13, 29, 9}, { 13, 29, 10},
+ { 13, 29, 11}, { 13, 29, 16}, { 13, 29, 17}, { 13, 29, 19},
+ { 13, 29, 21}, { 13, 29, 22}, { 13, 29, 23}, { 13, 29, 24},
+ { 13, 29, 28}, { 14, 3, 1}, { 14, 3, 2}, { 14, 3, 5},
+ { 14, 3, 7}, { 14, 3, 8}, { 14, 3, 9}, { 14, 3, 11},
+ { 14, 3, 17}, { 14, 3, 19}, { 14, 3, 21}, { 14, 3, 22},
+ { 14, 3, 23}, { 14, 3, 24}, { 14, 4, 1}, { 14, 4, 2},
+ { 14, 4, 5}, { 14, 4, 9}, { 14, 4, 17}, { 14, 4, 19},
+ { 14, 4, 21}, { 14, 4, 22}, { 14, 4, 23}, { 14, 5, 1},
+ { 14, 5, 2}, { 14, 5, 5}, { 14, 5, 7}, { 14, 5, 9},
+ { 14, 5, 17}, { 14, 5, 23}, { 14, 6, 1}, { 14, 6, 5},
+ { 14, 6, 9}, { 14, 7, 1}, { 14, 7, 2}, { 14, 7, 5},
+ { 14, 7, 9}, { 14, 7, 11}, { 14, 7, 17}, { 14, 7, 19},
+ { 14, 7, 21}, { 14, 7, 23}, { 14, 7, 24}, { 14, 10, 1},
+ { 14, 10, 2}, { 14, 10, 5}, { 14, 10, 9}, { 14, 10, 17},
+ { 14, 10, 19}, { 14, 10, 21}, { 14, 10, 23}, { 14, 11, 1},
+ { 14, 11, 5}, { 14, 11, 9}, { 14, 11, 17}, { 14, 11, 19},
+ { 14, 11, 22}, { 14, 11, 23}, { 14, 12, 1}, { 14, 13, 1},
+ { 14, 13, 2}, { 14, 13, 5}, { 14, 13, 9}, { 14, 13, 11},
+ { 14, 13, 17}, { 14, 13, 19}, { 14, 13, 21}, { 14, 13, 23},
+ { 14, 13, 24}, { 14, 13, 25}, { 14, 13, 29}, { 14, 14, 1},
+ { 14, 14, 2}, { 14, 14, 9}, { 14, 14, 19}, { 14, 14, 21},
+ { 14, 14, 23}, { 14, 15, 1}, { 14, 15, 22}, { 14, 15, 23},
+ { 14, 18, 1}, { 14, 18, 5}, { 14, 18, 9}, { 14, 18, 17},
+ { 14, 18, 19}, { 14, 18, 21}, { 14, 18, 23}, { 14, 19, 1},
+ { 14, 19, 2}, { 14, 19, 5}, { 14, 19, 23}, { 14, 20, 1},
+ { 14, 20, 2}, { 14, 20, 5}, { 14, 20, 9}, { 14, 20, 10},
+ { 14, 20, 11}, { 14, 20, 17}, { 14, 20, 19}, { 14, 20, 21},
+ { 14, 20, 23}, { 14, 21, 1}, { 14, 21, 22}, { 14, 22, 1},
+ { 14, 23, 1}, { 14, 23, 2}, { 14, 23, 5}, { 14, 23, 9},
+ { 14, 23, 17}, { 14, 23, 19}, { 14, 23, 21}, { 14, 26, 1},
+ { 14, 26, 5}, { 14, 26, 9}, { 14, 26, 17}, { 14, 27, 1},
+ { 14, 27, 2}, { 14, 27, 5}, { 14, 27, 9}, { 14, 27, 17},
+ { 14, 27, 19}, { 14, 27, 21}, { 14, 27, 23}, { 14, 29, 1},
+ { 14, 29, 2}, { 14, 29, 5}, { 14, 29, 8}, { 14, 29, 9},
+ { 14, 29, 11}, { 14, 29, 17}, { 14, 29, 19}, { 14, 29, 21},
+ { 14, 29, 23}, { 14, 29, 24}, { 14, 29, 27}, { 14, 29, 28},
+ { 15, 3, 1}, { 15, 3, 2}, { 15, 3, 5}, { 15, 3, 7},
+ { 15, 3, 9}, { 15, 3, 12}, { 15, 3, 17}, { 15, 3, 19},
+ { 15, 3, 21}, { 15, 3, 22}, { 15, 3, 23}, { 15, 4, 1},
+ { 15, 4, 2}, { 15, 4, 5}, { 15, 4, 9}, { 15, 4, 17},
+ { 15, 4, 19}, { 15, 4, 21}, { 15, 4, 22}, { 15, 4, 23},
+ { 15, 5, 1}, { 15, 5, 5}, { 15, 5, 23}, { 15, 7, 1},
+ { 15, 7, 2}, { 15, 7, 5}, { 15, 7, 9}, { 15, 7, 17},
+ { 15, 7, 19}, { 15, 7, 21}, { 15, 7, 22}, { 15, 7, 23},
+ { 15, 10, 1}, { 15, 10, 23}, { 15, 11, 1}, { 15, 11, 22},
+ { 15, 13, 1}, { 15, 13, 2}, { 15, 13, 5}, { 15, 13, 9},
+ { 15, 13, 17}, { 15, 13, 19}, { 15, 13, 21}, { 15, 13, 23},
+ { 15, 13, 25}, { 15, 14, 1}, { 15, 14, 2}, { 15, 14, 9},
+ { 15, 14, 22}, { 15, 15, 1}, { 15, 15, 22}, { 15, 18, 1},
+ { 15, 18, 5}, { 15, 18, 9}, { 15, 18, 17}, { 15, 18, 19},
+ { 15, 19, 23}, { 15, 20, 1}, { 15, 20, 2}, { 15, 20, 5},
+ { 15, 20, 9}, { 15, 20, 17}, { 15, 20, 19}, { 15, 20, 23},
+ { 15, 21, 1}, { 15, 21, 22}, { 15, 21, 23}, { 15, 23, 1},
+ { 15, 26, 1}, { 15, 27, 1}, { 15, 27, 17}, { 15, 27, 21},
+ { 15, 27, 23}, { 15, 29, 1}, { 15, 29, 2}, { 15, 29, 5},
+ { 15, 29, 9}, { 15, 29, 17}, { 15, 29, 19}, { 15, 29, 23},
+ { 15, 29, 24}, { 15, 29, 29}, { 16, 3, 1}, { 16, 3, 2},
+ { 16, 3, 5}, { 16, 3, 7}, { 16, 3, 9}, { 16, 3, 17},
+ { 16, 3, 19}, { 16, 3, 21}, { 16, 3, 22}, { 16, 3, 23},
+ { 16, 3, 24}, { 16, 4, 1}, { 16, 4, 2}, { 16, 4, 5},
+ { 16, 4, 9}, { 16, 4, 17}, { 16, 4, 19}, { 16, 4, 21},
+ { 16, 4, 22}, { 16, 4, 23}, { 16, 5, 1}, { 16, 5, 5},
+ { 16, 5, 7}, { 16, 5, 9}, { 16, 5, 17}, { 16, 5, 23},
+ { 16, 7, 1}, { 16, 7, 2}, { 16, 7, 5}, { 16, 7, 9},
+ { 16, 7, 17}, { 16, 7, 19}, { 16, 7, 21}, { 16, 7, 22},
+ { 16, 7, 23}, { 16, 10, 1}, { 16, 10, 2}, { 16, 10, 5},
+ { 16, 10, 9}, { 16, 10, 17}, { 16, 10, 19}, { 16, 10, 21},
+ { 16, 10, 23}, { 16, 11, 1}, { 16, 11, 5}, { 16, 11, 22},
+ { 16, 12, 1}, { 16, 12, 5}, { 16, 12, 23}, { 16, 13, 1},
+ { 16, 13, 2}, { 16, 13, 5}, { 16, 13, 9}, { 16, 13, 17},
+ { 16, 13, 19}, { 16, 13, 21}, { 16, 13, 23}, { 16, 14, 1},
+ { 16, 14, 5}, { 16, 14, 9}, { 16, 14, 23}, { 16, 18, 1},
+ { 16, 18, 5}, { 16, 18, 9}, { 16, 18, 17}, { 16, 18, 19},
+ { 16, 18, 21}, { 16, 18, 23}, { 16, 19, 1}, { 16, 19, 17},
+ { 16, 20, 1}, { 16, 20, 2}, { 16, 20, 5}, { 16, 20, 9},
+ { 16, 20, 17}, { 16, 20, 19}, { 16, 20, 21}, { 16, 20, 23},
+ { 16, 21, 1}, { 16, 21, 22}, { 16, 22, 1}, { 16, 22, 5},
+ { 16, 23, 1}, { 16, 23, 5}, { 16, 23, 9}, { 16, 23, 17},
+ { 16, 23, 19}, { 16, 23, 21}, { 16, 23, 23}, { 16, 26, 1},
+ { 16, 26, 5}, { 16, 26, 9}, { 16, 26, 17}, { 16, 26, 23},
+ { 16, 27, 1}, { 16, 27, 2}, { 16, 27, 5}, { 16, 27, 9},
+ { 16, 27, 17}, { 16, 27, 19}, { 16, 27, 21}, { 16, 27, 23},
+ { 16, 29, 1}, { 16, 29, 2}, { 16, 29, 5}, { 16, 29, 8},
+ { 16, 29, 9}, { 16, 29, 10}, { 16, 29, 17}, { 16, 29, 19},
+ { 16, 29, 21}, { 16, 29, 23}, { 17, 3, 1}, { 17, 3, 2},
+ { 17, 3, 5}, { 17, 3, 9}, { 17, 3, 17}, { 17, 3, 19},
+ { 17, 3, 21}, { 17, 3, 23}, { 17, 4, 1}, { 17, 4, 2},
+ { 17, 4, 5}, { 17, 4, 9}, { 17, 4, 17}, { 17, 4, 19},
+ { 17, 4, 21}, { 17, 4, 22}, { 17, 4, 23}, { 17, 5, 1},
+ { 17, 5, 2}, { 17, 5, 23}, { 17, 7, 1}, { 17, 7, 2},
+ { 17, 7, 5}, { 17, 7, 8}, { 17, 7, 9}, { 17, 7, 17},
+ { 17, 7, 19}, { 17, 7, 21}, { 17, 7, 22}, { 17, 7, 23},
+ { 17, 10, 1}, { 17, 10, 2}, { 17, 10, 5}, { 17, 10, 9},
+ { 17, 10, 17}, { 17, 10, 19}, { 17, 10, 21}, { 17, 10, 23},
+ { 17, 11, 1}, { 17, 11, 5}, { 17, 11, 9}, { 17, 11, 17},
+ { 17, 11, 19}, { 17, 11, 21}, { 17, 11, 22}, { 17, 11, 23},
+ { 17, 12, 1}, { 17, 13, 1}, { 17, 13, 2}, { 17, 13, 5},
+ { 17, 13, 9}, { 17, 13, 17}, { 17, 13, 19}, { 17, 13, 21},
+ { 17, 13, 23}, { 17, 14, 1}, { 17, 14, 2}, { 17, 14, 5},
+ { 17, 14, 9}, { 17, 14, 17}, { 17, 14, 23}, { 17, 15, 1},
+ { 17, 15, 23}, { 17, 18, 1}, { 17, 18, 9}, { 17, 19, 1},
+ { 17, 20, 1}, { 17, 20, 2}, { 17, 20, 5}, { 17, 20, 9},
+ { 17, 20, 17}, { 17, 20, 19}, { 17, 20, 21}, { 17, 20, 23},
+ { 17, 21, 1}, { 17, 21, 5}, { 17, 21, 9}, { 17, 21, 23},
+ { 17, 22, 1}, { 17, 22, 23}, { 17, 23, 1}, { 17, 23, 2},
+ { 17, 23, 5}, { 17, 23, 9}, { 17, 23, 17}, { 17, 23, 19},
+ { 17, 23, 21}, { 17, 23, 23}, { 17, 26, 1}, { 17, 26, 5},
+ { 17, 26, 9}, { 17, 26, 17}, { 17, 27, 1}, { 17, 27, 2},
+ { 17, 27, 5}, { 17, 27, 9}, { 17, 27, 17}, { 17, 27, 19},
+ { 17, 27, 23}, { 17, 29, 1}, { 17, 29, 2}, { 17, 29, 5},
+ { 17, 29, 9}, { 17, 29, 17}, { 17, 29, 19}, { 17, 29, 21},
+ { 17, 29, 23}, { 18, 3, 1}, { 18, 3, 2}, { 18, 3, 5},
+ { 18, 3, 9}, { 18, 3, 10}, { 18, 3, 17}, { 18, 3, 19},
+ { 18, 3, 21}, { 18, 3, 22}, { 18, 3, 23}, { 18, 4, 1},
+ { 18, 4, 2}, { 18, 4, 5}, { 18, 4, 9}, { 18, 4, 17},
+ { 18, 4, 19}, { 18, 4, 21}, { 18, 4, 22}, { 18, 4, 23},
+ { 18, 5, 1}, { 18, 5, 23}, { 18, 7, 1}, { 18, 7, 2},
+ { 18, 7, 5}, { 18, 7, 9}, { 18, 7, 11}, { 18, 7, 17},
+ { 18, 7, 19}, { 18, 7, 21}, { 18, 7, 22}, { 18, 7, 23},
+ { 18, 10, 1}, { 18, 10, 2}, { 18, 10, 5}, { 18, 10, 9},
+ { 18, 10, 17}, { 18, 10, 19}, { 18, 10, 21}, { 18, 10, 23},
+ { 18, 11, 1}, { 18, 11, 5}, { 18, 11, 22}, { 18, 12, 1},
+ { 18, 12, 5}, { 18, 13, 1}, { 18, 13, 2}, { 18, 13, 5},
+ { 18, 13, 9}, { 18, 13, 17}, { 18, 13, 19}, { 18, 13, 21},
+ { 18, 13, 23}, { 18, 13, 28}, { 18, 14, 1}, { 18, 14, 5},
+ { 18, 15, 1}, { 18, 18, 1}, { 18, 18, 5}, { 18, 18, 21},
+ { 18, 18, 23}, { 18, 19, 1}, { 18, 20, 1}, { 18, 20, 2},
+ { 18, 20, 5}, { 18, 20, 9}, { 18, 20, 17}, { 18, 20, 19},
+ { 18, 20, 21}, { 18, 20, 23}, { 18, 21, 1}, { 18, 21, 22},
+ { 18, 22, 1}, { 18, 23, 1}, { 18, 23, 2}, { 18, 23, 5},
+ { 18, 23, 9}, { 18, 23, 17}, { 18, 23, 19}, { 18, 23, 23},
+ { 18, 26, 1}, { 18, 26, 5}, { 18, 26, 9}, { 18, 26, 17},
+ { 18, 26, 23}, { 18, 27, 1}, { 18, 27, 2}, { 18, 27, 5},
+ { 18, 27, 8}, { 18, 27, 9}, { 18, 27, 11}, { 18, 27, 17},
+ { 18, 27, 19}, { 18, 27, 21}, { 18, 28, 1}, { 18, 28, 5},
+ { 18, 28, 9}, { 18, 28, 17}, { 18, 28, 19}, { 18, 29, 1},
+ { 18, 29, 2}, { 18, 29, 5}, { 18, 29, 9}, { 18, 29, 17},
+ { 18, 29, 19}, { 18, 29, 21}, { 18, 29, 23}, { 19, 3, 1},
+ { 19, 3, 2}, { 19, 3, 3}, { 19, 3, 5}, { 19, 3, 9},
+ { 19, 3, 11}, { 19, 3, 17}, { 19, 3, 19}, { 19, 3, 21},
+ { 19, 3, 22}, { 19, 3, 23}, { 19, 3, 27}, { 19, 4, 1},
+ { 19, 4, 2}, { 19, 4, 5}, { 19, 4, 9}, { 19, 4, 17},
+ { 19, 4, 19}, { 19, 4, 21}, { 19, 4, 22}, { 19, 4, 23},
+ { 19, 5, 1}, { 19, 5, 2}, { 19, 7, 1}, { 19, 7, 2},
+ { 19, 7, 5}, { 19, 7, 9}, { 19, 7, 17}, { 19, 7, 19},
+ { 19, 7, 21}, { 19, 7, 22}, { 19, 7, 23}, { 19, 10, 1},
+ { 19, 10, 2}, { 19, 10, 5}, { 19, 10, 9}, { 19, 10, 17},
+ { 19, 10, 19}, { 19, 10, 21}, { 19, 10, 23}, { 19, 11, 1},
+ { 19, 11, 5}, { 19, 11, 9}, { 19, 11, 17}, { 19, 11, 19},
+ { 19, 11, 22}, { 19, 11, 23}, { 19, 12, 1}, { 19, 12, 9},
+ { 19, 12, 19}, { 19, 12, 21}, { 19, 13, 1}, { 19, 13, 2},
+ { 19, 13, 5}, { 19, 13, 9}, { 19, 13, 17}, { 19, 13, 19},
+ { 19, 13, 21}, { 19, 13, 23}, { 19, 14, 1}, { 19, 14, 23},
+ { 19, 18, 1}, { 19, 18, 5}, { 19, 19, 1}, { 19, 19, 5},
+ { 19, 19, 9}, { 19, 19, 19}, { 19, 19, 21}, { 19, 20, 1},
+ { 19, 20, 2}, { 19, 20, 5}, { 19, 20, 8}, { 19, 20, 9},
+ { 19, 20, 11}, { 19, 20, 17}, { 19, 20, 19}, { 19, 20, 21},
+ { 19, 20, 23}, { 19, 21, 1}, { 19, 21, 23}, { 19, 23, 1},
+ { 19, 23, 5}, { 19, 23, 9}, { 19, 23, 17}, { 19, 23, 21},
+ { 19, 26, 1}, { 19, 26, 5}, { 19, 26, 9}, { 19, 26, 17},
+ { 19, 26, 21}, { 19, 26, 23}, { 19, 27, 1}, { 19, 27, 5},
+ { 19, 27, 9}, { 19, 27, 17}, { 19, 27, 19}, { 19, 27, 21},
+ { 19, 29, 1}, { 19, 29, 2}, { 19, 29, 5}, { 19, 29, 9},
+ { 19, 29, 17}, { 19, 29, 19}, { 19, 29, 21}, { 19, 29, 23},
+ { 20, 3, 1}, { 20, 3, 2}, { 20, 3, 5}, { 20, 3, 9},
+ { 20, 3, 14}, { 20, 3, 17}, { 20, 3, 19}, { 20, 3, 21},
+ { 20, 3, 23}, { 20, 4, 1}, { 20, 4, 2}, { 20, 4, 5},
+ { 20, 4, 9}, { 20, 4, 17}, { 20, 4, 19}, { 20, 4, 21},
+ { 20, 4, 22}, { 20, 4, 23}, { 20, 5, 1}, { 20, 5, 23},
+ { 20, 7, 1}, { 20, 7, 2}, { 20, 7, 5}, { 20, 7, 9},
+ { 20, 7, 11}, { 20, 7, 17}, { 20, 7, 19}, { 20, 7, 21},
+ { 20, 7, 23}, { 20, 10, 1}, { 20, 10, 2}, { 20, 10, 5},
+ { 20, 10, 9}, { 20, 10, 17}, { 20, 10, 19}, { 20, 10, 21},
+ { 20, 10, 23}, { 20, 11, 1}, { 20, 11, 2}, { 20, 11, 5},
+ { 20, 11, 9}, { 20, 11, 17}, { 20, 11, 19}, { 20, 11, 21},
+ { 20, 11, 22}, { 20, 11, 23}, { 20, 12, 1}, { 20, 12, 5},
+ { 20, 12, 9}, { 20, 12, 19}, { 20, 13, 1}, { 20, 13, 2},
+ { 20, 13, 5}, { 20, 13, 9}, { 20, 13, 14}, { 20, 13, 17},
+ { 20, 13, 19}, { 20, 13, 21}, { 20, 13, 23}, { 20, 13, 27},
+ { 20, 14, 1}, { 20, 14, 2}, { 20, 14, 5}, { 20, 14, 9},
+ { 20, 14, 21}, { 20, 14, 23}, { 20, 15, 1}, { 20, 15, 2},
+ { 20, 15, 5}, { 20, 15, 21}, { 20, 15, 23}, { 20, 18, 1},
+ { 20, 18, 2}, { 20, 18, 5}, { 20, 18, 9}, { 20, 18, 19},
+ { 20, 18, 21}, { 20, 18, 23}, { 20, 19, 1}, { 20, 19, 5},
+ { 20, 19, 9}, { 20, 19, 19}, { 20, 19, 21}, { 20, 20, 1},
+ { 20, 20, 2}, { 20, 20, 5}, { 20, 20, 9}, { 20, 20, 14},
+ { 20, 20, 17}, { 20, 20, 21}, { 20, 20, 23}, { 20, 21, 1},
+ { 20, 21, 5}, { 20, 21, 9}, { 20, 21, 17}, { 20, 21, 23},
+ { 20, 22, 1}, { 20, 22, 2}, { 20, 22, 5}, { 20, 22, 9},
+ { 20, 22, 23}, { 20, 23, 1}, { 20, 23, 2}, { 20, 23, 5},
+ { 20, 23, 9}, { 20, 23, 17}, { 20, 23, 19}, { 20, 23, 21},
+ { 20, 23, 23}, { 20, 26, 1}, { 20, 26, 2}, { 20, 26, 5},
+ { 20, 26, 9}, { 20, 26, 17}, { 20, 26, 21}, { 20, 26, 23},
+ { 20, 27, 1}, { 20, 27, 2}, { 20, 27, 5}, { 20, 27, 7},
+ { 20, 27, 8}, { 20, 27, 9}, { 20, 27, 10}, { 20, 27, 17},
+ { 20, 27, 19}, { 20, 27, 21}, { 20, 27, 23}, { 20, 27, 27},
+ { 20, 28, 1}, { 20, 28, 5}, { 20, 28, 9}, { 20, 28, 17},
+ { 20, 28, 19}, { 20, 28, 23}, { 20, 29, 1}, { 20, 29, 2},
+ { 20, 29, 5}, { 20, 29, 9}, { 20, 29, 17}, { 20, 29, 19},
+ { 20, 29, 21}, { 20, 29, 23},
+};
+
+
+static const unsigned short ks_table2[][4] =
+{
+ {0xa4bf, 1, 3, 1}, {0xa4c0, 1, 4, 1},
+ {0xa4c1, 1, 5, 1}, {0xa4c2, 1, 6, 1},
+ {0xa4c3, 1, 7, 1}, {0xa4c4, 1, 10, 1},
+ {0xa4c5, 1, 11, 1}, {0xa4c6, 1, 12, 1},
+ {0xa4c7, 1, 13, 1}, {0xa4c8, 1, 14, 1},
+ {0xa4c9, 1, 15, 1}, {0xa4ca, 1, 18, 1},
+ {0xa4cb, 1, 19, 1}, {0xa4cc, 1, 20, 1},
+ {0xa4cd, 1, 21, 1}, {0xa4ce, 1, 22, 1},
+ {0xa4cf, 1, 23, 1}, {0xa4d0, 1, 26, 1},
+ {0xa4d1, 1, 27, 1}, {0xa4d2, 1, 28, 1},
+ {0xa4d3, 1, 29, 1}, {0xa4a1, 2, 2, 1},
+ {0xa4a2, 3, 2, 1}, {0xa4a4, 4, 2, 1},
+ {0xa4a7, 5, 2, 1}, {0xa4a8, 6, 2, 1},
+ {0xa4a9, 7, 2, 1}, {0xa4b1, 8, 2, 1},
+ {0xa4b2, 9, 2, 1}, {0xa4b3, 10, 2, 1},
+ {0xa4b5, 11, 2, 1}, {0xa4b6, 12, 2, 1},
+ {0xa4b7, 13, 2, 1}, {0xa4b8, 14, 2, 1},
+ {0xa4b9, 15, 2, 1}, {0xa4ba, 16, 2, 1},
+ {0xa4bb, 17, 2, 1}, {0xa4bc, 18, 2, 1},
+ {0xa4bd, 19, 2, 1}, {0xa4be, 20, 2, 1},
+};
+
+/* Á¶ÇÕÇü Ãʼº - ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+ * conversion: initial sound of compound type - ??? of completion type
+ */
+
+static const char_u johab_fcon_to_wan[] =
+{
+ 0,
+ 0xd4, 0xa1, 0xa2, 0xa4, 0xa7, /* (ä¿ò),¤¡,¤¢,¤¤,¤§ */
+ 0xa8, 0xa9, 0xb1, 0xb2, 0xb3, /* ¤¨,¤©,¤±,¤²,¤³ */
+ 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* ¤µ,¤¶,¤·,¤¸,¤¹ */
+ 0xba, 0xbb, 0xbc, 0xbd, 0xbe /* ¤º,¤»,¤¼,¤½,¤¾ */
+};
+
+/* Á¶ÇÕÇü Áß¼º -> ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+ * conversion: medial vowel of compound type - ??? of completion type
+ */
+
+static const char_u johab_vow_to_wan[] =
+{
+ 0, 0,
+ 0xd4, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, /* (ä¿ò),¤¿,¤À,¤Á,¤Â,¤Ã */
+ 0, 0,
+ 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, /* ¤Ä,¤Å,¤Æ,¤Ç,¤Ç¤¿,¤Ç¤À */
+ 0, 0,
+ 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* ¤Ç¤Ó,¤Ë,¤Ì,¤Ì¤Ã,¤Ì¤Ä,¤Ì¤Ó */
+ 0, 0,
+ 0xd0, 0xd1, 0xd2, 0xd3 /* ¤Ð,¤Ñ,¤Ñ¤Ó,¤Ó */
+};
+
+/* Á¶ÇÕÇü Á¾¼º -> ¿Ï¼ºÇü ³¹ÀÚ º¯È¯
+ * conversion: final consonant of compound type - ??? of completion type
+ */
+
+static const char_u johab_lcon_to_wan[] =
+{
+ 0,
+ 0xd4, 0xa1, 0xa2, 0xa3, 0xa4, /* (ä¿ò), ¤¡, ¤¢, ¤¡¤µ, ¤¤ */
+ 0xa5, 0xa6, 0xa7, 0xa9, 0xaa, /* ¤¤¤¸, ¤¤¤¾, ¤§, ¤©, ¤©¤¡ */
+ 0xab, 0xac, 0xad, 0xae, 0xaf, /* ¤©¤±, ¤©¤², ¤©¤µ, ¤©¤¼, ¤©¤½ */
+ 0xb0, 0xb1, 0, 0xb2, 0xb4, /* ¤©¤¾, ¤±, 0, ¤², ¤²¤µ */
+ 0xb5, 0xb6, 0xb7, 0xb8, 0xba, /* ¤µ, ¤¶, ¤·, ¤¸, ¤º */
+ 0xbb, 0xbc, 0xbd, 0xbe /* ¤», ¤¼, ¤½, ¤¾ */
+};
+
+ static void
+convert_ks_to_3(src, fp, mp, lp)
+ const char_u *src;
+ int *fp;
+ int *mp;
+ int *lp;
+{
+ int h = *src;
+ int low = *(src + 1);
+ int c;
+ int i;
+
+ if ((i = han_index(h, low)) >= 0
+ && i < sizeof(ks_table1)/sizeof(ks_table1[0]))
+ {
+ *fp = ks_table1[i][0];
+ *mp = ks_table1[i][1];
+ *lp = ks_table1[i][2];
+ }
+ else
+ {
+ c = (h << 8) | low;
+ for (i = 0; i < 40; i++)
+ if (ks_table2[i][0] == c)
+ {
+ *fp = ks_table2[i][1];
+ *mp = ks_table2[i][2];
+ *lp = ks_table2[i][3];
+ return;
+ }
+ *fp = 0xff; /* ±×·¡ÇÈ ÄÚµå (graphic code) */
+ *mp = h;
+ *lp = low;
+ }
+}
+
+ static int
+convert_3_to_ks(fv, mv, lv, des)
+ int fv;
+ int mv;
+ int lv;
+ char_u *des;
+{
+ char_u key[3];
+ register int hi, lo, mi = 0, result, found;
+
+ if (fv == 0xff)
+ {
+ des[0] = mv;
+ des[1] = lv;
+ return 2;
+ }
+ key[0] = fv;
+ key[1] = mv;
+ key[2] = lv;
+ lo = 0;
+ hi = sizeof(ks_table1)/3 - 1;
+ found = 0;
+ while (lo + 1 < hi)
+ {
+ mi = (lo + hi)/2;
+ result = STRNCMP(ks_table1[mi], key, 3);
+ if (result == 0)
+ {
+ found = 1;
+ break;
+ }
+ else if (result > 0)
+ hi = mi;
+ else
+ lo = mi;
+ }
+ if (!found)
+ {
+ if (!STRNCMP(ks_table1[lo], key, 3))
+ {
+ found = 1;
+ mi = lo;
+ }
+ if (!STRNCMP(ks_table1[hi], key, 3))
+ {
+ found = 1;
+ mi = hi;
+ }
+ }
+ if (!found)
+ {
+ for (mi = 0; mi < 40; mi++)
+ if (ks_table2[mi][1] == fv && ks_table2[mi][2] == mv &&
+ ks_table2[mi][3] == lv)
+ {
+ des[0] = (unsigned)(ks_table2[mi][0]) >> 8;
+ des[1] = ks_table2[mi][0];
+ return 2; /* found */
+ }
+ }
+ else
+ {
+ des[0] = mi / (0xff-0xa1) + 0xb0;
+ des[1] = mi % (0xff-0xa1) + 0xa1;
+ return 2; /* found */
+ }
+
+ /* ¿Ï¼ºÇü Ç¥¿¡ ¾ø´Ù. ``KS C 5601 - 1992 Á¤º¸ ±³È¯¿ë ºÎÈ£ Çؼ³''
+ * 3.3 Àý¿¡ ¼³¸íµÈ ¹æ¹ýÀ¸·Î encoding ÇÑ´Ù.
+ */
+
+ *des++ = 0xa4; /* ä¿ò */
+ *des++ = 0xd4;
+ *des++ = 0xa4; /* ³¹ÀÚ´Â ¸ðµÎ a4 Çà¿¡ ÀÖ´Ù. */
+ *des++ = johab_fcon_to_wan[fv];
+ *des++ = 0xa4;
+ *des++ = johab_vow_to_wan[mv];
+ *des++ = 0xa4;
+ *des++ = johab_lcon_to_wan[lv];
+ return 8;
+}
diff --git a/src/if_cscope.c b/src/if_cscope.c
new file mode 100644
index 000000000..eec3de8de
--- /dev/null
+++ b/src/if_cscope.c
@@ -0,0 +1,2270 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com>
+ * Ported to Win32 by Sergey Khorev <khorev@softlab.ru>
+ *
+ * The basic idea/structure of cscope for Vim was borrowed from Nvi. There
+ * might be a few lines of code that look similar to what Nvi has.
+ *
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_CSCOPE) || defined(PROTO)
+
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(UNIX)
+# include <sys/wait.h>
+#else
+ /* not UNIX, must be WIN32 */
+# include <io.h>
+# include <fcntl.h>
+# include <process.h>
+# define STDIN_FILENO 0
+# define STDOUT_FILENO 1
+# define STDERR_FILENO 2
+# define pipe(fds) _pipe(fds, 256, O_TEXT|O_NOINHERIT)
+#endif
+#include "if_cscope.h"
+
+static void cs_usage_msg __ARGS((csid_e x));
+static int cs_add __ARGS((exarg_T *eap));
+static void cs_stat_emsg __ARGS((char *fname));
+static int cs_add_common __ARGS((char *, char *, char *));
+static int cs_check_for_connections __ARGS((void));
+static int cs_check_for_tags __ARGS((void));
+static int cs_cnt_connections __ARGS((void));
+static void cs_reading_emsg __ARGS((int idx));
+static int cs_cnt_matches __ARGS((int idx));
+static char * cs_create_cmd __ARGS((char *csoption, char *pattern));
+static int cs_create_connection __ARGS((int i));
+static void do_cscope_general __ARGS((exarg_T *eap, int make_split));
+static void cs_file_results __ARGS((FILE *, int *));
+static void cs_fill_results __ARGS((char *, int , int *, char ***,
+ char ***, int *));
+static int cs_find __ARGS((exarg_T *eap));
+static int cs_find_common __ARGS((char *opt, char *pat, int, int ));
+static int cs_help __ARGS((exarg_T *eap));
+static void cs_init __ARGS((void));
+static void clear_csinfo __ARGS((int i));
+static int cs_insert_filelist __ARGS((char *, char *, char *,
+ struct stat *));
+static int cs_kill __ARGS((exarg_T *eap));
+static void cs_kill_execute __ARGS((int, char *));
+static cscmd_T * cs_lookup_cmd __ARGS((exarg_T *eap));
+static char * cs_make_vim_style_matches __ARGS((char *, char *,
+ char *, char *));
+static char * cs_manage_matches __ARGS((char **, char **, int, mcmd_e));
+static char * cs_parse_results __ARGS((int cnumber, char *buf, int bufsize, char **context, char **linenumber, char **search));
+static char * cs_pathcomponents __ARGS((char *path));
+static void cs_print_tags_priv __ARGS((char **, char **, int));
+static int cs_read_prompt __ARGS((int ));
+static void cs_release_csp __ARGS((int, int freefnpp));
+static int cs_reset __ARGS((exarg_T *eap));
+static char * cs_resolve_file __ARGS((int, char *));
+static int cs_show __ARGS((exarg_T *eap));
+
+
+static csinfo_T csinfo[CSCOPE_MAX_CONNECTIONS];
+static cscmd_T cs_cmds[] =
+{
+ { "add", cs_add,
+ N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 },
+ { "find", cs_find,
+ N_("Query for a pattern"), FIND_USAGE, 1 },
+ { "help", cs_help,
+ N_("Show this message"), "help", 0 },
+ { "kill", cs_kill,
+ N_("Kill a connection"), "kill #", 0 },
+ { "reset", cs_reset,
+ N_("Reinit all connections"), "reset", 0 },
+ { "show", cs_show,
+ N_("Show connections"), "show", 0 },
+ { NULL }
+};
+
+ static void
+cs_usage_msg(x)
+ csid_e x;
+{
+ (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
+}
+
+/*
+ * PRIVATE: do_cscope_general
+ *
+ * find the command, print help if invalid, and the then call the
+ * corresponding command function,
+ * called from do_cscope and do_scscope
+ */
+ static void
+do_cscope_general(eap, make_split)
+ exarg_T *eap;
+ int make_split; /* whether to split window */
+{
+ cscmd_T *cmdp;
+
+ cs_init();
+ if ((cmdp = cs_lookup_cmd(eap)) == NULL)
+ {
+ cs_help(eap);
+ return;
+ }
+
+#ifdef FEAT_WINDOWS
+ if (make_split)
+ {
+ if (!cmdp->cansplit)
+ {
+ (void)MSG_PUTS(_("This cscope command does not support splitting the window.\n"));
+ return;
+ }
+ postponed_split = -1;
+ postponed_split_flags = cmdmod.split;
+ }
+#endif
+
+ cmdp->func(eap);
+
+#ifdef FEAT_WINDOWS
+ postponed_split_flags = 0;
+#endif
+}
+
+/*
+ * PUBLIC: do_cscope
+ */
+ void
+do_cscope(eap)
+ exarg_T *eap;
+{
+ do_cscope_general(eap, FALSE);
+}
+
+/*
+ * PUBLIC: do_scscope
+ *
+ * same as do_cscope, but splits window, too.
+ */
+ void
+do_scscope(eap)
+ exarg_T *eap;
+{
+ do_cscope_general(eap, TRUE);
+}
+
+/*
+ * PUBLIC: do_cstag
+ *
+ */
+ void
+do_cstag(eap)
+ exarg_T *eap;
+{
+ int ret = FALSE;
+
+ cs_init();
+
+ if (eap->arg == NULL || strlen((const char *)(eap->arg)) == 0)
+ {
+ (void)EMSG(_("E562: Usage: cstag <ident>"));
+ return;
+ }
+
+ switch (p_csto)
+ {
+ case 0 :
+ if (cs_check_for_connections())
+ {
+ ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE);
+ if (ret == FALSE)
+ {
+ cs_free_tags();
+ if (msg_col)
+ msg_putchar('\n');
+
+ if (cs_check_for_tags())
+ ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
+ }
+ }
+ else if (cs_check_for_tags())
+ {
+ ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
+ }
+ break;
+ case 1 :
+ if (cs_check_for_tags())
+ {
+ ret = do_tag(eap->arg, DT_JUMP, 0, eap->forceit, FALSE);
+ if (ret == FALSE)
+ {
+ if (msg_col)
+ msg_putchar('\n');
+
+ if (cs_check_for_connections())
+ {
+ ret = cs_find_common("g", (char *)(eap->arg), eap->forceit,
+ FALSE);
+ if (ret == FALSE)
+ cs_free_tags();
+ }
+ }
+ }
+ else if (cs_check_for_connections())
+ {
+ ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE);
+ if (ret == FALSE)
+ cs_free_tags();
+ }
+ break;
+ default :
+ break;
+ }
+
+ if (!ret)
+ {
+ (void)EMSG(_("E257: cstag: tag not found"));
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ g_do_tagpreview = 0;
+#endif
+ }
+
+} /* do_cscope */
+
+
+/*
+ * PUBLIC: cs_find
+ *
+ * this simulates a vim_fgets(), but for cscope, returns the next line
+ * from the cscope output. should only be called from find_tags()
+ *
+ * returns TRUE if eof, FALSE otherwise
+ */
+ int
+cs_fgets(buf, size)
+ char_u *buf;
+ int size;
+{
+ char *p;
+
+ if ((p = cs_manage_matches(NULL, NULL, -1, Get)) == NULL)
+ return TRUE;
+
+ if ((int)strlen(p) > size)
+ {
+ strncpy((char *)buf, p, size - 1);
+ buf[size] = '\0';
+ }
+ else
+ (void)strcpy((char *)buf, p);
+
+ return FALSE;
+} /* cs_fgets */
+
+
+/*
+ * PUBLIC: cs_free_tags
+ *
+ * called only from do_tag(), when popping the tag stack
+ */
+ void
+cs_free_tags()
+{
+ cs_manage_matches(NULL, NULL, -1, Free);
+}
+
+
+/*
+ * PUBLIC: cs_print_tags
+ *
+ * called from do_tag()
+ */
+ void
+cs_print_tags()
+{
+ cs_manage_matches(NULL, NULL, -1, Print);
+}
+
+
+/*
+ * "cscope_connection([{num} , {dbpath} [, {prepend}]])" function
+ *
+ * Checks for the existence of a |cscope| connection. If no
+ * parameters are specified, then the function returns:
+ *
+ * 0, if cscope was not available (not compiled in), or if there
+ * are no cscope connections; or
+ * 1, if there is at least one cscope connection.
+ *
+ * If parameters are specified, then the value of {num}
+ * determines how existence of a cscope connection is checked:
+ *
+ * {num} Description of existence check
+ * ----- ------------------------------
+ * 0 Same as no parameters (e.g., "cscope_connection()").
+ * 1 Ignore {prepend}, and use partial string matches for
+ * {dbpath}.
+ * 2 Ignore {prepend}, and use exact string matches for
+ * {dbpath}.
+ * 3 Use {prepend}, use partial string matches for both
+ * {dbpath} and {prepend}.
+ * 4 Use {prepend}, use exact string matches for both
+ * {dbpath} and {prepend}.
+ *
+ * Note: All string comparisons are case sensitive!
+ */
+#if defined(FEAT_EVAL) || defined(PROTO)
+ int
+cs_connection(num, dbpath, ppath)
+ int num;
+ char_u *dbpath;
+ char_u *ppath;
+{
+ int i;
+
+ if (num < 0 || num > 4 || (num > 0 && !dbpath))
+ return FALSE;
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (!csinfo[i].fname)
+ continue;
+
+ if (num == 0)
+ return TRUE;
+
+ switch (num)
+ {
+ case 1:
+ if (strstr(csinfo[i].fname, (char *)dbpath))
+ return TRUE;
+ break;
+ case 2:
+ if (strcmp(csinfo[i].fname, (char *)dbpath) == 0)
+ return TRUE;
+ break;
+ case 3:
+ if (strstr(csinfo[i].fname, (char *)dbpath)
+ && ((!ppath && !csinfo[i].ppath)
+ || (ppath
+ && csinfo[i].ppath
+ && strstr(csinfo[i].ppath, (char *)ppath))))
+ return TRUE;
+ break;
+ case 4:
+ if ((strcmp(csinfo[i].fname, (char *)dbpath) == 0)
+ && ((!ppath && !csinfo[i].ppath)
+ || (ppath
+ && csinfo[i].ppath
+ && (strcmp(csinfo[i].ppath, (char *)ppath) == 0))))
+ return TRUE;
+ break;
+ }
+ }
+
+ return FALSE;
+} /* cs_connection */
+#endif
+
+
+/*
+ * PRIVATE functions
+ ****************************************************************************/
+
+/*
+ * PRIVATE: cs_add
+ *
+ * add cscope database or a directory name (to look for cscope.out)
+ * the the cscope connection list
+ *
+ * MAXPATHL 256
+ */
+/* ARGSUSED */
+ static int
+cs_add(eap)
+ exarg_T *eap;
+{
+ char *fname, *ppath, *flags = NULL;
+
+ if ((fname = strtok((char *)NULL, (const char *)" ")) == NULL)
+ {
+ cs_usage_msg(Add);
+ return CSCOPE_FAILURE;
+ }
+ if ((ppath = strtok((char *)NULL, (const char *)" ")) != NULL)
+ flags = strtok((char *)NULL, (const char *)" ");
+
+ return cs_add_common(fname, ppath, flags);
+}
+
+ static void
+cs_stat_emsg(fname)
+ char *fname;
+{
+ char *stat_emsg = _("E563: stat(%s) error: %d");
+ char *buf = (char *)alloc((unsigned)strlen(stat_emsg) + MAXPATHL + 10);
+
+ if (buf != NULL)
+ {
+ (void)sprintf(buf, stat_emsg, fname, errno);
+ (void)EMSG(buf);
+ vim_free(buf);
+ }
+ else
+ (void)EMSG(_("E563: stat error"));
+}
+
+
+/*
+ * PRIVATE: cs_add_common
+ *
+ * the common routine to add a new cscope connection. called by
+ * cs_add() and cs_reset(). i really don't like to do this, but this
+ * routine uses a number of goto statements.
+ */
+ static int
+cs_add_common(arg1, arg2, flags)
+ char *arg1; /* filename - may contain environment variables */
+ char *arg2; /* prepend path - may contain environment variables */
+ char *flags;
+{
+ struct stat statbuf;
+ int ret;
+ char *fname = NULL;
+ char *fname2 = NULL;
+ char *ppath = NULL;
+ int i;
+
+ /* get the filename (arg1), expand it, and try to stat it */
+ if ((fname = (char *)alloc(MAXPATHL+1)) == NULL)
+ goto add_err;
+
+ expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL);
+ ret = stat(fname, &statbuf);
+ if (ret < 0)
+ {
+staterr:
+ if (p_csverbose)
+ cs_stat_emsg(fname);
+ goto add_err;
+ }
+
+ /* get the prepend path (arg2), expand it, and try to stat it */
+ if (arg2 != NULL)
+ {
+ struct stat statbuf2;
+
+ if ((ppath = (char *)alloc(MAXPATHL+1)) == NULL)
+ goto add_err;
+
+ expand_env((char_u *)arg2, (char_u *)ppath, MAXPATHL);
+ ret = stat(ppath, &statbuf2);
+ if (ret < 0)
+ goto staterr;
+ }
+
+ /* if filename is a directory, append the cscope database name to it */
+ if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
+ {
+ fname2 = (char *)alloc(strlen(CSCOPE_DBFILE) + strlen(fname) + 2);
+ if (fname2 == NULL)
+ goto add_err;
+
+ while (fname[strlen(fname)-1] == '/'
+#ifdef WIN32
+ || fname[strlen(fname)-1] == '\\'
+#endif
+ )
+ {
+ fname[strlen(fname)-1] = '\0';
+ if (strlen(fname) == 0)
+ break;
+ }
+ if (fname[0] == '\0')
+ (void)sprintf(fname2, "/%s", CSCOPE_DBFILE);
+ else
+ (void)sprintf(fname2, "%s/%s", fname, CSCOPE_DBFILE);
+
+ ret = stat(fname2, &statbuf);
+ if (ret < 0)
+ {
+ if (p_csverbose)
+ cs_stat_emsg(fname2);
+ goto add_err;
+ }
+
+ i = cs_insert_filelist(fname2, ppath, flags, &statbuf);
+ }
+#if defined(UNIX)
+ else if (S_ISREG(statbuf.st_mode) || S_ISLNK(statbuf.st_mode))
+#else
+ /* substitute define S_ISREG from os_unix.h */
+ else if (((statbuf.st_mode) & S_IFMT) == S_IFREG)
+#endif
+ {
+ i = cs_insert_filelist(fname, ppath, flags, &statbuf);
+ }
+ else
+ {
+ if (p_csverbose)
+ (void)EMSG2(
+ _("E564: %s is not a directory or a valid cscope database"),
+ fname);
+ goto add_err;
+ }
+
+ if (i != -1)
+ {
+ if (cs_create_connection(i) == CSCOPE_FAILURE
+ || cs_read_prompt(i) == CSCOPE_FAILURE)
+ {
+ cs_release_csp(i, TRUE);
+ goto add_err;
+ }
+
+ if (p_csverbose)
+ {
+ msg_clr_eos();
+ (void)smsg_attr(hl_attr(HLF_R),
+ (char_u *)_("Added cscope database %s"),
+ csinfo[i].fname);
+ }
+ }
+
+ vim_free(fname);
+ vim_free(fname2);
+ vim_free(ppath);
+ return CSCOPE_SUCCESS;
+
+add_err:
+ vim_free(fname2);
+ vim_free(fname);
+ vim_free(ppath);
+ return CSCOPE_FAILURE;
+} /* cs_add_common */
+
+
+ static int
+cs_check_for_connections()
+{
+ return (cs_cnt_connections() > 0);
+} /* cs_check_for_connections */
+
+
+ static int
+cs_check_for_tags()
+{
+ return (p_tags[0] != NUL && curbuf->b_p_tags != NUL);
+} /* cs_check_for_tags */
+
+
+/*
+ * PRIVATE: cs_cnt_connections
+ *
+ * count the number of cscope connections
+ */
+ static int
+cs_cnt_connections()
+{
+ short i;
+ short cnt = 0;
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (csinfo[i].fname != NULL)
+ cnt++;
+ }
+ return cnt;
+} /* cs_cnt_connections */
+
+ static void
+cs_reading_emsg(idx)
+ int idx; /* connection index */
+{
+ EMSGN(_("E262: error reading cscope connection %ld"), idx);
+}
+
+#define CSREAD_BUFSIZE 2048
+/*
+ * PRIVATE: cs_cnt_matches
+ *
+ * count the number of matches for a given cscope connection.
+ */
+ static int
+cs_cnt_matches(idx)
+ int idx;
+{
+ char *stok;
+ char *buf;
+ int nlines;
+
+ buf = (char *)alloc(CSREAD_BUFSIZE);
+ if (buf == NULL)
+ return 0;
+ for (;;)
+ {
+ if (!fgets(buf, CSREAD_BUFSIZE, csinfo[idx].fr_fp))
+ {
+ if (feof(csinfo[idx].fr_fp))
+ errno = EIO;
+
+ cs_reading_emsg(idx);
+
+ vim_free(buf);
+ return -1;
+ }
+
+ /*
+ * If the database is out of date, or there's some other problem,
+ * cscope will output error messages before the number-of-lines output.
+ * Display/discard any output that doesn't match what we want.
+ */
+ if ((stok = strtok(buf, (const char *)" ")) == NULL)
+ continue;
+ if (strcmp((const char *)stok, "cscope:"))
+ continue;
+
+ if ((stok = strtok(NULL, (const char *)" ")) == NULL)
+ continue;
+ nlines = atoi(stok);
+ if (nlines < 0)
+ {
+ nlines = 0;
+ break;
+ }
+
+ if ((stok = strtok(NULL, (const char *)" ")) == NULL)
+ continue;
+ if (strncmp((const char *)stok, "lines", 5))
+ continue;
+
+ break;
+ }
+
+ vim_free(buf);
+ return nlines;
+} /* cs_cnt_matches */
+
+
+/*
+ * PRIVATE: cs_create_cmd
+ *
+ * Creates the actual cscope command query from what the user entered.
+ */
+ static char *
+cs_create_cmd(csoption, pattern)
+ char *csoption;
+ char *pattern;
+{
+ char *cmd;
+ short search;
+
+ switch (csoption[0])
+ {
+ case '0' : case 's' :
+ search = 0;
+ break;
+ case '1' : case 'g' :
+ search = 1;
+ break;
+ case '2' : case 'd' :
+ search = 2;
+ break;
+ case '3' : case 'c' :
+ search = 3;
+ break;
+ case '4' : case 't' :
+ search = 4;
+ break;
+ case '6' : case 'e' :
+ search = 6;
+ break;
+ case '7' : case 'f' :
+ search = 7;
+ break;
+ case '8' : case 'i' :
+ search = 8;
+ break;
+ default :
+ (void)EMSG(_("E561: unknown cscope search type"));
+ cs_usage_msg(Find);
+ return NULL;
+ }
+
+ if ((cmd = (char *)alloc(strlen(pattern) + 2)) == NULL)
+ return NULL;
+
+ (void)sprintf(cmd, "%d%s", search, pattern);
+
+ return cmd;
+} /* cs_create_cmd */
+
+
+/*
+ * PRIVATE: cs_create_connection
+ *
+ * This piece of code was taken/adapted from nvi. do we need to add
+ * the BSD license notice?
+ */
+ static int
+cs_create_connection(i)
+ int i;
+{
+ int to_cs[2], from_cs[2], len;
+ char *prog, *cmd, *ppath = NULL;
+#ifndef UNIX
+ int in_save, out_save, err_save;
+ int ph;
+# ifdef FEAT_GUI
+ HWND activewnd = NULL;
+ HWND consolewnd = NULL;
+# endif
+#endif
+
+ /*
+ * Cscope reads from to_cs[0] and writes to from_cs[1]; vi reads from
+ * from_cs[0] and writes to to_cs[1].
+ */
+ to_cs[0] = to_cs[1] = from_cs[0] = from_cs[1] = -1;
+ if (pipe(to_cs) < 0 || pipe(from_cs) < 0)
+ {
+ (void)EMSG(_("E566: Could not create cscope pipes"));
+err_closing:
+ if (to_cs[0] != -1)
+ (void)close(to_cs[0]);
+ if (to_cs[1] != -1)
+ (void)close(to_cs[1]);
+ if (from_cs[0] != -1)
+ (void)close(from_cs[0]);
+ if (from_cs[1] != -1)
+ (void)close(from_cs[1]);
+ return CSCOPE_FAILURE;
+ }
+
+#if defined(UNIX)
+ switch (csinfo[i].pid = fork())
+ {
+ case -1:
+ (void)EMSG(_("E622: Could not fork for cscope"));
+ goto err_closing;
+ case 0: /* child: run cscope. */
+#else
+ in_save = dup(STDIN_FILENO);
+ out_save = dup(STDOUT_FILENO);
+ err_save = dup(STDERR_FILENO);
+#endif
+ if (dup2(to_cs[0], STDIN_FILENO) == -1)
+ PERROR("cs_create_connection 1");
+ if (dup2(from_cs[1], STDOUT_FILENO) == -1)
+ PERROR("cs_create_connection 2");
+ if (dup2(from_cs[1], STDERR_FILENO) == -1)
+ PERROR("cs_create_connection 3");
+
+ /* close unused */
+#if defined(UNIX)
+ (void)close(to_cs[1]);
+ (void)close(from_cs[0]);
+#else
+ /* On win32 we must close opposite ends because we are the parent */
+ (void)close(to_cs[0]);
+ to_cs[0] = -1;
+ (void)close(from_cs[1]);
+ from_cs[1] = -1;
+#endif
+ /* expand the cscope exec for env var's */
+ if ((prog = (char *)alloc(MAXPATHL + 1)) == NULL)
+ {
+#ifdef UNIX
+ return CSCOPE_FAILURE;
+#else
+ goto err_closing;
+#endif
+ }
+ expand_env((char_u *)p_csprg, (char_u *)prog, MAXPATHL);
+
+ /* alloc space to hold the cscope command */
+ len = strlen(prog) + strlen(csinfo[i].fname) + 32;
+ if (csinfo[i].ppath)
+ {
+ /* expand the prepend path for env var's */
+ if ((ppath = (char *)alloc(MAXPATHL + 1)) == NULL)
+ {
+ vim_free(prog);
+#ifdef UNIX
+ return CSCOPE_FAILURE;
+#else
+ goto err_closing;
+#endif
+ }
+ expand_env((char_u *)csinfo[i].ppath, (char_u *)ppath, MAXPATHL);
+
+ len += strlen(ppath);
+ }
+
+ if (csinfo[i].flags)
+ len += strlen(csinfo[i].flags);
+
+ if ((cmd = (char *)alloc(len)) == NULL)
+ {
+ vim_free(prog);
+ vim_free(ppath);
+#ifdef UNIX
+ return CSCOPE_FAILURE;
+#else
+ goto err_closing;
+#endif
+ }
+
+ /* run the cscope command; is there execl for non-unix systems? */
+#if defined(UNIX)
+ (void)sprintf(cmd, "exec %s -dl -f %s", prog, csinfo[i].fname);
+#else
+ (void)sprintf(cmd, "%s -dl -f %s", prog, csinfo[i].fname);
+#endif
+ if (csinfo[i].ppath != NULL)
+ {
+ (void)strcat(cmd, " -P");
+ (void)strcat(cmd, csinfo[i].ppath);
+ }
+ if (csinfo[i].flags != NULL)
+ {
+ (void)strcat(cmd, " ");
+ (void)strcat(cmd, csinfo[i].flags);
+ }
+# ifdef UNIX
+ /* on Win32 we still need prog */
+ vim_free(prog);
+# endif
+ vim_free(ppath);
+
+#if defined(UNIX)
+ if (execl("/bin/sh", "sh", "-c", cmd, NULL) == -1)
+ PERROR(_("cs_create_connection exec failed"));
+
+ exit(127);
+ /* NOTREACHED */
+ default: /* parent. */
+#else
+# ifdef FEAT_GUI
+ activewnd = GetForegroundWindow(); /* on win9x cscope steals focus */
+ /* Dirty hack to hide annoying console window */
+ if (AllocConsole())
+ {
+ char *title;
+ title = (char *)alloc(1024);
+ if (title == NULL)
+ FreeConsole();
+ else
+ {
+ GetConsoleTitle(title, 1024); /* save for future restore */
+ SetConsoleTitle(
+ "GVIMCS{5499421B-CBEF-45b0-85EF-38167FDEA5C5}GVIMCS");
+ Sleep(40); /* as stated in MS KB we must wait 40 ms */
+ consolewnd = FindWindow(NULL,
+ "GVIMCS{5499421B-CBEF-45b0-85EF-38167FDEA5C5}GVIMCS");
+ if (consolewnd != NULL)
+ ShowWindow(consolewnd, SW_HIDE);
+ SetConsoleTitle(title);
+ vim_free(title);
+ }
+ }
+# endif
+ /* May be use &shell, &shellquote etc */
+# ifdef __BORLANDC__
+ /* BCC 5.5 uses a different function name for spawnlp */
+ ph = spawnlp(P_NOWAIT, prog, cmd, NULL);
+# else
+ ph = _spawnlp(_P_NOWAIT, prog, cmd, NULL);
+# endif
+ vim_free(prog);
+ vim_free(cmd);
+# ifdef FEAT_GUI
+ /* Dirty hack part two */
+ if (activewnd != NULL)
+ /* restoring focus */
+ SetForegroundWindow(activewnd);
+ if (consolewnd != NULL)
+ FreeConsole();
+
+# endif
+ if (ph == -1)
+ {
+ PERROR(_("cs_create_connection exec failed"));
+ (void)EMSG(_("E623: Could not spawn cscope process"));
+ goto err_closing;
+ }
+ /* else */
+ csinfo[i].pid = 0;
+ csinfo[i].hProc = (HANDLE)ph;
+
+#endif /* !UNIX */
+ /*
+ * Save the file descriptors for later duplication, and
+ * reopen as streams.
+ */
+ if ((csinfo[i].to_fp = fdopen(to_cs[1], "w")) == NULL)
+ PERROR(_("cs_create_connection: fdopen for to_fp failed"));
+ if ((csinfo[i].fr_fp = fdopen(from_cs[0], "r")) == NULL)
+ PERROR(_("cs_create_connection: fdopen for fr_fp failed"));
+
+#if defined(UNIX)
+ /* close unused */
+ (void)close(to_cs[0]);
+ (void)close(from_cs[1]);
+
+ break;
+ }
+#else
+ /* restore stdhandles */
+ dup2(in_save, STDIN_FILENO);
+ dup2(out_save, STDOUT_FILENO);
+ dup2(err_save, STDERR_FILENO);
+ close(in_save);
+ close(out_save);
+ close(err_save);
+#endif
+ return CSCOPE_SUCCESS;
+} /* cs_create_connection */
+
+
+/*
+ * PRIVATE: cs_find
+ *
+ * query cscope using command line interface. parse the output and use tselect
+ * to allow choices. like Nvi, creates a pipe to send to/from query/cscope.
+ *
+ * returns TRUE if we jump to a tag or abort, FALSE if not.
+ */
+ static int
+cs_find(eap)
+ exarg_T *eap;
+{
+ char *opt, *pat;
+
+ if (cs_check_for_connections() == FALSE)
+ {
+ (void)EMSG(_("E567: no cscope connections"));
+ return FALSE;
+ }
+
+ if ((opt = strtok((char *)NULL, (const char *)" ")) == NULL)
+ {
+ cs_usage_msg(Find);
+ return FALSE;
+ }
+
+ pat = opt + strlen(opt) + 1;
+ if (pat == NULL || (pat != NULL && pat[0] == '\0'))
+ {
+ cs_usage_msg(Find);
+ return FALSE;
+ }
+
+ return cs_find_common(opt, pat, eap->forceit, TRUE);
+} /* cs_find */
+
+
+/*
+ * PRIVATE: cs_find_common
+ *
+ * common code for cscope find, shared by cs_find() and do_cstag()
+ */
+ static int
+cs_find_common(opt, pat, forceit, verbose)
+ char *opt;
+ char *pat;
+ int forceit;
+ int verbose;
+{
+ int i;
+ char *cmd;
+ char **matches, **contexts;
+ int nummatches[CSCOPE_MAX_CONNECTIONS], totmatches, matched;
+#ifdef FEAT_QUICKFIX
+ char cmdletter;
+ char *qfpos;
+#endif
+
+ /* create the actual command to send to cscope */
+ cmd = cs_create_cmd(opt, pat);
+ if (cmd == NULL)
+ return FALSE;
+
+ /* send query to all open connections, then count the total number
+ * of matches so we can alloc matchesp all in one swell foop
+ */
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ nummatches[i] = 0;
+ totmatches = 0;
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (csinfo[i].fname == NULL)
+ continue;
+
+ /* send cmd to cscope */
+ (void)fprintf(csinfo[i].to_fp, "%s\n", cmd);
+ (void)fflush(csinfo[i].to_fp);
+
+ nummatches[i] = cs_cnt_matches(i);
+
+ if (nummatches[i] > -1)
+ totmatches += nummatches[i];
+
+ if (nummatches[i] == 0)
+ (void)cs_read_prompt(i);
+ }
+ vim_free(cmd);
+
+ if (totmatches == 0)
+ {
+ char *nf = _("E259: no matches found for cscope query %s of %s");
+ char *buf;
+
+ if (!verbose)
+ return FALSE;
+
+ buf = (char *)alloc(strlen(opt) + strlen(pat) + strlen(nf));
+ if (buf == NULL)
+ (void)EMSG(nf);
+ else
+ {
+ sprintf(buf, nf, opt, pat);
+ (void)EMSG(buf);
+ vim_free(buf);
+ }
+ return FALSE;
+ }
+
+#ifdef FEAT_QUICKFIX
+ /* get cmd letter */
+ switch (opt[0])
+ {
+ case '0' :
+ cmdletter = 's';
+ break;
+ case '1' :
+ cmdletter = 'g';
+ break;
+ case '2' :
+ cmdletter = 'd';
+ break;
+ case '3' :
+ cmdletter = 'c';
+ break;
+ case '4' :
+ cmdletter = 't';
+ break;
+ case '6' :
+ cmdletter = 'e';
+ break;
+ case '7' :
+ cmdletter = 'f';
+ break;
+ case '8' :
+ cmdletter = 'i';
+ break;
+ default :
+ cmdletter = opt[0];
+ }
+
+ qfpos = (char *)vim_strchr(p_csqf, cmdletter);
+ if (qfpos != NULL)
+ {
+ qfpos++;
+ /* next symbol must be + or - */
+ if (strchr(CSQF_FLAGS, *qfpos) == NULL)
+ {
+ char *nf = _("E469: invalid cscopequickfix flag %c for %c");
+ char *buf = (char *)alloc(strlen(nf));
+
+ /* strlen will be enough because we use chars */
+ if (buf != NULL)
+ {
+ sprintf(buf, nf, *qfpos, *(qfpos-1));
+ (void)EMSG(buf);
+ vim_free(buf);
+ }
+ return FALSE;
+ }
+ }
+ if (qfpos != NULL && *qfpos != '0' && totmatches > 1)
+ {
+ /* fill error list */
+ FILE *f;
+ char_u *tmp = vim_tempname('c');
+
+ f = fopen((char *)tmp, "w");
+ cs_file_results(f, nummatches);
+ fclose(f);
+ /* '-' starts a new error list */
+ if (qf_init(tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0)
+ {
+# ifdef FEAT_WINDOWS
+ if (postponed_split != 0)
+ {
+ win_split(postponed_split > 0 ? postponed_split : 0,
+ postponed_split_flags);
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ postponed_split = 0;
+ }
+# endif
+ qf_jump(0, 0, forceit);
+ }
+ mch_remove(tmp);
+ vim_free(tmp);
+ return TRUE;
+ }
+ else
+#endif /* FEAT_QUICKFIX */
+ {
+ /* read output */
+ cs_fill_results((char *)pat, totmatches, nummatches, &matches,
+ &contexts, &matched);
+ if (matches == NULL)
+ return FALSE;
+
+ (void)cs_manage_matches(matches, contexts, totmatches, Store);
+
+ return do_tag((char_u *)pat, DT_CSCOPE, 0, forceit, verbose);
+ }
+
+} /* cs_find_common */
+
+/*
+ * PRIVATE: cs_help
+ *
+ * print help
+ */
+/* ARGSUSED */
+ static int
+cs_help(eap)
+ exarg_T *eap;
+{
+ cscmd_T *cmdp = cs_cmds;
+
+ (void)MSG_PUTS(_("cscope commands:\n"));
+ while (cmdp->name != NULL)
+ {
+ (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
+ cmdp->name, _(cmdp->help), cmdp->usage);
+ if (strcmp(cmdp->name, "find") == 0)
+ MSG_PUTS(FIND_HELP);
+ cmdp++;
+ }
+
+ wait_return(TRUE);
+ return 0;
+} /* cs_help */
+
+
+/*
+ * PRIVATE: cs_init
+ *
+ * initialize cscope structure if not already
+ */
+ static void
+cs_init()
+{
+ short i;
+ static int init_already = FALSE;
+
+ if (init_already)
+ return;
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ clear_csinfo(i);
+
+ init_already = TRUE;
+} /* cs_init */
+
+ static void
+clear_csinfo(i)
+ int i;
+{
+ csinfo[i].fname = NULL;
+ csinfo[i].ppath = NULL;
+ csinfo[i].flags = NULL;
+#if defined(UNIX)
+ csinfo[i].st_dev = (dev_t)0;
+ csinfo[i].st_ino = (ino_t)0;
+#else
+ csinfo[i].nVolume = 0;
+ csinfo[i].nIndexHigh = 0;
+ csinfo[i].nIndexLow = 0;
+#endif
+ csinfo[i].pid = -1;
+ csinfo[i].fr_fp = NULL;
+ csinfo[i].to_fp = NULL;
+}
+
+#ifndef UNIX
+static char *GetWin32Error __ARGS((void));
+
+ static char *
+GetWin32Error()
+{
+ char *msg = NULL;
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, GetLastError(), 0, (LPSTR)&msg, 0, NULL);
+ if (msg != NULL)
+ {
+ /* remove trailing \r\n */
+ char *pcrlf = strstr(msg, "\r\n");
+ if (pcrlf != NULL)
+ *pcrlf = '\0';
+ }
+ return msg;
+}
+#endif
+/*
+ * PRIVATE: cs_insert_filelist
+ *
+ * insert a new cscope database filename into the filelist
+ */
+ static int
+cs_insert_filelist(fname, ppath, flags, sb)
+ char *fname;
+ char *ppath;
+ char *flags;
+ struct stat *sb;
+{
+ short i, j;
+#ifndef UNIX
+ HANDLE hFile;
+ BY_HANDLE_FILE_INFORMATION bhfi;
+
+ vim_memset(&bhfi, 0, sizeof(bhfi));
+ /* On windows 9x GetFileInformationByHandle doesn't work, so skip it */
+ if (!mch_windows95())
+ {
+ hFile = CreateFile(fname, FILE_READ_ATTRIBUTES, 0, NULL, OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if (p_csverbose)
+ {
+ char *cant_msg = _("E625: cannot open cscope database: %s");
+ char *winmsg = GetWin32Error();
+
+ if (winmsg != NULL)
+ {
+ (void)EMSG2(cant_msg, winmsg);
+ LocalFree(winmsg);
+ }
+ else
+ /* subst filename if can't get error text */
+ (void)EMSG2(cant_msg, fname);
+ }
+ return -1;
+ }
+ if (!GetFileInformationByHandle(hFile, &bhfi))
+ {
+ CloseHandle(hFile);
+ if (p_csverbose)
+ (void)EMSG(_("E626: cannot get cscope database information"));
+ return -1;
+ }
+ CloseHandle(hFile);
+ }
+#endif
+
+ i = -1; /* can be set to the index of an empty item in csinfo */
+ for (j = 0; j < CSCOPE_MAX_CONNECTIONS; j++)
+ {
+ if (csinfo[j].fname != NULL
+#if defined(UNIX)
+ && csinfo[j].st_dev == sb->st_dev && csinfo[j].st_ino == sb->st_ino
+#else
+ /* compare pathnames first */
+ && ((fullpathcmp(csinfo[j].fname, fname, FALSE) & FPC_SAME)
+ /* if not Windows 9x, test index file atributes too */
+ || (!mch_windows95()
+ && csinfo[j].nVolume == bhfi.dwVolumeSerialNumber
+ && csinfo[j].nIndexHigh == bhfi.nFileIndexHigh
+ && csinfo[j].nIndexLow == bhfi.nFileIndexLow))
+#endif
+ )
+ {
+ if (p_csverbose)
+ (void)EMSG(_("E568: duplicate cscope database not added"));
+ return -1;
+ }
+
+ if (csinfo[j].fname == NULL && i == -1)
+ i = j; /* remember first empty entry */
+ }
+
+ if (i == -1)
+ {
+ if (p_csverbose)
+ (void)EMSG(_("E569: maximum number of cscope connections reached"));
+ return -1;
+ }
+
+ if ((csinfo[i].fname = (char *)alloc(strlen(fname)+1)) == NULL)
+ return -1;
+
+ (void)strcpy(csinfo[i].fname, (const char *)fname);
+
+ if (ppath != NULL)
+ {
+ if ((csinfo[i].ppath = (char *)alloc(strlen(ppath) + 1)) == NULL)
+ {
+ vim_free(csinfo[i].fname);
+ csinfo[i].fname = NULL;
+ return -1;
+ }
+ (void)strcpy(csinfo[i].ppath, (const char *)ppath);
+ } else
+ csinfo[i].ppath = NULL;
+
+ if (flags != NULL)
+ {
+ if ((csinfo[i].flags = (char *)alloc(strlen(flags) + 1)) == NULL)
+ {
+ vim_free(csinfo[i].fname);
+ vim_free(csinfo[i].ppath);
+ csinfo[i].fname = NULL;
+ csinfo[i].ppath = NULL;
+ return -1;
+ }
+ (void)strcpy(csinfo[i].flags, (const char *)flags);
+ } else
+ csinfo[i].flags = NULL;
+
+#if defined(UNIX)
+ csinfo[i].st_dev = sb->st_dev;
+ csinfo[i].st_ino = sb->st_ino;
+
+#else
+ csinfo[i].nVolume = bhfi.dwVolumeSerialNumber;
+ csinfo[i].nIndexLow = bhfi.nFileIndexLow;
+ csinfo[i].nIndexHigh = bhfi.nFileIndexHigh;
+#endif
+ return i;
+} /* cs_insert_filelist */
+
+
+/*
+ * PRIVATE: cs_lookup_cmd
+ *
+ * find cscope command in command table
+ */
+ static cscmd_T *
+cs_lookup_cmd(eap)
+ exarg_T *eap;
+{
+ cscmd_T *cmdp;
+ char *stok;
+ size_t len;
+
+ if (eap->arg == NULL)
+ return NULL;
+
+ if ((stok = strtok((char *)(eap->arg), (const char *)" ")) == NULL)
+ return NULL;
+
+ len = strlen(stok);
+ for (cmdp = cs_cmds; cmdp->name != NULL; ++cmdp)
+ {
+ if (strncmp((const char *)(stok), cmdp->name, len) == 0)
+ return (cmdp);
+ }
+ return NULL;
+} /* cs_lookup_cmd */
+
+
+/*
+ * PRIVATE: cs_kill
+ *
+ * nuke em
+ */
+/* ARGSUSED */
+ static int
+cs_kill(eap)
+ exarg_T *eap;
+{
+ char *stok;
+ short i;
+
+ if ((stok = strtok((char *)NULL, (const char *)" ")) == NULL)
+ {
+ cs_usage_msg(Kill);
+ return CSCOPE_FAILURE;
+ }
+
+ /* only single digit positive and negative integers are allowed */
+ if ((strlen(stok) < 2 && VIM_ISDIGIT((int)(stok[0])))
+ || (strlen(stok) < 3 && stok[0] == '-'
+ && VIM_ISDIGIT((int)(stok[1]))))
+ i = atoi(stok);
+ else
+ {
+ /* It must be part of a name. We will try to find a match
+ * within all the names in the csinfo data structure
+ */
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok))
+ break;
+ }
+ }
+
+ if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL)
+ && i != -1)
+ {
+ if (p_csverbose)
+ (void)EMSG2(_("E261: cscope connection %s not found"), stok);
+ }
+ else
+ {
+ if (i == -1)
+ {
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (csinfo[i].fname)
+ cs_kill_execute(i, csinfo[i].fname);
+ }
+ }
+ else
+ cs_kill_execute(i, stok);
+ }
+
+ return 0;
+} /* cs_kill */
+
+
+/*
+ * PRIVATE: cs_kill_execute
+ *
+ * Actually kills a specific cscope connection.
+ */
+ static void
+cs_kill_execute(i, cname)
+ int i; /* cscope table index */
+ char *cname; /* cscope database name */
+{
+ if (p_csverbose)
+ {
+ msg_clr_eos();
+ (void)smsg_attr(hl_attr(HLF_R) | MSG_HIST,
+ (char_u *)_("cscope connection %s closed"), cname);
+ }
+ cs_release_csp(i, TRUE);
+}
+
+
+/*
+ * PRIVATE: cs_make_vim_style_matches
+ *
+ * convert the cscope output into into a ctags style entry (as might be found
+ * in a ctags tags file). there's one catch though: cscope doesn't tell you
+ * the type of the tag you are looking for. for example, in Darren Hiebert's
+ * ctags (the one that comes with vim), #define's use a line number to find the
+ * tag in a file while function definitions use a regexp search pattern.
+ *
+ * i'm going to always use the line number because cscope does something
+ * quirky (and probably other things i don't know about):
+ *
+ * if you have "# define" in your source file, which is
+ * perfectly legal, cscope thinks you have "#define". this
+ * will result in a failed regexp search. :(
+ *
+ * besides, even if this particular case didn't happen, the search pattern
+ * would still have to be modified to escape all the special regular expression
+ * characters to comply with ctags formatting.
+ */
+ static char *
+cs_make_vim_style_matches(fname, slno, search, tagstr)
+ char *fname;
+ char *slno;
+ char *search;
+ char *tagstr;
+{
+ /* vim style is ctags:
+ *
+ * <tagstr>\t<filename>\t<linenum_or_search>"\t<extra>
+ *
+ * but as mentioned above, we'll always use the line number and
+ * put the search pattern (if one exists) as "extra"
+ *
+ * buf is used as part of vim's method of handling tags, and
+ * (i think) vim frees it when you pop your tags and get replaced
+ * by new ones on the tag stack.
+ */
+ char *buf;
+ int amt;
+
+ if (search != NULL)
+ {
+ amt = strlen(fname) + strlen(slno) + strlen(tagstr) + strlen(search)+6;
+ if ((buf = (char *)alloc(amt)) == NULL)
+ return NULL;
+
+ (void)sprintf(buf, "%s\t%s\t%s;\"\t%s", tagstr, fname, slno, search);
+ }
+ else
+ {
+ amt = strlen(fname) + strlen(slno) + strlen(tagstr) + 5;
+ if ((buf = (char *)alloc(amt)) == NULL)
+ return NULL;
+
+ (void)sprintf(buf, "%s\t%s\t%s;\"", tagstr, fname, slno);
+ }
+
+ return buf;
+} /* cs_make_vim_style_matches */
+
+
+/*
+ * PRIVATE: cs_manage_matches
+ *
+ * this is kind of hokey, but i don't see an easy way round this..
+ *
+ * Store: keep a ptr to the (malloc'd) memory of matches originally
+ * generated from cs_find(). the matches are originally lines directly
+ * from cscope output, but transformed to look like something out of a
+ * ctags. see cs_make_vim_style_matches for more details.
+ *
+ * Get: used only from cs_fgets(), this simulates a vim_fgets() to return
+ * the next line from the cscope output. it basically keeps track of which
+ * lines have been "used" and returns the next one.
+ *
+ * Free: frees up everything and resets
+ *
+ * Print: prints the tags
+ */
+ static char *
+cs_manage_matches(matches, contexts, totmatches, cmd)
+ char **matches;
+ char **contexts;
+ int totmatches;
+ mcmd_e cmd;
+{
+ static char **mp = NULL;
+ static char **cp = NULL;
+ static int cnt = -1;
+ static int next = -1;
+ char *p = NULL;
+
+ switch (cmd)
+ {
+ case Store:
+ assert(matches != NULL);
+ assert(totmatches > 0);
+ if (mp != NULL || cp != NULL)
+ (void)cs_manage_matches(NULL, NULL, -1, Free);
+ mp = matches;
+ cp = contexts;
+ cnt = totmatches;
+ next = 0;
+ break;
+ case Get:
+ if (next >= cnt)
+ return NULL;
+
+ p = mp[next];
+ next++;
+ break;
+ case Free:
+ if (mp != NULL)
+ {
+ if (cnt > 0)
+ while (cnt--)
+ {
+ vim_free(mp[cnt]);
+ if (cp != NULL)
+ vim_free(cp[cnt]);
+ }
+ vim_free(mp);
+ vim_free(cp);
+ }
+ mp = NULL;
+ cp = NULL;
+ cnt = 0;
+ next = 0;
+ break;
+ case Print:
+ cs_print_tags_priv(mp, cp, cnt);
+ break;
+ default: /* should not reach here */
+ (void)EMSG(_("E570: fatal error in cs_manage_matches"));
+ return NULL;
+ }
+
+ return p;
+} /* cs_manage_matches */
+
+
+/*
+ * PRIVATE: cs_parse_results
+ *
+ * parse cscope output
+ */
+ static char *
+cs_parse_results(cnumber, buf, bufsize, context, linenumber, search)
+ int cnumber;
+ char *buf;
+ int bufsize;
+ char **context;
+ char **linenumber;
+ char **search;
+{
+ int ch;
+ char *p;
+ char *name;
+
+ if (fgets(buf, bufsize, csinfo[cnumber].fr_fp) == NULL)
+ {
+ if (feof(csinfo[cnumber].fr_fp))
+ errno = EIO;
+
+ cs_reading_emsg(cnumber);
+
+ return NULL;
+ }
+
+ /* If the line's too long for the buffer, discard it. */
+ if ((p = strchr(buf, '\n')) == NULL)
+ {
+ while ((ch = getc(csinfo[cnumber].fr_fp)) != EOF && ch != '\n')
+ ;
+ return NULL;
+ }
+ *p = '\0';
+
+ /*
+ * cscope output is in the following format:
+ *
+ * <filename> <context> <line number> <pattern>
+ */
+ if ((name = strtok((char *)buf, (const char *)" ")) == NULL)
+ return NULL;
+ if ((*context = strtok(NULL, (const char *)" ")) == NULL)
+ return NULL;
+ if ((*linenumber = strtok(NULL, (const char *)" ")) == NULL)
+ return NULL;
+ *search = *linenumber + strlen(*linenumber) + 1; /* +1 to skip \0 */
+
+ /* --- nvi ---
+ * If the file is older than the cscope database, that is,
+ * the database was built since the file was last modified,
+ * or there wasn't a search string, use the line number.
+ */
+ if (strcmp(*search, "<unknown>") == 0)
+ *search = NULL;
+
+ name = cs_resolve_file(cnumber, name);
+ return name;
+}
+
+/*
+ * PRIVATE: cs_file_results
+ *
+ * write cscope find results to file
+ */
+ static void
+cs_file_results(f, nummatches_a)
+ FILE *f;
+ int *nummatches_a;
+{
+ int i, j;
+ char *buf;
+ char *search, *slno;
+ char *fullname;
+ char *cntx;
+ char *context;
+
+ buf = (char *)alloc(CSREAD_BUFSIZE);
+ if (buf == NULL)
+ return;
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (nummatches_a[i] < 1)
+ continue;
+
+ for (j = 0; j < nummatches_a[i]; j++)
+ {
+ if ((fullname=cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx,
+ &slno, &search))==NULL)
+ continue;
+
+ context = (char *)alloc(strlen(cntx)+5);
+ if (context==NULL)
+ continue;
+
+ if (strcmp(cntx, "<global>")==0)
+ strcpy(context, "<<global>>");
+ else
+ sprintf(context, "<<%s>>", cntx);
+
+ if (search==NULL)
+ fprintf(f, "%s\t%s\t%s\n", fullname, slno, context);
+ else
+ fprintf(f, "%s\t%s\t%s %s\n", fullname, slno, context, search);
+
+ vim_free(context);
+ vim_free(fullname);
+ } /* for all matches */
+
+ (void)cs_read_prompt(i);
+
+ } /* for all cscope connections */
+ vim_free(buf);
+}
+
+/*
+ * PRIVATE: cs_fill_results
+ *
+ * get parsed cscope output and calls cs_make_vim_style_matches to convert
+ * into ctags format
+ */
+ static void
+cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
+ char *tagstr;
+ int totmatches;
+ int *nummatches_a;
+ char ***matches_p;
+ char ***cntxts_p;
+ int *matched;
+{
+ int i, j;
+ char *buf;
+ char *search, *slno;
+ int totsofar = 0;
+ char **matches = NULL;
+ char **cntxts = NULL;
+ char *fullname;
+ char *cntx;
+
+ assert(totmatches > 0);
+
+ buf = (char *)alloc(CSREAD_BUFSIZE);
+ if (buf == NULL)
+ return;
+
+ if ((matches = (char **)alloc(sizeof(char *) * totmatches)) == NULL)
+ goto parse_out;
+ if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL)
+ goto parse_out;
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (nummatches_a[i] < 1)
+ continue;
+
+ for (j = 0; j < nummatches_a[i]; j++)
+ {
+ if ((fullname = cs_parse_results(i, buf, CSREAD_BUFSIZE, &cntx,
+ &slno, &search)) == NULL)
+ continue;
+
+ matches[totsofar] = cs_make_vim_style_matches(fullname, slno,
+ search, tagstr);
+
+ vim_free(fullname);
+
+ if (strcmp(cntx, "<global>") == 0)
+ cntxts[totsofar] = NULL;
+ else
+ /* note: if vim_strsave returns NULL, then the context
+ * will be "<global>", which is misleading.
+ */
+ cntxts[totsofar] = (char *)vim_strsave((char_u *)cntx);
+
+ if (matches[totsofar] != NULL)
+ totsofar++;
+
+ } /* for all matches */
+
+ (void)cs_read_prompt(i);
+
+ } /* for all cscope connections */
+
+parse_out:
+ *matched = totsofar;
+ *matches_p = matches;
+ *cntxts_p = cntxts;
+ vim_free(buf);
+} /* cs_fill_results */
+
+
+/* get the requested path components */
+ static char *
+cs_pathcomponents(path)
+ char *path;
+{
+ int i;
+ char *s;
+
+ if (p_cspc == 0)
+ return path;
+
+ s = path + strlen(path) - 1;
+ for (i = 0; i < p_cspc; ++i)
+ while (s > path && *--s != '/'
+#ifdef WIN32
+ && *--s != '\\'
+#endif
+ )
+ ;
+ if ((s > path && *s == '/')
+#ifdef WIN32
+ || (s > path && *s == '\\')
+#endif
+ )
+ ++s;
+ return s;
+}
+
+/*
+ * PRIVATE: cs_print_tags_priv
+ *
+ * called from cs_manage_matches()
+ */
+ static void
+cs_print_tags_priv(matches, cntxts, num_matches)
+ char **matches;
+ char **cntxts;
+ int num_matches;
+{
+ char *buf = NULL;
+ int bufsize = 0; /* Track available bufsize */
+ int newsize = 0;
+ char *ptag;
+ char *fname, *lno, *extra, *tbuf;
+ int i, idx, num;
+ char *globalcntx = "GLOBAL";
+ char *cntxformat = " <<%s>>";
+ char *context;
+ char *cstag_msg = _("Cscope tag: %s");
+ char *csfmt_str = "%4d %6s ";
+
+ assert (num_matches > 0);
+
+ if ((tbuf = (char *)alloc(strlen(matches[0]) + 1)) == NULL)
+ return;
+
+ strcpy(tbuf, matches[0]);
+ ptag = strtok(tbuf, "\t");
+
+ newsize = strlen(cstag_msg) + strlen(ptag);
+ buf = (char *)alloc(newsize);
+ if (buf != NULL)
+ {
+ bufsize = newsize;
+ (void)sprintf(buf, cstag_msg, ptag);
+ MSG_PUTS_ATTR(buf, hl_attr(HLF_T));
+ }
+
+ vim_free(tbuf);
+
+ MSG_PUTS_ATTR(_("\n # line"), hl_attr(HLF_T)); /* strlen is 7 */
+ msg_advance(msg_col + 2);
+ MSG_PUTS_ATTR(_("filename / context / line\n"), hl_attr(HLF_T));
+
+ num = 1;
+ for (i = 0; i < num_matches; i++)
+ {
+ idx = i;
+
+ /* if we really wanted to, we could avoid this malloc and strcpy
+ * by parsing matches[i] on the fly and placing stuff into buf
+ * directly, but that's too much of a hassle
+ */
+ if ((tbuf = (char *)alloc(strlen(matches[idx]) + 1)) == NULL)
+ continue;
+ (void)strcpy(tbuf, matches[idx]);
+
+ if ((fname = strtok(tbuf, (const char *)"\t")) == NULL)
+ continue;
+ if ((fname = strtok(NULL, (const char *)"\t")) == NULL)
+ continue;
+ if ((lno = strtok(NULL, (const char *)"\t")) == NULL)
+ {
+ /* if NULL, then no "extra", although in cscope's case, there
+ * should always be "extra".
+ */
+ extra = NULL;
+ }
+
+ extra = lno + strlen(lno) + 1;
+
+ lno[strlen(lno)-2] = '\0'; /* ignore ;" at the end */
+
+ /* hopefully 'num' (num of matches) will be less than 10^16 */
+ newsize = strlen(csfmt_str) + 16 + strlen(lno);
+ if (bufsize < newsize)
+ {
+ buf = (char *)vim_realloc(buf, newsize);
+ if (buf == NULL)
+ bufsize = 0;
+ else
+ bufsize = newsize;
+ }
+ if (buf != NULL)
+ {
+ /* csfmt_str = "%4d %6s "; */
+ (void)sprintf(buf, csfmt_str, num, lno);
+ MSG_PUTS_ATTR(buf, hl_attr(HLF_CM));
+ }
+ MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), hl_attr(HLF_CM));
+
+ /* compute the required space for the context */
+ if (cntxts[idx] != NULL)
+ context = cntxts[idx];
+ else
+ context = globalcntx;
+ newsize = strlen(context) + strlen(cntxformat);
+
+ if (bufsize < newsize)
+ {
+ buf = (char *)vim_realloc(buf, newsize);
+ if (buf == NULL)
+ bufsize = 0;
+ else
+ bufsize = newsize;
+ }
+ if (buf != NULL)
+ {
+ (void)sprintf(buf, cntxformat, context);
+
+ /* print the context only if it fits on the same line */
+ if (msg_col + (int)strlen(buf) >= (int)Columns)
+ msg_putchar('\n');
+ msg_advance(12);
+ MSG_PUTS_LONG(buf);
+ msg_putchar('\n');
+ }
+ if (extra != NULL)
+ {
+ msg_advance(13);
+ MSG_PUTS_LONG(extra);
+ }
+
+ vim_free(tbuf); /* only after printing extra due to strtok use */
+
+ if (msg_col)
+ msg_putchar('\n');
+
+ ui_breakcheck();
+ if (got_int)
+ {
+ got_int = FALSE; /* don't print any more matches */
+ break;
+ }
+
+ num++;
+ } /* for all matches */
+
+ vim_free(buf);
+} /* cs_print_tags_priv */
+
+
+/*
+ * PRIVATE: cs_read_prompt
+ *
+ * read a cscope prompt (basically, skip over the ">> ")
+ */
+ static int
+cs_read_prompt(i)
+ int i;
+{
+ int ch;
+ char *buf = NULL; /* buffer for possible error message from cscope */
+ int bufpos = 0;
+ char *cs_emsg;
+ int maxlen;
+ static char *eprompt = "Press the RETURN key to continue:";
+ int epromptlen = strlen(eprompt);
+ int n;
+
+ cs_emsg = _("E609: Cscope error: %s");
+ /* compute maximum allowed len for Cscope error message */
+ maxlen = (int)(IOSIZE - strlen(cs_emsg));
+
+ for (;;)
+ {
+ while ((ch = getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0])
+ /* if there is room and char is printable */
+ if (bufpos < maxlen - 1 && vim_isprintc(ch))
+ {
+ if (buf == NULL) /* lazy buffer allocation */
+ buf = (char *)alloc(maxlen);
+ if (buf != NULL)
+ {
+ /* append character to the message */
+ buf[bufpos++] = ch;
+ buf[bufpos] = NUL;
+ if (bufpos >= epromptlen
+ && strcmp(&buf[bufpos - epromptlen], eprompt) == 0)
+ {
+ /* remove eprompt from buf */
+ buf[bufpos - epromptlen] = NUL;
+
+ /* print message to user */
+ (void)EMSG2(cs_emsg, buf);
+
+ /* send RETURN to cscope */
+ (void)putc('\n', csinfo[i].to_fp);
+ (void)fflush(csinfo[i].to_fp);
+
+ /* clear buf */
+ bufpos = 0;
+ buf[bufpos] = NUL;
+ }
+ }
+ }
+
+ for (n = 0; n < (int)strlen(CSCOPE_PROMPT); ++n)
+ {
+ if (n > 0)
+ ch = getc(csinfo[i].fr_fp);
+ if (ch == EOF)
+ {
+ PERROR("cs_read_prompt EOF");
+ if (buf != NULL && buf[0] != NUL)
+ (void)EMSG2(cs_emsg, buf);
+ else if (p_csverbose)
+ cs_reading_emsg(i); /* don't have additional information */
+ cs_release_csp(i, TRUE);
+ vim_free(buf);
+ return CSCOPE_FAILURE;
+ }
+
+ if (ch != CSCOPE_PROMPT[n])
+ {
+ ch = EOF;
+ break;
+ }
+ }
+
+ if (ch == EOF)
+ continue; /* didn't find the prompt */
+ break; /* did find the prompt */
+ }
+
+ vim_free(buf);
+ return CSCOPE_SUCCESS;
+}
+
+
+/*
+ * PRIVATE: cs_release_csp
+ *
+ * does the actual free'ing for the cs ptr with an optional flag of whether
+ * or not to free the filename. called by cs_kill and cs_reset.
+ */
+ static void
+cs_release_csp(i, freefnpp)
+ int i;
+ int freefnpp;
+{
+#if defined(UNIX)
+ int pstat;
+#else
+ /*
+ * Trying to exit normally (not sure whether it is fit to UNIX cscope
+ */
+ if (csinfo[i].to_fp != NULL)
+ {
+ (void)fputs("q\n", csinfo[i].to_fp);
+ (void)fflush(csinfo[i].to_fp);
+ }
+ /* give cscope chance to exit normally */
+ if (csinfo[i].hProc > 0
+ && WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT)
+ TerminateProcess(csinfo[i].hProc, 0);
+#endif
+
+ if (csinfo[i].fr_fp != NULL)
+ (void)fclose(csinfo[i].fr_fp);
+ if (csinfo[i].to_fp != NULL)
+ (void)fclose(csinfo[i].to_fp);
+
+ /*
+ * Safety check: If the PID would be zero here, the entire X session would
+ * be killed. -1 and 1 are dangerous as well.
+ */
+#if defined(UNIX)
+ if (csinfo[i].pid > 1)
+ {
+ kill(csinfo[i].pid, SIGTERM);
+ (void)waitpid(csinfo[i].pid, &pstat, 0);
+ }
+#endif
+
+ if (freefnpp)
+ {
+ vim_free(csinfo[i].fname);
+ vim_free(csinfo[i].ppath);
+ vim_free(csinfo[i].flags);
+ }
+
+ clear_csinfo(i);
+} /* cs_release_csp */
+
+
+/*
+ * PRIVATE: cs_reset
+ *
+ * calls cs_kill on all cscope connections then reinits
+ */
+/* ARGSUSED */
+ static int
+cs_reset(eap)
+ exarg_T *eap;
+{
+ char **dblist = NULL, **pplist = NULL, **fllist = NULL;
+ int i;
+ char buf[8]; /* for sprintf " (#%d)" */
+
+ /* malloc our db and ppath list */
+ dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
+ pplist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
+ fllist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
+ if (dblist == NULL || pplist == NULL || fllist == NULL)
+ {
+ vim_free(dblist);
+ vim_free(pplist);
+ vim_free(fllist);
+ return CSCOPE_FAILURE;
+ }
+
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ dblist[i] = csinfo[i].fname;
+ pplist[i] = csinfo[i].ppath;
+ fllist[i] = csinfo[i].flags;
+ if (csinfo[i].fname != NULL)
+ cs_release_csp(i, FALSE);
+ }
+
+ /* rebuild the cscope connection list */
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (dblist[i] != NULL)
+ {
+ cs_add_common(dblist[i], pplist[i], fllist[i]);
+ if (p_csverbose)
+ {
+ /* dont' use smsg_attr because want to display
+ * connection number in the same line as
+ * "Added cscope database..."
+ */
+ sprintf(buf, " (#%d)", i);
+ MSG_PUTS_ATTR(buf, hl_attr(HLF_R));
+ }
+ }
+ vim_free(dblist[i]);
+ vim_free(pplist[i]);
+ vim_free(fllist[i]);
+ }
+ vim_free(dblist);
+ vim_free(pplist);
+ vim_free(fllist);
+
+ if (p_csverbose)
+ MSG_ATTR(_("All cscope databases reset"), hl_attr(HLF_R) | MSG_HIST);
+ return CSCOPE_SUCCESS;
+} /* cs_reset */
+
+
+/*
+ * PRIVATE: cs_resolve_file
+ *
+ * construct the full pathname to a file found in the cscope database.
+ * (Prepends ppath, if there is one and if it's not already prepended,
+ * otherwise just uses the name found.)
+ *
+ * we need to prepend the prefix because on some cscope's (e.g., the one that
+ * ships with Solaris 2.6), the output never has the prefix prepended.
+ * contrast this with my development system (Digital Unix), which does.
+ */
+ static char *
+cs_resolve_file(i, name)
+ int i;
+ char *name;
+{
+ char *fullname;
+ int len;
+
+ /*
+ * ppath is freed when we destroy the cscope connection.
+ * fullname is freed after cs_make_vim_style_matches, after it's been
+ * copied into the tag buffer used by vim
+ */
+ len = strlen(name) + 2;
+ if (csinfo[i].ppath != NULL)
+ len += strlen(csinfo[i].ppath);
+
+ if ((fullname = (char *)alloc(len)) == NULL)
+ return NULL;
+
+ /*
+ * note/example: this won't work if the cscope output already starts
+ * "../.." and the prefix path is also "../..". if something like this
+ * happens, you are screwed up and need to fix how you're using cscope.
+ */
+ if (csinfo[i].ppath != NULL &&
+ (strncmp(name, csinfo[i].ppath, strlen(csinfo[i].ppath)) != 0) &&
+ (name[0] != '/')
+#ifdef WIN32
+ && name[0] != '\\' && name[1] != ':'
+#endif
+ )
+ (void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name);
+ else
+ (void)sprintf(fullname, "%s", name);
+
+ return fullname;
+} /* cs_resolve_file */
+
+
+/*
+ * PRIVATE: cs_show
+ *
+ * show all cscope connections
+ */
+/* ARGSUSED */
+ static int
+cs_show(eap)
+ exarg_T *eap;
+{
+ short i;
+ if (cs_cnt_connections() == 0)
+ MSG_PUTS(_("no cscope connections\n"));
+ else
+ {
+ MSG_PUTS_ATTR(
+ _(" # pid database name prepend path\n"),
+ hl_attr(HLF_T));
+ for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+ {
+ if (csinfo[i].fname == NULL)
+ continue;
+
+ if (csinfo[i].ppath != NULL)
+ (void)smsg((char_u *)"%2d %-5ld %-34s %-32s",
+ i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath);
+ else
+ (void)smsg((char_u *)"%2d %-5ld %-34s <none>",
+ i, (long)csinfo[i].pid, csinfo[i].fname);
+ }
+ }
+
+ wait_return(TRUE);
+ return CSCOPE_SUCCESS;
+} /* cs_show */
+
+#endif /* FEAT_CSCOPE */
+
+/* the end */
diff --git a/src/if_cscope.h b/src/if_cscope.h
new file mode 100644
index 000000000..b3149d6c6
--- /dev/null
+++ b/src/if_cscope.h
@@ -0,0 +1,96 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * CSCOPE support for Vim added by Andy Kahn <kahn@zk3.dec.com>
+ * Ported to Win32 by Sergey Khorev <khorev@softlab.ru>
+ *
+ * The basic idea/structure of cscope for Vim was borrowed from Nvi.
+ * There might be a few lines of code that look similar to what Nvi
+ * has. If this is a problem and requires inclusion of the annoying
+ * BSD license, then sue me; I'm not worth much anyway.
+ */
+
+#if defined(FEAT_CSCOPE) || defined(PROTO)
+
+#if defined(UNIX)
+#include <sys/types.h> /* pid_t */
+#include <sys/stat.h> /* dev_t, ino_t */
+#elif defined (WIN32)
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+#endif
+
+#define CSCOPE_SUCCESS 0
+#define CSCOPE_FAILURE -1
+#define CSCOPE_MAX_CONNECTIONS 8 /* you actually need more? */
+
+#define CSCOPE_DBFILE "cscope.out"
+#define CSCOPE_PROMPT ">> "
+#define CSCOPE_QUERIES "sgdct efi"
+
+/*
+ * s 0name Find this C symbol
+ * g 1name Find this definition
+ * d 2name Find functions called by this function
+ * c 3name Find functions calling this function
+ * t 4string find text string (cscope 12.9)
+ * t 4name Find assignments to (cscope 13.3)
+ * 5pattern change pattern -- NOT USED
+ * e 6pattern Find this egrep pattern
+ * f 7name Find this file
+ * i 8name Find files #including this file
+ */
+#define FIND_USAGE "find c|d|e|f|g|i|s|t name"
+#define FIND_HELP "\n\
+ c: Find functions calling this function\n\
+ d: Find functions called by this function\n\
+ e: Find this egrep pattern\n\
+ f: Find this file\n\
+ g: Find this definition\n\
+ i: Find files #including this file\n\
+ s: Find this C symbol\n\
+ t: Find assignments to\n"
+
+
+typedef struct {
+ char * name;
+ int (*func) __ARGS((exarg_T *eap));
+ char * help;
+ char * usage;
+ int cansplit; /* if supports splitting window */
+} cscmd_T;
+
+typedef struct csi {
+ char * fname; /* cscope db name */
+ char * ppath; /* path to prepend (the -P option) */
+ char * flags; /* additional cscope flags/options (e.g, -p2) */
+#if defined(UNIX)
+ pid_t pid; /* PID of the connected cscope process. */
+ dev_t st_dev; /* ID of dev containing cscope db */
+ ino_t st_ino; /* inode number of cscope db */
+#elif defined(WIN32)
+ int pid; /* Can't get pid so set it to 0 ;) */
+ HANDLE hProc; /* cscope process handle */
+ DWORD nVolume; /* Volume serial number, instead of st_dev */
+ DWORD nIndexHigh; /* st_ino has no meaning in the Windows */
+ DWORD nIndexLow;
+#endif
+
+ FILE * fr_fp; /* from cscope: FILE. */
+ FILE * to_fp; /* to cscope: FILE. */
+} csinfo_T;
+
+typedef enum { Add, Find, Help, Kill, Reset, Show } csid_e;
+
+typedef enum {
+ Store,
+ Get,
+ Free,
+ Print
+} mcmd_e;
+
+
+#endif /* FEAT_CSCOPE */
+
+/* the end */
diff --git a/src/if_ole.cpp b/src/if_ole.cpp
new file mode 100644
index 000000000..bc57f1255
--- /dev/null
+++ b/src/if_ole.cpp
@@ -0,0 +1,778 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#if defined(FEAT_OLE) && defined(FEAT_GUI_W32)
+/*
+ * OLE server implementation.
+ *
+ * See os_mswin.c for the client side.
+ */
+
+#include <windows.h>
+#include <oleauto.h>
+
+extern "C" {
+#include "vim.h"
+extern HWND s_hwnd;
+extern HWND vim_parent_hwnd;
+}
+
+#include "if_ole.h" // Interface definitions
+#include "iid_ole.c" // UUID definitions (compile here)
+
+/* Supply function prototype to work around bug in Mingw oleauto.h header */
+#ifdef __MINGW32__
+WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor,
+ WORD wVerMinor, LCID lcid, SYSKIND syskind);
+#endif
+
+/*****************************************************************************
+ 1. Internal definitions for this file
+*****************************************************************************/
+
+class CVim;
+class CVimCF;
+
+/* Internal data */
+// The identifier of the registered class factory
+static unsigned long cf_id = 0;
+
+// The identifier of the running application object
+static unsigned long app_id = 0;
+
+// The single global instance of the class factory
+static CVimCF *cf = 0;
+
+// The single global instance of the application object
+static CVim *app = 0;
+
+/* GUIDs, versions and type library information */
+#define MYCLSID CLSID_Vim
+#define MYLIBID LIBID_Vim
+#define MYIID IID_IVim
+
+#define MAJORVER 1
+#define MINORVER 0
+#define LOCALE 0x0409
+
+#define MYNAME "Vim"
+#define MYPROGID "Vim.Application.1"
+#define MYVIPROGID "Vim.Application"
+
+#define MAX_CLSID_LEN 100
+
+/*****************************************************************************
+ 2. The application object
+*****************************************************************************/
+
+/* Definition
+ * ----------
+ */
+
+class CVim : public IVim
+{
+public:
+ ~CVim();
+ static CVim *Create(int* pbDoRestart);
+
+ // IUnknown members
+ STDMETHOD(QueryInterface)(REFIID riid, void ** ppv);
+ STDMETHOD_(unsigned long, AddRef)(void);
+ STDMETHOD_(unsigned long, Release)(void);
+
+ // IDispatch members
+ STDMETHOD(GetTypeInfoCount)(UINT *pCount);
+ STDMETHOD(GetTypeInfo)(UINT iTypeInfo, LCID, ITypeInfo **ppITypeInfo);
+ STDMETHOD(GetIDsOfNames)(const IID& iid, OLECHAR** names, UINT n, LCID, DISPID *dispids);
+ STDMETHOD(Invoke)(DISPID member, const IID& iid, LCID, WORD flags, DISPPARAMS *dispparams, VARIANT *result, EXCEPINFO *excepinfo, UINT *argerr);
+
+ // IVim members
+ STDMETHOD(SendKeys)(BSTR keys);
+ STDMETHOD(Eval)(BSTR expr, BSTR *result);
+ STDMETHOD(SetForeground)(void);
+ STDMETHOD(GetHwnd)(UINT* result);
+
+private:
+ // Constructor is private - create using CVim::Create()
+ CVim() : ref(0), typeinfo(0) {};
+
+ // Reference count
+ unsigned long ref;
+
+ // The object's TypeInfo
+ ITypeInfo *typeinfo;
+};
+
+/* Implementation
+ * --------------
+ */
+
+CVim *CVim::Create(int* pbDoRestart)
+{
+ HRESULT hr;
+ CVim *me = 0;
+ ITypeLib *typelib = 0;
+ ITypeInfo *typeinfo = 0;
+
+ *pbDoRestart = FALSE;
+
+ // Create the object
+ me = new CVim();
+ if (me == NULL)
+ {
+ MessageBox(0, "Cannot create application object", "Vim Initialisation", 0);
+ return NULL;
+ }
+
+ // Load the type library from the registry
+ hr = LoadRegTypeLib(MYLIBID, 1, 0, 0x00, &typelib);
+ if (FAILED(hr))
+ {
+ HKEY hKey;
+
+ // Check we can write to the registry.
+ // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011
+ if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL,
+ REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL))
+ {
+ delete me;
+ return NULL; // Unable to write to registry. Quietly fail.
+ }
+ RegCloseKey(hKey);
+
+ if (MessageBox(0, "Cannot load registered type library.\nDo you want to register Vim now?",
+ "Vim Initialisation", MB_YESNO | MB_ICONQUESTION) != IDYES)
+ {
+ delete me;
+ return NULL;
+ }
+
+ RegisterMe(FALSE);
+
+ // Load the type library from the registry
+ hr = LoadRegTypeLib(MYLIBID, 1, 0, 0x00, &typelib);
+ if (FAILED(hr))
+ {
+ MessageBox(0, "You must restart Vim in order for the registration to take effect.",
+ "Vim Initialisation", 0);
+ *pbDoRestart = TRUE;
+ delete me;
+ return NULL;
+ }
+ }
+
+ // Get the type info of the vtable interface
+ hr = typelib->GetTypeInfoOfGuid(MYIID, &typeinfo);
+ typelib->Release();
+
+ if (FAILED(hr))
+ {
+ MessageBox(0, "Cannot get interface type information",
+ "Vim Initialisation", 0);
+ delete me;
+ return NULL;
+ }
+
+ // Save the type information
+ me->typeinfo = typeinfo;
+ return me;
+}
+
+CVim::~CVim()
+{
+ if (typeinfo && vim_parent_hwnd == NULL)
+ typeinfo->Release();
+}
+
+STDMETHODIMP
+CVim::QueryInterface(REFIID riid, void **ppv)
+{
+ if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IDispatch) || IsEqualIID(riid, MYIID))
+ {
+ AddRef();
+ *ppv = this;
+ return S_OK;
+ }
+
+ *ppv = 0;
+ return E_NOINTERFACE;
+}
+
+STDMETHODIMP_(ULONG)
+CVim::AddRef()
+{
+ return ++ref;
+}
+
+STDMETHODIMP_(ULONG)
+CVim::Release()
+{
+ // Don't delete the object when the reference count reaches zero, as there
+ // is only a single application object, and its lifetime is controlled by
+ // the running instance, not by its reference count.
+ if (ref > 0)
+ --ref;
+ return ref;
+}
+
+STDMETHODIMP
+CVim::GetTypeInfoCount(UINT *pCount)
+{
+ *pCount = 1;
+ return S_OK;
+}
+
+STDMETHODIMP
+CVim::GetTypeInfo(UINT iTypeInfo, LCID, ITypeInfo **ppITypeInfo)
+{
+ *ppITypeInfo = 0;
+
+ if (iTypeInfo != 0)
+ return DISP_E_BADINDEX;
+
+ typeinfo->AddRef();
+ *ppITypeInfo = typeinfo;
+ return S_OK;
+}
+
+STDMETHODIMP
+CVim::GetIDsOfNames(
+ const IID& iid,
+ OLECHAR** names,
+ UINT n,
+ LCID,
+ DISPID *dispids)
+{
+ if (iid != IID_NULL)
+ return DISP_E_UNKNOWNINTERFACE;
+
+ return typeinfo->GetIDsOfNames(names, n, dispids);
+}
+
+STDMETHODIMP
+CVim::Invoke(
+ DISPID member,
+ const IID& iid,
+ LCID,
+ WORD flags,
+ DISPPARAMS *dispparams,
+ VARIANT *result,
+ EXCEPINFO *excepinfo,
+ UINT *argerr)
+{
+ if (iid != IID_NULL)
+ return DISP_E_UNKNOWNINTERFACE;
+
+ ::SetErrorInfo(0, NULL);
+ return typeinfo->Invoke(static_cast<IDispatch*>(this),
+ member, flags, dispparams,
+ result, excepinfo, argerr);
+}
+
+STDMETHODIMP
+CVim::GetHwnd(UINT* result)
+{
+ *result = (UINT) s_hwnd;
+ return S_OK;
+}
+
+STDMETHODIMP
+CVim::SetForeground(void)
+{
+ /* Make the Vim window come to the foreground */
+ gui_mch_set_foreground();
+ return S_OK;
+}
+
+STDMETHODIMP
+CVim::SendKeys(BSTR keys)
+{
+ int len;
+ char *buffer;
+ char_u *str;
+ char_u *ptr;
+
+ /* Get a suitable buffer */
+ len = WideCharToMultiByte(CP_ACP, 0, keys, -1, 0, 0, 0, 0);
+ buffer = (char *)alloc(len+1);
+
+ if (buffer == NULL)
+ return E_OUTOFMEMORY;
+
+ len = WideCharToMultiByte(CP_ACP, 0, keys, -1, buffer, len, 0, 0);
+
+ if (len == 0)
+ {
+ vim_free(buffer);
+ return E_INVALIDARG;
+ }
+
+ /* Translate key codes like <Esc> */
+ str = replace_termcodes((char_u *)buffer, &ptr, FALSE, TRUE);
+
+ /* If ptr was set, then a new buffer was allocated,
+ * so we can free the old one.
+ */
+ if (ptr)
+ vim_free((char_u *)(buffer));
+
+ /* Reject strings too long to fit in the input buffer. Allow 10 bytes
+ * space to cover for the (remote) possibility that characters may enter
+ * the input buffer between now and when the WM_OLE message is actually
+ * processed. If more that 10 characters enter the input buffer in that
+ * time, the WM_OLE processing will simply fail to insert the characters.
+ */
+ if ((int)(STRLEN(str)) > (vim_free_in_input_buf() - 10))
+ {
+ vim_free(str);
+ return E_INVALIDARG;
+ }
+
+ /* Pass the string to the main input loop. The memory will be freed when
+ * the message is processed.
+ */
+ PostMessage(NULL, WM_OLE, 0, (LPARAM)str);
+
+ return S_OK;
+}
+
+STDMETHODIMP
+CVim::Eval(BSTR expr, BSTR *result)
+{
+#ifdef FEAT_EVAL
+ int len;
+ char *buffer;
+ char *str;
+ wchar_t *w_buffer;
+
+ /* Get a suitable buffer */
+ len = WideCharToMultiByte(CP_ACP, 0, expr, -1, 0, 0, 0, 0);
+ if (len == 0)
+ return E_INVALIDARG;
+
+ buffer = (char *)alloc((unsigned)len);
+
+ if (buffer == NULL)
+ return E_OUTOFMEMORY;
+
+ /* Convert the (wide character) expression to an ASCII string */
+ len = WideCharToMultiByte(CP_ACP, 0, expr, -1, buffer, len, 0, 0);
+ if (len == 0)
+ return E_INVALIDARG;
+
+ /* Evaluate the expression */
+ ++emsg_skip;
+ str = (char *)eval_to_string((char_u *)buffer, NULL);
+ --emsg_skip;
+ vim_free(buffer);
+ if (str == NULL)
+ return E_FAIL;
+
+ /* Convert the result to wide characters */
+ MultiByteToWideChar_alloc(CP_ACP, 0, str, -1, &w_buffer, &len);
+ vim_free(str);
+ if (w_buffer == NULL)
+ return E_OUTOFMEMORY;
+
+ if (len == 0)
+ {
+ vim_free(w_buffer);
+ return E_FAIL;
+ }
+
+ /* Store the result */
+ *result = SysAllocString(w_buffer);
+ vim_free(w_buffer);
+
+ return S_OK;
+#else
+ return E_NOTIMPL;
+#endif
+}
+
+/*****************************************************************************
+ 3. The class factory
+*****************************************************************************/
+
+/* Definition
+ * ----------
+ */
+
+class CVimCF : public IClassFactory
+{
+public:
+ static CVimCF *Create();
+
+ STDMETHOD(QueryInterface)(REFIID riid, void ** ppv);
+ STDMETHOD_(unsigned long, AddRef)(void);
+ STDMETHOD_(unsigned long, Release)(void);
+ STDMETHOD(CreateInstance)(IUnknown *punkOuter, REFIID riid, void ** ppv);
+ STDMETHOD(LockServer)(BOOL lock);
+
+private:
+ // Constructor is private - create via Create()
+ CVimCF() : ref(0) {};
+
+ // Reference count
+ unsigned long ref;
+};
+
+/* Implementation
+ * --------------
+ */
+
+CVimCF *CVimCF::Create()
+{
+ CVimCF *me = new CVimCF();
+
+ if (me == NULL)
+ MessageBox(0, "Cannot create class factory", "Vim Initialisation", 0);
+
+ return me;
+}
+
+STDMETHODIMP
+CVimCF::QueryInterface(REFIID riid, void **ppv)
+{
+ if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory))
+ {
+ AddRef();
+ *ppv = this;
+ return S_OK;
+ }
+
+ *ppv = 0;
+ return E_NOINTERFACE;
+}
+
+STDMETHODIMP_(ULONG)
+CVimCF::AddRef()
+{
+ return ++ref;
+}
+
+STDMETHODIMP_(ULONG)
+CVimCF::Release()
+{
+ // Don't delete the object when the reference count reaches zero, as there
+ // is only a single application object, and its lifetime is controlled by
+ // the running instance, not by its reference count.
+ if (ref > 0)
+ --ref;
+ return ref;
+}
+
+STDMETHODIMP
+CVimCF::CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv)
+{
+ return app->QueryInterface(riid, ppv);
+}
+
+STDMETHODIMP
+CVimCF::LockServer(BOOL lock)
+{
+ return S_OK;
+}
+
+/*****************************************************************************
+ 4. Registry manipulation code
+*****************************************************************************/
+
+// Internal use only
+static void SetKeyAndValue(const char* path, const char* subkey, const char* value);
+static void GUIDtochar(const GUID& guid, char* GUID, int length);
+static void RecursiveDeleteKey(HKEY hKeyParent, const char* child);
+static const int GUID_STRING_SIZE = 39;
+
+// Register the component in the registry
+// When "silent" is TRUE don't give any messages.
+
+extern "C" void RegisterMe(int silent)
+{
+ BOOL ok = TRUE;
+
+ // Get the application startup command
+ char module[MAX_PATH];
+
+ ::GetModuleFileName(NULL, module, MAX_PATH);
+
+ // Unregister first (quietly)
+ UnregisterMe(FALSE);
+
+ // Convert the CLSID into a char
+ char clsid[GUID_STRING_SIZE];
+ GUIDtochar(MYCLSID, clsid, sizeof(clsid));
+
+ // Convert the LIBID into a char
+ char libid[GUID_STRING_SIZE];
+ GUIDtochar(MYLIBID, libid, sizeof(libid));
+
+ // Build the key CLSID\\{...}
+ char Key[MAX_CLSID_LEN];
+ strcpy(Key, "CLSID\\");
+ strcat(Key, clsid);
+
+ // Add the CLSID to the registry
+ SetKeyAndValue(Key, NULL, MYNAME);
+ SetKeyAndValue(Key, "LocalServer32", module);
+ SetKeyAndValue(Key, "ProgID", MYPROGID);
+ SetKeyAndValue(Key, "VersionIndependentProgID", MYVIPROGID);
+ SetKeyAndValue(Key, "TypeLib", libid);
+
+ // Add the version-independent ProgID subkey under HKEY_CLASSES_ROOT
+ SetKeyAndValue(MYVIPROGID, NULL, MYNAME);
+ SetKeyAndValue(MYVIPROGID, "CLSID", clsid);
+ SetKeyAndValue(MYVIPROGID, "CurVer", MYPROGID);
+
+ // Add the versioned ProgID subkey under HKEY_CLASSES_ROOT
+ SetKeyAndValue(MYPROGID, NULL, MYNAME);
+ SetKeyAndValue(MYPROGID, "CLSID", clsid);
+
+ wchar_t w_module[MAX_PATH];
+ MultiByteToWideChar(CP_ACP, 0, module, -1, w_module, MAX_PATH);
+
+ ITypeLib *typelib = NULL;
+ if (LoadTypeLib(w_module, &typelib) != S_OK)
+ {
+ if (!silent)
+ MessageBox(0, "Cannot load type library to register",
+ "Vim Registration", 0);
+ ok = FALSE;
+ }
+ else
+ {
+ if (RegisterTypeLib(typelib, w_module, NULL) != S_OK)
+ {
+ if (!silent)
+ MessageBox(0, "Cannot register type library",
+ "Vim Registration", 0);
+ ok = FALSE;
+ }
+ typelib->Release();
+ }
+
+ if (ok && !silent)
+ MessageBox(0, "Registered successfully", "Vim", 0);
+}
+
+// Remove the component from the registry
+//
+// Note: There is little error checking in this code, to allow incomplete
+// or failed registrations to be undone.
+extern "C" void UnregisterMe(int bNotifyUser)
+{
+ // Unregister the type library
+ ITypeLib *typelib;
+ if (SUCCEEDED(LoadRegTypeLib(MYLIBID, MAJORVER, MINORVER, LOCALE, &typelib)))
+ {
+ TLIBATTR *tla;
+ if (SUCCEEDED(typelib->GetLibAttr(&tla)))
+ {
+ UnRegisterTypeLib(tla->guid, tla->wMajorVerNum, tla->wMinorVerNum,
+ tla->lcid, tla->syskind);
+ typelib->ReleaseTLibAttr(tla);
+ }
+ typelib->Release();
+ }
+
+ // Convert the CLSID into a char
+ char clsid[GUID_STRING_SIZE];
+ GUIDtochar(MYCLSID, clsid, sizeof(clsid));
+
+ // Build the key CLSID\\{...}
+ char Key[MAX_CLSID_LEN];
+ strcpy(Key, "CLSID\\");
+ strcat(Key, clsid);
+
+ // Delete the CLSID Key - CLSID\{...}
+ RecursiveDeleteKey(HKEY_CLASSES_ROOT, Key);
+
+ // Delete the version-independent ProgID Key
+ RecursiveDeleteKey(HKEY_CLASSES_ROOT, MYVIPROGID);
+
+ // Delete the ProgID key
+ RecursiveDeleteKey(HKEY_CLASSES_ROOT, MYPROGID);
+
+ if (bNotifyUser)
+ MessageBox(0, "Unregistered successfully", "Vim", 0);
+}
+
+/****************************************************************************/
+
+// Convert a GUID to a char string
+static void GUIDtochar(const GUID& guid, char* GUID, int length)
+{
+ // Get wide string version
+ LPOLESTR wGUID = NULL;
+ StringFromCLSID(guid, &wGUID);
+
+ // Covert from wide characters to non-wide
+ wcstombs(GUID, wGUID, length);
+
+ // Free memory
+ CoTaskMemFree(wGUID);
+}
+
+// Delete a key and all of its descendents
+static void RecursiveDeleteKey(HKEY hKeyParent, const char* child)
+{
+ // Open the child
+ HKEY hKeyChild;
+ LONG result = RegOpenKeyEx(hKeyParent, child, 0, KEY_ALL_ACCESS, &hKeyChild);
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // Enumerate all of the decendents of this child
+ FILETIME time;
+ char buffer[1024];
+ DWORD size = 1024;
+
+ while (RegEnumKeyEx(hKeyChild, 0, buffer, &size, NULL,
+ NULL, NULL, &time) == S_OK)
+ {
+ // Delete the decendents of this child
+ RecursiveDeleteKey(hKeyChild, buffer);
+ size = 256;
+ }
+
+ // Close the child
+ RegCloseKey(hKeyChild);
+
+ // Delete this child
+ RegDeleteKey(hKeyParent, child);
+}
+
+// Create a key and set its value
+static void SetKeyAndValue(const char* key, const char* subkey, const char* value)
+{
+ HKEY hKey;
+ char buffer[1024];
+
+ strcpy(buffer, key);
+
+ // Add subkey name to buffer.
+ if (subkey)
+ {
+ strcat(buffer, "\\");
+ strcat(buffer, subkey);
+ }
+
+ // Create and open key and subkey.
+ long result = RegCreateKeyEx(HKEY_CLASSES_ROOT,
+ buffer,
+ 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS, NULL,
+ &hKey, NULL);
+ if (result != ERROR_SUCCESS)
+ return;
+
+ // Set the value
+ if (value)
+ RegSetValueEx(hKey, NULL, 0, REG_SZ, (BYTE *)value,
+ (DWORD)STRLEN(value)+1);
+
+ RegCloseKey(hKey);
+}
+
+/*****************************************************************************
+ 5. OLE Initialisation and shutdown processing
+*****************************************************************************/
+extern "C" void InitOLE(int* pbDoRestart)
+{
+ HRESULT hr;
+
+ *pbDoRestart = FALSE;
+
+ // Initialize the OLE libraries
+ hr = OleInitialize(NULL);
+ if (FAILED(hr))
+ {
+ MessageBox(0, "Cannot initialise OLE", "Vim Initialisation", 0);
+ goto error0;
+ }
+
+ // Create the application object
+ app = CVim::Create(pbDoRestart);
+ if (app == NULL)
+ goto error1;
+
+ // Create the class factory
+ cf = CVimCF::Create();
+ if (cf == NULL)
+ goto error1;
+
+ // Register the class factory
+ hr = CoRegisterClassObject(
+ MYCLSID,
+ cf,
+ CLSCTX_LOCAL_SERVER,
+ REGCLS_MULTIPLEUSE,
+ &cf_id);
+
+ if (FAILED(hr))
+ {
+ MessageBox(0, "Cannot register class factory", "Vim Initialisation", 0);
+ goto error1;
+ }
+
+ // Register the application object as active
+ hr = RegisterActiveObject(
+ app,
+ MYCLSID,
+ NULL,
+ &app_id);
+
+ if (FAILED(hr))
+ {
+ MessageBox(0, "Cannot register application object", "Vim Initialisation", 0);
+ goto error1;
+ }
+
+ return;
+
+ // Errors: tidy up as much as needed and return
+error1:
+ UninitOLE();
+error0:
+ return;
+}
+
+extern "C" void UninitOLE()
+{
+ // Unregister the application object
+ if (app_id)
+ {
+ RevokeActiveObject(app_id, NULL);
+ app_id = 0;
+ }
+
+ // Unregister the class factory
+ if (cf_id)
+ {
+ CoRevokeClassObject(cf_id);
+ cf_id = 0;
+ }
+
+ // Shut down the OLE libraries
+ OleUninitialize();
+
+ // Delete the application object
+ if (app)
+ {
+ delete app;
+ app = NULL;
+ }
+
+ // Delete the class factory
+ if (cf)
+ {
+ delete cf;
+ cf = NULL;
+ }
+}
+#endif /* FEAT_OLE */
diff --git a/src/if_ole.h b/src/if_ole.h
new file mode 100644
index 000000000..30191b843
--- /dev/null
+++ b/src/if_ole.h
@@ -0,0 +1,289 @@
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+/* File created by MIDL compiler version 3.01.75 */
+/* at Wed Jun 06 18:20:37 2001
+ */
+/* Compiler settings for .\if_ole.idl:
+ Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
+ error checks: none
+*/
+//@@MIDL_FILE_HEADING( )
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __if_ole_h__
+#define __if_ole_h__
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IVim_FWD_DEFINED__
+#define __IVim_FWD_DEFINED__
+typedef interface IVim IVim;
+#endif /* __IVim_FWD_DEFINED__ */
+
+
+#ifndef __Vim_FWD_DEFINED__
+#define __Vim_FWD_DEFINED__
+
+#ifdef __cplusplus
+typedef class Vim Vim;
+#else
+typedef struct Vim Vim;
+#endif /* __cplusplus */
+
+#endif /* __Vim_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+
+void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
+void __RPC_USER MIDL_user_free( void __RPC_FAR * );
+
+#ifndef __IVim_INTERFACE_DEFINED__
+#define __IVim_INTERFACE_DEFINED__
+
+/****************************************
+ * Generated header for interface: IVim
+ * at Wed Jun 06 18:20:37 2001
+ * using MIDL 3.01.75
+ ****************************************/
+/* [oleautomation][dual][unique][helpstring][uuid][object] */
+
+
+
+EXTERN_C const IID IID_IVim;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ interface DECLSPEC_UUID("0F0BFAE2-4C90-11d1-82D7-0004AC368519")
+ IVim : public IDispatch
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SendKeys(
+ /* [in] */ BSTR keys) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Eval(
+ /* [in] */ BSTR expr,
+ /* [retval][out] */ BSTR __RPC_FAR *result) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetForeground( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetHwnd(
+ /* [retval][out] */ UINT __RPC_FAR *result) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IVimVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
+ IVim __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
+ IVim __RPC_FAR * This);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
+ IVim __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )(
+ IVim __RPC_FAR * This,
+ /* [out] */ UINT __RPC_FAR *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )(
+ IVim __RPC_FAR * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )(
+ IVim __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
+ /* [in] */ UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ DISPID __RPC_FAR *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )(
+ IVim __RPC_FAR * This,
+ /* [in] */ DISPID dispIdMember,
+ /* [in] */ REFIID riid,
+ /* [in] */ LCID lcid,
+ /* [in] */ WORD wFlags,
+ /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
+ /* [out] */ VARIANT __RPC_FAR *pVarResult,
+ /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
+ /* [out] */ UINT __RPC_FAR *puArgErr);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SendKeys )(
+ IVim __RPC_FAR * This,
+ /* [in] */ BSTR keys);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Eval )(
+ IVim __RPC_FAR * This,
+ /* [in] */ BSTR expr,
+ /* [retval][out] */ BSTR __RPC_FAR *result);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetForeground )(
+ IVim __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetHwnd )(
+ IVim __RPC_FAR * This,
+ /* [retval][out] */ UINT __RPC_FAR *result);
+
+ END_INTERFACE
+ } IVimVtbl;
+
+ interface IVim
+ {
+ CONST_VTBL struct IVimVtbl __RPC_FAR *lpVtbl;
+ };
+
+#ifdef COBJMACROS
+
+
+#define IVim_QueryInterface(This,riid,ppvObject) \
+ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IVim_AddRef(This) \
+ (This)->lpVtbl -> AddRef(This)
+
+#define IVim_Release(This) \
+ (This)->lpVtbl -> Release(This)
+
+
+#define IVim_GetTypeInfoCount(This,pctinfo) \
+ (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo)
+
+#define IVim_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+
+#define IVim_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+
+#define IVim_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+
+
+#define IVim_SendKeys(This,keys) \
+ (This)->lpVtbl -> SendKeys(This,keys)
+
+#define IVim_Eval(This,expr,result) \
+ (This)->lpVtbl -> Eval(This,expr,result)
+
+#define IVim_SetForeground(This) \
+ (This)->lpVtbl -> SetForeground(This)
+
+#define IVim_GetHwnd(This,result) \
+ (This)->lpVtbl -> GetHwnd(This,result)
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+HRESULT STDMETHODCALLTYPE IVim_SendKeys_Proxy(
+ IVim __RPC_FAR * This,
+ /* [in] */ BSTR keys);
+
+
+void __RPC_STUB IVim_SendKeys_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IVim_Eval_Proxy(
+ IVim __RPC_FAR * This,
+ /* [in] */ BSTR expr,
+ /* [retval][out] */ BSTR __RPC_FAR *result);
+
+
+void __RPC_STUB IVim_Eval_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IVim_SetForeground_Proxy(
+ IVim __RPC_FAR * This);
+
+
+void __RPC_STUB IVim_SetForeground_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IVim_GetHwnd_Proxy(
+ IVim __RPC_FAR * This,
+ /* [retval][out] */ UINT __RPC_FAR *result);
+
+
+void __RPC_STUB IVim_GetHwnd_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IVim_INTERFACE_DEFINED__ */
+
+
+
+#ifndef __Vim_LIBRARY_DEFINED__
+#define __Vim_LIBRARY_DEFINED__
+
+/****************************************
+ * Generated header for library: Vim
+ * at Wed Jun 06 18:20:37 2001
+ * using MIDL 3.01.75
+ ****************************************/
+/* [version][helpstring][uuid] */
+
+
+
+EXTERN_C const IID LIBID_Vim;
+
+#ifdef __cplusplus
+EXTERN_C const CLSID CLSID_Vim;
+
+class DECLSPEC_UUID("0F0BFAE1-4C90-11d1-82D7-0004AC368519")
+Vim;
+#endif
+#endif /* __Vim_LIBRARY_DEFINED__ */
+
+/* Additional Prototypes for ALL interfaces */
+
+unsigned long __RPC_USER BSTR_UserSize( unsigned long __RPC_FAR *, unsigned long , BSTR __RPC_FAR * );
+unsigned char __RPC_FAR * __RPC_USER BSTR_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
+unsigned char __RPC_FAR * __RPC_USER BSTR_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, BSTR __RPC_FAR * );
+void __RPC_USER BSTR_UserFree( unsigned long __RPC_FAR *, BSTR __RPC_FAR * );
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/if_ole.idl b/src/if_ole.idl
new file mode 100644
index 000000000..83cde3acd
--- /dev/null
+++ b/src/if_ole.idl
@@ -0,0 +1,45 @@
+// if_ole.idl - IDL source for the Vim OLE Automation interface
+//
+// Processed by the IDL compiler (MIDL) to generate the type library
+// (Vim.tlb).
+//
+// Command line:
+// MIDL /proxy nul /iid iid_ole.c /h if_ole.h /tlb vim.tlb if_ole.idl
+
+[
+ object,
+ uuid(0F0BFAE2-4C90-11d1-82D7-0004AC368519), // IID_IVim
+ helpstring("IVim"),
+ pointer_default(unique),
+ dual,
+ oleautomation
+]
+interface IVim : IDispatch
+{
+ import "oaidl.idl";
+ HRESULT SendKeys([in]BSTR keys);
+ HRESULT Eval([in]BSTR expr, [out, retval]BSTR* result);
+ HRESULT SetForeground(void);
+ HRESULT GetHwnd([out, retval]UINT* result);
+};
+
+// Component and type library definitions
+[
+ uuid(0F0BFAE0-4C90-11d1-82D7-0004AC368519), // LIBID_Vim
+ helpstring("Vim OLE Interface 1.1 Type Library"),
+ version(1.1)
+]
+library Vim
+{
+ importlib("stdole32.tlb");
+
+ // Component
+ [
+ uuid(0F0BFAE1-4C90-11d1-82D7-0004AC368519), // CLSID_Vim
+ helpstring("Vim OLE Interface")
+ ]
+ coclass Vim
+ {
+ [default] interface IVim;
+ };
+};
diff --git a/src/if_perl.xs b/src/if_perl.xs
new file mode 100644
index 000000000..96608ef6b
--- /dev/null
+++ b/src/if_perl.xs
@@ -0,0 +1,1150 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+/*
+ * if_perl.xs: Main code for Perl interface support.
+ * Mostly written by Sven Verdoolaege.
+ */
+
+#define _memory_h /* avoid memset redeclaration */
+#define IN_PERL_FILE /* don't include if_perl.pro from proto.h */
+
+#include "vim.h"
+
+
+/*
+ * Work around clashes between Perl and Vim namespace. proto.h doesn't
+ * include if_perl.pro and perlsfio.pro when IN_PERL_FILE is defined, because
+ * we need the CV typedef. proto.h can't be moved to after including
+ * if_perl.h, because we get all sorts of name clashes then.
+ */
+#ifndef PROTO
+#ifndef __MINGW32__
+# include "proto/if_perl.pro"
+# include "proto/if_perlsfio.pro"
+#endif
+#endif
+
+/* Perl compatibility stuff. This should ensure compatibility with older
+ * versions of Perl.
+ */
+
+#ifndef PERL_VERSION
+# include <patchlevel.h>
+# define PERL_REVISION 5
+# define PERL_VERSION PATCHLEVEL
+# define PERL_SUBVERSION SUBVERSION
+#endif
+
+#ifndef pTHX
+# define pTHX void
+# define pTHX_
+#endif
+
+#ifndef EXTERN_C
+# define EXTERN_C
+#endif
+
+/* Compatibility hacks over */
+
+static PerlInterpreter *perl_interp = NULL;
+static void xs_init __ARGS((pTHX));
+static void VIM_init __ARGS((void));
+EXTERN_C void boot_DynaLoader __ARGS((pTHX_ CV*));
+
+/*
+ * For dynamic linked perl. (Windows)
+ */
+#if defined(DYNAMIC_PERL) || defined(PROTO)
+/*
+ * Wrapper defines
+ */
+# define perl_alloc dll_perl_alloc
+# define perl_construct dll_perl_construct
+# define perl_parse dll_perl_parse
+# define perl_run dll_perl_run
+# define perl_destruct dll_perl_destruct
+# define perl_free dll_perl_free
+# define Perl_get_context dll_Perl_get_context
+# define Perl_croak dll_Perl_croak
+# ifndef PROTO
+# define Perl_croak_nocontext dll_Perl_croak_nocontext
+# define Perl_call_argv dll_Perl_call_argv
+# define Perl_call_pv dll_Perl_call_pv
+# define Perl_eval_sv dll_Perl_eval_sv
+# define Perl_get_sv dll_Perl_get_sv
+# define Perl_eval_pv dll_Perl_eval_pv
+# define Perl_call_method dll_Perl_call_method
+# endif
+# define Perl_dowantarray dll_Perl_dowantarray
+# define Perl_free_tmps dll_Perl_free_tmps
+# define Perl_gv_stashpv dll_Perl_gv_stashpv
+# define Perl_markstack_grow dll_Perl_markstack_grow
+# define Perl_mg_find dll_Perl_mg_find
+# define Perl_newXS dll_Perl_newXS
+# define Perl_newSV dll_Perl_newSV
+# define Perl_newSViv dll_Perl_newSViv
+# define Perl_newSVpv dll_Perl_newSVpv
+# define Perl_pop_scope dll_Perl_pop_scope
+# define Perl_push_scope dll_Perl_push_scope
+# define Perl_save_int dll_Perl_save_int
+# define Perl_stack_grow dll_Perl_stack_grow
+# define Perl_set_context dll_Perl_set_context
+# define Perl_sv_2bool dll_Perl_sv_2bool
+# define Perl_sv_2iv dll_Perl_sv_2iv
+# define Perl_sv_2mortal dll_Perl_sv_2mortal
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+# define Perl_sv_2pv_flags dll_Perl_sv_2pv_flags
+# define Perl_sv_2pv_nolen dll_Perl_sv_2pv_nolen
+# else
+# define Perl_sv_2pv dll_Perl_sv_2pv
+# endif
+# define Perl_sv_bless dll_Perl_sv_bless
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+# define Perl_sv_catpvn_flags dll_Perl_sv_catpvn_flags
+# else
+# define Perl_sv_catpvn dll_Perl_sv_catpvn
+# endif
+# define Perl_sv_free dll_Perl_sv_free
+# define Perl_sv_isa dll_Perl_sv_isa
+# define Perl_sv_magic dll_Perl_sv_magic
+# define Perl_sv_setiv dll_Perl_sv_setiv
+# define Perl_sv_setpv dll_Perl_sv_setpv
+# define Perl_sv_setpvn dll_Perl_sv_setpvn
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+# define Perl_sv_setsv_flags dll_Perl_sv_setsv_flags
+# else
+# define Perl_sv_setsv dll_Perl_sv_setsv
+# endif
+# define Perl_sv_upgrade dll_Perl_sv_upgrade
+# define Perl_Tstack_sp_ptr dll_Perl_Tstack_sp_ptr
+# define Perl_Top_ptr dll_Perl_Top_ptr
+# define Perl_Tstack_base_ptr dll_Perl_Tstack_base_ptr
+# define Perl_Tstack_max_ptr dll_Perl_Tstack_max_ptr
+# define Perl_Ttmps_ix_ptr dll_Perl_Ttmps_ix_ptr
+# define Perl_Ttmps_floor_ptr dll_Perl_Ttmps_floor_ptr
+# define Perl_Tmarkstack_ptr_ptr dll_Perl_Tmarkstack_ptr_ptr
+# define Perl_Tmarkstack_max_ptr dll_Perl_Tmarkstack_max_ptr
+# define Perl_TSv_ptr dll_Perl_TSv_ptr
+# define Perl_TXpv_ptr dll_Perl_TXpv_ptr
+# define Perl_Tna_ptr dll_Perl_Tna_ptr
+# define Perl_Idefgv_ptr dll_Perl_Idefgv_ptr
+# define Perl_Ierrgv_ptr dll_Perl_Ierrgv_ptr
+# define Perl_Isv_yes_ptr dll_Perl_Isv_yes_ptr
+# define boot_DynaLoader dll_boot_DynaLoader
+
+#ifndef DYNAMIC_PERL /* just generating prototypes */
+typedef int HANDLE;
+typedef int XSINIT_t;
+typedef int XSUBADDR_t;
+#endif
+
+/*
+ * Declare HANDLE for perl.dll and function pointers.
+ */
+static HANDLE hPerlLib = NULL;
+
+static PerlInterpreter* (*perl_alloc)();
+static void (*perl_construct)(PerlInterpreter*);
+static void (*perl_destruct)(PerlInterpreter*);
+static void (*perl_free)(PerlInterpreter*);
+static int (*perl_run)(PerlInterpreter*);
+static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
+static void* (*Perl_get_context)(void);
+static void (*Perl_croak)(pTHX_ const char*, ...) __attribute__((noreturn));
+static void (*Perl_croak_nocontext)(const char*, ...) __attribute__((noreturn));
+static I32 (*Perl_dowantarray)(pTHX);
+static void (*Perl_free_tmps)(pTHX);
+static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
+static void (*Perl_markstack_grow)(pTHX);
+static MAGIC* (*Perl_mg_find)(pTHX_ SV*, int);
+static CV* (*Perl_newXS)(pTHX_ char*, XSUBADDR_t, char*);
+static SV* (*Perl_newSV)(pTHX_ STRLEN);
+static SV* (*Perl_newSViv)(pTHX_ IV);
+static SV* (*Perl_newSVpv)(pTHX_ const char*, STRLEN);
+static I32 (*Perl_call_argv)(pTHX_ const char*, I32, char**);
+static I32 (*Perl_call_pv)(pTHX_ const char*, I32);
+static I32 (*Perl_eval_sv)(pTHX_ SV*, I32);
+static SV* (*Perl_get_sv)(pTHX_ const char*, I32);
+static SV* (*Perl_eval_pv)(pTHX_ const char*, I32);
+static SV* (*Perl_call_method)(pTHX_ const char*, I32);
+static void (*Perl_pop_scope)(pTHX);
+static void (*Perl_push_scope)(pTHX);
+static void (*Perl_save_int)(pTHX_ int*);
+static SV** (*Perl_stack_grow)(pTHX_ SV**, SV**p, int);
+static SV** (*Perl_set_context)(void*);
+static bool (*Perl_sv_2bool)(pTHX_ SV*);
+static IV (*Perl_sv_2iv)(pTHX_ SV*);
+static SV* (*Perl_sv_2mortal)(pTHX_ SV*);
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+static char* (*Perl_sv_2pv_flags)(pTHX_ SV*, STRLEN*, I32);
+static char* (*Perl_sv_2pv_nolen)(pTHX_ SV*);
+#else
+static char* (*Perl_sv_2pv)(pTHX_ SV*, STRLEN*);
+#endif
+static SV* (*Perl_sv_bless)(pTHX_ SV*, HV*);
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+static void (*Perl_sv_catpvn_flags)(pTHX_ SV* , const char*, STRLEN, I32);
+#else
+static void (*Perl_sv_catpvn)(pTHX_ SV*, const char*, STRLEN);
+#endif
+static void (*Perl_sv_free)(pTHX_ SV*);
+static int (*Perl_sv_isa)(pTHX_ SV*, const char*);
+static void (*Perl_sv_magic)(pTHX_ SV*, SV*, int, const char*, I32);
+static void (*Perl_sv_setiv)(pTHX_ SV*, IV);
+static void (*Perl_sv_setpv)(pTHX_ SV*, const char*);
+static void (*Perl_sv_setpvn)(pTHX_ SV*, const char*, STRLEN);
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+static void (*Perl_sv_setsv_flags)(pTHX_ SV*, SV*, I32);
+#else
+static void (*Perl_sv_setsv)(pTHX_ SV*, SV*);
+#endif
+static bool (*Perl_sv_upgrade)(pTHX_ SV*, U32);
+static SV*** (*Perl_Tstack_sp_ptr)(register PerlInterpreter*);
+static OP** (*Perl_Top_ptr)(register PerlInterpreter*);
+static SV*** (*Perl_Tstack_base_ptr)(register PerlInterpreter*);
+static SV*** (*Perl_Tstack_max_ptr)(register PerlInterpreter*);
+static I32* (*Perl_Ttmps_ix_ptr)(register PerlInterpreter*);
+static I32* (*Perl_Ttmps_floor_ptr)(register PerlInterpreter*);
+static I32** (*Perl_Tmarkstack_ptr_ptr)(register PerlInterpreter*);
+static I32** (*Perl_Tmarkstack_max_ptr)(register PerlInterpreter*);
+static SV** (*Perl_TSv_ptr)(register PerlInterpreter*);
+static XPV** (*Perl_TXpv_ptr)(register PerlInterpreter*);
+static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*);
+static GV** (*Perl_Idefgv_ptr)(register PerlInterpreter*);
+static GV** (*Perl_Ierrgv_ptr)(register PerlInterpreter*);
+static SV* (*Perl_Isv_yes_ptr)(register PerlInterpreter*);
+static void (*boot_DynaLoader)_((pTHX_ CV*));
+
+
+/*
+ * Table of name to function pointer of perl.
+ */
+#define PERL_PROC FARPROC
+static struct {
+ char* name;
+ PERL_PROC* ptr;
+} perl_funcname_table[] = {
+ {"perl_alloc", (PERL_PROC*)&perl_alloc},
+ {"perl_construct", (PERL_PROC*)&perl_construct},
+ {"perl_destruct", (PERL_PROC*)&perl_destruct},
+ {"perl_free", (PERL_PROC*)&perl_free},
+ {"perl_run", (PERL_PROC*)&perl_run},
+ {"perl_parse", (PERL_PROC*)&perl_parse},
+ {"Perl_get_context", (PERL_PROC*)&Perl_get_context},
+ {"Perl_croak", (PERL_PROC*)&Perl_croak},
+ {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},
+ {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray},
+ {"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps},
+ {"Perl_gv_stashpv", (PERL_PROC*)&Perl_gv_stashpv},
+ {"Perl_markstack_grow", (PERL_PROC*)&Perl_markstack_grow},
+ {"Perl_mg_find", (PERL_PROC*)&Perl_mg_find},
+ {"Perl_newXS", (PERL_PROC*)&Perl_newXS},
+ {"Perl_newSV", (PERL_PROC*)&Perl_newSV},
+ {"Perl_newSViv", (PERL_PROC*)&Perl_newSViv},
+ {"Perl_newSVpv", (PERL_PROC*)&Perl_newSVpv},
+ {"Perl_call_argv", (PERL_PROC*)&Perl_call_argv},
+ {"Perl_call_pv", (PERL_PROC*)&Perl_call_pv},
+ {"Perl_eval_sv", (PERL_PROC*)&Perl_eval_sv},
+ {"Perl_get_sv", (PERL_PROC*)&Perl_get_sv},
+ {"Perl_eval_pv", (PERL_PROC*)&Perl_eval_pv},
+ {"Perl_call_method", (PERL_PROC*)&Perl_call_method},
+ {"Perl_pop_scope", (PERL_PROC*)&Perl_pop_scope},
+ {"Perl_push_scope", (PERL_PROC*)&Perl_push_scope},
+ {"Perl_save_int", (PERL_PROC*)&Perl_save_int},
+ {"Perl_stack_grow", (PERL_PROC*)&Perl_stack_grow},
+ {"Perl_set_context", (PERL_PROC*)&Perl_set_context},
+ {"Perl_sv_2bool", (PERL_PROC*)&Perl_sv_2bool},
+ {"Perl_sv_2iv", (PERL_PROC*)&Perl_sv_2iv},
+ {"Perl_sv_2mortal", (PERL_PROC*)&Perl_sv_2mortal},
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+ {"Perl_sv_2pv_flags", (PERL_PROC*)&Perl_sv_2pv_flags},
+ {"Perl_sv_2pv_nolen", (PERL_PROC*)&Perl_sv_2pv_nolen},
+#else
+ {"Perl_sv_2pv", (PERL_PROC*)&Perl_sv_2pv},
+#endif
+ {"Perl_sv_bless", (PERL_PROC*)&Perl_sv_bless},
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+ {"Perl_sv_catpvn_flags", (PERL_PROC*)&Perl_sv_catpvn_flags},
+#else
+ {"Perl_sv_catpvn", (PERL_PROC*)&Perl_sv_catpvn},
+#endif
+ {"Perl_sv_free", (PERL_PROC*)&Perl_sv_free},
+ {"Perl_sv_isa", (PERL_PROC*)&Perl_sv_isa},
+ {"Perl_sv_magic", (PERL_PROC*)&Perl_sv_magic},
+ {"Perl_sv_setiv", (PERL_PROC*)&Perl_sv_setiv},
+ {"Perl_sv_setpv", (PERL_PROC*)&Perl_sv_setpv},
+ {"Perl_sv_setpvn", (PERL_PROC*)&Perl_sv_setpvn},
+#if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+ {"Perl_sv_setsv_flags", (PERL_PROC*)&Perl_sv_setsv_flags},
+#else
+ {"Perl_sv_setsv", (PERL_PROC*)&Perl_sv_setsv},
+#endif
+ {"Perl_sv_upgrade", (PERL_PROC*)&Perl_sv_upgrade},
+ {"Perl_Tstack_sp_ptr", (PERL_PROC*)&Perl_Tstack_sp_ptr},
+ {"Perl_Top_ptr", (PERL_PROC*)&Perl_Top_ptr},
+ {"Perl_Tstack_base_ptr", (PERL_PROC*)&Perl_Tstack_base_ptr},
+ {"Perl_Tstack_max_ptr", (PERL_PROC*)&Perl_Tstack_max_ptr},
+ {"Perl_Ttmps_ix_ptr", (PERL_PROC*)&Perl_Ttmps_ix_ptr},
+ {"Perl_Ttmps_floor_ptr", (PERL_PROC*)&Perl_Ttmps_floor_ptr},
+ {"Perl_Tmarkstack_ptr_ptr", (PERL_PROC*)&Perl_Tmarkstack_ptr_ptr},
+ {"Perl_Tmarkstack_max_ptr", (PERL_PROC*)&Perl_Tmarkstack_max_ptr},
+ {"Perl_TSv_ptr", (PERL_PROC*)&Perl_TSv_ptr},
+ {"Perl_TXpv_ptr", (PERL_PROC*)&Perl_TXpv_ptr},
+ {"Perl_Tna_ptr", (PERL_PROC*)&Perl_Tna_ptr},
+ {"Perl_Idefgv_ptr", (PERL_PROC*)&Perl_Idefgv_ptr},
+ {"Perl_Ierrgv_ptr", (PERL_PROC*)&Perl_Ierrgv_ptr},
+ {"Perl_Isv_yes_ptr", (PERL_PROC*)&Perl_Isv_yes_ptr},
+ {"boot_DynaLoader", (PERL_PROC*)&boot_DynaLoader},
+ {"", NULL},
+};
+
+/*
+ * Make all runtime-links of perl.
+ *
+ * 1. Get module handle using LoadLibraryEx.
+ * 2. Get pointer to perl function by GetProcAddress.
+ * 3. Repeat 2, until get all functions will be used.
+ *
+ * Parameter 'libname' provides name of DLL.
+ * Return OK or FAIL.
+ */
+ static int
+perl_runtime_link_init(char *libname, int verbose)
+{
+ int i;
+
+ if (hPerlLib != NULL)
+ return OK;
+ if (!(hPerlLib = LoadLibraryEx(libname, NULL, 0)))
+ {
+ if (verbose)
+ EMSG2(_("E370: Could not load library %s"), libname);
+ return FAIL;
+ }
+ for (i = 0; perl_funcname_table[i].ptr; ++i)
+ {
+ if (!(*perl_funcname_table[i].ptr = GetProcAddress(hPerlLib,
+ perl_funcname_table[i].name)))
+ {
+ FreeLibrary(hPerlLib);
+ hPerlLib = NULL;
+ if (verbose)
+ EMSG2(_(e_loadfunc), perl_funcname_table[i].name);
+ return FAIL;
+ }
+ }
+ return OK;
+}
+
+/*
+ * If runtime-link-perl(DLL) was loaded successfully, return TRUE.
+ * There were no DLL loaded, return FALSE.
+ */
+ int
+perl_enabled(verbose)
+ int verbose;
+{
+ return perl_runtime_link_init(DYNAMIC_PERL_DLL, verbose) == OK;
+}
+#endif /* DYNAMIC_PERL */
+
+/*
+ * perl_init(): initialize perl interpreter
+ * We have to call perl_parse to initialize some structures,
+ * there's nothing to actually parse.
+ */
+ static void
+perl_init()
+{
+ char *bootargs[] = { "VI", NULL };
+ static char *args[] = { "", "-e", "" };
+
+ perl_interp = perl_alloc();
+ perl_construct(perl_interp);
+ perl_parse(perl_interp, xs_init, 3, args, 0);
+ perl_call_argv("VIM::bootstrap", (long)G_DISCARD, bootargs);
+ VIM_init();
+#ifdef USE_SFIO
+ sfdisc(PerlIO_stdout(), sfdcnewvim());
+ sfdisc(PerlIO_stderr(), sfdcnewvim());
+ sfsetbuf(PerlIO_stdout(), NULL, 0);
+ sfsetbuf(PerlIO_stderr(), NULL, 0);
+#endif
+}
+
+/*
+ * perl_end(): clean up after ourselves
+ */
+ void
+perl_end()
+{
+ if (perl_interp)
+ {
+ perl_run(perl_interp);
+ perl_destruct(perl_interp);
+ perl_free(perl_interp);
+ perl_interp = NULL;
+ }
+#ifdef DYNAMIC_PERL
+ if (hPerlLib)
+ {
+ FreeLibrary(hPerlLib);
+ hPerlLib = NULL;
+ }
+#endif
+}
+
+/*
+ * msg_split(): send a message to the message handling routines
+ * split at '\n' first though.
+ */
+ void
+msg_split(s, attr)
+ char_u *s;
+ int attr; /* highlighting attributes */
+{
+ char *next;
+ char *token = (char *)s;
+
+ while ((next = strchr(token, '\n')))
+ {
+ *next++ = '\0'; /* replace \n with \0 */
+ msg_attr((char_u *)token, attr);
+ token = next;
+ }
+ if (*token)
+ msg_attr((char_u *)token, attr);
+}
+
+#ifndef FEAT_EVAL
+/*
+ * This stub is needed because an "#ifdef FEAT_EVAL" around Eval() doesn't
+ * work properly.
+ */
+ char_u *
+eval_to_string(arg, nextcmd)
+ char_u *arg;
+ char_u **nextcmd;
+{
+ return NULL;
+}
+#endif
+
+/*
+ * Create a new reference to an SV pointing to the SCR structure
+ * The perl_private part of the SCR structure points to the SV,
+ * so there can only be one such SV for a particular SCR structure.
+ * When the last reference has gone (DESTROY is called),
+ * perl_private is reset; When the screen goes away before
+ * all references are gone, the value of the SV is reset;
+ * any subsequent use of any of those reference will produce
+ * a warning. (see typemap)
+ */
+#define newANYrv(TYPE, TNAME) \
+static SV * \
+new ## TNAME ## rv(rv, ptr) \
+ SV *rv; \
+ TYPE *ptr; \
+{ \
+ sv_upgrade(rv, SVt_RV); \
+ if (!ptr->perl_private) \
+ { \
+ ptr->perl_private = newSV(0); \
+ sv_setiv(ptr->perl_private, (IV)ptr); \
+ } \
+ else \
+ SvREFCNT_inc(ptr->perl_private); \
+ SvRV(rv) = ptr->perl_private; \
+ SvROK_on(rv); \
+ return sv_bless(rv, gv_stashpv("VI" #TNAME, TRUE)); \
+}
+
+newANYrv(win_T, WIN)
+newANYrv(buf_T, BUF)
+
+/*
+ * perl_win_free
+ * Remove all refences to the window to be destroyed
+ */
+ void
+perl_win_free(wp)
+ win_T *wp;
+{
+ if (wp->perl_private)
+ sv_setiv((SV *)wp->perl_private, 0);
+ return;
+}
+
+ void
+perl_buf_free(bp)
+ buf_T *bp;
+{
+ if (bp->perl_private)
+ sv_setiv((SV *)bp->perl_private, 0);
+ return;
+}
+
+#ifndef PROTO
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+I32 cur_val(pTHX_ IV iv, SV *sv);
+# else
+I32 cur_val(IV iv, SV *sv);
+#endif
+
+/*
+ * Handler for the magic variables $main::curwin and $main::curbuf.
+ * The handler is put into the magic vtbl for these variables.
+ * (This is effectively a C-level equivalent of a tied variable).
+ * There is no "set" function as the variables are read-only.
+ */
+# if (PERL_REVISION == 5) && (PERL_VERSION >= 8)
+I32 cur_val(pTHX_ IV iv, SV *sv)
+# else
+I32 cur_val(IV iv, SV *sv)
+# endif
+{
+ SV *rv;
+ if (iv == 0)
+ rv = newWINrv(newSV(0), curwin);
+ else
+ rv = newBUFrv(newSV(0), curbuf);
+ sv_setsv(sv, rv);
+ return 0;
+}
+#endif /* !PROTO */
+
+struct ufuncs cw_funcs = { cur_val, 0, 0 };
+struct ufuncs cb_funcs = { cur_val, 0, 1 };
+
+/*
+ * VIM_init(): Vim-specific initialisation.
+ * Make the magical main::curwin and main::curbuf variables
+ */
+ static void
+VIM_init()
+{
+ static char cw[] = "main::curwin";
+ static char cb[] = "main::curbuf";
+ SV *sv;
+
+ sv = perl_get_sv(cw, TRUE);
+ sv_magic(sv, NULL, 'U', (char *)&cw_funcs, sizeof(cw_funcs));
+ SvREADONLY_on(sv);
+
+ sv = perl_get_sv(cb, TRUE);
+ sv_magic(sv, NULL, 'U', (char *)&cb_funcs, sizeof(cb_funcs));
+ SvREADONLY_on(sv);
+
+ /*
+ * Setup the Safe compartment.
+ * It shouldn't be a fatal error if the Safe module is missing.
+ * XXX: Only shares the 'Msg' routine (which has to be called
+ * like 'Msg(...)').
+ */
+ (void)perl_eval_pv( "if ( eval( 'require Safe' ) ) { $VIM::safe = Safe->new(); $VIM::safe->share_from( 'VIM', ['Msg'] ); }", G_DISCARD | G_VOID );
+
+}
+
+#ifdef DYNAMIC_PERL
+static char *e_noperl = N_("Sorry, this command is disabled: the Perl library could not be loaded.");
+#endif
+
+/*
+ * ":perl"
+ */
+ void
+ex_perl(eap)
+ exarg_T *eap;
+{
+ char *err;
+ char *script;
+ STRLEN length;
+ SV *sv;
+ SV *safe;
+
+ script = (char *)script_get(eap, eap->arg);
+ if (eap->skip)
+ {
+ vim_free(script);
+ return;
+ }
+
+ if (perl_interp == NULL)
+ {
+#ifdef DYNAMIC_PERL
+ if (!perl_enabled(TRUE))
+ {
+ EMSG(_(e_noperl));
+ vim_free(script);
+ return;
+ }
+#endif
+ perl_init();
+ }
+
+ {
+ dSP;
+ ENTER;
+ SAVETMPS;
+
+ if (script == NULL)
+ sv = newSVpv((char *)eap->arg, 0);
+ else
+ {
+ sv = newSVpv(script, 0);
+ vim_free(script);
+ }
+
+#ifdef HAVE_SANDBOX
+ if (sandbox)
+ {
+ if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe))
+ EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
+ else
+ {
+ PUSHMARK(SP);
+ XPUSHs(safe);
+ XPUSHs(sv);
+ PUTBACK;
+ perl_call_method("reval", G_DISCARD);
+ }
+ }
+ else
+#endif
+ perl_eval_sv(sv, G_DISCARD | G_NOARGS);
+
+ SvREFCNT_dec(sv);
+
+ err = SvPV(GvSV(PL_errgv), length);
+
+ FREETMPS;
+ LEAVE;
+
+ if (!length)
+ return;
+
+ msg_split((char_u *)err, highlight_attr[HLF_E]);
+ return;
+ }
+}
+
+ static int
+replace_line(line, end)
+ linenr_T *line, *end;
+{
+ char *str;
+
+ if (SvOK(GvSV(PL_defgv)))
+ {
+ str = SvPV(GvSV(PL_defgv), PL_na);
+ ml_replace(*line, (char_u *)str, 1);
+ changed_bytes(*line, 0);
+ }
+ else
+ {
+ ml_delete(*line, FALSE);
+ deleted_lines_mark(*line, 1L);
+ --(*end);
+ --(*line);
+ }
+ return OK;
+}
+
+/*
+ * ":perldo".
+ */
+ void
+ex_perldo(eap)
+ exarg_T *eap;
+{
+ STRLEN length;
+ SV *sv;
+ char *str;
+ linenr_T i;
+
+ if (bufempty())
+ return;
+
+ if (perl_interp == NULL)
+ {
+#ifdef DYNAMIC_PERL
+ if (!perl_enabled(TRUE))
+ {
+ EMSG(_(e_noperl));
+ return;
+ }
+#endif
+ perl_init();
+ }
+ {
+ dSP;
+ length = strlen((char *)eap->arg);
+ sv = newSV(length + sizeof("sub VIM::perldo {")-1 + 1);
+ sv_setpvn(sv, "sub VIM::perldo {", sizeof("sub VIM::perldo {")-1);
+ sv_catpvn(sv, (char *)eap->arg, length);
+ sv_catpvn(sv, "}", 1);
+ perl_eval_sv(sv, G_DISCARD | G_NOARGS);
+ SvREFCNT_dec(sv);
+ str = SvPV(GvSV(PL_errgv), length);
+ if (length)
+ goto err;
+
+ if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
+ return;
+
+ ENTER;
+ SAVETMPS;
+ for (i = eap->line1; i <= eap->line2; i++)
+ {
+ sv_setpv(GvSV(PL_defgv),(char *)ml_get(i));
+ PUSHMARK(sp);
+ perl_call_pv("VIM::perldo", G_SCALAR | G_EVAL);
+ str = SvPV(GvSV(PL_errgv), length);
+ if (length)
+ break;
+ SPAGAIN;
+ if (SvTRUEx(POPs))
+ {
+ if (replace_line(&i, &eap->line2) != OK)
+ {
+ PUTBACK;
+ break;
+ }
+ }
+ PUTBACK;
+ }
+ FREETMPS;
+ LEAVE;
+ check_cursor();
+ update_screen(NOT_VALID);
+ if (!length)
+ return;
+
+err:
+ msg_split((char_u *)str, highlight_attr[HLF_E]);
+ return;
+ }
+}
+
+XS(XS_VIM_Msg);
+XS(XS_VIM_SetOption);
+XS(XS_VIM_DoCommand);
+XS(XS_VIM_Eval);
+XS(XS_VIM_Buffers);
+XS(XS_VIM_Windows);
+XS(XS_VIWIN_DESTROY);
+XS(XS_VIWIN_Buffer);
+XS(XS_VIWIN_SetHeight);
+XS(XS_VIWIN_Cursor);
+XS(XS_VIBUF_DESTROY);
+XS(XS_VIBUF_Name);
+XS(XS_VIBUF_Number);
+XS(XS_VIBUF_Count);
+XS(XS_VIBUF_Get);
+XS(XS_VIBUF_Set);
+XS(XS_VIBUF_Delete);
+XS(XS_VIBUF_Append);
+XS(boot_VIM);
+
+ static void
+xs_init(pTHX)
+{
+ char *file = __FILE__;
+
+ /* DynaLoader is a special case */
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+ newXS("VIM::bootstrap", boot_VIM, file);
+}
+
+typedef win_T * VIWIN;
+typedef buf_T * VIBUF;
+
+MODULE = VIM PACKAGE = VIM
+
+void
+Msg(text, hl=NULL)
+ char *text;
+ char *hl;
+
+ PREINIT:
+ int attr;
+ int id;
+
+ PPCODE:
+ if (text != NULL)
+ {
+ attr = 0;
+ if (hl != NULL)
+ {
+ id = syn_name2id((char_u *)hl);
+ if (id != 0)
+ attr = syn_id2attr(id);
+ }
+ msg_split((char_u *)text, attr);
+ }
+
+void
+SetOption(line)
+ char *line;
+
+ PPCODE:
+ if (line != NULL)
+ do_set((char_u *)line, 0);
+ update_screen(NOT_VALID);
+
+void
+DoCommand(line)
+ char *line;
+
+ PPCODE:
+ if (line != NULL)
+ do_cmdline_cmd((char_u *)line);
+
+void
+Eval(str)
+ char *str;
+
+ PREINIT:
+ char_u *value;
+ PPCODE:
+ value = eval_to_string((char_u *)str, (char_u**)0);
+ if (value == NULL)
+ {
+ XPUSHs(sv_2mortal(newSViv(0)));
+ XPUSHs(sv_2mortal(newSVpv("", 0)));
+ }
+ else
+ {
+ XPUSHs(sv_2mortal(newSViv(1)));
+ XPUSHs(sv_2mortal(newSVpv((char *)value, 0)));
+ vim_free(value);
+ }
+
+void
+Buffers(...)
+
+ PREINIT:
+ buf_T *vimbuf;
+ int i, b;
+
+ PPCODE:
+ if (items == 0)
+ {
+ if (GIMME == G_SCALAR)
+ {
+ i = 0;
+ for (vimbuf = firstbuf; vimbuf; vimbuf = vimbuf->b_next)
+ ++i;
+
+ XPUSHs(sv_2mortal(newSViv(i)));
+ }
+ else
+ {
+ for (vimbuf = firstbuf; vimbuf; vimbuf = vimbuf->b_next)
+ XPUSHs(newBUFrv(newSV(0), vimbuf));
+ }
+ }
+ else
+ {
+ for (i = 0; i < items; i++)
+ {
+ SV *sv = ST(i);
+ if (SvIOK(sv))
+ b = SvIV(ST(i));
+ else
+ {
+ char_u *pat;
+ STRLEN len;
+
+ pat = (char_u *)SvPV(sv, len);
+ ++emsg_off;
+ b = buflist_findpat(pat, pat+len, FALSE, FALSE);
+ --emsg_off;
+ }
+
+ if (b >= 0)
+ {
+ vimbuf = buflist_findnr(b);
+ if (vimbuf)
+ XPUSHs(newBUFrv(newSV(0), vimbuf));
+ }
+ }
+ }
+
+void
+Windows(...)
+
+ PREINIT:
+ win_T *vimwin;
+ int i, w;
+
+ PPCODE:
+ if (items == 0)
+ {
+ if (GIMME == G_SCALAR)
+ XPUSHs(sv_2mortal(newSViv(win_count())));
+ else
+ {
+ for (vimwin = firstwin; vimwin != NULL; vimwin = W_NEXT(vimwin))
+ XPUSHs(newWINrv(newSV(0), vimwin));
+ }
+ }
+ else
+ {
+ for (i = 0; i < items; i++)
+ {
+ w = SvIV(ST(i));
+ vimwin = win_find_nr(w);
+ if (vimwin)
+ XPUSHs(newWINrv(newSV(0), vimwin));
+ }
+ }
+
+MODULE = VIM PACKAGE = VIWIN
+
+void
+DESTROY(win)
+ VIWIN win
+
+ CODE:
+ if (win_valid(win))
+ win->perl_private = 0;
+
+SV *
+Buffer(win)
+ VIWIN win
+
+ CODE:
+ if (!win_valid(win))
+ win = curwin;
+ RETVAL = newBUFrv(newSV(0), win->w_buffer);
+ OUTPUT:
+ RETVAL
+
+void
+SetHeight(win, height)
+ VIWIN win
+ int height;
+
+ PREINIT:
+ win_T *savewin;
+
+ PPCODE:
+ if (!win_valid(win))
+ win = curwin;
+ savewin = curwin;
+ curwin = win;
+ win_setheight(height);
+ curwin = savewin;
+
+void
+Cursor(win, ...)
+ VIWIN win
+
+ PPCODE:
+ if(items == 1)
+ {
+ EXTEND(sp, 2);
+ if (!win_valid(win))
+ win = curwin;
+ PUSHs(sv_2mortal(newSViv(win->w_cursor.lnum)));
+ PUSHs(sv_2mortal(newSViv(win->w_cursor.col)));
+ }
+ else if(items == 3)
+ {
+ int lnum, col;
+
+ if (!win_valid(win))
+ win = curwin;
+ lnum = SvIV(ST(1));
+ col = SvIV(ST(2));
+ win->w_cursor.lnum = lnum;
+ win->w_cursor.col = col;
+ check_cursor(); /* put cursor on an existing line */
+ update_screen(NOT_VALID);
+ }
+
+MODULE = VIM PACKAGE = VIBUF
+
+void
+DESTROY(vimbuf)
+ VIBUF vimbuf;
+
+ CODE:
+ if (buf_valid(vimbuf))
+ vimbuf->perl_private = 0;
+
+void
+Name(vimbuf)
+ VIBUF vimbuf;
+
+ PPCODE:
+ if (!buf_valid(vimbuf))
+ vimbuf = curbuf;
+ /* No file name returns an empty string */
+ if (vimbuf->b_fname == NULL)
+ XPUSHs(sv_2mortal(newSVpv("", 0)));
+ else
+ XPUSHs(sv_2mortal(newSVpv((char *)vimbuf->b_fname, 0)));
+
+void
+Number(vimbuf)
+ VIBUF vimbuf;
+
+ PPCODE:
+ if (!buf_valid(vimbuf))
+ vimbuf = curbuf;
+ XPUSHs(sv_2mortal(newSViv(vimbuf->b_fnum)));
+
+void
+Count(vimbuf)
+ VIBUF vimbuf;
+
+ PPCODE:
+ if (!buf_valid(vimbuf))
+ vimbuf = curbuf;
+ XPUSHs(sv_2mortal(newSViv(vimbuf->b_ml.ml_line_count)));
+
+void
+Get(vimbuf, ...)
+ VIBUF vimbuf;
+
+ PREINIT:
+ char_u *line;
+ int i;
+ long lnum;
+ PPCODE:
+ if (buf_valid(vimbuf))
+ {
+ for (i = 1; i < items; i++)
+ {
+ lnum = SvIV(ST(i));
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+ line = ml_get_buf(vimbuf, lnum, FALSE);
+ XPUSHs(sv_2mortal(newSVpv((char *)line, 0)));
+ }
+ }
+ }
+
+void
+Set(vimbuf, ...)
+ VIBUF vimbuf;
+
+ PREINIT:
+ int i;
+ long lnum;
+ char *line;
+ buf_T *savebuf;
+ PPCODE:
+ if (buf_valid(vimbuf))
+ {
+ if (items < 3)
+ croak("Usage: VIBUF::Set(vimbuf, lnum, @lines)");
+
+ lnum = SvIV(ST(1));
+ for(i = 2; i < items; i++, lnum++)
+ {
+ line = SvPV(ST(i),PL_na);
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+ savebuf = curbuf;
+ curbuf = vimbuf;
+ if (u_savesub(lnum) == OK)
+ {
+ ml_replace(lnum, (char_u *)line, TRUE);
+ changed_bytes(lnum, 0);
+ }
+ curbuf = savebuf;
+ }
+ }
+ }
+
+void
+Delete(vimbuf, ...)
+ VIBUF vimbuf;
+
+ PREINIT:
+ long i, lnum = 0, count = 0;
+ buf_T *savebuf;
+ PPCODE:
+ if (buf_valid(vimbuf))
+ {
+ if (items == 2)
+ {
+ lnum = SvIV(ST(1));
+ count = 1;
+ }
+ else if (items == 3)
+ {
+ lnum = SvIV(ST(1));
+ count = 1 + SvIV(ST(2)) - lnum;
+ if(count == 0)
+ count = 1;
+ if(count < 0)
+ {
+ lnum -= count;
+ count = -count;
+ }
+ }
+ if (items >= 2)
+ {
+ for (i = 0; i < count; i++)
+ {
+ if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count)
+ {
+ savebuf = curbuf;
+ curbuf = vimbuf;
+ if (u_savedel(lnum, 1) == OK)
+ {
+ ml_delete(lnum, 0);
+ deleted_lines_mark(lnum, 1L);
+ if (savebuf == curbuf)
+ check_cursor();
+ }
+ curbuf = savebuf;
+ update_curbuf(VALID);
+ }
+ }
+ }
+ }
+
+void
+Append(vimbuf, ...)
+ VIBUF vimbuf;
+
+ PREINIT:
+ int i;
+ long lnum;
+ char *line;
+ buf_T *savebuf;
+ PPCODE:
+ if (buf_valid(vimbuf))
+ {
+ if (items < 3)
+ croak("Usage: VIBUF::Append(vimbuf, lnum, @lines)");
+
+ lnum = SvIV(ST(1));
+ for (i = 2; i < items; i++, lnum++)
+ {
+ line = SvPV(ST(i),PL_na);
+ if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL)
+ {
+ savebuf = curbuf;
+ curbuf = vimbuf;
+ if (u_inssub(lnum + 1) == OK)
+ {
+ ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE);
+ appended_lines_mark(lnum, 1L);
+ }
+ curbuf = savebuf;
+ update_curbuf(VALID);
+ }
+ }
+ }
+
diff --git a/src/if_perlsfio.c b/src/if_perlsfio.c
new file mode 100644
index 000000000..0ae1b956d
--- /dev/null
+++ b/src/if_perlsfio.c
@@ -0,0 +1,66 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * if_perlsfio.c: Special I/O functions for Perl interface.
+ */
+
+#define _memory_h /* avoid memset redeclaration */
+#define IN_PERL_FILE /* don't include if_perl.pro from prot.h */
+
+#include "vim.h"
+
+#if defined(USE_SFIO) || defined(PROTO)
+
+#ifndef USE_SFIO /* just generating prototypes */
+# define Sfio_t int
+# define Sfdisc_t int
+#endif
+
+#define NIL(type) ((type)0)
+
+ static int
+sfvimwrite(f, buf, n, disc)
+ Sfio_t *f; /* stream involved */
+ char *buf; /* buffer to read from */
+ int n; /* number of bytes to write */
+ Sfdisc_t *disc; /* discipline */
+{
+ char_u *str;
+
+ str = vim_strnsave((char_u *)buf, n);
+ if (str == NULL)
+ return 0;
+ msg_split((char *)str);
+ vim_free(str);
+
+ return n;
+}
+
+/*
+ * sfdcnewnvi --
+ * Create Vim discipline
+ */
+ Sfdisc_t *
+sfdcnewvim()
+{
+ Sfdisc_t *disc;
+
+ disc = (Sfdisc_t *)alloc((unsigned)sizeof(Sfdisc_t));
+ if (disc == NULL)
+ return NULL;
+
+ disc->readf = (Sfread_f)NULL;
+ disc->writef = sfvimwrite;
+ disc->seekf = (Sfseek_f)NULL;
+ disc->exceptf = (Sfexcept_f)NULL;
+
+ return disc;
+}
+
+#endif /* USE_SFIO */
diff --git a/src/if_python.c b/src/if_python.c
new file mode 100644
index 000000000..21c436520
--- /dev/null
+++ b/src/if_python.c
@@ -0,0 +1,2807 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * Python extensions by Paul Moore.
+ * Changes for Unix by David Leonard.
+ *
+ * This consists of four parts:
+ * 1. Python interpreter main program
+ * 2. Python output stream: writes output via [e]msg().
+ * 3. Implementation of the Vim module for Python
+ * 4. Utility functions for handling the interface between Vim and Python.
+ */
+
+#include "vim.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <limits.h>
+
+/* Python.h defines _POSIX_THREADS itself (if needed) */
+#ifdef _POSIX_THREADS
+# undef _POSIX_THREADS
+#endif
+
+#if defined(_WIN32) && defined (HAVE_FCNTL_H)
+# undef HAVE_FCNTL_H
+#endif
+
+#ifdef _DEBUG
+# undef _DEBUG
+#endif
+
+#ifdef HAVE_STDARG_H
+# undef HAVE_STDARG_H /* Python's config.h defines it as well. */
+#endif
+
+#include <Python.h>
+#if defined(MACOS) && !defined(MACOS_X_UNIX)
+# include "macglue.h"
+# include <CodeFragments.h>
+#endif
+#undef main /* Defined in python.h - aargh */
+#undef HAVE_FCNTL_H /* Clash with os_win32.h */
+
+#if !defined(FEAT_PYTHON) && defined(PROTO)
+/* Use this to be able to generate prototypes without python being used. */
+# define PyObject int
+# define PyThreadState int
+# define PyTypeObject int
+struct PyMethodDef { int a; };
+# define PySequenceMethods int
+#endif
+
+/* Parser flags */
+#define single_input 256
+#define file_input 257
+#define eval_input 258
+
+#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x020300F0
+ /* Python 2.3: can invoke ":python" recursively. */
+# define PY_CAN_RECURSE
+#endif
+
+#if defined(DYNAMIC_PYTHON) || defined(PROTO)
+# ifndef DYNAMIC_PYTHON
+# define HINSTANCE int /* for generating prototypes */
+# endif
+
+/*
+ * Wrapper defines
+ */
+# define PyArg_Parse dll_PyArg_Parse
+# define PyArg_ParseTuple dll_PyArg_ParseTuple
+# define PyDict_SetItemString dll_PyDict_SetItemString
+# define PyErr_BadArgument dll_PyErr_BadArgument
+# define PyErr_Clear dll_PyErr_Clear
+# define PyErr_NoMemory dll_PyErr_NoMemory
+# define PyErr_Occurred dll_PyErr_Occurred
+# define PyErr_SetNone dll_PyErr_SetNone
+# define PyErr_SetString dll_PyErr_SetString
+# define PyEval_InitThreads dll_PyEval_InitThreads
+# define PyEval_RestoreThread dll_PyEval_RestoreThread
+# define PyEval_SaveThread dll_PyEval_SaveThread
+# ifdef PY_CAN_RECURSE
+# define PyGILState_Ensure dll_PyGILState_Ensure
+# define PyGILState_Release dll_PyGILState_Release
+# endif
+# define PyInt_AsLong dll_PyInt_AsLong
+# define PyInt_FromLong dll_PyInt_FromLong
+# define PyInt_Type (*dll_PyInt_Type)
+# define PyList_GetItem dll_PyList_GetItem
+# define PyList_New dll_PyList_New
+# define PyList_SetItem dll_PyList_SetItem
+# define PyList_Size dll_PyList_Size
+# define PyList_Type (*dll_PyList_Type)
+# define PyImport_ImportModule dll_PyImport_ImportModule
+# define PyDict_GetItemString dll_PyDict_GetItemString
+# define PyModule_GetDict dll_PyModule_GetDict
+# define PyRun_SimpleString dll_PyRun_SimpleString
+# define PyString_AsString dll_PyString_AsString
+# define PyString_FromString dll_PyString_FromString
+# define PyString_FromStringAndSize dll_PyString_FromStringAndSize
+# define PyString_Size dll_PyString_Size
+# define PyString_Type (*dll_PyString_Type)
+# define PySys_SetObject dll_PySys_SetObject
+# define PySys_SetArgv dll_PySys_SetArgv
+# define PyType_Type (*dll_PyType_Type)
+# define Py_BuildValue dll_Py_BuildValue
+# define Py_FindMethod dll_Py_FindMethod
+# define Py_InitModule4 dll_Py_InitModule4
+# define Py_Initialize dll_Py_Initialize
+# define _PyObject_New dll__PyObject_New
+# define _Py_NoneStruct (*dll__Py_NoneStruct)
+# define PyObject_Init dll__PyObject_Init
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+# define PyType_IsSubtype dll_PyType_IsSubtype
+# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
+# define PyObject_Malloc dll_PyObject_Malloc
+# define PyObject_Free dll_PyObject_Free
+# endif
+
+/*
+ * Pointers for dynamic link
+ */
+static int(*dll_PyArg_Parse)(PyObject *, char *, ...);
+static int(*dll_PyArg_ParseTuple)(PyObject *, char *, ...);
+static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
+static int(*dll_PyErr_BadArgument)(void);
+static void(*dll_PyErr_Clear)(void);
+static PyObject*(*dll_PyErr_NoMemory)(void);
+static PyObject*(*dll_PyErr_Occurred)(void);
+static void(*dll_PyErr_SetNone)(PyObject *);
+static void(*dll_PyErr_SetString)(PyObject *, const char *);
+static void(*dll_PyEval_InitThreads)(void);
+static void(*dll_PyEval_RestoreThread)(PyThreadState *);
+static PyThreadState*(*dll_PyEval_SaveThread)(void);
+# ifdef PY_CAN_RECURSE
+static PyGILState_STATE (*dll_PyGILState_Ensure)(void);
+static void (*dll_PyGILState_Release)(PyGILState_STATE);
+#endif
+static long(*dll_PyInt_AsLong)(PyObject *);
+static PyObject*(*dll_PyInt_FromLong)(long);
+static PyTypeObject* dll_PyInt_Type;
+static PyObject*(*dll_PyList_GetItem)(PyObject *, int);
+static PyObject*(*dll_PyList_New)(int size);
+static int(*dll_PyList_SetItem)(PyObject *, int, PyObject *);
+static int(*dll_PyList_Size)(PyObject *);
+static PyTypeObject* dll_PyList_Type;
+static PyObject*(*dll_PyImport_ImportModule)(const char *);
+static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *);
+static PyObject*(*dll_PyModule_GetDict)(PyObject *);
+static int(*dll_PyRun_SimpleString)(char *);
+static char*(*dll_PyString_AsString)(PyObject *);
+static PyObject*(*dll_PyString_FromString)(const char *);
+static PyObject*(*dll_PyString_FromStringAndSize)(const char *, int);
+static int(*dll_PyString_Size)(PyObject *);
+static PyTypeObject* dll_PyString_Type;
+static int(*dll_PySys_SetObject)(char *, PyObject *);
+static int(*dll_PySys_SetArgv)(int, char **);
+static PyTypeObject* dll_PyType_Type;
+static PyObject*(*dll_Py_BuildValue)(char *, ...);
+static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
+static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int);
+static void(*dll_Py_Initialize)(void);
+static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
+static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
+static PyObject* dll__Py_NoneStruct;
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
+# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
+static void* (*dll_PyObject_Malloc)(size_t);
+static void (*dll_PyObject_Free)(void*);
+# endif
+
+static HINSTANCE hinstPython = 0; /* Instance of python.dll */
+
+/* Imported exception objects */
+static PyObject *imp_PyExc_AttributeError;
+static PyObject *imp_PyExc_IndexError;
+static PyObject *imp_PyExc_KeyboardInterrupt;
+static PyObject *imp_PyExc_TypeError;
+static PyObject *imp_PyExc_ValueError;
+
+# define PyExc_AttributeError imp_PyExc_AttributeError
+# define PyExc_IndexError imp_PyExc_IndexError
+# define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt
+# define PyExc_TypeError imp_PyExc_TypeError
+# define PyExc_ValueError imp_PyExc_ValueError
+
+/*
+ * Table of name to function pointer of python.
+ */
+# define PYTHON_PROC FARPROC
+static struct
+{
+ char *name;
+ PYTHON_PROC *ptr;
+} python_funcname_table[] =
+{
+ {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
+ {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
+ {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
+ {"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument},
+ {"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear},
+ {"PyErr_NoMemory", (PYTHON_PROC*)&dll_PyErr_NoMemory},
+ {"PyErr_Occurred", (PYTHON_PROC*)&dll_PyErr_Occurred},
+ {"PyErr_SetNone", (PYTHON_PROC*)&dll_PyErr_SetNone},
+ {"PyErr_SetString", (PYTHON_PROC*)&dll_PyErr_SetString},
+ {"PyEval_InitThreads", (PYTHON_PROC*)&dll_PyEval_InitThreads},
+ {"PyEval_RestoreThread", (PYTHON_PROC*)&dll_PyEval_RestoreThread},
+ {"PyEval_SaveThread", (PYTHON_PROC*)&dll_PyEval_SaveThread},
+# ifdef PY_CAN_RECURSE
+ {"PyGILState_Ensure", (PYTHON_PROC*)&dll_PyGILState_Ensure},
+ {"PyGILState_Release", (PYTHON_PROC*)&dll_PyGILState_Release},
+# endif
+ {"PyInt_AsLong", (PYTHON_PROC*)&dll_PyInt_AsLong},
+ {"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong},
+ {"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type},
+ {"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem},
+ {"PyList_New", (PYTHON_PROC*)&dll_PyList_New},
+ {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem},
+ {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size},
+ {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type},
+ {"PyImport_ImportModule", (PYTHON_PROC*)&dll_PyImport_ImportModule},
+ {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString},
+ {"PyModule_GetDict", (PYTHON_PROC*)&dll_PyModule_GetDict},
+ {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString},
+ {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString},
+ {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString},
+ {"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize},
+ {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
+ {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type},
+ {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject},
+ {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
+ {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
+ {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
+ {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
+ {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
+ {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
+ {"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
+ {"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
+ {"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct},
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
+# endif
+# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
+ {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
+ {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
+# endif
+ {"", NULL},
+};
+
+/*
+ * Free python.dll
+ */
+ static void
+end_dynamic_python(void)
+{
+ if (hinstPython)
+ {
+ FreeLibrary(hinstPython);
+ hinstPython = 0;
+ }
+}
+
+/*
+ * Load library and get all pointers.
+ * Parameter 'libname' provides name of DLL.
+ * Return OK or FAIL.
+ */
+ static int
+python_runtime_link_init(char *libname, int verbose)
+{
+ int i;
+
+ if (hinstPython)
+ return OK;
+ hinstPython = LoadLibrary(libname);
+ if (!hinstPython)
+ {
+ if (verbose)
+ EMSG2(_(e_loadlib), libname);
+ return FAIL;
+ }
+
+ for (i = 0; python_funcname_table[i].ptr; ++i)
+ {
+ if ((*python_funcname_table[i].ptr = GetProcAddress(hinstPython,
+ python_funcname_table[i].name)) == NULL)
+ {
+ FreeLibrary(hinstPython);
+ hinstPython = 0;
+ if (verbose)
+ EMSG2(_(e_loadfunc), python_funcname_table[i].name);
+ return FAIL;
+ }
+ }
+ return OK;
+}
+
+/*
+ * If python is enabled (there is installed python on Windows system) return
+ * TRUE, else FALSE.
+ */
+ int
+python_enabled(verbose)
+ int verbose;
+{
+ return python_runtime_link_init(DYNAMIC_PYTHON_DLL, verbose) == OK;
+}
+
+/* Load the standard Python exceptions - don't import the symbols from the
+ * DLL, as this can cause errors (importing data symbols is not reliable).
+ */
+static void get_exceptions __ARGS((void));
+
+ static void
+get_exceptions()
+{
+ PyObject *exmod = PyImport_ImportModule("exceptions");
+ PyObject *exdict = PyModule_GetDict(exmod);
+ imp_PyExc_AttributeError = PyDict_GetItemString(exdict, "AttributeError");
+ imp_PyExc_IndexError = PyDict_GetItemString(exdict, "IndexError");
+ imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
+ imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
+ imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
+ Py_XINCREF(imp_PyExc_AttributeError);
+ Py_XINCREF(imp_PyExc_IndexError);
+ Py_XINCREF(imp_PyExc_KeyboardInterrupt);
+ Py_XINCREF(imp_PyExc_TypeError);
+ Py_XINCREF(imp_PyExc_ValueError);
+ Py_XDECREF(exmod);
+}
+#endif /* DYNAMIC_PYTHON */
+
+/******************************************************
+ * Internal function prototypes.
+ */
+
+static void DoPythonCommand(exarg_T *, const char *);
+static int RangeStart;
+static int RangeEnd;
+
+static void PythonIO_Flush(void);
+static int PythonIO_Init(void);
+static int PythonMod_Init(void);
+
+/* Utility functions for the vim/python interface
+ * ----------------------------------------------
+ */
+static PyObject *GetBufferLine(buf_T *, int);
+static PyObject *GetBufferLineList(buf_T *, int, int);
+
+static int SetBufferLine(buf_T *, int, PyObject *, int *);
+static int SetBufferLineList(buf_T *, int, int, PyObject *, int *);
+static int InsertBufferLines(buf_T *, int, PyObject *, int *);
+
+static PyObject *LineToString(const char *);
+static char *StringToLine(PyObject *);
+
+static int VimErrorCheck(void);
+
+#define PyErr_SetVim(str) PyErr_SetString(VimError, str)
+
+/******************************************************
+ * 1. Python interpreter main program.
+ */
+
+static int initialised = 0;
+
+#if PYTHON_API_VERSION < 1007 /* Python 1.4 */
+typedef PyObject PyThreadState;
+#endif /* Python 1.4 */
+
+#ifndef PY_CAN_RECURSE
+static PyThreadState* saved_python_thread = NULL;
+
+/*
+ * Suspend a thread of the Python interpreter, other threads are allowed to
+ * run.
+ */
+static void Python_SaveThread(void)
+{
+ saved_python_thread = PyEval_SaveThread();
+}
+
+/*
+ * Restore a thread of the Python interpreter, waits for other threads to
+ * block.
+ */
+static void Python_RestoreThread(void)
+{
+ PyEval_RestoreThread(saved_python_thread);
+ saved_python_thread = NULL;
+}
+#endif
+
+/*
+ * obtain a lock on the Vim data structures
+ */
+static void Python_Lock_Vim(void)
+{
+}
+
+/*
+ * release a lock on the Vim data structures
+ */
+static void Python_Release_Vim(void)
+{
+}
+
+ void
+python_end()
+{
+#ifdef DYNAMIC_PYTHON
+ end_dynamic_python();
+#endif
+}
+
+ static int
+Python_Init(void)
+{
+ if (!initialised)
+ {
+#ifdef DYNAMIC_PYTHON
+ if (!python_enabled(TRUE))
+ {
+ EMSG(_("E263: Sorry, this command is disabled, the Python library could not be loaded."));
+ goto fail;
+ }
+#endif
+
+#if !defined(MACOS) || defined(MACOS_X_UNIX)
+ Py_Initialize();
+#else
+ PyMac_Initialize();
+#endif
+ /* initialise threads */
+ PyEval_InitThreads();
+
+#ifdef DYNAMIC_PYTHON
+ get_exceptions();
+#endif
+
+ if (PythonIO_Init())
+ goto fail;
+
+ if (PythonMod_Init())
+ goto fail;
+
+#ifndef PY_CAN_RECURSE
+ /* the first python thread is vim's */
+ Python_SaveThread();
+#endif
+
+ initialised = 1;
+ }
+
+ return 0;
+
+fail:
+ /* We call PythonIO_Flush() here to print any Python errors.
+ * This is OK, as it is possible to call this function even
+ * if PythonIO_Init() has not completed successfully (it will
+ * not do anything in this case).
+ */
+ PythonIO_Flush();
+ return -1;
+}
+
+/*
+ * External interface
+ */
+ static void
+DoPythonCommand(exarg_T *eap, const char *cmd)
+{
+#ifdef PY_CAN_RECURSE
+ PyGILState_STATE pygilstate;
+#else
+ static int recursive = 0;
+#endif
+#if defined(MACOS) && !defined(MACOS_X_UNIX)
+ GrafPtr oldPort;
+#endif
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ char *saved_locale;
+#endif
+
+#ifndef PY_CAN_RECURSE
+ if (recursive)
+ {
+ EMSG(_("E659: Cannot invoke Python recursively"));
+ return;
+ }
+ ++recursive;
+#endif
+
+#if defined(MACOS) && !defined(MACOS_X_UNIX)
+ GetPort(&oldPort);
+ /* Check if the Python library is available */
+ if ((Ptr)PyMac_Initialize == (Ptr)kUnresolvedCFragSymbolAddress)
+ goto theend;
+#endif
+ if (Python_Init())
+ goto theend;
+
+ RangeStart = eap->line1;
+ RangeEnd = eap->line2;
+ Python_Release_Vim(); /* leave vim */
+
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ /* Python only works properly when the LC_NUMERIC locale is "C". */
+ saved_locale = setlocale(LC_NUMERIC, NULL);
+ if (saved_locale == NULL || STRCMP(saved_locale, "C") == 0)
+ saved_locale = NULL;
+ else
+ {
+ /* Need to make a copy, value may change when setting new locale. */
+ saved_locale = (char *)vim_strsave((char_u *)saved_locale);
+ (void)setlocale(LC_NUMERIC, "C");
+ }
+#endif
+
+#ifdef PY_CAN_RECURSE
+ pygilstate = PyGILState_Ensure();
+#else
+ Python_RestoreThread(); /* enter python */
+#endif
+
+ PyRun_SimpleString((char *)(cmd));
+
+#ifdef PY_CAN_RECURSE
+ PyGILState_Release(pygilstate);
+#else
+ Python_SaveThread(); /* leave python */
+#endif
+
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ if (saved_locale != NULL)
+ {
+ (void)setlocale(LC_NUMERIC, saved_locale);
+ vim_free(saved_locale);
+ }
+#endif
+
+ Python_Lock_Vim(); /* enter vim */
+ PythonIO_Flush();
+#if defined(MACOS) && !defined(MACOS_X_UNIX)
+ SetPort(oldPort);
+#endif
+
+theend:
+#ifndef PY_CAN_RECURSE
+ --recursive;
+#endif
+ return; /* keeps lint happy */
+}
+
+/*
+ * ":python"
+ */
+ void
+ex_python(exarg_T *eap)
+{
+ char_u *script;
+
+ script = script_get(eap, eap->arg);
+ if (!eap->skip)
+ {
+ if (script == NULL)
+ DoPythonCommand(eap, (char *)eap->arg);
+ else
+ DoPythonCommand(eap, (char *)script);
+ }
+ vim_free(script);
+}
+
+#define BUFFER_SIZE 1024
+
+/*
+ * ":pyfile"
+ */
+ void
+ex_pyfile(exarg_T *eap)
+{
+ static char buffer[BUFFER_SIZE];
+ const char *file = (char *)eap->arg;
+ char *p;
+
+ /* Have to do it like this. PyRun_SimpleFile requires you to pass a
+ * stdio file pointer, but Vim and the Python DLL are compiled with
+ * different options under Windows, meaning that stdio pointers aren't
+ * compatible between the two. Yuk.
+ *
+ * Put the string "execfile('file')" into buffer. But, we need to
+ * escape any backslashes or single quotes in the file name, so that
+ * Python won't mangle the file name.
+ */
+ strcpy(buffer, "execfile('");
+ p = buffer + 10; /* size of "execfile('" */
+
+ while (*file && p < buffer + (BUFFER_SIZE - 3))
+ {
+ if (*file == '\\' || *file == '\'')
+ *p++ = '\\';
+ *p++ = *file++;
+ }
+
+ /* If we didn't finish the file name, we hit a buffer overflow */
+ if (*file != '\0')
+ return;
+
+ /* Put in the terminating "')" and a null */
+ *p++ = '\'';
+ *p++ = ')';
+ *p++ = '\0';
+
+ /* Execute the file */
+ DoPythonCommand(eap, buffer);
+}
+
+/******************************************************
+ * 2. Python output stream: writes output via [e]msg().
+ */
+
+/* Implementation functions
+ */
+
+static PyObject *OutputGetattr(PyObject *, char *);
+static int OutputSetattr(PyObject *, char *, PyObject *);
+
+static PyObject *OutputWrite(PyObject *, PyObject *);
+static PyObject *OutputWritelines(PyObject *, PyObject *);
+
+typedef void (*writefn)(char_u *);
+static void writer(writefn fn, char_u *str, int n);
+
+/* Output object definition
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+ long softspace;
+ long error;
+} OutputObject;
+
+static struct PyMethodDef OutputMethods[] = {
+ /* name, function, calling, documentation */
+ {"write", OutputWrite, 1, "" },
+ {"writelines", OutputWritelines, 1, "" },
+ { NULL, NULL, 0, NULL }
+};
+
+static PyTypeObject OutputType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "message",
+ sizeof(OutputObject),
+ 0,
+
+ (destructor) 0,
+ (printfunc) 0,
+ (getattrfunc) OutputGetattr,
+ (setattrfunc) OutputSetattr,
+ (cmpfunc) 0,
+ (reprfunc) 0,
+
+ 0, /* as number */
+ 0, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0,
+ (ternaryfunc) 0,
+ (reprfunc) 0
+};
+
+/*************/
+
+ static PyObject *
+OutputGetattr(PyObject *self, char *name)
+{
+ if (strcmp(name, "softspace") == 0)
+ return PyInt_FromLong(((OutputObject *)(self))->softspace);
+
+ return Py_FindMethod(OutputMethods, self, name);
+}
+
+ static int
+OutputSetattr(PyObject *self, char *name, PyObject *val)
+{
+ if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+ if (!PyInt_Check(val)) {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+
+ ((OutputObject *)(self))->softspace = PyInt_AsLong(val);
+ return 0;
+ }
+
+ PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
+ return -1;
+}
+
+/*************/
+
+ static PyObject *
+OutputWrite(PyObject *self, PyObject *args)
+{
+ int len;
+ char *str;
+ int error = ((OutputObject *)(self))->error;
+
+ if (!PyArg_ParseTuple(args, "s#", &str, &len))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ Python_Lock_Vim();
+ writer((writefn)(error ? emsg : msg), (char_u *)str, len);
+ Python_Release_Vim();
+ Py_END_ALLOW_THREADS
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+ static PyObject *
+OutputWritelines(PyObject *self, PyObject *args)
+{
+ int n;
+ int i;
+ PyObject *list;
+ int error = ((OutputObject *)(self))->error;
+
+ if (!PyArg_ParseTuple(args, "O", &list))
+ return NULL;
+ Py_INCREF(list);
+
+ if (!PyList_Check(list)) {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+ }
+
+ n = PyList_Size(list);
+
+ for (i = 0; i < n; ++i)
+ {
+ PyObject *line = PyList_GetItem(list, i);
+ char *str;
+ int len;
+
+ if (!PyArg_Parse(line, "s#", &str, &len)) {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+ }
+
+ Py_BEGIN_ALLOW_THREADS
+ Python_Lock_Vim();
+ writer((writefn)(error ? emsg : msg), (char_u *)str, len);
+ Python_Release_Vim();
+ Py_END_ALLOW_THREADS
+ }
+
+ Py_DECREF(list);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+/* Output buffer management
+ */
+
+static char_u *buffer = NULL;
+static int buffer_len = 0;
+static int buffer_size = 0;
+
+static writefn old_fn = NULL;
+
+ static void
+buffer_ensure(int n)
+{
+ int new_size;
+ char_u *new_buffer;
+
+ if (n < buffer_size)
+ return;
+
+ new_size = buffer_size;
+ while (new_size < n)
+ new_size += 80;
+
+ if (new_size != buffer_size)
+ {
+ new_buffer = alloc((unsigned)new_size);
+ if (new_buffer == NULL)
+ return;
+
+ if (buffer)
+ {
+ memcpy(new_buffer, buffer, buffer_len);
+ vim_free(buffer);
+ }
+
+ buffer = new_buffer;
+ buffer_size = new_size;
+ }
+}
+
+ static void
+PythonIO_Flush(void)
+{
+ if (old_fn && buffer_len)
+ {
+ buffer[buffer_len] = 0;
+ old_fn(buffer);
+ }
+
+ buffer_len = 0;
+}
+
+ static void
+writer(writefn fn, char_u *str, int n)
+{
+ char_u *ptr;
+
+ if (fn != old_fn && old_fn != NULL)
+ PythonIO_Flush();
+
+ old_fn = fn;
+
+ while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL)
+ {
+ int len = ptr - str;
+
+ buffer_ensure(buffer_len + len + 1);
+
+ memcpy(buffer + buffer_len, str, len);
+ buffer_len += len;
+ buffer[buffer_len] = 0;
+ fn(buffer);
+ str = ptr + 1;
+ n -= len + 1;
+ buffer_len = 0;
+ }
+
+ /* Put the remaining text into the buffer for later printing */
+ buffer_ensure(buffer_len + n + 1);
+ memcpy(buffer + buffer_len, str, n);
+ buffer_len += n;
+}
+
+/***************/
+
+static OutputObject Output =
+{
+ PyObject_HEAD_INIT(&OutputType)
+ 0,
+ 0
+};
+
+static OutputObject Error =
+{
+ PyObject_HEAD_INIT(&OutputType)
+ 0,
+ 1
+};
+
+ static int
+PythonIO_Init(void)
+{
+ /* Fixups... */
+ OutputType.ob_type = &PyType_Type;
+
+ PySys_SetObject("stdout", (PyObject *)(&Output));
+ PySys_SetObject("stderr", (PyObject *)(&Error));
+
+ if (PyErr_Occurred())
+ {
+ EMSG(_("E264: Python: Error initialising I/O objects"));
+ return -1;
+ }
+
+ return 0;
+}
+
+/******************************************************
+ * 3. Implementation of the Vim module for Python
+ */
+
+/* Vim module - Implementation functions
+ * -------------------------------------
+ */
+
+static PyObject *VimError;
+
+static PyObject *VimCommand(PyObject *, PyObject *);
+static PyObject *VimEval(PyObject *, PyObject *);
+
+/* Window type - Implementation functions
+ * --------------------------------------
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+ win_T *win;
+}
+WindowObject;
+
+#define INVALID_WINDOW_VALUE ((win_T *)(-1))
+
+#define WindowType_Check(obj) ((obj)->ob_type == &WindowType)
+
+static PyObject *WindowNew(win_T *);
+
+static void WindowDestructor(PyObject *);
+static PyObject *WindowGetattr(PyObject *, char *);
+static int WindowSetattr(PyObject *, char *, PyObject *);
+static PyObject *WindowRepr(PyObject *);
+
+/* Buffer type - Implementation functions
+ * --------------------------------------
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+ buf_T *buf;
+}
+BufferObject;
+
+#define INVALID_BUFFER_VALUE ((buf_T *)(-1))
+
+#define BufferType_Check(obj) ((obj)->ob_type == &BufferType)
+
+static PyObject *BufferNew (buf_T *);
+
+static void BufferDestructor(PyObject *);
+static PyObject *BufferGetattr(PyObject *, char *);
+static PyObject *BufferRepr(PyObject *);
+
+static int BufferLength(PyObject *);
+static PyObject *BufferItem(PyObject *, int);
+static PyObject *BufferSlice(PyObject *, int, int);
+static int BufferAssItem(PyObject *, int, PyObject *);
+static int BufferAssSlice(PyObject *, int, int, PyObject *);
+
+static PyObject *BufferAppend(PyObject *, PyObject *);
+static PyObject *BufferMark(PyObject *, PyObject *);
+static PyObject *BufferRange(PyObject *, PyObject *);
+
+/* Line range type - Implementation functions
+ * --------------------------------------
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+ BufferObject *buf;
+ int start;
+ int end;
+}
+RangeObject;
+
+#define RangeType_Check(obj) ((obj)->ob_type == &RangeType)
+
+static PyObject *RangeNew(buf_T *, int, int);
+
+static void RangeDestructor(PyObject *);
+static PyObject *RangeGetattr(PyObject *, char *);
+static PyObject *RangeRepr(PyObject *);
+
+static int RangeLength(PyObject *);
+static PyObject *RangeItem(PyObject *, int);
+static PyObject *RangeSlice(PyObject *, int, int);
+static int RangeAssItem(PyObject *, int, PyObject *);
+static int RangeAssSlice(PyObject *, int, int, PyObject *);
+
+static PyObject *RangeAppend(PyObject *, PyObject *);
+
+/* Window list type - Implementation functions
+ * -------------------------------------------
+ */
+
+static int WinListLength(PyObject *);
+static PyObject *WinListItem(PyObject *, int);
+
+/* Buffer list type - Implementation functions
+ * -------------------------------------------
+ */
+
+static int BufListLength(PyObject *);
+static PyObject *BufListItem(PyObject *, int);
+
+/* Current objects type - Implementation functions
+ * -----------------------------------------------
+ */
+
+static PyObject *CurrentGetattr(PyObject *, char *);
+static int CurrentSetattr(PyObject *, char *, PyObject *);
+
+/* Vim module - Definitions
+ */
+
+static struct PyMethodDef VimMethods[] = {
+ /* name, function, calling, documentation */
+ {"command", VimCommand, 1, "" },
+ {"eval", VimEval, 1, "" },
+ { NULL, NULL, 0, NULL }
+};
+
+/* Vim module - Implementation
+ */
+/*ARGSUSED*/
+ static PyObject *
+VimCommand(PyObject *self, PyObject *args)
+{
+ char *cmd;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args, "s", &cmd))
+ return NULL;
+
+ PyErr_Clear();
+
+ Py_BEGIN_ALLOW_THREADS
+ Python_Lock_Vim();
+
+ do_cmdline_cmd((char_u *)cmd);
+ update_screen(VALID);
+
+ Python_Release_Vim();
+ Py_END_ALLOW_THREADS
+
+ if (VimErrorCheck())
+ result = NULL;
+ else
+ result = Py_None;
+
+ Py_XINCREF(result);
+ return result;
+}
+
+/*ARGSUSED*/
+ static PyObject *
+VimEval(PyObject *self, PyObject *args)
+{
+#ifdef FEAT_EVAL
+ char *expr;
+ char *str;
+ PyObject *result;
+
+ if (!PyArg_ParseTuple(args, "s", &expr))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ Python_Lock_Vim();
+ str = (char *)eval_to_string((char_u *)expr, NULL);
+ Python_Release_Vim();
+ Py_END_ALLOW_THREADS
+
+ if (str == NULL)
+ {
+ PyErr_SetVim(_("invalid expression"));
+ return NULL;
+ }
+
+ result = Py_BuildValue("s", str);
+
+ Py_BEGIN_ALLOW_THREADS
+ Python_Lock_Vim();
+ vim_free(str);
+ Python_Release_Vim();
+ Py_END_ALLOW_THREADS
+
+ return result;
+#else
+ PyErr_SetVim(_("expressions disabled at compile time"));
+ return NULL;
+#endif
+}
+
+/* Common routines for buffers and line ranges
+ * -------------------------------------------
+ */
+ static int
+CheckBuffer(BufferObject *this)
+{
+ if (this->buf == INVALID_BUFFER_VALUE)
+ {
+ PyErr_SetVim(_("attempt to refer to deleted buffer"));
+ return -1;
+ }
+
+ return 0;
+}
+
+ static PyObject *
+RBItem(BufferObject *self, int n, int start, int end)
+{
+ if (CheckBuffer(self))
+ return NULL;
+
+ if (n < 0 || n > end - start)
+ {
+ PyErr_SetString(PyExc_IndexError, _("line number out of range"));
+ return NULL;
+ }
+
+ return GetBufferLine(self->buf, n+start);
+}
+
+ static PyObject *
+RBSlice(BufferObject *self, int lo, int hi, int start, int end)
+{
+ int size;
+
+ if (CheckBuffer(self))
+ return NULL;
+
+ size = end - start + 1;
+
+ if (lo < 0)
+ lo = 0;
+ else if (lo > size)
+ lo = size;
+ if (hi < 0)
+ hi = 0;
+ if (hi < lo)
+ hi = lo;
+ else if (hi > size)
+ hi = size;
+
+ return GetBufferLineList(self->buf, lo+start, hi+start);
+}
+
+ static int
+RBAssItem(BufferObject *self, int n, PyObject *val, int start, int end, int *new_end)
+{
+ int len_change;
+
+ if (CheckBuffer(self))
+ return -1;
+
+ if (n < 0 || n > end - start)
+ {
+ PyErr_SetString(PyExc_IndexError, _("line number out of range"));
+ return -1;
+ }
+
+ if (SetBufferLine(self->buf, n+start, val, &len_change) == FAIL)
+ return -1;
+
+ if (new_end)
+ *new_end = end + len_change;
+
+ return 0;
+}
+
+ static int
+RBAssSlice(BufferObject *self, int lo, int hi, PyObject *val, int start, int end, int *new_end)
+{
+ int size;
+ int len_change;
+
+ /* Self must be a valid buffer */
+ if (CheckBuffer(self))
+ return -1;
+
+ /* Sort out the slice range */
+ size = end - start + 1;
+
+ if (lo < 0)
+ lo = 0;
+ else if (lo > size)
+ lo = size;
+ if (hi < 0)
+ hi = 0;
+ if (hi < lo)
+ hi = lo;
+ else if (hi > size)
+ hi = size;
+
+ if (SetBufferLineList(self->buf, lo+start, hi+start, val, &len_change) == FAIL)
+ return -1;
+
+ if (new_end)
+ *new_end = end + len_change;
+
+ return 0;
+}
+
+ static PyObject *
+RBAppend(BufferObject *self, PyObject *args, int start, int end, int *new_end)
+{
+ PyObject *lines;
+ int len_change;
+ int max;
+ int n;
+
+ if (CheckBuffer(self))
+ return NULL;
+
+ max = n = end - start + 1;
+
+ if (!PyArg_ParseTuple(args, "O|i", &lines, &n))
+ return NULL;
+
+ if (n < 0 || n > max)
+ {
+ PyErr_SetString(PyExc_ValueError, _("line number out of range"));
+ return NULL;
+ }
+
+ if (InsertBufferLines(self->buf, n + start - 1, lines, &len_change) == FAIL)
+ return NULL;
+
+ if (new_end)
+ *new_end = end + len_change;
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+
+/* Buffer object - Definitions
+ */
+
+static struct PyMethodDef BufferMethods[] = {
+ /* name, function, calling, documentation */
+ {"append", BufferAppend, 1, "" },
+ {"mark", BufferMark, 1, "" },
+ {"range", BufferRange, 1, "" },
+ { NULL, NULL, 0, NULL }
+};
+
+static PySequenceMethods BufferAsSeq = {
+ (inquiry) BufferLength, /* sq_length, len(x) */
+ (binaryfunc) 0, /* BufferConcat, */ /* sq_concat, x+y */
+ (intargfunc) 0, /* BufferRepeat, */ /* sq_repeat, x*n */
+ (intargfunc) BufferItem, /* sq_item, x[i] */
+ (intintargfunc) BufferSlice, /* sq_slice, x[i:j] */
+ (intobjargproc) BufferAssItem, /* sq_ass_item, x[i]=v */
+ (intintobjargproc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */
+};
+
+static PyTypeObject BufferType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "buffer",
+ sizeof(BufferObject),
+ 0,
+
+ (destructor) BufferDestructor, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) BufferGetattr, /* tp_getattr, x.attr */
+ (setattrfunc) 0, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) BufferRepr, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ &BufferAsSeq, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Buffer object - Implementation
+ */
+
+ static PyObject *
+BufferNew(buf_T *buf)
+{
+ /* We need to handle deletion of buffers underneath us.
+ * If we add a "python_ref" field to the buf_T structure,
+ * then we can get at it in buf_freeall() in vim. We then
+ * need to create only ONE Python object per buffer - if
+ * we try to create a second, just INCREF the existing one
+ * and return it. The (single) Python object referring to
+ * the buffer is stored in "python_ref".
+ * Question: what to do on a buf_freeall(). We'll probably
+ * have to either delete the Python object (DECREF it to
+ * zero - a bad idea, as it leaves dangling refs!) or
+ * set the buf_T * value to an invalid value (-1?), which
+ * means we need checks in all access functions... Bah.
+ */
+
+ BufferObject *self;
+
+ if (buf->python_ref)
+ {
+ self = buf->python_ref;
+ Py_INCREF(self);
+ }
+ else
+ {
+ self = PyObject_NEW(BufferObject, &BufferType);
+ if (self == NULL)
+ return NULL;
+ self->buf = buf;
+ buf->python_ref = self;
+ }
+
+ return (PyObject *)(self);
+}
+
+ static void
+BufferDestructor(PyObject *self)
+{
+ BufferObject *this = (BufferObject *)(self);
+
+ if (this->buf && this->buf != INVALID_BUFFER_VALUE)
+ this->buf->python_ref = NULL;
+
+ PyMem_DEL(self);
+}
+
+ static PyObject *
+BufferGetattr(PyObject *self, char *name)
+{
+ BufferObject *this = (BufferObject *)(self);
+
+ if (CheckBuffer(this))
+ return NULL;
+
+ if (strcmp(name, "name") == 0)
+ return Py_BuildValue("s",this->buf->b_ffname);
+ else if (strcmp(name, "number") == 0)
+ return Py_BuildValue("i",this->buf->b_fnum);
+ else if (strcmp(name,"__members__") == 0)
+ return Py_BuildValue("[ss]", "name", "number");
+ else
+ return Py_FindMethod(BufferMethods, self, name);
+}
+
+ static PyObject *
+BufferRepr(PyObject *self)
+{
+ static char repr[50];
+ BufferObject *this = (BufferObject *)(self);
+
+ if (this->buf == INVALID_BUFFER_VALUE)
+ {
+ sprintf(repr, _("<buffer object (deleted) at %8lX>"), (long)(self));
+ return PyString_FromString(repr);
+ }
+ else
+ {
+ char *name = (char *)this->buf->b_fname;
+ int len;
+
+ if (name == NULL)
+ name = "";
+ len = strlen(name);
+
+ if (len > 35)
+ name = name + (35 - len);
+
+ sprintf(repr, "<buffer %s%s>", len > 35 ? "..." : "", name);
+
+ return PyString_FromString(repr);
+ }
+}
+
+/******************/
+
+ static int
+BufferLength(PyObject *self)
+{
+ /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
+ if (CheckBuffer((BufferObject *)(self)))
+ return -1; /* ??? */
+
+ return (((BufferObject *)(self))->buf->b_ml.ml_line_count);
+}
+
+ static PyObject *
+BufferItem(PyObject *self, int n)
+{
+ return RBItem((BufferObject *)(self), n, 1,
+ (int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
+}
+
+ static PyObject *
+BufferSlice(PyObject *self, int lo, int hi)
+{
+ return RBSlice((BufferObject *)(self), lo, hi, 1,
+ (int)((BufferObject *)(self))->buf->b_ml.ml_line_count);
+}
+
+ static int
+BufferAssItem(PyObject *self, int n, PyObject *val)
+{
+ return RBAssItem((BufferObject *)(self), n, val, 1,
+ (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+}
+
+ static int
+BufferAssSlice(PyObject *self, int lo, int hi, PyObject *val)
+{
+ return RBAssSlice((BufferObject *)(self), lo, hi, val, 1,
+ (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+}
+
+ static PyObject *
+BufferAppend(PyObject *self, PyObject *args)
+{
+ return RBAppend((BufferObject *)(self), args, 1,
+ (int)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+}
+
+ static PyObject *
+BufferMark(PyObject *self, PyObject *args)
+{
+ pos_T *posp;
+ char mark;
+ buf_T *curbuf_save;
+
+ if (CheckBuffer((BufferObject *)(self)))
+ return NULL;
+
+ if (!PyArg_ParseTuple(args, "c", &mark))
+ return NULL;
+
+ curbuf_save = curbuf;
+ curbuf = ((BufferObject *)(self))->buf;
+ posp = getmark(mark, FALSE);
+ curbuf = curbuf_save;
+
+ if (posp == NULL)
+ {
+ PyErr_SetVim(_("invalid mark name"));
+ return NULL;
+ }
+
+ /* Ckeck for keyboard interrupt */
+ if (VimErrorCheck())
+ return NULL;
+
+ if (posp->lnum <= 0)
+ {
+ /* Or raise an error? */
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ return Py_BuildValue("(ll)", (long)(posp->lnum), (long)(posp->col));
+}
+
+ static PyObject *
+BufferRange(PyObject *self, PyObject *args)
+{
+ int start;
+ int end;
+
+ if (CheckBuffer((BufferObject *)(self)))
+ return NULL;
+
+ if (!PyArg_ParseTuple(args, "ii", &start, &end))
+ return NULL;
+
+ return RangeNew(((BufferObject *)(self))->buf, start, end);
+}
+
+/* Line range object - Definitions
+ */
+
+static struct PyMethodDef RangeMethods[] = {
+ /* name, function, calling, documentation */
+ {"append", RangeAppend, 1, "" },
+ { NULL, NULL, 0, NULL }
+};
+
+static PySequenceMethods RangeAsSeq = {
+ (inquiry) RangeLength, /* sq_length, len(x) */
+ (binaryfunc) 0, /* RangeConcat, */ /* sq_concat, x+y */
+ (intargfunc) 0, /* RangeRepeat, */ /* sq_repeat, x*n */
+ (intargfunc) RangeItem, /* sq_item, x[i] */
+ (intintargfunc) RangeSlice, /* sq_slice, x[i:j] */
+ (intobjargproc) RangeAssItem, /* sq_ass_item, x[i]=v */
+ (intintobjargproc) RangeAssSlice, /* sq_ass_slice, x[i:j]=v */
+};
+
+static PyTypeObject RangeType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "range",
+ sizeof(RangeObject),
+ 0,
+
+ (destructor) RangeDestructor, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) RangeGetattr, /* tp_getattr, x.attr */
+ (setattrfunc) 0, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) RangeRepr, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ &RangeAsSeq, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Line range object - Implementation
+ */
+
+ static PyObject *
+RangeNew(buf_T *buf, int start, int end)
+{
+ BufferObject *bufr;
+ RangeObject *self;
+ self = PyObject_NEW(RangeObject, &RangeType);
+ if (self == NULL)
+ return NULL;
+
+ bufr = (BufferObject *)BufferNew(buf);
+ if (bufr == NULL)
+ {
+ PyMem_DEL(self);
+ return NULL;
+ }
+ Py_INCREF(bufr);
+
+ self->buf = bufr;
+ self->start = start;
+ self->end = end;
+
+ return (PyObject *)(self);
+}
+
+ static void
+RangeDestructor(PyObject *self)
+{
+ Py_DECREF(((RangeObject *)(self))->buf);
+ PyMem_DEL(self);
+}
+
+ static PyObject *
+RangeGetattr(PyObject *self, char *name)
+{
+ if (strcmp(name, "start") == 0)
+ return Py_BuildValue("i",((RangeObject *)(self))->start - 1);
+ else if (strcmp(name, "end") == 0)
+ return Py_BuildValue("i",((RangeObject *)(self))->end - 1);
+ else
+ return Py_FindMethod(RangeMethods, self, name);
+}
+
+ static PyObject *
+RangeRepr(PyObject *self)
+{
+ static char repr[75];
+ RangeObject *this = (RangeObject *)(self);
+
+ if (this->buf->buf == INVALID_BUFFER_VALUE)
+ {
+ sprintf(repr, "<range object (for deleted buffer) at %8lX>",
+ (long)(self));
+ return PyString_FromString(repr);
+ }
+ else
+ {
+ char *name = (char *)this->buf->buf->b_fname;
+ int len;
+
+ if (name == NULL)
+ name = "";
+ len = strlen(name);
+
+ if (len > 45)
+ name = name + (45 - len);
+
+ sprintf(repr, "<range %s%s (%d:%d)>",
+ len > 45 ? "..." : "", name,
+ this->start, this->end);
+
+ return PyString_FromString(repr);
+ }
+}
+
+/****************/
+
+ static int
+RangeLength(PyObject *self)
+{
+ /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */
+ if (CheckBuffer(((RangeObject *)(self))->buf))
+ return -1; /* ??? */
+
+ return (((RangeObject *)(self))->end - ((RangeObject *)(self))->start + 1);
+}
+
+ static PyObject *
+RangeItem(PyObject *self, int n)
+{
+ return RBItem(((RangeObject *)(self))->buf, n,
+ ((RangeObject *)(self))->start,
+ ((RangeObject *)(self))->end);
+}
+
+ static PyObject *
+RangeSlice(PyObject *self, int lo, int hi)
+{
+ return RBSlice(((RangeObject *)(self))->buf, lo, hi,
+ ((RangeObject *)(self))->start,
+ ((RangeObject *)(self))->end);
+}
+
+ static int
+RangeAssItem(PyObject *self, int n, PyObject *val)
+{
+ return RBAssItem(((RangeObject *)(self))->buf, n, val,
+ ((RangeObject *)(self))->start,
+ ((RangeObject *)(self))->end,
+ &((RangeObject *)(self))->end);
+}
+
+ static int
+RangeAssSlice(PyObject *self, int lo, int hi, PyObject *val)
+{
+ return RBAssSlice(((RangeObject *)(self))->buf, lo, hi, val,
+ ((RangeObject *)(self))->start,
+ ((RangeObject *)(self))->end,
+ &((RangeObject *)(self))->end);
+}
+
+ static PyObject *
+RangeAppend(PyObject *self, PyObject *args)
+{
+ return RBAppend(((RangeObject *)(self))->buf, args,
+ ((RangeObject *)(self))->start,
+ ((RangeObject *)(self))->end,
+ &((RangeObject *)(self))->end);
+}
+
+/* Buffer list object - Definitions
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+}
+BufListObject;
+
+static PySequenceMethods BufListAsSeq = {
+ (inquiry) BufListLength, /* sq_length, len(x) */
+ (binaryfunc) 0, /* sq_concat, x+y */
+ (intargfunc) 0, /* sq_repeat, x*n */
+ (intargfunc) BufListItem, /* sq_item, x[i] */
+ (intintargfunc) 0, /* sq_slice, x[i:j] */
+ (intobjargproc) 0, /* sq_ass_item, x[i]=v */
+ (intintobjargproc) 0, /* sq_ass_slice, x[i:j]=v */
+};
+
+static PyTypeObject BufListType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "buffer list",
+ sizeof(BufListObject),
+ 0,
+
+ (destructor) 0, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) 0, /* tp_getattr, x.attr */
+ (setattrfunc) 0, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) 0, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ &BufListAsSeq, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Buffer list object - Implementation
+ */
+
+/*ARGSUSED*/
+ static int
+BufListLength(PyObject *self)
+{
+ buf_T *b = firstbuf;
+ int n = 0;
+
+ while (b)
+ {
+ ++n;
+ b = b->b_next;
+ }
+
+ return n;
+}
+
+/*ARGSUSED*/
+ static PyObject *
+BufListItem(PyObject *self, int n)
+{
+ buf_T *b;
+
+ for (b = firstbuf; b; b = b->b_next, --n)
+ {
+ if (n == 0)
+ return BufferNew(b);
+ }
+
+ PyErr_SetString(PyExc_IndexError, _("no such buffer"));
+ return NULL;
+}
+
+/* Window object - Definitions
+ */
+
+static struct PyMethodDef WindowMethods[] = {
+ /* name, function, calling, documentation */
+ { NULL, NULL, 0, NULL }
+};
+
+static PyTypeObject WindowType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "window",
+ sizeof(WindowObject),
+ 0,
+
+ (destructor) WindowDestructor, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) WindowGetattr, /* tp_getattr, x.attr */
+ (setattrfunc) WindowSetattr, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) WindowRepr, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ 0, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Window object - Implementation
+ */
+
+ static PyObject *
+WindowNew(win_T *win)
+{
+ /* We need to handle deletion of windows underneath us.
+ * If we add a "python_ref" field to the win_T structure,
+ * then we can get at it in win_free() in vim. We then
+ * need to create only ONE Python object per window - if
+ * we try to create a second, just INCREF the existing one
+ * and return it. The (single) Python object referring to
+ * the window is stored in "python_ref".
+ * On a win_free() we set the Python object's win_T* field
+ * to an invalid value. We trap all uses of a window
+ * object, and reject them if the win_T* field is invalid.
+ */
+
+ WindowObject *self;
+
+ if (win->python_ref)
+ {
+ self = win->python_ref;
+ Py_INCREF(self);
+ }
+ else
+ {
+ self = PyObject_NEW(WindowObject, &WindowType);
+ if (self == NULL)
+ return NULL;
+ self->win = win;
+ win->python_ref = self;
+ }
+
+ return (PyObject *)(self);
+}
+
+ static void
+WindowDestructor(PyObject *self)
+{
+ WindowObject *this = (WindowObject *)(self);
+
+ if (this->win && this->win != INVALID_WINDOW_VALUE)
+ this->win->python_ref = NULL;
+
+ PyMem_DEL(self);
+}
+
+ static int
+CheckWindow(WindowObject *this)
+{
+ if (this->win == INVALID_WINDOW_VALUE)
+ {
+ PyErr_SetVim(_("attempt to refer to deleted window"));
+ return -1;
+ }
+
+ return 0;
+}
+
+ static PyObject *
+WindowGetattr(PyObject *self, char *name)
+{
+ WindowObject *this = (WindowObject *)(self);
+
+ if (CheckWindow(this))
+ return NULL;
+
+ if (strcmp(name, "buffer") == 0)
+ return (PyObject *)BufferNew(this->win->w_buffer);
+ else if (strcmp(name, "cursor") == 0)
+ {
+ pos_T *pos = &this->win->w_cursor;
+
+ return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col));
+ }
+ else if (strcmp(name, "height") == 0)
+ return Py_BuildValue("l", (long)(this->win->w_height));
+#ifdef FEAT_VERTSPLIT
+ else if (strcmp(name, "width") == 0)
+ return Py_BuildValue("l", (long)(W_WIDTH(this->win)));
+#endif
+ else if (strcmp(name,"__members__") == 0)
+ return Py_BuildValue("[sss]", "buffer", "cursor", "height");
+ else
+ return Py_FindMethod(WindowMethods, self, name);
+}
+
+ static int
+WindowSetattr(PyObject *self, char *name, PyObject *val)
+{
+ WindowObject *this = (WindowObject *)(self);
+
+ if (CheckWindow(this))
+ return -1;
+
+ if (strcmp(name, "buffer") == 0)
+ {
+ PyErr_SetString(PyExc_TypeError, _("readonly attribute"));
+ return -1;
+ }
+ else if (strcmp(name, "cursor") == 0)
+ {
+ long lnum;
+ long col;
+
+ if (!PyArg_Parse(val, "(ll)", &lnum, &col))
+ return -1;
+
+ if (lnum <= 0 || lnum > this->win->w_buffer->b_ml.ml_line_count)
+ {
+ PyErr_SetVim(_("cursor position outside buffer"));
+ return -1;
+ }
+
+ /* Check for keyboard interrupts */
+ if (VimErrorCheck())
+ return -1;
+
+ /* NO CHECK ON COLUMN - SEEMS NOT TO MATTER */
+
+ this->win->w_cursor.lnum = lnum;
+ this->win->w_cursor.col = col;
+ update_screen(VALID);
+
+ return 0;
+ }
+ else if (strcmp(name, "height") == 0)
+ {
+ int height;
+ win_T *savewin;
+
+ if (!PyArg_Parse(val, "i", &height))
+ return -1;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ savewin = curwin;
+ curwin = this->win;
+ win_setheight(height);
+ curwin = savewin;
+
+ /* Check for keyboard interrupts */
+ if (VimErrorCheck())
+ return -1;
+
+ return 0;
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (strcmp(name, "width") == 0)
+ {
+ int width;
+ win_T *savewin;
+
+ if (!PyArg_Parse(val, "i", &width))
+ return -1;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ savewin = curwin;
+ curwin = this->win;
+ win_setwidth(width);
+ curwin = savewin;
+
+ /* Check for keyboard interrupts */
+ if (VimErrorCheck())
+ return -1;
+
+ return 0;
+ }
+#endif
+ else
+ {
+ PyErr_SetString(PyExc_AttributeError, name);
+ return -1;
+ }
+}
+
+ static PyObject *
+WindowRepr(PyObject *self)
+{
+ static char repr[50];
+ WindowObject *this = (WindowObject *)(self);
+
+ if (this->win == INVALID_WINDOW_VALUE)
+ {
+ sprintf(repr, _("<window object (deleted) at %.8lX>"), (long)(self));
+ return PyString_FromString(repr);
+ }
+ else
+ {
+ int i = 0;
+ win_T *w;
+
+ for (w = firstwin; w != NULL && w != this->win; w = W_NEXT(w))
+ ++i;
+
+ if (w == NULL)
+ sprintf(repr, _("<window object (unknown) at %.8lX>"), (long)(self));
+ else
+ sprintf(repr, _("<window %d>"), i);
+
+ return PyString_FromString(repr);
+ }
+}
+
+/* Window list object - Definitions
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+}
+WinListObject;
+
+static PySequenceMethods WinListAsSeq = {
+ (inquiry) WinListLength, /* sq_length, len(x) */
+ (binaryfunc) 0, /* sq_concat, x+y */
+ (intargfunc) 0, /* sq_repeat, x*n */
+ (intargfunc) WinListItem, /* sq_item, x[i] */
+ (intintargfunc) 0, /* sq_slice, x[i:j] */
+ (intobjargproc) 0, /* sq_ass_item, x[i]=v */
+ (intintobjargproc) 0, /* sq_ass_slice, x[i:j]=v */
+};
+
+static PyTypeObject WinListType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "window list",
+ sizeof(WinListObject),
+ 0,
+
+ (destructor) 0, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) 0, /* tp_getattr, x.attr */
+ (setattrfunc) 0, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) 0, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ &WinListAsSeq, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Window list object - Implementation
+ */
+/*ARGSUSED*/
+ static int
+WinListLength(PyObject *self)
+{
+ win_T *w = firstwin;
+ int n = 0;
+
+ while (w)
+ {
+ ++n;
+ w = W_NEXT(w);
+ }
+
+ return n;
+}
+
+/*ARGSUSED*/
+ static PyObject *
+WinListItem(PyObject *self, int n)
+{
+ win_T *w;
+
+ for (w = firstwin; w; w = W_NEXT(w), --n)
+ if (n == 0)
+ return WindowNew(w);
+
+ PyErr_SetString(PyExc_IndexError, _("no such window"));
+ return NULL;
+}
+
+/* Current items object - Definitions
+ */
+
+typedef struct
+{
+ PyObject_HEAD
+}
+CurrentObject;
+
+static PyTypeObject CurrentType = {
+ PyObject_HEAD_INIT(0)
+ 0,
+ "current data",
+ sizeof(CurrentObject),
+ 0,
+
+ (destructor) 0, /* tp_dealloc, refcount==0 */
+ (printfunc) 0, /* tp_print, print x */
+ (getattrfunc) CurrentGetattr, /* tp_getattr, x.attr */
+ (setattrfunc) CurrentSetattr, /* tp_setattr, x.attr=v */
+ (cmpfunc) 0, /* tp_compare, x>y */
+ (reprfunc) 0, /* tp_repr, `x`, print x */
+
+ 0, /* as number */
+ 0, /* as sequence */
+ 0, /* as mapping */
+
+ (hashfunc) 0, /* tp_hash, dict(x) */
+ (ternaryfunc) 0, /* tp_call, x() */
+ (reprfunc) 0, /* tp_str, str(x) */
+};
+
+/* Current items object - Implementation
+ */
+/*ARGSUSED*/
+ static PyObject *
+CurrentGetattr(PyObject *self, char *name)
+{
+ if (strcmp(name, "buffer") == 0)
+ return (PyObject *)BufferNew(curbuf);
+ else if (strcmp(name, "window") == 0)
+ return (PyObject *)WindowNew(curwin);
+ else if (strcmp(name, "line") == 0)
+ return GetBufferLine(curbuf, (int)curwin->w_cursor.lnum);
+ else if (strcmp(name, "range") == 0)
+ return RangeNew(curbuf, RangeStart, RangeEnd);
+ else if (strcmp(name,"__members__") == 0)
+ return Py_BuildValue("[ssss]", "buffer", "window", "line", "range");
+ else
+ {
+ PyErr_SetString(PyExc_AttributeError, name);
+ return NULL;
+ }
+}
+
+/*ARGSUSED*/
+ static int
+CurrentSetattr(PyObject *self, char *name, PyObject *value)
+{
+ if (strcmp(name, "line") == 0)
+ {
+ if (SetBufferLine(curbuf, (int)curwin->w_cursor.lnum, value, NULL) == FAIL)
+ return -1;
+
+ return 0;
+ }
+ else
+ {
+ PyErr_SetString(PyExc_AttributeError, name);
+ return -1;
+ }
+}
+
+/* External interface
+ */
+
+ void
+python_buffer_free(buf_T *buf)
+{
+ if (buf->python_ref)
+ {
+ BufferObject *bp = buf->python_ref;
+ bp->buf = INVALID_BUFFER_VALUE;
+ buf->python_ref = NULL;
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+python_window_free(win_T *win)
+{
+ if (win->python_ref)
+ {
+ WindowObject *wp = win->python_ref;
+ wp->win = INVALID_WINDOW_VALUE;
+ win->python_ref = NULL;
+ }
+}
+#endif
+
+static BufListObject TheBufferList =
+{
+ PyObject_HEAD_INIT(&BufListType)
+};
+
+static WinListObject TheWindowList =
+{
+ PyObject_HEAD_INIT(&WinListType)
+};
+
+static CurrentObject TheCurrent =
+{
+ PyObject_HEAD_INIT(&CurrentType)
+};
+
+ static int
+PythonMod_Init(void)
+{
+ PyObject *mod;
+ PyObject *dict;
+ static char *(argv[2]) = {"", NULL};
+
+ /* Fixups... */
+ BufferType.ob_type = &PyType_Type;
+ RangeType.ob_type = &PyType_Type;
+ WindowType.ob_type = &PyType_Type;
+ BufListType.ob_type = &PyType_Type;
+ WinListType.ob_type = &PyType_Type;
+ CurrentType.ob_type = &PyType_Type;
+
+ /* Set sys.argv[] to avoid a crash in warn(). */
+ PySys_SetArgv(1, argv);
+
+ mod = Py_InitModule("vim", VimMethods);
+ dict = PyModule_GetDict(mod);
+
+ VimError = Py_BuildValue("s", "vim.error");
+
+ PyDict_SetItemString(dict, "error", VimError);
+ PyDict_SetItemString(dict, "buffers", (PyObject *)(&TheBufferList));
+ PyDict_SetItemString(dict, "current", (PyObject *)(&TheCurrent));
+ PyDict_SetItemString(dict, "windows", (PyObject *)(&TheWindowList));
+
+ if (PyErr_Occurred())
+ return -1;
+
+ return 0;
+}
+
+/*************************************************************************
+ * 4. Utility functions for handling the interface between Vim and Python.
+ */
+
+/* Get a line from the specified buffer. The line number is
+ * in Vim format (1-based). The line is returned as a Python
+ * string object.
+ */
+ static PyObject *
+GetBufferLine(buf_T *buf, int n)
+{
+ return LineToString((char *)ml_get_buf(buf, (linenr_T)n, FALSE));
+}
+
+/* Get a list of lines from the specified buffer. The line numbers
+ * are in Vim format (1-based). The range is from lo up to, but not
+ * including, hi. The list is returned as a Python list of string objects.
+ */
+ static PyObject *
+GetBufferLineList(buf_T *buf, int lo, int hi)
+{
+ int i;
+ int n = hi - lo;
+ PyObject *list = PyList_New(n);
+
+ if (list == NULL)
+ return NULL;
+
+ for (i = 0; i < n; ++i)
+ {
+ PyObject *str = LineToString((char *)ml_get_buf(buf, (linenr_T)(lo+i), FALSE));
+
+ /* Error check - was the Python string creation OK? */
+ if (str == NULL)
+ {
+ Py_DECREF(list);
+ return NULL;
+ }
+
+ /* Set the list item */
+ if (PyList_SetItem(list, i, str))
+ {
+ Py_DECREF(str);
+ Py_DECREF(list);
+ return NULL;
+ }
+ }
+
+ /* The ownership of the Python list is passed to the caller (ie,
+ * the caller should Py_DECREF() the object when it is finished
+ * with it).
+ */
+
+ return list;
+}
+
+/*
+ * Check if deleting lines made the cursor position invalid.
+ * Changed the lines from "lo" to "hi" and added "extra" lines (negative if
+ * deleted).
+ */
+ static void
+py_fix_cursor(int lo, int hi, int extra)
+{
+ if (curwin->w_cursor.lnum >= lo)
+ {
+ /* Adjust the cursor position if it's in/after the changed
+ * lines. */
+ if (curwin->w_cursor.lnum >= hi)
+ {
+ curwin->w_cursor.lnum += extra;
+ check_cursor_col();
+ }
+ else if (extra < 0)
+ {
+ curwin->w_cursor.lnum = lo;
+ check_cursor();
+ }
+ changed_cline_bef_curs();
+ }
+ invalidate_botline();
+}
+
+/* Replace a line in the specified buffer. The line number is
+ * in Vim format (1-based). The replacement line is given as
+ * a Python string object. The object is checked for validity
+ * and correct format. Errors are returned as a value of FAIL.
+ * The return value is OK on success.
+ * If OK is returned and len_change is not NULL, *len_change
+ * is set to the change in the buffer length.
+ */
+ static int
+SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change)
+{
+ /* First of all, we check the thpe of the supplied Python object.
+ * There are three cases:
+ * 1. NULL, or None - this is a deletion.
+ * 2. A string - this is a replacement.
+ * 3. Anything else - this is an error.
+ */
+ if (line == Py_None || line == NULL)
+ {
+ buf_T *savebuf = curbuf;
+
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_savedel((linenr_T)n, 1L) == FAIL)
+ PyErr_SetVim(_("cannot save undo information"));
+ else if (ml_delete((linenr_T)n, FALSE) == FAIL)
+ PyErr_SetVim(_("cannot delete line"));
+ else
+ {
+ deleted_lines_mark((linenr_T)n, 1L);
+ if (buf == curwin->w_buffer)
+ py_fix_cursor(n, n + 1, -1);
+ }
+
+ curbuf = savebuf;
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = -1;
+
+ return OK;
+ }
+ else if (PyString_Check(line))
+ {
+ char *save = StringToLine(line);
+ buf_T *savebuf = curbuf;
+
+ if (save == NULL)
+ return FAIL;
+
+ /* We do not need to free "save" if ml_replace() consumes it. */
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_savesub((linenr_T)n) == FAIL)
+ {
+ PyErr_SetVim(_("cannot save undo information"));
+ vim_free(save);
+ }
+ else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL)
+ {
+ PyErr_SetVim(_("cannot replace line"));
+ vim_free(save);
+ }
+ else
+ changed_bytes((linenr_T)n, 0);
+
+ curbuf = savebuf;
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = 0;
+
+ return OK;
+ }
+ else
+ {
+ PyErr_BadArgument();
+ return FAIL;
+ }
+}
+
+/* Replace a range of lines in the specified buffer. The line numbers are in
+ * Vim format (1-based). The range is from lo up to, but not including, hi.
+ * The replacement lines are given as a Python list of string objects. The
+ * list is checked for validity and correct format. Errors are returned as a
+ * value of FAIL. The return value is OK on success.
+ * If OK is returned and len_change is not NULL, *len_change
+ * is set to the change in the buffer length.
+ */
+ static int
+SetBufferLineList(buf_T *buf, int lo, int hi, PyObject *list, int *len_change)
+{
+ /* First of all, we check the thpe of the supplied Python object.
+ * There are three cases:
+ * 1. NULL, or None - this is a deletion.
+ * 2. A list - this is a replacement.
+ * 3. Anything else - this is an error.
+ */
+ if (list == Py_None || list == NULL)
+ {
+ int i;
+ int n = hi - lo;
+ buf_T *savebuf = curbuf;
+
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_savedel((linenr_T)lo, (long)n) == FAIL)
+ PyErr_SetVim(_("cannot save undo information"));
+ else
+ {
+ for (i = 0; i < n; ++i)
+ {
+ if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ {
+ PyErr_SetVim(_("cannot delete line"));
+ break;
+ }
+ }
+ deleted_lines_mark((linenr_T)lo, (long)i);
+
+ if (buf == curwin->w_buffer)
+ py_fix_cursor(lo, hi, -n);
+ }
+
+ curbuf = savebuf;
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = -n;
+
+ return OK;
+ }
+ else if (PyList_Check(list))
+ {
+ int i;
+ int new_len = PyList_Size(list);
+ int old_len = hi - lo;
+ int extra = 0; /* lines added to text, can be negative */
+ char **array;
+ buf_T *savebuf;
+
+ if (new_len == 0) /* avoid allocating zero bytes */
+ array = NULL;
+ else
+ {
+ array = (char **)alloc((unsigned)(new_len * sizeof(char *)));
+ if (array == NULL)
+ {
+ PyErr_NoMemory();
+ return FAIL;
+ }
+ }
+
+ for (i = 0; i < new_len; ++i)
+ {
+ PyObject *line = PyList_GetItem(list, i);
+
+ array[i] = StringToLine(line);
+ if (array[i] == NULL)
+ {
+ while (i)
+ vim_free(array[--i]);
+ vim_free(array);
+ return FAIL;
+ }
+ }
+
+ savebuf = curbuf;
+
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
+ PyErr_SetVim(_("cannot save undo information"));
+
+ /* If the size of the range is reducing (ie, new_len < old_len) we
+ * need to delete some old_len. We do this at the start, by
+ * repeatedly deleting line "lo".
+ */
+ if (!PyErr_Occurred())
+ {
+ for (i = 0; i < old_len - new_len; ++i)
+ if (ml_delete((linenr_T)lo, FALSE) == FAIL)
+ {
+ PyErr_SetVim(_("cannot delete line"));
+ break;
+ }
+ extra -= i;
+ }
+
+ /* For as long as possible, replace the existing old_len with the
+ * new old_len. This is a more efficient operation, as it requires
+ * less memory allocation and freeing.
+ */
+ if (!PyErr_Occurred())
+ {
+ for (i = 0; i < old_len && i < new_len; ++i)
+ if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE)
+ == FAIL)
+ {
+ PyErr_SetVim(_("cannot replace line"));
+ break;
+ }
+ }
+ else
+ i = 0;
+
+ /* Now we may need to insert the remaining new old_len. If we do, we
+ * must free the strings as we finish with them (we can't pass the
+ * responsibility to vim in this case).
+ */
+ if (!PyErr_Occurred())
+ {
+ while (i < new_len)
+ {
+ if (ml_append((linenr_T)(lo + i - 1),
+ (char_u *)array[i], 0, FALSE) == FAIL)
+ {
+ PyErr_SetVim(_("cannot insert line"));
+ break;
+ }
+ vim_free(array[i]);
+ ++i;
+ ++extra;
+ }
+ }
+
+ /* Free any left-over old_len, as a result of an error */
+ while (i < new_len)
+ {
+ vim_free(array[i]);
+ ++i;
+ }
+
+ /* Free the array of old_len. All of its contents have now
+ * been dealt with (either freed, or the responsibility passed
+ * to vim.
+ */
+ vim_free(array);
+
+ /* Adjust marks. Invalidate any which lie in the
+ * changed range, and move any in the remainder of the buffer.
+ */
+ mark_adjust((linenr_T)lo, (linenr_T)(hi - 1),
+ (long)MAXLNUM, (long)extra);
+ changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
+
+ if (buf == curwin->w_buffer)
+ py_fix_cursor(lo, hi, extra);
+
+ curbuf = savebuf;
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = new_len - old_len;
+
+ return OK;
+ }
+ else
+ {
+ PyErr_BadArgument();
+ return FAIL;
+ }
+}
+
+/* Insert a number of lines into the specified buffer after the specifed line.
+ * The line number is in Vim format (1-based). The lines to be inserted are
+ * given as a Python list of string objects or as a single string. The lines
+ * to be added are checked for validity and correct format. Errors are
+ * returned as a value of FAIL. The return value is OK on success.
+ * If OK is returned and len_change is not NULL, *len_change
+ * is set to the change in the buffer length.
+ */
+ static int
+InsertBufferLines(buf_T *buf, int n, PyObject *lines, int *len_change)
+{
+ /* First of all, we check the type of the supplied Python object.
+ * It must be a string or a list, or the call is in error.
+ */
+ if (PyString_Check(lines))
+ {
+ char *str = StringToLine(lines);
+ buf_T *savebuf;
+
+ if (str == NULL)
+ return FAIL;
+
+ savebuf = curbuf;
+
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
+ PyErr_SetVim(_("cannot save undo information"));
+ else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
+ PyErr_SetVim(_("cannot insert line"));
+ else
+ appended_lines_mark((linenr_T)n, 1L);
+
+ vim_free(str);
+ curbuf = savebuf;
+ update_screen(VALID);
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = 1;
+
+ return OK;
+ }
+ else if (PyList_Check(lines))
+ {
+ int i;
+ int size = PyList_Size(lines);
+ char **array;
+ buf_T *savebuf;
+
+ array = (char **)alloc((unsigned)(size * sizeof(char *)));
+ if (array == NULL)
+ {
+ PyErr_NoMemory();
+ return FAIL;
+ }
+
+ for (i = 0; i < size; ++i)
+ {
+ PyObject *line = PyList_GetItem(lines, i);
+ array[i] = StringToLine(line);
+
+ if (array[i] == NULL)
+ {
+ while (i)
+ vim_free(array[--i]);
+ vim_free(array);
+ return FAIL;
+ }
+ }
+
+ savebuf = curbuf;
+
+ PyErr_Clear();
+ curbuf = buf;
+
+ if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
+ PyErr_SetVim(_("cannot save undo information"));
+ else
+ {
+ for (i = 0; i < size; ++i)
+ {
+ if (ml_append((linenr_T)(n + i),
+ (char_u *)array[i], 0, FALSE) == FAIL)
+ {
+ PyErr_SetVim(_("cannot insert line"));
+
+ /* Free the rest of the lines */
+ while (i < size)
+ vim_free(array[i++]);
+
+ break;
+ }
+ vim_free(array[i]);
+ }
+ if (i > 0)
+ appended_lines_mark((linenr_T)n, (long)i);
+ }
+
+ /* Free the array of lines. All of its contents have now
+ * been freed.
+ */
+ vim_free(array);
+
+ curbuf = savebuf;
+ update_screen(VALID);
+
+ if (PyErr_Occurred() || VimErrorCheck())
+ return FAIL;
+
+ if (len_change)
+ *len_change = size;
+
+ return OK;
+ }
+ else
+ {
+ PyErr_BadArgument();
+ return FAIL;
+ }
+}
+
+/* Convert a Vim line into a Python string.
+ * All internal newlines are replaced by null characters.
+ *
+ * On errors, the Python exception data is set, and NULL is returned.
+ */
+ static PyObject *
+LineToString(const char *str)
+{
+ PyObject *result;
+ int len = strlen(str);
+ char *p;
+
+ /* Allocate an Python string object, with uninitialised contents. We
+ * must do it this way, so that we can modify the string in place
+ * later. See the Python source, Objects/stringobject.c for details.
+ */
+ result = PyString_FromStringAndSize(NULL, len);
+ if (result == NULL)
+ return NULL;
+
+ p = PyString_AsString(result);
+
+ while (*str)
+ {
+ if (*str == '\n')
+ *p = '\0';
+ else
+ *p = *str;
+
+ ++p;
+ ++str;
+ }
+
+ return result;
+}
+
+/* Convert a Python string into a Vim line.
+ *
+ * The result is in allocated memory. All internal nulls are replaced by
+ * newline characters. It is an error for the string to contain newline
+ * characters.
+ *
+ * On errors, the Python exception data is set, and NULL is returned.
+ */
+ static char *
+StringToLine(PyObject *obj)
+{
+ const char *str;
+ char *save;
+ int len;
+ int i;
+
+ if (obj == NULL || !PyString_Check(obj))
+ {
+ PyErr_BadArgument();
+ return NULL;
+ }
+
+ str = PyString_AsString(obj);
+ len = PyString_Size(obj);
+
+ /* Error checking: String must not contain newlines, as we
+ * are replacing a single line, and we must replace it with
+ * a single line.
+ */
+ if (memchr(str, '\n', len))
+ {
+ PyErr_SetVim(_("string cannot contain newlines"));
+ return NULL;
+ }
+
+ /* Create a copy of the string, with internal nulls replaced by
+ * newline characters, as is the vim convention.
+ */
+ save = (char *)alloc((unsigned)(len+1));
+ if (save == NULL)
+ {
+ PyErr_NoMemory();
+ return NULL;
+ }
+
+ for (i = 0; i < len; ++i)
+ {
+ if (str[i] == '\0')
+ save[i] = '\n';
+ else
+ save[i] = str[i];
+ }
+
+ save[i] = '\0';
+
+ return save;
+}
+
+/* Check to see whether a Vim error has been reported, or a keyboard
+ * interrupt has been detected.
+ */
+ static int
+VimErrorCheck(void)
+{
+ if (got_int)
+ {
+ PyErr_SetNone(PyExc_KeyboardInterrupt);
+ return 1;
+ }
+ else if (did_emsg && !PyErr_Occurred())
+ {
+ PyErr_SetNone(VimError);
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/* Don't generate a prototype for the next function, it generates an error on
+ * newer Python versions. */
+#if PYTHON_API_VERSION < 1007 /* Python 1.4 */ && !defined(PROTO)
+
+ char *
+Py_GetProgramName(void)
+{
+ return "vim";
+}
+#endif /* Python 1.4 */
diff --git a/src/if_ruby.c b/src/if_ruby.c
new file mode 100644
index 000000000..9ef504cff
--- /dev/null
+++ b/src/if_ruby.c
@@ -0,0 +1,868 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Ruby interface by Shugo Maeda.
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef _WIN32
+# if !defined(DYNAMIC_RUBY_VER) || (DYNAMIC_RUBY_VER < 18)
+# define NT
+# endif
+# ifndef DYNAMIC_RUBY
+# define IMPORT /* For static dll usage __declspec(dllimport) */
+# define RUBYEXTERN __declspec(dllimport)
+# endif
+#endif
+#ifndef RUBYEXTERN
+# define RUBYEXTERN extern
+#endif
+
+/*
+ * This is tricky. In ruby.h there is (inline) function rb_class_of()
+ * definition. This function use these variables. But we want function to
+ * use dll_* variables.
+ */
+#ifdef DYNAMIC_RUBY
+# define rb_cFalseClass (*dll_rb_cFalseClass)
+# define rb_cFixnum (*dll_rb_cFixnum)
+# define rb_cNilClass (*dll_rb_cNilClass)
+# define rb_cSymbol (*dll_rb_cSymbol)
+# define rb_cTrueClass (*dll_rb_cTrueClass)
+# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
+/*
+ * On ver 1.8, all Ruby functions are exported with "__declspce(dllimport)"
+ * in ruby.h. But it cause trouble for these variables, because it is
+ * defined in this file. When defined this RUBY_EXPORT it modified to
+ * "extern" and be able to avoid this problem.
+ */
+# define RUBY_EXPORT
+# endif
+#endif
+
+#include <ruby.h>
+
+#undef EXTERN
+#undef _
+
+/* T_DATA defined both by Ruby and Mac header files, hack around it... */
+#ifdef FEAT_GUI_MAC
+# define __OPENTRANSPORT__
+# define __OPENTRANSPORTPROTOCOL__
+# define __OPENTRANSPORTPROVIDERS__
+#endif
+
+#include "vim.h"
+#include "version.h"
+
+#if defined(PROTO) && !defined(FEAT_RUBY)
+/* Define these to be able to generate the function prototypes. */
+# define VALUE int
+# define RUBY_DATA_FUNC int
+#endif
+
+static int ruby_initialized = 0;
+static VALUE objtbl;
+
+static VALUE mVIM;
+static VALUE cBuffer;
+static VALUE cVimWindow;
+static VALUE eDeletedBufferError;
+static VALUE eDeletedWindowError;
+
+static int ensure_ruby_initialized(void);
+static void error_print(int);
+static void ruby_io_init(void);
+static void ruby_vim_init(void);
+
+#if defined(DYNAMIC_RUBY) || defined(PROTO)
+#ifdef PROTO
+# define HINSTANCE int /* for generating prototypes */
+#endif
+
+/*
+ * Wrapper defines
+ */
+#define rb_assoc_new dll_rb_assoc_new
+#define rb_cObject (*dll_rb_cObject)
+#define rb_check_type dll_rb_check_type
+#define rb_class_path dll_rb_class_path
+#define rb_data_object_alloc dll_rb_data_object_alloc
+#define rb_define_class_under dll_rb_define_class_under
+#define rb_define_const dll_rb_define_const
+#define rb_define_global_function dll_rb_define_global_function
+#define rb_define_method dll_rb_define_method
+#define rb_define_module dll_rb_define_module
+#define rb_define_module_function dll_rb_define_module_function
+#define rb_define_singleton_method dll_rb_define_singleton_method
+#define rb_define_virtual_variable dll_rb_define_virtual_variable
+#define rb_stdout (*dll_rb_stdout)
+#define rb_eArgError (*dll_rb_eArgError)
+#define rb_eIndexError (*dll_rb_eIndexError)
+#define rb_eRuntimeError (*dll_rb_eRuntimeError)
+#define rb_eStandardError (*dll_rb_eStandardError)
+#define rb_eval_string_protect dll_rb_eval_string_protect
+#define rb_global_variable dll_rb_global_variable
+#define rb_hash_aset dll_rb_hash_aset
+#define rb_hash_new dll_rb_hash_new
+#define rb_inspect dll_rb_inspect
+#define rb_int2inum dll_rb_int2inum
+#define rb_lastline_get dll_rb_lastline_get
+#define rb_lastline_set dll_rb_lastline_set
+#define rb_load_protect dll_rb_load_protect
+#define rb_num2long dll_rb_num2long
+#define rb_num2ulong dll_rb_num2ulong
+#define rb_obj_alloc dll_rb_obj_alloc
+#define rb_obj_as_string dll_rb_obj_as_string
+#define rb_obj_id dll_rb_obj_id
+#define rb_raise dll_rb_raise
+#define rb_str2cstr dll_rb_str2cstr
+#define rb_str_cat dll_rb_str_cat
+#define rb_str_concat dll_rb_str_concat
+#define rb_str_new dll_rb_str_new
+#define rb_str_new2 dll_rb_str_new2
+#define ruby_errinfo (*dll_ruby_errinfo)
+#define ruby_init dll_ruby_init
+#define ruby_init_loadpath dll_ruby_init_loadpath
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
+# define rb_w32_snprintf dll_rb_w32_snprintf
+#endif
+
+/*
+ * Pointers for dynamic link
+ */
+static VALUE (*dll_rb_assoc_new) (VALUE, VALUE);
+static VALUE *dll_rb_cFalseClass;
+static VALUE *dll_rb_cFixnum;
+static VALUE *dll_rb_cNilClass;
+static VALUE *dll_rb_cObject;
+static VALUE *dll_rb_cSymbol;
+static VALUE *dll_rb_cTrueClass;
+static void (*dll_rb_check_type) (VALUE,int);
+static VALUE (*dll_rb_class_path) (VALUE);
+static VALUE (*dll_rb_data_object_alloc) (VALUE, void*, RUBY_DATA_FUNC, RUBY_DATA_FUNC);
+static VALUE (*dll_rb_define_class_under) (VALUE, const char*, VALUE);
+static void (*dll_rb_define_const) (VALUE,const char*,VALUE);
+static void (*dll_rb_define_global_function) (const char*,VALUE(*)(),int);
+static void (*dll_rb_define_method) (VALUE,const char*,VALUE(*)(),int);
+static VALUE (*dll_rb_define_module) (const char*);
+static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int);
+static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int);
+static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)());
+static VALUE *dll_rb_stdout;
+static VALUE *dll_rb_eArgError;
+static VALUE *dll_rb_eIndexError;
+static VALUE *dll_rb_eRuntimeError;
+static VALUE *dll_rb_eStandardError;
+static VALUE (*dll_rb_eval_string_protect) (const char*, int*);
+static void (*dll_rb_global_variable) (VALUE*);
+static VALUE (*dll_rb_hash_aset) (VALUE, VALUE, VALUE);
+static VALUE (*dll_rb_hash_new) (void);
+static VALUE (*dll_rb_inspect) (VALUE);
+static VALUE (*dll_rb_int2inum) (long);
+static VALUE (*dll_rb_int2inum) (long);
+static VALUE (*dll_rb_lastline_get) (void);
+static void (*dll_rb_lastline_set) (VALUE);
+static void (*dll_rb_load_protect) (VALUE, int, int*);
+static long (*dll_rb_num2long) (VALUE);
+static unsigned long (*dll_rb_num2ulong) (VALUE);
+static VALUE (*dll_rb_obj_alloc) (VALUE);
+static VALUE (*dll_rb_obj_as_string) (VALUE);
+static VALUE (*dll_rb_obj_id) (VALUE);
+static void (*dll_rb_raise) (VALUE, const char*, ...);
+static char *(*dll_rb_str2cstr) (VALUE,int*);
+static VALUE (*dll_rb_str_cat) (VALUE, const char*, long);
+static VALUE (*dll_rb_str_concat) (VALUE, VALUE);
+static VALUE (*dll_rb_str_new) (const char*, long);
+static VALUE (*dll_rb_str_new2) (const char*);
+static VALUE *dll_ruby_errinfo;
+static void (*dll_ruby_init) (void);
+static void (*dll_ruby_init_loadpath) (void);
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
+static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
+#endif
+
+static HINSTANCE hinstRuby = 0; /* Instance of ruby.dll */
+
+/*
+ * Table of name to function pointer of python.
+ */
+#define RUBY_PROC FARPROC
+static struct
+{
+ char *name;
+ RUBY_PROC *ptr;
+} ruby_funcname_table[] =
+{
+ {"rb_assoc_new", (RUBY_PROC*)&dll_rb_assoc_new},
+ {"rb_cFalseClass", (RUBY_PROC*)&dll_rb_cFalseClass},
+ {"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum},
+ {"rb_cNilClass", (RUBY_PROC*)&dll_rb_cNilClass},
+ {"rb_cObject", (RUBY_PROC*)&dll_rb_cObject},
+ {"rb_cSymbol", (RUBY_PROC*)&dll_rb_cSymbol},
+ {"rb_cTrueClass", (RUBY_PROC*)&dll_rb_cTrueClass},
+ {"rb_check_type", (RUBY_PROC*)&dll_rb_check_type},
+ {"rb_class_path", (RUBY_PROC*)&dll_rb_class_path},
+ {"rb_data_object_alloc", (RUBY_PROC*)&dll_rb_data_object_alloc},
+ {"rb_define_class_under", (RUBY_PROC*)&dll_rb_define_class_under},
+ {"rb_define_const", (RUBY_PROC*)&dll_rb_define_const},
+ {"rb_define_global_function", (RUBY_PROC*)&dll_rb_define_global_function},
+ {"rb_define_method", (RUBY_PROC*)&dll_rb_define_method},
+ {"rb_define_module", (RUBY_PROC*)&dll_rb_define_module},
+ {"rb_define_module_function", (RUBY_PROC*)&dll_rb_define_module_function},
+ {"rb_define_singleton_method", (RUBY_PROC*)&dll_rb_define_singleton_method},
+ {"rb_define_virtual_variable", (RUBY_PROC*)&dll_rb_define_virtual_variable},
+ {"rb_stdout", (RUBY_PROC*)&dll_rb_stdout},
+ {"rb_eArgError", (RUBY_PROC*)&dll_rb_eArgError},
+ {"rb_eIndexError", (RUBY_PROC*)&dll_rb_eIndexError},
+ {"rb_eRuntimeError", (RUBY_PROC*)&dll_rb_eRuntimeError},
+ {"rb_eStandardError", (RUBY_PROC*)&dll_rb_eStandardError},
+ {"rb_eval_string_protect", (RUBY_PROC*)&dll_rb_eval_string_protect},
+ {"rb_global_variable", (RUBY_PROC*)&dll_rb_global_variable},
+ {"rb_hash_aset", (RUBY_PROC*)&dll_rb_hash_aset},
+ {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new},
+ {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect},
+ {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum},
+ {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get},
+ {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set},
+ {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect},
+ {"rb_num2long", (RUBY_PROC*)&dll_rb_num2long},
+ {"rb_num2ulong", (RUBY_PROC*)&dll_rb_num2ulong},
+ {"rb_obj_alloc", (RUBY_PROC*)&dll_rb_obj_alloc},
+ {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string},
+ {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id},
+ {"rb_raise", (RUBY_PROC*)&dll_rb_raise},
+ {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr},
+ {"rb_str_cat", (RUBY_PROC*)&dll_rb_str_cat},
+ {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat},
+ {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new},
+ {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2},
+ {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo},
+ {"ruby_init", (RUBY_PROC*)&dll_ruby_init},
+ {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath},
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18
+ {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf},
+#endif
+ {"", NULL},
+};
+
+/*
+ * Free ruby.dll
+ */
+ static void
+end_dynamic_ruby()
+{
+ if (hinstRuby)
+ {
+ FreeLibrary(hinstRuby);
+ hinstRuby = 0;
+ }
+}
+
+/*
+ * Load library and get all pointers.
+ * Parameter 'libname' provides name of DLL.
+ * Return OK or FAIL.
+ */
+ static int
+ruby_runtime_link_init(char *libname, int verbose)
+{
+ int i;
+
+ if (hinstRuby)
+ return OK;
+ hinstRuby = LoadLibrary(libname);
+ if (!hinstRuby)
+ {
+ if (verbose)
+ EMSG2(_(e_loadlib), libname);
+ return FAIL;
+ }
+
+ for (i = 0; ruby_funcname_table[i].ptr; ++i)
+ {
+ if (!(*ruby_funcname_table[i].ptr = GetProcAddress(hinstRuby,
+ ruby_funcname_table[i].name)))
+ {
+ FreeLibrary(hinstRuby);
+ hinstRuby = 0;
+ if (verbose)
+ EMSG2(_(e_loadfunc), ruby_funcname_table[i].name);
+ return FAIL;
+ }
+ }
+ return OK;
+}
+
+/*
+ * If ruby is enabled (there is installed ruby on Windows system) return TRUE,
+ * else FALSE.
+ */
+ int
+ruby_enabled(verbose)
+ int verbose;
+{
+ return ruby_runtime_link_init(DYNAMIC_RUBY_DLL, verbose) == OK;
+}
+#endif /* defined(DYNAMIC_RUBY) || defined(PROTO) */
+
+ void
+ruby_end()
+{
+#ifdef DYNAMIC_RUBY
+ end_dynamic_ruby();
+#endif
+}
+
+void ex_ruby(exarg_T *eap)
+{
+ int state;
+ char *script = NULL;
+
+ script = script_get(eap, eap->arg);
+ if (!eap->skip && ensure_ruby_initialized())
+ {
+ if (script == NULL)
+ rb_eval_string_protect((char *)eap->arg, &state);
+ else
+ rb_eval_string_protect(script, &state);
+ if (state)
+ error_print(state);
+ }
+ vim_free(script);
+}
+
+void ex_rubydo(exarg_T *eap)
+{
+ int state;
+ linenr_T i;
+
+ if (ensure_ruby_initialized())
+ {
+ if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
+ return;
+ for (i = eap->line1; i <= eap->line2; i++) {
+ VALUE line, oldline;
+
+ line = oldline = rb_str_new2(ml_get(i));
+ rb_lastline_set(line);
+ rb_eval_string_protect((char *) eap->arg, &state);
+ if (state) {
+ error_print(state);
+ break;
+ }
+ line = rb_lastline_get();
+ if (!NIL_P(line)) {
+ if (TYPE(line) != T_STRING) {
+ EMSG("E265: $_ must be an instance of String");
+ return;
+ }
+ ml_replace(i, (char_u *) STR2CSTR(line), 1);
+ changed();
+#ifdef SYNTAX_HL
+ syn_changed(i); /* recompute syntax hl. for this line */
+#endif
+ }
+ }
+ check_cursor();
+ update_curbuf(NOT_VALID);
+ }
+}
+
+void ex_rubyfile(exarg_T *eap)
+{
+ int state;
+
+ if (ensure_ruby_initialized())
+ {
+ rb_load_protect(rb_str_new2((char *) eap->arg), 0, &state);
+ if (state) error_print(state);
+ }
+}
+
+void ruby_buffer_free(buf_T *buf)
+{
+ if (buf->ruby_ref) {
+ rb_hash_aset(objtbl, rb_obj_id((VALUE) buf->ruby_ref), Qnil);
+ RDATA(buf->ruby_ref)->data = NULL;
+ }
+}
+
+void ruby_window_free(win_T *win)
+{
+ if (win->ruby_ref) {
+ rb_hash_aset(objtbl, rb_obj_id((VALUE) win->ruby_ref), Qnil);
+ RDATA(win->ruby_ref)->data = NULL;
+ }
+}
+
+static int ensure_ruby_initialized(void)
+{
+ if (!ruby_initialized)
+ {
+#ifdef DYNAMIC_RUBY
+ if (ruby_enabled(TRUE))
+ {
+#endif
+ ruby_init();
+ ruby_init_loadpath();
+ ruby_io_init();
+ ruby_vim_init();
+ ruby_initialized = 1;
+#ifdef DYNAMIC_RUBY
+ }
+ else
+ {
+ EMSG(_("E266: Sorry, this command is disabled, the Ruby library could not be loaded."));
+ return 0;
+ }
+#endif
+ }
+ return ruby_initialized;
+}
+
+static void error_print(int state)
+{
+#ifndef DYNAMIC_RUBY
+ RUBYEXTERN VALUE ruby_errinfo;
+#endif
+ VALUE eclass;
+ VALUE einfo;
+ char buff[BUFSIZ];
+
+#define TAG_RETURN 0x1
+#define TAG_BREAK 0x2
+#define TAG_NEXT 0x3
+#define TAG_RETRY 0x4
+#define TAG_REDO 0x5
+#define TAG_RAISE 0x6
+#define TAG_THROW 0x7
+#define TAG_FATAL 0x8
+#define TAG_MASK 0xf
+
+ switch (state) {
+ case TAG_RETURN:
+ EMSG("E267: unexpected return");
+ break;
+ case TAG_NEXT:
+ EMSG("E268: unexpected next");
+ break;
+ case TAG_BREAK:
+ EMSG("E269: unexpected break");
+ break;
+ case TAG_REDO:
+ EMSG("E270: unexpected redo");
+ break;
+ case TAG_RETRY:
+ EMSG("E271: retry outside of rescue clause");
+ break;
+ case TAG_RAISE:
+ case TAG_FATAL:
+ eclass = CLASS_OF(ruby_errinfo);
+ einfo = rb_obj_as_string(ruby_errinfo);
+ if (eclass == rb_eRuntimeError && RSTRING(einfo)->len == 0) {
+ EMSG("E272: unhandled exception");
+ }
+ else {
+ VALUE epath;
+ char *p;
+
+ epath = rb_class_path(eclass);
+ snprintf(buff, BUFSIZ, "%s: %s",
+ RSTRING(epath)->ptr, RSTRING(einfo)->ptr);
+ p = strchr(buff, '\n');
+ if (p) *p = '\0';
+ EMSG(buff);
+ }
+ break;
+ default:
+ snprintf(buff, BUFSIZ, _("E273: unknown longjmp status %d"), state);
+ EMSG(buff);
+ break;
+ }
+}
+
+static VALUE vim_message(VALUE self, VALUE str)
+{
+ char *buff, *p;
+
+ str = rb_obj_as_string(str);
+ buff = ALLOCA_N(char, RSTRING(str)->len);
+ strcpy(buff, RSTRING(str)->ptr);
+ p = strchr(buff, '\n');
+ if (p) *p = '\0';
+ MSG(buff);
+ return Qnil;
+}
+
+static VALUE vim_set_option(VALUE self, VALUE str)
+{
+ do_set((char_u *)STR2CSTR(str), 0);
+ update_screen(NOT_VALID);
+ return Qnil;
+}
+
+static VALUE vim_command(VALUE self, VALUE str)
+{
+ do_cmdline_cmd((char_u *)STR2CSTR(str));
+ return Qnil;
+}
+
+static VALUE vim_evaluate(VALUE self, VALUE str)
+{
+#ifdef FEAT_EVAL
+ char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL);
+
+ if (value)
+ {
+ VALUE val = rb_str_new2(value);
+ vim_free(value);
+ return val;
+ }
+ else
+#endif
+ return Qnil;
+}
+
+static VALUE buffer_new(buf_T *buf)
+{
+ if (buf->ruby_ref) {
+ return (VALUE) buf->ruby_ref;
+ }
+ else {
+ VALUE obj = Data_Wrap_Struct(cBuffer, 0, 0, buf);
+ buf->ruby_ref = (void *) obj;
+ rb_hash_aset(objtbl, rb_obj_id(obj), obj);
+ return obj;
+ }
+}
+
+static buf_T *get_buf(VALUE obj)
+{
+ buf_T *buf;
+
+ Data_Get_Struct(obj, buf_T, buf);
+ if (buf == NULL)
+ rb_raise(eDeletedBufferError, "attempt to refer to deleted buffer");
+ return buf;
+}
+
+static VALUE buffer_s_current()
+{
+ return buffer_new(curbuf);
+}
+
+static VALUE buffer_s_count()
+{
+ buf_T *b;
+ int n = 0;
+
+ for (b = firstbuf; b; b = b->b_next) n++;
+ return INT2NUM(n);
+}
+
+static VALUE buffer_s_aref(VALUE self, VALUE num)
+{
+ buf_T *b;
+ int n = NUM2INT(num);
+
+ for (b = firstbuf; b; b = b->b_next, --n) {
+ if (n == 0)
+ return buffer_new(b);
+ }
+ return Qnil;
+}
+
+static VALUE buffer_name(VALUE self)
+{
+ buf_T *buf = get_buf(self);
+
+ return buf->b_ffname ? rb_str_new2(buf->b_ffname) : Qnil;
+}
+
+static VALUE buffer_number(VALUE self)
+{
+ buf_T *buf = get_buf(self);
+
+ return INT2NUM(buf->b_fnum);
+}
+
+static VALUE buffer_count(VALUE self)
+{
+ buf_T *buf = get_buf(self);
+
+ return INT2NUM(buf->b_ml.ml_line_count);
+}
+
+static VALUE buffer_aref(VALUE self, VALUE num)
+{
+ buf_T *buf = get_buf(self);
+ long n = NUM2LONG(num);
+
+ if (n > 0 && n <= buf->b_ml.ml_line_count) {
+ char *line = ml_get_buf(buf, n, FALSE);
+ return line ? rb_str_new2(line) : Qnil;
+ }
+ else {
+ rb_raise(rb_eIndexError, "index %d out of buffer", n);
+ return Qnil; /* For stop warning */
+ }
+}
+
+static VALUE buffer_aset(VALUE self, VALUE num, VALUE str)
+{
+ buf_T *buf = get_buf(self);
+ buf_T *savebuf = curbuf;
+ char *line = STR2CSTR(str);
+ long n = NUM2LONG(num);
+
+ if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
+ curbuf = buf;
+ if (u_savesub(n) == OK) {
+ ml_replace(n, (char_u *) line, TRUE);
+ changed();
+#ifdef SYNTAX_HL
+ syn_changed(n); /* recompute syntax hl. for this line */
+#endif
+ }
+ curbuf = savebuf;
+ update_curbuf(NOT_VALID);
+ }
+ else {
+ rb_raise(rb_eIndexError, "index %d out of buffer", n);
+ return Qnil; /* For stop warning */
+ }
+ return str;
+}
+
+static VALUE buffer_delete(VALUE self, VALUE num)
+{
+ buf_T *buf = get_buf(self);
+ buf_T *savebuf = curbuf;
+ long n = NUM2LONG(num);
+
+ if (n > 0 && n <= buf->b_ml.ml_line_count) {
+ curbuf = buf;
+ if (u_savedel(n, 1) == OK) {
+ mark_adjust(n, n, MAXLNUM, -1);
+ ml_delete(n, 0);
+ changed();
+ }
+ curbuf = savebuf;
+ update_curbuf(NOT_VALID);
+ }
+ else {
+ rb_raise(rb_eIndexError, "index %d out of buffer", n);
+ }
+ return Qnil;
+}
+
+static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
+{
+ buf_T *buf = get_buf(self);
+ buf_T *savebuf = curbuf;
+ char *line = STR2CSTR(str);
+ long n = NUM2LONG(num);
+
+ if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
+ curbuf = buf;
+ if (u_inssub(n + 1) == OK) {
+ mark_adjust(n + 1, MAXLNUM, 1L, 0L);
+ ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
+ changed();
+ }
+ curbuf = savebuf;
+ update_curbuf(NOT_VALID);
+ }
+ else {
+ rb_raise(rb_eIndexError, "index %d out of buffer", n);
+ }
+ return str;
+}
+
+static VALUE window_new(win_T *win)
+{
+ if (win->ruby_ref) {
+ return (VALUE) win->ruby_ref;
+ }
+ else {
+ VALUE obj = Data_Wrap_Struct(cVimWindow, 0, 0, win);
+ win->ruby_ref = (void *) obj;
+ rb_hash_aset(objtbl, rb_obj_id(obj), obj);
+ return obj;
+ }
+}
+
+static win_T *get_win(VALUE obj)
+{
+ win_T *win;
+
+ Data_Get_Struct(obj, win_T, win);
+ if (win == NULL)
+ rb_raise(eDeletedWindowError, "attempt to refer to deleted window");
+ return win;
+}
+
+static VALUE window_s_current()
+{
+ return window_new(curwin);
+}
+
+static VALUE window_s_count()
+{
+#ifdef FEAT_WINDOWS
+ win_T *w;
+ int n = 0;
+
+ for (w = firstwin; w; w = w->w_next)
+ n++;
+ return INT2NUM(n);
+#else
+ return INT2NUM(1);
+#endif
+}
+
+static VALUE window_s_aref(VALUE self, VALUE num)
+{
+ win_T *w;
+ int n = NUM2INT(num);
+
+#ifndef FEAT_WINDOWS
+ w = curwin;
+#else
+ for (w = firstwin; w != NULL; w = w->w_next, --n)
+#endif
+ if (n == 0)
+ return window_new(w);
+ return Qnil;
+}
+
+static VALUE window_buffer(VALUE self)
+{
+ win_T *win = get_win(self);
+
+ return buffer_new(win->w_buffer);
+}
+
+static VALUE window_height(VALUE self)
+{
+ win_T *win = get_win(self);
+
+ return INT2NUM(win->w_height);
+}
+
+static VALUE window_set_height(VALUE self, VALUE height)
+{
+ win_T *win = get_win(self);
+ win_T *savewin = curwin;
+
+ curwin = win;
+ win_setheight(NUM2INT(height));
+ curwin = savewin;
+ return height;
+}
+
+static VALUE window_cursor(VALUE self)
+{
+ win_T *win = get_win(self);
+
+ return rb_assoc_new(INT2NUM(win->w_cursor.lnum), INT2NUM(win->w_cursor.col));
+}
+
+static VALUE window_set_cursor(VALUE self, VALUE pos)
+{
+ VALUE lnum, col;
+ win_T *win = get_win(self);
+
+ Check_Type(pos, T_ARRAY);
+ if (RARRAY(pos)->len != 2)
+ rb_raise(rb_eArgError, "array length must be 2");
+ lnum = RARRAY(pos)->ptr[0];
+ col = RARRAY(pos)->ptr[1];
+ win->w_cursor.lnum = NUM2LONG(lnum);
+ win->w_cursor.col = NUM2UINT(col);
+ check_cursor(); /* put cursor on an existing line */
+ update_screen(NOT_VALID);
+ return Qnil;
+}
+
+static VALUE f_p(int argc, VALUE *argv, VALUE self)
+{
+ int i;
+ VALUE str = rb_str_new("", 0);
+
+ for (i = 0; i < argc; i++) {
+ if (i > 0) rb_str_cat(str, ", ", 2);
+ rb_str_concat(str, rb_inspect(argv[i]));
+ }
+ MSG(RSTRING(str)->ptr);
+ return Qnil;
+}
+
+static void ruby_io_init(void)
+{
+#ifndef DYNAMIC_RUBY
+ RUBYEXTERN VALUE rb_stdout;
+#endif
+
+ rb_stdout = rb_obj_alloc(rb_cObject);
+ rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
+ rb_define_global_function("p", f_p, -1);
+}
+
+static void ruby_vim_init(void)
+{
+ objtbl = rb_hash_new();
+ rb_global_variable(&objtbl);
+
+ mVIM = rb_define_module("VIM");
+ rb_define_const(mVIM, "VERSION_MAJOR", INT2NUM(VIM_VERSION_MAJOR));
+ rb_define_const(mVIM, "VERSION_MINOR", INT2NUM(VIM_VERSION_MINOR));
+ rb_define_const(mVIM, "VERSION_BUILD", INT2NUM(VIM_VERSION_BUILD));
+ rb_define_const(mVIM, "VERSION_PATCHLEVEL", INT2NUM(VIM_VERSION_PATCHLEVEL));
+ rb_define_const(mVIM, "VERSION_SHORT", rb_str_new2(VIM_VERSION_SHORT));
+ rb_define_const(mVIM, "VERSION_MEDIUM", rb_str_new2(VIM_VERSION_MEDIUM));
+ rb_define_const(mVIM, "VERSION_LONG", rb_str_new2(VIM_VERSION_LONG));
+ rb_define_const(mVIM, "VERSION_LONG_DATE", rb_str_new2(VIM_VERSION_LONG_DATE));
+ rb_define_module_function(mVIM, "message", vim_message, 1);
+ rb_define_module_function(mVIM, "set_option", vim_set_option, 1);
+ rb_define_module_function(mVIM, "command", vim_command, 1);
+ rb_define_module_function(mVIM, "evaluate", vim_evaluate, 1);
+
+ eDeletedBufferError = rb_define_class_under(mVIM, "DeletedBufferError",
+ rb_eStandardError);
+ eDeletedWindowError = rb_define_class_under(mVIM, "DeletedWindowError",
+ rb_eStandardError);
+
+ cBuffer = rb_define_class_under(mVIM, "Buffer", rb_cObject);
+ rb_define_singleton_method(cBuffer, "current", buffer_s_current, 0);
+ rb_define_singleton_method(cBuffer, "count", buffer_s_count, 0);
+ rb_define_singleton_method(cBuffer, "[]", buffer_s_aref, 1);
+ rb_define_method(cBuffer, "name", buffer_name, 0);
+ rb_define_method(cBuffer, "number", buffer_number, 0);
+ rb_define_method(cBuffer, "count", buffer_count, 0);
+ rb_define_method(cBuffer, "length", buffer_count, 0);
+ rb_define_method(cBuffer, "[]", buffer_aref, 1);
+ rb_define_method(cBuffer, "[]=", buffer_aset, 2);
+ rb_define_method(cBuffer, "delete", buffer_delete, 1);
+ rb_define_method(cBuffer, "append", buffer_append, 2);
+
+ cVimWindow = rb_define_class_under(mVIM, "Window", rb_cObject);
+ rb_define_singleton_method(cVimWindow, "current", window_s_current, 0);
+ rb_define_singleton_method(cVimWindow, "count", window_s_count, 0);
+ rb_define_singleton_method(cVimWindow, "[]", window_s_aref, 1);
+ rb_define_method(cVimWindow, "buffer", window_buffer, 0);
+ rb_define_method(cVimWindow, "height", window_height, 0);
+ rb_define_method(cVimWindow, "height=", window_set_height, 1);
+ rb_define_method(cVimWindow, "cursor", window_cursor, 0);
+ rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1);
+
+ rb_define_virtual_variable("$curbuf", buffer_s_current, 0);
+ rb_define_virtual_variable("$curwin", window_s_current, 0);
+}
diff --git a/src/if_sniff.c b/src/if_sniff.c
new file mode 100644
index 000000000..4cb0bee24
--- /dev/null
+++ b/src/if_sniff.c
@@ -0,0 +1,1210 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * if_sniff.c Interface between Vim and SNiFF+
+ *
+ * $Id$
+ *
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#ifdef WIN32
+# include <stdio.h>
+# include <fcntl.h>
+# include <io.h>
+# include <process.h>
+# include <string.h>
+# include <assert.h>
+#else
+# ifdef FEAT_GUI_X11
+# include "gui_x11.pro"
+# endif
+# include "os_unixx.h"
+#endif
+
+static int sniffemacs_pid;
+
+int fd_from_sniff;
+int sniff_connected = 0;
+int sniff_request_waiting = 0;
+int want_sniff_request = 0;
+
+#define MAX_REQUEST_LEN 512
+
+#define NEED_SYMBOL 2
+#define EMPTY_SYMBOL 4
+#define NEED_FILE 8
+#define SILENT 16
+#define DISCONNECT 32
+#define CONNECT 64
+
+#define RQ_NONE 0
+#define RQ_SIMPLE 1
+#define RQ_CONTEXT NEED_FILE + NEED_SYMBOL
+#define RQ_SCONTEXT NEED_FILE + NEED_SYMBOL + EMPTY_SYMBOL
+#define RQ_NOSYMBOL NEED_FILE
+#define RQ_SILENT RQ_NOSYMBOL + SILENT
+#define RQ_CONNECT RQ_NONE + CONNECT
+#define RQ_DISCONNECT RQ_SIMPLE + DISCONNECT
+
+struct sn_cmd
+{
+ char *cmd_name;
+ char cmd_code;
+ char *cmd_msg;
+ int cmd_type;
+};
+
+struct sn_cmd_list
+{
+ struct sn_cmd* sniff_cmd;
+ struct sn_cmd_list* next_cmd;
+};
+
+static struct sn_cmd sniff_cmds[] =
+{
+ { "toggle", 'e', N_("Toggle implementation/definition"),RQ_SCONTEXT },
+ { "superclass", 's', N_("Show base class of"), RQ_CONTEXT },
+ { "overridden", 'm', N_("Show overridden member function"),RQ_SCONTEXT },
+ { "retrieve-file", 'r', N_("Retrieve from file"), RQ_CONTEXT },
+ { "retrieve-project",'p', N_("Retrieve from project"), RQ_CONTEXT },
+ { "retrieve-all-projects",
+ 'P', N_("Retrieve from all projects"), RQ_CONTEXT },
+ { "retrieve-next", 'R', N_("Retrieve"), RQ_CONTEXT },
+ { "goto-symbol", 'g', N_("Show source of"), RQ_CONTEXT },
+ { "find-symbol", 'f', N_("Find symbol"), RQ_CONTEXT },
+ { "browse-class", 'w', N_("Browse class"), RQ_CONTEXT },
+ { "hierarchy", 't', N_("Show class in hierarchy"), RQ_CONTEXT },
+ { "restr-hier", 'T', N_("Show class in restricted hierarchy"),RQ_CONTEXT },
+ { "xref-to", 'x', N_("Xref refers to"), RQ_CONTEXT },
+ { "xref-by", 'X', N_("Xref referred by"), RQ_CONTEXT },
+ { "xref-has", 'c', N_("Xref has a"), RQ_CONTEXT },
+ { "xref-used-by", 'C', N_("Xref used by"), RQ_CONTEXT },
+ { "show-docu", 'd', N_("Show docu of"), RQ_CONTEXT },
+ { "gen-docu", 'D', N_("Generate docu for"), RQ_CONTEXT },
+ { "connect", 'y', NULL, RQ_CONNECT },
+ { "disconnect", 'q', NULL, RQ_DISCONNECT },
+ { "font-info", 'z', NULL, RQ_SILENT },
+ { "update", 'u', NULL, RQ_SILENT },
+ { NULL, '\0', NULL, 0}
+};
+
+
+static char *SniffEmacs[2] = {"sniffemacs", (char *)NULL}; /* Yes, Emacs! */
+static int fd_to_sniff;
+static int sniff_will_disconnect = 0;
+static char msg_sniff_disconnect[] = N_("Cannot connect to SNiFF+. Check environment (sniffemacs must be found in $PATH).\n");
+static char sniff_rq_sep[] = " ";
+static struct sn_cmd_list *sniff_cmd_ext = NULL;
+
+/* Initializing vim commands
+ * executed each time vim connects to Sniff
+ */
+static char *init_cmds[]= {
+ "augroup sniff",
+ "autocmd BufWritePost * sniff update",
+ "autocmd BufReadPost * sniff font-info",
+ "autocmd VimLeave * sniff disconnect",
+ "augroup END",
+
+ "let g:sniff_connected = 1",
+
+ "if ! exists('g:sniff_mappings_sourced')|"
+ "if ! exists('g:sniff_mappings')|"
+ "if exists('$SNIFF_DIR4')|"
+ "let g:sniff_mappings='$SNIFF_DIR4/config/integrations/vim/sniff.vim'|"
+ "else|"
+ "let g:sniff_mappings='$SNIFF_DIR/config/sniff.vim'|"
+ "endif|"
+ "endif|"
+ "let g:sniff_mappings=expand(g:sniff_mappings)|"
+ "if filereadable(g:sniff_mappings)|"
+ "execute 'source' g:sniff_mappings|"
+ "let g:sniff_mappings_sourced=1|"
+ "endif|"
+ "endif",
+
+ NULL
+};
+
+/*-------- Function Prototypes ----------------------------------*/
+
+static int ConnectToSniffEmacs __ARGS((void));
+static void sniff_connect __ARGS((void));
+static void HandleSniffRequest __ARGS((char* buffer));
+static int get_request __ARGS((int fd, char *buf, int maxlen));
+static void WriteToSniff __ARGS((char *str));
+static void SendRequest __ARGS((struct sn_cmd *command, char* symbol));
+static void vi_msg __ARGS((char *));
+static void vi_error_msg __ARGS((char *));
+static char *vi_symbol_under_cursor __ARGS((void));
+static void vi_open_file __ARGS((char *));
+static char *vi_buffer_name __ARGS((void));
+static buf_T *vi_find_buffer __ARGS((char *));
+static void vi_exec_cmd __ARGS((char *));
+static void vi_set_cursor_pos __ARGS((long char_nr));
+static long vi_cursor_pos __ARGS((void));
+
+/* debug trace */
+#if 0
+static FILE* _tracefile = NULL;
+#define SNIFF_TRACE_OPEN(file) if (!_tracefile) _tracefile = fopen(file, "w")
+#define SNIFF_TRACE(msg) fprintf(_tracefile, msg); fflush(_tracefile);
+#define SNIFF_TRACE1(msg, arg) fprintf(_tracefile, msg,arg); fflush(_tracefile);
+#define SNIFF_TRACE_CLOSE fclose(_tracefile); _tracefile=NULL;
+#else
+#define SNIFF_TRACE_OPEN(file)
+#define SNIFF_TRACE(msg)
+#define SNIFF_TRACE1(msg, arg)
+#define SNIFF_TRACE_CLOSE
+#endif
+
+/*-------- Windows Only Declarations -----------------------------*/
+#ifdef WIN32
+
+static int sniff_request_processed=1;
+static HANDLE sniffemacs_handle=NULL;
+static HANDLE readthread_handle=NULL;
+static HANDLE handle_to_sniff=NULL;
+static HANDLE handle_from_sniff=NULL;
+
+struct sniffBufNode
+{
+ struct sniffBufNode *next;
+ int bufLen;
+ char buf[MAX_REQUEST_LEN];
+};
+static struct sniffBufNode *sniffBufStart=NULL;
+static struct sniffBufNode *sniffBufEnd=NULL;
+static HANDLE hBufferMutex=NULL;
+
+# ifdef FEAT_GUI_W32
+ extern HWND s_hwnd; /* gvim's Window handle */
+# endif
+/*
+ * some helper functions for Windows port only
+ */
+
+ static HANDLE
+ExecuteDetachedProgram(char *szBinary, char *szCmdLine,
+ HANDLE hStdInput, HANDLE hStdOutput)
+{
+ BOOL bResult;
+ DWORD nError;
+ PROCESS_INFORMATION aProcessInformation;
+ PROCESS_INFORMATION *pProcessInformation= &aProcessInformation;
+ STARTUPINFO aStartupInfo;
+ STARTUPINFO *pStartupInfo= &aStartupInfo;
+ DWORD dwCreationFlags= 0;
+ char szPath[512];
+ HINSTANCE hResult;
+
+ hResult = FindExecutable(szBinary, ".", szPath);
+ if ((int)hResult <= 32)
+ {
+ /* can't find the exe file */
+ return NULL;
+ }
+
+ ZeroMemory(pStartupInfo, sizeof(*pStartupInfo));
+ pStartupInfo->dwFlags= STARTF_USESHOWWINDOW|STARTF_USESTDHANDLES;
+ pStartupInfo->hStdInput = hStdInput;
+ pStartupInfo->hStdOutput = hStdOutput;
+ pStartupInfo->wShowWindow= SW_HIDE;
+ pStartupInfo->cb = sizeof(STARTUPINFO);
+
+ bResult= CreateProcess(
+ szPath,
+ szCmdLine,
+ NULL, /* security attr for process */
+ NULL, /* security attr for primary thread */
+ TRUE, /* DO inherit stdin and stdout */
+ dwCreationFlags, /* creation flags */
+ NULL, /* environment */
+ ".", /* current directory */
+ pStartupInfo, /* startup info: NULL crashes */
+ pProcessInformation /* process information: NULL crashes */
+ );
+ nError= GetLastError();
+ if (bResult)
+ {
+ CloseHandle(pProcessInformation->hThread);
+ CloseHandle(hStdInput);
+ CloseHandle(hStdOutput);
+ return(pProcessInformation->hProcess);
+ }
+ else
+ return(NULL);
+}
+
+/*
+ * write to the internal Thread / Thread communications buffer.
+ * Return TRUE if successful, FALSE else.
+ */
+ static BOOL
+writeToBuffer(char *msg, int len)
+{
+ DWORD dwWaitResult; /* Request ownership of mutex. */
+ struct sniffBufNode *bn;
+ int bnSize;
+
+ SNIFF_TRACE1("writeToBuffer %d\n", len);
+ bnSize = sizeof(struct sniffBufNode) - MAX_REQUEST_LEN + len + 1;
+ if (bnSize < 128) bnSize = 128; /* minimum length to avoid fragmentation */
+ bn = (struct sniffBufNode *)malloc(bnSize);
+ if (!bn)
+ return FALSE;
+
+ memcpy(bn->buf, msg, len);
+ bn->buf[len]='\0'; /* terminate CString for added safety */
+ bn->next = NULL;
+ bn->bufLen = len;
+ /* now, acquire a Mutex for adding the string to our linked list */
+ dwWaitResult = WaitForSingleObject(
+ hBufferMutex, /* handle of mutex */
+ 1000L); /* one-second time-out interval */
+ if (dwWaitResult == WAIT_OBJECT_0)
+ {
+ /* The thread got mutex ownership. */
+ if (sniffBufEnd)
+ {
+ sniffBufEnd->next = bn;
+ sniffBufEnd = bn;
+ }
+ else
+ sniffBufStart = sniffBufEnd = bn;
+ /* Release ownership of the mutex object. */
+ if (! ReleaseMutex(hBufferMutex))
+ {
+ /* Deal with error. */
+ }
+ return TRUE;
+ }
+
+ /* Cannot get mutex ownership due to time-out or mutex object abandoned. */
+ free(bn);
+ return FALSE;
+}
+
+/*
+ * read from the internal Thread / Thread communications buffer.
+ * Return TRUE if successful, FALSE else.
+ */
+ static int
+ReadFromBuffer(char *buf, int maxlen)
+{
+ DWORD dwWaitResult; /* Request ownership of mutex. */
+ int theLen;
+ struct sniffBufNode *bn;
+
+ dwWaitResult = WaitForSingleObject(
+ hBufferMutex, /* handle of mutex */
+ 1000L); /* one-second time-out interval */
+ if (dwWaitResult == WAIT_OBJECT_0)
+ {
+ if (!sniffBufStart)
+ {
+ /* all pending Requests Processed */
+ theLen = 0;
+ }
+ else
+ {
+ bn = sniffBufStart;
+ theLen = bn->bufLen;
+ SNIFF_TRACE1("ReadFromBuffer %d\n", theLen);
+ if (theLen >= maxlen)
+ {
+ /* notify the user of buffer overflow? */
+ theLen = maxlen-1;
+ }
+ memcpy(buf, bn->buf, theLen);
+ buf[theLen] = '\0';
+ if (! (sniffBufStart = bn->next))
+ {
+ sniffBufEnd = NULL;
+ sniff_request_processed = 1;
+ }
+ free(bn);
+ }
+ if (! ReleaseMutex(hBufferMutex))
+ {
+ /* Deal with error. */
+ }
+ return theLen;
+ }
+
+ /* Cannot get mutex ownership due to time-out or mutex object abandoned. */
+ return -1;
+}
+
+/* on Win32, a separate Thread reads the input pipe. get_request is not needed here. */
+ static void __cdecl
+SniffEmacsReadThread(void *dummy)
+{
+ static char ReadThreadBuffer[MAX_REQUEST_LEN];
+ int ReadThreadLen=0;
+ int result=0;
+ int msgLen=0;
+ char *msgStart, *msgCur;
+
+ SNIFF_TRACE("begin thread\n");
+ /* Read from the pipe to SniffEmacs */
+ while (sniff_connected)
+ {
+ if (!ReadFile(handle_from_sniff,
+ ReadThreadBuffer + ReadThreadLen, /* acknowledge rest in buffer */
+ MAX_REQUEST_LEN - ReadThreadLen,
+ &result,
+ NULL))
+ {
+ DWORD err = GetLastError();
+ result = -1;
+ }
+
+ if (result < 0)
+ {
+ /* probably sniffemacs died... log the Error? */
+ sniff_disconnect(1);
+ }
+ else if (result > 0)
+ {
+ ReadThreadLen += result-1; /* total length of valid chars */
+ for(msgCur=msgStart=ReadThreadBuffer; ReadThreadLen > 0; msgCur++, ReadThreadLen--)
+ {
+ if (*msgCur == '\0' || *msgCur == '\r' || *msgCur == '\n')
+ {
+ msgLen = msgCur-msgStart; /* don't add the CR/LF chars */
+ if (msgLen > 0)
+ writeToBuffer(msgStart, msgLen);
+ msgStart = msgCur + 1; /* over-read single CR/LF chars */
+ }
+ }
+
+ /* move incomplete message to beginning of buffer */
+ ReadThreadLen = msgCur - msgStart;
+ if (ReadThreadLen > 0)
+ mch_memmove(ReadThreadBuffer, msgStart, ReadThreadLen);
+
+ if (sniff_request_processed)
+ {
+ /* notify others that new data has arrived */
+ sniff_request_processed = 0;
+ sniff_request_waiting = 1;
+#ifdef FEAT_GUI_W32
+ PostMessage(s_hwnd, WM_USER, (WPARAM)0, (LPARAM)0);
+#endif
+ }
+ }
+ }
+ SNIFF_TRACE("end thread\n");
+}
+#endif /* WIN32 */
+/*-------- End of Windows Only Declarations ------------------------*/
+
+
+/* ProcessSniffRequests
+ * Function that should be called from outside
+ * to process the waiting sniff requests
+ */
+ void
+ProcessSniffRequests()
+{
+ static char buf[MAX_REQUEST_LEN];
+ int len;
+
+ while (sniff_connected)
+ {
+#ifdef WIN32
+ len = ReadFromBuffer(buf, sizeof(buf));
+#else
+ len = get_request(fd_from_sniff, buf, sizeof(buf));
+#endif
+ if (len < 0)
+ {
+ vi_error_msg(_("E274: Sniff: Error during read. Disconnected"));
+ sniff_disconnect(1);
+ break;
+ }
+ else if (len > 0)
+ HandleSniffRequest( buf );
+ else
+ break;
+ }
+
+ if (sniff_will_disconnect) /* Now the last msg has been processed */
+ sniff_disconnect(1);
+}
+
+ static struct sn_cmd *
+find_sniff_cmd(cmd)
+ char *cmd;
+{
+ struct sn_cmd *sniff_cmd = NULL;
+ int i;
+ for(i=0; sniff_cmds[i].cmd_name; i++)
+ {
+ if (!strcmp(cmd, sniff_cmds[i].cmd_name))
+ {
+ sniff_cmd = &sniff_cmds[i];
+ break;
+ }
+ }
+ if (!sniff_cmd)
+ {
+ struct sn_cmd_list *list = sniff_cmd_ext;
+ while(list)
+ {
+ if (!strcmp(cmd, list->sniff_cmd->cmd_name))
+ {
+ sniff_cmd = list->sniff_cmd;
+ break;
+ }
+ list = list->next_cmd;
+ }
+ }
+ return sniff_cmd;
+}
+
+ static int
+add_sniff_cmd(cmd, def, msg)
+ char *cmd;
+ char *def;
+ char *msg;
+{
+ int rc = 0;
+ if (def != NULL && def[0] != NUL && find_sniff_cmd(cmd) == NULL)
+ {
+ struct sn_cmd_list *list = sniff_cmd_ext;
+ struct sn_cmd *sniff_cmd = (struct sn_cmd*)malloc(sizeof(struct sn_cmd));
+ struct sn_cmd_list *cmd_node = (struct sn_cmd_list*)malloc(sizeof(struct sn_cmd_list));
+ int rq_type = 0;
+
+ /* unescape message text */
+ char *p = msg;
+ char *end = p+strlen(msg);
+ while(*p)
+ {
+ if (*p == '\\')
+ mch_memmove(p,p+1,end-p);
+ p++;
+ }
+ SNIFF_TRACE1("request name = %s\n",cmd);
+ SNIFF_TRACE1("request def = %s\n",def);
+ SNIFF_TRACE1("request msg = %s\n",msg);
+
+ while(list && list->next_cmd)
+ list = list->next_cmd;
+ if (!list)
+ sniff_cmd_ext = cmd_node;
+ else
+ list->next_cmd = cmd_node;
+
+ sniff_cmd->cmd_name = cmd;
+ sniff_cmd->cmd_code = def[0];
+ sniff_cmd->cmd_msg = msg;
+ switch(def[1])
+ {
+ case 'f':
+ rq_type = RQ_NOSYMBOL;
+ break;
+ case 's':
+ rq_type = RQ_CONTEXT;
+ break;
+ case 'S':
+ rq_type = RQ_SCONTEXT;
+ break;
+ default:
+ rq_type = RQ_SIMPLE;
+ break;
+ }
+ sniff_cmd->cmd_type = rq_type;
+ cmd_node->sniff_cmd = sniff_cmd;
+ cmd_node->next_cmd = NULL;
+ rc = 1;
+ }
+ return rc;
+}
+
+/* ex_sniff
+ * Handle ":sniff" command
+ */
+ void
+ex_sniff(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *symbol = NULL;
+ char_u *cmd = NULL;
+
+ SNIFF_TRACE_OPEN("if_sniff.log");
+ if (ends_excmd(*arg)) /* no request: print available commands */
+ {
+ int i;
+ msg_start();
+ msg_outtrans_attr((char_u *)"-- SNiFF+ commands --", hl_attr(HLF_T));
+ for(i=0; sniff_cmds[i].cmd_name; i++)
+ {
+ msg_putchar('\n');
+ msg_outtrans((char_u *)":sniff ");
+ msg_outtrans((char_u *)sniff_cmds[i].cmd_name);
+ }
+ msg_putchar('\n');
+ msg_outtrans((char_u *)_("SNiFF+ is currently "));
+ if (!sniff_connected)
+ msg_outtrans((char_u *)_("not "));
+ msg_outtrans((char_u *)_("connected"));
+ msg_end();
+ }
+ else /* extract command name and symbol if present */
+ {
+ symbol = skiptowhite(arg);
+ cmd = vim_strnsave(arg, (int)(symbol-arg));
+ symbol = skipwhite(symbol);
+ if (ends_excmd(*symbol))
+ symbol = NULL;
+ if (!strcmp((char *)cmd, "addcmd"))
+ {
+ char_u *def = skiptowhite(symbol);
+ char_u *name = vim_strnsave(symbol, (int)(def-symbol));
+ char_u *msg;
+ def = skipwhite(def);
+ msg = skiptowhite(def);
+ def = vim_strnsave(def, (int)(msg-def));
+ msg = skipwhite(msg);
+ if (ends_excmd(*msg))
+ msg = vim_strsave(name);
+ else
+ msg = vim_strnsave(msg, (int)(skiptowhite_esc(msg)-msg));
+ if (!add_sniff_cmd((char*)name, (char*)def, (char*)msg))
+ {
+ vim_free(msg);
+ vim_free(def);
+ vim_free(name);
+ }
+ }
+ else
+ {
+ struct sn_cmd* sniff_cmd = find_sniff_cmd((char*)cmd);
+ if (sniff_cmd)
+ SendRequest(sniff_cmd, (char *)symbol);
+ else
+ EMSG2(_("E275: Unknown SNiFF+ request: %s"), cmd);
+ }
+ vim_free(cmd);
+ }
+}
+
+
+ static void
+sniff_connect()
+{
+ if (sniff_connected)
+ return;
+ if (ConnectToSniffEmacs())
+ vi_error_msg(_("E276: Error connecting to SNiFF+"));
+ else
+ {
+ int i;
+
+ for (i = 0; init_cmds[i]; i++)
+ vi_exec_cmd(init_cmds[i]);
+ }
+}
+
+ void
+sniff_disconnect(immediately)
+ int immediately;
+{
+ if (!sniff_connected)
+ return;
+ if (immediately)
+ {
+ vi_exec_cmd("augroup sniff");
+ vi_exec_cmd("au!");
+ vi_exec_cmd("augroup END");
+ vi_exec_cmd("unlet g:sniff_connected");
+ sniff_connected = 0;
+ want_sniff_request = 0;
+ sniff_will_disconnect = 0;
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_mch_wait_for_chars(0L);
+#endif
+#ifdef WIN32
+ while(sniffBufStart != NULL)
+ {
+ struct sniffBufNode *node = sniffBufStart;
+ sniffBufStart = sniffBufStart->next;
+ free(node);
+ }
+ sniffBufStart = sniffBufEnd = NULL;
+ sniff_request_processed = 1;
+ CloseHandle(handle_to_sniff);
+ CloseHandle(handle_from_sniff);
+ WaitForSingleObject(sniffemacs_handle, 1000L);
+ CloseHandle(sniffemacs_handle);
+ sniffemacs_handle = NULL;
+ WaitForSingleObject(readthread_handle, 1000L);
+ readthread_handle = NULL;
+ CloseHandle(hBufferMutex);
+ hBufferMutex = NULL;
+ SNIFF_TRACE_CLOSE;
+#else
+ close(fd_to_sniff);
+ close(fd_from_sniff);
+ wait(NULL);
+#endif
+ }
+ else
+ {
+#ifdef WIN32
+ _sleep(2);
+ if (!sniff_request_processed)
+ ProcessSniffRequests();
+#else
+ sleep(2); /* Incoming msg could disturb edit */
+#endif
+ sniff_will_disconnect = 1; /* We expect disconnect msg in 2 secs */
+ }
+}
+
+
+/* ConnectToSniffEmacs
+ * Connect to Sniff: returns 1 on error
+ */
+ static int
+ConnectToSniffEmacs()
+{
+#ifdef WIN32 /* Windows Version of the Code */
+ HANDLE ToSniffEmacs[2], FromSniffEmacs[2];
+ SECURITY_ATTRIBUTES sa;
+
+ sa.nLength = sizeof(sa);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ if (! CreatePipe(&ToSniffEmacs[0], &ToSniffEmacs[1], &sa, 0))
+ return 1;
+ if (! CreatePipe(&FromSniffEmacs[0], &FromSniffEmacs[1], &sa, 0))
+ return 1;
+
+ sniffemacs_handle = ExecuteDetachedProgram(SniffEmacs[0], SniffEmacs[0],
+ ToSniffEmacs[0], FromSniffEmacs[1]);
+
+ if (sniffemacs_handle)
+ {
+ handle_to_sniff = ToSniffEmacs[1];
+ handle_from_sniff = FromSniffEmacs[0];
+ sniff_connected = 1;
+ hBufferMutex = CreateMutex(
+ NULL, /* no security attributes */
+ FALSE, /* initially not owned */
+ "SniffReadBufferMutex"); /* name of mutex */
+ if (hBufferMutex == NULL)
+ {
+ /* Check for error. */
+ }
+ readthread_handle = (HANDLE)_beginthread(SniffEmacsReadThread, 0, NULL);
+ return 0;
+ }
+ else
+ {
+ /* error in spawn() */
+ return 1;
+ }
+
+#else /* UNIX Version of the Code */
+ int ToSniffEmacs[2], FromSniffEmacs[2];
+
+ pipe(ToSniffEmacs);
+ pipe(FromSniffEmacs);
+
+ /* fork */
+ if ((sniffemacs_pid=fork()) == 0)
+ {
+ /* child */
+
+ /* prepare communication pipes */
+ close(ToSniffEmacs[1]);
+ close(FromSniffEmacs[0]);
+
+ dup2(ToSniffEmacs[0],fileno(stdin)); /* write to ToSniffEmacs[1] */
+ dup2(FromSniffEmacs[1],fileno(stdout));/* read from FromSniffEmacs[0] */
+
+ close(ToSniffEmacs[0]);
+ close(FromSniffEmacs[1]);
+
+ /* start sniffemacs */
+ execvp (SniffEmacs[0], SniffEmacs);
+ {
+/* FILE *out = fdopen(FromSniffEmacs[1], "w"); */
+ sleep(1);
+ fputs(_(msg_sniff_disconnect), stdout);
+ fflush(stdout);
+ sleep(3);
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_exit(1);
+#endif
+ exit(1);
+ }
+ return 1;
+ }
+ else if (sniffemacs_pid > 0)
+ {
+ /* parent process */
+ close(ToSniffEmacs[0]);
+ fd_to_sniff = ToSniffEmacs[1];
+ close(FromSniffEmacs[1]);
+ fd_from_sniff = FromSniffEmacs[0];
+ sniff_connected = 1;
+ return 0;
+ }
+ else /* error in fork() */
+ return 1;
+#endif /* UNIX Version of the Code */
+}
+
+
+/* HandleSniffRequest
+ * Handle one request from SNiFF+
+ */
+ static void
+HandleSniffRequest(buffer)
+ char *buffer;
+{
+ char VICommand[MAX_REQUEST_LEN];
+ char command;
+ char *arguments;
+ char *token;
+ char *argv[3];
+ int argc = 0;
+ buf_T *buf;
+
+ const char *SetTab = "set tabstop=%d";
+ const char *SelectBuf = "buf %s";
+ const char *DeleteBuf = "bd %s";
+ const char *UnloadBuf = "bun %s";
+ const char *GotoLine = "%d";
+
+ command = buffer[0];
+ arguments = &buffer[1];
+ token = strtok(arguments, sniff_rq_sep);
+ while(argc <3)
+ {
+ if (token)
+ {
+ argv[argc] = (char*)vim_strsave((char_u *)token);
+ token = strtok(0, sniff_rq_sep);
+ }
+ else
+ argv[argc] = strdup("");
+ argc++;
+ }
+
+ switch (command)
+ {
+ case 'o' : /* visit file at char pos */
+ case 'O' : /* visit file at line number */
+ {
+ char *file = argv[0];
+ int position = atoi(argv[1]);
+
+ buf = vi_find_buffer(file);
+ setpcmark(); /* insert current pos in jump list [mark.c]*/
+ if (!buf)
+ vi_open_file(file);
+ else if (buf!=curbuf)
+ {
+ sprintf(VICommand, SelectBuf, file);
+ vi_exec_cmd(VICommand);
+ }
+ if (command == 'o')
+ vi_set_cursor_pos((long)position);
+ else
+ {
+ sprintf(VICommand, GotoLine, (int)position);
+ vi_exec_cmd(VICommand);
+ }
+ checkpcmark(); /* [mark.c] */
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_W32)
+ if (gui.in_use && !gui.in_focus) /* Raise Vim Window */
+ {
+# ifdef FEAT_GUI_W32
+ SetForegroundWindow(s_hwnd);
+# else
+ extern Widget vimShell;
+
+ XSetInputFocus(gui.dpy, XtWindow(vimShell), RevertToNone,
+ CurrentTime);
+ XRaiseWindow(gui.dpy, XtWindow(vimShell));
+# endif
+ }
+#endif
+ break;
+ }
+ case 'p' : /* path of file has changed */
+ /* when changing from shared to private WS (checkout) */
+ {
+ char *file = argv[0];
+ char *new_path = argv[1];
+
+ buf = vi_find_buffer(file);
+ if (buf && !buf->b_changed) /* delete buffer only if not modified */
+ {
+ sprintf(VICommand, DeleteBuf, file);
+ vi_exec_cmd(VICommand);
+ }
+ vi_open_file(new_path);
+ break;
+ }
+ case 'w' : /* writability has changed */
+ /* Sniff sends request twice,
+ * but only the last one is the right one */
+ {
+ char *file = argv[0];
+ int writable = atoi(argv[1]);
+
+ buf = vi_find_buffer(file);
+ if (buf)
+ {
+ buf->b_p_ro = !writable;
+ if (buf != curbuf)
+ {
+ buf->b_flags |= BF_CHECK_RO + BF_NEVERLOADED;
+ if (writable && !buf->b_changed)
+ {
+ sprintf(VICommand, UnloadBuf, file);
+ vi_exec_cmd(VICommand);
+ }
+ }
+ else if (writable && !buf->b_changed)
+ {
+ vi_exec_cmd("e");
+ }
+ }
+ break;
+ }
+ case 'h' : /* highlight info */
+ break; /* not implemented */
+
+ case 't' : /* Set tab width */
+ {
+ int tab_width = atoi(argv[1]);
+
+ if (tab_width > 0 && tab_width <= 16)
+ {
+ sprintf(VICommand, SetTab, tab_width);
+ vi_exec_cmd(VICommand);
+ }
+ break;
+ }
+ case '|':
+ {
+ /* change the request separator */
+ sniff_rq_sep[0] = arguments[0];
+ /* echo the request */
+ WriteToSniff(buffer);
+ break;
+ }
+ case 'A' : /* Warning/Info msg */
+ vi_msg(arguments);
+ if (!strncmp(arguments, "Disconnected", 12)) /* "Disconnected ..." */
+ sniff_disconnect(1); /* unexpected disconnection */
+ break;
+ case 'a' : /* Error msg */
+ vi_error_msg(arguments);
+ if (!strncmp(arguments, "Cannot connect", 14)) /* "Cannot connect ..." */
+ sniff_disconnect(1);
+ break;
+
+ default :
+ break;
+ }
+ while(argc)
+ vim_free(argv[--argc]);
+}
+
+
+#ifndef WIN32
+/* get_request
+ * read string from fd up to next newline (excluding the nl),
+ * returns length of string
+ * 0 if no data available or no complete line
+ * <0 on error
+ */
+ static int
+get_request(fd, buf, maxlen)
+ int fd;
+ char *buf;
+ int maxlen;
+{
+ static char inbuf[1024];
+ static int pos = 0, bytes = 0;
+ int len;
+#ifdef HAVE_SELECT
+ struct timeval tval;
+ fd_set rfds;
+
+ FD_ZERO(&rfds);
+ FD_SET(fd, &rfds);
+ tval.tv_sec = 0;
+ tval.tv_usec = 0;
+#else
+ struct pollfd fds;
+
+ fds.fd = fd;
+ fds.events = POLLIN;
+#endif
+
+ for (len = 0; len < maxlen; len++)
+ {
+ if (pos >= bytes) /* end of buffer reached? */
+ {
+#ifdef HAVE_SELECT
+ if (select(fd + 1, &rfds, NULL, NULL, &tval) > 0)
+#else
+ if (poll(&fds, 1, 0) > 0)
+#endif
+ {
+ pos = 0;
+ bytes = read(fd, inbuf, sizeof(inbuf));
+ if (bytes <= 0)
+ return bytes;
+ }
+ else
+ {
+ pos = pos-len;
+ buf[0] = '\0';
+ return 0;
+ }
+ }
+ if ((buf[len] = inbuf[pos++]) =='\n')
+ break;
+ }
+ buf[len] = '\0';
+ return len;
+}
+#endif /* WIN32 */
+
+
+ static void
+SendRequest(command, symbol)
+ struct sn_cmd *command;
+ char *symbol;
+{
+ int cmd_type = command->cmd_type;
+ static char cmdstr[MAX_REQUEST_LEN];
+ static char msgtxt[MAX_REQUEST_LEN];
+ char *buffer_name = NULL;
+
+ if (cmd_type == RQ_CONNECT)
+ {
+ sniff_connect();
+ return;
+ }
+ if (!sniff_connected && !(cmd_type & SILENT))
+ {
+ vi_error_msg(_("E278: SNiFF+ not connected"));
+ return;
+ }
+
+ if (cmd_type & NEED_FILE)
+ {
+ if (!curbuf->b_sniff)
+ {
+ if (!(cmd_type & SILENT))
+ vi_error_msg(_("E279: Not a SNiFF+ buffer"));
+ return;
+ }
+ buffer_name = vi_buffer_name();
+ if (buffer_name == NULL)
+ return;
+ if (cmd_type & NEED_SYMBOL)
+ {
+ if (cmd_type & EMPTY_SYMBOL)
+ symbol = " ";
+ else if (!symbol && !(symbol = vi_symbol_under_cursor()))
+ return; /* error msg already displayed */
+ }
+
+ if (symbol)
+ sprintf(cmdstr, "%c%s%s%ld%s%s\n",
+ command->cmd_code,
+ buffer_name,
+ sniff_rq_sep,
+ vi_cursor_pos(),
+ sniff_rq_sep,
+ symbol
+ );
+ else
+ sprintf(cmdstr, "%c%s\n", command->cmd_code, buffer_name);
+ }
+ else /* simple request */
+ {
+ cmdstr[0] = command->cmd_code;
+ cmdstr[1] = '\n';
+ cmdstr[2] = '\0';
+ }
+ if (command->cmd_msg && !(cmd_type & SILENT))
+ {
+ if ((cmd_type & NEED_SYMBOL) && !(cmd_type & EMPTY_SYMBOL))
+ {
+ sprintf(msgtxt, "%s: %s", _(command->cmd_msg), symbol);
+ vi_msg(msgtxt);
+ }
+ else
+ vi_msg(_(command->cmd_msg));
+ }
+ WriteToSniff(cmdstr);
+ if (cmd_type & DISCONNECT)
+ sniff_disconnect(0);
+}
+
+
+
+ static void
+WriteToSniff(str)
+ char *str;
+{
+ int bytes;
+#ifdef WIN32
+ if (! WriteFile(handle_to_sniff, str, strlen(str), &bytes, NULL))
+ {
+ DWORD err=GetLastError();
+ bytes = -1;
+ }
+#else
+ bytes = write(fd_to_sniff, str, strlen(str));
+#endif
+ if (bytes<0)
+ {
+ vi_msg(_("Sniff: Error during write. Disconnected"));
+ sniff_disconnect(1);
+ }
+}
+
+/*-------- vim helping functions --------------------------------*/
+
+ static void
+vi_msg(str)
+ char *str;
+{
+ if (str != NULL && *str != NUL)
+ MSG((char_u *)str);
+}
+
+ static void
+vi_error_msg(str)
+ char *str;
+{
+ if (str != NULL && *str != NUL)
+ EMSG((char_u *)str);
+}
+
+ static void
+vi_open_file(fname)
+ char *fname;
+{
+ ++no_wait_return;
+ do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF);
+ curbuf->b_sniff = TRUE;
+ --no_wait_return; /* [ex_docmd.c] */
+}
+
+ static buf_T *
+vi_find_buffer(fname)
+ char *fname;
+{ /* derived from buflist_findname() [buffer.c] */
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_sfname != NULL && fnamecmp(fname, buf->b_sfname) == 0)
+ return (buf);
+ return NULL;
+}
+
+
+ static char *
+vi_symbol_under_cursor()
+{
+ int len;
+ char *symbolp;
+ char *p;
+ static char sniff_symbol[256];
+
+ len = find_ident_under_cursor((char_u **)&symbolp, FIND_IDENT);
+ /* [normal.c] */
+ if (len <= 0)
+ return NULL;
+ for (p=sniff_symbol; len; len--)
+ *p++ = *symbolp++;
+ *p = '\0';
+ return sniff_symbol;
+}
+
+
+ static char *
+vi_buffer_name()
+{
+ return (char *)curbuf->b_sfname;
+}
+
+ static void
+vi_exec_cmd(vicmd)
+ char *vicmd;
+{
+ do_cmdline_cmd((char_u *)vicmd); /* [ex_docmd.c] */
+}
+
+/*
+ * Set cursor on character position
+ * derived from cursor_pos_info() [buffer.c]
+ */
+ static void
+vi_set_cursor_pos(char_pos)
+ long char_pos;
+{
+ linenr_T lnum;
+ long char_count = 1; /* first position = 1 */
+ int line_size;
+ int eol_size;
+
+ if (char_pos == 0)
+ {
+ char_pos = 1;
+ }
+ if (get_fileformat(curbuf) == EOL_DOS)
+ eol_size = 2;
+ else
+ eol_size = 1;
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ line_size = STRLEN(ml_get(lnum)) + eol_size;
+ if (char_count+line_size > char_pos) break;
+ char_count += line_size;
+ }
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = char_pos - char_count;
+}
+
+ static long
+vi_cursor_pos()
+{
+ linenr_T lnum;
+ long char_count=1; /* sniff starts with pos 1 */
+ int line_size;
+ int eol_size;
+
+ if (curbuf->b_p_tx)
+ eol_size = 2;
+ else
+ eol_size = 1;
+ for (lnum = 1; lnum < curwin->w_cursor.lnum; ++lnum)
+ {
+ line_size = STRLEN(ml_get(lnum)) + eol_size;
+ char_count += line_size;
+ }
+ return char_count + curwin->w_cursor.col;
+}
diff --git a/src/if_sniff.h b/src/if_sniff.h
new file mode 100644
index 000000000..901b06a63
--- /dev/null
+++ b/src/if_sniff.h
@@ -0,0 +1,18 @@
+/*
+ * if_sniff.h Interface between Vim and SNiFF+
+ *
+ * $Id$
+ */
+
+#ifndef __if_sniff_h__
+#define __if_sniff_h__
+
+extern int want_sniff_request;
+extern int sniff_request_waiting;
+extern int sniff_connected;
+extern int fd_from_sniff;
+extern void sniff_disconnect __ARGS((int immediately));
+extern void ProcessSniffRequests __ARGS((void));
+extern void ex_sniff __ARGS((exarg_T *eap));
+
+#endif
diff --git a/src/if_tcl.c b/src/if_tcl.c
new file mode 100644
index 000000000..61b1fb9da
--- /dev/null
+++ b/src/if_tcl.c
@@ -0,0 +1,2118 @@
+/* vi:set ts=8 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Tcl extensions by Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+ * Last modification: Wed May 10 21:28:44 CEST 2000
+ * Requires Tcl 8.0 or higher.
+ *
+ * Variables:
+ * ::vim::current(buffer) # Name of buffer command for current buffer.
+ * ::vim::current(window) # Name of window command for current window.
+ * ::vim::range(start) # Start of current range (line number).
+ * ::vim::range(end) # End of current range (line number).
+ * ::vim::lbase # Start of line/column numbers (1 or 0).
+ *
+ * Commands:
+ * ::vim::command {cmd} # Execute ex command {cmd}.
+ * ::vim::option {opt} [val] # Get/Set option {opt}.
+ * ::vim::expr {expr} # Evaluate {expr} using vim's evaluator.
+ * ::vim::beep # Guess.
+ *
+ * set buf [::vim::buffer {n}] # Create Tcl command for buffer N.
+ * set bl [::vim::buffer list] # Get list of Tcl commands of all buffers.
+ * ::vim::buffer exists {n} # True if buffer {n} exists.
+ *
+ * set wl [::vim::window list] # Get list of Tcl commands of all windows.
+ *
+ * set n [$win height] # Report window height.
+ * $win height {n} # Set window height to {n}.
+ * array set pos [$win cursor] # Get cursor position.
+ * $win cursor {row} {col} # Set cursor position.
+ * $win cursor pos # Set cursor position from array var "pos"
+ * $win delcmd {cmd} # Register callback command for closed window.
+ * $win option {opt} [val] # Get/Set vim option in context of $win.
+ * $win command {cmd} # Execute ex command in context of $win.
+ * $win expr {expr} # Evaluate vim expression in context of $win.
+ * set buf [$win buffer] # Create Tcl command for window's buffer.
+ *
+ * $buf name # Reports file name in buffer.
+ * $buf number # Reports buffer number.
+ * set l [$buf get {n}] # Get buffer line {n} as a string.
+ * set L [$buf get {n} {m}] # Get lines {n} through {m} as a list.
+ * $buf count # Reports number of lines in buffer.
+ * $buf last # Reports number of last line in buffer.
+ * $buf delete {n} # Delete line {n}.
+ * $buf delete {n} {m} # Delete lines {n} through {m}.
+ * $buf set {n} {l} # Set line {n} to string {l}.
+ * $buf set {n} {m} {L} # Set lines {n} through {m} from list {L}.
+ * # Delete/inserts lines as appropriate.
+ * $buf option {opt} [val] # Get/Set vim option in context of $buf.
+ * $buf command {cmd} # Execute ex command in context of $buf
+ * $buf expr {cmd} # Evaluate vim expression in context of $buf.
+ * array set pos [$buf mark {m}] # Get position of mark.
+ * $buf append {n} {str} # Append string {str} to buffer,after line {n}.
+ * $buf insert {n} {str} # Insert string {str} in buffer as line {n}.
+ * $buf delcmd {cmd} # Register callback command for deleted buffer.
+ * set wl [$buf windows] # Get list of Tcl commands for all windows of
+ * # this buffer.
+TODO:
+ * ::vim::buffer new # create new buffer + Tcl command
+ */
+
+#include "vim.h"
+#undef EXTERN /* tcl.h defines it too */
+
+#ifdef DYNAMIC_TCL
+# define USE_TCL_STUBS /* use tcl's stubs mechanism */
+#endif
+
+#include <tcl.h>
+#include <errno.h>
+#include <string.h>
+
+typedef struct
+{
+ Tcl_Interp *interp;
+ int range_start, range_end;
+ int lbase;
+ char *curbuf, *curwin;
+} tcl_info;
+
+static tcl_info tclinfo = { NULL, 0, 0, 0, NULL, NULL };
+
+#define VAR_RANGE1 "::vim::range(start)"
+#define VAR_RANGE2 "::vim::range(begin)"
+#define VAR_RANGE3 "::vim::range(end)"
+#define VAR_CURBUF "::vim::current(buffer)"
+#define VAR_CURWIN "::vim::current(window)"
+#define VAR_LBASE "::vim::lbase"
+#define VAR_CURLINE "line"
+#define VAR_CURLNUM "lnum"
+#define VARNAME_SIZE 64
+
+#define row2tcl(x) ((x) - (tclinfo.lbase==0))
+#define row2vim(x) ((x) + (tclinfo.lbase==0))
+#define col2tcl(x) ((x) + (tclinfo.lbase!=0))
+#define col2vim(x) ((x) - (tclinfo.lbase!=0))
+
+
+#define VIMOUT ((ClientData)1)
+#define VIMERR ((ClientData)2)
+
+/*
+ * List of Tcl interpreters who reference a vim window or buffer.
+ * Each buffer and window has it's own list in the tcl_ref struct member.
+ * We need this because Tcl can create sub-interpreters with the "interp"
+ * command, and each interpreter can reference all windows and buffers.
+ */
+struct ref
+{
+ struct ref *next;
+
+ Tcl_Interp *interp;
+ Tcl_Command cmd; /* Tcl command that represents this object */
+ Tcl_Obj *delcmd; /* Tcl command to call when object is being del. */
+ void *vimobj; /* Vim window or buffer (win_T* or buf_T*) */
+};
+static char * tclgetbuffer _ANSI_ARGS_((Tcl_Interp *interp, buf_T *buf));
+static char * tclgetwindow _ANSI_ARGS_((Tcl_Interp *interp, win_T *win));
+static int tclsetdelcmd _ANSI_ARGS_((Tcl_Interp *interp, struct ref *reflist, void *vimobj, Tcl_Obj *delcmd));
+static int tclgetlinenum _ANSI_ARGS_ ((Tcl_Interp *interp, Tcl_Obj *obj, int *valueP, buf_T *buf));
+static win_T *tclfindwin _ANSI_ARGS_ ((buf_T *buf));
+static int tcldoexcommand _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn));
+static int tclsetoption _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn));
+static int tclvimexpr _ANSI_ARGS_ ((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int objn));
+static void tcldelthisinterp _ANSI_ARGS_ ((void));
+
+static int vimerror _ANSI_ARGS_((Tcl_Interp *interp));
+static void tclmsg _ANSI_ARGS_((char *text));
+static void tclerrmsg _ANSI_ARGS_((char *text));
+static void tclupdatevars _ANSI_ARGS_((void));
+
+static struct ref refsdeleted; /* dummy object for deleted ref list */
+
+/*****************************************************************************
+ * TCL interface manager
+ ****************************************************************************/
+
+#if defined(DYNAMIC_TCL) || defined(PROTO)
+# ifndef DYNAMIC_TCL_DLL
+# define DYNAMIC_TCL_DLL "tcl83.dll"
+# endif
+# ifndef DYNAMIC_TCL_VER
+# define DYNAMIC_TCL_VER "8.3"
+# endif
+
+# ifndef DYNAMIC_TCL /* Just generating prototypes */
+typedef int HANDLE;
+# endif
+
+/*
+ * Declare HANDLE for perl.dll and function pointers.
+ */
+static HANDLE hTclLib = NULL;
+Tcl_Interp* (*dll_Tcl_CreateInterp)();
+
+/*
+ * Table of name to function pointer of tcl.
+ */
+#define TCL_PROC FARPROC
+static struct {
+ char* name;
+ TCL_PROC* ptr;
+} tcl_funcname_table[] = {
+ {"Tcl_CreateInterp", (TCL_PROC*)&dll_Tcl_CreateInterp},
+ {NULL, NULL},
+};
+
+/*
+ * Make all runtime-links of tcl.
+ *
+ * 1. Get module handle using LoadLibraryEx.
+ * 2. Get pointer to perl function by GetProcAddress.
+ * 3. Repeat 2, until get all functions will be used.
+ *
+ * Parameter 'libname' provides name of DLL.
+ * Return OK or FAIL.
+ */
+ static int
+tcl_runtime_link_init(char *libname, int verbose)
+{
+ int i;
+
+ if (hTclLib)
+ return OK;
+ if (!(hTclLib = LoadLibraryEx(libname, NULL, 0)))
+ {
+ if (verbose)
+ EMSG2(_(e_loadlib), libname);
+ return FAIL;
+ }
+ for (i = 0; tcl_funcname_table[i].ptr; ++i)
+ {
+ if (!(*tcl_funcname_table[i].ptr = GetProcAddress(hTclLib,
+ tcl_funcname_table[i].name)))
+ {
+ FreeLibrary(hTclLib);
+ hTclLib = NULL;
+ if (verbose)
+ EMSG2(_(e_loadfunc), tcl_funcname_table[i].name);
+ return FAIL;
+ }
+ }
+ return OK;
+}
+#endif /* defined(DYNAMIC_TCL) || defined(PROTO) */
+
+#ifdef DYNAMIC_TCL
+static char *find_executable_arg = NULL;
+#endif
+
+ void
+vim_tcl_init(arg)
+ char *arg;
+{
+#ifndef DYNAMIC_TCL
+ Tcl_FindExecutable(arg);
+#else
+ find_executable_arg = arg;
+#endif
+}
+
+#if defined(DYNAMIC_TCL) || defined(PROTO)
+
+static int stubs_initialized = FALSE;
+
+/*
+ * Return TRUE if the TCL interface can be used.
+ */
+ int
+tcl_enabled(verbose)
+ int verbose;
+{
+ if (!stubs_initialized && find_executable_arg != NULL
+ && tcl_runtime_link_init(DYNAMIC_TCL_DLL, verbose) == OK)
+ {
+ Tcl_Interp *interp;
+
+ if (interp = dll_Tcl_CreateInterp())
+ {
+ if (Tcl_InitStubs(interp, DYNAMIC_TCL_VER, 0))
+ {
+ Tcl_FindExecutable(find_executable_arg);
+ Tcl_DeleteInterp(interp);
+ stubs_initialized = TRUE;
+ }
+ /* FIXME: When Tcl_InitStubs() was failed, how delete interp? */
+ }
+ }
+ return stubs_initialized;
+}
+#endif
+
+ void
+tcl_end()
+{
+#ifdef DYNAMIC_TCL
+ if (hTclLib)
+ {
+ FreeLibrary(hTclLib);
+ hTclLib = NULL;
+ }
+#endif
+}
+
+/****************************************************************************
+ Tcl commands
+ ****************************************************************************/
+
+/*
+ * Replace standard "exit" and "catch" commands.
+ *
+ * This is a design flaw in Tcl - the standard "exit" command just calls
+ * exit() and kills the application. It should return TCL_EXIT to the
+ * app, which then decides if it wants to terminate or not. In our case,
+ * we just delete the Tcl interpreter (and create a new one with the next
+ * :tcl command).
+ */
+#define TCL_EXIT 5
+
+/* ARGSUSED */
+ static int
+exitcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ int value = 0;
+
+ switch (objc)
+ {
+ case 2:
+ if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK)
+ break;
+ /* FALLTHROUGH */
+ case 1:
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(value));
+ return TCL_EXIT;
+ default:
+ Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
+ }
+ return TCL_ERROR;
+}
+
+/* ARGSUSED */
+ static int
+catchcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ char *varname = NULL;
+ int result;
+
+ switch (objc)
+ {
+ case 3:
+ varname = Tcl_GetStringFromObj(objv[2], NULL);
+ /* fallthrough */
+ case 2:
+ Tcl_ResetResult(interp);
+ Tcl_AllowExceptions(interp);
+ result = Tcl_EvalObj(interp, objv[1]);
+ if (result == TCL_EXIT)
+ return result;
+ if (varname)
+ {
+ if (Tcl_SetVar(interp, varname, Tcl_GetStringResult(interp), 0) == NULL)
+ {
+ Tcl_SetResult(interp, "couldn't save command result in variable", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
+ return TCL_OK;
+ default:
+ Tcl_WrongNumArgs(interp, 1, objv, "command ?varName?");
+ }
+ return TCL_ERROR;
+}
+
+/*
+ * "::vim::beep" - what Vi[m] does best :-)
+ */
+/* ARGSUSED */
+ static int
+beepcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ if (objc != 1)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
+ vim_beep();
+ return TCL_OK;
+}
+
+/*
+ * "::vim::buffer list" - create a list of buffer commands.
+ * "::vim::bufffer {N}" - create buffer command for buffer N.
+ * "::vim::buffer new" - create a new buffer (not implemented)
+ */
+/* ARGSUSED */
+ static int
+buffercmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ char *name;
+ buf_T *buf;
+ Tcl_Obj *resobj;
+ int err, n, idx;
+
+ enum {BCMD_EXISTS, BCMD_LIST};
+ static char *bcmdoptions[] =
+ {
+ "exists", "list", (char *)0
+ };
+
+ if (objc < 2)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, "option");
+ return TCL_ERROR;
+ }
+ err = Tcl_GetIntFromObj(interp, objv[1], &n);
+ if (err == TCL_OK)
+ {
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, "bufNumber");
+ return TCL_ERROR;
+ }
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (buf->b_fnum == n)
+ {
+ name = tclgetbuffer(interp, buf);
+ if (name == NULL)
+ return TCL_ERROR;
+ Tcl_SetResult(interp, name, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ }
+ Tcl_SetResult(interp, _("invalid buffer number"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ Tcl_ResetResult(interp); /* clear error from Tcl_GetIntFromObj */
+
+ err = Tcl_GetIndexFromObj(interp, objv[1], bcmdoptions, "option", 0, &idx);
+ if (err != TCL_OK)
+ return err;
+ switch (idx)
+ {
+ case BCMD_LIST:
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "");
+ err = TCL_ERROR;
+ break;
+ }
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ name = tclgetbuffer(interp, buf);
+ if (name == NULL)
+ {
+ err = TCL_ERROR;
+ break;
+ }
+ Tcl_AppendElement(interp, name);
+ }
+ break;
+
+ case BCMD_EXISTS:
+ if (objc != 3)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "bufNumber");
+ err = TCL_ERROR;
+ break;
+ }
+ err = Tcl_GetIntFromObj(interp, objv[2], &n);
+ if (err == TCL_OK)
+ {
+ buf = buflist_findnr(n);
+ resobj = Tcl_NewIntObj(buf != NULL);
+ Tcl_SetObjResult(interp, resobj);
+ }
+ break;
+
+ default:
+ Tcl_SetResult(interp, _("not implemented yet"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ return err;
+}
+
+/*
+ * "::vim::window list" - create list of window commands.
+ */
+/* ARGSUSED */
+ static int
+windowcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ char *what, *string;
+ win_T *win;
+
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, "option");
+ return TCL_ERROR;
+ }
+ what = Tcl_GetStringFromObj(objv[1], NULL);
+ if (strcmp(what, "list") == 0)
+ {
+ FOR_ALL_WINDOWS(win)
+ {
+ string = tclgetwindow(interp, win);
+ if (string == NULL)
+ return TCL_ERROR;
+ Tcl_AppendElement(interp, string);
+ }
+ return TCL_OK;
+ }
+ Tcl_SetResult(interp, _("unknown option"), TCL_STATIC);
+ return TCL_ERROR;
+}
+
+/*
+ * flags for bufselfcmd and winselfcmd to indicate outstanding actions.
+ */
+#define FL_UPDATE_SCREEN (1<<0)
+#define FL_UPDATE_CURBUF (1<<1)
+#define FL_ADJUST_CURSOR (1<<2)
+
+/*
+ * This function implements the buffer commands.
+ */
+ static int
+bufselfcmd(ref, interp, objc, objv)
+ ClientData ref;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ int opt, err, idx, flags;
+ int val1, val2, n, i;
+ buf_T *buf, *savebuf;
+ win_T *win, *savewin;
+ Tcl_Obj *resobj;
+ pos_T *pos;
+ char *line;
+
+ enum
+ {
+ BUF_APPEND, BUF_COMMAND, BUF_COUNT, BUF_DELCMD, BUF_DELETE, BUF_EXPR,
+ BUF_GET, BUF_INSERT, BUF_LAST, BUF_MARK, BUF_NAME, BUF_NUMBER,
+ BUF_OPTION, BUF_SET, BUF_WINDOWS
+ };
+ static char *bufoptions[] =
+ {
+ "append", "command", "count", "delcmd", "delete", "expr",
+ "get", "insert", "last", "mark", "name", "number",
+ "option", "set", "windows", (char *)0
+ };
+
+ if (objc < 2)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ err = Tcl_GetIndexFromObj(interp, objv[1], bufoptions, "option", 0, &idx);
+ if (err != TCL_OK)
+ return err;
+
+ buf = (buf_T *)((struct ref *)ref)->vimobj;
+ savebuf = curbuf; curbuf = buf;
+ savewin = curwin; curwin = tclfindwin(buf);
+ flags = 0;
+ opt = 0;
+
+ switch (idx)
+ {
+ case BUF_COMMAND:
+ err = tcldoexcommand(interp, objc, objv, 2);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ case BUF_OPTION:
+ err = tclsetoption(interp, objc, objv, 2);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ case BUF_EXPR:
+ err = tclvimexpr(interp, objc, objv, 2);
+ break;
+
+ case BUF_NAME:
+ /*
+ * Get filename of buffer.
+ */
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ err = TCL_ERROR;
+ break;
+ }
+ if (buf->b_ffname)
+ Tcl_SetResult(interp, (char *)buf->b_ffname, TCL_VOLATILE);
+ else
+ Tcl_SetResult(interp, "", TCL_STATIC);
+ break;
+
+ case BUF_LAST:
+ /*
+ * Get line number of last line.
+ */
+ opt = 1;
+ /* fallthrough */
+ case BUF_COUNT:
+ /*
+ * Get number of lines in buffer.
+ */
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ err = TCL_ERROR;
+ break;
+ }
+ val1 = (int)buf->b_ml.ml_line_count;
+ if (opt)
+ val1 = row2tcl(val1);
+
+ resobj = Tcl_NewIntObj(val1);
+ Tcl_SetObjResult(interp, resobj);
+ break;
+
+ case BUF_NUMBER:
+ /*
+ * Get buffer's number.
+ */
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ err = TCL_ERROR;
+ break;
+ }
+ resobj = Tcl_NewIntObj((int)buf->b_fnum);
+ Tcl_SetObjResult(interp, resobj);
+ break;
+
+ case BUF_GET:
+ if (objc != 3 && objc != 4)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "lineNumber ?lineNumber?");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclgetlinenum(interp, objv[2], &val1, buf);
+ if (err != TCL_OK)
+ break;
+ if (objc == 4)
+ {
+ err = tclgetlinenum(interp, objv[3], &val2, buf);
+ if (err != TCL_OK)
+ break;
+ if (val1 > val2)
+ {
+ n = val1; val1 = val2; val2 = n;
+ }
+ Tcl_ResetResult(interp);
+
+ for (n = val1; n <= val2 && err == TCL_OK; n++)
+ {
+ line = (char *)ml_get_buf(buf, (linenr_T)n, FALSE);
+ if (line)
+ Tcl_AppendElement(interp, line);
+ else
+ err = TCL_ERROR;
+ }
+ }
+ else { /* objc == 3 */
+ line = (char *)ml_get_buf(buf, (linenr_T)val1, FALSE);
+ Tcl_SetResult(interp, line, TCL_VOLATILE);
+ }
+ break;
+
+ case BUF_SET:
+ if (objc != 4 && objc != 5)
+ {
+ Tcl_WrongNumArgs(interp, 3, objv, "lineNumber ?lineNumber? stringOrList");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclgetlinenum(interp, objv[2], &val1, buf);
+ if (err != TCL_OK)
+ return TCL_ERROR;
+ if (objc == 4)
+ {
+ /*
+ * Replace one line with a string.
+ * $buf set {n} {string}
+ */
+ line = Tcl_GetStringFromObj(objv[3], NULL);
+ if (u_savesub((linenr_T)val1) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot save undo information"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ else
+ if (ml_replace((linenr_T)val1, (char_u *)line, TRUE) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot replace line"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ else
+ {
+ changed_bytes((linenr_T)val1, 0);
+ flags |= FL_UPDATE_CURBUF;
+ }
+ break;
+ }
+ else
+ {
+ /*
+ * Replace several lines with the elements of a Tcl list.
+ * $buf set {n} {m} {list}
+ * If the list contains more than {m}-{n}+1 elements, they
+ * are * inserted after line {m}. If the list contains fewer
+ * elements, * the lines from {n}+length({list}) through {m}
+ * are deleted.
+ */
+ int lc;
+ Tcl_Obj **lv;
+
+ err = tclgetlinenum(interp, objv[3], &val2, buf);
+ if (err != TCL_OK)
+ break;
+ err = Tcl_ListObjGetElements(interp, objv[4], &lc, &lv);
+ if (err != TCL_OK)
+ break;
+ if (val1 > val2)
+ {
+ n = val1;
+ val1 = val2;
+ val2 = n;
+ }
+
+ n = val1;
+ if (u_save((linenr_T)(val1 - 1), (linenr_T)(val2 + 1)) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot save undo information"),
+ TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ flags |= FL_UPDATE_CURBUF;
+
+ for (i = 0; i < lc && n <= val2; i++)
+ {
+ line = Tcl_GetStringFromObj(lv[i], NULL);
+ if (ml_replace((linenr_T)n, (char_u *)line, TRUE) != OK)
+ goto setListError;
+ ++n;
+ }
+ if (i < lc)
+ {
+ /* append lines */
+ do
+ {
+ line = Tcl_GetStringFromObj(lv[i], NULL);
+ if (ml_append((linenr_T)(n - 1),
+ (char_u *)line, 0, FALSE) != OK)
+ goto setListError;
+ ++n;
+ ++i;
+ } while (i < lc);
+ }
+ else if (n <= val2)
+ {
+ /* did not replace all lines, delete */
+ i = n;
+ do
+ {
+ if (ml_delete((linenr_T)i, FALSE) != OK)
+ goto setListError;
+ ++n;
+ } while (n <= val2);
+ }
+ lc -= val2 - val1 + 1; /* number of lines to be replaced */
+ mark_adjust((linenr_T)val1, (linenr_T)val2, (long)MAXLNUM,
+ (long)lc);
+ changed_lines((linenr_T)val1, 0, (linenr_T)val2 + 1, (long)lc);
+ break;
+ setListError:
+ u_undo(1); /* ??? */
+ Tcl_SetResult(interp, _("cannot set line(s)"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ break;
+
+ case BUF_DELETE:
+ if (objc != 3 && objc != 4)
+ {
+ Tcl_WrongNumArgs(interp, 3, objv, "lineNumber ?lineNumber?");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclgetlinenum(interp, objv[2], &val1, buf);
+ if (err != TCL_OK)
+ break;
+ val2 = val1;
+ if (objc == 4)
+ {
+ err = tclgetlinenum(interp, objv[3], &val2, buf);
+ if (err != TCL_OK)
+ return err;
+ if (val1 > val2)
+ {
+ i = val1; val1 = val2; val2 = i;
+ }
+ }
+ n = val2 - val1 + 1;
+ if (u_savedel((linenr_T)val1, (long)n) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot save undo information"),
+ TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ for (i = 0; i < n; i++)
+ {
+ ml_delete((linenr_T)val1, FALSE);
+ err = vimerror(interp);
+ if (err != TCL_OK)
+ break;
+ }
+ if (i > 0)
+ deleted_lines_mark((linenr_T)val1, (long)i);
+ flags |= FL_ADJUST_CURSOR|FL_UPDATE_SCREEN;
+ break;
+
+ case BUF_MARK:
+ if (objc != 3)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "markName");
+ err = TCL_ERROR;
+ break;
+ }
+ line = Tcl_GetStringFromObj(objv[2], NULL);
+
+ pos = NULL;
+ if (line[0] != '\0' && line[1] == '\0')
+ {
+ pos = getmark(line[0], FALSE);
+ }
+ if (pos == NULL)
+ {
+ Tcl_SetResult(interp, _("invalid mark name"), TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ err = vimerror(interp);
+ if (err != TCL_OK)
+ break;
+ if (pos->lnum <= 0)
+ {
+ Tcl_SetResult(interp, _("mark not set"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ else
+ {
+ char rbuf[64];
+ sprintf(rbuf, _("row %d column %d"), (int)row2tcl(pos->lnum), (int)col2tcl(pos->col));
+ Tcl_SetResult(interp, rbuf, TCL_VOLATILE);
+ }
+ break;
+
+ case BUF_INSERT:
+ opt = 1;
+ /* fallthrough */
+ case BUF_APPEND:
+ if (objc != 4)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "lineNum text");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclgetlinenum(interp, objv[2], &val1, buf);
+ if (err != TCL_OK)
+ break;
+ if (opt)
+ --val1;
+ if (u_save((linenr_T)val1, (linenr_T)(val1+1)) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot save undo information"), TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+
+ line = Tcl_GetStringFromObj(objv[3], NULL);
+ if (ml_append((linenr_T)val1, (char_u *)line, 0, FALSE) != OK)
+ {
+ Tcl_SetResult(interp, _("cannot insert/append line"), TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ appended_lines_mark((linenr_T)val1, 1L);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ case BUF_WINDOWS:
+ /*
+ * Return list of window commands.
+ */
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ err = TCL_ERROR;
+ break;
+ }
+ Tcl_ResetResult(interp);
+ FOR_ALL_WINDOWS(win)
+ {
+ if (win->w_buffer == buf)
+ {
+ line = tclgetwindow(interp, win);
+ if (line != NULL)
+ Tcl_AppendElement(interp, line);
+ else
+ {
+ err = TCL_ERROR;
+ break;
+ }
+ }
+ }
+ break;
+
+ case BUF_DELCMD:
+ /*
+ * Register deletion callback.
+ * TODO: Should be able to register multiple callbacks
+ */
+ if (objc != 3)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "command");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclsetdelcmd(interp, buf->tcl_ref, (void *)buf, objv[2]);
+ break;
+
+ default:
+ Tcl_SetResult(interp, _("not implemented yet"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+
+ if (flags & FL_UPDATE_CURBUF)
+ redraw_curbuf_later(NOT_VALID);
+ curbuf = savebuf;
+ curwin = savewin;
+ if (flags & FL_ADJUST_CURSOR)
+ check_cursor();
+ if (flags & (FL_UPDATE_SCREEN | FL_UPDATE_CURBUF))
+ update_screen(NOT_VALID);
+
+ return err;
+}
+
+/*
+ * This function implements the window commands.
+ */
+ static int
+winselfcmd(ref, interp, objc, objv)
+ ClientData ref;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ int err, idx, flags;
+ int val1, val2;
+ Tcl_Obj *resobj;
+ win_T *savewin, *win;
+ buf_T *savebuf;
+ char *str;
+
+ enum
+ {
+ WIN_BUFFER, WIN_COMMAND, WIN_CURSOR, WIN_DELCMD, WIN_EXPR,
+ WIN_HEIGHT, WIN_OPTION
+ };
+ static char *winoptions[] =
+ {
+ "buffer", "command", "cursor", "delcmd", "expr",
+ "height", "option", (char *)0
+ };
+
+ if (objc < 2)
+ {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ err = Tcl_GetIndexFromObj(interp, objv[1], winoptions, "option", 0, &idx);
+ if (err != TCL_OK)
+ return TCL_ERROR;
+
+ win = (win_T *)((struct ref *)ref)->vimobj;
+ savewin = curwin; curwin = win;
+ savebuf = curbuf; curbuf = win->w_buffer;
+ flags = 0;
+
+ switch (idx)
+ {
+ case WIN_OPTION:
+ err = tclsetoption(interp, objc, objv, 2);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ case WIN_COMMAND:
+ err = tcldoexcommand(interp, objc, objv, 2);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ case WIN_EXPR:
+ err = tclvimexpr(interp, objc, objv, 2);
+ break;
+
+ case WIN_HEIGHT:
+ if (objc == 3)
+ {
+ err = Tcl_GetIntFromObj(interp, objv[2], &val1);
+ if (err != TCL_OK)
+ break;
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setheight(val1);
+ err = vimerror(interp);
+ if (err != TCL_OK)
+ break;
+ }
+ else
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "?value?");
+ err = TCL_ERROR;
+ break;
+ }
+
+ resobj = Tcl_NewIntObj((int)(win->w_height));
+ Tcl_SetObjResult(interp, resobj);
+ break;
+
+ case WIN_BUFFER:
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ err = TCL_ERROR;
+ break;
+ }
+ str = tclgetbuffer(interp, win->w_buffer);
+ if (str)
+ Tcl_SetResult(interp, str, TCL_VOLATILE);
+ else
+ err = TCL_ERROR;
+ break;
+
+ case WIN_DELCMD:
+ if (objc != 3)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "command");
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclsetdelcmd(interp, win->tcl_ref, (void *)win, objv[2]);
+ break;
+
+ case WIN_CURSOR:
+ if (objc > 4)
+ {
+ Tcl_WrongNumArgs(interp, 2, objv, "?arg1 ?arg2??");
+ err = TCL_ERROR;
+ break;
+ }
+ if (objc == 2)
+ {
+ char buf[64];
+ sprintf(buf, _("row %d column %d"), (int)row2tcl(win->w_cursor.lnum), (int)col2tcl(win->w_cursor.col));
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ break;
+ }
+ else if (objc == 3)
+ {
+ Tcl_Obj *part, *var;
+
+ part = Tcl_NewStringObj("row", -1);
+ var = Tcl_ObjGetVar2(interp, objv[2], part, TCL_LEAVE_ERR_MSG);
+ if (var == NULL)
+ {
+ err = TCL_ERROR;
+ break;
+ }
+ err = tclgetlinenum(interp, var, &val1, win->w_buffer);
+ if (err != TCL_OK)
+ break;
+ part = Tcl_NewStringObj("column", -1);
+ var = Tcl_ObjGetVar2(interp, objv[2], part, TCL_LEAVE_ERR_MSG);
+ if (var == NULL)
+ {
+ err = TCL_ERROR;
+ break;
+ }
+ err = Tcl_GetIntFromObj(interp, var, &val2);
+ if (err != TCL_OK)
+ break;
+ }
+ else { /* objc == 4 */
+ err = tclgetlinenum(interp, objv[2], &val1, win->w_buffer);
+ if (err != TCL_OK)
+ break;
+ err = Tcl_GetIntFromObj(interp, objv[3], &val2);
+ if (err != TCL_OK)
+ break;
+ }
+ /* TODO: should check column */
+ win->w_cursor.lnum = val1;
+ win->w_cursor.col = col2vim(val2);
+ flags |= FL_UPDATE_SCREEN;
+ break;
+
+ default:
+ Tcl_SetResult(interp, _("not implemented yet"), TCL_STATIC);
+ break;
+ }
+
+ curwin = savewin;
+ curbuf = savebuf;
+ if (flags & FL_UPDATE_SCREEN)
+ update_screen(NOT_VALID);
+
+ return err;
+}
+
+
+/* ARGSUSED */
+ static int
+commandcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ int err;
+
+ err = tcldoexcommand(interp, objc, objv, 1);
+ update_screen(VALID);
+ return err;
+}
+
+/* ARGSUSED */
+ static int
+optioncmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ int err;
+
+ err = tclsetoption(interp, objc, objv, 1);
+ update_screen(VALID);
+ return err;
+}
+
+/* ARGSUSED */
+ static int
+exprcmd(dummy, interp, objc, objv)
+ ClientData dummy;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ return tclvimexpr(interp, objc, objv, 1);
+}
+
+/****************************************************************************
+ Support functions for Tcl commands
+ ****************************************************************************/
+
+/*
+ * Get a line number from 'obj' and convert it to vim's range.
+ */
+ static int
+tclgetlinenum(interp, obj, valueP, buf)
+ Tcl_Interp *interp;
+ Tcl_Obj *obj;
+ int *valueP;
+ buf_T *buf;
+{
+ int err, i;
+
+ enum { LN_BEGIN, LN_BOTTOM, LN_END, LN_FIRST, LN_LAST, LN_START, LN_TOP };
+
+ static char *keyw[] =
+ {
+ "begin", "bottom", "end", "first", "last", "start", "top", (char *)0
+ };
+
+ err = Tcl_GetIndexFromObj(interp, obj, keyw, "", 0, &i);
+ if (err == TCL_OK)
+ {
+ switch (i)
+ {
+ case LN_BEGIN:
+ case LN_FIRST:
+ case LN_START:
+ case LN_TOP:
+ *valueP = 1;
+ break;
+ case LN_BOTTOM:
+ case LN_END:
+ case LN_LAST:
+ *valueP = buf->b_ml.ml_line_count;
+ break;
+ }
+ return TCL_OK;
+ }
+ Tcl_ResetResult(interp);
+
+ err = Tcl_GetIntFromObj(interp, obj, &i);
+ if (err != TCL_OK)
+ return err;
+ i = row2vim(i);
+ if (i < 1 || i > buf->b_ml.ml_line_count)
+ {
+ Tcl_SetResult(interp, _("line number out of range"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ *valueP = i;
+ return TCL_OK;
+}
+
+/*
+ * Find the first window in the window list that displays the buffer.
+ */
+ static win_T *
+tclfindwin(buf)
+ buf_T *buf;
+{
+ win_T *win;
+
+ FOR_ALL_WINDOWS(win)
+ {
+ if (win->w_buffer == buf)
+ return win;
+ }
+ return curwin; /* keep current window context */
+}
+
+/*
+ * Do-it-all function for "::vim::command", "$buf command" and "$win command".
+ */
+ static int
+tcldoexcommand(interp, objc, objv, objn)
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+ int objn;
+{
+ tcl_info saveinfo;
+ int err, flag, nobjs;
+ char *arg;
+
+ nobjs = objc - objn;
+ if (nobjs < 1 || nobjs > 2)
+ {
+ Tcl_WrongNumArgs(interp, objn, objv, "?-quiet? exCommand");
+ return TCL_ERROR;
+ }
+
+ flag = 0;
+ if (nobjs == 2)
+ {
+ arg = Tcl_GetStringFromObj(objv[objn], NULL);
+ if (strcmp(arg, "-quiet") == 0)
+ flag = 1;
+ else
+ {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, _("unknown flag: "), arg, (char *)0);
+ return TCL_ERROR;
+ }
+ ++objn;
+ }
+
+ memcpy(&saveinfo, &tclinfo, sizeof(tcl_info));
+ tclinfo.interp = NULL;
+ tclinfo.curwin = NULL;
+ tclinfo.curbuf = NULL;
+
+ arg = Tcl_GetStringFromObj(objv[objn], NULL);
+ if (flag)
+ ++emsg_off;
+ do_cmdline_cmd((char_u *)arg);
+ if (flag)
+ --emsg_off;
+ err = vimerror(interp);
+
+ /* If the ex command created a new Tcl interpreter, remove it */
+ if (tclinfo.interp)
+ tcldelthisinterp();
+ memcpy(&tclinfo, &saveinfo, sizeof(tcl_info));
+ tclupdatevars();
+
+ return err;
+}
+
+/*
+ * Do-it-all function for "::vim::option", "$buf option" and "$win option".
+ */
+ static int
+tclsetoption(interp, objc, objv, objn)
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+ int objn;
+{
+ int err, nobjs, idx;
+ char_u *option;
+ int isnum;
+ long lval;
+ char_u *sval;
+ Tcl_Obj *resobj;
+
+ enum { OPT_OFF, OPT_ON, OPT_TOGGLE };
+ static char *optkw[] = { "off", "on", "toggle", (char *)0 };
+
+ nobjs = objc - objn;
+ if (nobjs != 1 && nobjs != 2)
+ {
+ Tcl_WrongNumArgs(interp, objn, objv, "vimOption ?value?");
+ return TCL_ERROR;
+ }
+
+ option = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
+ ++objn;
+ isnum = get_option_value(option, &lval, &sval, 0);
+ err = TCL_OK;
+ switch (isnum)
+ {
+ case 0:
+ Tcl_SetResult(interp, (char *)sval, TCL_VOLATILE);
+ vim_free(sval);
+ break;
+ case 1:
+ resobj = Tcl_NewLongObj(lval);
+ Tcl_SetObjResult(interp, resobj);
+ break;
+ default:
+ Tcl_SetResult(interp, _("unknown vimOption"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ if (nobjs == 2)
+ {
+ if (isnum)
+ {
+ sval = NULL; /* avoid compiler warning */
+ err = Tcl_GetIndexFromObj(interp, objv[objn], optkw, "", 0, &idx);
+ if (err != TCL_OK)
+ {
+ Tcl_ResetResult(interp);
+ err = Tcl_GetLongFromObj(interp, objv[objn], &lval);
+ }
+ else
+ switch (idx)
+ {
+ case OPT_ON:
+ lval = 1;
+ break;
+ case OPT_OFF:
+ lval = 0;
+ break;
+ case OPT_TOGGLE:
+ lval = !lval;
+ break;
+ }
+ }
+ else
+ sval = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL);
+ if (err == TCL_OK)
+ {
+ set_option_value(option, lval, sval, OPT_LOCAL);
+ err = vimerror(interp);
+ }
+ }
+ return err;
+}
+
+/*
+ * Do-it-all function for "::vim::expr", "$buf expr" and "$win expr".
+ */
+ static int
+tclvimexpr(interp, objc, objv, objn)
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+ int objn;
+{
+#ifdef FEAT_EVAL
+ char *expr, *str;
+#endif
+ int err;
+
+ if (objc - objn != 1)
+ {
+ Tcl_WrongNumArgs(interp, objn, objv, "vimExpr");
+ return TCL_ERROR;
+ }
+
+#ifdef FEAT_EVAL
+ expr = Tcl_GetStringFromObj(objv[objn], NULL);
+ str = (char *)eval_to_string((char_u *)expr, NULL);
+ if (str == NULL)
+ Tcl_SetResult(interp, _("invalid expression"), TCL_STATIC);
+ else
+ Tcl_SetResult(interp, str, TCL_VOLATILE);
+ err = vimerror(interp);
+#else
+ Tcl_SetResult(interp, _("expressions disabled at compile time"), TCL_STATIC);
+ err = TCL_ERROR;
+#endif
+
+ return err;
+}
+
+/*
+ * Check for internal vim errors.
+ */
+ static int
+vimerror(interp)
+ Tcl_Interp *interp;
+{
+ if (got_int)
+ {
+ Tcl_SetResult(interp, _("keyboard interrupt"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ else if (did_emsg)
+ {
+ Tcl_SetResult(interp, _("vim error"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ * Functions that handle the reference lists:
+ * delref() - callback for Tcl's DeleteCommand
+ * tclgetref() - find/create Tcl command for a win_T* or buf_T* object
+ * tclgetwindow() - window frontend for tclgetref()
+ * tclgetbuffer() - buffer frontend for tclgetref()
+ * tclsetdelcmd() - add Tcl callback command to a vim object
+ */
+ static void
+delref(cref)
+ ClientData cref;
+{
+ struct ref *ref = (struct ref *)cref;
+
+ if (ref->delcmd)
+ {
+ Tcl_DecrRefCount(ref->delcmd);
+ ref->delcmd = NULL;
+ }
+ ref->interp = NULL;
+}
+
+ static char *
+tclgetref(interp, refstartP, prefix, vimobj, proc)
+ Tcl_Interp *interp;
+ void **refstartP; /* ptr to tcl_ref member of win_T/buf_T struct */
+ char *prefix; /* "win" or "buf" */
+ void *vimobj; /* win_T* or buf_T* */
+ Tcl_ObjCmdProc *proc; /* winselfcmd or bufselfcmd */
+{
+ struct ref *ref, *unused = NULL;
+ static char name[VARNAME_SIZE];
+ Tcl_Command cmd;
+
+ ref = (struct ref *)(*refstartP);
+ if (ref == &refsdeleted)
+ {
+ Tcl_SetResult(interp, _("cannot create buffer/window command: object is being deleted"), TCL_STATIC);
+ return NULL;
+ }
+
+ while (ref != NULL)
+ {
+ if (ref->interp == interp)
+ break;
+ if (ref->interp == NULL)
+ unused = ref;
+ ref = ref->next;
+ }
+
+ if (ref)
+ sprintf(name, "::vim::%s", Tcl_GetCommandName(interp, ref->cmd));
+ else
+ {
+ if (unused)
+ ref = unused;
+ else
+ {
+ ref = (struct ref *)Tcl_Alloc(sizeof(struct ref));
+#if 0 /* Tcl_Alloc either succeeds or does not return */
+ if (!ref)
+ {
+ Tcl_SetResult(interp, "out of memory", TCL_STATIC);
+ return NULL;
+ }
+#endif
+ ref->interp = NULL;
+ ref->next = (struct ref *)(*refstartP);
+ (*refstartP) = (void *)ref;
+ }
+
+ /* This might break on some exotic systems... */
+ sprintf(name, "::vim::%s_%lx", prefix, (unsigned long)vimobj);
+ cmd = Tcl_CreateObjCommand(interp, name, proc,
+ (ClientData)ref, (Tcl_CmdDeleteProc *)delref);
+ if (!cmd)
+ return NULL;
+
+ ref->interp = interp;
+ ref->cmd = cmd;
+ ref->delcmd = NULL;
+ ref->vimobj = vimobj;
+ }
+ return name;
+}
+
+ static char *
+tclgetwindow(interp, win)
+ Tcl_Interp *interp;
+ win_T *win;
+{
+ return tclgetref(interp, &(win->tcl_ref), "win", (void *)win, winselfcmd);
+}
+
+ static char *
+tclgetbuffer(interp, buf)
+ Tcl_Interp *interp;
+ buf_T *buf;
+{
+ return tclgetref(interp, &(buf->tcl_ref), "buf", (void *)buf, bufselfcmd);
+}
+
+ static int
+tclsetdelcmd(interp, reflist, vimobj, delcmd)
+ Tcl_Interp *interp;
+ struct ref *reflist;
+ void *vimobj;
+ Tcl_Obj *delcmd;
+{
+ if (reflist == &refsdeleted)
+ {
+ Tcl_SetResult(interp, _("cannot register callback command: buffer/window is already being deleted"), TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ while (reflist != NULL)
+ {
+ if (reflist->interp == interp && reflist->vimobj == vimobj)
+ {
+ if (reflist->delcmd)
+ Tcl_DecrRefCount(reflist->delcmd);
+ Tcl_IncrRefCount(delcmd);
+ reflist->delcmd = delcmd;
+ return TCL_OK;
+ }
+ reflist = reflist->next;
+ }
+ /* This should never happen. Famous last word? */
+ EMSG(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
+ Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC);
+ return TCL_ERROR;
+}
+
+
+/*******************************************
+ I/O Channel
+********************************************/
+
+/* ARGSUSED */
+ static int
+channel_close(instance, interp)
+ ClientData instance;
+ Tcl_Interp *interp;
+{
+ int err = 0;
+
+ /* currently does nothing */
+
+ if (instance != VIMOUT && instance != VIMERR)
+ {
+ Tcl_SetErrno(EBADF);
+ err = EBADF;
+ }
+ return err;
+}
+
+/* ARGSUSED */
+ static int
+channel_input(instance, buf, bufsiz, errptr)
+ ClientData instance;
+ char *buf;
+ int bufsiz;
+ int *errptr;
+{
+
+ /* input is currently not supported */
+
+ Tcl_SetErrno(EINVAL);
+ if (errptr)
+ *errptr = EINVAL;
+ return -1;
+}
+
+ static int
+channel_output(instance, buf, bufsiz, errptr)
+ ClientData instance;
+ char *buf;
+ int bufsiz;
+ int *errptr;
+{
+ char_u *str;
+ int result;
+
+ /* The buffer is not guaranteed to be 0-terminated, and we don't if
+ * there is enough room to add a '\0'. So we have to create a copy
+ * of the buffer...
+ */
+ str = vim_strnsave((char_u *)buf, bufsiz);
+ if (!str)
+ {
+ Tcl_SetErrno(ENOMEM);
+ if (errptr)
+ *errptr = ENOMEM;
+ return -1;
+ }
+
+ result = bufsiz;
+ if (instance == VIMOUT)
+ tclmsg((char *)str);
+ else
+ if (instance == VIMERR)
+ tclerrmsg((char *)str);
+ else
+ {
+ Tcl_SetErrno(EBADF);
+ if (errptr)
+ *errptr = EBADF;
+ result = -1;
+ }
+ vim_free(str);
+ return result;
+}
+
+/* ARGSUSED */
+ static void
+channel_watch(instance, mask)
+ ClientData instance;
+ int mask;
+{
+ Tcl_SetErrno(EINVAL);
+}
+
+/* ARGSUSED */
+ static int
+channel_gethandle(instance, direction, handleptr)
+ ClientData instance;
+ int direction;
+ ClientData *handleptr;
+{
+ Tcl_SetErrno(EINVAL);
+ return EINVAL;
+}
+
+
+static Tcl_ChannelType channel_type =
+{
+ "vimmessage",
+ NULL, /* blockmode */
+ channel_close,
+ channel_input,
+ channel_output,
+ NULL, /* seek */
+ NULL, /* set option */
+ NULL, /* get option */
+ channel_watch,
+ channel_gethandle
+};
+
+/**********************************
+ Interface to vim
+ **********************************/
+
+ static void
+tclupdatevars()
+{
+ char varname[VARNAME_SIZE]; /* must be writeable */
+ char *name;
+
+ strcpy(varname, VAR_RANGE1);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+ strcpy(varname, VAR_RANGE2);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+ strcpy(varname, VAR_RANGE3);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+
+ strcpy(varname, VAR_LBASE);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+
+ name = tclgetbuffer(tclinfo.interp, curbuf);
+ strcpy(tclinfo.curbuf, name);
+ strcpy(varname, VAR_CURBUF);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+
+ name = tclgetwindow(tclinfo.interp, curwin);
+ strcpy(tclinfo.curwin, name);
+ strcpy(varname, VAR_CURWIN);
+ Tcl_UpdateLinkedVar(tclinfo.interp, varname);
+}
+
+
+ static int
+tclinit(eap)
+ exarg_T *eap;
+{
+ char varname[VARNAME_SIZE]; /* Tcl_LinkVar requires writeable varname */
+ char *name;
+
+#ifdef DYNAMIC_TCL
+ if (!tcl_enabled(TRUE))
+ {
+ EMSG(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
+ return FAIL;
+ }
+#endif
+
+ if (!tclinfo.interp)
+ {
+ Tcl_Interp *interp;
+ static Tcl_Channel ch1, ch2;
+
+ /* replace stdout and stderr */
+ ch1 = Tcl_CreateChannel(&channel_type, "vimout", VIMOUT, TCL_WRITABLE);
+ ch2 = Tcl_CreateChannel(&channel_type, "vimerr", VIMERR, TCL_WRITABLE);
+ Tcl_SetStdChannel(ch1, TCL_STDOUT);
+ Tcl_SetStdChannel(ch2, TCL_STDERR);
+
+ interp = Tcl_CreateInterp();
+ Tcl_Preserve(interp);
+ if (Tcl_Init(interp) == TCL_ERROR)
+ {
+ Tcl_Release(interp);
+ Tcl_DeleteInterp(interp);
+ return FAIL;
+ }
+#if 0
+ /* VIM sure is interactive */
+ Tcl_SetVar(interp, "tcl_interactive", "1", TCL_GLOBAL_ONLY);
+#endif
+
+ Tcl_SetChannelOption(interp, ch1, "-buffering", "line");
+ Tcl_SetChannelOption(interp, ch2, "-buffering", "line");
+
+ /* replace some standard Tcl commands */
+ Tcl_DeleteCommand(interp, "exit");
+ Tcl_CreateObjCommand(interp, "exit", exitcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_DeleteCommand(interp, "catch");
+ Tcl_CreateObjCommand(interp, "catch", catchcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+
+ /* new commands, in ::vim namespace */
+ Tcl_CreateObjCommand(interp, "::vim::buffer", buffercmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::vim::window", windowcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::vim::command", commandcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::vim::beep", beepcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::vim::option", optioncmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+ Tcl_CreateObjCommand(interp, "::vim::expr", exprcmd,
+ (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
+
+ /* "lbase" variable */
+ tclinfo.lbase = 1;
+ strcpy(varname, VAR_LBASE);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.lbase, TCL_LINK_INT);
+
+ /* "range" variable */
+ tclinfo.range_start = eap->line1;
+ strcpy(varname, VAR_RANGE1);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY);
+ strcpy(varname, VAR_RANGE2);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_start, TCL_LINK_INT|TCL_LINK_READ_ONLY);
+ tclinfo.range_end = eap->line2;
+ strcpy(varname, VAR_RANGE3);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.range_end, TCL_LINK_INT|TCL_LINK_READ_ONLY);
+
+ /* "current" variable */
+ tclinfo.curbuf = Tcl_Alloc(VARNAME_SIZE);
+ tclinfo.curwin = Tcl_Alloc(VARNAME_SIZE);
+ name = tclgetbuffer(interp, curbuf);
+ strcpy(tclinfo.curbuf, name);
+ strcpy(varname, VAR_CURBUF);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.curbuf, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
+ name = tclgetwindow(interp, curwin);
+ strcpy(tclinfo.curwin, name);
+ strcpy(varname, VAR_CURWIN);
+ Tcl_LinkVar(interp, varname, (char *)&tclinfo.curwin, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
+
+ tclinfo.interp = interp;
+ }
+ else
+ {
+ /* Interpreter already exists, just update variables */
+ tclinfo.range_start = row2tcl(eap->line1);
+ tclinfo.range_end = row2tcl(eap->line2);
+ tclupdatevars();
+ }
+ return OK;
+}
+
+ static void
+tclerrmsg(text)
+ char *text;
+{
+ char *next;
+
+ while ((next=strchr(text, '\n')))
+ {
+ *next++ = '\0';
+ EMSG(text);
+ text = next;
+ }
+ if (*text)
+ EMSG(text);
+}
+
+ static void
+tclmsg(text)
+ char *text;
+{
+ char *next;
+
+ while ((next=strchr(text, '\n')))
+ {
+ *next++ = '\0';
+ MSG(text);
+ text = next;
+ }
+ if (*text)
+ MSG(text);
+}
+
+ static void
+tcldelthisinterp()
+{
+ if (!Tcl_InterpDeleted(tclinfo.interp))
+ Tcl_DeleteInterp(tclinfo.interp);
+ Tcl_Release(tclinfo.interp);
+ /* The interpreter is now gets deleted. All registered commands (esp.
+ * window and buffer commands) are deleted, triggering their deletion
+ * callback, which deletes all refs pointing to this interpreter.
+ * We could garbage-collect the unused ref structs in all windows and
+ * buffers, but unless the user creates hundreds of sub-interpreters
+ * all refering to lots of windows and buffers, this is hardly worth
+ * the effort. Unused refs are recycled by other interpreters, and
+ * all refs are free'd when the window/buffer gets closed by vim.
+ */
+
+ tclinfo.interp = NULL;
+ Tcl_Free(tclinfo.curbuf);
+ Tcl_Free(tclinfo.curwin);
+ tclinfo.curbuf = tclinfo.curwin = NULL;
+}
+
+ static int
+tclexit(error)
+ int error;
+{
+ int newerr = OK;
+
+ if (error == TCL_EXIT )
+ {
+ int retval;
+ char buf[32];
+ Tcl_Obj *robj;
+
+ robj = Tcl_GetObjResult(tclinfo.interp);
+ if( Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK )
+ {
+ EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"));
+ newerr = FAIL;
+ }
+ else
+ {
+ sprintf(buf, "E572: exit code %d", retval);
+ tclerrmsg(buf);
+ if (retval == 0 )
+ {
+ did_emsg = 0;
+ newerr = OK;
+ }
+ else
+ newerr = FAIL;
+ }
+
+ tcldelthisinterp();
+ }
+ else
+ {
+ char *result;
+
+ result = Tcl_GetStringResult(tclinfo.interp);
+ if (error == TCL_OK)
+ {
+ tclmsg(result);
+ newerr = OK;
+ }
+ else
+ {
+ tclerrmsg(result);
+ newerr = FAIL;
+ }
+ }
+
+ return newerr;
+}
+
+/*
+ * ":tcl"
+ */
+ void
+ex_tcl(eap)
+ exarg_T *eap;
+{
+ char_u *script;
+ int err;
+
+ script = script_get(eap, eap->arg);
+ if (!eap->skip)
+ {
+ err = tclinit(eap);
+ if (err == OK)
+ {
+ Tcl_AllowExceptions(tclinfo.interp);
+ if (script == NULL)
+ err = Tcl_Eval(tclinfo.interp, (char *)eap->arg);
+ else
+ err = Tcl_Eval(tclinfo.interp, (char *)script);
+ err = tclexit(err);
+ }
+ }
+ vim_free(script);
+}
+
+/*
+ * ":tclfile"
+ */
+ void
+ex_tclfile(eap)
+ exarg_T *eap;
+{
+ char *file = (char *)eap->arg;
+ int err;
+
+ err = tclinit(eap);
+ if (err == OK)
+ {
+ Tcl_AllowExceptions(tclinfo.interp);
+ err = Tcl_EvalFile(tclinfo.interp, file);
+ err = tclexit(err);
+ }
+}
+
+/*
+ * ":tcldo"
+ */
+ void
+ex_tcldo(eap)
+ exarg_T *eap;
+{
+ char *script, *line;
+ int err, rs, re, lnum;
+ char var_lnum[VARNAME_SIZE]; /* must be writeable memory */
+ char var_line[VARNAME_SIZE];
+ linenr_T first_line = 0;
+ linenr_T last_line = 0;
+
+ rs = eap->line1;
+ re = eap->line2;
+ script = (char *)eap->arg;
+ strcpy(var_lnum, VAR_CURLNUM);
+ strcpy(var_line, VAR_CURLINE);
+
+ err = tclinit(eap);
+ if (err != OK)
+ return;
+
+ lnum = row2tcl(rs);
+ Tcl_LinkVar(tclinfo.interp, var_lnum, (char *)&lnum, TCL_LINK_INT|TCL_LINK_READ_ONLY);
+ err = TCL_OK;
+ if (u_save((linenr_T)(rs-1), (linenr_T)(re+1)) != OK)
+ {
+ Tcl_SetResult(tclinfo.interp, _("cannot save undo information"), TCL_STATIC);
+ err = TCL_ERROR;
+ }
+ while (err == TCL_OK && rs <= re)
+ {
+ line = (char *)ml_get_buf(curbuf, (linenr_T)rs, FALSE);
+ if (!line)
+ {
+ Tcl_SetResult(tclinfo.interp, _("cannot get line"), TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ Tcl_SetVar(tclinfo.interp, var_line, line, 0);
+ Tcl_AllowExceptions(tclinfo.interp);
+ err = Tcl_Eval(tclinfo.interp, script);
+ if (err != TCL_OK)
+ break;
+ line = Tcl_GetVar(tclinfo.interp, var_line, 0);
+ if (line)
+ {
+ if (ml_replace((linenr_T)rs, (char_u *)line, TRUE) != OK)
+ {
+ Tcl_SetResult(tclinfo.interp, _("cannot replace line"), TCL_STATIC);
+ err = TCL_ERROR;
+ break;
+ }
+ if (first_line == 0)
+ first_line = rs;
+ last_line = rs;
+ }
+ ++rs;
+ ++lnum;
+ Tcl_UpdateLinkedVar(tclinfo.interp, var_lnum);
+ }
+ if (first_line)
+ changed_lines(first_line, 0, last_line + 1, (long)0);
+
+ Tcl_UnsetVar(tclinfo.interp, var_line, 0);
+ Tcl_UnlinkVar(tclinfo.interp, var_lnum);
+ if (err == TCL_OK)
+ Tcl_ResetResult(tclinfo.interp);
+
+ (void)tclexit(err);
+}
+
+ static void
+tcldelallrefs(ref)
+ struct ref *ref;
+{
+ struct ref *next;
+ int err;
+ char *result;
+
+ while (ref != NULL)
+ {
+ next = ref->next;
+ if (ref->interp)
+ {
+ if (ref->delcmd)
+ {
+ err = Tcl_GlobalEvalObj(ref->interp, ref->delcmd);
+ if (err != TCL_OK)
+ {
+ result = Tcl_GetStringResult(ref->interp);
+ if (result)
+ tclerrmsg(result);
+ }
+ Tcl_DecrRefCount(ref->delcmd);
+ ref->delcmd = NULL;
+ }
+ Tcl_DeleteCommandFromToken(ref->interp, ref->cmd);
+ }
+ Tcl_Free((char *)ref);
+ ref = next;
+ }
+}
+
+ void
+tcl_buffer_free(buf)
+ buf_T *buf;
+{
+ struct ref *reflist;
+
+#ifdef DYNAMIC_TCL
+ if (!stubs_initialized) /* Not using Tcl, nothing to do. */
+ return;
+#endif
+
+ reflist = (struct ref*)(buf->tcl_ref);
+ if (reflist != &refsdeleted)
+ {
+ buf->tcl_ref = (void *)&refsdeleted;
+ tcldelallrefs(reflist);
+ buf->tcl_ref = NULL;
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+ void
+tcl_window_free(win)
+ win_T *win;
+{
+ struct ref *reflist;
+
+#ifdef DYNAMIC_TCL
+ if (!stubs_initialized) /* Not using Tcl, nothing to do. */
+ return;
+#endif
+
+ reflist = (struct ref*)(win->tcl_ref);
+ if (reflist != &refsdeleted)
+ {
+ win->tcl_ref = (void *)&refsdeleted;
+ tcldelallrefs(reflist);
+ win->tcl_ref = NULL;
+ }
+}
+#endif
+
+/* The End */
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c
new file mode 100644
index 000000000..a82139e64
--- /dev/null
+++ b/src/if_xcmdsrv.c
@@ -0,0 +1,1441 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * X command server by Flemming Madsen
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ *
+ * if_xcmdsrv.c: Functions for passing commands through an X11 display.
+ *
+ */
+
+#include "vim.h"
+#include "version.h"
+
+#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
+
+# ifdef FEAT_X11
+# include <X11/Intrinsic.h>
+# include <X11/Xatom.h>
+# endif
+
+# if defined(HAVE_SYS_SELECT_H) && \
+ (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
+# include <sys/select.h>
+# endif
+
+# ifndef HAVE_SELECT
+# ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+# else
+# ifdef HAVE_POLL_H
+# include <poll.h>
+# endif
+# endif
+# endif
+
+/*
+ * This file provides procedures that implement the command server functionality
+ * of Vim when in contact with an X11 server.
+ *
+ * Adapted from TCL/TK's send command in tkSend.c of the tk 3.6 distribution.
+ * Adapted for use in Vim by Flemming Madsen. Protocol changed to that of tk 4
+ */
+
+/*
+ * Copyright (c) 1989-1993 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
+ * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+
+/*
+ * When a result is being awaited from a sent command, one of
+ * the following structures is present on a list of all outstanding
+ * sent commands. The information in the structure is used to
+ * process the result when it arrives. You're probably wondering
+ * how there could ever be multiple outstanding sent commands.
+ * This could happen if Vim instances invoke each other recursively.
+ * It's unlikely, but possible.
+ */
+
+typedef struct PendingCommand
+{
+ int serial; /* Serial number expected in result. */
+ int code; /* Result Code. 0 is OK */
+ char_u *result; /* String result for command (malloc'ed).
+ * NULL means command still pending. */
+ struct PendingCommand *nextPtr;
+ /* Next in list of all outstanding commands.
+ * NULL means end of list. */
+} PendingCommand;
+
+static PendingCommand *pendingCommands = NULL;
+ /* List of all commands currently
+ * being waited for. */
+
+/*
+ * The information below is used for communication between processes
+ * during "send" commands. Each process keeps a private window, never
+ * even mapped, with one property, "Comm". When a command is sent to
+ * an interpreter, the command is appended to the comm property of the
+ * communication window associated with the interp's process. Similarly,
+ * when a result is returned from a sent command, it is also appended
+ * to the comm property.
+ *
+ * Each command and each result takes the form of ASCII text. For a
+ * command, the text consists of a nul character followed by several
+ * nul-terminated ASCII strings. The first string consists of the
+ * single letter "c" for an expression, or "k" for keystrokes. Subsequent
+ * strings have the form "option value" where the following options are
+ * supported:
+ *
+ * -r commWindow serial
+ *
+ * This option means that a response should be sent to the window
+ * whose X identifier is "commWindow" (in hex), and the response should
+ * be identified with the serial number given by "serial" (in decimal).
+ * If this option isn't specified then the send is asynchronous and
+ * no response is sent.
+ *
+ * -n name
+ * "Name" gives the name of the application for which the command is
+ * intended. This option must be present.
+ *
+ * -s script
+ * "Script" is the script to be executed. This option must be
+ * present. Taken as a series of keystrokes in a "k" command where
+ * <Key>'s are expanded
+ *
+ * The options may appear in any order. The -n and -s options must be
+ * present, but -r may be omitted for asynchronous RPCs. For compatibility
+ * with future releases that may add new features, there may be additional
+ * options present; as long as they start with a "-" character, they will
+ * be ignored.
+ *
+ * A result also consists of a zero character followed by several null-
+ * terminated ASCII strings. The first string consists of the single
+ * letter "r". Subsequent strings have the form "option value" where
+ * the following options are supported:
+ *
+ * -s serial
+ * Identifies the command for which this is the result. It is the
+ * same as the "serial" field from the -s option in the command. This
+ * option must be present.
+ *
+ * -r result
+ * "Result" is the result string for the script, which may be either
+ * a result or an error message. If this field is omitted then it
+ * defaults to an empty string.
+ *
+ * -c code
+ * 0: for OK. This is the default.
+ * 1: for error: Result is the last error
+ *
+ * -i errorInfo
+ * -e errorCode
+ * Not applicable for Vim
+ *
+ * Options may appear in any order, and only the -s option must be
+ * present. As with commands, there may be additional options besides
+ * these; unknown options are ignored.
+ */
+
+/*
+ * Maximum size property that can be read at one time by
+ * this module:
+ */
+
+#define MAX_PROP_WORDS 100000
+
+struct ServerReply
+{
+ Window id;
+ garray_T strings;
+};
+static garray_T serverReply = { 0, 0, 0, 0, 0 };
+enum ServerReplyOp { SROP_Find, SROP_Add, SROP_Delete };
+
+typedef int (*EndCond) __ARGS((void *));
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static Window LookupName __ARGS((Display *dpy, char_u *name, int delete, char_u **loose));
+static int SendInit __ARGS((Display *dpy));
+static int DoRegisterName __ARGS((Display *dpy, char_u *name));
+static void DeleteAnyLingerer __ARGS((Display *dpy, Window w));
+static int GetRegProp __ARGS((Display *dpy, char_u **regPropp, long_u *numItemsp, int domsg));
+static int WaitForPend __ARGS((void *p));
+static int WaitForReply __ARGS((void *p));
+static int WindowValid __ARGS((Display *dpy, Window w));
+static void ServerWait __ARGS((Display *dpy, Window w, EndCond endCond, void *endData, int localLoop, int seconds));
+static struct ServerReply *ServerReplyFind __ARGS((Window w, enum ServerReplyOp op));
+static int AppendPropCarefully __ARGS((Display *display, Window window, Atom property, char_u *value, int length));
+static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event));
+static int IsSerialName __ARGS((char_u *name));
+
+/* Private variables for the "server" functionality */
+static Atom registryProperty = None;
+static Atom vimProperty = None;
+static int got_x_error = FALSE;
+
+static char_u *empty_prop = (char_u *)""; /* empty GetRegProp() result */
+
+/*
+ * Associate an ASCII name with Vim. Try real hard to get a unique one.
+ * Returns FAIL or OK.
+ */
+ int
+serverRegisterName(dpy, name)
+ Display *dpy; /* display to register with */
+ char_u *name; /* the name that will be used as a base */
+{
+ int i;
+ int res;
+ char_u *p = NULL;
+
+ res = DoRegisterName(dpy, name);
+ if (res < 0)
+ {
+ i = 1;
+ do
+ {
+ if (res < -1 || i >= 1000)
+ {
+ MSG_ATTR(_("Unable to register a command server name"),
+ hl_attr(HLF_W));
+ return FAIL;
+ }
+ if (p == NULL)
+ p = alloc(STRLEN(name) + 10);
+ if (p == NULL)
+ {
+ res = -10;
+ continue;
+ }
+ sprintf((char *)p, "%s%d", name, i++);
+ res = DoRegisterName(dpy, p);
+ }
+ while (res < 0)
+ ;
+ vim_free(p);
+ }
+ return OK;
+}
+
+ static int
+DoRegisterName(dpy, name)
+ Display *dpy;
+ char_u *name;
+{
+ Window w;
+ XErrorHandler old_handler;
+#define MAX_NAME_LENGTH 100
+ char_u propInfo[MAX_NAME_LENGTH + 20];
+
+ if (commProperty == None)
+ {
+ if (SendInit(dpy) < 0)
+ return -2;
+ }
+
+ /*
+ * Make sure the name is unique, and append info about it to
+ * the registry property. It's important to lock the server
+ * here to prevent conflicting changes to the registry property.
+ * WARNING: Do not step through this while debugging, it will hangup the X
+ * server!
+ */
+ XGrabServer(dpy);
+ w = LookupName(dpy, name, FALSE, NULL);
+ if (w != (Window)0)
+ {
+ Status status;
+ int dummyInt;
+ unsigned int dummyUns;
+ Window dummyWin;
+
+ /*
+ * The name is currently registered. See if the commWindow
+ * associated with the name exists. If not, or if the commWindow
+ * is *our* commWindow, then just unregister the old name (this
+ * could happen if an application dies without cleaning up the
+ * registry).
+ */
+ old_handler = XSetErrorHandler(x_error_check);
+ status = XGetGeometry(dpy, w, &dummyWin, &dummyInt, &dummyInt,
+ &dummyUns, &dummyUns, &dummyUns, &dummyUns);
+ (void)XSetErrorHandler(old_handler);
+ if (status != Success && w != commWindow)
+ {
+ XUngrabServer(dpy);
+ XFlush(dpy);
+ return -1;
+ }
+ (void)LookupName(dpy, name, /*delete=*/TRUE, NULL);
+ }
+ sprintf((char *)propInfo, "%x %.*s", (int_u)commWindow,
+ MAX_NAME_LENGTH, name);
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+ XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING, 8,
+ PropModeAppend, propInfo, STRLEN(propInfo) + 1);
+ XUngrabServer(dpy);
+ XSync(dpy, False);
+ (void)XSetErrorHandler(old_handler);
+
+ if (!got_x_error)
+ {
+#ifdef FEAT_EVAL
+ set_vim_var_string(VV_SEND_SERVER, name, -1);
+#endif
+ serverName = vim_strsave(name);
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+#endif
+ return 0;
+ }
+ return -2;
+}
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Clean out new ID from registry and set it as comm win.
+ * Change any registered window ID.
+ */
+ void
+serverChangeRegisteredWindow(dpy, newwin)
+ Display *dpy; /* Display to register with */
+ Window newwin; /* Re-register to this ID */
+{
+ char_u propInfo[MAX_NAME_LENGTH + 20];
+
+ commWindow = newwin;
+
+ /* Always call SendInit() here, to make sure commWindow is marked as a Vim
+ * window. */
+ if (SendInit(dpy) < 0)
+ return;
+
+ /* WARNING: Do not step through this while debugging, it will hangup the X
+ * server! */
+ XGrabServer(dpy);
+ DeleteAnyLingerer(dpy, newwin);
+ if (serverName != NULL)
+ {
+ /* Reinsert name if we was already registered */
+ (void)LookupName(dpy, serverName, /*delete=*/TRUE, NULL);
+ sprintf((char *)propInfo, "%x %.*s",
+ (int_u)newwin, MAX_NAME_LENGTH, serverName);
+ XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING, 8,
+ PropModeAppend, (char_u *)propInfo,
+ STRLEN(propInfo) + 1);
+ }
+ XUngrabServer(dpy);
+}
+#endif
+
+/*
+ * Send to an instance of Vim via the X display.
+ * Returns 0 for OK, negative for an error.
+ */
+ int
+serverSendToVim(dpy, name, cmd, result, server, asExpr, localLoop, silent)
+ Display *dpy; /* Where to send. */
+ char_u *name; /* Where to send. */
+ char_u *cmd; /* What to send. */
+ char_u **result; /* Result of eval'ed expression */
+ Window *server; /* Actual ID of receiving app */
+ Bool asExpr; /* Interpret as keystrokes or expr ? */
+ Bool localLoop; /* Throw away everything but result */
+ int silent; /* don't complain about no server */
+{
+ Window w;
+ char_u *property;
+ int length;
+ int res;
+ static int serial = 0; /* Running count of sent commands.
+ * Used to give each command a
+ * different serial number. */
+ PendingCommand pending;
+ char_u *loosename = NULL;
+
+ if (result != NULL)
+ *result = NULL;
+ if (name == NULL || *name == NUL)
+ name = (char_u *)"GVIM"; /* use a default name */
+
+ if (commProperty == None && dpy != NULL)
+ {
+ if (SendInit(dpy) < 0)
+ return -1;
+ }
+
+ /* Execute locally if no display or target is ourselves */
+ if (dpy == NULL || (serverName != NULL && STRICMP(name, serverName) == 0))
+ {
+ if (asExpr)
+ {
+ char_u *ret;
+
+ ret = eval_client_expr_to_string(cmd);
+ if (result != NULL)
+ {
+ if (ret == NULL)
+ *result = vim_strsave((char_u *)_(e_invexprmsg));
+ else
+ *result = ret;
+ }
+ else
+ vim_free(ret);
+ return ret == NULL ? -1 : 0;
+ }
+ else
+ server_to_input_buf(cmd);
+ return 0;
+ }
+
+ /*
+ * Bind the server name to a communication window.
+ *
+ * Find any survivor with a serialno attached to the name if the
+ * original registrant of the wanted name is no longer present.
+ *
+ * Delete any lingering names from dead editors.
+ */
+ while (TRUE)
+ {
+ w = LookupName(dpy, name, FALSE, &loosename);
+ /* Check that the window is hot */
+ if (w != None)
+ {
+ if (!WindowValid(dpy, w))
+ {
+ LookupName(dpy, loosename ? loosename : name,
+ /*DELETE=*/TRUE, NULL);
+ continue;
+ }
+ }
+ break;
+ }
+ if (w == None)
+ {
+ if (!silent)
+ EMSG2(_(e_noserver), name);
+ return -1;
+ }
+ else if (loosename != NULL)
+ name = loosename;
+ if (server != NULL)
+ *server = w;
+
+ /*
+ * Send the command to target interpreter by appending it to the
+ * comm window in the communication window.
+ */
+ length = STRLEN(name) + STRLEN(cmd) + 10;
+ property = (char_u *)alloc((unsigned) length + 30);
+
+ sprintf((char *)property, "%c%c%c-n %s%c-s %s",
+ 0, asExpr ? 'c' : 'k', 0, name, 0, cmd);
+ if (name == loosename)
+ vim_free(loosename);
+ /* Add a back reference to our comm window */
+ serial++;
+ sprintf((char *)property + length, "%c-r %x %d",
+ 0, (int_u)commWindow, serial);
+ length += STRLEN(property + length + 1) + 1;
+
+ res = AppendPropCarefully(dpy, w, commProperty, property, length + 1);
+ vim_free(property);
+ if (res < 0)
+ {
+ EMSG(_("E248: Failed to send command to the destination program"));
+ return -1;
+ }
+
+ if (!asExpr) /* There is no answer for this - Keys are sent async */
+ return 0;
+
+ /*
+ * Register the fact that we're waiting for a command to
+ * complete (this is needed by SendEventProc and by
+ * AppendErrorProc to pass back the command's results).
+ */
+ pending.serial = serial;
+ pending.code = 0;
+ pending.result = NULL;
+ pending.nextPtr = pendingCommands;
+ pendingCommands = &pending;
+
+ ServerWait(dpy, w, WaitForPend, &pending, localLoop, 600);
+
+ /*
+ * Unregister the information about the pending command
+ * and return the result.
+ */
+ if (pendingCommands == &pending)
+ pendingCommands = pending.nextPtr;
+ else
+ {
+ PendingCommand *pcPtr;
+
+ for (pcPtr = pendingCommands; pcPtr != NULL; pcPtr = pcPtr->nextPtr)
+ if (pcPtr->nextPtr == &pending)
+ {
+ pcPtr->nextPtr = pending.nextPtr;
+ break;
+ }
+ }
+ if (result != NULL)
+ *result = pending.result;
+ else
+ vim_free(pending.result);
+
+ return pending.code == 0 ? 0 : -1;
+}
+
+ static int
+WaitForPend(p)
+ void *p;
+{
+ PendingCommand *pending = (PendingCommand *) p;
+ return pending->result != NULL;
+}
+
+/*
+ * Return TRUE if window "w" exists and has a "Vim" property on it.
+ */
+ static int
+WindowValid(dpy, w)
+ Display *dpy;
+ Window w;
+{
+ XErrorHandler old_handler;
+ Atom *plist;
+ int numProp;
+ int i;
+
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = 0;
+ plist = XListProperties(dpy, w, &numProp);
+ XSync(dpy, False);
+ XSetErrorHandler(old_handler);
+ if (plist == NULL || got_x_error)
+ return FALSE;
+
+ for (i = 0; i < numProp; i++)
+ if (plist[i] == vimProperty)
+ {
+ XFree(plist);
+ return TRUE;
+ }
+ XFree(plist);
+ return FALSE;
+}
+
+/*
+ * Enter a loop processing X events & polling chars until we see a result
+ */
+ static void
+ServerWait(dpy, w, endCond, endData, localLoop, seconds)
+ Display *dpy;
+ Window w;
+ EndCond endCond;
+ void *endData;
+ int localLoop;
+ int seconds;
+{
+ time_t start;
+ time_t now;
+ time_t lastChk = 0;
+ XEvent event;
+ XPropertyEvent *e = (XPropertyEvent *)&event;
+# define SEND_MSEC_POLL 50
+
+ time(&start);
+ while (endCond(endData) == 0)
+ {
+ time(&now);
+ if (seconds >= 0 && (now - start) >= seconds)
+ break;
+ if (now != lastChk)
+ {
+ lastChk = now;
+ if (!WindowValid(dpy, w))
+ break;
+ /*
+ * Sometimes the PropertyChange event doesn't come.
+ * This can be seen in eg: vim -c 'echo remote_expr("gvim", "3+2")'
+ */
+ serverEventProc(dpy, NULL);
+ }
+ if (localLoop)
+ {
+ /* Just look out for the answer without calling back into Vim */
+#ifndef HAVE_SELECT
+ struct pollfd fds;
+
+ fds.fd = ConnectionNumber(dpy);
+ fds.events = POLLIN;
+ if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
+ break;
+#else
+ fd_set fds;
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = SEND_MSEC_POLL * 1000;
+ FD_ZERO(&fds);
+ FD_SET(ConnectionNumber(dpy), &fds);
+ if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0)
+ break;
+#endif
+ while (XEventsQueued(dpy, QueuedAfterReading) > 0)
+ {
+ XNextEvent(dpy, &event);
+ if (event.type == PropertyNotify && e->window == commWindow)
+ serverEventProc(dpy, &event);
+ }
+ }
+ else
+ {
+ if (got_int)
+ break;
+ ui_delay((long)SEND_MSEC_POLL, TRUE);
+ ui_breakcheck();
+ }
+ }
+}
+
+
+/*
+ * Fetch a list of all the Vim instance names currently registered for the
+ * display.
+ *
+ * Returns a newline separated list in allocated memory or NULL.
+ */
+ char_u *
+serverGetVimNames(dpy)
+ Display *dpy;
+{
+ char_u *regProp;
+ char_u *entry;
+ char_u *p;
+ long_u numItems;
+ int_u w;
+ garray_T ga;
+
+ if (registryProperty == None)
+ {
+ if (SendInit(dpy) < 0)
+ return NULL;
+ }
+ ga_init2(&ga, 1, 100);
+
+ /*
+ * Read the registry property.
+ */
+ if (GetRegProp(dpy, &regProp, &numItems, TRUE) == FAIL)
+ return NULL;
+
+ /*
+ * Scan all of the names out of the property.
+ */
+ ga_init2(&ga, 1, 100);
+ for (p = regProp; (p - regProp) < numItems; p++)
+ {
+ entry = p;
+ while (*p != 0 && !isspace(*p))
+ p++;
+ if (*p != 0)
+ {
+ w = None;
+ sscanf((char *)entry, "%x", &w);
+ if (WindowValid(dpy, (Window)w))
+ {
+ ga_concat(&ga, p + 1);
+ ga_concat(&ga, (char_u *)"\n");
+ }
+ while (*p != 0)
+ p++;
+ }
+ }
+ if (regProp != empty_prop)
+ XFree(regProp);
+ return ga.ga_data;
+}
+
+/* ----------------------------------------------------------
+ * Reply stuff
+ */
+
+ static struct ServerReply *
+ServerReplyFind(w, op)
+ Window w;
+ enum ServerReplyOp op;
+{
+ struct ServerReply *p;
+ struct ServerReply e;
+ int i;
+
+ p = (struct ServerReply *) serverReply.ga_data;
+ for (i = 0; i < serverReply.ga_len; i++, p++)
+ if (p->id == w)
+ break;
+ if (i >= serverReply.ga_len)
+ p = NULL;
+
+ if (p == NULL && op == SROP_Add)
+ {
+ if (serverReply.ga_growsize == 0)
+ ga_init2(&serverReply, sizeof(struct ServerReply), 1);
+ if (ga_grow(&serverReply, 1) == OK)
+ {
+ p = ((struct ServerReply *) serverReply.ga_data)
+ + serverReply.ga_len;
+ e.id = w;
+ ga_init2(&e.strings, 1, 100);
+ memcpy(p, &e, sizeof(e));
+ serverReply.ga_len++;
+ serverReply.ga_room--;
+ }
+ }
+ else if (p != NULL && op == SROP_Delete)
+ {
+ ga_clear(&p->strings);
+ mch_memmove(p, p + 1, (serverReply.ga_len - i - 1) * sizeof(*p));
+ serverReply.ga_len--;
+ serverReply.ga_room++;
+ }
+
+ return p;
+}
+
+/*
+ * Convert string to windowid.
+ * Issue an error if the id is invalid.
+ */
+ Window
+serverStrToWin(str)
+ char_u *str;
+{
+ unsigned id = None;
+
+ sscanf((char *)str, "0x%x", &id);
+ if (id == None)
+ EMSG2(_("E573: Invalid server id used: %s"), str);
+
+ return (Window)id;
+}
+
+/*
+ * Send a reply string to client with id "name".
+ * Return -1 if the window is invalid.
+ */
+ int
+serverSendReply(name, str)
+ char_u *name;
+ char_u *str;
+{
+ char_u *property;
+ int length;
+ int res;
+ Display *dpy = X_DISPLAY;
+ Window win = serverStrToWin(name);
+
+ if (commProperty == None)
+ {
+ if (SendInit(dpy) < 0)
+ return -2;
+ }
+ if (!WindowValid(dpy, win))
+ return -1;
+
+ length = STRLEN(str) + 7;
+ if ((property = (char_u *)alloc((unsigned) length + 30)) != NULL)
+ {
+ sprintf((char *)property, "%c%c%c-n %s%c-w %x",
+ 0, 'n', 0, str, 0, (unsigned int)commWindow);
+ length += STRLEN(property + length);
+ res = AppendPropCarefully(dpy, win, commProperty, property, length + 1);
+ vim_free(property);
+ return res;
+ }
+ return -1;
+}
+
+ static int
+WaitForReply(p)
+ void *p;
+{
+ Window *w = (Window *) p;
+ return ServerReplyFind(*w, SROP_Find) != NULL;
+}
+
+/*
+ * Wait for replies from id (win)
+ * Return 0 and the malloc'ed string when a reply is available.
+ * Return -1 if the window becomes invalid while waiting.
+ */
+ int
+serverReadReply(dpy, win, str, localLoop)
+ Display *dpy;
+ Window win;
+ char_u **str;
+ int localLoop;
+{
+ int len;
+ char_u *s;
+ struct ServerReply *p;
+
+ ServerWait(dpy, win, WaitForReply, &win, localLoop, -1);
+
+ if ((p = ServerReplyFind(win, SROP_Find)) != NULL && p->strings.ga_len > 0)
+ {
+ *str = vim_strsave(p->strings.ga_data);
+ len = STRLEN(*str) + 1;
+ if (len < p->strings.ga_len)
+ {
+ s = (char_u *) p->strings.ga_data;
+ mch_memmove(s, s + len, p->strings.ga_len - len);
+ p->strings.ga_room += len;
+ p->strings.ga_len -= len;
+ }
+ else
+ {
+ /* Last string read. Remove from list */
+ ga_clear(&p->strings);
+ ServerReplyFind(win, SROP_Delete);
+ }
+ return 0;
+ }
+ return -1;
+}
+
+/*
+ * Check for replies from id (win).
+ * Return TRUE and a non-malloc'ed string if there is. Else return FALSE.
+ */
+ int
+serverPeekReply(dpy, win, str)
+ Display *dpy;
+ Window win;
+ char_u **str;
+{
+ struct ServerReply *p;
+
+ if ((p = ServerReplyFind(win, SROP_Find)) != NULL && p->strings.ga_len > 0)
+ {
+ if (str != NULL)
+ *str = p->strings.ga_data;
+ return 1;
+ }
+ if (!WindowValid(dpy, win))
+ return -1;
+ return 0;
+}
+
+
+/*
+ * Initialize the communication channels for sending commands and receiving
+ * results.
+ */
+ static int
+SendInit(dpy)
+ Display *dpy;
+{
+ XErrorHandler old_handler;
+
+ /*
+ * Create the window used for communication, and set up an
+ * event handler for it.
+ */
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+
+ if (commProperty == None)
+ commProperty = XInternAtom(dpy, "Comm", False);
+ if (vimProperty == None)
+ vimProperty = XInternAtom(dpy, "Vim", False);
+ if (registryProperty == None)
+ registryProperty = XInternAtom(dpy, "VimRegistry", False);
+
+ if (commWindow == None)
+ {
+ commWindow = XCreateSimpleWindow(dpy, XDefaultRootWindow(dpy),
+ getpid(), 0, 10, 10, 0,
+ WhitePixel(dpy, DefaultScreen(dpy)),
+ WhitePixel(dpy, DefaultScreen(dpy)));
+ XSelectInput(dpy, commWindow, PropertyChangeMask);
+ /* WARNING: Do not step through this while debugging, it will hangup
+ * the X server! */
+ XGrabServer(dpy);
+ DeleteAnyLingerer(dpy, commWindow);
+ XUngrabServer(dpy);
+ }
+
+ /* Make window recognizable as a vim window */
+ XChangeProperty(dpy, commWindow, vimProperty, XA_STRING,
+ 8, PropModeReplace, (char_u *)VIM_VERSION_SHORT,
+ (int)STRLEN(VIM_VERSION_SHORT) + 1);
+
+ XSync(dpy, False);
+ (void)XSetErrorHandler(old_handler);
+
+ return got_x_error ? -1 : 0;
+}
+
+/*
+ * Given a server name, see if the name exists in the registry for a
+ * particular display.
+ *
+ * If the given name is registered, return the ID of the window associated
+ * with the name. If the name isn't registered, then return 0.
+ *
+ * Side effects:
+ * If the registry property is improperly formed, then it is deleted.
+ * If "delete" is non-zero, then if the named server is found it is
+ * removed from the registry property.
+ */
+ static Window
+LookupName(dpy, name, delete, loose)
+ Display *dpy; /* Display whose registry to check. */
+ char_u *name; /* Name of a server. */
+ int delete; /* If non-zero, delete info about name. */
+ char_u **loose; /* Do another search matching -999 if not found
+ Return result here if a match is found */
+{
+ char_u *regProp, *entry;
+ char_u *p;
+ long_u numItems;
+ int_u returnValue;
+
+ /*
+ * Read the registry property.
+ */
+ if (GetRegProp(dpy, &regProp, &numItems, FALSE) == FAIL)
+ return 0;
+
+ /*
+ * Scan the property for the desired name.
+ */
+ returnValue = (int_u)None;
+ entry = NULL; /* Not needed, but eliminates compiler warning. */
+ for (p = regProp; (p - regProp) < numItems; )
+ {
+ entry = p;
+ while (*p != 0 && !isspace(*p))
+ p++;
+ if (*p != 0 && STRICMP(name, p + 1) == 0)
+ {
+ sscanf((char *)entry, "%x", &returnValue);
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (loose != NULL && returnValue == (int_u)None && !IsSerialName(name))
+ {
+ for (p = regProp; (p - regProp) < numItems; )
+ {
+ entry = p;
+ while (*p != 0 && !isspace(*p))
+ p++;
+ if (*p != 0 && IsSerialName(p + 1)
+ && STRNICMP(name, p + 1, STRLEN(name)) == 0)
+ {
+ sscanf((char *)entry, "%x", &returnValue);
+ *loose = vim_strsave(p + 1);
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+ }
+
+ /*
+ * Delete the property, if that is desired (copy down the
+ * remainder of the registry property to overlay the deleted
+ * info, then rewrite the property).
+ */
+ if (delete && returnValue != (int_u)None)
+ {
+ int count;
+
+ while (*p != 0)
+ p++;
+ p++;
+ count = numItems - (p - regProp);
+ if (count > 0)
+ memcpy(entry, p, count);
+ XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING,
+ 8, PropModeReplace, regProp,
+ (int)(numItems - (p - entry)));
+ XSync(dpy, False);
+ }
+
+ if (regProp != empty_prop)
+ XFree(regProp);
+ return (Window)returnValue;
+}
+
+/*
+ * Delete any lingering occurences of window id. We promise that any
+ * occurences is not ours since it is not yet put into the registry (by us)
+ *
+ * This is necessary in the following scenario:
+ * 1. There is an old windowid for an exit'ed vim in the registry
+ * 2. We get that id for our commWindow but only want to send, not register.
+ * 3. The window will mistakenly be regarded valid because of own commWindow
+ */
+ static void
+DeleteAnyLingerer(dpy, win)
+ Display *dpy; /* Display whose registry to check. */
+ Window win; /* Window to remove */
+{
+ char_u *regProp, *entry = NULL;
+ char_u *p;
+ long_u numItems;
+ Window wwin;
+
+ /*
+ * Read the registry property.
+ */
+ if (GetRegProp(dpy, &regProp, &numItems, FALSE) == FAIL)
+ return;
+
+ /* Scan the property for the window id. */
+ for (p = regProp; (p - regProp) < numItems; )
+ {
+ if (*p != 0)
+ {
+ sscanf((char *)p, "%x", (int_u *)&wwin);
+ if (wwin == win)
+ {
+ int lastHalf;
+
+ /* Copy down the remainder to delete entry */
+ entry = p;
+ while (*p != 0)
+ p++;
+ p++;
+ lastHalf = numItems - (p - regProp);
+ if (lastHalf > 0)
+ memcpy(entry, p, lastHalf);
+ numItems = (entry - regProp) + lastHalf;
+ p = entry;
+ continue;
+ }
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (entry != NULL)
+ {
+ XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty,
+ XA_STRING, 8, PropModeReplace, regProp,
+ (int)(p - regProp));
+ XSync(dpy, False);
+ }
+
+ if (regProp != empty_prop)
+ XFree(regProp);
+}
+
+/*
+ * Read the registry property. Delete it when it's formatted wrong.
+ * Return the property in "regPropp". "empty_prop" is used when it doesn't
+ * exist yet.
+ * Return OK when successful.
+ */
+ static int
+GetRegProp(dpy, regPropp, numItemsp, domsg)
+ Display *dpy;
+ char_u **regPropp;
+ long_u *numItemsp;
+ int domsg; /* When TRUE give error message. */
+{
+ int result, actualFormat;
+ long_u bytesAfter;
+ Atom actualType;
+
+ *regPropp = NULL;
+ result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L,
+ (long)MAX_PROP_WORDS, False,
+ XA_STRING, &actualType,
+ &actualFormat, numItemsp, &bytesAfter,
+ regPropp);
+
+ if (actualType == None)
+ {
+ /* No prop yet. Logically equal to the empty list */
+ *numItemsp = 0;
+ *regPropp = empty_prop;
+ return OK;
+ }
+
+ /* If the property is improperly formed, then delete it. */
+ if (result != Success || actualFormat != 8 || actualType != XA_STRING)
+ {
+ if (*regPropp != NULL)
+ XFree(*regPropp);
+ XDeleteProperty(dpy, RootWindow(dpy, 0), registryProperty);
+ if (domsg)
+ EMSG(_("E251: VIM instance registry property is badly formed. Deleted!"));
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * This procedure is invoked by the varous X event loops throughout Vims when
+ * a property changes on the communication window. This procedure reads the
+ * property and handles command requests and responses.
+ */
+ void
+serverEventProc(dpy, eventPtr)
+ Display *dpy;
+ XEvent *eventPtr; /* Information about event. */
+{
+ char_u *propInfo;
+ char_u *p;
+ int result, actualFormat, code;
+ long_u numItems, bytesAfter;
+ Atom actualType;
+
+ if (eventPtr != NULL)
+ {
+ if (eventPtr->xproperty.atom != commProperty
+ || eventPtr->xproperty.state != PropertyNewValue)
+ return;
+ }
+
+ /*
+ * Read the comm property and delete it.
+ */
+ propInfo = NULL;
+ result = XGetWindowProperty(dpy, commWindow, commProperty, 0L,
+ (long)MAX_PROP_WORDS, True,
+ XA_STRING, &actualType,
+ &actualFormat, &numItems, &bytesAfter,
+ &propInfo);
+
+ /* If the property doesn't exist or is improperly formed then ignore it. */
+ if (result != Success || actualType != XA_STRING || actualFormat != 8)
+ {
+ if (propInfo != NULL)
+ XFree(propInfo);
+ return;
+ }
+
+ /*
+ * Several commands and results could arrive in the property at
+ * one time; each iteration through the outer loop handles a
+ * single command or result.
+ */
+ for (p = propInfo; (p - propInfo) < numItems; )
+ {
+ /*
+ * Ignore leading NULs; each command or result starts with a
+ * NUL so that no matter how badly formed a preceding command
+ * is, we'll be able to tell that a new command/result is
+ * starting.
+ */
+ if (*p == 0)
+ {
+ p++;
+ continue;
+ }
+
+ if ((*p == 'c' || *p == 'k') && (p[1] == 0))
+ {
+ Window resWindow;
+ char_u *name, *script, *serial, *end, *res;
+ Bool asKeys = *p == 'k';
+ garray_T reply;
+
+ /*
+ * This is an incoming command from some other application.
+ * Iterate over all of its options. Stop when we reach
+ * the end of the property or something that doesn't look
+ * like an option.
+ */
+ p += 2;
+ name = NULL;
+ resWindow = None;
+ serial = (char_u *)"";
+ script = NULL;
+ while (p - propInfo < numItems && *p == '-')
+ {
+ switch (p[1])
+ {
+ case 'r':
+ end = skipwhite(p + 2);
+ resWindow = 0;
+ while (vim_isxdigit(*end))
+ {
+ resWindow = 16 * resWindow + (long_u)hex2nr(*end);
+ ++end;
+ }
+ if (end == p + 2 || *end != ' ')
+ resWindow = None;
+ else
+ {
+ p = serial = end + 1;
+ clientWindow = resWindow; /* Remember in global */
+ }
+ break;
+ case 'n':
+ if (p[2] == ' ')
+ name = p + 3;
+ break;
+ case 's':
+ if (p[2] == ' ')
+ script = p + 3;
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (script == NULL || name == NULL)
+ continue;
+
+ /*
+ * Initialize the result property, so that we're ready at any
+ * time if we need to return an error.
+ */
+ if (resWindow != None)
+ {
+ ga_init2(&reply, 1, 100);
+ ga_grow(&reply, 50);
+ sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0);
+ reply.ga_len = 10 + STRLEN(serial);
+ reply.ga_room -= reply.ga_len;
+ }
+ res = NULL;
+ if (serverName != NULL && STRICMP(name, serverName) == 0)
+ {
+ if (asKeys)
+ server_to_input_buf(script);
+ else
+ res = eval_client_expr_to_string(script);
+ }
+ if (resWindow != None)
+ {
+ if (res != NULL)
+ ga_concat(&reply, res);
+ else if (asKeys == 0)
+ {
+ ga_concat(&reply, (char_u *)_(e_invexprmsg));
+ ga_append(&reply, 0);
+ ga_concat(&reply, (char_u *)"-c 1");
+ }
+ ga_append(&reply, 0);
+ (void)AppendPropCarefully(dpy, resWindow, commProperty,
+ reply.ga_data, reply.ga_len);
+ }
+ vim_free(res);
+ }
+ else if (*p == 'r' && p[1] == 0)
+ {
+ int serial, gotSerial;
+ char_u *res;
+ PendingCommand *pcPtr;
+
+ /*
+ * This is a reply to some command that we sent out. Iterate
+ * over all of its options. Stop when we reach the end of the
+ * property or something that doesn't look like an option.
+ */
+ p += 2;
+ gotSerial = 0;
+ res = (char_u *)"";
+ code = 0;
+ while ((p-propInfo) < numItems && *p == '-')
+ {
+ switch (p[1])
+ {
+ case 'r':
+ if (p[2] == ' ')
+ res = p + 3;
+ break;
+ case 's':
+ if (sscanf((char *)p + 2, " %d", &serial) == 1)
+ gotSerial = 1;
+ break;
+ case 'c':
+ if (sscanf((char *)p + 2, " %d", &code) != 1)
+ code = 0;
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (!gotSerial)
+ continue;
+
+ /*
+ * Give the result information to anyone who's
+ * waiting for it.
+ */
+ for (pcPtr = pendingCommands; pcPtr != NULL; pcPtr = pcPtr->nextPtr)
+ {
+ if (serial != pcPtr->serial || pcPtr->result != NULL)
+ continue;
+
+ pcPtr->code = code;
+ if (res != NULL)
+ pcPtr->result = vim_strsave(res);
+ else
+ pcPtr->result = vim_strsave((char_u *)"");
+ break;
+ }
+ }
+ else if (*p == 'n' && p[1] == 0)
+ {
+ Window win = 0;
+ unsigned int u;
+ int gotWindow;
+ char_u *str;
+ char_u winstr[30];
+ struct ServerReply *r;
+
+ /*
+ * This is a (n)otification. Sent with serverreply_send in VimL.
+ * Execute any autocommand and save it for later retrieval
+ */
+ p += 2;
+ gotWindow = 0;
+ str = (char_u *)"";
+ while ((p-propInfo) < numItems && *p == '-')
+ {
+ switch (p[1])
+ {
+ case 'n':
+ if (p[2] == ' ')
+ str = p + 3;
+ break;
+ case 'w':
+ if (sscanf((char *)p + 2, " %x", &u) == 1)
+ {
+ win = u;
+ gotWindow = 1;
+ }
+ break;
+ }
+ while (*p != 0)
+ p++;
+ p++;
+ }
+
+ if (!gotWindow)
+ continue;
+ if ((r = ServerReplyFind(win, SROP_Add)) != NULL)
+ {
+ ga_concat(&(r->strings), str);
+ ga_append(&(r->strings), 0);
+ }
+#ifdef FEAT_AUTOCMD
+ sprintf((char *)winstr, "0x%x", (unsigned int)win);
+ apply_autocmds(EVENT_REMOTEREPLY, winstr, str, TRUE, curbuf);
+#endif
+
+ }
+ else
+ {
+ /*
+ * Didn't recognize this thing. Just skip through the next
+ * null character and try again.
+ * Even if we get an 'r'(eply) we will throw it away as we
+ * never specify (and thus expect) one
+ */
+ while (*p != 0)
+ p++;
+ p++;
+ }
+ }
+ XFree(propInfo);
+}
+
+/*
+ * Append a given property to a given window, but set up an X error handler so
+ * that if the append fails this procedure can return an error code rather
+ * than having Xlib panic.
+ * Return: 0 for OK, -1 for error
+ */
+ static int
+AppendPropCarefully(dpy, window, property, value, length)
+ Display *dpy; /* Display on which to operate. */
+ Window window; /* Window whose property is to be modified. */
+ Atom property; /* Name of property. */
+ char_u *value; /* Characters to append to property. */
+ int length; /* How much to append */
+{
+ XErrorHandler old_handler;
+
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+ XChangeProperty(dpy, window, property, XA_STRING, 8,
+ PropModeAppend, value, length);
+ XSync(dpy, False);
+ (void) XSetErrorHandler(old_handler);
+ return got_x_error ? -1 : 0;
+}
+
+
+/*
+ * Another X Error handler, just used to check for errors.
+ */
+/* ARGSUSED */
+ static int
+x_error_check(dpy, error_event)
+ Display *dpy;
+ XErrorEvent *error_event;
+{
+ got_x_error = TRUE;
+ return 0;
+}
+
+/*
+ * Check if "str" looks like it had a serial number appended.
+ * Actually just checks if the name ends in a digit.
+ */
+ static int
+IsSerialName(str)
+ char_u *str;
+{
+ int len = STRLEN(str);
+
+ return (len > 1 && vim_isdigit(str[len - 1]));
+}
+#endif /* FEAT_CLIENTSERVER */
diff --git a/src/iid_ole.c b/src/iid_ole.c
new file mode 100644
index 000000000..6ade213fe
--- /dev/null
+++ b/src/iid_ole.c
@@ -0,0 +1,50 @@
+/* this file contains the actual definitions of */
+/* the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+/* File created by MIDL compiler version 3.00.44 */
+/* at Sat Jan 03 16:34:55 1998
+ */
+/* Compiler settings for if_ole.idl:
+ Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
+ error checks: none
+*/
+//@@MIDL_FILE_HEADING( )
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+const IID IID_IVim = {0x0F0BFAE2,0x4C90,0x11d1,{0x82,0xD7,0x00,0x04,0xAC,0x36,0x85,0x19}};
+
+
+const IID LIBID_Vim = {0x0F0BFAE0,0x4C90,0x11d1,{0x82,0xD7,0x00,0x04,0xAC,0x36,0x85,0x19}};
+
+
+const CLSID CLSID_Vim = {0x0F0BFAE1,0x4C90,0x11d1,{0x82,0xD7,0x00,0x04,0xAC,0x36,0x85,0x19}};
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/infplist.xml b/src/infplist.xml
new file mode 100644
index 000000000..f0ba5fc58
--- /dev/null
+++ b/src/infplist.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vim:set ts=2 sts=2 sw=2 tw=0: -->
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+ <dict>
+
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+
+ <key>CFBundleExecutable</key>
+ <string>APP_EXE</string>
+ <key>CFBundleName</key>
+ <string>APP_NAME</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleVersion</key>
+ <string>APP_VER</string>
+ <key>CFBundleShortVersionString</key>
+ <string>APP_VER</string>
+ <key>CFBundleSignature</key>
+ <string>VIM!</string>
+
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CSResourcesFileMapped</key>
+ <true/>
+ <key>CFBundleIconFile</key>
+ <string>ICON_APP</string>
+
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>*</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>doc-txt.icns</string>
+ <key>CFBundleTypeName</key>
+ <string>NSStringPboardType</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ </array>
+
+ </dict>
+</plist>
diff --git a/src/integration.c b/src/integration.c
new file mode 100644
index 000000000..05a9dec3f
--- /dev/null
+++ b/src/integration.c
@@ -0,0 +1,1198 @@
+/* vi:set ts=8 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Integration with Sun Workshop.
+ *
+ * This file should not change much, it's also used by other editors that
+ * connect to Workshop. Consider changing workshop.c instead.
+ */
+/*
+-> consider using MakeSelectionVisible instead of gotoLine hacks
+ to show the line properly
+ -> consider using glue instead of our own message wrapping functions
+ (but can only use glue if we don't have to distribute source)
+*/
+
+#include "vim.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+
+#ifdef INET_SOCKETS
+#include <netdb.h>
+#include <netinet/in.h>
+#else
+#include <sys/un.h>
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/param.h>
+#ifdef HAVE_LIBGEN_H
+# include <libgen.h>
+#endif
+#include <unistd.h>
+#include <string.h>
+
+#include <X11/Intrinsic.h>
+#include <Xm/Xm.h>
+#include <Xm/AtomMgr.h>
+#include <Xm/PushB.h>
+
+#ifdef HAVE_X11_XPM_H
+# include <X11/xpm.h>
+#else
+# ifdef HAVE_XM_XPMP_H
+# include <Xm/XpmP.h>
+# endif
+#endif
+
+#ifdef HAVE_UTIL_DEBUG_H
+# include <util/debug.h>
+#endif
+#ifdef HAVE_UTIL_MSGI18N_H
+# include <util/msgi18n.h>
+#endif
+
+#include "integration.h" /* <EditPlugin/integration.h> */
+#ifdef HAVE_FRAME_H
+# include <frame.h>
+#endif
+
+#ifndef MAX
+# define MAX(a, b) (a) > (b) ? (a) : (b)
+#endif
+
+#ifndef NOCATGETS
+# define NOCATGETS(x) x
+#endif
+
+/* Functions private to this file */
+static void workshop_connection_closed(void);
+static void messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2);
+static void workshop_disconnect(void);
+static void workshop_sensitivity(int num, char *table);
+static void adjust_sign_name(char *filename);
+static void process_menuItem(char *);
+static void process_toolbarButton(char *);
+static void workshop_set_option_first(char *name, char *value);
+
+
+#define CMDBUFSIZ 2048
+
+#ifdef DEBUG
+static FILE *dfd;
+static void pldebug(char *, ...);
+static void unrecognised_message(char *);
+
+#define HANDLE_ERRORS(cmd) else unrecognised_message(cmd);
+#else
+#define HANDLE_ERRORS(cmd)
+#endif
+
+/*
+ * Version number of the protocol between an editor and eserve.
+ * This number should be incremented when the protocol
+ * is changed.
+ */
+#define PROTOCOL_VERSION "4.0.0"
+
+static int sd = -1;
+static XtInputId inputHandler; /* Cookie for input */
+
+Boolean save_files = True; /* When true, save all files before build actions */
+
+void
+workshop_connection_closed(void)
+{
+ /*
+ * socket closed on other end
+ */
+ XtRemoveInput(inputHandler);
+ inputHandler = 0;
+ sd = -1;
+}
+
+ static char *
+getCommand(void)
+{
+ int len; /* length of this command */
+ char lenbuf[7]; /* get the length string here */
+ char *newcb; /* used to realloc cmdbuf */
+ static char *cmdbuf;/* get the command string here */
+ static int cbsize;/* size of cmdbuf */
+
+ if ((len = read(sd, &lenbuf, 6)) == 6) {
+ lenbuf[6] = 0; /* Terminate buffer such that atoi() works right */
+ len = atoi(lenbuf);
+ if (cbsize < (len + 1)) {
+ newcb = (char *) realloc(cmdbuf,
+ MAX((len + 256), CMDBUFSIZ));
+ if (newcb != NULL) {
+ cmdbuf = newcb;
+ cbsize = MAX((len + 256), CMDBUFSIZ);
+ }
+ }
+ if (cbsize >= len && (len = read(sd, cmdbuf, len)) > 0) {
+ cmdbuf[len] = 0;
+ return cmdbuf;
+ } else {
+ return NULL;
+ }
+ } else {
+ if (len == 0) { /* EOF */
+ workshop_connection_closed();
+ }
+ return NULL;
+ }
+
+}
+
+/*ARGSUSED*/
+void
+messageFromEserve(XtPointer clientData, int *NOTUSED1, XtInputId *NOTUSED2)
+{
+ char *cmd; /* the 1st word of the command */
+
+ cmd = getCommand();
+ if (cmd == NULL) {
+ /* We're being shut down by eserve and the "quit" message
+ * didn't arrive before the socket connection got closed */
+ return;
+ }
+#ifdef DEBUG
+ pldebug("%s\n", cmd);
+#endif
+ switch (*cmd) {
+ case 'a':
+ if (cmd[1] == 'c' &&
+ strncmp(cmd, NOCATGETS("ack "), 4) == 0) {
+ int ackNum;
+ char buf[20];
+
+ ackNum = atoi(&cmd[4]);
+ sprintf(buf, NOCATGETS("ack %d\n"), ackNum);
+ write(sd, buf, strlen(buf));
+ } else if (strncmp(cmd,
+ NOCATGETS("addMarkType "), 12) == 0) {
+ int idx;
+ char *color;
+ char *sign;
+
+ idx = atoi(strtok(&cmd[12], " "));
+ color = strtok(NULL, NOCATGETS("\001"));
+ sign = strtok(NULL, NOCATGETS("\001"));
+ /* Skip space that separates names */
+ if (color) {
+ color++;
+ }
+ if (sign) {
+ sign++;
+ }
+ /* Change sign name to accomodate a different size? */
+ adjust_sign_name(sign);
+ workshop_add_mark_type(idx, color, sign);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'b':
+ if (strncmp(cmd,
+ NOCATGETS("balloon "), 8) == 0) {
+ char *tip;
+
+ tip = strtok(&cmd[8], NOCATGETS("\001"));
+ workshop_show_balloon_tip(tip);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'c':
+ if (strncmp(cmd,
+ NOCATGETS("changeMarkType "), 15) == 0) {
+ char *file;
+ int markId;
+ int type;
+
+ file = strtok(&cmd[15], " ");
+ markId = atoi(strtok(NULL, " "));
+ type = atoi(strtok(NULL, " "));
+ workshop_change_mark_type(file, markId, type);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'd':
+ if (strncmp(cmd, NOCATGETS("deleteMark "), 11) == 0) {
+ char *file;
+ int markId;
+
+ file = strtok(&cmd[11], " ");
+ markId = atoi(strtok(NULL, " "));
+ workshop_delete_mark(file, markId);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'f':
+ if (cmd[1] == 'o' &&
+ strncmp(cmd, NOCATGETS("footerMsg "), 10) == 0) {
+ int severity;
+ char *message;
+
+ severity =
+ atoi(strtok(&cmd[10], " "));
+ message = strtok(NULL, NOCATGETS("\001"));
+
+ workshop_footer_message(message, severity);
+ } else if (strncmp(cmd,
+ NOCATGETS("frontFile "), 10) == 0) {
+ char *file;
+
+ file = strtok(&cmd[10], " ");
+ workshop_front_file(file);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'g':
+ if (cmd[1] == 'e' &&
+ strncmp(cmd, NOCATGETS("getMarkLine "), 12) == 0) {
+ char *file;
+ int markid;
+ int line;
+ char buf[100];
+
+ file = strtok(&cmd[12], " ");
+ markid = atoi(strtok(NULL, " "));
+ line = workshop_get_mark_lineno(file, markid);
+ sprintf(buf, NOCATGETS("markLine %s %d %d\n"),
+ file, markid, line);
+ write(sd, buf, strlen(buf));
+ } else if (cmd[1] == 'o' && cmd[4] == 'L' &&
+ strncmp(cmd, NOCATGETS("gotoLine "), 9) == 0) {
+ char *file;
+ int lineno;
+
+ file = strtok(&cmd[9], " ");
+ lineno = atoi(strtok(NULL, " "));
+ workshop_goto_line(file, lineno);
+ } else if (strncmp(cmd,
+ NOCATGETS("gotoMark "), 9) == 0) {
+ char *file;
+ int markId;
+ char *message;
+
+ file = strtok(&cmd[9], " ");
+ markId = atoi(strtok(NULL, " "));
+ message = strtok(NULL, NOCATGETS("\001"));
+ workshop_goto_mark(file, markId, message);
+#ifdef NOHANDS_SUPPORT_FUNCTIONS
+ } else if (strcmp(cmd, NOCATGETS("getCurrentFile")) == 0) {
+ char *f = workshop_test_getcurrentfile();
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("currentFile %d %s"),
+ f ? strlen(f) : 0, f ? f : "");
+ workshop_send_message(buffer);
+ } else if (strcmp(cmd, NOCATGETS("getCursorRow")) == 0) {
+ int row = workshop_test_getcursorrow();
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("cursorRow %d"), row);
+ workshop_send_message(buffer);
+ } else if (strcmp(cmd, NOCATGETS("getCursorCol")) == 0) {
+ int col = workshop_test_getcursorcol();
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("cursorCol %d"), col);
+ workshop_send_message(buffer);
+ } else if (strcmp(cmd, NOCATGETS("getCursorRowText")) == 0) {
+ char *t = workshop_test_getcursorrowtext();
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("cursorRowText %d %s"),
+ t ? strlen(t) : 0, t ? t : "");
+ workshop_send_message(buffer);
+ } else if (strcmp(cmd, NOCATGETS("getSelectedText")) == 0) {
+ char *t = workshop_test_getselectedtext();
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("selectedText %d %s"),
+ t ? strlen(t) : 0, t ? t : "");
+ workshop_send_message(buffer);
+#endif
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'l':
+ if (strncmp(cmd, NOCATGETS("loadFile "), 9) == 0) {
+ char *file;
+ int line;
+ char *frameid;
+
+ file = strtok(&cmd[9], " ");
+ line = atoi(strtok(NULL, " "));
+ frameid = strtok(NULL, " ");
+ workshop_load_file(file, line, frameid);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'm': /* Menu, minimize, maximize */
+ if (cmd[1] == 'e' && cmd[4] == 'B' &&
+ strncmp(cmd, NOCATGETS("menuBegin "), 10) == 0) {
+ workshop_menu_begin(&cmd[10]);
+ } else if (cmd[1] == 'e' && cmd[4] == 'I' &&
+ strncmp(cmd, NOCATGETS("menuItem "), 9) == 0) {
+ process_menuItem(cmd);
+ } else if (cmd[1] == 'e' && cmd[4] == 'E' &&
+ strcmp(cmd, NOCATGETS("menuEnd")) == 0) {
+ workshop_menu_end();
+ } else if (cmd[1] == 'a' &&
+ strcmp(cmd, NOCATGETS("maximize")) == 0) {
+ workshop_maximize();
+ } else if (strcmp(cmd, NOCATGETS("minimize")) == 0) {
+ workshop_minimize();
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'o':
+ if (cmd[1] == 'p' &&
+ strcmp(cmd, NOCATGETS("option"))) {
+ char *name;
+ char *value;
+
+ name = strtok(&cmd[7], " ");
+ value = strtok(NULL, " ");
+ workshop_set_option_first(name, value);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'p':
+ if (strcmp(cmd, NOCATGETS("ping")) == 0) {
+#if 0
+ int pingNum;
+
+ pingNum = atoi(&cmd[5]);
+ workshop_send_ack(ackNum);
+ WHAT DO I DO HERE?
+#endif
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'q':
+ if (strncmp(cmd, NOCATGETS("quit"), 4) == 0) {
+
+ /* Close the connection. It's important to do
+ * that now, since workshop_quit might be
+ * looking at open files. For example, if you
+ * have modified one of the files without
+ * saving, NEdit will ask you what you want to
+ * do, and spin loop by calling
+ * XtAppProcessEvent while waiting for your
+ * reply. In this case, if we still have an
+ * input handler and the socket has been
+ * closed on the other side when eserve
+ * expired, we will hang in IoWait.
+ */
+ workshop_disconnect();
+
+ workshop_quit();
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 'r':
+ if (cmd[1] == 'e' &&
+ strncmp(cmd, NOCATGETS("reloadFile "), 11) == 0) {
+ char *file;
+ int line;
+
+ file = strtok(&cmd[11], " ");
+ line = atoi(strtok(NULL, " "));
+ workshop_reload_file(file, line);
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 's':
+ if (cmd[1] == 'e' && cmd[2] == 't' &&
+ strncmp(cmd, NOCATGETS("setMark "), 8) == 0) {
+ char *file;
+ int line;
+ int markId;
+ int type;
+
+ file = strtok(&cmd[8], " ");
+ line = atoi(strtok(NULL, " "));
+ markId = atoi(strtok(NULL, " "));
+ type = atoi(strtok(NULL, " "));
+ workshop_set_mark(file, line, markId, type);
+ } else if (cmd[1] == 'h' &&
+ strncmp(cmd, NOCATGETS("showFile "), 9) == 0) {
+ workshop_show_file(&cmd[9]);
+ } else if (cmd[1] == 'u' &&
+ strncmp(cmd, NOCATGETS("subMenu "), 8) == 0) {
+ char *label;
+
+ label = strtok(&cmd[8], NOCATGETS("\001"));
+ workshop_submenu_begin(label);
+ } else if (cmd[1] == 'u' &&
+ strcmp(cmd, NOCATGETS("subMenuEnd")) == 0) {
+ workshop_submenu_end();
+ } else if (cmd[1] == 'e' && cmd[2] == 'n' &&
+ strncmp(cmd, NOCATGETS("sensitivity "), 12) == 0) {
+ int num;
+ char *bracket;
+ char *table;
+
+ num = atoi(strtok(&cmd[12], " "));
+ bracket = strtok(NULL, " ");
+ if (*bracket != '[') {
+ fprintf(stderr, NOCATGETS("Parsing "
+ "error for sensitivity\n"));
+ } else {
+ table = strtok(NULL, NOCATGETS("]"));
+ workshop_sensitivity(num, table);
+ }
+ } else if (cmd[1] == 'e' && cmd[2] == 'n' && cmd[3] == 'd' &&
+ strncmp(cmd, NOCATGETS("sendVerb "), 9) == 0) {
+ /* Send the given verb back (used for the
+ * debug.lineno callback (such that other tools
+ * can obtain the position coordinates or the
+ * selection) */
+ char *verb;
+
+ verb = strtok(&cmd[9], " ");
+ workshop_perform_verb(verb, NULL);
+ } else if (cmd[1] == 'a' &&
+ strncmp(cmd, NOCATGETS("saveFile "), 9) == 0) {
+ workshop_save_file(&cmd[9]);
+#ifdef NOHANDS_SUPPORT_FUNCTIONS
+ } else if (strncmp(cmd, NOCATGETS("saveSensitivity "), 16) == 0) {
+ char *file;
+
+ file = strtok(&cmd[16], " ");
+ workshop_save_sensitivity(file);
+#endif
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+ case 't': /* Toolbar */
+ if (cmd[8] == 'e' &&
+ strncmp(cmd, NOCATGETS("toolbarBegin"), 12) == 0) {
+ workshop_toolbar_begin();
+ } else if (cmd[8] == 'u' &&
+ strncmp(cmd, NOCATGETS("toolbarButton"), 13) == 0) {
+ process_toolbarButton(cmd);
+ } else if (cmd[7] == 'E' &&
+ strcmp(cmd, NOCATGETS("toolbarEnd")) == 0) {
+ workshop_toolbar_end();
+ }
+ HANDLE_ERRORS(cmd);
+ break;
+
+#ifdef DEBUG
+ default:
+ unrecognised_message(cmd);
+ break;
+#endif
+ }
+}
+
+static void
+process_menuItem(
+ char *cmd)
+{
+ char *label = strtok(&cmd[9], NOCATGETS("\001"));
+ char *verb = strtok(NULL, NOCATGETS("\001"));
+ char *acc = strtok(NULL, NOCATGETS("\001"));
+ char *accText = strtok(NULL, NOCATGETS("\001"));
+ char *name = strtok(NULL, NOCATGETS("\001"));
+ char *sense = strtok(NULL, NOCATGETS("\n"));
+ char *filepos = strtok(NULL, NOCATGETS("\n"));
+ if (*acc == '-') {
+ acc = NULL;
+ }
+ if (*accText == '-') {
+ accText = NULL;
+ }
+ workshop_menu_item(label, verb, acc, accText, name, filepos, sense);
+
+}
+
+
+static void
+process_toolbarButton(
+ char *cmd) /* button definition */
+{
+ char *label = strtok(&cmd[14], NOCATGETS("\001"));
+ char *verb = strtok(NULL, NOCATGETS("\001"));
+ char *senseVerb = strtok(NULL, NOCATGETS("\001"));
+ char *filepos = strtok(NULL, NOCATGETS("\001"));
+ char *help = strtok(NULL, NOCATGETS("\001"));
+ char *sense = strtok(NULL, NOCATGETS("\001"));
+ char *file = strtok(NULL, NOCATGETS("\001"));
+ char *left = strtok(NULL, NOCATGETS("\n"));
+
+ if (!strcmp(label, NOCATGETS("-"))) {
+ label = NULL;
+ }
+ if (!strcmp(help, NOCATGETS("-"))) {
+ help = NULL;
+ }
+ if (!strcmp(file, NOCATGETS("-"))) {
+ file = NULL;
+ }
+ if (!strcmp(senseVerb, NOCATGETS("-"))) {
+ senseVerb = NULL;
+ }
+ workshop_toolbar_button(label, verb, senseVerb, filepos, help,
+ sense, file, left);
+}
+
+
+#ifdef DEBUG
+void
+unrecognised_message(
+ char *cmd)
+{
+ pldebug("Unrecognised eserve message:\n\t%s\n", cmd);
+ /* abort(); */
+}
+#endif
+
+
+/* Change sign name to accomodate a different size:
+ * Create the filename based on the height. The filename format
+ * of multisize icons are:
+ * x.xpm : largest icon
+ * x1.xpm : smaller icon
+ * x2.xpm : smallest icon */
+ void
+adjust_sign_name(char *filename)
+{
+ char *s;
+ static int fontSize = -1;
+
+ if (fontSize == -1)
+ fontSize = workshop_get_font_height();
+ if (fontSize == 0)
+ return;
+ if (filename[0] == '-')
+ return;
+
+ /* This is ugly: later we should instead pass the fontheight over
+ * to eserve on startup and let eserve just send the right filenames
+ * to us in the first place
+
+ * I know that the filename will end with 1.xpm (see
+ * GuiEditor.cc`LispPrintSign if you wonder why) */
+ s = filename+strlen(filename)-5;
+ if (fontSize <= 11)
+ strcpy(s, "2.xpm");
+ else if (fontSize <= 15)
+ strcpy(s, "1.xpm");
+ else
+ strcpy(s, ".xpm");
+}
+
+/* Were we invoked by WorkShop? This function can be used early during startup
+ if you want to do things differently if the editor is started standalone
+ or in WorkShop mode. For example, in standalone mode you may not want to
+ add a footer/message area or a sign gutter. */
+int
+workshop_invoked()
+{
+ static int result = -1;
+ if (result == -1) {
+ result = (getenv(NOCATGETS("SPRO_EDITOR_SOCKET")) != NULL);
+ }
+ return result;
+}
+
+/* Connect back to eserve */
+void workshop_connect(XtAppContext context)
+{
+#ifdef INET_SOCKETS
+ struct sockaddr_in server;
+ struct hostent * host;
+ int port;
+#else
+ struct sockaddr_un server;
+#endif
+ char buf[32];
+ char * address;
+#ifdef DEBUG
+ char *file;
+#endif
+
+ address = getenv(NOCATGETS("SPRO_EDITOR_SOCKET"));
+ if (address == NULL) {
+ return;
+ }
+
+#ifdef INET_SOCKETS
+ port = atoi(address);
+
+ if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+
+ /* Get the server internet address and put into addr structure */
+ /* fill in the socket address structure and connect to server */
+ memset((char *)&server, '\0', sizeof(server));
+ server.sin_family = AF_INET;
+ server.sin_port = port;
+ if ((host = gethostbyname(NOCATGETS("localhost"))) == NULL) {
+ PERROR(NOCATGETS("gethostbyname"));
+ sd = -1;
+ return;
+ }
+ memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
+#else
+ if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+
+ server.sun_family = AF_UNIX;
+ strcpy(server.sun_path, address);
+#endif
+ /* Connect to server */
+ if (connect(sd, (struct sockaddr *)&server, sizeof(server))) {
+ if (errno == ECONNREFUSED) {
+ close(sd);
+#ifdef INET_SOCKETS
+ if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+#else
+ if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+#endif
+ if (connect(sd, (struct sockaddr *)&server,
+ sizeof(server))) {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+
+ } else {
+ PERROR(NOCATGETS("workshop_connect"));
+ return;
+ }
+ }
+
+ /* tell notifier we are interested in being called
+ * when there is input on the editor connection socket
+ */
+ inputHandler = XtAppAddInput(context, sd, (XtPointer) XtInputReadMask,
+ messageFromEserve, NULL);
+#ifdef DEBUG
+ if ((file = getenv(NOCATGETS("SPRO_PLUGIN_DEBUG"))) != NULL) {
+ char buf[BUFSIZ];
+
+ unlink(file);
+ sprintf(buf, "date > %s", file);
+ system(buf);
+ dfd = fopen(file, "a");
+ } else {
+ dfd = NULL;
+ }
+#endif
+
+ sprintf(buf, NOCATGETS("connected %s %s %s\n"),
+ workshop_get_editor_name(),
+ PROTOCOL_VERSION,
+ workshop_get_editor_version());
+ write(sd, buf, strlen(buf));
+
+ sprintf(buf, NOCATGETS("ack 1\n"));
+ write(sd, buf, strlen(buf));
+}
+
+void workshop_disconnect()
+{
+ /* Probably need to send some message here */
+
+ /*
+ * socket closed on other end
+ */
+ XtRemoveInput(inputHandler);
+ close(sd);
+ inputHandler = 0;
+ sd = -1;
+
+}
+
+/*
+ * Utility functions
+ */
+
+/* Set icon for the window */
+void
+workshop_set_icon(Display *display, Widget shell, char **xpmdata,
+ int width, int height)
+{
+ Pixel bgPixel;
+ XpmAttributes xpmAttributes;
+ XSetWindowAttributes attr;
+ Window iconWindow;
+ int depth;
+ int screenNum;
+ Pixmap pixmap;
+
+ /* Create the pixmap/icon window which is shown when you
+ * iconify the sccs viewer
+ * This code snipped was adapted from Sun WorkShop's source base,
+ * setIcon.cc.
+ */
+ XtVaGetValues(shell, XmNbackground, &bgPixel, NULL);
+ screenNum = XScreenNumberOfScreen(XtScreen(shell));
+ depth = DisplayPlanes(display, screenNum);
+ xpmAttributes.valuemask = XpmColorSymbols;
+ xpmAttributes.numsymbols = 1;
+ xpmAttributes.colorsymbols =
+ (XpmColorSymbol *)XtMalloc(sizeof (XpmColorSymbol) *
+ xpmAttributes.numsymbols);
+ xpmAttributes.colorsymbols[0].name = NOCATGETS("BgColor");
+ xpmAttributes.colorsymbols[0].value = NULL;
+ xpmAttributes.colorsymbols[0].pixel = bgPixel;
+ if (XpmCreatePixmapFromData(display,
+ RootWindow(display, screenNum), xpmdata, &pixmap,
+ NULL, &xpmAttributes) >= 0) {
+ attr.background_pixmap = pixmap;
+ iconWindow = XCreateWindow(display, RootWindow(display,
+ screenNum), 0, 0, width, height, 0, depth,
+ (unsigned int)CopyFromParent,
+ CopyFromParent, CWBackPixmap, &attr);
+
+ XtVaSetValues(shell,
+ XtNiconWindow, iconWindow, NULL);
+ }
+ XtFree((char *)xpmAttributes.colorsymbols);
+}
+
+/* Minimize and maximize shells. From libutil's shell.cc. */
+
+/* utility functions from libutil's shell.cc */
+static Boolean
+isWindowMapped(Display *display, Window win)
+{
+ XWindowAttributes winAttrs;
+ XGetWindowAttributes(display,
+ win,
+ &winAttrs);
+ if (winAttrs.map_state == IsViewable) {
+ return(True);
+ } else {
+ return(False);
+ }
+}
+
+static Boolean
+isMapped(Widget widget)
+{
+ if (widget == NULL) {
+ return(False);
+ }
+
+ if (XtIsRealized(widget) == False) {
+ return(False);
+ }
+
+ return(isWindowMapped(XtDisplay(widget), XtWindow(widget)));
+}
+
+static Boolean
+widgetIsIconified(
+ Widget w)
+{
+ Atom wm_state;
+ Atom act_type; /* actual Atom type returned */
+ int act_fmt; /* actual format returned */
+ u_long nitems_ret; /* number of items returned */
+ u_long bytes_after; /* number of bytes remaining */
+ u_long *property; /* actual property returned */
+
+ /*
+ * If a window is iconified its WM_STATE is set to IconicState. See
+ * ICCCM Version 2.0, section 4.1.3.1 for more details.
+ */
+
+ wm_state = XmInternAtom(XtDisplay(w), NOCATGETS("WM_STATE"), False);
+ if (XtWindow(w) != 0) { /* only check if window exists! */
+ XGetWindowProperty(XtDisplay(w), XtWindow(w), wm_state, 0L, 2L,
+ False, AnyPropertyType, &act_type, &act_fmt, &nitems_ret,
+ &bytes_after, (u_char **) &property);
+ if (nitems_ret == 2 && property[0] == IconicState) {
+ return True;
+ }
+ }
+
+ return False;
+
+} /* end widgetIsIconified */
+
+void
+workshop_minimize_shell(Widget shell)
+{
+ if (shell != NULL &&
+ XtIsObject(shell) &&
+ XtIsRealized(shell) == True) {
+ if (isMapped(shell) == True) {
+ XIconifyWindow(XtDisplay(shell), XtWindow(shell),
+ XScreenNumberOfScreen(XtScreen(shell)));
+ }
+ XtVaSetValues(shell,
+ XmNiconic, True,
+ NULL);
+ }
+}
+
+void workshop_maximize_shell(Widget shell)
+{
+ if (shell != NULL &&
+ XtIsRealized(shell) == True &&
+ widgetIsIconified(shell) == True &&
+ isMapped(shell) == False) {
+ XtMapWidget(shell);
+ /* This used to be
+ XtPopdown(shell);
+ XtPopup(shell, XtGrabNone);
+ However, I found that that would drop any transient
+ windows that had been iconified with the window.
+ According to the ICCCM, XtMapWidget should be used
+ to bring a window from Iconic to Normal state.
+ However, Rich Mauri did a lot of work on this during
+ Bart, and found that XtPopDown,XtPopup was required
+ to fix several bugs involving multiple CDE workspaces.
+ I've tested it now and things seem to work fine but
+ I'm leaving this note for history in case this needs
+ to be revisited.
+ */
+ }
+}
+
+
+Boolean workshop_get_width_height(int *width, int *height)
+{
+ static int wid = 0;
+ static int hgt = 0;
+ static Boolean firstTime = True;
+ static Boolean success = False;
+
+ if (firstTime) {
+ char *settings;
+
+ settings = getenv(NOCATGETS("SPRO_GUI_WIDTH_HEIGHT"));
+ if (settings != NULL) {
+ wid = atoi(settings);
+ settings = strrchr(settings, ':');
+ if (settings++ != NULL) {
+ hgt = atoi(settings);
+ }
+ if (wid > 0 && hgt > 0) {
+ success = True;
+ }
+ firstTime = False;
+ }
+ }
+
+ if (success) {
+ *width = wid;
+ *height = hgt;
+ }
+ return success;
+}
+
+
+Boolean workshop_get_rows_cols(int *rows, int *cols)
+{
+ static int r = 0;
+ static int c = 0;
+ static Boolean firstTime = True;
+ static Boolean success = False;
+
+ if (firstTime) {
+ char *settings;
+
+ settings = getenv(NOCATGETS("SPRO_GUI_ROWS_COLS"));
+ if (settings != NULL) {
+ r = atoi(settings);
+ settings = strrchr(settings, ':');
+ if (settings++ != NULL) {
+ c = atoi(settings);
+ }
+ if (r > 0 && c > 0) {
+ success = True;
+ }
+ firstTime = False;
+ }
+ }
+
+ if (success) {
+ *rows = r;
+ *cols = c;
+ }
+ return success;
+}
+
+/*
+ * Toolbar code
+ */
+
+void workshop_sensitivity(int num, char *table)
+{
+ /* build up a verb table */
+ VerbSense *vs;
+ int i;
+ char *s;
+ if ((num < 1) || (num > 500)) {
+ return;
+ }
+
+ vs = (VerbSense *)malloc((num+1)*sizeof(VerbSense));
+
+ /* Point to the individual names (destroys the table string, but
+ * that's okay -- this is more efficient than duplicating strings) */
+ s = table;
+ for (i = 0; i < num; i++) {
+ while (*s == ' ') {
+ s++;
+ }
+ vs[i].verb = s;
+ while (*s && (*s != ' ') && (*s != '\001')) {
+ s++;
+ }
+ if (*s == 0) {
+ vs[i].verb = NULL;
+ break;
+ }
+ if (*s == '\001') {
+ *s = 0;
+ s++;
+ }
+ *s = 0;
+ s++;
+ while (*s == ' ') {
+ s++;
+ }
+ if (*s == '1') {
+ vs[i].sense = 1;
+ } else {
+ vs[i].sense = 0;
+ }
+ s++;
+ }
+ vs[i].verb = NULL;
+
+ workshop_frame_sensitivities(vs);
+
+ free(vs);
+}
+
+/*
+ * Options code
+ */
+/* Set an editor option.
+ * IGNORE an option if you do not recognize it.
+ */
+void workshop_set_option_first(char *name, char *value)
+{
+ /* Currently value can only be on/off. This may change later (for
+ * example to set an option like "balloon evaluate delay", but
+ * for now just convert it into a boolean */
+ Boolean on = !strcmp(value, "on");
+
+ if (!strcmp(name, "workshopkeys")) {
+ workshop_hotkeys(on);
+ } else if (!strcmp(name, "savefiles")) {
+ save_files = on;
+ } else if (!strcmp(name, "balloon")) {
+ workshop_balloon_mode(on);
+ } else if (!strcmp(name, "balloondelay")) {
+ int delay = atoi(value);
+ /* Should I validate the number here?? */
+ workshop_balloon_delay(delay);
+ } else {
+ /* Let editor interpret it */
+ workshop_set_option(name, value);
+ }
+}
+
+
+
+/*
+ * Send information to eserve on certain editor events
+ * You must make sure these are called when necessary
+ */
+
+void workshop_file_closed(char *filename)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("deletedFile %s\n"), filename);
+ write(sd, buffer, strlen(buffer));
+}
+
+void workshop_file_closed_lineno(char *filename, int lineno)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("deletedFile %s %d\n"), filename, lineno);
+ write(sd, buffer, strlen(buffer));
+}
+
+void workshop_file_opened(char *filename, int readOnly)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("loadedFile %s %d\n"), filename, readOnly);
+ write(sd, buffer, strlen(buffer));
+}
+
+
+void workshop_file_saved(char *filename)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("savedFile %s\n"), filename);
+ write(sd, buffer, strlen(buffer));
+
+ /* Let editor report any moved marks that the eserve client
+ * should deal with (for example, moving location-based breakpoints) */
+ workshop_moved_marks(filename);
+}
+
+void workshop_move_mark(char *filename, int markId, int newLineno)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
+ write(sd, buffer, strlen(buffer));
+}
+
+void workshop_file_modified(char *filename)
+{
+ char buffer[2*MAXPATHLEN];
+ sprintf(buffer, NOCATGETS("modifiedFile %s\n"), filename);
+ write(sd, buffer, strlen(buffer));
+}
+
+void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h)
+{
+ char buffer[200];
+
+ if (sd >= 0)
+ {
+ sprintf(buffer, NOCATGETS("frameAt %d %d %d %d\n"),
+ new_x, new_y, new_w, new_h);
+ write(sd, buffer, strlen(buffer));
+ }
+}
+
+/* A button in the toolbar has been pushed.
+ * Clientdata is a pointer used by the editor code to figure out the
+ * positions for this toolbar (probably by storing a window pointer,
+ * and then fetching the current buffer for that window and looking up
+ * cursor and selection positions etc.) */
+void workshop_perform_verb(char *verb, void *clientData)
+{
+ char *filename;
+ int curLine;
+ int curCol;
+ int selStartLine;
+ int selStartCol;
+ int selEndLine;
+ int selEndCol;
+ int selLength;
+ char *selection;
+
+ char buf[2*MAXPATHLEN];
+/* Later: needsFilePos indicates whether or not we need to fetch all this
+ * info for this verb... for now, however, it looks as if
+ * eserve parsing routines depend on it always being present */
+
+ if (workshop_get_positions(clientData,
+ &filename,
+ &curLine,
+ &curCol,
+ &selStartLine,
+ &selStartCol,
+ &selEndLine,
+ &selEndCol,
+ &selLength,
+ &selection)) {
+ if (selection == NULL) {
+ selection = NOCATGETS("");
+ }
+
+ /* Should I save the files??? This is currently done by checking
+ if the verb is one of a few recognized ones. Later we can pass
+ this list from eserve to the editor (it's currently hardcoded in
+ vi and emacs as well). */
+ if (save_files) {
+ if (!strcmp(verb, "build.build") || !strcmp(verb, "build.build-file") ||
+ !strcmp(verb, "debug.fix") || !strcmp(verb, "debug.fix-all")) {
+ workshop_save_files();
+ }
+ }
+
+ sprintf(buf, NOCATGETS("toolVerb %s %s %d,%d %d,%d %d,%d %d %s\n"),
+ verb,
+ filename,
+ curLine, curCol,
+ selStartLine, selStartCol,
+ selEndLine, selEndCol,
+ selLength,
+ selection);
+ write(sd, buf, strlen(buf));
+ if (*selection) {
+ free(selection);
+ }
+ }
+}
+
+/* Send a message to eserve */
+void workshop_send_message(char *buf)
+{
+ write(sd, buf, strlen(buf));
+}
+
+/* Some methods, like currentFile, cursorPos, etc. are missing here.
+ * But it looks like these are used for NoHands testing only so we
+ * won't bother requiring editors to implement these
+ */
+
+
+#ifdef DEBUG
+
+void
+pldebug(
+ char *fmt, /* a printf style format line */
+ ...)
+{
+ va_list ap;
+
+ if (dfd != NULL) {
+ va_start(ap, fmt);
+ vfprintf(dfd, fmt, ap);
+ va_end(ap);
+ fflush(dfd);
+ }
+
+} /* end pldebug */
+
+#endif
diff --git a/src/integration.h b/src/integration.h
new file mode 100644
index 000000000..d6c687d46
--- /dev/null
+++ b/src/integration.h
@@ -0,0 +1,453 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+/*
+ THIS IS AN UNSTABLE INTERFACE! It is unsupported and will likely
+ change in future releases, possibly breaking compatibility!
+*/
+
+#ifndef _INTEGRATION_H
+#define _INTEGRATION_H
+
+#include <X11/Intrinsic.h>
+#include <Xm/Xm.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Enable NoHands test support functions. Define this only if you want to
+ compile in support in the editor such that it can be run under
+ the WorkShop test suite. */
+#ifndef NOHANDS_SUPPORT_FUNCTIONS
+#define NOHANDS_SUPPORT_FUNCTIONS
+#endif
+
+
+/* This header file has three parts.
+ * 1. Functions you need to implement; these are called by the integration
+ * library
+ * 2. Functions you need to call when certain events happen in the editor;
+ * these are implemented by the integration library
+ * 3. Utility functions provided by the integration library; these make
+ * task 1 a bit easier.
+ */
+
+/*
+ * The following functions need to be implemented by the editor
+ * integration code (and will be editor-specific). Please see the
+ * sample workshop.c file for comments explaining what each functions
+ * needs to do, what the arguments mean, etc.
+ */
+
+/*
+ * This string is recognized by eserve and should be all lower case.
+ * This is how the editor detects that it is talking to NEdit instead
+ * of Vim, for example, when the connection is initiated from the editor.
+ * Examples: "nedit", "gvim"
+ */
+char *workshop_get_editor_name();
+
+/*
+ * Version number of the editor.
+ * This number is communicated along with the protocol
+ * version to the application.
+ * Examples: "5.0.2", "19.3"
+ */
+char *workshop_get_editor_version();
+
+
+/* Goto a given line in a given file */
+void workshop_goto_line(char *filename, int lineno);
+
+
+/* Set mark in a given file */
+void workshop_set_mark(char *filename, int lineno, int markId, int type);
+
+
+/* Change mark type (for example from current-pc to pc-and-breakpoint) */
+void workshop_change_mark_type(char *filename, int markId, int type);
+
+/*
+ * Goto the given mark in a file (e.g. show it).
+ * If message is not null, display it in the footer.
+ */
+
+void workshop_goto_mark(char *filename, int markId, char *message);
+
+
+/* Delete mark */
+void workshop_delete_mark(char *filename, int markId);
+
+/* Begin/end pair of messages indicating that a series of _set_mark and
+ * _delete_mark messages will be sent. This can/should be used to suppress gui
+ * redraws between the begin and end messages. For example, if you switch
+ * to a headerfile that has a class breakpoint set, there may be hundreds
+ * of marks that need to be added. You don't want to refresh the gui for each
+ * added sign, you want to wait until the final end message.
+ */
+void workshop_mark_batch_begin();
+void workshop_mark_batch_end();
+
+
+/* Load a given file into the WorkShop buffer. "frameid" is a token string
+ * that identifies which frame the file would like to be loaded into. This
+ * will usually be null, in which case you should use the default frame.
+ * However, if frameid is not null, you need to find a frame that has this
+ * frameid, and replace the file in that frame. Finally, if the frameid is
+ * one you haven't seen before, you should create a new frame for this file.
+ * Note that "frameid" is a string value, not just an opaque pointer, so
+ * you should use strcmp rather than == when testing for equality.
+ */
+void workshop_load_file(char *filename, int line, char *frameid);
+
+
+/* Reload the WorkShop buffer */
+void workshop_reload_file(char *filename, int line);
+
+
+/* Show the given file */
+void workshop_show_file(char *filename);
+
+
+/* Front the given file */
+void workshop_front_file(char *filename);
+
+
+/* Save the given file */
+void workshop_save_file(char *filename);
+
+/* Save all WorkShop edited files. You can ask user about modified files
+ * and skip saving any files the user doesn't want to save.
+ * This function is typically called when the user issues a build, a fix,
+ * etc. (and also if you select "Save All" from the File menu :-)
+ */
+void workshop_save_files();
+
+/* Show a message in all footers.
+ Severity currently is not defined. */
+void workshop_footer_message(char *message, int severity);
+
+/* Minimize all windows */
+void workshop_minimize();
+
+
+/* Maximize all windows */
+void workshop_maximize();
+
+
+/*
+ * Create a new mark type, assign it a given index, a given textbackground
+ * color, and a given left-margin sign (where sign is a filename to an
+ * .xpm file)
+ */
+void workshop_add_mark_type(int idx, char *colorspec, char *sign);
+
+
+/* Get mark line number */
+int workshop_get_mark_lineno(char *filename, int markId);
+
+
+/* Exit editor; save confirmation dialogs are okay */
+void workshop_quit();
+
+/* Set an editor option.
+ * For example, name="syntax",value="on" would enable syntax highlighting.
+ * The currently defined options are:
+ * lineno {on,off} show line numbers
+ * syntax {on,off} highlight syntax
+ * parentheses {on,off} show matching parentheses
+ * The following options are interpreted by the library for you (so you
+ * will never see the message. However, the implementation requires you
+ * to provide certain callbacks, like restore hotkeys or save all files.
+ * These are documented separately).
+ * workshopkeys {on,off} set workshop hotkeys
+ * savefiles {on,off} save all files before issuing a build
+ * balloon {on,off} enable/disable balloon evaluate
+ *
+ * IGNORE an option if you do not recognize it.
+ */
+void workshop_set_option(char *name, char *value);
+
+/*
+ * (See workshop_add_frame first.) This function notifies the editor
+ * that the frame for the given window (indicated by "frame", which
+ * was supplied by the editor in workshop_add_frame) has been created.
+ * This can happen much later than the workshop_add_frame message, since
+ * often a window is created on editor startup, while the frame description
+ * is passed over from eserve much later, when the connection is complete.
+ * This gives the editor a chance to kick its GUI to show the frame
+ * properly; typically you'll unmanage and remanage the parent widget to
+ * force a geometry recalculation.
+ */
+
+void workshop_reconfigure_frame(void *frame);
+
+
+/* Are there any moved marks? If so, call workshop_move_mark on
+ * each of them now. This is how eserve can find out if for example
+ * breakpoints have moved when a program has been recompiled and
+ * reloaded into dbx.
+ */
+void workshop_moved_marks(char *filename);
+
+
+/* A button in the toolbar has been pushed. "frame" is provided
+ * which should let you determine which toolbar had a button pushed
+ * (you supplied this clientData when you created a toolbar). From
+ * this you should be able to figure out which file the operation
+ * applies to, and for that window the cursor line and column,
+ * selection begin line and column, selection end line and column,
+ * selection text and selection text length. The column numbers are
+ * currently unused but implement it anyway in case we decide to use
+ * them in the future.
+ * Note that frame can be NULL. In this case, you should pick
+ * a default window to translate coordinates for (ideally, the
+ * last window the user has operated on.) This will be the case when
+ * the user clicks on a Custom Button programmed to take the current
+ * line number as an argument. Here it's ambiguous which buffer
+ * to use, so you need to pick one.
+ * (Interface consideration: Perhaps we instead should add smarts
+ * into the library such that we remember which frame pointer
+ * we last noticed (e.g. last call to get_positions, or perhaps
+ * last add_frame) and then pass that instead? For example, we could
+ * have all workshop operations return the clientData when passed
+ * the filename (or add a filename-to-clientData converter?) and then
+ * remember the last filename/clientData used.
+ */
+int workshop_get_positions(void *frame,
+ char **filename,
+ int *curLine,
+ int *curCol,
+ int *selStartLine,
+ int *selStartCol,
+ int *selEndLine,
+ int *selEndCol,
+ int *selLength,
+ char **selection);
+
+/* The following function should return the height of a character
+ * in the text display. This is used to pick out a suitable size
+ * for the signs to match the text (currently available in three
+ * sizes). If you just return 0, WorkShop will use the default
+ * sign size. (Use XmStringExtent on character "A" to get the height.)
+ */
+
+int workshop_get_font_height(void);
+
+/* The following function requests that you register the given
+ * hotkey as a keyboard accelerator for all frames. Whenever the
+ * hotkey is pressed, you should invoke workshop_hotkey_pressed
+ * and pass the current frame pointer as an argument as well as
+ * the clientData pointer passed in to this function.
+ * The remove function unregisters the hotkey.
+ */
+void workshop_register_hotkey(Modifiers modifiers, KeySym keysym,
+ void *clientData);
+void workshop_unregister_hotkey(Modifiers modifiers, KeySym keysym,
+ void *clientData);
+
+
+
+
+/*
+ *
+ * The following functions notify eserve of important editor events,
+ * such as files being modified, files being saved, etc. You must
+ * sprinkle your editor code with calls to these. For example, whenever
+ * a file is modified (well, when its read-only status changes to modified),
+ * call workshop_file_modified().
+ *
+ */
+
+
+
+/* Connect with eserve. Add this call after you editor initialization
+ * is done, right before entering the event loop or blocking on input.
+ * This will set up a socket connection with eserve.
+ */
+void workshop_connect(XtAppContext context);
+
+/* A file has been opened. */
+void workshop_file_opened(char *filename, int readOnly);
+
+
+/* A file has been saved. Despite its name, eserve also uses this
+ * message to mean a file has been reverted or unmodified.
+ */
+void workshop_file_saved(char *filename);
+
+
+/* A file has been closed */
+void workshop_file_closed(char *filename);
+
+/* Like workshop_file_closed, but also inform eserve what line the
+ cursor was on when you left the file. That way eserve can put you
+ back where you left off when you return to this file. */
+void workshop_file_closed_lineno(char *filename, int line);
+
+/* A file has been modified */
+void workshop_file_modified(char *filename);
+
+
+/*
+ * A mark has been moved. Only call this as a response to
+ * a workshop_moved_marks request call.
+ */
+void workshop_move_mark(char *filename, int markId, int newLineno);
+
+/* Tell the integration library about a new frame being added.
+ * Supply a form for the toolbar, a label for the footer, and an
+ * XmPulldown menu for the WorkShop menu to attach to. Top and bottom
+ * are the widgets above and below the toolbar form widget, if
+ * any. Call this function when you create a new window. It returns a
+ * void *, a handle which you should keep and return when you delete
+ * the window with workshop_delete_toolbar. The "footer" argument
+ * points to a Label widget that is going to be used as a status
+ * message area, and "menu" (if any) points to an Menu widget that
+ * should contain a WorkShop menu. Clientdata is a pointer which is
+ * only used by the editor. It will typically be a pointer to the
+ * window object that the toolbar is placed in. If you have multiple
+ * windows, you need to use this pointer to figure out which window
+ * (and thus corresponding buffer) the user has clicked on to respond
+ * to the workshop_get_positions message.
+ * Each frame's clientData ("frame") should be unique.
+ */
+void *workshop_add_frame(void *frame, Widget form,
+ Widget top, Widget bottom, Widget footer,
+ Widget menu);
+
+/* Delete a window/frame. Call this when an editor window is being deleted. */
+void workshop_delete_frame(void *handle);
+
+/* Add a balloon evaluate text area. "frame" is used the same way
+ * as in workshop_add_frame. This call is not part of workshop_add_frame because
+ * a frame can have multiple tooltip areas (typically, an editor frame that
+ * is split showing multiple buffers will have a separate tooltip area for
+ * each text widget. Each such area is called a "window" (consistent with
+ * XEmacs terminology). Separate these by the window argument if necessary.
+ * You will need to implement workshop_get_balloon_text such that it uses
+ * these two arguments to derive the file, line etc. for the tip.
+ * Call the remove function if you delete this area such that the integration
+ * library can update itself. You must call workshop_add_frame before you
+ * call add_balloon_eval_area, and you must pass the same frame pointer.
+ */
+void workshop_add_balloon_eval_area(void *frame, void *window, Widget widget);
+void workshop_remove_balloon_eval_area(void *frame, void *window, Widget widget);
+
+
+/* For a given mouse position inside the balloon area (passed as x,y),
+ * return the balloon text to be evaluated. There are two scenarios:
+ * If the position is inside the selection, return the selection
+ * string. Else, return the full line (or possibly the full line up
+ * to the last semicolon (that's TBD), along with an index pointing to
+ * where which character the mouse is over.
+ * If we have the selection-scenario, set mouseIndex to -1 to indicate
+ * that no autoexpansion should occur but that the selection should
+ * be evaluated as is.
+ *
+ * XXX Does dbx need more information here, like the filename and line
+ * number in order to determine the correct language and scope to be
+ * used during evaluation?? Or should it just work like the p= button
+ * (where the current scope and language is used, even if you are
+ * pointing at a different file with a different scope) ?
+ */
+int workshop_get_balloon_text(Position x, Position y,
+ void *frame,
+ void *window,
+ char **filename,
+ int *line,
+ char **text,
+ int *mouseIndex);
+
+
+/* Window size and location
+ * WorkShop will attempt to restore the size and location of a single
+ * editor frame. For vi, this window is designated as the "reusable" one.
+ * You can implement your own scheme for determining which window you
+ * want to associate with WorkShop. Whenever the size and location of
+ * this window is changed, call the following function to notify eserve.
+ * Like workshop_invoked, this can be called before the workshop_connect()
+ * call.
+ */
+void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h);
+Boolean workshop_get_width_height(int *, int *);
+Boolean workshop_get_rows_cols(int *, int *);
+
+/* This function should be invoked when you press a hotkey
+ * set up by workshop_register_hotkey. Pass the clientData
+ * to it that was given to you with workshop_register_hotkey.
+*/
+void workshop_hotkey_pressed(void *frame, void *clientData);
+
+
+
+
+
+/*
+ * Utility functions
+ * These provide convenience functions to simplify implementing some
+ * of the above functions.
+ *
+ */
+
+/* Were we invoked by WorkShop? This function can be used early during startup
+ * if you want to do things differently if the editor is started standalone
+ * or in WorkShop mode. For example, in standalone mode you may not want to
+ * add a footer/message area or a sign gutter.
+ */
+int workshop_invoked(void);
+
+/*
+ *Set the desktop icon of the current shell to the given xpm icon.
+ * Standard WorkShop desktop icons should be 48x48.
+ */
+
+void workshop_set_icon(Display *display, Widget shell, char **xpmdata,
+ int width, int height);
+
+
+/* Minimize (iconify) the given shell */
+void workshop_minimize_shell(Widget shell);
+
+/* Maximize (deiconify) the given shell */
+void workshop_maximize_shell(Widget shell);
+
+/* Called by frame.cc -- editor shouldn't call this directly.
+ * Perhaps we need an integrationP.h file ? */
+void workshop_perform_verb(char *verb, void *clientData);
+void workshop_send_message(char *buf);
+
+
+#ifdef NOHANDS_SUPPORT_FUNCTIONS
+/* The following functions are needed to run the WorkShop testsuite
+ * with this editor. You don't need to implement these unless you
+ * intend for your editor to be run by Workshop's testsuite.
+ * getcursorrow should return the number of lines from the top of
+ * the window the cursor is; similarly for getcursorcol.
+ */
+char *workshop_test_getcurrentfile();
+int workshop_test_getcursorrow();
+int workshop_test_getcursorcol();
+char *workshop_test_getcursorrowtext();
+char *workshop_test_getselectedtext();
+#endif
+
+/*
+ * Struct used to set/unset the sensitivity of verbs.
+ */
+typedef struct {
+ char *verb;
+ Boolean sense;
+} VerbSense;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _INTEGRATION_H */
diff --git a/src/keymap.h b/src/keymap.h
new file mode 100644
index 000000000..24b0d61d8
--- /dev/null
+++ b/src/keymap.h
@@ -0,0 +1,484 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * For MSDOS some keys produce codes larger than 0xff. They are split into two
+ * chars, the first one is K_NUL (same value used in term.h).
+ */
+#define K_NUL (0xce) /* for MSDOS: special key follows */
+
+/*
+ * Keycode definitions for special keys.
+ *
+ * Any special key code sequences are replaced by these codes.
+ */
+
+/*
+ * K_SPECIAL is the first byte of a special key code and is always followed by
+ * two bytes.
+ * The second byte can have any value. ASCII is used for normal termcap
+ * entries, 0x80 and higher for special keys, see below.
+ * The third byte is guaranteed to be between 0x02 and 0x7f.
+ */
+
+#define K_SPECIAL (0x80)
+
+/*
+ * Positive characters are "normal" characters.
+ * Negative characters are special key codes. Only characters below -0x200
+ * are used to so that the absolute value can't be mistaken for a single-byte
+ * character.
+ */
+#define IS_SPECIAL(c) ((c) < 0)
+
+/*
+ * Characters 0x0100 - 0x01ff have a special meaning for abbreviations.
+ * Multi-byte characters also have ABBR_OFF added, thus are above 0x0200.
+ */
+#define ABBR_OFF 0x100
+
+/*
+ * NUL cannot be in the input string, therefore it is replaced by
+ * K_SPECIAL KS_ZERO KE_FILLER
+ */
+#define KS_ZERO 255
+
+/*
+ * K_SPECIAL cannot be in the input string, therefore it is replaced by
+ * K_SPECIAL KS_SPECIAL KE_FILLER
+ */
+#define KS_SPECIAL 254
+
+/*
+ * KS_EXTRA is used for keys that have no termcap name
+ * K_SPECIAL KS_EXTRA KE_xxx
+ */
+#define KS_EXTRA 253
+
+/*
+ * KS_MODIFIER is used when a modifier is given for a (special) key
+ * K_SPECIAL KS_MODIFIER bitmask
+ */
+#define KS_MODIFIER 252
+
+/*
+ * These are used for the GUI
+ * K_SPECIAL KS_xxx KE_FILLER
+ */
+#define KS_MOUSE 251
+#define KS_MENU 250
+#define KS_VER_SCROLLBAR 249
+#define KS_HOR_SCROLLBAR 248
+
+/*
+ * These are used for DEC mouse
+ */
+#define KS_NETTERM_MOUSE 247
+#define KS_DEC_MOUSE 246
+
+/*
+ * Used for switching Select mode back on after a mapping or menu.
+ */
+#define KS_SELECT 245
+#define K_SELECT_STRING (char_u *)"\200\365X"
+
+/*
+ * Used for tearing off a menu.
+ */
+#define KS_TEAROFF 244
+
+/* used for JSB term mouse */
+#define KS_JSBTERM_MOUSE 243
+
+/* used a termcap entry that produces a normal character */
+#define KS_KEY 242
+
+/* Used for the qnx pterm mouse */
+#define KS_PTERM_MOUSE 241
+
+/*
+ * Filler used after KS_SPECIAL and others
+ */
+#define KE_FILLER ('X')
+
+/*
+ * translation of three byte code "K_SPECIAL a b" into int "K_xxx" and back
+ */
+#define TERMCAP2KEY(a, b) (-((a) + ((int)(b) << 8)))
+#define KEY2TERMCAP0(x) ((-(x)) & 0xff)
+#define KEY2TERMCAP1(x) (((unsigned)(-(x)) >> 8) & 0xff)
+
+/*
+ * get second or third byte when translating special key code into three bytes
+ */
+#define K_SECOND(c) ((c) == K_SPECIAL ? KS_SPECIAL : (c) == NUL ? KS_ZERO : KEY2TERMCAP0(c))
+
+#define K_THIRD(c) (((c) == K_SPECIAL || (c) == NUL) ? KE_FILLER : KEY2TERMCAP1(c))
+
+/*
+ * get single int code from second byte after K_SPECIAL
+ */
+#define TO_SPECIAL(a, b) ((a) == KS_SPECIAL ? K_SPECIAL : (a) == KS_ZERO ? K_ZERO : TERMCAP2KEY(a, b))
+
+/*
+ * Codes for keys that do not have a termcap name.
+ *
+ * K_SPECIAL KS_EXTRA KE_xxx
+ */
+enum key_extra
+{
+ KE_NAME = 3 /* name of this terminal entry */
+
+ , KE_S_UP /* shift-up */
+ , KE_S_DOWN /* shift-down */
+
+ , KE_S_F1 /* shifted function keys */
+ , KE_S_F2
+ , KE_S_F3
+ , KE_S_F4
+ , KE_S_F5
+ , KE_S_F6
+ , KE_S_F7
+ , KE_S_F8
+ , KE_S_F9
+ , KE_S_F10
+
+ , KE_S_F11
+ , KE_S_F12
+ , KE_S_F13
+ , KE_S_F14
+ , KE_S_F15
+ , KE_S_F16
+ , KE_S_F17
+ , KE_S_F18
+ , KE_S_F19
+ , KE_S_F20
+
+ , KE_S_F21
+ , KE_S_F22
+ , KE_S_F23
+ , KE_S_F24
+ , KE_S_F25
+ , KE_S_F26
+ , KE_S_F27
+ , KE_S_F28
+ , KE_S_F29
+ , KE_S_F30
+
+ , KE_S_F31
+ , KE_S_F32
+ , KE_S_F33
+ , KE_S_F34
+ , KE_S_F35
+ , KE_S_F36
+ , KE_S_F37
+
+ , KE_MOUSE /* mouse event start */
+
+/*
+ * Symbols for pseudo keys which are translated from the real key symbols
+ * above.
+ */
+ , KE_LEFTMOUSE /* Left mouse button click */
+ , KE_LEFTDRAG /* Drag with left mouse button down */
+ , KE_LEFTRELEASE /* Left mouse button release */
+ , KE_MIDDLEMOUSE /* Middle mouse button click */
+ , KE_MIDDLEDRAG /* Drag with middle mouse button down */
+ , KE_MIDDLERELEASE /* Middle mouse button release */
+ , KE_RIGHTMOUSE /* Right mouse button click */
+ , KE_RIGHTDRAG /* Drag with right mouse button down */
+ , KE_RIGHTRELEASE /* Right mouse button release */
+
+ , KE_IGNORE /* Ignored mouse drag/release */
+
+ , KE_TAB /* unshifted TAB key */
+ , KE_S_TAB_OLD /* shifted TAB key (no longer used) */
+
+ , KE_SNIFF /* SNiFF+ input waiting */
+
+ , KE_XF1 /* extra vt100 function keys for xterm */
+ , KE_XF2
+ , KE_XF3
+ , KE_XF4
+ , KE_XEND /* extra (vt100) end key for xterm */
+ , KE_XHOME /* extra (vt100) home key for xterm */
+
+ , KE_LEFTMOUSE_NM /* non-mappable Left mouse button click */
+ , KE_LEFTRELEASE_NM /* non-mappable left mouse button release */
+
+ , KE_S_XF1 /* extra vt100 shifted function keys for xterm */
+ , KE_S_XF2
+ , KE_S_XF3
+ , KE_S_XF4
+
+ , KE_MOUSEDOWN /* scroll wheel pseudo-button Down */
+ , KE_MOUSEUP /* scroll wheel pseudo-button Up */
+
+ , KE_KINS /* keypad Insert key */
+ , KE_KDEL /* keypad Delete key */
+
+ , KE_CSI /* CSI typed directly */
+ , KE_SNR /* <SNR> */
+ , KE_PLUG /* <Plug> */
+ , KE_CMDWIN /* open command-line window from Command-line Mode */
+
+ , KE_C_LEFT /* control-left */
+ , KE_C_RIGHT /* control-right */
+ , KE_C_HOME /* control-home */
+ , KE_C_END /* control-end */
+
+ , KE_X1MOUSE /* X1/X2 mouse-buttons */
+ , KE_X1DRAG
+ , KE_X1RELEASE
+ , KE_X2MOUSE
+ , KE_X2DRAG
+ , KE_X2RELEASE
+
+ , KE_DROP /* DnD data is available */
+};
+
+/*
+ * the three byte codes are replaced with the following int when using vgetc()
+ */
+#define K_ZERO TERMCAP2KEY(KS_ZERO, KE_FILLER)
+
+#define K_UP TERMCAP2KEY('k', 'u')
+#define K_DOWN TERMCAP2KEY('k', 'd')
+#define K_LEFT TERMCAP2KEY('k', 'l')
+#define K_RIGHT TERMCAP2KEY('k', 'r')
+#define K_S_UP TERMCAP2KEY(KS_EXTRA, KE_S_UP)
+#define K_S_DOWN TERMCAP2KEY(KS_EXTRA, KE_S_DOWN)
+#define K_S_LEFT TERMCAP2KEY('#', '4')
+#define K_C_LEFT TERMCAP2KEY(KS_EXTRA, KE_C_LEFT)
+#define K_S_RIGHT TERMCAP2KEY('%', 'i')
+#define K_C_RIGHT TERMCAP2KEY(KS_EXTRA, KE_C_RIGHT)
+#define K_S_HOME TERMCAP2KEY('#', '2')
+#define K_C_HOME TERMCAP2KEY(KS_EXTRA, KE_C_HOME)
+#define K_S_END TERMCAP2KEY('*', '7')
+#define K_C_END TERMCAP2KEY(KS_EXTRA, KE_C_END)
+#define K_TAB TERMCAP2KEY(KS_EXTRA, KE_TAB)
+#define K_S_TAB TERMCAP2KEY('k', 'B')
+
+/* extra set of function keys F1-F4, for vt100 compatible xterm */
+#define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1)
+#define K_XF2 TERMCAP2KEY(KS_EXTRA, KE_XF2)
+#define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
+#define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)
+
+#define K_F1 TERMCAP2KEY('k', '1') /* function keys */
+#define K_F2 TERMCAP2KEY('k', '2')
+#define K_F3 TERMCAP2KEY('k', '3')
+#define K_F4 TERMCAP2KEY('k', '4')
+#define K_F5 TERMCAP2KEY('k', '5')
+#define K_F6 TERMCAP2KEY('k', '6')
+#define K_F7 TERMCAP2KEY('k', '7')
+#define K_F8 TERMCAP2KEY('k', '8')
+#define K_F9 TERMCAP2KEY('k', '9')
+#define K_F10 TERMCAP2KEY('k', ';')
+
+#define K_F11 TERMCAP2KEY('F', '1')
+#define K_F12 TERMCAP2KEY('F', '2')
+#define K_F13 TERMCAP2KEY('F', '3')
+#define K_F14 TERMCAP2KEY('F', '4')
+#define K_F15 TERMCAP2KEY('F', '5')
+#define K_F16 TERMCAP2KEY('F', '6')
+#define K_F17 TERMCAP2KEY('F', '7')
+#define K_F18 TERMCAP2KEY('F', '8')
+#define K_F19 TERMCAP2KEY('F', '9')
+#define K_F20 TERMCAP2KEY('F', 'A')
+
+#define K_F21 TERMCAP2KEY('F', 'B')
+#define K_F22 TERMCAP2KEY('F', 'C')
+#define K_F23 TERMCAP2KEY('F', 'D')
+#define K_F24 TERMCAP2KEY('F', 'E')
+#define K_F25 TERMCAP2KEY('F', 'F')
+#define K_F26 TERMCAP2KEY('F', 'G')
+#define K_F27 TERMCAP2KEY('F', 'H')
+#define K_F28 TERMCAP2KEY('F', 'I')
+#define K_F29 TERMCAP2KEY('F', 'J')
+#define K_F30 TERMCAP2KEY('F', 'K')
+
+#define K_F31 TERMCAP2KEY('F', 'L')
+#define K_F32 TERMCAP2KEY('F', 'M')
+#define K_F33 TERMCAP2KEY('F', 'N')
+#define K_F34 TERMCAP2KEY('F', 'O')
+#define K_F35 TERMCAP2KEY('F', 'P')
+#define K_F36 TERMCAP2KEY('F', 'Q')
+#define K_F37 TERMCAP2KEY('F', 'R')
+
+/* extra set of shifted function keys F1-F4, for vt100 compatible xterm */
+#define K_S_XF1 TERMCAP2KEY(KS_EXTRA, KE_S_XF1)
+#define K_S_XF2 TERMCAP2KEY(KS_EXTRA, KE_S_XF2)
+#define K_S_XF3 TERMCAP2KEY(KS_EXTRA, KE_S_XF3)
+#define K_S_XF4 TERMCAP2KEY(KS_EXTRA, KE_S_XF4)
+
+#define K_S_F1 TERMCAP2KEY(KS_EXTRA, KE_S_F1) /* shifted func. keys */
+#define K_S_F2 TERMCAP2KEY(KS_EXTRA, KE_S_F2)
+#define K_S_F3 TERMCAP2KEY(KS_EXTRA, KE_S_F3)
+#define K_S_F4 TERMCAP2KEY(KS_EXTRA, KE_S_F4)
+#define K_S_F5 TERMCAP2KEY(KS_EXTRA, KE_S_F5)
+#define K_S_F6 TERMCAP2KEY(KS_EXTRA, KE_S_F6)
+#define K_S_F7 TERMCAP2KEY(KS_EXTRA, KE_S_F7)
+#define K_S_F8 TERMCAP2KEY(KS_EXTRA, KE_S_F8)
+#define K_S_F9 TERMCAP2KEY(KS_EXTRA, KE_S_F9)
+#define K_S_F10 TERMCAP2KEY(KS_EXTRA, KE_S_F10)
+
+#define K_S_F11 TERMCAP2KEY(KS_EXTRA, KE_S_F11)
+#define K_S_F12 TERMCAP2KEY(KS_EXTRA, KE_S_F12)
+#define K_S_F13 TERMCAP2KEY(KS_EXTRA, KE_S_F13)
+#define K_S_F14 TERMCAP2KEY(KS_EXTRA, KE_S_F14)
+#define K_S_F15 TERMCAP2KEY(KS_EXTRA, KE_S_F15)
+#define K_S_F16 TERMCAP2KEY(KS_EXTRA, KE_S_F16)
+#define K_S_F17 TERMCAP2KEY(KS_EXTRA, KE_S_F17)
+#define K_S_F18 TERMCAP2KEY(KS_EXTRA, KE_S_F18)
+#define K_S_F19 TERMCAP2KEY(KS_EXTRA, KE_S_F19)
+#define K_S_F20 TERMCAP2KEY(KS_EXTRA, KE_S_F20)
+
+#define K_S_F21 TERMCAP2KEY(KS_EXTRA, KE_S_F21)
+#define K_S_F22 TERMCAP2KEY(KS_EXTRA, KE_S_F22)
+#define K_S_F23 TERMCAP2KEY(KS_EXTRA, KE_S_F23)
+#define K_S_F24 TERMCAP2KEY(KS_EXTRA, KE_S_F24)
+#define K_S_F25 TERMCAP2KEY(KS_EXTRA, KE_S_F25)
+#define K_S_F26 TERMCAP2KEY(KS_EXTRA, KE_S_F26)
+#define K_S_F27 TERMCAP2KEY(KS_EXTRA, KE_S_F27)
+#define K_S_F28 TERMCAP2KEY(KS_EXTRA, KE_S_F28)
+#define K_S_F29 TERMCAP2KEY(KS_EXTRA, KE_S_F29)
+#define K_S_F30 TERMCAP2KEY(KS_EXTRA, KE_S_F30)
+
+#define K_S_F31 TERMCAP2KEY(KS_EXTRA, KE_S_F31)
+#define K_S_F32 TERMCAP2KEY(KS_EXTRA, KE_S_F32)
+#define K_S_F33 TERMCAP2KEY(KS_EXTRA, KE_S_F33)
+#define K_S_F34 TERMCAP2KEY(KS_EXTRA, KE_S_F34)
+#define K_S_F35 TERMCAP2KEY(KS_EXTRA, KE_S_F35)
+#define K_S_F36 TERMCAP2KEY(KS_EXTRA, KE_S_F36)
+#define K_S_F37 TERMCAP2KEY(KS_EXTRA, KE_S_F37)
+
+#define K_HELP TERMCAP2KEY('%', '1')
+#define K_UNDO TERMCAP2KEY('&', '8')
+
+#define K_BS TERMCAP2KEY('k', 'b')
+
+#define K_INS TERMCAP2KEY('k', 'I')
+#define K_KINS TERMCAP2KEY(KS_EXTRA, KE_KINS)
+#define K_DEL TERMCAP2KEY('k', 'D')
+#define K_KDEL TERMCAP2KEY(KS_EXTRA, KE_KDEL)
+#define K_HOME TERMCAP2KEY('k', 'h')
+#define K_KHOME TERMCAP2KEY('K', '1') /* keypad home (upper left) */
+#define K_XHOME TERMCAP2KEY(KS_EXTRA, KE_XHOME)
+#define K_END TERMCAP2KEY('@', '7')
+#define K_KEND TERMCAP2KEY('K', '4') /* keypad end (lower left) */
+#define K_XEND TERMCAP2KEY(KS_EXTRA, KE_XEND)
+#define K_PAGEUP TERMCAP2KEY('k', 'P')
+#define K_PAGEDOWN TERMCAP2KEY('k', 'N')
+#define K_KPAGEUP TERMCAP2KEY('K', '3') /* keypad pageup (upper R.) */
+#define K_KPAGEDOWN TERMCAP2KEY('K', '5') /* keypad pagedown (lower R.) */
+
+#define K_KPLUS TERMCAP2KEY('K', '6') /* keypad plus */
+#define K_KMINUS TERMCAP2KEY('K', '7') /* keypad minus */
+#define K_KDIVIDE TERMCAP2KEY('K', '8') /* keypad / */
+#define K_KMULTIPLY TERMCAP2KEY('K', '9') /* keypad * */
+#define K_KENTER TERMCAP2KEY('K', 'A') /* keypad Enter */
+#define K_KPOINT TERMCAP2KEY('K', 'B') /* keypad . */
+
+#define K_K0 TERMCAP2KEY('K', 'C') /* keypad 0 */
+#define K_K1 TERMCAP2KEY('K', 'D') /* keypad 1 */
+#define K_K2 TERMCAP2KEY('K', 'E') /* keypad 2 */
+#define K_K3 TERMCAP2KEY('K', 'F') /* keypad 3 */
+#define K_K4 TERMCAP2KEY('K', 'G') /* keypad 4 */
+#define K_K5 TERMCAP2KEY('K', 'H') /* keypad 5 */
+#define K_K6 TERMCAP2KEY('K', 'I') /* keypad 6 */
+#define K_K7 TERMCAP2KEY('K', 'J') /* keypad 7 */
+#define K_K8 TERMCAP2KEY('K', 'K') /* keypad 8 */
+#define K_K9 TERMCAP2KEY('K', 'L') /* keypad 9 */
+
+/*
+ * These are used to recognize a keypad key that does have an ASCII equivalent.
+ * Since the values are negative, it's the other way around.
+ */
+#define FIRST_KEYPAD K_K9
+#define LAST_KEYPAD K_KPLUS
+
+#define K_MOUSE TERMCAP2KEY(KS_MOUSE, KE_FILLER)
+#define K_MENU TERMCAP2KEY(KS_MENU, KE_FILLER)
+#define K_VER_SCROLLBAR TERMCAP2KEY(KS_VER_SCROLLBAR, KE_FILLER)
+#define K_HOR_SCROLLBAR TERMCAP2KEY(KS_HOR_SCROLLBAR, KE_FILLER)
+
+#define K_NETTERM_MOUSE TERMCAP2KEY(KS_NETTERM_MOUSE, KE_FILLER)
+#define K_DEC_MOUSE TERMCAP2KEY(KS_DEC_MOUSE, KE_FILLER)
+#define K_JSBTERM_MOUSE TERMCAP2KEY(KS_JSBTERM_MOUSE, KE_FILLER)
+#define K_PTERM_MOUSE TERMCAP2KEY(KS_PTERM_MOUSE, KE_FILLER)
+
+#define K_SELECT TERMCAP2KEY(KS_SELECT, KE_FILLER)
+#define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, KE_FILLER)
+
+/*
+ * Symbols for pseudo keys which are translated from the real key symbols
+ * above.
+ */
+#define K_LEFTMOUSE TERMCAP2KEY(KS_EXTRA, KE_LEFTMOUSE)
+#define K_LEFTMOUSE_NM TERMCAP2KEY(KS_EXTRA, KE_LEFTMOUSE_NM)
+#define K_LEFTDRAG TERMCAP2KEY(KS_EXTRA, KE_LEFTDRAG)
+#define K_LEFTRELEASE TERMCAP2KEY(KS_EXTRA, KE_LEFTRELEASE)
+#define K_LEFTRELEASE_NM TERMCAP2KEY(KS_EXTRA, KE_LEFTRELEASE_NM)
+#define K_MIDDLEMOUSE TERMCAP2KEY(KS_EXTRA, KE_MIDDLEMOUSE)
+#define K_MIDDLEDRAG TERMCAP2KEY(KS_EXTRA, KE_MIDDLEDRAG)
+#define K_MIDDLERELEASE TERMCAP2KEY(KS_EXTRA, KE_MIDDLERELEASE)
+#define K_RIGHTMOUSE TERMCAP2KEY(KS_EXTRA, KE_RIGHTMOUSE)
+#define K_RIGHTDRAG TERMCAP2KEY(KS_EXTRA, KE_RIGHTDRAG)
+#define K_RIGHTRELEASE TERMCAP2KEY(KS_EXTRA, KE_RIGHTRELEASE)
+#define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
+#define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
+#define K_X1DRAG TERMCAP2KEY(KS_EXTRA, KE_X1DRAG)
+#define K_X1RELEASE TERMCAP2KEY(KS_EXTRA, KE_X1RELEASE)
+#define K_X2MOUSE TERMCAP2KEY(KS_EXTRA, KE_X2MOUSE)
+#define K_X2DRAG TERMCAP2KEY(KS_EXTRA, KE_X2DRAG)
+#define K_X2RELEASE TERMCAP2KEY(KS_EXTRA, KE_X2RELEASE)
+
+#define K_IGNORE TERMCAP2KEY(KS_EXTRA, KE_IGNORE)
+
+#define K_SNIFF TERMCAP2KEY(KS_EXTRA, KE_SNIFF)
+
+#define K_MOUSEDOWN TERMCAP2KEY(KS_EXTRA, KE_MOUSEDOWN)
+#define K_MOUSEUP TERMCAP2KEY(KS_EXTRA, KE_MOUSEUP)
+
+#define K_CSI TERMCAP2KEY(KS_EXTRA, KE_CSI)
+#define K_SNR TERMCAP2KEY(KS_EXTRA, KE_SNR)
+#define K_PLUG TERMCAP2KEY(KS_EXTRA, KE_PLUG)
+#define K_CMDWIN TERMCAP2KEY(KS_EXTRA, KE_CMDWIN)
+
+#define K_DROP TERMCAP2KEY(KS_EXTRA, KE_DROP)
+
+/* Bits for modifier mask */
+/* 0x01 cannot be used, because the modifier must be 0x02 or higher */
+#define MOD_MASK_SHIFT 0x02
+#define MOD_MASK_CTRL 0x04
+#define MOD_MASK_ALT 0x08 /* aka META */
+#define MOD_MASK_2CLICK 0x10 /* use MOD_MASK_MULTI_CLICK */
+#define MOD_MASK_3CLICK 0x20 /* use MOD_MASK_MULTI_CLICK */
+#define MOD_MASK_4CLICK 0x30 /* use MOD_MASK_MULTI_CLICK */
+#ifdef MACOS
+# define MOD_MASK_CMD 0x80
+#endif
+
+#define MOD_MASK_MULTI_CLICK (MOD_MASK_2CLICK|MOD_MASK_3CLICK|MOD_MASK_4CLICK)
+
+/*
+ * The length of the longest special key name, including modifiers.
+ * Current longest is <M-C-S-4-MiddleRelease> (length includes '<' and '>').
+ */
+#define MAX_KEY_NAME_LEN 23
+
+/* Maximum length of a special key event as tokens. This includes modifiers.
+ * The longest event is something like <M-C-S-4-LeftDrag> which would be the
+ * following string of tokens:
+ *
+ * <K_SPECIAL> <KS_MODIFIER> bitmask <K_SPECIAL> <KS_EXTRA> <KT_LEFTDRAG>.
+ *
+ * This is a total of 6 tokens, and is currently the longest one possible.
+ */
+#define MAX_KEY_CODE_LEN 6
diff --git a/src/link.390 b/src/link.390
new file mode 100644
index 000000000..76edc04fd
--- /dev/null
+++ b/src/link.390
@@ -0,0 +1,7 @@
+s%-lXext *%%g
+s%-lXmu *%%g
+s%-lXm *%/usr/lib/Xm.x %g
+s%-lX11 *%/usr/lib/X11.x %g
+s%-lXt *%%g
+s%-lSM *%/usr/lib/SM.x %g
+s%-lICE *%/usr/lib/ICE.x %g
diff --git a/src/link.sh b/src/link.sh
new file mode 100755
index 000000000..dc9c4a2ac
--- /dev/null
+++ b/src/link.sh
@@ -0,0 +1,136 @@
+#! /bin/sh
+#
+# link.sh -- try linking Vim with different sets of libraries, finding the
+# minimal set for fastest startup. The problem is that configure adds a few
+# libraries when they exist, but this doesn't mean they are needed for Vim.
+#
+# Author: Bram Moolenaar
+# Last change: 2004 Apr 05
+#
+# Warning: This fails miserably if the linker doesn't return an error code!
+#
+# Otherwise this script is fail-safe, falling back to the original full link
+# command if anything fails.
+
+echo "$LINK " >link.cmd
+exit_value=0
+
+#
+# If auto/link.sed already exists, use it. We assume a previous run of
+# link.sh has found the correct set of libraries.
+#
+if test -f auto/link.sed; then
+ echo "link.sh: The file 'auto/link.sed' exists, which is going to be used now."
+ echo "link.sh: If linking fails, try deleting the auto/link.sed file."
+ echo "link.sh: If this fails too, try creating an empty auto/link.sed file."
+else
+
+# If linking works with the full link command, try removing some libraries,
+# that are known not to be needed on at least one system.
+# Remove auto/pathdef.c if there is a new link command and compile it again.
+# There is a loop to remove libraries that appear several times.
+#
+# Notes:
+# - Can't remove Xext; It links fine but will give an error when running gvim
+# with Motif.
+# - Don't remove the last -lm: On HP-UX Vim links OK but crashes when the GTK
+# GUI is started, because the "floor" symbol could not be resolved.
+#
+ cat link.cmd
+ if sh link.cmd; then
+ touch auto/link.sed
+ cp link.cmd linkit.sh
+ for libname in SM ICE nsl dnet dnet_stub inet socket dir elf iconv Xt Xmu Xp Xpm X11 Xdmcp x w dl pthread thread readline m perl crypt attr; do
+ cont=yes
+ while test -n "$cont"; do
+ if grep "l$libname " linkit.sh >/dev/null; then
+ if test ! -f link1.sed; then
+ echo "link.sh: OK, linking works, let's try removing a few libraries."
+ echo "link.sh: See auto/link.log for details."
+ rm -f auto/link.log
+ fi
+ echo "s/-l$libname *//" >link1.sed
+ sed -f auto/link.sed <link.cmd >linkit2.sh
+ sed -f link1.sed <linkit2.sh >linkit.sh
+ # keep the last -lm
+ if test $libname != "m" || grep "lm " linkit.sh >/dev/null; then
+ echo "link.sh: Trying to remove the $libname library..."
+ cat linkit.sh >>auto/link.log
+ # Redirect this link output, it may contain error messages which
+ # should be ignored.
+ if sh linkit.sh >>auto/link.log 2>&1; then
+ echo "link.sh: We don't need the $libname library!"
+ cat link1.sed >>auto/link.sed
+ rm -f auto/pathdef.c
+ else
+ echo "link.sh: We DO need the $libname library."
+ cont=
+ cp link.cmd linkit.sh
+ fi
+ else
+ cont=
+ cp link.cmd linkit.sh
+ fi
+ else
+ cont=
+ cp link.cmd linkit.sh
+ fi
+ done
+ done
+ if test ! -f auto/pathdef.c; then
+ $MAKE objects/pathdef.o
+ fi
+ if test ! -f link1.sed; then
+ echo "link.sh: Linked fine, no libraries can be removed"
+ touch link3.sed
+ fi
+ else
+ exit_value=$?
+ fi
+fi
+
+#
+# Now do the real linking.
+#
+if test -s auto/link.sed; then
+ echo "link.sh: Using auto/link.sed file to remove a few libraries"
+ sed -f auto/link.sed <link.cmd >linkit.sh
+ cat linkit.sh
+ if sh linkit.sh; then
+ exit_value=0
+ echo "link.sh: Linked fine with a few libraries removed"
+ else
+ exit_value=$?
+ echo "link.sh: Linking failed, making auto/link.sed empty and trying again"
+ mv -f auto/link.sed link2.sed
+ touch auto/link.sed
+ rm -f auto/pathdef.c
+ $MAKE objects/pathdef.o
+ fi
+fi
+if test -f auto/link.sed -a ! -s auto/link.sed -a ! -f link3.sed; then
+ echo "link.sh: Using unmodified link command"
+ cat link.cmd
+ if sh link.cmd; then
+ exit_value=0
+ echo "link.sh: Linked OK"
+ else
+ exit_value=$?
+ if test -f link2.sed; then
+ echo "link.sh: Linking doesn't work at all, removing auto/link.sed"
+ rm -f auto/link.sed
+ fi
+ fi
+fi
+
+#
+# cleanup
+#
+rm -f link.cmd linkit.sh link1.sed link2.sed link3.sed linkit2.sh
+
+#
+# return an error code if something went wrong
+#
+exit $exit_value
+
+# vim:set sw=2 et:
diff --git a/src/macros.h b/src/macros.h
new file mode 100644
index 000000000..9dbb393f5
--- /dev/null
+++ b/src/macros.h
@@ -0,0 +1,245 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * macros.h: macro definitions for often used code
+ */
+
+/*
+ * pchar(lp, c) - put character 'c' at position 'lp'
+ */
+#define pchar(lp, c) (*(ml_get_buf(curbuf, (lp).lnum, TRUE) + (lp).col) = (c))
+
+/*
+ * Position comparisons
+ */
+#ifdef FEAT_VIRTUALEDIT
+# define lt(a, b) (((a).lnum != (b).lnum) \
+ ? (a).lnum < (b).lnum \
+ : (a).col != (b).col \
+ ? (a).col < (b).col \
+ : (a).coladd < (b).coladd)
+# define ltp(a, b) (((a)->lnum != (b)->lnum) \
+ ? (a)->lnum < (b)->lnum \
+ : (a)->col != (b)->col \
+ ? (a)->col < (b)->col \
+ : (a)->coladd < (b)->coladd)
+# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd))
+#else
+# define lt(a, b) (((a).lnum != (b).lnum) \
+ ? ((a).lnum < (b).lnum) : ((a).col < (b).col))
+# define ltp(a, b) (((a)->lnum != (b)->lnum) \
+ ? ((a)->lnum < (b)->lnum) : ((a)->col < (b)->col))
+# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col))
+#endif
+
+#define ltoreq(a, b) (lt(a, b) || equalpos(a, b))
+
+/*
+ * lineempty() - return TRUE if the line is empty
+ */
+#define lineempty(p) (*ml_get(p) == NUL)
+
+/*
+ * bufempty() - return TRUE if the current buffer is empty
+ */
+#define bufempty() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == NUL)
+
+/*
+ * toupper() and tolower() that use the current locale.
+ * On some systems toupper()/tolower() only work on lower/uppercase characters
+ * Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
+ * range 0 - 255. toupper()/tolower() on some systems can't handle others.
+ * Note: for UTF-8 use utf_toupper() and utf_tolower().
+ */
+#ifdef MSWIN
+# define TOUPPER_LOC(c) toupper_tab[(c) & 255]
+# define TOLOWER_LOC(c) tolower_tab[(c) & 255]
+#else
+# ifdef BROKEN_TOUPPER
+# define TOUPPER_LOC(c) (islower(c) ? toupper(c) : (c))
+# define TOLOWER_LOC(c) (isupper(c) ? tolower(c) : (c))
+# else
+# define TOUPPER_LOC toupper
+# define TOLOWER_LOC tolower
+# endif
+#endif
+
+/* toupper() and tolower() for ASCII only and ignore the current locale. */
+#ifdef EBCDIC
+# define TOUPPER_ASC(c) (islower(c) ? toupper(c) : (c))
+# define TOLOWER_ASC(c) (isupper(c) ? tolower(c) : (c))
+#else
+# define TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
+# define TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
+#endif
+
+/*
+ * MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters. But
+ * don't use them for negative values.
+ */
+#ifdef FEAT_MBYTE
+# define MB_ISLOWER(c) (enc_utf8 && (c) > 0x80 ? utf_islower(c) : (has_mbyte && c > 255 ? FALSE : islower(c)))
+# define MB_ISUPPER(c) (enc_utf8 && (c) > 0x80 ? utf_isupper(c) : (has_mbyte && c > 255 ? FALSE : isupper(c)))
+# define MB_TOLOWER(c) (enc_utf8 && (c) > 0x80 ? utf_tolower(c) : (has_mbyte && c > 255 ? c : TOLOWER_LOC(c)))
+# define MB_TOUPPER(c) (enc_utf8 && (c) > 0x80 ? utf_toupper(c) : (has_mbyte && c > 255 ? c : TOUPPER_LOC(c)))
+#else
+# define MB_ISLOWER(c) islower(c)
+# define MB_ISUPPER(c) isupper(c)
+# define MB_TOLOWER(c) TOLOWER_LOC(c)
+# define MB_TOUPPER(c) TOUPPER_LOC(c)
+#endif
+
+/* Like isalpha() but reject non-ASCII characters. Can't be used with a
+ * special key (negative value). */
+#ifdef EBCDIC
+# define ASCII_ISALPHA(c) isalpha(c)
+# define ASCII_ISALNUM(c) isalnum(c)
+# define ASCII_ISLOWER(c) islower(c)
+# define ASCII_ISUPPER(c) isupper(c)
+#else
+# define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
+# define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
+# define ASCII_ISLOWER(c) ((c) < 0x7f && islower(c))
+# define ASCII_ISUPPER(c) ((c) < 0x7f && isupper(c))
+#endif
+
+/* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
+ * non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
+ * below 0 and above 255. For complicated arguments and in/decrement use
+ * vim_isdigit() instead. */
+#define VIM_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
+
+/* macro version of chartab().
+ * Only works with values 0-255!
+ * Doesn't work for UTF-8 mode with chars >= 0x80. */
+#define CHARSIZE(c) (chartab[c] & CT_CELL_MASK)
+
+#ifdef FEAT_LANGMAP
+/*
+ * Adjust chars in a language according to 'langmap' option.
+ * NOTE that there is NO overhead if 'langmap' is not set; but even
+ * when set we only have to do 2 ifs and an array lookup.
+ * Don't apply 'langmap' if the character comes from the Stuff buffer.
+ * The do-while is just to ignore a ';' after the macro.
+ */
+# define LANGMAP_ADJUST(c, condition) do { \
+ if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
+ c = langmap_mapchar[c]; \
+ } while (0)
+#endif
+
+/*
+ * vim_isbreak() is used very often if 'linebreak' is set, use a macro to make
+ * it work fast.
+ */
+#define vim_isbreak(c) (breakat_flags[(char_u)(c)])
+
+/*
+ * On VMS file names are different and require a translation.
+ * On the Mac open() has only two arguments.
+ */
+#ifdef VMS
+# define mch_access(n, p) access(vms_fixfilename(n), (p))
+ /* see mch_open() comment */
+# define mch_fopen(n, p) fopen(vms_fixfilename(n), (p))
+# define mch_fstat(n, p) fstat(vms_fixfilename(n), (p))
+ /* VMS does not have lstat() */
+# define mch_stat(n, p) stat(vms_fixfilename(n), (p))
+#else
+# ifndef WIN32
+# define mch_access(n, p) access((n), (p))
+# endif
+# if !(defined(FEAT_MBYTE) && defined(WIN3264))
+# define mch_fopen(n, p) fopen((n), (p))
+# endif
+# define mch_fstat(n, p) fstat((n), (p))
+# define mch_lstat(n, p) lstat((n), (p))
+# ifdef MSWIN /* has it's own mch_stat() function */
+# define mch_stat(n, p) vim_stat((n), (p))
+# else
+# ifdef STAT_IGNORES_SLASH
+ /* On Solaris stat() accepts "file/" as if it was "file". Return -1 if
+ * the name ends in "/" and it's not a directory. */
+# define mch_stat(n, p) (illegal_slash(n) ? -1 : stat((n), (p)))
+# else
+# define mch_stat(n, p) stat((n), (p))
+# endif
+# endif
+#endif
+
+#ifdef MACOS_CLASSIC
+/* MacOS classic doesn't support perm but MacOS X does. */
+# define mch_open(n, m, p) open((n), (m))
+#else
+# ifdef VMS
+/*
+ * It is possible to force some record format with:
+ * # define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p)), "rat=cr", "rfm=stmlf", "mrs=0")
+ * but it is not recomended, because it can destroy indexes etc.
+ */
+# define mch_open(n, m, p) open(vms_fixfilename(n), (m), (p))
+# else
+# if !(defined(FEAT_MBYTE) && defined(WIN3264))
+# define mch_open(n, m, p) open((n), (m), (p))
+# endif
+# endif
+#endif
+
+/* mch_open_rw(): invoke mch_open() with third argument for user R/W. */
+#if defined(UNIX) || defined(VMS) /* open in rw------- mode */
+# define mch_open_rw(n, f) mch_open((n), (f), (mode_t)0600)
+#else
+# if defined(MSDOS) || defined(MSWIN) || defined(OS2) /* open read/write */
+# define mch_open_rw(n, f) mch_open((n), (f), S_IREAD | S_IWRITE)
+# else
+# define mch_open_rw(n, f) mch_open((n), (f), 0)
+# endif
+#endif
+
+/*
+ * Encryption macros. Mohsin Ahmed, mosh@sasi.com 98-09-24
+ * Based on zip/crypt sources.
+ */
+
+#ifdef FEAT_CRYPT
+
+#ifndef __MINGW32__
+# define PWLEN 80
+#endif
+
+/* encode byte c, using temp t. Warning: c must not have side effects. */
+# define ZENCODE(c, t) (t = decrypt_byte(), update_keys(c), t^(c))
+
+/* decode byte c in place */
+# define ZDECODE(c) update_keys(c ^= decrypt_byte())
+
+#endif
+
+#ifdef STARTUPTIME
+# define TIME_MSG(s) time_msg(s, NULL)
+#else
+# define TIME_MSG(s)
+#endif
+
+#ifdef FEAT_VREPLACE
+# define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG))
+#else
+# define REPLACE_NORMAL(s) ((s) & REPLACE_FLAG)
+#endif
+
+#ifdef FEAT_ARABIC
+# define UTF_COMPOSINGLIKE(p1, p2) utf_composinglike((p1), (p2))
+#else
+# define UTF_COMPOSINGLIKE(p1, p2) utf_iscomposing(utf_ptr2char(p2))
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ /* Whether to draw the vertical bar on the right side of the cell. */
+# define CURSOR_BAR_RIGHT (curwin->w_p_rl && (!(State & CMDLINE) || cmdmsg_rl))
+#endif
diff --git a/src/main.aap b/src/main.aap
new file mode 100644
index 000000000..1d90a8795
--- /dev/null
+++ b/src/main.aap
@@ -0,0 +1,1014 @@
+# A-A-P recipe for building Vim
+#
+# There are no user choices in here!
+# Put configure arguments in the file config.arg.
+# Later there will be a config.txt file that contains examples and
+# explanations.
+#
+# Optional arguments:
+# PREFIX=dir Overrules the install directory.
+# Can be specified when installing only.
+# Example: aap install PREFIX=$HOME
+#
+
+# Skip the configure stuff when "link.sh" is executing this recipe recursively
+# to build pathdef.c or not building something and auto/config.aap does exist.
+@if ((_no.TARGETARG != "pathdef" and has_build_target())
+@ or not os.path.exists("auto/config.aap")):
+
+ #
+ # A U T O C O N F
+ #
+
+ # Run autoconf when configure.in has been changed since it was last run.
+ # This is skipped when the signatures in "mysign" are up-to-date. When
+ # there is no autoconf program skip this (the signature is often the only
+ # thing that's outdated)
+ auto/configure {signfile = mysign} : configure.in
+ @if not program_path("autoconf"):
+ :print Can't find autoconf, using existing configure script.
+ @else:
+ # Move configure aside, autoconf would overwrite it
+ :move {exist} configure configure.save
+ :sys autoconf
+ :cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) >! auto/configure
+ :chmod 755 auto/configure
+ :move configure.save configure
+ :del {force} auto/config.cache auto/config.status
+
+ # Change the configure script to produce config.aap instead of config.mk.
+ auto/configure.aap : auto/configure
+ :print Adjusting auto/configure for A-A-P.
+ :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin)
+ >! auto/configure.aap
+ :chmod 755 auto/configure.aap
+
+ # The configure script uses the directory where it's located, use a link.
+ configure.aap: {buildcheck=}
+ :sys ln -s auto/configure.aap configure.aap
+
+ # Dependency: run configure.aap to update config.h and config.aap in the
+ # "auto" directory.
+ config {virtual} auto/config.h auto/config.aap :
+ auto/configure.aap configure.aap
+ config.arg config.h.in config.aap.in
+ :sys CONFIG_STATUS=auto/config.status
+ ./configure.aap `file2string("config.arg")`
+ --cache-file=auto/config.cache
+
+ # Configure arguments: create an empty "config.arg" file when its missing
+ config.arg:
+ :touch {exist} config.arg
+
+ # "auto/config.aap" contains a lot of settings, such as the name of the
+ # executable "Target".
+ # First update it, forcefully if the "reconfig" target was used.
+ @if _no.TARGETARG != "comment" and _no.TARGETARG != "make":
+ @if "reconfig" in var2list(_no.TARGETARG):
+ :del {force} auto/config.cache auto/config.status
+ :update {force} auto/config.aap
+ @else:
+ :update auto/config.aap
+
+# Include the recipe that autoconf generated.
+:include auto/config.aap
+
+# A "PREFIX=dir" argument overrules the value of $prefix
+@if _no.get("PREFIX"):
+ prefix = $PREFIX
+
+# Don't want "~/" in prefix.
+prefix = `os.path.expanduser(prefix)`
+
+#
+# G U I variant
+#
+# The GUI is selected by configure, a lot of other things depend on it.
+#
+:variant GUI
+ GTK
+ GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c
+ gui_gtk_f.c
+ GUI_OBJ $= $BDIR/gui.o $BDIR/gui_gtk.o $BDIR/gui_gtk_x11.o
+ $BDIR/pty.o $BDIR/gui_gtk_f.o
+ GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO
+ GUI_IPATH = $GUI_INC_LOC
+ GUI_LIBS_DIR = $GUI_LIB_LOC
+ GUI_LIBS1 =
+ GUI_LIBS2 = $GTK_LIBNAME
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ MOTIF
+ GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
+ GUI_OBJ $= $BDIR/gui.o $BDIR/gui_motif.o $BDIR/gui_x11.o
+ $BDIR/pty.o $BDIR/gui_beval.o
+ GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO
+ GUI_IPATH = $GUI_INC_LOC
+ GUI_LIBS_DIR = $GUI_LIB_LOC
+ GUI_LIBS1 =
+ GUI_LIBS2 = $MOTIF_LIBNAME -lXt
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ ATHENA
+ # XAW_LIB et al. can be overruled to use Xaw3d widgets
+ XAW_LIB ?= -lXaw
+ GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \
+ gui_at_sb.c gui_at_fs.c
+ GUI_OBJ $= $BDIR/gui.o $BDIR/gui_athena.o $BDIR/gui_x11.o \
+ $BDIR/pty.o $BDIR/gui_beval.o \
+ $BDIR/gui_at_sb.o $BDIR/gui_at_fs.o
+ GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO
+ GUI_IPATH = $GUI_INC_LOC
+ GUI_LIBS_DIR = $GUI_LIB_LOC
+ GUI_LIBS1 = $XAW_LIB
+ GUI_LIBS2 = -lXt
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ NEXTAW
+ # XAW_LIB et al. can be overruled to use Xaw3d widgets
+ XAW_LIB ?= -lXaw
+ GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c
+ gui_at_fs.c
+ GUI_OBJ $= $BDIR/gui.o $BDIR/gui_athena.o $BDIR/gui_x11.o
+ $BDIR/pty.o $BDIR/gui_beval.o $BDIR/gui_at_fs.o
+ GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO
+ GUI_IPATH = $GUI_INC_LOC
+ GUI_LIBS_DIR = $GUI_LIB_LOC
+ GUI_LIBS1 = $NEXTAW_LIB
+ GUI_LIBS2 = -lXt
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ BEOSGUI
+ GUI_SRC = gui.c gui_beos.cc pty.c
+ GUI_OBJ = $BDIR/gui.o $BDIR/gui_beos.o $BDIR/pty.o
+ GUI_DEFS = -DFEAT_GUI_BEOS
+ GUI_IPATH =
+ GUI_LIBS_DIR =
+ GUI_LIBS1 = -lbe -lroot
+ GUI_LIBS2 =
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ PHOTONGUI
+ GUI_SRC = gui.c gui_photon.c pty.c
+ GUI_OBJ = $BDIR/gui.o $BDIR/gui_photon.o $BDIR/pty.o
+ GUI_DEFS = -DFEAT_GUI_PHOTON
+ GUI_IPATH =
+ GUI_LIBS_DIR =
+ GUI_LIBS1 = -lph -lphexlib
+ GUI_LIBS2 =
+ GUI_TARGETS = installglinks
+ GUI_MAN_TARGETS = installghelplinks
+ GUI_TESTTARGET = gui
+ *
+ GUI_SRC =
+ GUI_OBJ =
+ GUI_DEFS =
+ GUI_IPATH =
+ GUI_LIBS_DIR =
+ GUI_LIBS1 =
+ GUI_LIBS2 =
+ GUI_TARGETS =
+ GUI_MAN_TARGETS =
+ GUI_TESTTARGET =
+
+
+PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS)
+POST_DEFS = $X_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $?(EXTRA_DEFS)
+CFLAGS = $PRE_DEFS $CONF_CFLAGS $?(PROFILE_CFLAGS) $POST_DEFS
+CPPFLAGS =
+
+ALL_LIB_DIRS = $GUI_LIBS_DIR $X_LIBS_DIR
+LDFLAGS = $ALL_LIB_DIRS $CONF_LDFLAGS
+LIBS = $GUI_LIBS1 $GUI_X_LIBS $GUI_LIBS2 $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $CONF_LIBS $?(EXTRA_LIBS) $PERL_LIBS $PYTHON_LIBS $TCL_LIBS $RUBY_LIBS $?(PROFILE_LIBS)
+
+Target = $VIMNAME
+
+# reconfig target also builds Vim (reconfiguration is handled above).
+reconfig {virtual}: $Target
+
+
+# Execute the test scripts. Run these after compiling Vim, before installing.
+#
+# This will produce a lot of garbage on your screen, including a few error
+# messages. Don't worry about that.
+# If there is a real error, there will be a difference between "test.out" and
+# a "test99.ok" file.
+# If everything is allright, the final message will be "ALL DONE".
+#
+test check:
+ VimProg = ../$Target
+ :execute testdir/main.aap $GUI_TESTTARGET
+
+testclean {virtual}:
+ :del {force} testdir/*.out testdir/test.log
+
+
+# When no fetch target exists we are not a child of the ../main.aap recipe,
+# Use ../main.aap to do the fetching.
+# --- If you get an error here for wrong number of arguments, you need to
+# update to a newer version of A-A-P.
+@if not has_target("fetch"):
+ fetch:
+ :execute ../main.aap fetch
+
+
+# All the source files that need to be compiled.
+# Some are optional and depend on configure.
+# "version.c" is missing, it's always compiled (see below).
+Source =
+ buffer.c
+ charset.c
+ diff.c
+ digraph.c
+ edit.c
+ eval.c
+ ex_cmds.c
+ ex_cmds2.c
+ ex_docmd.c
+ ex_eval.c
+ ex_getln.c
+ fileio.c
+ fold.c
+ getchar.c
+ if_cscope.c
+ if_xcmdsrv.c
+ main.c
+ mark.c
+ memfile.c
+ memline.c
+ menu.c
+ message.c
+ misc1.c
+ misc2.c
+ move.c
+ mbyte.c
+ normal.c
+ ops.c
+ option.c
+ os_unix.c
+ auto/pathdef.c
+ quickfix.c
+ regexp.c
+ screen.c
+ search.c
+ syntax.c
+ tag.c
+ term.c
+ ui.c
+ undo.c
+ window.c
+ $OS_EXTRA_SRC
+ $GUI_SRC
+ $HANGULIN_SRC
+ $PERL_SRC
+ $NETBEANS_SRC
+ $PYTHON_SRC
+ $TCL_SRC
+ $RUBY_SRC
+ $SNIFF_SRC
+ $WORKSHOP_SRC
+
+# TODO: make is still used for subdirectories, need to write a recipe.
+MAKE ?= make
+
+all: $Target
+
+# This dependency is required to build auto/osdef.h before automatic
+# dependencies are generated.
+$Source version.c : auto/osdef.h
+
+# Need to mention that the target also depends on version.c, since it's not
+# inluded in $Source
+$Target : version.c
+
+# Some sources are to be found in the "auto" directory.
+SRCPATH += auto
+
+# When building Vim always compile version.c to get the timestamp.
+:filetype
+ declare my_prog
+:attr {filetype = my_prog} $Target
+
+:program $Target : $Source
+
+:action build my_prog object
+ version_obj = `src2obj("version.c")`
+ :do compile {target = $version_obj} version.c
+ #:do build {target = $target {filetype = program}} $source $version_obj
+ link_sed = $BDIR/link.sed
+ @if os.path.exists(link_sed):
+ :move {force} $link_sed auto/link.sed
+ @else:
+ :del {force} auto/link.sed
+ :update link2.sh
+ :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \
+ -o $target $source $version_obj $LIBS" \
+ MAKE="aap" sh ./link2.sh
+ :copy {force} auto/link.sed $BDIR/link.sed
+
+# "link.sh" must be modified for A-A-P
+link2.sh : link.sh
+ :print Adjusting $-source for A-A-P.
+ :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin)
+ >! $target
+
+xxd/xxd$EXESUF: xxd/xxd.c
+ :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \
+ $MAKE -f Makefile
+
+# Build the language specific files if they were unpacked.
+# Generate the converted .mo files separately, it's no problem if this fails.
+languages {virtual}:
+ @if _no.MAKEMO:
+ :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix
+ @try:
+ :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted
+ @except:
+ :print Generated converted language files failed, continuing
+
+# Update the *.po files for changes in the sources. Only run manually.
+update-po {virtual}:
+ cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po
+
+auto/if_perl.c: if_perl.xs
+ :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target
+ :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
+ $PERLLIB/ExtUtils/typemap if_perl.xs >> $target
+
+auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
+ :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh
+
+pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF
+
+auto/pathdef.c: auto/config.aap
+ :print Creating $target
+ :print >! $target /* pathdef.c */
+ :print >> $target /* This file is automatically created by main.aap */
+ :print >> $target /* DO NOT EDIT! Change main.aap only. */
+ :print >> $target $#include "vim.h"
+ :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC";
+ :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR";
+ :print >> $target char_u *all_cflags = (char_u *)"$CC -c -I$srcdir $CFLAGS";
+ linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS
+ link_sed = $BDIR/link.sed
+ @if os.path.exists(link_sed):
+ # filter $linkcmd through $BDIR/link.sed
+ :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd
+ :print >> $target char_u *all_lflags = (char_u *)"$linkcmd";
+ @if _no.get("COMPILEDBY"):
+ who = $COMPILEDBY
+ where = ''
+ @else:
+ :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who
+
+ :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where
+ :print >> $target char_u *compiled_user = (char_u *)"$who";
+ :print >> $target char_u *compiled_sys = (char_u *)"$where";
+
+
+### Names of the programs and targets
+VIMTARGET = $VIMNAME$EXESUF
+EXTARGET = $EXNAME$LNKSUF
+VIEWTARGET = $VIEWNAME$LNKSUF
+GVIMNAME = g$VIMNAME
+GVIMTARGET = $GVIMNAME$LNKSUF
+GVIEWNAME = g$VIEWNAME
+GVIEWTARGET = $GVIEWNAME$LNKSUF
+RVIMNAME = r$VIMNAME
+RVIMTARGET = $RVIMNAME$LNKSUF
+RVIEWNAME = r$VIEWNAME
+RVIEWTARGET = $RVIEWNAME$LNKSUF
+RGVIMNAME = r$GVIMNAME
+RGVIMTARGET = $RGVIMNAME$LNKSUF
+RGVIEWNAME = r$GVIEWNAME
+RGVIEWTARGET = $RGVIEWNAME$LNKSUF
+VIMDIFFNAME = $(VIMNAME)diff
+GVIMDIFFNAME = g$VIMDIFFNAME
+VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF
+GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF
+EVIMNAME = e$VIMNAME
+EVIMTARGET = $EVIMNAME$LNKSUF
+EVIEWNAME = e$VIEWNAME
+EVIEWTARGET = $EVIEWNAME$LNKSUF
+
+### Names of the tools that are also made
+TOOLS = xxd/xxd$EXESUF
+
+# Root of the installation tree. Empty for a normal install, set to an
+# existing path to install into a special place (for generating a package).
+DESTDIR ?=
+
+### Location of man pages
+MANSUBDIR = $MANDIR/man1
+
+### Location of Vim files (should not need to be changed, and
+### some things might not work when they are changed!)
+VIMDIR = /vim
+@r = re.compile('.*VIM_VERSION_NODOT\\s*"(vim\\d\\d[^"]*)".*', re.S)
+VIMRTDIR = /`r.match(open("version.h").read()).group(1)`
+HELPSUBDIR = /doc
+COLSUBDIR = /colors
+SYNSUBDIR = /syntax
+INDSUBDIR = /indent
+PLUGSUBDIR = /plugin
+FTPLUGSUBDIR = /ftplugin
+LANGSUBDIR = /lang
+COMPSUBDIR = /compiler
+KMAPSUBDIR = /keymap
+MACROSUBDIR = /macros
+TOOLSSUBDIR = /tools
+TUTORSUBDIR = /tutor
+PRINTSUBDIR = /print
+PODIR = po
+
+### VIMLOC common root of the Vim files (all versions)
+### VIMRTLOC common root of the runtime Vim files (this version)
+### VIMRCLOC compiled-in location for global [g]vimrc files (all versions)
+### VIMRUNTIMEDIR compiled-in location for runtime files (optional)
+### HELPSUBLOC location for help files
+### COLSUBLOC location for colorscheme files
+### SYNSUBLOC location for syntax files
+### INDSUBLOC location for indent files
+### PLUGSUBLOC location for standard plugin files
+### FTPLUGSUBLOC location for ftplugin files
+### LANGSUBLOC location for language files
+### COMPSUBLOC location for compiler files
+### KMAPSUBLOC location for keymap files
+### MACROSUBLOC location for macro files
+### TOOLSSUBLOC location for tools files
+### TUTORSUBLOC location for tutor files
+### PRINTSUBLOC location for print files
+### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..)
+### You can override these if you want to install them somewhere else.
+### Edit feature.h for compile-time settings.
+VIMLOC = $DATADIR$VIMDIR
+VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR
+VIMRCLOC = $VIMLOC
+HELPSUBLOC = $VIMRTLOC$HELPSUBDIR
+COLSUBLOC = $VIMRTLOC$COLSUBDIR
+SYNSUBLOC = $VIMRTLOC$SYNSUBDIR
+INDSUBLOC = $VIMRTLOC$INDSUBDIR
+PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR
+FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR
+LANGSUBLOC = $VIMRTLOC$LANGSUBDIR
+COMPSUBLOC = $VIMRTLOC$COMPSUBDIR
+KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR
+MACROSUBLOC = $VIMRTLOC$MACROSUBDIR
+TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR
+TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR
+PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR
+SCRIPTLOC = $VIMRTLOC
+
+### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and
+### the runtime directory is not below it.
+#VIMRUNTIMEDIR = $VIMRTLOC
+
+### Name of the evim file target.
+EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim
+MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim
+
+### Name of the menu file target.
+SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim
+SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim
+SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim
+
+### Name of the bugreport file target.
+SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim
+
+### Name of the file type detection file target.
+SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim
+
+### Name of the file type detection file target.
+SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim
+
+### Name of the file type detection script file target.
+SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim
+
+### Name of the ftplugin-on file target.
+SYS_FTPLUGIN_FILE = $DESTDIR$SCRIPTLOC/ftplugin.vim
+
+### Name of the ftplugin-off file target.
+SYS_FTPLUGOF_FILE = $DESTDIR$SCRIPTLOC/ftplugof.vim
+
+### Name of the indent-on file target.
+SYS_INDENT_FILE = $DESTDIR$SCRIPTLOC/indent.vim
+
+### Name of the indent-off file target.
+SYS_INDOFF_FILE = $DESTDIR$SCRIPTLOC/indoff.vim
+
+### Name of the option window script file target.
+SYS_OPTWIN_FILE = $DESTDIR$SCRIPTLOC/optwin.vim
+
+### Permissions for binaries
+BINMOD = 755
+
+### Permissions for man page
+MANMOD = 644
+
+### Permissions for help files
+HELPMOD = 644
+
+### Permissions for Perl and shell scripts
+SCRIPTMOD = 755
+
+### Permission for Vim script files (menu.vim, bugreport.vim, ..)
+VIMSCRIPTMOD = 644
+
+### Permissions for all directories that are created
+DIRMOD = 755
+
+### Permissions for all other files that are created
+FILEMOD = 644
+
+# Where to copy the man and help files from
+HELPSOURCE = ../runtime/doc
+
+# Where to copy the script files from (menu, bugreport)
+SCRIPTSOURCE = ../runtime
+
+# Where to copy the colorscheme files from
+COLSOURCE = ../runtime/colors
+
+# Where to copy the syntax files from
+SYNSOURCE = ../runtime/syntax
+
+# Where to copy the indent files from
+INDSOURCE = ../runtime/indent
+
+# Where to copy the standard plugin files from
+PLUGSOURCE = ../runtime/plugin
+
+# Where to copy the ftplugin files from
+FTPLUGSOURCE = ../runtime/ftplugin
+
+# Where to copy the macro files from
+MACROSOURCE = ../runtime/macros
+
+# Where to copy the tools files from
+TOOLSSOURCE = ../runtime/tools
+
+# Where to copy the tutor files from
+TUTORSOURCE = ../runtime/tutor
+
+# Where to look for language specific files
+LANGSOURCE = ../runtime/lang
+
+# Where to look for compiler files
+COMPSOURCE = ../runtime/compiler
+
+# Where to look for keymap files
+KMAPSOURCE = ../runtime/keymap
+
+# Where to look for print resource files
+PRINTSOURCE = ../runtime/print
+
+# abbreviations
+DEST_BIN = $DESTDIR$BINDIR
+DEST_VIM = $DESTDIR$VIMLOC
+DEST_RT = $DESTDIR$VIMRTLOC
+DEST_HELP = $DESTDIR$HELPSUBLOC
+DEST_COL = $DESTDIR$COLSUBLOC
+DEST_SYN = $DESTDIR$SYNSUBLOC
+DEST_IND = $DESTDIR$INDSUBLOC
+DEST_PLUG = $DESTDIR$PLUGSUBLOC
+DEST_FTP = $DESTDIR$FTPLUGSUBLOC
+DEST_LANG = $DESTDIR$LANGSUBLOC
+DEST_COMP = $DESTDIR$COMPSUBLOC
+DEST_KMAP = $DESTDIR$KMAPSUBLOC
+DEST_MACRO = $DESTDIR$MACROSUBLOC
+DEST_TOOLS = $DESTDIR$TOOLSSUBLOC
+DEST_TUTOR = $DESTDIR$TUTORSUBLOC
+DEST_SCRIPT = $DESTDIR$SCRIPTLOC
+DEST_PRINT = $DESTDIR$PRINTSUBLOC
+DEST_MAN = $DESTDIR$MANSUBDIR
+
+# These are directories, create them when needed.
+:attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL
+ $DEST_SYN $DEST_IND $DEST_PLUG $DEST_FTP $DEST_LANG
+ $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR
+ $DEST_SCRIPT $DEST_PRINT $DEST_MAN
+
+#
+# I N S T A L L
+#
+install:
+ @if not os.path.isdir(_no.DEST_BIN):
+ @try:
+ :mkdir $DEST_BIN
+ @except:
+ @ pass
+ @if os.access(_no.DEST_BIN, os.W_OK):
+ # Bin directory is writable, install directly.
+ :update installvim installtools install-languages install-icons
+ @else:
+ # Bin directory is not writable, need to become root.
+ :print The destination directory "$DEST_BIN" is not writable.
+ :print If this is the wrong directory, use PREFIX to specify another one.
+ :print Otherwise, type the root password to continue installing.
+ :asroot $AAP install
+
+installvim {virtual}: installvimbin installruntime installlinks \
+ installhelplinks installmacros installtutor
+
+installvimbin {virtual}{force}: $Target $DEST_BIN
+ exe = $DEST_BIN/$VIMTARGET
+ @if os.path.exists(exe):
+ # Move the old executable aside and delete it. Any other method
+ # may cause a crash if the executable is currently being used.
+ :move {force} $exe $(exe).rm
+ :del {force} $(exe).rm
+ :copy $VIMTARGET $DEST_BIN
+ :do strip $exe
+ :chmod $BINMOD $DEST_BIN/$VIMTARGET
+# may create a link to the new executable from /usr/bin/vi
+ @if _no.get("LINKIT"):
+ :sys $LINKIT
+
+# install the help files; first adjust the contents for the location
+installruntime {virtual}{force}: $HELPSOURCE/vim.1 $DEST_MAN $DEST_VIM
+ $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
+ $DEST_FTP $DEST_PLUG $DEST_TUTOR $DEST_COMP $DEST_PRINT
+ :print generating $DEST_MAN/$(VIMNAME).1
+ :cat $HELPSOURCE/vim.1 |
+ :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
+ :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) |
+ :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) |
+ :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) |
+ :eval re.sub(_no.VIMLOC + "/vimrc",
+ _no.VIMRCLOC + "/vimrc", stdin) |
+ :eval re.sub(_no.VIMLOC + "/gvimrc",
+ _no.VIMRCLOC + "/gvimrc", stdin) |
+ :eval re.sub(_no.VIMLOC + "/menu.vim",
+ _no.SCRIPTLOC + "/menu.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/bugreport.vim",
+ _no.SCRIPTLOC + "/bugreport.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/filetype.vim",
+ _no.SCRIPTLOC + "/filetype.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/ftoff.vim",
+ _no.SCRIPTLOC + "/ftoff.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/scripts.vim",
+ _no.SCRIPTLOC + "/scripts.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/optwin.vim",
+ _no.SCRIPTLOC + "/optwin.vim", stdin) |
+ :eval re.sub(_no.VIMLOC + "/\\*.ps",
+ _no.SCRIPTLOC + "/*.ps", stdin)
+ >! $DEST_MAN/$(VIMNAME).1
+ :chmod $MANMOD $DEST_MAN/$(VIMNAME).1
+
+ :print generating $DEST_MAN/$(VIMNAME)tutor.1
+ :cat $HELPSOURCE/vimtutor.1 |
+ :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) |
+ :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin)
+ >! $DEST_MAN/$(VIMNAME)tutor.1
+ :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1
+
+ :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1
+ :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1
+
+ :print generating $DEST_MAN/$(EVIMNAME).1
+ :cat $HELPSOURCE/evim.1 |
+ :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin)
+ >! $DEST_MAN/$(EVIMNAME).1
+ :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1
+
+ :cd $HELPSOURCE
+ @try:
+ XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")`
+ @except:
+ XTRA = # It's OK if there are no matches.
+ :copy *.txt tags $XTRA $DEST_HELP
+ :cd -
+ :cd $DEST_HELP
+ :chmod $HELPMOD *.txt tags $XTRA
+ :cd -
+ :copy $HELPSOURCE/*.pl $DEST_HELP
+ :chmod $SCRIPTMOD $DEST_HELP/*.pl
+# install the menu files
+ :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE
+ :chmod $VIMSCRIPTMOD $SYS_MENU_FILE
+ :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE
+ :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE
+ :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE
+ :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE
+# install the evim file
+ :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE
+ :chmod $VIMSCRIPTMOD $MSWIN_FILE
+ :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE
+ :chmod $VIMSCRIPTMOD $EVIM_FILE
+# install the bugreport file
+ :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE
+ :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE
+# install the example vimrc files
+ :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT
+ :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim
+ :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT
+ :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim
+# install the file type detection files
+ :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE
+ :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE
+ :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE
+ :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE
+ :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE
+ :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE
+ :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE
+ :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE
+ :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE
+ :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE
+ :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE
+ :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE
+ :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE
+ :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE
+ :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE
+ :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE
+# install the print resource files
+ :copy $PRINTSOURCE/*.ps $DEST_PRINT
+ :chmod $FILEMOD $DEST_PRINT/*.ps
+# install the colorscheme files
+ :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL
+ :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt
+# install the syntax files
+ :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN
+ :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt
+# install the indent files
+ :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND
+ :chmod $HELPMOD $DEST_IND/*.vim
+# install the standard plugin files
+ :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG
+ :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt
+# install the ftplugin files
+ :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP
+ :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt
+# install the compiler files
+ :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP
+ :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt
+
+installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO
+ :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO
+ # Delete any CVS and AAPDIR directories.
+ # Use the ":tree" command if possible. It was added later, fall back
+ # to using "find" when it doesn't work.
+ @try:
+ :tree $DEST_MACRO {dirname = CVS}
+ :del {recursive} $name
+ :tree $DEST_MACRO {dirname = AAPDIR}
+ :del {recursive} $name
+ :tree $DEST_MACRO {dirname = .*}
+ :chmod $DIRMOD $name
+ :tree $DEST_MACRO {filename = .*}
+ :chmod $FILEMOD $name
+ @except:
+ @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO)
+ @ if ok and cvsdirs:
+ :del {recursive} $cvsdirs
+ :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print``
+ :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print``
+ :chmod $SCRIPTMOD $DEST_MACRO/less.sh
+
+# install the tutor files
+installtutor {virtual}{force}: $TUTORSOURCE $DEST_VIM $DEST_RT $DEST_TUTOR
+ :copy vimtutor $DEST_BIN/$(VIMNAME)tutor
+ :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor
+ :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR
+ :chmod $HELPMOD $DEST_TUTOR/*
+
+# install helper program xxd
+installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
+ $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS
+ xxd = $DEST_BIN/xxd$EXESUF
+ @if os.path.exists(xxd):
+ :move {force} $xxd $(xxd).rm
+ :del $(xxd).rm
+ :copy xxd/xxd$EXESUF $DEST_BIN
+ :do strip $DEST_BIN/xxd$EXESUF
+ :chmod $BINMOD $DEST_BIN/xxd$EXESUF
+ :copy $HELPSOURCE/xxd.1 $DEST_MAN
+ :chmod $MANMOD $DEST_MAN/xxd.1
+# install the runtime tools
+ @try:
+ @ if aap_has(":tree"):
+ # New method: copy everything and delete CVS and AAPDIR dirs
+ :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS
+ :tree $DEST_TOOLS {dirname = CVS}
+ :delete {recursive} $name
+ :tree $DEST_TOOLS {dirname = AAPDIR}
+ :delete {recursive} $name
+ @except:
+ # Old method: copy only specific files and directories.
+ :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS
+ :chmod $FILEMOD $DEST_TOOLS/*
+# replace the path in some tools
+ :progsearch perlpath perl
+ @if perlpath:
+ :cat $TOOLSSOURCE/efm_perl.pl |
+ :eval re.sub("/usr/bin/perl", perlpath, stdin)
+ >! $DEST_TOOLS/efm_perl.pl
+ @else:
+ :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS
+
+ :progsearch awkpath nawk gawk awk
+ @if awkpath:
+ :cat $TOOLSSOURCE/mve.awk |
+ :eval re.sub("/usr/bin/nawk", awkpath, stdin)
+ >! $DEST_TOOLS/mve.awk
+ @else:
+ :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS
+
+ :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*``
+
+# install the language specific files, if they were unpacked
+install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
+ @if _no.MAKEMO:
+ :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \
+ LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install
+ @if os.path.exists(_no.LANGSOURCE):
+ :print installing language files
+ :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG
+ :chmod $FILEMOD $DEST_LANG/*.vim
+ @if os.path.exists(_no.KMAPSOURCE):
+ :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP
+ :chmod $FILEMOD $DEST_KMAP/*.vim
+
+# install the icons for KDE, if the directory exists and the icon doesn't.
+ICON48PATH = $DESTDIR$DATADIR/icons/hicolor/48x48/apps
+ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps
+ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps
+KDEPATH = $HOME/.kde/share/icons
+install-icons {virtual}:
+ gp = $ICON48PATH/gvim.png
+ @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp):
+ :copy $SCRIPTSOURCE/vim48x48.png $gp
+ gp = $ICON32PATH/gvim.png
+ @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp):
+ :copy $SCRIPTSOURCE/vim32x32.png $gp
+ gp = $ICON16PATH/gvim.png
+ @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp):
+ :copy $SCRIPTSOURCE/vim16x16.png $gp
+
+
+$HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE:
+ @if not os.path.exists(_no.TOOLSSOURCE):
+ :print Runtime files not found.
+ :error You need to unpack the runtime archive before running "make install".
+
+# create links from various names to vim. This is only done when the links
+# (or executables with the same name) don't exist yet.
+installlinks {virtual}: $GUI_TARGETS \
+ $DEST_BIN/$EXTARGET \
+ $DEST_BIN/$VIEWTARGET \
+ $DEST_BIN/$RVIMTARGET \
+ $DEST_BIN/$RVIEWTARGET \
+ $INSTALLVIMDIFF
+
+installglinks {virtual}: $DEST_BIN/$GVIMTARGET \
+ $DEST_BIN/$GVIEWTARGET \
+ $DEST_BIN/$RGVIMTARGET \
+ $DEST_BIN/$RGVIEWTARGET \
+ $DEST_BIN/$EVIMTARGET \
+ $DEST_BIN/$EVIEWTARGET \
+ $INSTALLGVIMDIFF
+
+installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET
+installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET
+
+# These dependencies use an empty buildcheck so that they are only done when
+# the target doesn't exist.
+$DEST_BIN/$EXTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $EXTARGET
+
+$DEST_BIN/$VIEWTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $VIEWTARGET
+
+$DEST_BIN/$GVIMTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMTARGET
+
+$DEST_BIN/$GVIEWTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIEWTARGET
+
+$DEST_BIN/$RVIMTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIMTARGET
+
+$DEST_BIN/$RVIEWTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $RVIEWTARGET
+
+$DEST_BIN/$RGVIMTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIMTARGET
+
+$DEST_BIN/$RGVIEWTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $RGVIEWTARGET
+
+$DEST_BIN/$VIMDIFFTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $VIMDIFFTARGET
+
+$DEST_BIN/$GVIMDIFFTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $GVIMDIFFTARGET
+
+$DEST_BIN/$EVIMTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIMTARGET
+
+$DEST_BIN/$EVIEWTARGET: {buildcheck = }
+ :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET
+
+# create links for the manual pages with various names to vim. This is only
+# done when the links (or manpages with the same name) don't exist yet.
+installhelplinks {virtual}: $GUI_MAN_TARGETS \
+ $DEST_MAN/$(EXNAME).1 \
+ $DEST_MAN/$(VIEWNAME).1 \
+ $DEST_MAN/$(RVIMNAME).1 \
+ $DEST_MAN/$(RVIEWNAME).1
+
+installghelplinks {virtual}: $DEST_MAN/$(GVIMNAME).1 \
+ $DEST_MAN/$(GVIEWNAME).1 \
+ $DEST_MAN/$(RGVIMNAME).1 \
+ $DEST_MAN/$(RGVIEWNAME).1 \
+ $DEST_MAN/$(GVIMDIFFNAME).1 \
+ $DEST_MAN/$(EVIEWNAME).1
+
+$DEST_MAN/$(EXNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(EXNAME).1
+
+$DEST_MAN/$(VIEWNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(VIEWNAME).1
+
+$DEST_MAN/$(GVIMNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIMNAME).1
+
+$DEST_MAN/$(GVIEWNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(GVIEWNAME).1
+
+$DEST_MAN/$(RVIMNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIMNAME).1
+
+$DEST_MAN/$(RVIEWNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RVIEWNAME).1
+
+$DEST_MAN/$(RGVIMNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIMNAME).1
+
+$DEST_MAN/$(RGVIEWNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(RGVIEWNAME).1
+
+$DEST_MAN/$(GVIMDIFFNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(VIMDIFFNAME).1 $(GVIMDIFFNAME).1
+
+$DEST_MAN/$(EVIEWNAME).1: {buildcheck = }
+ :sys cd $DEST_MAN; ln -s $(EVIMNAME).1 $(EVIEWNAME).1
+
+#
+# U N I N S T A L L
+#
+uninstall {virtual}{force}: uninstall_runtime
+ :del {force} $DEST_BIN/$VIMTARGET
+ :del {force} $DEST_MAN/$(VIMNAME).1 $DEST_MAN/$(VIMNAME)tutor.1
+ :del {force} $DEST_BIN/vimtutor
+ :del {force} $DEST_BIN/xxd$EXESUF $DEST_MAN/xxd.1
+ :del {force} $DEST_BIN/$EXTARGET $DEST_BIN/$VIEWTARGET
+ :del {force} $DEST_BIN/$GVIMTARGET $DEST_BIN/$GVIEWTARGET
+ :del {force} $DEST_BIN/$RVIMTARGET $DEST_BIN/$RVIEWTARGET
+ :del {force} $DEST_BIN/$RGVIMTARGET $DEST_BIN/$RGVIEWTARGET
+ :del {force} $DEST_BIN/$VIMDIFFTARGET $DEST_BIN/$GVIMDIFFTARGET
+ :del {force} $DEST_BIN/$EVIMTARGET $DEST_BIN/$EVIEWTARGET
+ :del {force} $DEST_MAN/$(EXNAME).1 $DEST_MAN/$(VIEWNAME).1
+ :del {force} $DEST_MAN/$(GVIMNAME).1 $DEST_MAN/$(GVIEWNAME).1
+ :del {force} $DEST_MAN/$(RVIMNAME).1 $DEST_MAN/$(RVIEWNAME).1
+ :del {force} $DEST_MAN/$(RGVIMNAME).1 $DEST_MAN/$(RGVIEWNAME).1
+ :del {force} $DEST_MAN/$(VIMDIFFNAME).1 $DEST_MAN/$(GVIMDIFFNAME).1
+ :del {force} $DEST_MAN/$(EVIMNAME).1 $DEST_MAN/$(EVIEWNAME).1
+
+# Note: "deldir" will fail if any files were added after "make install", that
+# is intentionally: Keep files the user added.
+uninstall_runtime {virtual}{force}:
+ :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl
+ :del {force} $SYS_MENU_FILE $SYS_SYNMENU_FILE $SYS_DELMENU_FILE
+ :del {force} $SYS_BUGR_FILE $EVIM_FILE $MSWIN_FILE
+ :del {force} $DEST_SCRIPT/gvimrc_example.vim $DEST_SCRIPT/vimrc_example.vim
+ :del {force} $SYS_FILETYPE_FILE $SYS_FTOFF_FILE $SYS_SCRIPTS_FILE
+ :del {force} $SYS_INDOFF_FILE $SYS_INDENT_FILE
+ :del {force} $SYS_FTPLUGOF_FILE $SYS_FTPLUGIN_FILE
+ :del {force} $SYS_OPTWIN_FILE
+ :del {force} $DEST_COL/*.vim $DEST_COL/README.txt
+ :del {force} $DEST_SYN/*.vim $DEST_SYN/README.txt
+ :del {force} $DEST_IND/*.vim $DEST_IND/README.txt
+ :del {force} $DEST_PRINT/*.ps
+ :del {force}{recursive} $DEST_MACRO
+ :del {force}{recursive} $DEST_TUTOR
+ :del {force}{recursive} $DEST_TOOLS
+ :del {force}{recursive} $DEST_LANG
+ :del {force}{recursive} $DEST_KMAP
+ :del {force}{recursive} $DEST_COMP
+ :deldir {force} $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
+ :del {force}{recursive} $DEST_FTP/*.vim $DEST_FTP/README.txt
+ :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt
+ :deldir {force} $DEST_FTP $DEST_PLUG $DEST_PRINT $DEST_RT
+# This will fail when other Vim versions are installed, no worries.
+ @try:
+ :deldir $DEST_VIM
+ @except:
+ :print Cannot delete $DEST_VIM
+
+
+# vim: sts=4 sw=4 :
diff --git a/src/mark.c b/src/mark.c
new file mode 100644
index 000000000..e1b800eb1
--- /dev/null
+++ b/src/mark.c
@@ -0,0 +1,1617 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * mark.c: functions for setting marks and jumping to them
+ */
+
+#include "vim.h"
+
+/*
+ * This file contains routines to maintain and manipulate marks.
+ */
+
+/*
+ * If a named file mark's lnum is non-zero, it is valid.
+ * If a named file mark's fnum is non-zero, it is for an existing buffer,
+ * otherwise it is from .viminfo and namedfm[n].fname is the file name.
+ * There are marks 'A - 'Z (set by user) and '0 to '9 (set when writing
+ * viminfo).
+ */
+#define EXTRA_MARKS 10 /* marks 0-9 */
+static xfmark_T namedfm[NMARKS + EXTRA_MARKS]; /* marks with file nr */
+
+static void fname2fnum __ARGS((xfmark_T *fm));
+static void fmarks_check_one __ARGS((xfmark_T *fm, char_u *name, buf_T *buf));
+static char_u *mark_line __ARGS((pos_T *mp, int lead_len));
+static void show_one_mark __ARGS((int, char_u *, pos_T *, char_u *, int current));
+#ifdef FEAT_JUMPLIST
+static void cleanup_jumplist __ARGS((void));
+#endif
+#ifdef FEAT_VIMINFO
+static void write_one_filemark __ARGS((FILE *fp, xfmark_T *fm, int c1, int c2));
+#endif
+
+/*
+ * Set named mark 'c' at current cursor position.
+ * Returns OK on success, FAIL if bad name given.
+ */
+ int
+setmark(c)
+ int c;
+{
+ int i;
+
+ /* Check for a special key (may cause islower() to crash). */
+ if (c < 0)
+ return FAIL;
+
+ if (c == '\'' || c == '`')
+ {
+ setpcmark();
+ /* keep it even when the cursor doesn't move */
+ curwin->w_prev_pcmark = curwin->w_pcmark;
+ return OK;
+ }
+
+ /* Allow setting '[ and '] for an autocommand that simulates reading a
+ * file. */
+ if (c == '[')
+ {
+ curbuf->b_op_start = curwin->w_cursor;
+ return OK;
+ }
+ if (c == ']')
+ {
+ curbuf->b_op_end = curwin->w_cursor;
+ return OK;
+ }
+
+#ifndef EBCDIC
+ if (c > 'z') /* some islower() and isupper() cannot handle
+ characters above 127 */
+ return FAIL;
+#endif
+ if (islower(c))
+ {
+ i = c - 'a';
+ curbuf->b_namedm[i] = curwin->w_cursor;
+ return OK;
+ }
+ if (isupper(c))
+ {
+ i = c - 'A';
+ namedfm[i].fmark.mark = curwin->w_cursor;
+ namedfm[i].fmark.fnum = curbuf->b_fnum;
+ vim_free(namedfm[i].fname);
+ namedfm[i].fname = NULL;
+ return OK;
+ }
+ return FAIL;
+}
+
+/*
+ * Set the previous context mark to the current position and add it to the
+ * jump list.
+ */
+ void
+setpcmark()
+{
+#ifdef FEAT_JUMPLIST
+ int i;
+ xfmark_T *fm;
+#endif
+#ifdef JUMPLIST_ROTATE
+ xfmark_T tempmark;
+#endif
+
+ /* for :global the mark is set only once */
+ if (global_busy || listcmd_busy || cmdmod.keepjumps)
+ return;
+
+ curwin->w_prev_pcmark = curwin->w_pcmark;
+ curwin->w_pcmark = curwin->w_cursor;
+
+#ifdef FEAT_JUMPLIST
+# ifdef JUMPLIST_ROTATE
+ /*
+ * If last used entry is not at the top, put it at the top by rotating
+ * the stack until it is (the newer entries will be at the bottom).
+ * Keep one entry (the last used one) at the top.
+ */
+ if (curwin->w_jumplistidx < curwin->w_jumplistlen)
+ ++curwin->w_jumplistidx;
+ while (curwin->w_jumplistidx < curwin->w_jumplistlen)
+ {
+ tempmark = curwin->w_jumplist[curwin->w_jumplistlen - 1];
+ for (i = curwin->w_jumplistlen - 1; i > 0; --i)
+ curwin->w_jumplist[i] = curwin->w_jumplist[i - 1];
+ curwin->w_jumplist[0] = tempmark;
+ ++curwin->w_jumplistidx;
+ }
+# endif
+
+ /* If jumplist is full: remove oldest entry */
+ if (++curwin->w_jumplistlen > JUMPLISTSIZE)
+ {
+ curwin->w_jumplistlen = JUMPLISTSIZE;
+ vim_free(curwin->w_jumplist[0].fname);
+ for (i = 1; i < JUMPLISTSIZE; ++i)
+ curwin->w_jumplist[i - 1] = curwin->w_jumplist[i];
+ }
+ curwin->w_jumplistidx = curwin->w_jumplistlen;
+ fm = &curwin->w_jumplist[curwin->w_jumplistlen - 1];
+
+ fm->fmark.mark = curwin->w_pcmark;
+ fm->fmark.fnum = curbuf->b_fnum;
+ fm->fname = NULL;
+#endif
+}
+
+/*
+ * To change context, call setpcmark(), then move the current position to
+ * where ever, then call checkpcmark(). This ensures that the previous
+ * context will only be changed if the cursor moved to a different line.
+ * If pcmark was deleted (with "dG") the previous mark is restored.
+ */
+ void
+checkpcmark()
+{
+ if (curwin->w_prev_pcmark.lnum != 0
+ && (equalpos(curwin->w_pcmark, curwin->w_cursor)
+ || curwin->w_pcmark.lnum == 0))
+ {
+ curwin->w_pcmark = curwin->w_prev_pcmark;
+ curwin->w_prev_pcmark.lnum = 0; /* Show it has been checked */
+ }
+}
+
+#if defined(FEAT_JUMPLIST) || defined(PROTO)
+/*
+ * move "count" positions in the jump list (count may be negative)
+ */
+ pos_T *
+movemark(count)
+ int count;
+{
+ pos_T *pos;
+ xfmark_T *jmp;
+
+ cleanup_jumplist();
+
+ if (curwin->w_jumplistlen == 0) /* nothing to jump to */
+ return (pos_T *)NULL;
+
+ for (;;)
+ {
+ if (curwin->w_jumplistidx + count < 0
+ || curwin->w_jumplistidx + count >= curwin->w_jumplistlen)
+ return (pos_T *)NULL;
+
+ /*
+ * if first CTRL-O or CTRL-I command after a jump, add cursor position
+ * to list. Careful: If there are duplicates (CTRL-O immidiately after
+ * starting Vim on a file), another entry may have been removed.
+ */
+ if (curwin->w_jumplistidx == curwin->w_jumplistlen)
+ {
+ setpcmark();
+ --curwin->w_jumplistidx; /* skip the new entry */
+ if (curwin->w_jumplistidx + count < 0)
+ return (pos_T *)NULL;
+ }
+
+ curwin->w_jumplistidx += count;
+
+ jmp = curwin->w_jumplist + curwin->w_jumplistidx;
+ if (jmp->fmark.fnum == 0)
+ fname2fnum(jmp);
+ if (jmp->fmark.fnum != curbuf->b_fnum)
+ {
+ /* jump to other file */
+ if (buflist_findnr(jmp->fmark.fnum) == NULL)
+ { /* Skip this one .. */
+ count += count < 0 ? -1 : 1;
+ continue;
+ }
+ if (buflist_getfile(jmp->fmark.fnum, jmp->fmark.mark.lnum,
+ 0, FALSE) == FAIL)
+ return (pos_T *)NULL;
+ /* Set lnum again, autocommands my have changed it */
+ curwin->w_cursor = jmp->fmark.mark;
+ pos = (pos_T *)-1;
+ }
+ else
+ pos = &(jmp->fmark.mark);
+ return pos;
+ }
+}
+
+/*
+ * Move "count" positions in the changelist (count may be negative).
+ */
+ pos_T *
+movechangelist(count)
+ int count;
+{
+ int n;
+
+ if (curbuf->b_changelistlen == 0) /* nothing to jump to */
+ return (pos_T *)NULL;
+
+ n = curwin->w_changelistidx;
+ if (n + count < 0)
+ {
+ if (n == 0)
+ return (pos_T *)NULL;
+ n = 0;
+ }
+ else if (n + count >= curbuf->b_changelistlen)
+ {
+ if (n == curbuf->b_changelistlen - 1)
+ return (pos_T *)NULL;
+ n = curbuf->b_changelistlen - 1;
+ }
+ else
+ n += count;
+ curwin->w_changelistidx = n;
+ return curbuf->b_changelist + n;
+}
+#endif
+
+/*
+ * Find mark "c".
+ * Returns:
+ * - pointer to pos_T if found. lnum is 0 when mark not set, -1 when mark is
+ * in another file which can't be gotten. (caller needs to check lnum!)
+ * - NULL if there is no mark called 'c'.
+ * - -1 if mark is in other file and jumped there (only if changefile is TRUE)
+ */
+ pos_T *
+getmark(c, changefile)
+ int c;
+ int changefile; /* allowed to edit another file */
+{
+ pos_T *posp;
+#ifdef FEAT_VISUAL
+ pos_T *startp, *endp;
+#endif
+ static pos_T pos_copy;
+
+ posp = NULL;
+
+ /* Check for special key, can't be a mark name and might cause islower()
+ * to crash. */
+ if (c < 0)
+ return posp;
+#ifndef EBCDIC
+ if (c > '~') /* check for islower()/isupper() */
+ ;
+ else
+#endif
+ if (c == '\'' || c == '`') /* previous context mark */
+ {
+ pos_copy = curwin->w_pcmark; /* need to make a copy because */
+ posp = &pos_copy; /* w_pcmark may be changed soon */
+ }
+ else if (c == '"') /* to pos when leaving buffer */
+ posp = &(curbuf->b_last_cursor);
+ else if (c == '^') /* to where Insert mode stopped */
+ posp = &(curbuf->b_last_insert);
+ else if (c == '.') /* to where last change was made */
+ posp = &(curbuf->b_last_change);
+ else if (c == '[') /* to start of previous operator */
+ posp = &(curbuf->b_op_start);
+ else if (c == ']') /* to end of previous operator */
+ posp = &(curbuf->b_op_end);
+ else if (c == '{' || c == '}') /* to previous/next paragraph */
+ {
+ pos_T pos;
+ oparg_T oa;
+ int slcb = listcmd_busy;
+
+ pos = curwin->w_cursor;
+ listcmd_busy = TRUE; /* avoid that '' is changed */
+ if (findpar(&oa, c == '}' ? FORWARD : BACKWARD, 1L, NUL, FALSE))
+ {
+ pos_copy = curwin->w_cursor;
+ posp = &pos_copy;
+ }
+ curwin->w_cursor = pos;
+ listcmd_busy = slcb;
+ }
+ else if (c == '(' || c == ')') /* to previous/next sentence */
+ {
+ pos_T pos;
+ int slcb = listcmd_busy;
+
+ pos = curwin->w_cursor;
+ listcmd_busy = TRUE; /* avoid that '' is changed */
+ if (findsent(c == ')' ? FORWARD : BACKWARD, 1L))
+ {
+ pos_copy = curwin->w_cursor;
+ posp = &pos_copy;
+ }
+ curwin->w_cursor = pos;
+ listcmd_busy = slcb;
+ }
+#ifdef FEAT_VISUAL
+ else if (c == '<' || c == '>') /* start/end of visual area */
+ {
+ startp = &curbuf->b_visual_start;
+ endp = &curbuf->b_visual_end;
+ if ((c == '<') == lt(*startp, *endp))
+ posp = startp;
+ else
+ posp = endp;
+ /*
+ * For Visual line mode, set mark at begin or end of line
+ */
+ if (curbuf->b_visual_mode == 'V')
+ {
+ pos_copy = *posp;
+ posp = &pos_copy;
+ if (c == '<')
+ pos_copy.col = 0;
+ else
+ pos_copy.col = MAXCOL;
+#ifdef FEAT_VIRTUALEDIT
+ pos_copy.coladd = 0;
+#endif
+ }
+ }
+#endif
+ else if (ASCII_ISLOWER(c)) /* normal named mark */
+ {
+ posp = &(curbuf->b_namedm[c - 'a']);
+ }
+ else if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c)) /* named file mark */
+ {
+ if (VIM_ISDIGIT(c))
+ c = c - '0' + NMARKS;
+ else
+ c -= 'A';
+ posp = &(namedfm[c].fmark.mark);
+
+ if (namedfm[c].fmark.fnum == 0)
+ fname2fnum(&namedfm[c]);
+ if (namedfm[c].fmark.fnum != curbuf->b_fnum)
+ {
+ posp = &pos_copy;
+
+ /* mark is in another file */
+ if (namedfm[c].fmark.mark.lnum != 0
+ && changefile && namedfm[c].fmark.fnum)
+ {
+ if (buflist_getfile(namedfm[c].fmark.fnum,
+ (linenr_T)1, GETF_SETMARK, FALSE) == OK)
+ {
+ /* Set the lnum now, autocommands could have changed it */
+ curwin->w_cursor = namedfm[c].fmark.mark;
+ return (pos_T *)-1;
+ }
+ pos_copy.lnum = -1; /* can't get file */
+ }
+ else
+ pos_copy.lnum = 0; /* mark exists, but is not valid in
+ current buffer */
+ }
+ }
+
+ return posp;
+}
+
+/*
+ * Search for the next named mark in the current file.
+ *
+ * Returns pointer to pos_T of the next mark or NULL if no mark is found.
+ */
+ pos_T *
+getnextmark(startpos, dir, begin_line)
+ pos_T *startpos; /* where to start */
+ int dir; /* direction for search */
+ int begin_line;
+{
+ int i;
+ pos_T *result = NULL;
+ pos_T pos;
+
+ pos = *startpos;
+
+ /* When searching backward and leaving the cursor on the first non-blank,
+ * position must be in a previous line.
+ * When searching forward and leaving the cursor on the first non-blank,
+ * position must be in a next line. */
+ if (dir == BACKWARD && begin_line)
+ pos.col = 0;
+ else if (dir == FORWARD && begin_line)
+ pos.col = MAXCOL;
+
+ for (i = 0; i < NMARKS; i++)
+ {
+ if (curbuf->b_namedm[i].lnum > 0)
+ {
+ if (dir == FORWARD)
+ {
+ if ((result == NULL || lt(curbuf->b_namedm[i], *result))
+ && lt(pos, curbuf->b_namedm[i]))
+ result = &curbuf->b_namedm[i];
+ }
+ else
+ {
+ if ((result == NULL || lt(*result, curbuf->b_namedm[i]))
+ && lt(curbuf->b_namedm[i], pos))
+ result = &curbuf->b_namedm[i];
+ }
+ }
+ }
+
+ return result;
+}
+
+/*
+ * For an xtended filemark: set the fnum from the fname.
+ * This is used for marks obtained from the .viminfo file. It's postponed
+ * until the mark is used to avoid a long startup delay.
+ */
+ static void
+fname2fnum(fm)
+ xfmark_T *fm;
+{
+ char_u *p;
+
+ if (fm->fname != NULL)
+ {
+ /*
+ * First expand "~/" in the file name to the home directory.
+ * Try to shorten the file name.
+ */
+ expand_env(fm->fname, NameBuff, MAXPATHL);
+ mch_dirname(IObuff, IOSIZE);
+ p = shorten_fname(NameBuff, IObuff);
+
+ /* buflist_new() will call fmarks_check_names() */
+ (void)buflist_new(NameBuff, p, (linenr_T)1, 0);
+ }
+}
+
+/*
+ * Check all file marks for a name that matches the file name in buf.
+ * May replace the name with an fnum.
+ * Used for marks that come from the .viminfo file.
+ */
+ void
+fmarks_check_names(buf)
+ buf_T *buf;
+{
+ char_u *name;
+ int i;
+#ifdef FEAT_JUMPLIST
+ win_T *wp;
+#endif
+
+ if (buf->b_ffname == NULL)
+ return;
+
+ name = home_replace_save(buf, buf->b_ffname);
+ if (name == NULL)
+ return;
+
+ for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
+ fmarks_check_one(&namedfm[i], name, buf);
+
+#ifdef FEAT_JUMPLIST
+ FOR_ALL_WINDOWS(wp)
+ {
+ for (i = 0; i < wp->w_jumplistlen; ++i)
+ fmarks_check_one(&wp->w_jumplist[i], name, buf);
+ }
+#endif
+
+ vim_free(name);
+}
+
+ static void
+fmarks_check_one(fm, name, buf)
+ xfmark_T *fm;
+ char_u *name;
+ buf_T *buf;
+{
+ if (fm->fmark.fnum == 0
+ && fm->fname != NULL
+ && fnamecmp(name, fm->fname) == 0)
+ {
+ fm->fmark.fnum = buf->b_fnum;
+ vim_free(fm->fname);
+ fm->fname = NULL;
+ }
+}
+
+/*
+ * Check a if a position from a mark is valid.
+ * Give and error message and return FAIL if not.
+ */
+ int
+check_mark(pos)
+ pos_T *pos;
+{
+ if (pos == NULL)
+ {
+ EMSG(_(e_umark));
+ return FAIL;
+ }
+ if (pos->lnum <= 0)
+ {
+ /* lnum is negative if mark is in another file can can't get that
+ * file, error message already give then. */
+ if (pos->lnum == 0)
+ EMSG(_(e_marknotset));
+ return FAIL;
+ }
+ if (pos->lnum > curbuf->b_ml.ml_line_count)
+ {
+ EMSG(_(e_markinval));
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * clrallmarks() - clear all marks in the buffer 'buf'
+ *
+ * Used mainly when trashing the entire buffer during ":e" type commands
+ */
+ void
+clrallmarks(buf)
+ buf_T *buf;
+{
+ static int i = -1;
+
+ if (i == -1) /* first call ever: initialize */
+ for (i = 0; i < NMARKS + 1; i++)
+ {
+ namedfm[i].fmark.mark.lnum = 0;
+ namedfm[i].fname = NULL;
+ }
+
+ for (i = 0; i < NMARKS; i++)
+ buf->b_namedm[i].lnum = 0;
+ buf->b_op_start.lnum = 0; /* start/end op mark cleared */
+ buf->b_op_end.lnum = 0;
+ buf->b_last_cursor.lnum = 1; /* '" mark cleared */
+ buf->b_last_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ buf->b_last_cursor.coladd = 0;
+#endif
+ buf->b_last_insert.lnum = 0; /* '^ mark cleared */
+ buf->b_last_change.lnum = 0; /* '. mark cleared */
+#ifdef FEAT_JUMPLIST
+ buf->b_changelistlen = 0;
+#endif
+}
+
+/*
+ * Get name of file from a filemark.
+ * When it's in the current buffer, return the text at the mark.
+ * Returns an allocated string.
+ */
+ char_u *
+fm_getname(fmark, lead_len)
+ fmark_T *fmark;
+ int lead_len;
+{
+ if (fmark->fnum == curbuf->b_fnum) /* current buffer */
+ return mark_line(&(fmark->mark), lead_len);
+ return buflist_nr2name(fmark->fnum, FALSE, TRUE);
+}
+
+/*
+ * Return the line at mark "mp". Truncate to fit in window.
+ * The returned string has been allocated.
+ */
+ static char_u *
+mark_line(mp, lead_len)
+ pos_T *mp;
+ int lead_len;
+{
+ char_u *s, *p;
+ int len;
+
+ if (mp->lnum == 0 || mp->lnum > curbuf->b_ml.ml_line_count)
+ return vim_strsave((char_u *)"-invalid-");
+ s = vim_strnsave(skipwhite(ml_get(mp->lnum)), (int)Columns);
+ if (s == NULL)
+ return NULL;
+ /* Truncate the line to fit it in the window */
+ len = 0;
+ for (p = s; *p != NUL; ++p)
+ {
+ len += ptr2cells(p);
+ if (len >= Columns - lead_len)
+ break;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ *p = NUL;
+ return s;
+}
+
+/*
+ * print the marks
+ */
+ void
+do_marks(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ int i;
+ char_u *name;
+
+ if (arg != NULL && *arg == NUL)
+ arg = NULL;
+
+ show_one_mark('\'', arg, &curwin->w_pcmark, NULL, TRUE);
+ for (i = 0; i < NMARKS; ++i)
+ show_one_mark(i + 'a', arg, &curbuf->b_namedm[i], NULL, TRUE);
+ for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
+ {
+ if (namedfm[i].fmark.fnum != 0)
+ name = fm_getname(&namedfm[i].fmark, 15);
+ else
+ name = namedfm[i].fname;
+ if (name != NULL)
+ {
+ show_one_mark(i >= NMARKS ? i - NMARKS + '0' : i + 'A',
+ arg, &namedfm[i].fmark.mark, name,
+ namedfm[i].fmark.fnum == curbuf->b_fnum);
+ if (namedfm[i].fmark.fnum != 0)
+ vim_free(name);
+ }
+ }
+ show_one_mark('"', arg, &curbuf->b_last_cursor, NULL, TRUE);
+ show_one_mark('[', arg, &curbuf->b_op_start, NULL, TRUE);
+ show_one_mark(']', arg, &curbuf->b_op_end, NULL, TRUE);
+ show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE);
+ show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE);
+#ifdef FEAT_VISUAL
+ show_one_mark('<', arg, &curbuf->b_visual_start, NULL, TRUE);
+ show_one_mark('>', arg, &curbuf->b_visual_end, NULL, TRUE);
+#endif
+ show_one_mark(-1, arg, NULL, NULL, FALSE);
+}
+
+ static void
+show_one_mark(c, arg, p, name, current)
+ int c;
+ char_u *arg;
+ pos_T *p;
+ char_u *name;
+ int current; /* in current file */
+{
+ static int did_title = FALSE;
+ int mustfree = FALSE;
+
+ if (c == -1) /* finish up */
+ {
+ if (did_title)
+ did_title = FALSE;
+ else
+ {
+ if (arg == NULL)
+ MSG(_("No marks set"));
+ else
+ EMSG2(_("E283: No marks matching \"%s\""), arg);
+ }
+ }
+ /* don't output anything if 'q' typed at --more-- prompt */
+ else if (!got_int
+ && (arg == NULL || vim_strchr(arg, c) != NULL)
+ && p->lnum != 0)
+ {
+ if (!did_title)
+ {
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\nmark line col file/text"));
+ did_title = TRUE;
+ }
+ msg_putchar('\n');
+ if (!got_int)
+ {
+ sprintf((char *)IObuff, " %c %6ld %4d ", c, p->lnum, p->col);
+ msg_outtrans(IObuff);
+ if (name == NULL && current)
+ {
+ name = mark_line(p, 15);
+ mustfree = TRUE;
+ }
+ if (name != NULL)
+ {
+ msg_outtrans_attr(name, current ? hl_attr(HLF_D) : 0);
+ if (mustfree)
+ vim_free(name);
+ }
+ }
+ out_flush(); /* show one line at a time */
+ }
+}
+
+#if defined(FEAT_JUMPLIST) || defined(PROTO)
+/*
+ * print the jumplist
+ */
+/*ARGSUSED*/
+ void
+ex_jumps(eap)
+ exarg_T *eap;
+{
+ int i;
+ char_u *name;
+
+ cleanup_jumplist();
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n jump line col file/text"));
+ for (i = 0; i < curwin->w_jumplistlen && !got_int; ++i)
+ {
+ if (curwin->w_jumplist[i].fmark.mark.lnum != 0)
+ {
+ if (curwin->w_jumplist[i].fmark.fnum == 0)
+ fname2fnum(&curwin->w_jumplist[i]);
+ name = fm_getname(&curwin->w_jumplist[i].fmark, 16);
+ if (name == NULL) /* file name not available */
+ continue;
+
+ msg_putchar('\n');
+ if (got_int)
+ break;
+ sprintf((char *)IObuff, "%c %2d %5ld %4d ",
+ i == curwin->w_jumplistidx ? '>' : ' ',
+ i > curwin->w_jumplistidx ? i - curwin->w_jumplistidx
+ : curwin->w_jumplistidx - i,
+ curwin->w_jumplist[i].fmark.mark.lnum,
+ curwin->w_jumplist[i].fmark.mark.col);
+ msg_outtrans(IObuff);
+ msg_outtrans_attr(name,
+ curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum
+ ? hl_attr(HLF_D) : 0);
+ vim_free(name);
+ ui_breakcheck();
+ }
+ out_flush();
+ }
+ if (curwin->w_jumplistidx == curwin->w_jumplistlen)
+ MSG_PUTS("\n>");
+}
+
+/*
+ * print the changelist
+ */
+/*ARGSUSED*/
+ void
+ex_changes(eap)
+ exarg_T *eap;
+{
+ int i;
+ char_u *name;
+
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\nchange line col text"));
+
+ for (i = 0; i < curbuf->b_changelistlen && !got_int; ++i)
+ {
+ if (curbuf->b_changelist[i].lnum != 0)
+ {
+ msg_putchar('\n');
+ if (got_int)
+ break;
+ sprintf((char *)IObuff, "%c %3d %5ld %4d ",
+ i == curwin->w_changelistidx ? '>' : ' ',
+ i > curwin->w_changelistidx ? i - curwin->w_changelistidx
+ : curwin->w_changelistidx - i,
+ (long)curbuf->b_changelist[i].lnum,
+ curbuf->b_changelist[i].col);
+ msg_outtrans(IObuff);
+ name = mark_line(&curbuf->b_changelist[i], 17);
+ if (name == NULL)
+ break;
+ msg_outtrans_attr(name, hl_attr(HLF_D));
+ vim_free(name);
+ ui_breakcheck();
+ }
+ out_flush();
+ }
+ if (curwin->w_changelistidx == curbuf->b_changelistlen)
+ MSG_PUTS("\n>");
+}
+#endif
+
+#define one_adjust(add) \
+ { \
+ lp = add; \
+ if (*lp >= line1 && *lp <= line2) \
+ { \
+ if (amount == MAXLNUM) \
+ *lp = 0; \
+ else \
+ *lp += amount; \
+ } \
+ else if (amount_after && *lp > line2) \
+ *lp += amount_after; \
+ }
+
+/* don't delete the line, just put at first deleted line */
+#define one_adjust_nodel(add) \
+ { \
+ lp = add; \
+ if (*lp >= line1 && *lp <= line2) \
+ { \
+ if (amount == MAXLNUM) \
+ *lp = line1; \
+ else \
+ *lp += amount; \
+ } \
+ else if (amount_after && *lp > line2) \
+ *lp += amount_after; \
+ }
+
+/*
+ * Adjust marks between line1 and line2 (inclusive) to move 'amount' lines.
+ * Must be called before changed_*(), appended_lines() or deleted_lines().
+ * May be called before or after changing the text.
+ * When deleting lines line1 to line2, use an 'amount' of MAXLNUM: The marks
+ * within this range are made invalid.
+ * If 'amount_after' is non-zero adjust marks after line2.
+ * Example: Delete lines 34 and 35: mark_adjust(34, 35, MAXLNUM, -2);
+ * Example: Insert two lines below 55: mark_adjust(56, MAXLNUM, 2, 0);
+ * or: mark_adjust(56, 55, MAXLNUM, 2);
+ */
+ void
+mark_adjust(line1, line2, amount, amount_after)
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ int i;
+ int fnum = curbuf->b_fnum;
+ linenr_T *lp;
+ win_T *win;
+
+ if (line2 < line1 && amount_after == 0L) /* nothing to do */
+ return;
+
+ if (!cmdmod.lockmarks)
+ {
+ /* named marks, lower case and upper case */
+ for (i = 0; i < NMARKS; i++)
+ {
+ one_adjust(&(curbuf->b_namedm[i].lnum));
+ if (namedfm[i].fmark.fnum == fnum)
+ one_adjust_nodel(&(namedfm[i].fmark.mark.lnum));
+ }
+ for (i = NMARKS; i < NMARKS + EXTRA_MARKS; i++)
+ {
+ if (namedfm[i].fmark.fnum == fnum)
+ one_adjust_nodel(&(namedfm[i].fmark.mark.lnum));
+ }
+
+ /* last Insert position */
+ one_adjust(&(curbuf->b_last_insert.lnum));
+
+ /* last change position */
+ one_adjust(&(curbuf->b_last_change.lnum));
+
+#ifdef FEAT_JUMPLIST
+ /* list of change positions */
+ for (i = 0; i < curbuf->b_changelistlen; ++i)
+ one_adjust_nodel(&(curbuf->b_changelist[i].lnum));
+#endif
+
+#ifdef FEAT_VISUAL
+ /* Visual area */
+ one_adjust_nodel(&(curbuf->b_visual_start.lnum));
+ one_adjust_nodel(&(curbuf->b_visual_end.lnum));
+#endif
+
+#ifdef FEAT_QUICKFIX
+ /* quickfix marks */
+ qf_mark_adjust(line1, line2, amount, amount_after);
+#endif
+
+#ifdef FEAT_SIGNS
+ sign_mark_adjust(line1, line2, amount, amount_after);
+#endif
+ }
+
+ /* previous context mark */
+ one_adjust(&(curwin->w_pcmark.lnum));
+
+ /* previous pcmark */
+ one_adjust(&(curwin->w_prev_pcmark.lnum));
+
+ /* saved cursor for formatting */
+ if (saved_cursor.lnum != 0)
+ one_adjust_nodel(&(saved_cursor.lnum));
+
+ /*
+ * Adjust items in all windows related to the current buffer.
+ */
+ FOR_ALL_WINDOWS(win)
+ {
+#ifdef FEAT_JUMPLIST
+ if (!cmdmod.lockmarks)
+ /* Marks in the jumplist. When deleting lines, this may create
+ * duplicate marks in the jumplist, they will be removed later. */
+ for (i = 0; i < win->w_jumplistlen; ++i)
+ if (win->w_jumplist[i].fmark.fnum == fnum)
+ one_adjust_nodel(&(win->w_jumplist[i].fmark.mark.lnum));
+#endif
+
+ if (win->w_buffer == curbuf)
+ {
+ if (!cmdmod.lockmarks)
+ /* marks in the tag stack */
+ for (i = 0; i < win->w_tagstacklen; i++)
+ if (win->w_tagstack[i].fmark.fnum == fnum)
+ one_adjust_nodel(&(win->w_tagstack[i].fmark.mark.lnum));
+
+#ifdef FEAT_VISUAL
+ /* the displayed Visual area */
+ if (win->w_old_cursor_lnum != 0)
+ {
+ one_adjust_nodel(&(win->w_old_cursor_lnum));
+ one_adjust_nodel(&(win->w_old_visual_lnum));
+ }
+#endif
+
+ /* topline and cursor position for windows with the same buffer
+ * other than the current window */
+ if (win != curwin)
+ {
+ if (win->w_topline >= line1 && win->w_topline <= line2)
+ {
+ if (amount == MAXLNUM) /* topline is deleted */
+ {
+ if (line1 <= 1)
+ win->w_topline = 1;
+ else
+ win->w_topline = line1 - 1;
+ }
+ else /* keep topline on the same line */
+ win->w_topline += amount;
+#ifdef FEAT_DIFF
+ win->w_topfill = 0;
+#endif
+ }
+ else if (amount_after && win->w_topline > line2)
+ {
+ win->w_topline += amount_after;
+#ifdef FEAT_DIFF
+ win->w_topfill = 0;
+#endif
+ }
+ if (win->w_cursor.lnum >= line1 && win->w_cursor.lnum <= line2)
+ {
+ if (amount == MAXLNUM) /* line with cursor is deleted */
+ {
+ if (line1 <= 1)
+ win->w_cursor.lnum = 1;
+ else
+ win->w_cursor.lnum = line1 - 1;
+ win->w_cursor.col = 0;
+ }
+ else /* keep cursor on the same line */
+ win->w_cursor.lnum += amount;
+ }
+ else if (amount_after && win->w_cursor.lnum > line2)
+ win->w_cursor.lnum += amount_after;
+ }
+
+#ifdef FEAT_FOLDING
+ /* adjust folds */
+ foldMarkAdjust(win, line1, line2, amount, amount_after);
+#endif
+ }
+ }
+
+#ifdef FEAT_DIFF
+ /* adjust diffs */
+ diff_mark_adjust(line1, line2, amount, amount_after);
+#endif
+}
+
+/* This code is used often, needs to be fast. */
+#define col_adjust(pp) \
+ { \
+ posp = pp; \
+ if (posp->lnum == lnum && posp->col >= mincol) \
+ { \
+ posp->lnum += lnum_amount; \
+ if (col_amount < 0 && posp->col <= (colnr_T)-col_amount) \
+ posp->col = 0; \
+ else \
+ posp->col += col_amount; \
+ } \
+ }
+
+/*
+ * Adjust marks in line "lnum" at column "mincol" and further: add
+ * "lnum_amount" to the line number and add "col_amount" to the column
+ * position.
+ */
+ void
+mark_col_adjust(lnum, mincol, lnum_amount, col_amount)
+ linenr_T lnum;
+ colnr_T mincol;
+ long lnum_amount;
+ long col_amount;
+{
+ int i;
+ int fnum = curbuf->b_fnum;
+ win_T *win;
+ pos_T *posp;
+
+ if ((col_amount == 0L && lnum_amount == 0L) || cmdmod.lockmarks)
+ return; /* nothing to do */
+
+ /* named marks, lower case and upper case */
+ for (i = 0; i < NMARKS; i++)
+ {
+ col_adjust(&(curbuf->b_namedm[i]));
+ if (namedfm[i].fmark.fnum == fnum)
+ col_adjust(&(namedfm[i].fmark.mark));
+ }
+ for (i = NMARKS; i < NMARKS + EXTRA_MARKS; i++)
+ {
+ if (namedfm[i].fmark.fnum == fnum)
+ col_adjust(&(namedfm[i].fmark.mark));
+ }
+
+ /* last Insert position */
+ col_adjust(&(curbuf->b_last_insert));
+
+ /* last change position */
+ col_adjust(&(curbuf->b_last_change));
+
+#ifdef FEAT_JUMPLIST
+ /* list of change positions */
+ for (i = 0; i < curbuf->b_changelistlen; ++i)
+ col_adjust(&(curbuf->b_changelist[i]));
+#endif
+
+#ifdef FEAT_VISUAL
+ /* Visual area */
+ col_adjust(&(curbuf->b_visual_start));
+ col_adjust(&(curbuf->b_visual_end));
+#endif
+
+ /* previous context mark */
+ col_adjust(&(curwin->w_pcmark));
+
+ /* previous pcmark */
+ col_adjust(&(curwin->w_prev_pcmark));
+
+ /* saved cursor for formatting */
+ col_adjust(&saved_cursor);
+
+ /*
+ * Adjust items in all windows related to the current buffer.
+ */
+ FOR_ALL_WINDOWS(win)
+ {
+#ifdef FEAT_JUMPLIST
+ /* marks in the jumplist */
+ for (i = 0; i < win->w_jumplistlen; ++i)
+ if (win->w_jumplist[i].fmark.fnum == fnum)
+ col_adjust(&(win->w_jumplist[i].fmark.mark));
+#endif
+
+ if (win->w_buffer == curbuf)
+ {
+ /* marks in the tag stack */
+ for (i = 0; i < win->w_tagstacklen; i++)
+ if (win->w_tagstack[i].fmark.fnum == fnum)
+ col_adjust(&(win->w_tagstack[i].fmark.mark));
+
+ /* cursor position for other windows with the same buffer */
+ if (win != curwin)
+ col_adjust(&win->w_cursor);
+ }
+ }
+}
+
+#ifdef FEAT_JUMPLIST
+/*
+ * When deleting lines, this may create duplicate marks in the
+ * jumplist. They will be removed here for the current window.
+ */
+ static void
+cleanup_jumplist()
+{
+ int i;
+ int from, to;
+
+ to = 0;
+ for (from = 0; from < curwin->w_jumplistlen; ++from)
+ {
+ if (curwin->w_jumplistidx == from)
+ curwin->w_jumplistidx = to;
+ for (i = from + 1; i < curwin->w_jumplistlen; ++i)
+ if (curwin->w_jumplist[i].fmark.fnum
+ == curwin->w_jumplist[from].fmark.fnum
+ && curwin->w_jumplist[from].fmark.fnum != 0
+ && curwin->w_jumplist[i].fmark.mark.lnum
+ == curwin->w_jumplist[from].fmark.mark.lnum)
+ break;
+ if (i >= curwin->w_jumplistlen) /* no duplicate */
+ curwin->w_jumplist[to++] = curwin->w_jumplist[from];
+ else
+ vim_free(curwin->w_jumplist[from].fname);
+ }
+ if (curwin->w_jumplistidx == curwin->w_jumplistlen)
+ curwin->w_jumplistidx = to;
+ curwin->w_jumplistlen = to;
+}
+
+# if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Copy the jumplist from window "from" to window "to".
+ */
+ void
+copy_jumplist(from, to)
+ win_T *from;
+ win_T *to;
+{
+ int i;
+
+ for (i = 0; i < from->w_jumplistlen; ++i)
+ {
+ to->w_jumplist[i] = from->w_jumplist[i];
+ if (from->w_jumplist[i].fname != NULL)
+ to->w_jumplist[i].fname = vim_strsave(from->w_jumplist[i].fname);
+ }
+ to->w_jumplistlen = from->w_jumplistlen;
+ to->w_jumplistidx = from->w_jumplistidx;
+}
+
+/*
+ * Free items in the jumplist of window "wp".
+ */
+ void
+free_jumplist(wp)
+ win_T *wp;
+{
+ int i;
+
+ for (i = 0; i < wp->w_jumplistlen; ++i)
+ vim_free(wp->w_jumplist[i].fname);
+}
+# endif
+#endif /* FEAT_JUMPLIST */
+
+ void
+set_last_cursor(win)
+ win_T *win;
+{
+ win->w_buffer->b_last_cursor = win->w_cursor;
+}
+
+#if defined(FEAT_VIMINFO) || defined(PROTO)
+ int
+read_viminfo_filemark(virp, force)
+ vir_T *virp;
+ int force;
+{
+ char_u *str;
+ xfmark_T *fm;
+ int i;
+
+ /* We only get here if line[0] == '\'' or '-'.
+ * Illegal mark names are ignored (for future expansion). */
+ str = virp->vir_line + 1;
+ if (
+#ifndef EBCDIC
+ *str <= 127 &&
+#endif
+ ((*virp->vir_line == '\'' && (VIM_ISDIGIT(*str) || isupper(*str)))
+ || (*virp->vir_line == '-' && *str == '\'')))
+ {
+ if (*str == '\'')
+ {
+#ifdef FEAT_JUMPLIST
+ /* If the jumplist isn't full insert fmark as oldest entry */
+ if (curwin->w_jumplistlen == JUMPLISTSIZE)
+ fm = NULL;
+ else
+ {
+ for (i = curwin->w_jumplistlen; i > 0; --i)
+ curwin->w_jumplist[i] = curwin->w_jumplist[i - 1];
+ ++curwin->w_jumplistidx;
+ ++curwin->w_jumplistlen;
+ fm = &curwin->w_jumplist[0];
+ fm->fmark.mark.lnum = 0;
+ fm->fname = NULL;
+ }
+#else
+ fm = NULL;
+#endif
+ }
+ else if (VIM_ISDIGIT(*str))
+ fm = &namedfm[*str - '0' + NMARKS];
+ else
+ fm = &namedfm[*str - 'A'];
+ if (fm != NULL && (fm->fmark.mark.lnum == 0 || force))
+ {
+ str = skipwhite(str + 1);
+ fm->fmark.mark.lnum = getdigits(&str);
+ str = skipwhite(str);
+ fm->fmark.mark.col = getdigits(&str);
+#ifdef FEAT_VIRTUALEDIT
+ fm->fmark.mark.coladd = 0;
+#endif
+ fm->fmark.fnum = 0;
+ str = skipwhite(str);
+ vim_free(fm->fname);
+ fm->fname = viminfo_readstring(virp, (int)(str - virp->vir_line),
+ FALSE);
+ }
+ }
+ return vim_fgets(virp->vir_line, LSIZE, virp->vir_fd);
+}
+
+ void
+write_viminfo_filemarks(fp)
+ FILE *fp;
+{
+ int i;
+ char_u *name;
+ buf_T *buf;
+ xfmark_T *fm;
+
+ if (get_viminfo_parameter('f') == 0)
+ return;
+
+ fprintf(fp, _("\n# File marks:\n"));
+
+ /*
+ * Find a mark that is the same file and position as the cursor.
+ * That one, or else the last one is deleted.
+ * Move '0 to '1, '1 to '2, etc. until the matching one or '9
+ * Set '0 mark to current cursor position.
+ */
+ if (curbuf->b_ffname != NULL && !removable(curbuf->b_ffname))
+ {
+ name = buflist_nr2name(curbuf->b_fnum, TRUE, FALSE);
+ for (i = NMARKS; i < NMARKS + EXTRA_MARKS - 1; ++i)
+ if (namedfm[i].fmark.mark.lnum == curwin->w_cursor.lnum
+ && (namedfm[i].fname == NULL
+ ? namedfm[i].fmark.fnum == curbuf->b_fnum
+ : (name != NULL
+ && STRCMP(name, namedfm[i].fname) == 0)))
+ break;
+ vim_free(name);
+
+ vim_free(namedfm[i].fname);
+ for ( ; i > NMARKS; --i)
+ namedfm[i] = namedfm[i - 1];
+ namedfm[NMARKS].fmark.mark = curwin->w_cursor;
+ namedfm[NMARKS].fmark.fnum = curbuf->b_fnum;
+ namedfm[NMARKS].fname = NULL;
+ }
+
+ /* Write the filemarks '0 - '9 and 'A - 'Z */
+ for (i = 0; i < NMARKS + EXTRA_MARKS; i++)
+ write_one_filemark(fp, &namedfm[i], '\'',
+ i < NMARKS ? i + 'A' : i - NMARKS + '0');
+
+#ifdef FEAT_JUMPLIST
+ /* Write the jumplist with -' */
+ fprintf(fp, _("\n# Jumplist (newest first):\n"));
+ setpcmark(); /* add current cursor position */
+ cleanup_jumplist();
+ for (fm = &curwin->w_jumplist[curwin->w_jumplistlen - 1];
+ fm >= &curwin->w_jumplist[0]; --fm)
+ {
+ if (fm->fmark.fnum == 0
+ || ((buf = buflist_findnr(fm->fmark.fnum)) != NULL
+ && !removable(buf->b_ffname)))
+ write_one_filemark(fp, fm, '-', '\'');
+ }
+#endif
+}
+
+ static void
+write_one_filemark(fp, fm, c1, c2)
+ FILE *fp;
+ xfmark_T *fm;
+ int c1;
+ int c2;
+{
+ char_u *name;
+
+ if (fm->fmark.mark.lnum == 0) /* not set */
+ return;
+
+ if (fm->fmark.fnum != 0) /* there is a buffer */
+ name = buflist_nr2name(fm->fmark.fnum, TRUE, FALSE);
+ else
+ name = fm->fname; /* use name from .viminfo */
+ if (name != NULL && *name != NUL)
+ {
+ fprintf(fp, "%c%c %ld %ld ", c1, c2, (long)fm->fmark.mark.lnum,
+ (long)fm->fmark.mark.col);
+ viminfo_writestring(fp, name);
+ }
+
+ if (fm->fmark.fnum != 0)
+ vim_free(name);
+}
+
+/*
+ * Return TRUE if "name" is on removable media (depending on 'viminfo').
+ */
+ int
+removable(name)
+ char_u *name;
+{
+ char_u *p;
+ char_u part[51];
+ int retval = FALSE;
+
+ name = home_replace_save(NULL, name);
+ if (name != NULL)
+ {
+ for (p = p_viminfo; *p; )
+ {
+ copy_option_part(&p, part, 51, ", ");
+ if (part[0] == 'r'
+ && MB_STRNICMP(part + 1, name, STRLEN(part + 1)) == 0)
+ {
+ retval = TRUE;
+ break;
+ }
+ }
+ vim_free(name);
+ }
+ return retval;
+}
+
+static void write_one_mark __ARGS((FILE *fp_out, int c, pos_T *pos));
+
+/*
+ * Write all the named marks for all buffers.
+ * Return the number of buffers for which marks have been written.
+ */
+ int
+write_viminfo_marks(fp_out)
+ FILE *fp_out;
+{
+ int count;
+ buf_T *buf;
+ int is_mark_set;
+ int i;
+#ifdef FEAT_WINDOWS
+ win_T *win;
+
+ /*
+ * Set b_last_cursor for the all buffers that have a window.
+ */
+ for (win = firstwin; win != NULL; win = win->w_next)
+ set_last_cursor(win);
+#else
+ set_last_cursor(curwin);
+#endif
+
+ fprintf(fp_out, _("\n# History of marks within files (newest to oldest):\n"));
+ count = 0;
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ /*
+ * Only write something if buffer has been loaded and at least one
+ * mark is set.
+ */
+ if (buf->b_marks_read)
+ {
+ if (buf->b_last_cursor.lnum != 0)
+ is_mark_set = TRUE;
+ else
+ {
+ is_mark_set = FALSE;
+ for (i = 0; i < NMARKS; i++)
+ if (buf->b_namedm[i].lnum != 0)
+ {
+ is_mark_set = TRUE;
+ break;
+ }
+ }
+ if (is_mark_set && buf->b_ffname != NULL
+ && buf->b_ffname[0] != NUL && !removable(buf->b_ffname))
+ {
+ home_replace(NULL, buf->b_ffname, IObuff, IOSIZE, TRUE);
+ fprintf(fp_out, "\n> ");
+ viminfo_writestring(fp_out, IObuff);
+ write_one_mark(fp_out, '"', &buf->b_last_cursor);
+ write_one_mark(fp_out, '^', &buf->b_last_insert);
+ write_one_mark(fp_out, '.', &buf->b_last_change);
+#ifdef FEAT_JUMPLIST
+ /* changelist positions are stored oldest first */
+ for (i = 0; i < buf->b_changelistlen; ++i)
+ write_one_mark(fp_out, '+', &buf->b_changelist[i]);
+#endif
+ for (i = 0; i < NMARKS; i++)
+ write_one_mark(fp_out, 'a' + i, &buf->b_namedm[i]);
+ count++;
+ }
+ }
+ }
+
+ return count;
+}
+
+ static void
+write_one_mark(fp_out, c, pos)
+ FILE *fp_out;
+ int c;
+ pos_T *pos;
+{
+ if (pos->lnum != 0)
+ fprintf(fp_out, "\t%c\t%ld\t%d\n", c, (long)pos->lnum, (int)pos->col);
+}
+
+/*
+ * Handle marks in the viminfo file:
+ * fp_out == NULL read marks for current buffer only
+ * fp_out != NULL copy marks for buffers not in buffer list
+ */
+ void
+copy_viminfo_marks(virp, fp_out, count, eof)
+ vir_T *virp;
+ FILE *fp_out;
+ int count;
+ int eof;
+{
+ char_u *line = virp->vir_line;
+ buf_T *buf;
+ int num_marked_files;
+ int load_marks;
+ int copy_marks_out;
+ char_u *str;
+ int i;
+ char_u *p;
+ char_u *name_buf;
+ pos_T pos;
+
+ if ((name_buf = alloc(LSIZE)) == NULL)
+ return;
+ *name_buf = NUL;
+ num_marked_files = get_viminfo_parameter('\'');
+ while (!eof && (count < num_marked_files || fp_out == NULL))
+ {
+ if (line[0] != '>')
+ {
+ if (line[0] != '\n' && line[0] != '\r' && line[0] != '#')
+ {
+ if (viminfo_error("E576: ", _("Missing '>'"), line))
+ break; /* too many errors, return now */
+ }
+ eof = vim_fgets(line, LSIZE, virp->vir_fd);
+ continue; /* Skip this dud line */
+ }
+
+ /*
+ * Handle long line and translate escaped characters.
+ * Find file name, set str to start.
+ * Ignore leading and trailing white space.
+ */
+ str = skipwhite(line + 1);
+ str = viminfo_readstring(virp, (int)(str - virp->vir_line), FALSE);
+ if (str == NULL)
+ continue;
+ p = str + STRLEN(str);
+ while (p != str && (*p == NUL || vim_isspace(*p)))
+ p--;
+ if (*p)
+ p++;
+ *p = NUL;
+
+ /*
+ * If fp_out == NULL, load marks for current buffer.
+ * If fp_out != NULL, copy marks for buffers not in buflist.
+ */
+ load_marks = copy_marks_out = FALSE;
+ if (fp_out == NULL)
+ {
+ if (curbuf->b_ffname != NULL)
+ {
+ if (*name_buf == NUL) /* only need to do this once */
+ home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
+ if (fnamecmp(str, name_buf) == 0)
+ load_marks = TRUE;
+ }
+ }
+ else /* fp_out != NULL */
+ {
+ /* This is slow if there are many buffers!! */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_ffname != NULL)
+ {
+ home_replace(NULL, buf->b_ffname, name_buf, LSIZE, TRUE);
+ if (fnamecmp(str, name_buf) == 0)
+ break;
+ }
+
+ /*
+ * copy marks if the buffer has not been loaded
+ */
+ if (buf == NULL || !buf->b_marks_read)
+ {
+ copy_marks_out = TRUE;
+ fputs("\n> ", fp_out);
+ viminfo_writestring(fp_out, str);
+ count++;
+ }
+ }
+ vim_free(str);
+
+#ifdef FEAT_VIRTUALEDIT
+ pos.coladd = 0;
+#endif
+ while (!(eof = viminfo_readline(virp)) && line[0] == TAB)
+ {
+ if (load_marks)
+ {
+ if (line[1] != NUL)
+ {
+ sscanf((char *)line + 2, "%ld %u", &pos.lnum, &pos.col);
+ switch (line[1])
+ {
+ case '"': curbuf->b_last_cursor = pos; break;
+ case '^': curbuf->b_last_insert = pos; break;
+ case '.': curbuf->b_last_change = pos; break;
+ case '+':
+#ifdef FEAT_JUMPLIST
+ /* changelist positions are stored oldest
+ * first */
+ if (curbuf->b_changelistlen == JUMPLISTSIZE)
+ /* list is full, remove oldest entry */
+ mch_memmove(curbuf->b_changelist,
+ curbuf->b_changelist + 1,
+ sizeof(pos_T) * (JUMPLISTSIZE - 1));
+ else
+ ++curbuf->b_changelistlen;
+ curbuf->b_changelist[
+ curbuf->b_changelistlen - 1] = pos;
+#endif
+ break;
+ default: if ((i = line[1] - 'a') >= 0 && i < NMARKS)
+ curbuf->b_namedm[i] = pos;
+ }
+ }
+ }
+ else if (copy_marks_out)
+ fputs((char *)line, fp_out);
+ }
+ if (load_marks)
+ {
+#ifdef FEAT_JUMPLIST
+ win_T *wp;
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer == curbuf)
+ wp->w_changelistidx = curbuf->b_changelistlen;
+ }
+#endif
+ break;
+ }
+ }
+ vim_free(name_buf);
+}
+#endif /* FEAT_VIMINFO */
diff --git a/src/mbyte.c b/src/mbyte.c
new file mode 100644
index 000000000..699316d0e
--- /dev/null
+++ b/src/mbyte.c
@@ -0,0 +1,5833 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Multibyte extensions partly by Sung-Hoon Baek
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * mbyte.c: Code specifically for handling multi-byte characters.
+ *
+ * The encoding used in the core is set with 'encoding'. When 'encoding' is
+ * changed, the following four variables are set (for speed).
+ * Currently these types of character encodings are supported:
+ *
+ * "enc_dbcs" When non-zero it tells the type of double byte character
+ * encoding (Chinese, Korean, Japanese, etc.).
+ * The cell width on the display is equal to the number of
+ * bytes. (exception: DBCS_JPNU with first byte 0x8e)
+ * Recognizing the first or second byte is difficult, it
+ * requires checking a byte sequence from the start.
+ * "enc_utf8" When TRUE use Unicode characters in UTF-8 encoding.
+ * The cell width on the display needs to be determined from
+ * the character value.
+ * Recognizing bytes is easy: 0xxx.xxxx is a single-byte
+ * char, 10xx.xxxx is a trailing byte, 11xx.xxxx is a leading
+ * byte of a multi-byte character.
+ * To make things complicated, up to two composing characters
+ * are allowed. These are drawn on top of the first char.
+ * For most editing the sequence of bytes with composing
+ * characters included is considered to be one character.
+ * "enc_unicode" When 2 use 16-bit Unicode characters (or UTF-16).
+ * When 4 use 32-but Unicode characters.
+ * Internally characters are stored in UTF-8 encoding to
+ * avoid NUL bytes. Conversion happens when doing I/O.
+ * "enc_utf8" will also be TRUE.
+ *
+ * "has_mbyte" is set when "enc_dbcs" or "enc_utf8" is non-zero.
+ *
+ * If none of these is TRUE, 8-bit bytes are used for a character. The
+ * encoding isn't currently specified (TODO).
+ *
+ * 'encoding' specifies the encoding used in the core. This is in registers,
+ * text manipulation, buffers, etc. Conversion has to be done when characters
+ * in another encoding are received or send:
+ *
+ * clipboard
+ * ^
+ * | (2)
+ * V
+ * +---------------+
+ * (1) | | (3)
+ * keyboard ----->| core |-----> display
+ * | |
+ * +---------------+
+ * ^
+ * | (4)
+ * V
+ * file
+ *
+ * (1) Typed characters arrive in the current locale. Conversion is to be
+ * done when 'encoding' is different from 'termencoding'.
+ * (2) Text will be made available with the encoding specified with
+ * 'encoding'. If this is not sufficient, system-specific conversion
+ * might be required.
+ * (3) For the GUI the correct font must be selected, no conversion done.
+ * Otherwise, conversion is to be done when 'encoding' differs from
+ * 'termencoding'. (Different in the GTK+ 2 port -- 'termencoding'
+ * is always used for both input and output and must always be set to
+ * "utf-8". gui_mch_init() does this automatically.)
+ * (4) The encoding of the file is specified with 'fileencoding'. Conversion
+ * is to be done when it's different from 'encoding'.
+ *
+ * The viminfo file is a special case: Only text is converted, not file names.
+ * Vim scripts may contain an ":encoding" command. This has an effect for
+ * some commands, like ":menutrans"
+ */
+
+#include "vim.h"
+
+#ifdef WIN32UNIX
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# ifdef WIN32
+# undef WIN32 /* Some windows.h define WIN32, we don't want that here. */
+# endif
+#endif
+
+#if (defined(WIN3264) || defined(WIN32UNIX)) && !defined(__MINGW32__)
+# include <winnls.h>
+#endif
+
+#ifdef FEAT_GUI_X11
+# include <X11/Intrinsic.h>
+#endif
+#ifdef X_LOCALE
+#include <X11/Xlocale.h>
+#endif
+
+#if defined(FEAT_XIM) && defined(HAVE_GTK2)
+# include <gdk/gdkkeysyms.h>
+# ifdef WIN3264
+# include <gdk/gdkwin32.h>
+# else
+# include <gdk/gdkx.h>
+# endif
+#endif
+
+#ifdef HAVE_WCHAR_H
+# include <wchar.h>
+#endif
+
+#if 0
+/* This has been disabled, because several people reported problems with the
+ * wcwidth() and iswprint() library functions, esp. for Hebrew. */
+# ifdef __STDC_ISO_10646__
+# define USE_WCHAR_FUNCTIONS
+# endif
+#endif
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+
+static int enc_canon_search __ARGS((char_u *name));
+static int dbcs_char2len __ARGS((int c));
+static int dbcs_char2bytes __ARGS((int c, char_u *buf));
+static int dbcs_ptr2len_check __ARGS((char_u *p));
+static int dbcs_char2cells __ARGS((int c));
+static int dbcs_ptr2char __ARGS((char_u *p));
+
+/* Lookup table to quickly get the length in bytes of a UTF-8 character from
+ * the first byte of a UTF-8 string. Bytes which are illegal when used as the
+ * first byte have a one, because these will be used separately. */
+static char utf8len_tab[256] =
+{
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /*bogus*/
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1,
+};
+
+/*
+ * XIM often causes trouble. Define XIM_DEBUG to get a log of XIM callbacks
+ * in the "xim.log" file.
+ */
+/* #define XIM_DEBUG */
+#ifdef XIM_DEBUG
+ static void
+xim_log(char *s, ...)
+{
+ va_list arglist;
+ static FILE *fd = NULL;
+
+ if (fd == (FILE *)-1)
+ return;
+ if (fd == NULL)
+ {
+ fd = fopen("xim.log", "w");
+ if (fd == NULL)
+ {
+ EMSG("Cannot open xim.log");
+ fd = (FILE *)-1;
+ return;
+ }
+ }
+
+ va_start(arglist, s);
+ vfprintf(fd, s, arglist);
+ va_end(arglist);
+}
+#endif
+
+#endif
+
+#if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT) || defined(PROTO)
+/*
+ * Canonical encoding names and their properties.
+ * "iso-8859-n" is handled by enc_canonize() directly.
+ */
+static struct
+{ char *name; int prop; int codepage;}
+enc_canon_table[] =
+{
+#define IDX_LATIN_1 0
+ {"latin1", ENC_8BIT + ENC_LATIN1, 1252},
+#define IDX_ISO_2 1
+ {"iso-8859-2", ENC_8BIT, 0},
+#define IDX_ISO_3 2
+ {"iso-8859-3", ENC_8BIT, 0},
+#define IDX_ISO_4 3
+ {"iso-8859-4", ENC_8BIT, 0},
+#define IDX_ISO_5 4
+ {"iso-8859-5", ENC_8BIT, 0},
+#define IDX_ISO_6 5
+ {"iso-8859-6", ENC_8BIT, 0},
+#define IDX_ISO_7 6
+ {"iso-8859-7", ENC_8BIT, 0},
+#define IDX_CP1255 7
+ {"cp1255", ENC_8BIT, 1255}, /* close to iso-8859-8 */
+#define IDX_ISO_8 8
+ {"iso-8859-8", ENC_8BIT, 0},
+#define IDX_ISO_9 9
+ {"iso-8859-9", ENC_8BIT, 0},
+#define IDX_ISO_10 10
+ {"iso-8859-10", ENC_8BIT, 0},
+#define IDX_ISO_11 11
+ {"iso-8859-11", ENC_8BIT, 0},
+#define IDX_ISO_13 12
+ {"iso-8859-13", ENC_8BIT, 0},
+#define IDX_ISO_14 13
+ {"iso-8859-14", ENC_8BIT, 0},
+#define IDX_ISO_15 14
+ {"iso-8859-15", ENC_8BIT, 0},
+#define IDX_KOI8_R 15
+ {"koi8-r", ENC_8BIT, 0},
+#define IDX_KOI8_U 16
+ {"koi8-u", ENC_8BIT, 0},
+#define IDX_UTF8 17
+ {"utf-8", ENC_UNICODE, 0},
+#define IDX_UCS2 18
+ {"ucs-2", ENC_UNICODE + ENC_ENDIAN_B + ENC_2BYTE, 0},
+#define IDX_UCS2LE 19
+ {"ucs-2le", ENC_UNICODE + ENC_ENDIAN_L + ENC_2BYTE, 0},
+#define IDX_UTF16 20
+ {"utf-16", ENC_UNICODE + ENC_ENDIAN_B + ENC_2WORD, 0},
+#define IDX_UTF16LE 21
+ {"utf-16le", ENC_UNICODE + ENC_ENDIAN_L + ENC_2WORD, 0},
+#define IDX_UCS4 22
+ {"ucs-4", ENC_UNICODE + ENC_ENDIAN_B + ENC_4BYTE, 0},
+#define IDX_UCS4LE 23
+ {"ucs-4le", ENC_UNICODE + ENC_ENDIAN_L + ENC_4BYTE, 0},
+#define IDX_DEBUG 24
+ {"debug", ENC_DBCS, DBCS_DEBUG},
+#define IDX_CP932 25
+ {"cp932", ENC_DBCS, DBCS_JPN},
+#define IDX_CP949 26
+ {"cp949", ENC_DBCS, DBCS_KOR},
+#define IDX_CP936 27
+ {"cp936", ENC_DBCS, DBCS_CHS},
+#define IDX_CP950 28
+ {"cp950", ENC_DBCS, DBCS_CHT},
+#define IDX_EUC_JP 29
+ {"euc-jp", ENC_DBCS, DBCS_JPNU},
+#define IDX_SJIS 30
+ {"sjis", ENC_DBCS, DBCS_JPN},
+#define IDX_EUC_KR 31
+ {"euc-kr", ENC_DBCS, DBCS_KORU},
+#define IDX_EUC_CN 32
+ {"euc-cn", ENC_DBCS, DBCS_CHSU},
+#define IDX_EUC_TW 33
+ {"euc-tw", ENC_DBCS, DBCS_CHTU},
+#define IDX_BIG5 34
+ {"big5", ENC_DBCS, DBCS_CHT},
+#define IDX_CP1251 35
+ {"cp1251", ENC_8BIT, 1251},
+#define IDX_MACROMAN 36
+ {"macroman", ENC_8BIT + ENC_MACROMAN, 0},
+#define IDX_COUNT 37
+};
+
+/*
+ * Aliases for encoding names.
+ */
+static struct
+{ char *name; int canon;}
+enc_alias_table[] =
+{
+ {"ansi", IDX_LATIN_1},
+ {"iso-8859-1", IDX_LATIN_1},
+ {"latin2", IDX_ISO_2},
+ {"latin3", IDX_ISO_3},
+ {"latin4", IDX_ISO_4},
+ {"cyrillic", IDX_ISO_5},
+ {"arabic", IDX_ISO_6},
+ {"greek", IDX_ISO_7},
+#ifdef WIN3264
+ {"hebrew", IDX_CP1255},
+#else
+ {"hebrew", IDX_ISO_8},
+#endif
+ {"latin5", IDX_ISO_9},
+ {"turkish", IDX_ISO_9}, /* ? */
+ {"latin6", IDX_ISO_10},
+ {"nordic", IDX_ISO_10}, /* ? */
+ {"thai", IDX_ISO_11}, /* ? */
+ {"latin7", IDX_ISO_13},
+ {"latin8", IDX_ISO_14},
+ {"latin9", IDX_ISO_15},
+ {"utf8", IDX_UTF8},
+ {"unicode", IDX_UCS2},
+ {"ucs2", IDX_UCS2},
+ {"ucs2be", IDX_UCS2},
+ {"ucs-2be", IDX_UCS2},
+ {"ucs2le", IDX_UCS2LE},
+ {"utf16", IDX_UTF16},
+ {"utf16be", IDX_UTF16},
+ {"utf-16be", IDX_UTF16},
+ {"utf16le", IDX_UTF16LE},
+ {"ucs4", IDX_UCS4},
+ {"ucs4be", IDX_UCS4},
+ {"ucs-4be", IDX_UCS4},
+ {"ucs4le", IDX_UCS4LE},
+ {"932", IDX_CP932},
+ {"949", IDX_CP949},
+ {"936", IDX_CP936},
+ {"950", IDX_CP950},
+ {"eucjp", IDX_EUC_JP},
+ {"unix-jis", IDX_EUC_JP},
+ {"ujis", IDX_EUC_JP},
+ {"shift-jis", IDX_SJIS},
+ {"euckr", IDX_EUC_KR},
+ {"5601", IDX_EUC_KR}, /* Sun: KS C 5601 */
+ {"euccn", IDX_EUC_CN},
+ {"gb2312", IDX_EUC_CN},
+ {"euctw", IDX_EUC_TW},
+#if defined(WIN3264) || defined(WIN32UNIX) || defined(MACOS)
+ {"japan", IDX_CP932},
+ {"korea", IDX_CP949},
+ {"prc", IDX_CP936},
+ {"chinese", IDX_CP936},
+ {"taiwan", IDX_CP950},
+ {"big5", IDX_CP950},
+#else
+ {"japan", IDX_EUC_JP},
+ {"korea", IDX_EUC_KR},
+ {"prc", IDX_EUC_CN},
+ {"chinese", IDX_EUC_CN},
+ {"taiwan", IDX_EUC_TW},
+ {"cp950", IDX_BIG5},
+ {"950", IDX_BIG5},
+#endif
+ {"mac", IDX_MACROMAN},
+ {NULL, 0}
+};
+
+#ifndef CP_UTF8
+# define CP_UTF8 65001 /* magic number from winnls.h */
+#endif
+
+/*
+ * Find encoding "name" in the list of canonical encoding names.
+ * Returns -1 if not found.
+ */
+ static int
+enc_canon_search(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; i < IDX_COUNT; ++i)
+ if (STRCMP(name, enc_canon_table[i].name) == 0)
+ return i;
+ return -1;
+}
+
+#endif
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+
+/*
+ * Find canonical encoding "name" in the list and return its properties.
+ * Returns 0 if not found.
+ */
+ int
+enc_canon_props(name)
+ char_u *name;
+{
+ int i;
+
+ i = enc_canon_search(name);
+ if (i >= 0)
+ return enc_canon_table[i].prop;
+#ifdef WIN3264
+ if (name[0] == 'c' && name[1] == 'p' && VIM_ISDIGIT(name[2]))
+ {
+ CPINFO cpinfo;
+
+ /* Get info on this codepage to find out what it is. */
+ if (GetCPInfo(atoi(name + 2), &cpinfo) != 0)
+ {
+ if (cpinfo.MaxCharSize == 1) /* some single-byte encoding */
+ return ENC_8BIT;
+ if (cpinfo.MaxCharSize == 2
+ && (cpinfo.LeadByte[0] != 0 || cpinfo.LeadByte[1] != 0))
+ /* must be a DBCS encoding */
+ return ENC_DBCS;
+ }
+ return 0;
+ }
+#endif
+ if (STRNCMP(name, "2byte-", 6) == 0)
+ return ENC_DBCS;
+ if (STRNCMP(name, "8bit-", 5) == 0 || STRNCMP(name, "iso-8859-", 9) == 0)
+ return ENC_8BIT;
+ return 0;
+}
+
+/*
+ * Set up for using multi-byte characters.
+ * Called in three cases:
+ * - by main() to initialize (p_enc == NULL)
+ * - by set_init_1() after 'encoding' was set to its default.
+ * - by do_set() when 'encoding' has been set.
+ * p_enc must have been passed through enc_canonize() already.
+ * Sets the "enc_unicode", "enc_utf8", "enc_dbcs" and "has_mbyte" flags.
+ * Fills mb_bytelen_tab[] and returns NULL when there are no problems.
+ * When there is something wrong: Returns an error message and doesn't change
+ * anything.
+ */
+ char_u *
+mb_init()
+{
+ int i;
+ int idx;
+ int n;
+ int enc_dbcs_new = 0;
+#if defined(USE_ICONV) && !defined(WIN3264) && !defined(WIN32UNIX) \
+ && !defined(MACOS)
+# define LEN_FROM_CONV
+ vimconv_T vimconv;
+ char_u *p;
+#endif
+
+ if (p_enc == NULL)
+ {
+ /* Just starting up: set the whole table to one's. */
+ for (i = 0; i < 256; ++i)
+ mb_bytelen_tab[i] = 1;
+ input_conv.vc_type = CONV_NONE;
+ input_conv.vc_factor = 1;
+ output_conv.vc_type = CONV_NONE;
+ return NULL;
+ }
+
+#ifdef WIN3264
+ if (p_enc[0] == 'c' && p_enc[1] == 'p' && VIM_ISDIGIT(p_enc[2]))
+ {
+ CPINFO cpinfo;
+
+ /* Get info on this codepage to find out what it is. */
+ if (GetCPInfo(atoi(p_enc + 2), &cpinfo) != 0)
+ {
+ if (cpinfo.MaxCharSize == 1)
+ {
+ /* some single-byte encoding */
+ enc_unicode = 0;
+ enc_utf8 = FALSE;
+ }
+ else if (cpinfo.MaxCharSize == 2
+ && (cpinfo.LeadByte[0] != 0 || cpinfo.LeadByte[1] != 0))
+ {
+ /* must be a DBCS encoding, check below */
+ enc_dbcs_new = atoi(p_enc + 2);
+ }
+ else
+ goto codepage_invalid;
+ }
+ else if (GetLastError() == ERROR_INVALID_PARAMETER)
+ {
+codepage_invalid:
+ return (char_u *)N_("E543: Not a valid codepage");
+ }
+ }
+#endif
+ else if (STRNCMP(p_enc, "8bit-", 5) == 0
+ || STRNCMP(p_enc, "iso-8859-", 9) == 0)
+ {
+ /* Accept any "8bit-" or "iso-8859-" name. */
+ enc_unicode = 0;
+ enc_utf8 = FALSE;
+ }
+ else if (STRNCMP(p_enc, "2byte-", 6) == 0)
+ {
+#ifdef WIN3264
+ /* Windows: accept only valid codepage numbers, check below. */
+ if (p_enc[6] != 'c' || p_enc[7] != 'p'
+ || (enc_dbcs_new = atoi(p_enc + 8)) == 0)
+ return e_invarg;
+#else
+ /* Unix: accept any "2byte-" name, assume current locale. */
+ enc_dbcs_new = DBCS_2BYTE;
+#endif
+ }
+ else if ((idx = enc_canon_search(p_enc)) >= 0)
+ {
+ i = enc_canon_table[idx].prop;
+ if (i & ENC_UNICODE)
+ {
+ /* Unicode */
+ enc_utf8 = TRUE;
+ if (i & (ENC_2BYTE | ENC_2WORD))
+ enc_unicode = 2;
+ else if (i & ENC_4BYTE)
+ enc_unicode = 4;
+ else
+ enc_unicode = 0;
+ }
+ else if (i & ENC_DBCS)
+ {
+ /* 2byte, handle below */
+ enc_dbcs_new = enc_canon_table[idx].codepage;
+ }
+ else
+ {
+ /* Must be 8-bit. */
+ enc_unicode = 0;
+ enc_utf8 = FALSE;
+ }
+ }
+ else /* Don't know what encoding this is, reject it. */
+ return e_invarg;
+
+ if (enc_dbcs_new != 0)
+ {
+#ifdef WIN3264
+ /* Check if the DBCS code page is OK. */
+ if (!IsValidCodePage(enc_dbcs_new))
+ goto codepage_invalid;
+#endif
+ enc_unicode = 0;
+ enc_utf8 = FALSE;
+ }
+ enc_dbcs = enc_dbcs_new;
+ has_mbyte = (enc_dbcs != 0 || enc_utf8);
+
+#ifdef WIN3264
+ enc_codepage = encname2codepage(p_enc);
+#endif
+
+ /*
+ * Set the function pointers.
+ */
+ if (enc_utf8)
+ {
+ mb_ptr2len_check = utfc_ptr2len_check;
+ mb_char2len = utf_char2len;
+ mb_char2bytes = utf_char2bytes;
+ mb_ptr2cells = utf_ptr2cells;
+ mb_char2cells = utf_char2cells;
+ mb_off2cells = utf_off2cells;
+ mb_ptr2char = utf_ptr2char;
+ mb_head_off = utf_head_off;
+ }
+ else if (enc_dbcs != 0)
+ {
+ mb_ptr2len_check = dbcs_ptr2len_check;
+ mb_char2len = dbcs_char2len;
+ mb_char2bytes = dbcs_char2bytes;
+ mb_ptr2cells = dbcs_ptr2cells;
+ mb_char2cells = dbcs_char2cells;
+ mb_off2cells = dbcs_off2cells;
+ mb_ptr2char = dbcs_ptr2char;
+ mb_head_off = dbcs_head_off;
+ }
+ else
+ {
+ mb_ptr2len_check = latin_ptr2len_check;
+ mb_char2len = latin_char2len;
+ mb_char2bytes = latin_char2bytes;
+ mb_ptr2cells = latin_ptr2cells;
+ mb_char2cells = latin_char2cells;
+ mb_off2cells = latin_off2cells;
+ mb_ptr2char = latin_ptr2char;
+ mb_head_off = latin_head_off;
+ }
+
+ /*
+ * Fill the mb_bytelen_tab[] for MB_BYTE2LEN().
+ */
+#ifdef LEN_FROM_CONV
+ /* When 'encoding' is different from the current locale mblen() won't
+ * work. Use conversion to "utf-8" instead. */
+ vimconv.vc_type = CONV_NONE;
+ if (enc_dbcs)
+ {
+ p = enc_locale();
+ if (p == NULL || STRCMP(p, p_enc) != 0)
+ {
+ convert_setup(&vimconv, p_enc, (char_u *)"utf-8");
+ vimconv.vc_fail = TRUE;
+ }
+ vim_free(p);
+ }
+#endif
+
+ for (i = 0; i < 256; ++i)
+ {
+ /* Our own function to reliably check the length of UTF-8 characters,
+ * independent of mblen(). */
+ if (enc_utf8)
+ n = utf8len_tab[i];
+ else if (enc_dbcs == 0)
+ n = 1;
+ else
+ {
+#if defined(WIN3264) || defined(WIN32UNIX)
+ /* enc_dbcs is set by setting 'fileencoding'. It becomes a Windows
+ * CodePage identifier, which we can pass directly in to Windows
+ * API */
+ n = IsDBCSLeadByteEx(enc_dbcs, (BYTE)i) ? 2 : 1;
+#else
+# ifdef MACOS
+ /*
+ * if mblen() is not available, character which MSB is turned on
+ * are treated as leading byte character. (note : This assumption
+ * is not always true.)
+ */
+ n = (i & 0x80) ? 2 : 1;
+# else
+ char buf[MB_MAXBYTES];
+# ifdef X_LOCALE
+# ifndef mblen
+# define mblen _Xmblen
+# endif
+# endif
+ if (i == NUL) /* just in case mblen() can't handle "" */
+ n = 1;
+ else
+ {
+ buf[0] = i;
+ buf[1] = 0;
+#ifdef LEN_FROM_CONV
+ if (vimconv.vc_type != CONV_NONE)
+ {
+ /*
+ * string_convert() should fail when converting the first
+ * byte of a double-byte character.
+ */
+ p = string_convert(&vimconv, (char_u *)buf, NULL);
+ if (p != NULL)
+ {
+ vim_free(p);
+ n = 1;
+ }
+ else
+ n = 2;
+ }
+ else
+#endif
+ {
+ /*
+ * mblen() should return -1 for invalid (means the leading
+ * multibyte) character. However there are some platforms
+ * where mblen() returns 0 for invalid character.
+ * Therefore, following condition includes 0.
+ */
+ if (mblen(buf, (size_t)1) <= 0)
+ n = 2;
+ else
+ n = 1;
+ }
+ }
+# endif
+#endif
+ }
+
+ mb_bytelen_tab[i] = n;
+ }
+
+#ifdef LEN_FROM_CONV
+ convert_setup(&vimconv, NULL, NULL);
+#endif
+
+ /* The cell width depends on the type of multi-byte characters. */
+ (void)init_chartab();
+
+ /* When enc_utf8 is set or reset, (de)allocate ScreenLinesUC[] */
+ screenalloc(FALSE);
+
+ /* When using Unicode, set default for 'fileencodings'. */
+ if (enc_utf8 && !option_was_set((char_u *)"fencs"))
+ set_string_option_direct((char_u *)"fencs", -1,
+ (char_u *)"ucs-bom,utf-8,latin1", OPT_FREE);
+#if defined(HAVE_BIND_TEXTDOMAIN_CODESET) && defined(FEAT_GETTEXT)
+ /* GNU gettext 0.10.37 supports this feature: set the codeset used for
+ * translated messages independently from the current locale. */
+ (void)bind_textdomain_codeset(VIMPACKAGE,
+ enc_utf8 ? "utf-8" : (char *)p_enc);
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /* Fire an autocommand to let people do custom font setup. This must be
+ * after Vim has been setup for the new encoding. */
+ apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf);
+#endif
+
+ return NULL;
+}
+
+/*
+ * Return the size of the BOM for the current buffer:
+ * 0 - no BOM
+ * 2 - UCS-2 or UTF-16 BOM
+ * 4 - UCS-4 BOM
+ * 3 - UTF-8 BOM
+ */
+ int
+bomb_size()
+{
+ int n = 0;
+
+ if (curbuf->b_p_bomb && !curbuf->b_p_bin)
+ {
+ if (*curbuf->b_p_fenc == NUL)
+ {
+ if (enc_utf8)
+ {
+ if (enc_unicode != 0)
+ n = enc_unicode;
+ else
+ n = 3;
+ }
+ }
+ else if (STRCMP(curbuf->b_p_fenc, "utf-8") == 0)
+ n = 3;
+ else if (STRNCMP(curbuf->b_p_fenc, "ucs-2", 5) == 0
+ || STRNCMP(curbuf->b_p_fenc, "utf-16", 6) == 0)
+ n = 2;
+ else if (STRNCMP(curbuf->b_p_fenc, "ucs-4", 5) == 0)
+ n = 4;
+ }
+ return n;
+}
+
+/*
+ * Get class of pointer:
+ * 0 for blank or NUL
+ * 1 for punctuation
+ * 2 for an (ASCII) word character
+ * >2 for other word characters
+ */
+ int
+mb_get_class(p)
+ char_u *p;
+{
+ if (MB_BYTE2LEN(p[0]) == 1)
+ {
+ if (p[0] == NUL || vim_iswhite(p[0]))
+ return 0;
+ if (vim_iswordc(p[0]))
+ return 2;
+ return 1;
+ }
+ if (enc_dbcs != 0 && p[0] != NUL && p[1] != NUL)
+ return dbcs_class(p[0], p[1]);
+ if (enc_utf8)
+ return utf_class(utf_ptr2char(p));
+ return 0;
+}
+
+/*
+ * Get class of a double-byte character. This always returns 3 or bigger.
+ * TODO: Should return 1 for punctuation.
+ */
+ int
+dbcs_class(lead, trail)
+ unsigned lead;
+ unsigned trail;
+{
+ switch (enc_dbcs)
+ {
+ /* please add classfy routine for your language in here */
+
+ case DBCS_JPNU: /* ? */
+ case DBCS_JPN:
+ {
+ /* JIS code classification */
+ unsigned char lb = lead;
+ unsigned char tb = trail;
+
+ /* convert process code to JIS */
+# if defined(WIN3264) || defined(WIN32UNIX) || defined(MACOS)
+ /* process code is SJIS */
+ if (lb <= 0x9f)
+ lb = (lb - 0x81) * 2 + 0x21;
+ else
+ lb = (lb - 0xc1) * 2 + 0x21;
+ if (tb <= 0x7e)
+ tb -= 0x1f;
+ else if (tb <= 0x9e)
+ tb -= 0x20;
+ else
+ {
+ tb -= 0x7e;
+ lb += 1;
+ }
+# else
+ /*
+ * XXX: Code page identification can not use with all
+ * system! So, some other encoding information
+ * will be needed.
+ * In japanese: SJIS,EUC,UNICODE,(JIS)
+ * Note that JIS-code system don't use as
+ * process code in most system because it uses
+ * escape sequences(JIS is context depend encoding).
+ */
+ /* assume process code is JAPANESE-EUC */
+ lb &= 0x7f;
+ tb &= 0x7f;
+# endif
+ /* exceptions */
+ switch (lb << 8 | tb)
+ {
+ case 0x2121: /* ZENKAKU space */
+ return 0;
+ case 0x2122: /* KU-TEN (Japanese comma) */
+ case 0x2123: /* TOU-TEN (Japanese period) */
+ case 0x2124: /* ZENKAKU comma */
+ case 0x2125: /* ZENKAKU period */
+ return 1;
+ case 0x213c: /* prolongedsound handled as KATAKANA */
+ return 13;
+ }
+ /* sieved by KU code */
+ switch (lb)
+ {
+ case 0x21:
+ case 0x22:
+ /* special symbols */
+ return 10;
+ case 0x23:
+ /* alpha-numeric */
+ return 11;
+ case 0x24:
+ /* hiragana */
+ return 12;
+ case 0x25:
+ /* katakana */
+ return 13;
+ case 0x26:
+ /* greek */
+ return 14;
+ case 0x27:
+ /* russian */
+ return 15;
+ case 0x28:
+ /* lines */
+ return 16;
+ default:
+ /* kanji */
+ return 17;
+ }
+ }
+
+ case DBCS_KORU: /* ? */
+ case DBCS_KOR:
+ {
+ /* KS code classification */
+ unsigned char c1 = lead;
+ unsigned char c2 = trail;
+
+ /*
+ * 20 : Hangul
+ * 21 : Hanja
+ * 22 : Symbols
+ * 23 : Alpha-numeric/Roman Letter (Full width)
+ * 24 : Hangul Letter(Alphabet)
+ * 25 : Roman Numeral/Greek Letter
+ * 26 : Box Drawings
+ * 27 : Unit Symbols
+ * 28 : Circled/Parenthesized Letter
+ * 29 : Hirigana/Katakana
+ * 30 : Cyrillic Letter
+ */
+
+ if (c1 >= 0xB0 && c1 <= 0xC8)
+ /* Hangul */
+ return 20;
+#if defined(WIN3264) || defined(WIN32UNIX)
+ else if (c1 <= 0xA0 || c2 <= 0xA0)
+ /* Extended Hangul Region : MS UHC(Unified Hangul Code) */
+ /* c1: 0x81-0xA0 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xFE
+ * c1: 0xA1-0xC6 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xA0
+ */
+ return 20;
+#endif
+
+ else if (c1 >= 0xCA && c1 <= 0xFD)
+ /* Hanja */
+ return 21;
+ else switch (c1)
+ {
+ case 0xA1:
+ case 0xA2:
+ /* Symbols */
+ return 22;
+ case 0xA3:
+ /* Alpha-numeric */
+ return 23;
+ case 0xA4:
+ /* Hangul Letter(Alphabet) */
+ return 24;
+ case 0xA5:
+ /* Roman Numeral/Greek Letter */
+ return 25;
+ case 0xA6:
+ /* Box Drawings */
+ return 26;
+ case 0xA7:
+ /* Unit Symbols */
+ return 27;
+ case 0xA8:
+ case 0xA9:
+ if (c2 <= 0xAF)
+ return 25; /* Roman Letter */
+ else if (c2 >= 0xF6)
+ return 22; /* Symbols */
+ else
+ /* Circled/Parenthesized Letter */
+ return 28;
+ case 0xAA:
+ case 0xAB:
+ /* Hirigana/Katakana */
+ return 29;
+ case 0xAC:
+ /* Cyrillic Letter */
+ return 30;
+ }
+ }
+ default:
+ break;
+ }
+ return 3;
+}
+
+/*
+ * mb_char2len() function pointer.
+ * Return length in bytes of character "c".
+ * Returns 1 for a single-byte character.
+ */
+/* ARGSUSED */
+ int
+latin_char2len(c)
+ int c;
+{
+ return 1;
+}
+
+ static int
+dbcs_char2len(c)
+ int c;
+{
+ if (c >= 0x100)
+ return 2;
+ return 1;
+}
+
+/*
+ * mb_char2bytes() function pointer.
+ * Convert a character to its bytes.
+ * Returns the length in bytes.
+ */
+ int
+latin_char2bytes(c, buf)
+ int c;
+ char_u *buf;
+{
+ buf[0] = c;
+ return 1;
+}
+
+ static int
+dbcs_char2bytes(c, buf)
+ int c;
+ char_u *buf;
+{
+ if (c >= 0x100)
+ {
+ buf[0] = (unsigned)c >> 8;
+ buf[1] = c;
+ return 2;
+ }
+ buf[0] = c;
+ return 1;
+}
+
+/*
+ * mb_ptr2len_check() function pointer.
+ * Get byte length of character at "*p" but stop at a NUL.
+ * For UTF-8 this includes following composing characters.
+ * Returns 0 when *p is NUL.
+ *
+ */
+ int
+latin_ptr2len_check(p)
+ char_u *p;
+{
+ return MB_BYTE2LEN(*p);
+}
+
+ static int
+dbcs_ptr2len_check(p)
+ char_u *p;
+{
+ int len;
+
+ /* Check if second byte is not missing. */
+ len = MB_BYTE2LEN(*p);
+ if (len == 2 && p[1] == NUL)
+ len = 1;
+ return len;
+}
+
+struct interval
+{
+ unsigned short first;
+ unsigned short last;
+};
+static int intable __ARGS((struct interval *table, size_t size, int c));
+
+/*
+ * Return TRUE if "c" is in "table[size / sizeof(struct interval)]".
+ */
+ static int
+intable(table, size, c)
+ struct interval *table;
+ size_t size;
+ int c;
+{
+ int mid, bot, top;
+
+ /* first quick check for Latin1 etc. characters */
+ if (c < table[0].first)
+ return FALSE;
+
+ /* binary search in table */
+ bot = 0;
+ top = size / sizeof(struct interval) - 1;
+ while (top >= bot)
+ {
+ mid = (bot + top) / 2;
+ if (table[mid].last < c)
+ bot = mid + 1;
+ else if (table[mid].first > c)
+ top = mid - 1;
+ else
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * For UTF-8 character "c" return 2 for a double-width character, 1 for others.
+ * Returns 4 or 6 for an unprintable character.
+ * Is only correct for characters >= 0x80.
+ * When p_ambw is "double", return 2 for a character with East Asian Width
+ * class 'A'(mbiguous).
+ */
+ int
+utf_char2cells(c)
+ int c;
+{
+ /* sorted list of non-overlapping intervals of East Asian Ambiguous
+ * characters, generated with:
+ * "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
+ static struct interval ambiguous[] = {
+ {0x00A1, 0x00A1}, {0x00A4, 0x00A4}, {0x00A7, 0x00A8},
+ {0x00AA, 0x00AA}, {0x00AE, 0x00AE}, {0x00B0, 0x00B4},
+ {0x00B6, 0x00BA}, {0x00BC, 0x00BF}, {0x00C6, 0x00C6},
+ {0x00D0, 0x00D0}, {0x00D7, 0x00D8}, {0x00DE, 0x00E1},
+ {0x00E6, 0x00E6}, {0x00E8, 0x00EA}, {0x00EC, 0x00ED},
+ {0x00F0, 0x00F0}, {0x00F2, 0x00F3}, {0x00F7, 0x00FA},
+ {0x00FC, 0x00FC}, {0x00FE, 0x00FE}, {0x0101, 0x0101},
+ {0x0111, 0x0111}, {0x0113, 0x0113}, {0x011B, 0x011B},
+ {0x0126, 0x0127}, {0x012B, 0x012B}, {0x0131, 0x0133},
+ {0x0138, 0x0138}, {0x013F, 0x0142}, {0x0144, 0x0144},
+ {0x0148, 0x014B}, {0x014D, 0x014D}, {0x0152, 0x0153},
+ {0x0166, 0x0167}, {0x016B, 0x016B}, {0x01CE, 0x01CE},
+ {0x01D0, 0x01D0}, {0x01D2, 0x01D2}, {0x01D4, 0x01D4},
+ {0x01D6, 0x01D6}, {0x01D8, 0x01D8}, {0x01DA, 0x01DA},
+ {0x01DC, 0x01DC}, {0x0251, 0x0251}, {0x0261, 0x0261},
+ {0x02C4, 0x02C4}, {0x02C7, 0x02C7}, {0x02C9, 0x02CB},
+ {0x02CD, 0x02CD}, {0x02D0, 0x02D0}, {0x02D8, 0x02DB},
+ {0x02DD, 0x02DD}, {0x02DF, 0x02DF}, {0x0391, 0x03A1},
+ {0x03A3, 0x03A9}, {0x03B1, 0x03C1}, {0x03C3, 0x03C9},
+ {0x0401, 0x0401}, {0x0410, 0x044F}, {0x0451, 0x0451},
+ {0x2010, 0x2010}, {0x2013, 0x2016}, {0x2018, 0x2019},
+ {0x201C, 0x201D}, {0x2020, 0x2022}, {0x2024, 0x2027},
+ {0x2030, 0x2030}, {0x2032, 0x2033}, {0x2035, 0x2035},
+ {0x203B, 0x203B}, {0x203E, 0x203E}, {0x2074, 0x2074},
+ {0x207F, 0x207F}, {0x2081, 0x2084}, {0x20AC, 0x20AC},
+ {0x2103, 0x2103}, {0x2105, 0x2105}, {0x2109, 0x2109},
+ {0x2113, 0x2113}, {0x2116, 0x2116}, {0x2121, 0x2122},
+ {0x2126, 0x2126}, {0x212B, 0x212B}, {0x2153, 0x2154},
+ {0x215B, 0x215E}, {0x2160, 0x216B}, {0x2170, 0x2179},
+ {0x2190, 0x2199}, {0x21B8, 0x21B9}, {0x21D2, 0x21D2},
+ {0x21D4, 0x21D4}, {0x21E7, 0x21E7}, {0x2200, 0x2200},
+ {0x2202, 0x2203}, {0x2207, 0x2208}, {0x220B, 0x220B},
+ {0x220F, 0x220F}, {0x2211, 0x2211}, {0x2215, 0x2215},
+ {0x221A, 0x221A}, {0x221D, 0x2220}, {0x2223, 0x2223},
+ {0x2225, 0x2225}, {0x2227, 0x222C}, {0x222E, 0x222E},
+ {0x2234, 0x2237}, {0x223C, 0x223D}, {0x2248, 0x2248},
+ {0x224C, 0x224C}, {0x2252, 0x2252}, {0x2260, 0x2261},
+ {0x2264, 0x2267}, {0x226A, 0x226B}, {0x226E, 0x226F},
+ {0x2282, 0x2283}, {0x2286, 0x2287}, {0x2295, 0x2295},
+ {0x2299, 0x2299}, {0x22A5, 0x22A5}, {0x22BF, 0x22BF},
+ {0x2312, 0x2312}, {0x2460, 0x24E9}, {0x24EB, 0x254B},
+ {0x2550, 0x2573}, {0x2580, 0x258F}, {0x2592, 0x2595},
+ {0x25A0, 0x25A1}, {0x25A3, 0x25A9}, {0x25B2, 0x25B3},
+ {0x25B6, 0x25B7}, {0x25BC, 0x25BD}, {0x25C0, 0x25C1},
+ {0x25C6, 0x25C8}, {0x25CB, 0x25CB}, {0x25CE, 0x25D1},
+ {0x25E2, 0x25E5}, {0x25EF, 0x25EF}, {0x2605, 0x2606},
+ {0x2609, 0x2609}, {0x260E, 0x260F}, {0x2614, 0x2615},
+ {0x261C, 0x261C}, {0x261E, 0x261E}, {0x2640, 0x2640},
+ {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665},
+ {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F},
+ {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF},
+ {0xFFFD, 0xFFFD}, /* {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD} */
+ };
+
+ if (c >= 0x100)
+ {
+#ifdef USE_WCHAR_FUNCTIONS
+ /*
+ * Assume the library function wcwidth() works better than our own
+ * stuff. It should return 1 for ambiguous width chars!
+ */
+ int n = wcwidth(c);
+
+ if (n < 0)
+ return 6; /* unprintable, displays <xxxx> */
+ if (n > 1)
+ return n;
+#else
+ if (!utf_printable(c))
+ return 6; /* unprintable, displays <xxxx> */
+ if (c >= 0x1100
+ && (c <= 0x115f /* Hangul Jamo */
+ || c == 0x2329
+ || c == 0x232a
+ || (c >= 0x2e80 && c <= 0xa4cf
+ && c != 0x303f) /* CJK ... Yi */
+ || (c >= 0xac00 && c <= 0xd7a3) /* Hangul Syllables */
+ || (c >= 0xf900 && c <= 0xfaff) /* CJK Compatibility
+ Ideographs */
+ || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
+ || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
+ || (c >= 0xffe0 && c <= 0xffe6)
+ || (c >= 0x20000 && c <= 0x2fffd)
+ || (c >= 0x30000 && c <= 0x3fffd)))
+ return 2;
+#endif
+ }
+
+ /* Characters below 0x100 are influenced by 'isprint' option */
+ else if (c >= 0x80 && !vim_isprintc(c))
+ return 4; /* unprintable, displays <xx> */
+
+ if (c >= 0x80 && *p_ambw == 'd' && intable(ambiguous, sizeof(ambiguous), c))
+ return 2;
+
+ return 1;
+}
+
+/*
+ * mb_ptr2cells() function pointer.
+ * Return the number of display cells character at "*p" occupies.
+ * This doesn't take care of unprintable characters, use ptr2cells() for that.
+ */
+/*ARGSUSED*/
+ int
+latin_ptr2cells(p)
+ char_u *p;
+{
+ return 1;
+}
+
+ int
+utf_ptr2cells(p)
+ char_u *p;
+{
+ int c;
+
+ /* Need to convert to a wide character. */
+ if (*p >= 0x80)
+ {
+ c = utf_ptr2char(p);
+ /* An illegal byte is displayed as <xx>. */
+ if (utf_ptr2len_check(p) == 1 || c == NUL)
+ return 4;
+ /* If the char is ASCII it must be an overlong sequence. */
+ if (c < 0x80)
+ return char2cells(c);
+ return utf_char2cells(c);
+ }
+ return 1;
+}
+
+ int
+dbcs_ptr2cells(p)
+ char_u *p;
+{
+ /* Number of cells is equal to number of bytes, except for euc-jp when
+ * the first byte is 0x8e. */
+ if (enc_dbcs == DBCS_JPNU && *p == 0x8e)
+ return 1;
+ return MB_BYTE2LEN(*p);
+}
+
+/*
+ * mb_char2cells() function pointer.
+ * Return the number of display cells character "c" occupies.
+ * Only takes care of multi-byte chars, not "^C" and such.
+ */
+/*ARGSUSED*/
+ int
+latin_char2cells(c)
+ int c;
+{
+ return 1;
+}
+
+ static int
+dbcs_char2cells(c)
+ int c;
+{
+ /* Number of cells is equal to number of bytes, except for euc-jp when
+ * the first byte is 0x8e. */
+ if (enc_dbcs == DBCS_JPNU && ((unsigned)c >> 8) == 0x8e)
+ return 1;
+ /* use the first byte */
+ return MB_BYTE2LEN((unsigned)c >> 8);
+}
+
+/*
+ * mb_off2cells() function pointer.
+ * Return number of display cells for char at ScreenLines[off].
+ * Caller must make sure "off" and "off + 1" are valid!
+ */
+/*ARGSUSED*/
+ int
+latin_off2cells(off)
+ unsigned off;
+{
+ return 1;
+}
+
+ int
+dbcs_off2cells(off)
+ unsigned off;
+{
+ /* Number of cells is equal to number of bytes, except for euc-jp when
+ * the first byte is 0x8e. */
+ if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
+ return 1;
+ return MB_BYTE2LEN(ScreenLines[off]);
+}
+
+ int
+utf_off2cells(off)
+ unsigned off;
+{
+ return ScreenLines[off + 1] == 0 ? 2 : 1;
+}
+
+/*
+ * mb_ptr2char() function pointer.
+ * Convert a byte sequence into a character.
+ */
+ int
+latin_ptr2char(p)
+ char_u *p;
+{
+ return *p;
+}
+
+ static int
+dbcs_ptr2char(p)
+ char_u *p;
+{
+ if (MB_BYTE2LEN(*p) > 1 && p[1] != NUL)
+ return (p[0] << 8) + p[1];
+ return *p;
+}
+
+/*
+ * Convert a UTF-8 byte sequence to a wide character.
+ * If the sequence is illegal or truncated by a NUL the first byte is
+ * returned.
+ * Does not include composing characters, of course.
+ */
+ int
+utf_ptr2char(p)
+ char_u *p;
+{
+ int len;
+
+ if (p[0] < 0x80) /* be quick for ASCII */
+ return p[0];
+
+ len = utf8len_tab[p[0]];
+ if ((p[1] & 0xc0) == 0x80)
+ {
+ if (len == 2)
+ return ((p[0] & 0x1f) << 6) + (p[1] & 0x3f);
+ if ((p[2] & 0xc0) == 0x80)
+ {
+ if (len == 3)
+ return ((p[0] & 0x0f) << 12) + ((p[1] & 0x3f) << 6)
+ + (p[2] & 0x3f);
+ if ((p[3] & 0xc0) == 0x80)
+ {
+ if (len == 4)
+ return ((p[0] & 0x07) << 18) + ((p[1] & 0x3f) << 12)
+ + ((p[2] & 0x3f) << 6) + (p[3] & 0x3f);
+ if ((p[4] & 0xc0) == 0x80)
+ {
+ if (len == 5)
+ return ((p[0] & 0x03) << 24) + ((p[1] & 0x3f) << 18)
+ + ((p[2] & 0x3f) << 12) + ((p[3] & 0x3f) << 6)
+ + (p[4] & 0x3f);
+ if ((p[5] & 0xc0) == 0x80 && len == 6)
+ return ((p[0] & 0x01) << 30) + ((p[1] & 0x3f) << 24)
+ + ((p[2] & 0x3f) << 18) + ((p[3] & 0x3f) << 12)
+ + ((p[4] & 0x3f) << 6) + (p[5] & 0x3f);
+ }
+ }
+ }
+ }
+ /* Illegal value, just return the first byte */
+ return p[0];
+}
+
+/*
+ * Get character at **pp and advance *pp to the next character.
+ * Note: composing characters are skipped!
+ */
+ int
+mb_ptr2char_adv(pp)
+ char_u **pp;
+{
+ int c;
+
+ c = (*mb_ptr2char)(*pp);
+ *pp += (*mb_ptr2len_check)(*pp);
+ return c;
+}
+
+#if defined(FEAT_ARABIC) || defined(PROTO)
+/*
+ * Check whether we are dealing with Arabic combining characters.
+ * Note: these are NOT really composing characters!
+ */
+ int
+arabic_combine(one, two)
+ int one; /* first character */
+ int two; /* character just after "one" */
+{
+ if (one == a_LAM)
+ return arabic_maycombine(two);
+ return FALSE;
+}
+
+/*
+ * Check whether we are dealing with a character that could be regarded as an
+ * Arabic combining character, need to check the character before this.
+ */
+ int
+arabic_maycombine(two)
+ int two;
+{
+ if (p_arshape && !p_tbidi)
+ return (two == a_ALEF_MADDA
+ || two == a_ALEF_HAMZA_ABOVE
+ || two == a_ALEF_HAMZA_BELOW
+ || two == a_ALEF);
+ return FALSE;
+}
+
+/*
+ * Check if the character pointed to by "p2" is a composing character when it
+ * comes after "p1". For Arabic sometimes "ab" is replaced with "c", which
+ * behaves like a composing character.
+ */
+ int
+utf_composinglike(p1, p2)
+ char_u *p1;
+ char_u *p2;
+{
+ int c2;
+
+ c2 = utf_ptr2char(p2);
+ if (utf_iscomposing(c2))
+ return TRUE;
+ if (!arabic_maycombine(c2))
+ return FALSE;
+ return arabic_combine(utf_ptr2char(p1), c2);
+}
+#endif
+
+/*
+ * Convert a UTF-8 byte string to a wide chararacter. Also get up to two
+ * composing characters.
+ */
+ int
+utfc_ptr2char(p, p1, p2)
+ char_u *p;
+ int *p1; /* return: first composing char or 0 */
+ int *p2; /* return: second composing char or 0 */
+{
+ int len;
+ int c;
+ int cc;
+
+ c = utf_ptr2char(p);
+ len = utf_ptr2len_check(p);
+ /* Only accept a composing char when the first char isn't illegal. */
+ if ((len > 1 || *p < 0x80)
+ && p[len] >= 0x80
+ && UTF_COMPOSINGLIKE(p, p + len))
+ {
+ *p1 = utf_ptr2char(p + len);
+ len += utf_ptr2len_check(p + len);
+ if (p[len] >= 0x80 && utf_iscomposing(cc = utf_ptr2char(p + len)))
+ *p2 = cc;
+ else
+ *p2 = 0;
+ }
+ else
+ {
+ *p1 = 0;
+ *p2 = 0;
+ }
+ return c;
+}
+
+/*
+ * Convert a UTF-8 byte string to a wide chararacter. Also get up to two
+ * composing characters. Use no more than p[maxlen].
+ */
+ int
+utfc_ptr2char_len(p, p1, p2, maxlen)
+ char_u *p;
+ int *p1; /* return: first composing char or 0 */
+ int *p2; /* return: second composing char or 0 */
+ int maxlen;
+{
+ int len;
+ int c;
+ int cc;
+
+ c = utf_ptr2char(p);
+ len = utf_ptr2len_check_len(p, maxlen);
+ /* Only accept a composing char when the first char isn't illegal. */
+ if ((len > 1 || *p < 0x80)
+ && len < maxlen
+ && p[len] >= 0x80
+ && UTF_COMPOSINGLIKE(p, p + len))
+ {
+ *p1 = utf_ptr2char(p + len);
+ len += utf_ptr2len_check_len(p + len, maxlen - len);
+ if (len < maxlen
+ && p[len] >= 0x80
+ && utf_iscomposing(cc = utf_ptr2char(p + len)))
+ *p2 = cc;
+ else
+ *p2 = 0;
+ }
+ else
+ {
+ *p1 = 0;
+ *p2 = 0;
+ }
+ return c;
+}
+
+/*
+ * Convert the character at screen position "off" to a sequence of bytes.
+ * Includes the composing characters.
+ * "buf" must at least have the length MB_MAXBYTES.
+ * Returns the produced number of bytes.
+ */
+ int
+utfc_char2bytes(off, buf)
+ int off;
+ char_u *buf;
+{
+ int len;
+
+ len = utf_char2bytes(ScreenLinesUC[off], buf);
+ if (ScreenLinesC1[off] != 0)
+ {
+ len += utf_char2bytes(ScreenLinesC1[off], buf + len);
+ if (ScreenLinesC2[off] != 0)
+ len += utf_char2bytes(ScreenLinesC2[off], buf + len);
+ }
+ return len;
+}
+
+/*
+ * Get the length of a UTF-8 byte sequence, not including any following
+ * composing characters.
+ * Returns 0 for "".
+ * Returns 1 for an illegal byte sequence.
+ */
+ int
+utf_ptr2len_check(p)
+ char_u *p;
+{
+ int len;
+ int i;
+
+ if (*p == NUL)
+ return 0;
+ len = utf8len_tab[*p];
+ for (i = 1; i < len; ++i)
+ if ((p[i] & 0xc0) != 0x80)
+ return 1;
+ return len;
+}
+
+/*
+ * Return length of UTF-8 character, obtained from the first byte.
+ * "b" must be between 0 and 255!
+ */
+ int
+utf_byte2len(b)
+ int b;
+{
+ return utf8len_tab[b];
+}
+
+/*
+ * Get the length of UTF-8 byte sequence "p[size]". Does not include any
+ * following composing characters.
+ * Returns 1 for "".
+ * Returns 1 for an illegal byte sequence.
+ * Returns number > "size" for an incomplete byte sequence.
+ */
+ int
+utf_ptr2len_check_len(p, size)
+ char_u *p;
+ int size;
+{
+ int len;
+ int i;
+
+ if (*p == NUL)
+ return 1;
+ len = utf8len_tab[*p];
+ if (len > size)
+ return len; /* incomplete byte sequence. */
+ for (i = 1; i < len; ++i)
+ if ((p[i] & 0xc0) != 0x80)
+ return 1;
+ return len;
+}
+
+/*
+ * Return the number of bytes the UTF-8 encoding of the character at "p" takes.
+ * This includes following composing characters.
+ */
+ int
+utfc_ptr2len_check(p)
+ char_u *p;
+{
+ int len;
+#ifdef FEAT_ARABIC
+ int prevlen;
+#endif
+
+ if (*p == NUL)
+ return 0;
+ if (p[0] < 0x80 && p[1] < 0x80) /* be quick for ASCII */
+ return 1;
+
+ /* Skip over first UTF-8 char, stopping at a NUL byte. */
+ len = utf_ptr2len_check(p);
+
+ /* Check for illegal byte. */
+ if (len == 1 && p[0] >= 0x80)
+ return 1;
+
+ /*
+ * Check for composing characters. We can handle only the first two, but
+ * skip all of them (otherwise the cursor would get stuck).
+ */
+#ifdef FEAT_ARABIC
+ prevlen = 0;
+#endif
+ for (;;)
+ {
+ if (p[len] < 0x80 || !UTF_COMPOSINGLIKE(p + prevlen, p + len))
+ return len;
+
+ /* Skip over composing char */
+#ifdef FEAT_ARABIC
+ prevlen = len;
+#endif
+ len += utf_ptr2len_check(p + len);
+ }
+}
+
+/*
+ * Return the number of bytes the UTF-8 encoding of the character at "p[size]"
+ * takes. This includes following composing characters.
+ * Returns 1 for an illegal char or an incomplete byte sequence.
+ */
+ int
+utfc_ptr2len_check_len(p, size)
+ char_u *p;
+ int size;
+{
+ int len;
+#ifdef FEAT_ARABIC
+ int prevlen;
+#endif
+
+ if (*p == NUL)
+ return 0;
+ if (p[0] < 0x80 && (size == 1 || p[1] < 0x80)) /* be quick for ASCII */
+ return 1;
+
+ /* Skip over first UTF-8 char, stopping at a NUL byte. */
+ len = utf_ptr2len_check_len(p, size);
+
+ /* Check for illegal byte and incomplete byte sequence. */
+ if ((len == 1 && p[0] >= 0x80) || len > size)
+ return 1;
+
+ /*
+ * Check for composing characters. We can handle only the first two, but
+ * skip all of them (otherwise the cursor would get stuck).
+ */
+#ifdef FEAT_ARABIC
+ prevlen = 0;
+#endif
+ while (len < size)
+ {
+ if (p[len] < 0x80 || !UTF_COMPOSINGLIKE(p + prevlen, p + len))
+ break;
+
+ /* Skip over composing char */
+#ifdef FEAT_ARABIC
+ prevlen = len;
+#endif
+ len += utf_ptr2len_check_len(p + len, size - len);
+ }
+ return len;
+}
+
+/*
+ * Return the number of bytes the UTF-8 encoding of character "c" takes.
+ * This does not include composing characters.
+ */
+ int
+utf_char2len(c)
+ int c;
+{
+ if (c < 0x80)
+ return 1;
+ if (c < 0x800)
+ return 2;
+ if (c < 0x10000)
+ return 3;
+ if (c < 0x200000)
+ return 4;
+ if (c < 0x4000000)
+ return 5;
+ return 6;
+}
+
+/*
+ * Convert Unicode character "c" to UTF-8 string in "buf[]".
+ * Returns the number of bytes.
+ * This does not include composing characters.
+ */
+ int
+utf_char2bytes(c, buf)
+ int c;
+ char_u *buf;
+{
+ if (c < 0x80) /* 7 bits */
+ {
+ buf[0] = c;
+ return 1;
+ }
+ if (c < 0x800) /* 11 bits */
+ {
+ buf[0] = 0xc0 + ((unsigned)c >> 6);
+ buf[1] = 0x80 + (c & 0x3f);
+ return 2;
+ }
+ if (c < 0x10000) /* 16 bits */
+ {
+ buf[0] = 0xe0 + ((unsigned)c >> 12);
+ buf[1] = 0x80 + (((unsigned)c >> 6) & 0x3f);
+ buf[2] = 0x80 + (c & 0x3f);
+ return 3;
+ }
+ if (c < 0x200000) /* 21 bits */
+ {
+ buf[0] = 0xf0 + ((unsigned)c >> 18);
+ buf[1] = 0x80 + (((unsigned)c >> 12) & 0x3f);
+ buf[2] = 0x80 + (((unsigned)c >> 6) & 0x3f);
+ buf[3] = 0x80 + (c & 0x3f);
+ return 4;
+ }
+ if (c < 0x4000000) /* 26 bits */
+ {
+ buf[0] = 0xf8 + ((unsigned)c >> 24);
+ buf[1] = 0x80 + (((unsigned)c >> 18) & 0x3f);
+ buf[2] = 0x80 + (((unsigned)c >> 12) & 0x3f);
+ buf[3] = 0x80 + (((unsigned)c >> 6) & 0x3f);
+ buf[4] = 0x80 + (c & 0x3f);
+ return 5;
+ }
+ /* 31 bits */
+ buf[0] = 0xfc + ((unsigned)c >> 30);
+ buf[1] = 0x80 + (((unsigned)c >> 24) & 0x3f);
+ buf[2] = 0x80 + (((unsigned)c >> 18) & 0x3f);
+ buf[3] = 0x80 + (((unsigned)c >> 12) & 0x3f);
+ buf[4] = 0x80 + (((unsigned)c >> 6) & 0x3f);
+ buf[5] = 0x80 + (c & 0x3f);
+ return 6;
+}
+
+/*
+ * Return TRUE if "c" is a composing UTF-8 character. This means it will be
+ * drawn on top of the preceding character.
+ * Based on code from Markus Kuhn.
+ */
+ int
+utf_iscomposing(c)
+ int c;
+{
+ /* sorted list of non-overlapping intervals */
+ static struct interval combining[] =
+ {
+ {0x0300, 0x034f}, {0x0360, 0x036f}, {0x0483, 0x0486}, {0x0488, 0x0489},
+ {0x0591, 0x05a1}, {0x05a3, 0x05b9}, {0x05bb, 0x05bd}, {0x05bf, 0x05bf},
+ {0x05c1, 0x05c2}, {0x05c4, 0x05c4}, {0x0610, 0x0615}, {0x064b, 0x0658},
+ {0x0670, 0x0670}, {0x06d6, 0x06dc}, {0x06de, 0x06e4}, {0x06e7, 0x06e8},
+ {0x06ea, 0x06ed}, {0x0711, 0x0711}, {0x0730, 0x074a}, {0x07a6, 0x07b0},
+ {0x0901, 0x0903}, {0x093c, 0x093c}, {0x093e, 0x094d}, {0x0951, 0x0954},
+ {0x0962, 0x0963}, {0x0981, 0x0983}, {0x09bc, 0x09bc}, {0x09be, 0x09c4},
+ {0x09c7, 0x09c8}, {0x09cb, 0x09cd}, {0x09d7, 0x09d7}, {0x09e2, 0x09e3},
+ {0x0a01, 0x0a03}, {0x0a3c, 0x0a3c}, {0x0a3e, 0x0a42}, {0x0a47, 0x0a48},
+ {0x0a4b, 0x0a4d}, {0x0a70, 0x0a71}, {0x0a81, 0x0a83}, {0x0abc, 0x0abc},
+ {0x0abe, 0x0ac5}, {0x0ac7, 0x0ac9}, {0x0acb, 0x0acd}, {0x0ae2, 0x0ae3},
+ {0x0b01, 0x0b03}, {0x0b3c, 0x0b3c}, {0x0b3e, 0x0b43}, {0x0b47, 0x0b48},
+ {0x0b4b, 0x0b4d}, {0x0b56, 0x0b57}, {0x0b82, 0x0b82}, {0x0bbe, 0x0bc2},
+ {0x0bc6, 0x0bc8}, {0x0bca, 0x0bcd}, {0x0bd7, 0x0bd7}, {0x0c01, 0x0c03},
+ {0x0c3e, 0x0c44}, {0x0c46, 0x0c48}, {0x0c4a, 0x0c4d}, {0x0c55, 0x0c56},
+ {0x0c82, 0x0c83}, {0x0cbc, 0x0cbc}, {0x0cbe, 0x0cc4}, {0x0cc6, 0x0cc8},
+ {0x0cca, 0x0ccd}, {0x0cd5, 0x0cd6}, {0x0d02, 0x0d03}, {0x0d3e, 0x0d43},
+ {0x0d46, 0x0d48}, {0x0d4a, 0x0d4d}, {0x0d57, 0x0d57}, {0x0d82, 0x0d83},
+ {0x0dca, 0x0dca}, {0x0dcf, 0x0dd4}, {0x0dd6, 0x0dd6}, {0x0dd8, 0x0ddf},
+ {0x0df2, 0x0df3}, {0x0e31, 0x0e31}, {0x0e34, 0x0e3a}, {0x0e47, 0x0e4e},
+ {0x0eb1, 0x0eb1}, {0x0eb4, 0x0eb9}, {0x0ebb, 0x0ebc}, {0x0ec8, 0x0ecd},
+ {0x0f18, 0x0f19}, {0x0f35, 0x0f35}, {0x0f37, 0x0f37}, {0x0f39, 0x0f39},
+ {0x0f3e, 0x0f3f}, {0x0f71, 0x0f84}, {0x0f86, 0x0f87}, {0x0f90, 0x0f97},
+ {0x0f99, 0x0fbc}, {0x0fc6, 0x0fc6}, {0x102c, 0x1032}, {0x1036, 0x1039},
+ {0x1056, 0x1059}, {0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753},
+ {0x1772, 0x1773}, {0x17b6, 0x17d3}, {0x17dd, 0x17dd}, {0x180b, 0x180d},
+ {0x18a9, 0x18a9}, {0x1920, 0x192b}, {0x1930, 0x193b}, {0x20d0, 0x20ea},
+ {0x302a, 0x302f}, {0x3099, 0x309a}, {0xfb1e, 0xfb1e}, {0xfe00, 0xfe0f},
+ {0xfe20, 0xfe23},
+ };
+
+ return intable(combining, sizeof(combining), c);
+}
+
+/*
+ * Return TRUE for characters that can be displayed in a normal way.
+ * Only for characters of 0x100 and above!
+ */
+ int
+utf_printable(c)
+ int c;
+{
+#ifdef USE_WCHAR_FUNCTIONS
+ /*
+ * Assume the iswprint() library function works better than our own stuff.
+ */
+ return iswprint(c);
+#else
+ /* Sorted list of non-overlapping intervals.
+ * 0xd800-0xdfff is reserved for UTF-16, actually illegal. */
+ static struct interval nonprint[] =
+ {
+ {0x070f, 0x070f}, {0x180b, 0x180e}, {0x200b, 0x200f}, {0x202a, 0x202e},
+ {0x206a, 0x206f}, {0xd800, 0xdfff}, {0xfeff, 0xfeff}, {0xfff9, 0xfffb},
+ {0xfffe, 0xffff}
+ };
+
+ return !intable(nonprint, sizeof(nonprint), c);
+#endif
+}
+
+/*
+ * Get class of a Unicode character.
+ * 0: white space
+ * 1: punctuation
+ * 2 or bigger: some class of word character.
+ */
+ int
+utf_class(c)
+ int c;
+{
+ /* sorted list of non-overlapping intervals */
+ static struct clinterval
+ {
+ unsigned short first;
+ unsigned short last;
+ unsigned short class;
+ } classes[] =
+ {
+ {0x037e, 0x037e, 1}, /* Greek question mark */
+ {0x0387, 0x0387, 1}, /* Greek ano teleia */
+ {0x055a, 0x055f, 1}, /* Armenian punctuation */
+ {0x0589, 0x0589, 1}, /* Armenian full stop */
+ {0x05be, 0x05be, 1},
+ {0x05c0, 0x05c0, 1},
+ {0x05c3, 0x05c3, 1},
+ {0x05f3, 0x05f4, 1},
+ {0x060c, 0x060c, 1},
+ {0x061b, 0x061b, 1},
+ {0x061f, 0x061f, 1},
+ {0x066a, 0x066d, 1},
+ {0x06d4, 0x06d4, 1},
+ {0x0700, 0x070d, 1}, /* Syriac punctuation */
+ {0x0964, 0x0965, 1},
+ {0x0970, 0x0970, 1},
+ {0x0df4, 0x0df4, 1},
+ {0x0e4f, 0x0e4f, 1},
+ {0x0e5a, 0x0e5b, 1},
+ {0x0f04, 0x0f12, 1},
+ {0x0f3a, 0x0f3d, 1},
+ {0x0f85, 0x0f85, 1},
+ {0x104a, 0x104f, 1}, /* Myanmar punctuation */
+ {0x10fb, 0x10fb, 1}, /* Georgian punctuation */
+ {0x1361, 0x1368, 1}, /* Ethiopic punctuation */
+ {0x166d, 0x166e, 1}, /* Canadian Syl. punctuation */
+ {0x1680, 0x1680, 0},
+ {0x169b, 0x169c, 1},
+ {0x16eb, 0x16ed, 1},
+ {0x1735, 0x1736, 1},
+ {0x17d4, 0x17dc, 1}, /* Khmer punctuation */
+ {0x1800, 0x180a, 1}, /* Mongolian punctuation */
+ {0x2000, 0x200b, 0}, /* spaces */
+ {0x200c, 0x2027, 1}, /* punctuation and symbols */
+ {0x2028, 0x2029, 0},
+ {0x202a, 0x202e, 1}, /* punctuation and symbols */
+ {0x202f, 0x202f, 0},
+ {0x2030, 0x205e, 1}, /* punctuation and symbols */
+ {0x205f, 0x205f, 0},
+ {0x2060, 0x27ff, 1}, /* punctuation and symbols */
+ {0x2070, 0x207f, 0x2070}, /* superscript */
+ {0x2080, 0x208f, 0x2080}, /* subscript */
+ {0x2983, 0x2998, 1},
+ {0x29d8, 0x29db, 1},
+ {0x29fc, 0x29fd, 1},
+ {0x3000, 0x3000, 0}, /* ideographic space */
+ {0x3001, 0x3020, 1}, /* ideographic punctuation */
+ {0x3030, 0x3030, 1},
+ {0x303d, 0x303d, 1},
+ {0x3040, 0x309f, 0x3040}, /* Hiragana */
+ {0x30a0, 0x30ff, 0x30a0}, /* Katakana */
+ {0x3300, 0x9fff, 0x4e00}, /* CJK Ideographs */
+ {0xac00, 0xd7a3, 0xac00}, /* Hangul Syllables */
+ {0xf900, 0xfaff, 0x4e00}, /* CJK Ideographs */
+ {0xfd3e, 0xfd3f, 1},
+ {0xfe30, 0xfe6b, 1}, /* punctuation forms */
+ {0xff00, 0xff0f, 1}, /* half/fullwidth ASCII */
+ {0xff1a, 0xff20, 1}, /* half/fullwidth ASCII */
+ {0xff3b, 0xff40, 1}, /* half/fullwidth ASCII */
+ {0xff5b, 0xff65, 1}, /* half/fullwidth ASCII */
+ };
+ int bot = 0;
+ int top = sizeof(classes) / sizeof(struct clinterval) - 1;
+ int mid;
+
+ /* First quick check for Latin1 characters, use 'iskeyword'. */
+ if (c < 0x100)
+ {
+ if (c == ' ' || c == '\t' || c == NUL)
+ return 0; /* blank */
+ if (vim_iswordc(c))
+ return 2; /* word character */
+ return 1; /* punctuation */
+ }
+
+ /* binary search in table */
+ while (top >= bot)
+ {
+ mid = (bot + top) / 2;
+ if (classes[mid].last < c)
+ bot = mid + 1;
+ else if (classes[mid].first > c)
+ top = mid - 1;
+ else
+ return (int)classes[mid].class;
+ }
+
+ /* most other characters are "word" characters */
+ return 2;
+}
+
+/*
+ * Code for Unicode case-dependent operations. Based on notes in
+ * http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
+ * This code uses simple case folding, not full case folding.
+ */
+
+/*
+ * The following table is built by foldExtract.pl < CaseFolding.txt .
+ * It must be in numeric order, because we use binary search on it.
+ * An entry such as {0x41,0x5a,1,32} means that UCS-4 characters in the range
+ * from 0x41 to 0x5a inclusive, stepping by 1, are folded by adding 32.
+ */
+
+typedef struct
+{
+ int rangeStart;
+ int rangeEnd;
+ int step;
+ int offset;
+} convertStruct;
+
+convertStruct foldCase[] =
+{
+ {0x41,0x5a,1,32}, {0xc0,0xd6,1,32}, {0xd8,0xde,1,32},
+ {0x100,0x12e,2,1}, {0x130,0x130,-1,-199}, {0x132,0x136,2,1},
+ {0x139,0x147,2,1}, {0x14a,0x176,2,1}, {0x178,0x178,-1,-121},
+ {0x179,0x17d,2,1}, {0x181,0x181,-1,210}, {0x182,0x184,2,1},
+ {0x186,0x186,-1,206}, {0x187,0x187,-1,1}, {0x189,0x18a,1,205},
+ {0x18b,0x18b,-1,1}, {0x18e,0x18e,-1,79}, {0x18f,0x18f,-1,202},
+ {0x190,0x190,-1,203}, {0x191,0x191,-1,1}, {0x193,0x193,-1,205},
+ {0x194,0x194,-1,207}, {0x196,0x196,-1,211}, {0x197,0x197,-1,209},
+ {0x198,0x198,-1,1}, {0x19c,0x19c,-1,211}, {0x19d,0x19d,-1,213},
+ {0x19f,0x19f,-1,214}, {0x1a0,0x1a4,2,1}, {0x1a6,0x1a6,-1,218},
+ {0x1a7,0x1a7,-1,1}, {0x1a9,0x1a9,-1,218}, {0x1ac,0x1ac,-1,1},
+ {0x1ae,0x1ae,-1,218}, {0x1af,0x1af,-1,1}, {0x1b1,0x1b2,1,217},
+ {0x1b3,0x1b5,2,1}, {0x1b7,0x1b7,-1,219}, {0x1b8,0x1bc,4,1},
+ {0x1c4,0x1c4,-1,2}, {0x1c5,0x1c5,-1,1}, {0x1c7,0x1c7,-1,2},
+ {0x1c8,0x1c8,-1,1}, {0x1ca,0x1ca,-1,2}, {0x1cb,0x1db,2,1},
+ {0x1de,0x1ee,2,1}, {0x1f1,0x1f1,-1,2}, {0x1f2,0x1f4,2,1},
+ {0x1f6,0x1f6,-1,-97}, {0x1f7,0x1f7,-1,-56}, {0x1f8,0x21e,2,1},
+ {0x220,0x220,-1,-130}, {0x222,0x232,2,1}, {0x386,0x386,-1,38},
+ {0x388,0x38a,1,37}, {0x38c,0x38c,-1,64}, {0x38e,0x38f,1,63},
+ {0x391,0x3a1,1,32}, {0x3a3,0x3ab,1,32}, {0x3d8,0x3ee,2,1},
+ {0x3f4,0x3f4,-1,-60}, {0x3f7,0x3f7,-1,1}, {0x3f9,0x3f9,-1,-7},
+ {0x3fa,0x3fa,-1,1}, {0x400,0x40f,1,80}, {0x410,0x42f,1,32},
+ {0x460,0x480,2,1}, {0x48a,0x4be,2,1}, {0x4c1,0x4cd,2,1},
+ {0x4d0,0x4f4,2,1}, {0x4f8,0x500,8,1}, {0x502,0x50e,2,1},
+ {0x531,0x556,1,48}, {0x1e00,0x1e94,2,1}, {0x1ea0,0x1ef8,2,1},
+ {0x1f08,0x1f0f,1,-8}, {0x1f18,0x1f1d,1,-8}, {0x1f28,0x1f2f,1,-8},
+ {0x1f38,0x1f3f,1,-8}, {0x1f48,0x1f4d,1,-8}, {0x1f59,0x1f5f,2,-8},
+ {0x1f68,0x1f6f,1,-8}, {0x1f88,0x1f8f,1,-8}, {0x1f98,0x1f9f,1,-8},
+ {0x1fa8,0x1faf,1,-8}, {0x1fb8,0x1fb9,1,-8}, {0x1fba,0x1fbb,1,-74},
+ {0x1fbc,0x1fbc,-1,-9}, {0x1fc8,0x1fcb,1,-86}, {0x1fcc,0x1fcc,-1,-9},
+ {0x1fd8,0x1fd9,1,-8}, {0x1fda,0x1fdb,1,-100}, {0x1fe8,0x1fe9,1,-8},
+ {0x1fea,0x1feb,1,-112}, {0x1fec,0x1fec,-1,-7}, {0x1ff8,0x1ff9,1,-128},
+ {0x1ffa,0x1ffb,1,-126}, {0x1ffc,0x1ffc,-1,-9}, {0x2126,0x2126,-1,-7517},
+ {0x212a,0x212a,-1,-8383}, {0x212b,0x212b,-1,-8262},
+ {0x2160,0x216f,1,16}, {0x24b6,0x24cf,1,26}, {0xff21,0xff3a,1,32},
+ {0x10400,0x10427,1,40}
+};
+
+static int utf_convert(int a, convertStruct table[], int tableSize);
+
+/*
+ * Generic conversion function for case operations.
+ * Return the converted equivalent of "a", which is a UCS-4 character. Use
+ * the given conversion "table". Uses binary search on "table".
+ */
+ static int
+utf_convert(a, table, tableSize)
+ int a;
+ convertStruct table[];
+ int tableSize;
+{
+ int start, mid, end; /* indices into table */
+
+ start = 0;
+ end = tableSize / sizeof(convertStruct);
+ while (start < end)
+ {
+ /* need to search further */
+ mid = (end + start) /2;
+ if (table[mid].rangeEnd < a)
+ start = mid + 1;
+ else
+ end = mid;
+ }
+ if (table[start].rangeStart <= a && a <= table[start].rangeEnd
+ && (a - table[start].rangeStart) % table[start].step == 0)
+ return (a + table[start].offset);
+ else
+ return a;
+}
+
+/*
+ * Return the folded-case equivalent of "a", which is a UCS-4 character. Uses
+ * simple case folding.
+ */
+ int
+utf_fold(a)
+ int a;
+{
+ return utf_convert(a, foldCase, sizeof(foldCase));
+}
+
+/*
+ * The following tables are built by upperLowerExtract.pl < UnicodeData.txt .
+ * They must be in numeric order, because we use binary search on them.
+ * An entry such as {0x41,0x5a,1,32} means that UCS-4 characters in the range
+ * from 0x41 to 0x5a inclusive, stepping by 1, are switched to lower (for
+ * example) by adding 32.
+ */
+convertStruct toLower[] =
+{
+ {0x41,0x5a,1,32}, {0xc0,0xd6,1,32}, {0xd8,0xde,1,32},
+ {0x100,0x12e,2,1}, {0x130,0x130,-1,-199}, {0x132,0x136,2,1},
+ {0x139,0x147,2,1}, {0x14a,0x176,2,1}, {0x178,0x178,-1,-121},
+ {0x179,0x17d,2,1}, {0x181,0x181,-1,210}, {0x182,0x184,2,1},
+ {0x186,0x186,-1,206}, {0x187,0x187,-1,1}, {0x189,0x18a,1,205},
+ {0x18b,0x18b,-1,1}, {0x18e,0x18e,-1,79}, {0x18f,0x18f,-1,202},
+ {0x190,0x190,-1,203}, {0x191,0x191,-1,1}, {0x193,0x193,-1,205},
+ {0x194,0x194,-1,207}, {0x196,0x196,-1,211}, {0x197,0x197,-1,209},
+ {0x198,0x198,-1,1}, {0x19c,0x19c,-1,211}, {0x19d,0x19d,-1,213},
+ {0x19f,0x19f,-1,214}, {0x1a0,0x1a4,2,1}, {0x1a6,0x1a6,-1,218},
+ {0x1a7,0x1a7,-1,1}, {0x1a9,0x1a9,-1,218}, {0x1ac,0x1ac,-1,1},
+ {0x1ae,0x1ae,-1,218}, {0x1af,0x1af,-1,1}, {0x1b1,0x1b2,1,217},
+ {0x1b3,0x1b5,2,1}, {0x1b7,0x1b7,-1,219}, {0x1b8,0x1bc,4,1},
+ {0x1c4,0x1ca,3,2}, {0x1cd,0x1db,2,1}, {0x1de,0x1ee,2,1},
+ {0x1f1,0x1f1,-1,2}, {0x1f4,0x1f4,-1,1}, {0x1f6,0x1f6,-1,-97},
+ {0x1f7,0x1f7,-1,-56}, {0x1f8,0x21e,2,1}, {0x220,0x220,-1,-130},
+ {0x222,0x232,2,1}, {0x386,0x386,-1,38}, {0x388,0x38a,1,37},
+ {0x38c,0x38c,-1,64}, {0x38e,0x38f,1,63}, {0x391,0x3a1,1,32},
+ {0x3a3,0x3ab,1,32}, {0x3d8,0x3ee,2,1}, {0x3f4,0x3f4,-1,-60},
+ {0x3f7,0x3f7,-1,1}, {0x3f9,0x3f9,-1,-7}, {0x3fa,0x3fa,-1,1},
+ {0x400,0x40f,1,80}, {0x410,0x42f,1,32}, {0x460,0x480,2,1},
+ {0x48a,0x4be,2,1}, {0x4c1,0x4cd,2,1}, {0x4d0,0x4f4,2,1},
+ {0x4f8,0x500,8,1}, {0x502,0x50e,2,1}, {0x531,0x556,1,48},
+ {0x1e00,0x1e94,2,1}, {0x1ea0,0x1ef8,2,1}, {0x1f08,0x1f0f,1,-8},
+ {0x1f18,0x1f1d,1,-8}, {0x1f28,0x1f2f,1,-8}, {0x1f38,0x1f3f,1,-8},
+ {0x1f48,0x1f4d,1,-8}, {0x1f59,0x1f5f,2,-8}, {0x1f68,0x1f6f,1,-8},
+ {0x1fb8,0x1fb9,1,-8}, {0x1fba,0x1fbb,1,-74}, {0x1fc8,0x1fcb,1,-86},
+ {0x1fd8,0x1fd9,1,-8}, {0x1fda,0x1fdb,1,-100}, {0x1fe8,0x1fe9,1,-8},
+ {0x1fea,0x1feb,1,-112}, {0x1fec,0x1fec,-1,-7}, {0x1ff8,0x1ff9,1,-128},
+ {0x1ffa,0x1ffb,1,-126}, {0x2126,0x2126,-1,-7517}, {0x212a,0x212a,-1,-8383},
+ {0x212b,0x212b,-1,-8262}, {0xff21,0xff3a,1,32}, {0x10400,0x10427,1,40}
+};
+
+convertStruct toUpper[] =
+{
+ {0x61,0x7a,1,-32}, {0xb5,0xb5,-1,743}, {0xe0,0xf6,1,-32},
+ {0xf8,0xfe,1,-32}, {0xff,0xff,-1,121}, {0x101,0x12f,2,-1},
+ {0x131,0x131,-1,-232}, {0x133,0x137,2,-1}, {0x13a,0x148,2,-1},
+ {0x14b,0x177,2,-1}, {0x17a,0x17e,2,-1}, {0x17f,0x17f,-1,-300},
+ {0x183,0x185,2,-1}, {0x188,0x18c,4,-1}, {0x192,0x192,-1,-1},
+ {0x195,0x195,-1,97}, {0x199,0x199,-1,-1}, {0x19e,0x19e,-1,130},
+ {0x1a1,0x1a5,2,-1}, {0x1a8,0x1ad,5,-1}, {0x1b0,0x1b4,4,-1},
+ {0x1b6,0x1b9,3,-1}, {0x1bd,0x1bd,-1,-1}, {0x1bf,0x1bf,-1,56},
+ {0x1c5,0x1c6,1,-1}, {0x1c8,0x1c9,1,-1}, {0x1cb,0x1cc,1,-1},
+ {0x1ce,0x1dc,2,-1}, {0x1dd,0x1dd,-1,-79}, {0x1df,0x1ef,2,-1},
+ {0x1f2,0x1f3,1,-1}, {0x1f5,0x1f9,4,-1}, {0x1fb,0x21f,2,-1},
+ {0x223,0x233,2,-1}, {0x253,0x253,-1,-210}, {0x254,0x254,-1,-206},
+ {0x256,0x257,1,-205}, {0x259,0x259,-1,-202}, {0x25b,0x25b,-1,-203},
+ {0x260,0x260,-1,-205}, {0x263,0x263,-1,-207}, {0x268,0x268,-1,-209},
+ {0x269,0x26f,6,-211}, {0x272,0x272,-1,-213}, {0x275,0x275,-1,-214},
+ {0x280,0x283,3,-218}, {0x288,0x288,-1,-218}, {0x28a,0x28b,1,-217},
+ {0x292,0x292,-1,-219}, {0x3ac,0x3ac,-1,-38}, {0x3ad,0x3af,1,-37},
+ {0x3b1,0x3c1,1,-32}, {0x3c2,0x3c2,-1,-31}, {0x3c3,0x3cb,1,-32},
+ {0x3cc,0x3cc,-1,-64}, {0x3cd,0x3ce,1,-63}, {0x3d0,0x3d0,-1,-62},
+ {0x3d1,0x3d1,-1,-57}, {0x3d5,0x3d5,-1,-47}, {0x3d6,0x3d6,-1,-54},
+ {0x3d9,0x3ef,2,-1}, {0x3f0,0x3f0,-1,-86}, {0x3f1,0x3f1,-1,-80},
+ {0x3f2,0x3f2,-1,7}, {0x3f5,0x3f5,-1,-96}, {0x3f8,0x3fb,3,-1},
+ {0x430,0x44f,1,-32}, {0x450,0x45f,1,-80}, {0x461,0x481,2,-1},
+ {0x48b,0x4bf,2,-1}, {0x4c2,0x4ce,2,-1}, {0x4d1,0x4f5,2,-1},
+ {0x4f9,0x501,8,-1}, {0x503,0x50f,2,-1}, {0x561,0x586,1,-48},
+ {0x1e01,0x1e95,2,-1}, {0x1e9b,0x1e9b,-1,-59}, {0x1ea1,0x1ef9,2,-1},
+ {0x1f00,0x1f07,1,8}, {0x1f10,0x1f15,1,8}, {0x1f20,0x1f27,1,8},
+ {0x1f30,0x1f37,1,8}, {0x1f40,0x1f45,1,8}, {0x1f51,0x1f57,2,8},
+ {0x1f60,0x1f67,1,8}, {0x1f70,0x1f71,1,74}, {0x1f72,0x1f75,1,86},
+ {0x1f76,0x1f77,1,100}, {0x1f78,0x1f79,1,128}, {0x1f7a,0x1f7b,1,112},
+ {0x1f7c,0x1f7d,1,126}, {0x1f80,0x1f87,1,8}, {0x1f90,0x1f97,1,8},
+ {0x1fa0,0x1fa7,1,8}, {0x1fb0,0x1fb1,1,8}, {0x1fb3,0x1fb3,-1,9},
+ {0x1fbe,0x1fbe,-1,-7205}, {0x1fc3,0x1fc3,-1,9}, {0x1fd0,0x1fd1,1,8},
+ {0x1fe0,0x1fe1,1,8}, {0x1fe5,0x1fe5,-1,7}, {0x1ff3,0x1ff3,-1,9},
+ {0xff41,0xff5a,1,-32}, {0x10428,0x1044f,1,-40}
+};
+
+/*
+ * Return the upper-case equivalent of "a", which is a UCS-4 character. Use
+ * simple case folding.
+ */
+ int
+utf_toupper(a)
+ int a;
+{
+ /* If 'casemap' contains "keepascii" use ASCII style toupper(). */
+ if (a < 128 && (cmp_flags & CMP_KEEPASCII))
+ return TOUPPER_ASC(a);
+
+#if defined(HAVE_TOWUPPER) && defined(__STDC__ISO_10646__)
+ /* If towupper() is availble and handles Unicode, use it. */
+ if (!(cmp_flags & CMP_INTERNAL))
+ return towupper(a);
+#endif
+
+ /* For characters below 128 use locale sensitive toupper(). */
+ if (a < 128)
+ return TOUPPER_LOC(a);
+
+ /* For any other characters use the above mapping table. */
+ return utf_convert(a, toUpper, sizeof(toUpper));
+}
+
+ int
+utf_islower(a)
+ int a;
+{
+ return (utf_toupper(a) != a);
+}
+
+/*
+ * Return the lower-case equivalent of "a", which is a UCS-4 character. Use
+ * simple case folding.
+ */
+ int
+utf_tolower(a)
+ int a;
+{
+ /* If 'casemap' contains "keepascii" use ASCII style tolower(). */
+ if (a < 128 && (cmp_flags & CMP_KEEPASCII))
+ return TOLOWER_ASC(a);
+
+#if defined(HAVE_TOWLOWER) && defined(__STDC__ISO_10646__)
+ /* If towlower() is availble and handles Unicode, use it. */
+ if (!(cmp_flags & CMP_INTERNAL))
+ return towlower(a);
+#endif
+
+ /* For characters below 128 use locale sensitive tolower(). */
+ if (a < 128)
+ return TOLOWER_LOC(a);
+
+ /* For any other characters use the above mapping table. */
+ return utf_convert(a, toLower, sizeof(toLower));
+}
+
+ int
+utf_isupper(a)
+ int a;
+{
+ return (utf_tolower(a) != a);
+}
+
+/*
+ * Version of strnicmp() that handles multi-byte characters.
+ * Needed for Big5, Sjift-JIS and UTF-8 encoding. Other DBCS encodings can
+ * probably use strnicmp(), because there are no ASCII characters in the
+ * second byte.
+ * Returns zero if s1 and s2 are equal (ignoring case), the difference between
+ * two characters otherwise.
+ */
+ int
+mb_strnicmp(s1, s2, n)
+ char_u *s1, *s2;
+ int n;
+{
+ int i, j, l;
+ int cdiff;
+
+ for (i = 0; i < n; i += l)
+ {
+ if (s1[i] == NUL && s2[i] == NUL) /* both strings end */
+ return 0;
+ if (enc_utf8)
+ {
+ l = utf_byte2len(s1[i]);
+ if (l > n - i)
+ l = n - i; /* incomplete character */
+ /* Check directly first, it's faster. */
+ for (j = 0; j < l; ++j)
+ if (s1[i + j] != s2[i + j])
+ break;
+ if (j < l)
+ {
+ /* If one of the two characters is incomplete return -1. */
+ if (i + utf_byte2len(s1[i]) > n || i + utf_byte2len(s2[i]) > n)
+ return -1;
+ cdiff = utf_fold(utf_ptr2char(s1 + i))
+ - utf_fold(utf_ptr2char(s2 + i));
+ if (cdiff != 0)
+ return cdiff;
+ }
+ }
+ else
+ {
+ l = (*mb_ptr2len_check)(s1 + i);
+ if (l <= 1)
+ {
+ /* Single byte: first check normally, then with ignore case. */
+ if (s1[i] != s2[i])
+ {
+ cdiff = TOLOWER_LOC(s1[i]) - TOLOWER_LOC(s2[i]);
+ if (cdiff != 0)
+ return cdiff;
+ }
+ }
+ else
+ {
+ /* For non-Unicode multi-byte don't ignore case. */
+ if (l > n - i)
+ l = n - i;
+ cdiff = STRNCMP(s1 + i, s2 + i, l);
+ if (cdiff != 0)
+ return cdiff;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+ * "g8": show bytes of the UTF-8 char under the cursor. Doesn't matter what
+ * 'encoding' has been set to.
+ */
+ void
+show_utf8()
+{
+ int len;
+ char_u *line;
+ int clen;
+ int i;
+
+ /* Get the byte length of the char under the cursor, including composing
+ * characters. */
+ line = ml_get_cursor();
+ len = utfc_ptr2len_check(line);
+ if (len == 0)
+ {
+ MSG("NUL");
+ return;
+ }
+
+ IObuff[0] = NUL;
+ clen = 0;
+ for (i = 0; i < len; ++i)
+ {
+ if (clen == 0)
+ {
+ /* start of (composing) character, get its length */
+ if (i > 0)
+ STRCAT(IObuff, "+ ");
+ clen = utf_ptr2len_check(line + i);
+ }
+ sprintf((char *)IObuff + STRLEN(IObuff), "%02x ", line[i]);
+ --clen;
+ }
+
+ msg(IObuff);
+}
+
+/*
+ * mb_head_off() function pointer.
+ * Return offset from "p" to the first byte of the character it points into.
+ * Returns 0 when already at the first byte of a character.
+ */
+/*ARGSUSED*/
+ int
+latin_head_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ return 0;
+}
+
+ int
+dbcs_head_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ char_u *q;
+
+ /* It can't be a trailing byte when not using DBCS, at the start of the
+ * string or the previous byte can't start a double-byte. */
+ if (p <= base || MB_BYTE2LEN(p[-1]) == 1)
+ return 0;
+
+ /* This is slow: need to start at the base and go forward until the
+ * byte we are looking for. Return 1 when we went past it, 0 otherwise. */
+ q = base;
+ while (q < p)
+ q += dbcs_ptr2len_check(q);
+ return (q == p) ? 0 : 1;
+}
+
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
+ || defined(PROTO)
+/*
+ * Special version of dbcs_head_off() that works for ScreenLines[], where
+ * single-width DBCS_JPNU characters are stored separately.
+ */
+ int
+dbcs_screen_head_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ char_u *q;
+
+ /* It can't be a trailing byte when not using DBCS, at the start of the
+ * string or the previous byte can't start a double-byte.
+ * For euc-jp an 0x8e byte in the previous cell always means we have a
+ * lead byte in the current cell. */
+ if (p <= base
+ || (enc_dbcs == DBCS_JPNU && p[-1] == 0x8e)
+ || MB_BYTE2LEN(p[-1]) == 1)
+ return 0;
+
+ /* This is slow: need to start at the base and go forward until the
+ * byte we are looking for. Return 1 when we went past it, 0 otherwise.
+ * For DBCS_JPNU look out for 0x8e, which means the second byte is not
+ * stored as the next byte. */
+ q = base;
+ while (q < p)
+ {
+ if (enc_dbcs == DBCS_JPNU && *q == 0x8e)
+ ++q;
+ else
+ q += dbcs_ptr2len_check(q);
+ }
+ return (q == p) ? 0 : 1;
+}
+#endif
+
+ int
+utf_head_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ char_u *q;
+ char_u *s;
+ int c;
+#ifdef FEAT_ARABIC
+ char_u *j;
+#endif
+
+ if (*p < 0x80) /* be quick for ASCII */
+ return 0;
+
+ /* Skip backwards over trailing bytes: 10xx.xxxx
+ * Skip backwards again if on a composing char. */
+ for (q = p; ; --q)
+ {
+ /* Move s to the last byte of this char. */
+ for (s = q; (s[1] & 0xc0) == 0x80; ++s)
+ ;
+ /* Move q to the first byte of this char. */
+ while (q > base && (*q & 0xc0) == 0x80)
+ --q;
+ /* Check for illegal sequence. Do allow an illegal byte after where we
+ * started. */
+ if (utf8len_tab[*q] != (int)(s - q + 1)
+ && utf8len_tab[*q] != (int)(p - q + 1))
+ return 0;
+
+ if (q <= base)
+ break;
+
+ c = utf_ptr2char(q);
+ if (utf_iscomposing(c))
+ continue;
+
+#ifdef FEAT_ARABIC
+ if (arabic_maycombine(c))
+ {
+ /* Advance to get a sneak-peak at the next char */
+ j = q;
+ --j;
+ /* Move j to the first byte of this char. */
+ while (j > base && (*j & 0xc0) == 0x80)
+ --j;
+ if (arabic_combine(utf_ptr2char(j), c))
+ continue;
+ }
+#endif
+ break;
+ }
+
+ return (int)(p - q);
+}
+
+/*
+ * Return the offset from "p" to the first byte of a character. When "p" is
+ * at the start of a character 0 is returned, otherwise the offset to the next
+ * character. Can start anywhere in a stream of bytes.
+ */
+ int
+mb_off_next(base, p)
+ char_u *base;
+ char_u *p;
+{
+ int i;
+ int j;
+
+ if (enc_utf8)
+ {
+ if (*p < 0x80) /* be quick for ASCII */
+ return 0;
+
+ /* Find the next character that isn't 10xx.xxxx */
+ for (i = 0; (p[i] & 0xc0) == 0x80; ++i)
+ ;
+ if (i > 0)
+ {
+ /* Check for illegal sequence. */
+ for (j = 0; p - j > base; ++j)
+ if ((p[-j] & 0xc0) != 0x80)
+ break;
+ if (utf8len_tab[p[-j]] != i + j)
+ return 0;
+ }
+ return i;
+ }
+
+ /* Only need to check if we're on a trail byte, it doesn't matter if we
+ * want the offset to the next or current character. */
+ return (*mb_head_off)(base, p);
+}
+
+/*
+ * Return the offset from "p" to the last byte of the character it points
+ * into. Can start anywhere in a stream of bytes.
+ */
+ int
+mb_tail_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ int i;
+ int j;
+
+ if (*p == NUL)
+ return 0;
+
+ if (enc_utf8)
+ {
+ /* Find the last character that is 10xx.xxxx */
+ for (i = 0; (p[i + 1] & 0xc0) == 0x80; ++i)
+ ;
+ /* Check for illegal sequence. */
+ for (j = 0; p - j > base; ++j)
+ if ((p[-j] & 0xc0) != 0x80)
+ break;
+ if (utf8len_tab[p[-j]] != i + j + 1)
+ return 0;
+ return i;
+ }
+
+ /* It can't be the first byte if a double-byte when not using DBCS, at the
+ * end of the string or the byte can't start a double-byte. */
+ if (enc_dbcs == 0 || p[1] == NUL || MB_BYTE2LEN(*p) == 1)
+ return 0;
+
+ /* Return 1 when on the lead byte, 0 when on the tail byte. */
+ return 1 - dbcs_head_off(base, p);
+}
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Special version of mb_tail_off() for use in ScreenLines[].
+ */
+ int
+dbcs_screen_tail_off(base, p)
+ char_u *base;
+ char_u *p;
+{
+ /* It can't be the first byte if a double-byte when not using DBCS, at the
+ * end of the string or the byte can't start a double-byte.
+ * For euc-jp an 0x8e byte always means we have a lead byte in the current
+ * cell. */
+ if (*p == NUL || p[1] == NUL
+ || (enc_dbcs == DBCS_JPNU && *p == 0x8e)
+ || MB_BYTE2LEN(*p) == 1)
+ return 0;
+
+ /* Return 1 when on the lead byte, 0 when on the tail byte. */
+ return 1 - dbcs_screen_head_off(base, p);
+}
+#endif
+
+/*
+ * If the cursor moves on an trail byte, set the cursor on the lead byte.
+ * Thus it moves left if necessary.
+ * Return TRUE when the cursor was adjusted.
+ */
+ void
+mb_adjust_cursor()
+{
+ mb_adjustpos(&curwin->w_cursor);
+}
+
+/*
+ * Adjust position "*lp" to point to the first byte of a multi-byte character.
+ * If it points to a tail byte it's moved backwards to the head byte.
+ */
+ void
+mb_adjustpos(lp)
+ pos_T *lp;
+{
+ char_u *p;
+
+ if (lp->col > 0
+#ifdef FEAT_VIRTUALEDIT
+ || lp->coladd > 1
+#endif
+ )
+ {
+ p = ml_get(lp->lnum);
+ lp->col -= (*mb_head_off)(p, p + lp->col);
+#ifdef FEAT_VIRTUALEDIT
+ /* Reset "coladd" when the cursor would be on the right half of a
+ * double-wide character. */
+ if (lp->coladd == 1
+ && p[lp->col] != TAB
+ && vim_isprintc((*mb_ptr2char)(p + lp->col))
+ && ptr2cells(p + lp->col) > 1)
+ lp->coladd = 0;
+#endif
+ }
+}
+
+/*
+ * Return a pointer to the character before "*p", if there is one.
+ */
+ char_u *
+mb_prevptr(line, p)
+ char_u *line; /* start of the string */
+ char_u *p;
+{
+ if (p > line)
+ p = p - (*mb_head_off)(line, p - 1) - 1;
+ return p;
+}
+
+/*
+ * Return the character length of "str". multi-byte characters counts as one.
+ */
+ int
+mb_charlen(str)
+ char_u *str;
+{
+ int count;
+
+ if (str == NULL)
+ return 0;
+
+ for (count = 0; *str != NUL; count++)
+ str += (*mb_ptr2len_check)(str);
+
+ return count;
+}
+
+/*
+ * Try to un-escape a multi-byte character.
+ * Used for the "to" and "from" part of a mapping.
+ * Return the un-escaped string if it is a multi-byte character, and advance
+ * "pp" to just after the bytes that formed it.
+ * Return NULL if no multi-byte char was found.
+ */
+ char_u *
+mb_unescape(pp)
+ char_u **pp;
+{
+ static char_u buf[MB_MAXBYTES + 1];
+ int n, m = 0;
+ char_u *str = *pp;
+
+ /* Must translate K_SPECIAL KS_SPECIAL KE_FILLER to K_SPECIAL and CSI
+ * KS_EXTRA KE_CSI to CSI. */
+ for (n = 0; str[n] != NUL && m <= MB_MAXBYTES; ++n)
+ {
+ if (str[n] == K_SPECIAL
+ && str[n + 1] == KS_SPECIAL
+ && str[n + 2] == KE_FILLER)
+ {
+ buf[m++] = K_SPECIAL;
+ n += 2;
+ }
+# ifdef FEAT_GUI
+ else if (str[n] == CSI
+ && str[n + 1] == KS_EXTRA
+ && str[n + 2] == (int)KE_CSI)
+ {
+ buf[m++] = CSI;
+ n += 2;
+ }
+# endif
+ else if (str[n] == K_SPECIAL
+# ifdef FEAT_GUI
+ || str[n] == CSI
+# endif
+ )
+ break; /* a special key can't be a multibyte char */
+ else
+ buf[m++] = str[n];
+ buf[m] = NUL;
+
+ /* Return a multi-byte character if it's found. An illegal sequence
+ * will result in a 1 here. */
+ if ((*mb_ptr2len_check)(buf) > 1)
+ {
+ *pp = str + n + 1;
+ return buf;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Return TRUE if the character at "row"/"col" on the screen is the left side
+ * of a double-width character.
+ * Caller must make sure "row" and "col" are not invalid!
+ */
+ int
+mb_lefthalve(row, col)
+ int row;
+ int col;
+{
+#ifdef FEAT_HANGULIN
+ if (composing_hangul)
+ return TRUE;
+#endif
+ if (enc_dbcs != 0)
+ return dbcs_off2cells(LineOffset[row] + col) > 1;
+ if (enc_utf8)
+ return (col + 1 < Columns
+ && ScreenLines[LineOffset[row] + col + 1] == 0);
+ return FALSE;
+}
+
+# if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
+ || defined(PROTO)
+/*
+ * Correct a position on the screen, if it's the right halve of a double-wide
+ * char move it to the left halve. Returns the corrected column.
+ */
+ int
+mb_fix_col(col, row)
+ int col;
+ int row;
+{
+ col = check_col(col);
+ row = check_row(row);
+ if (has_mbyte && ScreenLines != NULL && col > 0
+ && ((enc_dbcs
+ && ScreenLines[LineOffset[row] + col] != NUL
+ && dbcs_screen_head_off(ScreenLines + LineOffset[row],
+ ScreenLines + LineOffset[row] + col))
+ || (enc_utf8 && ScreenLines[LineOffset[row] + col] == 0)))
+ --col;
+ return col;
+}
+# endif
+#endif
+
+#if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT) || defined(PROTO)
+static int enc_alias_search __ARGS((char_u *name));
+
+/*
+ * Skip the Vim specific head of a 'encoding' name.
+ */
+ char_u *
+enc_skip(p)
+ char_u *p;
+{
+ if (STRNCMP(p, "2byte-", 6) == 0)
+ return p + 6;
+ if (STRNCMP(p, "8bit-", 5) == 0)
+ return p + 5;
+ return p;
+}
+
+/*
+ * Find the canonical name for encoding "enc".
+ * When the name isn't recognized, returns "enc" itself, but with all lower
+ * case characters and '_' replaced with '-'.
+ * Returns an allocated string. NULL for out-of-memory.
+ */
+ char_u *
+enc_canonize(enc)
+ char_u *enc;
+{
+ char_u *r;
+ char_u *p, *s;
+ int i;
+
+ /* copy "enc" to allocted memory, with room for two '-' */
+ r = alloc((unsigned)(STRLEN(enc) + 3));
+ if (r != NULL)
+ {
+ /* Make it all lower case and replace '_' with '-'. */
+ p = r;
+ for (s = enc; *s != NUL; ++s)
+ {
+ if (*s == '_')
+ *p++ = '-';
+ else
+ *p++ = TOLOWER_ASC(*s);
+ }
+ *p = NUL;
+
+ /* Skip "2byte-" and "8bit-". */
+ p = enc_skip(r);
+
+ /* "iso8859" -> "iso-8859" */
+ if (STRNCMP(p, "iso8859", 7) == 0)
+ {
+ mch_memmove(p + 4, p + 3, STRLEN(p + 2));
+ p[3] = '-';
+ }
+
+ /* "iso-8859n" -> "iso-8859-n" */
+ if (STRNCMP(p, "iso-8859", 8) == 0 && p[8] != '-')
+ {
+ mch_memmove(p + 9, p + 8, STRLEN(p + 7));
+ p[8] = '-';
+ }
+
+ /* "latin-N" -> "latinN" */
+ if (STRNCMP(p, "latin-", 6) == 0)
+ mch_memmove(p + 5, p + 6, STRLEN(p + 5));
+
+ if (enc_canon_search(p) >= 0)
+ {
+ /* canonical name can be used unmodified */
+ if (p != r)
+ mch_memmove(r, p, STRLEN(p) + 1);
+ }
+ else if ((i = enc_alias_search(p)) >= 0)
+ {
+ /* alias recognized, get canonical name */
+ vim_free(r);
+ r = vim_strsave((char_u *)enc_canon_table[i].name);
+ }
+ }
+ return r;
+}
+
+/*
+ * Search for an encoding alias of "name".
+ * Returns -1 when not found.
+ */
+ static int
+enc_alias_search(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; enc_alias_table[i].name != NULL; ++i)
+ if (STRCMP(name, enc_alias_table[i].name) == 0)
+ return enc_alias_table[i].canon;
+ return -1;
+}
+#endif
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+
+/*
+ * Get the canonicalized encoding of the current locale.
+ * Returns an allocated string when successful, NULL when not.
+ */
+ char_u *
+enc_locale()
+{
+#ifndef WIN3264
+ char *s;
+ char *p;
+ int i;
+#endif
+ char buf[50];
+#ifdef WIN3264
+ long acp = GetACP();
+
+ if (acp == 1200)
+ STRCPY(buf, "ucs-2le");
+ else if (acp == 1252)
+ STRCPY(buf, "latin1");
+ else
+ sprintf(buf, "cp%ld", acp);
+#else
+# ifdef HAVE_NL_LANGINFO_CODESET
+ if ((s = nl_langinfo(CODESET)) == NULL || *s == NUL)
+# endif
+# if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ if ((s = setlocale(LC_CTYPE, NULL)) == NULL || *s == NUL)
+# endif
+ if ((s = getenv("LC_ALL")) == NULL || *s == NUL)
+ if ((s = getenv("LC_CTYPE")) == NULL || *s == NUL)
+ s = getenv("LANG");
+
+ if (s == NULL || *s == NUL)
+ return FAIL;
+
+ /* The most generic locale format is:
+ * language[_territory][.codeset][@modifier][+special][,[sponsor][_revision]]
+ * If there is a '.' remove the part before it.
+ * if there is something after the codeset, remove it.
+ * Make the name lowercase and replace '_' with '-'.
+ * Exception: "ja_JP.EUC" == "euc-jp", "zh_CN.EUC" = "euc-cn",
+ * "ko_KR.EUC" == "euc-kr"
+ */
+ if ((p = (char *)vim_strchr((char_u *)s, '.')) != NULL)
+ {
+ if (p > s + 2 && STRNICMP(p + 1, "EUC", 3) == 0
+ && !isalnum((int)p[4]) && p[4] != '-' && p[-3] == '_')
+ {
+ /* copy "XY.EUC" to "euc-XY" to buf[10] */
+ STRCPY(buf + 10, "euc-");
+ buf[14] = p[-2];
+ buf[15] = p[-1];
+ buf[16] = 0;
+ s = buf + 10;
+ }
+ else
+ s = p + 1;
+ }
+ for (i = 0; s[i] != NUL && i < sizeof(buf) - 1; ++i)
+ {
+ if (s[i] == '_' || s[i] == '-')
+ buf[i] = '-';
+ else if (isalnum((int)s[i]))
+ buf[i] = TOLOWER_ASC(s[i]);
+ else
+ break;
+ }
+ buf[i] = NUL;
+#endif
+
+ return enc_canonize((char_u *)buf);
+}
+
+#if defined(WIN3264) || defined(PROTO)
+/*
+ * Convert an encoding name to an MS-Windows codepage.
+ * Returns zero if no codepage can be figured out.
+ */
+ int
+encname2codepage(name)
+ char_u *name;
+{
+ int cp;
+ char_u *p = name;
+ int idx;
+
+ if (STRNCMP(p, "8bit-", 5) == 0)
+ p += 5;
+ else if (STRNCMP(p_enc, "2byte-", 6) == 0)
+ p += 6;
+
+ if (p[0] == 'c' && p[1] == 'p')
+ cp = atoi(p + 2);
+ else if ((idx = enc_canon_search(p)) >= 0)
+ cp = enc_canon_table[idx].codepage;
+ else
+ return 0;
+ if (IsValidCodePage(cp))
+ return cp;
+ return 0;
+}
+#endif
+
+# if defined(USE_ICONV) || defined(PROTO)
+
+static char_u *iconv_string __ARGS((vimconv_T *vcp, char_u *str, int slen, int *unconvlenp));
+
+/*
+ * Call iconv_open() with a check if iconv() works properly (there are broken
+ * versions).
+ * Returns (void *)-1 if failed.
+ * (should return iconv_t, but that causes problems with prototypes).
+ */
+ void *
+my_iconv_open(to, from)
+ char_u *to;
+ char_u *from;
+{
+ iconv_t fd;
+#define ICONV_TESTLEN 400
+ char_u tobuf[ICONV_TESTLEN];
+ char *p;
+ size_t tolen;
+ static int iconv_ok = -1;
+
+ if (iconv_ok == FALSE)
+ return (void *)-1; /* detected a broken iconv() previously */
+
+#ifdef DYNAMIC_ICONV
+ /* Check if the iconv.dll can be found. */
+ if (!iconv_enabled(TRUE))
+ return (void *)-1;
+#endif
+
+ fd = iconv_open((char *)enc_skip(to), (char *)enc_skip(from));
+
+ if (fd != (iconv_t)-1 && iconv_ok == -1)
+ {
+ /*
+ * Do a dummy iconv() call to check if it actually works. There is a
+ * version of iconv() on Linux that is broken. We can't ignore it,
+ * because it's wide-spread. The symptoms are that after outputting
+ * the initial shift state the "to" pointer is NULL and conversion
+ * stops for no apparent reason after about 8160 characters.
+ */
+ p = (char *)tobuf;
+ tolen = ICONV_TESTLEN;
+ (void)iconv(fd, NULL, NULL, &p, &tolen);
+ if (p == NULL)
+ {
+ iconv_ok = FALSE;
+ iconv_close(fd);
+ fd = (iconv_t)-1;
+ }
+ else
+ iconv_ok = TRUE;
+ }
+
+ return (void *)fd;
+}
+
+/*
+ * Convert the string "str[slen]" with iconv().
+ * If "unconvlenp" is not NULL handle the string ending in an incomplete
+ * sequence and set "*unconvlenp" to the length of it.
+ * Returns the converted string in allocated memory. NULL for an error.
+ */
+ static char_u *
+iconv_string(vcp, str, slen, unconvlenp)
+ vimconv_T *vcp;
+ char_u *str;
+ int slen;
+ int *unconvlenp;
+{
+ const char *from;
+ size_t fromlen;
+ char *to;
+ size_t tolen;
+ size_t len = 0;
+ size_t done = 0;
+ char_u *result = NULL;
+ char_u *p;
+ int l;
+
+ from = (char *)str;
+ fromlen = slen;
+ for (;;)
+ {
+ if (len == 0 || ICONV_ERRNO == ICONV_E2BIG)
+ {
+ /* Allocate enough room for most conversions. When re-allocating
+ * increase the buffer size. */
+ len = len + fromlen * 2 + 40;
+ p = alloc((unsigned)len);
+ if (p != NULL && done > 0)
+ mch_memmove(p, result, done);
+ vim_free(result);
+ result = p;
+ if (result == NULL) /* out of memory */
+ break;
+ }
+
+ to = (char *)result + done;
+ tolen = len - done - 2;
+ /* Avoid a warning for systems with a wrong iconv() prototype by
+ * casting the second argument to void *. */
+ if (iconv(vcp->vc_fd, (void *)&from, &fromlen, &to, &tolen)
+ != (size_t)-1)
+ {
+ /* Finished, append a NUL. */
+ *to = NUL;
+ break;
+ }
+
+ /* Check both ICONV_EINVAL and EINVAL, because the dynamically loaded
+ * iconv library may use one of them. */
+ if (!vcp->vc_fail && unconvlenp != NULL
+ && (ICONV_ERRNO == ICONV_EINVAL || ICONV_ERRNO == EINVAL))
+ {
+ /* Handle an incomplete sequence at the end. */
+ *to = NUL;
+ *unconvlenp = fromlen;
+ break;
+ }
+
+ /* Check both ICONV_EILSEQ and EILSEQ, because the dynamically loaded
+ * iconv library may use one of them. */
+ else if (!vcp->vc_fail
+ && (ICONV_ERRNO == ICONV_EILSEQ || ICONV_ERRNO == EILSEQ
+ || ICONV_ERRNO == ICONV_EINVAL || ICONV_ERRNO == EINVAL))
+ {
+ /* Can't convert: insert a '?' and skip a character. This assumes
+ * conversion from 'encoding' to something else. In other
+ * situations we don't know what to skip anyway. */
+ *to++ = '?';
+ if ((*mb_ptr2cells)((char_u *)from) > 1)
+ *to++ = '?';
+ l = (*mb_ptr2len_check)((char_u *)from);
+ from += l;
+ fromlen -= l;
+ }
+ else if (ICONV_ERRNO != ICONV_E2BIG)
+ {
+ /* conversion failed */
+ vim_free(result);
+ result = NULL;
+ break;
+ }
+ /* Not enough room or skipping illegal sequence. */
+ done = to - (char *)result;
+ }
+ return result;
+}
+
+# if defined(DYNAMIC_ICONV) || defined(PROTO)
+/*
+ * Dynamically load the "iconv.dll" on Win32.
+ */
+
+#ifndef DYNAMIC_ICONV /* just generating prototypes */
+# define HINSTANCE int
+#endif
+HINSTANCE hIconvDLL = 0;
+HINSTANCE hMsvcrtDLL = 0;
+
+# ifndef DYNAMIC_ICONV_DLL
+# define DYNAMIC_ICONV_DLL "iconv.dll"
+# define DYNAMIC_ICONV_DLL_ALT "libiconv.dll"
+# endif
+# ifndef DYNAMIC_MSVCRT_DLL
+# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
+# endif
+
+/*
+ * Try opening the iconv.dll and return TRUE if iconv() can be used.
+ */
+ int
+iconv_enabled(verbose)
+ int verbose;
+{
+ if (hIconvDLL != 0 && hMsvcrtDLL != 0)
+ return TRUE;
+ hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL);
+ if (hIconvDLL == 0) /* sometimes it's called libiconv.dll */
+ hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL_ALT);
+ if (hIconvDLL != 0)
+ hMsvcrtDLL = LoadLibrary(DYNAMIC_MSVCRT_DLL);
+ if (hIconvDLL == 0 || hMsvcrtDLL == 0)
+ {
+ /* Only give the message when 'verbose' is set, otherwise it might be
+ * done whenever a conversion is attempted. */
+ if (verbose && p_verbose > 0)
+ EMSG2(_(e_loadlib),
+ hIconvDLL == 0 ? DYNAMIC_ICONV_DLL : DYNAMIC_MSVCRT_DLL);
+ iconv_end();
+ return FALSE;
+ }
+
+ *((FARPROC*)&iconv) = GetProcAddress(hIconvDLL, "libiconv");
+ *((FARPROC*)&iconv_open) = GetProcAddress(hIconvDLL, "libiconv_open");
+ *((FARPROC*)&iconv_close) = GetProcAddress(hIconvDLL, "libiconv_close");
+ *((FARPROC*)&iconvctl) = GetProcAddress(hIconvDLL, "libiconvctl");
+ *((FARPROC*)&iconv_errno) = GetProcAddress(hMsvcrtDLL, "_errno");
+ if (iconv == NULL || iconv_open == NULL || iconv_close == NULL
+ || iconvctl == NULL || iconv_errno == NULL)
+ {
+ iconv_end();
+ if (verbose && p_verbose > 0)
+ EMSG2(_(e_loadfunc), "for libiconv");
+ return FALSE;
+ }
+ return TRUE;
+}
+
+ void
+iconv_end()
+{
+ /* Don't use iconv() when inputting or outputting characters. */
+ if (input_conv.vc_type == CONV_ICONV)
+ convert_setup(&input_conv, NULL, NULL);
+ if (output_conv.vc_type == CONV_ICONV)
+ convert_setup(&output_conv, NULL, NULL);
+
+ if (hIconvDLL != 0)
+ FreeLibrary(hIconvDLL);
+ if (hMsvcrtDLL != 0)
+ FreeLibrary(hMsvcrtDLL);
+ hIconvDLL = 0;
+ hMsvcrtDLL = 0;
+}
+# endif /* DYNAMIC_ICONV */
+# endif /* USE_ICONV */
+
+#endif /* FEAT_MBYTE */
+
+#if defined(FEAT_XIM) || defined(PROTO)
+
+# ifdef FEAT_GUI_GTK
+static int xim_has_preediting INIT(= FALSE); /* IM current status */
+
+/*
+ * Set preedit_start_col to the current cursor position.
+ */
+ static void
+init_preedit_start_col(void)
+{
+ if (State & CMDLINE)
+ preedit_start_col = cmdline_getvcol_cursor();
+ else if (curwin != NULL)
+ getvcol(curwin, &curwin->w_cursor, &preedit_start_col, NULL, NULL);
+ /* Prevent that preediting marks the buffer as changed. */
+ xim_changed_while_preediting = curbuf->b_changed;
+}
+# endif
+
+# if defined(HAVE_GTK2) && !defined(PROTO)
+
+static int im_is_active = FALSE; /* IM is enabled for current mode */
+static int im_preedit_cursor = 0; /* cursor offset in characters */
+static int im_preedit_trailing = 0; /* number of characters after cursor */
+
+static unsigned long im_commit_handler_id = 0;
+static unsigned int im_activatekey_keyval = GDK_VoidSymbol;
+static unsigned int im_activatekey_state = 0;
+
+ void
+im_set_active(int active)
+{
+ int was_active;
+
+ was_active = !!im_is_active;
+ im_is_active = (active && !p_imdisable);
+
+ if (im_is_active != was_active)
+ xim_reset();
+}
+
+ void
+xim_set_focus(int focus)
+{
+ if (xic != NULL)
+ {
+ if (focus)
+ gtk_im_context_focus_in(xic);
+ else
+ gtk_im_context_focus_out(xic);
+ }
+}
+
+ void
+im_set_position(int row, int col)
+{
+ if (xic != NULL)
+ {
+ GdkRectangle area;
+
+ area.x = FILL_X(col);
+ area.y = FILL_Y(row);
+ area.width = gui.char_width * (mb_lefthalve(row, col) ? 2 : 1);
+ area.height = gui.char_height;
+
+ gtk_im_context_set_cursor_location(xic, &area);
+ }
+}
+
+# if 0 || defined(PROTO) /* apparently only used in gui_x11.c */
+ void
+xim_set_preedit(void)
+{
+ im_set_position(gui.row, gui.col);
+}
+# endif
+
+ static void
+im_add_to_input(char_u *str, int len)
+{
+ /* Convert from 'termencoding' (always "utf-8") to 'encoding' */
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ str = string_convert(&input_conv, str, &len);
+ g_return_if_fail(str != NULL);
+ }
+
+ add_to_input_buf_csi(str, len);
+
+ if (input_conv.vc_type != CONV_NONE)
+ vim_free(str);
+
+ if (p_mh) /* blank out the pointer if necessary */
+ gui_mch_mousehide(TRUE);
+}
+
+ static void
+im_delete_preedit(void)
+{
+ char_u bskey[] = {CSI, 'k', 'b'};
+ char_u delkey[] = {CSI, 'k', 'D'};
+
+ if (State & NORMAL)
+ {
+ im_preedit_cursor = 0;
+ return;
+ }
+ for (; im_preedit_cursor > 0; --im_preedit_cursor)
+ add_to_input_buf(bskey, (int)sizeof(bskey));
+
+ for (; im_preedit_trailing > 0; --im_preedit_trailing)
+ add_to_input_buf(delkey, (int)sizeof(delkey));
+}
+
+ static void
+im_correct_cursor(int num_move_back)
+{
+ char_u backkey[] = {CSI, 'k', 'l'};
+
+ if (State & NORMAL)
+ return;
+# ifdef FEAT_RIGHTLEFT
+ if ((State & CMDLINE) == 0 && curwin != NULL && curwin->w_p_rl)
+ backkey[2] = 'r';
+# endif
+ for (; num_move_back > 0; --num_move_back)
+ add_to_input_buf(backkey, (int)sizeof(backkey));
+}
+
+static int xim_expected_char = NUL;
+static int xim_ignored_char = FALSE;
+
+/*
+ * Update the mode and cursor while in an IM callback.
+ */
+ static void
+im_show_info(void)
+{
+ int old_vgetc_busy;
+ old_vgetc_busy = vgetc_busy;
+ vgetc_busy = TRUE;
+ showmode();
+ vgetc_busy = old_vgetc_busy;
+ setcursor();
+ out_flush();
+}
+
+/*
+ * Callback invoked when the user finished preediting.
+ * Put the final string into the input buffer.
+ */
+/*ARGSUSED0*/
+ static void
+im_commit_cb(GtkIMContext *context, const gchar *str, gpointer data)
+{
+ int slen = (int)STRLEN(str);
+ int add_to_input = TRUE;
+ int clen;
+ int len = slen;
+ int commit_with_preedit = TRUE;
+ char_u *im_str, *p;
+
+#ifdef XIM_DEBUG
+ xim_log("im_commit_cb(): %s\n", str);
+#endif
+
+ /* The imhangul module doesn't reset the preedit string before
+ * committing. Call im_delete_preedit() to work around that. */
+ im_delete_preedit();
+
+ /* Indicate that preediting has finished. */
+ if (preedit_start_col == MAXCOL)
+ {
+ init_preedit_start_col();
+ commit_with_preedit = FALSE;
+ }
+
+ /* The thing which setting "preedit_start_col" to MAXCOL means that
+ * "preedit_start_col" will be set forcely when calling
+ * preedit_changed_cb() next time.
+ * "preedit_start_col" should not reset with MAXCOL on this part. Vim
+ * is simulating the preediting by using add_to_input_str(). when
+ * preedit begin immediately before committed, the typebuf is not
+ * flushed to screen, then it can't get correct "preedit_start_col".
+ * Thus, it should calculate the cells by adding cells of the committed
+ * string. */
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ im_str = string_convert(&input_conv, (char_u *)str, &len);
+ g_return_if_fail(im_str != NULL);
+ }
+ else
+ im_str = (char_u *)str;
+ clen = 0;
+ for (p = im_str; p < im_str + len; p += (*mb_ptr2len_check)(p))
+ clen += (*mb_ptr2cells)(p);
+ if (input_conv.vc_type != CONV_NONE)
+ vim_free(im_str);
+ preedit_start_col += clen;
+
+ /* Is this a single character that matches a keypad key that's just
+ * been pressed? If so, we don't want it to be entered as such - let
+ * us carry on processing the raw keycode so that it may be used in
+ * mappings as <kSomething>. */
+ if (xim_expected_char != NUL)
+ {
+ /* We're currently processing a keypad or other special key */
+ if (slen == 1 && str[0] == xim_expected_char)
+ {
+ /* It's a match - don't do it here */
+ xim_ignored_char = TRUE;
+ add_to_input = FALSE;
+ }
+ else
+ {
+ /* Not a match */
+ xim_ignored_char = FALSE;
+ }
+ }
+
+ if (add_to_input)
+ im_add_to_input((char_u *)str, slen);
+
+ /* Inserting chars while "im_is_active" is set does not cause a change of
+ * buffer. When the chars are committed the buffer must be marked as
+ * changed. */
+ if (!commit_with_preedit)
+ preedit_start_col = MAXCOL;
+
+ /* This flag is used in changed() at next call. */
+ xim_changed_while_preediting = TRUE;
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * Callback invoked after start to the preedit.
+ */
+/*ARGSUSED*/
+ static void
+im_preedit_start_cb(GtkIMContext *context, gpointer data)
+{
+#ifdef XIM_DEBUG
+ xim_log("im_preedit_start_cb()\n");
+#endif
+
+ im_is_active = TRUE;
+ gui_update_cursor(TRUE, FALSE);
+}
+
+/*
+ * Callback invoked after end to the preedit.
+ */
+/*ARGSUSED*/
+ static void
+im_preedit_end_cb(GtkIMContext *context, gpointer data)
+{
+#ifdef XIM_DEBUG
+ xim_log("im_preedit_end_cb()\n");
+#endif
+ im_delete_preedit();
+
+ /* Indicate that preediting has finished */
+ preedit_start_col = MAXCOL;
+ xim_has_preediting = FALSE;
+
+ im_is_active = FALSE;
+ gui_update_cursor(TRUE, FALSE);
+ im_show_info();
+}
+
+/*
+ * Callback invoked after changes to the preedit string. If the preedit
+ * string was empty before, remember the preedit start column so we know
+ * where to apply feedback attributes. Delete the previous preedit string
+ * if there was one, save the new preedit cursor offset, and put the new
+ * string into the input buffer.
+ *
+ * TODO: The pragmatic "put into input buffer" approach used here has
+ * several fundamental problems:
+ *
+ * - The characters in the preedit string are subject to remapping.
+ * That's broken, only the finally committed string should be remapped.
+ *
+ * - There is a race condition involved: The retrieved value for the
+ * current cursor position will be wrong if any unprocessed characters
+ * are still queued in the input buffer.
+ *
+ * - Due to the lack of synchronization between the file buffer in memory
+ * and any typed characters, it's practically impossible to implement the
+ * "retrieve_surrounding" and "delete_surrounding" signals reliably. IM
+ * modules for languages such as Thai are likely to rely on this feature
+ * for proper operation.
+ *
+ * Conclusions: I think support for preediting needs to be moved to the
+ * core parts of Vim. Ideally, until it has been committed, the preediting
+ * string should only be displayed and not affect the buffer content at all.
+ * The question how to deal with the synchronization issue still remains.
+ * Circumventing the input buffer is probably not desirable. Anyway, I think
+ * implementing "retrieve_surrounding" is the only hard problem.
+ *
+ * One way to solve all of this in a clean manner would be to queue all key
+ * press/release events "as is" in the input buffer, and apply the IM filtering
+ * at the receiving end of the queue. This, however, would have a rather large
+ * impact on the code base. If there is an easy way to force processing of all
+ * remaining input from within the "retrieve_surrounding" signal handler, this
+ * might not be necessary. Gotta ask on vim-dev for opinions.
+ */
+/*ARGSUSED1*/
+ static void
+im_preedit_changed_cb(GtkIMContext *context, gpointer data)
+{
+ char *preedit_string = NULL;
+ int cursor_index = 0;
+ int num_move_back = 0;
+ char_u *str;
+ char_u *p;
+ int i;
+
+ gtk_im_context_get_preedit_string(context,
+ &preedit_string, NULL,
+ &cursor_index);
+
+#ifdef XIM_DEBUG
+ xim_log("im_preedit_changed_cb(): %s\n", preedit_string);
+#endif
+
+ g_return_if_fail(preedit_string != NULL); /* just in case */
+
+ /* If preedit_start_col is MAXCOL set it to the current cursor position. */
+ if (preedit_start_col == MAXCOL && preedit_string[0] != '\0')
+ {
+ xim_has_preediting = TRUE;
+
+ /* Urgh, this breaks if the input buffer isn't empty now */
+ init_preedit_start_col();
+ }
+ else if (cursor_index == 0 && preedit_string[0] == '\0')
+ {
+ if (preedit_start_col == MAXCOL)
+ xim_has_preediting = FALSE;
+
+ /* If at the start position (after typing backspace)
+ * preedit_start_col must be reset. */
+ preedit_start_col = MAXCOL;
+ }
+
+ im_delete_preedit();
+
+ /*
+ * Compute the end of the preediting area: "preedit_end_col".
+ * According to the documentation of gtk_im_context_get_preedit_string(),
+ * the cursor_pos output argument returns the offset in bytes. This is
+ * unfortunately not true -- real life shows the offset is in characters,
+ * and the GTK+ source code agrees with me. Will file a bug later.
+ */
+ if (preedit_start_col != MAXCOL)
+ preedit_end_col = preedit_start_col;
+ str = (char_u *)preedit_string;
+ for (p = str, i = 0; *p != NUL; p += utf_byte2len(*p), ++i)
+ {
+ int is_composing;
+
+ is_composing = ((*p & 0x80) != 0 && utf_iscomposing(utf_ptr2char(p)));
+ /*
+ * These offsets are used as counters when generating <BS> and <Del>
+ * to delete the preedit string. So don't count composing characters
+ * unless 'delcombine' is enabled.
+ */
+ if (!is_composing || p_deco)
+ {
+ if (i < cursor_index)
+ ++im_preedit_cursor;
+ else
+ ++im_preedit_trailing;
+ }
+ if (!is_composing && i >= cursor_index)
+ {
+ /* This is essentially the same as im_preedit_trailing, except
+ * composing characters are not counted even if p_deco is set. */
+ ++num_move_back;
+ }
+ if (preedit_start_col != MAXCOL)
+ preedit_end_col += utf_ptr2cells(p);
+ }
+
+ if (p > str)
+ {
+ im_add_to_input(str, (int)(p - str));
+ im_correct_cursor(num_move_back);
+ }
+
+ g_free(preedit_string);
+
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * Translate the Pango attributes at iter to Vim highlighting attributes.
+ * Ignore attributes not supported by Vim highlighting. This shouldn't have
+ * too much impact -- right now we handle even more attributes than necessary
+ * for the IM modules I tested with.
+ */
+ static int
+translate_pango_attributes(PangoAttrIterator *iter)
+{
+ PangoAttribute *attr;
+ int char_attr = HL_NORMAL;
+
+ attr = pango_attr_iterator_get(iter, PANGO_ATTR_UNDERLINE);
+ if (attr != NULL && ((PangoAttrInt *)attr)->value
+ != (int)PANGO_UNDERLINE_NONE)
+ char_attr |= HL_UNDERLINE;
+
+ attr = pango_attr_iterator_get(iter, PANGO_ATTR_WEIGHT);
+ if (attr != NULL && ((PangoAttrInt *)attr)->value >= (int)PANGO_WEIGHT_BOLD)
+ char_attr |= HL_BOLD;
+
+ attr = pango_attr_iterator_get(iter, PANGO_ATTR_STYLE);
+ if (attr != NULL && ((PangoAttrInt *)attr)->value
+ != (int)PANGO_STYLE_NORMAL)
+ char_attr |= HL_ITALIC;
+
+ attr = pango_attr_iterator_get(iter, PANGO_ATTR_BACKGROUND);
+ if (attr != NULL)
+ {
+ const PangoColor *color = &((PangoAttrColor *)attr)->color;
+
+ /* Assume inverse if black background is requested */
+ if ((color->red | color->green | color->blue) == 0)
+ char_attr |= HL_INVERSE;
+ }
+
+ return char_attr;
+}
+
+/*
+ * Retrieve the highlighting attributes at column col in the preedit string.
+ * Return -1 if not in preediting mode or if col is out of range.
+ */
+ int
+im_get_feedback_attr(int col)
+{
+ char *preedit_string = NULL;
+ PangoAttrList *attr_list = NULL;
+ int char_attr = -1;
+
+ if (xic == NULL)
+ return char_attr;
+
+ gtk_im_context_get_preedit_string(xic, &preedit_string, &attr_list, NULL);
+
+ if (preedit_string != NULL && attr_list != NULL)
+ {
+ int index;
+
+ /* Get the byte index as used by PangoAttrIterator */
+ for (index = 0; col > 0 && preedit_string[index] != '\0'; --col)
+ index += utfc_ptr2len_check((char_u *)preedit_string + index);
+
+ if (preedit_string[index] != '\0')
+ {
+ PangoAttrIterator *iter;
+ int start, end;
+
+ char_attr = HL_NORMAL;
+ iter = pango_attr_list_get_iterator(attr_list);
+
+ /* Extract all relevant attributes from the list. */
+ do
+ {
+ pango_attr_iterator_range(iter, &start, &end);
+
+ if (index >= start && index < end)
+ char_attr |= translate_pango_attributes(iter);
+ }
+ while (pango_attr_iterator_next(iter));
+
+ pango_attr_iterator_destroy(iter);
+ }
+ }
+
+ if (attr_list != NULL)
+ pango_attr_list_unref(attr_list);
+ g_free(preedit_string);
+
+ return char_attr;
+}
+
+ void
+xim_init(void)
+{
+#ifdef XIM_DEBUG
+ xim_log("xim_init()\n");
+#endif
+
+ g_return_if_fail(gui.drawarea != NULL);
+ g_return_if_fail(gui.drawarea->window != NULL);
+
+ xic = gtk_im_multicontext_new();
+ g_object_ref(xic);
+
+ im_commit_handler_id = g_signal_connect(G_OBJECT(xic), "commit",
+ G_CALLBACK(&im_commit_cb), NULL);
+ g_signal_connect(G_OBJECT(xic), "preedit_changed",
+ G_CALLBACK(&im_preedit_changed_cb), NULL);
+ g_signal_connect(G_OBJECT(xic), "preedit_start",
+ G_CALLBACK(&im_preedit_start_cb), NULL);
+ g_signal_connect(G_OBJECT(xic), "preedit_end",
+ G_CALLBACK(&im_preedit_end_cb), NULL);
+
+ gtk_im_context_set_client_window(xic, gui.drawarea->window);
+}
+
+ void
+im_shutdown(void)
+{
+#ifdef XIM_DEBUG
+ xim_log("im_shutdown()\n");
+#endif
+
+ if (xic != NULL)
+ {
+ gtk_im_context_focus_out(xic);
+ g_object_unref(xic);
+ xic = NULL;
+ }
+ im_is_active = FALSE;
+ im_commit_handler_id = 0;
+ preedit_start_col = MAXCOL;
+ xim_has_preediting = FALSE;
+}
+
+/*
+ * Convert the string argument to keyval and state for GdkEventKey.
+ * If str is valid return TRUE, otherwise FALSE.
+ *
+ * See 'imactivatekey' for documentation of the format.
+ */
+ static int
+im_string_to_keyval(const char *str, unsigned int *keyval, unsigned int *state)
+{
+ const char *mods_end;
+ unsigned tmp_keyval;
+ unsigned tmp_state = 0;
+
+ mods_end = strrchr(str, '-');
+ mods_end = (mods_end != NULL) ? mods_end + 1 : str;
+
+ /* Parse modifier keys */
+ while (str < mods_end)
+ switch (*str++)
+ {
+ case '-': break;
+ case 'S': case 's': tmp_state |= (unsigned)GDK_SHIFT_MASK; break;
+ case 'L': case 'l': tmp_state |= (unsigned)GDK_LOCK_MASK; break;
+ case 'C': case 'c': tmp_state |= (unsigned)GDK_CONTROL_MASK;break;
+ case '1': tmp_state |= (unsigned)GDK_MOD1_MASK; break;
+ case '2': tmp_state |= (unsigned)GDK_MOD2_MASK; break;
+ case '3': tmp_state |= (unsigned)GDK_MOD3_MASK; break;
+ case '4': tmp_state |= (unsigned)GDK_MOD4_MASK; break;
+ case '5': tmp_state |= (unsigned)GDK_MOD5_MASK; break;
+ default:
+ return FALSE;
+ }
+
+ tmp_keyval = gdk_keyval_from_name(str);
+
+ if (tmp_keyval == 0 || tmp_keyval == GDK_VoidSymbol)
+ return FALSE;
+
+ if (keyval != NULL)
+ *keyval = tmp_keyval;
+ if (state != NULL)
+ *state = tmp_state;
+
+ return TRUE;
+}
+
+/*
+ * Return TRUE if p_imak is valid, otherwise FALSE. As a special case, an
+ * empty string is also regarded as valid.
+ *
+ * Note: The numerical key value of p_imak is cached if it was valid; thus
+ * boldly assuming im_xim_isvalid_imactivate() will always be called whenever
+ * 'imak' changes. This is currently the case but not obvious -- should
+ * probably rename the function for clarity.
+ */
+ int
+im_xim_isvalid_imactivate(void)
+{
+ if (p_imak[0] == NUL)
+ {
+ im_activatekey_keyval = GDK_VoidSymbol;
+ im_activatekey_state = 0;
+ return TRUE;
+ }
+
+ return im_string_to_keyval((const char *)p_imak,
+ &im_activatekey_keyval,
+ &im_activatekey_state);
+}
+
+ static void
+im_synthesize_keypress(unsigned int keyval, unsigned int state)
+{
+ GdkEventKey *event;
+
+# ifdef HAVE_GTK_MULTIHEAD
+ event = (GdkEventKey *)gdk_event_new(GDK_KEY_PRESS);
+ g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
+# else
+ event = (GdkEventKey *)g_malloc0((gulong)sizeof(GdkEvent));
+ event->type = GDK_KEY_PRESS;
+# endif
+ event->window = gui.drawarea->window;
+ event->send_event = TRUE;
+ event->time = GDK_CURRENT_TIME;
+ event->state = state;
+ event->keyval = keyval;
+ event->hardware_keycode = /* needed for XIM */
+ XKeysymToKeycode(GDK_WINDOW_XDISPLAY(event->window), (KeySym)keyval);
+ event->length = 0;
+ event->string = NULL;
+
+ gtk_im_context_filter_keypress(xic, event);
+
+ /* For consistency, also send the corresponding release event. */
+ event->type = GDK_KEY_RELEASE;
+ event->send_event = FALSE;
+ gtk_im_context_filter_keypress(xic, event);
+
+# ifdef HAVE_GTK_MULTIHEAD
+ gdk_event_free((GdkEvent *)event);
+# else
+ g_free(event);
+# endif
+}
+
+ void
+xim_reset(void)
+{
+ if (xic != NULL)
+ {
+ /*
+ * The third-party imhangul module (and maybe others too) ignores
+ * gtk_im_context_reset() or at least doesn't reset the active state.
+ * Thus sending imactivatekey would turn it off if it was on before,
+ * which is clearly not what we want. Fortunately we can work around
+ * that for imhangul by sending GDK_Escape, but I don't know if it
+ * works with all IM modules that support an activation key :/
+ *
+ * An alternative approach would be to destroy the IM context and
+ * recreate it. But that means loading/unloading the IM module on
+ * every mode switch, which causes a quite noticable delay even on
+ * my rather fast box...
+ * *
+ * Moreover, there are some XIM which cannot respond to
+ * im_synthesize_keypress(). we hope that they reset by
+ * xim_shutdown().
+ */
+ if (im_activatekey_keyval != GDK_VoidSymbol && im_is_active)
+ im_synthesize_keypress(GDK_Escape, 0U);
+
+ gtk_im_context_reset(xic);
+
+ /*
+ * HACK for Ami: This sequence of function calls makes Ami handle
+ * the IM reset gratiously, without breaking loads of other stuff.
+ * It seems to force English mode as well, which is exactly what we
+ * want because it makes the Ami status display work reliably.
+ */
+ gtk_im_context_set_use_preedit(xic, FALSE);
+
+ if (p_imdisable)
+ im_shutdown();
+ else
+ {
+ gtk_im_context_set_use_preedit(xic, TRUE);
+ xim_set_focus(gui.in_focus);
+
+ if (im_activatekey_keyval != GDK_VoidSymbol)
+ {
+ if (im_is_active)
+ {
+ g_signal_handler_block(xic, im_commit_handler_id);
+ im_synthesize_keypress(im_activatekey_keyval,
+ im_activatekey_state);
+ g_signal_handler_unblock(xic, im_commit_handler_id);
+ }
+ }
+ else
+ {
+ im_shutdown();
+ xim_init();
+ xim_set_focus(gui.in_focus);
+ }
+ }
+ }
+
+ preedit_start_col = MAXCOL;
+ xim_has_preediting = FALSE;
+}
+
+ int
+xim_queue_key_press_event(GdkEventKey *event, int down)
+{
+ if (down)
+ {
+ /*
+ * Workaround GTK2 XIM 'feature' that always converts keypad keys to
+ * chars., even when not part of an IM sequence (ref. feature of
+ * gdk/gdkkeyuni.c).
+ * Flag any keypad keys that might represent a single char.
+ * If this (on its own - i.e., not part of an IM sequence) is
+ * committed while we're processing one of these keys, we can ignore
+ * that commit and go ahead & process it ourselves. That way we can
+ * still distinguish keypad keys for use in mappings.
+ */
+ switch (event->keyval)
+ {
+ case GDK_KP_Add: xim_expected_char = '+'; break;
+ case GDK_KP_Subtract: xim_expected_char = '-'; break;
+ case GDK_KP_Divide: xim_expected_char = '/'; break;
+ case GDK_KP_Multiply: xim_expected_char = '*'; break;
+ case GDK_KP_Decimal: xim_expected_char = '.'; break;
+ case GDK_KP_Equal: xim_expected_char = '='; break;
+ case GDK_KP_0: xim_expected_char = '0'; break;
+ case GDK_KP_1: xim_expected_char = '1'; break;
+ case GDK_KP_2: xim_expected_char = '2'; break;
+ case GDK_KP_3: xim_expected_char = '3'; break;
+ case GDK_KP_4: xim_expected_char = '4'; break;
+ case GDK_KP_5: xim_expected_char = '5'; break;
+ case GDK_KP_6: xim_expected_char = '6'; break;
+ case GDK_KP_7: xim_expected_char = '7'; break;
+ case GDK_KP_8: xim_expected_char = '8'; break;
+ case GDK_KP_9: xim_expected_char = '9'; break;
+ default: xim_expected_char = NUL;
+ }
+ xim_ignored_char = FALSE;
+ }
+
+ /*
+ * When typing fFtT, XIM may be activated. Thus it must pass
+ * gtk_im_context_filter_keypress() in Normal mode.
+ * And while doing :sh too.
+ */
+ if (xic != NULL && !p_imdisable
+ && (State & (INSERT | CMDLINE | NORMAL | EXTERNCMD)) != 0)
+ {
+ /*
+ * Filter 'imactivatekey' and map it to CTRL-^. This way, Vim is
+ * always aware of the current status of IM, and can even emulate
+ * the activation key for modules that don't support one.
+ */
+ if (event->keyval == im_activatekey_keyval
+ && (event->state & im_activatekey_state) == im_activatekey_state)
+ {
+ unsigned int state_mask;
+
+ /* Require the state of the 3 most used modifiers to match exactly.
+ * Otherwise e.g. <S-C-space> would be unusable for other purposes
+ * if the IM activate key is <S-space>. */
+ state_mask = im_activatekey_state;
+ state_mask |= ((int)GDK_SHIFT_MASK | (int)GDK_CONTROL_MASK
+ | (int)GDK_MOD1_MASK);
+
+ if ((event->state & state_mask) != im_activatekey_state)
+ return FALSE;
+
+ /* Don't send it a second time on GDK_KEY_RELEASE. */
+ if (event->type != GDK_KEY_PRESS)
+ return TRUE;
+
+ if (map_to_exists_mode((char_u *)"", LANGMAP))
+ {
+ im_set_active(FALSE);
+
+ /* ":lmap" mappings exists, toggle use of mappings. */
+ State ^= LANGMAP;
+ if (State & LANGMAP)
+ {
+ curbuf->b_p_iminsert = B_IMODE_NONE;
+ State &= ~LANGMAP;
+ }
+ else
+ {
+ curbuf->b_p_iminsert = B_IMODE_LMAP;
+ State |= LANGMAP;
+ }
+ return TRUE;
+ }
+
+ return gtk_im_context_filter_keypress(xic, event);
+ }
+
+ /* Don't filter events through the IM context if IM isn't active
+ * right now. Unlike with GTK+ 1.2 we cannot rely on the IM module
+ * not doing anything before the activation key was sent. */
+ if (im_activatekey_keyval == GDK_VoidSymbol || im_is_active)
+ {
+ int imresult = gtk_im_context_filter_keypress(xic, event);
+
+ /* Some XIM send following sequence:
+ * 1. preedited string.
+ * 2. committed string.
+ * 3. line changed key.
+ * 4. preedited string.
+ * 5. remove preedited string.
+ * if 3, Vim can't move back the above line for 5.
+ * thus, this part should not parse the key. */
+ if (!imresult && preedit_start_col != MAXCOL
+ && event->keyval == GDK_Return)
+ {
+ im_synthesize_keypress(GDK_Return, 0U);
+ return FALSE;
+ }
+
+ /* If XIM tried to commit a keypad key as a single char.,
+ * ignore it so we can use the keypad key 'raw', for mappings. */
+ if (xim_expected_char != NUL && xim_ignored_char)
+ /* We had a keypad key, and XIM tried to thieve it */
+ return FALSE;
+
+ /* Normal processing */
+ return imresult;
+ }
+ }
+
+ return FALSE;
+}
+
+ int
+im_get_status(void)
+{
+ return im_is_active;
+}
+
+# else /* !HAVE_GTK2 */
+
+static int xim_is_active = FALSE; /* XIM should be active in the current
+ mode */
+static int xim_has_focus = FALSE; /* XIM is really being used for Vim */
+#ifdef FEAT_GUI_X11
+static XIMStyle input_style;
+static int status_area_enabled = TRUE;
+#endif
+
+#ifdef FEAT_GUI_GTK
+# ifdef WIN3264
+# include <gdk/gdkwin32.h>
+# else
+# include <gdk/gdkx.h>
+# endif
+#else
+# ifdef PROTO
+/* Define a few things to be able to generate prototypes while not configured
+ * for GTK. */
+# define GSList int
+# define gboolean int
+ typedef int GdkEvent;
+ typedef int GdkEventKey;
+# define GdkIC int
+# endif
+#endif
+
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
+static int preedit_buf_len = 0;
+static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */
+static int xim_input_style;
+#ifndef FEAT_GUI_GTK
+# define gboolean int
+#endif
+static gboolean use_status_area = 0;
+
+static int im_xim_str2keycode __ARGS((unsigned int *code, unsigned int *state));
+static void im_xim_send_event_imactivate __ARGS((void));
+
+/*
+ * Convert string to keycode and state for XKeyEvent.
+ * When string is valid return OK, when invalid return FAIL.
+ *
+ * See 'imactivatekey' documentation for the format.
+ */
+ static int
+im_xim_str2keycode(code, state)
+ unsigned int *code;
+ unsigned int *state;
+{
+ int retval = OK;
+ int len;
+ unsigned keycode = 0, keystate = 0;
+ Window window;
+ Display *display;
+ char_u *flag_end;
+ char_u *str;
+
+ if (*p_imak != NUL)
+ {
+ len = STRLEN(p_imak);
+ for (flag_end = p_imak + len - 1;
+ flag_end > p_imak && *flag_end != '-'; --flag_end)
+ ;
+
+ /* Parse modifier keys */
+ for (str = p_imak; str < flag_end; ++str)
+ {
+ switch (*str)
+ {
+ case 's': case 'S':
+ keystate |= ShiftMask;
+ break;
+ case 'l': case 'L':
+ keystate |= LockMask;
+ break;
+ case 'c': case 'C':
+ keystate |= ControlMask;
+ break;
+ case '1':
+ keystate |= Mod1Mask;
+ break;
+ case '2':
+ keystate |= Mod2Mask;
+ break;
+ case '3':
+ keystate |= Mod3Mask;
+ break;
+ case '4':
+ keystate |= Mod4Mask;
+ break;
+ case '5':
+ keystate |= Mod5Mask;
+ break;
+ case '-':
+ break;
+ default:
+ retval = FAIL;
+ }
+ }
+ if (*str == '-')
+ ++str;
+
+ /* Get keycode from string. */
+ gui_get_x11_windis(&window, &display);
+ if (display)
+ keycode = XKeysymToKeycode(display, XStringToKeysym((char *)str));
+ if (keycode == 0)
+ retval = FAIL;
+
+ if (code != NULL)
+ *code = keycode;
+ if (state != NULL)
+ *state = keystate;
+ }
+ return retval;
+}
+
+ static void
+im_xim_send_event_imactivate()
+{
+ /* Force turn on preedit state by symulate keypress event.
+ * Keycode and state is specified by 'imactivatekey'.
+ */
+ XKeyEvent ev;
+
+ gui_get_x11_windis(&ev.window, &ev.display);
+ ev.root = RootWindow(ev.display, DefaultScreen(ev.display));
+ ev.subwindow = None;
+ ev.time = CurrentTime;
+ ev.x = 1;
+ ev.y = 1;
+ ev.x_root = 1;
+ ev.y_root = 1;
+ ev.same_screen = 1;
+ ev.type = KeyPress;
+ if (im_xim_str2keycode(&ev.keycode, &ev.state) == OK)
+ XSendEvent(ev.display, ev.window, 1, KeyPressMask, (XEvent*)&ev);
+}
+
+/*
+ * Return TRUE if 'imactivatekey' has a valid value.
+ */
+ int
+im_xim_isvalid_imactivate()
+{
+ return im_xim_str2keycode(NULL, NULL) == OK;
+}
+#endif /* FEAT_GUI_GTK */
+
+/*
+ * Switch using XIM on/off. This is used by the code that changes "State".
+ */
+ void
+im_set_active(active)
+ int active;
+{
+ if (xic == NULL)
+ return;
+
+ /* If 'imdisable' is set, XIM is never active. */
+ if (p_imdisable)
+ active = FALSE;
+#ifndef FEAT_GUI_GTK
+ else if (input_style & XIMPreeditPosition)
+ /* There is a problem in switching XIM off when preediting is used,
+ * and it is not clear how this can be solved. For now, keep XIM on
+ * all the time, like it was done in Vim 5.8. */
+ active = TRUE;
+#endif
+
+ /* Remember the active state, it is needed when Vim gets keyboard focus. */
+ xim_is_active = active;
+
+#ifdef FEAT_GUI_GTK
+ /* When 'imactivatekey' has valid key-string, try to control XIM preedit
+ * state. When 'imactivatekey' has no or invalid string, try old XIM
+ * focus control.
+ */
+ if (*p_imak != NUL)
+ {
+ /* BASIC STRATEGY:
+ * Destroy old Input Context (XIC), and create new one. New XIC
+ * would have a state of preedit that is off. When argument:active
+ * is false, that's all. Else argument:active is true, send a key
+ * event specified by 'imactivatekey' to activate XIM preedit state.
+ */
+
+ xim_is_active = TRUE; /* Disable old XIM focus control */
+ /* If we can monitor preedit state with preedit callback functions,
+ * try least creation of new XIC.
+ */
+ if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
+ {
+ if (xim_can_preediting && !active)
+ {
+ /* Force turn off preedit state. With some IM
+ * implementations, we cannot turn off preedit state by
+ * symulate keypress event. It is why using such a method
+ * that destroy old IC (input context), and create new one.
+ * When create new IC, its preedit state is usually off.
+ */
+ xim_reset();
+ xim_set_focus(FALSE);
+ gdk_ic_destroy(xic);
+ xim_init();
+ xim_can_preediting = FALSE;
+ }
+ else if (!xim_can_preediting && active)
+ im_xim_send_event_imactivate();
+ }
+ else
+ {
+ /* First, force destroy old IC, and create new one. It
+ * symulates "turning off preedit state".
+ */
+ xim_set_focus(FALSE);
+ gdk_ic_destroy(xic);
+ xim_init();
+ xim_can_preediting = FALSE;
+
+ /* 2nd, when requested to activate IM, symulate this by sending
+ * the event.
+ */
+ if (active)
+ {
+ im_xim_send_event_imactivate();
+ xim_can_preediting = TRUE;
+ }
+ }
+ }
+ else
+ {
+# ifndef XIMPreeditUnKnown
+ /* X11R5 doesn't have these, it looks safe enough to define here. */
+ typedef unsigned long XIMPreeditState;
+# define XIMPreeditUnKnown 0L
+# define XIMPreeditEnable 1L
+# define XIMPreeditDisable (1L<<1)
+# define XNPreeditState "preeditState"
+# endif
+ XIMPreeditState preedit_state = XIMPreeditUnKnown;
+ XVaNestedList preedit_attr;
+ XIC pxic;
+
+ preedit_attr = XVaCreateNestedList(0,
+ XNPreeditState, &preedit_state,
+ NULL);
+ pxic = ((GdkICPrivate *)xic)->xic;
+
+ if (!XGetICValues(pxic, XNPreeditAttributes, preedit_attr, NULL))
+ {
+ XFree(preedit_attr);
+ preedit_attr = XVaCreateNestedList(0,
+ XNPreeditState,
+ active ? XIMPreeditEnable : XIMPreeditDisable,
+ NULL);
+ XSetICValues(pxic, XNPreeditAttributes, preedit_attr, NULL);
+ xim_can_preediting = active;
+ xim_is_active = active;
+ }
+ XFree(preedit_attr);
+ }
+ if (xim_input_style & XIMPreeditCallbacks)
+ {
+ preedit_buf_len = 0;
+ init_preedit_start_col();
+ }
+#else
+# if 0
+ /* When had tested kinput2 + canna + Athena GUI version with
+ * 'imactivatekey' is "s-space", im_xim_send_event_imactivate() did not
+ * work correctly. It just inserted one space. I don't know why we
+ * couldn't switch state of XIM preediting. This is reason why these
+ * codes are commented out.
+ */
+ /* First, force destroy old IC, and create new one. It symulates
+ * "turning off preedit state".
+ */
+ xim_set_focus(FALSE);
+ XDestroyIC(xic);
+ xic = NULL;
+ xim_init();
+
+ /* 2nd, when requested to activate IM, symulate this by sending the
+ * event.
+ */
+ if (active)
+ im_xim_send_event_imactivate();
+# endif
+#endif
+ xim_set_preedit();
+}
+
+/*
+ * Adjust using XIM for gaining or losing keyboard focus. Also called when
+ * "xim_is_active" changes.
+ */
+ void
+xim_set_focus(focus)
+ int focus;
+{
+ if (xic == NULL)
+ return;
+
+ /*
+ * XIM only gets focus when the Vim window has keyboard focus and XIM has
+ * been set active for the current mode.
+ */
+ if (focus && xim_is_active)
+ {
+ if (!xim_has_focus)
+ {
+ xim_has_focus = TRUE;
+#ifdef FEAT_GUI_GTK
+ gdk_im_begin(xic, gui.drawarea->window);
+#else
+ XSetICFocus(xic);
+#endif
+ }
+ }
+ else
+ {
+ if (xim_has_focus)
+ {
+ xim_has_focus = FALSE;
+#ifdef FEAT_GUI_GTK
+ gdk_im_end();
+#else
+ XUnsetICFocus(xic);
+#endif
+ }
+ }
+}
+
+/*ARGSUSED*/
+ void
+im_set_position(row, col)
+ int row;
+ int col;
+{
+ xim_set_preedit();
+}
+
+/*
+ * Set the XIM to the current cursor position.
+ */
+ void
+xim_set_preedit()
+{
+ if (xic == NULL)
+ return;
+
+ xim_set_focus(TRUE);
+
+#ifdef FEAT_GUI_GTK
+ if (gdk_im_ready())
+ {
+ int attrmask;
+ GdkICAttr *attr;
+
+ if (!xic_attr)
+ return;
+
+ attr = xic_attr;
+ attrmask = 0;
+
+# ifdef FEAT_XFONTSET
+ if ((xim_input_style & (int)GDK_IM_PREEDIT_POSITION)
+ && gui.fontset != NOFONTSET
+ && gui.fontset->type == GDK_FONT_FONTSET)
+ {
+ if (!xim_has_focus)
+ {
+ if (attr->spot_location.y >= 0)
+ {
+ attr->spot_location.x = 0;
+ attr->spot_location.y = -100;
+ attrmask |= (int)GDK_IC_SPOT_LOCATION;
+ }
+ }
+ else
+ {
+ gint width, height;
+
+ if (attr->spot_location.x != TEXT_X(gui.col)
+ || attr->spot_location.y != TEXT_Y(gui.row))
+ {
+ attr->spot_location.x = TEXT_X(gui.col);
+ attr->spot_location.y = TEXT_Y(gui.row);
+ attrmask |= (int)GDK_IC_SPOT_LOCATION;
+ }
+
+ gdk_window_get_size(gui.drawarea->window, &width, &height);
+ width -= 2 * gui.border_offset;
+ height -= 2 * gui.border_offset;
+ if (xim_input_style & (int)GDK_IM_STATUS_AREA)
+ height -= gui.char_height;
+ if (attr->preedit_area.width != width
+ || attr->preedit_area.height != height)
+ {
+ attr->preedit_area.x = gui.border_offset;
+ attr->preedit_area.y = gui.border_offset;
+ attr->preedit_area.width = width;
+ attr->preedit_area.height = height;
+ attrmask |= (int)GDK_IC_PREEDIT_AREA;
+ }
+
+ if (attr->preedit_fontset != gui.current_font)
+ {
+ attr->preedit_fontset = gui.current_font;
+ attrmask |= (int)GDK_IC_PREEDIT_FONTSET;
+ }
+ }
+ }
+# endif /* FEAT_XFONTSET */
+
+ if (xim_fg_color == INVALCOLOR)
+ {
+ xim_fg_color = gui.def_norm_pixel;
+ xim_bg_color = gui.def_back_pixel;
+ }
+ if (attr->preedit_foreground.pixel != xim_fg_color)
+ {
+ attr->preedit_foreground.pixel = xim_fg_color;
+ attrmask |= (int)GDK_IC_PREEDIT_FOREGROUND;
+ }
+ if (attr->preedit_background.pixel != xim_bg_color)
+ {
+ attr->preedit_background.pixel = xim_bg_color;
+ attrmask |= (int)GDK_IC_PREEDIT_BACKGROUND;
+ }
+
+ if (attrmask != 0)
+ gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask);
+ }
+#else /* FEAT_GUI_GTK */
+ {
+ XVaNestedList attr_list;
+ XRectangle spot_area;
+ XPoint over_spot;
+ int line_space;
+
+ if (!xim_has_focus)
+ {
+ /* hide XIM cursor */
+ over_spot.x = 0;
+ over_spot.y = -100; /* arbitrary invisible position */
+ attr_list = (XVaNestedList) XVaCreateNestedList(0,
+ XNSpotLocation,
+ &over_spot,
+ NULL);
+ XSetICValues(xic, XNPreeditAttributes, attr_list, NULL);
+ XFree(attr_list);
+ return;
+ }
+
+ if (input_style & XIMPreeditPosition)
+ {
+ if (xim_fg_color == INVALCOLOR)
+ {
+ xim_fg_color = gui.def_norm_pixel;
+ xim_bg_color = gui.def_back_pixel;
+ }
+ over_spot.x = TEXT_X(gui.col);
+ over_spot.y = TEXT_Y(gui.row);
+ spot_area.x = 0;
+ spot_area.y = 0;
+ spot_area.height = gui.char_height * Rows;
+ spot_area.width = gui.char_width * Columns;
+ line_space = gui.char_height;
+ attr_list = (XVaNestedList) XVaCreateNestedList(0,
+ XNSpotLocation, &over_spot,
+ XNForeground, (Pixel) xim_fg_color,
+ XNBackground, (Pixel) xim_bg_color,
+ XNArea, &spot_area,
+ XNLineSpace, line_space,
+ NULL);
+ if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL))
+ EMSG(_("E284: Cannot set IC values"));
+ XFree(attr_list);
+ }
+ }
+#endif /* FEAT_GUI_GTK */
+}
+
+/*
+ * Set up the status area.
+ *
+ * This should use a separate Widget, but that seems not possible, because
+ * preedit_area and status_area should be set to the same window as for the
+ * text input. Unfortunately this means the status area pollutes the text
+ * window...
+ */
+ void
+xim_set_status_area()
+{
+ if (xic == NULL)
+ return;
+
+#ifdef FEAT_GUI_GTK
+# if defined(FEAT_XFONTSET)
+ if (use_status_area)
+ {
+ GdkICAttr *attr;
+ int style;
+ gint width, height;
+ GtkWidget *widget;
+ int attrmask;
+
+ if (!xic_attr)
+ return;
+
+ attr = xic_attr;
+ attrmask = 0;
+ style = (int)gdk_ic_get_style(xic);
+ if ((style & (int)GDK_IM_STATUS_MASK) == (int)GDK_IM_STATUS_AREA)
+ {
+ if (gui.fontset != NOFONTSET
+ && gui.fontset->type == GDK_FONT_FONTSET)
+ {
+ widget = gui.mainwin;
+ gdk_window_get_size(widget->window, &width, &height);
+
+ attrmask |= (int)GDK_IC_STATUS_AREA;
+ attr->status_area.x = 0;
+ attr->status_area.y = height - gui.char_height - 1;
+ attr->status_area.width = width;
+ attr->status_area.height = gui.char_height;
+ }
+ }
+ if (attrmask != 0)
+ gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask);
+ }
+# endif
+#else
+ {
+ XVaNestedList preedit_list = 0, status_list = 0, list = 0;
+ XRectangle pre_area, status_area;
+
+ if (input_style & XIMStatusArea)
+ {
+ if (input_style & XIMPreeditArea)
+ {
+ XRectangle *needed_rect;
+
+ /* to get status_area width */
+ status_list = XVaCreateNestedList(0, XNAreaNeeded,
+ &needed_rect, NULL);
+ XGetICValues(xic, XNStatusAttributes, status_list, NULL);
+ XFree(status_list);
+
+ status_area.width = needed_rect->width;
+ }
+ else
+ status_area.width = gui.char_width * Columns;
+
+ status_area.x = 0;
+ status_area.y = gui.char_height * Rows + gui.border_offset;
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ status_area.y += gui.scrollbar_height;
+#ifdef FEAT_MENU
+ if (gui.menu_is_active)
+ status_area.y += gui.menu_height;
+#endif
+ status_area.height = gui.char_height;
+ status_list = XVaCreateNestedList(0, XNArea, &status_area, NULL);
+ }
+ else
+ {
+ status_area.x = 0;
+ status_area.y = gui.char_height * Rows + gui.border_offset;
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ status_area.y += gui.scrollbar_height;
+#ifdef FEAT_MENU
+ if (gui.menu_is_active)
+ status_area.y += gui.menu_height;
+#endif
+ status_area.width = 0;
+ status_area.height = gui.char_height;
+ }
+
+ if (input_style & XIMPreeditArea) /* off-the-spot */
+ {
+ pre_area.x = status_area.x + status_area.width;
+ pre_area.y = gui.char_height * Rows + gui.border_offset;
+ pre_area.width = gui.char_width * Columns - pre_area.x;
+ if (gui.which_scrollbars[SBAR_BOTTOM])
+ pre_area.y += gui.scrollbar_height;
+#ifdef FEAT_MENU
+ if (gui.menu_is_active)
+ pre_area.y += gui.menu_height;
+#endif
+ pre_area.height = gui.char_height;
+ preedit_list = XVaCreateNestedList(0, XNArea, &pre_area, NULL);
+ }
+ else if (input_style & XIMPreeditPosition) /* over-the-spot */
+ {
+ pre_area.x = 0;
+ pre_area.y = 0;
+ pre_area.height = gui.char_height * Rows;
+ pre_area.width = gui.char_width * Columns;
+ preedit_list = XVaCreateNestedList(0, XNArea, &pre_area, NULL);
+ }
+
+ if (preedit_list && status_list)
+ list = XVaCreateNestedList(0, XNPreeditAttributes, preedit_list,
+ XNStatusAttributes, status_list, NULL);
+ else if (preedit_list)
+ list = XVaCreateNestedList(0, XNPreeditAttributes, preedit_list,
+ NULL);
+ else if (status_list)
+ list = XVaCreateNestedList(0, XNStatusAttributes, status_list,
+ NULL);
+ else
+ list = NULL;
+
+ if (list)
+ {
+ XSetICValues(xic, XNVaNestedList, list, NULL);
+ XFree(list);
+ }
+ if (status_list)
+ XFree(status_list);
+ if (preedit_list)
+ XFree(preedit_list);
+ }
+#endif
+}
+
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+static char e_xim[] = N_("E285: Failed to create input context");
+#endif
+
+#if defined(FEAT_GUI_X11) || defined(PROTO)
+# if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun)
+# define USE_X11R6_XIM
+# endif
+
+static int xim_real_init __ARGS((Window x11_window, Display *x11_display));
+
+
+#ifdef USE_X11R6_XIM
+static void xim_instantiate_cb __ARGS((Display *display, XPointer client_data, XPointer call_data));
+static void xim_destroy_cb __ARGS((XIM im, XPointer client_data, XPointer call_data));
+
+/*ARGSUSED*/
+ static void
+xim_instantiate_cb(display, client_data, call_data)
+ Display *display;
+ XPointer client_data;
+ XPointer call_data;
+{
+ Window x11_window;
+ Display *x11_display;
+
+#ifdef XIM_DEBUG
+ xim_log("xim_instantiate_cb()\n");
+#endif
+
+ gui_get_x11_windis(&x11_window, &x11_display);
+ if (display != x11_display)
+ return;
+
+ xim_real_init(x11_window, x11_display);
+ gui_set_shellsize(FALSE, FALSE);
+ if (xic != NULL)
+ XUnregisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
+ xim_instantiate_cb, NULL);
+}
+
+/*ARGSUSED*/
+ static void
+xim_destroy_cb(im, client_data, call_data)
+ XIM im;
+ XPointer client_data;
+ XPointer call_data;
+{
+ Window x11_window;
+ Display *x11_display;
+
+#ifdef XIM_DEBUG
+ xim_log("xim_destroy_cb()\n");
+#endif
+ gui_get_x11_windis(&x11_window, &x11_display);
+
+ xic = NULL;
+ status_area_enabled = FALSE;
+
+ gui_set_shellsize(FALSE, FALSE);
+
+ XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
+ xim_instantiate_cb, NULL);
+}
+#endif
+
+ void
+xim_init()
+{
+ Window x11_window;
+ Display *x11_display;
+
+#ifdef XIM_DEBUG
+ xim_log("xim_init()\n");
+#endif
+
+ gui_get_x11_windis(&x11_window, &x11_display);
+
+ xic = NULL;
+
+ if (xim_real_init(x11_window, x11_display))
+ return;
+
+ gui_set_shellsize(FALSE, FALSE);
+
+#ifdef USE_X11R6_XIM
+ XRegisterIMInstantiateCallback(x11_display, NULL, NULL, NULL,
+ xim_instantiate_cb, NULL);
+#endif
+}
+
+ static int
+xim_real_init(x11_window, x11_display)
+ Window x11_window;
+ Display *x11_display;
+{
+ int i;
+ char *p,
+ *s,
+ *ns,
+ *end,
+ tmp[1024];
+#define IMLEN_MAX 40
+ char buf[IMLEN_MAX + 7];
+ XIM xim = NULL;
+ XIMStyles *xim_styles;
+ XIMStyle this_input_style = 0;
+ Boolean found;
+ XPoint over_spot;
+ XVaNestedList preedit_list, status_list;
+
+ input_style = 0;
+ status_area_enabled = FALSE;
+
+ if (xic != NULL)
+ return FALSE;
+
+ if (gui.rsrc_input_method != NULL && *gui.rsrc_input_method != NUL)
+ {
+ strcpy(tmp, gui.rsrc_input_method);
+ for (ns = s = tmp; ns != NULL && *s != NUL;)
+ {
+ s = (char *)skipwhite((char_u *)s);
+ if (*s == NUL)
+ break;
+ if ((ns = end = strchr(s, ',')) == NULL)
+ end = s + strlen(s);
+ while (isspace(((char_u *)end)[-1]))
+ end--;
+ *end = NUL;
+
+ if (strlen(s) <= IMLEN_MAX)
+ {
+ strcpy(buf, "@im=");
+ strcat(buf, s);
+ if ((p = XSetLocaleModifiers(buf)) != NULL && *p != NUL
+ && (xim = XOpenIM(x11_display, NULL, NULL, NULL))
+ != NULL)
+ break;
+ }
+
+ s = ns + 1;
+ }
+ }
+
+ if (xim == NULL && (p = XSetLocaleModifiers("")) != NULL && *p != NUL)
+ xim = XOpenIM(x11_display, NULL, NULL, NULL);
+
+ /* This is supposed to be useful to obtain characters through
+ * XmbLookupString() without really using a XIM. */
+ if (xim == NULL && (p = XSetLocaleModifiers("@im=none")) != NULL
+ && *p != NUL)
+ xim = XOpenIM(x11_display, NULL, NULL, NULL);
+
+ if (xim == NULL)
+ {
+ /* Only give this message when verbose is set, because too many people
+ * got this message when they didn't want to use a XIM. */
+ if (p_verbose > 0)
+ EMSG(_("E286: Failed to open input method"));
+ return FALSE;
+ }
+
+#ifdef USE_X11R6_XIM
+ {
+ XIMCallback destroy_cb;
+
+ destroy_cb.callback = xim_destroy_cb;
+ destroy_cb.client_data = NULL;
+ if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL))
+ EMSG(_("E287: Warning: Could not set destroy callback to IM"));
+ }
+#endif
+
+ if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles)
+ {
+ EMSG(_("E288: input method doesn't support any style"));
+ XCloseIM(xim);
+ return FALSE;
+ }
+
+ found = False;
+ strcpy(tmp, gui.rsrc_preedit_type_name);
+ for (s = tmp; s && !found; )
+ {
+ while (*s && isspace((unsigned char)*s))
+ s++;
+ if (!*s)
+ break;
+ if ((ns = end = strchr(s, ',')) != 0)
+ ns++;
+ else
+ end = s + strlen(s);
+ while (isspace((unsigned char)*end))
+ end--;
+ *end = '\0';
+
+ if (!strcmp(s, "OverTheSpot"))
+ this_input_style = (XIMPreeditPosition | XIMStatusArea);
+ else if (!strcmp(s, "OffTheSpot"))
+ this_input_style = (XIMPreeditArea | XIMStatusArea);
+ else if (!strcmp(s, "Root"))
+ this_input_style = (XIMPreeditNothing | XIMStatusNothing);
+
+ for (i = 0; (unsigned short)i < xim_styles->count_styles; i++)
+ {
+ if (this_input_style == xim_styles->supported_styles[i])
+ {
+ found = True;
+ break;
+ }
+ }
+ if (!found)
+ for (i = 0; (unsigned short)i < xim_styles->count_styles; i++)
+ {
+ if ((xim_styles->supported_styles[i] & this_input_style)
+ == (this_input_style & ~XIMStatusArea))
+ {
+ this_input_style &= ~XIMStatusArea;
+ found = True;
+ break;
+ }
+ }
+
+ s = ns;
+ }
+ XFree(xim_styles);
+
+ if (!found)
+ {
+ /* Only give this message when verbose is set, because too many people
+ * got this message when they didn't want to use a XIM. */
+ if (p_verbose > 0)
+ EMSG(_("E289: input method doesn't support my preedit type"));
+ XCloseIM(xim);
+ return FALSE;
+ }
+
+ over_spot.x = TEXT_X(gui.col);
+ over_spot.y = TEXT_Y(gui.row);
+ input_style = this_input_style;
+
+ /* A crash was reported when trying to pass gui.norm_font as XNFontSet,
+ * thus that has been removed. Hopefully the default works... */
+#ifdef FEAT_XFONTSET
+ if (gui.fontset != NOFONTSET)
+ {
+ preedit_list = XVaCreateNestedList(0,
+ XNSpotLocation, &over_spot,
+ XNForeground, (Pixel)gui.def_norm_pixel,
+ XNBackground, (Pixel)gui.def_back_pixel,
+ XNFontSet, (XFontSet)gui.fontset,
+ NULL);
+ status_list = XVaCreateNestedList(0,
+ XNForeground, (Pixel)gui.def_norm_pixel,
+ XNBackground, (Pixel)gui.def_back_pixel,
+ XNFontSet, (XFontSet)gui.fontset,
+ NULL);
+ }
+ else
+#endif
+ {
+ preedit_list = XVaCreateNestedList(0,
+ XNSpotLocation, &over_spot,
+ XNForeground, (Pixel)gui.def_norm_pixel,
+ XNBackground, (Pixel)gui.def_back_pixel,
+ NULL);
+ status_list = XVaCreateNestedList(0,
+ XNForeground, (Pixel)gui.def_norm_pixel,
+ XNBackground, (Pixel)gui.def_back_pixel,
+ NULL);
+ }
+
+ xic = XCreateIC(xim,
+ XNInputStyle, input_style,
+ XNClientWindow, x11_window,
+ XNFocusWindow, gui.wid,
+ XNPreeditAttributes, preedit_list,
+ XNStatusAttributes, status_list,
+ NULL);
+ XFree(status_list);
+ XFree(preedit_list);
+ if (xic != NULL)
+ {
+ if (input_style & XIMStatusArea)
+ {
+ xim_set_status_area();
+ status_area_enabled = TRUE;
+ }
+ else
+ gui_set_shellsize(FALSE, FALSE);
+ }
+ else
+ {
+ EMSG(_(e_xim));
+ XCloseIM(xim);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+#endif /* FEAT_GUI_X11 */
+
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
+
+# ifdef FEAT_XFONTSET
+static char e_overthespot[] = N_("E290: over-the-spot style requires fontset");
+# endif
+
+# ifdef PROTO
+typedef int GdkIC;
+# endif
+
+ void
+xim_decide_input_style()
+{
+ /* GDK_IM_STATUS_CALLBACKS was disabled, enabled it to allow Japanese
+ * OverTheSpot. */
+ int supported_style = (int)GDK_IM_PREEDIT_NONE |
+ (int)GDK_IM_PREEDIT_NOTHING |
+ (int)GDK_IM_PREEDIT_POSITION |
+ (int)GDK_IM_PREEDIT_CALLBACKS |
+ (int)GDK_IM_STATUS_CALLBACKS |
+ (int)GDK_IM_STATUS_AREA |
+ (int)GDK_IM_STATUS_NONE |
+ (int)GDK_IM_STATUS_NOTHING;
+
+#ifdef XIM_DEBUG
+ xim_log("xim_decide_input_style()\n");
+#endif
+
+ if (!gdk_im_ready())
+ xim_input_style = 0;
+ else
+ {
+ if (gtk_major_version > 1
+ || (gtk_major_version == 1
+ && (gtk_minor_version > 2
+ || (gtk_minor_version == 2 && gtk_micro_version >= 3))))
+ use_status_area = TRUE;
+ else
+ {
+ EMSG(_("E291: Your GTK+ is older than 1.2.3. Status area disabled"));
+ use_status_area = FALSE;
+ }
+#ifdef FEAT_XFONTSET
+ if (gui.fontset == NOFONTSET || gui.fontset->type != GDK_FONT_FONTSET)
+#endif
+ supported_style &= ~((int)GDK_IM_PREEDIT_POSITION
+ | (int)GDK_IM_STATUS_AREA);
+ if (!use_status_area)
+ supported_style &= ~(int)GDK_IM_STATUS_AREA;
+ xim_input_style = (int)gdk_im_decide_style((GdkIMStyle)supported_style);
+ }
+}
+
+/*ARGSUSED*/
+ static void
+preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+{
+#ifdef XIM_DEBUG
+ xim_log("xim_decide_input_style()\n");
+#endif
+
+ draw_feedback = NULL;
+ xim_can_preediting = TRUE;
+ xim_has_preediting = TRUE;
+ gui_update_cursor(TRUE, FALSE);
+ if (showmode() > 0)
+ {
+ setcursor();
+ out_flush();
+ }
+}
+
+ static void
+xim_back_delete(int n)
+{
+ char_u str[3];
+
+ str[0] = CSI;
+ str[1] = 'k';
+ str[2] = 'b';
+ while (n-- > 0)
+ add_to_input_buf(str, 3);
+}
+
+static GSList *key_press_event_queue = NULL;
+static gboolean processing_queued_event = FALSE;
+
+/*ARGSUSED*/
+ static void
+preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+{
+ XIMPreeditDrawCallbackStruct *draw_data;
+ XIMText *text;
+ char *src;
+ GSList *event_queue;
+
+#ifdef XIM_DEBUG
+ xim_log("preedit_draw_cbproc()\n");
+#endif
+
+ draw_data = (XIMPreeditDrawCallbackStruct *) call_data;
+ text = (XIMText *) draw_data->text;
+
+ if ((text == NULL && draw_data->chg_length == preedit_buf_len)
+ || preedit_buf_len == 0)
+ {
+ init_preedit_start_col();
+ vim_free(draw_feedback);
+ draw_feedback = NULL;
+ }
+ if (draw_data->chg_length > 0)
+ {
+ int bs_cnt;
+
+ if (draw_data->chg_length > preedit_buf_len)
+ bs_cnt = preedit_buf_len;
+ else
+ bs_cnt = draw_data->chg_length;
+ xim_back_delete(bs_cnt);
+ preedit_buf_len -= bs_cnt;
+ }
+ if (text != NULL)
+ {
+ int len;
+#ifdef FEAT_MBYTE
+ char_u *buf = NULL;
+ unsigned int nfeedback = 0;
+#endif
+ char_u *ptr;
+
+ src = text->string.multi_byte;
+ if (src != NULL && !text->encoding_is_wchar)
+ {
+ len = strlen(src);
+ ptr = (char_u *)src;
+ /* Avoid the enter for decision */
+ if (*ptr == '\n')
+ return;
+
+#ifdef FEAT_MBYTE
+ if (input_conv.vc_type != CONV_NONE
+ && (buf = string_convert(&input_conv,
+ (char_u *)src, &len)) != NULL)
+ {
+ /* Converted from 'termencoding' to 'encoding'. */
+ add_to_input_buf_csi(buf, len);
+ ptr = buf;
+ }
+ else
+#endif
+ add_to_input_buf_csi((char_u *)src, len);
+ /* Add count of character to preedit_buf_len */
+ while (*ptr != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (draw_data->text->feedback != NULL)
+ {
+ if (draw_feedback == NULL)
+ draw_feedback = (char *)alloc(draw_data->chg_first
+ + text->length);
+ else
+ draw_feedback = realloc(draw_feedback,
+ draw_data->chg_first + text->length);
+ if (draw_feedback != NULL)
+ {
+ draw_feedback[nfeedback + draw_data->chg_first]
+ = draw_data->text->feedback[nfeedback];
+ nfeedback++;
+ }
+ }
+ if (has_mbyte)
+ ptr += mb_ptr2len_check(ptr);
+ else
+#endif
+ ptr++;
+ preedit_buf_len++;
+ }
+#ifdef FEAT_MBYTE
+ vim_free(buf);
+#endif
+ preedit_end_col = MAXCOL;
+ }
+ }
+ if (text != NULL || draw_data->chg_length > 0)
+ {
+ event_queue = key_press_event_queue;
+ processing_queued_event = TRUE;
+ while (event_queue != NULL && processing_queued_event)
+ {
+ GdkEvent *ev = event_queue->data;
+
+ gboolean *ret;
+ gtk_signal_emit_by_name((GtkObject*)gui.mainwin, "key_press_event",
+ ev, &ret);
+ gdk_event_free(ev);
+ event_queue = event_queue->next;
+ }
+ processing_queued_event = FALSE;
+ if (key_press_event_queue)
+ {
+ g_slist_free(key_press_event_queue);
+ key_press_event_queue = NULL;
+ }
+ }
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+}
+
+/*
+ * Retrieve the highlighting attributes at column col in the preedit string.
+ * Return -1 if not in preediting mode or if col is out of range.
+ */
+ int
+im_get_feedback_attr(int col)
+{
+ if (draw_feedback != NULL && col < preedit_buf_len)
+ {
+ if (draw_feedback[col] & XIMReverse)
+ return HL_INVERSE;
+ else if (draw_feedback[col] & XIMUnderline)
+ return HL_UNDERLINE;
+ else
+ return hl_attr(HLF_V);
+ }
+
+ return -1;
+}
+
+/*ARGSUSED*/
+ static void
+preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+{
+#ifdef XIM_DEBUG
+ xim_log("preedit_caret_cbproc()\n");
+#endif
+}
+
+/*ARGSUSED*/
+ static void
+preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
+{
+#ifdef XIM_DEBUG
+ xim_log("preedit_done_cbproc()\n");
+#endif
+
+ vim_free(draw_feedback);
+ draw_feedback = NULL;
+ xim_can_preediting = FALSE;
+ xim_has_preediting = FALSE;
+ gui_update_cursor(TRUE, FALSE);
+ if (showmode() > 0)
+ {
+ setcursor();
+ out_flush();
+ }
+}
+
+ void
+xim_reset(void)
+{
+ char *text;
+
+#ifdef XIM_DEBUG
+ xim_log("xim_reset()\n");
+#endif
+
+ if (xic != NULL)
+ {
+ text = XmbResetIC(((GdkICPrivate *)xic)->xic);
+ if (text != NULL && !(xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS))
+ add_to_input_buf_csi((char_u *)text, strlen(text));
+ else
+ preedit_buf_len = 0;
+ if (text != NULL)
+ XFree(text);
+ }
+}
+
+/*ARGSUSED*/
+ int
+xim_queue_key_press_event(GdkEventKey *event, int down)
+{
+#ifdef XIM_DEBUG
+ xim_log("xim_queue_key_press_event()\n");
+#endif
+
+ if (preedit_buf_len <= 0)
+ return FALSE;
+ if (processing_queued_event)
+ processing_queued_event = FALSE;
+
+ key_press_event_queue = g_slist_append(key_press_event_queue,
+ gdk_event_copy((GdkEvent *)event));
+ return TRUE;
+}
+
+/*ARGSUSED*/
+ static void
+preedit_callback_setup(GdkIC *ic)
+{
+ XIC xxic;
+ XVaNestedList preedit_attr;
+ XIMCallback preedit_start_cb;
+ XIMCallback preedit_draw_cb;
+ XIMCallback preedit_caret_cb;
+ XIMCallback preedit_done_cb;
+
+ xxic = ((GdkICPrivate*)xic)->xic;
+ preedit_start_cb.callback = (XIMProc)preedit_start_cbproc;
+ preedit_draw_cb.callback = (XIMProc)preedit_draw_cbproc;
+ preedit_caret_cb.callback = (XIMProc)preedit_caret_cbproc;
+ preedit_done_cb.callback = (XIMProc)preedit_done_cbproc;
+ preedit_attr
+ = XVaCreateNestedList (0,
+ XNPreeditStartCallback, &preedit_start_cb,
+ XNPreeditDrawCallback, &preedit_draw_cb,
+ XNPreeditCaretCallback, &preedit_caret_cb,
+ XNPreeditDoneCallback, &preedit_done_cb,
+ 0);
+ XSetICValues (xxic, XNPreeditAttributes, preedit_attr, 0);
+ XFree(preedit_attr);
+}
+
+/*ARGSUSED*/
+ static void
+reset_state_setup(GdkIC *ic)
+{
+#ifdef USE_X11R6_XIM
+ /* don't change the input context when we call reset */
+ XSetICValues(((GdkICPrivate*)ic)->xic, XNResetState, XIMPreserveState, 0);
+#endif
+}
+
+ void
+xim_init(void)
+{
+#ifdef XIM_DEBUG
+ xim_log("xim_init()\n");
+#endif
+
+ xic = NULL;
+ xic_attr = NULL;
+
+ if (!gdk_im_ready())
+ {
+ if (p_verbose > 0)
+ EMSG(_("E292: Input Method Server is not running"));
+ return;
+ }
+ if ((xic_attr = gdk_ic_attr_new()) != NULL)
+ {
+#ifdef FEAT_XFONTSET
+ gint width, height;
+#endif
+ int mask;
+ GdkColormap *colormap;
+ GdkICAttr *attr = xic_attr;
+ int attrmask = (int)GDK_IC_ALL_REQ;
+ GtkWidget *widget = gui.drawarea;
+
+ attr->style = (GdkIMStyle)xim_input_style;
+ attr->client_window = gui.mainwin->window;
+
+ if ((colormap = gtk_widget_get_colormap(widget)) !=
+ gtk_widget_get_default_colormap())
+ {
+ attrmask |= (int)GDK_IC_PREEDIT_COLORMAP;
+ attr->preedit_colormap = colormap;
+ }
+ attrmask |= (int)GDK_IC_PREEDIT_FOREGROUND;
+ attrmask |= (int)GDK_IC_PREEDIT_BACKGROUND;
+ attr->preedit_foreground = widget->style->fg[GTK_STATE_NORMAL];
+ attr->preedit_background = widget->style->base[GTK_STATE_NORMAL];
+
+#ifdef FEAT_XFONTSET
+ if ((xim_input_style & (int)GDK_IM_PREEDIT_MASK)
+ == (int)GDK_IM_PREEDIT_POSITION)
+ {
+ if (gui.fontset == NOFONTSET
+ || gui.fontset->type != GDK_FONT_FONTSET)
+ {
+ EMSG(_(e_overthespot));
+ }
+ else
+ {
+ gdk_window_get_size(widget->window, &width, &height);
+
+ attrmask |= (int)GDK_IC_PREEDIT_POSITION_REQ;
+ attr->spot_location.x = TEXT_X(0);
+ attr->spot_location.y = TEXT_Y(0);
+ attr->preedit_area.x = gui.border_offset;
+ attr->preedit_area.y = gui.border_offset;
+ attr->preedit_area.width = width - 2*gui.border_offset;
+ attr->preedit_area.height = height - 2*gui.border_offset;
+ attr->preedit_fontset = gui.fontset;
+ }
+ }
+
+ if ((xim_input_style & (int)GDK_IM_STATUS_MASK)
+ == (int)GDK_IM_STATUS_AREA)
+ {
+ if (gui.fontset == NOFONTSET
+ || gui.fontset->type != GDK_FONT_FONTSET)
+ {
+ EMSG(_(e_overthespot));
+ }
+ else
+ {
+ gdk_window_get_size(gui.mainwin->window, &width, &height);
+ attrmask |= (int)GDK_IC_STATUS_AREA_REQ;
+ attr->status_area.x = 0;
+ attr->status_area.y = height - gui.char_height - 1;
+ attr->status_area.width = width;
+ attr->status_area.height = gui.char_height;
+ attr->status_fontset = gui.fontset;
+ }
+ }
+ else if ((xim_input_style & (int)GDK_IM_STATUS_MASK)
+ == (int)GDK_IM_STATUS_CALLBACKS)
+ {
+ /* FIXME */
+ }
+#endif
+
+ xic = gdk_ic_new(attr, (GdkICAttributesType)attrmask);
+
+ if (xic == NULL)
+ EMSG(_(e_xim));
+ else
+ {
+ mask = (int)gdk_window_get_events(widget->window);
+ mask |= (int)gdk_ic_get_events(xic);
+ gdk_window_set_events(widget->window, (GdkEventMask)mask);
+ if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
+ preedit_callback_setup(xic);
+ reset_state_setup(xic);
+ }
+ }
+}
+
+ void
+im_shutdown(void)
+{
+#ifdef XIM_DEBUG
+ xim_log("im_shutdown()\n");
+#endif
+
+ if (xic != NULL)
+ {
+ gdk_im_end();
+ gdk_ic_destroy(xic);
+ xic = NULL;
+ }
+ xim_is_active = FALSE;
+ xim_can_preediting = FALSE;
+ preedit_start_col = MAXCOL;
+ xim_has_preediting = FALSE;
+}
+
+#endif /* FEAT_GUI_GTK */
+
+ int
+xim_get_status_area_height()
+{
+#ifdef FEAT_GUI_GTK
+ if (xim_input_style & (int)GDK_IM_STATUS_AREA)
+ return gui.char_height;
+#else
+ if (status_area_enabled)
+ return gui.char_height;
+#endif
+ return 0;
+}
+
+/*
+ * Get IM status. When IM is on, return TRUE. Else return FALSE.
+ * FIXME: This doesn't work correctly: Having focus doesn't always mean XIM is
+ * active, when not having focus XIM may still be active (e.g., when using a
+ * tear-off menu item).
+ */
+ int
+im_get_status()
+{
+# ifdef FEAT_GUI_GTK
+ if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS)
+ return xim_can_preediting;
+# endif
+ return xim_has_focus;
+}
+
+# endif /* !HAVE_GTK2 */
+
+# if defined(FEAT_GUI_GTK) || defined(PROTO)
+ int
+im_is_preediting()
+{
+ return xim_has_preediting;
+}
+# endif
+#endif /* FEAT_XIM */
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+
+/*
+ * Setup "vcp" for conversion from "from" to "to".
+ * The names must have been made canonical with enc_canonize().
+ * vcp->vc_type must have been initialized to CONV_NONE.
+ * Note: cannot be used for conversion from/to ucs-2 and ucs-4 (will use utf-8
+ * instead).
+ * Afterwards invoke with "from" and "to" equal to NULL to cleanup.
+ * Return FAIL when conversion is not supported, OK otherwise.
+ */
+ int
+convert_setup(vcp, from, to)
+ vimconv_T *vcp;
+ char_u *from;
+ char_u *to;
+{
+ int from_prop;
+ int to_prop;
+
+ /* Reset to no conversion. */
+# ifdef USE_ICONV
+ if (vcp->vc_type == CONV_ICONV && vcp->vc_fd != (iconv_t)-1)
+ iconv_close(vcp->vc_fd);
+# endif
+ vcp->vc_type = CONV_NONE;
+ vcp->vc_factor = 1;
+ vcp->vc_fail = FALSE;
+
+ /* No conversion when one of the names is empty or they are equal. */
+ if (from == NULL || *from == NUL || to == NULL || *to == NUL
+ || STRCMP(from, to) == 0)
+ return OK;
+
+ from_prop = enc_canon_props(from);
+ to_prop = enc_canon_props(to);
+ if ((from_prop & ENC_LATIN1) && (to_prop & ENC_UNICODE))
+ {
+ /* Internal latin1 -> utf-8 conversion. */
+ vcp->vc_type = CONV_TO_UTF8;
+ vcp->vc_factor = 2; /* up to twice as long */
+ }
+ else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_LATIN1))
+ {
+ /* Internal utf-8 -> latin1 conversion. */
+ vcp->vc_type = CONV_TO_LATIN1;
+ }
+#ifdef WIN3264
+ /* Win32-specific codepage <-> codepage conversion without iconv. */
+ else if (((from_prop & ENC_UNICODE) || encname2codepage(from) > 0)
+ && ((to_prop & ENC_UNICODE) || encname2codepage(to) > 0))
+ {
+ vcp->vc_type = CONV_CODEPAGE;
+ vcp->vc_factor = 2; /* up to twice as long */
+ vcp->vc_cpfrom = (from_prop & ENC_UNICODE) ? 0 : encname2codepage(from);
+ vcp->vc_cpto = (to_prop & ENC_UNICODE) ? 0 : encname2codepage(to);
+ }
+#endif
+#ifdef MACOS_X
+ else if ((from_prop & ENC_MACROMAN) && (to_prop & ENC_LATIN1))
+ {
+ vcp->vc_type = CONV_MAC_LATIN1;
+ }
+ else if ((from_prop & ENC_MACROMAN) && (to_prop & ENC_UNICODE))
+ {
+ vcp->vc_type = CONV_MAC_UTF8;
+ vcp->vc_factor = 2; /* up to twice as long */
+ }
+ else if ((from_prop & ENC_LATIN1) && (to_prop & ENC_MACROMAN))
+ {
+ vcp->vc_type = CONV_LATIN1_MAC;
+ }
+ else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_MACROMAN))
+ {
+ vcp->vc_type = CONV_UTF8_MAC;
+ }
+#endif
+# ifdef USE_ICONV
+ else
+ {
+ /* Use iconv() for conversion. */
+ vcp->vc_fd = (iconv_t)my_iconv_open(
+ (to_prop & ENC_UNICODE) ? (char_u *)"utf-8" : to,
+ (from_prop & ENC_UNICODE) ? (char_u *)"utf-8" : from);
+ if (vcp->vc_fd != (iconv_t)-1)
+ {
+ vcp->vc_type = CONV_ICONV;
+ vcp->vc_factor = 4; /* could be longer too... */
+ }
+ }
+# endif
+ if (vcp->vc_type == CONV_NONE)
+ return FAIL;
+ return OK;
+}
+
+#if defined(FEAT_GUI) || defined(AMIGA) || defined(WIN3264) \
+ || defined(MSDOS) || defined(PROTO)
+/*
+ * Do conversion on typed input characters in-place.
+ * The input and output are not NUL terminated!
+ * Returns the length after conversion.
+ */
+ int
+convert_input(ptr, len, maxlen)
+ char_u *ptr;
+ int len;
+ int maxlen;
+{
+ return convert_input_safe(ptr, len, maxlen, NULL, NULL);
+}
+#endif
+
+/*
+ * Like convert_input(), but when there is an incomplete byte sequence at the
+ * end return that as an allocated string in "restp" and set "*restlenp" to
+ * the length. If "restp" is NULL it is not used.
+ */
+ int
+convert_input_safe(ptr, len, maxlen, restp, restlenp)
+ char_u *ptr;
+ int len;
+ int maxlen;
+ char_u **restp;
+ int *restlenp;
+{
+ char_u *d;
+ int dlen = len;
+ int unconvertlen = 0;
+
+ d = string_convert_ext(&input_conv, ptr, &dlen,
+ restp == NULL ? NULL : &unconvertlen);
+ if (d != NULL)
+ {
+ if (dlen <= maxlen)
+ {
+ if (unconvertlen > 0)
+ {
+ /* Move the unconverted characters to allocated memory. */
+ *restp = alloc(unconvertlen);
+ if (*restp != NULL)
+ mch_memmove(*restp, ptr + len - unconvertlen, unconvertlen);
+ *restlenp = unconvertlen;
+ }
+ mch_memmove(ptr, d, dlen);
+ }
+ else
+ /* result is too long, keep the unconverted text (the caller must
+ * have done something wrong!) */
+ dlen = len;
+ vim_free(d);
+ }
+ return dlen;
+}
+
+#if defined(MACOS_X)
+static char_u *mac_string_convert __ARGS((char_u *ptr, int len, int *lenp, int fail_on_error, CFStringEncoding from, CFStringEncoding to, int *unconvlenp));
+
+/*
+ * A Mac version of string_convert_ext() for special cases.
+ */
+ static char_u *
+mac_string_convert(ptr, len, lenp, fail_on_error, from, to, unconvlenp)
+ char_u *ptr;
+ int len;
+ int *lenp;
+ int fail_on_error;
+ CFStringEncoding from;
+ CFStringEncoding to;
+ int *unconvlenp;
+{
+ char_u *retval, *d;
+ CFStringRef cfstr;
+ int buflen, in, out, l, i;
+
+ if (unconvlenp != NULL)
+ *unconvlenp = 0;
+ cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
+ /* When conversion failed, try excluding bytes from the end, helps when
+ * there is an incomplete byte sequence. Only do up to 6 bytes to avoid
+ * looping a long time when there really is something unconvertable. */
+ while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
+ {
+ --len;
+ ++*unconvlenp;
+ cfstr = CFStringCreateWithBytes(NULL, ptr, len, from, 0);
+ }
+ if (cfstr == NULL)
+ return NULL;
+ if (to == kCFStringEncodingUTF8)
+ buflen = len * 6 + 1;
+ else
+ buflen = len + 1;
+ retval = alloc(buflen);
+ if (retval == NULL)
+ {
+ CFRelease(cfstr);
+ return NULL;
+ }
+ if (!CFStringGetCString(cfstr, retval, buflen, to))
+ {
+ CFRelease(cfstr);
+ if (fail_on_error)
+ {
+ vim_free(retval);
+ return NULL;
+ }
+
+ /* conversion failed for the whole string, but maybe it will work
+ * for each character */
+ for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
+ {
+ if (from == kCFStringEncodingUTF8)
+ l = utf_ptr2len_check(ptr + in);
+ else
+ l = 1;
+ cfstr = CFStringCreateWithBytes(NULL, ptr + in, l, from, 0);
+ if (cfstr == NULL)
+ {
+ *d++ = '?';
+ out++;
+ }
+ else
+ {
+ if (!CFStringGetCString(cfstr, d, buflen - out, to))
+ {
+ *d++ = '?';
+ out++;
+ }
+ else
+ {
+ i = strlen(d);
+ d += i;
+ out += i;
+ }
+ CFRelease(cfstr);
+ }
+ in += l;
+ }
+ *d = NUL;
+ if (lenp != NULL)
+ *lenp = out;
+ return retval;
+ }
+ CFRelease(cfstr);
+ if (lenp != NULL)
+ *lenp = strlen(retval);
+ return retval;
+}
+#endif
+
+/*
+ * Convert text "ptr[*lenp]" according to "vcp".
+ * Returns the result in allocated memory and sets "*lenp".
+ * When "lenp" is NULL, use NUL terminated strings.
+ * Illegal chars are often changed to "?", unless vcp->vc_fail is set.
+ * When something goes wrong, NULL is returned and "*lenp" is unchanged.
+ */
+ char_u *
+string_convert(vcp, ptr, lenp)
+ vimconv_T *vcp;
+ char_u *ptr;
+ int *lenp;
+{
+ return string_convert_ext(vcp, ptr, lenp, NULL);
+}
+
+/*
+ * Like string_convert(), but when "unconvlenp" is not NULL and there are is
+ * an incomplete sequence at the end it is not converted and "*unconvlenp" is
+ * set to the number of remaining bytes.
+ */
+ char_u *
+string_convert_ext(vcp, ptr, lenp, unconvlenp)
+ vimconv_T *vcp;
+ char_u *ptr;
+ int *lenp;
+ int *unconvlenp;
+{
+ char_u *retval = NULL;
+ char_u *d;
+ int len;
+ int i;
+ int l;
+ int c;
+
+ if (lenp == NULL)
+ len = (int)STRLEN(ptr);
+ else
+ len = *lenp;
+ if (len == 0)
+ return vim_strsave((char_u *)"");
+
+ switch (vcp->vc_type)
+ {
+ case CONV_TO_UTF8: /* latin1 to utf-8 conversion */
+ retval = alloc(len * 2 + 1);
+ if (retval == NULL)
+ break;
+ d = retval;
+ for (i = 0; i < len; ++i)
+ {
+ if (ptr[i] < 0x80)
+ *d++ = ptr[i];
+ else
+ {
+ *d++ = 0xc0 + ((unsigned)ptr[i] >> 6);
+ *d++ = 0x80 + (ptr[i] & 0x3f);
+ }
+ }
+ *d = NUL;
+ if (lenp != NULL)
+ *lenp = (int)(d - retval);
+ break;
+
+ case CONV_TO_LATIN1: /* utf-8 to latin1 conversion */
+ retval = alloc(len + 1);
+ if (retval == NULL)
+ break;
+ d = retval;
+ for (i = 0; i < len; ++i)
+ {
+ l = utf_ptr2len_check(ptr + i);
+ if (l == 0)
+ *d++ = NUL;
+ else if (l == 1)
+ {
+ if (unconvlenp != NULL && utf8len_tab[ptr[i]] > len - i)
+ {
+ /* Incomplete sequence at the end. */
+ *unconvlenp = len - i;
+ break;
+ }
+ *d++ = ptr[i];
+ }
+ else
+ {
+ c = utf_ptr2char(ptr + i);
+ if (!utf_iscomposing(c)) /* skip composing chars */
+ {
+ if (c < 0x100)
+ *d++ = c;
+ else if (vcp->vc_fail)
+ {
+ vim_free(retval);
+ return NULL;
+ }
+ else
+ {
+ *d++ = 0xbf;
+ if (utf_char2cells(c) > 1)
+ *d++ = '?';
+ }
+ }
+ i += l - 1;
+ }
+ }
+ *d = NUL;
+ if (lenp != NULL)
+ *lenp = (int)(d - retval);
+ break;
+
+# ifdef MACOS_X
+ case CONV_MAC_LATIN1:
+ retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
+ kCFStringEncodingMacRoman,
+ kCFStringEncodingISOLatin1,
+ unconvlenp);
+ break;
+
+ case CONV_LATIN1_MAC:
+ retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
+ kCFStringEncodingISOLatin1,
+ kCFStringEncodingMacRoman,
+ unconvlenp);
+ break;
+
+ case CONV_MAC_UTF8:
+ retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
+ kCFStringEncodingMacRoman,
+ kCFStringEncodingUTF8,
+ unconvlenp);
+ break;
+
+ case CONV_UTF8_MAC:
+ retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail,
+ kCFStringEncodingUTF8,
+ kCFStringEncodingMacRoman,
+ unconvlenp);
+ break;
+# endif
+
+# ifdef USE_ICONV
+ case CONV_ICONV: /* conversion with output_conv.vc_fd */
+ retval = iconv_string(vcp, ptr, len, unconvlenp);
+ if (retval != NULL && lenp != NULL)
+ *lenp = (int)STRLEN(retval);
+ break;
+# endif
+# ifdef WIN3264
+ case CONV_CODEPAGE: /* codepage -> codepage */
+ {
+ int retlen;
+ int tmp_len;
+ short_u *tmp;
+
+ /* 1. codepage/UTF-8 -> ucs-2. */
+ if (vcp->vc_cpfrom == 0)
+ tmp_len = utf8_to_ucs2(ptr, len, NULL, NULL);
+ else
+ tmp_len = MultiByteToWideChar(vcp->vc_cpfrom, 0,
+ ptr, len, 0, 0);
+ tmp = (short_u *)alloc(sizeof(short_u) * tmp_len);
+ if (tmp == NULL)
+ break;
+ if (vcp->vc_cpfrom == 0)
+ utf8_to_ucs2(ptr, len, tmp, unconvlenp);
+ else
+ MultiByteToWideChar(vcp->vc_cpfrom, 0, ptr, len, tmp, tmp_len);
+
+ /* 2. ucs-2 -> codepage/UTF-8. */
+ if (vcp->vc_cpto == 0)
+ retlen = ucs2_to_utf8(tmp, tmp_len, NULL);
+ else
+ retlen = WideCharToMultiByte(vcp->vc_cpto, 0,
+ tmp, tmp_len, 0, 0, 0, 0);
+ retval = alloc(retlen + 1);
+ if (retval != NULL)
+ {
+ if (vcp->vc_cpto == 0)
+ ucs2_to_utf8(tmp, tmp_len, retval);
+ else
+ WideCharToMultiByte(vcp->vc_cpto, 0,
+ tmp, tmp_len, retval, retlen, 0, 0);
+ retval[retlen] = NUL;
+ if (lenp != NULL)
+ *lenp = retlen;
+ }
+ vim_free(tmp);
+ break;
+ }
+# endif
+ }
+
+ return retval;
+}
+#endif
diff --git a/src/memfile.c b/src/memfile.c
new file mode 100644
index 000000000..8c41832c2
--- /dev/null
+++ b/src/memfile.c
@@ -0,0 +1,1312 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * memfile.c: Contains the functions for handling blocks of memory which can
+ * be stored in a file. This is the implementation of a sort of virtual memory.
+ *
+ * A memfile consists of a sequence of blocks. The blocks numbered from 0
+ * upwards have been assigned a place in the actual file. The block number
+ * is equal to the page number in the file. The
+ * blocks with negative numbers are currently in memory only. They can be
+ * assigned a place in the file when too much memory is being used. At that
+ * moment they get a new, positive, number. A list is used for translation of
+ * negative to positive numbers.
+ *
+ * The size of a block is a multiple of a page size, normally the page size of
+ * the device the file is on. Most blocks are 1 page long. A Block of multiple
+ * pages is used for a line that does not fit in a single page.
+ *
+ * Each block can be in memory and/or in a file. The block stays in memory
+ * as long as it is locked. If it is no longer locked it can be swapped out to
+ * the file. It is only written to the file if it has been changed.
+ *
+ * Under normal operation the file is created when opening the memory file and
+ * deleted when closing the memory file. Only with recovery an existing memory
+ * file is opened.
+ */
+
+#if defined MSDOS || defined(WIN32) || defined(_WIN64)
+# include <io.h> /* for lseek(), must be before vim.h */
+#endif
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+/*
+ * Some systems have the page size in statfs.f_bsize, some in stat.st_blksize
+ */
+#ifdef HAVE_ST_BLKSIZE
+# define STATFS stat
+# define F_BSIZE st_blksize
+# define fstatfs(fd, buf, len, nul) mch_fstat((fd), (buf))
+#else
+# ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+# define STATFS statfs
+# define F_BSIZE f_bsize
+# ifdef __MINT__ /* do we still need this? */
+# define fstatfs(fd, buf, len, nul) mch_fstat((fd), (buf))
+# endif
+# endif
+#endif
+
+/*
+ * for Amiga Dos 2.0x we use Flush
+ */
+#ifdef AMIGA
+# ifdef FEAT_ARP
+extern int dos2; /* this is in os_amiga.c */
+# endif
+# ifdef SASC
+# include <proto/dos.h>
+# include <ios1.h> /* for chkufb() */
+# endif
+#endif
+
+#define MEMFILE_PAGE_SIZE 4096 /* default page size */
+
+static long_u total_mem_used = 0; /* total memory used for memfiles */
+static int dont_release = FALSE; /* don't release blocks */
+
+static void mf_ins_hash __ARGS((memfile_T *, bhdr_T *));
+static void mf_rem_hash __ARGS((memfile_T *, bhdr_T *));
+static bhdr_T *mf_find_hash __ARGS((memfile_T *, blocknr_T));
+static void mf_ins_used __ARGS((memfile_T *, bhdr_T *));
+static void mf_rem_used __ARGS((memfile_T *, bhdr_T *));
+static bhdr_T *mf_release __ARGS((memfile_T *, int));
+static bhdr_T *mf_alloc_bhdr __ARGS((memfile_T *, int));
+static void mf_free_bhdr __ARGS((bhdr_T *));
+static void mf_ins_free __ARGS((memfile_T *, bhdr_T *));
+static bhdr_T *mf_rem_free __ARGS((memfile_T *));
+static int mf_read __ARGS((memfile_T *, bhdr_T *));
+static int mf_write __ARGS((memfile_T *, bhdr_T *));
+static int mf_trans_add __ARGS((memfile_T *, bhdr_T *));
+static void mf_do_open __ARGS((memfile_T *, char_u *, int));
+
+/*
+ * The functions for using a memfile:
+ *
+ * mf_open() open a new or existing memfile
+ * mf_open_file() open a swap file for an existing memfile
+ * mf_close() close (and delete) a memfile
+ * mf_new() create a new block in a memfile and lock it
+ * mf_get() get an existing block and lock it
+ * mf_put() unlock a block, may be marked for writing
+ * mf_free() remove a block
+ * mf_sync() sync changed parts of memfile to disk
+ * mf_release_all() release as much memory as possible
+ * mf_trans_del() may translate negative to positive block number
+ * mf_fullname() make file name full path (use before first :cd)
+ */
+
+/*
+ * Open an existing or new memory block file.
+ *
+ * fname: name of file to use (NULL means no file at all)
+ * Note: fname must have been allocated, it is not copied!
+ * If opening the file fails, fname is freed.
+ * flags: flags for open() call
+ *
+ * If fname != NULL and file cannot be opened, fail.
+ *
+ * return value: identifier for this memory block file.
+ */
+ memfile_T *
+mf_open(fname, flags)
+ char_u *fname;
+ int flags;
+{
+ memfile_T *mfp;
+ int i;
+ off_t size;
+#if defined(STATFS) && defined(UNIX) && !defined(__QNX__)
+# define USE_FSTATFS
+ struct STATFS stf;
+#endif
+
+ if ((mfp = (memfile_T *)alloc((unsigned)sizeof(memfile_T))) == NULL)
+ return NULL;
+
+ if (fname == NULL) /* no file for this memfile, use memory only */
+ {
+ mfp->mf_fname = NULL;
+ mfp->mf_ffname = NULL;
+ mfp->mf_fd = -1;
+ }
+ else
+ {
+ mf_do_open(mfp, fname, flags); /* try to open the file */
+
+ /* if the file cannot be opened, return here */
+ if (mfp->mf_fd < 0)
+ {
+ vim_free(mfp);
+ return NULL;
+ }
+ }
+
+ mfp->mf_free_first = NULL; /* free list is empty */
+ mfp->mf_used_first = NULL; /* used list is empty */
+ mfp->mf_used_last = NULL;
+ mfp->mf_dirty = FALSE;
+ mfp->mf_used_count = 0;
+ for (i = 0; i < MEMHASHSIZE; ++i)
+ {
+ mfp->mf_hash[i] = NULL; /* hash lists are empty */
+ mfp->mf_trans[i] = NULL; /* trans lists are empty */
+ }
+ mfp->mf_page_size = MEMFILE_PAGE_SIZE;
+
+#ifdef USE_FSTATFS
+ /*
+ * Try to set the page size equal to the block size of the device.
+ * Speeds up I/O a lot.
+ * When recovering, the actual block size will be retrieved from block 0
+ * in ml_recover(). The size used here may be wrong, therefore
+ * mf_blocknr_max must be rounded up.
+ */
+ if (mfp->mf_fd >= 0
+ && fstatfs(mfp->mf_fd, &stf, sizeof(struct statfs), 0) == 0
+ && stf.F_BSIZE >= MIN_SWAP_PAGE_SIZE
+ && stf.F_BSIZE <= MAX_SWAP_PAGE_SIZE)
+ mfp->mf_page_size = stf.F_BSIZE;
+#endif
+
+ if (mfp->mf_fd < 0 || (flags & (O_TRUNC|O_EXCL))
+ || (size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
+ mfp->mf_blocknr_max = 0; /* no file or empty file */
+ else
+ mfp->mf_blocknr_max = (blocknr_T)((size + mfp->mf_page_size - 1)
+ / mfp->mf_page_size);
+ mfp->mf_blocknr_min = -1;
+ mfp->mf_neg_count = 0;
+ mfp->mf_infile_count = mfp->mf_blocknr_max;
+ mfp->mf_used_count_max = p_mm * 1024 / mfp->mf_page_size;
+
+ return mfp;
+}
+
+/*
+ * Open a file for an existing memfile. Used when updatecount set from 0 to
+ * some value.
+ * If the file already exists, this fails.
+ * "fname" is the name of file to use (NULL means no file at all)
+ * Note: "fname" must have been allocated, it is not copied! If opening the
+ * file fails, "fname" is freed.
+ *
+ * return value: FAIL if file could not be opened, OK otherwise
+ */
+ int
+mf_open_file(mfp, fname)
+ memfile_T *mfp;
+ char_u *fname;
+{
+ mf_do_open(mfp, fname, O_RDWR|O_CREAT|O_EXCL); /* try to open the file */
+
+ if (mfp->mf_fd < 0)
+ return FAIL;
+
+ mfp->mf_dirty = TRUE;
+ return OK;
+}
+
+/*
+ * close a memory file and delete the associated file if 'del_file' is TRUE
+ */
+ void
+mf_close(mfp, del_file)
+ memfile_T *mfp;
+ int del_file;
+{
+ bhdr_T *hp, *nextp;
+ NR_TRANS *tp, *tpnext;
+ int i;
+
+ if (mfp == NULL) /* safety check */
+ return;
+ if (mfp->mf_fd >= 0)
+ {
+ if (close(mfp->mf_fd) < 0)
+ EMSG(_(e_swapclose));
+ }
+ if (del_file && mfp->mf_fname != NULL)
+ mch_remove(mfp->mf_fname);
+ /* free entries in used list */
+ for (hp = mfp->mf_used_first; hp != NULL; hp = nextp)
+ {
+ total_mem_used -= hp->bh_page_count * mfp->mf_page_size;
+ nextp = hp->bh_next;
+ mf_free_bhdr(hp);
+ }
+ while (mfp->mf_free_first != NULL) /* free entries in free list */
+ vim_free(mf_rem_free(mfp));
+ for (i = 0; i < MEMHASHSIZE; ++i) /* free entries in trans lists */
+ for (tp = mfp->mf_trans[i]; tp != NULL; tp = tpnext)
+ {
+ tpnext = tp->nt_next;
+ vim_free(tp);
+ }
+ vim_free(mfp->mf_fname);
+ vim_free(mfp->mf_ffname);
+ vim_free(mfp);
+}
+
+/*
+ * Close the swap file for a memfile. Used when 'swapfile' is reset.
+ */
+ void
+mf_close_file(buf, getlines)
+ buf_T *buf;
+ int getlines; /* get all lines into memory? */
+{
+ memfile_T *mfp;
+ linenr_T lnum;
+
+ mfp = buf->b_ml.ml_mfp;
+ if (mfp == NULL || mfp->mf_fd < 0) /* nothing to close */
+ return;
+
+ if (getlines)
+ {
+ /* get all blocks in memory by accessing all lines (clumsy!) */
+ dont_release = TRUE;
+ for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
+ (void)ml_get_buf(buf, lnum, FALSE);
+ dont_release = FALSE;
+ /* TODO: should check if all blocks are really in core */
+ }
+
+ if (close(mfp->mf_fd) < 0) /* close the file */
+ EMSG(_(e_swapclose));
+ mfp->mf_fd = -1;
+
+ if (mfp->mf_fname != NULL)
+ {
+ mch_remove(mfp->mf_fname); /* delete the swap file */
+ vim_free(mfp->mf_fname);
+ vim_free(mfp->mf_ffname);
+ mfp->mf_fname = NULL;
+ mfp->mf_ffname = NULL;
+ }
+}
+
+/*
+ * Set new size for a memfile. Used when block 0 of a swapfile has been read
+ * and the size it indicates differs from what was guessed.
+ */
+ void
+mf_new_page_size(mfp, new_size)
+ memfile_T *mfp;
+ unsigned new_size;
+{
+ /* Correct the memory used for block 0 to the new size, because it will be
+ * freed with that size later on. */
+ total_mem_used += new_size - mfp->mf_page_size;
+ mfp->mf_page_size = new_size;
+}
+
+/*
+ * get a new block
+ *
+ * negative: TRUE if negative block number desired (data block)
+ */
+ bhdr_T *
+mf_new(mfp, negative, page_count)
+ memfile_T *mfp;
+ int negative;
+ int page_count;
+{
+ bhdr_T *hp; /* new bhdr_T */
+ bhdr_T *freep; /* first block in free list */
+ char_u *p;
+
+ /*
+ * If we reached the maximum size for the used memory blocks, release one
+ * If a bhdr_T is returned, use it and adjust the page_count if necessary.
+ */
+ hp = mf_release(mfp, page_count);
+
+/*
+ * Decide on the number to use:
+ * If there is a free block, use its number.
+ * Otherwise use mf_block_min for a negative number, mf_block_max for
+ * a positive number.
+ */
+ freep = mfp->mf_free_first;
+ if (!negative && freep != NULL && freep->bh_page_count >= page_count)
+ {
+ /*
+ * If the block in the free list has more pages, take only the number
+ * of pages needed and allocate a new bhdr_T with data
+ *
+ * If the number of pages matches and mf_release did not return a bhdr_T,
+ * use the bhdr_T from the free list and allocate the data
+ *
+ * If the number of pages matches and mf_release returned a bhdr_T,
+ * just use the number and free the bhdr_T from the free list
+ */
+ if (freep->bh_page_count > page_count)
+ {
+ if (hp == NULL && (hp = mf_alloc_bhdr(mfp, page_count)) == NULL)
+ return NULL;
+ hp->bh_bnum = freep->bh_bnum;
+ freep->bh_bnum += page_count;
+ freep->bh_page_count -= page_count;
+ }
+ else if (hp == NULL) /* need to allocate memory for this block */
+ {
+ if ((p = (char_u *)alloc(mfp->mf_page_size * page_count)) == NULL)
+ return NULL;
+ hp = mf_rem_free(mfp);
+ hp->bh_data = p;
+ }
+ else /* use the number, remove entry from free list */
+ {
+ freep = mf_rem_free(mfp);
+ hp->bh_bnum = freep->bh_bnum;
+ vim_free(freep);
+ }
+ }
+ else /* get a new number */
+ {
+ if (hp == NULL && (hp = mf_alloc_bhdr(mfp, page_count)) == NULL)
+ return NULL;
+ if (negative)
+ {
+ hp->bh_bnum = mfp->mf_blocknr_min--;
+ mfp->mf_neg_count++;
+ }
+ else
+ {
+ hp->bh_bnum = mfp->mf_blocknr_max;
+ mfp->mf_blocknr_max += page_count;
+ }
+ }
+ hp->bh_flags = BH_LOCKED | BH_DIRTY; /* new block is always dirty */
+ mfp->mf_dirty = TRUE;
+ hp->bh_page_count = page_count;
+ mf_ins_used(mfp, hp);
+ mf_ins_hash(mfp, hp);
+
+ /*
+ * Init the data to all zero, to avoid reading uninitialized data.
+ * This also avoids that the passwd file ends up in the swap file!
+ */
+ (void)vim_memset((char *)(hp->bh_data), 0, (size_t)mfp->mf_page_size);
+
+ return hp;
+}
+
+/*
+ * get existing block 'nr' with 'page_count' pages
+ *
+ * Note: The caller should first check a negative nr with mf_trans_del()
+ */
+ bhdr_T *
+mf_get(mfp, nr, page_count)
+ memfile_T *mfp;
+ blocknr_T nr;
+ int page_count;
+{
+ bhdr_T *hp;
+ /* doesn't exist */
+ if (nr >= mfp->mf_blocknr_max || nr <= mfp->mf_blocknr_min)
+ return NULL;
+
+ /*
+ * see if it is in the cache
+ */
+ hp = mf_find_hash(mfp, nr);
+ if (hp == NULL) /* not in the hash list */
+ {
+ if (nr < 0 || nr >= mfp->mf_infile_count) /* can't be in the file */
+ return NULL;
+
+ /* could check here if the block is in the free list */
+
+ /*
+ * Check if we need to flush an existing block.
+ * If so, use that block.
+ * If not, allocate a new block.
+ */
+ hp = mf_release(mfp, page_count);
+ if (hp == NULL && (hp = mf_alloc_bhdr(mfp, page_count)) == NULL)
+ return NULL;
+
+ hp->bh_bnum = nr;
+ hp->bh_flags = 0;
+ hp->bh_page_count = page_count;
+ if (mf_read(mfp, hp) == FAIL) /* cannot read the block! */
+ {
+ mf_free_bhdr(hp);
+ return NULL;
+ }
+ }
+ else
+ {
+ mf_rem_used(mfp, hp); /* remove from list, insert in front below */
+ mf_rem_hash(mfp, hp);
+ }
+
+ hp->bh_flags |= BH_LOCKED;
+ mf_ins_used(mfp, hp); /* put in front of used list */
+ mf_ins_hash(mfp, hp); /* put in front of hash list */
+
+ return hp;
+}
+
+/*
+ * release the block *hp
+ *
+ * dirty: Block must be written to file later
+ * infile: Block should be in file (needed for recovery)
+ *
+ * no return value, function cannot fail
+ */
+ void
+mf_put(mfp, hp, dirty, infile)
+ memfile_T *mfp;
+ bhdr_T *hp;
+ int dirty;
+ int infile;
+{
+ int flags;
+
+ flags = hp->bh_flags;
+
+ if ((flags & BH_LOCKED) == 0)
+ EMSG(_("E293: block was not locked"));
+ flags &= ~BH_LOCKED;
+ if (dirty)
+ {
+ flags |= BH_DIRTY;
+ mfp->mf_dirty = TRUE;
+ }
+ hp->bh_flags = flags;
+ if (infile)
+ mf_trans_add(mfp, hp); /* may translate negative in positive nr */
+}
+
+/*
+ * block *hp is no longer in used, may put it in the free list of memfile *mfp
+ */
+ void
+mf_free(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ vim_free(hp->bh_data); /* free the memory */
+ mf_rem_hash(mfp, hp); /* get *hp out of the hash list */
+ mf_rem_used(mfp, hp); /* get *hp out of the used list */
+ if (hp->bh_bnum < 0)
+ {
+ vim_free(hp); /* don't want negative numbers in free list */
+ mfp->mf_neg_count--;
+ }
+ else
+ mf_ins_free(mfp, hp); /* put *hp in the free list */
+}
+
+#if defined(__MORPHOS__)
+/* function is missing in MorphOS libnix version */
+extern unsigned long *__stdfiledes;
+
+ static unsigned long
+fdtofh(int filedescriptor)
+{
+ return __stdfiledes[filedescriptor];
+}
+#endif
+
+/*
+ * Sync the memory file *mfp to disk.
+ * Flags:
+ * MFS_ALL If not given, blocks with negative numbers are not synced,
+ * even when they are dirty!
+ * MFS_STOP Stop syncing when a character becomes available, but sync at
+ * least one block.
+ * MFS_FLUSH Make sure buffers are flushed to disk, so they will survive a
+ * system crash.
+ * MFS_ZERO Only write block 0.
+ *
+ * Return FAIL for failure, OK otherwise
+ */
+ int
+mf_sync(mfp, flags)
+ memfile_T *mfp;
+ int flags;
+{
+ int status;
+ bhdr_T *hp;
+#if defined(SYNC_DUP_CLOSE) && !defined(MSDOS)
+ int fd;
+#endif
+ int got_int_save = got_int;
+
+ if (mfp->mf_fd < 0) /* there is no file, nothing to do */
+ {
+ mfp->mf_dirty = FALSE;
+ return FAIL;
+ }
+
+ /* Only a CTRL-C while writing will break us here, not one typed
+ * previously. */
+ got_int = FALSE;
+
+ /*
+ * sync from last to first (may reduce the probability of an inconsistent
+ * file) If a write fails, it is very likely caused by a full filesystem.
+ * Then we only try to write blocks within the existing file. If that also
+ * fails then we give up.
+ */
+ status = OK;
+ for (hp = mfp->mf_used_last; hp != NULL; hp = hp->bh_prev)
+ if (((flags & MFS_ALL) || hp->bh_bnum >= 0)
+ && (hp->bh_flags & BH_DIRTY)
+ && (status == OK || (hp->bh_bnum >= 0
+ && hp->bh_bnum < mfp->mf_infile_count)))
+ {
+ if ((flags & MFS_ZERO) && hp->bh_bnum != 0)
+ continue;
+ if (mf_write(mfp, hp) == FAIL)
+ {
+ if (status == FAIL) /* double error: quit syncing */
+ break;
+ status = FAIL;
+ }
+ if (flags & MFS_STOP)
+ {
+ /* Stop when char available now. */
+ if (ui_char_avail())
+ break;
+ }
+ else
+ ui_breakcheck();
+ if (got_int)
+ break;
+ }
+
+ /*
+ * If the whole list is flushed, the memfile is not dirty anymore.
+ * In case of an error this flag is also set, to avoid trying all the time.
+ */
+ if (hp == NULL || status == FAIL)
+ mfp->mf_dirty = FALSE;
+
+ if ((flags & MFS_FLUSH) && *p_sws != NUL)
+ {
+#if defined(UNIX)
+# ifdef HAVE_FSYNC
+ /*
+ * most Unixes have the very useful fsync() function, just what we need.
+ * However, with OS/2 and EMX it is also available, but there are
+ * reports of bad problems with it (a bug in HPFS.IFS).
+ * So we disable use of it here in case someone tries to be smart
+ * and changes os_os2_cfg.h... (even though there is no __EMX__ test
+ * in the #if, as __EMX__ does not have sync(); we hope for a timely
+ * sync from the system itself).
+ */
+# if defined(__EMX__)
+ error "Dont use fsync with EMX! Read emxdoc.doc or emxfix01.doc for info."
+# endif
+ if (STRCMP(p_sws, "fsync") == 0)
+ {
+ if (fsync(mfp->mf_fd))
+ status = FAIL;
+ }
+ else
+# endif
+ /* OpenNT is strictly POSIX (Benzinger) */
+ /* Tandem/Himalaya NSK-OSS doesn't have sync() */
+# if defined(__OPENNT) || defined(__TANDEM)
+ fflush(NULL);
+# else
+ sync();
+# endif
+#endif
+#ifdef VMS
+ if (STRCMP(p_sws, "fsync") == 0)
+ {
+ if (fsync(mfp->mf_fd))
+ status = FAIL;
+ }
+#endif
+#ifdef MSDOS
+ if (_dos_commit(mfp->mf_fd))
+ status = FAIL;
+#else
+# ifdef SYNC_DUP_CLOSE
+ /*
+ * Win32 is a bit more work: Duplicate the file handle and close it.
+ * This should flush the file to disk.
+ */
+ if ((fd = dup(mfp->mf_fd)) >= 0)
+ close(fd);
+# endif
+#endif
+#ifdef AMIGA
+# ifdef __AROS__
+ if (fsync(mfp->mf_fd) != 0)
+ status = FAIL;
+# else
+ /*
+ * Flush() only exists for AmigaDos 2.0.
+ * For 1.3 it should be done with close() + open(), but then the risk
+ * is that the open() may fail and lose the file....
+ */
+# ifdef FEAT_ARP
+ if (dos2)
+# endif
+# ifdef SASC
+ {
+ struct UFB *fp = chkufb(mfp->mf_fd);
+
+ if (fp != NULL)
+ Flush(fp->ufbfh);
+ }
+# else
+# if defined(_DCC) || defined(__GNUC__) || defined(__MORPHOS__)
+ {
+# if defined(__GNUC__) && !defined(__MORPHOS__)
+ /* Have function (in libnix at least),
+ * but ain't got no prototype anywhere. */
+ extern unsigned long fdtofh(int filedescriptor);
+# endif
+ BPTR fh = (BPTR)fdtofh(mfp->mf_fd);
+
+ if (fh != 0)
+ Flush(fh);
+ }
+# else /* assume Manx */
+ Flush(_devtab[mfp->mf_fd].fd);
+# endif
+# endif
+# endif
+#endif /* AMIGA */
+ }
+
+ got_int |= got_int_save;
+
+ return status;
+}
+
+/*
+ * insert block *hp in front of hashlist of memfile *mfp
+ */
+ static void
+mf_ins_hash(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ bhdr_T *hhp;
+ int hash;
+
+ hash = MEMHASH(hp->bh_bnum);
+ hhp = mfp->mf_hash[hash];
+ hp->bh_hash_next = hhp;
+ hp->bh_hash_prev = NULL;
+ if (hhp != NULL)
+ hhp->bh_hash_prev = hp;
+ mfp->mf_hash[hash] = hp;
+}
+
+/*
+ * remove block *hp from hashlist of memfile list *mfp
+ */
+ static void
+mf_rem_hash(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ if (hp->bh_hash_prev == NULL)
+ mfp->mf_hash[MEMHASH(hp->bh_bnum)] = hp->bh_hash_next;
+ else
+ hp->bh_hash_prev->bh_hash_next = hp->bh_hash_next;
+
+ if (hp->bh_hash_next)
+ hp->bh_hash_next->bh_hash_prev = hp->bh_hash_prev;
+}
+
+/*
+ * look in hash lists of memfile *mfp for block header with number 'nr'
+ */
+ static bhdr_T *
+mf_find_hash(mfp, nr)
+ memfile_T *mfp;
+ blocknr_T nr;
+{
+ bhdr_T *hp;
+
+ for (hp = mfp->mf_hash[MEMHASH(nr)]; hp != NULL; hp = hp->bh_hash_next)
+ if (hp->bh_bnum == nr)
+ break;
+ return hp;
+}
+
+/*
+ * insert block *hp in front of used list of memfile *mfp
+ */
+ static void
+mf_ins_used(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ hp->bh_next = mfp->mf_used_first;
+ mfp->mf_used_first = hp;
+ hp->bh_prev = NULL;
+ if (hp->bh_next == NULL) /* list was empty, adjust last pointer */
+ mfp->mf_used_last = hp;
+ else
+ hp->bh_next->bh_prev = hp;
+ mfp->mf_used_count += hp->bh_page_count;
+ total_mem_used += hp->bh_page_count * mfp->mf_page_size;
+}
+
+/*
+ * remove block *hp from used list of memfile *mfp
+ */
+ static void
+mf_rem_used(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ if (hp->bh_next == NULL) /* last block in used list */
+ mfp->mf_used_last = hp->bh_prev;
+ else
+ hp->bh_next->bh_prev = hp->bh_prev;
+ if (hp->bh_prev == NULL) /* first block in used list */
+ mfp->mf_used_first = hp->bh_next;
+ else
+ hp->bh_prev->bh_next = hp->bh_next;
+ mfp->mf_used_count -= hp->bh_page_count;
+ total_mem_used -= hp->bh_page_count * mfp->mf_page_size;
+}
+
+/*
+ * Release the least recently used block from the used list if the number
+ * of used memory blocks gets to big.
+ *
+ * Return the block header to the caller, including the memory block, so
+ * it can be re-used. Make sure the page_count is right.
+ */
+ static bhdr_T *
+mf_release(mfp, page_count)
+ memfile_T *mfp;
+ int page_count;
+{
+ bhdr_T *hp;
+ int need_release;
+ buf_T *buf;
+
+ /* don't release while in mf_close_file() */
+ if (dont_release)
+ return NULL;
+
+ /*
+ * Need to release a block if the number of blocks for this memfile is
+ * higher than the maximum or total memory used is over 'maxmemtot'
+ */
+ need_release = ((mfp->mf_used_count >= mfp->mf_used_count_max)
+ || (total_mem_used >> 10) >= (long_u)p_mmt);
+
+ /*
+ * Try to create a swap file if the amount of memory used is getting too
+ * high.
+ */
+ if (mfp->mf_fd < 0 && need_release && p_uc)
+ {
+ /* find for which buffer this memfile is */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (buf->b_ml.ml_mfp == mfp)
+ break;
+ if (buf != NULL && buf->b_may_swap)
+ ml_open_file(buf);
+ }
+
+ /*
+ * don't release a block if
+ * there is no file for this memfile
+ * or
+ * the number of blocks for this memfile is lower than the maximum
+ * and
+ * total memory used is not up to 'maxmemtot'
+ */
+ if (mfp->mf_fd < 0 || !need_release)
+ return NULL;
+
+ for (hp = mfp->mf_used_last; hp != NULL; hp = hp->bh_prev)
+ if (!(hp->bh_flags & BH_LOCKED))
+ break;
+ if (hp == NULL) /* not a single one that can be released */
+ return NULL;
+
+ /*
+ * If the block is dirty, write it.
+ * If the write fails we don't free it.
+ */
+ if ((hp->bh_flags & BH_DIRTY) && mf_write(mfp, hp) == FAIL)
+ return NULL;
+
+ mf_rem_used(mfp, hp);
+ mf_rem_hash(mfp, hp);
+
+ /*
+ * If a bhdr_T is returned, make sure that the page_count of bh_data is
+ * right
+ */
+ if (hp->bh_page_count != page_count)
+ {
+ vim_free(hp->bh_data);
+ if ((hp->bh_data = alloc(mfp->mf_page_size * page_count)) == NULL)
+ {
+ vim_free(hp);
+ return NULL;
+ }
+ hp->bh_page_count = page_count;
+ }
+ return hp;
+}
+
+/*
+ * release as many blocks as possible
+ * Used in case of out of memory
+ *
+ * return TRUE if any memory was released
+ */
+ int
+mf_release_all()
+{
+ buf_T *buf;
+ memfile_T *mfp;
+ bhdr_T *hp;
+ int retval = FALSE;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ mfp = buf->b_ml.ml_mfp;
+ if (mfp != NULL)
+ {
+ /* If no swap file yet, may open one */
+ if (mfp->mf_fd < 0 && buf->b_may_swap)
+ ml_open_file(buf);
+
+ /* only if there is a swapfile */
+ if (mfp->mf_fd >= 0)
+ {
+ for (hp = mfp->mf_used_last; hp != NULL; )
+ {
+ if (!(hp->bh_flags & BH_LOCKED)
+ && (!(hp->bh_flags & BH_DIRTY)
+ || mf_write(mfp, hp) != FAIL))
+ {
+ mf_rem_used(mfp, hp);
+ mf_rem_hash(mfp, hp);
+ mf_free_bhdr(hp);
+ hp = mfp->mf_used_last; /* re-start, list was changed */
+ retval = TRUE;
+ }
+ else
+ hp = hp->bh_prev;
+ }
+ }
+ }
+ }
+ return retval;
+}
+
+/*
+ * Allocate a block header and a block of memory for it
+ */
+ static bhdr_T *
+mf_alloc_bhdr(mfp, page_count)
+ memfile_T *mfp;
+ int page_count;
+{
+ bhdr_T *hp;
+
+ if ((hp = (bhdr_T *)alloc((unsigned)sizeof(bhdr_T))) != NULL)
+ {
+ if ((hp->bh_data = (char_u *)alloc(mfp->mf_page_size * page_count))
+ == NULL)
+ {
+ vim_free(hp); /* not enough memory */
+ return NULL;
+ }
+ hp->bh_page_count = page_count;
+ }
+ return hp;
+}
+
+/*
+ * Free a block header and the block of memory for it
+ */
+ static void
+mf_free_bhdr(hp)
+ bhdr_T *hp;
+{
+ vim_free(hp->bh_data);
+ vim_free(hp);
+}
+
+/*
+ * insert entry *hp in the free list
+ */
+ static void
+mf_ins_free(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ hp->bh_next = mfp->mf_free_first;
+ mfp->mf_free_first = hp;
+}
+
+/*
+ * remove the first entry from the free list and return a pointer to it
+ * Note: caller must check that mfp->mf_free_first is not NULL!
+ */
+ static bhdr_T *
+mf_rem_free(mfp)
+ memfile_T *mfp;
+{
+ bhdr_T *hp;
+
+ hp = mfp->mf_free_first;
+ mfp->mf_free_first = hp->bh_next;
+ return hp;
+}
+
+/*
+ * read a block from disk
+ *
+ * Return FAIL for failure, OK otherwise
+ */
+ static int
+mf_read(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ off_t offset;
+ unsigned page_size;
+ unsigned size;
+
+ if (mfp->mf_fd < 0) /* there is no file, can't read */
+ return FAIL;
+
+ page_size = mfp->mf_page_size;
+ offset = (off_t)page_size * hp->bh_bnum;
+ size = page_size * hp->bh_page_count;
+ if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
+ {
+ EMSG(_("E294: Seek error in swap file read"));
+ return FAIL;
+ }
+ if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size)
+ {
+ EMSG(_("E295: Read error in swap file"));
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * write a block to disk
+ *
+ * Return FAIL for failure, OK otherwise
+ */
+ static int
+mf_write(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ off_t offset; /* offset in the file */
+ blocknr_T nr; /* block nr which is being written */
+ bhdr_T *hp2;
+ unsigned page_size; /* number of bytes in a page */
+ unsigned page_count; /* number of pages written */
+ unsigned size; /* number of bytes written */
+
+ if (mfp->mf_fd < 0) /* there is no file, can't write */
+ return FAIL;
+
+ if (hp->bh_bnum < 0) /* must assign file block number */
+ if (mf_trans_add(mfp, hp) == FAIL)
+ return FAIL;
+
+ page_size = mfp->mf_page_size;
+
+ /*
+ * We don't want gaps in the file. Write the blocks in front of *hp
+ * to extend the file.
+ * If block 'mf_infile_count' is not in the hash list, it has been
+ * freed. Fill the space in the file with data from the current block.
+ */
+ for (;;)
+ {
+ nr = hp->bh_bnum;
+ if (nr > mfp->mf_infile_count) /* beyond end of file */
+ {
+ nr = mfp->mf_infile_count;
+ hp2 = mf_find_hash(mfp, nr); /* NULL catched below */
+ }
+ else
+ hp2 = hp;
+
+ offset = (off_t)page_size * nr;
+ if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
+ {
+ EMSG(_("E296: Seek error in swap file write"));
+ return FAIL;
+ }
+ if (hp2 == NULL) /* freed block, fill with dummy data */
+ page_count = 1;
+ else
+ page_count = hp2->bh_page_count;
+ size = page_size * page_count;
+ if ((unsigned)vim_write(mfp->mf_fd,
+ (hp2 == NULL ? hp : hp2)->bh_data, size) != size)
+ {
+ /*
+ * Avoid repeating the error message, this mostly happens when the
+ * disk is full. We give the message again only after a succesful
+ * write or when hitting a key. We keep on trying, in case some
+ * space becomes available.
+ */
+ if (!did_swapwrite_msg)
+ EMSG(_("E297: Write error in swap file"));
+ did_swapwrite_msg = TRUE;
+ return FAIL;
+ }
+ did_swapwrite_msg = FALSE;
+ if (hp2 != NULL) /* written a non-dummy block */
+ hp2->bh_flags &= ~BH_DIRTY;
+ /* appended to the file */
+ if (nr + (blocknr_T)page_count > mfp->mf_infile_count)
+ mfp->mf_infile_count = nr + page_count;
+ if (nr == hp->bh_bnum) /* written the desired block */
+ break;
+ }
+ return OK;
+}
+
+/*
+ * Make block number for *hp positive and add it to the translation list
+ *
+ * Return FAIL for failure, OK otherwise
+ */
+ static int
+mf_trans_add(mfp, hp)
+ memfile_T *mfp;
+ bhdr_T *hp;
+{
+ bhdr_T *freep;
+ blocknr_T new_bnum;
+ int hash;
+ NR_TRANS *np;
+ int page_count;
+
+ if (hp->bh_bnum >= 0) /* it's already positive */
+ return OK;
+
+ if ((np = (NR_TRANS *)alloc((unsigned)sizeof(NR_TRANS))) == NULL)
+ return FAIL;
+
+/*
+ * get a new number for the block.
+ * If the first item in the free list has sufficient pages, use its number
+ * Otherwise use mf_blocknr_max.
+ */
+ freep = mfp->mf_free_first;
+ page_count = hp->bh_page_count;
+ if (freep != NULL && freep->bh_page_count >= page_count)
+ {
+ new_bnum = freep->bh_bnum;
+ /*
+ * If the page count of the free block was larger, recude it.
+ * If the page count matches, remove the block from the free list
+ */
+ if (freep->bh_page_count > page_count)
+ {
+ freep->bh_bnum += page_count;
+ freep->bh_page_count -= page_count;
+ }
+ else
+ {
+ freep = mf_rem_free(mfp);
+ vim_free(freep);
+ }
+ }
+ else
+ {
+ new_bnum = mfp->mf_blocknr_max;
+ mfp->mf_blocknr_max += page_count;
+ }
+
+ np->nt_old_bnum = hp->bh_bnum; /* adjust number */
+ np->nt_new_bnum = new_bnum;
+
+ mf_rem_hash(mfp, hp); /* remove from old hash list */
+ hp->bh_bnum = new_bnum;
+ mf_ins_hash(mfp, hp); /* insert in new hash list */
+
+ hash = MEMHASH(np->nt_old_bnum); /* insert in trans list */
+ np->nt_next = mfp->mf_trans[hash];
+ mfp->mf_trans[hash] = np;
+ if (np->nt_next != NULL)
+ np->nt_next->nt_prev = np;
+ np->nt_prev = NULL;
+
+ return OK;
+}
+
+/*
+ * Lookup a tranlation from the trans lists and delete the entry
+ *
+ * Return the positive new number when found, the old number when not found
+ */
+ blocknr_T
+mf_trans_del(mfp, old_nr)
+ memfile_T *mfp;
+ blocknr_T old_nr;
+{
+ int hash;
+ NR_TRANS *np;
+ blocknr_T new_bnum;
+
+ hash = MEMHASH(old_nr);
+ for (np = mfp->mf_trans[hash]; np != NULL; np = np->nt_next)
+ if (np->nt_old_bnum == old_nr)
+ break;
+ if (np == NULL) /* not found */
+ return old_nr;
+
+ mfp->mf_neg_count--;
+ new_bnum = np->nt_new_bnum;
+ if (np->nt_prev != NULL) /* remove entry from the trans list */
+ np->nt_prev->nt_next = np->nt_next;
+ else
+ mfp->mf_trans[hash] = np->nt_next;
+ if (np->nt_next != NULL)
+ np->nt_next->nt_prev = np->nt_prev;
+ vim_free(np);
+
+ return new_bnum;
+}
+
+/*
+ * Set mfp->mf_ffname according to mfp->mf_fname and some other things.
+ * Only called when creating or renaming the swapfile. Either way it's a new
+ * name so we must work out the full path name.
+ */
+ void
+mf_set_ffname(mfp)
+ memfile_T *mfp;
+{
+ mfp->mf_ffname = FullName_save(mfp->mf_fname, FALSE);
+}
+
+/*
+ * Make the name of the file used for the memfile a full path.
+ * Used before doing a :cd
+ */
+ void
+mf_fullname(mfp)
+ memfile_T *mfp;
+{
+ if (mfp != NULL && mfp->mf_fname != NULL && mfp->mf_ffname != NULL)
+ {
+ vim_free(mfp->mf_fname);
+ mfp->mf_fname = mfp->mf_ffname;
+ mfp->mf_ffname = NULL;
+ }
+}
+
+/*
+ * return TRUE if there are any translations pending for 'mfp'
+ */
+ int
+mf_need_trans(mfp)
+ memfile_T *mfp;
+{
+ return (mfp->mf_fname != NULL && mfp->mf_neg_count > 0);
+}
+
+/*
+ * Open a swap file for a memfile.
+ * The "fname" must be in allocated memory, and is consumed (also when an
+ * error occurs).
+ */
+ static void
+mf_do_open(mfp, fname, flags)
+ memfile_T *mfp;
+ char_u *fname;
+ int flags; /* flags for open() */
+{
+#ifdef HAVE_LSTAT
+ struct stat sb;
+#endif
+
+ mfp->mf_fname = fname;
+
+ /*
+ * Get the full path name before the open, because this is
+ * not possible after the open on the Amiga.
+ * fname cannot be NameBuff, because it must have been allocated.
+ */
+ mf_set_ffname(mfp);
+#if defined(MSDOS) || defined(MSWIN) || defined(RISCOS)
+ /*
+ * A ":!cd e:xxx" may change the directory without us knowning, use the
+ * full pathname always. Careful: This frees fname!
+ */
+ mf_fullname(mfp);
+#endif
+
+#ifdef HAVE_LSTAT
+ /*
+ * Extra security check: When creating a swap file it really shouldn't
+ * exist yet. If there is a symbolic link, this is most likely an attack.
+ */
+ if ((flags & O_CREAT) && mch_lstat((char *)mfp->mf_fname, &sb) >= 0)
+ {
+ mfp->mf_fd = -1;
+ EMSG(_("E300: Swap file already exists (symlink attack?)"));
+ }
+ else
+#endif
+ {
+ /*
+ * try to open the file
+ */
+ flags |= O_EXTRA;
+#ifdef WIN32
+ /* Prevent handle inheritance that cause problems with Cscope
+ * (swap file may not be deleted if cscope connection was open after
+ * the file) */
+ flags |= O_NOINHERIT;
+#endif
+ mfp->mf_fd = mch_open_rw((char *)mfp->mf_fname, flags);
+ }
+
+ /*
+ * If the file cannot be opened, use memory only
+ */
+ if (mfp->mf_fd < 0)
+ {
+ vim_free(mfp->mf_fname);
+ vim_free(mfp->mf_ffname);
+ mfp->mf_fname = NULL;
+ mfp->mf_ffname = NULL;
+ }
+ else
+ mch_hide(mfp->mf_fname); /* try setting the 'hidden' flag */
+}
diff --git a/src/memline.c b/src/memline.c
new file mode 100644
index 000000000..7c1866329
--- /dev/null
+++ b/src/memline.c
@@ -0,0 +1,4378 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/* for debugging */
+/* #define CHECK(c, s) if (c) EMSG(s) */
+#define CHECK(c, s)
+
+/*
+ * memline.c: Contains the functions for appending, deleting and changing the
+ * text lines. The memfile functions are used to store the information in blocks
+ * of memory, backed up by a file. The structure of the information is a tree.
+ * The root of the tree is a pointer block. The leaves of the tree are data
+ * blocks. In between may be several layers of pointer blocks, forming branches.
+ *
+ * Three types of blocks are used:
+ * - Block nr 0 contains information for recovery
+ * - Pointer blocks contain list of pointers to other blocks.
+ * - Data blocks contain the actual text.
+ *
+ * Block nr 0 contains the block0 structure (see below).
+ *
+ * Block nr 1 is the first pointer block. It is the root of the tree.
+ * Other pointer blocks are branches.
+ *
+ * If a line is too big to fit in a single page, the block containing that
+ * line is made big enough to hold the line. It may span several pages.
+ * Otherwise all blocks are one page.
+ *
+ * A data block that was filled when starting to edit a file and was not
+ * changed since then, can have a negative block number. This means that it
+ * has not yet been assigned a place in the file. When recovering, the lines
+ * in this data block can be read from the original file. When the block is
+ * changed (lines appended/deleted/changed) or when it is flushed it gets a
+ * positive number. Use mf_trans_del() to get the new number, before calling
+ * mf_get().
+ */
+
+#if defined(MSDOS) || defined(WIN32) || defined(_WIN64)
+# include <io.h>
+#endif
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifndef UNIX /* it's in os_unix.h for Unix */
+# include <time.h>
+#endif
+
+#ifdef SASC
+# include <proto/dos.h> /* for Open() and Close() */
+#endif
+
+typedef struct block0 ZERO_BL; /* contents of the first block */
+typedef struct pointer_block PTR_BL; /* contents of a pointer block */
+typedef struct data_block DATA_BL; /* contents of a data block */
+typedef struct pointer_entry PTR_EN; /* block/line-count pair */
+
+#define DATA_ID (('d' << 8) + 'a') /* data block id */
+#define PTR_ID (('p' << 8) + 't') /* pointer block id */
+#define BLOCK0_ID0 'b' /* block 0 id 0 */
+#define BLOCK0_ID1 '0' /* block 0 id 1 */
+
+/*
+ * pointer to a block, used in a pointer block
+ */
+struct pointer_entry
+{
+ blocknr_T pe_bnum; /* block number */
+ linenr_T pe_line_count; /* number of lines in this branch */
+ linenr_T pe_old_lnum; /* lnum for this block (for recovery) */
+ int pe_page_count; /* number of pages in block pe_bnum */
+};
+
+/*
+ * A pointer block contains a list of branches in the tree.
+ */
+struct pointer_block
+{
+ short_u pb_id; /* ID for pointer block: PTR_ID */
+ short_u pb_count; /* number of pointer in this block */
+ short_u pb_count_max; /* maximum value for pb_count */
+ PTR_EN pb_pointer[1]; /* list of pointers to blocks (actually longer)
+ * followed by empty space until end of page */
+};
+
+/*
+ * A data block is a leaf in the tree.
+ *
+ * The text of the lines is at the end of the block. The text of the first line
+ * in the block is put at the end, the text of the second line in front of it,
+ * etc. Thus the order of the lines is the opposite of the line number.
+ */
+struct data_block
+{
+ short_u db_id; /* ID for data block: DATA_ID */
+ unsigned db_free; /* free space available */
+ unsigned db_txt_start; /* byte where text starts */
+ unsigned db_txt_end; /* byte just after data block */
+ linenr_T db_line_count; /* number of lines in this block */
+ unsigned db_index[1]; /* index for start of line (actually bigger)
+ * followed by empty space upto db_txt_start
+ * followed by the text in the lines until
+ * end of page */
+};
+
+/*
+ * The low bits of db_index hold the actual index. The topmost bit is
+ * used for the global command to be able to mark a line.
+ * This method is not clean, but otherwise there would be at least one extra
+ * byte used for each line.
+ * The mark has to be in this place to keep it with the correct line when other
+ * lines are inserted or deleted.
+ */
+#define DB_MARKED ((unsigned)1 << ((sizeof(unsigned) * 8) - 1))
+#define DB_INDEX_MASK (~DB_MARKED)
+
+#define INDEX_SIZE (sizeof(unsigned)) /* size of one db_index entry */
+#define HEADER_SIZE (sizeof(DATA_BL) - INDEX_SIZE) /* size of data block header */
+
+#define B0_FNAME_SIZE 900
+#define B0_UNAME_SIZE 40
+#define B0_HNAME_SIZE 40
+/*
+ * Restrict the numbers to 32 bits, otherwise most compilers will complain.
+ * This won't detect a 64 bit machine that only swaps a byte in the top 32
+ * bits, but that is crazy anyway.
+ */
+#define B0_MAGIC_LONG 0x30313233L
+#define B0_MAGIC_INT 0x20212223L
+#define B0_MAGIC_SHORT 0x10111213L
+#define B0_MAGIC_CHAR 0x55
+
+/*
+ * Block zero holds all info about the swap file.
+ *
+ * NOTE: DEFINITION OF BLOCK 0 SHOULD NOT CHANGE! It would make all existing
+ * swap files unusable!
+ *
+ * If size of block0 changes anyway, adjust MIN_SWAP_PAGE_SIZE in vim.h!!
+ *
+ * This block is built up of single bytes, to make it portable accros
+ * different machines. b0_magic_* is used to check the byte order and size of
+ * variables, because the rest of the swap file is not portable.
+ */
+struct block0
+{
+ char_u b0_id[2]; /* id for block 0: BLOCK0_ID0 and BLOCK0_ID1 */
+ char_u b0_version[10]; /* Vim version string */
+ char_u b0_page_size[4];/* number of bytes per page */
+ char_u b0_mtime[4]; /* last modification time of file */
+ char_u b0_ino[4]; /* inode of b0_fname */
+ char_u b0_pid[4]; /* process id of creator (or 0) */
+ char_u b0_uname[B0_UNAME_SIZE]; /* name of user (uid if no name) */
+ char_u b0_hname[B0_HNAME_SIZE]; /* host name (if it has a name) */
+ char_u b0_fname[B0_FNAME_SIZE]; /* name of file being edited */
+ long b0_magic_long; /* check for byte order of long */
+ int b0_magic_int; /* check for byte order of int */
+ short b0_magic_short; /* check for byte order of short */
+ char_u b0_magic_char; /* check for last char */
+};
+#define b0_dirty b0_fname[B0_FNAME_SIZE-1]
+
+#define STACK_INCR 5 /* nr of entries added to ml_stack at a time */
+
+/*
+ * The line number where the first mark may be is remembered.
+ * If it is 0 there are no marks at all.
+ * (always used for the current buffer only, no buffer change possible while
+ * executing a global command).
+ */
+static linenr_T lowest_marked = 0;
+
+/*
+ * arguments for ml_find_line()
+ */
+#define ML_DELETE 0x11 /* delete line */
+#define ML_INSERT 0x12 /* insert line */
+#define ML_FIND 0x13 /* just find the line */
+#define ML_FLUSH 0x02 /* flush locked block */
+#define ML_SIMPLE(x) (x & 0x10) /* DEL, INS or FIND */
+
+static void set_b0_fname __ARGS((ZERO_BL *, buf_T *buf));
+static time_t swapfile_info __ARGS((char_u *));
+static int recov_file_names __ARGS((char_u **, char_u *, int prepend_dot));
+static int ml_append_int __ARGS((buf_T *, linenr_T, char_u *, colnr_T, int, int));
+static int ml_delete_int __ARGS((buf_T *, linenr_T, int));
+static char_u *findswapname __ARGS((buf_T *, char_u **, char_u *));
+static void ml_flush_line __ARGS((buf_T *));
+static bhdr_T *ml_new_data __ARGS((memfile_T *, int, int));
+static bhdr_T *ml_new_ptr __ARGS((memfile_T *));
+static bhdr_T *ml_find_line __ARGS((buf_T *, linenr_T, int));
+static int ml_add_stack __ARGS((buf_T *));
+static char_u *makeswapname __ARGS((buf_T *, char_u *));
+static void ml_lineadd __ARGS((buf_T *, int));
+static int b0_magic_wrong __ARGS((ZERO_BL *));
+#ifdef CHECK_INODE
+static int fnamecmp_ino __ARGS((char_u *, char_u *, long));
+#endif
+static void long_to_char __ARGS((long, char_u *));
+static long char_to_long __ARGS((char_u *));
+#if defined(UNIX) || defined(WIN3264)
+static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name));
+#endif
+#ifdef FEAT_BYTEOFF
+static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype));
+#endif
+
+/*
+ * open a new memline for 'curbuf'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+ml_open()
+{
+ memfile_T *mfp;
+ bhdr_T *hp = NULL;
+ ZERO_BL *b0p;
+ PTR_BL *pp;
+ DATA_BL *dp;
+
+/*
+ * init fields in memline struct
+ */
+ curbuf->b_ml.ml_stack_size = 0; /* no stack yet */
+ curbuf->b_ml.ml_stack = NULL; /* no stack yet */
+ curbuf->b_ml.ml_stack_top = 0; /* nothing in the stack */
+ curbuf->b_ml.ml_locked = NULL; /* no cached block */
+ curbuf->b_ml.ml_line_lnum = 0; /* no cached line */
+#ifdef FEAT_BYTEOFF
+ curbuf->b_ml.ml_chunksize = NULL;
+#endif
+
+/*
+ * When 'updatecount' is non-zero, flag that a swap file may be opened later.
+ */
+ if (p_uc && curbuf->b_p_swf)
+ curbuf->b_may_swap = TRUE;
+ else
+ curbuf->b_may_swap = FALSE;
+
+/*
+ * Open the memfile. No swap file is created yet.
+ */
+ mfp = mf_open(NULL, 0);
+ if (mfp == NULL)
+ goto error;
+
+ curbuf->b_ml.ml_mfp = mfp;
+ curbuf->b_ml.ml_flags = ML_EMPTY;
+ curbuf->b_ml.ml_line_count = 1;
+
+#if defined(MSDOS) && !defined(DJGPP)
+ /* for 16 bit MS-DOS create a swapfile now, because we run out of
+ * memory very quickly */
+ if (p_uc != 0)
+ ml_open_file(curbuf);
+#endif
+
+/*
+ * fill block0 struct and write page 0
+ */
+ if ((hp = mf_new(mfp, FALSE, 1)) == NULL)
+ goto error;
+ if (hp->bh_bnum != 0)
+ {
+ EMSG(_("E298: Didn't get block nr 0?"));
+ goto error;
+ }
+ b0p = (ZERO_BL *)(hp->bh_data);
+
+ b0p->b0_id[0] = BLOCK0_ID0;
+ b0p->b0_id[1] = BLOCK0_ID1;
+ b0p->b0_dirty = curbuf->b_changed ? 0x55 : 0;
+ b0p->b0_magic_long = (long)B0_MAGIC_LONG;
+ b0p->b0_magic_int = (int)B0_MAGIC_INT;
+ b0p->b0_magic_short = (short)B0_MAGIC_SHORT;
+ b0p->b0_magic_char = B0_MAGIC_CHAR;
+
+ STRNCPY(b0p->b0_version, "VIM ", 4);
+ STRNCPY(b0p->b0_version + 4, Version, 6);
+ set_b0_fname(b0p, curbuf);
+ long_to_char((long)mfp->mf_page_size, b0p->b0_page_size);
+ (void)get_user_name(b0p->b0_uname, B0_UNAME_SIZE);
+ b0p->b0_uname[B0_UNAME_SIZE - 1] = NUL;
+ mch_get_host_name(b0p->b0_hname, B0_HNAME_SIZE);
+ b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL;
+ long_to_char(mch_get_pid(), b0p->b0_pid);
+
+ /*
+ * Always sync block number 0 to disk, so we can check the file name in
+ * the swap file in findswapname(). Don't do this for help files though.
+ * Only works when there's a swapfile, otherwise it's done when the file
+ * is created.
+ */
+ mf_put(mfp, hp, TRUE, FALSE);
+ if (!curbuf->b_help)
+ (void)mf_sync(mfp, 0);
+
+/*
+ * fill in root pointer block and write page 1
+ */
+ if ((hp = ml_new_ptr(mfp)) == NULL)
+ goto error;
+ if (hp->bh_bnum != 1)
+ {
+ EMSG(_("E298: Didn't get block nr 1?"));
+ goto error;
+ }
+ pp = (PTR_BL *)(hp->bh_data);
+ pp->pb_count = 1;
+ pp->pb_pointer[0].pe_bnum = 2;
+ pp->pb_pointer[0].pe_page_count = 1;
+ pp->pb_pointer[0].pe_old_lnum = 1;
+ pp->pb_pointer[0].pe_line_count = 1; /* line count after insertion */
+ mf_put(mfp, hp, TRUE, FALSE);
+
+/*
+ * allocate first data block and create an empty line 1.
+ */
+ if ((hp = ml_new_data(mfp, FALSE, 1)) == NULL)
+ goto error;
+ if (hp->bh_bnum != 2)
+ {
+ EMSG(_("E298: Didn't get block nr 2?"));
+ goto error;
+ }
+
+ dp = (DATA_BL *)(hp->bh_data);
+ dp->db_index[0] = --dp->db_txt_start; /* at end of block */
+ dp->db_free -= 1 + INDEX_SIZE;
+ dp->db_line_count = 1;
+ *((char_u *)dp + dp->db_txt_start) = NUL; /* emtpy line */
+
+ return OK;
+
+error:
+ if (mfp != NULL)
+ {
+ if (hp)
+ mf_put(mfp, hp, FALSE, FALSE);
+ mf_close(mfp, TRUE); /* will also free(mfp->mf_fname) */
+ }
+ curbuf->b_ml.ml_mfp = NULL;
+ return FAIL;
+}
+
+/*
+ * ml_setname() is called when the file name of "buf" has been changed.
+ * It may rename the swap file.
+ */
+ void
+ml_setname(buf)
+ buf_T *buf;
+{
+ int success = FALSE;
+ memfile_T *mfp;
+ char_u *fname;
+ char_u *dirp;
+#if defined(MSDOS) || defined(MSWIN)
+ char_u *p;
+#endif
+
+ mfp = buf->b_ml.ml_mfp;
+ if (mfp->mf_fd < 0) /* there is no swap file yet */
+ {
+ /*
+ * When 'updatecount' is 0 and 'noswapfile' there is no swap file.
+ * For help files we will make a swap file now.
+ */
+ if (p_uc != 0)
+ ml_open_file(buf); /* create a swap file */
+ return;
+ }
+
+ /*
+ * Try all directories in the 'directory' option.
+ */
+ dirp = p_dir;
+ for (;;)
+ {
+ if (*dirp == NUL) /* tried all directories, fail */
+ break;
+ fname = findswapname(buf, &dirp, mfp->mf_fname); /* alloc's fname */
+ if (fname == NULL) /* no file name found for this dir */
+ continue;
+
+#if defined(MSDOS) || defined(MSWIN)
+ /*
+ * Set full pathname for swap file now, because a ":!cd dir" may
+ * change directory without us knowing it.
+ */
+ p = FullName_save(fname, FALSE);
+ vim_free(fname);
+ fname = p;
+ if (fname == NULL)
+ continue;
+#endif
+ /* if the file name is the same we don't have to do anything */
+ if (fnamecmp(fname, mfp->mf_fname) == 0)
+ {
+ vim_free(fname);
+ success = TRUE;
+ break;
+ }
+ /* need to close the swap file before renaming */
+ if (mfp->mf_fd >= 0)
+ {
+ close(mfp->mf_fd);
+ mfp->mf_fd = -1;
+ }
+
+ /* try to rename the swap file */
+ if (vim_rename(mfp->mf_fname, fname) == 0)
+ {
+ success = TRUE;
+ vim_free(mfp->mf_fname);
+ mfp->mf_fname = fname;
+ vim_free(mfp->mf_ffname);
+#if defined(MSDOS) || defined(MSWIN)
+ mfp->mf_ffname = NULL; /* mf_fname is full pathname already */
+#else
+ mf_set_ffname(mfp);
+#endif
+ break;
+ }
+ vim_free(fname); /* this fname didn't work, try another */
+ }
+
+ if (mfp->mf_fd == -1) /* need to (re)open the swap file */
+ {
+ mfp->mf_fd = mch_open((char *)mfp->mf_fname, O_RDWR | O_EXTRA, 0);
+ if (mfp->mf_fd < 0)
+ {
+ /* could not (re)open the swap file, what can we do???? */
+ EMSG(_("E301: Oops, lost the swap file!!!"));
+ return;
+ }
+ }
+ if (!success)
+ EMSG(_("E302: Could not rename swap file"));
+}
+
+/*
+ * Open a file for the memfile for all buffers that are not readonly or have
+ * been modified.
+ * Used when 'updatecount' changes from zero to non-zero.
+ */
+ void
+ml_open_files()
+{
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (!buf->b_p_ro || buf->b_changed)
+ ml_open_file(buf);
+}
+
+/*
+ * Open a swap file for an existing memfile, if there is no swap file yet.
+ * If we are unable to find a file name, mf_fname will be NULL
+ * and the memfile will be in memory only (no recovery possible).
+ */
+ void
+ml_open_file(buf)
+ buf_T *buf;
+{
+ memfile_T *mfp;
+ char_u *fname;
+ char_u *dirp;
+
+ mfp = buf->b_ml.ml_mfp;
+ if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf)
+ return; /* nothing to do */
+
+ /*
+ * Try all directories in 'directory' option.
+ */
+ dirp = p_dir;
+ for (;;)
+ {
+ if (*dirp == NUL)
+ break;
+ /* There is a small chance that between chosing the swap file name and
+ * creating it, another Vim creates the file. In that case the
+ * creation will fail and we will use another directory. */
+ fname = findswapname(buf, &dirp, NULL); /* allocates fname */
+ if (fname == NULL)
+ continue;
+ if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
+ {
+#if defined(MSDOS) || defined(MSWIN) || defined(RISCOS)
+ /*
+ * set full pathname for swap file now, because a ":!cd dir" may
+ * change directory without us knowing it.
+ */
+ mf_fullname(mfp);
+#endif
+ /* Flush block zero, so others can read it */
+ if (mf_sync(mfp, MFS_ZERO) == OK)
+ break;
+ /* Writing block 0 failed: close the file and try another dir */
+ mf_close_file(buf, FALSE);
+ }
+ }
+
+ if (mfp->mf_fname == NULL) /* Failed! */
+ {
+ need_wait_return = TRUE; /* call wait_return later */
+ ++no_wait_return;
+ (void)EMSG2(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
+ buf_spname(buf) != NULL
+ ? (char_u *)buf_spname(buf)
+ : buf->b_fname);
+ --no_wait_return;
+ }
+
+ /* don't try to open a swap file again */
+ buf->b_may_swap = FALSE;
+}
+
+/*
+ * If still need to create a swap file, and starting to edit a not-readonly
+ * file, or reading into an existing buffer, create a swap file now.
+ */
+ void
+check_need_swap(newfile)
+ int newfile; /* reading file into new buffer */
+{
+ if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
+ ml_open_file(curbuf);
+}
+
+/*
+ * Close memline for buffer 'buf'.
+ * If 'del_file' is TRUE, delete the swap file
+ */
+ void
+ml_close(buf, del_file)
+ buf_T *buf;
+ int del_file;
+{
+ if (buf->b_ml.ml_mfp == NULL) /* not open */
+ return;
+ mf_close(buf->b_ml.ml_mfp, del_file); /* close the .swp file */
+ if (buf->b_ml.ml_line_lnum != 0 && (buf->b_ml.ml_flags & ML_LINE_DIRTY))
+ vim_free(buf->b_ml.ml_line_ptr);
+ vim_free(buf->b_ml.ml_stack);
+#ifdef FEAT_BYTEOFF
+ vim_free(buf->b_ml.ml_chunksize);
+ buf->b_ml.ml_chunksize = NULL;
+#endif
+ buf->b_ml.ml_mfp = NULL;
+
+ /* Reset the "recovered" flag, give the ATTENTION prompt the next time
+ * this buffer is loaded. */
+ buf->b_flags &= ~BF_RECOVERED;
+}
+
+/*
+ * Close all existing memlines and memfiles.
+ * Only used when exiting.
+ * When 'del_file' is TRUE, delete the memfiles.
+ */
+ void
+ml_close_all(del_file)
+ int del_file;
+{
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ ml_close(buf, del_file);
+#ifdef TEMPDIRNAMES
+ vim_deltempdir(); /* delete created temp directory */
+#endif
+}
+
+/*
+ * Close all memfiles for not modified buffers.
+ * Only use just before exiting!
+ */
+ void
+ml_close_notmod()
+{
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (!bufIsChanged(buf))
+ ml_close(buf, TRUE); /* close all not-modified buffers */
+}
+
+/*
+ * Update the timestamp in the .swp file.
+ * Used when the file has been written.
+ */
+ void
+ml_timestamp(buf)
+ buf_T *buf;
+{
+ memfile_T *mfp;
+ bhdr_T *hp;
+ ZERO_BL *b0p;
+
+ mfp = buf->b_ml.ml_mfp;
+
+ if (mfp == NULL || (hp = mf_get(mfp, (blocknr_T)0, 1)) == NULL)
+ return;
+ b0p = (ZERO_BL *)(hp->bh_data);
+ if (b0p->b0_id[0] != BLOCK0_ID0 || b0p->b0_id[1] != BLOCK0_ID1)
+ EMSG(_("E304: ml_timestamp: Didn't get block 0??"));
+ else
+ set_b0_fname(b0p, buf);
+ mf_put(mfp, hp, TRUE, FALSE);
+}
+
+/*
+ * Write file name and timestamp into block 0 of a swap file.
+ * Also set buf->b_mtime.
+ * Don't use NameBuff[]!!!
+ */
+ static void
+set_b0_fname(b0p, buf)
+ ZERO_BL *b0p;
+ buf_T *buf;
+{
+ struct stat st;
+
+ if (buf->b_ffname == NULL)
+ b0p->b0_fname[0] = NUL;
+ else
+ {
+#if defined(MSDOS) || defined(MSWIN) || defined(AMIGA) || defined(RISCOS)
+ /* systems that cannot translate "~user" back into a path: copy the
+ * file name unmodified */
+ STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE);
+#else
+ size_t flen, ulen;
+ char_u uname[B0_UNAME_SIZE];
+
+ /*
+ * For a file under the home directory of the current user, we try to
+ * replace the home directory path with "~user". This helps when
+ * editing the same file on different machines over a network.
+ * First replace home dir path with "~/" with home_replace().
+ * Then insert the user name to get "~user/".
+ */
+ home_replace(NULL, buf->b_ffname, b0p->b0_fname, B0_FNAME_SIZE, TRUE);
+ if (b0p->b0_fname[0] == '~')
+ {
+ flen = STRLEN(b0p->b0_fname);
+ /* If there is no user name or it is too long, don't use "~/" */
+ if (get_user_name(uname, B0_UNAME_SIZE) == FAIL
+ || (ulen = STRLEN(uname)) + flen > B0_FNAME_SIZE - 1)
+ STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE);
+ else
+ {
+ mch_memmove(b0p->b0_fname + ulen + 1, b0p->b0_fname + 1, flen);
+ mch_memmove(b0p->b0_fname + 1, uname, ulen);
+ }
+ }
+#endif
+ if (mch_stat((char *)buf->b_ffname, &st) >= 0)
+ {
+ long_to_char((long)st.st_mtime, b0p->b0_mtime);
+#ifdef CHECK_INODE
+ long_to_char((long)st.st_ino, b0p->b0_ino);
+#endif
+ buf_store_time(buf, &st, buf->b_ffname);
+ buf->b_mtime_read = buf->b_mtime;
+ }
+ else
+ {
+ long_to_char(0L, b0p->b0_mtime);
+#ifdef CHECK_INODE
+ long_to_char(0L, b0p->b0_ino);
+#endif
+ buf->b_mtime = 0;
+ buf->b_mtime_read = 0;
+ buf->b_orig_size = 0;
+ buf->b_orig_mode = 0;
+ }
+ }
+}
+
+/*
+ * try to recover curbuf from the .swp file
+ */
+ void
+ml_recover()
+{
+ buf_T *buf = NULL;
+ memfile_T *mfp = NULL;
+ char_u *fname;
+ bhdr_T *hp = NULL;
+ ZERO_BL *b0p;
+ PTR_BL *pp;
+ DATA_BL *dp;
+ infoptr_T *ip;
+ blocknr_T bnum;
+ int page_count;
+ struct stat org_stat, swp_stat;
+ int len;
+ int directly;
+ linenr_T lnum;
+ char_u *p;
+ int i;
+ long error;
+ int cannot_open;
+ linenr_T line_count;
+ int has_error;
+ int idx;
+ int top;
+ int txt_start;
+ off_t size;
+ int called_from_main;
+ int serious_error = TRUE;
+ long mtime;
+ int attr;
+
+ recoverymode = TRUE;
+ called_from_main = (curbuf->b_ml.ml_mfp == NULL);
+ attr = hl_attr(HLF_E);
+/*
+ * If the file name ends in ".sw?" we use it directly.
+ * Otherwise a search is done to find the swap file(s).
+ */
+ fname = curbuf->b_fname;
+ if (fname == NULL) /* When there is no file name */
+ fname = (char_u *)"";
+ len = (int)STRLEN(fname);
+ if (len >= 4 &&
+#if defined(VMS) || defined(RISCOS)
+ STRNICMP(fname + len - 4, "_sw" , 3)
+#else
+ STRNICMP(fname + len - 4, ".sw" , 3)
+#endif
+ == 0)
+ {
+ directly = TRUE;
+ fname = vim_strsave(fname); /* make a copy for mf_open() */
+ }
+ else
+ {
+ directly = FALSE;
+
+ /* count the number of matching swap files */
+ len = recover_names(&fname, FALSE, 0);
+ if (len == 0) /* no swap files found */
+ {
+ EMSG2(_("E305: No swap file found for %s"), fname);
+ goto theend;
+ }
+ if (len == 1) /* one swap file found, use it */
+ i = 1;
+ else /* several swap files found, choose */
+ {
+ /* list the names of the swap files */
+ (void)recover_names(&fname, TRUE, 0);
+ msg_putchar('\n');
+ MSG_PUTS(_("Enter number of swap file to use (0 to quit): "));
+ i = get_number(FALSE);
+ if (i < 1 || i > len)
+ goto theend;
+ }
+ /* get the swap file name that will be used */
+ (void)recover_names(&fname, FALSE, i);
+ }
+ if (fname == NULL)
+ goto theend; /* out of memory */
+
+ /* When called from main() still need to initialize storage structure */
+ if (called_from_main && ml_open() == FAIL)
+ getout(1);
+
+/*
+ * allocate a buffer structure (only the memline in it is really used)
+ */
+ buf = (buf_T *)alloc((unsigned)sizeof(buf_T));
+ if (buf == NULL)
+ {
+ vim_free(fname);
+ goto theend;
+ }
+
+/*
+ * init fields in memline struct
+ */
+ buf->b_ml.ml_stack_size = 0; /* no stack yet */
+ buf->b_ml.ml_stack = NULL; /* no stack yet */
+ buf->b_ml.ml_stack_top = 0; /* nothing in the stack */
+ buf->b_ml.ml_line_lnum = 0; /* no cached line */
+ buf->b_ml.ml_locked = NULL; /* no locked block */
+ buf->b_ml.ml_flags = 0;
+
+/*
+ * open the memfile from the old swap file
+ */
+ p = vim_strsave(fname); /* save fname for the message
+ (mf_open() may free fname) */
+ mfp = mf_open(fname, O_RDONLY); /* consumes fname! */
+ if (mfp == NULL || mfp->mf_fd < 0)
+ {
+ if (p != NULL)
+ {
+ EMSG2(_("E306: Cannot open %s"), p);
+ vim_free(p);
+ }
+ goto theend;
+ }
+ vim_free(p);
+ buf->b_ml.ml_mfp = mfp;
+
+ /*
+ * The page size set in mf_open() might be different from the page size
+ * used in the swap file, we must get it from block 0. But to read block
+ * 0 we need a page size. Use the minimal size for block 0 here, it will
+ * be set to the real value below.
+ */
+ mfp->mf_page_size = MIN_SWAP_PAGE_SIZE;
+
+/*
+ * try to read block 0
+ */
+ if ((hp = mf_get(mfp, (blocknr_T)0, 1)) == NULL)
+ {
+ msg_start();
+ MSG_PUTS_ATTR(_("Unable to read block 0 from "), attr | MSG_HIST);
+ msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
+ MSG_PUTS_ATTR(
+ _("\nMaybe no changes were made or Vim did not update the swap file."),
+ attr | MSG_HIST);
+ msg_end();
+ goto theend;
+ }
+ b0p = (ZERO_BL *)(hp->bh_data);
+ if (STRNCMP(b0p->b0_version, "VIM 3.0", 7) == 0)
+ {
+ msg_start();
+ msg_outtrans_attr(mfp->mf_fname, MSG_HIST);
+ MSG_PUTS_ATTR(_(" cannot be used with this version of Vim.\n"),
+ MSG_HIST);
+ MSG_PUTS_ATTR(_("Use Vim version 3.0.\n"), MSG_HIST);
+ msg_end();
+ goto theend;
+ }
+ if (b0p->b0_id[0] != BLOCK0_ID0 || b0p->b0_id[1] != BLOCK0_ID1)
+ {
+ EMSG2(_("E307: %s does not look like a Vim swap file"), mfp->mf_fname);
+ goto theend;
+ }
+ if (b0_magic_wrong(b0p))
+ {
+ msg_start();
+ msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
+#if defined(MSDOS) || defined(MSWIN)
+ if (STRNCMP(b0p->b0_hname, "PC ", 3) == 0)
+ MSG_PUTS_ATTR(_(" cannot be used with this version of Vim.\n"),
+ attr | MSG_HIST);
+ else
+#endif
+ MSG_PUTS_ATTR(_(" cannot be used on this computer.\n"),
+ attr | MSG_HIST);
+ MSG_PUTS_ATTR(_("The file was created on "), attr | MSG_HIST);
+ /* avoid going past the end of a currupted hostname */
+ b0p->b0_fname[0] = NUL;
+ MSG_PUTS_ATTR(b0p->b0_hname, attr | MSG_HIST);
+ MSG_PUTS_ATTR(_(",\nor the file has been damaged."), attr | MSG_HIST);
+ msg_end();
+ goto theend;
+ }
+ /*
+ * If we guessed the wrong page size, we have to recalculate the
+ * highest block number in the file.
+ */
+ if (mfp->mf_page_size != (unsigned)char_to_long(b0p->b0_page_size))
+ {
+ mf_new_page_size(mfp, (unsigned)char_to_long(b0p->b0_page_size));
+ if ((size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
+ mfp->mf_blocknr_max = 0; /* no file or empty file */
+ else
+ mfp->mf_blocknr_max = (blocknr_T)(size / mfp->mf_page_size);
+ mfp->mf_infile_count = mfp->mf_blocknr_max;
+ }
+
+/*
+ * If .swp file name given directly, use name from swap file for buffer.
+ */
+ if (directly)
+ {
+ expand_env(b0p->b0_fname, NameBuff, MAXPATHL);
+ if (setfname(curbuf, NameBuff, NULL, TRUE) == FAIL)
+ goto theend;
+ }
+
+ home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE);
+ msg_str((char_u *)_("Using swap file \"%s\""), NameBuff);
+
+ if (buf_spname(curbuf) != NULL)
+ STRCPY(NameBuff, buf_spname(curbuf));
+ else
+ home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
+ msg_str((char_u *)_("Original file \"%s\""), NameBuff);
+ msg_putchar('\n');
+
+/*
+ * check date of swap file and original file
+ */
+ mtime = char_to_long(b0p->b0_mtime);
+ if (curbuf->b_ffname != NULL
+ && mch_stat((char *)curbuf->b_ffname, &org_stat) != -1
+ && ((mch_stat((char *)mfp->mf_fname, &swp_stat) != -1
+ && org_stat.st_mtime > swp_stat.st_mtime)
+ || org_stat.st_mtime != mtime))
+ {
+ EMSG(_("E308: Warning: Original file may have been changed"));
+ }
+ out_flush();
+ mf_put(mfp, hp, FALSE, FALSE); /* release block 0 */
+ hp = NULL;
+
+ /*
+ * Now that we are sure that the file is going to be recovered, clear the
+ * contents of the current buffer.
+ */
+ while (!(curbuf->b_ml.ml_flags & ML_EMPTY))
+ ml_delete((linenr_T)1, FALSE);
+
+ /*
+ * Try reading the original file to obtain the values of 'fileformat',
+ * 'fileencoding', etc. Ignore errors. The text itself is not used.
+ */
+ if (curbuf->b_ffname != NULL)
+ {
+ (void)readfile(curbuf->b_ffname, NULL, (linenr_T)0,
+ (linenr_T)0, (linenr_T)MAXLNUM, NULL, READ_NEW);
+ while (!(curbuf->b_ml.ml_flags & ML_EMPTY))
+ ml_delete((linenr_T)1, FALSE);
+ }
+
+ bnum = 1; /* start with block 1 */
+ page_count = 1; /* which is 1 page */
+ lnum = 0; /* append after line 0 in curbuf */
+ line_count = 0;
+ idx = 0; /* start with first index in block 1 */
+ error = 0;
+ buf->b_ml.ml_stack_top = 0;
+ buf->b_ml.ml_stack = NULL;
+ buf->b_ml.ml_stack_size = 0; /* no stack yet */
+
+ if (curbuf->b_ffname == NULL)
+ cannot_open = TRUE;
+ else
+ cannot_open = FALSE;
+
+ serious_error = FALSE;
+ for ( ; !got_int; line_breakcheck())
+ {
+ if (hp != NULL)
+ mf_put(mfp, hp, FALSE, FALSE); /* release previous block */
+
+ /*
+ * get block
+ */
+ if ((hp = mf_get(mfp, (blocknr_T)bnum, page_count)) == NULL)
+ {
+ if (bnum == 1)
+ {
+ EMSG2(_("E309: Unable to read block 1 from %s"), mfp->mf_fname);
+ goto theend;
+ }
+ ++error;
+ ml_append(lnum++, (char_u *)_("???MANY LINES MISSING"),
+ (colnr_T)0, TRUE);
+ }
+ else /* there is a block */
+ {
+ pp = (PTR_BL *)(hp->bh_data);
+ if (pp->pb_id == PTR_ID) /* it is a pointer block */
+ {
+ /* check line count when using pointer block first time */
+ if (idx == 0 && line_count != 0)
+ {
+ for (i = 0; i < (int)pp->pb_count; ++i)
+ line_count -= pp->pb_pointer[i].pe_line_count;
+ if (line_count != 0)
+ {
+ ++error;
+ ml_append(lnum++, (char_u *)_("???LINE COUNT WRONG"),
+ (colnr_T)0, TRUE);
+ }
+ }
+
+ if (pp->pb_count == 0)
+ {
+ ml_append(lnum++, (char_u *)_("???EMPTY BLOCK"),
+ (colnr_T)0, TRUE);
+ ++error;
+ }
+ else if (idx < (int)pp->pb_count) /* go a block deeper */
+ {
+ if (pp->pb_pointer[idx].pe_bnum < 0)
+ {
+ /*
+ * Data block with negative block number.
+ * Try to read lines from the original file.
+ * This is slow, but it works.
+ */
+ if (!cannot_open)
+ {
+ line_count = pp->pb_pointer[idx].pe_line_count;
+ if (readfile(curbuf->b_ffname, NULL, lnum,
+ pp->pb_pointer[idx].pe_old_lnum - 1,
+ line_count, NULL, 0) == FAIL)
+ cannot_open = TRUE;
+ else
+ lnum += line_count;
+ }
+ if (cannot_open)
+ {
+ ++error;
+ ml_append(lnum++, (char_u *)_("???LINES MISSING"),
+ (colnr_T)0, TRUE);
+ }
+ ++idx; /* get same block again for next index */
+ continue;
+ }
+
+ /*
+ * going one block deeper in the tree
+ */
+ if ((top = ml_add_stack(buf)) < 0) /* new entry in stack */
+ {
+ ++error;
+ break; /* out of memory */
+ }
+ ip = &(buf->b_ml.ml_stack[top]);
+ ip->ip_bnum = bnum;
+ ip->ip_index = idx;
+
+ bnum = pp->pb_pointer[idx].pe_bnum;
+ line_count = pp->pb_pointer[idx].pe_line_count;
+ page_count = pp->pb_pointer[idx].pe_page_count;
+ continue;
+ }
+ }
+ else /* not a pointer block */
+ {
+ dp = (DATA_BL *)(hp->bh_data);
+ if (dp->db_id != DATA_ID) /* block id wrong */
+ {
+ if (bnum == 1)
+ {
+ EMSG2(_("E310: Block 1 ID wrong (%s not a .swp file?)"),
+ mfp->mf_fname);
+ goto theend;
+ }
+ ++error;
+ ml_append(lnum++, (char_u *)_("???BLOCK MISSING"),
+ (colnr_T)0, TRUE);
+ }
+ else
+ {
+ /*
+ * it is a data block
+ * Append all the lines in this block
+ */
+ has_error = FALSE;
+ /*
+ * check length of block
+ * if wrong, use length in pointer block
+ */
+ if (page_count * mfp->mf_page_size != dp->db_txt_end)
+ {
+ ml_append(lnum++, (char_u *)_("??? from here until ???END lines may be messed up"),
+ (colnr_T)0, TRUE);
+ ++error;
+ has_error = TRUE;
+ dp->db_txt_end = page_count * mfp->mf_page_size;
+ }
+
+ /* make sure there is a NUL at the end of the block */
+ *((char_u *)dp + dp->db_txt_end - 1) = NUL;
+
+ /*
+ * check number of lines in block
+ * if wrong, use count in data block
+ */
+ if (line_count != dp->db_line_count)
+ {
+ ml_append(lnum++, (char_u *)_("??? from here until ???END lines may have been inserted/deleted"),
+ (colnr_T)0, TRUE);
+ ++error;
+ has_error = TRUE;
+ }
+
+ for (i = 0; i < dp->db_line_count; ++i)
+ {
+ txt_start = (dp->db_index[i] & DB_INDEX_MASK);
+ if (txt_start <= HEADER_SIZE
+ || txt_start >= (int)dp->db_txt_end)
+ {
+ p = (char_u *)"???";
+ ++error;
+ }
+ else
+ p = (char_u *)dp + txt_start;
+ ml_append(lnum++, p, (colnr_T)0, TRUE);
+ }
+ if (has_error)
+ ml_append(lnum++, (char_u *)_("???END"), (colnr_T)0, TRUE);
+ }
+ }
+ }
+
+ if (buf->b_ml.ml_stack_top == 0) /* finished */
+ break;
+
+ /*
+ * go one block up in the tree
+ */
+ ip = &(buf->b_ml.ml_stack[--(buf->b_ml.ml_stack_top)]);
+ bnum = ip->ip_bnum;
+ idx = ip->ip_index + 1; /* go to next index */
+ page_count = 1;
+ }
+
+ /*
+ * The dummy line from the empty buffer will now be after the last line in
+ * the buffer. Delete it.
+ */
+ ml_delete(curbuf->b_ml.ml_line_count, FALSE);
+ curbuf->b_flags |= BF_RECOVERED;
+
+ recoverymode = FALSE;
+ if (got_int)
+ EMSG(_("E311: Recovery Interrupted"));
+ else if (error)
+ {
+ ++no_wait_return;
+ MSG(">>>>>>>>>>>>>");
+ EMSG(_("E312: Errors detected while recovering; look for lines starting with ???"));
+ --no_wait_return;
+ MSG(_("See \":help E312\" for more information."));
+ MSG(">>>>>>>>>>>>>");
+ }
+ else
+ {
+ MSG(_("Recovery completed. You should check if everything is OK."));
+ MSG_PUTS(_("\n(You might want to write out this file under another name\n"));
+ MSG_PUTS(_("and run diff with the original file to check for changes)\n"));
+ MSG_PUTS(_("Delete the .swp file afterwards.\n\n"));
+ cmdline_row = msg_row;
+ }
+ redraw_curbuf_later(NOT_VALID);
+
+theend:
+ recoverymode = FALSE;
+ if (mfp != NULL)
+ {
+ if (hp != NULL)
+ mf_put(mfp, hp, FALSE, FALSE);
+ mf_close(mfp, FALSE); /* will also vim_free(mfp->mf_fname) */
+ }
+ vim_free(buf);
+ if (serious_error && called_from_main)
+ ml_close(curbuf, TRUE);
+#ifdef FEAT_AUTOCMD
+ else
+ {
+ apply_autocmds(EVENT_BUFREADPOST, NULL, curbuf->b_fname, FALSE, curbuf);
+ apply_autocmds(EVENT_BUFWINENTER, NULL, curbuf->b_fname, FALSE, curbuf);
+ }
+#endif
+ return;
+}
+
+/*
+ * Find the names of swap files in current directory and the directory given
+ * with the 'directory' option.
+ *
+ * Used to:
+ * - list the swap files for "vim -r"
+ * - count the number of swap files when recovering
+ * - list the swap files when recovering
+ * - find the name of the n'th swap file when recovering
+ */
+ int
+recover_names(fname, list, nr)
+ char_u **fname; /* base for swap file name */
+ int list; /* when TRUE, list the swap file names */
+ int nr; /* when non-zero, return nr'th swap file name */
+{
+ int num_names;
+ char_u *(names[6]);
+ char_u *tail;
+ char_u *p;
+ int num_files;
+ int file_count = 0;
+ char_u **files;
+ int i;
+ char_u *dirp;
+ char_u *dir_name;
+
+ if (list)
+ {
+ /* use msg() to start the scrolling properly */
+ msg((char_u *)_("Swap files found:"));
+ msg_putchar('\n');
+ }
+
+ /*
+ * Do the loop for every directory in 'directory'.
+ * First allocate some memory to put the directory name in.
+ */
+ dir_name = alloc((unsigned)STRLEN(p_dir) + 1);
+ dirp = p_dir;
+ while (dir_name != NULL && *dirp)
+ {
+ /*
+ * Isolate a directory name from *dirp and put it in dir_name (we know
+ * it is large enough, so use 31000 for length).
+ * Advance dirp to next directory name.
+ */
+ (void)copy_option_part(&dirp, dir_name, 31000, ",");
+
+ if (dir_name[0] == '.' && dir_name[1] == NUL) /* check current dir */
+ {
+ if (fname == NULL || *fname == NULL)
+ {
+#ifdef VMS
+ names[0] = vim_strsave((char_u *)"*_sw%");
+#else
+# ifdef RISCOS
+ names[0] = vim_strsave((char_u *)"*_sw#");
+# else
+ names[0] = vim_strsave((char_u *)"*.sw?");
+# endif
+#endif
+#ifdef UNIX
+ /* for Unix names starting with a dot are special */
+ names[1] = vim_strsave((char_u *)".*.sw?");
+ names[2] = vim_strsave((char_u *)".sw?");
+ num_names = 3;
+#else
+# ifdef VMS
+ names[1] = vim_strsave((char_u *)".*_sw%");
+ num_names = 2;
+# else
+ num_names = 1;
+# endif
+#endif
+ }
+ else
+ num_names = recov_file_names(names, *fname, TRUE);
+ }
+ else /* check directory dir_name */
+ {
+ if (fname == NULL || *fname == NULL)
+ {
+#ifdef VMS
+ names[0] = concat_fnames(dir_name, (char_u *)"*_sw%", TRUE);
+#else
+# ifdef RISCOS
+ names[0] = concat_fnames(dir_name, (char_u *)"*_sw#", TRUE);
+# else
+ names[0] = concat_fnames(dir_name, (char_u *)"*.sw?", TRUE);
+# endif
+#endif
+#ifdef UNIX
+ /* for Unix names starting with a dot are special */
+ names[1] = concat_fnames(dir_name, (char_u *)".*.sw?", TRUE);
+ names[2] = concat_fnames(dir_name, (char_u *)".sw?", TRUE);
+ num_names = 3;
+#else
+# ifdef VMS
+ names[1] = concat_fnames(dir_name, (char_u *)".*_sw%", TRUE);
+ num_names = 2;
+# else
+ num_names = 1;
+# endif
+#endif
+ }
+ else
+ {
+#if defined(UNIX) || defined(WIN3264)
+ p = dir_name + STRLEN(dir_name);
+ if (vim_ispathsep(p[-1]) && p[-1] == p[-2])
+ {
+ /* Ends with '//', Use Full path for swap name */
+ tail = make_percent_swname(dir_name, *fname);
+ }
+ else
+#endif
+ {
+ tail = gettail(*fname);
+ tail = concat_fnames(dir_name, tail, TRUE);
+ }
+ if (tail == NULL)
+ num_names = 0;
+ else
+ {
+ num_names = recov_file_names(names, tail, FALSE);
+ vim_free(tail);
+ }
+ }
+ }
+
+ /* check for out-of-memory */
+ for (i = 0; i < num_names; ++i)
+ {
+ if (names[i] == NULL)
+ {
+ for (i = 0; i < num_names; ++i)
+ vim_free(names[i]);
+ num_names = 0;
+ }
+ }
+ if (num_names == 0)
+ num_files = 0;
+ else if (expand_wildcards(num_names, names, &num_files, &files,
+ EW_KEEPALL|EW_FILE|EW_SILENT) == FAIL)
+ num_files = 0;
+
+ /*
+ * When no swap file found, wildcard expansion might have failed (e.g.
+ * not able to execute the shell).
+ * Try finding a swap file by simply adding ".swp" to the file name.
+ */
+ if (*dirp == NUL && file_count + num_files == 0
+ && fname != NULL && *fname != NULL)
+ {
+ struct stat st;
+ char_u *swapname;
+
+#if defined(VMS) || defined(RISCOS)
+ swapname = modname(*fname, (char_u *)"_swp", FALSE);
+#else
+ swapname = modname(*fname, (char_u *)".swp", TRUE);
+#endif
+ if (swapname != NULL)
+ {
+ if (mch_stat((char *)swapname, &st) != -1) /* It exists! */
+ {
+ files = (char_u **)alloc((unsigned)sizeof(char_u *));
+ if (files != NULL)
+ {
+ files[0] = swapname;
+ swapname = NULL;
+ num_files = 1;
+ }
+ }
+ vim_free(swapname);
+ }
+ }
+
+ /*
+ * remove swapfile name of the current buffer, it must be ignored
+ */
+ if (curbuf->b_ml.ml_mfp != NULL
+ && (p = curbuf->b_ml.ml_mfp->mf_fname) != NULL)
+ {
+ for (i = 0; i < num_files; ++i)
+ if (fullpathcmp(p, files[i], TRUE) & FPC_SAME)
+ {
+ vim_free(files[i]);
+ --num_files;
+ for ( ; i < num_files; ++i)
+ files[i] = files[i + 1];
+ }
+ }
+ if (nr)
+ {
+ file_count += num_files;
+ if (nr <= file_count)
+ {
+ *fname = vim_strsave(files[nr - 1 + num_files - file_count]);
+ dirp = (char_u *)""; /* stop searching */
+ }
+ }
+ else if (list)
+ {
+ if (dir_name[0] == '.' && dir_name[1] == NUL)
+ {
+ if (fname == NULL || *fname == NULL)
+ MSG_PUTS(_(" In current directory:\n"));
+ else
+ MSG_PUTS(_(" Using specified name:\n"));
+ }
+ else
+ {
+ MSG_PUTS(_(" In directory "));
+ msg_home_replace(dir_name);
+ MSG_PUTS(":\n");
+ }
+
+ if (num_files)
+ {
+ for (i = 0; i < num_files; ++i)
+ {
+ /* print the swap file name */
+ msg_outnum((long)++file_count);
+ MSG_PUTS(". ");
+ msg_puts(gettail(files[i]));
+ msg_putchar('\n');
+ (void)swapfile_info(files[i]);
+ }
+ }
+ else
+ MSG_PUTS(_(" -- none --\n"));
+ out_flush();
+ }
+ else
+ file_count += num_files;
+
+ for (i = 0; i < num_names; ++i)
+ vim_free(names[i]);
+ FreeWild(num_files, files);
+ }
+ vim_free(dir_name);
+ return file_count;
+}
+
+#if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */
+/*
+ * Append the full path to name with path separators made into percent
+ * signs, to dir. An unnamed buffer is handled as "" (<currentdir>/"")
+ */
+ static char_u *
+make_percent_swname(dir, name)
+ char_u *dir;
+ char_u *name;
+{
+ char_u *d, *s, *f, *p;
+
+ f = fix_fname(name != NULL ? name : (char_u *) "");
+ d = NULL;
+ if (f != NULL)
+ {
+ s = alloc((unsigned)(STRLEN(f) + 1));
+ if (s != NULL)
+ {
+ for (d = s, p = f; *p; p++, d++)
+ *d = vim_ispathsep(*p) ? '%' : *p;
+ *d = 0;
+ d = concat_fnames(dir, s, TRUE);
+ vim_free(s);
+ }
+ vim_free(f);
+ }
+ return d;
+}
+#endif
+
+#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+static int process_still_running;
+#endif
+
+/*
+ * Give information about an existing swap file
+ * Returns timestamp (0 when unknown).
+ */
+ static time_t
+swapfile_info(fname)
+ char_u *fname;
+{
+ struct stat st;
+ int fd;
+ struct block0 b0;
+ time_t x = (time_t)0;
+#ifdef UNIX
+ char_u uname[B0_UNAME_SIZE];
+#endif
+
+ /* print the swap file date */
+ if (mch_stat((char *)fname, &st) != -1)
+ {
+#ifdef UNIX
+ /* print name of owner of the file */
+ if (mch_get_uname(st.st_uid, uname, B0_UNAME_SIZE) == OK)
+ {
+ MSG_PUTS(_(" owned by: "));
+ msg_outtrans(uname);
+ MSG_PUTS(_(" dated: "));
+ }
+ else
+#endif
+ MSG_PUTS(_(" dated: "));
+ x = st.st_mtime; /* Manx C can't do &st.st_mtime */
+ MSG_PUTS(ctime(&x)); /* includes '\n' */
+
+ }
+
+ /*
+ * print the original file name
+ */
+ fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+ if (fd >= 0)
+ {
+ if (read(fd, (char *)&b0, sizeof(b0)) == sizeof(b0))
+ {
+ if (STRNCMP(b0.b0_version, "VIM 3.0", 7) == 0)
+ {
+ MSG_PUTS(_(" [from Vim version 3.0]"));
+ }
+ else if (b0.b0_id[0] != BLOCK0_ID0 || b0.b0_id[1] != BLOCK0_ID1)
+ {
+ MSG_PUTS(_(" [does not look like a Vim swap file]"));
+ }
+ else
+ {
+ MSG_PUTS(_(" file name: "));
+ if (b0.b0_fname[0] == NUL)
+ MSG_PUTS(_("[No File]"));
+ else
+ msg_outtrans(b0.b0_fname);
+
+ MSG_PUTS(_("\n modified: "));
+ MSG_PUTS(b0.b0_dirty ? _("YES") : _("no"));
+
+ if (*(b0.b0_uname) != NUL)
+ {
+ MSG_PUTS(_("\n user name: "));
+ msg_outtrans(b0.b0_uname);
+ }
+
+ if (*(b0.b0_hname) != NUL)
+ {
+ if (*(b0.b0_uname) != NUL)
+ MSG_PUTS(_(" host name: "));
+ else
+ MSG_PUTS(_("\n host name: "));
+ msg_outtrans(b0.b0_hname);
+ }
+
+ if (char_to_long(b0.b0_pid) != 0L)
+ {
+ MSG_PUTS(_("\n process ID: "));
+ msg_outnum(char_to_long(b0.b0_pid));
+#if defined(UNIX) || defined(__EMX__)
+ /* EMX kill() not working correctly, it seems */
+ if (kill((pid_t)char_to_long(b0.b0_pid), 0) == 0)
+ {
+ MSG_PUTS(_(" (still running)"));
+# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ process_still_running = TRUE;
+# endif
+ }
+#endif
+ }
+
+ if (b0_magic_wrong(&b0))
+ {
+#if defined(MSDOS) || defined(MSWIN)
+ if (STRNCMP(b0.b0_hname, "PC ", 3) == 0)
+ MSG_PUTS(_("\n [not usable with this version of Vim]"));
+ else
+#endif
+ MSG_PUTS(_("\n [not usable on this computer]"));
+ }
+ }
+ }
+ else
+ MSG_PUTS(_(" [cannot be read]"));
+ close(fd);
+ }
+ else
+ MSG_PUTS(_(" [cannot be opened]"));
+ msg_putchar('\n');
+
+ return x;
+}
+
+ static int
+recov_file_names(names, path, prepend_dot)
+ char_u **names;
+ char_u *path;
+ int prepend_dot;
+{
+ int num_names;
+
+#ifdef SHORT_FNAME
+ /*
+ * (MS-DOS) always short names
+ */
+ names[0] = modname(path, (char_u *)".sw?", FALSE);
+ num_names = 1;
+#else /* !SHORT_FNAME */
+ /*
+ * (Win32 and Win64) never short names, but do prepend a dot.
+ * (Not MS-DOS or Win32 or Win64) maybe short name, maybe not: Try both.
+ * Only use the short name if it is different.
+ */
+ char_u *p;
+ int i;
+# ifndef WIN3264
+ int shortname = curbuf->b_shortname;
+
+ curbuf->b_shortname = FALSE;
+# endif
+
+ num_names = 0;
+
+ /*
+ * May also add the file name with a dot prepended, for swap file in same
+ * dir as original file.
+ */
+ if (prepend_dot)
+ {
+ names[num_names] = modname(path, (char_u *)".sw?", TRUE);
+ if (names[num_names] == NULL)
+ goto end;
+ ++num_names;
+ }
+
+ /*
+ * Form the normal swap file name pattern by appending ".sw?".
+ */
+#ifdef VMS
+ names[num_names] = concat_fnames(path, (char_u *)"_sw%", FALSE);
+#else
+# ifdef RISCOS
+ names[num_names] = concat_fnames(path, (char_u *)"_sw#", FALSE);
+# else
+ names[num_names] = concat_fnames(path, (char_u *)".sw?", FALSE);
+# endif
+#endif
+ if (names[num_names] == NULL)
+ goto end;
+ if (num_names >= 1) /* check if we have the same name twice */
+ {
+ p = names[num_names - 1];
+ i = (int)STRLEN(names[num_names - 1]) - (int)STRLEN(names[num_names]);
+ if (i > 0)
+ p += i; /* file name has been expanded to full path */
+
+ if (STRCMP(p, names[num_names]) != 0)
+ ++num_names;
+ else
+ vim_free(names[num_names]);
+ }
+ else
+ ++num_names;
+
+# ifndef WIN3264
+ /*
+ * Also try with 'shortname' set, in case the file is on a DOS filesystem.
+ */
+ curbuf->b_shortname = TRUE;
+#ifdef VMS
+ names[num_names] = modname(path, (char_u *)"_sw%", FALSE);
+#else
+# ifdef RISCOS
+ names[num_names] = modname(path, (char_u *)"_sw#", FALSE);
+# else
+ names[num_names] = modname(path, (char_u *)".sw?", FALSE);
+# endif
+#endif
+ if (names[num_names] == NULL)
+ goto end;
+
+ /*
+ * Remove the one from 'shortname', if it's the same as with 'noshortname'.
+ */
+ p = names[num_names];
+ i = STRLEN(names[num_names]) - STRLEN(names[num_names - 1]);
+ if (i > 0)
+ p += i; /* file name has been expanded to full path */
+ if (STRCMP(names[num_names - 1], p) == 0)
+ vim_free(names[num_names]);
+ else
+ ++num_names;
+# endif
+
+end:
+# ifndef WIN3264
+ curbuf->b_shortname = shortname;
+# endif
+
+#endif /* !SHORT_FNAME */
+
+ return num_names;
+}
+
+/*
+ * sync all memlines
+ *
+ * If 'check_file' is TRUE, check if original file exists and was not changed.
+ * If 'check_char' is TRUE, stop syncing when character becomes available, but
+ * always sync at least one block.
+ */
+ void
+ml_sync_all(check_file, check_char)
+ int check_file;
+ int check_char;
+{
+ buf_T *buf;
+ struct stat st;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (buf->b_ml.ml_mfp == NULL || buf->b_ml.ml_mfp->mf_fname == NULL)
+ continue; /* no file */
+
+ ml_flush_line(buf); /* flush buffered line */
+ /* flush locked block */
+ (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH);
+ if (bufIsChanged(buf) && check_file && mf_need_trans(buf->b_ml.ml_mfp)
+ && buf->b_ffname != NULL)
+ {
+ /*
+ * If the original file does not exist anymore or has been changed
+ * call ml_preserve() to get rid of all negative numbered blocks.
+ */
+ if (mch_stat((char *)buf->b_ffname, &st) == -1
+ || st.st_mtime != buf->b_mtime_read
+ || (size_t)st.st_size != buf->b_orig_size)
+ {
+ ml_preserve(buf, FALSE);
+ did_check_timestamps = FALSE;
+ need_check_timestamps = TRUE; /* give message later */
+ }
+ }
+ if (buf->b_ml.ml_mfp->mf_dirty)
+ {
+ (void)mf_sync(buf->b_ml.ml_mfp, (check_char ? MFS_STOP : 0)
+ | (bufIsChanged(buf) ? MFS_FLUSH : 0));
+ if (check_char && ui_char_avail()) /* character available now */
+ break;
+ }
+ }
+}
+
+/*
+ * sync one buffer, including negative blocks
+ *
+ * after this all the blocks are in the swap file
+ *
+ * Used for the :preserve command and when the original file has been
+ * changed or deleted.
+ *
+ * when message is TRUE the success of preserving is reported
+ */
+ void
+ml_preserve(buf, message)
+ buf_T *buf;
+ int message;
+{
+ bhdr_T *hp;
+ linenr_T lnum;
+ memfile_T *mfp = buf->b_ml.ml_mfp;
+ int status;
+ int got_int_save = got_int;
+
+ if (mfp == NULL || mfp->mf_fname == NULL)
+ {
+ if (message)
+ EMSG(_("E313: Cannot preserve, there is no swap file"));
+ return;
+ }
+
+ /* We only want to stop when interrupted here, not when interrupted
+ * before. */
+ got_int = FALSE;
+
+ ml_flush_line(buf); /* flush buffered line */
+ (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); /* flush locked block */
+ status = mf_sync(mfp, MFS_ALL | MFS_FLUSH);
+
+ /* stack is invalid after mf_sync(.., MFS_ALL) */
+ buf->b_ml.ml_stack_top = 0;
+
+ /*
+ * Some of the data blocks may have been changed from negative to
+ * positive block number. In that case the pointer blocks need to be
+ * updated.
+ *
+ * We don't know in which pointer block the references are, so we visit
+ * all data blocks until there are no more translations to be done (or
+ * we hit the end of the file, which can only happen in case a write fails,
+ * e.g. when file system if full).
+ * ml_find_line() does the work by translating the negative block numbers
+ * when getting the first line of each data block.
+ */
+ if (mf_need_trans(mfp) && !got_int)
+ {
+ lnum = 1;
+ while (mf_need_trans(mfp) && lnum <= buf->b_ml.ml_line_count)
+ {
+ hp = ml_find_line(buf, lnum, ML_FIND);
+ if (hp == NULL)
+ {
+ status = FAIL;
+ goto theend;
+ }
+ CHECK(buf->b_ml.ml_locked_low != lnum, "low != lnum");
+ lnum = buf->b_ml.ml_locked_high + 1;
+ }
+ (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); /* flush locked block */
+ /* sync the updated pointer blocks */
+ if (mf_sync(mfp, MFS_ALL | MFS_FLUSH) == FAIL)
+ status = FAIL;
+ buf->b_ml.ml_stack_top = 0; /* stack is invalid now */
+ }
+theend:
+ got_int |= got_int_save;
+
+ if (message)
+ {
+ if (status == OK)
+ MSG(_("File preserved"));
+ else
+ EMSG(_("E314: Preserve failed"));
+ }
+}
+
+/*
+ * NOTE: The pointer returned by the ml_get_*() functions only remains valid
+ * until the next call!
+ * line1 = ml_get(1);
+ * line2 = ml_get(2); // line1 is now invalid!
+ * Make a copy of the line if necessary.
+ */
+/*
+ * get a pointer to a (read-only copy of a) line
+ *
+ * On failure an error message is given and IObuff is returned (to avoid
+ * having to check for error everywhere).
+ */
+ char_u *
+ml_get(lnum)
+ linenr_T lnum;
+{
+ return ml_get_buf(curbuf, lnum, FALSE);
+}
+
+/*
+ * ml_get_pos: get pointer to position 'pos'
+ */
+ char_u *
+ml_get_pos(pos)
+ pos_T *pos;
+{
+ return (ml_get_buf(curbuf, pos->lnum, FALSE) + pos->col);
+}
+
+/*
+ * ml_get_curline: get pointer to cursor line.
+ */
+ char_u *
+ml_get_curline()
+{
+ return ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE);
+}
+
+/*
+ * ml_get_cursor: get pointer to cursor position
+ */
+ char_u *
+ml_get_cursor()
+{
+ return (ml_get_buf(curbuf, curwin->w_cursor.lnum, FALSE) +
+ curwin->w_cursor.col);
+}
+
+/*
+ * get a pointer to a line in a specific buffer
+ *
+ * "will_change": if TRUE mark the buffer dirty (chars in the line will be
+ * changed)
+ */
+ char_u *
+ml_get_buf(buf, lnum, will_change)
+ buf_T *buf;
+ linenr_T lnum;
+ int will_change; /* line will be changed */
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+ char_u *ptr;
+
+ if (lnum > buf->b_ml.ml_line_count) /* invalid line number */
+ {
+ EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum);
+errorret:
+ STRCPY(IObuff, "???");
+ return IObuff;
+ }
+ if (lnum <= 0) /* pretend line 0 is line 1 */
+ lnum = 1;
+
+ if (buf->b_ml.ml_mfp == NULL) /* there are no lines */
+ return (char_u *)"";
+
+/*
+ * See if it is the same line as requested last time.
+ * Otherwise may need to flush last used line.
+ */
+ if (buf->b_ml.ml_line_lnum != lnum)
+ {
+ ml_flush_line(buf);
+
+ /*
+ * Find the data block containing the line.
+ * This also fills the stack with the blocks from the root to the data
+ * block and releases any locked block.
+ */
+ if ((hp = ml_find_line(buf, lnum, ML_FIND)) == NULL)
+ {
+ EMSGN(_("E316: ml_get: cannot find line %ld"), lnum);
+ goto errorret;
+ }
+
+ dp = (DATA_BL *)(hp->bh_data);
+
+ ptr = (char_u *)dp + ((dp->db_index[lnum - buf->b_ml.ml_locked_low]) & DB_INDEX_MASK);
+ buf->b_ml.ml_line_ptr = ptr;
+ buf->b_ml.ml_line_lnum = lnum;
+ buf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
+ }
+ if (will_change)
+ buf->b_ml.ml_flags |= (ML_LOCKED_DIRTY | ML_LOCKED_POS);
+
+ return buf->b_ml.ml_line_ptr;
+}
+
+/*
+ * Check if a line that was just obtained by a call to ml_get
+ * is in allocated memory.
+ */
+ int
+ml_line_alloced()
+{
+ return (curbuf->b_ml.ml_flags & ML_LINE_DIRTY);
+}
+
+/*
+ * Append a line after lnum (may be 0 to insert a line in front of the file).
+ * "line" does not need to be allocated, but can't be another line in a
+ * buffer, unlocking may make it invalid.
+ *
+ * newfile: TRUE when starting to edit a new file, meaning that pe_old_lnum
+ * will be set for recovery
+ * Check: The caller of this function should probably also call
+ * appended_lines().
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+ml_append(lnum, line, len, newfile)
+ linenr_T lnum; /* append after this line (can be 0) */
+ char_u *line; /* text of the new line */
+ colnr_T len; /* length of new line, including NUL, or 0 */
+ int newfile; /* flag, see above */
+{
+ /* When starting up, we might still need to create the memfile */
+ if (curbuf->b_ml.ml_mfp == NULL && open_buffer(FALSE, NULL) == FAIL)
+ return FAIL;
+
+ if (curbuf->b_ml.ml_line_lnum != 0)
+ ml_flush_line(curbuf);
+ return ml_append_int(curbuf, lnum, line, len, newfile, FALSE);
+}
+
+ static int
+ml_append_int(buf, lnum, line, len, newfile, mark)
+ buf_T *buf;
+ linenr_T lnum; /* append after this line (can be 0) */
+ char_u *line; /* text of the new line */
+ colnr_T len; /* length of line, including NUL, or 0 */
+ int newfile; /* flag, see above */
+ int mark; /* mark the new line */
+{
+ int i;
+ int line_count; /* number of indexes in current block */
+ int offset;
+ int from, to;
+ int space_needed; /* space needed for new line */
+ int page_size;
+ int page_count;
+ int db_idx; /* index for lnum in data block */
+ bhdr_T *hp;
+ memfile_T *mfp;
+ DATA_BL *dp;
+ PTR_BL *pp;
+ infoptr_T *ip;
+
+ /* lnum out of range */
+ if (lnum > buf->b_ml.ml_line_count || buf->b_ml.ml_mfp == NULL)
+ return FAIL;
+
+ if (lowest_marked && lowest_marked > lnum)
+ lowest_marked = lnum + 1;
+
+ if (len == 0)
+ len = (colnr_T)STRLEN(line) + 1; /* space needed for the text */
+ space_needed = len + INDEX_SIZE; /* space needed for text + index */
+
+ mfp = buf->b_ml.ml_mfp;
+ page_size = mfp->mf_page_size;
+
+/*
+ * find the data block containing the previous line
+ * This also fills the stack with the blocks from the root to the data block
+ * This also releases any locked block.
+ */
+ if ((hp = ml_find_line(buf, lnum == 0 ? (linenr_T)1 : lnum,
+ ML_INSERT)) == NULL)
+ return FAIL;
+
+ buf->b_ml.ml_flags &= ~ML_EMPTY;
+
+ if (lnum == 0) /* got line one instead, correct db_idx */
+ db_idx = -1; /* careful, it is negative! */
+ else
+ db_idx = lnum - buf->b_ml.ml_locked_low;
+ /* get line count before the insertion */
+ line_count = buf->b_ml.ml_locked_high - buf->b_ml.ml_locked_low;
+
+ dp = (DATA_BL *)(hp->bh_data);
+
+/*
+ * If
+ * - there is not enough room in the current block
+ * - appending to the last line in the block
+ * - not appending to the last line in the file
+ * insert in front of the next block.
+ */
+ if ((int)dp->db_free < space_needed && db_idx == line_count - 1
+ && lnum < buf->b_ml.ml_line_count)
+ {
+ /*
+ * Now that the line is not going to be inserted in the block that we
+ * expected, the line count has to be adjusted in the pointer blocks
+ * by using ml_locked_lineadd.
+ */
+ --(buf->b_ml.ml_locked_lineadd);
+ --(buf->b_ml.ml_locked_high);
+ if ((hp = ml_find_line(buf, lnum + 1, ML_INSERT)) == NULL)
+ return FAIL;
+
+ db_idx = -1; /* careful, it is negative! */
+ /* get line count before the insertion */
+ line_count = buf->b_ml.ml_locked_high - buf->b_ml.ml_locked_low;
+ CHECK(buf->b_ml.ml_locked_low != lnum + 1, "locked_low != lnum + 1");
+
+ dp = (DATA_BL *)(hp->bh_data);
+ }
+
+ ++buf->b_ml.ml_line_count;
+
+ if ((int)dp->db_free >= space_needed) /* enough room in data block */
+ {
+/*
+ * Insert new line in existing data block, or in data block allocated above.
+ */
+ dp->db_txt_start -= len;
+ dp->db_free -= space_needed;
+ ++(dp->db_line_count);
+
+ /*
+ * move the text of the lines that follow to the front
+ * adjust the indexes of the lines that follow
+ */
+ if (line_count > db_idx + 1) /* if there are following lines */
+ {
+ /*
+ * Offset is the start of the previous line.
+ * This will become the character just after the new line.
+ */
+ if (db_idx < 0)
+ offset = dp->db_txt_end;
+ else
+ offset = ((dp->db_index[db_idx]) & DB_INDEX_MASK);
+ mch_memmove((char *)dp + dp->db_txt_start,
+ (char *)dp + dp->db_txt_start + len,
+ (size_t)(offset - (dp->db_txt_start + len)));
+ for (i = line_count - 1; i > db_idx; --i)
+ dp->db_index[i + 1] = dp->db_index[i] - len;
+ dp->db_index[db_idx + 1] = offset - len;
+ }
+ else /* add line at the end */
+ dp->db_index[db_idx + 1] = dp->db_txt_start;
+
+ /*
+ * copy the text into the block
+ */
+ mch_memmove((char *)dp + dp->db_index[db_idx + 1], line, (size_t)len);
+ if (mark)
+ dp->db_index[db_idx + 1] |= DB_MARKED;
+
+ /*
+ * Mark the block dirty.
+ */
+ buf->b_ml.ml_flags |= ML_LOCKED_DIRTY;
+ if (!newfile)
+ buf->b_ml.ml_flags |= ML_LOCKED_POS;
+ }
+ else /* not enough space in data block */
+ {
+/*
+ * If there is not enough room we have to create a new data block and copy some
+ * lines into it.
+ * Then we have to insert an entry in the pointer block.
+ * If this pointer block also is full, we go up another block, and so on, up
+ * to the root if necessary.
+ * The line counts in the pointer blocks have already been adjusted by
+ * ml_find_line().
+ */
+ long line_count_left, line_count_right;
+ int page_count_left, page_count_right;
+ bhdr_T *hp_left;
+ bhdr_T *hp_right;
+ bhdr_T *hp_new;
+ int lines_moved;
+ int data_moved = 0; /* init to shut up gcc */
+ int total_moved = 0; /* init to shut up gcc */
+ DATA_BL *dp_right, *dp_left;
+ int stack_idx;
+ int in_left;
+ int lineadd;
+ blocknr_T bnum_left, bnum_right;
+ linenr_T lnum_left, lnum_right;
+ int pb_idx;
+ PTR_BL *pp_new;
+
+ /*
+ * We are going to allocate a new data block. Depending on the
+ * situation it will be put to the left or right of the existing
+ * block. If possible we put the new line in the left block and move
+ * the lines after it to the right block. Otherwise the new line is
+ * also put in the right block. This method is more efficient when
+ * inserting a lot of lines at one place.
+ */
+ if (db_idx < 0) /* left block is new, right block is existing */
+ {
+ lines_moved = 0;
+ in_left = TRUE;
+ /* space_needed does not change */
+ }
+ else /* left block is existing, right block is new */
+ {
+ lines_moved = line_count - db_idx - 1;
+ if (lines_moved == 0)
+ in_left = FALSE; /* put new line in right block */
+ /* space_needed does not change */
+ else
+ {
+ data_moved = ((dp->db_index[db_idx]) & DB_INDEX_MASK) -
+ dp->db_txt_start;
+ total_moved = data_moved + lines_moved * INDEX_SIZE;
+ if ((int)dp->db_free + total_moved >= space_needed)
+ {
+ in_left = TRUE; /* put new line in left block */
+ space_needed = total_moved;
+ }
+ else
+ {
+ in_left = FALSE; /* put new line in right block */
+ space_needed += total_moved;
+ }
+ }
+ }
+
+ page_count = ((space_needed + HEADER_SIZE) + page_size - 1) / page_size;
+ if ((hp_new = ml_new_data(mfp, newfile, page_count)) == NULL)
+ {
+ /* correct line counts in pointer blocks */
+ --(buf->b_ml.ml_locked_lineadd);
+ --(buf->b_ml.ml_locked_high);
+ return FAIL;
+ }
+ if (db_idx < 0) /* left block is new */
+ {
+ hp_left = hp_new;
+ hp_right = hp;
+ line_count_left = 0;
+ line_count_right = line_count;
+ }
+ else /* right block is new */
+ {
+ hp_left = hp;
+ hp_right = hp_new;
+ line_count_left = line_count;
+ line_count_right = 0;
+ }
+ dp_right = (DATA_BL *)(hp_right->bh_data);
+ dp_left = (DATA_BL *)(hp_left->bh_data);
+ bnum_left = hp_left->bh_bnum;
+ bnum_right = hp_right->bh_bnum;
+ page_count_left = hp_left->bh_page_count;
+ page_count_right = hp_right->bh_page_count;
+
+ /*
+ * May move the new line into the right/new block.
+ */
+ if (!in_left)
+ {
+ dp_right->db_txt_start -= len;
+ dp_right->db_free -= len + INDEX_SIZE;
+ dp_right->db_index[0] = dp_right->db_txt_start;
+ if (mark)
+ dp_right->db_index[0] |= DB_MARKED;
+
+ mch_memmove((char *)dp_right + dp_right->db_txt_start,
+ line, (size_t)len);
+ ++line_count_right;
+ }
+ /*
+ * may move lines from the left/old block to the right/new one.
+ */
+ if (lines_moved)
+ {
+ /*
+ */
+ dp_right->db_txt_start -= data_moved;
+ dp_right->db_free -= total_moved;
+ mch_memmove((char *)dp_right + dp_right->db_txt_start,
+ (char *)dp_left + dp_left->db_txt_start,
+ (size_t)data_moved);
+ offset = dp_right->db_txt_start - dp_left->db_txt_start;
+ dp_left->db_txt_start += data_moved;
+ dp_left->db_free += total_moved;
+
+ /*
+ * update indexes in the new block
+ */
+ for (to = line_count_right, from = db_idx + 1;
+ from < line_count_left; ++from, ++to)
+ dp_right->db_index[to] = dp->db_index[from] + offset;
+ line_count_right += lines_moved;
+ line_count_left -= lines_moved;
+ }
+
+ /*
+ * May move the new line into the left (old or new) block.
+ */
+ if (in_left)
+ {
+ dp_left->db_txt_start -= len;
+ dp_left->db_free -= len + INDEX_SIZE;
+ dp_left->db_index[line_count_left] = dp_left->db_txt_start;
+ if (mark)
+ dp_left->db_index[line_count_left] |= DB_MARKED;
+ mch_memmove((char *)dp_left + dp_left->db_txt_start,
+ line, (size_t)len);
+ ++line_count_left;
+ }
+
+ if (db_idx < 0) /* left block is new */
+ {
+ lnum_left = lnum + 1;
+ lnum_right = 0;
+ }
+ else /* right block is new */
+ {
+ lnum_left = 0;
+ if (in_left)
+ lnum_right = lnum + 2;
+ else
+ lnum_right = lnum + 1;
+ }
+ dp_left->db_line_count = line_count_left;
+ dp_right->db_line_count = line_count_right;
+
+ /*
+ * release the two data blocks
+ * The new one (hp_new) already has a correct blocknumber.
+ * The old one (hp, in ml_locked) gets a positive blocknumber if
+ * we changed it and we are not editing a new file.
+ */
+ if (lines_moved || in_left)
+ buf->b_ml.ml_flags |= ML_LOCKED_DIRTY;
+ if (!newfile && db_idx >= 0 && in_left)
+ buf->b_ml.ml_flags |= ML_LOCKED_POS;
+ mf_put(mfp, hp_new, TRUE, FALSE);
+
+ /*
+ * flush the old data block
+ * set ml_locked_lineadd to 0, because the updating of the
+ * pointer blocks is done below
+ */
+ lineadd = buf->b_ml.ml_locked_lineadd;
+ buf->b_ml.ml_locked_lineadd = 0;
+ ml_find_line(buf, (linenr_T)0, ML_FLUSH); /* flush data block */
+
+ /*
+ * update pointer blocks for the new data block
+ */
+ for (stack_idx = buf->b_ml.ml_stack_top - 1; stack_idx >= 0;
+ --stack_idx)
+ {
+ ip = &(buf->b_ml.ml_stack[stack_idx]);
+ pb_idx = ip->ip_index;
+ if ((hp = mf_get(mfp, ip->ip_bnum, 1)) == NULL)
+ return FAIL;
+ pp = (PTR_BL *)(hp->bh_data); /* must be pointer block */
+ if (pp->pb_id != PTR_ID)
+ {
+ EMSG(_("E317: pointer block id wrong 3"));
+ mf_put(mfp, hp, FALSE, FALSE);
+ return FAIL;
+ }
+ /*
+ * TODO: If the pointer block is full and we are adding at the end
+ * try to insert in front of the next block
+ */
+ /* block not full, add one entry */
+ if (pp->pb_count < pp->pb_count_max)
+ {
+ if (pb_idx + 1 < (int)pp->pb_count)
+ mch_memmove(&pp->pb_pointer[pb_idx + 2],
+ &pp->pb_pointer[pb_idx + 1],
+ (size_t)(pp->pb_count - pb_idx - 1) * sizeof(PTR_EN));
+ ++pp->pb_count;
+ pp->pb_pointer[pb_idx].pe_line_count = line_count_left;
+ pp->pb_pointer[pb_idx].pe_bnum = bnum_left;
+ pp->pb_pointer[pb_idx].pe_page_count = page_count_left;
+ pp->pb_pointer[pb_idx + 1].pe_line_count = line_count_right;
+ pp->pb_pointer[pb_idx + 1].pe_bnum = bnum_right;
+ pp->pb_pointer[pb_idx + 1].pe_page_count = page_count_right;
+
+ if (lnum_left != 0)
+ pp->pb_pointer[pb_idx].pe_old_lnum = lnum_left;
+ if (lnum_right != 0)
+ pp->pb_pointer[pb_idx + 1].pe_old_lnum = lnum_right;
+
+ mf_put(mfp, hp, TRUE, FALSE);
+ buf->b_ml.ml_stack_top = stack_idx + 1; /* truncate stack */
+
+ if (lineadd)
+ {
+ --(buf->b_ml.ml_stack_top);
+ /* fix line count for rest of blocks in the stack */
+ ml_lineadd(buf, lineadd);
+ /* fix stack itself */
+ buf->b_ml.ml_stack[buf->b_ml.ml_stack_top].ip_high +=
+ lineadd;
+ ++(buf->b_ml.ml_stack_top);
+ }
+
+ /*
+ * We are finished, break the loop here.
+ */
+ break;
+ }
+ else /* pointer block full */
+ {
+ /*
+ * split the pointer block
+ * allocate a new pointer block
+ * move some of the pointer into the new block
+ * prepare for updating the parent block
+ */
+ for (;;) /* do this twice when splitting block 1 */
+ {
+ hp_new = ml_new_ptr(mfp);
+ if (hp_new == NULL) /* TODO: try to fix tree */
+ return FAIL;
+ pp_new = (PTR_BL *)(hp_new->bh_data);
+
+ if (hp->bh_bnum != 1)
+ break;
+
+ /*
+ * if block 1 becomes full the tree is given an extra level
+ * The pointers from block 1 are moved into the new block.
+ * block 1 is updated to point to the new block
+ * then continue to split the new block
+ */
+ mch_memmove(pp_new, pp, (size_t)page_size);
+ pp->pb_count = 1;
+ pp->pb_pointer[0].pe_bnum = hp_new->bh_bnum;
+ pp->pb_pointer[0].pe_line_count = buf->b_ml.ml_line_count;
+ pp->pb_pointer[0].pe_old_lnum = 1;
+ pp->pb_pointer[0].pe_page_count = 1;
+ mf_put(mfp, hp, TRUE, FALSE); /* release block 1 */
+ hp = hp_new; /* new block is to be split */
+ pp = pp_new;
+ CHECK(stack_idx != 0, _("stack_idx should be 0"));
+ ip->ip_index = 0;
+ ++stack_idx; /* do block 1 again later */
+ }
+ /*
+ * move the pointers after the current one to the new block
+ * If there are none, the new entry will be in the new block.
+ */
+ total_moved = pp->pb_count - pb_idx - 1;
+ if (total_moved)
+ {
+ mch_memmove(&pp_new->pb_pointer[0],
+ &pp->pb_pointer[pb_idx + 1],
+ (size_t)(total_moved) * sizeof(PTR_EN));
+ pp_new->pb_count = total_moved;
+ pp->pb_count -= total_moved - 1;
+ pp->pb_pointer[pb_idx + 1].pe_bnum = bnum_right;
+ pp->pb_pointer[pb_idx + 1].pe_line_count = line_count_right;
+ pp->pb_pointer[pb_idx + 1].pe_page_count = page_count_right;
+ if (lnum_right)
+ pp->pb_pointer[pb_idx + 1].pe_old_lnum = lnum_right;
+ }
+ else
+ {
+ pp_new->pb_count = 1;
+ pp_new->pb_pointer[0].pe_bnum = bnum_right;
+ pp_new->pb_pointer[0].pe_line_count = line_count_right;
+ pp_new->pb_pointer[0].pe_page_count = page_count_right;
+ pp_new->pb_pointer[0].pe_old_lnum = lnum_right;
+ }
+ pp->pb_pointer[pb_idx].pe_bnum = bnum_left;
+ pp->pb_pointer[pb_idx].pe_line_count = line_count_left;
+ pp->pb_pointer[pb_idx].pe_page_count = page_count_left;
+ if (lnum_left)
+ pp->pb_pointer[pb_idx].pe_old_lnum = lnum_left;
+ lnum_left = 0;
+ lnum_right = 0;
+
+ /*
+ * recompute line counts
+ */
+ line_count_right = 0;
+ for (i = 0; i < (int)pp_new->pb_count; ++i)
+ line_count_right += pp_new->pb_pointer[i].pe_line_count;
+ line_count_left = 0;
+ for (i = 0; i < (int)pp->pb_count; ++i)
+ line_count_left += pp->pb_pointer[i].pe_line_count;
+
+ bnum_left = hp->bh_bnum;
+ bnum_right = hp_new->bh_bnum;
+ page_count_left = 1;
+ page_count_right = 1;
+ mf_put(mfp, hp, TRUE, FALSE);
+ mf_put(mfp, hp_new, TRUE, FALSE);
+ }
+ }
+
+ /*
+ * Safety check: fallen out of for loop?
+ */
+ if (stack_idx < 0)
+ {
+ EMSG(_("E318: Updated too many blocks?"));
+ buf->b_ml.ml_stack_top = 0; /* invalidate stack */
+ }
+ }
+
+#ifdef FEAT_BYTEOFF
+ /* The line was inserted below 'lnum' */
+ ml_updatechunk(buf, lnum + 1, (long)len, ML_CHNK_ADDLINE);
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ if (STRLEN(line) > 0)
+ netbeans_inserted(buf, lnum+1, (colnr_T)0, 0, line, STRLEN(line));
+ netbeans_inserted(buf, lnum+1, (colnr_T)STRLEN(line), 0,
+ (char_u *)"\n", 1);
+ }
+#endif
+ return OK;
+}
+
+/*
+ * replace line lnum, with buffering, in current buffer
+ *
+ * If copy is TRUE, make a copy of the line, otherwise the line has been
+ * copied to allocated memory already.
+ *
+ * Check: The caller of this function should probably also call
+ * changed_lines(), unless update_screen(NOT_VALID) is used.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+ml_replace(lnum, line, copy)
+ linenr_T lnum;
+ char_u *line;
+ int copy;
+{
+ if (line == NULL) /* just checking... */
+ return FAIL;
+
+ /* When starting up, we might still need to create the memfile */
+ if (curbuf->b_ml.ml_mfp == NULL && open_buffer(FALSE, NULL) == FAIL)
+ return FAIL;
+
+ if (copy && (line = vim_strsave(line)) == NULL) /* allocate memory */
+ return FAIL;
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ netbeans_removed(curbuf, lnum, 0, (long)STRLEN(ml_get(lnum)));
+ netbeans_inserted(curbuf, lnum, 0, 0, line, STRLEN(line));
+ }
+#endif
+ if (curbuf->b_ml.ml_line_lnum != lnum) /* other line buffered */
+ ml_flush_line(curbuf); /* flush it */
+ else if (curbuf->b_ml.ml_flags & ML_LINE_DIRTY) /* same line allocated */
+ vim_free(curbuf->b_ml.ml_line_ptr); /* free it */
+ curbuf->b_ml.ml_line_ptr = line;
+ curbuf->b_ml.ml_line_lnum = lnum;
+ curbuf->b_ml.ml_flags = (curbuf->b_ml.ml_flags | ML_LINE_DIRTY) & ~ML_EMPTY;
+
+ return OK;
+}
+
+/*
+ * delete line 'lnum'
+ *
+ * Check: The caller of this function should probably also call
+ * deleted_lines() after this.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+ml_delete(lnum, message)
+ linenr_T lnum;
+ int message;
+{
+ ml_flush_line(curbuf);
+ return ml_delete_int(curbuf, lnum, message);
+}
+
+ static int
+ml_delete_int(buf, lnum, message)
+ buf_T *buf;
+ linenr_T lnum;
+ int message;
+{
+ bhdr_T *hp;
+ memfile_T *mfp;
+ DATA_BL *dp;
+ PTR_BL *pp;
+ infoptr_T *ip;
+ int count; /* number of entries in block */
+ int idx;
+ int stack_idx;
+ int text_start;
+ int line_start;
+ long line_size;
+ int i;
+
+ if (lnum < 1 || lnum > buf->b_ml.ml_line_count)
+ return FAIL;
+
+ if (lowest_marked && lowest_marked > lnum)
+ lowest_marked--;
+
+/*
+ * If the file becomes empty the last line is replaced by an empty line.
+ */
+ if (buf->b_ml.ml_line_count == 1) /* file becomes empty */
+ {
+ if (message
+#ifdef FEAT_NETBEANS_INTG
+ && !netbeansSuppressNoLines
+#endif
+ )
+ {
+ set_keep_msg((char_u *)_(no_lines_msg));
+ keep_msg_attr = 0;
+ }
+ /* FEAT_BYTEOFF already handled in there, dont worry 'bout it below */
+ i = ml_replace((linenr_T)1, (char_u *)"", TRUE);
+ buf->b_ml.ml_flags |= ML_EMPTY;
+
+ return i;
+ }
+
+/*
+ * find the data block containing the line
+ * This also fills the stack with the blocks from the root to the data block
+ * This also releases any locked block.
+ */
+ mfp = buf->b_ml.ml_mfp;
+ if (mfp == NULL)
+ return FAIL;
+
+ if ((hp = ml_find_line(buf, lnum, ML_DELETE)) == NULL)
+ return FAIL;
+
+ dp = (DATA_BL *)(hp->bh_data);
+ /* compute line count before the delete */
+ count = (long)(buf->b_ml.ml_locked_high)
+ - (long)(buf->b_ml.ml_locked_low) + 2;
+ idx = lnum - buf->b_ml.ml_locked_low;
+
+ --buf->b_ml.ml_line_count;
+
+ line_start = ((dp->db_index[idx]) & DB_INDEX_MASK);
+ if (idx == 0) /* first line in block, text at the end */
+ line_size = dp->db_txt_end - line_start;
+ else
+ line_size = ((dp->db_index[idx - 1]) & DB_INDEX_MASK) - line_start;
+
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_removed(buf, lnum, 0, line_size);
+#endif
+
+/*
+ * special case: If there is only one line in the data block it becomes empty.
+ * Then we have to remove the entry, pointing to this data block, from the
+ * pointer block. If this pointer block also becomes empty, we go up another
+ * block, and so on, up to the root if necessary.
+ * The line counts in the pointer blocks have already been adjusted by
+ * ml_find_line().
+ */
+ if (count == 1)
+ {
+ mf_free(mfp, hp); /* free the data block */
+ buf->b_ml.ml_locked = NULL;
+
+ for (stack_idx = buf->b_ml.ml_stack_top - 1; stack_idx >= 0; --stack_idx)
+ {
+ buf->b_ml.ml_stack_top = 0; /* stack is invalid when failing */
+ ip = &(buf->b_ml.ml_stack[stack_idx]);
+ idx = ip->ip_index;
+ if ((hp = mf_get(mfp, ip->ip_bnum, 1)) == NULL)
+ return FAIL;
+ pp = (PTR_BL *)(hp->bh_data); /* must be pointer block */
+ if (pp->pb_id != PTR_ID)
+ {
+ EMSG(_("E317: pointer block id wrong 4"));
+ mf_put(mfp, hp, FALSE, FALSE);
+ return FAIL;
+ }
+ count = --(pp->pb_count);
+ if (count == 0) /* the pointer block becomes empty! */
+ mf_free(mfp, hp);
+ else
+ {
+ if (count != idx) /* move entries after the deleted one */
+ mch_memmove(&pp->pb_pointer[idx], &pp->pb_pointer[idx + 1],
+ (size_t)(count - idx) * sizeof(PTR_EN));
+ mf_put(mfp, hp, TRUE, FALSE);
+
+ buf->b_ml.ml_stack_top = stack_idx; /* truncate stack */
+ /* fix line count for rest of blocks in the stack */
+ if (buf->b_ml.ml_locked_lineadd)
+ {
+ ml_lineadd(buf, buf->b_ml.ml_locked_lineadd);
+ buf->b_ml.ml_stack[buf->b_ml.ml_stack_top].ip_high +=
+ buf->b_ml.ml_locked_lineadd;
+ }
+ ++(buf->b_ml.ml_stack_top);
+
+ break;
+ }
+ }
+ CHECK(stack_idx < 0, _("deleted block 1?"));
+ }
+ else
+ {
+ /*
+ * delete the text by moving the next lines forwards
+ */
+ text_start = dp->db_txt_start;
+ mch_memmove((char *)dp + text_start + line_size,
+ (char *)dp + text_start, (size_t)(line_start - text_start));
+
+ /*
+ * delete the index by moving the next indexes backwards
+ * Adjust the indexes for the text movement.
+ */
+ for (i = idx; i < count - 1; ++i)
+ dp->db_index[i] = dp->db_index[i + 1] + line_size;
+
+ dp->db_free += line_size + INDEX_SIZE;
+ dp->db_txt_start += line_size;
+ --(dp->db_line_count);
+
+ /*
+ * mark the block dirty and make sure it is in the file (for recovery)
+ */
+ buf->b_ml.ml_flags |= (ML_LOCKED_DIRTY | ML_LOCKED_POS);
+ }
+
+#ifdef FEAT_BYTEOFF
+ ml_updatechunk(buf, lnum, line_size, ML_CHNK_DELLINE);
+#endif
+ return OK;
+}
+
+/*
+ * set the B_MARKED flag for line 'lnum'
+ */
+ void
+ml_setmarked(lnum)
+ linenr_T lnum;
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+ /* invalid line number */
+ if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count
+ || curbuf->b_ml.ml_mfp == NULL)
+ return; /* give error message? */
+
+ if (lowest_marked == 0 || lowest_marked > lnum)
+ lowest_marked = lnum;
+
+ /*
+ * find the data block containing the line
+ * This also fills the stack with the blocks from the root to the data block
+ * This also releases any locked block.
+ */
+ if ((hp = ml_find_line(curbuf, lnum, ML_FIND)) == NULL)
+ return; /* give error message? */
+
+ dp = (DATA_BL *)(hp->bh_data);
+ dp->db_index[lnum - curbuf->b_ml.ml_locked_low] |= DB_MARKED;
+ curbuf->b_ml.ml_flags |= ML_LOCKED_DIRTY;
+}
+
+/*
+ * find the first line with its B_MARKED flag set
+ */
+ linenr_T
+ml_firstmarked()
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+ linenr_T lnum;
+ int i;
+
+ if (curbuf->b_ml.ml_mfp == NULL)
+ return (linenr_T) 0;
+
+ /*
+ * The search starts with lowest_marked line. This is the last line where
+ * a mark was found, adjusted by inserting/deleting lines.
+ */
+ for (lnum = lowest_marked; lnum <= curbuf->b_ml.ml_line_count; )
+ {
+ /*
+ * Find the data block containing the line.
+ * This also fills the stack with the blocks from the root to the data
+ * block This also releases any locked block.
+ */
+ if ((hp = ml_find_line(curbuf, lnum, ML_FIND)) == NULL)
+ return (linenr_T)0; /* give error message? */
+
+ dp = (DATA_BL *)(hp->bh_data);
+
+ for (i = lnum - curbuf->b_ml.ml_locked_low;
+ lnum <= curbuf->b_ml.ml_locked_high; ++i, ++lnum)
+ if ((dp->db_index[i]) & DB_MARKED)
+ {
+ (dp->db_index[i]) &= DB_INDEX_MASK;
+ curbuf->b_ml.ml_flags |= ML_LOCKED_DIRTY;
+ lowest_marked = lnum + 1;
+ return lnum;
+ }
+ }
+
+ return (linenr_T) 0;
+}
+
+#if 0 /* not used */
+/*
+ * return TRUE if line 'lnum' has a mark
+ */
+ int
+ml_has_mark(lnum)
+ linenr_T lnum;
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+
+ if (curbuf->b_ml.ml_mfp == NULL
+ || (hp = ml_find_line(curbuf, lnum, ML_FIND)) == NULL)
+ return FALSE;
+
+ dp = (DATA_BL *)(hp->bh_data);
+ return (int)((dp->db_index[lnum - curbuf->b_ml.ml_locked_low]) & DB_MARKED);
+}
+#endif
+
+/*
+ * clear all DB_MARKED flags
+ */
+ void
+ml_clearmarked()
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+ linenr_T lnum;
+ int i;
+
+ if (curbuf->b_ml.ml_mfp == NULL) /* nothing to do */
+ return;
+
+ /*
+ * The search starts with line lowest_marked.
+ */
+ for (lnum = lowest_marked; lnum <= curbuf->b_ml.ml_line_count; )
+ {
+ /*
+ * Find the data block containing the line.
+ * This also fills the stack with the blocks from the root to the data
+ * block and releases any locked block.
+ */
+ if ((hp = ml_find_line(curbuf, lnum, ML_FIND)) == NULL)
+ return; /* give error message? */
+
+ dp = (DATA_BL *)(hp->bh_data);
+
+ for (i = lnum - curbuf->b_ml.ml_locked_low;
+ lnum <= curbuf->b_ml.ml_locked_high; ++i, ++lnum)
+ if ((dp->db_index[i]) & DB_MARKED)
+ {
+ (dp->db_index[i]) &= DB_INDEX_MASK;
+ curbuf->b_ml.ml_flags |= ML_LOCKED_DIRTY;
+ }
+ }
+
+ lowest_marked = 0;
+ return;
+}
+
+/*
+ * flush ml_line if necessary
+ */
+ static void
+ml_flush_line(buf)
+ buf_T *buf;
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+ linenr_T lnum;
+ char_u *new_line;
+ char_u *old_line;
+ colnr_T new_len;
+ int old_len;
+ int extra;
+ int idx;
+ int start;
+ int count;
+ int i;
+
+ if (buf->b_ml.ml_line_lnum == 0 || buf->b_ml.ml_mfp == NULL)
+ return; /* nothing to do */
+
+ if (buf->b_ml.ml_flags & ML_LINE_DIRTY)
+ {
+ lnum = buf->b_ml.ml_line_lnum;
+ new_line = buf->b_ml.ml_line_ptr;
+
+ hp = ml_find_line(buf, lnum, ML_FIND);
+ if (hp == NULL)
+ EMSGN(_("E320: Cannot find line %ld"), lnum);
+ else
+ {
+ dp = (DATA_BL *)(hp->bh_data);
+ idx = lnum - buf->b_ml.ml_locked_low;
+ start = ((dp->db_index[idx]) & DB_INDEX_MASK);
+ old_line = (char_u *)dp + start;
+ if (idx == 0) /* line is last in block */
+ old_len = dp->db_txt_end - start;
+ else /* text of previous line follows */
+ old_len = (dp->db_index[idx - 1] & DB_INDEX_MASK) - start;
+ new_len = (colnr_T)STRLEN(new_line) + 1;
+ extra = new_len - old_len; /* negative if lines gets smaller */
+
+ /*
+ * if new line fits in data block, replace directly
+ */
+ if ((int)dp->db_free >= extra)
+ {
+ /* if the length changes and there are following lines */
+ count = buf->b_ml.ml_locked_high - buf->b_ml.ml_locked_low + 1;
+ if (extra != 0 && idx < count - 1)
+ {
+ /* move text of following lines */
+ mch_memmove((char *)dp + dp->db_txt_start - extra,
+ (char *)dp + dp->db_txt_start,
+ (size_t)(start - dp->db_txt_start));
+
+ /* adjust pointers of this and following lines */
+ for (i = idx + 1; i < count; ++i)
+ dp->db_index[i] -= extra;
+ }
+ dp->db_index[idx] -= extra;
+
+ /* adjust free space */
+ dp->db_free -= extra;
+ dp->db_txt_start -= extra;
+
+ /* copy new line into the data block */
+ mch_memmove(old_line - extra, new_line, (size_t)new_len);
+ buf->b_ml.ml_flags |= (ML_LOCKED_DIRTY | ML_LOCKED_POS);
+#ifdef FEAT_BYTEOFF
+ /* The else case is already covered by the insert and delete */
+ ml_updatechunk(buf, lnum, (long)extra, ML_CHNK_UPDLINE);
+#endif
+ }
+ else
+ {
+ /*
+ * Cannot do it in one data block: Delete and append.
+ * Append first, because ml_delete_int() cannot delete the
+ * last line in a buffer, which causes trouble for a buffer
+ * that has only one line.
+ * Don't forget to copy the mark!
+ */
+ /* How about handling errors??? */
+ (void)ml_append_int(buf, lnum, new_line, new_len, FALSE,
+ (dp->db_index[idx] & DB_MARKED));
+ (void)ml_delete_int(buf, lnum, FALSE);
+ }
+ }
+ vim_free(new_line);
+ }
+
+ buf->b_ml.ml_line_lnum = 0;
+}
+
+/*
+ * create a new, empty, data block
+ */
+ static bhdr_T *
+ml_new_data(mfp, negative, page_count)
+ memfile_T *mfp;
+ int negative;
+ int page_count;
+{
+ bhdr_T *hp;
+ DATA_BL *dp;
+
+ if ((hp = mf_new(mfp, negative, page_count)) == NULL)
+ return NULL;
+
+ dp = (DATA_BL *)(hp->bh_data);
+ dp->db_id = DATA_ID;
+ dp->db_txt_start = dp->db_txt_end = page_count * mfp->mf_page_size;
+ dp->db_free = dp->db_txt_start - HEADER_SIZE;
+ dp->db_line_count = 0;
+
+ return hp;
+}
+
+/*
+ * create a new, empty, pointer block
+ */
+ static bhdr_T *
+ml_new_ptr(mfp)
+ memfile_T *mfp;
+{
+ bhdr_T *hp;
+ PTR_BL *pp;
+
+ if ((hp = mf_new(mfp, FALSE, 1)) == NULL)
+ return NULL;
+
+ pp = (PTR_BL *)(hp->bh_data);
+ pp->pb_id = PTR_ID;
+ pp->pb_count = 0;
+ pp->pb_count_max = (short_u)((mfp->mf_page_size - sizeof(PTR_BL)) / sizeof(PTR_EN) + 1);
+
+ return hp;
+}
+
+/*
+ * lookup line 'lnum' in a memline
+ *
+ * action: if ML_DELETE or ML_INSERT the line count is updated while searching
+ * if ML_FLUSH only flush a locked block
+ * if ML_FIND just find the line
+ *
+ * If the block was found it is locked and put in ml_locked.
+ * The stack is updated to lead to the locked block. The ip_high field in
+ * the stack is updated to reflect the last line in the block AFTER the
+ * insert or delete, also if the pointer block has not been updated yet. But
+ * if if ml_locked != NULL ml_locked_lineadd must be added to ip_high.
+ *
+ * return: NULL for failure, pointer to block header otherwise
+ */
+ static bhdr_T *
+ml_find_line(buf, lnum, action)
+ buf_T *buf;
+ linenr_T lnum;
+ int action;
+{
+ DATA_BL *dp;
+ PTR_BL *pp;
+ infoptr_T *ip;
+ bhdr_T *hp;
+ memfile_T *mfp;
+ linenr_T t;
+ blocknr_T bnum, bnum2;
+ int dirty;
+ linenr_T low, high;
+ int top;
+ int page_count;
+ int idx;
+
+ mfp = buf->b_ml.ml_mfp;
+
+ /*
+ * If there is a locked block check if the wanted line is in it.
+ * If not, flush and release the locked block.
+ * Don't do this for ML_INSERT_SAME, because the stack need to be updated.
+ * Don't do this for ML_FLUSH, because we want to flush the locked block.
+ */
+ if (buf->b_ml.ml_locked)
+ {
+ if (ML_SIMPLE(action) && buf->b_ml.ml_locked_low <= lnum
+ && buf->b_ml.ml_locked_high >= lnum)
+ {
+ /* remember to update pointer blocks and stack later */
+ if (action == ML_INSERT)
+ {
+ ++(buf->b_ml.ml_locked_lineadd);
+ ++(buf->b_ml.ml_locked_high);
+ }
+ else if (action == ML_DELETE)
+ {
+ --(buf->b_ml.ml_locked_lineadd);
+ --(buf->b_ml.ml_locked_high);
+ }
+ return (buf->b_ml.ml_locked);
+ }
+
+ mf_put(mfp, buf->b_ml.ml_locked, buf->b_ml.ml_flags & ML_LOCKED_DIRTY,
+ buf->b_ml.ml_flags & ML_LOCKED_POS);
+ buf->b_ml.ml_locked = NULL;
+
+ /*
+ * if lines have been added or deleted in the locked block, need to
+ * update the line count in pointer blocks
+ */
+ if (buf->b_ml.ml_locked_lineadd)
+ ml_lineadd(buf, buf->b_ml.ml_locked_lineadd);
+ }
+
+ if (action == ML_FLUSH) /* nothing else to do */
+ return NULL;
+
+ bnum = 1; /* start at the root of the tree */
+ page_count = 1;
+ low = 1;
+ high = buf->b_ml.ml_line_count;
+
+ if (action == ML_FIND) /* first try stack entries */
+ {
+ for (top = buf->b_ml.ml_stack_top - 1; top >= 0; --top)
+ {
+ ip = &(buf->b_ml.ml_stack[top]);
+ if (ip->ip_low <= lnum && ip->ip_high >= lnum)
+ {
+ bnum = ip->ip_bnum;
+ low = ip->ip_low;
+ high = ip->ip_high;
+ buf->b_ml.ml_stack_top = top; /* truncate stack at prev entry */
+ break;
+ }
+ }
+ if (top < 0)
+ buf->b_ml.ml_stack_top = 0; /* not found, start at the root */
+ }
+ else /* ML_DELETE or ML_INSERT */
+ buf->b_ml.ml_stack_top = 0; /* start at the root */
+
+/*
+ * search downwards in the tree until a data block is found
+ */
+ for (;;)
+ {
+ if ((hp = mf_get(mfp, bnum, page_count)) == NULL)
+ goto error_noblock;
+
+ /*
+ * update high for insert/delete
+ */
+ if (action == ML_INSERT)
+ ++high;
+ else if (action == ML_DELETE)
+ --high;
+
+ dp = (DATA_BL *)(hp->bh_data);
+ if (dp->db_id == DATA_ID) /* data block */
+ {
+ buf->b_ml.ml_locked = hp;
+ buf->b_ml.ml_locked_low = low;
+ buf->b_ml.ml_locked_high = high;
+ buf->b_ml.ml_locked_lineadd = 0;
+ buf->b_ml.ml_flags &= ~(ML_LOCKED_DIRTY | ML_LOCKED_POS);
+ return hp;
+ }
+
+ pp = (PTR_BL *)(dp); /* must be pointer block */
+ if (pp->pb_id != PTR_ID)
+ {
+ EMSG(_("E317: pointer block id wrong"));
+ goto error_block;
+ }
+
+ if ((top = ml_add_stack(buf)) < 0) /* add new entry to stack */
+ goto error_block;
+ ip = &(buf->b_ml.ml_stack[top]);
+ ip->ip_bnum = bnum;
+ ip->ip_low = low;
+ ip->ip_high = high;
+ ip->ip_index = -1; /* index not known yet */
+
+ dirty = FALSE;
+ for (idx = 0; idx < (int)pp->pb_count; ++idx)
+ {
+ t = pp->pb_pointer[idx].pe_line_count;
+ CHECK(t == 0, _("pe_line_count is zero"));
+ if ((low += t) > lnum)
+ {
+ ip->ip_index = idx;
+ bnum = pp->pb_pointer[idx].pe_bnum;
+ page_count = pp->pb_pointer[idx].pe_page_count;
+ high = low - 1;
+ low -= t;
+
+ /*
+ * a negative block number may have been changed
+ */
+ if (bnum < 0)
+ {
+ bnum2 = mf_trans_del(mfp, bnum);
+ if (bnum != bnum2)
+ {
+ bnum = bnum2;
+ pp->pb_pointer[idx].pe_bnum = bnum;
+ dirty = TRUE;
+ }
+ }
+
+ break;
+ }
+ }
+ if (idx >= (int)pp->pb_count) /* past the end: something wrong! */
+ {
+ if (lnum > buf->b_ml.ml_line_count)
+ EMSGN(_("E322: line number out of range: %ld past the end"),
+ lnum - buf->b_ml.ml_line_count);
+
+ else
+ EMSGN(_("E323: line count wrong in block %ld"), bnum);
+ goto error_block;
+ }
+ if (action == ML_DELETE)
+ {
+ pp->pb_pointer[idx].pe_line_count--;
+ dirty = TRUE;
+ }
+ else if (action == ML_INSERT)
+ {
+ pp->pb_pointer[idx].pe_line_count++;
+ dirty = TRUE;
+ }
+ mf_put(mfp, hp, dirty, FALSE);
+ }
+
+error_block:
+ mf_put(mfp, hp, FALSE, FALSE);
+error_noblock:
+/*
+ * If action is ML_DELETE or ML_INSERT we have to correct the tree for
+ * the incremented/decremented line counts, because there won't be a line
+ * inserted/deleted after all.
+ */
+ if (action == ML_DELETE)
+ ml_lineadd(buf, 1);
+ else if (action == ML_INSERT)
+ ml_lineadd(buf, -1);
+ buf->b_ml.ml_stack_top = 0;
+ return NULL;
+}
+
+/*
+ * add an entry to the info pointer stack
+ *
+ * return -1 for failure, number of the new entry otherwise
+ */
+ static int
+ml_add_stack(buf)
+ buf_T *buf;
+{
+ int top;
+ infoptr_T *newstack;
+
+ top = buf->b_ml.ml_stack_top;
+
+ /* may have to increase the stack size */
+ if (top == buf->b_ml.ml_stack_size)
+ {
+ CHECK(top > 0, _("Stack size increases")); /* more than 5 levels??? */
+
+ newstack = (infoptr_T *)alloc((unsigned)sizeof(infoptr_T) *
+ (buf->b_ml.ml_stack_size + STACK_INCR));
+ if (newstack == NULL)
+ return -1;
+ mch_memmove(newstack, buf->b_ml.ml_stack, (size_t)top * sizeof(infoptr_T));
+ vim_free(buf->b_ml.ml_stack);
+ buf->b_ml.ml_stack = newstack;
+ buf->b_ml.ml_stack_size += STACK_INCR;
+ }
+
+ buf->b_ml.ml_stack_top++;
+ return top;
+}
+
+/*
+ * Update the pointer blocks on the stack for inserted/deleted lines.
+ * The stack itself is also updated.
+ *
+ * When a insert/delete line action fails, the line is not inserted/deleted,
+ * but the pointer blocks have already been updated. That is fixed here by
+ * walking through the stack.
+ *
+ * Count is the number of lines added, negative if lines have been deleted.
+ */
+ static void
+ml_lineadd(buf, count)
+ buf_T *buf;
+ int count;
+{
+ int idx;
+ infoptr_T *ip;
+ PTR_BL *pp;
+ memfile_T *mfp = buf->b_ml.ml_mfp;
+ bhdr_T *hp;
+
+ for (idx = buf->b_ml.ml_stack_top - 1; idx >= 0; --idx)
+ {
+ ip = &(buf->b_ml.ml_stack[idx]);
+ if ((hp = mf_get(mfp, ip->ip_bnum, 1)) == NULL)
+ break;
+ pp = (PTR_BL *)(hp->bh_data); /* must be pointer block */
+ if (pp->pb_id != PTR_ID)
+ {
+ mf_put(mfp, hp, FALSE, FALSE);
+ EMSG(_("E317: pointer block id wrong 2"));
+ break;
+ }
+ pp->pb_pointer[ip->ip_index].pe_line_count += count;
+ ip->ip_high += count;
+ mf_put(mfp, hp, TRUE, FALSE);
+ }
+}
+
+/*
+ * make swap file name out of the file name and a directory name
+ */
+ static char_u *
+makeswapname(buf, dir_name)
+ buf_T *buf;
+ char_u *dir_name;
+{
+ char_u *r, *s;
+
+#if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */
+ s = dir_name + STRLEN(dir_name);
+ if (vim_ispathsep(s[-1]) && s[-1] == s[-2])
+ { /* Ends with '//', Use Full path */
+ r = NULL;
+ if ((s = make_percent_swname(dir_name, buf->b_fname)) != NULL)
+ {
+ r = modname(s, (char_u *)".swp", FALSE);
+ vim_free(s);
+ }
+ return r;
+ }
+#endif
+
+ r = buf_modname(
+#ifdef SHORT_FNAME
+ TRUE,
+#else
+ (buf->b_p_sn || buf->b_shortname),
+#endif
+#ifdef RISCOS
+ /* Avoid problems if fname has special chars, eg <Wimp$Scrap> */
+ buf->b_ffname,
+#else
+ buf->b_fname,
+#endif
+ (char_u *)
+#if defined(VMS) || defined(RISCOS)
+ "_swp",
+#else
+ ".swp",
+#endif
+#ifdef SHORT_FNAME /* always 8.3 file name */
+ FALSE
+#else
+ /* Prepend a '.' to the swap file name for the current directory. */
+ dir_name[0] == '.' && dir_name[1] == NUL
+#endif
+ );
+ if (r == NULL) /* out of memory */
+ return NULL;
+
+ s = get_file_in_dir(r, dir_name);
+ vim_free(r);
+ return s;
+}
+
+/*
+ * Get file name to use for swap file or backup file.
+ * Use the name of the edited file "fname" and an entry in the 'dir' or 'bdir'
+ * option "dname".
+ * - If "dname" is ".", return "fname" (swap file in dir of file).
+ * - If "dname" starts with "./", insert "dname" in "fname" (swap file
+ * relative to dir of file).
+ * - Otherwise, prepend "dname" to the tail of "fname" (swap file in specific
+ * dir).
+ *
+ * The return value is an allocated string and can be NULL.
+ */
+ char_u *
+get_file_in_dir(fname, dname)
+ char_u *fname;
+ char_u *dname; /* don't use "dirname", it is a global for Alpha */
+{
+ char_u *t;
+ char_u *tail;
+ char_u *retval;
+ int save_char;
+
+ tail = gettail(fname);
+
+ if (dname[0] == '.' && dname[1] == NUL)
+ retval = vim_strsave(fname);
+ else if (dname[0] == '.' && vim_ispathsep(dname[1]))
+ {
+ if (tail == fname) /* no path before file name */
+ retval = concat_fnames(dname + 2, tail, TRUE);
+ else
+ {
+ save_char = *tail;
+ *tail = NUL;
+ t = concat_fnames(fname, dname + 2, TRUE);
+ *tail = save_char;
+ if (t == NULL) /* out of memory */
+ retval = NULL;
+ else
+ {
+ retval = concat_fnames(t, tail, TRUE);
+ vim_free(t);
+ }
+ }
+ }
+ else
+ retval = concat_fnames(dname, tail, TRUE);
+
+ return retval;
+}
+
+/*
+ * Find out what name to use for the swap file for buffer 'buf'.
+ *
+ * Several names are tried to find one that does not exist
+ *
+ * Note: If BASENAMELEN is not correct, you will get error messages for
+ * not being able to open the swapfile
+ */
+ static char_u *
+findswapname(buf, dirp, old_fname)
+ buf_T *buf;
+ char_u **dirp; /* pointer to list of directories */
+ char_u *old_fname; /* don't give warning for this file name */
+{
+ char_u *fname;
+ int n;
+ time_t x, sx;
+ char_u *dir_name;
+#ifdef AMIGA
+ BPTR fh;
+#endif
+#ifndef SHORT_FNAME
+ int r;
+#endif
+
+#if !defined(SHORT_FNAME) \
+ && ((!defined(UNIX) && !defined(OS2)) || defined(ARCHIE))
+# define CREATE_DUMMY_FILE
+ FILE *dummyfd = NULL;
+
+/*
+ * If we start editing a new file, e.g. "test.doc", which resides on an MSDOS
+ * compatible filesystem, it is possible that the file "test.doc.swp" which we
+ * create will be exactly the same file. To avoid this problem we temporarily
+ * create "test.doc".
+ * Don't do this when the check below for a 8.3 file name is used.
+ */
+ if (!(buf->b_p_sn || buf->b_shortname) && buf->b_fname != NULL
+ && mch_getperm(buf->b_fname) < 0)
+ dummyfd = mch_fopen((char *)buf->b_fname, "w");
+#endif
+
+/*
+ * Isolate a directory name from *dirp and put it in dir_name.
+ * First allocate some memory to put the directory name in.
+ */
+ dir_name = alloc((unsigned)STRLEN(*dirp) + 1);
+ if (dir_name != NULL)
+ (void)copy_option_part(dirp, dir_name, 31000, ",");
+
+/*
+ * we try different names until we find one that does not exist yet
+ */
+ if (dir_name == NULL) /* out of memory */
+ fname = NULL;
+ else
+ fname = makeswapname(buf, dir_name);
+
+ for (;;)
+ {
+ if (fname == NULL) /* must be out of memory */
+ break;
+ if ((n = (int)STRLEN(fname)) == 0) /* safety check */
+ {
+ vim_free(fname);
+ fname = NULL;
+ break;
+ }
+#if (defined(UNIX) || defined(OS2)) && !defined(ARCHIE) && !defined(SHORT_FNAME)
+/*
+ * Some systems have a MS-DOS compatible filesystem that use 8.3 character
+ * file names. If this is the first try and the swap file name does not fit in
+ * 8.3, detect if this is the case, set shortname and try again.
+ */
+ if (fname[n - 2] == 'w' && fname[n - 1] == 'p'
+ && !(buf->b_p_sn || buf->b_shortname))
+ {
+ char_u *tail;
+ char_u *fname2;
+ struct stat s1, s2;
+ int f1, f2;
+ int created1 = FALSE, created2 = FALSE;
+ int same = FALSE;
+
+ /*
+ * Check if swapfile name does not fit in 8.3:
+ * It either contains two dots, is longer than 8 chars, or starts
+ * with a dot.
+ */
+ tail = gettail(buf->b_fname);
+ if ( vim_strchr(tail, '.') != NULL
+ || STRLEN(tail) > (size_t)8
+ || *gettail(fname) == '.')
+ {
+ fname2 = alloc(n + 2);
+ if (fname2 != NULL)
+ {
+ STRCPY(fname2, fname);
+ /* if fname == "xx.xx.swp", fname2 = "xx.xx.swx"
+ * if fname == ".xx.swp", fname2 = ".xx.swpx"
+ * if fname == "123456789.swp", fname2 = "12345678x.swp"
+ */
+ if (vim_strchr(tail, '.') != NULL)
+ fname2[n - 1] = 'x';
+ else if (*gettail(fname) == '.')
+ {
+ fname2[n] = 'x';
+ fname2[n + 1] = NUL;
+ }
+ else
+ fname2[n - 5] += 1;
+ /*
+ * may need to create the files to be able to use mch_stat()
+ */
+ f1 = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+ if (f1 < 0)
+ {
+ f1 = mch_open_rw((char *)fname,
+ O_RDWR|O_CREAT|O_EXCL|O_EXTRA);
+#if defined(OS2)
+ if (f1 < 0 && errno == ENOENT)
+ same = TRUE;
+#endif
+ created1 = TRUE;
+ }
+ if (f1 >= 0)
+ {
+ f2 = mch_open((char *)fname2, O_RDONLY | O_EXTRA, 0);
+ if (f2 < 0)
+ {
+ f2 = mch_open_rw((char *)fname2,
+ O_RDWR|O_CREAT|O_EXCL|O_EXTRA);
+ created2 = TRUE;
+ }
+ if (f2 >= 0)
+ {
+ /*
+ * Both files exist now. If mch_stat() returns the
+ * same device and inode they are the same file.
+ */
+ if (mch_fstat(f1, &s1) != -1
+ && mch_fstat(f2, &s2) != -1
+ && s1.st_dev == s2.st_dev
+ && s1.st_ino == s2.st_ino)
+ same = TRUE;
+ close(f2);
+ if (created2)
+ mch_remove(fname2);
+ }
+ close(f1);
+ if (created1)
+ mch_remove(fname);
+ }
+ vim_free(fname2);
+ if (same)
+ {
+ buf->b_shortname = TRUE;
+ vim_free(fname);
+ fname = makeswapname(buf, dir_name);
+ continue; /* try again with b_shortname set */
+ }
+ }
+ }
+ }
+#endif
+ /*
+ * check if the swapfile already exists
+ */
+ if (mch_getperm(fname) < 0) /* it does not exist */
+ {
+#ifdef HAVE_LSTAT
+ struct stat sb;
+
+ /*
+ * Extra security check: When a swap file is a symbolic link, this
+ * is most likely a symlink attack.
+ */
+ if (mch_lstat((char *)fname, &sb) < 0)
+#else
+# ifdef AMIGA
+ fh = Open((UBYTE *)fname, (long)MODE_NEWFILE);
+ /*
+ * on the Amiga mch_getperm() will return -1 when the file exists
+ * but is being used by another program. This happens if you edit
+ * a file twice.
+ */
+ if (fh != (BPTR)NULL) /* can open file, OK */
+ {
+ Close(fh);
+ mch_remove(fname);
+ break;
+ }
+ if (IoErr() != ERROR_OBJECT_IN_USE
+ && IoErr() != ERROR_OBJECT_EXISTS)
+# endif
+#endif
+ break;
+ }
+
+ /*
+ * A file name equal to old_fname is OK to use.
+ */
+ if (old_fname != NULL && fnamecmp(fname, old_fname) == 0)
+ break;
+
+ /*
+ * get here when file already exists
+ */
+ if (fname[n - 2] == 'w' && fname[n - 1] == 'p') /* first try */
+ {
+#ifndef SHORT_FNAME
+ /*
+ * on MS-DOS compatible filesystems (e.g. messydos) file.doc.swp
+ * and file.doc are the same file. To guess if this problem is
+ * present try if file.doc.swx exists. If it does, we set
+ * buf->b_shortname and try file_doc.swp (dots replaced by
+ * underscores for this file), and try again. If it doesn't we
+ * assume that "file.doc.swp" already exists.
+ */
+ if (!(buf->b_p_sn || buf->b_shortname)) /* not tried yet */
+ {
+ fname[n - 1] = 'x';
+ r = mch_getperm(fname); /* try "file.swx" */
+ fname[n - 1] = 'p';
+ if (r >= 0) /* "file.swx" seems to exist */
+ {
+ buf->b_shortname = TRUE;
+ vim_free(fname);
+ fname = makeswapname(buf, dir_name);
+ continue; /* try again with '.' replaced with '_' */
+ }
+ }
+#endif
+ /*
+ * If we get here the ".swp" file really exists.
+ * Give an error message, unless recovering, no file name, we are
+ * viewing a help file or when the path of the file is different
+ * (happens when all .swp files are in one directory).
+ */
+ if (!recoverymode && buf->b_fname != NULL && !buf->b_help)
+ {
+ int fd;
+ struct block0 b0;
+ int differ = FALSE;
+
+ /*
+ * Try to read block 0 from the swap file to get the original
+ * file name (and inode number).
+ */
+ fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0);
+ if (fd >= 0)
+ {
+ if (read(fd, (char *)&b0, sizeof(b0)) == sizeof(b0))
+ {
+ /*
+ * The name in the swap file may be "~user/path/file".
+ * Expand it first.
+ */
+ expand_env(b0.b0_fname, NameBuff, MAXPATHL);
+#ifdef CHECK_INODE
+ if (fnamecmp_ino(buf->b_ffname, NameBuff,
+ char_to_long(b0.b0_ino)))
+ differ = TRUE;
+#else
+ if (fnamecmp(NameBuff, buf->b_ffname) != 0)
+ differ = TRUE;
+#endif
+ }
+ close(fd);
+ }
+#ifdef RISCOS
+ else
+ /* Can't open swap file, though it does exist.
+ * Assume that the user is editing two files with
+ * the same name in different directories. No error.
+ */
+ differ = TRUE;
+#endif
+
+ /* give the ATTENTION message when there is an old swap file
+ * for the current file, and the buffer was not recovered. */
+ if (differ == FALSE && !(curbuf->b_flags & BF_RECOVERED)
+ && vim_strchr(p_shm, SHM_ATTENTION) == NULL)
+ {
+ struct stat st;
+#ifdef CREATE_DUMMY_FILE
+ int did_use_dummy = FALSE;
+
+ /* Avoid getting a warning for the file being created
+ * outside of Vim, it was created at the start of this
+ * function. Delete the file now, because Vim might exit
+ * here if the window is closed. */
+ if (dummyfd != NULL)
+ {
+ fclose(dummyfd);
+ dummyfd = NULL;
+ mch_remove(buf->b_fname);
+ did_use_dummy = TRUE;
+ }
+#endif
+#ifdef FEAT_GUI
+ /* If we are supposed to start the GUI but it wasn't
+ * completely started yet, start it now. This makes the
+ * messages displayed in the Vim window when loading a
+ * session from the .gvimrc file. */
+ if (gui.starting && !gui.in_use)
+ gui_start();
+#endif
+
+#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) && (defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG))
+ process_still_running = FALSE;
+#endif
+ ++no_wait_return;
+ (void)EMSG(_("E325: ATTENTION"));
+ MSG_PUTS(_("\nFound a swap file by the name \""));
+ msg_home_replace(fname);
+ MSG_PUTS("\"\n");
+ sx = swapfile_info(fname);
+ MSG_PUTS(_("While opening file \""));
+ msg_outtrans(buf->b_fname);
+ MSG_PUTS("\"\n");
+ if (mch_stat((char *)buf->b_fname, &st) != -1)
+ {
+ MSG_PUTS(_(" dated: "));
+ x = st.st_mtime; /* Manx C can't do &st.st_mtime */
+ MSG_PUTS(ctime(&x));
+ if (sx != 0 && x > sx)
+ MSG_PUTS(_(" NEWER than swap file!\n"));
+ }
+ /* Some of these messages are long to allow translation to
+ * other languages. */
+ MSG_PUTS(_("\n(1) Another program may be editing the same file.\n If this is the case, be careful not to end up with two\n different instances of the same file when making changes.\n"));
+ MSG_PUTS(_(" Quit, or continue with caution.\n"));
+ MSG_PUTS(_("\n(2) An edit session for this file crashed.\n"));
+ MSG_PUTS(_(" If this is the case, use \":recover\" or \"vim -r "));
+ msg_outtrans(buf->b_fname);
+ MSG_PUTS(_("\"\n to recover the changes (see \":help recovery\").\n"));
+ MSG_PUTS(_(" If you did this already, delete the swap file \""));
+ msg_outtrans(fname);
+ MSG_PUTS(_("\"\n to avoid this message.\n"));
+ cmdline_row = msg_row;
+ --no_wait_return;
+
+ /* We don't want a 'q' typed at the more-prompt interrupt
+ * loading a file. */
+ got_int = FALSE;
+
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (swap_exists_action)
+ {
+ char_u *name;
+
+ name = alloc((unsigned)(STRLEN(fname)
+ + STRLEN(_("Swap file \""))
+ + STRLEN(_("\" already exists!")) + 5));
+ if (name != NULL)
+ {
+ STRCPY(name, _("Swap file \""));
+ home_replace(NULL, fname, name + STRLEN(name),
+ 1000, TRUE);
+ STRCAT(name, _("\" already exists!"));
+ }
+ switch (do_dialog(VIM_WARNING,
+ (char_u *)_("VIM - ATTENTION"),
+ name == NULL
+ ? (char_u *)_("Swap file already exists!")
+ : name,
+# if defined(UNIX) || defined(__EMX__) || defined(VMS)
+ process_still_running
+ ? (char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort") :
+# endif
+ (char_u *)_("&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort\n&Delete it"), 1, NULL))
+ {
+ case 1:
+ buf->b_p_ro = TRUE;
+ break;
+ case 2:
+ break;
+ case 3:
+ swap_exists_action = SEA_RECOVER;
+ break;
+ case 4:
+ swap_exists_action = SEA_QUIT;
+ break;
+ case 5:
+ swap_exists_action = SEA_QUIT;
+ got_int = TRUE;
+ break;
+ case 6:
+ mch_remove(fname);
+ break;
+ }
+ vim_free(name);
+
+ /* pretend screen didn't scroll, need redraw anyway */
+ msg_scrolled = 0;
+ redraw_all_later(NOT_VALID);
+
+ /* If the file was deleted this fname can be used. */
+ if (mch_getperm(fname) < 0)
+ break;
+ }
+ else
+#endif
+ {
+ MSG_PUTS("\n");
+ need_wait_return = TRUE; /* call wait_return later */
+ }
+
+#ifdef CREATE_DUMMY_FILE
+ /* Going to try another name, need the dummy file again. */
+ if (did_use_dummy)
+ dummyfd = mch_fopen((char *)buf->b_fname, "w");
+#endif
+ }
+ }
+ }
+
+ /*
+ * Change the ".swp" extension to find another file that can be used.
+ * First decrement the last char: ".swo", ".swn", etc.
+ * If that still isn't enough decrement the last but one char: ".svz"
+ * Can happen when editing many "No File" buffers.
+ */
+ if (fname[n - 1] == 'a') /* ".s?a" */
+ {
+ if (fname[n - 2] == 'a') /* ".saa": tried enough, give up */
+ {
+ EMSG(_("E326: Too many swap files found"));
+ vim_free(fname);
+ fname = NULL;
+ break;
+ }
+ --fname[n - 2]; /* ".svz", ".suz", etc. */
+ fname[n - 1] = 'z' + 1;
+ }
+ --fname[n - 1]; /* ".swo", ".swn", etc. */
+ }
+
+ vim_free(dir_name);
+#ifdef CREATE_DUMMY_FILE
+ if (dummyfd != NULL) /* file has been created temporarily */
+ {
+ fclose(dummyfd);
+ mch_remove(buf->b_fname);
+ }
+#endif
+ return fname;
+}
+
+ static int
+b0_magic_wrong(b0p)
+ ZERO_BL *b0p;
+{
+ return (b0p->b0_magic_long != (long)B0_MAGIC_LONG
+ || b0p->b0_magic_int != (int)B0_MAGIC_INT
+ || b0p->b0_magic_short != (short)B0_MAGIC_SHORT
+ || b0p->b0_magic_char != B0_MAGIC_CHAR);
+}
+
+#ifdef CHECK_INODE
+/*
+ * Compare current file name with file name from swap file.
+ * Try to use inode numbers when possible.
+ * Return non-zero when files are different.
+ *
+ * When comparing file names a few things have to be taken into consideration:
+ * - When working over a network the full path of a file depends on the host.
+ * We check the inode number if possible. It is not 100% reliable though,
+ * because the device number cannot be used over a network.
+ * - When a file does not exist yet (editing a new file) there is no inode
+ * number.
+ * - The file name in a swap file may not be valid on the current host. The
+ * "~user" form is used whenever possible to avoid this.
+ *
+ * This is getting complicated, let's make a table:
+ *
+ * ino_c ino_s fname_c fname_s differ =
+ *
+ * both files exist -> compare inode numbers:
+ * != 0 != 0 X X ino_c != ino_s
+ *
+ * inode number(s) unknown, file names available -> compare file names
+ * == 0 X OK OK fname_c != fname_s
+ * X == 0 OK OK fname_c != fname_s
+ *
+ * current file doesn't exist, file for swap file exist, file name(s) not
+ * available -> probably different
+ * == 0 != 0 FAIL X TRUE
+ * == 0 != 0 X FAIL TRUE
+ *
+ * current file exists, inode for swap unknown, file name(s) not
+ * available -> probably different
+ * != 0 == 0 FAIL X TRUE
+ * != 0 == 0 X FAIL TRUE
+ *
+ * current file doesn't exist, inode for swap unknown, one file name not
+ * available -> probably different
+ * == 0 == 0 FAIL OK TRUE
+ * == 0 == 0 OK FAIL TRUE
+ *
+ * current file doesn't exist, inode for swap unknown, both file names not
+ * available -> probably same file
+ * == 0 == 0 FAIL FAIL FALSE
+ *
+ * Note that when the ino_t is 64 bits, only the last 32 will be used. This
+ * can't be changed without making the block 0 incompatible with 32 bit
+ * versions.
+ */
+
+ static int
+fnamecmp_ino(fname_c, fname_s, ino_block0)
+ char_u *fname_c; /* current file name */
+ char_u *fname_s; /* file name from swap file */
+ long ino_block0;
+{
+ struct stat st;
+ ino_t ino_c = 0; /* ino of current file */
+ ino_t ino_s; /* ino of file from swap file */
+ char_u buf_c[MAXPATHL]; /* full path of fname_c */
+ char_u buf_s[MAXPATHL]; /* full path of fname_s */
+ int retval_c; /* flag: buf_c valid */
+ int retval_s; /* flag: buf_s valid */
+
+ if (mch_stat((char *)fname_c, &st) == 0)
+ ino_c = (ino_t)st.st_ino;
+
+ /*
+ * First we try to get the inode from the file name, because the inode in
+ * the swap file may be outdated. If that fails (e.g. this path is not
+ * valid on this machine), use the inode from block 0.
+ */
+ if (mch_stat((char *)fname_s, &st) == 0)
+ ino_s = (ino_t)st.st_ino;
+ else
+ ino_s = (ino_t)ino_block0;
+
+ if (ino_c && ino_s)
+ return (ino_c != ino_s);
+
+ /*
+ * One of the inode numbers is unknown, try a forced vim_FullName() and
+ * compare the file names.
+ */
+ retval_c = vim_FullName(fname_c, buf_c, MAXPATHL, TRUE);
+ retval_s = vim_FullName(fname_s, buf_s, MAXPATHL, TRUE);
+ if (retval_c == OK && retval_s == OK)
+ return (STRCMP(buf_c, buf_s) != 0);
+
+ /*
+ * Can't compare inodes or file names, guess that the files are different,
+ * unless both appear not to exist at all.
+ */
+ if (ino_s == 0 && ino_c == 0 && retval_c == FAIL && retval_s == FAIL)
+ return FALSE;
+ return TRUE;
+}
+#endif /* CHECK_INODE */
+
+/*
+ * Move a long integer into a four byte character array.
+ * Used for machine independency in block zero.
+ */
+ static void
+long_to_char(n, s)
+ long n;
+ char_u *s;
+{
+ s[0] = (char_u)(n & 0xff);
+ n = (unsigned)n >> 8;
+ s[1] = (char_u)(n & 0xff);
+ n = (unsigned)n >> 8;
+ s[2] = (char_u)(n & 0xff);
+ n = (unsigned)n >> 8;
+ s[3] = (char_u)(n & 0xff);
+}
+
+ static long
+char_to_long(s)
+ char_u *s;
+{
+ long retval;
+
+ retval = s[3];
+ retval <<= 8;
+ retval |= s[2];
+ retval <<= 8;
+ retval |= s[1];
+ retval <<= 8;
+ retval |= s[0];
+
+ return retval;
+}
+
+ void
+ml_setdirty(buf, flag)
+ buf_T *buf;
+ int flag;
+{
+ bhdr_T *hp;
+ ZERO_BL *b0p;
+
+ if (!buf->b_ml.ml_mfp)
+ return;
+ for (hp = buf->b_ml.ml_mfp->mf_used_last; hp != NULL; hp = hp->bh_prev)
+ {
+ if (hp->bh_bnum == 0)
+ {
+ b0p = (ZERO_BL *)(hp->bh_data);
+ b0p->b0_dirty = flag ? 0x55 : 0;
+ hp->bh_flags |= BH_DIRTY;
+ mf_sync(buf->b_ml.ml_mfp, MFS_ZERO);
+ break;
+ }
+ }
+}
+
+#if defined(FEAT_BYTEOFF) || defined(PROTO)
+
+#define MLCS_MAXL 800 /* max no of lines in chunk */
+#define MLCS_MINL 400 /* should be half of MLCS_MAXL */
+
+/*
+ * Keep information for finding byte offset of a line, updtytpe may be one of:
+ * ML_CHNK_ADDLINE: Add len to parent chunk, possibly splitting it
+ * Careful: ML_CHNK_ADDLINE may cause ml_find_line() to be called.
+ * ML_CHNK_DELLINE: Subtract len from parent chunk, possibly deleting it
+ * ML_CHNK_UPDLINE: Add len to parent chunk, as a signed entity.
+ */
+ static void
+ml_updatechunk(buf, line, len, updtype)
+ buf_T *buf;
+ linenr_T line;
+ long len;
+ int updtype;
+{
+ static buf_T *ml_upd_lastbuf = NULL;
+ static linenr_T ml_upd_lastline;
+ static linenr_T ml_upd_lastcurline;
+ static int ml_upd_lastcurix;
+
+ linenr_T curline = ml_upd_lastcurline;
+ int curix = ml_upd_lastcurix;
+ long size;
+ chunksize_T *curchnk;
+ int rest;
+ bhdr_T *hp;
+ DATA_BL *dp;
+
+ if (buf->b_ml.ml_usedchunks == -1 || len == 0)
+ return;
+ if (buf->b_ml.ml_chunksize == NULL)
+ {
+ buf->b_ml.ml_chunksize = (chunksize_T *)
+ alloc((unsigned)sizeof(chunksize_T) * 100);
+ if (buf->b_ml.ml_chunksize == NULL)
+ {
+ buf->b_ml.ml_usedchunks = -1;
+ return;
+ }
+ buf->b_ml.ml_numchunks = 100;
+ buf->b_ml.ml_usedchunks = 1;
+ buf->b_ml.ml_chunksize[0].mlcs_numlines = 1;
+ buf->b_ml.ml_chunksize[0].mlcs_totalsize = 1;
+ }
+
+ if (updtype == ML_CHNK_UPDLINE && buf->b_ml.ml_line_count == 1)
+ {
+ /*
+ * First line in empty buffer from ml_flush_line() -- reset
+ */
+ buf->b_ml.ml_usedchunks = 1;
+ buf->b_ml.ml_chunksize[0].mlcs_numlines = 1;
+ buf->b_ml.ml_chunksize[0].mlcs_totalsize =
+ (long)STRLEN(buf->b_ml.ml_line_ptr) + 1;
+ return;
+ }
+
+ /*
+ * Find chunk that our line belongs to, curline will be at start of the
+ * chunk.
+ */
+ if (buf != ml_upd_lastbuf || line != ml_upd_lastline + 1
+ || updtype != ML_CHNK_ADDLINE)
+ {
+ for (curline = 1, curix = 0;
+ curix < buf->b_ml.ml_usedchunks - 1
+ && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines;
+ curix++)
+ {
+ curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
+ }
+ }
+ else if (line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines
+ && curix < buf->b_ml.ml_usedchunks - 1)
+ {
+ /* Adjust cached curix & curline */
+ curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
+ curix++;
+ }
+ curchnk = buf->b_ml.ml_chunksize + curix;
+
+ if (updtype == ML_CHNK_DELLINE)
+ len *= -1;
+ curchnk->mlcs_totalsize += len;
+ if (updtype == ML_CHNK_ADDLINE)
+ {
+ curchnk->mlcs_numlines++;
+
+ /* May resize here so we don't have to do it in both cases below */
+ if (buf->b_ml.ml_usedchunks + 1 >= buf->b_ml.ml_numchunks)
+ {
+ buf->b_ml.ml_numchunks = buf->b_ml.ml_numchunks * 3 / 2;
+ buf->b_ml.ml_chunksize = (chunksize_T *)
+ vim_realloc(buf->b_ml.ml_chunksize,
+ sizeof(chunksize_T) * buf->b_ml.ml_numchunks);
+ if (buf->b_ml.ml_chunksize == NULL)
+ {
+ /* Hmmmm, Give up on offset for this buffer */
+ buf->b_ml.ml_usedchunks = -1;
+ return;
+ }
+ }
+
+ if (buf->b_ml.ml_chunksize[curix].mlcs_numlines >= MLCS_MAXL)
+ {
+ int count; /* number of entries in block */
+ int idx;
+ int text_end;
+ int linecnt;
+
+ mch_memmove(buf->b_ml.ml_chunksize + curix + 1,
+ buf->b_ml.ml_chunksize + curix,
+ (buf->b_ml.ml_usedchunks - curix) *
+ sizeof(chunksize_T));
+ /* Compute length of first half of lines in the splitted chunk */
+ size = 0;
+ linecnt = 0;
+ while (curline < buf->b_ml.ml_line_count
+ && linecnt < MLCS_MINL)
+ {
+ if ((hp = ml_find_line(buf, curline, ML_FIND)) == NULL)
+ {
+ buf->b_ml.ml_usedchunks = -1;
+ return;
+ }
+ dp = (DATA_BL *)(hp->bh_data);
+ count = (long)(buf->b_ml.ml_locked_high) -
+ (long)(buf->b_ml.ml_locked_low) + 1;
+ idx = curline - buf->b_ml.ml_locked_low;
+ curline = buf->b_ml.ml_locked_high + 1;
+ if (idx == 0)/* first line in block, text at the end */
+ text_end = dp->db_txt_end;
+ else
+ text_end = ((dp->db_index[idx - 1]) & DB_INDEX_MASK);
+ /* Compute index of last line to use in this MEMLINE */
+ rest = count - idx;
+ if (linecnt + rest > MLCS_MINL)
+ {
+ idx += MLCS_MINL - linecnt - 1;
+ linecnt = MLCS_MINL;
+ }
+ else
+ {
+ idx = count - 1;
+ linecnt += rest;
+ }
+ size += text_end - ((dp->db_index[idx]) & DB_INDEX_MASK);
+ }
+ buf->b_ml.ml_chunksize[curix].mlcs_numlines = linecnt;
+ buf->b_ml.ml_chunksize[curix + 1].mlcs_numlines -= linecnt;
+ buf->b_ml.ml_chunksize[curix].mlcs_totalsize = size;
+ buf->b_ml.ml_chunksize[curix + 1].mlcs_totalsize -= size;
+ buf->b_ml.ml_usedchunks++;
+ ml_upd_lastbuf = NULL; /* Force recalc of curix & curline */
+ return;
+ }
+ else if (buf->b_ml.ml_chunksize[curix].mlcs_numlines >= MLCS_MINL
+ && curix == buf->b_ml.ml_usedchunks - 1
+ && buf->b_ml.ml_line_count - line <= 1)
+ {
+ /*
+ * We are in the last chunk and it is cheap to crate a new one
+ * after this. Do it now to avoid the loop above later on
+ */
+ curchnk = buf->b_ml.ml_chunksize + curix + 1;
+ buf->b_ml.ml_usedchunks++;
+ if (line == buf->b_ml.ml_line_count)
+ {
+ curchnk->mlcs_numlines = 0;
+ curchnk->mlcs_totalsize = 0;
+ }
+ else
+ {
+ /*
+ * Line is just prior to last, move count for last
+ * This is the common case when loading a new file
+ */
+ hp = ml_find_line(buf, buf->b_ml.ml_line_count, ML_FIND);
+ if (hp == NULL)
+ {
+ buf->b_ml.ml_usedchunks = -1;
+ return;
+ }
+ dp = (DATA_BL *)(hp->bh_data);
+ if (dp->db_line_count == 1)
+ rest = dp->db_txt_end - dp->db_txt_start;
+ else
+ rest =
+ ((dp->db_index[dp->db_line_count - 2]) & DB_INDEX_MASK)
+ - dp->db_txt_start;
+ curchnk->mlcs_totalsize = rest;
+ curchnk->mlcs_numlines = 1;
+ curchnk[-1].mlcs_totalsize -= rest;
+ curchnk[-1].mlcs_numlines -= 1;
+ }
+ }
+ }
+ else if (updtype == ML_CHNK_DELLINE)
+ {
+ curchnk->mlcs_numlines--;
+ ml_upd_lastbuf = NULL; /* Force recalc of curix & curline */
+ if (curix < (buf->b_ml.ml_usedchunks - 1)
+ && (curchnk->mlcs_numlines + curchnk[1].mlcs_numlines)
+ <= MLCS_MINL)
+ {
+ curix++;
+ curchnk = buf->b_ml.ml_chunksize + curix;
+ }
+ else if (curix == 0 && curchnk->mlcs_numlines <= 0)
+ {
+ buf->b_ml.ml_usedchunks--;
+ mch_memmove(buf->b_ml.ml_chunksize, buf->b_ml.ml_chunksize + 1,
+ buf->b_ml.ml_usedchunks * sizeof(chunksize_T));
+ return;
+ }
+ else if (curix == 0 || (curchnk->mlcs_numlines > 10
+ && (curchnk->mlcs_numlines + curchnk[-1].mlcs_numlines)
+ > MLCS_MINL))
+ {
+ return;
+ }
+
+ /* Collapse chunks */
+ curchnk[-1].mlcs_numlines += curchnk->mlcs_numlines;
+ curchnk[-1].mlcs_totalsize += curchnk->mlcs_totalsize;
+ buf->b_ml.ml_usedchunks--;
+ if (curix < buf->b_ml.ml_usedchunks)
+ {
+ mch_memmove(buf->b_ml.ml_chunksize + curix,
+ buf->b_ml.ml_chunksize + curix + 1,
+ (buf->b_ml.ml_usedchunks - curix) *
+ sizeof(chunksize_T));
+ }
+ return;
+ }
+ ml_upd_lastbuf = buf;
+ ml_upd_lastline = line;
+ ml_upd_lastcurline = curline;
+ ml_upd_lastcurix = curix;
+}
+
+/*
+ * Find offset for line or line with offset.
+ * Find line with offset if line is 0; return remaining offset in offp
+ * Find offset of line if line > 0
+ * return -1 if information is not available
+ */
+ long
+ml_find_line_or_offset(buf, line, offp)
+ buf_T *buf;
+ linenr_T line;
+ long *offp;
+{
+ linenr_T curline;
+ int curix;
+ long size;
+ bhdr_T *hp;
+ DATA_BL *dp;
+ int count; /* number of entries in block */
+ int idx;
+ int start_idx;
+ int text_end;
+ long offset;
+ int len;
+ int ffdos = (get_fileformat(buf) == EOL_DOS);
+ int extra = 0;
+
+ if (buf->b_ml.ml_usedchunks == -1
+ || buf->b_ml.ml_chunksize == NULL
+ || line < 0)
+ return -1;
+
+ if (offp == NULL)
+ offset = 0;
+ else
+ offset = *offp;
+ if (line == 0 && offset <= 0)
+ return 1; /* Not a "find offset" and offset 0 _must_ be in line 1 */
+ /*
+ * Find the last chunk before the one containing our line. Last chunk is
+ * special because it will never qualify
+ */
+ curline = 1;
+ curix = size = 0;
+ while (curix < buf->b_ml.ml_usedchunks - 1
+ && ((line != 0
+ && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines)
+ || (offset != 0
+ && offset > size + buf->b_ml.ml_chunksize[curix].mlcs_totalsize
+ + ffdos * buf->b_ml.ml_chunksize[curix].mlcs_numlines)))
+ {
+ curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
+ size += buf->b_ml.ml_chunksize[curix].mlcs_totalsize;
+ if (offset && ffdos)
+ size += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
+ curix++;
+ }
+
+ while ((line != 0 && curline < line) || (offset != 0 && size < offset))
+ {
+ if (curline > buf->b_ml.ml_line_count
+ || (hp = ml_find_line(buf, curline, ML_FIND)) == NULL)
+ return -1;
+ dp = (DATA_BL *)(hp->bh_data);
+ count = (long)(buf->b_ml.ml_locked_high) -
+ (long)(buf->b_ml.ml_locked_low) + 1;
+ start_idx = idx = curline - buf->b_ml.ml_locked_low;
+ if (idx == 0)/* first line in block, text at the end */
+ text_end = dp->db_txt_end;
+ else
+ text_end = ((dp->db_index[idx - 1]) & DB_INDEX_MASK);
+ /* Compute index of last line to use in this MEMLINE */
+ if (line != 0)
+ {
+ if (curline + (count - idx) >= line)
+ idx += line - curline - 1;
+ else
+ idx = count - 1;
+ }
+ else
+ {
+ extra = 0;
+ while (offset >= size
+ + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK)
+ + ffdos)
+ {
+ if (ffdos)
+ size++;
+ if (idx == count - 1)
+ {
+ extra = 1;
+ break;
+ }
+ idx++;
+ }
+ }
+ len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK);
+ size += len;
+ if (offset != 0 && size >= offset)
+ {
+ if (size + ffdos == offset)
+ *offp = 0;
+ else if (idx == start_idx)
+ *offp = offset - size + len;
+ else
+ *offp = offset - size + len
+ - (text_end - ((dp->db_index[idx - 1]) & DB_INDEX_MASK));
+ curline += idx - start_idx + extra;
+ if (curline > buf->b_ml.ml_line_count)
+ return -1; /* exactly one byte beyond the end */
+ return curline;
+ }
+ curline = buf->b_ml.ml_locked_high + 1;
+ }
+
+ if (ffdos)
+ size += line - 1;
+ return size;
+}
+
+/*
+ * Goto byte in buffer with offset 'cnt'.
+ */
+ void
+goto_byte(cnt)
+ long cnt;
+{
+ long boff = cnt;
+ linenr_T lnum;
+
+ ml_flush_line(curbuf); /* cached line may be dirty */
+ setpcmark();
+ if (boff)
+ --boff;
+ lnum = ml_find_line_or_offset(curbuf, (linenr_T)0, &boff);
+ if (lnum < 1) /* past the end */
+ {
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ curwin->w_curswant = MAXCOL;
+ coladvance((colnr_T)MAXCOL);
+ }
+ else
+ {
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = (colnr_T)boff;
+ curwin->w_set_curswant = TRUE;
+ }
+ check_cursor();
+
+# ifdef FEAT_MBYTE
+ /* Make sure the cursor is on the first byte of a multi-byte char. */
+ if (has_mbyte)
+ mb_adjust_cursor();
+# endif
+}
+#endif
diff --git a/src/menu.c b/src/menu.c
new file mode 100644
index 000000000..052910f7e
--- /dev/null
+++ b/src/menu.c
@@ -0,0 +1,2385 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI/Motif support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Code for menus. Used for the GUI and 'wildmenu'.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_MENU) || defined(PROTO)
+
+#define MENUDEPTH 10 /* maximum depth of menus */
+
+#ifdef FEAT_GUI_W32
+static int add_menu_path __ARGS((char_u *, vimmenu_T *, int *, char_u *, int));
+#else
+static int add_menu_path __ARGS((char_u *, vimmenu_T *, int *, char_u *));
+#endif
+static int menu_nable_recurse __ARGS((vimmenu_T *menu, char_u *name, int modes, int enable));
+static int remove_menu __ARGS((vimmenu_T **, char_u *, int, int silent));
+static void free_menu __ARGS((vimmenu_T **menup));
+static void free_menu_string __ARGS((vimmenu_T *, int));
+static int show_menus __ARGS((char_u *, int));
+static void show_menus_recursive __ARGS((vimmenu_T *, int, int));
+static int menu_name_equal __ARGS((char_u *name, vimmenu_T *menu));
+static int menu_namecmp __ARGS((char_u *name, char_u *mname));
+static int get_menu_cmd_modes __ARGS((char_u *, int, int *, int *));
+static char_u *popup_mode_name __ARGS((char_u *name, int idx));
+static char_u *menu_text __ARGS((char_u *text, int *mnemonic, char_u **actext));
+#ifdef FEAT_GUI
+static int get_menu_mode __ARGS((void));
+static void gui_update_menus_recurse __ARGS((vimmenu_T *, int));
+#endif
+
+#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+static void gui_create_tearoffs_recurse __ARGS((vimmenu_T *menu, const char_u *pname, int *pri_tab, int pri_idx));
+static void gui_add_tearoff __ARGS((char_u *tearpath, int *pri_tab, int pri_idx));
+static void gui_destroy_tearoffs_recurse __ARGS((vimmenu_T *menu));
+static int s_tearoffs = FALSE;
+#endif
+
+static int menu_is_hidden __ARGS((char_u *name));
+#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
+static int menu_is_tearoff __ARGS((char_u *name));
+#endif
+
+#if defined(FEAT_MULTI_LANG) || defined(FEAT_TOOLBAR)
+static char_u *menu_skip_part __ARGS((char_u *p));
+#endif
+#ifdef FEAT_MULTI_LANG
+static char_u *menutrans_lookup __ARGS((char_u *name, int len));
+#endif
+
+/* The character for each menu mode */
+static char_u menu_mode_chars[] = {'n', 'v', 'o', 'i', 'c', 't'};
+
+static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
+static char_u e_othermode[] = N_("E328: Menu only exists in another mode");
+static char_u e_nomenu[] = N_("E329: No menu of that name");
+
+#ifdef FEAT_TOOLBAR
+static const char *toolbar_names[] =
+{
+ /* 0 */ "New", "Open", "Save", "Undo", "Redo",
+ /* 5 */ "Cut", "Copy", "Paste", "Print", "Help",
+ /* 10 */ "Find", "SaveAll", "SaveSesn", "NewSesn", "LoadSesn",
+ /* 15 */ "RunScript", "Replace", "WinClose", "WinMax", "WinMin",
+ /* 20 */ "WinSplit", "Shell", "FindPrev", "FindNext", "FindHelp",
+ /* 25 */ "Make", "TagJump", "RunCtags", "WinVSplit", "WinMaxWidth",
+ /* 30 */ "WinMinWidth", "Exit"
+};
+# define TOOLBAR_NAME_COUNT (sizeof(toolbar_names) / sizeof(char *))
+#endif
+
+/*
+ * Do the :menu command and relatives.
+ */
+ void
+ex_menu(eap)
+ exarg_T *eap; /* Ex command arguments */
+{
+ char_u *menu_path;
+ int modes;
+ char_u *map_to;
+ int noremap;
+ int silent = FALSE;
+ int unmenu;
+ char_u *map_buf;
+ char_u *arg;
+ char_u *p;
+ int i;
+#if defined(FEAT_GUI) && !defined(FEAT_GUI_GTK)
+ int old_menu_height;
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_W16)
+ int old_toolbar_height;
+# endif
+#endif
+ int pri_tab[MENUDEPTH + 1];
+ int enable = MAYBE; /* TRUE for "menu enable", FALSE for "menu
+ * disable */
+#ifdef FEAT_MULTI_LANG
+ char_u *tofree = NULL;
+ char_u *new_cmd;
+#endif
+#ifdef FEAT_TOOLBAR
+ char_u *icon = NULL;
+#endif
+ vimmenu_T menuarg;
+
+ modes = get_menu_cmd_modes(eap->cmd, eap->forceit, &noremap, &unmenu);
+ arg = eap->arg;
+
+ for (;;)
+ {
+ if (STRNCMP(arg, "<script>", 8) == 0)
+ {
+ noremap = REMAP_SCRIPT;
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+ if (STRNCMP(arg, "<silent>", 8) == 0)
+ {
+ silent = TRUE;
+ arg = skipwhite(arg + 8);
+ continue;
+ }
+ break;
+ }
+
+
+ /* Locate an optional "icon=filename" argument. */
+ if (STRNCMP(arg, "icon=", 5) == 0)
+ {
+ arg += 5;
+#ifdef FEAT_TOOLBAR
+ icon = arg;
+#endif
+ while (*arg != NUL && *arg != ' ')
+ {
+ if (*arg == '\\')
+ mch_memmove(arg, arg + 1, STRLEN(arg));
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ arg += (*mb_ptr2len_check)(arg);
+ else
+#endif
+ ++arg;
+ }
+ if (*arg != NUL)
+ {
+ *arg++ = NUL;
+ arg = skipwhite(arg);
+ }
+ }
+
+ /*
+ * Fill in the priority table.
+ */
+ for (p = arg; *p; ++p)
+ if (!VIM_ISDIGIT(*p) && *p != '.')
+ break;
+ if (vim_iswhite(*p))
+ {
+ for (i = 0; i < MENUDEPTH && !vim_iswhite(*arg); ++i)
+ {
+ pri_tab[i] = getdigits(&arg);
+ if (pri_tab[i] == 0)
+ pri_tab[i] = 500;
+ if (*arg == '.')
+ ++arg;
+ }
+ arg = skipwhite(arg);
+ }
+ else if (eap->addr_count && eap->line2 != 0)
+ {
+ pri_tab[0] = eap->line2;
+ i = 1;
+ }
+ else
+ i = 0;
+ while (i < MENUDEPTH)
+ pri_tab[i++] = 500;
+ pri_tab[MENUDEPTH] = -1; /* mark end of the table */
+
+ /*
+ * Check for "disable" or "enable" argument.
+ */
+ if (STRNCMP(arg, "enable", 6) == 0 && vim_iswhite(arg[6]))
+ {
+ enable = TRUE;
+ arg = skipwhite(arg + 6);
+ }
+ else if (STRNCMP(arg, "disable", 7) == 0 && vim_iswhite(arg[7]))
+ {
+ enable = FALSE;
+ arg = skipwhite(arg + 7);
+ }
+
+ /*
+ * If there is no argument, display all menus.
+ */
+ if (*arg == NUL)
+ {
+ show_menus(arg, modes);
+ return;
+ }
+
+#ifdef FEAT_TOOLBAR
+ /*
+ * Need to get the toolbar icon index before doing the translation.
+ */
+ menuarg.iconidx = -1;
+ menuarg.icon_builtin = FALSE;
+ if (menu_is_toolbar(arg))
+ {
+ menu_path = menu_skip_part(arg);
+ if (*menu_path == '.')
+ {
+ p = menu_skip_part(++menu_path);
+ if (STRNCMP(menu_path, "BuiltIn", 7) == 0)
+ {
+ if (skipdigits(menu_path + 7) == p)
+ {
+ menuarg.iconidx = atoi((char *)menu_path + 7);
+ if (menuarg.iconidx >= TOOLBAR_NAME_COUNT)
+ menuarg.iconidx = -1;
+ else
+ menuarg.icon_builtin = TRUE;
+ }
+ }
+ else
+ {
+ for (i = 0; i < TOOLBAR_NAME_COUNT; ++i)
+ if (STRNCMP(toolbar_names[i], menu_path, p - menu_path)
+ == 0)
+ {
+ menuarg.iconidx = i;
+ break;
+ }
+ }
+ }
+ }
+#endif
+
+#ifdef FEAT_MULTI_LANG
+ /*
+ * Translate menu names as specified with ":menutrans" commands.
+ */
+ menu_path = arg;
+ while (*menu_path)
+ {
+ /* find the end of one part and check if it should be translated */
+ p = menu_skip_part(menu_path);
+ map_to = menutrans_lookup(menu_path, (int)(p - menu_path));
+ if (map_to != NULL)
+ {
+ /* found a match: replace with the translated part */
+ i = (int)STRLEN(map_to);
+ new_cmd = alloc((unsigned)STRLEN(arg) + i + 1);
+ if (new_cmd == NULL)
+ break;
+ mch_memmove(new_cmd, arg, menu_path - arg);
+ mch_memmove(new_cmd + (menu_path - arg), map_to, (size_t)i);
+ STRCPY(new_cmd + (menu_path - arg) + i, p);
+ p = new_cmd + (menu_path - arg) + i;
+ vim_free(tofree);
+ tofree = new_cmd;
+ arg = new_cmd;
+ }
+ if (*p != '.')
+ break;
+ menu_path = p + 1;
+ }
+#endif
+
+ /*
+ * Isolate the menu name.
+ * Skip the menu name, and translate <Tab> into a real TAB.
+ */
+ menu_path = arg;
+ if (*menu_path == '.')
+ {
+ EMSG2(_(e_invarg2), menu_path);
+ goto theend;
+ }
+
+ while (*arg && !vim_iswhite(*arg))
+ {
+ if ((*arg == '\\' || *arg == Ctrl_V) && arg[1] != NUL)
+ arg++;
+ else if (STRNICMP(arg, "<TAB>", 5) == 0)
+ {
+ *arg = TAB;
+ mch_memmove(arg + 1, arg + 5, STRLEN(arg + 4));
+ }
+ arg++;
+ }
+ if (*arg != NUL)
+ *arg++ = NUL;
+ arg = skipwhite(arg);
+ map_to = arg;
+
+ /*
+ * If there is only a menu name, display menus with that name.
+ */
+ if (*map_to == NUL && !unmenu && enable == MAYBE)
+ {
+ show_menus(menu_path, modes);
+ goto theend;
+ }
+ else if (*map_to != NUL && (unmenu || enable != MAYBE))
+ {
+ EMSG(_(e_trailing));
+ goto theend;
+ }
+#if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON))
+ old_menu_height = gui.menu_height;
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_W16)
+ old_toolbar_height = gui.toolbar_height;
+# endif
+#endif
+
+ if (enable != MAYBE)
+ {
+ /*
+ * Change sensitivity of the menu.
+ * For the PopUp menu, remove a menu for each mode separately.
+ * Careful: menu_nable_recurse() changes menu_path.
+ */
+ if (STRCMP(menu_path, "*") == 0) /* meaning: do all menus */
+ menu_path = (char_u *)"";
+
+ if (menu_is_popup(menu_path))
+ {
+ for (i = 0; i < MENU_INDEX_TIP; ++i)
+ if (modes & (1 << i))
+ {
+ p = popup_mode_name(menu_path, i);
+ if (p != NULL)
+ {
+ menu_nable_recurse(root_menu, p, MENU_ALL_MODES,
+ enable);
+ vim_free(p);
+ }
+ }
+ }
+ menu_nable_recurse(root_menu, menu_path, modes, enable);
+ }
+ else if (unmenu)
+ {
+ /*
+ * Delete menu(s).
+ */
+ if (STRCMP(menu_path, "*") == 0) /* meaning: remove all menus */
+ menu_path = (char_u *)"";
+
+ /*
+ * For the PopUp menu, remove a menu for each mode separately.
+ */
+ if (menu_is_popup(menu_path))
+ {
+ for (i = 0; i < MENU_INDEX_TIP; ++i)
+ if (modes & (1 << i))
+ {
+ p = popup_mode_name(menu_path, i);
+ if (p != NULL)
+ {
+ remove_menu(&root_menu, p, MENU_ALL_MODES, TRUE);
+ vim_free(p);
+ }
+ }
+ }
+
+ /* Careful: remove_menu() changes menu_path */
+ remove_menu(&root_menu, menu_path, modes, FALSE);
+ }
+ else
+ {
+ /*
+ * Add menu(s).
+ * Replace special key codes.
+ */
+ if (STRICMP(map_to, "<nop>") == 0) /* "<Nop>" means nothing */
+ {
+ map_to = (char_u *)"";
+ map_buf = NULL;
+ }
+ else
+ map_to = replace_termcodes(map_to, &map_buf, FALSE, TRUE);
+ menuarg.modes = modes;
+#ifdef FEAT_TOOLBAR
+ menuarg.iconfile = icon;
+#endif
+ menuarg.noremap[0] = noremap;
+ menuarg.silent[0] = silent;
+ add_menu_path(menu_path, &menuarg, pri_tab, map_to
+#ifdef FEAT_GUI_W32
+ , TRUE
+#endif
+ );
+
+ /*
+ * For the PopUp menu, add a menu for each mode separately.
+ */
+ if (menu_is_popup(menu_path))
+ {
+ for (i = 0; i < MENU_INDEX_TIP; ++i)
+ if (modes & (1 << i))
+ {
+ p = popup_mode_name(menu_path, i);
+ if (p != NULL)
+ {
+ /* Include all modes, to make ":amenu" work */
+ menuarg.modes = modes;
+#ifdef FEAT_TOOLBAR
+ menuarg.iconfile = NULL;
+ menuarg.iconidx = -1;
+ menuarg.icon_builtin = FALSE;
+#endif
+ add_menu_path(p, &menuarg, pri_tab, map_to
+#ifdef FEAT_GUI_W32
+ , TRUE
+#endif
+ );
+ vim_free(p);
+ }
+ }
+ }
+
+ vim_free(map_buf);
+ }
+
+#if defined(FEAT_GUI) && !defined(FEAT_GUI_GTK)
+ /* If the menubar height changed, resize the window */
+ if (gui.in_use
+ && (gui.menu_height != old_menu_height
+# if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_W16)
+ || gui.toolbar_height != old_toolbar_height
+# endif
+ ))
+ gui_set_shellsize(FALSE, FALSE);
+#endif
+
+theend:
+#ifdef FEAT_MULTI_LANG
+ vim_free(tofree);
+#else
+ ;
+#endif
+}
+
+/*
+ * Add the menu with the given name to the menu hierarchy
+ */
+ static int
+add_menu_path(menu_path, menuarg, pri_tab, call_data
+#ifdef FEAT_GUI_W32
+ , addtearoff
+#endif
+ )
+ char_u *menu_path;
+ vimmenu_T *menuarg; /* passes modes, iconfile, iconidx,
+ icon_builtin, silent[0], noremap[0] */
+ int *pri_tab;
+ char_u *call_data;
+#ifdef FEAT_GUI_W32
+ int addtearoff; /* may add tearoff item */
+#endif
+{
+ char_u *path_name;
+ int modes = menuarg->modes;
+ vimmenu_T **menup;
+ vimmenu_T *menu = NULL;
+ vimmenu_T *parent;
+ vimmenu_T **lower_pri;
+ char_u *p;
+ char_u *name;
+ char_u *dname;
+ char_u *next_name;
+ int i;
+ int c;
+#ifdef FEAT_GUI
+ int idx;
+ int new_idx;
+#endif
+ int pri_idx = 0;
+ int old_modes = 0;
+ int amenu;
+
+ /* Make a copy so we can stuff around with it, since it could be const */
+ path_name = vim_strsave(menu_path);
+ if (path_name == NULL)
+ return FAIL;
+ menup = &root_menu;
+ parent = NULL;
+ name = path_name;
+ while (*name)
+ {
+ /* Get name of this element in the menu hierarchy, and the simplified
+ * name (without mnemonic and accelerator text). */
+ next_name = menu_name_skip(name);
+ dname = menu_text(name, NULL, NULL);
+
+ /* See if it's already there */
+ lower_pri = menup;
+#ifdef FEAT_GUI
+ idx = 0;
+ new_idx = 0;
+#endif
+ menu = *menup;
+ while (menu != NULL)
+ {
+ if (menu_name_equal(name, menu) || menu_name_equal(dname, menu))
+ {
+ if (*next_name == NUL && menu->children != NULL)
+ {
+ if (!sys_menu)
+ EMSG(_("E330: Menu path must not lead to a sub-menu"));
+ goto erret;
+ }
+ if (*next_name != NUL && menu->children == NULL
+#ifdef FEAT_GUI_W32
+ && addtearoff
+#endif
+ )
+ {
+ if (!sys_menu)
+ EMSG(_(e_notsubmenu));
+ goto erret;
+ }
+ break;
+ }
+ menup = &menu->next;
+
+ /* Count menus, to find where this one needs to be inserted.
+ * Ignore menus that are not in the menubar (PopUp and Toolbar) */
+ if (parent != NULL || menu_is_menubar(menu->name))
+ {
+#ifdef FEAT_GUI
+ ++idx;
+#endif
+ if (menu->priority <= pri_tab[pri_idx])
+ {
+ lower_pri = menup;
+#ifdef FEAT_GUI
+ new_idx = idx;
+#endif
+ }
+ }
+ menu = menu->next;
+ }
+
+ if (menu == NULL)
+ {
+ if (*next_name == NUL && parent == NULL)
+ {
+ EMSG(_("E331: Must not add menu items directly to menu bar"));
+ goto erret;
+ }
+
+ if (menu_is_separator(dname) && *next_name != NUL)
+ {
+ EMSG(_("E332: Separator cannot be part of a menu path"));
+ goto erret;
+ }
+
+ /* Not already there, so lets add it */
+ menu = (vimmenu_T *)alloc_clear((unsigned)sizeof(vimmenu_T));
+ if (menu == NULL)
+ goto erret;
+
+ menu->modes = modes;
+ menu->enabled = MENU_ALL_MODES;
+ menu->name = vim_strsave(name);
+ /* separate mnemonic and accelerator text from actual menu name */
+ menu->dname = menu_text(name, &menu->mnemonic, &menu->actext);
+ menu->priority = pri_tab[pri_idx];
+ menu->parent = parent;
+#ifdef FEAT_GUI_MOTIF
+ menu->sensitive = TRUE; /* the default */
+#endif
+#ifdef FEAT_BEVAL_TIP
+ menu->tip = NULL;
+#endif
+#ifdef FEAT_GUI_ATHENA
+ menu->image = None; /* X-Windows definition for NULL*/
+#endif
+
+ /*
+ * Add after menu that has lower priority.
+ */
+ menu->next = *lower_pri;
+ *lower_pri = menu;
+
+ old_modes = 0;
+
+#ifdef FEAT_TOOLBAR
+ menu->iconidx = menuarg->iconidx;
+ menu->icon_builtin = menuarg->icon_builtin;
+ if (*next_name == NUL && menuarg->iconfile != NULL)
+ menu->iconfile = vim_strsave(menuarg->iconfile);
+#endif
+#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+ /* the tearoff item must be present in the modes of each item. */
+ if (parent != NULL && menu_is_tearoff(parent->children->dname))
+ parent->children->modes |= modes;
+#endif
+ }
+ else
+ {
+ old_modes = menu->modes;
+
+ /*
+ * If this menu option was previously only available in other
+ * modes, then make sure it's available for this one now
+ * Also enable a menu when it's created or changed.
+ */
+#ifdef FEAT_GUI_W32
+ /* If adding a tearbar (addtearoff == FALSE) don't update modes */
+ if (addtearoff)
+#endif
+ {
+ menu->modes |= modes;
+ menu->enabled |= modes;
+ }
+ }
+
+#ifdef FEAT_GUI
+ /*
+ * Add the menu item when it's used in one of the modes, but not when
+ * only a tooltip is defined.
+ */
+ if ((old_modes & MENU_ALL_MODES) == 0
+ && (menu->modes & MENU_ALL_MODES) != 0)
+ {
+ if (gui.in_use) /* Otherwise it will be added when GUI starts */
+ {
+ if (*next_name == NUL)
+ {
+ /* Real menu item, not sub-menu */
+ gui_mch_add_menu_item(menu, new_idx);
+
+ /* Want to update menus now even if mode not changed */
+ force_menu_update = TRUE;
+ }
+ else
+ {
+ /* Sub-menu (not at end of path yet) */
+ gui_mch_add_menu(menu, new_idx);
+ }
+ }
+
+# if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+ /* When adding a new submenu, may add a tearoff item */
+ if ( addtearoff
+ && *next_name
+ && vim_strchr(p_go, GO_TEAROFF) != NULL
+ && menu_is_menubar(name))
+ {
+ char_u *tearpath;
+
+ /*
+ * The pointers next_name & path_name refer to a string with
+ * \'s and ^V's stripped out. But menu_path is a "raw"
+ * string, so we must correct for special characters.
+ */
+ tearpath = alloc((unsigned int)STRLEN(menu_path) + TEAR_LEN + 2);
+ if (tearpath != NULL)
+ {
+ char_u *s;
+ int idx;
+
+ STRCPY(tearpath, menu_path);
+ idx = (int)(next_name - path_name - 1);
+ for (s = tearpath; *s && s < tearpath + idx; ++s)
+ {
+ if ((*s == '\\' || *s == Ctrl_V) && s[1])
+ {
+ ++idx;
+ ++s;
+ }
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s) - 1;
+# endif
+ }
+ tearpath[idx] = NUL;
+ gui_add_tearoff(tearpath, pri_tab, pri_idx);
+ vim_free(tearpath);
+ }
+ }
+# endif
+ }
+#endif /* FEAT_GUI */
+
+ menup = &menu->children;
+ parent = menu;
+ name = next_name;
+ vim_free(dname);
+ if (pri_tab[pri_idx + 1] != -1)
+ ++pri_idx;
+ }
+ vim_free(path_name);
+
+ /*
+ * Only add system menu items which have not been defined yet.
+ * First check if this was an ":amenu".
+ */
+ amenu = ((modes & (MENU_NORMAL_MODE | MENU_INSERT_MODE)) ==
+ (MENU_NORMAL_MODE | MENU_INSERT_MODE));
+ if (sys_menu)
+ modes &= ~old_modes;
+
+ if (menu != NULL && modes)
+ {
+#ifdef FEAT_GUI
+ menu->cb = gui_menu_cb;
+#endif
+ p = (call_data == NULL) ? NULL : vim_strsave(call_data);
+
+ /* loop over all modes, may add more than one */
+ for (i = 0; i < MENU_MODES; ++i)
+ {
+ if (modes & (1 << i))
+ {
+ /* free any old menu */
+ free_menu_string(menu, i);
+
+ /* For "amenu", may insert an extra character.
+ * Don't do this if adding a tearbar (addtearoff == FALSE).
+ * Don't do this for "<Nop>". */
+ c = 0;
+ if (amenu && call_data != NULL && *call_data != NUL
+#ifdef FEAT_GUI_W32
+ && addtearoff
+#endif
+ )
+ {
+ switch (1 << i)
+ {
+ case MENU_VISUAL_MODE:
+ case MENU_OP_PENDING_MODE:
+ case MENU_CMDLINE_MODE:
+ c = Ctrl_C;
+ break;
+ case MENU_INSERT_MODE:
+ c = Ctrl_O;
+ break;
+ }
+ }
+
+ if (c)
+ {
+ menu->strings[i] = alloc((unsigned)(STRLEN(call_data) + 4));
+ if (menu->strings[i] != NULL)
+ {
+ menu->strings[i][0] = c;
+ STRCPY(menu->strings[i] + 1, call_data);
+ if (c == Ctrl_C)
+ {
+ int len = STRLEN(menu->strings[i]);
+
+ /* Append CTRL-\ CTRL-G to obey 'insertmode'. */
+ menu->strings[i][len] = Ctrl_BSL;
+ menu->strings[i][len + 1] = Ctrl_G;
+ menu->strings[i][len + 2] = NUL;
+ }
+ }
+ }
+ else
+ menu->strings[i] = p;
+ menu->noremap[i] = menuarg->noremap[0];
+ menu->silent[i] = menuarg->silent[0];
+ }
+ }
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
+ && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
+ /* Need to update the menu tip. */
+ if (modes & MENU_TIP_MODE)
+ gui_mch_menu_set_tip(menu);
+#endif
+ }
+ return OK;
+
+erret:
+ vim_free(path_name);
+ vim_free(dname);
+ return FAIL;
+}
+
+/*
+ * Set the (sub)menu with the given name to enabled or disabled.
+ * Called recursively.
+ */
+ static int
+menu_nable_recurse(menu, name, modes, enable)
+ vimmenu_T *menu;
+ char_u *name;
+ int modes;
+ int enable;
+{
+ char_u *p;
+
+ if (menu == NULL)
+ return OK; /* Got to bottom of hierarchy */
+
+ /* Get name of this element in the menu hierarchy */
+ p = menu_name_skip(name);
+
+ /* Find the menu */
+ while (menu != NULL)
+ {
+ if (*name == NUL || *name == '*' || menu_name_equal(name, menu))
+ {
+ if (*p != NUL)
+ {
+ if (menu->children == NULL)
+ {
+ EMSG(_(e_notsubmenu));
+ return FAIL;
+ }
+ if (menu_nable_recurse(menu->children, p, modes, enable)
+ == FAIL)
+ return FAIL;
+ }
+ else
+ if (enable)
+ menu->enabled |= modes;
+ else
+ menu->enabled &= ~modes;
+
+ /*
+ * When name is empty, we are doing all menu items for the given
+ * modes, so keep looping, otherwise we are just doing the named
+ * menu item (which has been found) so break here.
+ */
+ if (*name != NUL && *name != '*')
+ break;
+ }
+ menu = menu->next;
+ }
+ if (*name != NUL && *name != '*' && menu == NULL)
+ {
+ EMSG(_(e_nomenu));
+ return FAIL;
+ }
+
+#ifdef FEAT_GUI
+ /* Want to update menus now even if mode not changed */
+ force_menu_update = TRUE;
+#endif
+
+ return OK;
+}
+
+/*
+ * Remove the (sub)menu with the given name from the menu hierarchy
+ * Called recursively.
+ */
+ static int
+remove_menu(menup, name, modes, silent)
+ vimmenu_T **menup;
+ char_u *name;
+ int modes;
+ int silent; /* don't give error messages */
+{
+ vimmenu_T *menu;
+ vimmenu_T *child;
+ char_u *p;
+
+ if (*menup == NULL)
+ return OK; /* Got to bottom of hierarchy */
+
+ /* Get name of this element in the menu hierarchy */
+ p = menu_name_skip(name);
+
+ /* Find the menu */
+ while ((menu = *menup) != NULL)
+ {
+ if (*name == NUL || menu_name_equal(name, menu))
+ {
+ if (*p != NUL && menu->children == NULL)
+ {
+ if (!silent)
+ EMSG(_(e_notsubmenu));
+ return FAIL;
+ }
+ if ((menu->modes & modes) != 0x0)
+ {
+#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+ /*
+ * If we are removing all entries for this menu,MENU_ALL_MODES,
+ * Then kill any tearoff before we start
+ */
+ if (*p == NUL && modes == MENU_ALL_MODES)
+ {
+ if (IsWindow(menu->tearoff_handle))
+ DestroyWindow(menu->tearoff_handle);
+ }
+#endif
+ if (remove_menu(&menu->children, p, modes, silent) == FAIL)
+ return FAIL;
+ }
+ else if (*name != NUL)
+ {
+ if (!silent)
+ EMSG(_(e_othermode));
+ return FAIL;
+ }
+
+ /*
+ * When name is empty, we are removing all menu items for the given
+ * modes, so keep looping, otherwise we are just removing the named
+ * menu item (which has been found) so break here.
+ */
+ if (*name != NUL)
+ break;
+
+ /* Remove the menu item for the given mode[s]. If the menu item
+ * is no longer valid in ANY mode, delete it */
+ menu->modes &= ~modes;
+ if (modes & MENU_TIP_MODE)
+ free_menu_string(menu, MENU_INDEX_TIP);
+ if ((menu->modes & MENU_ALL_MODES) == 0)
+ free_menu(menup);
+ else
+ menup = &menu->next;
+ }
+ else
+ menup = &menu->next;
+ }
+ if (*name != NUL)
+ {
+ if (menu == NULL)
+ {
+ if (!silent)
+ EMSG(_(e_nomenu));
+ return FAIL;
+ }
+
+
+ /* Recalculate modes for menu based on the new updated children */
+ menu->modes &= ~modes;
+#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+ if ((s_tearoffs) && (menu->children != NULL)) /* there's a tear bar.. */
+ child = menu->children->next; /* don't count tearoff bar */
+ else
+#endif
+ child = menu->children;
+ for ( ; child != NULL; child = child->next)
+ menu->modes |= child->modes;
+ if (modes & MENU_TIP_MODE)
+ {
+ free_menu_string(menu, MENU_INDEX_TIP);
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) \
+ && (defined(FEAT_BEVAL) || defined(FEAT_GUI_GTK))
+ /* Need to update the menu tip. */
+ if (gui.in_use)
+ gui_mch_menu_set_tip(menu);
+#endif
+ }
+ if ((menu->modes & MENU_ALL_MODES) == 0)
+ {
+ /* The menu item is no longer valid in ANY mode, so delete it */
+#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF)
+ if (s_tearoffs && menu->children != NULL) /* there's a tear bar.. */
+ free_menu(&menu->children);
+#endif
+ *menup = menu;
+ free_menu(menup);
+ }
+ }
+
+ return OK;
+}
+
+/*
+ * Free the given menu structure and remove it from the linked list.
+ */
+ static void
+free_menu(menup)
+ vimmenu_T **menup;
+{
+ int i;
+ vimmenu_T *menu;
+
+ menu = *menup;
+
+#ifdef FEAT_GUI
+ /* Free machine specific menu structures (only when already created) */
+ /* Also may rebuild a tearoff'ed menu */
+ if (gui.in_use)
+ gui_mch_destroy_menu(menu);
+#endif
+
+ /* Don't change *menup until after calling gui_mch_destroy_menu(). The
+ * MacOS code needs the original structure to properly delete the menu. */
+ *menup = menu->next;
+ vim_free(menu->name);
+ vim_free(menu->dname);
+ vim_free(menu->actext);
+#ifdef FEAT_TOOLBAR
+ vim_free(menu->iconfile);
+#endif
+ for (i = 0; i < MENU_MODES; i++)
+ free_menu_string(menu, i);
+ vim_free(menu);
+
+#ifdef FEAT_GUI
+ /* Want to update menus now even if mode not changed */
+ force_menu_update = TRUE;
+#endif
+}
+
+/*
+ * Free the menu->string with the given index.
+ */
+ static void
+free_menu_string(menu, idx)
+ vimmenu_T *menu;
+ int idx;
+{
+ int count = 0;
+ int i;
+
+ for (i = 0; i < MENU_MODES; i++)
+ if (menu->strings[i] == menu->strings[idx])
+ count++;
+ if (count == 1)
+ vim_free(menu->strings[idx]);
+ menu->strings[idx] = NULL;
+}
+
+/*
+ * Show the mapping associated with a menu item or hierarchy in a sub-menu.
+ */
+ static int
+show_menus(path_name, modes)
+ char_u *path_name;
+ int modes;
+{
+ char_u *p;
+ char_u *name;
+ vimmenu_T *menu;
+ vimmenu_T *parent = NULL;
+
+ menu = root_menu;
+ name = path_name = vim_strsave(path_name);
+ if (path_name == NULL)
+ return FAIL;
+
+ /* First, find the (sub)menu with the given name */
+ while (*name)
+ {
+ p = menu_name_skip(name);
+ while (menu != NULL)
+ {
+ if (menu_name_equal(name, menu))
+ {
+ /* Found menu */
+ if (*p != NUL && menu->children == NULL)
+ {
+ EMSG(_(e_notsubmenu));
+ vim_free(path_name);
+ return FAIL;
+ }
+ else if ((menu->modes & modes) == 0x0)
+ {
+ EMSG(_(e_othermode));
+ vim_free(path_name);
+ return FAIL;
+ }
+ break;
+ }
+ menu = menu->next;
+ }
+ if (menu == NULL)
+ {
+ EMSG(_(e_nomenu));
+ vim_free(path_name);
+ return FAIL;
+ }
+ name = p;
+ parent = menu;
+ menu = menu->children;
+ }
+
+ /* Now we have found the matching menu, and we list the mappings */
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n--- Menus ---"));
+
+ show_menus_recursive(parent, modes, 0);
+ return OK;
+}
+
+/*
+ * Recursively show the mappings associated with the menus under the given one
+ */
+ static void
+show_menus_recursive(menu, modes, depth)
+ vimmenu_T *menu;
+ int modes;
+ int depth;
+{
+ int i;
+ int bit;
+
+ if (menu != NULL && (menu->modes & modes) == 0x0)
+ return;
+
+ if (menu != NULL)
+ {
+ msg_putchar('\n');
+ if (got_int) /* "q" hit for "--more--" */
+ return;
+ for (i = 0; i < depth; i++)
+ MSG_PUTS(" ");
+ if (menu->priority)
+ {
+ msg_outnum((long)menu->priority);
+ MSG_PUTS(" ");
+ }
+ /* Same highlighting as for directories!? */
+ msg_outtrans_attr(menu->name, hl_attr(HLF_D));
+ }
+
+ if (menu != NULL && menu->children == NULL)
+ {
+ for (bit = 0; bit < MENU_MODES; bit++)
+ if ((menu->modes & modes & (1 << bit)) != 0)
+ {
+ msg_putchar('\n');
+ if (got_int) /* "q" hit for "--more--" */
+ return;
+ for (i = 0; i < depth + 2; i++)
+ MSG_PUTS(" ");
+ msg_putchar(menu_mode_chars[bit]);
+ if (menu->noremap[bit] == REMAP_NONE)
+ msg_putchar('*');
+ else if (menu->noremap[bit] == REMAP_SCRIPT)
+ msg_putchar('&');
+ else
+ msg_putchar(' ');
+ if (menu->silent[bit])
+ msg_putchar('s');
+ else
+ msg_putchar(' ');
+ if ((menu->modes & menu->enabled & (1 << bit)) == 0)
+ msg_putchar('-');
+ else
+ msg_putchar(' ');
+ MSG_PUTS(" ");
+ if (*menu->strings[bit] == NUL)
+ msg_puts_attr((char_u *)"<Nop>", hl_attr(HLF_8));
+ else
+ msg_outtrans_special(menu->strings[bit], FALSE);
+ }
+ }
+ else
+ {
+ if (menu == NULL)
+ {
+ menu = root_menu;
+ depth--;
+ }
+ else
+ menu = menu->children;
+
+ /* recursively show all children. Skip PopUp[nvoci]. */
+ for (; menu != NULL && !got_int; menu = menu->next)
+ if (!menu_is_hidden(menu->dname))
+ show_menus_recursive(menu, modes, depth + 1);
+ }
+}
+
+#ifdef FEAT_CMDL_COMPL
+
+/*
+ * Used when expanding menu names.
+ */
+static vimmenu_T *expand_menu = NULL;
+static int expand_modes = 0x0;
+static int expand_emenu; /* TRUE for ":emenu" command */
+
+/*
+ * Work out what to complete when doing command line completion of menu names.
+ */
+ char_u *
+set_context_in_menu_cmd(xp, cmd, arg, forceit)
+ expand_T *xp;
+ char_u *cmd;
+ char_u *arg;
+ int forceit;
+{
+ char_u *after_dot;
+ char_u *p;
+ char_u *path_name = NULL;
+ char_u *name;
+ int unmenu;
+ vimmenu_T *menu;
+ int expand_menus;
+
+ xp->xp_context = EXPAND_UNSUCCESSFUL;
+
+
+ /* Check for priority numbers, enable and disable */
+ for (p = arg; *p; ++p)
+ if (!VIM_ISDIGIT(*p) && *p != '.')
+ break;
+
+ if (!vim_iswhite(*p))
+ {
+ if (STRNCMP(arg, "enable", 6) == 0
+ && (arg[6] == NUL || vim_iswhite(arg[6])))
+ p = arg + 6;
+ else if (STRNCMP(arg, "disable", 7) == 0
+ && (arg[7] == NUL || vim_iswhite(arg[7])))
+ p = arg + 7;
+ else
+ p = arg;
+ }
+
+ while (*p != NUL && vim_iswhite(*p))
+ ++p;
+
+ arg = after_dot = p;
+
+ for (; *p && !vim_iswhite(*p); ++p)
+ {
+ if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL)
+ p++;
+ else if (*p == '.')
+ after_dot = p + 1;
+ }
+
+ /* ":tearoff" and ":popup" only use menus, not entries */
+ expand_menus = !((*cmd == 't' && cmd[1] == 'e') || *cmd == 'p');
+ expand_emenu = (*cmd == 'e');
+ if (expand_menus && vim_iswhite(*p))
+ return NULL; /* TODO: check for next command? */
+ if (*p == NUL) /* Complete the menu name */
+ {
+ /*
+ * With :unmenu, you only want to match menus for the appropriate mode.
+ * With :menu though you might want to add a menu with the same name as
+ * one in another mode, so match menus from other modes too.
+ */
+ expand_modes = get_menu_cmd_modes(cmd, forceit, NULL, &unmenu);
+ if (!unmenu)
+ expand_modes = MENU_ALL_MODES;
+
+ menu = root_menu;
+ if (after_dot != arg)
+ {
+ path_name = alloc((unsigned)(after_dot - arg));
+ if (path_name == NULL)
+ return NULL;
+ STRNCPY(path_name, arg, after_dot - arg - 1);
+ path_name[after_dot - arg - 1] = NUL;
+ }
+ name = path_name;
+ while (name != NULL && *name)
+ {
+ p = menu_name_skip(name);
+ while (menu != NULL)
+ {
+ if (menu_name_equal(name, menu))
+ {
+ /* Found menu */
+ if ((*p != NUL && menu->children == NULL)
+ || ((menu->modes & expand_modes) == 0x0))
+ {
+ /*
+ * Menu path continues, but we have reached a leaf.
+ * Or menu exists only in another mode.
+ */
+ vim_free(path_name);
+ return NULL;
+ }
+ break;
+ }
+ menu = menu->next;
+ }
+ if (menu == NULL)
+ {
+ /* No menu found with the name we were looking for */
+ vim_free(path_name);
+ return NULL;
+ }
+ name = p;
+ menu = menu->children;
+ }
+
+ xp->xp_context = expand_menus ? EXPAND_MENUNAMES : EXPAND_MENUS;
+ xp->xp_pattern = after_dot;
+ expand_menu = menu;
+ }
+ else /* We're in the mapping part */
+ xp->xp_context = EXPAND_NOTHING;
+ return NULL;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of (sub)menus (not
+ * entries).
+ */
+/*ARGSUSED*/
+ char_u *
+get_menu_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static vimmenu_T *menu = NULL;
+ char_u *str;
+
+ if (idx == 0) /* first call: start at first item */
+ menu = expand_menu;
+
+ /* Skip PopUp[nvoci]. */
+ while (menu != NULL && (menu_is_hidden(menu->dname)
+ || menu_is_separator(menu->dname)
+ || menu_is_tearoff(menu->dname)
+ || menu->children == NULL))
+ menu = menu->next;
+
+ if (menu == NULL) /* at end of linked list */
+ return NULL;
+
+ if (menu->modes & expand_modes)
+ str = menu->dname;
+ else
+ str = (char_u *)"";
+
+ /* Advance to next menu entry. */
+ menu = menu->next;
+
+ return str;
+}
+
+/*
+ * Function given to ExpandGeneric() to obtain the list of menus and menu
+ * entries.
+ */
+/*ARGSUSED*/
+ char_u *
+get_menu_names(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ static vimmenu_T *menu = NULL;
+ static char_u tbuffer[256]; /*hack*/
+ char_u *str;
+
+ if (idx == 0) /* first call: start at first item */
+ menu = expand_menu;
+
+ /* Skip Browse-style entries, popup menus and separators. */
+ while (menu != NULL
+ && ( menu_is_hidden(menu->dname)
+ || (expand_emenu && menu_is_separator(menu->dname))
+ || menu_is_tearoff(menu->dname)
+#ifndef FEAT_BROWSE
+ || menu->dname[STRLEN(menu->dname) - 1] == '.'
+#endif
+ ))
+ menu = menu->next;
+
+ if (menu == NULL) /* at end of linked list */
+ return NULL;
+
+ if (menu->modes & expand_modes)
+ {
+ if (menu->children != NULL)
+ {
+ STRCPY(tbuffer, menu->dname);
+ /* hack on menu separators: use a 'magic' char for the separator
+ * so that '.' in names gets escaped properly */
+ STRCAT(tbuffer, "\001");
+ str = tbuffer;
+ }
+ else
+ str = menu->dname;
+ }
+ else
+ str = (char_u *)"";
+
+ /* Advance to next menu entry. */
+ menu = menu->next;
+
+ return str;
+}
+#endif /* FEAT_CMDL_COMPL */
+
+/*
+ * Skip over this element of the menu path and return the start of the next
+ * element. Any \ and ^Vs are removed from the current element.
+ */
+ char_u *
+menu_name_skip(name)
+ char_u *name;
+{
+ char_u *p;
+
+ for (p = name; *p && *p != '.'; p++)
+ {
+ if (*p == '\\' || *p == Ctrl_V)
+ {
+ mch_memmove(p, p + 1, STRLEN(p));
+ if (*p == NUL)
+ break;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1; /* skip multibyte char */
+#endif
+ }
+ if (*p)
+ *p++ = NUL;
+ return p;
+}
+
+/*
+ * Return TRUE when "name" matches with menu "menu". The name is compared in
+ * two ways: raw menu name and menu name without '&'. ignore part after a TAB.
+ */
+ static int
+menu_name_equal(name, menu)
+ char_u *name;
+ vimmenu_T *menu;
+{
+ return (menu_namecmp(name, menu->name) || menu_namecmp(name, menu->dname));
+}
+
+ static int
+menu_namecmp(name, mname)
+ char_u *name;
+ char_u *mname;
+{
+ int i;
+
+ for (i = 0; name[i] != NUL && name[i] != TAB; ++i)
+ if (name[i] != mname[i])
+ break;
+ return ((name[i] == NUL || name[i] == TAB)
+ && (mname[i] == NUL || mname[i] == TAB));
+}
+
+/*
+ * Return the modes specified by the given menu command (eg :menu! returns
+ * MENU_CMDLINE_MODE | MENU_INSERT_MODE).
+ * If "noremap" is not NULL, then the flag it points to is set according to
+ * whether the command is a "nore" command.
+ * If "unmenu" is not NULL, then the flag it points to is set according to
+ * whether the command is an "unmenu" command.
+ */
+ static int
+get_menu_cmd_modes(cmd, forceit, noremap, unmenu)
+ char_u *cmd;
+ int forceit; /* Was there a "!" after the command? */
+ int *noremap;
+ int *unmenu;
+{
+ int modes;
+
+ switch (*cmd++)
+ {
+ case 'v': /* vmenu, vunmenu, vnoremenu */
+ modes = MENU_VISUAL_MODE;
+ break;
+ case 'o': /* omenu */
+ modes = MENU_OP_PENDING_MODE;
+ break;
+ case 'i': /* imenu */
+ modes = MENU_INSERT_MODE;
+ break;
+ case 't':
+ modes = MENU_TIP_MODE; /* tmenu */
+ break;
+ case 'c': /* cmenu */
+ modes = MENU_CMDLINE_MODE;
+ break;
+ case 'a': /* amenu */
+ modes = MENU_INSERT_MODE | MENU_CMDLINE_MODE | MENU_NORMAL_MODE
+ | MENU_VISUAL_MODE | MENU_OP_PENDING_MODE;
+ break;
+ case 'n':
+ if (*cmd != 'o') /* nmenu, not noremenu */
+ {
+ modes = MENU_NORMAL_MODE;
+ break;
+ }
+ /* FALLTHROUGH */
+ default:
+ --cmd;
+ if (forceit) /* menu!! */
+ modes = MENU_INSERT_MODE | MENU_CMDLINE_MODE;
+ else /* menu */
+ modes = MENU_NORMAL_MODE | MENU_VISUAL_MODE
+ | MENU_OP_PENDING_MODE;
+ }
+
+ if (noremap != NULL)
+ *noremap = (*cmd == 'n' ? REMAP_NONE : REMAP_YES);
+ if (unmenu != NULL)
+ *unmenu = (*cmd == 'u');
+ return modes;
+}
+
+/*
+ * Modify a menu name starting with "PopUp" to include the mode character.
+ * Returns the name in allocated memory (NULL for failure).
+ */
+ static char_u *
+popup_mode_name(name, idx)
+ char_u *name;
+ int idx;
+{
+ char_u *p;
+ int len = (int)STRLEN(name);
+
+ p = vim_strnsave(name, len + 1);
+ if (p != NULL)
+ {
+ mch_memmove(p + 6, p + 5, (size_t)(len - 4));
+ p[5] = menu_mode_chars[idx];
+ }
+ return p;
+}
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Return the index into the menu->strings or menu->noremap arrays for the
+ * current state. Returns MENU_INDEX_INVALID if there is no mapping for the
+ * given menu in the current mode.
+ */
+ int
+get_menu_index(menu, state)
+ vimmenu_T *menu;
+ int state;
+{
+ int idx;
+
+ if ((state & INSERT))
+ idx = MENU_INDEX_INSERT;
+ else if (state & CMDLINE)
+ idx = MENU_INDEX_CMDLINE;
+#ifdef FEAT_VISUAL
+ else if (VIsual_active)
+ idx = MENU_INDEX_VISUAL;
+#endif
+ else if (state == HITRETURN || state == ASKMORE)
+ idx = MENU_INDEX_CMDLINE;
+ else if (finish_op)
+ idx = MENU_INDEX_OP_PENDING;
+ else if ((state & NORMAL))
+ idx = MENU_INDEX_NORMAL;
+ else
+ idx = MENU_INDEX_INVALID;
+
+ if (idx != MENU_INDEX_INVALID && menu->strings[idx] == NULL)
+ idx = MENU_INDEX_INVALID;
+ return idx;
+}
+#endif
+
+/*
+ * Duplicate the menu item text and then process to see if a mnemonic key
+ * and/or accelerator text has been identified.
+ * Returns a pointer to allocated memory, or NULL for failure.
+ * If mnemonic != NULL, *mnemonic is set to the character after the first '&'.
+ * If actext != NULL, *actext is set to the text after the first TAB.
+ */
+ static char_u *
+menu_text(str, mnemonic, actext)
+ char_u *str;
+ int *mnemonic;
+ char_u **actext;
+{
+ char_u *p;
+ char_u *text;
+
+ /* Locate accelerator text, after the first TAB */
+ p = vim_strchr(str, TAB);
+ if (p != NULL)
+ {
+ if (actext != NULL)
+ *actext = vim_strsave(p + 1);
+ text = vim_strnsave(str, (int)(p - str));
+ }
+ else
+ text = vim_strsave(str);
+
+ /* Find mnemonic characters "&a" and reduce "&&" to "&". */
+ for (p = text; p != NULL; )
+ {
+ p = vim_strchr(p, '&');
+ if (p != NULL)
+ {
+ if (p[1] == NUL) /* trailing "&" */
+ break;
+ if (mnemonic != NULL && p[1] != '&')
+#if !defined(__MVS__) || defined(MOTIF390_MNEMONIC_FIXED)
+ *mnemonic = p[1];
+#else
+ {
+ /*
+ * Well there is a bug in the Motif libraries on OS390 Unix.
+ * The mnemonic keys needs to be converted to ASCII values
+ * first.
+ * This behavior has been seen in 2.8 and 2.9.
+ */
+ char c = p[1];
+ __etoa_l(&c, 1);
+ *mnemonic = c;
+ }
+#endif
+ mch_memmove(p, p + 1, STRLEN(p));
+ p = p + 1;
+ }
+ }
+ return text;
+}
+
+/*
+ * Return TRUE if "name" can be a menu in the MenuBar.
+ */
+ int
+menu_is_menubar(name)
+ char_u *name;
+{
+ return (!menu_is_popup(name)
+ && !menu_is_toolbar(name)
+ && *name != MNU_HIDDEN_CHAR);
+}
+
+/*
+ * Return TRUE if "name" is a popup menu name.
+ */
+ int
+menu_is_popup(name)
+ char_u *name;
+{
+ return (STRNCMP(name, "PopUp", 5) == 0);
+}
+
+#if (defined(FEAT_GUI_MOTIF) && (XmVersion <= 1002)) || defined(PROTO)
+/*
+ * Return TRUE if "name" is part of a popup menu.
+ */
+ int
+menu_is_child_of_popup(menu)
+ vimmenu_T *menu;
+{
+ while (menu->parent != NULL)
+ menu = menu->parent;
+ return menu_is_popup(menu->name);
+}
+#endif
+
+/*
+ * Return TRUE if "name" is a toolbar menu name.
+ */
+ int
+menu_is_toolbar(name)
+ char_u *name;
+{
+ return (STRNCMP(name, "ToolBar", 7) == 0);
+}
+
+/*
+ * Return TRUE if the name is a menu separator identifier: Starts and ends
+ * with '-'
+ */
+ int
+menu_is_separator(name)
+ char_u *name;
+{
+ return (name[0] == '-' && name[STRLEN(name) - 1] == '-');
+}
+
+/*
+ * Return TRUE if the menu is hidden: Starts with ']'
+ */
+ static int
+menu_is_hidden(name)
+ char_u *name;
+{
+ return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL);
+}
+
+#if defined(FEAT_CMDL_COMPL) \
+ || (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF))
+/*
+ * Return TRUE if the menu is the tearoff menu.
+ */
+/*ARGSUSED*/
+ static int
+menu_is_tearoff(name)
+ char_u *name;
+{
+#ifdef FEAT_GUI
+ return (STRCMP(name, TEAR_STRING) == 0);
+#else
+ return FALSE;
+#endif
+}
+#endif
+
+#ifdef FEAT_GUI
+
+ static int
+get_menu_mode()
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ return MENU_INDEX_VISUAL;
+#endif
+ if (State & INSERT)
+ return MENU_INDEX_INSERT;
+ if ((State & CMDLINE) || State == ASKMORE || State == HITRETURN)
+ return MENU_INDEX_CMDLINE;
+ if (finish_op)
+ return MENU_INDEX_OP_PENDING;
+ if (State & NORMAL)
+ return MENU_INDEX_NORMAL;
+ if (State & LANGMAP) /* must be a "r" command, like Insert mode */
+ return MENU_INDEX_INSERT;
+ return MENU_INDEX_INVALID;
+}
+
+/*
+ * After we have started the GUI, then we can create any menus that have been
+ * defined. This is done once here. add_menu_path() may have already been
+ * called to define these menus, and may be called again. This function calls
+ * itself recursively. Should be called at the top level with:
+ * gui_create_initial_menus(root_menu, NULL);
+ */
+ void
+gui_create_initial_menus(menu)
+ vimmenu_T *menu;
+{
+ int idx = 0;
+
+ while (menu != NULL)
+ {
+ /* Don't add a menu when only a tip was defined. */
+ if (menu->modes & MENU_ALL_MODES)
+ {
+ if (menu->children != NULL)
+ {
+ gui_mch_add_menu(menu, idx);
+ gui_create_initial_menus(menu->children);
+ }
+ else
+ gui_mch_add_menu_item(menu, idx);
+ }
+ menu = menu->next;
+ ++idx;
+ }
+}
+
+/*
+ * Used recursively by gui_update_menus (see below)
+ */
+ static void
+gui_update_menus_recurse(menu, mode)
+ vimmenu_T *menu;
+ int mode;
+{
+ int grey;
+
+ while (menu)
+ {
+ if ((menu->modes & menu->enabled & mode)
+#if defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)
+ || menu_is_tearoff(menu->dname)
+#endif
+ )
+ grey = FALSE;
+ else
+ grey = TRUE;
+#ifdef FEAT_GUI_ATHENA
+ /* Hiding menus doesn't work for Athena, it can cause a crash. */
+ gui_mch_menu_grey(menu, grey);
+#else
+ /* Never hide a toplevel menu, it may make the menubar resize or
+ * disappear. Same problem for ToolBar items. */
+ if (vim_strchr(p_go, GO_GREY) != NULL || menu->parent == NULL
+# ifdef FEAT_TOOLBAR
+ || menu_is_toolbar(menu->parent->name)
+# endif
+ )
+ gui_mch_menu_grey(menu, grey);
+ else
+ gui_mch_menu_hidden(menu, grey);
+#endif
+ gui_update_menus_recurse(menu->children, mode);
+ menu = menu->next;
+ }
+}
+
+/*
+ * Make sure only the valid menu items appear for this mode. If
+ * force_menu_update is not TRUE, then we only do this if the mode has changed
+ * since last time. If "modes" is not 0, then we use these modes instead.
+ */
+ void
+gui_update_menus(modes)
+ int modes;
+{
+ static int prev_mode = -1;
+ int mode = 0;
+
+ if (modes != 0x0)
+ mode = modes;
+ else
+ {
+ mode = get_menu_mode();
+ if (mode == MENU_INDEX_INVALID)
+ mode = 0;
+ else
+ mode = (1 << mode);
+ }
+
+ if (force_menu_update || mode != prev_mode)
+ {
+ gui_update_menus_recurse(root_menu, mode);
+ gui_mch_draw_menubar();
+ prev_mode = mode;
+ force_menu_update = FALSE;
+#ifdef FEAT_GUI_W32
+ /* This can leave a tearoff as active window - make sure we
+ * have the focus <negri>*/
+ gui_mch_activate_window();
+#endif
+ }
+}
+
+#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_PHOTON) || defined(PROTO)
+/*
+ * Check if a key is used as a mnemonic for a toplevel menu.
+ * Case of the key is ignored.
+ */
+ int
+gui_is_menu_shortcut(key)
+ int key;
+{
+ vimmenu_T *menu;
+
+ if (key < 256)
+ key = TOLOWER_LOC(key);
+ for (menu = root_menu; menu != NULL; menu = menu->next)
+ if (menu->mnemonic == key
+ || (menu->mnemonic < 256 && TOLOWER_LOC(menu->mnemonic) == key))
+ return TRUE;
+ return FALSE;
+}
+#endif
+
+/*
+ * Display the Special "PopUp" menu as a pop-up at the current mouse
+ * position. The "PopUpn" menu is for Normal mode, "PopUpi" for Insert mode,
+ * etc.
+ */
+ void
+gui_show_popupmenu()
+{
+ vimmenu_T *menu;
+ int mode;
+
+ mode = get_menu_mode();
+ if (mode == MENU_INDEX_INVALID)
+ return;
+ mode = menu_mode_chars[mode];
+
+ for (menu = root_menu; menu != NULL; menu = menu->next)
+ if (STRNCMP("PopUp", menu->name, 5) == 0 && menu->name[5] == mode)
+ break;
+
+ /* Only show a popup when it is defined and has entries */
+ if (menu != NULL && menu->children != NULL)
+ gui_mch_show_popupmenu(menu);
+}
+#endif /* FEAT_GUI */
+
+#if (defined(FEAT_GUI_W32) && defined(FEAT_TEAROFF)) || defined(PROTO)
+
+/*
+ * Deal with tearoff items that are added like a menu item.
+ * Currently only for Win32 GUI. Others may follow later.
+ */
+
+ void
+gui_mch_toggle_tearoffs(int enable)
+{
+ int pri_tab[MENUDEPTH + 1];
+ int i;
+
+ if (enable)
+ {
+ for (i = 0; i < MENUDEPTH; ++i)
+ pri_tab[i] = 500;
+ pri_tab[MENUDEPTH] = -1;
+ gui_create_tearoffs_recurse(root_menu, (char_u *)"", pri_tab, 0);
+ }
+ else
+ gui_destroy_tearoffs_recurse(root_menu);
+ s_tearoffs = enable;
+}
+
+/*
+ * Recursively add tearoff items
+ */
+ static void
+gui_create_tearoffs_recurse(menu, pname, pri_tab, pri_idx)
+ vimmenu_T *menu;
+ const char_u *pname;
+ int *pri_tab;
+ int pri_idx;
+{
+ char_u *newpname = NULL;
+ int len;
+ char_u *s;
+ char_u *d;
+
+ if (pri_tab[pri_idx + 1] != -1)
+ ++pri_idx;
+ while (menu != NULL)
+ {
+ if (menu->children != NULL && menu_is_menubar(menu->name))
+ {
+ /* Add the menu name to the menu path. Insert a backslash before
+ * dots (it's used to separate menu names). */
+ len = (int)STRLEN(pname) + (int)STRLEN(menu->name);
+ for (s = menu->name; *s; ++s)
+ if (*s == '.' || *s == '\\')
+ ++len;
+ newpname = alloc(len + TEAR_LEN + 2);
+ if (newpname != NULL)
+ {
+ STRCPY(newpname, pname);
+ d = newpname + STRLEN(newpname);
+ for (s = menu->name; *s; ++s)
+ {
+ if (*s == '.' || *s == '\\')
+ *d++ = '\\';
+ *d++ = *s;
+ }
+ *d = NUL;
+
+ /* check if tearoff already exists */
+ if (STRCMP(menu->children->name, TEAR_STRING) != 0)
+ {
+ gui_add_tearoff(newpname, pri_tab, pri_idx - 1);
+ *d = NUL; /* remove TEAR_STRING */
+ }
+
+ STRCAT(newpname, ".");
+ gui_create_tearoffs_recurse(menu->children, newpname,
+ pri_tab, pri_idx);
+ vim_free(newpname);
+ }
+ }
+ menu = menu->next;
+ }
+}
+
+/*
+ * Add tear-off menu item for a submenu.
+ * "tearpath" is the menu path, and must have room to add TEAR_STRING.
+ */
+ static void
+gui_add_tearoff(tearpath, pri_tab, pri_idx)
+ char_u *tearpath;
+ int *pri_tab;
+ int pri_idx;
+{
+ char_u *tbuf;
+ int t;
+ vimmenu_T menuarg;
+
+ tbuf = alloc(5 + (unsigned int)STRLEN(tearpath));
+ if (tbuf != NULL)
+ {
+ tbuf[0] = K_SPECIAL;
+ tbuf[1] = K_SECOND(K_TEAROFF);
+ tbuf[2] = K_THIRD(K_TEAROFF);
+ STRCPY(tbuf + 3, tearpath);
+ STRCAT(tbuf + 3, "\r");
+
+ STRCAT(tearpath, ".");
+ STRCAT(tearpath, TEAR_STRING);
+
+ /* Priority of tear-off is always 1 */
+ t = pri_tab[pri_idx + 1];
+ pri_tab[pri_idx + 1] = 1;
+
+#ifdef FEAT_TOOLBAR
+ menuarg.iconfile = NULL;
+ menuarg.iconidx = -1;
+ menuarg.icon_builtin = FALSE;
+#endif
+ menuarg.noremap[0] = REMAP_NONE;
+ menuarg.silent[0] = TRUE;
+
+ menuarg.modes = MENU_ALL_MODES;
+ add_menu_path(tearpath, &menuarg, pri_tab, tbuf, FALSE);
+
+ menuarg.modes = MENU_TIP_MODE;
+ add_menu_path(tearpath, &menuarg, pri_tab,
+ (char_u *)_("Tear off this menu"), FALSE);
+
+ pri_tab[pri_idx + 1] = t;
+ vim_free(tbuf);
+ }
+}
+
+/*
+ * Recursively destroy tearoff items
+ */
+ static void
+gui_destroy_tearoffs_recurse(menu)
+ vimmenu_T *menu;
+{
+ while (menu)
+ {
+ if (menu->children)
+ {
+ /* check if tearoff exists */
+ if (STRCMP(menu->children->name, TEAR_STRING) == 0)
+ {
+ /* Disconnect the item and free the memory */
+ free_menu(&menu->children);
+ }
+ if (menu->children != NULL) /* if not the last one */
+ gui_destroy_tearoffs_recurse(menu->children);
+ }
+ menu = menu->next;
+ }
+}
+
+#endif /* FEAT_GUI_W32 && FEAT_TEAROFF */
+
+/*
+ * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and
+ * execute it.
+ */
+ void
+ex_emenu(eap)
+ exarg_T *eap;
+{
+ vimmenu_T *menu;
+ char_u *name;
+ char_u *saved_name;
+ char_u *p;
+ int idx;
+ char_u *mode;
+
+ saved_name = vim_strsave(eap->arg);
+ if (saved_name == NULL)
+ return;
+
+ menu = root_menu;
+ name = saved_name;
+ while (*name)
+ {
+ /* Find in the menu hierarchy */
+ p = menu_name_skip(name);
+
+ while (menu != NULL)
+ {
+ if (menu_name_equal(name, menu))
+ {
+ if (*p == NUL && menu->children != NULL)
+ {
+ EMSG(_("E333: Menu path must lead to a menu item"));
+ menu = NULL;
+ }
+ else if (*p != NUL && menu->children == NULL)
+ {
+ EMSG(_(e_notsubmenu));
+ menu = NULL;
+ }
+ break;
+ }
+ menu = menu->next;
+ }
+ if (menu == NULL || *p == NUL)
+ break;
+ menu = menu->children;
+ name = p;
+ }
+ vim_free(saved_name);
+ if (menu == NULL)
+ {
+ EMSG2(_("E334: Menu not found: %s"), eap->arg);
+ return;
+ }
+
+ /* Found the menu, so execute. */
+ if (restart_edit)
+ {
+ mode = (char_u *)"Insert";
+ idx = MENU_INDEX_INSERT;
+ }
+ else if (eap->addr_count)
+ {
+ pos_T tpos;
+
+ mode = (char_u *)"Visual";
+ idx = MENU_INDEX_VISUAL;
+
+ /* GEDDES: This is not perfect - but it is a
+ * quick way of detecting whether we are doing this from a
+ * selection - see if the range matches up with the visual
+ * select start and end.
+ */
+ if ((curbuf->b_visual_start.lnum == eap->line1)
+ && (curbuf->b_visual_end.lnum) == eap->line2)
+ {
+ /* Set it up for visual mode - equivalent to gv. */
+ VIsual_mode = curbuf->b_visual_mode;
+ tpos = curbuf->b_visual_end;
+ curwin->w_cursor = curbuf->b_visual_start;
+ curwin->w_curswant = curbuf->b_visual_curswant;
+ }
+ else
+ {
+ /* Set it up for line-wise visual mode */
+ VIsual_mode = 'V';
+ curwin->w_cursor.lnum = eap->line1;
+ curwin->w_cursor.col = 1;
+ tpos.lnum = eap->line2;
+ tpos.col = MAXCOL;
+ }
+
+ /* Activate visual mode
+ */
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+ check_cursor();
+ VIsual = curwin->w_cursor;
+ curwin->w_cursor = tpos;
+
+ check_cursor();
+
+ /* Adjust the cursor to make sure it is in the correct pos
+ * for exclusive mode
+ */
+ if (*p_sel == 'e' && gchar_cursor() != NUL)
+ ++curwin->w_cursor.col;
+ }
+ else
+ {
+ mode = (char_u *)"Normal";
+ idx = MENU_INDEX_NORMAL;
+ }
+
+ if (idx != MENU_INDEX_INVALID && menu->strings[idx] != NULL)
+ {
+ ins_typebuf(menu->strings[idx], menu->noremap[idx], 0,
+ TRUE, menu->silent[idx]);
+ }
+ else
+ EMSG2(_("E335: Menu not defined for %s mode"), mode);
+}
+
+#if defined(FEAT_GUI_MSWIN) \
+ || (defined(FEAT_GUI_GTK) && defined(FEAT_MENU)) \
+ || defined(FEAT_BEVAL_TIP) || defined(PROTO)
+/*
+ * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy.
+ */
+ vimmenu_T *
+gui_find_menu(path_name)
+ char_u *path_name;
+{
+ vimmenu_T *menu = NULL;
+ char_u *name;
+ char_u *saved_name;
+ char_u *p;
+
+ menu = root_menu;
+
+ saved_name = vim_strsave(path_name);
+ if (saved_name == NULL)
+ return NULL;
+
+ name = saved_name;
+ while (*name)
+ {
+ /* find the end of one dot-separated name and put a NUL at the dot */
+ p = menu_name_skip(name);
+
+ while (menu != NULL)
+ {
+ if (STRCMP(name, menu->name) == 0 || STRCMP(name, menu->dname) == 0)
+ {
+ if (menu->children == NULL)
+ {
+ /* found a menu item instead of a sub-menu */
+ if (*p == NUL)
+ EMSG(_("E336: Menu path must lead to a sub-menu"));
+ else
+ EMSG(_(e_notsubmenu));
+ menu = NULL;
+ goto theend;
+ }
+ if (*p == NUL) /* found a full match */
+ goto theend;
+ break;
+ }
+ menu = menu->next;
+ }
+ if (menu == NULL) /* didn't find it */
+ break;
+
+ /* Found a match, search the sub-menu. */
+ menu = menu->children;
+ name = p;
+ }
+
+ if (menu == NULL)
+ EMSG(_("E337: Menu not found - check menu names"));
+theend:
+ vim_free(saved_name);
+ return menu;
+}
+#endif
+
+#ifdef FEAT_MULTI_LANG
+/*
+ * Translation of menu names. Just a simple lookup table.
+ */
+
+typedef struct
+{
+ char_u *from; /* English name */
+ char_u *from_noamp; /* same, without '&' */
+ char_u *to; /* translated name */
+} menutrans_T;
+
+static garray_T menutrans_ga = {0, 0, 0, 0, NULL};
+#endif
+
+/*
+ * ":menutrans".
+ * This function is also defined without the +multi_lang feature, in which
+ * case the commands are ignored.
+ */
+/*ARGSUSED*/
+ void
+ex_menutranslate(eap)
+ exarg_T *eap;
+{
+#ifdef FEAT_MULTI_LANG
+ char_u *arg = eap->arg;
+ menutrans_T *tp;
+ int i;
+ char_u *from, *from_noamp, *to;
+
+ if (menutrans_ga.ga_itemsize == 0)
+ ga_init2(&menutrans_ga, (int)sizeof(menutrans_T), 5);
+
+ /*
+ * ":menutrans clear": clear all translations.
+ */
+ if (STRNCMP(arg, "clear", 5) == 0 && ends_excmd(*skipwhite(arg + 5)))
+ {
+ tp = (menutrans_T *)menutrans_ga.ga_data;
+ for (i = 0; i < menutrans_ga.ga_len; ++i)
+ {
+ vim_free(tp[i].from);
+ vim_free(tp[i].from_noamp);
+ vim_free(tp[i].to);
+ }
+ ga_clear(&menutrans_ga);
+# ifdef FEAT_EVAL
+ /* Delete all "menutrans_" global variables. */
+ del_menutrans_vars();
+# endif
+ }
+ else
+ {
+ /* ":menutrans from to": add translation */
+ from = arg;
+ arg = menu_skip_part(arg);
+ to = skipwhite(arg);
+ *arg = NUL;
+ arg = menu_skip_part(to);
+ if (arg == to)
+ EMSG(_(e_invarg));
+ else
+ {
+ if (ga_grow(&menutrans_ga, 1) == OK)
+ {
+ tp = (menutrans_T *)menutrans_ga.ga_data;
+ from = vim_strsave(from);
+ from_noamp = menu_text(from, NULL, NULL);
+ to = vim_strnsave(to, (int)(arg - to));
+ if (from != NULL && from_noamp != NULL && to != NULL)
+ {
+ tp[menutrans_ga.ga_len].from = from;
+ tp[menutrans_ga.ga_len].from_noamp = from_noamp;
+ tp[menutrans_ga.ga_len].to = to;
+ ++menutrans_ga.ga_len;
+ --menutrans_ga.ga_room;
+ }
+ else
+ {
+ vim_free(from);
+ vim_free(from_noamp);
+ vim_free(to);
+ }
+ }
+ }
+ }
+#endif
+}
+
+#if defined(FEAT_MULTI_LANG) || defined(FEAT_TOOLBAR)
+/*
+ * Find the character just after one part of a menu name.
+ */
+ static char_u *
+menu_skip_part(p)
+ char_u *p;
+{
+ while (*p != NUL && *p != '.' && !vim_iswhite(*p))
+ {
+ if ((*p == '\\' || *p == Ctrl_V) && p[1] != NUL)
+ ++p;
+ ++p;
+ }
+ return p;
+}
+#endif
+
+#ifdef FEAT_MULTI_LANG
+/*
+ * Lookup part of a menu name in the translations.
+ * Return a pointer to the translation or NULL if not found.
+ */
+ static char_u *
+menutrans_lookup(name, len)
+ char_u *name;
+ int len;
+{
+ menutrans_T *tp = (menutrans_T *)menutrans_ga.ga_data;
+ int i;
+ char_u *dname;
+
+ for (i = 0; i < menutrans_ga.ga_len; ++i)
+ if (STRNCMP(name, tp[i].from, len) == 0 && tp[i].from[len] == NUL)
+ return tp[i].to;
+
+ /* Now try again while ignoring '&' characters. */
+ i = name[len];
+ name[len] = NUL;
+ dname = menu_text(name, NULL, NULL);
+ name[len] = i;
+ if (dname != NULL)
+ {
+ for (i = 0; i < menutrans_ga.ga_len; ++i)
+ if (STRCMP(dname, tp[i].from_noamp) == 0)
+ {
+ vim_free(dname);
+ return tp[i].to;
+ }
+ vim_free(dname);
+ }
+
+ return NULL;
+}
+#endif /* FEAT_MULTI_LANG */
+
+#endif /* FEAT_MENU */
diff --git a/src/message.c b/src/message.c
new file mode 100644
index 000000000..405ae6e03
--- /dev/null
+++ b/src/message.c
@@ -0,0 +1,3165 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * message.c: functions for displaying messages on the command line
+ */
+
+#define MESSAGE_FILE /* don't include prototype for smsg() */
+
+#include "vim.h"
+
+#ifdef HAVE_STDARG_H
+# include <stdarg.h>
+#endif
+
+static void reset_last_sourcing __ARGS((void));
+static char_u *get_emsg_source __ARGS((int other));
+static char_u *get_emsg_lnum __ARGS((int other));
+static void add_msg_hist __ARGS((char_u *s, int len, int attr));
+static void hit_return_msg __ARGS((void));
+static void msg_home_replace_attr __ARGS((char_u *fname, int attr));
+#ifdef FEAT_MBYTE
+static char_u *screen_puts_mbyte __ARGS((char_u *s, int l, int attr));
+#endif
+static void msg_puts_attr_len __ARGS((char_u *str, int maxlen, int attr));
+static void t_puts __ARGS((int t_col, char_u *t_s, char_u *s, int attr));
+static void msg_screen_putchar __ARGS((int c, int attr));
+static int msg_check_screen __ARGS((void));
+static void redir_write __ARGS((char_u *s, int maxlen));
+#ifdef FEAT_CON_DIALOG
+static char_u *msg_show_console_dialog __ARGS((char_u *message, char_u *buttons, int dfltbutton));
+static int confirm_msg_used = FALSE; /* displaying confirm_msg */
+static char_u *confirm_msg = NULL; /* ":confirm" message */
+static char_u *confirm_msg_tail; /* tail of confirm_msg */
+#endif
+
+struct msg_hist
+{
+ struct msg_hist *next;
+ char_u *msg;
+ int attr;
+};
+
+static struct msg_hist *first_msg_hist = NULL;
+static struct msg_hist *last_msg_hist = NULL;
+static int msg_hist_len = 0;
+static int msg_hist_off = FALSE; /* don't add messages to history */
+
+/*
+ * When writing messages to the screen, there are many different situations.
+ * A number of variables is used to remember the current state:
+ * msg_didany TRUE when messages were written since the last time the
+ * user reacted to a prompt.
+ * Reset: After hitting a key for the hit-return prompt,
+ * hitting <CR> for the command line or input().
+ * Set: When any message is written to the screen.
+ * msg_didout TRUE when something was written to the current line.
+ * Reset: When advancing to the next line, when the current
+ * text can be overwritten.
+ * Set: When any message is written to the screen.
+ * msg_nowait No extra delay for the last drawn message.
+ * Used in normal_cmd() before the mode message is drawn.
+ * emsg_on_display There was an error message recently. Indicates that there
+ * should be a delay before redrawing.
+ * msg_scroll The next message should not overwrite the current one.
+ * msg_scrolled How many lines the screen has been scrolled (because of
+ * messages). Used in update_screen() to scroll the screen
+ * back. Incremented each time the screen scrolls a line.
+ * msg_scrolled_ign TRUE when msg_scrolled is non-zero and msg_puts_attr()
+ * writes something without scrolling should not make
+ * need_wait_return to be set. This is a hack to make ":ts"
+ * work without an extra prompt.
+ * lines_left Number of lines available for messages before the
+ * more-prompt is to be given.
+ * need_wait_return TRUE when the hit-return prompt is needed.
+ * Reset: After giving the hit-return prompt, when the user
+ * has answered some other prompt.
+ * Set: When the ruler or typeahead display is overwritten,
+ * scrolling the screen for some message.
+ * keep_msg Message to be displayed after redrawing the screen, in
+ * main_loop().
+ * This is an allocated string or NULL when not used.
+ */
+
+/*
+ * msg(s) - displays the string 's' on the status line
+ * When terminal not initialized (yet) mch_errmsg(..) is used.
+ * return TRUE if wait_return not called
+ */
+ int
+msg(s)
+ char_u *s;
+{
+ return msg_attr_keep(s, 0, FALSE);
+}
+
+ int
+msg_attr(s, attr)
+ char_u *s;
+ int attr;
+{
+ return msg_attr_keep(s, attr, FALSE);
+}
+
+ int
+msg_attr_keep(s, attr, keep)
+ char_u *s;
+ int attr;
+ int keep; /* TRUE: set keep_msg if it doesn't scroll */
+{
+ static int entered = 0;
+ int retval;
+ char_u *buf = NULL;
+
+#ifdef FEAT_EVAL
+ if (attr == 0)
+ set_vim_var_string(VV_STATUSMSG, s, -1);
+#endif
+
+ /*
+ * It is possible that displaying a messages causes a problem (e.g.,
+ * when redrawing the window), which causes another message, etc.. To
+ * break this loop, limit the recursiveness to 3 levels.
+ */
+ if (entered >= 3)
+ return TRUE;
+ ++entered;
+
+ /* Add message to history (unless it's a repeated kept message or a
+ * truncated message) */
+ if (s != keep_msg
+ || (*s != '<'
+ && last_msg_hist != NULL
+ && last_msg_hist->msg != NULL
+ && STRCMP(s, last_msg_hist->msg)))
+ add_msg_hist(s, -1, attr);
+
+ /* When displaying keep_msg, don't let msg_start() free it, caller must do
+ * that. */
+ if (s == keep_msg)
+ keep_msg = NULL;
+
+ /* Truncate the message if needed. */
+ buf = msg_strtrunc(s);
+ if (buf != NULL)
+ s = buf;
+
+ msg_start();
+ msg_outtrans_attr(s, attr);
+ msg_clr_eos();
+ retval = msg_end();
+
+ if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)
+ * Columns + sc_col)
+ {
+ set_keep_msg(s);
+ keep_msg_attr = 0;
+ }
+
+ vim_free(buf);
+ --entered;
+ return retval;
+}
+
+/*
+ * Truncate a string such that it can be printed without causing a scroll.
+ * Returns an allocated string or NULL when no truncating is done.
+ */
+ char_u *
+msg_strtrunc(s)
+ char_u *s;
+{
+ char_u *buf = NULL;
+ int len;
+ int room;
+
+ /* May truncate message to avoid a hit-return prompt */
+ if (!msg_scroll && !need_wait_return && shortmess(SHM_TRUNCALL)
+ && !exmode_active)
+ {
+ len = vim_strsize(s);
+ room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
+ if (len > room && room > 0)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ /* may have up to 18 bytes per cell (6 per char, up to two
+ * composing chars) */
+ buf = alloc((room + 2) * 18);
+ else if (enc_dbcs == DBCS_JPNU)
+ /* may have up to 2 bytes per cell for euc-jp */
+ buf = alloc((room + 2) * 2);
+ else
+#endif
+ buf = alloc(room + 2);
+ if (buf != NULL)
+ trunc_string(s, buf, room);
+ }
+ }
+ return buf;
+}
+
+/*
+ * Truncate a string "s" to "buf" with cell width "room".
+ * "s" and "buf" may be equal.
+ */
+ void
+trunc_string(s, buf, room)
+ char_u *s;
+ char_u *buf;
+ int room;
+{
+ int half;
+ int len;
+ int e;
+ int i;
+ int n;
+
+ room -= 3;
+ half = room / 2;
+ len = 0;
+
+ /* First part: Start of the string. */
+ for (e = 0; len < half; ++e)
+ {
+ if (s[e] == NUL)
+ {
+ /* text fits without truncating! */
+ buf[e] = NUL;
+ return;
+ }
+ n = ptr2cells(s + e);
+ if (len + n >= half)
+ break;
+ len += n;
+ buf[e] = s[e];
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ for (n = (*mb_ptr2len_check)(s + e); --n > 0; )
+ {
+ ++e;
+ buf[e] = s[e];
+ }
+#endif
+ }
+
+ /* Last part: End of the string. */
+ i = e;
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0)
+ {
+ /* For DBCS going backwards in a string is slow, but
+ * computing the cell width isn't too slow: go forward
+ * until the rest fits. */
+ n = vim_strsize(s + i);
+ while (len + n > room)
+ {
+ n -= ptr2cells(s + i);
+ i += (*mb_ptr2len_check)(s + i);
+ }
+ }
+ else if (enc_utf8)
+ {
+ /* For UTF-8 we can go backwards easily. */
+ i = (int)STRLEN(s);
+ for (;;)
+ {
+ half = i - (*mb_head_off)(s, s + i - 1) - 1;
+ n = ptr2cells(s + half);
+ if (len + n > room)
+ break;
+ len += n;
+ i = half;
+ }
+ }
+ else
+#endif
+ {
+ for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i)
+ len += n;
+ }
+
+ /* Set the middle and copy the last part. */
+ mch_memmove(buf + e, "...", (size_t)3);
+ mch_memmove(buf + e + 3, s + i, STRLEN(s + i) + 1);
+}
+
+/*
+ * Automatic prototype generation does not understand this function.
+ * Note: Caller of smgs() and smsg_attr() must check the resulting string is
+ * shorter than IOSIZE!!!
+ */
+#ifndef PROTO
+# ifndef HAVE_STDARG_H
+
+int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg __ARGS((char_u *, long, long, long,
+ long, long, long, long, long, long, long));
+int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg_attr __ARGS((int, char_u *, long, long, long,
+ long, long, long, long, long, long, long));
+
+/* VARARGS */
+ int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ char_u *s;
+ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
+{
+ return smsg_attr(0, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+}
+
+/* VARARGS */
+ int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg_attr(attr, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ int attr;
+ char_u *s;
+ long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
+{
+ sprintf((char *)IObuff, (char *)s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+ return msg_attr(IObuff, attr);
+}
+
+# else /* HAVE_STDARG_H */
+
+ int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg(char_u *s, ...)
+{
+ va_list arglist;
+
+ va_start(arglist, s);
+# ifdef HAVE_VSNPRINTF
+ vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist);
+# else
+ vsprintf((char *)IObuff, (char *)s, arglist);
+# endif
+ va_end(arglist);
+ return msg(IObuff);
+}
+
+ int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg_attr(int attr, char_u *s, ...)
+{
+ va_list arglist;
+
+ va_start(arglist, s);
+# ifdef HAVE_VSNPRINTF
+ vsnprintf((char *)IObuff, IOSIZE, (char *)s, arglist);
+# else
+ vsprintf((char *)IObuff, (char *)s, arglist);
+# endif
+ va_end(arglist);
+ return msg_attr(IObuff, attr);
+}
+
+# endif /* HAVE_STDARG_H */
+#endif
+
+/*
+ * Remember the last sourcing name/lnum used in an error message, so that it
+ * isn't printed each time when it didn't change.
+ */
+static int last_sourcing_lnum = 0;
+static char_u *last_sourcing_name = NULL;
+
+/*
+ * Reset the last used sourcing name/lnum. Makes sure it is displayed again
+ * for the next error message;
+ */
+ static void
+reset_last_sourcing()
+{
+ vim_free(last_sourcing_name);
+ last_sourcing_name = NULL;
+ last_sourcing_lnum = 0;
+}
+
+/*
+ * Get the message about the source, as used for an error message.
+ * Returns an allocated string with room for one more character.
+ * Returns NULL when no message is to be given.
+ */
+ static char_u *
+get_emsg_source(other)
+ int other; /* TRUE when "sourcing_name" differs from last time */
+{
+ char_u *Buf, *p;
+
+ if (sourcing_name != NULL && other)
+ {
+ p = (char_u *)_("Error detected while processing %s:");
+ Buf = alloc((unsigned)(STRLEN(sourcing_name) + STRLEN(p)));
+ if (Buf != NULL)
+ sprintf((char *)Buf, (char *)p, sourcing_name);
+ return Buf;
+ }
+ return NULL;
+}
+
+/*
+ * Get the message about the source lnum, as used for an error message.
+ * Returns an allocated string with room for one more character.
+ * Returns NULL when no message is to be given.
+ */
+ static char_u *
+get_emsg_lnum(other)
+ int other; /* TRUE when "sourcing_name" differs from last time */
+{
+ char_u *Buf, *p;
+
+ /* lnum is 0 when executing a command from the command line
+ * argument, we don't want a line number then */
+ if (sourcing_name != NULL
+ && (other || sourcing_lnum != last_sourcing_lnum)
+ && sourcing_lnum != 0)
+ {
+ p = (char_u *)_("line %4ld:");
+ Buf = alloc((unsigned)(STRLEN(p) + 20));
+ if (Buf != NULL)
+ sprintf((char *)Buf, (char *)p, (long)sourcing_lnum);
+ return Buf;
+ }
+ return NULL;
+}
+
+/*
+ * emsg() - display an error message
+ *
+ * Rings the bell, if appropriate, and calls message() to do the real work
+ * When terminal not initialized (yet) mch_errmsg(..) is used.
+ *
+ * return TRUE if wait_return not called
+ */
+ int
+emsg(s)
+ char_u *s;
+{
+ int attr;
+ int other_sourcing_name;
+ char_u *p;
+#ifdef FEAT_EVAL
+ int ignore = FALSE;
+ int severe;
+#endif
+
+ called_emsg = TRUE;
+
+ /*
+ * If "emsg_severe" is TRUE: When an error exception is to be thrown, prefer
+ * this message over previous messages for the same command.
+ */
+#ifdef FEAT_EVAL
+ severe = emsg_severe;
+ emsg_severe = FALSE;
+#endif
+
+ /*
+ * If "emsg_off" is set: no error messages at the moment.
+ * If 'debug' is set: do error message anyway, but without side effects.
+ * If "emsg_skip" is set: never do error messages.
+ */
+ if ((emsg_off > 0 && *p_debug == NUL)
+#ifdef FEAT_EVAL
+ || emsg_skip > 0
+#endif
+ )
+ return TRUE;
+
+ if (sourcing_name != NULL)
+ {
+ if (last_sourcing_name != NULL)
+ other_sourcing_name = STRCMP(sourcing_name, last_sourcing_name);
+ else
+ other_sourcing_name = TRUE;
+ }
+ else
+ other_sourcing_name = FALSE;
+
+ if (!emsg_off)
+ {
+#ifdef FEAT_EVAL
+ /*
+ * Cause a throw of an error exception if appropriate. Don't display
+ * the error message in this case. (If no matching catch clause will
+ * be found, the message will be displayed later on.) "ignore" is set
+ * when the message should be ignored completely (used for the
+ * interrupt message).
+ */
+ if (cause_errthrow(s, severe, &ignore) == TRUE)
+ {
+ if (!ignore)
+ did_emsg = TRUE;
+ return TRUE;
+ }
+
+ /* set "v:errmsg", also when using ":silent! cmd" */
+ set_vim_var_string(VV_ERRMSG, s, -1);
+#endif
+
+ /*
+ * When using ":silent! cmd" ignore error messsages.
+ * But do write it to the redirection file.
+ */
+ if (emsg_silent != 0)
+ {
+ msg_start();
+ p = get_emsg_source(other_sourcing_name);
+ if (p != NULL)
+ {
+ STRCAT(p, "\n");
+ redir_write(p, -1);
+ vim_free(p);
+ }
+ p = get_emsg_lnum(other_sourcing_name);
+ if (p != NULL)
+ {
+ STRCAT(p, "\n");
+ redir_write(p, -1);
+ vim_free(p);
+ }
+ redir_write(s, -1);
+ return TRUE;
+ }
+
+ /* Reset msg_silent, an error causes messages to be switched back on. */
+ msg_silent = 0;
+ cmd_silent = FALSE;
+
+ if (global_busy) /* break :global command */
+ ++global_busy;
+
+ if (p_eb)
+ beep_flush(); /* also includes flush_buffers() */
+ else
+ flush_buffers(FALSE); /* flush internal buffers */
+ did_emsg = TRUE; /* flag for DoOneCmd() */
+
+#ifdef VIMBUDDY
+ if (sourcing_name == NULL)
+ {
+ VimBuddyText(s, 2);
+ return TRUE;
+ }
+#endif
+ }
+
+ emsg_on_display = TRUE; /* remember there is an error message */
+ ++msg_scroll; /* don't overwrite a previous message */
+ attr = hl_attr(HLF_E); /* set highlight mode for error messages */
+ if (msg_scrolled)
+ need_wait_return = TRUE; /* needed in case emsg() is called after
+ * wait_return has reset need_wait_return
+ * and a redraw is expected because
+ * msg_scrolled is non-zero */
+
+ /*
+ * Display name and line number for the source of the error.
+ */
+ ++no_wait_return;
+ p = get_emsg_source(other_sourcing_name);
+ if (p != NULL)
+ {
+ msg_attr(p, attr);
+ vim_free(p);
+ }
+ p = get_emsg_lnum(other_sourcing_name);
+ if (p != NULL)
+ {
+ msg_attr(p, hl_attr(HLF_N));
+ vim_free(p);
+ last_sourcing_lnum = sourcing_lnum; /* only once for each line */
+ }
+ --no_wait_return;
+
+ /* remember the last sourcing name printed, also when it's empty */
+ if (sourcing_name == NULL || other_sourcing_name)
+ {
+ vim_free(last_sourcing_name);
+ if (sourcing_name == NULL)
+ last_sourcing_name = NULL;
+ else
+ last_sourcing_name = vim_strsave(sourcing_name);
+ }
+ msg_nowait = FALSE; /* wait for this msg */
+
+ /*
+ * Display the error message itself.
+ */
+ return msg_attr(s, attr);
+}
+
+/*
+ * Print an error message with one "%s" and one string argument.
+ */
+ int
+emsg2(s, a1)
+ char_u *s, *a1;
+{
+ return emsg3(s, a1, NULL);
+}
+
+/*
+ * Print an error message with one or two "%s" and one or two string arguments.
+ */
+ int
+emsg3(s, a1, a2)
+ char_u *s, *a1, *a2;
+{
+ if ((emsg_off > 0 && *p_debug == NUL)
+#ifdef FEAT_EVAL
+ || emsg_skip > 0
+#endif
+ )
+ return TRUE; /* no error messages at the moment */
+
+ /* Check for NULL strings (just in case) */
+ if (a1 == NULL)
+ a1 = (char_u *)"[NULL]";
+ if (a2 == NULL)
+ a2 = (char_u *)"[NULL]";
+
+ /* Check for very long strings (can happen with ":help ^A<CR>"). */
+ if (STRLEN(s) + STRLEN(a1) + STRLEN(a2) >= (size_t)IOSIZE)
+ a1 = a2 = (char_u *)_("[string too long]");
+
+ sprintf((char *)IObuff, (char *)s, (char *)a1, (char *)a2);
+ return emsg(IObuff);
+}
+
+/*
+ * Print an error message with one "%ld" and one long int argument.
+ */
+ int
+emsgn(s, n)
+ char_u *s;
+ long n;
+{
+ if ((emsg_off > 0 && *p_debug == NUL)
+#ifdef FEAT_EVAL
+ || emsg_skip > 0
+#endif
+ )
+ return TRUE; /* no error messages at the moment */
+ sprintf((char *)IObuff, (char *)s, n);
+ return emsg(IObuff);
+}
+
+/*
+ * Like msg(), but truncate to a single line if p_shm contains 't', or when
+ * "force" is TRUE. This truncates in another way as for normal messages.
+ * Careful: The string may be changed by msg_may_trunc()!
+ * Returns a pointer to the printed message, if wait_return() not called.
+ */
+ char_u *
+msg_trunc_attr(s, force, attr)
+ char_u *s;
+ int force;
+ int attr;
+{
+ int n;
+
+ /* Add message to history before truncating */
+ add_msg_hist(s, -1, attr);
+
+ s = msg_may_trunc(force, s);
+
+ msg_hist_off = TRUE;
+ n = msg_attr(s, attr);
+ msg_hist_off = FALSE;
+
+ if (n)
+ return s;
+ return NULL;
+}
+
+/*
+ * Check if message "s" should be truncated at the start (for filenames).
+ * Return a pointer to where the truncated message starts.
+ * Note: May change the message by replacing a character with '<'.
+ */
+ char_u *
+msg_may_trunc(force, s)
+ int force;
+ char_u *s;
+{
+ int n;
+ int room;
+
+ room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
+ if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
+ && (n = (int)STRLEN(s) - room) > 0)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int size = vim_strsize(s);
+
+ for (n = 0; size >= room; )
+ {
+ size -= (*mb_ptr2cells)(s + n);
+ n += (*mb_ptr2len_check)(s + n);
+ }
+ --n;
+ }
+#endif
+ s += n;
+ *s = '<';
+ }
+ return s;
+}
+
+ static void
+add_msg_hist(s, len, attr)
+ char_u *s;
+ int len; /* -1 for undetermined length */
+ int attr;
+{
+ struct msg_hist *p;
+
+ if (msg_hist_off || msg_silent != 0)
+ return;
+
+ /* Don't let the message history get too big */
+ while (msg_hist_len > 20)
+ {
+ p = first_msg_hist;
+ first_msg_hist = p->next;
+ vim_free(p->msg);
+ vim_free(p);
+ --msg_hist_len;
+ }
+ /* allocate an entry and add the message at the end of the history */
+ p = (struct msg_hist *)alloc((int)sizeof(struct msg_hist));
+ if (p != NULL)
+ {
+ if (len < 0)
+ len = (int)STRLEN(s);
+ /* remove leading and trailing newlines */
+ while (len > 0 && *s == '\n')
+ {
+ ++s;
+ --len;
+ }
+ while (len > 0 && s[len - 1] == '\n')
+ --len;
+ p->msg = vim_strnsave(s, len);
+ p->next = NULL;
+ p->attr = attr;
+ if (last_msg_hist != NULL)
+ last_msg_hist->next = p;
+ last_msg_hist = p;
+ if (first_msg_hist == NULL)
+ first_msg_hist = last_msg_hist;
+ ++msg_hist_len;
+ }
+}
+
+/*
+ * ":messages" command.
+ */
+/*ARGSUSED*/
+ void
+ex_messages(eap)
+ exarg_T *eap;
+{
+ struct msg_hist *p;
+ char_u *s;
+
+ msg_hist_off = TRUE;
+
+ s = mch_getenv((char_u *)"LANG");
+ if (s != NULL && *s != NUL)
+ msg_attr((char_u *)
+ _("Messages maintainer: Bram Moolenaar <Bram@vim.org>"),
+ hl_attr(HLF_T));
+
+ for (p = first_msg_hist; p != NULL; p = p->next)
+ if (p->msg != NULL)
+ msg_attr(p->msg, p->attr);
+
+ msg_hist_off = FALSE;
+}
+
+#if defined(FEAT_CON_DIALOG) || defined(PROTO)
+static void msg_end_prompt __ARGS((void));
+
+/*
+ * Call this after prompting the user. This will avoid a hit-return message
+ * and a delay.
+ */
+ static void
+msg_end_prompt()
+{
+ need_wait_return = FALSE;
+ emsg_on_display = FALSE;
+ cmdline_row = msg_row;
+ msg_col = 0;
+ msg_clr_eos();
+}
+#endif
+
+/*
+ * wait for the user to hit a key (normally a return)
+ * if 'redraw' is TRUE, clear and redraw the screen
+ * if 'redraw' is FALSE, just redraw the screen
+ * if 'redraw' is -1, don't redraw at all
+ */
+ void
+wait_return(redraw)
+ int redraw;
+{
+ int c;
+ int oldState;
+ int tmpState;
+#ifndef ORG_HITRETURN
+ int had_got_int;
+#endif
+
+ if (redraw == TRUE)
+ must_redraw = CLEAR;
+
+ /* If using ":silent cmd", don't wait for a return. Also don't set
+ * need_wait_return to do it later. */
+ if (msg_silent != 0)
+ return;
+
+/*
+ * With the global command (and some others) we only need one return at the
+ * end. Adjust cmdline_row to avoid the next message overwriting the last one.
+ * When inside vgetc(), we can't wait for a typed character at all.
+ */
+ if (vgetc_busy)
+ return;
+ if (no_wait_return)
+ {
+ need_wait_return = TRUE;
+ if (!exmode_active)
+ cmdline_row = msg_row;
+ return;
+ }
+
+ redir_off = TRUE; /* don't redirect this message */
+ oldState = State;
+ if (quit_more)
+ {
+ c = CAR; /* just pretend CR was hit */
+ quit_more = FALSE;
+ got_int = FALSE;
+ }
+ else if (exmode_active)
+ {
+ MSG_PUTS(" "); /* make sure the cursor is on the right line */
+ c = CAR; /* no need for a return in ex mode */
+ got_int = FALSE;
+ }
+ else
+ {
+ /* Make sure the hit-return prompt is on screen when 'guioptions' was
+ * just changed. */
+ screenalloc(FALSE);
+
+ State = HITRETURN;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ hit_return_msg();
+
+#ifdef ORG_HITRETURN
+ do
+ {
+ c = safe_vgetc();
+ } while (vim_strchr((char_u *)"\r\n: ", c) == NULL);
+ if (c == ':') /* this can vi too (but not always!) */
+ stuffcharReadbuff(c);
+#else
+ do
+ {
+ /* Remember "got_int", if it is set vgetc() probably returns a
+ * CTRL-C, but we need to loop then. */
+ had_got_int = got_int;
+ c = safe_vgetc();
+ if (!global_busy)
+ got_int = FALSE;
+#ifdef FEAT_CLIPBOARD
+ /* Strange way to allow copying (yanking) a modeless selection at
+ * the hit-enter prompt. Use CTRL-Y, because the same is used in
+ * Cmdline-mode and it's harmless when there is no selection. */
+ if (c == Ctrl_Y && clip_star.state == SELECT_DONE)
+ {
+ clip_copy_modeless_selection(TRUE);
+ c = K_IGNORE;
+ }
+#endif
+ } while ((had_got_int && c == Ctrl_C)
+ || c == K_IGNORE
+#ifdef FEAT_GUI
+ || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR
+#endif
+#ifdef FEAT_MOUSE
+ || c == K_LEFTDRAG || c == K_LEFTRELEASE
+ || c == K_MIDDLEDRAG || c == K_MIDDLERELEASE
+ || c == K_RIGHTDRAG || c == K_RIGHTRELEASE
+ || c == K_MOUSEDOWN || c == K_MOUSEUP
+ || (!mouse_has(MOUSE_RETURN)
+ && mouse_row < msg_row
+ && (c == K_LEFTMOUSE
+ || c == K_MIDDLEMOUSE
+ || c == K_RIGHTMOUSE
+ || c == K_X1MOUSE
+ || c == K_X2MOUSE))
+#endif
+ );
+ ui_breakcheck();
+#ifdef FEAT_MOUSE
+ /*
+ * Avoid that the mouse-up event causes visual mode to start.
+ */
+ if (c == K_LEFTMOUSE || c == K_MIDDLEMOUSE || c == K_RIGHTMOUSE
+ || c == K_X1MOUSE || c == K_X2MOUSE)
+ (void)jump_to_mouse(MOUSE_SETPOS, NULL, 0);
+ else
+#endif
+ if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
+ {
+ stuffcharReadbuff(c);
+ do_redraw = TRUE; /* need a redraw even though there is
+ something in the stuff buffer */
+ }
+#endif
+ }
+ redir_off = FALSE;
+
+ /*
+ * If the user hits ':', '?' or '/' we get a command line from the next
+ * line.
+ */
+ if (c == ':' || c == '?' || c == '/')
+ {
+ if (!exmode_active)
+ cmdline_row = msg_row;
+ skip_redraw = TRUE; /* skip redraw once */
+ do_redraw = FALSE;
+ }
+
+ /*
+ * If the window size changed set_shellsize() will redraw the screen.
+ * Otherwise the screen is only redrawn if 'redraw' is set and no ':'
+ * typed.
+ */
+ tmpState = State;
+ State = oldState; /* restore State before set_shellsize */
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ msg_check();
+
+#if defined(UNIX) || defined(VMS)
+ /*
+ * When switching screens, we need to output an extra newline on exit.
+ */
+ if (swapping_screen() && !termcap_active)
+ newline_on_exit = TRUE;
+#endif
+
+ need_wait_return = FALSE;
+ did_wait_return = TRUE;
+ emsg_on_display = FALSE; /* can delete error message now */
+ lines_left = -1; /* reset lines_left at next msg_start() */
+ reset_last_sourcing();
+ if (keep_msg != NULL && vim_strsize(keep_msg) >=
+ (Rows - cmdline_row - 1) * Columns + sc_col)
+ {
+ vim_free(keep_msg);
+ keep_msg = NULL; /* don't redisplay message, it's too long */
+ }
+
+ if (tmpState == SETWSIZE) /* got resize event while in vgetc() */
+ {
+ starttermcap(); /* start termcap before redrawing */
+ shell_resized();
+ }
+ else if (!skip_redraw
+ && (redraw == TRUE || (msg_scrolled != 0 && redraw != -1)))
+ {
+ starttermcap(); /* start termcap before redrawing */
+ redraw_later(VALID);
+ }
+}
+
+/*
+ * Write the hit-return prompt.
+ */
+ static void
+hit_return_msg()
+{
+ if (msg_didout) /* start on a new line */
+ msg_putchar('\n');
+ if (got_int)
+ MSG_PUTS(_("Interrupt: "));
+
+#ifdef ORG_HITRETURN
+ MSG_PUTS_ATTR(_("Hit ENTER to continue"), hl_attr(HLF_R));
+#else
+ MSG_PUTS_ATTR(_("Hit ENTER or type command to continue"), hl_attr(HLF_R));
+#endif
+ if (!msg_use_printf())
+ msg_clr_eos();
+}
+
+/*
+ * Set "keep_msg" to "s". Free the old value and check for NULL pointer.
+ */
+ void
+set_keep_msg(s)
+ char_u *s;
+{
+ vim_free(keep_msg);
+ if (s != NULL && msg_silent == 0)
+ keep_msg = vim_strsave(s);
+ else
+ keep_msg = NULL;
+}
+
+/*
+ * Prepare for outputting characters in the command line.
+ */
+ void
+msg_start()
+{
+ int did_return = FALSE;
+
+ vim_free(keep_msg);
+ keep_msg = NULL; /* don't display old message now */
+ if (!msg_scroll && full_screen) /* overwrite last message */
+ {
+ msg_row = cmdline_row;
+ msg_col =
+#ifdef FEAT_RIGHTLEFT
+ cmdmsg_rl ? Columns - 1 :
+#endif
+ 0;
+ }
+ else if (msg_didout) /* start message on next line */
+ {
+ msg_putchar('\n');
+ did_return = TRUE;
+ if (exmode_active != EXMODE_NORMAL)
+ cmdline_row = msg_row;
+ }
+ if (!msg_didany || lines_left < 0)
+ msg_starthere();
+ if (msg_silent == 0)
+ {
+ msg_didout = FALSE; /* no output on current line yet */
+ cursor_off();
+ }
+
+ /* when redirecting, may need to start a new line. */
+ if (!did_return)
+ redir_write((char_u *)"\n", -1);
+}
+
+/*
+ * Note that the current msg position is where messages start.
+ */
+ void
+msg_starthere()
+{
+ lines_left = cmdline_row;
+ msg_didany = FALSE;
+}
+
+ void
+msg_putchar(c)
+ int c;
+{
+ msg_putchar_attr(c, 0);
+}
+
+ void
+msg_putchar_attr(c, attr)
+ int c;
+ int attr;
+{
+#ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+#else
+ char_u buf[4];
+#endif
+
+ if (IS_SPECIAL(c))
+ {
+ buf[0] = K_SPECIAL;
+ buf[1] = K_SECOND(c);
+ buf[2] = K_THIRD(c);
+ buf[3] = NUL;
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ buf[(*mb_char2bytes)(c, buf)] = NUL;
+#else
+ buf[0] = c;
+ buf[1] = NUL;
+#endif
+ }
+ msg_puts_attr(buf, attr);
+}
+
+ void
+msg_outnum(n)
+ long n;
+{
+ char_u buf[20];
+
+ sprintf((char *)buf, "%ld", n);
+ msg_puts(buf);
+}
+
+ void
+msg_home_replace(fname)
+ char_u *fname;
+{
+ msg_home_replace_attr(fname, 0);
+}
+
+#if defined(FEAT_FIND_ID) || defined(PROTO)
+ void
+msg_home_replace_hl(fname)
+ char_u *fname;
+{
+ msg_home_replace_attr(fname, hl_attr(HLF_D));
+}
+#endif
+
+ static void
+msg_home_replace_attr(fname, attr)
+ char_u *fname;
+ int attr;
+{
+ char_u *name;
+
+ name = home_replace_save(NULL, fname);
+ if (name != NULL)
+ msg_outtrans_attr(name, attr);
+ vim_free(name);
+}
+
+/*
+ * Output 'len' characters in 'str' (including NULs) with translation
+ * if 'len' is -1, output upto a NUL character.
+ * Use attributes 'attr'.
+ * Return the number of characters it takes on the screen.
+ */
+ int
+msg_outtrans(str)
+ char_u *str;
+{
+ return msg_outtrans_attr(str, 0);
+}
+
+ int
+msg_outtrans_attr(str, attr)
+ char_u *str;
+ int attr;
+{
+ return msg_outtrans_len_attr(str, (int)STRLEN(str), attr);
+}
+
+ int
+msg_outtrans_len(str, len)
+ char_u *str;
+ int len;
+{
+ return msg_outtrans_len_attr(str, len, 0);
+}
+
+/*
+ * Output one character at "p". Return pointer to the next character.
+ * Handles multi-byte characters.
+ */
+ char_u *
+msg_outtrans_one(p, attr)
+ char_u *p;
+ int attr;
+{
+#ifdef FEAT_MBYTE
+ int l;
+
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ msg_outtrans_len_attr(p, l, attr);
+ return p + l;
+ }
+#endif
+ msg_puts_attr(transchar_byte(*p), attr);
+ return p + 1;
+}
+
+ int
+msg_outtrans_len_attr(msgstr, len, attr)
+ char_u *msgstr;
+ int len;
+ int attr;
+{
+ int retval = 0;
+ char_u *str = msgstr;
+ char_u *plain_start = msgstr;
+ char_u *s;
+#ifdef FEAT_MBYTE
+ int mb_l;
+ int c;
+#endif
+
+ /* if MSG_HIST flag set, add message to history */
+ if (attr & MSG_HIST)
+ {
+ add_msg_hist(str, len, attr);
+ attr &= ~MSG_HIST;
+ }
+
+#ifdef FEAT_MBYTE
+ /* If the string starts with a composing character first draw a space on
+ * which the composing char can be drawn. */
+ if (enc_utf8 && utf_iscomposing(utf_ptr2char(msgstr)))
+ msg_puts_attr((char_u *)" ", attr);
+#endif
+
+ /*
+ * Go over the string. Special characters are translated and printed.
+ * Normal characters are printed several at a time.
+ */
+ while (--len >= 0)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ /* Don't include composing chars after the end. */
+ mb_l = utfc_ptr2len_check_len(str, len + 1);
+ else if (has_mbyte)
+ mb_l = (*mb_ptr2len_check)(str);
+ else
+ mb_l = 1;
+ if (has_mbyte && mb_l > 1)
+ {
+ c = (*mb_ptr2char)(str);
+ if (vim_isprintc(c))
+ /* printable multi-byte char: count the cells. */
+ retval += (*mb_ptr2cells)(str);
+ else
+ {
+ /* unprintable multi-byte char: print the printable chars so
+ * far and the translation of the unprintable char. */
+ if (str > plain_start)
+ msg_puts_attr_len(plain_start, (int)(str - plain_start),
+ attr);
+ plain_start = str + mb_l;
+ msg_puts_attr(transchar(c), attr == 0 ? hl_attr(HLF_8) : attr);
+ retval += char2cells(c);
+ }
+ len -= mb_l - 1;
+ str += mb_l;
+ }
+ else
+#endif
+ {
+ s = transchar_byte(*str);
+ if (s[1] != NUL)
+ {
+ /* unprintable char: print the printable chars so far and the
+ * translation of the unprintable char. */
+ if (str > plain_start)
+ msg_puts_attr_len(plain_start, (int)(str - plain_start),
+ attr);
+ plain_start = str + 1;
+ msg_puts_attr(s, attr == 0 ? hl_attr(HLF_8) : attr);
+ }
+ retval += ptr2cells(str);
+ ++str;
+ }
+ }
+
+ if (str > plain_start)
+ /* print the printable chars at the end */
+ msg_puts_attr_len(plain_start, (int)(str - plain_start), attr);
+
+ return retval;
+}
+
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
+ void
+msg_make(arg)
+ char_u *arg;
+{
+ int i;
+ static char_u *str = (char_u *)"eeffoc", *rs = (char_u *)"Plon#dqg#vxjduB";
+
+ arg = skipwhite(arg);
+ for (i = 5; *arg && i >= 0; --i)
+ if (*arg++ != str[i])
+ break;
+ if (i < 0)
+ {
+ msg_putchar('\n');
+ for (i = 0; rs[i]; ++i)
+ msg_putchar(rs[i] - 3);
+ }
+}
+#endif
+
+/*
+ * Output the string 'str' upto a NUL character.
+ * Return the number of characters it takes on the screen.
+ *
+ * If K_SPECIAL is encountered, then it is taken in conjunction with the
+ * following character and shown as <F1>, <S-Up> etc. Any other character
+ * which is not printable shown in <> form.
+ * If 'from' is TRUE (lhs of a mapping), a space is shown as <Space>.
+ * If a character is displayed in one of these special ways, is also
+ * highlighted (its highlight name is '8' in the p_hl variable).
+ * Otherwise characters are not highlighted.
+ * This function is used to show mappings, where we want to see how to type
+ * the character/string -- webb
+ */
+ int
+msg_outtrans_special(strstart, from)
+ char_u *strstart;
+ int from; /* TRUE for lhs of a mapping */
+{
+ char_u *str = strstart;
+ int retval = 0;
+ char_u *string;
+ int attr;
+ int len;
+
+ attr = hl_attr(HLF_8);
+ while (*str != NUL)
+ {
+ /* Leading and trailing spaces need to be displayed in <> form. */
+ if ((str == strstart || str[1] == NUL) && *str == ' ')
+ {
+ string = (char_u *)"<Space>";
+ ++str;
+ }
+ else
+ string = str2special(&str, from);
+ len = vim_strsize(string);
+ /* Highlight special keys */
+ msg_puts_attr(string, len > 1
+#ifdef FEAT_MBYTE
+ && (*mb_ptr2len_check)(string) <= 1
+#endif
+ ? attr : 0);
+ retval += len;
+ }
+ return retval;
+}
+
+/*
+ * Return the printable string for the key codes at "*sp".
+ * Used for translating the lhs or rhs of a mapping to printable chars.
+ * Advances "sp" to the next code.
+ */
+ char_u *
+str2special(sp, from)
+ char_u **sp;
+ int from; /* TRUE for lhs of mapping */
+{
+ int c;
+ static char_u buf[7];
+ char_u *str = *sp;
+ int modifiers = 0;
+ int special = FALSE;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ char_u *p;
+
+ /* Try to un-escape a multi-byte character. Return the un-escaped
+ * string if it is a multi-byte character. */
+ p = mb_unescape(sp);
+ if (p != NULL)
+ return p;
+ }
+#endif
+
+ c = *str;
+ if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL)
+ {
+ if (str[1] == KS_MODIFIER)
+ {
+ modifiers = str[2];
+ str += 3;
+ c = *str;
+ }
+ if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL)
+ {
+ c = TO_SPECIAL(str[1], str[2]);
+ str += 2;
+ if (c == K_ZERO) /* display <Nul> as ^@ */
+ c = NUL;
+ }
+ if (IS_SPECIAL(c) || modifiers) /* special key */
+ special = TRUE;
+ }
+ *sp = str + 1;
+
+#ifdef FEAT_MBYTE
+ /* For multi-byte characters check for an illegal byte. */
+ if (has_mbyte && MB_BYTE2LEN(*str) > (*mb_ptr2len_check)(str))
+ {
+ transchar_nonprint(buf, c);
+ return buf;
+ }
+#endif
+
+ /* Make unprintable characters in <> form, also <M-Space> and <Tab>.
+ * Use <Space> only for lhs of a mapping. */
+ if (special || char2cells(c) > 1 || (from && c == ' '))
+ return get_special_key_name(c, modifiers);
+ buf[0] = c;
+ buf[1] = NUL;
+ return buf;
+}
+
+/*
+ * Translate a key sequence into special key names.
+ */
+ void
+str2specialbuf(sp, buf, len)
+ char_u *sp;
+ char_u *buf;
+ int len;
+{
+ char_u *s;
+
+ *buf = NUL;
+ while (*sp)
+ {
+ s = str2special(&sp, FALSE);
+ if ((int)(STRLEN(s) + STRLEN(buf)) < len)
+ STRCAT(buf, s);
+ }
+}
+
+/*
+ * print line for :print or :list command
+ */
+ void
+msg_prt_line(s)
+ char_u *s;
+{
+ int c;
+ int col = 0;
+ int n_extra = 0;
+ int c_extra = 0;
+ char_u *p_extra = NULL; /* init to make SASC shut up */
+ int n;
+ int attr= 0;
+ char_u *trail = NULL;
+#ifdef FEAT_MBYTE
+ int l;
+ char_u buf[MB_MAXBYTES + 1];
+#endif
+
+ /* find start of trailing whitespace */
+ if (curwin->w_p_list && lcs_trail)
+ {
+ trail = s + STRLEN(s);
+ while (trail > s && vim_iswhite(trail[-1]))
+ --trail;
+ }
+
+ /* output a space for an empty line, otherwise the line will be
+ * overwritten */
+ if (*s == NUL && !(curwin->w_p_list && lcs_eol != NUL))
+ msg_putchar(' ');
+
+ for (;;)
+ {
+ if (n_extra)
+ {
+ --n_extra;
+ if (c_extra)
+ c = c_extra;
+ else
+ c = *p_extra++;
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte && (l = (*mb_ptr2len_check)(s)) > 1)
+ {
+ col += (*mb_ptr2cells)(s);
+ mch_memmove(buf, s, (size_t)l);
+ buf[l] = NUL;
+ msg_puts_attr(buf, attr);
+ s += l;
+ continue;
+ }
+#endif
+ else
+ {
+ attr = 0;
+ c = *s++;
+ if (c == TAB && (!curwin->w_p_list || lcs_tab1))
+ {
+ /* tab amount depends on current column */
+ n_extra = curbuf->b_p_ts - col % curbuf->b_p_ts - 1;
+ if (!curwin->w_p_list)
+ {
+ c = ' ';
+ c_extra = ' ';
+ }
+ else
+ {
+ c = lcs_tab1;
+ c_extra = lcs_tab2;
+ attr = hl_attr(HLF_8);
+ }
+ }
+ else if (c == NUL && curwin->w_p_list && lcs_eol != NUL)
+ {
+ p_extra = (char_u *)"";
+ c_extra = NUL;
+ n_extra = 1;
+ c = lcs_eol;
+ attr = hl_attr(HLF_AT);
+ --s;
+ }
+ else if (c != NUL && (n = byte2cells(c)) > 1)
+ {
+ n_extra = n - 1;
+ p_extra = transchar_byte(c);
+ c_extra = NUL;
+ c = *p_extra++;
+ }
+ else if (c == ' ' && trail != NULL && s > trail)
+ {
+ c = lcs_trail;
+ attr = hl_attr(HLF_8);
+ }
+ }
+
+ if (c == NUL)
+ break;
+
+ msg_putchar_attr(c, attr);
+ col++;
+ }
+ msg_clr_eos();
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Use screen_puts() to output one multi-byte character.
+ * Return the pointer "s" advanced to the next character.
+ */
+ static char_u *
+screen_puts_mbyte(s, l, attr)
+ char_u *s;
+ int l;
+ int attr;
+{
+ int cw;
+
+ msg_didout = TRUE; /* remember that line is not empty */
+ cw = (*mb_ptr2cells)(s);
+ if (cw > 1 && (
+#ifdef FEAT_RIGHTLEFT
+ cmdmsg_rl ? msg_col <= 1 :
+#endif
+ msg_col == Columns - 1))
+ {
+ /* Doesn't fit, print a highlighted '>' to fill it up. */
+ msg_screen_putchar('>', hl_attr(HLF_AT));
+ return s;
+ }
+
+ screen_puts_len(s, l, msg_row, msg_col, attr);
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ {
+ msg_col -= cw;
+ if (msg_col == 0)
+ {
+ msg_col = Columns;
+ ++msg_row;
+ }
+ }
+ else
+#endif
+ {
+ msg_col += cw;
+ if (msg_col >= Columns)
+ {
+ msg_col = 0;
+ ++msg_row;
+ }
+ }
+ return s + l;
+}
+#endif
+
+/*
+ * Output a string to the screen at position msg_row, msg_col.
+ * Update msg_row and msg_col for the next message.
+ */
+ void
+msg_puts(s)
+ char_u *s;
+{
+ msg_puts_attr(s, 0);
+}
+
+ void
+msg_puts_title(s)
+ char_u *s;
+{
+ msg_puts_attr(s, hl_attr(HLF_T));
+}
+
+#if defined(FEAT_CSCOPE) || defined(PROTO)
+/*
+ * if printing a string will exceed the screen width, print "..." in the
+ * middle.
+ */
+ void
+msg_puts_long(longstr)
+ char_u *longstr;
+{
+ msg_puts_long_len_attr(longstr, (int)strlen((char *)longstr), 0);
+}
+#endif
+
+/*
+ * Show a message in such a way that it always fits in the line. Cut out a
+ * part in the middle and replace it with "..." when necessary.
+ * Does not handle multi-byte characters!
+ */
+ void
+msg_puts_long_attr(longstr, attr)
+ char_u *longstr;
+ int attr;
+{
+ msg_puts_long_len_attr(longstr, (int)strlen((char *)longstr), attr);
+}
+
+ void
+msg_puts_long_len_attr(longstr, len, attr)
+ char_u *longstr;
+ int len;
+ int attr;
+{
+ int slen = len;
+ int room;
+
+ room = Columns - msg_col;
+ if (len > room && room >= 20)
+ {
+ slen = (room - 3) / 2;
+ msg_outtrans_len_attr(longstr, slen, attr);
+ msg_puts_attr((char_u *)"...", hl_attr(HLF_8));
+ }
+ msg_outtrans_len_attr(longstr + len - slen, slen, attr);
+}
+
+/*
+ * Basic function for writing a message with highlight attributes.
+ */
+ void
+msg_puts_attr(s, attr)
+ char_u *s;
+ int attr;
+{
+ msg_puts_attr_len(s, -1, attr);
+}
+
+/*
+ * Like msg_puts_attr(), but with a maximum length "maxlen" (in bytes).
+ * When "maxlen" is -1 there is no maximum length.
+ * When "maxlen" is >= 0 the message is not put in the history.
+ */
+ static void
+msg_puts_attr_len(str, maxlen, attr)
+ char_u *str;
+ int maxlen;
+ int attr;
+{
+ int oldState;
+ char_u *s = str;
+ char_u *p;
+ char_u buf[4];
+ char_u *t_s = str; /* string from "t_s" to "s" is still todo */
+ int t_col = 0; /* screen cells todo, 0 when "t_s" not used */
+#ifdef FEAT_MBYTE
+ int l;
+ int cw;
+#endif
+ int c;
+
+ /*
+ * If redirection is on, also write to the redirection file.
+ */
+ redir_write(s, maxlen);
+
+ /*
+ * Don't print anything when using ":silent cmd".
+ */
+ if (msg_silent != 0)
+ return;
+
+ /* if MSG_HIST flag set, add message to history */
+ if ((attr & MSG_HIST) && maxlen < 0)
+ {
+ add_msg_hist(s, -1, attr);
+ attr &= ~MSG_HIST;
+ }
+
+ /*
+ * When writing something to the screen after it has scrolled, requires a
+ * wait-return prompt later. Needed when scrolling, resetting
+ * need_wait_return after some prompt, and then outputting something
+ * without scrolling
+ */
+ if (msg_scrolled && !msg_scrolled_ign)
+ need_wait_return = TRUE;
+ msg_didany = TRUE; /* remember that something was outputted */
+
+ /*
+ * If there is no valid screen, use fprintf so we can see error messages.
+ * If termcap is not active, we may be writing in an alternate console
+ * window, cursor positioning may not work correctly (window size may be
+ * different, e.g. for Win32 console) or we just don't know where the
+ * cursor is.
+ */
+ if (msg_use_printf())
+ {
+#ifdef WIN3264
+ if (!(silent_mode && p_verbose == 0))
+ mch_settmode(TMODE_COOK); /* handle '\r' and '\n' correctly */
+#endif
+ while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
+ {
+ if (!(silent_mode && p_verbose == 0))
+ {
+ p = &buf[0];
+ /* NL --> CR NL translation (for Unix, not for "--version") */
+ /* NL --> CR translation (for Mac) */
+ if (*s == '\n' && !info_message)
+ *p++ = '\r';
+#if defined(USE_CR) && !defined(MACOS_X_UNIX)
+ else
+#endif
+ *p++ = *s;
+ *p = '\0';
+ if (info_message) /* informative message, not an error */
+ mch_msg((char *)buf);
+ else
+ mch_errmsg((char *)buf);
+ }
+
+ /* primitive way to compute the current column */
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ {
+ if (*s == '\r' || *s == '\n')
+ msg_col = Columns - 1;
+ else
+ --msg_col;
+ }
+ else
+#endif
+ {
+ if (*s == '\r' || *s == '\n')
+ msg_col = 0;
+ else
+ ++msg_col;
+ }
+ ++s;
+ }
+ msg_didout = TRUE; /* assume that line is not empty */
+
+#ifdef WIN3264
+ if (!(silent_mode && p_verbose == 0))
+ mch_settmode(TMODE_RAW);
+#endif
+ return;
+ }
+
+ did_wait_return = FALSE;
+ while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
+ {
+ /*
+ * The screen is scrolled up when:
+ * - When outputting a newline in the last row
+ * - when outputting a character in the last column of the last row
+ * (some terminals scroll automatically, some don't. To avoid
+ * problems we scroll ourselves)
+ */
+ if (msg_row >= Rows - 1
+ && (*s == '\n'
+ || (
+#ifdef FEAT_RIGHTLEFT
+ cmdmsg_rl
+ ? (
+ msg_col <= 1
+ || (*s == TAB && msg_col <= 7)
+# ifdef FEAT_MBYTE
+ || (has_mbyte && (*mb_ptr2cells)(s) > 1 && msg_col <= 2)
+# endif
+ )
+ :
+#endif
+ (msg_col + t_col >= Columns - 1
+ || (*s == TAB && msg_col + t_col >= ((Columns - 1) & ~7))
+# ifdef FEAT_MBYTE
+ || (has_mbyte && (*mb_ptr2cells)(s) > 1
+ && msg_col + t_col >= Columns - 2)
+# endif
+ ))))
+ {
+ if (t_col > 0)
+ {
+ /* output postponed text */
+ t_puts(t_col, t_s, s, attr);
+ t_col = 0;
+ }
+
+ /* When no more prompt an no more room, truncate here */
+ if (msg_no_more && lines_left == 0)
+ break;
+#ifdef FEAT_GUI
+ /* Remove the cursor before scrolling, ScreenLines[] is going to
+ * become invalid. */
+ if (gui.in_use)
+ gui_undraw_cursor();
+#endif
+ /* scrolling up always works */
+ screen_del_lines(0, 0, 1, (int)Rows, TRUE, NULL);
+
+ if (!can_clear((char_u *)" "))
+ {
+ /* Scrolling up doesn't result in the right background. Set
+ * the background here. It's not efficient, but avoids that
+ * we have to do it all over the code. */
+ screen_fill((int)Rows - 1, (int)Rows, 0,
+ (int)Columns, ' ', ' ', 0);
+
+ /* Also clear the last char of the last but one line if it was
+ * not cleared before to avoid a scroll-up. */
+ if (ScreenAttrs[LineOffset[Rows - 2] + Columns - 1]
+ == (sattr_T)-1)
+ screen_fill((int)Rows - 2, (int)Rows - 1,
+ (int)Columns - 1, (int)Columns, ' ', ' ', 0);
+ }
+
+ msg_row = Rows - 2;
+ if (msg_col >= Columns) /* can happen after screen resize */
+ msg_col = Columns - 1;
+
+ ++msg_scrolled;
+ need_wait_return = TRUE; /* may need wait_return in main() */
+ if (must_redraw < VALID)
+ must_redraw = VALID;
+ redraw_cmdline = TRUE;
+ if (cmdline_row > 0 && !exmode_active)
+ --cmdline_row;
+
+ /*
+ * if screen is completely filled wait for a character
+ */
+ if (p_more && --lines_left == 0 && State != HITRETURN
+ && !msg_no_more && !exmode_active)
+ {
+ oldState = State;
+ State = ASKMORE;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ msg_moremsg(FALSE);
+ for (;;)
+ {
+ /*
+ * Get a typed character directly from the user.
+ */
+ c = get_keystroke();
+
+#if defined(FEAT_MENU) && defined(FEAT_GUI)
+ if (c == K_MENU)
+ {
+ int idx = get_menu_index(current_menu, ASKMORE);
+
+ /* Used a menu. If it starts with CTRL-Y, it must
+ * be a "Copy" for the clipboard. Otherwise
+ * assume that we end */
+ if (idx == MENU_INDEX_INVALID)
+ continue;
+ c = *current_menu->strings[idx];
+ if (c != NUL && current_menu->strings[idx][1] != NUL)
+ ins_typebuf(current_menu->strings[idx] + 1,
+ current_menu->noremap[idx], 0, TRUE,
+ current_menu->silent[idx]);
+ }
+#endif
+
+ switch (c)
+ {
+ case BS:
+ case 'k':
+ case K_UP:
+ if (!more_back_used)
+ {
+ msg_moremsg(TRUE);
+ continue;
+ }
+ more_back = 1;
+ lines_left = 1;
+ break;
+ case CAR: /* one extra line */
+ case NL:
+ case 'j':
+ case K_DOWN:
+ lines_left = 1;
+ break;
+ case ':': /* start new command line */
+#ifdef FEAT_CON_DIALOG
+ if (!confirm_msg_used)
+#endif
+ {
+ /* Since got_int is set all typeahead will be
+ * flushed, but we want to keep this ':', remember
+ * that in a special way. */
+ typeahead_noflush(':');
+ cmdline_row = Rows - 1; /* put ':' on this line */
+ skip_redraw = TRUE; /* skip redraw once */
+ need_wait_return = FALSE; /* don't wait in main() */
+ }
+ /*FALLTHROUGH*/
+ case 'q': /* quit */
+ case Ctrl_C:
+ case ESC:
+#ifdef FEAT_CON_DIALOG
+ if (confirm_msg_used)
+ {
+ /* Jump to the choices of the dialog. */
+ s = confirm_msg_tail;
+ lines_left = Rows - 1;
+ }
+ else
+#endif
+ {
+ got_int = TRUE;
+ quit_more = TRUE;
+ }
+ break;
+ case 'u': /* Up half a page */
+ case K_PAGEUP:
+ if (!more_back_used)
+ {
+ msg_moremsg(TRUE);
+ continue;
+ }
+ more_back = Rows / 2;
+ /*FALLTHROUGH*/
+ case 'd': /* Down half a page */
+ lines_left = Rows / 2;
+ break;
+ case 'b': /* one page back */
+ if (!more_back_used)
+ {
+ msg_moremsg(TRUE);
+ continue;
+ }
+ more_back = Rows - 1;
+ /*FALLTHROUGH*/
+ case ' ': /* one extra page */
+ case K_PAGEDOWN:
+ case K_LEFTMOUSE:
+ lines_left = Rows - 1;
+ break;
+
+#ifdef FEAT_CLIPBOARD
+ case Ctrl_Y:
+ /* Strange way to allow copying (yanking) a modeless
+ * selection at the more prompt. Use CTRL-Y,
+ * because the same is used in Cmdline-mode and at the
+ * hit-enter prompt. However, scrolling one line up
+ * might be expected... */
+ if (clip_star.state == SELECT_DONE)
+ clip_copy_modeless_selection(TRUE);
+ continue;
+#endif
+ default: /* no valid response */
+ msg_moremsg(TRUE);
+ continue;
+ }
+ break;
+ }
+
+ /* clear the --more-- message */
+ screen_fill((int)Rows - 1, (int)Rows,
+ 0, (int)Columns, ' ', ' ', 0);
+ State = oldState;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ if (quit_more)
+ {
+ msg_row = Rows - 1;
+ msg_col = 0;
+ return; /* the string is not displayed! */
+ }
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ msg_col = Columns - 1;
+#endif
+ }
+ }
+
+ if (t_col > 0
+ && (vim_strchr((char_u *)"\n\r\b\t", *s) != NULL
+ || *s == BELL
+ || msg_col + t_col >= Columns
+#ifdef FEAT_MBYTE
+ || (has_mbyte && (*mb_ptr2cells)(s) > 1
+ && msg_col + t_col >= Columns - 1)
+#endif
+ ))
+ {
+ /* output any postponed text */
+ t_puts(t_col, t_s, s, attr);
+ t_col = 0;
+ }
+
+ if (*s == '\n') /* go to next line */
+ {
+ msg_didout = FALSE; /* remember that line is empty */
+ msg_col = 0;
+ if (++msg_row >= Rows) /* safety check */
+ msg_row = Rows - 1;
+ }
+ else if (*s == '\r') /* go to column 0 */
+ {
+ msg_col = 0;
+ }
+ else if (*s == '\b') /* go to previous char */
+ {
+ if (msg_col)
+ --msg_col;
+ }
+ else if (*s == TAB) /* translate into spaces */
+ {
+ do
+ msg_screen_putchar(' ', attr);
+ while (msg_col & 7);
+ }
+ else if (*s == BELL) /* beep (from ":sh") */
+ vim_beep();
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ cw = (*mb_ptr2cells)(s);
+ if (enc_utf8 && maxlen >= 0)
+ /* avoid including composing chars after the end */
+ l = utfc_ptr2len_check_len(s, (int)((str + maxlen) - s));
+ else
+ l = (*mb_ptr2len_check)(s);
+ }
+ else
+ {
+ cw = 1;
+ l = 1;
+ }
+#endif
+ /* When drawing from right to left or when a double-wide character
+ * doesn't fit, draw a single character here. Otherwise collect
+ * characters and draw them all at once later. */
+#if defined(FEAT_RIGHTLEFT) || defined(FEAT_MBYTE)
+ if (
+# ifdef FEAT_RIGHTLEFT
+ cmdmsg_rl
+# ifdef FEAT_MBYTE
+ ||
+# endif
+# endif
+# ifdef FEAT_MBYTE
+ (cw > 1 && msg_col + t_col >= Columns - 1)
+# endif
+ )
+ {
+# ifdef FEAT_MBYTE
+ if (l > 1)
+ s = screen_puts_mbyte(s, l, attr) - 1;
+ else
+# endif
+ msg_screen_putchar(*s, attr);
+ }
+ else
+#endif
+ {
+ /* postpone this character until later */
+ if (t_col == 0)
+ t_s = s;
+#ifdef FEAT_MBYTE
+ t_col += cw;
+ s += l - 1;
+#else
+ ++t_col;
+#endif
+ }
+ }
+ ++s;
+ }
+
+ /* output any postponed text */
+ if (t_col > 0)
+ t_puts(t_col, t_s, s, attr);
+
+ msg_check();
+}
+
+/*
+ * Output any postponed text for msg_puts_attr_len().
+ */
+ static void
+t_puts(t_col, t_s, s, attr)
+ int t_col;
+ char_u *t_s;
+ char_u *s;
+ int attr;
+{
+ /* output postponed text */
+ msg_didout = TRUE; /* remember that line is not empty */
+ screen_puts_len(t_s, (int)(s - t_s), msg_row, msg_col, attr);
+ msg_col += t_col;
+#ifdef FEAT_MBYTE
+ /* If the string starts with a composing character don't increment the
+ * column position for it. */
+ if (enc_utf8 && utf_iscomposing(utf_ptr2char(t_s)))
+ --msg_col;
+#endif
+ if (msg_col >= Columns)
+ {
+ msg_col = 0;
+ ++msg_row;
+ }
+}
+
+
+/*
+ * Returns TRUE when messages should be printed with mch_errmsg().
+ * This is used when there is no valid screen, so we can see error messages.
+ * If termcap is not active, we may be writing in an alternate console
+ * window, cursor positioning may not work correctly (window size may be
+ * different, e.g. for Win32 console) or we just don't know where the
+ * cursor is.
+ */
+ int
+msg_use_printf()
+{
+ return (!msg_check_screen()
+#if defined(WIN3264) && !defined(FEAT_GUI_MSWIN)
+ || !termcap_active
+#endif
+ || (swapping_screen() && !termcap_active)
+ );
+}
+
+#if defined(USE_MCH_ERRMSG) || defined(PROTO)
+
+#ifdef mch_errmsg
+# undef mch_errmsg
+#endif
+#ifdef mch_msg
+# undef mch_msg
+#endif
+
+/*
+ * Give an error message. To be used when the screen hasn't been initialized
+ * yet. When stderr can't be used, collect error messages until the GUI has
+ * started and they can be displayed in a message box.
+ */
+ void
+mch_errmsg(str)
+ char *str;
+{
+ int len;
+
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI)
+ /* On Unix use stderr if it's a tty.
+ * When not going to start the GUI also use stderr.
+ * On Mac, when started from Finder, stderr is the console. */
+ if (
+# ifdef UNIX
+# ifdef MACOS_X_UNIX
+ (isatty(2) && strcmp("/dev/console", ttyname(2)) != 0)
+# else
+ isatty(2)
+# endif
+# ifdef FEAT_GUI
+ ||
+# endif
+# endif
+# ifdef FEAT_GUI
+ !(gui.in_use || gui.starting)
+# endif
+ )
+ {
+ fprintf(stderr, "%s", str);
+ return;
+ }
+#endif
+
+ /* avoid a delay for a message that isn't there */
+ emsg_on_display = FALSE;
+
+ len = (int)STRLEN(str) + 1;
+ if (error_ga.ga_growsize == 0)
+ {
+ error_ga.ga_growsize = 80;
+ error_ga.ga_itemsize = 1;
+ }
+ if (ga_grow(&error_ga, len) == OK)
+ {
+ mch_memmove((char_u *)error_ga.ga_data + error_ga.ga_len,
+ (char_u *)str, len);
+#ifdef UNIX
+ /* remove CR characters, they are displayed */
+ {
+ char_u *p;
+
+ p = (char_u *)error_ga.ga_data + error_ga.ga_len;
+ for (;;)
+ {
+ p = vim_strchr(p, '\r');
+ if (p == NULL)
+ break;
+ *p = ' ';
+ }
+ }
+#endif
+ --len; /* don't count the NUL at the end */
+ error_ga.ga_len += len;
+ error_ga.ga_room -= len;
+ }
+}
+
+/*
+ * Give a message. To be used when the screen hasn't been initialized yet.
+ * When there is no tty, collect messages until the GUI has started and they
+ * can be displayed in a message box.
+ */
+ void
+mch_msg(str)
+ char *str;
+{
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI)
+ /* On Unix use stdout if we have a tty. This allows "vim -h | more" and
+ * uses mch_errmsg() when started from the desktop.
+ * When not going to start the GUI also use stdout.
+ * On Mac, when started from Finder, stderr is the console. */
+ if (
+# ifdef UNIX
+# ifdef MACOS_X_UNIX
+ (isatty(2) && strcmp("/dev/console", ttyname(2)) != 0)
+# else
+ isatty(2)
+# endif
+# ifdef FEAT_GUI
+ ||
+# endif
+# endif
+# ifdef FEAT_GUI
+ !(gui.in_use || gui.starting)
+# endif
+ )
+ {
+ printf("%s", str);
+ return;
+ }
+# endif
+ mch_errmsg(str);
+}
+#endif /* USE_MCH_ERRMSG */
+
+/*
+ * Put a character on the screen at the current message position and advance
+ * to the next position. Only for printable ASCII!
+ */
+ static void
+msg_screen_putchar(c, attr)
+ int c;
+ int attr;
+{
+ msg_didout = TRUE; /* remember that line is not empty */
+ screen_putchar(c, msg_row, msg_col, attr);
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ {
+ if (--msg_col == 0)
+ {
+ msg_col = Columns;
+ ++msg_row;
+ }
+ }
+ else
+#endif
+ {
+ if (++msg_col >= Columns)
+ {
+ msg_col = 0;
+ ++msg_row;
+ }
+ }
+}
+
+ void
+msg_moremsg(full)
+ int full;
+{
+ int attr;
+
+ attr = hl_attr(HLF_M);
+ screen_puts((char_u *)_("-- More --"), (int)Rows - 1, 0, attr);
+ if (full)
+ screen_puts(more_back_used
+ ? (char_u *)_(" (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)")
+ : (char_u *)_(" (RET: line, SPACE: page, d: half page, q: quit)"),
+ (int)Rows - 1, 10, attr);
+}
+
+/*
+ * Repeat the message for the current mode: ASKMORE, EXTERNCMD, CONFIRM or
+ * exmode_active.
+ */
+ void
+repeat_message()
+{
+ if (State == ASKMORE)
+ {
+ msg_moremsg(TRUE); /* display --more-- message again */
+ msg_row = Rows - 1;
+ }
+#ifdef FEAT_CON_DIALOG
+ else if (State == CONFIRM)
+ {
+ display_confirm_msg(); /* display ":confirm" message again */
+ msg_row = Rows - 1;
+ }
+#endif
+ else if (State == EXTERNCMD)
+ {
+ windgoto(msg_row, msg_col); /* put cursor back */
+ }
+ else if (State == HITRETURN || State == SETWSIZE)
+ {
+ hit_return_msg();
+ msg_row = Rows - 1;
+ }
+}
+
+/*
+ * msg_check_screen - check if the screen is initialized.
+ * Also check msg_row and msg_col, if they are too big it may cause a crash.
+ * While starting the GUI the terminal codes will be set for the GUI, but the
+ * output goes to the terminal. Don't use the terminal codes then.
+ */
+ static int
+msg_check_screen()
+{
+ if (!full_screen || !screen_valid(FALSE))
+ return FALSE;
+
+ if (msg_row >= Rows)
+ msg_row = Rows - 1;
+ if (msg_col >= Columns)
+ msg_col = Columns - 1;
+ return TRUE;
+}
+
+/*
+ * Clear from current message position to end of screen.
+ * Skip this when ":silent" was used, no need to clear for redirection.
+ */
+ void
+msg_clr_eos()
+{
+ if (msg_silent == 0)
+ msg_clr_eos_force();
+}
+
+/*
+ * Clear from current message position to end of screen.
+ * Note: msg_col is not updated, so we remember the end of the message
+ * for msg_check().
+ */
+ void
+msg_clr_eos_force()
+{
+ if (msg_use_printf())
+ {
+ if (full_screen) /* only when termcap codes are valid */
+ {
+ if (*T_CD)
+ out_str(T_CD); /* clear to end of display */
+ else if (*T_CE)
+ out_str(T_CE); /* clear to end of line */
+ }
+ }
+ else
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (cmdmsg_rl)
+ {
+ screen_fill(msg_row, msg_row + 1, 0, msg_col + 1, ' ', ' ', 0);
+ screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
+ }
+ else
+#endif
+ {
+ screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns,
+ ' ', ' ', 0);
+ screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
+ }
+ }
+}
+
+/*
+ * Clear the command line.
+ */
+ void
+msg_clr_cmdline()
+{
+ msg_row = cmdline_row;
+ msg_col = 0;
+ msg_clr_eos_force();
+}
+
+/*
+ * end putting a message on the screen
+ * call wait_return if the message does not fit in the available space
+ * return TRUE if wait_return not called.
+ */
+ int
+msg_end()
+{
+ /*
+ * if the string is larger than the window,
+ * or the ruler option is set and we run into it,
+ * we have to redraw the window.
+ * Do not do this if we are abandoning the file or editing the command line.
+ */
+ if (!exiting && need_wait_return && !(State & CMDLINE))
+ {
+ wait_return(FALSE);
+ return FALSE;
+ }
+ out_flush();
+ return TRUE;
+}
+
+/*
+ * If the written message runs into the shown command or ruler, we have to
+ * wait for hit-return and redraw the window later.
+ */
+ void
+msg_check()
+{
+ if (msg_row == Rows - 1 && msg_col >= sc_col)
+ {
+ need_wait_return = TRUE;
+ redraw_cmdline = TRUE;
+ }
+}
+
+/*
+ * May write a string to the redirection file.
+ * When "maxlen" is -1 write the whole string, otherwise up to "maxlen" bytes.
+ */
+ static void
+redir_write(str, maxlen)
+ char_u *str;
+ int maxlen;
+{
+ char_u *s = str;
+ static int cur_col = 0;
+
+ if ((redir_fd != NULL
+#ifdef FEAT_EVAL
+ || redir_reg
+#endif
+ ) && !redir_off)
+ {
+ /* If the string doesn't start with CR or NL, go to msg_col */
+ if (*s != '\n' && *s != '\r')
+ {
+ while (cur_col < msg_col)
+ {
+#ifdef FEAT_EVAL
+ if (redir_reg)
+ write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE);
+ else if (redir_fd)
+#endif
+ fputs(" ", redir_fd);
+ ++cur_col;
+ }
+ }
+
+#ifdef FEAT_EVAL
+ if (redir_reg)
+ write_reg_contents(redir_reg, s, maxlen, TRUE);
+#endif
+
+ /* Adjust the current column */
+ while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
+ {
+#ifdef FEAT_EVAL
+ if (!redir_reg && redir_fd != NULL)
+#endif
+ putc(*s, redir_fd);
+ if (*s == '\r' || *s == '\n')
+ cur_col = 0;
+ else if (*s == '\t')
+ cur_col += (8 - cur_col % 8);
+ else
+ ++cur_col;
+ ++s;
+ }
+
+ if (msg_silent != 0) /* should update msg_col */
+ msg_col = cur_col;
+ }
+}
+
+/*
+ * Give a warning message (for searching).
+ * Use 'w' highlighting and may repeat the message after redrawing
+ */
+ void
+give_warning(message, hl)
+ char_u *message;
+ int hl;
+{
+ /* Don't do this for ":silent". */
+ if (msg_silent != 0)
+ return;
+
+ /* Don't want a hit-enter prompt here. */
+ ++no_wait_return;
+#ifdef FEAT_EVAL
+ set_vim_var_string(VV_WARNINGMSG, message, -1);
+#endif
+#ifdef VIMBUDDY
+ VimBuddyText(message, 1);
+#else
+ vim_free(keep_msg);
+ keep_msg = NULL;
+ if (hl)
+ keep_msg_attr = hl_attr(HLF_W);
+ else
+ keep_msg_attr = 0;
+ if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0)
+ set_keep_msg(message);
+ msg_didout = FALSE; /* overwrite this message */
+ msg_nowait = TRUE; /* don't wait for this message */
+ msg_col = 0;
+#endif
+ --no_wait_return;
+}
+
+/*
+ * Advance msg cursor to column "col".
+ */
+ void
+msg_advance(col)
+ int col;
+{
+ if (msg_silent != 0) /* nothing to advance to */
+ {
+ msg_col = col; /* for redirection, may fill it up later */
+ return;
+ }
+ if (col >= Columns) /* not enough room */
+ col = Columns - 1;
+ while (msg_col < col)
+ msg_putchar(' ');
+}
+
+#if defined(FEAT_CON_DIALOG) || defined(PROTO)
+/*
+ * Used for "confirm()" function, and the :confirm command prefix.
+ * Versions which haven't got flexible dialogs yet, and console
+ * versions, get this generic handler which uses the command line.
+ *
+ * type = one of:
+ * VIM_QUESTION, VIM_INFO, VIM_WARNING, VIM_ERROR or VIM_GENERIC
+ * title = title string (can be NULL for default)
+ * (neither used in console dialogs at the moment)
+ *
+ * Format of the "buttons" string:
+ * "Button1Name\nButton2Name\nButton3Name"
+ * The first button should normally be the default/accept
+ * The second button should be the 'Cancel' button
+ * Other buttons- use your imagination!
+ * A '&' in a button name becomes a shortcut, so each '&' should be before a
+ * different letter.
+ */
+/* ARGSUSED */
+ int
+do_dialog(type, title, message, buttons, dfltbutton, textfield)
+ int type;
+ char_u *title;
+ char_u *message;
+ char_u *buttons;
+ int dfltbutton;
+ char_u *textfield; /* IObuff for inputdialog(), NULL otherwise */
+{
+ int oldState;
+ int retval = 0;
+ char_u *hotkeys;
+ int c;
+ int i;
+
+#ifndef NO_CONSOLE
+ /* Don't output anything in silent mode ("ex -s") */
+ if (silent_mode)
+ return dfltbutton; /* return default option */
+#endif
+
+#ifdef FEAT_GUI_DIALOG
+ /* When GUI is running and 'c' not in 'guioptions', use the GUI dialog */
+ if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL)
+ {
+ c = gui_mch_dialog(type, title, message, buttons, dfltbutton,
+ textfield);
+ msg_end_prompt();
+
+ /* Flush output to avoid that further messages and redrawing is done
+ * in the wrong order. */
+ out_flush();
+ gui_mch_update();
+
+ return c;
+ }
+#endif
+
+ oldState = State;
+ State = CONFIRM;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+
+ /*
+ * Since we wait for a keypress, don't make the
+ * user press RETURN as well afterwards.
+ */
+ ++no_wait_return;
+ hotkeys = msg_show_console_dialog(message, buttons, dfltbutton);
+
+ if (hotkeys != NULL)
+ {
+ for (;;)
+ {
+ /* Get a typed character directly from the user. */
+ c = get_keystroke();
+ switch (c)
+ {
+ case CAR: /* User accepts default option */
+ case NL:
+ retval = dfltbutton;
+ break;
+ case Ctrl_C: /* User aborts/cancels */
+ case ESC:
+ retval = 0;
+ break;
+ default: /* Could be a hotkey? */
+ if (c < 0) /* special keys are ignored here */
+ continue;
+ /* Make the character lowercase, as chars in "hotkeys" are. */
+ c = MB_TOLOWER(c);
+ retval = 1;
+ for (i = 0; hotkeys[i]; ++i)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ if ((*mb_ptr2char)(hotkeys + i) == c)
+ break;
+ i += (*mb_ptr2len_check)(hotkeys + i) - 1;
+ }
+ else
+#endif
+ if (hotkeys[i] == c)
+ break;
+ ++retval;
+ }
+ if (hotkeys[i])
+ break;
+ /* No hotkey match, so keep waiting */
+ continue;
+ }
+ break;
+ }
+
+ vim_free(hotkeys);
+ }
+
+ State = oldState;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ --no_wait_return;
+ msg_end_prompt();
+
+ return retval;
+}
+
+static int copy_char __ARGS((char_u *from, char_u *to, int lowercase));
+
+/*
+ * Copy one character from "*from" to "*to", taking care of multi-byte
+ * characters. Return the length of the character in bytes.
+ */
+ static int
+copy_char(from, to, lowercase)
+ char_u *from;
+ char_u *to;
+ int lowercase; /* make character lower case */
+{
+#ifdef FEAT_MBYTE
+ int len;
+ int c;
+
+ if (has_mbyte)
+ {
+ if (lowercase)
+ {
+ c = MB_TOLOWER((*mb_ptr2char)(from));
+ return (*mb_char2bytes)(c, to);
+ }
+ else
+ {
+ len = (*mb_ptr2len_check)(from);
+ mch_memmove(to, from, (size_t)len);
+ return len;
+ }
+ }
+ else
+#endif
+ {
+ if (lowercase)
+ *to = (char_u)TOLOWER_LOC(*from);
+ else
+ *to = *from;
+ return 1;
+ }
+}
+
+/*
+ * Format the dialog string, and display it at the bottom of
+ * the screen. Return a string of hotkey chars (if defined) for
+ * each 'button'. If a button has no hotkey defined, the first character of
+ * the button is used.
+ * The hotkeys can be multi-byte characters, but without combining chars.
+ *
+ * Returns an allocated string with hotkeys, or NULL for error.
+ */
+ static char_u *
+msg_show_console_dialog(message, buttons, dfltbutton)
+ char_u *message;
+ char_u *buttons;
+ int dfltbutton;
+{
+ int len = 0;
+#ifdef FEAT_MBYTE
+# define HOTK_LEN (has_mbyte ? MB_MAXBYTES : 1)
+#else
+# define HOTK_LEN 1
+#endif
+ int lenhotkey = HOTK_LEN; /* count first button */
+ char_u *hotk = NULL;
+ char_u *msgp = NULL;
+ char_u *hotkp = NULL;
+ char_u *r;
+ int copy;
+#define HAS_HOTKEY_LEN 30
+ char_u has_hotkey[HAS_HOTKEY_LEN];
+ int first_hotkey = FALSE; /* first char of button is hotkey */
+ int idx;
+
+ has_hotkey[0] = FALSE;
+
+ /*
+ * First loop: compute the size of memory to allocate.
+ * Second loop: copy to the allocated memory.
+ */
+ for (copy = 0; copy <= 1; ++copy)
+ {
+ r = buttons;
+ idx = 0;
+ while (*r)
+ {
+ if (*r == DLG_BUTTON_SEP)
+ {
+ if (copy)
+ {
+ *msgp++ = ',';
+ *msgp++ = ' '; /* '\n' -> ', ' */
+
+ /* advance to next hotkey and set default hotkey */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ hotkp += (*mb_ptr2len_check)(hotkp);
+ else
+#endif
+ ++hotkp;
+ (void)copy_char(r + 1, hotkp, TRUE);
+ if (dfltbutton)
+ --dfltbutton;
+
+ /* If no hotkey is specified first char is used. */
+ if (idx < HAS_HOTKEY_LEN - 1 && !has_hotkey[++idx])
+ first_hotkey = TRUE;
+ }
+ else
+ {
+ len += 3; /* '\n' -> ', '; 'x' -> '(x)' */
+ lenhotkey += HOTK_LEN; /* each button needs a hotkey */
+ if (idx < HAS_HOTKEY_LEN - 1)
+ has_hotkey[++idx] = FALSE;
+ }
+ }
+ else if (*r == DLG_HOTKEY_CHAR || first_hotkey)
+ {
+ if (*r == DLG_HOTKEY_CHAR)
+ ++r;
+ first_hotkey = FALSE;
+ if (copy)
+ {
+ if (*r == DLG_HOTKEY_CHAR) /* '&&a' -> '&a' */
+ *msgp++ = *r;
+ else
+ {
+ /* '&a' -> '[a]' */
+ *msgp++ = (dfltbutton == 1) ? '[' : '(';
+ msgp += copy_char(r, msgp, FALSE);
+ *msgp++ = (dfltbutton == 1) ? ']' : ')';
+
+ /* redefine hotkey */
+ (void)copy_char(r, hotkp, TRUE);
+ }
+ }
+ else
+ {
+ ++len; /* '&a' -> '[a]' */
+ if (idx < HAS_HOTKEY_LEN - 1)
+ has_hotkey[idx] = TRUE;
+ }
+ }
+ else
+ {
+ /* everything else copy literally */
+ if (copy)
+ msgp += copy_char(r, msgp, FALSE);
+ }
+
+ /* advance to the next character */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ r += (*mb_ptr2len_check)(r);
+ else
+#endif
+ ++r;
+ }
+
+ if (copy)
+ {
+ *msgp++ = ':';
+ *msgp++ = ' ';
+ *msgp = NUL;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ hotkp += (*mb_ptr2len_check)(hotkp);
+ else
+#endif
+ ++hotkp;
+ *hotkp = NUL;
+ }
+ else
+ {
+ len += STRLEN(message)
+ + 2 /* for the NL's */
+ + STRLEN(buttons)
+ + 3; /* for the ": " and NUL */
+ lenhotkey++; /* for the NUL */
+
+ /* If no hotkey is specified first char is used. */
+ if (!has_hotkey[0])
+ {
+ first_hotkey = TRUE;
+ len += 2; /* "x" -> "[x]" */
+ }
+
+ /*
+ * Now allocate and load the strings
+ */
+ vim_free(confirm_msg);
+ confirm_msg = alloc(len);
+ if (confirm_msg == NULL)
+ return NULL;
+ *confirm_msg = NUL;
+ hotk = alloc(lenhotkey);
+ if (hotk == NULL)
+ return NULL;
+
+ *confirm_msg = '\n';
+ STRCPY(confirm_msg + 1, message);
+
+ msgp = confirm_msg + 1 + STRLEN(message);
+ hotkp = hotk;
+
+ /* define first default hotkey */
+ (void)copy_char(buttons, hotkp, TRUE);
+
+ /* Remember where the choices start, displaying starts here when
+ * "hotkp" typed at the more prompt. */
+ confirm_msg_tail = msgp;
+ *msgp++ = '\n';
+ }
+ }
+
+ display_confirm_msg();
+ return hotk;
+}
+
+/*
+ * Display the ":confirm" message. Also called when screen resized.
+ */
+ void
+display_confirm_msg()
+{
+ /* avoid that 'q' at the more prompt truncates the message here */
+ ++confirm_msg_used;
+ if (confirm_msg != NULL)
+ msg_puts_attr(confirm_msg, hl_attr(HLF_M));
+ --confirm_msg_used;
+}
+
+#endif /* FEAT_CON_DIALOG */
+
+#if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
+
+ int
+vim_dialog_yesno(type, title, message, dflt)
+ int type;
+ char_u *title;
+ char_u *message;
+ int dflt;
+{
+ if (do_dialog(type,
+ title == NULL ? (char_u *)_("Question") : title,
+ message,
+ (char_u *)_("&Yes\n&No"), dflt, NULL) == 1)
+ return VIM_YES;
+ return VIM_NO;
+}
+
+ int
+vim_dialog_yesnocancel(type, title, message, dflt)
+ int type;
+ char_u *title;
+ char_u *message;
+ int dflt;
+{
+ switch (do_dialog(type,
+ title == NULL ? (char_u *)_("Question") : title,
+ message,
+ (char_u *)_("&Yes\n&No\n&Cancel"), dflt, NULL))
+ {
+ case 1: return VIM_YES;
+ case 2: return VIM_NO;
+ }
+ return VIM_CANCEL;
+}
+
+ int
+vim_dialog_yesnoallcancel(type, title, message, dflt)
+ int type;
+ char_u *title;
+ char_u *message;
+ int dflt;
+{
+ switch (do_dialog(type,
+ title == NULL ? (char_u *)"Question" : title,
+ message,
+ (char_u *)_("&Yes\n&No\nSave &All\n&Discard All\n&Cancel"),
+ dflt, NULL))
+ {
+ case 1: return VIM_YES;
+ case 2: return VIM_NO;
+ case 3: return VIM_ALL;
+ case 4: return VIM_DISCARDALL;
+ }
+ return VIM_CANCEL;
+}
+
+#endif /* FEAT_GUI_DIALOG || FEAT_CON_DIALOG */
+
+#if defined(FEAT_BROWSE) || defined(PROTO)
+/*
+ * Generic browse function. Calls gui_mch_browse() when possible.
+ * Later this may pop-up a non-GUI file selector (external command?).
+ */
+ char_u *
+do_browse(saving, title, dflt, ext, initdir, filter, buf)
+ int saving; /* write action */
+ char_u *title; /* title for the window */
+ char_u *dflt; /* default file name (may include directory) */
+ char_u *ext; /* extension added */
+ char_u *initdir; /* initial directory, NULL for current dir or
+ when using path from "dflt" */
+ char_u *filter; /* file name filter */
+ buf_T *buf; /* buffer to read/write for */
+{
+ char_u *fname;
+ static char_u *last_dir = NULL; /* last used directory */
+ char_u *tofree = NULL;
+ int save_browse = cmdmod.browse;
+
+ /* Must turn off browse to avoid that autocommands will get the
+ * flag too! */
+ cmdmod.browse = FALSE;
+
+ if (title == NULL)
+ {
+ if (saving)
+ title = (char_u *)_("Save File dialog");
+ else
+ title = (char_u *)_("Open File dialog");
+ }
+
+ /* When no directory specified, use default file name, default dir, buffer
+ * dir, last dir or current dir */
+ if ((initdir == NULL || *initdir == NUL) && dflt != NULL && *dflt != NUL)
+ {
+ if (mch_isdir(dflt)) /* default file name is a directory */
+ {
+ initdir = dflt;
+ dflt = NULL;
+ }
+ else if (gettail(dflt) != dflt) /* default file name includes a path */
+ {
+ tofree = vim_strsave(dflt);
+ if (tofree != NULL)
+ {
+ initdir = tofree;
+ *gettail(initdir) = NUL;
+ dflt = gettail(dflt);
+ }
+ }
+ }
+
+ if (initdir == NULL || *initdir == NUL)
+ {
+ /* When 'browsedir' is a directory, use it */
+ if (mch_isdir(p_bsdir))
+ initdir = p_bsdir;
+ /* When saving or 'browsedir' is "buffer", use buffer fname */
+ else if ((saving || *p_bsdir == 'b')
+ && buf != NULL && buf->b_ffname != NULL)
+ {
+ if (dflt == NULL || *dflt == NUL)
+ dflt = gettail(curbuf->b_ffname);
+ tofree = vim_strsave(curbuf->b_ffname);
+ if (tofree != NULL)
+ {
+ initdir = tofree;
+ *gettail(initdir) = NUL;
+ }
+ }
+ /* When 'browsedir' is "last", use dir from last browse */
+ else if (*p_bsdir == 'l')
+ initdir = last_dir;
+ /* When 'browsedir is "current", use current directory. This is the
+ * default already, leave initdir empty. */
+ }
+
+# ifdef FEAT_GUI
+ if (gui.in_use) /* when this changes, also adjust f_has()! */
+ {
+ if (filter == NULL
+# ifdef FEAT_EVAL
+ && (filter = get_var_value((char_u *)"b:browsefilter")) == NULL
+ && (filter = get_var_value((char_u *)"g:browsefilter")) == NULL
+# endif
+ )
+ filter = BROWSE_FILTER_DEFAULT;
+ fname = gui_mch_browse(saving, title, dflt, ext, initdir, filter);
+
+ /* We hang around in the dialog for a while, the user might do some
+ * things to our files. The Win32 dialog allows deleting or renaming
+ * a file, check timestamps. */
+ need_check_timestamps = TRUE;
+ did_check_timestamps = FALSE;
+ }
+ else
+# endif
+ {
+ /* TODO: non-GUI file selector here */
+ EMSG(_("E338: Sorry, no file browser in console mode"));
+ fname = NULL;
+ }
+
+ /* keep the directory for next time */
+ if (fname != NULL)
+ {
+ vim_free(last_dir);
+ last_dir = vim_strsave(fname);
+ if (last_dir != NULL)
+ {
+ *gettail(last_dir) = NUL;
+ if (*last_dir == NUL)
+ {
+ /* filename only returned, must be in current dir */
+ vim_free(last_dir);
+ last_dir = alloc(MAXPATHL);
+ if (last_dir != NULL)
+ mch_dirname(last_dir, MAXPATHL);
+ }
+ }
+ }
+
+ vim_free(tofree);
+ cmdmod.browse = save_browse;
+
+ return fname;
+}
+#endif
diff --git a/src/misc1.c b/src/misc1.c
new file mode 100644
index 000000000..0e0705dbd
--- /dev/null
+++ b/src/misc1.c
@@ -0,0 +1,8455 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * misc1.c: functions that didn't seem to fit elsewhere
+ */
+
+#include "vim.h"
+#include "version.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* for chdir() */
+#endif
+
+static char_u *vim_version_dir __ARGS((char_u *vimdir));
+static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name));
+#if defined(USE_EXE_NAME) && defined(MACOS_X)
+static char_u *remove_tail_with_ext __ARGS((char_u *p, char_u *pend, char_u *ext));
+#endif
+static int get_indent_str __ARGS((char_u *ptr, int ts));
+static int copy_indent __ARGS((int size, char_u *src));
+
+/*
+ * Count the size (in window cells) of the indent in the current line.
+ */
+ int
+get_indent()
+{
+ return get_indent_str(ml_get_curline(), (int)curbuf->b_p_ts);
+}
+
+/*
+ * Count the size (in window cells) of the indent in line "lnum".
+ */
+ int
+get_indent_lnum(lnum)
+ linenr_T lnum;
+{
+ return get_indent_str(ml_get(lnum), (int)curbuf->b_p_ts);
+}
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+/*
+ * Count the size (in window cells) of the indent in line "lnum" of buffer
+ * "buf".
+ */
+ int
+get_indent_buf(buf, lnum)
+ buf_T *buf;
+ linenr_T lnum;
+{
+ return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts);
+}
+#endif
+
+/*
+ * count the size (in window cells) of the indent in line "ptr", with
+ * 'tabstop' at "ts"
+ */
+ static int
+get_indent_str(ptr, ts)
+ char_u *ptr;
+ int ts;
+{
+ int count = 0;
+
+ for ( ; *ptr; ++ptr)
+ {
+ if (*ptr == TAB) /* count a tab for what it is worth */
+ count += ts - (count % ts);
+ else if (*ptr == ' ')
+ ++count; /* count a space for one */
+ else
+ break;
+ }
+ return (count);
+}
+
+/*
+ * Set the indent of the current line.
+ * Leaves the cursor on the first non-blank in the line.
+ * Caller must take care of undo.
+ * "flags":
+ * SIN_CHANGED: call changed_bytes() if the line was changed.
+ * SIN_INSERT: insert the indent in front of the line.
+ * SIN_UNDO: save line for undo before changing it.
+ * Returns TRUE if the line was changed.
+ */
+ int
+set_indent(size, flags)
+ int size;
+ int flags;
+{
+ char_u *p;
+ char_u *newline;
+ char_u *oldline;
+ char_u *s;
+ int todo;
+ int ind_len;
+ int line_len;
+ int doit = FALSE;
+ int ind_done;
+ int tab_pad;
+
+ /*
+ * First check if there is anything to do and compute the number of
+ * characters needed for the indent.
+ */
+ todo = size;
+ ind_len = 0;
+ p = oldline = ml_get_curline();
+
+ /* Calculate the buffer size for the new indent, and check to see if it
+ * isn't already set */
+
+ /* if 'expandtab' isn't set: use TABs */
+ if (!curbuf->b_p_et)
+ {
+ /* If 'preserveindent' is set then reuse as much as possible of
+ * the existing indent structure for the new indent */
+ if (!(flags & SIN_INSERT) && curbuf->b_p_pi)
+ {
+ ind_done = 0;
+
+ /* count as many characters as we can use */
+ while (todo > 0 && vim_iswhite(*p))
+ {
+ if (*p == TAB)
+ {
+ tab_pad = (int)curbuf->b_p_ts
+ - (ind_done % (int)curbuf->b_p_ts);
+ /* stop if this tab will overshoot the target */
+ if (todo < tab_pad)
+ break;
+ todo -= tab_pad;
+ ++ind_len;
+ ind_done += tab_pad;
+ }
+ else
+ {
+ --todo;
+ ++ind_len;
+ ++ind_done;
+ }
+ ++p;
+ }
+
+ /* Fill to next tabstop with a tab, if possible */
+ tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
+ if (todo >= tab_pad)
+ {
+ doit = TRUE;
+ todo -= tab_pad;
+ ++ind_len;
+ /* ind_done += tab_pad; */
+ }
+ }
+
+ /* count tabs required for indent */
+ while (todo >= (int)curbuf->b_p_ts)
+ {
+ if (*p != TAB)
+ doit = TRUE;
+ else
+ ++p;
+ todo -= (int)curbuf->b_p_ts;
+ ++ind_len;
+ /* ind_done += (int)curbuf->b_p_ts; */
+ }
+ }
+ /* count spaces required for indent */
+ while (todo > 0)
+ {
+ if (*p != ' ')
+ doit = TRUE;
+ else
+ ++p;
+ --todo;
+ ++ind_len;
+ /* ++ind_done; */
+ }
+
+ /* Return if the indent is OK already. */
+ if (!doit && !vim_iswhite(*p) && !(flags & SIN_INSERT))
+ return FALSE;
+
+ /* Allocate memory for the new line. */
+ if (flags & SIN_INSERT)
+ p = oldline;
+ else
+ p = skipwhite(p);
+ line_len = (int)STRLEN(p) + 1;
+ newline = alloc(ind_len + line_len);
+ if (newline == NULL)
+ return FALSE;
+
+ /* Put the characters in the new line. */
+ s = newline;
+ todo = size;
+ /* if 'expandtab' isn't set: use TABs */
+ if (!curbuf->b_p_et)
+ {
+ /* If 'preserveindent' is set then reuse as much as possible of
+ * the existing indent structure for the new indent */
+ if (!(flags & SIN_INSERT) && curbuf->b_p_pi)
+ {
+ p = oldline;
+ ind_done = 0;
+
+ while (todo > 0 && vim_iswhite(*p))
+ {
+ if (*p == TAB)
+ {
+ tab_pad = (int)curbuf->b_p_ts
+ - (ind_done % (int)curbuf->b_p_ts);
+ /* stop if this tab will overshoot the target */
+ if (todo < tab_pad)
+ break;
+ todo -= tab_pad;
+ ind_done += tab_pad;
+ }
+ else
+ {
+ --todo;
+ ++ind_done;
+ }
+ *s++ = *p++;
+ }
+
+ /* Fill to next tabstop with a tab, if possible */
+ tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
+ if (todo >= tab_pad)
+ {
+ *s++ = TAB;
+ todo -= tab_pad;
+ }
+
+ p = skipwhite(p);
+ }
+
+ while (todo >= (int)curbuf->b_p_ts)
+ {
+ *s++ = TAB;
+ todo -= (int)curbuf->b_p_ts;
+ }
+ }
+ while (todo > 0)
+ {
+ *s++ = ' ';
+ --todo;
+ }
+ mch_memmove(s, p, (size_t)line_len);
+
+ /* Replace the line (unless undo fails). */
+ if (!(flags & SIN_UNDO) || u_savesub(curwin->w_cursor.lnum) == OK)
+ {
+ ml_replace(curwin->w_cursor.lnum, newline, FALSE);
+ if (flags & SIN_CHANGED)
+ changed_bytes(curwin->w_cursor.lnum, 0);
+ /* Correct saved cursor position if it's after the indent. */
+ if (saved_cursor.lnum == curwin->w_cursor.lnum
+ && saved_cursor.col >= (colnr_T)(p - oldline))
+ saved_cursor.col += ind_len - (p - oldline);
+ }
+ else
+ vim_free(newline);
+
+ curwin->w_cursor.col = ind_len;
+ return TRUE;
+}
+
+/*
+ * Copy the indent from ptr to the current line (and fill to size)
+ * Leaves the cursor on the first non-blank in the line.
+ * Returns TRUE if the line was changed.
+ */
+ static int
+copy_indent(size, src)
+ int size;
+ char_u *src;
+{
+ char_u *p = NULL;
+ char_u *line = NULL;
+ char_u *s;
+ int todo;
+ int ind_len;
+ int line_len = 0;
+ int tab_pad;
+ int ind_done;
+ int round;
+
+ /* Round 1: compute the number of characters needed for the indent
+ * Round 2: copy the characters. */
+ for (round = 1; round <= 2; ++round)
+ {
+ todo = size;
+ ind_len = 0;
+ ind_done = 0;
+ s = src;
+
+ /* Count/copy the usable portion of the source line */
+ while (todo > 0 && vim_iswhite(*s))
+ {
+ if (*s == TAB)
+ {
+ tab_pad = (int)curbuf->b_p_ts
+ - (ind_done % (int)curbuf->b_p_ts);
+ /* Stop if this tab will overshoot the target */
+ if (todo < tab_pad)
+ break;
+ todo -= tab_pad;
+ ind_done += tab_pad;
+ }
+ else
+ {
+ --todo;
+ ++ind_done;
+ }
+ ++ind_len;
+ if (round == 2)
+ *p++ = *s;
+ ++s;
+ }
+
+ /* Fill to next tabstop with a tab, if possible */
+ tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
+ if (todo >= tab_pad)
+ {
+ todo -= tab_pad;
+ ++ind_len;
+ if (round == 2)
+ *p++ = TAB;
+ }
+
+ /* Add tabs required for indent */
+ while (todo >= (int)curbuf->b_p_ts)
+ {
+ todo -= (int)curbuf->b_p_ts;
+ ++ind_len;
+ if (round == 2)
+ *p++ = TAB;
+ }
+
+ /* Count/add spaces required for indent */
+ while (todo > 0)
+ {
+ --todo;
+ ++ind_len;
+ if (round == 2)
+ *p++ = ' ';
+ }
+
+ if (round == 1)
+ {
+ /* Allocate memory for the result: the copied indent, new indent
+ * and the rest of the line. */
+ line_len = (int)STRLEN(ml_get_curline()) + 1;
+ line = alloc(ind_len + line_len);
+ if (line == NULL)
+ return FALSE;
+ p = line;
+ }
+ }
+
+ /* Append the original line */
+ mch_memmove(p, ml_get_curline(), (size_t)line_len);
+
+ /* Replace the line */
+ ml_replace(curwin->w_cursor.lnum, line, FALSE);
+
+ /* Put the cursor after the indent. */
+ curwin->w_cursor.col = ind_len;
+ return TRUE;
+}
+
+/*
+ * Return the indent of the current line after a number. Return -1 if no
+ * number was found. Used for 'n' in 'formatoptions': numbered list.
+ */
+ int
+get_number_indent(lnum)
+ linenr_T lnum;
+{
+ char_u *line;
+ char_u *p;
+ colnr_T col;
+ pos_T pos;
+
+ if (lnum > curbuf->b_ml.ml_line_count)
+ return -1;
+ line = ml_get(lnum);
+ p = skipwhite(line);
+ if (!VIM_ISDIGIT(*p))
+ return -1;
+ p = skipdigits(p);
+ if (vim_strchr((char_u *)":.)]}\t ", *p) == NULL)
+ return -1;
+ p = skipwhite(p + 1);
+ if (*p == NUL)
+ return -1;
+ pos.lnum = lnum;
+ pos.col = (colnr_T)(p - line);
+ getvcol(curwin, &pos, &col, NULL, NULL);
+ return (int)col;
+}
+
+#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
+
+static int cin_is_cinword __ARGS((char_u *line));
+
+/*
+ * Return TRUE if the string "line" starts with a word from 'cinwords'.
+ */
+ static int
+cin_is_cinword(line)
+ char_u *line;
+{
+ char_u *cinw;
+ char_u *cinw_buf;
+ int cinw_len;
+ int retval = FALSE;
+ int len;
+
+ cinw_len = (int)STRLEN(curbuf->b_p_cinw) + 1;
+ cinw_buf = alloc((unsigned)cinw_len);
+ if (cinw_buf != NULL)
+ {
+ line = skipwhite(line);
+ for (cinw = curbuf->b_p_cinw; *cinw; )
+ {
+ len = copy_option_part(&cinw, cinw_buf, cinw_len, ",");
+ if (STRNCMP(line, cinw_buf, len) == 0
+ && (!vim_iswordc(line[len]) || !vim_iswordc(line[len - 1])))
+ {
+ retval = TRUE;
+ break;
+ }
+ }
+ vim_free(cinw_buf);
+ }
+ return retval;
+}
+#endif
+
+/*
+ * open_line: Add a new line below or above the current line.
+ *
+ * For VREPLACE mode, we only add a new line when we get to the end of the
+ * file, otherwise we just start replacing the next line.
+ *
+ * Caller must take care of undo. Since VREPLACE may affect any number of
+ * lines however, it may call u_save_cursor() again when starting to change a
+ * new line.
+ * "flags": OPENLINE_DELSPACES delete spaces after cursor
+ * OPENLINE_DO_COM format comments
+ * OPENLINE_KEEPTRAIL keep trailing spaces
+ * OPENLINE_MARKFIX adjust mark positions after the line break
+ *
+ * Return TRUE for success, FALSE for failure
+ */
+ int
+open_line(dir, flags, old_indent)
+ int dir; /* FORWARD or BACKWARD */
+ int flags;
+ int old_indent; /* indent for after ^^D in Insert mode */
+{
+ char_u *saved_line; /* copy of the original line */
+ char_u *next_line = NULL; /* copy of the next line */
+ char_u *p_extra = NULL; /* what goes to next line */
+ int less_cols = 0; /* less columns for mark in new line */
+ int less_cols_off = 0; /* columns to skip for mark adjust */
+ pos_T old_cursor; /* old cursor position */
+ int newcol = 0; /* new cursor column */
+ int newindent = 0; /* auto-indent of the new line */
+ int n;
+ int trunc_line = FALSE; /* truncate current line afterwards */
+ int retval = FALSE; /* return value, default is FAIL */
+#ifdef FEAT_COMMENTS
+ int extra_len = 0; /* length of p_extra string */
+ int lead_len; /* length of comment leader */
+ char_u *lead_flags; /* position in 'comments' for comment leader */
+ char_u *leader = NULL; /* copy of comment leader */
+#endif
+ char_u *allocated = NULL; /* allocated memory */
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_VREPLACE) || defined(FEAT_LISP) \
+ || defined(FEAT_CINDENT) || defined(FEAT_COMMENTS)
+ char_u *p;
+#endif
+ int saved_char = NUL; /* init for GCC */
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_COMMENTS)
+ pos_T *pos;
+#endif
+#ifdef FEAT_SMARTINDENT
+ int do_si = (!p_paste && curbuf->b_p_si
+# ifdef FEAT_CINDENT
+ && !curbuf->b_p_cin
+# endif
+ );
+ int no_si = FALSE; /* reset did_si afterwards */
+ int first_char = NUL; /* init for GCC */
+#endif
+#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT))
+ int vreplace_mode;
+#endif
+ int did_append; /* appended a new line */
+ int saved_pi = curbuf->b_p_pi; /* copy of preserveindent setting */
+
+ /*
+ * make a copy of the current line so we can mess with it
+ */
+ saved_line = vim_strsave(ml_get_curline());
+ if (saved_line == NULL) /* out of memory! */
+ return FALSE;
+
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ /*
+ * With VREPLACE we make a copy of the next line, which we will be
+ * starting to replace. First make the new line empty and let vim play
+ * with the indenting and comment leader to its heart's content. Then
+ * we grab what it ended up putting on the new line, put back the
+ * original line, and call ins_char() to put each new character onto
+ * the line, replacing what was there before and pushing the right
+ * stuff onto the replace stack. -- webb.
+ */
+ if (curwin->w_cursor.lnum < orig_line_count)
+ next_line = vim_strsave(ml_get(curwin->w_cursor.lnum + 1));
+ else
+ next_line = vim_strsave((char_u *)"");
+ if (next_line == NULL) /* out of memory! */
+ goto theend;
+
+ /*
+ * In VREPLACE mode, a NL replaces the rest of the line, and starts
+ * replacing the next line, so push all of the characters left on the
+ * line onto the replace stack. We'll push any other characters that
+ * might be replaced at the start of the next line (due to autoindent
+ * etc) a bit later.
+ */
+ replace_push(NUL); /* Call twice because BS over NL expects it */
+ replace_push(NUL);
+ p = saved_line + curwin->w_cursor.col;
+ while (*p != NUL)
+ replace_push(*p++);
+ saved_line[curwin->w_cursor.col] = NUL;
+ }
+#endif
+
+ if ((State & INSERT)
+#ifdef FEAT_VREPLACE
+ && !(State & VREPLACE_FLAG)
+#endif
+ )
+ {
+ p_extra = saved_line + curwin->w_cursor.col;
+#ifdef FEAT_SMARTINDENT
+ if (do_si) /* need first char after new line break */
+ {
+ p = skipwhite(p_extra);
+ first_char = *p;
+ }
+#endif
+#ifdef FEAT_COMMENTS
+ extra_len = (int)STRLEN(p_extra);
+#endif
+ saved_char = *p_extra;
+ *p_extra = NUL;
+ }
+
+ u_clearline(); /* cannot do "U" command when adding lines */
+#ifdef FEAT_SMARTINDENT
+ did_si = FALSE;
+#endif
+ ai_col = 0;
+
+ /*
+ * If we just did an auto-indent, then we didn't type anything on
+ * the prior line, and it should be truncated. Do this even if 'ai' is not
+ * set because automatically inserting a comment leader also sets did_ai.
+ */
+ if (dir == FORWARD && did_ai)
+ trunc_line = TRUE;
+
+ /*
+ * If 'autoindent' and/or 'smartindent' is set, try to figure out what
+ * indent to use for the new line.
+ */
+ if (curbuf->b_p_ai
+#ifdef FEAT_SMARTINDENT
+ || do_si
+#endif
+ )
+ {
+ /*
+ * count white space on current line
+ */
+ newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts);
+ if (newindent == 0)
+ newindent = old_indent; /* for ^^D command in insert mode */
+
+#ifdef FEAT_SMARTINDENT
+ /*
+ * Do smart indenting.
+ * In insert/replace mode (only when dir == FORWARD)
+ * we may move some text to the next line. If it starts with '{'
+ * don't add an indent. Fixes inserting a NL before '{' in line
+ * "if (condition) {"
+ */
+ if (!trunc_line && do_si && *saved_line != NUL
+ && (p_extra == NULL || first_char != '{'))
+ {
+ char_u *ptr;
+ char_u last_char;
+
+ old_cursor = curwin->w_cursor;
+ ptr = saved_line;
+# ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+ lead_len = get_leader_len(ptr, NULL, FALSE);
+ else
+ lead_len = 0;
+# endif
+ if (dir == FORWARD)
+ {
+ /*
+ * Skip preprocessor directives, unless they are
+ * recognised as comments.
+ */
+ if (
+# ifdef FEAT_COMMENTS
+ lead_len == 0 &&
+# endif
+ ptr[0] == '#')
+ {
+ while (ptr[0] == '#' && curwin->w_cursor.lnum > 1)
+ ptr = ml_get(--curwin->w_cursor.lnum);
+ newindent = get_indent();
+ }
+# ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+ lead_len = get_leader_len(ptr, NULL, FALSE);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+ {
+ /*
+ * This case gets the following right:
+ * \*
+ * * A comment (read '\' as '/').
+ * *\
+ * #define IN_THE_WAY
+ * This should line up here;
+ */
+ p = skipwhite(ptr);
+ if (p[0] == '/' && p[1] == '*')
+ p++;
+ if (p[0] == '*')
+ {
+ for (p++; *p; p++)
+ {
+ if (p[0] == '/' && p[-1] == '*')
+ {
+ /*
+ * End of C comment, indent should line up
+ * with the line containing the start of
+ * the comment
+ */
+ curwin->w_cursor.col = (colnr_T)(p - ptr);
+ if ((pos = findmatch(NULL, NUL)) != NULL)
+ {
+ curwin->w_cursor.lnum = pos->lnum;
+ newindent = get_indent();
+ }
+ }
+ }
+ }
+ }
+ else /* Not a comment line */
+# endif
+ {
+ /* Find last non-blank in line */
+ p = ptr + STRLEN(ptr) - 1;
+ while (p > ptr && vim_iswhite(*p))
+ --p;
+ last_char = *p;
+
+ /*
+ * find the character just before the '{' or ';'
+ */
+ if (last_char == '{' || last_char == ';')
+ {
+ if (p > ptr)
+ --p;
+ while (p > ptr && vim_iswhite(*p))
+ --p;
+ }
+ /*
+ * Try to catch lines that are split over multiple
+ * lines. eg:
+ * if (condition &&
+ * condition) {
+ * Should line up here!
+ * }
+ */
+ if (*p == ')')
+ {
+ curwin->w_cursor.col = (colnr_T)(p - ptr);
+ if ((pos = findmatch(NULL, '(')) != NULL)
+ {
+ curwin->w_cursor.lnum = pos->lnum;
+ newindent = get_indent();
+ ptr = ml_get_curline();
+ }
+ }
+ /*
+ * If last character is '{' do indent, without
+ * checking for "if" and the like.
+ */
+ if (last_char == '{')
+ {
+ did_si = TRUE; /* do indent */
+ no_si = TRUE; /* don't delete it when '{' typed */
+ }
+ /*
+ * Look for "if" and the like, use 'cinwords'.
+ * Don't do this if the previous line ended in ';' or
+ * '}'.
+ */
+ else if (last_char != ';' && last_char != '}'
+ && cin_is_cinword(ptr))
+ did_si = TRUE;
+ }
+ }
+ else /* dir == BACKWARD */
+ {
+ /*
+ * Skip preprocessor directives, unless they are
+ * recognised as comments.
+ */
+ if (
+# ifdef FEAT_COMMENTS
+ lead_len == 0 &&
+# endif
+ ptr[0] == '#')
+ {
+ int was_backslashed = FALSE;
+
+ while ((ptr[0] == '#' || was_backslashed) &&
+ curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+ if (*ptr && ptr[STRLEN(ptr) - 1] == '\\')
+ was_backslashed = TRUE;
+ else
+ was_backslashed = FALSE;
+ ptr = ml_get(++curwin->w_cursor.lnum);
+ }
+ if (was_backslashed)
+ newindent = 0; /* Got to end of file */
+ else
+ newindent = get_indent();
+ }
+ p = skipwhite(ptr);
+ if (*p == '}') /* if line starts with '}': do indent */
+ did_si = TRUE;
+ else /* can delete indent when '{' typed */
+ can_si_back = TRUE;
+ }
+ curwin->w_cursor = old_cursor;
+ }
+ if (do_si)
+ can_si = TRUE;
+#endif /* FEAT_SMARTINDENT */
+
+ did_ai = TRUE;
+ }
+
+#ifdef FEAT_COMMENTS
+ /*
+ * Find out if the current line starts with a comment leader.
+ * This may then be inserted in front of the new line.
+ */
+ end_comment_pending = NUL;
+ if (flags & OPENLINE_DO_COM)
+ lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+ {
+ char_u *lead_repl = NULL; /* replaces comment leader */
+ int lead_repl_len = 0; /* length of *lead_repl */
+ char_u lead_middle[COM_MAX_LEN]; /* middle-comment string */
+ char_u lead_end[COM_MAX_LEN]; /* end-comment string */
+ char_u *comment_end = NULL; /* where lead_end has been found */
+ int extra_space = FALSE; /* append extra space */
+ int current_flag;
+ int require_blank = FALSE; /* requires blank after middle */
+ char_u *p2;
+
+ /*
+ * If the comment leader has the start, middle or end flag, it may not
+ * be used or may be replaced with the middle leader.
+ */
+ for (p = lead_flags; *p && *p != ':'; ++p)
+ {
+ if (*p == COM_BLANK)
+ {
+ require_blank = TRUE;
+ continue;
+ }
+ if (*p == COM_START || *p == COM_MIDDLE)
+ {
+ current_flag = *p;
+ if (*p == COM_START)
+ {
+ /*
+ * Doing "O" on a start of comment does not insert leader.
+ */
+ if (dir == BACKWARD)
+ {
+ lead_len = 0;
+ break;
+ }
+
+ /* find start of middle part */
+ (void)copy_option_part(&p, lead_middle, COM_MAX_LEN, ",");
+ require_blank = FALSE;
+ }
+
+ /*
+ * Isolate the strings of the middle and end leader.
+ */
+ while (*p && p[-1] != ':') /* find end of middle flags */
+ {
+ if (*p == COM_BLANK)
+ require_blank = TRUE;
+ ++p;
+ }
+ (void)copy_option_part(&p, lead_middle, COM_MAX_LEN, ",");
+
+ while (*p && p[-1] != ':') /* find end of end flags */
+ {
+ /* Check whether we allow automatic ending of comments */
+ if (*p == COM_AUTO_END)
+ end_comment_pending = -1; /* means we want to set it */
+ ++p;
+ }
+ n = copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
+
+ if (end_comment_pending == -1) /* we can set it now */
+ end_comment_pending = lead_end[n - 1];
+
+ /*
+ * If the end of the comment is in the same line, don't use
+ * the comment leader.
+ */
+ if (dir == FORWARD)
+ {
+ for (p = saved_line + lead_len; *p; ++p)
+ if (STRNCMP(p, lead_end, n) == 0)
+ {
+ comment_end = p;
+ lead_len = 0;
+ break;
+ }
+ }
+
+ /*
+ * Doing "o" on a start of comment inserts the middle leader.
+ */
+ if (lead_len > 0)
+ {
+ if (current_flag == COM_START)
+ {
+ lead_repl = lead_middle;
+ lead_repl_len = (int)STRLEN(lead_middle);
+ }
+
+ /*
+ * If we have hit RETURN immediately after the start
+ * comment leader, then put a space after the middle
+ * comment leader on the next line.
+ */
+ if (!vim_iswhite(saved_line[lead_len - 1])
+ && ((p_extra != NULL
+ && (int)curwin->w_cursor.col == lead_len)
+ || (p_extra == NULL
+ && saved_line[lead_len] == NUL)
+ || require_blank))
+ extra_space = TRUE;
+ }
+ break;
+ }
+ if (*p == COM_END)
+ {
+ /*
+ * Doing "o" on the end of a comment does not insert leader.
+ * Remember where the end is, might want to use it to find the
+ * start (for C-comments).
+ */
+ if (dir == FORWARD)
+ {
+ comment_end = skipwhite(saved_line);
+ lead_len = 0;
+ break;
+ }
+
+ /*
+ * Doing "O" on the end of a comment inserts the middle leader.
+ * Find the string for the middle leader, searching backwards.
+ */
+ while (p > curbuf->b_p_com && *p != ',')
+ --p;
+ for (lead_repl = p; lead_repl > curbuf->b_p_com
+ && lead_repl[-1] != ':'; --lead_repl)
+ ;
+ lead_repl_len = (int)(p - lead_repl);
+
+ /* We can probably always add an extra space when doing "O" on
+ * the comment-end */
+ extra_space = TRUE;
+
+ /* Check whether we allow automatic ending of comments */
+ for (p2 = p; *p2 && *p2 != ':'; p2++)
+ {
+ if (*p2 == COM_AUTO_END)
+ end_comment_pending = -1; /* means we want to set it */
+ }
+ if (end_comment_pending == -1)
+ {
+ /* Find last character in end-comment string */
+ while (*p2 && *p2 != ',')
+ p2++;
+ end_comment_pending = p2[-1];
+ }
+ break;
+ }
+ if (*p == COM_FIRST)
+ {
+ /*
+ * Comment leader for first line only: Don't repeat leader
+ * when using "O", blank out leader when using "o".
+ */
+ if (dir == BACKWARD)
+ lead_len = 0;
+ else
+ {
+ lead_repl = (char_u *)"";
+ lead_repl_len = 0;
+ }
+ break;
+ }
+ }
+ if (lead_len)
+ {
+ /* allocate buffer (may concatenate p_exta later) */
+ leader = alloc(lead_len + lead_repl_len + extra_space +
+ extra_len + 1);
+ allocated = leader; /* remember to free it later */
+
+ if (leader == NULL)
+ lead_len = 0;
+ else
+ {
+ STRNCPY(leader, saved_line, lead_len);
+ leader[lead_len] = NUL;
+
+ /*
+ * Replace leader with lead_repl, right or left adjusted
+ */
+ if (lead_repl != NULL)
+ {
+ int c = 0;
+ int off = 0;
+
+ for (p = lead_flags; *p && *p != ':'; ++p)
+ {
+ if (*p == COM_RIGHT || *p == COM_LEFT)
+ c = *p;
+ else if (VIM_ISDIGIT(*p) || *p == '-')
+ off = getdigits(&p);
+ }
+ if (c == COM_RIGHT) /* right adjusted leader */
+ {
+ /* find last non-white in the leader to line up with */
+ for (p = leader + lead_len - 1; p > leader
+ && vim_iswhite(*p); --p)
+ ;
+
+ ++p;
+ if (p < leader + lead_repl_len)
+ p = leader;
+ else
+ p -= lead_repl_len;
+ mch_memmove(p, lead_repl, (size_t)lead_repl_len);
+ if (p + lead_repl_len > leader + lead_len)
+ p[lead_repl_len] = NUL;
+
+ /* blank-out any other chars from the old leader. */
+ while (--p >= leader)
+ if (!vim_iswhite(*p))
+ *p = ' ';
+ }
+ else /* left adjusted leader */
+ {
+ p = skipwhite(leader);
+ mch_memmove(p, lead_repl, (size_t)lead_repl_len);
+
+ /* Replace any remaining non-white chars in the old
+ * leader by spaces. Keep Tabs, the indent must
+ * remain the same. */
+ for (p += lead_repl_len; p < leader + lead_len; ++p)
+ if (!vim_iswhite(*p))
+ {
+ /* Don't put a space before a TAB. */
+ if (p + 1 < leader + lead_len && p[1] == TAB)
+ {
+ --lead_len;
+ mch_memmove(p, p + 1,
+ (leader + lead_len) - p);
+ }
+ else
+ *p = ' ';
+ }
+ *p = NUL;
+ }
+
+ /* Recompute the indent, it may have changed. */
+ if (curbuf->b_p_ai
+#ifdef FEAT_SMARTINDENT
+ || do_si
+#endif
+ )
+ newindent = get_indent_str(leader, (int)curbuf->b_p_ts);
+
+ /* Add the indent offset */
+ if (newindent + off < 0)
+ {
+ off = -newindent;
+ newindent = 0;
+ }
+ else
+ newindent += off;
+
+ /* Correct trailing spaces for the shift, so that
+ * alignment remains equal. */
+ while (off > 0 && lead_len > 0
+ && leader[lead_len - 1] == ' ')
+ {
+ /* Don't do it when there is a tab before the space */
+ if (vim_strchr(skipwhite(leader), '\t') != NULL)
+ break;
+ --lead_len;
+ --off;
+ }
+
+ /* If the leader ends in white space, don't add an
+ * extra space */
+ if (lead_len > 0 && vim_iswhite(leader[lead_len - 1]))
+ extra_space = FALSE;
+ leader[lead_len] = NUL;
+ }
+
+ if (extra_space)
+ {
+ leader[lead_len++] = ' ';
+ leader[lead_len] = NUL;
+ }
+
+ newcol = lead_len;
+
+ /*
+ * if a new indent will be set below, remove the indent that
+ * is in the comment leader
+ */
+ if (newindent
+#ifdef FEAT_SMARTINDENT
+ || did_si
+#endif
+ )
+ {
+ while (lead_len && vim_iswhite(*leader))
+ {
+ --lead_len;
+ --newcol;
+ ++leader;
+ }
+ }
+
+ }
+#ifdef FEAT_SMARTINDENT
+ did_si = can_si = FALSE;
+#endif
+ }
+ else if (comment_end != NULL)
+ {
+ /*
+ * We have finished a comment, so we don't use the leader.
+ * If this was a C-comment and 'ai' or 'si' is set do a normal
+ * indent to align with the line containing the start of the
+ * comment.
+ */
+ if (comment_end[0] == '*' && comment_end[1] == '/' &&
+ (curbuf->b_p_ai
+#ifdef FEAT_SMARTINDENT
+ || do_si
+#endif
+ ))
+ {
+ old_cursor = curwin->w_cursor;
+ curwin->w_cursor.col = (colnr_T)(comment_end - saved_line);
+ if ((pos = findmatch(NULL, NUL)) != NULL)
+ {
+ curwin->w_cursor.lnum = pos->lnum;
+ newindent = get_indent();
+ }
+ curwin->w_cursor = old_cursor;
+ }
+ }
+ }
+#endif
+
+ /* (State == INSERT || State == REPLACE), only when dir == FORWARD */
+ if (p_extra != NULL)
+ {
+ *p_extra = saved_char; /* restore char that NUL replaced */
+
+ /*
+ * When 'ai' set or "flags" has OPENLINE_DELSPACES, skip to the first
+ * non-blank.
+ *
+ * When in REPLACE mode, put the deleted blanks on the replace stack,
+ * preceded by a NUL, so they can be put back when a BS is entered.
+ */
+ if (REPLACE_NORMAL(State))
+ replace_push(NUL); /* end of extra blanks */
+ if (curbuf->b_p_ai || (flags & OPENLINE_DELSPACES))
+ {
+ while ((*p_extra == ' ' || *p_extra == '\t')
+#ifdef FEAT_MBYTE
+ && (!enc_utf8
+ || !utf_iscomposing(utf_ptr2char(p_extra + 1)))
+#endif
+ )
+ {
+ if (REPLACE_NORMAL(State))
+ replace_push(*p_extra);
+ ++p_extra;
+ ++less_cols_off;
+ }
+ }
+ if (*p_extra != NUL)
+ did_ai = FALSE; /* append some text, don't truncate now */
+
+ /* columns for marks adjusted for removed columns */
+ less_cols = (int)(p_extra - saved_line);
+ }
+
+ if (p_extra == NULL)
+ p_extra = (char_u *)""; /* append empty line */
+
+#ifdef FEAT_COMMENTS
+ /* concatenate leader and p_extra, if there is a leader */
+ if (lead_len)
+ {
+ STRCAT(leader, p_extra);
+ p_extra = leader;
+ did_ai = TRUE; /* So truncating blanks works with comments */
+ less_cols -= lead_len;
+ }
+ else
+ end_comment_pending = NUL; /* turns out there was no leader */
+#endif
+
+ old_cursor = curwin->w_cursor;
+ if (dir == BACKWARD)
+ --curwin->w_cursor.lnum;
+#ifdef FEAT_VREPLACE
+ if (!(State & VREPLACE_FLAG) || old_cursor.lnum >= orig_line_count)
+#endif
+ {
+ if (ml_append(curwin->w_cursor.lnum, p_extra, (colnr_T)0, FALSE)
+ == FAIL)
+ goto theend;
+ /* Postpone calling changed_lines(), because it would mess up folding
+ * with markers. */
+ mark_adjust(curwin->w_cursor.lnum + 1, (linenr_T)MAXLNUM, 1L, 0L);
+ did_append = TRUE;
+ }
+#ifdef FEAT_VREPLACE
+ else
+ {
+ /*
+ * In VREPLACE mode we are starting to replace the next line.
+ */
+ curwin->w_cursor.lnum++;
+ if (curwin->w_cursor.lnum >= Insstart.lnum + vr_lines_changed)
+ {
+ /* In case we NL to a new line, BS to the previous one, and NL
+ * again, we don't want to save the new line for undo twice.
+ */
+ (void)u_save_cursor(); /* errors are ignored! */
+ vr_lines_changed++;
+ }
+ ml_replace(curwin->w_cursor.lnum, p_extra, TRUE);
+ changed_bytes(curwin->w_cursor.lnum, 0);
+ curwin->w_cursor.lnum--;
+ did_append = FALSE;
+ }
+#endif
+
+ if (newindent
+#ifdef FEAT_SMARTINDENT
+ || did_si
+#endif
+ )
+ {
+ ++curwin->w_cursor.lnum;
+#ifdef FEAT_SMARTINDENT
+ if (did_si)
+ {
+ if (p_sr)
+ newindent -= newindent % (int)curbuf->b_p_sw;
+ newindent += (int)curbuf->b_p_sw;
+ }
+#endif
+ /* Copy the indent only if expand tab is disabled */
+ if (curbuf->b_p_ci && !curbuf->b_p_et)
+ {
+ (void)copy_indent(newindent, saved_line);
+
+ /*
+ * Set the 'preserveindent' option so that any further screwing
+ * with the line doesn't entirely destroy our efforts to preserve
+ * it. It gets restored at the function end.
+ */
+ curbuf->b_p_pi = TRUE;
+ }
+ else
+ (void)set_indent(newindent, SIN_INSERT);
+ less_cols -= curwin->w_cursor.col;
+
+ ai_col = curwin->w_cursor.col;
+
+ /*
+ * In REPLACE mode, for each character in the new indent, there must
+ * be a NUL on the replace stack, for when it is deleted with BS
+ */
+ if (REPLACE_NORMAL(State))
+ for (n = 0; n < (int)curwin->w_cursor.col; ++n)
+ replace_push(NUL);
+ newcol += curwin->w_cursor.col;
+#ifdef FEAT_SMARTINDENT
+ if (no_si)
+ did_si = FALSE;
+#endif
+ }
+
+#ifdef FEAT_COMMENTS
+ /*
+ * In REPLACE mode, for each character in the extra leader, there must be
+ * a NUL on the replace stack, for when it is deleted with BS.
+ */
+ if (REPLACE_NORMAL(State))
+ while (lead_len-- > 0)
+ replace_push(NUL);
+#endif
+
+ curwin->w_cursor = old_cursor;
+
+ if (dir == FORWARD)
+ {
+ if (trunc_line || (State & INSERT))
+ {
+ /* truncate current line at cursor */
+ saved_line[curwin->w_cursor.col] = NUL;
+ /* Remove trailing white space, unless OPENLINE_KEEPTRAIL used. */
+ if (trunc_line && !(flags & OPENLINE_KEEPTRAIL))
+ truncate_spaces(saved_line);
+ ml_replace(curwin->w_cursor.lnum, saved_line, FALSE);
+ saved_line = NULL;
+ if (did_append)
+ {
+ changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col,
+ curwin->w_cursor.lnum + 1, 1L);
+ did_append = FALSE;
+
+ /* Move marks after the line break to the new line. */
+ if (flags & OPENLINE_MARKFIX)
+ mark_col_adjust(curwin->w_cursor.lnum,
+ curwin->w_cursor.col + less_cols_off,
+ 1L, (long)-less_cols);
+ }
+ else
+ changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
+ }
+
+ /*
+ * Put the cursor on the new line. Careful: the scrollup() above may
+ * have moved w_cursor, we must use old_cursor.
+ */
+ curwin->w_cursor.lnum = old_cursor.lnum + 1;
+ }
+ if (did_append)
+ changed_lines(curwin->w_cursor.lnum, 0, curwin->w_cursor.lnum, 1L);
+
+ curwin->w_cursor.col = newcol;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+
+#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT))
+ /*
+ * In VREPLACE mode, we are handling the replace stack ourselves, so stop
+ * fixthisline() from doing it (via change_indent()) by telling it we're in
+ * normal INSERT mode.
+ */
+ if (State & VREPLACE_FLAG)
+ {
+ vreplace_mode = State; /* So we know to put things right later */
+ State = INSERT;
+ }
+ else
+ vreplace_mode = 0;
+#endif
+#ifdef FEAT_LISP
+ /*
+ * May do lisp indenting.
+ */
+ if (!p_paste
+# ifdef FEAT_COMMENTS
+ && leader == NULL
+# endif
+ && curbuf->b_p_lisp
+ && curbuf->b_p_ai)
+ {
+ fixthisline(get_lisp_indent);
+ p = ml_get_curline();
+ ai_col = (colnr_T)(skipwhite(p) - p);
+ }
+#endif
+#ifdef FEAT_CINDENT
+ /*
+ * May do indenting after opening a new line.
+ */
+ if (!p_paste
+ && (curbuf->b_p_cin
+# ifdef FEAT_EVAL
+ || *curbuf->b_p_inde != NUL
+# endif
+ )
+ && in_cinkeys(dir == FORWARD
+ ? KEY_OPEN_FORW
+ : KEY_OPEN_BACK, ' ', linewhite(curwin->w_cursor.lnum)))
+ {
+ do_c_expr_indent();
+ p = ml_get_curline();
+ ai_col = (colnr_T)(skipwhite(p) - p);
+ }
+#endif
+#if defined(FEAT_VREPLACE) && (defined(FEAT_LISP) || defined(FEAT_CINDENT))
+ if (vreplace_mode != 0)
+ State = vreplace_mode;
+#endif
+
+#ifdef FEAT_VREPLACE
+ /*
+ * Finally, VREPLACE gets the stuff on the new line, then puts back the
+ * original line, and inserts the new stuff char by char, pushing old stuff
+ * onto the replace stack (via ins_char()).
+ */
+ if (State & VREPLACE_FLAG)
+ {
+ /* Put new line in p_extra */
+ p_extra = vim_strsave(ml_get_curline());
+ if (p_extra == NULL)
+ goto theend;
+
+ /* Put back original line */
+ ml_replace(curwin->w_cursor.lnum, next_line, FALSE);
+
+ /* Insert new stuff into line again */
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ ins_bytes(p_extra); /* will call changed_bytes() */
+ vim_free(p_extra);
+ next_line = NULL;
+ }
+#endif
+
+ retval = TRUE; /* success! */
+theend:
+ curbuf->b_p_pi = saved_pi;
+ vim_free(saved_line);
+ vim_free(next_line);
+ vim_free(allocated);
+ return retval;
+}
+
+#if defined(FEAT_COMMENTS) || defined(PROTO)
+/*
+ * get_leader_len() returns the length of the prefix of the given string
+ * which introduces a comment. If this string is not a comment then 0 is
+ * returned.
+ * When "flags" is not NULL, it is set to point to the flags of the recognized
+ * comment leader.
+ * "backward" must be true for the "O" command.
+ */
+ int
+get_leader_len(line, flags, backward)
+ char_u *line;
+ char_u **flags;
+ int backward;
+{
+ int i, j;
+ int got_com = FALSE;
+ int found_one;
+ char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */
+ char_u *string; /* pointer to comment string */
+ char_u *list;
+
+ i = 0;
+ while (vim_iswhite(line[i])) /* leading white space is ignored */
+ ++i;
+
+ /*
+ * Repeat to match several nested comment strings.
+ */
+ while (line[i])
+ {
+ /*
+ * scan through the 'comments' option for a match
+ */
+ found_one = FALSE;
+ for (list = curbuf->b_p_com; *list; )
+ {
+ /*
+ * Get one option part into part_buf[]. Advance list to next one.
+ * put string at start of string.
+ */
+ if (!got_com && flags != NULL) /* remember where flags started */
+ *flags = list;
+ (void)copy_option_part(&list, part_buf, COM_MAX_LEN, ",");
+ string = vim_strchr(part_buf, ':');
+ if (string == NULL) /* missing ':', ignore this part */
+ continue;
+ *string++ = NUL; /* isolate flags from string */
+
+ /*
+ * When already found a nested comment, only accept further
+ * nested comments.
+ */
+ if (got_com && vim_strchr(part_buf, COM_NEST) == NULL)
+ continue;
+
+ /* When 'O' flag used don't use for "O" command */
+ if (backward && vim_strchr(part_buf, COM_NOBACK) != NULL)
+ continue;
+
+ /*
+ * Line contents and string must match.
+ * When string starts with white space, must have some white space
+ * (but the amount does not need to match, there might be a mix of
+ * TABs and spaces).
+ */
+ if (vim_iswhite(string[0]))
+ {
+ if (i == 0 || !vim_iswhite(line[i - 1]))
+ continue;
+ while (vim_iswhite(string[0]))
+ ++string;
+ }
+ for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j)
+ ;
+ if (string[j] != NUL)
+ continue;
+
+ /*
+ * When 'b' flag used, there must be white space or an
+ * end-of-line after the string in the line.
+ */
+ if (vim_strchr(part_buf, COM_BLANK) != NULL
+ && !vim_iswhite(line[i + j]) && line[i + j] != NUL)
+ continue;
+
+ /*
+ * We have found a match, stop searching.
+ */
+ i += j;
+ got_com = TRUE;
+ found_one = TRUE;
+ break;
+ }
+
+ /*
+ * No match found, stop scanning.
+ */
+ if (!found_one)
+ break;
+
+ /*
+ * Include any trailing white space.
+ */
+ while (vim_iswhite(line[i]))
+ ++i;
+
+ /*
+ * If this comment doesn't nest, stop here.
+ */
+ if (vim_strchr(part_buf, COM_NEST) == NULL)
+ break;
+ }
+ return (got_com ? i : 0);
+}
+#endif
+
+/*
+ * Return the number of window lines occupied by buffer line "lnum".
+ */
+ int
+plines(lnum)
+ linenr_T lnum;
+{
+ return plines_win(curwin, lnum, TRUE);
+}
+
+ int
+plines_win(wp, lnum, winheight)
+ win_T *wp;
+ linenr_T lnum;
+ int winheight; /* when TRUE limit to window height */
+{
+#if defined(FEAT_DIFF) || defined(PROTO)
+ /* Check for filler lines above this buffer line. When folded the result
+ * is one line anyway. */
+ return plines_win_nofill(wp, lnum, winheight) + diff_check_fill(wp, lnum);
+}
+
+ int
+plines_nofill(lnum)
+ linenr_T lnum;
+{
+ return plines_win_nofill(curwin, lnum, TRUE);
+}
+
+ int
+plines_win_nofill(wp, lnum, winheight)
+ win_T *wp;
+ linenr_T lnum;
+ int winheight; /* when TRUE limit to window height */
+{
+#endif
+ int lines;
+
+ if (!wp->w_p_wrap)
+ return 1;
+
+#ifdef FEAT_VERTSPLIT
+ if (wp->w_width == 0)
+ return 1;
+#endif
+
+#ifdef FEAT_FOLDING
+ /* A folded lines is handled just like an empty line. */
+ /* NOTE: Caller must handle lines that are MAYBE folded. */
+ if (lineFolded(wp, lnum) == TRUE)
+ return 1;
+#endif
+
+ lines = plines_win_nofold(wp, lnum);
+ if (winheight > 0 && lines > wp->w_height)
+ return (int)wp->w_height;
+ return lines;
+}
+
+/*
+ * Return number of window lines physical line "lnum" will occupy in window
+ * "wp". Does not care about folding, 'wrap' or 'diff'.
+ */
+ int
+plines_win_nofold(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ char_u *s;
+ long col;
+ int width;
+
+ s = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ if (*s == NUL) /* empty line */
+ return 1;
+ col = win_linetabsize(wp, s, (colnr_T)MAXCOL);
+
+ /*
+ * If list mode is on, then the '$' at the end of the line may take up one
+ * extra column.
+ */
+ if (wp->w_p_list && lcs_eol != NUL)
+ col += 1;
+
+ /*
+ * Add column offset for 'number' and 'foldcolumn'.
+ */
+ width = W_WIDTH(wp) - win_col_off(wp);
+ if (width <= 0)
+ return 32000;
+ if (col <= width)
+ return 1;
+ col -= width;
+ width += win_col_off2(wp);
+ return (col + (width - 1)) / width + 1;
+}
+
+/*
+ * Like plines_win(), but only reports the number of physical screen lines
+ * used from the start of the line to the given column number.
+ */
+ int
+plines_win_col(wp, lnum, column)
+ win_T *wp;
+ linenr_T lnum;
+ long column;
+{
+ long col;
+ char_u *s;
+ int lines = 0;
+ int width;
+
+#ifdef FEAT_DIFF
+ /* Check for filler lines above this buffer line. When folded the result
+ * is one line anyway. */
+ lines = diff_check_fill(wp, lnum);
+#endif
+
+ if (!wp->w_p_wrap)
+ return lines + 1;
+
+#ifdef FEAT_VERTSPLIT
+ if (wp->w_width == 0)
+ return lines + 1;
+#endif
+
+ s = ml_get_buf(wp->w_buffer, lnum, FALSE);
+
+ col = 0;
+ while (*s != NUL && --column >= 0)
+ {
+ col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+#endif
+ ++s;
+ }
+
+ /*
+ * If *s is a TAB, and the TAB is not displayed as ^I, and we're not in
+ * INSERT mode, then col must be adjusted so that it represents the last
+ * screen position of the TAB. This only fixes an error when the TAB wraps
+ * from one screen line to the next (when 'columns' is not a multiple of
+ * 'ts') -- webb.
+ */
+ if (*s == TAB && (State & NORMAL) && (!wp->w_p_list || lcs_tab1))
+ col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL) - 1;
+
+ /*
+ * Add column offset for 'number', 'foldcolumn', etc.
+ */
+ width = W_WIDTH(wp) - win_col_off(wp);
+ if (width > 0)
+ {
+ lines += 1;
+ if (col >= width)
+ lines += (col - width) / (width + win_col_off2(wp));
+ if (lines <= wp->w_height)
+ return lines;
+ }
+ return (int)(wp->w_height); /* maximum length */
+}
+
+ int
+plines_m_win(wp, first, last)
+ win_T *wp;
+ linenr_T first, last;
+{
+ int count = 0;
+
+ while (first <= last)
+ {
+#ifdef FEAT_FOLDING
+ int x;
+
+ /* Check if there are any really folded lines, but also included lines
+ * that are maybe folded. */
+ x = foldedCount(wp, first, NULL);
+ if (x > 0)
+ {
+ ++count; /* count 1 for "+-- folded" line */
+ first += x;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_DIFF
+ if (first == wp->w_topline)
+ count += plines_win_nofill(wp, first, TRUE) + wp->w_topfill;
+ else
+#endif
+ count += plines_win(wp, first, TRUE);
+ ++first;
+ }
+ }
+ return (count);
+}
+
+#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Insert string "p" at the cursor position. Stops at a NUL byte.
+ * Handles Replace mode and multi-byte characters.
+ */
+ void
+ins_bytes(p)
+ char_u *p;
+{
+ ins_bytes_len(p, (int)STRLEN(p));
+}
+#endif
+
+#if defined(FEAT_VREPLACE) || defined(FEAT_INS_EXPAND) \
+ || defined(FEAT_COMMENTS) || defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Insert string "p" with length "len" at the cursor position.
+ * Handles Replace mode and multi-byte characters.
+ */
+ void
+ins_bytes_len(p, len)
+ char_u *p;
+ int len;
+{
+ int i;
+# ifdef FEAT_MBYTE
+ int n;
+
+ for (i = 0; i < len; i += n)
+ {
+ n = (*mb_ptr2len_check)(p + i);
+ ins_char_bytes(p + i, n);
+ }
+# else
+ for (i = 0; i < len; ++i)
+ ins_char(p[i]);
+# endif
+}
+#endif
+
+/*
+ * Insert or replace a single character at the cursor position.
+ * When in REPLACE or VREPLACE mode, replace any existing character.
+ * Caller must have prepared for undo.
+ * For multi-byte characters we get the whole character, the caller must
+ * convert bytes to a character.
+ */
+ void
+ins_char(c)
+ int c;
+{
+#if defined(FEAT_MBYTE) || defined(PROTO)
+ char_u buf[MB_MAXBYTES];
+ int n;
+
+ n = (*mb_char2bytes)(c, buf);
+
+ /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
+ * Happens for CTRL-Vu9900. */
+ if (buf[0] == 0)
+ buf[0] = '\n';
+
+ ins_char_bytes(buf, n);
+}
+
+ void
+ins_char_bytes(buf, charlen)
+ char_u *buf;
+ int charlen;
+{
+ int c = buf[0];
+ int l, j;
+#endif
+ int newlen; /* nr of bytes inserted */
+ int oldlen; /* nr of bytes deleted (0 when not replacing) */
+ char_u *p;
+ char_u *newp;
+ char_u *oldp;
+ int linelen; /* length of old line including NUL */
+ colnr_T col;
+ linenr_T lnum = curwin->w_cursor.lnum;
+ int i;
+
+#ifdef FEAT_VIRTUALEDIT
+ /* Break tabs if needed. */
+ if (virtual_active() && curwin->w_cursor.coladd > 0)
+ coladvance_force(getviscol());
+#endif
+
+ col = curwin->w_cursor.col;
+ oldp = ml_get(lnum);
+ linelen = (int)STRLEN(oldp) + 1;
+
+ /* The lengths default to the values for when not replacing. */
+ oldlen = 0;
+#ifdef FEAT_MBYTE
+ newlen = charlen;
+#else
+ newlen = 1;
+#endif
+
+ if (State & REPLACE_FLAG)
+ {
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ {
+ colnr_T new_vcol = 0; /* init for GCC */
+ colnr_T vcol;
+ int old_list;
+#ifndef FEAT_MBYTE
+ char_u buf[2];
+#endif
+
+ /*
+ * Disable 'list' temporarily, unless 'cpo' contains the 'L' flag.
+ * Returns the old value of list, so when finished,
+ * curwin->w_p_list should be set back to this.
+ */
+ old_list = curwin->w_p_list;
+ if (old_list && vim_strchr(p_cpo, CPO_LISTWM) == NULL)
+ curwin->w_p_list = FALSE;
+
+ /*
+ * In virtual replace mode each character may replace one or more
+ * characters (zero if it's a TAB). Count the number of bytes to
+ * be deleted to make room for the new character, counting screen
+ * cells. May result in adding spaces to fill a gap.
+ */
+ getvcol(curwin, &curwin->w_cursor, NULL, &vcol, NULL);
+#ifndef FEAT_MBYTE
+ buf[0] = c;
+ buf[1] = NUL;
+#endif
+ new_vcol = vcol + chartabsize(buf, vcol);
+ while (oldp[col + oldlen] != NUL && vcol < new_vcol)
+ {
+ vcol += chartabsize(oldp + col + oldlen, vcol);
+ /* Don't need to remove a TAB that takes us to the right
+ * position. */
+ if (vcol > new_vcol && oldp[col + oldlen] == TAB)
+ break;
+#ifdef FEAT_MBYTE
+ oldlen += (*mb_ptr2len_check)(oldp + col + oldlen);
+#else
+ ++oldlen;
+#endif
+ /* Deleted a bit too much, insert spaces. */
+ if (vcol > new_vcol)
+ newlen += vcol - new_vcol;
+ }
+ curwin->w_p_list = old_list;
+ }
+ else
+#endif
+ if (oldp[col] != NUL)
+ {
+ /* normal replace */
+#ifdef FEAT_MBYTE
+ oldlen = (*mb_ptr2len_check)(oldp + col);
+#else
+ oldlen = 1;
+#endif
+ }
+
+
+ /* Push the replaced bytes onto the replace stack, so that they can be
+ * put back when BS is used. The bytes of a multi-byte character are
+ * done the other way around, so that the first byte is popped off
+ * first (it tells the byte length of the character). */
+ replace_push(NUL);
+ for (i = 0; i < oldlen; ++i)
+ {
+#ifdef FEAT_MBYTE
+ l = (*mb_ptr2len_check)(oldp + col + i) - 1;
+ for (j = l; j >= 0; --j)
+ replace_push(oldp[col + i + j]);
+ i += l;
+#else
+ replace_push(oldp[col + i]);
+#endif
+ }
+ }
+
+ newp = alloc_check((unsigned)(linelen + newlen - oldlen));
+ if (newp == NULL)
+ return;
+
+ /* Copy bytes before the cursor. */
+ if (col > 0)
+ mch_memmove(newp, oldp, (size_t)col);
+
+ /* Copy bytes after the changed character(s). */
+ p = newp + col;
+ mch_memmove(p + newlen, oldp + col + oldlen,
+ (size_t)(linelen - col - oldlen));
+
+ /* Insert or overwrite the new character. */
+#ifdef FEAT_MBYTE
+ mch_memmove(p, buf, charlen);
+ i = charlen;
+#else
+ *p = c;
+ i = 1;
+#endif
+
+ /* Fill with spaces when necessary. */
+ while (i < newlen)
+ p[i++] = ' ';
+
+ /* Replace the line in the buffer. */
+ ml_replace(lnum, newp, FALSE);
+
+ /* mark the buffer as changed and prepare for displaying */
+ changed_bytes(lnum, col);
+
+ /*
+ * If we're in Insert or Replace mode and 'showmatch' is set, then briefly
+ * show the match for right parens and braces.
+ */
+ if (p_sm && (State & INSERT)
+ && msg_silent == 0
+#ifdef FEAT_MBYTE
+ && charlen == 1
+#endif
+ )
+ showmatch(c);
+
+#ifdef FEAT_RIGHTLEFT
+ if (!p_ri || (State & REPLACE_FLAG))
+#endif
+ {
+ /* Normal insert: move cursor right */
+#ifdef FEAT_MBYTE
+ curwin->w_cursor.col += charlen;
+#else
+ ++curwin->w_cursor.col;
+#endif
+ }
+ /*
+ * TODO: should try to update w_row here, to avoid recomputing it later.
+ */
+}
+
+/*
+ * Insert a string at the cursor position.
+ * Note: Does NOT handle Replace mode.
+ * Caller must have prepared for undo.
+ */
+ void
+ins_str(s)
+ char_u *s;
+{
+ char_u *oldp, *newp;
+ int newlen = (int)STRLEN(s);
+ int oldlen;
+ colnr_T col;
+ linenr_T lnum = curwin->w_cursor.lnum;
+
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active() && curwin->w_cursor.coladd > 0)
+ coladvance_force(getviscol());
+#endif
+
+ col = curwin->w_cursor.col;
+ oldp = ml_get(lnum);
+ oldlen = (int)STRLEN(oldp);
+
+ newp = alloc_check((unsigned)(oldlen + newlen + 1));
+ if (newp == NULL)
+ return;
+ if (col > 0)
+ mch_memmove(newp, oldp, (size_t)col);
+ mch_memmove(newp + col, s, (size_t)newlen);
+ mch_memmove(newp + col + newlen, oldp + col, (size_t)(oldlen - col + 1));
+ ml_replace(lnum, newp, FALSE);
+ changed_bytes(lnum, col);
+ curwin->w_cursor.col += newlen;
+}
+
+/*
+ * Delete one character under the cursor.
+ * If "fixpos" is TRUE, don't leave the cursor on the NUL after the line.
+ * Caller must have prepared for undo.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+del_char(fixpos)
+ int fixpos;
+{
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Make sure the cursor is at the start of a character. */
+ mb_adjust_cursor();
+ if (*ml_get_cursor() == NUL)
+ return FAIL;
+ return del_chars(1L, fixpos);
+ }
+#endif
+ return del_bytes(1L, fixpos);
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Like del_bytes(), but delete characters instead of bytes.
+ */
+ int
+del_chars(count, fixpos)
+ long count;
+ int fixpos;
+{
+ long bytes = 0;
+ long i;
+ char_u *p;
+ int l;
+
+ p = ml_get_cursor();
+ for (i = 0; i < count && *p != NUL; ++i)
+ {
+ l = (*mb_ptr2len_check)(p);
+ bytes += l;
+ p += l;
+ }
+ return del_bytes(bytes, fixpos);
+}
+#endif
+
+/*
+ * Delete "count" bytes under the cursor.
+ * If "fixpos" is TRUE, don't leave the cursor on the NUL after the line.
+ * Caller must have prepared for undo.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+del_bytes(count, fixpos)
+ long count;
+ int fixpos;
+{
+ char_u *oldp, *newp;
+ colnr_T oldlen;
+ linenr_T lnum = curwin->w_cursor.lnum;
+ colnr_T col = curwin->w_cursor.col;
+ int was_alloced;
+ long movelen;
+
+ oldp = ml_get(lnum);
+ oldlen = (int)STRLEN(oldp);
+
+ /*
+ * Can't do anything when the cursor is on the NUL after the line.
+ */
+ if (col >= oldlen)
+ return FAIL;
+
+#ifdef FEAT_MBYTE
+ /* If 'delcombine' is set and deleting (less than) one character, only
+ * delete the last combining character. */
+ if (p_deco && enc_utf8 && (*mb_ptr2len_check)(oldp + col) <= count)
+ {
+ int c1, c2;
+ int n;
+
+ (void)utfc_ptr2char(oldp + col, &c1, &c2);
+ if (c1 != NUL)
+ {
+ /* Find the last composing char, there can be several. */
+ n = col;
+ do
+ {
+ col = n;
+ count = utf_ptr2len_check(oldp + n);
+ n += count;
+ } while (UTF_COMPOSINGLIKE(oldp + col, oldp + n));
+ fixpos = 0;
+ }
+ }
+#endif
+
+ /*
+ * When count is too big, reduce it.
+ */
+ movelen = (long)oldlen - (long)col - count + 1; /* includes trailing NUL */
+ if (movelen <= 1)
+ {
+ /*
+ * If we just took off the last character of a non-blank line, and
+ * fixpos is TRUE, we don't want to end up positioned at the NUL.
+ */
+ if (col > 0 && fixpos)
+ {
+ --curwin->w_cursor.col;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ curwin->w_cursor.col -=
+ (*mb_head_off)(oldp, oldp + curwin->w_cursor.col);
+#endif
+ }
+ count = oldlen - col;
+ movelen = 1;
+ }
+
+ /*
+ * If the old line has been allocated the deletion can be done in the
+ * existing line. Otherwise a new line has to be allocated
+ */
+ was_alloced = ml_line_alloced(); /* check if oldp was allocated */
+#ifdef FEAT_NETBEANS_INTG
+ if (was_alloced && usingNetbeans)
+ netbeans_removed(curbuf, lnum, col, count);
+ /* else is handled by ml_replace() */
+#endif
+ if (was_alloced)
+ newp = oldp; /* use same allocated memory */
+ else
+ { /* need to allocate a new line */
+ newp = alloc((unsigned)(oldlen + 1 - count));
+ if (newp == NULL)
+ return FAIL;
+ mch_memmove(newp, oldp, (size_t)col);
+ }
+ mch_memmove(newp + col, oldp + col + count, (size_t)movelen);
+ if (!was_alloced)
+ ml_replace(lnum, newp, FALSE);
+
+ /* mark the buffer as changed and prepare for displaying */
+ changed_bytes(lnum, curwin->w_cursor.col);
+
+ return OK;
+}
+
+/*
+ * Delete from cursor to end of line.
+ * Caller must have prepared for undo.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+truncate_line(fixpos)
+ int fixpos; /* if TRUE fix the cursor position when done */
+{
+ char_u *newp;
+ linenr_T lnum = curwin->w_cursor.lnum;
+ colnr_T col = curwin->w_cursor.col;
+
+ if (col == 0)
+ newp = vim_strsave((char_u *)"");
+ else
+ newp = vim_strnsave(ml_get(lnum), col);
+
+ if (newp == NULL)
+ return FAIL;
+
+ ml_replace(lnum, newp, FALSE);
+
+ /* mark the buffer as changed and prepare for displaying */
+ changed_bytes(lnum, curwin->w_cursor.col);
+
+ /*
+ * If "fixpos" is TRUE we don't want to end up positioned at the NUL.
+ */
+ if (fixpos && curwin->w_cursor.col > 0)
+ --curwin->w_cursor.col;
+
+ return OK;
+}
+
+/*
+ * Delete "nlines" lines at the cursor.
+ * Saves the lines for undo first if "undo" is TRUE.
+ */
+ void
+del_lines(nlines, undo)
+ long nlines; /* number of lines to delete */
+ int undo; /* if TRUE, prepare for undo */
+{
+ long n;
+
+ if (nlines <= 0)
+ return;
+
+ /* save the deleted lines for undo */
+ if (undo && u_savedel(curwin->w_cursor.lnum, nlines) == FAIL)
+ return;
+
+ for (n = 0; n < nlines; )
+ {
+ if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */
+ break;
+
+ ml_delete(curwin->w_cursor.lnum, TRUE);
+ ++n;
+
+ /* If we delete the last line in the file, stop */
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ break;
+ }
+ /* adjust marks, mark the buffer as changed and prepare for displaying */
+ deleted_lines_mark(curwin->w_cursor.lnum, n);
+
+ curwin->w_cursor.col = 0;
+ check_cursor_lnum();
+}
+
+ int
+gchar_pos(pos)
+ pos_T *pos;
+{
+ char_u *ptr = ml_get_pos(pos);
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ return (*mb_ptr2char)(ptr);
+#endif
+ return (int)*ptr;
+}
+
+ int
+gchar_cursor()
+{
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ return (*mb_ptr2char)(ml_get_cursor());
+#endif
+ return (int)*ml_get_cursor();
+}
+
+/*
+ * Write a character at the current cursor position.
+ * It is directly written into the block.
+ */
+ void
+pchar_cursor(c)
+ int c;
+{
+ *(ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE)
+ + curwin->w_cursor.col) = c;
+}
+
+#if 0 /* not used */
+/*
+ * Put *pos at end of current buffer
+ */
+ void
+goto_endofbuf(pos)
+ pos_T *pos;
+{
+ char_u *p;
+
+ pos->lnum = curbuf->b_ml.ml_line_count;
+ pos->col = 0;
+ p = ml_get(pos->lnum);
+ while (*p++)
+ ++pos->col;
+}
+#endif
+
+/*
+ * When extra == 0: Return TRUE if the cursor is before or on the first
+ * non-blank in the line.
+ * When extra == 1: Return TRUE if the cursor is before the first non-blank in
+ * the line.
+ */
+ int
+inindent(extra)
+ int extra;
+{
+ char_u *ptr;
+ colnr_T col;
+
+ for (col = 0, ptr = ml_get_curline(); vim_iswhite(*ptr); ++col)
+ ++ptr;
+ if (col >= curwin->w_cursor.col + extra)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+/*
+ * Skip to next part of an option argument: Skip space and comma.
+ */
+ char_u *
+skip_to_option_part(p)
+ char_u *p;
+{
+ if (*p == ',')
+ ++p;
+ while (*p == ' ')
+ ++p;
+ return p;
+}
+
+/*
+ * changed() is called when something in the current buffer is changed.
+ *
+ * Most often called through changed_bytes() and changed_lines(), which also
+ * mark the area of the display to be redrawn.
+ */
+ void
+changed()
+{
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ /* The text of the preediting area is inserted, but this doesn't
+ * mean a change of the buffer yet. That is delayed until the
+ * text is committed. (this means preedit becomes empty) */
+ if (im_is_preediting() && !xim_changed_while_preediting)
+ return;
+ xim_changed_while_preediting = FALSE;
+#endif
+
+ if (!curbuf->b_changed)
+ {
+ int save_msg_scroll = msg_scroll;
+
+ change_warning(0);
+ /* Create a swap file if that is wanted.
+ * Don't do this for "nofile" and "nowrite" buffer types. */
+ if (curbuf->b_may_swap
+#ifdef FEAT_QUICKFIX
+ && !bt_dontwrite(curbuf)
+#endif
+ )
+ {
+ ml_open_file(curbuf);
+
+ /* The ml_open_file() can cause an ATTENTION message.
+ * Wait two seconds, to make sure the user reads this unexpected
+ * message. Since we could be anywhere, call wait_return() now,
+ * and don't let the emsg() set msg_scroll. */
+ if (need_wait_return && emsg_silent == 0)
+ {
+ out_flush();
+ ui_delay(2000L, TRUE);
+ wait_return(TRUE);
+ msg_scroll = save_msg_scroll;
+ }
+ }
+ curbuf->b_changed = TRUE;
+ ml_setdirty(curbuf, TRUE);
+#ifdef FEAT_WINDOWS
+ check_status(curbuf);
+#endif
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE; /* set window title later */
+#endif
+ }
+ ++curbuf->b_changedtick;
+ ++global_changedtick;
+}
+
+static void changedOneline __ARGS((linenr_T lnum));
+static void changed_common __ARGS((linenr_T lnum, colnr_T col, linenr_T lnume, long xtra));
+
+/*
+ * Changed bytes within a single line for the current buffer.
+ * - marks the windows on this buffer to be redisplayed
+ * - marks the buffer changed by calling changed()
+ * - invalidates cached values
+ */
+ void
+changed_bytes(lnum, col)
+ linenr_T lnum;
+ colnr_T col;
+{
+ changedOneline(lnum);
+ changed_common(lnum, col, lnum + 1, 0L);
+}
+
+ static void
+changedOneline(lnum)
+ linenr_T lnum;
+{
+ if (curbuf->b_mod_set)
+ {
+ /* find the maximum area that must be redisplayed */
+ if (lnum < curbuf->b_mod_top)
+ curbuf->b_mod_top = lnum;
+ else if (lnum >= curbuf->b_mod_bot)
+ curbuf->b_mod_bot = lnum + 1;
+ }
+ else
+ {
+ /* set the area that must be redisplayed to one line */
+ curbuf->b_mod_set = TRUE;
+ curbuf->b_mod_top = lnum;
+ curbuf->b_mod_bot = lnum + 1;
+ curbuf->b_mod_xlines = 0;
+ }
+}
+
+/*
+ * Appended "count" lines below line "lnum" in the current buffer.
+ * Must be called AFTER the change and after mark_adjust().
+ * Takes care of marking the buffer to be redrawn and sets the changed flag.
+ */
+ void
+appended_lines(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ changed_lines(lnum + 1, 0, lnum + 1, count);
+}
+
+/*
+ * Like appended_lines(), but adjust marks first.
+ */
+ void
+appended_lines_mark(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ mark_adjust(lnum + 1, (linenr_T)MAXLNUM, count, 0L);
+ changed_lines(lnum + 1, 0, lnum + 1, count);
+}
+
+/*
+ * Deleted "count" lines at line "lnum" in the current buffer.
+ * Must be called AFTER the change and after mark_adjust().
+ * Takes care of marking the buffer to be redrawn and sets the changed flag.
+ */
+ void
+deleted_lines(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ changed_lines(lnum, 0, lnum + count, -count);
+}
+
+/*
+ * Like deleted_lines(), but adjust marks first.
+ */
+ void
+deleted_lines_mark(lnum, count)
+ linenr_T lnum;
+ long count;
+{
+ mark_adjust(lnum, (linenr_T)(lnum + count - 1), (long)MAXLNUM, -count);
+ changed_lines(lnum, 0, lnum + count, -count);
+}
+
+/*
+ * Changed lines for the current buffer.
+ * Must be called AFTER the change and after mark_adjust().
+ * - mark the buffer changed by calling changed()
+ * - mark the windows on this buffer to be redisplayed
+ * - invalidate cached values
+ * "lnum" is the first line that needs displaying, "lnume" the first line
+ * below the changed lines (BEFORE the change).
+ * When only inserting lines, "lnum" and "lnume" are equal.
+ * Takes care of calling changed() and updating b_mod_*.
+ */
+ void
+changed_lines(lnum, col, lnume, xtra)
+ linenr_T lnum; /* first line with change */
+ colnr_T col; /* column in first line with change */
+ linenr_T lnume; /* line below last changed line */
+ long xtra; /* number of extra lines (negative when deleting) */
+{
+ if (curbuf->b_mod_set)
+ {
+ /* find the maximum area that must be redisplayed */
+ if (lnum < curbuf->b_mod_top)
+ curbuf->b_mod_top = lnum;
+ if (lnum < curbuf->b_mod_bot)
+ {
+ /* adjust old bot position for xtra lines */
+ curbuf->b_mod_bot += xtra;
+ if (curbuf->b_mod_bot < lnum)
+ curbuf->b_mod_bot = lnum;
+ }
+ if (lnume + xtra > curbuf->b_mod_bot)
+ curbuf->b_mod_bot = lnume + xtra;
+ curbuf->b_mod_xlines += xtra;
+ }
+ else
+ {
+ /* set the area that must be redisplayed */
+ curbuf->b_mod_set = TRUE;
+ curbuf->b_mod_top = lnum;
+ curbuf->b_mod_bot = lnume + xtra;
+ curbuf->b_mod_xlines = xtra;
+ }
+
+ changed_common(lnum, col, lnume, xtra);
+}
+
+ static void
+changed_common(lnum, col, lnume, xtra)
+ linenr_T lnum;
+ colnr_T col;
+ linenr_T lnume;
+ long xtra;
+{
+ win_T *wp;
+ int i;
+#ifdef FEAT_JUMPLIST
+ int cols;
+ pos_T *p;
+ int add;
+#endif
+
+ /* mark the buffer as modified */
+ changed();
+
+ /* set the '. mark */
+ if (!cmdmod.keepjumps)
+ {
+ curbuf->b_last_change.lnum = lnum;
+ curbuf->b_last_change.col = col;
+
+#ifdef FEAT_JUMPLIST
+ /* Create a new entry if a new undo-able change was started or we
+ * don't have an entry yet. */
+ if (curbuf->b_new_change || curbuf->b_changelistlen == 0)
+ {
+ if (curbuf->b_changelistlen == 0)
+ add = TRUE;
+ else
+ {
+ /* Don't create a new entry when the line number is the same
+ * as the last one and the column is not too far away. Avoids
+ * creating many entries for typing "xxxxx". */
+ p = &curbuf->b_changelist[curbuf->b_changelistlen - 1];
+ if (p->lnum != lnum)
+ add = TRUE;
+ else
+ {
+ cols = comp_textwidth(FALSE);
+ if (cols == 0)
+ cols = 79;
+ add = (p->col + cols < col || col + cols < p->col);
+ }
+ }
+ if (add)
+ {
+ /* This is the first of a new sequence of undo-able changes
+ * and it's at some distance of the last change. Use a new
+ * position in the changelist. */
+ curbuf->b_new_change = FALSE;
+
+ if (curbuf->b_changelistlen == JUMPLISTSIZE)
+ {
+ /* changelist is full: remove oldest entry */
+ curbuf->b_changelistlen = JUMPLISTSIZE - 1;
+ mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1,
+ sizeof(pos_T) * (JUMPLISTSIZE - 1));
+ FOR_ALL_WINDOWS(wp)
+ {
+ /* Correct position in changelist for other windows on
+ * this buffer. */
+ if (wp->w_buffer == curbuf && wp->w_changelistidx > 0)
+ --wp->w_changelistidx;
+ }
+ }
+ FOR_ALL_WINDOWS(wp)
+ {
+ /* For other windows, if the position in the changelist is
+ * at the end it stays at the end. */
+ if (wp->w_buffer == curbuf
+ && wp->w_changelistidx == curbuf->b_changelistlen)
+ ++wp->w_changelistidx;
+ }
+ ++curbuf->b_changelistlen;
+ }
+ }
+ curbuf->b_changelist[curbuf->b_changelistlen - 1] =
+ curbuf->b_last_change;
+ /* The current window is always after the last change, so that "g,"
+ * takes you back to it. */
+ curwin->w_changelistidx = curbuf->b_changelistlen;
+#endif
+ }
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer == curbuf)
+ {
+ /* Mark this window to be redrawn later. */
+ if (wp->w_redr_type < VALID)
+ wp->w_redr_type = VALID;
+
+ /* Check if a change in the buffer has invalidated the cached
+ * values for the cursor. */
+#ifdef FEAT_FOLDING
+ /*
+ * Update the folds for this window. Can't postpone this, because
+ * a following operator might work on the whole fold: ">>dd".
+ */
+ foldUpdate(wp, lnum, lnume + xtra - 1);
+
+ /* The change may cause lines above or below the change to become
+ * included in a fold. Set lnum/lnume to the first/last line that
+ * might be displayed differently.
+ * Set w_cline_folded here as an efficient way to update it when
+ * inserting lines just above a closed fold. */
+ i = hasFoldingWin(wp, lnum, &lnum, NULL, FALSE, NULL);
+ if (wp->w_cursor.lnum == lnum)
+ wp->w_cline_folded = i;
+ i = hasFoldingWin(wp, lnume, NULL, &lnume, FALSE, NULL);
+ if (wp->w_cursor.lnum == lnume)
+ wp->w_cline_folded = i;
+
+ /* If the changed line is in a range of previously folded lines,
+ * compare with the first line in that range. */
+ if (wp->w_cursor.lnum <= lnum)
+ {
+ i = find_wl_entry(wp, lnum);
+ if (i >= 0 && wp->w_cursor.lnum > wp->w_lines[i].wl_lnum)
+ changed_line_abv_curs_win(wp);
+ }
+#endif
+
+ if (wp->w_cursor.lnum > lnum)
+ changed_line_abv_curs_win(wp);
+ else if (wp->w_cursor.lnum == lnum && wp->w_cursor.col >= col)
+ changed_cline_bef_curs_win(wp);
+ if (wp->w_botline >= lnum)
+ {
+ /* Assume that botline doesn't change (inserted lines make
+ * other lines scroll down below botline). */
+ approximate_botline_win(wp);
+ }
+
+ /* Check if any w_lines[] entries have become invalid.
+ * For entries below the change: Correct the lnums for
+ * inserted/deleted lines. Makes it possible to stop displaying
+ * after the change. */
+ for (i = 0; i < wp->w_lines_valid; ++i)
+ if (wp->w_lines[i].wl_valid)
+ {
+ if (wp->w_lines[i].wl_lnum >= lnum)
+ {
+ if (wp->w_lines[i].wl_lnum < lnume)
+ {
+ /* line included in change */
+ wp->w_lines[i].wl_valid = FALSE;
+ }
+ else if (xtra != 0)
+ {
+ /* line below change */
+ wp->w_lines[i].wl_lnum += xtra;
+#ifdef FEAT_FOLDING
+ wp->w_lines[i].wl_lastlnum += xtra;
+#endif
+ }
+ }
+#ifdef FEAT_FOLDING
+ else if (wp->w_lines[i].wl_lastlnum >= lnum)
+ {
+ /* change somewhere inside this range of folded lines,
+ * may need to be redrawn */
+ wp->w_lines[i].wl_valid = FALSE;
+ }
+#endif
+ }
+ }
+ }
+
+ /* Call update_screen() later, which checks out what needs to be redrawn,
+ * since it notices b_mod_set and then uses b_mod_*. */
+ if (must_redraw < VALID)
+ must_redraw = VALID;
+}
+
+/*
+ * unchanged() is called when the changed flag must be reset for buffer 'buf'
+ */
+ void
+unchanged(buf, ff)
+ buf_T *buf;
+ int ff; /* also reset 'fileformat' */
+{
+ if (buf->b_changed || (ff && file_ff_differs(buf)))
+ {
+ buf->b_changed = 0;
+ ml_setdirty(buf, FALSE);
+ if (ff)
+ save_file_ff(buf);
+#ifdef FEAT_WINDOWS
+ check_status(buf);
+#endif
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE; /* set window title later */
+#endif
+ }
+ ++buf->b_changedtick;
+ ++global_changedtick;
+#ifdef FEAT_NETBEANS_INTG
+ netbeans_unmodified(buf);
+#endif
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * check_status: called when the status bars for the buffer 'buf'
+ * need to be updated
+ */
+ void
+check_status(buf)
+ buf_T *buf;
+{
+ win_T *wp;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer == buf && wp->w_status_height)
+ {
+ wp->w_redr_status = TRUE;
+ if (must_redraw < VALID)
+ must_redraw = VALID;
+ }
+}
+#endif
+
+/*
+ * If the file is readonly, give a warning message with the first change.
+ * Don't do this for autocommands.
+ * Don't use emsg(), because it flushes the macro buffer.
+ * If we have undone all changes b_changed will be FALSE, but b_did_warn
+ * will be TRUE.
+ */
+ void
+change_warning(col)
+ int col; /* column for message; non-zero when in insert
+ mode and 'showmode' is on */
+{
+ if (curbuf->b_did_warn == FALSE
+ && curbufIsChanged() == 0
+#ifdef FEAT_AUTOCMD
+ && !autocmd_busy
+#endif
+ && curbuf->b_p_ro)
+ {
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_FILECHANGEDRO, NULL, NULL, FALSE, curbuf);
+ if (!curbuf->b_p_ro)
+ return;
+#endif
+ /*
+ * Do what msg() does, but with a column offset if the warning should
+ * be after the mode message.
+ */
+ msg_start();
+ if (msg_row == Rows - 1)
+ msg_col = col;
+ MSG_PUTS_ATTR(_("W10: Warning: Changing a readonly file"),
+ hl_attr(HLF_W) | MSG_HIST);
+ msg_clr_eos();
+ (void)msg_end();
+ if (msg_silent == 0 && !silent_mode)
+ {
+ out_flush();
+ ui_delay(1000L, TRUE); /* give the user time to think about it */
+ }
+ curbuf->b_did_warn = TRUE;
+ redraw_cmdline = FALSE; /* don't redraw and erase the message */
+ if (msg_row < Rows - 1)
+ showmode();
+ }
+}
+
+/*
+ * Ask for a reply from the user, a 'y' or a 'n'.
+ * No other characters are accepted, the message is repeated until a valid
+ * reply is entered or CTRL-C is hit.
+ * If direct is TRUE, don't use vgetc() but ui_inchar(), don't get characters
+ * from any buffers but directly from the user.
+ *
+ * return the 'y' or 'n'
+ */
+ int
+ask_yesno(str, direct)
+ char_u *str;
+ int direct;
+{
+ int r = ' ';
+ int save_State = State;
+
+ if (exiting) /* put terminal in raw mode for this question */
+ settmode(TMODE_RAW);
+ ++no_wait_return;
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ State = CONFIRM; /* mouse behaves like with :confirm */
+#ifdef FEAT_MOUSE
+ setmouse(); /* disables mouse for xterm */
+#endif
+ ++no_mapping;
+ ++allow_keys; /* no mapping here, but recognize keys */
+
+ while (r != 'y' && r != 'n')
+ {
+ /* same highlighting as for wait_return */
+ smsg_attr(hl_attr(HLF_R), (char_u *)"%s (y/n)?", str);
+ if (direct)
+ r = get_keystroke();
+ else
+ r = safe_vgetc();
+ if (r == Ctrl_C || r == ESC)
+ r = 'n';
+ msg_putchar(r); /* show what you typed */
+ out_flush();
+ }
+ --no_wait_return;
+ State = save_State;
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ --no_mapping;
+ --allow_keys;
+
+ return r;
+}
+
+/*
+ * Get a key stroke directly from the user.
+ * Ignores mouse clicks and scrollbar events, except a click for the left
+ * button (used at the more prompt).
+ * Doesn't use vgetc(), because it syncs undo and eats mapped characters.
+ * Disadvantage: typeahead is ignored.
+ * Translates the interrupt character for unix to ESC.
+ */
+ int
+get_keystroke()
+{
+#define CBUFLEN 151
+ char_u buf[CBUFLEN];
+ int len = 0;
+ int n;
+ int save_mapped_ctrl_c = mapped_ctrl_c;
+
+ mapped_ctrl_c = FALSE; /* mappings are not used here */
+ for (;;)
+ {
+ cursor_on();
+ out_flush();
+
+ /* First time: blocking wait. Second time: wait up to 100ms for a
+ * terminal code to complete. Leave some room for check_termcode() to
+ * insert a key code into (max 5 chars plus NUL). And
+ * fix_input_buffer() can triple the number of bytes. */
+ n = ui_inchar(buf + len, (CBUFLEN - 6 - len) / 3,
+ len == 0 ? -1L : 100L, 0);
+ if (n > 0)
+ {
+ /* Replace zero and CSI by a special key code. */
+ n = fix_input_buffer(buf + len, n, FALSE);
+ len += n;
+ }
+
+ /* incomplete termcode: get more characters */
+ if ((n = check_termcode(1, buf, len)) < 0)
+ continue;
+ /* found a termcode: adjust length */
+ if (n > 0)
+ len = n;
+ if (len == 0) /* nothing typed yet */
+ continue;
+
+ /* Handle modifier and/or special key code. */
+ n = buf[0];
+ if (n == K_SPECIAL)
+ {
+ n = TO_SPECIAL(buf[1], buf[2]);
+ if (buf[1] == KS_MODIFIER
+ || n == K_IGNORE
+#ifdef FEAT_MOUSE
+ || n == K_LEFTMOUSE_NM
+ || n == K_LEFTDRAG
+ || n == K_LEFTRELEASE
+ || n == K_LEFTRELEASE_NM
+ || n == K_MIDDLEMOUSE
+ || n == K_MIDDLEDRAG
+ || n == K_MIDDLERELEASE
+ || n == K_RIGHTMOUSE
+ || n == K_RIGHTDRAG
+ || n == K_RIGHTRELEASE
+ || n == K_MOUSEDOWN
+ || n == K_MOUSEUP
+ || n == K_X1MOUSE
+ || n == K_X1DRAG
+ || n == K_X1RELEASE
+ || n == K_X2MOUSE
+ || n == K_X2DRAG
+ || n == K_X2RELEASE
+# ifdef FEAT_GUI
+ || n == K_VER_SCROLLBAR
+ || n == K_HOR_SCROLLBAR
+# endif
+#endif
+ )
+ {
+ if (buf[1] == KS_MODIFIER)
+ mod_mask = buf[2];
+ len -= 3;
+ if (len > 0)
+ mch_memmove(buf, buf + 3, (size_t)len);
+ continue;
+ }
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ if (MB_BYTE2LEN(n) > len)
+ continue; /* more bytes to get */
+ buf[len >= CBUFLEN ? CBUFLEN - 1 : len] = NUL;
+ n = (*mb_ptr2char)(buf);
+ }
+#endif
+#ifdef UNIX
+ if (n == intr_char)
+ n = ESC;
+#endif
+ break;
+ }
+
+ mapped_ctrl_c = save_mapped_ctrl_c;
+ return n;
+}
+
+/*
+ * get a number from the user
+ */
+ int
+get_number(colon)
+ int colon; /* allow colon to abort */
+{
+ int n = 0;
+ int c;
+
+ /* When not printing messages, the user won't know what to type, return a
+ * zero (as if CR was hit). */
+ if (msg_silent != 0)
+ return 0;
+
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ ++no_mapping;
+ ++allow_keys; /* no mapping here, but recognize keys */
+ for (;;)
+ {
+ windgoto(msg_row, msg_col);
+ c = safe_vgetc();
+ if (VIM_ISDIGIT(c))
+ {
+ n = n * 10 + c - '0';
+ msg_putchar(c);
+ }
+ else if (c == K_DEL || c == K_KDEL || c == K_BS || c == Ctrl_H)
+ {
+ n /= 10;
+ MSG_PUTS("\b \b");
+ }
+ else if (n == 0 && c == ':' && colon)
+ {
+ stuffcharReadbuff(':');
+ if (!exmode_active)
+ cmdline_row = msg_row;
+ skip_redraw = TRUE; /* skip redraw once */
+ do_redraw = FALSE;
+ break;
+ }
+ else if (c == CAR || c == NL || c == Ctrl_C || c == ESC)
+ break;
+ }
+ --no_mapping;
+ --allow_keys;
+ return n;
+}
+
+ void
+msgmore(n)
+ long n;
+{
+ long pn;
+
+ if (global_busy /* no messages now, wait until global is finished */
+ || keep_msg != NULL /* there is a message already, skip this one */
+ || !messaging()) /* 'lazyredraw' set, don't do messages now */
+ return;
+
+ if (n > 0)
+ pn = n;
+ else
+ pn = -n;
+
+ if (pn > p_report)
+ {
+ if (pn == 1)
+ {
+ if (n > 0)
+ STRCPY(msg_buf, _("1 more line"));
+ else
+ STRCPY(msg_buf, _("1 line less"));
+ }
+ else
+ {
+ if (n > 0)
+ sprintf((char *)msg_buf, _("%ld more lines"), pn);
+ else
+ sprintf((char *)msg_buf, _("%ld fewer lines"), pn);
+ }
+ if (got_int)
+ STRCAT(msg_buf, _(" (Interrupted)"));
+ if (msg(msg_buf))
+ {
+ set_keep_msg(msg_buf);
+ keep_msg_attr = 0;
+ }
+ }
+}
+
+/*
+ * flush map and typeahead buffers and give a warning for an error
+ */
+ void
+beep_flush()
+{
+ if (emsg_silent == 0)
+ {
+ flush_buffers(FALSE);
+ vim_beep();
+ }
+}
+
+/*
+ * give a warning for an error
+ */
+ void
+vim_beep()
+{
+ if (emsg_silent == 0)
+ {
+ if (p_vb
+#ifdef FEAT_GUI
+ /* While the GUI is starting up the termcap is set for the GUI
+ * but the output still goes to a terminal. */
+ && !(gui.in_use && gui.starting)
+#endif
+ )
+ {
+ out_str(T_VB);
+ }
+ else
+ {
+#ifdef MSDOS
+ /*
+ * The number of beeps outputted is reduced to avoid having to wait
+ * for all the beeps to finish. This is only a problem on systems
+ * where the beeps don't overlap.
+ */
+ if (beep_count == 0 || beep_count == 10)
+ {
+ out_char(BELL);
+ beep_count = 1;
+ }
+ else
+ ++beep_count;
+#else
+ out_char(BELL);
+#endif
+ }
+ }
+}
+
+/*
+ * To get the "real" home directory:
+ * - get value of $HOME
+ * For Unix:
+ * - go to that directory
+ * - do mch_dirname() to get the real name of that directory.
+ * This also works with mounts and links.
+ * Don't do this for MS-DOS, it will change the "current dir" for a drive.
+ */
+static char_u *homedir = NULL;
+
+ void
+init_homedir()
+{
+ char_u *var;
+
+#ifdef VMS
+ var = mch_getenv((char_u *)"SYS$LOGIN");
+#else
+ var = mch_getenv((char_u *)"HOME");
+#endif
+
+ if (var != NULL && *var == NUL) /* empty is same as not set */
+ var = NULL;
+
+#ifdef WIN3264
+ /*
+ * Weird but true: $HOME may contain an indirect reference to another
+ * variable, esp. "%USERPROFILE%". Happens when $USERPROFILE isn't set
+ * when $HOME is being set.
+ */
+ if (var != NULL && *var == '%')
+ {
+ char_u *p;
+ char_u *exp;
+
+ p = vim_strchr(var + 1, '%');
+ if (p != NULL)
+ {
+ STRNCPY(NameBuff, var + 1, p - (var + 1));
+ NameBuff[p - (var + 1)] = NUL;
+ exp = mch_getenv(NameBuff);
+ if (exp != NULL && *exp != NUL
+ && STRLEN(exp) + STRLEN(p) < MAXPATHL)
+ {
+ sprintf((char *)NameBuff, "%s%s", exp, p + 1);
+ var = NameBuff;
+ /* Also set $HOME, it's needed for _viminfo. */
+ vim_setenv((char_u *)"HOME", NameBuff);
+ }
+ }
+ }
+
+ /*
+ * Typically, $HOME is not defined on Windows, unless the user has
+ * specifically defined it for Vim's sake. However, on Windows NT
+ * platforms, $HOMEDRIVE and $HOMEPATH are automatically defined for
+ * each user. Try constructing $HOME from these.
+ */
+ if (var == NULL)
+ {
+ char_u *homedrive, *homepath;
+
+ homedrive = mch_getenv((char_u *)"HOMEDRIVE");
+ homepath = mch_getenv((char_u *)"HOMEPATH");
+ if (homedrive != NULL && homepath != NULL
+ && STRLEN(homedrive) + STRLEN(homepath) < MAXPATHL)
+ {
+ sprintf((char *)NameBuff, "%s%s", homedrive, homepath);
+ if (NameBuff[0] != NUL)
+ {
+ var = NameBuff;
+ /* Also set $HOME, it's needed for _viminfo. */
+ vim_setenv((char_u *)"HOME", NameBuff);
+ }
+ }
+ }
+#endif
+
+#if defined(OS2) || defined(MSDOS) || defined(MSWIN)
+ /*
+ * Default home dir is C:/
+ * Best assumption we can make in such a situation.
+ */
+ if (var == NULL)
+ var = "C:/";
+#endif
+ if (var != NULL)
+ {
+#ifdef UNIX
+ /*
+ * Change to the directory and get the actual path. This resolves
+ * links. Don't do it when we can't return.
+ */
+ if (mch_dirname(NameBuff, MAXPATHL) == OK
+ && mch_chdir((char *)NameBuff) == 0)
+ {
+ if (!mch_chdir((char *)var) && mch_dirname(IObuff, IOSIZE) == OK)
+ var = IObuff;
+ if (mch_chdir((char *)NameBuff) != 0)
+ EMSG(_(e_prev_dir));
+ }
+#endif
+ homedir = vim_strsave(var);
+ }
+}
+
+/*
+ * Expand environment variable with path name.
+ * "~/" is also expanded, using $HOME. For Unix "~user/" is expanded.
+ * Skips over "\ ", "\~" and "\$".
+ * If anything fails no expansion is done and dst equals src.
+ */
+ void
+expand_env(src, dst, dstlen)
+ char_u *src; /* input string e.g. "$HOME/vim.hlp" */
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+{
+ expand_env_esc(src, dst, dstlen, FALSE);
+}
+
+ void
+expand_env_esc(src, dst, dstlen, esc)
+ char_u *src; /* input string e.g. "$HOME/vim.hlp" */
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ int esc; /* escape spaces in expanded variables */
+{
+ char_u *tail;
+ int c;
+ char_u *var;
+ int copy_char;
+ int mustfree; /* var was allocated, need to free it later */
+ int at_start = TRUE; /* at start of a name */
+
+ src = skipwhite(src);
+ --dstlen; /* leave one char space for "\," */
+ while (*src && dstlen > 0)
+ {
+ copy_char = TRUE;
+ if (*src == '$'
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ || *src == '%'
+#endif
+ || (*src == '~' && at_start))
+ {
+ mustfree = FALSE;
+
+ /*
+ * The variable name is copied into dst temporarily, because it may
+ * be a string in read-only memory and a NUL needs to be appended.
+ */
+ if (*src != '~') /* environment var */
+ {
+ tail = src + 1;
+ var = dst;
+ c = dstlen - 1;
+
+#ifdef UNIX
+ /* Unix has ${var-name} type environment vars */
+ if (*tail == '{' && !vim_isIDc('{'))
+ {
+ tail++; /* ignore '{' */
+ while (c-- > 0 && *tail && *tail != '}')
+ *var++ = *tail++;
+ }
+ else
+#endif
+ {
+ while (c-- > 0 && *tail != NUL && ((vim_isIDc(*tail))
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ || (*src == '%' && *tail != '%')
+#endif
+ ))
+ {
+#ifdef OS2 /* env vars only in uppercase */
+ *var++ = TOUPPER_LOC(*tail);
+ tail++; /* toupper() may be a macro! */
+#else
+ *var++ = *tail++;
+#endif
+ }
+ }
+
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX)
+# ifdef UNIX
+ if (src[1] == '{' && *tail != '}')
+# else
+ if (*src == '%' && *tail != '%')
+# endif
+ var = NULL;
+ else
+ {
+# ifdef UNIX
+ if (src[1] == '{')
+# else
+ if (*src == '%')
+#endif
+ ++tail;
+#endif
+ *var = NUL;
+ var = vim_getenv(dst, &mustfree);
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(UNIX)
+ }
+#endif
+ }
+ /* home directory */
+ else if ( src[1] == NUL
+ || vim_ispathsep(src[1])
+ || vim_strchr((char_u *)" ,\t\n", src[1]) != NULL)
+ {
+ var = homedir;
+ tail = src + 1;
+ }
+ else /* user directory */
+ {
+#if defined(UNIX) || (defined(VMS) && defined(USER_HOME))
+ /*
+ * Copy ~user to dst[], so we can put a NUL after it.
+ */
+ tail = src;
+ var = dst;
+ c = dstlen - 1;
+ while ( c-- > 0
+ && *tail
+ && vim_isfilec(*tail)
+ && !vim_ispathsep(*tail))
+ *var++ = *tail++;
+ *var = NUL;
+# ifdef UNIX
+ /*
+ * If the system supports getpwnam(), use it.
+ * Otherwise, or if getpwnam() fails, the shell is used to
+ * expand ~user. This is slower and may fail if the shell
+ * does not support ~user (old versions of /bin/sh).
+ */
+# if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
+ {
+ struct passwd *pw;
+
+ pw = getpwnam((char *)dst + 1);
+ if (pw != NULL)
+ var = (char_u *)pw->pw_dir;
+ else
+ var = NULL;
+ }
+ if (var == NULL)
+# endif
+ {
+ expand_T xpc;
+
+ ExpandInit(&xpc);
+ xpc.xp_context = EXPAND_FILES;
+ var = ExpandOne(&xpc, dst, NULL,
+ WILD_ADD_SLASH|WILD_SILENT, WILD_EXPAND_FREE);
+ ExpandCleanup(&xpc);
+ mustfree = TRUE;
+ }
+
+# else /* !UNIX, thus VMS */
+ /*
+ * USER_HOME is a comma-separated list of
+ * directories to search for the user account in.
+ */
+ {
+ char_u test[MAXPATHL], paths[MAXPATHL];
+ char_u *path, *next_path, *ptr;
+ struct stat st;
+
+ STRCPY(paths, USER_HOME);
+ next_path = paths;
+ while (*next_path)
+ {
+ for (path = next_path; *next_path && *next_path != ',';
+ next_path++);
+ if (*next_path)
+ *next_path++ = NUL;
+ STRCPY(test, path);
+ STRCAT(test, "/");
+ STRCAT(test, dst + 1);
+ if (mch_stat(test, &st) == 0)
+ {
+ var = alloc(STRLEN(test) + 1);
+ STRCPY(var, test);
+ mustfree = TRUE;
+ break;
+ }
+ }
+ }
+# endif /* UNIX */
+#else
+ /* cannot expand user's home directory, so don't try */
+ var = NULL;
+ tail = (char_u *)""; /* for gcc */
+#endif /* UNIX || VMS */
+ }
+
+#ifdef BACKSLASH_IN_FILENAME
+ /* If 'shellslash' is set change backslashes to forward slashes.
+ * Can't use slash_adjust(), p_ssl may be set temporarily. */
+ if (p_ssl && var != NULL && vim_strchr(var, '\\') != NULL)
+ {
+ char_u *p = vim_strsave(var);
+
+ if (p != NULL)
+ {
+ if (mustfree)
+ vim_free(var);
+ var = p;
+ mustfree = TRUE;
+ forward_slash(var);
+ }
+ }
+#endif
+
+ /* If "var" contains white space, escape it with a backslash.
+ * Required for ":e ~/tt" when $HOME includes a space. */
+ if (esc && var != NULL && vim_strpbrk(var, (char_u *)" \t") != NULL)
+ {
+ char_u *p = vim_strsave_escaped(var, (char_u *)" \t");
+
+ if (p != NULL)
+ {
+ if (mustfree)
+ vim_free(var);
+ var = p;
+ mustfree = TRUE;
+ }
+ }
+
+ if (var != NULL && *var != NUL
+ && (STRLEN(var) + STRLEN(tail) + 1 < (unsigned)dstlen))
+ {
+ STRCPY(dst, var);
+ dstlen -= (int)STRLEN(var);
+ dst += STRLEN(var);
+ /* if var[] ends in a path separator and tail[] starts
+ * with it, skip a character */
+ if (*var != NUL && vim_ispathsep(dst[-1])
+#if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
+ && dst[-1] != ':'
+#endif
+ && vim_ispathsep(*tail))
+ ++tail;
+ src = tail;
+ copy_char = FALSE;
+ }
+ if (mustfree)
+ vim_free(var);
+ }
+
+ if (copy_char) /* copy at least one char */
+ {
+ /*
+ * Recogize the start of a new name, for '~'.
+ */
+ at_start = FALSE;
+ if (src[0] == '\\' && src[1] != NUL)
+ {
+ *dst++ = *src++;
+ --dstlen;
+ }
+ else if (src[0] == ' ' || src[0] == ',')
+ at_start = TRUE;
+ *dst++ = *src++;
+ --dstlen;
+ }
+ }
+ *dst = NUL;
+}
+
+/*
+ * Vim's version of getenv().
+ * Special handling of $HOME, $VIM and $VIMRUNTIME.
+ */
+ char_u *
+vim_getenv(name, mustfree)
+ char_u *name;
+ int *mustfree; /* set to TRUE when returned is allocated */
+{
+ char_u *p;
+ char_u *pend;
+ int vimruntime;
+
+#if defined(OS2) || defined(MSDOS) || defined(MSWIN)
+ /* use "C:/" when $HOME is not set */
+ if (STRCMP(name, "HOME") == 0)
+ return homedir;
+#endif
+
+ p = mch_getenv(name);
+ if (p != NULL && *p == NUL) /* empty is the same as not set */
+ p = NULL;
+
+ if (p != NULL)
+ return p;
+
+ vimruntime = (STRCMP(name, "VIMRUNTIME") == 0);
+ if (!vimruntime && STRCMP(name, "VIM") != 0)
+ return NULL;
+
+ /*
+ * When expanding $VIMRUNTIME fails, try using $VIM/vim<version> or $VIM.
+ * Don't do this when default_vimruntime_dir is non-empty.
+ */
+ if (vimruntime
+#ifdef HAVE_PATHDEF
+ && *default_vimruntime_dir == NUL
+#endif
+ )
+ {
+ p = mch_getenv((char_u *)"VIM");
+ if (p != NULL && *p == NUL) /* empty is the same as not set */
+ p = NULL;
+ if (p != NULL)
+ {
+ p = vim_version_dir(p);
+ if (p != NULL)
+ *mustfree = TRUE;
+ else
+ p = mch_getenv((char_u *)"VIM");
+ }
+ }
+
+ /*
+ * When expanding $VIM or $VIMRUNTIME fails, try using:
+ * - the directory name from 'helpfile' (unless it contains '$')
+ * - the executable name from argv[0]
+ */
+ if (p == NULL)
+ {
+ if (p_hf != NULL && vim_strchr(p_hf, '$') == NULL)
+ p = p_hf;
+#ifdef USE_EXE_NAME
+ /*
+ * Use the name of the executable, obtained from argv[0].
+ */
+ else
+ p = exe_name;
+#endif
+ if (p != NULL)
+ {
+ /* remove the file name */
+ pend = gettail(p);
+
+ /* remove "doc/" from 'helpfile', if present */
+ if (p == p_hf)
+ pend = remove_tail(p, pend, (char_u *)"doc");
+
+#ifdef USE_EXE_NAME
+# ifdef MACOS_X
+ /* remove "build/..." from exe_name, if present */
+ if (p == exe_name)
+ {
+ char_u *pend1;
+ char_u *pend2;
+
+ pend1 = remove_tail(p, pend, (char_u *)"Contents/MacOS");
+ pend2 = remove_tail_with_ext(p, pend1, (char_u *)".app");
+ pend = remove_tail(p, pend2, (char_u *)"build");
+ /* When runnig from project builder get rid of the
+ * build/???.app, otherwise keep the ???.app */
+ if (pend2 == pend)
+ pend = pend1;
+ }
+# endif
+ /* remove "src/" from exe_name, if present */
+ if (p == exe_name)
+ pend = remove_tail(p, pend, (char_u *)"src");
+#endif
+
+ /* for $VIM, remove "runtime/" or "vim54/", if present */
+ if (!vimruntime)
+ {
+ pend = remove_tail(p, pend, (char_u *)RUNTIME_DIRNAME);
+ pend = remove_tail(p, pend, (char_u *)VIM_VERSION_NODOT);
+ }
+
+ /* remove trailing path separator */
+#ifndef MACOS_CLASSIC
+ /* With MacOS path (with colons) the final colon is required */
+ /* to avoid confusion between absoulute and relative path */
+ if (pend > p && vim_ispathsep(*(pend - 1)))
+ --pend;
+#endif
+
+ /* check that the result is a directory name */
+ p = vim_strnsave(p, (int)(pend - p));
+
+ if (p != NULL && !mch_isdir(p))
+ {
+ vim_free(p);
+ p = NULL;
+ }
+ else
+ {
+#ifdef USE_EXE_NAME
+ /* may add "/vim54" or "/runtime" if it exists */
+ if (vimruntime && (pend = vim_version_dir(p)) != NULL)
+ {
+ vim_free(p);
+ p = pend;
+ }
+#endif
+ *mustfree = TRUE;
+ }
+ }
+ }
+
+#ifdef HAVE_PATHDEF
+ /* When there is a pathdef.c file we can use default_vim_dir and
+ * default_vimruntime_dir */
+ if (p == NULL)
+ {
+ /* Only use default_vimruntime_dir when it is not empty */
+ if (vimruntime && *default_vimruntime_dir != NUL)
+ {
+ p = default_vimruntime_dir;
+ *mustfree = FALSE;
+ }
+ else if (*default_vim_dir != NUL)
+ {
+ if (vimruntime && (p = vim_version_dir(default_vim_dir)) != NULL)
+ *mustfree = TRUE;
+ else
+ {
+ p = default_vim_dir;
+ *mustfree = FALSE;
+ }
+ }
+ }
+#endif
+
+ /*
+ * Set the environment variable, so that the new value can be found fast
+ * next time, and others can also use it (e.g. Perl).
+ */
+ if (p != NULL)
+ {
+ if (vimruntime)
+ {
+ vim_setenv((char_u *)"VIMRUNTIME", p);
+ didset_vimruntime = TRUE;
+#ifdef FEAT_GETTEXT
+ {
+ char_u *buf = alloc((unsigned int)STRLEN(p) + 6);
+
+ if (buf != NULL)
+ {
+ STRCPY(buf, p);
+ STRCAT(buf, "/lang");
+ bindtextdomain(VIMPACKAGE, (char *)buf);
+ vim_free(buf);
+ }
+ }
+#endif
+ }
+ else
+ {
+ vim_setenv((char_u *)"VIM", p);
+ didset_vim = TRUE;
+ }
+ }
+ return p;
+}
+
+/*
+ * Check if the directory "vimdir/<version>" or "vimdir/runtime" exists.
+ * Return NULL if not, return its name in allocated memory otherwise.
+ */
+ static char_u *
+vim_version_dir(vimdir)
+ char_u *vimdir;
+{
+ char_u *p;
+
+ if (vimdir == NULL || *vimdir == NUL)
+ return NULL;
+ p = concat_fnames(vimdir, (char_u *)VIM_VERSION_NODOT, TRUE);
+ if (p != NULL && mch_isdir(p))
+ return p;
+ vim_free(p);
+ p = concat_fnames(vimdir, (char_u *)RUNTIME_DIRNAME, TRUE);
+ if (p != NULL && mch_isdir(p))
+ return p;
+ vim_free(p);
+ return NULL;
+}
+
+/*
+ * If the string between "p" and "pend" ends in "name/", return "pend" minus
+ * the length of "name/". Otherwise return "pend".
+ */
+ static char_u *
+remove_tail(p, pend, name)
+ char_u *p;
+ char_u *pend;
+ char_u *name;
+{
+ int len = (int)STRLEN(name) + 1;
+ char_u *newend = pend - len;
+
+ if (newend >= p
+ && fnamencmp(newend, name, len - 1) == 0
+ && (newend == p || vim_ispathsep(*(newend - 1))))
+ return newend;
+ return pend;
+}
+
+#if defined(USE_EXE_NAME) && defined(MACOS_X)
+/*
+ * If the string between "p" and "pend" ends in "???.ext/", return "pend"
+ * minus the length of "???.ext/". Otherwise return "pend".
+ */
+ static char_u *
+remove_tail_with_ext(p, pend, ext)
+ char_u *p;
+ char_u *pend;
+ char_u *ext;
+{
+ int len = (int)STRLEN(ext) + 1;
+ char_u *newend = pend - len;
+
+ if (newend >= p && fnamencmp(newend, ext, len - 1) == 0)
+ while (newend != p && !vim_ispathsep(*(newend - 1)))
+ --newend;
+ if (newend == p || vim_ispathsep(*(newend - 1)))
+ return newend;
+ return pend;
+}
+#endif
+
+/*
+ * Call expand_env() and store the result in an allocated string.
+ * This is not very memory efficient, this expects the result to be freed
+ * again soon.
+ */
+ char_u *
+expand_env_save(src)
+ char_u *src;
+{
+ char_u *p;
+
+ p = alloc(MAXPATHL);
+ if (p != NULL)
+ expand_env(src, p, MAXPATHL);
+ return p;
+}
+
+/*
+ * Our portable version of setenv.
+ */
+ void
+vim_setenv(name, val)
+ char_u *name;
+ char_u *val;
+{
+#ifdef HAVE_SETENV
+ mch_setenv((char *)name, (char *)val, 1);
+#else
+ char_u *envbuf;
+
+ /*
+ * Putenv does not copy the string, it has to remain
+ * valid. The allocated memory will never be freed.
+ */
+ envbuf = alloc((unsigned)(STRLEN(name) + STRLEN(val) + 2));
+ if (envbuf != NULL)
+ {
+ sprintf((char *)envbuf, "%s=%s", name, val);
+ putenv((char *)envbuf);
+ }
+#endif
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain an environment variable name.
+ */
+/*ARGSUSED*/
+ char_u *
+get_env_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+# if defined(AMIGA) || defined(__MRC__) || defined(__SC__)
+ /*
+ * No environ[] on the Amiga and on the Mac (using MPW).
+ */
+ return NULL;
+# else
+# ifndef __WIN32__
+ /* Borland C++ 5.2 has this in a header file. */
+ extern char **environ;
+# endif
+ static char_u name[100];
+ char_u *str;
+ int n;
+
+ str = (char_u *)environ[idx];
+ if (str == NULL)
+ return NULL;
+
+ for (n = 0; n < 99; ++n)
+ {
+ if (str[n] == '=' || str[n] == NUL)
+ break;
+ name[n] = str[n];
+ }
+ name[n] = NUL;
+ return name;
+# endif
+}
+#endif
+
+/*
+ * Replace home directory by "~" in each space or comma separated file name in
+ * 'src'.
+ * If anything fails (except when out of space) dst equals src.
+ */
+ void
+home_replace(buf, src, dst, dstlen, one)
+ buf_T *buf; /* when not NULL, check for help files */
+ char_u *src; /* input file name */
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ int one; /* if TRUE, only replace one file name, include
+ spaces and commas in the file name. */
+{
+ size_t dirlen = 0, envlen = 0;
+ size_t len;
+ char_u *homedir_env;
+ char_u *p;
+
+ if (src == NULL)
+ {
+ *dst = NUL;
+ return;
+ }
+
+ /*
+ * If the file is a help file, remove the path completely.
+ */
+ if (buf != NULL && buf->b_help)
+ {
+ STRCPY(dst, gettail(src));
+ return;
+ }
+
+ /*
+ * We check both the value of the $HOME environment variable and the
+ * "real" home directory.
+ */
+ if (homedir != NULL)
+ dirlen = STRLEN(homedir);
+
+#ifdef VMS
+ homedir_env = mch_getenv((char_u *)"SYS$LOGIN");
+#else
+ homedir_env = mch_getenv((char_u *)"HOME");
+#endif
+
+ if (homedir_env != NULL && *homedir_env == NUL)
+ homedir_env = NULL;
+ if (homedir_env != NULL)
+ envlen = STRLEN(homedir_env);
+
+ if (!one)
+ src = skipwhite(src);
+ while (*src && dstlen > 0)
+ {
+ /*
+ * Here we are at the beginning of a file name.
+ * First, check to see if the beginning of the file name matches
+ * $HOME or the "real" home directory. Check that there is a '/'
+ * after the match (so that if e.g. the file is "/home/pieter/bla",
+ * and the home directory is "/home/piet", the file does not end up
+ * as "~er/bla" (which would seem to indicate the file "bla" in user
+ * er's home directory)).
+ */
+ p = homedir;
+ len = dirlen;
+ for (;;)
+ {
+ if ( len
+ && fnamencmp(src, p, len) == 0
+ && (vim_ispathsep(src[len])
+ || (!one && (src[len] == ',' || src[len] == ' '))
+ || src[len] == NUL))
+ {
+ src += len;
+ if (--dstlen > 0)
+ *dst++ = '~';
+
+ /*
+ * If it's just the home directory, add "/".
+ */
+ if (!vim_ispathsep(src[0]) && --dstlen > 0)
+ *dst++ = '/';
+ break;
+ }
+ if (p == homedir_env)
+ break;
+ p = homedir_env;
+ len = envlen;
+ }
+
+ /* if (!one) skip to separator: space or comma */
+ while (*src && (one || (*src != ',' && *src != ' ')) && --dstlen > 0)
+ *dst++ = *src++;
+ /* skip separator */
+ while ((*src == ' ' || *src == ',') && --dstlen > 0)
+ *dst++ = *src++;
+ }
+ /* if (dstlen == 0) out of space, what to do??? */
+
+ *dst = NUL;
+}
+
+/*
+ * Like home_replace, store the replaced string in allocated memory.
+ * When something fails, NULL is returned.
+ */
+ char_u *
+home_replace_save(buf, src)
+ buf_T *buf; /* when not NULL, check for help files */
+ char_u *src; /* input file name */
+{
+ char_u *dst;
+ unsigned len;
+
+ len = 3; /* space for "~/" and trailing NUL */
+ if (src != NULL) /* just in case */
+ len += (unsigned)STRLEN(src);
+ dst = alloc(len);
+ if (dst != NULL)
+ home_replace(buf, src, dst, len, TRUE);
+ return dst;
+}
+
+/*
+ * Compare two file names and return:
+ * FPC_SAME if they both exist and are the same file.
+ * FPC_SAMEX if they both don't exist and have the same file name.
+ * FPC_DIFF if they both exist and are different files.
+ * FPC_NOTX if they both don't exist.
+ * FPC_DIFFX if one of them doesn't exist.
+ * For the first name environment variables are expanded
+ */
+ int
+fullpathcmp(s1, s2, checkname)
+ char_u *s1, *s2;
+ int checkname; /* when both don't exist, check file names */
+{
+#ifdef UNIX
+ char_u exp1[MAXPATHL];
+ char_u full1[MAXPATHL];
+ char_u full2[MAXPATHL];
+ struct stat st1, st2;
+ int r1, r2;
+
+ expand_env(s1, exp1, MAXPATHL);
+ r1 = mch_stat((char *)exp1, &st1);
+ r2 = mch_stat((char *)s2, &st2);
+ if (r1 != 0 && r2 != 0)
+ {
+ /* if mch_stat() doesn't work, may compare the names */
+ if (checkname)
+ {
+ if (fnamecmp(exp1, s2) == 0)
+ return FPC_SAMEX;
+ r1 = vim_FullName(exp1, full1, MAXPATHL, FALSE);
+ r2 = vim_FullName(s2, full2, MAXPATHL, FALSE);
+ if (r1 == OK && r2 == OK && fnamecmp(full1, full2) == 0)
+ return FPC_SAMEX;
+ }
+ return FPC_NOTX;
+ }
+ if (r1 != 0 || r2 != 0)
+ return FPC_DIFFX;
+ if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
+ return FPC_SAME;
+ return FPC_DIFF;
+#else
+ char_u *exp1; /* expanded s1 */
+ char_u *full1; /* full path of s1 */
+ char_u *full2; /* full path of s2 */
+ int retval = FPC_DIFF;
+ int r1, r2;
+
+ /* allocate one buffer to store three paths (alloc()/free() is slow!) */
+ if ((exp1 = alloc(MAXPATHL * 3)) != NULL)
+ {
+ full1 = exp1 + MAXPATHL;
+ full2 = full1 + MAXPATHL;
+
+ expand_env(s1, exp1, MAXPATHL);
+ r1 = vim_FullName(exp1, full1, MAXPATHL, FALSE);
+ r2 = vim_FullName(s2, full2, MAXPATHL, FALSE);
+
+ /* If vim_FullName() fails, the file probably doesn't exist. */
+ if (r1 != OK && r2 != OK)
+ {
+ if (checkname && fnamecmp(exp1, s2) == 0)
+ retval = FPC_SAMEX;
+ else
+ retval = FPC_NOTX;
+ }
+ else if (r1 != OK || r2 != OK)
+ retval = FPC_DIFFX;
+ else if (fnamecmp(full1, full2))
+ retval = FPC_DIFF;
+ else
+ retval = FPC_SAME;
+ vim_free(exp1);
+ }
+ return retval;
+#endif
+}
+
+/*
+ * get the tail of a path: the file name.
+ */
+ char_u *
+gettail(fname)
+ char_u *fname;
+{
+ char_u *p1, *p2;
+
+ if (fname == NULL)
+ return (char_u *)"";
+ for (p1 = p2 = fname; *p2; ) /* find last part of path */
+ {
+ if (vim_ispathsep(*p2))
+ p1 = p2 + 1;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p2 += (*mb_ptr2len_check)(p2);
+ else
+#endif
+ ++p2;
+ }
+ return p1;
+}
+
+/*
+ * get the next path component (just after the next path separator).
+ */
+ char_u *
+getnextcomp(fname)
+ char_u *fname;
+{
+ while (*fname && !vim_ispathsep(*fname))
+ ++fname;
+ if (*fname)
+ ++fname;
+ return fname;
+}
+
+#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \
+ || defined(FEAT_SESSION) || defined(MSWIN) \
+ || (defined(FEAT_GUI_GTK) \
+ && (defined(FEAT_WINDOWS) || defined(FEAT_DND))) \
+ || defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
+ || defined(PROTO)
+/*
+ * Get a pointer to one character past the head of a path name.
+ * Unix: after "/"; DOS: after "c:\"; Amiga: after "disk:/"; Mac: no head.
+ * If there is no head, path is returned.
+ */
+ char_u *
+get_past_head(path)
+ char_u *path;
+{
+ char_u *retval;
+
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ /* may skip "c:" */
+ if (isalpha(path[0]) && path[1] == ':')
+ retval = path + 2;
+ else
+ retval = path;
+#else
+# if defined(AMIGA)
+ /* may skip "label:" */
+ retval = vim_strchr(path, ':');
+ if (retval == NULL)
+ retval = path;
+# else /* Unix */
+ retval = path;
+# endif
+#endif
+
+ while (vim_ispathsep(*retval))
+ ++retval;
+
+ return retval;
+}
+#endif
+
+/*
+ * return TRUE if 'c' is a path separator.
+ */
+ int
+vim_ispathsep(c)
+ int c;
+{
+#ifdef RISCOS
+ return (c == '.' || c == ':');
+#else
+# ifdef UNIX
+ return (c == '/'); /* UNIX has ':' inside file names */
+# else
+# ifdef BACKSLASH_IN_FILENAME
+ return (c == ':' || c == '/' || c == '\\');
+# else
+# ifdef VMS
+ /* server"user passwd"::device:[full.path.name]fname.extension;version" */
+ return (c == ':' || c == '[' || c == ']' || c == '/'
+ || c == '<' || c == '>' || c == '"' );
+# else
+# ifdef COLON_AS_PATHSEP
+ return (c == ':');
+# else /* Amiga */
+ return (c == ':' || c == '/');
+# endif
+# endif /* VMS */
+# endif
+# endif
+#endif /* RISC OS */
+}
+
+#if defined(FEAT_SEARCHPATH) || defined(PROTO)
+/*
+ * return TRUE if 'c' is a path list separator.
+ */
+ int
+vim_ispathlistsep(c)
+ int c;
+{
+#ifdef UNIX
+ return (c == ':');
+#else
+ return (c == ';'); /* might not be rigth for every system... */
+#endif
+}
+#endif
+
+#if (defined(CASE_INSENSITIVE_FILENAME) && defined(BACKSLASH_IN_FILENAME)) \
+ || defined(PROTO)
+/*
+ * Versions of fnamecmp() and fnamencmp() that handle '/' and '\' equally.
+ */
+ int
+vim_fnamecmp(x, y)
+ char_u *x, *y;
+{
+ return vim_fnamencmp(x, y, MAXPATHL);
+}
+
+ int
+vim_fnamencmp(x, y, len)
+ char_u *x, *y;
+ size_t len;
+{
+ while (len > 0 && *x && *y)
+ {
+ if (TOLOWER_LOC(*x) != TOLOWER_LOC(*y)
+ && !(*x == '/' && *y == '\\')
+ && !(*x == '\\' && *y == '/'))
+ break;
+ ++x;
+ ++y;
+ --len;
+ }
+ if (len == 0)
+ return 0;
+ return (*x - *y);
+}
+#endif
+
+/*
+ * Concatenate file names fname1 and fname2 into allocated memory.
+ * Only add a '/' or '\\' when 'sep' is TRUE and it is neccesary.
+ */
+ char_u *
+concat_fnames(fname1, fname2, sep)
+ char_u *fname1;
+ char_u *fname2;
+ int sep;
+{
+ char_u *dest;
+
+ dest = alloc((unsigned)(STRLEN(fname1) + STRLEN(fname2) + 3));
+ if (dest != NULL)
+ {
+ STRCPY(dest, fname1);
+ if (sep)
+ add_pathsep(dest);
+ STRCAT(dest, fname2);
+ }
+ return dest;
+}
+
+/*
+ * Add a path separator to a file name, unless it already ends in a path
+ * separator.
+ */
+ void
+add_pathsep(p)
+ char_u *p;
+{
+ if (*p != NUL && !vim_ispathsep(*(p + STRLEN(p) - 1)))
+ STRCAT(p, PATHSEPSTR);
+}
+
+/*
+ * FullName_save - Make an allocated copy of a full file name.
+ * Returns NULL when out of memory.
+ */
+ char_u *
+FullName_save(fname, force)
+ char_u *fname;
+ int force; /* force expansion, even when it already looks
+ like a full path name */
+{
+ char_u *buf;
+ char_u *new_fname = NULL;
+
+ if (fname == NULL)
+ return NULL;
+
+ buf = alloc((unsigned)MAXPATHL);
+ if (buf != NULL)
+ {
+ if (vim_FullName(fname, buf, MAXPATHL, force) != FAIL)
+ new_fname = vim_strsave(buf);
+ else
+ new_fname = vim_strsave(fname);
+ vim_free(buf);
+ }
+ return new_fname;
+}
+
+#if defined(FEAT_CINDENT) || defined(FEAT_SYN_HL)
+
+static char_u *skip_string __ARGS((char_u *p));
+
+/*
+ * Find the start of a comment, not knowing if we are in a comment right now.
+ * Search starts at w_cursor.lnum and goes backwards.
+ */
+ pos_T *
+find_start_comment(ind_maxcomment) /* XXX */
+ int ind_maxcomment;
+{
+ pos_T *pos;
+ char_u *line;
+ char_u *p;
+
+ if ((pos = findmatchlimit(NULL, '*', FM_BACKWARD, ind_maxcomment)) == NULL)
+ return NULL;
+
+ /*
+ * Check if the comment start we found is inside a string.
+ */
+ line = ml_get(pos->lnum);
+ for (p = line; *p && (unsigned)(p - line) < pos->col; ++p)
+ p = skip_string(p);
+ if ((unsigned)(p - line) > pos->col)
+ return NULL;
+ return pos;
+}
+
+/*
+ * Skip to the end of a "string" and a 'c' character.
+ * If there is no string or character, return argument unmodified.
+ */
+ static char_u *
+skip_string(p)
+ char_u *p;
+{
+ int i;
+
+ /*
+ * We loop, because strings may be concatenated: "date""time".
+ */
+ for ( ; ; ++p)
+ {
+ if (p[0] == '\'') /* 'c' or '\n' or '\000' */
+ {
+ if (!p[1]) /* ' at end of line */
+ break;
+ i = 2;
+ if (p[1] == '\\') /* '\n' or '\000' */
+ {
+ ++i;
+ while (vim_isdigit(p[i - 1])) /* '\000' */
+ ++i;
+ }
+ if (p[i] == '\'') /* check for trailing ' */
+ {
+ p += i;
+ continue;
+ }
+ }
+ else if (p[0] == '"') /* start of string */
+ {
+ for (++p; p[0]; ++p)
+ {
+ if (p[0] == '\\' && p[1] != NUL)
+ ++p;
+ else if (p[0] == '"') /* end of string */
+ break;
+ }
+ if (p[0] == '"')
+ continue;
+ }
+ break; /* no string found */
+ }
+ if (!*p)
+ --p; /* backup from NUL */
+ return p;
+}
+#endif /* FEAT_CINDENT || FEAT_SYN_HL */
+
+#if defined(FEAT_CINDENT) || defined(PROTO)
+
+/*
+ * Do C or expression indenting on the current line.
+ */
+ void
+do_c_expr_indent()
+{
+# ifdef FEAT_EVAL
+ if (*curbuf->b_p_inde != NUL)
+ fixthisline(get_expr_indent);
+ else
+# endif
+ fixthisline(get_c_indent);
+}
+
+/*
+ * Functions for C-indenting.
+ * Most of this originally comes from Eric Fischer.
+ */
+/*
+ * Below "XXX" means that this function may unlock the current line.
+ */
+
+static char_u *cin_skipcomment __ARGS((char_u *));
+static int cin_nocode __ARGS((char_u *));
+static pos_T *find_line_comment __ARGS((void));
+static int cin_islabel_skip __ARGS((char_u **));
+static int cin_isdefault __ARGS((char_u *));
+static char_u *after_label __ARGS((char_u *l));
+static int get_indent_nolabel __ARGS((linenr_T lnum));
+static int skip_label __ARGS((linenr_T, char_u **pp, int ind_maxcomment));
+static int cin_first_id_amount __ARGS((void));
+static int cin_get_equal_amount __ARGS((linenr_T lnum));
+static int cin_ispreproc __ARGS((char_u *));
+static int cin_ispreproc_cont __ARGS((char_u **pp, linenr_T *lnump));
+static int cin_iscomment __ARGS((char_u *));
+static int cin_islinecomment __ARGS((char_u *));
+static int cin_isterminated __ARGS((char_u *, int, int));
+static int cin_isinit __ARGS((void));
+static int cin_isfuncdecl __ARGS((char_u **, linenr_T));
+static int cin_isif __ARGS((char_u *));
+static int cin_iselse __ARGS((char_u *));
+static int cin_isdo __ARGS((char_u *));
+static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
+static int cin_isbreak __ARGS((char_u *));
+static int cin_is_cpp_baseclass __ARGS((char_u *line, colnr_T *col));
+static int cin_ends_in __ARGS((char_u *, char_u *, char_u *));
+static int cin_skip2pos __ARGS((pos_T *trypos));
+static pos_T *find_start_brace __ARGS((int));
+static pos_T *find_match_paren __ARGS((int, int));
+static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
+static int find_last_paren __ARGS((char_u *l, int start, int end));
+static int find_match __ARGS((int lookfor, linenr_T ourscope, int ind_maxparen, int ind_maxcomment));
+
+/*
+ * Skip over white space and C comments within the line.
+ */
+ static char_u *
+cin_skipcomment(s)
+ char_u *s;
+{
+ while (*s)
+ {
+ s = skipwhite(s);
+ if (*s != '/')
+ break;
+ ++s;
+ if (*s == '/') /* slash-slash comment continues till eol */
+ {
+ s += STRLEN(s);
+ break;
+ }
+ if (*s != '*')
+ break;
+ for (++s; *s; ++s) /* skip slash-star comment */
+ if (s[0] == '*' && s[1] == '/')
+ {
+ s += 2;
+ break;
+ }
+ }
+ return s;
+}
+
+/*
+ * Return TRUE if there there is no code at *s. White space and comments are
+ * not considered code.
+ */
+ static int
+cin_nocode(s)
+ char_u *s;
+{
+ return *cin_skipcomment(s) == NUL;
+}
+
+/*
+ * Check previous lines for a "//" line comment, skipping over blank lines.
+ */
+ static pos_T *
+find_line_comment() /* XXX */
+{
+ static pos_T pos;
+ char_u *line;
+ char_u *p;
+
+ pos = curwin->w_cursor;
+ while (--pos.lnum > 0)
+ {
+ line = ml_get(pos.lnum);
+ p = skipwhite(line);
+ if (cin_islinecomment(p))
+ {
+ pos.col = (int)(p - line);
+ return &pos;
+ }
+ if (*p != NUL)
+ break;
+ }
+ return NULL;
+}
+
+/*
+ * Check if string matches "label:"; move to character after ':' if true.
+ */
+ static int
+cin_islabel_skip(s)
+ char_u **s;
+{
+ if (!vim_isIDc(**s)) /* need at least one ID character */
+ return FALSE;
+
+ while (vim_isIDc(**s))
+ (*s)++;
+
+ *s = cin_skipcomment(*s);
+
+ /* "::" is not a label, it's C++ */
+ return (**s == ':' && *++*s != ':');
+}
+
+/*
+ * Recognize a label: "label:".
+ * Note: curwin->w_cursor must be where we are looking for the label.
+ */
+ int
+cin_islabel(ind_maxcomment) /* XXX */
+ int ind_maxcomment;
+{
+ char_u *s;
+
+ s = cin_skipcomment(ml_get_curline());
+
+ /*
+ * Exclude "default" from labels, since it should be indented
+ * like a switch label. Same for C++ scope declarations.
+ */
+ if (cin_isdefault(s))
+ return FALSE;
+ if (cin_isscopedecl(s))
+ return FALSE;
+
+ if (cin_islabel_skip(&s))
+ {
+ /*
+ * Only accept a label if the previous line is terminated or is a case
+ * label.
+ */
+ pos_T cursor_save;
+ pos_T *trypos;
+ char_u *line;
+
+ cursor_save = curwin->w_cursor;
+ while (curwin->w_cursor.lnum > 1)
+ {
+ --curwin->w_cursor.lnum;
+
+ /*
+ * If we're in a comment now, skip to the start of the comment.
+ */
+ curwin->w_cursor.col = 0;
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL) /* XXX */
+ curwin->w_cursor = *trypos;
+
+ line = ml_get_curline();
+ if (cin_ispreproc(line)) /* ignore #defines, #if, etc. */
+ continue;
+ if (*(line = cin_skipcomment(line)) == NUL)
+ continue;
+
+ curwin->w_cursor = cursor_save;
+ if (cin_isterminated(line, TRUE, FALSE)
+ || cin_isscopedecl(line)
+ || cin_iscase(line)
+ || (cin_islabel_skip(&line) && cin_nocode(line)))
+ return TRUE;
+ return FALSE;
+ }
+ curwin->w_cursor = cursor_save;
+ return TRUE; /* label at start of file??? */
+ }
+ return FALSE;
+}
+
+/*
+ * Recognize structure initialization and enumerations.
+ * Q&D-Implementation:
+ * check for "=" at end or "[typedef] enum" at beginning of line.
+ */
+ static int
+cin_isinit(void)
+{
+ char_u *s;
+
+ s = cin_skipcomment(ml_get_curline());
+
+ if (STRNCMP(s, "typedef", 7) == 0 && !vim_isIDc(s[7]))
+ s = cin_skipcomment(s + 7);
+
+ if (STRNCMP(s, "enum", 4) == 0 && !vim_isIDc(s[4]))
+ return TRUE;
+
+ if (cin_ends_in(s, (char_u *)"=", (char_u *)"{"))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+ * Recognize a switch label: "case .*:" or "default:".
+ */
+ int
+cin_iscase(s)
+ char_u *s;
+{
+ s = cin_skipcomment(s);
+ if (STRNCMP(s, "case", 4) == 0 && !vim_isIDc(s[4]))
+ {
+ for (s += 4; *s; ++s)
+ {
+ s = cin_skipcomment(s);
+ if (*s == ':')
+ {
+ if (s[1] == ':') /* skip over "::" for C++ */
+ ++s;
+ else
+ return TRUE;
+ }
+ if (*s == '\'' && s[1] && s[2] == '\'')
+ s += 2; /* skip over '.' */
+ else if (*s == '/' && (s[1] == '*' || s[1] == '/'))
+ return FALSE; /* stop at comment */
+ else if (*s == '"')
+ return FALSE; /* stop at string */
+ }
+ return FALSE;
+ }
+
+ if (cin_isdefault(s))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Recognize a "default" switch label.
+ */
+ static int
+cin_isdefault(s)
+ char_u *s;
+{
+ return (STRNCMP(s, "default", 7) == 0
+ && *(s = cin_skipcomment(s + 7)) == ':'
+ && s[1] != ':');
+}
+
+/*
+ * Recognize a "public/private/proctected" scope declaration label.
+ */
+ int
+cin_isscopedecl(s)
+ char_u *s;
+{
+ int i;
+
+ s = cin_skipcomment(s);
+ if (STRNCMP(s, "public", 6) == 0)
+ i = 6;
+ else if (STRNCMP(s, "protected", 9) == 0)
+ i = 9;
+ else if (STRNCMP(s, "private", 7) == 0)
+ i = 7;
+ else
+ return FALSE;
+ return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':');
+}
+
+/*
+ * Return a pointer to the first non-empty non-comment character after a ':'.
+ * Return NULL if not found.
+ * case 234: a = b;
+ * ^
+ */
+ static char_u *
+after_label(l)
+ char_u *l;
+{
+ for ( ; *l; ++l)
+ {
+ if (*l == ':')
+ {
+ if (l[1] == ':') /* skip over "::" for C++ */
+ ++l;
+ else if (!cin_iscase(l + 1))
+ break;
+ }
+ else if (*l == '\'' && l[1] && l[2] == '\'')
+ l += 2; /* skip over 'x' */
+ }
+ if (*l == NUL)
+ return NULL;
+ l = cin_skipcomment(l + 1);
+ if (*l == NUL)
+ return NULL;
+ return l;
+}
+
+/*
+ * Get indent of line "lnum", skipping a label.
+ * Return 0 if there is nothing after the label.
+ */
+ static int
+get_indent_nolabel(lnum) /* XXX */
+ linenr_T lnum;
+{
+ char_u *l;
+ pos_T fp;
+ colnr_T col;
+ char_u *p;
+
+ l = ml_get(lnum);
+ p = after_label(l);
+ if (p == NULL)
+ return 0;
+
+ fp.col = (colnr_T)(p - l);
+ fp.lnum = lnum;
+ getvcol(curwin, &fp, &col, NULL, NULL);
+ return (int)col;
+}
+
+/*
+ * Find indent for line "lnum", ignoring any case or jump label.
+ * Also return a pointer to the text (after the label).
+ * label: if (asdf && asdfasdf)
+ * ^
+ */
+ static int
+skip_label(lnum, pp, ind_maxcomment)
+ linenr_T lnum;
+ char_u **pp;
+ int ind_maxcomment;
+{
+ char_u *l;
+ int amount;
+ pos_T cursor_save;
+
+ cursor_save = curwin->w_cursor;
+ curwin->w_cursor.lnum = lnum;
+ l = ml_get_curline();
+ /* XXX */
+ if (cin_iscase(l) || cin_isscopedecl(l) || cin_islabel(ind_maxcomment))
+ {
+ amount = get_indent_nolabel(lnum);
+ l = after_label(ml_get_curline());
+ if (l == NULL) /* just in case */
+ l = ml_get_curline();
+ }
+ else
+ {
+ amount = get_indent();
+ l = ml_get_curline();
+ }
+ *pp = l;
+
+ curwin->w_cursor = cursor_save;
+ return amount;
+}
+
+/*
+ * Return the indent of the first variable name after a type in a declaration.
+ * int a, indent of "a"
+ * static struct foo b, indent of "b"
+ * enum bla c, indent of "c"
+ * Returns zero when it doesn't look like a declaration.
+ */
+ static int
+cin_first_id_amount()
+{
+ char_u *line, *p, *s;
+ int len;
+ pos_T fp;
+ colnr_T col;
+
+ line = ml_get_curline();
+ p = skipwhite(line);
+ len = skiptowhite(p) - p;
+ if (len == 6 && STRNCMP(p, "static", 6) == 0)
+ {
+ p = skipwhite(p + 6);
+ len = skiptowhite(p) - p;
+ }
+ if (len == 6 && STRNCMP(p, "struct", 6) == 0)
+ p = skipwhite(p + 6);
+ else if (len == 4 && STRNCMP(p, "enum", 4) == 0)
+ p = skipwhite(p + 4);
+ else if ((len == 8 && STRNCMP(p, "unsigned", 8) == 0)
+ || (len == 6 && STRNCMP(p, "signed", 6) == 0))
+ {
+ s = skipwhite(p + len);
+ if ((STRNCMP(s, "int", 3) == 0 && vim_iswhite(s[3]))
+ || (STRNCMP(s, "long", 4) == 0 && vim_iswhite(s[4]))
+ || (STRNCMP(s, "short", 5) == 0 && vim_iswhite(s[5]))
+ || (STRNCMP(s, "char", 4) == 0 && vim_iswhite(s[4])))
+ p = s;
+ }
+ for (len = 0; vim_isIDc(p[len]); ++len)
+ ;
+ if (len == 0 || !vim_iswhite(p[len]) || cin_nocode(p))
+ return 0;
+
+ p = skipwhite(p + len);
+ fp.lnum = curwin->w_cursor.lnum;
+ fp.col = (colnr_T)(p - line);
+ getvcol(curwin, &fp, &col, NULL, NULL);
+ return (int)col;
+}
+
+/*
+ * Return the indent of the first non-blank after an equal sign.
+ * char *foo = "here";
+ * Return zero if no (useful) equal sign found.
+ * Return -1 if the line above "lnum" ends in a backslash.
+ * foo = "asdf\
+ * asdf\
+ * here";
+ */
+ static int
+cin_get_equal_amount(lnum)
+ linenr_T lnum;
+{
+ char_u *line;
+ char_u *s;
+ colnr_T col;
+ pos_T fp;
+
+ if (lnum > 1)
+ {
+ line = ml_get(lnum - 1);
+ if (*line != NUL && line[STRLEN(line) - 1] == '\\')
+ return -1;
+ }
+
+ line = s = ml_get(lnum);
+ while (*s != NUL && vim_strchr((char_u *)"=;{}\"'", *s) == NULL)
+ {
+ if (cin_iscomment(s)) /* ignore comments */
+ s = cin_skipcomment(s);
+ else
+ ++s;
+ }
+ if (*s != '=')
+ return 0;
+
+ s = skipwhite(s + 1);
+ if (cin_nocode(s))
+ return 0;
+
+ if (*s == '"') /* nice alignment for continued strings */
+ ++s;
+
+ fp.lnum = lnum;
+ fp.col = (colnr_T)(s - line);
+ getvcol(curwin, &fp, &col, NULL, NULL);
+ return (int)col;
+}
+
+/*
+ * Recognize a preprocessor statement: Any line that starts with '#'.
+ */
+ static int
+cin_ispreproc(s)
+ char_u *s;
+{
+ s = skipwhite(s);
+ if (*s == '#')
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
+ * continuation line of a preprocessor statement. Decrease "*lnump" to the
+ * start and return the line in "*pp".
+ */
+ static int
+cin_ispreproc_cont(pp, lnump)
+ char_u **pp;
+ linenr_T *lnump;
+{
+ char_u *line = *pp;
+ linenr_T lnum = *lnump;
+ int retval = FALSE;
+
+ while (1)
+ {
+ if (cin_ispreproc(line))
+ {
+ retval = TRUE;
+ *lnump = lnum;
+ break;
+ }
+ if (lnum == 1)
+ break;
+ line = ml_get(--lnum);
+ if (*line == NUL || line[STRLEN(line) - 1] != '\\')
+ break;
+ }
+
+ if (lnum != *lnump)
+ *pp = ml_get(*lnump);
+ return retval;
+}
+
+/*
+ * Recognize the start of a C or C++ comment.
+ */
+ static int
+cin_iscomment(p)
+ char_u *p;
+{
+ return (p[0] == '/' && (p[1] == '*' || p[1] == '/'));
+}
+
+/*
+ * Recognize the start of a "//" comment.
+ */
+ static int
+cin_islinecomment(p)
+ char_u *p;
+{
+ return (p[0] == '/' && p[1] == '/');
+}
+
+/*
+ * Recognize a line that starts with '{' or '}', or ends with ';', '{' or '}'.
+ * Don't consider "} else" a terminated line.
+ * Return the character terminating the line (ending char's have precedence if
+ * both apply in order to determine initializations).
+ */
+ static int
+cin_isterminated(s, incl_open, incl_comma)
+ char_u *s;
+ int incl_open; /* include '{' at the end as terminator */
+ int incl_comma; /* recognize a trailing comma */
+{
+ char_u found_start = 0;
+
+ s = cin_skipcomment(s);
+
+ if (*s == '{' || (*s == '}' && !cin_iselse(s)))
+ found_start = *s;
+
+ while (*s)
+ {
+ /* skip over comments, "" strings and 'c'haracters */
+ s = skip_string(cin_skipcomment(s));
+ if ((*s == ';' || (incl_open && *s == '{') || *s == '}'
+ || (incl_comma && *s == ','))
+ && cin_nocode(s + 1))
+ return *s;
+
+ if (*s)
+ s++;
+ }
+ return found_start;
+}
+
+/*
+ * Recognize the basic picture of a function declaration -- it needs to
+ * have an open paren somewhere and a close paren at the end of the line and
+ * no semicolons anywhere.
+ * When a line ends in a comma we continue looking in the next line.
+ * "sp" points to a string with the line. When looking at other lines it must
+ * be restored to the line. When it's NULL fetch lines here.
+ * "lnum" is where we start looking.
+ */
+ static int
+cin_isfuncdecl(sp, first_lnum)
+ char_u **sp;
+ linenr_T first_lnum;
+{
+ char_u *s;
+ linenr_T lnum = first_lnum;
+ int retval = FALSE;
+
+ if (sp == NULL)
+ s = ml_get(lnum);
+ else
+ s = *sp;
+
+ while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"')
+ {
+ if (cin_iscomment(s)) /* ignore comments */
+ s = cin_skipcomment(s);
+ else
+ ++s;
+ }
+ if (*s != '(')
+ return FALSE; /* ';', ' or " before any () or no '(' */
+
+ while (*s && *s != ';' && *s != '\'' && *s != '"')
+ {
+ if (*s == ')' && cin_nocode(s + 1))
+ {
+ /* ')' at the end: may have found a match
+ * Check for he previous line not to end in a backslash:
+ * #if defined(x) && \
+ * defined(y)
+ */
+ lnum = first_lnum - 1;
+ s = ml_get(lnum);
+ if (*s == NUL || s[STRLEN(s) - 1] != '\\')
+ retval = TRUE;
+ goto done;
+ }
+ if (*s == ',' && cin_nocode(s + 1))
+ {
+ /* ',' at the end: continue looking in the next line */
+ if (lnum >= curbuf->b_ml.ml_line_count)
+ break;
+
+ s = ml_get(++lnum);
+ }
+ else if (cin_iscomment(s)) /* ignore comments */
+ s = cin_skipcomment(s);
+ else
+ ++s;
+ }
+
+done:
+ if (lnum != first_lnum && sp != NULL)
+ *sp = ml_get(first_lnum);
+
+ return retval;
+}
+
+ static int
+cin_isif(p)
+ char_u *p;
+{
+ return (STRNCMP(p, "if", 2) == 0 && !vim_isIDc(p[2]));
+}
+
+ static int
+cin_iselse(p)
+ char_u *p;
+{
+ if (*p == '}') /* accept "} else" */
+ p = cin_skipcomment(p + 1);
+ return (STRNCMP(p, "else", 4) == 0 && !vim_isIDc(p[4]));
+}
+
+ static int
+cin_isdo(p)
+ char_u *p;
+{
+ return (STRNCMP(p, "do", 2) == 0 && !vim_isIDc(p[2]));
+}
+
+/*
+ * Check if this is a "while" that should have a matching "do".
+ * We only accept a "while (condition) ;", with only white space between the
+ * ')' and ';'. The condition may be spread over several lines.
+ */
+ static int
+cin_iswhileofdo(p, lnum, ind_maxparen) /* XXX */
+ char_u *p;
+ linenr_T lnum;
+ int ind_maxparen;
+{
+ pos_T cursor_save;
+ pos_T *trypos;
+ int retval = FALSE;
+
+ p = cin_skipcomment(p);
+ if (*p == '}') /* accept "} while (cond);" */
+ p = cin_skipcomment(p + 1);
+ if (STRNCMP(p, "while", 5) == 0 && !vim_isIDc(p[5]))
+ {
+ cursor_save = curwin->w_cursor;
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = 0;
+ p = ml_get_curline();
+ while (*p && *p != 'w') /* skip any '}', until the 'w' of the "while" */
+ {
+ ++p;
+ ++curwin->w_cursor.col;
+ }
+ if ((trypos = findmatchlimit(NULL, 0, 0, ind_maxparen)) != NULL
+ && *cin_skipcomment(ml_get_pos(trypos) + 1) == ';')
+ retval = TRUE;
+ curwin->w_cursor = cursor_save;
+ }
+ return retval;
+}
+
+ static int
+cin_isbreak(p)
+ char_u *p;
+{
+ return (STRNCMP(p, "break", 5) == 0 && !vim_isIDc(p[5]));
+}
+
+/* Find the position of a C++ base-class declaration or
+ * constructor-initialization. eg:
+ *
+ * class MyClass :
+ * baseClass <-- here
+ * class MyClass : public baseClass,
+ * anotherBaseClass <-- here (should probably lineup ??)
+ * MyClass::MyClass(...) :
+ * baseClass(...) <-- here (constructor-initialization)
+ */
+ static int
+cin_is_cpp_baseclass(line, col)
+ char_u *line;
+ colnr_T *col;
+{
+ char_u *s;
+ int class_or_struct, lookfor_ctor_init, cpp_base_class;
+
+ *col = 0;
+
+ s = cin_skipcomment(line);
+ if (*s == NUL)
+ return FALSE;
+
+ cpp_base_class = lookfor_ctor_init = class_or_struct = FALSE;
+
+ while(*s != NUL)
+ {
+ if (s[0] == ':')
+ {
+ if (s[1] == ':')
+ {
+ /* skip double colon. It can't be a constructor
+ * initialization any more */
+ lookfor_ctor_init = FALSE;
+ s = cin_skipcomment(s + 2);
+ }
+ else if (lookfor_ctor_init || class_or_struct)
+ {
+ /* we have something found, that looks like the start of
+ * cpp-base-class-declaration or contructor-initialization */
+ cpp_base_class = TRUE;
+ lookfor_ctor_init = class_or_struct = FALSE;
+ *col = 0;
+ s = cin_skipcomment(s + 1);
+ }
+ else
+ s = cin_skipcomment(s + 1);
+ }
+ else if ((STRNCMP(s, "class", 5) == 0 && !vim_isIDc(s[5]))
+ || (STRNCMP(s, "struct", 6) == 0 && !vim_isIDc(s[6])))
+ {
+ class_or_struct = TRUE;
+ lookfor_ctor_init = FALSE;
+
+ if (*s == 'c')
+ s = cin_skipcomment(s + 5);
+ else
+ s = cin_skipcomment(s + 6);
+ }
+ else
+ {
+ if (s[0] == '{' || s[0] == '}' || s[0] == ';')
+ {
+ cpp_base_class = lookfor_ctor_init = class_or_struct = FALSE;
+ }
+ else if (s[0] == ')')
+ {
+ /* Constructor-initialization is assumed if we come across
+ * something like "):" */
+ class_or_struct = FALSE;
+ lookfor_ctor_init = TRUE;
+ }
+ else if (!vim_isIDc(s[0]))
+ {
+ /* if it is not an identifier, we are wrong */
+ class_or_struct = FALSE;
+ lookfor_ctor_init = FALSE;
+ }
+ else if (*col == 0)
+ {
+ /* it can't be a constructor-initialization any more */
+ lookfor_ctor_init = FALSE;
+
+ /* the first statement starts here: lineup with this one... */
+ if (cpp_base_class && *col == 0)
+ *col = (colnr_T)(s - line);
+ }
+
+ s = cin_skipcomment(s + 1);
+ }
+ }
+
+ return cpp_base_class;
+}
+
+/*
+ * Return TRUE if string "s" ends with the string "find", possibly followed by
+ * white space and comments. Skip strings and comments.
+ * Ignore "ignore" after "find" if it's not NULL.
+ */
+ static int
+cin_ends_in(s, find, ignore)
+ char_u *s;
+ char_u *find;
+ char_u *ignore;
+{
+ char_u *p = s;
+ char_u *r;
+ int len = (int)STRLEN(find);
+
+ while (*p != NUL)
+ {
+ p = cin_skipcomment(p);
+ if (STRNCMP(p, find, len) == 0)
+ {
+ r = skipwhite(p + len);
+ if (ignore != NULL && STRNCMP(r, ignore, STRLEN(ignore)) == 0)
+ r = skipwhite(r + STRLEN(ignore));
+ if (cin_nocode(r))
+ return TRUE;
+ }
+ if (*p != NUL)
+ ++p;
+ }
+ return FALSE;
+}
+
+/*
+ * Skip strings, chars and comments until at or past "trypos".
+ * Return the column found.
+ */
+ static int
+cin_skip2pos(trypos)
+ pos_T *trypos;
+{
+ char_u *line;
+ char_u *p;
+
+ p = line = ml_get(trypos->lnum);
+ while (*p && (colnr_T)(p - line) < trypos->col)
+ {
+ if (cin_iscomment(p))
+ p = cin_skipcomment(p);
+ else
+ {
+ p = skip_string(p);
+ ++p;
+ }
+ }
+ return (int)(p - line);
+}
+
+/*
+ * Find the '{' at the start of the block we are in.
+ * Return NULL if no match found.
+ * Ignore a '{' that is in a comment, makes indenting the next three lines
+ * work. */
+/* foo() */
+/* { */
+/* } */
+
+ static pos_T *
+find_start_brace(ind_maxcomment) /* XXX */
+ int ind_maxcomment;
+{
+ pos_T cursor_save;
+ pos_T *trypos;
+ pos_T *pos;
+ static pos_T pos_copy;
+
+ cursor_save = curwin->w_cursor;
+ while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL)
+ {
+ pos_copy = *trypos; /* copy pos_T, next findmatch will change it */
+ trypos = &pos_copy;
+ curwin->w_cursor = *trypos;
+ pos = NULL;
+ /* ignore the { if it's in a // comment */
+ if ((colnr_T)cin_skip2pos(trypos) == trypos->col
+ && (pos = find_start_comment(ind_maxcomment)) == NULL) /* XXX */
+ break;
+ if (pos != NULL)
+ curwin->w_cursor.lnum = pos->lnum;
+ }
+ curwin->w_cursor = cursor_save;
+ return trypos;
+}
+
+/*
+ * Find the matching '(', failing if it is in a comment.
+ * Return NULL of no match found.
+ */
+ static pos_T *
+find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */
+ int ind_maxparen;
+ int ind_maxcomment;
+{
+ pos_T cursor_save;
+ pos_T *trypos;
+ static pos_T pos_copy;
+
+ cursor_save = curwin->w_cursor;
+ if ((trypos = findmatchlimit(NULL, '(', 0, ind_maxparen)) != NULL)
+ {
+ /* check if the ( is in a // comment */
+ if ((colnr_T)cin_skip2pos(trypos) > trypos->col)
+ trypos = NULL;
+ else
+ {
+ pos_copy = *trypos; /* copy trypos, findmatch will change it */
+ trypos = &pos_copy;
+ curwin->w_cursor = *trypos;
+ if (find_start_comment(ind_maxcomment) != NULL) /* XXX */
+ trypos = NULL;
+ }
+ }
+ curwin->w_cursor = cursor_save;
+ return trypos;
+}
+
+/*
+ * Return ind_maxparen corrected for the difference in line number between the
+ * cursor position and "startpos". This makes sure that searching for a
+ * matching paren above the cursor line doesn't find a match because of
+ * looking a few lines further.
+ */
+ static int
+corr_ind_maxparen(ind_maxparen, startpos)
+ int ind_maxparen;
+ pos_T *startpos;
+{
+ long n = (long)startpos->lnum - (long)curwin->w_cursor.lnum;
+
+ if (n > 0 && n < ind_maxparen / 2)
+ return ind_maxparen - (int)n;
+ return ind_maxparen;
+}
+
+/*
+ * Set w_cursor.col to the column number of the last unmatched ')' or '{' in
+ * line "l".
+ */
+ static int
+find_last_paren(l, start, end)
+ char_u *l;
+ int start, end;
+{
+ int i;
+ int retval = FALSE;
+ int open_count = 0;
+
+ curwin->w_cursor.col = 0; /* default is start of line */
+
+ for (i = 0; l[i]; i++)
+ {
+ i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
+ i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */
+ if (l[i] == start)
+ ++open_count;
+ else if (l[i] == end)
+ {
+ if (open_count > 0)
+ --open_count;
+ else
+ {
+ curwin->w_cursor.col = i;
+ retval = TRUE;
+ }
+ }
+ }
+ return retval;
+}
+
+ int
+get_c_indent()
+{
+ /*
+ * spaces from a block's opening brace the prevailing indent for that
+ * block should be
+ */
+ int ind_level = curbuf->b_p_sw;
+
+ /*
+ * spaces from the edge of the line an open brace that's at the end of a
+ * line is imagined to be.
+ */
+ int ind_open_imag = 0;
+
+ /*
+ * spaces from the prevailing indent for a line that is not precededof by
+ * an opening brace.
+ */
+ int ind_no_brace = 0;
+
+ /*
+ * column where the first { of a function should be located }
+ */
+ int ind_first_open = 0;
+
+ /*
+ * spaces from the prevailing indent a leftmost open brace should be
+ * located
+ */
+ int ind_open_extra = 0;
+
+ /*
+ * spaces from the matching open brace (real location for one at the left
+ * edge; imaginary location from one that ends a line) the matching close
+ * brace should be located
+ */
+ int ind_close_extra = 0;
+
+ /*
+ * spaces from the edge of the line an open brace sitting in the leftmost
+ * column is imagined to be
+ */
+ int ind_open_left_imag = 0;
+
+ /*
+ * spaces from the switch() indent a "case xx" label should be located
+ */
+ int ind_case = curbuf->b_p_sw;
+
+ /*
+ * spaces from the "case xx:" code after a switch() should be located
+ */
+ int ind_case_code = curbuf->b_p_sw;
+
+ /*
+ * lineup break at end of case in switch() with case label
+ */
+ int ind_case_break = 0;
+
+ /*
+ * spaces from the class declaration indent a scope declaration label
+ * should be located
+ */
+ int ind_scopedecl = curbuf->b_p_sw;
+
+ /*
+ * spaces from the scope declaration label code should be located
+ */
+ int ind_scopedecl_code = curbuf->b_p_sw;
+
+ /*
+ * amount K&R-style parameters should be indented
+ */
+ int ind_param = curbuf->b_p_sw;
+
+ /*
+ * amount a function type spec should be indented
+ */
+ int ind_func_type = curbuf->b_p_sw;
+
+ /*
+ * amount a cpp base class declaration or constructor initialization
+ * should be indented
+ */
+ int ind_cpp_baseclass = curbuf->b_p_sw;
+
+ /*
+ * additional spaces beyond the prevailing indent a continuation line
+ * should be located
+ */
+ int ind_continuation = curbuf->b_p_sw;
+
+ /*
+ * spaces from the indent of the line with an unclosed parentheses
+ */
+ int ind_unclosed = curbuf->b_p_sw * 2;
+
+ /*
+ * spaces from the indent of the line with an unclosed parentheses, which
+ * itself is also unclosed
+ */
+ int ind_unclosed2 = curbuf->b_p_sw;
+
+ /*
+ * suppress ignoring spaces from the indent of a line starting with an
+ * unclosed parentheses.
+ */
+ int ind_unclosed_noignore = 0;
+
+ /*
+ * If the opening paren is the last nonwhite character on the line, and
+ * ind_unclosed_wrapped is nonzero, use this indent relative to the outer
+ * context (for very long lines).
+ */
+ int ind_unclosed_wrapped = 0;
+
+ /*
+ * suppress ignoring white space when lining up with the character after
+ * an unclosed parentheses.
+ */
+ int ind_unclosed_whiteok = 0;
+
+ /*
+ * indent a closing parentheses under the line start of the matching
+ * opening parentheses.
+ */
+ int ind_matching_paren = 0;
+
+ /*
+ * Extra indent for comments.
+ */
+ int ind_comment = 0;
+
+ /*
+ * spaces from the comment opener when there is nothing after it.
+ */
+ int ind_in_comment = 3;
+
+ /*
+ * boolean: if non-zero, use ind_in_comment even if there is something
+ * after the comment opener.
+ */
+ int ind_in_comment2 = 0;
+
+ /*
+ * max lines to search for an open paren
+ */
+ int ind_maxparen = 20;
+
+ /*
+ * max lines to search for an open comment
+ */
+ int ind_maxcomment = 70;
+
+ /*
+ * handle braces for java code
+ */
+ int ind_java = 0;
+
+ /*
+ * handle blocked cases correctly
+ */
+ int ind_keep_case_label = 0;
+
+ pos_T cur_curpos;
+ int amount;
+ int scope_amount;
+ int cur_amount;
+ colnr_T col;
+ char_u *theline;
+ char_u *linecopy;
+ pos_T *trypos;
+ pos_T *tryposBrace = NULL;
+ pos_T our_paren_pos;
+ char_u *start;
+ int start_brace;
+#define BRACE_IN_COL0 1 /* '{' is in comumn 0 */
+#define BRACE_AT_START 2 /* '{' is at start of line */
+#define BRACE_AT_END 3 /* '{' is at end of line */
+ linenr_T ourscope;
+ char_u *l;
+ char_u *look;
+ char_u terminated;
+ int lookfor;
+#define LOOKFOR_INITIAL 0
+#define LOOKFOR_IF 1
+#define LOOKFOR_DO 2
+#define LOOKFOR_CASE 3
+#define LOOKFOR_ANY 4
+#define LOOKFOR_TERM 5
+#define LOOKFOR_UNTERM 6
+#define LOOKFOR_SCOPEDECL 7
+#define LOOKFOR_NOBREAK 8
+#define LOOKFOR_CPP_BASECLASS 9
+#define LOOKFOR_ENUM_OR_INIT 10
+
+ int whilelevel;
+ linenr_T lnum;
+ char_u *options;
+ int fraction = 0; /* init for GCC */
+ int divider;
+ int n;
+ int iscase;
+ int lookfor_break;
+ int cont_amount = 0; /* amount for continuation line */
+
+ for (options = curbuf->b_p_cino; *options; )
+ {
+ l = options++;
+ if (*options == '-')
+ ++options;
+ n = getdigits(&options);
+ divider = 0;
+ if (*options == '.') /* ".5s" means a fraction */
+ {
+ fraction = atol((char *)++options);
+ while (VIM_ISDIGIT(*options))
+ {
+ ++options;
+ if (divider)
+ divider *= 10;
+ else
+ divider = 10;
+ }
+ }
+ if (*options == 's') /* "2s" means two times 'shiftwidth' */
+ {
+ if (n == 0 && fraction == 0)
+ n = curbuf->b_p_sw; /* just "s" is one 'shiftwidth' */
+ else
+ {
+ n *= curbuf->b_p_sw;
+ if (divider)
+ n += (curbuf->b_p_sw * fraction + divider / 2) / divider;
+ }
+ ++options;
+ }
+ if (l[1] == '-')
+ n = -n;
+ /* When adding an entry here, also update the default 'cinoptions' in
+ * change.txt, and add explanation for it! */
+ switch (*l)
+ {
+ case '>': ind_level = n; break;
+ case 'e': ind_open_imag = n; break;
+ case 'n': ind_no_brace = n; break;
+ case 'f': ind_first_open = n; break;
+ case '{': ind_open_extra = n; break;
+ case '}': ind_close_extra = n; break;
+ case '^': ind_open_left_imag = n; break;
+ case ':': ind_case = n; break;
+ case '=': ind_case_code = n; break;
+ case 'b': ind_case_break = n; break;
+ case 'p': ind_param = n; break;
+ case 't': ind_func_type = n; break;
+ case '/': ind_comment = n; break;
+ case 'c': ind_in_comment = n; break;
+ case 'C': ind_in_comment2 = n; break;
+ case 'i': ind_cpp_baseclass = n; break;
+ case '+': ind_continuation = n; break;
+ case '(': ind_unclosed = n; break;
+ case 'u': ind_unclosed2 = n; break;
+ case 'U': ind_unclosed_noignore = n; break;
+ case 'W': ind_unclosed_wrapped = n; break;
+ case 'w': ind_unclosed_whiteok = n; break;
+ case 'm': ind_matching_paren = n; break;
+ case ')': ind_maxparen = n; break;
+ case '*': ind_maxcomment = n; break;
+ case 'g': ind_scopedecl = n; break;
+ case 'h': ind_scopedecl_code = n; break;
+ case 'j': ind_java = n; break;
+ case 'l': ind_keep_case_label = n; break;
+ }
+ }
+
+ /* remember where the cursor was when we started */
+ cur_curpos = curwin->w_cursor;
+
+ /* Get a copy of the current contents of the line.
+ * This is required, because only the most recent line obtained with
+ * ml_get is valid! */
+ linecopy = vim_strsave(ml_get(cur_curpos.lnum));
+ if (linecopy == NULL)
+ return 0;
+
+ /*
+ * In insert mode and the cursor is on a ')' truncate the line at the
+ * cursor position. We don't want to line up with the matching '(' when
+ * inserting new stuff.
+ * For unknown reasons the cursor might be past the end of the line, thus
+ * check for that.
+ */
+ if ((State & INSERT)
+ && curwin->w_cursor.col < STRLEN(linecopy)
+ && linecopy[curwin->w_cursor.col] == ')')
+ linecopy[curwin->w_cursor.col] = NUL;
+
+ theline = skipwhite(linecopy);
+
+ /* move the cursor to the start of the line */
+
+ curwin->w_cursor.col = 0;
+
+ /*
+ * #defines and so on always go at the left when included in 'cinkeys'.
+ */
+ if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', TRUE)))
+ {
+ amount = 0;
+ }
+
+ /*
+ * Is it a non-case label? Then that goes at the left margin too.
+ */
+ else if (cin_islabel(ind_maxcomment)) /* XXX */
+ {
+ amount = 0;
+ }
+
+ /*
+ * If we're inside a "//" comment and there is a "//" comment in a
+ * previous line, lineup with that one.
+ */
+ else if (cin_islinecomment(theline)
+ && (trypos = find_line_comment()) != NULL) /* XXX */
+ {
+ /* find how indented the line beginning the comment is */
+ getvcol(curwin, trypos, &col, NULL, NULL);
+ amount = col;
+ }
+
+ /*
+ * If we're inside a comment and not looking at the start of the
+ * comment, try using the 'comments' option.
+ */
+ else if (!cin_iscomment(theline)
+ && (trypos = find_start_comment(ind_maxcomment)) != NULL) /* XXX */
+ {
+ int lead_start_len = 2;
+ int lead_middle_len = 1;
+ char_u lead_start[COM_MAX_LEN]; /* start-comment string */
+ char_u lead_middle[COM_MAX_LEN]; /* middle-comment string */
+ char_u lead_end[COM_MAX_LEN]; /* end-comment string */
+ char_u *p;
+ int start_align = 0;
+ int start_off = 0;
+ int done = FALSE;
+
+ /* find how indented the line beginning the comment is */
+ getvcol(curwin, trypos, &col, NULL, NULL);
+ amount = col;
+
+ p = curbuf->b_p_com;
+ while (*p != NUL)
+ {
+ int align = 0;
+ int off = 0;
+ int what = 0;
+
+ while (*p != NUL && *p != ':')
+ {
+ if (*p == COM_START || *p == COM_END || *p == COM_MIDDLE)
+ what = *p++;
+ else if (*p == COM_LEFT || *p == COM_RIGHT)
+ align = *p++;
+ else if (VIM_ISDIGIT(*p) || *p == '-')
+ off = getdigits(&p);
+ else
+ ++p;
+ }
+
+ if (*p == ':')
+ ++p;
+ (void)copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
+ if (what == COM_START)
+ {
+ STRCPY(lead_start, lead_end);
+ lead_start_len = (int)STRLEN(lead_start);
+ start_off = off;
+ start_align = align;
+ }
+ else if (what == COM_MIDDLE)
+ {
+ STRCPY(lead_middle, lead_end);
+ lead_middle_len = (int)STRLEN(lead_middle);
+ }
+ else if (what == COM_END)
+ {
+ /* If our line starts with the middle comment string, line it
+ * up with the comment opener per the 'comments' option. */
+ if (STRNCMP(theline, lead_middle, lead_middle_len) == 0
+ && STRNCMP(theline, lead_end, STRLEN(lead_end)) != 0)
+ {
+ done = TRUE;
+ if (curwin->w_cursor.lnum > 1)
+ {
+ /* If the start comment string matches in the previous
+ * line, use the indent of that line pluss offset. If
+ * the middle comment string matches in the previous
+ * line, use the indent of that line. XXX */
+ look = skipwhite(ml_get(curwin->w_cursor.lnum - 1));
+ if (STRNCMP(look, lead_start, lead_start_len) == 0)
+ amount = get_indent_lnum(curwin->w_cursor.lnum - 1);
+ else if (STRNCMP(look, lead_middle,
+ lead_middle_len) == 0)
+ {
+ amount = get_indent_lnum(curwin->w_cursor.lnum - 1);
+ break;
+ }
+ /* If the start comment string doesn't match with the
+ * start of the comment, skip this entry. XXX */
+ else if (STRNCMP(ml_get(trypos->lnum) + trypos->col,
+ lead_start, lead_start_len) != 0)
+ continue;
+ }
+ if (start_off != 0)
+ amount += start_off;
+ else if (start_align == COM_RIGHT)
+ amount += lead_start_len - lead_middle_len;
+ break;
+ }
+
+ /* If our line starts with the end comment string, line it up
+ * with the middle comment */
+ if (STRNCMP(theline, lead_middle, lead_middle_len) != 0
+ && STRNCMP(theline, lead_end, STRLEN(lead_end)) == 0)
+ {
+ amount = get_indent_lnum(curwin->w_cursor.lnum - 1);
+ /* XXX */
+ if (off != 0)
+ amount += off;
+ else if (align == COM_RIGHT)
+ amount += lead_start_len - lead_middle_len;
+ done = TRUE;
+ break;
+ }
+ }
+ }
+
+ /* If our line starts with an asterisk, line up with the
+ * asterisk in the comment opener; otherwise, line up
+ * with the first character of the comment text.
+ */
+ if (done)
+ ;
+ else if (theline[0] == '*')
+ amount += 1;
+ else
+ {
+ /*
+ * If we are more than one line away from the comment opener, take
+ * the indent of the previous non-empty line. If 'cino' has "CO"
+ * and we are just below the comment opener and there are any
+ * white characters after it line up with the text after it;
+ * otherwise, add the amount specified by "c" in 'cino'
+ */
+ amount = -1;
+ for (lnum = cur_curpos.lnum - 1; lnum > trypos->lnum; --lnum)
+ {
+ if (linewhite(lnum)) /* skip blank lines */
+ continue;
+ amount = get_indent_lnum(lnum); /* XXX */
+ break;
+ }
+ if (amount == -1) /* use the comment opener */
+ {
+ if (!ind_in_comment2)
+ {
+ start = ml_get(trypos->lnum);
+ look = start + trypos->col + 2; /* skip / and * */
+ if (*look != NUL) /* if something after it */
+ trypos->col = (colnr_T)(skipwhite(look) - start);
+ }
+ getvcol(curwin, trypos, &col, NULL, NULL);
+ amount = col;
+ if (ind_in_comment2 || *look == NUL)
+ amount += ind_in_comment;
+ }
+ }
+ }
+
+ /*
+ * Are we inside parentheses or braces?
+ */ /* XXX */
+ else if (((trypos = find_match_paren(ind_maxparen, ind_maxcomment)) != NULL
+ && ind_java == 0)
+ || (tryposBrace = find_start_brace(ind_maxcomment)) != NULL
+ || trypos != NULL)
+ {
+ if (trypos != NULL && tryposBrace != NULL)
+ {
+ /* Both an unmatched '(' and '{' is found. Use the one which is
+ * closer to the current cursor position, set the other to NULL. */
+ if (trypos->lnum != tryposBrace->lnum
+ ? trypos->lnum < tryposBrace->lnum
+ : trypos->col < tryposBrace->col)
+ trypos = NULL;
+ else
+ tryposBrace = NULL;
+ }
+
+ if (trypos != NULL)
+ {
+ /*
+ * If the matching paren is more than one line away, use the indent of
+ * a previous non-empty line that matches the same paren.
+ */
+ amount = -1;
+ cur_amount = MAXCOL;
+ our_paren_pos = *trypos;
+ for (lnum = cur_curpos.lnum - 1; lnum > our_paren_pos.lnum; --lnum)
+ {
+ l = skipwhite(ml_get(lnum));
+ if (cin_nocode(l)) /* skip comment lines */
+ continue;
+ if (cin_ispreproc_cont(&l, &lnum)) /* ignore #defines, #if, etc. */
+ continue;
+ curwin->w_cursor.lnum = lnum;
+
+ /* Skip a comment. XXX */
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
+ {
+ lnum = trypos->lnum + 1;
+ continue;
+ }
+
+ /* XXX */
+ if ((trypos = find_match_paren(
+ corr_ind_maxparen(ind_maxparen, &cur_curpos),
+ ind_maxcomment)) != NULL
+ && trypos->lnum == our_paren_pos.lnum
+ && trypos->col == our_paren_pos.col)
+ {
+ amount = get_indent_lnum(lnum); /* XXX */
+
+ if (theline[0] == ')')
+ {
+ if (our_paren_pos.lnum != lnum && cur_amount > amount)
+ cur_amount = amount;
+ amount = -1;
+ }
+ break;
+ }
+ }
+
+ /*
+ * Line up with line where the matching paren is. XXX
+ * If the line starts with a '(' or the indent for unclosed
+ * parentheses is zero, line up with the unclosed parentheses.
+ */
+ if (amount == -1)
+ {
+ amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
+ if (theline[0] == ')' || ind_unclosed == 0
+ || (!ind_unclosed_noignore && *skipwhite(look) == '('))
+ {
+ /*
+ * If we're looking at a close paren, line up right there;
+ * otherwise, line up with the next (non-white) character.
+ * When ind_unclosed_wrapped is set and the matching paren is
+ * the last nonwhite character of the line, use either the
+ * indent of the current line or the indentation of the next
+ * outer paren and add ind_unclosed_wrapped (for very long
+ * lines).
+ */
+ if (theline[0] != ')')
+ {
+ cur_amount = MAXCOL;
+ l = ml_get(our_paren_pos.lnum);
+ if (ind_unclosed_wrapped
+ && cin_ends_in(l, (char_u *)"(", NULL))
+ {
+ /* look for opening unmatched paren, indent one level
+ * for each additional level */
+ n = 1;
+ for (col = 0; col < our_paren_pos.col; ++col)
+ {
+ switch (l[col])
+ {
+ case '(':
+ case '{': ++n;
+ break;
+
+ case ')':
+ case '}': if (n > 1)
+ --n;
+ break;
+ }
+ }
+
+ our_paren_pos.col = 0;
+ amount += n * ind_unclosed_wrapped;
+ }
+ else if (ind_unclosed_whiteok)
+ our_paren_pos.col++;
+ else
+ {
+ col = our_paren_pos.col + 1;
+ while (vim_iswhite(l[col]))
+ col++;
+ if (l[col] != NUL) /* In case of trailing space */
+ our_paren_pos.col = col;
+ else
+ our_paren_pos.col++;
+ }
+ }
+
+ /*
+ * Find how indented the paren is, or the character after it
+ * if we did the above "if".
+ */
+ if (our_paren_pos.col > 0)
+ {
+ getvcol(curwin, &our_paren_pos, &col, NULL, NULL);
+ if (cur_amount > (int)col)
+ cur_amount = col;
+ }
+ }
+
+ if (theline[0] == ')' && ind_matching_paren)
+ {
+ /* Line up with the start of the matching paren line. */
+ }
+ else if (ind_unclosed == 0 || (!ind_unclosed_noignore
+ && *skipwhite(look) == '('))
+ {
+ if (cur_amount != MAXCOL)
+ amount = cur_amount;
+ }
+ else
+ {
+ /* add ind_unclosed2 for each '(' before our matching one */
+ col = our_paren_pos.col;
+ while (our_paren_pos.col > 0)
+ {
+ --our_paren_pos.col;
+ switch (*ml_get_pos(&our_paren_pos))
+ {
+ case '(': amount += ind_unclosed2;
+ col = our_paren_pos.col;
+ break;
+ case ')': amount -= ind_unclosed2;
+ col = MAXCOL;
+ break;
+ }
+ }
+
+ /* Use ind_unclosed once, when the first '(' is not inside
+ * braces */
+ if (col == MAXCOL)
+ amount += ind_unclosed;
+ else
+ {
+ curwin->w_cursor.lnum = our_paren_pos.lnum;
+ curwin->w_cursor.col = col;
+ if ((trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ amount += ind_unclosed2;
+ else
+ amount += ind_unclosed;
+ }
+ /*
+ * For a line starting with ')' use the minimum of the two
+ * positions, to avoid giving it more indent than the previous
+ * lines:
+ * func_long_name( if (x
+ * arg && yy
+ * ) ^ not here ) ^ not here
+ */
+ if (cur_amount < amount)
+ amount = cur_amount;
+ }
+ }
+
+ /* add extra indent for a comment */
+ if (cin_iscomment(theline))
+ amount += ind_comment;
+ }
+
+ /*
+ * Are we at least inside braces, then?
+ */
+ else
+ {
+ trypos = tryposBrace;
+
+ ourscope = trypos->lnum;
+ start = ml_get(ourscope);
+
+ /*
+ * Now figure out how indented the line is in general.
+ * If the brace was at the start of the line, we use that;
+ * otherwise, check out the indentation of the line as
+ * a whole and then add the "imaginary indent" to that.
+ */
+ look = skipwhite(start);
+ if (*look == '{')
+ {
+ getvcol(curwin, trypos, &col, NULL, NULL);
+ amount = col;
+ if (*start == '{')
+ start_brace = BRACE_IN_COL0;
+ else
+ start_brace = BRACE_AT_START;
+ }
+ else
+ {
+ /*
+ * that opening brace might have been on a continuation
+ * line. if so, find the start of the line.
+ */
+ curwin->w_cursor.lnum = ourscope;
+
+ /*
+ * position the cursor over the rightmost paren, so that
+ * matching it will take us back to the start of the line.
+ */
+ lnum = ourscope;
+ if (find_last_paren(start, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ lnum = trypos->lnum;
+
+ /*
+ * It could have been something like
+ * case 1: if (asdf &&
+ * ldfd) {
+ * }
+ */
+ if (ind_keep_case_label && cin_iscase(skipwhite(ml_get_curline())))
+ amount = get_indent();
+ else
+ amount = skip_label(lnum, &l, ind_maxcomment);
+
+ start_brace = BRACE_AT_END;
+ }
+
+ /*
+ * if we're looking at a closing brace, that's where
+ * we want to be. otherwise, add the amount of room
+ * that an indent is supposed to be.
+ */
+ if (theline[0] == '}')
+ {
+ /*
+ * they may want closing braces to line up with something
+ * other than the open brace. indulge them, if so.
+ */
+ amount += ind_close_extra;
+ }
+ else
+ {
+ /*
+ * If we're looking at an "else", try to find an "if"
+ * to match it with.
+ * If we're looking at a "while", try to find a "do"
+ * to match it with.
+ */
+ lookfor = LOOKFOR_INITIAL;
+ if (cin_iselse(theline))
+ lookfor = LOOKFOR_IF;
+ else if (cin_iswhileofdo(theline, cur_curpos.lnum, ind_maxparen))
+ /* XXX */
+ lookfor = LOOKFOR_DO;
+ if (lookfor != LOOKFOR_INITIAL)
+ {
+ curwin->w_cursor.lnum = cur_curpos.lnum;
+ if (find_match(lookfor, ourscope, ind_maxparen,
+ ind_maxcomment) == OK)
+ {
+ amount = get_indent(); /* XXX */
+ goto theend;
+ }
+ }
+
+ /*
+ * We get here if we are not on an "while-of-do" or "else" (or
+ * failed to find a matching "if").
+ * Search backwards for something to line up with.
+ * First set amount for when we don't find anything.
+ */
+
+ /*
+ * if the '{' is _really_ at the left margin, use the imaginary
+ * location of a left-margin brace. Otherwise, correct the
+ * location for ind_open_extra.
+ */
+
+ if (start_brace == BRACE_IN_COL0) /* '{' is in column 0 */
+ {
+ amount = ind_open_left_imag;
+ }
+ else
+ {
+ if (start_brace == BRACE_AT_END) /* '{' is at end of line */
+ amount += ind_open_imag;
+ else
+ {
+ /* Compensate for adding ind_open_extra later. */
+ amount -= ind_open_extra;
+ if (amount < 0)
+ amount = 0;
+ }
+ }
+
+ lookfor_break = FALSE;
+
+ if (cin_iscase(theline)) /* it's a switch() label */
+ {
+ lookfor = LOOKFOR_CASE; /* find a previous switch() label */
+ amount += ind_case;
+ }
+ else if (cin_isscopedecl(theline)) /* private:, ... */
+ {
+ lookfor = LOOKFOR_SCOPEDECL; /* class decl is this block */
+ amount += ind_scopedecl;
+ }
+ else
+ {
+ if (ind_case_break && cin_isbreak(theline)) /* break; ... */
+ lookfor_break = TRUE;
+
+ lookfor = LOOKFOR_INITIAL;
+ amount += ind_level; /* ind_level from start of block */
+ }
+ scope_amount = amount;
+ whilelevel = 0;
+
+ /*
+ * Search backwards. If we find something we recognize, line up
+ * with that.
+ *
+ * if we're looking at an open brace, indent
+ * the usual amount relative to the conditional
+ * that opens the block.
+ */
+ curwin->w_cursor = cur_curpos;
+ for (;;)
+ {
+ curwin->w_cursor.lnum--;
+ curwin->w_cursor.col = 0;
+
+ /*
+ * If we went all the way back to the start of our scope, line
+ * up with it.
+ */
+ if (curwin->w_cursor.lnum <= ourscope)
+ {
+ /* we reached end of scope:
+ * if looking for a enum or structure initialization
+ * go further back:
+ * if it is an initializer (enum xxx or xxx =), then
+ * don't add ind_continuation, otherwise it is a variable
+ * declaration:
+ * int x,
+ * here; <-- add ind_continuation
+ */
+ if (lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ if (curwin->w_cursor.lnum == 0
+ || curwin->w_cursor.lnum
+ < ourscope - ind_maxparen)
+ {
+ /* nothing found (abuse ind_maxparen as limit)
+ * assume terminated line (i.e. a variable
+ * initialization) */
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ break;
+ }
+
+ l = ml_get_curline();
+
+ /*
+ * If we're in a comment now, skip to the start of the
+ * comment.
+ */
+ trypos = find_start_comment(ind_maxcomment);
+ if (trypos != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
+ continue;
+ }
+
+ /*
+ * Skip preprocessor directives and blank lines.
+ */
+ if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
+ continue;
+
+ if (cin_nocode(l))
+ continue;
+
+ terminated = cin_isterminated(l, FALSE, TRUE);
+
+ /*
+ * If we are at top level and the line looks like a
+ * function declaration, we are done
+ * (it's a variable declaration).
+ */
+ if (start_brace != BRACE_IN_COL0
+ || !cin_isfuncdecl(&l, curwin->w_cursor.lnum))
+ {
+ /* if the line is terminated with another ','
+ * it is a continued variable initialization.
+ * don't add extra indent.
+ * TODO: does not work, if a function
+ * declaration is split over multiple lines:
+ * cin_isfuncdecl returns FALSE then.
+ */
+ if (terminated == ',')
+ break;
+
+ /* if it es a enum declaration or an assignment,
+ * we are done.
+ */
+ if (terminated != ';' && cin_isinit())
+ break;
+
+ /* nothing useful found */
+ if (terminated == 0 || terminated == '{')
+ continue;
+ }
+
+ if (terminated != ';')
+ {
+ /* Skip parens and braces. Position the cursor
+ * over the rightmost paren, so that matching it
+ * will take us back to the start of the line.
+ */ /* XXX */
+ trypos = NULL;
+ if (find_last_paren(l, '(', ')'))
+ trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment);
+
+ if (trypos == NULL && find_last_paren(l, '{', '}'))
+ trypos = find_start_brace(ind_maxcomment);
+
+ if (trypos != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
+ continue;
+ }
+ }
+
+ /* it's a variable declaration, add indentation
+ * like in
+ * int a,
+ * b;
+ */
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ }
+ else if (lookfor == LOOKFOR_UNTERM)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ }
+ else if (lookfor != LOOKFOR_TERM
+ && lookfor != LOOKFOR_CPP_BASECLASS)
+ {
+ amount = scope_amount;
+ if (theline[0] == '{')
+ amount += ind_open_extra;
+ }
+ break;
+ }
+
+ /*
+ * If we're in a comment now, skip to the start of the comment.
+ */ /* XXX */
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
+ continue;
+ }
+
+ l = ml_get_curline();
+
+ /*
+ * If this is a switch() label, may line up relative to that.
+ * if this is a C++ scope declaration, do the same.
+ */
+ iscase = cin_iscase(l);
+ if (iscase || cin_isscopedecl(l))
+ {
+ /* we are only looking for cpp base class
+ * declaration/initialization any longer */
+ if (lookfor == LOOKFOR_CPP_BASECLASS)
+ break;
+
+ /* When looking for a "do" we are not interested in
+ * labels. */
+ if (whilelevel > 0)
+ continue;
+
+ /*
+ * case xx:
+ * c = 99 + <- this indent plus continuation
+ *-> here;
+ */
+ if (lookfor == LOOKFOR_UNTERM
+ || lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ break;
+ }
+
+ /*
+ * case xx: <- line up with this case
+ * x = 333;
+ * case yy:
+ */
+ if ( (iscase && lookfor == LOOKFOR_CASE)
+ || (iscase && lookfor_break)
+ || (!iscase && lookfor == LOOKFOR_SCOPEDECL))
+ {
+ /*
+ * Check that this case label is not for another
+ * switch()
+ */ /* XXX */
+ if ((trypos = find_start_brace(ind_maxcomment)) ==
+ NULL || trypos->lnum == ourscope)
+ {
+ amount = get_indent(); /* XXX */
+ break;
+ }
+ continue;
+ }
+
+ n = get_indent_nolabel(curwin->w_cursor.lnum); /* XXX */
+
+ /*
+ * case xx: if (cond) <- line up with this if
+ * y = y + 1;
+ * -> s = 99;
+ *
+ * case xx:
+ * if (cond) <- line up with this line
+ * y = y + 1;
+ * -> s = 99;
+ */
+ if (lookfor == LOOKFOR_TERM)
+ {
+ if (n)
+ amount = n;
+
+ if (!lookfor_break)
+ break;
+ }
+
+ /*
+ * case xx: x = x + 1; <- line up with this x
+ * -> y = y + 1;
+ *
+ * case xx: if (cond) <- line up with this if
+ * -> y = y + 1;
+ */
+ if (n)
+ {
+ amount = n;
+ l = after_label(ml_get_curline());
+ if (l != NULL && cin_is_cinword(l))
+ amount += ind_level + ind_no_brace;
+ break;
+ }
+
+ /*
+ * Try to get the indent of a statement before the switch
+ * label. If nothing is found, line up relative to the
+ * switch label.
+ * break; <- may line up with this line
+ * case xx:
+ * -> y = 1;
+ */
+ scope_amount = get_indent() + (iscase /* XXX */
+ ? ind_case_code : ind_scopedecl_code);
+ lookfor = ind_case_break ? LOOKFOR_NOBREAK : LOOKFOR_ANY;
+ continue;
+ }
+
+ /*
+ * Looking for a switch() label or C++ scope declaration,
+ * ignore other lines, skip {}-blocks.
+ */
+ if (lookfor == LOOKFOR_CASE || lookfor == LOOKFOR_SCOPEDECL)
+ {
+ if (find_last_paren(l, '{', '}') && (trypos =
+ find_start_brace(ind_maxcomment)) != NULL)
+ curwin->w_cursor.lnum = trypos->lnum + 1;
+ continue;
+ }
+
+ /*
+ * Ignore jump labels with nothing after them.
+ */
+ if (cin_islabel(ind_maxcomment))
+ {
+ l = after_label(ml_get_curline());
+ if (l == NULL || cin_nocode(l))
+ continue;
+ }
+
+ /*
+ * Ignore #defines, #if, etc.
+ * Ignore comment and empty lines.
+ * (need to get the line again, cin_islabel() may have
+ * unlocked it)
+ */
+ l = ml_get_curline();
+ if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum)
+ || cin_nocode(l))
+ continue;
+
+ /*
+ * Are we at the start of a cpp base class declaration or
+ * constructor initialization?
+ */ /* XXX */
+ if (lookfor != LOOKFOR_TERM && ind_cpp_baseclass
+ && cin_is_cpp_baseclass(l, &col))
+ {
+ if (lookfor == LOOKFOR_UNTERM)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ }
+ else if (col == 0 || theline[0] == '{')
+ {
+ amount = get_indent();
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ amount = get_indent_lnum(trypos->lnum); /* XXX */
+ if (theline[0] != '{')
+ amount += ind_cpp_baseclass;
+ }
+ else
+ {
+ curwin->w_cursor.col = col;
+ getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL);
+ amount = (int)col;
+ }
+ break;
+ }
+ else if (lookfor == LOOKFOR_CPP_BASECLASS)
+ {
+ /* only look, whether there is a cpp base class
+ * declaration or initialization before the opening brace. */
+ if (cin_isterminated(l, TRUE, FALSE))
+ break;
+ else
+ continue;
+ }
+
+ /*
+ * What happens next depends on the line being terminated.
+ * If terminated with a ',' only consider it terminating if
+ * there is anoter unterminated statement behind, eg:
+ * 123,
+ * sizeof
+ * here
+ * Otherwise check whether it is a enumeration or structure
+ * initialisation (not indented) or a variable declaration
+ * (indented).
+ */
+ terminated = cin_isterminated(l, FALSE, TRUE);
+
+ if (terminated == 0 || (lookfor != LOOKFOR_UNTERM
+ && terminated == ','))
+ {
+ /*
+ * if we're in the middle of a paren thing,
+ * go back to the line that starts it so
+ * we can get the right prevailing indent
+ * if ( foo &&
+ * bar )
+ */
+ /*
+ * position the cursor over the rightmost paren, so that
+ * matching it will take us back to the start of the line.
+ */
+ (void)find_last_paren(l, '(', ')');
+ trypos = find_match_paren(
+ corr_ind_maxparen(ind_maxparen, &cur_curpos),
+ ind_maxcomment);
+
+ /*
+ * If we are looking for ',', we also look for matching
+ * braces.
+ */
+ if (trypos == NULL && find_last_paren(l, '{', '}'))
+ trypos = find_start_brace(ind_maxcomment);
+
+ if (trypos != NULL)
+ {
+ /*
+ * Check if we are on a case label now. This is
+ * handled above.
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+ curwin->w_cursor.lnum = trypos->lnum;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
+ continue;
+ }
+ }
+
+ /*
+ * Skip over continuation lines to find the one to get the
+ * indent from
+ * char *usethis = "bla\
+ * bla",
+ * here;
+ */
+ if (terminated == ',')
+ {
+ while (curwin->w_cursor.lnum > 1)
+ {
+ l = ml_get(curwin->w_cursor.lnum - 1);
+ if (*l == NUL || l[STRLEN(l) - 1] != '\\')
+ break;
+ --curwin->w_cursor.lnum;
+ }
+ }
+
+ /*
+ * Get indent and pointer to text for current line,
+ * ignoring any jump label. XXX
+ */
+ cur_amount = skip_label(curwin->w_cursor.lnum,
+ &l, ind_maxcomment);
+
+ /*
+ * If this is just above the line we are indenting, and it
+ * starts with a '{', line it up with this line.
+ * while (not)
+ * -> {
+ * }
+ */
+ if (terminated != ',' && lookfor != LOOKFOR_TERM
+ && theline[0] == '{')
+ {
+ amount = cur_amount;
+ /*
+ * Only add ind_open_extra when the current line
+ * doesn't start with a '{', which must have a match
+ * in the same line (scope is the same). Probably:
+ * { 1, 2 },
+ * -> { 3, 4 }
+ */
+ if (*skipwhite(l) != '{')
+ amount += ind_open_extra;
+
+ if (ind_cpp_baseclass)
+ {
+ /* have to look back, whether it is a cpp base
+ * class declaration or initialization */
+ lookfor = LOOKFOR_CPP_BASECLASS;
+ continue;
+ }
+ break;
+ }
+
+ /*
+ * Check if we are after an "if", "while", etc.
+ * Also allow " } else".
+ */
+ if (cin_is_cinword(l) || cin_iselse(skipwhite(l)))
+ {
+ /*
+ * Found an unterminated line after an if (), line up
+ * with the last one.
+ * if (cond)
+ * 100 +
+ * -> here;
+ */
+ if (lookfor == LOOKFOR_UNTERM
+ || lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ break;
+ }
+
+ /*
+ * If this is just above the line we are indenting, we
+ * are finished.
+ * while (not)
+ * -> here;
+ * Otherwise this indent can be used when the line
+ * before this is terminated.
+ * yyy;
+ * if (stat)
+ * while (not)
+ * xxx;
+ * -> here;
+ */
+ amount = cur_amount;
+ if (theline[0] == '{')
+ amount += ind_open_extra;
+ if (lookfor != LOOKFOR_TERM)
+ {
+ amount += ind_level + ind_no_brace;
+ break;
+ }
+
+ /*
+ * Special trick: when expecting the while () after a
+ * do, line up with the while()
+ * do
+ * x = 1;
+ * -> here
+ */
+ l = skipwhite(ml_get_curline());
+ if (cin_isdo(l))
+ {
+ if (whilelevel == 0)
+ break;
+ --whilelevel;
+ }
+
+ /*
+ * When searching for a terminated line, don't use the
+ * one between the "if" and the "else".
+ * Need to use the scope of this "else". XXX
+ * If whilelevel != 0 continue looking for a "do {".
+ */
+ if (cin_iselse(l)
+ && whilelevel == 0
+ && ((trypos = find_start_brace(ind_maxcomment))
+ == NULL
+ || find_match(LOOKFOR_IF, trypos->lnum,
+ ind_maxparen, ind_maxcomment) == FAIL))
+ break;
+ }
+
+ /*
+ * If we're below an unterminated line that is not an
+ * "if" or something, we may line up with this line or
+ * add someting for a continuation line, depending on
+ * the line before this one.
+ */
+ else
+ {
+ /*
+ * Found two unterminated lines on a row, line up with
+ * the last one.
+ * c = 99 +
+ * 100 +
+ * -> here;
+ */
+ if (lookfor == LOOKFOR_UNTERM)
+ {
+ /* When line ends in a comma add extra indent */
+ if (terminated == ',')
+ amount += ind_continuation;
+ break;
+ }
+
+ if (lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ /* Found two lines ending in ',', lineup with the
+ * lowest one, but check for cpp base class
+ * declaration/initialization, if it is an
+ * opening brace or we are looking just for
+ * enumerations/initializations. */
+ if (terminated == ',')
+ {
+ if (ind_cpp_baseclass == 0)
+ break;
+
+ lookfor = LOOKFOR_CPP_BASECLASS;
+ continue;
+ }
+
+ /* Ignore unterminated lines in between, but
+ * reduce indent. */
+ if (amount > cur_amount)
+ amount = cur_amount;
+ }
+ else
+ {
+ /*
+ * Found first unterminated line on a row, may
+ * line up with this line, remember its indent
+ * 100 +
+ * -> here;
+ */
+ amount = cur_amount;
+
+ /*
+ * If previous line ends in ',', check whether we
+ * are in an initialization or enum
+ * struct xxx =
+ * {
+ * sizeof a,
+ * 124 };
+ * or a normal possible continuation line.
+ * but only, of no other statement has been found
+ * yet.
+ */
+ if (lookfor == LOOKFOR_INITIAL && terminated == ',')
+ {
+ lookfor = LOOKFOR_ENUM_OR_INIT;
+ cont_amount = cin_first_id_amount();
+ }
+ else
+ {
+ if (lookfor == LOOKFOR_INITIAL
+ && *l != NUL
+ && l[STRLEN(l) - 1] == '\\')
+ /* XXX */
+ cont_amount = cin_get_equal_amount(
+ curwin->w_cursor.lnum);
+ if (lookfor != LOOKFOR_TERM)
+ lookfor = LOOKFOR_UNTERM;
+ }
+ }
+ }
+ }
+
+ /*
+ * Check if we are after a while (cond);
+ * If so: Ignore until the matching "do".
+ */
+ /* XXX */
+ else if (cin_iswhileofdo(l,
+ curwin->w_cursor.lnum, ind_maxparen))
+ {
+ /*
+ * Found an unterminated line after a while ();, line up
+ * with the last one.
+ * while (cond);
+ * 100 + <- line up with this one
+ * -> here;
+ */
+ if (lookfor == LOOKFOR_UNTERM
+ || lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ break;
+ }
+
+ if (whilelevel == 0)
+ {
+ lookfor = LOOKFOR_TERM;
+ amount = get_indent(); /* XXX */
+ if (theline[0] == '{')
+ amount += ind_open_extra;
+ }
+ ++whilelevel;
+ }
+
+ /*
+ * We are after a "normal" statement.
+ * If we had another statement we can stop now and use the
+ * indent of that other statement.
+ * Otherwise the indent of the current statement may be used,
+ * search backwards for the next "normal" statement.
+ */
+ else
+ {
+ /*
+ * Skip single break line, if before a switch label. It
+ * may be lined up with the case label.
+ */
+ if (lookfor == LOOKFOR_NOBREAK
+ && cin_isbreak(skipwhite(ml_get_curline())))
+ {
+ lookfor = LOOKFOR_ANY;
+ continue;
+ }
+
+ /*
+ * Handle "do {" line.
+ */
+ if (whilelevel > 0)
+ {
+ l = cin_skipcomment(ml_get_curline());
+ if (cin_isdo(l))
+ {
+ amount = get_indent(); /* XXX */
+ --whilelevel;
+ continue;
+ }
+ }
+
+ /*
+ * Found a terminated line above an unterminated line. Add
+ * the amount for a continuation line.
+ * x = 1;
+ * y = foo +
+ * -> here;
+ * or
+ * int x = 1;
+ * int foo,
+ * -> here;
+ */
+ if (lookfor == LOOKFOR_UNTERM
+ || lookfor == LOOKFOR_ENUM_OR_INIT)
+ {
+ if (cont_amount > 0)
+ amount = cont_amount;
+ else
+ amount += ind_continuation;
+ break;
+ }
+
+ /*
+ * Found a terminated line above a terminated line or "if"
+ * etc. line. Use the amount of the line below us.
+ * x = 1; x = 1;
+ * if (asdf) y = 2;
+ * while (asdf) ->here;
+ * here;
+ * ->foo;
+ */
+ if (lookfor == LOOKFOR_TERM)
+ {
+ if (!lookfor_break && whilelevel == 0)
+ break;
+ }
+
+ /*
+ * First line above the one we're indenting is terminated.
+ * To know what needs to be done look further backward for
+ * a terminated line.
+ */
+ else
+ {
+ /*
+ * position the cursor over the rightmost paren, so
+ * that matching it will take us back to the start of
+ * the line. Helps for:
+ * func(asdr,
+ * asdfasdf);
+ * here;
+ */
+term_again:
+ l = ml_get_curline();
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ {
+ /*
+ * Check if we are on a case label now. This is
+ * handled above.
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+ curwin->w_cursor.lnum = trypos->lnum;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
+ continue;
+ }
+ }
+
+ /* When aligning with the case statement, don't align
+ * with a statement after it.
+ * case 1: { <-- don't use this { position
+ * stat;
+ * }
+ * case 2:
+ * stat;
+ * }
+ */
+ iscase = (ind_keep_case_label && cin_iscase(l));
+
+ /*
+ * Get indent and pointer to text for current line,
+ * ignoring any jump label.
+ */
+ amount = skip_label(curwin->w_cursor.lnum,
+ &l, ind_maxcomment);
+
+ if (theline[0] == '{')
+ amount += ind_open_extra;
+ /* See remark above: "Only add ind_open_extra.." */
+ if (*skipwhite(l) == '{')
+ amount -= ind_open_extra;
+ lookfor = iscase ? LOOKFOR_ANY : LOOKFOR_TERM;
+
+ /*
+ * If we're at the end of a block, skip to the start of
+ * that block.
+ */
+ curwin->w_cursor.col = 0;
+ if (*cin_skipcomment(l) == '}'
+ && (trypos = find_start_brace(ind_maxcomment))
+ != NULL) /* XXX */
+ {
+ curwin->w_cursor.lnum = trypos->lnum;
+ /* if not "else {" check for terminated again */
+ /* but skip block for "} else {" */
+ l = cin_skipcomment(ml_get_curline());
+ if (*l == '}' || !cin_iselse(l))
+ goto term_again;
+ ++curwin->w_cursor.lnum;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* add extra indent for a comment */
+ if (cin_iscomment(theline))
+ amount += ind_comment;
+ }
+
+ /*
+ * ok -- we're not inside any sort of structure at all!
+ *
+ * this means we're at the top level, and everything should
+ * basically just match where the previous line is, except
+ * for the lines immediately following a function declaration,
+ * which are K&R-style parameters and need to be indented.
+ */
+ else
+ {
+ /*
+ * if our line starts with an open brace, forget about any
+ * prevailing indent and make sure it looks like the start
+ * of a function
+ */
+
+ if (theline[0] == '{')
+ {
+ amount = ind_first_open;
+ }
+
+ /*
+ * If the NEXT line is a function declaration, the current
+ * line needs to be indented as a function type spec.
+ * Don't do this if the current line looks like a comment
+ * or if the current line is terminated, ie. ends in ';'.
+ */
+ else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
+ && !cin_nocode(theline)
+ && !cin_ends_in(theline, (char_u *)":", NULL)
+ && !cin_ends_in(theline, (char_u *)",", NULL)
+ && cin_isfuncdecl(NULL, cur_curpos.lnum + 1)
+ && !cin_isterminated(theline, FALSE, TRUE))
+ {
+ amount = ind_func_type;
+ }
+ else
+ {
+ amount = 0;
+ curwin->w_cursor = cur_curpos;
+
+ /* search backwards until we find something we recognize */
+
+ while (curwin->w_cursor.lnum > 1)
+ {
+ curwin->w_cursor.lnum--;
+ curwin->w_cursor.col = 0;
+
+ l = ml_get_curline();
+
+ /*
+ * If we're in a comment now, skip to the start of the comment.
+ */ /* XXX */
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
+ continue;
+ }
+
+ /*
+ * Are we at the start of a cpp base class declaration or constructor
+ * initialization?
+ */ /* XXX */
+ if (ind_cpp_baseclass != 0 && theline[0] != '{'
+ && cin_is_cpp_baseclass(l, &col))
+ {
+ if (col == 0)
+ {
+ amount = get_indent() + ind_cpp_baseclass; /* XXX */
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ amount = get_indent_lnum(trypos->lnum)
+ + ind_cpp_baseclass; /* XXX */
+ }
+ else
+ {
+ curwin->w_cursor.col = col;
+ getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL);
+ amount = (int)col;
+ }
+ break;
+ }
+
+ /*
+ * Skip preprocessor directives and blank lines.
+ */
+ if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
+ continue;
+
+ if (cin_nocode(l))
+ continue;
+
+ /*
+ * If the previous line ends in ',', use one level of
+ * indentation:
+ * int foo,
+ * bar;
+ * do this before checking for '}' in case of eg.
+ * enum foobar
+ * {
+ * ...
+ * } foo,
+ * bar;
+ */
+ n = 0;
+ if (cin_ends_in(l, (char_u *)",", NULL)
+ || (*l != NUL && (n = l[STRLEN(l) - 1]) == '\\'))
+ {
+ /* take us back to opening paren */
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ curwin->w_cursor.lnum = trypos->lnum;
+
+ /* For a line ending in ',' that is a continuation line go
+ * back to the first line with a backslash:
+ * char *foo = "bla\
+ * bla",
+ * here;
+ */
+ while (n == 0 && curwin->w_cursor.lnum > 1)
+ {
+ l = ml_get(curwin->w_cursor.lnum - 1);
+ if (*l == NUL || l[STRLEN(l) - 1] != '\\')
+ break;
+ --curwin->w_cursor.lnum;
+ }
+
+ amount = get_indent(); /* XXX */
+
+ if (amount == 0)
+ amount = cin_first_id_amount();
+ if (amount == 0)
+ amount = ind_continuation;
+ break;
+ }
+
+ /*
+ * If the line looks like a function declaration, and we're
+ * not in a comment, put it the left margin.
+ */
+ if (cin_isfuncdecl(NULL, cur_curpos.lnum)) /* XXX */
+ break;
+ l = ml_get_curline();
+
+ /*
+ * Finding the closing '}' of a previous function. Put
+ * current line at the left margin. For when 'cino' has "fs".
+ */
+ if (*skipwhite(l) == '}')
+ break;
+
+ /* (matching {)
+ * If the previous line ends on '};' (maybe followed by
+ * comments) align at column 0. For example:
+ * char *string_array[] = { "foo",
+ * / * x * / "b};ar" }; / * foobar * /
+ */
+ if (cin_ends_in(l, (char_u *)"};", NULL))
+ break;
+
+ /*
+ * If the PREVIOUS line is a function declaration, the current
+ * line (and the ones that follow) needs to be indented as
+ * parameters.
+ */
+ if (cin_isfuncdecl(&l, curwin->w_cursor.lnum))
+ {
+ amount = ind_param;
+ break;
+ }
+
+ /*
+ * If the previous line ends in ';' and the line before the
+ * previous line ends in ',' or '\', ident to column zero:
+ * int foo,
+ * bar;
+ * indent_to_0 here;
+ */
+ if (cin_ends_in(l, (char_u*)";", NULL))
+ {
+ l = ml_get(curwin->w_cursor.lnum - 1);
+ if (cin_ends_in(l, (char_u *)",", NULL)
+ || (*l != NUL && l[STRLEN(l) - 1] == '\\'))
+ break;
+ l = ml_get_curline();
+ }
+
+ /*
+ * Doesn't look like anything interesting -- so just
+ * use the indent of this line.
+ *
+ * Position the cursor over the rightmost paren, so that
+ * matching it will take us back to the start of the line.
+ */
+ find_last_paren(l, '(', ')');
+
+ if ((trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+ curwin->w_cursor.lnum = trypos->lnum;
+ amount = get_indent(); /* XXX */
+ break;
+ }
+
+ /* add extra indent for a comment */
+ if (cin_iscomment(theline))
+ amount += ind_comment;
+
+ /* add extra indent if the previous line ended in a backslash:
+ * "asdfasdf\
+ * here";
+ * char *foo = "asdf\
+ * here";
+ */
+ if (cur_curpos.lnum > 1)
+ {
+ l = ml_get(cur_curpos.lnum - 1);
+ if (*l != NUL && l[STRLEN(l) - 1] == '\\')
+ {
+ cur_amount = cin_get_equal_amount(cur_curpos.lnum - 1);
+ if (cur_amount > 0)
+ amount = cur_amount;
+ else if (cur_amount == 0)
+ amount += ind_continuation;
+ }
+ }
+ }
+ }
+
+theend:
+ /* put the cursor back where it belongs */
+ curwin->w_cursor = cur_curpos;
+
+ vim_free(linecopy);
+
+ if (amount < 0)
+ return 0;
+ return amount;
+}
+
+ static int
+find_match(lookfor, ourscope, ind_maxparen, ind_maxcomment)
+ int lookfor;
+ linenr_T ourscope;
+ int ind_maxparen;
+ int ind_maxcomment;
+{
+ char_u *look;
+ pos_T *theirscope;
+ char_u *mightbeif;
+ int elselevel;
+ int whilelevel;
+
+ if (lookfor == LOOKFOR_IF)
+ {
+ elselevel = 1;
+ whilelevel = 0;
+ }
+ else
+ {
+ elselevel = 0;
+ whilelevel = 1;
+ }
+
+ curwin->w_cursor.col = 0;
+
+ while (curwin->w_cursor.lnum > ourscope + 1)
+ {
+ curwin->w_cursor.lnum--;
+ curwin->w_cursor.col = 0;
+
+ look = cin_skipcomment(ml_get_curline());
+ if (cin_iselse(look)
+ || cin_isif(look)
+ || cin_isdo(look) /* XXX */
+ || cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen))
+ {
+ /*
+ * if we've gone outside the braces entirely,
+ * we must be out of scope...
+ */
+ theirscope = find_start_brace(ind_maxcomment); /* XXX */
+ if (theirscope == NULL)
+ break;
+
+ /*
+ * and if the brace enclosing this is further
+ * back than the one enclosing the else, we're
+ * out of luck too.
+ */
+ if (theirscope->lnum < ourscope)
+ break;
+
+ /*
+ * and if they're enclosed in a *deeper* brace,
+ * then we can ignore it because it's in a
+ * different scope...
+ */
+ if (theirscope->lnum > ourscope)
+ continue;
+
+ /*
+ * if it was an "else" (that's not an "else if")
+ * then we need to go back to another if, so
+ * increment elselevel
+ */
+ look = cin_skipcomment(ml_get_curline());
+ if (cin_iselse(look))
+ {
+ mightbeif = cin_skipcomment(look + 4);
+ if (!cin_isif(mightbeif))
+ ++elselevel;
+ continue;
+ }
+
+ /*
+ * if it was a "while" then we need to go back to
+ * another "do", so increment whilelevel. XXX
+ */
+ if (cin_iswhileofdo(look, curwin->w_cursor.lnum, ind_maxparen))
+ {
+ ++whilelevel;
+ continue;
+ }
+
+ /* If it's an "if" decrement elselevel */
+ look = cin_skipcomment(ml_get_curline());
+ if (cin_isif(look))
+ {
+ elselevel--;
+ /*
+ * When looking for an "if" ignore "while"s that
+ * get in the way.
+ */
+ if (elselevel == 0 && lookfor == LOOKFOR_IF)
+ whilelevel = 0;
+ }
+
+ /* If it's a "do" decrement whilelevel */
+ if (cin_isdo(look))
+ whilelevel--;
+
+ /*
+ * if we've used up all the elses, then
+ * this must be the if that we want!
+ * match the indent level of that if.
+ */
+ if (elselevel <= 0 && whilelevel <= 0)
+ {
+ return OK;
+ }
+ }
+ }
+ return FAIL;
+}
+
+# if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Get indent level from 'indentexpr'.
+ */
+ int
+get_expr_indent()
+{
+ int indent;
+ pos_T pos;
+ int save_State;
+
+ pos = curwin->w_cursor;
+ set_vim_var_nr(VV_LNUM, curwin->w_cursor.lnum);
+ ++sandbox;
+ indent = eval_to_number(curbuf->b_p_inde);
+ --sandbox;
+
+ /* Restore the cursor position so that 'indentexpr' doesn't need to.
+ * Pretend to be in Insert mode, allow cursor past end of line for "o"
+ * command. */
+ save_State = State;
+ State = INSERT;
+ curwin->w_cursor = pos;
+ check_cursor();
+ State = save_State;
+
+ /* If there is an error, just keep the current indent. */
+ if (indent < 0)
+ indent = get_indent();
+
+ return indent;
+}
+# endif
+
+#endif /* FEAT_CINDENT */
+
+#if defined(FEAT_LISP) || defined(PROTO)
+
+static int lisp_match __ARGS((char_u *p));
+
+ static int
+lisp_match(p)
+ char_u *p;
+{
+ char_u buf[LSIZE];
+ int len;
+ char_u *word = p_lispwords;
+
+ while (*word != NUL)
+ {
+ (void)copy_option_part(&word, buf, LSIZE, ",");
+ len = (int)STRLEN(buf);
+ if (STRNCMP(buf, p, len) == 0 && p[len] == ' ')
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * When 'p' is present in 'cpoptions, a Vi compatible method is used.
+ * The incompatible newer method is quite a bit better at indenting
+ * code in lisp-like languages than the traditional one; it's still
+ * mostly heuristics however -- Dirk van Deun, dirk@rave.org
+ *
+ * TODO:
+ * Findmatch() should be adapted for lisp, also to make showmatch
+ * work correctly: now (v5.3) it seems all C/C++ oriented:
+ * - it does not recognize the #\( and #\) notations as character literals
+ * - it doesn't know about comments starting with a semicolon
+ * - it incorrectly interprets '(' as a character literal
+ * All this messes up get_lisp_indent in some rare cases.
+ */
+ int
+get_lisp_indent()
+{
+ pos_T *pos, realpos;
+ int amount;
+ char_u *that;
+ colnr_T col;
+ colnr_T firsttry;
+ int parencount, quotecount;
+ int vi_lisp;
+
+ /* Set vi_lisp to use the vi-compatible method */
+ vi_lisp = (vim_strchr(p_cpo, CPO_LISP) != NULL);
+
+ realpos = curwin->w_cursor;
+ curwin->w_cursor.col = 0;
+
+ if ((pos = findmatch(NULL, '(')) != NULL)
+ {
+ /* Extra trick: Take the indent of the first previous non-white
+ * line that is at the same () level. */
+ amount = -1;
+ parencount = 0;
+
+ while (--curwin->w_cursor.lnum >= pos->lnum)
+ {
+ if (linewhite(curwin->w_cursor.lnum))
+ continue;
+ for (that = ml_get_curline(); *that != NUL; ++that)
+ {
+ if (*that == ';')
+ {
+ while (*(that + 1) != NUL)
+ ++that;
+ continue;
+ }
+ if (*that == '\\')
+ {
+ if (*(that + 1) != NUL)
+ ++that;
+ continue;
+ }
+ if (*that == '"' && *(that + 1) != NUL)
+ {
+ that++;
+ while (*that && (*that != '"' || *(that - 1) == '\\'))
+ ++that;
+ }
+ if (*that == '(')
+ ++parencount;
+ else if (*that == ')')
+ --parencount;
+ }
+ if (parencount == 0)
+ {
+ amount = get_indent();
+ break;
+ }
+ }
+
+ if (amount == -1)
+ {
+ curwin->w_cursor.lnum = pos->lnum;
+ curwin->w_cursor.col = pos->col;
+ col = pos->col;
+
+ that = ml_get_curline();
+
+ if (vi_lisp && get_indent() == 0)
+ amount = 2;
+ else
+ {
+ amount = 0;
+ while (*that && col)
+ {
+ amount += lbr_chartabsize_adv(&that, (colnr_T)amount);
+ col--;
+ }
+
+ /*
+ * Some keywords require "body" indenting rules (the
+ * non-standard-lisp ones are Scheme special forms):
+ *
+ * (let ((a 1)) instead (let ((a 1))
+ * (...)) of (...))
+ */
+
+ if (!vi_lisp && *that == '(' && lisp_match(that + 1))
+ amount += 2;
+ else
+ {
+ that++;
+ amount++;
+ firsttry = amount;
+
+ while (vim_iswhite(*that))
+ {
+ amount += lbr_chartabsize(that, (colnr_T)amount);
+ ++that;
+ }
+
+ if (*that && *that != ';') /* not a comment line */
+ {
+ /* test *that != '(' to accomodate first let/do
+ * argument if it is more than one line */
+ if (!vi_lisp && *that != '(')
+ firsttry++;
+
+ parencount = 0;
+ quotecount = 0;
+
+ if (vi_lisp
+ || (*that != '"'
+ && *that != '\''
+ && *that != '#'
+ && (*that < '0' || *that > '9')))
+ {
+ while (*that
+ && (!vim_iswhite(*that)
+ || quotecount
+ || parencount)
+ && (!(*that == '('
+ && !quotecount
+ && !parencount
+ && vi_lisp)))
+ {
+ if (*that == '"')
+ quotecount = !quotecount;
+ if (*that == '(' && !quotecount)
+ ++parencount;
+ if (*that == ')' && !quotecount)
+ --parencount;
+ if (*that == '\\' && *(that+1) != NUL)
+ amount += lbr_chartabsize_adv(&that,
+ (colnr_T)amount);
+ amount += lbr_chartabsize_adv(&that,
+ (colnr_T)amount);
+ }
+ }
+ while (vim_iswhite(*that))
+ {
+ amount += lbr_chartabsize(that, (colnr_T)amount);
+ that++;
+ }
+ if (!*that || *that == ';')
+ amount = firsttry;
+ }
+ }
+ }
+ }
+ }
+ else
+ amount = 0; /* no matching '(' found, use zero indent */
+
+ curwin->w_cursor = realpos;
+
+ return amount;
+}
+#endif /* FEAT_LISP */
+
+ void
+prepare_to_exit()
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui.dying = TRUE;
+ out_trash(); /* trash any pending output */
+ }
+ else
+#endif
+ {
+ windgoto((int)Rows - 1, 0);
+
+ /*
+ * Switch terminal mode back now, so messages end up on the "normal"
+ * screen (if there are two screens).
+ */
+ settmode(TMODE_COOK);
+#ifdef WIN3264
+ if (can_end_termcap_mode(FALSE) == TRUE)
+#endif
+ stoptermcap();
+ out_flush();
+ }
+}
+
+/*
+ * Preserve files and exit.
+ * When called IObuff must contain a message.
+ */
+ void
+preserve_exit()
+{
+ buf_T *buf;
+
+ prepare_to_exit();
+
+ out_str(IObuff);
+ screen_start(); /* don't know where cursor is now */
+ out_flush();
+
+ ml_close_notmod(); /* close all not-modified buffers */
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
+ {
+ OUT_STR(_("Vim: preserving files...\n"));
+ screen_start(); /* don't know where cursor is now */
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+ break;
+ }
+ }
+
+ ml_close_all(FALSE); /* close all memfiles, without deleting */
+
+ OUT_STR(_("Vim: Finished.\n"));
+
+ getout(1);
+}
+
+/*
+ * return TRUE if "fname" exists.
+ */
+ int
+vim_fexists(fname)
+ char_u *fname;
+{
+ struct stat st;
+
+ if (mch_stat((char *)fname, &st))
+ return FALSE;
+ return TRUE;
+}
+
+/*
+ * Check for CTRL-C pressed, but only once in a while.
+ * Should be used instead of ui_breakcheck() for functions that check for
+ * each line in the file. Calling ui_breakcheck() each time takes too much
+ * time, because it can be a system call.
+ */
+
+#ifndef BREAKCHECK_SKIP
+# ifdef FEAT_GUI /* assume the GUI only runs on fast computers */
+# define BREAKCHECK_SKIP 200
+# else
+# define BREAKCHECK_SKIP 32
+# endif
+#endif
+
+static int breakcheck_count = 0;
+
+ void
+line_breakcheck()
+{
+ if (++breakcheck_count >= BREAKCHECK_SKIP)
+ {
+ breakcheck_count = 0;
+ ui_breakcheck();
+ }
+}
+
+/*
+ * Like line_breakcheck() but check 10 times less often.
+ */
+ void
+fast_breakcheck()
+{
+ if (++breakcheck_count >= BREAKCHECK_SKIP * 10)
+ {
+ breakcheck_count = 0;
+ ui_breakcheck();
+ }
+}
+
+/*
+ * Expand wildcards. Calls gen_expand_wildcards() and removes files matching
+ * 'wildignore'.
+ */
+ int
+expand_wildcards(num_pat, pat, num_file, file, flags)
+ int num_pat; /* number of input patterns */
+ char_u **pat; /* array of input patterns */
+ int *num_file; /* resulting number of files */
+ char_u ***file; /* array of resulting files */
+ int flags; /* EW_DIR, etc. */
+{
+ int retval;
+ int i, j;
+ char_u *p;
+ int non_suf_match; /* number without matching suffix */
+
+ retval = gen_expand_wildcards(num_pat, pat, num_file, file, flags);
+
+ /* When keeping all matches, return here */
+ if (flags & EW_KEEPALL)
+ return retval;
+
+#ifdef FEAT_WILDIGN
+ /*
+ * Remove names that match 'wildignore'.
+ */
+ if (*p_wig)
+ {
+ char_u *ffname;
+
+ /* check all files in (*file)[] */
+ for (i = 0; i < *num_file; ++i)
+ {
+ ffname = FullName_save((*file)[i], FALSE);
+ if (ffname == NULL) /* out of memory */
+ break;
+# ifdef VMS
+ vms_remove_version(ffname);
+# endif
+ if (match_file_list(p_wig, (*file)[i], ffname))
+ {
+ /* remove this matching file from the list */
+ vim_free((*file)[i]);
+ for (j = i; j + 1 < *num_file; ++j)
+ (*file)[j] = (*file)[j + 1];
+ --*num_file;
+ --i;
+ }
+ vim_free(ffname);
+ }
+ }
+#endif
+
+ /*
+ * Move the names where 'suffixes' match to the end.
+ */
+ if (*num_file > 1)
+ {
+ non_suf_match = 0;
+ for (i = 0; i < *num_file; ++i)
+ {
+ if (!match_suffix((*file)[i]))
+ {
+ /*
+ * Move the name without matching suffix to the front
+ * of the list.
+ */
+ p = (*file)[i];
+ for (j = i; j > non_suf_match; --j)
+ (*file)[j] = (*file)[j - 1];
+ (*file)[non_suf_match++] = p;
+ }
+ }
+ }
+
+ return retval;
+}
+
+/*
+ * Return TRUE if "fname" matches with an entry in 'suffixes'.
+ */
+ int
+match_suffix(fname)
+ char_u *fname;
+{
+ int fnamelen, setsuflen;
+ char_u *setsuf;
+#define MAXSUFLEN 30 /* maximum length of a file suffix */
+ char_u suf_buf[MAXSUFLEN];
+
+ fnamelen = (int)STRLEN(fname);
+ setsuflen = 0;
+ for (setsuf = p_su; *setsuf; )
+ {
+ setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
+ if (fnamelen >= setsuflen
+ && fnamencmp(suf_buf, fname + fnamelen - setsuflen,
+ (size_t)setsuflen) == 0)
+ break;
+ setsuflen = 0;
+ }
+ return (setsuflen != 0);
+}
+
+#if !defined(NO_EXPANDPATH) || defined(PROTO)
+
+# ifdef VIM_BACKTICK
+static int vim_backtick __ARGS((char_u *p));
+static int expand_backtick __ARGS((garray_T *gap, char_u *pat, int flags));
+# endif
+
+# if defined(MSDOS) || defined(FEAT_GUI_W16) || defined(WIN3264)
+/*
+ * File name expansion code for MS-DOS, Win16 and Win32. It's here because
+ * it's shared between these systems.
+ */
+# if defined(DJGPP) || defined(PROTO)
+# define _cdecl /* DJGPP doesn't have this */
+# else
+# ifdef __BORLANDC__
+# define _cdecl _RTLENTRYF
+# endif
+# endif
+
+/*
+ * comparison function for qsort in dos_expandpath()
+ */
+ static int _cdecl
+pstrcmp(const void *a, const void *b)
+{
+ return (pathcmp(*(char **)a, *(char **)b));
+}
+
+# ifndef WIN3264
+ static void
+namelowcpy(
+ char_u *d,
+ char_u *s)
+{
+# ifdef DJGPP
+ if (USE_LONG_FNAME) /* don't lower case on Windows 95/NT systems */
+ while (*s)
+ *d++ = *s++;
+ else
+# endif
+ while (*s)
+ *d++ = TOLOWER_LOC(*s++);
+ *d = NUL;
+}
+# endif
+
+/*
+ * Recursively build up a list of files in "gap" matching the first wildcard
+ * in `path'. Called by expand_wildcards().
+ * Return the number of matches found.
+ * "path" has backslashes before chars that are not to be expanded, starting
+ * at "path[wildoff]".
+ */
+ static int
+dos_expandpath(
+ garray_T *gap,
+ char_u *path,
+ int wildoff,
+ int flags) /* EW_* flags */
+{
+ char_u *buf;
+ char_u *path_end;
+ char_u *p, *s, *e;
+ int start_len = gap->ga_len;
+ int ok;
+#ifdef WIN3264
+ WIN32_FIND_DATA fb;
+ HANDLE hFind = (HANDLE)0;
+# ifdef FEAT_MBYTE
+ WIN32_FIND_DATAW wfb;
+ WCHAR *wn = NULL; /* UCS-2 name, NULL when not used. */
+# endif
+#else
+ struct ffblk fb;
+#endif
+ int matches;
+ int starts_with_dot;
+ int len;
+ char_u *pat;
+ regmatch_T regmatch;
+ char_u *matchname;
+
+ /* make room for file name */
+ buf = alloc((unsigned int)STRLEN(path) + BASENAMELEN + 5);
+ if (buf == NULL)
+ return 0;
+
+ /*
+ * Find the first part in the path name that contains a wildcard or a ~1.
+ * Copy it into buf, including the preceding characters.
+ */
+ p = buf;
+ s = buf;
+ e = NULL;
+ path_end = path;
+ while (*path_end != NUL)
+ {
+ /* May ignore a wildcard that has a backslash before it; it will
+ * be removed by rem_backslash() or file_pat_to_reg_pat() below. */
+ if (path_end >= path + wildoff && rem_backslash(path_end))
+ *p++ = *path_end++;
+ else if (*path_end == '\\' || *path_end == ':' || *path_end == '/')
+ {
+ if (e != NULL)
+ break;
+ s = p + 1;
+ }
+ else if (path_end >= path + wildoff
+ && vim_strchr((char_u *)"*?[~", *path_end) != NULL)
+ e = p;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ len = (*mb_ptr2len_check)(path_end);
+ STRNCPY(p, path_end, len);
+ p += len;
+ path_end += len;
+ }
+ else
+#endif
+ *p++ = *path_end++;
+ }
+ e = p;
+ *e = NUL;
+
+ /* now we have one wildcard component between s and e */
+ /* Remove backslashes between "wildoff" and the start of the wildcard
+ * component. */
+ for (p = buf + wildoff; p < s; ++p)
+ if (rem_backslash(p))
+ {
+ STRCPY(p, p + 1);
+ --e;
+ --s;
+ }
+
+ starts_with_dot = (*s == '.');
+ pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
+ if (pat == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* compile the regexp into a program */
+ regmatch.rm_ic = TRUE; /* Always ignore case */
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+ vim_free(pat);
+
+ if (regmatch.regprog == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* remember the pattern or file name being looked for */
+ matchname = vim_strsave(s);
+
+ /* Scan all files in the directory with "dir/ *.*" */
+ STRCPY(s, "*.*");
+#ifdef WIN3264
+# ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ /* The active codepage differs from 'encoding'. Attempt using the
+ * wide function. If it fails because it is not implemented fall back
+ * to the non-wide version (for Windows 98) */
+ wn = enc_to_ucs2(buf, NULL);
+ if (wn != NULL)
+ {
+ hFind = FindFirstFileW(wn, &wfb);
+ if (hFind == INVALID_HANDLE_VALUE
+ && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ vim_free(wn);
+ wn = NULL;
+ }
+ }
+ }
+
+ if (wn == NULL)
+# endif
+ hFind = FindFirstFile(buf, &fb);
+ ok = (hFind != INVALID_HANDLE_VALUE);
+#else
+ /* If we are expanding wildcards we try both files and directories */
+ ok = (findfirst((char *)buf, &fb,
+ (*path_end != NUL || (flags & EW_DIR)) ? FA_DIREC : 0) == 0);
+#endif
+
+ while (ok)
+ {
+#ifdef WIN3264
+# ifdef FEAT_MBYTE
+ if (wn != NULL)
+ p = ucs2_to_enc(wfb.cFileName, NULL); /* p is allocated here */
+ else
+# endif
+ p = (char_u *)fb.cFileName;
+#else
+ p = (char_u *)fb.ff_name;
+#endif
+ /* Ignore entries starting with a dot, unless when asked for. Accept
+ * all entries found with "matchname". */
+ if ((p[0] != '.' || starts_with_dot)
+ && (matchname == NULL
+ || vim_regexec(&regmatch, p, (colnr_T)0)))
+ {
+#ifdef WIN3264
+ STRCPY(s, p);
+#else
+ namelowcpy(s, p);
+#endif
+ len = (int)STRLEN(buf);
+ STRCPY(buf + len, path_end);
+ if (mch_has_exp_wildcard(path_end))
+ {
+ /* need to expand another component of the path */
+ /* remove backslashes for the remaining components only */
+ (void)dos_expandpath(gap, buf, len + 1, flags);
+ }
+ else
+ {
+ /* no more wildcards, check if there is a match */
+ /* remove backslashes for the remaining components only */
+ if (*path_end != 0)
+ backslash_halve(buf + len + 1);
+ if (mch_getperm(buf) >= 0) /* add existing file */
+ addfile(gap, buf, flags);
+ }
+ }
+
+#ifdef WIN3264
+# ifdef FEAT_MBYTE
+ if (wn != NULL)
+ {
+ vim_free(p);
+ ok = FindNextFileW(hFind, &wfb);
+ }
+ else
+# endif
+ ok = FindNextFile(hFind, &fb);
+#else
+ ok = (findnext(&fb) == 0);
+#endif
+
+ /* If no more matches and no match was used, try expanding the name
+ * itself. Finds the long name of a short filename. */
+ if (!ok && matchname != NULL && gap->ga_len == start_len)
+ {
+ STRCPY(s, matchname);
+#ifdef WIN3264
+ FindClose(hFind);
+# ifdef FEAT_MBYTE
+ if (wn != NULL)
+ {
+ vim_free(wn);
+ wn = enc_to_ucs2(buf, NULL);
+ if (wn != NULL)
+ hFind = FindFirstFileW(wn, &wfb);
+ }
+ if (wn == NULL)
+# endif
+ hFind = FindFirstFile(buf, &fb);
+ ok = (hFind != INVALID_HANDLE_VALUE);
+#else
+ ok = (findfirst((char *)buf, &fb,
+ (*path_end != NUL || (flags & EW_DIR)) ? FA_DIREC : 0) == 0);
+#endif
+ vim_free(matchname);
+ matchname = NULL;
+ }
+ }
+
+#ifdef WIN3264
+ FindClose(hFind);
+# ifdef FEAT_MBYTE
+ vim_free(wn);
+# endif
+#endif
+ vim_free(buf);
+ vim_free(regmatch.regprog);
+ vim_free(matchname);
+
+ matches = gap->ga_len - start_len;
+ if (matches > 0)
+ qsort(((char_u **)gap->ga_data) + start_len, (size_t)matches,
+ sizeof(char_u *), pstrcmp);
+ return matches;
+}
+
+ int
+mch_expandpath(
+ garray_T *gap,
+ char_u *path,
+ int flags) /* EW_* flags */
+{
+ return dos_expandpath(gap, path, 0, flags);
+}
+# endif /* MSDOS || FEAT_GUI_W16 || WIN3264 */
+
+/*
+ * Generic wildcard expansion code.
+ *
+ * Characters in "pat" that should not be expanded must be preceded with a
+ * backslash. E.g., "/path\ with\ spaces/my\*star*"
+ *
+ * Return FAIL when no single file was found. In this case "num_file" is not
+ * set, and "file" may contain an error message.
+ * Return OK when some files found. "num_file" is set to the number of
+ * matches, "file" to the array of matches. Call FreeWild() later.
+ */
+ int
+gen_expand_wildcards(num_pat, pat, num_file, file, flags)
+ int num_pat; /* number of input patterns */
+ char_u **pat; /* array of input patterns */
+ int *num_file; /* resulting number of files */
+ char_u ***file; /* array of resulting files */
+ int flags; /* EW_* flags */
+{
+ int i;
+ garray_T ga;
+ char_u *p;
+ static int recursive = FALSE;
+ int add_pat;
+
+ /*
+ * expand_env() is called to expand things like "~user". If this fails,
+ * it calls ExpandOne(), which brings us back here. In this case, always
+ * call the machine specific expansion function, if possible. Otherwise,
+ * return FAIL.
+ */
+ if (recursive)
+#ifdef SPECIAL_WILDCHAR
+ return mch_expand_wildcards(num_pat, pat, num_file, file, flags);
+#else
+ return FAIL;
+#endif
+
+#ifdef SPECIAL_WILDCHAR
+ /*
+ * If there are any special wildcard characters which we cannot handle
+ * here, call machine specific function for all the expansion. This
+ * avoids starting the shell for each argument separately.
+ * For `=expr` do use the internal function.
+ */
+ for (i = 0; i < num_pat; i++)
+ {
+ if (vim_strpbrk(pat[i], (char_u *)SPECIAL_WILDCHAR) != NULL
+# ifdef VIM_BACKTICK
+ && !(vim_backtick(pat[i]) && pat[i][1] == '=')
+# endif
+ )
+ return mch_expand_wildcards(num_pat, pat, num_file, file, flags);
+ }
+#endif
+
+ recursive = TRUE;
+
+ /*
+ * The matching file names are stored in a growarray. Init it empty.
+ */
+ ga_init2(&ga, (int)sizeof(char_u *), 30);
+
+ for (i = 0; i < num_pat; ++i)
+ {
+ add_pat = -1;
+ p = pat[i];
+
+#ifdef VIM_BACKTICK
+ if (vim_backtick(p))
+ add_pat = expand_backtick(&ga, p, flags);
+ else
+#endif
+ {
+ /*
+ * First expand environment variables, "~/" and "~user/".
+ */
+ if (vim_strpbrk(p, (char_u *)"$~") != NULL)
+ {
+ p = expand_env_save(p);
+ if (p == NULL)
+ p = pat[i];
+#ifdef UNIX
+ /*
+ * On Unix, if expand_env() can't expand an environment
+ * variable, use the shell to do that. Discard previously
+ * found file names and start all over again.
+ */
+ else if (vim_strpbrk(p, (char_u *)"$~") != NULL)
+ {
+ vim_free(p);
+ ga_clear(&ga);
+ i = mch_expand_wildcards(num_pat, pat, num_file, file,
+ flags);
+ recursive = FALSE;
+ return i;
+ }
+#endif
+ }
+
+ /*
+ * If there are wildcards: Expand file names and add each match to
+ * the list. If there is no match, and EW_NOTFOUND is given, add
+ * the pattern.
+ * If there are no wildcards: Add the file name if it exists or
+ * when EW_NOTFOUND is given.
+ */
+ if (mch_has_exp_wildcard(p))
+ add_pat = mch_expandpath(&ga, p, flags);
+ }
+
+ if (add_pat == -1 || (add_pat == 0 && (flags & EW_NOTFOUND)))
+ {
+ char_u *t = backslash_halve_save(p);
+
+#if defined(MACOS_CLASSIC)
+ slash_to_colon(t);
+#endif
+ /* When EW_NOTFOUND is used, always add files and dirs. Makes
+ * "vim c:/" work. */
+ if (flags & EW_NOTFOUND)
+ addfile(&ga, t, flags | EW_DIR | EW_FILE);
+ else if (mch_getperm(t) >= 0)
+ addfile(&ga, t, flags);
+ vim_free(t);
+ }
+
+ if (p != pat[i])
+ vim_free(p);
+ }
+
+ *num_file = ga.ga_len;
+ *file = (ga.ga_data != NULL) ? (char_u **)ga.ga_data : (char_u **)"";
+
+ recursive = FALSE;
+
+ return (ga.ga_data != NULL) ? OK : FAIL;
+}
+
+# ifdef VIM_BACKTICK
+
+/*
+ * Return TRUE if we can expand this backtick thing here.
+ */
+ static int
+vim_backtick(p)
+ char_u *p;
+{
+ return (*p == '`' && *(p + 1) != NUL && *(p + STRLEN(p) - 1) == '`');
+}
+
+/*
+ * Expand an item in `backticks` by executing it as a command.
+ * Currently only works when pat[] starts and ends with a `.
+ * Returns number of file names found.
+ */
+ static int
+expand_backtick(gap, pat, flags)
+ garray_T *gap;
+ char_u *pat;
+ int flags; /* EW_* flags */
+{
+ char_u *p;
+ char_u *cmd;
+ char_u *buffer;
+ int cnt = 0;
+ int i;
+
+ /* Create the command: lop off the backticks. */
+ cmd = vim_strnsave(pat + 1, (int)STRLEN(pat) - 2);
+ if (cmd == NULL)
+ return 0;
+
+#ifdef FEAT_EVAL
+ if (*cmd == '=') /* `={expr}`: Expand expression */
+ buffer = eval_to_string(cmd + 1, &p);
+ else
+#endif
+ buffer = get_cmd_output(cmd, (flags & EW_SILENT) ? SHELL_SILENT : 0);
+ vim_free(cmd);
+ if (buffer == NULL)
+ return 0;
+
+ cmd = buffer;
+ while (*cmd != NUL)
+ {
+ cmd = skipwhite(cmd); /* skip over white space */
+ p = cmd;
+ while (*p != NUL && *p != '\r' && *p != '\n') /* skip over entry */
+ ++p;
+ /* add an entry if it is not empty */
+ if (p > cmd)
+ {
+ i = *p;
+ *p = NUL;
+ addfile(gap, cmd, flags);
+ *p = i;
+ ++cnt;
+ }
+ cmd = p;
+ while (*cmd != NUL && (*cmd == '\r' || *cmd == '\n'))
+ ++cmd;
+ }
+
+ vim_free(buffer);
+ return cnt;
+}
+# endif /* VIM_BACKTICK */
+
+/*
+ * Add a file to a file list. Accepted flags:
+ * EW_DIR add directories
+ * EW_FILE add files
+ * EW_NOTFOUND add even when it doesn't exist
+ * EW_ADDSLASH add slash after directory name
+ */
+ void
+addfile(gap, f, flags)
+ garray_T *gap;
+ char_u *f; /* filename */
+ int flags;
+{
+ char_u *p;
+ int isdir;
+
+ /* if the file/dir doesn't exist, may not add it */
+ if (!(flags & EW_NOTFOUND) && mch_getperm(f) < 0)
+ return;
+
+#ifdef FNAME_ILLEGAL
+ /* if the file/dir contains illegal characters, don't add it */
+ if (vim_strpbrk(f, (char_u *)FNAME_ILLEGAL) != NULL)
+ return;
+#endif
+
+ isdir = mch_isdir(f);
+ if ((isdir && !(flags & EW_DIR)) || (!isdir && !(flags & EW_FILE)))
+ return;
+
+ /* Make room for another item in the file list. */
+ if (ga_grow(gap, 1) == FAIL)
+ return;
+
+ p = alloc((unsigned)(STRLEN(f) + 1 + isdir));
+ if (p == NULL)
+ return;
+
+ STRCPY(p, f);
+#ifdef BACKSLASH_IN_FILENAME
+ slash_adjust(p);
+#endif
+ /*
+ * Append a slash or backslash after directory names if none is present.
+ */
+#ifndef DONT_ADD_PATHSEP_TO_DIR
+ if (isdir && (flags & EW_ADDSLASH))
+ add_pathsep(p);
+#endif
+ ((char_u **)gap->ga_data)[gap->ga_len++] = p;
+ --gap->ga_room;
+}
+#endif /* !NO_EXPANDPATH */
+
+#if defined(VIM_BACKTICK) || defined(FEAT_EVAL) || defined(PROTO)
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+#ifndef SEEK_END
+# define SEEK_END 2
+#endif
+
+/*
+ * Get the stdout of an external command.
+ * Returns an allocated string, or NULL for error.
+ */
+ char_u *
+get_cmd_output(cmd, flags)
+ char_u *cmd;
+ int flags; /* can be SHELL_SILENT */
+{
+ char_u *tempname;
+ char_u *command;
+ char_u *buffer = NULL;
+ int len;
+ int i = 0;
+ FILE *fd;
+
+ if (check_restricted() || check_secure())
+ return NULL;
+
+ /* get a name for the temp file */
+ if ((tempname = vim_tempname('o')) == NULL)
+ {
+ EMSG(_(e_notmp));
+ return NULL;
+ }
+
+ /* Add the redirection stuff */
+ command = make_filter_cmd(cmd, NULL, tempname);
+ if (command == NULL)
+ goto done;
+
+ /*
+ * Call the shell to execute the command (errors are ignored).
+ * Don't check timestamps here.
+ */
+ ++no_check_timestamps;
+ call_shell(command, SHELL_DOOUT | SHELL_EXPAND | flags);
+ --no_check_timestamps;
+
+ vim_free(command);
+
+ /*
+ * read the names from the file into memory
+ */
+# ifdef VMS
+ /* created temporary file is not allways readable as binary */
+ fd = mch_fopen((char *)tempname, "r");
+# else
+ fd = mch_fopen((char *)tempname, READBIN);
+# endif
+
+ if (fd == NULL)
+ {
+ EMSG2(_(e_notopen), tempname);
+ goto done;
+ }
+
+ fseek(fd, 0L, SEEK_END);
+ len = ftell(fd); /* get size of temp file */
+ fseek(fd, 0L, SEEK_SET);
+
+ buffer = alloc(len + 1);
+ if (buffer != NULL)
+ i = (int)fread((char *)buffer, (size_t)1, (size_t)len, fd);
+ fclose(fd);
+ mch_remove(tempname);
+ if (buffer == NULL)
+ goto done;
+#ifdef VMS
+ len = i; /* VMS doesn't give us what we asked for... */
+#endif
+ if (i != len)
+ {
+ EMSG2(_(e_notread), tempname);
+ vim_free(buffer);
+ buffer = NULL;
+ }
+ else
+ buffer[len] = '\0'; /* make sure the buffer is terminated */
+
+done:
+ vim_free(tempname);
+ return buffer;
+}
+#endif
+
+/*
+ * Free the list of files returned by expand_wildcards() or other expansion
+ * functions.
+ */
+ void
+FreeWild(count, files)
+ int count;
+ char_u **files;
+{
+ if (files == NULL || count <= 0)
+ return;
+#if defined(__EMX__) && defined(__ALWAYS_HAS_TRAILING_NULL_POINTER) /* XXX */
+ /*
+ * Is this still OK for when other functions than expand_wildcards() have
+ * been used???
+ */
+ _fnexplodefree((char **)files);
+#else
+ while (count--)
+ vim_free(files[count]);
+ vim_free(files);
+#endif
+}
+
+/*
+ * return TRUE when need to go to Insert mode because of 'insertmode'.
+ * Don't do this when still processing a command or a mapping.
+ * Don't do this when inside a ":normal" command.
+ */
+ int
+goto_im()
+{
+ return (p_im && stuff_empty() && typebuf_typed());
+}
diff --git a/src/misc2.c b/src/misc2.c
new file mode 100644
index 000000000..55c44a865
--- /dev/null
+++ b/src/misc2.c
@@ -0,0 +1,5556 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * misc2.c: Various functions.
+ */
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* for chdir() */
+#endif
+
+#if defined(FEAT_VIRTUALEDIT) || defined(PROTO)
+static int coladvance2 __ARGS((pos_T *pos, int addspaces, int finetune, colnr_T wcol));
+
+/*
+ * Return TRUE if in the current mode we need to use virtual.
+ */
+ int
+virtual_active()
+{
+ /* While an operator is being executed we return "virtual_op", because
+ * VIsual_active has already been reset, thus we can't check for "block"
+ * being used. */
+ if (virtual_op != MAYBE)
+ return virtual_op;
+ return (ve_flags == VE_ALL
+# ifdef FEAT_VISUAL
+ || ((ve_flags & VE_BLOCK) && VIsual_active && VIsual_mode == Ctrl_V)
+# endif
+ || ((ve_flags & VE_INSERT) && (State & INSERT)));
+}
+
+/*
+ * Get the screen position of the cursor.
+ */
+ int
+getviscol()
+{
+ colnr_T x;
+
+ getvvcol(curwin, &curwin->w_cursor, &x, NULL, NULL);
+ return (int)x;
+}
+
+/*
+ * Get the screen position of character col with a coladd in the cursor line.
+ */
+ int
+getviscol2(col, coladd)
+ colnr_T col;
+ colnr_T coladd;
+{
+ colnr_T x;
+ pos_T pos;
+
+ pos.lnum = curwin->w_cursor.lnum;
+ pos.col = col;
+ pos.coladd = coladd;
+ getvvcol(curwin, &pos, &x, NULL, NULL);
+ return (int)x;
+}
+
+/*
+ * Go to column "wcol", and add/insert white space as neccessary to get the
+ * cursor in that column.
+ * The caller must have saved the cursor line for undo!
+ */
+ int
+coladvance_force(wcol)
+ colnr_T wcol;
+{
+ int rc = coladvance2(&curwin->w_cursor, TRUE, FALSE, wcol);
+
+ if (wcol == MAXCOL)
+ curwin->w_valid &= ~VALID_VIRTCOL;
+ else
+ {
+ /* Virtcol is valid */
+ curwin->w_valid |= VALID_VIRTCOL;
+ curwin->w_virtcol = wcol;
+ }
+ return rc;
+}
+#endif
+
+/*
+ * Try to advance the Cursor to the specified screen column.
+ * If virtual editing: fine tune the cursor position.
+ * Note that all virtual positions off the end of a line should share
+ * a curwin->w_cursor.col value (n.b. this is equal to STRLEN(line)),
+ * beginning at coladd 0.
+ *
+ * return OK if desired column is reached, FAIL if not
+ */
+ int
+coladvance(wcol)
+ colnr_T wcol;
+{
+ int rc = getvpos(&curwin->w_cursor, wcol);
+
+ if (wcol == MAXCOL || rc == FAIL)
+ curwin->w_valid &= ~VALID_VIRTCOL;
+ else
+ {
+ /* Virtcol is valid */
+ curwin->w_valid |= VALID_VIRTCOL;
+ curwin->w_virtcol = wcol;
+ }
+ return rc;
+}
+
+/*
+ * Return in "pos" the position of the cursor advanced to screen column "wcol".
+ * return OK if desired column is reached, FAIL if not
+ */
+ int
+getvpos(pos, wcol)
+ pos_T *pos;
+ colnr_T wcol;
+{
+#ifdef FEAT_VIRTUALEDIT
+ return coladvance2(pos, FALSE, virtual_active(), wcol);
+}
+
+ static int
+coladvance2(pos, addspaces, finetune, wcol)
+ pos_T *pos;
+ int addspaces; /* change the text to achieve our goal? */
+ int finetune; /* change char offset for the excact column */
+ colnr_T wcol; /* column to move to */
+{
+#endif
+ int idx;
+ char_u *ptr;
+ char_u *line;
+ colnr_T col = 0;
+ int csize = 0;
+ int one_more;
+#ifdef FEAT_LINEBREAK
+ int head = 0;
+#endif
+
+ one_more = (State & INSERT) || restart_edit != NUL
+#ifdef FEAT_VISUAL
+ || (VIsual_active && *p_sel != 'o')
+#endif
+ ;
+ line = ml_get_curline();
+
+ if (wcol >= MAXCOL)
+ {
+ idx = (int)STRLEN(line) - 1 + one_more;
+ col = wcol;
+
+#ifdef FEAT_VIRTUALEDIT
+ if ((addspaces || finetune) && !VIsual_active)
+ {
+ curwin->w_curswant = linetabsize(line) + one_more;
+ if (curwin->w_curswant > 0)
+ --curwin->w_curswant;
+ }
+#endif
+ }
+ else
+ {
+#ifdef FEAT_VIRTUALEDIT
+ int width = W_WIDTH(curwin) - win_col_off(curwin);
+
+ if ((addspaces || finetune)
+ && curwin->w_p_wrap
+# ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+# endif
+ && wcol >= (colnr_T)width)
+ {
+ csize = linetabsize(line);
+ if (csize > 0)
+ csize--;
+
+ if (wcol / width > (colnr_T)csize / width)
+ {
+ /* In case of line wrapping don't move the cursor beyond the
+ * right screen edge. */
+ wcol = (csize / width + 1) * width - 1;
+ }
+ }
+#endif
+
+ idx = -1;
+ ptr = line;
+ while (col <= wcol && *ptr != NUL)
+ {
+ /* Count a tab for what it's worth (if list mode not on) */
+#ifdef FEAT_LINEBREAK
+ csize = win_lbr_chartabsize(curwin, ptr, col, &head);
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+# endif
+ ++ptr;
+#else
+ csize = lbr_chartabsize_adv(&ptr, col);
+#endif
+ col += csize;
+ }
+ idx = (int)(ptr - line);
+ /*
+ * Handle all the special cases. The virtual_active() check
+ * is needed to ensure that a virtual position off the end of
+ * a line has the correct indexing. The one_more comparison
+ * replaces an explicit add of one_more later on.
+ */
+ if (col > wcol || (!virtual_active() && one_more == 0))
+ {
+ idx -= 1;
+# ifdef FEAT_LINEBREAK
+ /* Don't count the chars from 'showbreak'. */
+ csize -= head;
+# endif
+ col -= csize;
+ }
+
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active()
+ && addspaces
+ && ((col != wcol && col != wcol + 1) || csize > 1))
+ {
+ /* 'virtualedit' is set: The difference between wcol and col is
+ * filled with spaces. */
+
+ if (line[idx] == NUL)
+ {
+ /* Append spaces */
+ int correct = wcol - col;
+ char_u *newline = alloc(idx + correct + 1);
+ int t;
+
+ if (newline == NULL)
+ return FAIL;
+
+ for (t = 0; t < idx; ++t)
+ newline[t] = line[t];
+
+ for (t = 0; t < correct; ++t)
+ newline[t + idx] = ' ';
+
+ newline[idx + correct] = NUL;
+
+ ml_replace(pos->lnum, newline, FALSE);
+ changed_bytes(pos->lnum, (colnr_T)idx);
+ idx += correct;
+ col = wcol;
+ }
+ else
+ {
+ /* Break a tab */
+ int linelen = (int)STRLEN(line);
+ int correct = wcol - col - csize + 1; /* negative!! */
+ char_u *newline = alloc(linelen + csize);
+ int t, s = 0;
+ int v;
+
+ /*
+ * break a tab
+ */
+ if (newline == NULL || -correct > csize)
+ return FAIL;
+
+ for (t = 0; t < linelen; t++)
+ {
+ if (t != idx)
+ newline[s++] = line[t];
+ else
+ for (v = 0; v < csize; v++)
+ newline[s++] = ' ';
+ }
+
+ newline[linelen + csize - 1] = NUL;
+
+ ml_replace(pos->lnum, newline, FALSE);
+ changed_bytes(pos->lnum, idx);
+ idx += (csize - 1 + correct);
+ col += correct;
+ }
+ }
+#endif
+ }
+
+ if (idx < 0)
+ pos->col = 0;
+ else
+ pos->col = idx;
+
+#ifdef FEAT_VIRTUALEDIT
+ pos->coladd = 0;
+
+ if (finetune)
+ {
+ if (wcol == MAXCOL)
+ {
+ /* The width of the last character is used to set coladd. */
+ if (!one_more)
+ {
+ colnr_T scol, ecol;
+
+ getvcol(curwin, pos, &scol, NULL, &ecol);
+ pos->coladd = ecol - scol;
+ }
+ }
+ else
+ {
+ int b = (int)wcol - (int)col;
+
+ /* The difference between wcol and col is used to set coladd. */
+ if (b > 0 && b < (MAXCOL - 2 * W_WIDTH(curwin)))
+ pos->coladd = b;
+
+ col += b;
+ }
+ }
+#endif
+
+#ifdef FEAT_MBYTE
+ /* prevent cursor from moving on the trail byte */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+
+ if (col < wcol)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * inc(p)
+ *
+ * Increment the line pointer 'p' crossing line boundaries as necessary.
+ * Return 1 when going to the next line.
+ * Return 2 when moving forward onto a NUL at the end of the line).
+ * Return -1 when at the end of file.
+ * Return 0 otherwise.
+ */
+ int
+inc_cursor()
+{
+ return inc(&curwin->w_cursor);
+}
+
+ int
+inc(lp)
+ pos_T *lp;
+{
+ char_u *p = ml_get_pos(lp);
+
+ if (*p != NUL) /* still within line, move to next char (may be NUL) */
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int l = (*mb_ptr2len_check)(p);
+
+ lp->col += l;
+ return ((p[l] != NUL) ? 0 : 2);
+ }
+#endif
+ lp->col++;
+#ifdef FEAT_VIRTUALEDIT
+ lp->coladd = 0;
+#endif
+ return ((p[1] != NUL) ? 0 : 2);
+ }
+ if (lp->lnum != curbuf->b_ml.ml_line_count) /* there is a next line */
+ {
+ lp->col = 0;
+ lp->lnum++;
+#ifdef FEAT_VIRTUALEDIT
+ lp->coladd = 0;
+#endif
+ return 1;
+ }
+ return -1;
+}
+
+/*
+ * incl(lp): same as inc(), but skip the NUL at the end of non-empty lines
+ */
+ int
+incl(lp)
+ pos_T *lp;
+{
+ int r;
+
+ if ((r = inc(lp)) >= 1 && lp->col)
+ r = inc(lp);
+ return r;
+}
+
+/*
+ * dec(p)
+ *
+ * Decrement the line pointer 'p' crossing line boundaries as necessary.
+ * Return 1 when crossing a line, -1 when at start of file, 0 otherwise.
+ */
+ int
+dec_cursor()
+{
+ return dec(&curwin->w_cursor);
+}
+
+ int
+dec(lp)
+ pos_T *lp;
+{
+ char_u *p;
+
+#ifdef FEAT_VIRTUALEDIT
+ lp->coladd = 0;
+#endif
+ if (lp->col > 0) /* still within line */
+ {
+ lp->col--;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ p = ml_get(lp->lnum);
+ lp->col -= (*mb_head_off)(p, p + lp->col);
+ }
+#endif
+ return 0;
+ }
+ if (lp->lnum > 1) /* there is a prior line */
+ {
+ lp->lnum--;
+ p = ml_get(lp->lnum);
+ lp->col = (colnr_T)STRLEN(p);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ lp->col -= (*mb_head_off)(p, p + lp->col);
+#endif
+ return 1;
+ }
+ return -1; /* at start of file */
+}
+
+/*
+ * decl(lp): same as dec(), but skip the NUL at the end of non-empty lines
+ */
+ int
+decl(lp)
+ pos_T *lp;
+{
+ int r;
+
+ if ((r = dec(lp)) == 1 && lp->col)
+ r = dec(lp);
+ return r;
+}
+
+/*
+ * Make sure curwin->w_cursor.lnum is valid.
+ */
+ void
+check_cursor_lnum()
+{
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ {
+#ifdef FEAT_FOLDING
+ /* If there is a closed fold at the end of the file, put the cursor in
+ * its first line. Otherwise in the last line. */
+ if (!hasFolding(curbuf->b_ml.ml_line_count,
+ &curwin->w_cursor.lnum, NULL))
+#endif
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ }
+ if (curwin->w_cursor.lnum <= 0)
+ curwin->w_cursor.lnum = 1;
+}
+
+/*
+ * Make sure curwin->w_cursor.col is valid.
+ */
+ void
+check_cursor_col()
+{
+ colnr_T len;
+#ifdef FEAT_VIRTUALEDIT
+ colnr_T oldcol = curwin->w_cursor.col + curwin->w_cursor.coladd;
+#endif
+
+ len = (colnr_T)STRLEN(ml_get_curline());
+ if (len == 0)
+ curwin->w_cursor.col = 0;
+ else if (curwin->w_cursor.col >= len)
+ {
+ /* Allow cursor past end-of-line in Insert mode, restarting Insert
+ * mode or when in Visual mode and 'selection' isn't "old" */
+ if (State & INSERT || restart_edit
+#ifdef FEAT_VISUAL
+ || (VIsual_active && *p_sel != 'o')
+#endif
+ || virtual_active())
+ curwin->w_cursor.col = len;
+ else
+ curwin->w_cursor.col = len - 1;
+ }
+
+#ifdef FEAT_VIRTUALEDIT
+ /* If virtual editing is on, we can leave the cursor on the old position,
+ * only we must set it to virtual. But don't do it when at the end of the
+ * line. */
+ if (oldcol == MAXCOL)
+ curwin->w_cursor.coladd = 0;
+ else if (ve_flags == VE_ALL)
+ curwin->w_cursor.coladd = oldcol - curwin->w_cursor.col;
+#endif
+}
+
+/*
+ * make sure curwin->w_cursor in on a valid character
+ */
+ void
+check_cursor()
+{
+ check_cursor_lnum();
+ check_cursor_col();
+}
+
+#if defined(FEAT_TEXTOBJ) || defined(PROTO)
+/*
+ * Make sure curwin->w_cursor is not on the NUL at the end of the line.
+ * Allow it when in Visual mode and 'selection' is not "old".
+ */
+ void
+adjust_cursor_col()
+{
+ if (curwin->w_cursor.col > 0
+# ifdef FEAT_VISUAL
+ && (!VIsual_active || *p_sel == 'o')
+# endif
+ && gchar_cursor() == NUL)
+ --curwin->w_cursor.col;
+}
+#endif
+
+/*
+ * When curwin->w_leftcol has changed, adjust the cursor position.
+ * Return TRUE if the cursor was moved.
+ */
+ int
+leftcol_changed()
+{
+ long lastcol;
+ colnr_T s, e;
+ int retval = FALSE;
+
+ changed_cline_bef_curs();
+ lastcol = curwin->w_leftcol + W_WIDTH(curwin) - curwin_col_off() - 1;
+ validate_virtcol();
+
+ /*
+ * If the cursor is right or left of the screen, move it to last or first
+ * character.
+ */
+ if (curwin->w_virtcol > (colnr_T)(lastcol - p_siso))
+ {
+ retval = TRUE;
+ coladvance((colnr_T)(lastcol - p_siso));
+ }
+ else if (curwin->w_virtcol < curwin->w_leftcol + p_siso)
+ {
+ retval = TRUE;
+ (void)coladvance((colnr_T)(curwin->w_leftcol + p_siso));
+ }
+
+ /*
+ * If the start of the character under the cursor is not on the screen,
+ * advance the cursor one more char. If this fails (last char of the
+ * line) adjust the scrolling.
+ */
+ getvvcol(curwin, &curwin->w_cursor, &s, NULL, &e);
+ if (e > (colnr_T)lastcol)
+ {
+ retval = TRUE;
+ coladvance(s - 1);
+ }
+ else if (s < curwin->w_leftcol)
+ {
+ retval = TRUE;
+ if (coladvance(e + 1) == FAIL) /* there isn't another character */
+ {
+ curwin->w_leftcol = s; /* adjust w_leftcol instead */
+ changed_cline_bef_curs();
+ }
+ }
+
+ if (retval)
+ curwin->w_set_curswant = TRUE;
+ redraw_later(NOT_VALID);
+ return retval;
+}
+
+/**********************************************************************
+ * Various routines dealing with allocation and deallocation of memory.
+ */
+
+#if defined(MEM_PROFILE) || defined(PROTO)
+
+# define MEM_SIZES 8200
+static long_u mem_allocs[MEM_SIZES];
+static long_u mem_frees[MEM_SIZES];
+static long_u mem_allocated;
+static long_u mem_freed;
+static long_u mem_peak;
+static long_u num_alloc;
+static long_u num_freed;
+
+static void mem_pre_alloc_s __ARGS((size_t *sizep));
+static void mem_pre_alloc_l __ARGS((long_u *sizep));
+static void mem_post_alloc __ARGS((void **pp, size_t size));
+static void mem_pre_free __ARGS((void **pp));
+
+ static void
+mem_pre_alloc_s(sizep)
+ size_t *sizep;
+{
+ *sizep += sizeof(size_t);
+}
+
+ static void
+mem_pre_alloc_l(sizep)
+ long_u *sizep;
+{
+ *sizep += sizeof(size_t);
+}
+
+ static void
+mem_post_alloc(pp, size)
+ void **pp;
+ size_t size;
+{
+ if (*pp == NULL)
+ return;
+ size -= sizeof(size_t);
+ *(long_u *)*pp = size;
+ if (size <= MEM_SIZES-1)
+ mem_allocs[size-1]++;
+ else
+ mem_allocs[MEM_SIZES-1]++;
+ mem_allocated += size;
+ if (mem_allocated - mem_freed > mem_peak)
+ mem_peak = mem_allocated - mem_freed;
+ num_alloc++;
+ *pp = (void *)((char *)*pp + sizeof(size_t));
+}
+
+ static void
+mem_pre_free(pp)
+ void **pp;
+{
+ long_u size;
+
+ *pp = (void *)((char *)*pp - sizeof(size_t));
+ size = *(size_t *)*pp;
+ if (size <= MEM_SIZES-1)
+ mem_frees[size-1]++;
+ else
+ mem_frees[MEM_SIZES-1]++;
+ mem_freed += size;
+ num_freed++;
+}
+
+/*
+ * called on exit via atexit()
+ */
+ void
+vim_mem_profile_dump()
+{
+ int i, j;
+
+ printf("\r\n");
+ j = 0;
+ for (i = 0; i < MEM_SIZES - 1; i++)
+ {
+ if (mem_allocs[i] || mem_frees[i])
+ {
+ if (mem_frees[i] > mem_allocs[i])
+ printf("\r\n%s", _("ERROR: "));
+ printf("[%4d / %4lu-%-4lu] ", i + 1, mem_allocs[i], mem_frees[i]);
+ j++;
+ if (j > 3)
+ {
+ j = 0;
+ printf("\r\n");
+ }
+ }
+ }
+
+ i = MEM_SIZES - 1;
+ if (mem_allocs[i])
+ {
+ printf("\r\n");
+ if (mem_frees[i] > mem_allocs[i])
+ printf(_("ERROR: "));
+ printf("[>%d / %4lu-%-4lu]", i, mem_allocs[i], mem_frees[i]);
+ }
+
+ printf(_("\n[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"),
+ mem_allocated, mem_freed, mem_allocated - mem_freed, mem_peak);
+ printf(_("[calls] total re/malloc()'s %lu, total free()'s %lu\n\n"),
+ num_alloc, num_freed);
+}
+
+#endif /* MEM_PROFILE */
+
+/*
+ * Some memory is reserved for error messages and for being able to
+ * call mf_release_all(), which needs some memory for mf_trans_add().
+ */
+#if defined(MSDOS) && !defined(DJGPP)
+# define SMALL_MEM
+# define KEEP_ROOM 8192L
+#else
+# define KEEP_ROOM (2 * 8192L)
+#endif
+
+/*
+ * Note: if unsinged is 16 bits we can only allocate up to 64K with alloc().
+ * Use lalloc for larger blocks.
+ */
+ char_u *
+alloc(size)
+ unsigned size;
+{
+ return (lalloc((long_u)size, TRUE));
+}
+
+/*
+ * Allocate memory and set all bytes to zero.
+ */
+ char_u *
+alloc_clear(size)
+ unsigned size;
+{
+ char_u *p;
+
+ p = (lalloc((long_u)size, TRUE));
+ if (p != NULL)
+ (void)vim_memset(p, 0, (size_t)size);
+ return p;
+}
+
+/*
+ * alloc() with check for maximum line length
+ */
+ char_u *
+alloc_check(size)
+ unsigned size;
+{
+#if !defined(UNIX) && !defined(__EMX__)
+ if (sizeof(int) == 2 && size > 0x7fff)
+ {
+ /* Don't hide this message */
+ emsg_silent = 0;
+ EMSG(_("E340: Line is becoming too long"));
+ return NULL;
+ }
+#endif
+ return (lalloc((long_u)size, TRUE));
+}
+
+/*
+ * Allocate memory like lalloc() and set all bytes to zero.
+ */
+ char_u *
+lalloc_clear(size, message)
+ long_u size;
+ int message;
+{
+ char_u *p;
+
+ p = (lalloc(size, message));
+ if (p != NULL)
+ (void)vim_memset(p, 0, (size_t)size);
+ return p;
+}
+
+/*
+ * Low level memory allocation function.
+ * This is used often, KEEP IT FAST!
+ */
+ char_u *
+lalloc(size, message)
+ long_u size;
+ int message;
+{
+ char_u *p; /* pointer to new storage space */
+ static int releasing = FALSE; /* don't do mf_release_all() recursive */
+ int try_again;
+#if defined(HAVE_AVAIL_MEM) && !defined(SMALL_MEM)
+ static long_u allocated = 0; /* allocated since last avail check */
+#endif
+
+ /* Safety check for allocating zero bytes */
+ if (size == 0)
+ {
+ /* Don't hide this message */
+ emsg_silent = 0;
+ EMSGN(_("E341: Internal error: lalloc(%ld, )"), size);
+ return NULL;
+ }
+
+#ifdef MEM_PROFILE
+ mem_pre_alloc_l(&size);
+#endif
+
+#if defined(MSDOS) && !defined(DJGPP)
+ if (size >= 0xfff0) /* in MSDOS we can't deal with >64K blocks */
+ p = NULL;
+ else
+#endif
+
+ /*
+ * Loop when out of memory: Try to release some memfile blocks and
+ * if some blocks are released call malloc again.
+ */
+ for (;;)
+ {
+ /*
+ * Handle three kind of systems:
+ * 1. No check for available memory: Just return.
+ * 2. Slow check for available memory: call mch_avail_mem() after
+ * allocating KEEP_ROOM amount of memory.
+ * 3. Strict check for available memory: call mch_avail_mem()
+ */
+ if ((p = (char_u *)malloc((size_t)size)) != NULL)
+ {
+#ifndef HAVE_AVAIL_MEM
+ /* 1. No check for available memory: Just return. */
+ goto theend;
+#else
+# ifndef SMALL_MEM
+ /* 2. Slow check for available memory: call mch_avail_mem() after
+ * allocating (KEEP_ROOM / 2) amount of memory. */
+ allocated += size;
+ if (allocated < KEEP_ROOM / 2)
+ goto theend;
+ allocated = 0;
+# endif
+ /* 3. check for available memory: call mch_avail_mem() */
+ if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
+ {
+ vim_free((char *)p); /* System is low... no go! */
+ p = NULL;
+ }
+ else
+ goto theend;
+#endif
+ }
+ /*
+ * Remember that mf_release_all() is being called to avoid an endless
+ * loop, because mf_release_all() may call alloc() recursively.
+ */
+ if (releasing)
+ break;
+ releasing = TRUE;
+ try_again = mf_release_all();
+ releasing = FALSE;
+ if (!try_again)
+ break;
+ }
+
+ if (message && p == NULL)
+ do_outofmem_msg(size);
+
+theend:
+#ifdef MEM_PROFILE
+ mem_post_alloc((void **)&p, (size_t)size);
+#endif
+ return p;
+}
+
+#if defined(MEM_PROFILE) || defined(PROTO)
+/*
+ * realloc() with memory profiling.
+ */
+ void *
+mem_realloc(ptr, size)
+ void *ptr;
+ size_t size;
+{
+ void *p;
+
+ mem_pre_free(&ptr);
+ mem_pre_alloc_s(&size);
+
+ p = realloc(ptr, size);
+
+ mem_post_alloc(&p, size);
+
+ return p;
+}
+#endif
+
+/*
+* Avoid repeating the error message many times (they take 1 second each).
+* Did_outofmem_msg is reset when a character is read.
+*/
+ void
+do_outofmem_msg(size)
+ long_u size;
+{
+ if (!did_outofmem_msg)
+ {
+ /* Don't hide this message */
+ emsg_silent = 0;
+ EMSGN(_("E342: Out of memory! (allocating %lu bytes)"), size);
+ did_outofmem_msg = TRUE;
+ }
+}
+
+/*
+ * copy a string into newly allocated memory
+ */
+ char_u *
+vim_strsave(string)
+ char_u *string;
+{
+ char_u *p;
+ unsigned len;
+
+ len = (unsigned)STRLEN(string) + 1;
+ p = alloc(len);
+ if (p != NULL)
+ mch_memmove(p, string, (size_t)len);
+ return p;
+}
+
+ char_u *
+vim_strnsave(string, len)
+ char_u *string;
+ int len;
+{
+ char_u *p;
+
+ p = alloc((unsigned)(len + 1));
+ if (p != NULL)
+ {
+ STRNCPY(p, string, len);
+ p[len] = NUL;
+ }
+ return p;
+}
+
+#if 0 /* not used */
+/*
+ * like vim_strnsave(), but remove backslashes from the string.
+ */
+ char_u *
+vim_strnsave_esc(string, len)
+ char_u *string;
+ int len;
+{
+ char_u *p1, *p2;
+
+ p1 = alloc((unsigned) (len + 1));
+ if (p1 != NULL)
+ {
+ STRNCPY(p1, string, len);
+ p1[len] = NUL;
+ for (p2 = p1; *p2; ++p2)
+ if (*p2 == '\\' && *(p2 + 1) != NUL)
+ STRCPY(p2, p2 + 1);
+ }
+ return p1;
+}
+#endif
+
+/*
+ * Same as vim_strsave(), but any characters found in esc_chars are preceded
+ * by a backslash.
+ */
+ char_u *
+vim_strsave_escaped(string, esc_chars)
+ char_u *string;
+ char_u *esc_chars;
+{
+ return vim_strsave_escaped_ext(string, esc_chars, FALSE);
+}
+
+/*
+ * Same as vim_strsave_escaped(), but when "bsl" is TRUE also escape
+ * characters where rem_backslash() would remove the backslash.
+ */
+ char_u *
+vim_strsave_escaped_ext(string, esc_chars, bsl)
+ char_u *string;
+ char_u *esc_chars;
+ int bsl;
+{
+ char_u *p;
+ char_u *p2;
+ char_u *escaped_string;
+ unsigned length;
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+ /*
+ * First count the number of backslashes required.
+ * Then allocate the memory and insert them.
+ */
+ length = 1; /* count the trailing NUL */
+ for (p = string; *p; p++)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ length += l; /* count a multibyte char */
+ p += l - 1;
+ continue;
+ }
+#endif
+ if (vim_strchr(esc_chars, *p) != NULL || (bsl && rem_backslash(p)))
+ ++length; /* count a backslash */
+ ++length; /* count an ordinary char */
+ }
+ escaped_string = alloc(length);
+ if (escaped_string != NULL)
+ {
+ p2 = escaped_string;
+ for (p = string; *p; p++)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ mch_memmove(p2, p, (size_t)l);
+ p2 += l;
+ p += l - 1; /* skip multibyte char */
+ continue;
+ }
+#endif
+ if (vim_strchr(esc_chars, *p) != NULL || (bsl && rem_backslash(p)))
+ *p2++ = '\\';
+ *p2++ = *p;
+ }
+ *p2 = NUL;
+ }
+ return escaped_string;
+}
+
+/*
+ * Like vim_strsave(), but make all characters uppercase.
+ * This uses ASCII lower-to-upper case translation, language independent.
+ */
+ char_u *
+vim_strsave_up(string)
+ char_u *string;
+{
+ char_u *p1;
+
+ p1 = vim_strsave(string);
+ vim_strup(p1);
+ return p1;
+}
+
+/*
+ * Like vim_strnsave(), but make all characters uppercase.
+ * This uses ASCII lower-to-upper case translation, language independent.
+ */
+ char_u *
+vim_strnsave_up(string, len)
+ char_u *string;
+ int len;
+{
+ char_u *p1;
+
+ p1 = vim_strnsave(string, len);
+ vim_strup(p1);
+ return p1;
+}
+
+/*
+ * ASCII lower-to-upper case translation, language independent.
+ */
+ void
+vim_strup(p)
+ char_u *p;
+{
+ char_u *p2;
+ int c;
+
+ if (p != NULL)
+ {
+ p2 = p;
+ while ((c = *p2) != NUL)
+#ifdef EBCDIC
+ *p2++ = isalpha(c) ? toupper(c) : c;
+#else
+ *p2++ = (c < 'a' || c > 'z') ? c : (c - 0x20);
+#endif
+ }
+}
+
+/*
+ * copy a space a number of times
+ */
+ void
+copy_spaces(ptr, count)
+ char_u *ptr;
+ size_t count;
+{
+ size_t i = count;
+ char_u *p = ptr;
+
+ while (i--)
+ *p++ = ' ';
+}
+
+#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+/*
+ * Copy a character a number of times.
+ * Does not work for multi-byte charactes!
+ */
+ void
+copy_chars(ptr, count, c)
+ char_u *ptr;
+ size_t count;
+ int c;
+{
+ size_t i = count;
+ char_u *p = ptr;
+
+ while (i--)
+ *p++ = c;
+}
+#endif
+
+/*
+ * delete spaces at the end of a string
+ */
+ void
+del_trailing_spaces(ptr)
+ char_u *ptr;
+{
+ char_u *q;
+
+ q = ptr + STRLEN(ptr);
+ while (--q > ptr && vim_iswhite(q[0]) && q[-1] != '\\' && q[-1] != Ctrl_V)
+ *q = NUL;
+}
+
+/*
+ * This is here because strncpy() does not guarantee successful results when
+ * the to and from strings overlap. It is only currently called from
+ * nextwild() which copies part of the command line to another part of the
+ * command line. This produced garbage when expanding files etc in the middle
+ * of the command line (on my terminal, anyway) -- webb.
+ * Note: strncpy() pads the remainder of the buffer with NUL bytes,
+ * vim_strncpy() doesn't do that.
+ */
+ void
+vim_strncpy(to, from, len)
+ char_u *to;
+ char_u *from;
+ int len;
+{
+ int i;
+
+ if (to <= from)
+ {
+ while (len-- && *from)
+ *to++ = *from++;
+ if (len >= 0)
+ *to = *from; /* Copy NUL */
+ }
+ else
+ {
+ for (i = 0; i < len; i++)
+ {
+ to++;
+ if (*from++ == NUL)
+ {
+ i++;
+ break;
+ }
+ }
+ for (; i > 0; i--)
+ *--to = *--from;
+ }
+}
+
+/*
+ * Isolate one part of a string option where parts are separated with
+ * "sep_chars".
+ * The part is copied into buf[maxlen].
+ * "*option" is advanced to the next part.
+ * The length is returned.
+ */
+ int
+copy_option_part(option, buf, maxlen, sep_chars)
+ char_u **option;
+ char_u *buf;
+ int maxlen;
+ char *sep_chars;
+{
+ int len = 0;
+ char_u *p = *option;
+
+ /* skip '.' at start of option part, for 'suffixes' */
+ if (*p == '.')
+ buf[len++] = *p++;
+ while (*p != NUL && vim_strchr((char_u *)sep_chars, *p) == NULL)
+ {
+ /*
+ * Skip backslash before a separator character and space.
+ */
+ if (p[0] == '\\' && vim_strchr((char_u *)sep_chars, p[1]) != NULL)
+ ++p;
+ if (len < maxlen - 1)
+ buf[len++] = *p;
+ ++p;
+ }
+ buf[len] = NUL;
+
+ if (*p != NUL && *p != ',') /* skip non-standard separator */
+ ++p;
+ p = skip_to_option_part(p); /* p points to next file name */
+
+ *option = p;
+ return len;
+}
+
+/*
+ * replacement for free() that ignores NULL pointers
+ */
+ void
+vim_free(x)
+ void *x;
+{
+ if (x != NULL)
+ {
+#ifdef MEM_PROFILE
+ mem_pre_free(&x);
+#endif
+ free(x);
+ }
+}
+
+#ifndef HAVE_MEMSET
+ void *
+vim_memset(ptr, c, size)
+ void *ptr;
+ int c;
+ size_t size;
+{
+ char *p = ptr;
+
+ while (size-- > 0)
+ *p++ = c;
+ return ptr;
+}
+#endif
+
+#ifdef VIM_MEMCMP
+/*
+ * Return zero when "b1" and "b2" are the same for "len" bytes.
+ * Return non-zero otherwise.
+ */
+ int
+vim_memcmp(b1, b2, len)
+ void *b1;
+ void *b2;
+ size_t len;
+{
+ char_u *p1 = (char_u *)b1, *p2 = (char_u *)b2;
+
+ for ( ; len > 0; --len)
+ {
+ if (*p1 != *p2)
+ return 1;
+ ++p1;
+ ++p2;
+ }
+ return 0;
+}
+#endif
+
+#ifdef VIM_MEMMOVE
+/*
+ * Version of memmove() that handles overlapping source and destination.
+ * For systems that don't have a function that is guaranteed to do that (SYSV).
+ */
+ void
+mch_memmove(dst_arg, src_arg, len)
+ void *src_arg, *dst_arg;
+ size_t len;
+{
+ /*
+ * A void doesn't have a size, we use char pointers.
+ */
+ char *dst = dst_arg, *src = src_arg;
+
+ /* overlap, copy backwards */
+ if (dst > src && dst < src + len)
+ {
+ src += len;
+ dst += len;
+ while (len-- > 0)
+ *--dst = *--src;
+ }
+ else /* copy forwards */
+ while (len-- > 0)
+ *dst++ = *src++;
+}
+#endif
+
+#if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
+/*
+ * Compare two strings, ignoring case, using current locale.
+ * Doesn't work for multi-byte characters.
+ * return 0 for match, < 0 for smaller, > 0 for bigger
+ */
+ int
+vim_stricmp(s1, s2)
+ char *s1;
+ char *s2;
+{
+ int i;
+
+ for (;;)
+ {
+ i = (int)TOLOWER_LOC(*s1) - (int)TOLOWER_LOC(*s2);
+ if (i != 0)
+ return i; /* this character different */
+ if (*s1 == NUL)
+ break; /* strings match until NUL */
+ ++s1;
+ ++s2;
+ }
+ return 0; /* strings match */
+}
+#endif
+
+#if (!defined(HAVE_STRNCASECMP) && !defined(HAVE_STRNICMP)) || defined(PROTO)
+/*
+ * Compare two strings, for length "len", ignoring case, using current locale.
+ * Doesn't work for multi-byte characters.
+ * return 0 for match, < 0 for smaller, > 0 for bigger
+ */
+ int
+vim_strnicmp(s1, s2, len)
+ char *s1;
+ char *s2;
+ size_t len;
+{
+ int i;
+
+ while (len > 0)
+ {
+ i = (int)TOLOWER_LOC(*s1) - (int)TOLOWER_LOC(*s2);
+ if (i != 0)
+ return i; /* this character different */
+ if (*s1 == NUL)
+ break; /* strings match until NUL */
+ ++s1;
+ ++s2;
+ --len;
+ }
+ return 0; /* strings match */
+}
+#endif
+
+#if 0 /* currently not used */
+/*
+ * Check if string "s2" appears somewhere in "s1" while ignoring case.
+ * Return NULL if not, a pointer to the first occurrence if it does.
+ */
+ char_u *
+vim_stristr(s1, s2)
+ char_u *s1;
+ char_u *s2;
+{
+ char_u *p;
+ int len = STRLEN(s2);
+ char_u *end = s1 + STRLEN(s1) - len;
+
+ for (p = s1; p <= end; ++p)
+ if (STRNICMP(p, s2, len) == 0)
+ return p;
+ return NULL;
+}
+#endif
+
+/*
+ * Version of strchr() and strrchr() that handle unsigned char strings
+ * with characters above 128 correctly. Also it doesn't return a pointer to
+ * the NUL at the end of the string.
+ */
+ char_u *
+vim_strchr(string, c)
+ char_u *string;
+ int c;
+{
+ char_u *p;
+ int b;
+
+ p = string;
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && c >= 0x80)
+ {
+ while (*p != NUL)
+ {
+ if (utf_ptr2char(p) == c)
+ return p;
+ p += (*mb_ptr2len_check)(p);
+ }
+ return NULL;
+ }
+ if (enc_dbcs != 0 && c > 255)
+ {
+ int n2 = c & 0xff;
+
+ c = ((unsigned)c >> 8) & 0xff;
+ while ((b = *p) != NUL)
+ {
+ if (b == c && p[1] == n2)
+ return p;
+ p += (*mb_ptr2len_check)(p);
+ }
+ return NULL;
+ }
+ if (has_mbyte)
+ {
+ while ((b = *p) != NUL)
+ {
+ if (b == c)
+ return p;
+ p += (*mb_ptr2len_check)(p);
+ }
+ return NULL;
+ }
+#endif
+ while ((b = *p) != NUL)
+ {
+ if (b == c)
+ return p;
+ ++p;
+ }
+ return NULL;
+}
+
+/*
+ * Search for last occurrence of "c" in "string".
+ * return NULL if not found.
+ * Does not handle multi-byte!
+ */
+ char_u *
+vim_strrchr(string, c)
+ char_u *string;
+ int c;
+{
+ char_u *retval = NULL;
+
+ while (*string)
+ {
+ if (*string == c)
+ retval = string;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ string += (*mb_ptr2len_check)(string);
+ else
+#endif
+ ++string;
+ }
+ return retval;
+}
+
+/*
+ * Vim's version of strpbrk(), in case it's missing.
+ * Don't generate a prototype for this, causes problems when it's not used.
+ */
+#ifndef PROTO
+# ifndef HAVE_STRPBRK
+# ifdef vim_strpbrk
+# undef vim_strpbrk
+# endif
+ char_u *
+vim_strpbrk(s, charset)
+ char_u *s;
+ char_u *charset;
+{
+ while (*s)
+ {
+ if (vim_strchr(charset, *s) != NULL)
+ return s;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+#endif
+ ++s;
+ }
+ return NULL;
+}
+# endif
+#endif
+
+/*
+ * Vim has its own isspace() function, because on some machines isspace()
+ * can't handle characters above 128.
+ */
+ int
+vim_isspace(x)
+ int x;
+{
+ return ((x >= 9 && x <= 13) || x == ' ');
+}
+
+/************************************************************************
+ * Functions for hanlding growing arrays.
+ */
+
+/*
+ * Clear an allocated growing array.
+ */
+ void
+ga_clear(gap)
+ garray_T *gap;
+{
+ vim_free(gap->ga_data);
+ ga_init(gap);
+}
+
+/*
+ * Clear a growing array that contains a list of strings.
+ */
+ void
+ga_clear_strings(gap)
+ garray_T *gap;
+{
+ int i;
+
+ for (i = 0; i < gap->ga_len; ++i)
+ vim_free(((char_u **)(gap->ga_data))[i]);
+ ga_clear(gap);
+}
+
+/*
+ * Initialize a growing array. Don't forget to set ga_itemsize and
+ * ga_growsize! Or use ga_init2().
+ */
+ void
+ga_init(gap)
+ garray_T *gap;
+{
+ gap->ga_data = NULL;
+ gap->ga_room = 0;
+ gap->ga_len = 0;
+}
+
+ void
+ga_init2(gap, itemsize, growsize)
+ garray_T *gap;
+ int itemsize;
+ int growsize;
+{
+ ga_init(gap);
+ gap->ga_itemsize = itemsize;
+ gap->ga_growsize = growsize;
+}
+
+/*
+ * Make room in growing array "gap" for at least "n" items.
+ * Return FAIL for failure, OK otherwise.
+ */
+ int
+ga_grow(gap, n)
+ garray_T *gap;
+ int n;
+{
+ size_t len;
+ char_u *pp;
+
+ if (gap->ga_room < n)
+ {
+ if (n < gap->ga_growsize)
+ n = gap->ga_growsize;
+ len = gap->ga_itemsize * (gap->ga_len + n);
+ pp = alloc_clear((unsigned)len);
+ if (pp == NULL)
+ return FAIL;
+ gap->ga_room = n;
+ if (gap->ga_data != NULL)
+ {
+ mch_memmove(pp, gap->ga_data,
+ (size_t)(gap->ga_itemsize * gap->ga_len));
+ vim_free(gap->ga_data);
+ }
+ gap->ga_data = pp;
+ }
+ return OK;
+}
+
+/*
+ * Concatenate a string to a growarray which contains characters.
+ * Note: Does NOT copy the NUL at the end!
+ */
+ void
+ga_concat(gap, s)
+ garray_T *gap;
+ char_u *s;
+{
+ int len = (int)STRLEN(s);
+
+ if (ga_grow(gap, len) == OK)
+ {
+ mch_memmove((char *)gap->ga_data + gap->ga_len, s, (size_t)len);
+ gap->ga_len += len;
+ gap->ga_room -= len;
+ }
+}
+
+/*
+ * Append one byte to a growarray which contains bytes.
+ */
+ void
+ga_append(gap, c)
+ garray_T *gap;
+ int c;
+{
+ if (ga_grow(gap, 1) == OK)
+ {
+ *((char *)gap->ga_data + gap->ga_len) = c;
+ ++gap->ga_len;
+ --gap->ga_room;
+ }
+}
+
+/************************************************************************
+ * functions that use lookup tables for various things, generally to do with
+ * special key codes.
+ */
+
+/*
+ * Some useful tables.
+ */
+
+static struct modmasktable
+{
+ short mod_mask; /* Bit-mask for particular key modifier */
+ short mod_flag; /* Bit(s) for particular key modifier */
+ char_u name; /* Single letter name of modifier */
+} mod_mask_table[] =
+{
+ {MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'M'},
+ {MOD_MASK_CTRL, MOD_MASK_CTRL, (char_u)'C'},
+ {MOD_MASK_SHIFT, MOD_MASK_SHIFT, (char_u)'S'},
+ {MOD_MASK_MULTI_CLICK, MOD_MASK_2CLICK, (char_u)'2'},
+ {MOD_MASK_MULTI_CLICK, MOD_MASK_3CLICK, (char_u)'3'},
+ {MOD_MASK_MULTI_CLICK, MOD_MASK_4CLICK, (char_u)'4'},
+#ifdef MACOS
+ {MOD_MASK_CMD, MOD_MASK_CMD, (char_u)'D'},
+#endif
+ /* 'A' must be the last one */
+ {MOD_MASK_ALT, MOD_MASK_ALT, (char_u)'A'},
+ {0, 0, NUL}
+};
+
+/*
+ * Shifted key terminal codes and their unshifted equivalent.
+ * Don't add mouse codes here, they are handled seperately!
+ */
+#define MOD_KEYS_ENTRY_SIZE 5
+
+static char_u modifier_keys_table[] =
+{
+/* mod mask with modifier without modifier */
+ MOD_MASK_SHIFT, '&', '9', '@', '1', /* begin */
+ MOD_MASK_SHIFT, '&', '0', '@', '2', /* cancel */
+ MOD_MASK_SHIFT, '*', '1', '@', '4', /* command */
+ MOD_MASK_SHIFT, '*', '2', '@', '5', /* copy */
+ MOD_MASK_SHIFT, '*', '3', '@', '6', /* create */
+ MOD_MASK_SHIFT, '*', '4', 'k', 'D', /* delete char */
+ MOD_MASK_SHIFT, '*', '5', 'k', 'L', /* delete line */
+ MOD_MASK_SHIFT, '*', '7', '@', '7', /* end */
+ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_END, '@', '7', /* end */
+ MOD_MASK_SHIFT, '*', '9', '@', '9', /* exit */
+ MOD_MASK_SHIFT, '*', '0', '@', '0', /* find */
+ MOD_MASK_SHIFT, '#', '1', '%', '1', /* help */
+ MOD_MASK_SHIFT, '#', '2', 'k', 'h', /* home */
+ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_HOME, 'k', 'h', /* home */
+ MOD_MASK_SHIFT, '#', '3', 'k', 'I', /* insert */
+ MOD_MASK_SHIFT, '#', '4', 'k', 'l', /* left arrow */
+ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_LEFT, 'k', 'l', /* left arrow */
+ MOD_MASK_SHIFT, '%', 'a', '%', '3', /* message */
+ MOD_MASK_SHIFT, '%', 'b', '%', '4', /* move */
+ MOD_MASK_SHIFT, '%', 'c', '%', '5', /* next */
+ MOD_MASK_SHIFT, '%', 'd', '%', '7', /* options */
+ MOD_MASK_SHIFT, '%', 'e', '%', '8', /* previous */
+ MOD_MASK_SHIFT, '%', 'f', '%', '9', /* print */
+ MOD_MASK_SHIFT, '%', 'g', '%', '0', /* redo */
+ MOD_MASK_SHIFT, '%', 'h', '&', '3', /* replace */
+ MOD_MASK_SHIFT, '%', 'i', 'k', 'r', /* right arr. */
+ MOD_MASK_CTRL, KS_EXTRA, (int)KE_C_RIGHT, 'k', 'r', /* right arr. */
+ MOD_MASK_SHIFT, '%', 'j', '&', '5', /* resume */
+ MOD_MASK_SHIFT, '!', '1', '&', '6', /* save */
+ MOD_MASK_SHIFT, '!', '2', '&', '7', /* suspend */
+ MOD_MASK_SHIFT, '!', '3', '&', '8', /* undo */
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_UP, 'k', 'u', /* up arrow */
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_DOWN, 'k', 'd', /* down arrow */
+
+ /* vt100 F1 */
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF1, KS_EXTRA, (int)KE_XF1,
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF2, KS_EXTRA, (int)KE_XF2,
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF3, KS_EXTRA, (int)KE_XF3,
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_XF4, KS_EXTRA, (int)KE_XF4,
+
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F1, 'k', '1', /* F1 */
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F2, 'k', '2',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F3, 'k', '3',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F4, 'k', '4',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F5, 'k', '5',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F6, 'k', '6',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F7, 'k', '7',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F8, 'k', '8',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F9, 'k', '9',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F10, 'k', ';', /* F10 */
+
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F11, 'F', '1',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F12, 'F', '2',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F13, 'F', '3',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F14, 'F', '4',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F15, 'F', '5',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F16, 'F', '6',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F17, 'F', '7',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F18, 'F', '8',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F19, 'F', '9',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F20, 'F', 'A',
+
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F21, 'F', 'B',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F22, 'F', 'C',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F23, 'F', 'D',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F24, 'F', 'E',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F25, 'F', 'F',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F26, 'F', 'G',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F27, 'F', 'H',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F28, 'F', 'I',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F29, 'F', 'J',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F30, 'F', 'K',
+
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F31, 'F', 'L',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F32, 'F', 'M',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F33, 'F', 'N',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F34, 'F', 'O',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F35, 'F', 'P',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F36, 'F', 'Q',
+ MOD_MASK_SHIFT, KS_EXTRA, (int)KE_S_F37, 'F', 'R',
+
+ /* TAB pseudo code*/
+ MOD_MASK_SHIFT, 'k', 'B', KS_EXTRA, (int)KE_TAB,
+
+ NUL
+};
+
+static struct key_name_entry
+{
+ int key; /* Special key code or ascii value */
+ char_u *name; /* Name of key */
+} key_names_table[] =
+{
+ {' ', (char_u *)"Space"},
+ {TAB, (char_u *)"Tab"},
+ {K_TAB, (char_u *)"Tab"},
+ {NL, (char_u *)"NL"},
+ {NL, (char_u *)"NewLine"}, /* Alternative name */
+ {NL, (char_u *)"LineFeed"}, /* Alternative name */
+ {NL, (char_u *)"LF"}, /* Alternative name */
+ {CAR, (char_u *)"CR"},
+ {CAR, (char_u *)"Return"}, /* Alternative name */
+ {CAR, (char_u *)"Enter"}, /* Alternative name */
+ {K_BS, (char_u *)"BS"},
+ {K_BS, (char_u *)"BackSpace"}, /* Alternative name */
+ {ESC, (char_u *)"Esc"},
+ {CSI, (char_u *)"CSI"},
+ {K_CSI, (char_u *)"xCSI"},
+ {'|', (char_u *)"Bar"},
+ {'\\', (char_u *)"Bslash"},
+ {K_DEL, (char_u *)"Del"},
+ {K_DEL, (char_u *)"Delete"}, /* Alternative name */
+ {K_KDEL, (char_u *)"kDel"},
+ {K_UP, (char_u *)"Up"},
+ {K_DOWN, (char_u *)"Down"},
+ {K_LEFT, (char_u *)"Left"},
+ {K_RIGHT, (char_u *)"Right"},
+
+ {K_F1, (char_u *)"F1"},
+ {K_F2, (char_u *)"F2"},
+ {K_F3, (char_u *)"F3"},
+ {K_F4, (char_u *)"F4"},
+ {K_F5, (char_u *)"F5"},
+ {K_F6, (char_u *)"F6"},
+ {K_F7, (char_u *)"F7"},
+ {K_F8, (char_u *)"F8"},
+ {K_F9, (char_u *)"F9"},
+ {K_F10, (char_u *)"F10"},
+
+ {K_F11, (char_u *)"F11"},
+ {K_F12, (char_u *)"F12"},
+ {K_F13, (char_u *)"F13"},
+ {K_F14, (char_u *)"F14"},
+ {K_F15, (char_u *)"F15"},
+ {K_F16, (char_u *)"F16"},
+ {K_F17, (char_u *)"F17"},
+ {K_F18, (char_u *)"F18"},
+ {K_F19, (char_u *)"F19"},
+ {K_F20, (char_u *)"F20"},
+
+ {K_F21, (char_u *)"F21"},
+ {K_F22, (char_u *)"F22"},
+ {K_F23, (char_u *)"F23"},
+ {K_F24, (char_u *)"F24"},
+ {K_F25, (char_u *)"F25"},
+ {K_F26, (char_u *)"F26"},
+ {K_F27, (char_u *)"F27"},
+ {K_F28, (char_u *)"F28"},
+ {K_F29, (char_u *)"F29"},
+ {K_F30, (char_u *)"F30"},
+
+ {K_F31, (char_u *)"F31"},
+ {K_F32, (char_u *)"F32"},
+ {K_F33, (char_u *)"F33"},
+ {K_F34, (char_u *)"F34"},
+ {K_F35, (char_u *)"F35"},
+ {K_F36, (char_u *)"F36"},
+ {K_F37, (char_u *)"F37"},
+
+ {K_XF1, (char_u *)"xF1"},
+ {K_XF2, (char_u *)"xF2"},
+ {K_XF3, (char_u *)"xF3"},
+ {K_XF4, (char_u *)"xF4"},
+
+ {K_HELP, (char_u *)"Help"},
+ {K_UNDO, (char_u *)"Undo"},
+ {K_INS, (char_u *)"Insert"},
+ {K_INS, (char_u *)"Ins"}, /* Alternative name */
+ {K_KINS, (char_u *)"kInsert"},
+ {K_HOME, (char_u *)"Home"},
+ {K_KHOME, (char_u *)"kHome"},
+ {K_XHOME, (char_u *)"xHome"},
+ {K_END, (char_u *)"End"},
+ {K_KEND, (char_u *)"kEnd"},
+ {K_XEND, (char_u *)"xEnd"},
+ {K_PAGEUP, (char_u *)"PageUp"},
+ {K_PAGEDOWN, (char_u *)"PageDown"},
+ {K_KPAGEUP, (char_u *)"kPageUp"},
+ {K_KPAGEDOWN, (char_u *)"kPageDown"},
+
+ {K_KPLUS, (char_u *)"kPlus"},
+ {K_KMINUS, (char_u *)"kMinus"},
+ {K_KDIVIDE, (char_u *)"kDivide"},
+ {K_KMULTIPLY, (char_u *)"kMultiply"},
+ {K_KENTER, (char_u *)"kEnter"},
+ {K_KPOINT, (char_u *)"kPoint"},
+
+ {K_K0, (char_u *)"k0"},
+ {K_K1, (char_u *)"k1"},
+ {K_K2, (char_u *)"k2"},
+ {K_K3, (char_u *)"k3"},
+ {K_K4, (char_u *)"k4"},
+ {K_K5, (char_u *)"k5"},
+ {K_K6, (char_u *)"k6"},
+ {K_K7, (char_u *)"k7"},
+ {K_K8, (char_u *)"k8"},
+ {K_K9, (char_u *)"k9"},
+
+ {'<', (char_u *)"lt"},
+
+ {K_MOUSE, (char_u *)"Mouse"},
+ {K_NETTERM_MOUSE, (char_u *)"NetMouse"},
+ {K_DEC_MOUSE, (char_u *)"DecMouse"},
+ {K_JSBTERM_MOUSE, (char_u *)"JsbMouse"},
+ {K_PTERM_MOUSE, (char_u *)"PtermMouse"},
+ {K_LEFTMOUSE, (char_u *)"LeftMouse"},
+ {K_LEFTMOUSE_NM, (char_u *)"LeftMouseNM"},
+ {K_LEFTDRAG, (char_u *)"LeftDrag"},
+ {K_LEFTRELEASE, (char_u *)"LeftRelease"},
+ {K_LEFTRELEASE_NM, (char_u *)"LeftReleaseNM"},
+ {K_MIDDLEMOUSE, (char_u *)"MiddleMouse"},
+ {K_MIDDLEDRAG, (char_u *)"MiddleDrag"},
+ {K_MIDDLERELEASE, (char_u *)"MiddleRelease"},
+ {K_RIGHTMOUSE, (char_u *)"RightMouse"},
+ {K_RIGHTDRAG, (char_u *)"RightDrag"},
+ {K_RIGHTRELEASE, (char_u *)"RightRelease"},
+ {K_MOUSEDOWN, (char_u *)"MouseDown"},
+ {K_MOUSEUP, (char_u *)"MouseUp"},
+ {K_X1MOUSE, (char_u *)"X1Mouse"},
+ {K_X1DRAG, (char_u *)"X1Drag"},
+ {K_X1RELEASE, (char_u *)"X1Release"},
+ {K_X2MOUSE, (char_u *)"X2Mouse"},
+ {K_X2DRAG, (char_u *)"X2Drag"},
+ {K_X2RELEASE, (char_u *)"X2Release"},
+ {K_DROP, (char_u *)"Drop"},
+ {K_ZERO, (char_u *)"Nul"},
+#ifdef FEAT_EVAL
+ {K_SNR, (char_u *)"SNR"},
+#endif
+ {K_PLUG, (char_u *)"Plug"},
+ {0, NULL}
+};
+
+#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / sizeof(struct key_name_entry))
+
+#ifdef FEAT_MOUSE
+static struct mousetable
+{
+ int pseudo_code; /* Code for pseudo mouse event */
+ int button; /* Which mouse button is it? */
+ int is_click; /* Is it a mouse button click event? */
+ int is_drag; /* Is it a mouse drag event? */
+} mouse_table[] =
+{
+ {(int)KE_LEFTMOUSE, MOUSE_LEFT, TRUE, FALSE},
+#ifdef FEAT_GUI
+ {(int)KE_LEFTMOUSE_NM, MOUSE_LEFT, TRUE, FALSE},
+#endif
+ {(int)KE_LEFTDRAG, MOUSE_LEFT, FALSE, TRUE},
+ {(int)KE_LEFTRELEASE, MOUSE_LEFT, FALSE, FALSE},
+#ifdef FEAT_GUI
+ {(int)KE_LEFTRELEASE_NM, MOUSE_LEFT, FALSE, FALSE},
+#endif
+ {(int)KE_MIDDLEMOUSE, MOUSE_MIDDLE, TRUE, FALSE},
+ {(int)KE_MIDDLEDRAG, MOUSE_MIDDLE, FALSE, TRUE},
+ {(int)KE_MIDDLERELEASE, MOUSE_MIDDLE, FALSE, FALSE},
+ {(int)KE_RIGHTMOUSE, MOUSE_RIGHT, TRUE, FALSE},
+ {(int)KE_RIGHTDRAG, MOUSE_RIGHT, FALSE, TRUE},
+ {(int)KE_RIGHTRELEASE, MOUSE_RIGHT, FALSE, FALSE},
+ {(int)KE_X1MOUSE, MOUSE_X1, TRUE, FALSE},
+ {(int)KE_X1DRAG, MOUSE_X1, FALSE, TRUE},
+ {(int)KE_X1RELEASE, MOUSE_X1, FALSE, FALSE},
+ {(int)KE_X2MOUSE, MOUSE_X2, TRUE, FALSE},
+ {(int)KE_X2DRAG, MOUSE_X2, FALSE, TRUE},
+ {(int)KE_X2RELEASE, MOUSE_X2, FALSE, FALSE},
+ /* DRAG without CLICK */
+ {(int)KE_IGNORE, MOUSE_RELEASE, FALSE, TRUE},
+ /* RELEASE without CLICK */
+ {(int)KE_IGNORE, MOUSE_RELEASE, FALSE, FALSE},
+ {0, 0, 0, 0},
+};
+#endif /* FEAT_MOUSE */
+
+/*
+ * Return the modifier mask bit (MOD_MASK_*) which corresponds to the given
+ * modifier name ('S' for Shift, 'C' for Ctrl etc).
+ */
+ int
+name_to_mod_mask(c)
+ int c;
+{
+ int i;
+
+ c = TOUPPER_ASC(c);
+ for (i = 0; mod_mask_table[i].mod_mask != 0; i++)
+ if (c == mod_mask_table[i].name)
+ return mod_mask_table[i].mod_flag;
+ return 0;
+}
+
+#if 0 /* not used */
+/*
+ * Decide whether the given key code (K_*) is a shifted special
+ * key (by looking at mod_mask). If it is, then return the appropriate shifted
+ * key code, otherwise just return the character as is.
+ */
+ int
+check_shifted_spec_key(c)
+ int c;
+{
+ return simplify_key(c, &mod_mask);
+}
+#endif
+
+/*
+ * Check if if there is a special key code for "key" that includes the
+ * modifiers specified.
+ */
+ int
+simplify_key(key, modifiers)
+ int key;
+ int *modifiers;
+{
+ int i;
+ int key0;
+ int key1;
+
+ if (*modifiers & (MOD_MASK_SHIFT | MOD_MASK_CTRL | MOD_MASK_ALT))
+ {
+ /* TAB is a special case */
+ if (key == TAB && (*modifiers & MOD_MASK_SHIFT))
+ {
+ *modifiers &= ~MOD_MASK_SHIFT;
+ return K_S_TAB;
+ }
+ key0 = KEY2TERMCAP0(key);
+ key1 = KEY2TERMCAP1(key);
+ for (i = 0; modifier_keys_table[i] != NUL; i += MOD_KEYS_ENTRY_SIZE)
+ if (key0 == modifier_keys_table[i + 3]
+ && key1 == modifier_keys_table[i + 4]
+ && (*modifiers & modifier_keys_table[i]))
+ {
+ *modifiers &= ~modifier_keys_table[i];
+ return TERMCAP2KEY(modifier_keys_table[i + 1],
+ modifier_keys_table[i + 2]);
+ }
+ }
+ return key;
+}
+
+/*
+ * Return a string which contains the name of the given key when the given
+ * modifiers are down.
+ */
+ char_u *
+get_special_key_name(c, modifiers)
+ int c;
+ int modifiers;
+{
+ static char_u string[MAX_KEY_NAME_LEN + 1];
+
+ int i, idx;
+ int table_idx;
+ char_u *s;
+
+ string[0] = '<';
+ idx = 1;
+
+ /* Key that stands for a normal character. */
+ if (IS_SPECIAL(c) && KEY2TERMCAP0(c) == KS_KEY)
+ c = KEY2TERMCAP1(c);
+
+ /*
+ * Translate shifted special keys into unshifted keys and set modifier.
+ * Same for CTRL and ALT modifiers.
+ */
+ if (IS_SPECIAL(c))
+ {
+ for (i = 0; modifier_keys_table[i] != 0; i += MOD_KEYS_ENTRY_SIZE)
+ if ( KEY2TERMCAP0(c) == (int)modifier_keys_table[i + 1]
+ && (int)KEY2TERMCAP1(c) == (int)modifier_keys_table[i + 2])
+ {
+ modifiers |= modifier_keys_table[i];
+ c = TERMCAP2KEY(modifier_keys_table[i + 3],
+ modifier_keys_table[i + 4]);
+ break;
+ }
+ }
+
+ /* try to find the key in the special key table */
+ table_idx = find_special_key_in_table(c);
+
+ /*
+ * When not a known special key, and not a printable character, try to
+ * extract modifiers.
+ */
+ if (c > 0
+#ifdef FEAT_MBYTE
+ && (*mb_char2len)(c) == 1
+#endif
+ )
+ {
+ if (table_idx < 0
+ && (!vim_isprintc(c) || (c & 0x7f) == ' ')
+ && (c & 0x80))
+ {
+ c &= 0x7f;
+ modifiers |= MOD_MASK_ALT;
+ /* try again, to find the un-alted key in the special key table */
+ table_idx = find_special_key_in_table(c);
+ }
+ if (table_idx < 0 && !vim_isprintc(c) && c < ' ')
+ {
+#ifdef EBCDIC
+ c = CtrlChar(c);
+#else
+ c += '@';
+#endif
+ modifiers |= MOD_MASK_CTRL;
+ }
+ }
+
+ /* translate the modifier into a string */
+ for (i = 0; mod_mask_table[i].name != 'A'; i++)
+ if ((modifiers & mod_mask_table[i].mod_mask)
+ == mod_mask_table[i].mod_flag)
+ {
+ string[idx++] = mod_mask_table[i].name;
+ string[idx++] = (char_u)'-';
+ }
+
+ if (table_idx < 0) /* unknown special key, may output t_xx */
+ {
+ if (IS_SPECIAL(c))
+ {
+ string[idx++] = 't';
+ string[idx++] = '_';
+ string[idx++] = KEY2TERMCAP0(c);
+ string[idx++] = KEY2TERMCAP1(c);
+ }
+ /* Not a special key, only modifiers, output directly */
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (*mb_char2len)(c) > 1)
+ idx += (*mb_char2bytes)(c, string + idx);
+ else
+#endif
+ if (vim_isprintc(c))
+ string[idx++] = c;
+ else
+ {
+ s = transchar(c);
+ while (*s)
+ string[idx++] = *s++;
+ }
+ }
+ }
+ else /* use name of special key */
+ {
+ STRCPY(string + idx, key_names_table[table_idx].name);
+ idx = (int)STRLEN(string);
+ }
+ string[idx++] = '>';
+ string[idx] = NUL;
+ return string;
+}
+
+/*
+ * Try translating a <> name at (*srcp)[] to dst[].
+ * Return the number of characters added to dst[], zero for no match.
+ * If there is a match, srcp is advanced to after the <> name.
+ * dst[] must be big enough to hold the result (up to six characters)!
+ */
+ int
+trans_special(srcp, dst, keycode)
+ char_u **srcp;
+ char_u *dst;
+ int keycode; /* prefer key code, e.g. K_DEL instead of DEL */
+{
+ int modifiers = 0;
+ int key;
+ int dlen = 0;
+
+ key = find_special_key(srcp, &modifiers, keycode);
+ if (key == 0)
+ return 0;
+
+ /* Put the appropriate modifier in a string */
+ if (modifiers != 0)
+ {
+ dst[dlen++] = K_SPECIAL;
+ dst[dlen++] = KS_MODIFIER;
+ dst[dlen++] = modifiers;
+ }
+
+ if (IS_SPECIAL(key))
+ {
+ dst[dlen++] = K_SPECIAL;
+ dst[dlen++] = KEY2TERMCAP0(key);
+ dst[dlen++] = KEY2TERMCAP1(key);
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte && !keycode)
+ dlen += (*mb_char2bytes)(key, dst + dlen);
+#endif
+ else if (keycode)
+ dlen = (int)(add_char2buf(key, dst + dlen) - dst);
+ else
+ dst[dlen++] = key;
+
+ return dlen;
+}
+
+/*
+ * Try translating a <> name at (*srcp)[], return the key and modifiers.
+ * srcp is advanced to after the <> name.
+ * returns 0 if there is no match.
+ */
+ int
+find_special_key(srcp, modp, keycode)
+ char_u **srcp;
+ int *modp;
+ int keycode; /* prefer key code, e.g. K_DEL instead of DEL */
+{
+ char_u *last_dash;
+ char_u *end_of_name;
+ char_u *src;
+ char_u *bp;
+ int modifiers;
+ int bit;
+ int key;
+ long_u n;
+
+ src = *srcp;
+ if (src[0] != '<')
+ return 0;
+
+ /* Find end of modifier list */
+ last_dash = src;
+ for (bp = src + 1; *bp == '-' || vim_isIDc(*bp); bp++)
+ {
+ if (*bp == '-')
+ {
+ last_dash = bp;
+ if (bp[1] != NUL && bp[2] == '>')
+ ++bp; /* anything accepted, like <C-?> */
+ }
+ if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
+ bp += 3; /* skip t_xx, xx may be '-' or '>' */
+ }
+
+ if (*bp == '>') /* found matching '>' */
+ {
+ end_of_name = bp + 1;
+
+ if (STRNICMP(src + 1, "char-", 5) == 0 && VIM_ISDIGIT(src[6]))
+ {
+ /* <Char-123> or <Char-033> or <Char-0x33> */
+ vim_str2nr(src + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
+ *modp = 0;
+ *srcp = end_of_name;
+ return (int)n;
+ }
+
+ /* Which modifiers are given? */
+ modifiers = 0x0;
+ for (bp = src + 1; bp < last_dash; bp++)
+ {
+ if (*bp != '-')
+ {
+ bit = name_to_mod_mask(*bp);
+ if (bit == 0x0)
+ break; /* Illegal modifier name */
+ modifiers |= bit;
+ }
+ }
+
+ /*
+ * Legal modifier name.
+ */
+ if (bp >= last_dash)
+ {
+ /*
+ * Modifier with single letter, or special key name.
+ */
+ if (modifiers != 0 && last_dash[2] == '>')
+ key = last_dash[1];
+ else
+ key = get_special_key_code(last_dash + 1);
+
+ /*
+ * get_special_key_code() may return NUL for invalid
+ * special key name.
+ */
+ if (key != NUL)
+ {
+ /*
+ * Only use a modifier when there is no special key code that
+ * includes the modifier.
+ */
+ key = simplify_key(key, &modifiers);
+
+ if (!keycode)
+ {
+ /* don't want keycode, use single byte code */
+ if (key == K_BS)
+ key = BS;
+ else if (key == K_DEL || key == K_KDEL)
+ key = DEL;
+ }
+
+ /*
+ * Normal Key with modifier: Try to make a single byte code.
+ */
+ if (!IS_SPECIAL(key))
+ key = extract_modifiers(key, &modifiers);
+
+ *modp = modifiers;
+ *srcp = end_of_name;
+ return key;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+ * Try to include modifiers in the key.
+ * Changes "Shift-a" to 'A', "Alt-A" to 0xc0, etc.
+ */
+ int
+extract_modifiers(key, modp)
+ int key;
+ int *modp;
+{
+ int modifiers = *modp;
+
+#ifdef MACOS
+ /* Command-key really special, No fancynest */
+ if (!(modifiers & MOD_MASK_CMD))
+#endif
+ if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key))
+ {
+ key = TOUPPER_ASC(key);
+ modifiers &= ~MOD_MASK_SHIFT;
+ }
+ if ((modifiers & MOD_MASK_CTRL)
+#ifdef EBCDIC
+ /* * TODO: EBCDIC Better use:
+ * && (Ctrl_chr(key) || key == '?')
+ * ??? */
+ && strchr("?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_", key)
+ != NULL
+#else
+ && ((key >= '?' && key <= '_') || ASCII_ISALPHA(key))
+#endif
+ )
+ {
+ key = Ctrl_chr(key);
+ modifiers &= ~MOD_MASK_CTRL;
+ /* <C-@> is <Nul> */
+ if (key == 0)
+ key = K_ZERO;
+ }
+#ifdef MACOS
+ /* Command-key really special, No fancynest */
+ if (!(modifiers & MOD_MASK_CMD))
+#endif
+ if ((modifiers & MOD_MASK_ALT) && key < 0x80
+#ifdef FEAT_MBYTE
+ && !enc_dbcs /* avoid creating a lead byte */
+#endif
+ )
+ {
+ key |= 0x80;
+ modifiers &= ~MOD_MASK_ALT; /* remove the META modifier */
+ }
+
+ *modp = modifiers;
+ return key;
+}
+
+/*
+ * Try to find key "c" in the special key table.
+ * Return the index when found, -1 when not found.
+ */
+ int
+find_special_key_in_table(c)
+ int c;
+{
+ int i;
+
+ for (i = 0; key_names_table[i].name != NULL; i++)
+ if (c == key_names_table[i].key)
+ break;
+ if (key_names_table[i].name == NULL)
+ i = -1;
+ return i;
+}
+
+/*
+ * Find the special key with the given name (the given string does not have to
+ * end with NUL, the name is assumed to end before the first non-idchar).
+ * If the name starts with "t_" the next two characters are interpreted as a
+ * termcap name.
+ * Return the key code, or 0 if not found.
+ */
+ int
+get_special_key_code(name)
+ char_u *name;
+{
+ char_u *table_name;
+ char_u string[3];
+ int i, j;
+
+ /*
+ * If it's <t_xx> we get the code for xx from the termcap
+ */
+ if (name[0] == 't' && name[1] == '_' && name[2] != NUL && name[3] != NUL)
+ {
+ string[0] = name[2];
+ string[1] = name[3];
+ string[2] = NUL;
+ if (add_termcap_entry(string, FALSE) == OK)
+ return TERMCAP2KEY(name[2], name[3]);
+ }
+ else
+ for (i = 0; key_names_table[i].name != NULL; i++)
+ {
+ table_name = key_names_table[i].name;
+ for (j = 0; vim_isIDc(name[j]) && table_name[j] != NUL; j++)
+ if (TOLOWER_ASC(table_name[j]) != TOLOWER_ASC(name[j]))
+ break;
+ if (!vim_isIDc(name[j]) && table_name[j] == NUL)
+ return key_names_table[i].key;
+ }
+ return 0;
+}
+
+#ifdef FEAT_CMDL_COMPL
+ char_u *
+get_key_name(i)
+ int i;
+{
+ if (i >= KEY_NAMES_TABLE_LEN)
+ return NULL;
+ return key_names_table[i].name;
+}
+#endif
+
+#ifdef FEAT_MOUSE
+/*
+ * Look up the given mouse code to return the relevant information in the other
+ * arguments. Return which button is down or was released.
+ */
+ int
+get_mouse_button(code, is_click, is_drag)
+ int code;
+ int *is_click;
+ int *is_drag;
+{
+ int i;
+
+ for (i = 0; mouse_table[i].pseudo_code; i++)
+ if (code == mouse_table[i].pseudo_code)
+ {
+ *is_click = mouse_table[i].is_click;
+ *is_drag = mouse_table[i].is_drag;
+ return mouse_table[i].button;
+ }
+ return 0; /* Shouldn't get here */
+}
+
+/*
+ * Return the appropriate pseudo mouse event token (KE_LEFTMOUSE etc) based on
+ * the given information about which mouse button is down, and whether the
+ * mouse was clicked, dragged or released.
+ */
+ int
+get_pseudo_mouse_code(button, is_click, is_drag)
+ int button; /* eg MOUSE_LEFT */
+ int is_click;
+ int is_drag;
+{
+ int i;
+
+ for (i = 0; mouse_table[i].pseudo_code; i++)
+ if (button == mouse_table[i].button
+ && is_click == mouse_table[i].is_click
+ && is_drag == mouse_table[i].is_drag)
+ {
+#ifdef FEAT_GUI
+ /* Trick: a non mappable left click and release has mouse_col < 0.
+ * Used for 'mousefocus' in gui_mouse_moved() */
+ if (mouse_col < 0)
+ {
+ mouse_col = 0;
+ if (mouse_table[i].pseudo_code == (int)KE_LEFTMOUSE)
+ return (int)KE_LEFTMOUSE_NM;
+ if (mouse_table[i].pseudo_code == (int)KE_LEFTRELEASE)
+ return (int)KE_LEFTRELEASE_NM;
+ }
+#endif
+ return mouse_table[i].pseudo_code;
+ }
+ return (int)KE_IGNORE; /* not recongnized, ignore it */
+}
+#endif /* FEAT_MOUSE */
+
+/*
+ * Return the current end-of-line type: EOL_DOS, EOL_UNIX or EOL_MAC.
+ */
+ int
+get_fileformat(buf)
+ buf_T *buf;
+{
+ int c = *buf->b_p_ff;
+
+ if (buf->b_p_bin || c == 'u')
+ return EOL_UNIX;
+ if (c == 'm')
+ return EOL_MAC;
+ return EOL_DOS;
+}
+
+/*
+ * Like get_fileformat(), but override 'fileformat' with "p" for "++opt=val"
+ * argument.
+ */
+ int
+get_fileformat_force(buf, eap)
+ buf_T *buf;
+ exarg_T *eap; /* can be NULL! */
+{
+ int c;
+
+ if (eap != NULL && eap->force_ff != 0)
+ c = eap->cmd[eap->force_ff];
+ else
+ {
+ if ((eap != NULL && eap->force_bin != 0)
+ ? (eap->force_bin == FORCE_BIN) : buf->b_p_bin)
+ return EOL_UNIX;
+ c = *buf->b_p_ff;
+ }
+ if (c == 'u')
+ return EOL_UNIX;
+ if (c == 'm')
+ return EOL_MAC;
+ return EOL_DOS;
+}
+
+/*
+ * Set the current end-of-line type to EOL_DOS, EOL_UNIX or EOL_MAC.
+ * Sets both 'textmode' and 'fileformat'.
+ * Note: Does _not_ set global value of 'textmode'!
+ */
+ void
+set_fileformat(t, opt_flags)
+ int t;
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ char *p = NULL;
+
+ switch (t)
+ {
+ case EOL_DOS:
+ p = FF_DOS;
+ curbuf->b_p_tx = TRUE;
+ break;
+ case EOL_UNIX:
+ p = FF_UNIX;
+ curbuf->b_p_tx = FALSE;
+ break;
+ case EOL_MAC:
+ p = FF_MAC;
+ curbuf->b_p_tx = FALSE;
+ break;
+ }
+ if (p != NULL)
+ set_string_option_direct((char_u *)"ff", -1, (char_u *)p,
+ OPT_FREE | opt_flags);
+#ifdef FEAT_WINDOWS
+ check_status(curbuf);
+#endif
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE; /* set window title later */
+#endif
+}
+
+/*
+ * Return the default fileformat from 'fileformats'.
+ */
+ int
+default_fileformat()
+{
+ switch (*p_ffs)
+ {
+ case 'm': return EOL_MAC;
+ case 'd': return EOL_DOS;
+ }
+ return EOL_UNIX;
+}
+
+/*
+ * Call shell. Calls mch_call_shell, with 'shellxquote' added.
+ */
+ int
+call_shell(cmd, opt)
+ char_u *cmd;
+ int opt;
+{
+ char_u *ncmd;
+ int retval;
+
+ if (p_verbose > 3)
+ {
+ msg_str((char_u *)_("Calling shell to execute: \"%s\""),
+ cmd == NULL ? p_sh : cmd);
+ out_char('\n');
+ cursor_on();
+ }
+
+ if (*p_sh == NUL)
+ {
+ EMSG(_(e_shellempty));
+ retval = -1;
+ }
+ else
+ {
+#ifdef FEAT_GUI_MSWIN
+ /* Don't hide the pointer while executing a shell command. */
+ gui_mch_mousehide(FALSE);
+#endif
+#ifdef FEAT_GUI
+ ++hold_gui_events;
+#endif
+ /* The external command may update a tags file, clear cached tags. */
+ tag_freematch();
+
+ if (cmd == NULL || *p_sxq == NUL)
+ retval = mch_call_shell(cmd, opt);
+ else
+ {
+ ncmd = alloc((unsigned)(STRLEN(cmd) + STRLEN(p_sxq) * 2 + 1));
+ if (ncmd != NULL)
+ {
+ STRCPY(ncmd, p_sxq);
+ STRCAT(ncmd, cmd);
+ STRCAT(ncmd, p_sxq);
+ retval = mch_call_shell(ncmd, opt);
+ vim_free(ncmd);
+ }
+ else
+ retval = -1;
+ }
+#ifdef FEAT_GUI
+ --hold_gui_events;
+#endif
+ /*
+ * Check the window size, in case it changed while executing the
+ * external command.
+ */
+ shell_resized_check();
+ }
+
+#ifdef FEAT_EVAL
+ set_vim_var_nr(VV_SHELL_ERROR, (long)retval);
+#endif
+
+ return retval;
+}
+
+/*
+ * VISUAL and OP_PENDING State are never set, they are equal to NORMAL State
+ * with a condition. This function returns the real State.
+ */
+ int
+get_real_state()
+{
+ if (State & NORMAL)
+ {
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ return VISUAL;
+ else
+#endif
+ if (finish_op)
+ return OP_PENDING;
+ }
+ return State;
+}
+
+#if defined(FEAT_SESSION) || defined(MSWIN) || defined(FEAT_GUI_MAC) \
+ || (defined(FEAT_GUI_GTK) \
+ && (defined(FEAT_WINDOWS) || defined(FEAT_DND))) \
+ || defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
+ || defined(PROTO)
+/*
+ * Change to a file's directory.
+ * Caller must call shorten_fnames()!
+ * Return OK or FAIL.
+ */
+ int
+vim_chdirfile(fname)
+ char_u *fname;
+{
+ char_u temp_string[MAXPATHL];
+ char_u *p;
+ char_u *t;
+
+ STRCPY(temp_string, fname);
+ p = get_past_head(temp_string);
+ t = gettail(temp_string);
+ while (t > p && vim_ispathsep(t[-1]))
+ --t;
+ *t = NUL; /* chop off end of string */
+
+ return mch_chdir((char *)temp_string) == 0 ? OK : FAIL;
+}
+#endif
+
+#if defined(STAT_IGNORES_SLASH) || defined(PROTO)
+/*
+ * Check if "name" ends in a slash and is not a directory.
+ * Used for systems where stat() ignores a trailing slash on a file name.
+ * The Vim code assumes a trailing slash is only ignored for a directory.
+ */
+ int
+illegal_slash(name)
+ char *name;
+{
+ if (name[0] == NUL)
+ return FALSE; /* no file name is not illegal */
+ if (name[strlen(name) - 1] != '/')
+ return FALSE; /* no trailing slash */
+ if (mch_isdir((char_u *)name))
+ return FALSE; /* trailing slash for a directory */
+ return TRUE;
+}
+#endif
+
+#if defined(CURSOR_SHAPE) || defined(PROTO)
+
+/*
+ * Handling of cursor and mouse pointer shapes in various modes.
+ */
+
+cursorentry_T shape_table[SHAPE_IDX_COUNT] =
+{
+ /* The values will be filled in from the 'guicursor' and 'mouseshape'
+ * defaults when Vim starts.
+ * Adjust the SHAPE_IDX_ defines when making changes! */
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "n", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "v", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "i", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "r", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "c", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "ci", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "cr", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "o", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 700L, 400L, 250L, 0, 0, "ve", SHAPE_CURSOR+SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "e", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "s", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "sd", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "vs", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "vd", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "m", SHAPE_MOUSE},
+ {0, 0, 0, 0L, 0L, 0L, 0, 0, "ml", SHAPE_MOUSE},
+ {0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR},
+};
+
+#ifdef FEAT_MOUSESHAPE
+/*
+ * Table with names for mouse shapes. Keep in sync with all the tables for
+ * mch_set_mouse_shape()!.
+ */
+static char * mshape_names[] =
+{
+ "arrow", /* default, must be the first one */
+ "blank", /* hidden */
+ "beam",
+ "updown",
+ "udsizing",
+ "leftright",
+ "lrsizing",
+ "busy",
+ "no",
+ "crosshair",
+ "hand1",
+ "hand2",
+ "pencil",
+ "question",
+ "rightup-arrow",
+ "up-arrow",
+ NULL
+};
+#endif
+
+/*
+ * Parse the 'guicursor' option ("what" is SHAPE_CURSOR) or 'mouseshape'
+ * ("what" is SHAPE_MOUSE).
+ * Returns error message for an illegal option, NULL otherwise.
+ */
+ char_u *
+parse_shape_opt(what)
+ int what;
+{
+ char_u *modep;
+ char_u *colonp;
+ char_u *commap;
+ char_u *slashp;
+ char_u *p, *endp;
+ int idx = 0; /* init for GCC */
+ int all_idx;
+ int len;
+ int i;
+ long n;
+ int found_ve = FALSE; /* found "ve" flag */
+ int round;
+
+ /*
+ * First round: check for errors; second round: do it for real.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ /*
+ * Repeat for all comma separated parts.
+ */
+#ifdef FEAT_MOUSESHAPE
+ if (what == SHAPE_MOUSE)
+ modep = p_mouseshape;
+ else
+#endif
+ modep = p_guicursor;
+ while (*modep != NUL)
+ {
+ colonp = vim_strchr(modep, ':');
+ if (colonp == NULL)
+ return (char_u *)N_("E545: Missing colon");
+ if (colonp == modep)
+ return (char_u *)N_("E546: Illegal mode");
+ commap = vim_strchr(modep, ',');
+
+ /*
+ * Repeat for all mode's before the colon.
+ * For the 'a' mode, we loop to handle all the modes.
+ */
+ all_idx = -1;
+ while (modep < colonp || all_idx >= 0)
+ {
+ if (all_idx < 0)
+ {
+ /* Find the mode. */
+ if (modep[1] == '-' || modep[1] == ':')
+ len = 1;
+ else
+ len = 2;
+ if (len == 1 && TOLOWER_ASC(modep[0]) == 'a')
+ all_idx = SHAPE_IDX_COUNT - 1;
+ else
+ {
+ for (idx = 0; idx < SHAPE_IDX_COUNT; ++idx)
+ if (STRNICMP(modep, shape_table[idx].name, len)
+ == 0)
+ break;
+ if (idx == SHAPE_IDX_COUNT
+ || (shape_table[idx].used_for & what) == 0)
+ return (char_u *)N_("E546: Illegal mode");
+ if (len == 2 && modep[0] == 'v' && modep[1] == 'e')
+ found_ve = TRUE;
+ }
+ modep += len + 1;
+ }
+
+ if (all_idx >= 0)
+ idx = all_idx--;
+ else if (round == 2)
+ {
+#ifdef FEAT_MOUSESHAPE
+ if (what == SHAPE_MOUSE)
+ {
+ /* Set the default, for the missing parts */
+ shape_table[idx].mshape = 0;
+ }
+ else
+#endif
+ {
+ /* Set the defaults, for the missing parts */
+ shape_table[idx].shape = SHAPE_BLOCK;
+ shape_table[idx].blinkwait = 700L;
+ shape_table[idx].blinkon = 400L;
+ shape_table[idx].blinkoff = 250L;
+ }
+ }
+
+ /* Parse the part after the colon */
+ for (p = colonp + 1; *p && *p != ','; )
+ {
+#ifdef FEAT_MOUSESHAPE
+ if (what == SHAPE_MOUSE)
+ {
+ for (i = 0; ; ++i)
+ {
+ if (mshape_names[i] == NULL)
+ {
+ if (!VIM_ISDIGIT(*p))
+ return (char_u *)N_("E547: Illegal mouseshape");
+ if (round == 2)
+ shape_table[idx].mshape =
+ getdigits(&p) + MSHAPE_NUMBERED;
+ else
+ (void)getdigits(&p);
+ break;
+ }
+ len = (int)STRLEN(mshape_names[i]);
+ if (STRNICMP(p, mshape_names[i], len) == 0)
+ {
+ if (round == 2)
+ shape_table[idx].mshape = i;
+ p += len;
+ break;
+ }
+ }
+ }
+ else /* if (what == SHAPE_MOUSE) */
+#endif
+ {
+ /*
+ * First handle the ones with a number argument.
+ */
+ i = *p;
+ len = 0;
+ if (STRNICMP(p, "ver", 3) == 0)
+ len = 3;
+ else if (STRNICMP(p, "hor", 3) == 0)
+ len = 3;
+ else if (STRNICMP(p, "blinkwait", 9) == 0)
+ len = 9;
+ else if (STRNICMP(p, "blinkon", 7) == 0)
+ len = 7;
+ else if (STRNICMP(p, "blinkoff", 8) == 0)
+ len = 8;
+ if (len != 0)
+ {
+ p += len;
+ if (!VIM_ISDIGIT(*p))
+ return (char_u *)N_("E548: digit expected");
+ n = getdigits(&p);
+ if (len == 3) /* "ver" or "hor" */
+ {
+ if (n == 0)
+ return (char_u *)N_("E549: Illegal percentage");
+ if (round == 2)
+ {
+ if (TOLOWER_ASC(i) == 'v')
+ shape_table[idx].shape = SHAPE_VER;
+ else
+ shape_table[idx].shape = SHAPE_HOR;
+ shape_table[idx].percentage = n;
+ }
+ }
+ else if (round == 2)
+ {
+ if (len == 9)
+ shape_table[idx].blinkwait = n;
+ else if (len == 7)
+ shape_table[idx].blinkon = n;
+ else
+ shape_table[idx].blinkoff = n;
+ }
+ }
+ else if (STRNICMP(p, "block", 5) == 0)
+ {
+ if (round == 2)
+ shape_table[idx].shape = SHAPE_BLOCK;
+ p += 5;
+ }
+ else /* must be a highlight group name then */
+ {
+ endp = vim_strchr(p, '-');
+ if (commap == NULL) /* last part */
+ {
+ if (endp == NULL)
+ endp = p + STRLEN(p); /* find end of part */
+ }
+ else if (endp > commap || endp == NULL)
+ endp = commap;
+ slashp = vim_strchr(p, '/');
+ if (slashp != NULL && slashp < endp)
+ {
+ /* "group/langmap_group" */
+ i = syn_check_group(p, (int)(slashp - p));
+ p = slashp + 1;
+ }
+ if (round == 2)
+ {
+ shape_table[idx].id = syn_check_group(p,
+ (int)(endp - p));
+ shape_table[idx].id_lm = shape_table[idx].id;
+ if (slashp != NULL && slashp < endp)
+ shape_table[idx].id = i;
+ }
+ p = endp;
+ }
+ } /* if (what != SHAPE_MOUSE) */
+
+ if (*p == '-')
+ ++p;
+ }
+ }
+ modep = p;
+ if (*modep == ',')
+ ++modep;
+ }
+ }
+
+ /* If the 's' flag is not given, use the 'v' cursor for 's' */
+ if (!found_ve)
+ {
+#ifdef FEAT_MOUSESHAPE
+ if (what == SHAPE_MOUSE)
+ {
+ shape_table[SHAPE_IDX_VE].mshape = shape_table[SHAPE_IDX_V].mshape;
+ }
+ else
+#endif
+ {
+ shape_table[SHAPE_IDX_VE].shape = shape_table[SHAPE_IDX_V].shape;
+ shape_table[SHAPE_IDX_VE].percentage =
+ shape_table[SHAPE_IDX_V].percentage;
+ shape_table[SHAPE_IDX_VE].blinkwait =
+ shape_table[SHAPE_IDX_V].blinkwait;
+ shape_table[SHAPE_IDX_VE].blinkon =
+ shape_table[SHAPE_IDX_V].blinkon;
+ shape_table[SHAPE_IDX_VE].blinkoff =
+ shape_table[SHAPE_IDX_V].blinkoff;
+ shape_table[SHAPE_IDX_VE].id = shape_table[SHAPE_IDX_V].id;
+ shape_table[SHAPE_IDX_VE].id_lm = shape_table[SHAPE_IDX_V].id_lm;
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * Return the index into shape_table[] for the current mode.
+ * When "mouse" is TRUE, consider indexes valid for the mouse pointer.
+ */
+ int
+get_shape_idx(mouse)
+ int mouse;
+{
+#ifdef FEAT_MOUSESHAPE
+ if (mouse && (State == HITRETURN || State == ASKMORE))
+ {
+# ifdef FEAT_GUI
+ if (Y_2_ROW(gui_mch_get_mouse_y()) == Rows - 1)
+ return SHAPE_IDX_MOREL;
+# endif
+ return SHAPE_IDX_MORE;
+ }
+ if (mouse && drag_status_line)
+ return SHAPE_IDX_SDRAG;
+# ifdef FEAT_VERTSPLIT
+ if (mouse && drag_sep_line)
+ return SHAPE_IDX_VDRAG;
+# endif
+#endif
+ if (!mouse && State == SHOWMATCH)
+ return SHAPE_IDX_SM;
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ return SHAPE_IDX_R;
+#endif
+ if (State & REPLACE_FLAG)
+ return SHAPE_IDX_R;
+ if (State & INSERT)
+ return SHAPE_IDX_I;
+ if (State & CMDLINE)
+ {
+ if (cmdline_at_end())
+ return SHAPE_IDX_C;
+ if (cmdline_overstrike())
+ return SHAPE_IDX_CR;
+ return SHAPE_IDX_CI;
+ }
+ if (finish_op)
+ return SHAPE_IDX_O;
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (*p_sel == 'e')
+ return SHAPE_IDX_VE;
+ else
+ return SHAPE_IDX_V;
+ }
+#endif
+ return SHAPE_IDX_N;
+}
+
+# if defined(FEAT_MOUSESHAPE) || defined(PROTO)
+static int old_mouse_shape = 0;
+
+/*
+ * Set the mouse shape:
+ * If "shape" is -1, use shape depending on the current mode,
+ * depending on the current state.
+ * If "shape" is -2, only update the shape when it's CLINE or STATUS (used
+ * when the mouse moves off the status or command line).
+ */
+ void
+update_mouseshape(shape_idx)
+ int shape_idx;
+{
+ int new_mouse_shape;
+
+ /* Only works in GUI mode. */
+ if (!gui.in_use)
+ return;
+
+ /* Postpone the updating when more is to come. Speeds up executing of
+ * mappings. */
+ if (shape_idx == -1 && char_avail())
+ {
+ postponed_mouseshape = TRUE;
+ return;
+ }
+
+ if (shape_idx == -2
+ && old_mouse_shape != shape_table[SHAPE_IDX_CLINE].mshape
+ && old_mouse_shape != shape_table[SHAPE_IDX_STATUS].mshape
+ && old_mouse_shape != shape_table[SHAPE_IDX_VSEP].mshape)
+ return;
+ if (shape_idx < 0)
+ new_mouse_shape = shape_table[get_shape_idx(TRUE)].mshape;
+ else
+ new_mouse_shape = shape_table[shape_idx].mshape;
+ if (new_mouse_shape != old_mouse_shape)
+ {
+ mch_set_mouse_shape(new_mouse_shape);
+ old_mouse_shape = new_mouse_shape;
+ }
+ postponed_mouseshape = FALSE;
+}
+# endif
+
+#endif /* CURSOR_SHAPE */
+
+
+#ifdef FEAT_CRYPT
+/*
+ * Optional encryption suypport.
+ * Mohsin Ahmed, mosh@sasi.com, 98-09-24
+ * Based on zip/crypt sources.
+ *
+ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
+ * most countries. There are a few exceptions, but that still should not be a
+ * problem since this code was originally created in Europe and India.
+ */
+
+/* from zip.h */
+
+typedef unsigned short ush; /* unsigned 16-bit value */
+typedef unsigned long ulg; /* unsigned 32-bit value */
+
+static void make_crc_tab __ARGS((void));
+
+ulg crc_32_tab[256];
+
+/*
+ * Fill the CRC table.
+ */
+ static void
+make_crc_tab()
+{
+ ulg s,t,v;
+ static int done = FALSE;
+
+ if (done)
+ return;
+ for (t = 0; t < 256; t++)
+ {
+ v = t;
+ for (s = 0; s < 8; s++)
+ v = (v >> 1) ^ ((v & 1) * (ulg)0xedb88320L);
+ crc_32_tab[t] = v;
+ }
+ done = TRUE;
+}
+
+#define CRC32(c, b) (crc_32_tab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+
+
+static ulg keys[3]; /* keys defining the pseudo-random sequence */
+
+/*
+ * Return the next byte in the pseudo-random sequence
+ */
+ int
+decrypt_byte()
+{
+ ush temp;
+
+ temp = (ush)keys[2] | 2;
+ return (int)(((unsigned)(temp * (temp ^ 1)) >> 8) & 0xff);
+}
+
+/*
+ * Update the encryption keys with the next byte of plain text
+ */
+ int
+update_keys(c)
+ int c; /* byte of plain text */
+{
+ keys[0] = CRC32(keys[0], c);
+ keys[1] += keys[0] & 0xff;
+ keys[1] = keys[1] * 134775813L + 1;
+ keys[2] = CRC32(keys[2], (int)(keys[1] >> 24));
+ return c;
+}
+
+/*
+ * Initialize the encryption keys and the random header according to
+ * the given password.
+ * If "passwd" is NULL or empty, don't do anything.
+ */
+ void
+crypt_init_keys(passwd)
+ char_u *passwd; /* password string with which to modify keys */
+{
+ if (passwd != NULL && *passwd != NUL)
+ {
+ make_crc_tab();
+ keys[0] = 305419896L;
+ keys[1] = 591751049L;
+ keys[2] = 878082192L;
+ while (*passwd != '\0')
+ update_keys((int)*passwd++);
+ }
+}
+
+/*
+ * Ask the user for a crypt key.
+ * When "store" is TRUE, the new key in stored in the 'key' option, and the
+ * 'key' option value is returned: Don't free it.
+ * When "store" is FALSE, the typed key is returned in allocated memory.
+ * Returns NULL on failure.
+ */
+ char_u *
+get_crypt_key(store, twice)
+ int store;
+ int twice; /* Ask for the key twice. */
+{
+ char_u *p1, *p2 = NULL;
+ int round;
+
+ for (round = 0; ; ++round)
+ {
+ cmdline_star = TRUE;
+ cmdline_row = msg_row;
+ p1 = getcmdline_prompt(NUL, round == 0
+ ? (char_u *)_("Enter encryption key: ")
+ : (char_u *)_("Enter same key again: "), 0);
+ cmdline_star = FALSE;
+
+ if (p1 == NULL)
+ break;
+
+ if (round == twice)
+ {
+ if (p2 != NULL && STRCMP(p1, p2) != 0)
+ {
+ MSG(_("Keys don't match!"));
+ vim_free(p1);
+ vim_free(p2);
+ p2 = NULL;
+ round = -1; /* do it again */
+ continue;
+ }
+ if (store)
+ {
+ set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
+ vim_free(p1);
+ p1 = curbuf->b_p_key;
+ }
+ break;
+ }
+ p2 = p1;
+ }
+
+ /* since the user typed this, no need to wait for return */
+ need_wait_return = FALSE;
+ msg_didout = FALSE;
+
+ vim_free(p2);
+ return p1;
+}
+
+#endif /* FEAT_CRYPT */
+
+/* TODO: make some #ifdef for this */
+/*--------[ file searching ]-------------------------------------------------*/
+/*
+ * File searching functions for 'path', 'tags' and 'cdpath' options.
+ * External visible functions:
+ * vim_findfile_init() creates/initialises the search context
+ * vim_findfile_free_visited() free list of visited files/dirs of search
+ * context
+ * vim_findfile() find a file in the search context
+ * vim_findfile_cleanup() cleanup/free search context created by
+ * vim_findfile_init()
+ *
+ * All static functions and variables start with 'ff_'
+ *
+ * In general it works like this:
+ * First you create yourself a search context by calling vim_findfile_init().
+ * It is possible to give a search context from a previous call to
+ * vim_findfile_init(), so it can be reused. After this you call vim_findfile()
+ * until you are satisfied with the result or it returns NULL. On every call it
+ * returns the next file which matches the conditions given to
+ * vim_findfile_init(). If it doesn't find a next file it returns NULL.
+ *
+ * It is possible to call vim_findfile_init() again to reinitialise your search
+ * with some new parameters. Don't forget to pass your old search context to
+ * it, so it can reuse it and especially reuse the list of already visited
+ * directories. If you want to delete the list of already visited directories
+ * simply call vim_findfile_free_visited().
+ *
+ * When you are done call vim_findfile_cleanup() to free the search context.
+ *
+ * The function vim_findfile_init() has a long comment, which describes the
+ * needed parameters.
+ *
+ *
+ *
+ * ATTENTION:
+ * ==========
+ * Also we use an allocated search context here, this functions ARE NOT
+ * thread-safe!!!!!
+ *
+ * To minimize parameter passing (or because I'm to lazy), only the
+ * external visible functions get a search context as a parameter. This is
+ * then assigned to a static global, which is used throughout the local
+ * functions.
+ */
+
+/*
+ * type for the directory search stack
+ */
+typedef struct ff_stack
+{
+ struct ff_stack *ffs_prev;
+
+ /* the fix part (no wildcards) and the part containing the wildcards
+ * of the search path
+ */
+ char_u *ffs_fix_path;
+#ifdef FEAT_PATH_EXTRA
+ char_u *ffs_wc_path;
+#endif
+
+ /* files/dirs found in the above directory, matched by the first wildcard
+ * of wc_part
+ */
+ char_u **ffs_filearray;
+ int ffs_filearray_size;
+ char_u ffs_filearray_cur; /* needed for partly handled dirs */
+
+ /* to store status of partly handled directories
+ * 0: we work the on this directory for the first time
+ * 1: this directory was partly searched in an earlier step
+ */
+ int ffs_stage;
+
+ /* How deep are we in the directory tree?
+ * Counts backward from value of level parameter to vim_findfile_init
+ */
+ int ffs_level;
+
+ /* Did we already expand '**' to an empty string? */
+ int ffs_star_star_empty;
+} ff_stack_T;
+
+/*
+ * type for already visited directories or files.
+ */
+typedef struct ff_visited
+{
+ struct ff_visited *ffv_next;
+
+#ifdef FEAT_PATH_EXTRA
+ /* Visited directories are different if the wildcard string are
+ * different. So we have to save it.
+ */
+ char_u *ffv_wc_path;
+#endif
+ /* for unix use inode etc for comparison (needed because of links), else
+ * use filename.
+ */
+#ifdef UNIX
+ int ffv_dev; /* device number (-1 if not set) */
+ ino_t ffv_ino; /* inode number */
+#endif
+ /* The memory for this struct is allocated according to the length of
+ * ffv_fname.
+ */
+ char_u ffv_fname[1]; /* actually longer */
+} ff_visited_T;
+
+/*
+ * We might have to manage several visited lists during a search.
+ * This is expecially needed for the tags option. If tags is set to:
+ * "./++/tags,./++/TAGS,++/tags" (replace + with *)
+ * So we have to do 3 searches:
+ * 1) search from the current files directory downward for the file "tags"
+ * 2) search from the current files directory downward for the file "TAGS"
+ * 3) search from Vims current directory downwards for the file "tags"
+ * As you can see, the first and the third search are for the same file, so for
+ * the third search we can use the visited list of the first search. For the
+ * second search we must start from a empty visited list.
+ * The struct ff_visited_list_hdr is used to manage a linked list of already
+ * visited lists.
+ */
+typedef struct ff_visited_list_hdr
+{
+ struct ff_visited_list_hdr *ffvl_next;
+
+ /* the filename the attached visited list is for */
+ char_u *ffvl_filename;
+
+ ff_visited_T *ffvl_visited_list;
+
+} ff_visited_list_hdr_T;
+
+
+/*
+ * '**' can be expanded to several directory levels.
+ * Set the default maximium depth.
+ */
+#define FF_MAX_STAR_STAR_EXPAND ((char_u)30)
+/*
+ * The search context:
+ * ffsc_stack_ptr: the stack for the dirs to search
+ * ffsc_visited_list: the currently active visited list
+ * ffsc_dir_visited_list: the currently active visited list for search dirs
+ * ffsc_visited_lists_list: the list of all visited lists
+ * ffsc_dir_visited_lists_list: the list of all visited lists for search dirs
+ * ffsc_file_to_search: the file to search for
+ * ffsc_start_dir: the starting directory, if search path was relative
+ * ffsc_fix_path: the fix part of the given path (without wildcards)
+ * Needed for upward search.
+ * ffsc_wc_path: the part of the given path containing wildcards
+ * ffsc_level: how many levels of dirs to search downwards
+ * ffsc_stopdirs_v: array of stop directories for upward search
+ * ffsc_need_dir: TRUE if we search for a directory
+ */
+typedef struct ff_search_ctx_T
+{
+ ff_stack_T *ffsc_stack_ptr;
+ ff_visited_list_hdr_T *ffsc_visited_list;
+ ff_visited_list_hdr_T *ffsc_dir_visited_list;
+ ff_visited_list_hdr_T *ffsc_visited_lists_list;
+ ff_visited_list_hdr_T *ffsc_dir_visited_lists_list;
+ char_u *ffsc_file_to_search;
+ char_u *ffsc_start_dir;
+ char_u *ffsc_fix_path;
+#ifdef FEAT_PATH_EXTRA
+ char_u *ffsc_wc_path;
+ int ffsc_level;
+ char_u **ffsc_stopdirs_v;
+#endif
+ int ffsc_need_dir;
+}ff_search_ctx_T;
+static ff_search_ctx_T *ff_search_ctx = NULL;
+
+/* used for expanding filenames */
+static char_u *ff_expand_buffer = NULL;
+
+/* locally needed functions */
+#ifdef FEAT_PATH_EXTRA
+static int ff_check_visited __ARGS((ff_visited_T **, char_u *, char_u *));
+#else
+static int ff_check_visited __ARGS((ff_visited_T **, char_u *));
+#endif
+static void vim_findfile_free_visited_list __ARGS((ff_visited_list_hdr_T **list_headp));
+static void ff_free_visited_list __ARGS((ff_visited_T *vl));
+static ff_visited_list_hdr_T* ff_get_visited_list __ARGS((char_u *, ff_visited_list_hdr_T **list_headp));
+#ifdef FEAT_PATH_EXTRA
+static int ff_wc_equal __ARGS((char_u *s1, char_u *s2));
+#endif
+
+static void ff_push __ARGS((ff_stack_T *));
+static ff_stack_T * ff_pop __ARGS((void));
+static void ff_clear __ARGS((void));
+static void ff_free_stack_element __ARGS((ff_stack_T *));
+#ifdef FEAT_PATH_EXTRA
+static ff_stack_T *ff_create_stack_element __ARGS((char_u *, char_u *, int, int));
+#else
+static ff_stack_T *ff_create_stack_element __ARGS((char_u *, int, int));
+#endif
+#ifdef FEAT_PATH_EXTRA
+static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **));
+#endif
+
+#ifdef FEAT_SEARCHPATH
+static char_u *find_file_in_path_option __ARGS((char_u *ptr, int len, int options, int first, char_u *path_option, int need_dir, char_u *rel_fname));
+#endif
+
+#if 0
+/*
+ * if someone likes findfirst/findnext, here are the functions
+ * NOT TESTED!!
+ */
+
+static void *ff_fn_search_context = NULL;
+
+ char_u *
+vim_findfirst(path, filename, level)
+ char_u *path;
+ char_u *filename;
+ int level;
+{
+ ff_fn_search_context =
+ vim_findfile_init(path, filename, NULL, level, TRUE, FALSE,
+ ff_fn_search_context, rel_fname);
+ if (NULL == ff_fn_search_context)
+ return NULL;
+ else
+ return vim_findnext()
+}
+
+ char_u *
+vim_findnext()
+{
+ char_u *ret = vim_findfile(ff_fn_search_context);
+
+ if (NULL == ret)
+ {
+ vim_findfile_cleanup(ff_fn_search_context);
+ ff_fn_search_context = NULL;
+ }
+ return ret;
+}
+#endif
+
+/*
+ * Initialization routine for vim_findfile.
+ *
+ * Returns the newly allocated search context or NULL if an error occured.
+ *
+ * Don't forget to clean up by calling vim_findfile_cleanup() if you are done
+ * with the search context.
+ *
+ * Find the file 'filename' in the directory 'path'.
+ * The parameter 'path' may contain wildcards. If so only search 'level'
+ * directories deep. The parameter 'level' is the absolute maximum and is
+ * not related to restricts given to the '**' wildcard. If 'level' is 100
+ * and you use '**200' vim_findfile() will stop after 100 levels.
+ *
+ * If 'stopdirs' is not NULL and nothing is found downward, the search is
+ * restarted on the next higher directory level. This is repeated until the
+ * start-directory of a search is contained in 'stopdirs'. 'stopdirs' has the
+ * format ";*<dirname>*\(;<dirname>\)*;\=$".
+ *
+ * If the 'path' is relative, the starting dir for the search is either VIM's
+ * current dir or if the path starts with "./" the current files dir.
+ * If the 'path' is absolut, the starting dir is that part of the path before
+ * the first wildcard.
+ *
+ * Upward search is only done on the starting dir.
+ *
+ * If 'free_visited' is TRUE the list of already visited files/directories is
+ * cleared. Set this to FALSE if you just want to search from another
+ * directory, but want to be sure that no directory from a previous search is
+ * searched again. This is useful if you search for a file at different places.
+ * The list of visited files/dirs can also be cleared with the function
+ * vim_findfile_free_visited().
+ *
+ * Set the parameter 'need_dir' to TRUE if you want to search for a directory
+ * instead of a file.
+ *
+ * A search context returned by a previous call to vim_findfile_init() can be
+ * passed in the parameter 'search_ctx'. This context is than reused and
+ * reinitialized with the new parameters. The list of already viseted
+ * directories from this context is only deleted if the parameter
+ * 'free_visited' is true. Be aware that the passed search_context is freed if
+ * the reinitialization fails.
+ *
+ * If you don't have a search context from a previous call 'search_ctx' must be
+ * NULL.
+ *
+ * This function silently ignores a few errors, vim_findfile() will have
+ * limited functionality then.
+ */
+/*ARGSUSED*/
+ void *
+vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
+ search_ctx, tagfile, rel_fname)
+ char_u *path;
+ char_u *filename;
+ char_u *stopdirs;
+ int level;
+ int free_visited;
+ int need_dir;
+ void *search_ctx;
+ int tagfile;
+ char_u *rel_fname; /* file name to use for "." */
+{
+#ifdef FEAT_PATH_EXTRA
+ char_u *wc_part;
+#endif
+ ff_stack_T *sptr;
+
+ /* If a search context is given by the caller, reuse it, else allocate a
+ * new one.
+ */
+ if (search_ctx != NULL)
+ ff_search_ctx = search_ctx;
+ else
+ {
+ ff_search_ctx = (ff_search_ctx_T*)alloc(
+ (unsigned)sizeof(ff_search_ctx_T));
+ if (ff_search_ctx == NULL)
+ goto error_return;
+ memset(ff_search_ctx, 0, sizeof(ff_search_ctx_T));
+ }
+
+ /* clear the search context, but NOT the visited lists */
+ ff_clear();
+
+ /* clear visited list if wanted */
+ if (free_visited == TRUE)
+ vim_findfile_free_visited(ff_search_ctx);
+ else
+ {
+ /* Reuse old visited lists. Get the visited list for the given
+ * filename. If no list for the current filename exists, creates a new
+ * one.
+ */
+ ff_search_ctx->ffsc_visited_list = ff_get_visited_list(filename,
+ &ff_search_ctx->ffsc_visited_lists_list);
+ if (ff_search_ctx->ffsc_visited_list == NULL)
+ goto error_return;
+ ff_search_ctx->ffsc_dir_visited_list = ff_get_visited_list(filename,
+ &ff_search_ctx->ffsc_dir_visited_lists_list);
+ if (ff_search_ctx->ffsc_dir_visited_list == NULL)
+ goto error_return;
+ }
+
+ if (ff_expand_buffer == NULL)
+ {
+ ff_expand_buffer = (char_u*)alloc(MAXPATHL);
+ if (ff_expand_buffer == NULL)
+ goto error_return;
+ }
+
+ /* Store information on starting dir now if path is relative.
+ * If path is absolute, we do that later.
+ */
+ if (path[0] == '.'
+ && (vim_ispathsep(path[1]) || path[1] == NUL)
+ && (!tagfile || vim_strchr(p_cpo, CPO_DOTTAG) == NULL)
+ && rel_fname != NULL)
+ {
+ int len = (int)(gettail(rel_fname) - rel_fname);
+
+ if (!vim_isAbsName(rel_fname) && len + 1 < MAXPATHL)
+ {
+ /* Make the start dir an absolute path name. */
+ STRNCPY(ff_expand_buffer, rel_fname, len);
+ ff_expand_buffer[len] = NUL;
+ ff_search_ctx->ffsc_start_dir = FullName_save(ff_expand_buffer,
+ FALSE);
+ }
+ else
+ ff_search_ctx->ffsc_start_dir = vim_strnsave(rel_fname, len);
+ if (ff_search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+ if (*++path != NUL)
+ ++path;
+ }
+ else if (*path == NUL || !vim_isAbsName(path))
+ {
+#ifdef BACKSLASH_IN_FILENAME
+ /* "c:dir" needs "c:" to be expanded, otherwise use current dir */
+ if (*path != NUL && path[1] == ':')
+ {
+ char_u drive[3];
+
+ drive[0] = path[0];
+ drive[1] = ':';
+ drive[2] = NUL;
+ if (vim_FullName(drive, ff_expand_buffer, MAXPATHL, TRUE) == FAIL)
+ goto error_return;
+ path += 2;
+ }
+ else
+#endif
+ if (mch_dirname(ff_expand_buffer, MAXPATHL) == FAIL)
+ goto error_return;
+
+ ff_search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer);
+ if (ff_search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+
+#ifdef BACKSLASH_IN_FILENAME
+ /* A path that starts with "/dir" is relative to the drive, not to the
+ * directory (but not for "//machine/dir"). Only use the drive name. */
+ if ((*path == '/' || *path == '\\')
+ && path[1] != path[0]
+ && ff_search_ctx->ffsc_start_dir[1] == ':')
+ ff_search_ctx->ffsc_start_dir[2] = NUL;
+#endif
+ }
+
+#ifdef FEAT_PATH_EXTRA
+ /*
+ * If stopdirs are given, split them into an array of pointers.
+ * If this fails (mem allocation), there is no upward search at all or a
+ * stop directory is not recognized -> continue silently.
+ * If stopdirs just contains a ";" or is empty,
+ * ff_search_ctx->ffsc_stopdirs_v will only contain a NULL pointer. This
+ * is handled as unlimited upward search. See function
+ * ff_path_in_stoplist() for details.
+ */
+ if (stopdirs != NULL)
+ {
+ char_u *walker = stopdirs;
+ int dircount;
+
+ while (*walker == ';')
+ walker++;
+
+ dircount = 1;
+ ff_search_ctx->ffsc_stopdirs_v =
+ (char_u **)alloc((unsigned)sizeof(char_u *));
+
+ if (ff_search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ do
+ {
+ char_u *helper;
+ void *ptr;
+
+ helper = walker;
+ ptr = vim_realloc(ff_search_ctx->ffsc_stopdirs_v,
+ (dircount + 1) * sizeof(char_u *));
+ if (ptr)
+ ff_search_ctx->ffsc_stopdirs_v = ptr;
+ else
+ /* ignore, keep what we have and continue */
+ break;
+ walker = vim_strchr(walker, ';');
+ if (walker)
+ {
+ ff_search_ctx->ffsc_stopdirs_v[dircount-1] =
+ vim_strnsave(helper, (int)(walker - helper));
+ walker++;
+ }
+ else
+ /* this might be "", which means ascent till top
+ * of directory tree.
+ */
+ ff_search_ctx->ffsc_stopdirs_v[dircount-1] =
+ vim_strsave(helper);
+
+ dircount++;
+
+ } while (walker != NULL);
+ ff_search_ctx->ffsc_stopdirs_v[dircount-1] = NULL;
+ }
+ }
+#endif
+
+#ifdef FEAT_PATH_EXTRA
+ ff_search_ctx->ffsc_level = level;
+
+ /* split into:
+ * -fix path
+ * -wildcard_stuff (might be NULL)
+ */
+ wc_part = vim_strchr(path, '*');
+ if (wc_part != NULL)
+ {
+ int llevel;
+ int len;
+ char_u *errpt;
+
+ /* save the fix part of the path */
+ ff_search_ctx->ffsc_fix_path = vim_strnsave(path,
+ (int)(wc_part - path));
+
+ /*
+ * copy wc_path and add restricts to the '**' wildcard.
+ * The octett after a '**' is used as a (binary) counter.
+ * So '**3' is transposed to '**^C' ('^C' is ASCII value 3)
+ * or '**76' is transposed to '**N'( 'N' is ASCII value 76).
+ * For EBCDIC you get different character values.
+ * If no restrict is given after '**' the default is used.
+ * Due to this technic the path looks awful if you print it as a
+ * string.
+ */
+ len = 0;
+ while (*wc_part != NUL)
+ {
+ if (STRNCMP(wc_part, "**", 2) == 0)
+ {
+ ff_expand_buffer[len++] = *wc_part++;
+ ff_expand_buffer[len++] = *wc_part++;
+
+ llevel = strtol((char *)wc_part, (char **)&errpt, 10);
+ if (errpt != wc_part && llevel > 0 && llevel < 255)
+ ff_expand_buffer[len++] = llevel;
+ else if (errpt != wc_part && llevel == 0)
+ /* restrict is 0 -> remove already added '**' */
+ len -= 2;
+ else
+ ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
+ wc_part = errpt;
+ if (*wc_part != PATHSEP && *wc_part != NUL)
+ {
+ EMSG2(_("E343: Invalid path: '**[number]' must be at the end of the path or be followed by '%s'."), PATHSEPSTR);
+ goto error_return;
+ }
+ }
+ else
+ ff_expand_buffer[len++] = *wc_part++;
+ }
+ ff_expand_buffer[len] = NUL;
+ ff_search_ctx->ffsc_wc_path =
+ vim_strsave(ff_expand_buffer);
+
+ if (ff_search_ctx->ffsc_wc_path == NULL)
+ goto error_return;
+ }
+ else
+#endif
+ ff_search_ctx->ffsc_fix_path = vim_strsave(path);
+
+ if (ff_search_ctx->ffsc_start_dir == NULL)
+ {
+ /* store the fix part as startdir.
+ * This is needed if the parameter path is fully qualified.
+ */
+ ff_search_ctx->ffsc_start_dir = vim_strsave(ff_search_ctx->ffsc_fix_path);
+ if (ff_search_ctx->ffsc_start_dir)
+ ff_search_ctx->ffsc_fix_path[0] = NUL;
+ }
+
+ /* create an absolute path */
+ STRCPY(ff_expand_buffer, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(ff_expand_buffer);
+ STRCAT(ff_expand_buffer, ff_search_ctx->ffsc_fix_path);
+ add_pathsep(ff_expand_buffer);
+
+ sptr = ff_create_stack_element(ff_expand_buffer,
+#ifdef FEAT_PATH_EXTRA
+ ff_search_ctx->ffsc_wc_path,
+#endif
+ level, 0);
+
+ if (sptr == NULL)
+ goto error_return;
+
+ ff_push(sptr);
+
+ ff_search_ctx->ffsc_file_to_search = vim_strsave(filename);
+ if (ff_search_ctx->ffsc_file_to_search == NULL)
+ goto error_return;
+
+ return ff_search_ctx;
+
+error_return:
+ /*
+ * We clear the search context now!
+ * Even when the caller gave us a (perhaps valid) context we free it here,
+ * as we might have already destroyed it.
+ */
+ vim_findfile_cleanup(ff_search_ctx);
+ return NULL;
+}
+
+#if defined(FEAT_PATH_EXTRA) || defined(PROTO)
+/*
+ * Get the stopdir string. Check that ';' is not escaped.
+ */
+ char_u *
+vim_findfile_stopdir(buf)
+ char_u *buf;
+{
+ char_u *r_ptr = buf;
+
+ while (*r_ptr != NUL && *r_ptr != ';')
+ {
+ if (r_ptr[0] == '\\' && r_ptr[1] == ';')
+ {
+ /* overwrite the escape char,
+ * use STRLEN(r_ptr) to move the trailing '\0'
+ */
+ mch_memmove(r_ptr, r_ptr + 1, STRLEN(r_ptr));
+ r_ptr++;
+ }
+ r_ptr++;
+ }
+ if (*r_ptr == ';')
+ {
+ *r_ptr = 0;
+ r_ptr++;
+ }
+ else if (*r_ptr == NUL)
+ r_ptr = NULL;
+ return r_ptr;
+}
+#endif
+
+/* Clean up the given search context. Can handle a NULL pointer */
+ void
+vim_findfile_cleanup(ctx)
+ void *ctx;
+{
+ if (NULL == ctx)
+ return;
+
+ ff_search_ctx = ctx;
+
+ vim_findfile_free_visited(ctx);
+ ff_clear();
+ vim_free(ctx);
+ ff_search_ctx = NULL;
+}
+
+/*
+ * Find a file in a search context.
+ * The search context was created with vim_findfile_init() above.
+ * Return a pointer to an allocated file name or NULL if nothing found.
+ * To get all matching files call this function until you get NULL.
+ *
+ * If the passed search_context is NULL, it the returns NULL.
+ *
+ * The search algorithm is depth first. To change this replace the
+ * stack with a list (don't forget to leave partly searched directories on the
+ * top of the list).
+ */
+ char_u *
+vim_findfile(search_ctx)
+ void *search_ctx;
+{
+ char_u *file_path;
+#ifdef FEAT_PATH_EXTRA
+ char_u *rest_of_wildcards;
+ char_u *path_end = NULL;
+#endif
+ ff_stack_T *ctx;
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_PATH_EXTRA)
+ int len;
+#endif
+ int i;
+ char_u *p;
+#ifdef FEAT_SEARCHPATH
+ char_u *suf;
+#endif
+
+ if (search_ctx == NULL)
+ return NULL;
+
+ ff_search_ctx = (ff_search_ctx_T*)search_ctx;
+
+ /*
+ * filepath is used as buffer for various actions and as the storage to
+ * return a found filename.
+ */
+ if ((file_path = alloc((int)MAXPATHL)) == NULL)
+ return NULL;
+
+#ifdef FEAT_PATH_EXTRA
+ /* store the end of the start dir -- needed for upward search */
+ if (ff_search_ctx->ffsc_start_dir != NULL)
+ path_end = &ff_search_ctx->ffsc_start_dir[STRLEN(ff_search_ctx->ffsc_start_dir)];
+#endif
+
+#ifdef FEAT_PATH_EXTRA
+ /* upward search loop */
+ for (;;)
+ {
+#endif
+ /* downward search loop */
+ for (;;)
+ {
+ /* check if user user wants to stop the search*/
+ ui_breakcheck();
+ if (got_int)
+ break;
+
+ /* get directory to work on from stack */
+ ctx = ff_pop();
+ if (ctx == NULL)
+ break;
+
+ /*
+ * TODO: decide if we leave this test in
+ *
+ * GOOD: don't search a directory(-tree) twice.
+ * BAD: - check linked list for every new directory entered.
+ * - check for double files also done below
+ *
+ * Here we check if we already searched this directory.
+ * We already searched a directory if:
+ * 1) The directory is the same.
+ * 2) We would use the same wildcard string.
+ *
+ * Good if you have links on same directory via several ways
+ * or you have selfreferences in directories (e.g. SuSE Linux 6.3:
+ * /etc/rc.d/init.d is linked to /etc/rc.d -> endless loop)
+ *
+ * This check is only needed for directories we work on for the
+ * first time (hence ctx->ff_filearray == NULL)
+ */
+ if (ctx->ffs_filearray == NULL
+ && ff_check_visited(&ff_search_ctx->ffsc_dir_visited_list
+ ->ffvl_visited_list,
+ ctx->ffs_fix_path
+#ifdef FEAT_PATH_EXTRA
+ , ctx->ffs_wc_path
+#endif
+ ) == FAIL)
+ {
+#ifdef FF_VERBOSE
+ if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ smsg((char_u *)"Already Searched: %s (%s)",
+ ctx->ffs_fix_path, ctx->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+#endif
+ ff_free_stack_element(ctx);
+ continue;
+ }
+#ifdef FF_VERBOSE
+ else if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ smsg((char_u *)"Searching: %s (%s)", ctx->ffs_fix_path,
+ ctx->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+#endif
+
+ /* check depth */
+ if (ctx->ffs_level <= 0)
+ {
+ ff_free_stack_element(ctx);
+ continue;
+ }
+
+ file_path[0] = NUL;
+
+ /*
+ * If no filearray till now expand wildcards
+ * The function expand_wildcards() can handle an array of paths
+ * and all possible expands are returned in one array. We use this
+ * to handle the expansion of '**' into an empty string.
+ */
+ if (ctx->ffs_filearray == NULL)
+ {
+ char_u *dirptrs[2];
+
+ /* we use filepath to build the path expand_wildcards() should
+ * expand.
+ */
+ dirptrs[0] = file_path;
+ dirptrs[1] = NULL;
+
+ /* if we have a start dir copy it in */
+ if (!vim_isAbsName(ctx->ffs_fix_path)
+ && ff_search_ctx->ffsc_start_dir)
+ {
+ STRCPY(file_path, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+ }
+
+ /* append the fix part of the search path */
+ STRCAT(file_path, ctx->ffs_fix_path);
+ add_pathsep(file_path);
+
+#ifdef FEAT_PATH_EXTRA
+ rest_of_wildcards = ctx->ffs_wc_path;
+ if (*rest_of_wildcards != NUL)
+ {
+ len = (int)STRLEN(file_path);
+ if (STRNCMP(rest_of_wildcards, "**", 2) == 0)
+ {
+ /* pointer to the restrict byte
+ * The restrict byte is not a character!
+ */
+ p = rest_of_wildcards + 2;
+
+ if (*p > 0)
+ {
+ (*p)--;
+ file_path[len++] = '*';
+ }
+
+ if (*p == 0)
+ {
+ /* remove '**<numb> from wildcards */
+ mch_memmove(rest_of_wildcards,
+ rest_of_wildcards + 3,
+ STRLEN(rest_of_wildcards + 3) + 1);
+ }
+ else
+ rest_of_wildcards += 3;
+
+ if (ctx->ffs_star_star_empty == 0)
+ {
+ /* if not done before, expand '**' to empty */
+ ctx->ffs_star_star_empty = 1;
+ dirptrs[1] = ctx->ffs_fix_path;
+ }
+ }
+
+ /*
+ * Here we copy until the next path separator or the end of
+ * the path. If we stop at a path separator, there is
+ * still somthing else left. This is handled below by
+ * pushing every directory returned from expand_wildcards()
+ * on the stack again for further search.
+ */
+ while (*rest_of_wildcards
+ && !vim_ispathsep(*rest_of_wildcards))
+ file_path[len++] = *rest_of_wildcards++;
+
+ file_path[len] = NUL;
+ if (vim_ispathsep(*rest_of_wildcards))
+ rest_of_wildcards++;
+ }
+#endif
+
+ /*
+ * Expand wildcards like "*" and "$VAR".
+ * If the path is a URL don't try this.
+ */
+ if (path_with_url(dirptrs[0]))
+ {
+ ctx->ffs_filearray = (char_u **)
+ alloc((unsigned)sizeof(char *));
+ if (ctx->ffs_filearray != NULL
+ && (ctx->ffs_filearray[0]
+ = vim_strsave(dirptrs[0])) != NULL)
+ ctx->ffs_filearray_size = 1;
+ else
+ ctx->ffs_filearray_size = 0;
+ }
+ else
+ expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
+ &ctx->ffs_filearray_size,
+ &ctx->ffs_filearray,
+ EW_DIR|EW_ADDSLASH|EW_SILENT);
+
+ ctx->ffs_filearray_cur = 0;
+ ctx->ffs_stage = 0;
+ }
+#ifdef FEAT_PATH_EXTRA
+ else
+ rest_of_wildcards = &ctx->ffs_wc_path[STRLEN(ctx->ffs_wc_path)];
+#endif
+
+ if (ctx->ffs_stage == 0)
+ {
+ /* this is the first time we work on this directory */
+#ifdef FEAT_PATH_EXTRA
+ if (*rest_of_wildcards == NUL)
+#endif
+ {
+ /*
+ * we don't have further wildcards to expand, so we have to
+ * check for the final file now
+ */
+ for (i = ctx->ffs_filearray_cur;
+ i < ctx->ffs_filearray_size; ++i)
+ {
+ if (!path_with_url(ctx->ffs_filearray[i])
+ && !mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+
+ /* prepare the filename to be checked for existance
+ * below */
+ STRCPY(file_path, ctx->ffs_filearray[i]);
+ add_pathsep(file_path);
+ STRCAT(file_path, ff_search_ctx->ffsc_file_to_search);
+
+ /*
+ * Try without extra suffix and then with suffixes
+ * from 'suffixesadd'.
+ */
+#ifdef FEAT_SEARCHPATH
+ len = (int)STRLEN(file_path);
+ suf = curbuf->b_p_sua;
+ for (;;)
+#endif
+ {
+ /* if file exists and we didn't already find it */
+ if ((path_with_url(file_path)
+ || (mch_getperm(file_path) >= 0
+ && (!ff_search_ctx->ffsc_need_dir
+ || mch_isdir(file_path))))
+#ifndef FF_VERBOSE
+ && (ff_check_visited(
+ &ff_search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+#ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+#endif
+ ) == OK)
+#endif
+ )
+ {
+#ifdef FF_VERBOSE
+ if (ff_check_visited(
+ &ff_search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+#ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+#endif
+ ) == FAIL)
+ {
+ if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ msg_str((char_u *)"Already: %s",
+ file_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+ continue;
+ }
+#endif
+
+ /* push dir to examine rest of subdirs later */
+ ctx->ffs_filearray_cur = i + 1;
+ ff_push(ctx);
+
+ simplify_filename(file_path);
+ if (mch_dirname(ff_expand_buffer, MAXPATHL)
+ == OK)
+ {
+ p = shorten_fname(file_path,
+ ff_expand_buffer);
+ if (p != NULL)
+ mch_memmove(file_path, p,
+ STRLEN(p) + 1);
+ }
+#ifdef FF_VERBOSE
+ if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ msg_str((char_u *)"HIT: %s", file_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+#endif
+ return file_path;
+ }
+
+#ifdef FEAT_SEARCHPATH
+ /* Not found or found already, try next suffix. */
+ if (*suf == NUL)
+ break;
+ copy_option_part(&suf, file_path + len,
+ MAXPATHL - len, ",");
+#endif
+ }
+ }
+ }
+#ifdef FEAT_PATH_EXTRA
+ else
+ {
+ /*
+ * still wildcards left, push the directories for further
+ * search
+ */
+ for (i = ctx->ffs_filearray_cur; i < ctx->ffs_filearray_size;
+ ++i)
+ {
+ if (!mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+
+ ff_push(ff_create_stack_element(ctx->ffs_filearray[i],
+ rest_of_wildcards, ctx->ffs_level - 1, 0));
+ }
+ }
+#endif
+ ctx->ffs_filearray_cur = 0;
+ ctx->ffs_stage = 1;
+ }
+
+#ifdef FEAT_PATH_EXTRA
+ /*
+ * if wildcards contains '**' we have to descent till we reach the
+ * leaves of the directory tree.
+ */
+ if (STRNCMP(ctx->ffs_wc_path, "**", 2) == 0)
+ {
+ for (i = ctx->ffs_filearray_cur; i < ctx->ffs_filearray_size; ++i)
+ {
+ if (fnamecmp(ctx->ffs_filearray[i], ctx->ffs_fix_path) == 0)
+ continue; /* don't repush same directory */
+ if (!mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+ ff_push(ff_create_stack_element(ctx->ffs_filearray[i],
+ ctx->ffs_wc_path, ctx->ffs_level - 1, 1));
+ }
+ }
+#endif
+
+ /* we are done with the current directory */
+ ff_free_stack_element(ctx);
+
+ }
+
+#ifdef FEAT_PATH_EXTRA
+ /* If we reached this, we didn't find anything downwards.
+ * Let's check if we should do an upward search.
+ */
+ if (ff_search_ctx->ffsc_start_dir
+ && ff_search_ctx->ffsc_stopdirs_v != NULL && !got_int)
+ {
+ ff_stack_T *sptr;
+
+ /* is the last starting directory in the stop list? */
+ if (ff_path_in_stoplist(ff_search_ctx->ffsc_start_dir,
+ (int)(path_end - ff_search_ctx->ffsc_start_dir),
+ ff_search_ctx->ffsc_stopdirs_v) == TRUE)
+ break;
+
+ /* cut of last dir */
+ while (path_end > ff_search_ctx->ffsc_start_dir
+ && *path_end == PATHSEP)
+ path_end--;
+ while (path_end > ff_search_ctx->ffsc_start_dir
+ && *(path_end-1) != PATHSEP)
+ path_end--;
+ *path_end = 0;
+ path_end--;
+
+ if (*ff_search_ctx->ffsc_start_dir == 0)
+ break;
+
+ STRCPY(file_path, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+ STRCAT(file_path, ff_search_ctx->ffsc_fix_path);
+
+ /* create a new stack entry */
+ sptr = ff_create_stack_element(file_path,
+ ff_search_ctx->ffsc_wc_path, ff_search_ctx->ffsc_level, 0);
+ if (sptr == NULL)
+ break;
+ ff_push(sptr);
+ }
+ else
+ break;
+ }
+#endif
+
+ vim_free(file_path);
+ return NULL;
+}
+
+/*
+ * Free the list of lists of visited files and directories
+ * Can handle it if the passed search_context is NULL;
+ */
+ void
+vim_findfile_free_visited(search_ctx)
+ void *search_ctx;
+{
+ if (search_ctx == NULL)
+ return;
+
+ ff_search_ctx = (ff_search_ctx_T *)search_ctx;
+
+ vim_findfile_free_visited_list(&ff_search_ctx->ffsc_visited_lists_list);
+ vim_findfile_free_visited_list(&ff_search_ctx->ffsc_dir_visited_lists_list);
+}
+
+ static void
+vim_findfile_free_visited_list(list_headp)
+ ff_visited_list_hdr_T **list_headp;
+{
+ ff_visited_list_hdr_T *vp;
+
+ while (*list_headp != NULL)
+ {
+ vp = (*list_headp)->ffvl_next;
+ ff_free_visited_list((*list_headp)->ffvl_visited_list);
+
+ vim_free((*list_headp)->ffvl_filename);
+ vim_free(*list_headp);
+ *list_headp = vp;
+ }
+ *list_headp = NULL;
+}
+
+ static void
+ff_free_visited_list(vl)
+ ff_visited_T *vl;
+{
+ ff_visited_T *vp;
+
+ while (vl != NULL)
+ {
+ vp = vl->ffv_next;
+#ifdef FEAT_PATH_EXTRA
+ vim_free(vl->ffv_wc_path);
+#endif
+ vim_free(vl);
+ vl = vp;
+ }
+ vl = NULL;
+}
+
+/*
+ * Returns the already visited list for the given filename. If none is found it
+ * allocates a new one.
+ */
+ static ff_visited_list_hdr_T*
+ff_get_visited_list(filename, list_headp)
+ char_u *filename;
+ ff_visited_list_hdr_T **list_headp;
+{
+ ff_visited_list_hdr_T *retptr = NULL;
+
+ /* check if a visited list for the given filename exists */
+ if (*list_headp != NULL)
+ {
+ retptr = *list_headp;
+ while (retptr != NULL)
+ {
+ if (fnamecmp(filename, retptr->ffvl_filename) == 0)
+ {
+#ifdef FF_VERBOSE
+ if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ msg_str((char_u *)"ff_get_visited_list: FOUND list for %s",
+ filename);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+#endif
+ return retptr;
+ }
+ retptr = retptr->ffvl_next;
+ }
+ }
+
+#ifdef FF_VERBOSE
+ if (p_verbose >= 5)
+ {
+ /* always scroll up, don't overwrite */
+ msg_scroll = TRUE;
+ msg_str((char_u *)"ff_get_visited_list: new list for %s", filename);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ cmdline_row = msg_row;
+ }
+#endif
+
+ /*
+ * if we reach this we didn't find a list and we have to allocate new list
+ */
+ retptr = (ff_visited_list_hdr_T*)alloc((unsigned)sizeof(*retptr));
+ if (retptr == NULL)
+ return NULL;
+
+ retptr->ffvl_visited_list = NULL;
+ retptr->ffvl_filename = vim_strsave(filename);
+ if (retptr->ffvl_filename == NULL)
+ {
+ vim_free(retptr);
+ return NULL;
+ }
+ retptr->ffvl_next = *list_headp;
+ *list_headp = retptr;
+
+ return retptr;
+}
+
+#ifdef FEAT_PATH_EXTRA
+/*
+ * check if two wildcard paths are equal. Returns TRUE or FALSE.
+ * They are equal if:
+ * - both paths are NULL
+ * - they have the same length
+ * - char by char comparison is OK
+ * - the only differences are in the counters behind a '**', so
+ * '**\20' is equal to '**\24'
+ */
+ static int
+ff_wc_equal(s1, s2)
+ char_u *s1;
+ char_u *s2;
+{
+ int i;
+
+ if (s1 == s2)
+ return TRUE;
+
+ if (s1 == NULL || s2 == NULL)
+ return FALSE;
+
+ if (STRLEN(s1) != STRLEN(s2))
+ return FAIL;
+
+ for (i = 0; s1[i] != NUL && s2[i] != NUL; i++)
+ {
+ if (s1[i] != s2[i]
+#ifdef CASE_INSENSITIVE_FILENAME
+ && TOUPPER_LOC(s1[i]) != TOUPPER_LOC(s2[i])
+#endif
+ )
+ {
+ if (i >= 2)
+ if (s1[i-1] == '*' && s1[i-2] == '*')
+ continue;
+ else
+ return FAIL;
+ else
+ return FAIL;
+ }
+ }
+ return TRUE;
+}
+#endif
+
+/*
+ * maintains the list of already visited files and dirs
+ * returns FAIL if the given file/dir is already in the list
+ * returns OK if it is newly added
+ *
+ * TODO: What to do on memory allocation problems?
+ * -> return TRUE - Better the file is found several times instead of
+ * never.
+ */
+ static int
+ff_check_visited(visited_list, fname
+#ifdef FEAT_PATH_EXTRA
+ , wc_path
+#endif
+ )
+ ff_visited_T **visited_list;
+ char_u *fname;
+#ifdef FEAT_PATH_EXTRA
+ char_u *wc_path;
+#endif
+{
+ ff_visited_T *vp;
+#ifdef UNIX
+ struct stat st;
+ int url = FALSE;
+#endif
+
+ /* For an URL we only compare the name, otherwise we compare the
+ * device/inode (unix) or the full path name (not Unix). */
+ if (path_with_url(fname))
+ {
+ STRNCPY(ff_expand_buffer, fname, MAXPATHL);
+#ifdef UNIX
+ url = TRUE;
+#endif
+ }
+ else
+ {
+ ff_expand_buffer[0] = NUL;
+#ifdef UNIX
+ if (mch_stat((char *)fname, &st) < 0)
+#else
+ if (vim_FullName(fname, ff_expand_buffer, MAXPATHL, TRUE) == FAIL)
+#endif
+ return FAIL;
+ }
+
+ /* check against list of already visited files */
+ for (vp = *visited_list; vp != NULL; vp = vp->ffv_next)
+ {
+ if (
+#ifdef UNIX
+ !url
+ ? (vp->ffv_dev == st.st_dev
+ && vp->ffv_ino == st.st_ino)
+ :
+#endif
+ fnamecmp(vp->ffv_fname, ff_expand_buffer) == 0
+ )
+ {
+#ifdef FEAT_PATH_EXTRA
+ /* are the wildcard parts equal */
+ if (ff_wc_equal(vp->ffv_wc_path, wc_path) == TRUE)
+#endif
+ /* already visited */
+ return FAIL;
+ }
+ }
+
+ /*
+ * New file/dir. Add it to the list of visited files/dirs.
+ */
+ vp = (ff_visited_T *)alloc((unsigned)(sizeof(ff_visited_T)
+ + STRLEN(ff_expand_buffer)));
+
+ if (vp != NULL)
+ {
+#ifdef UNIX
+ if (!url)
+ {
+ vp->ffv_ino = st.st_ino;
+ vp->ffv_dev = st.st_dev;
+ vp->ffv_fname[0] = NUL;
+ }
+ else
+ {
+ vp->ffv_ino = 0;
+ vp->ffv_dev = -1;
+#endif
+ STRCPY(vp->ffv_fname, ff_expand_buffer);
+#ifdef UNIX
+ }
+#endif
+#ifdef FEAT_PATH_EXTRA
+ if (wc_path != NULL)
+ vp->ffv_wc_path = vim_strsave(wc_path);
+ else
+ vp->ffv_wc_path = NULL;
+#endif
+
+ vp->ffv_next = *visited_list;
+ *visited_list = vp;
+ }
+
+ return OK;
+}
+
+/*
+ * create stack element from given path pieces
+ */
+ static ff_stack_T *
+ff_create_stack_element(fix_part,
+#ifdef FEAT_PATH_EXTRA
+ wc_part,
+#endif
+ level, star_star_empty)
+ char_u *fix_part;
+#ifdef FEAT_PATH_EXTRA
+ char_u *wc_part;
+#endif
+ int level;
+ int star_star_empty;
+{
+ ff_stack_T *new;
+
+ new = (ff_stack_T *)alloc((unsigned)sizeof(ff_stack_T));
+ if (new == NULL)
+ return NULL;
+
+ new->ffs_prev = NULL;
+ new->ffs_filearray = NULL;
+ new->ffs_filearray_size = 0;
+ new->ffs_filearray_cur = 0;
+ new->ffs_stage = 0;
+ new->ffs_level = level;
+ new->ffs_star_star_empty = star_star_empty;;
+
+ /* the following saves NULL pointer checks in vim_findfile */
+ if (fix_part == NULL)
+ fix_part = (char_u *)"";
+ new->ffs_fix_path = vim_strsave(fix_part);
+
+#ifdef FEAT_PATH_EXTRA
+ if (wc_part == NULL)
+ wc_part = (char_u *)"";
+ new->ffs_wc_path = vim_strsave(wc_part);
+#endif
+
+ if (new->ffs_fix_path == NULL
+#ifdef FEAT_PATH_EXTRA
+ || new->ffs_wc_path == NULL
+#endif
+ )
+ {
+ ff_free_stack_element(new);
+ new = NULL;
+ }
+
+ return new;
+}
+
+/*
+ * push a dir on the directory stack
+ */
+ static void
+ff_push(ctx)
+ ff_stack_T *ctx;
+{
+ /* check for NULL pointer, not to return an error to the user, but
+ * to prevent a crash
+ */
+ if (ctx != NULL)
+ {
+ ctx->ffs_prev = ff_search_ctx->ffsc_stack_ptr;
+ ff_search_ctx->ffsc_stack_ptr = ctx;
+ }
+}
+
+/*
+ * pop a dir from the directory stack
+ * returns NULL if stack is empty
+ */
+ static ff_stack_T *
+ff_pop()
+{
+ ff_stack_T *sptr;
+
+ sptr = ff_search_ctx->ffsc_stack_ptr;
+ if (ff_search_ctx->ffsc_stack_ptr != NULL)
+ ff_search_ctx->ffsc_stack_ptr = ff_search_ctx->ffsc_stack_ptr->ffs_prev;
+
+ return sptr;
+}
+
+/*
+ * free the given stack element
+ */
+ static void
+ff_free_stack_element(ctx)
+ ff_stack_T *ctx;
+{
+ /* vim_free handles possible NULL pointers */
+ vim_free(ctx->ffs_fix_path);
+#ifdef FEAT_PATH_EXTRA
+ vim_free(ctx->ffs_wc_path);
+#endif
+
+ if (ctx->ffs_filearray != NULL)
+ FreeWild(ctx->ffs_filearray_size, ctx->ffs_filearray);
+
+ vim_free(ctx);
+}
+
+/*
+ * clear the search context
+ */
+ static void
+ff_clear()
+{
+ ff_stack_T *sptr;
+
+ /* clear up stack */
+ while ((sptr = ff_pop()) != NULL)
+ ff_free_stack_element(sptr);
+
+ vim_free(ff_search_ctx->ffsc_file_to_search);
+ vim_free(ff_search_ctx->ffsc_start_dir);
+ vim_free(ff_search_ctx->ffsc_fix_path);
+#ifdef FEAT_PATH_EXTRA
+ vim_free(ff_search_ctx->ffsc_wc_path);
+#endif
+
+#ifdef FEAT_PATH_EXTRA
+ if (ff_search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ int i = 0;
+
+ while (ff_search_ctx->ffsc_stopdirs_v[i] != NULL)
+ {
+ vim_free(ff_search_ctx->ffsc_stopdirs_v[i]);
+ i++;
+ }
+ vim_free(ff_search_ctx->ffsc_stopdirs_v);
+ }
+ ff_search_ctx->ffsc_stopdirs_v = NULL;
+#endif
+
+ /* reset everything */
+ ff_search_ctx->ffsc_file_to_search = NULL;
+ ff_search_ctx->ffsc_start_dir = NULL;
+ ff_search_ctx->ffsc_fix_path = NULL;
+#ifdef FEAT_PATH_EXTRA
+ ff_search_ctx->ffsc_wc_path = NULL;
+ ff_search_ctx->ffsc_level = 0;
+#endif
+}
+
+#ifdef FEAT_PATH_EXTRA
+/*
+ * check if the given path is in the stopdirs
+ * returns TRUE if yes else FALSE
+ */
+ static int
+ff_path_in_stoplist(path, path_len, stopdirs_v)
+ char_u *path;
+ int path_len;
+ char_u **stopdirs_v;
+{
+ int i = 0;
+
+ /* eat up trailing path separators, except the first */
+ while (path_len > 1 && path[path_len - 1] == PATHSEP)
+ path_len--;
+
+ /* if no path consider it as match */
+ if (path_len == 0)
+ return TRUE;
+
+ for (i = 0; stopdirs_v[i] != NULL; i++)
+ {
+ if ((int)STRLEN(stopdirs_v[i]) > path_len)
+ {
+ /* match for parent directory. So '/home' also matches
+ * '/home/rks'. Check for PATHSEP in stopdirs_v[i], else
+ * '/home/r' would also match '/home/rks'
+ */
+ if (fnamencmp(stopdirs_v[i], path, path_len) == 0
+ && stopdirs_v[i][path_len] == PATHSEP)
+ return TRUE;
+ }
+ else
+ {
+ if (fnamecmp(stopdirs_v[i], path) == 0)
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+#endif
+
+#if defined(FEAT_SEARCHPATH) || defined(PROTO)
+/*
+ * Find the file name "ptr[len]" in the path.
+ *
+ * On the first call set the parameter 'first' to TRUE to initialize
+ * the search. For repeating calls to FALSE.
+ *
+ * Repeating calls will return other files called 'ptr[len]' from the path.
+ *
+ * Only on the first call 'ptr' and 'len' are used. For repeating calls they
+ * don't need valid values.
+ *
+ * If nothing found on the first call the option FNAME_MESS will issue the
+ * message:
+ * 'Can't find file "<file>" in path'
+ * On repeating calls:
+ * 'No more file "<file>" found in path'
+ *
+ * options:
+ * FNAME_MESS give error message when not found
+ *
+ * Uses NameBuff[]!
+ *
+ * Returns an allocated string for the file name. NULL for error.
+ *
+ */
+ char_u *
+find_file_in_path(ptr, len, options, first, rel_fname)
+ char_u *ptr; /* file name */
+ int len; /* length of file name */
+ int options;
+ int first; /* use count'th matching file name */
+ char_u *rel_fname; /* file name searching relative to */
+{
+ return find_file_in_path_option(ptr, len, options, first,
+ *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path,
+ FALSE, rel_fname);
+}
+
+/*
+ * Find the directory name "ptr[len]" in the path.
+ *
+ * options:
+ * FNAME_MESS give error message when not found
+ *
+ * Uses NameBuff[]!
+ *
+ * Returns an allocated string for the file name. NULL for error.
+ */
+ char_u *
+find_directory_in_path(ptr, len, options, rel_fname)
+ char_u *ptr; /* file name */
+ int len; /* length of file name */
+ int options;
+ char_u *rel_fname; /* file name searching relative to */
+{
+ return find_file_in_path_option(ptr, len, options, TRUE, p_cdpath,
+ TRUE, rel_fname);
+}
+
+ static char_u *
+find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fname)
+ char_u *ptr; /* file name */
+ int len; /* length of file name */
+ int options;
+ int first; /* use count'th matching file name */
+ char_u *path_option; /* p_path or p_cdpath */
+ int need_dir; /* looking for directory name */
+ char_u *rel_fname; /* file name we are looking relative to. */
+{
+ static void *search_ctx = NULL;
+ static char_u *dir;
+ static char_u *file_to_find = NULL;
+ static int did_findfile_init = FALSE;
+ char_u save_char;
+ char_u *file_name = NULL;
+ char_u *buf = NULL;
+ int rel_to_curdir;
+#ifdef AMIGA
+ struct Process *proc = (struct Process *)FindTask(0L);
+ APTR save_winptr = proc->pr_WindowPtr;
+
+ /* Avoid a requester here for a volume that doesn't exist. */
+ proc->pr_WindowPtr = (APTR)-1L;
+#endif
+
+ if (first == TRUE)
+ {
+ /* copy file name into NameBuff, expanding environment variables */
+ save_char = ptr[len];
+ ptr[len] = NUL;
+ expand_env(ptr, NameBuff, MAXPATHL);
+ ptr[len] = save_char;
+
+ vim_free(file_to_find);
+ file_to_find = vim_strsave(NameBuff);
+ if (file_to_find == NULL) /* out of memory */
+ {
+ file_name = NULL;
+ goto theend;
+ }
+ }
+
+ rel_to_curdir = (file_to_find[0] == '.'
+ && (file_to_find[1] == NUL
+ || vim_ispathsep(file_to_find[1])
+ || (file_to_find[1] == '.'
+ && (file_to_find[2] == NUL
+ || vim_ispathsep(file_to_find[2])))));
+ if (vim_isAbsName(file_to_find)
+ /* "..", "../path", "." and "./path": don't use the path_option */
+ || rel_to_curdir
+#if defined(MSWIN) || defined(MSDOS) || defined(OS2)
+ /* handle "\tmp" as absolute path */
+ || vim_ispathsep(file_to_find[0])
+ /* handle "c:name" as absulute path */
+ || (file_to_find[0] != NUL && file_to_find[1] == ':')
+#endif
+#ifdef AMIGA
+ /* handle ":tmp" as absolute path */
+ || file_to_find[0] == ':'
+#endif
+ )
+ {
+ /*
+ * Absolute path, no need to use "path_option".
+ * If this is not a first call, return NULL. We already returned a
+ * filename on the first call.
+ */
+ if (first == TRUE)
+ {
+ int l;
+ int run;
+
+ if (path_with_url(file_to_find))
+ {
+ file_name = vim_strsave(file_to_find);
+ goto theend;
+ }
+
+ /* When FNAME_REL flag given first use the directory of the file.
+ * Otherwise or when this fails use the current directory. */
+ for (run = 1; run <= 2; ++run)
+ {
+ l = (int)STRLEN(file_to_find);
+ if (run == 1
+ && rel_to_curdir
+ && (options & FNAME_REL)
+ && rel_fname != NULL
+ && STRLEN(rel_fname) + l < MAXPATHL)
+ {
+ STRCPY(NameBuff, rel_fname);
+ STRCPY(gettail(NameBuff), file_to_find);
+ l = (int)STRLEN(NameBuff);
+ }
+ else
+ {
+ STRCPY(NameBuff, file_to_find);
+ run = 2;
+ }
+
+ /* When the file doesn't exist, try adding parts of
+ * 'suffixesadd'. */
+ buf = curbuf->b_p_sua;
+ for (;;)
+ {
+ if (
+#ifdef DJGPP
+ /* "C:" by itself will fail for mch_getperm(),
+ * assume it's always valid. */
+ (need_dir && NameBuff[0] != NUL
+ && NameBuff[1] == ':'
+ && NameBuff[2] == NUL) ||
+#endif
+ (mch_getperm(NameBuff) >= 0
+ && (!need_dir || mch_isdir(NameBuff))))
+ {
+ file_name = vim_strsave(NameBuff);
+ goto theend;
+ }
+ if (*buf == NUL)
+ break;
+ copy_option_part(&buf, NameBuff + l, MAXPATHL - l, ",");
+ }
+ }
+ }
+ }
+ else
+ {
+ /*
+ * Loop over all paths in the 'path' or 'cdpath' option.
+ * When "first" is set, first setup to the start of the option.
+ * Otherwise continue to find the next match.
+ */
+ if (first == TRUE)
+ {
+ /* vim_findfile_free_visited can handle a possible NULL pointer */
+ vim_findfile_free_visited(search_ctx);
+ dir = path_option;
+ did_findfile_init = FALSE;
+ }
+
+ for (;;)
+ {
+ if (did_findfile_init)
+ {
+ ff_search_ctx->ffsc_need_dir = need_dir;
+ file_name = vim_findfile(search_ctx);
+ ff_search_ctx->ffsc_need_dir = FALSE;
+ if (file_name != NULL)
+ break;
+
+ did_findfile_init = FALSE;
+ }
+ else
+ {
+ char_u *r_ptr;
+
+ if (dir == NULL || *dir == NUL)
+ {
+ /* We searched all paths of the option, now we can
+ * free the search context. */
+ vim_findfile_cleanup(search_ctx);
+ search_ctx = NULL;
+ break;
+ }
+
+ if ((buf = alloc((int)(MAXPATHL))) == NULL)
+ break;
+
+ /* copy next path */
+ buf[0] = 0;
+ copy_option_part(&dir, buf, MAXPATHL, " ,");
+
+#ifdef FEAT_PATH_EXTRA
+ /* get the stopdir string */
+ r_ptr = vim_findfile_stopdir(buf);
+#else
+ r_ptr = NULL;
+#endif
+ search_ctx = vim_findfile_init(buf, file_to_find, r_ptr, 100,
+ FALSE, TRUE, search_ctx, FALSE, rel_fname);
+ if (search_ctx != NULL)
+ did_findfile_init = TRUE;
+ vim_free(buf);
+ }
+ }
+ }
+ if (file_name == NULL && (options & FNAME_MESS))
+ {
+ if (first == TRUE)
+ {
+ if (need_dir)
+ EMSG2(_("E344: Can't find directory \"%s\" in cdpath"),
+ file_to_find);
+ else
+ EMSG2(_("E345: Can't find file \"%s\" in path"),
+ file_to_find);
+ }
+ else
+ {
+ if (need_dir)
+ EMSG2(_("E346: No more directory \"%s\" found in cdpath"),
+ file_to_find);
+ else
+ EMSG2(_("E347: No more file \"%s\" found in path"),
+ file_to_find);
+ }
+ }
+
+theend:
+#ifdef AMIGA
+ proc->pr_WindowPtr = save_winptr;
+#endif
+ return file_name;
+}
+
+#endif /* FEAT_SEARCHPATH */
+
+/*
+ * Change directory to "new_dir". If FEAT_SEARCHPATH is defined, search
+ * 'cdpath' for relative directory names, otherwise just mch_chdir().
+ */
+ int
+vim_chdir(new_dir)
+ char_u *new_dir;
+{
+#ifndef FEAT_SEARCHPATH
+ return mch_chdir((char *)new_dir);
+#else
+ char_u *dir_name;
+ int r;
+
+ dir_name = find_directory_in_path(new_dir, (int)STRLEN(new_dir),
+ FNAME_MESS, curbuf->b_ffname);
+ if (dir_name == NULL)
+ return -1;
+ r = mch_chdir((char *)dir_name);
+ vim_free(dir_name);
+ return r;
+#endif
+}
+
+/*
+ * Get user name from machine-specific function and cache it.
+ * Returns the user name in "buf[len]".
+ * Some systems are quite slow in obtaining the user name (Windows NT).
+ * Returns OK or FAIL.
+ */
+ int
+get_user_name(buf, len)
+ char_u *buf;
+ int len;
+{
+ static char_u *name = NULL;
+
+ if (name == NULL)
+ {
+ if (mch_get_user_name(buf, len) == FAIL)
+ return FAIL;
+ name = vim_strsave(buf);
+ }
+ else
+ STRNCPY(buf, name, len);
+ return OK;
+}
+
+#ifndef HAVE_QSORT
+/*
+ * Our own qsort(), for systems that don't have it.
+ * It's simple and slow. From the K&R C book.
+ */
+ void
+qsort(base, elm_count, elm_size, cmp)
+ void *base;
+ size_t elm_count;
+ size_t elm_size;
+ int (*cmp) __ARGS((const void *, const void *));
+{
+ char_u *buf;
+ char_u *p1;
+ char_u *p2;
+ int i, j;
+ int gap;
+
+ buf = alloc((unsigned)elm_size);
+ if (buf == NULL)
+ return;
+
+ for (gap = elm_count / 2; gap > 0; gap /= 2)
+ for (i = gap; i < elm_count; ++i)
+ for (j = i - gap; j >= 0; j -= gap)
+ {
+ /* Compare the elements. */
+ p1 = (char_u *)base + j * elm_size;
+ p2 = (char_u *)base + (j + gap) * elm_size;
+ if ((*cmp)((void *)p1, (void *)p2) <= 0)
+ break;
+ /* Exchange the elemets. */
+ mch_memmove(buf, p1, elm_size);
+ mch_memmove(p1, p2, elm_size);
+ mch_memmove(p2, buf, elm_size);
+ }
+
+ vim_free(buf);
+}
+#endif
+
+#if defined(FEAT_EX_EXTRA) || defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Sort an array of strings.
+ */
+static int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+sort_compare __ARGS((const void *s1, const void *s2));
+
+ static int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+sort_compare(s1, s2)
+ const void *s1;
+ const void *s2;
+{
+ return STRCMP(*(char **)s1, *(char **)s2);
+}
+
+ void
+sort_strings(files, count)
+ char_u **files;
+ int count;
+{
+ qsort((void *)files, (size_t)count, sizeof(char_u *), sort_compare);
+}
+#endif
+
+#if !defined(NO_EXPANDPATH) || defined(PROTO)
+/*
+ * Compare path "p[]" to "q[]".
+ * Return value like strcmp(p, q), but consider path separators.
+ */
+ int
+pathcmp(p, q)
+ const char *p, *q;
+{
+ int i;
+ const char *s;
+
+ for (i = 0; ; ++i)
+ {
+ /* End of "p": check if "q" also ends or just has a slash. */
+ if (p[i] == NUL)
+ {
+ if (q[i] == NUL) /* full match */
+ return 0;
+ s = q;
+ break;
+ }
+
+ /* End of "q": check if "p" just has a slash. */
+ if (q[i] == NUL)
+ {
+ s = p;
+ break;
+ }
+
+ if (
+#ifdef CASE_INSENSITIVE_FILENAME
+ TOUPPER_LOC(p[i]) != TOUPPER_LOC(q[i])
+#else
+ p[i] != q[i]
+#endif
+#ifdef BACKSLASH_IN_FILENAME
+ /* consider '/' and '\\' to be equal */
+ && !((p[i] == '/' && q[i] == '\\')
+ || (p[i] == '\\' && q[i] == '/'))
+#endif
+ )
+ {
+ if (vim_ispathsep(p[i]))
+ return -1;
+ if (vim_ispathsep(q[i]))
+ return 1;
+ return ((char_u *)p)[i] - ((char_u *)q)[i]; /* no match */
+ }
+ }
+
+ /* ignore a trailing slash, but not "//" or ":/" */
+ if (s[i + 1] == NUL && i > 0 && !vim_ispathsep(s[i - 1])
+#ifdef BACKSLASH_IN_FILENAME
+ && (s[i] == '/' || s[i] == '\\')
+#else
+ && s[i] == '/'
+#endif
+ )
+ return 0; /* match with trailing slash */
+ if (s == q)
+ return -1; /* no match */
+ return 1;
+}
+#endif
+
+#if defined(FEAT_PRINTER) || defined(PROTO)
+/*
+ * Parse a list of options in the form
+ * option:value,option:value,option:value
+ *
+ * "value" can start with a number which is parsed out, e.g.
+ * margin:12mm
+ *
+ * Returns error message for an illegal option, NULL otherwise.
+ * Only used for the printer at the moment...
+ */
+ char_u *
+parse_list_options(option_str, table, table_size)
+ char_u *option_str;
+ option_table_T *table;
+ int table_size;
+{
+ char_u *stringp;
+ char_u *colonp;
+ char_u *commap;
+ char_u *p;
+ int idx = 0; /* init for GCC */
+ int len;
+
+ for (idx = 0; idx < table_size; ++idx)
+ table[idx].present = FALSE;
+
+ /*
+ * Repeat for all comma separated parts.
+ */
+ stringp = option_str;
+ while (*stringp)
+ {
+ colonp = vim_strchr(stringp, ':');
+ if (colonp == NULL)
+ return (char_u *)N_("E550: Missing colon");
+ commap = vim_strchr(stringp, ',');
+ if (commap == NULL)
+ commap = option_str + STRLEN(option_str);
+
+ len = (int)(colonp - stringp);
+
+ for (idx = 0; idx < table_size; ++idx)
+ if (STRNICMP(stringp, table[idx].name, len) == 0)
+ break;
+
+ if (idx == table_size)
+ return (char_u *)N_("E551: Illegal component");
+
+ p = colonp + 1;
+ table[idx].present = TRUE;
+
+ if (table[idx].hasnum)
+ {
+ if (!VIM_ISDIGIT(*p))
+ return (char_u *)N_("E552: digit expected");
+
+ table[idx].number = getdigits(&p); /*advances p*/
+ }
+
+ table[idx].string = p;
+ table[idx].strlen = (int)(commap - p);
+
+ stringp = commap;
+ if (*stringp == ',')
+ ++stringp;
+ }
+
+ return NULL;
+}
+
+
+#endif /*FEAT_PRINTER*/
+
+/*
+ * The putenv() implementation below comes from the "screen" program.
+ * Included with permission from Juergen Weigert.
+ * See pty.c for the copyright notice.
+ */
+
+/*
+ * putenv -- put value into environment
+ *
+ * Usage: i = putenv (string)
+ * int i;
+ * char *string;
+ *
+ * where string is of the form <name>=<value>.
+ * Putenv returns 0 normally, -1 on error (not enough core for malloc).
+ *
+ * Putenv may need to add a new name into the environment, or to
+ * associate a value longer than the current value with a particular
+ * name. So, to make life simpler, putenv() copies your entire
+ * environment into the heap (i.e. malloc()) from the stack
+ * (i.e. where it resides when your process is initiated) the first
+ * time you call it.
+ *
+ * (history removed, not very interesting. See the "screen" sources.)
+ */
+
+#if !defined(HAVE_SETENV) && !defined(HAVE_PUTENV)
+
+#define EXTRASIZE 5 /* increment to add to env. size */
+
+static int envsize = -1; /* current size of environment */
+#ifndef MACOS_CLASSIC
+extern
+#endif
+ char **environ; /* the global which is your env. */
+
+static int findenv __ARGS((char *name)); /* look for a name in the env. */
+static int newenv __ARGS((void)); /* copy env. from stack to heap */
+static int moreenv __ARGS((void)); /* incr. size of env. */
+
+ int
+putenv(string)
+ const char *string;
+{
+ int i;
+ char *p;
+
+ if (envsize < 0)
+ { /* first time putenv called */
+ if (newenv() < 0) /* copy env. to heap */
+ return -1;
+ }
+
+ i = findenv((char *)string); /* look for name in environment */
+
+ if (i < 0)
+ { /* name must be added */
+ for (i = 0; environ[i]; i++);
+ if (i >= (envsize - 1))
+ { /* need new slot */
+ if (moreenv() < 0)
+ return -1;
+ }
+ p = (char *)alloc((unsigned)(strlen(string) + 1));
+ if (p == NULL) /* not enough core */
+ return -1;
+ environ[i + 1] = 0; /* new end of env. */
+ }
+ else
+ { /* name already in env. */
+ p = vim_realloc(environ[i], strlen(string) + 1);
+ if (p == NULL)
+ return -1;
+ }
+ sprintf(p, "%s", string); /* copy into env. */
+ environ[i] = p;
+
+ return 0;
+}
+
+ static int
+findenv(name)
+ char *name;
+{
+ char *namechar, *envchar;
+ int i, found;
+
+ found = 0;
+ for (i = 0; environ[i] && !found; i++)
+ {
+ envchar = environ[i];
+ namechar = name;
+ while (*namechar && *namechar != '=' && (*namechar == *envchar))
+ {
+ namechar++;
+ envchar++;
+ }
+ found = ((*namechar == '\0' || *namechar == '=') && *envchar == '=');
+ }
+ return found ? i - 1 : -1;
+}
+
+ static int
+newenv()
+{
+ char **env, *elem;
+ int i, esize;
+
+#ifdef MACOS
+ /* for Mac a new, empty environment is created */
+ i = 0;
+#else
+ for (i = 0; environ[i]; i++)
+ ;
+#endif
+ esize = i + EXTRASIZE + 1;
+ env = (char **)alloc((unsigned)(esize * sizeof (elem)));
+ if (env == NULL)
+ return -1;
+
+#ifndef MACOS
+ for (i = 0; environ[i]; i++)
+ {
+ elem = (char *)alloc((unsigned)(strlen(environ[i]) + 1));
+ if (elem == NULL)
+ return -1;
+ env[i] = elem;
+ strcpy(elem, environ[i]);
+ }
+#endif
+
+ env[i] = 0;
+ environ = env;
+ envsize = esize;
+ return 0;
+}
+
+ static int
+moreenv()
+{
+ int esize;
+ char **env;
+
+ esize = envsize + EXTRASIZE;
+ env = (char **)vim_realloc((char *)environ, esize * sizeof (*env));
+ if (env == 0)
+ return -1;
+ environ = env;
+ envsize = esize;
+ return 0;
+}
+
+# ifdef USE_VIMPTY_GETENV
+ char_u *
+vimpty_getenv(string)
+ const char_u *string;
+{
+ int i;
+ char_u *p;
+
+ if (envsize < 0)
+ return NULL;
+
+ i = findenv((char *)string);
+
+ if (i < 0)
+ return NULL;
+
+ p = vim_strchr((char_u *)environ[i], '=');
+ return (p + 1);
+}
+# endif
+
+#endif /* !defined(HAVE_SETENV) && !defined(HAVE_PUTENV) */
+
+/*
+ * Print a message with one string argument.
+ * Make sure that the result fits in IObuff.
+ * This is not in message.c, because the prototype for smsg() isn't used
+ * there.
+ */
+ void
+msg_str(s, arg)
+ char_u *s;
+ char_u *arg;
+{
+ int ls = STRLEN(s);
+ int larg = STRLEN(arg);
+
+ if (ls + larg >= IOSIZE)
+ smsg(s, arg + (ls + larg - IOSIZE));
+ else
+ smsg(s, arg);
+}
diff --git a/src/mkinstalldirs b/src/mkinstalldirs
new file mode 100755
index 000000000..64ae3939c
--- /dev/null
+++ b/src/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id$
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/src/move.c b/src/move.c
new file mode 100644
index 000000000..daa0fb7c1
--- /dev/null
+++ b/src/move.c
@@ -0,0 +1,2796 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * move.c: Functions for moving the cursor and scrolling text.
+ *
+ * There are two ways to move the cursor:
+ * 1. Move the cursor directly, the text is scrolled to keep the cursor in the
+ * window.
+ * 2. Scroll the text, the cursor is moved into the text visible in the
+ * window.
+ * The 'scrolloff' option makes this a bit complicated.
+ */
+
+#include "vim.h"
+
+static void comp_botline __ARGS((win_T *wp));
+static int check_top_offset __ARGS((void));
+static void curs_rows __ARGS((win_T *wp, int do_botline));
+static void validate_botline_win __ARGS((win_T *wp));
+static void validate_cheight __ARGS((void));
+
+typedef struct
+{
+ linenr_T lnum; /* line number */
+#ifdef FEAT_DIFF
+ int fill; /* filler lines */
+#endif
+ int height; /* height of added line */
+} lineoff_T;
+
+static void topline_back __ARGS((lineoff_T *lp));
+static void botline_forw __ARGS((lineoff_T *lp));
+#ifdef FEAT_DIFF
+static void botline_topline __ARGS((lineoff_T *lp));
+static void topline_botline __ARGS((lineoff_T *lp));
+static void max_topfill __ARGS((void));
+#endif
+
+/*
+ * Compute wp->w_botline for the current wp->w_topline. Can be called after
+ * wp->w_topline changed.
+ */
+ static void
+comp_botline(wp)
+ win_T *wp;
+{
+ int n;
+ linenr_T lnum;
+ int done;
+#ifdef FEAT_FOLDING
+ linenr_T last;
+ int folded;
+#endif
+
+ /*
+ * If w_cline_row is valid, start there.
+ * Otherwise have to start at w_topline.
+ */
+ check_cursor_moved(wp);
+ if (wp->w_valid & VALID_CROW)
+ {
+ lnum = wp->w_cursor.lnum;
+ done = wp->w_cline_row;
+ }
+ else
+ {
+ lnum = wp->w_topline;
+ done = 0;
+ }
+
+ for ( ; lnum <= wp->w_buffer->b_ml.ml_line_count; ++lnum)
+ {
+#ifdef FEAT_FOLDING
+ last = lnum;
+ folded = FALSE;
+ if (hasFoldingWin(wp, lnum, NULL, &last, TRUE, NULL))
+ {
+ n = 1;
+ folded = TRUE;
+ }
+ else
+#endif
+#ifdef FEAT_DIFF
+ if (lnum == wp->w_topline)
+ n = plines_win_nofill(wp, lnum, TRUE) + wp->w_topfill;
+ else
+#endif
+ n = plines_win(wp, lnum, TRUE);
+ if (
+#ifdef FEAT_FOLDING
+ lnum <= wp->w_cursor.lnum && last >= wp->w_cursor.lnum
+#else
+ lnum == wp->w_cursor.lnum
+#endif
+ )
+ {
+ wp->w_cline_row = done;
+ wp->w_cline_height = n;
+#ifdef FEAT_FOLDING
+ wp->w_cline_folded = folded;
+#endif
+ wp->w_valid |= (VALID_CROW|VALID_CHEIGHT);
+ }
+ if (done + n > wp->w_height)
+ break;
+ done += n;
+#ifdef FEAT_FOLDING
+ lnum = last;
+#endif
+ }
+
+ /* wp->w_botline is the line that is just below the window */
+ wp->w_botline = lnum;
+ wp->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
+
+ set_empty_rows(wp, done);
+}
+
+/*
+ * Update curwin->w_topline and redraw if necessary.
+ * Used to update the screen before printing a message.
+ */
+ void
+update_topline_redraw()
+{
+ update_topline();
+ if (must_redraw)
+ update_screen(0);
+}
+
+/*
+ * Update curwin->w_topline to move the cursor onto the screen.
+ */
+ void
+update_topline()
+{
+ long line_count;
+ int halfheight;
+ int n;
+ linenr_T old_topline;
+#ifdef FEAT_DIFF
+ int old_topfill;
+#endif
+#ifdef FEAT_FOLDING
+ linenr_T lnum;
+#endif
+ int check_topline = FALSE;
+ int check_botline = FALSE;
+#ifdef FEAT_MOUSE
+ int save_so = p_so;
+#endif
+
+ if (!screen_valid(TRUE))
+ return;
+
+ check_cursor_moved(curwin);
+ if (curwin->w_valid & VALID_TOPLINE)
+ return;
+
+#ifdef FEAT_MOUSE
+ /* When dragging with the mouse, don't scroll that quickly */
+ if (mouse_dragging)
+ p_so = mouse_dragging - 1;
+#endif
+
+ old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ old_topfill = curwin->w_topfill;
+#endif
+
+ /*
+ * If the buffer is empty, always set topline to 1.
+ */
+ if (bufempty()) /* special case - file is empty */
+ {
+ if (curwin->w_topline != 1)
+ redraw_later(NOT_VALID);
+ curwin->w_topline = 1;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ curwin->w_botline = 2;
+ curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
+#ifdef FEAT_SCROLLBIND
+ curwin->w_scbind_pos = 1;
+#endif
+ }
+
+ /*
+ * If the cursor is above or near the top of the window, scroll the window
+ * to show the line the cursor is in, with 'scrolloff' context.
+ */
+ else
+ {
+ if (curwin->w_topline > 1)
+ {
+ /* If the cursor is above topline, scrolling is always needed.
+ * If the cursor is far below topline and there is no folding,
+ * scrolling down is never needed. */
+ if (curwin->w_cursor.lnum < curwin->w_topline)
+ check_topline = TRUE;
+ else if (check_top_offset())
+ check_topline = TRUE;
+ }
+#ifdef FEAT_DIFF
+ /* Check if there are more filler lines than allowed. */
+ if (!check_topline && curwin->w_topfill > diff_check_fill(curwin,
+ curwin->w_topline))
+ check_topline = TRUE;
+#endif
+
+ if (check_topline)
+ {
+ halfheight = curwin->w_height / 2 - 1;
+ if (halfheight < 2)
+ halfheight = 2;
+
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ /* Count the number of logical lines between the cursor and
+ * topline + p_so (approximation of how much will be
+ * scrolled). */
+ n = 0;
+ for (lnum = curwin->w_cursor.lnum;
+ lnum < curwin->w_topline + p_so; ++lnum)
+ {
+ ++n;
+ /* stop at end of file or when we know we are far off */
+ if (lnum >= curbuf->b_ml.ml_line_count || n >= halfheight)
+ break;
+ (void)hasFolding(lnum, NULL, &lnum);
+ }
+ }
+ else
+#endif
+ n = curwin->w_topline + p_so - curwin->w_cursor.lnum;
+
+ /* If we weren't very close to begin with, we scroll to put the
+ * cursor in the middle of the window. Otherwise put the cursor
+ * near the top of the window. */
+ if (n >= halfheight)
+ scroll_cursor_halfway(FALSE);
+ else
+ {
+ scroll_cursor_top((int)p_sj, FALSE);
+ check_botline = TRUE;
+ }
+ }
+
+ else
+ {
+#ifdef FEAT_FOLDING
+ /* Make sure topline is the first line of a fold. */
+ (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+ check_botline = TRUE;
+ }
+ }
+
+ /*
+ * If the cursor is below the bottom of the window, scroll the window
+ * to put the cursor on the window.
+ * When w_botline is invalid, recompute it first, to avoid a redraw later.
+ * If w_botline was approximated, we might need a redraw later in a few
+ * cases, but we don't want to spend (a lot of) time recomputing w_botline
+ * for every small change.
+ */
+ if (check_botline)
+ {
+ if (!(curwin->w_valid & VALID_BOTLINE_AP))
+ validate_botline();
+
+ if (curwin->w_botline <= curbuf->b_ml.ml_line_count)
+ {
+ if (curwin->w_cursor.lnum < curwin->w_botline
+ && ((long)curwin->w_cursor.lnum
+ >= (long)curwin->w_botline - p_so
+#ifdef FEAT_FOLDING
+ || hasAnyFolding(curwin)
+#endif
+ ))
+ {
+ lineoff_T loff;
+
+ /* Cursor is above botline, check if there are 'scrolloff'
+ * window lines below the cursor. If not, need to scroll. */
+ n = curwin->w_empty_rows;
+ loff.lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_FOLDING
+ /* In a fold go to its last line. */
+ (void)hasFolding(loff.lnum, NULL, &loff.lnum);
+#endif
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+ n += curwin->w_filler_rows;
+#endif
+ loff.height = 0;
+ while (loff.lnum < curwin->w_botline
+#ifdef FEAT_DIFF
+ && (loff.lnum + 1 < curwin->w_botline || loff.fill == 0)
+#endif
+ )
+ {
+ n += loff.height;
+ if (n >= p_so)
+ break;
+ botline_forw(&loff);
+ }
+ if (n >= p_so)
+ /* sufficient context, no need to scroll */
+ check_botline = FALSE;
+ }
+ if (check_botline)
+ {
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ /* Count the number of logical lines between the cursor and
+ * botline - p_so (approximation of how much will be
+ * scrolled). */
+ line_count = 0;
+ for (lnum = curwin->w_cursor.lnum;
+ lnum >= curwin->w_botline - p_so; --lnum)
+ {
+ ++line_count;
+ /* stop at end of file or when we know we are far off */
+ if (lnum <= 0 || line_count > curwin->w_height + 1)
+ break;
+ (void)hasFolding(lnum, &lnum, NULL);
+ }
+ }
+ else
+#endif
+ line_count = curwin->w_cursor.lnum - curwin->w_botline
+ + 1 + p_so;
+ if (line_count <= curwin->w_height + 1)
+ scroll_cursor_bot((int)p_sj, FALSE);
+ else
+ scroll_cursor_halfway(FALSE);
+ }
+ }
+ }
+ curwin->w_valid |= VALID_TOPLINE;
+
+ /*
+ * Need to redraw when topline changed.
+ */
+ if (curwin->w_topline != old_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill != old_topfill
+#endif
+ )
+ {
+ dollar_vcol = 0;
+ if (curwin->w_skipcol)
+ {
+ curwin->w_skipcol = 0;
+ redraw_later(NOT_VALID);
+ }
+ else
+ redraw_later(VALID);
+ /* May need to set w_skipcol when cursor in w_topline. */
+ if (curwin->w_cursor.lnum == curwin->w_topline)
+ validate_cursor();
+ }
+
+#ifdef FEAT_MOUSE
+ p_so = save_so;
+#endif
+}
+
+/*
+ * Return TRUE when there are not 'scrolloff' lines above the cursor for the
+ * current window.
+ */
+ static int
+check_top_offset()
+{
+ lineoff_T loff;
+ int n;
+
+ if (curwin->w_cursor.lnum < curwin->w_topline + p_so
+#ifdef FEAT_FOLDING
+ || hasAnyFolding(curwin)
+#endif
+ )
+ {
+ loff.lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+ n = curwin->w_topfill; /* always have this context */
+#else
+ n = 0;
+#endif
+ /* Count the visible screen lines above the cursor line. */
+ while (n < p_so)
+ {
+ topline_back(&loff);
+ /* Stop when included a line above the window. */
+ if (loff.lnum < curwin->w_topline
+#ifdef FEAT_DIFF
+ || (loff.lnum == curwin->w_topline && loff.fill > 0)
+#endif
+ )
+ break;
+ n += loff.height;
+ }
+ if (n < p_so)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+ void
+update_curswant()
+{
+ if (curwin->w_set_curswant)
+ {
+ validate_virtcol();
+ curwin->w_curswant = curwin->w_virtcol;
+ curwin->w_set_curswant = FALSE;
+ }
+}
+
+/*
+ * Check if the cursor has moved. Set the w_valid flag accordingly.
+ */
+ void
+check_cursor_moved(wp)
+ win_T *wp;
+{
+ if (wp->w_cursor.lnum != wp->w_valid_cursor.lnum)
+ {
+ wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
+ |VALID_CHEIGHT|VALID_CROW|VALID_TOPLINE);
+ wp->w_valid_cursor = wp->w_cursor;
+ wp->w_valid_leftcol = wp->w_leftcol;
+ }
+ else if (wp->w_cursor.col != wp->w_valid_cursor.col
+ || wp->w_leftcol != wp->w_valid_leftcol
+#ifdef FEAT_VIRTUALEDIT
+ || wp->w_cursor.coladd != wp->w_valid_cursor.coladd
+#endif
+ )
+ {
+ wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
+ wp->w_valid_cursor.col = wp->w_cursor.col;
+ wp->w_valid_leftcol = wp->w_leftcol;
+#ifdef FEAT_VIRTUALEDIT
+ wp->w_valid_cursor.coladd = wp->w_cursor.coladd;
+#endif
+ }
+}
+
+/*
+ * Call this function when some window settings have changed, which require
+ * the cursor position, botline and topline to be recomputed and the window to
+ * be redrawn. E.g, when changing the 'wrap' option or folding.
+ */
+ void
+changed_window_setting()
+{
+ changed_window_setting_win(curwin);
+}
+
+ void
+changed_window_setting_win(wp)
+ win_T *wp;
+{
+ wp->w_lines_valid = 0;
+ changed_line_abv_curs_win(wp);
+ wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP|VALID_TOPLINE);
+ redraw_win_later(wp, NOT_VALID);
+}
+
+/*
+ * Set wp->w_topline to a certain number.
+ */
+ void
+set_topline(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+#ifdef FEAT_FOLDING
+ /* go to first of folded lines */
+ (void)hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
+#endif
+ /* Approximate the value of w_botline */
+ wp->w_botline += lnum - wp->w_topline;
+ wp->w_topline = lnum;
+#ifdef FEAT_DIFF
+ wp->w_topfill = 0;
+#endif
+ wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
+ /* Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked. */
+ redraw_later(VALID);
+}
+
+/*
+ * Call this function when the length of the cursor line (in screen
+ * characters) has changed, and the change is before the cursor.
+ * Need to take care of w_botline separately!
+ */
+ void
+changed_cline_bef_curs()
+{
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
+ |VALID_CHEIGHT|VALID_TOPLINE);
+}
+
+ void
+changed_cline_bef_curs_win(wp)
+ win_T *wp;
+{
+ wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL
+ |VALID_CHEIGHT|VALID_TOPLINE);
+}
+
+#if 0 /* not used */
+/*
+ * Call this function when the length of the cursor line (in screen
+ * characters) has changed, and the position of the cursor doesn't change.
+ * Need to take care of w_botline separately!
+ */
+ void
+changed_cline_aft_curs()
+{
+ curwin->w_valid &= ~VALID_CHEIGHT;
+}
+#endif
+
+/*
+ * Call this function when the length of a line (in screen characters) above
+ * the cursor have changed.
+ * Need to take care of w_botline separately!
+ */
+ void
+changed_line_abv_curs()
+{
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
+ |VALID_CHEIGHT|VALID_TOPLINE);
+}
+
+ void
+changed_line_abv_curs_win(wp)
+ win_T *wp;
+{
+ wp->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL|VALID_CROW
+ |VALID_CHEIGHT|VALID_TOPLINE);
+}
+
+/*
+ * Make sure the value of curwin->w_botline is valid.
+ */
+ void
+validate_botline()
+{
+ if (!(curwin->w_valid & VALID_BOTLINE))
+ comp_botline(curwin);
+}
+
+/*
+ * Make sure the value of wp->w_botline is valid.
+ */
+ static void
+validate_botline_win(wp)
+ win_T *wp;
+{
+ if (!(wp->w_valid & VALID_BOTLINE))
+ comp_botline(wp);
+}
+
+/*
+ * Mark curwin->w_botline as invalid (because of some change in the buffer).
+ */
+ void
+invalidate_botline()
+{
+ curwin->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
+}
+
+ void
+invalidate_botline_win(wp)
+ win_T *wp;
+{
+ wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
+}
+
+#if 0 /* never used */
+/*
+ * Mark curwin->w_botline as approximated (because of some small change in the
+ * buffer).
+ */
+ void
+approximate_botline()
+{
+ curwin->w_valid &= ~VALID_BOTLINE;
+}
+#endif
+
+ void
+approximate_botline_win(wp)
+ win_T *wp;
+{
+ wp->w_valid &= ~VALID_BOTLINE;
+}
+
+#if 0 /* not used */
+/*
+ * Return TRUE if curwin->w_botline is valid.
+ */
+ int
+botline_valid()
+{
+ return (curwin->w_valid & VALID_BOTLINE);
+}
+#endif
+
+#if 0 /* not used */
+/*
+ * Return TRUE if curwin->w_botline is valid or approximated.
+ */
+ int
+botline_approximated()
+{
+ return (curwin->w_valid & VALID_BOTLINE_AP);
+}
+#endif
+
+/*
+ * Return TRUE if curwin->w_wrow and curwin->w_wcol are valid.
+ */
+ int
+cursor_valid()
+{
+ check_cursor_moved(curwin);
+ return ((curwin->w_valid & (VALID_WROW|VALID_WCOL)) ==
+ (VALID_WROW|VALID_WCOL));
+}
+
+/*
+ * Validate cursor position. Makes sure w_wrow and w_wcol are valid.
+ * w_topline must be valid, you may need to call update_topline() first!
+ */
+ void
+validate_cursor()
+{
+ check_cursor_moved(curwin);
+ if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW))
+ curs_columns(TRUE);
+}
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * validate w_cline_row.
+ */
+ void
+validate_cline_row()
+{
+ /*
+ * First make sure that w_topline is valid (after moving the cursor).
+ */
+ update_topline();
+ check_cursor_moved(curwin);
+ if (!(curwin->w_valid & VALID_CROW))
+ curs_rows(curwin, FALSE);
+}
+#endif
+
+/*
+ * Compute wp->w_cline_row and wp->w_cline_height, based on the current value
+ * of wp->w_topine.
+ *
+ * Returns OK when cursor is in the window, FAIL when it isn't.
+ */
+ static void
+curs_rows(wp, do_botline)
+ win_T *wp;
+ int do_botline; /* also compute w_botline */
+{
+ linenr_T lnum;
+ int i;
+ int all_invalid;
+ int valid;
+#ifdef FEAT_FOLDING
+ long fold_count;
+#endif
+
+ /* Check if wp->w_lines[].wl_size is invalid */
+ all_invalid = (!redrawing()
+ || wp->w_lines_valid == 0
+ || wp->w_lines[0].wl_lnum > wp->w_topline);
+ i = 0;
+ wp->w_cline_row = 0;
+ for (lnum = wp->w_topline; lnum < wp->w_cursor.lnum; ++i)
+ {
+ valid = FALSE;
+ if (!all_invalid && i < wp->w_lines_valid)
+ {
+ if (wp->w_lines[i].wl_lnum < lnum || !wp->w_lines[i].wl_valid)
+ continue; /* skip changed or deleted lines */
+ if (wp->w_lines[i].wl_lnum == lnum)
+ {
+#ifdef FEAT_FOLDING
+ /* Check for newly inserted lines below this row, in which
+ * case we need to check for folded lines. */
+ if (!wp->w_buffer->b_mod_set
+ || wp->w_lines[i].wl_lastlnum < wp->w_cursor.lnum
+ || wp->w_buffer->b_mod_top
+ > wp->w_lines[i].wl_lastlnum + 1)
+#endif
+ valid = TRUE;
+ }
+ else if (wp->w_lines[i].wl_lnum > lnum)
+ --i; /* hold at inserted lines */
+ }
+ if (valid
+#ifdef FEAT_DIFF
+ && (lnum != wp->w_topline || !wp->w_p_diff)
+#endif
+ )
+ {
+#ifdef FEAT_FOLDING
+ lnum = wp->w_lines[i].wl_lastlnum + 1;
+ /* Cursor inside folded lines, don't count this row */
+ if (lnum > wp->w_cursor.lnum)
+ break;
+#else
+ ++lnum;
+#endif
+ wp->w_cline_row += wp->w_lines[i].wl_size;
+ }
+ else
+ {
+#ifdef FEAT_FOLDING
+ fold_count = foldedCount(wp, lnum, NULL);
+ if (fold_count)
+ {
+ lnum += fold_count;
+ if (lnum > wp->w_cursor.lnum)
+ break;
+ ++wp->w_cline_row;
+ }
+ else
+#endif
+#ifdef FEAT_DIFF
+ if (lnum == wp->w_topline)
+ wp->w_cline_row += plines_win_nofill(wp, lnum++, TRUE)
+ + wp->w_topfill;
+ else
+#endif
+ wp->w_cline_row += plines_win(wp, lnum++, TRUE);
+ }
+ }
+
+ check_cursor_moved(wp);
+ if (!(wp->w_valid & VALID_CHEIGHT))
+ {
+ if (all_invalid
+ || i == wp->w_lines_valid
+ || (i < wp->w_lines_valid
+ && (!wp->w_lines[i].wl_valid
+ || wp->w_lines[i].wl_lnum != wp->w_cursor.lnum)))
+ {
+#ifdef FEAT_DIFF
+ if (wp->w_cursor.lnum == wp->w_topline)
+ wp->w_cline_height = plines_win_nofill(wp, wp->w_cursor.lnum,
+ TRUE) + wp->w_topfill;
+ else
+#endif
+ wp->w_cline_height = plines_win(wp, wp->w_cursor.lnum, TRUE);
+#ifdef FEAT_FOLDING
+ wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
+ NULL, NULL, TRUE, NULL);
+#endif
+ }
+ else if (i > wp->w_lines_valid)
+ {
+ /* a line that is too long to fit on the last screen line */
+ wp->w_cline_height = 0;
+#ifdef FEAT_FOLDING
+ wp->w_cline_folded = hasFoldingWin(wp, wp->w_cursor.lnum,
+ NULL, NULL, TRUE, NULL);
+#endif
+ }
+ else
+ {
+ wp->w_cline_height = wp->w_lines[i].wl_size;
+#ifdef FEAT_FOLDING
+ wp->w_cline_folded = wp->w_lines[i].wl_folded;
+#endif
+ }
+ }
+
+ wp->w_valid |= VALID_CROW|VALID_CHEIGHT;
+
+ /* validate botline too, if update_screen doesn't do it */
+ if (do_botline && all_invalid)
+ validate_botline_win(wp);
+}
+
+/*
+ * Validate curwin->w_virtcol only.
+ */
+ void
+validate_virtcol()
+{
+ validate_virtcol_win(curwin);
+}
+
+/*
+ * Validate wp->w_virtcol only.
+ */
+ void
+validate_virtcol_win(wp)
+ win_T *wp;
+{
+ check_cursor_moved(wp);
+ if (!(wp->w_valid & VALID_VIRTCOL))
+ {
+ getvvcol(wp, &wp->w_cursor, NULL, &(wp->w_virtcol), NULL);
+ wp->w_valid |= VALID_VIRTCOL;
+ }
+}
+
+/*
+ * Validate curwin->w_cline_height only.
+ */
+ static void
+validate_cheight()
+{
+ check_cursor_moved(curwin);
+ if (!(curwin->w_valid & VALID_CHEIGHT))
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_cursor.lnum == curwin->w_topline)
+ curwin->w_cline_height = plines_nofill(curwin->w_cursor.lnum)
+ + curwin->w_topfill;
+ else
+#endif
+ curwin->w_cline_height = plines(curwin->w_cursor.lnum);
+#ifdef FEAT_FOLDING
+ curwin->w_cline_folded = hasFolding(curwin->w_cursor.lnum, NULL, NULL);
+#endif
+ curwin->w_valid |= VALID_CHEIGHT;
+ }
+}
+
+/*
+ * validate w_wcol and w_virtcol only. Only correct when 'wrap' on!
+ */
+ void
+validate_cursor_col()
+{
+ colnr_T off;
+ colnr_T col;
+
+ validate_virtcol();
+ if (!(curwin->w_valid & VALID_WCOL))
+ {
+ col = curwin->w_virtcol;
+ off = curwin_col_off();
+ col += off;
+
+ /* long line wrapping, adjust curwin->w_wrow */
+ if (curwin->w_p_wrap && col >= (colnr_T)W_WIDTH(curwin)
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ col -= W_WIDTH(curwin);
+ col = col % (W_WIDTH(curwin) - off + curwin_col_off2());
+ }
+ curwin->w_wcol = col;
+ curwin->w_valid |= VALID_WCOL;
+ }
+}
+
+/*
+ * Compute offset of a window, occupied by line number, fold column and sign
+ * column (these don't move when scrolling horizontally).
+ */
+ int
+win_col_off(wp)
+ win_T *wp;
+{
+ return ((wp->w_p_nu ? 8 : 0)
+#ifdef FEAT_CMDWIN
+ + (cmdwin_type == 0 || wp != curwin ? 0 : 1)
+#endif
+#ifdef FEAT_FOLDING
+ + wp->w_p_fdc
+#endif
+#ifdef FEAT_SIGNS
+ + (
+# ifdef FEAT_NETBEANS_INTG
+ /* always show glyph gutter in netbeans */
+ usingNetbeans ||
+# endif
+ wp->w_buffer->b_signlist != NULL ? 2 : 0)
+#endif
+ );
+}
+
+ int
+curwin_col_off()
+{
+ return win_col_off(curwin);
+}
+
+/*
+ * Return the difference in column offset for the second screen line of a
+ * wrapped line. It's 8 if 'number' is on and 'n' is in 'cpoptions'.
+ */
+ int
+win_col_off2(wp)
+ win_T *wp;
+{
+ if (wp->w_p_nu && vim_strchr(p_cpo, CPO_NUMCOL) != NULL)
+ return 8;
+ return 0;
+}
+
+ int
+curwin_col_off2()
+{
+ return win_col_off2(curwin);
+}
+
+/*
+ * compute curwin->w_wcol and curwin->w_virtcol.
+ * Also updates curwin->w_wrow and curwin->w_cline_row.
+ * Also updates curwin->w_leftcol.
+ */
+ void
+curs_columns(scroll)
+ int scroll; /* when TRUE, may scroll horizontally */
+{
+ int diff;
+ int extra; /* offset for first screen line */
+ int off_left, off_right;
+ int n;
+ int p_lines;
+ int width = 0;
+ int textwidth;
+ int new_leftcol;
+ colnr_T startcol;
+ colnr_T endcol;
+ colnr_T prev_skipcol;
+
+ /*
+ * First make sure that w_topline is valid (after moving the cursor).
+ */
+ update_topline();
+
+ /*
+ * Next make sure that w_cline_row is valid.
+ */
+ if (!(curwin->w_valid & VALID_CROW))
+ curs_rows(curwin, FALSE);
+
+ /*
+ * Compute the number of virtual columns.
+ */
+#ifdef FEAT_FOLDING
+ if (curwin->w_cline_folded)
+ /* In a folded line the cursor is always in the first column */
+ startcol = curwin->w_virtcol = endcol = curwin->w_leftcol;
+ else
+#endif
+ getvvcol(curwin, &curwin->w_cursor,
+ &startcol, &(curwin->w_virtcol), &endcol);
+
+ /* remove '$' from change command when cursor moves onto it */
+ if (startcol > dollar_vcol)
+ dollar_vcol = 0;
+
+ extra = curwin_col_off();
+ curwin->w_wcol = curwin->w_virtcol + extra;
+ endcol += extra;
+
+ /*
+ * Now compute w_wrow, counting screen lines from w_cline_row.
+ */
+ curwin->w_wrow = curwin->w_cline_row;
+
+ textwidth = W_WIDTH(curwin) - extra;
+ if (textwidth <= 0)
+ {
+ /* No room for text, put cursor in last char of window. */
+ curwin->w_wcol = W_WIDTH(curwin) - 1;
+ curwin->w_wrow = curwin->w_height - 1;
+ }
+ else if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ width = textwidth + curwin_col_off2();
+
+ /* long line wrapping, adjust curwin->w_wrow */
+ if (curwin->w_wcol >= W_WIDTH(curwin))
+ {
+ n = (curwin->w_wcol - W_WIDTH(curwin)) / width + 1;
+ curwin->w_wcol -= n * width;
+ curwin->w_wrow += n;
+
+#ifdef FEAT_LINEBREAK
+ /* When cursor wraps to first char of next line in Insert
+ * mode, the 'showbreak' string isn't shown, backup to first
+ * column */
+ if (*p_sbr && *ml_get_cursor() == NUL
+ && curwin->w_wcol == (int)vim_strsize(p_sbr))
+ curwin->w_wcol = 0;
+#endif
+ }
+ }
+
+ /* No line wrapping: compute curwin->w_leftcol if scrolling is on and line
+ * is not folded.
+ * If scrolling is off, curwin->w_leftcol is assumed to be 0 */
+ else if (scroll
+#ifdef FEAT_FOLDING
+ && !curwin->w_cline_folded
+#endif
+ )
+ {
+ /*
+ * If Cursor is left of the screen, scroll rightwards.
+ * If Cursor is right of the screen, scroll leftwards
+ * If we get closer to the edge than 'sidescrolloff', scroll a little
+ * extra
+ */
+ off_left = (int)startcol - (int)curwin->w_leftcol - p_siso;
+ off_right = (int)endcol - (int)(curwin->w_leftcol + W_WIDTH(curwin)
+ - p_siso) + 1;
+ if (off_left < 0 || off_right > 0)
+ {
+ if (off_left < 0)
+ diff = -off_left;
+ else
+ diff = off_right;
+
+ /* When far off or not enough room on either side, put cursor in
+ * middle of window. */
+ if (p_ss == 0 || diff >= textwidth / 2 || off_right >= off_left)
+ new_leftcol = curwin->w_wcol - extra - textwidth / 2;
+ else
+ {
+ if (diff < p_ss)
+ diff = p_ss;
+ if (off_left < 0)
+ new_leftcol = curwin->w_leftcol - diff;
+ else
+ new_leftcol = curwin->w_leftcol + diff;
+ }
+ if (new_leftcol < 0)
+ new_leftcol = 0;
+ if (new_leftcol != (int)curwin->w_leftcol)
+ {
+ curwin->w_leftcol = new_leftcol;
+ /* screen has to be redrawn with new curwin->w_leftcol */
+ redraw_later(NOT_VALID);
+ }
+ }
+ curwin->w_wcol -= curwin->w_leftcol;
+ }
+ else if (curwin->w_wcol > (int)curwin->w_leftcol)
+ curwin->w_wcol -= curwin->w_leftcol;
+ else
+ curwin->w_wcol = 0;
+
+#ifdef FEAT_DIFF
+ /* Skip over filler lines. At the top use w_topfill, there
+ * may be some filler lines above the window. */
+ if (curwin->w_cursor.lnum == curwin->w_topline)
+ curwin->w_wrow += curwin->w_topfill;
+ else
+ curwin->w_wrow += diff_check_fill(curwin, curwin->w_cursor.lnum);
+#endif
+
+ prev_skipcol = curwin->w_skipcol;
+
+ p_lines = 0;
+ if ((curwin->w_wrow >= curwin->w_height
+ || ((prev_skipcol > 0
+ || curwin->w_wrow + p_so >= curwin->w_height)
+ && (p_lines =
+#ifdef FEAT_DIFF
+ plines_win_nofill
+#else
+ plines_win
+#endif
+ (curwin, curwin->w_cursor.lnum, FALSE))
+ - 1 >= curwin->w_height))
+ && curwin->w_height != 0
+ && curwin->w_cursor.lnum == curwin->w_topline
+ && width > 0
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ /* Cursor past end of screen. Happens with a single line that does
+ * not fit on screen. Find a skipcol to show the text around the
+ * cursor. Avoid scrolling all the time. compute value of "extra":
+ * 1: Less than "p_so" lines above
+ * 2: Less than "p_so" lines below
+ * 3: both of them */
+ extra = 0;
+ if (curwin->w_skipcol + p_so * width > curwin->w_virtcol)
+ extra = 1;
+ /* Compute last display line of the buffer line that we want at the
+ * bottom of the window. */
+ if (p_lines == 0)
+ p_lines = plines_win(curwin, curwin->w_cursor.lnum, FALSE);
+ --p_lines;
+ if (p_lines > curwin->w_wrow + p_so)
+ n = curwin->w_wrow + p_so;
+ else
+ n = p_lines;
+ if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width)
+ extra += 2;
+
+ if (extra == 3 || p_lines < p_so * 2)
+ {
+ /* not enough room for 'scrolloff', put cursor in the middle */
+ n = curwin->w_virtcol / width;
+ if (n > curwin->w_height / 2)
+ n -= curwin->w_height / 2;
+ else
+ n = 0;
+ /* don't skip more than necessary */
+ if (n > p_lines - curwin->w_height + 1)
+ n = p_lines - curwin->w_height + 1;
+ curwin->w_skipcol = n * width;
+ }
+ else if (extra == 1)
+ {
+ /* less then 'scrolloff' lines above, decrease skipcol */
+ extra = (curwin->w_skipcol + p_so * width - curwin->w_virtcol
+ + width - 1) / width;
+ if (extra > 0)
+ {
+ if ((colnr_T)(extra * width) > curwin->w_skipcol)
+ extra = curwin->w_skipcol / width;
+ curwin->w_skipcol -= extra * width;
+ }
+ }
+ else if (extra == 2)
+ {
+ /* less then 'scrolloff' lines below, increase skipcol */
+ endcol = (n - curwin->w_height + 1) * width;
+ while (endcol > curwin->w_virtcol)
+ endcol -= width;
+ if (endcol > curwin->w_skipcol)
+ curwin->w_skipcol = endcol;
+ }
+
+ curwin->w_wrow -= curwin->w_skipcol / width;
+ if (curwin->w_wrow >= curwin->w_height)
+ {
+ /* small window, make sure cursor is in it */
+ extra = curwin->w_wrow - curwin->w_height + 1;
+ curwin->w_skipcol += extra * width;
+ curwin->w_wrow -= extra;
+ }
+
+ extra = ((int)prev_skipcol - (int)curwin->w_skipcol) / width;
+ if (extra > 0)
+ win_ins_lines(curwin, 0, extra, FALSE, FALSE);
+ else if (extra < 0)
+ win_del_lines(curwin, 0, -extra, FALSE, FALSE);
+ }
+ else
+ curwin->w_skipcol = 0;
+ if (prev_skipcol != curwin->w_skipcol)
+ redraw_later(NOT_VALID);
+
+ curwin->w_valid |= VALID_WCOL|VALID_WROW|VALID_VIRTCOL;
+}
+
+/*
+ * Scroll the current window down by "line_count" logical lines. "CTRL-Y"
+ */
+/*ARGSUSED*/
+ void
+scrolldown(line_count, byfold)
+ long line_count;
+ int byfold; /* TRUE: count a closed fold as one line */
+{
+ long done = 0; /* total # of physical lines done */
+ int wrow;
+ int moved = FALSE;
+
+#ifdef FEAT_FOLDING
+ linenr_T first;
+
+ /* Make sure w_topline is at the first of a sequence of folded lines. */
+ (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+ validate_cursor(); /* w_wrow needs to be valid */
+ while (line_count-- > 0)
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
+ {
+ ++curwin->w_topfill;
+ ++done;
+ }
+ else
+#endif
+ {
+ if (curwin->w_topline == 1)
+ break;
+ --curwin->w_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+#ifdef FEAT_FOLDING
+ /* A sequence of folded lines only counts for one logical line */
+ if (hasFolding(curwin->w_topline, &first, NULL))
+ {
+ ++done;
+ if (!byfold)
+ line_count -= curwin->w_topline - first - 1;
+ curwin->w_botline -= curwin->w_topline - first;
+ curwin->w_topline = first;
+ }
+ else
+#endif
+#ifdef FEAT_DIFF
+ done += plines_nofill(curwin->w_topline);
+#else
+ done += plines(curwin->w_topline);
+#endif
+ }
+ --curwin->w_botline; /* approximate w_botline */
+ invalidate_botline();
+ }
+ curwin->w_wrow += done; /* keep w_wrow updated */
+ curwin->w_cline_row += done; /* keep w_cline_row updated */
+
+#ifdef FEAT_DIFF
+ if (curwin->w_cursor.lnum == curwin->w_topline)
+ curwin->w_cline_row = 0;
+ check_topfill(curwin, TRUE);
+#endif
+
+ /*
+ * Compute the row number of the last row of the cursor line
+ * and move the cursor onto the displayed part of the window.
+ */
+ wrow = curwin->w_wrow;
+ if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ validate_virtcol();
+ validate_cheight();
+ wrow += curwin->w_cline_height - 1 -
+ curwin->w_virtcol / W_WIDTH(curwin);
+ }
+ while (wrow >= curwin->w_height && curwin->w_cursor.lnum > 1)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_cursor.lnum, &first, NULL))
+ {
+ --wrow;
+ if (first == 1)
+ curwin->w_cursor.lnum = 1;
+ else
+ curwin->w_cursor.lnum = first - 1;
+ }
+ else
+#endif
+ wrow -= plines(curwin->w_cursor.lnum--);
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL);
+ moved = TRUE;
+ }
+ if (moved)
+ {
+#ifdef FEAT_FOLDING
+ /* Move cursor to first line of closed fold. */
+ foldAdjustCursor();
+#endif
+ coladvance(curwin->w_curswant);
+ }
+}
+
+/*
+ * Scroll the current window up by "line_count" logical lines. "CTRL-E"
+ */
+/*ARGSUSED*/
+ void
+scrollup(line_count, byfold)
+ long line_count;
+ int byfold; /* TRUE: count a closed fold as one line */
+{
+#if defined(FEAT_FOLDING) || defined(FEAT_DIFF)
+ linenr_T lnum;
+
+ if (
+# ifdef FEAT_FOLDING
+ (byfold && hasAnyFolding(curwin))
+# ifdef FEAT_DIFF
+ ||
+# endif
+# endif
+# ifdef FEAT_DIFF
+ curwin->w_p_diff
+# endif
+ )
+ {
+ /* count each sequence of folded lines as one logical line */
+ lnum = curwin->w_topline;
+ while (line_count--)
+ {
+# ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ --curwin->w_topfill;
+ else
+# endif
+ {
+# ifdef FEAT_FOLDING
+ if (byfold)
+ (void)hasFolding(lnum, NULL, &lnum);
+# endif
+ if (lnum >= curbuf->b_ml.ml_line_count)
+ break;
+ ++lnum;
+# ifdef FEAT_DIFF
+ curwin->w_topfill = diff_check_fill(curwin, lnum);
+# endif
+ }
+ }
+ /* approximate w_botline */
+ curwin->w_botline += lnum - curwin->w_topline;
+ curwin->w_topline = lnum;
+ }
+ else
+#endif
+ {
+ curwin->w_topline += line_count;
+ curwin->w_botline += line_count; /* approximate w_botline */
+ }
+
+ if (curwin->w_topline > curbuf->b_ml.ml_line_count)
+ curwin->w_topline = curbuf->b_ml.ml_line_count;
+ if (curwin->w_botline > curbuf->b_ml.ml_line_count + 1)
+ curwin->w_botline = curbuf->b_ml.ml_line_count + 1;
+
+#ifdef FEAT_DIFF
+ check_topfill(curwin, FALSE);
+#endif
+
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ /* Make sure w_topline is at the first of a sequence of folded lines. */
+ (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
+ if (curwin->w_cursor.lnum < curwin->w_topline)
+ {
+ curwin->w_cursor.lnum = curwin->w_topline;
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW|VALID_VIRTCOL);
+ coladvance(curwin->w_curswant);
+ }
+}
+
+#ifdef FEAT_DIFF
+/*
+ * Don't end up with too many filler lines in the window.
+ */
+ void
+check_topfill(wp, down)
+ win_T *wp;
+ int down; /* when TRUE scroll down when not enough space */
+{
+ int n;
+
+ if (wp->w_topfill > 0)
+ {
+ n = plines_win_nofill(wp, wp->w_topline, TRUE);
+ if (wp->w_topfill + n > wp->w_height)
+ {
+ if (down && wp->w_topline > 1)
+ {
+ --wp->w_topline;
+ wp->w_topfill = 0;
+ }
+ else
+ {
+ wp->w_topfill = wp->w_height - n;
+ if (wp->w_topfill < 0)
+ wp->w_topfill = 0;
+ }
+ }
+ }
+}
+
+/*
+ * Use as many filler lines as possible for w_topline. Make sure w_topline
+ * is still visible.
+ */
+ static void
+max_topfill()
+{
+ int n;
+
+ n = plines_nofill(curwin->w_topline);
+ if (n >= curwin->w_height)
+ curwin->w_topfill = 0;
+ else
+ {
+ curwin->w_topfill = diff_check_fill(curwin, curwin->w_topline);
+ if (curwin->w_topfill + n > curwin->w_height)
+ curwin->w_topfill = curwin->w_height - n;
+ }
+}
+#endif
+
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * Scroll the screen one line down, but don't do it if it would move the
+ * cursor off the screen.
+ */
+ void
+scrolldown_clamp()
+{
+ int end_row;
+#ifdef FEAT_DIFF
+ int can_fill = (curwin->w_topfill
+ < diff_check_fill(curwin, curwin->w_topline));
+#endif
+
+ if (curwin->w_topline <= 1
+#ifdef FEAT_DIFF
+ && !can_fill
+#endif
+ )
+ return;
+
+ validate_cursor(); /* w_wrow needs to be valid */
+
+ /*
+ * Compute the row number of the last row of the cursor line
+ * and make sure it doesn't go off the screen. Make sure the cursor
+ * doesn't go past 'scrolloff' lines from the screen end.
+ */
+ end_row = curwin->w_wrow;
+#ifdef FEAT_DIFF
+ if (can_fill)
+ ++end_row;
+ else
+ end_row += plines_nofill(curwin->w_topline - 1);
+#else
+ end_row += plines(curwin->w_topline - 1);
+#endif
+ if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ validate_cheight();
+ validate_virtcol();
+ end_row += curwin->w_cline_height - 1 -
+ curwin->w_virtcol / W_WIDTH(curwin);
+ }
+ if (end_row < curwin->w_height - p_so)
+ {
+#ifdef FEAT_DIFF
+ if (can_fill)
+ {
+ ++curwin->w_topfill;
+ check_topfill(curwin, TRUE);
+ }
+ else
+ {
+ --curwin->w_topline;
+ curwin->w_topfill = 0;
+ }
+#else
+ --curwin->w_topline;
+#endif
+#ifdef FEAT_FOLDING
+ hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+ --curwin->w_botline; /* approximate w_botline */
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
+ }
+}
+
+/*
+ * Scroll the screen one line up, but don't do it if it would move the cursor
+ * off the screen.
+ */
+ void
+scrollup_clamp()
+{
+ int start_row;
+
+ if (curwin->w_topline == curbuf->b_ml.ml_line_count
+#ifdef FEAT_DIFF
+ && curwin->w_topfill == 0
+#endif
+ )
+ return;
+
+ validate_cursor(); /* w_wrow needs to be valid */
+
+ /*
+ * Compute the row number of the first row of the cursor line
+ * and make sure it doesn't go off the screen. Make sure the cursor
+ * doesn't go before 'scrolloff' lines from the screen start.
+ */
+#ifdef FEAT_DIFF
+ start_row = curwin->w_wrow - plines_nofill(curwin->w_topline)
+ - curwin->w_topfill;
+#else
+ start_row = curwin->w_wrow - plines(curwin->w_topline);
+#endif
+ if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ validate_virtcol();
+ start_row -= curwin->w_virtcol / W_WIDTH(curwin);
+ }
+ if (start_row >= p_so)
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ --curwin->w_topfill;
+ else
+#endif
+ ++curwin->w_topline;
+ ++curwin->w_botline; /* approximate w_botline */
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
+ }
+}
+#endif /* FEAT_INS_EXPAND */
+
+/*
+ * Add one line above "lp->lnum". This can be a filler line, a closed fold or
+ * a (wrapped) text line. Uses and sets "lp->fill".
+ * Returns the height of the added line in "lp->height".
+ * Lines above the first one are incredibly high.
+ */
+ static void
+topline_back(lp)
+ lineoff_T *lp;
+{
+#ifdef FEAT_DIFF
+ if (lp->fill < diff_check_fill(curwin, lp->lnum))
+ {
+ /* Add a filler line. */
+ ++lp->fill;
+ lp->height = 1;
+ }
+ else
+#endif
+ {
+ --lp->lnum;
+#ifdef FEAT_DIFF
+ lp->fill = 0;
+#endif
+ if (lp->lnum < 1)
+ lp->height = MAXCOL;
+ else
+#ifdef FEAT_FOLDING
+ if (hasFolding(lp->lnum, &lp->lnum, NULL))
+ /* Add a closed fold */
+ lp->height = 1;
+ else
+#endif
+ {
+#ifdef FEAT_DIFF
+ lp->height = plines_nofill(lp->lnum);
+#else
+ lp->height = plines(lp->lnum);
+#endif
+ }
+ }
+}
+
+/*
+ * Add one line below "lp->lnum". This can be a filler line, a closed fold or
+ * a (wrapped) text line. Uses and sets "lp->fill".
+ * Returns the height of the added line in "lp->height".
+ * Lines below the last one are incredibly high.
+ */
+ static void
+botline_forw(lp)
+ lineoff_T *lp;
+{
+#ifdef FEAT_DIFF
+ if (lp->fill < diff_check_fill(curwin, lp->lnum + 1))
+ {
+ /* Add a filler line. */
+ ++lp->fill;
+ lp->height = 1;
+ }
+ else
+#endif
+ {
+ ++lp->lnum;
+#ifdef FEAT_DIFF
+ lp->fill = 0;
+#endif
+ if (lp->lnum > curbuf->b_ml.ml_line_count)
+ lp->height = MAXCOL;
+ else
+#ifdef FEAT_FOLDING
+ if (hasFolding(lp->lnum, NULL, &lp->lnum))
+ /* Add a closed fold */
+ lp->height = 1;
+ else
+#endif
+ {
+#ifdef FEAT_DIFF
+ lp->height = plines_nofill(lp->lnum);
+#else
+ lp->height = plines(lp->lnum);
+#endif
+ }
+ }
+}
+
+#ifdef FEAT_DIFF
+/*
+ * Switch from including filler lines below lp->lnum to including filler
+ * lines above loff.lnum + 1. This keeps pointing to the same line.
+ * When there are no filler lines nothing changes.
+ */
+ static void
+botline_topline(lp)
+ lineoff_T *lp;
+{
+ if (lp->fill > 0)
+ {
+ ++lp->lnum;
+ lp->fill = diff_check_fill(curwin, lp->lnum) - lp->fill + 1;
+ }
+}
+
+/*
+ * Switch from including filler lines above lp->lnum to including filler
+ * lines below loff.lnum - 1. This keeps pointing to the same line.
+ * When there are no filler lines nothing changes.
+ */
+ static void
+topline_botline(lp)
+ lineoff_T *lp;
+{
+ if (lp->fill > 0)
+ {
+ lp->fill = diff_check_fill(curwin, lp->lnum) - lp->fill + 1;
+ --lp->lnum;
+ }
+}
+#endif
+
+/*
+ * Recompute topline to put the cursor at the top of the window.
+ * Scroll at least "min_scroll" lines.
+ * If "always" is TRUE, always set topline (for "zt").
+ */
+ void
+scroll_cursor_top(min_scroll, always)
+ int min_scroll;
+ int always;
+{
+ int scrolled = 0;
+ int extra = 0;
+ int used;
+ int i;
+ linenr_T top; /* just above displayed lines */
+ linenr_T bot; /* just below displayed lines */
+ linenr_T old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ linenr_T old_topfill = curwin->w_topfill;
+#endif
+ linenr_T new_topline;
+ int off = p_so;
+
+#ifdef FEAT_MOUSE
+ if (mouse_dragging > 0)
+ off = mouse_dragging - 1;
+#endif
+
+ /*
+ * Decrease topline until:
+ * - it has become 1
+ * - (part of) the cursor line is moved off the screen or
+ * - moved at least 'scrolljump' lines and
+ * - at least 'scrolloff' lines above and below the cursor
+ */
+ validate_cheight();
+ used = curwin->w_cline_height;
+ if (curwin->w_cursor.lnum < curwin->w_topline)
+ scrolled = used;
+
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_cursor.lnum, &top, &bot))
+ {
+ --top;
+ ++bot;
+ }
+ else
+#endif
+ {
+ top = curwin->w_cursor.lnum - 1;
+ bot = curwin->w_cursor.lnum + 1;
+ }
+ new_topline = top + 1;
+
+#ifdef FEAT_DIFF
+ /* count filler lines of the cursor window as context */
+ i = diff_check_fill(curwin, curwin->w_cursor.lnum);
+ used += i;
+ extra += i;
+#endif
+
+ /*
+ * Check if the lines from "top" to "bot" fit in the window. If they do,
+ * set new_topline and advance "top" and "bot" to include more lines.
+ */
+ while (top > 0)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(top, &top, NULL))
+ /* count one logical line for a sequence of folded lines */
+ i = 1;
+ else
+#endif
+ i = plines(top);
+ used += i;
+ if (extra + i <= off && bot < curbuf->b_ml.ml_line_count)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(bot, NULL, &bot))
+ /* count one logical line for a sequence of folded lines */
+ ++used;
+ else
+#endif
+ used += plines(bot);
+ }
+ if (used > curwin->w_height)
+ break;
+ if (top < curwin->w_topline)
+ scrolled += i;
+
+ /*
+ * If scrolling is needed, scroll at least 'sj' lines.
+ */
+ if ((new_topline >= curwin->w_topline || scrolled > min_scroll)
+ && extra >= off)
+ break;
+
+ extra += i;
+ new_topline = top;
+ --top;
+ ++bot;
+ }
+
+ /*
+ * If we don't have enough space, put cursor in the middle.
+ * This makes sure we get the same position when using "k" and "j"
+ * in a small window.
+ */
+ if (used > curwin->w_height)
+ scroll_cursor_halfway(FALSE);
+ else
+ {
+ /*
+ * If "always" is FALSE, only adjust topline to a lower value, higher
+ * value may happen with wrapping lines
+ */
+ if (new_topline < curwin->w_topline || always)
+ curwin->w_topline = new_topline;
+ if (curwin->w_topline > curwin->w_cursor.lnum)
+ curwin->w_topline = curwin->w_cursor.lnum;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = diff_check_fill(curwin, curwin->w_topline);
+ if (curwin->w_topfill > 0 && extra > off)
+ {
+ curwin->w_topfill -= extra - off;
+ if (curwin->w_topfill < 0)
+ curwin->w_topfill = 0;
+ }
+ check_topfill(curwin, FALSE);
+#endif
+ if (curwin->w_topline != old_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill != old_topfill
+#endif
+ )
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
+ curwin->w_valid |= VALID_TOPLINE;
+ }
+}
+
+/*
+ * Set w_empty_rows and w_filler_rows for window "wp", having used up "used"
+ * screen lines for text lines.
+ */
+ void
+set_empty_rows(wp, used)
+ win_T *wp;
+ int used;
+{
+#ifdef FEAT_DIFF
+ wp->w_filler_rows = 0;
+#endif
+ if (used == 0)
+ wp->w_empty_rows = 0; /* single line that doesn't fit */
+ else
+ {
+ wp->w_empty_rows = wp->w_height - used;
+#ifdef FEAT_DIFF
+ if (wp->w_botline <= wp->w_buffer->b_ml.ml_line_count)
+ {
+ wp->w_filler_rows = diff_check_fill(wp, wp->w_botline);
+ if (wp->w_empty_rows > wp->w_filler_rows)
+ wp->w_empty_rows -= wp->w_filler_rows;
+ else
+ {
+ wp->w_filler_rows = wp->w_empty_rows;
+ wp->w_empty_rows = 0;
+ }
+ }
+#endif
+ }
+}
+
+/*
+ * Recompute topline to put the cursor at the bottom of the window.
+ * Scroll at least "min_scroll" lines.
+ * If "set_topbot" is TRUE, set topline and botline first (for "zb").
+ * This is messy stuff!!!
+ */
+ void
+scroll_cursor_bot(min_scroll, set_topbot)
+ int min_scroll;
+ int set_topbot;
+{
+ int used;
+ int scrolled = 0;
+ int extra = 0;
+ int i;
+ linenr_T line_count;
+ linenr_T old_topline = curwin->w_topline;
+ lineoff_T loff;
+ lineoff_T boff;
+#ifdef FEAT_DIFF
+ int old_topfill = curwin->w_topfill;
+ int fill_below_window;
+#endif
+ linenr_T old_botline = curwin->w_botline;
+ linenr_T old_valid = curwin->w_valid;
+ int old_empty_rows = curwin->w_empty_rows;
+ linenr_T cln; /* Cursor Line Number */
+
+ cln = curwin->w_cursor.lnum;
+ if (set_topbot)
+ {
+ used = 0;
+ curwin->w_botline = cln + 1;
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+#endif
+ for (curwin->w_topline = curwin->w_botline;
+ curwin->w_topline > 1;
+ curwin->w_topline = loff.lnum)
+ {
+ loff.lnum = curwin->w_topline;
+ topline_back(&loff);
+ if (used + loff.height > curwin->w_height)
+ break;
+ used += loff.height;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = loff.fill;
+#endif
+ }
+ set_empty_rows(curwin, used);
+ curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
+ if (curwin->w_topline != old_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill != old_topfill
+#endif
+ )
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW);
+ }
+ else
+ validate_botline();
+
+ /* The lines of the cursor line itself are always used. */
+#ifdef FEAT_DIFF
+ used = plines_nofill(cln);
+#else
+ validate_cheight();
+ used = curwin->w_cline_height;
+#endif
+
+ /* If the cursor is below botline, we will at least scroll by the height
+ * of the cursor line. Correct for empty lines, which are really part of
+ * botline. */
+ if (cln >= curwin->w_botline)
+ {
+ scrolled = used;
+ if (cln == curwin->w_botline)
+ scrolled -= curwin->w_empty_rows;
+ }
+
+ /*
+ * Stop counting lines to scroll when
+ * - hitting start of the file
+ * - scrolled nothing or at least 'sj' lines
+ * - at least 'so' lines below the cursor
+ * - lines between botline and cursor have been counted
+ */
+#ifdef FEAT_FOLDING
+ if (!hasFolding(curwin->w_cursor.lnum, &loff.lnum, &boff.lnum))
+#endif
+ {
+ loff.lnum = cln;
+ boff.lnum = cln;
+ }
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+ boff.fill = 0;
+ fill_below_window = diff_check_fill(curwin, curwin->w_botline)
+ - curwin->w_filler_rows;
+#endif
+
+ while (loff.lnum > 1)
+ {
+ /* Stop when scrolled nothing or at least "min_scroll", found "extra"
+ * context for 'scrolloff' and counted all lines below the window. */
+ if ((((scrolled <= 0 || scrolled >= min_scroll)
+ && extra >= (
+#ifdef FEAT_MOUSE
+ mouse_dragging ? mouse_dragging - 1 :
+#endif
+ p_so))
+ || boff.lnum + 1 > curbuf->b_ml.ml_line_count)
+ && loff.lnum <= curwin->w_botline
+#ifdef FEAT_DIFF
+ && (loff.lnum < curwin->w_botline
+ || loff.fill >= fill_below_window)
+#endif
+ )
+ break;
+
+ /* Add one line above */
+ topline_back(&loff);
+ used += loff.height;
+ if (used > curwin->w_height)
+ break;
+ if (loff.lnum >= curwin->w_botline
+#ifdef FEAT_DIFF
+ && (loff.lnum > curwin->w_botline
+ || loff.fill <= fill_below_window)
+#endif
+ )
+ {
+ /* Count screen lines that are below the window. */
+ scrolled += loff.height;
+ if (loff.lnum == curwin->w_botline
+#ifdef FEAT_DIFF
+ && boff.fill == 0
+#endif
+ )
+ scrolled -= curwin->w_empty_rows;
+ }
+
+ if (boff.lnum < curbuf->b_ml.ml_line_count)
+ {
+ /* Add one line below */
+ botline_forw(&boff);
+ used += boff.height;
+ if (used > curwin->w_height)
+ break;
+ if (extra < (
+#ifdef FEAT_MOUSE
+ mouse_dragging > 0 ? mouse_dragging - 1 :
+#endif
+ p_so) || scrolled < min_scroll)
+ {
+ extra += boff.height;
+ if (boff.lnum >= curwin->w_botline
+#ifdef FEAT_DIFF
+ || (boff.lnum + 1 == curwin->w_botline
+ && boff.fill > curwin->w_filler_rows)
+#endif
+ )
+ {
+ /* Count screen lines that are below the window. */
+ scrolled += boff.height;
+ if (boff.lnum == curwin->w_botline
+#ifdef FEAT_DIFF
+ && boff.fill == 0
+#endif
+ )
+ scrolled -= curwin->w_empty_rows;
+ }
+ }
+ }
+ }
+
+ /* curwin->w_empty_rows is larger, no need to scroll */
+ if (scrolled <= 0)
+ line_count = 0;
+ /* more than a screenfull, don't scroll but redraw */
+ else if (used > curwin->w_height)
+ line_count = used;
+ /* scroll minimal number of lines */
+ else
+ {
+ line_count = 0;
+#ifdef FEAT_DIFF
+ boff.fill = curwin->w_topfill;
+#endif
+ boff.lnum = curwin->w_topline - 1;
+ for (i = 0; i < scrolled && boff.lnum < curwin->w_botline; )
+ {
+ botline_forw(&boff);
+ i += boff.height;
+ ++line_count;
+ }
+ if (i < scrolled) /* below curwin->w_botline, don't scroll */
+ line_count = 9999;
+ }
+
+ /*
+ * Scroll up if the cursor is off the bottom of the screen a bit.
+ * Otherwise put it at 1/2 of the screen.
+ */
+ if (line_count >= curwin->w_height && line_count > min_scroll)
+ scroll_cursor_halfway(FALSE);
+ else
+ scrollup(line_count, TRUE);
+
+ /*
+ * If topline didn't change we need to restore w_botline and w_empty_rows
+ * (we changed them).
+ * If topline did change, update_screen() will set botline.
+ */
+ if (curwin->w_topline == old_topline && set_topbot)
+ {
+ curwin->w_botline = old_botline;
+ curwin->w_empty_rows = old_empty_rows;
+ curwin->w_valid = old_valid;
+ }
+ curwin->w_valid |= VALID_TOPLINE;
+}
+
+/*
+ * Recompute topline to put the cursor halfway the window
+ * If "atend" is TRUE, also put it halfway at the end of the file.
+ */
+ void
+scroll_cursor_halfway(atend)
+ int atend;
+{
+ int above = 0;
+ linenr_T topline;
+#ifdef FEAT_DIFF
+ int topfill = 0;
+#endif
+ int below = 0;
+ int used;
+ lineoff_T loff;
+ lineoff_T boff;
+
+ loff.lnum = boff.lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_FOLDING
+ (void)hasFolding(loff.lnum, &loff.lnum, &boff.lnum);
+#endif
+#ifdef FEAT_DIFF
+ used = plines_nofill(loff.lnum);
+ loff.fill = 0;
+ boff.fill = 0;
+#else
+ used = plines(loff.lnum);
+#endif
+ topline = loff.lnum;
+ while (topline > 1)
+ {
+ if (below <= above) /* add a line below the cursor first */
+ {
+ if (boff.lnum < curbuf->b_ml.ml_line_count)
+ {
+ botline_forw(&boff);
+ used += boff.height;
+ if (used > curwin->w_height)
+ break;
+ below += boff.height;
+ }
+ else
+ {
+ ++below; /* count a "~" line */
+ if (atend)
+ ++used;
+ }
+ }
+
+ if (below > above) /* add a line above the cursor */
+ {
+ topline_back(&loff);
+ used += loff.height;
+ if (used > curwin->w_height)
+ break;
+ above += loff.height;
+ topline = loff.lnum;
+#ifdef FEAT_DIFF
+ topfill = loff.fill;
+#endif
+ }
+ }
+#ifdef FEAT_FOLDING
+ if (!hasFolding(topline, &curwin->w_topline, NULL))
+#endif
+ curwin->w_topline = topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = topfill;
+ check_topfill(curwin, FALSE);
+#endif
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
+ curwin->w_valid |= VALID_TOPLINE;
+}
+
+/*
+ * Correct the cursor position so that it is in a part of the screen at least
+ * 'so' lines from the top and bottom, if possible.
+ * If not possible, put it at the same position as scroll_cursor_halfway().
+ * When called topline must be valid!
+ */
+ void
+cursor_correct()
+{
+ int above = 0; /* screen lines above topline */
+ linenr_T topline;
+ int below = 0; /* screen lines below botline */
+ linenr_T botline;
+ int above_wanted, below_wanted;
+ linenr_T cln; /* Cursor Line Number */
+ int max_off;
+
+ /*
+ * How many lines we would like to have above/below the cursor depends on
+ * whether the first/last line of the file is on screen.
+ */
+ above_wanted = p_so;
+ below_wanted = p_so;
+#ifdef FEAT_MOUSE
+ if (mouse_dragging)
+ {
+ above_wanted = mouse_dragging - 1;
+ below_wanted = mouse_dragging - 1;
+ }
+#endif
+ if (curwin->w_topline == 1)
+ {
+ above_wanted = 0;
+ max_off = curwin->w_height / 2;
+ if (below_wanted > max_off)
+ below_wanted = max_off;
+ }
+ validate_botline();
+ if (curwin->w_botline == curbuf->b_ml.ml_line_count + 1
+#ifdef FEAT_MOUSE
+ && !mouse_dragging
+#endif
+ )
+ {
+ below_wanted = 0;
+ max_off = (curwin->w_height - 1) / 2;
+ if (above_wanted > max_off)
+ above_wanted = max_off;
+ }
+
+ /*
+ * If there are sufficient file-lines above and below the cursor, we can
+ * return now.
+ */
+ cln = curwin->w_cursor.lnum;
+ if (cln >= curwin->w_topline + above_wanted
+ && cln < curwin->w_botline - below_wanted
+#ifdef FEAT_FOLDING
+ && !hasAnyFolding(curwin)
+#endif
+ )
+ return;
+
+ /*
+ * Narrow down the area where the cursor can be put by taking lines from
+ * the top and the bottom until:
+ * - the desired context lines are found
+ * - the lines from the top is past the lines from the bottom
+ */
+ topline = curwin->w_topline;
+ botline = curwin->w_botline - 1;
+#ifdef FEAT_DIFF
+ /* count filler lines as context */
+ above = curwin->w_topfill;
+ below = curwin->w_filler_rows;
+#endif
+ while ((above < above_wanted || below < below_wanted) && topline < botline)
+ {
+ if (below < below_wanted && (below <= above || above >= above_wanted))
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(botline, &botline, NULL))
+ ++below;
+ else
+#endif
+ below += plines(botline);
+ --botline;
+ }
+ if (above < above_wanted && (above < below || below >= below_wanted))
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(topline, NULL, &topline))
+ ++above;
+ else
+#endif
+#ifndef FEAT_DIFF
+ above += plines(topline);
+#else
+ above += plines_nofill(topline);
+
+ /* Count filler lines below this line as context. */
+ if (topline < botline)
+ above += diff_check_fill(curwin, topline + 1);
+#endif
+ ++topline;
+ }
+ }
+ if (topline == botline || botline == 0)
+ curwin->w_cursor.lnum = topline;
+ else if (topline > botline)
+ curwin->w_cursor.lnum = botline;
+ else
+ {
+ if (cln < topline && curwin->w_topline > 1)
+ {
+ curwin->w_cursor.lnum = topline;
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW);
+ }
+ if (cln > botline && curwin->w_botline <= curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_cursor.lnum = botline;
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW);
+ }
+ }
+ curwin->w_valid |= VALID_TOPLINE;
+}
+
+static void get_scroll_overlap __ARGS((lineoff_T *lp, int dir));
+
+/*
+ * move screen 'count' pages up or down and update screen
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+onepage(dir, count)
+ int dir;
+ long count;
+{
+ long n;
+ int retval = OK;
+ lineoff_T loff;
+ linenr_T old_topline = curwin->w_topline;
+
+ if (curbuf->b_ml.ml_line_count == 1) /* nothing to do */
+ {
+ beep_flush();
+ return FAIL;
+ }
+
+ for ( ; count > 0; --count)
+ {
+ validate_botline();
+ /*
+ * It's an error to move a page up when the first line is already on
+ * the screen. It's an error to move a page down when the last line
+ * is on the screen and the topline is 'scrolloff' lines from the
+ * last line.
+ */
+ if (dir == FORWARD
+ ? ((curwin->w_topline >= curbuf->b_ml.ml_line_count - p_so)
+ && curwin->w_botline > curbuf->b_ml.ml_line_count)
+ : (curwin->w_topline == 1
+#ifdef FEAT_DIFF
+ && curwin->w_topfill ==
+ diff_check_fill(curwin, curwin->w_topline)
+#endif
+ ))
+ {
+ beep_flush();
+ retval = FAIL;
+ break;
+ }
+
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+#endif
+ if (dir == FORWARD)
+ {
+ /* at end of file */
+ if (curwin->w_botline > curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_topline = curbuf->b_ml.ml_line_count;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW);
+ }
+ else
+ {
+ /* For the overlap, start with the line just below the window
+ * and go upwards. */
+ loff.lnum = curwin->w_botline;
+#ifdef FEAT_DIFF
+ loff.fill = diff_check_fill(curwin, loff.lnum)
+ - curwin->w_filler_rows;
+#endif
+ get_scroll_overlap(&loff, -1);
+ curwin->w_topline = loff.lnum;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = loff.fill;
+ check_topfill(curwin, FALSE);
+#endif
+ curwin->w_cursor.lnum = curwin->w_topline;
+ curwin->w_valid &= ~(VALID_WCOL|VALID_CHEIGHT|VALID_WROW|
+ VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
+ }
+ }
+ else /* dir == BACKWARDS */
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topline == 1)
+ {
+ /* Include max number of filler lines */
+ max_topfill();
+ continue;
+ }
+#endif
+ /* Find the line at the top of the window that is going to be the
+ * line at the bottom of the window. Make sure this results in
+ * the same line as before doing CTRL-F. */
+ loff.lnum = curwin->w_topline - 1;
+#ifdef FEAT_DIFF
+ loff.fill = diff_check_fill(curwin, loff.lnum + 1)
+ - curwin->w_topfill;
+#endif
+ get_scroll_overlap(&loff, 1);
+
+ if (loff.lnum >= curbuf->b_ml.ml_line_count)
+ {
+ loff.lnum = curbuf->b_ml.ml_line_count;
+#ifdef FEAT_DIFF
+ loff.fill = 0;
+ }
+ else
+ {
+ botline_topline(&loff);
+#endif
+ }
+ curwin->w_cursor.lnum = loff.lnum;
+
+ /* Find the line just above the new topline to get the right line
+ * at the bottom of the window. */
+ n = 0;
+ while (n <= curwin->w_height && loff.lnum >= 1)
+ {
+ topline_back(&loff);
+ n += loff.height;
+ }
+ if (n <= curwin->w_height) /* at begin of file */
+ {
+ curwin->w_topline = 1;
+#ifdef FEAT_DIFF
+ max_topfill();
+#endif
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
+ }
+ else
+ {
+ /* Go two lines forward again. */
+#ifdef FEAT_DIFF
+ topline_botline(&loff);
+#endif
+ botline_forw(&loff);
+ botline_forw(&loff);
+#ifdef FEAT_DIFF
+ botline_topline(&loff);
+#endif
+#ifdef FEAT_FOLDING
+ /* We're at the wrong end of a fold now. */
+ (void)hasFolding(loff.lnum, &loff.lnum, NULL);
+#endif
+
+ /* Always scroll at least one line. Avoid getting stuck on
+ * very long lines. */
+ if (loff.lnum >= curwin->w_topline
+#ifdef FEAT_DIFF
+ && (loff.lnum > curwin->w_topline
+ || loff.fill >= curwin->w_topfill)
+#endif
+ )
+ {
+#ifdef FEAT_DIFF
+ /* First try using the maximum number of filler lines. If
+ * that's not enough, backup one line. */
+ loff.fill = curwin->w_topfill;
+ if (curwin->w_topfill < diff_check_fill(curwin,
+ curwin->w_topline))
+ max_topfill();
+ if (curwin->w_topfill == loff.fill)
+#endif
+ {
+ --curwin->w_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ }
+ comp_botline(curwin);
+ curwin->w_cursor.lnum = curwin->w_botline - 1;
+ curwin->w_valid &= ~(VALID_WCOL|VALID_CHEIGHT|
+ VALID_WROW|VALID_CROW);
+ }
+ else
+ {
+ curwin->w_topline = loff.lnum;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = loff.fill;
+ check_topfill(curwin, FALSE);
+#endif
+ curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
+ }
+ }
+ }
+ }
+#ifdef FEAT_FOLDING
+ foldAdjustCursor();
+#endif
+ cursor_correct();
+ beginline(BL_SOL | BL_FIX);
+ curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL);
+
+ /*
+ * Avoid the screen jumping up and down when 'scrolloff' is non-zero.
+ * But make sure we scroll at least one line (happens with mix of long
+ * wrapping lines and non-wrapping line).
+ */
+ if (retval == OK && dir == FORWARD && check_top_offset())
+ {
+ scroll_cursor_top(1, FALSE);
+ if (curwin->w_topline <= old_topline
+ && old_topline < curbuf->b_ml.ml_line_count)
+ {
+ curwin->w_topline = old_topline + 1;
+#ifdef FEAT_FOLDING
+ (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+ }
+ }
+
+ redraw_later(VALID);
+ return retval;
+}
+
+/*
+ * Decide how much overlap to use for page-up or page-down scrolling.
+ * This is symmetric, so that doing both keeps the same lines displayed.
+ * Three lines are examined:
+ *
+ * before CTRL-F after CTRL-F / before CTRL-B
+ * etc. l1
+ * l1 last but one line ------------
+ * l2 last text line l2 top text line
+ * ------------- l3 second text line
+ * l3 etc.
+ */
+ static void
+get_scroll_overlap(lp, dir)
+ lineoff_T *lp;
+ int dir;
+{
+ int h1, h2, h3, h4;
+ int min_height = curwin->w_height - 2;
+ lineoff_T loff0, loff1, loff2;
+
+#ifdef FEAT_DIFF
+ if (lp->fill > 0)
+ lp->height = 1;
+ else
+ lp->height = plines_nofill(lp->lnum);
+#else
+ lp->height = plines(lp->lnum);
+#endif
+ h1 = lp->height;
+ if (h1 > min_height)
+ return; /* no overlap */
+
+ loff0 = *lp;
+ if (dir > 0)
+ botline_forw(lp);
+ else
+ topline_back(lp);
+ h2 = lp->height;
+ if (h2 + h1 > min_height)
+ {
+ *lp = loff0; /* no overlap */
+ return;
+ }
+
+ loff1 = *lp;
+ if (dir > 0)
+ botline_forw(lp);
+ else
+ topline_back(lp);
+ h3 = lp->height;
+ if (h3 + h2 > min_height)
+ {
+ *lp = loff0; /* no overlap */
+ return;
+ }
+
+ loff2 = *lp;
+ if (dir > 0)
+ botline_forw(lp);
+ else
+ topline_back(lp);
+ h4 = lp->height;
+ if (h4 + h3 + h2 > min_height || h3 + h2 + h1 > min_height)
+ *lp = loff1; /* 1 line overlap */
+ else
+ *lp = loff2; /* 2 lines overlap */
+ return;
+}
+
+/* #define KEEP_SCREEN_LINE */
+/*
+ * Scroll 'scroll' lines up or down.
+ */
+ void
+halfpage(flag, Prenum)
+ int flag;
+ linenr_T Prenum;
+{
+ long scrolled = 0;
+ int i;
+ int n;
+ int room;
+
+ if (Prenum)
+ curwin->w_p_scr = (Prenum > curwin->w_height) ?
+ curwin->w_height : Prenum;
+ n = (curwin->w_p_scr <= curwin->w_height) ?
+ curwin->w_p_scr : curwin->w_height;
+
+ validate_botline();
+ room = curwin->w_empty_rows;
+#ifdef FEAT_DIFF
+ room += curwin->w_filler_rows;
+#endif
+ if (flag)
+ {
+ /*
+ * scroll the text up
+ */
+ while (n > 0 && curwin->w_botline <= curbuf->b_ml.ml_line_count)
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ {
+ i = 1;
+ if (--n < 0 && scrolled > 0)
+ break;
+ --curwin->w_topfill;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_DIFF
+ i = plines_nofill(curwin->w_topline);
+#else
+ i = plines(curwin->w_topline);
+#endif
+ n -= i;
+ if (n < 0 && scrolled > 0)
+ break;
+#ifdef FEAT_FOLDING
+ (void)hasFolding(curwin->w_topline, NULL, &curwin->w_topline);
+#endif
+ ++curwin->w_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = diff_check_fill(curwin, curwin->w_topline);
+#endif
+
+#ifndef KEEP_SCREEN_LINE
+ if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+ ++curwin->w_cursor.lnum;
+ curwin->w_valid &=
+ ~(VALID_VIRTCOL|VALID_CHEIGHT|VALID_WCOL);
+ }
+#endif
+ }
+ curwin->w_valid &= ~(VALID_CROW|VALID_WROW);
+ scrolled += i;
+
+ /*
+ * Correct w_botline for changed w_topline.
+ * Won't work when there are filler lines.
+ */
+#ifdef FEAT_DIFF
+ if (curwin->w_p_diff)
+ curwin->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
+ else
+#endif
+ {
+ room += i;
+ do
+ {
+ i = plines(curwin->w_botline);
+ if (i > room)
+ break;
+#ifdef FEAT_FOLDING
+ (void)hasFolding(curwin->w_botline, NULL,
+ &curwin->w_botline);
+#endif
+ ++curwin->w_botline;
+ room -= i;
+ } while (curwin->w_botline <= curbuf->b_ml.ml_line_count);
+ }
+ }
+
+#ifndef KEEP_SCREEN_LINE
+ /*
+ * When hit bottom of the file: move cursor down.
+ */
+ if (n > 0)
+ {
+# ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ while (--n >= 0
+ && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+ (void)hasFolding(curwin->w_cursor.lnum, NULL,
+ &curwin->w_cursor.lnum);
+ ++curwin->w_cursor.lnum;
+ }
+ }
+ else
+# endif
+ curwin->w_cursor.lnum += n;
+ check_cursor_lnum();
+ }
+#else
+ /* try to put the cursor in the same screen line */
+ while ((curwin->w_cursor.lnum < curwin->w_topline || scrolled > 0)
+ && curwin->w_cursor.lnum < curwin->w_botline - 1)
+ {
+ scrolled -= plines(curwin->w_cursor.lnum);
+ if (scrolled < 0 && curwin->w_cursor.lnum >= curwin->w_topline)
+ break;
+# ifdef FEAT_FOLDING
+ (void)hasFolding(curwin->w_cursor.lnum, NULL,
+ &curwin->w_cursor.lnum);
+# endif
+ ++curwin->w_cursor.lnum;
+ }
+#endif
+ }
+ else
+ {
+ /*
+ * scroll the text down
+ */
+ while (n > 0 && curwin->w_topline > 1)
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline))
+ {
+ i = 1;
+ if (--n < 0 && scrolled > 0)
+ break;
+ ++curwin->w_topfill;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_DIFF
+ i = plines_nofill(curwin->w_topline - 1);
+#else
+ i = plines(curwin->w_topline - 1);
+#endif
+ n -= i;
+ if (n < 0 && scrolled > 0)
+ break;
+ --curwin->w_topline;
+#ifdef FEAT_FOLDING
+ (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ }
+ curwin->w_valid &= ~(VALID_CROW|VALID_WROW|
+ VALID_BOTLINE|VALID_BOTLINE_AP);
+ scrolled += i;
+#ifndef KEEP_SCREEN_LINE
+ if (curwin->w_cursor.lnum > 1)
+ {
+ --curwin->w_cursor.lnum;
+ curwin->w_valid &= ~(VALID_VIRTCOL|VALID_CHEIGHT|VALID_WCOL);
+ }
+#endif
+ }
+#ifndef KEEP_SCREEN_LINE
+ /*
+ * When hit top of the file: move cursor up.
+ */
+ if (n > 0)
+ {
+ if (curwin->w_cursor.lnum <= (linenr_T)n)
+ curwin->w_cursor.lnum = 1;
+ else
+# ifdef FEAT_FOLDING
+ if (hasAnyFolding(curwin))
+ {
+ while (--n >= 0 && curwin->w_cursor.lnum > 1)
+ {
+ --curwin->w_cursor.lnum;
+ (void)hasFolding(curwin->w_cursor.lnum,
+ &curwin->w_cursor.lnum, NULL);
+ }
+ }
+ else
+# endif
+ curwin->w_cursor.lnum -= n;
+ }
+#else
+ /* try to put the cursor in the same screen line */
+ scrolled += n; /* move cursor when topline is 1 */
+ while (curwin->w_cursor.lnum > curwin->w_topline
+ && (scrolled > 0 || curwin->w_cursor.lnum >= curwin->w_botline))
+ {
+ scrolled -= plines(curwin->w_cursor.lnum - 1);
+ if (scrolled < 0 && curwin->w_cursor.lnum < curwin->w_botline)
+ break;
+ --curwin->w_cursor.lnum;
+# ifdef FEAT_FOLDING
+ foldAdjustCursor();
+# endif
+ }
+#endif
+ }
+# ifdef FEAT_FOLDING
+ /* Move cursor to first line of closed fold. */
+ foldAdjustCursor();
+# endif
+#ifdef FEAT_DIFF
+ check_topfill(curwin, !flag);
+#endif
+ cursor_correct();
+ beginline(BL_SOL | BL_FIX);
+ redraw_later(VALID);
+}
diff --git a/src/mysign b/src/mysign
new file mode 100644
index 000000000..1528e109c
--- /dev/null
+++ b/src/mysign
@@ -0,0 +1 @@
+=auto/configure-lastupdate=1084789875.25=configure.in@md5=8f2cf9135e297094c53080c53e541a0f-@buildcheck=2c92a9e4676b2304fab9af16f1664194
diff --git a/src/nbdebug.c b/src/nbdebug.c
new file mode 100644
index 000000000..daf87a856
--- /dev/null
+++ b/src/nbdebug.c
@@ -0,0 +1,182 @@
+/* vi:set ts=8 sts=8 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * NetBeans Debugging Tools. What are these tools and why are they important?
+ * There are two main tools here. The first tool is a tool for delaying or
+ * stopping gvim during startup. The second tool is a protocol log tool.
+ *
+ * The startup delay tool is called nbdebug_wait(). This is very important for
+ * debugging startup problems because gvim will be started automatically from
+ * netbeans and cannot be run directly from a debugger. The only way to debug
+ * a gvim started by netbeans is by attaching a debugger to it. Without this
+ * tool all starup code will have completed before you can get the pid and
+ * attach.
+ *
+ * The second tool is a log tool.
+ *
+ * This code must have NBDEBUG defined for it to be compiled into vim/gvim.
+ */
+
+#ifdef NBDEBUG
+
+#include <stdarg.h>
+
+#include "vim.h"
+
+FILE *nb_debug = NULL;
+u_int nb_dlevel = 0; /* nb_debug verbosity level */
+
+void nbdb(char *, ...);
+void nbtrace(char *, ...);
+
+static int lookup(char *);
+#ifndef FEAT_GUI_W32
+static int errorHandler(Display *, XErrorEvent *);
+#endif
+
+/*
+ * nbdebug_wait - This function can be used to delay or stop execution of vim.
+ * Its normally used to delay startup while attaching a
+ * debugger to a running process. Since workshop starts gvim
+ * from a background process this is the only way to debug
+ * startup problems.
+ */
+
+void nbdebug_wait(
+ u_int wait_flags, /* tells what to do */
+ char *wait_var, /* wait environment variable */
+ u_int wait_secs) /* how many seconds to wait */
+{
+
+ init_homedir(); /* not inited yet */
+#ifdef USE_WDDUMP
+ WDDump(0, 0, 0);
+#endif
+
+ /* for debugging purposes only */
+ if (wait_flags & WT_ENV && wait_var && getenv(wait_var) != NULL) {
+ sleep(atoi(getenv(wait_var)));
+ } else if (wait_flags & WT_WAIT && lookup("~/.gvimwait")) {
+ sleep(wait_secs > 0 && wait_secs < 120 ? wait_secs : 20);
+ } else if (wait_flags & WT_STOP && lookup("~/.gvimstop")) {
+ int w = 1;
+ while (w) {
+ ;
+ }
+ }
+} /* end nbdebug_wait */
+
+
+void
+nbdebug_log_init(
+ char *log_var, /* env var with log file */
+ char *level_var) /* env var with nb_debug level */
+{
+ char *file; /* possible nb_debug output file */
+ char *cp; /* nb_dlevel pointer */
+
+ if (log_var && (file = getenv(log_var)) != NULL) {
+ time_t now;
+
+ nb_debug = fopen(file, "a");
+ time(&now);
+ fprintf(nb_debug, "%s", asctime(localtime(&now)));
+ if (level_var && (cp = getenv(level_var)) != NULL) {
+ nb_dlevel = strtoul(cp, NULL, 0);
+ } else {
+ nb_dlevel = NB_TRACE; /* default level */
+ }
+ /* XSetErrorHandler(errorHandler); */
+ }
+
+} /* end nbdebug_log_init */
+
+
+
+
+void
+nbtrace(
+ char *fmt,
+ ...)
+{
+ va_list ap;
+
+ if (nb_debug!= NULL && (nb_dlevel & (NB_TRACE | NB_TRACE_VERBOSE))) {
+ va_start(ap, fmt);
+ vfprintf(nb_debug, fmt, ap);
+ va_end(ap);
+ fflush(nb_debug);
+ }
+
+} /* end nbtrace */
+
+
+void
+nbdbg(
+ char *fmt,
+ ...)
+{
+ va_list ap;
+
+ if (nb_debug != NULL) {
+ va_start(ap, fmt);
+ vfprintf(nb_debug, fmt, ap);
+ va_end(ap);
+ fflush(nb_debug);
+ }
+
+} /* end nbdbg */
+
+
+static int
+lookup(
+ char *file)
+{
+ char buf[BUFSIZ];
+
+ expand_env((char_u *) file, (char_u *) buf, BUFSIZ);
+ return
+#ifndef FEAT_GUI_W32
+ (access(buf, F_OK) == 0);
+#else
+ (access(buf, 0) == 0);
+#endif
+
+} /* end lookup */
+
+#ifndef FEAT_GUI_W32
+static int
+errorHandler(
+ Display *dpy,
+ XErrorEvent *err)
+{
+ char msg[256];
+ char buf[256];
+
+ XGetErrorText(dpy, err->error_code, msg, sizeof(msg));
+ nbdbg("\n\nNBDEBUG Vim: X Error of failed request: %s\n", msg);
+
+ sprintf(buf, "%d", err->request_code);
+ XGetErrorDatabaseText(dpy,
+ "XRequest", buf, "Unknown", msg, sizeof(msg));
+ nbdbg("\tMajor opcode of failed request: %d (%s)\n",
+ err->request_code, msg);
+ if (err->request_code > 128) {
+ nbdbg("\tMinor opcode of failed request: %d\n",
+ err->minor_code);
+ }
+
+ return 0;
+}
+#endif
+
+
+#endif /* NBDEBUG */
diff --git a/src/nbdebug.h b/src/nbdebug.h
new file mode 100644
index 000000000..46b2c0833
--- /dev/null
+++ b/src/nbdebug.h
@@ -0,0 +1,81 @@
+/* vi:set ts=8 sts=8 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+
+#ifndef NBDEBUG_H
+#define NBDEBUG_H
+
+#ifdef NBDEBUG
+
+#ifndef ASSERT
+#define ASSERT(c) \
+ if (!(c)) { \
+ fprintf(stderr, "Assertion failed: line %d, file %s\n", \
+ __LINE__, __FILE__); \
+ fflush(stderr); \
+ abort(); \
+ }
+#endif
+
+#define nbdebug(a) nbdbg##a
+
+#define NB_TRACE 0x00000001
+#define NB_TRACE_VERBOSE 0x00000002
+#define NB_TRACE_COLONCMD 0x00000004
+#define NB_DEBUG_ALL 0xffffffff
+
+#define NBDLEVEL(flags) (nb_debug != NULL && (nb_dlevel & (flags)))
+
+#define NBDEBUG_TRACE 1
+//#define NBDEBUG_SENSE 2
+
+typedef enum {
+ WT_ENV = 1, /* look for env var if set */
+ WT_WAIT, /* look for ~/.gvimwait if set */
+ WT_STOP /* look for ~/.gvimstop if set */
+} WtWait;
+
+
+void nbdbg(char *, ...);
+void nbtrace(char *, ...);
+
+void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs));
+void nbdebug_log_init __ARGS((char *log_var, char *level_var));
+
+extern FILE *nb_debug;
+extern u_int nb_dlevel; /* nb_debug verbosity level */
+
+# else /* not NBDEBUG */
+
+#ifndef ASSERT
+# define ASSERT(c)
+#endif
+
+/*
+ * The following 2 stubs are needed because a macro cannot be used because of
+ * the variable number of arguments.
+ */
+
+void
+nbdbg(
+ char *fmt,
+ ...)
+{
+}
+
+
+void
+nbtrace(
+ char *fmt,
+ ...)
+{
+}
+
+#endif /* NBDEBUG */
+#endif /* NBDEBUG_H */
diff --git a/src/netbeans.c b/src/netbeans.c
new file mode 100644
index 000000000..087f35be2
--- /dev/null
+++ b/src/netbeans.c
@@ -0,0 +1,3185 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Netbeans integration by David Weatherford
+ * Adopted for Win32 by Sergey Khorev
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Implements client side of org.netbeans.modules.emacs editor
+ * integration protocol. Be careful! The protocol uses offsets
+ * which are *between* characters, whereas vim uses line number
+ * and column number which are *on* characters.
+ * See ":help netbeans-protocol" for explanation.
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_NETBEANS_INTG) || defined(PROTO)
+
+/* Note: when making changes here also adjust configure.in. */
+# include <stdarg.h>
+# include <fcntl.h>
+#ifdef WIN32
+# ifdef DEBUG
+# include <tchar.h> /* for _T definition for TRACEn macros */
+# endif
+# include <io.h>
+/* WinSock API is separated from C API, thus we can't use read(), write(),
+ * errno... */
+# define sock_errno WSAGetLastError()
+# define ECONNREFUSED WSAECONNREFUSED
+# ifdef EINTR
+# undef EINTR
+# endif
+# define EINTR WSAEINTR
+# define sock_write(sd, buf, len) send(sd, buf, len, 0)
+# define sock_read(sd, buf, len) recv(sd, buf, len, 0)
+# define sock_close(sd) closesocket(sd)
+# define sleep(t) Sleep(t*1000) /* WinAPI Sleep() accepts milliseconds */
+#else
+# include <netdb.h>
+# include <netinet/in.h>
+# include <sys/socket.h>
+# ifdef HAVE_LIBGEN_H
+# include <libgen.h>
+# endif
+# define sock_errno errno
+# define sock_write(sd, buf, len) write(sd, buf, len)
+# define sock_read(sd, buf, len) read(sd, buf, len)
+# define sock_close(sd) close(sd)
+#endif
+
+#include "version.h"
+
+#define INET_SOCKETS
+
+#define GUARDED 10000 /* typenr for "guarded" annotation */
+#define GUARDEDOFFSET 1000000 /* base for "guarded" sign id's */
+
+/* The first implementation (working only with Netbeans) returned "1.1". The
+ * protocol implemented here also supports A-A-P. */
+static char *ExtEdProtocolVersion = "2.2";
+
+static long pos2off __ARGS((buf_T *, pos_T *));
+static pos_T *off2pos __ARGS((buf_T *, long));
+static pos_T *get_off_or_lnum __ARGS((buf_T *buf, char_u **argp));
+static long get_buf_size __ARGS((buf_T *));
+
+static void netbeans_connect __ARGS((void));
+static int getConnInfo __ARGS((char *file, char **host, char **port, char **password));
+
+static void nb_init_graphics __ARGS((void));
+static void coloncmd __ARGS((char *cmd, ...));
+#ifdef FEAT_GUI_MOTIF
+static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *));
+#endif
+#ifdef FEAT_GUI_GTK
+static void messageFromNetbeans __ARGS((gpointer, gint, GdkInputCondition));
+#endif
+static void nb_parse_cmd __ARGS((char_u *));
+static int nb_do_cmd __ARGS((int, char_u *, int, int, char_u *));
+static void nb_send __ARGS((char *buf, char *fun));
+#ifdef FEAT_BEVAL
+static void netbeans_beval_cb __ARGS((BalloonEval *beval, int state));
+#endif
+
+static int sd = -1; /* socket fd for Netbeans connection */
+#ifdef FEAT_GUI_MOTIF
+static XtInputId inputHandler; /* Cookie for input */
+#endif
+#ifdef FEAT_GUI_GTK
+static gint inputHandler; /* Cookie for input */
+#endif
+#ifdef FEAT_GUI_W32
+static int inputHandler = -1; /* simply ret.value of WSAAsyncSelect() */
+extern HWND s_hwnd; /* Gvim's Window handle */
+#endif
+static int cmdno; /* current command number for reply */
+static int haveConnection = FALSE; /* socket is connected and
+ initialization is done */
+static int oldFire = 1;
+static int exit_delay = 2; /* exit delay in seconds */
+
+#ifdef FEAT_BEVAL
+# if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)
+extern Widget textArea;
+# endif
+BalloonEval *balloonEval = NULL;
+#endif
+
+/*
+ * Include the debugging code if wanted.
+ */
+#ifdef NBDEBUG
+# include "nbdebug.c"
+#endif
+
+/* Connect back to Netbeans process */
+#if defined(FEAT_GUI_MOTIF) || defined(PROTO)
+ void
+netbeans_Xt_connect(void *context)
+{
+ netbeans_connect();
+ if (sd > 0)
+ {
+ /* tell notifier we are interested in being called
+ * when there is input on the editor connection socket
+ */
+ inputHandler = XtAppAddInput((XtAppContext)context, sd,
+ (XtPointer)(XtInputReadMask + XtInputExceptMask),
+ messageFromNetbeans, NULL);
+ }
+}
+
+ static void
+netbeans_disconnect(void)
+{
+ if (inputHandler != (XtInputId)NULL)
+ {
+ XtRemoveInput(inputHandler);
+ inputHandler = (XtInputId)NULL;
+ }
+ sd = -1;
+ haveConnection = FALSE;
+}
+#endif /* FEAT_MOTIF_GUI */
+
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
+ void
+netbeans_gtk_connect(void)
+{
+# ifdef FEAT_BEVAL
+ /*
+ * Set up the Balloon Expression Evaluation area.
+ * Always create it but disable it when 'ballooneval' isn't set.
+ */
+ balloonEval = gui_mch_create_beval_area(gui.drawarea, NULL,
+ &netbeans_beval_cb, NULL);
+ if (!p_beval)
+ gui_mch_disable_beval_area(balloonEval);
+# endif
+
+ netbeans_connect();
+ if (sd > 0)
+ {
+ /*
+ * Tell gdk we are interested in being called when there
+ * is input on the editor connection socket
+ */
+ inputHandler = gdk_input_add(sd, (GdkInputCondition)
+ ((int)GDK_INPUT_READ + (int)GDK_INPUT_EXCEPTION),
+ messageFromNetbeans, NULL);
+ }
+}
+
+ static void
+netbeans_disconnect(void)
+{
+ if (inputHandler != 0)
+ {
+ gdk_input_remove(inputHandler);
+ inputHandler = 0;
+ }
+ sd = -1;
+ haveConnection = FALSE;
+}
+#endif /* FEAT_GUI_GTK */
+
+#if defined(FEAT_GUI_W32) || defined(PROTO)
+ void
+netbeans_w32_connect(void)
+{
+ netbeans_connect();
+ if (sd > 0)
+ {
+ /*
+ * Tell Windows we are interested in receiving message when there
+ * is input on the editor connection socket
+ */
+ inputHandler = WSAAsyncSelect(sd, s_hwnd, WM_NETBEANS, FD_READ);
+ }
+}
+
+ static void
+netbeans_disconnect(void)
+{
+ if (inputHandler == 0)
+ {
+ WSAAsyncSelect(sd, s_hwnd, 0, 0);
+ inputHandler = -1;
+ }
+ sd = -1;
+ haveConnection = FALSE;
+
+ /* It seems that Motif and GTK versions also need this: */
+ gui_mch_destroy_beval_area(balloonEval);
+ balloonEval = NULL;
+}
+#endif /* FEAT_GUI_W32 */
+
+#define NB_DEF_HOST "localhost"
+#define NB_DEF_ADDR "3219"
+#define NB_DEF_PASS "changeme"
+
+ static void
+netbeans_connect(void)
+{
+#ifdef INET_SOCKETS
+ struct sockaddr_in server;
+ struct hostent * host;
+# ifdef FEAT_GUI_W32
+ u_short port;
+# else
+ int port;
+#endif
+#else
+ struct sockaddr_un server;
+#endif
+ char buf[32];
+ char *hostname = NULL;
+ char *address = NULL;
+ char *password = NULL;
+ char *fname;
+ char *arg = NULL;
+
+ if (netbeansArg[3] == '=')
+ {
+ /* "-nb=fname": Read info from specified file. */
+ if (getConnInfo(netbeansArg + 4, &hostname, &address, &password)
+ == FAIL)
+ return;
+ }
+ else
+ {
+ if (netbeansArg[3] == ':')
+ /* "-nb:<host>:<addr>:<password>": get info from argument */
+ arg = netbeansArg + 4;
+ if (arg == NULL && (fname = getenv("__NETBEANS_CONINFO")) != NULL)
+ {
+ /* "-nb": get info from file specified in environment */
+ if (getConnInfo(fname, &hostname, &address, &password) == FAIL)
+ return;
+ }
+ else
+ {
+ if (arg != NULL)
+ {
+ /* "-nb:<host>:<addr>:<password>": get info from argument */
+ hostname = arg;
+ address = strchr(hostname, ':');
+ if (address != NULL)
+ {
+ *address++ = '\0';
+ password = strchr(address, ':');
+ if (password != NULL)
+ *password++ = '\0';
+ }
+ }
+
+ /* Get the missing values from the environment. */
+ if (hostname == NULL || *hostname == '\0')
+ hostname = getenv("__NETBEANS_HOST");
+ if (address == NULL)
+ address = getenv("__NETBEANS_SOCKET");
+ if (password == NULL)
+ password = getenv("__NETBEANS_VIM_PASSWORD");
+
+ /* Move values to allocated memory. */
+ if (hostname != NULL)
+ hostname = (char *)vim_strsave((char_u *)hostname);
+ if (address != NULL)
+ address = (char *)vim_strsave((char_u *)address);
+ if (password != NULL)
+ password = (char *)vim_strsave((char_u *)password);
+ }
+ }
+
+ /* Use the default when a value is missing. */
+ if (hostname == NULL || *hostname == '\0')
+ {
+ vim_free(hostname);
+ hostname = (char *)vim_strsave((char_u *)NB_DEF_HOST);
+ }
+ if (address == NULL || *address == '\0')
+ {
+ vim_free(address);
+ address = (char *)vim_strsave((char_u *)NB_DEF_ADDR);
+ }
+ if (password == NULL || *password == '\0')
+ {
+ vim_free(password);
+ password = (char *)vim_strsave((char_u *)NB_DEF_PASS);
+ }
+ if (hostname == NULL || address == NULL || password == NULL)
+ goto theend; /* out of memory */
+
+#ifdef INET_SOCKETS
+ port = atoi(address);
+
+ if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+ {
+ PERROR("socket() in netbeans_connect()");
+ goto theend;
+ }
+
+ /* Get the server internet address and put into addr structure */
+ /* fill in the socket address structure and connect to server */
+ memset((char *)&server, '\0', sizeof(server));
+ server.sin_family = AF_INET;
+ server.sin_port = htons(port);
+ if ((host = gethostbyname(hostname)) == NULL)
+ {
+ if (mch_access(hostname, R_OK) >= 0)
+ {
+ /* DEBUG: input file */
+ sd = mch_open(hostname, O_RDONLY, 0);
+ goto theend;
+ }
+ PERROR("gethostbyname() in netbeans_connect()");
+ sd = -1;
+ goto theend;
+ }
+ memcpy((char *)&server.sin_addr, host->h_addr, host->h_length);
+#else
+ if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ {
+ PERROR("socket()");
+ goto theend;
+ }
+
+ server.sun_family = AF_UNIX;
+ strcpy(server.sun_path, address);
+#endif
+ /* Connect to server */
+ if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
+ {
+ nbdebug(("netbeans_connect: Connect failed with errno %d\n", sock_errno));
+ if (sock_errno == ECONNREFUSED)
+ {
+ sock_close(sd);
+#ifdef INET_SOCKETS
+ if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+ {
+ PERROR("socket()#2 in netbeans_connect()");
+ goto theend;
+ }
+#else
+ if ((sd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ {
+ PERROR("socket()#2 in netbeans_connect()");
+ goto theend;
+ }
+#endif
+ if (connect(sd, (struct sockaddr *)&server, sizeof(server)))
+ {
+ int retries = 36;
+ int success = FALSE;
+ while (retries--
+ && ((sock_errno == ECONNREFUSED) || (sock_errno == EINTR)))
+ {
+ nbdebug(("retrying...\n"));
+ sleep(5);
+ if (connect(sd, (struct sockaddr *)&server,
+ sizeof(server)) == 0)
+ {
+ success = TRUE;
+ break;
+ }
+ }
+ if (!success)
+ {
+ /* Get here when the server can't be found. */
+ PERROR(_("Cannot connect to Netbeans #2"));
+ getout(1);
+ }
+ }
+
+ }
+ else
+ {
+ PERROR(_("Cannot connect to Netbeans"));
+ getout(1);
+ }
+ }
+
+ sprintf(buf, "AUTH %s\n", password);
+ nb_send(buf, "netbeans_connect");
+
+ sprintf(buf, "0:version=0 \"%s\"\n", ExtEdProtocolVersion);
+ nb_send(buf, "externaleditor_version");
+
+ nbdebug(("netbeans_connect: Connection succeeded\n"));
+
+/* nb_init_graphics(); delay until needed */
+
+ haveConnection = TRUE;
+
+theend:
+ vim_free(hostname);
+ vim_free(address);
+ vim_free(password);
+ return;
+}
+
+/*
+ * Obtain the NetBeans hostname, port address and password from a file.
+ * Return the strings in allocated memory.
+ * Return FAIL if the file could not be read, OK otherwise (no matter what it
+ * contains).
+ */
+ static int
+getConnInfo(char *file, char **host, char **port, char **auth)
+{
+ FILE *fp;
+ char_u buf[BUFSIZ];
+ char_u *lp;
+ char_u *nl;
+#ifdef UNIX
+ struct stat st;
+
+ /*
+ * For Unix only accept the file when it's not accessible by others.
+ * The open will then fail if we don't own the file.
+ */
+ if (mch_stat(file, &st) == 0 && (st.st_mode & 0077) != 0)
+ {
+ EMSG2(_("E668: Wrong access mode for NetBeans connection info file: \"%s\""),
+ file);
+ return FAIL;
+ }
+#endif
+
+ fp = mch_fopen(file, "r");
+ if (fp == NULL)
+ {
+ PERROR("E660: Cannot open NetBeans connection info file");
+ return FAIL;
+ }
+
+ /* Read the file. There should be one of each parameter */
+ while ((lp = (char_u *)fgets((char *)buf, BUFSIZ, fp)) != NULL)
+ {
+ if ((nl = vim_strchr(lp, '\n')) != NULL)
+ *nl = 0; /* strip off the trailing newline */
+
+ if (STRNCMP(lp, "host=", 5) == 0)
+ {
+ vim_free(*host);
+ *host = (char *)vim_strsave(&buf[5]);
+ }
+ else if (STRNCMP(lp, "port=", 5) == 0)
+ {
+ vim_free(*port);
+ *port = (char *)vim_strsave(&buf[5]);
+ }
+ else if (STRNCMP(lp, "auth=", 5) == 0)
+ {
+ vim_free(*auth);
+ *auth = (char *)vim_strsave(&buf[5]);
+ }
+ }
+ fclose(fp);
+
+ return OK;
+}
+
+
+struct keyqueue
+{
+ int key;
+ struct keyqueue *next;
+ struct keyqueue *prev;
+};
+
+typedef struct keyqueue keyQ_T;
+
+static keyQ_T keyHead; /* dummy node, header for circular queue */
+
+
+/*
+ * Queue up key commands sent from netbeans.
+ */
+ static void
+postpone_keycommand(int key)
+{
+ keyQ_T *node;
+
+ node = (keyQ_T *)alloc(sizeof(keyQ_T));
+
+ if (keyHead.next == NULL) /* initialize circular queue */
+ {
+ keyHead.next = &keyHead;
+ keyHead.prev = &keyHead;
+ }
+
+ /* insert node at tail of queue */
+ node->next = &keyHead;
+ node->prev = keyHead.prev;
+ keyHead.prev->next = node;
+ keyHead.prev = node;
+
+ node->key = key;
+}
+
+/*
+ * Handle any queued-up NetBeans keycommands to be send.
+ */
+ static void
+handle_key_queue(void)
+{
+ while (keyHead.next && keyHead.next != &keyHead)
+ {
+ /* first, unlink the node */
+ keyQ_T *node = keyHead.next;
+ keyHead.next = node->next;
+ node->next->prev = node->prev;
+
+ /* now, send the keycommand */
+ netbeans_keycommand(node->key);
+
+ /* Finally, dispose of the node */
+ vim_free(node);
+ }
+}
+
+
+struct cmdqueue
+{
+ char_u *buffer;
+ struct cmdqueue *next;
+ struct cmdqueue *prev;
+};
+
+typedef struct cmdqueue queue_T;
+
+static queue_T head; /* dummy node, header for circular queue */
+
+
+/*
+ * Put the buffer on the work queue; possibly save it to a file as well.
+ */
+ static void
+save(char_u *buf, int len)
+{
+ queue_T *node;
+
+ node = (queue_T *)alloc(sizeof(queue_T));
+ if (node == NULL)
+ return; /* out of memory */
+ node->buffer = alloc(len + 1);
+ if (node->buffer == NULL)
+ {
+ vim_free(node);
+ return; /* out of memory */
+ }
+ mch_memmove(node->buffer, buf, (size_t)len);
+ node->buffer[len] = NUL;
+
+ if (head.next == NULL) /* initialize circular queue */
+ {
+ head.next = &head;
+ head.prev = &head;
+ }
+
+ /* insert node at tail of queue */
+ node->next = &head;
+ node->prev = head.prev;
+ head.prev->next = node;
+ head.prev = node;
+
+#ifdef NBDEBUG
+ {
+ static int outfd = -2;
+
+ /* possibly write buffer out to a file */
+ if (outfd == -3)
+ return;
+
+ if (outfd == -2)
+ {
+ char *file = getenv("__NETBEANS_SAVE");
+ if (file == NULL)
+ outfd = -3;
+ else
+ outfd = mch_open(file, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ }
+
+ if (outfd >= 0)
+ write(outfd, buf, len);
+ }
+#endif
+}
+
+
+/*
+ * While there's still a command in the work queue, parse and execute it.
+ */
+ static void
+nb_parse_messages(void)
+{
+ char_u *p;
+ queue_T *node;
+
+ while (head.next != &head)
+ {
+ node = head.next;
+
+ /* Locate the first line in the first buffer. */
+ p = vim_strchr(node->buffer, '\n');
+ if (p == NULL)
+ {
+ /* Command isn't complete. If there is no following buffer,
+ * return (wait for more). If there is another buffer following,
+ * prepend the text to that buffer and delete this one. */
+ if (node->next == &head)
+ return;
+ p = alloc(STRLEN(node->buffer) + STRLEN(node->next->buffer) + 1);
+ if (p == NULL)
+ return; /* out of memory */
+ STRCPY(p, node->buffer);
+ STRCAT(p, node->next->buffer);
+ vim_free(node->next->buffer);
+ node->next->buffer = p;
+
+ /* dispose of the node and buffer */
+ head.next = node->next;
+ node->next->prev = node->prev;
+ vim_free(node->buffer);
+ vim_free(node);
+ }
+ else
+ {
+ /* There is a complete command at the start of the buffer.
+ * Terminate it with a NUL. When no more text is following unlink
+ * the buffer. Do this before executing, because new buffers can
+ * be added while busy handling the command. */
+ *p++ = NUL;
+ if (*p == NUL)
+ {
+ head.next = node->next;
+ node->next->prev = node->prev;
+ }
+
+ /* now, parse and execute the commands */
+ nb_parse_cmd(node->buffer);
+
+ if (*p == NUL)
+ {
+ /* buffer finished, dispose of the node and buffer */
+ vim_free(node->buffer);
+ vim_free(node);
+ }
+ else
+ {
+ /* more follows, move to the start */
+ mch_memmove(node->buffer, p, STRLEN(p) + 1);
+ }
+ }
+ }
+}
+
+/* Buffer size for reading incoming messages. */
+#define MAXMSGSIZE 4096
+
+/*
+ * Read and process a command from netbeans.
+ */
+/*ARGSUSED*/
+#if defined(FEAT_GUI_W32) || defined(PROTO)
+/* Use this one when generating prototypes, the others are static. */
+ void
+messageFromNetbeansW32()
+#else
+# ifdef FEAT_GUI_MOTIF
+ static void
+messageFromNetbeans(XtPointer clientData, int *unused1, XtInputId *unused2)
+# endif
+# ifdef FEAT_GUI_GTK
+ static void
+messageFromNetbeans(gpointer clientData, gint unused1,
+ GdkInputCondition unused2)
+# endif
+#endif
+{
+ static char_u *buf = NULL;
+ int len;
+ int readlen = 0;
+ static int level = 0;
+
+ if (sd < 0)
+ {
+ nbdebug(("messageFromNetbeans() called without a socket\n"));
+ return;
+ }
+
+ ++level; /* recursion guard; this will be called from the X event loop */
+
+ /* Allocate a buffer to read into. */
+ if (buf == NULL)
+ {
+ buf = alloc(MAXMSGSIZE);
+ if (buf == NULL)
+ return; /* out of memory! */
+ }
+
+ /* Keep on reading for as long as there is something to read. */
+ for (;;)
+ {
+ len = sock_read(sd, buf, MAXMSGSIZE);
+ if (len <= 0)
+ break; /* error or nothing more to read */
+
+ /* Store the read message in the queue. */
+ save(buf, len);
+ readlen += len;
+ if (len < MAXMSGSIZE)
+ break; /* did read everything that's available */
+ }
+
+ if (readlen <= 0)
+ {
+ /* read error or didn't read anything */
+ netbeans_disconnect();
+ nbdebug(("messageFromNetbeans: Error in read() from socket\n"));
+ if (len < 0)
+ PERROR(_("read from Netbeans socket"));
+ return; /* don't try to parse it */;
+ }
+
+ /* Parse the messages, but avoid recursion. */
+ if (level == 1)
+ nb_parse_messages();
+
+ --level;
+}
+
+/*
+ * Handle one NUL terminated command.
+ *
+ * format of a command from netbeans:
+ *
+ * 6:setTitle!84 "a.c"
+ *
+ * bufno
+ * colon
+ * cmd
+ * !
+ * cmdno
+ * args
+ *
+ * for function calls, the ! is replaced by a /
+ */
+ static void
+nb_parse_cmd(char_u *cmd)
+{
+ char_u *verb;
+ char_u *q;
+ int bufno;
+ int isfunc = -1;
+
+ if (STRCMP(cmd, "DISCONNECT") == 0)
+ {
+ /* We assume the server knows that we can safely exit! */
+ if (sd >= 0)
+ sock_close(sd);
+ /* Disconnect before exiting, Motif hangs in a Select error
+ * message otherwise. */
+ netbeans_disconnect();
+ getout(0);
+ /* NOTREACHED */
+ }
+
+ if (STRCMP(cmd, "DETACH") == 0)
+ {
+ /* The IDE is breaking the connection. */
+ if (sd >= 0)
+ sock_close(sd);
+ netbeans_disconnect();
+ return;
+ }
+
+ bufno = strtol((char *)cmd, (char **)&verb, 10);
+
+ if (*verb != ':')
+ {
+ EMSG2("E627: missing colon: %s", cmd);
+ return;
+ }
+ ++verb; /* skip colon */
+
+ for (q = verb; *q; q++)
+ {
+ if (*q == '!')
+ {
+ *q++ = NUL;
+ isfunc = 0;
+ break;
+ }
+ else if (*q == '/')
+ {
+ *q++ = NUL;
+ isfunc = 1;
+ break;
+ }
+ }
+
+ if (isfunc < 0)
+ {
+ EMSG2("E628: missing ! or / in: %s", cmd);
+ return;
+ }
+
+ cmdno = strtol((char *)q, (char **)&q, 10);
+
+ q = skipwhite(q);
+
+ if (nb_do_cmd(bufno, verb, isfunc, cmdno, q) == FAIL)
+ {
+ nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd));
+ EMSG("E629: bad return from nb_do_cmd");
+ }
+}
+
+struct nbbuf_struct
+{
+ buf_T *bufp;
+ unsigned int fireChanges:1;
+ unsigned int initDone:1;
+ unsigned int modified:1;
+ char *displayname;
+ char_u *partial_line;
+ int *signmap;
+ short_u signmaplen;
+ short_u signmapused;
+};
+
+typedef struct nbbuf_struct nbbuf_T;
+
+static nbbuf_T *buf_list = 0;
+int buf_list_size = 0; /* size of buf_list */
+int buf_list_used = 0; /* nr of entries in buf_list actually in use */
+
+static char **globalsignmap;
+static int globalsignmaplen;
+static int globalsignmapused;
+
+static int mapsigntype __ARGS((nbbuf_T *, int localsigntype));
+static void addsigntype __ARGS((nbbuf_T *, int localsigntype, char_u *typeName,
+ char_u *tooltip, char_u *glyphfile,
+ int usefg, int fg, int usebg, int bg));
+
+static int curPCtype = -1;
+
+/*
+ * Get the Netbeans buffer number for the specified buffer.
+ */
+ static int
+nb_getbufno(buf_T *bufp)
+{
+ int i;
+
+ for (i = 0; i < buf_list_used; i++)
+ if (buf_list[i].bufp == bufp)
+ return i;
+ return -1;
+}
+
+/*
+ * Is this a NetBeans-owned buffer?
+ */
+ int
+isNetbeansBuffer(buf_T *bufp)
+{
+ return bufp->b_netbeans_file;
+}
+
+/*
+ * NetBeans and Vim have different undo models. In Vim, the file isn't
+ * changed if changes are undone via the undo command. In NetBeans, once
+ * a change has been made the file is marked as modified until saved. It
+ * doesn't matter if the change was undone.
+ *
+ * So this function is for the corner case where Vim thinks a buffer is
+ * unmodified but NetBeans thinks it IS modified.
+ */
+ int
+isNetbeansModified(buf_T *bufp)
+{
+ int bufno = nb_getbufno(bufp);
+
+ if (bufno > 0)
+ return buf_list[bufno].modified;
+ else
+ return FALSE;
+}
+
+/*
+ * Given a Netbeans buffer number, return the netbeans buffer.
+ * Returns NULL for 0 or a negative number. A 0 bufno means a
+ * non-buffer related command has been sent.
+ */
+ static nbbuf_T *
+nb_get_buf(int bufno)
+{
+ /* find or create a buffer with the given number */
+ int incr;
+
+ if (bufno <= 0)
+ return NULL;
+
+ if (!buf_list)
+ {
+ /* initialize */
+ buf_list = (nbbuf_T *)alloc_clear(100 * sizeof(nbbuf_T));
+ buf_list_size = 100;
+ }
+ if (bufno >= buf_list_used) /* new */
+ {
+ if (bufno >= buf_list_size) /* grow list */
+ {
+ incr = bufno - buf_list_size + 90;
+ buf_list_size += incr;
+ buf_list = (nbbuf_T *)vim_realloc(
+ buf_list, buf_list_size * sizeof(nbbuf_T));
+ memset(buf_list + buf_list_size - incr, 0, incr * sizeof(nbbuf_T));
+ }
+
+ while (buf_list_used <= bufno)
+ {
+ /* Default is to fire text changes. */
+ buf_list[buf_list_used].fireChanges = 1;
+ ++buf_list_used;
+ }
+ }
+
+ return buf_list + bufno;
+}
+
+/*
+ * Return the number of buffers that are modified.
+ */
+ static int
+count_changed_buffers(void)
+{
+ buf_T *bufp;
+ int n;
+
+ n = 0;
+ for (bufp = firstbuf; bufp != NULL; bufp = bufp->b_next)
+ if (bufp->b_changed)
+ ++n;
+ return n;
+}
+
+/*
+ * End the netbeans session.
+ */
+ void
+netbeans_end(void)
+{
+ int i;
+ static char buf[128];
+
+ if (!haveConnection)
+ return;
+
+ for (i = 0; i < buf_list_used; i++)
+ {
+ if (!buf_list[i].bufp)
+ continue;
+ if (netbeansForcedQuit)
+ {
+ /* mark as unmodified so NetBeans won't put up dialog on "killed" */
+ sprintf(buf, "%d:unmodified=%d\n", i, cmdno);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_end");
+ }
+ sprintf(buf, "%d:killed=%d\n", i, cmdno);
+ nbdebug(("EVT: %s", buf));
+/* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
+ if (sd >= 0)
+ sock_write(sd, buf, STRLEN(buf)); /* ignore errors */
+ }
+
+ /* Give NetBeans a chance to write some clean-up cmds to the socket before
+ * we close the connection. Other clients may set the delay to zero. */
+ if (exit_delay > 0)
+ sleep(exit_delay);
+}
+
+/*
+ * Send a message to netbeans.
+ */
+ static void
+nb_send(char *buf, char *fun)
+{
+ /* Avoid giving pages full of error messages when the other side has
+ * exited, only mention the first error until the connection works again. */
+ static int did_error = FALSE;
+
+ if (sd < 0)
+ {
+ if (!did_error)
+ EMSG2("E630: %s(): write while not connected", fun);
+ did_error = TRUE;
+ }
+ else if (sock_write(sd, buf, STRLEN(buf)) != (int)STRLEN(buf))
+ {
+ if (!did_error)
+ EMSG2("E631: %s(): write failed", fun);
+ did_error = TRUE;
+ }
+ else
+ did_error = FALSE;
+}
+
+/*
+ * Some input received from netbeans requires a response. This function
+ * handles a response with no information (except the command number).
+ */
+ static void
+nb_reply_nil(int cmdno)
+{
+ char reply[32];
+
+ if (!haveConnection)
+ return;
+
+ sprintf(reply, "%d\n", cmdno);
+
+ nbdebug((" REPLY: %s", reply));
+
+ nb_send(reply, "nb_reply_nil");
+}
+
+
+/*
+ * Send a response with text.
+ * "result" must have been quoted already (using nb_quote()).
+ */
+ static void
+nb_reply_text(int cmdno, char_u *result)
+{
+ char_u *reply;
+
+ if (!haveConnection)
+ return;
+
+ reply = alloc(STRLEN(result) + 32);
+ sprintf((char *)reply, "%d %s\n", cmdno, (char *)result);
+
+ nbdebug((" REPLY: %s", reply));
+ nb_send((char *)reply, "nb_reply_text");
+
+ vim_free(reply);
+}
+
+
+/*
+ * Send a response with a number result code.
+ */
+ static void
+nb_reply_nr(int cmdno, long result)
+{
+ char reply[32];
+
+ if (!haveConnection)
+ return;
+
+ sprintf(reply, "%d %ld\n", cmdno, result);
+
+ nbdebug(("REPLY: %s", reply));
+
+ nb_send(reply, "nb_reply_nr");
+}
+
+
+/*
+ * Encode newline, ret, backslash, double quote for transmission to NetBeans.
+ */
+ static char_u *
+nb_quote(char_u *txt)
+{
+ char_u *buf = alloc(2 * STRLEN(txt) + 1);
+ char_u *p = txt;
+ char_u *q = buf;
+
+ if (buf == NULL)
+ return NULL;
+ for (; *p; p++)
+ {
+ switch (*p)
+ {
+ case '\"':
+ case '\\':
+ *q++ = '\\'; *q++ = *p; break;
+ /* case '\t': */
+ /* *q++ = '\\'; *q++ = 't'; break; */
+ case '\n':
+ *q++ = '\\'; *q++ = 'n'; break;
+ case '\r':
+ *q++ = '\\'; *q++ = 'r'; break;
+ default:
+ *q++ = *p;
+ break;
+ }
+ }
+ *q++ = '\0';
+
+ return buf;
+}
+
+
+/*
+ * Remove top level double quotes; convert backslashed chars.
+ * Returns an allocated string (NULL for failure).
+ * If "endp" is not NULL it is set to the character after the terminating
+ * quote.
+ */
+ static char *
+nb_unquote(char_u *p, char_u **endp)
+{
+ char *result = 0;
+ char *q;
+ int done = 0;
+
+ /* result is never longer than input */
+ result = (char *)alloc_clear(STRLEN(p) + 1);
+ if (result == NULL)
+ return NULL;
+
+ if (*p++ != '"')
+ {
+ nbdebug(("nb_unquote called with string that doesn't start with a quote!: %s\n",
+ p));
+ result[0] = NUL;
+ return result;
+ }
+
+ for (q = result; !done && *p != NUL;)
+ {
+ switch (*p)
+ {
+ case '"':
+ /*
+ * Unbackslashed dquote marks the end, if first char was dquote.
+ */
+ done = 1;
+ break;
+
+ case '\\':
+ ++p;
+ switch (*p)
+ {
+ case '\\': *q++ = '\\'; break;
+ case 'n': *q++ = '\n'; break;
+ case 't': *q++ = '\t'; break;
+ case 'r': *q++ = '\r'; break;
+ case '"': *q++ = '"'; break;
+ case NUL: --p; break;
+ /* default: skip over illegal chars */
+ }
+ ++p;
+ break;
+
+ default:
+ *q++ = *p++;
+ }
+ }
+
+ if (endp != NULL)
+ *endp = p;
+
+ return result;
+}
+
+#define SKIP_STOP 2
+#define streq(a,b) (strcmp(a,b) == 0)
+static int needupdate = 0;
+static int inAtomic = 0;
+
+/*
+ * Do the actual processing of a single netbeans command or function.
+ * The differance between a command and function is that a function
+ * gets a response (its required) but a command does not.
+ * For arguments see comment for nb_parse_cmd().
+ */
+ static int
+nb_do_cmd(
+ int bufno,
+ char_u *cmd,
+ int func,
+ int cmdno,
+ char_u *args) /* points to space before arguments or NUL */
+{
+ int doupdate = 0;
+ long off = 0;
+ nbbuf_T *buf = nb_get_buf(bufno);
+ static int skip = 0;
+ int retval = OK;
+
+ nbdebug(("%s %d: (%d) %s %s\n", (func) ? "FUN" : "CMD", cmdno, bufno, cmd,
+ STRCMP(cmd, "insert") == 0 ? "<text>" : (char *)args));
+
+ if (func)
+ {
+/* =====================================================================*/
+ if (streq((char *)cmd, "getModified"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ /* Return the number of buffers that are modified. */
+ nb_reply_nr(cmdno, (long)count_changed_buffers());
+ else
+ /* Return whether the buffer is modified. */
+ nb_reply_nr(cmdno, (long)(buf->bufp->b_changed
+ || isNetbeansModified(buf->bufp)));
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "saveAndExit"))
+ {
+ /* Note: this will exit Vim if successful. */
+ coloncmd(":confirm qall");
+
+ /* We didn't exit: return the number of changed buffers. */
+ nb_reply_nr(cmdno, (long)count_changed_buffers());
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "getCursor"))
+ {
+ char_u text[200];
+
+ /* Note: nb_getbufno() may return -1. This indicates the IDE
+ * didn't assign a number to the current buffer in response to a
+ * fileOpened event. */
+ sprintf((char *)text, "%d %ld %d %ld",
+ nb_getbufno(curbuf),
+ (long)curwin->w_cursor.lnum,
+ (int)curwin->w_cursor.col,
+ pos2off(curbuf, &curwin->w_cursor));
+ nb_reply_text(cmdno, text);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "getLength"))
+ {
+ long len = 0;
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in getLength"));
+ EMSG("E632: null bufp in getLength");
+ retval = FAIL;
+ }
+ else
+ {
+ len = get_buf_size(buf->bufp);
+ /* adjust for a partial last line */
+ if (buf->partial_line != NULL)
+ {
+ nbdebug((" Adjusting buffer len for partial last line: %d\n",
+ STRLEN(buf->partial_line)));
+ len += STRLEN(buf->partial_line);
+ }
+ }
+ nb_reply_nr(cmdno, len);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "getText"))
+ {
+ long len;
+ linenr_T nlines;
+ char_u *text = NULL;
+ linenr_T lno = 1;
+ char_u *p;
+ char_u *line;
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in getText"));
+ EMSG("E633: null bufp in getText");
+ retval = FAIL;
+ }
+ else
+ {
+ len = get_buf_size(buf->bufp);
+ nlines = buf->bufp->b_ml.ml_line_count;
+ text = alloc((unsigned)((len > 0)
+ ? ((len + nlines) * 2) : 4));
+ if (text == NULL)
+ {
+ nbdebug((" nb_do_cmd: getText has null text field\n"));
+ retval = FAIL;
+ }
+ else
+ {
+ p = text;
+ *p++ = '\"';
+ for (; lno <= nlines ; lno++)
+ {
+ line = nb_quote(ml_get_buf(buf->bufp, lno, FALSE));
+ if (line != NULL)
+ {
+ STRCPY(p, line);
+ p += STRLEN(line);
+ *p++ = '\\';
+ *p++ = 'n';
+ }
+ vim_free(line);
+ }
+ *p++ = '\"';
+ *p = '\0';
+ }
+ }
+ if (text == NULL)
+ nb_reply_text(cmdno, (char_u *)"");
+ else
+ {
+ nb_reply_text(cmdno, text);
+ vim_free(text);
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "remove"))
+ {
+ long count;
+ pos_T first, last;
+ pos_T *pos;
+ int oldFire = netbeansFireChanges;
+ int oldSuppress = netbeansSuppressNoLines;
+ int wasChanged;
+
+ if (skip >= SKIP_STOP)
+ {
+ nbdebug((" Skipping %s command\n", (char *) cmd));
+ nb_reply_nil(cmdno);
+ return OK;
+ }
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in remove"));
+ EMSG("E634: null bufp in remove");
+ retval = FAIL;
+ }
+ else
+ {
+ netbeansFireChanges = FALSE;
+ netbeansSuppressNoLines = TRUE;
+
+ if (curbuf != buf->bufp)
+ set_curbuf(buf->bufp, DOBUF_GOTO);
+ wasChanged = buf->bufp->b_changed;
+ off = strtol((char *)args, (char **)&args, 10);
+ count = strtol((char *)args, (char **)&args, 10);
+ /* delete "count" chars, starting at "off" */
+ pos = off2pos(buf->bufp, off);
+ if (!pos)
+ {
+ nb_reply_text(cmdno, (char_u *)"!bad position");
+ netbeansFireChanges = oldFire;
+ netbeansSuppressNoLines = oldSuppress;
+ return FAIL;
+ }
+ first = *pos;
+ nbdebug((" FIRST POS: line %d, col %d\n", first.lnum, first.col));
+ pos = off2pos(buf->bufp, off+count-1);
+ if (!pos)
+ {
+ nb_reply_text(cmdno, (char_u *)"!bad count");
+ netbeansFireChanges = oldFire;
+ netbeansSuppressNoLines = oldSuppress;
+ return FAIL;
+ }
+ last = *pos;
+ nbdebug((" LAST POS: line %d, col %d\n", last.lnum, last.col));
+ curwin->w_cursor = first;
+ doupdate = 1;
+
+ /* keep part of first line */
+ if (first.lnum == last.lnum && first.col != last.col)
+ {
+ /* deletion is within one line */
+ char_u *p = ml_get(first.lnum);
+ mch_memmove(p + first.col, p + last.col + 1, STRLEN(p + last.col) + 1);
+ nbdebug((" NEW LINE %d: %s\n", first.lnum, p));
+ ml_replace(first.lnum, p, TRUE);
+ }
+
+ if (first.lnum < last.lnum)
+ {
+ int i;
+
+ /* delete signs from the lines being deleted */
+ for (i = first.lnum; i <= last.lnum; i++)
+ {
+ int id = buf_findsign_id(buf->bufp, (linenr_T)i);
+ if (id > 0)
+ {
+ nbdebug((" Deleting sign %d on line %d\n", id, i));
+ buf_delsign(buf->bufp, id);
+ }
+ else
+ nbdebug((" No sign on line %d\n", i));
+ }
+
+ /* delete whole lines */
+ nbdebug((" Deleting lines %d through %d\n", first.lnum, last.lnum));
+ del_lines(last.lnum - first.lnum + 1, FALSE);
+ }
+ buf->bufp->b_changed = wasChanged; /* logically unchanged */
+ netbeansFireChanges = oldFire;
+ netbeansSuppressNoLines = oldSuppress;
+
+ u_blockfree(buf->bufp);
+ u_clearall(buf->bufp);
+ }
+ nb_reply_nil(cmdno);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "insert"))
+ {
+ pos_T *pos;
+ pos_T mypos;
+ char_u *to_free;
+ char_u *nl;
+ int lnum;
+ pos_T old_w_cursor;
+ int old_b_changed;
+
+ if (skip >= SKIP_STOP)
+ {
+ nbdebug((" Skipping %s command\n", (char *) cmd));
+ nb_reply_nil(cmdno);
+ return OK;
+ }
+
+ /* get offset */
+ off = strtol((char *)args, (char **)&args, 10);
+
+ /* get text to be inserted */
+ args = skipwhite(args);
+ args = to_free = (char_u *)nb_unquote(args, NULL);
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in insert"));
+ EMSG("E635: null bufp in insert");
+ retval = FAIL;
+ }
+ else if (args != NULL)
+ {
+ /* We need to detect EOL style
+ * because addAnno passes char-offset
+ */
+ int ff_detected = EOL_UNKNOWN;
+ int buf_was_empty = (buf->bufp->b_ml.ml_flags & ML_EMPTY);
+
+ oldFire = netbeansFireChanges;
+ netbeansFireChanges = 0;
+
+ if (curbuf != buf->bufp)
+ set_curbuf(buf->bufp, DOBUF_GOTO);
+ old_b_changed = buf->bufp->b_changed;
+
+ if (buf->partial_line != NULL)
+ {
+ nbdebug((" Combining with partial line\n"));
+ off -= STRLEN(buf->partial_line);
+ pos = off2pos(buf->bufp, off);
+ if (pos && pos->col != 0)
+ off -= pos->col; /* want start of line */
+ buf->partial_line = vim_realloc(buf->partial_line,
+ STRLEN(buf->partial_line) + STRLEN(args) + 1);
+ STRCAT(buf->partial_line, args);
+ vim_free(to_free);
+ args = buf->partial_line;
+ buf->partial_line = NULL;
+ to_free = args;
+ }
+ pos = off2pos(buf->bufp, off);
+ if (pos)
+ {
+ if (pos->lnum == 0)
+ pos->lnum = 1;
+ nbdebug((" POSITION: line = %d, col = %d\n",
+ pos->lnum, pos->col));
+ }
+ else
+ {
+ /* if the given position is not found, assume we want
+ * the end of the file. See setLocAndSize HACK. */
+ pos = &mypos;
+ pos->col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ pos->coladd = 0;
+#endif
+ pos->lnum = buf->bufp->b_ml.ml_line_count;
+ nbdebug((" POSITION: line = %d (EOF)\n", pos->lnum));
+ }
+ lnum = pos->lnum;
+ old_w_cursor = curwin->w_cursor;
+ curwin->w_cursor = *pos;
+
+ doupdate = 1;
+ while (*args)
+ {
+ nl = (char_u *)strchr((char *)args, '\n');
+ if (!nl)
+ {
+ nbdebug((" PARTIAL[%d]: %s\n", lnum, args));
+ break;
+ }
+ /* EOL detecting.
+ * Not sure how to deal with '\n' on Mac
+ * it will fail already in nl = ... above
+ */
+ if (buf_was_empty && /* There is need to detect EOLs */
+ /* AND: string is empty */
+ (args == nl
+ /* OR hasn't '\r' at the end */
+ || *(nl - 1) != '\r'))
+ ff_detected = EOL_UNIX;
+
+ *nl = '\0';
+ nbdebug((" INSERT[%d]: %s\n", lnum, args));
+ ml_append((linenr_T)(lnum++ - 1), args,
+ STRLEN(args) + 1, FALSE);
+ args = nl + 1;
+ }
+
+ appended_lines_mark(pos->lnum - 1, lnum - pos->lnum);
+
+ /* We can change initial ff without consequences
+ * Isn't it a kind of hacking?
+ */
+ if (buf_was_empty)
+ {
+ if (ff_detected == EOL_UNKNOWN)
+ ff_detected = EOL_DOS;
+ set_fileformat(ff_detected, OPT_LOCAL);
+ buf->bufp->b_start_ffc = *buf->bufp->b_p_ff;
+ }
+
+ if (*args)
+ {
+ /*
+ * Incomplete line, squirrel away and wait for next insert.
+ */
+ nbdebug((" PARTIAL-SAVED: %s\n", args));
+ buf->partial_line = vim_realloc(buf->partial_line,
+ STRLEN(args) + 1);
+ STRCPY(buf->partial_line, args);
+ }
+ curwin->w_cursor = old_w_cursor;
+
+ /*
+ * XXX - GRP - Is the next line right? If I've inserted
+ * text the buffer has been updated but not written. Will
+ * netbeans guarantee to write it? Even if I do a :q! ?
+ */
+ buf->bufp->b_changed = old_b_changed; /* logically unchanged */
+ netbeansFireChanges = oldFire;
+
+ u_blockfree(buf->bufp);
+ u_clearall(buf->bufp);
+ }
+ vim_free(to_free);
+ nb_reply_nil(cmdno); /* or !error */
+ }
+ else
+ {
+ nbdebug(("UNIMPLEMENTED FUNCTION: %s\n", cmd));
+ nb_reply_nil(cmdno);
+ retval = FAIL;
+ }
+ }
+ else /* Not a function; no reply required. */
+ {
+/* =====================================================================*/
+ if (streq((char *)cmd, "create"))
+ {
+ /* Create a buffer without a name. */
+ if (buf == NULL)
+ {
+ EMSG("E636: null buf in create");
+ return FAIL;
+ }
+ vim_free(buf->displayname);
+ buf->displayname = NULL;
+ nbdebug((" CREATE %d\n", bufno));
+
+ netbeansReadFile = 0; /* don't try to open disk file */
+ do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF);
+ netbeansReadFile = 1;
+ buf->bufp = curbuf;
+ maketitle();
+ gui_update_menus(0);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "startDocumentListen"))
+ {
+ if (buf == NULL)
+ {
+ EMSG("E637: null buf in startDocumentListen");
+ return FAIL;
+ }
+ buf->fireChanges = 1;
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "stopDocumentListen"))
+ {
+ if (buf == NULL)
+ {
+ EMSG("E638: null buf in stopDocumentListen");
+ return FAIL;
+ }
+ buf->fireChanges = 0;
+ if (buf->bufp != NULL
+ && buf->bufp->b_was_netbeans_file
+ && !buf->bufp->b_netbeans_file)
+ EMSGN(_("E658: NetBeans connection lost for buffer %ld"),
+ buf->bufp->b_fnum);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setTitle"))
+ {
+ if (buf == NULL)
+ {
+ EMSG("E639: null buf in setTitle");
+ return FAIL;
+ }
+ vim_free(buf->displayname);
+ buf->displayname = nb_unquote(args, NULL);
+ nbdebug((" SETTITLE %d %s\n", bufno, buf->displayname));
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "initDone"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ EMSG("E640: null buf in initDone");
+ return FAIL;
+ }
+ doupdate = 1;
+ buf->initDone = 1;
+ if (curbuf != buf->bufp)
+ set_curbuf(buf->bufp, DOBUF_GOTO);
+#if defined(FEAT_AUTOCMD)
+ apply_autocmds(EVENT_BUFREADPOST, 0, 0, FALSE, buf->bufp);
+#endif
+
+ /* handle any postponed key commands */
+ handle_key_queue();
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setBufferNumber")
+ || streq((char *)cmd, "putBufferNumber"))
+ {
+ char_u *to_free;
+ buf_T *bufp;
+
+ if (buf == NULL)
+ {
+ EMSG("E641: null buf in setBufferNumber");
+ return FAIL;
+ }
+ to_free = (char_u *)nb_unquote(args, NULL);
+ if (to_free == NULL)
+ return FAIL;
+ bufp = buflist_findname(to_free);
+ vim_free(to_free);
+ if (bufp == NULL)
+ {
+ EMSG2("E642: File %s not found in setBufferNumber", args);
+ return FAIL;
+ }
+ buf->bufp = bufp;
+
+ /* "setBufferNumber" has the side effect of jumping to the buffer
+ * (don't know why!). Don't do that for "putBufferNumber". */
+ if (*cmd != 'p')
+ coloncmd(":buffer %d", bufp->b_fnum);
+ else
+ {
+ buf->initDone = 1;
+
+ /* handle any postponed key commands */
+ handle_key_queue();
+ }
+
+#if 0 /* never used */
+ buf->internalname = (char *)alloc_clear(8);
+ sprintf(buf->internalname, "<%d>", bufno);
+ buf->netbeansOwns = 0;
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setFullName"))
+ {
+ if (buf == NULL)
+ {
+ EMSG("E643: null buf in setFullName");
+ return FAIL;
+ }
+ vim_free(buf->displayname);
+ buf->displayname = nb_unquote(args, NULL);
+ nbdebug((" SETFULLNAME %d %s\n", bufno, buf->displayname));
+
+ netbeansReadFile = 0; /* don't try to open disk file */
+ do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
+ ECMD_HIDE + ECMD_OLDBUF);
+ netbeansReadFile = 1;
+ buf->bufp = curbuf;
+ maketitle();
+ gui_update_menus(0);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "editFile"))
+ {
+ if (buf == NULL)
+ {
+ EMSG("E644: null buf in editFile");
+ return FAIL;
+ }
+ /* Edit a file: like create + setFullName + read the file. */
+ vim_free(buf->displayname);
+ buf->displayname = nb_unquote(args, NULL);
+ nbdebug((" EDITFILE %d %s\n", bufno, buf->displayname));
+ do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
+ ECMD_HIDE + ECMD_OLDBUF);
+ buf->bufp = curbuf;
+ buf->initDone = 1;
+ doupdate = 1;
+#if defined(FEAT_TITLE)
+ maketitle();
+#endif
+ gui_update_menus(0);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setVisible"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ {
+/* EMSG("E645: null bufp in setVisible"); */
+ return FAIL;
+ }
+ if (streq((char *)args, "T"))
+ {
+ exarg_T exarg;
+ exarg.cmd = (char_u *)"goto";
+ exarg.forceit = FALSE;
+ goto_buffer(&exarg, DOBUF_FIRST, FORWARD, buf->bufp->b_fnum);
+ doupdate = 1;
+
+ /* Side effect!!!. */
+ if (!gui.starting)
+ gui_mch_set_foreground();
+ }
+ else
+ {
+ /* bury the buffer - not yet */
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "raise"))
+ {
+ /* Bring gvim to the foreground. */
+ if (!gui.starting)
+ gui_mch_set_foreground();
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setModified"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ {
+/* EMSG("E646: null bufp in setModified"); */
+ return FAIL;
+ }
+ if (streq((char *)args, "T"))
+ buf->bufp->b_changed = 1;
+ else
+ {
+ struct stat st;
+
+ /* Assume NetBeans stored the file. Reset the timestamp to
+ * avoid "file changed" warnings. */
+ if (buf->bufp->b_ffname != NULL
+ && mch_stat((char *)buf->bufp->b_ffname, &st) >= 0)
+ buf_store_time(buf->bufp, &st, buf->bufp->b_ffname);
+ buf->bufp->b_changed = 0;
+ }
+ buf->modified = buf->bufp->b_changed;
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setMark"))
+ {
+ /* not yet */
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "showBalloon"))
+ {
+#if defined(FEAT_BEVAL)
+ static char *text = NULL;
+
+ /*
+ * Set up the Balloon Expression Evaluation area.
+ * Ignore 'ballooneval' here.
+ * The text pointer must remain valid for a while.
+ */
+ if (balloonEval != NULL)
+ {
+ vim_free(text);
+ text = nb_unquote(args, NULL);
+ if (text != NULL)
+ gui_mch_post_balloon(balloonEval, (char_u *)text);
+ }
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setDot"))
+ {
+ pos_T *pos;
+#ifdef NBDEBUG
+ char_u *s;
+#endif
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ EMSG("E647: null bufp in setDot");
+ return FAIL;
+ }
+
+ if (curbuf != buf->bufp)
+ set_curbuf(buf->bufp, DOBUF_GOTO);
+#ifdef FEAT_VISUAL
+ /* Don't want Visual mode now. */
+ if (VIsual_active)
+ end_visual_mode();
+#endif
+#ifdef NBDEBUG
+ s = args;
+#endif
+ pos = get_off_or_lnum(buf->bufp, &args);
+ if (pos)
+ {
+ curwin->w_cursor = *pos;
+ check_cursor();
+#ifdef FEAT_FOLDING
+ foldOpenCursor();
+#endif
+ }
+ else
+ nbdebug((" BAD POSITION in setDot: %s\n", s));
+
+ /* gui_update_cursor(TRUE, FALSE); */
+ /* update_curbuf(NOT_VALID); */
+ update_topline(); /* scroll to show the line */
+ update_screen(VALID);
+ setcursor();
+ out_flush();
+ gui_update_cursor(TRUE, FALSE);
+ gui_mch_flush();
+ /* Quit a hit-return or more prompt. */
+ if (State == HITRETURN || State == ASKMORE)
+ {
+ add_to_input_buf((char_u *)"\003", 1);
+#ifdef FEAT_GUI_GTK
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+#endif
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "close"))
+ {
+#ifdef NBDEBUG
+ char *name = "<NONE>";
+#endif
+
+ if (buf == NULL)
+ {
+ EMSG("E648: null buf in close");
+ return FAIL;
+ }
+
+#ifdef NBDEBUG
+ if (buf->displayname != NULL)
+ name = buf->displayname;
+#endif
+/* if (buf->bufp == NULL) */
+/* EMSG("E649: null bufp in close"); */
+ nbdebug((" CLOSE %d: %s\n", bufno, name));
+ need_mouse_correct = TRUE;
+ if (buf->bufp != NULL)
+ do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD,
+ buf->bufp->b_fnum, TRUE);
+ doupdate = 1;
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setStyle")) /* obsolete... */
+ {
+ nbdebug((" setStyle is obsolete!"));
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "setExitDelay"))
+ {
+ /* New in version 2.1. */
+ exit_delay = strtol((char *)args, (char **)&args, 10);
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "defineAnnoType"))
+ {
+#ifdef FEAT_SIGNS
+ int typeNum;
+ char_u *typeName;
+ char_u *tooltip;
+ char_u *p;
+ char_u *glyphFile;
+ int use_fg = 0;
+ int use_bg = 0;
+ int fg = -1;
+ int bg = -1;
+
+ if (buf == NULL)
+ {
+ EMSG("E650: null buf in defineAnnoType");
+ return FAIL;
+ }
+
+ typeNum = strtol((char *)args, (char **)&args, 10);
+ args = skipwhite(args);
+ typeName = (char_u *)nb_unquote(args, &args);
+ args = skipwhite(args + 1);
+ tooltip = (char_u *)nb_unquote(args, &args);
+ args = skipwhite(args + 1);
+
+ p = (char_u *)nb_unquote(args, &args);
+ glyphFile = vim_strsave_escaped(p, escape_chars);
+ vim_free(p);
+
+ args = skipwhite(args + 1);
+ if (STRNCMP(args, "none", 4) == 0)
+ args += 5;
+ else
+ {
+ use_fg = 1;
+ fg = strtol((char *)args, (char **)&args, 10);
+ }
+ if (STRNCMP(args, "none", 4) == 0)
+ args += 5;
+ else
+ {
+ use_bg = 1;
+ bg = strtol((char *)args, (char **)&args, 10);
+ }
+ if (typeName != NULL && tooltip != NULL && glyphFile != NULL)
+ addsigntype(buf, typeNum, typeName, tooltip, glyphFile,
+ use_fg, fg, use_bg, bg);
+ else
+ vim_free(typeName);
+
+ /* don't free typeName; it's used directly in addsigntype() */
+ vim_free(tooltip);
+ vim_free(glyphFile);
+
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "addAnno"))
+ {
+#ifdef FEAT_SIGNS
+ int serNum;
+ int localTypeNum;
+ int typeNum;
+# ifdef NBDEBUG
+ int len;
+# endif
+ pos_T *pos;
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ EMSG("E651: null bufp in addAnno");
+ return FAIL;
+ }
+
+ doupdate = 1;
+
+ serNum = strtol((char *)args, (char **)&args, 10);
+
+ /* Get the typenr specific for this buffer and convert it to
+ * the global typenumber, as used for the sign name. */
+ localTypeNum = strtol((char *)args, (char **)&args, 10);
+ typeNum = mapsigntype(buf, localTypeNum);
+
+ pos = get_off_or_lnum(buf->bufp, &args);
+
+# ifdef NBDEBUG
+ len =
+# endif
+ strtol((char *)args, (char **)&args, 10);
+# ifdef NBDEBUG
+ if (len != -1)
+ {
+ nbdebug((" partial line annotation -- Not Yet Implemented!"));
+ }
+# endif
+ if (serNum >= GUARDEDOFFSET)
+ {
+ nbdebug((" too many annotations! ignoring..."));
+ return FAIL;
+ }
+ if (pos)
+ {
+ coloncmd(":sign place %d line=%d name=%d buffer=%d",
+ serNum, pos->lnum, typeNum, buf->bufp->b_fnum);
+ if (typeNum == curPCtype)
+ coloncmd(":sign jump %d buffer=%d", serNum,
+ buf->bufp->b_fnum);
+ }
+ /* XXX only redraw what changed. */
+ redraw_later(CLEAR);
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "removeAnno"))
+ {
+#ifdef FEAT_SIGNS
+ int serNum;
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in removeAnno"));
+ return FAIL;
+ }
+ doupdate = 1;
+ serNum = strtol((char *)args, (char **)&args, 10);
+ coloncmd(":sign unplace %d buffer=%d",
+ serNum, buf->bufp->b_fnum);
+ redraw_buf_later(buf->bufp, NOT_VALID);
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "moveAnnoToFront"))
+ {
+#ifdef FEAT_SIGNS
+ nbdebug((" moveAnnoToFront: Not Yet Implemented!"));
+#endif
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "guard") || streq((char *)cmd, "unguard"))
+ {
+ int len;
+ pos_T first;
+ pos_T last;
+ pos_T *pos;
+ int un = (cmd[0] == 'u');
+ static int guardId = GUARDEDOFFSET;
+
+ if (skip >= SKIP_STOP)
+ {
+ nbdebug((" Skipping %s command\n", (char *) cmd));
+ return OK;
+ }
+
+ nb_init_graphics();
+
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in %s command", cmd));
+ return FAIL;
+ }
+ if (curbuf != buf->bufp)
+ set_curbuf(buf->bufp, DOBUF_GOTO);
+ off = strtol((char *)args, (char **)&args, 10);
+ len = strtol((char *)args, 0, 10);
+ pos = off2pos(buf->bufp, off);
+ doupdate = 1;
+ if (!pos)
+ nbdebug((" no such start pos in %s, %ld\n", cmd, off));
+ else
+ {
+ first = *pos;
+ pos = off2pos(buf->bufp, off + len - 1);
+ if (pos != NULL && pos->col == 0) {
+ /*
+ * In Java Swing the offset is a position between 2
+ * characters. If col == 0 then we really want the
+ * previous line as the end.
+ */
+ pos = off2pos(buf->bufp, off + len - 2);
+ }
+ if (!pos)
+ nbdebug((" no such end pos in %s, %ld\n",
+ cmd, off + len - 1));
+ else
+ {
+ long lnum;
+ last = *pos;
+ /* set highlight for region */
+ nbdebug((" %sGUARD %ld,%d to %ld,%d\n", (un) ? "UN" : "",
+ first.lnum, first.col,
+ last.lnum, last.col));
+#ifdef FEAT_SIGNS
+ for (lnum = first.lnum; lnum <= last.lnum; lnum++)
+ {
+ if (un)
+ {
+ /* never used */
+ }
+ else
+ {
+ if (buf_findsigntype_id(buf->bufp, lnum,
+ GUARDED) == 0)
+ {
+ coloncmd(
+ ":sign place %d line=%d name=%d buffer=%d",
+ guardId++, lnum, GUARDED,
+ buf->bufp->b_fnum);
+ }
+ }
+ }
+#endif
+ redraw_buf_later(buf->bufp, NOT_VALID);
+ }
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "startAtomic"))
+ {
+ inAtomic = 1;
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "endAtomic"))
+ {
+ inAtomic = 0;
+ if (needupdate)
+ {
+ doupdate = 1;
+ needupdate = 0;
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "save"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in %s command", cmd));
+ return FAIL;
+ }
+
+ /* the following is taken from ex_cmds.c (do_wqall function) */
+ if (bufIsChanged(buf->bufp))
+ {
+ /* Only write if the buffer can be written. */
+ if (p_write
+ && !buf->bufp->b_p_ro
+ && buf->bufp->b_ffname != NULL
+#ifdef FEAT_QUICKFIX
+ && !bt_dontwrite(buf->bufp)
+#endif
+ )
+ {
+ buf_write_all(buf->bufp, FALSE);
+#ifdef FEAT_AUTOCMD
+ /* an autocommand may have deleted the buffer */
+ if (!buf_valid(buf->bufp))
+ buf->bufp = NULL;
+#endif
+ }
+ }
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "netbeansBuffer"))
+ {
+ if (buf == NULL || buf->bufp == NULL)
+ {
+ nbdebug((" null bufp in %s command", cmd));
+ return FAIL;
+ }
+ if (*args == 'T')
+ {
+ buf->bufp->b_netbeans_file = TRUE;
+ buf->bufp->b_was_netbeans_file = TRUE;
+ }
+ else
+ buf->bufp->b_netbeans_file = FALSE;
+/* =====================================================================*/
+ }
+ else if (streq((char *)cmd, "version"))
+ {
+ nbdebug((" Version = %s\n", (char *) args));
+ }
+ /*
+ * Unrecognized command is ignored.
+ */
+ }
+ if (inAtomic && doupdate)
+ {
+ needupdate = 1;
+ doupdate = 0;
+ }
+
+ if (buf != NULL && buf->initDone && doupdate)
+ {
+ update_screen(NOT_VALID);
+ setcursor();
+ out_flush();
+ gui_update_cursor(TRUE, FALSE);
+ gui_mch_flush();
+ /* Quit a hit-return or more prompt. */
+ if (State == HITRETURN || State == ASKMORE)
+ {
+ add_to_input_buf((char_u *)"\003", 1);
+#ifdef FEAT_GUI_GTK
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+#endif
+ }
+ }
+
+ return retval;
+}
+
+
+/*
+ * Process a vim colon command.
+ */
+ static void
+coloncmd(char *cmd, ...)
+{
+ char buf[1024];
+ va_list ap;
+
+ va_start(ap, cmd);
+ vsprintf(buf, cmd, ap);
+ va_end(ap);
+
+ nbdebug((" COLONCMD %s\n", buf));
+
+/* ALT_INPUT_LOCK_ON; */
+ do_cmdline((char_u *)buf, NULL, NULL, DOCMD_NOWAIT | DOCMD_KEYTYPED);
+/* ALT_INPUT_LOCK_OFF; */
+
+ setcursor(); /* restore the cursor position */
+ out_flush(); /* make sure output has been written */
+
+ gui_update_cursor(TRUE, FALSE);
+ gui_mch_flush();
+}
+
+
+/*
+ * Initialize highlights and signs for use by netbeans (mostly obsolete)
+ */
+ static void
+nb_init_graphics(void)
+{
+ static int did_init = FALSE;
+
+ if (!did_init)
+ {
+ coloncmd(":highlight NBGuarded guibg=Cyan guifg=Black");
+ coloncmd(":sign define %d linehl=NBGuarded", GUARDED);
+
+ did_init = TRUE;
+ }
+}
+
+/*
+ * Convert key to netbeans name.
+ */
+ static void
+netbeans_keyname(int key, char *buf)
+{
+ char *name = 0;
+ char namebuf[2];
+ int ctrl = 0;
+ int shift = 0;
+ int alt = 0;
+
+ if (mod_mask & MOD_MASK_CTRL)
+ ctrl = 1;
+ if (mod_mask & MOD_MASK_SHIFT)
+ shift = 1;
+ if (mod_mask & MOD_MASK_ALT)
+ alt = 1;
+
+
+ switch (key)
+ {
+ case K_F1: name = "F1"; break;
+ case K_S_F1: name = "F1"; shift = 1; break;
+ case K_F2: name = "F2"; break;
+ case K_S_F2: name = "F2"; shift = 1; break;
+ case K_F3: name = "F3"; break;
+ case K_S_F3: name = "F3"; shift = 1; break;
+ case K_F4: name = "F4"; break;
+ case K_S_F4: name = "F4"; shift = 1; break;
+ case K_F5: name = "F5"; break;
+ case K_S_F5: name = "F5"; shift = 1; break;
+ case K_F6: name = "F6"; break;
+ case K_S_F6: name = "F6"; shift = 1; break;
+ case K_F7: name = "F7"; break;
+ case K_S_F7: name = "F7"; shift = 1; break;
+ case K_F8: name = "F8"; break;
+ case K_S_F8: name = "F8"; shift = 1; break;
+ case K_F9: name = "F9"; break;
+ case K_S_F9: name = "F9"; shift = 1; break;
+ case K_F10: name = "F10"; break;
+ case K_S_F10: name = "F10"; shift = 1; break;
+ case K_F11: name = "F11"; break;
+ case K_S_F11: name = "F11"; shift = 1; break;
+ case K_F12: name = "F12"; break;
+ case K_S_F12: name = "F12"; shift = 1; break;
+ default:
+ if (key >= ' ' && key <= '~')
+ {
+ /* Allow ASCII characters. */
+ name = namebuf;
+ namebuf[0] = key;
+ namebuf[1] = NUL;
+ }
+ else
+ name = "X";
+ break;
+ }
+
+ buf[0] = '\0';
+ if (ctrl)
+ strcat(buf, "C");
+ if (shift)
+ strcat(buf, "S");
+ if (alt)
+ strcat(buf, "M"); /* META */
+ if (ctrl || shift || alt)
+ strcat(buf, "-");
+ strcat(buf, name);
+}
+
+#ifdef FEAT_BEVAL
+/*
+ * Function to be called for balloon evaluation. Grabs the text under the
+ * cursor and sends it to the debugger for evaluation. The debugger should
+ * respond with a showBalloon command when there is a useful result.
+ */
+/*ARGSUSED*/
+ static void
+netbeans_beval_cb(
+ BalloonEval *beval,
+ int state)
+{
+ char_u *filename;
+ char_u *text;
+ int line;
+ int col;
+ char buf[MAXPATHL * 2 + 25];
+ char_u *p;
+
+ /* Don't do anything when 'ballooneval' is off, messages scrolled the
+ * windows up or we have no connection. */
+ if (!p_beval || msg_scrolled > 0 || !haveConnection)
+ return;
+
+ if (gui_mch_get_beval_info(beval, &filename, &line, &text, &col) == OK)
+ {
+ /* Send debugger request. Only when the text is of reasonable
+ * length. */
+ if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
+ {
+ p = nb_quote(text);
+ if (p != NULL)
+ sprintf(buf, "0:balloonText=%d \"%s\"\n", cmdno, p);
+ vim_free(p);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_beval_cb");
+ }
+ vim_free(text);
+ }
+}
+#endif
+
+/*
+ * Tell netbeans that the window was opened, ready for commands.
+ */
+ void
+netbeans_startup_done(void)
+{
+ char *cmd = "0:startupDone=0\n";
+
+ if (!haveConnection)
+ return;
+
+ nbdebug(("EVT: %s", cmd));
+ nb_send(cmd, "netbeans_startup_done");
+
+#ifdef FEAT_BEVAL
+# ifdef FEAT_GUI_MOTIF
+ if (gui.in_use)
+ {
+ /*
+ * Set up the Balloon Expression Evaluation area for Motif.
+ * GTK can do it earlier...
+ * Always create it but disable it when 'ballooneval' isn't set.
+ */
+ balloonEval = gui_mch_create_beval_area(textArea, NULL,
+ &netbeans_beval_cb, NULL);
+ if (!p_beval)
+ gui_mch_disable_beval_area(balloonEval);
+ }
+# else
+# if defined(FEAT_GUI_W32) && defined(FEAT_BEVAL)
+ balloonEval = gui_mch_create_beval_area(NULL, NULL,
+ &netbeans_beval_cb, NULL);
+ if (!p_beval)
+ gui_mch_disable_beval_area(balloonEval);
+# endif
+# endif
+#endif
+}
+
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_W32) || defined(PROTO)
+/*
+ * Tell netbeans that the window was moved or resized.
+ */
+ void
+netbeans_frame_moved(int new_x, int new_y)
+{
+ char buf[128];
+
+ if (!haveConnection)
+ return;
+
+ sprintf(buf, "0:geometry=%d %d %d %d %d\n",
+ cmdno, (int)Columns, (int)Rows, new_x, new_y);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_frame_moved");
+}
+#endif
+
+/*
+ * Tell netbeans the user opened a file.
+ */
+ void
+netbeans_file_opened(char *filename)
+{
+ char buffer[2*MAXPATHL];
+ char_u *q;
+
+ if (!haveConnection)
+ return;
+
+ q = nb_quote((char_u *)filename);
+ if (q == NULL)
+ return;
+ sprintf(buffer, "0:fileOpened=%d \"%s\" %s %s\n",
+ 0,
+ (char *)q,
+ "T", /* open in NetBeans */
+ "F"); /* modified */
+
+ vim_free(q);
+ nbdebug(("EVT: %s", buffer));
+
+ nb_send(buffer, "netbeans_file_opened");
+ if (p_acd && vim_chdirfile((char_u *)filename) == OK)
+ shorten_fnames(TRUE);
+}
+
+/*
+ * Tell netbeans a file was closed.
+ */
+ void
+netbeans_file_closed(buf_T *bufp)
+{
+ int bufno = nb_getbufno(bufp);
+ nbbuf_T *nbbuf = nb_get_buf(bufno);
+ char buffer[2*MAXPATHL];
+
+ if (!haveConnection || bufno < 0)
+ return;
+
+ if (!netbeansCloseFile)
+ {
+ nbdebug(("ignoring file_closed for %s\n", bufp->b_ffname));
+ return;
+ }
+
+ nbdebug(("netbeans_file_closed() bufno = %d, file = %s, displayname = %s\n",
+ bufno, bufp->b_ffname,
+ (nbbuf != NULL) ? nbbuf->displayname : "<>"));
+
+ if (bufno <= 0)
+ return;
+
+ sprintf(buffer, "%d:killed=%d\n", bufno, cmdno);
+
+ nbdebug(("EVT: %s", buffer));
+
+ nb_send(buffer, "netbeans_file_closed");
+
+ if (nbbuf != NULL)
+ nbbuf->bufp = NULL;
+}
+
+/*
+ * Get a pointer to the Netbeans buffer for Vim buffer "bufp".
+ * Return NULL if there is no such buffer or changes are not to be reported.
+ * Otherwise store the buffer number in "*bufnop".
+ */
+ static nbbuf_T *
+nb_bufp2nbbuf_fire(buf_T *bufp, int *bufnop)
+{
+ int bufno;
+ nbbuf_T *nbbuf;
+
+ if (!haveConnection || !netbeansFireChanges)
+ return NULL; /* changes are not reported at all */
+
+ bufno = nb_getbufno(bufp);
+ if (bufno <= 0)
+ return NULL; /* file is not known to NetBeans */
+
+ nbbuf = nb_get_buf(bufno);
+ if (nbbuf != NULL && !nbbuf->fireChanges)
+ return NULL; /* changes in this buffer are not reported */
+
+ *bufnop = bufno;
+ return nbbuf;
+}
+
+/*
+ * Tell netbeans the user inserted some text.
+ */
+ void
+netbeans_inserted(
+ buf_T *bufp,
+ linenr_T linenr,
+ colnr_T col,
+ int oldlen,
+ char_u *txt,
+ int newlen)
+{
+ char_u *buf;
+ int bufno;
+ nbbuf_T *nbbuf;
+ pos_T pos;
+ long off;
+ char_u *p;
+ char_u *newtxt;
+
+ nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
+ if (nbbuf == NULL)
+ return;
+
+ nbbuf->modified = 1;
+
+ pos.lnum = linenr;
+ pos.col = col;
+
+ off = pos2off(bufp, &pos);
+
+/* nbdebug(("linenr = %d, col = %d, off = %ld\n", linenr, col, off)); */
+
+ buf = alloc(128 + 2*newlen);
+
+ if (oldlen > 0)
+ {
+ /* some chars were replaced; send "remove" EVT */
+ sprintf((char *)buf, "%d:remove=%d %ld %d\n",
+ bufno, cmdno, off, oldlen);
+ nbdebug(("EVT: %s", buf));
+ nb_send((char *)buf, "netbeans_inserted");
+ }
+ else if (oldlen < 0)
+ {
+ /* can't happen? */
+ nbdebug(("unexpected: oldlen < 0 in netbeans_inserted"));
+ }
+
+ /* send the "insert" EVT */
+ newtxt = alloc(newlen + 1);
+ STRNCPY(newtxt, txt, newlen);
+ newtxt[newlen] = '\0';
+ p = nb_quote(newtxt);
+ if (p != NULL)
+ {
+ sprintf((char *)buf, "%d:insert=%d %ld \"%s\"\n", bufno, cmdno, off, p);
+ nbdebug(("EVT: %s", buf));
+ nb_send((char *)buf, "netbeans_inserted");
+ }
+ vim_free(p);
+ vim_free(newtxt);
+ vim_free(buf);
+}
+
+/*
+ * Tell netbeans some bytes have been removed.
+ */
+ void
+netbeans_removed(
+ buf_T *bufp,
+ linenr_T linenr,
+ colnr_T col,
+ long len)
+{
+ char_u buf[128];
+ int bufno;
+ nbbuf_T *nbbuf;
+ pos_T pos;
+ long off;
+
+ nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
+ if (nbbuf == NULL)
+ return;
+
+ if (len < 0)
+ {
+ nbdebug(("Negative len %ld in netbeans_removed()!", len));
+ return;
+ }
+
+ nbbuf->modified = 1;
+
+ pos.lnum = linenr;
+ pos.col = col;
+
+ off = pos2off(bufp, &pos);
+
+ sprintf((char *)buf, "%d:remove=%d %ld %ld\n", bufno, cmdno, off, len);
+ nbdebug(("EVT: %s", buf));
+ nb_send((char *)buf, "netbeans_removed");
+}
+
+/*
+ * Send netbeans an unmodufied command.
+ */
+/*ARGSUSED*/
+ void
+netbeans_unmodified(buf_T *bufp)
+{
+#if 0
+ char_u buf[128];
+ int bufno;
+ nbbuf_T *nbbuf;
+
+ /* This has been disabled, because NetBeans considers a buffer modified
+ * even when all changes have been undone. */
+ nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
+ if (nbbuf == NULL)
+ return;
+
+ nbbuf->modified = 0;
+
+ sprintf((char *)buf, "%d:unmodified=%d\n", bufno, cmdno);
+ nbdebug(("EVT: %s", buf));
+ nb_send((char *)buf, "netbeans_unmodified");
+#endif
+}
+
+/*
+ * Send a button release event back to netbeans. Its up to netbeans
+ * to decide what to do (if anything) with this event.
+ */
+ void
+netbeans_button_release(int button)
+{
+ char buf[128];
+ int bufno;
+
+ bufno = nb_getbufno(curbuf);
+
+ if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf)
+ {
+ int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1);
+ long off = pos2off(curbuf, &curwin->w_cursor);
+
+ /* sync the cursor position */
+ sprintf(buf, "%d:newDotAndMark=%d %ld %ld\n", bufno, cmdno, off, off);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_button_release[newDotAndMark]");
+
+ sprintf(buf, "%d:buttonRelease=%d %d %ld %d\n", bufno, cmdno,
+ button, (long)curwin->w_cursor.lnum, col);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_button_release");
+ }
+}
+
+
+/*
+ * Send a keypress event back to netbeans. This usualy simulates some
+ * kind of function key press.
+ */
+ void
+netbeans_keycommand(int key)
+{
+ char buf[2*MAXPATHL];
+ int bufno;
+ char keyName[60];
+ long off;
+ char_u *q;
+
+ if (!haveConnection)
+ return;
+
+ /* convert key to netbeans name */
+ netbeans_keyname(key, keyName);
+
+ bufno = nb_getbufno(curbuf);
+
+ if (bufno == -1)
+ {
+ nbdebug(("got keycommand for non-NetBeans buffer, opening...\n"));
+ q = curbuf->b_ffname == NULL ? (char_u *)""
+ : nb_quote(curbuf->b_ffname);
+ if (q == NULL)
+ return;
+ sprintf(buf, "0:fileOpened=%d \"%s\" %s %s\n", 0,
+ q,
+ "T", /* open in NetBeans */
+ "F"); /* modified */
+ if (curbuf->b_ffname != NULL)
+ vim_free(q);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_keycommand");
+
+ postpone_keycommand(key);
+ return;
+ }
+
+ /* sync the cursor position */
+ off = pos2off(curbuf, &curwin->w_cursor);
+ sprintf(buf, "%d:newDotAndMark=%d %ld %ld\n", bufno, cmdno, off, off);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_keycommand");
+
+ /* To work on Win32 you must apply patch to ExtEditor module
+ * from ExtEdCaret.java.diff - make EVT_newDotAndMark handler
+ * more synchronous
+ */
+
+ /* now send keyCommand event */
+ sprintf(buf, "%d:keyCommand=%d \"%s\"\n", bufno, cmdno, keyName);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_keycommand");
+
+ /* New: do both at once and include the lnum/col. */
+ sprintf(buf, "%d:keyAtPos=%d \"%s\" %ld %ld/%ld\n", bufno, cmdno, keyName,
+ off, (long)curwin->w_cursor.lnum, (long)curwin->w_cursor.col);
+ nbdebug(("EVT: %s", buf));
+ nb_send(buf, "netbeans_keycommand");
+}
+
+
+/*
+ * Send a save event to netbeans.
+ */
+ void
+netbeans_save_buffer(buf_T *bufp)
+{
+ char_u buf[64];
+ int bufno;
+ nbbuf_T *nbbuf;
+
+ nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
+ if (nbbuf == NULL)
+ return;
+
+ nbbuf->modified = 0;
+
+ sprintf((char *)buf, "%d:save=%d\n", bufno, cmdno);
+ nbdebug(("EVT: %s", buf));
+ nb_send((char *)buf, "netbeans_save_buffer");
+}
+
+
+/*
+ * Send remove command to netbeans (this command has been turned off).
+ */
+ void
+netbeans_deleted_all_lines(buf_T *bufp)
+{
+ char_u buf[64];
+ int bufno;
+ nbbuf_T *nbbuf;
+
+ nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
+ if (nbbuf == NULL)
+ return;
+
+ nbbuf->modified = 1;
+
+ sprintf((char *)buf, "%d:remove=%d 0 -1\n", bufno, cmdno);
+ nbdebug(("EVT(suppressed): %s", buf));
+/* nb_send(buf, "netbeans_deleted_all_lines"); */
+}
+
+
+/*
+ * See if the lines are guarded. The top and bot parameters are from
+ * u_savecommon(), these are the line above the change and the line below the
+ * change.
+ */
+ int
+netbeans_is_guarded(linenr_T top, linenr_T bot)
+{
+ signlist_T *p;
+ int lnum;
+
+ for (p = curbuf->b_signlist; p != NULL; p = p->next)
+ if (p->id >= GUARDEDOFFSET)
+ for (lnum = top + 1; lnum < bot; lnum++)
+ if (lnum == p->lnum)
+ return TRUE;
+
+ return FALSE;
+}
+
+#if defined(FEAT_GUI_MOTIF) || defined(PROTO)
+/*
+ * We have multiple signs to draw at the same location. Draw the
+ * multi-sign indicator instead. This is the Motif version.
+ */
+ void
+netbeans_draw_multisign_indicator(int row)
+{
+ int i;
+ int y;
+ int x;
+
+ x = 0;
+ y = row * gui.char_height + 2;
+
+ for (i = 0; i < gui.char_height - 3; i++)
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y++);
+
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+0, y);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+4, y++);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+1, y);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++);
+ XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y);
+}
+#endif /* FEAT_GUI_MOTIF */
+
+#ifdef FEAT_GUI_GTK
+/*
+ * We have multiple signs to draw at the same location. Draw the
+ * multi-sign indicator instead. This is the GTK/Gnome version.
+ */
+ void
+netbeans_draw_multisign_indicator(int row)
+{
+ int i;
+ int y;
+ int x;
+ GdkDrawable *drawable = gui.drawarea->window;
+
+ x = 0;
+ y = row * gui.char_height + 2;
+
+ for (i = 0; i < gui.char_height - 3; i++)
+ gdk_draw_point(drawable, gui.text_gc, x+2, y++);
+
+ gdk_draw_point(drawable, gui.text_gc, x+0, y);
+ gdk_draw_point(drawable, gui.text_gc, x+2, y);
+ gdk_draw_point(drawable, gui.text_gc, x+4, y++);
+ gdk_draw_point(drawable, gui.text_gc, x+1, y);
+ gdk_draw_point(drawable, gui.text_gc, x+2, y);
+ gdk_draw_point(drawable, gui.text_gc, x+3, y++);
+ gdk_draw_point(drawable, gui.text_gc, x+2, y);
+}
+#endif /* FEAT_GUI_GTK */
+
+/*
+ * If the mouse is clicked in the gutter of a line with multiple
+ * annotations, cycle through the set of signs.
+ */
+ void
+netbeans_gutter_click(linenr_T lnum)
+{
+ signlist_T *p;
+
+ for (p = curbuf->b_signlist; p != NULL; p = p->next)
+ {
+ if (p->lnum == lnum && p->next && p->next->lnum == lnum)
+ {
+ signlist_T *tail;
+
+ /* remove "p" from list, reinsert it at the tail of the sublist */
+ if (p->prev)
+ p->prev->next = p->next;
+ else
+ curbuf->b_signlist = p->next;
+ p->next->prev = p->prev;
+ /* now find end of sublist and insert p */
+ for (tail = p->next;
+ tail->next && tail->next->lnum == lnum
+ && tail->next->id < GUARDEDOFFSET;
+ tail = tail->next)
+ ;
+ /* tail now points to last entry with same lnum (except
+ * that "guarded" annotations are always last) */
+ p->next = tail->next;
+ if (tail->next)
+ tail->next->prev = p;
+ p->prev = tail;
+ tail->next = p;
+ update_debug_sign(curbuf, lnum);
+ break;
+ }
+ }
+}
+
+
+/*
+ * Add a sign of the reqested type at the requested location.
+ *
+ * Reverse engineering:
+ * Apparently an annotation is defined the first time it is used in a buffer.
+ * When the same annotation is used in two buffers, the second time we do not
+ * need to define a new sign name but reuse the existing one. But since the
+ * ID number used in the second buffer starts counting at one again, a mapping
+ * is made from the ID specifically for the buffer to the global sign name
+ * (which is a number).
+ *
+ * globalsignmap[] stores the signs that have been defined globally.
+ * buf->signmapused[] maps buffer-local annotation IDs to an index in
+ * globalsignmap[].
+ */
+/*ARGSUSED*/
+ static void
+addsigntype(
+ nbbuf_T *buf,
+ int typeNum,
+ char_u *typeName,
+ char_u *tooltip,
+ char_u *glyphFile,
+ int use_fg,
+ int fg,
+ int use_bg,
+ int bg)
+{
+ char fgbuf[32];
+ char bgbuf[32];
+ int i, j;
+
+ for (i = 0; i < globalsignmapused; i++)
+ if (STRCMP(typeName, globalsignmap[i]) == 0)
+ break;
+
+ if (i == globalsignmapused) /* not found; add it to global map */
+ {
+ nbdebug(("DEFINEANNOTYPE(%d,%s,%s,%s,%d,%d)\n",
+ typeNum, typeName, tooltip, glyphFile, fg, bg));
+ if (use_fg || use_bg)
+ {
+ sprintf(fgbuf, "guifg=#%06x", fg & 0xFFFFFF);
+ sprintf(bgbuf, "guibg=#%06x", bg & 0xFFFFFF);
+
+ coloncmd(":highlight NB_%s %s %s", typeName, (use_fg) ? fgbuf : "",
+ (use_bg) ? bgbuf : "");
+ if (*glyphFile == NUL)
+ /* no glyph, line highlighting only */
+ coloncmd(":sign define %d linehl=NB_%s", i + 1, typeName);
+ else if (vim_strsize(glyphFile) <= 2)
+ /* one- or two-character glyph name, use as text glyph with
+ * texthl */
+ coloncmd(":sign define %d text=%s texthl=NB_%s", i + 1,
+ glyphFile, typeName);
+ else
+ /* glyph, line highlighting */
+ coloncmd(":sign define %d icon=%s linehl=NB_%s", i + 1,
+ glyphFile, typeName);
+ }
+ else
+ /* glyph, no line highlighting */
+ coloncmd(":sign define %d icon=%s", i + 1, glyphFile);
+
+ if (STRCMP(typeName,"CurrentPC") == 0)
+ curPCtype = typeNum;
+
+ if (globalsignmapused == globalsignmaplen)
+ {
+ if (globalsignmaplen == 0) /* first allocation */
+ {
+ globalsignmaplen = 20;
+ globalsignmap = (char **)alloc_clear(globalsignmaplen*sizeof(char *));
+ }
+ else /* grow it */
+ {
+ int incr;
+ int oldlen = globalsignmaplen;
+
+ globalsignmaplen *= 2;
+ incr = globalsignmaplen - oldlen;
+ globalsignmap = (char **)vim_realloc(globalsignmap,
+ globalsignmaplen * sizeof(char *));
+ memset(globalsignmap + oldlen, 0, incr * sizeof(char *));
+ }
+ }
+
+ globalsignmap[i] = (char *)typeName;
+ globalsignmapused = i + 1;
+ }
+
+ /* check local map; should *not* be found! */
+ for (j = 0; j < buf->signmapused; j++)
+ if (buf->signmap[j] == i + 1)
+ return;
+
+ /* add to local map */
+ if (buf->signmapused == buf->signmaplen)
+ {
+ if (buf->signmaplen == 0) /* first allocation */
+ {
+ buf->signmaplen = 5;
+ buf->signmap = (int *)alloc_clear(buf->signmaplen * sizeof(int *));
+ }
+ else /* grow it */
+ {
+ int incr;
+ int oldlen = buf->signmaplen;
+ buf->signmaplen *= 2;
+ incr = buf->signmaplen - oldlen;
+ buf->signmap = (int *)vim_realloc(buf->signmap,
+ buf->signmaplen*sizeof(int *));
+ memset(buf->signmap + oldlen, 0, incr * sizeof(int *));
+ }
+ }
+
+ buf->signmap[buf->signmapused++] = i + 1;
+
+}
+
+
+/*
+ * See if we have the requested sign type in the buffer.
+ */
+ static int
+mapsigntype(nbbuf_T *buf, int localsigntype)
+{
+ if (--localsigntype >= 0 && localsigntype < buf->signmapused)
+ return buf->signmap[localsigntype];
+
+ return 0;
+}
+
+
+/*
+ * Compute length of buffer, don't print anything.
+ */
+ static long
+get_buf_size(buf_T *bufp)
+{
+ linenr_T lnum;
+ long char_count = 0;
+ int eol_size;
+ long last_check = 100000L;
+
+ if (bufp->b_ml.ml_flags & ML_EMPTY)
+ return 0;
+ else
+ {
+ if (get_fileformat(bufp) == EOL_DOS)
+ eol_size = 2;
+ else
+ eol_size = 1;
+ for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum)
+ {
+ char_count += STRLEN(ml_get(lnum)) + eol_size;
+ /* Check for a CTRL-C every 100000 characters */
+ if (char_count > last_check)
+ {
+ ui_breakcheck();
+ if (got_int)
+ return char_count;
+ last_check = char_count + 100000L;
+ }
+ }
+ /* Correction for when last line doesn't have an EOL. */
+ if (!bufp->b_p_eol && bufp->b_p_bin)
+ char_count -= eol_size;
+ }
+
+ return char_count;
+}
+
+/*
+ * Convert character offset to lnum,col
+ */
+ static pos_T *
+off2pos(buf_T *buf, long offset)
+{
+ linenr_T lnum;
+ static pos_T pos;
+
+ pos.lnum = 0;
+ pos.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ pos.coladd = 0;
+#endif
+
+ if (!(buf->b_ml.ml_flags & ML_EMPTY))
+ {
+ if ((lnum = ml_find_line_or_offset(buf, (linenr_T)0, &offset)) < 0)
+ return NULL;
+ pos.lnum = lnum;
+ pos.col = offset;
+ }
+
+ return &pos;
+}
+
+/*
+ * Convert an argument in the form "1234" to an offset and compute the
+ * lnum/col from it. Convert an argument in the form "123/12" directly to a
+ * lnum/col.
+ * "argp" is advanced to after the argument.
+ * Return a pointer to the position, NULL if something is wrong.
+ */
+ static pos_T *
+get_off_or_lnum(buf_T *buf, char_u **argp)
+{
+ static pos_T mypos;
+ long off;
+
+ off = strtol((char *)*argp, (char **)argp, 10);
+ if (**argp == '/')
+ {
+ mypos.lnum = (linenr_T)off;
+ ++*argp;
+ mypos.col = strtol((char *)*argp, (char **)argp, 10);
+#ifdef FEAT_VIRTUALEDIT
+ mypos.coladd = 0;
+#endif
+ return &mypos;
+ }
+ return off2pos(buf, off);
+}
+
+
+/*
+ * Convert lnum,col to character offset
+ */
+ static long
+pos2off(buf_T *buf, pos_T *pos)
+{
+ long offset = 0;
+
+ if (!(buf->b_ml.ml_flags & ML_EMPTY))
+ {
+ if ((offset = ml_find_line_or_offset(buf, pos->lnum, 0)) < 0)
+ return 0;
+ offset += pos->col;
+ }
+
+ return offset;
+}
+
+
+#endif /* defined(FEAT_NETBEANS_INTG) */
diff --git a/src/normal.c b/src/normal.c
new file mode 100644
index 000000000..89196da0f
--- /dev/null
+++ b/src/normal.c
@@ -0,0 +1,8508 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * normal.c: Contains the main routine for processing characters in command
+ * mode. Communicates closely with the code in ops.c to handle
+ * the operators.
+ */
+
+#include "vim.h"
+
+#ifdef FEAT_VISUAL
+/*
+ * The Visual area is remembered for reselection.
+ */
+static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
+static linenr_T resel_VIsual_line_count; /* number of lines */
+static colnr_T resel_VIsual_col; /* nr of cols or end col */
+
+static int restart_VIsual_select = 0;
+#endif
+
+static int
+# ifdef __BORLANDC__
+_RTLENTRYF
+# endif
+ nv_compare __ARGS((const void *s1, const void *s2));
+static int find_command __ARGS((int cmdchar));
+static void op_colon __ARGS((oparg_T *oap));
+#if defined(FEAT_MOUSE) && defined(FEAT_VISUAL)
+static void find_start_of_word __ARGS((pos_T *));
+static void find_end_of_word __ARGS((pos_T *));
+static int get_mouse_class __ARGS((char_u *p));
+#endif
+static void prep_redo_cmd __ARGS((cmdarg_T *cap));
+static void prep_redo __ARGS((int regname, long, int, int, int, int, int));
+static int checkclearop __ARGS((oparg_T *oap));
+static int checkclearopq __ARGS((oparg_T *oap));
+static void clearop __ARGS((oparg_T *oap));
+static void clearopbeep __ARGS((oparg_T *oap));
+#ifdef FEAT_VISUAL
+static void unshift_special __ARGS((cmdarg_T *cap));
+#endif
+#ifdef FEAT_CMDL_INFO
+static void del_from_showcmd __ARGS((int));
+#endif
+
+/*
+ * nv_*(): functions called to handle Normal and Visual mode commands.
+ * n_*(): functions called to handle Normal mode commands.
+ * v_*(): functions called to handle Visual mode commands.
+ */
+static void nv_ignore __ARGS((cmdarg_T *cap));
+static void nv_error __ARGS((cmdarg_T *cap));
+static void nv_help __ARGS((cmdarg_T *cap));
+static void nv_addsub __ARGS((cmdarg_T *cap));
+static void nv_page __ARGS((cmdarg_T *cap));
+static void nv_gd __ARGS((oparg_T *oap, int nchar));
+static int nv_screengo __ARGS((oparg_T *oap, int dir, long dist));
+#ifdef FEAT_MOUSE
+static void nv_mousescroll __ARGS((cmdarg_T *cap));
+static void nv_mouse __ARGS((cmdarg_T *cap));
+#endif
+static void nv_scroll_line __ARGS((cmdarg_T *cap));
+static void nv_zet __ARGS((cmdarg_T *cap));
+#ifdef FEAT_GUI
+static void nv_ver_scrollbar __ARGS((cmdarg_T *cap));
+static void nv_hor_scrollbar __ARGS((cmdarg_T *cap));
+#endif
+static void nv_exmode __ARGS((cmdarg_T *cap));
+static void nv_colon __ARGS((cmdarg_T *cap));
+static void nv_ctrlg __ARGS((cmdarg_T *cap));
+static void nv_ctrlh __ARGS((cmdarg_T *cap));
+static void nv_clear __ARGS((cmdarg_T *cap));
+static void nv_ctrlo __ARGS((cmdarg_T *cap));
+static void nv_hat __ARGS((cmdarg_T *cap));
+static void nv_Zet __ARGS((cmdarg_T *cap));
+static void nv_ident __ARGS((cmdarg_T *cap));
+#ifdef FEAT_VISUAL
+static int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
+#endif
+static void nv_tagpop __ARGS((cmdarg_T *cap));
+static void nv_scroll __ARGS((cmdarg_T *cap));
+static void nv_right __ARGS((cmdarg_T *cap));
+static void nv_left __ARGS((cmdarg_T *cap));
+static void nv_up __ARGS((cmdarg_T *cap));
+static void nv_down __ARGS((cmdarg_T *cap));
+#ifdef FEAT_SEARCHPATH
+static void nv_gotofile __ARGS((cmdarg_T *cap));
+#endif
+static void nv_end __ARGS((cmdarg_T *cap));
+static void nv_dollar __ARGS((cmdarg_T *cap));
+static void nv_search __ARGS((cmdarg_T *cap));
+static void nv_next __ARGS((cmdarg_T *cap));
+static void normal_search __ARGS((cmdarg_T *cap, int dir, char_u *pat, int opt));
+static void nv_csearch __ARGS((cmdarg_T *cap));
+static void nv_brackets __ARGS((cmdarg_T *cap));
+static void nv_percent __ARGS((cmdarg_T *cap));
+static void nv_brace __ARGS((cmdarg_T *cap));
+static void nv_mark __ARGS((cmdarg_T *cap));
+static void nv_findpar __ARGS((cmdarg_T *cap));
+static void nv_undo __ARGS((cmdarg_T *cap));
+static void nv_kundo __ARGS((cmdarg_T *cap));
+static void nv_Replace __ARGS((cmdarg_T *cap));
+#ifdef FEAT_VREPLACE
+static void nv_vreplace __ARGS((cmdarg_T *cap));
+#endif
+#ifdef FEAT_VISUAL
+static void v_swap_corners __ARGS((int cmdchar));
+#endif
+static void nv_replace __ARGS((cmdarg_T *cap));
+static void n_swapchar __ARGS((cmdarg_T *cap));
+static void nv_cursormark __ARGS((cmdarg_T *cap, int flag, pos_T *pos));
+#ifdef FEAT_VISUAL
+static void v_visop __ARGS((cmdarg_T *cap));
+#endif
+static void nv_subst __ARGS((cmdarg_T *cap));
+static void nv_abbrev __ARGS((cmdarg_T *cap));
+static void nv_optrans __ARGS((cmdarg_T *cap));
+static void nv_gomark __ARGS((cmdarg_T *cap));
+static void nv_pcmark __ARGS((cmdarg_T *cap));
+static void nv_regname __ARGS((cmdarg_T *cap));
+#ifdef FEAT_VISUAL
+static void nv_visual __ARGS((cmdarg_T *cap));
+static void n_start_visual_mode __ARGS((int c));
+#endif
+static void nv_window __ARGS((cmdarg_T *cap));
+static void nv_suspend __ARGS((cmdarg_T *cap));
+static void nv_g_cmd __ARGS((cmdarg_T *cap));
+static void n_opencmd __ARGS((cmdarg_T *cap));
+static void nv_dot __ARGS((cmdarg_T *cap));
+static void nv_redo __ARGS((cmdarg_T *cap));
+static void nv_Undo __ARGS((cmdarg_T *cap));
+static void nv_tilde __ARGS((cmdarg_T *cap));
+static void nv_operator __ARGS((cmdarg_T *cap));
+static void nv_lineop __ARGS((cmdarg_T *cap));
+static void nv_home __ARGS((cmdarg_T *cap));
+static void nv_pipe __ARGS((cmdarg_T *cap));
+static void nv_bck_word __ARGS((cmdarg_T *cap));
+static void nv_wordcmd __ARGS((cmdarg_T *cap));
+static void nv_beginline __ARGS((cmdarg_T *cap));
+#ifdef FEAT_VISUAL
+static void adjust_for_sel __ARGS((cmdarg_T *cap));
+static int unadjust_for_sel __ARGS((void));
+static void nv_select __ARGS((cmdarg_T *cap));
+#endif
+static void nv_goto __ARGS((cmdarg_T *cap));
+static void nv_normal __ARGS((cmdarg_T *cap));
+static void nv_esc __ARGS((cmdarg_T *oap));
+static void nv_edit __ARGS((cmdarg_T *cap));
+static void invoke_edit __ARGS((cmdarg_T *cap, int repl, int cmd, int startln));
+#ifdef FEAT_TEXTOBJ
+static void nv_object __ARGS((cmdarg_T *cap));
+#endif
+static void nv_record __ARGS((cmdarg_T *cap));
+static void nv_at __ARGS((cmdarg_T *cap));
+static void nv_halfpage __ARGS((cmdarg_T *cap));
+static void nv_join __ARGS((cmdarg_T *cap));
+static void nv_put __ARGS((cmdarg_T *cap));
+static void nv_open __ARGS((cmdarg_T *cap));
+#ifdef FEAT_SNIFF
+static void nv_sniff __ARGS((cmdarg_T *cap));
+#endif
+#ifdef FEAT_NETBEANS_INTG
+static void nv_nbcmd __ARGS((cmdarg_T *cap));
+#endif
+#ifdef FEAT_DND
+static void nv_drop __ARGS((cmdarg_T *cap));
+#endif
+
+/*
+ * Function to be called for a Normal or Visual mode command.
+ * The argument is a cmdarg_T.
+ */
+typedef void (*nv_func_T) __ARGS((cmdarg_T *cap));
+
+/* Values for cmd_flags. */
+#define NV_NCH 0x01 /* may need to get a second char */
+#define NV_NCH_NOP (0x02|NV_NCH) /* get second char when no operator pending */
+#define NV_NCH_ALW (0x04|NV_NCH) /* always get a second char */
+#define NV_LANG 0x08 /* second char needs language adjustment */
+
+#define NV_SS 0x10 /* may start selection */
+#define NV_SSS 0x20 /* may start selection with shift modifier */
+#define NV_STS 0x40 /* may stop selection without shift modif. */
+#define NV_RL 0x80 /* 'rightleft' modifies command */
+#define NV_KEEPREG 0x100 /* don't clear regname */
+#define NV_NCW 0x200 /* not allowed in command-line window */
+
+/*
+ * Generally speaking, every Normal mode command should either clear any
+ * pending operator (with *clearop*()), or set the motion type variable
+ * oap->motion_type.
+ *
+ * When a cursor motion command is made, it is marked as being a character or
+ * line oriented motion. Then, if an operator is in effect, the operation
+ * becomes character or line oriented accordingly.
+ */
+
+/*
+ * This table contains one entry for every Normal or Visual mode command.
+ * The order doesn't matter, init_normal_cmds() will create a sorted index.
+ * It is faster when all keys from zero to '~' are present.
+ */
+static const struct nv_cmd
+{
+ int cmd_char; /* (first) command character */
+ nv_func_T cmd_func; /* function for this command */
+ short_u cmd_flags; /* NV_ flags */
+ short cmd_arg; /* value for ca.arg */
+} nv_cmds[] =
+{
+ {NUL, nv_error, 0, 0},
+ {Ctrl_A, nv_addsub, 0, 0},
+ {Ctrl_B, nv_page, NV_STS, BACKWARD},
+ {Ctrl_C, nv_esc, 0, TRUE},
+ {Ctrl_D, nv_halfpage, 0, 0},
+ {Ctrl_E, nv_scroll_line, 0, TRUE},
+ {Ctrl_F, nv_page, NV_STS, FORWARD},
+ {Ctrl_G, nv_ctrlg, 0, 0},
+ {Ctrl_H, nv_ctrlh, 0, 0},
+ {Ctrl_I, nv_pcmark, 0, 0},
+ {NL, nv_down, 0, FALSE},
+ {Ctrl_K, nv_error, 0, 0},
+ {Ctrl_L, nv_clear, 0, 0},
+ {CAR, nv_down, 0, TRUE},
+ {Ctrl_N, nv_down, NV_STS, FALSE},
+ {Ctrl_O, nv_ctrlo, 0, 0},
+ {Ctrl_P, nv_up, NV_STS, FALSE},
+ {Ctrl_Q, nv_ignore, 0, 0},
+ {Ctrl_R, nv_redo, 0, 0},
+ {Ctrl_S, nv_ignore, 0, 0},
+ {Ctrl_T, nv_tagpop, NV_NCW, 0},
+ {Ctrl_U, nv_halfpage, 0, 0},
+#ifdef FEAT_VISUAL
+ {Ctrl_V, nv_visual, 0, FALSE},
+ {'V', nv_visual, 0, FALSE},
+ {'v', nv_visual, 0, FALSE},
+#else
+ {Ctrl_V, nv_error, 0, 0},
+ {'V', nv_error, 0, 0},
+ {'v', nv_error, 0, 0},
+#endif
+ {Ctrl_W, nv_window, 0, 0},
+ {Ctrl_X, nv_addsub, 0, 0},
+ {Ctrl_Y, nv_scroll_line, 0, FALSE},
+ {Ctrl_Z, nv_suspend, 0, 0},
+ {ESC, nv_esc, 0, FALSE},
+ {Ctrl_BSL, nv_normal, NV_NCH_ALW, 0},
+ {Ctrl_RSB, nv_ident, NV_NCW, 0},
+ {Ctrl_HAT, nv_hat, NV_NCW, 0},
+ {Ctrl__, nv_error, 0, 0},
+ {' ', nv_right, 0, 0},
+ {'!', nv_operator, 0, 0},
+ {'"', nv_regname, NV_NCH_NOP|NV_KEEPREG, 0},
+ {'#', nv_ident, 0, 0},
+ {'$', nv_dollar, 0, 0},
+ {'%', nv_percent, 0, 0},
+ {'&', nv_optrans, 0, 0},
+ {'\'', nv_gomark, NV_NCH_ALW, TRUE},
+ {'(', nv_brace, 0, BACKWARD},
+ {')', nv_brace, 0, FORWARD},
+ {'*', nv_ident, 0, 0},
+ {'+', nv_down, 0, TRUE},
+ {',', nv_csearch, 0, TRUE},
+ {'-', nv_up, 0, TRUE},
+ {'.', nv_dot, NV_KEEPREG, 0},
+ {'/', nv_search, 0, FALSE},
+ {'0', nv_beginline, 0, 0},
+ {'1', nv_ignore, 0, 0},
+ {'2', nv_ignore, 0, 0},
+ {'3', nv_ignore, 0, 0},
+ {'4', nv_ignore, 0, 0},
+ {'5', nv_ignore, 0, 0},
+ {'6', nv_ignore, 0, 0},
+ {'7', nv_ignore, 0, 0},
+ {'8', nv_ignore, 0, 0},
+ {'9', nv_ignore, 0, 0},
+ {':', nv_colon, 0, 0},
+ {';', nv_csearch, 0, FALSE},
+ {'<', nv_operator, NV_RL, 0},
+ {'=', nv_operator, 0, 0},
+ {'>', nv_operator, NV_RL, 0},
+ {'?', nv_search, 0, FALSE},
+ {'@', nv_at, NV_NCH_NOP, FALSE},
+ {'A', nv_edit, 0, 0},
+ {'B', nv_bck_word, 0, 1},
+ {'C', nv_abbrev, NV_KEEPREG, 0},
+ {'D', nv_abbrev, NV_KEEPREG, 0},
+ {'E', nv_wordcmd, 0, TRUE},
+ {'F', nv_csearch, NV_NCH_ALW|NV_LANG, BACKWARD},
+ {'G', nv_goto, 0, TRUE},
+ {'H', nv_scroll, 0, 0},
+ {'I', nv_edit, 0, 0},
+ {'J', nv_join, 0, 0},
+ {'K', nv_ident, 0, 0},
+ {'L', nv_scroll, 0, 0},
+ {'M', nv_scroll, 0, 0},
+ {'N', nv_next, 0, SEARCH_REV},
+ {'O', nv_open, 0, 0},
+ {'P', nv_put, 0, 0},
+ {'Q', nv_exmode, NV_NCW, 0},
+ {'R', nv_Replace, 0, FALSE},
+ {'S', nv_subst, NV_KEEPREG, 0},
+ {'T', nv_csearch, NV_NCH_ALW|NV_LANG, BACKWARD},
+ {'U', nv_Undo, 0, 0},
+ {'W', nv_wordcmd, 0, TRUE},
+ {'X', nv_abbrev, NV_KEEPREG, 0},
+ {'Y', nv_abbrev, NV_KEEPREG, 0},
+ {'Z', nv_Zet, NV_NCH_NOP|NV_NCW, 0},
+ {'[', nv_brackets, NV_NCH_ALW, BACKWARD},
+ {'\\', nv_error, 0, 0},
+ {']', nv_brackets, NV_NCH_ALW, FORWARD},
+ {'^', nv_beginline, 0, BL_WHITE | BL_FIX},
+ {'_', nv_lineop, 0, 0},
+ {'`', nv_gomark, NV_NCH_ALW, FALSE},
+ {'a', nv_edit, NV_NCH, 0},
+ {'b', nv_bck_word, 0, 0},
+ {'c', nv_operator, 0, 0},
+ {'d', nv_operator, 0, 0},
+ {'e', nv_wordcmd, 0, FALSE},
+ {'f', nv_csearch, NV_NCH_ALW|NV_LANG, FORWARD},
+ {'g', nv_g_cmd, NV_NCH_ALW, FALSE},
+ {'h', nv_left, NV_RL, 0},
+ {'i', nv_edit, NV_NCH, 0},
+ {'j', nv_down, 0, FALSE},
+ {'k', nv_up, 0, FALSE},
+ {'l', nv_right, NV_RL, 0},
+ {'m', nv_mark, NV_NCH_NOP, 0},
+ {'n', nv_next, 0, 0},
+ {'o', nv_open, 0, 0},
+ {'p', nv_put, 0, 0},
+ {'q', nv_record, NV_NCH, 0},
+ {'r', nv_replace, NV_NCH_NOP|NV_LANG, 0},
+ {'s', nv_subst, NV_KEEPREG, 0},
+ {'t', nv_csearch, NV_NCH_ALW|NV_LANG, FORWARD},
+ {'u', nv_undo, 0, 0},
+ {'w', nv_wordcmd, 0, FALSE},
+ {'x', nv_abbrev, NV_KEEPREG, 0},
+ {'y', nv_operator, 0, 0},
+ {'z', nv_zet, NV_NCH_ALW, 0},
+ {'{', nv_findpar, 0, BACKWARD},
+ {'|', nv_pipe, 0, 0},
+ {'}', nv_findpar, 0, FORWARD},
+ {'~', nv_tilde, 0, 0},
+
+ /* pound sign */
+ {POUND, nv_ident, 0, 0},
+#ifdef FEAT_MOUSE
+ {K_MOUSEUP, nv_mousescroll, 0, TRUE},
+ {K_MOUSEDOWN, nv_mousescroll, 0, FALSE},
+ {K_LEFTMOUSE, nv_mouse, 0, 0},
+ {K_LEFTMOUSE_NM, nv_mouse, 0, 0},
+ {K_LEFTDRAG, nv_mouse, 0, 0},
+ {K_LEFTRELEASE, nv_mouse, 0, 0},
+ {K_LEFTRELEASE_NM, nv_mouse, 0, 0},
+ {K_MIDDLEMOUSE, nv_mouse, 0, 0},
+ {K_MIDDLEDRAG, nv_mouse, 0, 0},
+ {K_MIDDLERELEASE, nv_mouse, 0, 0},
+ {K_RIGHTMOUSE, nv_mouse, 0, 0},
+ {K_RIGHTDRAG, nv_mouse, 0, 0},
+ {K_RIGHTRELEASE, nv_mouse, 0, 0},
+ {K_X1MOUSE, nv_mouse, 0, 0},
+ {K_X1DRAG, nv_mouse, 0, 0},
+ {K_X1RELEASE, nv_mouse, 0, 0},
+ {K_X2MOUSE, nv_mouse, 0, 0},
+ {K_X2DRAG, nv_mouse, 0, 0},
+ {K_X2RELEASE, nv_mouse, 0, 0},
+#endif
+ {K_IGNORE, nv_ignore, 0, 0},
+ {K_INS, nv_edit, 0, 0},
+ {K_KINS, nv_edit, 0, 0},
+ {K_BS, nv_ctrlh, 0, 0},
+ {K_UP, nv_up, NV_SSS|NV_STS, FALSE},
+ {K_S_UP, nv_page, NV_SS, BACKWARD},
+ {K_DOWN, nv_down, NV_SSS|NV_STS, FALSE},
+ {K_S_DOWN, nv_page, NV_SS, FORWARD},
+ {K_LEFT, nv_left, NV_SSS|NV_STS|NV_RL, 0},
+ {K_S_LEFT, nv_bck_word, NV_SS|NV_RL, 0},
+ {K_C_LEFT, nv_bck_word, NV_SSS|NV_RL|NV_STS, 1},
+ {K_RIGHT, nv_right, NV_SSS|NV_STS|NV_RL, 0},
+ {K_S_RIGHT, nv_wordcmd, NV_SS|NV_RL, FALSE},
+ {K_C_RIGHT, nv_wordcmd, NV_SSS|NV_RL|NV_STS, TRUE},
+ {K_PAGEUP, nv_page, NV_SSS|NV_STS, BACKWARD},
+ {K_KPAGEUP, nv_page, NV_SSS|NV_STS, BACKWARD},
+ {K_PAGEDOWN, nv_page, NV_SSS|NV_STS, FORWARD},
+ {K_KPAGEDOWN, nv_page, NV_SSS|NV_STS, FORWARD},
+ {K_END, nv_end, NV_SSS|NV_STS, FALSE},
+ {K_KEND, nv_end, NV_SSS|NV_STS, FALSE},
+ {K_XEND, nv_end, NV_SSS|NV_STS, FALSE},
+ {K_S_END, nv_end, NV_SS, FALSE},
+ {K_C_END, nv_end, NV_SSS|NV_STS, TRUE},
+ {K_HOME, nv_home, NV_SSS|NV_STS, 0},
+ {K_KHOME, nv_home, NV_SSS|NV_STS, 0},
+ {K_XHOME, nv_home, NV_SSS|NV_STS, 0},
+ {K_S_HOME, nv_home, NV_SS, 0},
+ {K_C_HOME, nv_goto, NV_SSS|NV_STS, FALSE},
+ {K_DEL, nv_abbrev, 0, 0},
+ {K_KDEL, nv_abbrev, 0, 0},
+ {K_UNDO, nv_kundo, 0, 0},
+ {K_HELP, nv_help, NV_NCW, 0},
+ {K_F1, nv_help, NV_NCW, 0},
+ {K_XF1, nv_help, NV_NCW, 0},
+#ifdef FEAT_VISUAL
+ {K_SELECT, nv_select, 0, 0},
+#endif
+#ifdef FEAT_GUI
+ {K_VER_SCROLLBAR, nv_ver_scrollbar, 0, 0},
+ {K_HOR_SCROLLBAR, nv_hor_scrollbar, 0, 0},
+#endif
+#ifdef FEAT_FKMAP
+ {K_F8, farsi_fkey, 0, 0},
+ {K_F9, farsi_fkey, 0, 0},
+#endif
+#ifdef FEAT_SNIFF
+ {K_SNIFF, nv_sniff, 0, 0},
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ {K_F21, nv_nbcmd, NV_NCH_ALW, 0},
+#endif
+#ifdef FEAT_DND
+ {K_DROP, nv_drop, NV_STS, 0},
+#endif
+};
+
+/* Number of commands in nv_cmds[]. */
+#define NV_CMDS_SIZE (sizeof(nv_cmds) / sizeof(struct nv_cmd))
+
+/* Sorted index of commands in nv_cmds[]. */
+static short nv_cmd_idx[NV_CMDS_SIZE];
+
+/* The highest index for which
+ * nv_cmds[idx].cmd_char == nv_cmd_idx[nv_cmds[idx].cmd_char] */
+static int nv_max_linear;
+
+/*
+ * Compare functions for qsort() below, that checks the command character
+ * through the index in nv_cmd_idx[].
+ */
+ static int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+nv_compare(s1, s2)
+ const void *s1;
+ const void *s2;
+{
+ int c1, c2;
+
+ /* The commands are sorted on absolute value. */
+ c1 = nv_cmds[*(const short *)s1].cmd_char;
+ c2 = nv_cmds[*(const short *)s2].cmd_char;
+ if (c1 < 0)
+ c1 = -c1;
+ if (c2 < 0)
+ c2 = -c2;
+ return c1 - c2;
+}
+
+/*
+ * Initialize the nv_cmd_idx[] table.
+ */
+ void
+init_normal_cmds()
+{
+ int i;
+
+ /* Fill the index table with a one to one relation. */
+ for (i = 0; i < NV_CMDS_SIZE; ++i)
+ nv_cmd_idx[i] = i;
+
+ /* Sort the commands by the command character. */
+ qsort((void *)&nv_cmd_idx, (size_t)NV_CMDS_SIZE, sizeof(short), nv_compare);
+
+ /* Find the first entry that can't be indexed by the command character. */
+ for (i = 0; i < NV_CMDS_SIZE; ++i)
+ if (i != nv_cmds[nv_cmd_idx[i]].cmd_char)
+ break;
+ nv_max_linear = i - 1;
+}
+
+/*
+ * Search for a command in the commands table.
+ * Returns -1 for invalid command.
+ */
+ static int
+find_command(cmdchar)
+ int cmdchar;
+{
+ int i;
+ int idx;
+ int top, bot;
+ int c;
+
+#ifdef FEAT_MBYTE
+ /* A multi-byte character is never a command. */
+ if (cmdchar >= 0x100)
+ return -1;
+#endif
+
+ /* We use the absolute value of the character. Special keys have a
+ * negative value, but are sorted on their absolute value. */
+ if (cmdchar < 0)
+ cmdchar = -cmdchar;
+
+ /* If the character is in the first part: The character is the index into
+ * nv_cmd_idx[]. */
+ if (cmdchar <= nv_max_linear)
+ return nv_cmd_idx[cmdchar];
+
+ /* Perform a binary search. */
+ bot = nv_max_linear + 1;
+ top = NV_CMDS_SIZE - 1;
+ idx = -1;
+ while (bot <= top)
+ {
+ i = (top + bot) / 2;
+ c = nv_cmds[nv_cmd_idx[i]].cmd_char;
+ if (c < 0)
+ c = -c;
+ if (cmdchar == c)
+ {
+ idx = nv_cmd_idx[i];
+ break;
+ }
+ if (cmdchar > c)
+ bot = i + 1;
+ else
+ top = i - 1;
+ }
+ return idx;
+}
+
+/*
+ * Execute a command in Normal mode.
+ */
+/*ARGSUSED*/
+ void
+normal_cmd(oap, toplevel)
+ oparg_T *oap;
+ int toplevel; /* TRUE when called from main() */
+{
+ static long opcount = 0; /* ca.opcount saved here */
+ cmdarg_T ca; /* command arguments */
+ int c;
+ int ctrl_w = FALSE; /* got CTRL-W command */
+ int old_col = curwin->w_curswant;
+#ifdef FEAT_CMDL_INFO
+ int need_flushbuf; /* need to call out_flush() */
+#endif
+#ifdef FEAT_VISUAL
+ pos_T old_pos; /* cursor position before command */
+ int mapped_len;
+#endif
+ static int old_mapped_len = 0;
+ int idx;
+
+ vim_memset(&ca, 0, sizeof(ca)); /* also resets ca.retval */
+ ca.oap = oap;
+ ca.opcount = opcount;
+
+#ifdef FEAT_SNIFF
+ want_sniff_request = sniff_connected;
+#endif
+
+ /*
+ * If there is an operator pending, then the command we take this time
+ * will terminate it. Finish_op tells us to finish the operation before
+ * returning this time (unless the operation was cancelled).
+ */
+#ifdef CURSOR_SHAPE
+ c = finish_op;
+#endif
+ finish_op = (oap->op_type != OP_NOP);
+#ifdef CURSOR_SHAPE
+ if (finish_op != c)
+ {
+ ui_cursor_shape(); /* may show different cursor shape */
+# ifdef FEAT_MOUSESHAPE
+ update_mouseshape(-1);
+# endif
+ }
+#endif
+
+ if (!finish_op && !oap->regname)
+ ca.opcount = 0;
+
+#ifdef FEAT_VISUAL
+ mapped_len = typebuf_maplen();
+#endif
+
+ State = NORMAL_BUSY;
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = FALSE; /* allow scrolling here */
+#endif
+
+ /*
+ * Get the command character from the user.
+ */
+ c = safe_vgetc();
+
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(c, TRUE);
+#endif
+
+ /*
+ * If a mapping was started in Visual or Select mode, remember the length
+ * of the mapping. This is used below to not return to Insert mode for as
+ * long as the mapping is being executed.
+ */
+ if (restart_edit == 0)
+ old_mapped_len = 0;
+ else if (old_mapped_len
+#ifdef FEAT_VISUAL
+ || (VIsual_active && mapped_len == 0 && typebuf_maplen() > 0)
+#endif
+ )
+ old_mapped_len = typebuf_maplen();
+
+ if (c == NUL)
+ c = K_ZERO;
+
+#ifdef FEAT_VISUAL
+ /*
+ * In Select mode, typed text replaces the selection.
+ */
+ if (VIsual_active
+ && VIsual_select
+ && (vim_isprintc(c) || c == NL || c == CAR || c == K_KENTER))
+ {
+# ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+
+ buf[(*mb_char2bytes)(c, buf)] = NUL;
+# else
+ char_u buf[2];
+
+ buf[0] = c;
+ buf[1] = NUL;
+# endif
+ /* Fake a "c"hange command.
+ * Insert the typed character in the typeahead buffer, so that it will
+ * be mapped in Insert mode. Required for ":lmap" to work. May cause
+ * mapping a character from ":vnoremap"... */
+ (void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
+ c = 'c';
+ }
+#endif
+
+#ifdef FEAT_CMDL_INFO
+ need_flushbuf = add_to_showcmd(c);
+#endif
+
+getcount:
+#ifdef FEAT_VISUAL
+ if (!(VIsual_active && VIsual_select))
+#endif
+ {
+ /*
+ * Handle a count before a command and compute ca.count0.
+ * Note that '0' is a command and not the start of a count, but it's
+ * part of a count after other digits.
+ */
+ while ( (c >= '1' && c <= '9')
+ || (ca.count0 != 0 && (c == K_DEL || c == K_KDEL || c == '0')))
+ {
+ if (c == K_DEL || c == K_KDEL)
+ {
+ ca.count0 /= 10;
+#ifdef FEAT_CMDL_INFO
+ del_from_showcmd(4); /* delete the digit and ~@% */
+#endif
+ }
+ else
+ ca.count0 = ca.count0 * 10 + (c - '0');
+ if (ca.count0 < 0) /* got too large! */
+ ca.count0 = 999999999L;
+ if (ctrl_w)
+ {
+ ++no_mapping;
+ ++allow_keys; /* no mapping for nchar, but keys */
+ }
+ ++no_zero_mapping; /* don't map zero here */
+ c = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(c, TRUE);
+#endif
+ --no_zero_mapping;
+ if (ctrl_w)
+ {
+ --no_mapping;
+ --allow_keys;
+ }
+#ifdef FEAT_CMDL_INFO
+ need_flushbuf |= add_to_showcmd(c);
+#endif
+ }
+
+ /*
+ * If we got CTRL-W there may be a/another count
+ */
+ if (c == Ctrl_W && !ctrl_w && oap->op_type == OP_NOP)
+ {
+ ctrl_w = TRUE;
+ ca.opcount = ca.count0; /* remember first count */
+ ca.count0 = 0;
+ ++no_mapping;
+ ++allow_keys; /* no mapping for nchar, but keys */
+ c = safe_vgetc(); /* get next character */
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(c, TRUE);
+#endif
+ --no_mapping;
+ --allow_keys;
+#ifdef FEAT_CMDL_INFO
+ need_flushbuf |= add_to_showcmd(c);
+#endif
+ goto getcount; /* jump back */
+ }
+ }
+
+ /*
+ * If we're in the middle of an operator (including after entering a yank
+ * buffer with '"') AND we had a count before the operator, then that
+ * count overrides the current value of ca.count0.
+ * What this means effectively, is that commands like "3dw" get turned
+ * into "d3w" which makes things fall into place pretty neatly.
+ * If you give a count before AND after the operator, they are multiplied.
+ */
+ if (ca.opcount != 0)
+ {
+ if (ca.count0)
+ ca.count0 *= ca.opcount;
+ else
+ ca.count0 = ca.opcount;
+ }
+
+ /*
+ * Always remember the count. It will be set to zero (on the next call,
+ * above) when there is no pending operator.
+ * When called from main(), save the count for use by the "count" built-in
+ * variable.
+ */
+ ca.opcount = ca.count0;
+ ca.count1 = (ca.count0 == 0 ? 1 : ca.count0);
+
+#ifdef FEAT_EVAL
+ /*
+ * Only set v:count when called from main() and not a stuffed command.
+ */
+ if (toplevel && stuff_empty())
+ set_vcount(ca.count0, ca.count1);
+#endif
+
+ /*
+ * Find the command character in the table of commands.
+ * For CTRL-W we already got nchar when looking for a count.
+ */
+ if (ctrl_w)
+ {
+ ca.nchar = c;
+ ca.cmdchar = Ctrl_W;
+ }
+ else
+ ca.cmdchar = c;
+ idx = find_command(ca.cmdchar);
+ if (idx < 0)
+ {
+ /* Not a known command: beep. */
+ clearopbeep(oap);
+ goto normal_end;
+ }
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && (nv_cmds[idx].cmd_flags & NV_NCW))
+ {
+ /* This command is not allowed in the cmdline window: beep. */
+ clearopbeep(oap);
+ EMSG(_(e_cmdwin));
+ goto normal_end;
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /*
+ * In Visual/Select mode, a few keys are handled in a special way.
+ */
+ if (VIsual_active)
+ {
+ /* when 'keymodel' contains "stopsel" may stop Select/Visual mode */
+ if (km_stopsel
+ && (nv_cmds[idx].cmd_flags & NV_STS)
+ && !(mod_mask & MOD_MASK_SHIFT))
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED);
+ }
+
+ /* Keys that work different when 'keymodel' contains "startsel" */
+ if (km_startsel)
+ {
+ if (nv_cmds[idx].cmd_flags & NV_SS)
+ {
+ unshift_special(&ca);
+ idx = find_command(ca.cmdchar);
+ }
+ else if ((nv_cmds[idx].cmd_flags & NV_SSS)
+ && (mod_mask & MOD_MASK_SHIFT))
+ {
+ mod_mask &= ~MOD_MASK_SHIFT;
+ }
+ }
+ }
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (curwin->w_p_rl && KeyTyped && !KeyStuffed
+ && (nv_cmds[idx].cmd_flags & NV_RL))
+ {
+ /* Invert horizontal movements and operations. Only when typed by the
+ * user directly, not when the result of a mapping or "x" translated
+ * to "dl". */
+ switch (ca.cmdchar)
+ {
+ case 'l': ca.cmdchar = 'h'; break;
+ case K_RIGHT: ca.cmdchar = K_LEFT; break;
+ case K_S_RIGHT: ca.cmdchar = K_S_LEFT; break;
+ case K_C_RIGHT: ca.cmdchar = K_C_LEFT; break;
+ case 'h': ca.cmdchar = 'l'; break;
+ case K_LEFT: ca.cmdchar = K_RIGHT; break;
+ case K_S_LEFT: ca.cmdchar = K_S_RIGHT; break;
+ case K_C_LEFT: ca.cmdchar = K_C_RIGHT; break;
+ case '>': ca.cmdchar = '<'; break;
+ case '<': ca.cmdchar = '>'; break;
+ }
+ idx = find_command(ca.cmdchar);
+ }
+#endif
+
+ /*
+ * Get an additional character if we need one.
+ */
+ if ((nv_cmds[idx].cmd_flags & NV_NCH)
+ && (((nv_cmds[idx].cmd_flags & NV_NCH_NOP) == NV_NCH_NOP
+ && oap->op_type == OP_NOP)
+ || (nv_cmds[idx].cmd_flags & NV_NCH_ALW) == NV_NCH_ALW
+ || (ca.cmdchar == 'q'
+ && oap->op_type == OP_NOP
+ && !Recording
+ && !Exec_reg)
+ || ((ca.cmdchar == 'a' || ca.cmdchar == 'i')
+ && (oap->op_type != OP_NOP
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ ))))
+ {
+ int *cp;
+ int repl = FALSE; /* get character for replace mode */
+ int lit = FALSE; /* get extra character literally */
+ int langmap_active = FALSE; /* using :lmap mappings */
+ int lang; /* getting a text character */
+#ifdef USE_IM_CONTROL
+ int save_smd; /* saved value of p_smd */
+#endif
+
+ ++no_mapping;
+ ++allow_keys; /* no mapping for nchar, but allow key codes */
+ if (ca.cmdchar == 'g')
+ {
+ /*
+ * For 'g' get the next character now, so that we can check for
+ * "gr", "g'" and "g`".
+ */
+ ca.nchar = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(ca.nchar, TRUE);
+#endif
+#ifdef FEAT_CMDL_INFO
+ need_flushbuf |= add_to_showcmd(ca.nchar);
+#endif
+ if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`'
+ || ca.nchar == Ctrl_BSL)
+ {
+ cp = &ca.extra_char; /* need to get a third character */
+ if (ca.nchar != 'r')
+ lit = TRUE; /* get it literally */
+ else
+ repl = TRUE; /* get it in replace mode */
+ }
+ else
+ cp = NULL; /* no third character needed */
+ }
+ else
+ {
+ if (ca.cmdchar == 'r') /* get it in replace mode */
+ repl = TRUE;
+ cp = &ca.nchar;
+ }
+ lang = (repl || (nv_cmds[idx].cmd_flags & NV_LANG));
+
+ /*
+ * Get a second or third character.
+ */
+ if (cp != NULL)
+ {
+#ifdef CURSOR_SHAPE
+ if (repl)
+ {
+ State = REPLACE; /* pretend Replace mode */
+ ui_cursor_shape(); /* show different cursor shape */
+ }
+#endif
+ if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP)
+ {
+ /* Allow mappings defined with ":lmap". */
+ --no_mapping;
+ --allow_keys;
+ if (repl)
+ State = LREPLACE;
+ else
+ State = LANGMAP;
+ langmap_active = TRUE;
+ }
+#ifdef USE_IM_CONTROL
+ save_smd = p_smd;
+ p_smd = FALSE; /* Don't let the IM code show the mode here */
+ if (lang && curbuf->b_p_iminsert == B_IMODE_IM)
+ im_set_active(TRUE);
+#endif
+
+ *cp = safe_vgetc();
+
+ if (langmap_active)
+ {
+ /* Undo the decrement done above */
+ ++no_mapping;
+ ++allow_keys;
+ State = NORMAL_BUSY;
+ }
+#ifdef USE_IM_CONTROL
+ if (lang)
+ {
+ if (curbuf->b_p_iminsert != B_IMODE_LMAP)
+ im_save_status(&curbuf->b_p_iminsert);
+ im_set_active(FALSE);
+ }
+ p_smd = save_smd;
+#endif
+#ifdef CURSOR_SHAPE
+ State = NORMAL_BUSY;
+#endif
+#ifdef FEAT_CMDL_INFO
+ need_flushbuf |= add_to_showcmd(*cp);
+#endif
+
+ if (!lit)
+ {
+#ifdef FEAT_DIGRAPHS
+ /* Typing CTRL-K gets a digraph. */
+ if (*cp == Ctrl_K
+ && ((nv_cmds[idx].cmd_flags & NV_LANG)
+ || cp == &ca.extra_char)
+ && vim_strchr(p_cpo, CPO_DIGRAPH) == NULL)
+ {
+ c = get_digraph(FALSE);
+ if (c > 0)
+ {
+ *cp = c;
+# ifdef FEAT_CMDL_INFO
+ /* Guessing how to update showcmd here... */
+ del_from_showcmd(3);
+ need_flushbuf |= add_to_showcmd(*cp);
+# endif
+ }
+ }
+#endif
+
+#ifdef FEAT_LANGMAP
+ /* adjust chars > 127, except after "tTfFr" commands */
+ LANGMAP_ADJUST(*cp, !lang);
+#endif
+#ifdef FEAT_RIGHTLEFT
+ /* adjust Hebrew mapped char */
+ if (p_hkmap && lang && KeyTyped)
+ *cp = hkmap(*cp);
+# ifdef FEAT_FKMAP
+ /* adjust Farsi mapped char */
+ if (p_fkmap && lang && KeyTyped)
+ *cp = fkmap(*cp);
+# endif
+#endif
+ }
+
+ /*
+ * When the next character is CTRL-\ a following CTRL-N means the
+ * command is aborted and we go to Normal mode.
+ */
+ if (cp == &ca.extra_char
+ && ca.nchar == Ctrl_BSL
+ && (ca.extra_char == Ctrl_N || ca.extra_char == Ctrl_G))
+ {
+ ca.cmdchar = Ctrl_BSL;
+ ca.nchar = ca.extra_char;
+ idx = find_command(ca.cmdchar);
+ }
+ else if (*cp == Ctrl_BSL)
+ {
+ long towait = (p_ttm >= 0 ? p_ttm : p_tm);
+
+ /* There is a busy wait here when typing "f<C-\>" and then
+ * something different from CTRL-N. Can't be avoided. */
+ while ((c = vpeekc()) <= 0 && towait > 0L)
+ {
+ do_sleep(towait > 50L ? 50L : towait);
+ towait -= 50L;
+ }
+ if (c > 0)
+ {
+ c = safe_vgetc();
+ if (c != Ctrl_N && c != Ctrl_G)
+ vungetc(c);
+ else
+ {
+ ca.cmdchar = Ctrl_BSL;
+ ca.nchar = c;
+ idx = find_command(ca.cmdchar);
+ }
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ /* When getting a text character and the next character is a
+ * multi-byte character, it could be a composing character.
+ * However, don't wait for it to arrive. */
+ while (enc_utf8 && lang && (c = vpeekc()) > 0
+ && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
+ {
+ c = safe_vgetc();
+ if (!utf_iscomposing(c))
+ {
+ vungetc(c); /* it wasn't, put it back */
+ break;
+ }
+ else if (ca.ncharC1 == 0)
+ ca.ncharC1 = c;
+ else
+ ca.ncharC2 = c;
+ }
+#endif
+ }
+ --no_mapping;
+ --allow_keys;
+ }
+
+#ifdef FEAT_CMDL_INFO
+ /*
+ * Flush the showcmd characters onto the screen so we can see them while
+ * the command is being executed. Only do this when the shown command was
+ * actually displayed, otherwise this will slow down a lot when executing
+ * mappings.
+ */
+ if (need_flushbuf)
+ out_flush();
+#endif
+
+ State = NORMAL;
+
+ if (ca.nchar == ESC)
+ {
+ clearop(oap);
+ if (restart_edit == 0 && goto_im())
+ restart_edit = 'a';
+ goto normal_end;
+ }
+
+ msg_didout = FALSE; /* don't scroll screen up for normal command */
+ msg_col = 0;
+
+#ifdef FEAT_VISUAL
+ old_pos = curwin->w_cursor; /* remember where cursor was */
+
+ /* When 'keymodel' contains "startsel" some keys start Select/Visual
+ * mode. */
+ if (!VIsual_active && km_startsel)
+ {
+ if (nv_cmds[idx].cmd_flags & NV_SS)
+ {
+ start_selection();
+ unshift_special(&ca);
+ idx = find_command(ca.cmdchar);
+ }
+ else if ((nv_cmds[idx].cmd_flags & NV_SSS)
+ && (mod_mask & MOD_MASK_SHIFT))
+ {
+ start_selection();
+ mod_mask &= ~MOD_MASK_SHIFT;
+ }
+ }
+#endif
+
+ /*
+ * Execute the command!
+ * Call the command function found in the commands table.
+ */
+ ca.arg = nv_cmds[idx].cmd_arg;
+ (nv_cmds[idx].cmd_func)(&ca);
+
+ /*
+ * If we didn't start or finish an operator, reset oap->regname, unless we
+ * need it later.
+ */
+ if (!finish_op
+ && !oap->op_type
+ && (idx < 0 || !(nv_cmds[idx].cmd_flags & NV_KEEPREG)))
+ {
+ clearop(oap);
+#ifdef FEAT_EVAL
+ set_reg_var('"');
+#endif
+ }
+
+ /*
+ * If an operation is pending, handle it...
+ */
+ do_pending_operator(&ca, old_col, FALSE);
+
+ /*
+ * Wait for a moment when a message is displayed that will be overwritten
+ * by the mode message.
+ * In Visual mode and with "^O" in Insert mode, a short message will be
+ * overwritten by the mode message. Wait a bit, until a key is hit.
+ * In Visual mode, it's more important to keep the Visual area updated
+ * than keeping a message (e.g. from a /pat search).
+ * Only do this if the command was typed, not from a mapping.
+ * Don't wait when emsg_silent is non-zero.
+ * Also wait a bit after an error message, e.g. for "^O:".
+ * Don't redraw the screen, it would remove the message.
+ */
+ if ( ((p_smd
+ && (restart_edit != 0
+#ifdef FEAT_VISUAL
+ || (VIsual_active
+ && old_pos.lnum == curwin->w_cursor.lnum
+ && old_pos.col == curwin->w_cursor.col)
+#endif
+ )
+ && (clear_cmdline
+ || redraw_cmdline)
+ && (msg_didout || (msg_didany && msg_scroll))
+ && !msg_nowait
+ && KeyTyped)
+ || (restart_edit != 0
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ && (msg_scroll
+ || emsg_on_display)))
+ && oap->regname == 0
+ && !(ca.retval & CA_COMMAND_BUSY)
+ && stuff_empty()
+ && typebuf_typed()
+ && emsg_silent == 0
+ && !did_wait_return
+ && oap->op_type == OP_NOP)
+ {
+ int save_State = State;
+
+ /* Draw the cursor with the right shape here */
+ if (restart_edit != 0)
+ State = INSERT;
+
+ /* If need to redraw, and there is a "keep_msg", redraw before the
+ * delay */
+ if (must_redraw && keep_msg != NULL && !emsg_on_display)
+ {
+ char_u *kmsg;
+
+ kmsg = keep_msg;
+ keep_msg = NULL;
+ /* showmode() will clear keep_msg, but we want to use it anyway */
+ update_screen(0);
+ /* now reset it, otherwise it's put in the history again */
+ keep_msg = kmsg;
+ msg_attr(kmsg, keep_msg_attr);
+ vim_free(kmsg);
+ }
+ setcursor();
+ cursor_on();
+ out_flush();
+ if (msg_scroll || emsg_on_display)
+ ui_delay(1000L, TRUE); /* wait at least one second */
+ ui_delay(3000L, FALSE); /* wait up to three seconds */
+ State = save_State;
+
+ msg_scroll = FALSE;
+ emsg_on_display = FALSE;
+ }
+
+ /*
+ * Finish up after executing a Normal mode command.
+ */
+normal_end:
+
+ msg_nowait = FALSE;
+
+ /* Reset finish_op, in case it was set */
+#ifdef CURSOR_SHAPE
+ c = finish_op;
+#endif
+ finish_op = FALSE;
+#ifdef CURSOR_SHAPE
+ /* Redraw the cursor with another shape, if we were in Operator-pending
+ * mode or did a replace command. */
+ if (c || ca.cmdchar == 'r')
+ {
+ ui_cursor_shape(); /* may show different cursor shape */
+# ifdef FEAT_MOUSESHAPE
+ update_mouseshape(-1);
+# endif
+ }
+#endif
+
+#ifdef FEAT_CMDL_INFO
+ if (oap->op_type == OP_NOP && oap->regname == 0)
+ clear_showcmd();
+#endif
+
+ checkpcmark(); /* check if we moved since setting pcmark */
+ vim_free(ca.searchbuf);
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+
+#ifdef FEAT_SCROLLBIND
+ if (curwin->w_p_scb && toplevel)
+ {
+ validate_cursor(); /* may need to update w_leftcol */
+ do_check_scrollbind(TRUE);
+ }
+#endif
+
+ /*
+ * May restart edit(), if we got here with CTRL-O in Insert mode (but not
+ * if still inside a mapping that started in Visual mode).
+ * May switch from Visual to Select mode after CTRL-O command.
+ */
+ if ( oap->op_type == OP_NOP
+#ifdef FEAT_VISUAL
+ && ((restart_edit != 0 && !VIsual_active && old_mapped_len == 0)
+ || restart_VIsual_select == 1)
+#endif
+ && !(ca.retval & CA_COMMAND_BUSY)
+ && stuff_empty()
+ && oap->regname == 0)
+ {
+#ifdef FEAT_VISUAL
+ if (restart_VIsual_select == 1)
+ {
+ VIsual_select = TRUE;
+ showmode();
+ restart_VIsual_select = 0;
+ }
+#endif
+ if (restart_edit != 0
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ && old_mapped_len == 0)
+ (void)edit(restart_edit, FALSE, 1L);
+ }
+
+#ifdef FEAT_VISUAL
+ if (restart_VIsual_select == 2)
+ restart_VIsual_select = 1;
+#endif
+
+ /* Save count before an operator for next time. */
+ opcount = ca.opcount;
+}
+
+/*
+ * Handle an operator after visual mode or when the movement is finished
+ */
+ void
+do_pending_operator(cap, old_col, gui_yank)
+ cmdarg_T *cap;
+ int old_col;
+ int gui_yank;
+{
+ oparg_T *oap = cap->oap;
+ pos_T old_cursor;
+ int empty_region_error;
+ int restart_edit_save;
+
+#ifdef FEAT_VISUAL
+ /* The visual area is remembered for redo */
+ static int redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
+ static linenr_T redo_VIsual_line_count; /* number of lines */
+ static colnr_T redo_VIsual_col; /* number of cols or end column */
+ static long redo_VIsual_count; /* count for Visual operator */
+# ifdef FEAT_VIRTUALEDIT
+ int include_line_break = FALSE;
+# endif
+#endif
+
+#if defined(FEAT_CLIPBOARD)
+ /*
+ * Yank the visual area into the GUI selection register before we operate
+ * on it and lose it forever.
+ * Don't do it if a specific register was specified, so that ""x"*P works.
+ * This could call do_pending_operator() recursively, but that's OK
+ * because gui_yank will be TRUE for the nested call.
+ */
+ if (clip_star.available
+ && oap->op_type != OP_NOP
+ && !gui_yank
+# ifdef FEAT_VISUAL
+ && VIsual_active
+ && !redo_VIsual_busy
+# endif
+ && oap->regname == 0)
+ clip_auto_select();
+#endif
+ old_cursor = curwin->w_cursor;
+
+ /*
+ * If an operation is pending, handle it...
+ */
+ if ((finish_op
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ ) && oap->op_type != OP_NOP)
+ {
+#ifdef FEAT_VISUAL
+ oap->is_VIsual = VIsual_active;
+ if (oap->motion_force == 'V')
+ oap->motion_type = MLINE;
+ else if (oap->motion_force == 'v')
+ {
+ /* If the motion was linewise, "inclusive" will not have been set.
+ * Use "exclusive" to be consistent. Makes "dvj" work nice. */
+ if (oap->motion_type == MLINE)
+ oap->inclusive = FALSE;
+ /* If the motion already was characterwise, toggle "inclusive" */
+ else if (oap->motion_type == MCHAR)
+ oap->inclusive = !oap->inclusive;
+ oap->motion_type = MCHAR;
+ }
+ else if (oap->motion_force == Ctrl_V)
+ {
+ /* Change line- or characterwise motion into Visual block mode. */
+ VIsual_active = TRUE;
+ VIsual = oap->start;
+ VIsual_mode = Ctrl_V;
+ VIsual_select = FALSE;
+ VIsual_reselect = FALSE;
+ }
+#endif
+
+ /* only redo yank when 'y' flag is in 'cpoptions' */
+ /* never redo "zf" (define fold) */
+ if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK)
+#ifdef FEAT_VISUAL
+ && (!VIsual_active || oap->motion_force)
+#endif
+#ifdef FEAT_FOLDING
+ && oap->op_type != OP_FOLD
+ && oap->op_type != OP_FOLDOPEN
+ && oap->op_type != OP_FOLDOPENREC
+ && oap->op_type != OP_FOLDCLOSE
+ && oap->op_type != OP_FOLDCLOSEREC
+ && oap->op_type != OP_FOLDDEL
+ && oap->op_type != OP_FOLDDELREC
+#endif
+ )
+ {
+ prep_redo(oap->regname, cap->count0,
+ get_op_char(oap->op_type), get_extra_op_char(oap->op_type),
+ oap->motion_force, cap->cmdchar, cap->nchar);
+ if (cap->cmdchar == '/' || cap->cmdchar == '?') /* was a search */
+ {
+ /*
+ * If 'cpoptions' does not contain 'r', insert the search
+ * pattern to really repeat the same command.
+ */
+ if (vim_strchr(p_cpo, CPO_REDO) == NULL)
+ AppendToRedobuffLit(cap->searchbuf);
+ AppendToRedobuff(NL_STR);
+ }
+ else if (cap->cmdchar == ':')
+ {
+ /* do_cmdline() has stored the first typed line in
+ * "repeat_cmdline". When several lines are typed repeating
+ * won't be possible. */
+ if (repeat_cmdline == NULL)
+ ResetRedobuff();
+ else
+ {
+ AppendToRedobuffLit(repeat_cmdline);
+ AppendToRedobuff(NL_STR);
+ vim_free(repeat_cmdline);
+ repeat_cmdline = NULL;
+ }
+ }
+ }
+
+#ifdef FEAT_VISUAL
+ if (redo_VIsual_busy)
+ {
+ oap->start = curwin->w_cursor;
+ curwin->w_cursor.lnum += redo_VIsual_line_count - 1;
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ VIsual_mode = redo_VIsual_mode;
+ if (VIsual_mode == 'v')
+ {
+ if (redo_VIsual_line_count <= 1)
+ curwin->w_cursor.col += redo_VIsual_col - 1;
+ else
+ curwin->w_cursor.col = redo_VIsual_col;
+ }
+ if (redo_VIsual_col == MAXCOL)
+ {
+ curwin->w_curswant = MAXCOL;
+ coladvance((colnr_T)MAXCOL);
+ }
+ cap->count0 = redo_VIsual_count;
+ if (redo_VIsual_count != 0)
+ cap->count1 = redo_VIsual_count;
+ else
+ cap->count1 = 1;
+ }
+ else if (VIsual_active)
+ {
+ /* Save the current VIsual area for '< and '> marks, and "gv" */
+ curbuf->b_visual_start = VIsual;
+ curbuf->b_visual_end = curwin->w_cursor;
+ curbuf->b_visual_mode = VIsual_mode;
+# ifdef FEAT_EVAL
+ curbuf->b_visual_mode_eval = VIsual_mode;
+# endif
+ curbuf->b_visual_curswant = curwin->w_curswant;
+
+ /* In Select mode, a linewise selection is operated upon like a
+ * characterwise selection. */
+ if (VIsual_select && VIsual_mode == 'V')
+ {
+ if (lt(VIsual, curwin->w_cursor))
+ {
+ VIsual.col = 0;
+ curwin->w_cursor.col =
+ (colnr_T)STRLEN(ml_get(curwin->w_cursor.lnum));
+ }
+ else
+ {
+ curwin->w_cursor.col = 0;
+ VIsual.col = (colnr_T)STRLEN(ml_get(VIsual.lnum));
+ }
+ VIsual_mode = 'v';
+ }
+ /* If 'selection' is "exclusive", backup one character for
+ * charwise selections. */
+ else if (VIsual_mode == 'v')
+ {
+# ifdef FEAT_VIRTUALEDIT
+ include_line_break =
+# endif
+ unadjust_for_sel();
+ }
+
+ oap->start = VIsual;
+ if (VIsual_mode == 'V')
+ oap->start.col = 0;
+ }
+#endif /* FEAT_VISUAL */
+
+ /*
+ * Set oap->start to the first position of the operated text, oap->end
+ * to the end of the operated text. w_cursor is equal to oap->start.
+ */
+ if (lt(oap->start, curwin->w_cursor))
+ {
+#ifdef FEAT_FOLDING
+ /* Include folded lines completely. */
+ if (!VIsual_active)
+ {
+ if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL))
+ oap->start.col = 0;
+ if (hasFolding(curwin->w_cursor.lnum, NULL,
+ &curwin->w_cursor.lnum))
+ curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline());
+ }
+#endif
+ oap->end = curwin->w_cursor;
+ curwin->w_cursor = oap->start;
+
+ /* w_virtcol may have been updated; if the cursor goes back to its
+ * previous position w_virtcol becomes invalid and isn't updated
+ * automatically. */
+ curwin->w_valid &= ~VALID_VIRTCOL;
+ }
+ else
+ {
+#ifdef FEAT_FOLDING
+ /* Include folded lines completely. */
+ if (!VIsual_active && oap->motion_type == MLINE)
+ {
+ if (hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum,
+ NULL))
+ curwin->w_cursor.col = 0;
+ if (hasFolding(oap->start.lnum, NULL, &oap->start.lnum))
+ oap->start.col = (colnr_T)STRLEN(ml_get(oap->start.lnum));
+ }
+#endif
+ oap->end = oap->start;
+ oap->start = curwin->w_cursor;
+ }
+
+ oap->line_count = oap->end.lnum - oap->start.lnum + 1;
+
+#ifdef FEAT_VIRTUALEDIT
+ /* Set "virtual_op" before resetting VIsual_active. */
+ virtual_op = virtual_active();
+#endif
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active || redo_VIsual_busy)
+ {
+ if (VIsual_mode == Ctrl_V) /* block mode */
+ {
+ colnr_T start, end;
+
+ oap->block_mode = TRUE;
+
+ getvvcol(curwin, &(oap->start),
+ &oap->start_vcol, NULL, &oap->end_vcol);
+ if (!redo_VIsual_busy)
+ {
+ getvvcol(curwin, &(oap->end), &start, NULL, &end);
+
+ if (start < oap->start_vcol)
+ oap->start_vcol = start;
+ if (end > oap->end_vcol)
+ {
+ if (*p_sel == 'e' && start >= 1
+ && start - 1 >= oap->end_vcol)
+ oap->end_vcol = start - 1;
+ else
+ oap->end_vcol = end;
+ }
+ }
+
+ /* if '$' was used, get oap->end_vcol from longest line */
+ if (curwin->w_curswant == MAXCOL)
+ {
+ curwin->w_cursor.col = MAXCOL;
+ oap->end_vcol = 0;
+ for (curwin->w_cursor.lnum = oap->start.lnum;
+ curwin->w_cursor.lnum <= oap->end.lnum;
+ ++curwin->w_cursor.lnum)
+ {
+ getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end);
+ if (end > oap->end_vcol)
+ oap->end_vcol = end;
+ }
+ }
+ else if (redo_VIsual_busy)
+ oap->end_vcol = oap->start_vcol + redo_VIsual_col - 1;
+ /*
+ * Correct oap->end.col and oap->start.col to be the
+ * upper-left and lower-right corner of the block area.
+ *
+ * (Actually, this does convert column positions into character
+ * positions)
+ */
+ curwin->w_cursor.lnum = oap->end.lnum;
+ coladvance(oap->end_vcol);
+ oap->end = curwin->w_cursor;
+
+ curwin->w_cursor = oap->start;
+ coladvance(oap->start_vcol);
+ oap->start = curwin->w_cursor;
+ }
+
+ if (!redo_VIsual_busy && !gui_yank)
+ {
+ /*
+ * Prepare to reselect and redo Visual: this is based on the
+ * size of the Visual text
+ */
+ resel_VIsual_mode = VIsual_mode;
+ if (curwin->w_curswant == MAXCOL)
+ resel_VIsual_col = MAXCOL;
+ else if (VIsual_mode == Ctrl_V)
+ resel_VIsual_col = oap->end_vcol - oap->start_vcol + 1;
+ else if (oap->line_count > 1)
+ resel_VIsual_col = oap->end.col;
+ else
+ resel_VIsual_col = oap->end.col - oap->start.col + 1;
+ resel_VIsual_line_count = oap->line_count;
+ }
+
+ /* can't redo yank (unless 'y' is in 'cpoptions') and ":" */
+ if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK)
+ && oap->op_type != OP_COLON
+#ifdef FEAT_FOLDING
+ && oap->op_type != OP_FOLD
+ && oap->op_type != OP_FOLDOPEN
+ && oap->op_type != OP_FOLDOPENREC
+ && oap->op_type != OP_FOLDCLOSE
+ && oap->op_type != OP_FOLDCLOSEREC
+ && oap->op_type != OP_FOLDDEL
+ && oap->op_type != OP_FOLDDELREC
+#endif
+ && oap->motion_force == NUL
+ )
+ {
+ /* Prepare for redoing. Only use the nchar field for "r",
+ * otherwise it might be the second char of the operator. */
+ prep_redo(oap->regname, 0L, NUL, 'v',
+ get_op_char(oap->op_type),
+ get_extra_op_char(oap->op_type),
+ oap->op_type == OP_REPLACE ? cap->nchar : NUL);
+ if (!redo_VIsual_busy)
+ {
+ redo_VIsual_mode = resel_VIsual_mode;
+ redo_VIsual_col = resel_VIsual_col;
+ redo_VIsual_line_count = resel_VIsual_line_count;
+ redo_VIsual_count = cap->count0;
+ }
+ }
+
+ /*
+ * oap->inclusive defaults to TRUE.
+ * If oap->end is on a NUL (empty line) oap->inclusive becomes
+ * FALSE. This makes "d}P" and "v}dP" work the same.
+ */
+ if (oap->motion_force == NUL || oap->motion_type == MLINE)
+ oap->inclusive = TRUE;
+ if (VIsual_mode == 'V')
+ oap->motion_type = MLINE;
+ else
+ {
+ oap->motion_type = MCHAR;
+ if (VIsual_mode != Ctrl_V && *ml_get_pos(&(oap->end)) == NUL
+# ifdef FEAT_VIRTUALEDIT
+ && (include_line_break || !virtual_op)
+# endif
+ )
+ {
+ oap->inclusive = FALSE;
+ /* Try to include the newline, unless it's an operator
+ * that works on lines only */
+ if (*p_sel != 'o'
+ && !op_on_lines(oap->op_type)
+ && oap->end.lnum < curbuf->b_ml.ml_line_count)
+ {
+ ++oap->end.lnum;
+ oap->end.col = 0;
+# ifdef FEAT_VIRTUALEDIT
+ oap->end.coladd = 0;
+# endif
+ ++oap->line_count;
+ }
+ }
+ }
+
+ redo_VIsual_busy = FALSE;
+ /*
+ * Switch Visual off now, so screen updating does
+ * not show inverted text when the screen is redrawn.
+ * With OP_YANK and sometimes with OP_COLON and OP_FILTER there is
+ * no screen redraw, so it is done here to remove the inverted
+ * part.
+ */
+ if (!gui_yank)
+ {
+ VIsual_active = FALSE;
+# ifdef FEAT_MOUSE
+ setmouse();
+ mouse_dragging = 0;
+# endif
+ if (p_smd)
+ clear_cmdline = TRUE; /* unshow visual mode later */
+#ifdef FEAT_CMDL_INFO
+ else
+ clear_showcmd();
+#endif
+ if ((oap->op_type == OP_YANK
+ || oap->op_type == OP_COLON
+ || oap->op_type == OP_FILTER)
+ && oap->motion_force == NUL)
+ redraw_curbuf_later(INVERTED);
+ }
+ }
+#endif
+
+#ifdef FEAT_MBYTE
+ /* Include the trailing byte of a multi-byte char. */
+ if (has_mbyte && oap->inclusive)
+ {
+ int l;
+
+ l = (*mb_ptr2len_check)(ml_get_pos(&oap->end));
+ if (l > 1)
+ oap->end.col += l - 1;
+ }
+#endif
+ curwin->w_set_curswant = TRUE;
+
+ /*
+ * oap->empty is set when start and end are the same. The inclusive
+ * flag affects this too, unless yanking and the end is on a NUL.
+ */
+ oap->empty = (oap->motion_type == MCHAR
+ && (!oap->inclusive
+ || (oap->op_type == OP_YANK
+ && gchar_pos(&oap->end) == NUL))
+ && equalpos(oap->start, oap->end)
+#ifdef FEAT_VIRTUALEDIT
+ && !(virtual_op && oap->start.coladd != oap->end.coladd)
+#endif
+ );
+ /*
+ * For delete, change and yank, it's an error to operate on an
+ * empty region, when 'E' included in 'cpoptions' (Vi compatible).
+ */
+ empty_region_error = (oap->empty
+ && vim_strchr(p_cpo, CPO_EMPTYREGION) != NULL);
+
+#ifdef FEAT_VISUAL
+ /* Force a redraw when operating on an empty Visual region, when
+ * 'modifiable is off or creating a fold. */
+ if (oap->is_VIsual && (oap->empty || !curbuf->b_p_ma
+# ifdef FEAT_FOLDING
+ || oap->op_type == OP_FOLD
+# endif
+ ))
+ redraw_curbuf_later(INVERTED);
+#endif
+
+ /*
+ * If the end of an operator is in column one while oap->motion_type
+ * is MCHAR and oap->inclusive is FALSE, we put op_end after the last
+ * character in the previous line. If op_start is on or before the
+ * first non-blank in the line, the operator becomes linewise
+ * (strange, but that's the way vi does it).
+ */
+ if ( oap->motion_type == MCHAR
+ && oap->inclusive == FALSE
+ && !(cap->retval & CA_NO_ADJ_OP_END)
+ && oap->end.col == 0
+#ifdef FEAT_VISUAL
+ && (!oap->is_VIsual || *p_sel == 'o')
+#endif
+ && oap->line_count > 1)
+ {
+ oap->end_adjusted = TRUE; /* remember that we did this */
+ --oap->line_count;
+ --oap->end.lnum;
+ if (inindent(0))
+ oap->motion_type = MLINE;
+ else
+ {
+ oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum));
+ if (oap->end.col)
+ {
+ --oap->end.col;
+ oap->inclusive = TRUE;
+ }
+ }
+ }
+ else
+ oap->end_adjusted = FALSE;
+
+ switch (oap->op_type)
+ {
+ case OP_LSHIFT:
+ case OP_RSHIFT:
+ op_shift(oap, TRUE,
+#ifdef FEAT_VISUAL
+ oap->is_VIsual ? (int)cap->count1 :
+#endif
+ 1);
+ auto_format(FALSE, TRUE);
+ break;
+
+ case OP_JOIN_NS:
+ case OP_JOIN:
+ if (oap->line_count < 2)
+ oap->line_count = 2;
+ if (curwin->w_cursor.lnum + oap->line_count - 1 >
+ curbuf->b_ml.ml_line_count)
+ beep_flush();
+ else
+ {
+ do_do_join(oap->line_count, oap->op_type == OP_JOIN);
+ auto_format(FALSE, TRUE);
+ }
+ break;
+
+ case OP_DELETE:
+#ifdef FEAT_VISUAL
+ VIsual_reselect = FALSE; /* don't reselect now */
+#endif
+ if (empty_region_error)
+ vim_beep();
+ else
+ {
+ (void)op_delete(oap);
+ if (oap->motion_type == MLINE && has_format_option(FO_AUTO))
+ u_save_cursor(); /* cursor line wasn't saved yet */
+ auto_format(FALSE, TRUE);
+ }
+ break;
+
+ case OP_YANK:
+ if (empty_region_error)
+ {
+ if (!gui_yank)
+ vim_beep();
+ }
+ else
+ (void)op_yank(oap, FALSE, !gui_yank);
+ check_cursor_col();
+ break;
+
+ case OP_CHANGE:
+#ifdef FEAT_VISUAL
+ VIsual_reselect = FALSE; /* don't reselect now */
+#endif
+ if (empty_region_error)
+ vim_beep();
+ else
+ {
+ /* This is a new edit command, not a restart. Need to
+ * remember it to make 'insertmode' work with mappings for
+ * Visual mode. But do this only once and not when typed and
+ * 'insertmode' isn't set. */
+ if (p_im || !KeyTyped)
+ restart_edit_save = restart_edit;
+ else
+ restart_edit_save = 0;
+ restart_edit = 0;
+ /* Reset finish_op now, don't want it set inside edit(). */
+ finish_op = FALSE;
+ if (op_change(oap)) /* will call edit() */
+ cap->retval |= CA_COMMAND_BUSY;
+ if (restart_edit == 0)
+ restart_edit = restart_edit_save;
+ }
+ break;
+
+ case OP_FILTER:
+ if (vim_strchr(p_cpo, CPO_FILTER) != NULL)
+ AppendToRedobuff((char_u *)"!\r"); /* use any last used !cmd */
+ else
+ bangredo = TRUE; /* do_bang() will put cmd in redo buffer */
+
+ case OP_INDENT:
+ case OP_COLON:
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
+ /*
+ * If 'equalprg' is empty, do the indenting internally.
+ */
+ if (oap->op_type == OP_INDENT && *get_equalprg() == NUL)
+ {
+# ifdef FEAT_LISP
+ if (curbuf->b_p_lisp)
+ {
+ op_reindent(oap, get_lisp_indent);
+ break;
+ }
+# endif
+# ifdef FEAT_CINDENT
+ op_reindent(oap,
+# ifdef FEAT_EVAL
+ *curbuf->b_p_inde != NUL ? get_expr_indent :
+# endif
+ get_c_indent);
+ break;
+# endif
+ }
+#endif
+
+ op_colon(oap);
+ break;
+
+ case OP_TILDE:
+ case OP_UPPER:
+ case OP_LOWER:
+ case OP_ROT13:
+ if (empty_region_error)
+ vim_beep();
+ else
+ op_tilde(oap);
+ check_cursor_col();
+ break;
+
+ case OP_FORMAT:
+ if (*p_fp != NUL)
+ op_colon(oap); /* use external command */
+ else
+ op_format(oap, FALSE); /* use internal function */
+ break;
+
+ case OP_FORMAT2:
+ op_format(oap, TRUE); /* use internal function */
+ break;
+
+ case OP_INSERT:
+ case OP_APPEND:
+#ifdef FEAT_VISUAL
+ VIsual_reselect = FALSE; /* don't reselect now */
+#endif
+#ifdef FEAT_VISUALEXTRA
+ if (empty_region_error)
+ vim_beep();
+ else
+ {
+ /* This is a new edit command, not a restart. Need to
+ * remember it to make 'insertmode' work with mappings for
+ * Visual mode. But do this only once. */
+ restart_edit_save = restart_edit;
+ restart_edit = 0;
+
+ op_insert(oap, cap->count1);
+
+ /* TODO: when inserting in several lines, should format all
+ * the lines. */
+ auto_format(FALSE, TRUE);
+
+ if (restart_edit == 0)
+ restart_edit = restart_edit_save;
+ }
+#else
+ vim_beep();
+#endif
+ break;
+
+ case OP_REPLACE:
+#ifdef FEAT_VISUAL
+ VIsual_reselect = FALSE; /* don't reselect now */
+#endif
+#ifdef FEAT_VISUALEXTRA
+ if (empty_region_error)
+#endif
+ vim_beep();
+#ifdef FEAT_VISUALEXTRA
+ else
+ op_replace(oap, cap->nchar);
+#endif
+ break;
+
+#ifdef FEAT_FOLDING
+ case OP_FOLD:
+ VIsual_reselect = FALSE; /* don't reselect now */
+ foldCreate(oap->start.lnum, oap->end.lnum);
+ break;
+
+ case OP_FOLDOPEN:
+ case OP_FOLDOPENREC:
+ case OP_FOLDCLOSE:
+ case OP_FOLDCLOSEREC:
+ VIsual_reselect = FALSE; /* don't reselect now */
+ opFoldRange(oap->start.lnum, oap->end.lnum,
+ oap->op_type == OP_FOLDOPEN
+ || oap->op_type == OP_FOLDOPENREC,
+ oap->op_type == OP_FOLDOPENREC
+ || oap->op_type == OP_FOLDCLOSEREC,
+ oap->is_VIsual);
+ break;
+
+ case OP_FOLDDEL:
+ case OP_FOLDDELREC:
+ VIsual_reselect = FALSE; /* don't reselect now */
+ deleteFold(oap->start.lnum, oap->end.lnum,
+ oap->op_type == OP_FOLDDELREC, oap->is_VIsual);
+ break;
+#endif
+ default:
+ clearopbeep(oap);
+ }
+#ifdef FEAT_VIRTUALEDIT
+ virtual_op = MAYBE;
+#endif
+ if (!gui_yank)
+ {
+ /*
+ * if 'sol' not set, go back to old column for some commands
+ */
+ if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
+ && (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
+ || oap->op_type == OP_DELETE))
+ coladvance(curwin->w_curswant = old_col);
+ }
+ else
+ {
+ curwin->w_cursor = old_cursor;
+ }
+#ifdef FEAT_VISUAL
+ oap->block_mode = FALSE;
+#endif
+ clearop(oap);
+ }
+}
+
+/*
+ * Handle indent and format operators and visual mode ":".
+ */
+ static void
+op_colon(oap)
+ oparg_T *oap;
+{
+ stuffcharReadbuff(':');
+#ifdef FEAT_VISUAL
+ if (oap->is_VIsual)
+ stuffReadbuff((char_u *)"'<,'>");
+ else
+#endif
+ {
+ /*
+ * Make the range look nice, so it can be repeated.
+ */
+ if (oap->start.lnum == curwin->w_cursor.lnum)
+ stuffcharReadbuff('.');
+ else
+ stuffnumReadbuff((long)oap->start.lnum);
+ if (oap->end.lnum != oap->start.lnum)
+ {
+ stuffcharReadbuff(',');
+ if (oap->end.lnum == curwin->w_cursor.lnum)
+ stuffcharReadbuff('.');
+ else if (oap->end.lnum == curbuf->b_ml.ml_line_count)
+ stuffcharReadbuff('$');
+ else if (oap->start.lnum == curwin->w_cursor.lnum)
+ {
+ stuffReadbuff((char_u *)".+");
+ stuffnumReadbuff((long)oap->line_count - 1);
+ }
+ else
+ stuffnumReadbuff((long)oap->end.lnum);
+ }
+ }
+ if (oap->op_type != OP_COLON)
+ stuffReadbuff((char_u *)"!");
+ if (oap->op_type == OP_INDENT)
+ {
+#ifndef FEAT_CINDENT
+ if (*get_equalprg() == NUL)
+ stuffReadbuff((char_u *)"indent");
+ else
+#endif
+ stuffReadbuff(get_equalprg());
+ stuffReadbuff((char_u *)"\n");
+ }
+ else if (oap->op_type == OP_FORMAT)
+ {
+ if (*p_fp == NUL)
+ stuffReadbuff((char_u *)"fmt");
+ else
+ stuffReadbuff(p_fp);
+ stuffReadbuff((char_u *)"\n");
+ }
+
+ /*
+ * do_cmdline() does the rest
+ */
+}
+
+#if defined(FEAT_MOUSE) || defined(PROTO)
+/*
+ * Do the appropriate action for the current mouse click in the current mode.
+ * Not used for Command-line mode.
+ *
+ * Normal Mode:
+ * event modi- position visual change action
+ * fier cursor window
+ * left press - yes end yes
+ * left press C yes end yes "^]" (2)
+ * left press S yes end yes "*" (2)
+ * left drag - yes start if moved no
+ * left relse - yes start if moved no
+ * middle press - yes if not active no put register
+ * middle press - yes if active no yank and put
+ * right press - yes start or extend yes
+ * right press S yes no change yes "#" (2)
+ * right drag - yes extend no
+ * right relse - yes extend no
+ *
+ * Insert or Replace Mode:
+ * event modi- position visual change action
+ * fier cursor window
+ * left press - yes (cannot be active) yes
+ * left press C yes (cannot be active) yes "CTRL-O^]" (2)
+ * left press S yes (cannot be active) yes "CTRL-O*" (2)
+ * left drag - yes start or extend (1) no CTRL-O (1)
+ * left relse - yes start or extend (1) no CTRL-O (1)
+ * middle press - no (cannot be active) no put register
+ * right press - yes start or extend yes CTRL-O
+ * right press S yes (cannot be active) yes "CTRL-O#" (2)
+ *
+ * (1) only if mouse pointer moved since press
+ * (2) only if click is in same buffer
+ *
+ * Return TRUE if start_arrow() should be called for edit mode.
+ */
+ int
+do_mouse(oap, c, dir, count, fixindent)
+ oparg_T *oap; /* operator argument, can be NULL */
+ int c; /* K_LEFTMOUSE, etc */
+ int dir; /* Direction to 'put' if necessary */
+ long count;
+ int fixindent; /* PUT_FIXINDENT if fixing indent necessary */
+{
+ static int do_always = FALSE; /* ignore 'mouse' setting next time */
+ static int got_click = FALSE; /* got a click some time back */
+
+ int which_button; /* MOUSE_LEFT, _MIDDLE or _RIGHT */
+ int is_click; /* If FALSE it's a drag or release event */
+ int is_drag; /* If TRUE it's a drag event */
+ int jump_flags = 0; /* flags for jump_to_mouse() */
+ pos_T start_visual;
+ int moved; /* Has cursor moved? */
+ int in_status_line; /* mouse in status line */
+#ifdef FEAT_VERTSPLIT
+ int in_sep_line; /* mouse in vertical separator line */
+#endif
+ int c1, c2;
+#if defined(FEAT_FOLDING)
+ pos_T save_cursor;
+#endif
+ win_T *old_curwin = curwin;
+#ifdef FEAT_VISUAL
+ static pos_T orig_cursor;
+ colnr_T leftcol, rightcol;
+ pos_T end_visual;
+ int diff;
+ int old_active = VIsual_active;
+ int old_mode = VIsual_mode;
+#endif
+ int regname;
+
+#if defined(FEAT_FOLDING)
+ save_cursor = curwin->w_cursor;
+#endif
+
+ /*
+ * When GUI is active, always recognize mouse events, otherwise:
+ * - Ignore mouse event in normal mode if 'mouse' doesn't include 'n'.
+ * - Ignore mouse event in visual mode if 'mouse' doesn't include 'v'.
+ * - For command line and insert mode 'mouse' is checked before calling
+ * do_mouse().
+ */
+ if (do_always)
+ do_always = FALSE;
+ else
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+#endif
+ {
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (!mouse_has(MOUSE_VISUAL))
+ return FALSE;
+ }
+ else
+#endif
+ if (State == NORMAL && !mouse_has(MOUSE_NORMAL))
+ return FALSE;
+ }
+
+ which_button = get_mouse_button(KEY2TERMCAP1(c), &is_click, &is_drag);
+
+#ifdef FEAT_MOUSESHAPE
+ /* May have stopped dragging the status or separator line. The pointer is
+ * most likely still on the status or separator line. */
+ if (!is_drag && drag_status_line)
+ {
+ drag_status_line = FALSE;
+ update_mouseshape(SHAPE_IDX_STATUS);
+ }
+# ifdef FEAT_VERTSPLIT
+ if (!is_drag && drag_sep_line)
+ {
+ drag_sep_line = FALSE;
+ update_mouseshape(SHAPE_IDX_VSEP);
+ }
+# endif
+#endif
+
+ /*
+ * Ignore drag and release events if we didn't get a click.
+ */
+ if (is_click)
+ got_click = TRUE;
+ else
+ {
+ if (!got_click) /* didn't get click, ignore */
+ return FALSE;
+ if (!is_drag) /* release, reset got_click */
+ got_click = FALSE;
+ }
+
+ /*
+ * ALT is currently ignored
+ */
+ if ((mod_mask & MOD_MASK_ALT))
+ return FALSE;
+
+ /*
+ * CTRL right mouse button does CTRL-T
+ */
+ if (is_click && (mod_mask & MOD_MASK_CTRL) && which_button == MOUSE_RIGHT)
+ {
+ if (State & INSERT)
+ stuffcharReadbuff(Ctrl_O);
+ if (count > 1)
+ stuffnumReadbuff(count);
+ stuffcharReadbuff(Ctrl_T);
+ got_click = FALSE; /* ignore drag&release now */
+ return FALSE;
+ }
+
+ /*
+ * CTRL only works with left mouse button
+ */
+ if ((mod_mask & MOD_MASK_CTRL) && which_button != MOUSE_LEFT)
+ return FALSE;
+
+ /*
+ * When a modifier is down, ignore drag and release events, as well as
+ * multiple clicks and the middle mouse button.
+ * Accept shift-leftmouse drags when 'mousemodel' is "popup.*".
+ */
+ if ((mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL | MOD_MASK_ALT))
+ && (!is_click
+ || (mod_mask & MOD_MASK_MULTI_CLICK)
+ || which_button == MOUSE_MIDDLE)
+ && !((mod_mask & MOD_MASK_SHIFT)
+ && mouse_model_popup()
+ && which_button == MOUSE_LEFT)
+ )
+ return FALSE;
+
+ /*
+ * If the button press was used as the movement command for an operator
+ * (eg "d<MOUSE>"), or it is the middle button that is held down, ignore
+ * drag/release events.
+ */
+ if (!is_click && which_button == MOUSE_MIDDLE)
+ return FALSE;
+
+ if (oap != NULL)
+ regname = oap->regname;
+ else
+ regname = 0;
+
+ /*
+ * Middle mouse button does a 'put' of the selected text
+ */
+ if (which_button == MOUSE_MIDDLE)
+ {
+ if (State == NORMAL)
+ {
+ /*
+ * If an operator was pending, we don't know what the user wanted
+ * to do. Go back to normal mode: Clear the operator and beep().
+ */
+ if (oap != NULL && oap->op_type != OP_NOP)
+ {
+ clearopbeep(oap);
+ return FALSE;
+ }
+
+#ifdef FEAT_VISUAL
+ /*
+ * If visual was active, yank the highlighted text and put it
+ * before the mouse pointer position.
+ */
+ if (VIsual_active)
+ {
+ stuffcharReadbuff('y');
+ stuffcharReadbuff(K_MIDDLEMOUSE);
+ do_always = TRUE; /* ignore 'mouse' setting next time */
+ return FALSE;
+ }
+#endif
+ /*
+ * The rest is below jump_to_mouse()
+ */
+ }
+
+ else if ((State & INSERT) == 0)
+ return FALSE;
+
+ /*
+ * Middle click in insert mode doesn't move the mouse, just insert the
+ * contents of a register. '.' register is special, can't insert that
+ * with do_put().
+ * Also paste at the cursor if the current mode isn't in 'mouse' (only
+ * happens for the GUI).
+ */
+ if ((State & INSERT) || !mouse_has(MOUSE_NORMAL))
+ {
+ if (regname == '.')
+ insert_reg(regname, TRUE);
+ else
+ {
+#ifdef FEAT_CLIPBOARD
+ if (clip_star.available && regname == 0)
+ regname = '*';
+#endif
+ if ((State & REPLACE_FLAG) && !yank_register_mline(regname))
+ insert_reg(regname, TRUE);
+ else
+ {
+ do_put(regname, BACKWARD, 1L, fixindent | PUT_CURSEND);
+
+ /* Repeat it with CTRL-R CTRL-O r or CTRL-R CTRL-P r */
+ AppendCharToRedobuff(Ctrl_R);
+ AppendCharToRedobuff(fixindent ? Ctrl_P : Ctrl_O);
+ AppendCharToRedobuff(regname == 0 ? '"' : regname);
+ }
+ }
+ return FALSE;
+ }
+ }
+
+ /* When dragging or button-up stay in the same window. */
+ if (!is_click)
+ jump_flags |= MOUSE_FOCUS | MOUSE_DID_MOVE;
+
+ start_visual.lnum = 0;
+
+ /*
+ * When 'mousemodel' is "popup" or "popup_setpos", translate mouse events:
+ * right button up -> pop-up menu
+ * shift-left button -> right button
+ */
+ if (mouse_model_popup())
+ {
+ if (which_button == MOUSE_RIGHT
+ && !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)))
+ {
+ /*
+ * NOTE: Ignore right button down and drag mouse events.
+ * Windows only shows the popup menu on the button up event.
+ */
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
+ if (!is_click)
+ return FALSE;
+#endif
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN)
+ if (is_click || is_drag)
+ return FALSE;
+#endif
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_PHOTON)
+ if (gui.in_use)
+ {
+ jump_flags = 0;
+ if (STRCMP(p_mousem, "popup_setpos") == 0)
+ {
+ /* First set the cursor position before showing the popup
+ * menu. */
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ pos_T m_pos;
+
+ /*
+ * set MOUSE_MAY_STOP_VIS if we are outside the
+ * selection or the current window (might have false
+ * negative here)
+ */
+ if (mouse_row < W_WINROW(curwin)
+ || mouse_row
+ > (W_WINROW(curwin) + curwin->w_height))
+ jump_flags = MOUSE_MAY_STOP_VIS;
+ else if (get_fpos_of_mouse(&m_pos) != IN_BUFFER)
+ jump_flags = MOUSE_MAY_STOP_VIS;
+ else
+ {
+ if ((lt(curwin->w_cursor, VIsual)
+ && (lt(m_pos, curwin->w_cursor)
+ || lt(VIsual, m_pos)))
+ || (lt(VIsual, curwin->w_cursor)
+ && (lt(m_pos, VIsual)
+ || lt(curwin->w_cursor, m_pos))))
+ {
+ jump_flags = MOUSE_MAY_STOP_VIS;
+ }
+ else if (VIsual_mode == Ctrl_V)
+ {
+ getvcols(curwin, &curwin->w_cursor, &VIsual,
+ &leftcol, &rightcol);
+ getvcol(curwin, &m_pos, NULL, &m_pos.col, NULL);
+ if (m_pos.col < leftcol || m_pos.col > rightcol)
+ jump_flags = MOUSE_MAY_STOP_VIS;
+ }
+ }
+ }
+ else
+ jump_flags = MOUSE_MAY_STOP_VIS;
+#endif
+ }
+ if (jump_flags)
+ {
+ jump_flags = jump_to_mouse(jump_flags, NULL, which_button);
+ update_curbuf(
+#ifdef FEAT_VISUAL
+ VIsual_active ? INVERTED :
+#endif
+ VALID);
+ setcursor();
+ out_flush(); /* Update before showing popup menu */
+ }
+# ifdef FEAT_MENU
+ gui_show_popupmenu();
+# endif
+ return (jump_flags & CURSOR_MOVED) != 0;
+ }
+ else
+ return FALSE;
+#else
+ return FALSE;
+#endif
+ }
+ if (which_button == MOUSE_LEFT && (mod_mask & MOD_MASK_SHIFT))
+ {
+ which_button = MOUSE_RIGHT;
+ mod_mask &= ~MOD_MASK_SHIFT;
+ }
+ }
+
+#ifdef FEAT_VISUAL
+ if ((State & (NORMAL | INSERT))
+ && !(mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)))
+ {
+ if (which_button == MOUSE_LEFT)
+ {
+ if (is_click)
+ {
+ /* stop Visual mode for a left click in a window, but not when
+ * on a status line */
+ if (VIsual_active)
+ jump_flags |= MOUSE_MAY_STOP_VIS;
+ }
+ else if (mouse_has(MOUSE_VISUAL))
+ jump_flags |= MOUSE_MAY_VIS;
+ }
+ else if (which_button == MOUSE_RIGHT)
+ {
+ if (is_click && VIsual_active)
+ {
+ /*
+ * Remember the start and end of visual before moving the
+ * cursor.
+ */
+ if (lt(curwin->w_cursor, VIsual))
+ {
+ start_visual = curwin->w_cursor;
+ end_visual = VIsual;
+ }
+ else
+ {
+ start_visual = VIsual;
+ end_visual = curwin->w_cursor;
+ }
+ }
+ jump_flags |= MOUSE_FOCUS;
+ if (mouse_has(MOUSE_VISUAL))
+ jump_flags |= MOUSE_MAY_VIS;
+ }
+ }
+#endif
+
+ /*
+ * If an operator is pending, ignore all drags and releases until the
+ * next mouse click.
+ */
+ if (!is_drag && oap != NULL && oap->op_type != OP_NOP)
+ {
+ got_click = FALSE;
+ oap->motion_type = MCHAR;
+ }
+
+ /* When releasing the button let jump_to_mouse() know. */
+ if (!is_click && !is_drag)
+ jump_flags |= MOUSE_RELEASED;
+
+ /*
+ * JUMP!
+ */
+ jump_flags = jump_to_mouse(jump_flags,
+ oap == NULL ? NULL : &(oap->inclusive), which_button);
+ moved = (jump_flags & CURSOR_MOVED);
+ in_status_line = (jump_flags & IN_STATUS_LINE);
+#ifdef FEAT_VERTSPLIT
+ in_sep_line = (jump_flags & IN_SEP_LINE);
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans && isNetbeansBuffer(curbuf)
+ && !(jump_flags & (IN_STATUS_LINE | IN_SEP_LINE)))
+ {
+ int key = KEY2TERMCAP1(c);
+
+ if (key == (int)KE_LEFTRELEASE || key == (int)KE_MIDDLERELEASE
+ || key == (int)KE_RIGHTRELEASE)
+ netbeans_button_release(which_button);
+ }
+#endif
+
+ /* When jumping to another window, clear a pending operator. That's a bit
+ * friendlier than beeping and not jumping to that window. */
+ if (curwin != old_curwin && oap != NULL && oap->op_type != OP_NOP)
+ clearop(oap);
+
+#ifdef FEAT_FOLDING
+ if (mod_mask == 0
+ && !is_drag
+ && (jump_flags & (MOUSE_FOLD_CLOSE | MOUSE_FOLD_OPEN))
+ && which_button == MOUSE_LEFT)
+ {
+ /* open or close a fold at this line */
+ if (jump_flags & MOUSE_FOLD_OPEN)
+ openFold(curwin->w_cursor.lnum, 1L);
+ else
+ closeFold(curwin->w_cursor.lnum, 1L);
+ /* don't move the cursor if still in the same window */
+ if (curwin == old_curwin)
+ curwin->w_cursor = save_cursor;
+ }
+#endif
+
+#if defined(FEAT_CLIPBOARD) && defined(FEAT_CMDWIN)
+ if ((jump_flags & IN_OTHER_WIN) && !VIsual_active && clip_star.available)
+ {
+ clip_modeless(which_button, is_click, is_drag);
+ return FALSE;
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /* Set global flag that we are extending the Visual area with mouse
+ * dragging; temporarily mimimize 'scrolloff'. */
+ if (VIsual_active && is_drag && p_so)
+ {
+ /* In the very first line, allow scrolling one line */
+ if (mouse_row == 0)
+ mouse_dragging = 2;
+ else
+ mouse_dragging = 1;
+ }
+
+ /* When dragging the mouse above the window, scroll down. */
+ if (is_drag && mouse_row < 0 && !in_status_line)
+ {
+ scroll_redraw(FALSE, 1L);
+ mouse_row = 0;
+ }
+
+ if (start_visual.lnum) /* right click in visual mode */
+ {
+ /*
+ * In Visual-block mode, divide the area in four, pick up the corner
+ * that is in the quarter that the cursor is in.
+ */
+ if (VIsual_mode == Ctrl_V)
+ {
+ getvcols(curwin, &start_visual, &end_visual, &leftcol, &rightcol);
+ if (curwin->w_curswant > (leftcol + rightcol) / 2)
+ end_visual.col = leftcol;
+ else
+ end_visual.col = rightcol;
+ if (curwin->w_cursor.lnum <
+ (start_visual.lnum + end_visual.lnum) / 2)
+ end_visual.lnum = end_visual.lnum;
+ else
+ end_visual.lnum = start_visual.lnum;
+
+ /* move VIsual to the right column */
+ start_visual = curwin->w_cursor; /* save the cursor pos */
+ curwin->w_cursor = end_visual;
+ coladvance(end_visual.col);
+ VIsual = curwin->w_cursor;
+ curwin->w_cursor = start_visual; /* restore the cursor */
+ }
+ else
+ {
+ /*
+ * If the click is before the start of visual, change the start.
+ * If the click is after the end of visual, change the end. If
+ * the click is inside the visual, change the closest side.
+ */
+ if (lt(curwin->w_cursor, start_visual))
+ VIsual = end_visual;
+ else if (lt(end_visual, curwin->w_cursor))
+ VIsual = start_visual;
+ else
+ {
+ /* In the same line, compare column number */
+ if (end_visual.lnum == start_visual.lnum)
+ {
+ if (curwin->w_cursor.col - start_visual.col >
+ end_visual.col - curwin->w_cursor.col)
+ VIsual = start_visual;
+ else
+ VIsual = end_visual;
+ }
+
+ /* In different lines, compare line number */
+ else
+ {
+ diff = (curwin->w_cursor.lnum - start_visual.lnum) -
+ (end_visual.lnum - curwin->w_cursor.lnum);
+
+ if (diff > 0) /* closest to end */
+ VIsual = start_visual;
+ else if (diff < 0) /* closest to start */
+ VIsual = end_visual;
+ else /* in the middle line */
+ {
+ if (curwin->w_cursor.col <
+ (start_visual.col + end_visual.col) / 2)
+ VIsual = end_visual;
+ else
+ VIsual = start_visual;
+ }
+ }
+ }
+ }
+ }
+ /*
+ * If Visual mode started in insert mode, execute "CTRL-O"
+ */
+ else if ((State & INSERT) && VIsual_active)
+ stuffcharReadbuff(Ctrl_O);
+#endif
+
+ /*
+ * Middle mouse click: Put text before cursor.
+ */
+ if (which_button == MOUSE_MIDDLE)
+ {
+#ifdef FEAT_CLIPBOARD
+ if (clip_star.available && regname == 0)
+ regname = '*';
+#endif
+ if (yank_register_mline(regname))
+ {
+ if (mouse_past_bottom)
+ dir = FORWARD;
+ }
+ else if (mouse_past_eol)
+ dir = FORWARD;
+
+ if (fixindent)
+ {
+ c1 = (dir == BACKWARD) ? '[' : ']';
+ c2 = 'p';
+ }
+ else
+ {
+ c1 = (dir == FORWARD) ? 'p' : 'P';
+ c2 = NUL;
+ }
+ prep_redo(regname, count, NUL, c1, NUL, c2, NUL);
+
+ /*
+ * Remember where the paste started, so in edit() Insstart can be set
+ * to this position
+ */
+ if (restart_edit != 0)
+ where_paste_started = curwin->w_cursor;
+ do_put(regname, dir, count, fixindent | PUT_CURSEND);
+ }
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ /*
+ * Ctrl-Mouse click or double click in a quickfix window jumps to the
+ * error under the mouse pointer.
+ */
+ else if (((mod_mask & MOD_MASK_CTRL)
+ || (mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
+ && bt_quickfix(curbuf))
+ {
+ if (State & INSERT)
+ stuffcharReadbuff(Ctrl_O);
+ stuffReadbuff((char_u *)":.cc\n");
+ got_click = FALSE; /* ignore drag&release now */
+ }
+#endif
+
+ /*
+ * Ctrl-Mouse click (or double click in a help window) jumps to the tag
+ * under the mouse pointer.
+ */
+ else if ((mod_mask & MOD_MASK_CTRL) || (curbuf->b_help
+ && (mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK))
+ {
+ if (State & INSERT)
+ stuffcharReadbuff(Ctrl_O);
+ stuffcharReadbuff(Ctrl_RSB);
+ got_click = FALSE; /* ignore drag&release now */
+ }
+
+ /*
+ * Shift-Mouse click searches for the next occurrence of the word under
+ * the mouse pointer
+ */
+ else if ((mod_mask & MOD_MASK_SHIFT))
+ {
+ if (State & INSERT
+#ifdef FEAT_VISUAL
+ || (VIsual_active && VIsual_select)
+#endif
+ )
+ stuffcharReadbuff(Ctrl_O);
+ if (which_button == MOUSE_LEFT)
+ stuffcharReadbuff('*');
+ else /* MOUSE_RIGHT */
+ stuffcharReadbuff('#');
+ }
+
+ /* Handle double clicks, unless on status line */
+ else if (in_status_line)
+ {
+#ifdef FEAT_MOUSESHAPE
+ if ((is_drag || is_click) && !drag_status_line)
+ {
+ drag_status_line = TRUE;
+ update_mouseshape(-1);
+ }
+#endif
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (in_sep_line)
+ {
+# ifdef FEAT_MOUSESHAPE
+ if ((is_drag || is_click) && !drag_sep_line)
+ {
+ drag_sep_line = TRUE;
+ update_mouseshape(-1);
+ }
+# endif
+ }
+#endif
+#ifdef FEAT_VISUAL
+ else if ((mod_mask & MOD_MASK_MULTI_CLICK) && (State & (NORMAL | INSERT))
+ && mouse_has(MOUSE_VISUAL))
+ {
+ if (is_click || !VIsual_active)
+ {
+ if (VIsual_active)
+ orig_cursor = VIsual;
+ else
+ {
+ check_visual_highlight();
+ VIsual = curwin->w_cursor;
+ orig_cursor = VIsual;
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+ /* start Select mode if 'selectmode' contains "mouse" */
+ may_start_select('o');
+ setmouse();
+ }
+ if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
+ VIsual_mode = 'v';
+ else if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_3CLICK)
+ VIsual_mode = 'V';
+ else if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_4CLICK)
+ VIsual_mode = Ctrl_V;
+#ifdef FEAT_CLIPBOARD
+ /* Make sure the clipboard gets updated. Needed because start and
+ * end may still be the same, and the selection needs to be owned */
+ clip_star.vmode = NUL;
+#endif
+ }
+ /*
+ * A double click selects a word or a block.
+ */
+ if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK)
+ {
+ pos_T *pos = NULL;
+
+ if (is_click)
+ {
+ /* If the character under the cursor (skipping white space) is
+ * not a word character, try finding a match and select a (),
+ * {}, [], #if/#endif, etc. block. */
+ end_visual = curwin->w_cursor;
+ while (vim_iswhite(gchar_pos(&end_visual)))
+ inc(&end_visual);
+ if (oap != NULL)
+ oap->motion_type = MCHAR;
+ if (oap != NULL
+ && VIsual_mode == 'v'
+ && !vim_iswordc(gchar_pos(&end_visual))
+ && equalpos(curwin->w_cursor, VIsual)
+ && (pos = findmatch(oap, NUL)) != NULL)
+ {
+ curwin->w_cursor = *pos;
+ if (oap->motion_type == MLINE)
+ VIsual_mode = 'V';
+ else if (*p_sel == 'e')
+ {
+ if (lt(curwin->w_cursor, VIsual))
+ ++VIsual.col;
+ else
+ ++curwin->w_cursor.col;
+ }
+ }
+ }
+
+ if (pos == NULL && (is_click || is_drag))
+ {
+ /* When not found a match or when dragging: extend to include
+ * a word. */
+ if (lt(curwin->w_cursor, orig_cursor))
+ {
+ find_start_of_word(&curwin->w_cursor);
+ find_end_of_word(&VIsual);
+ }
+ else
+ {
+ find_start_of_word(&VIsual);
+ if (*p_sel == 'e' && *ml_get_cursor() != NUL)
+#ifdef FEAT_MBYTE
+ curwin->w_cursor.col +=
+ (*mb_ptr2len_check)(ml_get_cursor());
+#else
+ ++curwin->w_cursor.col;
+#endif
+ find_end_of_word(&curwin->w_cursor);
+ }
+ }
+ curwin->w_set_curswant = TRUE;
+ }
+ if (is_click)
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ }
+ else if (VIsual_active && !old_active)
+ VIsual_mode = 'v';
+
+ /* If Visual mode changed show it later. */
+ if (p_smd && (VIsual_active != old_active || VIsual_mode != old_mode))
+ redraw_cmdline = TRUE;
+#endif
+
+ return moved;
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * Move "pos" back to the start of the word it's in.
+ */
+ static void
+find_start_of_word(pos)
+ pos_T *pos;
+{
+ char_u *line;
+ int cclass;
+ int col;
+
+ line = ml_get(pos->lnum);
+ cclass = get_mouse_class(line + pos->col);
+
+ while (pos->col > 0)
+ {
+ col = pos->col - 1;
+#ifdef FEAT_MBYTE
+ col -= (*mb_head_off)(line, line + col);
+#endif
+ if (get_mouse_class(line + col) != cclass)
+ break;
+ pos->col = col;
+ }
+}
+
+/*
+ * Move "pos" forward to the end of the word it's in.
+ * When 'selection' is "exclusive", the position is just after the word.
+ */
+ static void
+find_end_of_word(pos)
+ pos_T *pos;
+{
+ char_u *line;
+ int cclass;
+ int col;
+
+ line = ml_get(pos->lnum);
+ if (*p_sel == 'e' && pos->col > 0)
+ {
+ --pos->col;
+#ifdef FEAT_MBYTE
+ pos->col -= (*mb_head_off)(line, line + pos->col);
+#endif
+ }
+ cclass = get_mouse_class(line + pos->col);
+ while (line[pos->col] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ col = pos->col + (*mb_ptr2len_check)(line + pos->col);
+#else
+ col = pos->col + 1;
+#endif
+ if (get_mouse_class(line + col) != cclass)
+ {
+ if (*p_sel == 'e')
+ pos->col = col;
+ break;
+ }
+ pos->col = col;
+ }
+}
+
+/*
+ * Get class of a character for selection: same class means same word.
+ * 0: blank
+ * 1: punctuation groups
+ * 2: normal word character
+ * >2: multi-byte word character.
+ */
+ static int
+get_mouse_class(p)
+ char_u *p;
+{
+ int c;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte && MB_BYTE2LEN(p[0]) > 1)
+ return mb_get_class(p);
+#endif
+
+ c = *p;
+ if (c == ' ' || c == '\t')
+ return 0;
+
+ if (vim_iswordc(c))
+ return 2;
+
+ /*
+ * There are a few special cases where we want certain combinations of
+ * characters to be considered as a single word. These are things like
+ * "->", "/ *", "*=", "+=", "&=", "<=", ">=", "!=" etc. Otherwise, each
+ * character is in it's own class.
+ */
+ if (c != NUL && vim_strchr((char_u *)"-+*/%<>&|^!=", c) != NULL)
+ return 1;
+ return c;
+}
+#endif /* FEAT_VISUAL */
+#endif /* FEAT_MOUSE */
+
+#if defined(FEAT_VISUAL) || defined(PROTO)
+/*
+ * Check if highlighting for visual mode is possible, give a warning message
+ * if not.
+ */
+ void
+check_visual_highlight()
+{
+ static int did_check = FALSE;
+
+ if (full_screen)
+ {
+ if (!did_check && hl_attr(HLF_V) == 0)
+ MSG(_("Warning: terminal cannot highlight"));
+ did_check = TRUE;
+ }
+}
+
+/*
+ * End visual mode.
+ * This function should ALWAYS be called to end Visual mode, except from
+ * do_pending_operator().
+ */
+ void
+end_visual_mode()
+{
+#ifdef FEAT_CLIPBOARD
+ /*
+ * If we are using the clipboard, then remember what was selected in case
+ * we need to paste it somewhere while we still own the selection.
+ * Only do this when the clipboard is already owned. Don't want to grab
+ * the selection when hitting ESC.
+ */
+ if (clip_star.available && clip_star.owned)
+ clip_auto_select();
+#endif
+
+ VIsual_active = FALSE;
+#ifdef FEAT_MOUSE
+ setmouse();
+ mouse_dragging = 0;
+#endif
+
+ /* Save the current VIsual area for '< and '> marks, and "gv" */
+ curbuf->b_visual_mode = VIsual_mode;
+#ifdef FEAT_EVAL
+ curbuf->b_visual_mode_eval = VIsual_mode;
+#endif
+ curbuf->b_visual_start = VIsual;
+ curbuf->b_visual_end = curwin->w_cursor;
+ curbuf->b_visual_curswant = curwin->w_curswant;
+#ifdef FEAT_VIRTUALEDIT
+ if (!virtual_active())
+ curwin->w_cursor.coladd = 0;
+#endif
+
+ if (p_smd)
+ clear_cmdline = TRUE; /* unshow visual mode later */
+#ifdef FEAT_CMDL_INFO
+ else
+ clear_showcmd();
+#endif
+
+ /* Don't leave the cursor past the end of the line */
+ if (curwin->w_cursor.col > 0 && *ml_get_cursor() == NUL)
+ --curwin->w_cursor.col;
+}
+
+/*
+ * Reset VIsual_active and VIsual_reselect.
+ */
+ void
+reset_VIsual_and_resel()
+{
+ if (VIsual_active)
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED); /* delete the inversion later */
+ }
+ VIsual_reselect = FALSE;
+}
+
+/*
+ * Reset VIsual_active and VIsual_reselect if it's set.
+ */
+ void
+reset_VIsual()
+{
+ if (VIsual_active)
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED); /* delete the inversion later */
+ VIsual_reselect = FALSE;
+ }
+}
+#endif /* FEAT_VISUAL */
+
+#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+static int find_is_eval_item __ARGS((char_u *ptr, int *colp, int *nbp, int dir));
+
+/*
+ * Check for a balloon-eval special item to include when searching for an
+ * identifier. When "dir" is BACKWARD "ptr[-1]" must be valid!
+ * Returns TRUE if the character at "*ptr" should be included.
+ * "dir" is FORWARD or BACKWARD, the direction of searching.
+ * "*colp" is in/decremented if "ptr[-dir]" should also be included.
+ * "bnp" points to a counter for square brackets.
+ */
+ static int
+find_is_eval_item(ptr, colp, bnp, dir)
+ char_u *ptr;
+ int *colp;
+ int *bnp;
+ int dir;
+{
+ /* Accept everything inside []. */
+ if ((*ptr == ']' && dir == BACKWARD) || (*ptr == '[' && dir == FORWARD))
+ ++*bnp;
+ if (*bnp > 0)
+ {
+ if ((*ptr == '[' && dir == BACKWARD) || (*ptr == ']' && dir == FORWARD))
+ --*bnp;
+ return TRUE;
+ }
+
+ /* skip over "s.var" */
+ if (*ptr == '.')
+ return TRUE;
+
+ /* two-character item: s->var */
+ if (ptr[dir == BACKWARD ? 0 : 1] == '>'
+ && ptr[dir == BACKWARD ? -1 : 0] == '-')
+ {
+ *colp += dir;
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+
+/*
+ * Find the identifier under or to the right of the cursor.
+ * "find_type" can have one of three values:
+ * FIND_IDENT: find an identifier (keyword)
+ * FIND_STRING: find any non-white string
+ * FIND_IDENT + FIND_STRING: find any non-white string, identifier preferred.
+ *
+ * There are three steps:
+ * 1. Search forward for the start of an identifier/string. Doesn't move if
+ * already on one.
+ * 2. Search backward for the start of this identifier/string.
+ * This doesn't match the real Vi but I like it a little better and it
+ * shouldn't bother anyone.
+ * 3. Search forward to the end of this identifier/string.
+ * When FIND_IDENT isn't defined, we backup until a blank.
+ *
+ * Returns the length of the string, or zero if no string is found.
+ * If a string is found, a pointer to the string is put in "*string". This
+ * string is not always NUL terminated.
+ */
+ int
+find_ident_under_cursor(string, find_type)
+ char_u **string;
+ int find_type;
+{
+ return find_ident_at_pos(curwin, curwin->w_cursor.lnum,
+ curwin->w_cursor.col, string, find_type);
+}
+
+/*
+ * Like find_ident_under_cursor(), but for any window and any position.
+ * However: Uses 'iskeyword' from the current window!.
+ */
+ int
+find_ident_at_pos(wp, lnum, startcol, string, find_type)
+ win_T *wp;
+ linenr_T lnum;
+ colnr_T startcol;
+ char_u **string;
+ int find_type;
+{
+ char_u *ptr;
+ int col = 0; /* init to shut up GCC */
+ int i;
+#ifdef FEAT_MBYTE
+ int this_class = 0;
+ int prev_class;
+ int prevcol;
+#endif
+#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ int bn = 0; /* bracket nesting */
+#endif
+
+ /*
+ * if i == 0: try to find an identifier
+ * if i == 1: try to find any non-white string
+ */
+ ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ for (i = (find_type & FIND_IDENT) ? 0 : 1; i < 2; ++i)
+ {
+ /*
+ * 1. skip to start of identifier/string
+ */
+ col = startcol;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ while (ptr[col] != NUL)
+ {
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ /* Stop at a ']' to evaluate "a[x]". */
+ if ((find_type & FIND_EVAL) && ptr[col] == ']')
+ break;
+# endif
+ this_class = mb_get_class(ptr + col);
+ if (this_class != 0 && (i == 1 || this_class != 1))
+ break;
+ col += (*mb_ptr2len_check)(ptr + col);
+ }
+ }
+ else
+#endif
+ while (ptr[col] != NUL
+ && (i == 0 ? !vim_iswordc(ptr[col]) : vim_iswhite(ptr[col]))
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ && (!(find_type & FIND_EVAL) || ptr[col] != ']')
+# endif
+ )
+ ++col;
+
+#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ /* When starting on a ']' count it, so that we include the '['. */
+ bn = ptr[col] == ']';
+#endif
+
+ /*
+ * 2. Back up to start of identifier/string.
+ */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Remember class of character under cursor. */
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ if ((find_type & FIND_EVAL) && ptr[col] == ']')
+ this_class = mb_get_class((char_u *)"a");
+ else
+# endif
+ this_class = mb_get_class(ptr + col);
+ while (col > 0)
+ {
+ prevcol = col - 1 - (*mb_head_off)(ptr, ptr + col - 1);
+ prev_class = mb_get_class(ptr + prevcol);
+ if (this_class != prev_class
+ && (i == 0
+ || prev_class == 0
+ || (find_type & FIND_IDENT))
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ && (!(find_type & FIND_EVAL)
+ || prevcol == 0
+ || !find_is_eval_item(ptr + prevcol, &prevcol,
+ &bn, BACKWARD))
+# endif
+ )
+ break;
+ col = prevcol;
+ }
+
+ /* If we don't want just any old string, or we've found an
+ * identifier, stop searching. */
+ if (this_class > 2)
+ this_class = 2;
+ if (!(find_type & FIND_STRING) || this_class == 2)
+ break;
+ }
+ else
+#endif
+ {
+ while (col > 0
+ && ((i == 0
+ ? vim_iswordc(ptr[col - 1])
+ : (!vim_iswhite(ptr[col - 1])
+ && (!(find_type & FIND_IDENT)
+ || !vim_iswordc(ptr[col - 1]))))
+#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ || ((find_type & FIND_EVAL)
+ && col > 1
+ && find_is_eval_item(ptr + col - 1, &col,
+ &bn, BACKWARD))
+#endif
+ ))
+ --col;
+
+ /* If we don't want just any old string, or we've found an
+ * identifier, stop searching. */
+ if (!(find_type & FIND_STRING) || vim_iswordc(ptr[col]))
+ break;
+ }
+ }
+
+ if (ptr[col] == NUL || (i == 0 && (
+#ifdef FEAT_MBYTE
+ has_mbyte ? this_class != 2 :
+#endif
+ !vim_iswordc(ptr[col]))))
+ {
+ /*
+ * didn't find an identifier or string
+ */
+ if (find_type & FIND_STRING)
+ EMSG(_("E348: No string under cursor"));
+ else
+ EMSG(_("E349: No identifier under cursor"));
+ return 0;
+ }
+ ptr += col;
+ *string = ptr;
+
+ /*
+ * 3. Find the end if the identifier/string.
+ */
+#if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ bn = 0;
+ startcol -= col;
+#endif
+ col = 0;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ /* Search for point of changing multibyte character class. */
+ this_class = mb_get_class(ptr);
+ while (ptr[col] != NUL
+ && ((i == 0 ? mb_get_class(ptr + col) == this_class
+ : mb_get_class(ptr + col) != 0)
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ || ((find_type & FIND_EVAL)
+ && col <= (int)startcol
+ && find_is_eval_item(ptr + col, &col, &bn, FORWARD))
+# endif
+ ))
+ col += (*mb_ptr2len_check)(ptr + col);
+ }
+ else
+#endif
+ while ((i == 0 ? vim_iswordc(ptr[col])
+ : (ptr[col] != NUL && !vim_iswhite(ptr[col])))
+# if defined(FEAT_NETBEANS_INTG) && defined(FEAT_BEVAL)
+ || ((find_type & FIND_EVAL)
+ && col <= (int)startcol
+ && find_is_eval_item(ptr + col, &col, &bn, FORWARD))
+# endif
+ )
+ {
+ ++col;
+ }
+
+ return col;
+}
+
+/*
+ * Prepare for redo of a normal command.
+ */
+ static void
+prep_redo_cmd(cap)
+ cmdarg_T *cap;
+{
+ prep_redo(cap->oap->regname, cap->count0,
+ NUL, cap->cmdchar, NUL, NUL, cap->nchar);
+}
+
+/*
+ * Prepare for redo of any command.
+ * Note that only the last argument can be a multi-byte char.
+ */
+ static void
+prep_redo(regname, num, cmd1, cmd2, cmd3, cmd4, cmd5)
+ int regname;
+ long num;
+ int cmd1;
+ int cmd2;
+ int cmd3;
+ int cmd4;
+ int cmd5;
+{
+ ResetRedobuff();
+ if (regname != 0) /* yank from specified buffer */
+ {
+ AppendCharToRedobuff('"');
+ AppendCharToRedobuff(regname);
+ }
+ if (num)
+ AppendNumberToRedobuff(num);
+
+ if (cmd1 != NUL)
+ AppendCharToRedobuff(cmd1);
+ if (cmd2 != NUL)
+ AppendCharToRedobuff(cmd2);
+ if (cmd3 != NUL)
+ AppendCharToRedobuff(cmd3);
+ if (cmd4 != NUL)
+ AppendCharToRedobuff(cmd4);
+ if (cmd5 != NUL)
+ AppendCharToRedobuff(cmd5);
+}
+
+/*
+ * check for operator active and clear it
+ *
+ * return TRUE if operator was active
+ */
+ static int
+checkclearop(oap)
+ oparg_T *oap;
+{
+ if (oap->op_type == OP_NOP)
+ return FALSE;
+ clearopbeep(oap);
+ return TRUE;
+}
+
+/*
+ * check for operator or Visual active and clear it
+ *
+ * return TRUE if operator was active
+ */
+ static int
+checkclearopq(oap)
+ oparg_T *oap;
+{
+ if (oap->op_type == OP_NOP
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ )
+ return FALSE;
+ clearopbeep(oap);
+ return TRUE;
+}
+
+ static void
+clearop(oap)
+ oparg_T *oap;
+{
+ oap->op_type = OP_NOP;
+ oap->regname = 0;
+ oap->motion_force = NUL;
+ oap->use_reg_one = FALSE;
+}
+
+ static void
+clearopbeep(oap)
+ oparg_T *oap;
+{
+ clearop(oap);
+ beep_flush();
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * Remove the shift modifier from a special key.
+ */
+ static void
+unshift_special(cap)
+ cmdarg_T *cap;
+{
+ switch (cap->cmdchar)
+ {
+ case K_S_RIGHT: cap->cmdchar = K_RIGHT; break;
+ case K_S_LEFT: cap->cmdchar = K_LEFT; break;
+ case K_S_UP: cap->cmdchar = K_UP; break;
+ case K_S_DOWN: cap->cmdchar = K_DOWN; break;
+ case K_S_HOME: cap->cmdchar = K_HOME; break;
+ case K_S_END: cap->cmdchar = K_END; break;
+ }
+ cap->cmdchar = simplify_key(cap->cmdchar, &mod_mask);
+}
+#endif
+
+#if defined(FEAT_CMDL_INFO) || defined(PROTO)
+/*
+ * Routines for displaying a partly typed command
+ */
+
+#ifdef FEAT_VISUAL /* need room for size of Visual area */
+# define SHOWCMD_BUFLEN SHOWCMD_COLS + 1 + 30
+#else
+# define SHOWCMD_BUFLEN SHOWCMD_COLS + 1
+#endif
+static char_u showcmd_buf[SHOWCMD_BUFLEN];
+static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; /* For push_showcmd() */
+static int showcmd_is_clear = TRUE;
+static int showcmd_visual = FALSE;
+
+static void display_showcmd __ARGS((void));
+
+ void
+clear_showcmd()
+{
+ if (!p_sc)
+ return;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active && !char_avail())
+ {
+ int i = lt(VIsual, curwin->w_cursor);
+ long lines;
+ colnr_T leftcol, rightcol;
+ linenr_T top, bot;
+
+ /* Show the size of the Visual area. */
+ if (i)
+ {
+ top = VIsual.lnum;
+ bot = curwin->w_cursor.lnum;
+ }
+ else
+ {
+ top = curwin->w_cursor.lnum;
+ bot = VIsual.lnum;
+ }
+# ifdef FEAT_FOLDING
+ /* Include closed folds as a whole. */
+ hasFolding(top, &top, NULL);
+ hasFolding(bot, NULL, &bot);
+# endif
+ lines = bot - top + 1;
+
+ if (VIsual_mode == Ctrl_V)
+ {
+ getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol);
+ sprintf((char *)showcmd_buf, "%ldx%ld", lines,
+ (long)(rightcol - leftcol + 1));
+ }
+ else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum)
+ sprintf((char *)showcmd_buf, "%ld", lines);
+ else
+ sprintf((char *)showcmd_buf, "%ld", (long)(i
+ ? curwin->w_cursor.col - VIsual.col
+ : VIsual.col - curwin->w_cursor.col) + (*p_sel != 'e'));
+ showcmd_buf[SHOWCMD_COLS] = NUL; /* truncate */
+ showcmd_visual = TRUE;
+ }
+ else
+#endif
+ {
+ showcmd_buf[0] = NUL;
+ showcmd_visual = FALSE;
+
+ /* Don't actually display something if there is nothing to clear. */
+ if (showcmd_is_clear)
+ return;
+ }
+
+ display_showcmd();
+}
+
+/*
+ * Add 'c' to string of shown command chars.
+ * Return TRUE if output has been written (and setcursor() has been called).
+ */
+ int
+add_to_showcmd(c)
+ int c;
+{
+ char_u *p;
+ int old_len;
+ int extra_len;
+ int overflow;
+#if defined(FEAT_MOUSE)
+ int i;
+ static int ignore[] =
+ {
+#ifdef FEAT_GUI
+ K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
+ K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
+#endif
+ K_IGNORE,
+ K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
+ K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
+ K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
+ K_MOUSEDOWN, K_MOUSEUP,
+ K_X1MOUSE, K_X1DRAG, K_X1RELEASE, K_X2MOUSE, K_X2DRAG, K_X2RELEASE,
+ 0
+ };
+#endif
+
+ if (!p_sc)
+ return FALSE;
+
+ if (showcmd_visual)
+ {
+ showcmd_buf[0] = NUL;
+ showcmd_visual = FALSE;
+ }
+
+#if defined(FEAT_MOUSE)
+ /* Ignore keys that are scrollbar updates and mouse clicks */
+ if (IS_SPECIAL(c))
+ for (i = 0; ignore[i] != 0; ++i)
+ if (ignore[i] == c)
+ return FALSE;
+#endif
+
+ p = transchar(c);
+ old_len = (int)STRLEN(showcmd_buf);
+ extra_len = (int)STRLEN(p);
+ overflow = old_len + extra_len - SHOWCMD_COLS;
+ if (overflow > 0)
+ STRCPY(showcmd_buf, showcmd_buf + overflow);
+ STRCAT(showcmd_buf, p);
+
+ if (char_avail())
+ return FALSE;
+
+ display_showcmd();
+
+ return TRUE;
+}
+
+ void
+add_to_showcmd_c(c)
+ int c;
+{
+ if (!add_to_showcmd(c))
+ setcursor();
+}
+
+/*
+ * Delete 'len' characters from the end of the shown command.
+ */
+ static void
+del_from_showcmd(len)
+ int len;
+{
+ int old_len;
+
+ if (!p_sc)
+ return;
+
+ old_len = (int)STRLEN(showcmd_buf);
+ if (len > old_len)
+ len = old_len;
+ showcmd_buf[old_len - len] = NUL;
+
+ if (!char_avail())
+ display_showcmd();
+}
+
+/*
+ * push_showcmd() and pop_showcmd() are used when waiting for the user to type
+ * something and there is a partial mapping.
+ */
+ void
+push_showcmd()
+{
+ if (p_sc)
+ STRCPY(old_showcmd_buf, showcmd_buf);
+}
+
+ void
+pop_showcmd()
+{
+ if (!p_sc)
+ return;
+
+ STRCPY(showcmd_buf, old_showcmd_buf);
+
+ display_showcmd();
+}
+
+ static void
+display_showcmd()
+{
+ int len;
+
+ cursor_off();
+
+ len = (int)STRLEN(showcmd_buf);
+ if (len == 0)
+ showcmd_is_clear = TRUE;
+ else
+ {
+ screen_puts(showcmd_buf, (int)Rows - 1, sc_col, 0);
+ showcmd_is_clear = FALSE;
+ }
+
+ /*
+ * clear the rest of an old message by outputing up to SHOWCMD_COLS spaces
+ */
+ screen_puts((char_u *)" " + len, (int)Rows - 1, sc_col + len, 0);
+
+ setcursor(); /* put cursor back where it belongs */
+}
+#endif
+
+#ifdef FEAT_SCROLLBIND
+/*
+ * When "check" is FALSE, prepare for commands that scroll the window.
+ * When "check" is TRUE, take care of scroll-binding after the window has
+ * scrolled. Called from normal_cmd() and edit().
+ */
+ void
+do_check_scrollbind(check)
+ int check;
+{
+ static win_T *old_curwin = NULL;
+ static linenr_T old_topline = 0;
+#ifdef FEAT_DIFF
+ static int old_topfill = 0;
+#endif
+ static buf_T *old_buf = NULL;
+ static colnr_T old_leftcol = 0;
+
+ if (check && curwin->w_p_scb)
+ {
+ /* If a ":syncbind" command was just used, don't scroll, only reset
+ * the values. */
+ if (did_syncbind)
+ did_syncbind = FALSE;
+ else if (curwin == old_curwin)
+ {
+ /*
+ * Synchronize other windows, as necessary according to
+ * 'scrollbind'. Don't do this after an ":edit" command, except
+ * when 'diff' is set.
+ */
+ if ((curwin->w_buffer == old_buf
+#ifdef FEAT_DIFF
+ || curwin->w_p_diff
+#endif
+ )
+ && (curwin->w_topline != old_topline
+#ifdef FEAT_DIFF
+ || curwin->w_topfill != old_topfill
+#endif
+ || curwin->w_leftcol != old_leftcol))
+ {
+ check_scrollbind(curwin->w_topline - old_topline,
+ (long)(curwin->w_leftcol - old_leftcol));
+ }
+ }
+ else if (vim_strchr(p_sbo, 'j')) /* jump flag set in 'scrollopt' */
+ {
+ /*
+ * When switching between windows, make sure that the relative
+ * vertical offset is valid for the new window. The relative
+ * offset is invalid whenever another 'scrollbind' window has
+ * scrolled to a point that would force the current window to
+ * scroll past the beginning or end of its buffer. When the
+ * resync is performed, some of the other 'scrollbind' windows may
+ * need to jump so that the current window's relative position is
+ * visible on-screen.
+ */
+ check_scrollbind(curwin->w_topline - curwin->w_scbind_pos, 0L);
+ }
+ curwin->w_scbind_pos = curwin->w_topline;
+ }
+
+ old_curwin = curwin;
+ old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ old_topfill = curwin->w_topfill;
+#endif
+ old_buf = curwin->w_buffer;
+ old_leftcol = curwin->w_leftcol;
+}
+
+/*
+ * Synchronize any windows that have "scrollbind" set, based on the
+ * number of rows by which the current window has changed
+ * (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
+ */
+ void
+check_scrollbind(topline_diff, leftcol_diff)
+ linenr_T topline_diff;
+ long leftcol_diff;
+{
+ int want_ver;
+ int want_hor;
+ win_T *old_curwin = curwin;
+ buf_T *old_curbuf = curbuf;
+#ifdef FEAT_VISUAL
+ int old_VIsual_select = VIsual_select;
+ int old_VIsual_active = VIsual_active;
+#endif
+ colnr_T tgt_leftcol = curwin->w_leftcol;
+ long topline;
+ long y;
+
+ /*
+ * check 'scrollopt' string for vertical and horizontal scroll options
+ */
+ want_ver = (vim_strchr(p_sbo, 'v') && topline_diff != 0);
+#ifdef FEAT_DIFF
+ want_ver |= old_curwin->w_p_diff;
+#endif
+ want_hor = (vim_strchr(p_sbo, 'h') && (leftcol_diff || topline_diff != 0));
+
+ /*
+ * loop through the scrollbound windows and scroll accordingly
+ */
+#ifdef FEAT_VISUAL
+ VIsual_select = VIsual_active = 0;
+#endif
+ for (curwin = firstwin; curwin; curwin = curwin->w_next)
+ {
+ curbuf = curwin->w_buffer;
+ /* skip original window and windows with 'noscrollbind' */
+ if (curwin != old_curwin && curwin->w_p_scb)
+ {
+ /*
+ * do the vertical scroll
+ */
+ if (want_ver)
+ {
+#ifdef FEAT_DIFF
+ if (old_curwin->w_p_diff && curwin->w_p_diff)
+ {
+ diff_set_topline(old_curwin, curwin);
+ }
+ else
+#endif
+ {
+ curwin->w_scbind_pos += topline_diff;
+ topline = curwin->w_scbind_pos;
+ if (topline > curbuf->b_ml.ml_line_count)
+ topline = curbuf->b_ml.ml_line_count;
+ if (topline < 1)
+ topline = 1;
+
+ y = topline - curwin->w_topline;
+ if (y > 0)
+ scrollup(y, FALSE);
+ else
+ scrolldown(-y, FALSE);
+ }
+
+ redraw_later(VALID);
+ cursor_correct();
+#ifdef FEAT_WINDOWS
+ curwin->w_redr_status = TRUE;
+#endif
+ }
+
+ /*
+ * do the horizontal scroll
+ */
+ if (want_hor && curwin->w_leftcol != tgt_leftcol)
+ {
+ curwin->w_leftcol = tgt_leftcol;
+ leftcol_changed();
+ }
+ }
+ }
+
+ /*
+ * reset current-window
+ */
+#ifdef FEAT_VISUAL
+ VIsual_select = old_VIsual_select;
+ VIsual_active = old_VIsual_active;
+#endif
+ curwin = old_curwin;
+ curbuf = old_curbuf;
+}
+#endif /* #ifdef FEAT_SCROLLBIND */
+
+/*
+ * Command character that's ignored.
+ * Used for CTRL-Q and CTRL-S to avoid problems with terminals that use
+ * xon/xoff
+ */
+/*ARGSUSED */
+ static void
+nv_ignore(cap)
+ cmdarg_T *cap;
+{
+}
+
+/*
+ * Command character doesn't exist.
+ */
+ static void
+nv_error(cap)
+ cmdarg_T *cap;
+{
+ clearopbeep(cap->oap);
+}
+
+/*
+ * <Help> and <F1> commands.
+ */
+ static void
+nv_help(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ ex_help(NULL);
+}
+
+/*
+ * CTRL-A and CTRL-X: Add or subtract from letter or number under cursor.
+ */
+ static void
+nv_addsub(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap)
+ && do_addsub((int)cap->cmdchar, cap->count1) == OK)
+ prep_redo_cmd(cap);
+}
+
+/*
+ * CTRL-F, CTRL-B, etc: Scroll page up or down.
+ */
+ static void
+nv_page(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearop(cap->oap))
+ (void)onepage(cap->arg, cap->count1);
+}
+
+/*
+ * Implementation of "gd" and "gD" command.
+ */
+ static void
+nv_gd(oap, nchar)
+ oparg_T *oap;
+ int nchar;
+{
+ int len;
+ char_u *pat;
+ pos_T old_pos;
+ int t;
+ int save_p_ws;
+ int save_p_scs;
+ char_u *ptr;
+
+ if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0 ||
+ (pat = alloc(len + 5)) == NULL)
+ {
+ clearopbeep(oap);
+ return;
+ }
+ sprintf((char *)pat, vim_iswordp(ptr) ? "\\<%.*s\\>" : "%.*s", len, ptr);
+ old_pos = curwin->w_cursor;
+ save_p_ws = p_ws;
+ save_p_scs = p_scs;
+ p_ws = FALSE; /* don't wrap around end of file now */
+ p_scs = FALSE; /* don't switch ignorecase off now */
+
+ /*
+ * With "gD" go to line 1.
+ * With "gd" Search back for the start of the current function, then go
+ * back until a blank line. If this fails go to line 1.
+ */
+ if (nchar == 'D' || !findpar(oap, BACKWARD, 1L, '{', FALSE))
+ {
+ setpcmark(); /* Set in findpar() otherwise */
+ curwin->w_cursor.lnum = 1;
+ }
+ else
+ {
+ while (curwin->w_cursor.lnum > 1 && *skipwhite(ml_get_curline()) != NUL)
+ --curwin->w_cursor.lnum;
+ }
+ curwin->w_cursor.col = 0;
+
+ /* Search forward for the identifier, ignore comment lines. */
+ while ((t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD, pat, 1L, 0,
+ RE_LAST)) != FAIL
+#ifdef FEAT_COMMENTS
+ && get_leader_len(ml_get_curline(), NULL, FALSE) > 0
+#endif
+ && old_pos.lnum > curwin->w_cursor.lnum)
+ {
+ /* Ignore this line, continue at start of next line. */
+ ++curwin->w_cursor.lnum;
+ curwin->w_cursor.col = 0;
+ }
+ if (t == FAIL || old_pos.lnum <= curwin->w_cursor.lnum)
+ {
+ clearopbeep(oap);
+ curwin->w_cursor = old_pos;
+ }
+ else
+ {
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ /* "n" searches forward now */
+ reset_search_dir();
+ }
+
+ vim_free(pat);
+ p_ws = save_p_ws;
+ p_scs = save_p_scs;
+}
+
+/*
+ * Move 'dist' lines in direction 'dir', counting lines by *screen*
+ * lines rather than lines in the file.
+ * 'dist' must be positive.
+ *
+ * Return OK if able to move cursor, FAIL otherwise.
+ */
+ static int
+nv_screengo(oap, dir, dist)
+ oparg_T *oap;
+ int dir;
+ long dist;
+{
+ int linelen = linetabsize(ml_get_curline());
+ int retval = OK;
+ int atend = FALSE;
+ int n;
+ int col_off1; /* margin offset for first screen line */
+ int col_off2; /* margin offset for wrapped screen line */
+ int width1; /* text width for first screen line */
+ int width2; /* test width for wrapped screen line */
+
+ oap->motion_type = MCHAR;
+ oap->inclusive = FALSE;
+
+ col_off1 = curwin_col_off();
+ col_off2 = col_off1 - curwin_col_off2();
+ width1 = W_WIDTH(curwin) - col_off1;
+ width2 = W_WIDTH(curwin) - col_off2;
+
+#ifdef FEAT_VERTSPLIT
+ if (curwin->w_width != 0)
+ {
+#endif
+ /*
+ * Instead of sticking at the last character of the buffer line we
+ * try to stick in the last column of the screen.
+ */
+ if (curwin->w_curswant == MAXCOL)
+ {
+ atend = TRUE;
+ validate_virtcol();
+ if (width1 <= 0)
+ curwin->w_curswant = 0;
+ else
+ {
+ curwin->w_curswant = width1 - 1;
+ if (curwin->w_virtcol > curwin->w_curswant)
+ curwin->w_curswant += ((curwin->w_virtcol
+ - curwin->w_curswant - 1) / width2 + 1) * width2;
+ }
+ }
+ else
+ {
+ if (linelen > width1)
+ n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
+ else
+ n = width1;
+ if (curwin->w_curswant > (colnr_T)n + 1)
+ curwin->w_curswant -= ((curwin->w_curswant - n) / width2 + 1)
+ * width2;
+ }
+
+ while (dist--)
+ {
+ if (dir == BACKWARD)
+ {
+ if ((long)curwin->w_curswant >= width2)
+ /* move back within line */
+ curwin->w_curswant -= width2;
+ else
+ {
+ /* to previous line */
+ if (curwin->w_cursor.lnum == 1)
+ {
+ retval = FAIL;
+ break;
+ }
+ --curwin->w_cursor.lnum;
+#ifdef FEAT_FOLDING
+ /* Move to the start of a closed fold. Don't do that when
+ * 'foldopen' contains "all": it will open in a moment. */
+ if (!(fdo_flags & FDO_ALL))
+ (void)hasFolding(curwin->w_cursor.lnum,
+ &curwin->w_cursor.lnum, NULL);
+#endif
+ linelen = linetabsize(ml_get_curline());
+ if (linelen > width1)
+ curwin->w_curswant += (((linelen - width1 - 1) / width2)
+ + 1) * width2;
+ }
+ }
+ else /* dir == FORWARD */
+ {
+ if (linelen > width1)
+ n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
+ else
+ n = width1;
+ if (curwin->w_curswant + width2 < (colnr_T)n)
+ /* move forward within line */
+ curwin->w_curswant += width2;
+ else
+ {
+ /* to next line */
+#ifdef FEAT_FOLDING
+ /* Move to the end of a closed fold. */
+ (void)hasFolding(curwin->w_cursor.lnum, NULL,
+ &curwin->w_cursor.lnum);
+#endif
+ if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)
+ {
+ retval = FAIL;
+ break;
+ }
+ curwin->w_cursor.lnum++;
+ curwin->w_curswant %= width2;
+ }
+ }
+ }
+#ifdef FEAT_VERTSPLIT
+ }
+#endif
+
+ coladvance(curwin->w_curswant);
+
+#if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
+ if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
+ {
+ /*
+ * Check for landing on a character that got split at the end of the
+ * last line. We want to advance a screenline, not end up in the same
+ * screenline or move two screenlines.
+ */
+ validate_virtcol();
+ if (curwin->w_virtcol > curwin->w_curswant
+ && (curwin->w_curswant < (colnr_T)width1
+ ? (curwin->w_curswant > (colnr_T)width1 / 2)
+ : ((curwin->w_curswant - width1) % width2
+ > (colnr_T)width2 / 2)))
+ --curwin->w_cursor.col;
+ }
+#endif
+
+ if (atend)
+ curwin->w_curswant = MAXCOL; /* stick in the last column */
+
+ return retval;
+}
+
+#ifdef FEAT_MOUSE
+/*
+ * Mouse scroll wheel: Default action is to scroll three lines, or one page
+ * when Shift or Ctrl is used.
+ * K_MOUSEUP (cap->arg == TRUE) or K_MOUSEDOWN (cap->arg == FALSE)
+ */
+ static void
+nv_mousescroll(cap)
+ cmdarg_T *cap;
+{
+# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+ win_T *old_curwin;
+
+ old_curwin = curwin;
+
+ /* Currently we only get the mouse coordinates in the GUI. */
+ if (gui.in_use && mouse_row >= 0 && mouse_col >= 0)
+ {
+ int row, col;
+
+ row = mouse_row;
+ col = mouse_col;
+
+ /* find the window at the pointer coordinates */
+ curwin = mouse_find_win(&row, &col);
+ curbuf = curwin->w_buffer;
+ }
+# endif
+
+ if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
+ {
+ (void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
+ }
+ else
+ {
+ cap->count1 = 3;
+ cap->count0 = 3;
+ nv_scroll_line(cap);
+ }
+
+# if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
+ curwin->w_redr_status = TRUE;
+
+ curwin = old_curwin;
+ curbuf = curwin->w_buffer;
+# endif
+}
+
+/*
+ * Mouse clicks and drags.
+ */
+ static void
+nv_mouse(cap)
+ cmdarg_T *cap;
+{
+ (void)do_mouse(cap->oap, cap->cmdchar, BACKWARD, cap->count1, 0);
+}
+#endif
+
+/*
+ * Handle CTRL-E and CTRL-Y commands: scroll a line up or down.
+ * cap->arg must be TRUE for CTRL-E.
+ */
+ static void
+nv_scroll_line(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearop(cap->oap))
+ scroll_redraw(cap->arg, cap->count1);
+}
+
+/*
+ * Scroll "count" lines up or down, and redraw.
+ */
+ void
+scroll_redraw(up, count)
+ int up;
+ long count;
+{
+ linenr_T prev_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ int prev_topfill = curwin->w_topfill;
+#endif
+ linenr_T prev_lnum = curwin->w_cursor.lnum;
+
+ if (up)
+ scrollup(count, TRUE);
+ else
+ scrolldown(count, TRUE);
+ if (p_so)
+ {
+ /* Adjust the cursor position for 'scrolloff'. Mark w_topline as
+ * valid, otherwise the screen jumps back at the end of the file. */
+ cursor_correct();
+ check_cursor_moved(curwin);
+ curwin->w_valid |= VALID_TOPLINE;
+
+ /* If moved back to where we were, at least move the cursor, otherwise
+ * we get stuck at one position. Don't move the cursor up if the
+ * first line of the buffer is already on the screen */
+ while (curwin->w_topline == prev_topline
+#ifdef FEAT_DIFF
+ && curwin->w_topfill == prev_topfill
+#endif
+ )
+ {
+ if (up)
+ {
+ if (curwin->w_cursor.lnum > prev_lnum
+ || cursor_down(1L, FALSE) == FAIL)
+ break;
+ }
+ else
+ {
+ if (curwin->w_cursor.lnum < prev_lnum
+ || prev_topline == 1L
+ || cursor_up(1L, FALSE) == FAIL)
+ break;
+ }
+ /* Mark w_topline as valid, otherwise the screen jumps back at the
+ * end of the file. */
+ check_cursor_moved(curwin);
+ curwin->w_valid |= VALID_TOPLINE;
+ }
+ }
+ if (curwin->w_cursor.lnum != prev_lnum)
+ coladvance(curwin->w_curswant);
+ redraw_later(VALID);
+}
+
+/*
+ * Commands that start with "z".
+ */
+ static void
+nv_zet(cap)
+ cmdarg_T *cap;
+{
+ long n;
+ colnr_T col;
+ int nchar = cap->nchar;
+#ifdef FEAT_FOLDING
+ long old_fdl = curwin->w_p_fdl;
+ int old_fen = curwin->w_p_fen;
+#endif
+
+ if (VIM_ISDIGIT(nchar))
+ {
+ /*
+ * "z123{nchar}": edit the count before obtaining {nchar}
+ */
+ if (checkclearop(cap->oap))
+ return;
+ n = nchar - '0';
+ for (;;)
+ {
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ ++no_mapping;
+ ++allow_keys; /* no mapping for nchar, but allow key codes */
+ nchar = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(nchar, TRUE);
+#endif
+ --no_mapping;
+ --allow_keys;
+#ifdef FEAT_CMDL_INFO
+ (void)add_to_showcmd(nchar);
+#endif
+ if (nchar == K_DEL || nchar == K_KDEL)
+ n /= 10;
+ else if (VIM_ISDIGIT(nchar))
+ n = n * 10 + (nchar - '0');
+ else if (nchar == CAR)
+ {
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setheight((int)n);
+ break;
+ }
+ else if (nchar == 'l'
+ || nchar == 'h'
+ || nchar == K_LEFT
+ || nchar == K_RIGHT)
+ {
+ cap->count1 = n ? n * cap->count1 : cap->count1;
+ goto dozet;
+ }
+ else
+ {
+ clearopbeep(cap->oap);
+ break;
+ }
+ }
+ cap->oap->op_type = OP_NOP;
+ return;
+ }
+
+dozet:
+ if (
+#ifdef FEAT_FOLDING
+ /* "zf" and "zF" are always an operator, "zd", "zo", "zO", "zc"
+ * and "zC" only in Visual mode. "zj" and "zk" are motion
+ * commands. */
+ cap->nchar != 'f' && cap->nchar != 'F'
+ && !(VIsual_active && vim_strchr((char_u *)"dcCoO", cap->nchar))
+ && cap->nchar != 'j' && cap->nchar != 'k'
+ &&
+#endif
+ checkclearop(cap->oap))
+ return;
+
+ /*
+ * For "z+", "z<CR>", "zt", "z.", "zz", "z^", "z-", "zb":
+ * If line number given, set cursor.
+ */
+ if ((vim_strchr((char_u *)"+\r\nt.z^-b", nchar) != NULL)
+ && cap->count0
+ && cap->count0 != curwin->w_cursor.lnum)
+ {
+ setpcmark();
+ if (cap->count0 > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ else
+ curwin->w_cursor.lnum = cap->count0;
+ }
+
+ switch (nchar)
+ {
+ /* "z+", "z<CR>" and "zt": put cursor at top of screen */
+ case '+':
+ if (cap->count0 == 0)
+ {
+ /* No count given: put cursor at the line below screen */
+ validate_botline(); /* make sure w_botline is valid */
+ if (curwin->w_botline > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ else
+ curwin->w_cursor.lnum = curwin->w_botline;
+ }
+ /* FALLTHROUGH */
+ case NL:
+ case CAR:
+ case K_KENTER:
+ beginline(BL_WHITE | BL_FIX);
+ /* FALLTHROUGH */
+
+ case 't': scroll_cursor_top(0, TRUE);
+ redraw_later(VALID);
+ break;
+
+ /* "z." and "zz": put cursor in middle of screen */
+ case '.': beginline(BL_WHITE | BL_FIX);
+ /* FALLTHROUGH */
+
+ case 'z': scroll_cursor_halfway(TRUE);
+ redraw_later(VALID);
+ break;
+
+ /* "z^", "z-" and "zb": put cursor at bottom of screen */
+ case '^': /* Strange Vi behavior: <count>z^ finds line at top of window
+ * when <count> is at bottom of window, and puts that one at
+ * bottom of window. */
+ if (cap->count0 != 0)
+ {
+ scroll_cursor_bot(0, TRUE);
+ curwin->w_cursor.lnum = curwin->w_topline;
+ }
+ else if (curwin->w_topline == 1)
+ curwin->w_cursor.lnum = 1;
+ else
+ curwin->w_cursor.lnum = curwin->w_topline - 1;
+ /* FALLTHROUGH */
+ case '-':
+ beginline(BL_WHITE | BL_FIX);
+ /* FALLTHROUGH */
+
+ case 'b': scroll_cursor_bot(0, TRUE);
+ redraw_later(VALID);
+ break;
+
+ /* "zH" - scroll screen right half-page */
+ case 'H':
+ cap->count1 *= W_WIDTH(curwin) / 2;
+ /* FALLTHROUGH */
+
+ /* "zh" - scroll screen to the right */
+ case 'h':
+ case K_LEFT:
+ if (!curwin->w_p_wrap)
+ {
+ if ((colnr_T)cap->count1 > curwin->w_leftcol)
+ curwin->w_leftcol = 0;
+ else
+ curwin->w_leftcol -= (colnr_T)cap->count1;
+ leftcol_changed();
+ }
+ break;
+
+ /* "zL" - scroll screen left half-page */
+ case 'L': cap->count1 *= W_WIDTH(curwin) / 2;
+ /* FALLTHROUGH */
+
+ /* "zl" - scroll screen to the left */
+ case 'l':
+ case K_RIGHT:
+ if (!curwin->w_p_wrap)
+ {
+ /* scroll the window left */
+ curwin->w_leftcol += (colnr_T)cap->count1;
+ leftcol_changed();
+ }
+ break;
+
+ /* "zs" - scroll screen, cursor at the start */
+ case 's': if (!curwin->w_p_wrap)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_cursor.lnum, NULL, NULL))
+ col = 0; /* like the cursor is in col 0 */
+ else
+#endif
+ getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL);
+ if ((long)col > p_siso)
+ col -= p_siso;
+ else
+ col = 0;
+ if (curwin->w_leftcol != col)
+ {
+ curwin->w_leftcol = col;
+ redraw_later(NOT_VALID);
+ }
+ }
+ break;
+
+ /* "ze" - scroll screen, cursor at the end */
+ case 'e': if (!curwin->w_p_wrap)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_cursor.lnum, NULL, NULL))
+ col = 0; /* like the cursor is in col 0 */
+ else
+#endif
+ getvcol(curwin, &curwin->w_cursor, NULL, NULL, &col);
+ n = W_WIDTH(curwin) - curwin_col_off();
+ if ((long)col + p_siso < n)
+ col = 0;
+ else
+ col = col + p_siso - n + 1;
+ if (curwin->w_leftcol != col)
+ {
+ curwin->w_leftcol = col;
+ redraw_later(NOT_VALID);
+ }
+ }
+ break;
+
+#ifdef FEAT_FOLDING
+ /* "zF": create fold command */
+ /* "zf": create fold operator */
+ case 'F':
+ case 'f': if (foldManualAllowed(TRUE))
+ {
+ cap->nchar = 'f';
+ nv_operator(cap);
+ curwin->w_p_fen = TRUE;
+
+ /* "zF" is like "zfzf" */
+ if (nchar == 'F' && cap->oap->op_type == OP_FOLD)
+ {
+ nv_operator(cap);
+ finish_op = TRUE;
+ }
+ }
+ else
+ clearopbeep(cap->oap);
+ break;
+
+ /* "zd": delete fold at cursor */
+ /* "zD": delete fold at cursor recursively */
+ case 'd':
+ case 'D': if (foldManualAllowed(FALSE))
+ {
+ if (VIsual_active)
+ nv_operator(cap);
+ else
+ deleteFold(curwin->w_cursor.lnum,
+ curwin->w_cursor.lnum, nchar == 'D', FALSE);
+ }
+ break;
+
+ /* "zE": erease all folds */
+ case 'E': if (foldmethodIsManual(curwin))
+ {
+ clearFolding(curwin);
+ changed_window_setting();
+ }
+ else if (foldmethodIsMarker(curwin))
+ deleteFold((linenr_T)1, curbuf->b_ml.ml_line_count,
+ TRUE, FALSE);
+ else
+ EMSG(_("E352: Cannot erase folds with current 'foldmethod'"));
+ break;
+
+ /* "zn": fold none: reset 'foldenable' */
+ case 'n': curwin->w_p_fen = FALSE;
+ break;
+
+ /* "zN": fold Normal: set 'foldenable' */
+ case 'N': curwin->w_p_fen = TRUE;
+ break;
+
+ /* "zi": invert folding: toggle 'foldenable' */
+ case 'i': curwin->w_p_fen = !curwin->w_p_fen;
+ break;
+
+ /* "za": open closed fold or close open fold at cursor */
+ case 'a': if (hasFolding(curwin->w_cursor.lnum, NULL, NULL))
+ openFold(curwin->w_cursor.lnum, cap->count1);
+ else
+ {
+ closeFold(curwin->w_cursor.lnum, cap->count1);
+ curwin->w_p_fen = TRUE;
+ }
+ break;
+
+ /* "zA": open fold at cursor recursively */
+ case 'A': if (hasFolding(curwin->w_cursor.lnum, NULL, NULL))
+ openFoldRecurse(curwin->w_cursor.lnum);
+ else
+ {
+ closeFoldRecurse(curwin->w_cursor.lnum);
+ curwin->w_p_fen = TRUE;
+ }
+ break;
+
+ /* "zo": open fold at cursor or Visual area */
+ case 'o': if (VIsual_active)
+ nv_operator(cap);
+ else
+ openFold(curwin->w_cursor.lnum, cap->count1);
+ break;
+
+ /* "zO": open fold recursively */
+ case 'O': if (VIsual_active)
+ nv_operator(cap);
+ else
+ openFoldRecurse(curwin->w_cursor.lnum);
+ break;
+
+ /* "zc": close fold at cursor or Visual area */
+ case 'c': if (VIsual_active)
+ nv_operator(cap);
+ else
+ closeFold(curwin->w_cursor.lnum, cap->count1);
+ curwin->w_p_fen = TRUE;
+ break;
+
+ /* "zC": close fold recursively */
+ case 'C': if (VIsual_active)
+ nv_operator(cap);
+ else
+ closeFoldRecurse(curwin->w_cursor.lnum);
+ curwin->w_p_fen = TRUE;
+ break;
+
+ /* "zv": open folds at the cursor */
+ case 'v': foldOpenCursor();
+ break;
+
+ /* "zx": re-apply 'foldlevel' and open folds at the cursor */
+ case 'x': curwin->w_p_fen = TRUE;
+ newFoldLevel(); /* update right now */
+ foldOpenCursor();
+ break;
+
+ /* "zX": undo manual opens/closes, re-apply 'foldlevel' */
+ case 'X': curwin->w_p_fen = TRUE;
+ old_fdl = -1; /* force an update */
+ break;
+
+ /* "zm": fold more */
+ case 'm': if (curwin->w_p_fdl > 0)
+ --curwin->w_p_fdl;
+ old_fdl = -1; /* force an update */
+ curwin->w_p_fen = TRUE;
+ break;
+
+ /* "zM": close all folds */
+ case 'M': curwin->w_p_fdl = 0;
+ old_fdl = -1; /* force an update */
+ curwin->w_p_fen = TRUE;
+ break;
+
+ /* "zr": reduce folding */
+ case 'r': ++curwin->w_p_fdl;
+ break;
+
+ /* "zR": open all folds */
+ case 'R': curwin->w_p_fdl = getDeepestNesting();
+ old_fdl = -1; /* force an update */
+ break;
+
+ case 'j': /* "zj" move to next fold downwards */
+ case 'k': /* "zk" move to next fold upwards */
+ if (foldMoveTo(TRUE, nchar == 'j' ? FORWARD : BACKWARD,
+ cap->count1) == FAIL)
+ clearopbeep(cap->oap);
+ break;
+
+#endif /* FEAT_FOLDING */
+
+ default: clearopbeep(cap->oap);
+ }
+
+#ifdef FEAT_FOLDING
+ /* Redraw when 'foldenable' changed */
+ if (old_fen != curwin->w_p_fen)
+ {
+# ifdef FEAT_DIFF
+ win_T *wp;
+
+ if (foldmethodIsDiff(curwin) && curwin->w_p_scb)
+ {
+ /* Adjust 'foldenable' in diff-synced windows. */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb)
+ {
+ wp->w_p_fen = curwin->w_p_fen;
+ changed_window_setting_win(wp);
+ }
+ }
+ }
+# endif
+ changed_window_setting();
+ }
+
+ /* Redraw when 'foldlevel' changed. */
+ if (old_fdl != curwin->w_p_fdl)
+ newFoldLevel();
+#endif
+}
+
+#ifdef FEAT_GUI
+/*
+ * Vertical scrollbar movement.
+ */
+ static void
+nv_ver_scrollbar(cap)
+ cmdarg_T *cap;
+{
+ if (cap->oap->op_type != OP_NOP)
+ clearopbeep(cap->oap);
+
+ /* Even if an operator was pending, we still want to scroll */
+ gui_do_scroll();
+}
+
+/*
+ * Horizontal scrollbar movement.
+ */
+ static void
+nv_hor_scrollbar(cap)
+ cmdarg_T *cap;
+{
+ if (cap->oap->op_type != OP_NOP)
+ clearopbeep(cap->oap);
+
+ /* Even if an operator was pending, we still want to scroll */
+ gui_do_horiz_scroll();
+}
+#endif
+
+/*
+ * "Q" command.
+ */
+ static void
+nv_exmode(cap)
+ cmdarg_T *cap;
+{
+ /*
+ * Ignore 'Q' in Visual mode, just give a beep.
+ */
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ vim_beep();
+ else
+#endif
+ if (!checkclearop(cap->oap))
+ do_exmode(FALSE);
+}
+
+/*
+ * Handle a ":" command.
+ */
+ static void
+nv_colon(cap)
+ cmdarg_T *cap;
+{
+ int old_p_im;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ nv_operator(cap);
+ else
+#endif
+ {
+ if (cap->oap->op_type != OP_NOP)
+ {
+ /* Using ":" as a movement is characterwise exclusive. */
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ }
+ else if (cap->count0)
+ {
+ /* translate "count:" into ":.,.+(count - 1)" */
+ stuffcharReadbuff('.');
+ if (cap->count0 > 1)
+ {
+ stuffReadbuff((char_u *)",.+");
+ stuffnumReadbuff((long)cap->count0 - 1L);
+ }
+ }
+
+ /* When typing, don't type below an old message */
+ if (KeyTyped)
+ compute_cmdrow();
+
+ old_p_im = p_im;
+
+ /* get a command line and execute it */
+ do_cmdline(NULL, getexline, NULL,
+ cap->oap->op_type != OP_NOP ? DOCMD_KEEPLINE : 0);
+
+ /* If 'insertmode' changed, enter or exit Insert mode */
+ if (p_im != old_p_im)
+ {
+ if (p_im)
+ restart_edit = 'i';
+ else
+ restart_edit = 0;
+ }
+
+ /* The start of the operator may have become invalid by the Ex
+ * command. */
+ if (cap->oap->op_type != OP_NOP
+ && (cap->oap->start.lnum > curbuf->b_ml.ml_line_count
+ || cap->oap->start.col >
+ STRLEN(ml_get(cap->oap->start.lnum))))
+ clearopbeep(cap->oap);
+ }
+}
+
+/*
+ * Handle CTRL-G command.
+ */
+ static void
+nv_ctrlg(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active) /* toggle Selection/Visual mode */
+ {
+ VIsual_select = !VIsual_select;
+ showmode();
+ }
+ else
+#endif
+ if (!checkclearop(cap->oap))
+ /* print full name if count given or :cd used */
+ fileinfo((int)cap->count0, FALSE, TRUE);
+}
+
+/*
+ * Handle CTRL-H <Backspace> command.
+ */
+ static void
+nv_ctrlh(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active && VIsual_select)
+ {
+ cap->cmdchar = 'x'; /* BS key behaves like 'x' in Select mode */
+ v_visop(cap);
+ }
+ else
+#endif
+ nv_left(cap);
+}
+
+/*
+ * CTRL-L: clear screen and redraw.
+ */
+ static void
+nv_clear(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearop(cap->oap))
+ {
+#if defined(__BEOS__) && !USE_THREAD_FOR_INPUT_WITH_TIMEOUT
+ /*
+ * Right now, the BeBox doesn't seem to have an easy way to detect
+ * window resizing, so we cheat and make the user detect it
+ * manually with CTRL-L instead
+ */
+ ui_get_shellsize();
+#endif
+#ifdef FEAT_SYN_HL
+ /* Clear all syntax states to force resyncing. */
+ syn_stack_free_all(curbuf);
+#endif
+ redraw_later(CLEAR);
+ }
+}
+
+/*
+ * CTRL-O: In Select mode: switch to Visual mode for one command.
+ * Otherwise: Go to older pcmark.
+ */
+ static void
+nv_ctrlo(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active && VIsual_select)
+ {
+ VIsual_select = FALSE;
+ showmode();
+ restart_VIsual_select = 2; /* restart Select mode later */
+ }
+ else
+#endif
+ {
+ cap->count1 = -cap->count1;
+ nv_pcmark(cap);
+ }
+}
+
+/*
+ * CTRL-^ command, short for ":e #"
+ */
+ static void
+nv_hat(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ (void)buflist_getfile((int)cap->count0, (linenr_T)0,
+ GETF_SETMARK|GETF_ALT, FALSE);
+}
+
+/*
+ * "Z" commands.
+ */
+ static void
+nv_Zet(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ {
+ switch (cap->nchar)
+ {
+ /* "ZZ": equivalent to ":x". */
+ case 'Z': do_cmdline_cmd((char_u *)"x");
+ break;
+
+ /* "ZQ": equivalent to ":q!" (Elvis compatible). */
+ case 'Q': do_cmdline_cmd((char_u *)"q!");
+ break;
+
+ default: clearopbeep(cap->oap);
+ }
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Call nv_ident() as if "c1" was used, with "c2" as next character.
+ */
+ void
+do_nv_ident(c1, c2)
+ int c1;
+ int c2;
+{
+ oparg_T oa;
+ cmdarg_T ca;
+
+ clear_oparg(&oa);
+ vim_memset(&ca, 0, sizeof(ca));
+ ca.oap = &oa;
+ ca.cmdchar = c1;
+ ca.nchar = c2;
+ nv_ident(&ca);
+}
+#endif
+
+/*
+ * Handle the commands that use the word under the cursor.
+ * [g] CTRL-] :ta to current identifier
+ * [g] 'K' run program for current identifier
+ * [g] '*' / to current identifier or string
+ * [g] '#' ? to current identifier or string
+ * g ']' :tselect for current identifier
+ */
+ static void
+nv_ident(cap)
+ cmdarg_T *cap;
+{
+ char_u *ptr = NULL;
+ char_u *buf;
+ char_u *p;
+ char_u *kp; /* value of 'keywordprg' */
+ int kp_help; /* 'keywordprg' is ":help" */
+ int n = 0; /* init for GCC */
+ int cmdchar;
+ int g_cmd; /* "g" command */
+ char_u *aux_ptr;
+ int isman;
+ int isman_s;
+
+ if (cap->cmdchar == 'g') /* "g*", "g#", "g]" and "gCTRL-]" */
+ {
+ cmdchar = cap->nchar;
+ g_cmd = TRUE;
+ }
+ else
+ {
+ cmdchar = cap->cmdchar;
+ g_cmd = FALSE;
+ }
+
+ if (cmdchar == POUND) /* the pound sign, '#' for English keyboards */
+ cmdchar = '#';
+
+ /*
+ * The "]", "CTRL-]" and "K" commands accept an argument in Visual mode.
+ */
+ if (cmdchar == ']' || cmdchar == Ctrl_RSB || cmdchar == 'K')
+ {
+#ifdef FEAT_VISUAL
+ if (VIsual_active && get_visual_text(cap, &ptr, &n) == FAIL)
+ return;
+#endif
+ if (checkclearopq(cap->oap))
+ return;
+ }
+
+ if (ptr == NULL && (n = find_ident_under_cursor(&ptr,
+ (cmdchar == '*' || cmdchar == '#')
+ ? FIND_IDENT|FIND_STRING : FIND_IDENT)) == 0)
+ {
+ clearop(cap->oap);
+ return;
+ }
+
+ /* Allocate buffer to put the command in. Inserting backslashes can
+ * double the length of the word. p_kp / curbuf->b_p_kp could be added
+ * and some numbers. */
+ kp = (*curbuf->b_p_kp == NUL ? p_kp : curbuf->b_p_kp);
+ kp_help = (*kp == NUL || STRCMP(kp, ":he") == 0
+ || STRCMP(kp, ":help") == 0);
+ buf = alloc((unsigned)(n * 2 + 30 + STRLEN(kp)));
+ if (buf == NULL)
+ return;
+ buf[0] = NUL;
+
+ switch (cmdchar)
+ {
+ case '*':
+ case '#':
+ /*
+ * Put cursor at start of word, makes search skip the word
+ * under the cursor.
+ * Call setpcmark() first, so "*``" puts the cursor back where
+ * it was.
+ */
+ setpcmark();
+ curwin->w_cursor.col = (colnr_T) (ptr - ml_get_curline());
+
+ if (!g_cmd && vim_iswordp(ptr))
+ STRCPY(buf, "\\<");
+ no_smartcase = TRUE; /* don't use 'smartcase' now */
+ break;
+
+ case 'K':
+ if (kp_help)
+ STRCPY(buf, "he! ");
+ else
+ {
+ /* When a count is given, turn it into a range. Is this
+ * really what we want? */
+ isman = (STRCMP(kp, "man") == 0);
+ isman_s = (STRCMP(kp, "man -s") == 0);
+ if (cap->count0 != 0 && !(isman || isman_s))
+ sprintf((char *)buf, ".,.+%ld", cap->count0 - 1);
+
+ STRCAT(buf, "! ");
+ if (cap->count0 == 0 && isman_s)
+ STRCAT(buf, "man");
+ else
+ STRCAT(buf, kp);
+ STRCAT(buf, " ");
+ if (cap->count0 != 0 && (isman || isman_s))
+ {
+ sprintf((char *)buf + STRLEN(buf), "%ld", cap->count0);
+ STRCAT(buf, " ");
+ }
+ }
+ break;
+
+ case ']':
+#ifdef FEAT_CSCOPE
+ if (p_cst)
+ STRCPY(buf, "cstag ");
+ else
+#endif
+ STRCPY(buf, "ts ");
+ break;
+
+ default:
+ if (curbuf->b_help)
+ STRCPY(buf, "he! ");
+ else if (g_cmd)
+ STRCPY(buf, "tj ");
+ else
+ STRCPY(buf, "ta ");
+ }
+
+ /*
+ * Now grab the chars in the identifier
+ */
+ if (cmdchar == '*')
+ aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
+ else if (cmdchar == '#')
+ aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
+ else if (cmdchar == 'K' && !kp_help)
+ aux_ptr = (char_u *)" \t\\\"|!";
+ else
+ /* Don't escape spaces and Tabs in a tag with a backslash */
+ aux_ptr = (char_u *)"\\|\"";
+
+ p = buf + STRLEN(buf);
+ while (n-- > 0)
+ {
+ /* put a backslash before \ and some others */
+ if (vim_strchr(aux_ptr, *ptr) != NULL)
+ *p++ = '\\';
+#ifdef FEAT_MBYTE
+ /* When current byte is a part of multibyte character, copy all bytes
+ * of that character. */
+ if (has_mbyte)
+ {
+ int i;
+ int len = (*mb_ptr2len_check)(ptr) - 1;
+
+ for (i = 0; i < len && n >= 1; ++i, --n)
+ *p++ = *ptr++;
+ }
+#endif
+ *p++ = *ptr++;
+ }
+ *p = NUL;
+
+ /*
+ * Execute the command.
+ */
+ if (cmdchar == '*' || cmdchar == '#')
+ {
+ if (!g_cmd && (
+#ifdef FEAT_MBYTE
+ has_mbyte ? vim_iswordp(mb_prevptr(ml_get_curline(), ptr)) :
+#endif
+ vim_iswordc(ptr[-1])))
+ STRCAT(buf, "\\>");
+#ifdef FEAT_CMDHIST
+ /* put pattern in search history */
+ add_to_history(HIST_SEARCH, buf, TRUE, NUL);
+#endif
+ normal_search(cap, cmdchar == '*' ? '/' : '?', buf, 0);
+ }
+ else
+ do_cmdline_cmd(buf);
+
+ vim_free(buf);
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * Get visually selected text, within one line only.
+ * Returns FAIL if more than one line selected.
+ */
+ static int
+get_visual_text(cap, pp, lenp)
+ cmdarg_T *cap;
+ char_u **pp; /* return: start of selected text */
+ int *lenp; /* return: length of selected text */
+{
+ if (VIsual_mode != 'V')
+ unadjust_for_sel();
+ if (VIsual.lnum != curwin->w_cursor.lnum)
+ {
+ clearopbeep(cap->oap);
+ return FAIL;
+ }
+ if (VIsual_mode == 'V')
+ {
+ *pp = ml_get_curline();
+ *lenp = (int)STRLEN(*pp);
+ }
+ else
+ {
+ if (lt(curwin->w_cursor, VIsual))
+ {
+ *pp = ml_get_pos(&curwin->w_cursor);
+ *lenp = VIsual.col - curwin->w_cursor.col + 1;
+ }
+ else
+ {
+ *pp = ml_get_pos(&VIsual);
+ *lenp = curwin->w_cursor.col - VIsual.col + 1;
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ /* Correct the length to include the whole last character. */
+ *lenp += (*mb_ptr2len_check)(*pp + (*lenp - 1)) - 1;
+#endif
+ }
+ reset_VIsual_and_resel();
+ return OK;
+}
+#endif
+
+/*
+ * CTRL-T: backwards in tag stack
+ */
+ static void
+nv_tagpop(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ do_tag((char_u *)"", DT_POP, (int)cap->count1, FALSE, TRUE);
+}
+
+/*
+ * Handle scrolling command 'H', 'L' and 'M'.
+ */
+ static void
+nv_scroll(cap)
+ cmdarg_T *cap;
+{
+ int used = 0;
+ long n;
+#ifdef FEAT_FOLDING
+ linenr_T lnum;
+#endif
+ int half;
+
+ cap->oap->motion_type = MLINE;
+ setpcmark();
+
+ if (cap->cmdchar == 'L')
+ {
+ validate_botline(); /* make sure curwin->w_botline is valid */
+ curwin->w_cursor.lnum = curwin->w_botline - 1;
+ if (cap->count1 - 1 >= curwin->w_cursor.lnum)
+ curwin->w_cursor.lnum = 1;
+ else
+ curwin->w_cursor.lnum -= cap->count1 - 1;
+ }
+ else
+ {
+ if (cap->cmdchar == 'M')
+ {
+#ifdef FEAT_DIFF
+ /* Don't count filler lines above the window. */
+ used -= diff_check_fill(curwin, curwin->w_topline)
+ - curwin->w_topfill;
+#endif
+ validate_botline(); /* make sure w_empty_rows is valid */
+ half = (curwin->w_height - curwin->w_empty_rows + 1) / 2;
+ for (n = 0; curwin->w_topline + n < curbuf->b_ml.ml_line_count; ++n)
+ {
+#ifdef FEAT_DIFF
+ /* Count half he number of filler lines to be "below this
+ * line" and half to be "above the next line". */
+ if (n > 0 && used + diff_check_fill(curwin, curwin->w_topline
+ + n) / 2 >= half)
+ {
+ --n;
+ break;
+ }
+#endif
+ used += plines(curwin->w_topline + n);
+ if (used >= half)
+ break;
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_topline + n, NULL, &lnum))
+ n = lnum - curwin->w_topline;
+#endif
+ }
+ if (n > 0 && used > curwin->w_height)
+ --n;
+ }
+ else
+ n = cap->count1 - 1;
+ curwin->w_cursor.lnum = curwin->w_topline + n;
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ }
+
+ cursor_correct(); /* correct for 'so' */
+ beginline(BL_SOL | BL_FIX);
+}
+
+/*
+ * Cursor right commands.
+ */
+ static void
+nv_right(cap)
+ cmdarg_T *cap;
+{
+ long n;
+#ifdef FEAT_VISUAL
+ int PAST_LINE;
+#else
+# define PAST_LINE 0
+#endif
+
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+#ifdef FEAT_VISUAL
+ PAST_LINE = (VIsual_active && *p_sel != 'o');
+
+# ifdef FEAT_VIRTUALEDIT
+ /*
+ * In virtual mode, there's no such thing as "PAST_LINE", as lines are
+ * (theoretically) infinitly long.
+ */
+ if (virtual_active())
+ PAST_LINE = 0;
+# endif
+#endif
+
+ for (n = cap->count1; n > 0; --n)
+ {
+ if ((!PAST_LINE && oneright() == FAIL)
+ || (PAST_LINE && *ml_get_cursor() == NUL))
+ {
+ /*
+ * <Space> wraps to next line if 'whichwrap' bit 1 set.
+ * 'l' wraps to next line if 'whichwrap' bit 2 set.
+ * CURS_RIGHT wraps to next line if 'whichwrap' bit 3 set
+ */
+ if ( ((cap->cmdchar == ' '
+ && vim_strchr(p_ww, 's') != NULL)
+ || (cap->cmdchar == 'l'
+ && vim_strchr(p_ww, 'l') != NULL)
+ || (cap->cmdchar == K_RIGHT
+ && vim_strchr(p_ww, '>') != NULL))
+ && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+ /* When deleting we also count the NL as a character.
+ * Set cap->oap->inclusive when last char in the line is
+ * included, move to next line after that */
+ if ( (cap->oap->op_type == OP_DELETE
+ || cap->oap->op_type == OP_CHANGE)
+ && !cap->oap->inclusive
+ && !lineempty(curwin->w_cursor.lnum))
+ cap->oap->inclusive = TRUE;
+ else
+ {
+ ++curwin->w_cursor.lnum;
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+ cap->oap->inclusive = FALSE;
+ }
+ continue;
+ }
+ if (cap->oap->op_type == OP_NOP)
+ {
+ /* Only beep and flush if not moved at all */
+ if (n == cap->count1)
+ beep_flush();
+ }
+ else
+ {
+ if (!lineempty(curwin->w_cursor.lnum))
+ cap->oap->inclusive = TRUE;
+ }
+ break;
+ }
+#ifdef FEAT_VISUAL
+ else if (PAST_LINE)
+ {
+ curwin->w_set_curswant = TRUE;
+# ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ oneright();
+ else
+# endif
+ {
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ curwin->w_cursor.col +=
+ (*mb_ptr2len_check)(ml_get_cursor());
+ else
+# endif
+ ++curwin->w_cursor.col;
+ }
+ }
+#endif
+ }
+#ifdef FEAT_FOLDING
+ if (n != cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
+ && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Cursor left commands.
+ *
+ * Returns TRUE when operator end should not be adjusted.
+ */
+ static void
+nv_left(cap)
+ cmdarg_T *cap;
+{
+ long n;
+
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ for (n = cap->count1; n > 0; --n)
+ {
+ if (oneleft() == FAIL)
+ {
+ /* <BS> and <Del> wrap to previous line if 'whichwrap' has 'b'.
+ * 'h' wraps to previous line if 'whichwrap' has 'h'.
+ * CURS_LEFT wraps to previous line if 'whichwrap' has '<'.
+ */
+ if ( (((cap->cmdchar == K_BS
+ || cap->cmdchar == Ctrl_H)
+ && vim_strchr(p_ww, 'b') != NULL)
+ || (cap->cmdchar == 'h'
+ && vim_strchr(p_ww, 'h') != NULL)
+ || (cap->cmdchar == K_LEFT
+ && vim_strchr(p_ww, '<') != NULL))
+ && curwin->w_cursor.lnum > 1)
+ {
+ --(curwin->w_cursor.lnum);
+ coladvance((colnr_T)MAXCOL);
+ curwin->w_set_curswant = TRUE;
+
+ /* When the NL before the first char has to be deleted we
+ * put the cursor on the NUL after the previous line.
+ * This is a very special case, be careful!
+ * don't adjust op_end now, otherwise it won't work */
+ if ( (cap->oap->op_type == OP_DELETE
+ || cap->oap->op_type == OP_CHANGE)
+ && !lineempty(curwin->w_cursor.lnum))
+ {
+ ++curwin->w_cursor.col;
+ cap->retval |= CA_NO_ADJ_OP_END;
+ }
+ continue;
+ }
+ /* Only beep and flush if not moved at all */
+ else if (cap->oap->op_type == OP_NOP && n == cap->count1)
+ beep_flush();
+ break;
+ }
+ }
+#ifdef FEAT_FOLDING
+ if (n != cap->count1 && (fdo_flags & FDO_HOR) && KeyTyped
+ && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Cursor up commands.
+ * cap->arg is TRUE for "-": Move cursor to first non-blank.
+ */
+ static void
+nv_up(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MLINE;
+ if (cursor_up(cap->count1, cap->oap->op_type == OP_NOP) == FAIL)
+ clearopbeep(cap->oap);
+ else if (cap->arg)
+ beginline(BL_WHITE | BL_FIX);
+}
+
+/*
+ * Cursor down commands.
+ * cap->arg is TRUE for CR and "+": Move cursor to first non-blank.
+ */
+ static void
+nv_down(cap)
+ cmdarg_T *cap;
+{
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ /* In a quickfix window a <CR> jumps to the error under the cursor. */
+ if (bt_quickfix(curbuf) && cap->cmdchar == '\r')
+ do_cmdline_cmd((char_u *)".cc");
+ else
+#endif
+ {
+#ifdef FEAT_CMDWIN
+ /* In the cmdline window a <CR> executes the command. */
+ if (cmdwin_type != 0 && cap->cmdchar == '\r')
+ cmdwin_result = CAR;
+ else
+#endif
+ {
+ cap->oap->motion_type = MLINE;
+ if (cursor_down(cap->count1, cap->oap->op_type == OP_NOP) == FAIL)
+ clearopbeep(cap->oap);
+ else if (cap->arg)
+ beginline(BL_WHITE | BL_FIX);
+ }
+ }
+}
+
+#ifdef FEAT_SEARCHPATH
+/*
+ * Grab the file name under the cursor and edit it.
+ */
+ static void
+nv_gotofile(cap)
+ cmdarg_T *cap;
+{
+ char_u *ptr;
+
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ clearopbeep(cap->oap);
+ return;
+ }
+#endif
+
+# ifdef FEAT_VISUAL
+ /*
+ * In Visual mode, use the selected text as a file name.
+ * Don't allow selection across multiple lines.
+ */
+ if (VIsual_active)
+ {
+ int len;
+
+ if (get_visual_text(cap, &ptr, &len) == FAIL)
+ return;
+ ptr = find_file_name_in_path(ptr, len,
+ FNAME_MESS|FNAME_EXP|FNAME_REL, cap->count1, curbuf->b_ffname);
+ }
+ else
+# endif
+ ptr = file_name_at_cursor(FNAME_MESS|FNAME_HYP|FNAME_EXP|FNAME_REL,
+ cap->count1);
+
+ if (ptr != NULL)
+ {
+ /* do autowrite if necessary */
+ if (curbufIsChanged() && curbuf->b_nwindows <= 1 && !P_HID(curbuf))
+ autowrite(curbuf, FALSE);
+ setpcmark();
+ (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
+ P_HID(curbuf) ? ECMD_HIDE : 0);
+ vim_free(ptr);
+ }
+ else
+ clearop(cap->oap);
+}
+#endif
+
+/*
+ * <End> command: to end of current line or last line.
+ */
+ static void
+nv_end(cap)
+ cmdarg_T *cap;
+{
+ if (cap->arg) /* CTRL-END = goto last line */
+ {
+ nv_goto(cap);
+ cap->count1 = 1; /* to end of current line */
+ }
+ nv_dollar(cap);
+}
+
+/*
+ * Handle the "$" command.
+ */
+ static void
+nv_dollar(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ /* In virtual mode when off the edge of a line and an operator
+ * is pending (whew!) keep the cursor where it is.
+ * Otherwise, send it to the end of the line. */
+ if (!virtual_active() || gchar_cursor() != NUL
+ || cap->oap->op_type == OP_NOP)
+#endif
+ curwin->w_curswant = MAXCOL; /* so we stay at the end */
+ if (cursor_down((long)(cap->count1 - 1),
+ cap->oap->op_type == OP_NOP) == FAIL)
+ clearopbeep(cap->oap);
+#ifdef FEAT_FOLDING
+ else if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Implementation of '?' and '/' commands.
+ * If cap->arg is TRUE don't set PC mark.
+ */
+ static void
+nv_search(cap)
+ cmdarg_T *cap;
+{
+ oparg_T *oap = cap->oap;
+
+ if (cap->cmdchar == '?' && cap->oap->op_type == OP_ROT13)
+ {
+ /* Translate "g??" to "g?g?" */
+ cap->cmdchar = 'g';
+ cap->nchar = '?';
+ nv_operator(cap);
+ return;
+ }
+
+ cap->searchbuf = getcmdline(cap->cmdchar, cap->count1, 0);
+
+ if (cap->searchbuf == NULL)
+ {
+ clearop(oap);
+ return;
+ }
+
+ normal_search(cap, cap->cmdchar, cap->searchbuf,
+ (cap->arg ? 0 : SEARCH_MARK));
+}
+
+/*
+ * Handle "N" and "n" commands.
+ * cap->arg is SEARCH_REV for "N", 0 for "n".
+ */
+ static void
+nv_next(cap)
+ cmdarg_T *cap;
+{
+ normal_search(cap, 0, NULL, SEARCH_MARK | cap->arg);
+}
+
+/*
+ * Search for "pat" in direction "dir" ('/' or '?', 0 for repeat).
+ * Uses only cap->count1 and cap->oap from "cap".
+ */
+ static void
+normal_search(cap, dir, pat, opt)
+ cmdarg_T *cap;
+ int dir;
+ char_u *pat;
+ int opt; /* extra flags for do_search() */
+{
+ int i;
+
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ cap->oap->use_reg_one = TRUE;
+ curwin->w_set_curswant = TRUE;
+
+ i = do_search(cap->oap, dir, pat, cap->count1,
+ opt | SEARCH_OPT | SEARCH_ECHO | SEARCH_MSG);
+ if (i == 0)
+ clearop(cap->oap);
+ else
+ {
+ if (i == 2)
+ cap->oap->motion_type = MLINE;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_FOLDING
+ if (cap->oap->op_type == OP_NOP && (fdo_flags & FDO_SEARCH) && KeyTyped)
+ foldOpenCursor();
+#endif
+ }
+
+ /* "/$" will put the cursor after the end of the line, may need to
+ * correct that here */
+ check_cursor();
+}
+
+/*
+ * Character search commands.
+ * cap->arg is BACKWARD for 'F' and 'T', FORWARD for 'f' and 't', TRUE for
+ * ',' and FALSE for ';'.
+ * cap->nchar is NUL for ',' and ';' (repeat the search)
+ */
+ static void
+nv_csearch(cap)
+ cmdarg_T *cap;
+{
+ int t_cmd;
+
+ if (cap->cmdchar == 't' || cap->cmdchar == 'T')
+ t_cmd = TRUE;
+ else
+ t_cmd = FALSE;
+
+ cap->oap->motion_type = MCHAR;
+ if (cap->arg == BACKWARD)
+ cap->oap->inclusive = FALSE;
+ else
+ cap->oap->inclusive = TRUE;
+ if (IS_SPECIAL(cap->nchar) || searchc(cap, t_cmd) == FAIL)
+ clearopbeep(cap->oap);
+ else
+ {
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ /* Include a Tab for "tx" and for "dfx". */
+ if (gchar_cursor() == TAB && virtual_active() && cap->arg == FORWARD
+ && (t_cmd || cap->oap->op_type != OP_NOP))
+ {
+ colnr_T scol, ecol;
+
+ getvcol(curwin, &curwin->w_cursor, &scol, NULL, &ecol);
+ curwin->w_cursor.coladd = ecol - scol;
+ }
+ else
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_VISUAL
+ adjust_for_sel(cap);
+#endif
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+}
+
+/*
+ * "[" and "]" commands.
+ * cap->arg is BACKWARD for "[" and FORWARD for "]".
+ */
+ static void
+nv_brackets(cap)
+ cmdarg_T *cap;
+{
+ pos_T new_pos;
+ pos_T prev_pos;
+ pos_T *pos = NULL; /* init for GCC */
+ pos_T old_pos; /* cursor position before command */
+ int flag;
+ long n;
+ int findc;
+ int c;
+
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ old_pos = curwin->w_cursor;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0; /* TODO: don't do this for an error. */
+#endif
+
+#ifdef FEAT_SEARCHPATH
+ /*
+ * "[f" or "]f" : Edit file under the cursor (same as "gf")
+ */
+ if (cap->nchar == 'f')
+ nv_gotofile(cap);
+ else
+#endif
+
+#ifdef FEAT_FIND_ID
+ /*
+ * Find the occurence(s) of the identifier or define under cursor
+ * in current and included files or jump to the first occurence.
+ *
+ * search list jump
+ * fwd bwd fwd bwd fwd bwd
+ * identifier "]i" "[i" "]I" "[I" "]^I" "[^I"
+ * define "]d" "[d" "]D" "[D" "]^D" "[^D"
+ */
+ if (vim_strchr((char_u *)
+#ifdef EBCDIC
+ "iI\005dD\067",
+#else
+ "iI\011dD\004",
+#endif
+ cap->nchar) != NULL)
+ {
+ char_u *ptr;
+ int len;
+
+ if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0)
+ clearop(cap->oap);
+ else
+ {
+ find_pattern_in_path(ptr, 0, len, TRUE,
+ cap->count0 == 0 ? !isupper(cap->nchar) : FALSE,
+ ((cap->nchar & 0xf) == ('d' & 0xf)) ? FIND_DEFINE : FIND_ANY,
+ cap->count1,
+ isupper(cap->nchar) ? ACTION_SHOW_ALL :
+ islower(cap->nchar) ? ACTION_SHOW : ACTION_GOTO,
+ cap->cmdchar == ']' ? curwin->w_cursor.lnum + 1 : (linenr_T)1,
+ (linenr_T)MAXLNUM);
+ curwin->w_set_curswant = TRUE;
+ }
+ }
+ else
+#endif
+
+ /*
+ * "[{", "[(", "]}" or "])": go to Nth unclosed '{', '(', '}' or ')'
+ * "[#", "]#": go to start/end of Nth innermost #if..#endif construct.
+ * "[/", "[*", "]/", "]*": go to Nth comment start/end.
+ * "[m" or "]m" search for prev/next start of (Java) method.
+ * "[M" or "]M" search for prev/next end of (Java) method.
+ */
+ if ( (cap->cmdchar == '['
+ && vim_strchr((char_u *)"{(*/#mM", cap->nchar) != NULL)
+ || (cap->cmdchar == ']'
+ && vim_strchr((char_u *)"})*/#mM", cap->nchar) != NULL))
+ {
+ if (cap->nchar == '*')
+ cap->nchar = '/';
+ new_pos.lnum = 0;
+ prev_pos.lnum = 0;
+ if (cap->nchar == 'm' || cap->nchar == 'M')
+ {
+ if (cap->cmdchar == '[')
+ findc = '{';
+ else
+ findc = '}';
+ n = 9999;
+ }
+ else
+ {
+ findc = cap->nchar;
+ n = cap->count1;
+ }
+ for ( ; n > 0; --n)
+ {
+ if ((pos = findmatchlimit(cap->oap, findc,
+ (cap->cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == NULL)
+ {
+ if (new_pos.lnum == 0) /* nothing found */
+ {
+ if (cap->nchar != 'm' && cap->nchar != 'M')
+ clearopbeep(cap->oap);
+ }
+ else
+ pos = &new_pos; /* use last one found */
+ break;
+ }
+ prev_pos = new_pos;
+ curwin->w_cursor = *pos;
+ new_pos = *pos;
+ }
+ curwin->w_cursor = old_pos;
+
+ /*
+ * Handle "[m", "]m", "[M" and "[M". The findmatchlimit() only
+ * brought us to the match for "[m" and "]M" when inside a method.
+ * Try finding the '{' or '}' we want to be at.
+ * Also repeat for the given count.
+ */
+ if (cap->nchar == 'm' || cap->nchar == 'M')
+ {
+ /* norm is TRUE for "]M" and "[m" */
+ int norm = ((findc == '{') == (cap->nchar == 'm'));
+
+ n = cap->count1;
+ /* found a match: we were inside a method */
+ if (prev_pos.lnum != 0)
+ {
+ pos = &prev_pos;
+ curwin->w_cursor = prev_pos;
+ if (norm)
+ --n;
+ }
+ else
+ pos = NULL;
+ while (n > 0)
+ {
+ for (;;)
+ {
+ if ((findc == '{' ? dec_cursor() : inc_cursor()) < 0)
+ {
+ /* if not found anything, that's an error */
+ if (pos == NULL)
+ clearopbeep(cap->oap);
+ n = 0;
+ break;
+ }
+ c = gchar_cursor();
+ if (c == '{' || c == '}')
+ {
+ /* Must have found end/start of class: use it.
+ * Or found the place to be at. */
+ if ((c == findc && norm) || (n == 1 && !norm))
+ {
+ new_pos = curwin->w_cursor;
+ pos = &new_pos;
+ n = 0;
+ }
+ /* if no match found at all, we started outside of the
+ * class and we're inside now. Just go on. */
+ else if (new_pos.lnum == 0)
+ {
+ new_pos = curwin->w_cursor;
+ pos = &new_pos;
+ }
+ /* found start/end of other method: go to match */
+ else if ((pos = findmatchlimit(cap->oap, findc,
+ (cap->cmdchar == '[') ? FM_BACKWARD : FM_FORWARD,
+ 0)) == NULL)
+ n = 0;
+ else
+ curwin->w_cursor = *pos;
+ break;
+ }
+ }
+ --n;
+ }
+ curwin->w_cursor = old_pos;
+ if (pos == NULL && new_pos.lnum != 0)
+ clearopbeep(cap->oap);
+ }
+ if (pos != NULL)
+ {
+ setpcmark();
+ curwin->w_cursor = *pos;
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_BLOCK) && KeyTyped
+ && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+ }
+
+ /*
+ * "[[", "[]", "]]" and "][": move to start or end of function
+ */
+ else if (cap->nchar == '[' || cap->nchar == ']')
+ {
+ if (cap->nchar == cap->cmdchar) /* "]]" or "[[" */
+ flag = '{';
+ else
+ flag = '}'; /* "][" or "[]" */
+
+ curwin->w_set_curswant = TRUE;
+ /*
+ * Imitate strange Vi behaviour: When using "]]" with an operator
+ * we also stop at '}'.
+ */
+ if (!findpar(cap->oap, cap->arg, cap->count1, flag,
+ (cap->oap->op_type != OP_NOP
+ && cap->arg == FORWARD && flag == '{')))
+ clearopbeep(cap->oap);
+ else
+ {
+ if (cap->oap->op_type == OP_NOP)
+ beginline(BL_WHITE | BL_FIX);
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+ }
+
+ /*
+ * "[p", "[P", "]P" and "]p": put with indent adjustment
+ */
+ else if (cap->nchar == 'p' || cap->nchar == 'P')
+ {
+ if (!checkclearopq(cap->oap))
+ {
+ prep_redo_cmd(cap);
+ do_put(cap->oap->regname,
+ (cap->cmdchar == ']' && cap->nchar == 'p') ? FORWARD : BACKWARD,
+ cap->count1, PUT_FIXINDENT);
+ }
+ }
+
+ /*
+ * "['", "[`", "]'" and "]`": jump to next mark
+ */
+ else if (cap->nchar == '\'' || cap->nchar == '`')
+ {
+ pos = &curwin->w_cursor;
+ for (n = cap->count1; n > 0; --n)
+ {
+ prev_pos = *pos;
+ pos = getnextmark(pos, cap->cmdchar == '[' ? BACKWARD : FORWARD,
+ cap->nchar == '\'');
+ if (pos == NULL)
+ break;
+ }
+ if (pos == NULL)
+ pos = &prev_pos;
+ nv_cursormark(cap, cap->nchar == '\'', pos);
+ }
+
+#ifdef FEAT_MOUSE
+ /*
+ * [ or ] followed by a middle mouse click: put selected text with
+ * indent adjustment. Any other button just does as usual.
+ */
+ else if (cap->nchar >= K_LEFTMOUSE && cap->nchar <= K_RIGHTRELEASE)
+ {
+ (void)do_mouse(cap->oap, cap->nchar,
+ (cap->cmdchar == ']') ? FORWARD : BACKWARD,
+ cap->count1, PUT_FIXINDENT);
+ }
+#endif /* FEAT_MOUSE */
+
+#ifdef FEAT_FOLDING
+ /*
+ * "[z" and "]z": move to start or end of open fold.
+ */
+ else if (cap->nchar == 'z')
+ {
+ if (foldMoveTo(FALSE, cap->cmdchar == ']' ? FORWARD : BACKWARD,
+ cap->count1) == FAIL)
+ clearopbeep(cap->oap);
+ }
+#endif
+
+#ifdef FEAT_DIFF
+ /*
+ * "[c" and "]c": move to next or previous diff-change.
+ */
+ else if (cap->nchar == 'c')
+ {
+ if (diff_move_to(cap->cmdchar == ']' ? FORWARD : BACKWARD,
+ cap->count1) == FAIL)
+ clearopbeep(cap->oap);
+ }
+#endif
+
+ /* Not a valid cap->nchar. */
+ else
+ clearopbeep(cap->oap);
+}
+
+/*
+ * Handle Normal mode "%" command.
+ */
+ static void
+nv_percent(cap)
+ cmdarg_T *cap;
+{
+ pos_T *pos;
+#ifdef FEAT_FOLDING
+ linenr_T lnum = curwin->w_cursor.lnum;
+#endif
+
+ cap->oap->inclusive = TRUE;
+ if (cap->count0) /* {cnt}% : goto {cnt} percentage in file */
+ {
+ if (cap->count0 > 100)
+ clearopbeep(cap->oap);
+ else
+ {
+ cap->oap->motion_type = MLINE;
+ setpcmark();
+ /* Round up, so CTRL-G will give same value. Watch out for a
+ * large line count, the line number must not go negative! */
+ if (curbuf->b_ml.ml_line_count > 1000000)
+ curwin->w_cursor.lnum = (curbuf->b_ml.ml_line_count + 99L)
+ / 100L * cap->count0;
+ else
+ curwin->w_cursor.lnum = (curbuf->b_ml.ml_line_count *
+ cap->count0 + 99L) / 100L;
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ beginline(BL_SOL | BL_FIX);
+ }
+ }
+ else /* "%" : go to matching paren */
+ {
+ cap->oap->motion_type = MCHAR;
+ cap->oap->use_reg_one = TRUE;
+ if ((pos = findmatch(cap->oap, NUL)) == NULL)
+ clearopbeep(cap->oap);
+ else
+ {
+ setpcmark();
+ curwin->w_cursor = *pos;
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_VISUAL
+ adjust_for_sel(cap);
+#endif
+ }
+ }
+#ifdef FEAT_FOLDING
+ if (cap->oap->op_type == OP_NOP
+ && lnum != curwin->w_cursor.lnum
+ && (fdo_flags & FDO_PERCENT)
+ && KeyTyped)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Handle "(" and ")" commands.
+ * cap->arg is BACKWARD for "(" and FORWARD for ")".
+ */
+ static void
+nv_brace(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->use_reg_one = TRUE;
+ if (cap->cmdchar == ')')
+ cap->oap->inclusive = FALSE;
+ else
+ cap->oap->inclusive = TRUE;
+ curwin->w_set_curswant = TRUE;
+
+ if (findsent(cap->arg, cap->count1) == FAIL)
+ clearopbeep(cap->oap);
+ else
+ {
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+}
+
+/*
+ * "m" command: Mark a position.
+ */
+ static void
+nv_mark(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearop(cap->oap))
+ {
+ if (setmark(cap->nchar) == FAIL)
+ clearopbeep(cap->oap);
+ }
+}
+
+/*
+ * "{" and "}" commands.
+ * cmd->arg is BACKWARD for "{" and FORWARD for "}".
+ */
+ static void
+nv_findpar(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ cap->oap->use_reg_one = TRUE;
+ curwin->w_set_curswant = TRUE;
+ if (!findpar(cap->oap, cap->arg, cap->count1, NUL, FALSE))
+ clearopbeep(cap->oap);
+ else
+ {
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_BLOCK) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+}
+
+/*
+ * "u" command: Undo or make lower case.
+ */
+ static void
+nv_undo(cap)
+ cmdarg_T *cap;
+{
+ if (cap->oap->op_type == OP_LOWER
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ )
+ {
+ /* translate "<Visual>u" to "<Visual>gu" and "guu" to "gugu" */
+ cap->cmdchar = 'g';
+ cap->nchar = 'u';
+ nv_operator(cap);
+ }
+ else
+ nv_kundo(cap);
+}
+
+/*
+ * <Undo> command.
+ */
+ static void
+nv_kundo(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ {
+ u_undo((int)cap->count1);
+ curwin->w_set_curswant = TRUE;
+ }
+}
+
+/*
+ * Handle the "r" command.
+ */
+ static void
+nv_replace(cap)
+ cmdarg_T *cap;
+{
+ char_u *ptr;
+ int had_ctrl_v;
+ long n;
+
+ if (checkclearop(cap->oap))
+ return;
+
+ /* get another character */
+ if (cap->nchar == Ctrl_V)
+ {
+ had_ctrl_v = Ctrl_V;
+ cap->nchar = get_literal();
+ /* Don't redo a multibyte character with CTRL-V. */
+ if (cap->nchar > DEL)
+ had_ctrl_v = NUL;
+ }
+ else
+ had_ctrl_v = NUL;
+
+#ifdef FEAT_VISUAL
+ /* Visual mode "r" */
+ if (VIsual_active)
+ {
+ nv_operator(cap);
+ return;
+ }
+#endif
+
+#ifdef FEAT_VIRTUALEDIT
+ /* Break tabs, etc. */
+ if (virtual_active())
+ {
+ if (u_save_cursor() == FAIL)
+ return;
+ if (gchar_cursor() == NUL)
+ {
+ /* Add extra space and put the cursor on the first one. */
+ coladvance_force((colnr_T)(getviscol() + cap->count1));
+ curwin->w_cursor.col -= cap->count1;
+ }
+ else if (gchar_cursor() == TAB)
+ coladvance_force(getviscol());
+ }
+#endif
+
+ /*
+ * Check for a special key or not enough characters to replace.
+ */
+ ptr = ml_get_cursor();
+ if (IS_SPECIAL(cap->nchar) || STRLEN(ptr) < (unsigned)cap->count1
+#ifdef FEAT_MBYTE
+ || (has_mbyte && mb_charlen(ptr) < cap->count1)
+#endif
+ )
+ {
+ clearopbeep(cap->oap);
+ return;
+ }
+
+ /*
+ * Replacing with a TAB is done by edit() when it is complicated because
+ * 'expandtab' or 'smarttab' is set. CTRL-V TAB inserts a literal TAB.
+ * Other characters are done below to avoid problems with things like
+ * CTRL-V 048 (for edit() this would be R CTRL-V 0 ESC).
+ */
+ if (had_ctrl_v != Ctrl_V && cap->nchar == '\t' && (curbuf->b_p_et || p_sta))
+ {
+ stuffnumReadbuff(cap->count1);
+ stuffcharReadbuff('R');
+ stuffcharReadbuff('\t');
+ stuffcharReadbuff(ESC);
+ return;
+ }
+
+ /* save line for undo */
+ if (u_save_cursor() == FAIL)
+ return;
+
+ if (had_ctrl_v != Ctrl_V && (cap->nchar == '\r' || cap->nchar == '\n'))
+ {
+ /*
+ * Replace character(s) by a single newline.
+ * Strange vi behaviour: Only one newline is inserted.
+ * Delete the characters here.
+ * Insert the newline with an insert command, takes care of
+ * autoindent. The insert command depends on being on the last
+ * character of a line or not.
+ */
+#ifdef FEAT_MBYTE
+ (void)del_chars(cap->count1, FALSE); /* delete the characters */
+#else
+ (void)del_bytes(cap->count1, FALSE); /* delete the characters */
+#endif
+ stuffcharReadbuff('\r');
+ stuffcharReadbuff(ESC);
+
+ /* Give 'r' to edit(), to get the redo command right. */
+ invoke_edit(cap, TRUE, 'r', FALSE);
+ }
+ else
+ {
+ prep_redo(cap->oap->regname, cap->count1,
+ NUL, 'r', NUL, had_ctrl_v, cap->nchar);
+
+ curbuf->b_op_start = curwin->w_cursor;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int old_State = State;
+
+ if (cap->ncharC1 != 0)
+ AppendCharToRedobuff(cap->ncharC1);
+ if (cap->ncharC2 != 0)
+ AppendCharToRedobuff(cap->ncharC2);
+
+ /* This is slow, but it handles replacing a single-byte with a
+ * multi-byte and the other way around. Also handles adding
+ * composing characters for utf-8. */
+ for (n = cap->count1; n > 0; --n)
+ {
+ State = REPLACE;
+ ins_char(cap->nchar);
+ State = old_State;
+ if (cap->ncharC1 != 0)
+ ins_char(cap->ncharC1);
+ if (cap->ncharC2 != 0)
+ ins_char(cap->ncharC2);
+ }
+ }
+ else
+#endif
+ {
+ /*
+ * Replace the characters within one line.
+ */
+ for (n = cap->count1; n > 0; --n)
+ {
+ /*
+ * Get ptr again, because u_save and/or showmatch() will have
+ * released the line. At the same time we let know that the
+ * line will be changed.
+ */
+ ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
+ ptr[curwin->w_cursor.col] = cap->nchar;
+ if (p_sm && msg_silent == 0)
+ showmatch(cap->nchar);
+ ++curwin->w_cursor.col;
+ }
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ colnr_T start = (colnr_T)(curwin->w_cursor.col - cap->count1);
+
+ netbeans_inserted(curbuf, curwin->w_cursor.lnum, start,
+ (int)cap->count1, &ptr[start], (int)cap->count1);
+ }
+#endif
+
+ /* mark the buffer as changed and prepare for displaying */
+ changed_bytes(curwin->w_cursor.lnum,
+ (colnr_T)(curwin->w_cursor.col - cap->count1));
+ }
+ --curwin->w_cursor.col; /* cursor on the last replaced char */
+#ifdef FEAT_MBYTE
+ /* if the character on the left of the current cursor is a multi-byte
+ * character, move two characters left */
+ if (has_mbyte)
+ mb_adjust_cursor();
+#endif
+ curbuf->b_op_end = curwin->w_cursor;
+ curwin->w_set_curswant = TRUE;
+ set_last_insert(cap->nchar);
+ }
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * 'o': Exchange start and end of Visual area.
+ * 'O': same, but in block mode exchange left and right corners.
+ */
+ static void
+v_swap_corners(cmdchar)
+ int cmdchar;
+{
+ pos_T old_cursor;
+ colnr_T left, right;
+
+ if (cmdchar == 'O' && VIsual_mode == Ctrl_V)
+ {
+ old_cursor = curwin->w_cursor;
+ getvcols(curwin, &old_cursor, &VIsual, &left, &right);
+ curwin->w_cursor.lnum = VIsual.lnum;
+ coladvance(left);
+ VIsual = curwin->w_cursor;
+
+ curwin->w_cursor.lnum = old_cursor.lnum;
+ curwin->w_curswant = right;
+ /* 'selection "exclusive" and cursor at right-bottom corner: move it
+ * right one column */
+ if (old_cursor.lnum >= VIsual.lnum && *p_sel == 'e')
+ ++curwin->w_curswant;
+ coladvance(curwin->w_curswant);
+ if (curwin->w_cursor.col == old_cursor.col
+#ifdef FEAT_VIRTUALEDIT
+ && (!virtual_active()
+ || curwin->w_cursor.coladd == old_cursor.coladd)
+#endif
+ )
+ {
+ curwin->w_cursor.lnum = VIsual.lnum;
+ if (old_cursor.lnum <= VIsual.lnum && *p_sel == 'e')
+ ++right;
+ coladvance(right);
+ VIsual = curwin->w_cursor;
+
+ curwin->w_cursor.lnum = old_cursor.lnum;
+ coladvance(left);
+ curwin->w_curswant = left;
+ }
+ }
+ else
+ {
+ old_cursor = curwin->w_cursor;
+ curwin->w_cursor = VIsual;
+ VIsual = old_cursor;
+ curwin->w_set_curswant = TRUE;
+ }
+}
+#endif /* FEAT_VISUAL */
+
+/*
+ * "R" (cap->arg is FALSE) and "gR" (cap->arg is TRUE).
+ */
+ static void
+nv_Replace(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active) /* "R" is replace lines */
+ {
+ cap->cmdchar = 'c';
+ cap->nchar = NUL;
+ VIsual_mode = 'V';
+ nv_operator(cap);
+ }
+ else
+#endif
+ if (!checkclearopq(cap->oap))
+ {
+ if (!curbuf->b_p_ma)
+ EMSG(_(e_modifiable));
+ else
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ coladvance(getviscol());
+#endif
+ invoke_edit(cap, FALSE, cap->arg ? 'V' : 'R', FALSE);
+ }
+ }
+}
+
+#ifdef FEAT_VREPLACE
+/*
+ * "gr".
+ */
+ static void
+nv_vreplace(cap)
+ cmdarg_T *cap;
+{
+# ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ cap->cmdchar = 'r';
+ cap->nchar = cap->extra_char;
+ nv_replace(cap); /* Do same as "r" in Visual mode for now */
+ }
+ else
+# endif
+ if (!checkclearopq(cap->oap))
+ {
+ if (!curbuf->b_p_ma)
+ EMSG(_(e_modifiable));
+ else
+ {
+ if (cap->extra_char == Ctrl_V) /* get another character */
+ cap->extra_char = get_literal();
+ stuffcharReadbuff(cap->extra_char);
+ stuffcharReadbuff(ESC);
+# ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ coladvance(getviscol());
+# endif
+ invoke_edit(cap, TRUE, 'v', FALSE);
+ }
+ }
+}
+#endif
+
+/*
+ * Swap case for "~" command, when it does not work like an operator.
+ */
+ static void
+n_swapchar(cap)
+ cmdarg_T *cap;
+{
+ long n;
+ pos_T startpos;
+ int did_change = 0;
+#ifdef FEAT_NETBEANS_INTG
+ pos_T pos;
+ char_u *ptr;
+ int count;
+#endif
+
+ if (checkclearopq(cap->oap))
+ return;
+
+ if (lineempty(curwin->w_cursor.lnum) && vim_strchr(p_ww, '~') == NULL)
+ {
+ clearopbeep(cap->oap);
+ return;
+ }
+
+ prep_redo_cmd(cap);
+
+ if (u_save_cursor() == FAIL)
+ return;
+
+ startpos = curwin->w_cursor;
+#ifdef FEAT_NETBEANS_INTG
+ pos = startpos;
+#endif
+ for (n = cap->count1; n > 0; --n)
+ {
+ did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor);
+ inc_cursor();
+ if (gchar_cursor() == NUL)
+ {
+ if (vim_strchr(p_ww, '~') != NULL
+ && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ {
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ {
+ if (did_change)
+ {
+ ptr = ml_get(pos.lnum);
+ count = STRLEN(ptr) - pos.col;
+ netbeans_inserted(curbuf, pos.lnum, pos.col,
+ count, &ptr[pos.col], count);
+ }
+ pos.col = 0;
+ pos.lnum++;
+ }
+#endif
+ ++curwin->w_cursor.lnum;
+ curwin->w_cursor.col = 0;
+ if (n > 1)
+ {
+ if (u_savesub(curwin->w_cursor.lnum) == FAIL)
+ break;
+ u_clearline();
+ }
+ }
+ else
+ break;
+ }
+ }
+#ifdef FEAT_NETBEANS_INTG
+ if (did_change && usingNetbeans)
+ {
+ ptr = ml_get(pos.lnum);
+ count = curwin->w_cursor.col - pos.col;
+ netbeans_inserted(curbuf, pos.lnum, pos.col,
+ count, &ptr[pos.col], count);
+ }
+#endif
+
+
+ check_cursor();
+ curwin->w_set_curswant = TRUE;
+ if (did_change)
+ {
+ changed_lines(startpos.lnum, startpos.col, curwin->w_cursor.lnum + 1,
+ 0L);
+ curbuf->b_op_start = startpos;
+ curbuf->b_op_end = curwin->w_cursor;
+ if (curbuf->b_op_end.col > 0)
+ --curbuf->b_op_end.col;
+ }
+}
+
+/*
+ * Move cursor to mark.
+ */
+ static void
+nv_cursormark(cap, flag, pos)
+ cmdarg_T *cap;
+ int flag;
+ pos_T *pos;
+{
+ if (check_mark(pos) == FAIL)
+ clearop(cap->oap);
+ else
+ {
+ if (cap->cmdchar == '\''
+ || cap->cmdchar == '`'
+ || cap->cmdchar == '['
+ || cap->cmdchar == ']')
+ setpcmark();
+ curwin->w_cursor = *pos;
+ if (flag)
+ beginline(BL_WHITE | BL_FIX);
+ else
+ check_cursor();
+ }
+ cap->oap->motion_type = flag ? MLINE : MCHAR;
+ if (cap->cmdchar == '`')
+ cap->oap->use_reg_one = TRUE;
+ cap->oap->inclusive = FALSE; /* ignored if not MCHAR */
+ curwin->w_set_curswant = TRUE;
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * Handle commands that are operators in Visual mode.
+ */
+ static void
+v_visop(cap)
+ cmdarg_T *cap;
+{
+ static char_u trans[] = "YyDdCcxdXdAAIIrr";
+
+ /* Uppercase means linewise, except in block mode, then "D" deletes till
+ * the end of the line, and "C" replaces til EOL */
+ if (isupper(cap->cmdchar))
+ {
+ if (VIsual_mode != Ctrl_V)
+ VIsual_mode = 'V';
+ else if (cap->cmdchar == 'C' || cap->cmdchar == 'D')
+ curwin->w_curswant = MAXCOL;
+ }
+ cap->cmdchar = *(vim_strchr(trans, cap->cmdchar) + 1);
+ nv_operator(cap);
+}
+#endif
+
+/*
+ * "s" and "S" commands.
+ */
+ static void
+nv_subst(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active) /* "vs" and "vS" are the same as "vc" */
+ {
+ if (cap->cmdchar == 'S')
+ VIsual_mode = 'V';
+ cap->cmdchar = 'c';
+ nv_operator(cap);
+ }
+ else
+#endif
+ nv_optrans(cap);
+}
+
+/*
+ * Abbreviated commands.
+ */
+ static void
+nv_abbrev(cap)
+ cmdarg_T *cap;
+{
+ if (cap->cmdchar == K_DEL || cap->cmdchar == K_KDEL)
+ cap->cmdchar = 'x'; /* DEL key behaves like 'x' */
+
+#ifdef FEAT_VISUAL
+ /* in Visual mode these commands are operators */
+ if (VIsual_active)
+ v_visop(cap);
+ else
+#endif
+ nv_optrans(cap);
+}
+
+/*
+ * Translate a command into another command.
+ */
+ static void
+nv_optrans(cap)
+ cmdarg_T *cap;
+{
+ static char_u *(ar[8]) = {(char_u *)"dl", (char_u *)"dh",
+ (char_u *)"d$", (char_u *)"c$",
+ (char_u *)"cl", (char_u *)"cc",
+ (char_u *)"yy", (char_u *)":s\r"};
+ static char_u *str = (char_u *)"xXDCsSY&";
+
+ if (!checkclearopq(cap->oap))
+ {
+ if (cap->count0)
+ stuffnumReadbuff(cap->count0);
+ stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]);
+ }
+ cap->opcount = 0;
+}
+
+/*
+ * "'" and "`" commands. Also for "g'" and "g`".
+ * cap->arg is TRUE for "'" and "g'".
+ */
+ static void
+nv_gomark(cap)
+ cmdarg_T *cap;
+{
+ pos_T *pos;
+ int c;
+#ifdef FEAT_FOLDING
+ linenr_T lnum = curwin->w_cursor.lnum;
+ int old_KeyTyped = KeyTyped; /* getting file may reset it */
+#endif
+
+ if (cap->cmdchar == 'g')
+ c = cap->extra_char;
+ else
+ c = cap->nchar;
+ pos = getmark(c, (cap->oap->op_type == OP_NOP));
+ if (pos == (pos_T *)-1) /* jumped to other file */
+ {
+ if (cap->arg)
+ {
+ check_cursor_lnum();
+ beginline(BL_WHITE | BL_FIX);
+ }
+ else
+ check_cursor();
+ }
+ else
+ nv_cursormark(cap, cap->arg, pos);
+
+#ifdef FEAT_VIRTUALEDIT
+ /* May need to clear the coladd that a mark includes. */
+ if (!virtual_active())
+ curwin->w_cursor.coladd = 0;
+#endif
+#ifdef FEAT_FOLDING
+ if (cap->oap->op_type == OP_NOP
+ && (pos == (pos_T *)-1 || lnum != curwin->w_cursor.lnum)
+ && (fdo_flags & FDO_MARK)
+ && old_KeyTyped)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Handle CTRL-O, CTRL-I, "g;" and "g," commands.
+ */
+ static void
+nv_pcmark(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_JUMPLIST
+ pos_T *pos;
+# ifdef FEAT_FOLDING
+ linenr_T lnum = curwin->w_cursor.lnum;
+ int old_KeyTyped = KeyTyped; /* getting file may reset it */
+# endif
+
+ if (!checkclearopq(cap->oap))
+ {
+ if (cap->cmdchar == 'g')
+ pos = movechangelist((int)cap->count1);
+ else
+ pos = movemark((int)cap->count1);
+ if (pos == (pos_T *)-1) /* jump to other file */
+ {
+ curwin->w_set_curswant = TRUE;
+ check_cursor();
+ }
+ else if (pos != NULL) /* can jump */
+ nv_cursormark(cap, FALSE, pos);
+ else if (cap->cmdchar == 'g')
+ {
+ if (curbuf->b_changelistlen == 0)
+ EMSG(_("E664: changelist is empty"));
+ else if (cap->count1 < 0)
+ EMSG(_("E662: At start of changelist"));
+ else
+ EMSG(_("E663: At end of changelist"));
+ }
+ else
+ clearopbeep(cap->oap);
+# ifdef FEAT_FOLDING
+ if (cap->oap->op_type == OP_NOP
+ && (pos == (pos_T *)-1 || lnum != curwin->w_cursor.lnum)
+ && (fdo_flags & FDO_MARK)
+ && old_KeyTyped)
+ foldOpenCursor();
+# endif
+ }
+#else
+ clearopbeep(cap->oap);
+#endif
+}
+
+/*
+ * Handle '"' command.
+ */
+ static void
+nv_regname(cap)
+ cmdarg_T *cap;
+{
+ if (checkclearop(cap->oap))
+ return;
+#ifdef FEAT_EVAL
+ if (cap->nchar == '=')
+ cap->nchar = get_expr_register();
+#endif
+ if (cap->nchar != NUL && valid_yank_reg(cap->nchar, FALSE))
+ {
+ cap->oap->regname = cap->nchar;
+ cap->opcount = cap->count0; /* remember count before '"' */
+#ifdef FEAT_EVAL
+ set_reg_var(cap->oap->regname);
+#endif
+ }
+ else
+ clearopbeep(cap->oap);
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * Handle "v", "V" and "CTRL-V" commands.
+ * Also for "gh", "gH" and "g^H" commands: Always start Select mode, cap->arg
+ * is TRUE.
+ */
+ static void
+nv_visual(cap)
+ cmdarg_T *cap;
+{
+ /* 'v', 'V' and CTRL-V can be used while an operator is pending to make it
+ * characterwise, linewise, or blockwise. */
+ if (cap->oap->op_type != OP_NOP)
+ {
+ cap->oap->motion_force = cap->cmdchar;
+ finish_op = FALSE; /* operator doesn't finish now but later */
+ return;
+ }
+
+ VIsual_select = cap->arg;
+ if (VIsual_active) /* change Visual mode */
+ {
+ if (VIsual_mode == cap->cmdchar) /* stop visual mode */
+ end_visual_mode();
+ else /* toggle char/block mode */
+ { /* or char/line mode */
+ VIsual_mode = cap->cmdchar;
+ showmode();
+ }
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ }
+ else /* start Visual mode */
+ {
+ check_visual_highlight();
+ if (cap->count0) /* use previously selected part */
+ {
+ if (resel_VIsual_mode == NUL) /* there is none */
+ {
+ beep_flush();
+ return;
+ }
+ VIsual = curwin->w_cursor;
+
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+ if (!cap->arg)
+ /* start Select mode when 'selectmode' contains "cmd" */
+ may_start_select('c');
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ if (p_smd)
+ redraw_cmdline = TRUE; /* show visual mode later */
+ /*
+ * For V and ^V, we multiply the number of lines even if there
+ * was only one -- webb
+ */
+ if (resel_VIsual_mode != 'v' || resel_VIsual_line_count > 1)
+ {
+ curwin->w_cursor.lnum +=
+ resel_VIsual_line_count * cap->count0 - 1;
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ }
+ VIsual_mode = resel_VIsual_mode;
+ if (VIsual_mode == 'v')
+ {
+ if (resel_VIsual_line_count <= 1)
+ curwin->w_cursor.col += resel_VIsual_col * cap->count0 - 1;
+ else
+ curwin->w_cursor.col = resel_VIsual_col;
+ check_cursor_col();
+ }
+ if (resel_VIsual_col == MAXCOL)
+ {
+ curwin->w_curswant = MAXCOL;
+ coladvance((colnr_T)MAXCOL);
+ }
+ else if (VIsual_mode == Ctrl_V)
+ {
+ validate_virtcol();
+ curwin->w_curswant = curwin->w_virtcol
+ + resel_VIsual_col * cap->count0 - 1;
+ coladvance(curwin->w_curswant);
+ }
+ else
+ curwin->w_set_curswant = TRUE;
+ redraw_curbuf_later(INVERTED); /* show the inversion */
+ }
+ else
+ {
+ if (!cap->arg)
+ /* start Select mode when 'selectmode' contains "cmd" */
+ may_start_select('c');
+ n_start_visual_mode(cap->cmdchar);
+ }
+ }
+}
+
+/*
+ * Start selection for Shift-movement keys.
+ */
+ void
+start_selection()
+{
+ /* if 'selectmode' contains "key", start Select mode */
+ may_start_select('k');
+ n_start_visual_mode('v');
+}
+
+/*
+ * Start Select mode, if "c" is in 'selectmode' and not in a mapping or menu.
+ */
+ void
+may_start_select(c)
+ int c;
+{
+ VIsual_select = (stuff_empty() && typebuf_typed()
+ && (vim_strchr(p_slm, c) != NULL));
+}
+
+/*
+ * Start Visual mode "c".
+ * Should set VIsual_select before calling this.
+ */
+ static void
+n_start_visual_mode(c)
+ int c;
+{
+ VIsual_mode = c;
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ /* Corner case: the 0 position in a tab may change when going into
+ * virtualedit. Recalculate curwin->w_cursor to avoid bad hilighting.
+ */
+ if (c == Ctrl_V && (ve_flags & VE_BLOCK) && gchar_cursor() == TAB)
+ coladvance(curwin->w_virtcol);
+#endif
+ VIsual = curwin->w_cursor;
+
+#ifdef FEAT_FOLDING
+ foldAdjustVisual();
+#endif
+
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+ if (p_smd)
+ redraw_cmdline = TRUE; /* show visual mode later */
+#ifdef FEAT_CLIPBOARD
+ /* Make sure the clipboard gets updated. Needed because start and
+ * end may still be the same, and the selection needs to be owned */
+ clip_star.vmode = NUL;
+#endif
+
+ /* Only need to redraw this line, unless still need to redraw an old
+ * Visual area (when 'lazyredraw' is set). */
+ if (curwin->w_redr_type < INVERTED)
+ {
+ curwin->w_old_cursor_lnum = curwin->w_cursor.lnum;
+ curwin->w_old_visual_lnum = curwin->w_cursor.lnum;
+ }
+}
+
+#endif /* FEAT_VISUAL */
+
+/*
+ * CTRL-W: Window commands
+ */
+ static void
+nv_window(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_WINDOWS
+ if (!checkclearop(cap->oap))
+ do_window(cap->nchar, cap->count0, NUL); /* everything is in window.c */
+#else
+ (void)checkclearop(cap->oap);
+#endif
+}
+
+/*
+ * CTRL-Z: Suspend
+ */
+ static void
+nv_suspend(cap)
+ cmdarg_T *cap;
+{
+ clearop(cap->oap);
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ end_visual_mode(); /* stop Visual mode */
+#endif
+ do_cmdline_cmd((char_u *)"st");
+}
+
+/*
+ * Commands starting with "g".
+ */
+ static void
+nv_g_cmd(cap)
+ cmdarg_T *cap;
+{
+ oparg_T *oap = cap->oap;
+#ifdef FEAT_VISUAL
+ pos_T tpos;
+#endif
+ int i;
+ int flag = FALSE;
+
+ switch (cap->nchar)
+ {
+#ifdef MEM_PROFILE
+ /*
+ * "g^A": dump log of used memory.
+ */
+ case Ctrl_A:
+ vim_mem_profile_dump();
+ break;
+#endif
+
+#ifdef FEAT_VREPLACE
+ /*
+ * "gR": Enter virtual replace mode.
+ */
+ case 'R':
+ cap->arg = TRUE;
+ nv_Replace(cap);
+ break;
+
+ case 'r':
+ nv_vreplace(cap);
+ break;
+#endif
+
+ case '&':
+ do_cmdline_cmd((char_u *)"%s//~/&");
+ break;
+
+#ifdef FEAT_VISUAL
+ /*
+ * "gv": Reselect the previous Visual area. If Visual already active,
+ * exchange previous and current Visual area.
+ */
+ case 'v':
+ if (checkclearop(oap))
+ break;
+
+ if ( curbuf->b_visual_start.lnum == 0
+ || curbuf->b_visual_start.lnum > curbuf->b_ml.ml_line_count
+ || curbuf->b_visual_end.lnum == 0)
+ beep_flush();
+ else
+ {
+ /* set w_cursor to the start of the Visual area, tpos to the end */
+ if (VIsual_active)
+ {
+ i = VIsual_mode;
+ VIsual_mode = curbuf->b_visual_mode;
+ curbuf->b_visual_mode = i;
+# ifdef FEAT_EVAL
+ curbuf->b_visual_mode_eval = i;
+# endif
+ i = curwin->w_curswant;
+ curwin->w_curswant = curbuf->b_visual_curswant;
+ curbuf->b_visual_curswant = i;
+
+ tpos = curbuf->b_visual_end;
+ curbuf->b_visual_end = curwin->w_cursor;
+ curwin->w_cursor = curbuf->b_visual_start;
+ curbuf->b_visual_start = VIsual;
+ }
+ else
+ {
+ VIsual_mode = curbuf->b_visual_mode;
+ curwin->w_curswant = curbuf->b_visual_curswant;
+ tpos = curbuf->b_visual_end;
+ curwin->w_cursor = curbuf->b_visual_start;
+ }
+
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+
+ /* Set Visual to the start and w_cursor to the end of the Visual
+ * area. Make sure they are on an existing character. */
+ check_cursor();
+ VIsual = curwin->w_cursor;
+ curwin->w_cursor = tpos;
+ check_cursor();
+ update_topline();
+ /*
+ * When called from normal "g" command: start Select mode when
+ * 'selectmode' contains "cmd". When called for K_SELECT, always
+ * start Select mode.
+ */
+ if (cap->arg)
+ VIsual_select = TRUE;
+ else
+ may_start_select('c');
+#ifdef FEAT_MOUSE
+ setmouse();
+#endif
+#ifdef FEAT_CLIPBOARD
+ /* Make sure the clipboard gets updated. Needed because start and
+ * end are still the same, and the selection needs to be owned */
+ clip_star.vmode = NUL;
+#endif
+ redraw_curbuf_later(INVERTED);
+ showmode();
+ }
+ break;
+ /*
+ * "gV": Don't reselect the previous Visual area after a Select mode
+ * mapping of menu.
+ */
+ case 'V':
+ VIsual_reselect = FALSE;
+ break;
+
+ /*
+ * "gh": start Select mode.
+ * "gH": start Select line mode.
+ * "g^H": start Select block mode.
+ */
+ case K_BS:
+ cap->nchar = Ctrl_H;
+ /* FALLTHROUGH */
+ case 'h':
+ case 'H':
+ case Ctrl_H:
+# ifdef EBCDIC
+ /* EBCDIC: 'v'-'h' != '^v'-'^h' */
+ if (cap->nchar == Ctrl_H)
+ cap->cmdchar = Ctrl_V;
+ else
+# endif
+ cap->cmdchar = cap->nchar + ('v' - 'h');
+ cap->arg = TRUE;
+ nv_visual(cap);
+ break;
+#endif /* FEAT_VISUAL */
+
+ /*
+ * "gj" and "gk" two new funny movement keys -- up and down
+ * movement based on *screen* line rather than *file* line.
+ */
+ case 'j':
+ case K_DOWN:
+ /* with 'nowrap' it works just like the normal "j" command; also when
+ * in a closed fold */
+ if (!curwin->w_p_wrap
+#ifdef FEAT_FOLDING
+ || hasFolding(curwin->w_cursor.lnum, NULL, NULL)
+#endif
+ )
+ {
+ oap->motion_type = MLINE;
+ i = cursor_down(cap->count1, oap->op_type == OP_NOP);
+ }
+ else
+ i = nv_screengo(oap, FORWARD, cap->count1);
+ if (i == FAIL)
+ clearopbeep(oap);
+ break;
+
+ case 'k':
+ case K_UP:
+ /* with 'nowrap' it works just like the normal "k" command; also when
+ * in a closed fold */
+ if (!curwin->w_p_wrap
+#ifdef FEAT_FOLDING
+ || hasFolding(curwin->w_cursor.lnum, NULL, NULL)
+#endif
+ )
+ {
+ oap->motion_type = MLINE;
+ i = cursor_up(cap->count1, oap->op_type == OP_NOP);
+ }
+ else
+ i = nv_screengo(oap, BACKWARD, cap->count1);
+ if (i == FAIL)
+ clearopbeep(oap);
+ break;
+
+ /*
+ * "gJ": join two lines without inserting a space.
+ */
+ case 'J':
+ nv_join(cap);
+ break;
+
+ /*
+ * "g0", "g^" and "g$": Like "0", "^" and "$" but for screen lines.
+ * "gm": middle of "g0" and "g$".
+ */
+ case '^':
+ flag = TRUE;
+ /* FALLTHROUGH */
+
+ case '0':
+ case 'm':
+ case K_HOME:
+ case K_KHOME:
+ case K_XHOME:
+ oap->motion_type = MCHAR;
+ oap->inclusive = FALSE;
+ if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ int width1 = W_WIDTH(curwin) - curwin_col_off();
+ int width2 = width1 + curwin_col_off2();
+
+ validate_virtcol();
+ i = 0;
+ if (curwin->w_virtcol >= (colnr_T)width1 && width2 > 0)
+ i = (curwin->w_virtcol - width1) / width2 * width2 + width1;
+ }
+ else
+ i = curwin->w_leftcol;
+ /* Go to the middle of the screen line. When 'number' is on and lines
+ * are wrapping the middle can be more to the left.*/
+ if (cap->nchar == 'm')
+ i += (W_WIDTH(curwin) - curwin_col_off()
+ + ((curwin->w_p_wrap && i > 0)
+ ? curwin_col_off2() : 0)) / 2;
+ coladvance((colnr_T)i);
+ if (flag)
+ {
+ do
+ i = gchar_cursor();
+ while (vim_iswhite(i) && oneright() == OK);
+ }
+ curwin->w_set_curswant = TRUE;
+ break;
+
+ case '_':
+ /* "g_": to the last non-blank character in the line or <count> lines
+ * downward. */
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = TRUE;
+ curwin->w_curswant = MAXCOL;
+ if (cursor_down((long)(cap->count1 - 1),
+ cap->oap->op_type == OP_NOP) == FAIL)
+ clearopbeep(cap->oap);
+ else
+ {
+ char_u *ptr = ml_get_curline();
+
+ /* In Visual mode we may end up after the line. */
+ if (curwin->w_cursor.col > 0 && ptr[curwin->w_cursor.col] == NUL)
+ --curwin->w_cursor.col;
+
+ /* Decrease the cursor column until it's on a non-blank. */
+ while (curwin->w_cursor.col > 0
+ && vim_iswhite(ptr[curwin->w_cursor.col]))
+ --curwin->w_cursor.col;
+ curwin->w_set_curswant = TRUE;
+ }
+ break;
+
+ case '$':
+ case K_END:
+ case K_KEND:
+ case K_XEND:
+ {
+ int col_off = curwin_col_off();
+
+ oap->motion_type = MCHAR;
+ oap->inclusive = TRUE;
+ if (curwin->w_p_wrap
+#ifdef FEAT_VERTSPLIT
+ && curwin->w_width != 0
+#endif
+ )
+ {
+ curwin->w_curswant = MAXCOL; /* so we stay at the end */
+ if (cap->count1 == 1)
+ {
+ int width1 = W_WIDTH(curwin) - col_off;
+ int width2 = width1 + curwin_col_off2();
+
+ validate_virtcol();
+ i = width1 - 1;
+ if (curwin->w_virtcol >= (colnr_T)width1)
+ i += ((curwin->w_virtcol - width1) / width2 + 1)
+ * width2;
+ coladvance((colnr_T)i);
+#if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
+ if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
+ {
+ /*
+ * Check for landing on a character that got split at
+ * the end of the line. We do not want to advance to
+ * the next screen line.
+ */
+ validate_virtcol();
+ if (curwin->w_virtcol > (colnr_T)i)
+ --curwin->w_cursor.col;
+ }
+#endif
+ }
+ else if (nv_screengo(oap, FORWARD, cap->count1 - 1) == FAIL)
+ clearopbeep(oap);
+ }
+ else
+ {
+ i = curwin->w_leftcol + W_WIDTH(curwin) - col_off - 1;
+ coladvance((colnr_T)i);
+ curwin->w_set_curswant = TRUE;
+ }
+ }
+ break;
+
+ /*
+ * "g*" and "g#", like "*" and "#" but without using "\<" and "\>"
+ */
+ case '*':
+ case '#':
+#if POUND != '#'
+ case POUND: /* pound sign (sometimes equal to '#') */
+#endif
+ case Ctrl_RSB: /* :tag or :tselect for current identifier */
+ case ']': /* :tselect for current identifier */
+ nv_ident(cap);
+ break;
+
+ /*
+ * ge and gE: go back to end of word
+ */
+ case 'e':
+ case 'E':
+ oap->motion_type = MCHAR;
+ curwin->w_set_curswant = TRUE;
+ oap->inclusive = TRUE;
+ if (bckend_word(cap->count1, cap->nchar == 'E', FALSE) == FAIL)
+ clearopbeep(oap);
+ break;
+
+ /*
+ * "g CTRL-G": display info about cursor position
+ */
+ case Ctrl_G:
+ cursor_pos_info();
+ break;
+
+ /*
+ * "gi": start Insert at the last position.
+ */
+ case 'i':
+ if (curbuf->b_last_insert.lnum != 0)
+ {
+ curwin->w_cursor = curbuf->b_last_insert;
+ check_cursor_lnum();
+ i = (int)STRLEN(ml_get_curline());
+ if (curwin->w_cursor.col > (colnr_T)i)
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active())
+ curwin->w_cursor.coladd += curwin->w_cursor.col - i;
+#endif
+ curwin->w_cursor.col = i;
+ }
+ }
+ cap->cmdchar = 'i';
+ nv_edit(cap);
+ break;
+
+ /*
+ * "gI": Start insert in column 1.
+ */
+ case 'I':
+ beginline(0);
+ if (!checkclearopq(oap))
+ invoke_edit(cap, FALSE, 'g', FALSE);
+ break;
+
+#ifdef FEAT_SEARCHPATH
+ /*
+ * "gf": goto file, edit file under cursor
+ * "]f" and "[f": can also be used.
+ */
+ case 'f':
+ nv_gotofile(cap);
+ break;
+#endif
+
+ /* "g'm" and "g`m": jump to mark without setting pcmark */
+ case '\'':
+ cap->arg = TRUE;
+ /*FALLTHROUGH*/
+ case '`':
+ nv_gomark(cap);
+ break;
+
+ /*
+ * "gs": Goto sleep.
+ */
+ case 's':
+ do_sleep(cap->count1 * 1000L);
+ break;
+
+ /*
+ * "ga": Display the ascii value of the character under the
+ * cursor. It is displayed in decimal, hex, and octal. -- webb
+ */
+ case 'a':
+ do_ascii(NULL);
+ break;
+
+#ifdef FEAT_MBYTE
+ /*
+ * "g8": Display the bytes used for the UTF-8 character under the
+ * cursor. It is displayed in hex.
+ */
+ case '8':
+ show_utf8();
+ break;
+#endif
+
+ /*
+ * "gg": Goto the first line in file. With a count it goes to
+ * that line number like for "G". -- webb
+ */
+ case 'g':
+ cap->arg = FALSE;
+ nv_goto(cap);
+ break;
+
+ /*
+ * Two-character operators:
+ * "gq" Format text
+ * "gw" Format text and keep cursor position
+ * "g~" Toggle the case of the text.
+ * "gu" Change text to lower case.
+ * "gU" Change text to upper case.
+ * "g?" rot13 encoding
+ */
+ case 'q':
+ case 'w':
+ oap->cursor_start = curwin->w_cursor;
+ /*FALLTHROUGH*/
+ case '~':
+ case 'u':
+ case 'U':
+ case '?':
+ nv_operator(cap);
+ break;
+
+ /*
+ * "gd": Find first occurence of pattern under the cursor in the
+ * current function
+ * "gD": idem, but in the current file.
+ */
+ case 'd':
+ case 'D':
+ nv_gd(oap, cap->nchar);
+ break;
+
+#ifdef FEAT_MOUSE
+ /*
+ * g<*Mouse> : <C-*mouse>
+ */
+ case K_MIDDLEMOUSE:
+ case K_MIDDLEDRAG:
+ case K_MIDDLERELEASE:
+ case K_LEFTMOUSE:
+ case K_LEFTDRAG:
+ case K_LEFTRELEASE:
+ case K_RIGHTMOUSE:
+ case K_RIGHTDRAG:
+ case K_RIGHTRELEASE:
+ case K_X1MOUSE:
+ case K_X1DRAG:
+ case K_X1RELEASE:
+ case K_X2MOUSE:
+ case K_X2DRAG:
+ case K_X2RELEASE:
+ mod_mask = MOD_MASK_CTRL;
+ (void)do_mouse(oap, cap->nchar, BACKWARD, cap->count1, 0);
+ break;
+#endif
+
+ case K_IGNORE:
+ break;
+
+ /*
+ * "gP" and "gp": same as "P" and "p" but leave cursor just after new text
+ */
+ case 'p':
+ case 'P':
+ nv_put(cap);
+ break;
+
+#ifdef FEAT_BYTEOFF
+ /* "go": goto byte count from start of buffer */
+ case 'o':
+ goto_byte(cap->count0);
+ break;
+#endif
+
+ /* "gQ": improved Ex mode */
+ case 'Q':
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ clearopbeep(cap->oap);
+ break;
+ }
+#endif
+ if (!checkclearopq(oap))
+ do_exmode(TRUE);
+ break;
+
+#ifdef FEAT_JUMPLIST
+ case ',':
+ nv_pcmark(cap);
+ break;
+
+ case ';':
+ cap->count1 = -cap->count1;
+ nv_pcmark(cap);
+ break;
+#endif
+
+ default:
+ clearopbeep(oap);
+ break;
+ }
+}
+
+/*
+ * Handle "o" and "O" commands.
+ */
+ static void
+n_opencmd(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ {
+#ifdef FEAT_FOLDING
+ if (cap->cmdchar == 'O')
+ /* Open above the first line of a folded sequence of lines */
+ (void)hasFolding(curwin->w_cursor.lnum,
+ &curwin->w_cursor.lnum, NULL);
+ else
+ /* Open below the last line of a folded sequence of lines */
+ (void)hasFolding(curwin->w_cursor.lnum,
+ NULL, &curwin->w_cursor.lnum);
+#endif
+ if (u_save((linenr_T)(curwin->w_cursor.lnum -
+ (cap->cmdchar == 'O' ? 1 : 0)),
+ (linenr_T)(curwin->w_cursor.lnum +
+ (cap->cmdchar == 'o' ? 1 : 0))
+ ) == OK
+ && open_line(cap->cmdchar == 'O' ? BACKWARD : FORWARD,
+#ifdef FEAT_COMMENTS
+ has_format_option(FO_OPEN_COMS) ? OPENLINE_DO_COM :
+#endif
+ 0, 0))
+ {
+ invoke_edit(cap, FALSE, cap->cmdchar, TRUE);
+ }
+ }
+}
+
+/*
+ * "." command: redo last change.
+ */
+ static void
+nv_dot(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ {
+ /*
+ * If "restart_edit" is TRUE, the last but one command is repeated
+ * instead of the last command (inserting text). This is used for
+ * CTRL-O <.> in insert mode.
+ */
+ if (start_redo(cap->count0, restart_edit != 0 && !arrow_used) == FAIL)
+ clearopbeep(cap->oap);
+ }
+}
+
+/*
+ * CTRL-R: undo undo
+ */
+ static void
+nv_redo(cap)
+ cmdarg_T *cap;
+{
+ if (!checkclearopq(cap->oap))
+ {
+ u_redo((int)cap->count1);
+ curwin->w_set_curswant = TRUE;
+ }
+}
+
+/*
+ * Handle "U" command.
+ */
+ static void
+nv_Undo(cap)
+ cmdarg_T *cap;
+{
+ /* In Visual mode and typing "gUU" triggers an operator */
+ if (cap->oap->op_type == OP_UPPER
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ )
+ {
+ /* translate "gUU" to "gUgU" */
+ cap->cmdchar = 'g';
+ cap->nchar = 'U';
+ nv_operator(cap);
+ }
+ else if (!checkclearopq(cap->oap))
+ {
+ u_undoline();
+ curwin->w_set_curswant = TRUE;
+ }
+}
+
+/*
+ * '~' command: If tilde is not an operator and Visual is off: swap case of a
+ * single character.
+ */
+ static void
+nv_tilde(cap)
+ cmdarg_T *cap;
+{
+ if (!p_to
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ && cap->oap->op_type != OP_TILDE)
+ n_swapchar(cap);
+ else
+ nv_operator(cap);
+}
+
+/*
+ * Handle an operator command.
+ * The actual work is done by do_pending_operator().
+ */
+ static void
+nv_operator(cap)
+ cmdarg_T *cap;
+{
+ int op_type;
+
+ op_type = get_op_type(cap->cmdchar, cap->nchar);
+
+ if (op_type == cap->oap->op_type) /* double operator works on lines */
+ nv_lineop(cap);
+ else if (!checkclearop(cap->oap))
+ {
+ cap->oap->start = curwin->w_cursor;
+ cap->oap->op_type = op_type;
+ }
+}
+
+/*
+ * Handle linewise operator "dd", "yy", etc.
+ *
+ * "_" is is a strange motion command that helps make operators more logical.
+ * It is actually implemented, but not documented in the real Vi. This motion
+ * command actually refers to "the current line". Commands like "dd" and "yy"
+ * are really an alternate form of "d_" and "y_". It does accept a count, so
+ * "d3_" works to delete 3 lines.
+ */
+ static void
+nv_lineop(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MLINE;
+ if (cursor_down(cap->count1 - 1L, cap->oap->op_type == OP_NOP) == FAIL)
+ clearopbeep(cap->oap);
+ else if ( cap->oap->op_type == OP_DELETE
+ || cap->oap->op_type == OP_LSHIFT
+ || cap->oap->op_type == OP_RSHIFT)
+ beginline(BL_SOL | BL_FIX);
+ else if (cap->oap->op_type != OP_YANK) /* 'Y' does not move cursor */
+ beginline(BL_WHITE | BL_FIX);
+}
+
+/*
+ * <Home> command.
+ */
+ static void
+nv_home(cap)
+ cmdarg_T *cap;
+{
+ cap->count0 = 1;
+ nv_pipe(cap);
+}
+
+/*
+ * "|" command.
+ */
+ static void
+nv_pipe(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ beginline(0);
+ if (cap->count0 > 0)
+ {
+ coladvance((colnr_T)(cap->count0 - 1));
+ curwin->w_curswant = (colnr_T)(cap->count0 - 1);
+ }
+ else
+ curwin->w_curswant = 0;
+ /* keep curswant at the column where we wanted to go, not where
+ we ended; differs if line is too short */
+ curwin->w_set_curswant = FALSE;
+}
+
+/*
+ * Handle back-word command "b" and "B".
+ * cap->arg is 1 for "B"
+ */
+ static void
+nv_bck_word(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ curwin->w_set_curswant = TRUE;
+ if (bck_word(cap->count1, cap->arg, FALSE) == FAIL)
+ clearopbeep(cap->oap);
+#ifdef FEAT_FOLDING
+ else if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * Handle word motion commands "e", "E", "w" and "W".
+ * cap->arg is TRUE for "E" and "W".
+ */
+ static void
+nv_wordcmd(cap)
+ cmdarg_T *cap;
+{
+ int n;
+ int word_end;
+ int flag = FALSE;
+
+ /*
+ * Set inclusive for the "E" and "e" command.
+ */
+ if (cap->cmdchar == 'e' || cap->cmdchar == 'E')
+ word_end = TRUE;
+ else
+ word_end = FALSE;
+ cap->oap->inclusive = word_end;
+
+ /*
+ * "cw" and "cW" are a special case.
+ */
+ if (!word_end && cap->oap->op_type == OP_CHANGE)
+ {
+ n = gchar_cursor();
+ if (n != NUL) /* not an empty line */
+ {
+ if (vim_iswhite(n))
+ {
+ /*
+ * Reproduce a funny Vi behaviour: "cw" on a blank only
+ * changes one character, not all blanks until the start of
+ * the next word. Only do this when the 'w' flag is included
+ * in 'cpoptions'.
+ */
+ if (cap->count1 == 1 && vim_strchr(p_cpo, CPO_CW) != NULL)
+ {
+ cap->oap->inclusive = TRUE;
+ cap->oap->motion_type = MCHAR;
+ return;
+ }
+ }
+ else
+ {
+ /*
+ * This is a little strange. To match what the real Vi does,
+ * we effectively map 'cw' to 'ce', and 'cW' to 'cE', provided
+ * that we are not on a space or a TAB. This seems impolite
+ * at first, but it's really more what we mean when we say
+ * 'cw'.
+ * Another strangeness: When standing on the end of a word
+ * "ce" will change until the end of the next wordt, but "cw"
+ * will change only one character! This is done by setting
+ * flag.
+ */
+ cap->oap->inclusive = TRUE;
+ word_end = TRUE;
+ flag = TRUE;
+ }
+ }
+ }
+
+ cap->oap->motion_type = MCHAR;
+ curwin->w_set_curswant = TRUE;
+ if (word_end)
+ n = end_word(cap->count1, cap->arg, flag, FALSE);
+ else
+ n = fwd_word(cap->count1, cap->arg, cap->oap->op_type != OP_NOP);
+
+ /* Don't leave the cursor on the NUL past a line */
+ if (curwin->w_cursor.col && gchar_cursor() == NUL)
+ {
+ --curwin->w_cursor.col;
+ cap->oap->inclusive = TRUE;
+ }
+
+ if (n == FAIL && cap->oap->op_type == OP_NOP)
+ clearopbeep(cap->oap);
+ else
+ {
+#ifdef FEAT_VISUAL
+ adjust_for_sel(cap);
+#endif
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+ }
+}
+
+/*
+ * "0" and "^" commands.
+ * cap->arg is the argument for beginline().
+ */
+ static void
+nv_beginline(cap)
+ cmdarg_T *cap;
+{
+ cap->oap->motion_type = MCHAR;
+ cap->oap->inclusive = FALSE;
+ beginline(cap->arg);
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_HOR) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * In exclusive Visual mode, may include the last character.
+ */
+ static void
+adjust_for_sel(cap)
+ cmdarg_T *cap;
+{
+ if (VIsual_active && cap->oap->inclusive && *p_sel == 'e'
+ && gchar_cursor() != NUL && lt(VIsual, curwin->w_cursor))
+ {
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ inc_cursor();
+ else
+# endif
+ ++curwin->w_cursor.col;
+ cap->oap->inclusive = FALSE;
+ }
+}
+
+/*
+ * Exclude last character at end of Visual area for 'selection' == "exclusive".
+ * Should check VIsual_mode before calling this.
+ * Returns TRUE when backed up to the previous line.
+ */
+ static int
+unadjust_for_sel()
+{
+ pos_T *pp;
+
+ if (*p_sel == 'e' && !equalpos(VIsual, curwin->w_cursor))
+ {
+ if (lt(VIsual, curwin->w_cursor))
+ pp = &curwin->w_cursor;
+ else
+ pp = &VIsual;
+#ifdef FEAT_VIRTUALEDIT
+ if (pp->coladd > 0)
+ --pp->coladd;
+ else
+#endif
+ if (pp->col > 0)
+ {
+ --pp->col;
+#ifdef FEAT_MBYTE
+ mb_adjustpos(pp);
+#endif
+ }
+ else if (pp->lnum > 1)
+ {
+ --pp->lnum;
+ pp->col = (colnr_T)STRLEN(ml_get(pp->lnum));
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * SELECT key in Normal or Visual mode: end of Select mode mapping.
+ */
+ static void
+nv_select(cap)
+ cmdarg_T *cap;
+{
+ if (VIsual_active)
+ VIsual_select = TRUE;
+ else if (VIsual_reselect)
+ {
+ cap->nchar = 'v'; /* fake "gv" command */
+ cap->arg = TRUE;
+ nv_g_cmd(cap);
+ }
+}
+
+#endif
+
+/*
+ * "G", "gg", CTRL-END, CTRL-HOME.
+ * cap->arg is TRUE for "G".
+ */
+ static void
+nv_goto(cap)
+ cmdarg_T *cap;
+{
+ linenr_T lnum;
+
+ if (cap->arg)
+ lnum = curbuf->b_ml.ml_line_count;
+ else
+ lnum = 1L;
+ cap->oap->motion_type = MLINE;
+ setpcmark();
+
+ /* When a count is given, use it instead of the default lnum */
+ if (cap->count0 != 0)
+ lnum = cap->count0;
+ if (lnum < 1L)
+ lnum = 1L;
+ else if (lnum > curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.lnum = lnum;
+ beginline(BL_SOL | BL_FIX);
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_JUMP) && KeyTyped && cap->oap->op_type == OP_NOP)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * CTRL-\ in Normal mode.
+ */
+ static void
+nv_normal(cap)
+ cmdarg_T *cap;
+{
+ if (cap->nchar == Ctrl_N || cap->nchar == Ctrl_G)
+ {
+ clearop(cap->oap);
+ if (restart_edit != 0 && p_smd)
+ clear_cmdline = TRUE; /* unshow mode later */
+ restart_edit = 0;
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ cmdwin_result = Ctrl_C;
+#endif
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ end_visual_mode(); /* stop Visual */
+ redraw_curbuf_later(INVERTED);
+ }
+#endif
+ /* CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set. */
+ if (cap->nchar == Ctrl_G && p_im)
+ restart_edit = 'a';
+ }
+ else
+ clearopbeep(cap->oap);
+}
+
+/*
+ * ESC in Normal mode: beep, but don't flush buffers.
+ * Don't even beep if we are canceling a command.
+ */
+ static void
+nv_esc(cap)
+ cmdarg_T *cap;
+{
+ int no_reason;
+
+ no_reason = (cap->oap->op_type == OP_NOP
+ && cap->opcount == 0
+ && cap->count0 == 0
+ && cap->oap->regname == 0
+ && !p_im);
+
+ if (cap->arg) /* TRUE for CTRL-C */
+ {
+ if (restart_edit == 0
+#ifdef FEAT_CMDWIN
+ && cmdwin_type == 0
+#endif
+#ifdef FEAT_VISUAL
+ && !VIsual_active
+#endif
+ && no_reason)
+ MSG(_("Type :quit<Enter> to exit Vim"));
+
+ /* Don't reset "restart_edit" when 'insertmode' is set, it won't be
+ * set again below when halfway a mapping. */
+ if (!p_im)
+ restart_edit = 0;
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ cmdwin_result = K_IGNORE;
+ got_int = FALSE; /* don't stop executing autocommands et al. */
+ return;
+ }
+#endif
+ }
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ end_visual_mode(); /* stop Visual */
+ check_cursor_col(); /* make sure cursor is not beyond EOL */
+ curwin->w_set_curswant = TRUE;
+ redraw_curbuf_later(INVERTED);
+ }
+ else
+#endif
+ if (no_reason)
+ vim_beep();
+ clearop(cap->oap);
+
+ /* A CTRL-C is often used at the start of a menu. When 'insertmode' is
+ * set return to Insert mode afterwards. */
+ if (restart_edit == 0 && goto_im()
+#ifdef FEAT_EX_EXTRA
+ && ex_normal_busy == 0
+#endif
+ )
+ restart_edit = 'a';
+}
+
+/*
+ * Handle "A", "a", "I", "i" and <Insert> commands.
+ */
+ static void
+nv_edit(cap)
+ cmdarg_T *cap;
+{
+ /* <Insert> is equal to "i" */
+ if (cap->cmdchar == K_INS || cap->cmdchar == K_KINS)
+ cap->cmdchar = 'i';
+
+#ifdef FEAT_VISUAL
+ /* in Visual mode "A" and "I" are an operator */
+ if (VIsual_active && (cap->cmdchar == 'A' || cap->cmdchar == 'I'))
+ v_visop(cap);
+
+ /* in Visual mode and after an operator "a" and "i" are for text objects */
+ else
+#endif
+ if ((cap->cmdchar == 'a' || cap->cmdchar == 'i')
+ && (cap->oap->op_type != OP_NOP
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ ))
+ {
+#ifdef FEAT_TEXTOBJ
+ nv_object(cap);
+#else
+ clearopbeep(cap->oap);
+#endif
+ }
+ else if (!curbuf->b_p_ma && !p_im)
+ {
+ /* Only give this error when 'insertmode' is off. */
+ EMSG(_(e_modifiable));
+ clearop(cap->oap);
+ }
+ else if (!checkclearopq(cap->oap))
+ {
+ switch (cap->cmdchar)
+ {
+ case 'A': /* "A"ppend after the line */
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_VIRTUALEDIT
+ if (ve_flags == VE_ALL)
+ {
+ int save_State = State;
+
+ /* Pretent Insert mode here to allow the cursor on the
+ * character past the end of the line */
+ State = INSERT;
+ coladvance((colnr_T)MAXCOL);
+ State = save_State;
+ }
+ else
+#endif
+ curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor());
+ break;
+
+ case 'I': /* "I"nsert before the first non-blank */
+ beginline(BL_WHITE);
+ break;
+
+ case 'a': /* "a"ppend is like "i"nsert on the next character. */
+#ifdef FEAT_VIRTUALEDIT
+ /* increment coladd when in virtual space, increment the
+ * column otherwise, also to append after an unprintable char */
+ if (virtual_active()
+ && (curwin->w_cursor.coladd > 0
+ || *ml_get_cursor() == NUL
+ || *ml_get_cursor() == TAB))
+ curwin->w_cursor.coladd++;
+ else
+#endif
+ if (*ml_get_cursor() != NUL)
+ inc_cursor();
+ break;
+ }
+
+#ifdef FEAT_VIRTUALEDIT
+ if (curwin->w_cursor.coladd && cap->cmdchar != 'A')
+ {
+ int save_State = State;
+
+ /* Pretent Insert mode here to allow the cursor on the
+ * character past the end of the line */
+ State = INSERT;
+ coladvance(getviscol());
+ State = save_State;
+ }
+#endif
+
+ invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
+ }
+}
+
+/*
+ * Invoke edit() and take care of "restart_edit" and the return value.
+ */
+ static void
+invoke_edit(cap, repl, cmd, startln)
+ cmdarg_T *cap;
+ int repl; /* "r" or "gr" command */
+ int cmd;
+ int startln;
+{
+ int restart_edit_save = 0;
+
+ /* Complicated: When the user types "a<C-O>a" we don't want to do Insert
+ * mode recursively. But when doing "a<C-O>." or "a<C-O>rx" we do allow
+ * it. */
+ if (repl || !stuff_empty())
+ restart_edit_save = restart_edit;
+ else
+ restart_edit_save = 0;
+
+ /* Always reset "restart_edit", this is not a restarted edit. */
+ restart_edit = 0;
+
+ if (edit(cmd, startln, cap->count1))
+ cap->retval |= CA_COMMAND_BUSY;
+
+ if (restart_edit == 0)
+ restart_edit = restart_edit_save;
+}
+
+#ifdef FEAT_TEXTOBJ
+/*
+ * "a" or "i" while an operator is pending or in Visual mode: object motion.
+ */
+ static void
+nv_object(cap)
+ cmdarg_T *cap;
+{
+ int flag;
+ int include;
+ char_u *mps_save;
+
+ if (cap->cmdchar == 'i')
+ include = FALSE; /* "ix" = inner object: exclude white space */
+ else
+ include = TRUE; /* "ax" = an object: include white space */
+
+ /* Make sure (), [], {} and <> are in 'matchpairs' */
+ mps_save = curbuf->b_p_mps;
+ curbuf->b_p_mps = (char_u *)"(:),{:},[:],<:>";
+
+ switch (cap->nchar)
+ {
+ case 'w': /* "aw" = a word */
+ flag = current_word(cap->oap, cap->count1, include, FALSE);
+ break;
+ case 'W': /* "aW" = a WORD */
+ flag = current_word(cap->oap, cap->count1, include, TRUE);
+ break;
+ case 'b': /* "ab" = a braces block */
+ case '(':
+ case ')':
+ flag = current_block(cap->oap, cap->count1, include, '(', ')');
+ break;
+ case 'B': /* "aB" = a Brackets block */
+ case '{':
+ case '}':
+ flag = current_block(cap->oap, cap->count1, include, '{', '}');
+ break;
+ case '[': /* "a[" = a [] block */
+ case ']':
+ flag = current_block(cap->oap, cap->count1, include, '[', ']');
+ break;
+ case '<': /* "a<" = a <> block */
+ case '>':
+ flag = current_block(cap->oap, cap->count1, include, '<', '>');
+ break;
+ case 'p': /* "ap" = a paragraph */
+ flag = current_par(cap->oap, cap->count1, include, 'p');
+ break;
+ case 's': /* "as" = a sentence */
+ flag = current_sent(cap->oap, cap->count1, include);
+ break;
+#if 0 /* TODO */
+ case 'S': /* "aS" = a section */
+ case 'f': /* "af" = a filename */
+ case 'u': /* "au" = a URL */
+#endif
+ default:
+ flag = FAIL;
+ break;
+ }
+
+ curbuf->b_p_mps = mps_save;
+ if (flag == FAIL)
+ clearopbeep(cap->oap);
+ adjust_cursor_col();
+ curwin->w_set_curswant = TRUE;
+}
+#endif
+
+/*
+ * "q" command: Start/stop recording.
+ * "q:", "q/", "q?": edit command-line in command-line window.
+ */
+ static void
+nv_record(cap)
+ cmdarg_T *cap;
+{
+ if (cap->oap->op_type == OP_FORMAT)
+ {
+ /* "gqq" is the same as "gqgq": format line */
+ cap->cmdchar = 'g';
+ cap->nchar = 'q';
+ nv_operator(cap);
+ }
+ else if (!checkclearop(cap->oap))
+ {
+#ifdef FEAT_CMDWIN
+ if (cap->nchar == ':' || cap->nchar == '/' || cap->nchar == '?')
+ {
+ stuffcharReadbuff(cap->nchar);
+ stuffcharReadbuff(K_CMDWIN);
+ }
+ else
+#endif
+ /* (stop) recording into a named register, unless executing a
+ * register */
+ if (!Exec_reg && do_record(cap->nchar) == FAIL)
+ clearopbeep(cap->oap);
+ }
+}
+
+/*
+ * Handle the "@r" command.
+ */
+ static void
+nv_at(cap)
+ cmdarg_T *cap;
+{
+ if (checkclearop(cap->oap))
+ return;
+#ifdef FEAT_EVAL
+ if (cap->nchar == '=')
+ {
+ if (get_expr_register() == NUL)
+ return;
+ }
+#endif
+ while (cap->count1-- && !got_int)
+ {
+ if (do_execreg(cap->nchar, FALSE, FALSE) == FAIL)
+ {
+ clearopbeep(cap->oap);
+ break;
+ }
+ line_breakcheck();
+ }
+}
+
+/*
+ * Handle the CTRL-U and CTRL-D commands.
+ */
+ static void
+nv_halfpage(cap)
+ cmdarg_T *cap;
+{
+ if ((cap->cmdchar == Ctrl_U && curwin->w_cursor.lnum == 1)
+ || (cap->cmdchar == Ctrl_D
+ && curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count))
+ clearopbeep(cap->oap);
+ else if (!checkclearop(cap->oap))
+ halfpage(cap->cmdchar == Ctrl_D, cap->count0);
+}
+
+/*
+ * Handle "J" or "gJ" command.
+ */
+ static void
+nv_join(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ if (VIsual_active) /* join the visual lines */
+ nv_operator(cap);
+ else
+#endif
+ if (!checkclearop(cap->oap))
+ {
+ if (cap->count0 <= 1)
+ cap->count0 = 2; /* default for join is two lines! */
+ if (curwin->w_cursor.lnum + cap->count0 - 1 >
+ curbuf->b_ml.ml_line_count)
+ clearopbeep(cap->oap); /* beyond last line */
+ else
+ {
+ prep_redo(cap->oap->regname, cap->count0,
+ NUL, cap->cmdchar, NUL, NUL, cap->nchar);
+ do_do_join(cap->count0, cap->nchar == NUL);
+ }
+ }
+}
+
+/*
+ * "P", "gP", "p" and "gp" commands.
+ */
+ static void
+nv_put(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_VISUAL
+ int regname = 0;
+ void *reg1 = NULL, *reg2 = NULL;
+#endif
+ int dir;
+ int flags = 0;
+
+ if (cap->oap->op_type != OP_NOP)
+ {
+#ifdef FEAT_DIFF
+ /* "dp" is ":diffput" */
+ if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
+ {
+ clearop(cap->oap);
+ nv_diffgetput(TRUE);
+ }
+ else
+#endif
+ clearopbeep(cap->oap);
+ }
+ else
+ {
+ dir = (cap->cmdchar == 'P'
+ || (cap->cmdchar == 'g' && cap->nchar == 'P'))
+ ? BACKWARD : FORWARD;
+ prep_redo_cmd(cap);
+ if (cap->cmdchar == 'g')
+ flags |= PUT_CURSEND;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ /* Putting in Visual mode: The put text replaces the selected
+ * text. First delete the selected text, then put the new text.
+ * Need to save and restore the registers that the delete
+ * overwrites if the old contents is being put.
+ */
+ regname = cap->oap->regname;
+# ifdef FEAT_CLIPBOARD
+ adjust_clip_reg(&regname);
+# endif
+ if (regname == 0 || VIM_ISDIGIT(regname)
+# ifdef FEAT_CLIPBOARD
+ || (clip_unnamed && (regname == '*' || regname == '+'))
+# endif
+
+ )
+ {
+ /* the delete is going to overwrite the register we want to
+ * put, save it first. */
+ reg1 = get_register(regname, TRUE);
+ }
+
+ /* Now delete the selected text. */
+ cap->cmdchar = 'd';
+ cap->nchar = NUL;
+ cap->oap->regname = NUL;
+ nv_operator(cap);
+ do_pending_operator(cap, 0, FALSE);
+
+ /* delete PUT_LINE_BACKWARD; */
+ cap->oap->regname = regname;
+
+ if (reg1 != NULL)
+ {
+ /* Delete probably changed the register we want to put, save
+ * it first. Then put back what was there before the delete. */
+ reg2 = get_register(regname, FALSE);
+ put_register(regname, reg1);
+ }
+
+ /* When deleted a linewise Visual area, put the register as
+ * lines to avoid it joined with the next line. When deletion was
+ * characterwise, split a line when putting lines. */
+ if (VIsual_mode == 'V')
+ flags |= PUT_LINE;
+ else if (VIsual_mode == 'v')
+ flags |= PUT_LINE_SPLIT;
+ if (VIsual_mode == Ctrl_V && dir == FORWARD)
+ flags |= PUT_LINE_FORWARD;
+ dir = BACKWARD;
+ if ((VIsual_mode != 'V'
+ && curwin->w_cursor.col < curbuf->b_op_start.col)
+ || (VIsual_mode == 'V'
+ && curwin->w_cursor.lnum < curbuf->b_op_start.lnum))
+ /* cursor is at the end of the line or end of file, put
+ * forward. */
+ dir = FORWARD;
+ }
+#endif
+ do_put(cap->oap->regname, dir, cap->count1, flags);
+
+#ifdef FEAT_VISUAL
+ /* If a register was saved, put it back now. */
+ if (reg2 != NULL)
+ put_register(regname, reg2);
+#endif
+ auto_format(FALSE, TRUE);
+ }
+}
+
+/*
+ * "o" and "O" commands.
+ */
+ static void
+nv_open(cap)
+ cmdarg_T *cap;
+{
+#ifdef FEAT_DIFF
+ /* "do" is ":diffget" */
+ if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
+ {
+ clearop(cap->oap);
+ nv_diffgetput(FALSE);
+ }
+ else
+#endif
+#ifdef FEAT_VISUAL
+ if (VIsual_active) /* switch start and end of visual */
+ v_swap_corners(cap->cmdchar);
+ else
+#endif
+ n_opencmd(cap);
+}
+
+#ifdef FEAT_SNIFF
+/*ARGSUSED*/
+ static void
+nv_sniff(cap)
+ cmdarg_T *cap;
+{
+ ProcessSniffRequests();
+}
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ static void
+nv_nbcmd(cap)
+ cmdarg_T *cap;
+{
+ netbeans_keycommand(cap->nchar);
+}
+#endif
+
+#ifdef FEAT_DND
+/*ARGSUSED*/
+ static void
+nv_drop(cap)
+ cmdarg_T *cap;
+{
+ do_put('~', BACKWARD, 1L, PUT_CURSEND);
+}
+#endif
diff --git a/src/ops.c b/src/ops.c
new file mode 100644
index 000000000..e240c45f3
--- /dev/null
+++ b/src/ops.c
@@ -0,0 +1,6114 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ops.c: implementation of various operators: op_shift, op_delete, op_tilde,
+ * op_change, op_yank, do_put, do_join
+ */
+
+#include "vim.h"
+
+/*
+ * Number of registers.
+ * 0 = unnamed register, for normal yanks and puts
+ * 1..9 = registers '1' to '9', for deletes
+ * 10..35 = registers 'a' to 'z'
+ * 36 = delete register '-'
+ * 37 = Selection register '*'. Only if FEAT_CLIPBOARD defined
+ * 38 = Clipboard register '+'. Only if FEAT_CLIPBOARD and FEAT_X11 defined
+ */
+/*
+ * Symbolic names for some registers.
+ */
+#define DELETION_REGISTER 36
+#ifdef FEAT_CLIPBOARD
+# define STAR_REGISTER 37
+# ifdef FEAT_X11
+# define PLUS_REGISTER 38
+# else
+# define PLUS_REGISTER STAR_REGISTER /* there is only one */
+# endif
+#endif
+#ifdef FEAT_DND
+# define TILDE_REGISTER (PLUS_REGISTER + 1)
+#endif
+
+#ifdef FEAT_CLIPBOARD
+# ifdef FEAT_DND
+# define NUM_REGISTERS (TILDE_REGISTER + 1)
+# else
+# define NUM_REGISTERS (PLUS_REGISTER + 1)
+# endif
+#else
+# define NUM_REGISTERS 37
+#endif
+
+/*
+ * Each yank register is an array of pointers to lines.
+ */
+static struct yankreg
+{
+ char_u **y_array; /* pointer to array of line pointers */
+ linenr_T y_size; /* number of lines in y_array */
+ char_u y_type; /* MLINE, MCHAR or MBLOCK */
+#ifdef FEAT_VISUAL
+ colnr_T y_width; /* only set if y_type == MBLOCK */
+#endif
+} y_regs[NUM_REGISTERS];
+
+static struct yankreg *y_current; /* ptr to current yankreg */
+static int y_append; /* TRUE when appending */
+static struct yankreg *y_previous = NULL; /* ptr to last written yankreg */
+
+/*
+ * structure used by block_prep, op_delete and op_yank for blockwise operators
+ * also op_change, op_shift, op_insert, op_replace - AKelly
+ */
+struct block_def
+{
+ int startspaces; /* 'extra' cols of first char */
+ int endspaces; /* 'extra' cols of first char */
+ int textlen; /* chars in block */
+ char_u *textstart; /* pointer to 1st char in block */
+ colnr_T textcol; /* cols of chars (at least part.) in block */
+ colnr_T start_vcol; /* start col of 1st char wholly inside block */
+ colnr_T end_vcol; /* start col of 1st char wholly after block */
+#ifdef FEAT_VISUALEXTRA
+ int is_short; /* TRUE if line is too short to fit in block */
+ int is_MAX; /* TRUE if curswant==MAXCOL when starting */
+ int is_oneChar; /* TRUE if block within one character */
+ int pre_whitesp; /* screen cols of ws before block */
+ int pre_whitesp_c; /* chars of ws before block */
+ colnr_T end_char_vcols; /* number of vcols of post-block char */
+#endif
+ colnr_T start_char_vcols; /* number of vcols of pre-block char */
+};
+
+#ifdef FEAT_VISUALEXTRA
+static void shift_block __ARGS((oparg_T *oap, int amount));
+static void block_insert __ARGS((oparg_T *oap, char_u *s, int b_insert, struct block_def*bdp));
+#endif
+static void get_yank_register __ARGS((int regname, int writing));
+static int stuff_yank __ARGS((int, char_u *));
+static void put_reedit_in_typebuf __ARGS((void));
+static int put_in_typebuf __ARGS((char_u *s, int colon));
+static void stuffescaped __ARGS((char_u *arg, int literally));
+static int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg));
+static void cmdline_paste_str __ARGS((char_u *s, int literally));
+#ifdef FEAT_MBYTE
+static void mb_adjust_opend __ARGS((oparg_T *oap));
+#endif
+static void free_yank __ARGS((long));
+static void free_yank_all __ARGS((void));
+static int yank_copy_line __ARGS((struct block_def *bd, long y_idx));
+#ifdef FEAT_CLIPBOARD
+static void copy_yank_reg __ARGS((struct yankreg *reg));
+# if defined(FEAT_VISUAL) || defined(FEAT_EVAL)
+static void may_set_selection __ARGS((void));
+# endif
+#endif
+static void dis_msg __ARGS((char_u *p, int skip_esc));
+#ifdef FEAT_VISUAL
+static void block_prep __ARGS((oparg_T *oap, struct block_def *, linenr_T, int));
+#endif
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_EVAL)
+static void str_to_reg __ARGS((struct yankreg *y_ptr, int type, char_u *str, long len, long blocklen));
+#endif
+static int ends_in_white __ARGS((linenr_T lnum));
+#ifdef FEAT_COMMENTS
+static int same_leader __ARGS((linenr_T lnum, int, char_u *, int, char_u *));
+static int fmt_check_par __ARGS((linenr_T, int *, char_u **, int do_comments));
+#else
+static int fmt_check_par __ARGS((linenr_T));
+#endif
+
+/*
+ * The names of operators.
+ * IMPORTANT: Index must correspond with defines in vim.h!!!
+ * The third field indicates whether the operator always works on lines.
+ */
+static char opchars[][3] =
+{
+ {NUL, NUL, FALSE}, /* OP_NOP */
+ {'d', NUL, FALSE}, /* OP_DELETE */
+ {'y', NUL, FALSE}, /* OP_YANK */
+ {'c', NUL, FALSE}, /* OP_CHANGE */
+ {'<', NUL, TRUE}, /* OP_LSHIFT */
+ {'>', NUL, TRUE}, /* OP_RSHIFT */
+ {'!', NUL, TRUE}, /* OP_FILTER */
+ {'g', '~', FALSE}, /* OP_TILDE */
+ {'=', NUL, TRUE}, /* OP_INDENT */
+ {'g', 'q', TRUE}, /* OP_FORMAT */
+ {':', NUL, TRUE}, /* OP_COLON */
+ {'g', 'U', FALSE}, /* OP_UPPER */
+ {'g', 'u', FALSE}, /* OP_LOWER */
+ {'J', NUL, TRUE}, /* DO_JOIN */
+ {'g', 'J', TRUE}, /* DO_JOIN_NS */
+ {'g', '?', FALSE}, /* OP_ROT13 */
+ {'r', NUL, FALSE}, /* OP_REPLACE */
+ {'I', NUL, FALSE}, /* OP_INSERT */
+ {'A', NUL, FALSE}, /* OP_APPEND */
+ {'z', 'f', TRUE}, /* OP_FOLD */
+ {'z', 'o', TRUE}, /* OP_FOLDOPEN */
+ {'z', 'O', TRUE}, /* OP_FOLDOPENREC */
+ {'z', 'c', TRUE}, /* OP_FOLDCLOSE */
+ {'z', 'C', TRUE}, /* OP_FOLDCLOSEREC */
+ {'z', 'd', TRUE}, /* OP_FOLDDEL */
+ {'z', 'D', TRUE}, /* OP_FOLDDELREC */
+ {'g', 'w', TRUE}, /* OP_FORMAT2 */
+};
+
+/*
+ * Translate a command name into an operator type.
+ * Must only be called with a valid operator name!
+ */
+ int
+get_op_type(char1, char2)
+ int char1;
+ int char2;
+{
+ int i;
+
+ if (char1 == 'r') /* ignore second character */
+ return OP_REPLACE;
+ if (char1 == '~') /* when tilde is an operator */
+ return OP_TILDE;
+ for (i = 0; ; ++i)
+ if (opchars[i][0] == char1 && opchars[i][1] == char2)
+ break;
+ return i;
+}
+
+#if defined(FEAT_VISUAL) || defined(PROTO)
+/*
+ * Return TRUE if operator "op" always works on whole lines.
+ */
+ int
+op_on_lines(op)
+ int op;
+{
+ return opchars[op][2];
+}
+#endif
+
+/*
+ * Get first operator command character.
+ * Returns 'g' or 'z' if there is another command character.
+ */
+ int
+get_op_char(optype)
+ int optype;
+{
+ return opchars[optype][0];
+}
+
+/*
+ * Get second operator command character.
+ */
+ int
+get_extra_op_char(optype)
+ int optype;
+{
+ return opchars[optype][1];
+}
+
+/*
+ * op_shift - handle a shift operation
+ */
+ void
+op_shift(oap, curs_top, amount)
+ oparg_T *oap;
+ int curs_top;
+ int amount;
+{
+ long i;
+ int first_char;
+ char_u *s;
+#ifdef FEAT_VISUAL
+ int block_col = 0;
+#endif
+
+ if (u_save((linenr_T)(oap->start.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return;
+
+#ifdef FEAT_VISUAL
+ if (oap->block_mode)
+ block_col = curwin->w_cursor.col;
+#endif
+
+ for (i = oap->line_count; --i >= 0; )
+ {
+ first_char = *ml_get_curline();
+ if (first_char == NUL) /* empty line */
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VISUALEXTRA
+ else if (oap->block_mode)
+ shift_block(oap, amount);
+#endif
+ else
+ /* Move the line right if it doesn't start with '#', 'smartindent'
+ * isn't set or 'cindent' isn't set or '#' isn't in 'cino'. */
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ if (first_char != '#' || !preprocs_left())
+#endif
+ {
+ shift_line(oap->op_type == OP_LSHIFT, p_sr, amount);
+ }
+ ++curwin->w_cursor.lnum;
+ }
+
+ changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
+
+#ifdef FEAT_VISUAL
+ if (oap->block_mode)
+ {
+ curwin->w_cursor.lnum = oap->start.lnum;
+ curwin->w_cursor.col = block_col;
+ }
+ else
+#endif
+ if (curs_top) /* put cursor on first line, for ">>" */
+ {
+ curwin->w_cursor.lnum = oap->start.lnum;
+ beginline(BL_SOL | BL_FIX); /* shift_line() may have set cursor.col */
+ }
+ else
+ --curwin->w_cursor.lnum; /* put cursor on last line, for ":>" */
+
+ if (oap->line_count > p_report)
+ {
+ if (oap->op_type == OP_RSHIFT)
+ s = (char_u *)">";
+ else
+ s = (char_u *)"<";
+ if (oap->line_count == 1)
+ {
+ if (amount == 1)
+ sprintf((char *)IObuff, _("1 line %sed 1 time"), s);
+ else
+ sprintf((char *)IObuff, _("1 line %sed %d times"), s, amount);
+ }
+ else
+ {
+ if (amount == 1)
+ sprintf((char *)IObuff, _("%ld lines %sed 1 time"),
+ oap->line_count, s);
+ else
+ sprintf((char *)IObuff, _("%ld lines %sed %d times"),
+ oap->line_count, s, amount);
+ }
+ msg(IObuff);
+ }
+
+ /*
+ * Set "'[" and "']" marks.
+ */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end.lnum = oap->end.lnum;
+ curbuf->b_op_end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum));
+ if (curbuf->b_op_end.col > 0)
+ --curbuf->b_op_end.col;
+}
+
+/*
+ * shift the current line one shiftwidth left (if left != 0) or right
+ * leaves cursor on first blank in the line
+ */
+ void
+shift_line(left, round, amount)
+ int left;
+ int round;
+ int amount;
+{
+ int count;
+ int i, j;
+ int p_sw = (int)curbuf->b_p_sw;
+
+ count = get_indent(); /* get current indent */
+
+ if (round) /* round off indent */
+ {
+ i = count / p_sw; /* number of p_sw rounded down */
+ j = count % p_sw; /* extra spaces */
+ if (j && left) /* first remove extra spaces */
+ --amount;
+ if (left)
+ {
+ i -= amount;
+ if (i < 0)
+ i = 0;
+ }
+ else
+ i += amount;
+ count = i * p_sw;
+ }
+ else /* original vi indent */
+ {
+ if (left)
+ {
+ count -= p_sw * amount;
+ if (count < 0)
+ count = 0;
+ }
+ else
+ count += p_sw * amount;
+ }
+
+ /* Set new indent */
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ change_indent(INDENT_SET, count, FALSE, NUL);
+ else
+#endif
+ (void)set_indent(count, SIN_CHANGED);
+}
+
+#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+/*
+ * Shift one line of the current block one shiftwidth right or left.
+ * Leaves cursor on first character in block.
+ */
+ static void
+shift_block(oap, amount)
+ oparg_T *oap;
+ int amount;
+{
+ int left = (oap->op_type == OP_LSHIFT);
+ int oldstate = State;
+ int total, split;
+ char_u *newp, *oldp, *midp, *ptr;
+ int oldcol = curwin->w_cursor.col;
+ int p_sw = (int)curbuf->b_p_sw;
+ int p_ts = (int)curbuf->b_p_ts;
+ struct block_def bd;
+ int internal = 0;
+ int incr;
+ colnr_T vcol, col = 0, ws_vcol;
+ int i = 0, j = 0;
+ int len;
+
+#ifdef FEAT_RIGHTLEFT
+ int old_p_ri = p_ri;
+
+ p_ri = 0; /* don't want revins in ident */
+#endif
+
+ State = INSERT; /* don't want REPLACE for State */
+ block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE);
+ if (bd.is_short)
+ return;
+
+ /* total is number of screen columns to be inserted/removed */
+ total = amount * p_sw;
+ oldp = ml_get_curline();
+
+ if (!left)
+ {
+ /*
+ * 1. Get start vcol
+ * 2. Total ws vcols
+ * 3. Divvy into TABs & spp
+ * 4. Construct new string
+ */
+ total += bd.pre_whitesp; /* all virtual WS upto & incl a split TAB */
+ ws_vcol = bd.start_vcol - bd.pre_whitesp;
+ if (bd.startspaces)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ bd.textstart += (*mb_ptr2len_check)(bd.textstart);
+#endif
+ ++bd.textstart;
+ }
+ for ( ; vim_iswhite(*bd.textstart); )
+ {
+ incr = lbr_chartabsize_adv(&bd.textstart, (colnr_T)(bd.start_vcol));
+ total += incr;
+ bd.start_vcol += incr;
+ }
+ /* OK, now total=all the VWS reqd, and textstart points at the 1st
+ * non-ws char in the block. */
+ if (!curbuf->b_p_et)
+ i = ((ws_vcol % p_ts) + total) / p_ts; /* number of tabs */
+ if (i)
+ j = ((ws_vcol % p_ts) + total) % p_ts; /* number of spp */
+ else
+ j = total;
+ /* if we're splitting a TAB, allow for it */
+ bd.textcol -= bd.pre_whitesp_c - (bd.startspaces != 0);
+ len = (int)STRLEN(bd.textstart) + 1;
+ newp = alloc_check((unsigned)(bd.textcol + i + j + len));
+ if (newp == NULL)
+ return;
+ vim_memset(newp, NUL, (size_t)(bd.textcol + i + j + len));
+ mch_memmove(newp, oldp, (size_t)bd.textcol);
+ copy_chars(newp + bd.textcol, (size_t)i, TAB);
+ copy_spaces(newp + bd.textcol + i, (size_t)j);
+ /* the end */
+ mch_memmove(newp + bd.textcol + i + j, bd.textstart, (size_t)len);
+ }
+ else /* left */
+ {
+ vcol = oap->start_vcol;
+ /* walk vcol past ws to be removed */
+ for (midp = oldp + bd.textcol;
+ vcol < (oap->start_vcol + total) && vim_iswhite(*midp); )
+ {
+ incr = lbr_chartabsize_adv(&midp, (colnr_T)vcol);
+ vcol += incr;
+ }
+ /* internal is the block-internal ws replacing a split TAB */
+ if (vcol > (oap->start_vcol + total))
+ {
+ /* we have to split the TAB *(midp-1) */
+ internal = vcol - (oap->start_vcol + total);
+ }
+ /* if 'expandtab' is not set, use TABs */
+
+ split = bd.startspaces + internal;
+ if (split > 0)
+ {
+ if (!curbuf->b_p_et)
+ {
+ for (ptr = oldp, col = 0; ptr < oldp+bd.textcol; )
+ col += lbr_chartabsize_adv(&ptr, (colnr_T)col);
+
+ /* col+1 now equals the start col of the first char of the
+ * block (may be < oap.start_vcol if we're splitting a TAB) */
+ i = ((col % p_ts) + split) / p_ts; /* number of tabs */
+ }
+ if (i)
+ j = ((col % p_ts) + split) % p_ts; /* number of spp */
+ else
+ j = split;
+ }
+
+ newp = alloc_check(bd.textcol + i + j + (unsigned)STRLEN(midp) + 1);
+ if (newp == NULL)
+ return;
+ vim_memset(newp, NUL, (size_t)(bd.textcol + i + j + STRLEN(midp) + 1));
+
+ /* copy first part we want to keep */
+ mch_memmove(newp, oldp, (size_t)bd.textcol);
+ /* Now copy any TABS and spp to ensure correct alignment! */
+ while (vim_iswhite(*midp))
+ {
+ if (*midp == TAB)
+ i++;
+ else /*space */
+ j++;
+ midp++;
+ }
+ /* We might have an extra TAB worth of spp now! */
+ if (j / p_ts && !curbuf->b_p_et)
+ {
+ i++;
+ j -= p_ts;
+ }
+ copy_chars(newp + bd.textcol, (size_t)i, TAB);
+ copy_spaces(newp + bd.textcol + i, (size_t)j);
+
+ /* the end */
+ mch_memmove(newp + STRLEN(newp), midp, (size_t)STRLEN(midp) + 1);
+ }
+ /* replace the line */
+ ml_replace(curwin->w_cursor.lnum, newp, FALSE);
+ changed_bytes(curwin->w_cursor.lnum, (colnr_T)bd.textcol);
+ State = oldstate;
+ curwin->w_cursor.col = oldcol;
+#ifdef FEAT_RIGHTLEFT
+ p_ri = old_p_ri;
+#endif
+}
+#endif
+
+#ifdef FEAT_VISUALEXTRA
+/*
+ * Insert string "s" (b_insert ? before : after) block :AKelly
+ * Caller must prepare for undo.
+ */
+ static void
+block_insert(oap, s, b_insert, bdp)
+ oparg_T *oap;
+ char_u *s;
+ int b_insert;
+ struct block_def *bdp;
+{
+ int p_ts;
+ int count = 0; /* extra spaces to replace a cut TAB */
+ int spaces = 0; /* non-zero if cutting a TAB */
+ colnr_T offset; /* pointer along new line */
+ unsigned s_len; /* STRLEN(s) */
+ char_u *newp, *oldp; /* new, old lines */
+ linenr_T lnum; /* loop var */
+ int oldstate = State;
+
+ State = INSERT; /* don't want REPLACE for State */
+ s_len = (unsigned)STRLEN(s);
+
+ for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++)
+ {
+ block_prep(oap, bdp, lnum, TRUE);
+ if (bdp->is_short && b_insert)
+ continue; /* OP_INSERT, line ends before block start */
+
+ oldp = ml_get(lnum);
+
+ if (b_insert)
+ {
+ p_ts = bdp->start_char_vcols;
+ spaces = bdp->startspaces;
+ if (spaces != 0)
+ count = p_ts - 1; /* we're cutting a TAB */
+ offset = bdp->textcol;
+ }
+ else /* append */
+ {
+ p_ts = bdp->end_char_vcols;
+ if (!bdp->is_short) /* spaces = padding after block */
+ {
+ spaces = (bdp->endspaces ? p_ts - bdp->endspaces : 0);
+ if (spaces != 0)
+ count = p_ts - 1; /* we're cutting a TAB */
+ offset = bdp->textcol + bdp->textlen - (spaces != 0);
+ }
+ else /* spaces = padding to block edge */
+ {
+ /* if $ used, just append to EOL (ie spaces==0) */
+ if (!bdp->is_MAX)
+ spaces = (oap->end_vcol - bdp->end_vcol) + 1;
+ count = spaces;
+ offset = bdp->textcol + bdp->textlen;
+ }
+ }
+
+ newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
+ if (newp == NULL)
+ continue;
+
+ /* copy up to shifted part */
+ mch_memmove(newp, oldp, (size_t)(offset));
+ oldp += offset;
+
+ /* insert pre-padding */
+ copy_spaces(newp + offset, (size_t)spaces);
+
+ /* copy the new text */
+ mch_memmove(newp + offset + spaces, s, (size_t)s_len);
+ offset += s_len;
+
+ if (spaces && !bdp->is_short)
+ {
+ /* insert post-padding */
+ copy_spaces(newp + offset + spaces, (size_t)(p_ts - spaces));
+ /* We're splitting a TAB, don't copy it. */
+ oldp++;
+ /* We allowed for that TAB, remember this now */
+ count++;
+ }
+
+ if (spaces > 0)
+ offset += count;
+ mch_memmove(newp + offset, oldp, (size_t)(STRLEN(oldp) + 1));
+
+ ml_replace(lnum, newp, FALSE);
+
+ if (lnum == oap->end.lnum)
+ {
+ /* Set "']" mark to the end of the block instead of the end of
+ * the insert in the first line. */
+ curbuf->b_op_end.lnum = oap->end.lnum;
+ curbuf->b_op_end.col = offset;
+ }
+ } /* for all lnum */
+
+ changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L);
+
+ State = oldstate;
+}
+#endif
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(PROTO)
+/*
+ * op_reindent - handle reindenting a block of lines.
+ */
+ void
+op_reindent(oap, how)
+ oparg_T *oap;
+ int (*how) __ARGS((void));
+{
+ long i;
+ char_u *l;
+ int count;
+ linenr_T first_changed = 0;
+ linenr_T last_changed = 0;
+ linenr_T start_lnum = curwin->w_cursor.lnum;
+
+ for (i = oap->line_count; --i >= 0 && !got_int; )
+ {
+ /* it's a slow thing to do, so give feedback so there's no worry that
+ * the computer's just hung. */
+
+ if (i > 1
+ && (i % 50 == 0 || i == oap->line_count - 1)
+ && oap->line_count > p_report)
+ smsg((char_u *)_("%ld lines to indent... "), i);
+
+ /*
+ * Be vi-compatible: For lisp indenting the first line is not
+ * indented, unless there is only one line.
+ */
+#ifdef FEAT_LISP
+ if (i != oap->line_count - 1 || oap->line_count == 1
+ || how != get_lisp_indent)
+#endif
+ {
+ l = skipwhite(ml_get_curline());
+ if (*l == NUL) /* empty or blank line */
+ count = 0;
+ else
+ count = how(); /* get the indent for this line */
+
+ if (set_indent(count, SIN_UNDO))
+ {
+ /* did change the indent, call changed_lines() later */
+ if (first_changed == 0)
+ first_changed = curwin->w_cursor.lnum;
+ last_changed = curwin->w_cursor.lnum;
+ }
+ }
+ ++curwin->w_cursor.lnum;
+ }
+
+ /* put cursor on first non-blank of indented line */
+ curwin->w_cursor.lnum = start_lnum;
+ beginline(BL_SOL | BL_FIX);
+
+ /* Mark changed lines so that they will be redrawn. When Visual
+ * highlighting was present, need to continue until the last line. When
+ * there is no change still need to remove the Visual highlighting. */
+ if (last_changed != 0)
+ changed_lines(first_changed, 0,
+#ifdef FEAT_VISUAL
+ oap->is_VIsual ? start_lnum + oap->line_count :
+#endif
+ last_changed + 1, 0L);
+#ifdef FEAT_VISUAL
+ else if (oap->is_VIsual)
+ redraw_curbuf_later(INVERTED);
+#endif
+
+ if (oap->line_count > p_report)
+ {
+ i = oap->line_count - (i + 1);
+ if (i == 1)
+ MSG(_("1 line indented "));
+ else
+ smsg((char_u *)_("%ld lines indented "), i);
+ }
+ /* set '[ and '] marks */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end = oap->end;
+}
+#endif /* defined(FEAT_LISP) || defined(FEAT_CINDENT) */
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Keep the last expression line here, for repeating.
+ */
+static char_u *expr_line = NULL;
+
+/*
+ * Get an expression for the "\"=expr1" or "CTRL-R =expr1"
+ * Returns '=' when OK, NUL otherwise.
+ */
+ int
+get_expr_register()
+{
+ char_u *new_line;
+
+ new_line = getcmdline('=', 0L, 0);
+ if (new_line == NULL)
+ return NUL;
+ if (*new_line == NUL) /* use previous line */
+ vim_free(new_line);
+ else
+ set_expr_line(new_line);
+ return '=';
+}
+
+/*
+ * Set the expression for the '=' register.
+ * Argument must be an allocated string.
+ */
+ void
+set_expr_line(new_line)
+ char_u *new_line;
+{
+ vim_free(expr_line);
+ expr_line = new_line;
+}
+
+/*
+ * Get the result of the '=' register expression.
+ * Returns a pointer to allocated memory, or NULL for failure.
+ */
+ char_u *
+get_expr_line()
+{
+ char_u *expr_copy;
+ char_u *rv;
+
+ if (expr_line == NULL)
+ return NULL;
+
+ /* Make a copy of the expression, because evaluating it may cause it to be
+ * changed. */
+ expr_copy = vim_strsave(expr_line);
+ if (expr_copy == NULL)
+ return NULL;
+
+ rv = eval_to_string(expr_copy, NULL);
+ vim_free(expr_copy);
+ return rv;
+}
+#endif /* FEAT_EVAL */
+
+/*
+ * Check if 'regname' is a valid name of a yank register.
+ * Note: There is no check for 0 (default register), caller should do this
+ */
+ int
+valid_yank_reg(regname, writing)
+ int regname;
+ int writing; /* if TRUE check for writable registers */
+{
+ if ( (regname > 0 && ASCII_ISALNUM(regname))
+ || (!writing && vim_strchr((char_u *)
+#ifdef FEAT_EVAL
+ "/.%#:="
+#else
+ "/.%#:"
+#endif
+ , regname) != NULL)
+ || regname == '"'
+ || regname == '-'
+ || regname == '_'
+#ifdef FEAT_CLIPBOARD
+ || regname == '*'
+ || regname == '+'
+#endif
+#ifdef FEAT_DND
+ || (!writing && regname == '~')
+#endif
+ )
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Set y_current and y_append, according to the value of "regname".
+ * Cannot handle the '_' register.
+ *
+ * If regname is 0 and writing, use register 0
+ * If regname is 0 and reading, use previous register
+ */
+ static void
+get_yank_register(regname, writing)
+ int regname;
+ int writing;
+{
+ int i;
+
+ y_append = FALSE;
+ if ((regname == 0 || regname == '"') && !writing && y_previous != NULL)
+ {
+ y_current = y_previous;
+ return;
+ }
+ i = regname;
+ if (VIM_ISDIGIT(i))
+ i -= '0';
+ else if (ASCII_ISLOWER(i))
+ i = CharOrdLow(i) + 10;
+ else if (ASCII_ISUPPER(i))
+ {
+ i = CharOrdUp(i) + 10;
+ y_append = TRUE;
+ }
+ else if (regname == '-')
+ i = DELETION_REGISTER;
+#ifdef FEAT_CLIPBOARD
+ /* When selection is not available, use register 0 instead of '*' */
+ else if (clip_star.available && regname == '*')
+ i = STAR_REGISTER;
+ /* When clipboard is not available, use register 0 instead of '+' */
+ else if (clip_plus.available && regname == '+')
+ i = PLUS_REGISTER;
+#endif
+#ifdef FEAT_DND
+ else if (!writing && regname == '~')
+ i = TILDE_REGISTER;
+#endif
+ else /* not 0-9, a-z, A-Z or '-': use register 0 */
+ i = 0;
+ y_current = &(y_regs[i]);
+ if (writing) /* remember the register we write into for do_put() */
+ y_previous = y_current;
+}
+
+#ifdef FEAT_CLIPBOARD
+/*
+ * When "regname" is a clipboard register, obtain the selection. If it's not
+ * available return zero, otherwise return "regname".
+ */
+static int may_get_selection __ARGS((int regname));
+
+ static int
+may_get_selection(regname)
+ int regname;
+{
+ if (regname == '*')
+ {
+ if (!clip_star.available)
+ regname = 0;
+ else
+ clip_get_selection(&clip_star);
+ }
+ else if (regname == '+')
+ {
+ if (!clip_plus.available)
+ regname = 0;
+ else
+ clip_get_selection(&clip_plus);
+ }
+ return regname;
+}
+#endif
+
+#if defined(FEAT_VISUAL) || defined(PROTO)
+/*
+ * Obtain the contents of a "normal" register. The register is made empty.
+ * The returned pointer has allocated memory, use put_register() later.
+ */
+ void *
+get_register(name, copy)
+ int name;
+ int copy; /* make a copy, if FALSE make register empty. */
+{
+ static struct yankreg *reg;
+ int i;
+
+#ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. Obtain the
+ * selection too. */
+ if (name == '*' && clip_star.available && clip_isautosel())
+ {
+ clip_update_selection();
+ may_get_selection(name);
+ }
+#endif
+
+ get_yank_register(name, 0);
+ reg = (struct yankreg *)alloc((unsigned)sizeof(struct yankreg));
+ if (reg != NULL)
+ {
+ *reg = *y_current;
+ if (copy)
+ {
+ /* If we run out of memory some or all of the lines are empty. */
+ if (reg->y_size == 0)
+ reg->y_array = NULL;
+ else
+ reg->y_array = (char_u **)alloc((unsigned)(sizeof(char_u *)
+ * reg->y_size));
+ if (reg->y_array != NULL)
+ {
+ for (i = 0; i < reg->y_size; ++i)
+ reg->y_array[i] = vim_strsave(y_current->y_array[i]);
+ }
+ }
+ else
+ y_current->y_array = NULL;
+ }
+ return (void *)reg;
+}
+
+/*
+ * Put "reg" into register "name". Free any previous contents.
+ */
+ void
+put_register(name, reg)
+ int name;
+ void *reg;
+{
+ get_yank_register(name, 0);
+ free_yank_all();
+ *y_current = *(struct yankreg *)reg;
+
+# ifdef FEAT_CLIPBOARD
+ /* Send text written to clipboard register to the clipboard. */
+ may_set_selection();
+# endif
+}
+#endif
+
+#if defined(FEAT_MOUSE) || defined(PROTO)
+/*
+ * return TRUE if the current yank register has type MLINE
+ */
+ int
+yank_register_mline(regname)
+ int regname;
+{
+ if (regname != 0 && !valid_yank_reg(regname, FALSE))
+ return FALSE;
+ if (regname == '_') /* black hole is always empty */
+ return FALSE;
+ get_yank_register(regname, FALSE);
+ return (y_current->y_type == MLINE);
+}
+#endif
+
+/*
+ * start or stop recording into a yank register
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_record(c)
+ int c;
+{
+ char_u *p;
+ static int regname;
+ struct yankreg *old_y_previous, *old_y_current;
+ int retval;
+
+ if (Recording == FALSE) /* start recording */
+ {
+ /* registers 0-9, a-z and " are allowed */
+ if (c < 0 || (!ASCII_ISALNUM(c) && c != '"'))
+ retval = FAIL;
+ else
+ {
+ Recording = TRUE;
+ showmode();
+ regname = c;
+ retval = OK;
+ }
+ }
+ else /* stop recording */
+ {
+ /*
+ * Get the recorded key hits. K_SPECIAL and CSI will be escaped, so
+ * that the register can be put into the typeahead buffer without
+ * translation.
+ */
+ Recording = FALSE;
+ MSG("");
+ p = get_recorded();
+ if (p == NULL)
+ retval = FAIL;
+ else
+ {
+ /*
+ * We don't want to change the default register here, so save and
+ * restore the current register name.
+ */
+ old_y_previous = y_previous;
+ old_y_current = y_current;
+
+ retval = stuff_yank(regname, p);
+
+ y_previous = old_y_previous;
+ y_current = old_y_current;
+ }
+ }
+ return retval;
+}
+
+/*
+ * Stuff string "p" into yank register "regname" as a single line (append if
+ * uppercase). "p" must have been alloced.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ static int
+stuff_yank(regname, p)
+ int regname;
+ char_u *p;
+{
+ char_u *lp;
+ char_u **pp;
+
+ /* check for read-only register */
+ if (regname != 0 && !valid_yank_reg(regname, TRUE))
+ {
+ vim_free(p);
+ return FAIL;
+ }
+ if (regname == '_') /* black hole: don't do anything */
+ {
+ vim_free(p);
+ return OK;
+ }
+ get_yank_register(regname, TRUE);
+ if (y_append && y_current->y_array != NULL)
+ {
+ pp = &(y_current->y_array[y_current->y_size - 1]);
+ lp = lalloc((long_u)(STRLEN(*pp) + STRLEN(p) + 1), TRUE);
+ if (lp == NULL)
+ {
+ vim_free(p);
+ return FAIL;
+ }
+ STRCPY(lp, *pp);
+ STRCAT(lp, p);
+ vim_free(p);
+ vim_free(*pp);
+ *pp = lp;
+ }
+ else
+ {
+ free_yank_all();
+ if ((y_current->y_array =
+ (char_u **)alloc((unsigned)sizeof(char_u *))) == NULL)
+ {
+ vim_free(p);
+ return FAIL;
+ }
+ y_current->y_array[0] = p;
+ y_current->y_size = 1;
+ y_current->y_type = MCHAR; /* used to be MLINE, why? */
+ }
+ return OK;
+}
+
+/*
+ * execute a yank register: copy it into the stuff buffer
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_execreg(regname, colon, addcr)
+ int regname;
+ int colon; /* insert ':' before each line */
+ int addcr; /* always add '\n' to end of line */
+{
+ static int lastc = NUL;
+ long i;
+ char_u *p;
+ int retval = OK;
+ int remap;
+
+ if (regname == '@') /* repeat previous one */
+ regname = lastc;
+ /* check for valid regname */
+ if (regname == '%' || regname == '#' || !valid_yank_reg(regname, FALSE))
+ return FAIL;
+ lastc = regname;
+
+#ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+#endif
+
+ if (regname == '_') /* black hole: don't stuff anything */
+ return OK;
+
+#ifdef FEAT_CMDHIST
+ if (regname == ':') /* use last command line */
+ {
+ if (last_cmdline == NULL)
+ {
+ EMSG(_(e_nolastcmd));
+ return FAIL;
+ }
+ vim_free(new_last_cmdline); /* don't keep the cmdline containing @: */
+ new_last_cmdline = NULL;
+ retval = put_in_typebuf(last_cmdline, TRUE);
+ }
+#endif
+#ifdef FEAT_EVAL
+ else if (regname == '=')
+ {
+ p = get_expr_line();
+ if (p == NULL)
+ return FAIL;
+ retval = put_in_typebuf(p, colon);
+ vim_free(p);
+ }
+#endif
+ else if (regname == '.') /* use last inserted text */
+ {
+ p = get_last_insert_save();
+ if (p == NULL)
+ {
+ EMSG(_(e_noinstext));
+ return FAIL;
+ }
+ retval = put_in_typebuf(p, colon);
+ vim_free(p);
+ }
+ else
+ {
+ get_yank_register(regname, FALSE);
+ if (y_current->y_array == NULL)
+ return FAIL;
+
+ /* Disallow remaping for ":@r". */
+ remap = colon ? REMAP_NONE : REMAP_YES;
+
+ /*
+ * Insert lines into typeahead buffer, from last one to first one.
+ */
+ put_reedit_in_typebuf();
+ for (i = y_current->y_size; --i >= 0; )
+ {
+ /* insert NL between lines and after last line if type is MLINE */
+ if (y_current->y_type == MLINE || i < y_current->y_size - 1
+ || addcr)
+ {
+ if (ins_typebuf((char_u *)"\n", remap, 0, TRUE, FALSE) == FAIL)
+ return FAIL;
+ }
+ if (ins_typebuf(y_current->y_array[i], remap, 0, TRUE, FALSE)
+ == FAIL)
+ return FAIL;
+ if (colon && ins_typebuf((char_u *)":", remap, 0, TRUE, FALSE)
+ == FAIL)
+ return FAIL;
+ }
+ Exec_reg = TRUE; /* disable the 'q' command */
+ }
+ return retval;
+}
+
+/*
+ * If "restart_edit" is not zero, put it in the typeahead buffer, so that it's
+ * used only after other typeahead has been processed.
+ */
+ static void
+put_reedit_in_typebuf()
+{
+ char_u buf[3];
+
+ if (restart_edit != NUL)
+ {
+ if (restart_edit == 'V')
+ {
+ buf[0] = 'g';
+ buf[1] = 'R';
+ buf[2] = NUL;
+ }
+ else
+ {
+ buf[0] = restart_edit == 'I' ? 'i' : restart_edit;
+ buf[1] = NUL;
+ }
+ if (ins_typebuf(buf, REMAP_NONE, 0, TRUE, FALSE) == OK)
+ restart_edit = NUL;
+ }
+}
+
+ static int
+put_in_typebuf(s, colon)
+ char_u *s;
+ int colon; /* add ':' before the line */
+{
+ int retval = OK;
+
+ put_reedit_in_typebuf();
+ if (colon)
+ retval = ins_typebuf((char_u *)"\n", REMAP_YES, 0, TRUE, FALSE);
+ if (retval == OK)
+ retval = ins_typebuf(s, REMAP_YES, 0, TRUE, FALSE);
+ if (colon && retval == OK)
+ retval = ins_typebuf((char_u *)":", REMAP_YES, 0, TRUE, FALSE);
+ return retval;
+}
+
+/*
+ * Insert a yank register: copy it into the Read buffer.
+ * Used by CTRL-R command and middle mouse button in insert mode.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+insert_reg(regname, literally)
+ int regname;
+ int literally; /* insert literally, not as if typed */
+{
+ long i;
+ int retval = OK;
+ char_u *arg;
+ int allocated;
+
+ /*
+ * It is possible to get into an endless loop by having CTRL-R a in
+ * register a and then, in insert mode, doing CTRL-R a.
+ * If you hit CTRL-C, the loop will be broken here.
+ */
+ ui_breakcheck();
+ if (got_int)
+ return FAIL;
+
+ /* check for valid regname */
+ if (regname != NUL && !valid_yank_reg(regname, FALSE))
+ return FAIL;
+
+#ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+#endif
+
+ if (regname == '.') /* insert last inserted text */
+ retval = stuff_inserted(NUL, 1L, TRUE);
+ else if (get_spec_reg(regname, &arg, &allocated, TRUE))
+ {
+ if (arg == NULL)
+ return FAIL;
+ stuffescaped(arg, literally);
+ if (allocated)
+ vim_free(arg);
+ }
+ else /* name or number register */
+ {
+ get_yank_register(regname, FALSE);
+ if (y_current->y_array == NULL)
+ retval = FAIL;
+ else
+ {
+ for (i = 0; i < y_current->y_size; ++i)
+ {
+ stuffescaped(y_current->y_array[i], literally);
+ /*
+ * Insert a newline between lines and after last line if
+ * y_type is MLINE.
+ */
+ if (y_current->y_type == MLINE || i < y_current->y_size - 1)
+ stuffcharReadbuff('\n');
+ }
+ }
+ }
+
+ return retval;
+}
+
+/*
+ * Stuff a string into the typeahead buffer, such that edit() will insert it
+ * literally ("literally" TRUE) or interpret is as typed characters.
+ */
+ static void
+stuffescaped(arg, literally)
+ char_u *arg;
+ int literally;
+{
+ int c;
+ char_u *start;
+
+ while (*arg != NUL)
+ {
+ /* Stuff a sequence of normal ASCII characters, that's fast. Also
+ * stuff K_SPECIAL to get the effect of a special key when "literally"
+ * is TRUE. */
+ start = arg;
+ while ((*arg >= ' '
+#ifndef EBCDIC
+ && *arg < DEL /* EBCDIC: chars above space are normal */
+#endif
+ )
+ || (*arg == K_SPECIAL && !literally))
+ ++arg;
+ if (arg > start)
+ stuffReadbuffLen(start, (long)(arg - start));
+
+ /* stuff a single special character */
+ if (*arg != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ c = mb_ptr2char_adv(&arg);
+ else
+#endif
+ c = *arg++;
+ if (literally && ((c < ' ' && c != TAB) || c == DEL))
+ stuffcharReadbuff(Ctrl_V);
+ stuffcharReadbuff(c);
+ }
+ }
+}
+
+/*
+ * If "regname" is a special register, return a pointer to its value.
+ */
+ static int
+get_spec_reg(regname, argp, allocated, errmsg)
+ int regname;
+ char_u **argp;
+ int *allocated;
+ int errmsg; /* give error message when failing */
+{
+ int cnt;
+
+ *argp = NULL;
+ *allocated = FALSE;
+ switch (regname)
+ {
+ case '%': /* file name */
+ if (errmsg)
+ check_fname(); /* will give emsg if not set */
+ *argp = curbuf->b_fname;
+ return TRUE;
+
+ case '#': /* alternate file name */
+ *argp = getaltfname(errmsg); /* may give emsg if not set */
+ return TRUE;
+
+#ifdef FEAT_EVAL
+ case '=': /* result of expression */
+ *argp = get_expr_line();
+ *allocated = TRUE;
+ return TRUE;
+#endif
+
+ case ':': /* last command line */
+ if (last_cmdline == NULL && errmsg)
+ EMSG(_(e_nolastcmd));
+ *argp = last_cmdline;
+ return TRUE;
+
+ case '/': /* last search-pattern */
+ if (last_search_pat() == NULL && errmsg)
+ EMSG(_(e_noprevre));
+ *argp = last_search_pat();
+ return TRUE;
+
+ case '.': /* last inserted text */
+ *argp = get_last_insert_save();
+ *allocated = TRUE;
+ if (*argp == NULL && errmsg)
+ EMSG(_(e_noinstext));
+ return TRUE;
+
+#ifdef FEAT_SEARCHPATH
+ case Ctrl_F: /* Filename under cursor */
+ case Ctrl_P: /* Path under cursor, expand via "path" */
+ if (!errmsg)
+ return FALSE;
+ *argp = file_name_at_cursor(FNAME_MESS | FNAME_HYP
+ | (regname == Ctrl_P ? FNAME_EXP : 0), 1L);
+ *allocated = TRUE;
+ return TRUE;
+#endif
+
+ case Ctrl_W: /* word under cursor */
+ case Ctrl_A: /* WORD (mnemonic All) under cursor */
+ if (!errmsg)
+ return FALSE;
+ cnt = find_ident_under_cursor(argp, regname == Ctrl_W
+ ? (FIND_IDENT|FIND_STRING) : FIND_STRING);
+ *argp = cnt ? vim_strnsave(*argp, cnt) : NULL;
+ *allocated = TRUE;
+ return TRUE;
+
+ case '_': /* black hole: always empty */
+ *argp = (char_u *)"";
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+ * paste a yank register into the command line.
+ * used by CTRL-R command in command-line mode
+ * insert_reg() can't be used here, because special characters from the
+ * register contents will be interpreted as commands.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+cmdline_paste(regname, literally)
+ int regname;
+ int literally; /* Insert text literally instead of "as typed" */
+{
+ long i;
+ char_u *arg;
+ int allocated;
+
+ /* check for valid regname; also accept special characters for CTRL-R in
+ * the command line */
+ if (regname != Ctrl_F && regname != Ctrl_P && regname != Ctrl_W
+ && regname != Ctrl_A && !valid_yank_reg(regname, FALSE))
+ return FAIL;
+
+ /* A register containing CTRL-R can cause an endless loop. Allow using
+ * CTRL-C to break the loop. */
+ line_breakcheck();
+ if (got_int)
+ return FAIL;
+
+#ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+#endif
+
+ if (get_spec_reg(regname, &arg, &allocated, TRUE))
+ {
+ if (arg == NULL)
+ return FAIL;
+ cmdline_paste_str(arg, literally);
+ if (allocated)
+ vim_free(arg);
+ return OK;
+ }
+
+ get_yank_register(regname, FALSE);
+ if (y_current->y_array == NULL)
+ return FAIL;
+
+ for (i = 0; i < y_current->y_size; ++i)
+ {
+ cmdline_paste_str(y_current->y_array[i], literally);
+
+ /* insert ^M between lines and after last line if type is MLINE */
+ if (y_current->y_type == MLINE || i < y_current->y_size - 1)
+ cmdline_paste_str((char_u *)"\r", literally);
+
+ /* Check for CTRL-C, in case someone tries to paste a few thousand
+ * lines and gets bored. */
+ ui_breakcheck();
+ if (got_int)
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
+ * Put a string on the command line.
+ * When "literally" is TRUE, insert literally.
+ * When "literally" is FALSE, insert as typed, but don't leave the command
+ * line.
+ */
+ static void
+cmdline_paste_str(s, literally)
+ char_u *s;
+ int literally;
+{
+ int c, cv;
+
+ if (literally)
+ put_on_cmdline(s, -1, TRUE);
+ else
+ while (*s != NUL)
+ {
+ cv = *s;
+ if (cv == Ctrl_V && s[1])
+ ++s;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ c = mb_ptr2char(s);
+ s += mb_char2len(c);
+ }
+ else
+#endif
+ c = *s++;
+ if (cv == Ctrl_V || c == ESC || c == Ctrl_C || c == CAR || c == NL
+#ifdef UNIX
+ || c == intr_char
+#endif
+ || (c == Ctrl_BSL && *s == Ctrl_N))
+ stuffcharReadbuff(Ctrl_V);
+ stuffcharReadbuff(c);
+ }
+}
+
+#if defined(FEAT_CLIPBOARD) || defined(PROTO)
+/*
+ * Adjust the register name pointed to with "rp" for the clipboard being
+ * used always and the clipboard being available.
+ */
+ void
+adjust_clip_reg(rp)
+ int *rp;
+{
+ /* If no reg. specified, and "unnamed" is in 'clipboard', use '*' reg. */
+ if (*rp == 0 && clip_unnamed)
+ *rp = '*';
+ if (!clip_star.available && *rp == '*')
+ *rp = 0;
+ if (!clip_plus.available && *rp == '+')
+ *rp = 0;
+}
+#endif
+
+/*
+ * op_delete - handle a delete operation
+ *
+ * return FAIL if undo failed, OK otherwise.
+ */
+ int
+op_delete(oap)
+ oparg_T *oap;
+{
+ int n;
+ linenr_T lnum;
+ char_u *ptr;
+#ifdef FEAT_VISUAL
+ char_u *newp, *oldp;
+ struct block_def bd;
+#endif
+ linenr_T old_lcount = curbuf->b_ml.ml_line_count;
+ int did_yank = FALSE;
+
+ if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to do */
+ return OK;
+
+ /* Nothing to delete, return here. Do prepare undo, for op_change(). */
+ if (oap->empty)
+ return u_save_cursor();
+
+ if (!curbuf->b_p_ma)
+ {
+ EMSG(_(e_modifiable));
+ return FAIL;
+ }
+
+#ifdef FEAT_CLIPBOARD
+ adjust_clip_reg(&oap->regname);
+#endif
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ mb_adjust_opend(oap);
+#endif
+
+/*
+ * Imitate the strange Vi behaviour: If the delete spans more than one line
+ * and motion_type == MCHAR and the result is a blank line, make the delete
+ * linewise. Don't do this for the change command or Visual mode.
+ */
+ if ( oap->motion_type == MCHAR
+#ifdef FEAT_VISUAL
+ && !oap->is_VIsual
+#endif
+ && oap->line_count > 1
+ && oap->op_type == OP_DELETE)
+ {
+ ptr = ml_get(oap->end.lnum) + oap->end.col + oap->inclusive;
+ ptr = skipwhite(ptr);
+ if (*ptr == NUL && inindent(0))
+ oap->motion_type = MLINE;
+ }
+
+/*
+ * Check for trying to delete (e.g. "D") in an empty line.
+ * Note: For the change operator it is ok.
+ */
+ if ( oap->motion_type == MCHAR
+ && oap->line_count == 1
+ && oap->op_type == OP_DELETE
+ && *ml_get(oap->start.lnum) == NUL)
+ {
+ /*
+ * It's an error to operate on an empty region, when 'E' inclucded in
+ * 'cpoptions' (Vi compatible).
+ */
+ if (vim_strchr(p_cpo, CPO_EMPTYREGION) != NULL)
+ beep_flush();
+ return OK;
+ }
+
+/*
+ * Do a yank of whatever we're about to delete.
+ * If a yank register was specified, put the deleted text into that register.
+ * For the black hole register '_' don't yank anything.
+ */
+ if (oap->regname != '_')
+ {
+ if (oap->regname != 0)
+ {
+ /* check for read-only register */
+ if (!valid_yank_reg(oap->regname, TRUE))
+ {
+ beep_flush();
+ return OK;
+ }
+ get_yank_register(oap->regname, TRUE); /* yank into specif'd reg. */
+ if (op_yank(oap, TRUE, FALSE) == OK) /* yank without message */
+ did_yank = TRUE;
+ }
+
+ /*
+ * Put deleted text into register 1 and shift number registers if the
+ * delete contains a line break, or when a regname has been specified.
+ */
+ if (oap->regname != 0 || oap->motion_type == MLINE
+ || oap->line_count > 1 || oap->use_reg_one)
+ {
+ y_current = &y_regs[9];
+ free_yank_all(); /* free register nine */
+ for (n = 9; n > 1; --n)
+ y_regs[n] = y_regs[n - 1];
+ y_previous = y_current = &y_regs[1];
+ y_regs[1].y_array = NULL; /* set register one to empty */
+ if (op_yank(oap, TRUE, FALSE) == OK)
+ did_yank = TRUE;
+ }
+
+ /* Yank into small delete register when no register specified and the
+ * delete is within one line. */
+ if (oap->regname == 0 && oap->motion_type != MLINE
+ && oap->line_count == 1)
+ {
+ oap->regname = '-';
+ get_yank_register(oap->regname, TRUE);
+ if (op_yank(oap, TRUE, FALSE) == OK)
+ did_yank = TRUE;
+ oap->regname = 0;
+ }
+
+ /*
+ * If there's too much stuff to fit in the yank register, then get a
+ * confirmation before doing the delete. This is crude, but simple.
+ * And it avoids doing a delete of something we can't put back if we
+ * want.
+ */
+ if (!did_yank)
+ {
+ int msg_silent_save = msg_silent;
+
+ msg_silent = 0; /* must display the prompt */
+ n = ask_yesno((char_u *)_("cannot yank; delete anyway"), TRUE);
+ msg_silent = msg_silent_save;
+ if (n != 'y')
+ {
+ EMSG(_(e_abort));
+ return FAIL;
+ }
+ }
+ }
+
+#ifdef FEAT_VISUAL
+/*
+ * block mode delete
+ */
+ if (oap->block_mode)
+ {
+ if (u_save((linenr_T)(oap->start.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return FAIL;
+
+ for (lnum = curwin->w_cursor.lnum; lnum <= oap->end.lnum; ++lnum)
+ {
+ block_prep(oap, &bd, lnum, TRUE);
+ if (bd.textlen == 0) /* nothing to delete */
+ continue;
+
+ /* Adjust cursor position for tab replaced by spaces and 'lbr'. */
+ if (lnum == curwin->w_cursor.lnum)
+ {
+ curwin->w_cursor.col = bd.textcol + bd.startspaces;
+# ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+# endif
+ }
+
+ /* n == number of chars deleted
+ * If we delete a TAB, it may be replaced by several characters.
+ * Thus the number of characters may increase!
+ */
+ n = bd.textlen - bd.startspaces - bd.endspaces;
+ oldp = ml_get(lnum);
+ newp = alloc_check((unsigned)STRLEN(oldp) + 1 - n);
+ if (newp == NULL)
+ continue;
+ /* copy up to deleted part */
+ mch_memmove(newp, oldp, (size_t)bd.textcol);
+ /* insert spaces */
+ copy_spaces(newp + bd.textcol,
+ (size_t)(bd.startspaces + bd.endspaces));
+ /* copy the part after the deleted part */
+ oldp += bd.textcol + bd.textlen;
+ mch_memmove(newp + bd.textcol + bd.startspaces + bd.endspaces,
+ oldp, STRLEN(oldp) + 1);
+ /* replace the line */
+ ml_replace(lnum, newp, FALSE);
+ }
+
+ check_cursor_col();
+ changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col,
+ oap->end.lnum + 1, 0L);
+ oap->line_count = 0; /* no lines deleted */
+ }
+ else
+#endif
+ if (oap->motion_type == MLINE)
+ {
+ if (oap->op_type == OP_CHANGE)
+ {
+ /* Delete the lines except the first one. Temporarily move the
+ * cursor to the next line. Save the current line number, if the
+ * last line is deleted it may be changed.
+ */
+ if (oap->line_count > 1)
+ {
+ lnum = curwin->w_cursor.lnum;
+ ++curwin->w_cursor.lnum;
+ del_lines((long)(oap->line_count - 1), TRUE);
+ curwin->w_cursor.lnum = lnum;
+ }
+ if (u_save_cursor() == FAIL)
+ return FAIL;
+ if (curbuf->b_p_ai) /* don't delete indent */
+ {
+ beginline(BL_WHITE); /* cursor on first non-white */
+ did_ai = TRUE; /* delete the indent when ESC hit */
+ ai_col = curwin->w_cursor.col;
+ }
+ else
+ beginline(0); /* cursor in column 0 */
+ truncate_line(FALSE); /* delete the rest of the line */
+ /* leave cursor past last char in line */
+ if (oap->line_count > 1)
+ u_clearline(); /* "U" command not possible after "2cc" */
+ }
+ else
+ {
+ del_lines(oap->line_count, TRUE);
+ beginline(BL_WHITE | BL_FIX);
+ u_clearline(); /* "U" command not possible after "dd" */
+ }
+ }
+ else
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_op)
+ {
+ int endcol = 0;
+
+ /* For virtualedit: break the tabs that are partly included. */
+ if (gchar_pos(&oap->start) == '\t')
+ {
+ if (u_save_cursor() == FAIL) /* save first line for undo */
+ return FAIL;
+ if (oap->line_count == 1)
+ endcol = getviscol2(oap->end.col, oap->end.coladd);
+ coladvance_force(getviscol2(oap->start.col, oap->start.coladd));
+ oap->start = curwin->w_cursor;
+ if (oap->line_count == 1)
+ {
+ coladvance(endcol);
+ oap->end.col = curwin->w_cursor.col;
+ oap->end.coladd = curwin->w_cursor.coladd;
+ curwin->w_cursor = oap->start;
+ }
+ }
+
+ /* Break a tab only when it's included in the area. */
+ if (gchar_pos(&oap->end) == '\t'
+ && (int)oap->end.coladd < oap->inclusive)
+ {
+ /* save last line for undo */
+ if (u_save((linenr_T)(oap->end.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return FAIL;
+ curwin->w_cursor = oap->end;
+ coladvance_force(getviscol2(oap->end.col, oap->end.coladd));
+ oap->end = curwin->w_cursor;
+ curwin->w_cursor = oap->start;
+ }
+ }
+#endif
+
+ if (oap->line_count == 1) /* delete characters within one line */
+ {
+ if (u_save_cursor() == FAIL) /* save line for undo */
+ return FAIL;
+
+ /* if 'cpoptions' contains '$', display '$' at end of change */
+ if ( vim_strchr(p_cpo, CPO_DOLLAR) != NULL
+ && oap->op_type == OP_CHANGE
+ && oap->end.lnum == curwin->w_cursor.lnum
+#ifdef FEAT_VISUAL
+ && !oap->is_VIsual
+#endif
+ )
+ display_dollar(oap->end.col - !oap->inclusive);
+
+ n = oap->end.col - oap->start.col + 1 - !oap->inclusive;
+
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_op)
+ {
+ /* fix up things for virtualedit-delete:
+ * break the tabs which are going to get in our way
+ */
+ char_u *curline = ml_get_curline();
+ int len = (int)STRLEN(curline);
+
+ if (oap->end.coladd != 0
+ && (int)oap->end.col >= len - 1
+ && !(oap->start.coladd && (int)oap->end.col >= len - 1))
+ n++;
+ /* Delete at least one char (e.g, when on a control char). */
+ if (n == 0 && oap->start.coladd != oap->end.coladd)
+ n = 1;
+
+ /* When deleted a char in the line, reset coladd. */
+ if (gchar_cursor() != NUL)
+ curwin->w_cursor.coladd = 0;
+ }
+#endif
+ (void)del_bytes((long)n, restart_edit == NUL && !virtual_op);
+ }
+ else /* delete characters between lines */
+ {
+ pos_T curpos;
+
+ /* save deleted and changed lines for undo */
+ if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
+ (linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL)
+ return FAIL;
+
+ truncate_line(TRUE); /* delete from cursor to end of line */
+
+ curpos = curwin->w_cursor; /* remember curwin->w_cursor */
+ ++curwin->w_cursor.lnum;
+ del_lines((long)(oap->line_count - 2), FALSE);
+
+ /* delete from start of line until op_end */
+ curwin->w_cursor.col = 0;
+ (void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive),
+ restart_edit == NUL && !virtual_op);
+ curwin->w_cursor = curpos; /* restore curwin->w_cursor */
+
+ (void)do_join(FALSE);
+ }
+ }
+
+ msgmore(curbuf->b_ml.ml_line_count - old_lcount);
+
+#ifdef FEAT_VISUAL
+ if (oap->block_mode)
+ {
+ curbuf->b_op_end.lnum = oap->end.lnum;
+ curbuf->b_op_end.col = oap->start.col;
+ }
+ else
+#endif
+ curbuf->b_op_end = oap->start;
+ curbuf->b_op_start = oap->start;
+
+ return OK;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Adjust end of operating area for ending on a multi-byte character.
+ * Used for deletion.
+ */
+ static void
+mb_adjust_opend(oap)
+ oparg_T *oap;
+{
+ char_u *p;
+
+ if (oap->inclusive)
+ {
+ p = ml_get(oap->end.lnum);
+ oap->end.col += mb_tail_off(p, p + oap->end.col);
+ }
+}
+#endif
+
+#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+/*
+ * Replace a whole area with one character.
+ */
+ int
+op_replace(oap, c)
+ oparg_T *oap;
+ int c;
+{
+ int n, numc;
+#ifdef FEAT_MBYTE
+ int num_chars;
+#endif
+ char_u *newp, *oldp;
+ size_t oldlen;
+ struct block_def bd;
+
+ if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty)
+ return OK; /* nothing to do */
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ mb_adjust_opend(oap);
+#endif
+
+ if (u_save((linenr_T)(oap->start.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return FAIL;
+
+ /*
+ * block mode replace
+ */
+ if (oap->block_mode)
+ {
+ bd.is_MAX = (curwin->w_curswant == MAXCOL);
+ for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum)
+ {
+ block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE);
+ if (bd.textlen == 0 && (!virtual_op || bd.is_MAX))
+ continue; /* nothing to replace */
+
+ /* n == number of extra chars required
+ * If we split a TAB, it may be replaced by several characters.
+ * Thus the number of characters may increase!
+ */
+#ifdef FEAT_VIRTUALEDIT
+ /* If the range starts in virtual space, count the initial
+ * coladd offset as part of "startspaces" */
+ if (virtual_op && bd.is_short && *bd.textstart == NUL)
+ {
+ pos_T vpos;
+
+ getvpos(&vpos, oap->start_vcol);
+ bd.startspaces += vpos.coladd;
+ n = bd.startspaces;
+ }
+ else
+#endif
+ /* allow for pre spaces */
+ n = (bd.startspaces ? bd.start_char_vcols - 1 : 0);
+
+ /* allow for post spp */
+ n += (bd.endspaces
+#ifdef FEAT_VIRTUALEDIT
+ && !bd.is_oneChar
+#endif
+ && bd.end_char_vcols > 0) ? bd.end_char_vcols - 1 : 0;
+ /* Figure out how many characters to replace. */
+ numc = oap->end_vcol - oap->start_vcol + 1;
+ if (bd.is_short && (!virtual_op || bd.is_MAX))
+ numc -= (oap->end_vcol - bd.end_vcol) + 1;
+
+#ifdef FEAT_MBYTE
+ /* A double-wide character can be replaced only up to half the
+ * times. */
+ if ((*mb_char2cells)(c) > 1)
+ {
+ if ((numc & 1) && !bd.is_short)
+ {
+ ++bd.endspaces;
+ ++n;
+ }
+ numc = numc / 2;
+ }
+
+ /* Compute bytes needed, move character count to num_chars. */
+ num_chars = numc;
+ numc *= (*mb_char2len)(c);
+#endif
+ /* oldlen includes textlen, so don't double count */
+ n += numc - bd.textlen;
+
+ oldp = ml_get_curline();
+ oldlen = STRLEN(oldp);
+ newp = alloc_check((unsigned)oldlen + 1 + n);
+ if (newp == NULL)
+ continue;
+ vim_memset(newp, NUL, (size_t)(oldlen + 1 + n));
+ /* copy up to deleted part */
+ mch_memmove(newp, oldp, (size_t)bd.textcol);
+ oldp += bd.textcol + bd.textlen;
+ /* insert pre-spaces */
+ copy_spaces(newp + bd.textcol, (size_t)bd.startspaces);
+ /* insert replacement chars CHECK FOR ALLOCATED SPACE */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ n = STRLEN(newp);
+ while (--num_chars >= 0)
+ n += (*mb_char2bytes)(c, newp + n);
+ }
+ else
+#endif
+ copy_chars(newp + STRLEN(newp), (size_t)numc, c);
+ if (!bd.is_short)
+ {
+ /* insert post-spaces */
+ copy_spaces(newp + STRLEN(newp), (size_t)bd.endspaces);
+ /* copy the part after the changed part */
+ mch_memmove(newp + STRLEN(newp), oldp, STRLEN(oldp) + 1);
+ }
+ /* replace the line */
+ ml_replace(curwin->w_cursor.lnum, newp, FALSE);
+ }
+ }
+ else
+ {
+ /*
+ * MCHAR and MLINE motion replace.
+ */
+ if (oap->motion_type == MLINE)
+ {
+ oap->start.col = 0;
+ curwin->w_cursor.col = 0;
+ oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum));
+ if (oap->end.col)
+ --oap->end.col;
+ }
+ else if (!oap->inclusive)
+ dec(&(oap->end));
+
+ while (ltoreq(curwin->w_cursor, oap->end))
+ {
+ n = gchar_cursor();
+ if (n != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if ((*mb_char2len)(c) > 1 || (*mb_char2len)(n) > 1)
+ {
+ /* This is slow, but it handles replacing a single-byte
+ * with a multi-byte and the other way around. */
+ oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
+ n = State;
+ State = REPLACE;
+ ins_char(c);
+ State = n;
+ /* Backup to the replaced character. */
+ dec_cursor();
+ }
+ else
+#endif
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (n == TAB)
+ {
+ int end_vcol = 0;
+
+ if (curwin->w_cursor.lnum == oap->end.lnum)
+ {
+ /* oap->end has to be recalculated when
+ * the tab breaks */
+ end_vcol = getviscol2(oap->end.col,
+ oap->end.coladd);
+ }
+ coladvance_force(getviscol());
+ if (curwin->w_cursor.lnum == oap->end.lnum)
+ getvpos(&oap->end, end_vcol);
+ }
+#endif
+ pchar(curwin->w_cursor, c);
+ }
+ }
+#ifdef FEAT_VIRTUALEDIT
+ else if (virtual_op && curwin->w_cursor.lnum == oap->end.lnum)
+ {
+ int virtcols = oap->end.coladd;
+
+ if (curwin->w_cursor.lnum == oap->start.lnum
+ && oap->start.col == oap->end.col && oap->start.coladd)
+ virtcols -= oap->start.coladd;
+
+ /* oap->end has been trimmed so it's effectively inclusive;
+ * as a result an extra +1 must be counted so we don't
+ * trample the NUL byte. */
+ coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1);
+ curwin->w_cursor.col -= (virtcols + 1);
+ for (; virtcols >= 0; virtcols--)
+ {
+ pchar(curwin->w_cursor, c);
+ if (inc(&curwin->w_cursor) == -1)
+ break;
+ }
+ }
+#endif
+
+ /* Advance to next character, stop at the end of the file. */
+ if (inc_cursor() == -1)
+ break;
+ }
+ }
+
+ curwin->w_cursor = oap->start;
+ check_cursor();
+ changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, 0L);
+
+ /* Set "'[" and "']" marks. */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end = oap->end;
+
+ return OK;
+}
+#endif
+
+/*
+ * Handle the (non-standard vi) tilde operator. Also for "gu", "gU" and "g?".
+ */
+ void
+op_tilde(oap)
+ oparg_T *oap;
+{
+ pos_T pos;
+#ifdef FEAT_VISUAL
+ struct block_def bd;
+ int done;
+#endif
+ int did_change = 0;
+#ifdef FEAT_MBYTE
+ colnr_T col;
+#endif
+
+ if (u_save((linenr_T)(oap->start.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return;
+
+ pos = oap->start;
+#ifdef FEAT_VISUAL
+ if (oap->block_mode) /* Visual block mode */
+ {
+ for (; pos.lnum <= oap->end.lnum; ++pos.lnum)
+ {
+ block_prep(oap, &bd, pos.lnum, FALSE);
+ pos.col = bd.textcol;
+ for (done = 0; done < bd.textlen; ++done)
+ {
+ did_change |= swapchar(oap->op_type, &pos);
+# ifdef FEAT_MBYTE
+ col = pos.col + 1;
+# endif
+ if (inc(&pos) == -1) /* at end of file */
+ break;
+# ifdef FEAT_MBYTE
+ if (pos.col > col)
+ /* Count extra bytes of a multi-byte character. */
+ done += pos.col - col;
+# endif
+ }
+# ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans && did_change)
+ {
+ char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
+
+ netbeans_inserted(curbuf, pos.lnum, bd.textcol,
+ bd.textlen, &ptr[bd.textcol], bd.textlen);
+ }
+# endif
+ }
+ if (did_change)
+ changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L);
+ }
+ else /* not block mode */
+#endif
+ {
+ if (oap->motion_type == MLINE)
+ {
+ oap->start.col = 0;
+ pos.col = 0;
+ oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum));
+ if (oap->end.col)
+ --oap->end.col;
+ }
+ else if (!oap->inclusive)
+ dec(&(oap->end));
+
+ while (ltoreq(pos, oap->end))
+ {
+ did_change |= swapchar(oap->op_type, &pos);
+ if (inc(&pos) == -1) /* at end of file */
+ break;
+ }
+ if (did_change)
+ {
+ changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1,
+ 0L);
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans && did_change)
+ {
+ char_u *ptr;
+ int count;
+
+ pos = oap->start;
+ while (pos.lnum < oap->end.lnum)
+ {
+ ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
+ count = STRLEN(ptr) - pos.col;
+ netbeans_inserted(curbuf, pos.lnum, pos.col,
+ count, &ptr[pos.col], count);
+ pos.col = 0;
+ pos.lnum++;
+ }
+ ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
+ count = oap->end.col - pos.col + 1;
+ netbeans_inserted(curbuf, pos.lnum, pos.col,
+ count, &ptr[pos.col], count);
+ }
+#endif
+ }
+ }
+
+#ifdef FEAT_VISUAL
+ if (!did_change && oap->is_VIsual)
+ /* No change: need to remove the Visual selection */
+ redraw_curbuf_later(INVERTED);
+#endif
+
+ /*
+ * Set '[ and '] marks.
+ */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end = oap->end;
+
+ if (oap->line_count > p_report)
+ {
+ if (oap->line_count == 1)
+ MSG(_("1 line changed"));
+ else
+ smsg((char_u *)_("%ld lines changed"), oap->line_count);
+ }
+}
+
+/*
+ * If op_type == OP_UPPER: make uppercase,
+ * if op_type == OP_LOWER: make lowercase,
+ * if op_type == OP_ROT13: do rot13 encoding,
+ * else swap case of character at 'pos'
+ * returns TRUE when something actually changed.
+ */
+ int
+swapchar(op_type, pos)
+ int op_type;
+ pos_T *pos;
+{
+ int c;
+ int nc;
+
+ c = gchar_pos(pos);
+
+ /* Only do rot13 encoding for ASCII characters. */
+ if (c >= 0x80 && op_type == OP_ROT13)
+ return FALSE;
+
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && c >= 0x100) /* No lower/uppercase letter */
+ return FALSE;
+#endif
+ nc = c;
+ if (MB_ISLOWER(c))
+ {
+ if (op_type == OP_ROT13)
+ nc = ROT13(c, 'a');
+ else if (op_type != OP_LOWER)
+ nc = MB_TOUPPER(c);
+ }
+ else if (MB_ISUPPER(c))
+ {
+ if (op_type == OP_ROT13)
+ nc = ROT13(c, 'A');
+ else if (op_type != OP_UPPER)
+ nc = MB_TOLOWER(c);
+ }
+ if (nc != c)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && (c >= 0x80 || nc >= 0x80))
+ {
+ pos_T sp = curwin->w_cursor;
+
+ curwin->w_cursor = *pos;
+ del_char(FALSE);
+ ins_char(nc);
+ curwin->w_cursor = sp;
+ }
+ else
+#endif
+ pchar(*pos, nc);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+/*
+ * op_insert - Insert and append operators for Visual mode.
+ */
+ void
+op_insert(oap, count1)
+ oparg_T *oap;
+ long count1;
+{
+ long ins_len, pre_textlen = 0;
+ char_u *firstline, *ins_text;
+ struct block_def bd;
+ int i;
+
+ /* edit() changes this - record it for OP_APPEND */
+ bd.is_MAX = (curwin->w_curswant == MAXCOL);
+
+ /* vis block is still marked. Get rid of it now. */
+ curwin->w_cursor.lnum = oap->start.lnum;
+ update_screen(INVERTED);
+
+ if (oap->block_mode)
+ {
+#ifdef FEAT_VIRTUALEDIT
+ /* When 'virtualedit' is used, need to insert the extra spaces before
+ * doing block_prep(). When only "block" is used, virtual edit is
+ * already disabled, but still need it when calling
+ * coladvance_force(). */
+ if (curwin->w_cursor.coladd > 0)
+ {
+ int old_ve_flags = ve_flags;
+
+ ve_flags = VE_ALL;
+ if (u_save_cursor() == FAIL)
+ return;
+ coladvance_force(oap->op_type == OP_APPEND
+ ? oap->end_vcol + 1 : getviscol());
+ if (oap->op_type == OP_APPEND)
+ --curwin->w_cursor.col;
+ ve_flags = old_ve_flags;
+ }
+#endif
+ /* Get the info about the block before entering the text */
+ block_prep(oap, &bd, oap->start.lnum, TRUE);
+ firstline = ml_get(oap->start.lnum) + bd.textcol;
+ if (oap->op_type == OP_APPEND)
+ firstline += bd.textlen;
+ pre_textlen = (long)STRLEN(firstline);
+ }
+
+ if (oap->op_type == OP_APPEND)
+ {
+ if (oap->block_mode
+#ifdef FEAT_VIRTUALEDIT
+ && curwin->w_cursor.coladd == 0
+#endif
+ )
+ {
+ /* Move the cursor to the character right of the block. */
+ curwin->w_set_curswant = TRUE;
+ while (*ml_get_cursor() != NUL
+ && (curwin->w_cursor.col < bd.textcol + bd.textlen))
+ ++curwin->w_cursor.col;
+ if (bd.is_short && !bd.is_MAX)
+ {
+ /* First line was too short, make it longer and adjust the
+ * values in "bd". */
+ if (u_save_cursor() == FAIL)
+ return;
+ for (i = 0; i < bd.endspaces; ++i)
+ ins_char(' ');
+ bd.textlen += bd.endspaces;
+ }
+ }
+ else
+ {
+ curwin->w_cursor = oap->end;
+
+ /* Works just like an 'i'nsert on the next character. */
+ if (!lineempty(curwin->w_cursor.lnum)
+ && oap->start_vcol != oap->end_vcol)
+ inc_cursor();
+ }
+ }
+
+ edit(NUL, FALSE, (linenr_T)count1);
+
+ /* if user has moved off this line, we don't know what to do, so do
+ * nothing */
+ if (curwin->w_cursor.lnum != oap->start.lnum)
+ return;
+
+ if (oap->block_mode)
+ {
+ struct block_def bd2;
+
+ /*
+ * Spaces and tabs in the indent may have changed to other spaces and
+ * tabs. Get the starting column again and correct the lenght.
+ * Don't do this when "$" used, end-of-line will have changed.
+ */
+ block_prep(oap, &bd2, oap->start.lnum, TRUE);
+ if (!bd.is_MAX || bd2.textlen < bd.textlen)
+ {
+ if (oap->op_type == OP_APPEND)
+ {
+ pre_textlen += bd2.textlen - bd.textlen;
+ if (bd2.endspaces)
+ --bd2.textlen;
+ }
+ bd.textcol = bd2.textcol;
+ bd.textlen = bd2.textlen;
+ }
+
+ /*
+ * Subsequent calls to ml_get() flush the firstline data - take a
+ * copy of the required string.
+ */
+ firstline = ml_get(oap->start.lnum) + bd.textcol;
+ if (oap->op_type == OP_APPEND)
+ firstline += bd.textlen;
+ if ((ins_len = (long)STRLEN(firstline) - pre_textlen) > 0)
+ {
+ ins_text = vim_strnsave(firstline, (int)ins_len);
+ if (ins_text != NULL)
+ {
+ /* block handled here */
+ if (u_save(oap->start.lnum,
+ (linenr_T)(oap->end.lnum + 1)) == OK)
+ block_insert(oap, ins_text, (oap->op_type == OP_INSERT),
+ &bd);
+
+ curwin->w_cursor.col = oap->start.col;
+ check_cursor();
+ vim_free(ins_text);
+ }
+ }
+ }
+}
+#endif
+
+/*
+ * op_change - handle a change operation
+ *
+ * return TRUE if edit() returns because of a CTRL-O command
+ */
+ int
+op_change(oap)
+ oparg_T *oap;
+{
+ colnr_T l;
+ int retval;
+#ifdef FEAT_VISUALEXTRA
+ long offset;
+ linenr_T linenr;
+ long ins_len, pre_textlen = 0;
+ char_u *firstline;
+ char_u *ins_text, *newp, *oldp;
+ struct block_def bd;
+#endif
+
+ l = oap->start.col;
+ if (oap->motion_type == MLINE)
+ {
+ l = 0;
+#ifdef FEAT_SMARTINDENT
+ if (!p_paste && curbuf->b_p_si
+# ifdef FEAT_CINDENT
+ && !curbuf->b_p_cin
+# endif
+ )
+ can_si = TRUE; /* It's like opening a new line, do si */
+#endif
+ }
+
+ /* First delete the text in the region. In an empty buffer only need to
+ * save for undo */
+ if (curbuf->b_ml.ml_flags & ML_EMPTY)
+ {
+ if (u_save_cursor() == FAIL)
+ return FALSE;
+ }
+ else if (op_delete(oap) == FAIL)
+ return FALSE;
+
+ if ((l > curwin->w_cursor.col) && !lineempty(curwin->w_cursor.lnum)
+ && !virtual_op)
+ inc_cursor();
+
+#ifdef FEAT_VISUALEXTRA
+ /* check for still on same line (<CR> in inserted text meaningless) */
+ /* skip blank lines too */
+ if (oap->block_mode)
+ {
+# ifdef FEAT_VIRTUALEDIT
+ /* Add spaces before getting the current line length. */
+ if (virtual_op && (curwin->w_cursor.coladd > 0
+ || gchar_cursor() == NUL))
+ coladvance_force(getviscol());
+# endif
+ pre_textlen = (long)STRLEN(ml_get(oap->start.lnum));
+ bd.textcol = curwin->w_cursor.col;
+ }
+#endif
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT)
+ if (oap->motion_type == MLINE)
+ fix_indent();
+#endif
+
+ retval = edit(NUL, FALSE, (linenr_T)1);
+
+#ifdef FEAT_VISUALEXTRA
+ /*
+ * In Visual block mode, handle copying the next text to all lines of the
+ * block.
+ */
+ if (oap->block_mode && oap->start.lnum != oap->end.lnum)
+ {
+ firstline = ml_get(oap->start.lnum);
+ /*
+ * Subsequent calls to ml_get() flush the firstline data - take a
+ * copy of the required bit.
+ */
+ if ((ins_len = (long)STRLEN(firstline) - pre_textlen) > 0)
+ {
+ if ((ins_text = alloc_check((unsigned)(ins_len + 1))) != NULL)
+ {
+ STRNCPY(ins_text, firstline + bd.textcol, ins_len);
+ ins_text[ins_len] = NUL;
+ for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum;
+ linenr++)
+ {
+ block_prep(oap, &bd, linenr, TRUE);
+ if (!bd.is_short || virtual_op)
+ {
+# ifdef FEAT_VIRTUALEDIT
+ pos_T vpos;
+
+ /* If the block starts in virtual space, count the
+ * initial coladd offset as part of "startspaces" */
+ if (bd.is_short)
+ {
+ linenr_T lnum = curwin->w_cursor.lnum;
+
+ curwin->w_cursor.lnum = linenr;
+ (void)getvpos(&vpos, oap->start_vcol);
+ curwin->w_cursor.lnum = lnum;
+ }
+ else
+ vpos.coladd = 0;
+# endif
+ oldp = ml_get(linenr);
+ newp = alloc_check((unsigned)(STRLEN(oldp)
+# ifdef FEAT_VIRTUALEDIT
+ + vpos.coladd
+# endif
+ + ins_len + 1));
+ if (newp == NULL)
+ continue;
+ /* copy up to block start */
+ mch_memmove(newp, oldp, (size_t)bd.textcol);
+ offset = bd.textcol;
+# ifdef FEAT_VIRTUALEDIT
+ copy_spaces(newp + offset, (size_t)vpos.coladd);
+ offset += vpos.coladd;
+# endif
+ mch_memmove(newp + offset, ins_text, (size_t)ins_len);
+ offset += ins_len;
+ oldp += bd.textcol;
+ mch_memmove(newp + offset, oldp, STRLEN(oldp) + 1);
+ ml_replace(linenr, newp, FALSE);
+ }
+ }
+ check_cursor();
+
+ changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L);
+ }
+ vim_free(ins_text);
+ }
+ }
+#endif
+
+ return retval;
+}
+
+/*
+ * set all the yank registers to empty (called from main())
+ */
+ void
+init_yank()
+{
+ int i;
+
+ for (i = 0; i < NUM_REGISTERS; ++i)
+ y_regs[i].y_array = NULL;
+}
+
+/*
+ * Free "n" lines from the current yank register.
+ * Called for normal freeing and in case of error.
+ */
+ static void
+free_yank(n)
+ long n;
+{
+ if (y_current->y_array != NULL)
+ {
+ long i;
+
+ for (i = n; --i >= 0; )
+ {
+#ifdef AMIGA /* only for very slow machines */
+ if ((i & 1023) == 1023) /* this may take a while */
+ {
+ /*
+ * This message should never cause a hit-return message.
+ * Overwrite this message with any next message.
+ */
+ ++no_wait_return;
+ smsg((char_u *)_("freeing %ld lines"), i + 1);
+ --no_wait_return;
+ msg_didout = FALSE;
+ msg_col = 0;
+ }
+#endif
+ vim_free(y_current->y_array[i]);
+ }
+ vim_free(y_current->y_array);
+ y_current->y_array = NULL;
+#ifdef AMIGA
+ if (n >= 1000)
+ MSG("");
+#endif
+ }
+}
+
+ static void
+free_yank_all()
+{
+ free_yank(y_current->y_size);
+}
+
+/*
+ * Yank the text between "oap->start" and "oap->end" into a yank register.
+ * If we are to append (uppercase register), we first yank into a new yank
+ * register and then concatenate the old and the new one (so we keep the old
+ * one in case of out-of-memory).
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+op_yank(oap, deleting, mess)
+ oparg_T *oap;
+ int deleting;
+ int mess;
+{
+ long y_idx; /* index in y_array[] */
+ struct yankreg *curr; /* copy of y_current */
+ struct yankreg newreg; /* new yank register when appending */
+ char_u **new_ptr;
+ linenr_T lnum; /* current line number */
+ long j;
+ int yanktype = oap->motion_type;
+ long yanklines = oap->line_count;
+ linenr_T yankendlnum = oap->end.lnum;
+ char_u *p;
+ char_u *pnew;
+ struct block_def bd;
+
+ /* check for read-only register */
+ if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE))
+ {
+ beep_flush();
+ return FAIL;
+ }
+ if (oap->regname == '_') /* black hole: nothing to do */
+ return OK;
+
+#ifdef FEAT_CLIPBOARD
+ if (!clip_star.available && oap->regname == '*')
+ oap->regname = 0;
+ else if (!clip_plus.available && oap->regname == '+')
+ oap->regname = 0;
+#endif
+
+ if (!deleting) /* op_delete() already set y_current */
+ get_yank_register(oap->regname, TRUE);
+
+ curr = y_current;
+ /* append to existing contents */
+ if (y_append && y_current->y_array != NULL)
+ y_current = &newreg;
+ else
+ free_yank_all(); /* free previously yanked lines */
+
+/*
+ * If the cursor was in column 1 before and after the movement, and the
+ * operator is not inclusive, the yank is always linewise.
+ */
+ if ( oap->motion_type == MCHAR
+ && oap->start.col == 0
+ && !oap->inclusive
+#ifdef FEAT_VISUAL
+ && (!oap->is_VIsual || *p_sel == 'o')
+#endif
+ && oap->end.col == 0
+ && yanklines > 1)
+ {
+ yanktype = MLINE;
+ --yankendlnum;
+ --yanklines;
+ }
+
+ y_current->y_size = yanklines;
+ y_current->y_type = yanktype; /* set the yank register type */
+#ifdef FEAT_VISUAL
+ y_current->y_width = 0;
+#endif
+ y_current->y_array = (char_u **)lalloc_clear((long_u)(sizeof(char_u *) *
+ yanklines), TRUE);
+
+ if (y_current->y_array == NULL)
+ {
+ y_current = curr;
+ return FAIL;
+ }
+
+ y_idx = 0;
+ lnum = oap->start.lnum;
+
+#ifdef FEAT_VISUAL
+ if (oap->block_mode)
+ {
+ /* Visual block mode */
+ y_current->y_type = MBLOCK; /* set the yank register type */
+ y_current->y_width = oap->end_vcol - oap->start_vcol;
+
+ if (curwin->w_curswant == MAXCOL && y_current->y_width > 0)
+ y_current->y_width--;
+ }
+#endif
+
+ for ( ; lnum <= yankendlnum; lnum++, y_idx++)
+ {
+ switch (y_current->y_type)
+ {
+#ifdef FEAT_VISUAL
+ case MBLOCK:
+ block_prep(oap, &bd, lnum, FALSE);
+ if (yank_copy_line(&bd, y_idx) == FAIL)
+ goto fail;
+ break;
+#endif
+
+ case MLINE:
+ if ((y_current->y_array[y_idx] =
+ vim_strsave(ml_get(lnum))) == NULL)
+ goto fail;
+ break;
+
+ case MCHAR:
+ {
+ colnr_T startcol = 0, endcol = MAXCOL;
+#ifdef FEAT_VIRTUALEDIT
+ int is_oneChar = FALSE;
+ colnr_T cs, ce;
+#endif
+ p = ml_get(lnum);
+ bd.startspaces = 0;
+ bd.endspaces = 0;
+
+ if (lnum == oap->start.lnum)
+ {
+ startcol = oap->start.col;
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_op)
+ {
+ getvcol(curwin, &oap->start, &cs, NULL, &ce);
+ if (ce != cs && oap->start.coladd > 0)
+ {
+ /* Part of a tab selected -- but don't
+ * double-count it. */
+ bd.startspaces = (ce - cs + 1)
+ - oap->start.coladd;
+ startcol++;
+ }
+ }
+#endif
+ }
+
+ if (lnum == oap->end.lnum)
+ {
+ endcol = oap->end.col;
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_op)
+ {
+ getvcol(curwin, &oap->end, &cs, NULL, &ce);
+ if (p[endcol] == NUL || (cs + oap->end.coladd < ce
+# ifdef FEAT_MBYTE
+ /* Don't add space for double-wide
+ * char; endcol will be on last byte
+ * of multi-byte char. */
+ && (*mb_head_off)(p, p + endcol) == 0
+# endif
+ ))
+ {
+ if (oap->start.lnum == oap->end.lnum
+ && oap->start.col == oap->end.col)
+ {
+ /* Special case: inside a single char */
+ is_oneChar = TRUE;
+ bd.startspaces = oap->end.coladd
+ - oap->start.coladd + oap->inclusive;
+ endcol = startcol;
+ }
+ else
+ {
+ bd.endspaces = oap->end.coladd
+ + oap->inclusive;
+ endcol -= oap->inclusive;
+ }
+ }
+ }
+#endif
+ }
+ if (startcol > endcol
+#ifdef FEAT_VIRTUALEDIT
+ || is_oneChar
+#endif
+ )
+ bd.textlen = 0;
+ else
+ {
+ if (endcol == MAXCOL)
+ endcol = STRLEN(p);
+ bd.textlen = endcol - startcol + oap->inclusive;
+ }
+ bd.textstart = p + startcol;
+ if (yank_copy_line(&bd, y_idx) == FAIL)
+ goto fail;
+ break;
+ }
+ /* NOTREACHED */
+ }
+ }
+
+ if (curr != y_current) /* append the new block to the old block */
+ {
+ new_ptr = (char_u **)lalloc((long_u)(sizeof(char_u *) *
+ (curr->y_size + y_current->y_size)), TRUE);
+ if (new_ptr == NULL)
+ goto fail;
+ for (j = 0; j < curr->y_size; ++j)
+ new_ptr[j] = curr->y_array[j];
+ vim_free(curr->y_array);
+ curr->y_array = new_ptr;
+
+ if (yanktype == MLINE) /* MLINE overrides MCHAR and MBLOCK */
+ curr->y_type = MLINE;
+
+ /* concatenate the last line of the old block with the first line of
+ * the new block */
+ if (curr->y_type == MCHAR)
+ {
+ pnew = lalloc((long_u)(STRLEN(curr->y_array[curr->y_size - 1])
+ + STRLEN(y_current->y_array[0]) + 1), TRUE);
+ if (pnew == NULL)
+ {
+ y_idx = y_current->y_size - 1;
+ goto fail;
+ }
+ STRCPY(pnew, curr->y_array[--j]);
+ STRCAT(pnew, y_current->y_array[0]);
+ vim_free(curr->y_array[j]);
+ vim_free(y_current->y_array[0]);
+ curr->y_array[j++] = pnew;
+ y_idx = 1;
+ }
+ else
+ y_idx = 0;
+ while (y_idx < y_current->y_size)
+ curr->y_array[j++] = y_current->y_array[y_idx++];
+ curr->y_size = j;
+ vim_free(y_current->y_array);
+ y_current = curr;
+ }
+ if (mess) /* Display message about yank? */
+ {
+ if (yanktype == MCHAR
+#ifdef FEAT_VISUAL
+ && !oap->block_mode
+#endif
+ && yanklines == 1)
+ yanklines = 0;
+ /* Some versions of Vi use ">=" here, some don't... */
+ if (yanklines > p_report)
+ {
+ /* redisplay now, so message is not deleted */
+ update_topline_redraw();
+ if (yanklines == 1)
+ MSG(_("1 line yanked"));
+ else
+ smsg((char_u *)_("%ld lines yanked"), yanklines);
+ }
+ }
+
+ /*
+ * Set "'[" and "']" marks.
+ */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end = oap->end;
+
+#ifdef FEAT_CLIPBOARD
+ /*
+ * If we were yanking to the '*' register, send result to clipboard.
+ * If no register was specified, and "unnamed" in 'clipboard', make a copy
+ * to the '*' register.
+ */
+ if (clip_star.available
+ && (curr == &(y_regs[STAR_REGISTER])
+ || (!deleting && oap->regname == 0 && clip_unnamed)))
+ {
+ if (curr != &(y_regs[STAR_REGISTER]))
+ /* Copy the text from register 0 to the clipboard register. */
+ copy_yank_reg(&(y_regs[STAR_REGISTER]));
+
+ clip_own_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+
+# ifdef FEAT_X11
+ /*
+ * If we were yanking to the '+' register, send result to selection.
+ * Also copy to the '*' register, in case auto-select is off.
+ */
+ else if (clip_plus.available && curr == &(y_regs[PLUS_REGISTER]))
+ {
+ /* No need to copy to * register upon 'unnamed' now - see below */
+ clip_own_selection(&clip_plus);
+ clip_gen_set_selection(&clip_plus);
+ if (!clip_isautosel())
+ {
+ copy_yank_reg(&(y_regs[STAR_REGISTER]));
+ clip_own_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+ }
+# endif
+#endif
+
+ return OK;
+
+fail: /* free the allocated lines */
+ free_yank(y_idx + 1);
+ y_current = curr;
+ return FAIL;
+}
+
+ static int
+yank_copy_line(bd, y_idx)
+ struct block_def *bd;
+ long y_idx;
+{
+ char_u *pnew;
+
+ if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1))
+ == NULL)
+ return FAIL;
+ y_current->y_array[y_idx] = pnew;
+ copy_spaces(pnew, (size_t)bd->startspaces);
+ pnew += bd->startspaces;
+ mch_memmove(pnew, bd->textstart, (size_t)bd->textlen);
+ pnew += bd->textlen;
+ copy_spaces(pnew, (size_t)bd->endspaces);
+ pnew += bd->endspaces;
+ *pnew = NUL;
+ return OK;
+}
+
+#ifdef FEAT_CLIPBOARD
+/*
+ * Make a copy of the y_current register to register "reg".
+ */
+ static void
+copy_yank_reg(reg)
+ struct yankreg *reg;
+{
+ struct yankreg *curr = y_current;
+ long j;
+
+ y_current = reg;
+ free_yank_all();
+ *y_current = *curr;
+ y_current->y_array = (char_u **)lalloc_clear(
+ (long_u)(sizeof(char_u *) * y_current->y_size), TRUE);
+ if (y_current->y_array == NULL)
+ y_current->y_size = 0;
+ else
+ for (j = 0; j < y_current->y_size; ++j)
+ if ((y_current->y_array[j] = vim_strsave(curr->y_array[j])) == NULL)
+ {
+ free_yank(j);
+ y_current->y_size = 0;
+ break;
+ }
+ y_current = curr;
+}
+#endif
+
+/*
+ * put contents of register "regname" into the text
+ * flags: PUT_FIXINDENT make indent look nice
+ * PUT_CURSEND leave cursor after end of new text
+ * PUT_LINE force linewise put (":put")
+ */
+ void
+do_put(regname, dir, count, flags)
+ int regname;
+ int dir; /* BACKWARD for 'P', FORWARD for 'p' */
+ long count;
+ int flags;
+{
+ char_u *ptr;
+ char_u *newp, *oldp;
+ int yanklen;
+ int totlen = 0; /* init for gcc */
+ linenr_T lnum;
+ colnr_T col;
+ long i; /* index in y_array[] */
+ int y_type;
+ long y_size;
+#ifdef FEAT_VISUAL
+ int oldlen;
+ long y_width = 0;
+ colnr_T vcol;
+ int delcount;
+ int incr = 0;
+ long j;
+ struct block_def bd;
+#endif
+ char_u **y_array = NULL;
+ long nr_lines = 0;
+ pos_T new_cursor;
+ int indent;
+ int orig_indent = 0; /* init for gcc */
+ int indent_diff = 0; /* init for gcc */
+ int first_indent = TRUE;
+ int lendiff = 0;
+ pos_T old_pos;
+ char_u *insert_string = NULL;
+ int allocated = FALSE;
+ long cnt;
+
+#ifdef FEAT_CLIPBOARD
+ /* Adjust register name for "unnamed" in 'clipboard'. */
+ adjust_clip_reg(&regname);
+ (void)may_get_selection(regname);
+#endif
+
+ if (flags & PUT_FIXINDENT)
+ orig_indent = get_indent();
+
+ curbuf->b_op_start = curwin->w_cursor; /* default for '[ mark */
+ curbuf->b_op_end = curwin->w_cursor; /* default for '] mark */
+
+ /*
+ * Using inserted text works differently, because the register includes
+ * special characters (newlines, etc.).
+ */
+ if (regname == '.')
+ {
+ (void)stuff_inserted((dir == FORWARD ? (count == -1 ? 'o' : 'a') :
+ (count == -1 ? 'O' : 'i')), count, FALSE);
+ /* Putting the text is done later, so can't really move the cursor to
+ * the next character. Use "l" to simulate it. */
+ if ((flags & PUT_CURSEND) && gchar_cursor() != NUL)
+ stuffcharReadbuff('l');
+ return;
+ }
+
+ /*
+ * For special registers '%' (file name), '#' (alternate file name) and
+ * ':' (last command line), etc. we have to create a fake yank register.
+ */
+ if (get_spec_reg(regname, &insert_string, &allocated, TRUE))
+ {
+ if (insert_string == NULL)
+ return;
+ }
+
+ if (insert_string != NULL)
+ {
+ y_type = MCHAR;
+#ifdef FEAT_EVAL
+ if (regname == '=')
+ {
+ /* For the = register we need to split the string at NL
+ * characters. */
+ /* Loop twice: count the number of lines and save them. */
+ for (;;)
+ {
+ y_size = 0;
+ ptr = insert_string;
+ while (ptr != NULL)
+ {
+ if (y_array != NULL)
+ y_array[y_size] = ptr;
+ ++y_size;
+ ptr = vim_strchr(ptr, '\n');
+ if (ptr != NULL)
+ {
+ if (y_array != NULL)
+ *ptr = NUL;
+ ++ptr;
+ /* A trailing '\n' makes the string linewise */
+ if (*ptr == NUL)
+ {
+ y_type = MLINE;
+ break;
+ }
+ }
+ }
+ if (y_array != NULL)
+ break;
+ y_array = (char_u **)alloc((unsigned)
+ (y_size * sizeof(char_u *)));
+ if (y_array == NULL)
+ goto end;
+ }
+ }
+ else
+#endif
+ {
+ y_size = 1; /* use fake one-line yank register */
+ y_array = &insert_string;
+ }
+ }
+ else
+ {
+ get_yank_register(regname, FALSE);
+
+ y_type = y_current->y_type;
+#ifdef FEAT_VISUAL
+ y_width = y_current->y_width;
+#endif
+ y_size = y_current->y_size;
+ y_array = y_current->y_array;
+ }
+
+#ifdef FEAT_VISUAL
+ if (y_type == MLINE)
+ {
+ if (flags & PUT_LINE_SPLIT)
+ {
+ /* "p" or "P" in Visual mode: split the lines to put the text in
+ * between. */
+ if (u_save_cursor() == FAIL)
+ goto end;
+ ptr = vim_strsave(ml_get_cursor());
+ if (ptr == NULL)
+ goto end;
+ ml_append(curwin->w_cursor.lnum, ptr, (colnr_T)0, FALSE);
+ vim_free(ptr);
+
+ ptr = vim_strnsave(ml_get_curline(), curwin->w_cursor.col);
+ if (ptr == NULL)
+ goto end;
+ ml_replace(curwin->w_cursor.lnum, ptr, FALSE);
+ ++nr_lines;
+ dir = FORWARD;
+ }
+ if (flags & PUT_LINE_FORWARD)
+ {
+ /* Must be "p" for a Visual block, put lines below the block. */
+ curwin->w_cursor = curbuf->b_visual_end;
+ dir = FORWARD;
+ }
+ curbuf->b_op_start = curwin->w_cursor; /* default for '[ mark */
+ curbuf->b_op_end = curwin->w_cursor; /* default for '] mark */
+ }
+#endif
+
+ if (flags & PUT_LINE) /* :put command or "p" in Visual line mode. */
+ y_type = MLINE;
+
+ if (y_size == 0 || y_array == NULL)
+ {
+ EMSG2(_("E353: Nothing in register %s"),
+ regname == 0 ? (char_u *)"\"" : transchar(regname));
+ goto end;
+ }
+
+#ifdef FEAT_VISUAL
+ if (y_type == MBLOCK)
+ {
+ lnum = curwin->w_cursor.lnum + y_size + 1;
+ if (lnum > curbuf->b_ml.ml_line_count)
+ lnum = curbuf->b_ml.ml_line_count + 1;
+ if (u_save(curwin->w_cursor.lnum - 1, lnum) == FAIL)
+ goto end;
+ }
+ else
+#endif
+ if (y_type == MLINE)
+ {
+ lnum = curwin->w_cursor.lnum;
+#ifdef FEAT_FOLDING
+ /* Correct line number for closed fold. Don't move the cursor yet,
+ * u_save() uses it. */
+ if (dir == BACKWARD)
+ (void)hasFolding(lnum, &lnum, NULL);
+ else
+ (void)hasFolding(lnum, NULL, &lnum);
+#endif
+ if (dir == FORWARD)
+ ++lnum;
+ if (u_save(lnum - 1, lnum) == FAIL)
+ goto end;
+#ifdef FEAT_FOLDING
+ if (dir == FORWARD)
+ curwin->w_cursor.lnum = lnum - 1;
+ else
+ curwin->w_cursor.lnum = lnum;
+ curbuf->b_op_start = curwin->w_cursor; /* for mark_adjust() */
+#endif
+ }
+ else if (u_save_cursor() == FAIL)
+ goto end;
+
+ yanklen = (int)STRLEN(y_array[0]);
+
+#ifdef FEAT_VIRTUALEDIT
+ if (ve_flags == VE_ALL && y_type == MCHAR)
+ {
+ if (gchar_cursor() == TAB)
+ {
+ /* Don't need to insert spaces when "p" on the last position of a
+ * tab or "P" on the first position. */
+ if (dir == FORWARD
+ ? (int)curwin->w_cursor.coladd < curbuf->b_p_ts - 1
+ : curwin->w_cursor.coladd > 0)
+ coladvance_force(getviscol());
+ else
+ curwin->w_cursor.coladd = 0;
+ }
+ else if (curwin->w_cursor.coladd > 0 || gchar_cursor() == NUL)
+ coladvance_force(getviscol() + (dir == FORWARD));
+ }
+#endif
+
+ lnum = curwin->w_cursor.lnum;
+ col = curwin->w_cursor.col;
+
+#ifdef FEAT_VISUAL
+ /*
+ * Block mode
+ */
+ if (y_type == MBLOCK)
+ {
+ char c = gchar_cursor();
+ colnr_T endcol2 = 0;
+
+ if (dir == FORWARD && c != NUL)
+ {
+#ifdef FEAT_VIRTUALEDIT
+ if (ve_flags == VE_ALL)
+ getvcol(curwin, &curwin->w_cursor, &col, NULL, &endcol2);
+ else
+#endif
+ getvcol(curwin, &curwin->w_cursor, NULL, NULL, &col);
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ /* move to start of next multi-byte character */
+ curwin->w_cursor.col += (*mb_ptr2len_check)(ml_get_cursor());
+ else
+#endif
+#ifdef FEAT_VIRTUALEDIT
+ if (c != TAB || ve_flags != VE_ALL)
+#endif
+ ++curwin->w_cursor.col;
+ ++col;
+ }
+ else
+ getvcol(curwin, &curwin->w_cursor, &col, NULL, &endcol2);
+
+#ifdef FEAT_VIRTUALEDIT
+ col += curwin->w_cursor.coladd;
+ if (ve_flags == VE_ALL && curwin->w_cursor.coladd > 0)
+ {
+ if (dir == FORWARD && c == NUL)
+ ++col;
+ if (dir != FORWARD && c != NUL)
+ ++curwin->w_cursor.col;
+ if (c == TAB)
+ {
+ if (dir == BACKWARD && curwin->w_cursor.col)
+ curwin->w_cursor.col--;
+ if (dir == FORWARD && col - 1 == endcol2)
+ curwin->w_cursor.col++;
+ }
+ }
+ curwin->w_cursor.coladd = 0;
+#endif
+ for (i = 0; i < y_size; ++i)
+ {
+ int spaces;
+ char shortline;
+
+ bd.startspaces = 0;
+ bd.endspaces = 0;
+ bd.textcol = 0;
+ vcol = 0;
+ delcount = 0;
+
+ /* add a new line */
+ if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ {
+ if (ml_append(curbuf->b_ml.ml_line_count, (char_u *)"",
+ (colnr_T)1, FALSE) == FAIL)
+ break;
+ ++nr_lines;
+ }
+ /* get the old line and advance to the position to insert at */
+ oldp = ml_get_curline();
+ oldlen = (int)STRLEN(oldp);
+ for (ptr = oldp; vcol < col && *ptr; )
+ {
+ /* Count a tab for what it's worth (if list mode not on) */
+ incr = lbr_chartabsize_adv(&ptr, (colnr_T)vcol);
+ vcol += incr;
+ }
+ bd.textcol = (colnr_T)(ptr - oldp);
+
+ shortline = (vcol < col) || (vcol == col && !*ptr) ;
+
+ if (vcol < col) /* line too short, padd with spaces */
+ bd.startspaces = col - vcol;
+ else if (vcol > col)
+ {
+ bd.endspaces = vcol - col;
+ bd.startspaces = incr - bd.endspaces;
+ --bd.textcol;
+ delcount = 1;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ bd.textcol -= (*mb_head_off)(oldp, oldp + bd.textcol);
+#endif
+ if (oldp[bd.textcol] != TAB)
+ {
+ /* Only a Tab can be split into spaces. Other
+ * characters will have to be moved to after the
+ * block, causing misalignment. */
+ delcount = 0;
+ bd.endspaces = 0;
+ }
+ }
+
+ yanklen = (int)STRLEN(y_array[i]);
+
+ /* calculate number of spaces required to fill right side of block*/
+ spaces = y_width + 1;
+ for (j = 0; j < yanklen; j++)
+ spaces -= lbr_chartabsize(&y_array[i][j], 0);
+ if (spaces < 0)
+ spaces = 0;
+
+ /* insert the new text */
+ totlen = count * (yanklen + spaces) + bd.startspaces + bd.endspaces;
+ newp = alloc_check((unsigned)totlen + oldlen + 1);
+ if (newp == NULL)
+ break;
+ /* copy part up to cursor to new line */
+ ptr = newp;
+ mch_memmove(ptr, oldp, (size_t)bd.textcol);
+ ptr += bd.textcol;
+ /* may insert some spaces before the new text */
+ copy_spaces(ptr, (size_t)bd.startspaces);
+ ptr += bd.startspaces;
+ /* insert the new text */
+ for (j = 0; j < count; ++j)
+ {
+ mch_memmove(ptr, y_array[i], (size_t)yanklen);
+ ptr += yanklen;
+
+ /* insert block's trailing spaces only if there's text behind */
+ if ((j < count - 1 || !shortline) && spaces)
+ {
+ copy_spaces(ptr, (size_t)spaces);
+ ptr += spaces;
+ }
+ }
+ /* may insert some spaces after the new text */
+ copy_spaces(ptr, (size_t)bd.endspaces);
+ ptr += bd.endspaces;
+ /* move the text after the cursor to the end of the line. */
+ mch_memmove(ptr, oldp + bd.textcol + delcount,
+ (size_t)(oldlen - bd.textcol - delcount + 1));
+ ml_replace(curwin->w_cursor.lnum, newp, FALSE);
+
+ ++curwin->w_cursor.lnum;
+ if (i == 0)
+ curwin->w_cursor.col += bd.startspaces;
+ }
+
+ changed_lines(lnum, 0, curwin->w_cursor.lnum, nr_lines);
+
+ /* Set '[ mark. */
+ curbuf->b_op_start = curwin->w_cursor;
+ curbuf->b_op_start.lnum = lnum;
+
+ /* adjust '] mark */
+ curbuf->b_op_end.lnum = curwin->w_cursor.lnum - 1;
+ curbuf->b_op_end.col = bd.textcol + totlen - 1;
+#ifdef FEAT_VIRTUALEDIT
+ curbuf->b_op_end.coladd = 0;
+#endif
+ if (flags & PUT_CURSEND)
+ {
+ curwin->w_cursor = curbuf->b_op_end;
+ curwin->w_cursor.col++;
+ }
+ else
+ curwin->w_cursor.lnum = lnum;
+ }
+ else
+#endif
+ {
+ /*
+ * Character or Line mode
+ */
+ if (y_type == MCHAR)
+ {
+ /* if type is MCHAR, FORWARD is the same as BACKWARD on the next
+ * char */
+ if (dir == FORWARD && gchar_cursor() != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int bytelen = (*mb_ptr2len_check)(ml_get_cursor());
+
+ /* put it on the next of the multi-byte character. */
+ col += bytelen;
+ if (yanklen)
+ {
+ curwin->w_cursor.col += bytelen;
+ curbuf->b_op_end.col += bytelen;
+ }
+ }
+ else
+#endif
+ {
+ ++col;
+ if (yanklen)
+ {
+ ++curwin->w_cursor.col;
+ ++curbuf->b_op_end.col;
+ }
+ }
+ }
+ new_cursor = curwin->w_cursor;
+ curbuf->b_op_start = curwin->w_cursor;
+ }
+ /*
+ * Line mode: BACKWARD is the same as FORWARD on the previous line
+ */
+ else if (dir == BACKWARD)
+ --lnum;
+
+ /*
+ * simple case: insert into current line
+ */
+ if (y_type == MCHAR && y_size == 1)
+ {
+ totlen = count * yanklen;
+ if (totlen)
+ {
+ oldp = ml_get(lnum);
+ newp = alloc_check((unsigned)(STRLEN(oldp) + totlen + 1));
+ if (newp == NULL)
+ goto end; /* alloc() will give error message */
+ mch_memmove(newp, oldp, (size_t)col);
+ ptr = newp + col;
+ for (i = 0; i < count; ++i)
+ {
+ mch_memmove(ptr, y_array[0], (size_t)yanklen);
+ ptr += yanklen;
+ }
+ mch_memmove(ptr, oldp + col, STRLEN(oldp + col) + 1);
+ ml_replace(lnum, newp, FALSE);
+ /* Put cursor on last putted char. */
+ curwin->w_cursor.col += (colnr_T)(totlen - 1);
+ }
+ curbuf->b_op_end = curwin->w_cursor;
+ /* For "CTRL-O p" in Insert mode, put cursor after last char */
+ if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND)))
+ ++curwin->w_cursor.col;
+ changed_bytes(lnum, col);
+ }
+ else
+ {
+ /*
+ * Insert at least one line. When y_type is MCHAR, break the first
+ * line in two.
+ */
+ for (cnt = 1; cnt <= count; ++cnt)
+ {
+ i = 0;
+ if (y_type == MCHAR)
+ {
+ /*
+ * Split the current line in two at the insert position.
+ * First insert y_array[size - 1] in front of second line.
+ * Then append y_array[0] to first line.
+ */
+ lnum = new_cursor.lnum;
+ ptr = ml_get(lnum) + col;
+ totlen = (int)STRLEN(y_array[y_size - 1]);
+ newp = alloc_check((unsigned)(STRLEN(ptr) + totlen + 1));
+ if (newp == NULL)
+ goto error;
+ STRCPY(newp, y_array[y_size - 1]);
+ STRCAT(newp, ptr);
+ /* insert second line */
+ ml_append(lnum, newp, (colnr_T)0, FALSE);
+ vim_free(newp);
+
+ oldp = ml_get(lnum);
+ newp = alloc_check((unsigned)(col + yanklen + 1));
+ if (newp == NULL)
+ goto error;
+ /* copy first part of line */
+ mch_memmove(newp, oldp, (size_t)col);
+ /* append to first line */
+ mch_memmove(newp + col, y_array[0], (size_t)(yanklen + 1));
+ ml_replace(lnum, newp, FALSE);
+
+ curwin->w_cursor.lnum = lnum;
+ i = 1;
+ }
+
+ for (; i < y_size; ++i)
+ {
+ if ((y_type != MCHAR || i < y_size - 1)
+ && ml_append(lnum, y_array[i], (colnr_T)0, FALSE)
+ == FAIL)
+ goto error;
+ lnum++;
+ ++nr_lines;
+ if (flags & PUT_FIXINDENT)
+ {
+ old_pos = curwin->w_cursor;
+ curwin->w_cursor.lnum = lnum;
+ ptr = ml_get(lnum);
+ if (cnt == count && i == y_size - 1)
+ lendiff = (int)STRLEN(ptr);
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ if (*ptr == '#' && preprocs_left())
+ indent = 0; /* Leave # lines at start */
+ else
+#endif
+ if (*ptr == NUL)
+ indent = 0; /* Ignore empty lines */
+ else if (first_indent)
+ {
+ indent_diff = orig_indent - get_indent();
+ indent = orig_indent;
+ first_indent = FALSE;
+ }
+ else if ((indent = get_indent() + indent_diff) < 0)
+ indent = 0;
+ (void)set_indent(indent, 0);
+ curwin->w_cursor = old_pos;
+ /* remember how many chars were removed */
+ if (cnt == count && i == y_size - 1)
+ lendiff -= (int)STRLEN(ml_get(lnum));
+ }
+ }
+ }
+
+error:
+ /* Adjust marks. */
+ if (y_type == MLINE)
+ {
+ curbuf->b_op_start.col = 0;
+ if (dir == FORWARD)
+ curbuf->b_op_start.lnum++;
+ }
+ mark_adjust(curbuf->b_op_start.lnum + (y_type == MCHAR),
+ (linenr_T)MAXLNUM, nr_lines, 0L);
+
+ /* note changed text for displaying and folding */
+ if (y_type == MCHAR)
+ changed_lines(curwin->w_cursor.lnum, col,
+ curwin->w_cursor.lnum + 1, nr_lines);
+ else
+ changed_lines(curbuf->b_op_start.lnum, 0,
+ curbuf->b_op_start.lnum, nr_lines);
+
+ /* put '] mark at last inserted character */
+ curbuf->b_op_end.lnum = lnum;
+ /* correct length for change in indent */
+ col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
+ if (col > 1)
+ curbuf->b_op_end.col = col - 1;
+ else
+ curbuf->b_op_end.col = 0;
+
+ if (flags & PUT_CURSEND)
+ {
+ /* put cursor after inserted text */
+ if (y_type == MLINE)
+ {
+ if (lnum >= curbuf->b_ml.ml_line_count)
+ curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ else
+ curwin->w_cursor.lnum = lnum + 1;
+ curwin->w_cursor.col = 0;
+ }
+ else
+ {
+ curwin->w_cursor.lnum = lnum;
+ curwin->w_cursor.col = col;
+ }
+ }
+ else if (y_type == MLINE)
+ {
+ /* put cursor onfirst non-blank in first inserted line */
+ curwin->w_cursor.col = 0;
+ if (dir == FORWARD)
+ ++curwin->w_cursor.lnum;
+ beginline(BL_WHITE | BL_FIX);
+ }
+ else /* put cursor on first inserted character */
+ curwin->w_cursor = new_cursor;
+ }
+ }
+
+ msgmore(nr_lines);
+ curwin->w_set_curswant = TRUE;
+
+end:
+ if (allocated)
+ {
+ vim_free(insert_string);
+ if (regname == '=')
+ vim_free(y_array);
+ }
+ if (gchar_cursor() == NUL
+ && curwin->w_cursor.col > 0
+ && !(restart_edit || (State & INSERT)))
+ {
+ --curwin->w_cursor.col;
+#ifdef FEAT_VIRTUALEDIT
+ if (ve_flags == VE_ALL)
+ ++curwin->w_cursor.coladd;
+#endif
+ }
+}
+
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) || defined(PROTO)
+/*
+ * Return TRUE if lines starting with '#' should be left aligned.
+ */
+ int
+preprocs_left()
+{
+ return
+# ifdef FEAT_SMARTINDENT
+# ifdef FEAT_CINDENT
+ (curbuf->b_p_si && !curbuf->b_p_cin) ||
+# else
+ curbuf->b_p_si
+# endif
+# endif
+# ifdef FEAT_CINDENT
+ (curbuf->b_p_cin && in_cinkeys('#', ' ', TRUE))
+# endif
+ ;
+}
+#endif
+
+/* Return the character name of the register with the given number */
+ int
+get_register_name(num)
+ int num;
+{
+ if (num == -1)
+ return '"';
+ else if (num < 10)
+ return num + '0';
+ else if (num == DELETION_REGISTER)
+ return '-';
+#ifdef FEAT_CLIPBOARD
+ else if (num == STAR_REGISTER)
+ return '*';
+ else if (num == PLUS_REGISTER)
+ return '+';
+#endif
+ else
+ {
+#ifdef EBCDIC
+ int i;
+
+ /* EBCDIC is really braindead ... */
+ i = 'a' + (num - 10);
+ if (i > 'i')
+ i += 7;
+ if (i > 'r')
+ i += 8;
+ return i;
+#else
+ return num + 'a' - 10;
+#endif
+ }
+}
+
+/*
+ * ":dis" and ":registers": Display the contents of the yank registers.
+ */
+ void
+ex_display(eap)
+ exarg_T *eap;
+{
+ int i, n;
+ long j;
+ char_u *p;
+ struct yankreg *yb;
+ int name;
+ int attr;
+ char_u *arg = eap->arg;
+
+ if (arg != NULL && *arg == NUL)
+ arg = NULL;
+ attr = hl_attr(HLF_8);
+
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n--- Registers ---"));
+ for (i = -1; i < NUM_REGISTERS && !got_int; ++i)
+ {
+ name = get_register_name(i);
+ if (arg != NULL && vim_strchr(arg, name) == NULL)
+ continue; /* did not ask for this register */
+
+#ifdef FEAT_CLIPBOARD
+ /* Adjust register name for "unnamed" in 'clipboard'.
+ * When it's a clipboard register, fill it with the current contents
+ * of the clipboard. */
+ adjust_clip_reg(&name);
+ (void)may_get_selection(name);
+#endif
+
+ if (i == -1)
+ {
+ if (y_previous != NULL)
+ yb = y_previous;
+ else
+ yb = &(y_regs[0]);
+ }
+ else
+ yb = &(y_regs[i]);
+ if (yb->y_array != NULL)
+ {
+ msg_putchar('\n');
+ msg_putchar('"');
+ msg_putchar(name);
+ MSG_PUTS(" ");
+
+ n = (int)Columns - 6;
+ for (j = 0; j < yb->y_size && n > 1; ++j)
+ {
+ if (j)
+ {
+ MSG_PUTS_ATTR("^J", attr);
+ n -= 2;
+ }
+ for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0; ++p)
+ {
+ msg_outtrans_len(p, 1);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ }
+ if (n > 1 && yb->y_type == MLINE)
+ MSG_PUTS_ATTR("^J", attr);
+ out_flush(); /* show one line at a time */
+ }
+ ui_breakcheck();
+ }
+
+ /*
+ * display last inserted text
+ */
+ if ((p = get_last_insert()) != NULL
+ && (arg == NULL || vim_strchr(arg, '.') != NULL) && !got_int)
+ {
+ MSG_PUTS("\n\". ");
+ dis_msg(p, TRUE);
+ }
+
+ /*
+ * display last command line
+ */
+ if (last_cmdline != NULL && (arg == NULL || vim_strchr(arg, ':') != NULL)
+ && !got_int)
+ {
+ MSG_PUTS("\n\": ");
+ dis_msg(last_cmdline, FALSE);
+ }
+
+ /*
+ * display current file name
+ */
+ if (curbuf->b_fname != NULL
+ && (arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int)
+ {
+ MSG_PUTS("\n\"% ");
+ dis_msg(curbuf->b_fname, FALSE);
+ }
+
+ /*
+ * display alternate file name
+ */
+ if ((arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int)
+ {
+ char_u *fname;
+ linenr_T dummy;
+
+ if (buflist_name_nr(0, &fname, &dummy) != FAIL)
+ {
+ MSG_PUTS("\n\"# ");
+ dis_msg(fname, FALSE);
+ }
+ }
+
+ /*
+ * display last search pattern
+ */
+ if (last_search_pat() != NULL
+ && (arg == NULL || vim_strchr(arg, '/') != NULL) && !got_int)
+ {
+ MSG_PUTS("\n\"/ ");
+ dis_msg(last_search_pat(), FALSE);
+ }
+
+#ifdef FEAT_EVAL
+ /*
+ * display last used expression
+ */
+ if (expr_line != NULL && (arg == NULL || vim_strchr(arg, '=') != NULL)
+ && !got_int)
+ {
+ MSG_PUTS("\n\"= ");
+ dis_msg(expr_line, FALSE);
+ }
+#endif
+}
+
+/*
+ * display a string for do_dis()
+ * truncate at end of screen line
+ */
+ static void
+dis_msg(p, skip_esc)
+ char_u *p;
+ int skip_esc; /* if TRUE, ignore trailing ESC */
+{
+ int n;
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+ n = (int)Columns - 6;
+ while (*p != NUL
+ && !(*p == ESC && skip_esc && *(p + 1) == NUL)
+ && (n -= ptr2cells(p)) >= 0)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ msg_outtrans_len(p, l);
+ p += l;
+ }
+ else
+#endif
+ msg_outtrans_len(p++, 1);
+ }
+ ui_breakcheck();
+}
+
+/*
+ * join 'count' lines (minimal 2), including u_save()
+ */
+ void
+do_do_join(count, insert_space)
+ long count;
+ int insert_space;
+{
+ if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
+ (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL)
+ return;
+
+ while (--count > 0)
+ {
+ line_breakcheck();
+ if (got_int || do_join(insert_space) == FAIL)
+ {
+ beep_flush();
+ break;
+ }
+ }
+
+#if 0
+ /*
+ * Need to update the screen if the line where the cursor is became too
+ * long to fit on the screen.
+ */
+ update_topline_redraw();
+#endif
+}
+
+/*
+ * Join two lines at the cursor position.
+ * "redraw" is TRUE when the screen should be updated.
+ * Caller must have setup for undo.
+ *
+ * return FAIL for failure, OK ohterwise
+ */
+ int
+do_join(insert_space)
+ int insert_space;
+{
+ char_u *curr;
+ char_u *next, *next_start;
+ char_u *newp;
+ int endcurr1, endcurr2;
+ int currsize; /* size of the current line */
+ int nextsize; /* size of the next line */
+ int spaces; /* number of spaces to insert */
+ linenr_T t;
+
+ if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)
+ return FAIL; /* can't join on last line */
+
+ curr = ml_get_curline();
+ currsize = (int)STRLEN(curr);
+ endcurr1 = endcurr2 = NUL;
+ if (insert_space && currsize > 0)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ next = curr + currsize - 1;
+ next -= (*mb_head_off)(curr, next);
+ endcurr1 = (*mb_ptr2char)(next);
+ if (next > curr)
+ {
+ --next;
+ next -= (*mb_head_off)(curr, next);
+ endcurr2 = (*mb_ptr2char)(next);
+ }
+ }
+ else
+#endif
+ {
+ endcurr1 = *(curr + currsize - 1);
+ if (currsize > 1)
+ endcurr2 = *(curr + currsize - 2);
+ }
+ }
+
+ next = next_start = ml_get((linenr_T)(curwin->w_cursor.lnum + 1));
+ spaces = 0;
+ if (insert_space)
+ {
+ next = skipwhite(next);
+ if (*next != ')' && currsize != 0 && endcurr1 != TAB
+#ifdef FEAT_MBYTE
+ && (!has_format_option(FO_MBYTE_JOIN)
+ || (mb_ptr2char(next) < 0x100 && endcurr1 < 0x100))
+ && (!has_format_option(FO_MBYTE_JOIN2)
+ || mb_ptr2char(next) < 0x100 || endcurr1 < 0x100)
+#endif
+ )
+ {
+ /* don't add a space if the line is ending in a space */
+ if (endcurr1 == ' ')
+ endcurr1 = endcurr2;
+ else
+ ++spaces;
+ /* extra space when 'joinspaces' set and line ends in '.' */
+ if ( p_js
+ && (endcurr1 == '.'
+ || (vim_strchr(p_cpo, CPO_JOINSP) == NULL
+ && (endcurr1 == '?' || endcurr1 == '!'))))
+ ++spaces;
+ }
+ }
+ nextsize = (int)STRLEN(next);
+
+ newp = alloc_check((unsigned)(currsize + nextsize + spaces + 1));
+ if (newp == NULL)
+ return FAIL;
+
+ /*
+ * Insert the next line first, because we already have that pointer.
+ * Curr has to be obtained again, because getting next will have
+ * invalidated it.
+ */
+ mch_memmove(newp + currsize + spaces, next, (size_t)(nextsize + 1));
+
+ curr = ml_get_curline();
+ mch_memmove(newp, curr, (size_t)currsize);
+
+ copy_spaces(newp + currsize, (size_t)spaces);
+
+ ml_replace(curwin->w_cursor.lnum, newp, FALSE);
+
+ /* Only report the change in the first line here, del_lines() will report
+ * the deleted line. */
+ changed_lines(curwin->w_cursor.lnum, currsize,
+ curwin->w_cursor.lnum + 1, 0L);
+
+ /*
+ * Delete the following line. To do this we move the cursor there
+ * briefly, and then move it back. After del_lines() the cursor may
+ * have moved up (last line deleted), so the current lnum is kept in t.
+ *
+ * Move marks from the deleted line to the joined line, adjusting the
+ * column. This is not Vi compatible, but Vi deletes the marks, thus that
+ * should not really be a problem.
+ */
+ t = curwin->w_cursor.lnum;
+ mark_col_adjust(t + 1, (colnr_T)0, (linenr_T)-1,
+ (long)(currsize + spaces - (next - next_start)));
+ ++curwin->w_cursor.lnum;
+ del_lines(1L, FALSE);
+ curwin->w_cursor.lnum = t;
+
+ /*
+ * go to first character of the joined line
+ */
+ curwin->w_cursor.col = currsize;
+ check_cursor_col();
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ curwin->w_set_curswant = TRUE;
+
+ return OK;
+}
+
+#ifdef FEAT_COMMENTS
+/*
+ * Return TRUE if the two comment leaders given are the same. "lnum" is
+ * the first line. White-space is ignored. Note that the whole of
+ * 'leader1' must match 'leader2_len' characters from 'leader2' -- webb
+ */
+ static int
+same_leader(lnum, leader1_len, leader1_flags, leader2_len, leader2_flags)
+ linenr_T lnum;
+ int leader1_len;
+ char_u *leader1_flags;
+ int leader2_len;
+ char_u *leader2_flags;
+{
+ int idx1 = 0, idx2 = 0;
+ char_u *p;
+ char_u *line1;
+ char_u *line2;
+
+ if (leader1_len == 0)
+ return (leader2_len == 0);
+
+ /*
+ * If first leader has 'f' flag, the lines can be joined only if the
+ * second line does not have a leader.
+ * If first leader has 'e' flag, the lines can never be joined.
+ * If fist leader has 's' flag, the lines can only be joined if there is
+ * some text after it and the second line has the 'm' flag.
+ */
+ if (leader1_flags != NULL)
+ {
+ for (p = leader1_flags; *p && *p != ':'; ++p)
+ {
+ if (*p == COM_FIRST)
+ return (leader2_len == 0);
+ if (*p == COM_END)
+ return FALSE;
+ if (*p == COM_START)
+ {
+ if (*(ml_get(lnum) + leader1_len) == NUL)
+ return FALSE;
+ if (leader2_flags == NULL || leader2_len == 0)
+ return FALSE;
+ for (p = leader2_flags; *p && *p != ':'; ++p)
+ if (*p == COM_MIDDLE)
+ return TRUE;
+ return FALSE;
+ }
+ }
+ }
+
+ /*
+ * Get current line and next line, compare the leaders.
+ * The first line has to be saved, only one line can be locked at a time.
+ */
+ line1 = vim_strsave(ml_get(lnum));
+ if (line1 != NULL)
+ {
+ for (idx1 = 0; vim_iswhite(line1[idx1]); ++idx1)
+ ;
+ line2 = ml_get(lnum + 1);
+ for (idx2 = 0; idx2 < leader2_len; ++idx2)
+ {
+ if (!vim_iswhite(line2[idx2]))
+ {
+ if (line1[idx1++] != line2[idx2])
+ break;
+ }
+ else
+ while (vim_iswhite(line1[idx1]))
+ ++idx1;
+ }
+ vim_free(line1);
+ }
+ return (idx2 == leader2_len && idx1 == leader1_len);
+}
+#endif
+
+/*
+ * implementation of the format operator 'gq'
+ */
+ void
+op_format(oap, keep_cursor)
+ oparg_T *oap;
+ int keep_cursor; /* keep cursor on same text char */
+{
+ long old_line_count = curbuf->b_ml.ml_line_count;
+
+ /* Place the cursor where the "gq" or "gw" command was given, so that "u"
+ * can put it back there. */
+ curwin->w_cursor = oap->cursor_start;
+
+ if (u_save((linenr_T)(oap->start.lnum - 1),
+ (linenr_T)(oap->end.lnum + 1)) == FAIL)
+ return;
+ curwin->w_cursor = oap->start;
+
+#ifdef FEAT_VISUAL
+ if (oap->is_VIsual)
+ /* When there is no change: need to remove the Visual selection */
+ redraw_curbuf_later(INVERTED);
+#endif
+
+ /* Set '[ mark at the start of the formatted area */
+ curbuf->b_op_start = oap->start;
+
+ /* For "gw" remember the cursor position and put it back below (adjusted
+ * for joined and split lines). */
+ if (keep_cursor)
+ saved_cursor = oap->cursor_start;
+
+ format_lines(oap->line_count);
+
+ /*
+ * Leave the cursor at the first non-blank of the last formatted line.
+ * If the cursor was moved one line back (e.g. with "Q}") go to the next
+ * line, so "." will do the next lines.
+ */
+ if (oap->end_adjusted && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+ ++curwin->w_cursor.lnum;
+ beginline(BL_WHITE | BL_FIX);
+ old_line_count = curbuf->b_ml.ml_line_count - old_line_count;
+ msgmore(old_line_count);
+
+ /* put '] mark on the end of the formatted area */
+ curbuf->b_op_end = curwin->w_cursor;
+
+ if (keep_cursor)
+ {
+ curwin->w_cursor = saved_cursor;
+ saved_cursor.lnum = 0;
+ }
+
+#ifdef FEAT_VISUAL
+ if (oap->is_VIsual)
+ {
+ win_T *wp;
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_old_cursor_lnum != 0)
+ {
+ /* When lines have been inserted or deleted, adjust the end of
+ * the Visual area to be redrawn. */
+ if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum)
+ wp->w_old_cursor_lnum += old_line_count;
+ else
+ wp->w_old_visual_lnum += old_line_count;
+ }
+ }
+ }
+#endif
+}
+
+/*
+ * Format "line_count" lines, starting at the cursor position.
+ * When "line_count" is negative, format until the end of the paragraph.
+ * Lines after the cursor line are saved for undo, caller must have saved the
+ * first line.
+ */
+ void
+format_lines(line_count)
+ linenr_T line_count;
+{
+ int max_len;
+ int is_not_par; /* current line not part of parag. */
+ int next_is_not_par; /* next line not part of paragraph */
+ int is_end_par; /* at end of paragraph */
+ int prev_is_end_par = FALSE;/* prev. line not part of parag. */
+ int next_is_start_par = FALSE;
+#ifdef FEAT_COMMENTS
+ int leader_len = 0; /* leader len of current line */
+ int next_leader_len; /* leader len of next line */
+ char_u *leader_flags = NULL; /* flags for leader of current line */
+ char_u *next_leader_flags; /* flags for leader of next line */
+ int do_comments; /* format comments */
+#endif
+ int advance = TRUE;
+ int second_indent = -1;
+ int do_second_indent;
+ int do_number_indent;
+ int do_trail_white;
+ int first_par_line = TRUE;
+ int smd_save;
+ long count;
+ int need_set_indent = TRUE; /* set indent of next paragraph */
+ int force_format = FALSE;
+ int old_State = State;
+
+ /* length of a line to force formatting: 3 * 'tw' */
+ max_len = comp_textwidth(TRUE) * 3;
+
+ /* check for 'q', '2' and '1' in 'formatoptions' */
+#ifdef FEAT_COMMENTS
+ do_comments = has_format_option(FO_Q_COMS);
+#endif
+ do_second_indent = has_format_option(FO_Q_SECOND);
+ do_number_indent = has_format_option(FO_Q_NUMBER);
+ do_trail_white = has_format_option(FO_WHITE_PAR);
+
+ /*
+ * Get info about the previous and current line.
+ */
+ if (curwin->w_cursor.lnum > 1)
+ is_not_par = fmt_check_par(curwin->w_cursor.lnum - 1
+#ifdef FEAT_COMMENTS
+ , &leader_len, &leader_flags, do_comments
+#endif
+ );
+ else
+ is_not_par = TRUE;
+ next_is_not_par = fmt_check_par(curwin->w_cursor.lnum
+#ifdef FEAT_COMMENTS
+ , &next_leader_len, &next_leader_flags, do_comments
+#endif
+ );
+ is_end_par = (is_not_par || next_is_not_par);
+ if (!is_end_par && do_trail_white)
+ is_end_par = !ends_in_white(curwin->w_cursor.lnum - 1);
+
+ curwin->w_cursor.lnum--;
+ for (count = line_count; count != 0 && !got_int; --count)
+ {
+ /*
+ * Advance to next paragraph.
+ */
+ if (advance)
+ {
+ curwin->w_cursor.lnum++;
+ prev_is_end_par = is_end_par;
+ is_not_par = next_is_not_par;
+#ifdef FEAT_COMMENTS
+ leader_len = next_leader_len;
+ leader_flags = next_leader_flags;
+#endif
+ }
+
+ /*
+ * The last line to be formatted.
+ */
+ if (count == 1 || curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)
+ {
+ next_is_not_par = TRUE;
+#ifdef FEAT_COMMENTS
+ next_leader_len = 0;
+ next_leader_flags = NULL;
+#endif
+ }
+ else
+ {
+ next_is_not_par = fmt_check_par(curwin->w_cursor.lnum + 1
+#ifdef FEAT_COMMENTS
+ , &next_leader_len, &next_leader_flags, do_comments
+#endif
+ );
+ if (do_number_indent)
+ next_is_start_par =
+ (get_number_indent(curwin->w_cursor.lnum + 1) > 0);
+ }
+ advance = TRUE;
+ is_end_par = (is_not_par || next_is_not_par || next_is_start_par);
+ if (!is_end_par && do_trail_white)
+ is_end_par = !ends_in_white(curwin->w_cursor.lnum);
+
+ /*
+ * Skip lines that are not in a paragraph.
+ */
+ if (is_not_par)
+ {
+ if (line_count < 0)
+ break;
+ }
+ else
+ {
+ /*
+ * For the first line of a paragraph, check indent of second line.
+ * Don't do this for comments and empty lines.
+ */
+ if (first_par_line
+ && (do_second_indent || do_number_indent)
+ && prev_is_end_par
+ && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count
+#ifdef FEAT_COMMENTS
+ && leader_len == 0
+ && next_leader_len == 0
+#endif
+ )
+ {
+ if (do_second_indent
+ && !lineempty(curwin->w_cursor.lnum + 1))
+ second_indent = get_indent_lnum(curwin->w_cursor.lnum + 1);
+ else if (do_number_indent)
+ second_indent = get_number_indent(curwin->w_cursor.lnum);
+ }
+
+ /*
+ * When the comment leader changes, it's the end of the paragraph.
+ */
+ if (curwin->w_cursor.lnum >= curbuf->b_ml.ml_line_count
+#ifdef FEAT_COMMENTS
+ || !same_leader(curwin->w_cursor.lnum,
+ leader_len, leader_flags,
+ next_leader_len, next_leader_flags)
+#endif
+ )
+ is_end_par = TRUE;
+
+ /*
+ * If we have got to the end of a paragraph, or the line is
+ * getting long, format it.
+ */
+ if (is_end_par || force_format)
+ {
+ if (need_set_indent)
+ /* replace indent in first line with minimal number of
+ * tabs and spaces, according to current options */
+ (void)set_indent(get_indent(), SIN_CHANGED);
+
+ /* put cursor on last non-space */
+ State = NORMAL; /* don't go past end-of-line */
+ coladvance((colnr_T)MAXCOL);
+ while (curwin->w_cursor.col && vim_isspace(gchar_cursor()))
+ dec_cursor();
+
+ /* do the formatting, without 'showmode' */
+ State = INSERT; /* for open_line() */
+ smd_save = p_smd;
+ p_smd = FALSE;
+ insertchar(NUL, INSCHAR_FORMAT
+#ifdef FEAT_COMMENTS
+ + (do_comments ? INSCHAR_DO_COM : 0)
+#endif
+ , second_indent);
+ State = old_State;
+ p_smd = smd_save;
+ second_indent = -1;
+ /* at end of par.: need to set indent of next par. */
+ need_set_indent = is_end_par;
+ if (is_end_par)
+ {
+ /* When called with a negative line count, break at the
+ * end of the paragraph. */
+ if (line_count < 0)
+ break;
+ first_par_line = TRUE;
+ }
+ force_format = FALSE;
+ }
+
+ /*
+ * When still in same paragraph, join the lines together. But
+ * first delete the comment leader from the second line.
+ */
+ if (!is_end_par)
+ {
+ advance = FALSE;
+ curwin->w_cursor.lnum++;
+ curwin->w_cursor.col = 0;
+ if (line_count < 0 && u_save_cursor() == FAIL)
+ break;
+#ifdef FEAT_COMMENTS
+ (void)del_bytes((long)next_leader_len, FALSE);
+ if (next_leader_len > 0)
+ mark_col_adjust(curwin->w_cursor.lnum, (colnr_T)0, 0L,
+ (long)-next_leader_len);
+#endif
+ curwin->w_cursor.lnum--;
+ if (do_join(TRUE) == FAIL)
+ {
+ beep_flush();
+ break;
+ }
+ first_par_line = FALSE;
+ /* If the line is getting long, format it next time */
+ if (STRLEN(ml_get_curline()) > (size_t)max_len)
+ force_format = TRUE;
+ else
+ force_format = FALSE;
+ }
+ }
+ line_breakcheck();
+ }
+}
+
+/*
+ * Return TRUE if line "lnum" ends in a white character.
+ */
+ static int
+ends_in_white(lnum)
+ linenr_T lnum;
+{
+ char_u *s = ml_get(lnum);
+ size_t l;
+
+ if (*s == NUL)
+ return FALSE;
+ /* Don't use STRLEN() inside vim_iswhite(), SAS/C complains: "macro
+ * invocation may call function multiple times". */
+ l = STRLEN(s) - 1;
+ return vim_iswhite(s[l]);
+}
+
+/*
+ * Blank lines, and lines containing only the comment leader, are left
+ * untouched by the formatting. The function returns TRUE in this
+ * case. It also returns TRUE when a line starts with the end of a comment
+ * ('e' in comment flags), so that this line is skipped, and not joined to the
+ * previous line. A new paragraph starts after a blank line, or when the
+ * comment leader changes -- webb.
+ */
+#ifdef FEAT_COMMENTS
+ static int
+fmt_check_par(lnum, leader_len, leader_flags, do_comments)
+ linenr_T lnum;
+ int *leader_len;
+ char_u **leader_flags;
+ int do_comments;
+{
+ char_u *flags = NULL; /* init for GCC */
+ char_u *ptr;
+
+ ptr = ml_get(lnum);
+ if (do_comments)
+ *leader_len = get_leader_len(ptr, leader_flags, FALSE);
+ else
+ *leader_len = 0;
+
+ if (*leader_len > 0)
+ {
+ /*
+ * Search for 'e' flag in comment leader flags.
+ */
+ flags = *leader_flags;
+ while (*flags && *flags != ':' && *flags != COM_END)
+ ++flags;
+ }
+
+ return (*skipwhite(ptr + *leader_len) == NUL
+ || (*leader_len > 0 && *flags == COM_END)
+ || startPS(lnum, NUL, FALSE));
+}
+#else
+ static int
+fmt_check_par(lnum)
+ linenr_T lnum;
+{
+ return (*skipwhite(ml_get(lnum)) == NUL || startPS(lnum, NUL, FALSE));
+}
+#endif
+
+/*
+ * Return TRUE when a paragraph starts in line "lnum". Return FALSE when the
+ * previous line is in the same paragraph. Used for auto-formatting.
+ */
+ int
+paragraph_start(lnum)
+ linenr_T lnum;
+{
+ char_u *p;
+#ifdef FEAT_COMMENTS
+ int leader_len = 0; /* leader len of current line */
+ char_u *leader_flags = NULL; /* flags for leader of current line */
+ int next_leader_len; /* leader len of next line */
+ char_u *next_leader_flags; /* flags for leader of next line */
+ int do_comments; /* format comments */
+#endif
+
+ if (lnum <= 1)
+ return TRUE; /* start of the file */
+
+ p = ml_get(lnum - 1);
+ if (*p == NUL)
+ return TRUE; /* after empty line */
+
+#ifdef FEAT_COMMENTS
+ do_comments = has_format_option(FO_Q_COMS);
+#endif
+ if (fmt_check_par(lnum - 1
+#ifdef FEAT_COMMENTS
+ , &leader_len, &leader_flags, do_comments
+#endif
+ ))
+ return TRUE; /* after non-paragraph line */
+
+ if (fmt_check_par(lnum
+#ifdef FEAT_COMMENTS
+ , &next_leader_len, &next_leader_flags, do_comments
+#endif
+ ))
+ return TRUE; /* "lnum" is not a paragraph line */
+
+ if (has_format_option(FO_WHITE_PAR) && !ends_in_white(lnum - 1))
+ return TRUE; /* missing trailing space in previous line. */
+
+ if (has_format_option(FO_Q_NUMBER) && (get_number_indent(lnum) > 0))
+ return TRUE; /* numbered item starts in "lnum". */
+
+#ifdef FEAT_COMMENTS
+ if (!same_leader(lnum - 1, leader_len, leader_flags,
+ next_leader_len, next_leader_flags))
+ return TRUE; /* change of comment leader. */
+#endif
+
+ return FALSE;
+}
+
+#ifdef FEAT_VISUAL
+/*
+ * prepare a few things for block mode yank/delete/tilde
+ *
+ * for delete:
+ * - textlen includes the first/last char to be (partly) deleted
+ * - start/endspaces is the number of columns that are taken by the
+ * first/last deleted char minus the number of columns that have to be
+ * deleted. for yank and tilde:
+ * - textlen includes the first/last char to be wholly yanked
+ * - start/endspaces is the number of columns of the first/last yanked char
+ * that are to be yanked.
+ */
+ static void
+block_prep(oap, bdp, lnum, is_del)
+ oparg_T *oap;
+ struct block_def *bdp;
+ linenr_T lnum;
+ int is_del;
+{
+ int incr = 0;
+ char_u *pend;
+ char_u *pstart;
+ char_u *line;
+ char_u *prev_pstart;
+ char_u *prev_pend;
+
+ bdp->startspaces = 0;
+ bdp->endspaces = 0;
+ bdp->textlen = 0;
+ bdp->start_vcol = 0;
+ bdp->end_vcol = 0;
+#ifdef FEAT_VISUALEXTRA
+ bdp->is_short = FALSE;
+ bdp->is_oneChar = FALSE;
+ bdp->pre_whitesp = 0;
+ bdp->pre_whitesp_c = 0;
+ bdp->end_char_vcols = 0;
+#endif
+ bdp->start_char_vcols = 0;
+
+ line = ml_get(lnum);
+ pstart = line;
+ prev_pstart = line;
+ while (bdp->start_vcol < oap->start_vcol && *pstart)
+ {
+ /* Count a tab for what it's worth (if list mode not on) */
+ incr = lbr_chartabsize(pstart, (colnr_T)bdp->start_vcol);
+ bdp->start_vcol += incr;
+#ifdef FEAT_VISUALEXTRA
+ if (vim_iswhite(*pstart))
+ {
+ bdp->pre_whitesp += incr;
+ bdp->pre_whitesp_c++;
+ }
+ else
+ {
+ bdp->pre_whitesp = 0;
+ bdp->pre_whitesp_c = 0;
+ }
+#endif
+ prev_pstart = pstart;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ pstart += (*mb_ptr2len_check)(pstart);
+ else
+#endif
+ ++pstart;
+ }
+ bdp->start_char_vcols = incr;
+ if (bdp->start_vcol < oap->start_vcol) /* line too short */
+ {
+ bdp->end_vcol = bdp->start_vcol;
+#ifdef FEAT_VISUALEXTRA
+ bdp->is_short = TRUE;
+#endif
+ if (!is_del || oap->op_type == OP_APPEND)
+ bdp->endspaces = oap->end_vcol - oap->start_vcol + 1;
+ }
+ else
+ {
+ /* notice: this converts partly selected Multibyte characters to
+ * spaces, too. */
+ bdp->startspaces = bdp->start_vcol - oap->start_vcol;
+ if (is_del && bdp->startspaces)
+ bdp->startspaces = bdp->start_char_vcols - bdp->startspaces;
+ pend = pstart;
+ bdp->end_vcol = bdp->start_vcol;
+ if (bdp->end_vcol > oap->end_vcol) /* it's all in one character */
+ {
+#ifdef FEAT_VISUALEXTRA
+ bdp->is_oneChar = TRUE;
+#endif
+ if (oap->op_type == OP_INSERT)
+ bdp->endspaces = bdp->start_char_vcols - bdp->startspaces;
+ else if (oap->op_type == OP_APPEND)
+ {
+ bdp->startspaces += oap->end_vcol - oap->start_vcol + 1;
+ bdp->endspaces = bdp->start_char_vcols - bdp->startspaces;
+ }
+ else
+ {
+ bdp->startspaces = oap->end_vcol - oap->start_vcol + 1;
+ if (is_del && oap->op_type != OP_LSHIFT)
+ {
+ /* just putting the sum of those two into
+ * bdp->startspaces doesn't work for Visual replace,
+ * so we have to split the tab in two */
+ bdp->startspaces = bdp->start_char_vcols
+ - (bdp->start_vcol - oap->start_vcol);
+ bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1;
+ }
+ }
+ }
+ else
+ {
+ prev_pend = pend;
+ while (bdp->end_vcol <= oap->end_vcol && *pend != NUL)
+ {
+ /* Count a tab for what it's worth (if list mode not on) */
+ prev_pend = pend;
+ incr = lbr_chartabsize_adv(&pend, (colnr_T)bdp->end_vcol);
+ bdp->end_vcol += incr;
+ }
+ if (bdp->end_vcol <= oap->end_vcol
+ && (!is_del
+ || oap->op_type == OP_APPEND
+ || oap->op_type == OP_REPLACE)) /* line too short */
+ {
+#ifdef FEAT_VISUALEXTRA
+ bdp->is_short = TRUE;
+#endif
+ /* Alternative: include spaces to fill up the block.
+ * Disadvantage: can lead to trailing spaces when the line is
+ * short where the text is put */
+ /* if (!is_del || oap->op_type == OP_APPEND) */
+ if (oap->op_type == OP_APPEND || virtual_op)
+ bdp->endspaces = oap->end_vcol - bdp->end_vcol
+ + oap->inclusive;
+ else
+ bdp->endspaces = 0; /* replace doesn't add characters */
+ }
+ else if (bdp->end_vcol > oap->end_vcol)
+ {
+ bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1;
+ if (!is_del && bdp->endspaces)
+ {
+ bdp->endspaces = incr - bdp->endspaces;
+ if (pend != pstart)
+ pend = prev_pend;
+ }
+ }
+ }
+#ifdef FEAT_VISUALEXTRA
+ bdp->end_char_vcols = incr;
+#endif
+ if (is_del && bdp->startspaces)
+ pstart = prev_pstart;
+ bdp->textlen = (int)(pend - pstart);
+ }
+ bdp->textcol = (colnr_T) (pstart - line);
+ bdp->textstart = pstart;
+}
+#endif /* FEAT_VISUAL */
+
+#ifdef FEAT_RIGHTLEFT
+static void reverse_line __ARGS((char_u *s));
+
+ static void
+reverse_line(s)
+ char_u *s;
+{
+ int i, j;
+ char_u c;
+
+ if ((i = (int)STRLEN(s) - 1) <= 0)
+ return;
+
+ curwin->w_cursor.col = i - curwin->w_cursor.col;
+ for (j = 0; j < i; j++, i--)
+ {
+ c = s[i]; s[i] = s[j]; s[j] = c;
+ }
+}
+
+# define RLADDSUBFIX(ptr) if (curwin->w_p_rl) reverse_line(ptr);
+#else
+# define RLADDSUBFIX(ptr)
+#endif
+
+/*
+ * add or subtract 'Prenum1' from a number in a line
+ * 'command' is CTRL-A for add, CTRL-X for subtract
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+do_addsub(command, Prenum1)
+ int command;
+ linenr_T Prenum1;
+{
+ int col;
+ char_u *buf1;
+ char_u buf2[NUMBUFLEN];
+ int hex; /* 'X' or 'x': hex; '0': octal */
+ static int hexupper = FALSE; /* 0xABC */
+ long_u n;
+ long_u oldn;
+ char_u *ptr;
+ int c;
+ int length = 0; /* character length of the number */
+ int todel;
+ int dohex;
+ int dooct;
+ int doalp;
+ int firstdigit;
+ int negative;
+ int subtract;
+
+ dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
+ dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
+ doalp = (vim_strchr(curbuf->b_p_nf, 'p') != NULL); /* "alPha" */
+
+ ptr = ml_get_curline();
+ RLADDSUBFIX(ptr);
+
+ /*
+ * First check if we are on a hexadecimal number, after the "0x".
+ */
+ col = curwin->w_cursor.col;
+ if (dohex)
+ while (col > 0 && vim_isxdigit(ptr[col]))
+ --col;
+ if ( dohex
+ && col > 0
+ && (ptr[col] == 'X'
+ || ptr[col] == 'x')
+ && ptr[col - 1] == '0'
+ && vim_isxdigit(ptr[col + 1]))
+ {
+ /*
+ * Found hexadecimal number, move to its start.
+ */
+ --col;
+ }
+ else
+ {
+ /*
+ * Search forward and then backward to find the start of number.
+ */
+ col = curwin->w_cursor.col;
+
+ while (ptr[col] != NUL
+ && !vim_isdigit(ptr[col])
+ && !(doalp && ASCII_ISALPHA(ptr[col])))
+ ++col;
+
+ while (col > 0
+ && vim_isdigit(ptr[col - 1])
+ && !(doalp && ASCII_ISALPHA(ptr[col])))
+ --col;
+ }
+
+ /* truncate to max length of a number */
+ if (length >= NUMBUFLEN - 1)
+ length = NUMBUFLEN - 2;
+
+ /*
+ * If a number was found, and saving for undo works, replace the number.
+ */
+ firstdigit = ptr[col];
+ RLADDSUBFIX(ptr);
+ if ((!VIM_ISDIGIT(firstdigit) && !(doalp && ASCII_ISALPHA(firstdigit)))
+ || u_save_cursor() != OK)
+ {
+ beep_flush();
+ return FAIL;
+ }
+
+ /* get ptr again, because u_save() may have changed it */
+ ptr = ml_get_curline();
+ RLADDSUBFIX(ptr);
+
+ if (doalp && ASCII_ISALPHA(firstdigit))
+ {
+ /* decrement or increment alphabetic character */
+ if (command == Ctrl_X)
+ {
+ if (CharOrd(firstdigit) < Prenum1)
+ {
+ if (isupper(firstdigit))
+ firstdigit = 'A';
+ else
+ firstdigit = 'a';
+ }
+ else
+#ifdef EBCDIC
+ firstdigit = EBCDIC_CHAR_ADD(firstdigit, -Prenum1);
+#else
+ firstdigit -= Prenum1;
+#endif
+ }
+ else
+ {
+ if (26 - CharOrd(firstdigit) - 1 < Prenum1)
+ {
+ if (isupper(firstdigit))
+ firstdigit = 'Z';
+ else
+ firstdigit = 'z';
+ }
+ else
+#ifdef EBCDIC
+ firstdigit = EBCDIC_CHAR_ADD(firstdigit, Prenum1);
+#else
+ firstdigit += Prenum1;
+#endif
+ }
+ curwin->w_cursor.col = col;
+ (void)del_char(FALSE);
+ ins_char(firstdigit);
+ }
+ else
+ {
+ negative = FALSE;
+ if (col > 0 && ptr[col - 1] == '-') /* negative number */
+ {
+ --col;
+ negative = TRUE;
+ }
+
+ /* get the number value (unsigned) */
+ vim_str2nr(ptr + col, &hex, &length, dooct, dohex, NULL, &n);
+
+ /* ignore leading '-' for hex and octal numbers */
+ if (hex && negative)
+ {
+ ++col;
+ --length;
+ negative = FALSE;
+ }
+
+ /* add or subtract */
+ subtract = FALSE;
+ if (command == Ctrl_X)
+ subtract ^= TRUE;
+ if (negative)
+ subtract ^= TRUE;
+
+ oldn = n;
+ if (subtract)
+ n -= (unsigned long)Prenum1;
+ else
+ n += (unsigned long)Prenum1;
+
+ /* handle wraparound for decimal numbers */
+ if (!hex)
+ {
+ if (subtract)
+ {
+ if (n > oldn)
+ {
+ n = 1 + (n ^ (unsigned long)-1);
+ negative ^= TRUE;
+ }
+ }
+ else /* add */
+ {
+ if (n < oldn)
+ {
+ n = (n ^ (unsigned long)-1);
+ negative ^= TRUE;
+ }
+ }
+ if (n == 0)
+ negative = FALSE;
+ }
+
+ /*
+ * Delete the old number.
+ */
+ curwin->w_cursor.col = col;
+ todel = length;
+ c = gchar_cursor();
+ /*
+ * Don't include the '-' in the length, only the length of the part
+ * after it is kept the same.
+ */
+ if (c == '-')
+ --length;
+ while (todel-- > 0)
+ {
+ if (c < 0x100 && isalpha(c))
+ {
+ if (isupper(c))
+ hexupper = TRUE;
+ else
+ hexupper = FALSE;
+ }
+ /* del_char() will mark line needing displaying */
+ (void)del_char(FALSE);
+ c = gchar_cursor();
+ }
+
+ /*
+ * Prepare the leading characters in buf1[].
+ * When there are many leading zeros it could be very long. Allocate
+ * a bit too much.
+ */
+ buf1 = alloc((unsigned)length + NUMBUFLEN);
+ if (buf1 == NULL)
+ return FAIL;
+ ptr = buf1;
+ if (negative)
+ {
+ *ptr++ = '-';
+ }
+ if (hex)
+ {
+ *ptr++ = '0';
+ --length;
+ }
+ if (hex == 'x' || hex == 'X')
+ {
+ *ptr++ = hex;
+ --length;
+ }
+
+ /*
+ * Put the number characters in buf2[].
+ */
+ if (hex == 0)
+ sprintf((char *)buf2, "%lu", n);
+ else if (hex == '0')
+ sprintf((char *)buf2, "%lo", n);
+ else if (hex && hexupper)
+ sprintf((char *)buf2, "%lX", n);
+ else
+ sprintf((char *)buf2, "%lx", n);
+ length -= (int)STRLEN(buf2);
+
+ /*
+ * adjust number of zeros to the new number of digits, so the
+ * total length of the number remains the same
+ */
+ if (firstdigit == '0')
+ while (length-- > 0)
+ *ptr++ = '0';
+ *ptr = NUL;
+ STRCAT(buf1, buf2);
+ ins_str(buf1); /* insert the new number */
+ vim_free(buf1);
+ }
+ --curwin->w_cursor.col;
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_RIGHTLEFT
+ ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
+ RLADDSUBFIX(ptr);
+#endif
+ return OK;
+}
+
+#ifdef FEAT_VIMINFO
+ int
+read_viminfo_register(virp, force)
+ vir_T *virp;
+ int force;
+{
+ int eof;
+ int do_it = TRUE;
+ int size;
+ int limit;
+ int i;
+ int set_prev = FALSE;
+ char_u *str;
+ char_u **array = NULL;
+
+ /* We only get here (hopefully) if line[0] == '"' */
+ str = virp->vir_line + 1;
+ if (*str == '"')
+ {
+ set_prev = TRUE;
+ str++;
+ }
+ if (!ASCII_ISALNUM(*str) && *str != '-')
+ {
+ if (viminfo_error("E577: ", _("Illegal register name"), virp->vir_line))
+ return TRUE; /* too many errors, pretend end-of-file */
+ do_it = FALSE;
+ }
+ get_yank_register(*str++, FALSE);
+ if (!force && y_current->y_array != NULL)
+ do_it = FALSE;
+ size = 0;
+ limit = 100; /* Optimized for registers containing <= 100 lines */
+ if (do_it)
+ {
+ if (set_prev)
+ y_previous = y_current;
+ vim_free(y_current->y_array);
+ array = y_current->y_array =
+ (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
+ str = skipwhite(str);
+ if (STRNCMP(str, "CHAR", 4) == 0)
+ y_current->y_type = MCHAR;
+#ifdef FEAT_VISUAL
+ else if (STRNCMP(str, "BLOCK", 5) == 0)
+ y_current->y_type = MBLOCK;
+#endif
+ else
+ y_current->y_type = MLINE;
+ /* get the block width; if it's missing we get a zero, which is OK */
+ str = skipwhite(skiptowhite(str));
+#ifdef FEAT_VISUAL
+ y_current->y_width = getdigits(&str);
+#else
+ (void)getdigits(&str);
+#endif
+ }
+
+ while (!(eof = viminfo_readline(virp))
+ && (virp->vir_line[0] == TAB || virp->vir_line[0] == '<'))
+ {
+ if (do_it)
+ {
+ if (size >= limit)
+ {
+ y_current->y_array = (char_u **)
+ alloc((unsigned)(limit * 2 * sizeof(char_u *)));
+ for (i = 0; i < limit; i++)
+ y_current->y_array[i] = array[i];
+ vim_free(array);
+ limit *= 2;
+ array = y_current->y_array;
+ }
+ str = viminfo_readstring(virp, 1, TRUE);
+ if (str != NULL)
+ array[size++] = str;
+ else
+ do_it = FALSE;
+ }
+ }
+ if (do_it)
+ {
+ if (size == 0)
+ {
+ vim_free(array);
+ y_current->y_array = NULL;
+ }
+ else if (size < limit)
+ {
+ y_current->y_array =
+ (char_u **)alloc((unsigned)(size * sizeof(char_u *)));
+ for (i = 0; i < size; i++)
+ y_current->y_array[i] = array[i];
+ vim_free(array);
+ }
+ y_current->y_size = size;
+ }
+ return eof;
+}
+
+ void
+write_viminfo_registers(fp)
+ FILE *fp;
+{
+ int i, j;
+ char_u *type;
+ char_u c;
+ int num_lines;
+ int max_num_lines;
+ int max_kbyte;
+ long len;
+
+ fprintf(fp, _("\n# Registers:\n"));
+
+ /* Get '<' value, use old '"' value if '<' is not found. */
+ max_num_lines = get_viminfo_parameter('<');
+ if (max_num_lines < 0)
+ max_num_lines = get_viminfo_parameter('"');
+ if (max_num_lines == 0)
+ return;
+ max_kbyte = get_viminfo_parameter('s');
+ if (max_kbyte == 0)
+ return;
+ for (i = 0; i < NUM_REGISTERS; i++)
+ {
+ if (y_regs[i].y_array == NULL)
+ continue;
+#ifdef FEAT_CLIPBOARD
+ /* Skip '*'/'+' register, we don't want them back next time */
+ if (i == STAR_REGISTER || i == PLUS_REGISTER)
+ continue;
+#endif
+#ifdef FEAT_DND
+ /* Neither do we want the '~' register */
+ if (i == TILDE_REGISTER)
+ continue;
+#endif
+ num_lines = y_regs[i].y_size;
+ if (max_kbyte > 0)
+ {
+ /* Skip register if there is more text than the maximum size. */
+ len = 0;
+ for (j = 0; j < num_lines; j++)
+ len += STRLEN(y_regs[i].y_array[j]) + 1L;
+ if (len > (long)max_kbyte * 1024L)
+ continue;
+ }
+
+ switch (y_regs[i].y_type)
+ {
+ case MLINE:
+ type = (char_u *)"LINE";
+ break;
+ case MCHAR:
+ type = (char_u *)"CHAR";
+ break;
+#ifdef FEAT_VISUAL
+ case MBLOCK:
+ type = (char_u *)"BLOCK";
+ break;
+#endif
+ default:
+ sprintf((char *)IObuff, _("E574: Unknown register type %d"),
+ y_regs[i].y_type);
+ emsg(IObuff);
+ type = (char_u *)"LINE";
+ break;
+ }
+ if (y_previous == &y_regs[i])
+ fprintf(fp, "\"");
+ c = get_register_name(i);
+ fprintf(fp, "\"%c\t%s\t%d\n", c, type,
+#ifdef FEAT_VISUAL
+ (int)y_regs[i].y_width
+#else
+ 0
+#endif
+ );
+
+ /* If max_num_lines < 0, then we save ALL the lines in the register */
+ if (max_num_lines > 0 && num_lines > max_num_lines)
+ num_lines = max_num_lines;
+ for (j = 0; j < num_lines; j++)
+ {
+ putc('\t', fp);
+ viminfo_writestring(fp, y_regs[i].y_array[j]);
+ }
+ }
+}
+#endif /* FEAT_VIMINFO */
+
+#if defined(FEAT_CLIPBOARD) || defined(PROTO)
+/*
+ * SELECTION / PRIMARY ('*')
+ *
+ * Text selection stuff that uses the GUI selection register '*'. When using a
+ * GUI this may be text from another window, otherwise it is the last text we
+ * had highlighted with VIsual mode. With mouse support, clicking the middle
+ * button performs the paste, otherwise you will need to do <"*p>. "
+ * If not under X, it is synonymous with the clipboard register '+'.
+ *
+ * X CLIPBOARD ('+')
+ *
+ * Text selection stuff that uses the GUI clipboard register '+'.
+ * Under X, this matches the standard cut/paste buffer CLIPBOARD selection.
+ * It will be used for unnamed cut/pasting is 'clipboard' contains "unnamed",
+ * otherwise you will need to do <"+p>. "
+ * If not under X, it is synonymous with the selection register '*'.
+ */
+
+/*
+ * Routine to export any final X selection we had to the environment
+ * so that the text is still available after vim has exited. X selections
+ * only exist while the owning application exists, so we write to the
+ * permanent (while X runs) store CUT_BUFFER0.
+ * Dump the CLIPBOARD selection if we own it (it's logically the more
+ * 'permanent' of the two), otherwise the PRIMARY one.
+ * For now, use a hard-coded sanity limit of 1Mb of data.
+ */
+#if defined(FEAT_X11) && defined(FEAT_CLIPBOARD)
+ void
+x11_export_final_selection()
+{
+ Display *dpy;
+ char_u *str = NULL;
+ long_u len = 0;
+ int motion_type = -1;
+
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ dpy = X_DISPLAY;
+ else
+# endif
+# ifdef FEAT_XCLIPBOARD
+ dpy = xterm_dpy;
+# else
+ return;
+# endif
+
+ /* Get selection to export */
+ if (clip_plus.owned)
+ motion_type = clip_convert_selection(&str, &len, &clip_plus);
+ else if (clip_star.owned)
+ motion_type = clip_convert_selection(&str, &len, &clip_star);
+
+ /* Check it's OK */
+ if (dpy != NULL && str != NULL && motion_type >= 0
+ && len < 1024*1024 && len > 0)
+ {
+ XStoreBuffer(dpy, (char *)str, (int)len, 0);
+ XFlush(dpy);
+ }
+
+ vim_free(str);
+}
+#endif
+
+ void
+clip_free_selection(cbd)
+ VimClipboard *cbd;
+{
+ struct yankreg *y_ptr = y_current;
+
+ if (cbd == &clip_plus)
+ y_current = &y_regs[PLUS_REGISTER];
+ else
+ y_current = &y_regs[STAR_REGISTER];
+ free_yank_all();
+ y_current->y_size = 0;
+ y_current = y_ptr;
+}
+
+/*
+ * Get the selected text and put it in the gui selection register '*' or '+'.
+ */
+ void
+clip_get_selection(cbd)
+ VimClipboard *cbd;
+{
+ struct yankreg *old_y_previous, *old_y_current;
+ pos_T old_cursor;
+#ifdef FEAT_VISUAL
+ pos_T old_visual;
+ int old_visual_mode;
+#endif
+ colnr_T old_curswant;
+ int old_set_curswant;
+ pos_T old_op_start, old_op_end;
+ oparg_T oa;
+ cmdarg_T ca;
+
+ if (cbd->owned)
+ {
+ if ((cbd == &clip_plus && y_regs[PLUS_REGISTER].y_array != NULL)
+ || (cbd == &clip_star && y_regs[STAR_REGISTER].y_array != NULL))
+ return;
+
+ /* Get the text between clip_star.start & clip_star.end */
+ old_y_previous = y_previous;
+ old_y_current = y_current;
+ old_cursor = curwin->w_cursor;
+ old_curswant = curwin->w_curswant;
+ old_set_curswant = curwin->w_set_curswant;
+ old_op_start = curbuf->b_op_start;
+ old_op_end = curbuf->b_op_end;
+#ifdef FEAT_VISUAL
+ old_visual = VIsual;
+ old_visual_mode = VIsual_mode;
+#endif
+ clear_oparg(&oa);
+ oa.regname = (cbd == &clip_plus ? '+' : '*');
+ oa.op_type = OP_YANK;
+ vim_memset(&ca, 0, sizeof(ca));
+ ca.oap = &oa;
+ ca.cmdchar = 'y';
+ ca.count1 = 1;
+ ca.retval = CA_NO_ADJ_OP_END;
+ do_pending_operator(&ca, 0, TRUE);
+ y_previous = old_y_previous;
+ y_current = old_y_current;
+ curwin->w_cursor = old_cursor;
+ curwin->w_curswant = old_curswant;
+ curwin->w_set_curswant = old_set_curswant;
+ curbuf->b_op_start = old_op_start;
+ curbuf->b_op_end = old_op_end;
+#ifdef FEAT_VISUAL
+ VIsual = old_visual;
+ VIsual_mode = old_visual_mode;
+#endif
+ }
+ else
+ {
+ clip_free_selection(cbd);
+
+ /* Try to get selected text from another window */
+ clip_gen_request_selection(cbd);
+ }
+}
+
+/* Convert from the GUI selection string into the '*'/'+' register */
+ void
+clip_yank_selection(type, str, len, cbd)
+ int type;
+ char_u *str;
+ long len;
+ VimClipboard *cbd;
+{
+ struct yankreg *y_ptr;
+
+ if (cbd == &clip_plus)
+ y_ptr = &y_regs[PLUS_REGISTER];
+ else
+ y_ptr = &y_regs[STAR_REGISTER];
+
+ clip_free_selection(cbd);
+
+ str_to_reg(y_ptr, type, str, len, 0L);
+}
+
+/*
+ * Convert the '*'/'+' register into a GUI selection string returned in *str
+ * with length *len.
+ * Returns the motion type, or -1 for failure.
+ */
+ int
+clip_convert_selection(str, len, cbd)
+ char_u **str;
+ long_u *len;
+ VimClipboard *cbd;
+{
+ char_u *p;
+ int lnum;
+ int i, j;
+ int_u eolsize;
+ struct yankreg *y_ptr;
+
+ if (cbd == &clip_plus)
+ y_ptr = &y_regs[PLUS_REGISTER];
+ else
+ y_ptr = &y_regs[STAR_REGISTER];
+
+#ifdef USE_CRNL
+ eolsize = 2;
+#else
+ eolsize = 1;
+#endif
+
+ *str = NULL;
+ *len = 0;
+ if (y_ptr->y_array == NULL)
+ return -1;
+
+ for (i = 0; i < y_ptr->y_size; i++)
+ *len += (long_u)STRLEN(y_ptr->y_array[i]) + eolsize;
+
+ /*
+ * Don't want newline character at end of last line if we're in MCHAR mode.
+ */
+ if (y_ptr->y_type == MCHAR && *len >= eolsize)
+ *len -= eolsize;
+
+ p = *str = lalloc(*len + 1, TRUE); /* add one to avoid zero */
+ if (p == NULL)
+ return -1;
+ lnum = 0;
+ for (i = 0, j = 0; i < (int)*len; i++, j++)
+ {
+ if (y_ptr->y_array[lnum][j] == '\n')
+ p[i] = NUL;
+ else if (y_ptr->y_array[lnum][j] == NUL)
+ {
+#ifdef USE_CRNL
+ p[i++] = '\r';
+#endif
+#ifdef USE_CR
+ p[i] = '\r';
+#else
+ p[i] = '\n';
+#endif
+ lnum++;
+ j = -1;
+ }
+ else
+ p[i] = y_ptr->y_array[lnum][j];
+ }
+ return y_ptr->y_type;
+}
+
+
+# if defined(FEAT_VISUAL) || defined(FEAT_EVAL)
+/*
+ * If we have written to a clipboard register, send the text to the clipboard.
+ */
+ static void
+may_set_selection()
+{
+ if (y_current == &(y_regs[STAR_REGISTER]) && clip_star.available)
+ {
+ clip_own_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+ else if (y_current == &(y_regs[PLUS_REGISTER]) && clip_plus.available)
+ {
+ clip_own_selection(&clip_plus);
+ clip_gen_set_selection(&clip_plus);
+ }
+}
+# endif
+
+#endif /* FEAT_CLIPBOARD || PROTO */
+
+
+#if defined(FEAT_DND) || defined(PROTO)
+/*
+ * Replace the contents of the '~' register with str.
+ */
+ void
+dnd_yank_drag_data(str, len)
+ char_u *str;
+ long len;
+{
+ struct yankreg *curr;
+
+ curr = y_current;
+ y_current = &y_regs[TILDE_REGISTER];
+ free_yank_all();
+ str_to_reg(y_current, MCHAR, str, len, 0L);
+ y_current = curr;
+}
+#endif
+
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return the type of a register.
+ * Used for getregtype()
+ * Returns MAUTO for error.
+ */
+ char_u
+get_reg_type(regname, reglen)
+ int regname;
+ long *reglen;
+{
+ switch (regname)
+ {
+ case '%': /* file name */
+ case '#': /* alternate file name */
+ case '=': /* expression */
+ case ':': /* last command line */
+ case '/': /* last search-pattern */
+ case '.': /* last inserted text */
+#ifdef FEAT_SEARCHPATH
+ case Ctrl_F: /* Filename under cursor */
+ case Ctrl_P: /* Path under cursor, expand via "path" */
+#endif
+ case Ctrl_W: /* word under cursor */
+ case Ctrl_A: /* WORD (mnemonic All) under cursor */
+ case '_': /* black hole: always empty */
+ return MCHAR;
+ }
+
+#ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+#endif
+
+ /* Should we check for a valid name? */
+ get_yank_register(regname, FALSE);
+
+ if (y_current->y_array != NULL)
+ {
+#ifdef FEAT_VISUAL
+ if (reglen != NULL && y_current->y_type == MBLOCK)
+ *reglen = y_current->y_width;
+#endif
+ return y_current->y_type;
+ }
+ return MAUTO;
+}
+
+/*
+ * Return the contents of a register as a single allocated string.
+ * Used for "@r" in expressions and for getreg().
+ * Returns NULL for error.
+ */
+ char_u *
+get_reg_contents(regname, allowexpr)
+ int regname;
+ int allowexpr; /* allow "=" register. */
+{
+ long i;
+ char_u *retval;
+ int allocated;
+ long len;
+
+ /* Don't allow using an expression register inside an expression */
+ if (regname == '=')
+ {
+ if (allowexpr)
+ return get_expr_line();
+ return NULL;
+ }
+
+ if (regname == '@') /* "@@" is used for unnamed register */
+ regname = '"';
+
+ /* check for valid regname */
+ if (regname != NUL && !valid_yank_reg(regname, FALSE))
+ return NULL;
+
+#ifdef FEAT_CLIPBOARD
+ regname = may_get_selection(regname);
+#endif
+
+ if (get_spec_reg(regname, &retval, &allocated, FALSE))
+ {
+ if (retval == NULL)
+ return NULL;
+ if (!allocated)
+ retval = vim_strsave(retval);
+ return retval;
+ }
+
+ get_yank_register(regname, FALSE);
+ if (y_current->y_array == NULL)
+ return NULL;
+
+ /*
+ * Compute length of resulting string.
+ */
+ len = 0;
+ for (i = 0; i < y_current->y_size; ++i)
+ {
+ len += (long)STRLEN(y_current->y_array[i]);
+ /*
+ * Insert a newline between lines and after last line if
+ * y_type is MLINE.
+ */
+ if (y_current->y_type == MLINE || i < y_current->y_size - 1)
+ ++len;
+ }
+
+ retval = lalloc(len + 1, TRUE);
+
+ /*
+ * Copy the lines of the yank register into the string.
+ */
+ if (retval != NULL)
+ {
+ len = 0;
+ for (i = 0; i < y_current->y_size; ++i)
+ {
+ STRCPY(retval + len, y_current->y_array[i]);
+ len += (long)STRLEN(retval + len);
+
+ /*
+ * Insert a NL between lines and after the last line if y_type is
+ * MLINE.
+ */
+ if (y_current->y_type == MLINE || i < y_current->y_size - 1)
+ retval[len++] = '\n';
+ }
+ retval[len] = NUL;
+ }
+
+ return retval;
+}
+
+/*
+ * Store string "str" in register "name".
+ * "maxlen" is the maximum number of bytes to use, -1 for all bytes.
+ * If "must_append" is TRUE, always append to the register. Otherwise append
+ * if "name" is an uppercase letter.
+ * Note: "maxlen" and "must_append" don't work for the "/" register.
+ * Careful: 'str' is modified, you may have to use a copy!
+ * If "str" ends in '\n' or '\r', use linewise, otherwise use characterwise.
+ */
+ void
+write_reg_contents(name, str, maxlen, must_append)
+ int name;
+ char_u *str;
+ int maxlen;
+ int must_append;
+{
+ write_reg_contents_ex(name, str, maxlen, must_append, MAUTO, 0L);
+}
+
+ void
+write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len)
+ int name;
+ char_u *str;
+ int maxlen;
+ int must_append;
+ int yank_type;
+ long block_len;
+{
+ struct yankreg *old_y_previous, *old_y_current;
+ long len;
+
+ /* Special case: '/' search pattern */
+ if (name == '/')
+ {
+ set_last_search_pat(str, RE_SEARCH, TRUE, TRUE);
+ return;
+ }
+
+ if (!valid_yank_reg(name, TRUE)) /* check for valid reg name */
+ {
+ EMSG2(_("E354: Invalid register name: '%s'"), transchar(name));
+ return;
+ }
+
+ if (name == '_') /* black hole: nothing to do */
+ return;
+
+ /* Don't want to change the current (unnamed) register */
+ old_y_previous = y_previous;
+ old_y_current = y_current;
+
+ get_yank_register(name, TRUE);
+ if (!y_append && !must_append)
+ free_yank_all();
+ if (maxlen >= 0)
+ len = maxlen;
+ else
+ len = (long)STRLEN(str);
+#ifndef FEAT_VISUAL
+ /* Just in case - make sure we don't use MBLOCK */
+ if (yank_type == MBLOCK)
+ yank_type = MAUTO;
+#endif
+ if (yank_type == MAUTO)
+ yank_type = ((len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r'))
+ ? MLINE : MCHAR);
+ str_to_reg(y_current, yank_type, str, len, block_len);
+
+# ifdef FEAT_CLIPBOARD
+ /* Send text of clipboard register to the clipboard. */
+ may_set_selection();
+# endif
+
+ /* ':let @" = "val"' should change the meaning of the "" register */
+ if (name != '"')
+ y_previous = old_y_previous;
+ y_current = old_y_current;
+}
+#endif /* FEAT_EVAL */
+
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_EVAL)
+/*
+ * Put a string into a register. When the register is not empty, the string
+ * is appended.
+ */
+ static void
+str_to_reg(y_ptr, type, str, len, blocklen)
+ struct yankreg *y_ptr; /* pointer to yank register */
+ int type; /* MCHAR, MLINE or MBLOCK */
+ char_u *str; /* string to put in register */
+ long len; /* length of string */
+ long blocklen; /* width of Visual block */
+{
+ int lnum;
+ long start;
+ long i;
+ int extra;
+ int newlines; /* number of lines added */
+ int extraline = 0; /* extra line at the end */
+ int append = FALSE; /* append to last line in register */
+ char_u *s;
+ char_u **pp;
+#ifdef FEAT_VISUAL
+ long maxlen;
+#endif
+
+ if (y_ptr->y_array == NULL) /* NULL means emtpy register */
+ y_ptr->y_size = 0;
+
+ /*
+ * Count the number of lines within the string
+ */
+ newlines = 0;
+ for (i = 0; i < len; i++)
+ if (str[i] == '\n')
+ ++newlines;
+ if (type == MCHAR || len == 0 || str[len - 1] != '\n')
+ {
+ extraline = 1;
+ ++newlines; /* count extra newline at the end */
+ }
+ if (y_ptr->y_size > 0 && y_ptr->y_type == MCHAR)
+ {
+ append = TRUE;
+ --newlines; /* uncount newline when appending first line */
+ }
+
+ /*
+ * Allocate an array to hold the pointers to the new register lines.
+ * If the register was not empty, move the existing lines to the new array.
+ */
+ pp = (char_u **)lalloc_clear((y_ptr->y_size + newlines)
+ * sizeof(char_u *), TRUE);
+ if (pp == NULL) /* out of memory */
+ return;
+ for (lnum = 0; lnum < y_ptr->y_size; ++lnum)
+ pp[lnum] = y_ptr->y_array[lnum];
+ vim_free(y_ptr->y_array);
+ y_ptr->y_array = pp;
+#ifdef FEAT_VISUAL
+ maxlen = 0;
+#endif
+
+ /*
+ * Find the end of each line and save it into the array.
+ */
+ for (start = 0; start < len + extraline; start += i + 1)
+ {
+ for (i = start; i < len; ++i) /* find the end of the line */
+ if (str[i] == '\n')
+ break;
+ i -= start; /* i is now length of line */
+#ifdef FEAT_VISUAL
+ if (i > maxlen)
+ maxlen = i;
+#endif
+ if (append)
+ {
+ --lnum;
+ extra = (int)STRLEN(y_ptr->y_array[lnum]);
+ }
+ else
+ extra = 0;
+ s = alloc((unsigned)(i + extra + 1));
+ if (s == NULL)
+ break;
+ if (extra)
+ mch_memmove(s, y_ptr->y_array[lnum], (size_t)extra);
+ if (append)
+ vim_free(y_ptr->y_array[lnum]);
+ if (i)
+ mch_memmove(s + extra, str + start, (size_t)i);
+ extra += i;
+ s[extra] = NUL;
+ y_ptr->y_array[lnum++] = s;
+ while (--extra >= 0)
+ {
+ if (*s == NUL)
+ *s = '\n'; /* replace NUL with newline */
+ ++s;
+ }
+ append = FALSE; /* only first line is appended */
+ }
+ y_ptr->y_type = type;
+ y_ptr->y_size = lnum;
+# ifdef FEAT_VISUAL
+ if (type == MBLOCK)
+ y_ptr->y_width = (blocklen < 0 ? maxlen - 1 : blocklen);
+ else
+ y_ptr->y_width = 0;
+# endif
+}
+#endif /* FEAT_CLIPBOARD || FEAT_EVAL || PROTO */
+
+ void
+clear_oparg(oap)
+ oparg_T *oap;
+{
+ vim_memset(oap, 0, sizeof(oparg_T));
+}
+
+static long line_count_info __ARGS((char_u *line, long *wc, long limit, int eol_size));
+
+/*
+ * Count the number of characters and "words" in a line.
+ *
+ * "Words" are counted by looking for boundaries between non-space and
+ * space characters. (it seems to produce results that match 'wc'.)
+ *
+ * Return value is character count; word count for the line is ADDED
+ * to "*wc".
+ *
+ * The function will only examine the first "limit" characters in the
+ * line, stopping if it encounters an end-of-line (NUL byte). In that
+ * case, eol_size will be added to the character count to account for
+ * the size of the EOL character.
+ */
+ static long
+line_count_info(line, wc, limit, eol_size)
+ char_u *line;
+ long *wc;
+ long limit;
+ int eol_size;
+{
+ long i, words = 0;
+ int is_word = 0;
+
+ for (i = 0; line[i] && i < limit; i++)
+ {
+ if (is_word)
+ {
+ if (vim_isspace(line[i]))
+ {
+ words++;
+ is_word = 0;
+ }
+ }
+ else if (!vim_isspace(line[i]))
+ is_word = 1;
+ }
+
+ if (is_word)
+ words++;
+ *wc += words;
+
+ /* Add eol_size if the end of line was reached before hitting limit. */
+ if (!line[i] && i < limit)
+ i += eol_size;
+ return i;
+}
+
+/*
+ * Give some info about the position of the cursor (for "g CTRL-G").
+ * In Visual mode, give some info about the selected region. (In this case,
+ * the *_count_cursor variables store running totals for the selection.)
+ */
+ void
+cursor_pos_info()
+{
+ char_u *p;
+ char_u buf1[20];
+ char_u buf2[20];
+ linenr_T lnum;
+ long char_count = 0;
+ long char_count_cursor = 0;
+ int eol_size;
+ long last_check = 100000L;
+ long word_count = 0;
+ long word_count_cursor = 0;
+#ifdef FEAT_VISUAL
+ long line_count_selected = 0;
+ pos_T min_pos, max_pos;
+ oparg_T oparg;
+ struct block_def bd;
+#endif
+
+ /*
+ * Compute the length of the file in characters.
+ */
+ if (curbuf->b_ml.ml_flags & ML_EMPTY)
+ {
+ MSG(_(no_lines_msg));
+ }
+ else
+ {
+ if (get_fileformat(curbuf) == EOL_DOS)
+ eol_size = 2;
+ else
+ eol_size = 1;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (lt(VIsual, curwin->w_cursor))
+ {
+ min_pos = VIsual;
+ max_pos = curwin->w_cursor;
+ }
+ else
+ {
+ min_pos = curwin->w_cursor;
+ max_pos = VIsual;
+ }
+ if (*p_sel == 'e' && max_pos.col > 0)
+ --max_pos.col;
+
+ if (VIsual_mode == Ctrl_V)
+ {
+ oparg.is_VIsual = 1;
+ oparg.block_mode = TRUE;
+ oparg.op_type = OP_NOP;
+ getvcols(curwin, &min_pos, &max_pos,
+ &oparg.start_vcol, &oparg.end_vcol);
+ /* Swap the start, end vcol if needed */
+ if (oparg.end_vcol < oparg.start_vcol)
+ {
+ oparg.end_vcol += oparg.start_vcol;
+ oparg.start_vcol = oparg.end_vcol - oparg.start_vcol;
+ oparg.end_vcol -= oparg.start_vcol;
+ }
+ }
+ line_count_selected = max_pos.lnum - min_pos.lnum + 1;
+ }
+#endif
+
+ for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
+ {
+ /* Check for a CTRL-C every 100000 characters. */
+ if (char_count > last_check)
+ {
+ ui_breakcheck();
+ if (got_int)
+ return;
+ last_check = char_count + 100000L;
+ }
+
+#ifdef FEAT_VISUAL
+ /* Do extra processing for VIsual mode. */
+ if (VIsual_active
+ && lnum >= min_pos.lnum && lnum <= max_pos.lnum)
+ {
+ switch (VIsual_mode)
+ {
+ case Ctrl_V:
+# ifdef FEAT_VIRTUALEDIT
+ virtual_op = virtual_active();
+# endif
+ block_prep(&oparg, &bd, lnum, 0);
+# ifdef FEAT_VIRTUALEDIT
+ virtual_op = MAYBE;
+# endif
+ char_count_cursor += line_count_info(bd.textstart,
+ &word_count_cursor, (long)bd.textlen, eol_size);
+ break;
+ case 'V':
+ char_count_cursor += line_count_info(ml_get(lnum),
+ &word_count_cursor, (long)MAXCOL, eol_size);
+ break;
+ case 'v':
+ {
+ colnr_T start_col = (lnum == min_pos.lnum)
+ ? min_pos.col : 0;
+ colnr_T end_col = (lnum == max_pos.lnum)
+ ? max_pos.col - start_col + 1 : MAXCOL;
+
+ char_count_cursor +=
+ line_count_info(ml_get(lnum) + start_col,
+ &word_count_cursor, (long)end_col, eol_size);
+ }
+ break;
+ }
+ }
+ else
+#endif
+ {
+ /* In non-visual mode, check for the line the cursor is on */
+ if (lnum == curwin->w_cursor.lnum)
+ {
+ word_count_cursor += word_count;
+ char_count_cursor = char_count +
+ line_count_info(ml_get(lnum), &word_count_cursor,
+ (long)(curwin->w_cursor.col + 1), eol_size);
+ }
+ }
+ /* Add to the running totals */
+ char_count += line_count_info(ml_get(lnum), &word_count,
+ (long)MAXCOL, eol_size);
+ }
+
+ /* Correction for when last line doesn't have an EOL. */
+ if (!curbuf->b_p_eol && curbuf->b_p_bin)
+ char_count -= eol_size;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (VIsual_mode == Ctrl_V)
+ {
+ getvcols(curwin, &min_pos, &max_pos, &min_pos.col,
+ &max_pos.col);
+ sprintf((char *)buf1, _("%ld Cols; "),
+ (long)(oparg.end_vcol - oparg.start_vcol + 1));
+ }
+ else
+ buf1[0] = NUL;
+
+ sprintf((char *)IObuff,
+ _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"),
+ buf1, line_count_selected,
+ (long)curbuf->b_ml.ml_line_count,
+ word_count_cursor, word_count,
+ char_count_cursor, char_count);
+ }
+ else
+#endif
+ {
+ p = ml_get_curline();
+ validate_virtcol();
+ col_print(buf1, (int)curwin->w_cursor.col + 1,
+ (int)curwin->w_virtcol + 1);
+ col_print(buf2, (int)STRLEN(p), linetabsize(p));
+
+ sprintf((char *)IObuff,
+ _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"),
+ (char *)buf1, (char *)buf2,
+ (long)curwin->w_cursor.lnum,
+ (long)curbuf->b_ml.ml_line_count,
+ word_count_cursor, word_count,
+ char_count_cursor, char_count);
+ }
+
+#ifdef FEAT_MBYTE
+ char_count = bomb_size();
+ if (char_count > 0)
+ sprintf((char *)IObuff + STRLEN(IObuff), _("(+%ld for BOM)"),
+ char_count);
+#endif
+ /* Don't shorten this message, the user asked for it. */
+ p = p_shm;
+ p_shm = (char_u *)"";
+ msg(IObuff);
+ p_shm = p;
+ }
+}
diff --git a/src/option.c b/src/option.c
new file mode 100644
index 000000000..b87005e19
--- /dev/null
+++ b/src/option.c
@@ -0,0 +1,9383 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Code to handle user-settable options. This is all pretty much table-
+ * driven. Checklist for adding a new option:
+ * - Put it in the options array below (copy an existing entry).
+ * - For a global option: Add a variable for it in option.h.
+ * - For a buffer or window local option:
+ * - Add a PV_XX entry to the enum below.
+ * - Add a variable to the window or buffer struct in structs.h.
+ * - For a window option, add some code to copy_winopt().
+ * - For a buffer option, add some code to buf_copy_options().
+ * - For a buffer string option, add code to check_buf_options().
+ * - If it's a numeric option, add any necessary bounds checks to do_set().
+ * - If it's a list of flags, add some code in do_set(), search for WW_ALL.
+ * - When adding an option with expansion (P_EXPAND), but with a different
+ * default for Vi and Vim (no P_VI_DEF), add some code at VIMEXP.
+ * - Add documentation! One line in doc/help.txt, full description in
+ * options.txt, and any other related places.
+ * - Add an entry in runtime/optwin.vim.
+ * When making changes:
+ * - Adjust the help for the option in doc/option.txt.
+ * - When an entry has the P_VIM flag, or is lacking the P_VI_DEF flag, add a
+ * comment at the help for the 'compatible' option.
+ */
+
+#define IN_OPTION_C
+#include "vim.h"
+
+/*
+ * The options that are local to a window or buffer have "indir" set to one of
+ * these values. Special values:
+ * PV_NONE: global option.
+ * PV_BOTH is added: global option which also has a local value.
+ */
+#define PV_BOTH 0x1000
+#define OPT_BOTH(x) (idopt_T)(PV_BOTH + (int)(x))
+
+typedef enum
+{
+ PV_NONE = 0
+ , PV_AI
+ , PV_AR
+ , PV_ARAB
+ , PV_BH
+ , PV_BIN
+ , PV_BL
+ , PV_BOMB
+ , PV_BT
+ , PV_CI
+ , PV_CIN
+ , PV_CINK
+ , PV_CINO
+ , PV_CINW
+ , PV_CMS
+ , PV_COM
+ , PV_CPT
+ , PV_DEF
+ , PV_DICT
+ , PV_DIFF
+ , PV_EFM
+ , PV_EOL
+ , PV_EP
+ , PV_ET
+ , PV_FDC
+ , PV_FDE
+ , PV_FDI
+ , PV_FDL
+ , PV_FDM
+ , PV_FDN
+ , PV_FDT
+ , PV_FEN
+ , PV_FENC
+ , PV_FF
+ , PV_FML
+ , PV_FMR
+ , PV_FO
+ , PV_FT
+ , PV_GP
+ , PV_IMI
+ , PV_IMS
+ , PV_INC
+ , PV_INDE
+ , PV_INDK
+ , PV_INEX
+ , PV_INF
+ , PV_ISK
+ , PV_KEY
+ , PV_KMAP
+ , PV_KP
+ , PV_LBR
+ , PV_LISP
+ , PV_LIST
+ , PV_MA
+ , PV_ML
+ , PV_MOD
+ , PV_MP
+ , PV_MPS
+ , PV_NF
+ , PV_NU
+ , PV_OFT
+ , PV_PATH
+ , PV_PI
+ , PV_PVW
+ , PV_RL
+ , PV_RLC
+ , PV_RO
+ , PV_SCBIND
+ , PV_SCROLL
+ , PV_SI
+ , PV_SN
+ , PV_STS
+ , PV_SUA
+ , PV_SW
+ , PV_SWF
+ , PV_SYN
+ , PV_TAGS
+ , PV_TS
+ , PV_TSR
+ , PV_TW
+ , PV_TX
+ , PV_WFH
+ , PV_WM
+ , PV_WRAP
+} idopt_T;
+
+/*
+ * Options local to a window have a value local to a buffer and global to all
+ * buffers. Indicate this by setting "var" to VAR_WIN.
+ */
+#define VAR_WIN ((char_u *)-1)
+
+/*
+ * These the global values for options which are also local to a buffer.
+ * Only to be used in option.c!
+ */
+static int p_ai;
+static int p_bin;
+#ifdef FEAT_MBYTE
+static int p_bomb;
+#endif
+#if defined(FEAT_QUICKFIX)
+static char_u *p_bh;
+static char_u *p_bt;
+#endif
+static int p_bl;
+static int p_ci;
+#ifdef FEAT_CINDENT
+static int p_cin;
+static char_u *p_cink;
+static char_u *p_cino;
+#endif
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+static char_u *p_cinw;
+#endif
+#ifdef FEAT_COMMENTS
+static char_u *p_com;
+#endif
+#ifdef FEAT_FOLDING
+static char_u *p_cms;
+#endif
+#ifdef FEAT_INS_EXPAND
+static char_u *p_cpt;
+#endif
+static int p_eol;
+static int p_et;
+#ifdef FEAT_MBYTE
+static char_u *p_fenc;
+#endif
+static char_u *p_ff;
+static char_u *p_fo;
+#ifdef FEAT_AUTOCMD
+static char_u *p_ft;
+#endif
+static long p_iminsert;
+static long p_imsearch;
+#if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+static char_u *p_inex;
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+static char_u *p_inde;
+static char_u *p_indk;
+#endif
+static int p_inf;
+static char_u *p_isk;
+#ifdef FEAT_CRYPT
+static char_u *p_key;
+#endif
+#ifdef FEAT_LISP
+static int p_lisp;
+#endif
+static int p_ml;
+static int p_ma;
+static int p_mod;
+static char_u *p_mps;
+static char_u *p_nf;
+#ifdef FEAT_OSFILETYPE
+static char_u *p_oft;
+#endif
+static int p_pi;
+static int p_ro;
+#ifdef FEAT_SMARTINDENT
+static int p_si;
+#endif
+#ifndef SHORT_FNAME
+static int p_sn;
+#endif
+static long p_sts;
+#if defined(FEAT_SEARCHPATH)
+static char_u *p_sua;
+#endif
+static long p_sw;
+static int p_swf;
+#ifdef FEAT_SYN_HL
+static char_u *p_syn;
+#endif
+static long p_ts;
+static long p_tw;
+static int p_tx;
+static long p_wm;
+#ifdef FEAT_KEYMAP
+static char_u *p_keymap;
+#endif
+
+/* Saved values for when 'bin' is set. */
+static int p_et_nobin;
+static int p_ml_nobin;
+static long p_tw_nobin;
+static long p_wm_nobin;
+
+/* Saved values for when 'paste' is set */
+static long p_tw_nopaste;
+static long p_wm_nopaste;
+static long p_sts_nopaste;
+static int p_ai_nopaste;
+
+struct vimoption
+{
+ char *fullname; /* full option name */
+ char *shortname; /* permissible abbreviation */
+ long_u flags; /* see below */
+ char_u *var; /* global option: pointer to variable;
+ * window-local option: VAR_WIN;
+ * buffer-local option: global value */
+ idopt_T indir; /* global option: PV_NONE;
+ * local option: indirect option index */
+ char_u *def_val[2]; /* default values for variable (vi and vim) */
+#ifdef FEAT_EVAL
+ scid_T scriptID; /* script in which the option was last set */
+#endif
+};
+
+#define VI_DEFAULT 0 /* def_val[VI_DEFAULT] is Vi default value */
+#define VIM_DEFAULT 1 /* def_val[VIM_DEFAULT] is Vim default value */
+
+/*
+ * Flags
+ */
+#define P_BOOL 0x01 /* the option is boolean */
+#define P_NUM 0x02 /* the option is numeric */
+#define P_STRING 0x04 /* the option is a string */
+#define P_ALLOCED 0x08 /* the string option is in allocated memory,
+ must use vim_free() when assigning new
+ value. Not set if default is the same. */
+#define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can
+ never be used for local or hidden options! */
+#define P_NODEFAULT 0x40 /* don't set to default value */
+#define P_DEF_ALLOCED 0x80 /* default value is in allocated memory, must
+ use vim_free() when assigning new value */
+#define P_WAS_SET 0x100 /* option has been set/reset */
+#define P_NO_MKRC 0x200 /* don't include in :mkvimrc output */
+#define P_VI_DEF 0x400 /* Use Vi default for Vim */
+#define P_VIM 0x800 /* Vim option, reset when 'cp' set */
+
+ /* when option changed, what to display: */
+#define P_RSTAT 0x1000 /* redraw status lines */
+#define P_RWIN 0x2000 /* redraw current window */
+#define P_RBUF 0x4000 /* redraw current buffer */
+#define P_RALL 0x6000 /* redraw all windows */
+#define P_RCLR 0x7000 /* clear and redraw all */
+
+#define P_COMMA 0x8000 /* comma separated list */
+#define P_NODUP 0x10000L/* don't allow duplicate strings */
+#define P_FLAGLIST 0x20000L/* list of single-char flags */
+
+#define P_SECURE 0x40000L/* cannot change in modeline or secure mode */
+#define P_GETTEXT 0x80000L/* expand default value with _() */
+#define P_NOGLOB 0x100000L/* do not use local value for global vimrc */
+
+/*
+ * options[] is initialized here.
+ * The order of the options MUST be alphabetic for ":set all" and findoption().
+ * All option names MUST start with a lowercase letter (for findoption()).
+ * Exception: "t_" options are at the end.
+ * The options with a NULL variable are 'hidden': a set command for them is
+ * ignored and they are not printed.
+ */
+static struct vimoption
+#ifdef FEAT_GUI_W16
+ _far
+#endif
+ options[] =
+{
+ {"aleph", "al", P_NUM|P_VI_DEF,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)&p_aleph, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {
+#if (defined(MSDOS) || defined(WIN3264) || defined(OS2)) && !defined(FEAT_GUI_W32)
+ (char_u *)128L,
+#else
+ (char_u *)224L,
+#endif
+ (char_u *)0L}},
+ {"antialias", "anti", P_BOOL|P_VI_DEF|P_VIM|P_RCLR,
+#if defined(FEAT_GUI) && defined(MACOS_X)
+ (char_u *)&p_antialias, PV_NONE,
+ {(char_u *)FALSE, (char_u *)FALSE}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)FALSE}
+#endif
+ },
+ {"arabic", "arab", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_ARABIC
+ (char_u *)VAR_WIN, PV_ARAB,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"arabicshape", "arshape", P_BOOL|P_VI_DEF|P_VIM|P_RCLR,
+#ifdef FEAT_ARABIC
+ (char_u *)&p_arshape, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"allowrevins", "ari", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)&p_ari, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"altkeymap", "akm", P_BOOL|P_VI_DEF,
+#ifdef FEAT_FKMAP
+ (char_u *)&p_altkeymap, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"ambiwidth", "ambw", P_STRING|P_VI_DEF|P_RCLR,
+#if defined(FEAT_MBYTE)
+ (char_u *)&p_ambw, PV_NONE,
+ {(char_u *)"single", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
+ {"autochdir", "acd", P_BOOL|P_VI_DEF,
+ (char_u *)&p_acd, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+#endif
+ {"autoindent", "ai", P_BOOL|P_VI_DEF,
+ (char_u *)&p_ai, PV_AI,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"autoprint", "ap", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"autoread", "ar", P_BOOL|P_VI_DEF,
+ (char_u *)&p_ar, OPT_BOTH(PV_AR),
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"autowrite", "aw", P_BOOL|P_VI_DEF,
+ (char_u *)&p_aw, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"autowriteall","awa", P_BOOL|P_VI_DEF,
+ (char_u *)&p_awa, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"background", "bg", P_STRING|P_VI_DEF|P_RCLR,
+ (char_u *)&p_bg, PV_NONE,
+ {
+#if (defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI)
+ (char_u *)"dark",
+#else
+ (char_u *)"light",
+#endif
+ (char_u *)0L}},
+ {"backspace", "bs", P_STRING|P_VI_DEF|P_VIM|P_COMMA|P_NODUP,
+ (char_u *)&p_bs, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"backup", "bk", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_bk, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"backupcopy", "bkc", P_STRING|P_VIM|P_COMMA|P_NODUP,
+ (char_u *)&p_bkc, PV_NONE,
+#ifdef UNIX
+ {(char_u *)"yes", (char_u *)"auto"}
+#else
+ {(char_u *)"auto", (char_u *)"auto"}
+#endif
+ },
+ {"backupdir", "bdir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE,
+ (char_u *)&p_bdir, PV_NONE,
+ {(char_u *)DFLT_BDIR, (char_u *)0L}},
+ {"backupext", "bex", P_STRING|P_VI_DEF,
+ (char_u *)&p_bex, PV_NONE,
+ {
+#ifdef VMS
+ (char_u *)"_",
+#else
+ (char_u *)"~",
+#endif
+ (char_u *)0L}},
+ {"backupskip", "bsk", P_STRING|P_VI_DEF|P_COMMA,
+#ifdef FEAT_WILDIGN
+ (char_u *)&p_bsk, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+#ifdef FEAT_BEVAL
+ {"balloondelay","bdlay",P_NUM|P_VI_DEF,
+ (char_u *)&p_bdlay, PV_NONE,
+ {(char_u *)600L, (char_u *)0L}},
+#endif
+#if defined(FEAT_BEVAL) && (defined(FEAT_SUN_WORKSHOP) \
+ || defined(FEAT_NETBEANS_INTG))
+ {"ballooneval", "beval",P_BOOL|P_VI_DEF|P_NO_MKRC,
+ (char_u *)&p_beval, PV_NONE,
+ {(char_u*)FALSE, (char_u *)0L}},
+#endif
+ {"beautify", "bf", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"binary", "bin", P_BOOL|P_VI_DEF|P_RSTAT,
+ (char_u *)&p_bin, PV_BIN,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"bioskey", "biosk",P_BOOL|P_VI_DEF,
+#ifdef MSDOS
+ (char_u *)&p_biosk, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"bomb", NULL, P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_bomb, PV_BOMB,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"breakat", "brk", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST,
+#ifdef FEAT_LINEBREAK
+ (char_u *)&p_breakat, PV_NONE,
+ {(char_u *)" \t!@*-+;:,./?", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"browsedir", "bsdir",P_STRING|P_VI_DEF,
+#ifdef FEAT_BROWSE
+ (char_u *)&p_bsdir, PV_NONE,
+ {(char_u *)"last", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"bufhidden", "bh", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB,
+#if defined(FEAT_QUICKFIX)
+ (char_u *)&p_bh, PV_BH,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"buflisted", "bl", P_BOOL|P_VI_DEF|P_NOGLOB,
+ (char_u *)&p_bl, PV_BL,
+ {(char_u *)1L, (char_u *)0L}
+ },
+ {"buftype", "bt", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB,
+#if defined(FEAT_QUICKFIX)
+ (char_u *)&p_bt, PV_BT,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"casemap", "cmp", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_cmp, PV_NONE,
+ {(char_u *)"internal,keepascii", (char_u *)0L}
+ },
+ {"cdpath", "cd", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_SEARCHPATH
+ (char_u *)&p_cdpath, PV_NONE,
+ {(char_u *)",,", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"cedit", NULL, P_STRING,
+#ifdef FEAT_CMDWIN
+ (char_u *)&p_cedit, PV_NONE,
+ {(char_u *)"", (char_u *)CTRL_F_STR}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"charconvert", "ccv", P_STRING|P_VI_DEF|P_SECURE,
+#if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
+ (char_u *)&p_ccv, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_CINDENT
+ (char_u *)&p_cin, PV_CIN,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"cinkeys", "cink", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_CINDENT
+ (char_u *)&p_cink, PV_CINK,
+ {(char_u *)"0{,0},0),:,0#,!^F,o,O,e", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"cinoptions", "cino", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_CINDENT
+ (char_u *)&p_cino, PV_CINO,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"cinwords", "cinw", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ (char_u *)&p_cinw, PV_CINW,
+ {(char_u *)"if,else,while,do,for,switch",
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"clipboard", "cb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_CLIPBOARD
+ (char_u *)&p_cb, PV_NONE,
+# ifdef FEAT_XCLIPBOARD
+ {(char_u *)"autoselect,exclude:cons\\|linux",
+ (char_u *)0L}
+# else
+ {(char_u *)"", (char_u *)0L}
+# endif
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#endif
+ },
+ {"cmdheight", "ch", P_NUM|P_VI_DEF|P_RALL,
+ (char_u *)&p_ch, PV_NONE,
+ {(char_u *)1L, (char_u *)0L}},
+ {"cmdwinheight", "cwh", P_NUM|P_VI_DEF,
+#ifdef FEAT_CMDWIN
+ (char_u *)&p_cwh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)7L, (char_u *)0L}},
+ {"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
+ (char_u *)&Columns, PV_NONE,
+ {(char_u *)80L, (char_u *)0L}},
+ {"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_COMMENTS
+ (char_u *)&p_com, PV_COM,
+ {(char_u *)"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-",
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF,
+#ifdef FEAT_FOLDING
+ (char_u *)&p_cms, PV_CMS,
+ {(char_u *)"/*%s*/", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"compatible", "cp", P_BOOL|P_RALL,
+ (char_u *)&p_cp, PV_NONE,
+ {(char_u *)TRUE, (char_u *)FALSE}},
+ {"complete", "cpt", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_INS_EXPAND
+ (char_u *)&p_cpt, PV_CPT,
+ {(char_u *)".,w,b,u,t,i", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"confirm", "cf", P_BOOL|P_VI_DEF,
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ (char_u *)&p_confirm, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"conskey", "consk",P_BOOL|P_VI_DEF,
+#ifdef MSDOS
+ (char_u *)&p_consk, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"copyindent", "ci", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_ci, PV_CI,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"cpoptions", "cpo", P_STRING|P_VIM|P_RALL|P_FLAGLIST,
+ (char_u *)&p_cpo, PV_NONE,
+ {(char_u *)CPO_ALL, (char_u *)CPO_DEFAULT}},
+ {"cscopepathcomp", "cspc", P_NUM|P_VI_DEF|P_VIM,
+#ifdef FEAT_CSCOPE
+ (char_u *)&p_cspc, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L}},
+ {"cscopeprg", "csprg", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_CSCOPE
+ (char_u *)&p_csprg, PV_NONE,
+ {(char_u *)"cscope", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"cscopequickfix", "csqf", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#if defined(FEAT_CSCOPE) && defined(FEAT_QUICKFIX)
+ (char_u *)&p_csqf, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"cscopetag", "cst", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_CSCOPE
+ (char_u *)&p_cst, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L}},
+ {"cscopetagorder", "csto", P_NUM|P_VI_DEF|P_VIM,
+#ifdef FEAT_CSCOPE
+ (char_u *)&p_csto, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L}},
+ {"cscopeverbose", "csverb", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_CSCOPE
+ (char_u *)&p_csverbose, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L}},
+ {"debug", NULL, P_STRING|P_VI_DEF,
+ (char_u *)&p_debug, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"define", "def", P_STRING|P_ALLOCED|P_VI_DEF,
+#ifdef FEAT_FIND_ID
+ (char_u *)&p_def, OPT_BOTH(PV_DEF),
+ {(char_u *)"^\\s#\\s*define", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"delcombine", "deco", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_deco, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}
+ },
+ {"dictionary", "dict", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_INS_EXPAND
+ (char_u *)&p_dict, OPT_BOTH(PV_DICT),
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"diff", NULL, P_BOOL|P_VI_DEF|P_RWIN|P_NOGLOB,
+#ifdef FEAT_DIFF
+ (char_u *)VAR_WIN, PV_DIFF,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE,
+#if defined(FEAT_DIFF) && defined(FEAT_EVAL)
+ (char_u *)&p_dex, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"diffopt", "dip", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN|P_COMMA|P_NODUP,
+#ifdef FEAT_DIFF
+ (char_u *)&p_dip, PV_NONE,
+ {(char_u *)"filler", (char_u *)NULL}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)"", (char_u *)NULL}
+#endif
+ },
+ {"digraph", "dg", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_DIGRAPHS
+ (char_u *)&p_dg, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"directory", "dir", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP|P_SECURE,
+ (char_u *)&p_dir, PV_NONE,
+ {(char_u *)DFLT_DIR, (char_u *)0L}},
+ {"display", "dy", P_STRING|P_VI_DEF|P_COMMA|P_RALL|P_NODUP,
+ (char_u *)&p_dy, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"eadirection", "ead", P_STRING|P_VI_DEF,
+#ifdef FEAT_VERTSPLIT
+ (char_u *)&p_ead, PV_NONE,
+ {(char_u *)"both", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"edcompatible","ed", P_BOOL|P_VI_DEF,
+ (char_u *)&p_ed, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"encoding", "enc", P_STRING|P_VI_DEF|P_RCLR,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_enc, PV_NONE,
+ {(char_u *)ENC_DFLT, (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"endofline", "eol", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
+ (char_u *)&p_eol, PV_EOL,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"equalalways", "ea", P_BOOL|P_VI_DEF|P_RALL,
+ (char_u *)&p_ea, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"equalprg", "ep", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+ (char_u *)&p_ep, OPT_BOTH(PV_EP),
+ {(char_u *)"", (char_u *)0L}},
+ {"errorbells", "eb", P_BOOL|P_VI_DEF,
+ (char_u *)&p_eb, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"errorfile", "ef", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_ef, PV_NONE,
+ {(char_u *)DFLT_ERRORFILE, (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"errorformat", "efm", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_efm, OPT_BOTH(PV_EFM),
+ {(char_u *)DFLT_EFM, (char_u *)0L},
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"esckeys", "ek", P_BOOL|P_VIM,
+ (char_u *)&p_ek, PV_NONE,
+ {(char_u *)FALSE, (char_u *)TRUE}},
+ {"eventignore", "ei", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_AUTOCMD
+ (char_u *)&p_ei, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"expandtab", "et", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_et, PV_ET,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"exrc", "ex", P_BOOL|P_VI_DEF|P_SECURE,
+ (char_u *)&p_exrc, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"fileencoding","fenc", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_RBUF|P_NO_MKRC,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_fenc, PV_FENC,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"fileencodings","fencs", P_STRING|P_VI_DEF|P_COMMA,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_fencs, PV_NONE,
+ {(char_u *)"ucs-bom", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"fileformat", "ff", P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC,
+ (char_u *)&p_ff, PV_FF,
+ {(char_u *)DFLT_FF, (char_u *)0L}},
+ {"fileformats", "ffs", P_STRING|P_VIM|P_COMMA|P_NODUP,
+ (char_u *)&p_ffs, PV_NONE,
+ {(char_u *)DFLT_FFS_VI, (char_u *)DFLT_FFS_VIM}},
+ {"filetype", "ft", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB,
+#ifdef FEAT_AUTOCMD
+ (char_u *)&p_ft, PV_FT,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ (char_u *)&p_fcs, PV_NONE,
+ {(char_u *)"vert:|,fold:-", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#endif
+ },
+ {"fkmap", "fk", P_BOOL|P_VI_DEF,
+#ifdef FEAT_FKMAP
+ (char_u *)&p_fkmap, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"flash", "fl", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+#ifdef FEAT_FOLDING
+ {"foldclose", "fcl", P_STRING|P_VI_DEF|P_COMMA|P_NODUP|P_RWIN,
+ (char_u *)&p_fcl, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"foldcolumn", "fdc", P_NUM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FDC,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"foldenable", "fen", P_BOOL|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FEN,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"foldexpr", "fde", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
+# ifdef FEAT_EVAL
+ (char_u *)VAR_WIN, PV_FDE,
+ {(char_u *)"0", (char_u *)NULL}
+# else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+# endif
+ },
+ {"foldignore", "fdi", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FDI,
+ {(char_u *)"#", (char_u *)NULL}},
+ {"foldlevel", "fdl", P_NUM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FDL,
+ {(char_u *)0L, (char_u *)0L}},
+ {"foldlevelstart","fdls", P_NUM|P_VI_DEF,
+ (char_u *)&p_fdls, PV_NONE,
+ {(char_u *)-1L, (char_u *)0L}},
+ {"foldmarker", "fmr", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|
+ P_RWIN|P_COMMA|P_NODUP,
+ (char_u *)VAR_WIN, PV_FMR,
+ {(char_u *)"{{{,}}}", (char_u *)NULL}},
+ {"foldmethod", "fdm", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FDM,
+ {(char_u *)"manual", (char_u *)NULL}},
+ {"foldminlines","fml", P_NUM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FML,
+ {(char_u *)1L, (char_u *)0L}},
+ {"foldnestmax", "fdn", P_NUM|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_FDN,
+ {(char_u *)20L, (char_u *)0L}},
+ {"foldopen", "fdo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_fdo, PV_NONE,
+ {(char_u *)"block,hor,mark,percent,quickfix,search,tag,undo",
+ (char_u *)0L}},
+ {"foldtext", "fdt", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN,
+# ifdef FEAT_EVAL
+ (char_u *)VAR_WIN, PV_FDT,
+ {(char_u *)"foldtext()", (char_u *)NULL}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+#endif
+ {"formatoptions","fo", P_STRING|P_ALLOCED|P_VIM|P_FLAGLIST,
+ (char_u *)&p_fo, PV_FO,
+ {(char_u *)DFLT_FO_VI, (char_u *)DFLT_FO_VIM}},
+ {"formatprg", "fp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+ (char_u *)&p_fp, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"gdefault", "gd", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_gd, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"graphic", "gr", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"grepformat", "gfm", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_gefm, PV_NONE,
+ {(char_u *)DFLT_GREPFORMAT, (char_u *)0L},
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"grepprg", "gp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_gp, OPT_BOTH(PV_GP),
+ {
+# ifdef WIN3264
+ /* may be changed to "grep -n" in os_win32.c */
+ (char_u *)"findstr /n",
+# else
+# ifdef UNIX
+ /* Add an extra file name so that grep will always
+ * insert a file name in the match line. */
+ (char_u *)"grep -n $* /dev/null",
+# else
+# ifdef VMS
+ (char_u *)"SEARCH/NUMBERS ",
+# else
+ (char_u *)"grep -n ",
+#endif
+#endif
+# endif
+ (char_u *)0L},
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guicursor", "gcr", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef CURSOR_SHAPE
+ (char_u *)&p_guicursor, PV_NONE,
+ {
+# ifdef FEAT_GUI
+ (char_u *)"n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175",
+# else /* MSDOS or Win32 console */
+ (char_u *)"n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block",
+# endif
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guifont", "gfn", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
+#ifdef FEAT_GUI
+ (char_u *)&p_guifont, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guifontset", "gfs", P_STRING|P_VI_DEF|P_RCLR|P_COMMA,
+#if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
+ (char_u *)&p_guifontset, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guifontwide", "gfw", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
+#if defined(FEAT_GUI) && defined(FEAT_MBYTE)
+ (char_u *)&p_guifontwide, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guiheadroom", "ghr", P_NUM|P_VI_DEF,
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+ (char_u *)&p_ghr, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)50L, (char_u *)0L}},
+ {"guioptions", "go", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST,
+#if defined(FEAT_GUI)
+ (char_u *)&p_go, PV_NONE,
+# if defined(UNIX) && !defined(MACOS)
+ {(char_u *)"agimrLtT", (char_u *)0L}
+# else
+ {(char_u *)"gmrLtT", (char_u *)0L}
+# endif
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"guipty", NULL, P_BOOL|P_VI_DEF,
+#if defined(FEAT_GUI)
+ (char_u *)&p_guipty, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"hardtabs", "ht", P_NUM|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"helpfile", "hf", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+ (char_u *)&p_hf, PV_NONE,
+ {(char_u *)DFLT_HELPFILE, (char_u *)0L}},
+ {"helpheight", "hh", P_NUM|P_VI_DEF,
+#ifdef FEAT_WINDOWS
+ (char_u *)&p_hh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)20L, (char_u *)0L}},
+ {"helplang", "hlg", P_STRING|P_VI_DEF|P_COMMA,
+#ifdef FEAT_MULTI_LANG
+ (char_u *)&p_hlg, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"hidden", "hid", P_BOOL|P_VI_DEF,
+ (char_u *)&p_hid, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
+ (char_u *)&p_hl, PV_NONE,
+ {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn",
+ (char_u *)0L}},
+ {"history", "hi", P_NUM|P_VIM,
+ (char_u *)&p_hi, PV_NONE,
+ {(char_u *)0L, (char_u *)20L}},
+ {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)&p_hkmap, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"hkmapp", "hkp", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)&p_hkmapp, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"hlsearch", "hls", P_BOOL|P_VI_DEF|P_VIM|P_RALL,
+ (char_u *)&p_hls, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"icon", NULL, P_BOOL|P_VI_DEF,
+#ifdef FEAT_TITLE
+ (char_u *)&p_icon, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"iconstring", NULL, P_STRING|P_VI_DEF,
+#ifdef FEAT_TITLE
+ (char_u *)&p_iconstring, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"ignorecase", "ic", P_BOOL|P_VI_DEF,
+ (char_u *)&p_ic, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"imactivatekey","imak",P_STRING|P_VI_DEF,
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ (char_u *)&p_imak, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"imcmdline", "imc", P_BOOL|P_VI_DEF,
+#ifdef USE_IM_CONTROL
+ (char_u *)&p_imcmdline, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"imdisable", "imd", P_BOOL|P_VI_DEF,
+#ifdef USE_IM_CONTROL
+ (char_u *)&p_imdisable, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+#ifdef __sgi
+ {(char_u *)TRUE, (char_u *)0L}
+#else
+ {(char_u *)FALSE, (char_u *)0L}
+#endif
+ },
+ {"iminsert", "imi", P_NUM|P_VI_DEF,
+ (char_u *)&p_iminsert, PV_IMI,
+#ifdef B_IMODE_IM
+ {(char_u *)B_IMODE_IM, (char_u *)0L}
+#else
+ {(char_u *)B_IMODE_NONE, (char_u *)0L}
+#endif
+ },
+ {"imsearch", "ims", P_NUM|P_VI_DEF,
+ (char_u *)&p_imsearch, PV_IMS,
+#ifdef B_IMODE_IM
+ {(char_u *)B_IMODE_IM, (char_u *)0L}
+#else
+ {(char_u *)B_IMODE_NONE, (char_u *)0L}
+#endif
+ },
+ {"include", "inc", P_STRING|P_ALLOCED|P_VI_DEF,
+#ifdef FEAT_FIND_ID
+ (char_u *)&p_inc, OPT_BOTH(PV_INC),
+ {(char_u *)"^\\s*#\\s*include", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"includeexpr", "inex", P_STRING|P_ALLOCED|P_VI_DEF,
+#if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+ (char_u *)&p_inex, PV_INEX,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"incsearch", "is", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_is, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ (char_u *)&p_inde, PV_INDE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"indentkeys", "indk", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ (char_u *)&p_indk, PV_INDK,
+ {(char_u *)"0{,0},:,0#,!^F,o,O,e", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"infercase", "inf", P_BOOL|P_VI_DEF,
+ (char_u *)&p_inf, PV_INF,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"insertmode", "im", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_im, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"isfname", "isf", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_isf, PV_NONE,
+ {
+#ifdef BACKSLASH_IN_FILENAME
+ /* Excluded are: & and ^ are special in cmd.exe
+ * ( and ) are used in text separating fnames */
+ (char_u *)"@,48-57,/,\\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,=",
+#else
+# ifdef AMIGA
+ (char_u *)"@,48-57,/,.,-,_,+,,,$,:",
+# else
+# ifdef VMS
+ (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~",
+# else /* UNIX et al. */
+# ifdef EBCDIC
+ (char_u *)"@,240-249,/,.,-,_,+,,,#,$,%,~,=",
+# else
+ (char_u *)"@,48-57,/,.,-,_,+,,,#,$,%,~,=",
+# endif
+# endif
+# endif
+#endif
+ (char_u *)0L}},
+ {"isident", "isi", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_isi, PV_NONE,
+ {
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ (char_u *)"@,48-57,_,128-167,224-235",
+#else
+# ifdef EBCDIC
+ /* TODO: EBCDIC Check this! @ == isalpha()*/
+ (char_u *)"@,240-249,_,66-73,81-89,98-105,"
+ "112-120,128,140-142,156,158,172,"
+ "174,186,191,203-207,219-225,235-239,"
+ "251-254",
+# else
+ (char_u *)"@,48-57,_,192-255",
+# endif
+#endif
+ (char_u *)0L}},
+ {"iskeyword", "isk", P_STRING|P_ALLOCED|P_VIM|P_COMMA|P_NODUP,
+ (char_u *)&p_isk, PV_ISK,
+ {
+#ifdef EBCDIC
+ (char_u *)"@,240-249,_",
+ /* TODO: EBCDIC Check this! @ == isalpha()*/
+ (char_u *)"@,240-249,_,66-73,81-89,98-105,"
+ "112-120,128,140-142,156,158,172,"
+ "174,186,191,203-207,219-225,235-239,"
+ "251-254",
+#else
+ (char_u *)"@,48-57,_",
+# if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ (char_u *)"@,48-57,_,128-167,224-235"
+# else
+ (char_u *)"@,48-57,_,192-255"
+# endif
+#endif
+ }},
+ {"isprint", "isp", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
+ (char_u *)&p_isp, PV_NONE,
+ {
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2) || defined(MACOS) \
+ || defined(VMS)
+ (char_u *)"@,~-255",
+#else
+# ifdef EBCDIC
+ /* all chars above 63 are printable */
+ (char_u *)"63-255",
+# else
+ (char_u *)"@,161-255",
+# endif
+#endif
+ (char_u *)0L}},
+ {"joinspaces", "js", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_js, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"key", NULL, P_STRING|P_ALLOCED|P_VI_DEF|P_NO_MKRC,
+#ifdef FEAT_CRYPT
+ (char_u *)&p_key, PV_KEY,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"keymap", "kmp", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_RSTAT,
+#ifdef FEAT_KEYMAP
+ (char_u *)&p_keymap, PV_KMAP,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#endif
+ },
+ {"keymodel", "km", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_VISUAL
+ (char_u *)&p_km, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+ (char_u *)&p_kp, OPT_BOTH(PV_KP),
+ {
+#if defined(MSDOS) || defined(MSWIN)
+ (char_u *)":help",
+#else
+#ifdef VMS
+ (char_u *)"help",
+#else
+# if defined(OS2)
+ (char_u *)"view /",
+# else
+# ifdef USEMAN_S
+ (char_u *)"man -s",
+# else
+ (char_u *)"man",
+# endif
+# endif
+#endif
+#endif
+ (char_u *)0L}},
+ {"langmap", "lmap", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_LANGMAP
+ (char_u *)&p_langmap, PV_NONE,
+ {(char_u *)"", /* unmatched } */
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL,
+#endif
+ (char_u *)0L}},
+ {"langmenu", "lm", P_STRING|P_VI_DEF,
+#if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
+ (char_u *)&p_lm, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
+#ifdef FEAT_WINDOWS
+ (char_u *)&p_ls, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)1L, (char_u *)0L}},
+ {"lazyredraw", "lz", P_BOOL|P_VI_DEF,
+ (char_u *)&p_lz, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN,
+#ifdef FEAT_LINEBREAK
+ (char_u *)VAR_WIN, PV_LBR,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"lines", NULL, P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
+ (char_u *)&Rows, PV_NONE,
+ {
+#if defined(MSDOS) || defined(WIN3264) || defined(OS2)
+ (char_u *)25L,
+#else
+ (char_u *)24L,
+#endif
+ (char_u *)0L}},
+ {"linespace", "lsp", P_NUM|P_VI_DEF|P_RCLR,
+#ifdef FEAT_GUI
+ (char_u *)&p_linespace, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+#ifdef FEAT_GUI_W32
+ {(char_u *)1L, (char_u *)0L}
+#else
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"lisp", NULL, P_BOOL|P_VI_DEF,
+#ifdef FEAT_LISP
+ (char_u *)&p_lisp, PV_LISP,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"lispwords", "lw", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_LISP
+ (char_u *)&p_lispwords, PV_NONE,
+ {(char_u *)LISPWORD_VALUE, (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#endif
+ },
+ {"list", NULL, P_BOOL|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_LIST,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"listchars", "lcs", P_STRING|P_VI_DEF|P_RALL|P_COMMA|P_NODUP,
+ (char_u *)&p_lcs, PV_NONE,
+ {(char_u *)"eol:$", (char_u *)0L}},
+ {"loadplugins", "lpl", P_BOOL|P_VI_DEF,
+ (char_u *)&p_lpl, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"magic", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_magic, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"makeef", "mef", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_mef, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"makeprg", "mp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_mp, OPT_BOTH(PV_MP),
+# ifdef VMS
+ {(char_u *)"MMS", (char_u *)0L}
+# else
+ {(char_u *)"make", (char_u *)0L}
+# endif
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"matchpairs", "mps", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_mps, PV_MPS,
+ {(char_u *)"(:),{:},[:]", (char_u *)0L}},
+ {"matchtime", "mat", P_NUM|P_VI_DEF,
+ (char_u *)&p_mat, PV_NONE,
+ {(char_u *)5L, (char_u *)0L}},
+ {"maxfuncdepth", "mfd", P_NUM|P_VI_DEF,
+#ifdef FEAT_EVAL
+ (char_u *)&p_mfd, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)100L, (char_u *)0L}},
+ {"maxmapdepth", "mmd", P_NUM|P_VI_DEF,
+ (char_u *)&p_mmd, PV_NONE,
+ {(char_u *)1000L, (char_u *)0L}},
+ {"maxmem", "mm", P_NUM|P_VI_DEF,
+ (char_u *)&p_mm, PV_NONE,
+ {(char_u *)DFLT_MAXMEM, (char_u *)0L}},
+ {"maxmemtot", "mmt", P_NUM|P_VI_DEF,
+ (char_u *)&p_mmt, PV_NONE,
+ {(char_u *)DFLT_MAXMEMTOT, (char_u *)0L}},
+ {"menuitems", "mis", P_NUM|P_VI_DEF,
+#ifdef FEAT_MENU
+ (char_u *)&p_mis, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)25L, (char_u *)0L}},
+ {"mesg", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"modeline", "ml", P_BOOL|P_VIM,
+ (char_u *)&p_ml, PV_ML,
+ {(char_u *)FALSE, (char_u *)TRUE}},
+ {"modelines", "mls", P_NUM|P_VI_DEF,
+ (char_u *)&p_mls, PV_NONE,
+ {(char_u *)5L, (char_u *)0L}},
+ {"modifiable", "ma", P_BOOL|P_VI_DEF|P_NOGLOB,
+ (char_u *)&p_ma, PV_MA,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"modified", "mod", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
+ (char_u *)&p_mod, PV_MOD,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"more", NULL, P_BOOL|P_VIM,
+ (char_u *)&p_more, PV_NONE,
+ {(char_u *)FALSE, (char_u *)TRUE}},
+ {"mouse", NULL, P_STRING|P_VI_DEF|P_FLAGLIST,
+ (char_u *)&p_mouse, PV_NONE,
+ {
+#if defined(MSDOS) || defined(WIN3264)
+ (char_u *)"a",
+#else
+ (char_u *)"",
+#endif
+ (char_u *)0L}},
+ {"mousefocus", "mousef", P_BOOL|P_VI_DEF,
+#ifdef FEAT_GUI
+ (char_u *)&p_mousef, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"mousehide", "mh", P_BOOL|P_VI_DEF,
+#ifdef FEAT_GUI
+ (char_u *)&p_mh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"mousemodel", "mousem", P_STRING|P_VI_DEF,
+ (char_u *)&p_mousem, PV_NONE,
+ {
+#if defined(MSDOS) || defined(MSWIN)
+ (char_u *)"popup",
+#else
+# if defined(MACOS)
+ (char_u *)"popup_setpos",
+# else
+ (char_u *)"extend",
+# endif
+#endif
+ (char_u *)0L}},
+ {"mouseshape", "mouses", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_MOUSESHAPE
+ (char_u *)&p_mouseshape, PV_NONE,
+ {(char_u *)"i-r:beam,s:updown,sd:udsizing,vs:leftright,vd:lrsizing,m:no,ml:up-arrow,v:rightup-arrow", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"mousetime", "mouset", P_NUM|P_VI_DEF,
+ (char_u *)&p_mouset, PV_NONE,
+ {(char_u *)500L, (char_u *)0L}},
+ {"novice", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"nrformats", "nf", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_nf, PV_NF,
+ {(char_u *)"octal,hex", (char_u *)0L}},
+ {"number", "nu", P_BOOL|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_NU,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"open", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"optimize", "opt", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"osfiletype", "oft", P_STRING|P_ALLOCED|P_VI_DEF,
+#ifdef FEAT_OSFILETYPE
+ (char_u *)&p_oft, PV_OFT,
+ {(char_u *)DFLT_OFT, (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"paragraphs", "para", P_STRING|P_VI_DEF,
+ (char_u *)&p_para, PV_NONE,
+ {(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}},
+ {"paste", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_paste, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"pastetoggle", "pt", P_STRING|P_VI_DEF,
+ (char_u *)&p_pt, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"patchexpr", "pex", P_STRING|P_VI_DEF|P_SECURE,
+#if defined(FEAT_DIFF) && defined(FEAT_EVAL)
+ (char_u *)&p_pex, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"patchmode", "pm", P_STRING|P_VI_DEF,
+ (char_u *)&p_pm, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_path, OPT_BOTH(PV_PATH),
+ {
+#if defined AMIGA || defined MSDOS || defined MSWIN
+ (char_u *)".,,",
+#else
+# if defined(__EMX__)
+ (char_u *)".,/emx/include,,",
+# else /* Unix, probably */
+ (char_u *)".,/usr/include,,",
+# endif
+#endif
+ (char_u *)0L}},
+ {"preserveindent", "pi", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_pi, PV_PI,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"previewheight", "pvh",P_NUM|P_VI_DEF,
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ (char_u *)&p_pvh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)12L, (char_u *)0L}},
+ {"previewwindow", "pvw", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB,
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ (char_u *)VAR_WIN, PV_PVW,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"printdevice", "pdev", P_STRING|P_VI_DEF,
+#ifdef FEAT_PRINTER
+ (char_u *)&p_pdev, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"printencoding", "penc", P_STRING|P_VI_DEF,
+#ifdef FEAT_POSTSCRIPT
+ (char_u *)&p_penc, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"printexpr", "pexpr", P_STRING|P_VI_DEF,
+#ifdef FEAT_POSTSCRIPT
+ (char_u *)&p_pexpr, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"printfont", "pfn", P_STRING|P_VI_DEF,
+#ifdef FEAT_PRINTER
+ (char_u *)&p_pfn, PV_NONE,
+ {
+# ifdef MSWIN
+ (char_u *)"Courier_New:h10",
+# else
+ (char_u *)"courier",
+# endif
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"printheader", "pheader", P_STRING|P_VI_DEF|P_GETTEXT,
+#ifdef FEAT_PRINTER
+ (char_u *)&p_header, PV_NONE,
+ {(char_u *)N_("%<%f%h%m%=Page %N"), (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"printoptions", "popt", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_PRINTER
+ (char_u *)&p_popt, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"prompt", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"readonly", "ro", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB,
+ (char_u *)&p_ro, PV_RO,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"redraw", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"remap", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_remap, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"report", NULL, P_NUM|P_VI_DEF,
+ (char_u *)&p_report, PV_NONE,
+ {(char_u *)2L, (char_u *)0L}},
+ {"restorescreen", "rs", P_BOOL|P_VI_DEF,
+#ifdef WIN3264
+ (char_u *)&p_rs, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"revins", "ri", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)&p_ri, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"rightleft", "rl", P_BOOL|P_VI_DEF|P_RWIN,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)VAR_WIN, PV_RL,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"rightleftcmd", "rlc", P_STRING|P_ALLOCED|P_VI_DEF|P_RWIN,
+#ifdef FEAT_RIGHTLEFT
+ (char_u *)VAR_WIN, PV_RLC,
+ {(char_u *)"search", (char_u *)NULL}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"ruler", "ru", P_BOOL|P_VI_DEF|P_VIM|P_RSTAT,
+#ifdef FEAT_CMDL_INFO
+ (char_u *)&p_ru, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"rulerformat", "ruf", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT,
+#ifdef FEAT_STL_OPT
+ (char_u *)&p_ruf, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"runtimepath", "rtp", P_STRING|P_VI_DEF|P_EXPAND|P_COMMA|P_NODUP|P_SECURE,
+ (char_u *)&p_rtp, PV_NONE,
+ {(char_u *)DFLT_RUNTIMEPATH, (char_u *)0L}},
+ {"scroll", "scr", P_NUM|P_NO_MKRC|P_VI_DEF,
+ (char_u *)VAR_WIN, PV_SCROLL,
+ {(char_u *)12L, (char_u *)0L}},
+ {"scrollbind", "scb", P_BOOL|P_VI_DEF,
+#ifdef FEAT_SCROLLBIND
+ (char_u *)VAR_WIN, PV_SCBIND,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"scrolljump", "sj", P_NUM|P_VI_DEF|P_VIM,
+ (char_u *)&p_sj, PV_NONE,
+ {(char_u *)1L, (char_u *)0L}},
+ {"scrolloff", "so", P_NUM|P_VI_DEF|P_VIM|P_RALL,
+ (char_u *)&p_so, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"scrollopt", "sbo", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_SCROLLBIND
+ (char_u *)&p_sbo, PV_NONE,
+ {(char_u *)"ver,jump", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"sections", "sect", P_STRING|P_VI_DEF,
+ (char_u *)&p_sections, PV_NONE,
+ {(char_u *)"SHNHH HUnhsh", (char_u *)0L}},
+ {"secure", NULL, P_BOOL|P_VI_DEF|P_SECURE,
+ (char_u *)&p_secure, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"selection", "sel", P_STRING|P_VI_DEF,
+#ifdef FEAT_VISUAL
+ (char_u *)&p_sel, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"inclusive", (char_u *)0L}},
+ {"selectmode", "slm", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_VISUAL
+ (char_u *)&p_slm, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"sessionoptions", "ssop", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_SESSION
+ (char_u *)&p_ssop, PV_NONE,
+ {(char_u *)"blank,buffers,curdir,folds,help,options,winsize",
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"shell", "sh", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+ (char_u *)&p_sh, PV_NONE,
+ {
+#ifdef VMS
+ (char_u *)"-",
+#else
+# if defined(MSDOS)
+ (char_u *)"command",
+# else
+# if defined(WIN16)
+ (char_u *)"command.com",
+# else
+# if defined(WIN3264)
+ (char_u *)"", /* set in set_init_1() */
+# else
+# if defined(OS2)
+ (char_u *)"cmd.exe",
+# else
+# if defined(ARCHIE)
+ (char_u *)"gos",
+# else
+ (char_u *)"sh",
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif /* VMS */
+ (char_u *)0L}},
+ {"shellcmdflag","shcf", P_STRING|P_VI_DEF|P_SECURE,
+ (char_u *)&p_shcf, PV_NONE,
+ {
+#if defined(MSDOS) || defined(MSWIN)
+ (char_u *)"/c",
+#else
+# if defined(OS2)
+ (char_u *)"/c",
+# else
+ (char_u *)"-c",
+# endif
+#endif
+ (char_u *)0L}},
+ {"shellpipe", "sp", P_STRING|P_VI_DEF|P_SECURE,
+#ifdef FEAT_QUICKFIX
+ (char_u *)&p_sp, PV_NONE,
+ {
+#if defined(UNIX) || defined(OS2)
+# ifdef ARCHIE
+ (char_u *)"2>",
+# else
+ (char_u *)"| tee",
+# endif
+#else
+ (char_u *)">",
+#endif
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"shellquote", "shq", P_STRING|P_VI_DEF|P_SECURE,
+ (char_u *)&p_shq, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"shellredir", "srr", P_STRING|P_VI_DEF|P_SECURE,
+ (char_u *)&p_srr, PV_NONE,
+ {(char_u *)">", (char_u *)0L}},
+ {"shellslash", "ssl", P_BOOL|P_VI_DEF,
+#ifdef BACKSLASH_IN_FILENAME
+ (char_u *)&p_ssl, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"shelltype", "st", P_NUM|P_VI_DEF,
+#ifdef AMIGA
+ (char_u *)&p_st, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L}},
+ {"shellxquote", "sxq", P_STRING|P_VI_DEF|P_SECURE,
+ (char_u *)&p_sxq, PV_NONE,
+ {
+#if defined(UNIX) && defined(USE_SYSTEM) && !defined(__EMX__)
+ (char_u *)"\"",
+#else
+ (char_u *)"",
+#endif
+ (char_u *)0L}},
+ {"shiftround", "sr", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_sr, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"shiftwidth", "sw", P_NUM|P_VI_DEF,
+ (char_u *)&p_sw, PV_SW,
+ {(char_u *)8L, (char_u *)0L}},
+ {"shortmess", "shm", P_STRING|P_VIM|P_FLAGLIST,
+ (char_u *)&p_shm, PV_NONE,
+ {(char_u *)"", (char_u *)"filnxtToO"}},
+ {"shortname", "sn", P_BOOL|P_VI_DEF,
+#ifdef SHORT_FNAME
+ (char_u *)NULL, PV_NONE,
+#else
+ (char_u *)&p_sn, PV_SN,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL,
+#ifdef FEAT_LINEBREAK
+ (char_u *)&p_sbr, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"showcmd", "sc", P_BOOL|P_VIM,
+#ifdef FEAT_CMDL_INFO
+ (char_u *)&p_sc, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE,
+#ifdef UNIX
+ (char_u *)FALSE
+#else
+ (char_u *)TRUE
+#endif
+ }},
+ {"showfulltag", "sft", P_BOOL|P_VI_DEF,
+ (char_u *)&p_sft, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"showmatch", "sm", P_BOOL|P_VI_DEF,
+ (char_u *)&p_sm, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"showmode", "smd", P_BOOL|P_VIM,
+ (char_u *)&p_smd, PV_NONE,
+ {(char_u *)FALSE, (char_u *)TRUE}},
+ {"sidescroll", "ss", P_NUM|P_VI_DEF,
+ (char_u *)&p_ss, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"sidescrolloff", "siso", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
+ (char_u *)&p_siso, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"slowopen", "slow", P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"smartcase", "scs", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_scs, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"smartindent", "si", P_BOOL|P_VI_DEF|P_VIM,
+#ifdef FEAT_SMARTINDENT
+ (char_u *)&p_si, PV_SI,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"smarttab", "sta", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_sta, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"softtabstop", "sts", P_NUM|P_VI_DEF|P_VIM,
+ (char_u *)&p_sts, PV_STS,
+ {(char_u *)0L, (char_u *)0L}},
+ {"sourceany", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"splitbelow", "sb", P_BOOL|P_VI_DEF,
+#ifdef FEAT_WINDOWS
+ (char_u *)&p_sb, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"splitright", "spr", P_BOOL|P_VI_DEF,
+#ifdef FEAT_VERTSPLIT
+ (char_u *)&p_spr, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"startofline", "sol", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_sol, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"statusline" ,"stl", P_STRING|P_VI_DEF|P_ALLOCED|P_RSTAT,
+#ifdef FEAT_STL_OPT
+ (char_u *)&p_stl, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"suffixes", "su", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_su, PV_NONE,
+ {(char_u *)".bak,~,.o,.h,.info,.swp,.obj",
+ (char_u *)0L}},
+ {"suffixesadd", "sua", P_STRING|P_VI_DEF|P_ALLOCED|P_COMMA|P_NODUP,
+#if defined(FEAT_SEARCHPATH)
+ (char_u *)&p_sua, PV_SUA,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"swapfile", "swf", P_BOOL|P_VI_DEF|P_RSTAT,
+ (char_u *)&p_swf, PV_SWF,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"swapsync", "sws", P_STRING|P_VI_DEF,
+ (char_u *)&p_sws, PV_NONE,
+ {(char_u *)"fsync", (char_u *)0L}},
+ {"switchbuf", "swb", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_swb, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"syntax", "syn", P_STRING|P_ALLOCED|P_VI_DEF|P_NOGLOB,
+#ifdef FEAT_SYN_HL
+ (char_u *)&p_syn, PV_SYN,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF,
+ (char_u *)&p_ts, PV_TS,
+ {(char_u *)8L, (char_u *)0L}},
+ {"tagbsearch", "tbs", P_BOOL|P_VI_DEF,
+ (char_u *)&p_tbs, PV_NONE,
+#ifdef VMS /* binary searching doesn't appear to work on VMS */
+ {(char_u *)0L, (char_u *)0L}
+#else
+ {(char_u *)TRUE, (char_u *)0L}
+#endif
+ },
+ {"taglength", "tl", P_NUM|P_VI_DEF,
+ (char_u *)&p_tl, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"tagrelative", "tr", P_BOOL|P_VIM,
+ (char_u *)&p_tr, PV_NONE,
+ {(char_u *)FALSE, (char_u *)TRUE}},
+ {"tags", "tag", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_tags, OPT_BOTH(PV_TAGS),
+ {
+#if defined(FEAT_EMACS_TAGS) && !defined(CASE_INSENSITIVE_FILENAME)
+ (char_u *)"./tags,./TAGS,tags,TAGS",
+#else
+ (char_u *)"./tags,tags",
+#endif
+ (char_u *)0L}},
+ {"tagstack", "tgst", P_BOOL|P_VI_DEF,
+ (char_u *)&p_tgst, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"term", NULL, P_STRING|P_EXPAND|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RALL,
+ (char_u *)&T_NAME, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"termbidi", "tbidi", P_BOOL|P_VI_DEF,
+#ifdef FEAT_ARABIC
+ (char_u *)&p_tbidi, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"termencoding", "tenc", P_STRING|P_VI_DEF|P_RCLR,
+#ifdef FEAT_MBYTE
+ (char_u *)&p_tenc, PV_NONE,
+ {(char_u *)"", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"terse", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_terse, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"textauto", "ta", P_BOOL|P_VIM,
+ (char_u *)&p_ta, PV_NONE,
+ {(char_u *)DFLT_TEXTAUTO, (char_u *)TRUE}},
+ {"textmode", "tx", P_BOOL|P_VI_DEF|P_NO_MKRC,
+ (char_u *)&p_tx, PV_TX,
+ {
+#ifdef USE_CRNL
+ (char_u *)TRUE,
+#else
+ (char_u *)FALSE,
+#endif
+ (char_u *)0L}},
+ {"textwidth", "tw", P_NUM|P_VI_DEF|P_VIM,
+ (char_u *)&p_tw, PV_TW,
+ {(char_u *)0L, (char_u *)0L}},
+ {"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_INS_EXPAND
+ (char_u *)&p_tsr, OPT_BOTH(PV_TSR),
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"tildeop", "top", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_to, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"timeout", "to", P_BOOL|P_VI_DEF,
+ (char_u *)&p_timeout, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"timeoutlen", "tm", P_NUM|P_VI_DEF,
+ (char_u *)&p_tm, PV_NONE,
+ {(char_u *)1000L, (char_u *)0L}},
+ {"title", NULL, P_BOOL|P_VI_DEF,
+#ifdef FEAT_TITLE
+ (char_u *)&p_title, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"titlelen", NULL, P_NUM|P_VI_DEF,
+#ifdef FEAT_TITLE
+ (char_u *)&p_titlelen, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)85L, (char_u *)0L}},
+ {"titleold", NULL, P_STRING|P_VI_DEF|P_GETTEXT,
+#ifdef FEAT_TITLE
+ (char_u *)&p_titleold, PV_NONE,
+ {(char_u *)N_("Thanks for flying Vim"),
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"titlestring", NULL, P_STRING|P_VI_DEF,
+#ifdef FEAT_TITLE
+ (char_u *)&p_titlestring, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+ {"toolbar", "tb", P_STRING|P_COMMA|P_VI_DEF|P_NODUP,
+ (char_u *)&p_toolbar, PV_NONE,
+ {(char_u *)"icons,tooltips", (char_u *)0L}},
+#endif
+#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
+ {"toolbariconsize", "tbis", P_STRING|P_VI_DEF,
+ (char_u *)&p_tbis, PV_NONE,
+ {(char_u *)"small", (char_u *)0L}},
+#endif
+ {"ttimeout", NULL, P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_ttimeout, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"ttimeoutlen", "ttm", P_NUM|P_VI_DEF,
+ (char_u *)&p_ttm, PV_NONE,
+ {(char_u *)-1L, (char_u *)0L}},
+ {"ttybuiltin", "tbi", P_BOOL|P_VI_DEF,
+ (char_u *)&p_tbi, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"ttyfast", "tf", P_BOOL|P_NO_MKRC|P_VI_DEF,
+ (char_u *)&p_tf, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"ttymouse", "ttym", P_STRING|P_NODEFAULT|P_NO_MKRC|P_VI_DEF,
+#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
+ (char_u *)&p_ttym, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"ttyscroll", "tsl", P_NUM|P_VI_DEF,
+ (char_u *)&p_ttyscroll, PV_NONE,
+ {(char_u *)999L, (char_u *)0L}},
+ {"ttytype", "tty", P_STRING|P_EXPAND|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RALL,
+ (char_u *)&T_NAME, PV_NONE,
+ {(char_u *)"", (char_u *)0L}},
+ {"undolevels", "ul", P_NUM|P_VI_DEF,
+ (char_u *)&p_ul, PV_NONE,
+ {
+#if defined(UNIX) || defined(WIN3264) || defined(OS2) || defined(VMS)
+ (char_u *)1000L,
+#else
+ (char_u *)100L,
+#endif
+ (char_u *)0L}},
+ {"updatecount", "uc", P_NUM|P_VI_DEF,
+ (char_u *)&p_uc, PV_NONE,
+ {(char_u *)200L, (char_u *)0L}},
+ {"updatetime", "ut", P_NUM|P_VI_DEF,
+ (char_u *)&p_ut, PV_NONE,
+ {(char_u *)4000L, (char_u *)0L}},
+ {"verbose", "vbs", P_NUM|P_VI_DEF,
+ (char_u *)&p_verbose, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"viewdir", "vdir", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#ifdef FEAT_SESSION
+ (char_u *)&p_vdir, PV_NONE,
+ {(char_u *)DFLT_VDIR, (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"viewoptions", "vop", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_SESSION
+ (char_u *)&p_vop, PV_NONE,
+ {(char_u *)"folds,options,cursor", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"viminfo", "vi", P_STRING|P_COMMA|P_NODUP|P_SECURE,
+#ifdef FEAT_VIMINFO
+ (char_u *)&p_viminfo, PV_NONE,
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+ {(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"}
+#else
+# ifdef AMIGA
+ {(char_u *)"",
+ (char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"}
+# else
+ {(char_u *)"", (char_u *)"'20,<50,s10,h"}
+# endif
+#endif
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"virtualedit", "ve", P_STRING|P_COMMA|P_NODUP|P_VI_DEF|P_VIM,
+#ifdef FEAT_VIRTUALEDIT
+ (char_u *)&p_ve, PV_NONE,
+ {(char_u *)"", (char_u *)""}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ },
+ {"visualbell", "vb", P_BOOL|P_VI_DEF,
+ (char_u *)&p_vb, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"w300", NULL, P_NUM|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"w1200", NULL, P_NUM|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"w9600", NULL, P_NUM|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"warn", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_warn, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"weirdinvert", "wiv", P_BOOL|P_VI_DEF|P_RCLR,
+ (char_u *)&p_wiv, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"whichwrap", "ww", P_STRING|P_VIM|P_COMMA|P_FLAGLIST,
+ (char_u *)&p_ww, PV_NONE,
+ {(char_u *)"", (char_u *)"b,s"}},
+ {"wildchar", "wc", P_NUM|P_VIM,
+ (char_u *)&p_wc, PV_NONE,
+ {(char_u *)(long)Ctrl_E, (char_u *)(long)TAB}},
+ {"wildcharm", "wcm", P_NUM|P_VI_DEF,
+ (char_u *)&p_wcm, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"wildignore", "wig", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_WILDIGN
+ (char_u *)&p_wig, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)"", (char_u *)0L}},
+ {"wildmenu", "wmnu", P_BOOL|P_VI_DEF,
+#ifdef FEAT_WILDMENU
+ (char_u *)&p_wmnu, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"wildmode", "wim", P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+ (char_u *)&p_wim, PV_NONE,
+ {(char_u *)"full", (char_u *)0L}},
+ {"winaltkeys", "wak", P_STRING|P_VI_DEF,
+#ifdef FEAT_WAK
+ (char_u *)&p_wak, PV_NONE,
+ {(char_u *)"menu", (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ },
+ {"window", "wi", P_NUM|P_VI_DEF,
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+ {"winheight", "wh", P_NUM|P_VI_DEF,
+#ifdef FEAT_WINDOWS
+ (char_u *)&p_wh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)1L, (char_u *)0L}},
+ {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT,
+#if defined(FEAT_WINDOWS)
+ (char_u *)VAR_WIN, PV_WFH,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"winminheight", "wmh", P_NUM|P_VI_DEF,
+#ifdef FEAT_WINDOWS
+ (char_u *)&p_wmh, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)1L, (char_u *)0L}},
+ {"winminwidth", "wmw", P_NUM|P_VI_DEF,
+#ifdef FEAT_VERTSPLIT
+ (char_u *)&p_wmw, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)1L, (char_u *)0L}},
+ {"winwidth", "wiw", P_NUM|P_VI_DEF,
+#ifdef FEAT_VERTSPLIT
+ (char_u *)&p_wiw, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)20L, (char_u *)0L}},
+ {"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN,
+ (char_u *)VAR_WIN, PV_WRAP,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"wrapmargin", "wm", P_NUM|P_VI_DEF,
+ (char_u *)&p_wm, PV_WM,
+ {(char_u *)0L, (char_u *)0L}},
+ {"wrapscan", "ws", P_BOOL|P_VI_DEF,
+ (char_u *)&p_ws, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"write", NULL, P_BOOL|P_VI_DEF,
+ (char_u *)&p_write, PV_NONE,
+ {(char_u *)TRUE, (char_u *)0L}},
+ {"writeany", "wa", P_BOOL|P_VI_DEF,
+ (char_u *)&p_wa, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+ {"writebackup", "wb", P_BOOL|P_VI_DEF|P_VIM,
+ (char_u *)&p_wb, PV_NONE,
+ {
+#ifdef FEAT_WRITEBACKUP
+ (char_u *)TRUE,
+#else
+ (char_u *)FALSE,
+#endif
+ (char_u *)0L}},
+ {"writedelay", "wd", P_NUM|P_VI_DEF,
+ (char_u *)&p_wd, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}},
+
+/* terminal output codes */
+#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL, \
+ (char_u *)&vvv, PV_NONE, \
+ {(char_u *)"", (char_u *)0L}},
+
+ p_term("t_AB", T_CAB)
+ p_term("t_AF", T_CAF)
+ p_term("t_AL", T_CAL)
+ p_term("t_al", T_AL)
+ p_term("t_bc", T_BC)
+ p_term("t_cd", T_CD)
+ p_term("t_ce", T_CE)
+ p_term("t_cl", T_CL)
+ p_term("t_cm", T_CM)
+ p_term("t_Co", T_CCO)
+ p_term("t_CS", T_CCS)
+ p_term("t_cs", T_CS)
+#ifdef FEAT_VERTSPLIT
+ p_term("t_CV", T_CSV)
+#endif
+ p_term("t_ut", T_UT)
+ p_term("t_da", T_DA)
+ p_term("t_db", T_DB)
+ p_term("t_DL", T_CDL)
+ p_term("t_dl", T_DL)
+ p_term("t_fs", T_FS)
+ p_term("t_IE", T_CIE)
+ p_term("t_IS", T_CIS)
+ p_term("t_ke", T_KE)
+ p_term("t_ks", T_KS)
+ p_term("t_le", T_LE)
+ p_term("t_mb", T_MB)
+ p_term("t_md", T_MD)
+ p_term("t_me", T_ME)
+ p_term("t_mr", T_MR)
+ p_term("t_ms", T_MS)
+ p_term("t_nd", T_ND)
+ p_term("t_op", T_OP)
+ p_term("t_RI", T_CRI)
+ p_term("t_RV", T_CRV)
+ p_term("t_Sb", T_CSB)
+ p_term("t_Sf", T_CSF)
+ p_term("t_se", T_SE)
+ p_term("t_so", T_SO)
+ p_term("t_sr", T_SR)
+ p_term("t_ts", T_TS)
+ p_term("t_te", T_TE)
+ p_term("t_ti", T_TI)
+ p_term("t_ue", T_UE)
+ p_term("t_us", T_US)
+ p_term("t_vb", T_VB)
+ p_term("t_ve", T_VE)
+ p_term("t_vi", T_VI)
+ p_term("t_vs", T_VS)
+ p_term("t_WP", T_CWP)
+ p_term("t_WS", T_CWS)
+ p_term("t_xs", T_XS)
+ p_term("t_ZH", T_CZH)
+ p_term("t_ZR", T_CZR)
+
+/* terminal key codes are not in here */
+
+ {NULL, NULL, 0, NULL, PV_NONE, {NULL, NULL}} /* end marker */
+};
+
+#define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption))
+
+#ifdef FEAT_MBYTE
+static char *(p_ambw_values[]) = {"single", "double", NULL};
+#endif
+static char *(p_bg_values[]) = {"light", "dark", NULL};
+static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL};
+static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
+#ifdef FEAT_WAK
+static char *(p_wak_values[]) = {"yes", "menu", "no", NULL};
+#endif
+static char *(p_mousem_values[]) = {"extend", "popup", "popup_setpos", "mac", NULL};
+#ifdef FEAT_VISUAL
+static char *(p_sel_values[]) = {"inclusive", "exclusive", "old", NULL};
+static char *(p_slm_values[]) = {"mouse", "key", "cmd", NULL};
+#endif
+#ifdef FEAT_VISUAL
+static char *(p_km_values[]) = {"startsel", "stopsel", NULL};
+#endif
+#ifdef FEAT_BROWSE
+static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
+#endif
+#ifdef FEAT_SCROLLBIND
+static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
+#endif
+static char *(p_swb_values[]) = {"useopen", "split", NULL};
+static char *(p_debug_values[]) = {"msg", NULL};
+#ifdef FEAT_VERTSPLIT
+static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
+#endif
+#if defined(FEAT_QUICKFIX)
+static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", NULL};
+static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL};
+#endif
+static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
+#ifdef FEAT_FOLDING
+static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
+#ifdef FEAT_DIFF
+ "diff",
+#endif
+ NULL};
+static char *(p_fcl_values[]) = {"all", NULL};
+#endif
+
+static void set_option_default __ARGS((int, int opt_flags, int compatible));
+static void set_options_default __ARGS((int opt_flags));
+static char_u *illegal_char __ARGS((char_u *, int));
+static int string_to_key __ARGS((char_u *arg));
+#ifdef FEAT_CMDWIN
+static char_u *check_cedit __ARGS((void));
+#endif
+#ifdef FEAT_TITLE
+static void did_set_title __ARGS((int icon));
+#endif
+static char_u *option_expand __ARGS((int opt_idx, char_u *val));
+static void didset_options __ARGS((void));
+static void check_string_option __ARGS((char_u **pp));
+static void set_string_option_global __ARGS((int opt_idx, char_u **varp));
+static void set_string_option __ARGS((int opt_idx, char_u *value, int opt_flags));
+static char_u *did_set_string_option __ARGS((int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char_u *errbuf, int opt_flags));
+static char_u *set_chars_option __ARGS((char_u **varp));
+#ifdef FEAT_CLIPBOARD
+static char_u *check_clipboard_option __ARGS((void));
+#endif
+static char_u *set_bool_option __ARGS((int opt_idx, char_u *varp, int value, int opt_flags));
+static char_u *set_num_option __ARGS((int opt_idx, char_u *varp, long value, char_u *errbuf, int opt_flags));
+static void check_redraw __ARGS((long_u flags));
+static int findoption __ARGS((char_u *));
+static int find_key_option __ARGS((char_u *));
+static void showoptions __ARGS((int all, int opt_flags));
+static int optval_default __ARGS((struct vimoption *, char_u *varp));
+static void showoneopt __ARGS((struct vimoption *, int opt_flags));
+static int put_setstring __ARGS((FILE *fd, char *cmd, char *name, char_u **valuep, int expand));
+static int put_setnum __ARGS((FILE *fd, char *cmd, char *name, long *valuep));
+static int put_setbool __ARGS((FILE *fd, char *cmd, char *name, int value));
+static int istermoption __ARGS((struct vimoption *));
+static char_u *get_varp_scope __ARGS((struct vimoption *p, int opt_flags));
+static char_u *get_varp __ARGS((struct vimoption *));
+static void option_value2string __ARGS((struct vimoption *, int opt_flags));
+static int wc_use_keyname __ARGS((char_u *varp, long *wcp));
+#ifdef FEAT_LANGMAP
+static void langmap_init __ARGS((void));
+static void langmap_set __ARGS((void));
+#endif
+static void paste_option_changed __ARGS((void));
+static void compatible_set __ARGS((void));
+#ifdef FEAT_LINEBREAK
+static void fill_breakat_flags __ARGS((void));
+#endif
+static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list));
+static int check_opt_strings __ARGS((char_u *val, char **values, int));
+static int check_opt_wim __ARGS((void));
+
+/*
+ * Initialize the options, first part.
+ *
+ * Called only once from main(), just after creating the first buffer.
+ */
+ void
+set_init_1()
+{
+ char_u *p;
+ int opt_idx;
+ long n;
+
+#ifdef FEAT_LANGMAP
+ langmap_init();
+#endif
+
+ /* Be Vi compatible by default */
+ p_cp = TRUE;
+
+ /*
+ * Find default value for 'shell' option.
+ */
+ if ((p = mch_getenv((char_u *)"SHELL")) != NULL
+#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+# ifdef __EMX__
+ || (p = mch_getenv((char_u *)"EMXSHELL")) != NULL
+# endif
+ || (p = mch_getenv((char_u *)"COMSPEC")) != NULL
+# ifdef WIN3264
+ || (p = default_shell()) != NULL
+# endif
+#endif
+ )
+ set_string_default("sh", p);
+
+#ifdef FEAT_WILDIGN
+ /*
+ * Set the default for 'backupskip' to include environment variables for
+ * temp files.
+ */
+ {
+# ifdef UNIX
+ static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"};
+# else
+ static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"};
+# endif
+ int len;
+ garray_T ga;
+
+ ga_init2(&ga, 1, 100);
+ for (n = 0; n < (long)(sizeof(names) / sizeof(char *)); ++n)
+ {
+# ifdef UNIX
+ if (*names[n] == NUL)
+ p = (char_u *)"/tmp";
+ else
+# endif
+ p = mch_getenv((char_u *)names[n]);
+ if (p != NULL && *p != NUL)
+ {
+ /* First time count the NUL, otherwise count the ','. */
+ len = STRLEN(p) + 3;
+ if (ga_grow(&ga, len) == OK)
+ {
+ if (ga.ga_len > 0)
+ STRCAT(ga.ga_data, ",");
+ STRCAT(ga.ga_data, p);
+ add_pathsep(ga.ga_data);
+ STRCAT(ga.ga_data, "*");
+ ga.ga_room -= len;
+ ga.ga_len += len;
+ }
+ }
+ }
+ if (ga.ga_data != NULL)
+ {
+ set_string_default("bsk", ga.ga_data);
+ vim_free(ga.ga_data);
+ }
+ }
+#endif
+
+ /*
+ * 'maxmemtot' and 'maxmem' may have to be adjusted for available memory
+ */
+ opt_idx = findoption((char_u *)"maxmemtot");
+#if !defined(HAVE_AVAIL_MEM) && !defined(HAVE_TOTAL_MEM)
+ if (options[opt_idx].def_val[VI_DEFAULT] == (char_u *)0L)
+#endif
+ {
+#ifdef HAVE_AVAIL_MEM
+ /* Use amount of memory available at this moment. */
+ n = (mch_avail_mem(FALSE) >> 11);
+#else
+# ifdef HAVE_TOTAL_MEM
+ /* Use amount of memory available to Vim. */
+ n = (mch_total_mem(FALSE) >> 11);
+# else
+ n = (0x7fffffff >> 11);
+# endif
+#endif
+ options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n;
+ opt_idx = findoption((char_u *)"maxmem");
+#if !defined(HAVE_AVAIL_MEM) && !defined(HAVE_TOTAL_MEM)
+ if ((long)options[opt_idx].def_val[VI_DEFAULT] > n
+ || (long)options[opt_idx].def_val[VI_DEFAULT] == 0L)
+#endif
+ options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n;
+ }
+
+#ifdef FEAT_GUI_W32
+ /* force 'shortname' for Win32s */
+ if (gui_is_win32s())
+ options[findoption((char_u *)"shortname")].def_val[VI_DEFAULT] =
+ (char_u *)TRUE;
+#endif
+
+#ifdef FEAT_SEARCHPATH
+ {
+ char_u *cdpath;
+ char_u *buf;
+ int i;
+ int j;
+
+ /* Initialize the 'cdpath' option's default value. */
+ cdpath = mch_getenv((char_u *)"CDPATH");
+ if (cdpath != NULL)
+ {
+ buf = alloc((unsigned)((STRLEN(cdpath) << 1) + 2));
+ if (buf != NULL)
+ {
+ buf[0] = ','; /* start with ",", current dir first */
+ j = 1;
+ for (i = 0; cdpath[i] != NUL; ++i)
+ {
+ if (vim_ispathlistsep(cdpath[i]))
+ buf[j++] = ',';
+ else
+ {
+ if (cdpath[i] == ' ' || cdpath[i] == ',')
+ buf[j++] = '\\';
+ buf[j++] = cdpath[i];
+ }
+ }
+ buf[j] = NUL;
+ opt_idx = findoption((char_u *)"cdpath");
+ options[opt_idx].def_val[VI_DEFAULT] = buf;
+ options[opt_idx].flags |= P_DEF_ALLOCED;
+ }
+ }
+ }
+#endif
+
+#if defined(FEAT_POSTSCRIPT) && (defined(MSWIN) || defined(OS2) || defined(VMS) || defined(EBCDIC) || defined(MAC) || defined(hpux))
+ /* Set print encoding on platforms that don't default to latin1 */
+ set_string_default("penc",
+# if defined(MSWIN) || defined(OS2)
+ (char_u *)"cp1252"
+# else
+# ifdef VMS
+ (char_u *)"dec-mcs"
+# else
+# ifdef EBCDIC
+ (char_u *)"ebcdic-uk"
+# else
+# ifdef MAC
+ (char_u *)"mac-roman"
+# else /* HPUX */
+ (char_u *)"hp-roman8"
+# endif
+# endif
+# endif
+# endif
+ );
+#endif
+
+#ifdef FEAT_POSTSCRIPT
+ /* 'printexpr' must be allocated to be able to evaluate it. */
+ set_string_default("pexpr",
+# ifdef MSWIN
+ (char_u *)"system('copy' . ' ' . v:fname_in . ' \"' . &printdevice . '\"') . delete(v:fname_in)"
+# else
+# ifdef VMS
+ (char_u *)"system('print/delete' . (&printdevice == '' ? '' : ' /queue=' . &printdevice) . ' ' . v:fname_in)"
+
+# else
+ (char_u *)"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error"
+# endif
+# endif
+ );
+#endif
+
+ /*
+ * Set all the options (except the terminal options) to their default
+ * value. Also set the global value for local options.
+ */
+ set_options_default(0);
+
+#ifdef FEAT_GUI
+ if (found_reverse_arg)
+ set_option_value((char_u *)"bg", 0L, (char_u *)"dark", 0);
+#endif
+
+ curbuf->b_p_initialized = TRUE;
+ curbuf->b_p_ar = -1; /* no local 'autoread' value */
+ check_buf_options(curbuf);
+ check_win_options(curwin);
+ check_options();
+
+ /* Must be before option_expand(), because that one needs vim_isIDc() */
+ didset_options();
+
+#ifdef FEAT_LINEBREAK
+ /*
+ * initialize the table for 'breakat'.
+ */
+ fill_breakat_flags();
+#endif
+
+ /*
+ * Expand environment variables and things like "~" for the defaults.
+ * If option_expand() returns non-NULL the variable is expanded. This can
+ * only happen for non-indirect options.
+ * Also set the default to the expanded value, so ":set" does not list
+ * them.
+ * Don't set the P_ALLOCED flag, because we don't want to free the
+ * default.
+ */
+ for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++)
+ {
+ if ((options[opt_idx].flags & P_GETTEXT)
+ && options[opt_idx].var != NULL)
+ p = (char_u *)_(*(char **)options[opt_idx].var);
+ else
+ p = option_expand(opt_idx, NULL);
+ if (p != NULL && (p = vim_strsave(p)) != NULL)
+ {
+ *(char_u **)options[opt_idx].var = p;
+ /* VIMEXP
+ * Defaults for all expanded options are currently the same for Vi
+ * and Vim. When this changes, add some code here! Also need to
+ * split P_DEF_ALLOCED in two.
+ */
+ if (options[opt_idx].flags & P_DEF_ALLOCED)
+ vim_free(options[opt_idx].def_val[VI_DEFAULT]);
+ options[opt_idx].def_val[VI_DEFAULT] = p;
+ options[opt_idx].flags |= P_DEF_ALLOCED;
+ }
+ }
+
+ /* Initialize the highlight_attr[] table. */
+ highlight_changed();
+
+ save_file_ff(curbuf); /* Buffer is unchanged */
+
+ /* Parse default for 'wildmode' */
+ check_opt_wim();
+
+#if defined(FEAT_ARABIC)
+ /* Detect use of mlterm.
+ * Mlterm is a terminal emulator akin to xterm that has some special
+ * abilities (bidi namely).
+ * NOTE: mlterm's author is being asked to 'set' a variable
+ * instead of an environment variable due to inheritance.
+ */
+ if (mch_getenv((char_u *)"MLTERM") != NULL)
+ set_option_value((char_u *)"tbidi", 1L, NULL, 0);
+#endif
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ /* Parse default for 'fillchars'. */
+ (void)set_chars_option(&p_fcs);
+#endif
+
+#ifdef FEAT_CLIPBOARD
+ /* Parse default for 'clipboard' */
+ (void)check_clipboard_option();
+#endif
+
+#ifdef FEAT_MBYTE
+# if defined(WIN3264) && defined(FEAT_GETTEXT)
+ /*
+ * If $LANG isn't set, try to get a good value for it. This makes the
+ * right language be used automatically. Don't do this for English.
+ */
+ if (mch_getenv((char_u *)"LANG") == NULL)
+ {
+ char buf[20];
+
+ /* Could use LOCALE_SISO639LANGNAME, but it's not in Win95.
+ * LOCALE_SABBREVLANGNAME gives us three letters, like "enu", we use
+ * only the first two. */
+ n = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME,
+ (LPTSTR)buf, 20);
+ if (n >= 2 && STRNICMP(buf, "en", 2) != 0)
+ {
+ /* There are a few exceptions (probably more) */
+ if (STRNICMP(buf, "cht", 3) == 0 || STRNICMP(buf, "zht", 3) == 0)
+ STRCPY(buf, "zh_TW");
+ else if (STRNICMP(buf, "chs", 3) == 0
+ || STRNICMP(buf, "zhc", 3) == 0)
+ STRCPY(buf, "zh_CN");
+ else if (STRNICMP(buf, "jp", 2) == 0)
+ STRCPY(buf, "ja");
+ else
+ buf[2] = NUL; /* truncate to two-letter code */
+ vim_setenv("LANG", buf);
+ }
+ }
+# endif
+
+ /* enc_locale() will try to find the encoding of the current locale. */
+ p = enc_locale();
+ if (p != NULL)
+ {
+ char_u *save_enc;
+
+ /* Try setting 'encoding' and check if the value is valid.
+ * If not, go back to the default "latin1". */
+ save_enc = p_enc;
+ p_enc = p;
+ if (mb_init() == NULL)
+ {
+ opt_idx = findoption((char_u *)"encoding");
+ options[opt_idx].def_val[VI_DEFAULT] = p_enc;
+ options[opt_idx].flags |= P_DEF_ALLOCED;
+
+# if defined(WIN3264) && !defined(FEAT_GUI)
+ /* Win32 console: When GetACP() returns a different value from
+ * GetConsoleCP() set 'termencoding'. */
+ if (GetACP() != GetConsoleCP())
+ {
+ char buf[50];
+
+ sprintf(buf, "cp%ld", (long)GetConsoleCP());
+ p_tenc = vim_strsave((char_u *)buf);
+ if (p_tenc != NULL)
+ {
+ opt_idx = findoption((char_u *)"termencoding");
+ options[opt_idx].def_val[VI_DEFAULT] = p_tenc;
+ options[opt_idx].flags |= P_DEF_ALLOCED;
+ convert_setup(&input_conv, p_tenc, p_enc);
+ convert_setup(&output_conv, p_enc, p_tenc);
+ }
+ else
+ p_tenc = empty_option;
+ }
+# endif
+ }
+ else
+ {
+ vim_free(p_enc);
+ p_enc = save_enc;
+ }
+ }
+#endif
+
+#ifdef FEAT_MULTI_LANG
+ /* Set the default for 'helplang'. */
+ set_helplang_default(get_mess_lang());
+#endif
+}
+
+/*
+ * Set an option to its default value.
+ * This does not take care of side effects!
+ */
+ static void
+set_option_default(opt_idx, opt_flags, compatible)
+ int opt_idx;
+ int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+ int compatible; /* use Vi default value */
+{
+ char_u *varp; /* pointer to variable for current option */
+ int dvi; /* index in def_val[] */
+ long_u flags;
+ int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
+
+ varp = get_varp_scope(&(options[opt_idx]), both ? OPT_LOCAL : opt_flags);
+ flags = options[opt_idx].flags;
+ if (varp != NULL) /* nothing to do for hidden option */
+ {
+ dvi = ((flags & P_VI_DEF) || compatible) ? VI_DEFAULT : VIM_DEFAULT;
+ if (flags & P_STRING)
+ {
+ /* Use set_string_option_direct() for local options to handle
+ * freeing and allocating the value. */
+ if (options[opt_idx].indir != PV_NONE)
+ set_string_option_direct(NULL, opt_idx,
+ options[opt_idx].def_val[dvi], opt_flags);
+ else
+ {
+ if ((opt_flags & OPT_FREE) && (flags & P_ALLOCED))
+ free_string_option(*(char_u **)(varp));
+ *(char_u **)varp = options[opt_idx].def_val[dvi];
+ options[opt_idx].flags &= ~P_ALLOCED;
+ }
+ }
+ else if (flags & P_NUM)
+ {
+ if (varp == (char_u *)PV_SCROLL)
+ win_comp_scroll(curwin);
+ else
+ {
+ *(long *)varp = (long)options[opt_idx].def_val[dvi];
+ /* May also set global value for local option. */
+ if (both)
+ *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
+ *(long *)varp;
+ }
+ }
+ else /* P_BOOL */
+ {
+ /* the cast to long is required for Manx C */
+ *(int *)varp = (int)(long)options[opt_idx].def_val[dvi];
+ /* May also set global value for local option. */
+ if (both)
+ *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
+ *(int *)varp;
+ }
+ }
+
+#ifdef FEAT_EVAL
+ /* Remember where the option was set. */
+ options[opt_idx].scriptID = current_SID;
+#endif
+}
+
+/*
+ * Set all options (except terminal options) to their default value.
+ */
+ static void
+set_options_default(opt_flags)
+ int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+{
+ int i;
+#ifdef FEAT_WINDOWS
+ win_T *wp;
+#endif
+
+ for (i = 0; !istermoption(&options[i]); i++)
+ if (!(options[i].flags & P_NODEFAULT))
+ set_option_default(i, opt_flags, p_cp);
+
+#ifdef FEAT_WINDOWS
+ /* The 'scroll' option must be computed for all windows. */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ win_comp_scroll(wp);
+#else
+ win_comp_scroll(curwin);
+#endif
+}
+
+/*
+ * Set the Vi-default value of a string option.
+ * Used for 'sh', 'backupskip' and 'term'.
+ */
+ void
+set_string_default(name, val)
+ char *name;
+ char_u *val;
+{
+ char_u *p;
+ int opt_idx;
+
+ p = vim_strsave(val);
+ if (p != NULL) /* we don't want a NULL */
+ {
+ opt_idx = findoption((char_u *)name);
+ if (options[opt_idx].flags & P_DEF_ALLOCED)
+ vim_free(options[opt_idx].def_val[VI_DEFAULT]);
+ options[opt_idx].def_val[VI_DEFAULT] = p;
+ options[opt_idx].flags |= P_DEF_ALLOCED;
+ }
+}
+
+/*
+ * Set the Vi-default value of a number option.
+ * Used for 'lines' and 'columns'.
+ */
+ void
+set_number_default(name, val)
+ char *name;
+ long val;
+{
+ options[findoption((char_u *)name)].def_val[VI_DEFAULT] = (char_u *)val;
+}
+
+/*
+ * Initialize the options, part two: After getting Rows and Columns and
+ * setting 'term'.
+ */
+ void
+set_init_2()
+{
+ /*
+ * 'scroll' defaults to half the window height. Note that this default is
+ * wrong when the window height changes.
+ */
+ options[findoption((char_u *)"scroll")].def_val[VI_DEFAULT]
+ = (char_u *)((long_u)Rows >> 1);
+ comp_col();
+
+#if !((defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI))
+ {
+ int idx4;
+
+ /*
+ * If 'background' wasn't set by the user, try guessing the value,
+ * depending on the terminal name. Only need to check for terminals
+ * with a dark background, that can handle color. Only "linux"
+ * console at the moment.
+ */
+ idx4 = findoption((char_u *)"bg");
+ if (!(options[idx4].flags & P_WAS_SET) && STRCMP(T_NAME, "linux") == 0)
+ {
+ set_string_option_direct(NULL, idx4, (char_u *)"dark", OPT_FREE);
+ /* don't mark it as set, when starting the GUI it may be changed
+ * again */
+ options[idx4].flags &= ~P_WAS_SET;
+ }
+ }
+#endif
+}
+
+/*
+ * Initialize the options, part three: After reading the .vimrc
+ */
+ void
+set_init_3()
+{
+#if defined(UNIX) || defined(OS2) || defined(WIN3264)
+/*
+ * Set 'shellpipe' and 'shellredir', depending on the 'shell' option.
+ * This is done after other initializations, where 'shell' might have been
+ * set, but only if they have not been set before.
+ */
+ char_u *p;
+ int idx_srr;
+ int do_srr;
+#ifdef FEAT_QUICKFIX
+ int idx_sp;
+ int do_sp;
+#endif
+
+ idx_srr = findoption((char_u *)"srr");
+ do_srr = !(options[idx_srr].flags & P_WAS_SET);
+#ifdef FEAT_QUICKFIX
+ idx_sp = findoption((char_u *)"sp");
+ do_sp = !(options[idx_sp].flags & P_WAS_SET);
+#endif
+
+ /*
+ * Isolate the name of the shell:
+ * - Skip beyond any path. E.g., "/usr/bin/csh -f" -> "csh -f".
+ * - Remove any argument. E.g., "csh -f" -> "csh".
+ */
+ p = gettail(p_sh);
+ p = vim_strnsave(p, (int)(skiptowhite(p) - p));
+ if (p != NULL)
+ {
+ /*
+ * Default for p_sp is "| tee", for p_srr is ">".
+ * For known shells it is changed here to include stderr.
+ */
+ if ( fnamecmp(p, "csh") == 0
+ || fnamecmp(p, "tcsh") == 0
+# if defined(OS2) || defined(WIN3264) /* also check with .exe extension */
+ || fnamecmp(p, "csh.exe") == 0
+ || fnamecmp(p, "tcsh.exe") == 0
+# endif
+ )
+ {
+#if defined(FEAT_QUICKFIX)
+ if (do_sp)
+ {
+# ifdef WIN3264
+ p_sp = (char_u *)">&";
+# else
+ p_sp = (char_u *)"|& tee";
+# endif
+ options[idx_sp].def_val[VI_DEFAULT] = p_sp;
+ }
+#endif
+ if (do_srr)
+ {
+ p_srr = (char_u *)">&";
+ options[idx_srr].def_val[VI_DEFAULT] = p_srr;
+ }
+ }
+ else
+# ifndef OS2 /* Always use bourne shell style redirection if we reach this */
+ if ( fnamecmp(p, "sh") == 0
+ || fnamecmp(p, "ksh") == 0
+ || fnamecmp(p, "zsh") == 0
+ || fnamecmp(p, "bash") == 0
+# ifdef WIN3264
+ || fnamecmp(p, "cmd") == 0
+ || fnamecmp(p, "sh.exe") == 0
+ || fnamecmp(p, "ksh.exe") == 0
+ || fnamecmp(p, "zsh.exe") == 0
+ || fnamecmp(p, "bash.exe") == 0
+ || fnamecmp(p, "cmd.exe") == 0
+# endif
+ )
+# endif
+ {
+#if defined(FEAT_QUICKFIX)
+ if (do_sp)
+ {
+# ifdef WIN3264
+ p_sp = (char_u *)">%s 2>&1";
+# else
+ p_sp = (char_u *)"2>&1| tee";
+# endif
+ options[idx_sp].def_val[VI_DEFAULT] = p_sp;
+ }
+#endif
+ if (do_srr)
+ {
+ p_srr = (char_u *)">%s 2>&1";
+ options[idx_srr].def_val[VI_DEFAULT] = p_srr;
+ }
+ }
+ vim_free(p);
+ }
+#endif
+
+#if defined(MSDOS) || defined(WIN3264) || defined(OS2)
+ /*
+ * Set 'shellcmdflag and 'shellquote' depending on the 'shell' option.
+ * This is done after other initializations, where 'shell' might have been
+ * set, but only if they have not been set before. Default for p_shcf is
+ * "/c", for p_shq is "". For "sh" like shells it is changed here to
+ * "-c" and "\"", but not for DJGPP, because it starts the shell without
+ * command.com. And for Win32 we need to set p_sxq instead.
+ */
+ if (strstr((char *)p_sh, "sh") != NULL)
+ {
+ int idx3;
+
+ idx3 = findoption((char_u *)"shcf");
+ if (!(options[idx3].flags & P_WAS_SET))
+ {
+ p_shcf = (char_u *)"-c";
+ options[idx3].def_val[VI_DEFAULT] = p_shcf;
+ }
+
+# ifndef DJGPP
+# ifdef WIN3264
+ /* Somehow Win32 requires the quotes around the redirection too */
+ idx3 = findoption((char_u *)"sxq");
+ if (!(options[idx3].flags & P_WAS_SET))
+ {
+ p_sxq = (char_u *)"\"";
+ options[idx3].def_val[VI_DEFAULT] = p_sxq;
+ }
+# else
+ idx3 = findoption((char_u *)"shq");
+ if (!(options[idx3].flags & P_WAS_SET))
+ {
+ p_shq = (char_u *)"\"";
+ options[idx3].def_val[VI_DEFAULT] = p_shq;
+ }
+# endif
+# endif
+ }
+#endif
+
+#ifdef FEAT_TITLE
+ set_title_defaults();
+#endif
+}
+
+#if defined(FEAT_MULTI_LANG) || defined(PROTO)
+/*
+ * When 'helplang' is still at its default value, set it to "lang".
+ * Only the first two characters of "lang" are used.
+ */
+ void
+set_helplang_default(lang)
+ char_u *lang;
+{
+ int idx;
+
+ if (lang == NULL || STRLEN(lang) < 2) /* safety check */
+ return;
+ idx = findoption((char_u *)"hlg");
+ if (!(options[idx].flags & P_WAS_SET))
+ {
+ if (options[idx].flags & P_ALLOCED)
+ free_string_option(p_hlg);
+ p_hlg = vim_strsave(lang);
+ if (p_hlg == NULL)
+ p_hlg = empty_option;
+ else
+ p_hlg[2] = NUL;
+ options[idx].flags |= P_ALLOCED;
+ }
+}
+#endif
+
+#ifdef FEAT_GUI
+static char_u *gui_bg_default __ARGS((void));
+
+ static char_u *
+gui_bg_default()
+{
+ if (gui_get_lightness(gui.back_pixel) < 127)
+ return (char_u *)"dark";
+ return (char_u *)"light";
+}
+
+/*
+ * Option initializations that can only be done after opening the GUI window.
+ */
+ void
+init_gui_options()
+{
+ /* Set the 'background' option according to the lightness of the
+ * background color, unless the user has set it already. */
+ if (!option_was_set((char_u *)"bg") && STRCMP(p_bg, gui_bg_default()) != 0)
+ {
+ set_option_value((char_u *)"bg", 0L, gui_bg_default(), 0);
+ highlight_changed();
+ }
+}
+#endif
+
+#ifdef FEAT_TITLE
+/*
+ * 'title' and 'icon' only default to true if they have not been set or reset
+ * in .vimrc and we can read the old value.
+ * When 'title' and 'icon' have been reset in .vimrc, we won't even check if
+ * they can be reset. This reduces startup time when using X on a remote
+ * machine.
+ */
+ void
+set_title_defaults()
+{
+ int idx1;
+ long val;
+
+ /*
+ * If GUI is (going to be) used, we can always set the window title and
+ * icon name. Saves a bit of time, because the X11 display server does
+ * not need to be contacted.
+ */
+ idx1 = findoption((char_u *)"title");
+ if (!(options[idx1].flags & P_WAS_SET))
+ {
+#ifdef FEAT_GUI
+ if (gui.starting || gui.in_use)
+ val = TRUE;
+ else
+#endif
+ val = mch_can_restore_title();
+ options[idx1].def_val[VI_DEFAULT] = (char_u *)val;
+ p_title = val;
+ }
+ idx1 = findoption((char_u *)"icon");
+ if (!(options[idx1].flags & P_WAS_SET))
+ {
+#ifdef FEAT_GUI
+ if (gui.starting || gui.in_use)
+ val = TRUE;
+ else
+#endif
+ val = mch_can_restore_icon();
+ options[idx1].def_val[VI_DEFAULT] = (char_u *)val;
+ p_icon = val;
+ }
+}
+#endif
+
+/*
+ * Parse 'arg' for option settings.
+ *
+ * 'arg' may be IObuff, but only when no errors can be present and option
+ * does not need to be expanded with option_expand().
+ * "opt_flags":
+ * 0 for ":set"
+ * OPT_GLOBAL for ":setglobal"
+ * OPT_LOCAL for ":setlocal" and a modeline
+ * OPT_MODELINE for a modeline
+ *
+ * returns FAIL if an error is detected, OK otherwise
+ */
+ int
+do_set(arg, opt_flags)
+ char_u *arg; /* option string (may be written to!) */
+ int opt_flags;
+{
+ int opt_idx;
+ char_u *errmsg;
+ char_u errbuf[80];
+ char_u *startarg;
+ int prefix; /* 1: nothing, 0: "no", 2: "inv" in front of name */
+ int nextchar; /* next non-white char after option name */
+ int afterchar; /* character just after option name */
+ int len;
+ int i;
+ long value;
+ int key;
+ long_u flags; /* flags for current option */
+ char_u *varp = NULL; /* pointer to variable for current option */
+ int did_show = FALSE; /* already showed one value */
+ int adding; /* "opt+=arg" */
+ int prepending; /* "opt^=arg" */
+ int removing; /* "opt-=arg" */
+ int cp_val = 0;
+ char_u key_name[2];
+
+ if (*arg == NUL)
+ {
+ showoptions(0, opt_flags);
+ return OK;
+ }
+
+ while (*arg != NUL) /* loop to process all options */
+ {
+ errmsg = NULL;
+ startarg = arg; /* remember for error message */
+
+ if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3]))
+ {
+ /*
+ * ":set all" show all options.
+ * ":set all&" set all options to their default value.
+ */
+ arg += 3;
+ if (*arg == '&')
+ {
+ ++arg;
+ /* Only for :set command set global value of local options. */
+ set_options_default(OPT_FREE | opt_flags);
+ }
+ else
+ showoptions(1, opt_flags);
+ }
+ else if (STRNCMP(arg, "termcap", 7) == 0)
+ {
+ showoptions(2, opt_flags);
+ show_termcodes();
+ arg += 7;
+ }
+ else
+ {
+ prefix = 1;
+ if (STRNCMP(arg, "no", 2) == 0)
+ {
+ prefix = 0;
+ arg += 2;
+ }
+ else if (STRNCMP(arg, "inv", 3) == 0)
+ {
+ prefix = 2;
+ arg += 3;
+ }
+
+ /* find end of name */
+ key = 0;
+ if (*arg == '<')
+ {
+ nextchar = 0;
+ opt_idx = -1;
+ /* look out for <t_>;> */
+ if (arg[1] == 't' && arg[2] == '_' && arg[3] && arg[4])
+ len = 5;
+ else
+ {
+ len = 1;
+ while (arg[len] != NUL && arg[len] != '>')
+ ++len;
+ }
+ if (arg[len] != '>')
+ {
+ errmsg = e_invarg;
+ goto skip;
+ }
+ arg[len] = NUL; /* put NUL after name */
+ if (arg[1] == 't' && arg[2] == '_') /* could be term code */
+ opt_idx = findoption(arg + 1);
+ arg[len++] = '>'; /* restore '>' */
+ if (opt_idx == -1)
+ key = find_key_option(arg + 1);
+ }
+ else
+ {
+ len = 0;
+ /*
+ * The two characters after "t_" may not be alphanumeric.
+ */
+ if (arg[0] == 't' && arg[1] == '_' && arg[2] && arg[3])
+ len = 4;
+ else
+ while (ASCII_ISALNUM(arg[len]) || arg[len] == '_')
+ ++len;
+ nextchar = arg[len];
+ arg[len] = NUL; /* put NUL after name */
+ opt_idx = findoption(arg);
+ arg[len] = nextchar; /* restore nextchar */
+ if (opt_idx == -1)
+ key = find_key_option(arg);
+ }
+
+ /* remember character after option name */
+ afterchar = arg[len];
+
+ /* skip white space, allow ":set ai ?" */
+ while (vim_iswhite(arg[len]))
+ ++len;
+
+ adding = FALSE;
+ prepending = FALSE;
+ removing = FALSE;
+ if (arg[len] != NUL && arg[len + 1] == '=')
+ {
+ if (arg[len] == '+')
+ {
+ adding = TRUE; /* "+=" */
+ ++len;
+ }
+ else if (arg[len] == '^')
+ {
+ prepending = TRUE; /* "^=" */
+ ++len;
+ }
+ else if (arg[len] == '-')
+ {
+ removing = TRUE; /* "-=" */
+ ++len;
+ }
+ }
+ nextchar = arg[len];
+
+ if (opt_idx == -1 && key == 0) /* found a mismatch: skip */
+ {
+ errmsg = (char_u *)N_("E518: Unknown option");
+ goto skip;
+ }
+
+ if (opt_idx >= 0)
+ {
+ if (options[opt_idx].var == NULL) /* hidden option: skip */
+ {
+ /* Only give an error message when requesting the value of
+ * a hidden option, ignore setting it. */
+ if (vim_strchr((char_u *)"=:!&<", nextchar) == NULL
+ && (!(options[opt_idx].flags & P_BOOL)
+ || nextchar == '?'))
+ errmsg = (char_u *)N_("E519: Option not supported");
+ goto skip;
+ }
+
+ flags = options[opt_idx].flags;
+ varp = get_varp_scope(&(options[opt_idx]), opt_flags);
+ }
+ else
+ {
+ flags = P_STRING;
+ if (key < 0)
+ {
+ key_name[0] = KEY2TERMCAP0(key);
+ key_name[1] = KEY2TERMCAP1(key);
+ }
+ else
+ {
+ key_name[0] = KS_KEY;
+ key_name[1] = (key & 0xff);
+ }
+ }
+
+ /* Disallow changing some options from modelines */
+ if ((opt_flags & OPT_MODELINE) && (flags & P_SECURE))
+ {
+ errmsg = (char_u *)_("E520: Not allowed in a modeline");
+ goto skip;
+ }
+
+#ifdef HAVE_SANDBOX
+ /* Disallow changing some options in the sandbox */
+ if (sandbox > 0 && (flags & P_SECURE))
+ {
+ errmsg = (char_u *)_(e_sandbox);
+ goto skip;
+ }
+#endif
+
+ if (vim_strchr((char_u *)"?=:!&<", nextchar) != NULL)
+ {
+ arg += len;
+ cp_val = p_cp;
+ if (nextchar == '&' && arg[1] == 'v' && arg[2] == 'i')
+ {
+ if (arg[3] == 'm') /* "opt&vim": set to Vim default */
+ {
+ cp_val = FALSE;
+ arg += 3;
+ }
+ else /* "opt&vi": set to Vi default */
+ {
+ cp_val = TRUE;
+ arg += 2;
+ }
+ }
+ if (vim_strchr((char_u *)"?!&<", nextchar) != NULL
+ && arg[1] != NUL && !vim_iswhite(arg[1]))
+ {
+ errmsg = e_trailing;
+ goto skip;
+ }
+ }
+
+ /*
+ * allow '=' and ':' as MSDOS command.com allows only one
+ * '=' character per "set" command line. grrr. (jw)
+ */
+ if (nextchar == '?'
+ || (prefix == 1
+ && vim_strchr((char_u *)"=:&<", nextchar) == NULL
+ && !(flags & P_BOOL)))
+ {
+ /*
+ * print value
+ */
+ if (did_show)
+ msg_putchar('\n'); /* cursor below last one */
+ else
+ {
+ gotocmdline(TRUE); /* cursor at status line */
+ did_show = TRUE; /* remember that we did a line */
+ }
+ if (opt_idx >= 0)
+ {
+ showoneopt(&options[opt_idx], opt_flags);
+#ifdef FEAT_EVAL
+ if (p_verbose > 0)
+ {
+ if (options[opt_idx].scriptID != 0)
+ {
+ MSG_PUTS(_("\n\tLast set from "));
+ MSG_PUTS(get_scriptname(options[opt_idx].scriptID));
+ }
+ }
+#endif
+ }
+ else
+ {
+ char_u *p;
+
+ p = find_termcode(key_name);
+ if (p == NULL)
+ {
+ errmsg = (char_u *)N_("E518: Unknown option");
+ goto skip;
+ }
+ else
+ (void)show_one_termcode(key_name, p, TRUE);
+ }
+ if (nextchar != '?'
+ && nextchar != NUL && !vim_iswhite(afterchar))
+ errmsg = e_trailing;
+ }
+ else
+ {
+ if (flags & P_BOOL) /* boolean */
+ {
+ if (nextchar == '=' || nextchar == ':')
+ {
+ errmsg = e_invarg;
+ goto skip;
+ }
+
+ /*
+ * ":set opt!": invert
+ * ":set opt&": reset to default value
+ * ":set opt<": reset to global value
+ */
+ if (nextchar == '!')
+ value = *(int *)(varp) ^ 1;
+ else if (nextchar == '&')
+ value = (int)(long)options[opt_idx].def_val[
+ ((flags & P_VI_DEF) || cp_val)
+ ? VI_DEFAULT : VIM_DEFAULT];
+ else if (nextchar == '<')
+ {
+ /* For 'autoread' -1 means to use global value. */
+ if ((int *)varp == &curbuf->b_p_ar
+ && opt_flags == OPT_LOCAL)
+ value = -1;
+ else
+ value = *(int *)get_varp_scope(&(options[opt_idx]),
+ OPT_GLOBAL);
+ }
+ else
+ {
+ /*
+ * ":set invopt": invert
+ * ":set opt" or ":set noopt": set or reset
+ */
+ if (nextchar != NUL && !vim_iswhite(afterchar))
+ {
+ errmsg = e_trailing;
+ goto skip;
+ }
+ if (prefix == 2) /* inv */
+ value = *(int *)(varp) ^ 1;
+ else
+ value = prefix;
+ }
+
+ errmsg = set_bool_option(opt_idx, varp, (int)value,
+ opt_flags);
+ }
+ else /* numeric or string */
+ {
+ if (vim_strchr((char_u *)"=:&<", nextchar) == NULL
+ || prefix != 1)
+ {
+ errmsg = e_invarg;
+ goto skip;
+ }
+
+ if (flags & P_NUM) /* numeric */
+ {
+ /*
+ * Different ways to set a number option:
+ * & set to default value
+ * < set to global value
+ * <xx> accept special key codes for 'wildchar'
+ * c accept any non-digit for 'wildchar'
+ * [-]0-9 set number
+ * other error
+ */
+ ++arg;
+ if (nextchar == '&')
+ value = (long)options[opt_idx].def_val[
+ ((flags & P_VI_DEF) || cp_val)
+ ? VI_DEFAULT : VIM_DEFAULT];
+ else if (nextchar == '<')
+ value = *(long *)get_varp_scope(&(options[opt_idx]),
+ OPT_GLOBAL);
+ else if (((long *)varp == &p_wc
+ || (long *)varp == &p_wcm)
+ && (*arg == '<'
+ || *arg == '^'
+ || ((!arg[1] || vim_iswhite(arg[1]))
+ && !VIM_ISDIGIT(*arg))))
+ {
+ value = string_to_key(arg);
+ if (value == 0 && (long *)varp != &p_wcm)
+ {
+ errmsg = e_invarg;
+ goto skip;
+ }
+ }
+ /* allow negative numbers (for 'undolevels') */
+ else if (*arg == '-' || VIM_ISDIGIT(*arg))
+ {
+ i = 0;
+ if (*arg == '-')
+ i = 1;
+#ifdef HAVE_STRTOL
+ value = strtol((char *)arg, NULL, 0);
+ if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
+ i += 2;
+#else
+ value = atol((char *)arg);
+#endif
+ while (VIM_ISDIGIT(arg[i]))
+ ++i;
+ if (arg[i] != NUL && !vim_iswhite(arg[i]))
+ {
+ errmsg = e_invarg;
+ goto skip;
+ }
+ }
+ else
+ {
+ errmsg = (char_u *)N_("E521: Number required after =");
+ goto skip;
+ }
+
+ if (adding)
+ value = *(long *)varp + value;
+ if (prepending)
+ value = *(long *)varp * value;
+ if (removing)
+ value = *(long *)varp - value;
+ errmsg = set_num_option(opt_idx, varp, value,
+ errbuf, opt_flags);
+ }
+ else if (opt_idx >= 0) /* string */
+ {
+ char_u *save_arg = NULL;
+ char_u *s = NULL;
+ char_u *oldval; /* previous value if *varp */
+ char_u *newval;
+ char_u *origval;
+ unsigned newlen;
+ int comma;
+ int bs;
+ int new_value_alloced; /* new string option
+ was allocated */
+
+ /* When using ":set opt=val" for a global option
+ * with a local value the local value will be
+ * reset, use the global value here. */
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0
+ && (int)options[opt_idx].indir >= PV_BOTH)
+ varp = options[opt_idx].var;
+
+ /* The old value is kept until we are sure that the
+ * new value is valid. */
+ oldval = *(char_u **)varp;
+ if (nextchar == '&') /* set to default val */
+ {
+ newval = options[opt_idx].def_val[
+ ((flags & P_VI_DEF) || cp_val)
+ ? VI_DEFAULT : VIM_DEFAULT];
+ if ((char_u **)varp == &p_bg)
+ {
+ /* guess the value of 'background' */
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ newval = gui_bg_default();
+ else
+#endif
+ if (STRCMP(T_NAME, "linux") == 0)
+ newval = (char_u *)"dark";
+ }
+
+ /* expand environment variables and ~ (since the
+ * default value was already expanded, only
+ * required when an environment variable was set
+ * later */
+ if (newval == NULL)
+ newval = empty_option;
+ else
+ {
+ s = option_expand(opt_idx, newval);
+ if (s == NULL)
+ s = newval;
+ newval = vim_strsave(s);
+ }
+ new_value_alloced = TRUE;
+ }
+ else if (nextchar == '<') /* set to global val */
+ {
+ newval = vim_strsave(*(char_u **)get_varp_scope(
+ &(options[opt_idx]), OPT_GLOBAL));
+ new_value_alloced = TRUE;
+ }
+ else
+ {
+ ++arg; /* jump to after the '=' or ':' */
+
+ /*
+ * Set 'keywordprg' to ":help" if an empty
+ * value was passed to :set by the user.
+ * Misuse errbuf[] for the resulting string.
+ */
+ if (varp == (char_u *)&p_kp
+ && (*arg == NUL || *arg == ' '))
+ {
+ STRCPY(errbuf, ":help");
+ save_arg = arg;
+ arg = errbuf;
+ }
+ /*
+ * Convert 'whichwrap' number to string, for
+ * backwards compatibility with Vim 3.0.
+ * Misuse errbuf[] for the resulting string.
+ */
+ else if (varp == (char_u *)&p_ww
+ && VIM_ISDIGIT(*arg))
+ {
+ *errbuf = NUL;
+ i = getdigits(&arg);
+ if (i & 1)
+ STRCAT(errbuf, "b,");
+ if (i & 2)
+ STRCAT(errbuf, "s,");
+ if (i & 4)
+ STRCAT(errbuf, "h,l,");
+ if (i & 8)
+ STRCAT(errbuf, "<,>,");
+ if (i & 16)
+ STRCAT(errbuf, "[,],");
+ if (*errbuf != NUL) /* remove trailing , */
+ errbuf[STRLEN(errbuf) - 1] = NUL;
+ save_arg = arg;
+ arg = errbuf;
+ }
+ /*
+ * Remove '>' before 'dir' and 'bdir', for
+ * backwards compatibility with version 3.0
+ */
+ else if ( *arg == '>'
+ && (varp == (char_u *)&p_dir
+ || varp == (char_u *)&p_bdir))
+ {
+ ++arg;
+ }
+
+ /* When setting the local value of a global
+ * option, the old value may be the global value. */
+ if ((int)options[opt_idx].indir >= PV_BOTH
+ && (opt_flags & OPT_LOCAL))
+ origval = *(char_u **)get_varp(
+ &options[opt_idx]);
+ else
+ origval = oldval;
+
+ /*
+ * Copy the new string into allocated memory.
+ * Can't use set_string_option_direct(), because
+ * we need to remove the backslashes.
+ */
+ /* get a bit too much */
+ newlen = (unsigned)STRLEN(arg) + 1;
+ if (adding || prepending || removing)
+ newlen += (unsigned)STRLEN(origval) + 1;
+ newval = alloc(newlen);
+ if (newval == NULL) /* out of mem, don't change */
+ break;
+ s = newval;
+
+ /*
+ * Copy the string, skip over escaped chars.
+ * For MS-DOS and WIN32 backslashes before normal
+ * file name characters are not removed, and keep
+ * backslash at start, for "\\machine\path", but
+ * do remove it for "\\\\machine\\path".
+ * The reverse is found in ExpandOldSetting().
+ */
+ while (*arg && !vim_iswhite(*arg))
+ {
+ if (*arg == '\\' && arg[1] != NUL
+#ifdef BACKSLASH_IN_FILENAME
+ && !((flags & P_EXPAND)
+ && vim_isfilec(arg[1])
+ && (arg[1] != '\\'
+ || (s == newval
+ && arg[2] != '\\')))
+#endif
+ )
+ ++arg; /* remove backslash */
+#ifdef FEAT_MBYTE
+ if (has_mbyte
+ && (i = (*mb_ptr2len_check)(arg)) > 1)
+ {
+ /* copy multibyte char */
+ mch_memmove(s, arg, (size_t)i);
+ arg += i;
+ s += i;
+ }
+ else
+#endif
+ *s++ = *arg++;
+ }
+ *s = NUL;
+
+ /*
+ * Expand environment variables and ~.
+ * Don't do it when adding without inserting a
+ * comma.
+ */
+ if (!(adding || prepending || removing)
+ || (flags & P_COMMA))
+ {
+ s = option_expand(opt_idx, newval);
+ if (s != NULL)
+ {
+ vim_free(newval);
+ newlen = (unsigned)STRLEN(s) + 1;
+ if (adding || prepending || removing)
+ newlen += (unsigned)STRLEN(origval) + 1;
+ newval = alloc(newlen);
+ if (newval == NULL)
+ break;
+ STRCPY(newval, s);
+ }
+ }
+
+ /* locate newval[] in origval[] when removing it
+ * and when adding to avoid duplicates */
+ i = 0; /* init for GCC */
+ if (removing || (flags & P_NODUP))
+ {
+ i = (int)STRLEN(newval);
+ bs = 0;
+ for (s = origval; *s; ++s)
+ {
+ if ((!(flags & P_COMMA)
+ || s == origval
+ || (s[-1] == ',' && !(bs & 1)))
+ && STRNCMP(s, newval, i) == 0
+ && (!(flags & P_COMMA)
+ || s[i] == ','
+ || s[i] == NUL))
+ break;
+ /* Count backspaces. Only a comma with an
+ * even number of backspaces before it is
+ * recognized as a separator */
+ if (s > origval && s[-1] == '\\')
+ ++bs;
+ else
+ bs = 0;
+ }
+
+ /* do not add if already there */
+ if ((adding || prepending) && *s)
+ {
+ prepending = FALSE;
+ adding = FALSE;
+ STRCPY(newval, origval);
+ }
+ }
+
+ /* concatenate the two strings; add a ',' if
+ * needed */
+ if (adding || prepending)
+ {
+ comma = ((flags & P_COMMA) && *origval != NUL
+ && *newval != NUL);
+ if (adding)
+ {
+ i = (int)STRLEN(origval);
+ mch_memmove(newval + i + comma, newval,
+ STRLEN(newval) + 1);
+ mch_memmove(newval, origval, (size_t)i);
+ }
+ else
+ {
+ i = (int)STRLEN(newval);
+ mch_memmove(newval + i + comma, origval,
+ STRLEN(origval) + 1);
+ }
+ if (comma)
+ newval[i] = ',';
+ }
+
+ /* Remove newval[] from origval[]. (Note: "i" has
+ * been set above and is used here). */
+ if (removing)
+ {
+ STRCPY(newval, origval);
+ if (*s)
+ {
+ /* may need to remove a comma */
+ if (flags & P_COMMA)
+ {
+ if (s == origval)
+ {
+ /* include comma after string */
+ if (s[i] == ',')
+ ++i;
+ }
+ else
+ {
+ /* include comma before string */
+ --s;
+ ++i;
+ }
+ }
+ mch_memmove(newval + (s - origval), s + i,
+ STRLEN(s + i) + 1);
+ }
+ }
+
+ if (flags & P_FLAGLIST)
+ {
+ /* Remove flags that appear twice. */
+ for (s = newval; *s; ++s)
+ if ((!(flags & P_COMMA) || *s != ',')
+ && vim_strchr(s + 1, *s) != NULL)
+ {
+ STRCPY(s, s + 1);
+ --s;
+ }
+ }
+
+ if (save_arg != NULL) /* number for 'whichwrap' */
+ arg = save_arg;
+ new_value_alloced = TRUE;
+ }
+
+ /* Set the new value. */
+ *(char_u **)(varp) = newval;
+
+ /* Handle side effects, and set the global value for
+ * ":set" on local options. */
+ errmsg = did_set_string_option(opt_idx, (char_u **)varp,
+ new_value_alloced, oldval, errbuf, opt_flags);
+
+ /* If error detected, print the error message. */
+ if (errmsg != NULL)
+ goto skip;
+ }
+ else /* key code option */
+ {
+ char_u *p;
+
+ if (nextchar == '&')
+ {
+ if (add_termcap_entry(key_name, TRUE) == FAIL)
+ errmsg = (char_u *)N_("E522: Not found in termcap");
+ }
+ else
+ {
+ ++arg; /* jump to after the '=' or ':' */
+ for (p = arg; *p && !vim_iswhite(*p); ++p)
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ nextchar = *p;
+ *p = NUL;
+ add_termcode(key_name, arg, FALSE);
+ *p = nextchar;
+ }
+ if (full_screen)
+ ttest(FALSE);
+ redraw_all_later(CLEAR);
+ }
+ }
+ if (opt_idx >= 0)
+ options[opt_idx].flags |= P_WAS_SET;
+ }
+
+skip:
+ /*
+ * Advance to next argument.
+ * - skip until a blank found, taking care of backslashes
+ * - skip blanks
+ * - skip one "=val" argument (for hidden options ":set gfn =xx")
+ */
+ for (i = 0; i < 2 ; ++i)
+ {
+ while (*arg != NUL && !vim_iswhite(*arg))
+ if (*arg++ == '\\' && *arg != NUL)
+ ++arg;
+ arg = skipwhite(arg);
+ if (*arg != '=')
+ break;
+ }
+ }
+
+ if (errmsg != NULL)
+ {
+ STRNCPY(IObuff, _(errmsg), IOSIZE - 1);
+ IObuff[IOSIZE - 1] = NUL;
+ i = STRLEN(IObuff) + 2;
+ if (i + (arg - startarg) < IOSIZE)
+ {
+ /* append the argument with the error */
+ STRCAT(IObuff, ": ");
+ mch_memmove(IObuff + i, startarg, (arg - startarg));
+ IObuff[i + (arg - startarg)] = NUL;
+ }
+ /* make sure all characters are printable */
+ trans_characters(IObuff, IOSIZE);
+
+ ++no_wait_return; /* wait_return done later */
+ emsg(IObuff); /* show error highlighted */
+ --no_wait_return;
+
+ return FAIL;
+ }
+
+ arg = skipwhite(arg);
+ }
+
+ return OK;
+}
+
+ static char_u *
+illegal_char(errbuf, c)
+ char_u *errbuf;
+ int c;
+{
+ if (errbuf == NULL)
+ return (char_u *)"";
+ sprintf((char *)errbuf, _("E539: Illegal character <%s>"),
+ (char *)transchar(c));
+ return errbuf;
+}
+
+/*
+ * Convert a key name or string into a key value.
+ * Used for 'wildchar' and 'cedit' options.
+ */
+ static int
+string_to_key(arg)
+ char_u *arg;
+{
+ if (*arg == '<')
+ return find_key_option(arg + 1);
+ if (*arg == '^')
+ return Ctrl_chr(arg[1]);
+ return *arg;
+}
+
+#ifdef FEAT_CMDWIN
+/*
+ * Check value of 'cedit' and set cedit_key.
+ * Returns NULL if value is OK, error message otherwise.
+ */
+ static char_u *
+check_cedit()
+{
+ int n;
+
+ if (*p_cedit == NUL)
+ cedit_key = -1;
+ else
+ {
+ n = string_to_key(p_cedit);
+ if (vim_isprintc(n))
+ return e_invarg;
+ cedit_key = n;
+ }
+ return NULL;
+}
+#endif
+
+#ifdef FEAT_TITLE
+/*
+ * When changing 'title', 'titlestring', 'icon' or 'iconstring', call
+ * maketitle() to create and display it.
+ * When switching the title or icon off, call mch_restore_title() to get
+ * the old value back.
+ */
+ static void
+did_set_title(icon)
+ int icon; /* Did set icon instead of title */
+{
+ if (starting != NO_SCREEN
+#ifdef FEAT_GUI
+ && !gui.starting
+#endif
+ )
+ {
+ maketitle();
+ if (icon)
+ {
+ if (!p_icon)
+ mch_restore_title(2);
+ }
+ else
+ {
+ if (!p_title)
+ mch_restore_title(1);
+ }
+ }
+}
+#endif
+
+/*
+ * set_options_bin - called when 'bin' changes value.
+ */
+ void
+set_options_bin(oldval, newval, opt_flags)
+ int oldval;
+ int newval;
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ /*
+ * The option values that are changed when 'bin' changes are
+ * copied when 'bin is set and restored when 'bin' is reset.
+ */
+ if (newval)
+ {
+ if (!oldval) /* switched on */
+ {
+ if (!(opt_flags & OPT_GLOBAL))
+ {
+ curbuf->b_p_tw_nobin = curbuf->b_p_tw;
+ curbuf->b_p_wm_nobin = curbuf->b_p_wm;
+ curbuf->b_p_ml_nobin = curbuf->b_p_ml;
+ curbuf->b_p_et_nobin = curbuf->b_p_et;
+ }
+ if (!(opt_flags & OPT_LOCAL))
+ {
+ p_tw_nobin = p_tw;
+ p_wm_nobin = p_wm;
+ p_ml_nobin = p_ml;
+ p_et_nobin = p_et;
+ }
+ }
+
+ if (!(opt_flags & OPT_GLOBAL))
+ {
+ curbuf->b_p_tw = 0; /* no automatic line wrap */
+ curbuf->b_p_wm = 0; /* no automatic line wrap */
+ curbuf->b_p_ml = 0; /* no modelines */
+ curbuf->b_p_et = 0; /* no expandtab */
+ }
+ if (!(opt_flags & OPT_LOCAL))
+ {
+ p_tw = 0;
+ p_wm = 0;
+ p_ml = FALSE;
+ p_et = FALSE;
+ p_bin = TRUE; /* needed when called for the "-b" argument */
+ }
+ }
+ else if (oldval) /* switched off */
+ {
+ if (!(opt_flags & OPT_GLOBAL))
+ {
+ curbuf->b_p_tw = curbuf->b_p_tw_nobin;
+ curbuf->b_p_wm = curbuf->b_p_wm_nobin;
+ curbuf->b_p_ml = curbuf->b_p_ml_nobin;
+ curbuf->b_p_et = curbuf->b_p_et_nobin;
+ }
+ if (!(opt_flags & OPT_LOCAL))
+ {
+ p_tw = p_tw_nobin;
+ p_wm = p_wm_nobin;
+ p_ml = p_ml_nobin;
+ p_et = p_et_nobin;
+ }
+ }
+}
+
+#ifdef FEAT_VIMINFO
+/*
+ * Find the parameter represented by the given character (eg ', :, ", or /),
+ * and return its associated value in the 'viminfo' string.
+ * Only works for number parameters, not for 'r' or 'n'.
+ * If the parameter is not specified in the string, return -1.
+ */
+ int
+get_viminfo_parameter(type)
+ int type;
+{
+ char_u *p;
+
+ p = find_viminfo_parameter(type);
+ if (p != NULL && VIM_ISDIGIT(*p))
+ return atoi((char *)p);
+ return -1;
+}
+
+/*
+ * Find the parameter represented by the given character (eg ''', ':', '"', or
+ * '/') in the 'viminfo' option and return a pointer to the string after it.
+ * Return NULL if the parameter is not specified in the string.
+ */
+ char_u *
+find_viminfo_parameter(type)
+ int type;
+{
+ char_u *p;
+
+ for (p = p_viminfo; *p; ++p)
+ {
+ if (*p == type)
+ return p + 1;
+ if (*p == 'n') /* 'n' is always the last one */
+ break;
+ p = vim_strchr(p, ','); /* skip until next ',' */
+ if (p == NULL) /* hit the end without finding parameter */
+ break;
+ }
+ return NULL;
+}
+#endif
+
+/*
+ * Expand environment variables for some string options.
+ * These string options cannot be indirect!
+ * If "val" is NULL expand the current value of the option.
+ * Return pointer to NameBuff, or NULL when not expanded.
+ */
+ static char_u *
+option_expand(opt_idx, val)
+ int opt_idx;
+ char_u *val;
+{
+ /* if option doesn't need expansion nothing to do */
+ if (!(options[opt_idx].flags & P_EXPAND) || options[opt_idx].var == NULL)
+ return NULL;
+
+ /* If val is longer than MAXPATHL no meaningful expansion can be done,
+ * expand_env() would truncate the string. */
+ if (val != NULL && STRLEN(val) > MAXPATHL)
+ return NULL;
+
+ if (val == NULL)
+ val = *(char_u **)options[opt_idx].var;
+
+ /*
+ * Expanding this with NameBuff, expand_env() must not be passed IObuff.
+ * Escape spaces when expanding 'tags', they are used to separate file
+ * names.
+ */
+ expand_env_esc(val, NameBuff, MAXPATHL,
+ (char_u **)options[opt_idx].var == &p_tags);
+ if (STRCMP(NameBuff, val) == 0) /* they are the same */
+ return NULL;
+
+ return NameBuff;
+}
+
+/*
+ * After setting various option values: recompute variables that depend on
+ * option values.
+ */
+ static void
+didset_options()
+{
+ /* initialize the table for 'iskeyword' et.al. */
+ (void)init_chartab();
+
+ (void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE);
+ (void)opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE);
+#ifdef FEAT_SESSION
+ (void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE);
+ (void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE);
+#endif
+#ifdef FEAT_FOLDING
+ (void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE);
+#endif
+ (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE);
+#ifdef FEAT_VIRTUALEDIT
+ (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
+#endif
+#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
+ (void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE);
+#endif
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+ (void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE);
+#endif
+#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
+ (void)opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE);
+#endif
+#ifdef FEAT_CMDWIN
+ /* set cedit_key */
+ (void)check_cedit();
+#endif
+}
+
+/*
+ * Check for string options that are NULL (normally only termcap options).
+ */
+ void
+check_options()
+{
+ int opt_idx;
+
+ for (opt_idx = 0; options[opt_idx].fullname != NULL; opt_idx++)
+ if ((options[opt_idx].flags & P_STRING) && options[opt_idx].var != NULL)
+ check_string_option((char_u **)get_varp(&(options[opt_idx])));
+}
+
+/*
+ * Check string options in a buffer for NULL value.
+ */
+ void
+check_buf_options(buf)
+ buf_T *buf;
+{
+#if defined(FEAT_QUICKFIX)
+ check_string_option(&buf->b_p_bh);
+ check_string_option(&buf->b_p_bt);
+#endif
+#ifdef FEAT_MBYTE
+ check_string_option(&buf->b_p_fenc);
+#endif
+ check_string_option(&buf->b_p_ff);
+#ifdef FEAT_FIND_ID
+ check_string_option(&buf->b_p_def);
+ check_string_option(&buf->b_p_inc);
+# ifdef FEAT_EVAL
+ check_string_option(&buf->b_p_inex);
+# endif
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ check_string_option(&buf->b_p_inde);
+ check_string_option(&buf->b_p_indk);
+#endif
+#ifdef FEAT_CRYPT
+ check_string_option(&buf->b_p_key);
+#endif
+ check_string_option(&buf->b_p_kp);
+ check_string_option(&buf->b_p_mps);
+ check_string_option(&buf->b_p_fo);
+ check_string_option(&buf->b_p_isk);
+#ifdef FEAT_COMMENTS
+ check_string_option(&buf->b_p_com);
+#endif
+#ifdef FEAT_FOLDING
+ check_string_option(&buf->b_p_cms);
+#endif
+ check_string_option(&buf->b_p_nf);
+#ifdef FEAT_SYN_HL
+ check_string_option(&buf->b_p_syn);
+#endif
+#ifdef FEAT_SEARCHPATH
+ check_string_option(&buf->b_p_sua);
+#endif
+#ifdef FEAT_CINDENT
+ check_string_option(&buf->b_p_cink);
+ check_string_option(&buf->b_p_cino);
+#endif
+#ifdef FEAT_AUTOCMD
+ check_string_option(&buf->b_p_ft);
+#endif
+#ifdef FEAT_OSFILETYPE
+ check_string_option(&buf->b_p_oft);
+#endif
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ check_string_option(&buf->b_p_cinw);
+#endif
+#ifdef FEAT_INS_EXPAND
+ check_string_option(&buf->b_p_cpt);
+#endif
+#ifdef FEAT_KEYMAP
+ check_string_option(&buf->b_p_keymap);
+#endif
+#ifdef FEAT_QUICKFIX
+ check_string_option(&buf->b_p_gp);
+ check_string_option(&buf->b_p_mp);
+ check_string_option(&buf->b_p_efm);
+#endif
+ check_string_option(&buf->b_p_ep);
+ check_string_option(&buf->b_p_path);
+ check_string_option(&buf->b_p_tags);
+#ifdef FEAT_INS_EXPAND
+ check_string_option(&buf->b_p_dict);
+ check_string_option(&buf->b_p_tsr);
+#endif
+}
+
+/*
+ * Free the string allocated for an option.
+ * Checks for the string being empty_option. This may happen if we're out of
+ * memory, vim_strsave() returned NULL, which was replaced by empty_option by
+ * check_options().
+ * Does NOT check for P_ALLOCED flag!
+ */
+ void
+free_string_option(p)
+ char_u *p;
+{
+ if (p != empty_option)
+ vim_free(p);
+}
+
+ void
+clear_string_option(pp)
+ char_u **pp;
+{
+ if (*pp != empty_option)
+ vim_free(*pp);
+ *pp = empty_option;
+}
+
+ static void
+check_string_option(pp)
+ char_u **pp;
+{
+ if (*pp == NULL)
+ *pp = empty_option;
+}
+
+/*
+ * Mark a terminal option as allocated, found by a pointer into term_strings[].
+ */
+ void
+set_term_option_alloced(p)
+ char_u **p;
+{
+ int opt_idx;
+
+ for (opt_idx = 1; options[opt_idx].fullname != NULL; opt_idx++)
+ if (options[opt_idx].var == (char_u *)p)
+ {
+ options[opt_idx].flags |= P_ALLOCED;
+ return;
+ }
+ return; /* cannot happen: didn't find it! */
+}
+
+/*
+ * Set a string option to a new value (without checking the effect).
+ * The string is copied into allocated memory.
+ * if ("opt_idx" == -1) "name" is used, otherwise "opt_idx" is used.
+ */
+ void
+set_string_option_direct(name, opt_idx, val, opt_flags)
+ char_u *name;
+ int opt_idx;
+ char_u *val;
+ int opt_flags; /* OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL */
+{
+ char_u *s;
+ char_u **varp;
+ int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
+
+ if (opt_idx == -1) /* use name */
+ {
+ opt_idx = findoption(name);
+ if (opt_idx == -1) /* not found (should not happen) */
+ return;
+ }
+
+ if (options[opt_idx].var == NULL) /* can't set hidden option */
+ return;
+
+ s = vim_strsave(val);
+ if (s != NULL)
+ {
+ varp = (char_u **)get_varp_scope(&(options[opt_idx]),
+ both ? OPT_LOCAL : opt_flags);
+ if ((opt_flags & OPT_FREE) && (options[opt_idx].flags & P_ALLOCED))
+ free_string_option(*varp);
+ *varp = s;
+
+ /* For buffer/window local option may also set the global value. */
+ if (both)
+ set_string_option_global(opt_idx, varp);
+
+ options[opt_idx].flags |= P_ALLOCED;
+
+ /* When setting both values of a global option with a local value,
+ * make the local value empty, so that the global value is used. */
+ if ((int)options[opt_idx].indir >= PV_BOTH && both)
+ {
+ free_string_option(*varp);
+ *varp = empty_option;
+ }
+ }
+}
+
+/*
+ * Set global value for string option when it's a local option.
+ */
+ static void
+set_string_option_global(opt_idx, varp)
+ int opt_idx; /* option index */
+ char_u **varp; /* pointer to option variable */
+{
+ char_u **p, *s;
+
+ /* the global value is always allocated */
+ if (options[opt_idx].var == VAR_WIN)
+ p = (char_u **)GLOBAL_WO(varp);
+ else
+ p = (char_u **)options[opt_idx].var;
+ if (options[opt_idx].indir != PV_NONE
+ && p != varp
+ && (s = vim_strsave(*varp)) != NULL)
+ {
+ free_string_option(*p);
+ *p = s;
+ }
+}
+
+/*
+ * Set a string option to a new value, and handle the effects.
+ */
+ static void
+set_string_option(opt_idx, value, opt_flags)
+ int opt_idx;
+ char_u *value;
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ char_u *s;
+ char_u **varp;
+ char_u *oldval;
+
+ if (options[opt_idx].var == NULL) /* don't set hidden option */
+ return;
+
+ s = vim_strsave(value);
+ if (s != NULL)
+ {
+ varp = (char_u **)get_varp_scope(&(options[opt_idx]),
+ (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0
+ ? ((int)options[opt_idx].indir >= PV_BOTH
+ ? OPT_GLOBAL : OPT_LOCAL)
+ : opt_flags);
+ oldval = *varp;
+ *varp = s;
+ options[opt_idx].flags |= P_WAS_SET;
+ (void)did_set_string_option(opt_idx, varp, TRUE, oldval, NULL,
+ opt_flags);
+ }
+}
+
+/*
+ * Handle string options that need some action to perform when changed.
+ * Returns NULL for success, or an error message for an error.
+ */
+ static char_u *
+did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
+ opt_flags)
+ int opt_idx; /* index in options[] table */
+ char_u **varp; /* pointer to the option variable */
+ int new_value_alloced; /* new value was allocated */
+ char_u *oldval; /* previous value of the option */
+ char_u *errbuf; /* buffer for errors, or NULL */
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ char_u *errmsg = NULL;
+ char_u *s, *p;
+ int did_chartab = FALSE;
+ char_u **gvarp;
+
+ /* Get the global option to compare with, otherwise we would have to check
+ * two values for all local options. */
+ gvarp = (char_u **)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL);
+
+ /* Disallow changing some options from secure mode */
+ if ((secure
+#ifdef HAVE_SANDBOX
+ || sandbox != 0
+#endif
+ ) && (options[opt_idx].flags & P_SECURE))
+ {
+ errmsg = e_secure;
+ }
+
+ /* 'term' */
+ else if (varp == &T_NAME)
+ {
+ if (T_NAME[0] == NUL)
+ errmsg = (char_u *)N_("E529: Cannot set 'term' to empty string");
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ errmsg = (char_u *)N_("E530: Cannot change term in GUI");
+ else if (term_is_gui(T_NAME))
+ errmsg = (char_u *)N_("E531: Use \":gui\" to start the GUI");
+#endif
+ else if (set_termname(T_NAME) == FAIL)
+ errmsg = (char_u *)N_("E522: Not found in termcap");
+ else
+ /* Screen colors may have changed. */
+ redraw_later_clear();
+ }
+
+ /* 'backupcopy' */
+ else if (varp == &p_bkc)
+ {
+ if (opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ if (((bkc_flags & BKC_AUTO) != 0)
+ + ((bkc_flags & BKC_YES) != 0)
+ + ((bkc_flags & BKC_NO) != 0) != 1)
+ {
+ /* Must have exactly one of "auto", "yes" and "no". */
+ (void)opt_strings_flags(oldval, p_bkc_values, &bkc_flags, TRUE);
+ errmsg = e_invarg;
+ }
+ }
+
+ /* 'backupext' and 'patchmode' */
+ else if (varp == &p_bex || varp == &p_pm)
+ {
+ if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex,
+ *p_pm == '.' ? p_pm + 1 : p_pm) == 0)
+ errmsg = (char_u *)N_("E589: 'backupext' and 'patchmode' are equal");
+ }
+
+ /*
+ * 'isident', 'iskeyword', 'isprint or 'isfname' option: refill chartab[]
+ * If the new option is invalid, use old value. 'lisp' option: refill
+ * chartab[] for '-' char
+ */
+ else if ( varp == &p_isi
+ || varp == &(curbuf->b_p_isk)
+ || varp == &p_isp
+ || varp == &p_isf)
+ {
+ if (init_chartab() == FAIL)
+ {
+ did_chartab = TRUE; /* need to restore it below */
+ errmsg = e_invarg; /* error in value */
+ }
+ }
+
+ /* 'helpfile' */
+ else if (varp == &p_hf)
+ {
+ /* May compute new values for $VIM and $VIMRUNTIME */
+ if (didset_vim)
+ {
+ vim_setenv((char_u *)"VIM", (char_u *)"");
+ didset_vim = FALSE;
+ }
+ if (didset_vimruntime)
+ {
+ vim_setenv((char_u *)"VIMRUNTIME", (char_u *)"");
+ didset_vimruntime = FALSE;
+ }
+ }
+
+#ifdef FEAT_MULTI_LANG
+ /* 'helplang' */
+ else if (varp == &p_hlg)
+ {
+ /* Check for "", "ab", "ab,cd", etc. */
+ for (s = p_hlg; *s != NUL; s += 3)
+ {
+ if (s[1] == NUL || ((s[2] != ',' || s[3] == NUL) && s[2] != NUL))
+ {
+ errmsg = e_invarg;
+ break;
+ }
+ if (s[2] == NUL)
+ break;
+ }
+ }
+#endif
+
+ /* 'highlight' */
+ else if (varp == &p_hl)
+ {
+ if (highlight_changed() == FAIL)
+ errmsg = e_invarg; /* invalid flags */
+ }
+
+ /* 'nrformats' */
+ else if (gvarp == &p_nf)
+ {
+ if (check_opt_strings(*varp, p_nf_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+
+#ifdef FEAT_SESSION
+ /* 'sessionoptions' */
+ else if (varp == &p_ssop)
+ {
+ if (opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ if ((ssop_flags & SSOP_CURDIR) && (ssop_flags & SSOP_SESDIR))
+ {
+ /* Don't allow both "sesdir" and "curdir". */
+ (void)opt_strings_flags(oldval, p_ssop_values, &ssop_flags, TRUE);
+ errmsg = e_invarg;
+ }
+ }
+ /* 'viewoptions' */
+ else if (varp == &p_vop)
+ {
+ if (opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+ /* 'scrollopt' */
+#ifdef FEAT_SCROLLBIND
+ else if (varp == &p_sbo)
+ {
+ if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+ /* 'ambiwidth' */
+#ifdef FEAT_MBYTE
+ else if (varp == &p_ambw)
+ {
+ if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+ /* 'background' */
+ else if (varp == &p_bg)
+ {
+ if (check_opt_strings(p_bg, p_bg_values, FALSE) == OK)
+ {
+#ifdef FEAT_EVAL
+ int dark = (*p_bg == 'd');
+#endif
+
+ init_highlight(FALSE, FALSE);
+
+#ifdef FEAT_EVAL
+ if (dark != (*p_bg == 'd')
+ && get_var_value((char_u *)"g:colors_name") != NULL)
+ {
+ /* The color scheme must have set 'background' back to another
+ * value, that's not what we want here. Disable the color
+ * scheme and set the colors again. */
+ do_unlet((char_u *)"g:colors_name");
+ free_string_option(p_bg);
+ p_bg = vim_strsave((char_u *)(dark ? "dark" : "light"));
+ check_string_option(&p_bg);
+ init_highlight(FALSE, FALSE);
+ }
+#endif
+ }
+ else
+ errmsg = e_invarg;
+ }
+
+ /* 'wildmode' */
+ else if (varp == &p_wim)
+ {
+ if (check_opt_wim() == FAIL)
+ errmsg = e_invarg;
+ }
+
+#ifdef FEAT_WAK
+ /* 'winaltkeys' */
+ else if (varp == &p_wak)
+ {
+ if (*p_wak == NUL
+ || check_opt_strings(p_wak, p_wak_values, FALSE) != OK)
+ errmsg = e_invarg;
+# ifdef FEAT_MENU
+# ifdef FEAT_GUI_MOTIF
+ else if (gui.in_use)
+ gui_motif_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm');
+# else
+# ifdef FEAT_GUI_GTK
+ else if (gui.in_use)
+ gui_gtk_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm');
+# endif
+# endif
+# endif
+ }
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /* 'eventignore' */
+ else if (varp == &p_ei)
+ {
+ if (check_ei() == FAIL)
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_MBYTE
+ /* 'encoding' and 'fileencoding' */
+ else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc)
+ {
+ if (gvarp == &p_fenc)
+ {
+ if (!curbuf->b_p_ma)
+ errmsg = e_modifiable;
+ else if (vim_strchr(*varp, ',') != NULL)
+ /* No comma allowed in 'fileencoding'; catches confusing it
+ * with 'fileencodings'. */
+ errmsg = e_invarg;
+# ifdef FEAT_TITLE
+ else
+ /* May show a "+" in the title now. */
+ need_maketitle = TRUE;
+# endif
+ }
+ if (errmsg == NULL)
+ {
+ /* canonize the value, so that STRCMP() can be used on it */
+ p = enc_canonize(*varp);
+ if (p != NULL)
+ {
+ vim_free(*varp);
+ *varp = p;
+ }
+ if (varp == &p_enc)
+ {
+ errmsg = mb_init();
+# ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+# endif
+ }
+ }
+
+# if defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
+ if (errmsg == NULL && varp == &p_tenc && gui.in_use)
+ {
+ /* GTK+ 2 uses only a single encoding, and that is UTF-8. */
+ if (STRCMP(p_tenc, "utf-8") != 0)
+ errmsg = (char_u *)N_("E617: Cannot be changed in the GTK+ 2 GUI");
+ }
+# endif
+
+ if (errmsg == NULL)
+ {
+# ifdef FEAT_KEYMAP
+ /* When 'keymap' is used and 'encoding' changes, reload the keymap
+ * (with another encoding). */
+ if (varp == &p_enc && *curbuf->b_p_keymap != NUL)
+ (void)keymap_init();
+# endif
+
+ /* When 'termencoding' is not empty and 'encoding' changes or when
+ * 'termencoding' changes, need to setup for keyboard input and
+ * display output conversion. */
+ if (((varp == &p_enc && *p_tenc != NUL) || varp == &p_tenc))
+ {
+ convert_setup(&input_conv, p_tenc, p_enc);
+ convert_setup(&output_conv, p_enc, p_tenc);
+ }
+ }
+ }
+#endif
+
+#if defined(FEAT_POSTSCRIPT)
+ else if (varp == &p_penc)
+ {
+ /* Canonize printencoding if VIM standard one */
+ p = enc_canonize(p_penc);
+ if (p != NULL)
+ {
+ vim_free(p_penc);
+ p_penc = p;
+ }
+ else
+ {
+ /* Ensure lower case and '-' for '_' */
+ for (s = p_penc; *s != NUL; s++)
+ {
+ if (*s == '_')
+ *s = '-';
+ else
+ *s = TOLOWER_ASC(*s);
+ }
+ }
+ }
+#endif
+
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ else if (varp == &p_imak)
+ {
+ if (gui.in_use && !im_xim_isvalid_imactivate())
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_KEYMAP
+ else if (varp == &curbuf->b_p_keymap)
+ {
+ /* load or unload key mapping tables */
+ errmsg = keymap_init();
+
+ /* When successfully installed a new keymap switch on using it. */
+ if (*curbuf->b_p_keymap != NUL && errmsg == NULL)
+ {
+ curbuf->b_p_iminsert = B_IMODE_LMAP;
+ if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
+ curbuf->b_p_imsearch = B_IMODE_LMAP;
+ set_iminsert_global();
+ set_imsearch_global();
+# ifdef FEAT_WINDOWS
+ status_redraw_curbuf();
+# endif
+ }
+ }
+#endif
+
+ /* 'fileformat' */
+ else if (gvarp == &p_ff)
+ {
+ if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL))
+ errmsg = e_modifiable;
+ else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+ /* may also change 'textmode' */
+ if (get_fileformat(curbuf) == EOL_DOS)
+ curbuf->b_p_tx = TRUE;
+ else
+ curbuf->b_p_tx = FALSE;
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+#endif
+ }
+ }
+
+ /* 'fileformats' */
+ else if (varp == &p_ffs)
+ {
+ if (check_opt_strings(p_ffs, p_ff_values, TRUE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+ /* also change 'textauto' */
+ if (*p_ffs == NUL)
+ p_ta = FALSE;
+ else
+ p_ta = TRUE;
+ }
+ }
+
+#if defined(FEAT_CRYPT) && defined(FEAT_CMDHIST)
+ /* 'cryptkey' */
+ else if (gvarp == &p_key)
+ {
+ /* Make sure the ":set" command doesn't show the new value in the
+ * history. */
+ remove_key_from_history();
+ }
+#endif
+
+ /* 'matchpairs' */
+ else if (gvarp == &p_mps)
+ {
+ /* Check for "x:y,x:y" */
+ for (p = *varp; *p != NUL; p += 4)
+ {
+ if (p[1] != ':' || p[2] == NUL || (p[3] != NUL && p[3] != ','))
+ {
+ errmsg = e_invarg;
+ break;
+ }
+ if (p[3] == NUL)
+ break;
+ }
+ }
+
+#ifdef FEAT_COMMENTS
+ /* 'comments' */
+ else if (gvarp == &p_com)
+ {
+ for (s = *varp; *s; )
+ {
+ while (*s && *s != ':')
+ {
+ if (vim_strchr((char_u *)COM_ALL, *s) == NULL
+ && !VIM_ISDIGIT(*s) && *s != '-')
+ {
+ errmsg = illegal_char(errbuf, *s);
+ break;
+ }
+ ++s;
+ }
+ if (*s++ == NUL)
+ errmsg = (char_u *)N_("E524: Missing colon");
+ else if (*s == ',' || *s == NUL)
+ errmsg = (char_u *)N_("E525: Zero length string");
+ if (errmsg != NULL)
+ break;
+ while (*s && *s != ',')
+ {
+ if (*s == '\\' && s[1] != NUL)
+ ++s;
+ ++s;
+ }
+ s = skip_to_option_part(s);
+ }
+ }
+#endif
+
+ /* 'listchars' */
+ else if (varp == &p_lcs)
+ {
+ errmsg = set_chars_option(varp);
+ }
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ /* 'fillchars' */
+ else if (varp == &p_fcs)
+ {
+ errmsg = set_chars_option(varp);
+ }
+#endif
+
+#ifdef FEAT_CMDWIN
+ /* 'cedit' */
+ else if (varp == &p_cedit)
+ {
+ errmsg = check_cedit();
+ }
+#endif
+
+#ifdef FEAT_VIMINFO
+ /* 'viminfo' */
+ else if (varp == &p_viminfo)
+ {
+ for (s = p_viminfo; *s;)
+ {
+ /* Check it's a valid character */
+ if (vim_strchr((char_u *)"!\"%'/:<@cfhnrs", *s) == NULL)
+ {
+ errmsg = illegal_char(errbuf, *s);
+ break;
+ }
+ if (*s == 'n') /* name is always last one */
+ {
+ break;
+ }
+ else if (*s == 'r') /* skip until next ',' */
+ {
+ while (*++s && *s != ',')
+ ;
+ }
+ else if (*s == '%' || *s == '!' || *s == 'h' || *s == 'c')
+ ++s; /* no extra chars */
+ else /* must have a number */
+ {
+ while (vim_isdigit(*++s))
+ ;
+
+ if (!VIM_ISDIGIT(*(s - 1)))
+ {
+ if (errbuf != NULL)
+ {
+ sprintf((char *)errbuf, _("E526: Missing number after <%s>"),
+ transchar_byte(*(s - 1)));
+ errmsg = errbuf;
+ }
+ else
+ errmsg = (char_u *)"";
+ break;
+ }
+ }
+ if (*s == ',')
+ ++s;
+ else if (*s)
+ {
+ if (errbuf != NULL)
+ errmsg = (char_u *)N_("E527: Missing comma");
+ else
+ errmsg = (char_u *)"";
+ break;
+ }
+ }
+ if (*p_viminfo && errmsg == NULL && get_viminfo_parameter('\'') < 0)
+ errmsg = (char_u *)N_("E528: Must specify a ' value");
+ }
+#endif /* FEAT_VIMINFO */
+
+ /* terminal options */
+ else if (istermoption(&options[opt_idx]) && full_screen)
+ {
+ /* ":set t_Co=0" and ":set t_Co=1" do ":set t_Co=" */
+ if (varp == &T_CCO)
+ {
+ t_colors = atoi((char *)T_CCO);
+ if (t_colors <= 1)
+ {
+ if (new_value_alloced)
+ vim_free(T_CCO);
+ T_CCO = empty_option;
+ }
+ /* We now have a different color setup, initialize it again. */
+ init_highlight(TRUE, FALSE);
+ }
+ ttest(FALSE);
+ if (varp == &T_ME)
+ {
+ out_str(T_ME);
+ redraw_later(CLEAR);
+#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
+ /* Since t_me has been set, this probably means that the user
+ * wants to use this as default colors. Need to reset default
+ * background/foreground colors. */
+ mch_set_normal_colors();
+#endif
+ }
+ }
+
+#ifdef FEAT_LINEBREAK
+ /* 'showbreak' */
+ else if (varp == &p_sbr)
+ {
+ for (s = p_sbr; *s; )
+ {
+ if (ptr2cells(s) != 1)
+ errmsg = (char_u *)N_("E595: contains unprintable or wide character");
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+# endif
+ ++s;
+ }
+ }
+#endif
+
+#ifdef FEAT_GUI
+ /* 'guifont' */
+ else if (varp == &p_guifont)
+ {
+ if (gui.in_use)
+ {
+ p = p_guifont;
+# ifdef FEAT_GUI_GTK
+ /*
+ * Put up a font dialog and let the user select a new value.
+ * If this is cancelled go back to the old value but don't
+ * give an error message.
+ */
+ if (STRCMP(p, "*") == 0)
+ {
+ p = gui_mch_font_dialog(oldval);
+
+ if (new_value_alloced)
+ free_string_option(p_guifont);
+
+ p_guifont = (p != NULL) ? p : vim_strsave(oldval);
+ new_value_alloced = TRUE;
+ }
+# endif
+ if (p != NULL && gui_init_font(p_guifont, FALSE) != OK)
+ {
+# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON)
+ if (STRCMP(p_guifont, "*") == 0)
+ {
+ /* Dialog was cancelled: Keep the old value without giving
+ * an error message. */
+ if (new_value_alloced)
+ free_string_option(p_guifont);
+ p_guifont = vim_strsave(oldval);
+ new_value_alloced = TRUE;
+ }
+ else
+# endif
+ errmsg = (char_u *)N_("E596: Invalid font(s)");
+ }
+ }
+ }
+# ifdef FEAT_XFONTSET
+ else if (varp == &p_guifontset)
+ {
+ if (STRCMP(p_guifontset, "*") == 0)
+ errmsg = (char_u *)N_("E597: can't select fontset");
+ else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
+ errmsg = (char_u *)N_("E598: Invalid fontset");
+ }
+# endif
+# ifdef FEAT_MBYTE
+ else if (varp == &p_guifontwide)
+ {
+ if (STRCMP(p_guifontwide, "*") == 0)
+ errmsg = (char_u *)N_("E533: can't select wide font");
+ else if (gui_get_wide_font() == FAIL)
+ errmsg = (char_u *)N_("E534: Invalid wide font");
+ }
+# endif
+#endif
+
+#ifdef CURSOR_SHAPE
+ /* 'guicursor' */
+ else if (varp == &p_guicursor)
+ errmsg = parse_shape_opt(SHAPE_CURSOR);
+#endif
+
+#ifdef FEAT_MOUSESHAPE
+ /* 'mouseshape' */
+ else if (varp == &p_mouseshape)
+ {
+ errmsg = parse_shape_opt(SHAPE_MOUSE);
+ update_mouseshape(-1);
+ }
+#endif
+
+#ifdef FEAT_PRINTER
+ else if (varp == &p_popt)
+ errmsg = parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS);
+#endif
+
+#ifdef FEAT_LANGMAP
+ /* 'langmap' */
+ else if (varp == &p_langmap)
+ langmap_set();
+#endif
+
+#ifdef FEAT_LINEBREAK
+ /* 'breakat' */
+ else if (varp == &p_breakat)
+ fill_breakat_flags();
+#endif
+
+#ifdef FEAT_TITLE
+ /* 'titlestring' and 'iconstring' */
+ else if (varp == &p_titlestring || varp == &p_iconstring)
+ {
+# ifdef FEAT_STL_OPT
+ int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;
+
+ /* NULL => statusline syntax */
+ if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL)
+ stl_syntax |= flagval;
+ else
+ stl_syntax &= ~flagval;
+# endif
+ did_set_title(varp == &p_iconstring);
+
+ }
+#endif
+
+#ifdef FEAT_GUI
+ /* 'guioptions' */
+ else if (varp == &p_go)
+ gui_init_which_components(oldval);
+#endif
+
+#if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
+ /* 'ttymouse' */
+ else if (varp == &p_ttym)
+ {
+ if (opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE) != OK)
+ errmsg = e_invarg;
+ else
+ check_mouse_termcode();
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /* 'selection' */
+ else if (varp == &p_sel)
+ {
+ if (*p_sel == NUL
+ || check_opt_strings(p_sel, p_sel_values, FALSE) != OK)
+ errmsg = e_invarg;
+ }
+
+ /* 'selectmode' */
+ else if (varp == &p_slm)
+ {
+ if (check_opt_strings(p_slm, p_slm_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_BROWSE
+ /* 'browsedir' */
+ else if (varp == &p_bsdir)
+ {
+ if (check_opt_strings(p_bsdir, p_bsdir_values, FALSE) != OK
+ && !mch_isdir(p_bsdir))
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /* 'keymodel' */
+ else if (varp == &p_km)
+ {
+ if (check_opt_strings(p_km, p_km_values, TRUE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+ km_stopsel = (vim_strchr(p_km, 'o') != NULL);
+ km_startsel = (vim_strchr(p_km, 'a') != NULL);
+ }
+ }
+#endif
+
+ /* 'mousemodel' */
+ else if (varp == &p_mousem)
+ {
+ if (check_opt_strings(p_mousem, p_mousem_values, FALSE) != OK)
+ errmsg = e_invarg;
+#if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) && (XmVersion <= 1002)
+ else if (*p_mousem != *oldval)
+ /* Changed from "extend" to "popup" or "popup_setpos" or vv: need
+ * to create or delete the popup menus. */
+ gui_motif_update_mousemodel(root_menu);
+#endif
+ }
+
+ /* 'switchbuf' */
+ else if (varp == &p_swb)
+ {
+ if (check_opt_strings(p_swb, p_swb_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+
+ /* 'debug' */
+ else if (varp == &p_debug)
+ {
+ if (check_opt_strings(p_debug, p_debug_values, FALSE) != OK)
+ errmsg = e_invarg;
+ }
+
+ /* 'display' */
+ else if (varp == &p_dy)
+ {
+ if (opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ else
+ (void)init_chartab();
+
+ }
+
+#ifdef FEAT_VERTSPLIT
+ /* 'eadirection' */
+ else if (varp == &p_ead)
+ {
+ if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_CLIPBOARD
+ /* 'clipboard' */
+ else if (varp == &p_cb)
+ errmsg = check_clipboard_option();
+#endif
+
+#ifdef FEAT_AUTOCMD
+# ifdef FEAT_SYN_HL
+ /* When 'syntax' is set, load the syntax of that name */
+ else if (varp == &(curbuf->b_p_syn))
+ {
+ apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
+ curbuf->b_fname, TRUE, curbuf);
+ }
+# endif
+
+ /* When 'filetype' is set, trigger the FileType autocommands of that name */
+ else if (varp == &(curbuf->b_p_ft))
+ {
+ did_filetype = TRUE;
+ apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
+ curbuf->b_fname, TRUE, curbuf);
+ }
+#endif
+
+#ifdef FEAT_QUICKFIX
+ /* When 'bufhidden' is set, check for valid value. */
+ else if (gvarp == &p_bh)
+ {
+ if (check_opt_strings(curbuf->b_p_bh, p_bufhidden_values, FALSE) != OK)
+ errmsg = e_invarg;
+ }
+
+ /* When 'buftype' is set, check for valid value. */
+ else if (gvarp == &p_bt)
+ {
+ if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+# ifdef FEAT_WINDOWS
+ if (curwin->w_status_height)
+ {
+ curwin->w_redr_status = TRUE;
+ redraw_later(VALID);
+ }
+# endif
+ curbuf->b_help = (curbuf->b_p_bt[0] == 'h');
+ }
+ }
+#endif
+
+#ifdef FEAT_STL_OPT
+ /* 'statusline' or 'rulerformat' */
+ else if (varp == &p_stl || varp == &p_ruf)
+ {
+ int wid;
+
+ if (varp == &p_ruf) /* reset ru_wid first */
+ ru_wid = 0;
+ s = *varp;
+ if (varp == &p_ruf && *s == '%')
+ {
+ /* set ru_wid if 'ruf' starts with "%99(" */
+ if (*++s == '-') /* ignore a '-' */
+ s++;
+ wid = getdigits(&s);
+ if (wid && *s == '(' && (errmsg = check_stl_option(p_ruf)) == NULL)
+ ru_wid = wid;
+ else
+ errmsg = check_stl_option(p_ruf);
+ }
+ else
+ errmsg = check_stl_option(s);
+ if (varp == &(p_ruf) && errmsg == NULL)
+ comp_col();
+ }
+#endif
+
+#ifdef FEAT_INS_EXPAND
+ /* check if it is a valid value for 'complete' -- Acevedo */
+ else if (gvarp == &p_cpt)
+ {
+ for (s = *varp; *s;)
+ {
+ while(*s == ',' || *s == ' ')
+ s++;
+ if (!*s)
+ break;
+ if (vim_strchr((char_u *)".wbuksid]tU", *s) == NULL)
+ {
+ errmsg = illegal_char(errbuf, *s);
+ break;
+ }
+ if (*++s != NUL && *s != ',' && *s != ' ')
+ {
+ if (s[-1] == 'k' || s[-1] == 's')
+ {
+ /* skip optional filename after 'k' and 's' */
+ while (*s && *s != ',' && *s != ' ')
+ {
+ if (*s == '\\')
+ ++s;
+ ++s;
+ }
+ }
+ else
+ {
+ if (errbuf != NULL)
+ {
+ sprintf((char *)errbuf,
+ _("E535: Illegal character after <%c>"),
+ *--s);
+ errmsg = errbuf;
+ }
+ else
+ errmsg = (char_u *)"";
+ break;
+ }
+ }
+ }
+ }
+#endif /* FEAT_INS_EXPAND */
+
+
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+ else if (varp == &p_toolbar)
+ {
+ if (opt_strings_flags(p_toolbar, p_toolbar_values,
+ &toolbar_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+ out_flush();
+ gui_mch_show_toolbar((toolbar_flags &
+ (TOOLBAR_TEXT | TOOLBAR_ICONS)) != 0);
+ }
+ }
+#endif
+
+#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
+ /* 'toolbariconsize': GTK+ 2 only */
+ else if (varp == &p_tbis)
+ {
+ if (opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE) != OK)
+ errmsg = e_invarg;
+ else
+ {
+ out_flush();
+ gui_mch_show_toolbar((toolbar_flags &
+ (TOOLBAR_TEXT | TOOLBAR_ICONS)) != 0);
+ }
+ }
+#endif
+
+ /* 'pastetoggle': translate key codes like in a mapping */
+ else if (varp == &p_pt)
+ {
+ if (*p_pt)
+ {
+ (void)replace_termcodes(p_pt, &p, TRUE, TRUE);
+ if (p != NULL)
+ {
+ if (new_value_alloced)
+ free_string_option(p_pt);
+ p_pt = p;
+ new_value_alloced = TRUE;
+ }
+ }
+ }
+
+ /* 'backspace' */
+ else if (varp == &p_bs)
+ {
+ if (VIM_ISDIGIT(*p_bs))
+ {
+ if (*p_bs >'2' || p_bs[1] != NUL)
+ errmsg = e_invarg;
+ }
+ else if (check_opt_strings(p_bs, p_bs_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+
+ /* 'casemap' */
+ else if (varp == &p_cmp)
+ {
+ if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+
+#ifdef FEAT_DIFF
+ /* 'diffopt' */
+ else if (varp == &p_dip)
+ {
+ if (diffopt_changed() == FAIL)
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_FOLDING
+ /* 'foldmethod' */
+ else if (gvarp == &curwin->w_allbuf_opt.wo_fdm)
+ {
+ if (check_opt_strings(*varp, p_fdm_values, FALSE) != OK
+ || *curwin->w_p_fdm == NUL)
+ errmsg = e_invarg;
+ else
+ foldUpdateAll(curwin);
+ }
+# ifdef FEAT_EVAL
+ /* 'foldexpr' */
+ else if (varp == &curwin->w_p_fde)
+ {
+ if (foldmethodIsExpr(curwin))
+ foldUpdateAll(curwin);
+ }
+# endif
+ /* 'foldmarker' */
+ else if (gvarp == &curwin->w_allbuf_opt.wo_fmr)
+ {
+ p = vim_strchr(*varp, ',');
+ if (p == NULL)
+ errmsg = (char_u *)N_("E536: comma required");
+ else if (p == *varp || p[1] == NUL)
+ errmsg = e_invarg;
+ else if (foldmethodIsMarker(curwin))
+ foldUpdateAll(curwin);
+ }
+ /* 'commentstring' */
+ else if (gvarp == &p_cms)
+ {
+ if (**varp != NUL && strstr((char *)*varp, "%s") == NULL)
+ errmsg = (char_u *)N_("E537: 'commentstring' must be empty or contain %s");
+ }
+ /* 'foldopen' */
+ else if (varp == &p_fdo)
+ {
+ if (opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+ /* 'foldclose' */
+ else if (varp == &p_fcl)
+ {
+ if (check_opt_strings(p_fcl, p_fcl_values, TRUE) != OK)
+ errmsg = e_invarg;
+ }
+#endif
+
+#ifdef FEAT_VIRTUALEDIT
+ /* 'virtualedit' */
+ else if (varp == &p_ve)
+ {
+ if (opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE) != OK)
+ errmsg = e_invarg;
+ else if (STRCMP(p_ve, oldval) != 0)
+ {
+ /* Recompute cursor position in case the new 've' setting
+ * changes something. */
+ validate_virtcol();
+ coladvance(curwin->w_virtcol);
+ }
+ }
+#endif
+
+#if defined(FEAT_CSCOPE) && defined(FEAT_QUICKFIX)
+ else if (varp == &p_csqf)
+ {
+ if (p_csqf != NULL)
+ {
+ p = p_csqf;
+ while (*p != NUL)
+ {
+ if (vim_strchr((char_u *)CSQF_CMDS, *p) == NULL
+ || p[1] == NUL
+ || vim_strchr((char_u *)CSQF_FLAGS, p[1]) == NULL
+ || (p[2] != NUL && p[2] != ','))
+ {
+ errmsg = e_invarg;
+ break;
+ }
+ else if (p[2] == NUL)
+ break;
+ else
+ p += 3;
+ }
+ }
+ }
+#endif
+
+ /* Options that are a list of flags. */
+ else
+ {
+ p = NULL;
+ if (varp == &p_ww)
+ p = (char_u *)WW_ALL;
+ if (varp == &p_shm)
+ p = (char_u *)SHM_ALL;
+ else if (varp == &(p_cpo))
+ p = (char_u *)CPO_ALL;
+ else if (varp == &(curbuf->b_p_fo))
+ p = (char_u *)FO_ALL;
+ else if (varp == &p_mouse)
+ {
+#ifdef FEAT_MOUSE
+ p = (char_u *)MOUSE_ALL;
+#else
+ if (*p_mouse != NUL)
+ errmsg = (char_u *)N_("E538: No mouse support");
+#endif
+ }
+#if defined(FEAT_GUI)
+ else if (varp == &p_go)
+ p = (char_u *)GO_ALL;
+#endif
+ if (p != NULL)
+ {
+ for (s = *varp; *s; ++s)
+ if (vim_strchr(p, *s) == NULL)
+ {
+ errmsg = illegal_char(errbuf, *s);
+ break;
+ }
+ }
+ }
+
+ /*
+ * If error detected, restore the previous value.
+ */
+ if (errmsg != NULL)
+ {
+ if (new_value_alloced)
+ free_string_option(*varp);
+ *varp = oldval;
+ /*
+ * When resetting some values, need to act on it.
+ */
+ if (did_chartab)
+ (void)init_chartab();
+ if (varp == &p_hl)
+ (void)highlight_changed();
+ }
+ else
+ {
+#ifdef FEAT_EVAL
+ /* Remember where the option was set. */
+ options[opt_idx].scriptID = current_SID;
+#endif
+ /*
+ * Free string options that are in allocated memory.
+ */
+ if (options[opt_idx].flags & P_ALLOCED)
+ free_string_option(oldval);
+ if (new_value_alloced)
+ options[opt_idx].flags |= P_ALLOCED;
+ else
+ options[opt_idx].flags &= ~P_ALLOCED;
+
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0
+ && (int)options[opt_idx].indir >= PV_BOTH)
+ {
+ /* global option with local value set to use global value; free
+ * the local value and make it empty */
+ p = get_varp_scope(&(options[opt_idx]), OPT_LOCAL);
+ free_string_option(*(char_u **)p);
+ *(char_u **)p = empty_option;
+ }
+
+ /* May set global value for local option. */
+ else if (!(opt_flags & OPT_LOCAL) && opt_flags != OPT_GLOBAL)
+ set_string_option_global(opt_idx, varp);
+ }
+
+#ifdef FEAT_MOUSE
+ if (varp == &p_mouse)
+ {
+# ifdef FEAT_MOUSE_TTY
+ if (*p_mouse == NUL)
+ mch_setmouse(FALSE); /* switch mouse off */
+ else
+# endif
+ setmouse(); /* in case 'mouse' changed */
+ }
+#endif
+
+ if (curwin->w_curswant != MAXCOL)
+ curwin->w_set_curswant = TRUE; /* in case 'showbreak' changed */
+ check_redraw(options[opt_idx].flags);
+
+ return errmsg;
+}
+
+/*
+ * Handle setting 'listchars' or 'fillchars'.
+ * Returns error message, NULL if it's OK.
+ */
+ static char_u *
+set_chars_option(varp)
+ char_u **varp;
+{
+ int round, i, len, entries;
+ char_u *p, *s;
+ int c1, c2 = 0;
+ struct charstab
+ {
+ int *cp;
+ char *name;
+ };
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ static struct charstab filltab[] =
+ {
+ {&fill_stl, "stl"},
+ {&fill_stlnc, "stlnc"},
+ {&fill_vert, "vert"},
+ {&fill_fold, "fold"},
+ {&fill_diff, "diff"},
+ };
+#endif
+ static struct charstab lcstab[] =
+ {
+ {&lcs_eol, "eol"},
+ {&lcs_ext, "extends"},
+ {&lcs_prec, "precedes"},
+ {&lcs_tab2, "tab"},
+ {&lcs_trail, "trail"},
+ };
+ struct charstab *tab;
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ if (varp == &p_lcs)
+#endif
+ {
+ tab = lcstab;
+ entries = sizeof(lcstab) / sizeof(struct charstab);
+ }
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ else
+ {
+ tab = filltab;
+ entries = sizeof(filltab) / sizeof(struct charstab);
+ }
+#endif
+
+ /* first round: check for valid value, second round: assign values */
+ for (round = 0; round <= 1; ++round)
+ {
+ if (round)
+ {
+ /* After checking that the value is valid: set defaults: space for
+ * 'fillchars', NUL for 'listchars' */
+ for (i = 0; i < entries; ++i)
+ *(tab[i].cp) = (varp == &p_lcs ? NUL : ' ');
+ if (varp == &p_lcs)
+ lcs_tab1 = NUL;
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ else
+ fill_diff = '-';
+#endif
+ }
+ p = *varp;
+ while (*p)
+ {
+ for (i = 0; i < entries; ++i)
+ {
+ len = (int)STRLEN(tab[i].name);
+ if (STRNCMP(p, tab[i].name, len) == 0
+ && p[len] == ':'
+ && p[len + 1] != NUL)
+ {
+ s = p + len + 1;
+#ifdef FEAT_MBYTE
+ c1 = mb_ptr2char_adv(&s);
+#else
+ c1 = *s++;
+#endif
+ if (tab[i].cp == &lcs_tab2)
+ {
+ if (*s == NUL)
+ continue;
+#ifdef FEAT_MBYTE
+ c2 = mb_ptr2char_adv(&s);
+#else
+ c2 = *s++;
+#endif
+ }
+ if (*s == ',' || *s == NUL)
+ {
+ if (round)
+ {
+ if (tab[i].cp == &lcs_tab2)
+ {
+ lcs_tab1 = c1;
+ lcs_tab2 = c2;
+ }
+ else
+ *(tab[i].cp) = c1;
+
+ }
+ p = s;
+ break;
+ }
+ }
+ }
+
+ if (i == entries)
+ return e_invarg;
+ if (*p == ',')
+ ++p;
+ }
+ }
+
+ return NULL; /* no error */
+}
+
+#ifdef FEAT_STL_OPT
+/*
+ * Check validity of options with the 'statusline' format.
+ * Return error message or NULL.
+ */
+ char_u *
+check_stl_option(s)
+ char_u *s;
+{
+ int itemcnt = 0;
+ int groupdepth = 0;
+ static char_u errbuf[80];
+
+ while (*s && itemcnt < STL_MAX_ITEM)
+ {
+ /* Check for valid keys after % sequences */
+ while (*s && *s != '%')
+ s++;
+ if (!*s)
+ break;
+ s++;
+ if (*s != '%' && *s != ')')
+ ++itemcnt;
+ if (*s == '%' || *s == STL_TRUNCMARK || *s == STL_MIDDLEMARK)
+ {
+ s++;
+ continue;
+ }
+ if (*s == ')')
+ {
+ s++;
+ if (--groupdepth < 0)
+ break;
+ continue;
+ }
+ if (*s == '-')
+ s++;
+ while (VIM_ISDIGIT(*s))
+ s++;
+ if (*s == STL_HIGHLIGHT)
+ continue;
+ if (*s == '.')
+ {
+ s++;
+ while (*s && VIM_ISDIGIT(*s))
+ s++;
+ }
+ if (*s == '(')
+ {
+ groupdepth++;
+ continue;
+ }
+ if (vim_strchr(STL_ALL, *s) == NULL)
+ {
+ return illegal_char(errbuf, *s);
+ }
+ if (*s == '{')
+ {
+ s++;
+ while (*s != '}' && *s)
+ s++;
+ if (*s != '}')
+ return (char_u *)N_("E540: Unclosed expression sequence");
+ }
+ }
+ if (itemcnt >= STL_MAX_ITEM)
+ return (char_u *)N_("E541: too many items");
+ if (groupdepth != 0)
+ return (char_u *)N_("E542: unbalanced groups");
+ return NULL;
+}
+#endif
+
+#ifdef FEAT_CLIPBOARD
+/*
+ * Extract the items in the 'clipboard' option and set global values.
+ */
+ static char_u *
+check_clipboard_option()
+{
+ int new_unnamed = FALSE;
+ int new_autoselect = FALSE;
+ int new_autoselectml = FALSE;
+ regprog_T *new_exclude_prog = NULL;
+ char_u *errmsg = NULL;
+ char_u *p;
+
+ for (p = p_cb; *p != NUL; )
+ {
+ if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
+ {
+ new_unnamed = TRUE;
+ p += 7;
+ }
+ else if (STRNCMP(p, "autoselect", 10) == 0
+ && (p[10] == ',' || p[10] == NUL))
+ {
+ new_autoselect = TRUE;
+ p += 10;
+ }
+ else if (STRNCMP(p, "autoselectml", 12) == 0
+ && (p[12] == ',' || p[12] == NUL))
+ {
+ new_autoselectml = TRUE;
+ p += 12;
+ }
+ else if (STRNCMP(p, "exclude:", 8) == 0 && new_exclude_prog == NULL)
+ {
+ p += 8;
+ new_exclude_prog = vim_regcomp(p, RE_MAGIC);
+ if (new_exclude_prog == NULL)
+ errmsg = e_invarg;
+ break;
+ }
+ else
+ {
+ errmsg = e_invarg;
+ break;
+ }
+ if (*p == ',')
+ ++p;
+ }
+ if (errmsg == NULL)
+ {
+ clip_unnamed = new_unnamed;
+ clip_autoselect = new_autoselect;
+ clip_autoselectml = new_autoselectml;
+ vim_free(clip_exclude_prog);
+ clip_exclude_prog = new_exclude_prog;
+ }
+ else
+ vim_free(new_exclude_prog);
+
+ return errmsg;
+}
+#endif
+
+/*
+ * Set the value of a boolean option, and take care of side effects.
+ * Returns NULL for success, or an error message for an error.
+ */
+ static char_u *
+set_bool_option(opt_idx, varp, value, opt_flags)
+ int opt_idx; /* index in options[] table */
+ char_u *varp; /* pointer to the option variable */
+ int value; /* new value */
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ int old_value = *(int *)varp;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /* Disallow changing some options from secure mode */
+ if ((secure
+#ifdef HAVE_SANDBOX
+ || sandbox != 0
+#endif
+ ) && (options[opt_idx].flags & P_SECURE))
+ return e_secure;
+
+ *(int *)varp = value; /* set the new value */
+#ifdef FEAT_EVAL
+ /* Remember where the option was set. */
+ options[opt_idx].scriptID = current_SID;
+#endif
+
+ /* May set global value for local option. */
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
+ *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = value;
+
+ /*
+ * Handle side effects of changing a bool option.
+ */
+
+ /* 'compatible' */
+ if ((int *)varp == &p_cp)
+ {
+ compatible_set();
+ }
+
+ /* when 'readonly' is reset globally, also reset readonlymode */
+ else if ((int *)varp == &curbuf->b_p_ro)
+ {
+ if (!curbuf->b_p_ro && (opt_flags & OPT_LOCAL) == 0)
+ readonlymode = FALSE;
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+#endif
+ }
+
+#ifdef FEAT_TITLE
+ /* when 'modifiable' is changed, redraw the window title */
+ else if ((int *)varp == &curbuf->b_p_ma)
+ need_maketitle = TRUE;
+ /* when 'endofline' is changed, redraw the window title */
+ else if ((int *)varp == &curbuf->b_p_eol)
+ need_maketitle = TRUE;
+#endif
+
+ /* when 'bin' is set also set some other options */
+ else if ((int *)varp == &curbuf->b_p_bin)
+ {
+ set_options_bin(old_value, curbuf->b_p_bin, opt_flags);
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+#endif
+ }
+
+#ifdef FEAT_AUTOCMD
+ /* when 'buflisted' changes, trigger autocommands */
+ else if ((int *)varp == &curbuf->b_p_bl && old_value != curbuf->b_p_bl)
+ {
+ apply_autocmds(curbuf->b_p_bl ? EVENT_BUFADD : EVENT_BUFDELETE,
+ NULL, NULL, TRUE, curbuf);
+ }
+#endif
+
+ /* when 'swf' is set, create swapfile, when reset remove swapfile */
+ else if ((int *)varp == &curbuf->b_p_swf)
+ {
+ if (curbuf->b_p_swf && p_uc)
+ ml_open_file(curbuf); /* create the swap file */
+ else
+ mf_close_file(curbuf, TRUE); /* remove the swap file */
+ }
+
+ /* when 'terse' is set change 'shortmess' */
+ else if ((int *)varp == &p_terse)
+ {
+ char_u *p;
+
+ p = vim_strchr(p_shm, SHM_SEARCH);
+
+ /* insert 's' in p_shm */
+ if (p_terse && p == NULL)
+ {
+ STRCPY(IObuff, p_shm);
+ STRCAT(IObuff, "s");
+ set_string_option_direct((char_u *)"shm", -1, IObuff, OPT_FREE);
+ }
+ /* remove 's' from p_shm */
+ else if (!p_terse && p != NULL)
+ mch_memmove(p, p + 1, STRLEN(p));
+ }
+
+ /* when 'paste' is set or reset also change other options */
+ else if ((int *)varp == &p_paste)
+ {
+ paste_option_changed();
+ }
+
+ /* when 'insertmode' is set from an autocommand need to do work here */
+ else if ((int *)varp == &p_im)
+ {
+ if (p_im)
+ {
+ if ((State & INSERT) == 0)
+ need_start_insertmode = TRUE;
+ stop_insert_mode = FALSE;
+ }
+ else
+ {
+ need_start_insertmode = FALSE;
+ stop_insert_mode = TRUE;
+ if (p_smd && restart_edit != 0)
+ clear_cmdline = TRUE; /* remove "(insert)" */
+ restart_edit = 0;
+ }
+ }
+
+ /* when 'ignorecase' is set or reset and 'hlsearch' is set, redraw */
+ else if ((int *)varp == &p_ic && p_hls)
+ {
+ redraw_all_later(NOT_VALID);
+ }
+
+#ifdef FEAT_SEARCH_EXTRA
+ /* when 'hlsearch' is set or reset: reset no_hlsearch */
+ else if ((int *)varp == &p_hls)
+ {
+ no_hlsearch = FALSE;
+ }
+#endif
+
+#ifdef FEAT_SCROLLBIND
+ /* when 'scrollbind' is set: snapshot the current position to avoid a jump
+ * at the end of normal_cmd() */
+ else if ((int *)varp == &curwin->w_p_scb)
+ {
+ if (curwin->w_p_scb)
+ do_check_scrollbind(FALSE);
+ }
+#endif
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ /* There can be only one window with 'previewwindow' set. */
+ else if ((int *)varp == &curwin->w_p_pvw)
+ {
+ if (curwin->w_p_pvw)
+ {
+ win_T *win;
+
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (win->w_p_pvw && win != curwin)
+ {
+ curwin->w_p_pvw = FALSE;
+ return (char_u *)N_("E590: A preview window already exists");
+ }
+ }
+ }
+#endif
+
+ /* when 'textmode' is set or reset also change 'fileformat' */
+ else if ((int *)varp == &curbuf->b_p_tx)
+ {
+ set_fileformat(curbuf->b_p_tx ? EOL_DOS : EOL_UNIX, opt_flags);
+ }
+
+ /* when 'textauto' is set or reset also change 'fileformats' */
+ else if ((int *)varp == &p_ta)
+ {
+ set_string_option_direct((char_u *)"ffs", -1,
+ p_ta ? (char_u *)DFLT_FFS_VIM : (char_u *)"",
+ OPT_FREE | opt_flags);
+ }
+
+ /*
+ * When 'lisp' option changes include/exclude '-' in
+ * keyword characters.
+ */
+#ifdef FEAT_LISP
+ else if (varp == (char_u *)&(curbuf->b_p_lisp))
+ {
+ (void)buf_init_chartab(curbuf, FALSE); /* ignore errors */
+ }
+#endif
+
+#ifdef FEAT_TITLE
+ /* when 'title' changed, may need to change the title; same for 'icon' */
+ else if ((int *)varp == &p_title)
+ {
+ did_set_title(FALSE);
+ }
+
+ else if ((int *)varp == &p_icon)
+ {
+ did_set_title(TRUE);
+ }
+#endif
+
+ else if ((int *)varp == &curbuf->b_changed)
+ {
+ if (!value)
+ save_file_ff(curbuf); /* Buffer is unchanged */
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE;
+#endif
+#ifdef FEAT_AUTOCMD
+ modified_was_set = value;
+#endif
+ }
+
+#ifdef BACKSLASH_IN_FILENAME
+ else if ((int *)varp == &p_ssl)
+ {
+ if (p_ssl)
+ {
+ psepc = '/';
+ psepcN = '\\';
+ pseps[0] = '/';
+ psepsN[0] = '\\';
+ }
+ else
+ {
+ psepc = '\\';
+ psepcN = '/';
+ pseps[0] = '\\';
+ psepsN[0] = '/';
+ }
+
+ /* need to adjust the file name arguments and buffer names. */
+ buflist_slash_adjust();
+ alist_slash_adjust();
+# ifdef FEAT_EVAL
+ scriptnames_slash_adjust();
+# endif
+ }
+#endif
+
+ /* If 'wrap' is set, set w_leftcol to zero. */
+ else if ((int *)varp == &curwin->w_p_wrap)
+ {
+ if (curwin->w_p_wrap)
+ curwin->w_leftcol = 0;
+ }
+
+#ifdef FEAT_WINDOWS
+ else if ((int *)varp == &p_ea)
+ {
+ if (p_ea && !old_value)
+ win_equal(curwin, FALSE, 0);
+ }
+#endif
+
+ else if ((int *)varp == &p_wiv)
+ {
+ /*
+ * When 'weirdinvert' changed, set/reset 't_xs'.
+ * Then set 'weirdinvert' according to value of 't_xs'.
+ */
+ if (p_wiv && !old_value)
+ T_XS = (char_u *)"y";
+ else if (!p_wiv && old_value)
+ T_XS = empty_option;
+ p_wiv = (*T_XS != NUL);
+ }
+
+#if defined(FEAT_BEVAL) && (defined(FEAT_SUN_WORKSHOP) \
+ || defined(FEAT_NETBEANS_INTG))
+ else if ((int *)varp == &p_beval)
+ {
+ extern BalloonEval *balloonEval;
+
+ if (p_beval == TRUE)
+ gui_mch_enable_beval_area(balloonEval);
+ else
+ gui_mch_disable_beval_area(balloonEval);
+ }
+
+ else if ((int *)varp == &p_acd)
+ {
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+ }
+#endif
+
+#ifdef FEAT_DIFF
+ /* 'diff' */
+ else if ((int *)varp == &curwin->w_p_diff)
+ {
+ win_T *wp;
+
+ if (!curwin->w_p_diff)
+ {
+ /* When there is no window showing a diff for this buffer, remove
+ * it from the diffs. */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_buffer == curwin->w_buffer && wp->w_p_diff)
+ break;
+ if (wp == NULL)
+ diff_buf_delete(curwin->w_buffer);
+ }
+ else
+ diff_buf_add(curwin->w_buffer);
+#ifdef FEAT_FOLDING
+ if (foldmethodIsDiff(curwin))
+ foldUpdateAll(curwin);
+#endif
+ }
+#endif
+
+#ifdef USE_IM_CONTROL
+ /* 'imdisable' */
+ else if ((int *)varp == &p_imdisable)
+ {
+ /* Only de-activate it here, it will be enabled when changing mode. */
+ if (p_imdisable)
+ im_set_active(FALSE);
+ }
+#endif
+
+#ifdef FEAT_FKMAP
+ else if ((int *)varp == &p_altkeymap)
+ {
+ if (old_value != p_altkeymap)
+ {
+ if (!p_altkeymap)
+ {
+ p_hkmap = p_fkmap;
+ p_fkmap = 0;
+ }
+ else
+ {
+ p_fkmap = p_hkmap;
+ p_hkmap = 0;
+ }
+ (void)init_chartab();
+ }
+ }
+
+ /*
+ * In case some second language keymapping options have changed, check
+ * and correct the setting in a consistent way.
+ */
+
+ /*
+ * If hkmap or fkmap are set, reset Arabic keymapping.
+ */
+ if ((p_hkmap || p_fkmap) && p_altkeymap)
+ {
+ p_altkeymap = p_fkmap;
+# ifdef FEAT_ARABIC
+ curwin->w_p_arab = FALSE;
+# endif
+ (void)init_chartab();
+ }
+
+ /*
+ * If hkmap set, reset Farsi keymapping.
+ */
+ if (p_hkmap && p_altkeymap)
+ {
+ p_altkeymap = 0;
+ p_fkmap = 0;
+# ifdef FEAT_ARABIC
+ curwin->w_p_arab = FALSE;
+# endif
+ (void)init_chartab();
+ }
+
+ /*
+ * If fkmap set, reset Hebrew keymapping.
+ */
+ if (p_fkmap && !p_altkeymap)
+ {
+ p_altkeymap = 1;
+ p_hkmap = 0;
+# ifdef FEAT_ARABIC
+ curwin->w_p_arab = FALSE;
+# endif
+ (void)init_chartab();
+ }
+#endif
+
+#ifdef FEAT_ARABIC
+ if ((int *)varp == &curwin->w_p_arab)
+ {
+ if (curwin->w_p_arab)
+ {
+ /*
+ * 'arabic' is set, handle various sub-settings.
+ */
+ if (!p_tbidi)
+ {
+ /* set rightleft mode */
+ if (!curwin->w_p_rl)
+ {
+ curwin->w_p_rl = TRUE;
+ changed_window_setting();
+ }
+
+ /* Enable Arabic shaping (major part of what Arabic requires) */
+ if (!p_arshape)
+ {
+ p_arshape = TRUE;
+ redraw_later_clear();
+ }
+ }
+
+ /* Arabic requires a utf-8 encoding, inform the user if its not
+ * set. */
+ if (STRCMP(p_enc, "utf-8") != 0)
+ MSG_ATTR(_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"),
+ hl_attr(HLF_W));
+
+# ifdef FEAT_MBYTE
+ /* set 'delcombine' */
+ p_deco = TRUE;
+# endif
+
+# ifdef FEAT_KEYMAP
+ /* Force-set the necessary keymap for arabic */
+ set_option_value((char_u *)"keymap", 0L, (char_u *)"arabic",
+ OPT_LOCAL);
+# endif
+# ifdef FEAT_FKMAP
+ p_altkeymap = 0;
+ p_hkmap = 0;
+ p_fkmap = 0;
+ (void)init_chartab();
+# endif
+ }
+ else
+ {
+ /*
+ * 'arabic' is reset, handle various sub-settings.
+ */
+ if (!p_tbidi)
+ {
+ /* reset rightleft mode */
+ if (curwin->w_p_rl)
+ {
+ curwin->w_p_rl = FALSE;
+ changed_window_setting();
+ }
+
+ /* 'arabicshape' isn't reset, it is a global option and
+ * another window may still need it "on". */
+ }
+
+ /* 'delcombine' isn't reset, it is a global option and another
+ * window may still want it "on". */
+
+# ifdef FEAT_KEYMAP
+ /* Revert to the default keymap */
+ curbuf->b_p_iminsert = B_IMODE_NONE;
+ curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
+# endif
+ }
+ }
+#endif
+
+ /*
+ * End of handling side effects for bool options.
+ */
+
+ options[opt_idx].flags |= P_WAS_SET;
+
+ comp_col(); /* in case 'ruler' or 'showcmd' changed */
+ if (curwin->w_curswant != MAXCOL)
+ curwin->w_set_curswant = TRUE; /* in case 'list' changed */
+ check_redraw(options[opt_idx].flags);
+
+ return NULL;
+}
+
+/*
+ * Set the value of a number option, and take care of side effects.
+ * Returns NULL for success, or an error message for an error.
+ */
+ static char_u *
+set_num_option(opt_idx, varp, value, errbuf, opt_flags)
+ int opt_idx; /* index in options[] table */
+ char_u *varp; /* pointer to the option variable */
+ long value; /* new value */
+ char_u *errbuf; /* buffer for error messages */
+ int opt_flags; /* OPT_LOCAL, OPT_GLOBAL and
+ OPT_MODELINE */
+{
+ char_u *errmsg = NULL;
+ long old_value = *(long *)varp;
+ long old_Rows = Rows; /* remember old Rows */
+ long old_Columns = Columns; /* remember old Columns */
+ long *pp = (long *)varp;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ *pp = value;
+#ifdef FEAT_EVAL
+ /* Remember where the option was set. */
+ options[opt_idx].scriptID = current_SID;
+#endif
+
+ if (curbuf->b_p_sw <= 0)
+ {
+ errmsg = e_positive;
+ curbuf->b_p_sw = curbuf->b_p_ts;
+ }
+
+ /*
+ * Number options that need some action when changed
+ */
+#ifdef FEAT_WINDOWS
+ if (pp == &p_wh || pp == &p_hh)
+ {
+ if (p_wh < 1)
+ {
+ errmsg = e_positive;
+ p_wh = 1;
+ }
+ if (p_wmh > p_wh)
+ {
+ errmsg = e_winheight;
+ p_wh = p_wmh;
+ }
+ if (p_hh < 0)
+ {
+ errmsg = e_positive;
+ p_hh = 0;
+ }
+
+ /* Change window height NOW */
+ if (lastwin != firstwin)
+ {
+ if (pp == &p_wh && curwin->w_height < p_wh)
+ win_setheight((int)p_wh);
+ if (pp == &p_hh && curbuf->b_help && curwin->w_height < p_hh)
+ win_setheight((int)p_hh);
+ }
+ }
+
+ /* 'winminheight' */
+ else if (pp == &p_wmh)
+ {
+ if (p_wmh < 0)
+ {
+ errmsg = e_positive;
+ p_wmh = 0;
+ }
+ if (p_wmh > p_wh)
+ {
+ errmsg = e_winheight;
+ p_wmh = p_wh;
+ }
+ win_setminheight();
+ }
+
+# ifdef FEAT_VERTSPLIT
+ if (pp == &p_wiw)
+ {
+ if (p_wiw < 1)
+ {
+ errmsg = e_positive;
+ p_wiw = 1;
+ }
+ if (p_wmw > p_wiw)
+ {
+ errmsg = e_winwidth;
+ p_wiw = p_wmw;
+ }
+
+ /* Change window width NOW */
+ if (lastwin != firstwin && curwin->w_width < p_wiw)
+ win_setwidth((int)p_wiw);
+ }
+
+ /* 'winminwidth' */
+ else if (pp == &p_wmw)
+ {
+ if (p_wmw < 0)
+ {
+ errmsg = e_positive;
+ p_wmw = 0;
+ }
+ if (p_wmw > p_wiw)
+ {
+ errmsg = e_winwidth;
+ p_wmw = p_wiw;
+ }
+ win_setminheight();
+ }
+# endif
+
+#endif
+
+#ifdef FEAT_WINDOWS
+ /* (re)set last window status line */
+ else if (pp == &p_ls)
+ {
+ last_status(FALSE);
+ }
+#endif
+
+#ifdef FEAT_GUI
+ else if (pp == &p_linespace)
+ {
+ if (gui.in_use && gui_mch_adjust_charsize() == OK)
+ gui_set_shellsize(FALSE, FALSE);
+ }
+#endif
+
+#ifdef FEAT_FOLDING
+ /* 'foldlevel' */
+ else if (pp == &curwin->w_p_fdl)
+ {
+ if (curwin->w_p_fdl < 0)
+ curwin->w_p_fdl = 0;
+ newFoldLevel();
+ }
+
+ /* 'foldminlevel' */
+ else if (pp == &curwin->w_p_fml)
+ {
+ foldUpdateAll(curwin);
+ }
+
+ /* 'foldnestmax' */
+ else if (pp == &curwin->w_p_fdn)
+ {
+ if (foldmethodIsSyntax(curwin) || foldmethodIsIndent(curwin))
+ foldUpdateAll(curwin);
+ }
+
+ /* 'foldcolumn' */
+ else if (pp == &curwin->w_p_fdc)
+ {
+ if (curwin->w_p_fdc < 0)
+ {
+ errmsg = e_positive;
+ curwin->w_p_fdc = 0;
+ }
+ else if (curwin->w_p_fdc > 12)
+ {
+ errmsg = e_invarg;
+ curwin->w_p_fdc = 12;
+ }
+ }
+
+ /* 'shiftwidth' or 'tabstop' */
+ else if (pp == &curbuf->b_p_sw || pp == &curbuf->b_p_ts)
+ {
+ if (foldmethodIsIndent(curwin))
+ foldUpdateAll(curwin);
+ }
+#endif /* FEAT_FOLDING */
+
+ else if (pp == &curbuf->b_p_iminsert)
+ {
+ if (curbuf->b_p_iminsert < 0 || curbuf->b_p_iminsert > B_IMODE_LAST)
+ {
+ errmsg = e_invarg;
+ curbuf->b_p_iminsert = B_IMODE_NONE;
+ }
+ p_iminsert = curbuf->b_p_iminsert;
+ if (termcap_active) /* don't do this in the alternate screen */
+ showmode();
+#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
+ /* Show/unshow value of 'keymap' in status lines. */
+ status_redraw_curbuf();
+#endif
+ }
+
+ else if (pp == &curbuf->b_p_imsearch)
+ {
+ if (curbuf->b_p_imsearch < -1 || curbuf->b_p_imsearch > B_IMODE_LAST)
+ {
+ errmsg = e_invarg;
+ curbuf->b_p_imsearch = B_IMODE_NONE;
+ }
+ p_imsearch = curbuf->b_p_imsearch;
+ }
+
+#ifdef FEAT_TITLE
+ /* if 'titlelen' has changed, redraw the title */
+ else if (pp == &p_titlelen)
+ {
+ if (p_titlelen < 0)
+ {
+ errmsg = e_positive;
+ p_titlelen = 85;
+ }
+ if (starting != NO_SCREEN && old_value != p_titlelen)
+ need_maketitle = TRUE;
+ }
+#endif
+
+ /* if p_ch changed value, change the command line height */
+ else if (pp == &p_ch)
+ {
+ if (p_ch < 1)
+ {
+ errmsg = e_positive;
+ p_ch = 1;
+ }
+
+ /* Only compute the new window layout when startup has been
+ * completed. Otherwise the frame sizes may be wrong. */
+ if (p_ch != old_value && full_screen
+#ifdef FEAT_GUI
+ && !gui.starting
+#endif
+ )
+ command_height(old_value);
+ }
+
+ /* when 'updatecount' changes from zero to non-zero, open swap files */
+ else if (pp == &p_uc)
+ {
+ if (p_uc < 0)
+ {
+ errmsg = e_positive;
+ p_uc = 100;
+ }
+ if (p_uc && !old_value)
+ ml_open_files();
+ }
+
+ /* sync undo before 'undolevels' changes */
+ else if (pp == &p_ul)
+ {
+ /* use the old value, otherwise u_sync() may not work properly */
+ p_ul = old_value;
+ u_sync();
+ p_ul = value;
+ }
+
+ /*
+ * Check the bounds for numeric options here
+ */
+ if (Rows < min_rows() && full_screen)
+ {
+ if (errbuf != NULL)
+ {
+ sprintf((char *)errbuf, _("E593: Need at least %d lines"),
+ min_rows());
+ errmsg = errbuf;
+ }
+ Rows = min_rows();
+ }
+ if (Columns < MIN_COLUMNS && full_screen)
+ {
+ if (errbuf != NULL)
+ {
+ sprintf((char *)errbuf, _("E594: Need at least %d columns"),
+ MIN_COLUMNS);
+ errmsg = errbuf;
+ }
+ Columns = MIN_COLUMNS;
+ }
+
+#ifdef DJGPP
+ /* avoid a crash by checking for a too large value of 'columns' */
+ if (old_Columns != Columns && full_screen && term_console)
+ mch_check_columns();
+#endif
+
+ /*
+ * If the screen (shell) height has been changed, assume it is the
+ * physical screenheight.
+ */
+ if (old_Rows != Rows || old_Columns != Columns)
+ {
+ /* Changing the screen size is not allowed while updating the screen. */
+ if (updating_screen)
+ *pp = old_value;
+ else if (full_screen
+#ifdef FEAT_GUI
+ && !gui.starting
+#endif
+ )
+ set_shellsize((int)Columns, (int)Rows, TRUE);
+ else
+ {
+ /* Postpone the resizing; check the size and cmdline position for
+ * messages. */
+ check_shellsize();
+ if (cmdline_row > Rows - p_ch && Rows > p_ch)
+ cmdline_row = Rows - p_ch;
+ }
+ }
+
+ if (curbuf->b_p_sts < 0)
+ {
+ errmsg = e_positive;
+ curbuf->b_p_sts = 0;
+ }
+ if (curbuf->b_p_ts <= 0)
+ {
+ errmsg = e_positive;
+ curbuf->b_p_ts = 8;
+ }
+ if (curbuf->b_p_tw < 0)
+ {
+ errmsg = e_positive;
+ curbuf->b_p_tw = 0;
+ }
+ if (p_tm < 0)
+ {
+ errmsg = e_positive;
+ p_tm = 0;
+ }
+ if ((curwin->w_p_scr <= 0
+ || (curwin->w_p_scr > curwin->w_height
+ && curwin->w_height > 0))
+ && full_screen)
+ {
+ if (pp == &(curwin->w_p_scr))
+ {
+ if (curwin->w_p_scr != 0)
+ errmsg = e_scroll;
+ win_comp_scroll(curwin);
+ }
+ /* If 'scroll' became invalid because of a side effect silently adjust
+ * it. */
+ else if (curwin->w_p_scr <= 0)
+ curwin->w_p_scr = 1;
+ else /* curwin->w_p_scr > curwin->w_height */
+ curwin->w_p_scr = curwin->w_height;
+ }
+ if (p_report < 0)
+ {
+ errmsg = e_positive;
+ p_report = 1;
+ }
+ if ((p_sj < 0 || p_sj >= Rows) && full_screen)
+ {
+ if (Rows != old_Rows) /* Rows changed, just adjust p_sj */
+ p_sj = Rows / 2;
+ else
+ {
+ errmsg = e_scroll;
+ p_sj = 1;
+ }
+ }
+ if (p_so < 0 && full_screen)
+ {
+ errmsg = e_scroll;
+ p_so = 0;
+ }
+ if (p_siso < 0 && full_screen)
+ {
+ errmsg = e_positive;
+ p_siso = 0;
+ }
+#ifdef FEAT_CMDWIN
+ if (p_cwh < 1)
+ {
+ errmsg = e_positive;
+ p_cwh = 1;
+ }
+#endif
+ if (p_ut < 0)
+ {
+ errmsg = e_positive;
+ p_ut = 2000;
+ }
+ if (p_ss < 0)
+ {
+ errmsg = e_positive;
+ p_ss = 0;
+ }
+
+ /* May set global value for local option. */
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
+ *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = *pp;
+
+ options[opt_idx].flags |= P_WAS_SET;
+
+ comp_col(); /* in case 'columns' or 'ls' changed */
+ if (curwin->w_curswant != MAXCOL)
+ curwin->w_set_curswant = TRUE; /* in case 'tabstop' changed */
+ check_redraw(options[opt_idx].flags);
+
+ return errmsg;
+}
+
+/*
+ * Called after an option changed: check if something needs to be redrawn.
+ */
+ static void
+check_redraw(flags)
+ long_u flags;
+{
+ /* Careful: P_RCLR and P_RALL are a combination of other P_ flags */
+ int clear = (flags & P_RCLR) == P_RCLR;
+ int all = ((flags & P_RALL) == P_RALL || clear);
+
+#ifdef FEAT_WINDOWS
+ if ((flags & P_RSTAT) || all) /* mark all status lines dirty */
+ status_redraw_all();
+#endif
+
+ if ((flags & P_RBUF) || (flags & P_RWIN) || all)
+ changed_window_setting();
+ if (flags & P_RBUF)
+ redraw_curbuf_later(NOT_VALID);
+ if (clear)
+ redraw_all_later(CLEAR);
+ else if (all)
+ redraw_all_later(NOT_VALID);
+}
+
+/*
+ * Find index for option 'arg'.
+ * Return -1 if not found.
+ */
+ static int
+findoption(arg)
+ char_u *arg;
+{
+ int opt_idx;
+ char *s, *p;
+ static short quick_tab[27] = {0, 0}; /* quick access table */
+ int is_term_opt;
+
+ /*
+ * For first call: Initialize the quick-access table.
+ * It contains the index for the first option that starts with a certain
+ * letter. There are 26 letters, plus the first "t_" option.
+ */
+ if (quick_tab[1] == 0)
+ {
+ p = options[0].fullname;
+ for (opt_idx = 1; (s = options[opt_idx].fullname) != NULL; opt_idx++)
+ {
+ if (s[0] != p[0])
+ {
+ if (s[0] == 't' && s[1] == '_')
+ quick_tab[26] = opt_idx;
+ else
+ quick_tab[CharOrdLow(s[0])] = opt_idx;
+ }
+ p = s;
+ }
+ }
+
+ /*
+ * Check for name starting with an illegal character.
+ */
+#ifdef EBCDIC
+ if (!islower(arg[0]))
+#else
+ if (arg[0] < 'a' || arg[0] > 'z')
+#endif
+ return -1;
+
+ is_term_opt = (arg[0] == 't' && arg[1] == '_');
+ if (is_term_opt)
+ opt_idx = quick_tab[26];
+ else
+ opt_idx = quick_tab[CharOrdLow(arg[0])];
+ for ( ; (s = options[opt_idx].fullname) != NULL; opt_idx++)
+ {
+ if (STRCMP(arg, s) == 0) /* match full name */
+ break;
+ }
+ if (s == NULL && !is_term_opt)
+ {
+ opt_idx = quick_tab[CharOrdLow(arg[0])];
+ for ( ; options[opt_idx].fullname != NULL; opt_idx++)
+ {
+ s = options[opt_idx].shortname;
+ if (s != NULL && STRCMP(arg, s) == 0) /* match short name */
+ break;
+ s = NULL;
+ }
+ }
+ if (s == NULL)
+ opt_idx = -1;
+ return opt_idx;
+}
+
+#if defined(FEAT_EVAL) || defined(FEAT_TCL)
+/*
+ * Get the value for an option.
+ *
+ * Returns:
+ * Number or Toggle option: 1, *numval gets value.
+ * String option: 0, *stringval gets allocated string.
+ * Hidden Number or Toggle option: -1.
+ * hidden String option: -2.
+ * unknown option: -3.
+ */
+ int
+get_option_value(name, numval, stringval, opt_flags)
+ char_u *name;
+ long *numval;
+ char_u **stringval; /* NULL when only checking existance */
+ int opt_flags;
+{
+ int opt_idx;
+ char_u *varp;
+
+ opt_idx = findoption(name);
+ if (opt_idx < 0) /* unknown option */
+ return -3;
+
+ varp = get_varp_scope(&(options[opt_idx]), opt_flags);
+
+ if (options[opt_idx].flags & P_STRING)
+ {
+ if (varp == NULL) /* hidden option */
+ return -2;
+ if (stringval != NULL)
+ {
+#ifdef FEAT_CRYPT
+ /* never return the value of the crypt key */
+ if ((char_u **)varp == &curbuf->b_p_key)
+ *stringval = vim_strsave((char_u *)"*****");
+ else
+#endif
+ *stringval = vim_strsave(*(char_u **)(varp));
+ }
+ return 0;
+ }
+
+ if (varp == NULL) /* hidden option */
+ return -1;
+ if (options[opt_idx].flags & P_NUM)
+ *numval = *(long *)varp;
+ else
+ {
+ /* Special case: 'modified' is b_changed, but we also want to consider
+ * it set when 'ff' or 'fenc' changed. */
+ if ((int *)varp == &curbuf->b_changed)
+ *numval = curbufIsChanged();
+ else
+ *numval = *(int *)varp;
+ }
+ return 1;
+}
+#endif
+
+/*
+ * Set the value of option "name".
+ * Use "string" for string options, use "number" for other options.
+ */
+ void
+set_option_value(name, number, string, opt_flags)
+ char_u *name;
+ long number;
+ char_u *string;
+ int opt_flags; /* OPT_LOCAL or 0 (both) */
+{
+ int opt_idx;
+ char_u *varp;
+ int flags;
+
+ opt_idx = findoption(name);
+ if (opt_idx == -1)
+ EMSG2(_("E355: Unknown option: %s"), name);
+ else
+ {
+ flags = options[opt_idx].flags;
+#ifdef HAVE_SANDBOX
+ /* Disallow changing some options in the sandbox */
+ if (sandbox > 0 && (flags & P_SECURE))
+ EMSG(_(e_sandbox));
+ else
+#endif
+ if (flags & P_STRING)
+ set_string_option(opt_idx, string, opt_flags);
+ else
+ {
+ varp = get_varp(&options[opt_idx]);
+ if (varp != NULL) /* hidden option is not changed */
+ {
+ if (flags & P_NUM)
+ (void)set_num_option(opt_idx, varp, number, NULL, opt_flags);
+ else
+ (void)set_bool_option(opt_idx, varp, (int)number, opt_flags);
+ }
+ }
+ }
+}
+
+/*
+ * Get the terminal code for a terminal option.
+ * Returns NULL when not found.
+ */
+ char_u *
+get_term_code(tname)
+ char_u *tname;
+{
+ int opt_idx;
+ char_u *varp;
+
+ if (tname[0] != 't' || tname[1] != '_' ||
+ tname[2] == NUL || tname[3] == NUL)
+ return NULL;
+ if ((opt_idx = findoption(tname)) >= 0)
+ {
+ varp = get_varp(&(options[opt_idx]));
+ if (varp != NULL)
+ varp = *(char_u **)(varp);
+ return varp;
+ }
+ return find_termcode(tname + 2);
+}
+
+ char_u *
+get_highlight_default()
+{
+ int i;
+
+ i = findoption((char_u *)"hl");
+ if (i >= 0)
+ return options[i].def_val[VI_DEFAULT];
+ return (char_u *)NULL;
+}
+
+/*
+ * Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number.
+ */
+ static int
+find_key_option(arg)
+ char_u *arg;
+{
+ int key;
+ int modifiers;
+
+ /*
+ * Don't use get_special_key_code() for t_xx, we don't want it to call
+ * add_termcap_entry().
+ */
+ if (arg[0] == 't' && arg[1] == '_' && arg[2] && arg[3])
+ key = TERMCAP2KEY(arg[2], arg[3]);
+ else
+ {
+ --arg; /* put arg at the '<' */
+ modifiers = 0;
+ key = find_special_key(&arg, &modifiers, TRUE);
+ if (modifiers) /* can't handle modifiers here */
+ key = 0;
+ }
+ return key;
+}
+
+/*
+ * if 'all' == 0: show changed options
+ * if 'all' == 1: show all normal options
+ * if 'all' == 2: show all terminal options
+ */
+ static void
+showoptions(all, opt_flags)
+ int all;
+ int opt_flags; /* OPT_LOCAL and/or OPT_GLOBAL */
+{
+ struct vimoption *p;
+ int col;
+ int isterm;
+ char_u *varp;
+ struct vimoption **items;
+ int item_count;
+ int run;
+ int row, rows;
+ int cols;
+ int i;
+ int len;
+
+#define INC 20
+#define GAP 3
+
+ items = (struct vimoption **)alloc((unsigned)(sizeof(struct vimoption *) *
+ PARAM_COUNT));
+ if (items == NULL)
+ return;
+
+ /* Highlight title */
+ if (all == 2)
+ MSG_PUTS_TITLE(_("\n--- Terminal codes ---"));
+ else if (opt_flags & OPT_GLOBAL)
+ MSG_PUTS_TITLE(_("\n--- Global option values ---"));
+ else if (opt_flags & OPT_LOCAL)
+ MSG_PUTS_TITLE(_("\n--- Local option values ---"));
+ else
+ MSG_PUTS_TITLE(_("\n--- Options ---"));
+
+ /*
+ * do the loop two times:
+ * 1. display the short items
+ * 2. display the long items (only strings and numbers)
+ */
+ for (run = 1; run <= 2 && !got_int; ++run)
+ {
+ /*
+ * collect the items in items[]
+ */
+ item_count = 0;
+ for (p = &options[0]; p->fullname != NULL; p++)
+ {
+ varp = NULL;
+ isterm = istermoption(p);
+ if (opt_flags != 0)
+ {
+ if (p->indir != PV_NONE && !isterm)
+ varp = get_varp_scope(p, opt_flags);
+ }
+ else
+ varp = get_varp(p);
+ if (varp != NULL
+ && ((all == 2 && isterm)
+ || (all == 1 && !isterm)
+ || (all == 0 && !optval_default(p, varp))))
+ {
+ if (p->flags & P_BOOL)
+ len = 1; /* a toggle option fits always */
+ else
+ {
+ option_value2string(p, opt_flags);
+ len = (int)STRLEN(p->fullname) + vim_strsize(NameBuff) + 1;
+ }
+ if ((len <= INC - GAP && run == 1) ||
+ (len > INC - GAP && run == 2))
+ items[item_count++] = p;
+ }
+ }
+
+ /*
+ * display the items
+ */
+ if (run == 1)
+ {
+ cols = (Columns + GAP - 3) / INC;
+ if (cols == 0)
+ cols = 1;
+ rows = (item_count + cols - 1) / cols;
+ }
+ else /* run == 2 */
+ rows = item_count;
+ for (row = 0; row < rows && !got_int; ++row)
+ {
+ msg_putchar('\n'); /* go to next line */
+ if (got_int) /* 'q' typed in more */
+ break;
+ col = 0;
+ for (i = row; i < item_count; i += rows)
+ {
+ msg_col = col; /* make columns */
+ showoneopt(items[i], opt_flags);
+ col += INC;
+ }
+ out_flush();
+ ui_breakcheck();
+ }
+ }
+ vim_free(items);
+}
+
+/*
+ * Return TRUE if option "p" has its default value.
+ */
+ static int
+optval_default(p, varp)
+ struct vimoption *p;
+ char_u *varp;
+{
+ int dvi;
+
+ if (varp == NULL)
+ return TRUE; /* hidden option is always at default */
+ dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT;
+ if (p->flags & P_NUM)
+ return (*(long *)varp == (long)p->def_val[dvi]);
+ if (p->flags & P_BOOL)
+ /* the cast to long is required for Manx C */
+ return (*(int *)varp == (int)(long)p->def_val[dvi]);
+ /* P_STRING */
+ return (STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0);
+}
+
+/*
+ * showoneopt: show the value of one option
+ * must not be called with a hidden option!
+ */
+ static void
+showoneopt(p, opt_flags)
+ struct vimoption *p;
+ int opt_flags; /* OPT_LOCAL or OPT_GLOBAL */
+{
+ char_u *varp;
+
+ varp = get_varp_scope(p, opt_flags);
+
+ /* for 'modified' we also need to check if 'ff' or 'fenc' changed. */
+ if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed
+ ? !curbufIsChanged() : !*(int *)varp))
+ MSG_PUTS("no");
+ else if ((p->flags & P_BOOL) && *(int *)varp < 0)
+ MSG_PUTS("--");
+ else
+ MSG_PUTS(" ");
+ MSG_PUTS(p->fullname);
+ if (!(p->flags & P_BOOL))
+ {
+ msg_putchar('=');
+ /* put value string in NameBuff */
+ option_value2string(p, opt_flags);
+ msg_outtrans(NameBuff);
+ }
+}
+
+/*
+ * Write modified options as ":set" commands to a file.
+ *
+ * There are three values for "opt_flags":
+ * OPT_GLOBAL: Write global option values and fresh values of
+ * buffer-local options (used for start of a session
+ * file).
+ * OPT_GLOBAL + OPT_LOCAL: Idem, add fresh values of window-local options for
+ * curwin (used for a vimrc file).
+ * OPT_LOCAL: Write buffer-local option values for curbuf, fresh
+ * and local values for window-local options of
+ * curwin. Local values are also written when at the
+ * default value, because a modeline or autocommand
+ * may have set them when doing ":edit file" and the
+ * user has set them back at the default or fresh
+ * value.
+ * When "local_only" is TRUE, don't write fresh
+ * values, only local values (for ":mkview").
+ * (fresh value = value used for a new buffer or window for a local option).
+ *
+ * Return FAIL on error, OK otherwise.
+ */
+ int
+makeset(fd, opt_flags, local_only)
+ FILE *fd;
+ int opt_flags;
+ int local_only;
+{
+ struct vimoption *p;
+ char_u *varp; /* currently used value */
+ char_u *varp_fresh; /* local value */
+ char_u *varp_local = NULL; /* fresh value */
+ char *cmd;
+ int round;
+
+ /*
+ * The options that don't have a default (terminal name, columns, lines)
+ * are never written. Terminal options are also not written.
+ */
+ for (p = &options[0]; !istermoption(p); p++)
+ if (!(p->flags & P_NO_MKRC) && !istermoption(p))
+ {
+ /* skip global option when only doing locals */
+ if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL))
+ continue;
+
+ /* Do not store options like 'bufhidden' and 'syntax' in a vimrc
+ * file, they are always buffer-specific. */
+ if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB))
+ continue;
+
+ /* Global values are only written when not at the default value. */
+ varp = get_varp_scope(p, opt_flags);
+ if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp))
+ continue;
+
+ round = 2;
+ if (p->indir != PV_NONE)
+ {
+ if (p->var == VAR_WIN)
+ {
+ /* skip window-local option when only doing globals */
+ if (!(opt_flags & OPT_LOCAL))
+ continue;
+ /* When fresh value of window-local option is not at the
+ * default, need to write it too. */
+ if (!(opt_flags & OPT_GLOBAL) && !local_only)
+ {
+ varp_fresh = get_varp_scope(p, OPT_GLOBAL);
+ if (!optval_default(p, varp_fresh))
+ {
+ round = 1;
+ varp_local = varp;
+ varp = varp_fresh;
+ }
+ }
+ }
+ }
+
+ /* Round 1: fresh value for window-local options.
+ * Round 2: other values */
+ for ( ; round <= 2; varp = varp_local, ++round)
+ {
+ if (round == 1 || (opt_flags & OPT_GLOBAL))
+ cmd = "set";
+ else
+ cmd = "setlocal";
+
+ if (p->flags & P_BOOL)
+ {
+ if (put_setbool(fd, cmd, p->fullname, *(int *)varp) == FAIL)
+ return FAIL;
+ }
+ else if (p->flags & P_NUM)
+ {
+ if (put_setnum(fd, cmd, p->fullname, (long *)varp) == FAIL)
+ return FAIL;
+ }
+ else /* P_STRING */
+ {
+ /* Don't set 'syntax' and 'filetype' again if the value is
+ * already right, avoids reloading the syntax file. */
+ if (p->indir == PV_SYN || p->indir == PV_FT)
+ {
+ if (fprintf(fd, "if &%s != '%s'", p->fullname,
+ *(char_u **)(varp)) < 0
+ || put_eol(fd) < 0)
+ return FAIL;
+ }
+ if (put_setstring(fd, cmd, p->fullname, (char_u **)varp,
+ (p->flags & P_EXPAND) != 0) == FAIL)
+ return FAIL;
+ if (p->indir == PV_SYN || p->indir == PV_FT)
+ {
+ if (put_line(fd, "endif") == FAIL)
+ return FAIL;
+ }
+ }
+ }
+ }
+ return OK;
+}
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+/*
+ * Generate set commands for the local fold options only. Used when
+ * 'sessionoptions' or 'viewoptions' contains "folds" but not "options".
+ */
+ int
+makefoldset(fd)
+ FILE *fd;
+{
+ if (put_setstring(fd, "setlocal", "fdm", &curwin->w_p_fdm, FALSE) == FAIL
+# ifdef FEAT_EVAL
+ || put_setstring(fd, "setlocal", "fde", &curwin->w_p_fde, FALSE)
+ == FAIL
+# endif
+ || put_setstring(fd, "setlocal", "fmr", &curwin->w_p_fmr, FALSE)
+ == FAIL
+ || put_setstring(fd, "setlocal", "fdi", &curwin->w_p_fdi, FALSE)
+ == FAIL
+ || put_setnum(fd, "setlocal", "fdl", &curwin->w_p_fdl) == FAIL
+ || put_setnum(fd, "setlocal", "fml", &curwin->w_p_fml) == FAIL
+ || put_setnum(fd, "setlocal", "fdn", &curwin->w_p_fdn) == FAIL
+ || put_setbool(fd, "setlocal", "fen", curwin->w_p_fen) == FAIL
+ )
+ return FAIL;
+
+ return OK;
+}
+#endif
+
+ static int
+put_setstring(fd, cmd, name, valuep, expand)
+ FILE *fd;
+ char *cmd;
+ char *name;
+ char_u **valuep;
+ int expand;
+{
+ char_u *s;
+ char_u buf[MAXPATHL];
+
+ if (fprintf(fd, "%s %s=", cmd, name) < 0)
+ return FAIL;
+ if (*valuep != NULL)
+ {
+ /* Output 'pastetoggle' as key names. For other
+ * options some characters have to be escaped with
+ * CTRL-V or backslash */
+ if (valuep == &p_pt)
+ {
+ s = *valuep;
+ while (*s != NUL)
+ if (fputs((char *)str2special(&s, FALSE), fd) < 0)
+ return FAIL;
+ }
+ else if (expand)
+ {
+ home_replace(NULL, *valuep, buf, MAXPATHL, FALSE);
+ if (put_escstr(fd, buf, 2) == FAIL)
+ return FAIL;
+ }
+ else if (put_escstr(fd, *valuep, 2) == FAIL)
+ return FAIL;
+ }
+ if (put_eol(fd) < 0)
+ return FAIL;
+ return OK;
+}
+
+ static int
+put_setnum(fd, cmd, name, valuep)
+ FILE *fd;
+ char *cmd;
+ char *name;
+ long *valuep;
+{
+ long wc;
+
+ if (fprintf(fd, "%s %s=", cmd, name) < 0)
+ return FAIL;
+ if (wc_use_keyname((char_u *)valuep, &wc))
+ {
+ /* print 'wildchar' and 'wildcharm' as a key name */
+ if (fputs((char *)get_special_key_name((int)wc, 0), fd) < 0)
+ return FAIL;
+ }
+ else if (fprintf(fd, "%ld", *valuep) < 0)
+ return FAIL;
+ if (put_eol(fd) < 0)
+ return FAIL;
+ return OK;
+}
+
+ static int
+put_setbool(fd, cmd, name, value)
+ FILE *fd;
+ char *cmd;
+ char *name;
+ int value;
+{
+ if (fprintf(fd, "%s %s%s", cmd, value ? "" : "no", name) < 0
+ || put_eol(fd) < 0)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Clear all the terminal options.
+ * If the option has been allocated, free the memory.
+ * Terminal options are never hidden or indirect.
+ */
+ void
+clear_termoptions()
+{
+ struct vimoption *p;
+
+ /*
+ * Reset a few things before clearing the old options. This may cause
+ * outputting a few things that the terminal doesn't understand, but the
+ * screen will be cleared later, so this is OK.
+ */
+#ifdef FEAT_MOUSE_TTY
+ mch_setmouse(FALSE); /* switch mouse off */
+#endif
+#ifdef FEAT_TITLE
+ mch_restore_title(3); /* restore window titles */
+#endif
+#if defined(FEAT_XCLIPBOARD) && defined(FEAT_GUI)
+ /* When starting the GUI close the display opened for the clipboard.
+ * After restoring the title, because that will need the display. */
+ if (gui.starting)
+ clear_xterm_clip();
+#endif
+#ifdef WIN3264
+ /*
+ * Check if this is allowed now.
+ */
+ if (can_end_termcap_mode(FALSE) == TRUE)
+#endif
+ stoptermcap(); /* stop termcap mode */
+
+ for (p = &options[0]; p->fullname != NULL; p++)
+ if (istermoption(p))
+ {
+ if (p->flags & P_ALLOCED)
+ free_string_option(*(char_u **)(p->var));
+ if (p->flags & P_DEF_ALLOCED)
+ free_string_option(p->def_val[VI_DEFAULT]);
+ *(char_u **)(p->var) = empty_option;
+ p->def_val[VI_DEFAULT] = empty_option;
+ p->flags &= ~(P_ALLOCED|P_DEF_ALLOCED);
+ }
+ clear_termcodes();
+}
+
+/*
+ * Set the terminal option defaults to the current value.
+ * Used after setting the terminal name.
+ */
+ void
+set_term_defaults()
+{
+ struct vimoption *p;
+
+ for (p = &options[0]; p->fullname != NULL; p++)
+ {
+ if (istermoption(p) && p->def_val[VI_DEFAULT] != *(char_u **)(p->var))
+ {
+ if (p->flags & P_DEF_ALLOCED)
+ {
+ free_string_option(p->def_val[VI_DEFAULT]);
+ p->flags &= ~P_DEF_ALLOCED;
+ }
+ p->def_val[VI_DEFAULT] = *(char_u **)(p->var);
+ if (p->flags & P_ALLOCED)
+ {
+ p->flags |= P_DEF_ALLOCED;
+ p->flags &= ~P_ALLOCED; /* don't free the value now */
+ }
+ }
+ }
+}
+
+/*
+ * return TRUE if 'p' starts with 't_'
+ */
+ static int
+istermoption(p)
+ struct vimoption *p;
+{
+ return (p->fullname[0] == 't' && p->fullname[1] == '_');
+}
+
+/*
+ * Compute columns for ruler and shown command. 'sc_col' is also used to
+ * decide what the maximum length of a message on the status line can be.
+ * If there is a status line for the last window, 'sc_col' is independent
+ * of 'ru_col'.
+ */
+
+#define COL_RULER 17 /* columns needed by standard ruler */
+
+ void
+comp_col()
+{
+#if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS)
+ int last_has_status = (p_ls == 2 || (p_ls == 1 && firstwin != lastwin));
+
+ sc_col = 0;
+ ru_col = 0;
+ if (p_ru)
+ {
+#ifdef FEAT_STL_OPT
+ ru_col = (ru_wid ? ru_wid : COL_RULER) + 1;
+#else
+ ru_col = COL_RULER + 1;
+#endif
+ /* no last status line, adjust sc_col */
+ if (!last_has_status)
+ sc_col = ru_col;
+ }
+ if (p_sc)
+ {
+ sc_col += SHOWCMD_COLS;
+ if (!p_ru || last_has_status) /* no need for separating space */
+ ++sc_col;
+ }
+ sc_col = Columns - sc_col;
+ ru_col = Columns - ru_col;
+ if (sc_col <= 0) /* screen too narrow, will become a mess */
+ sc_col = 1;
+ if (ru_col <= 0)
+ ru_col = 1;
+#else
+ sc_col = Columns;
+ ru_col = Columns;
+#endif
+}
+
+/*
+ * Get pointer to option variable, depending on local or global scope.
+ */
+ static char_u *
+get_varp_scope(p, opt_flags)
+ struct vimoption *p;
+ int opt_flags;
+{
+ if ((opt_flags & OPT_GLOBAL) && p->indir != PV_NONE)
+ {
+ if (p->var == VAR_WIN)
+ return (char_u *)GLOBAL_WO(get_varp(p));
+ return p->var;
+ }
+ if ((opt_flags & OPT_LOCAL) && (int)p->indir >= PV_BOTH)
+ {
+ switch ((int)p->indir)
+ {
+#ifdef FEAT_QUICKFIX
+ case OPT_BOTH(PV_GP): return (char_u *)&(curbuf->b_p_gp);
+ case OPT_BOTH(PV_MP): return (char_u *)&(curbuf->b_p_mp);
+ case OPT_BOTH(PV_EFM): return (char_u *)&(curbuf->b_p_efm);
+#endif
+ case OPT_BOTH(PV_EP): return (char_u *)&(curbuf->b_p_ep);
+ case OPT_BOTH(PV_KP): return (char_u *)&(curbuf->b_p_kp);
+ case OPT_BOTH(PV_PATH): return (char_u *)&(curbuf->b_p_path);
+ case OPT_BOTH(PV_AR): return (char_u *)&(curbuf->b_p_ar);
+ case OPT_BOTH(PV_TAGS): return (char_u *)&(curbuf->b_p_tags);
+#ifdef FEAT_FIND_ID
+ case OPT_BOTH(PV_DEF): return (char_u *)&(curbuf->b_p_def);
+ case OPT_BOTH(PV_INC): return (char_u *)&(curbuf->b_p_inc);
+#endif
+#ifdef FEAT_INS_EXPAND
+ case OPT_BOTH(PV_DICT): return (char_u *)&(curbuf->b_p_dict);
+ case OPT_BOTH(PV_TSR): return (char_u *)&(curbuf->b_p_tsr);
+#endif
+ }
+ return NULL; /* "cannot happen" */
+ }
+ return get_varp(p);
+}
+
+/*
+ * Get pointer to option variable.
+ */
+ static char_u *
+get_varp(p)
+ struct vimoption *p;
+{
+ /* hidden option, always return NULL */
+ if (p->var == NULL)
+ return NULL;
+
+ switch ((int)p->indir)
+ {
+ case PV_NONE: return p->var;
+
+ /* global option with local value: use local value if it's been set */
+ case OPT_BOTH(PV_EP): return *curbuf->b_p_ep != NUL
+ ? (char_u *)&curbuf->b_p_ep : p->var;
+ case OPT_BOTH(PV_KP): return *curbuf->b_p_kp != NUL
+ ? (char_u *)&curbuf->b_p_kp : p->var;
+ case OPT_BOTH(PV_PATH): return *curbuf->b_p_path != NUL
+ ? (char_u *)&(curbuf->b_p_path) : p->var;
+ case OPT_BOTH(PV_AR): return curbuf->b_p_ar >= 0
+ ? (char_u *)&(curbuf->b_p_ar) : p->var;
+ case OPT_BOTH(PV_TAGS): return *curbuf->b_p_tags != NUL
+ ? (char_u *)&(curbuf->b_p_tags) : p->var;
+#ifdef FEAT_FIND_ID
+ case OPT_BOTH(PV_DEF): return *curbuf->b_p_def != NUL
+ ? (char_u *)&(curbuf->b_p_def) : p->var;
+ case OPT_BOTH(PV_INC): return *curbuf->b_p_inc != NUL
+ ? (char_u *)&(curbuf->b_p_inc) : p->var;
+#endif
+#ifdef FEAT_INS_EXPAND
+ case OPT_BOTH(PV_DICT): return *curbuf->b_p_dict != NUL
+ ? (char_u *)&(curbuf->b_p_dict) : p->var;
+ case OPT_BOTH(PV_TSR): return *curbuf->b_p_tsr != NUL
+ ? (char_u *)&(curbuf->b_p_tsr) : p->var;
+#endif
+#ifdef FEAT_QUICKFIX
+ case OPT_BOTH(PV_GP): return *curbuf->b_p_gp != NUL
+ ? (char_u *)&(curbuf->b_p_gp) : p->var;
+ case OPT_BOTH(PV_MP): return *curbuf->b_p_mp != NUL
+ ? (char_u *)&(curbuf->b_p_mp) : p->var;
+ case OPT_BOTH(PV_EFM): return *curbuf->b_p_efm != NUL
+ ? (char_u *)&(curbuf->b_p_efm) : p->var;
+#endif
+
+#ifdef FEAT_ARABIC
+ case PV_ARAB: return (char_u *)&(curwin->w_p_arab);
+#endif
+ case PV_LIST: return (char_u *)&(curwin->w_p_list);
+#ifdef FEAT_DIFF
+ case PV_DIFF: return (char_u *)&(curwin->w_p_diff);
+#endif
+#ifdef FEAT_FOLDING
+ case PV_FDC: return (char_u *)&(curwin->w_p_fdc);
+ case PV_FEN: return (char_u *)&(curwin->w_p_fen);
+ case PV_FDI: return (char_u *)&(curwin->w_p_fdi);
+ case PV_FDL: return (char_u *)&(curwin->w_p_fdl);
+ case PV_FDM: return (char_u *)&(curwin->w_p_fdm);
+ case PV_FML: return (char_u *)&(curwin->w_p_fml);
+ case PV_FDN: return (char_u *)&(curwin->w_p_fdn);
+# ifdef FEAT_EVAL
+ case PV_FDE: return (char_u *)&(curwin->w_p_fde);
+ case PV_FDT: return (char_u *)&(curwin->w_p_fdt);
+# endif
+ case PV_FMR: return (char_u *)&(curwin->w_p_fmr);
+#endif
+ case PV_NU: return (char_u *)&(curwin->w_p_nu);
+#if defined(FEAT_WINDOWS)
+ case PV_WFH: return (char_u *)&(curwin->w_p_wfh);
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ case PV_PVW: return (char_u *)&(curwin->w_p_pvw);
+#endif
+#ifdef FEAT_RIGHTLEFT
+ case PV_RL: return (char_u *)&(curwin->w_p_rl);
+ case PV_RLC: return (char_u *)&(curwin->w_p_rlc);
+#endif
+ case PV_SCROLL: return (char_u *)&(curwin->w_p_scr);
+ case PV_WRAP: return (char_u *)&(curwin->w_p_wrap);
+#ifdef FEAT_LINEBREAK
+ case PV_LBR: return (char_u *)&(curwin->w_p_lbr);
+#endif
+#ifdef FEAT_SCROLLBIND
+ case PV_SCBIND: return (char_u *)&(curwin->w_p_scb);
+#endif
+
+ case PV_AI: return (char_u *)&(curbuf->b_p_ai);
+ case PV_BIN: return (char_u *)&(curbuf->b_p_bin);
+#ifdef FEAT_MBYTE
+ case PV_BOMB: return (char_u *)&(curbuf->b_p_bomb);
+#endif
+#if defined(FEAT_QUICKFIX)
+ case PV_BH: return (char_u *)&(curbuf->b_p_bh);
+ case PV_BT: return (char_u *)&(curbuf->b_p_bt);
+#endif
+ case PV_BL: return (char_u *)&(curbuf->b_p_bl);
+ case PV_CI: return (char_u *)&(curbuf->b_p_ci);
+#ifdef FEAT_CINDENT
+ case PV_CIN: return (char_u *)&(curbuf->b_p_cin);
+ case PV_CINK: return (char_u *)&(curbuf->b_p_cink);
+ case PV_CINO: return (char_u *)&(curbuf->b_p_cino);
+#endif
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ case PV_CINW: return (char_u *)&(curbuf->b_p_cinw);
+#endif
+#ifdef FEAT_COMMENTS
+ case PV_COM: return (char_u *)&(curbuf->b_p_com);
+#endif
+#ifdef FEAT_FOLDING
+ case PV_CMS: return (char_u *)&(curbuf->b_p_cms);
+#endif
+#ifdef FEAT_INS_EXPAND
+ case PV_CPT: return (char_u *)&(curbuf->b_p_cpt);
+#endif
+ case PV_EOL: return (char_u *)&(curbuf->b_p_eol);
+ case PV_ET: return (char_u *)&(curbuf->b_p_et);
+#ifdef FEAT_MBYTE
+ case PV_FENC: return (char_u *)&(curbuf->b_p_fenc);
+#endif
+ case PV_FF: return (char_u *)&(curbuf->b_p_ff);
+#ifdef FEAT_AUTOCMD
+ case PV_FT: return (char_u *)&(curbuf->b_p_ft);
+#endif
+ case PV_FO: return (char_u *)&(curbuf->b_p_fo);
+ case PV_IMI: return (char_u *)&(curbuf->b_p_iminsert);
+ case PV_IMS: return (char_u *)&(curbuf->b_p_imsearch);
+ case PV_INF: return (char_u *)&(curbuf->b_p_inf);
+ case PV_ISK: return (char_u *)&(curbuf->b_p_isk);
+#ifdef FEAT_FIND_ID
+# ifdef FEAT_EVAL
+ case PV_INEX: return (char_u *)&(curbuf->b_p_inex);
+# endif
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ case PV_INDE: return (char_u *)&(curbuf->b_p_inde);
+ case PV_INDK: return (char_u *)&(curbuf->b_p_indk);
+#endif
+#ifdef FEAT_CRYPT
+ case PV_KEY: return (char_u *)&(curbuf->b_p_key);
+#endif
+#ifdef FEAT_LISP
+ case PV_LISP: return (char_u *)&(curbuf->b_p_lisp);
+#endif
+ case PV_ML: return (char_u *)&(curbuf->b_p_ml);
+ case PV_MPS: return (char_u *)&(curbuf->b_p_mps);
+ case PV_MA: return (char_u *)&(curbuf->b_p_ma);
+ case PV_MOD: return (char_u *)&(curbuf->b_changed);
+ case PV_NF: return (char_u *)&(curbuf->b_p_nf);
+#ifdef FEAT_OSFILETYPE
+ case PV_OFT: return (char_u *)&(curbuf->b_p_oft);
+#endif
+ case PV_PI: return (char_u *)&(curbuf->b_p_pi);
+ case PV_RO: return (char_u *)&(curbuf->b_p_ro);
+#ifdef FEAT_SMARTINDENT
+ case PV_SI: return (char_u *)&(curbuf->b_p_si);
+#endif
+#ifndef SHORT_FNAME
+ case PV_SN: return (char_u *)&(curbuf->b_p_sn);
+#endif
+ case PV_STS: return (char_u *)&(curbuf->b_p_sts);
+#ifdef FEAT_SEARCHPATH
+ case PV_SUA: return (char_u *)&(curbuf->b_p_sua);
+#endif
+ case PV_SWF: return (char_u *)&(curbuf->b_p_swf);
+#ifdef FEAT_SYN_HL
+ case PV_SYN: return (char_u *)&(curbuf->b_p_syn);
+#endif
+ case PV_SW: return (char_u *)&(curbuf->b_p_sw);
+ case PV_TS: return (char_u *)&(curbuf->b_p_ts);
+ case PV_TW: return (char_u *)&(curbuf->b_p_tw);
+ case PV_TX: return (char_u *)&(curbuf->b_p_tx);
+ case PV_WM: return (char_u *)&(curbuf->b_p_wm);
+#ifdef FEAT_KEYMAP
+ case PV_KMAP: return (char_u *)&(curbuf->b_p_keymap);
+#endif
+ default: EMSG(_("E356: get_varp ERROR"));
+ }
+ /* always return a valid pointer to avoid a crash! */
+ return (char_u *)&(curbuf->b_p_wm);
+}
+
+/*
+ * Get the value of 'equalprg', either the buffer-local one or the global one.
+ */
+ char_u *
+get_equalprg()
+{
+ if (*curbuf->b_p_ep == NUL)
+ return p_ep;
+ return curbuf->b_p_ep;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Copy options from one window to another.
+ * Used when splitting a window.
+ */
+ void
+win_copy_options(wp_from, wp_to)
+ win_T *wp_from;
+ win_T *wp_to;
+{
+ copy_winopt(&wp_from->w_onebuf_opt, &wp_to->w_onebuf_opt);
+ copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
+# ifdef FEAT_RIGHTLEFT
+# ifdef FEAT_FKMAP
+ /* Is this right? */
+ wp_to->w_farsi = wp_from->w_farsi;
+# endif
+# endif
+}
+#endif
+
+/*
+ * Copy the options from one winopt_T to another.
+ * Doesn't free the old option values in "to", use clear_winopt() for that.
+ * The 'scroll' option is not copied, because it depends on the window height.
+ * The 'previewwindow' option is reset, there can be only one preview window.
+ */
+ void
+copy_winopt(from, to)
+ winopt_T *from;
+ winopt_T *to;
+{
+#ifdef FEAT_ARABIC
+ to->wo_arab = from->wo_arab;
+#endif
+ to->wo_list = from->wo_list;
+ to->wo_nu = from->wo_nu;
+#ifdef FEAT_RIGHTLEFT
+ to->wo_rl = from->wo_rl;
+ to->wo_rlc = vim_strsave(from->wo_rlc);
+#endif
+ to->wo_wrap = from->wo_wrap;
+#ifdef FEAT_LINEBREAK
+ to->wo_lbr = from->wo_lbr;
+#endif
+#ifdef FEAT_SCROLLBIND
+ to->wo_scb = from->wo_scb;
+#endif
+#ifdef FEAT_DIFF
+ to->wo_diff = from->wo_diff;
+#endif
+#ifdef FEAT_FOLDING
+ to->wo_fdc = from->wo_fdc;
+ to->wo_fen = from->wo_fen;
+ to->wo_fdi = vim_strsave(from->wo_fdi);
+ to->wo_fml = from->wo_fml;
+ to->wo_fdl = from->wo_fdl;
+ to->wo_fdm = vim_strsave(from->wo_fdm);
+ to->wo_fdn = from->wo_fdn;
+# ifdef FEAT_EVAL
+ to->wo_fde = vim_strsave(from->wo_fde);
+ to->wo_fdt = vim_strsave(from->wo_fdt);
+# endif
+ to->wo_fmr = vim_strsave(from->wo_fmr);
+#endif
+ check_winopt(to); /* don't want NULL pointers */
+}
+
+/*
+ * Check string options in a window for a NULL value.
+ */
+ void
+check_win_options(win)
+ win_T *win;
+{
+ check_winopt(&win->w_onebuf_opt);
+ check_winopt(&win->w_allbuf_opt);
+}
+
+/*
+ * Check for NULL pointers in a winopt_T and replace them with empty_option.
+ */
+/*ARGSUSED*/
+ void
+check_winopt(wop)
+ winopt_T *wop;
+{
+#ifdef FEAT_FOLDING
+ check_string_option(&wop->wo_fdi);
+ check_string_option(&wop->wo_fdm);
+# ifdef FEAT_EVAL
+ check_string_option(&wop->wo_fde);
+ check_string_option(&wop->wo_fdt);
+# endif
+ check_string_option(&wop->wo_fmr);
+#endif
+#ifdef FEAT_RIGHTLEFT
+ check_string_option(&wop->wo_rlc);
+#endif
+}
+
+/*
+ * Free the allocated memory inside a winopt_T.
+ */
+/*ARGSUSED*/
+ void
+clear_winopt(wop)
+ winopt_T *wop;
+{
+#ifdef FEAT_FOLDING
+ clear_string_option(&wop->wo_fdi);
+ clear_string_option(&wop->wo_fdm);
+# ifdef FEAT_EVAL
+ clear_string_option(&wop->wo_fde);
+ clear_string_option(&wop->wo_fdt);
+# endif
+ clear_string_option(&wop->wo_fmr);
+#endif
+#ifdef FEAT_RIGHTLEFT
+ clear_string_option(&wop->wo_rlc);
+#endif
+}
+
+/*
+ * Copy global option values to local options for one buffer.
+ * Used when creating a new buffer and sometimes when entering a buffer.
+ * flags:
+ * BCO_ENTER We will enter the buf buffer.
+ * BCO_ALWAYS Always copy the options, but only set b_p_initialized when
+ * appropriate.
+ * BCO_NOHELP Don't copy the values to a help buffer.
+ */
+ void
+buf_copy_options(buf, flags)
+ buf_T *buf;
+ int flags;
+{
+ int should_copy = TRUE;
+ char_u *save_p_isk = NULL; /* init for GCC */
+ int dont_do_help;
+ int did_isk = FALSE;
+
+ /*
+ * Don't do anything of the buffer is invalid.
+ */
+ if (buf == NULL || !buf_valid(buf))
+ return;
+
+ /*
+ * Skip this when the option defaults have not been set yet. Happens when
+ * main() allocates the first buffer.
+ */
+ if (p_cpo != NULL)
+ {
+ /*
+ * Always copy when entering and 'cpo' contains 'S'.
+ * Don't copy when already initialized.
+ * Don't copy when 'cpo' contains 's' and not entering.
+ * 'S' BCO_ENTER initialized 's' should_copy
+ * yes yes X X TRUE
+ * yes no yes X FALSE
+ * no X yes X FALSE
+ * X no no yes FALSE
+ * X no no no TRUE
+ * no yes no X TRUE
+ */
+ if ((vim_strchr(p_cpo, CPO_BUFOPTGLOB) == NULL || !(flags & BCO_ENTER))
+ && (buf->b_p_initialized
+ || (!(flags & BCO_ENTER)
+ && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
+ should_copy = FALSE;
+
+ if (should_copy || (flags & BCO_ALWAYS))
+ {
+ /* Don't copy the options specific to a help buffer when
+ * BCO_NOHELP is given or the options were initialized already
+ * (jumping back to a help file with CTRL-T or CTRL-O) */
+ dont_do_help = ((flags & BCO_NOHELP) && buf->b_help)
+ || buf->b_p_initialized;
+ if (dont_do_help) /* don't free b_p_isk */
+ {
+ save_p_isk = buf->b_p_isk;
+ buf->b_p_isk = NULL;
+ }
+ /*
+ * Always free the allocated strings.
+ * If not already initialized, set 'readonly' and copy 'fileformat'.
+ */
+ if (!buf->b_p_initialized)
+ {
+ free_buf_options(buf, TRUE);
+ buf->b_p_ro = FALSE; /* don't copy readonly */
+ buf->b_p_tx = p_tx;
+#ifdef FEAT_MBYTE
+ buf->b_p_fenc = vim_strsave(p_fenc);
+#endif
+ buf->b_p_ff = vim_strsave(p_ff);
+#if defined(FEAT_QUICKFIX)
+ buf->b_p_bh = empty_option;
+ buf->b_p_bt = empty_option;
+#endif
+ }
+ else
+ free_buf_options(buf, FALSE);
+
+ buf->b_p_ai = p_ai;
+ buf->b_p_ai_nopaste = p_ai_nopaste;
+ buf->b_p_sw = p_sw;
+ buf->b_p_tw = p_tw;
+ buf->b_p_tw_nopaste = p_tw_nopaste;
+ buf->b_p_tw_nobin = p_tw_nobin;
+ buf->b_p_wm = p_wm;
+ buf->b_p_wm_nopaste = p_wm_nopaste;
+ buf->b_p_wm_nobin = p_wm_nobin;
+ buf->b_p_bin = p_bin;
+ buf->b_p_et = p_et;
+ buf->b_p_et_nobin = p_et_nobin;
+ buf->b_p_ml = p_ml;
+ buf->b_p_ml_nobin = p_ml_nobin;
+ buf->b_p_inf = p_inf;
+ buf->b_p_swf = p_swf;
+#ifdef FEAT_INS_EXPAND
+ buf->b_p_cpt = vim_strsave(p_cpt);
+#endif
+ buf->b_p_sts = p_sts;
+ buf->b_p_sts_nopaste = p_sts_nopaste;
+#ifndef SHORT_FNAME
+ buf->b_p_sn = p_sn;
+#endif
+#ifdef FEAT_COMMENTS
+ buf->b_p_com = vim_strsave(p_com);
+#endif
+#ifdef FEAT_FOLDING
+ buf->b_p_cms = vim_strsave(p_cms);
+#endif
+ buf->b_p_fo = vim_strsave(p_fo);
+ buf->b_p_nf = vim_strsave(p_nf);
+ buf->b_p_mps = vim_strsave(p_mps);
+#ifdef FEAT_SMARTINDENT
+ buf->b_p_si = p_si;
+#endif
+ buf->b_p_ci = p_ci;
+#ifdef FEAT_CINDENT
+ buf->b_p_cin = p_cin;
+ buf->b_p_cink = vim_strsave(p_cink);
+ buf->b_p_cino = vim_strsave(p_cino);
+#endif
+#ifdef FEAT_AUTOCMD
+ /* Don't copy 'filetype', it must be detected */
+ buf->b_p_ft = empty_option;
+#endif
+#ifdef FEAT_OSFILETYPE
+ buf->b_p_oft = vim_strsave(p_oft);
+#endif
+ buf->b_p_pi = p_pi;
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+ buf->b_p_cinw = vim_strsave(p_cinw);
+#endif
+#ifdef FEAT_LISP
+ buf->b_p_lisp = p_lisp;
+#endif
+#ifdef FEAT_SYN_HL
+ /* Don't copy 'syntax', it must be set */
+ buf->b_p_syn = empty_option;
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ buf->b_p_inde = vim_strsave(p_inde);
+ buf->b_p_indk = vim_strsave(p_indk);
+#endif
+#ifdef FEAT_CRYPT
+ buf->b_p_key = vim_strsave(p_key);
+#endif
+#ifdef FEAT_SEARCHPATH
+ buf->b_p_sua = vim_strsave(p_sua);
+#endif
+#ifdef FEAT_KEYMAP
+ buf->b_p_keymap = vim_strsave(p_keymap);
+ buf->b_kmap_state |= KEYMAP_INIT;
+#endif
+ /* This isn't really an option, but copying the langmap and IME
+ * state from the current buffer is better than resetting it. */
+ buf->b_p_iminsert = p_iminsert;
+ buf->b_p_imsearch = p_imsearch;
+
+ /* options that are normally global but also have a local value
+ * are not copied, start using the global value */
+ buf->b_p_ar = -1;
+#ifdef FEAT_QUICKFIX
+ buf->b_p_gp = empty_option;
+ buf->b_p_mp = empty_option;
+ buf->b_p_efm = empty_option;
+#endif
+ buf->b_p_ep = empty_option;
+ buf->b_p_kp = empty_option;
+ buf->b_p_path = empty_option;
+ buf->b_p_tags = empty_option;
+#ifdef FEAT_FIND_ID
+ buf->b_p_def = empty_option;
+ buf->b_p_inc = empty_option;
+# ifdef FEAT_EVAL
+ buf->b_p_inex = vim_strsave(p_inex);
+# endif
+#endif
+#ifdef FEAT_INS_EXPAND
+ buf->b_p_dict = empty_option;
+ buf->b_p_tsr = empty_option;
+#endif
+
+ /*
+ * Don't copy the options set by ex_help(), use the saved values,
+ * when going from a help buffer to a non-help buffer.
+ * Don't touch these at all when BCO_NOHELP is used and going from
+ * or to a help buffer.
+ */
+ if (dont_do_help)
+ buf->b_p_isk = save_p_isk;
+ else
+ {
+ buf->b_p_isk = vim_strsave(p_isk);
+ did_isk = TRUE;
+ buf->b_p_ts = p_ts;
+ buf->b_help = FALSE;
+#ifdef FEAT_QUICKFIX
+ if (buf->b_p_bt[0] == 'h')
+ clear_string_option(&buf->b_p_bt);
+#endif
+ buf->b_p_ma = p_ma;
+ }
+ }
+
+ /*
+ * When the options should be copied (ignoring BCO_ALWAYS), set the
+ * flag that indicates that the options have been initialized.
+ */
+ if (should_copy)
+ buf->b_p_initialized = TRUE;
+ }
+
+ check_buf_options(buf); /* make sure we don't have NULLs */
+ if (did_isk)
+ (void)buf_init_chartab(buf, FALSE);
+}
+
+/*
+ * Reset the 'modifiable' option and its default value.
+ */
+ void
+reset_modifiable()
+{
+ int opt_idx;
+
+ curbuf->b_p_ma = FALSE;
+ p_ma = FALSE;
+ opt_idx = findoption((char_u *)"ma");
+ options[opt_idx].def_val[VI_DEFAULT] = FALSE;
+}
+
+/*
+ * Set the global value for 'iminsert' to the local value.
+ */
+ void
+set_iminsert_global()
+{
+ p_iminsert = curbuf->b_p_iminsert;
+}
+
+/*
+ * Set the global value for 'imsearch' to the local value.
+ */
+ void
+set_imsearch_global()
+{
+ p_imsearch = curbuf->b_p_imsearch;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+static int expand_option_idx = -1;
+static char_u expand_option_name[5] = {'t', '_', NUL, NUL, NUL};
+static int expand_option_flags = 0;
+
+ void
+set_context_in_set_cmd(xp, arg, opt_flags)
+ expand_T *xp;
+ char_u *arg;
+ int opt_flags; /* OPT_GLOBAL and/or OPT_LOCAL */
+{
+ int nextchar;
+ long_u flags = 0; /* init for GCC */
+ int opt_idx = 0; /* init for GCC */
+ char_u *p;
+ char_u *s;
+ int is_term_option = FALSE;
+ int key;
+
+ expand_option_flags = opt_flags;
+
+ xp->xp_context = EXPAND_SETTINGS;
+ if (*arg == NUL)
+ {
+ xp->xp_pattern = arg;
+ return;
+ }
+ p = arg + STRLEN(arg) - 1;
+ if (*p == ' ' && *(p - 1) != '\\')
+ {
+ xp->xp_pattern = p + 1;
+ return;
+ }
+ while (p > arg)
+ {
+ s = p;
+ /* count number of backslashes before ' ' or ',' */
+ if (*p == ' ' || *p == ',')
+ {
+ while (s > arg && *(s - 1) == '\\')
+ --s;
+ }
+ /* break at a space with an even number of backslashes */
+ if (*p == ' ' && ((p - s) & 1) == 0)
+ {
+ ++p;
+ break;
+ }
+ --p;
+ }
+ if (STRNCMP(p, "no", 2) == 0)
+ {
+ xp->xp_context = EXPAND_BOOL_SETTINGS;
+ p += 2;
+ }
+ if (STRNCMP(p, "inv", 3) == 0)
+ {
+ xp->xp_context = EXPAND_BOOL_SETTINGS;
+ p += 3;
+ }
+ xp->xp_pattern = arg = p;
+ if (*arg == '<')
+ {
+ while (*p != '>')
+ if (*p++ == NUL) /* expand terminal option name */
+ return;
+ key = get_special_key_code(arg + 1);
+ if (key == 0) /* unknown name */
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return;
+ }
+ nextchar = *++p;
+ is_term_option = TRUE;
+ expand_option_name[2] = KEY2TERMCAP0(key);
+ expand_option_name[3] = KEY2TERMCAP1(key);
+ }
+ else
+ {
+ if (p[0] == 't' && p[1] == '_')
+ {
+ p += 2;
+ if (*p != NUL)
+ ++p;
+ if (*p == NUL)
+ return; /* expand option name */
+ nextchar = *++p;
+ is_term_option = TRUE;
+ expand_option_name[2] = p[-2];
+ expand_option_name[3] = p[-1];
+ }
+ else
+ {
+ /* Allow * wildcard */
+ while (ASCII_ISALNUM(*p) || *p == '_' || *p == '*')
+ p++;
+ if (*p == NUL)
+ return;
+ nextchar = *p;
+ *p = NUL;
+ opt_idx = findoption(arg);
+ *p = nextchar;
+ if (opt_idx == -1 || options[opt_idx].var == NULL)
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return;
+ }
+ flags = options[opt_idx].flags;
+ if (flags & P_BOOL)
+ {
+ xp->xp_context = EXPAND_NOTHING;
+ return;
+ }
+ }
+ }
+ /* handle "-=" and "+=" */
+ if ((nextchar == '-' || nextchar == '+' || nextchar == '^') && p[1] == '=')
+ {
+ ++p;
+ nextchar = '=';
+ }
+ if ((nextchar != '=' && nextchar != ':')
+ || xp->xp_context == EXPAND_BOOL_SETTINGS)
+ {
+ xp->xp_context = EXPAND_UNSUCCESSFUL;
+ return;
+ }
+ if (xp->xp_context != EXPAND_BOOL_SETTINGS && p[1] == NUL)
+ {
+ xp->xp_context = EXPAND_OLD_SETTING;
+ if (is_term_option)
+ expand_option_idx = -1;
+ else
+ expand_option_idx = opt_idx;
+ xp->xp_pattern = p + 1;
+ return;
+ }
+ xp->xp_context = EXPAND_NOTHING;
+ if (is_term_option || (flags & P_NUM))
+ return;
+
+ xp->xp_pattern = p + 1;
+
+ if (flags & P_EXPAND)
+ {
+ p = options[opt_idx].var;
+ if (p == (char_u *)&p_bdir
+ || p == (char_u *)&p_dir
+ || p == (char_u *)&p_path
+ || p == (char_u *)&p_rtp
+#ifdef FEAT_SEARCHPATH
+ || p == (char_u *)&p_cdpath
+#endif
+#ifdef FEAT_SESSION
+ || p == (char_u *)&p_vdir
+#endif
+ )
+ {
+ xp->xp_context = EXPAND_DIRECTORIES;
+ if (p == (char_u *)&p_path
+#ifdef FEAT_SEARCHPATH
+ || p == (char_u *)&p_cdpath
+#endif
+ )
+ xp->xp_backslash = XP_BS_THREE;
+ else
+ xp->xp_backslash = XP_BS_ONE;
+ }
+ else
+ {
+ xp->xp_context = EXPAND_FILES;
+ /* for 'tags' need three backslashes for a space */
+ if (p == (char_u *)&p_tags)
+ xp->xp_backslash = XP_BS_THREE;
+ else
+ xp->xp_backslash = XP_BS_ONE;
+ }
+ }
+
+ /* For an option that is a list of file names, find the start of the
+ * last file name. */
+ for (p = arg + STRLEN(arg) - 1; p > xp->xp_pattern; --p)
+ {
+ /* count number of backslashes before ' ' or ',' */
+ if (*p == ' ' || *p == ',')
+ {
+ s = p;
+ while (s > xp->xp_pattern && *(s - 1) == '\\')
+ --s;
+ if ((*p == ' ' && (xp->xp_backslash == XP_BS_THREE && (p - s) < 3))
+ || (*p == ',' && (flags & P_COMMA) && ((p - s) & 1) == 0))
+ {
+ xp->xp_pattern = p + 1;
+ break;
+ }
+ }
+ }
+
+ return;
+}
+
+ int
+ExpandSettings(xp, regmatch, num_file, file)
+ expand_T *xp;
+ regmatch_T *regmatch;
+ int *num_file;
+ char_u ***file;
+{
+ int num_normal = 0; /* Nr of matching non-term-code settings */
+ int num_term = 0; /* Nr of matching terminal code settings */
+ int opt_idx;
+ int match;
+ int count = 0;
+ char_u *str;
+ int loop;
+ int is_term_opt;
+ char_u name_buf[MAX_KEY_NAME_LEN];
+ static char *(names[]) = {"all", "termcap"};
+ int ic = regmatch->rm_ic; /* remember the ignore-case flag */
+
+ /* do this loop twice:
+ * loop == 0: count the number of matching options
+ * loop == 1: copy the matching options into allocated memory
+ */
+ for (loop = 0; loop <= 1; ++loop)
+ {
+ regmatch->rm_ic = ic;
+ if (xp->xp_context != EXPAND_BOOL_SETTINGS)
+ {
+ for (match = 0; match < sizeof(names) / sizeof(char *); ++match)
+ if (vim_regexec(regmatch, (char_u *)names[match], (colnr_T)0))
+ {
+ if (loop == 0)
+ num_normal++;
+ else
+ (*file)[count++] = vim_strsave((char_u *)names[match]);
+ }
+ }
+ for (opt_idx = 0; (str = (char_u *)options[opt_idx].fullname) != NULL;
+ opt_idx++)
+ {
+ if (options[opt_idx].var == NULL)
+ continue;
+ if (xp->xp_context == EXPAND_BOOL_SETTINGS
+ && !(options[opt_idx].flags & P_BOOL))
+ continue;
+ is_term_opt = istermoption(&options[opt_idx]);
+ if (is_term_opt && num_normal > 0)
+ continue;
+ match = FALSE;
+ if (vim_regexec(regmatch, str, (colnr_T)0)
+ || (options[opt_idx].shortname != NULL
+ && vim_regexec(regmatch,
+ (char_u *)options[opt_idx].shortname, (colnr_T)0)))
+ match = TRUE;
+ else if (is_term_opt)
+ {
+ name_buf[0] = '<';
+ name_buf[1] = 't';
+ name_buf[2] = '_';
+ name_buf[3] = str[2];
+ name_buf[4] = str[3];
+ name_buf[5] = '>';
+ name_buf[6] = NUL;
+ if (vim_regexec(regmatch, name_buf, (colnr_T)0))
+ {
+ match = TRUE;
+ str = name_buf;
+ }
+ }
+ if (match)
+ {
+ if (loop == 0)
+ {
+ if (is_term_opt)
+ num_term++;
+ else
+ num_normal++;
+ }
+ else
+ (*file)[count++] = vim_strsave(str);
+ }
+ }
+ /*
+ * Check terminal key codes, these are not in the option table
+ */
+ if (xp->xp_context != EXPAND_BOOL_SETTINGS && num_normal == 0)
+ {
+ for (opt_idx = 0; (str = get_termcode(opt_idx)) != NULL; opt_idx++)
+ {
+ if (!isprint(str[0]) || !isprint(str[1]))
+ continue;
+
+ name_buf[0] = 't';
+ name_buf[1] = '_';
+ name_buf[2] = str[0];
+ name_buf[3] = str[1];
+ name_buf[4] = NUL;
+
+ match = FALSE;
+ if (vim_regexec(regmatch, name_buf, (colnr_T)0))
+ match = TRUE;
+ else
+ {
+ name_buf[0] = '<';
+ name_buf[1] = 't';
+ name_buf[2] = '_';
+ name_buf[3] = str[0];
+ name_buf[4] = str[1];
+ name_buf[5] = '>';
+ name_buf[6] = NUL;
+
+ if (vim_regexec(regmatch, name_buf, (colnr_T)0))
+ match = TRUE;
+ }
+ if (match)
+ {
+ if (loop == 0)
+ num_term++;
+ else
+ (*file)[count++] = vim_strsave(name_buf);
+ }
+ }
+
+ /*
+ * Check special key names.
+ */
+ regmatch->rm_ic = TRUE; /* ignore case here */
+ for (opt_idx = 0; (str = get_key_name(opt_idx)) != NULL; opt_idx++)
+ {
+ name_buf[0] = '<';
+ STRCPY(name_buf + 1, str);
+ STRCAT(name_buf, ">");
+
+ if (vim_regexec(regmatch, name_buf, (colnr_T)0))
+ {
+ if (loop == 0)
+ num_term++;
+ else
+ (*file)[count++] = vim_strsave(name_buf);
+ }
+ }
+ }
+ if (loop == 0)
+ {
+ if (num_normal > 0)
+ *num_file = num_normal;
+ else if (num_term > 0)
+ *num_file = num_term;
+ else
+ return OK;
+ *file = (char_u **)alloc((unsigned)(*num_file * sizeof(char_u *)));
+ if (*file == NULL)
+ {
+ *file = (char_u **)"";
+ return FAIL;
+ }
+ }
+ }
+ return OK;
+}
+
+ int
+ExpandOldSetting(num_file, file)
+ int *num_file;
+ char_u ***file;
+{
+ char_u *var = NULL; /* init for GCC */
+ char_u *buf;
+
+ *num_file = 0;
+ *file = (char_u **)alloc((unsigned)sizeof(char_u *));
+ if (*file == NULL)
+ return FAIL;
+
+ /*
+ * For a terminal key code expand_option_idx is < 0.
+ */
+ if (expand_option_idx < 0)
+ {
+ var = find_termcode(expand_option_name + 2);
+ if (var == NULL)
+ expand_option_idx = findoption(expand_option_name);
+ }
+
+ if (expand_option_idx >= 0)
+ {
+ /* put string of option value in NameBuff */
+ option_value2string(&options[expand_option_idx], expand_option_flags);
+ var = NameBuff;
+ }
+ else if (var == NULL)
+ var = (char_u *)"";
+
+ /* A backslash is required before some characters. This is the reverse of
+ * what happens in do_set(). */
+ buf = vim_strsave_escaped(var, escape_chars);
+
+ if (buf == NULL)
+ {
+ vim_free(*file);
+ *file = NULL;
+ return FAIL;
+ }
+
+#ifdef BACKSLASH_IN_FILENAME
+ /* For MS-Windows et al. we don't double backslashes at the start and
+ * before a file name character. */
+ for (var = buf; *var != NUL; )
+ {
+ if (var[0] == '\\' && var[1] == '\\'
+ && expand_option_idx >= 0
+ && (options[expand_option_idx].flags & P_EXPAND)
+ && vim_isfilec(var[2])
+ && (var[2] != '\\' || (var == buf && var[4] != '\\')))
+ mch_memmove(var, var + 1, STRLEN(var));
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ var += (*mb_ptr2len_check)(var) - 1;
+#endif
+ ++var;
+ }
+#endif
+
+ *file[0] = buf;
+ *num_file = 1;
+ return OK;
+}
+#endif
+
+/*
+ * Get the value for the numeric or string option *opp in a nice format into
+ * NameBuff[]. Must not be called with a hidden option!
+ */
+ static void
+option_value2string(opp, opt_flags)
+ struct vimoption *opp;
+ int opt_flags; /* OPT_GLOBAL and/or OPT_LOCAL */
+{
+ char_u *varp;
+
+ varp = get_varp_scope(opp, opt_flags);
+
+ if (opp->flags & P_NUM)
+ {
+ long wc = 0;
+
+ if (wc_use_keyname(varp, &wc))
+ STRCPY(NameBuff, get_special_key_name((int)wc, 0));
+ else if (wc != 0)
+ STRCPY(NameBuff, transchar((int)wc));
+ else
+ sprintf((char *)NameBuff, "%ld", *(long *)varp);
+ }
+ else /* P_STRING */
+ {
+ varp = *(char_u **)(varp);
+ if (varp == NULL) /* just in case */
+ NameBuff[0] = NUL;
+#ifdef FEAT_CRYPT
+ /* don't show the actual value of 'key', only that it's set */
+ if (opp->var == (char_u *)&p_key && *varp)
+ STRCPY(NameBuff, "*****");
+#endif
+ else if (opp->flags & P_EXPAND)
+ home_replace(NULL, varp, NameBuff, MAXPATHL, FALSE);
+ /* Translate 'pastetoggle' into special key names */
+ else if ((char_u **)opp->var == &p_pt)
+ str2specialbuf(p_pt, NameBuff, MAXPATHL);
+ else
+ STRNCPY(NameBuff, varp, MAXPATHL);
+ }
+}
+
+/*
+ * Return TRUE if "varp" points to 'wildchar' or 'wildcharm' and it can be
+ * printed as a keyname.
+ * "*wcp" is set to the value of the option if it's 'wildchar' or 'wildcharm'.
+ */
+ static int
+wc_use_keyname(varp, wcp)
+ char_u *varp;
+ long *wcp;
+{
+ if (((long *)varp == &p_wc) || ((long *)varp == &p_wcm))
+ {
+ *wcp = *(long *)varp;
+ if (IS_SPECIAL(*wcp) || find_special_key_in_table((int)*wcp) >= 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#ifdef FEAT_LANGMAP
+/*
+ * Any character has an equivalent character. This is used for keyboards that
+ * have a special language mode that sends characters above 128 (although
+ * other characters can be translated too).
+ */
+
+/*
+ * char_u langmap_mapchar[256];
+ * Normally maps each of the 128 upper chars to an <128 ascii char; used to
+ * "translate" native lang chars in normal mode or some cases of
+ * insert mode without having to tediously switch lang mode back&forth.
+ */
+
+ static void
+langmap_init()
+{
+ int i;
+
+ for (i = 0; i < 256; i++) /* we init with a-one-to one map */
+ langmap_mapchar[i] = i;
+}
+
+/*
+ * Called when langmap option is set; the language map can be
+ * changed at any time!
+ */
+ static void
+langmap_set()
+{
+ char_u *p;
+ char_u *p2;
+ int from, to;
+
+ langmap_init(); /* back to one-to-one map first */
+
+ for (p = p_langmap; p[0] != NUL; )
+ {
+ for (p2 = p; p2[0] != NUL && p2[0] != ',' && p2[0] != ';'; ++p2)
+ {
+ if (p2[0] == '\\' && p2[1] != NUL)
+ ++p2;
+#ifdef FEAT_MBYTE
+ p2 += (*mb_ptr2len_check)(p2) - 1;
+#endif
+ }
+ if (p2[0] == ';')
+ ++p2; /* abcd;ABCD form, p2 points to A */
+ else
+ p2 = NULL; /* aAbBcCdD form, p2 is NULL */
+ while (p[0])
+ {
+ if (p[0] == '\\' && p[1] != NUL)
+ ++p;
+#ifdef FEAT_MBYTE
+ from = (*mb_ptr2char)(p);
+#else
+ from = p[0];
+#endif
+ if (p2 == NULL)
+ {
+#ifdef FEAT_MBYTE
+ p += (*mb_ptr2len_check)(p);
+#else
+ ++p;
+#endif
+ if (p[0] == '\\')
+ ++p;
+#ifdef FEAT_MBYTE
+ to = (*mb_ptr2char)(p);
+#else
+ to = p[0];
+#endif
+ }
+ else
+ {
+ if (p2[0] == '\\')
+ ++p2;
+#ifdef FEAT_MBYTE
+ to = (*mb_ptr2char)(p2);
+#else
+ to = p2[0];
+#endif
+ }
+ if (to == NUL)
+ {
+ EMSG2(_("E357: 'langmap': Matching character missing for %s"),
+ transchar(from));
+ return;
+ }
+ langmap_mapchar[from & 255] = to;
+
+ /* Advance to next pair */
+#ifdef FEAT_MBYTE
+ p += (*mb_ptr2len_check)(p);
+#else
+ ++p;
+#endif
+ if (p2 == NULL)
+ {
+ if (p[0] == ',')
+ {
+ ++p;
+ break;
+ }
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ p2 += (*mb_ptr2len_check)(p2);
+#else
+ ++p2;
+#endif
+ if (*p == ';')
+ {
+ p = p2;
+ if (p[0] != NUL)
+ {
+ if (p[0] != ',')
+ {
+ EMSG2(_("E358: 'langmap': Extra characters after semicolon: %s"), p);
+ return;
+ }
+ ++p;
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+#endif
+
+/*
+ * Return TRUE if format option 'x' is in effect.
+ * Take care of no formatting when 'paste' is set.
+ */
+ int
+has_format_option(x)
+ int x;
+{
+ if (p_paste)
+ return FALSE;
+ return (vim_strchr(curbuf->b_p_fo, x) != NULL);
+}
+
+/*
+ * Return TRUE if "x" is present in 'shortmess' option, or
+ * 'shortmess' contains 'a' and "x" is present in SHM_A.
+ */
+ int
+shortmess(x)
+ int x;
+{
+ return ( vim_strchr(p_shm, x) != NULL
+ || (vim_strchr(p_shm, 'a') != NULL
+ && vim_strchr((char_u *)SHM_A, x) != NULL));
+}
+
+/*
+ * paste_option_changed() - Called after p_paste was set or reset.
+ */
+ static void
+paste_option_changed()
+{
+ static int old_p_paste = FALSE;
+ static int save_sm = 0;
+#ifdef FEAT_CMDL_INFO
+ static int save_ru = 0;
+#endif
+#ifdef FEAT_RIGHTLEFT
+ static int save_ri = 0;
+ static int save_hkmap = 0;
+#endif
+ buf_T *buf;
+
+ if (p_paste)
+ {
+ /*
+ * Paste switched from off to on.
+ * Save the current values, so they can be restored later.
+ */
+ if (!old_p_paste)
+ {
+ /* save options for each buffer */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ buf->b_p_tw_nopaste = buf->b_p_tw;
+ buf->b_p_wm_nopaste = buf->b_p_wm;
+ buf->b_p_sts_nopaste = buf->b_p_sts;
+ buf->b_p_ai_nopaste = buf->b_p_ai;
+ }
+
+ /* save global options */
+ save_sm = p_sm;
+#ifdef FEAT_CMDL_INFO
+ save_ru = p_ru;
+#endif
+#ifdef FEAT_RIGHTLEFT
+ save_ri = p_ri;
+ save_hkmap = p_hkmap;
+#endif
+ /* save global values for local buffer options */
+ p_tw_nopaste = p_tw;
+ p_wm_nopaste = p_wm;
+ p_sts_nopaste = p_sts;
+ p_ai_nopaste = p_ai;
+ }
+
+ /*
+ * Always set the option values, also when 'paste' is set when it is
+ * already on.
+ */
+ /* set options for each buffer */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ buf->b_p_tw = 0; /* textwidth is 0 */
+ buf->b_p_wm = 0; /* wrapmargin is 0 */
+ buf->b_p_sts = 0; /* softtabstop is 0 */
+ buf->b_p_ai = 0; /* no auto-indent */
+ }
+
+ /* set global options */
+ p_sm = 0; /* no showmatch */
+#ifdef FEAT_CMDL_INFO
+# ifdef FEAT_WINDOWS
+ if (p_ru)
+ status_redraw_all(); /* redraw to remove the ruler */
+# endif
+ p_ru = 0; /* no ruler */
+#endif
+#ifdef FEAT_RIGHTLEFT
+ p_ri = 0; /* no reverse insert */
+ p_hkmap = 0; /* no Hebrew keyboard */
+#endif
+ /* set global values for local buffer options */
+ p_tw = 0;
+ p_wm = 0;
+ p_sts = 0;
+ p_ai = 0;
+ }
+
+ /*
+ * Paste switched from on to off: Restore saved values.
+ */
+ else if (old_p_paste)
+ {
+ /* restore options for each buffer */
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ {
+ buf->b_p_tw = buf->b_p_tw_nopaste;
+ buf->b_p_wm = buf->b_p_wm_nopaste;
+ buf->b_p_sts = buf->b_p_sts_nopaste;
+ buf->b_p_ai = buf->b_p_ai_nopaste;
+ }
+
+ /* restore global options */
+ p_sm = save_sm;
+#ifdef FEAT_CMDL_INFO
+# ifdef FEAT_WINDOWS
+ if (p_ru != save_ru)
+ status_redraw_all(); /* redraw to draw the ruler */
+# endif
+ p_ru = save_ru;
+#endif
+#ifdef FEAT_RIGHTLEFT
+ p_ri = save_ri;
+ p_hkmap = save_hkmap;
+#endif
+ /* set global values for local buffer options */
+ p_tw = p_tw_nopaste;
+ p_wm = p_wm_nopaste;
+ p_sts = p_sts_nopaste;
+ p_ai = p_ai_nopaste;
+ }
+
+ old_p_paste = p_paste;
+}
+
+/*
+ * vimrc_found() - Called when a ".vimrc" or "VIMINIT" has been found.
+ *
+ * Reset 'compatible' and set the values for options that didn't get set yet
+ * to the Vim defaults.
+ * Don't do this if the 'compatible' option has been set or reset before.
+ */
+ void
+vimrc_found()
+{
+ int opt_idx;
+
+ if (!option_was_set((char_u *)"cp"))
+ {
+ p_cp = FALSE;
+ for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++)
+ if (!(options[opt_idx].flags & (P_WAS_SET|P_VI_DEF)))
+ set_option_default(opt_idx, OPT_FREE, FALSE);
+ didset_options();
+ }
+}
+
+/*
+ * Set 'compatible' on or off. Called for "-C" and "-N" command line arg.
+ */
+ void
+change_compatible(on)
+ int on;
+{
+ if (p_cp != on)
+ {
+ p_cp = on;
+ compatible_set();
+ }
+ options[findoption((char_u *)"cp")].flags |= P_WAS_SET;
+}
+
+/*
+ * Return TRUE when option "name" has been set.
+ */
+ int
+option_was_set(name)
+ char_u *name;
+{
+ int idx;
+
+ idx = findoption(name);
+ if (idx < 0) /* unknown option */
+ return FALSE;
+ if (options[idx].flags & P_WAS_SET)
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * compatible_set() - Called when 'compatible' has been set or unset.
+ *
+ * When 'compatible' set: Set all relevant options (those that have the P_VIM)
+ * flag) to a Vi compatible value.
+ * When 'compatible' is unset: Set all options that have a different default
+ * for Vim (without the P_VI_DEF flag) to that default.
+ */
+ static void
+compatible_set()
+{
+ int opt_idx;
+
+ for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++)
+ if ( ((options[opt_idx].flags & P_VIM) && p_cp)
+ || (!(options[opt_idx].flags & P_VI_DEF) && !p_cp))
+ set_option_default(opt_idx, OPT_FREE, p_cp);
+ didset_options();
+}
+
+#ifdef FEAT_LINEBREAK
+
+# if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+ /* Borland C++ screws up loop optimisation here (negri) */
+# pragma option -O-l
+# endif
+
+/*
+ * fill_breakat_flags() -- called when 'breakat' changes value.
+ */
+ static void
+fill_breakat_flags()
+{
+ char_u *c;
+ int i;
+
+ for (i = 0; i < 256; i++)
+ breakat_flags[i] = FALSE;
+
+ if (p_breakat != NULL)
+ for (c = p_breakat; *c; c++)
+ breakat_flags[*c] = TRUE;
+}
+
+# if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# pragma option -O.l
+# endif
+
+#endif
+
+/*
+ * Check an option that can be a range of string values.
+ *
+ * Return OK for correct value, FAIL otherwise.
+ * Empty is always OK.
+ */
+ static int
+check_opt_strings(val, values, list)
+ char_u *val;
+ char **values;
+ int list; /* when TRUE: accept a list of values */
+{
+ return opt_strings_flags(val, values, NULL, list);
+}
+
+/*
+ * Handle an option that can be a range of string values.
+ * Set a flag in "*flagp" for each string present.
+ *
+ * Return OK for correct value, FAIL otherwise.
+ * Empty is always OK.
+ */
+ static int
+opt_strings_flags(val, values, flagp, list)
+ char_u *val; /* new value */
+ char **values; /* array of valid string values */
+ unsigned *flagp;
+ int list; /* when TRUE: accept a list of values */
+{
+ int i;
+ int len;
+ unsigned new_flags = 0;
+
+ while (*val)
+ {
+ for (i = 0; ; ++i)
+ {
+ if (values[i] == NULL) /* val not found in values[] */
+ return FAIL;
+
+ len = (int)STRLEN(values[i]);
+ if (STRNCMP(values[i], val, len) == 0
+ && ((list && val[len] == ',') || val[len] == NUL))
+ {
+ val += len + (val[len] == ',');
+ new_flags |= (1 << i);
+ break; /* check next item in val list */
+ }
+ }
+ }
+ if (flagp != NULL)
+ *flagp = new_flags;
+
+ return OK;
+}
+
+/*
+ * Read the 'wildmode' option, fill wim_flags[].
+ */
+ static int
+check_opt_wim()
+{
+ char_u new_wim_flags[4];
+ char_u *p;
+ int i;
+ int idx = 0;
+
+ for (i = 0; i < 4; ++i)
+ new_wim_flags[i] = 0;
+
+ for (p = p_wim; *p; ++p)
+ {
+ for (i = 0; ASCII_ISALPHA(p[i]); ++i)
+ ;
+ if (p[i] != NUL && p[i] != ',' && p[i] != ':')
+ return FAIL;
+ if (i == 7 && STRNCMP(p, "longest", 7) == 0)
+ new_wim_flags[idx] |= WIM_LONGEST;
+ else if (i == 4 && STRNCMP(p, "full", 4) == 0)
+ new_wim_flags[idx] |= WIM_FULL;
+ else if (i == 4 && STRNCMP(p, "list", 4) == 0)
+ new_wim_flags[idx] |= WIM_LIST;
+ else
+ return FAIL;
+ p += i;
+ if (*p == NUL)
+ break;
+ if (*p == ',')
+ {
+ if (idx == 3)
+ return FAIL;
+ ++idx;
+ }
+ }
+
+ /* fill remaining entries with last flag */
+ while (idx < 3)
+ {
+ new_wim_flags[idx + 1] = new_wim_flags[idx];
+ ++idx;
+ }
+
+ /* only when there are no errors, wim_flags[] is changed */
+ for (i = 0; i < 4; ++i)
+ wim_flags[i] = new_wim_flags[i];
+ return OK;
+}
+
+/*
+ * Check if backspacing over something is allowed.
+ */
+ int
+can_bs(what)
+ int what; /* BS_INDENT, BS_EOL or BS_START */
+{
+ switch (*p_bs)
+ {
+ case '2': return TRUE;
+ case '1': return (what != BS_START);
+ case '0': return FALSE;
+ }
+ return vim_strchr(p_bs, what) != NULL;
+}
+
+/*
+ * Save the current values of 'fileformat' and 'fileencoding', so that we know
+ * the file must be considered changed when the value is different.
+ */
+ void
+save_file_ff(buf)
+ buf_T *buf;
+{
+ buf->b_start_ffc = *buf->b_p_ff;
+ buf->b_start_eol = buf->b_p_eol;
+#ifdef FEAT_MBYTE
+ /* Only use free/alloc when necessary, they take time. */
+ if (buf->b_start_fenc == NULL
+ || STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0)
+ {
+ vim_free(buf->b_start_fenc);
+ buf->b_start_fenc = vim_strsave(buf->b_p_fenc);
+ }
+#endif
+}
+
+/*
+ * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
+ * from when editing started (save_file_ff() called).
+ * Also when 'endofline' was changed and 'binary' is set.
+ * Don't consider a new, empty buffer to be changed.
+ */
+ int
+file_ff_differs(buf)
+ buf_T *buf;
+{
+ if ((buf->b_flags & BF_NEW)
+ && buf->b_ml.ml_line_count == 1
+ && *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
+ return FALSE;
+ if (buf->b_start_ffc != *buf->b_p_ff)
+ return TRUE;
+ if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (buf->b_start_fenc == NULL)
+ return (*buf->b_p_fenc != NUL);
+ return (STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0);
+#else
+ return FALSE;
+#endif
+}
+
+/*
+ * return OK if "p" is a valid fileformat name, FAIL otherwise.
+ */
+ int
+check_ff_value(p)
+ char_u *p;
+{
+ return check_opt_strings(p, p_ff_values, FALSE);
+}
diff --git a/src/option.h b/src/option.h
new file mode 100644
index 000000000..f3985e50e
--- /dev/null
+++ b/src/option.h
@@ -0,0 +1,802 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * option.h: definition of global variables for settable options
+ */
+
+#ifndef EXTERN
+# define EXTERN extern
+# define INIT(x)
+#else
+# ifndef INIT
+# define INIT(x) x
+# endif
+#endif
+
+/* default values for p_efm 'errorformat' */
+#ifdef AMIGA
+# define DFLT_EFM "%f>%l:%c:%t:%n:%m,%f:%l: %t%*\\D%n: %m,%f %l %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f:%l:%m"
+#else
+# if defined(MSDOS) || defined(WIN3264)
+# define DFLT_EFM "%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%m"
+# else
+# if defined(__EMX__) /* put most common here (i.e. gcc format) at front */
+# define DFLT_EFM "%f:%l:%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f(%l:%c) : %m"
+# else
+# if defined(__QNX__)
+# define DFLT_EFM "%f(%l):%*[^WE]%t%*\\D%n:%m"
+# else
+# ifdef VMS
+# define DFLT_EFM "%A%p^,%C%%CC-%t-%m,%Cat line number %l in file %f"
+# else /* Unix, probably */
+# ifdef EBCDIC
+#define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f"
+# else
+#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f"
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#define DFLT_GREPFORMAT "%f:%l:%m,%f:%l%m,%f %l%m"
+
+/* default values for b_p_ff 'fileformat' and p_ffs 'fileformats' */
+#define FF_DOS "dos"
+#define FF_MAC "mac"
+#define FF_UNIX "unix"
+
+#ifdef USE_CRNL
+# define DFLT_FF "dos"
+# define DFLT_FFS_VIM "dos,unix"
+# define DFLT_FFS_VI "dos,unix" /* also autodetect in compatible mode */
+# define DFLT_TEXTAUTO TRUE
+#else
+# ifdef USE_CR
+# define DFLT_FF "mac"
+# define DFLT_FFS_VIM "mac,unix,dos"
+# define DFLT_FFS_VI "mac,unix,dos"
+# define DFLT_TEXTAUTO TRUE
+# else
+# define DFLT_FF "unix"
+# define DFLT_FFS_VIM "unix,dos"
+# ifdef __CYGWIN__
+# define DFLT_FFS_VI "unix,dos" /* Cygwin always needs file detection */
+# define DFLT_TEXTAUTO TRUE
+# else
+# define DFLT_FFS_VI ""
+# define DFLT_TEXTAUTO FALSE
+# endif
+# endif
+#endif
+
+
+#ifdef FEAT_MBYTE
+/* Possible values for 'encoding' */
+# define ENC_UCSBOM "ucs-bom" /* check for BOM at start of file */
+
+/* default value for 'encoding' */
+# define ENC_DFLT "latin1"
+#endif
+
+/* end-of-line style */
+#define EOL_UNKNOWN -1 /* not defined yet */
+#define EOL_UNIX 0 /* NL */
+#define EOL_DOS 1 /* CR NL */
+#define EOL_MAC 2 /* CR */
+
+/* Formatting options for p_fo 'formatoptions' */
+#define FO_WRAP 't'
+#define FO_WRAP_COMS 'c'
+#define FO_RET_COMS 'r'
+#define FO_OPEN_COMS 'o'
+#define FO_Q_COMS 'q'
+#define FO_Q_NUMBER 'n'
+#define FO_Q_SECOND '2'
+#define FO_INS_VI 'v'
+#define FO_INS_LONG 'l'
+#define FO_INS_BLANK 'b'
+#define FO_MBYTE_BREAK 'm' /* break before/after multi-byte char */
+#define FO_MBYTE_JOIN 'M' /* no space before/after multi-byte char */
+#define FO_MBYTE_JOIN2 'B' /* no space between multi-byte chars */
+#define FO_ONE_LETTER '1'
+#define FO_WHITE_PAR 'w' /* trailing white space continues paragr. */
+#define FO_AUTO 'a' /* automatic formatting */
+
+#define DFLT_FO_VI "vt"
+#define DFLT_FO_VIM "tcq"
+#define FO_ALL "tcroq2vlb1mMBn,aw" /* for do_set() */
+
+/* characters for the p_cpo option: */
+#define CPO_ALTREAD 'a' /* ":read" sets alternate file name */
+#define CPO_ALTWRITE 'A' /* ":write" sets alternate file name */
+#define CPO_BAR 'b' /* "\|" ends a mapping */
+#define CPO_BSLASH 'B' /* backslash in mapping is not special */
+#define CPO_SEARCH 'c'
+#define CPO_CONCAT 'C' /* Don't concatenate sourced lines */
+#define CPO_DOTTAG 'd' /* "./tags" in 'tags' is in current dir */
+#define CPO_DIGRAPH 'D' /* No digraph after "r", "f", etc. */
+#define CPO_EXECBUF 'e'
+#define CPO_EMPTYREGION 'E' /* operating on empty region is an error */
+#define CPO_FNAMER 'f' /* set file name for ":r file" */
+#define CPO_FNAMEW 'F' /* set file name for ":w file" */
+#define CPO_GOTO1 'g' /* goto line 1 for ":edit" */
+#define CPO_INTMOD 'i' /* interrupt a read makes buffer modified */
+#define CPO_JOINSP 'j' /* only use two spaces for join after '.' */
+#define CPO_ENDOFSENT 'J' /* need two spaces to detect end of sentence */
+#define CPO_KEYCODE 'k' /* don't recognize raw key code in mappings */
+#define CPO_KOFFSET 'K' /* don't wait for key code in mappings */
+#define CPO_LITERAL 'l' /* take char after backslash in [] literal */
+#define CPO_LISTWM 'L' /* 'list' changes wrapmargin */
+#define CPO_SHOWMATCH 'm'
+#define CPO_MATCHBSL 'M' /* "%" ignores use of backslashes */
+#define CPO_NUMCOL 'n' /* 'number' column also used for text */
+#define CPO_LINEOFF 'o'
+#define CPO_OVERNEW 'O' /* silently overwrite new file */
+#define CPO_LISP 'p' /* 'lisp' indenting */
+#define CPO_REDO 'r'
+#define CPO_REMMARK 'R' /* remove marks when filtering */
+#define CPO_BUFOPT 's'
+#define CPO_BUFOPTGLOB 'S'
+#define CPO_TAGPAT 't'
+#define CPO_UNDO 'u' /* "u" undoes itself */
+#define CPO_BACKSPACE 'v' /* "v" keep deleted text */
+#define CPO_CW 'w' /* "cw" only changes one blank */
+#define CPO_FWRITE 'W' /* "w!" doesn't overwrite readonly files */
+#define CPO_ESC 'x'
+#define CPO_YANK 'y'
+#define CPO_DOLLAR '$'
+#define CPO_FILTER '!'
+#define CPO_MATCH '%'
+#define CPO_STAR '*' /* ":*" means ":@" */
+#define CPO_SPECI '<' /* don't recognize <> in mappings */
+#define CPO_DEFAULT "aABceFs"
+#define CPO_ALL "aAbBcCdDeEfFgijJkKlLmMnoOprRsStuvwWxy$!%*<"
+
+/* characters for p_ww option: */
+#define WW_ALL "bshl<>[],~"
+
+/* characters for p_mouse option: */
+#define MOUSE_NORMAL 'n' /* use mouse in Normal mode */
+#define MOUSE_VISUAL 'v' /* use mouse in Visual/Select mode */
+#define MOUSE_INSERT 'i' /* use mouse in Insert mode */
+#define MOUSE_COMMAND 'c' /* use mouse in Command-line mode */
+#define MOUSE_HELP 'h' /* use mouse in help buffers */
+#define MOUSE_RETURN 'r' /* use mouse for hit-return message */
+#define MOUSE_A "nvich" /* used for 'a' flag */
+#define MOUSE_ALL "anvichr" /* all possible characters */
+#define MOUSE_NONE ' ' /* don't use Visual selection */
+#define MOUSE_NONEF 'x' /* forced modeless selection */
+
+/* characters for p_shm option: */
+#define SHM_RO 'r' /* readonly */
+#define SHM_MOD 'm' /* modified */
+#define SHM_FILE 'f' /* (file 1 of 2) */
+#define SHM_LAST 'i' /* last line incomplete */
+#define SHM_TEXT 'x' /* tx instead of textmode */
+#define SHM_LINES 'l' /* "L" instead of "lines" */
+#define SHM_NEW 'n' /* "[New]" instead of "[New file]" */
+#define SHM_WRI 'w' /* "[w]" instead of "written" */
+#define SHM_A "rmfixlnw" /* represented by 'a' flag */
+#define SHM_WRITE 'W' /* don't use "written" at all */
+#define SHM_TRUNC 't' /* trunctate file messages */
+#define SHM_TRUNCALL 'T' /* trunctate all messages */
+#define SHM_OVER 'o' /* overwrite file messages */
+#define SHM_OVERALL 'O' /* overwrite more messages */
+#define SHM_SEARCH 's' /* no search hit bottom messages */
+#define SHM_ATTENTION 'A' /* no ATTENTION messages */
+#define SHM_INTRO 'I' /* intro messages */
+#define SHM_ALL "rmfixlnwaWtToOsAI" /* all possible flags for 'shm' */
+
+/* characters for p_go: */
+#define GO_ASEL 'a' /* autoselect */
+#define GO_ASELML 'A' /* autoselect modeless selection */
+#define GO_BOT 'b' /* use bottom scrollbar */
+#define GO_CONDIALOG 'c' /* use console dialog */
+#define GO_FORG 'f' /* start GUI in foreground */
+#define GO_GREY 'g' /* use grey menu items */
+#define GO_HORSCROLL 'h' /* flexible horizontal scrolling */
+#define GO_ICON 'i' /* use Vim icon */
+#define GO_LEFT 'l' /* use left scrollbar */
+#define GO_VLEFT 'L' /* left scrollbar with vert split */
+#define GO_MENUS 'm' /* use menu bar */
+#define GO_NOSYSMENU 'M' /* don't source system menu */
+#define GO_POINTER 'p' /* pointer enter/leave callbacks */
+#define GO_RIGHT 'r' /* use right scrollbar */
+#define GO_VRIGHT 'R' /* right scrollbar with vert split */
+#define GO_TEAROFF 't' /* add tear-off menu items */
+#define GO_TOOLBAR 'T' /* add toolbar */
+#define GO_FOOTER 'F' /* add footer */
+#define GO_VERTICAL 'v' /* arrange dialog buttons vertically */
+#define GO_ALL "aAbcfFghilmMprtTv" /* all possible flags for 'go' */
+
+/* flags for 'comments' option */
+#define COM_NEST 'n' /* comments strings nest */
+#define COM_BLANK 'b' /* needs blank after string */
+#define COM_START 's' /* start of comment */
+#define COM_MIDDLE 'm' /* middle of comment */
+#define COM_END 'e' /* end of comment */
+#define COM_AUTO_END 'x' /* last char of end closes comment */
+#define COM_FIRST 'f' /* first line comment only */
+#define COM_LEFT 'l' /* left adjusted */
+#define COM_RIGHT 'r' /* right adjusted */
+#define COM_NOBACK 'O' /* don't use for "O" command */
+#define COM_ALL "nbsmexflrO" /* all flags for 'comments' option */
+#define COM_MAX_LEN 50 /* maximum length of a part */
+
+/* flags for 'statusline' option */
+#define STL_FILEPATH 'f' /* path of file in buffer */
+#define STL_FULLPATH 'F' /* full path of file in buffer */
+#define STL_FILENAME 't' /* last part (tail) of file path */
+#define STL_COLUMN 'c' /* column og cursor*/
+#define STL_VIRTCOL 'v' /* virtual column */
+#define STL_VIRTCOL_ALT 'V' /* - with 'if different' display */
+#define STL_LINE 'l' /* line number of cursor */
+#define STL_NUMLINES 'L' /* number of lines in buffer */
+#define STL_BUFNO 'n' /* current buffer number */
+#define STL_KEYMAP 'k' /* 'keymap' when active */
+#define STL_OFFSET 'o' /* offset of character under cursor*/
+#define STL_OFFSET_X 'O' /* - in hexadecimal */
+#define STL_BYTEVAL 'b' /* byte value of character */
+#define STL_BYTEVAL_X 'B' /* - in hexadecimal */
+#define STL_ROFLAG 'r' /* readonly flag */
+#define STL_ROFLAG_ALT 'R' /* - other display */
+#define STL_HELPFLAG 'h' /* window is showing a help file */
+#define STL_HELPFLAG_ALT 'H' /* - other display */
+#define STL_FILETYPE 'y' /* 'filetype' */
+#define STL_FILETYPE_ALT 'Y' /* - other display */
+#define STL_PREVIEWFLAG 'w' /* window is showing the preview buf */
+#define STL_PREVIEWFLAG_ALT 'W' /* - other display */
+#define STL_MODIFIED 'm' /* modified flag */
+#define STL_MODIFIED_ALT 'M' /* - other display */
+#define STL_PERCENTAGE 'p' /* percentage through file */
+#define STL_ALTPERCENT 'P' /* percentage as TOP BOT ALL or NN% */
+#define STL_ARGLISTSTAT 'a' /* argument list status as (x of y) */
+#define STL_PAGENUM 'N' /* page number (when printing)*/
+#define STL_VIM_EXPR '{' /* start of expression to substitute */
+#define STL_MIDDLEMARK '=' /* separation between left and right */
+#define STL_TRUNCMARK '<' /* truncation mark if line is too long*/
+#define STL_HIGHLIGHT '*' /* highlight from (User)1..9 or 0 */
+#define STL_ALL ((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{")
+
+/* flags used for parsed 'wildmode' */
+#define WIM_FULL 1
+#define WIM_LONGEST 2
+#define WIM_LIST 4
+
+/* arguments for can_bs() */
+#define BS_INDENT 'i' /* "Indent" */
+#define BS_EOL 'o' /* "eOl" */
+#define BS_START 's' /* "Start" */
+
+#define LISPWORD_VALUE "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object"
+
+/*
+ * The following are actual variabables for the options
+ */
+
+#ifdef FEAT_RIGHTLEFT
+EXTERN long p_aleph; /* 'aleph' */
+#endif
+#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
+EXTERN int p_acd; /* 'autochdir' */
+#endif
+#ifdef FEAT_MBYTE
+EXTERN char_u *p_ambw; /* 'ambiwidth' */
+#endif
+#if defined(FEAT_GUI) && defined(MACOS_X)
+EXTERN int *p_antialias; /* 'antialias' */
+#endif
+EXTERN int p_ar; /* 'autoread' */
+EXTERN int p_aw; /* 'autowrite' */
+EXTERN int p_awa; /* 'autowriteall' */
+EXTERN char_u *p_bs; /* 'backspace' */
+EXTERN char_u *p_bg; /* 'background' */
+EXTERN int p_bk; /* 'backup' */
+EXTERN char_u *p_bkc; /* 'backupcopy' */
+EXTERN unsigned bkc_flags;
+#ifdef IN_OPTION_C
+static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
+#endif
+# define BKC_YES 0x001
+# define BKC_AUTO 0x002
+# define BKC_NO 0x004
+# define BKC_BREAKSYMLINK 0x008
+# define BKC_BREAKHARDLINK 0x010
+EXTERN char_u *p_bdir; /* 'backupdir' */
+EXTERN char_u *p_bex; /* 'backupext' */
+#ifdef FEAT_WILDIGN
+EXTERN char_u *p_bsk; /* 'backupskip' */
+#endif
+#ifdef FEAT_BEVAL
+EXTERN long p_bdlay; /* 'balloondelay' */
+# if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
+EXTERN int p_beval; /* 'ballooneval' */
+# endif
+#endif
+#ifdef FEAT_BROWSE
+EXTERN char_u *p_bsdir; /* 'browsedir' */
+#endif
+#ifdef MSDOS
+EXTERN int p_biosk; /* 'bioskey' */
+EXTERN int p_consk; /* 'conskey' */
+#endif
+#ifdef FEAT_LINEBREAK
+EXTERN char_u *p_breakat; /* 'breakat' */
+#endif
+EXTERN char_u *p_cmp; /* 'casemap' */
+EXTERN unsigned cmp_flags;
+#ifdef IN_OPTION_C
+static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
+#endif
+#define CMP_INTERNAL 0x001
+#define CMP_KEEPASCII 0x002
+#ifdef FEAT_MBYTE
+EXTERN char_u *p_enc; /* 'encoding' */
+EXTERN int p_deco; /* 'delcombine' */
+# ifdef FEAT_EVAL
+EXTERN char_u *p_ccv; /* 'charconvert' */
+# endif
+#endif
+#ifdef FEAT_CMDWIN
+EXTERN char_u *p_cedit; /* 'cedit' */
+EXTERN long p_cwh; /* 'cmdwinheight' */
+#endif
+#ifdef FEAT_CLIPBOARD
+EXTERN char_u *p_cb; /* 'clipboard' */
+EXTERN int clip_unnamed INIT(= FALSE);
+EXTERN int clip_autoselect INIT(= FALSE);
+EXTERN int clip_autoselectml INIT(= FALSE);
+EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
+#endif
+EXTERN long p_ch; /* 'cmdheight' */
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+EXTERN int p_confirm; /* 'confirm' */
+#endif
+EXTERN int p_cp; /* 'compatible' */
+EXTERN char_u *p_cpo; /* 'cpoptions' */
+#ifdef FEAT_CSCOPE
+EXTERN char_u *p_csprg; /* 'cscopeprg' */
+# ifdef FEAT_QUICKFIX
+EXTERN char_u *p_csqf; /* 'cscopequickfix' */
+# define CSQF_CMDS "sgdctefi"
+# define CSQF_FLAGS "+-0"
+# endif
+EXTERN int p_cst; /* 'cscopetag' */
+EXTERN long p_csto; /* 'cscopetagorder' */
+EXTERN long p_cspc; /* 'cscopepathcomp' */
+EXTERN int p_csverbose; /* 'cscopeverbose' */
+#endif
+EXTERN char_u *p_debug; /* 'debug' */
+#ifdef FEAT_FIND_ID
+EXTERN char_u *p_def; /* 'define' */
+EXTERN char_u *p_inc;
+#endif
+#ifdef FEAT_DIFF
+EXTERN char_u *p_dip; /* 'diffopt' */
+# ifdef FEAT_EVAL
+EXTERN char_u *p_dex; /* 'diffexpr' */
+# endif
+#endif
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u *p_dict; /* 'dictionary' */
+#endif
+#ifdef FEAT_DIGRAPHS
+EXTERN int p_dg; /* 'digraph' */
+#endif
+EXTERN char_u *p_dir; /* 'directory' */
+EXTERN char_u *p_dy; /* 'display' */
+EXTERN unsigned dy_flags;
+#ifdef IN_OPTION_C
+static char *(p_dy_values[]) = {"lastline", "uhex", NULL};
+#endif
+#define DY_LASTLINE 0x001
+#define DY_UHEX 0x002
+EXTERN int p_ed; /* 'edcompatible' */
+#ifdef FEAT_VERTSPLIT
+EXTERN char_u *p_ead; /* 'eadirection' */
+#endif
+EXTERN int p_ea; /* 'equalalways' */
+EXTERN char_u *p_ep; /* 'equalprg' */
+EXTERN int p_eb; /* 'errorbells' */
+#ifdef FEAT_QUICKFIX
+EXTERN char_u *p_ef; /* 'errorfile' */
+EXTERN char_u *p_efm; /* 'errorformat' */
+EXTERN char_u *p_gefm; /* 'grepformat' */
+EXTERN char_u *p_gp; /* 'grepprg' */
+#endif
+#ifdef FEAT_AUTOCMD
+EXTERN char_u *p_ei; /* 'eventignore' */
+#endif
+EXTERN int p_ek; /* 'esckeys' */
+EXTERN int p_exrc; /* 'exrc' */
+#ifdef FEAT_MBYTE
+EXTERN char_u *p_fencs; /* 'fileencodings' */
+#endif
+EXTERN char_u *p_ffs; /* 'fileformats' */
+#ifdef FEAT_FOLDING
+EXTERN char_u *p_fcl; /* 'foldclose' */
+EXTERN long p_fdls; /* 'foldlevelstart' */
+EXTERN char_u *p_fdo; /* 'foldopen' */
+EXTERN unsigned fdo_flags;
+# ifdef IN_OPTION_C
+static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
+ "quickfix", "search", "tag", "insert",
+ "undo", "jump", NULL};
+# endif
+# define FDO_ALL 0x001
+# define FDO_BLOCK 0x002
+# define FDO_HOR 0x004
+# define FDO_MARK 0x008
+# define FDO_PERCENT 0x010
+# define FDO_QUICKFIX 0x020
+# define FDO_SEARCH 0x040
+# define FDO_TAG 0x080
+# define FDO_INSERT 0x100
+# define FDO_UNDO 0x200
+# define FDO_JUMP 0x400
+#endif
+EXTERN char_u *p_fp; /* 'formatprg' */
+EXTERN int p_gd; /* 'gdefault' */
+#ifdef FEAT_PRINTER
+EXTERN char_u *p_pdev; /* 'printdevice' */
+# ifdef FEAT_POSTSCRIPT
+EXTERN char_u *p_penc; /* 'printencoding' */
+EXTERN char_u *p_pexpr; /* 'printexpr' */
+# endif
+EXTERN char_u *p_pfn; /* 'printfont' */
+EXTERN char_u *p_popt; /* 'printoptions' */
+EXTERN char_u *p_header; /* 'printheader' */
+#endif
+#ifdef FEAT_GUI
+EXTERN char_u *p_guifont; /* 'guifont' */
+# ifdef FEAT_XFONTSET
+EXTERN char_u *p_guifontset; /* 'guifontset' */
+# endif
+# ifdef FEAT_MBYTE
+EXTERN char_u *p_guifontwide; /* 'guifontwide' */
+# endif
+EXTERN int p_guipty; /* 'guipty' */
+#endif
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
+EXTERN long p_ghr; /* 'guiheadroom' */
+#endif
+#ifdef CURSOR_SHAPE
+EXTERN char_u *p_guicursor; /* 'guicursor' */
+#endif
+#ifdef FEAT_MOUSESHAPE
+EXTERN char_u *p_mouseshape; /* 'mouseshape' */
+#endif
+#if defined(FEAT_GUI)
+EXTERN char_u *p_go; /* 'guioptions' */
+#endif
+EXTERN char_u *p_hf; /* 'helpfile' */
+#ifdef FEAT_WINDOWS
+EXTERN long p_hh; /* 'helpheight' */
+#endif
+#ifdef FEAT_MULTI_LANG
+EXTERN char_u *p_hlg; /* 'helplang' */
+#endif
+EXTERN int p_hid; /* 'hidden' */
+/* Use P_HID to check if a buffer is to be hidden when it is no longer
+ * visible in a window. */
+#ifndef FEAT_QUICKFIX
+# define P_HID(dummy) (p_hid || cmdmod.hide)
+#else
+# define P_HID(buf) (buf_hide(buf))
+#endif
+EXTERN char_u *p_hl; /* 'highlight' */
+EXTERN int p_hls; /* 'hlsearch' */
+EXTERN long p_hi; /* 'history' */
+#ifdef FEAT_RIGHTLEFT
+EXTERN int p_hkmap; /* 'hkmap' */
+EXTERN int p_hkmapp; /* 'hkmapp' */
+# ifdef FEAT_FKMAP
+EXTERN int p_fkmap; /* 'fkmap' */
+EXTERN int p_altkeymap; /* 'altkeymap' */
+# endif
+# ifdef FEAT_ARABIC
+EXTERN int p_arshape; /* 'arabicshape' */
+# endif
+#endif
+#ifdef FEAT_TITLE
+EXTERN int p_icon; /* 'icon' */
+EXTERN char_u *p_iconstring; /* 'iconstring' */
+#endif
+EXTERN int p_ic; /* 'ignorecase' */
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+EXTERN char_u *p_imak; /* 'imactivatekey' */
+#endif
+#ifdef USE_IM_CONTROL
+EXTERN int p_imcmdline; /* 'imcmdline' */
+EXTERN int p_imdisable; /* 'imdisable' */
+#endif
+EXTERN int p_is; /* 'incsearch' */
+EXTERN int p_im; /* 'insertmode' */
+EXTERN char_u *p_isf; /* 'isfname' */
+EXTERN char_u *p_isi; /* 'isident' */
+EXTERN char_u *p_isp; /* 'isprint' */
+EXTERN int p_js; /* 'joinspaces' */
+EXTERN char_u *p_kp; /* 'keywordprg' */
+#ifdef FEAT_VISUAL
+EXTERN char_u *p_km; /* 'keymodel' */
+#endif
+#ifdef FEAT_LANGMAP
+EXTERN char_u *p_langmap; /* 'langmap'*/
+#endif
+#if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
+EXTERN char_u *p_lm; /* 'langmenu' */
+#endif
+#ifdef FEAT_GUI
+EXTERN long p_linespace; /* 'linespace' */
+#endif
+#ifdef FEAT_LISP
+EXTERN char_u *p_lispwords; /* 'lispwords' */
+#endif
+#ifdef FEAT_WINDOWS
+EXTERN long p_ls; /* 'laststatus' */
+#endif
+EXTERN char_u *p_lcs; /* 'listchars' */
+
+EXTERN int p_lz; /* 'lazyredraw' */
+EXTERN int p_lpl; /* 'loadplugins' */
+EXTERN int p_magic; /* 'magic' */
+#ifdef FEAT_QUICKFIX
+EXTERN char_u *p_mef; /* 'makeef' */
+EXTERN char_u *p_mp; /* 'makeprg' */
+#endif
+EXTERN long p_mat; /* 'matchtime' */
+#ifdef FEAT_EVAL
+EXTERN long p_mfd; /* 'maxfuncdepth' */
+#endif
+EXTERN long p_mmd; /* 'maxmapdepth' */
+EXTERN long p_mm; /* 'maxmem' */
+EXTERN long p_mmt; /* 'maxmemtot' */
+#ifdef FEAT_MENU
+EXTERN long p_mis; /* 'menuitems' */
+#endif
+EXTERN long p_mls; /* 'modelines' */
+EXTERN char_u *p_mouse; /* 'mouse' */
+#ifdef FEAT_GUI
+EXTERN int p_mousef; /* 'mousefocus' */
+EXTERN int p_mh; /* 'mousehide' */
+#endif
+EXTERN char_u *p_mousem; /* 'mousemodel' */
+EXTERN long p_mouset; /* 'mousetime' */
+EXTERN int p_more; /* 'more' */
+EXTERN char_u *p_para; /* 'paragraphs' */
+EXTERN int p_paste; /* 'paste' */
+EXTERN char_u *p_pt; /* 'pastetoggle' */
+#if defined(FEAT_EVAL) && defined(FEAT_DIFF)
+EXTERN char_u *p_pex; /* 'patchexpr' */
+#endif
+EXTERN char_u *p_pm; /* 'patchmode' */
+EXTERN char_u *p_path; /* 'path' */
+#ifdef FEAT_SEARCHPATH
+EXTERN char_u *p_cdpath; /* 'cdpath' */
+#endif
+EXTERN int p_remap; /* 'remap' */
+EXTERN long p_report; /* 'report' */
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+EXTERN long p_pvh; /* 'previewheight' */
+#endif
+#ifdef WIN3264
+EXTERN int p_rs; /* 'restorescreen' */
+#endif
+#ifdef FEAT_RIGHTLEFT
+EXTERN int p_ari; /* 'allowrevins' */
+EXTERN int p_ri; /* 'revins' */
+#endif
+#ifdef FEAT_CMDL_INFO
+EXTERN int p_ru; /* 'ruler' */
+#endif
+#ifdef FEAT_STL_OPT
+EXTERN char_u *p_ruf; /* 'rulerformat' */
+#endif
+EXTERN char_u *p_rtp; /* 'runtimepath' */
+EXTERN long p_sj; /* 'scrolljump' */
+EXTERN long p_so; /* 'scrolloff' */
+#ifdef FEAT_SCROLLBIND
+EXTERN char_u *p_sbo; /* 'scrollopt' */
+#endif
+EXTERN char_u *p_sections; /* 'sections' */
+EXTERN int p_secure; /* 'secure' */
+#ifdef FEAT_VISUAL
+EXTERN char_u *p_sel; /* 'selection' */
+EXTERN char_u *p_slm; /* 'selectmode' */
+#endif
+#ifdef FEAT_SESSION
+EXTERN char_u *p_ssop; /* 'sessionoptions' */
+EXTERN unsigned ssop_flags;
+# ifdef IN_OPTION_C
+/* Also used for 'viewoptions'! */
+static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize",
+ "localoptions", "options", "help", "blank", "globals", "slash", "unix",
+ "sesdir", "curdir", "folds", "cursor", NULL};
+# endif
+# define SSOP_BUFFERS 0x001
+# define SSOP_WINPOS 0x002
+# define SSOP_RESIZE 0x004
+# define SSOP_WINSIZE 0x008
+# define SSOP_LOCALOPTIONS 0x010
+# define SSOP_OPTIONS 0x020
+# define SSOP_HELP 0x040
+# define SSOP_BLANK 0x080
+# define SSOP_GLOBALS 0x100
+# define SSOP_SLASH 0x200
+# define SSOP_UNIX 0x400
+# define SSOP_SESDIR 0x800
+# define SSOP_CURDIR 0x1000
+# define SSOP_FOLDS 0x2000
+# define SSOP_CURSOR 0x4000
+#endif
+EXTERN char_u *p_sh; /* 'shell' */
+EXTERN char_u *p_shcf; /* 'shellcmdflag' */
+#ifdef FEAT_QUICKFIX
+EXTERN char_u *p_sp; /* 'shellpipe' */
+#endif
+EXTERN char_u *p_shq; /* 'shellquote' */
+EXTERN char_u *p_sxq; /* 'shellxquote' */
+EXTERN char_u *p_srr; /* 'shellredir' */
+#ifdef AMIGA
+EXTERN long p_st; /* 'shelltype' */
+#endif
+#ifdef BACKSLASH_IN_FILENAME
+EXTERN int p_ssl; /* 'shellslash' */
+#endif
+#ifdef FEAT_STL_OPT
+EXTERN char_u *p_stl; /* 'statusline' */
+#endif
+EXTERN int p_sr; /* 'shiftround' */
+EXTERN char_u *p_shm; /* 'shortmess' */
+#ifdef FEAT_LINEBREAK
+EXTERN char_u *p_sbr; /* 'showbreak' */
+#endif
+#ifdef FEAT_CMDL_INFO
+EXTERN int p_sc; /* 'showcmd' */
+#endif
+EXTERN int p_sft; /* 'showfulltag' */
+EXTERN int p_sm; /* 'showmatch' */
+EXTERN int p_smd; /* 'showmode' */
+EXTERN long p_ss; /* 'sidescroll' */
+EXTERN long p_siso; /* 'sidescrolloff' */
+EXTERN int p_scs; /* 'smartcase' */
+EXTERN int p_sta; /* 'smarttab' */
+#ifdef FEAT_WINDOWS
+EXTERN int p_sb; /* 'splitbelow' */
+#endif
+#ifdef FEAT_VERTSPLIT
+EXTERN int p_spr; /* 'splitright' */
+#endif
+EXTERN int p_sol; /* 'startofline' */
+EXTERN char_u *p_su; /* 'suffixes' */
+EXTERN char_u *p_sws; /* 'swapsync' */
+EXTERN char_u *p_swb; /* 'switchbuf' */
+EXTERN int p_tbs; /* 'tagbsearch' */
+EXTERN long p_tl; /* 'taglength' */
+EXTERN int p_tr; /* 'tagrelative' */
+EXTERN char_u *p_tags; /* 'tags' */
+EXTERN int p_tgst; /* 'tagstack' */
+#ifdef FEAT_ARABIC
+EXTERN int p_tbidi; /* 'termbidi' */
+#endif
+#ifdef FEAT_MBYTE
+EXTERN char_u *p_tenc; /* 'termencoding' */
+#endif
+EXTERN int p_terse; /* 'terse' */
+EXTERN int p_ta; /* 'textauto' */
+EXTERN int p_to; /* 'tildeop' */
+EXTERN int p_timeout; /* 'timeout' */
+EXTERN long p_tm; /* 'timeoutlen' */
+#ifdef FEAT_TITLE
+EXTERN int p_title; /* 'title' */
+EXTERN long p_titlelen; /* 'titlelen' */
+EXTERN char_u *p_titleold; /* 'titleold' */
+EXTERN char_u *p_titlestring; /* 'titlestring' */
+#endif
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u *p_tsr; /* 'thesaurus' */
+#endif
+EXTERN int p_ttimeout; /* 'ttimeout' */
+EXTERN long p_ttm; /* 'ttimeoutlen' */
+EXTERN int p_tbi; /* 'ttybuiltin' */
+EXTERN int p_tf; /* 'ttyfast' */
+#if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+EXTERN char_u *p_toolbar; /* 'toolbar' */
+EXTERN unsigned toolbar_flags;
+# ifdef IN_OPTION_C
+static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL};
+# endif
+# define TOOLBAR_TEXT 0x01
+# define TOOLBAR_ICONS 0x02
+# define TOOLBAR_TOOLTIPS 0x04
+# define TOOLBAR_HORIZ 0x08
+#endif
+#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) && defined(HAVE_GTK2)
+EXTERN char_u *p_tbis; /* 'toolbariconsize' */
+EXTERN unsigned tbis_flags;
+# ifdef IN_OPTION_C
+static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", NULL};
+# endif
+# define TBIS_TINY 0x01
+# define TBIS_SMALL 0x02
+# define TBIS_MEDIUM 0x04
+# define TBIS_LARGE 0x08
+#endif
+EXTERN long p_ttyscroll; /* 'ttyscroll' */
+#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
+EXTERN char_u *p_ttym; /* 'ttymouse' */
+EXTERN unsigned ttym_flags;
+# ifdef IN_OPTION_C
+static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", NULL};
+# endif
+# define TTYM_XTERM 0x01
+# define TTYM_XTERM2 0x02
+# define TTYM_DEC 0x04
+# define TTYM_NETTERM 0x08
+# define TTYM_JSBTERM 0x10
+# define TTYM_PTERM 0x20
+#endif
+EXTERN long p_ul; /* 'undolevels' */
+EXTERN long p_uc; /* 'updatecount' */
+EXTERN long p_ut; /* 'updatetime' */
+#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+EXTERN char_u *p_fcs; /* 'fillchar' */
+#endif
+#ifdef FEAT_VIMINFO
+EXTERN char_u *p_viminfo; /* 'viminfo' */
+#endif
+#ifdef FEAT_SESSION
+EXTERN char_u *p_vdir; /* 'viewdir' */
+EXTERN char_u *p_vop; /* 'viewoptions' */
+EXTERN unsigned vop_flags; /* uses SSOP_ flags */
+#endif
+EXTERN int p_vb; /* 'visualbell' */
+#ifdef FEAT_VIRTUALEDIT
+EXTERN char_u *p_ve; /* 'virtualedit' */
+EXTERN unsigned ve_flags;
+# ifdef IN_OPTION_C
+static char *(p_ve_values[]) = {"block", "insert", "all", NULL};
+# endif
+# define VE_BLOCK 5 /* includes "all" */
+# define VE_INSERT 6 /* includes "all" */
+# define VE_ALL 4
+#endif
+EXTERN long p_verbose; /* 'verbose' */
+EXTERN int p_warn; /* 'warn' */
+#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
+ || defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
+#define FEAT_WAK
+EXTERN char_u *p_wak; /* 'winaltkeys' */
+#endif
+#ifdef FEAT_WILDIGN
+EXTERN char_u *p_wig; /* 'wildignore' */
+#endif
+EXTERN int p_wiv; /* 'weirdinvert' */
+EXTERN char_u *p_ww; /* 'whichwrap' */
+EXTERN long p_wc; /* 'wildchar' */
+EXTERN long p_wcm; /* 'wildcharm' */
+EXTERN char_u *p_wim; /* 'wildmode' */
+#ifdef FEAT_WILDMENU
+EXTERN int p_wmnu; /* 'wildmenu' */
+#endif
+#ifdef FEAT_WINDOWS
+EXTERN long p_wh; /* 'winheight' */
+EXTERN long p_wmh; /* 'winminheight' */
+#endif
+#ifdef FEAT_VERTSPLIT
+EXTERN long p_wmw; /* 'winminwidth' */
+EXTERN long p_wiw; /* 'winwidth' */
+#endif
+EXTERN int p_ws; /* 'wrapscan' */
+EXTERN int p_write; /* 'write' */
+EXTERN int p_wa; /* 'writeany' */
+EXTERN int p_wb; /* 'writebackup' */
+EXTERN long p_wd; /* 'writedelay' */
diff --git a/src/os_amiga.c b/src/os_amiga.c
new file mode 100644
index 000000000..f462ccc59
--- /dev/null
+++ b/src/os_amiga.c
@@ -0,0 +1,1619 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_amiga.c
+ *
+ * Amiga system-dependent routines.
+ */
+
+#include "vim.h"
+
+#ifdef Window
+# undef Window /* Amiga has its own Window definition */
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#undef TRUE /* will be redefined by exec/types.h */
+#undef FALSE
+
+#ifndef LATTICE
+# include <exec/types.h>
+# include <exec/exec.h>
+# include <libraries/dos.h>
+# include <libraries/dosextens.h>
+# include <intuition/intuition.h>
+#else
+# include <proto/dos.h>
+# include <libraries/dosextens.h>
+# include <proto/intuition.h>
+# include <proto/exec.h>
+#endif
+
+#include <exec/memory.h>
+
+#include <dos/dostags.h> /* for 2.0 functions */
+#include <dos/dosasl.h>
+
+#if defined(LATTICE) && !defined(SASC) && defined(FEAT_ARP)
+# include <libraries/arp_pragmas.h>
+#endif
+
+/*
+ * At this point TRUE and FALSE are defined as 1L and 0L, but we want 1 and 0.
+ */
+#undef TRUE
+#define TRUE (1)
+#undef FALSE
+#define FALSE (0)
+
+#if !defined(AZTEC_C) && !defined(__AROS__)
+static long dos_packet __ARGS((struct MsgPort *, long, long));
+#endif
+static int lock2name __ARGS((BPTR lock, char_u *buf, long len));
+static void out_num __ARGS((long n));
+static struct FileInfoBlock *get_fib __ARGS((char_u *));
+static int sortcmp __ARGS((const void *a, const void *b));
+
+static BPTR raw_in = (BPTR)NULL;
+static BPTR raw_out = (BPTR)NULL;
+static int close_win = FALSE; /* set if Vim opened the window */
+
+struct IntuitionBase *IntuitionBase = NULL;
+#ifdef FEAT_ARP
+struct ArpBase *ArpBase = NULL;
+#endif
+
+static struct Window *wb_window;
+static char_u *oldwindowtitle = NULL;
+
+#ifdef FEAT_ARP
+int dos2 = FALSE; /* Amiga DOS 2.0x or higher */
+#endif
+int size_set = FALSE; /* set to TRUE if window size was set */
+
+ void
+win_resize_on()
+{
+ OUT_STR_NF("\033[12{");
+}
+
+ void
+win_resize_off()
+{
+ OUT_STR_NF("\033[12}");
+}
+
+ void
+mch_write(p, len)
+ char_u *p;
+ int len;
+{
+ Write(raw_out, (char *)p, (long)len);
+}
+
+/*
+ * mch_inchar(): low level input funcion.
+ * Get a characters from the keyboard.
+ * If time == 0 do not wait for characters.
+ * If time == n wait a short time for characters.
+ * If time == -1 wait forever for characters.
+ *
+ * Return number of characters read.
+ */
+ int
+mch_inchar(buf, maxlen, time, tb_change_cnt)
+ char_u *buf;
+ int maxlen;
+ long time; /* milli seconds */
+ int tb_change_cnt;
+{
+ int len;
+ long utime;
+#ifdef FEAT_AUTOCMD
+ static int once_already = 0;
+#endif
+
+ if (time >= 0)
+ {
+ if (time == 0)
+ utime = 100L; /* time = 0 causes problems in DOS 1.2 */
+ else
+ utime = time * 1000L; /* convert from milli to micro secs */
+ if (WaitForChar(raw_in, utime) == 0) /* no character available */
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return 0;
+ }
+ }
+ else /* time == -1 */
+ {
+#ifdef FEAT_AUTOCMD
+ if (once_already == 2)
+ updatescript(0);
+ else if (once_already == 1)
+ {
+ setcursor();
+ once_already = 2;
+ return 0;
+ }
+ else
+#endif
+ /*
+ * If there is no character available within 2 seconds (default)
+ * write the autoscript file to disk
+ */
+ if (WaitForChar(raw_in, p_ut * 1000L) == 0)
+ {
+#ifdef FEAT_AUTOCMD
+ if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
+ {
+ apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
+ update_screen(VALID);
+ once_already = 1;
+ return 0;
+ }
+ else
+#endif
+ updatescript(0);
+ }
+ }
+
+ for (;;) /* repeat until we got a character */
+ {
+# ifdef FEAT_MBYTE
+ len = Read(raw_in, (char *)buf, (long)maxlen / input_conv.vc_factor);
+# else
+ len = Read(raw_in, (char *)buf, (long)maxlen);
+# endif
+ if (len > 0)
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+#ifdef FEAT_MBYTE
+ /* Convert from 'termencoding' to 'encoding'. */
+ if (input_conv.vc_type != CONV_NONE)
+ len = convert_input(buf, len, maxlen);
+#endif
+ return len;
+ }
+ }
+}
+
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail()
+{
+ return (WaitForChar(raw_in, 100L) != 0);
+}
+
+/*
+ * Return amount of memory still available.
+ */
+ long_u
+mch_avail_mem(special)
+ int special;
+{
+ return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY);
+}
+
+ void
+mch_delay(msec, ignoreinput)
+ long msec;
+ int ignoreinput;
+{
+#ifndef LATTICE /* SAS declares void Delay(UNLONG) */
+ void Delay __ARGS((long));
+#endif
+
+ if (msec > 0)
+ {
+ if (ignoreinput)
+ Delay(msec / 20L); /* Delay works with 20 msec intervals */
+ else
+ WaitForChar(raw_in, msec * 1000L);
+ }
+}
+
+/*
+ * We have no job control, fake it by starting a new shell.
+ */
+ void
+mch_suspend()
+{
+ suspend_shell();
+}
+
+#ifndef DOS_LIBRARY
+# define DOS_LIBRARY ((UBYTE *)"dos.library")
+#endif
+
+ void
+mch_init()
+{
+ static char intlibname[] = "intuition.library";
+
+#ifdef AZTEC_C
+ Enable_Abort = 0; /* disallow vim to be aborted */
+#endif
+ Columns = 80;
+ Rows = 24;
+
+ /*
+ * Set input and output channels, unless we have opened our own window
+ */
+ if (raw_in == (BPTR)NULL)
+ {
+ raw_in = Input();
+ raw_out = Output();
+ /*
+ * If Input() is not interactive, then Output() will be (because of
+ * check in mch_check_win()). Used for "Vim -".
+ * Also check the other way around, for "Vim -h | more".
+ */
+ if (!IsInteractive(raw_in))
+ raw_in = raw_out;
+ else if (!IsInteractive(raw_out))
+ raw_out = raw_in;
+ }
+
+ out_flush();
+
+ wb_window = NULL;
+ if ((IntuitionBase = (struct IntuitionBase *)
+ OpenLibrary((UBYTE *)intlibname, 0L)) == NULL)
+ {
+ mch_errmsg(_("cannot open "));
+ mch_errmsg(intlibname);
+ mch_errmsg("!?\n");
+ mch_exit(3);
+ }
+}
+
+#include <workbench/startup.h>
+
+/*
+ * Check_win checks whether we have an interactive window.
+ * If not, a new window is opened with the newcli command.
+ * If we would open a window ourselves, the :sh and :! commands would not
+ * work properly (Why? probably because we are then running in a background
+ * CLI). This also is the best way to assure proper working in a next
+ * Workbench release.
+ *
+ * For the -f option (foreground mode) we open our own window and disable :sh.
+ * Otherwise the calling program would never know when editing is finished.
+ */
+#define BUF2SIZE 320 /* length of buffer for argument with complete path */
+
+ int
+mch_check_win(argc, argv)
+ int argc;
+ char **argv;
+{
+ int i;
+ BPTR nilfh, fh;
+ char_u buf1[20];
+ char_u buf2[BUF2SIZE];
+ static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
+ (char_u *)"con:0/0/640/200/",
+ (char_u *)"con:0/0/320/200/"};
+ static char_u *winerr = (char_u *)N_("VIM: Can't open window!\n");
+ struct WBArg *argp;
+ int ac;
+ char *av;
+ char_u *device = NULL;
+ int exitval = 4;
+ struct Library *DosBase;
+ int usewin = FALSE;
+
+/*
+ * check if we are running under DOS 2.0x or higher
+ */
+ DosBase = OpenLibrary(DOS_LIBRARY, 37L);
+ if (DosBase != NULL)
+ /* if (((struct Library *)DOSBase)->lib_Version >= 37) */
+ {
+ CloseLibrary(DosBase);
+#ifdef FEAT_ARP
+ dos2 = TRUE;
+#endif
+ }
+ else /* without arp functions we NEED 2.0 */
+ {
+#ifndef FEAT_ARP
+ mch_errmsg(_("Need Amigados version 2.04 or later\n"));
+ exit(3);
+#else
+ /* need arp functions for dos 1.x */
+ if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
+ {
+ fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
+ exit(3);
+ }
+#endif
+ }
+
+ /*
+ * scan argv[] for the "-f" and "-d" arguments
+ */
+ for (i = 1; i < argc; ++i)
+ if (argv[i][0] == '-')
+ {
+ switch (argv[i][1])
+ {
+ case 'f':
+ usewin = TRUE;
+ break;
+
+ case 'd':
+ if (i < argc - 1
+#ifdef FEAT_DIFF
+ /* require using "-dev", "-d" means diff mode */
+ && argv[i][2] == 'e' && argv[i][3] == 'v'
+#endif
+ )
+ device = (char_u *)argv[i + 1];
+ break;
+ }
+ }
+
+/*
+ * If we were not started from workbench, do not have a "-d" or "-dev"
+ * argument and we have been started with an interactive window, use that
+ * window.
+ */
+ if (argc != 0
+ && device == NULL
+ && (IsInteractive(Input()) || IsInteractive(Output())))
+ return OK;
+
+/*
+ * When given the "-f" argument, we open our own window. We can't use the
+ * newcli trick below, because the calling program (mail, rn, etc.) would not
+ * know when we are finished.
+ */
+ if (usewin)
+ {
+ /*
+ * Try to open a window. First try the specified device.
+ * Then try a 24 line 80 column window.
+ * If that fails, try two smaller ones.
+ */
+ for (i = -1; i < 3; ++i)
+ {
+ if (i >= 0)
+ device = constrings[i];
+ if (device != NULL && (raw_in = Open((UBYTE *)device,
+ (long)MODE_NEWFILE)) != (BPTR)NULL)
+ break;
+ }
+ if (raw_in == (BPTR)NULL) /* all three failed */
+ {
+ mch_errmsg(_(winerr));
+ goto exit;
+ }
+ raw_out = raw_in;
+ close_win = TRUE;
+ return OK;
+ }
+
+ if ((nilfh = Open((UBYTE *)"NIL:", (long)MODE_NEWFILE)) == (BPTR)NULL)
+ {
+ mch_errmsg(_("Cannot open NIL:\n"));
+ goto exit;
+ }
+
+ /*
+ * Make a unique name for the temp file (which we will not delete!).
+ * Use a pointer on the stack (nobody else will be using it).
+ */
+ sprintf((char *)buf1, "t:nc%ld", (long)buf1);
+ if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
+ {
+ mch_errmsg(_("Cannot create "));
+ mch_errmsg((char *)buf1);
+ mch_errmsg("\n");
+ goto exit;
+ }
+ /*
+ * Write the command into the file, put quotes around the arguments that
+ * have a space in them.
+ */
+ if (argc == 0) /* run from workbench */
+ ac = ((struct WBStartup *)argv)->sm_NumArgs;
+ else
+ ac = argc;
+ for (i = 0; i < ac; ++i)
+ {
+ if (argc == 0)
+ {
+ *buf2 = NUL;
+ argp = &(((struct WBStartup *)argv)->sm_ArgList[i]);
+ if (argp->wa_Lock)
+ (void)lock2name(argp->wa_Lock, buf2, (long)(BUF2SIZE - 1));
+#ifdef FEAT_ARP
+ if (dos2) /* use 2.0 function */
+#endif
+ AddPart((UBYTE *)buf2, (UBYTE *)argp->wa_Name, (long)(BUF2SIZE - 1));
+#ifdef FEAT_ARP
+ else /* use arp function */
+ TackOn((char *)buf2, argp->wa_Name);
+#endif
+ av = (char *)buf2;
+ }
+ else
+ av = argv[i];
+
+ /* skip '-d' or "-dev" option */
+ if (av[0] == '-' && av[1] == 'd'
+#ifdef FEAT_DIFF
+ && av[2] == 'e' && av[3] == 'v'
+#endif
+ )
+ {
+ ++i;
+ continue;
+ }
+ if (vim_strchr((char_u *)av, ' '))
+ Write(fh, "\"", 1L);
+ Write(fh, av, (long)strlen(av));
+ if (vim_strchr((char_u *)av, ' '))
+ Write(fh, "\"", 1L);
+ Write(fh, " ", 1L);
+ }
+ Write(fh, "\nendcli\n", 8L);
+ Close(fh);
+
+/*
+ * Try to open a new cli in a window. If "-d" or "-dev" argument was given try
+ * to open the specified device. Then try a 24 line 80 column window. If that
+ * fails, try two smaller ones.
+ */
+ for (i = -1; i < 3; ++i)
+ {
+ if (i >= 0)
+ device = constrings[i];
+ else if (device == NULL)
+ continue;
+ sprintf((char *)buf2, "newcli <nil: >nil: %s from %s", (char *)device, (char *)buf1);
+#ifdef FEAT_ARP
+ if (dos2)
+ {
+#endif
+ if (!SystemTags((UBYTE *)buf2, SYS_UserShell, TRUE, TAG_DONE))
+ break;
+#ifdef FEAT_ARP
+ }
+ else
+ {
+ if (Execute((UBYTE *)buf2, nilfh, nilfh))
+ break;
+ }
+#endif
+ }
+ if (i == 3) /* all three failed */
+ {
+ DeleteFile((UBYTE *)buf1);
+ mch_errmsg(_(winerr));
+ goto exit;
+ }
+ exitval = 0; /* The Execute succeeded: exit this program */
+
+exit:
+#ifdef FEAT_ARP
+ if (ArpBase)
+ CloseLibrary((struct Library *) ArpBase);
+#endif
+ exit(exitval);
+ /* NOTREACHED */
+ return FAIL;
+}
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ * We fake there is a window, because we can always open one!
+ */
+ int
+mch_input_isatty()
+{
+ return TRUE;
+}
+
+/*
+ * fname_case(): Set the case of the file name, if it already exists.
+ * This will cause the file name to remain exactly the same.
+ */
+/*ARGSUSED*/
+ void
+fname_case(name, len)
+ char_u *name;
+ int len; /* buffer size, ignored here */
+{
+ struct FileInfoBlock *fib;
+ size_t flen;
+
+ fib = get_fib(name);
+ if (fib != NULL)
+ {
+ flen = STRLEN(name);
+ if (flen == strlen(fib->fib_FileName)) /* safety check */
+ mch_memmove(name, fib->fib_FileName, flen);
+ vim_free(fib);
+ }
+}
+
+/*
+ * Get the FileInfoBlock for file "fname"
+ * The returned structure has to be free()d.
+ * Returns NULL on error.
+ */
+ static struct FileInfoBlock *
+get_fib(fname)
+ char_u *fname;
+{
+ BPTR flock;
+ struct FileInfoBlock *fib;
+
+ if (fname == NULL) /* safety check */
+ return NULL;
+ fib = (struct FileInfoBlock *)malloc(sizeof(struct FileInfoBlock));
+ if (fib != NULL)
+ {
+ flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
+ if (flock == (BPTR)NULL || !Examine(flock, fib))
+ {
+ vim_free(fib); /* in case of an error the memory is freed here */
+ fib = NULL;
+ }
+ if (flock)
+ UnLock(flock);
+ }
+ return fib;
+}
+
+#ifdef FEAT_TITLE
+/*
+ * set the title of our window
+ * icon name is not set
+ */
+ void
+mch_settitle(title, icon)
+ char_u *title;
+ char_u *icon;
+{
+ if (wb_window != NULL && title != NULL)
+ SetWindowTitles(wb_window, (UBYTE *)title, (UBYTE *)-1L);
+}
+
+/*
+ * Restore the window/icon title.
+ * which is one of:
+ * 1 Just restore title
+ * 2 Just restore icon (which we don't have)
+ * 3 Restore title and icon (which we don't have)
+ */
+ void
+mch_restore_title(which)
+ int which;
+{
+ if (which & 1)
+ mch_settitle(oldwindowtitle, NULL);
+}
+
+ int
+mch_can_restore_title()
+{
+ return (wb_window != NULL);
+}
+
+ int
+mch_can_restore_icon()
+{
+ return FALSE;
+}
+#endif
+
+/*
+ * Insert user name in s[len].
+ */
+ int
+mch_get_user_name(s, len)
+ char_u *s;
+ int len;
+{
+ *s = NUL;
+ return FAIL;
+}
+
+/*
+ * Insert host name is s[len].
+ */
+ void
+mch_get_host_name(s, len)
+ char_u *s;
+ int len;
+{
+ STRNCPY(s, "Amiga", len);
+}
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ return (long)0;
+}
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(buf, len)
+ char_u *buf;
+ int len;
+{
+ return mch_FullName((char_u *)"", buf, len, FALSE);
+}
+
+/*
+ * get absolute file name into buffer 'buf' of length 'len' bytes
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_FullName(fname, buf, len, force)
+ char_u *fname, *buf;
+ int len;
+ int force;
+{
+ BPTR l;
+ int retval = FAIL;
+ int i;
+
+ /* Lock the file. If it exists, we can get the exact name. */
+ if ((l = Lock((UBYTE *)fname, (long)ACCESS_READ)) != (BPTR)0)
+ {
+ retval = lock2name(l, buf, (long)len - 1);
+ UnLock(l);
+ }
+ else if (force || !mch_isFullName(fname)) /* not a full path yet */
+ {
+ /*
+ * If the file cannot be locked (doesn't exist), try to lock the
+ * current directory and concatenate the file name.
+ */
+ if ((l = Lock((UBYTE *)"", (long)ACCESS_READ)) != (BPTR)NULL)
+ {
+ retval = lock2name(l, buf, (long)len);
+ UnLock(l);
+ if (retval == OK)
+ {
+ i = STRLEN(buf);
+ /* Concatenate the fname to the directory. Don't add a slash
+ * if fname is empty, but do change "" to "/". */
+ if (i == 0 || *fname != NUL)
+ {
+ if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
+ buf[i++] = '/';
+ STRNCPY(buf + i, fname, len - i);
+ }
+ }
+ }
+ }
+ if (*buf == 0 || *buf == ':')
+ retval = FAIL; /* something failed; use the file name */
+ return retval;
+}
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(fname)
+ char_u *fname;
+{
+ return (vim_strchr(fname, ':') != NULL && *fname != ':');
+}
+
+/*
+ * Get the full file name from a lock. Use 2.0 function if possible, because
+ * the arp function has more restrictions on the path length.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ static int
+lock2name(lock, buf, len)
+ BPTR lock;
+ char_u *buf;
+ long len;
+{
+#ifdef FEAT_ARP
+ if (dos2) /* use 2.0 function */
+#endif
+ return ((int)NameFromLock(lock, (UBYTE *)buf, len) ? OK : FAIL);
+#ifdef FEAT_ARP
+ else /* use arp function */
+ return ((int)PathName(lock, (char *)buf, (long)(len/32)) ? OK : FAIL);
+#endif
+}
+
+/*
+ * get file permissions for 'name'
+ * Returns -1 when it doesn't exist.
+ */
+ long
+mch_getperm(name)
+ char_u *name;
+{
+ struct FileInfoBlock *fib;
+ long retval = -1;
+
+ fib = get_fib(name);
+ if (fib != NULL)
+ {
+ retval = fib->fib_Protection;
+ vim_free(fib);
+ }
+ return retval;
+}
+
+/*
+ * set file permission for 'name' to 'perm'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_setperm(name, perm)
+ char_u *name;
+ long perm;
+{
+ perm &= ~FIBF_ARCHIVE; /* reset archived bit */
+ return (SetProtection((UBYTE *)name, (long)perm) ? OK : FAIL);
+}
+
+/*
+ * Set hidden flag for "name".
+ */
+ void
+mch_hide(name)
+ char_u *name;
+{
+ /* can't hide a file */
+}
+
+/*
+ * return FALSE if "name" is not a directory
+ * return TRUE if "name" is a directory.
+ * return FALSE for error.
+ */
+ int
+mch_isdir(name)
+ char_u *name;
+{
+ struct FileInfoBlock *fib;
+ int retval = FALSE;
+
+ fib = get_fib(name);
+ if (fib != NULL)
+ {
+ retval = ((fib->fib_DirEntryType >= 0) ? TRUE : FALSE);
+ vim_free(fib);
+ }
+ return retval;
+}
+
+/*
+ * Create directory "name".
+ */
+ void
+mch_mkdir(name)
+ char_u *name;
+{
+ BPTR lock;
+
+ lock = CreateDir(name);
+ if (lock != NULL)
+ UnLock(lock);
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return 1 if "name" can be executed, 0 if not.
+ * Return -1 if unknown.
+ */
+ int
+mch_can_exe(name)
+ char_u *name;
+{
+ /* TODO */
+ return -1;
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(name)
+ char_u *name;
+{
+ /* TODO */
+ return NODE_NORMAL;
+}
+
+ void
+mch_early_init()
+{
+}
+
+/*
+ * Careful: mch_exit() may be called before mch_init()!
+ */
+ void
+mch_exit(r)
+ int r;
+{
+ if (raw_in) /* put terminal in 'normal' mode */
+ {
+ settmode(TMODE_COOK);
+ stoptermcap();
+ }
+ out_char('\n');
+ if (raw_out)
+ {
+ if (term_console)
+ {
+ win_resize_off(); /* window resize events de-activated */
+ if (size_set)
+ OUT_STR("\233t\233u"); /* reset window size (CSI t CSI u) */
+ }
+ out_flush();
+ }
+
+#ifdef FEAT_TITLE
+ mch_restore_title(3); /* restore window title */
+#endif
+
+ ml_close_all(TRUE); /* remove all memfiles */
+
+#ifdef FEAT_ARP
+ if (ArpBase)
+ CloseLibrary((struct Library *) ArpBase);
+#endif
+ if (close_win)
+ Close(raw_in);
+ if (r)
+ printf(_("Vim exiting with %d\n"), r); /* somehow this makes :cq work!? */
+ exit(r);
+}
+
+/*
+ * This is a routine for setting a given stream to raw or cooked mode on the
+ * Amiga . This is useful when you are using Lattice C to produce programs
+ * that want to read single characters with the "getch()" or "fgetc" call.
+ *
+ * Written : 18-Jun-87 By Chuck McManis.
+ */
+
+#define MP(xx) ((struct MsgPort *)((struct FileHandle *) (BADDR(xx)))->fh_Type)
+
+/*
+ * Function mch_settmode() - Convert the specified file pointer to 'raw' or
+ * 'cooked' mode. This only works on TTY's.
+ *
+ * Raw: keeps DOS from translating keys for you, also (BIG WIN) it means
+ * getch() will return immediately rather than wait for a return. You
+ * lose editing features though.
+ *
+ * Cooked: This function returns the designate file pointer to it's normal,
+ * wait for a <CR> mode. This is exactly like raw() except that
+ * it sends a 0 to the console to make it back into a CON: from a RAW:
+ */
+ void
+mch_settmode(tmode)
+ int tmode;
+{
+#ifdef __AROS__
+ if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
+#else
+ if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
+ tmode == TMODE_RAW ? -1L : 0L) == 0)
+#endif
+ mch_errmsg(_("cannot change console mode ?!\n"));
+}
+
+/*
+ * set screen mode, always fails.
+ */
+ int
+mch_screenmode(arg)
+ char_u *arg;
+{
+ EMSG(_(e_screenmode));
+ return FAIL;
+}
+
+/*
+ * Code for this routine came from the following :
+ *
+ * ConPackets.c - C. Scheppner, A. Finkel, P. Lindsay CBM
+ * DOS packet example
+ * Requires 1.2
+ *
+ * Found on Fish Disk 56.
+ *
+ * Heavely modified by mool.
+ */
+
+#include <devices/conunit.h>
+
+/*
+ * try to get the real window size
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_get_shellsize()
+{
+ struct ConUnit *conUnit;
+ char id_a[sizeof(struct InfoData) + 3];
+ struct InfoData *id;
+
+ if (!term_console) /* not an amiga window */
+ return FAIL;
+
+ /* insure longword alignment */
+ id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
+
+ /*
+ * Should make console aware of real window size, not the one we set.
+ * Unfortunately, under DOS 2.0x this redraws the window and it
+ * is rarely needed, so we skip it now, unless we changed the size.
+ */
+ if (size_set)
+ OUT_STR("\233t\233u"); /* CSI t CSI u */
+ out_flush();
+
+#ifdef __AROS__
+ if (!Info(raw_out, id)
+ || (wb_window = (struct Window *) id->id_VolumeNode) == NULL)
+#else
+ if (dos_packet(MP(raw_out), (long)ACTION_DISK_INFO, ((ULONG) id) >> 2) == 0
+ || (wb_window = (struct Window *)id->id_VolumeNode) == NULL)
+#endif
+ {
+ /* it's not an amiga window, maybe aux device */
+ /* terminal type should be set */
+ term_console = FALSE;
+ return FAIL;
+ }
+ if (oldwindowtitle == NULL)
+ oldwindowtitle = (char_u *)wb_window->Title;
+ if (id->id_InUse == (BPTR)NULL)
+ {
+ mch_errmsg(_("mch_get_shellsize: not a console??\n"));
+ return FAIL;
+ }
+ conUnit = (struct ConUnit *) ((struct IOStdReq *) id->id_InUse)->io_Unit;
+
+ /* get window size */
+ Rows = conUnit->cu_YMax + 1;
+ Columns = conUnit->cu_XMax + 1;
+ if (Rows < 0 || Rows > 200) /* cannot be an amiga window */
+ {
+ Columns = 80;
+ Rows = 24;
+ term_console = FALSE;
+ return FAIL;
+ }
+
+ return OK;
+}
+
+/*
+ * Try to set the real window size to Rows and Columns.
+ */
+ void
+mch_set_shellsize()
+{
+ if (term_console)
+ {
+ size_set = TRUE;
+ out_char(CSI);
+ out_num((long)Rows);
+ out_char('t');
+ out_char(CSI);
+ out_num((long)Columns);
+ out_char('u');
+ out_flush();
+ }
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize()
+{
+ /* Nothing to do. */
+}
+
+/*
+ * out_num - output a (big) number fast
+ */
+ static void
+out_num(n)
+ long n;
+{
+ OUT_STR_NF(tltoa((unsigned long)n));
+}
+
+#if !defined(AZTEC_C) && !defined(__AROS__)
+/*
+ * Sendpacket.c
+ *
+ * An invaluable addition to your Amiga.lib file. This code sends a packet to
+ * the given message port. This makes working around DOS lots easier.
+ *
+ * Note, I didn't write this, those wonderful folks at CBM did. I do suggest
+ * however that you may wish to add it to Amiga.Lib, to do so, compile it and
+ * say 'oml lib:amiga.lib -r sendpacket.o'
+ */
+
+/* #include <proto/exec.h> */
+/* #include <proto/dos.h> */
+#include <exec/memory.h>
+
+/*
+ * Function - dos_packet written by Phil Lindsay, Carolyn Scheppner, and Andy
+ * Finkel. This function will send a packet of the given type to the Message
+ * Port supplied.
+ */
+
+ static long
+dos_packet(pid, action, arg)
+ struct MsgPort *pid; /* process indentifier ... (handlers message port) */
+ long action, /* packet type ... (what you want handler to do) */
+ arg; /* single argument */
+{
+# ifdef FEAT_ARP
+ struct MsgPort *replyport;
+ struct StandardPacket *packet;
+ long res1;
+
+ if (dos2)
+# endif
+ return DoPkt(pid, action, arg, 0L, 0L, 0L, 0L); /* use 2.0 function */
+# ifdef FEAT_ARP
+
+ replyport = (struct MsgPort *) CreatePort(NULL, 0); /* use arp function */
+ if (!replyport)
+ return (0);
+
+ /* Allocate space for a packet, make it public and clear it */
+ packet = (struct StandardPacket *)
+ AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR);
+ if (!packet) {
+ DeletePort(replyport);
+ return (0);
+ }
+ packet->sp_Msg.mn_Node.ln_Name = (char *) &(packet->sp_Pkt);
+ packet->sp_Pkt.dp_Link = &(packet->sp_Msg);
+ packet->sp_Pkt.dp_Port = replyport;
+ packet->sp_Pkt.dp_Type = action;
+ packet->sp_Pkt.dp_Arg1 = arg;
+
+ PutMsg(pid, (struct Message *)packet); /* send packet */
+
+ WaitPort(replyport);
+ GetMsg(replyport);
+
+ res1 = packet->sp_Pkt.dp_Res1;
+
+ FreeMem(packet, (long) sizeof(struct StandardPacket));
+ DeletePort(replyport);
+
+ return (res1);
+# endif
+}
+#endif /* !defined(AZTEC_C) && !defined(__AROS__) */
+
+/*
+ * Call shell.
+ * Return error number for failure, 0 otherwise
+ */
+ int
+mch_call_shell(cmd, options)
+ char_u *cmd;
+ int options; /* SHELL_*, see vim.h */
+{
+ BPTR mydir;
+ int x;
+ int tmode = cur_tmode;
+#ifdef AZTEC_C
+ int use_execute;
+ char_u *shellcmd = NULL;
+ char_u *shellarg;
+#endif
+ int retval = 0;
+
+ if (close_win)
+ {
+ /* if Vim opened a window: Executing a shell may cause crashes */
+ EMSG(_("E360: Cannot execute shell with -f option"));
+ return -1;
+ }
+
+ if (term_console)
+ win_resize_off(); /* window resize events de-activated */
+ out_flush();
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+ mydir = Lock((UBYTE *)"", (long)ACCESS_READ); /* remember current dir */
+
+#if !defined(AZTEC_C) /* not tested very much */
+ if (cmd == NULL)
+ {
+# ifdef FEAT_ARP
+ if (dos2)
+# endif
+ x = SystemTags(p_sh, SYS_UserShell, TRUE, TAG_DONE);
+# ifdef FEAT_ARP
+ else
+ x = Execute(p_sh, raw_in, raw_out);
+# endif
+ }
+ else
+ {
+# ifdef FEAT_ARP
+ if (dos2)
+# endif
+ x = SystemTags((char *)cmd, SYS_UserShell, TRUE, TAG_DONE);
+# ifdef FEAT_ARP
+ else
+ x = Execute((char *)cmd, 0L, raw_out);
+# endif
+ }
+# ifdef FEAT_ARP
+ if ((dos2 && x < 0) || (!dos2 && !x))
+# else
+ if (x < 0)
+# endif
+ {
+ MSG_PUTS(_("Cannot execute "));
+ if (cmd == NULL)
+ {
+ MSG_PUTS(_("shell "));
+ msg_outtrans(p_sh);
+ }
+ else
+ msg_outtrans(cmd);
+ msg_putchar('\n');
+ retval = -1;
+ }
+# ifdef FEAT_ARP
+ else if (!dos2 || x)
+# else
+ else if (x)
+# endif
+ {
+ if ((x = IoErr()) != 0)
+ {
+ if (!(options & SHELL_SILENT))
+ {
+ msg_putchar('\n');
+ msg_outnum((long)x);
+ MSG_PUTS(_(" returned\n"));
+ }
+ retval = x;
+ }
+ }
+#else /* else part is for AZTEC_C */
+ if (p_st >= 4 || (p_st >= 2 && !(options & SHELL_FILTER)))
+ use_execute = 1;
+ else
+ use_execute = 0;
+ if (!use_execute)
+ {
+ /*
+ * separate shell name from argument
+ */
+ shellcmd = vim_strsave(p_sh);
+ if (shellcmd == NULL) /* out of memory, use Execute */
+ use_execute = 1;
+ else
+ {
+ shellarg = skiptowhite(shellcmd); /* find start of arguments */
+ if (*shellarg != NUL)
+ {
+ *shellarg++ = NUL;
+ shellarg = skipwhite(shellarg);
+ }
+ }
+ }
+ if (cmd == NULL)
+ {
+ if (use_execute)
+ {
+# ifdef FEAT_ARP
+ if (dos2)
+# endif
+ x = SystemTags((UBYTE *)p_sh, SYS_UserShell, TRUE, TAG_DONE);
+# ifdef FEAT_ARP
+ else
+ x = !Execute((UBYTE *)p_sh, raw_in, raw_out);
+# endif
+ }
+ else
+ x = fexecl((char *)shellcmd, (char *)shellcmd, (char *)shellarg, NULL);
+ }
+ else if (use_execute)
+ {
+# ifdef FEAT_ARP
+ if (dos2)
+# endif
+ x = SystemTags((UBYTE *)cmd, SYS_UserShell, TRUE, TAG_DONE);
+# ifdef FEAT_ARP
+ else
+ x = !Execute((UBYTE *)cmd, 0L, raw_out);
+# endif
+ }
+ else if (p_st & 1)
+ x = fexecl((char *)shellcmd, (char *)shellcmd, (char *)shellarg,
+ (char *)cmd, NULL);
+ else
+ x = fexecl((char *)shellcmd, (char *)shellcmd, (char *)shellarg,
+ (char *)p_shcf, (char *)cmd, NULL);
+# ifdef FEAT_ARP
+ if ((dos2 && x < 0) || (!dos2 && x))
+# else
+ if (x < 0)
+# endif
+ {
+ MSG_PUTS(_("Cannot execute "));
+ if (use_execute)
+ {
+ if (cmd == NULL)
+ msg_outtrans(p_sh);
+ else
+ msg_outtrans(cmd);
+ }
+ else
+ {
+ MSG_PUTS(_("shell "));
+ msg_outtrans(shellcmd);
+ }
+ msg_putchar('\n');
+ retval = -1;
+ }
+ else
+ {
+ if (use_execute)
+ {
+# ifdef FEAT_ARP
+ if (!dos2 || x)
+# else
+ if (x)
+# endif
+ x = IoErr();
+ }
+ else
+ x = wait();
+ if (x)
+ {
+ if (!(options & SHELL_SILENT) && !emsg_silent)
+ {
+ msg_putchar('\n');
+ msg_outnum((long)x);
+ MSG_PUTS(_(" returned\n"));
+ }
+ retval = x;
+ }
+ }
+ vim_free(shellcmd);
+#endif /* AZTEC_C */
+
+ if ((mydir = CurrentDir(mydir)) != 0) /* make sure we stay in the same directory */
+ UnLock(mydir);
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+#ifdef FEAT_TITLE
+ resettitle();
+#endif
+ if (term_console)
+ win_resize_on(); /* window resize events activated */
+ return retval;
+}
+
+/*
+ * check for an "interrupt signal"
+ * We only react to a CTRL-C, but also clear the other break signals to avoid
+ * trouble with lattice-c programs.
+ */
+ void
+mch_breakcheck()
+{
+ if (SetSignal(0L, (long)(SIGBREAKF_CTRL_C|SIGBREAKF_CTRL_D|SIGBREAKF_CTRL_E|SIGBREAKF_CTRL_F)) & SIGBREAKF_CTRL_C)
+ got_int = TRUE;
+}
+
+/* this routine causes manx to use this Chk_Abort() rather than it's own */
+/* otherwise it resets our ^C when doing any I/O (even when Enable_Abort */
+/* is zero). Since we want to check for our own ^C's */
+
+#ifdef _DCC
+#define Chk_Abort chkabort
+#endif
+
+#ifdef LATTICE
+void __regargs __chkabort(void);
+
+void __regargs __chkabort(void)
+{}
+
+#else
+ long
+Chk_Abort(void)
+{
+ return(0L);
+}
+#endif
+
+/*
+ * mch_expandpath() - this code does wild-card pattern matching using the arp
+ * routines.
+ *
+ * "pat" has backslashes before chars that are not to be expanded.
+ * Returns the number of matches found.
+ *
+ * This is based on WildDemo2.c (found in arp1.1 distribution).
+ * That code's copyright follows:
+ * Copyright (c) 1987, Scott Ballantyne
+ * Use and abuse as you please.
+ */
+
+#define ANCHOR_BUF_SIZE (512)
+#define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
+
+ int
+mch_expandpath(gap, pat, flags)
+ garray_T *gap;
+ char_u *pat;
+ int flags; /* EW_* flags */
+{
+ struct AnchorPath *Anchor;
+ LONG Result;
+ char_u *starbuf, *sp, *dp;
+ int start_len;
+ int matches;
+
+ start_len = gap->ga_len;
+
+ /* Get our AnchorBase */
+ Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
+ if (Anchor == NULL)
+ return 0;
+
+ Anchor->ap_Strlen = ANCHOR_BUF_SIZE; /* ap_Length not supported anymore */
+#ifdef APF_DODOT
+ Anchor->ap_Flags = APF_DODOT | APF_DOWILD; /* allow '.' for current dir */
+#else
+ Anchor->ap_Flags = APF_DoDot | APF_DoWild; /* allow '.' for current dir */
+#endif
+
+#ifdef FEAT_ARP
+ if (dos2)
+ {
+#endif
+ /* hack to replace '*' by '#?' */
+ starbuf = alloc((unsigned)(2 * STRLEN(pat) + 1));
+ if (starbuf == NULL)
+ goto Return;
+ for (sp = pat, dp = starbuf; *sp; ++sp)
+ {
+ if (*sp == '*')
+ {
+ *dp++ = '#';
+ *dp++ = '?';
+ }
+ else
+ *dp++ = *sp;
+ }
+ *dp = NUL;
+ Result = MatchFirst((UBYTE *)starbuf, Anchor);
+ vim_free(starbuf);
+#ifdef FEAT_ARP
+ }
+ else
+ Result = FindFirst((char *)pat, Anchor);
+#endif
+
+ /*
+ * Loop to get all matches.
+ */
+ while (Result == 0)
+ {
+ addfile(gap, (char_u *)Anchor->ap_Buf, flags);
+#ifdef FEAT_ARP
+ if (dos2)
+#endif
+ Result = MatchNext(Anchor);
+#ifdef FEAT_ARP
+ else
+ Result = FindNext(Anchor);
+#endif
+ }
+ matches = gap->ga_len - start_len;
+
+ if (Result == ERROR_BUFFER_OVERFLOW)
+ EMSG(_("ANCHOR_BUF_SIZE too small."));
+ else if (matches == 0 && Result != ERROR_OBJECT_NOT_FOUND
+ && Result != ERROR_DEVICE_NOT_MOUNTED
+ && Result != ERROR_NO_MORE_ENTRIES)
+ EMSG(_("I/O ERROR"));
+
+ /*
+ * Sort the files for this pattern.
+ */
+ if (matches)
+ qsort((void *)(((char_u **)gap->ga_data) + start_len),
+ (size_t)matches, sizeof(char_u *), sortcmp);
+
+ /* Free the wildcard stuff */
+#ifdef FEAT_ARP
+ if (dos2)
+#endif
+ MatchEnd(Anchor);
+#ifdef FEAT_ARP
+ else
+ FreeAnchorChain(Anchor);
+#endif
+
+Return:
+ vim_free(Anchor);
+
+ return matches;
+}
+
+ static int
+sortcmp(a, b)
+ const void *a, *b;
+{
+ char *s = *(char **)a;
+ char *t = *(char **)b;
+
+ return pathcmp(s, t);
+}
+
+/*
+ * Return TRUE if "p" has wildcards that can be expanded by mch_expandpath().
+ */
+ int
+mch_has_exp_wildcard(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ {
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ else if (vim_strchr((char_u *)"*?[(#", *p) != NULL)
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+ int
+mch_has_wildcard(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ {
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ else
+ if (vim_strchr((char_u *)
+# ifdef VIM_BACKTICK
+ "*?[(#$`"
+# else
+ "*?[(#$"
+# endif
+ , *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * With AmigaDOS 2.0 support for reading local environment variables
+ *
+ * Two buffers are allocated:
+ * - A big one to do the expansion into. It is freed before returning.
+ * - A small one to hold the return value. It is kept until the next call.
+ */
+ char_u *
+mch_getenv(var)
+ char_u *var;
+{
+ int len;
+ UBYTE *buf; /* buffer to expand in */
+ char_u *retval; /* return value */
+ static char_u *alloced = NULL; /* allocated memory */
+
+#ifdef FEAT_ARP
+ if (!dos2)
+ retval = (char_u *)getenv((char *)var);
+ else
+#endif
+ {
+ vim_free(alloced);
+ alloced = NULL;
+ retval = NULL;
+
+ buf = alloc(IOSIZE);
+ if (buf == NULL)
+ return NULL;
+
+ len = GetVar((UBYTE *)var, buf, (long)(IOSIZE - 1), (long)0);
+ if (len >= 0)
+ {
+ retval = vim_strsave((char_u *)buf);
+ alloced = retval;
+ }
+
+ vim_free(buf);
+ }
+
+ /* if $VIM is not defined, use "vim:" instead */
+ if (retval == NULL && STRCMP(var, "VIM") == 0)
+ retval = (char_u *)"vim:";
+
+ return retval;
+}
+
+/*
+ * Amiga version of setenv() with AmigaDOS 2.0 support.
+ */
+/* ARGSUSED */
+ int
+mch_setenv(var, value, x)
+ char *var;
+ char *value;
+ int x;
+{
+#ifdef FEAT_ARP
+ if (!dos2)
+ return setenv(var, value);
+#endif
+
+ if (SetVar((UBYTE *)var, (UBYTE *)value, (LONG)-1, (ULONG)GVF_LOCAL_ONLY))
+ return 0; /* success */
+ return -1; /* failure */
+}
diff --git a/src/os_amiga.h b/src/os_amiga.h
new file mode 100644
index 000000000..06e4d1cb9
--- /dev/null
+++ b/src/os_amiga.h
@@ -0,0 +1,201 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Amiga Machine-dependent things
+ */
+
+#define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
+#define SPACE_IN_FILENAME
+#define USE_FNAME_CASE /* adjust case of file names */
+#define USE_TERM_CONSOLE
+#define HAVE_AVAIL_MEM
+
+#ifndef HAVE_CONFIG_H
+# ifdef AZTEC_C
+# define HAVE_STAT_H
+# endif
+# define HAVE_STDLIB_H
+# define HAVE_STRING_H
+# define HAVE_FCNTL_H
+# define HAVE_STRCSPN
+# define HAVE_STRICMP
+# define HAVE_STRNICMP
+# define HAVE_STRFTIME /* guessed */
+# define HAVE_SETENV
+# define HAVE_MEMSET
+# define HAVE_QSORT
+# if defined(__DATE__) && defined(__TIME__)
+# define HAVE_DATE_TIME
+# endif
+
+#define DFLT_ERRORFILE "AztecC.Err"
+#define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
+
+#define BASENAMELEN 26 /* Amiga */
+
+#define TEMPNAME "t:v?XXXXXX"
+#define TEMPNAMELEN 12
+
+#endif /* HAVE_CONFIG_H */
+
+#include <exec/types.h>
+#include <libraries/dos.h>
+#include <libraries/dosextens.h>
+
+/* Currently, all Amiga compilers except AZTEC C have these... */
+#ifndef AZTEC_C
+# include <proto/exec.h>
+# include <proto/dos.h>
+# include <proto/intuition.h>
+#endif
+
+#define FNAME_ILLEGAL ";*?`#%" /* illegal characters in a file name */
+
+/*
+ * Manx doesn't have off_t, define it here.
+ */
+#ifdef AZTEC_C
+typedef long off_t;
+#endif
+
+#ifdef LATTICE
+# define USE_TMPNAM /* use tmpnam() instead of mktemp() */
+#endif
+
+#ifdef __GNUC__
+# include <sys/stat.h>
+# include <unistd.h>
+#endif
+
+/*
+ * arpbase.h must be included before functions.h
+ */
+#ifdef FEAT_ARP
+# include <libraries/arpbase.h>
+#endif
+
+/*
+ * This won't be needed if you have a version of Lattice 4.01 without broken
+ * break signal handling.
+ */
+#include <signal.h>
+
+/*
+ * Names for the EXRC, HELP and temporary files.
+ * Some of these may have been defined in the makefile.
+ */
+#ifndef SYS_VIMRC_FILE
+# define SYS_VIMRC_FILE "$VIM/vimrc"
+#endif
+#ifndef SYS_GVIMRC_FILE
+# define SYS_GVIMRC_FILE "$VIM/gvimrc"
+#endif
+#ifndef SYS_MENU_FILE
+# define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
+#endif
+#ifndef DFLT_HELPFILE
+# define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
+#endif
+#ifndef FILETYPE_FILE
+# define FILETYPE_FILE "filetype.vim"
+#endif
+#ifndef FTPLUGIN_FILE
+# define FTPLUGIN_FILE "ftplugin.vim"
+#endif
+#ifndef INDENT_FILE
+# define INDENT_FILE "indent.vim"
+#endif
+#ifndef FTOFF_FILE
+# define FTOFF_FILE "ftoff.vim"
+#endif
+#ifndef FTPLUGOF_FILE
+# define FTPLUGOF_FILE "ftplugof.vim"
+#endif
+#ifndef INDOFF_FILE
+# define INDOFF_FILE "indoff.vim"
+#endif
+#ifndef SYNTAX_FNAME
+# define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
+#endif
+
+#ifndef USR_EXRC_FILE
+# define USR_EXRC_FILE "s:.exrc"
+#endif
+#ifndef USR_EXRC_FILE2
+# define USR_EXRC_FILE2 "home:.exrc"
+#endif
+
+#ifndef USR_VIMRC_FILE
+# define USR_VIMRC_FILE "s:.vimrc"
+#endif
+#ifndef USR_VIMRC_FILE2
+# define USR_VIMRC_FILE2 "home:.vimrc"
+#endif
+#ifndef USR_VIMRC_FILE3
+# define USR_VIMRC_FILE3 "$VIM/.vimrc"
+#endif
+#ifndef EVIM_FILE
+# define EVIM_FILE "$VIMRUNTIME/evim.vim"
+#endif
+
+#ifndef USR_GVIMRC_FILE
+# define USR_GVIMRC_FILE "s:.gvimrc"
+#endif
+#ifndef USR_GVIMRC_FILE2
+# define USR_GVIMRC_FILE2 "home:.gvimrc"
+#endif
+#ifndef USR_GVIMRC_FILE3
+# define USR_GVIMRC_FILE3 "$VIM/.gvimrc"
+#endif
+
+#ifdef FEAT_VIMINFO
+#ifndef VIMINFO_FILE
+# define VIMINFO_FILE "s:.viminfo"
+#endif
+#endif /* FEAT_VIMINFO */
+
+#ifndef EXRC_FILE
+# define EXRC_FILE ".exrc"
+#endif
+
+#ifndef VIMRC_FILE
+# define VIMRC_FILE ".vimrc"
+#endif
+
+#ifndef GVIMRC_FILE
+# define GVIMRC_FILE ".gvimrc"
+#endif
+
+#ifndef DFLT_BDIR
+# define DFLT_BDIR ".,t:" /* default for 'backupdir' */
+#endif
+
+#ifndef DFLT_DIR
+# define DFLT_DIR ".,t:" /* default for 'directory' */
+#endif
+
+#ifndef DFLT_VDIR
+# define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */
+#endif
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
+#endif
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT 0 /* decide in set_init */
+#endif
+
+#if defined(SASC)
+int setenv(const char *, const char *);
+#endif
+
+#define mch_remove(x) remove((char *)(x))
+#define mch_rename(src, dst) rename(src, dst)
+#define mch_chdir(s) chdir(s)
+#define vim_mkdir(x, y) mch_mkdir(x)
diff --git a/src/os_beos.c b/src/os_beos.c
new file mode 100644
index 000000000..e492cab45
--- /dev/null
+++ b/src/os_beos.c
@@ -0,0 +1,206 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * BeBox port Copyright 1997 by Olaf Seibert.
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * os_beos.c Additional stuff for BeOS (rest is in os_unix.c)
+ */
+
+#include <float.h>
+#include <termios.h>
+#include <kernel/OS.h>
+#include "vim.h"
+
+#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
+
+#ifdef PROTO /* making prototypes on Unix */
+#define sem_id int
+#define thread_id int
+#endif
+
+char_u charbuf;
+signed char charcount;
+sem_id character_present;
+sem_id character_wanted;
+thread_id read_thread_id;
+
+#define TRY_ABORT 0 /* This code does not work so turn it off. */
+
+#if TRY_ABORT
+ static void
+mostly_ignore(int sig)
+{
+}
+#endif
+
+ static long
+read_thread(void *dummy)
+{
+ signal(SIGINT, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
+#if TRY_ABORT
+ signal(SIGUSR1, mostly_ignore);
+#endif
+
+ for (;;) {
+ if (acquire_sem(character_wanted) != B_NO_ERROR)
+ break;
+ charcount = read(read_cmd_fd, &charbuf, 1);
+ release_sem(character_present);
+ }
+
+ return 0;
+}
+
+ void
+beos_cleanup_read_thread(void)
+{
+ if (character_present > 0)
+ delete_sem(character_present);
+ character_present = 0;
+ if (read_thread_id > 0)
+ kill_thread(read_thread_id);
+ read_thread_id = 0;
+}
+
+#endif
+
+/*
+ * select() emulation. Hopefully, in DR9 there will be something
+ * useful supplied by the system. ... Alas, not. Not in AAPR, nor
+ * in PR or even PR2... R3 then maybe? I don't think so!
+ */
+
+ int
+beos_select(int nbits,
+ struct fd_set *rbits,
+ struct fd_set *wbits,
+ struct fd_set *ebits,
+ struct timeval *timeout)
+{
+ bigtime_t tmo;
+
+ if (nbits == 0) {
+ /* select is purely being used for delay */
+ snooze(timeout->tv_sec * 1e6 + timeout->tv_usec);
+ return 0;
+ }
+#if 0
+ /*
+ * This does not seem to work either. Reads here are not supposed to
+ * block indefinitely, yet they do. This is most annoying.
+ */
+ if (FD_ISSET(0, rbits)) {
+ char cbuf[1];
+ int count;
+ struct termios told;
+ struct termios tnew;
+ tcgetattr(0, &told);
+ tnew = told;
+ tnew.c_lflag &= ~ICANON;
+ tnew.c_cc[VMIN] = 0;
+ tnew.c_cc[VTIME] = timeout->tv_sec * 10 + timeout->tv_usec / 100000;
+ tcsetattr(0, TCSANOW, &tnew);
+
+ count = read(0, &cbuf, sizeof(cbuf));
+ tcsetattr(0, TCSANOW, &told);
+ if (count > 0) {
+ add_to_input_buf(&cbuf[0], count);
+ return 1;
+ }
+ return 0;
+ }
+#endif
+#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
+ /*
+ * Check if the operation is really on stdin...
+ */
+ if (FD_ISSET(read_cmd_fd, rbits))
+ {
+ int acquired;
+
+ /*
+ * Is this the first time through?
+ * Then start up the thread and initialise the semaphores.
+ */
+ if (character_present == 0) {
+ character_present = create_sem(0, "vim character_present");
+ character_wanted = create_sem(1, "vim character_wanted");
+ read_thread_id = spawn_thread(read_thread, "vim async read",
+ B_NORMAL_PRIORITY, NULL);
+ atexit(beos_cleanup_read_thread);
+ resume_thread(read_thread_id);
+ }
+
+ /* timeout == NULL means "indefinitely" */
+ if (timeout) {
+ tmo = timeout->tv_sec * 1e6 + timeout->tv_usec;
+ /* 0 means "don't wait, which is impossible to do exactly. */
+ if (tmo == 0)
+ tmo = 1.0;
+ }
+#if TRY_ABORT
+ release_sem(character_wanted);
+#endif
+ if (timeout)
+ acquired = acquire_sem_etc(character_present, 1, B_TIMEOUT, tmo);
+ else
+ acquired = acquire_sem(character_present);
+ if (acquired == B_NO_ERROR) {
+ if (charcount > 0) {
+ add_to_input_buf(&charbuf, 1);
+#if !TRY_ABORT
+ release_sem(character_wanted);
+#endif
+
+ return 1;
+ } else {
+#if !TRY_ABORT
+ release_sem(character_wanted);
+#endif
+
+ return 0;
+ }
+ }
+#if TRY_ABORT
+ else {
+ /*
+ * Timeout occurred. Break the read() call by sending
+ * a signal. Problem: it may be just read()ing it now.
+ * Therefore we still have to finish the handshake with
+ * the thread and maybe remember the character.
+ */
+ kill(read_thread_id, SIGUSR1);
+ /*
+ * If some other error occurred, don't hang now.
+ * (We will most likely hang later anyway...)
+ */
+ if (acquired == B_TIMED_OUT)
+ acquire_sem(character_present);
+ if (charcount > 0) {
+ add_to_input_buf(&charbuf, 1);
+ return 1;
+ }
+ return 0;
+ }
+#endif
+ }
+#endif
+
+#if FEAT_GUI_BEOS
+ /*
+ * If not reading from terminal, pretend there is input.
+ * This makes the pty reading (for the GUI) "work" for
+ * :!ls but not for :r !ls ... weird.
+ */
+ if (gui.in_use && State == EXTERNCMD)
+ return 1;
+#endif
+ return 0;
+}
+
diff --git a/src/os_beos.h b/src/os_beos.h
new file mode 100644
index 000000000..260834e60
--- /dev/null
+++ b/src/os_beos.h
@@ -0,0 +1,25 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * BeBox port by Olaf Seibert
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * os_beos.h
+ */
+
+#undef USE_SYSTEM
+#define USE_THREAD_FOR_INPUT_WITH_TIMEOUT 1
+#define USE_TERM_CONSOLE
+
+#define HAVE_DROP_FILE
+
+#undef BEOS_DR8
+#define BEOS_PR_OR_BETTER
+
+/* select emulation */
+
+#include <net/socket.h> /* for typedefs and #defines only */
diff --git a/src/os_beos.rsrc b/src/os_beos.rsrc
new file mode 100644
index 000000000..f6443cd60
--- /dev/null
+++ b/src/os_beos.rsrc
Binary files differ
diff --git a/src/os_dos.h b/src/os_dos.h
new file mode 100644
index 000000000..103cded5a
--- /dev/null
+++ b/src/os_dos.h
@@ -0,0 +1,125 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Common MS-DOS and Win32 (Windows NT and Windows 95) defines.
+ *
+ * Names for the EXRC, HELP and temporary files.
+ * Some of these may have been defined in the makefile or feature.h.
+ */
+
+#ifndef SYS_VIMRC_FILE
+# define SYS_VIMRC_FILE "$VIM\\vimrc"
+#endif
+#ifndef USR_VIMRC_FILE
+# define USR_VIMRC_FILE "$HOME\\_vimrc"
+#endif
+#ifndef USR_VIMRC_FILE2
+# define USR_VIMRC_FILE2 "$VIM\\_vimrc"
+#endif
+#ifndef EVIM_FILE
+# define EVIM_FILE "$VIMRUNTIME\\evim.vim"
+#endif
+
+#ifndef USR_EXRC_FILE
+# define USR_EXRC_FILE "$HOME\\_exrc"
+#endif
+#ifndef USR_EXRC_FILE2
+# define USR_EXRC_FILE2 "$VIM\\_exrc"
+#endif
+
+#ifdef FEAT_GUI
+# ifndef SYS_GVIMRC_FILE
+# define SYS_GVIMRC_FILE "$VIM\\gvimrc"
+# endif
+# ifndef USR_GVIMRC_FILE
+# define USR_GVIMRC_FILE "$HOME\\_gvimrc"
+# endif
+# ifndef USR_GVIMRC_FILE2
+# define USR_GVIMRC_FILE2 "$VIM\\_gvimrc"
+# endif
+# ifndef SYS_MENU_FILE
+# define SYS_MENU_FILE "$VIMRUNTIME\\menu.vim"
+# endif
+#endif
+
+#ifndef SYS_OPTWIN_FILE
+# define SYS_OPTWIN_FILE "$VIMRUNTIME\\optwin.vim"
+#endif
+
+#ifdef FEAT_VIMINFO
+# ifndef VIMINFO_FILE
+# define VIMINFO_FILE "$HOME\\_viminfo"
+# endif
+# ifndef VIMINFO_FILE2
+# define VIMINFO_FILE2 "$VIM\\_viminfo"
+# endif
+#endif
+
+#ifndef VIMRC_FILE
+# define VIMRC_FILE "_vimrc"
+#endif
+
+#ifndef EXRC_FILE
+# define EXRC_FILE "_exrc"
+#endif
+
+#ifdef FEAT_GUI
+# ifndef GVIMRC_FILE
+# define GVIMRC_FILE "_gvimrc"
+# endif
+#endif
+
+#ifndef DFLT_HELPFILE
+# define DFLT_HELPFILE "$VIMRUNTIME\\doc\\help.txt"
+#endif
+
+#ifndef FILETYPE_FILE
+# define FILETYPE_FILE "filetype.vim"
+#endif
+#ifndef FTPLUGIN_FILE
+# define FTPLUGIN_FILE "ftplugin.vim"
+#endif
+#ifndef INDENT_FILE
+# define INDENT_FILE "indent.vim"
+#endif
+#ifndef FTOFF_FILE
+# define FTOFF_FILE "ftoff.vim"
+#endif
+#ifndef FTPLUGOF_FILE
+# define FTPLUGOF_FILE "ftplugof.vim"
+#endif
+#ifndef INDOFF_FILE
+# define INDOFF_FILE "indoff.vim"
+#endif
+
+#ifndef SYNTAX_FNAME
+# define SYNTAX_FNAME "$VIMRUNTIME\\syntax\\%s.vim"
+#endif
+
+#ifndef DFLT_BDIR
+# define DFLT_BDIR ".,c:\\tmp,c:\\temp" /* default for 'backupdir' */
+#endif
+
+#ifndef DFLT_VDIR
+# define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */
+#endif
+
+#ifndef DFLT_DIR
+# define DFLT_DIR ".,c:\\tmp,c:\\temp" /* default for 'directory' */
+#endif
+
+#define DFLT_ERRORFILE "errors.err"
+#define DFLT_RUNTIMEPATH "$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after"
+
+#define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
+#define SPACE_IN_FILENAME
+#define BACKSLASH_IN_FILENAME
+#define USE_CRNL /* lines end in CR-NL instead of NL */
+#define HAVE_DUP /* have dup() */
+#define HAVE_ST_MODE /* have stat.st_mode */
diff --git a/src/os_mac.build b/src/os_mac.build
new file mode 100644
index 000000000..014c037de
--- /dev/null
+++ b/src/os_mac.build
@@ -0,0 +1,91 @@
+set 68kTarget "68k"
+set ppcTarget "ppc"
+set carbonTarget "carbon"
+set vimTargets "`getlistitem -m " Select the vim target platform" -c -q "{68kTarget}" "{ppcTarget}" "{carbonTarget}"`"
+if !"{vimTargets}"
+ echo "No Makefile created"
+ exit 0
+end
+#
+set generalSources "buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c ex_docmd.c ex_eval.c ex_getln.c fileio.c fold.c getchar.c gui.c gui_mac.c if_cscope.c main.c mark.c memfile.c memline.c menu.c message.c misc1.c misc2.c move.c mbyte.c normal.c ops.c option.c os_mac.c pty.c quickfix.c regexp.c screen.c search.c tag.c term.c termlib.c ui.c undo.c version.c window.c"
+set generalOpts "-app -c 'VIM!' -t 'APPL' -i :proto"
+set generalCOpts "-w 2,35 -enum int"
+set generalLOpts "-mf -d"
+set generalLibs ""
+#
+#
+set 68kSources ""
+set 68kOpts "-model far"
+set 68kCOpts ""
+set 68kLOpts ""
+set 68kLibs ""
+#
+set ppcSources "syntax.c"
+set ppcOpts "-powerpc"
+set ppcCOpts ""
+set ppcLOpts "{SharedLibraries}AppearanceLib"
+set ppcLibs "{SharedLibraries}ContextualMenu"
+#
+set carbonSources ""
+set carbonOpts "-carbon"
+set carbonCOpts "-d TARGET_API_MAC_CARBON"
+set carbonLOpts ""
+set carbonLibs "{SharedLibraries}CarbonLib"
+#
+for vTarget in {vimTargets}
+ set vSources "{generalSources}"
+ set vLibs "{generalLibs}"
+ set vOpts "{generalOpts}"
+ set vCOpts "{generalCOpts}"
+ set vLOpts "{generalLOpts}"
+ set ppc ""
+ if "{vTarget}" == "{68kTarget}"
+ set vSources "{vSources} {68kSources}"
+ set vOpts "{vOpts} {68kOpts}"
+ set vLibs "{vLibs} {68kLibs}"
+ if "{68kCOpts}"
+ set vCOpts "{vCOpts} {68kCOpts}"
+ end
+ if "{68kLOpts}"
+ set vLOpts "{vLOpts} {68kLOpts}"
+ end
+ else
+ set ppc "ppc"
+ set vSources "{vSources} {ppcSources}"
+ set vOpts "{vOpts} {ppcOpts}"
+ set vLibs "{vLibs} {ppcLibs}"
+ if "{ppcCOpts}"
+ set vCOpts "{vCOpts} {ppcCOpts}"
+ end
+ if "{ppcLOpts}"
+ set vLOpts "{vLOpts} {ppcLOpts}"
+ end
+ if "{vTarget}" == "{carbonTarget}"
+ set vSources "{vSources} {carbonSources}"
+ set vLibs "{vLibs} {carbonLibs}"
+ set vOpts "{vOpts} {carbonOpts}"
+ if "{carbonCOpts}"
+ set vCOpts "{vCOpts} {carbonCOpts}"
+ end
+ if "{carbonLOpts}"
+ set vLOpts "{vLOpts} {carbonLOpts}"
+ end
+ end
+ end
+ set vODir :obj-{vTarget}:
+ if !"`exists -d {vOdir}`"
+ newFolder {vODir}
+ end
+ set vApp vim-{vTarget}
+ if "{vCOpts}"
+ set vOpts "{vOpts} -{ppc}COptions '{vCOpts}'"
+ end
+ if "{vLOpts}"
+ set vOpts "{vOpts} -{ppc}LinkOptions '{vLOpts}'"
+ end
+ set vOpts "{vOpts} -objdir {vODir}"
+ createmake {vApp} {vOpts} {vSources} {vLibs}
+ if !{Status}
+ echo "Makefile for {vApp} successfully created"
+ end
+end
diff --git a/src/os_mac.c b/src/os_mac.c
new file mode 100644
index 000000000..0f6a76ceb
--- /dev/null
+++ b/src/os_mac.c
@@ -0,0 +1,1451 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_mac.c -- code for the MacOS
+ *
+ * This file is mainly based on os_unix.c.
+ */
+
+#include "vim.h"
+
+#if defined(__MRC__) || defined(__SC__) /* for Apple MPW Compilers */
+
+#include "StandardFile.h"
+
+/*
+ * Implements the corresponding unix function
+ */
+ int
+stat(
+ char *p,
+ struct stat *p_st)
+{
+ /*
+ TODO: Use functions which fill the FileParam struct (Files.h)
+ and copy these contents to our self-defined stat struct
+ */
+ return 0;
+}
+#endif
+
+/*
+ * change the current working directory
+ */
+ int
+mch_chdir(char *p_name)
+{
+#if defined(__MRC__) || defined(__SC__) /* for Apple MPW Compilers */
+ /* TODO */
+ return FAIL;
+#else
+ return chdir(p_name);
+#endif
+}
+
+
+/*
+ * Recursively build up a list of files in "gap" matching the first wildcard
+ * in `path'. Called by mch_expandpath().
+ * "path" has backslashes before chars that are not to be expanded.
+ */
+ int
+mac_expandpath(
+ garray_T *gap,
+ char_u *path,
+ int flags, /* EW_* flags */
+ short start_at,
+ short as_full)
+{
+ /*
+ * TODO:
+ * +Get Volumes (when looking for files in current dir)
+ * +Make it work when working dir not on select volume
+ * +Cleanup
+ */
+ short index = 1;
+ OSErr gErr;
+ char_u dirname[256];
+ char_u cfilename[256];
+ long dirID;
+ char_u *new_name;
+ CInfoPBRec gMyCPB;
+ HParamBlockRec gMyHPBlock;
+ FSSpec usedDir;
+
+ char_u *buf;
+ char_u *p, *s, *e, dany;
+ int start_len, c;
+ char_u *pat;
+ regmatch_T regmatch;
+
+ start_len = gap->ga_len;
+ buf = alloc(STRLEN(path) + BASENAMELEN + 5);/* make room for file name */
+ if (buf == NULL)
+ return 0;
+
+/*
+ * Find the first part in the path name that contains a wildcard.
+ * Copy it into buf, including the preceding characters.
+ */
+ p = buf;
+ s = buf;
+ e = NULL;
+#if 1
+ STRNCPY(buf, path, start_at);
+ p += start_at;
+ path += start_at;
+#endif
+
+ while (*path)
+ {
+ if (*path == ':')
+ {
+ if (e)
+ break;
+ else
+ s = p + 1;
+ }
+ /* should use WILCARDLIST but what about ` */
+ /* if (vim_strchr((char_u *)"*?[{~$", *path) != NULL)*/
+ else if (vim_strchr((char_u *)WILDCHAR_LIST, *path) != NULL)
+ e = p;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int len = (*mb_ptr2len_check)(path);
+
+ STRNCPY(p, path, len);
+ p += len;
+ path += len;
+ }
+ else
+#endif
+ *p++ = *path++;
+ }
+ e = p;
+
+ /* now we have one wildcard component between s and e */
+ *e = NUL;
+
+#if 1
+ dany = *s;
+ *s = NUL;
+ backslash_halve(buf);
+ *s = dany;
+#endif
+
+ /* convert the file pattern to a regexp pattern */
+ pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
+ if (pat == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* compile the regexp into a program */
+ regmatch.rm_ic = FALSE; /* Don't ever ignore case */
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+ vim_free(pat);
+
+ if (regmatch.regprog == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* open the directory for scanning */
+ c = *s;
+ *s = NUL;
+
+ if (*buf == NUL)
+ {
+ as_full = TRUE;
+#if 0
+ (void) mch_dirname (&dirname[1], 254);
+ dirname[0] = STRLEN(&dirname[1]);
+#endif
+ }
+ else
+ {
+ if (*buf == ':') /* relative path */
+ {
+ (void)mch_dirname(&dirname[1], 254);
+ new_name = concat_fnames(&dirname[1], buf+1, TRUE);
+ STRCPY(&dirname[1], new_name);
+ dirname[0] = STRLEN(new_name);
+ vim_free(new_name);
+ }
+ else
+ {
+ STRCPY(&dirname[1], buf);
+ backslash_halve(&dirname[1]);
+ dirname[0] = STRLEN(buf);
+ }
+ }
+ *s = c;
+
+ FSMakeFSSpec (0, 0, dirname, &usedDir);
+
+ gMyCPB.dirInfo.ioNamePtr = dirname;
+ gMyCPB.dirInfo.ioVRefNum = usedDir.vRefNum;
+ gMyCPB.dirInfo.ioFDirIndex = 0;
+ gMyCPB.dirInfo.ioDrDirID = 0;
+
+ gErr = PBGetCatInfo(&gMyCPB, false);
+
+ gMyCPB.dirInfo.ioCompletion = NULL;
+ dirID = gMyCPB.dirInfo.ioDrDirID;
+ do
+ {
+ gMyCPB.hFileInfo.ioFDirIndex = index;
+ gMyCPB.hFileInfo.ioDirID = dirID;
+
+ gErr = PBGetCatInfo(&gMyCPB,false);
+
+ if (gErr == noErr)
+ {
+ STRNCPY (cfilename, &dirname[1], dirname[0]);
+ cfilename[dirname[0]] = 0;
+ if (vim_regexec(&regmatch, cfilename, (colnr_T)0))
+ {
+ if (s[-1] != ':')
+ {
+ /* TODO: need to copy with cleaned name */
+ STRCPY(s+1, cfilename);
+ s[0] = ':';
+ }
+ else
+ { /* TODO: need to copy with cleeaned name */
+ STRCPY(s, cfilename);
+ }
+ start_at = STRLEN(buf);
+ STRCAT(buf, path);
+ if (mch_has_exp_wildcard(path)) /* handle more wildcards */
+ (void)mac_expandpath(gap, buf, flags, start_at, FALSE);
+ else
+ {
+#ifdef DONT_ADD_PATHSEP_TO_DIR
+ if ((gMyCPB.hFileInfo.ioFlAttrib & ioDirMask) !=0 )
+ STRCAT(buf, PATHSEPSTR);
+#endif
+ addfile(gap, buf, flags);
+ }
+ }
+ if ((gMyCPB.hFileInfo.ioFlAttrib & ioDirMask) !=0 )
+ {
+ }
+ else
+ {
+ }
+ }
+ index++;
+ }
+ while (gErr == noErr);
+
+ if (as_full)
+ {
+ index = 1;
+ do
+ {
+ gMyHPBlock.volumeParam.ioNamePtr = (char_u *) dirname;
+ gMyHPBlock.volumeParam.ioVRefNum =0;
+ gMyHPBlock.volumeParam.ioVolIndex = index;
+
+ gErr = PBHGetVInfo (&gMyHPBlock,false);
+ if (gErr == noErr)
+ {
+ STRNCPY (cfilename, &dirname[1], dirname[0]);
+ cfilename[dirname[0]] = 0;
+ if (vim_regexec(&regmatch, cfilename, (colnr_T)0))
+ {
+ STRCPY(s, cfilename);
+ STRCAT(buf, path);
+ if (mch_has_exp_wildcard(path)) /* handle more wildcards */
+ (void)mac_expandpath(gap, s, flags, 0, FALSE);
+ else
+ {
+#ifdef DONT_ADD_PATHSEP_TO_DIR
+/* if ((gMyCPB.hFileInfo.ioFlAttrib & ioDirMask) !=0 )
+*/ STRCAT(buf, PATHSEPSTR);
+#endif
+ addfile(gap, s, flags);
+ }
+#if 0
+ STRCAT(cfilename, PATHSEPSTR);
+ addfile (gap, cfilename, flags);
+#endif
+ }
+ }
+ index++;
+ }
+ while (gErr == noErr);
+ }
+
+ vim_free(regmatch.regprog);
+
+ return gap->ga_len - start_len;
+}
+
+
+#ifdef USE_UNIXFILENAME
+ static int
+pstrcmp(a, b)
+ const void *a, *b;
+{
+ return (pathcmp(*(char **)a, *(char **)b));
+}
+
+ static int
+unix_expandpath(gap, path, wildoff, flags)
+ garray_T *gap;
+ char_u *path;
+ int wildoff;
+ int flags; /* EW_* flags */
+{
+ char_u *buf;
+ char_u *path_end;
+ char_u *p, *s, *e;
+ int start_len, c;
+ char_u *pat;
+ DIR *dirp;
+ regmatch_T regmatch;
+ struct dirent *dp;
+ int starts_with_dot;
+ int matches;
+ int len;
+
+ start_len = gap->ga_len;
+ buf = alloc(STRLEN(path) + BASENAMELEN + 5);/* make room for file name */
+ if (buf == NULL)
+ return 0;
+
+/*
+ * Find the first part in the path name that contains a wildcard.
+ * Copy it into buf, including the preceding characters.
+ */
+ p = buf;
+ s = buf;
+ e = NULL;
+ path_end = path;
+ while (*path_end)
+ {
+ /* May ignore a wildcard that has a backslash before it */
+ if (path_end >= path + wildoff && rem_backslash(path_end))
+ *p++ = *path_end++;
+ else if (*path_end == '/')
+ {
+ if (e != NULL)
+ break;
+ else
+ s = p + 1;
+ }
+ else if (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL)
+ e = p;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ len = (*mb_ptr2len_check)(path_end);
+ STRNCPY(p, path_end, len);
+ p += len;
+ path_end += len;
+ }
+ else
+#endif
+ *p++ = *path_end++;
+ }
+ e = p;
+ *e = NUL;
+
+ /* now we have one wildcard component between s and e */
+ /* Remove backslashes between "wildoff" and the start of the wildcard
+ * component. */
+ for (p = buf + wildoff; p < s; ++p)
+ if (rem_backslash(p))
+ {
+ STRCPY(p, p + 1);
+ --e;
+ --s;
+ }
+
+ /* convert the file pattern to a regexp pattern */
+ starts_with_dot = (*s == '.');
+ pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
+ if (pat == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* compile the regexp into a program */
+#ifdef MACOS_X
+ /* We want to behave like Terminal.app */
+ regmatch.rm_ic = TRUE;
+#else
+ regmatch.rm_ic = FALSE; /* Don't ever ignore case */
+#endif
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+ vim_free(pat);
+
+ if (regmatch.regprog == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* open the directory for scanning */
+ c = *s;
+ *s = NUL;
+ dirp = opendir(*buf == NUL ? "." : (char *)buf);
+ *s = c;
+
+ /* Find all matching entries */
+ if (dirp != NULL)
+ {
+ for (;;)
+ {
+ dp = readdir(dirp);
+ if (dp == NULL)
+ break;
+ if ((dp->d_name[0] != '.' || starts_with_dot)
+ && vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0))
+ {
+ STRCPY(s, dp->d_name);
+ len = STRLEN(buf);
+ STRCPY(buf + len, path_end);
+ if (mch_has_exp_wildcard(path_end)) /* handle more wildcards */
+ {
+ /* need to expand another component of the path */
+ /* remove backslashes for the remaining components only */
+ (void)unix_expandpath(gap, buf, len + 1, flags);
+ }
+ else
+ {
+ /* no more wildcards, check if there is a match */
+ /* remove backslashes for the remaining components only */
+ if (*path_end)
+ backslash_halve(buf + len + 1);
+ if (mch_getperm(buf) >= 0) /* add existing file */
+ addfile(gap, buf, flags);
+ }
+ }
+ }
+
+ closedir(dirp);
+ }
+
+ vim_free(buf);
+ vim_free(regmatch.regprog);
+
+ matches = gap->ga_len - start_len;
+ if (matches)
+ qsort(((char_u **)gap->ga_data) + start_len, matches,
+ sizeof(char_u *), pstrcmp);
+ return matches;
+}
+#endif
+
+/*
+ * Recursively build up a list of files in "gap" matching the first wildcard
+ * in `path'. Called by expand_wildcards().
+ * "pat" has backslashes before chars that are not to be expanded.
+ */
+ int
+mch_expandpath(
+ garray_T *gap,
+ char_u *path,
+ int flags) /* EW_* flags */
+{
+#ifdef USE_UNIXFILENAME
+ return unix_expandpath(gap, path, 0, flags);
+#else
+ char_u first = *path;
+ short scan_volume;
+
+ slash_n_colon_adjust(path);
+
+ scan_volume = (first != *path);
+
+ return mac_expandpath(gap, path, flags, 0, scan_volume);
+#endif
+}
+
+ void
+fname_case(name, len)
+ char_u *name;
+ int len; /* buffer size, ignored here */
+{
+ /*
+ * TODO: get the real casing for the file
+ * make it called
+ * with USE_FNAME_CASE & USE_LONG_FNAME
+ * CASE_INSENSITIVE_FILENAME
+ * within setfname, fix_fname, do_ecmd
+ */
+#ifdef USE_UNIXFILENAME
+ OSStatus status;
+ FSRef refFile;
+ UInt32 pathSize = STRLEN(name) + 1;
+ char_u *path;
+ Boolean isDirectory;
+
+ path = alloc(pathSize);
+ if (path == NULL)
+ return;
+
+ status = FSPathMakeRef((UInt8 *)name, &refFile, &isDirectory);
+ if (status)
+ return;
+
+ status = FSRefMakePath(&refFile, (UInt8 *)path, pathSize);
+ if (status)
+ return;
+
+ /* Paranoid: Update the name if only the casing differ.*/
+ if (STRICMP(name, path) == 0)
+ STRCPY(name, path);
+#endif
+}
+static char_u *oldtitle = (char_u *) "gVim";
+
+/*
+ * check for an "interrupt signal": CTRL-break or CTRL-C
+ */
+ void
+mch_breakcheck()
+{
+ /*
+ * TODO: Scan event for a CTRL-C or COMMAND-. and do: got_int=TRUE;
+ * or only go proccess event?
+ * or do nothing
+ */
+ EventRecord theEvent;
+
+ if (EventAvail (keyDownMask, &theEvent))
+ if ((theEvent.message & charCodeMask) == Ctrl_C && ctrl_c_interrupts)
+ got_int = TRUE;
+#if 0
+ short i = 0;
+ Boolean found = false;
+ EventRecord theEvent;
+
+ while ((i < 10) && (!found))
+ {
+ found = EventAvail (keyDownMask, &theEvent);
+ if (found)
+ {
+ if ((theEvent.modifiers & controlKey) != 0)
+ found = false;
+ if ((theEvent.what == keyDown))
+ found = false;
+ if ((theEvent.message & charCodeMask) == Ctrl_C)
+ {
+ found = false;
+ got_int = TRUE;
+ }
+ }
+ i++;
+ }
+#endif
+
+}
+
+/*
+ * Return amount of memory currently available.
+ */
+ long_u
+mch_avail_mem(special)
+ int special;
+{
+ /*
+ * TODO: Use MaxBlock, FreeMeM, PurgeSpace, MaxBlockSys FAQ-266
+ * figure out what the special is for
+ *
+ * FreeMem -> returns all avail memory is application heap
+ * MaxBlock -> returns the biggest contigeous block in application heap
+ * PurgeSpace ->
+ */
+ return MaxBlock();
+}
+
+ void
+mch_delay(msec, ignoreinput)
+ long msec;
+ int ignoreinput;
+{
+#if (defined(__MWERKS__) && __MWERKS__ >= 0x2000) \
+ || defined(__MRC__) || defined(__SC__)
+ unsigned
+#endif
+ long finalTick;
+
+ if (ignoreinput)
+ Delay (60*msec/1000, &finalTick);
+ else
+ /* even thougth we should call gui stuff from here
+ it the simplest way to be safe */
+ gui_mch_wait_for_chars(msec);
+}
+
+ void
+mch_init()
+{
+ /*
+ * TODO: Verify if needed, or override later.
+ */
+ Columns = 80;
+ Rows = 24;
+}
+
+/*
+ * Check_win checks whether we have an interactive stdout.
+ */
+ int
+mch_check_win(argc, argv)
+ int argc;
+ char **argv;
+{
+ /*
+ * TODO: Maybe to be remove through NO_CONSOLE
+ */
+ return OK;
+}
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ */
+ int
+mch_input_isatty()
+{
+ /*
+ * TODO: Maybe to be remove through NO_CONSOLE
+ */
+ return OK;
+}
+
+#ifdef FEAT_TITLE
+/*
+ * Set the window title and icon.
+ * (The icon is not taken care of).
+ */
+ void
+mch_settitle(title, icon)
+ char_u *title;
+ char_u *icon;
+{
+ gui_mch_settitle(title, icon);
+}
+
+/*
+ * Restore the window/icon title.
+ * which is one of:
+ * 1 Just restore title
+ * 2 Just restore icon
+ * 3 Restore title and icon
+ * but don't care about the icon.
+ */
+ void
+mch_restore_title(which)
+ int which;
+{
+ mch_settitle((which & 1) ? oldtitle : NULL, NULL);
+}
+#endif
+
+/*
+ * Insert user name in s[len].
+ * Return OK if a name found.
+ */
+ int
+mch_get_user_name(s, len)
+ char_u *s;
+ int len;
+{
+#if !(defined(__MRC__) || defined(__SC__)) /* No solution yet */
+ /*
+ * TODO: clean up and try getlogin ()
+ */
+#if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
+ struct passwd *pw;
+#endif
+ uid_t uid;
+
+ uid = getuid();
+#if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
+ if ((pw = getpwuid(uid)) != NULL
+ && pw->pw_name != NULL && *(pw->pw_name) != NUL)
+ {
+ STRNCPY(s, pw->pw_name, len);
+ return OK;
+ }
+#endif
+ sprintf((char *)s, "%d", (int)uid); /* assumes s is long enough */
+#endif
+ return FAIL; /* a number is not a name */
+}
+
+/*
+ * Copy host name into s[len].
+ */
+ void
+mch_get_host_name(s, len)
+ char_u *s;
+ int len;
+{
+#if defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__)
+ STRNCPY(s, "Mac", len); /* TODO: use Gestalt information */
+#else
+ struct utsname vutsname;
+
+ if (uname(&vutsname) < 0)
+ *s = NUL;
+ else
+ STRNCPY(s, vutsname.nodename, len);
+#endif
+ s[len - 1] = NUL; /* make sure it's terminated */
+}
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ return (long)getpid();
+}
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(buf, len)
+ char_u *buf;
+ int len;
+{
+#if defined(__MRC__) || defined(__SC__)
+ return FAIL; /* No solution yet */
+#else
+ /* The last : is already put by getcwd */
+ if (getcwd((char *)buf, len) == NULL)
+ {
+ STRCPY(buf, strerror(errno));
+ return FAIL;
+ }
+# ifndef USE_UNIXFILENAME
+ else if (*buf != NUL && buf[STRLEN(buf) - 1] == ':')
+ buf[STRLEN(buf) - 1] = NUL; /* remove trailing ':' */
+# endif
+ return OK;
+#endif
+}
+
+ void
+slash_to_colon(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ if (*p == '/')
+ *p = ':';
+}
+
+ char_u *
+slash_to_colon_save (p)
+ char_u *p;
+{
+ char_u *res;
+
+ res = vim_strsave(p);
+ if (res == NULL)
+ return p;
+ slash_to_colon(res);
+ return res;
+}
+
+ void
+slash_n_colon_adjust (buf)
+ char_u *buf;
+{
+ /*
+ * TODO: Make it faster
+ */
+#ifndef USE_UNIXFILENAME
+ char_u temp[MAXPATHL];
+ char_u *first_colon = vim_strchr(buf, ':');
+ char_u *first_slash = vim_strchr(buf, '/');
+ int full = TRUE;
+ char_u *scanning;
+ char_u *filling;
+ char_u last_copied = NUL;
+
+ if (*buf == NUL)
+ return ;
+
+ if ((first_colon == NULL) && (first_slash == NULL))
+ full = FALSE;
+ if ((first_slash == NULL) && (first_colon != NULL))
+ full = TRUE;
+ if ((first_colon == NULL) && (first_slash != NULL))
+ full = FALSE;
+ if ((first_slash < first_colon) && (first_slash != NULL))
+ full = FALSE;
+ if ((first_colon < first_slash) && (first_colon != NULL))
+ full = TRUE;
+ if (first_slash == buf)
+ full = TRUE;
+ if (first_colon == buf)
+ full = FALSE;
+
+ scanning = buf;
+ filling = temp;
+
+ while (*scanning != NUL)
+ {
+ if (*scanning == '/')
+ {
+ if ((scanning[1] != '/') && (scanning[-1] != ':'))
+ {
+ *filling++ = ':';
+ scanning++;
+ }
+ else
+ scanning++;
+ }
+ else if (*scanning == '.')
+ {
+ if ((scanning[1] == NUL) || scanning[1] == '/')
+ {
+ if (scanning[1] == NUL)
+ scanning += 1;
+ else
+ scanning += 2;
+ }
+ else if (scanning[1] == '.')
+ {
+ if ((scanning[2] == NUL) || scanning[2] == '/')
+ {
+ *filling++ = ':';
+ if (scanning[2] == NUL)
+ scanning +=2;
+ else
+ scanning += 3;
+ }
+ else
+ {
+ *filling++ = *scanning++;
+ }
+ }
+ else
+ {
+ *filling++ = *scanning++;
+ }
+
+ }
+ else
+ {
+ *filling++ = *scanning++;
+ }
+
+ }
+
+ *filling = 0;
+ filling = temp;
+
+ if (!full)
+ {
+ if (buf[0] != ':')
+ {
+ buf[0] = ':';
+ buf[1] = NUL;
+ }
+ else
+ buf[0] = NUL;
+ }
+ else
+ {
+ buf[0] = NUL;
+ if (filling[0] == ':')
+ filling++;
+ }
+
+ STRCAT (buf, filling);
+#endif
+}
+
+/*
+ * Get absolute filename into buffer 'buf' of length 'len' bytes.
+ *
+ * return FAIL for failure, OK for success
+ */
+ int
+mch_FullName(fname, buf, len, force)
+ char_u *fname, *buf;
+ int len;
+ int force; /* also expand when already absolute path name */
+{
+ /*
+ * TODO: Find what TODO
+ */
+ int l;
+ char_u olddir[MAXPATHL];
+ char_u newdir[MAXPATHL];
+ char_u *p;
+ char_u c;
+ int retval = OK;
+
+ if (force || !mch_isFullName(fname))
+ {
+ /*
+ * Forced or not an absolute path.
+ * If the file name has a path, change to that directory for a moment,
+ * and then do the getwd() (and get back to where we were).
+ * This will get the correct path name with "../" things.
+ */
+ if ((p = vim_strrchr(fname, ':')) != NULL)
+ {
+ p++;
+ if (mch_dirname(olddir, MAXPATHL) == FAIL)
+ {
+ p = NULL; /* can't get current dir: don't chdir */
+ retval = FAIL;
+ }
+ else
+ {
+ c = *p;
+ *p = NUL;
+ if (mch_chdir((char *)fname))
+ retval = FAIL;
+ else
+ fname = p; /* + 1;*/
+ *p = c;
+ }
+ }
+ if (mch_dirname(buf, len) == FAIL)
+ {
+ retval = FAIL;
+ *newdir = NUL;
+ }
+ l = STRLEN(buf);
+ if (STRCMP(fname, ".") != 0)
+ {
+#ifdef USE_UNIXFILENAME
+ if (l > 0 && buf[l - 1] != '/' && *fname != NUL)
+ STRCAT(buf, "/");
+#else
+ if (l > 0 && buf[l - 1] != ':' && *fname != NUL)
+ STRCAT(buf, ":");
+#endif
+ }
+ if (p != NULL)
+ mch_chdir((char *)olddir);
+ if (STRCMP(fname, ".") != 0)
+ STRCAT(buf, fname);
+ }
+ else
+ {
+ STRNCPY(buf, fname, len);
+ buf[len - 1] = NUL;
+ slash_n_colon_adjust(buf);
+ }
+
+ return retval;
+}
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(fname)
+ char_u *fname;
+{
+#ifdef USE_UNIXFILENAME
+ return ((fname[0] == '/') || (fname[0] == '~'));
+#else
+ /*
+ * TODO: Make sure fname is always of mac still
+ * i.e: passed throught slash_n_colon_adjust
+ */
+ char_u *first_colon = vim_strchr(fname, ':');
+ char_u *first_slash = vim_strchr(fname, '/');
+
+ if (first_colon == fname)
+ return FALSE;
+ if (first_slash == fname)
+ return TRUE;
+ if ((first_colon < first_slash) && (first_colon != NULL))
+ return TRUE;
+ if ((first_slash < first_colon) && (first_slash != NULL))
+ return FALSE;
+ if ((first_colon == NULL) && (first_slash != NULL))
+ return FALSE;
+ if ((first_slash == NULL) && (first_colon != NULL))
+ return TRUE;
+ if ((first_colon == NULL) && (first_slash == NULL))
+ return FALSE;
+ return TRUE;
+#endif
+}
+
+/*
+ * Replace all slashes by colons.
+ */
+ void
+slash_adjust(p)
+ char_u *p;
+{
+#ifndef USE_UNIXFILENAME
+ /*
+ * TODO: keep escaped '/'
+ */
+
+ while (*p)
+ {
+ if (*p == '/')
+ *p = ':';
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+#endif
+}
+
+/*
+ * Get file permissions for 'name'.
+ * Returns -1 when it doesn't exist.
+ */
+ long
+mch_getperm(name)
+ char_u *name;
+{
+ /*
+ * TODO: Maybe use AppleShare info??
+ * Use locked for non writable
+ */
+
+ struct stat statb;
+
+ if (stat((char *)name, &statb))
+ return -1;
+ return statb.st_mode;
+}
+
+/*
+ * set file permission for 'name' to 'perm'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_setperm(name, perm)
+ char_u *name;
+ long perm;
+{
+ /*
+ * TODO: Maybe use AppleShare info??
+ * Use locked for non writable
+ */
+ return (OK);
+}
+
+/*
+ * Set hidden flag for "name".
+ */
+ void
+mch_hide(name)
+ char_u *name;
+{
+ /*
+ * TODO: Hide the file throught FileManager FAQ 8-34
+ *
+ * *name is mac style start with : for relative
+ */
+}
+
+
+/*
+ * return TRUE if "name" is a directory
+ * return FALSE if "name" is not a directory
+ * return FALSE for error
+ */
+ int
+mch_isdir(name)
+ char_u *name;
+{
+ /*
+ * TODO: Find out by FileManager calls ...
+ */
+ struct stat statb;
+
+#if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
+ /* For some reason the name is sometimes empty,
+ * (such as for a not yet named file). An empty
+ * filename is interpreted by the MacOS version
+ * of stat (at least under Codewarrior) as the
+ * current directory.
+ */
+ /* AK 20020413
+ * This is required for Carbon but breaks the
+ * explorer plugin in Classic
+ */
+ if (name[0] == NULL)
+ return FALSE;
+#endif
+
+ if (stat((char *)name, &statb))
+ return FALSE;
+#if defined(__MRC__) || defined(__SC__)
+ return FALSE; /* definitely TODO */
+#else
+ return ((statb.st_mode & S_IFMT) == S_IFDIR ? TRUE : FALSE);
+#endif
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return 1 if "name" can be executed, 0 if not.
+ * Return -1 if unknown.
+ */
+ int
+mch_can_exe(name)
+ char_u *name;
+{
+ /* TODO */
+ return -1;
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(name)
+ char_u *name;
+{
+ /* TODO */
+ return NODE_NORMAL;
+}
+
+ void
+mch_early_init()
+{
+}
+
+ void
+mch_exit(r)
+ int r;
+{
+ display_errors();
+
+ ml_close_all(TRUE); /* remove all memfiles */
+ exit(r);
+}
+
+
+ void
+mch_settmode(tmode)
+ int tmode;
+{
+ /*
+ * TODO: remove the needs of it.
+ */
+}
+
+#ifdef FEAT_MOUSE
+/*
+ * set mouse clicks on or off (only works for xterms)
+ */
+ void
+mch_setmouse(on)
+ int on;
+{
+ /*
+ * TODO: remove the needs of it.
+ */
+}
+#endif
+
+/*
+ * set screen mode, always fails.
+ */
+ int
+mch_screenmode(arg)
+ char_u *arg;
+{
+ EMSG(_(e_screenmode));
+ return FAIL;
+}
+
+ int
+mch_call_shell(cmd, options)
+ char_u *cmd;
+ int options; /* SHELL_*, see vim.h */
+{
+ /*
+ * TODO: find a shell or pseudo-shell to call
+ * for some simple useful command
+ */
+
+ return (-1);
+}
+
+/*
+ * Return TRUE if "p" contains a wildcard that can be expanded by
+ * mch_expandpath().
+ */
+ int
+mch_has_exp_wildcard(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ {
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ else if (vim_strchr((char_u *)WILDCHAR_LIST, *p) != NULL)
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+ int
+mch_has_wildcard(p)
+ char_u *p;
+{
+#ifdef USE_UNIXFILENAME
+ if (*p == '~' && p[1] != NUL)
+ return TRUE;
+#endif
+ return mch_has_exp_wildcard(p);
+}
+
+
+/*
+ * This procedure duplicate a file, it is used in order to keep
+ * the footprint of the previous file, when some info can be easily
+ * restored with set_perm().
+ *
+ * Return -1 for failure, 0 for success.
+ */
+ int
+mch_copy_file(from, to)
+ char_u *from;
+ char_u *to;
+{
+ char_u from_str[256];
+ char_u to_str[256];
+ char_u to_name[256];
+
+ HParamBlockRec paramBlock;
+ char_u *char_ptr;
+ int len;
+
+ /*
+ * Convert C string to Pascal string
+ */
+ char_ptr = from;
+ len = 1;
+ for (; (*char_ptr != 0) && (len < 255); len++, char_ptr++)
+ from_str[len] = *char_ptr;
+ from_str[0] = len-1;
+
+ char_ptr = to;
+ len = 1;
+ for (; (*char_ptr != 0) && (len < 255); len++, char_ptr++)
+ to_str[len] = *char_ptr;
+ to_str[0] = len-1;
+
+ paramBlock.copyParam.ioCompletion = NULL;
+ paramBlock.copyParam.ioNamePtr = from_str;
+ /* paramBlock.copyParam.ioVRefnum = overided by ioFilename; */
+ /* paramBlock.copyParam.ioDirI = overided by ioFilename; */
+
+ paramBlock.copyParam.ioNewName = to_str;
+ paramBlock.copyParam.ioCopyName = to_name; /* NIL */
+ /* paramBlock.copyParam.ioDstVRefNum = overided by ioNewName; */
+ /* paramBlock.copyParam.ioNewDirID = overided by ioNewName; */
+
+
+
+ /*
+ * First delete the "to" file, this is required on some systems to make
+ * the rename() work, on other systems it makes sure that we don't have
+ * two files when the rename() fails.
+ */
+ mch_remove(to);
+
+ /*
+ * First try a normal rename, return if it works.
+ */
+ (void) PBHCopyFile(&paramBlock, false);
+ return 0;
+
+}
+
+
+ int
+mch_copy_file_attribute(from, to)
+ char_u *from;
+ char_u *to;
+{
+ FSSpec frFSSpec;
+ FSSpec toFSSpec;
+ FInfo fndrInfo;
+ Str255 name;
+ ResType type;
+ ResType sink;
+ Handle resource;
+ short idxTypes;
+ short nbTypes;
+ short idxResources;
+ short nbResources;
+ short ID;
+ short frRFid;
+ short toRFid;
+ short attrs_orig;
+ short attrs_copy;
+ short temp;
+
+ /* TODO: Handle error */
+ (void) GetFSSpecFromPath (from, &frFSSpec);
+ (void) GetFSSpecFromPath (to , &toFSSpec);
+
+ /* Copy resource fork */
+ temp = 0;
+
+#if 1
+ frRFid = FSpOpenResFile (&frFSSpec, fsCurPerm);
+
+ if (frRFid != -1)
+ {
+ FSpCreateResFile(&toFSSpec, 'TEXT', UNKNOWN_CREATOR, 0);
+ toRFid = FSpOpenResFile (&toFSSpec, fsRdWrPerm);
+
+ UseResFile (frRFid);
+
+ nbTypes = Count1Types();
+
+ for (idxTypes = 1; idxTypes <= nbTypes; idxTypes++)
+ {
+ Get1IndType (&type, idxTypes);
+ nbResources = Count1Resources(type);
+
+ for (idxResources = 1; idxResources <= nbResources; idxResources++)
+ {
+ attrs_orig = 0; /* in case GetRes fails */
+ attrs_copy = 0; /* in case GetRes fails */
+ resource = Get1IndResource(type, idxResources);
+ GetResInfo (resource, &ID, &sink, name);
+ HLock (resource);
+ attrs_orig = GetResAttrs (resource);
+ DetachResource (resource);
+
+
+ UseResFile (toRFid);
+ AddResource (resource, type, ID, name);
+ attrs_copy = GetResAttrs (resource);
+ attrs_copy = (attrs_copy & 0x2) | (attrs_orig & 0xFD);
+ SetResAttrs (resource, attrs_copy);
+ WriteResource (resource);
+ UpdateResFile (toRFid);
+
+ temp = GetResAttrs (resource);
+
+ /*SetResAttrs (resource, 0);*/
+ HUnlock(resource);
+ ReleaseResource (resource);
+ UseResFile (frRFid);
+ }
+ }
+ CloseResFile (toRFid);
+ CloseResFile (frRFid);
+ }
+#endif
+ /* Copy Finder Info */
+ (void) FSpGetFInfo (&frFSSpec, &fndrInfo);
+ (void) FSpSetFInfo (&toFSSpec, &fndrInfo);
+
+ return (temp == attrs_copy);
+}
+
+ int
+mch_has_resource_fork (file)
+ char_u *file;
+{
+ FSSpec fileFSSpec;
+ short fileRFid;
+
+ /* TODO: Handle error */
+ (void) GetFSSpecFromPath (file, &fileFSSpec);
+ fileRFid = FSpOpenResFile (&fileFSSpec, fsCurPerm);
+ if (fileRFid != -1)
+ CloseResFile (fileRFid);
+
+ return (fileRFid != -1);
+}
+
+ int
+mch_get_shellsize(void)
+{
+ /* never used */
+ return OK;
+}
+
+ void
+mch_set_shellsize(void)
+{
+ /* never used */
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize(void)
+{
+ /* never used */
+}
+
+/*
+ * Those function were set as #define before, but in order
+ * to allow an easier us of os_unix.c for the MacOS X port,
+ * they are change to procedure. Thec ompile whould optimize
+ * them out.
+ */
+
+ int
+mch_can_restore_title()
+{
+ return TRUE;
+}
+
+ int
+mch_can_restore_icon()
+{
+ return TRUE;
+}
+
+/*
+ * If the machine has job control, use it to suspend the program,
+ * otherwise fake it by starting a new shell.
+ */
+ void
+mch_suspend()
+{
+ /* TODO: get calle in #ifndef NO_CONSOLE */
+ gui_mch_iconify();
+};
+
diff --git a/src/os_mac.h b/src/os_mac.h
new file mode 100644
index 000000000..799176967
--- /dev/null
+++ b/src/os_mac.h
@@ -0,0 +1,411 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/* Before Including the MacOS specific files,
+ * lets set the OPAQUE_TOOLBOX_STRUCTS to 0 so we
+ * can access the internal structures.
+ * (Until fully Carbon compliant)
+ * TODO: Can we remove this? (Dany)
+ */
+#if 0
+# define OPAQUE_TOOLBOX_STRUCTS 0
+#endif
+
+/*
+ * Macintosh machine-dependent things.
+ */
+#include <QuickDraw.h>
+#include <ToolUtils.h>
+#include <LowMem.h>
+#include <Scrap.h>
+#include <Sound.h>
+#include <TextUtils.h>
+#include <Memory.h>
+#include <OSUtils.h>
+#include <Files.h>
+#ifdef FEAT_MBYTE
+# include <Script.h>
+#endif
+
+/*
+ * Unix interface
+ */
+#if defined(__MWERKS__) /* for CodeWarrior */
+# include <unistd.h>
+# include <utsname.h>
+# include <unix.h>
+#endif
+#if defined(__APPLE_CC__) /* for Project Builder and ... */
+# include <unistd.h>
+#endif
+/* Get stat.h or something similar. Comment: How come some OS get in in vim.h */
+#if defined(__MWERKS__)
+# include <stat.h>
+#endif
+#if defined(__APPLE_CC__)
+# include <sys/stat.h>
+#endif
+#if defined(__MRC__) || defined(__SC__) /* for Apple MPW Compilers */
+/* There's no stat.h for MPW? */
+# ifdef powerc
+# pragma options align=power
+# endif
+ struct stat
+ {
+ UInt32 st_mtime;
+ UInt32 st_mode;
+ UInt32 st_size;
+ };
+# ifdef powerc
+# pragma options align=reset
+# endif
+#endif
+#if defined(__APPLE_CC__) /* && defined(HAVE_CURSE) */
+/* The curses.h from MacOS X provides by default some BACKWARD compatibilty
+ * definition which can cause us problem later on. So we undefine a few of them. */
+# include <curses.h>
+# undef reg
+# undef ospeed
+/* OK defined to 0 in MacOS X 10.2 curses! Remove it, we define it to be 1. */
+# undef OK
+#endif
+#include <signal.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#ifdef MACOS_X
+# include <dirent.h>
+#endif
+
+/*
+ * Incompatibility checks
+ */
+
+/* Got problem trying to use shared library in 68k */
+#if !defined(__POWERPC__) && defined(FEAT_PYTHON)
+# undef FEAT_PYTHON
+# warning Auto-disabling Python. Not yet supported in 68k.
+#endif
+
+#if !defined(__POWERPC__) && !defined(__ppc__)
+# if !__option(enumsalwaysint)
+# error "You must compile with enums always int!"
+# endif
+# if defined(__MWERKS__) && !defined(__fourbyteints__)
+# error "You must compile the project with 4-byte ints"
+/* MPW ints are always 4 byte long */
+# endif
+#endif
+
+/*
+ * MacOS specific #define
+ */
+
+/* This will go away when CMD_KEY fully tested */
+#define USE_CMD_KEY
+/* On MacOS X use the / not the : */
+/* TODO: Should file such as ~/.vimrc reside instead in
+ * ~/Library/Vim or ~/Library/Preferences/org.vim.vim/ ? (Dany)
+ */
+/* When compiled under MacOS X (including CARBON version)
+ * we use the Unix File path style */
+#if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
+# undef COLON_AS_PATHSEP
+# define USE_UNIXFILENAME
+#else
+# define COLON_AS_PATHSEP
+# define DONT_ADD_PATHSEP_TO_DIR
+#endif
+
+
+/*
+ * Generic Vim #define
+ */
+
+#define FEAT_SOURCE_FFS
+#define FEAT_SOURCE_FF_MAC
+
+#define USE_EXE_NAME /* to find $VIM */
+#define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
+#define SPACE_IN_FILENAME
+#define BREAKCHECK_SKIP 32 /* call mch_breakcheck() each time, it's
+ quite fast. Did I forgot to update the comment */
+
+
+#undef USE_FNAME_CASE /* So that :e os_Mac.c, :w, save back the file as os_mac.c */
+#define BINARY_FILE_IO
+#define EOL_DEFAULT EOL_MAC
+#ifndef MACOS_X_UNIX /* I hope that switching these two lines */
+# define USE_CR /* does what I want -- BNF */
+# define NO_CONSOLE /* don't include console mode */
+#endif
+#define HAVE_AVAIL_MEM
+
+#ifndef HAVE_CONFIG_H
+/* #define SYNC_DUP_CLOSE sync() a file with dup() and close() */
+# define HAVE_STRING_H
+# define HAVE_STRCSPN
+# define HAVE_MEMSET
+# define USE_TMPNAM /* use tmpnam() instead of mktemp() */
+# define HAVE_FCNTL_H
+# define HAVE_QSORT
+# define HAVE_ST_MODE /* have stat.st_mode */
+
+# if defined(__DATE__) && defined(__TIME__)
+# define HAVE_DATE_TIME
+# endif
+# define HAVE_STRFTIME
+#endif
+
+
+/*
+ * Names for the EXRC, HELP and temporary files.
+ * Some of these may have been defined in the makefile.
+ */
+
+#ifndef SYS_VIMRC_FILE
+# ifdef COLON_AS_PATHSEP
+# define SYS_VIMRC_FILE "$VIM:vimrc"
+# else
+# define SYS_VIMRC_FILE "$VIM/vimrc"
+# endif
+#endif
+#ifndef SYS_GVIMRC_FILE
+# ifdef COLON_AS_PATHSEP
+# define SYS_GVIMRC_FILE "$VIM:gvimrc"
+# else
+# define SYS_GVIMRC_FILE "$VIM/gvimrc"
+# endif
+#endif
+#ifndef SYS_MENU_FILE
+# ifdef COLON_AS_PATHSEP
+# define SYS_MENU_FILE "$VIMRUNTIME:menu.vim"
+# else
+# define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
+# endif
+#endif
+#ifndef SYS_OPTWIN_FILE
+# ifdef COLON_AS_PATHSEP
+# define SYS_OPTWIN_FILE "$VIMRUNTIME:optwin.vim"
+# else
+# define SYS_OPTWIN_FILE "$VIMRUNTIME/optwin.vim"
+# endif
+#endif
+#ifndef EVIM_FILE
+# ifdef COLON_AS_PATHSEP
+# define EVIM_FILE "$VIMRUNTIME:evim.vim"
+# else
+# define EVIM_FILE "$VIMRUNTIME/evim.vim"
+# endif
+#endif
+
+#ifdef FEAT_GUI
+# ifndef USR_GVIMRC_FILE
+# ifdef COLON_AS_PATHSEP
+# define USR_GVIMRC_FILE "$VIM:.gvimrc"
+# else
+# define USR_GVIMRC_FILE "~/.gvimrc"
+# endif
+# endif
+# ifndef GVIMRC_FILE
+# define GVIMRC_FILE "_gvimrc"
+# endif
+#endif
+#ifndef USR_VIMRC_FILE
+# ifdef COLON_AS_PATHSEP
+# define USR_VIMRC_FILE "$VIM:.vimrc"
+# else
+# define USR_VIMRC_FILE "~/.vimrc"
+# endif
+#endif
+
+#ifndef USR_EXRC_FILE
+# ifdef COLON_AS_PATHSEP
+# define USR_EXRC_FILE "$VIM:.exrc"
+# else
+# define USR_EXRC_FILE "~/.exrc"
+# endif
+#endif
+
+#ifndef VIMRC_FILE
+# define VIMRC_FILE "_vimrc"
+#endif
+
+#ifndef EXRC_FILE
+# define EXRC_FILE "_exrc"
+#endif
+
+#ifndef DFLT_HELPFILE
+# ifdef COLON_AS_PATHSEP
+# define DFLT_HELPFILE "$VIMRUNTIME:doc:help.txt"
+# else
+# define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
+# endif
+#endif
+
+#ifndef FILETYPE_FILE
+# define FILETYPE_FILE "filetype.vim"
+#endif
+#ifndef FTPLUGIN_FILE
+# define FTPLUGIN_FILE "ftplugin.vim"
+#endif
+#ifndef INDENT_FILE
+# define INDENT_FILE "indent.vim"
+#endif
+#ifndef FTOFF_FILE
+# define FTOFF_FILE "ftoff.vim"
+#endif
+#ifndef FTPLUGOF_FILE
+# define FTPLUGOF_FILE "ftplugof.vim"
+#endif
+#ifndef INDOFF_FILE
+# define INDOFF_FILE "indoff.vim"
+#endif
+
+#ifndef SYNTAX_FNAME
+# ifdef COLON_AS_PATHSEP
+# define SYNTAX_FNAME "$VIMRUNTIME:syntax:%s.vim"
+# else
+# define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
+# endif
+#endif
+
+#ifdef FEAT_VIMINFO
+# ifndef VIMINFO_FILE
+# ifdef COLON_AS_PATHSEP
+# define VIMINFO_FILE "$VIM:viminfo"
+# else
+# define VIMINFO_FILE "~/.viminfo"
+# endif
+# endif
+#endif /* FEAT_VIMINFO */
+
+#ifndef DFLT_BDIR
+# define DFLT_BDIR "." /* default for 'backupdir' */
+#endif
+
+#ifndef DFLT_DIR
+# define DFLT_DIR "." /* default for 'directory' */
+#endif
+
+#ifndef DFLT_VDIR
+# ifdef COLON_AS_PATHSEP
+# define DFLT_VDIR "$VIM:vimfiles:view" /* default for 'viewdir' */
+# else
+# define DFLT_VDIR "$VIM/vimfiles/view" /* default for 'viewdir' */
+# endif
+#endif
+
+#define DFLT_ERRORFILE "errors.err"
+#ifdef COLON_AS_PATHSEP
+# define DFLT_RUNTIMEPATH "$VIM:vimfiles,$VIMRUNTIME,$VIM:vimfiles:after"
+#else
+# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
+#endif
+
+/*
+ * Macintosh has plenty of memory, use large buffers
+ */
+#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
+
+#if defined(MACOS_X_UNIX)
+# define MAXPATHL 1024
+# define BASENAMELEN (MAXNAMLEN - 5) /* length of base of filename */
+#else
+# define MAXPATHL 256 /* Limited by the Pascal Strings */
+# define BASENAMELEN (32-5-1) /* length of base of filename */
+#endif
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM 512 /* use up to 512 Kbyte for buffer */
+#endif
+
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT 2048 /* use up to 2048 Kbyte for Vim */
+#endif
+
+#define WILDCHAR_LIST "*?[{`$"
+
+/**************/
+#define mch_rename(src, dst) rename(src, dst)
+#define mch_remove(x) unlink((char *)(x))
+#ifndef mch_getenv
+# if defined(__MRC__) || defined(__SC__)
+# define mch_getenv(name) ((char_u *)getenv((char *)(name)))
+# define mch_setenv(name, val, x) setenv((name), (val))
+# elif defined(__APPLE_CC__)
+# define mch_getenv(name) ((char_u *)getenv((char *)(name)))
+/*# define mch_setenv(name, val, x) setenv((name), (val)) */ /* Obsoleted by Dany on Oct 30, 2001 */
+# define mch_setenv(name, val, x) setenv(name, val, x)
+# else
+ /* vim_getenv() is in pty.c */
+# define USE_VIMPTY_GETENV
+# define mch_getenv(x) vimpty_getenv(x)
+# define mch_setenv(name, val, x) setenv(name, val, x)
+# endif
+#endif
+
+#ifndef HAVE_CONFIG_H
+# ifdef __APPLE_CC__
+/* Assuming compiling for MacOS X */
+/* Trying to take advantage of the prebinding */
+# define HAVE_TGETENT
+# define OSPEED_EXTERN
+# define UP_BC_PC_EXTERN
+# endif
+#endif
+
+/* Some "prep work" definition to be able to compile the MacOS X
+ * version with os_unix.x instead of os_mac.c. Based on the result
+ * of ./configure for console MacOS X.
+ */
+
+#ifdef MACOS_X_UNIX
+# define SIGPROTOARG (int)
+# define SIGDEFARG(s) (s) int s;
+# define SIGDUMMYARG 0
+# undef HAVE_AVAIL_MEM
+# ifndef HAVE_CONFIG_H
+# define RETSIGTYPE void
+# define SIGRETURN return
+/*# define USE_SYSTEM */ /* Output ship do debugger :(, but ot compile */
+# define HAVE_SYS_WAIT_H 1 /* Attempt */
+# define HAVE_TERMIOS_H 1
+# define SYS_SELECT_WITH_SYS_TIME 1
+# define HAVE_SELECT 1
+# define HAVE_SYS_SELECT_H 1
+# define HAVE_PUTENV
+# define HAVE_SETENV
+# define HAVE_RENAME
+# endif
+# define mch_chdir(s) chdir(s)
+#endif
+
+#if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
+# define HAVE_PUTENV
+#endif
+
+/* A Mac constant causing big problem to syntax highlighting */
+#define UNKNOWN_CREATOR '\?\?\?\?'
+
+/*
+ * for debugging
+ */
+#ifdef MACOS_X
+# ifdef _DEBUG
+# define TRACE Trace
+ void Trace(char *fmt, ...);
+# else
+# define TRACE 1 ? (void)0 : printf
+# endif
+#endif
+
+#ifdef MACOS_CLASSIC
+# define TRACE 1 ? (int)0 : printf
+#endif
diff --git a/src/os_mac.rsr.hqx b/src/os_mac.rsr.hqx
new file mode 100644
index 000000000..04e99723f
--- /dev/null
+++ b/src/os_mac.rsr.hqx
@@ -0,0 +1,659 @@
+(This file must be converted with BinHex 4.0)
+
+:$'GeD9pYB@-ZFR0bB`"58e*$8P0&4!%!!!!!!!!!HUUk%`!!!!!"!!!!GJX!!(8
+,!!!%R`!!$Ed,Eh0IGc-bC'aX,Q-#!!!!9%9B9%0A588"!2rr#hCTE9"33bjbFh*
+MFLe%EfYeE@9ZG'9PEL"%BA4PER8!!(*cFQ058d9%!3lrrrrr!!!!!!!!!!!!!!!
+!!!!!!!!!X3N1a!!!!!!!!%'-!!!!!!!!!!!4!!!!$Ed,Eh0IGc-bCAKP,Q-#!!!
+!9%9B9%0A588"!2rrrrm!!!!!$NN!!!!!$hi!!%)!!!!!!!!!!!!!!,#`81D`X&$
+Q!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'6Y!!%!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!3!!!!!#a@58dK!!!!!8C548B!!J!!!)!!!3#"!!)!JNP$6L-!!J!!!))!!3#
+$!!)!!!!!!!G"8&"-!!!!!!!!"e4&@&3!!3!!!!!(+LSU+J!#!!!!!J!!!2rrrrr
+rrrrrrrm!!!!!!!$m$!`-$!`-$!`2m!!!!!!!m-$!`-E!`-$!cpm!!!!!!2`-$!`
+-$!`-$!r0m!!!!!$`aX$'aXCJB-$2$0m!!!!!r!B-"JB'"JB-$rrrm!!!!2$!B'$
+'aXE'`-$!c[!!!!$m$'aX"JB'"J`-$!l`!!!!m-$'`-E'aXE!`-$1m!!!!2`-$!`
+-$!`-$!`-$[!!!!$``-$!`-$!`-$!`-l`!!!!r!`-$!`-$!`-$!`1m!!!!2$!`-$
+!`-$!`-$!c[!!!!$m$!`-$!`-$!`-$!l`!!!!m-$!`-$!`-$!`-$1m!!!!2`-CJB
+-$!`-$!`-$[!!!!$`aXCJ`-$!`-$!`-l`!!!!r!`-$!`-$!`-$!`1m!!!!2$!`-$
+!`-$!`-$!c[!!!!$m$!`-$!`-$!`-$!l`!!!!m-$!`-$!`-$!`-$1m!!!!2`-$!`
+-$!`-$!`-$[!!!!$``-$!`-$!`-$!`-l`!!!!r!`-$!`-$!`-$!`1m!!!!2$!CXE
+!`-$!`-$!c[!!!!$m"JCX$!`-$!`-$!l`!!!!m-$!`-$!`-$!`-$1m!!!!2`-$!`
+-$!`-$!`-$[!!!!$``-$!`-$!`-$!`-l`!!!!r!`-$!`-$!`-$!`1m!!!!2lZlZl
+ZlZlZlZlZl[!!!!$rrrrrrrrrrrrrrrr`!!!!!J$rrrrrrrrrrrrrrrrrrrr`m!!
+!!!!!!!!!!!!!!!!!m2!!!!!!!!!!!!!!!!!!!2$`!!!!!!!!!!!!!!!!!!$`m!!
+!!!!!!!!2rrr`!!!!m2!!CJB!!!!!mJ)#$`!!!2$`"JCJ!!!!$b!J)#$`!!$`m!!
+!!!!!!2)2mJ)#$`!!m2!!!!!!!!$rrGmJ)#$`!2$`!!!!!!rr![rrrrm#$rrrm!!
+!!!!!$b![m#!J)#$fEr!!!!!!$Ghb!J)#!J)#pQr`!!!!!!!0hb!J)#!J)2C[m!!
+!!!!!!0hr!J)#!J,fEr!!CJB!!!!0hIrrrrmJpQr`"JCJ!!!!!0hGhGhGrrC[m!!
+!!!!!!!!!hGhGhGhIrr!!!!!!!!!!!!!!!!hGhI$`!!!!!!!!!!!!!!!!!!$`m!!
+!!!!!!!!!!!!'CQCJm2!!!!!!!!!!!!!!"QCQB2$`!!!!!!!'!!!!!!CQCQ$`m!!
+!!!!!!!!!!!!'CQCJm2!'B'!!B'B!CJB!"QCQB2$`"Q"J!'!'!'"JB!CQCQ$`m!!
+!"JB!"J"JB'!'CQCJm2!!!!B'!!B!B'"J"QCQB2$`"Q!'"J!'!'"JB!CQCQ$`m!C
+J!'!!"Q"JB'!'CQCJm2!!!!!!!!!!!!!!"QCQB2$`!!!!!!!!!!!!!!!!!!$`rrr
+rrrrrrrrrrrrrrrrrm!!!!J!!$rrrrrrrrrrrrrrrrr!!!2!!!!!!!!!!!!!!!!!
+2!!m!c-c-c-c-c-c-c-c-c[!2$-lZlZlZlZlZlZlZl-l`$`cZrrrrrrrrrrrrrq$
+1m!m-lrL2Mrrrrrrrrrr`c[!2$1q2L2rrrrrrrrrrm-l`$`c[rrrrrrrrrrrrrr$
+1m!m-lrrrrrrrrrrrrrr`c[!2$1rrrrrrrrrrrrrrm-l`$`c[rrrrrrrrrrrrrr$
+1m!m-lrL2Mrrrrrrrrrr`c[!2$1q2L2rrrrrrrrrrm-l`$`c[rrrrrrrrrrrrrr$
+1m!m-lrrrrrrrrrriL)M`c[!2$1rrrrrirrrrq)L)m-l`$`c[rrrrrrrrrrL)L2$
+1m!m-liq2q2MiMiriL)M`c[!2$1rrMrMiq2Miq)L)m-l`$`c[riq2q2Miq2L)L2$
+1m!m-liq)rrMiq2MiL)M`c[!2$1rrrrrrrrrrrrrrm-l`$`cZrrrrrrrrrrrrr`$
+1m!m-`!!!!!!!!!!!!!!-c[!2$-c-c-c-c-c-c-c-c1l`!2lZlZlZlZlZlZlZlZl
+[!!!2c1c1c1c1c1c1c1c1m!!!rmlXlXlXlXlXlXlXl[m!$rc1c1c1c1c1c1c1c1c
+1m2rmlXlXlXlXlXlXlXlXl[rrrrrrrrrrrrrrrrrrrrrr$rrrrrrrrrrrrrrrrrr
+rm!!!!J!!!!$rrrrrrrrrrrrrm!!!!!!!r!`-$!`-$!`-$2m!!!!!!2$!`-$!`-$
+!`-$qm!!!!!$m$!`-$!`-$!`-rHm!!!!!m-$!`-$!`-$!`2cHm!!!!2`-$!`-$!`
+-$!crrrm!rrrrrrrrrrrrrm$!`-$2$mc-c-c-c-c-c-cm$!`-$rcGhGhGhGhGhGh
+Glm$!`-rmhZlZlZlZlZlZlHm-$!`2r0lrrrrrrrq)Mmh[d-$!crcHMiq2L2MrL)r
+0lmd-$!rmhSq2Miq2MiL2cHrF`-$2r0k)riq2Miq)Mmh[c3`-$rcHrrrrrrrrrrr
+0lpc!`-rmh[rrrrrrrrrrcHr0$!`2r0liMirrrrrrrmh[h-$!crcHMiMrrrrrrrr
+0lmd-$!rmh[rrrrrrrrrrcHrF`-$2r0lrrrrrrrrrrmh[c3`-$rcHq)q2rrrrrrr
+0lpc!`-rmhSq)rrrrrrrrcHr0$!`2r0lrrrrrrrrrrmh[h-$!crcHc-c-c-c-c-c
+0lmd-$!rmhGhGhGhGhGhGhHrF`-$2$qlZlZlZlZlZlZlpc3`-$`$rrrrrrrrrrrr
+rh0$!`-m!!!$pcFh0cFh0cFd-$!`2!!!!r0cFh0cFh0c3`-$!c`!!!2`-$!`-$!`
+-$!`-$!m!!!$``-$!`-$!`-$!`-$2!!!!rrrrrrrrrrrrrrrrr`!!"!!!!!!!rrr
+rrrrrrrrrrrrrrrrrrrrrrrm!!!!!!!!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+errm!!!!!!!!!!!!!!2repIAepIAepHcepIAepIAepIArq[m!!!!!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIrhq[m!!!!!!!!!!!$rpIAXpIAel2AXpHcXpHcepIA
+errAhq[m!!!!!!!!!!2repHcepIAXpHcel2AXpHcepIArrrrrrrm!!!!!!!!!rrA
+epHcel2Ael2AXpHcel2AepIAepIAlr`!!!!!!!!$rpIAel2AXpIAXpHcel2AXpIA
+epIAepI[r!!!!!!!!!2repIAel2AepHcel2AXpHcepIAepIAeqrm!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epHcXpHcepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAXpHcXpIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epHcXpHcepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAXpHcXpIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rrA
+epIAepIAepIAepIAepIAepIAepIAlr`!!!!!!!!$rpIAepIAepIAepIAepIAepIA
+epIAepI[r!!!!!!!!!2repIAepIAepIAepIAepIAepIAepIAeqrm!!!!!!!!!rr[
+lqr[lqr[lqr[lqr[lqr[lqr[lqr[lr`!!!!!!!!$rrrrrrrrrrrrrrrrrrrrrrrr
+rrrrrrrrr!!!!!!!%!2rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrm!rdK
+)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)r`$r5%K)5%K)5%K)5%K)5%K)5%K
+)5%K)5%K)5%K)5%Mr!2p)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)52m!rdK
+)5%K)5%K)5%K)5%K)5%Mrrrrrrrp)5%K)5%K)r`$r5%K)l1a)l%K)5%K)5%K)r`J
+)#!J)#2p)5%K)5%Mr!2p)51a)l1a)5%K)5%K)52m)#!J)#!J)#2p)5%K)52m!rdK
+)5%K)5%K)5%K)5%Mr#!Mrr`J)#!J)#2p)5%K)r`$r5%K)5%K)5%K)5%K)52rrrhp
+rr`J)#!J)#2p)5%Mr!2p)5%K)5%K)5%K)rrrr#!Mrrrrrrrrrr`J)#2rrrrrrrdK
+)5%K)5%K)5%K)52m)#!Mrr`J)#!J)#!J)#2rXl2rr5%K)5%K)5%K)5(prIrm)#!J
+)#!J)#!J)#!J)rqcXrrp)5%K)5%K)5%K)5%KrIrm)#!J)#!J)#!J)#!Mrl1crrdK
+)5%K)5%K)5%K)5%KrIrrr#!J)#!J)#!J)#2rXl2rr5%K)l1a)l%K)5%K)5%KrIhr
+rrrrrrrrrr`J)rqcXrrp)51a)l1a)5%K)5%K)5%KrIhprIhprIhprrrrrl1crrdK
+)5%K)5%K)5%K)5%K)5%K)IhprIhprIhprIhrrrrrr5%K)5%K)5%K)5%K)5%K)5%K
+)5%K)5%K)IhprIhrr!2p)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)52m!rdK
+)5%K)5%K)5%K)5%K)5%K)5%K)5%MXl1cXl1a)r`$r5%K)5%K)5%K)5%K)5%K)5%K
+)5%K)51cXl1cXl%Mr!2p)5%K)5%K)5%K)5%MX5%K)5%K)5%K)l1cXl1cX52m!rdK
+)5%K)5%K)5%K)5%K)5%K)5%K)5%MXl1cXl1a)r`$r5%MXl%MX5%K)l%MXl%K)l1a
+)l%K)51cXl1cXl%Mr!2p)51cX51a)5%MX5%MX5%MX51a)l%K)l1cXl1cX52m!rdK
+)5%K)51a)l%K)51a)51a)l%MX5%MXl1cXl1a)r`$r5%K)5%K)l%MX5%K)l%K)l%M
+X51a)51cXl1cXl%Mr!2p)51cX5%MX51a)5%MX5%MX51a)l%K)l1cXl1cX52m!rdK
+)l1a)5%MX5%K)51cX51a)l%MX5%MXl1cXl1a)r`$r5%K)5%K)5%K)5%K)5%K)5%K
+)5%K)51cXl1cXl%Mr!2p)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)5%K)52m!rrr
+rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr`!!!!3!!!!!rrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrm!!!!!!2repIAepIAepIAepIAepIAepIAepIAepIAepIm
+!!!$rpIAiq2Miq2Miq2Miq2Miq2Miq2Miq2Miq2Mir2m!!2req2Mmr2cmr2cmr2c
+mr2cmr2cmr2cmr2cmq2Mmr`!!rrAir2crrrrrrrrrrrrrrrrrrrrrrrrrrrceq2c
+r!!$rpIMmrrrMirrMrrrrrrrrrrrrrrrrrrrrrrAir2m!!2req2crirrMirrrrrr
+rrrrrrrrrrrrrrrrrpIMmr`!!rrAir2rrrrrrrrrrrrrrrrrrrrrrrrrrrrreq2c
+r!!$rpIMmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrAir2m!!2req2crrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrpIMmr`!!rrAir2rrrrrrrrrrrrrrrrrrrrrrrrrrrrreq2c
+r!!$rpIMmrrrMirrMrrrrrrrrrrrrrrrrrrrrrrAir2m!!2req2crirrMirrrrrr
+rrrrrrrrrrrrrrrrrpIMmr`!!rrAir2rrrrrrrrrrrrrrrrrrrrrrrrrrrrreq2c
+r!!$rpIMmrrrrrrrrrrrrrrrrrrrrrq2Miq2MrrAir2m!!2req2crrrrrrrrrrq2
+rrrrrrrrriq2Miq2rpIMmr`!!rrAir2rrrrrrrrrrrrrrrrrrrrrMiq2Mirreq2c
+r!!$rpIMmrq2rirrrirrMrq2Mrq2rrq2Miq2MrrAir2m!!2req2crrrrMrrrMrq2
+rirrMrq2riq2Miq2rpIMmr`!!rrAir2rrrq2rirrrirrMrq2rirrMiq2Mirreq2c
+r!!$rpIMmrq2riq2rrrrMrq2rirrMrq2Miq2MrrAir2m!!2req2crrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrpIMmr`!!rrAir2crrrrrrrrrrrrrrrrrrrrrrrrrrrAeq2c
+r!!$rpIMipIAepIAepIAepIAepIAepIAepIAepIMir2m!!2req2Miq2Miq2Miq2M
+iq2Miq2Miq2Miq2Miq2cmr`!!!2rmr2cmr2cmr2cmr2cmr2cmr2cmr2cmr2cmr2m
+!!!!!!2rhpr[hpr[hpr[hpr[hpr[hpr[hpr[hpr[r!!!!!!$rrrIlqrIlqrIlqrI
+lqrIlqrIlqrIlqrIlqrrr!!!!rrrhpr[hpr[hpr[hpr[hpr[hpr[hpr[hpr[hpr[
+r!2rrrrIlqrIlqrIlqrIlqrIlqrIlqrIlqrIlqrIlqrrrrrrrrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrrrrrm!rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
+r!!!!"!!!!!!!!!$rrrrrrrrrrrrrrrrrrrrrrrrrrrm!!!!!!!!!!!!!!2rfp[E
+fp[Efp[Efp[Efp[Efp[Efrrm!!!!!!!!!!!!!rrEfp[Efp[Efp[Efp[Efp[Efp[E
+rr2m!!!!!!!!!!!$rp[Efp[Efp[Efp[Efp[Efp[Efp[rjr2m!!!!!!!!!!2rfp[E
+fp[Efp[Efp[Efp[Efp[EfrrMjr2m!!!!!!!!!rrEfp[Efp[Efp[Efp[Efp[Efp[E
+rrrrrrrm!!2rrrrrrrrrrrrrrrrrrrrrrrrrrp[Efp[Efp[Efr`$r+bXV+bXV+bX
+V+bXV+bXV+bXV+b[rp[Efp[Efp[Errb[jqIRjqIRjqIRjqIRjqIRjqIRjqIcrp[E
+fp[Efp[rr+rRmr2cmr2cmr2cmr2cmr2cmr2cjr2rfp[Efp[EfrrmVqIcrrrrrrrr
+rrrrrrrrMiq2r+rRmrrMfp[Efp[Errb[jr12rirrMrq2Mrq2rrq2MirmVqIcrq2M
+fp[Efp[rr+rRmirrMrq2rirrMrq2riq2Mrb[jr2riq2Efp[EfrrmVqIcMirrrirr
+Mrq2rirrMiq2r+rRmrrMip[Efp[Errb[jr2rrrrrrrrrrrrrrrrrrrrmVqIcrq2M
+fp[Efp[rr+rRmrrrrrrrrrrrrrrrrrrrrrb[jr2riq2Efp[EfrrmVqIcriq2rirr
+rrrrrrrrrrrrr+rRmrrMip[Efp[Errb[jr12riq2rrrrrrrrrrrrrrrmVqIcrq2M
+fp[Efp[rr+rRmrrrrrrrrrrrrrrrrrrrrrb[jr2riq2Efp[EfrrmVqIcrrrrrrrr
+rrrrrrrrrrrrr+rRmrrMip[Efp[Errb[jr2rMirrMrrrrrrrrrrrrrrmVqIcrq2M
+fp[Efp[rr+rRmirrMirrrrrrrrrrrrrrrrb[jr2riq2Efp[EfrrmVqIcrrrrrrrr
+rrrrrrrrrrrrr+rRmrrMip[Efp[Errb[jr#XV+bXV+bXV+bXV+bXV+bXVqIcrq2M
+fp[Efp[rr+rRjqIRjqIRjqIRjqIRjqIRjqIRjr2riq2Efp[Efr`$rr2cmr2cmr2c
+mr2cmr2cmr2cmr2crq2Mip[Efp[Er!!$rrrrrrrrrrrrrrrrrrrrrrrrrrrMiq2M
+fp[Efp[m!!!!!!!$rq2Miq2Miq2Miq2Miq2Miq2Mip[Efp[Efr`!!!!!!!2riq2M
+iq2Miq2Miq2Miq2Miq2Efp[Efp[Er!!!!!!!!rrEfp[Efp[Efp[Efp[Efp[Efp[E
+fp[Efp[m!!!!!!!$rp[Efp[Efp[Efp[Efp[Efp[Efp[Efp[Efr`!!!!!!!2rrrrr
+rrrrrrrrrrrrrrrrrrrrrrrrrrrrr!!!"!2rrrrk!!!!#J!!!!S!!!!+!!(i#M3#
+"!TB"!)+!!Q"#J!13!#+!(2mIJ!4J$i!#!!q!!3!2J!$!$id!2mq@!!!rJ!!!$i!
+!!!+!!!!#J!!"qS!!!IU!"!(kJ!!"qTSXdIUD*+RkJ85TqS&%UIUC4+RkQ)DTqS!
+!!IU!!!!#rrrrr[rrrrlrrrrqrrrrr[rrrrlrrrrqrrrrr[rrrrlrrrrqrrrrr[r
+rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[rrrrlrrrrqrrrrr[r
+rrrlrrrrqrrrrr[rrrrlrrrrqrrrrr[rrrrlrrrrqrrrrr[rrrrlrrrrq!!!"!!r
+rr`!)!!'!#!3"3!J!!5!*&D%3#494q!LP8!J)T9!)#%93#!J!!!J)!!!)#!!!#!J
+!!!J)!!!)#!!!#!M3!!J*B!!)#!!!#!J!!!J)!!!)#!!!#!J!!!J)!!!)#!!!#!M
+3!!J*B!!)#!!!#!J!!!J)!!!)#!!!#!J!!!J2rrri$rrr!!rrri!2rrr!$rrri!r
+rrr!2rrri$rrrq!rrrrJ2rrri$rrrq!rrrrJ2rrri$rrrq!rrrrJ2rrri$rrrq!r
+rrrJ2rrri$rrrq!rrrrJ2rrri$rrrq!rrrrJ2rrri$rrrq!rrrrJ2rrri$rrrq!r
+rrrJ2rrri$rrrq!rrrrJ!!!%!(rrrq#!!!!4!!!!#4rrriNJ!!"*)!!!55D!!%NV
+!!"*)!!!55!!!%NJ!!"**S!!55X!!%NJ!!"*)!!I55!3(dNJ!"p*+PDI55*9AdNL
+P9p*+a9I55!!!%NJ!!"*(rrrL3!!!!M!!!!`Irrri0YYY['5555EYYYY[rrrrrhr
+rrriIrrri2rrrr(rrrrjrrrrqIrrrrRrrrrjrrrrqIrrrrRrrrrjrrrrqIrrrrRr
+rrrjrrrrqIrrrrRrrrrjrrrrqIrrrrRrrrrjrrrrqIrrrrRrrrrjrrrrqIrrrrRr
+rrrjrrrrq2rrrr"rrrrJrrrrmIrrrr[rrrrrrrrrrIrrrrJ!!!3!$rrrJ!J!!-!)
+!!#J#!!!N!J!!)J)!!$mrrr`"3!!#!Crrq3'J!!8"S!$P!DUdj3'UUZ8"V+VP!D!
+!"3'J!!8"TS!&!DX!"3'J!!8"S!!&!DD!"3'V!!8"S!!&!D!!"3'IrrN"3!!#!6r
+rr!%#!!!"!J!!!3)!!!%#!!!"!rrrr`2rrq!$rrr`!rrrq!2rrr`$rrrq!rrrrcr
+rrrprrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrprrrrr2rrrr`2rrrm$rrrr!rrrr`2
+rrrm$rrrr!!!!32rrJ!'8!DJ"J!'!!C3"U!'!!B#"J!'UXBUjT+Q!!Irrrrrrrrr
+rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrm!!!"!Ir"!'%S89"j!!N!#5J*8!N!
+#3!*9BP9b9A**8N!#Irjrm(riIrarrRrqIrjrrRrqIrjrrRrqIrjrrRrqIrjrrJ!
+!!%"rrS!"RrQP"DS&S!@U[DUpT+fJ"CrjJ!&rrM9@DUYrrhrqrrrrrrrrrrrrrrr
+rrrrrrrrrrrrrrhrq2rjrrhrr!!!!3"ri%!`3#RrrJ!QIbD!TTUQV+D!TS#QIbB!
+*Ir%3!4rr(rJIr"rqIrrrrrrrrrrrrrrrrrrrrrrrrrprrarr(rm!!!#!rrrrrrr
+rrrrmc-c-c-c-crc2cmc-c-c2r2cmc-c-c-rmc-c-c-c-crc-c-c-c-c2r-r2c-c
+-c-rmr2c-c-c-crc-c-c-c-c2r-c-c2c-c-rmc-c-c-c-crcmr2cmrmc2r-cmr2c
+rr-rmr-r-r2cmcrc-c-c-c-c2rrrrrrrrrrm!!!#!$rrrrrrr!!!2$!`-$!r`!!r
+!B'$!cmm!$`B'$!`2rr!2`-$!`-$1m!m-$!`-$!l`$m"JB-$!c[!2"JB-$!`1m!r
+!`-$!`-l`$``-$!`-$[!2aXE'aQ$1m!m'"JB'CJl`$m"JaXCQc[!2$!`-$!`1m!r
+ZlZlZlZl`$rrrrrrrrr!!!!#!$rrrrrrrrr$mc-c-c-c-crcZlZlZlZl[r1q2Mrr
+rr1rmk2Mrrrrmlrc[rrrrrrc[r1Miq2L)r1rmk2Miq)Mmlrc[MrMiq2c[r1rrrrr
+rr1rml-c-c-c-lrlZlZlZlZl[$rrrrrrrrr!!rXl1cXl1m!rXl1cXl1cr$rrrrrr
+rrrm!!!#!!!rrrrrrm!!!$``-$!cr!!!2`-$!`2h`$rrrrrrrrrrmc-c-c-c`crc
+GhGhGh[`2r0rrrrrHm-rmhrL2Mplm$rcIMiMrh[$2r0rrrrrHr!rmhrrrrpl`crc
+GhGhGh[`2r1lZlZlZm-m2rrrrrrm-$`!2`-$!`-$2!!rrrrrrrrm!!!%!rrrrrrr
+rrrrrrrrrrrrrrrmU+LSU+LSU+LSU+LSU+[rr+LVr+[mU+LSU+LSU+LVrrbVr+[m
+U+LSU+LSU+LSUrrmU+LSU+LSU+LSU+LSU+[rr+LSU+LSU+LSU+LSU+LVrrbSUrbV
+r+LSU+LSU+LSUrrmUrbVr+LSU+LSU+LSU+[rr+LSU+LSU+LSU+LSU+LVrrbSU+LS
+U+LVr+LSU+LSUrrmU+LSU+LSU+LSU+LSU+[rr+[mUrbVr+[mUrrmU+LVrrbSU+[m
+UrbVr+[rrrbSUrrmUrbSUrbSUrbVr+[mU+[rr+LSU+LSU+LSU+LSU+LVrrrrrrrr
+rrrrrrrrrrrrrr`!!!3!!rrrrrrrrrrrrrrm!!!!!!2repIAepIAepIArr`!!!!$
+rpIAXpHcepIAerrIr!!!!rrAXpHcepIAepIrrrrm!!2repIAepIAepIAepI[r!!$
+rpIAepIAepIAepIAlr`!!rrAel2AXpIAepIAeqrm!!2rel2AXpIAepIAepI[r!!$
+rpIAepIAepIAepIAlr`!!rrAepIAepIAepIAeqrm!!2rel2AXpHcel1cepI[r!!$
+rpHcel2AXpHcXl2Alr`!!rrAel2Ael2AXl1ceqrm!!2repIAepIAepIAepI[r!!$
+rqr[lqr[lqr[lqr[lr`!!rrrrrrrrrrrrrrrrrrm!!!!"!!$rrrrrrrrrrrrrrrr
+rr`$rp[Efp[Efp[Efp[Efp[ErrrElqr[lqr[lqr[lqr[lrrrfqrrMrq2rrrrrrrr
+fqrrrp[[Mrq2rrrrrrrrrp[[rrrElrrrrrrrrrrrrrrElrrrfqq2rirrMrq2Mirr
+fqrrrp[[Mrq2rirrMiq2rp[[rrrElrq2rrq2rirrMrrElrrrfqrrrrrrrrrrrrrr
+fqrrrp[[fp[Efp[Efp[Efp[[rrr[lqr[lqr[lqr[lqr[lr`$rrrrrrrrrrrrrrrr
+rr`!!!2rlp[[fqrElp[[fqrm!!2rlp[[fqrElp[[fqrErr`$rrrrrrrrrrrrrrrr
+rrrm!!!%!!!!!rrrrrrrrrrrrr`!!!!!!!2mV+bXV+bXV+rrr!!!!!!$r+bXV+bX
+V+b[rqrm!!2rrrrrrrrrrrrrrrrrrrrmV+bXV+bXV+bXV+rmV+rrr+rVkq[Vkq[V
+kq[cr+b[rrb[krrrrrrrrrrVmrbXVrrmVq[rriq2rirrkr2mV+rrr+rVrirrMirr
+rq[cr+b[rrb[krrrrrrrrrrVmrbXVrrmVq[rrrrrrrrrkr2mV+rrr+rVkq[Vkq[V
+kq[cr+b[rrb[mr2cmr2cmr2cmrbXVr`$rrrrrrrrrrrrrrbXV+rm!!!$r+bXV+bX
+V+bXV+b[r!!!!rrrrrrrrrrrrrrrrr`!!!"SC9QPY)$8Z-b`J)%eKBdp6)(*PE'9
+KFf8J-J!!!!`!+!!S!43"S`#!998!!!!L!!%!!!!!!-N")3$G!9X%!Np,!!!!!!!
+8!#3!Y`&CL!*H-!!!!!,rr`!!!"B!!!!!!!!!E3!D!)%!9!3'3R9dG'pZ!!!!%J!
+!!!!!!!!0!"F!,3!hS!)!J!!!!"`!!!!!!!!!$3"1!'B"CSJ,8h4KG'PM)&4PH(3
+!!!!!&3!S!#J"%!'R!!!"!!%!!!!!!!#!!!!!!"8!43"-!'S!G`!&!3!"!!!!!!!
+!J3!!!!!9!*8!J!%P!1`!"3%!!3!!!!!!!))!!!!!&3!Z!#B!D3"d!!8"!!%!!!!
+!!!#$!!!!!"8!13!m!-B"Z3!!!3!"!!!!!!!!K!!!!!%!!!'!!!!#3!!IrDri)!2
+3"#!"m!)3!rJ'#!rm#JJ(q"3)$r!S#!IJ8!J2`+!)"i&`'!m"q#J'!raB$![qZ!!
+ArlJ),rpB!&rq+!$rr"J"2rJ)!6r`#!2rq!J')L3)!c!##"jc0!JZCQ3)IQCN#,c
+-b!6-6-3$Kr-i!!2!!!!"J!!!!B!!!!2!!"rrlrJrrrrm2rrrrKrrrri2rrrq$rr
+rr!rrrrJ2rrr`$rrri!rrrr!Irrri2rrrr(rrrrlrrrrrrrrrrhrrrrirrrrm(rr
+rq!rrrr!2rrri$rrrr!rrrri2rrrm$rrrr!rrrr`2rrri"mrrr!1(mcJ!!m!!!!'
+!!!!!!J!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!2L2!!!!!!!!!!!2rrrrrrq*Q2$
+rrrrrm!!!m!!!!!!!qCQ2!!!!!!m!!2$-c-c-c-qCR`c-c-c-m!!2c-c-c-cIQCR
+mc-c-cI!!!2h-c-cGqCQCRpc-c0h`!!$`c-c-hjQCQI$-c-hI!!!!m-c-c0qCQCm
+!c-cGm!!!!2$-c-cIQCR`$-c0h`!!!!$`c-c-hjQI!-c-hI!!!!!!m-c-c0qCm!c
+-cGp[!!!!$r$-c-cIR`$-c0hjP[!!!2M`c-c-hr!-c-hIQCP[!!q*m-c-c0m!c-c
+GqCQCP[$iQI$-c-c3$-c0hjQCQCP[q*R`c-c-d-c-hIQCQCQCE`q*m-c-c0c-cGq
+CQCQCP[!!q2$-c-c-c2rjQCQCQ@m!!!r`c-c-c-r-qCQCQCE`!!!!m-c-c-c2c2Q
+CQCP[!!!!!2$-c-c-hrqIrjrrrr!!!!$`c-c-cIc-r-cmc2c2!!!!m-c-c0hrc2r
+-c-c-c2!!!2$-c-hIr-rrc'E-rmm!!!$`c-cGqIc2r-Emcrc2!!!!m-c0hjRmcrc
+2r-rmc`!!!2$-hIqIc2r-rmcrc2!!!!!2cGm!rmc2c2r-rmc2!!!!!2r`!!rrp[m
+!r`$rm!!!!!!!!!!!pQm!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!%!q[%(#3--
+KaL1-)4`L2Q!ri2jKI#(+)N%R95p9'P8"UMqmIrjrrcrq2r`rr(rqrrrrrRrm2ri
+rrcrr2rmEr`'U!!!!J!$rrrM`rrm!$`!!$jm!!2!2c-c0rmc-h`$mc0qI$-h`!2c
+-hr$-h`!!r-cI$-hr!!Mmc0$-hjR`LIc-$-hjQCrjr-c-rjQCB!rmc-r2rjm!!2c
+-crr-r2!!r-cmcmc-c`$mcIr2cmr2!2cIRmr2cmm!$r$mcmr2c`!!!!r`m2$`!!!
+%!!!!!!$rrrrrrrrrrrrrrrrrrrrrrrrr!!!!!!!!!!!!!!!!!2repIAepIAepIA
+epIAepIAepIrr!!!!!!!!!!!!!!!!rrAepIAepIAepIAepIAepIAerb[r!!!!!!!
+!!!!!!!$rpIAepIAepIAepIAepIAepIAr+b[r!!!!!!!!!!!!!2repIAepIAepIA
+epIAepIAepImV+b[r!!!!!!!!!!!!rrAepIAepIAepIAepIAepIAerbXV+b[r!!!
+!!!!!!!$rpIAepIAepIAepIAepIAepIArrrrrrrrr!!!!!!!!!2repIAepIAepIA
+epIAepIAepIAepIAepIm!!!!!!!!!rrAepIAepIAepIAepIAepIAepIAepIAer`!
+!!!!!!!$rpIAerrrrpIrrrrArrrrerrrerrrepIAr!!!!!!!!!2repIAepIAepIA
+epIAepIAepIAepIAepIm!!!!!!!!!rrAepIAepIAepIAepIAepIAepIAepIAer`!
+!!!!!!!$rpIAerrrrpIrrrrrerrrrrrArrrrepIAr!!!!!!!!!2repIAepIAepIA
+epIAepIAepIAepIAepIm!!!!!!2rrrrrrpIrerrrrrrAepIAepIAepIAepIAer`!
+!!!$r!!!!!!$rpIm!!!!!rrAerrArrrrerrrepIAr!!!!!2mVprFVprRrrb[hpb[
+krrAepIAepIAepIAepIm!!!!!!2rh+rIjrrAr!2FVq[repIAepIAepIAepIAer`!
+!!!!!rb[hprVrr`$h+rVrpIAepIAepIAepIAepIAr!!!!!!$rprIhqIm!pb[krrr
+epIAepIAepIAepIAepIm!!!!!!2mVpb[k!#[hq[repIAepIAepIAepIAepIAer`!
+!!!!!rrFVp`$hprRrpIAepIAepIAepIAepIAepIAr!!!!!!$rprFVpb[rrrAepIA
+epIAepIAepIAepIAepIm!!!!!!2mVprFVrb[rrrrerrAepIAepIAepIAepIAer`!
+!!!!!rrFVprIrrrmVprmVrrAepIAepIAepIAepIAr!!!!!!$r+rIhrrFVrrFVprF
+VrrAepIAepIAepIAepIm!!!!!!2rh+rVrrrIrprmVrrIrpIAepIAepIAepIAer`!
+!!!!!rb[kr`$r+rmVrrIr+rrepIAepIAepIAepIAr!!!!!!!!rrrerb[hrrIr+rr
+hrrAepIAepIAepIAepIm!!!!!!!!!rrAerrrerrArpIrepIAepIAepIAepIAer`!
+!!!!!!!$rpIAepIAepIAepIAepIAepIAepIAepIAr!!!!!!!!!2rrrrrrrrrrrrr
+rrrrrrrrrrrrrrrrrrrm!!!!!!!%!$rrq!!J!!`!)!!+!#!!#3!J!!L!)!!)3#!!
+$q!J!!!J)!!!)#1lYL!J!!!J)!!!)#1plL!J!!!Jq[!!)38*GL%$$!!JK4J!))i`
+!##%F!!JL-!!))#!!##$!!!JKG!!))FS!##*"!!JR93!),98!#"T9!!J*UJ!)#!!
+!#!rrrrJ2rri!$rrr!!rrri!2rrr!$rrri!rrrr!2rrri$rrrq!rrrrJ2rrri$rr
+rq!rrrrJ2rrri$rrrq$rrrrKrrrriIrrrq$rrrrJrrrri2rrrq$rrrrJrrrri2rr
+rq$rrrrJrrrri2rrrq$rrrrJrrrri(rrrq!rrrrJ2rrri$rrrq!!!!J!!!2rrrrr
+rrrrrrr!!!!!!!!$m$!`-$!`-$!cr!!!!!!!!m-$!`-$!`-$!r2!!!!!!!2`-$!`
+-$!`-$2c2!!!!!!$``-$!`-$!`-$mc2!!!!!!r!`-$!`-$!`-r-c2!!!!!2$!`-$
+!`-$!`2rrrr!!!!$m$!`-$!`-$!`-$!c`!!!!m-$!`-$!`-$!`-$!m!!!!2`-rrc
+rr2rmr`rm$2!!!!$``-$!`-$!`-$!`-$`!!!!r!`-$!`-$!`-$!`-m!!!!2$!rr$
+rrmrrm2r``2!!!!$m$!`-$!`-$!`-$!c`!!$rrr$`rrr!`-$!`-$!m!!2!!!2$`!
+!r!m2r`rm$2!!$mc-cIr-c0r!`-$!`-$`!!$mc0m2$-hm$!`-$!`-m!!!r-cIm-c
+I`-$!`-$!`2!!!2c-h`c0r``-$!`-$!c`!!$mc0$-hm$!`-$!`-$!m!!!r-`-cI`
+-$!`-$!`-$2!!!2c-c2r!`-$!`-$!`-$`!!$mc-r2r`m-$!`-$!`-m!!!r-c2rmc
+mm-$!`-$!`2!!!2c-r-r-c-m-$!`-$!c`!!$mcIr2cmr2`-$!`-$!m!!!r0m2cmr
+2c``-$!`-$2!!!!r`r-r2cmr!`-$!`-$`!!!!r!rmr2cm$!`-$!`-m!!!!2$!`-$
+!`-$!`-$!`2!!!!$rrrrrrrrrrrrrrrr`!!!!!)!!rrrrrrm!!!$`!!!!$r!!!2!
+!!!!2c`!!m!!!!!rrm!$`!!!!!!$`!2!2$r$r!2!!m!!!!!!!m!$r!2m2$`$`$mc
+rc2!!!2!2c2r-m2m!m!r-r-m!!!$`$mr-m!m2!2!2c-m!!!!!m!r-m!!!!!$`$mm
+!!!!!!2!!rrrrrrrrm!!!!%!rm#!B)"3J(L!#*E)J!M056)*-XNN#8P*%!NJ#8!)
+rrMr`2rJrr$rq2rirrMrq2rjrrRrqIrjrrRrqIrjrrMrq!!!%!!!!!!!!!!!!!!!
+!!!!!!2rr!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$rZERr!!!!!!!!!!!
+!!!!!!!!!!!$rrrrrrrrrrrrrrlRPjVRr!2rrrrrrrrrrr`!!!!!!r`!!!!!!!!!
+!!!!!rqAQjERr!!!!!!!!!!!!r`!!!!$r!#[hpb[h+rIh+rFVrqAQjIm!+rIh+rF
+VprFVr`!!!!$rprFVprIh+rIh+rVrjZAQjIrhpb[hprIh+rVr!!!!!!$rqIIh+rI
+h+rVkrqAQjHEQjIrjprFVpb[kqIm!!!!!!2m!+rIh+rIhqIrPjZAQjHAr!2FVprF
+Vq[Rr!!!!!!!!r`$h+rIhpb[krqEPjZAQr`!!prFVprVjr`!!!!!!!!$r!2Ihpb[
+hprRrjHEPj[m!!#[h+rIkqIm!!!!!!!!!!2m!+rIhpb[hq[rPjHEr!!$hpb[hq[R
+r!!!!!!!!!!!!r`$hprFVprIjrqAQr`!!+rFVprVjrqrr!!!!!!!!!2rr!#[h+rI
+h+rVrj[m!!2IhprIjq[rPjZrr!!!!!!$rZIm!pb[hprIhqIrr!!$h+rFVqIVrjZA
+QjHrr!!!!rlRPr`$hpb[h+rIkr`!!+rIhprVjrqAPjZAQjHrr!2qjjHEr!#[hpb[
+hprN!!2Ihpb[kqIrQjHEPjZAQjHrrrlRQjIm!pb[hprFVqJ!Vpb[hq[RrjHEPjZA
+QjHEQm2m!rlRQr`!VprIh+rIjprFVprVjrqAQjHEPjZAQjHrr!!!!rlRr!2Ih+rI
+hprFVprIrrrrPjZAQjHEPjZA[r`!!!!!!rrm!pb[hpb[h+rIhrrFVrqEPjZAQjHE
+Plrm!!!!!!!!!r`$hpb[hpb[hpb[r+rIrjHEPjZAQjHrr!!!!!!!!!!$r!#[hpb[
+hprFVq[rrrqArrrrPrrrrrrrr!!!!!!!!!2m!pb[hpb[hprVr+rFVrb[hprmVpb[
+r+rIr!!!!!!!!r`$hprFVprIjqIrrprIrrrFVprFVprIhpb[r!!!!!!$r!#[hprF
+Vq[Vrrb[hrrrr+rI`lrFVrrmVr`!!!!!!!2m!pb[h+rVjrqArpb[rrb[hm2rh+rr
+rprIr!!!!!!!!r`$hpb[kq[rPj[rhprrrprIrrb[hrrmVprm!!!!!!!$r!#[hq[R
+rrqErpb[rrrFVrrmVprrr+rIr!!!!!!!!!!$rprRkr`!!rrmVprIr+rIrrrIhrrr
+h+rIr!!!!!!!!!!$rrrm!!!!!rrrrrqrrr`!!rrm!!2rrr`!!!!!!!!!!!!!!!!!
+!!!!!rqr`r`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrm!!!!!!!!!!!!
+!!!!!!!!!!!3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrrrrrre!!$rrrrr!!!!!!!!!!!
+!!!!!!!!!!!!!!2m!!!!!!2m!r`!!!!$r!!!!!!!!!!!!!!!!!!!!!!!!rb[hpb[
+hqIrr+rIh+rVr!!!!!!!!!!!!!!!!!!!!!!!!rrFVprRrpIm!pb[kr`!!!!!!!!!
+!!!!!!!!!!!!!!!$r+rIhq[rr!2FVq[m!!!!!!!!!!!!!!!!!!!!!!!!!!2rhprI
+jr`$h+rVr!!!!!!!!!!!!!!!!!!!!!!!!!!!!rb[h+rS!+rIkr`!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!$rpb[h!2IhqIm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2rhpb[
+h+rIrp3$r!2m!!2m!r`!!!!!!!2m!!!!!!!!!rb[hpb[hr`!!!2rrrrrrrrrrrrr
+rrrrrr`!!!!!!!!$rpb[hprm!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!2mVprI
+r!!$rr`!!rrrrrrre!!$rrrrr!!!!!!!!!!!!rrFVr`!!!2m!!2m!!!!!!2m!!!!
+!!!$r!!!!!!!!!!$r+rm!!!!!rrm!!!!!!!!!!!!!!2Ih+rVr!!!!!!!!!!$r!!!
+!!!$r!!!!rrrr!!$rr`!!pb[kr`!!!!!!!!!!!!!!!!!!!2m!!2m!!!$rr`!!r`!
+Vq[m!!!!!!!!!!!!!!!!!!!!!rrm!!2m!r`$r!!$r!2Vr!!!!!!!!!!!!!!!!!!!
+!!!$r!!!!r`$rr`!!r`!!r`!!!!!!!!!!!!!!!!!!!!!!!2rrr`$r!2m!!2m!!2m
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2m!!!$r!!$rp3!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!r`!!r`!!!!!!!2rr!!$rr`!!!!!!!!!!!!!!!!!!!!$r!2m!!!!!!!$
+rprIrrrIhr`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!2rhprrrprIr!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!rrIhrrIhr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
+rprrhprm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2rhprIr!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!rrIhr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
+rprm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3!!!2rrrrrrZIm!rrrrr`!!!2m
+!!!!!!2rPr`!!!!$r!!$r+rIh+rIjrrmVprFVq[m!!2rh+rIjrqAr!2FVq[m!!!$
+r+rIhq[rr!2FVq[m!!!!!rrIhprRr!2FVq[rr!!!!ZImVpb[k!#[hq[rPj[m!ZHA
+rpb[h!2IhqIrPjZAPrrrQrrIh+rFVrrrPjZAQl`!!rrmVprFVrb[rrrrQr`!!!!$
+rpb[hprrrrb[hrb[r!!!!rb[hprrh+rrh+rIh+rm!!2rh+rVrrrIrprmVrrIr!!$
+r+rVrjImVrb[rprmVr`!!!2rr!2mVprrhrb[rprm!!!!!!!!!rrm!r`$r!2m!!!!
+"!!!!rrrrrrrrrrrrr`!!!!!!!2repIAepIAepIrr!!!!!!$rpIAepIAepIAr+rm
+!!!!!rrAepIAepIAerrrrr`!!!2repIAepIAepIAepIm!!!$rpIArpIrrpIrrpIA
+r!!!!rrAepIAepIAepIAer`!!!2rrpIArrrArpIrepIm!!2rhprrrprIrpIAepIA
+r!!$rprIrrrIhrrArrrAer`!!rrIhrrIhrrAepIAepIm!!2rhrrIhrrAerrArpIA
+r!!$rprIhrrAepIAepIAer`!!rrIhrrAepIAepIAepIm!!2rhrrAepIAepIAepIA
+r!!!!rrrrrrrrrrrrrrrrr`!!!!%#!!S!!!!!!"3"@J!S!E`%"%CTEQ3!!!!!!$!
+"@3"%!EX%"e*PF'aKBf9M!!!!!!"0!9S!B3'm"!j5CA"XB@0P)#BJ4QPZC!!!!!!
+!D3&D!(d"[!3,8Q9`E'&MC5""E'bQ!!!!!!"h!&)!L3#m"3Y*Cfj[FQ8J3f&cCAF
+!!!!!!(J!a!#+!5i&"P*PCf9iF!!!!!!!M`"5!+%![!8,4@jdDA*P)&G[FQ4%!!!
+!!!!8!&8!0J%l%!P&C'Pd)&4PH(5m!!!!!!"#!&8!C!%l%!P&C'Pd)&4PH(4D!!!
+!!!!6!#d!)`"5L!9'D@jN1UB!!!!!!%3!&J"8!&+)#&*PF'aKBf8k!!!!&3"&!#)
+!m!(Y!!3"!!%!!!!!!!#&!!!!!1J!!!!!!1J!!J!"#%GKFQCTC@aN!!!!!!!!!!!
+!!!!!!!!!!!!!!,%1([G#4!!!!!![fJa3HA4SEfiJ-5ie,M%!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#rEX@T1)J"
+h!&B"qJ'$rrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!8T8aKEQGeB@GPFbp6Bh*TF(4
+TEQF!!3!%!!![fJ!#!#T(BA*QD@9XC$UP6'&ZCh9KCf9c,e0MFQP`G'PZCcT3HA4
+SEfiJ-5ie,M(rr`!!!!!!%&4&@&4dG(Kd!+J`-6Ja!!!!!!)!!!!!!!!!!!!!!!!
+!!!!!!!$rrrrrm!!!!!!!!!!!!!!!m!!!!2m!!!!!!!!!!!!!!2$r!!$`m!!!!!!
+!!!!!!!$Xrq!!rrm!!!!!!!!!!!!!c`r`!!!2!!!!!!!!!!!!!1rrrJ!!$q!!!!!
+!!!!!!!$`!2m!!!rJ!!!!!!!!!!!2rJlrm!!2i!!!!!!!!!!!!-!!!!!!$1!!!!!
+!!!!!!!$`-`!`!2rr`!!!!!!!!!!!m1-!-`$q$r!!!!!!!!!!!2!1-c-`rrr!!!!
+!!!!!!!$`!!!c!2i2m!!!!!!!!!!!m!!!-!$q$r!!!!!!!!!!!2rrrmrmrrr!!!!
+!!!!!!!!!$ZlZlXc-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%!!!!!!$rJ!!!J-!!!,#J!!#`m!!!@"!!
+!2JB!!#-'!!"MKJ!!!!)!!#b2!!!XcB!!*qm!!#$0J!!JMB!!2fm!!!I`!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!2q!!!$r`!!!rq!!!2r`!!$rm!!!rrJ!!2ri!!(rq!!!rrJ!
+!2rq!!$rrJ!!rri!!2rq!!$rrJ!!rri!!"rm!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3$rrm!
+!J!"!!)!!3!#!!%!!J!"!!)!!3!#!!%!!J!"!!)!!3!#!!%!!J!"!!)!!3!#!!%!
+!J!"!!)!!3!#!!%!!J!"!!2rr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2rr`!$rrm!!rrr!!2rr`!$rrm!
+!rrr!!2rr`!$rrm!!rrr!!2rr`!$rrm!!rrr!!2rr`!$rrm!!rrr!!2rr`!$rrm!
+!rrr!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!#!2rrrrrrrrrrr`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!m!!!!!!!!!!2!!!!!!!!!2!!!!!!!!!!$`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!m!!!!!!!!!!2!!!!!!!!!2!!!!!!!!!!$`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!m!!!!!!!!!!2!!!!!!!!!2!!!!!!!!!!$`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!m!!!!!!!!!!2!!!!!!!!!2!!!!!!!!!!$`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!m!!!!!!!!!!2!!!!!!!!!2!!!!!!!!!!$`!!!!!!!!$`!!!!!!!!!!m!!!!!!!!
+!rrrrrrrrrrrr!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!#!!!!!!!!!!!!!!!!!!!!!!!!!+!!!!#J!!!!!!!!!!!!!!Skrrrk1[!!!!!
+!!!!!!!#M-kc-Sc1Z!!!!!!!!!!!!#M-kbM-krJ!!!!!!!!!!!!qM-k-cS2i!!!!
+!!!!!!!!2bM-c1X$q!!!!!!!!!!!!$mbM-cc!rJ!!!!!!!!!!!!r+-c-c`2i!!!!
+!!!!!!!!2Sc1M-k$q!!!!!!!!!!!!#M-kbM-krJ!!!!!!!!!!!+-cV-bM-ki!!!!
+!!!!!!!!+1Xc-bM-k!!!!!!!!!!!!$kc-c-bMVJ!!!!!!!!!!!!m!!!!!b[i!!!!
+!!!!!!!!2rrrrrrrq!!!!!!!!!!!!!!$ZlZlZlJ!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"!!!!!!!)#!!
+!(ri!!$iq!!!IIJ!!(rS!!"Ib!!!6iJ!!&r)!!"rk!!!IIJ!!2Mi!!"`I!!!B$J!
+!%!B!!"rq!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!J)!!!IrJ!!2rm!!"rr!!!Ir`!
+!(rm!!"rr!!!Ir`!!(rm!!"rr!!!rr`!!(rm!!"rr!!!Ir`!!(rm!!!2r!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2rrr
+rrr!!!!!!!!!!!!!!$`!!!!$q!!!!!!!!!!!!!!m2rrrrrrrr!!!!!!!!!!!2!!$
+`!!!!$`!!!!!!!!!!$`rrm2rrr`rJ!!!!!!!!!!m!!2!!!!!2i!!!!!!!!!!2$rr
+`rrrr$q!!!!!!!!!!$`!!m!!!!!rJ!!!!!!!!!!m2m2$rrrm2i!!!!!!!!!!2!!$
+`!!!!$q!!!!!!!!!!$rrrm2m!!!rJ!!!!!!!!!!$Zl[!!!!!2i!!!!!!!!!!!!!$
+rrrrrrq!!!!!!!!!!!!!!!1lZlZlJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%
+!!!!!!!!!!!"ri!!!3$!!!&rr!!"#!3!!A[f!!%)"J!"HrB!!3J'!!&VpJ!"#!B!
+!IX'!!$i"J!!$ri!!!2q!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(rJ!!"rm!!
+!Irm!!(rr!!"rri!!Irq!!(rrJ!"rri!!Irq!!(rrJ!"rri!!2rq!!!2rJ!!!ri!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!3!'q!!!#33!!!J#!!!*$3!!"[X!!"rrJ!!`H-!
+!B(M!!0ai`!#FH-!!R(M!!-"i`!"JH-!!2rr!!"rr`!!!H!!!!(J!!!!i!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!Ei!!!2r!!!$ri!!!rr!!!'q`!!(rq!!$rr`!"rrm!!rrr!!2rr`!$rrm!
+!rrr!!(rr`!!rrm!!(rr!!!"i!!!!H!!!!$J!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#!!!!$r$rrr!
+!!!!!!!!!!!!!!2!2!!!2!!!!!!!!!!!!!!$`!!!!!2!!!!!!!!!!!!!!m!m!!2m
+2!!!!!!!!!!!!!!r`rrr3r`!!!!!!!!!!!!%F`Frr`Fr3!!!!!!!!!!!G%4%Irp%
+4r3!!!!!!!!!"d4%4(rr4%Id!!!!!!!!!(4cF%4rrd4(p!!!!!!!!!"%Gr4%Irp%
+4r3!!!!!!!!$4(0`4(rr4%Id!!!!!!!!!ha%4%4rrd4(p!!!!!!!!!!ha%4%Irp%
+4r3!!!!!!!!!!hrrrrrrIrrd!!!!!!!!!!!hGhGrrhGhG!!!!!!!!!!!!!!!2rp!
+!!!!!!!!!!!!!!!!!$rr3!!!!!!!!!!!!!!!!!!$Gd!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!$rrrrrrrrrrrm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2m
+!!!!!!!!!rrm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!r`$rr`!!!!$r!2m!!!!!!!!
+!!!!!!!!!!!!!!!!!!!$j+rrrq3!!!2rrrrm!!!!!!!!!!!!!!!!!!!!!!!!!!#[
+r!2rr!!!!!!!!r`!!!!!!!!!!!!!!!!!!!!!!!!!!qIrrrrrj!!!!!!$rq3!!!!!
+!!!!!!!!!!!!!!!!!!!$r!!!!rrm!!!!!!2rj!!!!!!!!!!!!!!!!!!!!!!!!rrr
+j!2Rrrrm!!!!!rrN!!!!!!!!!!!!!!!!!!!!!!!!!+`!!!!!!!!!!!!!Vq3!!!!!
+!!!!!!!!!!!!!!!!!!!$r!0MB!!$B!!!!rrrrrbX!!!!!!!!!!!!!!!!!!!!!!2m
+!qGJ!!0MB!!$rr!$rr`!!!!!!!!!!!!!!!!!!!!!!r`!!qGMBf0MB!2rrrrmV!!!
+!!!!!!!!!!!!!!!!!!!$r!!!!!!$Bf!!!rr`!rrm!!!!!!!!!!!!!!!!!!!!!!2m
+!!!!!!0J!!!$rr!$rr`!!!!!!!!!!!!!!!!!!!!!!rrrrrrrr+rrr+rrrrrmV!!!
+!!!!!!!!!!!!!!!!!!!!!!!$jqIRjqIRj+bXV+`!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3
+!rrrrrrrrrrrrrrrrrrrrrrrr!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!!!!!
+!r`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!!!!!
+!r`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!!!!!
+!r`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!!!!!
+!r`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!!!!!!!!!
+!r`!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!!!!!!!!!!2rrrrrrrrrrrrrrrrrrrrrrr`!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!$F!!!!!!!!!0`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!h#2Errrrrrr
+E)pcr!!!!!!!!!!!!!!!!!!!!!!!!!0XM)b2E+bXVfb-M)p[j!!!!!!!!!!!!!!!
+!!!!!!!!!!0`M)b2F+p`M)b2FrrN!!!!!!!!!!!!!!!!!!!!!!!!!rp`M)b2F)b-
+Mh!$rq3!!!!!!!!!!!!!!!!!!!!!!!!$r+p`M)b-M)p`V!2rj!!!!!!!!!!!!!!!
+!!!!!!!!!!2mV+p`M)b2E+bX!rrN!!!!!!!!!!!!!!!!!!!!!!!!!rb[F)b-M)b2
+E+`$rq3!!!!!!!!!!!!!!!!!!!!!!!!$rfb-M)p`M)b2F!2rj!!!!!!!!!!!!!!!
+!!!!!!!!!!0XM)b2F+p`M)b2FrrN!!!!!!!!!!!!!!!!!!!!!!!$F)b-MfbXV+pX
+M)b2Eq3!!!!!!!!!!!!!!!!!!!!!!!!$F)p`V+bXV+p`M)b2F!!!!!!!!!!!!!!!
+!!!!!!!!!!2rF+bXV+bXV+p`MfrN!!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!!
+!+p[rq3!!!!!!!!!!!!!!!!!!!!!!!!$rrrrrrrrrrrrrrrrj!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!2RjqIRjqIRjqIN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!rrrrrrrrrrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!
+!!!$rq3!!!!!!!!!!!!!!!!!!!!!!!!!!!2m!rrrrrrrrrrrrrrrrr`!!!!!!!!!
+!!!!!!!!!!!!!r`!!!!$r!!!!!!!!!!$r!!!!!!!!!!!!!!!!!!!!!!$r!2rrrrm
+!rrrrrrrr!2rj!!!!!!!!!!!!!!!!!!!!!2m!!!!!r`!!!!!!!!!!rrN!!!!!!!!
+!!!!!!!!!!!!!r`$rrrrr!2rrrrrrr`$rq3!!!!!!!!!!!!!!!!!!!!$r!!!!!2m
+!!!!!!!!!!2rj!!!!!!!!!!!!!!!!!!!!!2m!rrm!r`$rrrrrrrm!rrN!!!!!!!!
+!!!!!!!!!!!!!r`!!!!$r!!!!!!!!!!$rq3!!!!!!!!!!!!!!!!!!!!$rrrrrrrm
+!rrm!!!!!!2rj!!!!!!!!!!!!!!!!!!!!!!$jqIRjr`!!!!!!!!!!rrN!!!!!!!!
+!!!!!!!!!!!!!!!!!!!$rrrrrrrrrrrrrq3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!qIRjqIRjqIRj!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!3!!!!!!!$rr`$rrrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!r`!!r`!!!!!!r`!!!!!!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!r`!!!!!
+!!!!!!!!!!!!!!!!!!!!!!2m!!2m!!!!!rrm!r`!!!!!!!!!!!!!!!!!!!!!!!!!
+!!2rr!2rrrrrj!2rr!!!!!!!!!!!!!!!!!!!!!!!!!!%"+bX"+rrrrbX"+rqI!!!
+!!!!!!!!!!!!!!!!!!!!"q38&"38&rrrrq38&"Irj!!!!!!!!!!!!!!!!!!!!!IN
+&"38&"3Arrrrj"38&rrN!!!!!!!!!!!!!!!!!!!(j"5[j+`8&"IrrrrN&"3Arq3!
+!!!!!!!!!!!!!!!!!!38&qIrj"38&rrrrq38&"Irj!!!!!!!!!!!!!!!!!!$j"38
+Vq5X&"3Arrrrj"38&rrN!!!!!!!!!!!!!!!!!!2Rr"38&"38&"IrrrrN&"3Arq3!
+!!!!!!!!!!!!!!!!!!2Rr"38&"38&rrrrq38&"Irj!!!!!!!!!!!!!!!!!!!!!2R
+rrrrrrrrrrrrjrrrrrrN!!!!!!!!!!!!!!!!!!!!!!2RjqIRjqIrrrrRjqIRjq3!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrrrq3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!$rrrrj!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$jqIN!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!J!!!!!!!!!!!!!!!!!!!!!
+!!!!2!!!2i!!!!!!!!!!!!!!!$q!!$q!!!!!!!!!!!!!!!!$`!2i!!!!!!!!!!!!
+!!!!!rJ$q!!!!!!!!!!!!!!!!!!m2i!!!!!!!!!!!!!!!!!!2lq!!!!!!!!!!!!!
+!!!!!!2i!!!!!!!!!!!!!!!!!!!rri!!!!!!!!!!!!!!!!!lq!2i!!!!!!!!!!!!
+!!!$rrJ$rm!!!!!!!!!!!!!!2l[i!rJm!!!!!!!!!!!!!$`$q!2i2i!!!!!!!!!!
+!!!m!rJ$q$q!!!!!!!!!!!!!!rqi!$ri!!!!!!!!!!!!!!1i!!!lJ!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!3!!!!!!""!!!!33!!!#)!!!!L!!!!&!!!!"3!!
+!!)!!!!(!!!!#)!!!$MJ!!")N!!!5*!!!%L3!!!`B!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!%'!!!"KJ!!!)`!!!$-!!!!@!!!!(J!!!!`!!!!H!!!!F`!!!21!!
+!(c`!!"mq!!!I2J!!$a`!!!`B!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"!!!!!!!!!!!
+!!2q!!!#"J!!!JB!!!i'!!!1"J!"rcB!!Iqf!!(rKJ!"r`B!!!i'!!!1"J!!!Ki!
+!!*q!!!$rJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ri!!!2q!!!$rJ!!$ri!
+!!rq!!(rrJ!"rri!!Irq!!(rrJ!!$ri!!!rq!!!$rJ!!!ri!!!2q!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!rrrrrr!!!!!!!!!!!!!!!2!!!!r`!!!!!!!!!!!!!!$`!!!2m!!!!!!!!!!!!!$
+rm!!!$r!!!!!!!!!!!!!!mr!!!!r`!!!!!!!!!!rrrr-r!2m2m!!!!!!!!!!2-c-
+c-r$r$r!!!!!!!!!!$c-c-c2`!!r`!!!!!!!!!!rrrr-r!!!2m!!!!!!!!!!!!!$
+cm!!!$r!!!!!!!!!!!!!!rr!!!!r`!!!!!!!!!!!!!!$`!!rrm!!!!!!!!!!!!!!
+!m!rrrr!!!!!!!!!!!!!!!2rrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
+!!!!!!!!!!!!!!!!!!!!!!!rrrrrr!!!!!!!!!!!!!!!2!!!!$r!!!!!!!!!!!!!
+!$`!!!!r2!!!!!!!!!!!!!!m!!!!2rr!!!!!!!!!!!!!2!!!!!!$`!!!!!!!!!!!
+!$`!!!!rrm!!!!!!!!!!!!!m!!!$mc-m!!!!!!!!!!!!2!!!2`!c-m!!!!!!!!!!
+!$`!!$m$-c2!!!!!!!!!!!!m!!!r-c-c`!!!!!!!!!!!2!!!2c-$-m!!!!!!!!!!
+!$`!!!2c-cm!!!!!!!!!!!!m!!!!2rrcr!!!!!!!!!!!2!!!!!!$`rr!!!!!!!!!
+!$rrrrrrrm!r`!!!!!!!!!!!!hGhGhGd!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%!!!!!!(r!!!"!B!!
+!3&!!!%"i!!"!#!!!3(J!!%#%!!""!J!!33)!!%%#!!""!J!!3)3!!%"l!!"!#i!
+!IrQ!!!US!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Im!!!(rJ!!"rm!!!IrJ!!(ri!!"rq!!
+!Ir`!!(rq!!"rrJ!!Iri!!(rq!!"rrJ!!Irm!!(rlJ!"rqB!!$r`!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!r`!
+!!!!!rrN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$rq3!!!!$rq3!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!$r!!!!rrN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2r
+j!!$rq3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2m!rrN!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!rrRrq3!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!rrN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2rrrrN!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!2Rrq3!!rrN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$rrrr
+j!!$rrrm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrRjrrN!!2rj!2m!!!!!!!!!!!!
+!!!!!!!!!!!!!!!$r!!$rq3!!rrN!rrN!!!!!!!!!!!!!!!!!!!!!!!!!!2m!!2r
+j!!$rq3$rq3!!!!!!!!!!!!!!!!!!!!!!!!!!!2rrqIN!!!$rrrN!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!qIN!!!!!!2Rj!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!2rrrrrrrrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!2rr!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!rrm!!!!!!!!!!!!!!!!!!!!!!!!
+!!!$rrrm!!!!!!!$rr`!!!!!!!!!!!!!!!!!!!!!!!!!!!2rBr`!!!!!!!2rr!!!
+!!!!!!!!!!!!!!!!!!2rrrrrrrpMBr`!!rrm!rrm!!!!!!!!!!!!!!!!!!!!!rpM
+Bf0MBf0MBr`$rr`$rr`!!!!!!!!!!!!!!!!!!!!$rf0MBf0MBf0Mr!!!!!2rr!!!
+!!!!!!!!!!!!!!!!!!2rrrrrrrpMBr`!!!!!!rrm!!!!!!!!!!!!!!!!!!!!!!!!
+!!!$rf2m!!!!!!!$rr`!!!!!!!!!!!!!!!!!!!!!!!!!!!2rrr`!!!!!!!2rr!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!2rrrrm!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!2m!!2rrrrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrrrrrrrrrrr!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rrrrrrrrrrrr!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!2rr!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!rb[r!!!!!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!$rrrrr!!!
+!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!2m!!!!!!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!!!rrrrr`!!!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!2mVprFVr`!
+!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!$r+`!!prFVr`!!!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!2rh!2FVprIr!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!rrIh+rIh+rm
+!!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!$rpb[h!#[hr`!!!!!!!!!!!!!!!!!!!!!
+!!2m!!!!!!!$rprIhprmV!!!!!!!!!!!!!!!!!!!!!!!!r`!!!!!!!!$rrrrr+rr
+r!!!!!!!!!!!!!!!!!!!!!!$r!!!!!!!!!!!!!2m!rrrr!!!!!!!!!!!!!!!!!!!
+!!2rrrrrrrrrrrrrrr`!!rrm!!!!!!!!!!!!!!!!!!!!!!!!!q[RkqIVjq[Rkq3!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!3!!!(B,!!"e#`!!"*m,65PN"2i!!!!F"&S!$8*
+14%`!!!"b4P*&4J!#!(jTBf`d!!d!SQPME$J!$J&+5801)`!0!IjTBh-M!!8#TQP
+MFc3!"3,ZD@0c1!!&!cC@58dK!!!$IN&-8P3!!!1+4%P86!!&!jC%6%p(!!8$hQ&
+XDA-!!!3Q4e@h53!!"$)!J2rr!!!!!!!!!!!!J2rr!!!!-!!!!!!!JIrr!!!!1`!
+!!!!!J[rr!!!!4J!!!!!%DIrr!!!!83!!!!!%D2rr!!!#93!!!!!!J2rr!!!%@3!
+!!!!!JIrr!!!'A3!!!!!!J[rr!!!Ph!!!!!!!Jrrr!!!YX!!!!!!!KIrr!!!mU`!
+!!!!!K[rr!!"!Y`!!!!!!Krrr!!"#Z`!!!!!!L2rr!!"&``!!!!!!LIrr!!"*c`Y
+0*f3!L[rr!!"Ij`Y0*ZJ!Lrrr!!"Mm`Y0)q3!M2rr!!"Pp`Y0*c`%DIrr!!!)B3Y
+0*q!%D2rr!!!-C3Y0*m!!J2rr!!!3D3Y0*m`!JIrr!!!8E3Y0*lJ!J[rr!!!`I!Y
+0*mJ!Jrrr!!!SU!Y0*m3!K2rr!!!dJ!Y0*l`!KIrr!!",d`Y0)$!!KJ!d!!"2e`Y
+0*l!!K`!V!!"6f`Y0*k`!L!!p!!"Ah`Y0*kJ!LIrr!!"Ei`Y0*k3!L[rr!!"Sr`Y
+0(ZJ!Lrrr!!"Y!`Y0*d`!M2rr!!"a"`Y0(Z3%D2rr!!!BF3Y0#ZJ%DIrr!!!CG3Y
+0+!J!J2rr!!!DH3Y0+"3!JIrr!!!EI3Y0+$`!J[rr!!!Nf!Y0+!`!Jrrr!!!XV!Y
+0+"!!KIrr!!!qV`!!!!!!K[rr!!!rX`Y0+4J!Krrr!!"%[`Y0+"J!L2rr!!"(a`Y
+0+!3!LIrr!!")b`Y0*hJ!L[rr!!"Kk`Y0*Z!!Lrrr!!"Ll`Y0)r3!M2rr!!"Rq`Y
+0*#`%D2rr!!!FJ3Y0+#3%DIrr!!!Fa3Y0+#`!J2rr!!!G#3Y0+'3!JIrr!!!G63Y
+0+#!!J[rr!!!Ri!Y-+X3!Jrrr!!!`1!Y0+$!%D2rr!!!GN3Y0)X3%DIrr!!!H&3Y
+0(P`!J2rr!!!HQ3Y0*!3!JIrr!!!I(3Y0*`3!J[rr!!!S*!Y0(Q`!Jrrr!!![Y!Y
+0(P!%D2rr!!!IS3Y0)P`%DIrr!!!JT3Y0)P!!J2rr!!!KU3Y0)Q!!JIrr!!!LV3Y
+0(i!!J[rr!!!iK!Y0)P3!Jrrr!!!jL!Y0)Q3!!!!!!!!MX3!!!!!!J2rr!!!Mc`!
+!!!!!J2rr!!!Mh`!!!!!!JIrr!!!N"3!!!!!!J[rr!!!N#`!!!!!!Jrrr!!!N*3!
+!!!!!K2rr!!!N1`!!!!!!KIrr!!!kM!!!!!!!J2rr!!!N@`!!!!!!J3!2!!!NG!!
+!!!!!JJ!8!!!NM3!!!!!!J`!F!!!NTJ!!!!!!K!!K!!!N[`!!!!!!K3!Q!!!lNJ!
+!!!!!jIrr!!!lU`!!!!!S!Irr!!!mP`!!!!!16hGZCA)JFQ9cEh9bBf8%6@&TEJG
+#GA4dEfjc"%PMEfi%9'9iG!4'D@jN#(4LAf0XEh0P#(4LAf*XB@jV"h4LAf0[F(R
+VL!:
+
diff --git a/src/os_mac.sit.hqx b/src/os_mac.sit.hqx
new file mode 100644
index 000000000..50088b359
--- /dev/null
+++ b/src/os_mac.sit.hqx
@@ -0,0 +1,439 @@
+(This file must be converted with BinHex 4.0)
+:$hCTE5de,MBZE@0`,R0TG!"6593e8dP8)3#3"&'B!*!%ZHK6G(9QCNPd)#KM+6%
+j16FY-6Nj1#""E'&NC'PZ)&0jFh4PEA-X)%PZBbiX)'KdG(!k,bphN!-ZB@aKC'4
+TER0jFbjMEfd[8h4eCQC*G#m0#KS!"4!!!&'B!*!$FJ!"!*!$FPrf$D@P8Q9cCA*
+fC@5PT3#PN!3"!!!l!!#`q3D&Y+rST3#3$3[QD3!$hFd!!&$(!*!%$`"fD@dY05i
+f,QeMF!!!GjK069"b3eG*43%1!#J!j!#3#S!!N!G#`G5QH4&%pRa-K%E4UkZTaQU
+"-+X6)&,K$@Ym*hGC)9h[D9T)ZEHSeeHe%$lr48T9p$Np&PbAqU*p#C!!+pBqC2$
++(31mjb(d"cp6ITbIbU"PqNF#%Zi9$cAX6!'AN!!&&V4DC$iT%SSTLC!!c[YQl9D
+Qp5MRKAG)535FVqmN!N4lI[%(AZ,B"D)MXT!!6J!&d6Fk[m%mTSS,%0c&qK```4N
+bpANj3J1'Ri`LH5iFih`cfqU9r6PHD1(l0VT"db(a3fJ6KjSFJ1M&"SD3!03-kbd
+,5qaVNFl5chH'Bhm1C&IbETH!f-ZD8iX)pZCmMd3XC&&2l9G30%#AcQ(G)e!QUZU
+pip2FGeAjlM9,MfZ,`@@ldcQUDE9'XpUYMTRS0fI*d53$Ib5VUfMFB+Gc88)H2$M
+N[@Y((@0LD8J[M3ai'1(aILiJ+lCe@aMFqA$*NI)X4MG'K2*k0FFf9!m%%GJb+`5
+''M#,ZNDd%5hkISBL"*rq,cI`",@IljEQ*d)8Rl1J+Abc@emj6Qf6JYN@@-j`p+G
+XN!#ZYM,Jh-QjI(),d%P*XDb2If5!Pb'"##K98jjh6bdhX*2'rVU@ZEB4fNaUUkh
+%d2QZLU'aEP$&-CDA4Y`a$2hR2iUi%2-3!J05TbBe"1q[pBhBQXN1r"K04H2RR"K
+4ikr*J8k9[0aZI9k4+'""l8"&m9V6Ue9QSUrrrcfSL-eK+X*$BCmLTl8qa8dldDj
+!Ilr2lerNCca$`Uf($,TN0r2CT$GNUSKDlRS1`"4%KjqF#kA[BmZ3!0"CIV2%PZa
+aM-Zr[k*l)DPRTC,KpXJFVp6Vkqj13aQ`lLQ#Fq,hYF12[6#!DLfNVBQYQc@(0&`
+rlr9&%Ubmp+X(&PE-b1V+U`2BhMI`V"hZ!N#9(P6,I6bla-Qh,#X-a4m!JbMJ&#'
+'PTMHN!#PlXkZB$0ES)L([`YeUk3HG9-)!-HKVYC,Em1BB%j)d`8m-i,*10U*NTa
+L(6qMI`fBX#V2DIka'l`r2L#2&956a"UBXHVbG&%dX%G*AG3JE-3ZbT%fFF+kI`V
+P`LP`)Tjb`(S&K#S,3*a+l0@L%8Y!TqL5'fbhrQjlB"KGDFfP@Q+3!+hcE!pR[Mp
+-i'r&IN5-YNG["E+[P#NFm*!!r-jDTIB[A)A`q%T!SIr*0U4(26LGUQ,NNQUmG93
+d$FNZC(+BK)`lR&'$'fD#NR'TV&F5%`EH"XeEPQHcZlj[bqimQK,21l**B63Ef@,
+Z)U0dlQ,V`J+BB)'&+b5DijN49#LEI!a34hJ&Sj[`AP#p`&D0&rjTfhGIfFS[k0!
+[[d0(F5,ePc!kc-hR1P!dK`h!5PIjZr"EqX9#dJpU4(2VbSc8ee861++3!#SrcY#
+ma3XfbAq,br4qk1[G9fdh*hi$q$P3i`Q4[rDBe%8jVCjSkiaGXR&ma@jp&Y3lbUI
+9(kC&I@eH$-b1,&CUZFDYiZ1rDG-Mb2ek(K1Fdp"-(5@Q&8$J""&"H"1V2qFD4D9
+1i[3SKAkA3-J%dN`UXBSJ)P9QmRR&GiFrN8MJdQAjb*2'pUre0AGcm5rmU96%$kr
+k6!i6HKfU5&8fIhP8,'"*@plIf'"FQS2r'8dqHYfYYZ4f4e,Q[hKRreYV'6$0B$F
+@`KlYiHFMVbASScJM&eHLZ`pi6`XX!aia[0bA,3pF$)f*-J3F(XJU1Ir%P$k*'!Q
+mcI56lRH#S+2G#fB2q*A#[l6C2DP9qU6i#8(Z2b*@J@9&Y"jq'biC`P8*Ya%#-FB
+,"kFaJR"rP5&[hpfDeIfUjb0M31#Q9DJR(E8Z$'[hjVU+#(MR"9cY($"H6mJfhr`
+!Y+`ApCV#'i*I(i,afTp6k#R9-63ZVe%J-'GP*Lb"b'3i2N4#E1@+GM`AXYR"c`P
+*'+J8`qTDG*!!9S+0U1U%@39EB&#-eSci4Xc30m"FJZLZVi2Y!)cBK$'b@E"2j@B
+)*hfbclr&'3%&1)@$4l6RmH4#`"@Z1aV)"fm8qZ9%%0*9@!P`Kk'Slc#,0Tr+0'U
+Ei-r&1)i-+H8&HqMr9M3)3[)cJM"qQe6*R[ZPf'9IQLEY+lbELHU*5DH#[N$L(V8
+h%P"6@e"q)KL"EZUVL!3+V"&)Y+b"RJ4HEI[dbCi,%j!!Vh"-b&JMKVAbYa!Lk"6
+b55IDV8j"qa5#B2E,L%H6ZehmmIfAB4QK!UXEMBe-Fd2pFm2!'qcqBd82mp6X1)6
+HEIQhIGX#$B9i19`i+$C')T,ri4%aThaK3Z"6'!fM09N+!bKV"26+'!H*jL1Fb%f
+SVi4c#,&iqY8&RVd6+S"K$$!fY`i3(FXklKRT6,rK8%G*a*!!dV4X"I1DjI)"SjP
+5IR1Y2ThmlNcl8NGTP02A'')`-!MlIE"qq#@UP),p""S(c,#daeR#Da'%R@cM5lE
+j-(3q,%aSrc8f#@lNiV3H@Xm#VPJMRTXPYC5+#Re15)HH*+CZ[+S!e3,D)eMT#FX
+B@h8fZmBLAM')6a0kI*jKATFHfAcRd59c945E(q+5l4T%GMI4h!!9,j2Lm$rKcJV
+'H3cHFZl-kMiMKVSFFKk3!#Tji55j$R#`(qP83-I"jQF`fQK1B'2E)EZepHC&X)L
+-rSST[HYS4,NrDq'IKd0"4S"A$kE`A0kj*m@flkF%ABJ8-9ZFH93dU,I(k)RdmC1
+1*"l`1Ed&f!Vic(D`r$4)CfkaJl[GBmd#%iZ!,c0QK#$M3f`(&9p9$9Y+*-b$lLV
+-4PDm1d$136*-lX68MXFlMSkCl'ZNeGDCE)TdbU#'#[4rdr2h1@@'&r3SDqQSPh'
+5'k1EL39k3q(2&erTqAT+"9maP2kAIi5Dq&e8VqYBJj[FV`,'&FH%`kClMA&*1h1
+SS$2Y`T,Z%KY&DYTkD4R%Rh&2cY!L*G5+[#4[8*C%B,pICjICr1qV4ZcFj[9S$0T
+R`NL3!+HNCZ+rEla(#b4i('4H&J'BKY'PUe!&bqpf%YjTPMq2JQ)[NK4+SKKAG,Q
+NY44SIZXK-ZP!AL6T2hQhqD9iU[TD9Hi*lC2Iak1qr9Hi%iF0rjiG+N[UER2QLmA
+b9kENc3ib*2E&c,#qZ95+Q"4!4lkb4NbahS',@"JaN!$[d6"B@2C&VT[h1FDLiri
+c-c$@JI`ITFq-p1CI`Gll6B0(0,!Dh#2C5Y)Pl'-iZPc38`h81jUahRd6lX(X`Vb
+9'C0-U$eAQ-YVCXp2*2rLp91@Ck[RSr#hKeGTB+&`S!6l!k+!9G"iPiP0#%5251*
+8PL2fNMCp[riemVeK0(m&YT!!!QQFkfl!r[@`p2%L*ZZhU"@!YM'-$j5H'DCN#(j
+S1*81mXZaf*,-mUe*@*2+2Q'ai+jJC[m@C*e)A"l@jaH!fE![ULZmeLp(h@TBii!
+lkbG+2pjT@iZXcB5I0KL0@e%rlRIQYeRN)@MPhBLFJfcErQ$Mbji'@F["RiR[)%e
+"p5-UHM$PA0"8P"eHT*UpI[SMi+,BF[$EZRXbU"@"f)1VEcaAU,UbTK-A)lf,&Yf
+(DARP8@Hf[pV3@llMq!fMb5i1hDj-4)IF15S-cb)"cA#Di'`4pX2K8!iP[rrQPel
+i@42$5fP+*G$$dS!p5@)GQ4%LKCpN`5S9lif-!c(#&5p0iI[FNUJFi6%Y&T@LD&`
+[QVK34ih,J5Za5cYBll[#cPG@+2Ir-D&)NT!!Uq[85RK`Lk!3a"aC#SDmZ#@Q[Mr
+bTbb"[!Q0f-1rkBIpL%C-[eUFPX!''D+F,*YV$phA&bM15X(6hD"TBSS2PVE[h%%
+jcFTPc5k0q5A9-X`6QfZbIk"h+MH"6&Q[*Cr&CHkBkZY4GMJc6*JP#QfFbrB,fMm
+5`Qk@2L,bhT6$%c#q&q64I@`CIGZKRK0%G)V"S9m9+6&aIl&6RCIm`3ce102(VBM
+"D#A)kjifd$"dmFjJFbTVk`ZXb#5l9hG1ZFVGVV[`$(Z09"G8XB5p53E#X@j[R%m
+IH%-L3U'l%PMZhAXAmk[GL`cKT%)2$dSi4[QFSeYG)#hp4LN+f`"V9!k[kUTiC%8
+M`Pak-MH9,r)46d(L@!#!V)N@YQaX'4VJ4Af4keK%U)IC4UUD,iNGq!'0c@8Qp0Z
+@8!Pd+E4"V0b0kCDC'(VJffU4'%BT2j[P&)@JBmZj-T9kc4,JpcH-bALAhR4Q6`f
+"3Hi#pP#Km`6VGYMJ0@cCKRB,$I*T&4Z$V%AppP",T4HMSI2S&DH8M9P5%*qJ'r0
+JKRZZr4A0JX%-B'aE5XJCreK@*cp)YjdEYRN'3LiFGNXr!PXKikVM%0GHGUM!1Gj
+Tj`,Z%YAKT[AZ%a-IlqkbGF!'m#2V4+INhN,B,8j#%XRDerk[J)KU9"ebP)TQbX#
+R#$8kpQ$A(V`U+#'[rUVr8eFiEC8DLSp)qMNdK$(ZS`e(52&FkIR-#,ahL1F4I`k
+l"-9MIS+LSrUfQeYIG*JC!+1@46$AHcVPrPk#lCQEd%i1+*(fTUm4UE-`hcM'$b@
+#QD[[bb32PS8`-d-@Xj6dZI88re+BjYa2hD-e@#A+M&ejCSAX%&Fa2mq!YSjA@!E
+)K0kkke9QeQNlkrKMp$1SCKr$,&pj2!q40`j8(!%D(1%AUq+*QLS5L[%c,`*S[Ej
+XfbQjI#5C$BqK[rFl%43+UUSX-BL&9KYp"HVfZRe*XRaq"G*44fe8D9l#%Hbp,L*
+PC3$1XBGhDKSm6"1C,iiFbUQ3!%#`Y8D83YqrL1V3+CT!+F!8XUfk`#!G0AFkNPe
+%EMMr84@[G0Ql2C92G+,-4Y-3628+"NKTRHdhd#'iHrTemmEhIdb(G)lPAcPN$@-
+(hrpAc`a,+N3m(V#3!,4K,`H0dP6q611[XBe"r%hX5)0['Cd"`8rlqXACI,KQ5SN
+#[ZmD2@1J$'bXkEC&Qr%M8+KX"T8'E8r03T2Jha-JQ5VC'32RNrefVb9Ge#'pf[b
+J3!QCr92HRr%4GaDP@X`'G,Ciq)NL%j6T,2VVG"e)LBKL5hlP$kErE(@4+R'Cc4l
+I3)KMD63ITDeThSJ"HiZ1XP%5-4XQ@b@KbRTkYXU5rAGIqVRLf'B2jI,GUV(0i49
+Q0-PJk16'$Fi0VE3b"YM,'j`!@6PZ,Q!DIlAmE0K(p52r[SPCRl(j'SM6m'0E$Z1
+Ed$M%SbGc6Mhm(L'a*TrE3Q1Ehije3'ah,M#SfbpqUBS+`ZLq)F#S4aX`*jB#l"+
+PpmSj"[%3b5&Q-VFe0r8SZUVY4D(ir9kQqqXHK1&m%p'VI6Gjmdmk-0T'b4Bi,%A
+Tfj[JYITBrSE)F$'`mqI@*1**!'#NjrAh@+UYi[barS*0h9HYdmKcajNY$+qeXDI
+b&2a0)3M[DQ$M(iI#-cZ"GRaVdZD9pSCbbL9r1*!!la!V9I+0rK2K`)!q+4*qjTK
+'SHBU26rh4l,dCYDI`bRM-q`-(VR2ICB,SYT0f+FK!L)R@@PcYKR'%ipA&4aP2(S
+N4!CeIqpXE##XRjDmjLVqZT68+V#ZLHl"LZ1@6L&TV*5VYEBpGk-LG`%1*faeq!j
+,jYjpqrdr+5[YQ14*Y&QKS6kCHX5([Y"XXG(jL3iU@CQ3!%*S$$Z")1cfG19mfG0
+8[XjB@Ge,&"rG$DZ(+![lQNC3-+2Je6XHdrYJN!!la660#Ua5i3c'"4TC3RN,8h5
+KJQcKaa$8A8UCk3%ilT!!(c*b5$ALB"JDkf@@YVcB`%lq(Jh@+Gb-LI1kIRRdS#T
+m""fdXpFj4Ihfe5%`#QZkcq)f+N$4BY1$L*a#m$Kq95PLb9S%jVi04-(Pr*Lchac
+ppF%Yl0+faU8BQU$[fAjQ--5D&R5iiZJ&kX2#X(H'`Ua$m6ZPLe"%1UBiZAHpd-R
+K1$R)Y(iZU"d"MPI'ZCS6T,bPjK0'N!$`cNFi0b`c093dMX'F*G*kkI![6PCUL21
+AQ)Kp#TjUH,e4eSK[@P'Vd(c3M6,SpaqpVE'h*1%ZVTrR3*J8S)$C*eeQSc*PYe*
+C,25V4XaPRh!Dq4#&-KB6*#@YKC,N(GpQi)X6F*ZT5[-EhHYAEJ(X9HC5MHr9$AB
+Y"EMHqq"+9rN04J'ElFG-KYE,&q+06Gh$2Ih++$J#-Q4$IkdqC)S+!5aG5*-1dfp
+jUkdIB3,AKI3DT$E*YY2!%"phc9QSkd!TmEbMeTR8)Al5fXI0EqV5fC5[P!(JLY#
+8@RGkF"6rqbHTMXRL))88cT84LFKf+`SDPk-36'65B`af3[PD*P[EG&[H4'TZ'VP
+&qB)5)m!r$bJITKDSfAJ%@QGR!"X0EU,rM1R"9m9YNLi45)fhQ2hj8T!!U'8)'QN
+kLS-H`NZ%%X`'H%hE%I183I8kjE[iddHSfm1qY8dJiFb''3'%Ik!f4q[46f#h$mY
+qfZdc$!C9hFII2DrA+`rEP`3imIX8!3km"$EUbSB&T[1X$RN1BX`#Cj,`0)"I29*
+(iST%406dR-(E6!,"5AQF8KNXE*XmEbDHJIb&6Slm3q-icI(4N4YkLe$e&@rM8I1
+-"Fla%lkH*`--pB`3!8X`8pJ'Jf'[GfCC93IhUAhBL'XX6ITZ!ZSJi[Gh%98fA9F
+[Z$2Vk2iE[FAQ$TT'B)khrNG0b8bl`kKl9"M&22'[-1$l@&mE5dF'63#-L3I@Z`Z
+CA*90X`!bYTNX2p5C'&&qC8*9fPI3+Bc[fXGpm&r!Y*%l+rA23*&D1LeYVBNqTke
+qPL+PC1"%L*c-NKJ(rYUpVHZH,AmbcT[U[$*BLj-"a!S@@cHh!&m&b#E+YE)J5Ek
+K+aERLVI(3A4D`GcLk5,i2'-2QAJ-A&qFHCI@)q3XPC@*M-pd$a[dcdaK3i`&cU*
+aA-`p'I40YPkEdL%m@5cd*V8Re4Zq"BS&QPNpCHcJ5b+&Q$rFrV9kR#rLfYAhi[)
+BZd6pfSjQ'Sp8UE@Lr"jL)CmD+X-6AS,PDQ"Yla*%M'DCKmFl+Q)8GRm&c)Fa(aa
+&rFQL66EI1+"Kd9(GGI8FBPq!%!EL4ahk$leYN9-6V(mTQ6!k9ji@TI4Z%bHe%GS
+R'h5&#V9G1if+XV8N(-Lf3NmKKH08era)8IBFekSm`$4!KaKk[J'm5&dkkpY&*Ni
+N0b)MdR[5!(%UK,`TlRLS&-AEkqUAe1I)+3#2`V-h6KcB+6r&$,`0mUh[FIVB6C%
+KM91cdBPB1caqYhrlaUrEjUjRE3!GMiaL400Kl!T4$eAEG'+VT3Q*`e!*iXY9XRZ
+a94)9Tj[qReVHpp-j*J12Z1X5`QY&Vh3GKq!rN``4@,DRHJ@ppZ-B@2G)9admKSr
+&TqK1mU'a@Zd2@rN$6Kq,-)FY[Z-MQDpEX8ZRL3,AkL3-j&c6#!DPPbFSK&XC*6`
+mD!Lh-DqD@1j%GCJ%D'6L8cJbN!"(8GH*+eS4f+$M62a%IZqfr)Lk4cCAl0Xdj%m
+bm1Zi`IVl"YT9*jLC2Y8c+6G[JFbIE3D%KIqpVCe23Va3jAXlkYZB6Fp!!G#@rk)
+ekD8$Ic[25f2k)rb@,40ADmp6MEd)IPik0fXL2f`*Q6j,bmQZ8CY90fDV2+*XGc1
+V4&PUQTckPP'bkD81cPM9A24"NlGN*BjkM$2#!ETr!&[EqYcRR%BJ-hqqb$lr8L2
+$XKTUMD35HBl8N9X&*bI6!FS0&c)Y+%%NmN3bG)eA30dYP6T,B`1PVEjV#2d3i`3
+8[e04Dr9aqcU2%jCi#3"&6U&D&PTK(LMIi(cMUPm)aR1P'6lRF[M,reK0NDG9`,!
+i2e2P2he4'CZ8'2,V*c(I8ae+G,GiDS+MpEH'pTC9Cb*Ar4Nh0p9I(F*kNf43TRH
+KiUG[J!dN-e#-dKZ)RpXi`[!cI#i`"d8569`6Lc[eLRT#6pC1MH5j$m&k$Fk)dak
+4mf-Fr$k5Lm3Yi#rePr@G%[X3D"aB9bdcYYB9MlXh*ebL29#I!Ve2KBA&JVi6T'e
+a4h3Bk-,-Z[c5IVTY)aV05-q#rF,fXUZ[H4PZf!q4Gk")jmF$5Ic$L@[-,c`P#5T
+ahTfKYP-2(X45Ap2&f@&f'5Chh(IA1EcETV6Fpd5b85M2,c3GGpK#r-a(rbqKKSE
+#B4c+30$4XqL@rQmGLQ+%eEK6l-&E-Zi+GpEeddaTUI(MK@1X*13q,U2-rYGaDKq
+DLFY`GU`ZQ4&m15bYi@PYD&Q-#4dmEK(%HdXS!6!!SeL4*@m[%+HjhAL!14JlcI9
+m2hU5V%'Q-r-eG`c%#iSDp1p@ED!%eNY1qk$C0kQ1K0$iD!fk&@,$[Br[+H5+URq
+pJV1R,EZ)1FFeEebfB$*L'LfkT,NAhq48HpPCrr!I-Id4`r8ih!,F)Ml"&+3+T%c
+&DNYYGKm#U0hGB$89f'VScHUCE"&13j+q3H@RkIY9ABPbe"3#SP)ifR#"r5JeSJ9
+GQhR"4k&r)+!C52GTJI05,2ikDVC@S6&M6a#9K"Ur@#m3K`@)ZpUdB(VM38Z[LL(
+c3ShP0j1"0@BV4`P#2Rj!r[%@e&l"3-Di!9JaR`kMZh`cD5J2YDBeFb+Fq+%-fNI
+%aDTpV1"1X`3Zk!Q-fhl9NMeb3-@QbcR&9b3ecCe8mDE9p$rZmM[l"IPlBI64,ak
+i4-`rM%ia[F+qHI1G8UR3Fj'IL2IZ0DDh8V`&pld*DbE21FVrahZF"Y1b)hYm5UZ
+HVBEmB3%35l4kR(j+1B"@LF8%rMfUrPAQ6YkX%[I8AN'IfUbR*XG'h6D!T9"jQpB
+C5KKZDD4c`22)LlLe[qCe2jf9qm-*("0+0qBDS4El*1G(9[%Q--d[*"f'@UNc)5p
+@*HYZCJAYCV5bBFU,E!%3KB#A5lPXHNQ%,Ph,GQUF"hTUe-Ip#jmYp#cJC#6ZUiU
+QH*HK2d"HfU'lr3M@i&&!f8%0+T'`T,@,K1dhlf+2)+G1aNbTY+"*+*j@G(HSQh8
+%H"8CY03#P96e6C`RNDVRifP,T1m%ep$HI1JS!%6KKCB3@!X*SNhK-Sf*`A"&4KF
+N)9#UmM-hM2-rSaBPM%8*B&*rcpIES"Y&e4Z,@rd5bX629%G!6BRh6IHaL'qA3L%
+ANSHXRimH(c*VhX+qa6&,e86Y2DA@cF1hC![,,""0X)rDbM1ACAC04#C9ZNFBjc2
+SSM%0&NYV*@d4RV(BfXCK[&rVaSjE(X8E$Z+&iL88P5r63(0G(XDiEqfFDCjUS[L
+qDE9Q,B$HY)[!3Rb3!$8Ecja5*Q4923S#'XDRi8pG'm4fBJ(qE'Cjk6J6"q5,AI4
+ba`+4V0L`ZQdKPlTQ)bCG5hkXPDMBrFE$a0PNeM!25$l1HX+!BK4bMbQRJ$%I%c+
+Lr5qR*%PjY9QNMNYdeHcNj[rL("8Sr$'DeZ(kj)H*CEa2YeSF)p*TF3Uj[S[-5'5
+IJHA)p4KeCd1EM0Np$Q0+XKiRG`r,hUMCk3V@5eeI%6&5G5K98dY$Mhr0##,C6M,
+mfJ0FefV-i$RZ"##G9iF5Yq'ARiT1#0+)%3hPCb,*EE#83BTZYP`Rl$Rai5+k-K!
+kQ-eS!q#p9)380G!j6JdL,Gjd"$pXGP*khaKZ8h91Y'Lfq"6FrXar9&`58SDP0)6
+'pJ+T&NH*m+[#SJfNlP@ie6lL3b#1'$I)YrLU3LKj$VqK(`8CpN2Q@%SUA6a-[&)
+M)je#%R8Uf5Yr&GAaG6FA-"`"L`Vb`K@fej1Secle0&9%I95ieLVQb(b1+MJ%G6M
+!6d1c0CfL6,56bL1`D*RGK5PG6[NH&fTKhkpJr38-4Y5DQrAU[clBp9Cb,'qrU@Q
+lm-mj1HBCkN#5,#0`Yfc$kL40XpcHd[D@I*6&TUXY(8C8S,T6!a,T-C,Sm3cDXh4
+M3MjU@&'G8jeja8XK0UJ9,-aYAK@arhPPX4Zq[YqGNi#FI*%e4ZpcG8&pTBj9D9H
+*9TL3!!896UQ3!-EPR1+iX6A!%,iq"hf,8cPjPJ+N%8k`P$ZEEpM5*Yd4)mGUD,+
++kHB8-+A-UcckpC8ZNY3VC-h$Ni)klehBHE`1"rEH1I-I(qLFK6UC8LH5P3T50,m
+1I4jFeL,9G)DM'dmN'$+I[+h!JM3A&r65019a"A!XF*mRqZMqj4eP$Pkp+h%prcF
+bd+Z1RFXN!8Rp*E@priFrIC++Fl*Q"`IFVr[0pYK*8CXFiZXKGMekMI28HDKb`RZ
+)bZ@cTkMMJRBf)km0UYAUC[)k(Br6KT)aaQ'@M25%)ThRk#I'#+fme$RcU@rh#MU
+P2JEpKkr@cfC0810Q9dhD0)QZb&P-C#f"1f(CGNJ%,8cMYMk2Ba4p!rL[@DL$#Uc
+3BkpA1-&mi-AjHq,5Ah1l-p3Z-J55FS!E6PIbjRR6&P6C#Z@&HiaLC(&$(Hr[4FL
+H5ZaiZaKCGU-"33a%,YehNk&$(X39qqUk`!r"UBb6R5)U9HIDXmG!(`[ZTH`qQeb
+-,i+!4&)U!N`[qRSBJP-0@*,a"e3qXRa8M('$X!f[L#HA+%ARI,QX$RcEHP($B3F
+a@qrI(d"61KiQa1F)k8Gm14'RE+NakhDcCJL*keS*+AdjU68d@Na#3A'SZ%5AQdp
+Lp&*aBmI[ZaD00XYePLp#'F(f+XZd()%2$1ZUl%S'lLmF)1%R'M6MN!$)cr0I4$J
+H!Al$I8k*Lj&Af*AHMTEI8kCZ!Gj8-QepBb1f%5T&Hr`((3YMG+,YbJ-,&S3Zi3%
+E9r`6T0TNQ@,*AXpYD`R2RH[8q(kcVQ5*2qqk'l-ABIeeK4h'@Y[3#K2hY5AL6)p
+@jc!HJ)KT8XM!(ZRCV8'D&I5U##[N2TA&!6Z&Je*Y*Ub0@11LGU!U0)PqJE-qiHM
+45c"SpGmZ"rLp5QppEIK9hi"L`k!UVT%'ZYhH0E61fY*++Ak@MbpK021bTMX*5RC
+Gd&lJCM5hQZHa26hP,D"-F"(#-'A`E2"ZhiFRbHh"'5Z(h"`mk%11C,&EeFr%9+9
+Nf%N2bmV+AD692RA-K)66+22,b1(SAFeN#%+'qf(K[jpA0c+SbSfC)mI0JLL9Yc,
+GhHAh%BS`U21(E$CRBrMkimX6PV5lJZqR@MJKqFkpHl6DR4&diEMmhTK-HAM)fS'
+$@)5I)FPYPA+hJh3flDM0ck0ah(E,QMY0MU3L8qhY+R'3!#ELP`M-cX9l'6eI3Qe
+hS1T4aPZ$arXr"J0Im'HdT'6%)4BJe%$JpXjb8aVPjArZ!`JP8$LaN8Q!$XI*f+*
+0RF19c$NfEhAJ9'8(*&lph`([3LCFcpJEQF8IF-3[SFB2[e$($lbbCA-1c&2)KHZ
+p&kYSV#S5UKE@*[9+(%(i#iVir(1DAV2,NjX0M1r8*X(b@+F*8,+@4'-Q%rEF33F
+p8NKJf+H%03VjIQGPf&Q8*kU"[QpC@p8dpCh)qfmZlS&!B1ABJ4G`)H+mCZSaD+6
+`5TM[1p2SKkQR,pM@bidm`8XC5$&jB$GZE#"P9ljb%2[d5K!DAe[4Ia*,p#%edP5
+MIGKmUP&-`IUc$%+qrC(kc5T!ehdi-Mp[%b@Zppf0[EH($YFmmMCC+"GifH8p*Aj
+V81[IGd5P(9er(!T(lYE9EJF5@ik*6[VpEV1BlZB!e%eRk5DARXMh,JrVKRIJ4iQ
+P[Y+ACKr5N!!,!$EJ'`V1Q%NL,-aL+Tc59dS#-%90Bk#9m4bP[FKbC5Rleq'-beY
+NrT`6%RU([)`Ij4G(GkTaG%"XEQZmeKNQ*rIjkCdjm@RCr%-"+HK(SH9ZDa0&H-r
+CL6Tp#)L4*&fJlpa'$!*q!hXNbQj[33P8fP)-P%)d&(JV,R'BSj'$3*fUNDd#!1Y
+Gk(j'!pMM+erB9kpHeAUpKDe`VU!HRq%rmPRL6Q+eD*Vi)1JQprE%bbD*+DYSJFI
+E!AfQ3%HHKZP%1'qVFHJX&l*jAQ`#G[[Me`+&Yp,df5FNSJ-Q1hhJlhGf&K1Lca2
+ZppT2)1V$#i3ZC4iXaUhI-EGTU+-rN!$iplk0e,blq38!HpM3aPX6,Q*0HS5b&l&
+-&)p+2"*Nr,b)%iSN[P1rVYa*`&[8$b[`Kp$)9TQ"#QcpSU4RU(b8&SBp!j4(+Fd
+P@Y#cR4j5CLmG5qdARMeEeK2Ki4TG$FkkJ-`"D8-A,Jc*k,rL')A`K"Rr@-im`[p
+@+jC+20IV#+b-L5kJ14Am!9mCm@kN+aH,XUilTZXi&Vq`3XHMc3!CaVUZEqjd'c*
+8aNYMq5-ie-5P8m$6'Kc'pa0)l$ZkHkRKQiRZEXFF1'@F6Zi&AI!@c%4dPK@jBb`
+"IB+E`2[2*JcXT)fjJ"NKk"b*%ACF2"T6X5'DHYbZ!CBqG2dI#b`&"%P08hhef14
+@3ZkMV$rN9e*JkVZ"TJLd%PLlfU02@j!!K6b!2Y$`(`aPk3P#+qZF$`5hhpPh)B$
+G&&24F&pS+lA4VDA5@Z"eQJ90Q*!!$TIAS&F4VJUU`Dfdk4!HhS'5KVSAb+V"Y4k
+Xa+3@e3KFDlA3NeUcm)!Qfe4GS&2,S5NA!I52XSjmd&hi@U('&6)cTE+$X85-V+H
+2A*cqkA'@JR`lbiP*+P1S90CqqURQ9i`ZQ`405aJZ59&N1NGSIS"pZ!-TI4+3!(L
+'J`hRqU-"'!'05b1hi`ClF3[IMifbbQPN"5`#1#GF'%f&"ZAIhCX-e`(Yrfmk2k-
+`HYpRZ-H5XciCA#pESdX-QR5!SH#Z(br2VLTYG&5-[G-Ij1"96EPQd#r3Xr`rV&b
+l#+Ir$KC1+HHbL&3kqV90R"BF%ijd"Ja9L4Q!X*bCK+&Ya42h!6IkPdY[FY1R!Rj
+8,bD(3rac%,TBi&hI-lKic+lm933)96AlBiU3!$Hf*D+$rP[pR[%Vi&U`,8JYU3J
+C9Aa#i1-bEIBcE'a"2VRcF*Gp5ZkE$hG"SkANeDe-*iR!+[S2lDq!JP2`L`CrhUA
+p1l&BR#05440)mmlA$+q"q%)%,FI@pa"5BV!dB&YI&heV2M`G0P8Y#fL5pm!MCF5
+ljiV@Z1-"U*!!pr@,i,Cl4IBbL"[TchEG0R44%P!5E(i9FqQ`rVi919I'52@)8b"
+cRRpZe6dXe5'B3jlJ`,M9J5L6A9lqLcq3!'pQmkSBMc)k$Xbfh9-Nfl)+-E*21K0
+m[UYV,[1%V9a,XqfjiafhVIB$hab`qL1lcV51(L!4CZ8r1qiaJp0PrM-eA1[0hZH
+*)D2RVZ*9@e4#H6JQU9M4hDV,!RMRD0Z$Qlq(eQ#Zd8&XRZMrmb6GMi-PM3icGU9
+PPp"Mj(P#*lR'd3ALqlQ,GGG,0@UkS*!!!R(Y(j)P0VKc"P%Iacm13G"&*$k3!,D
+cPjidXlANCp56BGYiNKXf9Q3QHl2NTiNNBL$HVGMd"h+i*l"YA%VS@CA,8[S#3dX
+Nr9aklVUh0aH5i92S*2rXih*38bNH3`5(kiU3!*fD2I[I5hDACqdD[ZAj)MbV9lr
+Q,$"ica(YXVj0Q-IZi!`CANR-+dBdq[p,[r'N[lj+eDDR,#BilU0b)`@k!b)Y2-"
+B"`Q[5IfZA"Gqk('r`rM6C8p``fm%9MU+,L#aabIaLX6jDFP@i*JlreL4A0C0F`k
+E%FP+$fK,AG-9Ce6[R92p9*kkH(S&rD$V5RCGZqNliB&"P,TKKHKZBH6rj*P6'JH
+kp1N2a4Pe[mcRkN#**L1%rKp'Ci*8+3(+K2E5NN$YQ6&,JA9[R*IZ9!('@lU6`Ee
+K`@JQQd[BC$KlddRA9C-aHAmF-eqhk4eEK20C+9S6J[`E&K5[$)MDIj1MB64")p%
+LPK0Y,$l44,VM34Pe4!4X-mTm6*9(FS%Jk@K'eAJ$c%+d-+bE0+`diY%ie)0&$@A
+6QiL8dQ"[fAT+ML-KkR-13lfi8lZfCe,Pp(j%(d"4i!)'bCCFd(U-'*S9!q2jJ@h
+A,%BU9AL3!!+BipF["Di$CkbJ`(#$)HRZrc$1$&F3#Jj%+EGef0(f9["8*LHq)dS
+#L('21F0kNH)$R9Z+Uq-80k&rcPS&AdD*-%q3!'q%rQ63a+d!!&qHDmCh8MB5a)*
+Tf5ZT0!'Q$YiGA+rAN5f[-aT1IaJ4%kaj&9Sj2i55j5TiENDTf+0c%EESjZRc9Hb
+EjeaPC,PGb1a0X0a$EP@MhZNb@mej`![M`5RLdc4c5ii#lkFP*I-DM)3P)j@L'-Q
+kmV1)@1H''59LdI3IBc,Z!D0h$fZ[X2`h3L(pTS0kl)2Gf0*RV43FJb0J$LKqUP9
+N5&e[mYIQ5HUji4hk!(MGh(FbN!#@pCQ)!PAFJIUX)M*2-mUe#BLA53*5e'lqcR)
+c0$*'3!'F-Lr$VHZf0cbPf-qZ#aK4fS3kQqVh@U##i!!GYmrl[KUP5d0h&IC-+pN
+aIQHPCa%+b(C88Ji)AFljFRVTC#'M5P1`K&)jKU),9")LaJmXMAGrAjPfEPI('$Y
+ka9aIK&Z*ULAkMaNL(`d12mU&63kjd*'G)R!YQC@JFIAPYL'R3)jP8hU4AdhrPXA
+LZZB$'EZUm!he21D#emhr&D`d[Ll8XKYm#QEkhYeH3XUL8P9Uihipr`I9"9#5BSL
++U6DR9G$E`0+`Sq-eGm"@h[[[rL4N,,-N-cALcQf*dUT)mL3d5F!9Jf@b%p,-!"c
+9%l$M6jjS#cpJBr*9ba4IJI+Be&k"pTm@qdZZ+*!!5-',M9ZL#FGdRp5@%fU5e42
+(N!$Vp1N5P`0(jr`G$108h9VhSGTf@E"01SVFIXp935VT#iBqeMbZ)ckXLcbhe'Q
+F[kV)qqKQP)GBi+d,&c%U69iV@R)IA%G09PC1,qVAe5rp9FYP0e)@ZmkMP64"L52
+Ve`6@EPS[+3mH09ALYZYcGE%BCQ@244V[rI%"%%Q#YK'QL8D"cc$EpFdLZkA&4Hi
+rK3eZmM6'!`Pl6NM%4dH8#&lGIp$*H[Y-!-`Ed2*&AQFjr9&JI1TYG@GLQp52TVP
+3Fbl&,MPBMBFA8@2K,ADl8U%08A(U#,IRXaNcfT&Q"S"T,hr2+hGP9kL-Zrr0BH,
+2rG1N-b@KAa-#`KB(U5Vd9+aMbeh@B&0fF,1S%SL&SGqhT88UfE,VVJVN1kY,6LM
+heP%SF2EK$bk4&(1IIj2MC*[c+H1XRV##@T)%XFBGTld!GRi2Z*cjd+U)V"#+%dp
+R+("DaSQ%5SBI`Ni8b$jLMleEDJ1bK#mTVRBK(jbA$Fh4C)4+VS""p$J%X'Ek!kR
+CDhA4',$R&b6jdP!B*qcYX*hHY[jYY95l`@pG!-C@I,`piZm&6c)-TQaIY#ZhM+L
+[YDL6Ucf4*KZ**!6*[S"-"FG2iFfA0r40B`&iK!kAl9LY4VRb'BMdhf"Q&pR*Lrf
+PpJrV!AZX`E5hF!r"DCD"#3pf4$fpM+-&L'h$K[U@q$#(eX5#%,rl&j-K!b[m(q)
+9h&3*Cqb6FVDq@Tj,Cp9)QYfBHN)Seb0IjK[S%Mrc0h2i68c42r9PB1BL,DMpEk(
+lMa#PprQeSRN9"P-8%mbJ16"J!m'93pR'E6b&&)p-H$FZV-q!IAfl5KQIpS6lR,G
+LK1ji5ID5Di%GNYPjDV`F%Zj[bm)q#%(TGJSH-R2ApZXi4RR(S[GkAe6GqN`dNdG
+cpGXQ"IC#M$HrQ3PFCVRS!(AF@RSH`'BEY`e*QbZ`5Q$5pZ!EmPU1%5D`+Sr@L+L
+MeSZIcaR#(2GSD%$$Le6*iGqrLVP@[HbCIr,XPe&ZUk@hfqcbqZ0S+@#NdKL82j5
+"X8dJP&er`10iP&N'RjC0-NNNRb"9(Dp"Kb%CT("MMSRVfQDerUEiam3Re(hK#!$
+%N!!ABfCmBj2GZ(qAh03K-B1p&!TIi$Q("Pr)S((,qpqdc-V`kBl0LdIBa5q3!29
+DC$JpSlTHG``5Ha89qEf+jXNj`(m%2Cbe)2R8jfqXNHM4M4kEYScC#KEA3a+0!GP
+QZRUGXB[JCE!a!ZcLpe`I0G[QqPiG0pF[TC!!9fTU$VQP9RehYShR#M$RUbP9M5-
+bIRY25[@&5m8M+ibGiNPp0N21(q`1kQPj!Ci0*YKATpAMiAd@Z[&QX$1-R9RLB)p
+VmQj5II#qh(Rk,DAFr%NPII,m,'Fp!40IGhPaM!a-ifH[mNF"akR-0&+i&d(U*cA
+jQb'+K2KY%IQX%qGrEXX`SqNI,6qja3qR1C2'S8`cHa5V32@A)$,Y!9ci!XkhLND
+S$ZqLGMaIrcq2RN@+-rkHQ02+$5+F`C8M-ZkFCJC#rr'L6CpD0DRD1Va*Z($9k#Y
+@9+&(G!L%1jmke@JBHpH$6kTreTkk2d3eR0a5P(CKBl![`CU+'aah*#9LaiZcYh4
+5"Xe[MB*p$@SeShKF[(r#Zr3JqB4MlQX'jJRqHa'*'iU$D&,@IZd"m50acrD[rN3
+KN!!$"LKlkbR"9CGJ,,qG)rZJQ2C*5rN,4I2ldTXi*c+I4$[,N`rGr@c68jTAfNN
+cLMf6DNYb2GiKa-Y3kTJM&),me@"'QECkaVTrbL`Y)D(`B4rl!0``GE5mFV2fmdV
+rb+!hQLNjbXTj[5e40Ea(!$fqM'I(8`XB*F,#[KCERLE,ZG9Ifd6[#L9GN!"U-*d
+8ENU2m5[Pc65'kSUlG[L!9P&LPS'*(5%2FZZ6HP3B`GX`dPkUm6jTki0)TqX(jq,
+m+X`-6%$@"C9`r`5X2G(PUN@)bhC!#G+)DH1RL!plT`Mflj8cX+'pUC4#IU4Zfha
+3rRG!S(GJeTd!2,U#G"4V#2h2p[iNHk-iD0B0#pMJd@2X2$fTre"ZIAYIR&pHTmi
+!6&*P[#0ea3D4*R[B4*YcepR%$TJb`(P%YB9+CN[p@A[FkX%q@`["Bd0#D+Rr+'(
++D6UqVEJU0!k@!eakBj(c5e8%T-p5Tfe,GjaH,l(b+[+bbhqNd5KM(pBhSc9XciU
+%GPAZ$CRa&$lF6'AlD4KjfpKZd&4[3V$11JIAP*PQi6*-r8MLh%!hJSZbHjH,L(m
+Lq+9RVIUb%1d%IRZ*5X'p'R'alh(#-%RS5p3d[(-H1UNQYYUiH49kXmcr6NqJ(jc
+p2(39%R0KP"Ykk5YRTf'!kqqDSFj&YcZ'mcaIcZVV&QUBR,(6m"*l"TqYk'b"Qe(
+M5cS#RqPl'%#%hrQ(D4DFS#0Zbjr$8ldKV3-"0FQGG4XXHHf9$5e[M#2VQZqIC6G
+G1&jF3EB5SHkAEZ*6-jbjA*YBEcFeGhfrTi4c(iFilaDk9Y#RC,)GbAU0FRHB@[j
+iY$R4L5pDFH'TYlLISJ26"(H3!%HXr2[F,eii3i(@DU-0,h$"c,dRc)@mj&8-PV3
+b!6Y,r#'8T!e(dPdSl)mqK38Q2i$(YBe6ikFNi6"rpKpPrf+cL1D)T2BV%p5M-59
+(#`NHh$6GqDqYGcdm*IPih5l-QjKUkeKm8MYX+"U`U3CliB@9Ch4V0kl['YTkj%L
+l@J4cSp2b3CCZpbjbS*Pii34"BNf+YR[ZK+`hH$,+$1YeK+#5qXpYVIcacG,"QJ3
+F'qSrL3jr*0+D%BdL[&D6K&cc#AKdZ8&$V)a"BHL-T8rcKKGqUR8'NBcSHZ2L)'4
+[kKm")@I$@I#YiUqaCLaB'bLl30MJLeeVUB05bEcqm1DZeX10)!'[5XIRCB+[`46
+Z&eLmf*XdTH)Tf%$kU6$!C)&4P1B%q4Djk`YP(Yq%c4E"HFqh($q,TReP[afBf*8
+Kq&4Qj1,%da$328iPHrYcT-l45FNfGd)*N!$*L5FCQai1[X+TI`$LNk,36lb))hS
+c!j9X*m-,A1ZTVdXA+r@eeJ4HN!"N-Xhf'*Nka$Q%U@dF!k+Z80'Shb%FDhHH(P+
+EVD"!,dD8"9#iBk$&!KSJKjb1fkb1DrkZMej)Gr8qZ+4l'3A`!+pk16JZM!PdlKr
+J$cU5!6dYblU&LKkBTKEh6b3HdAZrB[23f@iqmA5UFj&,m-91Si)39,mrep`45$d
+E8TR-J1S"TAjkDZbRhK@'bK,eZ@5RA80@QACaShVD$aJ@Z"ddL"qGe6rS[C!!)3C
+0UE--&8jd4N-l%Q8%r$1FQrh3R3RH"EjNq*,ZcJ[dGFI1aUbUi+)NIb#%0@ea)-0
+Z1Fh9NQhq1k+4C%9MhaMdCalfq69Fm##'ZUG`VAMdKK1lL**+-4ZFq+*9!#hA'm)
+&I,CS`KX-@*&l,ZF,ird8qTi9iplZeBE2)%hjdRlhp*L'X64$*&,6AJiaj!!CNAG
+Ge3QI#!e8*NVV&-mj`rd&%*TL4m1BC`0qHE*$EXcbP`UPIN%p*MV(e(3EG0[3"e0
+3B%I,TjDX1be"baD8G20EB30EjV&bBQUBYD+18eEHp!@C5'(4(C!!CH5dqI9[[V"
+H$6E[[(F&me0JY)rUl%k26e@!aUk1ZB@$@HA*Y@b,)FL#NfV,R[,qSIX82%hp5-D
+eR1TlY(8a'CmieeB3rBPcKA&YQDP(rALbSqaq51)H6T1XPpbRV2hF"08dFG4A8pG
+@@03IM+rYjPaC*L!P&[d`"NjD)V4h2+Ykp@,N1p16)HGq)-$2@'Qqc[TU$U'mj!U
+"IZaB0Y#[!`epUj8q+YCi3$&MCBdbh$G+T,Y($,@Q*9QF$G5J"FGL2Zm-J6@YDea
+'`J&+!@H8Nlm'f1IPi111JpV!I!Xh8EV"c5r++Y)A"`k[#j9YBcfA&qJbKM0L&$"
+NE54Tq&I4U,,,'apRYa1)M4AlbcECl9M*EA!DK5rrMrYa1dk'AiS9FrX5+Udim"6
+,KURTAQ+,a9B)VC,bMpkdFmD-(68%0fKkfPRYaL#4*H3(eU2jaR"'le9'-H6fpK&
+AH%pKF3+b3phc$UQ2qG[K)#eH["!X#D0(2Pd![%FrE%R)ldMKF#FH3B$MS5TYEVZ
+'$N4DIH5Rr8TKYVF49EQCMV2lh-Xk68VT@jHZ$)D3!*S(fk*4`TB[llbRC%99(Xm
+CE!0843m1ZaX&C+mY8,&2*K&bcP2`VjU63qbaAIj5pNP%h9)bDiGXJF`1FeSjQS(
+`*U2ANB4-LN-!)$MR9'Lh"@BqR%@af!mRke")BQZ2kY)H0Q"bbCjJNRrN'$0hTf!
+5Pr+)$84,+UBH6ihr45DGP2%dFfA-%aFALk+6TUC!fI`#RPF6("irmVj3(+-@5p&
+VB@0jpqCh99ZSmefEKZG(Y9Ie2"9REZ[F,Aj!$Cj[r&@YlQDpS2a)MKA5aeKDR'F
+%*iTcL#jaR99pKMA[)V(@2)3"lBUiAk6DCrJ",hR0erF)N!!q`&Ip+c&51l(*(B1
+Kp,1CNBj%&hDfYEH%Gf6eAP2E4@VpDk'lbE([R,@aM3*V0VVXerUJJf,HlC3Q!%)
+CPeqJ`QCc(01lNJ53!1j[*Nra*5A[c`Rrbj-J,DJEP5A"3V"*+E)jefedm+pB[DC
+0hQc6q*Epf&e6MSC@kQM9lH[G0%&8#5Elq[QGS!@9d+4'SH14[+Q6a4&L2(J3Mc0
+5q2(R&RfYIAEj**-pXIMD,Y*R++GZYh@p[Y)`-("&c*[CJUFYMIkcm'rTSNZ"44l
+`B(&FeN&AEVM29)jKFirh5ESqRCJ1hl*4NRiBY4-'S+GZ!XC1R"ck68p!(9dAN4b
+"9kJ1MieH'+M6@!ipE(kaTB1Cc%rHY834pEmc1'-ZeZ@S)(14dEh,qjX8GL#C3%6
+%0djYrfl2`X@YCHQ9bc2jZcH,Lpl`hU$NkAe(,h085IN9QJa-U&X1Api2M-39GKR
+IUBfImmL*F(CKaBFQ#N"A0LraMKXf+Q1cD$MDc6NZ&"FIRAF`Ef@MPBYYfD6`b+9
+QEKB38A1XLRhU[eAV"T,+J3UF*d1JD[R`PPe[*(ZD-HC#HDZ*-'!fUq,q&EB(R)T
+Qh9QG@A+f#f"K`eREGa#eG1&8L*2M#Q[3$TPe(XL(0hmb(CNAp*KP1N@2[R1ZB[a
+GLV'`fKXkJ(f[RU""8$lbPh4FaaY0FQGjQEYd+5&JTDm@lp`4FF%[#r(I,"[)BZE
+Gl#NN3V3@al"dbBKak)pG6pM)FZ3cji(2pZBr*j@"%*HMb4+A%YN3QiESFaA29-e
+!9N['iC`E#0#qC&8j0Um1UDPj61R9N9dF`dad+RMS)'Kb2mV&*$@(q,(Y5BN-))Q
+iPMZ)4+Dq'V9!P0QeiC!!K,bCbMLI*"ee)*)V4pHcAh0*H8Iq1"XljiB4VJc&58&
+*eY+C[6`lEh0T*V0+Lp5)Sm`j+eNRf3X$KTMG+LFdhHe-IK"GBhJjNfXa9lH(Apk
+b$`2GE3kaZU,REa)eT0Rk-T!!LC'Y`bXF4RVmHLMBL[-H`b"0J(iDrN6LT"Ei8!T
+I1IVZ'l9KUHjQDDSpE#fN3AA5D2E%V)Z)''XQ-(qLIV3JP!i3J0f1VQ#ll)Q+!$B
+80F(Lm0,Fi,r+@P"eT49Z64A"2l[@fXB$URH8&#)Y14$$SLd2%,IU#2[55eL8T$4
+83$QlG5FE+SrSI[S[9PrT)P9kh,BQ*#&RAK035$0*Zr1%@r&m19JEkAHSd*lQfMr
+`U(d(06L%DVEE)61biid06MB*pp%!9jc#E*S41YQC9A@)JiU+Pm#Sf!P5fi$0V1D
+-F+XbHiIL59d@G8M3TN!5+D52`5!'J1VeG&bE@alFmF)kmA2eMl36`4DQC-[l0*`
+)cIDhRjl(%QaL,,lXV[0*J)2kQ%!SN!!qS(h8jFSIkqa$1E%#Ed[*d6*kH3GVf[Z
+Zf$N[Q#*aCpiq"NP(QXa8qi,JjL!+e0`M-bh*0EJ21bPE813+qRRD,Fb3!)Y`C&A
+4['YL4DEpdL'4UY#)HI[!hf'CJ"d!llq6p9Z3!,!CKpF5SKHd3pPfF"'Umd6!h(&
+&8mqXU)rCY3j6L9jciYPTSHI$2[6'G8'G#+FBG@Eb+U,Z0mAbP#!*U,m(*K9#V8'
+4i'PNM"IqCh2S1Ja,&&cRA86V[D%ZI)3%P$-jAd*Qk[IIBkY3$5")VYY(bkA@,8)
+ZfD62fl4B$'92$%Afm4XFNQ)#ZSP46(Y!P*8[qTE%-Q9Eff0kI)b'+f2-TijG-0%
+Yb`BqZS2`mm6-6c+FD1cehE5k('L+P5B1I5%B3U61BEU!8D8VG268d@Z#am-)ipZ
+JRd+cDIpldhTKc+kD9&-0@AaQ0ZipA'mY`q[+1L[)&9(c+FF`Gp6+)F3VP$cPY0J
+3`b+`%%fllhP,bE$I8&fh&!3-hSDbhHZ+6`PcY&1!r(*)pfcmZ-9[-YB2B5i@d!H
+X%eDk$UUQV*hidj(DIfGdTMMqZl)SX!,r5Ym`G$4)1Xida&j+pE**T+8l!B)9Y`"
+m#`SGB8M%NZ,4CQ4jZ)L@+@+kU3-'lIcSkK#F1dr`Z8bG'hVkdhQi-Yd0JZQrM8E
+%Gm+QKP[qN3S#N!"e!H[kNM3Q@D-JJPjj4P+6%"B40$[V"dRq4MR8*VhNY"0Q4dE
+b-qcUKfJI!S'k&dp,aFX%JkJS'hhTbR-`*RGdXd`k0D!4J2d1Y1D`h$G#Lf9P&`j
+hHi&qa5$Xck(hN!#D)Diaq3qX%&96BbaKV$'56ChapRc,fkp`!&D9A@4jpaJFBd#
+cFZT2*RM"qTZJih'"`qjS0plp,'0-GC13!+pbehAR0UU"P+f*HcK4#'YDBUi!,MH
+Aa5X`'bm(@e2M'5Yf)0"CCk`Y*!N#"C96pfq8#aAc&Mljrc[mk1[2dM&@fc`J%A%
+$"T'rFVB8@ZQlN!"a'l96JS1PCNU&@b6hC2I)JHQ*j""1pQD'1RJKXCd5$d4GMCN
+[#c28VPM@rmD%KC!![,&3$-k+he(XcNQMpN#NX[f)Z"&F,Z`5(jYrL)r)XikKq#6
+U(286'dGc@$a!Mf-Ykb(22(bG),b1G9@rh9hlr`#Y+h0@AHPV-6HRICT6VpiVCdb
+YZ69i9[pbT[J2h5lBp![rSGS1Gf)C'C%1pZj@@[@dl65@pjQ,00PE"E1M)BDY&)Q
+Kal5b+lIq*Ye+@aSHYa`[%eZb1",l'hYFFcPRJUaYAE"NccIP"G#I6``2+VYA$[9
+'c-`Aql`HQUmb5@4%C@1Gq#U[4"V)ES*U,%IX&L"!A-kJb'5q+HaT)(Jb%RZerpr
+4NXCGfLbR+-2[@Ce-"e-pF4"DZRBR%A4[-[A66Be$5V(fJ&Drk5%*UiXleair[%f
+QKiL%*`63I2jM,Z%6NAMrIQaUV#TRm""!HSFBkTJ9B$j#e)ebCHN6b`L8VM)$Z)L
+MccU0m'E+-liS'&5R-V`abGiGq@G+Lq-q"&$4LjqN(#91NC`A*[fH8pG@b(DTL*N
+0IX!VdVj+f65KVE!3#R$rlCG,(TXJi,GN[([Nr&bPm-5'*RFm3jh&jXF-q")+2"G
+#XL4EKNq1#)S$$Xd3-RhFG18Z5"M22jq@9%60CI$leE!QKaB@Vf@1`iH[`CSKZdb
+hqY[ZY09ZP[4RF[3P6RNAPA&jFG`l6IKiCc`KPjik4UXCQ%!a%,dLajXLH0XLCTX
+I%9`1#kYDJG"SCE(IkHreE#K#9dX`J%[IL&[8Ab+4,Rp'iUPI9Q%U`rh6jT5JCLF
+qdHkJ,(6(!iF`H(`jYD9`NZ58Hc@#aiMCD10@l,`Pdi8Yb((fe"e`q4R3E6EC,BT
+lEhm!9R$i-+&XQcaml3P[jH[&6%Ffi*Ci$d@1@$95qjQhNb$YdPIdk&%ar3FkNKc
+0l5$aL@`$3pcp#GHZM`'&Kcr8(Xp8AYc3HBAJ,5QjC(d-MIre9FehjUBI,`f(9A-
+-6qZd@XPaIG*ql*!!*U5"4h8DHZkh5P(9Q4lf"#%V,bVKZSDfQ,%cX931`r6VkNB
+4AE,&XTD`Vd(NkV!V9BE-CRVJ)#iM2!R9L`pBGD-PQpIVRX6PLT`SlL$+fTK'p6F
+IcGD'q@H%*c2Ebq1G3h"!2qU`&`UBEqS3I4mY@l!P'@M+d65l)Ge*,``#%lJ@`mr
+Hq*6eA[9l`Yr0r-AikAPEL&6)!GVhF*NI2UaVHEa)YX2mCIG*bP8MMr#YG-XHKIR
+*ep)(4P-"kjAlTVm@%(A*U-VlI3m"d##96!!LNh83TUNK$Jh-a2N8-dfYT(&cV9h
+$G,j`k-XmX06q@Mr&(kV$d"-51!-T*N,VSQX-II3$4TCALh&YkVlETPfa4pd*bD2
+F2q$L'A-1YmVrBBjfr9Kl"l0`fDSq(*!!Df`jGq$-EYGKM4C*ap-)k#YZMm#`MYT
+K0%T[IVJJ!bc%qq`k[)Jr[HK#cQm`QM`(J"kAFm*"cKr@rib[K+-)"S8lXj[ik50
+IDm0i!U86"4HZL(qjah20C9A2bQQiAYcFH-KRhZfN!0Lk04-jX21Nm'THZPqDqB*
+-5YHQ)+S#(,Eq#eUe"@@6RZqCqcf%JPkdr%Al#lEYJlmKMRlhV'Y2TF`H6fa9(c0
+Vq%A6rHIh4aDbdqUG3DQ-*LIGcqarG4f[TE*,rRZ*-K1i&iKEp0G)eZrP5c'0LR"
+SUIQUU0,DD58&f6rf5P-HF!LL22BKBDI)iqX0+(1X"))VYJX@pedNL"iL!LT"%h0
+9r(i)1S@ZU"j&9$X3@&edJ"Mi1'*llBIfeDK*#`jQAYQ`ET!!6aQU+Q&k!G[NDIE
+2!16Xe42l#'`pa+Vh"&"iNQ[[@r+)(cRr&2#TaieT,9!*lDAUfUSH&dJp9Y!#4Vc
+QL'ZTQIfU)XIT)ZAI"YR,X*BLR41UPcDlV(kZBa8)3J30k%F1i-L9K)iR+Vc(,&(
+pV,JR12rQffrcEHcJ%$fK(c(%lm@d!fXX(qdd*1@hiFTr-5qSaf$eS1jl)ci#%Jc
+j%@ArSrBNpZ+h6''De4EQ+Uf%%Fd$flKkGTUHZ8%!IaVLrj!!e&Y0`,j-!SY5e`$
+SRBcED$'F!p1pAI6PHfj1FKF#mc"b"HbS$!+@Xj'N94d9[N28fIUF`hN6bip)9)Q
+,8(V(!9II+N+DZ1riTL+h[*4QkH*rFer"*G("mp@Ll3ENK'h,P(ZpD&piM)5N8bE
+E%l"[Z)$bbeqC%S1L&CPIGPIdC!lT`eqX*&-%!3[iLM+#r8@hj3[8TC3H+!*IHf3
+dr,j$E@rFVNAQFaed`U$G$N%lS&IPD3,TcJDS-8Uql0pp*cY8r%f3!(6ec1,V,@K
+fVM6Di[[--&N`1)fN46fqh`ArA+2@DUNeIrC"G5&i,9S#-)U'T`(,`aRqHPV18S!
+kQ5HcMhqCF)D%82ZD*lI@rJCj&95i@NQFM[la5rbch,pdG1S2Pak#mpa3c1)YP4D
+kj$i8BS`U0a9b1cjL[rrXD*UV!0(pZSV-SE2(4$aJ!$#Fc#MISMI0TTIdAk89BYF
+!-F#DZ4BN(`S0YkUi+FPA&&@eI5bIL#mFZi8+AjLFX(C"#5eL!mM4#,p(RaD@CkI
+$$&C&bfP6F46RiBM$%#1cX@Ib81Pp(-&,Nfb8ZkM9T&,c+@#j$e+abQVj"3Y,FZk
+*8PVHD3VhAH`pB,S%elkc9LTj!4&[Pcacr99MAIc,J3SB(TMeG&GkpV@4a4J-S,*
+QL4fBf*(3SZ5JqVePR9BrEYYYTeX,IqJ@D[H4M#MlU*rDDa-jY4M,XD1LA*SGV),
+cQ[Ilal+91$#aRKrU'RQYJ5bM&K$'ZGULXIp6Y`rYN!"MjKM[%AA*)HeQA[6bFIV
+UF6)0VaDKd*ipSiMac8('ia"mbZ(qceF0hp3aXfcK@k0NdK`NV)ej%U&b#)LbD-)
+3r(#VLKVHl4"e8mCc8aB+KGG@-XjP2ECK@*L"C!()iIeD-XQZI"(m($!ka+EVbT`
+l+[h&9#iKQl`3+R9-+jhbr0VE(bVKfrERV$3jN62)r2KM8EA+(`D(ifYa-'bMHp(
+r#5&2aam4VVXfXSi*EB4d1pX$B&J!Y--*B,b6#A6'&XpDr)bf@PHBK(,TR(p&-!$
+A5`cL1T5@2P,C8dbA@F&)`Bbi(`#55GS&l#laa"%@VR*kDcjNX@)iJ!'par5!M@Q
+LeRZj'*j6)$TefKYdT$'2"LZbIUF6M(-![Fqkdk8d6$E6REf`bXMk&#d[6Z`BQ!!
+Z)+DjbKEh-"[J-#2TH+FhLC184iGLX,h2&EG-J*BeGRraQPcK(pQ8VjiJHP3&YN'
+3!&CG0qb[qqGbNq+lSN+IXKS-#ea",(D8,Cdd)&(ZC41BZ%,E`0`SCE(b4d*mR(C
+Lkpd&,'-p9AD#6bMThGU)&G8R[Y!$hI&d5"lST3'q"R&9b'aAYZ#!@5R!bklLLjj
+!lcq`RZ4pa`[K,#l`0cX&0cEH*D!IJ@+6m%kJ6rqkTJXGHjpddhPqYDNSN93X(a&
+S,b*5N9`LDCm%BQpJM'),EJ!Jd&c2V,$%LPlTYPc*,EM&!A"R*YLA+HNdSf"5(a[
+G#ZR,(a&D[-0GHVKrY,IlXK8rfl4+4DFUG$`RIcFhhkQ$0d3$GAR$kTa#p`)1br3
+JbBBl$!h0*j@Rjp'!'QSXf3@RC"b'ZUC,@!DSM+Pr4MjAX-4ZPj2dkK-e&$LZK`d
+hi#6CC0TLQa'hAbrFFNJRZ0kkmRHd3iaFN!!3HV"&a6Y[3R0GBE[*`&)pNTIXS!#
+lVh@6EE9l)d+P#2$Y+k0Q1DJ4ZE18!G*VUj!!9!CG&*!!l'lML26,1ejDk`%IpP5
+HHZQ$"B2i(ej6h`RASbS+CkR,*48Akm-*[q0h@lXYZ8fUBl$4-lkG!dN[&$#[F$J
+ciqVG2@h09B,ebNr%1mI0BKeIU"YDI,fV`5YY"#d@6@[Q%3e4J`8#1@#+jrR(`Il
+b(IdE*IpJh%D`!q,TV$SlKkP`-eKD3(@0bhZ'l0Ra991l2DI'ah4cXfV6d&D%`Ip
+M%%b4Y4JVj)d)h+Bq(0pLbHfq@k+E5PVLQr6EN9TqMaUeNNipa5ZfLDPep+il&le
+348C(ZYHS-VC4Ri+,$[R[C3GLqYim`RXffDaT9+6+Ei%U)kbFkQ@RU0j3f1)blh3
+%!`3XALpD&`9H)3c[&DZr+fpbe,e!M@!Z2kHp!2P94JZ3!#UUi*q"f98p-SCb'ih
+"kjk$V&*ekMG$[TMd$TH@4rS%PXbR2#JE24"@)fYrMXPM0Vl$&M#MZHd6Y!f+U)H
+kYk)XYHB25iM3BjhafdI3dJeVC8dhTFDH&))GjN8($$j@LXH6[j8+2m&cc,mC1+%
+TLikErejUUc+9Vc@AiD$I(lI2IS("m0$%L[q$&pfjEH@UUL"ND*6TUfF`,AM'Lca
+`L9Gf$XChI3Qr@[`(QT*jN4TjM8b9Q&j,%H)[#Er`p46%'k[Y+21S%YMda-)!T4&
+iF(l1GjS&rIVmeh8-F`R*d3ei0N(@L66M$$20@Y@0j,mh[Jd'GP$'G(%(&V)2Qe!
+B[80E(NVpG6m`@J&eFp",FSh1$X#,L*aSlVl181$fr,A)1T1SAbaReE%JFkbmKp4
+M8Gi0+EK&ABIh5I9%`&!%VAC6iB,VQFf4XeQ"d9qpp34kmJATLIiXe2VN4EPe0&c
+Zh)P($[4pfAI,CXdc9YaH1bmDRLX1c1XBSa!4Y'AdB-$I3a)%)lM*mDdS%!Flmh9
+N+KY%mAe[dEl1hGXEif&ER8NP2pRX"[bAG'K[kEL#!jkrS+bb44JdlXkk4jlkBIf
++(eaJF6iJJ2QR%)XeSYF%I(X!-6%6fjehppcBE5T3*9Ze#d%ATF0C+T!!R&E9DFf
+Dc))dJ2hjkYA--f51LjcPB'-a-ZklX+*XMKRABT2`RCK%c!!#d*0jP#fSqEYJCM+
+MdC6lZPPDY056@k9X)JR3R3D*$f-lPFV6!3b,6Y@ES@h6N9N)4'Q@B5Lc&T*Bqb'
+Abp+bY@*%+SF#-%`!NS%r'b2'%!"ZV63h%``0UN(($A)HRVed(A!qMfR(`jppK31
+f+XG28-)3NfqAX3'Y3R(0cSXDqXeXGeI,1*NHFdd#AZepE2QKD#Y0!@j3*'CZP'R
+McZqB+4%$`3P#@'rH!fTFQ&PA0fdPGh"Jca,Iq0$hjm21l-+JLZ1T*5cURR$FN!#
+`$AHYJE`9m&K31!Y@pkaPSbVI*PPa'-@M2YJb&1c92(c9FT'D)L*dp%lZ&"Z3!')
+8V0TT4URQE$6hLNaY84'9#qJp`M!Sl1[F5p305"1-(9P*&R@6*2ETSYmjaPG4(55
+)PPSe`K*$Je$KfeL9iKN6QBHIL[Q2%rpjaDM!HT&4l0l5%-QhT6bG45A'QP"'V1@
+4qRXS*#FK#jKqG%0RAV1)(@2rk,qqrh(de-"YY%Sh)dFMTTfUZ)EdqEHlG"k"RjP
+rkP[C%@j(4"iq3h,AUrra1Zk-KpcI+i`R'SIfX10VNJ3G@m$FdY`0[c4%P%lMZNq
+D3H8L*N!I)+Yb@Y@1*XFh!C*N$3J9k4mqi-P*#lI)XMlDjTS@f536ddC$6P5,Tm[
+PF"XP)kTc14Z4ha'3!*J5hQTl&c#5dFZH55R-3PdSiPPh6JE$XElBhYQ4HJEF6T2
+EKUk&M&h1D13&'PilPLrCZiL8F2!0%SXlPPpI#b!@BESJ!@X-!'mZNjJ0%5eY(R5
+"DeIZah1,(E9A3@Lk@Jc!e'Lk"9aL-D'4U3)e+'#aK2lH9l@Mjijb+UK"ar@+pra
+9(!VE,IP@VHqD-'i@U#"TLCmClZMc9K[6lSVr5jIVFRC,Rc9aCfB6,92M&6fkPdC
+R6CNHJX$%G$(AD80pV"dHNNm)a(mf-BU%,D@+3YbpNDLU#KhDcPJHPS!RKTQ[Fhr
+a9)0I1R+rH8hj8J(X-L9DXhHL+)VbX"2#rZ-34(e'+QHC"689B&Lc8!kaihkZcr$
+MfYr8hlPG&dN@9c)XeC`B1`a**XZNF%Z`mCi,lBDXpL&FpK1KF(UZZFm(%4+m9XF
+FjYpfU[6RN!$$[V(2F+6kGd!aKh3kVMA"6a$c@$l'-2ZJ3f1)m2@E08m$2rK)T5a
+F'1kGPFq1!ArkHDM1FbTX2,*Je@2fhm),d2Ep`k"jSQC%UQ$jDj&1+IFc*9R05$Q
+$pRrF,%5Lef-%@4CqB2p(SqL`hrUa*JA$r,$j["BjLm9#[PFKfGrhQJlB*BPdNf#
+k[PYEVCCYL44Kcd*EmDNNRiX+@b4MlB3qR,RIUMY5EZJiC4i`i(p#@&i`-,!%$bJ
+@I)leJLF"(`hl[c%5ASX5I`%GjrG(k33+fDiRf@C&,ek-(fl4qfHM+J2CSqc3@H4
+3kY"D"DQP(*Le,DV5Y(-0!-,+%mcJT)lH#PeD55&Z'Vck@aULj"+CTDY8A9E&`2%
+KRFqfZb'0P634A0J!bK)!!!:
diff --git a/src/os_macosx.c b/src/os_macosx.c
new file mode 100644
index 000000000..871eb7e5c
--- /dev/null
+++ b/src/os_macosx.c
@@ -0,0 +1,612 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_macosx.c -- election of os_mac.c or os_unix.c
+ *
+ */
+
+#ifdef MACOS_X_UNIX
+# ifdef HAVE_CONFIG_H /* Using Makefile. */
+# include "vim.h"
+# else
+# include "os_unix.c" /* Using Project Builder */
+# endif
+#else
+# include "os_mac.c"
+# include <TextEncodingConverter.h>
+#endif
+
+#ifdef _DEBUG
+ void
+Trace(char* fmt, ...)
+{
+ char buf[2048];
+ va_list args;
+
+ va_start(args, fmt);
+ /* vsnprintf(buf, sizeof(buf), fmt, args);*/
+ fprintf(stderr, "%s", buf);
+ va_end(args);
+}
+#endif
+
+#ifdef MACOS_X_ICONVEMU
+/*
+ * Libiconv emulation layer
+ */
+
+struct _iconv_t
+{
+ TECObjectRef tec;
+ TECObjectRef tecReverse;
+ TECSnifferObjectRef sniff;
+ TextEncoding from;
+ TextEncoding to;
+};
+/* typedef struct _iconv_t *iconv_t; */
+
+
+static int last_errno = 0;
+
+/*
+ * Get TextEncoding from iconv's encoding name
+ */
+ static TextEncoding
+get_textencoding(const char* encodename)
+{
+ static struct {
+ const char* name;
+ TextEncoding encode;
+ } encodetable[] = {
+ /* ISO-8859 encodings family */
+ {"latin1", kTextEncodingISOLatin1},
+ {"latin2", kTextEncodingISOLatin2},
+ {"latin3", kTextEncodingISOLatin3},
+ {"latin4", kTextEncodingISOLatin4},
+ {"latin5", kTextEncodingISOLatin5},
+ {"latin6", kTextEncodingISOLatin6},
+ {"latin7", kTextEncodingISOLatin7},
+ {"latin8", kTextEncodingISOLatin8},
+ {"latin9", kTextEncodingISOLatin9},
+ {"iso-8859-1", kTextEncodingISOLatin1},
+ {"iso-8859-2", kTextEncodingISOLatin2},
+ {"iso-8859-3", kTextEncodingISOLatin3},
+ {"iso-8859-4", kTextEncodingISOLatin4},
+ {"iso-8859-5", kTextEncodingISOLatinCyrillic},
+ {"iso-8859-6", kTextEncodingISOLatinArabic},
+ {"iso-8859-7", kTextEncodingISOLatinGreek},
+ {"iso-8859-8", kTextEncodingISOLatinHebrew},
+ {"iso-8859-9", kTextEncodingISOLatin5},
+ {"iso-8859-10", kTextEncodingISOLatin6},
+
+ /* Unicode encodings. */
+ /* TODO: Add other type of unicode */
+ {"ucs-2", kTextEncodingMacUnicode},
+
+ /* Japanese encoding aliases */
+ {"cp932", kTextEncodingShiftJIS},
+ {"shift-jis", kTextEncodingShiftJIS},
+ {"euc-jp", kTextEncodingEUC_JP},
+ {"iso-2022-jp", kTextEncodingISO_2022_JP},
+ {"iso-2022-jp-1", kTextEncodingISO_2022_JP_1},
+ {"iso-2022-jp-2", kTextEncodingISO_2022_JP_2},
+ {"iso-2022-jp-3", kTextEncodingISO_2022_JP_3},
+
+ /* Other aliases. These aliases in this block are just guessed. */
+ /* TODO: Must be verified. */
+ {"gb2312", kTextEncodingGB_2312_80},
+ {"cp936", kTextEncodingMacChineseSimp},
+ {"euc-cn", kTextEncodingEUC_CN},
+ {"cp950", kTextEncodingMacChineseTrad},
+ {"euc-tw", kTextEncodingEUC_TW},
+ {"cp949", kTextEncodingMacKorean},
+ {"euc-kr", kTextEncodingEUC_KR},
+
+ /*
+ * All encodings supported by Macintosh. You can find these values
+ * in a file:
+ * /System/Library/Frameworks/CoreServices.framework/Versions/A/
+ * Frameworks/CarbonCore.framework/Versions/A/Headers/TextCommon.h
+ */
+ {"MacRoman", kTextEncodingMacRoman},
+ {"MacJapanese", kTextEncodingMacJapanese},
+ {"MacChineseTrad", kTextEncodingMacChineseTrad},
+ {"MacKorean", kTextEncodingMacKorean},
+ {"MacArabic", kTextEncodingMacArabic},
+ {"MacHebrew", kTextEncodingMacHebrew},
+ {"MacGreek", kTextEncodingMacGreek},
+ {"MacCyrillic", kTextEncodingMacCyrillic},
+ {"MacDevanagari", kTextEncodingMacDevanagari},
+ {"MacGurmukhi", kTextEncodingMacGurmukhi},
+ {"MacGujarati", kTextEncodingMacGujarati},
+ {"MacOriya", kTextEncodingMacOriya},
+ {"MacBengali", kTextEncodingMacBengali},
+ {"MacTamil", kTextEncodingMacTamil},
+ {"MacTelugu", kTextEncodingMacTelugu},
+ {"MacKannada", kTextEncodingMacKannada},
+ {"MacMalayalam", kTextEncodingMacMalayalam},
+ {"MacSinhalese", kTextEncodingMacSinhalese},
+ {"MacBurmese", kTextEncodingMacBurmese},
+ {"MacKhmer", kTextEncodingMacKhmer},
+ {"MacThai", kTextEncodingMacThai},
+ {"MacLaotian", kTextEncodingMacLaotian},
+ {"MacGeorgian", kTextEncodingMacGeorgian},
+ {"MacArmenian", kTextEncodingMacArmenian},
+ {"MacChineseSimp", kTextEncodingMacChineseSimp},
+ {"MacTibetan", kTextEncodingMacTibetan},
+ {"MacMongolian", kTextEncodingMacMongolian},
+ {"MacEthiopic", kTextEncodingMacEthiopic},
+ {"MacCentralEurRoman", kTextEncodingMacCentralEurRoman},
+ {"MacVietnamese", kTextEncodingMacVietnamese},
+ {"MacExtArabic", kTextEncodingMacExtArabic},
+ {"MacSymbol", kTextEncodingMacSymbol},
+ {"MacDingbats", kTextEncodingMacDingbats},
+ {"MacTurkish", kTextEncodingMacTurkish},
+ {"MacCroatian", kTextEncodingMacCroatian},
+ {"MacIcelandic", kTextEncodingMacIcelandic},
+ {"MacRomanian", kTextEncodingMacRomanian},
+ {"MacCeltic", kTextEncodingMacCeltic},
+ {"MacGaelic", kTextEncodingMacGaelic},
+ {"MacKeyboardGlyphs", kTextEncodingMacKeyboardGlyphs},
+ {"MacTradChinese", kTextEncodingMacTradChinese},
+ {"MacRSymbol", kTextEncodingMacRSymbol},
+ {"MacSimpChinese", kTextEncodingMacSimpChinese},
+ {"MacGeez", kTextEncodingMacGeez},
+ {"MacEastEurRoman", kTextEncodingMacEastEurRoman},
+ {"MacUninterp", kTextEncodingMacUninterp},
+ {"MacUnicode", kTextEncodingMacUnicode},
+ {"MacFarsi", kTextEncodingMacFarsi},
+ {"MacUkrainian", kTextEncodingMacUkrainian},
+ {"MacInuit", kTextEncodingMacInuit},
+ {"MacVT100", kTextEncodingMacVT100},
+ {"MacHFS", kTextEncodingMacHFS},
+ {"UnicodeDefault", kTextEncodingUnicodeDefault},
+ {"UnicodeV1_1", kTextEncodingUnicodeV1_1},
+ {"ISO10646_1993", kTextEncodingISO10646_1993},
+ {"UnicodeV2_0", kTextEncodingUnicodeV2_0},
+ {"UnicodeV2_1", kTextEncodingUnicodeV2_1},
+ {"UnicodeV3_0", kTextEncodingUnicodeV3_0},
+ {"UnicodeV3_1", kTextEncodingUnicodeV3_1},
+ {"UnicodeV3_2", kTextEncodingUnicodeV3_2},
+ {"ISOLatin1", kTextEncodingISOLatin1},
+ {"ISOLatin2", kTextEncodingISOLatin2},
+ {"ISOLatin3", kTextEncodingISOLatin3},
+ {"ISOLatin4", kTextEncodingISOLatin4},
+ {"ISOLatinCyrillic", kTextEncodingISOLatinCyrillic},
+ {"ISOLatinArabic", kTextEncodingISOLatinArabic},
+ {"ISOLatinGreek", kTextEncodingISOLatinGreek},
+ {"ISOLatinHebrew", kTextEncodingISOLatinHebrew},
+ {"ISOLatin5", kTextEncodingISOLatin5},
+ {"ISOLatin6", kTextEncodingISOLatin6},
+ {"ISOLatin7", kTextEncodingISOLatin7},
+ {"ISOLatin8", kTextEncodingISOLatin8},
+ {"ISOLatin9", kTextEncodingISOLatin9},
+ {"DOSLatinUS", kTextEncodingDOSLatinUS},
+ {"DOSGreek", kTextEncodingDOSGreek},
+ {"DOSBalticRim", kTextEncodingDOSBalticRim},
+ {"DOSLatin1", kTextEncodingDOSLatin1},
+ {"DOSGreek1", kTextEncodingDOSGreek1},
+ {"DOSLatin2", kTextEncodingDOSLatin2},
+ {"DOSCyrillic", kTextEncodingDOSCyrillic},
+ {"DOSTurkish", kTextEncodingDOSTurkish},
+ {"DOSPortuguese", kTextEncodingDOSPortuguese},
+ {"DOSIcelandic", kTextEncodingDOSIcelandic},
+ {"DOSHebrew", kTextEncodingDOSHebrew},
+ {"DOSCanadianFrench", kTextEncodingDOSCanadianFrench},
+ {"DOSArabic", kTextEncodingDOSArabic},
+ {"DOSNordic", kTextEncodingDOSNordic},
+ {"DOSRussian", kTextEncodingDOSRussian},
+ {"DOSGreek2", kTextEncodingDOSGreek2},
+ {"DOSThai", kTextEncodingDOSThai},
+ {"DOSJapanese", kTextEncodingDOSJapanese},
+ {"DOSChineseSimplif", kTextEncodingDOSChineseSimplif},
+ {"DOSKorean", kTextEncodingDOSKorean},
+ {"DOSChineseTrad", kTextEncodingDOSChineseTrad},
+ {"WindowsLatin1", kTextEncodingWindowsLatin1},
+ {"WindowsANSI", kTextEncodingWindowsANSI},
+ {"WindowsLatin2", kTextEncodingWindowsLatin2},
+ {"WindowsCyrillic", kTextEncodingWindowsCyrillic},
+ {"WindowsGreek", kTextEncodingWindowsGreek},
+ {"WindowsLatin5", kTextEncodingWindowsLatin5},
+ {"WindowsHebrew", kTextEncodingWindowsHebrew},
+ {"WindowsArabic", kTextEncodingWindowsArabic},
+ {"WindowsBalticRim", kTextEncodingWindowsBalticRim},
+ {"WindowsVietnamese", kTextEncodingWindowsVietnamese},
+ {"WindowsKoreanJohab", kTextEncodingWindowsKoreanJohab},
+ {"US_ASCII", kTextEncodingUS_ASCII},
+ {"JIS_X0201_76", kTextEncodingJIS_X0201_76},
+ {"JIS_X0208_83", kTextEncodingJIS_X0208_83},
+ {"JIS_X0208_90", kTextEncodingJIS_X0208_90},
+ {"JIS_X0212_90", kTextEncodingJIS_X0212_90},
+ {"JIS_C6226_78", kTextEncodingJIS_C6226_78},
+ {"ShiftJIS_X0213_00", kTextEncodingShiftJIS_X0213_00},
+ {"GB_2312_80", kTextEncodingGB_2312_80},
+ {"GBK_95", kTextEncodingGBK_95},
+ {"GB_18030_2000", kTextEncodingGB_18030_2000},
+ {"KSC_5601_87", kTextEncodingKSC_5601_87},
+ {"KSC_5601_92_Johab", kTextEncodingKSC_5601_92_Johab},
+ {"CNS_11643_92_P1", kTextEncodingCNS_11643_92_P1},
+ {"CNS_11643_92_P2", kTextEncodingCNS_11643_92_P2},
+ {"CNS_11643_92_P3", kTextEncodingCNS_11643_92_P3},
+ {"ISO_2022_JP", kTextEncodingISO_2022_JP},
+ {"ISO_2022_JP_2", kTextEncodingISO_2022_JP_2},
+ {"ISO_2022_JP_1", kTextEncodingISO_2022_JP_1},
+ {"ISO_2022_JP_3", kTextEncodingISO_2022_JP_3},
+ {"ISO_2022_CN", kTextEncodingISO_2022_CN},
+ {"ISO_2022_CN_EXT", kTextEncodingISO_2022_CN_EXT},
+ {"ISO_2022_KR", kTextEncodingISO_2022_KR},
+ {"EUC_JP", kTextEncodingEUC_JP},
+ {"EUC_CN", kTextEncodingEUC_CN},
+ {"EUC_TW", kTextEncodingEUC_TW},
+ {"EUC_KR", kTextEncodingEUC_KR},
+ {"ShiftJIS", kTextEncodingShiftJIS},
+ {"KOI8_R", kTextEncodingKOI8_R},
+ {"Big5", kTextEncodingBig5},
+ {"MacRomanLatin1", kTextEncodingMacRomanLatin1},
+ {"HZ_GB_2312", kTextEncodingHZ_GB_2312},
+ {"Big5_HKSCS_1999", kTextEncodingBig5_HKSCS_1999},
+ {"NextStepLatin", kTextEncodingNextStepLatin},
+ {"EBCDIC_US", kTextEncodingEBCDIC_US},
+ {"EBCDIC_CP037", kTextEncodingEBCDIC_CP037},
+ {"MultiRun", kTextEncodingMultiRun},
+
+ /* Terminator */
+ {NULL, -1},
+ };
+ int i;
+
+ i = 0;
+ for (i = 0; encodetable[i].name != NULL; ++i)
+ {
+ if (STRICMP(encodename, encodetable[i].name) == 0)
+ break;
+ }
+ return encodetable[i].encode;
+}
+
+/*
+ * iconv interfaces
+ */
+
+ iconv_t
+iconv_open(const char* tocode, const char* fromcode)
+{
+ TextEncoding toEnc, fromEnc;
+ iconv_t cd = NULL;
+ OSStatus st;
+
+ /* Verify to/from encoding name */
+ toEnc = get_textencoding(tocode);
+ fromEnc = get_textencoding(fromcode);
+ if (toEnc < 0 || fromEnc < 0)
+ goto ICONV_OPEN_ERR;
+
+ /* Allocate memory to object */
+ cd = (iconv_t)alloc(sizeof(struct _iconv_t));
+ if (!cd)
+ goto ICONV_OPEN_ERR;
+ memset(cd, 0, sizeof(struct _iconv_t));
+
+ /* Create converter */
+ if (fromEnc != toEnc)
+ {
+ TRACE("*** fromEnc=%d toEnc=%d\n", (int)fromEnc, (int)toEnc);
+ st = TECCreateConverter(&cd->tec, fromEnc, toEnc);
+ if (st != 0)
+ {
+ TRACE("*** TECCreateConverter()=%d\n", (int)st);
+ goto ICONV_OPEN_ERR;
+ }
+ /* Create reverse converter */
+ st = TECCreateConverter(&cd->tecReverse, toEnc, fromEnc);
+ if (st != 0)
+ {
+ TRACE("*** TECCreateConverter()=%d (reverse)\n", (int)st);
+ goto ICONV_OPEN_ERR;
+ }
+ /* Create Sniffer */
+ st = TECCreateSniffer(&cd->sniff, &fromEnc, 1);
+ if (st != 0)
+ {
+ TRACE("*** TECCreateSniffer()=%d\n", (int)st);
+ goto ICONV_OPEN_ERR;
+ }
+ }
+
+ cd->from = fromEnc;
+ cd->to = toEnc;
+ last_errno = 0;
+ return cd;
+
+ICONV_OPEN_ERR:
+ if (cd)
+ iconv_close(cd);
+ last_errno = EINVAL;
+ return (iconv_t)-1;
+}
+
+/*
+ * Used when there are same value in 'from encoding' and 'to encoding'.
+ * TEC doesn't support conversion between same encodings, and
+ * TECCreateConverter() failed.
+ */
+ static size_t
+null_conv(iconv_t cd, const char** inbuf, size_t *inbytesleft,
+ char** outbuf, size_t *outbytesleft)
+{
+ const char* buf_in = inbuf && *inbuf ? *inbuf : NULL;
+ char* buf_out = outbuf && *outbuf ? *outbuf : NULL;
+
+ if (buf_in)
+ {
+ int in_len = inbytesleft ? *inbytesleft : 0;
+ int out_len = outbytesleft ? *outbytesleft : 0;
+
+ if (!buf_out || out_len <= 0)
+ {
+ last_errno = E2BIG;
+ return -1;
+ }
+ else if (in_len > 0)
+ {
+ int len = in_len < out_len ? in_len : out_len;
+
+ memcpy (buf_out, buf_in, len);
+ *inbuf += len;
+ *outbuf += len;
+ *inbytesleft -= len;
+ *outbytesleft -= len;
+ if (*outbytesleft <= 0)
+ {
+ last_errno = E2BIG;
+ return -1;
+ }
+ }
+ }
+ last_errno = 0;
+ return 0;
+}
+
+ size_t
+iconv(iconv_t cd, const char** inbuf, size_t *inbytesleft,
+ char** outbuf, size_t *outbytesleft)
+{
+ ConstTextPtr buf_in;
+ TextPtr buf_out;
+ ByteCount out_len, out_true;
+ ByteCount in_len, in_true;
+ OSStatus st;
+
+ if (!cd)
+ {
+ last_errno = ENOENT; /* TODO: Another error code should be set */
+ return -1;
+ }
+ if (cd->from == cd->to)
+ return null_conv(cd, inbuf, inbytesleft, outbuf, outbytesleft) ;
+
+ buf_in = (TextPtr) inbuf ;
+ buf_out = (TextPtr) outbuf ;
+ out_len = out_true = -1;
+ in_len = in_true = -1;
+
+ if (buf_in && buf_out)
+ {
+ ItemCount error, feature;
+
+ /* Normal convert mode */
+ if (!inbytesleft || !outbytesleft)
+ {
+ last_errno = EFAULT;
+ return -1;
+ }
+ in_len = *inbytesleft;
+ out_len = *outbytesleft;
+
+ /* Check stream is form in expected encoding or not */
+ st = TECSniffTextEncoding(cd->sniff, (TextPtr)buf_in, in_len,
+ &cd->from, 1, &error, 1, &feature, 1);
+ TRACE("TECSniffTextEncoding()=%d error=%d feature=%d\n",
+ (int)st, (int)error, (int)feature);
+ if ((error != 0 || feature == 0)
+ && !(error == 0xffffffff && feature == 0xffffffff))
+ /* Not expected encoding */
+ st = kTECUnmappableElementErr;
+ else
+ {
+ /* Do convert */
+ st = TECConvertText(cd->tec,
+ buf_in, in_len, &in_true,
+ buf_out, out_len, &out_true);
+ /* Verify converted text. Compare original text with reverse
+ * converted text. If not match, there is some problem on
+ * converting. */
+ if (st == 0 && in_true > 0)
+ {
+ ByteCount rev_in, rev_out;
+ TextPtr buf_rev = (TextPtr)alloc(in_true);
+
+ if (buf_rev)
+ {
+ st = TECConvertText(cd->tecReverse,
+ buf_out, out_true, &rev_in,
+ buf_rev, in_true, &rev_out);
+ if (st != 0 || rev_in != out_true || rev_out != in_true
+ || memcmp(buf_rev, buf_in, rev_out) != 0)
+ {
+#ifdef ICONVOSX_DEBUG
+ fprintf(stderr, " reverse conversion failed.\n");
+#endif
+ st = kTECUnmappableElementErr;
+ }
+ vim_free(buf_rev);
+ }
+ else
+ st = kTECUnmappableElementErr;
+ }
+ }
+ }
+ else if (!buf_in && buf_out)
+ {
+ /* Flush all buffered strings to buffer, and reset status */
+ if (!outbytesleft)
+ {
+ last_errno = EFAULT;
+ return -1;
+ }
+ out_len = *outbytesleft;
+ st = TECFlushText(cd->tec,
+ buf_out, out_len, &out_true);
+ }
+ else if (!buf_in && !buf_out)
+ {
+ /* Reset cd's status and cancel buffered strings */
+ unsigned char tmp_out[256];
+
+ buf_out = tmp_out;
+ out_len = sizeof(tmp_out);
+ st = TECFlushText(cd->tec,
+ buf_out, out_len, &out_true);
+ }
+ else
+ {
+ last_errno = EFAULT;
+ return -1;
+ }
+ TRACE("st=%d, buf_in=%p, in_len=%d, in_true=%d\n"
+ " buf_out=%p, out_len=%d, out_true=%d\n", (int)st,
+ buf_in, (int)in_len, (int)in_true,
+ buf_out, (int)out_len, (int)out_true);
+
+ switch (st)
+ {
+ case 0:
+ /* No error */
+ if (inbytesleft)
+ *inbytesleft -= in_true;
+ if (outbytesleft)
+ *outbytesleft -= out_true;
+ if (inbuf && *inbuf)
+ *inbuf += in_true;
+ if (outbuf && *outbuf)
+ *outbuf += out_true;
+ last_errno = 0;
+ return 0; /* No error */
+ case kTECUnmappableElementErr:
+ last_errno = EILSEQ;
+ case kTECIncompleteElementErr:
+ last_errno = EINVAL;
+ case kTECOutputBufferFullStatus:
+ last_errno = E2BIG;
+ return -1;
+ default:
+ TRACE("iconv(%p, %p, %p, %p, %p) failed. (%d)\n",
+ cd, inbuf, inbytesleft, outbuf, outbytesleft, (int)st);
+ last_errno = EFAULT;
+ return -1;
+ }
+}
+
+ int
+iconv_close(iconv_t cd)
+{
+ if (cd)
+ {
+ /* Free all elements of iconv_t */
+ if (cd->tec)
+ TECDisposeConverter(cd->tec);
+ if (cd->tecReverse)
+ TECDisposeConverter(cd->tecReverse);
+ if (cd->sniff)
+ TECDisposeSniffer(cd->sniff);
+ vim_free(cd);
+ last_errno = 0;
+ return 0;
+ }
+ else
+ {
+ last_errno = EINVAL;
+ return -1;
+ }
+}
+
+ int*
+iconv_errno()
+{
+ return &last_errno;
+}
+#endif /* MACOS_X_ICONVEMU */
+
+#ifdef USE_MCH_GETTEXT
+
+#define GETTEXT_BUFNUM 64
+#define GETTEXT_BUFSIZE 256
+
+ char*
+mch_gettext(const char* msgid)
+{
+ static char buf[GETTEXT_BUFNUM][GETTEXT_BUFSIZE];
+ static int bufnum = 0;
+ const char *msg = NULL;
+ CFStringRef strkey = NULL, strmsg = NULL;
+ CFStringEncoding enc;
+
+ if (!msgid)
+ goto MCH_GETTEXT_FINISH;
+ enc = CFStringGetSystemEncoding();
+ TRACE("mch_gettext(%s)\n", msgid);
+
+ strkey = CFStringCreateWithCString(NULL, msgid, enc);
+ if (!strkey)
+ {
+ TRACE(" Can't create a CFString for msgid.\n");
+ goto MCH_GETTEXT_FINISH;
+ }
+
+ strmsg = CFCopyLocalizedString(strkey, NULL);
+ if (!strmsg)
+ {
+ TRACE(" No localized strings for msgid.\n");
+ goto MCH_GETTEXT_FINISH;
+ }
+
+ msg = CFStringGetCStringPtr(strmsg, enc);
+ if (!msg)
+ {
+ /* This is as backup when CFStringGetCStringPtr was failed */
+ CFStringGetCString(strmsg, buf[bufnum], GETTEXT_BUFSIZE, enc);
+ msg = buf[bufnum];
+ if (++bufnum >= GETTEXT_BUFNUM)
+ bufnum = 0;
+ }
+ TRACE(" Localized to: %s\n", msg);
+
+MCH_GETTEXT_FINISH:
+ if (strkey)
+ CFRelease(strkey);
+ if (strmsg)
+ CFRelease(strmsg);
+ return (char*)(msg ? msg : msgid);
+}
+
+ char*
+mch_bindtextdomain(const char* domain, const char* dirname)
+{
+ TRACE("mch_bindtextdomain(%s, %s)\n", domain, dirname);
+ return (char*)dirname;
+}
+
+ char*
+mch_textdomain(const char* domain)
+{
+ TRACE("mch_textdomain(%s)\n", domain);
+ return (char*)domain;
+}
+#endif
diff --git a/src/os_mint.h b/src/os_mint.h
new file mode 100644
index 000000000..94419b389
--- /dev/null
+++ b/src/os_mint.h
@@ -0,0 +1,13 @@
+/* vim:ts=8 sts=4:sw=4
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Atari MiNT Machine-dependent things.
+ */
+
+#define BINARY_FILE_IO
diff --git a/src/os_msdos.c b/src/os_msdos.c
new file mode 100644
index 000000000..2d8b127e6
--- /dev/null
+++ b/src/os_msdos.c
@@ -0,0 +1,3114 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_msdos.c
+ *
+ * MSDOS system-dependent routines.
+ * A cheap plastic imitation of the amiga dependent code.
+ * A lot in this file was made by Juergen Weigert (jw).
+ *
+ * DJGPP changes by Gert van Antwerpen
+ * Faster text screens by John Lange (jlange@zilker.net)
+ * Windows clipboard functionality added by David Kotchan (dk)
+ *
+ * Some functions are also used for Win16 (MS-Windows 3.1).
+ */
+
+#include <io.h>
+#include "vim.h"
+
+#include <conio.h>
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+/*
+ * MS-DOS only code, not used for Win16.
+ */
+#ifndef WIN16
+
+
+#include <bios.h>
+#ifdef DJGPP
+# include <dpmi.h>
+# include <signal.h>
+# include <sys/movedata.h>
+# include <crt0.h>
+# ifdef FEAT_CLIPBOARD
+# include <sys/segments.h>
+# endif
+#else
+# include <alloc.h>
+#endif
+
+#if defined(DJGPP) || defined(PROTO)
+# define _cdecl /* DJGPP doesn't have this */
+#endif
+
+static int cbrk_pressed = FALSE; /* set by ctrl-break interrupt */
+static int ctrlc_pressed = FALSE; /* set when ctrl-C or ctrl-break detected */
+static int delayed_redraw = FALSE; /* set when ctrl-C detected */
+
+static int bioskey_read = _NKEYBRD_READ; /* bioskey() argument: read key */
+static int bioskey_ready = _NKEYBRD_READY; /* bioskey() argument: key ready? */
+
+#ifdef FEAT_MOUSE
+static int mouse_avail = FALSE; /* mouse present */
+static int mouse_active; /* mouse enabled */
+static int mouse_hidden; /* mouse not shown */
+static int mouse_click = -1; /* mouse status */
+static int mouse_last_click = -1; /* previous status at click */
+static int mouse_x = -1; /* mouse x coodinate */
+static int mouse_y = -1; /* mouse y coodinate */
+static long mouse_click_time = 0; /* biostime() of last click */
+static int mouse_click_count = 0; /* count for multi-clicks */
+static int mouse_click_x = 0; /* x of previous mouse click */
+static int mouse_click_y = 0; /* y of previous mouse click */
+static linenr_T mouse_topline = 0; /* w_topline at previous mouse click */
+#ifdef FEAT_DIFF
+static int mouse_topfill = 0; /* w_topfill at previous mouse click */
+#endif
+static int mouse_x_div = 8; /* column = x coord / mouse_x_div */
+static int mouse_y_div = 8; /* line = y coord / mouse_y_div */
+#endif
+
+#define BIOSTICK 55 /* biostime() increases one tick about
+ every 55 msec */
+
+static int orig_attr = 0x0700; /* video attributes when starting */
+
+static int S_iLeft = 0; /* Scroll window; these are 1 offset */
+static int S_iTop = 0;
+static int S_iRight = 0;
+static int S_iBottom = 0;
+
+/*
+ * Need to remember the values, because we set horizontal and vertical
+ * edges separately.
+ */
+ static void
+mywindow(int iLeft, int iTop, int iRight, int iBottom)
+{
+ S_iLeft = iLeft;
+ S_iTop = iTop;
+ S_iRight = iRight;
+ S_iBottom = iBottom;
+ window(iLeft, iTop, iRight, iBottom);
+}
+
+#ifdef DJGPP
+/*
+ * For DJGPP, use our own functions for fast text screens. JML 1/18/98
+ */
+
+unsigned long S_ulScreenBase = 0xb8000;
+unsigned short S_uiAttribute = 0;
+int S_iCurrentRow = 0; /* These are 0 offset */
+int S_iCurrentColumn = 0;
+short S_selVideo; /* Selector for DJGPP direct video transfers */
+
+/*
+ * Use burst writes to improve mch_write speed - VJN 01/10/99
+ */
+unsigned short S_linebuffer[8000]; /* <VN> enough for 160x50 */
+unsigned short S_blankbuffer[256]; /* <VN> max length of console line */
+unsigned short *S_linebufferpos = S_linebuffer;
+int S_iBufferRow;
+int S_iBufferColumn;
+
+ static void
+myflush(void)
+{
+ if (S_linebufferpos != S_linebuffer)
+ {
+ _dosmemputw(S_linebuffer, (S_linebufferpos - S_linebuffer),
+ S_ulScreenBase
+ + S_iBufferRow * (Columns << 1) + (S_iBufferColumn << 1));
+ S_linebufferpos = S_linebuffer;
+ }
+}
+
+ static void
+mygotoxy(int x, int y)
+{
+ S_iCurrentRow = y - 1;
+ S_iCurrentColumn = x - 1;
+}
+
+/*
+ * Set the system cursor to our cursor position.
+ */
+ static void
+set_sys_cursor(void)
+{
+ if (term_console && full_screen)
+ {
+ myflush();
+ gotoxy(S_iCurrentColumn + 1, S_iCurrentRow + 1);
+ }
+}
+
+ static void
+setblankbuffer(unsigned short uiValue)
+{
+ int i;
+ static unsigned short olduiValue = 0;
+
+ if (olduiValue != uiValue)
+ {
+ /* Load blank line buffer with spaces */
+ for (i = 0; i < Columns; ++i)
+ S_blankbuffer[i] = uiValue;
+ olduiValue = uiValue;
+ }
+}
+
+ static void
+myclreol(void)
+{
+ /* Clear to end of line */
+ setblankbuffer(S_uiAttribute | ' ');
+ _dosmemputw(S_blankbuffer, S_iRight - S_iCurrentColumn, S_ulScreenBase
+ + (S_iCurrentRow) * (Columns << 1)
+ + (S_iCurrentColumn << 1));
+}
+
+ static void
+myclrscr(void)
+{
+ /* Clear whole screen */
+ short iColumn;
+ int endpoint = (Rows * Columns) << 1;
+
+ setblankbuffer(S_uiAttribute | ' ');
+
+ for (iColumn = 0; iColumn < endpoint; iColumn += (Columns << 1))
+ _dosmemputw(S_blankbuffer, Columns, S_ulScreenBase + iColumn);
+}
+
+ static void
+mydelline(void)
+{
+ short iRow, iColumn;
+
+ iColumn = (S_iLeft - 1) << 1;
+
+ /* Copy the lines underneath */
+ for (iRow = S_iCurrentRow; iRow < S_iBottom - 1; iRow++)
+ movedata(S_selVideo, (((iRow + 1) * Columns) << 1) + iColumn,
+ S_selVideo, ((iRow * Columns) << 1) + iColumn,
+ (S_iRight - S_iLeft + 1) << 1);
+
+ /* Clear the new row */
+ setblankbuffer(S_uiAttribute | ' ');
+
+ _dosmemputw(S_blankbuffer, (S_iRight - S_iLeft) + 1, S_ulScreenBase
+ + (S_iBottom - 1) * (Columns << 1) + iColumn);
+}
+
+ static void
+myinsline(void)
+{
+ short iRow, iColumn;
+
+ iColumn = (S_iLeft - 1) << 1;
+
+ /* Copy the lines underneath */
+ for (iRow = S_iBottom - 1; iRow >= S_iTop; iRow--)
+ movedata(S_selVideo, (((iRow - 1) * Columns) << 1) + iColumn,
+ S_selVideo, ((iRow * Columns) << 1) + iColumn,
+ (S_iRight - S_iLeft + 1) << 1);
+
+ /* Clear the new row */
+ setblankbuffer(S_uiAttribute | ' ');
+
+ _dosmemputw(S_blankbuffer, (S_iRight - S_iLeft) + 1, S_ulScreenBase
+ + (S_iTop - 1) * (Columns << 1) + iColumn);
+}
+
+/*
+ * Scroll the screen one line up, clear the last line.
+ */
+ static void
+myscroll(void)
+{
+ short iRow, iColumn;
+
+ iColumn = (S_iLeft - 1) << 1;
+
+ /* Copy the screen */
+ for (iRow = S_iTop; iRow < S_iBottom; iRow++)
+ movedata(S_selVideo, ((iRow * Columns) << 1) + iColumn,
+ S_selVideo, (((iRow - 1) * Columns) << 1) + iColumn,
+ (S_iRight - S_iLeft + 1) << 1);
+
+ /* Clear the bottom row */
+ setblankbuffer(S_uiAttribute | ' ');
+
+ _dosmemputw(S_blankbuffer, (S_iRight - S_iLeft) + 1, S_ulScreenBase
+ + (S_iBottom - 1) * (Columns << 1) + iColumn);
+}
+
+ static int
+myputch(int iChar)
+{
+ unsigned short uiValue;
+
+ if (iChar == '\n')
+ {
+ myflush();
+ if (S_iCurrentRow >= S_iBottom - S_iTop)
+ myscroll();
+ else
+ {
+ S_iCurrentColumn = S_iLeft - 1;
+ S_iCurrentRow++;
+ }
+ }
+ else if (iChar == '\r')
+ {
+ myflush();
+ S_iCurrentColumn = S_iLeft - 1;
+ }
+ else if (iChar == '\b')
+ {
+ myflush();
+ if (S_iCurrentColumn >= S_iLeft)
+ S_iCurrentColumn--;
+ }
+ else if (iChar == 7)
+ {
+ sound(440); /* short beep */
+ delay(200);
+ nosound();
+ }
+ else
+ {
+ uiValue = S_uiAttribute | (unsigned char)iChar;
+
+ /*
+ * Normal char - are we starting to buffer?
+ */
+ if (S_linebufferpos == S_linebuffer)
+ {
+ S_iBufferColumn = S_iCurrentColumn;
+ S_iBufferRow = S_iCurrentRow;
+ }
+
+ *S_linebufferpos++ = uiValue;
+
+ S_iCurrentColumn++;
+ if (S_iCurrentColumn >= S_iRight && S_iCurrentRow >= S_iBottom - S_iTop)
+ {
+ myflush();
+ myscroll();
+ S_iCurrentColumn = S_iLeft - 1;
+ S_iCurrentRow++;
+ }
+ }
+
+ return 0;
+}
+
+ static void
+mytextinit(struct text_info *pTextinfo)
+{
+ S_selVideo = __dpmi_segment_to_descriptor(S_ulScreenBase >> 4);
+ S_uiAttribute = pTextinfo->normattr << 8;
+}
+
+ static void
+get_screenbase(void)
+{
+ static union REGS regs;
+
+ /* old Hercules grafic card has different base address (Macewicz) */
+ regs.h.ah = 0x0f;
+ (void)int86(0x10, &regs, &regs); /* int 10 0f */
+ if (regs.h.al == 0x07) /* video mode 7 -- hercules mono */
+ S_ulScreenBase = 0xb0000;
+ else
+ S_ulScreenBase = 0xb8000;
+}
+
+ static void
+mytextattr(int iAttribute)
+{
+ S_uiAttribute = (unsigned short)iAttribute << 8;
+}
+
+ static void
+mynormvideo(void)
+{
+ mytextattr(orig_attr);
+}
+
+ static void
+mytextcolor(int iTextColor)
+{
+ S_uiAttribute = (unsigned short)((S_uiAttribute & 0xf000)
+ | (unsigned short)iTextColor << 8);
+}
+
+ static void
+mytextbackground(int iBkgColor)
+{
+ S_uiAttribute = (unsigned short)((S_uiAttribute & 0x0f00)
+ | (unsigned short)(iBkgColor << 12));
+}
+/*
+ * Getdigits: Get a number from a string and skip over it.
+ * Note: the argument is a pointer to a char_u pointer!
+ */
+
+ static long
+mygetdigits(pp)
+ char_u **pp;
+{
+ char_u *p;
+ long retval = 0;
+
+ p = *pp;
+ if (*p == '-') /* skip negative sign */
+ ++p;
+ while (VIM_ISDIGIT(*p))
+ {
+ retval = (retval * 10) + (*p - '0');
+ ++p;
+ }
+ if (**pp == '-') /* process negative sign */
+ retval = -retval;
+
+ *pp = p;
+ return retval;
+}
+#else
+# define mygotoxy gotoxy
+# define myputch putch
+# define myscroll scroll
+# define mynormvideo normvideo
+# define mytextattr textattr
+# define mytextcolor textcolor
+# define mytextbackground textbackground
+# define mygetdigits getdigits
+# define myclreol clreol
+# define myclrscr clrscr
+# define myinsline insline
+# define mydelline delline
+#endif
+
+static const struct
+{
+ char_u scancode;
+ char_u metakey;
+} altkey_table[] =
+{
+ {0x1e, 0xe1}, /* a */
+ {0x30, 0xe2}, /* b */
+ {0x2e, 0xe3}, /* c */
+ {0x20, 0xe4}, /* d */
+ {0x12, 0xe5}, /* e */
+ {0x21, 0xe6}, /* f */
+ {0x22, 0xe7}, /* g */
+ {0x23, 0xe8}, /* h */
+ {0x17, 0xe9}, /* i */
+ {0x24, 0xea}, /* j */
+ {0x25, 0xeb}, /* k */
+ {0x26, 0xec}, /* l */
+ {0x32, 0xed}, /* m */
+ {0x31, 0xee}, /* n */
+ {0x18, 0xef}, /* o */
+ {0x19, 0xf0}, /* p */
+ {0x10, 0xf1}, /* q */
+ {0x13, 0xf2}, /* r */
+ {0x1f, 0xf3}, /* s */
+ {0x14, 0xf4}, /* t */
+ {0x16, 0xf5}, /* u */
+ {0x2f, 0xf6}, /* v */
+ {0x11, 0xf7}, /* w */
+ {0x2d, 0xf8}, /* x */
+ {0x15, 0xf9}, /* y */
+ {0x2c, 0xfa}, /* z */
+ {0x78, 0xb1}, /* 1 */
+ {0x79, 0xb2}, /* 2 */
+ {0x7a, 0xb3}, /* 3 */
+ {0x7b, 0xb4}, /* 4 */
+ {0x7c, 0xb5}, /* 5 */
+ {0x7d, 0xb6}, /* 6 */
+ {0x7e, 0xb7}, /* 7 */
+ {0x7f, 0xb8}, /* 8 */
+ {0x80, 0xb9}, /* 9 */
+ {0x81, 0xb0}, /* 0 */
+};
+
+/*
+ * Translate extended keycodes into meta-chars where applicable
+ */
+ static int
+translate_altkeys(int rawkey)
+{
+ int i, c;
+
+ if ((rawkey & 0xff) == 0)
+ {
+ c = (rawkey >> 8);
+ for (i = sizeof(altkey_table) / sizeof(altkey_table[0]); --i >= 0; )
+ {
+ if (c == altkey_table[i].scancode)
+ return (int)altkey_table[i].metakey;
+ }
+ }
+ return rawkey;
+}
+
+/*
+ * Set normal fg/bg color, based on T_ME. Called whem t_me has been set.
+ */
+ void
+mch_set_normal_colors()
+{
+ char_u *p;
+ int n;
+
+ cterm_normal_fg_color = (orig_attr & 0xf) + 1;
+ cterm_normal_bg_color = ((orig_attr >> 4) & 0xf) + 1;
+ if (T_ME[0] == ESC && T_ME[1] == '|')
+ {
+ p = T_ME + 2;
+ n = getdigits(&p);
+ if (*p == 'm' && n > 0)
+ {
+ cterm_normal_fg_color = (n & 0xf) + 1;
+ cterm_normal_bg_color = ((n >> 4) & 0xf) + 1;
+ }
+ }
+}
+
+#if defined(MCH_CURSOR_SHAPE) || defined(PROTO)
+/*
+ * Save/restore the shape of the cursor.
+ * call with FALSE to save, TRUE to restore
+ */
+ static void
+mch_restore_cursor_shape(int restore)
+{
+ static union REGS regs;
+ static int saved = FALSE;
+
+ if (restore)
+ {
+ if (saved)
+ regs.h.ah = 0x01; /*Set Cursor*/
+ else
+ return;
+ }
+ else
+ {
+ regs.h.ah = 0x03; /*Get Cursor*/
+ regs.h.bh = 0x00; /*Page */
+ saved = TRUE;
+ }
+
+ (void)int86(0x10, &regs, &regs);
+}
+
+/*
+ * Set the shape of the cursor.
+ * 'thickness' can be from 0 (thin) to 7 (block)
+ */
+ static void
+mch_set_cursor_shape(int thickness)
+{
+ union REGS regs;
+
+ regs.h.ch = 7 - thickness; /*Starting Line*/
+ regs.h.cl = 7; /*Ending Line*/
+ regs.h.ah = 0x01; /*Set Cursor*/
+ (void)int86(0x10, &regs, &regs);
+}
+
+ void
+mch_update_cursor(void)
+{
+ int idx;
+ int thickness;
+
+ /*
+ * How the cursor is drawn depends on the current mode.
+ */
+ idx = get_shape_idx(FALSE);
+
+ if (shape_table[idx].shape == SHAPE_BLOCK)
+ thickness = 7;
+ else
+ thickness = (7 * shape_table[idx].percentage + 90) / 100;
+ mch_set_cursor_shape(thickness);
+}
+#endif
+
+/*
+ * Return amount of memory currently available.
+ */
+ long_u
+mch_avail_mem(int special)
+{
+#ifdef DJGPP
+ return _go32_dpmi_remaining_virtual_memory();
+#else
+ return coreleft();
+#endif
+}
+
+#ifdef FEAT_MOUSE
+
+/*
+ * Set area where mouse can be moved to: The whole screen.
+ * Rows and Columns must be valid when calling!
+ */
+ static void
+mouse_area(void)
+{
+ union REGS regs;
+
+ if (mouse_avail)
+ {
+ regs.x.cx = 0; /* mouse visible between cx and dx */
+ regs.x.dx = Columns * mouse_x_div - 1;
+ regs.x.ax = 7;
+ (void)int86(0x33, &regs, &regs);
+
+ regs.x.cx = 0; /* mouse visible between cx and dx */
+ regs.x.dx = Rows * mouse_y_div - 1;
+ regs.x.ax = 8;
+ (void)int86(0x33, &regs, &regs);
+ }
+}
+
+ static void
+show_mouse(int on)
+{
+ static int was_on = FALSE;
+ union REGS regs;
+
+ if (mouse_avail)
+ {
+ if (!mouse_active || mouse_hidden)
+ on = FALSE;
+ /*
+ * Careful: Each switch on must be compensated by exactly one switch
+ * off
+ */
+ if ((on && !was_on) || (!on && was_on))
+ {
+ was_on = on;
+ regs.x.ax = on ? 1 : 2;
+ int86(0x33, &regs, &regs); /* show mouse */
+ if (on)
+ mouse_area();
+ }
+ }
+}
+
+#endif
+
+/*
+ * Version of kbhit() and getch() that use direct console I/O.
+ * This avoids trouble with CTRL-P and the like, and should work over a telnet
+ * connection (it works for Xvi).
+ */
+
+static int cons_key = -1;
+
+/*
+ * Try to get one character directly from the console.
+ * If there is a key, it is stored in cons_key.
+ * Only call when cons_key is -1!
+ */
+ static void
+cons_getkey(void)
+{
+ union REGS regs;
+
+ /* call DOS function 6: Direct console I/O */
+ regs.h.ah = 0x06;
+ regs.h.dl = 0xff;
+ (void)intdos(&regs, &regs);
+ if ((regs.x.flags & 0x40) == 0) /* zero flag not set? */
+ cons_key = (regs.h.al & 0xff);
+}
+
+/*
+ * Return TRUE if a character is available.
+ */
+ static int
+cons_kbhit(void)
+{
+ if (cons_key < 0)
+ cons_getkey();
+ return (cons_key >= 0);
+}
+
+/*
+ * Return a character from the console.
+ * Should only be called when vim_kbhit() returns TRUE.
+ */
+ static int
+cons_getch(void)
+{
+ int c = -1;
+
+ if (cons_key < 0)
+ cons_getkey();
+ c = cons_key;
+ cons_key = -1;
+ return c;
+}
+
+
+#ifdef DJGPP
+/*
+ * DJGPP provides a kbhit() function that goes to the BIOS instead of DOS.
+ * This doesn't work for terminals connected to a serial port.
+ * Redefine kbhit() here to make it work.
+ */
+ static int
+vim_kbhit(void)
+{
+ union REGS regs;
+
+ regs.h.ah = 0x0b;
+ (void)intdos(&regs, &regs);
+ return regs.h.al;
+}
+
+#ifdef kbhit
+# undef kbhit /* might have been defined in conio.h */
+#endif
+#define kbhit() vim_kbhit()
+
+#endif
+
+/*
+ * Simulate WaitForChar() by slowly polling with bioskey(1) or kbhit().
+ *
+ * If Vim should work over the serial line after a 'ctty com1' we must use
+ * kbhit() and getch(). (jw)
+ * Usually kbhit() is not used, because then CTRL-C and CTRL-P
+ * will be catched by DOS (mool).
+ *
+ * return TRUE if a character is available, FALSE otherwise
+ */
+
+#define FOREVER 1999999999L
+
+ static int
+WaitForChar(long msec)
+{
+ union REGS regs;
+ long starttime = 0;
+ int x, y;
+
+ if (msec != 0)
+ starttime = biostime(0, 0L);
+
+ for (;;)
+ {
+#ifdef FEAT_MOUSE
+ long clicktime;
+ static int old_status = 0;
+
+ if (mouse_avail && mouse_active && mouse_click < 0)
+ {
+ regs.x.ax = 3;
+ int86(0x33, &regs, &regs); /* check mouse status */
+ /* only recognize button-down and button-up event */
+ x = regs.x.cx / mouse_x_div;
+ y = regs.x.dx / mouse_y_div;
+ if ((old_status == 0) != (regs.x.bx == 0))
+ {
+ if (old_status) /* button up */
+ mouse_click = MOUSE_RELEASE;
+ else /* button down */
+ {
+ /*
+ * Translate MSDOS mouse events to Vim mouse events.
+ * TODO: should handle middle mouse button, by pressing
+ * left and right at the same time.
+ */
+ if (regs.x.bx & MSDOS_MOUSE_LEFT)
+ mouse_click = MOUSE_LEFT;
+ else if (regs.x.bx & MSDOS_MOUSE_RIGHT)
+ mouse_click = MOUSE_RIGHT;
+ else if (regs.x.bx & MSDOS_MOUSE_MIDDLE)
+ mouse_click = MOUSE_MIDDLE;
+
+ /*
+ * Find out if this is a multi-click
+ */
+ clicktime = biostime(0, 0L);
+ if (mouse_click_x == x && mouse_click_y == y
+ && mouse_topline == curwin->w_topline
+#ifdef FEAT_DIFF
+ && mouse_topfill == curwin->w_topfill
+#endif
+ && mouse_click_count != 4
+ && mouse_click == mouse_last_click
+ && clicktime < mouse_click_time
+ + p_mouset / BIOSTICK)
+ ++mouse_click_count;
+ else
+ mouse_click_count = 1;
+ mouse_click_time = clicktime;
+ mouse_last_click = mouse_click;
+ mouse_click_x = x;
+ mouse_click_y = y;
+ mouse_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ mouse_topfill = curwin->w_topfill;
+#endif
+ SET_NUM_MOUSE_CLICKS(mouse_click, mouse_click_count);
+ }
+ }
+ else if (old_status && (x != mouse_x || y != mouse_y))
+ mouse_click = MOUSE_DRAG;
+ old_status = regs.x.bx;
+ if (mouse_hidden && mouse_x >= 0 && (mouse_x != x || mouse_y != y))
+ {
+ mouse_hidden = FALSE;
+ show_mouse(TRUE);
+ }
+ mouse_x = x;
+ mouse_y = y;
+ }
+#endif
+
+ if ((p_consk ? cons_kbhit()
+ : p_biosk ? bioskey(bioskey_ready) : kbhit())
+ || cbrk_pressed
+#ifdef FEAT_MOUSE
+ || mouse_click >= 0
+#endif
+ )
+ return TRUE;
+ /*
+ * Use biostime() to wait until our time is done.
+ * We busy-wait here. Unfortunately, delay() and usleep() have been
+ * reported to give problems with the original Windows 95. This is
+ * fixed in service pack 1, but not everybody installed that.
+ * The DJGPP implementation of usleep() uses a busy-wait loop too.
+ */
+ if (msec == 0 || (msec != FOREVER
+ && biostime(0, 0L) > starttime + msec / BIOSTICK))
+ break;
+
+#ifdef DJGPP
+ /* Yield the CPU to the next process. */
+ __dpmi_yield();
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * don't do anything for about "msec" msec
+ */
+ void
+mch_delay(
+ long msec,
+ int ignoreinput)
+{
+ long starttime;
+
+ if (ignoreinput)
+ {
+ /*
+ * We busy-wait here. Unfortunately, delay() and usleep() have been
+ * reported to give problems with the original Windows 95. This is
+ * fixed in service pack 1, but not everybody installed that.
+ */
+ starttime = biostime(0, 0L);
+ while (biostime(0, 0L) < starttime + msec / BIOSTICK)
+ ;
+ }
+ else
+ WaitForChar(msec);
+}
+
+/*
+ * mch_write(): write the output buffer to the screen
+ */
+ void
+mch_write(
+ char_u *s,
+ int len)
+{
+ char_u *p;
+ int row, col;
+
+ if (term_console && full_screen)
+ while (len--)
+ {
+ /* translate ESC | sequences into bios calls */
+ if (p_wd) /* testing: wait a bit for each char */
+ WaitForChar(p_wd);
+
+ if (s[0] == '\n')
+#ifdef DJGPP
+ {
+ myflush();
+ S_iCurrentColumn = S_iLeft - 1;
+ }
+#else
+ myputch('\r');
+#endif
+ else if (s[0] == ESC && len > 1 && s[1] == '|')
+ {
+ switch (s[2])
+ {
+#ifdef DJGPP
+ case 'B': ScreenVisualBell();
+ goto got3;
+#endif
+ case 'J':
+#ifdef DJGPP
+ myflush();
+#endif
+ myclrscr();
+ goto got3;
+
+ case 'K':
+#ifdef DJGPP
+ myflush();
+#endif
+ myclreol();
+ goto got3;
+
+ case 'L':
+#ifdef DJGPP
+ myflush();
+#endif
+ myinsline();
+ goto got3;
+
+ case 'M':
+#ifdef DJGPP
+ myflush();
+#endif
+ mydelline();
+got3: s += 3;
+ len -= 2;
+ continue;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': p = s + 2;
+ row = mygetdigits(&p); /* no check for length! */
+ if (p > s + len)
+ break;
+ if (*p == ';')
+ {
+ ++p;
+ col = mygetdigits(&p); /* no check for length! */
+ if (p > s + len)
+ break;
+ if (*p == 'H' || *p == 'r' || *p == 'V')
+ {
+#ifdef DJGPP
+ myflush();
+#endif
+ if (*p == 'H') /* set cursor position */
+ mygotoxy(col, row);
+ else if (*p == 'V')
+ mywindow(row, S_iTop, col, S_iBottom);
+ else /* set scroll region */
+ mywindow(S_iLeft, row, S_iRight, col);
+ len -= p - s;
+ s = p + 1;
+ continue;
+ }
+ }
+ else if (*p == 'm' || *p == 'f' || *p == 'b')
+ {
+ if (*p == 'm') /* set color */
+ {
+ if (row == 0)
+ mynormvideo();/* reset color */
+ else
+ mytextattr(row);
+ }
+ else if (*p == 'f') /* set foreground color */
+ mytextcolor(row);
+ else /* set background color */
+ mytextbackground(row);
+
+ len -= p - s;
+ s = p + 1;
+ continue;
+ }
+ }
+ }
+ myputch(*s++);
+ }
+ else
+ {
+ write(1, s, (unsigned)len);
+ }
+}
+
+/*
+ * mch_inchar(): low level input funcion.
+ * Get a characters from the keyboard.
+ * If time == 0 do not wait for characters.
+ * If time == n wait a short time for characters.
+ * If time == -1 wait forever for characters.
+ *
+ * return the number of characters obtained
+ */
+ int
+mch_inchar(
+ char_u *buf,
+ int maxlen,
+ long time,
+ int tb_change_cnt)
+{
+ int len = 0;
+ int c;
+ int tmp_c;
+ static int nextchar = 0; /* may keep character when maxlen == 1 */
+#ifdef FEAT_AUTOCMD
+ static int once_already = 0;
+#endif
+
+ /*
+ * if we got a ctrl-C when we were busy, there will be a "^C" somewhere
+ * on the sceen, so we need to redisplay it.
+ */
+ if (delayed_redraw)
+ {
+ delayed_redraw = FALSE;
+ update_screen(CLEAR);
+ setcursor();
+ out_flush();
+ }
+
+ /* return remaining character from last call */
+ if (nextchar)
+ {
+ *buf = nextchar;
+ nextchar = 0;
+ return 1;
+ }
+
+#ifdef FEAT_MOUSE
+ if (time != 0)
+ show_mouse(TRUE);
+#endif
+#ifdef DJGPP
+ set_sys_cursor();
+#endif
+ if (time >= 0)
+ {
+ if (WaitForChar(time) == 0) /* no character available */
+ {
+#ifdef FEAT_MOUSE
+ show_mouse(FALSE);
+#endif
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return 0;
+ }
+ }
+ else /* time == -1 */
+ {
+#ifdef FEAT_AUTOCMD
+ if (once_already == 2)
+ updatescript(0);
+ else if (once_already == 1)
+ {
+ setcursor();
+ once_already = 2;
+ return 0;
+ }
+ else
+#endif
+ /*
+ * If there is no character available within 2 seconds (default)
+ * write the autoscript file to disk
+ */
+ if (WaitForChar(p_ut) == 0)
+ {
+#ifdef FEAT_AUTOCMD
+ if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
+ {
+ apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
+ update_screen(VALID);
+ once_already = 1;
+ return 0;
+ }
+ else
+#endif
+ updatescript(0);
+ }
+ }
+ WaitForChar(FOREVER); /* wait for key or mouse click */
+
+/*
+ * Try to read as many characters as there are, until the buffer is full.
+ */
+ /*
+ * we will get at least one key. Get more if they are available
+ * After a ctrl-break we have to read a 0 (!) from the buffer.
+ * bioskey(1) will return 0 if no key is available and when a
+ * ctrl-break was typed. When ctrl-break is hit, this does not always
+ * implies a key hit.
+ */
+ cbrk_pressed = FALSE;
+#ifdef FEAT_MOUSE
+ if (mouse_click >= 0 && maxlen >= 5)
+ {
+ len = 5;
+ *buf++ = ESC + 128;
+ *buf++ = 'M';
+ *buf++ = mouse_click;
+ *buf++ = mouse_x + '!';
+ *buf++ = mouse_y + '!';
+ mouse_click = -1;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_MOUSE
+ mouse_hidden = TRUE;
+#endif
+ if (p_biosk && !p_consk)
+ {
+ while ((len == 0 || bioskey(bioskey_ready)) && len < maxlen)
+ {
+ c = translate_altkeys(bioskey(bioskey_read)); /* get the key */
+ /*
+ * translate a few things for inchar():
+ * 0x0000 == CTRL-break -> 3 (CTRL-C)
+ * 0x0300 == CTRL-@ -> NUL
+ * 0xnn00 == extended key code -> K_NUL, nn
+ * 0xnne0 == enhanced keyboard -> K_NUL, nn
+ * K_NUL -> K_NUL, 3
+ */
+ if (c == 0)
+ c = 3;
+ else if (c == 0x0300)
+ c = NUL;
+ else if ((c & 0xff) == 0
+ || c == K_NUL
+ || c == 0x4e2b
+ || c == 0x4a2d
+ || c == 0x372a
+ || ((c & 0xff) == 0xe0 && c != 0xe0))
+ {
+ if (c == K_NUL)
+ c = 3;
+ else
+ c >>= 8;
+ *buf++ = K_NUL;
+ ++len;
+ }
+
+ if (len < maxlen)
+ {
+ *buf++ = c;
+ len++;
+#ifdef FEAT_MBYTE
+ /* Convert from 'termencoding' to 'encoding'. Only
+ * translate normal characters, not key codes. */
+ if (input_conv.vc_type != CONV_NONE
+ && (len == 1 || buf[-2] != K_NUL))
+ len += convert_input(buf - 1, 1, maxlen - len + 1) - 1;
+#endif
+ }
+ else
+ nextchar = c;
+ }
+ }
+ else
+ {
+ while ((len == 0 || (p_consk ? cons_kbhit() : kbhit()))
+ && len < maxlen)
+ {
+ switch (c = (p_consk ? cons_getch() : getch()))
+ {
+ case 0:
+ /* NUL means that there is another character.
+ * Get it immediately, because kbhit() doesn't always
+ * return TRUE for the second character.
+ */
+ if (p_consk)
+ c = cons_getch();
+ else
+ c = getch();
+ tmp_c = translate_altkeys(c << 8);
+ if (tmp_c == (c << 8))
+ {
+ *buf++ = K_NUL;
+ ++len;
+ }
+ else
+ c = tmp_c;
+ break;
+ case K_NUL:
+ *buf++ = K_NUL;
+ ++len;
+ c = 3;
+ break;
+ case 3:
+ cbrk_pressed = TRUE;
+ /*FALLTHROUGH*/
+ default:
+ break;
+ }
+ if (len < maxlen)
+ {
+ *buf++ = c;
+ ++len;
+ }
+ else
+ nextchar = c;
+ }
+ }
+ }
+#ifdef FEAT_MOUSE
+ show_mouse(FALSE);
+#endif
+
+ beep_count = 0; /* may beep again now that we got some chars */
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return len;
+}
+
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail(void)
+{
+ return WaitForChar(0L);
+}
+
+#ifdef DJGPP
+# define INT_ARG int
+#else
+# define INT_ARG
+#endif
+
+/*
+ * function for ctrl-break interrupt
+ */
+ static void interrupt
+#ifdef DJGPP
+catch_cbrk(int a)
+#else
+catch_cbrk(void)
+#endif
+{
+ cbrk_pressed = TRUE;
+ ctrlc_pressed = TRUE;
+}
+
+#ifndef DJGPP
+/*
+ * ctrl-break handler for DOS. Never called when a ctrl-break is typed, because
+ * we catch interrupt 1b. If you type ctrl-C while Vim is waiting for a
+ * character this function is not called. When a ctrl-C is typed while Vim is
+ * busy this function may be called. By that time a ^C has been displayed on
+ * the screen, so we have to redisplay the screen. We can't do that here,
+ * because we may be called by DOS. The redraw is in mch_inchar().
+ */
+ static int _cdecl
+cbrk_handler(void)
+{
+ delayed_redraw = TRUE;
+ return 1; /* resume operation after ctrl-break */
+}
+
+/*
+ * function for critical error interrupt
+ * For DOS 1 and 2 return 0 (Ignore).
+ * For DOS 3 and later return 3 (Fail)
+ */
+ static void interrupt
+catch_cint(bp, di, si, ds, es, dx, cx, bx, ax)
+ unsigned bp, di, si, ds, es, dx, cx, bx, ax;
+{
+ ax = (ax & 0xff00); /* set AL to 0 */
+ if (_osmajor >= 3)
+ ax |= 3; /* set AL to 3 */
+}
+#endif
+
+/*
+ * Set the interrupt vectors for use with Vim on or off.
+ * on == TRUE means as used within Vim
+ */
+ static void
+set_interrupts(int on)
+{
+ static int saved_cbrk;
+#ifndef DJGPP
+ static void interrupt (*old_cint)();
+#endif
+ static void interrupt (*old_cbrk)(INT_ARG);
+
+ if (on)
+ {
+ saved_cbrk = getcbrk(); /* save old ctrl-break setting */
+ setcbrk(0); /* do not check for ctrl-break */
+#ifdef DJGPP
+ old_cbrk = signal(SIGINT, catch_cbrk); /* critical error interrupt */
+#else
+ old_cint = getvect(0x24); /* save old critical error interrupt */
+ setvect(0x24, catch_cint); /* install our critical error interrupt */
+ old_cbrk = getvect(0x1B); /* save old ctrl-break interrupt */
+ setvect(0x1B, catch_cbrk); /* install our ctrl-break interrupt */
+ ctrlbrk(cbrk_handler); /* vim's ctrl-break handler */
+#endif
+ if (term_console)
+ out_str(T_ME); /* set colors */
+ }
+ else
+ {
+ setcbrk(saved_cbrk); /* restore ctrl-break setting */
+#ifdef DJGPP
+ signal(SIGINT,old_cbrk); /* critical error interrupt */
+#else
+ setvect(0x24, old_cint); /* restore critical error interrupt */
+ setvect(0x1B, old_cbrk); /* restore ctrl-break interrupt */
+#endif
+ /* restore ctrl-break handler, how ??? */
+ if (term_console)
+ mynormvideo(); /* restore screen colors */
+ }
+}
+
+/*
+ * We have no job control, fake it by starting a new shell.
+ */
+ void
+mch_suspend(void)
+{
+ suspend_shell();
+}
+
+extern int _fmode;
+
+/*
+ * Prepare window for use by Vim.
+ */
+ void
+mch_init(void)
+{
+ union REGS regs;
+
+#if defined(DJGPP) && defined(FEAT_CLIPBOARD)
+ __dpmi_regs dpmi_regs;
+#endif
+
+ /*
+ * Get the video attributes at the cursor. These will be used as the
+ * default attributes.
+ */
+ regs.h.ah = 0x08;
+ regs.h.bh = 0x00; /* video page 0 */
+ int86(0x10, &regs, &regs);
+ orig_attr = regs.h.ah;
+ mynormvideo();
+ if (cterm_normal_fg_color == 0)
+ cterm_normal_fg_color = (orig_attr & 0xf) + 1;
+ if (cterm_normal_bg_color == 0)
+ cterm_normal_bg_color = ((orig_attr >> 4) & 0xf) + 1;
+
+ term_console = TRUE; /* assume using the console for the things here */
+ _fmode = O_BINARY; /* we do our own CR-LF translation */
+ out_flush();
+ set_interrupts(TRUE); /* catch interrupts */
+
+#ifdef DJGPP
+ /*
+ * Use Long File Names by default, if $LFN not set.
+ */
+ if (getenv("LFN") == NULL)
+ putenv("LFN=y");
+
+ get_screenbase();
+#endif
+
+#ifdef FEAT_MOUSE
+/* find out if a MS compatible mouse is available */
+ regs.x.ax = 0;
+ (void)int86(0x33, &regs, &regs);
+ mouse_avail = regs.x.ax;
+ /* best guess for mouse coordinate computations */
+ mch_get_shellsize();
+ if (Columns <= 40)
+ mouse_x_div = 16;
+ if (Rows == 30)
+ mouse_y_div = 16;
+#endif
+
+ /*
+ * Try switching to 16 colors for background, instead of 8 colors and
+ * blinking. Does this always work? Can the old value be restored?
+ */
+ regs.x.ax = 0x1003;
+ regs.h.bl = 0x00;
+ regs.h.bh = 0x00;
+ int86(0x10, &regs, &regs);
+
+ /*
+ * Test if we have an enhanced AT keyboard. Write 0xFFFF to the keyboard
+ * buffer and try to read it back. If we can't in 16 tries, it's an old
+ * type XT keyboard.
+ */
+ regs.h.ah = 0x05;
+ regs.x.cx = 0xffff;
+ int86(0x16, &regs, &regs);
+ if (regs.h.al != 1) /* skip this when keyboard buffer is full */
+ {
+ int i;
+
+ for (i = 0; i < 16; ++i)
+ {
+ regs.h.ah = 0x10;
+ int86(0x16, &regs, &regs);
+ if (regs.x.ax == 0xffff)
+ break;
+ }
+ if (i == 16) /* 0xffff not read, must be old keyboard */
+ {
+ bioskey_read = 0;
+ bioskey_ready = 1;
+ }
+ }
+
+#ifdef MCH_CURSOR_SHAPE
+ /* Save the old cursor shape */
+ mch_restore_cursor_shape(FALSE);
+ /* Initialise the cursor shape */
+ mch_update_cursor();
+#endif
+
+#if defined(DJGPP) && defined(FEAT_CLIPBOARD)
+ /*
+ * Check to see if the Windows clipboard is available, ie. are we
+ * running from a DOS session within Windows. Obviously, the Windows
+ * clipboard will not be available if we're running under pure DOS.
+ *
+ * int 0x2f, AX = 0x1700 identifies the Windows version we're running
+ * under. Upon return from the interrupt, if AX is unchanged, we're
+ * running under pure DOS and no Windows clipboard is available.
+ *
+ * Remark: could use int86() here but __dpmi_int() is recommended in
+ * the DJGPP docs, since int86() doesn't cover all available interrupts.
+ */
+ dpmi_regs.x.ax = 0x1700;
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ /* real-mode interrupt failed? */
+ dpmi_regs.x.ax = 0x1700; /* force failure */
+
+ if (dpmi_regs.x.ax == 0x1700) /* no change in AX? */
+ clip_init(FALSE); /* no clipboard available, too bad */
+ else /* else, running under Windows, OK */
+ clip_init(TRUE); /* clipboard is available */
+#endif
+}
+
+ int
+mch_check_win(
+ int argc,
+ char **argv)
+{
+ /* store argv[0], may be used for $VIM */
+ if (*argv[0] != NUL)
+ exe_name = FullName_save((char_u *)argv[0], FALSE);
+
+ /*
+ * Try the DOS search path. The executable may in
+ * fact be called differently, so try this last.
+ */
+ if (exe_name == NULL || *exe_name == NUL)
+ exe_name = searchpath("vim.exe");
+
+ if (isatty(1))
+ return OK;
+ return FAIL;
+}
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ */
+ int
+mch_input_isatty(void)
+{
+ if (isatty(read_cmd_fd))
+ return TRUE;
+ return FALSE;
+}
+
+#if defined(USE_FNAME_CASE) || defined(PROTO)
+/*
+ * fname_case(): Set the case of the file name, if it already exists.
+ * TODO: should expand short to long file names. Need to use DOS interrupts,
+ * see DJGPP sources libc/dos/dir/findfirs.c.
+ */
+ void
+fname_case(char_u *name, int len)
+{
+ char_u *tail;
+ struct ffblk fb;
+
+ slash_adjust(name);
+ if (findfirst(name, &fb, 0) == 0)
+ {
+ tail = gettail(name);
+ if (len == 0 ? STRLEN(tail) == STRLEN(fb.ff_name)
+ : (tail - name) + STRLEN(fb.ff_name) < len)
+ STRCPY(tail, fb.ff_name);
+ }
+}
+#endif
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid(void)
+{
+ return (long)0;
+}
+
+/*
+ * Change default drive (just like _chdrive of Borland C 3.1)
+ */
+ static int
+change_drive(int drive)
+{
+ union REGS regs;
+
+ regs.h.ah = 0x0e;
+ regs.h.dl = drive - 1;
+ intdos(&regs, &regs); /* set default drive */
+ regs.h.ah = 0x19;
+ intdos(&regs, &regs); /* get default drive */
+ if (regs.h.al == drive - 1)
+ return 0;
+ return -1;
+}
+
+/*
+ * Get absolute file name into buffer 'buf' of length 'len' bytes.
+ * All slashes are replaced with backslashes, to avoid trouble when comparing
+ * file names. When 'shellslash' set do it the other way around.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_FullName(
+ char_u *fname,
+ char_u *buf,
+ int len,
+ int force)
+{
+ if (!force && mch_isFullName(fname)) /* already expanded */
+ {
+ STRNCPY(buf, fname, len);
+ buf[len - 1] = NUL;
+ slash_adjust(buf);
+ return OK;
+ }
+
+#ifdef __BORLANDC__ /* Only Borland C++ has this */
+ if (_fullpath((char *)buf, (char *)fname, len - 1) == NULL)
+ return FAIL;
+ return OK;
+#else /* almost the same as mch_FullName() in os_unix.c */
+ {
+# if 1
+ char_u fullpath[MAXPATHL];
+
+ if (!_truename(fname, fullpath))
+ return FAIL;
+ slash_adjust(fullpath); /* Only needed when 'shellslash' set */
+ STRNCPY(buf, fullpath, len);
+ buf[len - 1] = NUL;
+ return OK;
+
+# else /* Old code, to be deleted... */
+ int l;
+ char_u olddir[MAXPATHL];
+ char_u *p, *q;
+ int c;
+ int retval = OK;
+
+ *buf = 0;
+ /*
+ * change to the directory for a moment,
+ * and then do the getwd() (and get back to where we were).
+ * This will get the correct path name with "../" things.
+ */
+ p = vim_strrchr(fname, '/');
+ q = vim_strrchr(fname, '\\');
+ if (q != NULL && (p == NULL || q > p))
+ p = q;
+ q = vim_strrchr(fname, ':');
+ if (q != NULL && (p == NULL || q > p))
+ p = q;
+ if (p != NULL)
+ {
+ if (getcwd(olddir, MAXPATHL) == NULL)
+ {
+ p = NULL; /* can't get current dir: don't chdir */
+ retval = FAIL;
+ }
+ else
+ {
+ if (p == fname) /* /fname */
+ q = p + 1; /* -> / */
+ else if (q + 1 == p) /* ... c:\foo */
+ q = p + 1; /* -> c:\ */
+ else /* but c:\foo\bar */
+ q = p; /* -> c:\foo */
+
+ c = *q; /* truncate at start of fname */
+ *q = NUL;
+# ifdef DJGPP
+ STRCPY(buf, fname);
+ slash_adjust(buf); /* needed when fname starts with \ */
+ if (mch_chdir(buf)) /* change to the directory */
+# else
+ if (mch_chdir(fname)) /* change to the directory */
+# endif
+ retval = FAIL;
+ else
+ {
+ fname = q;
+ if (c == psepc) /* if we cut the name at a */
+ fname++; /* '\', don't add it again */
+ }
+ *q = c;
+ }
+ }
+ if (getcwd(buf, len) == NULL)
+ {
+ retval = FAIL;
+ *buf = NUL;
+ }
+# ifdef USE_FNAME_CASE
+ else
+ {
+ char_u *head;
+ char_u *tail;
+ struct ffblk fb;
+ int c;
+ int added;
+
+ /* Apparently "longna~1" isn't expanded by getcwd(), at least not
+ * for DJGPP. Expand it here. Have to do each dirname
+ * separately. */
+ slash_adjust(buf);
+ head = buf;
+ if (isalpha(*head) && head[1] == ':')
+ head += 2; /* skip "c:" */
+ while (*head != NUL)
+ {
+ /* Advance "head" to the start of a dirname and "tail" to just
+ * after it. */
+ while (*head == '/' || *head == '\\')
+ ++head;
+ for (tail = head; *tail != NUL; ++tail)
+ if (*tail == '/' || *tail == '\\')
+ break;
+ c = *tail;
+ *tail = NUL;
+
+ if (findfirst(buf, &fb, FA_DIREC) == 0)
+ {
+ added = STRLEN(fb.ff_name);
+ if ((head - buf) + added + STRLEN(tail + 1) + 2 < len)
+ {
+ added -= (tail - head);
+ if (added != 0)
+ mch_memmove(tail + 1 + added, tail + 1,
+ STRLEN(tail + 1) + 1);
+ STRCPY(head, fb.ff_name);
+ tail += added;
+ }
+ }
+ *tail = c;
+ head = tail;
+ }
+ }
+# endif
+ if (p != NULL)
+ mch_chdir(olddir);
+ /*
+ * Concatenate the file name to the path.
+ */
+ if (*fname != NUL)
+ {
+ l = STRLEN(buf);
+ if (l > 0 && buf[l - 1] != '/' && buf[l - 1] != '\\')
+ strcat(buf, pseps);
+ strcat(buf, fname);
+ }
+ return retval;
+# endif
+ }
+#endif
+}
+
+/*
+ * Replace all slashes by backslashes.
+ * This used to be the other way around, but MS-DOS sometimes has problems
+ * with slashes (e.g. in a command name). We can't have mixed slashes and
+ * backslashes, because comparing file names will not work correctly. The
+ * commands that use a file name should try to avoid the need to type a
+ * backslash twice.
+ * When 'shellslash' set do it the other way around.
+ */
+ void
+slash_adjust(char_u *p)
+{
+#ifdef OLD_DJGPP /* this seems to have been fixed in DJGPP 2.01 */
+ /* DJGPP can't handle a file name that starts with a backslash, and when it
+ * starts with a slash there should be no backslashes */
+ if (*p == '\\' || *p == '/')
+ while (*p)
+ {
+ if (*p == '\\')
+ *p = '/';
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+ else
+#endif
+ while (*p)
+ {
+ if (*p == psepcN)
+ *p = psepc;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+}
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(char_u *fname)
+{
+ /* A name like "d:/foo" and "//server/share" is absolute */
+ return (fname[0] != NUL && fname[1] == ':'
+ && (fname[2] == '/' || fname[2] == '\\'))
+ || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\'));
+}
+
+
+ void
+mch_early_init(void)
+{
+}
+
+/*
+ * Careful: mch_exit() may be called before mch_init()!
+ */
+ void
+mch_exit(int r)
+{
+ settmode(TMODE_COOK);
+ stoptermcap();
+ set_interrupts(FALSE); /* restore interrupts */
+#ifdef DJGPP
+ set_sys_cursor();
+#endif
+ /* Somehow outputting CR-NL causes the original colors to be restored */
+ out_char('\r');
+ out_char('\n');
+ out_flush();
+ ml_close_all(TRUE); /* remove all memfiles */
+#ifdef MCH_CURSOR_SHAPE
+ mch_restore_cursor_shape(TRUE);
+#endif
+ exit(r);
+}
+
+/*
+ * set the tty in (raw) ? "raw" : "cooked" mode
+ * Does not change the tty, as bioskey() and kbhit() work raw all the time.
+ */
+ void
+mch_settmode(int tmode)
+{
+}
+
+#ifdef FEAT_MOUSE
+ void
+mch_setmouse(int on)
+{
+ mouse_active = on;
+ mouse_hidden = TRUE; /* dont show it until moved */
+}
+#endif
+
+/*
+ * set screen mode
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_screenmode(char_u *arg)
+{
+ int mode;
+ int i;
+ static char *(names[]) = {"BW40", "C40", "BW80", "C80", "MONO", "C4350"};
+ static int modes[] = { BW40, C40, BW80, C80, MONO, C4350};
+
+ mode = -1;
+ if (VIM_ISDIGIT(*arg)) /* mode number given */
+ mode = atoi((char *)arg);
+ else
+ {
+ for (i = 0; i < sizeof(names) / sizeof(char_u *); ++i)
+ if (stricmp(names[i], (char *)arg) == 0)
+ {
+ mode = modes[i];
+ break;
+ }
+ }
+ if (mode == -1)
+ {
+ EMSG("E362: Unsupported screen mode");
+ return FAIL;
+ }
+ textmode(mode); /* use Borland function */
+#ifdef DJGPP
+ /* base address may have changed */
+ get_screenbase();
+#endif
+
+ /* Screen colors may have changed. */
+ out_str(T_ME);
+
+#ifdef FEAT_MOUSE
+ if (mode <= 1 || mode == 4 || mode == 5 || mode == 13 || mode == 0x13)
+ mouse_x_div = 16;
+ else
+ mouse_x_div = 8;
+ if (mode == 0x11 || mode == 0x12)
+ mouse_y_div = 16;
+ else if (mode == 0x10)
+ mouse_y_div = 14;
+ else
+ mouse_y_div = 8;
+ shell_resized();
+#endif
+ return OK;
+}
+
+/*
+ * Structure used by Turbo-C/Borland-C to store video parameters.
+ */
+#ifndef DJGPP
+extern struct text_info _video;
+#endif
+
+/*
+ * try to get the real window size
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_get_shellsize(void)
+{
+ struct text_info textinfo;
+
+ /*
+ * The screenwidth is returned by the BIOS OK.
+ * The screenheight is in a location in the bios RAM, if the display is
+ * EGA or VGA.
+ */
+ if (!term_console)
+ return FAIL;
+ gettextinfo(&textinfo);
+ Columns = textinfo.screenwidth;
+ Rows = textinfo.screenheight;
+#ifndef DJGPP
+ if (textinfo.currmode > 10)
+ Rows = *(char far *)MK_FP(0x40, 0x84) + 1;
+#endif
+
+ if (Columns < MIN_COLUMNS || Rows < MIN_LINES)
+ {
+ /* these values are overwritten by termcap size or default */
+ Columns = 80;
+ Rows = 25;
+ return FAIL;
+ }
+#ifdef DJGPP
+ mytextinit(&textinfo); /* Added by JML, 1/15/98 */
+#endif
+
+ return OK;
+}
+
+/*
+ * Set the active window for delline/insline.
+ */
+ static void
+set_window(void)
+{
+ if (term_console)
+ {
+#ifndef DJGPP
+ _video.screenheight = Rows;
+#endif
+ mywindow(1, 1, Columns, Rows);
+ }
+ screen_start();
+}
+
+ void
+mch_set_shellsize(void)
+{
+ /* Should try to set the window size to Rows and Columns.
+ * May involve switching display mode....
+ * We assume the user knows the size and just use it. */
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize()
+{
+#ifdef FEAT_MOUSE
+ /* best guess for mouse coordinate computations */
+ if (Columns <= 40)
+ mouse_x_div = 16;
+ if (Rows == 30)
+ mouse_y_div = 16;
+#endif
+ set_window();
+#ifdef FEAT_MOUSE
+ mouse_area(); /* set area where mouse can go */
+#endif
+}
+
+#if defined(DJGPP) || defined(PROTO)
+/*
+ * Check the number of Columns with a BIOS call. This avoids a crash of the
+ * DOS console when 'columns' is set to a too large value.
+ */
+ void
+mch_check_columns()
+{
+ static union REGS regs;
+
+ regs.h.ah = 0x0f;
+ (void)int86(0x10, &regs, &regs);
+ if ((unsigned)Columns > (unsigned)regs.h.ah)
+ Columns = (unsigned)regs.h.ah;
+}
+#endif
+
+/*
+ * call shell, return FAIL for failure, OK otherwise
+ * options: SHELL_*, see vim.h.
+ */
+ int
+mch_call_shell(
+ char_u *cmd,
+ int options)
+{
+ int x;
+ int tmode = cur_tmode;
+#ifndef DJGPP
+ char_u *newcmd;
+#endif
+
+ out_flush();
+#ifdef DJGPP
+ set_sys_cursor();
+#endif
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+ set_interrupts(FALSE); /* restore interrupts */
+
+#ifdef DJGPP
+ /* ignore signals while external command is running */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
+ signal(SIGQUIT, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+#endif
+ if (cmd == NULL)
+ x = system((char *)p_sh);
+ else
+ {
+#ifdef DJGPP
+ /*
+ * Use 'shell' for system().
+ */
+ setenv("SHELL", (char *)p_sh, 1);
+ x = system(cmd);
+#else
+ /* we use "command" to start the shell, slow but easy */
+ newcmd = alloc(STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 3);
+ if (newcmd == NULL)
+ x = -1;
+ else
+ {
+ sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd);
+ x = system((char *)newcmd);
+ vim_free(newcmd);
+ }
+#endif
+ }
+#ifdef DJGPP
+ signal(SIGINT, SIG_DFL);
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGQUIT, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
+#endif
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+ set_interrupts(TRUE); /* catch interrupts */
+
+ if (x && !(options & SHELL_SILENT) && !emsg_silent)
+ {
+ MSG_PUTS("\nshell returned ");
+ msg_outnum((long)x);
+ msg_putchar('\n');
+ }
+
+ return x;
+}
+
+/*
+ * check for an "interrupt signal": CTRL-break or CTRL-C
+ */
+ void
+mch_breakcheck(void)
+{
+ if (ctrlc_pressed)
+ {
+ ctrlc_pressed = FALSE;
+ got_int = TRUE;
+ }
+}
+
+/*
+ * Return TRUE if "p" contain a wildcard that can be expanded by
+ * dos_expandpath().
+ */
+ int
+mch_has_exp_wildcard(char_u *p)
+{
+ for ( ; *p; ++p)
+ {
+ if (vim_strchr((char_u *)"?*[", *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * Return TRUE if "p" contain a wildcard or a "~1" kind of thing (could be a
+ * shortened file name).
+ */
+ int
+mch_has_wildcard(char_u *p)
+{
+ for ( ; *p; ++p)
+ {
+ if (vim_strchr((char_u *)
+# ifdef VIM_BACKTICK
+ "?*$[`"
+# else
+ "?*$["
+# endif
+ , *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * Change directory to "path".
+ * The normal chdir() does not change the default drive. This one does.
+ * Return 0 for success, -1 for failure.
+ */
+ int
+mch_chdir(char *path)
+{
+ if (path[0] == NUL) /* just checking... */
+ return 0;
+ if (path[1] == ':') /* has a drive name */
+ {
+ if (change_drive(TOLOWER_ASC(path[0]) - 'a' + 1))
+ return -1; /* invalid drive name */
+ path += 2;
+ }
+ if (*path == NUL) /* drive name only */
+ return 0;
+ return chdir(path); /* let the normal chdir() do the rest */
+}
+
+#ifdef DJGPP
+/*
+ * mch_rename() works around a bug in rename (aka MoveFile) in
+ * Windows 95: rename("foo.bar", "foo.bar~") will generate a
+ * file whose short file name is "FOO.BAR" (its long file name will
+ * be correct: "foo.bar~"). Because a file can be accessed by
+ * either its SFN or its LFN, "foo.bar" has effectively been
+ * renamed to "foo.bar", which is not at all what was wanted. This
+ * seems to happen only when renaming files with three-character
+ * extensions by appending a suffix that does not include ".".
+ * Windows NT gets it right, however, with an SFN of "FOO~1.BAR".
+ * This works like mch_rename in os_win32.c, but is a bit simpler.
+ *
+ * Like rename(), returns 0 upon success, non-zero upon failure.
+ * Should probably set errno appropriately when errors occur.
+ */
+
+ int
+mch_rename(const char *OldFile, const char *NewFile)
+{
+ char_u *TempFile;
+ int retval;
+ int fd;
+
+ /* rename() works correctly without long file names, so use that */
+ if (!_USE_LFN)
+ return rename(OldFile, NewFile);
+
+ if ((TempFile = alloc((unsigned)(STRLEN(OldFile) + 13))) == NULL)
+ return -1;
+
+ STRCPY(TempFile, OldFile);
+ STRCPY(gettail(TempFile), "axlqwqhy.ba~");
+ if (rename(OldFile, TempFile))
+ retval = -1;
+ else
+ {
+ /* now create an empty file called OldFile; this prevents
+ * the operating system using OldFile as an alias (SFN)
+ * if we're renaming within the same directory. For example,
+ * we're editing a file called filename.asc.txt by its SFN,
+ * filena~1.txt. If we rename filena~1.txt to filena~1.txt~
+ * (i.e., we're making a backup while writing it), the SFN
+ * for filena~1.txt~ will be filena~1.txt, by default, which
+ * will cause all sorts of problems later in buf_write. So, we
+ * create an empty file called filena~1.txt and the system will have
+ * to find some other SFN for filena~1.txt~, such as filena~2.txt
+ */
+ if ((fd = open(OldFile, O_RDWR|O_CREAT|O_EXCL, 0444)) < 0)
+ return -1;
+ retval = rename(TempFile, NewFile);
+ close(fd);
+ mch_remove((char_u *)OldFile);
+
+ /* If renaming to NewFile failed, rename TempFile back to OldFile, so
+ * that it looks like nothing happened. */
+ if (retval)
+ rename(TempFile, OldFile);
+ }
+ vim_free(TempFile);
+
+ return retval; /* success */
+}
+#endif
+
+#if defined(DJGPP) || defined(PROTO)
+/*
+ * setlocale() for DJGPP with MS-DOS codepage support
+ * Author: Cyril Slobin <slobin@fe.msk.ru>
+ *
+ * Scaled down a lot for use by Vim: Only support setlocale(LC_ALL, "").
+ */
+
+#undef setlocale
+
+#include <go32.h>
+#include <inlines/ctype.ha>
+#include <locale.h>
+
+#define UPCASE (__dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISUPPER)
+#define LOCASE (__dj_ISALNUM | __dj_ISALPHA | __dj_ISGRAPH | __dj_ISPRINT | __dj_ISLOWER)
+
+ char *
+djgpp_setlocale(void)
+{
+ __dpmi_regs regs;
+ struct { char id; unsigned short off, seg; } __attribute__ ((packed)) info;
+ unsigned char buffer[0x82], lower, upper;
+ int i;
+
+ regs.x.ax = 0x6502;
+ regs.x.bx = 0xffff;
+ regs.x.dx = 0xffff;
+ regs.x.cx = 5;
+ regs.x.es = __tb >> 4;
+ regs.x.di = __tb & 0xf;
+
+ __dpmi_int(0x21, &regs);
+
+ if (regs.x.flags & 1)
+ return NULL;
+
+ dosmemget(__tb, 5, &info);
+ dosmemget((info.seg << 4) + info.off, 0x82, buffer);
+
+ if (*(short *)buffer != 0x80)
+ return NULL;
+
+ /* Fix problem of underscores being replaced with y-umlaut. (Levin) */
+ if (buffer[26] == 0x5f)
+ buffer[26] = 0x98;
+
+ for (i = 0; i < 0x80; i++)
+ {
+ lower = i + 0x80;
+ upper = (buffer+2)[i];
+ if (lower != upper)
+ {
+ __dj_ctype_flags[lower+1] = LOCASE;
+ __dj_ctype_toupper[lower+1] = upper;
+ if (__dj_ctype_flags[upper+1] == 0)
+ __dj_ctype_flags[upper+1] = UPCASE;
+ if (__dj_ctype_tolower[upper+1] == upper)
+ __dj_ctype_tolower[upper+1] = lower;
+ }
+ }
+
+ return "C";
+}
+
+#if defined(FEAT_CLIPBOARD) || defined(PROTO)
+
+/*
+ * Clipboard stuff, for cutting and pasting text to other windows.
+ *
+ * Implementation of DOS/Windows clipboard data transfer
+ * by David Kotchan (dkotchan@sympatico.ca)
+ */
+
+#define CF_TEXT 0x01 /* Windows clipboard format: Windows (ANSI) text */
+#define CF_OEMTEXT 0x07 /* Windows clipboard format: OEM (DOS) text */
+#define CF_VIMCLIP 0x04 /* trick: SYLK clipboard format for VimClipboard */
+
+static int Win16OpenClipboard(void);
+static int Win16CloseClipboard(void);
+static int Win16EmptyClipboard(void);
+static char_u *Win16GetClipboardData(int clip_data_format);
+static int Win16SetClipboardData(int clip_data_format, char_u *clip_data, int clip_data_size, int clip_data_type);
+
+/*
+ * Make vim the owner of the current selection. Return OK upon success.
+ */
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ /*
+ * Never actually own the clipboard. If another application sets the
+ * clipboard, we don't want to think that we still own it.
+ */
+ return FAIL;
+}
+
+/*
+ * Make vim NOT the owner of the current selection.
+ */
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+ /* Nothing needs to be done here */
+}
+
+/*
+ * Read the Windows clipboard text and put it in Vim's clipboard register.
+ */
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ int type = MCHAR;
+ char_u *pAllocated = NULL;
+ char_u *pClipText = NULL;
+ int clip_data_format = 0;
+
+ if (Win16OpenClipboard())
+ {
+ /* Check for Vim's own clipboard format first. The CF_VIMCLIP format
+ * is just ordinary text (like CF_TEXT) except prepended by the
+ * selection type (as a single character). Note that under DOS we
+ * actually cannot define a custom CF_VIMCLIP clipboard format; we
+ * use instead one of the existing Windows-defined formats, usually
+ * "DIF" or "SYLK". See Win16GetClipboardData() for details.
+ *
+ * Note that Win16GetClipboardData() returns the address of the memory
+ * block it allocated. This is not necessary the start of the
+ * clipboard text data: there may be other bytes ahead of the
+ * text (particularly for CF_VIMCLIP) which are used for data
+ * management. So pClipText is not necessarily == pAllocated.
+ */
+
+ if ((pAllocated = Win16GetClipboardData(CF_VIMCLIP)) != NULL)
+ {
+ clip_data_format = CF_VIMCLIP;
+ pClipText = pAllocated;
+
+ switch (*pClipText++) /* after ++, pClipText points to text */
+ {
+ default:
+ case 'L': type = MLINE; break;
+ case 'C': type = MCHAR; break;
+#ifdef FEAT_VISUAL
+ case 'B': type = MBLOCK; break;
+#endif
+ }
+ }
+
+ /* Otherwise, check for the normal Windows text formats. There are
+ * two of these: CF_TEXT (common) and CF_OEMTEXT (used for DOS
+ * compatibility). Experiments show that, under the DOS/Windows
+ * clipboard interface, writing CF_TEXT data to the clipboard
+ * automatically creates a CF_OEMTEXT format as well.
+ */
+
+ else if ((pAllocated = Win16GetClipboardData(CF_TEXT)) != NULL)
+ {
+ clip_data_format = CF_TEXT;
+ pClipText = pAllocated;
+ type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
+ }
+
+ else if ((pAllocated = Win16GetClipboardData(CF_OEMTEXT)) != NULL)
+ {
+ clip_data_format = CF_OEMTEXT;
+ pClipText = pAllocated;
+ type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
+ }
+
+ /* Did we get anything? */
+
+ if (pClipText != NULL)
+ {
+ char_u *pDest;
+ char_u *pStart;
+ char_u *pEnd;
+
+ long_u clip_data_size = 0;
+
+ /* The Windows clipboard normally stores its text lines terminated
+ * by <CR><NL>. But Vim uses only <NL>, so translate the <CR><NL>
+ * into <NL>. Also, watch for possible null bytes at the end of
+ * pClipText. These are padding added by "get_clipboard_data"
+ * (int 0x2f, AX= 0x1705) in order to round the data size up to the
+ * next multiple of 32 bytes. See Win16GetClipboardData() for
+ * details.
+ */
+
+ pDest = strstr( pClipText, "\r\n" ); /* find first <CR><NL> */
+
+ if (pDest != NULL) /* found one? */
+ {
+ pStart = pDest + 1; /* points to <NL> after <CR> */
+ pEnd = strstr( pStart, "\r\n" );/* find next <CR><NL> */
+
+ while (pEnd != NULL) /* found one? */
+ {
+ memmove(pDest, pStart, (long)(pEnd - pStart));
+ /* exclude <CR> */
+ pDest += (long)(pEnd - pStart); /* new destination */
+ pStart = pEnd + 1; /* new starting point */
+ pEnd = strstr(pStart, "\r\n"); /* find next <CR><NL> */
+ }
+
+ /* Fell out of while() loop: no more <CR><NL> pairs. Just copy
+ * the rest of the data, up to the first null byte. */
+ pEnd = strchr(pStart, '\0'); /* find first null */
+
+ memmove(pDest, pStart, (long)(pEnd - pStart)); /* exclude nul */
+ pDest += (long)(pEnd - pStart);
+ *pDest = '\0'; /* terminate */
+
+ /* Now that all <CR><NL> pairs have been "compressed" into just
+ * <NL>'s, determine the true text length. */
+ clip_data_size = (long_u)(pDest - pClipText);
+ }
+ else
+ {
+ /* no <CR><NL> pairs at all */
+ /* Since the data may have been padded with trailing nulls,
+ * determine the true string length. */
+ clip_data_size = STRLEN(pClipText); /* true data length */
+ }
+
+ /* Copy the cleaned-up data over to Vim's clipboard "*" register. */
+ clip_yank_selection(type, pClipText, clip_data_size, cbd);
+
+ /* Free the memory that Win16GetClipboardData() allocated. */
+ vim_free(pAllocated);
+ }
+
+ Win16CloseClipboard();
+
+ } // end if (Win16OpenClipboard())
+}
+
+/*
+ * Send the currently selected Vim text to the Windows clipboard.
+ */
+ void
+clip_mch_set_selection( VimClipboard *cbd )
+{
+ char_u *pClipData = NULL;
+ long_u clip_data_size;
+ int clip_data_type;
+
+ /* If the '*' register isn't already filled in, fill it in now. */
+ cbd->owned = TRUE;
+ clip_get_selection(cbd);
+ cbd->owned = FALSE;
+
+ /*
+ * clip_convert_selection() returns a pointer to a buffer containing
+ * the text to send to the Windows clipboard, together with a count
+ * of the number of characters (bytes) in the buffer. The function's
+ * return value is the 'type' of selection: MLINE, MCHAR, or MBLOCK;
+ * or -1 for failure.
+ */
+ clip_data_type = clip_convert_selection(&pClipData, &clip_data_size, cbd);
+
+ if (clip_data_type < 0) /* could not convert? */
+ return; /* early exit */
+
+ if (Win16OpenClipboard())
+ {
+ if (Win16EmptyClipboard())
+ {
+ int sentOK;
+
+ sentOK = Win16SetClipboardData(CF_TEXT, pClipData,
+ clip_data_size, clip_data_type);
+ sentOK = Win16SetClipboardData(CF_VIMCLIP,
+ pClipData, clip_data_size, clip_data_type) && sentOK;
+
+ if (!sentOK)
+ {
+ /* one or both of Win16SetClipboardData() failed. */
+ /* Technically we don't know why Win16SetClipboardData()
+ * failed, but almost always it will be because there wasn't
+ * enough DOS memory to bufer the data, so report that as the
+ * problem.
+ *
+ * We report the error here (instead of in
+ * Win16SetClipboardData()) because we don't want the error
+ * reported twice.
+ */
+ EMSG("E450: Selection too large, cannot allocate DOS buffer");
+ }
+ }
+
+ Win16CloseClipboard();
+ }
+
+ /* release memory allocated by clip_convert_selection() */
+ vim_free(pClipData);
+
+ return;
+}
+
+/*
+ * Win16OpenClipboard: open the Windows clipboard. The clipboard must be open
+ * before it can be communicated with at all. Return TRUE on success,
+ * FALSE on failure.
+ */
+ static int
+Win16OpenClipboard(void)
+{
+ __dpmi_regs dpmi_regs;
+
+ long start_time;
+ int tick_count;
+
+ /* int 02xf, AX = 0x1701 attempts to open the Windows clipboard. Upon
+ * return from the interrupt, if AX is non-zero, the clipboard was
+ * successfully opened. If AX is zero, the clipboard could not be opened
+ * because it is currently in use by another process.
+ *
+ * Remark: other DOS programs I (dk) have written that use the Windows
+ * clipboard sometimes encounter the problem that the clipboard cannot
+ * be opened even though it is demonstrably not in use by any other
+ * process. In all cases, repeated attempts to open the clipboard
+ * eventually succeed, but the initial attempt occasionally fails.
+ *
+ * The problem is intermittent and appears to be related to DOS being
+ * "busy" at certain unpredictable times. DOS maintains two internal
+ * flags that indicate whether it's busy: InDOS and CritErr. The
+ * location of InDOS can be found by calling int 0x21, AH = 0x34. The
+ * location of CritErr can be found by calling int 0x21, AX = 0x5d06.
+ * If either of these flags is set, DOS is "busy" and cannot be
+ * interrupted. See "Undocumented DOS" by Schulman et al for details.
+ *
+ * However here I take the easier approach that if the first call to open
+ * the clipboard does not succeed, just try again. In fact, try once per
+ * biostime() clock tick, up to 18 times (about one second).
+ */
+
+ tick_count = 0;
+
+ dpmi_regs.x.ax = 0x1701; /* open Windows clipboard */
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ return FALSE; /* FALSE --> clipboard not open */
+ }
+
+ /* wait up to one second */
+ while (dpmi_regs.x.ax == 0 && tick_count++ < 18)
+ {
+ /* Wait one clock tick (18.2 ticks/sec = 55 msec per tick).
+ *
+ * We busy-wait here. Unfortunately, delay() and usleep() have been
+ * reported to give problems with the original Windows 95. This is
+ * fixed in service pack 1, but not everybody installed that.
+ */
+ start_time = biostime(0, 0L);
+ while (biostime(0, 0L) == start_time)
+ ;
+
+ dpmi_regs.x.ax = 0x1701; /* open Windows clipboard */
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ return FALSE; /* FALSE --> clipboard not open */
+ }
+ }
+
+ /* Couldn't open the clipboard, even after 18 attempts? */
+
+ if (tick_count >= 18 && dpmi_regs.x.ax == 0)
+ return FALSE; /* FALSE --> clipboard not open */
+
+ return TRUE; /* TRUE --> clipboard opened successfully, OK */
+}
+
+/*
+ * Win16CloseClipboard: close the Windows clipboard. Return TRUE on
+ * success, FALSE on failure. This function can always be called,
+ * whether the clipboard is open or not.
+ */
+ static int
+Win16CloseClipboard(void)
+{
+ __dpmi_regs dpmi_regs;
+
+ /* Close the clipboard. This interrupt can always be called, even
+ * if the clipboard is already closed.
+ */
+
+ dpmi_regs.x.ax = 0x1708; /* close the clipboard */
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ return FALSE; /* FALSE --> clipboard could not be closed */
+ }
+
+ return TRUE; /* TRUE --> clipboard closed successfully, OK */
+}
+
+/*
+ * Win16EmptyClipboard: empty the (previously opened) Windows clipboard.
+ * Return TRUE on success, FALSE on failure.
+ */
+ static int
+Win16EmptyClipboard(void)
+{
+ __dpmi_regs dpmi_regs;
+
+ /* int 02xf, AX = 0x1702 attempts to empty the Windows clipboard. Upon
+ * return from the interrupt, if AX == 0, the clipboard could not be
+ * emptied (for some reason).
+ */
+ dpmi_regs.x.ax = 0x1702; /* empty the Windows clipboard */
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ return FALSE; /* FALSE --> clipboard could not be emptied */
+ }
+
+ /* Did we succeed in clearing the clipboard? */
+ if (dpmi_regs.x.ax == 0)
+ return FALSE; /* FALSE --> clipboard could not be emptied */
+
+ return TRUE; /* TRUE --> clipboard was emptied, OK */
+}
+
+/*
+ * FreeDOSMemory: a helper function to free memory previously
+ * allocated by a call to __dpmi_allocate_dos_memory().
+ */
+ static void
+FreeDOSMemory(int protected_mode_selector)
+{
+ /* Free the DOS buffer and release the DPMI prot-mode selector.
+ *
+ * It's important that DOS memory be properly released because
+ * there's only a limited amount of it. Therefore, if the call
+ * to __dpmi_free_dos_memory() fails, emit an error message
+ * unconditionally.
+ */
+ if (__dpmi_free_dos_memory(protected_mode_selector) == -1)
+ EMSG("E451: could not free DOS memory buffer (DJGPP)");
+}
+
+/*
+ * Win16GetClipboardData: query the Windows clipboard as to whether data
+ * is available in a particular clipboard format. If data is
+ * available, allocate a buffer for it and read the data from the
+ * clipboard into the buffer. Return a pointer to the buffer. If
+ * no data is available in the requested format, return NULL.
+ *
+ * This routine allocates memory to hold the retrieved clipboard
+ * data. It's the caller's responsibility to free this memory
+ * once it's finished using it. The memory should be freed by
+ * calling vim_free().
+ */
+ static char_u *
+Win16GetClipboardData(int clip_data_format)
+{
+ __dpmi_regs dpmi_regs;
+
+ int real_mode_segment_address;
+ int protected_mode_selector;
+
+ char_u *clip_data_buffer;
+ long_u clip_data_size;
+
+ /* We only handle clipboard formats we recognize, others are ignored.
+ *
+ * It's not possible to create a custom clipboard format for VimClipboard
+ * data under DOS, so one of the predefined Windows formats had to be
+ * used for CF_VIMCLIP. Two obscure formats, popular when Windows 3.0
+ * came out but no longer in much use today, are the DIF and SYLK formats.
+ * DIF is the Data Interchange Format, SYLK is the Symbolic Link format.
+ * They are both text formats and either one can be hijacked for use as
+ * "the VimClipboard format". Of course, this conflicts with anyone who
+ * still *is* using DIF or SYLK data formats, but that will be very few
+ * people.
+ *
+ * I (dk) chose SYLK as the more obscure format because it was used
+ * mostly for Microsoft Multiplan (the pre-cursor to Excel) and it's not
+ * likely Multiplan is used anywhere much anymore. Mind you, Excel can
+ * still export to both DIF and SYLK formats.
+ */
+
+ switch (clip_data_format)
+ {
+ case CF_VIMCLIP: /* Vim's own special clipboard format */
+ case CF_TEXT: /* Windows text */
+ case CF_OEMTEXT: /* DOS (OEM) text */
+
+ /* int 02xf, AX = 0x1704 returns the number of bytes of data currently
+ * on the Windows clipboard, for the specified format. Upon return
+ * from the interrupt, DX:AX = the number of bytes, rounded up to the
+ * nearest multiple of 32.
+ */
+
+ dpmi_regs.x.ax = 0x1704; /* get size of clipbd data */
+ dpmi_regs.x.dx = clip_data_format;
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ return NULL; /* early exit */
+ }
+
+ /* Did we get anything? If not, this is not an error. */
+ if (dpmi_regs.x.dx == 0 && dpmi_regs.x.ax == 0)
+ {
+ /* no CF_VIMCLIP data? */
+ return NULL; /* early exit */
+ }
+
+ /* There is data available in the requested clipboard format.
+ *
+ * Calculate data size. Remember this is rounded up to the nearest
+ * multiple of 32, so clip_data_size is actually an upper limit.
+ * The extra bytes, if any, are set to null (0x00) when the data is
+ * read from the clipboard. (Later:) actually I'm no longer sure
+ * this is strictly true: the end-of-data is marked by a null, but
+ * the extra bytes appear to sometimes be null, sometimes not.
+ * They may just be garbage.
+ */
+ clip_data_size = dpmi_regs.x.ax + (dpmi_regs.x.dx << 16);
+
+ /* Allocate memory to retrieve the data. The buffer has to lie in the
+ * DOS memory region (in the first 1 MByte of address space) because
+ * the Windows clipboard interface expects a 16-bit segment:offset
+ * pointer to a buffer address within the DOS region. Must therefore
+ * use __dpmi_allocate_dos_memory() instead of lalloc() or alloc().
+ */
+ real_mode_segment_address = __dpmi_allocate_dos_memory(
+ (clip_data_size + 15) >> 4, /* buffer size, in 16-byte paragraphs */
+ &protected_mode_selector); /* prot-mode selector for the address */
+
+ if (real_mode_segment_address == -1)
+ {
+ /* memory allocation failed. */
+
+ /* Technically we don't know why the allocation failed, but
+ * almost always it will be because there wasn't enough DOS
+ * memory to satisfy the request, so report that as the problem.
+ * On my system, DJGPP is able to satisfy a DOS allocation request
+ * up to about 600K in size. This depends on your HIMEM.SYS and
+ * EMM386.EXE settings however.
+ */
+ EMSG("E452: Clipboard data too large, cannot allocate DOS buffer");
+ return NULL; /* early exit */
+ }
+
+ /* Copy data from the clipboard into the buffer. Experiments show that
+ * the Windows clipboard is smart enough to handle data transfers
+ * larger than 64K properly, even though the buffer address is a 16-bit
+ * segment:offset (which would normally limit the block size to 64K
+ * unless ES gets incremented).
+ */
+ dpmi_regs.x.ax = 0x1705; /* get clipboard data */
+ dpmi_regs.x.dx = clip_data_format; /* CF_VIMCLIP */
+ dpmi_regs.x.es = real_mode_segment_address; /* buffer ad: segment */
+ dpmi_regs.x.bx = 0; /* buffer ad: offset */
+ if (__dpmi_int( 0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed? */
+ EMSG("E453: could not copy clipboard data to DOS buffer");
+ FreeDOSMemory(protected_mode_selector); /* clean up DOS mem */
+ return NULL; /* early exit */
+ }
+
+ /* Clipboard data is now in DOS memory in the buffer pointed to by
+ * ES:BX. Copy this into ordinary memory that Vim can access (ie.
+ * prot-mode memory). Allocate one extra byte to ensure the text
+ * is terminated properly (in case it was somehow corrupted).
+ */
+ clip_data_buffer = (char_u *)lalloc(clip_data_size + 1, TRUE);
+
+ if (clip_data_buffer == NULL)
+ {
+ /* allocation failed? */
+ EMSG("E454: could not allocate clipboard memory buffer");
+ FreeDOSMemory(protected_mode_selector); /* clean up DOS mem */
+ return NULL; /* early exit */
+ }
+
+ *(clip_data_buffer + clip_data_size) = '\0'; /* ensure terminated */
+
+ /* Copy the data from DOS memory to Vim-accessible memory. */
+ movedata( /* DJGPP version of memcpy() */
+ protected_mode_selector, 0, /* source: DOS ad (via selector) */
+ _my_ds(), (unsigned)clip_data_buffer,
+ /* target: normal mem address */
+ clip_data_size); /* how many bytes */
+
+ /* Free the DOS buffer and release the DPMI prot-mode selector. */
+ FreeDOSMemory(protected_mode_selector); /* clean up DOS memory */
+
+ return clip_data_buffer; /* return pointer to allocated buffer */
+
+ default: /* unknown clipboard format */
+ return NULL;
+ }
+}
+
+/*
+ * Win16SetClipboardData: send 'clip_data_size' bytes of data from the buffer
+ * pointed to by 'clip_data', to the Windows clipboard. The data is
+ * registered with the clipboard as being in the 'clip_data_format'
+ * format.
+ */
+ static int
+Win16SetClipboardData(
+ int clip_data_format,
+ char_u *clip_data,
+ int clip_data_size,
+ int clip_data_type)
+{
+ __dpmi_regs dpmi_regs;
+
+ int real_mode_segment_address;
+ int protected_mode_selector;
+ long_u protected_mode_offset = 0L;
+ int total_size = clip_data_size;
+
+ char_u *clip_sel_type;
+
+ /* If we're using the CF_VIMCLIP custom format, allocate an extra
+ * byte for clip_sel_type, which is a character indicating the type
+ * of text selection: MLINE, MCHAR, or MBLOCK.
+ */
+ if (clip_data_format == CF_VIMCLIP)
+ total_size++; /* extra byte for marker */
+
+ /* Data cannot be sent directly from a Vim string (pClipData) to
+ * the Windows clipboard, because the Windows clipboard interface
+ * expects a 16-bit (DOS) segment:offset address for the source
+ * buffer. Therefore we must create a "transfer buffer" in the DOS
+ * memory region (in the first 1 MByte of address space) and copy
+ * the Vim string into that. From there, the data can then be sent
+ * to the Windows clipboard.
+ *
+ * To allocate DOS memory, we must use __dpmi_allocate_dos_memory()
+ * instead of lalloc() or alloc(). If the allocation fails, it will
+ * almost invariably be because there is not enough DOS memory
+ * available to accommodate the size of clip_data. There is nothing
+ * we can do about this, we simply have to fail.
+ */
+ real_mode_segment_address = __dpmi_allocate_dos_memory(
+ (total_size + 15) >> 4, /* buffer size, in 16-byte paragraphs */
+ &protected_mode_selector); /* prot-mode selector for the address */
+
+ if (real_mode_segment_address == -1)
+ {
+ /* memory allocation failed. */
+ /* Technically we don't know why the allocation failed, but
+ * almost always it will be because there wasn't enough DOS
+ * memory to satisfy the request. On my system, DJGPP is able
+ * to satisfy a DOS allocation request up to about 600K in size.
+ * This depends however on HIMEM.SYS and EMM386.EXE settings.
+ */
+ return FALSE; /* early exit */
+ }
+
+ /* Copy data from Vim's buffer (clip_data) into the DOS transfer buffer.
+ * This can be larger than 64K; movedata() takes care of crossing any
+ * 16-bit segment boundaries.
+ *
+ * If we're using Vim's custom clipboard format, we must copy one extra
+ * byte to indicate the type of selection: line, character, or block.
+ */
+ if (clip_data_format == CF_VIMCLIP)
+ {
+ switch (clip_data_type)
+ {
+ default:
+ case MLINE: clip_sel_type = "L"; break;
+ case MCHAR: clip_sel_type = "C"; break;
+#ifdef FEAT_VISUAL
+ case MBLOCK: clip_sel_type = "B"; break;
+#endif
+ }
+
+ movedata(
+ _my_ds(), (unsigned)clip_sel_type,
+ /* source: normal memory address */
+ protected_mode_selector, 0, /* target: DOS ad (via selector) */
+ 1); /* how many bytes to copy */
+
+ protected_mode_offset += STRLEN(clip_sel_type); /* allow for marker */
+ }
+
+ movedata(
+ _my_ds(), (unsigned)clip_data, /* source: normal memory address */
+ protected_mode_selector, /* target: DOS address (via selector) */
+ protected_mode_offset, /* non-zero, if using clip_sel_type */
+ clip_data_size); /* how many bytes to copy */
+
+ /* Send data from the DOS transfer buffer to the Windows clipboard.
+ * int 02xf, AX = 0x1703 sends SI:CX bytes of data from the buffer
+ * at ES:BX, to the clipboard.
+ */
+ dpmi_regs.x.ax = 0x1703; /* send clipboard data */
+ dpmi_regs.x.dx = clip_data_format; /* flag: format of the data */
+ dpmi_regs.x.si = ((total_size >> 16)
+ & 0x0000ffffL); /* hi word of data size */
+ dpmi_regs.x.cx = (total_size & 0x0000ffffL);
+ /* lo word of data size */
+ dpmi_regs.x.es = real_mode_segment_address; /* buffer address: segment */
+ dpmi_regs.x.bx = 0; /* buffer address: offset */
+ if (__dpmi_int(0x2f, &dpmi_regs) == -1)
+ {
+ /* real-mode interrupt failed. */
+ FreeDOSMemory(protected_mode_selector); /* clean up DOS memory */
+ return FALSE; /* early exit */
+ }
+
+ /* Free the DOS buffer and release the DPMI prot-mode selector. */
+ FreeDOSMemory(protected_mode_selector); /* clean up DOS memory */
+
+ return TRUE; /* TRUE --> data successfully sent to clipboard */
+}
+
+#endif /* FEAT_CLIPBOARD */
+#endif /* DJGPP */
+
+/*
+ * End of MS-DOS only code
+ */
+#endif /* WIN16 */
+
+/* common MS-DOS and Win16 code follows */
+
+ static int
+vim_chmod(char_u *name)
+{
+ char_u *p;
+ int f;
+ int c = 0;
+
+ /* chmod() can't handle a file name with a trailing slash, remove it.
+ * But don't remove it for "/" or "c:/". */
+ p = name + STRLEN(name);
+ if (p > name)
+ --p;
+ if (p > name && (*p == '\\' || *p == '/') && p[-1] != ':')
+ {
+ c = *p; /* remove trailing (back)slash */
+ *p = NUL;
+ }
+ else
+ p = NULL;
+#if defined(__BORLANDC__) && (__BORLANDC__ > 0x410)
+ /* this also sets the archive bit, supported by Borland C 4.0 and later,
+ * where __BORLANDC__ is 0x450 (3.1 is 0x410) */
+ f = _rtl_chmod((char *)name, 0, 0);
+#else
+ f = _chmod((char *)name, 0, 0);
+#endif
+ if (p != NULL)
+ *p = c; /* put back (back)slash */
+ return f;
+}
+
+/*
+ * get file permissions for 'name'
+ * Returns -1 for error.
+ * Returns FA_attributes defined in dos.h
+ */
+ long
+mch_getperm(char_u *name)
+{
+ return (long)vim_chmod(name); /* get file mode */
+}
+
+/*
+ * set file permission for 'name' to 'perm'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_setperm(
+ char_u *name,
+ long perm)
+{
+ perm |= FA_ARCH; /* file has changed, set archive bit */
+#if defined(__BORLANDC__) && (__BORLANDC__ > 0x410)
+ return (_rtl_chmod((char *)name, 1, (int)perm) == -1 ? FAIL : OK);
+#else
+ return (_chmod((char *)name, 1, (int)perm) == -1 ? FAIL : OK);
+#endif
+}
+
+/*
+ * Set hidden flag for "name".
+ */
+ void
+mch_hide(char_u *name)
+{
+ /* DOS 6.2 share.exe causes "seek error on file write" errors when making
+ * the swap file hidden. Thus don't do it. */
+}
+
+/*
+ * return TRUE if "name" is a directory
+ * return FALSE if "name" is not a directory
+ * return FALSE for error
+ *
+ * beware of a trailing (back)slash
+ */
+ int
+mch_isdir(char_u *name)
+{
+ int f;
+
+ f = vim_chmod(name);
+ if (f == -1)
+ return FALSE; /* file does not exist at all */
+ if ((f & FA_DIREC) == 0)
+ return FALSE; /* not a directory */
+ return TRUE;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return 1 if "name" can be executed, 0 if not.
+ * Return -1 if unknown.
+ */
+ int
+mch_can_exe(name)
+ char_u *name;
+{
+ return (searchpath(name) != NULL);
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(char_u *name)
+{
+ if (STRICMP(name, "AUX") == 0
+ || STRICMP(name, "CON") == 0
+ || STRICMP(name, "CLOCK$") == 0
+ || STRICMP(name, "NUL") == 0
+ || STRICMP(name, "PRN") == 0
+ || ((STRNICMP(name, "COM", 3) == 0
+ || STRNICMP(name, "LPT", 3) == 0)
+ && VIM_ISDIGIT(name[3])
+ && name[4] == NUL))
+ return NODE_WRITABLE;
+ /* TODO: NODE_OTHER? */
+ return NODE_NORMAL;
+}
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(
+ char_u *buf,
+ int len)
+{
+#ifdef DJGPP
+ if (getcwd((char *)buf, len) == NULL)
+ return FAIL;
+ /* turn the '/'s returned by DJGPP into '\'s */
+ slash_adjust(buf);
+ return OK;
+#else
+ return (getcwd((char *)buf, len) != NULL ? OK : FAIL);
+#endif
+}
+
+/*
+ * this version of remove is not scared by a readonly (backup) file
+ *
+ * returns -1 on error, 0 otherwise (just like remove())
+ */
+ int
+mch_remove(char_u *name)
+{
+ (void)mch_setperm(name, 0); /* default permissions */
+ return unlink((char *)name);
+}
+
+/*
+ * Special version of getenv(): Use uppercase name.
+ */
+ char_u *
+mch_getenv(char_u *name)
+{
+ int i;
+#define MAXENVLEN 50
+ char_u var_copy[MAXENVLEN + 1];
+ char_u *p;
+ char_u *res;
+
+ /*
+ * Take a copy of the argument, and force it to upper case before passing
+ * to getenv(). On DOS systems, getenv() doesn't like lower-case argument
+ * (unlike Win32 et al.) If the name is too long to fit in var_copy[]
+ * allocate memory.
+ */
+ if ((i = STRLEN(name)) > MAXENVLEN)
+ p = alloc(i + 1);
+ else
+ p = var_copy;
+ if (p == NULL)
+ p = name; /* out of memory, fall back to unmodified name */
+ else
+ {
+ for (i = 0; name[i] != NUL; ++i)
+ p[i] = toupper(name[i]);
+ p[i] = NUL;
+ }
+
+ res = (char_u *)getenv((char *)p);
+
+ if (p != var_copy && p != name)
+ vim_free(p);
+
+ return res;
+}
+
+/*
+ * Insert user name in s[len].
+ */
+ int
+mch_get_user_name(
+ char_u *s,
+ int len)
+{
+ *s = NUL;
+ return FAIL;
+}
+
+/*
+ * Insert host name is s[len].
+ */
+ void
+mch_get_host_name(
+ char_u *s,
+ int len)
+{
+#ifdef DJGPP
+ STRNCPY(s, "PC (32 bits Vim)", len);
+#else
+ STRNCPY(s, "PC (16 bits Vim)", len);
+#endif
+ s[len - 1] = NUL; /* make sure it's terminated */
+}
diff --git a/src/os_msdos.h b/src/os_msdos.h
new file mode 100644
index 000000000..576b2383c
--- /dev/null
+++ b/src/os_msdos.h
@@ -0,0 +1,106 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * MSDOS Machine-dependent things.
+ */
+
+#include "os_dos.h" /* common MS-DOS and Win32 stuff */
+
+#define BINARY_FILE_IO
+#define USE_EXE_NAME /* use argv[0] for $VIM */
+#define NO_COOKED_INPUT /* mch_inchar() doesn't return whole lines */
+#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
+#define USE_TERM_CONSOLE
+#ifdef DJGPP
+# include <fcntl.h> /* defines _USE_LFN */
+# define USE_LONG_FNAME _USE_LFN /* decide at run time */
+# define USE_FNAME_CASE
+# define HAVE_PUTENV
+#else
+# define SHORT_FNAME /* always 8.3 file name */
+#endif
+#define HAVE_STDLIB_H
+#define HAVE_STRING_H
+#define HAVE_FCNTL_H
+#define HAVE_STRCSPN
+#define HAVE_STRICMP
+#define HAVE_STRFTIME /* guessed */
+#define HAVE_STRNICMP
+#define HAVE_MEMSET
+#define HAVE_QSORT
+#define HAVE_ST_MODE /* have stat.st_mode */
+#if defined(__DATE__) && defined(__TIME__)
+# define HAVE_DATE_TIME
+#endif
+#define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
+#define HAVE_AVAIL_MEM
+
+/*
+ * Borland C++ 3.1 doesn't have _RTLENTRYF
+ */
+#ifdef __BORLANDC__
+# if __BORLANDC__ < 0x450
+# define _RTLENTRYF
+# endif
+#endif
+
+#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
+
+#include <dos.h>
+#include <dir.h>
+#include <time.h>
+
+#ifdef DJGPP
+# include <unistd.h>
+# define HAVE_LOCALE_H
+# define setlocale(c, p) djgpp_setlocale()
+#endif
+
+#ifndef DJGPP
+typedef long off_t;
+#endif
+
+/*
+ * Try several directories to put the temp files.
+ */
+#define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
+#define TEMPNAMELEN 128
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM 256 /* use up to 256Kbyte for buffer */
+#endif
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT 0 /* decide in set_init */
+#endif
+
+#ifdef DJGPP
+# define BASENAMELEN (_USE_LFN?250:8) /* length of base of file name */
+#else
+# define BASENAMELEN 8 /* length of base of file name */
+#endif
+
+/* codes for msdos mouse event */
+#define MSDOS_MOUSE_LEFT 0x01
+#define MSDOS_MOUSE_RIGHT 0x02
+#define MSDOS_MOUSE_MIDDLE 0x04
+
+#ifdef DJGPP
+int mch_rename(const char *OldFile, const char *NewFile);
+#else
+# define mch_rename(src, dst) rename(src, dst)
+#endif
+
+#ifdef DJGPP
+# define vim_mkdir(x, y) mkdir((char *)(x), y)
+#else
+# define vim_mkdir(x, y) mkdir((char *)(x))
+#endif
+#define mch_rmdir(x) rmdir((char *)(x))
+
+#define mch_setenv(name, val, x) setenv(name, val, x)
diff --git a/src/os_mswin.c b/src/os_mswin.c
new file mode 100644
index 000000000..97803a89d
--- /dev/null
+++ b/src/os_mswin.c
@@ -0,0 +1,3245 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_mswin.c
+ *
+ * Routines common to both Win16 and Win32.
+ */
+
+#ifdef WIN16
+# ifdef __BORLANDC__
+# pragma warn -par
+# pragma warn -ucp
+# pragma warn -use
+# pragma warn -aus
+# endif
+#endif
+
+#include <io.h>
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#ifdef WIN16
+# define SHORT_FNAME /* always 8.3 file name */
+# include <dos.h>
+# include <string.h>
+#endif
+#include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
+#include <limits.h>
+#include <process.h>
+
+#undef chdir
+#ifdef __GNUC__
+# ifndef __MINGW32__
+# include <dirent.h>
+# endif
+#else
+# include <direct.h>
+#endif
+
+#if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
+# include <shellapi.h>
+#endif
+
+#if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)
+# include <dlgs.h>
+# ifdef WIN3264
+# include <winspool.h>
+# else
+# include <print.h>
+# endif
+# include <commdlg.h>
+#endif
+
+#ifdef __MINGW32__
+# ifndef FROM_LEFT_1ST_BUTTON_PRESSED
+# define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
+# endif
+# ifndef RIGHTMOST_BUTTON_PRESSED
+# define RIGHTMOST_BUTTON_PRESSED 0x0002
+# endif
+# ifndef FROM_LEFT_2ND_BUTTON_PRESSED
+# define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
+# endif
+# ifndef FROM_LEFT_3RD_BUTTON_PRESSED
+# define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
+# endif
+# ifndef FROM_LEFT_4TH_BUTTON_PRESSED
+# define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
+# endif
+
+/*
+ * EventFlags
+ */
+# ifndef MOUSE_MOVED
+# define MOUSE_MOVED 0x0001
+# endif
+# ifndef DOUBLE_CLICK
+# define DOUBLE_CLICK 0x0002
+# endif
+#endif
+
+/*
+ * When generating prototypes for Win32 on Unix, these lines make the syntax
+ * errors disappear. They do not need to be correct.
+ */
+#ifdef PROTO
+#define WINAPI
+#define WINBASEAPI
+typedef int BOOL;
+typedef int CALLBACK;
+typedef int COLORREF;
+typedef int CONSOLE_CURSOR_INFO;
+typedef int COORD;
+typedef int DWORD;
+typedef int ENUMLOGFONT;
+typedef int HANDLE;
+typedef int HDC;
+typedef int HFONT;
+typedef int HICON;
+typedef int HWND;
+typedef int INPUT_RECORD;
+typedef int KEY_EVENT_RECORD;
+typedef int LOGFONT;
+typedef int LPARAM;
+typedef int LPBOOL;
+typedef int LPCSTR;
+typedef int LPCWSTR;
+typedef int LPSTR;
+typedef int LPTSTR;
+typedef int LPWSTR;
+typedef int LRESULT;
+typedef int MOUSE_EVENT_RECORD;
+typedef int NEWTEXTMETRIC;
+typedef int PACL;
+typedef int PRINTDLG;
+typedef int PSECURITY_DESCRIPTOR;
+typedef int PSID;
+typedef int SECURITY_INFORMATION;
+typedef int SHORT;
+typedef int SMALL_RECT;
+typedef int TEXTMETRIC;
+typedef int UINT;
+typedef int WCHAR;
+typedef int WORD;
+typedef int WPARAM;
+typedef void VOID;
+#endif
+
+/* Record all output and all keyboard & mouse input */
+/* #define MCH_WRITE_DUMP */
+
+#ifdef MCH_WRITE_DUMP
+FILE* fdDump = NULL;
+#endif
+
+#ifdef WIN3264
+extern DWORD g_PlatformId;
+#endif
+
+#ifndef FEAT_GUI_MSWIN
+extern char g_szOrigTitle[];
+#endif
+
+#ifdef FEAT_GUI
+extern HWND s_hwnd;
+#else
+# if (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)) \
+ || defined(FEAT_CLIENTSERVER) \
+ || (defined(FEAT_EVAL) && !defined(FEAT_GUI))
+# define HAVE_GETCONSOLEHWND
+static HWND s_hwnd = 0; /* console window handle, set by GetConsoleHwnd() */
+# endif
+#endif
+
+extern int WSInitialized;
+
+/* Don't generate prototypes here, because some systems do have these
+ * functions. */
+#if defined(__GNUC__) && !defined(PROTO)
+# ifndef __MINGW32__
+int _stricoll(char *a, char *b)
+{
+ // the ANSI-ish correct way is to use strxfrm():
+ char a_buff[512], b_buff[512]; // file names, so this is enough on Win32
+ strxfrm(a_buff, a, 512);
+ strxfrm(b_buff, b, 512);
+ return strcoll(a_buff, b_buff);
+}
+
+char * _fullpath(char *buf, char *fname, int len)
+{
+ LPTSTR toss;
+
+ return (char *)GetFullPathName(fname, len, buf, &toss);
+}
+# endif
+
+int _chdrive(int drive)
+{
+ char temp [3] = "-:";
+ temp[0] = drive + 'A' - 1;
+ return !SetCurrentDirectory(temp);
+}
+#else
+# ifdef __BORLANDC__
+/* being a more ANSI compliant compiler, BorlandC doesn't define _stricoll:
+ * but it does in BC 5.02! */
+# if __BORLANDC__ < 0x502
+int _stricoll(char *a, char *b)
+{
+# if 1
+ // this is fast but not correct:
+ return stricmp(a, b);
+# else
+ // the ANSI-ish correct way is to use strxfrm():
+ char a_buff[512], b_buff[512]; // file names, so this is enough on Win32
+ strxfrm(a_buff, a, 512);
+ strxfrm(b_buff, b, 512);
+ return strcoll(a_buff, b_buff);
+# endif
+}
+# endif
+# endif
+#endif
+
+
+#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
+/*
+ * GUI version of mch_exit().
+ * Shut down and exit with status `r'
+ * Careful: mch_exit() may be called before mch_init()!
+ */
+ void
+mch_exit(int r)
+{
+ display_errors();
+
+ ml_close_all(TRUE); /* remove all memfiles */
+
+# ifdef FEAT_OLE
+ UninitOLE();
+# endif
+# ifdef FEAT_NETBEANS_INTG
+ if (WSInitialized)
+ {
+ WSInitialized = FALSE;
+ WSACleanup();
+ }
+# endif
+#ifdef DYNAMIC_GETTEXT
+ dyn_libintl_end();
+#endif
+
+ if (gui.in_use)
+ gui_exit(r);
+ exit(r);
+}
+
+#endif /* FEAT_GUI_MSWIN */
+
+
+/*
+ * Init the tables for toupper() and tolower().
+ */
+ void
+mch_early_init(void)
+{
+ int i;
+
+#ifdef WIN3264
+ PlatformId();
+#endif
+
+ /* Init the tables for toupper() and tolower() */
+ for (i = 0; i < 256; ++i)
+ toupper_tab[i] = tolower_tab[i] = i;
+#ifdef WIN3264
+ CharUpperBuff(toupper_tab, 256);
+ CharLowerBuff(tolower_tab, 256);
+#else
+ AnsiUpperBuff(toupper_tab, 256);
+ AnsiLowerBuff(tolower_tab, 256);
+#endif
+}
+
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ */
+ int
+mch_input_isatty()
+{
+#ifdef FEAT_GUI_MSWIN
+ return OK; /* GUI always has a tty */
+#else
+ if (isatty(read_cmd_fd))
+ return TRUE;
+ return FALSE;
+#endif
+}
+
+#ifdef FEAT_TITLE
+/*
+ * mch_settitle(): set titlebar of our window
+ */
+ void
+mch_settitle(
+ char_u *title,
+ char_u *icon)
+{
+# ifdef FEAT_GUI_MSWIN
+ gui_mch_settitle(title, icon);
+# else
+ if (title != NULL)
+ SetConsoleTitle(title);
+# endif
+}
+
+
+/*
+ * Restore the window/icon title.
+ * which is one of:
+ * 1: Just restore title
+ * 2: Just restore icon (which we don't have)
+ * 3: Restore title and icon (which we don't have)
+ */
+ void
+mch_restore_title(
+ int which)
+{
+#ifndef FEAT_GUI_MSWIN
+ mch_settitle((which & 1) ? g_szOrigTitle : NULL, NULL);
+#endif
+}
+
+
+/*
+ * Return TRUE if we can restore the title (we can)
+ */
+ int
+mch_can_restore_title()
+{
+ return TRUE;
+}
+
+
+/*
+ * Return TRUE if we can restore the icon title (we can't)
+ */
+ int
+mch_can_restore_icon()
+{
+ return FALSE;
+}
+#endif /* FEAT_TITLE */
+
+
+/*
+ * Get absolute file name into buffer 'buf' of length 'len' bytes,
+ * turning all '/'s into '\\'s and getting the correct case of each
+ * component of the file name. Append a backslash to a directory name.
+ * When 'shellslash' set do it the other way around.
+ * Return OK or FAIL.
+ */
+ int
+mch_FullName(
+ char_u *fname,
+ char_u *buf,
+ int len,
+ int force)
+{
+ int nResult = FAIL;
+
+#ifdef __BORLANDC__
+ if (*fname == NUL) /* Borland behaves badly here - make it consistent */
+ nResult = mch_dirname(buf, len);
+ else
+#endif
+ if (_fullpath(buf, fname, len - 1) == NULL)
+ {
+ STRNCPY(buf, fname, len); /* failed, use the relative path name */
+ buf[len - 1] = NUL;
+#ifndef USE_FNAME_CASE
+ slash_adjust(buf);
+#endif
+ }
+ else
+ nResult = OK;
+
+#ifdef USE_FNAME_CASE
+ fname_case(buf, len);
+#endif
+
+ return nResult;
+}
+
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(char_u *fname)
+{
+ char szName[_MAX_PATH + 1];
+
+ /* A name like "d:/foo" and "//server/share" is absolute */
+ if ((fname[0] && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\'))
+ || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')))
+ return TRUE;
+
+ /* A name that can't be made absolute probably isn't absolute. */
+ if (mch_FullName(fname, szName, _MAX_PATH, FALSE) == FAIL)
+ return FALSE;
+
+ return pathcmp(fname, szName) == 0;
+}
+
+/*
+ * Replace all slashes by backslashes.
+ * This used to be the other way around, but MS-DOS sometimes has problems
+ * with slashes (e.g. in a command name). We can't have mixed slashes and
+ * backslashes, because comparing file names will not work correctly. The
+ * commands that use a file name should try to avoid the need to type a
+ * backslash twice.
+ * When 'shellslash' set do it the other way around.
+ */
+ void
+slash_adjust(p)
+ char_u *p;
+{
+ if (p != NULL)
+ while (*p)
+ {
+ if (*p == psepcN)
+ *p = psepc;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+}
+
+
+/*
+ * stat() can't handle a trailing '/' or '\', remove it first.
+ */
+ int
+vim_stat(const char *name, struct stat *stp)
+{
+ char buf[_MAX_PATH + 1];
+ char *p;
+
+ STRNCPY(buf, name, _MAX_PATH);
+ buf[_MAX_PATH] = NUL;
+ p = buf + strlen(buf);
+ if (p > buf)
+ --p;
+ if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':')
+ *p = NUL;
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
+# ifdef __BORLANDC__
+ /* Wide functions of Borland C 5.5 do not work on Windows 98. */
+ && g_PlatformId == VER_PLATFORM_WIN32_NT
+# endif
+ )
+ {
+ WCHAR *wp = enc_to_ucs2(buf, NULL);
+ int n;
+
+ if (wp != NULL)
+ {
+ n = _wstat(wp, (struct _stat *)stp);
+ vim_free(wp);
+ if (n >= 0)
+ return n;
+ /* Retry with non-wide function (for Windows 98). Can't use
+ * GetLastError() here and it's unclear what errno gets set to if
+ * the _wstat() fails for missing wide functions. */
+ }
+ }
+#endif
+ return stat(buf, stp);
+}
+
+#if defined(FEAT_GUI_MSWIN) || defined(PROTO)
+ void
+mch_settmode(int tmode)
+{
+ /* nothing to do */
+}
+
+ int
+mch_get_shellsize(void)
+{
+ /* never used */
+ return OK;
+}
+
+ void
+mch_set_shellsize(void)
+{
+ /* never used */
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize(void)
+{
+ /* never used */
+}
+
+#endif
+
+/*
+ * We have no job control, so fake it by starting a new shell.
+ */
+ void
+mch_suspend()
+{
+ suspend_shell();
+}
+
+#if defined(USE_MCH_ERRMSG) || defined(PROTO)
+
+#ifdef display_errors
+# undef display_errors
+#endif
+
+/*
+ * Display the saved error message(s).
+ */
+ void
+display_errors()
+{
+ char *p;
+
+ if (error_ga.ga_data != NULL)
+ {
+ /* avoid putting up a message box with blanks only */
+ for (p = (char *)error_ga.ga_data; *p; ++p)
+ if (!isspace(*p))
+ {
+ /* Truncate a very long message, it will go off-screen. */
+ if (STRLEN(p) > 2000)
+ {
+ char_u *s = p + 2000 - 14;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s -= (*mb_head_off)(p, s);
+#endif
+ STRCPY(s, _("...(truncated)"));
+ }
+#ifdef WIN3264
+ MessageBox(NULL, p, "Vim", MB_TASKMODAL|MB_SETFOREGROUND);
+#else
+ MessageBox(NULL, p, "Vim", MB_TASKMODAL);
+#endif
+ break;
+ }
+ ga_clear(&error_ga);
+ }
+}
+#endif
+
+
+/*
+ * Return TRUE if "p" contain a wildcard that can be expanded by
+ * dos_expandpath().
+ */
+ int
+mch_has_exp_wildcard(char_u *p)
+{
+ for ( ; *p; ++p)
+ {
+ if (vim_strchr((char_u *)"?*[", *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * Return TRUE if "p" contain a wildcard or a "~1" kind of thing (could be a
+ * shortened file name).
+ */
+ int
+mch_has_wildcard(char_u *p)
+{
+ for ( ; *p; ++p)
+ {
+ if (vim_strchr((char_u *)
+# ifdef VIM_BACKTICK
+ "?*$[`"
+# else
+ "?*$["
+# endif
+ , *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+
+/*
+ * The normal _chdir() does not change the default drive. This one does.
+ * Returning 0 implies success; -1 implies failure.
+ */
+ int
+mch_chdir(char *path)
+{
+ if (path[0] == NUL) /* just checking... */
+ return -1;
+
+ if (isalpha(path[0]) && path[1] == ':') /* has a drive name */
+ {
+ /* If we can change to the drive, skip that part of the path. If we
+ * can't then the current directory may be invalid, try using chdir()
+ * with the whole path. */
+ if (_chdrive(TOLOWER_ASC(path[0]) - 'a' + 1) == 0)
+ path += 2;
+ }
+
+ if (*path == NUL) /* drive name only */
+ return 0;
+
+ return chdir(path); /* let the normal chdir() do the rest */
+}
+
+
+/*
+ * Switching off termcap mode is only allowed when Columns is 80, otherwise a
+ * crash may result. It's always allowed on NT or when running the GUI.
+ */
+ int
+can_end_termcap_mode(
+ int give_msg)
+{
+#ifdef FEAT_GUI_MSWIN
+ return TRUE; /* GUI starts a new console anyway */
+#else
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT || Columns == 80)
+ return TRUE;
+ if (give_msg)
+ msg(_("'columns' is not 80, cannot execute external commands"));
+ return FALSE;
+#endif
+}
+
+#ifdef FEAT_GUI_MSWIN
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail()
+{
+ /* never used */
+ return TRUE;
+}
+#endif
+
+
+/*
+ * set screen mode, always fails.
+ */
+ int
+mch_screenmode(
+ char_u *arg)
+{
+ EMSG(_(e_screenmode));
+ return FAIL;
+}
+
+
+#if defined(FEAT_LIBCALL) || defined(PROTO)
+/*
+ * Call a DLL routine which takes either a string or int param
+ * and returns an allocated string.
+ * Return OK if it worked, FAIL if not.
+ */
+# ifdef WIN3264
+typedef LPTSTR (*MYSTRPROCSTR)(LPTSTR);
+typedef LPTSTR (*MYINTPROCSTR)(int);
+typedef int (*MYSTRPROCINT)(LPTSTR);
+typedef int (*MYINTPROCINT)(int);
+# else
+typedef LPSTR (*MYSTRPROCSTR)(LPSTR);
+typedef LPSTR (*MYINTPROCSTR)(int);
+typedef int (*MYSTRPROCINT)(LPSTR);
+typedef int (*MYINTPROCINT)(int);
+# endif
+
+# ifndef WIN16
+/*
+ * Check if a pointer points to a valid NUL terminated string.
+ * Return the length of the string, including terminating NUL.
+ * Returns 0 for an invalid pointer, 1 for an empty string.
+ */
+ static size_t
+check_str_len(char_u *str)
+{
+ SYSTEM_INFO si;
+ MEMORY_BASIC_INFORMATION mbi;
+ size_t length = 0;
+ size_t i;
+ const char *p;
+
+ /* get page size */
+ GetSystemInfo(&si);
+
+ /* get memory information */
+ if (VirtualQuery(str, &mbi, sizeof(mbi)))
+ {
+ /* pre cast these (typing savers) */
+ DWORD dwStr = (DWORD)str;
+ DWORD dwBaseAddress = (DWORD)mbi.BaseAddress;
+
+ /* get start address of page that str is on */
+ DWORD strPage = dwStr - (dwStr - dwBaseAddress) % si.dwPageSize;
+
+ /* get length from str to end of page */
+ DWORD pageLength = si.dwPageSize - (dwStr - strPage);
+
+ for (p = str; !IsBadReadPtr(p, pageLength);
+ p += pageLength, pageLength = si.dwPageSize)
+ for (i = 0; i < pageLength; ++i, ++length)
+ if (p[i] == NUL)
+ return length + 1;
+ }
+
+ return 0;
+}
+# endif
+
+ int
+mch_libcall(
+ char_u *libname,
+ char_u *funcname,
+ char_u *argstring, /* NULL when using a argint */
+ int argint,
+ char_u **string_result,/* NULL when using number_result */
+ int *number_result)
+{
+ HINSTANCE hinstLib;
+ MYSTRPROCSTR ProcAdd;
+ MYINTPROCSTR ProcAddI;
+ char_u *retval_str = NULL;
+ int retval_int = 0;
+ size_t len;
+
+ BOOL fRunTimeLinkSuccess = FALSE;
+
+ // Get a handle to the DLL module.
+ hinstLib = LoadLibrary(libname);
+
+ // If the handle is valid, try to get the function address.
+ if (hinstLib != NULL)
+ {
+#ifdef HAVE_TRY_EXCEPT
+ __try
+ {
+#endif
+ if (argstring != NULL)
+ {
+ /* Call with string argument */
+ ProcAdd = (MYSTRPROCSTR) GetProcAddress(hinstLib, funcname);
+ if ((fRunTimeLinkSuccess = (ProcAdd != NULL)) != 0)
+ {
+ if (string_result == NULL)
+ retval_int = ((MYSTRPROCINT)ProcAdd)(argstring);
+ else
+ retval_str = (ProcAdd)(argstring);
+ }
+ }
+ else
+ {
+ /* Call with number argument */
+ ProcAddI = (MYINTPROCSTR) GetProcAddress(hinstLib, funcname);
+ if ((fRunTimeLinkSuccess = (ProcAddI != NULL)) != 0)
+ {
+ if (string_result == NULL)
+ retval_int = ((MYINTPROCINT)ProcAddI)(argint);
+ else
+ retval_str = (ProcAddI)(argint);
+ }
+ }
+
+ // Save the string before we free the library.
+ // Assume that a "1" result is an illegal pointer.
+ if (string_result == NULL)
+ *number_result = retval_int;
+ else if (retval_str != NULL
+# ifdef WIN16
+ && retval_str != (char_u *)1
+ && retval_str != (char_u *)-1
+ && !IsBadStringPtr(retval_str, INT_MAX)
+ && (len = strlen(retval_str) + 1) > 0
+# else
+ && (len = check_str_len(retval_str)) > 0
+# endif
+ )
+ {
+ *string_result = lalloc((long_u)len, TRUE);
+ if (*string_result != NULL)
+ mch_memmove(*string_result, retval_str, len);
+ }
+
+#ifdef HAVE_TRY_EXCEPT
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
+ RESETSTKOFLW();
+ fRunTimeLinkSuccess = 0;
+ }
+#endif
+
+ // Free the DLL module.
+ (void)FreeLibrary(hinstLib);
+ }
+
+ if (!fRunTimeLinkSuccess)
+ {
+ EMSG2(_(e_libcall), funcname);
+ return FAIL;
+ }
+
+ return OK;
+}
+#endif
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Convert an UTF-8 string to UCS-2.
+ * "instr[inlen]" is the input. "inlen" is in bytes.
+ * When "outstr" is NULL only return the number of UCS-2 words produced.
+ * Otherwise "outstr" must be a buffer of sufficient size.
+ * Returns the number of UCS-2 words produced.
+ */
+ int
+utf8_to_ucs2(char_u *instr, int inlen, short_u *outstr, int *unconvlenp)
+{
+ int outlen = 0;
+ char_u *p = instr;
+ int todo = inlen;
+ int l;
+
+ while (todo > 0)
+ {
+ /* Only convert if we have a complete sequence. */
+ l = utf_ptr2len_check_len(p, todo);
+ if (l > todo)
+ {
+ /* Return length of incomplete sequence. */
+ if (unconvlenp != NULL)
+ *unconvlenp = todo;
+ break;
+ }
+
+ if (outstr != NULL)
+ *outstr++ = utf_ptr2char(p);
+ ++outlen;
+ p += l;
+ todo -= l;
+ }
+
+ return outlen;
+}
+
+/*
+ * Convert an UCS-2 string to UTF-8.
+ * The input is "instr[inlen]" with "inlen" in number of ucs-2 words.
+ * When "outstr" is NULL only return the required number of bytes.
+ * Otherwise "outstr" must be a buffer of sufficient size.
+ * Return the number of bytes produced.
+ */
+ int
+ucs2_to_utf8(short_u *instr, int inlen, char_u *outstr)
+{
+ int outlen = 0;
+ int todo = inlen;
+ short_u *p = instr;
+ int l;
+
+ while (todo > 0)
+ {
+ if (outstr != NULL)
+ {
+ l = utf_char2bytes(*p, outstr);
+ outstr += l;
+ }
+ else
+ l = utf_char2len(*p);
+ ++p;
+ outlen += l;
+ --todo;
+ }
+
+ return outlen;
+}
+
+/*
+ * Call MultiByteToWideChar() and allocate memory for the result.
+ * Returns the result in "*out[*outlen]" with an extra zero appended.
+ * "outlen" is in words.
+ */
+ void
+MultiByteToWideChar_alloc(UINT cp, DWORD flags,
+ LPCSTR in, int inlen,
+ LPWSTR *out, int *outlen)
+{
+ *outlen = MultiByteToWideChar(cp, flags, in, inlen, 0, 0);
+ /* Add one one word to avoid a zero-length alloc(). */
+ *out = (LPWSTR)alloc(sizeof(WCHAR) * (*outlen + 1));
+ if (*out != NULL)
+ {
+ MultiByteToWideChar(cp, flags, in, inlen, *out, *outlen);
+ (*out)[*outlen] = 0;
+ }
+}
+
+/*
+ * Call WideCharToMultiByte() and allocate memory for the result.
+ * Returns the result in "*out[*outlen]" with an extra NUL appended.
+ */
+ void
+WideCharToMultiByte_alloc(UINT cp, DWORD flags,
+ LPCWSTR in, int inlen,
+ LPSTR *out, int *outlen,
+ LPCSTR def, LPBOOL useddef)
+{
+ *outlen = WideCharToMultiByte(cp, flags, in, inlen, NULL, 0, def, useddef);
+ /* Add one one byte to avoid a zero-length alloc(). */
+ *out = alloc((unsigned)*outlen + 1);
+ if (*out != NULL)
+ {
+ WideCharToMultiByte(cp, flags, in, inlen, *out, *outlen, def, useddef);
+ (*out)[*outlen] = 0;
+ }
+}
+
+#endif /* FEAT_MBYTE */
+
+#ifdef FEAT_CLIPBOARD
+/*
+ * Clipboard stuff, for cutting and pasting text to other windows.
+ */
+
+/* Type used for the clipboard type of Vim's data. */
+typedef struct
+{
+ int type; /* MCHAR, MBLOCK or MLINE */
+ int txtlen; /* length of CF_TEXT in bytes */
+ int ucslen; /* length of CF_UNICODETEXT in words */
+ int rawlen; /* length of clip_star.format_raw, including encoding,
+ excluding terminating NUL */
+} VimClipType_t;
+
+/*
+ * Make vim the owner of the current selection. Return OK upon success.
+ */
+ int
+clip_mch_own_selection(VimClipboard *cbd)
+{
+ /*
+ * Never actually own the clipboard. If another application sets the
+ * clipboard, we don't want to think that we still own it.
+ */
+ return FAIL;
+}
+
+/*
+ * Make vim NOT the owner of the current selection.
+ */
+ void
+clip_mch_lose_selection(VimClipboard *cbd)
+{
+ /* Nothing needs to be done here */
+}
+
+/*
+ * Copy "str[*size]" into allocated memory, changing CR-NL to NL.
+ * Return the allocated result and the size in "*size".
+ * Returns NULL when out of memory.
+ */
+ static char_u *
+crnl_to_nl(const char_u *str, int *size)
+{
+ int pos = 0;
+ int str_len = *size;
+ char_u *ret;
+ char_u *retp;
+
+ /* Avoid allocating zero bytes, it generates an error message. */
+ ret = lalloc((long_u)(str_len == 0 ? 1 : str_len), TRUE);
+ if (ret != NULL)
+ {
+ retp = ret;
+ for (pos = 0; pos < str_len; ++pos)
+ {
+ if (str[pos] == '\r' && str[pos + 1] == '\n')
+ {
+ ++pos;
+ --(*size);
+ }
+ *retp++ = str[pos];
+ }
+ }
+
+ return ret;
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Note: the following two functions are only guaranteed to work when using
+ * valid MS-Windows codepages or when iconv() is available.
+ */
+
+/*
+ * Convert "str" from 'encoding' to UCS-2.
+ * Input in "str" with length "*lenp". When "lenp" is NULL, use strlen().
+ * Output is returned as an allocated string. "*lenp" is set to the length of
+ * the result. A trailing NUL is always added.
+ * Returns NULL when out of memory.
+ */
+ short_u *
+enc_to_ucs2(char_u *str, int *lenp)
+{
+ vimconv_T conv;
+ WCHAR *ret;
+ char_u *allocbuf = NULL;
+ int len_loc;
+ int length;
+
+ if (lenp == NULL)
+ {
+ len_loc = STRLEN(str) + 1;
+ lenp = &len_loc;
+ }
+
+ if (enc_codepage > 0)
+ {
+ /* We can do any CP### -> UCS-2 in one pass, and we can do it
+ * without iconv() (convert_* may need iconv). */
+ MultiByteToWideChar_alloc(enc_codepage, 0, str, *lenp, &ret, &length);
+ }
+ else
+ {
+ /* Use "latin1" by default, we might be called before we have p_enc
+ * set up. Convert to utf-8 first, works better with iconv(). Does
+ * nothing if 'encoding' is "utf-8". */
+ conv.vc_type = CONV_NONE;
+ if (convert_setup(&conv, p_enc ? p_enc : (char_u *)"latin1",
+ (char_u *)"utf-8") == FAIL)
+ return NULL;
+ if (conv.vc_type != CONV_NONE)
+ {
+ str = allocbuf = string_convert(&conv, str, lenp);
+ if (str == NULL)
+ return NULL;
+ }
+ convert_setup(&conv, NULL, NULL);
+
+ length = utf8_to_ucs2(str, *lenp, NULL, NULL);
+ ret = (WCHAR *)alloc((unsigned)((length + 1) * sizeof(WCHAR)));
+ if (ret != NULL)
+ {
+ utf8_to_ucs2(str, *lenp, (short_u *)ret, NULL);
+ ret[length] = 0;
+ }
+
+ vim_free(allocbuf);
+ }
+
+ *lenp = length;
+ return (short_u *)ret;
+}
+
+/*
+ * Convert an UCS-2 string to 'encoding'.
+ * Input in "str" with length (counted in wide characters) "*lenp". When
+ * "lenp" is NULL, use wcslen().
+ * Output is returned as an allocated string. If "*lenp" is not NULL it is
+ * set to the length of the result.
+ * Returns NULL when out of memory.
+ */
+ char_u *
+ucs2_to_enc(short_u *str, int *lenp)
+{
+ vimconv_T conv;
+ char_u *utf8_str = NULL, *enc_str = NULL;
+ int len_loc;
+
+ if (lenp == NULL)
+ {
+ len_loc = wcslen(str) + 1;
+ lenp = &len_loc;
+ }
+
+ if (enc_codepage > 0)
+ {
+ /* We can do any UCS-2 -> CP### in one pass. */
+ int length;
+
+ WideCharToMultiByte_alloc(enc_codepage, 0, str, *lenp,
+ (LPSTR *)&enc_str, &length, 0, 0);
+ *lenp = length;
+ return enc_str;
+ }
+
+ /* Avoid allocating zero bytes, it generates an error message. */
+ utf8_str = alloc(ucs2_to_utf8(str, *lenp == 0 ? 1 : *lenp, NULL));
+ if (utf8_str != NULL)
+ {
+ *lenp = ucs2_to_utf8(str, *lenp, utf8_str);
+
+ /* We might be called before we have p_enc set up. */
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, (char_u *)"utf-8",
+ p_enc? p_enc: (char_u *)"latin1");
+ if (conv.vc_type == CONV_NONE)
+ {
+ /* p_enc is utf-8, so we're done. */
+ enc_str = utf8_str;
+ }
+ else
+ {
+ enc_str = string_convert(&conv, utf8_str, lenp);
+ vim_free(utf8_str);
+ }
+
+ convert_setup(&conv, NULL, NULL);
+ }
+
+ return enc_str;
+}
+#endif /* FEAT_MBYTE */
+
+/*
+ * Get the current selection and put it in the clipboard register.
+ *
+ * NOTE: Must use GlobalLock/Unlock here to ensure Win32s compatibility.
+ * On NT/W95 the clipboard data is a fixed global memory object and
+ * so its handle = its pointer.
+ * On Win32s, however, co-operation with the Win16 system means that
+ * the clipboard data is moveable and its handle is not a pointer at all,
+ * so we can't just cast the return value of GetClipboardData to (char_u*).
+ * <VN>
+ */
+ void
+clip_mch_request_selection(VimClipboard *cbd)
+{
+ VimClipType_t metadata = { -1, -1, -1, -1 };
+ HGLOBAL hMem = NULL;
+ char_u *str = NULL;
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+ char_u *to_free = NULL;
+#endif
+#ifdef FEAT_MBYTE
+ HGLOBAL rawh = NULL;
+#endif
+ char_u *hMemStr = NULL;
+ int str_size = 0;
+ int maxlen;
+ size_t n;
+
+ /*
+ * Don't pass GetActiveWindow() as an argument to OpenClipboard() because
+ * then we can't paste back into the same window for some reason - webb.
+ */
+ if (!OpenClipboard(NULL))
+ return;
+
+ /* Check for vim's own clipboard format first. This only gets the type of
+ * the data, still need to use CF_UNICODETEXT or CF_TEXT for the text. */
+ if (IsClipboardFormatAvailable(cbd->format))
+ {
+ VimClipType_t *meta_p;
+ HGLOBAL meta_h;
+
+ /* We have metadata on the clipboard; try to get it. */
+ if ((meta_h = GetClipboardData(cbd->format)) != NULL
+ && (meta_p = (VimClipType_t *)GlobalLock(meta_h)) != NULL)
+ {
+ /* The size of "VimClipType_t" changed, "rawlen" was added later.
+ * Only copy what is available for backwards compatibility. */
+ n = sizeof(VimClipType_t);
+ if (GlobalSize(meta_h) < n)
+ n = GlobalSize(meta_h);
+ memcpy(&metadata, meta_p, n);
+ GlobalUnlock(meta_h);
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ /* Check for Vim's raw clipboard format first. This is used without
+ * conversion, but only if 'encoding' matches. */
+ if (IsClipboardFormatAvailable(cbd->format_raw)
+ && metadata.rawlen > (int)STRLEN(p_enc))
+ {
+ /* We have raw data on the clipboard; try to get it. */
+ if ((rawh = GetClipboardData(cbd->format_raw)) != NULL)
+ {
+ char_u *rawp;
+
+ rawp = (char_u *)GlobalLock(rawh);
+ if (rawp != NULL && STRCMP(p_enc, rawp) == 0)
+ {
+ n = STRLEN(p_enc) + 1;
+ str = rawp + n;
+ str_size = metadata.rawlen - n;
+ }
+ else
+ {
+ GlobalUnlock(rawh);
+ rawh = NULL;
+ }
+ }
+ }
+ if (str == NULL)
+ {
+#endif
+
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+ /* Try to get the clipboard in Unicode if it's not an empty string. */
+ if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0)
+ {
+ HGLOBAL hMemW;
+
+ if ((hMemW = GetClipboardData(CF_UNICODETEXT)) != NULL)
+ {
+ WCHAR *hMemWstr = (WCHAR *)GlobalLock(hMemW);
+
+ /* Use the length of our metadata if possible, but limit it to the
+ * GlobalSize() for safety. */
+ maxlen = GlobalSize(hMemW) / sizeof(WCHAR);
+ if (metadata.ucslen >= 0)
+ {
+ if (metadata.ucslen > maxlen)
+ str_size = maxlen;
+ else
+ str_size = metadata.ucslen;
+ }
+ else
+ {
+ for (str_size = 0; str_size < maxlen; ++str_size)
+ if (hMemWstr[str_size] == NUL)
+ break;
+ }
+ to_free = str = ucs2_to_enc((short_u *)hMemWstr, &str_size);
+ GlobalUnlock(hMemW);
+ }
+ }
+ else
+#endif
+ /* Get the clipboard in the Active codepage. */
+ if (IsClipboardFormatAvailable(CF_TEXT))
+ {
+ if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
+ {
+ str = hMemStr = (char_u *)GlobalLock(hMem);
+
+ /* The length is either what our metadata says or the strlen().
+ * But limit it to the GlobalSize() for safety. */
+ maxlen = GlobalSize(hMem);
+ if (metadata.txtlen >= 0)
+ {
+ if (metadata.txtlen > maxlen)
+ str_size = maxlen;
+ else
+ str_size = metadata.txtlen;
+ }
+ else
+ {
+ for (str_size = 0; str_size < maxlen; ++str_size)
+ if (str[str_size] == NUL)
+ break;
+ }
+
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+ /* The text is in the active codepage. Convert to 'encoding',
+ * going through UCS-2. */
+ MultiByteToWideChar_alloc(GetACP(), 0, str, str_size,
+ (LPWSTR *)&to_free, &maxlen);
+ if (to_free != NULL)
+ {
+ str_size = maxlen;
+ str = ucs2_to_enc((short_u *)to_free, &str_size);
+ if (str != NULL)
+ {
+ vim_free(to_free);
+ to_free = str;
+ }
+ }
+#endif
+ }
+ }
+#ifdef FEAT_MBYTE
+ }
+#endif
+
+ if (str != NULL && *str != NUL)
+ {
+ char_u *temp_clipboard;
+
+ /* If the type is not known guess it. */
+ if (metadata.type == -1)
+ metadata.type = (vim_strchr(str, '\n') == NULL) ? MCHAR : MLINE;
+
+ /* Translate <CR><NL> into <NL>. */
+ temp_clipboard = crnl_to_nl(str, &str_size);
+ if (temp_clipboard != NULL)
+ {
+ clip_yank_selection(metadata.type, temp_clipboard, str_size, cbd);
+ vim_free(temp_clipboard);
+ }
+ }
+
+ /* unlock the global object */
+ if (hMem != NULL)
+ GlobalUnlock(hMem);
+#ifdef FEAT_MBYTE
+ if (rawh != NULL)
+ GlobalUnlock(rawh);
+#endif
+ CloseClipboard();
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+ vim_free(to_free);
+#endif
+}
+
+/*
+ * Send the current selection to the clipboard.
+ */
+ void
+clip_mch_set_selection(VimClipboard *cbd)
+{
+ char_u *str = NULL;
+ VimClipType_t metadata;
+ long_u txtlen;
+ HGLOBAL hMemRaw = NULL;
+ HGLOBAL hMem = NULL;
+ HGLOBAL hMemVim = NULL;
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ HGLOBAL hMemW = NULL;
+# endif
+
+ /* If the '*' register isn't already filled in, fill it in now */
+ cbd->owned = TRUE;
+ clip_get_selection(cbd);
+ cbd->owned = FALSE;
+
+ /* Get the text to be put on the clipboard, with CR-LF. */
+ metadata.type = clip_convert_selection(&str, &txtlen, cbd);
+ if (metadata.type < 0)
+ return;
+ metadata.txtlen = (int)txtlen;
+ metadata.ucslen = 0;
+ metadata.rawlen = 0;
+
+#ifdef FEAT_MBYTE
+ /* Always set the raw bytes: 'encoding', NUL and the text. This is used
+ * when copy/paste from/to Vim with the same 'encoding', so that illegal
+ * bytes can also be copied and no conversion is needed. */
+ {
+ LPSTR lpszMemRaw;
+
+ metadata.rawlen = txtlen + STRLEN(p_enc) + 1;
+ hMemRaw = (LPSTR)GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,
+ metadata.rawlen + 1);
+ lpszMemRaw = (LPSTR)GlobalLock(hMemRaw);
+ if (lpszMemRaw != NULL)
+ {
+ STRCPY(lpszMemRaw, p_enc);
+ memcpy(lpszMemRaw + STRLEN(p_enc) + 1, str, txtlen + 1);
+ GlobalUnlock(hMemRaw);
+ }
+ else
+ metadata.rawlen = 0;
+ }
+#endif
+
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ {
+ WCHAR *out;
+ int len = metadata.txtlen;
+
+ /* Convert the text to UCS-2. This is put on the clipboard as
+ * CF_UNICODETEXT. */
+ out = (WCHAR *)enc_to_ucs2(str, &len);
+ if (out != NULL)
+ {
+ WCHAR *lpszMemW;
+
+ /* Convert the text for CF_TEXT to Active codepage. Otherwise it's
+ * p_enc, which has no relation to the Active codepage. */
+ metadata.txtlen = WideCharToMultiByte(GetACP(), 0, out, len,
+ NULL, 0, 0, 0);
+ vim_free(str);
+ str = (char_u *)alloc((unsigned)(metadata.txtlen == 0 ? 1
+ : metadata.txtlen));
+ if (str == NULL)
+ {
+ vim_free(out);
+ return; /* out of memory */
+ }
+ WideCharToMultiByte(GetACP(), 0, out, len,
+ str, metadata.txtlen, 0, 0);
+
+ /* Allocate memory for the UCS-2 text, add one NUL word to
+ * terminate the string. */
+ hMemW = (LPSTR)GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,
+ (len + 1) * sizeof(WCHAR));
+ lpszMemW = (WCHAR *)GlobalLock(hMemW);
+ if (lpszMemW != NULL)
+ {
+ memcpy(lpszMemW, out, len * sizeof(WCHAR));
+ lpszMemW[len] = NUL;
+ GlobalUnlock(hMemW);
+ }
+ vim_free(out);
+ metadata.ucslen = len;
+ }
+ }
+# endif
+
+ /* Allocate memory for the text, add one NUL byte to terminate the string.
+ */
+ hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, metadata.txtlen + 1);
+ {
+ LPSTR lpszMem = (LPSTR)GlobalLock(hMem);
+
+ if (lpszMem)
+ {
+ STRNCPY(lpszMem, str, metadata.txtlen);
+ lpszMem[metadata.txtlen] = NUL;
+ GlobalUnlock(hMem);
+ }
+ }
+
+ /* Set up metadata: */
+ {
+ VimClipType_t *lpszMemVim = NULL;
+
+ hMemVim = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,
+ sizeof(VimClipType_t));
+ lpszMemVim = (VimClipType_t *)GlobalLock(hMemVim);
+ memcpy(lpszMemVim, &metadata, sizeof(metadata));
+ GlobalUnlock(hMemVim);
+ }
+
+ /*
+ * Open the clipboard, clear it and put our text on it.
+ * Always set our Vim format. Put Unicode and plain text on it.
+ *
+ * Don't pass GetActiveWindow() as an argument to OpenClipboard()
+ * because then we can't paste back into the same window for some
+ * reason - webb.
+ */
+ if (OpenClipboard(NULL))
+ {
+ if (EmptyClipboard())
+ {
+ SetClipboardData(cbd->format, hMemVim);
+ hMemVim = 0;
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ if (hMemW != NULL)
+ {
+ if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL)
+ hMemW = NULL;
+ }
+# endif
+ /* Always use CF_TEXT. On Win98 Notepad won't obtain the
+ * CF_UNICODETEXT text, only CF_TEXT. */
+ SetClipboardData(CF_TEXT, hMem);
+ hMem = 0;
+ }
+ CloseClipboard();
+ }
+
+ vim_free(str);
+ /* Free any allocations we didn't give to the clipboard: */
+ if (hMemRaw)
+ GlobalFree(hMemRaw);
+ if (hMem)
+ GlobalFree(hMem);
+# if defined(FEAT_MBYTE) && defined(WIN3264)
+ if (hMemW)
+ GlobalFree(hMemW);
+# endif
+ if (hMemVim)
+ GlobalFree(hMemVim);
+}
+
+#endif /* FEAT_CLIPBOARD */
+
+
+/*
+ * Debugging helper: expose the MCH_WRITE_DUMP stuff to other modules
+ */
+ void
+DumpPutS(
+ const char *psz)
+{
+# ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fputs(psz, fdDump);
+ if (psz[strlen(psz) - 1] != '\n')
+ fputc('\n', fdDump);
+ fflush(fdDump);
+ }
+# endif
+}
+
+#ifdef _DEBUG
+
+void __cdecl
+Trace(
+ char *pszFormat,
+ ...)
+{
+ CHAR szBuff[2048];
+ va_list args;
+
+ va_start(args, pszFormat);
+ vsprintf(szBuff, pszFormat, args);
+ va_end(args);
+
+ OutputDebugString(szBuff);
+}
+
+#endif //_DEBUG
+
+#ifdef HAVE_GETCONSOLEHWND
+# if defined(FEAT_TITLE) && defined(WIN3264)
+extern HWND g_hWnd; /* This is in os_win32.c. */
+# endif
+
+/*
+ * Showing the printer dialog is tricky since we have no GUI
+ * window to parent it. The following routines are needed to
+ * get the window parenting and Z-order to work properly.
+ */
+ static void
+GetConsoleHwnd(void)
+{
+# define MY_BUFSIZE 1024 // Buffer size for console window titles.
+
+ char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated WindowTitle.
+ char pszOldWindowTitle[MY_BUFSIZE]; // Contains original WindowTitle.
+
+ /* Skip if it's already set. */
+ if (s_hwnd != 0)
+ return;
+
+# if defined(FEAT_TITLE) && defined(WIN3264)
+ /* Window handle may have been found by init code (Windows NT only) */
+ if (g_hWnd != 0)
+ {
+ s_hwnd = g_hWnd;
+ return;
+ }
+# endif
+
+ GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
+
+ wsprintf(pszNewWindowTitle, "%s/%d/%d",
+ pszOldWindowTitle,
+ GetTickCount(),
+ GetCurrentProcessId());
+ SetConsoleTitle(pszNewWindowTitle);
+ Sleep(40);
+ s_hwnd = FindWindow(NULL, pszNewWindowTitle);
+
+ SetConsoleTitle(pszOldWindowTitle);
+}
+#endif
+
+#if (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)) || defined(PROTO)
+
+# ifdef WIN16
+# define TEXT(a) a
+# endif
+/*=================================================================
+ * Win32 printer stuff
+ */
+
+static HFONT prt_font_handles[2][2][2];
+static PRINTDLG prt_dlg;
+static const int boldface[2] = {FW_REGULAR, FW_BOLD};
+static TEXTMETRIC prt_tm;
+static int prt_line_height;
+static int prt_number_width;
+static int prt_left_margin;
+static int prt_right_margin;
+static int prt_top_margin;
+static char_u szAppName[] = TEXT("VIM");
+static HWND hDlgPrint;
+static int *bUserAbort = NULL;
+static char_u *prt_name = NULL;
+
+/* Defines which are also in vim.rc. */
+#define IDC_BOX1 400
+#define IDC_PRINTTEXT1 401
+#define IDC_PRINTTEXT2 402
+#define IDC_PROGRESS 403
+
+/*
+ * Convert BGR to RGB for Windows GDI calls
+ */
+ static COLORREF
+swap_me(COLORREF colorref)
+{
+ int temp;
+ char *ptr = (char *)&colorref;
+
+ temp = *(ptr);
+ *(ptr ) = *(ptr + 2);
+ *(ptr + 2) = temp;
+ return colorref;
+}
+
+ static BOOL CALLBACK
+PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+#ifdef FEAT_GETTEXT
+ NONCLIENTMETRICS nm;
+ static HFONT hfont;
+#endif
+
+ switch (message)
+ {
+ case WM_INITDIALOG:
+#ifdef FEAT_GETTEXT
+ nm.cbSize = sizeof(NONCLIENTMETRICS);
+ if (SystemParametersInfo(
+ SPI_GETNONCLIENTMETRICS,
+ sizeof(NONCLIENTMETRICS),
+ &nm,
+ 0))
+ {
+ char buff[MAX_PATH];
+ int i;
+
+ /* Translate the dialog texts */
+ hfont = CreateFontIndirect(&nm.lfMessageFont);
+ for (i = IDC_PRINTTEXT1; i <= IDC_PROGRESS; i++)
+ {
+ SendDlgItemMessage(hDlg, i, WM_SETFONT, (WPARAM)hfont, 1);
+ if (GetDlgItemText(hDlg,i, buff, sizeof(buff)))
+ SetDlgItemText(hDlg,i, _(buff));
+ }
+ SendDlgItemMessage(hDlg, IDCANCEL,
+ WM_SETFONT, (WPARAM)hfont, 1);
+ if (GetDlgItemText(hDlg,IDCANCEL, buff, sizeof(buff)))
+ SetDlgItemText(hDlg,IDCANCEL, _(buff));
+ }
+#endif
+ SetWindowText(hDlg, szAppName);
+ if (prt_name != NULL)
+ {
+ SetDlgItemText(hDlg, IDC_PRINTTEXT2, (LPSTR)prt_name);
+ vim_free(prt_name);
+ prt_name = NULL;
+ }
+ EnableMenuItem(GetSystemMenu(hDlg, FALSE), SC_CLOSE, MF_GRAYED);
+#ifndef FEAT_GUI
+ BringWindowToTop(s_hwnd);
+#endif
+ return TRUE;
+
+ case WM_COMMAND:
+ *bUserAbort = TRUE;
+ EnableWindow(GetParent(hDlg), TRUE);
+ DestroyWindow(hDlg);
+ hDlgPrint = NULL;
+#ifdef FEAT_GETTEXT
+ DeleteObject(hfont);
+#endif
+ return TRUE;
+ }
+ return FALSE;
+}
+
+ static BOOL CALLBACK
+AbortProc(HDC hdcPrn, int iCode)
+{
+ MSG msg;
+
+ while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ return !*bUserAbort;
+}
+
+#ifndef FEAT_GUI
+
+ static UINT CALLBACK
+PrintHookProc(
+ HWND hDlg, // handle to dialog box
+ UINT uiMsg, // message identifier
+ WPARAM wParam, // message parameter
+ LPARAM lParam // message parameter
+ )
+{
+ HWND hwndOwner;
+ RECT rc, rcDlg, rcOwner;
+ PRINTDLG *pPD;
+
+ if (uiMsg == WM_INITDIALOG)
+ {
+ // Get the owner window and dialog box rectangles.
+ if ((hwndOwner = GetParent(hDlg)) == NULL)
+ hwndOwner = GetDesktopWindow();
+
+ GetWindowRect(hwndOwner, &rcOwner);
+ GetWindowRect(hDlg, &rcDlg);
+ CopyRect(&rc, &rcOwner);
+
+ // Offset the owner and dialog box rectangles so that
+ // right and bottom values represent the width and
+ // height, and then offset the owner again to discard
+ // space taken up by the dialog box.
+
+ OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);
+ OffsetRect(&rc, -rc.left, -rc.top);
+ OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
+
+ // The new position is the sum of half the remaining
+ // space and the owner's original position.
+
+ SetWindowPos(hDlg,
+ HWND_TOP,
+ rcOwner.left + (rc.right / 2),
+ rcOwner.top + (rc.bottom / 2),
+ 0, 0, // ignores size arguments
+ SWP_NOSIZE);
+
+ /* tackle the printdlg copiesctrl problem */
+ pPD = (PRINTDLG *)lParam;
+ pPD->nCopies = (WORD)pPD->lCustData;
+ SetDlgItemInt( hDlg, edt3, pPD->nCopies, FALSE );
+ /* Bring the window to top */
+ BringWindowToTop(GetParent(hDlg));
+ SetForegroundWindow(hDlg);
+ }
+
+ return FALSE;
+}
+#endif
+
+ void
+mch_print_cleanup(void)
+{
+ int pifItalic;
+ int pifBold;
+ int pifUnderline;
+
+ for (pifBold = 0; pifBold <= 1; pifBold++)
+ for (pifItalic = 0; pifItalic <= 1; pifItalic++)
+ for (pifUnderline = 0; pifUnderline <= 1; pifUnderline++)
+ DeleteObject(prt_font_handles[pifBold][pifItalic][pifUnderline]);
+
+ if (prt_dlg.hDC != NULL)
+ DeleteDC(prt_dlg.hDC);
+ if (!*bUserAbort)
+ SendMessage(hDlgPrint, WM_COMMAND, 0, 0);
+}
+
+ static int
+to_device_units(int idx, int dpi, int physsize, int offset, int def_number)
+{
+ int ret = 0;
+ int u;
+ int nr;
+
+ u = prt_get_unit(idx);
+ if (u == PRT_UNIT_NONE)
+ {
+ u = PRT_UNIT_PERC;
+ nr = def_number;
+ }
+ else
+ nr = printer_opts[idx].number;
+
+ switch (u)
+ {
+ case PRT_UNIT_PERC:
+ ret = (physsize * nr) / 100;
+ break;
+ case PRT_UNIT_INCH:
+ ret = (nr * dpi);
+ break;
+ case PRT_UNIT_MM:
+ ret = (nr * 10 * dpi) / 254;
+ break;
+ case PRT_UNIT_POINT:
+ ret = (nr * 10 * dpi) / 720;
+ break;
+ }
+
+ if (ret < offset)
+ return 0;
+ else
+ return ret - offset;
+}
+
+ static int
+prt_get_cpl(void)
+{
+ int hr;
+ int phyw;
+ int dvoff;
+ int rev_offset;
+ int dpi;
+#ifdef WIN16
+ POINT pagesize;
+#endif
+
+ GetTextMetrics(prt_dlg.hDC, &prt_tm);
+ prt_line_height = prt_tm.tmHeight + prt_tm.tmExternalLeading;
+
+ hr = GetDeviceCaps(prt_dlg.hDC, HORZRES);
+#ifdef WIN16
+ Escape(prt_dlg.hDC, GETPHYSPAGESIZE, NULL, NULL, &pagesize);
+ phyw = pagesize.x;
+ Escape(prt_dlg.hDC, GETPRINTINGOFFSET, NULL, NULL, &pagesize);
+ dvoff = pagesize.x;
+#else
+ phyw = GetDeviceCaps(prt_dlg.hDC, PHYSICALWIDTH);
+ dvoff = GetDeviceCaps(prt_dlg.hDC, PHYSICALOFFSETX);
+#endif
+ dpi = GetDeviceCaps(prt_dlg.hDC, LOGPIXELSX);
+
+ rev_offset = phyw - (dvoff + hr);
+
+ prt_left_margin = to_device_units(OPT_PRINT_LEFT, dpi, phyw, dvoff, 10);
+ if (prt_use_number())
+ {
+ prt_number_width = PRINT_NUMBER_WIDTH * prt_tm.tmAveCharWidth;
+ prt_left_margin += prt_number_width;
+ }
+ else
+ prt_number_width = 0;
+
+ prt_right_margin = hr - to_device_units(OPT_PRINT_RIGHT, dpi, phyw,
+ rev_offset, 5);
+
+ return (prt_right_margin - prt_left_margin) / prt_tm.tmAveCharWidth;
+}
+
+ static int
+prt_get_lpp(void)
+{
+ int vr;
+ int phyw;
+ int dvoff;
+ int rev_offset;
+ int bottom_margin;
+ int dpi;
+#ifdef WIN16
+ POINT pagesize;
+#endif
+
+ vr = GetDeviceCaps(prt_dlg.hDC, VERTRES);
+#ifdef WIN16
+ Escape(prt_dlg.hDC, GETPHYSPAGESIZE, NULL, NULL, &pagesize);
+ phyw = pagesize.y;
+ Escape(prt_dlg.hDC, GETPRINTINGOFFSET, NULL, NULL, &pagesize);
+ dvoff = pagesize.y;
+#else
+ phyw = GetDeviceCaps(prt_dlg.hDC, PHYSICALHEIGHT);
+ dvoff = GetDeviceCaps(prt_dlg.hDC, PHYSICALOFFSETY);
+#endif
+ dpi = GetDeviceCaps(prt_dlg.hDC, LOGPIXELSY);
+
+ rev_offset = phyw - (dvoff + vr);
+
+ prt_top_margin = to_device_units(OPT_PRINT_TOP, dpi, phyw, dvoff, 5);
+
+ /* adjust top margin if there is a header */
+ prt_top_margin += prt_line_height * prt_header_height();
+
+ bottom_margin = vr - to_device_units(OPT_PRINT_BOT, dpi, phyw,
+ rev_offset, 5);
+
+ return (bottom_margin - prt_top_margin) / prt_line_height;
+}
+
+ int
+mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
+{
+ static HGLOBAL stored_dm = NULL;
+ static HGLOBAL stored_devn = NULL;
+ static int stored_nCopies = 1;
+ static int stored_nFlags = 0;
+
+ LOGFONT fLogFont;
+ int pifItalic;
+ int pifBold;
+ int pifUnderline;
+
+ DEVMODE *mem;
+ DEVNAMES *devname;
+ int i;
+
+ bUserAbort = &(psettings->user_abort);
+ memset(&prt_dlg, 0, sizeof(PRINTDLG));
+ prt_dlg.lStructSize = sizeof(PRINTDLG);
+#ifndef FEAT_GUI
+ GetConsoleHwnd(); /* get value of s_hwnd */
+#endif
+ prt_dlg.hwndOwner = s_hwnd;
+ prt_dlg.Flags = PD_NOPAGENUMS | PD_NOSELECTION | PD_RETURNDC;
+ if (!forceit)
+ {
+ prt_dlg.hDevMode = stored_dm;
+ prt_dlg.hDevNames = stored_devn;
+ prt_dlg.lCustData = stored_nCopies; // work around bug in print dialog
+#ifndef FEAT_GUI
+ /*
+ * Use hook to prevent console window being sent to back
+ */
+ prt_dlg.lpfnPrintHook = PrintHookProc;
+ prt_dlg.Flags |= PD_ENABLEPRINTHOOK;
+#endif
+ prt_dlg.Flags |= stored_nFlags;
+ }
+
+ /*
+ * If bang present, return default printer setup with no dialog
+ * never show dialog if we are running over telnet
+ */
+ if (forceit
+#ifndef FEAT_GUI
+ || !term_console
+#endif
+ )
+ {
+ prt_dlg.Flags |= PD_RETURNDEFAULT;
+#ifdef WIN3264
+ /*
+ * MSDN suggests setting the first parameter to WINSPOOL for
+ * NT, but NULL appears to work just as well.
+ */
+ if (*p_pdev != NUL)
+ prt_dlg.hDC = CreateDC(NULL, p_pdev, NULL, NULL);
+ else
+#endif
+ {
+ prt_dlg.Flags |= PD_RETURNDEFAULT;
+ if (PrintDlg(&prt_dlg) == 0)
+ goto init_fail_dlg;
+ }
+ }
+ else if (PrintDlg(&prt_dlg) == 0)
+ goto init_fail_dlg;
+ else
+ {
+ /*
+ * keep the previous driver context
+ */
+ stored_dm = prt_dlg.hDevMode;
+ stored_devn = prt_dlg.hDevNames;
+ stored_nFlags = prt_dlg.Flags;
+ stored_nCopies = prt_dlg.nCopies;
+ }
+
+ if (prt_dlg.hDC == NULL)
+ {
+ EMSG(_("E237: Printer selection failed"));
+ mch_print_cleanup();
+ return FALSE;
+ }
+
+ /* Not all printer drivers report the support of color (or grey) in the
+ * same way. Let's set has_color if there appears to be some way to print
+ * more than B&W. */
+ i = GetDeviceCaps(prt_dlg.hDC, NUMCOLORS);
+ psettings->has_color = (GetDeviceCaps(prt_dlg.hDC, BITSPIXEL) > 1
+ || GetDeviceCaps(prt_dlg.hDC, PLANES) > 1
+ || i > 2 || i == -1);
+
+ /* Ensure all font styles are baseline aligned */
+ SetTextAlign(prt_dlg.hDC, TA_BASELINE|TA_LEFT);
+
+ /*
+ * On some windows systems the nCopies parameter is not
+ * passed back correctly. It must be retrieved from the
+ * hDevMode struct.
+ */
+ mem = (DEVMODE *)GlobalLock(prt_dlg.hDevMode);
+ if (mem != NULL)
+ {
+#ifdef WIN3264
+ if (mem->dmCopies != 1)
+ stored_nCopies = mem->dmCopies;
+#endif
+ if ((mem->dmFields & DM_DUPLEX) && (mem->dmDuplex & ~DMDUP_SIMPLEX))
+ psettings->duplex = TRUE;
+ if ((mem->dmFields & DM_COLOR) && (mem->dmColor & DMCOLOR_COLOR))
+ psettings->has_color = TRUE;
+ }
+ GlobalUnlock(prt_dlg.hDevMode);
+
+ devname = (DEVNAMES *)GlobalLock(prt_dlg.hDevNames);
+ if (devname != 0)
+ {
+ char_u *printer_name = (char_u *)devname + devname->wDeviceOffset;
+ char_u *port_name = (char_u *)devname +devname->wOutputOffset;
+ char_u *text = _("to %s on %s");
+
+ prt_name = alloc(STRLEN(printer_name) + STRLEN(port_name)
+ + STRLEN(text));
+ if (prt_name != NULL)
+ wsprintf(prt_name, text, printer_name, port_name);
+ }
+ GlobalUnlock(prt_dlg.hDevNames);
+
+ /*
+ * Initialise the font according to 'printfont'
+ */
+ memset(&fLogFont, 0, sizeof(fLogFont));
+ if (!get_logfont(&fLogFont, p_pfn, prt_dlg.hDC))
+ {
+ EMSG2(_("E613: Unknown printer font: %s"), p_pfn);
+ mch_print_cleanup();
+ return FALSE;
+ }
+
+ for (pifBold = 0; pifBold <= 1; pifBold++)
+ for (pifItalic = 0; pifItalic <= 1; pifItalic++)
+ for (pifUnderline = 0; pifUnderline <= 1; pifUnderline++)
+ {
+ fLogFont.lfWeight = boldface[pifBold];
+ fLogFont.lfItalic = pifItalic;
+ fLogFont.lfUnderline = pifUnderline;
+ prt_font_handles[pifBold][pifItalic][pifUnderline]
+ = CreateFontIndirect(&fLogFont);
+ }
+
+ SetBkMode(prt_dlg.hDC, OPAQUE);
+ SelectObject(prt_dlg.hDC, prt_font_handles[0][0][0]);
+
+ /*
+ * Fill in the settings struct
+ */
+ psettings->chars_per_line = prt_get_cpl();
+ psettings->lines_per_page = prt_get_lpp();
+ psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
+ ? prt_dlg.nCopies : 1;
+ psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
+ ? 1 : prt_dlg.nCopies;
+
+ if (psettings->n_collated_copies == 0)
+ psettings->n_collated_copies = 1;
+
+ if (psettings->n_uncollated_copies == 0)
+ psettings->n_uncollated_copies = 1;
+
+ psettings->jobname = jobname;
+
+ return TRUE;
+
+init_fail_dlg:
+ {
+ DWORD err = CommDlgExtendedError();
+
+ if (err)
+ {
+#ifdef WIN16
+ char buf[20];
+
+ sprintf(buf, "%ld", err);
+ EMSG2(_("E238: Print error: %s"), buf);
+#else
+ char_u *buf;
+
+ /* I suspect FormatMessage() doesn't work for values returned by
+ * CommDlgExtendedError(). What does? */
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, err, 0, (LPTSTR)(&buf), 0, NULL);
+ EMSG2(_("E238: Print error: %s"),
+ buf == NULL ? (char_u *)_("Unknown") : buf);
+ LocalFree((LPVOID)(buf));
+#endif
+ }
+ else
+ msg_clr_eos(); /* Maybe canceled */
+
+ mch_print_cleanup();
+ return FALSE;
+ }
+}
+
+
+ int
+mch_print_begin(prt_settings_T *psettings)
+{
+ int ret;
+ static DOCINFO di;
+ char szBuffer[300];
+
+ hDlgPrint = CreateDialog(GetModuleHandle(NULL), TEXT("PrintDlgBox"),
+ prt_dlg.hwndOwner, PrintDlgProc);
+#ifdef WIN16
+ Escape(prt_dlg.hDC, SETABORTPROC, 0, (LPSTR)AbortProc, NULL);
+#else
+ SetAbortProc(prt_dlg.hDC, AbortProc);
+#endif
+ wsprintf(szBuffer, _("Printing '%s'"), gettail(psettings->jobname));
+ SetDlgItemText(hDlgPrint, IDC_PRINTTEXT1, (LPSTR)szBuffer);
+
+ memset(&di, 0, sizeof(DOCINFO));
+ di.cbSize = sizeof(DOCINFO);
+ di.lpszDocName = psettings->jobname;
+ ret = StartDoc(prt_dlg.hDC, &di);
+
+#ifdef FEAT_GUI
+ /* Give focus back to main window (when using MDI). */
+ SetFocus(s_hwnd);
+#endif
+
+ return (ret > 0);
+}
+
+ void
+mch_print_end(prt_settings_T *psettings)
+{
+ EndDoc(prt_dlg.hDC);
+ if (!*bUserAbort)
+ SendMessage(hDlgPrint, WM_COMMAND, 0, 0);
+}
+
+ int
+mch_print_end_page(void)
+{
+ return (EndPage(prt_dlg.hDC) > 0);
+}
+
+ int
+mch_print_begin_page(char_u *msg)
+{
+ if (msg != NULL)
+ SetDlgItemText(hDlgPrint, IDC_PROGRESS, (LPSTR)msg);
+ return (StartPage(prt_dlg.hDC) > 0);
+}
+
+ int
+mch_print_blank_page(void)
+{
+ return (mch_print_begin_page(NULL) ? (mch_print_end_page()) : FALSE);
+}
+
+static int prt_pos_x = 0;
+static int prt_pos_y = 0;
+
+ void
+mch_print_start_line(margin, page_line)
+ int margin;
+ int page_line;
+{
+ if (margin)
+ prt_pos_x = -prt_number_width;
+ else
+ prt_pos_x = 0;
+ prt_pos_y = page_line * prt_line_height
+ + prt_tm.tmAscent + prt_tm.tmExternalLeading;
+}
+
+ int
+mch_print_text_out(char_u *p, int len)
+{
+#ifdef FEAT_PROPORTIONAL_FONTS
+ SIZE sz;
+#endif
+
+ TextOut(prt_dlg.hDC, prt_pos_x + prt_left_margin,
+ prt_pos_y + prt_top_margin, p, len);
+#ifndef FEAT_PROPORTIONAL_FONTS
+ prt_pos_x += len * prt_tm.tmAveCharWidth;
+ return (prt_pos_x + prt_left_margin + prt_tm.tmAveCharWidth
+ + prt_tm.tmOverhang > prt_right_margin);
+#else
+# ifdef WIN16
+ GetTextExtentPoint(prt_dlg.hDC, p, len, &sz);
+# else
+ GetTextExtentPoint32(prt_dlg.hDC, p, len, &sz);
+# endif
+ prt_pos_x += (sz.cx - prt_tm.tmOverhang);
+ /* This is wrong when printing spaces for a TAB. */
+ if (p[len] == NUL)
+ return FALSE;
+# ifdef WIN16
+ GetTextExtentPoint(prt_dlg.hDC, p + len, 1, &sz);
+# else
+ GetTextExtentPoint32(prt_dlg.hDC, p + len, 1, &sz);
+# endif
+ return (prt_pos_x + prt_left_margin + sz.cx > prt_right_margin);
+#endif
+}
+
+ void
+mch_print_set_font(int iBold, int iItalic, int iUnderline)
+{
+ SelectObject(prt_dlg.hDC, prt_font_handles[iBold][iItalic][iUnderline]);
+}
+
+ void
+mch_print_set_bg(unsigned long bgcol)
+{
+ SetBkColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC, swap_me(bgcol)));
+ /*
+ * With a white background we can draw characters transparent, which is
+ * good for italic characters that overlap to the next char cell.
+ */
+ if (bgcol == 0xffffffUL)
+ SetBkMode(prt_dlg.hDC, TRANSPARENT);
+ else
+ SetBkMode(prt_dlg.hDC, OPAQUE);
+}
+
+ void
+mch_print_set_fg(unsigned long fgcol)
+{
+ SetTextColor(prt_dlg.hDC, GetNearestColor(prt_dlg.hDC, swap_me(fgcol)));
+}
+
+#endif /*FEAT_PRINTER && !FEAT_POSTSCRIPT*/
+
+#if defined(FEAT_SHORTCUT) || defined(PROTO)
+# include <shlobj.h>
+
+/*
+ * When "fname" is the name of a shortcut (*.lnk) resolve the file it points
+ * to and return that name in allocated memory.
+ * Otherwise NULL is returned.
+ */
+ char_u *
+mch_resolve_shortcut(char_u *fname)
+{
+ HRESULT hr;
+ IShellLink *psl = NULL;
+ IPersistFile *ppf = NULL;
+ OLECHAR wsz[MAX_PATH];
+ WIN32_FIND_DATA ffd; // we get those free of charge
+ TCHAR buf[MAX_PATH]; // could have simply reused 'wsz'...
+ char_u *rfname = NULL;
+ int len;
+
+ /* Check if the file name ends in ".lnk". Avoid calling
+ * CoCreateInstance(), it's quite slow. */
+ if (fname == NULL)
+ return rfname;
+ len = STRLEN(fname);
+ if (len <= 4 || STRNICMP(fname + len - 4, ".lnk", 4) != 0)
+ return rfname;
+
+ CoInitialize(NULL);
+
+ // create a link manager object and request its interface
+ hr = CoCreateInstance(
+ &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ &IID_IShellLink, (void**)&psl);
+ if (hr != S_OK)
+ goto shortcut_error;
+
+ // Get a pointer to the IPersistFile interface.
+ hr = psl->lpVtbl->QueryInterface(
+ psl, &IID_IPersistFile, (void**)&ppf);
+ if (hr != S_OK)
+ goto shortcut_error;
+
+ // full path string must be in Unicode.
+ MultiByteToWideChar(CP_ACP, 0, fname, -1, wsz, MAX_PATH);
+
+ // "load" the name and resove the link
+ hr = ppf->lpVtbl->Load(ppf, wsz, STGM_READ);
+ if (hr != S_OK)
+ goto shortcut_error;
+#if 0 // This makes Vim wait a long time if the target doesn't exist.
+ hr = psl->lpVtbl->Resolve(psl, NULL, SLR_NO_UI);
+ if (hr != S_OK)
+ goto shortcut_error;
+#endif
+
+ // Get the path to the link target.
+ ZeroMemory(buf, MAX_PATH);
+ hr = psl->lpVtbl->GetPath(psl, buf, MAX_PATH, &ffd, 0);
+ if (hr == S_OK && buf[0] != NUL)
+ rfname = vim_strsave(buf);
+
+shortcut_error:
+ // Release all interface pointers (both belong to the same object)
+ if (ppf != NULL)
+ ppf->lpVtbl->Release(ppf);
+ if (psl != NULL)
+ psl->lpVtbl->Release(psl);
+
+ CoUninitialize();
+ return rfname;
+}
+#endif
+
+#if (defined(FEAT_EVAL) && !defined(FEAT_GUI)) || defined(PROTO)
+/*
+ * Bring ourselves to the foreground. Does work if the OS doesn't allow it.
+ */
+ void
+win32_set_foreground()
+{
+# ifndef FEAT_GUI
+ GetConsoleHwnd(); /* get value of s_hwnd */
+# endif
+ if (s_hwnd != 0)
+ SetForegroundWindow(s_hwnd);
+}
+#endif
+
+#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
+/*
+ * Client-server code for Vim
+ *
+ * Originally written by Paul Moore
+ */
+
+/* In order to handle inter-process messages, we need to have a window. But
+ * the functions in this module can be called before the main GUI window is
+ * created (and may also be called in the console version, where there is no
+ * GUI window at all).
+ *
+ * So we create a hidden window, and arrange to destroy it on exit.
+ */
+HWND message_window = 0; /* window that's handling messsages */
+
+#define VIM_CLASSNAME "VIM_MESSAGES"
+#define VIM_CLASSNAME_LEN (sizeof(VIM_CLASSNAME) - 1)
+
+/* Communication is via WM_COPYDATA messages. The message type is send in
+ * the dwData parameter. Types are defined here. */
+#define COPYDATA_KEYS 0
+#define COPYDATA_REPLY 1
+#define COPYDATA_EXPR 10
+#define COPYDATA_RESULT 11
+#define COPYDATA_ERROR_RESULT 12
+
+/* This is a structure containing a server HWND and its name. */
+struct server_id
+{
+ HWND hwnd;
+ char_u *name;
+};
+
+/*
+ * Clean up on exit. This destroys the hidden message window.
+ */
+ static void
+#ifdef __BORLANDC__
+ _RTLENTRYF
+#endif
+CleanUpMessaging(void)
+{
+ if (message_window != 0)
+ {
+ DestroyWindow(message_window);
+ message_window = 0;
+ }
+}
+
+static int save_reply(HWND server, char_u *reply, int expr);
+
+/*s
+ * The window procedure for the hidden message window.
+ * It handles callback messages and notifications from servers.
+ * In order to process these messages, it is necessary to run a
+ * message loop. Code which may run before the main message loop
+ * is started (in the GUI) is careful to pump messages when it needs
+ * to. Features which require message delivery during normal use will
+ * not work in the console version - this basically means those
+ * features which allow Vim to act as a server, rather than a client.
+ */
+ static LRESULT CALLBACK
+Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ if (msg == WM_COPYDATA)
+ {
+ /* This is a message from another Vim. The dwData member of the
+ * COPYDATASTRUCT determines the type of message:
+ * COPYDATA_KEYS:
+ * A key sequence. We are a server, and a client wants these keys
+ * adding to the input queue.
+ * COPYDATA_REPLY:
+ * A reply. We are a client, and a server has sent this message
+ * in response to a request. (server2client())
+ * COPYDATA_EXPR:
+ * An expression. We are a server, and a client wants us to
+ * evaluate this expression.
+ * COPYDATA_RESULT:
+ * A reply. We are a client, and a server has sent this message
+ * in response to a COPYDATA_EXPR.
+ * COPYDATA_ERROR_RESULT:
+ * A reply. We are a client, and a server has sent this message
+ * in response to a COPYDATA_EXPR that failed to evaluate.
+ */
+ COPYDATASTRUCT *data = (COPYDATASTRUCT*)lParam;
+ HWND sender = (HWND)wParam;
+ COPYDATASTRUCT reply;
+ char_u *res;
+ char_u winstr[30];
+ int retval;
+
+ switch (data->dwData)
+ {
+ case COPYDATA_KEYS:
+ /* Remember who sent this, for <client> */
+ clientWindow = sender;
+
+ /* Add the received keys to the input buffer. The loop waiting
+ * for the user to do something should check the input buffer. */
+ server_to_input_buf((char_u *)(data->lpData));
+
+# ifdef FEAT_GUI
+ /* Wake up the main GUI loop. */
+ if (s_hwnd != 0)
+ PostMessage(s_hwnd, WM_NULL, 0, 0);
+# endif
+ return 1;
+
+ case COPYDATA_EXPR:
+ /* Remember who sent this, for <client> */
+ clientWindow = sender;
+
+ res = eval_client_expr_to_string(data->lpData);
+ if (res == NULL)
+ {
+ res = vim_strsave(_(e_invexprmsg));
+ reply.dwData = COPYDATA_ERROR_RESULT;
+ }
+ else
+ reply.dwData = COPYDATA_RESULT;
+ reply.lpData = res;
+ reply.cbData = STRLEN(res) + 1;
+
+ retval = SendMessage(sender, WM_COPYDATA, (WPARAM)message_window,
+ (LPARAM)(&reply));
+ vim_free(res);
+ return retval;
+
+ case COPYDATA_REPLY:
+ case COPYDATA_RESULT:
+ case COPYDATA_ERROR_RESULT:
+ if (data->lpData != NULL)
+ {
+ save_reply(sender, data->lpData,
+ (data->dwData == COPYDATA_REPLY ? 0 :
+ (data->dwData == COPYDATA_RESULT ? 1 :
+ 2)));
+#ifdef FEAT_AUTOCMD
+ if (data->dwData == COPYDATA_REPLY)
+ {
+ sprintf((char *)winstr, "0x%x", (unsigned)sender);
+ apply_autocmds(EVENT_REMOTEREPLY, winstr, data->lpData,
+ TRUE, curbuf);
+ }
+#endif
+ }
+ return 1;
+ }
+
+ return 0;
+ }
+
+ else if (msg == WM_ACTIVATE && wParam == WA_ACTIVE)
+ {
+ /* When the message window is activated (brought to the foreground),
+ * this actually applies to the text window. */
+#ifndef FEAT_GUI
+ GetConsoleHwnd(); /* get value of s_hwnd */
+#endif
+ if (s_hwnd != 0)
+ {
+ SetForegroundWindow(s_hwnd);
+ return 0;
+ }
+ }
+
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+}
+
+/*
+ * Initialise the message handling process. This involves creating a window
+ * to handle messages - the window will not be visible.
+ */
+ void
+serverInitMessaging(void)
+{
+ WNDCLASS wndclass;
+ HINSTANCE s_hinst;
+
+ /* Clean up on exit */
+ atexit(CleanUpMessaging);
+
+ /* Register a window class - we only really care
+ * about the window procedure
+ */
+ s_hinst = (HINSTANCE)GetModuleHandle(0);
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = Messaging_WndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = s_hinst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = NULL;
+ wndclass.hbrBackground = NULL;
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = VIM_CLASSNAME;
+ RegisterClass(&wndclass);
+
+ /* Create the message window. It will be hidden, so the details don't
+ * matter. Don't use WS_OVERLAPPEDWINDOW, it will make a shortcut remove
+ * focus from gvim. */
+ message_window = CreateWindow(VIM_CLASSNAME, "",
+ WS_POPUPWINDOW | WS_CAPTION,
+ CW_USEDEFAULT, CW_USEDEFAULT,
+ 100, 100, NULL, NULL,
+ s_hinst, NULL);
+}
+
+/*
+ * Get the title of the window "hwnd", which is the Vim server name, in
+ * "name[namelen]" and return the length.
+ * Returns zero if window "hwnd" is not a Vim server.
+ */
+ static int
+getVimServerName(HWND hwnd, char *name, int namelen)
+{
+ int len;
+ char buffer[VIM_CLASSNAME_LEN + 1];
+
+ /* Ignore windows which aren't Vim message windows */
+ len = GetClassName(hwnd, buffer, sizeof(buffer));
+ if (len != VIM_CLASSNAME_LEN || STRCMP(buffer, VIM_CLASSNAME) != 0)
+ return 0;
+
+ /* Get the title of the window */
+ return GetWindowText(hwnd, name, namelen);
+}
+
+ static BOOL CALLBACK
+enumWindowsGetServer(HWND hwnd, LPARAM lparam)
+{
+ struct server_id *id = (struct server_id *)lparam;
+ char server[MAX_PATH];
+
+ /* Get the title of the window */
+ if (getVimServerName(hwnd, server, sizeof(server)) == 0)
+ return TRUE;
+
+ /* If this is the server we're looking for, return its HWND */
+ if (STRICMP(server, id->name) == 0)
+ {
+ id->hwnd = hwnd;
+ return FALSE;
+ }
+
+ /* Otherwise, keep looking */
+ return TRUE;
+}
+
+ static BOOL CALLBACK
+enumWindowsGetNames(HWND hwnd, LPARAM lparam)
+{
+ garray_T *ga = (garray_T *)lparam;
+ char server[MAX_PATH];
+
+ /* Get the title of the window */
+ if (getVimServerName(hwnd, server, sizeof(server)) == 0)
+ return TRUE;
+
+ /* Add the name to the list */
+ ga_concat(ga, server);
+ ga_concat(ga, "\n");
+ return TRUE;
+}
+
+ static HWND
+findServer(char_u *name)
+{
+ struct server_id id;
+
+ id.name = name;
+ id.hwnd = 0;
+
+ EnumWindows(enumWindowsGetServer, (LPARAM)(&id));
+
+ return id.hwnd;
+}
+
+ void
+serverSetName(char_u *name)
+{
+ char_u *ok_name;
+ HWND hwnd = 0;
+ int i = 0;
+ char_u *p;
+
+ /* Leave enough space for a 9-digit suffix to ensure uniqueness! */
+ ok_name = alloc(STRLEN(name) + 10);
+
+ STRCPY(ok_name, name);
+ p = ok_name + STRLEN(name);
+
+ for (;;)
+ {
+ /* This is inefficient - we're doing an EnumWindows loop for each
+ * possible name. It would be better to grab all names in one go,
+ * and scan the list each time...
+ */
+ hwnd = findServer(ok_name);
+ if (hwnd == 0)
+ break;
+
+ ++i;
+ if (i >= 1000)
+ break;
+
+ sprintf((char *)p, "%d", i);
+ }
+
+ if (hwnd != 0)
+ vim_free(ok_name);
+ else
+ {
+ /* Remember the name */
+ serverName = ok_name;
+#ifdef FEAT_TITLE
+ need_maketitle = TRUE; /* update Vim window title later */
+#endif
+
+ /* Update the message window title */
+ SetWindowText(message_window, ok_name);
+
+#ifdef FEAT_EVAL
+ /* Set the servername variable */
+ set_vim_var_string(VV_SEND_SERVER, serverName, -1);
+#endif
+ }
+}
+
+ char_u *
+serverGetVimNames(void)
+{
+ garray_T ga;
+
+ ga_init2(&ga, 1, 100);
+
+ EnumWindows(enumWindowsGetNames, (LPARAM)(&ga));
+
+ return ga.ga_data;
+}
+
+ int
+serverSendReply(name, reply)
+ char_u *name; /* Where to send. */
+ char_u *reply; /* What to send. */
+{
+ HWND target;
+ COPYDATASTRUCT data;
+ int n = 0;
+
+ /* The "name" argument is a magic cookie obtained from expand("<client>").
+ * It should be of the form 0xXXXXX - i.e. a C hex literal, which is the
+ * value of the client's message window HWND.
+ */
+ sscanf((char *)name, "%x", &n);
+ if (n == 0)
+ return -1;
+
+ target = (HWND)n;
+ if (!IsWindow(target))
+ return -1;
+
+ data.dwData = COPYDATA_REPLY;
+ data.cbData = STRLEN(reply) + 1;
+ data.lpData = reply;
+
+ if (SendMessage(target, WM_COPYDATA, (WPARAM)message_window,
+ (LPARAM)(&data)))
+ return 0;
+
+ return -1;
+}
+
+ int
+serverSendToVim(name, cmd, result, ptarget, asExpr, silent)
+ char_u *name; /* Where to send. */
+ char_u *cmd; /* What to send. */
+ char_u **result; /* Result of eval'ed expression */
+ void *ptarget; /* HWND of server */
+ int asExpr; /* Expression or keys? */
+ int silent; /* don't complain about no server */
+{
+ HWND target = findServer(name);
+ COPYDATASTRUCT data;
+ char_u *retval = NULL;
+ int retcode = 0;
+
+ if (target == 0)
+ {
+ if (!silent)
+ EMSG2(_(e_noserver), name);
+ return -1;
+ }
+
+ if (ptarget)
+ *(HWND *)ptarget = target;
+
+ data.dwData = asExpr ? COPYDATA_EXPR : COPYDATA_KEYS;
+ data.cbData = STRLEN(cmd) + 1;
+ data.lpData = cmd;
+
+ if (SendMessage(target, WM_COPYDATA, (WPARAM)message_window,
+ (LPARAM)(&data)) == 0)
+ return -1;
+
+ if (asExpr)
+ retval = serverGetReply(target, &retcode, TRUE, TRUE);
+
+ if (result == NULL)
+ vim_free(retval);
+ else
+ *result = retval; /* Caller assumes responsibility for freeing */
+
+ return retcode;
+}
+
+/*
+ * Bring the server to the foreground.
+ */
+ void
+serverForeground(name)
+ char_u *name;
+{
+ HWND target = findServer(name);
+
+ if (target != 0)
+ SetForegroundWindow(target);
+}
+
+/* Replies from server need to be stored until the client picks them up via
+ * remote_read(). So we maintain a list of server-id/reply pairs.
+ * Note that there could be multiple replies from one server pending if the
+ * client is slow picking them up.
+ * We just store the replies in a simple list. When we remove an entry, we
+ * move list entries down to fill the gap.
+ * The server ID is simply the HWND.
+ */
+typedef struct
+{
+ HWND server; /* server window */
+ char_u *reply; /* reply string */
+ int expr_result; /* 0 for REPLY, 1 for RESULT 2 for error */
+}
+reply_T;
+
+static garray_T reply_list = {0, 0, sizeof(reply_T), 5, 0};
+
+#define REPLY_ITEM(i) ((reply_T *)(reply_list.ga_data) + (i))
+#define REPLY_COUNT (reply_list.ga_len)
+#define REPLY_ROOM (reply_list.ga_room)
+
+/* Flag which is used to wait for a reply */
+static int reply_received = 0;
+
+ static int
+save_reply(HWND server, char_u *reply, int expr)
+{
+ reply_T *rep;
+
+ if (ga_grow(&reply_list, 1) == FAIL)
+ return FAIL;
+
+ rep = REPLY_ITEM(REPLY_COUNT);
+ rep->server = server;
+ rep->reply = vim_strsave(reply);
+ rep->expr_result = expr;
+ if (rep->reply == NULL)
+ return FAIL;
+
+ ++REPLY_COUNT;
+ --REPLY_ROOM;
+ reply_received = 1;
+ return OK;
+}
+
+/*
+ * Get a reply from server "server".
+ * When "expr_res" is non NULL, get the result of an expression, otherwise a
+ * server2client() message.
+ * When non NULL, point to return code. 0 => OK, -1 => ERROR
+ * If "remove" is TRUE, consume the message, the caller must free it then.
+ * if "wait" is TRUE block until a message arrives (or the server exits).
+ */
+ char_u *
+serverGetReply(HWND server, int *expr_res, int remove, int wait)
+{
+ int i;
+ char_u *reply;
+ reply_T *rep;
+
+ /* When waiting, loop until the message waiting for is received. */
+ for (;;)
+ {
+ /* Reset this here, in case a message arrives while we are going
+ * through the already received messages. */
+ reply_received = 0;
+
+ for (i = 0; i < REPLY_COUNT; ++i)
+ {
+ rep = REPLY_ITEM(i);
+ if (rep->server == server
+ && ((rep->expr_result != 0) == (expr_res != NULL)))
+ {
+ /* Save the values we've found for later */
+ reply = rep->reply;
+ if (expr_res != NULL)
+ *expr_res = rep->expr_result == 1 ? 0 : -1;
+
+ if (remove)
+ {
+ /* Move the rest of the list down to fill the gap */
+ mch_memmove(rep, rep + 1,
+ (REPLY_COUNT - i - 1) * sizeof(reply_T));
+ --REPLY_COUNT;
+ ++REPLY_ROOM;
+ }
+
+ /* Return the reply to the caller, who takes on responsibility
+ * for freeing it if "remove" is TRUE. */
+ return reply;
+ }
+ }
+
+ /* If we got here, we didn't find a reply. Return immediately if the
+ * "wait" parameter isn't set. */
+ if (!wait)
+ break;
+
+ /* We need to wait for a reply. Enter a message loop until the
+ * "reply_received" flag gets set. */
+
+ /* Loop until we receive a reply */
+ while (reply_received == 0)
+ {
+ /* Wait for a SendMessage() call to us. This could be the reply
+ * we are waiting for. Use a timeout of a second, to catch the
+ * situation that the server died unexpectedly. */
+ MsgWaitForMultipleObjects(0, NULL, TRUE, 1000, QS_ALLINPUT);
+
+ /* If the server has died, give up */
+ if (!IsWindow(server))
+ return NULL;
+
+ serverProcessPendingMessages();
+ }
+ }
+
+ return NULL;
+}
+
+/*
+ * Process any messages in the Windows message queue.
+ */
+ void
+serverProcessPendingMessages(void)
+{
+ MSG msg;
+
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+}
+
+#endif /* FEAT_CLIENTSERVER */
+
+#if defined(FEAT_GUI) || (defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)) \
+ || defined(PROTO)
+
+struct charset_pair
+{
+ char *name;
+ BYTE charset;
+};
+
+static struct charset_pair
+charset_pairs[] =
+{
+ {"ANSI", ANSI_CHARSET},
+ {"CHINESEBIG5", CHINESEBIG5_CHARSET},
+ {"DEFAULT", DEFAULT_CHARSET},
+ {"HANGEUL", HANGEUL_CHARSET},
+ {"OEM", OEM_CHARSET},
+ {"SHIFTJIS", SHIFTJIS_CHARSET},
+ {"SYMBOL", SYMBOL_CHARSET},
+#ifdef WIN3264
+ {"ARABIC", ARABIC_CHARSET},
+ {"BALTIC", BALTIC_CHARSET},
+ {"EASTEUROPE", EASTEUROPE_CHARSET},
+ {"GB2312", GB2312_CHARSET},
+ {"GREEK", GREEK_CHARSET},
+ {"HEBREW", HEBREW_CHARSET},
+ {"JOHAB", JOHAB_CHARSET},
+ {"MAC", MAC_CHARSET},
+ {"RUSSIAN", RUSSIAN_CHARSET},
+ {"THAI", THAI_CHARSET},
+ {"TURKISH", TURKISH_CHARSET},
+# if (!defined(_MSC_VER) || (_MSC_VER > 1010)) \
+ && (!defined(__BORLANDC__) || (__BORLANDC__ > 0x0500))
+ {"VIETNAMESE", VIETNAMESE_CHARSET},
+# endif
+#endif
+ {NULL, 0}
+};
+
+/*
+ * Convert a charset ID to a name.
+ * Return NULL when not recognized.
+ */
+ char *
+charset_id2name(int id)
+{
+ struct charset_pair *cp;
+
+ for (cp = charset_pairs; cp->name != NULL; ++cp)
+ if ((BYTE)id == cp->charset)
+ break;
+ return cp->name;
+}
+
+static const LOGFONT s_lfDefault =
+{
+ -12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
+ OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
+ PROOF_QUALITY, FIXED_PITCH | FF_DONTCARE,
+ "Fixedsys" /* see _ReadVimIni */
+};
+
+/* Initialise the "current height" to -12 (same as s_lfDefault) just
+ * in case the user specifies a font in "guifont" with no size before a font
+ * with an explicit size has been set. This defaults the size to this value
+ * (-12 equates to roughly 9pt).
+ */
+int current_font_height = -12; /* also used in gui_w48.c */
+
+/* Convert a string representing a point size into pixels. The string should
+ * be a positive decimal number, with an optional decimal point (eg, "12", or
+ * "10.5"). The pixel value is returned, and a pointer to the next unconverted
+ * character is stored in *end. The flag "vertical" says whether this
+ * calculation is for a vertical (height) size or a horizontal (width) one.
+ */
+ static int
+points_to_pixels(char_u *str, char_u **end, int vertical, int pprinter_dc)
+{
+ int pixels;
+ int points = 0;
+ int divisor = 0;
+ HWND hwnd = (HWND)0;
+ HDC hdc;
+ HDC printer_dc = (HDC)pprinter_dc;
+
+ while (*str != NUL)
+ {
+ if (*str == '.' && divisor == 0)
+ {
+ /* Start keeping a divisor, for later */
+ divisor = 1;
+ }
+ else
+ {
+ if (!VIM_ISDIGIT(*str))
+ break;
+
+ points *= 10;
+ points += *str - '0';
+ divisor *= 10;
+ }
+ ++str;
+ }
+
+ if (divisor == 0)
+ divisor = 1;
+
+ if (printer_dc == NULL)
+ {
+ hwnd = GetDesktopWindow();
+ hdc = GetWindowDC(hwnd);
+ }
+ else
+ hdc = printer_dc;
+
+ pixels = MulDiv(points,
+ GetDeviceCaps(hdc, vertical ? LOGPIXELSY : LOGPIXELSX),
+ 72 * divisor);
+
+ if (printer_dc == NULL)
+ ReleaseDC(hwnd, hdc);
+
+ *end = str;
+ return pixels;
+}
+
+ static int CALLBACK
+font_enumproc(
+ ENUMLOGFONT *elf,
+ NEWTEXTMETRIC *ntm,
+ int type,
+ LPARAM lparam)
+{
+ /* Return value:
+ * 0 = terminate now (monospace & ANSI)
+ * 1 = continue, still no luck...
+ * 2 = continue, but we have an acceptable LOGFONT
+ * (monospace, not ANSI)
+ * We use these values, as EnumFontFamilies returns 1 if the
+ * callback function is never called. So, we check the return as
+ * 0 = perfect, 2 = OK, 1 = no good...
+ * It's not pretty, but it works!
+ */
+
+ LOGFONT *lf = (LOGFONT *)(lparam);
+
+#ifndef FEAT_PROPORTIONAL_FONTS
+ /* Ignore non-monospace fonts without further ado */
+ if ((ntm->tmPitchAndFamily & 1) != 0)
+ return 1;
+#endif
+
+ /* Remember this LOGFONT as a "possible" */
+ *lf = elf->elfLogFont;
+
+ /* Terminate the scan as soon as we find an ANSI font */
+ if (lf->lfCharSet == ANSI_CHARSET
+ || lf->lfCharSet == OEM_CHARSET
+ || lf->lfCharSet == DEFAULT_CHARSET)
+ return 0;
+
+ /* Continue the scan - we have a non-ANSI font */
+ return 2;
+}
+
+ static int
+init_logfont(LOGFONT *lf)
+{
+ int n;
+ HWND hwnd = GetDesktopWindow();
+ HDC hdc = GetWindowDC(hwnd);
+
+ n = EnumFontFamilies(hdc,
+ (LPCSTR)lf->lfFaceName,
+ (FONTENUMPROC)font_enumproc,
+ (LPARAM)lf);
+
+ ReleaseDC(hwnd, hdc);
+
+ /* If we couldn't find a useable font, return failure */
+ if (n == 1)
+ return FAIL;
+
+ /* Tidy up the rest of the LOGFONT structure. We set to a basic
+ * font - get_logfont() sets bold, italic, etc based on the user's
+ * input.
+ */
+ lf->lfHeight = current_font_height;
+ lf->lfWidth = 0;
+ lf->lfItalic = FALSE;
+ lf->lfUnderline = FALSE;
+ lf->lfStrikeOut = FALSE;
+ lf->lfWeight = FW_NORMAL;
+
+ /* Return success */
+ return OK;
+}
+
+ int
+get_logfont(
+ LOGFONT *lf,
+ char_u *name,
+ HDC printer_dc)
+{
+ char_u *p;
+ int i;
+ static LOGFONT *lastlf = NULL;
+
+ *lf = s_lfDefault;
+ if (name == NULL)
+ return 1;
+
+ if (STRCMP(name, "*") == 0)
+ {
+#if defined(FEAT_GUI_W32)
+ CHOOSEFONT cf;
+ /* if name is "*", bring up std font dialog: */
+ memset(&cf, 0, sizeof(cf));
+ cf.lStructSize = sizeof(cf);
+ cf.hwndOwner = s_hwnd;
+ cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_INITTOLOGFONTSTRUCT;
+ if (lastlf != NULL)
+ *lf = *lastlf;
+ cf.lpLogFont = lf;
+ cf.nFontType = 0 ; //REGULAR_FONTTYPE;
+ if (ChooseFont(&cf))
+ goto theend;
+#else
+ return 0;
+#endif
+ }
+
+ /*
+ * Split name up, it could be <name>:h<height>:w<width> etc.
+ */
+ for (p = name; *p && *p != ':'; p++)
+ {
+ if (p - name + 1 > LF_FACESIZE)
+ return 0; /* Name too long */
+ lf->lfFaceName[p - name] = *p;
+ }
+ if (p != name)
+ lf->lfFaceName[p - name] = NUL;
+
+ /* First set defaults */
+ lf->lfHeight = -12;
+ lf->lfWidth = 0;
+ lf->lfWeight = FW_NORMAL;
+ lf->lfItalic = FALSE;
+ lf->lfUnderline = FALSE;
+ lf->lfStrikeOut = FALSE;
+
+ /*
+ * If the font can't be found, try replacing '_' by ' '.
+ */
+ if (init_logfont(lf) == FAIL)
+ {
+ int did_replace = FALSE;
+
+ for (i = 0; lf->lfFaceName[i]; ++i)
+ if (lf->lfFaceName[i] == '_')
+ {
+ lf->lfFaceName[i] = ' ';
+ did_replace = TRUE;
+ }
+ if (!did_replace || init_logfont(lf) == FAIL)
+ return 0;
+ }
+
+ while (*p == ':')
+ p++;
+
+ /* Set the values found after ':' */
+ while (*p)
+ {
+ switch (*p++)
+ {
+ case 'h':
+ lf->lfHeight = - points_to_pixels(p, &p, TRUE, (int)printer_dc);
+ break;
+ case 'w':
+ lf->lfWidth = points_to_pixels(p, &p, FALSE, (int)printer_dc);
+ break;
+ case 'b':
+#ifndef MSWIN16_FASTTEXT
+ lf->lfWeight = FW_BOLD;
+#endif
+ break;
+ case 'i':
+#ifndef MSWIN16_FASTTEXT
+ lf->lfItalic = TRUE;
+#endif
+ break;
+ case 'u':
+ lf->lfUnderline = TRUE;
+ break;
+ case 's':
+ lf->lfStrikeOut = TRUE;
+ break;
+ case 'c':
+ {
+ struct charset_pair *cp;
+
+ for (cp = charset_pairs; cp->name != NULL; ++cp)
+ if (STRNCMP(p, cp->name, strlen(cp->name)) == 0)
+ {
+ lf->lfCharSet = cp->charset;
+ p += strlen(cp->name);
+ break;
+ }
+ if (cp->name == NULL)
+ {
+ sprintf((char *)IObuff, _("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
+ EMSG(IObuff);
+ break;
+ }
+ break;
+ }
+ default:
+ sprintf((char *)IObuff,
+ _("E245: Illegal char '%c' in font name \"%s\""),
+ p[-1], name);
+ EMSG(IObuff);
+ break;
+ }
+ while (*p == ':')
+ p++;
+ }
+
+#if defined(FEAT_GUI_W32)
+theend:
+#endif
+ /* ron: init lastlf */
+ if (printer_dc == NULL)
+ {
+ vim_free(lastlf);
+ lastlf = (LOGFONT *)alloc(sizeof(LOGFONT));
+ if (lastlf != NULL)
+ mch_memmove(lastlf, lf, sizeof(LOGFONT));
+ }
+
+ return 1;
+}
+
+#endif /* defined(FEAT_GUI) || defined(FEAT_PRINTER) */
diff --git a/src/os_os2_cfg.h b/src/os_os2_cfg.h
new file mode 100644
index 000000000..ce3b4bbde
--- /dev/null
+++ b/src/os_os2_cfg.h
@@ -0,0 +1,251 @@
+/* os_os2_cfg.h */
+/* vi:set ts=8 sts=4 sw=4: */
+
+#define CASE_INSENSITIVE_FILENAME /* ignore case when comparing file names */
+#define SPACE_IN_FILENAME
+#define BACKSLASH_IN_FILENAME
+#define BINARY_FILE_IO
+#define USE_CRNL /* lines end in CR-NL instead of NL */
+#define NO_EXPANDPATH /* always call mch_expand_wildcards */
+#define USE_EXE_NAME /* use argv[0] for $VIM */
+#define USE_TERM_CONSOLE
+#define HAVE_DUP /* have dup() */
+
+#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
+
+/*
+ * The rest is manually generated from configure.in by Paul Slootman.
+ */
+
+/* Define unless no X support found */
+#undef HAVE_X11
+
+/* Define when terminfo support found */
+#undef TERMINFO
+
+/* Define when termcap.h contains ospeed */
+#define HAVE_OSPEED 1
+
+#define HAVE_STRICMP
+#define HAVE_STRNICMP
+
+/* Define when ospeed can be extern */
+#define OSPEED_EXTERN
+
+/* Define when termcap.h contains UP, BC and PC */
+#define HAVE_UP_BC_PC 1
+
+/* Define when UP, BC and PC can be extern */
+#define UP_BC_PC_EXTERN
+
+/* Define when termcap.h defines outfuntype */
+#undef HAVE_OUTFUNTYPE
+
+/* Define when __DATE__ " " __TIME__ can be used */
+#define HAVE_DATE_TIME 1
+
+#undef UNIX /* define always by current configure script */
+
+/* Defined to the size of an int */
+#define SIZEOF_INT 4
+
+/*
+ * If we cannot trust one of the following from the libraries, we use our
+ * own safe but probably slower mch_memmove().
+ */
+#define USEBCOPY 1
+#undef USEMEMMOVE
+#undef USEMEMCPY
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef mode_t
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if you can safely include both <sys/time.h> and <sys/select.h>. */
+#define SYS_SELECT_WITH_SYS_TIME 1
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define as the command at the end of signal handlers ("" or "return 0;"). */
+#define SIGRETURN
+
+/* Define if touuper/tolower only work on lower/upercase characters */
+#undef BROKEN_TOUPPER
+
+/* Define if tgetstr() has a second argument that is (char *) */
+#undef TGETSTR_CHAR_P
+
+/* Define if you have the sigset() function. */
+#undef HAVE_SIGSET
+
+/* Define if the getcwd() function should not be used. */
+#undef BAD_GETCWD
+
+/* Define if you have the getcwd() function. */
+#define HAVE_GETCWD 1
+
+/* Define if you have the getwd() function. */
+#define HAVE_GETWD 1
+
+/* Define if you have the select() function. */
+#define HAVE_SELECT 1
+
+/* Define if you have the strcspn() function. */
+#define HAVE_STRCSPN 1
+
+/* Define if you have the strtol() function. */
+#define HAVE_STRTOL 1
+
+/* Define if you have the tgetent() function. */
+#define HAVE_TGETENT 1
+
+#define HAVE_STRFTIME /* guessed */
+
+/* Define if you have the memset() function. */
+#define HAVE_MEMSET 1
+
+/* Define if you have the strerror() function. */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strcasecmp() function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the fchown() function. */
+#undef HAVE_FCHOWN
+
+/* Define if you have the rename() function. */
+#define HAVE_RENAME 1
+
+/* Define if you have the fsync() function. */
+#undef HAVE_FSYNC /* exists, but apparently Bad Things happen when used */
+
+/* Define if you have the fchdir() function. */
+#undef HAVE_FCHDIR
+
+/* Define if you have the setenv() function. */
+#undef HAVE_SETENV
+
+/* Define if you have the putenv() function. */
+#define HAVE_PUTENV 1
+
+/* Define if you have the gettimeofday() function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the getpwuid() function. */
+#undef HAVE_GETPWUID
+
+/* Define if you have the getpwnam() function. */
+#undef HAVE_GETPWNAM
+
+/* Define if you have the qsort() function. */
+#define HAVE_QSORT 1
+
+/* Define if you have the <dirent.h> header file. */
+#define HAVE_DIRENT_H 1
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define if you have a <sys/wait.h> that is not POSIX.1 compatible. */
+#undef HAVE_UNION_WAIT
+
+/* This is currently unused in vim: */
+/* Define if you have the ANSI C header files. */
+/* #undef STDC_HEADERS */
+
+/* instead, we check a few STDC things ourselves */
+#define HAVE_STDLIB_H 1
+#undef HAVE_STRING_H /* On EMX it is better to use strings.h */
+
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <sys/utsname.h> header file. */
+#define HAVE_SYS_UTSNAME_H 1
+
+/* Define if you have the <termcap.h> header file. */
+#define HAVE_TERMCAP_H 1
+
+/* Define if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define if you have the <sgtty.h> header file. */
+#define HAVE_SGTTY_H 1
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H
+
+/* Define if you have the <termio.h> header file. */
+#undef HAVE_TERMIO_H
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
+/* Define if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define if you have the <sys/systeminfo.h> header file. */
+#undef HAVE_SYS_SYSTEMINFO_H
+
+/* Define if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
+
+/* Define if you have the <sys/stream.h> header file. */
+#undef HAVE_SYS_STREAM_H
+
+/* Define if you have the <sys/ptem.h> header file. */
+#undef HAVE_SYS_PTEM_H
+
+/* Define if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define if you have the <libc.h> header file. */
+#undef HAVE_LIBC_H
+
+/* Define if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
+
+/* Define if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
diff --git a/src/os_qnx.c b/src/os_qnx.c
new file mode 100644
index 000000000..704061a4e
--- /dev/null
+++ b/src/os_qnx.c
@@ -0,0 +1,162 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * QNX port by Julian Kinraid
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * os_qnx.c
+ */
+
+#include "vim.h"
+
+
+#if defined(FEAT_GUI_PHOTON)
+int is_photon_available;
+#endif
+
+void qnx_init()
+{
+#if defined(FEAT_GUI_PHOTON)
+ PhChannelParms_t parms;
+
+ memset( &parms, 0, sizeof( parms ) );
+ parms.flags = Ph_DYNAMIC_BUFFER;
+
+ is_photon_available = (PhAttach( NULL, &parms ) != NULL) ? TRUE : FALSE;
+#endif
+}
+
+#if (defined(FEAT_GUI_PHOTON) && defined(FEAT_CLIPBOARD)) || defined(PROTO)
+
+#define CLIP_TYPE_VIM "VIMTYPE"
+#define CLIP_TYPE_TEXT "TEXT"
+
+/* Turn on the clipboard for a console vim when photon is running */
+void qnx_clip_init()
+{
+ if( is_photon_available == TRUE && !gui.in_use)
+ clip_init( TRUE );
+}
+
+/*****************************************************************************/
+/* Clipboard */
+
+/* No support for owning the clipboard */
+int
+clip_mch_own_selection( VimClipboard *cbd )
+{
+ return FALSE;
+}
+
+void
+clip_mch_lose_selection( VimClipboard *cbd )
+{
+}
+
+void
+clip_mch_request_selection( VimClipboard *cbd )
+{
+ int type = MLINE, clip_length = 0, is_type_set = FALSE;
+ void *cbdata;
+ PhClipHeader *clip_header;
+ char_u *clip_text = NULL;
+
+ cbdata = PhClipboardPasteStart( PhInputGroup( NULL ));
+ if( cbdata != NULL )
+ {
+ /* Look for the vim specific clip first */
+ clip_header = PhClipboardPasteType( cbdata, CLIP_TYPE_VIM );
+ if( clip_header != NULL && clip_header->data != NULL )
+ {
+ switch( *(char *) clip_header->data )
+ {
+ default: /* fallthrough to line type */
+ case 'L': type = MLINE; break;
+ case 'C': type = MCHAR; break;
+#ifdef FEAT_VISUAL
+ case 'B': type = MBLOCK; break;
+#endif
+ }
+ is_type_set = TRUE;
+ }
+
+ /* Try for just normal text */
+ clip_header = PhClipboardPasteType( cbdata, CLIP_TYPE_TEXT );
+ if( clip_header != NULL )
+ {
+ clip_text = clip_header->data;
+ clip_length = clip_header->length - 1;
+
+ if( clip_text != NULL && is_type_set == FALSE )
+ type = (strchr( clip_text, '\r' ) != NULL) ? MLINE : MCHAR;
+ }
+
+ if( (clip_text != NULL) && (clip_length > 0) )
+ {
+ clip_yank_selection( type, clip_text, clip_length, cbd );
+ }
+
+ PhClipboardPasteFinish( cbdata );
+ }
+}
+
+void
+clip_mch_set_selection( VimClipboard *cbd )
+{
+ int type;
+ long_u len;
+ char_u *text_clip, vim_clip[2], *str = NULL;
+ PhClipHeader clip_header[2];
+
+ /* Prevent recursion from clip_get_selection() */
+ if( cbd->owned == TRUE )
+ return;
+
+ cbd->owned = TRUE;
+ clip_get_selection( cbd );
+ cbd->owned = FALSE;
+
+ type = clip_convert_selection( &str, &len, cbd );
+ if( type >= 0 )
+ {
+ text_clip = lalloc( len + 1, TRUE ); /* Normal text */
+
+ if( text_clip && vim_clip )
+ {
+ memset( clip_header, 0, sizeof( clip_header ) );
+
+ STRNCPY( clip_header[0].type, CLIP_TYPE_VIM, 8 );
+ clip_header[0].length = sizeof( vim_clip );
+ clip_header[0].data = vim_clip;
+
+ STRNCPY( clip_header[1].type, CLIP_TYPE_TEXT, 8 );
+ clip_header[1].length = len + 1;
+ clip_header[1].data = text_clip;
+
+ switch( type )
+ {
+ default: /* fallthrough to MLINE */
+ case MLINE: *vim_clip = 'L'; break;
+ case MCHAR: *vim_clip = 'C'; break;
+#ifdef FEAT_VISUAL
+ case MBLOCK: *vim_clip = 'B'; break;
+#endif
+ }
+
+ STRNCPY( text_clip, str, len );
+ text_clip[ len ] = NUL;
+
+ vim_clip[ 1 ] = NUL;
+
+ PhClipboardCopy( PhInputGroup( NULL ), 2, clip_header);
+ }
+ vim_free( text_clip );
+ }
+ vim_free( str );
+}
+#endif
diff --git a/src/os_qnx.h b/src/os_qnx.h
new file mode 100644
index 000000000..cddc68db9
--- /dev/null
+++ b/src/os_qnx.h
@@ -0,0 +1,19 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#ifdef __QNXNTO__
+# include <sys/procmgr.h>
+#endif
+
+#define USE_TMPNAM
+
+#define POSIX /* Used by pty.c */
+
+#if defined(FEAT_GUI_PHOTON)
+extern int is_photon_available;
+#endif
diff --git a/src/os_riscos.c b/src/os_riscos.c
new file mode 100644
index 000000000..a1cdab403
--- /dev/null
+++ b/src/os_riscos.c
@@ -0,0 +1,1288 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+/*
+ * os_riscos.c
+ *
+ * Thomas Leonard <tal197@ecs.soton.ac.uk>
+ */
+
+const char *__dynamic_da_name = "Vim heap"; /* Enable and name our dynamic area */
+int ro_line_mode = TRUE; /* For Ex mode we much echo chars to the screen ourselves */
+int windowed; /* Flag - are we running inside a text window? */
+int WinLeft, WinTop; /* We might be started inside a text window */
+int ScrollTop; /* Make cursor movements relative to ScrollTop. */
+
+int old_escape_state = -1;
+int old_cursor_state = -1;
+
+#define rgb(r,g,b) ((b<<24) + (g<<16) + (r<<8))
+#define NORMAL_FG 0x00000000
+#define NORMAL_BG 0xffffffff
+
+/* Convert a DOS colour number to an RGB palette entry.
+ * Mappings from X11 rgb/txt file.
+ */
+ static int
+map_colour(dos)
+ int dos; /* Standard DOS colour number. */
+{
+ switch (dos)
+ {
+ case 0: return 0; /* Black */
+ case 1: return rgb(0,0,139); /* DarkBlue */
+ case 2: return rgb(0,100,0); /* DarkGreen */
+ case 3: return rgb(0,139,139); /* DarkCyan */
+ case 4: return rgb(139,0,0); /* DarkRed */
+ case 5: return rgb(139,0,139); /* DarkMagenta */
+ case 6: return rgb(165,42,42); /* Brown, DarkYellow */
+ case 7: return rgb(211,211,211); /* LightGray, LightGrey, Gray, Grey */
+ case 8: return rgb(169,169,169); /* DarkGray, DarkGrey */
+ case 9: return rgb(173,216,230); /* Blue, LightBlue */
+ case 10: return rgb(144,238,144); /* Green, LightGreen */
+ case 11: return rgb(224,255,255); /* Cyan, LightCyan */
+ case 12: return rgb(255,0,0); /* Red, LightRed */
+ case 13: return rgb(255,0,255); /* Magenta, LightMagenta */
+ case 14: return rgb(255,255,0); /* Yellow, LightYellow */
+ case 15: return rgb(255,255,255); /* White */
+ }
+ return rgb(100,100,100);
+}
+
+ static void
+text_fg(fg)
+ int fg; /* Foregound colour in the form &BBGGRR00 */
+{
+ xswi(ColourTrans_SetTextColour, fg, 0, 0, 0);
+}
+
+ static void
+text_bg(bg)
+ int bg; /* Backgound colour in the form &BBGGRR00 */
+{
+ xswi(ColourTrans_SetTextColour, bg, 0, 0, 1 << 7);
+}
+
+#define OUT_NORMAL 0
+#define OUT_NUMBER 1 /* Reading in a number */
+
+ void
+mch_write(s, len)
+ char_u *s;
+ int len;
+{
+ static int mode = OUT_NORMAL;
+ static int x, y; /* For reading numbers in. */
+
+ if (!term_console)
+ {
+ /* Maybe we are running Vim remotely - don't interpret chars */
+ while (len--)
+ {
+ char_u c = *s++;
+ swi(OS_WriteC, c);
+ /* We might need to send a CR too. This shouldn't
+ * hurt if we don't need it, should it?
+ */
+ if (c == 10)
+ swi(OS_WriteI + 13);
+ }
+ return;
+ }
+
+ while (len--)
+ {
+ char_u c = *s++;
+ switch (mode)
+ {
+ case OUT_NUMBER:
+ if (c < '0' || c > '9')
+ {
+ mode = OUT_NORMAL;
+ }
+ else
+ {
+ x = (x * 10) + c - '0';
+ continue;
+ }
+ /* note: no break here! */
+
+ case OUT_NORMAL:
+ switch (c)
+ {
+ case 1:
+ /* Number (in decimal) follows. */
+ mode = OUT_NUMBER;
+ y = x;
+ x = 0;
+ break;
+ case 2:
+ /* Position cursor. */
+ swi(OS_WriteI + 31);
+ swi(OS_WriteC, x);
+ swi(OS_WriteC, y - ScrollTop);
+ break;
+ case 3:
+ /* Set scroll region. */
+ if (x == Rows -1 && y == 0 && !windowed)
+ {
+ /* Whole screen - remove text window.
+ * This is MUCH faster.
+ */
+ swi(OS_WriteI + 26);
+ }
+ else
+ {
+ /* Create a text window. */
+ swi(OS_WriteI + 28);
+ swi(OS_WriteC, WinLeft);
+ swi(OS_WriteC, WinTop + x);
+ swi(OS_WriteC, WinLeft + Columns - 1);
+ swi(OS_WriteC, WinTop + y);
+ }
+ ScrollTop = y;
+ break;
+ case 4:
+ /* Normal mode. */
+ text_fg(NORMAL_FG);
+ text_bg(NORMAL_BG);
+ break;
+ case 5:
+ /* Reverse mode. */
+ text_fg(NORMAL_BG);
+ text_bg(NORMAL_FG);
+ break;
+ case 10:
+ swi(OS_NewLine);
+ break;
+ case 14:
+ /* Cursor invisible. */
+ swi(OS_WriteN,
+ "\027\001\000\000\000\000\000\000\000\000",
+ 10);
+ break;
+ case 15:
+ /* Cursor visible. */
+ swi(OS_WriteN,
+ "\027\001\002\000\000\000\000\000\000\000",
+ 10);
+ break;
+ case 16:
+ /* Cursor very visible (flash) */
+ swi(OS_WriteN,
+ "\027\001\003\000\000\000\000\000\000\000",
+ 10);
+ case 17:
+ /* Set foreground colour. */
+ text_fg(map_colour(x));
+ break;
+ case 18:
+ /* Set background colour. */
+ text_bg(map_colour(x));
+ break;
+ case 19:
+ /* Scroll text down. */
+ swi(OS_WriteN,
+ "\027\007\000\002\000\000\000\000\000\000",
+ 10);
+ break;
+ default:
+ swi(OS_WriteC, c);
+ }
+ continue;
+
+ default:
+ printf("[output error]");
+ mode = OUT_NORMAL;
+ }
+ }
+}
+
+/*
+ * mch_inchar(): low level input funcion.
+ * Get a characters from the keyboard.
+ * Return the number of characters that are available.
+ * If wtime == 0 do not wait for characters.
+ * If wtime == n wait n msecs for characters.
+ * If wtime == -1 wait forever for characters.
+ *
+ * TODO: call convert_input() for 'fileencoding' to 'encoding' conversion.
+ */
+ int
+mch_inchar(buf, maxlen, wtime, tb_change_cnt)
+ char_u *buf;
+ int maxlen;
+ long wtime;
+ int tb_change_cnt;
+{
+ int got=0;
+ unsigned int start_time = clock();
+
+ if (ro_line_mode)
+ {
+ /* We're probably in Ex mode - get whole lines at a time. */
+
+ static char_u line_buffer[256];
+ static int remaining_chars = 0;
+ static int buf_pos = 0;
+
+ /* Do we need to fetch another line? */
+ if (remaining_chars == 0)
+ {
+ int old_esc_state;
+ swi(OS_Byte, 200, 1, 0xfe);
+ old_esc_state = r1;
+
+ buf_pos = 0;
+ if (xswi(OS_ReadLine, line_buffer, 255, 0, 255) & (c_flag | v_flag))
+ {
+ got_int = TRUE; /* ESC pressed */
+ r1 = 0;
+ }
+ line_buffer[r1] = 13;
+ remaining_chars = r1 + 1; /* Count CR as part of input */
+
+ swi(OS_Byte, 200, old_esc_state, 0);
+ }
+
+ /* Can we send the rest of the buffer back in one go? */
+ if (remaining_chars <= maxlen)
+ {
+ int got = remaining_chars;
+
+ memcpy(buf, line_buffer + buf_pos, got);
+ remaining_chars = 0;
+ return got;
+ }
+
+ /* Send as much as we can */
+ memcpy(buf, line_buffer + buf_pos, maxlen);
+ buf_pos += maxlen;
+ remaining_chars -= maxlen;
+
+ return maxlen;
+ }
+
+ if (!term_console)
+ {
+ /* Use OS_ReadC for all input.
+ * Avoids problems with remote access getting interference from
+ * the keyboard.
+ */
+ if (wtime == 0)
+ return 0; /* Ignore quick key checks */
+
+ if (xswi(OS_ReadC) & c_flag)
+ {
+ got_int = TRUE; /* ESC pressed - can this happen? */
+ swi(OS_Byte, 124); /* Clear Escape state */
+ r0 = 0x1b; /* It *might* not have been Escape! */
+ }
+ buf[0] = r0;
+ return 1;
+ }
+
+ /*
+ * OK, here's the plan:
+ *
+ * 1) Wait until wtime expires or we get a key
+ * 2) Get keys until the keyboard buffer is empty or buf is full
+ */
+
+ while (xswi(OS_Byte,145,0) & c_flag)
+ {
+ /* Nothing at all in the keyboard buffer.
+ * Has our time expired yet?
+ */
+ if ( (wtime != -1) && (clock() - start_time) >= wtime )
+ return 0; /* Nothing read - giving up */
+ }
+
+ /* We've got one char (in r2) - are there any more? */
+
+ while (got < maxlen)
+ {
+ buf[got++] = r2;
+
+ if (xswi(OS_Byte,145,0) & c_flag)
+ return got; /* Keyboard buffer empty */
+ }
+ return got; /* buf is full */
+}
+
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail()
+{
+ if (!term_console)
+ return 0; /* Can't tell */
+ if (xswi(OS_Byte, 152, 0) & c_flag)
+ return 0;
+ return 1;
+}
+
+/* Find out how much free memory we have.
+ * I don't know how to work this out exactly but, since we can claim
+ * more memory from the OS, let's just report the free pool size.
+ * Dynamic area 6 doesn't exist pre 3.6 according to StrongHelp, so
+ * we'll use Wimp_SlotSize. If that fails (outside the desktop?)
+ * then just return a big number and hope.
+ */
+ long_u
+mch_avail_mem(special)
+ int special;
+{
+ if (xswi(Wimp_SlotSize, -1, -1) & v_flag)
+ return 0x7fffffff;
+ return r2;
+}
+
+ void
+mch_delay(msec, ignoreinput)
+ long msec;
+ int ignoreinput;
+{
+ int start_time, time_now;
+ int csec = msec / 10;
+
+ swi(OS_ReadMonotonicTime);
+ start_time = r0;
+
+ for (;;)
+ {
+ swi(OS_ReadMonotonicTime);
+ time_now = r0;
+ if (time_now - start_time > csec)
+ return;
+#ifdef FEAT_GUI
+ /* In the GUI, allow other programs to run while waiting. */
+ if (gui.in_use)
+ gui_mch_wait_for_chars(start_time + csec);
+#endif
+ }
+}
+
+/*
+ * If the machine has job control, use it to suspend the program,
+ * otherwise fake it by starting a new shell.
+ */
+ void
+mch_suspend()
+{
+ suspend_shell();
+}
+
+ void
+mch_init()
+{
+ /*
+ * Read window size first. Calls to mch_get_shellsize() will
+ * simply return these values in future so that setting the
+ * text window (used for scrolling) won't give strange results.
+ */
+
+ int buf[7] = {132, 135, 256, 257, 1, 2, -1};
+
+ /* Command windows are no longer forced open, since if we are
+ * in the desktop then we'll use the GUI version.
+ * Opening a command window here messes up the GUI version startup
+ */
+#ifndef FEAT_GUI
+ swi(OS_WriteI);
+#endif
+ swi(OS_ReadVduVariables, buf, buf);
+ WinLeft = buf[0];
+ WinTop = buf[1];
+ Columns = buf[2];
+ Rows = buf[3] + 1; /* Seems to be one off (VduVars wrong?) */
+ ScrollTop = 0;
+
+ /* Are we running in a textwindow? */
+ if (Rows == buf[5] + 1 && Columns == buf[4] + 1)
+ windowed = 0;
+ else
+ windowed = 1;
+
+ /* Choose a nice colour scheme. */
+ text_fg(NORMAL_FG);
+ text_bg(NORMAL_BG);
+}
+
+/*
+ * Check_win checks whether we have an interactive stdout.
+ */
+/* ARGSUSED */
+ int
+mch_check_win(argc, argv)
+ int argc;
+ char **argv;
+{
+ return OK;
+}
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ */
+ int
+mch_input_isatty()
+{
+ if (xswi(OS_ChangeRedirection, -1, -1) & v_flag)
+ return TRUE; /* Error - TRUE is probably correct though */
+ if (r0 == 0)
+ return TRUE;
+ return FALSE;
+}
+
+#ifdef FEAT_TITLE
+ int
+mch_can_restore_title()
+{
+ return FALSE;
+}
+
+ int
+mch_can_restore_icon()
+{
+ return FALSE;
+}
+
+
+/*
+ * Set the window title and icon.
+ */
+ void
+mch_settitle(title, icon)
+ char_u *title;
+ char_u *icon;
+{
+ if (title == NULL)
+ title = (char_u *) "<untitled>";
+#ifdef FEAT_GUI
+ if (gui.in_use && strcmp(title, gui.window_title))
+ {
+ int length;
+ length = strlen(title);
+ if (length >= gui.window_title_size)
+ length = gui.window_title_size - 1;
+ strncpy(gui.window_title, title, length);
+ gui.window_title[length] = 0;
+ ro_redraw_title(gui.window_handle);
+ }
+#endif
+ return;
+}
+
+/*
+ * Restore the window/icon title.
+ * "which" is one of:
+ * 1 only restore title
+ * 2 only restore icon
+ * 3 restore title and icon
+ */
+ void
+mch_restore_title(which)
+ int which;
+{
+ return;
+}
+#endif
+
+/*
+ * Insert user name in s[len].
+ * Return OK if a name found.
+ */
+ int
+mch_get_user_name(s, len)
+ char_u *s;
+ int len;
+{
+ /* RISC OS doesn't support user names. */
+ *s = NUL;
+ return FAIL;
+}
+
+/*
+ * Insert host name in s[len].
+ */
+
+ void
+mch_get_host_name(s, len)
+ char_u *s;
+ int len;
+{
+ if (xswi(OS_ReadVarVal, "Machine$Name", s, len, 0, 3) & v_flag)
+ {
+ /* Variable does not exist (normal operation) */
+ STRNCPY(s, "(unknown)", len);
+ }
+}
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ if (xswi(Wimp_ReadSysInfo, 5) & v_flag)
+ return 0;
+ return r0;
+}
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(buf, len)
+ char_u *buf;
+ int len;
+{
+ if (xswi(OS_FSControl, 37, "@", buf, 0, 0, len) & v_flag)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Get absolute file name into buffer 'buf' of length 'len' bytes.
+ *
+ * return FAIL for failure, OK for success
+ */
+ int
+mch_FullName(fname, buf, len, force)
+ char_u *fname, *buf;
+ int len;
+ int force; /* Also expand when already absolute path name.
+ * Not used under RISC OS.
+ */
+{
+ if (xswi(OS_FSControl, 37, fname, buf, 0, 0, len) & v_flag)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(fname)
+ char_u *fname;
+{
+ if (strstr(fname, "::") && strstr(fname,".$."))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Get file permissions for 'name'.
+ * Returns -1 when it doesn't exist.
+ */
+ long
+mch_getperm(name)
+ char_u *name;
+{
+ struct stat statb;
+
+ if (stat((char *)name, &statb))
+ return -1;
+ return statb.st_mode;
+}
+
+/*
+ * set file permission for 'name' to 'perm'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_setperm(name, perm)
+ char_u *name;
+ long perm;
+{
+ return (chmod((char *)name, (mode_t)perm) == 0 ? OK : FAIL);
+}
+
+/*
+ * Set hidden flag for "name".
+ */
+/* ARGSUSED */
+ void
+mch_hide(name)
+ char_u *name;
+{
+ /* can't hide a file */
+}
+
+/*
+ * return TRUE if "name" is a directory
+ * return FALSE if "name" is not a directory
+ * return FALSE for error
+ */
+ int
+mch_isdir(name)
+ char_u *name;
+{
+ if (xswi(OS_File, 17, name) & v_flag)
+ return FALSE;
+ if (r0 == 2 || r0 == 3)
+ return TRUE; /* Count image files as directories. */
+ return FALSE;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return 1 if "name" can be executed, 0 if not.
+ * Return -1 if unknown. Requires which to work.
+ */
+ int
+mch_can_exe(name)
+ char_u *name;
+{
+ char_u *buf;
+ char_u *p;
+ int retval;
+
+ buf = alloc((unsigned)STRLEN(name) + 7);
+ if (buf == NULL)
+ return -1;
+ sprintf((char *)buf, "which %s", name);
+ p = get_cmd_output(buf, SHELL_SILENT);
+ vim_free(buf);
+ if (p == NULL)
+ return -1;
+ /* result can be: "name: Command not found" */
+ retval = (*p != NUL && strstr((char *)p, "not found") == NULL);
+ vim_free(p);
+ return retval;
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(name)
+ char_u *name;
+{
+ /* TODO */
+ return NODE_NORMAL;
+}
+
+ void
+mch_early_init()
+{
+ /* Turn off all the horrible filename munging in UnixLib. */
+ __riscosify_control = __RISCOSIFY_NO_PROCESS;
+}
+
+ void
+mch_exit(r)
+ int r;
+{
+ settmode(TMODE_COOK);
+ exiting = TRUE;
+ out_flush();
+ ml_close_all(TRUE); /* remove all memfiles */
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_exit(r);
+#endif
+ swi(OS_NewLine);
+ if (old_escape_state != -1)
+ swi(OS_Byte, 229, old_escape_state, 0);
+ if (old_cursor_state != -1)
+ swi(OS_Byte, 4, old_cursor_state);
+ exit(r);
+}
+
+ void
+mch_settmode(tmode)
+ int tmode; /* TMODE_RAW or TMODE_COOK */
+{
+ if (tmode == TMODE_COOK)
+ {
+ ro_line_mode = TRUE;
+ return;
+ }
+
+ ro_line_mode = FALSE;
+
+ if (term_console)
+ {
+ /* Block cursor. */
+ swi(OS_WriteN,
+ "\027\000\012\000\000\000\000\000\000\000",
+ 10);
+
+ /* Disable the standard cursor key actions. */
+ swi(OS_Byte, 4, 1);
+ if (old_cursor_state == -1)
+ old_cursor_state = r1;
+ }
+
+ /* Stop Escape from quitting Vim! */
+ swi(OS_Byte, 229, 1, 0);
+ if (old_escape_state == -1)
+ old_escape_state = r1;
+}
+
+/*
+ * set mouse clicks on or off (only works for xterms)
+ */
+ void
+mch_setmouse(on)
+ int on;
+{
+}
+
+/*
+ * set screen mode, always fails.
+ */
+/* ARGSUSED */
+ int
+mch_screenmode(arg)
+ char_u *arg;
+{
+ EMSG(_(e_screnmode));
+ return FAIL;
+}
+
+/*
+ * Try to get the current window size.
+ * Return OK when size could be determined, FAIL otherwise.
+ * Simply return results stored by mch_init() if we are the
+ * machine's console. If not, we don't know how big the screen is.
+ */
+ int
+mch_get_shellsize()
+{
+ /* if size changed: screenalloc will allocate new screen buffers */
+ return term_console ? OK : FAIL;
+}
+
+/*
+ * Can't change the size.
+ * Assume the user knows what he's doing and use the new values.
+ */
+ void
+mch_set_shellsize()
+{
+ /* Assume the user knows what he's doing and use the new values. */
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize()
+{
+ /* Nothing to do. */
+}
+
+ int
+mch_call_shell(cmd, options)
+ char_u *cmd;
+ int options; /* SHELL_*, see vim.h */
+{
+ int retval;
+ int tmode = cur_tmode;
+
+ if (cmd == NULL)
+ cmd = (char_u *) "GOS";
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ return gui_mch_call_shell(cmd, options);
+#endif
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+ MSG_PUTS("\n");
+
+ /* I don't even want to think about what UnixLib must
+ * be doing to allow this to work...
+ */
+ retval = system(cmd);
+ if (retval && !(options & SHELL_SILENT))
+ EMSG(strerror(EOPSYS)); /* Doesn't seem to set errno? */
+
+ swi(OS_Byte, 229, 1, 0); /* Re-disable escape */
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+ return retval ? FAIL : OK;
+}
+
+/*
+ * Check for Escape being pressed right now.
+ * [ different if !term_console? ]
+ */
+ void
+mch_breakcheck()
+{
+ if (xswi(OS_Byte, 121, 0xf0) & v_flag)
+ return;
+ if (r1 == 0xff)
+ {
+ got_int = TRUE;
+ swi(OS_Byte, 15, 1); /* Flush input buffer */
+ }
+}
+
+/*
+ * Recursively expand one path component into all matching files and/or
+ * directories.
+ * "path" has backslashes before chars that are not to be expanded.
+ * Return the number of matches found.
+ */
+ int
+mch_expandpath(gap, path, flags)
+ garray_T *gap; /* Grow array for results. */
+ char_u *path;
+ int flags; /* EW_* flags */
+{
+ int got; /* Number of matches. */
+ char_u *pattern;
+
+ /* Plan:
+ *
+ * 1) Get first part of path - no wildcards
+ * 2) Get next path element (wildcarded)
+ * 3) Get rest of path
+ *
+ * If (3) is nothing then only the leaf is wildcarded - add to gap
+ * Otherwise call recursively for each path in (2), passing (3)
+ *
+ * This is just the header function.
+ */
+
+ /* We must be able to modifiy path, so make a copy */
+ pattern = vim_strsave(path);
+ if (pattern == NULL)
+ return 0;
+ got = expand_section(gap, (char_u *)"", pattern, flags);
+ vim_free(pattern);
+ return got;
+}
+
+/*
+ * expand_section(gap, "$.Dir1.Dir2", "ABBA*.myleaf##")
+ *
+ * calls expand_section(gap, "$.Dir1.Dir2.ABBA_Gold", "myleaf##")
+ * and expand_section(gap, "$.Dir1.Dir2.ABBA_Live", "myleaf##")
+ *
+ * If rest is just a leaf then all matches are added to gap.
+ *
+ * Returns number of items added to gap.
+ */
+ int
+expand_section(gap, root, rest, flags)
+ garray_T *gap;
+ char_u *root; /* Non-wildcarded path to search */
+ char_u *rest; /* Wildcarded remainder of path */
+ int flags; /* Add dirs/files/missing objects. */
+{
+ static char_u buf[MAXPATHL]; /* Temporary buffer. */
+ char_u dir[MAXPATHL];
+ int start_element = -1; /* Start of wildcarded element */
+ char_u c;
+ int i;
+ int got, dir_pos;
+ int buflen; /* Chars used in buf[] */
+ int colon = 0; /* Dir ends in ':' */
+
+ buflen = strlen(root);
+ STRNCPY(buf, root, buflen); /* Copy root into buffer. */
+
+ /*
+ * Find end of nonwildcarded section.
+ * Count ':' as a path sep since Vim:Bug* is a valid pathname.
+ */
+
+ for (i = 0; c = rest[i]; i++)
+ {
+ if (c == PATHSEP)
+ {
+ start_element = i;
+ colon = 0;
+ }
+ if (c == ':')
+ {
+ start_element = i + 1;
+ colon = 1;
+ }
+ if (c == '#' || c == '*')
+ break;
+ }
+ if (c == 0)
+ start_element = i;
+
+ /*
+ * start_element +> terminator for non-wildcarded section.
+ * Transfer this bit into buf.
+ */
+ if (buflen + start_element + 4 >= MAXPATHL)
+ return 0; /* Buffer full */
+ if (start_element >= 0)
+ {
+ if (*root && !colon)
+ buf[buflen++] = PATHSEP;
+ strncpy(buf + buflen, rest, start_element);
+ buflen += start_element;
+ }
+ buf[buflen] = 0;
+
+ /*
+ * Did we reach the end of the string without hitting any wildcards?
+ */
+ if (c == 0)
+ {
+ /* Yes - add combined path to grow array and return. */
+ addfile(gap, buf, flags);
+ return 1;
+ }
+
+ if (start_element < 0 || !colon)
+ start_element++;
+ rest += start_element;
+
+ /*
+ * rest does contain wildcards if we get here.
+ *
+ * Now : have we reached the leaf names part yet?
+ * If so, add all matches (files and dirs) to gap.
+ * If not, get next path element and scan all matching directories.
+ */
+
+ start_element = -1;
+ for (i = 0; rest[i]; i++)
+ {
+ if (rest[i] == '.')
+ {
+ start_element = i;
+ rest[i] = 0; /* Break string here. */
+ break;
+ }
+ }
+
+ /* If start_element is -1 then we are matching leaf names */
+
+ r3 = 0; /* Number of objs read. */
+ dir_pos = 0; /* Position through directory. */
+ got = 0; /* Files added so far. */
+ while (dir_pos != -1)
+ {
+ buf[buflen] = 0;
+ if (xswi(OS_GBPB, 9,
+ buf, /* Directory to scan. */
+ buf + buflen + (1 - colon), /* Buffer for result. */
+ 1, /* Number of objects to read. */
+ dir_pos, /* Search position. */
+ MAXPATHL - 2 - buflen, /* Size of result buffer. */
+ rest) /* Wildcarded leafname. */
+ & v_flag)
+ {
+ EMSG(r0 + 4);
+ r4 = -1;
+ }
+ dir_pos = r4; /* r4 corrupted by addfile() */
+ if (r3 > 0)
+ {
+ char_u *path = buf;
+ if (buflen == 0)
+ path++; /* Don't do '.File' */
+ else if (!colon)
+ buf[buflen] = '.'; /* Join path and leaf */
+
+ /* Path -> full path of object found */
+ if (start_element == -1)
+ {
+ addfile(gap, path, flags);
+ got++;
+ }
+ else
+ {
+ /* Scan into subdirectories and images; ignore files */
+ swi(OS_File, 17, path);
+ if (r0 == 2 || r0 == 3)
+ got += expand_section(gap,
+ path,
+ rest + start_element + 1,
+ flags);
+ }
+ }
+ }
+
+ /* Restore the dot if we removed it. */
+ if (start_element >= 0)
+ rest[start_element] = '.';
+ return got;
+}
+
+/*
+ * mch_expand_wildcards() - this code does wild-card pattern matching using
+ * the shell. It isn't used under RISC OS.
+ *
+ * return OK for success, FAIL for error (you may lose some memory) and put
+ * an error message in *file.
+ *
+ * num_pat is number of input patterns
+ * pat is array of pointers to input patterns
+ * num_file is pointer to number of matched file names
+ * file is pointer to array of pointers to matched file names
+ */
+ int
+mch_expand_wildcards(num_pat, pat, num_file, file, flags)
+ int num_pat;
+ char_u **pat;
+ int *num_file;
+ char_u ***file;
+ int flags; /* EW_* flags */
+{
+ /* This doesn't get called unless SPECIAL_WILDCHAR is defined. */
+ return FAIL;
+}
+
+/*
+ * Return TRUE if "p" contains wildcards which can be expanded by
+ * mch_expandpath().
+ */
+ int
+mch_has_exp_wildcard(p)
+ char_u *p;
+{
+ if (vim_strpbrk((char_u *)"*#", p))
+ return TRUE;
+ return FALSE;
+}
+
+/* Return TRUE if "p" contains wildcards. */
+ int
+mch_has_wildcard(p)
+ char_u *p;
+{
+ if (vim_strpbrk((char_u *)"*#`", p))
+ return TRUE;
+ return FALSE;
+}
+
+ int /* see Unix unlink(2) */
+mch_remove(file)
+ char_u *file; /* Name of file to delete. */
+{
+ if (xswi(OS_FSControl, 27, file, 0, 0) & v_flag)
+ return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+}
+
+/* Try to make existing scripts work without modification.
+ * Return a pointer to the new string (freed by caller), or NULL
+ *
+ * Two main cases:
+ * - Absolute : $VIM/syntax/help.vim
+ * - Relative : Adfs::4.$.!Vim.Resources.Syntax/help.vim
+ */
+ char_u *
+mch_munge_fname(fname)
+ char_u *fname;
+{
+ char_u c;
+ int len;
+ char_u *retval;
+
+ retval = fname = vim_strsave(fname);
+ if (fname == NULL)
+ return NULL;
+
+ if (strncmp(fname, "$VIM/", 5) == 0)
+ {
+ strncpy(fname, "Vim:", 4);
+ for (fname += 5; c = *fname; fname++)
+ {
+ if (c == '.')
+ break;
+ if (c == '/')
+ fname[-1] = '.';
+ else
+ fname[-1] = c;
+ }
+ fname[-1] = '\0';
+ }
+ else
+ {
+ /* Check to see if the file exists without modification. */
+ if (xswi(OS_File, 17, fname) & v_flag)
+ r0 == 0; /* Invalid filename? */
+ if (r0)
+ return retval;
+
+ len = strlen(fname);
+ if (strcmp(fname + len - 4, ".vim") == 0)
+ {
+ fname[len - 4] = '\0';
+ for (; c = *fname; fname++)
+ {
+ if (c == '/')
+ *fname = '.';
+ }
+ }
+ }
+ return retval;
+}
+
+/* QuickFix reads munged names from the error file.
+ * Correct them.
+ */
+ int
+ro_buflist_add(old_name)
+ char_u *old_name; /* Name of file found by quickfix */
+{
+ char_u *fname;
+ char_u *leaf; /* Pointer to start of leaf in old_name */
+ char_u *ptr;
+ char_u c;
+ int retval;
+
+ if (old_name == NULL)
+ return buflist_add(NULL, 0);
+
+ /* Copy the name so we can mess around with it. */
+ fname = vim_strsave(old_name);
+ if (fname == NULL)
+ /* Out of memory - can't modify name */
+ return buflist_add(old_name, 0);
+
+ /* Change `dir/main.c' into `dir.c.main' */
+ leaf = fname;
+ for (ptr = fname; c = *ptr; ptr++)
+ {
+ if (c == '/')
+ {
+ leaf = ptr + 1;
+ *ptr = '.';
+ }
+ else if (c == '.')
+ break;
+ }
+ if (c == '.')
+ {
+ /* Change `main.c' into `c.main'
+ * | |
+ * leaf ptr
+ */
+ ptr += old_name - fname;
+ *ptr = '\0';
+ sprintf(leaf,
+ "%s.%s",
+ ptr + 1,
+ leaf - fname + old_name);
+ }
+
+ retval = buflist_add(fname, 0);
+ free(fname);
+ return retval;
+}
+
+/* Change the current directory.
+ * Strip trailing dots to make it easier to use with filename completion.
+ * Return 0 for success, -1 for failure.
+ */
+ int
+mch_chdir(dir)
+ char_u *dir;
+{
+ int length;
+ int retval;
+ char_u *new_dir;
+
+ length = strlen(dir);
+ if (dir[length - 1] != '.')
+ return chdir(dir); /* No trailing dots - nothing to do. */
+ new_dir = vim_strsave(dir);
+ if (new_dir == NULL)
+ return chdir(dir); /* Can't allocate memory. */
+
+ while (new_dir[--length] == '.')
+ new_dir[length] = '\0';
+
+ retval = chdir(new_dir);
+ vim_free(new_dir);
+ return retval;
+}
+
+/* Examine the named file, and set the 'osfiletype' option
+ * (in curbuf) to the file's type.
+ */
+ void
+mch_read_filetype(file)
+ char_u *file;
+{
+ int type;
+ char_u type_string[9];
+ int i;
+
+ if (xswi(OS_File, 23, file) & v_flag)
+ type = 0xfff; /* Default to Text */
+ else
+ type = r6;
+
+ /* Type is the numerical value - see if we have a textual equivalent */
+ swi(OS_FSControl, 18, 0, type);
+ ((int *) type_string)[0] = r2;
+ ((int *) type_string)[1] = r3;
+ type_string[8] = 0;
+ for (i = 0; type_string[i] > ' '; i++)
+ ;
+ type_string[i] = 0;
+
+ set_string_option_direct("osfiletype", -1, type_string, OPT_FREE);
+ return;
+}
+
+ void
+mch_set_filetype(file, type)
+ char_u *file;
+ char_u *type;
+{
+ if (xswi(OS_FSControl, 31, type) & v_flag)
+ {
+ EMSG(_("E366: Invalid 'osfiletype' option - using Text"));
+ r2 = 0xfff;
+ }
+
+ swi(OS_File, 18, file, r2);
+}
+
+/* Return TRUE if the file's type matches 'type'
+ * RISC OS types always start with '&'
+ */
+ int
+mch_check_filetype(fname, type)
+ char_u *fname;
+ char_u *type;
+{
+ int value;
+ char *end;
+
+ if (*type != '&')
+ return FALSE;
+
+ value = strtol(type + 1, &end, 16);
+ if (*end)
+ return FALSE; /* Invalid type (report error?) */
+
+ if (xswi(OS_File, 23, fname) & v_flag)
+ return FALSE; /* Invalid filename? */
+
+ return (r0 && r6 == value);
+}
diff --git a/src/os_riscos.h b/src/os_riscos.h
new file mode 100644
index 000000000..e7501d7f8
--- /dev/null
+++ b/src/os_riscos.h
@@ -0,0 +1,169 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <stdlib.h>
+#include <unixlib/local.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#define CASE_INSENSITIVE_FILENAME
+#define FEAT_MODIFY_FNAME
+#define FEAT_OSFILETYPE
+#define DFLT_OFT "Text"
+#define USE_TERM_CONSOLE
+#define HAVE_AVAIL_MEM
+
+/* Longer filenames now accessible to all */
+#ifndef BASENAMELEN
+# define BASENAMELEN 64 /* Same length as unzip */
+#endif
+
+#ifndef TEMNAME
+# define TEMPNAME "<Wimp$ScrapDir>.v?XXXXXX"
+# define TEMPNAMELEN 25
+#endif
+
+#ifndef DFLT_HELPFILE
+# define DFLT_HELPFILE "Vim:doc.help"
+#endif
+
+#ifndef DFLT_BDIR
+# define DFLT_BDIR ".,<Wimp$ScrapDir>." /* default for 'backupdir' */
+#endif
+
+/* Paths to try putting swap file in. */
+#ifndef DFLT_DIR
+# define DFLT_DIR "<Wimp$ScrapDir>.,." /* default for 'directory' */
+#endif
+
+#ifndef DFLT_VDIR
+# define DFLT_VDIR "Choices:Vim.view" /* default for 'viewdir' */
+#endif
+
+#ifndef TERMCAPFILE
+# define TERMCAPFILE "Vim:TermCap"
+#endif
+#define HAVE_TGETENT
+
+#ifndef SYNTAX_FNAME
+# define SYNTAX_FNAME "Vim:Syntax.%s"
+#endif
+
+#ifndef EVIM_FILE
+# define EVIM_FILE "Vim:Evim"
+#endif
+
+#define FEAT_VIMINFO
+
+#ifndef VIMINFO_FILE
+# define VIMINFO_FILE "<Choices$Write>.Vim.VimInfo"
+#endif
+#ifndef VIMINFO_FILE2
+# define VIMINFO_FILE2 "Choices:Vim.VimInfo"
+#endif
+
+#ifndef VIMRC_FILE
+# define VIMRC_FILE "/vimrc"
+#endif
+#ifndef EXRC_FILE
+# define EXRC_FILE "/exrc"
+#endif
+#ifndef GVIMRC_FILE
+# define GVIMRC_FILE "/gvimrc"
+#endif
+#ifndef VIEW_FILE
+# define VIEW_FILE "/View"
+#endif
+#ifndef USR_VIMRC_FILE
+# define USR_VIMRC_FILE "Vim:Evim"
+#endif
+#ifndef SESSION_FILE
+# define SESSION_FILE "/Session.vim"
+#endif
+#ifndef USR_VIMRC_FILE
+# define USR_VIMRC_FILE "Choices:Vim.VimRC"
+#endif
+#ifndef USR_GVIMRC_FILE
+# define USR_GVIMRC_FILE "Choices:Vim.GVimRC"
+#endif
+#ifndef USR_EXRC_FILE
+# define USR_EXRC_FILE "Choices:Vim.ExRC"
+#endif
+#ifndef SYS_VIMRC_FILE
+# define SYS_VIMRC_FILE "Vim:VimRC"
+#endif
+#ifndef SYS_GVIMRC_FILE
+# define SYS_GVIMRC_FILE "Vim:GVimRC"
+#endif
+#ifndef SYS_MENU_FILE
+# define SYS_MENU_FILE "Vim:Menu"
+#endif
+#ifndef SYS_OPTWIN_FILE
+# define SYS_OPTWIN_FILE "Vim:Optwin"
+#endif
+#ifndef FILETYPE_FILE
+# define FILETYPE_FILE "Vim:Filetype"
+#endif
+#ifndef FTPLUGIN_FILE
+# define FTPLUGIN_FILE "Vim:Ftplugin/vim"
+#endif
+#ifndef INDENT_FILE
+# define INDENT_FILE "Vim:Indent/vim"
+#endif
+#ifndef FTOFF_FILE
+# define FTOFF_FILE "Vim:Ftoff"
+#endif
+#ifndef FTPLUGOF_FILE
+# define FTPLUGOF_FILE "Vim:Ftplugof"
+#endif
+#ifndef INDOFF_FILE
+# define INDOFF_FILE "Vim:Indoff"
+#endif
+
+#define DFLT_ERRORFILE "errors/vim"
+#define DFLT_RUNTIMEPATH "Choices:Vim,Vim:,Choices:Vim.after"
+
+/*
+ * RISC PCs have plenty of memory, use large buffers
+ */
+#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
+#define MAXPATHL 256 /* paths are always quite short though */
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM (5*1024) /* use up to 5 Mbyte for a buffer */
+#endif
+
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT (10*1024) /* use up to 10 Mbyte for Vim */
+#endif
+
+#ifdef HAVE_SIGSET
+# define signal sigset
+#endif
+
+#define n_flag (1<<31)
+#define z_flag (1<<30)
+#define c_flag (1<<29)
+#define v_flag (1<<28)
+
+/* These take r0-r7 as inputs, returns r0-r7 in global variables. */
+void swi(int swinum, ...); /* Handles errors itself */
+int xswi(int swinum, ...); /* Returns errors using v flag */
+extern int r0, r1, r2, r3, r4, r5, r6, r7; /* For return values */
+
+#include <kernel.h>
+#include <swis.h>
+
+#define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
+#define mch_rename(src, dst) rename(src, dst)
+#define mch_getenv(x) (char_u *)getenv((char *)x)
+#define mch_setenv(name, val, x) setenv(name, val, x)
diff --git a/src/os_unix.c b/src/os_unix.c
new file mode 100644
index 000000000..b59d8ff5d
--- /dev/null
+++ b/src/os_unix.c
@@ -0,0 +1,6189 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * OS/2 port by Paul Slootman
+ * VMS merge by Zoltan Arpadffy
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * os_unix.c -- code for all flavors of Unix (BSD, SYSV, SVR4, POSIX, ...)
+ * Also for OS/2, using the excellent EMX package!!!
+ * Also for BeOS and Atari MiNT.
+ *
+ * A lot of this file was originally written by Juergen Weigert and later
+ * changed beyond recognition.
+ */
+
+/*
+ * Some systems have a prototype for select() that has (int *) instead of
+ * (fd_set *), which is wrong. This define removes that prototype. We define
+ * our own prototype below.
+ * Don't use it for the Mac, it causes a warning for precompiled headers.
+ * TODO: use a configure check for precompiled headers?
+ */
+#ifndef __APPLE__
+# define select select_declared_wrong
+#endif
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include "os_unixx.h" /* unix includes for os_unix.c only */
+
+#ifdef USE_XSMP
+# include <X11/SM/SMlib.h>
+#endif
+
+/*
+ * Use this prototype for select, some include files have a wrong prototype
+ */
+#undef select
+#ifdef __BEOS__
+# define select beos_select
+#endif
+
+#if defined(HAVE_SELECT)
+extern int select __ARGS((int, fd_set *, fd_set *, fd_set *, struct timeval *));
+#endif
+
+#ifdef FEAT_MOUSE_GPM
+# include <gpm.h>
+/* <linux/keyboard.h> contains defines conflicting with "keymap.h",
+ * I just copied relevant defines here. A cleaner solution would be to put gpm
+ * code into separate file and include there linux/keyboard.h
+ */
+/* #include <linux/keyboard.h> */
+# define KG_SHIFT 0
+# define KG_CTRL 2
+# define KG_ALT 3
+# define KG_ALTGR 1
+# define KG_SHIFTL 4
+# define KG_SHIFTR 5
+# define KG_CTRLL 6
+# define KG_CTRLR 7
+# define KG_CAPSSHIFT 8
+
+static void gpm_close __ARGS((void));
+static int gpm_open __ARGS((void));
+static int mch_gpm_process __ARGS((void));
+#endif
+
+/*
+ * end of autoconf section. To be extended...
+ */
+
+/* Are the following #ifdefs still required? And why? Is that for X11? */
+
+#if defined(ESIX) || defined(M_UNIX) && !defined(SCO)
+# ifdef SIGWINCH
+# undef SIGWINCH
+# endif
+# ifdef TIOCGWINSZ
+# undef TIOCGWINSZ
+# endif
+#endif
+
+#if defined(SIGWINDOW) && !defined(SIGWINCH) /* hpux 9.01 has it */
+# define SIGWINCH SIGWINDOW
+#endif
+
+#ifdef FEAT_X11
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+# include <X11/Xatom.h>
+# ifdef FEAT_XCLIPBOARD
+# include <X11/Intrinsic.h>
+# include <X11/Shell.h>
+# include <X11/StringDefs.h>
+static Widget xterm_Shell = (Widget)0;
+static void xterm_update __ARGS((void));
+# endif
+
+# if defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE)
+Window x11_window = 0;
+# endif
+Display *x11_display = NULL;
+
+# ifdef FEAT_TITLE
+static int get_x11_windis __ARGS((void));
+static void set_x11_title __ARGS((char_u *));
+static void set_x11_icon __ARGS((char_u *));
+# endif
+#endif
+
+#ifdef FEAT_TITLE
+static int get_x11_title __ARGS((int));
+static int get_x11_icon __ARGS((int));
+
+static char_u *oldtitle = NULL;
+static int did_set_title = FALSE;
+static char_u *oldicon = NULL;
+static int did_set_icon = FALSE;
+#endif
+
+static void may_core_dump __ARGS((void));
+
+static int WaitForChar __ARGS((long));
+#if defined(__BEOS__)
+int RealWaitForChar __ARGS((int, long, int *));
+#else
+static int RealWaitForChar __ARGS((int, long, int *));
+#endif
+
+#ifdef FEAT_XCLIPBOARD
+static int do_xterm_trace __ARGS((void));
+#define XT_TRACE_DELAY 50 /* delay for xterm tracing */
+#endif
+
+static void handle_resize __ARGS((void));
+
+#if defined(SIGWINCH)
+static RETSIGTYPE sig_winch __ARGS(SIGPROTOARG);
+#endif
+#if defined(SIGINT)
+static RETSIGTYPE catch_sigint __ARGS(SIGPROTOARG);
+#endif
+#if defined(SIGPWR)
+static RETSIGTYPE catch_sigpwr __ARGS(SIGPROTOARG);
+#endif
+#if defined(SIGALRM) && defined(FEAT_X11) \
+ && defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK)
+# define SET_SIG_ALARM
+static RETSIGTYPE sig_alarm __ARGS(SIGPROTOARG);
+static int sig_alarm_called;
+#endif
+static RETSIGTYPE deathtrap __ARGS(SIGPROTOARG);
+
+static void set_signals __ARGS((void));
+static void catch_signals __ARGS((RETSIGTYPE (*func_deadly)(), RETSIGTYPE (*func_other)()));
+#ifndef __EMX__
+static int have_wildcard __ARGS((int, char_u **));
+static int have_dollars __ARGS((int, char_u **));
+#endif
+
+#ifndef NO_EXPANDPATH
+static int pstrcmp __ARGS((const void *, const void *));
+static int unix_expandpath __ARGS((garray_T *gap, char_u *path, int wildoff, int flags));
+#endif
+
+#ifndef __EMX__
+static int save_patterns __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file));
+#endif
+
+#ifndef SIG_ERR
+# define SIG_ERR ((RETSIGTYPE (*)())-1)
+#endif
+
+static int do_resize = FALSE;
+#ifndef __EMX__
+static char_u *extra_shell_arg = NULL;
+static int show_shell_mess = TRUE;
+#endif
+static int deadly_signal = 0; /* The signal we caught */
+
+static int curr_tmode = TMODE_COOK; /* contains current terminal mode */
+
+#ifdef USE_XSMP
+typedef struct
+{
+ SmcConn smcconn; /* The SM connection ID */
+ IceConn iceconn; /* The ICE connection ID */
+ Bool save_yourself; /* If we're in the middle of a save_yourself */
+ Bool shutdown; /* If we're in shutdown mode */
+} xsmp_config_T;
+
+static xsmp_config_T xsmp;
+#endif
+
+#ifdef SYS_SIGLIST_DECLARED
+/*
+ * I have seen
+ * extern char *_sys_siglist[NSIG];
+ * on Irix, Linux, NetBSD and Solaris. It contains a nice list of strings
+ * that describe the signals. That is nearly what we want here. But
+ * autoconf does only check for sys_siglist (without the underscore), I
+ * do not want to change everything today.... jw.
+ * This is why AC_DECL_SYS_SIGLIST is commented out in configure.in
+ */
+#endif
+
+static struct signalinfo
+{
+ int sig; /* Signal number, eg. SIGSEGV etc */
+ char *name; /* Signal name (not char_u!). */
+ char deadly; /* Catch as a deadly signal? */
+} signal_info[] =
+{
+#ifdef SIGHUP
+ {SIGHUP, "HUP", TRUE},
+#endif
+#ifdef SIGQUIT
+ {SIGQUIT, "QUIT", TRUE},
+#endif
+#ifdef SIGILL
+ {SIGILL, "ILL", TRUE},
+#endif
+#ifdef SIGTRAP
+ {SIGTRAP, "TRAP", TRUE},
+#endif
+#ifdef SIGABRT
+ {SIGABRT, "ABRT", TRUE},
+#endif
+#ifdef SIGEMT
+ {SIGEMT, "EMT", TRUE},
+#endif
+#ifdef SIGFPE
+ {SIGFPE, "FPE", TRUE},
+#endif
+#ifdef SIGBUS
+ {SIGBUS, "BUS", TRUE},
+#endif
+#ifdef SIGSEGV
+ {SIGSEGV, "SEGV", TRUE},
+#endif
+#ifdef SIGSYS
+ {SIGSYS, "SYS", TRUE},
+#endif
+#ifdef SIGALRM
+ {SIGALRM, "ALRM", FALSE}, /* Perl's alarm() can trigger it */
+#endif
+#ifdef SIGTERM
+ {SIGTERM, "TERM", TRUE},
+#endif
+#ifdef SIGVTALRM
+ {SIGVTALRM, "VTALRM", TRUE},
+#endif
+#ifdef SIGPROF
+ {SIGPROF, "PROF", TRUE},
+#endif
+#ifdef SIGXCPU
+ {SIGXCPU, "XCPU", TRUE},
+#endif
+#ifdef SIGXFSZ
+ {SIGXFSZ, "XFSZ", TRUE},
+#endif
+#ifdef SIGUSR1
+ {SIGUSR1, "USR1", TRUE},
+#endif
+#ifdef SIGUSR2
+ {SIGUSR2, "USR2", TRUE},
+#endif
+#ifdef SIGINT
+ {SIGINT, "INT", FALSE},
+#endif
+#ifdef SIGWINCH
+ {SIGWINCH, "WINCH", FALSE},
+#endif
+#ifdef SIGTSTP
+ {SIGTSTP, "TSTP", FALSE},
+#endif
+#ifdef SIGPIPE
+ {SIGPIPE, "PIPE", FALSE},
+#endif
+ {-1, "Unknown!", FALSE}
+};
+
+ void
+mch_write(s, len)
+ char_u *s;
+ int len;
+{
+ write(1, (char *)s, len);
+ if (p_wd) /* Unix is too fast, slow down a bit more */
+ RealWaitForChar(read_cmd_fd, p_wd, NULL);
+}
+
+/*
+ * mch_inchar(): low level input funcion.
+ * Get a characters from the keyboard.
+ * Return the number of characters that are available.
+ * If wtime == 0 do not wait for characters.
+ * If wtime == n wait a short time for characters.
+ * If wtime == -1 wait forever for characters.
+ */
+ int
+mch_inchar(buf, maxlen, wtime, tb_change_cnt)
+ char_u *buf;
+ int maxlen;
+ long wtime; /* don't use "time", MIPS cannot handle it */
+ int tb_change_cnt;
+{
+ int len;
+#ifdef FEAT_AUTOCMD
+ static int once_already = 0;
+#endif
+
+ /* Check if window changed size while we were busy, perhaps the ":set
+ * columns=99" command was used. */
+ while (do_resize)
+ handle_resize();
+
+ if (wtime >= 0)
+ {
+ while (WaitForChar(wtime) == 0) /* no character available */
+ {
+ if (!do_resize) /* return if not interrupted by resize */
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return 0;
+ }
+ handle_resize();
+ }
+ }
+ else /* wtime == -1 */
+ {
+#ifdef FEAT_AUTOCMD
+ if (once_already == 2)
+ updatescript(0);
+ else if (once_already == 1)
+ {
+ setcursor();
+ once_already = 2;
+ return 0;
+ }
+ else
+#endif
+ /*
+ * If there is no character available within 'updatetime' seconds
+ * flush all the swap files to disk
+ * Also done when interrupted by SIGWINCH.
+ */
+ if (WaitForChar(p_ut) == 0)
+ {
+#ifdef FEAT_AUTOCMD
+ if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
+ {
+ apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
+ update_screen(VALID);
+ once_already = 1;
+ return 0;
+ }
+ else
+#endif
+ updatescript(0);
+ }
+ }
+
+ for (;;) /* repeat until we got a character */
+ {
+ while (do_resize) /* window changed size */
+ handle_resize();
+ /*
+ * we want to be interrupted by the winch signal
+ */
+ WaitForChar(-1L);
+ if (do_resize) /* interrupted by SIGWINCH signal */
+ continue;
+
+ /* If input was put directly in typeahead buffer bail out here. */
+ if (typebuf_changed(tb_change_cnt))
+ return 0;
+
+ /*
+ * For some terminals we only get one character at a time.
+ * We want the get all available characters, so we could keep on
+ * trying until none is available
+ * For some other terminals this is quite slow, that's why we don't do
+ * it.
+ */
+ len = read_from_input_buf(buf, (long)maxlen);
+ if (len > 0)
+ {
+#ifdef OS2
+ int i;
+
+ for (i = 0; i < len; i++)
+ if (buf[i] == 0)
+ buf[i] = K_NUL;
+#endif
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return len;
+ }
+ }
+}
+
+ static void
+handle_resize()
+{
+ do_resize = FALSE;
+ shell_resized();
+}
+
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail()
+{
+ return WaitForChar(0L);
+}
+
+#if defined(HAVE_TOTAL_MEM) || defined(PROTO)
+# ifdef HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+# endif
+# if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL)
+# include <sys/sysctl.h>
+# endif
+# if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
+# include <sys/sysinfo.h>
+# endif
+
+/*
+ * Return total amount of memory available. Doesn't change when memory has
+ * been allocated.
+ */
+/* ARGSUSED */
+ long_u
+mch_total_mem(special)
+ int special;
+{
+# ifdef __EMX__
+ return ulimit(3, 0L); /* always 32MB? */
+# else
+ long_u mem = 0;
+
+# ifdef HAVE_SYSCTL
+ int mib[2], physmem;
+ size_t len;
+
+ /* BSD way of getting the amount of RAM available. */
+ mib[0] = CTL_HW;
+ mib[1] = HW_USERMEM;
+ len = sizeof(physmem);
+ if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0)
+ mem = (long_u)physmem;
+# endif
+
+# if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
+ if (mem == 0)
+ {
+ struct sysinfo sinfo;
+
+ /* Linux way of getting amount of RAM available */
+ if (sysinfo(&sinfo) == 0)
+ mem = sinfo.totalram;
+ }
+# endif
+
+# ifdef HAVE_SYSCONF
+ if (mem == 0)
+ {
+ long pagesize, pagecount;
+
+ /* Solaris way of getting amount of RAM available */
+ pagesize = sysconf(_SC_PAGESIZE);
+ pagecount = sysconf(_SC_PHYS_PAGES);
+ if (pagesize > 0 && pagecount > 0)
+ mem = (long_u)pagesize * pagecount;
+ }
+# endif
+
+ /* Return the minimum of the physical memory and the user limit, because
+ * using more than the user limit may cause Vim to be terminated. */
+# if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)
+ {
+ struct rlimit rlp;
+
+ if (getrlimit(RLIMIT_DATA, &rlp) == 0
+ && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
+# ifdef RLIM_INFINITY
+ && rlp.rlim_cur != RLIM_INFINITY
+# endif
+ && (long_u)rlp.rlim_cur < mem
+ )
+ return (long_u)rlp.rlim_cur;
+ }
+# endif
+
+ if (mem > 0)
+ return mem;
+ return (long_u)0x7fffffff;
+# endif
+}
+#endif
+
+ void
+mch_delay(msec, ignoreinput)
+ long msec;
+ int ignoreinput;
+{
+ int old_tmode;
+
+ if (ignoreinput)
+ {
+ /* Go to cooked mode without echo, to allow SIGINT interrupting us
+ * here */
+ old_tmode = curr_tmode;
+ if (curr_tmode == TMODE_RAW)
+ settmode(TMODE_SLEEP);
+
+ /*
+ * Everybody sleeps in a different way...
+ * Prefer nanosleep(), some versions of usleep() can only sleep up to
+ * one second.
+ */
+#ifdef HAVE_NANOSLEEP
+ {
+ struct timespec ts;
+
+ ts.tv_sec = msec / 1000;
+ ts.tv_nsec = (msec % 1000) * 1000000;
+ (void)nanosleep(&ts, NULL);
+ }
+#else
+# ifdef HAVE_USLEEP
+ while (msec >= 1000)
+ {
+ usleep((unsigned int)(999 * 1000));
+ msec -= 999;
+ }
+ usleep((unsigned int)(msec * 1000));
+# else
+# ifndef HAVE_SELECT
+ poll(NULL, 0, (int)msec);
+# else
+# ifdef __EMX__
+ _sleep2(msec);
+# else
+ {
+ struct timeval tv;
+
+ tv.tv_sec = msec / 1000;
+ tv.tv_usec = (msec % 1000) * 1000;
+ /*
+ * NOTE: Solaris 2.6 has a bug that makes select() hang here. Get
+ * a patch from Sun to fix this. Reported by Gunnar Pedersen.
+ */
+ select(0, NULL, NULL, NULL, &tv);
+ }
+# endif /* __EMX__ */
+# endif /* HAVE_SELECT */
+# endif /* HAVE_NANOSLEEP */
+#endif /* HAVE_USLEEP */
+
+ settmode(old_tmode);
+ }
+ else
+ WaitForChar(msec);
+}
+
+#if defined(HAVE_GETRLIMIT) \
+ || (!defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGSTACK))
+# define HAVE_CHECK_STACK_GROWTH
+/*
+ * Support for checking for an almost-out-of-stack-space situation.
+ */
+
+/*
+ * Return a pointer to an item on the stack. Used to find out if the stack
+ * grows up or down.
+ */
+static void check_stack_growth __ARGS((char *p));
+static int stack_grows_downwards;
+
+/*
+ * Find out if the stack grows upwards or downwards.
+ * "p" points to a variable on the stack of the caller.
+ */
+ static void
+check_stack_growth(p)
+ char *p;
+{
+ int i;
+
+ stack_grows_downwards = (p > (char *)&i);
+}
+#endif
+
+#if defined(HAVE_GETRLIMIT) || defined(PROTO)
+static char *stack_limit = NULL;
+
+#if defined(_THREAD_SAFE) && defined(HAVE_PTHREAD_NP_H)
+# include <pthread.h>
+# include <pthread_np.h>
+#endif
+
+/*
+ * Find out until how var the stack can grow without getting into trouble.
+ * Called when starting up and when switching to the signal stack in
+ * deathtrap().
+ */
+ static void
+get_stack_limit()
+{
+ struct rlimit rlp;
+ int i;
+ long lim;
+
+ /* Set the stack limit to 15/16 of the allowable size. Skip this when the
+ * limit doesn't fit in a long (rlim_cur might be "long long"). */
+ if (getrlimit(RLIMIT_STACK, &rlp) == 0
+ && rlp.rlim_cur < ((rlim_t)1 << (sizeof(long_u) * 8 - 1))
+# ifdef RLIM_INFINITY
+ && rlp.rlim_cur != RLIM_INFINITY
+# endif
+ )
+ {
+ lim = (long)rlp.rlim_cur;
+#if defined(_THREAD_SAFE) && defined(HAVE_PTHREAD_NP_H)
+ {
+ pthread_attr_t attr;
+ size_t size;
+
+ /* On FreeBSD the initial thread always has a fixed stack size, no
+ * matter what the limits are set to. Normally it's 1 Mbyte. */
+ pthread_attr_init(&attr);
+ if (pthread_attr_get_np(pthread_self(), &attr) == 0)
+ {
+ pthread_attr_getstacksize(&attr, &size);
+ if (lim > (long)size)
+ lim = (long)size;
+ }
+ pthread_attr_destroy(&attr);
+ }
+#endif
+ if (stack_grows_downwards)
+ {
+ stack_limit = (char *)((long)&i - (lim / 16L * 15L));
+ if (stack_limit >= (char *)&i)
+ /* overflow, set to 1/16 of current stack position */
+ stack_limit = (char *)((long)&i / 16L);
+ }
+ else
+ {
+ stack_limit = (char *)((long)&i + (lim / 16L * 15L));
+ if (stack_limit <= (char *)&i)
+ stack_limit = NULL; /* overflow */
+ }
+ }
+}
+
+/*
+ * Return FAIL when running out of stack space.
+ * "p" must point to any variable local to the caller that's on the stack.
+ */
+ int
+mch_stackcheck(p)
+ char *p;
+{
+ if (stack_limit != NULL)
+ {
+ if (stack_grows_downwards)
+ {
+ if (p < stack_limit)
+ return FAIL;
+ }
+ else if (p > stack_limit)
+ return FAIL;
+ }
+ return OK;
+}
+#endif
+
+#if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
+/*
+ * Support for using the signal stack.
+ * This helps when we run out of stack space, which causes a SIGSEGV. The
+ * signal handler then must run on another stack, since the normal stack is
+ * completely full.
+ */
+
+#ifndef SIGSTKSZ
+# define SIGSTKSZ 8000 /* just a guess of how much stack is needed... */
+#endif
+
+# ifdef HAVE_SIGALTSTACK
+static stack_t sigstk; /* for sigaltstack() */
+# else
+static struct sigstack sigstk; /* for sigstack() */
+# endif
+
+static void init_signal_stack __ARGS((void));
+static char *signal_stack;
+
+ static void
+init_signal_stack()
+{
+ if (signal_stack != NULL)
+ {
+# ifdef HAVE_SIGALTSTACK
+# ifdef __APPLE__
+ /* missing prototype. Adding it to osdef?.h.in doesn't work, because
+ * "struct sigaltstack" needs to be declared. */
+ extern int sigaltstack __ARGS((const struct sigaltstack *ss, struct sigaltstack *oss));
+# endif
+
+# ifdef HAVE_SS_BASE
+ sigstk.ss_base = signal_stack;
+# else
+ sigstk.ss_sp = signal_stack;
+# endif
+ sigstk.ss_size = SIGSTKSZ;
+ sigstk.ss_flags = 0;
+ (void)sigaltstack(&sigstk, NULL);
+# else
+ sigstk.ss_sp = signal_stack;
+ if (stack_grows_downwards)
+ sigstk.ss_sp += SIGSTKSZ - 1;
+ sigstk.ss_onstack = 0;
+ (void)sigstack(&sigstk, NULL);
+# endif
+ }
+}
+#endif
+
+/*
+ * We need correct potatotypes for a signal function, otherwise mean compilers
+ * will barf when the second argument to signal() is ``wrong''.
+ * Let me try it with a few tricky defines from my own osdef.h (jw).
+ */
+#if defined(SIGWINCH)
+/* ARGSUSED */
+ static RETSIGTYPE
+sig_winch SIGDEFARG(sigarg)
+{
+ /* this is not required on all systems, but it doesn't hurt anybody */
+ signal(SIGWINCH, (RETSIGTYPE (*)())sig_winch);
+ do_resize = TRUE;
+ SIGRETURN;
+}
+#endif
+
+#if defined(SIGINT)
+/* ARGSUSED */
+ static RETSIGTYPE
+catch_sigint SIGDEFARG(sigarg)
+{
+ /* this is not required on all systems, but it doesn't hurt anybody */
+ signal(SIGINT, (RETSIGTYPE (*)())catch_sigint);
+ got_int = TRUE;
+ SIGRETURN;
+}
+#endif
+
+#if defined(SIGPWR)
+/* ARGSUSED */
+ static RETSIGTYPE
+catch_sigpwr SIGDEFARG(sigarg)
+{
+ /*
+ * I'm not sure we get the SIGPWR signal when the system is really going
+ * down or when the batteries are almost empty. Just preserve the swap
+ * files and don't exit, that can't do any harm.
+ */
+ ml_sync_all(FALSE, FALSE);
+ SIGRETURN;
+}
+#endif
+
+#ifdef SET_SIG_ALARM
+/*
+ * signal function for alarm().
+ */
+/* ARGSUSED */
+ static RETSIGTYPE
+sig_alarm SIGDEFARG(sigarg)
+{
+ /* doesn't do anything, just to break a system call */
+ sig_alarm_called = TRUE;
+ SIGRETURN;
+}
+#endif
+
+#if defined(HAVE_SETJMP_H) || defined(PROTO)
+/*
+ * A simplistic version of setjmp() that only allows one level of using.
+ * Don't call twice before calling mch_endjmp()!.
+ * Usage:
+ * mch_startjmp();
+ * if (SETJMP(lc_jump_env) != 0)
+ * {
+ * mch_didjmp();
+ * EMSG("crash!");
+ * }
+ * else
+ * {
+ * do_the_work;
+ * mch_endjmp();
+ * }
+ * Note: Can't move SETJMP() here, because a function calling setjmp() must
+ * not return before the saved environment is used.
+ * Returns OK for normal return, FAIL when the protected code caused a
+ * problem and LONGJMP() was used.
+ */
+ void
+mch_startjmp()
+{
+#ifdef SIGHASARG
+ lc_signal = 0;
+#endif
+ lc_active = TRUE;
+}
+
+ void
+mch_endjmp()
+{
+ lc_active = FALSE;
+}
+
+ void
+mch_didjmp()
+{
+# if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
+ /* On FreeBSD the signal stack has to be reset after using siglongjmp(),
+ * otherwise catching the signal only works once. */
+ init_signal_stack();
+# endif
+}
+#endif
+
+/*
+ * This function handles deadly signals.
+ * It tries to preserve any swap file and exit properly.
+ * (partly from Elvis).
+ */
+ static RETSIGTYPE
+deathtrap SIGDEFARG(sigarg)
+{
+ static int entered = 0; /* count the number of times we got here.
+ Note: when memory has been corrupted
+ this may get an arbitrary value! */
+#ifdef SIGHASARG
+ int i;
+#endif
+
+#if defined(HAVE_SETJMP_H)
+ /*
+ * Catch a crash in protected code.
+ * Restores the environment saved in lc_jump_env, which looks like
+ * SETJMP() returns 1.
+ */
+ if (lc_active)
+ {
+# if defined(SIGHASARG)
+ lc_signal = sigarg;
+# endif
+ lc_active = FALSE; /* don't jump again */
+ LONGJMP(lc_jump_env, 1);
+ /* NOTREACHED */
+ }
+#endif
+
+ /* Remember how often we have been called. */
+ ++entered;
+
+#ifdef FEAT_EVAL
+ /* Set the v:dying variable. */
+ set_vim_var_nr(VV_DYING, (long)entered);
+#endif
+
+#ifdef HAVE_GETRLIMIT
+ /* Since we are now using the signal stack, need to reset the stack
+ * limit. Otherwise using a regexp will fail. */
+ get_stack_limit();
+#endif
+
+#ifdef SIGHASARG
+ /* try to find the name of this signal */
+ for (i = 0; signal_info[i].sig != -1; i++)
+ if (sigarg == signal_info[i].sig)
+ break;
+ deadly_signal = sigarg;
+#endif
+
+ full_screen = FALSE; /* don't write message to the GUI, it might be
+ * part of the problem... */
+ /*
+ * If something goes wrong after entering here, we may get here again.
+ * When this happens, give a message and try to exit nicely (resetting the
+ * terminal mode, etc.)
+ * When this happens twice, just exit, don't even try to give a message,
+ * stack may be corrupt or something weird.
+ * When this still happens again (or memory was corrupted in such a way
+ * that "entered" was clobbered) use _exit(), don't try freeing resources.
+ */
+ if (entered >= 3)
+ {
+ reset_signals(); /* don't catch any signals anymore */
+ may_core_dump();
+ if (entered >= 4)
+ _exit(8);
+ exit(7);
+ }
+ if (entered == 2)
+ {
+ OUT_STR(_("Vim: Double signal, exiting\n"));
+ out_flush();
+ getout(1);
+ }
+
+#ifdef SIGHASARG
+ sprintf((char *)IObuff, _("Vim: Caught deadly signal %s\n"),
+ signal_info[i].name);
+#else
+ sprintf((char *)IObuff, _("Vim: Caught deadly signal\n"));
+#endif
+ preserve_exit(); /* preserve files and exit */
+
+ SIGRETURN;
+}
+
+#ifdef _REENTRANT
+/*
+ * On Solaris with multi-threading, suspending might not work immediately.
+ * Catch the SIGCONT signal, which will be used as an indication whether the
+ * suspending has been done or not.
+ */
+static int sigcont_received;
+static RETSIGTYPE sigcont_handler __ARGS(SIGPROTOARG);
+
+/*
+ * signal handler for SIGCONT
+ */
+/* ARGSUSED */
+ static RETSIGTYPE
+sigcont_handler SIGDEFARG(sigarg)
+{
+ sigcont_received = TRUE;
+ SIGRETURN;
+}
+#endif
+
+/*
+ * If the machine has job control, use it to suspend the program,
+ * otherwise fake it by starting a new shell.
+ */
+ void
+mch_suspend()
+{
+ /* BeOS does have SIGTSTP, but it doesn't work. */
+#if defined(SIGTSTP) && !defined(__BEOS__)
+ out_flush(); /* needed to make cursor visible on some systems */
+ settmode(TMODE_COOK);
+ out_flush(); /* needed to disable mouse on some systems */
+
+# if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
+ /* Since we are going to sleep, we can't respond to requests for the X
+ * selections. Lose them, otherwise other applications will hang. But
+ * first copy the text to cut buffer 0. */
+ if (clip_star.owned || clip_plus.owned)
+ {
+ x11_export_final_selection();
+ if (clip_star.owned)
+ clip_lose_selection(&clip_star);
+ if (clip_plus.owned)
+ clip_lose_selection(&clip_plus);
+ if (x11_display != NULL)
+ XFlush(x11_display);
+ }
+# endif
+
+# ifdef _REENTRANT
+ sigcont_received = FALSE;
+# endif
+ kill(0, SIGTSTP); /* send ourselves a STOP signal */
+# ifdef _REENTRANT
+ /* When we didn't suspend immediately in the kill(), do it now. Happens
+ * on multi-threaded Solaris. */
+ if (!sigcont_received)
+ pause();
+# endif
+
+# ifdef FEAT_TITLE
+ /*
+ * Set oldtitle to NULL, so the current title is obtained again.
+ */
+ vim_free(oldtitle);
+ oldtitle = NULL;
+# endif
+ settmode(TMODE_RAW);
+ need_check_timestamps = TRUE;
+ did_check_timestamps = FALSE;
+#else
+ suspend_shell();
+#endif
+}
+
+ void
+mch_init()
+{
+ Columns = 80;
+ Rows = 24;
+
+ out_flush();
+ set_signals();
+}
+
+ static void
+set_signals()
+{
+#if defined(SIGWINCH)
+ /*
+ * WINDOW CHANGE signal is handled with sig_winch().
+ */
+ signal(SIGWINCH, (RETSIGTYPE (*)())sig_winch);
+#endif
+
+ /*
+ * We want the STOP signal to work, to make mch_suspend() work.
+ * For "rvim" the STOP signal is ignored.
+ */
+#ifdef SIGTSTP
+ signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
+#endif
+#ifdef _REENTRANT
+ signal(SIGCONT, sigcont_handler);
+#endif
+
+ /*
+ * We want to ignore breaking of PIPEs.
+ */
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+#endif
+
+ /*
+ * We want to catch CTRL-C (only works while in Cooked mode).
+ */
+#ifdef SIGINT
+ signal(SIGINT, (RETSIGTYPE (*)())catch_sigint);
+#endif
+
+ /*
+ * Ignore alarm signals (Perl's alarm() generates it).
+ */
+#ifdef SIGALRM
+ signal(SIGALRM, SIG_IGN);
+#endif
+
+ /*
+ * Catch SIGPWR (power failure?) to preserve the swap files, so that no
+ * work will be lost.
+ */
+#ifdef SIGPWR
+ signal(SIGPWR, (RETSIGTYPE (*)())catch_sigpwr);
+#endif
+
+ /*
+ * Arrange for other signals to gracefully shutdown Vim.
+ */
+ catch_signals(deathtrap, SIG_ERR);
+
+#if defined(FEAT_GUI) && defined(SIGHUP)
+ /*
+ * When the GUI is running, ignore the hangup signal.
+ */
+ if (gui.in_use)
+ signal(SIGHUP, SIG_IGN);
+#endif
+}
+
+ void
+reset_signals()
+{
+ catch_signals(SIG_DFL, SIG_DFL);
+#ifdef _REENTRANT
+ /* SIGCONT isn't in the list, because its default action is ignore */
+ signal(SIGCONT, SIG_DFL);
+#endif
+}
+
+ static void
+catch_signals(func_deadly, func_other)
+ RETSIGTYPE (*func_deadly)();
+ RETSIGTYPE (*func_other)();
+{
+ int i;
+
+ for (i = 0; signal_info[i].sig != -1; i++)
+ if (signal_info[i].deadly)
+ {
+#if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION)
+ struct sigaction sa;
+
+ /* Setup to use the alternate stack for the signal function. */
+ sa.sa_handler = func_deadly;
+ sigemptyset(&sa.sa_mask);
+# if defined(__linux__) && defined(_REENTRANT)
+ /* On Linux, with glibc compiled for kernel 2.2, there is a bug in
+ * thread handling in combination with using the alternate stack:
+ * pthread library functions try to use the stack pointer to
+ * identify the current thread, causing a SEGV signal, which
+ * recursively calls deathtrap() and hangs. */
+ sa.sa_flags = 0;
+# else
+ sa.sa_flags = SA_ONSTACK;
+# endif
+ sigaction(signal_info[i].sig, &sa, NULL);
+#else
+# if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGVEC)
+ struct sigvec sv;
+
+ /* Setup to use the alternate stack for the signal function. */
+ sv.sv_handler = func_deadly;
+ sv.sv_mask = 0;
+ sv.sv_flags = SV_ONSTACK;
+ sigvec(signal_info[i].sig, &sv, NULL);
+# else
+ signal(signal_info[i].sig, func_deadly);
+# endif
+#endif
+ }
+ else if (func_other != SIG_ERR)
+ signal(signal_info[i].sig, func_other);
+}
+
+/*
+ * Check_win checks whether we have an interactive stdout.
+ */
+/* ARGSUSED */
+ int
+mch_check_win(argc, argv)
+ int argc;
+ char **argv;
+{
+#ifdef OS2
+ /*
+ * Store argv[0], may be used for $VIM. Only use it if it is an absolute
+ * name, mostly it's just "vim" and found in the path, which is unusable.
+ */
+ if (mch_isFullName(argv[0]))
+ exe_name = vim_strsave((char_u *)argv[0]);
+#endif
+ if (isatty(1))
+ return OK;
+ return FAIL;
+}
+
+/*
+ * Return TRUE if the input comes from a terminal, FALSE otherwise.
+ */
+ int
+mch_input_isatty()
+{
+ if (isatty(read_cmd_fd))
+ return TRUE;
+ return FALSE;
+}
+
+#ifdef FEAT_X11
+
+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) \
+ && (defined(FEAT_XCLIPBOARD) || defined(FEAT_TITLE))
+
+static void xopen_message __ARGS((struct timeval *tvp));
+
+/*
+ * Give a message about the elapsed time for opening the X window.
+ */
+ static void
+xopen_message(tvp)
+ struct timeval *tvp; /* must contain start time */
+{
+ struct timeval end_tv;
+
+ /* Compute elapsed time. */
+ gettimeofday(&end_tv, NULL);
+ smsg((char_u *)_("Opening the X display took %ld msec"),
+ (end_tv.tv_sec - tvp->tv_sec) * 1000L
+ + (end_tv.tv_usec - tvp->tv_usec) / 1000L);
+}
+# endif
+#endif
+
+#if defined(FEAT_X11) && (defined(FEAT_TITLE) || defined(FEAT_XCLIPBOARD))
+/*
+ * A few functions shared by X11 title and clipboard code.
+ */
+static int x_error_handler __ARGS((Display *dpy, XErrorEvent *error_event));
+static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event));
+static int x_connect_to_server __ARGS((void));
+static int test_x11_window __ARGS((Display *dpy));
+
+static int got_x_error = FALSE;
+
+/*
+ * X Error handler, otherwise X just exits! (very rude) -- webb
+ */
+ static int
+x_error_handler(dpy, error_event)
+ Display *dpy;
+ XErrorEvent *error_event;
+{
+ XGetErrorText(dpy, error_event->error_code, (char *)IObuff, IOSIZE);
+ STRCAT(IObuff, _("\nVim: Got X error\n"));
+
+ /* We cannot print a message and continue, because no X calls are allowed
+ * here (causes my system to hang). Silently continuing might be an
+ * alternative... */
+ preserve_exit(); /* preserve files and exit */
+
+ return 0; /* NOTREACHED */
+}
+
+/*
+ * Another X Error handler, just used to check for errors.
+ */
+/* ARGSUSED */
+ static int
+x_error_check(dpy, error_event)
+ Display *dpy;
+ XErrorEvent *error_event;
+{
+ got_x_error = TRUE;
+ return 0;
+}
+
+#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
+# if defined(HAVE_SETJMP_H)
+/*
+ * An X IO Error handler, used to catch error while opening the display.
+ */
+static int x_IOerror_check __ARGS((Display *dpy));
+
+/* ARGSUSED */
+ static int
+x_IOerror_check(dpy)
+ Display *dpy;
+{
+ /* This function should not return, it causes exit(). Longjump instead. */
+ LONGJMP(lc_jump_env, 1);
+ /*NOTREACHED*/
+ return 0;
+}
+# endif
+
+/*
+ * An X IO Error handler, used to catch terminal errors.
+ */
+static int x_IOerror_handler __ARGS((Display *dpy));
+
+/* ARGSUSED */
+ static int
+x_IOerror_handler(dpy)
+ Display *dpy;
+{
+ xterm_dpy = NULL;
+ x11_window = 0;
+ x11_display = NULL;
+ xterm_Shell = (Widget)0;
+
+ /* This function should not return, it causes exit(). Longjump instead. */
+ LONGJMP(x_jump_env, 1);
+ /*NOTREACHED*/
+ return 0;
+}
+#endif
+
+/*
+ * Return TRUE when connection to the X server is desired.
+ */
+ static int
+x_connect_to_server()
+{
+ regmatch_T regmatch;
+
+#if defined(FEAT_CLIENTSERVER)
+ if (x_force_connect)
+ return TRUE;
+#endif
+ if (x_no_connect)
+ return FALSE;
+
+ /* Check for a match with "exclude:" from 'clipboard'. */
+ if (clip_exclude_prog != NULL)
+ {
+ regmatch.rm_ic = FALSE; /* Don't ignore case */
+ regmatch.regprog = clip_exclude_prog;
+ if (vim_regexec(&regmatch, T_NAME, (colnr_T)0))
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Test if "dpy" and x11_window are valid by getting the window title.
+ * I don't actually want it yet, so there may be a simpler call to use, but
+ * this will cause the error handler x_error_check() to be called if anything
+ * is wrong, such as the window pointer being invalid (as can happen when the
+ * user changes his DISPLAY, but not his WINDOWID) -- webb
+ */
+ static int
+test_x11_window(dpy)
+ Display *dpy;
+{
+ int (*old_handler)();
+ XTextProperty text_prop;
+
+ old_handler = XSetErrorHandler(x_error_check);
+ got_x_error = FALSE;
+ if (XGetWMName(dpy, x11_window, &text_prop))
+ XFree((void *)text_prop.value);
+ XSync(dpy, False);
+ (void)XSetErrorHandler(old_handler);
+
+ if (p_verbose > 0 && got_x_error)
+ MSG(_("Testing the X display failed"));
+
+ return (got_x_error ? FAIL : OK);
+}
+#endif
+
+#ifdef FEAT_TITLE
+
+#ifdef FEAT_X11
+
+static int get_x11_thing __ARGS((int get_title, int test_only));
+
+/*
+ * try to get x11 window and display
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ static int
+get_x11_windis()
+{
+ char *winid;
+ static int result = -1;
+#define XD_NONE 0 /* x11_display not set here */
+#define XD_HERE 1 /* x11_display opened here */
+#define XD_GUI 2 /* x11_display used from gui.dpy */
+#define XD_XTERM 3 /* x11_display used from xterm_dpy */
+ static int x11_display_from = XD_NONE;
+ static int did_set_error_handler = FALSE;
+
+ if (!did_set_error_handler)
+ {
+ /* X just exits if it finds an error otherwise! */
+ (void)XSetErrorHandler(x_error_handler);
+ did_set_error_handler = TRUE;
+ }
+
+#if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+ if (gui.in_use)
+ {
+ /*
+ * If the X11 display was opened here before, for the window where Vim
+ * was started, close that one now to avoid a memory leak.
+ */
+ if (x11_display_from == XD_HERE && x11_display != NULL)
+ {
+ XCloseDisplay(x11_display);
+ x11_display_from = XD_NONE;
+ }
+ if (gui_get_x11_windis(&x11_window, &x11_display) == OK)
+ {
+ x11_display_from = XD_GUI;
+ return OK;
+ }
+ x11_display = NULL;
+ return FAIL;
+ }
+ else if (x11_display_from == XD_GUI)
+ {
+ /* GUI must have stopped somehow, clear x11_display */
+ x11_window = 0;
+ x11_display = NULL;
+ x11_display_from = XD_NONE;
+ }
+#endif
+
+ /* When started with the "-X" argument, don't try connecting. */
+ if (!x_connect_to_server())
+ return FAIL;
+
+ /*
+ * If WINDOWID not set, should try another method to find out
+ * what the current window number is. The only code I know for
+ * this is very complicated.
+ * We assume that zero is invalid for WINDOWID.
+ */
+ if (x11_window == 0 && (winid = getenv("WINDOWID")) != NULL)
+ x11_window = (Window)atol(winid);
+
+#ifdef FEAT_XCLIPBOARD
+ if (xterm_dpy != NULL && x11_window != 0)
+ {
+ /* Checked it already. */
+ if (x11_display_from == XD_XTERM)
+ return OK;
+
+ /*
+ * If the X11 display was opened here before, for the window where Vim
+ * was started, close that one now to avoid a memory leak.
+ */
+ if (x11_display_from == XD_HERE && x11_display != NULL)
+ XCloseDisplay(x11_display);
+ x11_display = xterm_dpy;
+ x11_display_from = XD_XTERM;
+ if (test_x11_window(x11_display) == FAIL)
+ {
+ /* probably bad $WINDOWID */
+ x11_window = 0;
+ x11_display = NULL;
+ x11_display_from = XD_NONE;
+ return FAIL;
+ }
+ return OK;
+ }
+#endif
+
+ if (x11_window == 0 || x11_display == NULL)
+ result = -1;
+
+ if (result != -1) /* Have already been here and set this */
+ return result; /* Don't do all these X calls again */
+
+ if (x11_window != 0 && x11_display == NULL)
+ {
+#ifdef SET_SIG_ALARM
+ RETSIGTYPE (*sig_save)();
+#endif
+#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+ struct timeval start_tv;
+
+ if (p_verbose > 0)
+ gettimeofday(&start_tv, NULL);
+#endif
+
+#ifdef SET_SIG_ALARM
+ /*
+ * Opening the Display may hang if the DISPLAY setting is wrong, or
+ * the network connection is bad. Set an alarm timer to get out.
+ */
+ sig_alarm_called = FALSE;
+ sig_save = (RETSIGTYPE (*)())signal(SIGALRM,
+ (RETSIGTYPE (*)())sig_alarm);
+ alarm(2);
+#endif
+ x11_display = XOpenDisplay(NULL);
+
+#ifdef SET_SIG_ALARM
+ alarm(0);
+ signal(SIGALRM, (RETSIGTYPE (*)())sig_save);
+ if (p_verbose > 0 && sig_alarm_called)
+ MSG(_("Opening the X display timed out"));
+#endif
+ if (x11_display != NULL)
+ {
+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+ if (p_verbose > 0)
+ xopen_message(&start_tv);
+# endif
+ if (test_x11_window(x11_display) == FAIL)
+ {
+ /* Maybe window id is bad */
+ x11_window = 0;
+ XCloseDisplay(x11_display);
+ x11_display = NULL;
+ }
+ else
+ x11_display_from = XD_HERE;
+ }
+ }
+ if (x11_window == 0 || x11_display == NULL)
+ return (result = FAIL);
+ return (result = OK);
+}
+
+/*
+ * Determine original x11 Window Title
+ */
+ static int
+get_x11_title(test_only)
+ int test_only;
+{
+ int retval;
+
+ retval = get_x11_thing(TRUE, test_only);
+
+ /* could not get old title: oldtitle == NULL */
+
+ return retval;
+}
+
+/*
+ * Determine original x11 Window icon
+ */
+ static int
+get_x11_icon(test_only)
+ int test_only;
+{
+ int retval = FALSE;
+
+ retval = get_x11_thing(FALSE, test_only);
+
+ /* could not get old icon, use terminal name */
+ if (oldicon == NULL && !test_only)
+ {
+ if (STRNCMP(T_NAME, "builtin_", 8) == 0)
+ oldicon = T_NAME + 8;
+ else
+ oldicon = T_NAME;
+ }
+
+ return retval;
+}
+
+ static int
+get_x11_thing(get_title, test_only)
+ int get_title; /* get title string */
+ int test_only;
+{
+ XTextProperty text_prop;
+ int retval = FALSE;
+ Status status;
+
+ if (get_x11_windis() == OK)
+ {
+ /* Get window/icon name if any */
+ if (get_title)
+ status = XGetWMName(x11_display, x11_window, &text_prop);
+ else
+ status = XGetWMIconName(x11_display, x11_window, &text_prop);
+
+ /*
+ * If terminal is xterm, then x11_window may be a child window of the
+ * outer xterm window that actually contains the window/icon name, so
+ * keep traversing up the tree until a window with a title/icon is
+ * found.
+ */
+ /* Previously this was only done for xterm and alikes. I don't see a
+ * reason why it would fail for other terminal emulators.
+ * if (term_is_xterm) */
+ {
+ Window root;
+ Window parent;
+ Window win = x11_window;
+ Window *children;
+ unsigned int num_children;
+
+ while (!status || text_prop.value == NULL)
+ {
+ if (!XQueryTree(x11_display, win, &root, &parent, &children,
+ &num_children))
+ break;
+ if (children)
+ XFree((void *)children);
+ if (parent == root || parent == 0)
+ break;
+
+ win = parent;
+ if (get_title)
+ status = XGetWMName(x11_display, win, &text_prop);
+ else
+ status = XGetWMIconName(x11_display, win, &text_prop);
+ }
+ }
+ if (status && text_prop.value != NULL)
+ {
+ retval = TRUE;
+ if (!test_only)
+ {
+#ifdef FEAT_XFONTSET
+ if (text_prop.encoding == XA_STRING)
+ {
+#endif
+ if (get_title)
+ oldtitle = vim_strsave((char_u *)text_prop.value);
+ else
+ oldicon = vim_strsave((char_u *)text_prop.value);
+#ifdef FEAT_XFONTSET
+ }
+ else
+ {
+ char **cl;
+ Status transform_status;
+ int n = 0;
+
+ transform_status = XmbTextPropertyToTextList(x11_display,
+ &text_prop,
+ &cl, &n);
+ if (transform_status >= Success && n > 0 && cl[0])
+ {
+ if (get_title)
+ oldtitle = vim_strsave((char_u *) cl[0]);
+ else
+ oldicon = vim_strsave((char_u *) cl[0]);
+ XFreeStringList(cl);
+ }
+ else
+ {
+ if (get_title)
+ oldtitle = vim_strsave((char_u *)text_prop.value);
+ else
+ oldicon = vim_strsave((char_u *)text_prop.value);
+ }
+ }
+#endif
+ }
+ XFree((void *)text_prop.value);
+ }
+ }
+ return retval;
+}
+
+/* Are Xutf8 functions available? Avoid error from old compilers. */
+#if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
+# if X_HAVE_UTF8_STRING
+# define USE_UTF8_STRING
+# endif
+#endif
+
+/*
+ * Set x11 Window Title
+ *
+ * get_x11_windis() must be called before this and have returned OK
+ */
+ static void
+set_x11_title(title)
+ char_u *title;
+{
+ /* XmbSetWMProperties() and Xutf8SetWMProperties() should use a STRING
+ * when possible, COMPOUND_TEXT otherwise. COMPOUND_TEXT isn't
+ * supported everywhere and STRING doesn't work for multi-byte titles.
+ */
+#ifdef USE_UTF8_STRING
+ if (enc_utf8)
+ Xutf8SetWMProperties(x11_display, x11_window, (const char *)title,
+ NULL, NULL, 0, NULL, NULL, NULL);
+ else
+#endif
+ {
+#if XtSpecificationRelease >= 4
+# ifdef FEAT_XFONTSET
+ XmbSetWMProperties(x11_display, x11_window, (const char *)title,
+ NULL, NULL, 0, NULL, NULL, NULL);
+# else
+ XTextProperty text_prop;
+
+ /* directly from example 3-18 "basicwin" of Xlib Programming Manual */
+ (void)XStringListToTextProperty((char **)&title, 1, &text_prop);
+ XSetWMProperties(x11_display, x11_window, &text_prop,
+ NULL, NULL, 0, NULL, NULL, NULL);
+# endif
+#else
+ XStoreName(x11_display, x11_window, (char *)title);
+#endif
+ }
+ XFlush(x11_display);
+}
+
+/*
+ * Set x11 Window icon
+ *
+ * get_x11_windis() must be called before this and have returned OK
+ */
+ static void
+set_x11_icon(icon)
+ char_u *icon;
+{
+ /* See above for comments about using X*SetWMProperties(). */
+#ifdef USE_UTF8_STRING
+ if (enc_utf8)
+ Xutf8SetWMProperties(x11_display, x11_window, NULL, (const char *)icon,
+ NULL, 0, NULL, NULL, NULL);
+ else
+#endif
+ {
+#if XtSpecificationRelease >= 4
+# ifdef FEAT_XFONTSET
+ XmbSetWMProperties(x11_display, x11_window, NULL, (const char *)icon,
+ NULL, 0, NULL, NULL, NULL);
+# else
+ XTextProperty text_prop;
+
+ (void)XStringListToTextProperty((char **)&icon, 1, &text_prop);
+ XSetWMProperties(x11_display, x11_window, NULL, &text_prop,
+ NULL, 0, NULL, NULL, NULL);
+# endif
+#else
+ XSetIconName(x11_display, x11_window, (char *)icon);
+#endif
+ }
+ XFlush(x11_display);
+}
+
+#else /* FEAT_X11 */
+
+/*ARGSUSED*/
+ static int
+get_x11_title(test_only)
+ int test_only;
+{
+ return FALSE;
+}
+
+ static int
+get_x11_icon(test_only)
+ int test_only;
+{
+ if (!test_only)
+ {
+ if (STRNCMP(T_NAME, "builtin_", 8) == 0)
+ oldicon = T_NAME + 8;
+ else
+ oldicon = T_NAME;
+ }
+ return FALSE;
+}
+
+#endif /* FEAT_X11 */
+
+ int
+mch_can_restore_title()
+{
+ return get_x11_title(TRUE);
+}
+
+ int
+mch_can_restore_icon()
+{
+ return get_x11_icon(TRUE);
+}
+
+/*
+ * Set the window title and icon.
+ */
+ void
+mch_settitle(title, icon)
+ char_u *title;
+ char_u *icon;
+{
+ int type = 0;
+ static int recursive = 0;
+
+ if (T_NAME == NULL) /* no terminal name (yet) */
+ return;
+ if (title == NULL && icon == NULL) /* nothing to do */
+ return;
+
+ /* When one of the X11 functions causes a deadly signal, we get here again
+ * recursively. Avoid hanging then (something is probably locked). */
+ if (recursive)
+ return;
+ ++recursive;
+
+ /*
+ * if the window ID and the display is known, we may use X11 calls
+ */
+#ifdef FEAT_X11
+ if (get_x11_windis() == OK)
+ type = 1;
+#else
+# if defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(FEAT_GUI_GTK)
+ if (gui.in_use)
+ type = 1;
+# endif
+# ifdef FEAT_GUI_BEOS
+ /* TODO: If this means (gui.in_use) why not merge with above? (Dany) */
+ /* we always have a 'window' */
+ type = 1;
+# endif
+#endif
+
+ /*
+ * Note: if "t_TS" is set, title is set with escape sequence rather
+ * than x11 calls, because the x11 calls don't always work
+ */
+
+ if ((type || *T_TS != NUL) && title != NULL)
+ {
+ if (oldtitle == NULL
+#ifdef FEAT_GUI
+ && !gui.in_use
+#endif
+ ) /* first call but not in GUI, save title */
+ (void)get_x11_title(FALSE);
+
+ if (*T_TS != NUL) /* it's OK if t_fs is empty */
+ term_settitle(title);
+#ifdef FEAT_X11
+ else
+# ifdef FEAT_GUI_GTK
+ if (!gui.in_use) /* don't do this if GTK+ is running */
+# endif
+ set_x11_title(title); /* x11 */
+#endif
+#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_BEOS) \
+ || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
+ else
+ gui_mch_settitle(title, icon);
+#endif
+ did_set_title = TRUE;
+ }
+
+ if ((type || *T_CIS != NUL) && icon != NULL)
+ {
+ if (oldicon == NULL
+#ifdef FEAT_GUI
+ && !gui.in_use
+#endif
+ ) /* first call, save icon */
+ get_x11_icon(FALSE);
+
+ if (*T_CIS != NUL)
+ {
+ out_str(T_CIS); /* set icon start */
+ out_str_nf(icon);
+ out_str(T_CIE); /* set icon end */
+ out_flush();
+ }
+#ifdef FEAT_X11
+ else
+# ifdef FEAT_GUI_GTK
+ if (!gui.in_use) /* don't do this if GTK+ is running */
+# endif
+ set_x11_icon(icon); /* x11 */
+#endif
+ did_set_icon = TRUE;
+ }
+ --recursive;
+}
+
+/*
+ * Restore the window/icon title.
+ * "which" is one of:
+ * 1 only restore title
+ * 2 only restore icon
+ * 3 restore title and icon
+ */
+ void
+mch_restore_title(which)
+ int which;
+{
+ /* only restore the title or icon when it has been set */
+ mch_settitle(((which & 1) && did_set_title) ?
+ (oldtitle ? oldtitle : p_titleold) : NULL,
+ ((which & 2) && did_set_icon) ? oldicon : NULL);
+}
+
+#endif /* FEAT_TITLE */
+
+/*
+ * Return TRUE if "name" looks like some xterm name.
+ */
+ int
+vim_is_xterm(name)
+ char_u *name;
+{
+ if (name == NULL)
+ return FALSE;
+ return (STRNICMP(name, "xterm", 5) == 0
+ || STRNICMP(name, "nxterm", 6) == 0
+ || STRNICMP(name, "kterm", 5) == 0
+ || STRNICMP(name, "rxvt", 4) == 0
+ || STRCMP(name, "builtin_xterm") == 0);
+}
+
+#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
+/*
+ * Return non-zero when using an xterm mouse, according to 'ttymouse'.
+ * Return 1 for "xterm".
+ * Return 2 for "xterm2".
+ */
+ int
+use_xterm_mouse()
+{
+ if (ttym_flags == TTYM_XTERM2)
+ return 2;
+ if (ttym_flags == TTYM_XTERM)
+ return 1;
+ return 0;
+}
+#endif
+
+ int
+vim_is_iris(name)
+ char_u *name;
+{
+ if (name == NULL)
+ return FALSE;
+ return (STRNICMP(name, "iris-ansi", 9) == 0
+ || STRCMP(name, "builtin_iris-ansi") == 0);
+}
+
+ int
+vim_is_vt300(name)
+ char_u *name;
+{
+ if (name == NULL)
+ return FALSE; /* actually all ANSI comp. terminals should be here */
+ return (STRNICMP(name, "vt3", 3) == 0 /* it will cover all from VT100-VT300 */
+ || STRNICMP(name, "vt2", 3) == 0 /* TODO: from VT340 can hanle colors */
+ || STRNICMP(name, "vt1", 3) == 0
+ || STRCMP(name, "builtin_vt320") == 0);
+}
+
+/*
+ * Return TRUE if "name" is a terminal for which 'ttyfast' should be set.
+ * This should include all windowed terminal emulators.
+ */
+ int
+vim_is_fastterm(name)
+ char_u *name;
+{
+ if (name == NULL)
+ return FALSE;
+ if (vim_is_xterm(name) || vim_is_vt300(name) || vim_is_iris(name))
+ return TRUE;
+ return ( STRNICMP(name, "hpterm", 6) == 0
+ || STRNICMP(name, "sun-cmd", 7) == 0
+ || STRNICMP(name, "screen", 6) == 0
+ || STRNICMP(name, "dtterm", 6) == 0);
+}
+
+/*
+ * Insert user name in s[len].
+ * Return OK if a name found.
+ */
+ int
+mch_get_user_name(s, len)
+ char_u *s;
+ int len;
+{
+#ifdef VMS
+ STRNCPY((char *)s, cuserid(NULL), len);
+ return OK;
+#else
+ return mch_get_uname(getuid(), s, len);
+#endif
+}
+
+/*
+ * Insert user name for "uid" in s[len].
+ * Return OK if a name found.
+ */
+ int
+mch_get_uname(uid, s, len)
+ uid_t uid;
+ char_u *s;
+ int len;
+{
+#if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
+ struct passwd *pw;
+
+ if ((pw = getpwuid(uid)) != NULL
+ && pw->pw_name != NULL && *(pw->pw_name) != NUL)
+ {
+ STRNCPY(s, pw->pw_name, len);
+ return OK;
+ }
+#endif
+ sprintf((char *)s, "%d", (int)uid); /* assumes s is long enough */
+ return FAIL; /* a number is not a name */
+}
+
+/*
+ * Insert host name is s[len].
+ */
+
+#ifdef HAVE_SYS_UTSNAME_H
+ void
+mch_get_host_name(s, len)
+ char_u *s;
+ int len;
+{
+ struct utsname vutsname;
+
+ if (uname(&vutsname) < 0)
+ *s = NUL;
+ else
+ STRNCPY(s, vutsname.nodename, len);
+ s[len - 1] = NUL; /* make sure it's terminated */
+}
+#else /* HAVE_SYS_UTSNAME_H */
+
+# ifdef HAVE_SYS_SYSTEMINFO_H
+# define gethostname(nam, len) sysinfo(SI_HOSTNAME, nam, len)
+# endif
+
+ void
+mch_get_host_name(s, len)
+ char_u *s;
+ int len;
+{
+# ifdef VAXC
+ vaxc$gethostname((char *)s, len);
+# else
+ gethostname((char *)s, len);
+# endif
+ s[len - 1] = NUL; /* make sure it's terminated */
+}
+#endif /* HAVE_SYS_UTSNAME_H */
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ return (long)getpid();
+}
+
+#if !defined(HAVE_STRERROR) && defined(USE_GETCWD)
+static char *strerror __ARGS((int));
+
+ static char *
+strerror(err)
+ int err;
+{
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+ static char er[20];
+
+ if (err > 0 && err < sys_nerr)
+ return (sys_errlist[err]);
+ sprintf(er, "Error %d", err);
+ return er;
+}
+#endif
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(buf, len)
+ char_u *buf;
+ int len;
+{
+#if defined(USE_GETCWD)
+ if (getcwd((char *)buf, len) == NULL)
+ {
+ STRCPY(buf, strerror(errno));
+ return FAIL;
+ }
+ return OK;
+#else
+ return (getwd((char *)buf) != NULL ? OK : FAIL);
+#endif
+}
+
+#if defined(OS2) || defined(PROTO)
+/*
+ * Replace all slashes by backslashes.
+ * When 'shellslash' set do it the other way around.
+ */
+ void
+slash_adjust(p)
+ char_u *p;
+{
+ while (*p)
+ {
+ if (*p == psepcN)
+ *p = psepc;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+}
+#endif
+
+/*
+ * Get absolute file name into buffer 'buf' of length 'len' bytes.
+ *
+ * return FAIL for failure, OK for success
+ */
+ int
+mch_FullName(fname, buf, len, force)
+ char_u *fname, *buf;
+ int len;
+ int force; /* also expand when already absolute path */
+{
+ int l;
+#ifdef OS2
+ int only_drive; /* file name is only a drive letter */
+#endif
+#ifdef HAVE_FCHDIR
+ int fd = -1;
+ static int dont_fchdir = FALSE; /* TRUE when fchdir() doesn't work */
+#endif
+ char_u olddir[MAXPATHL];
+ char_u *p;
+ int retval = OK;
+
+#ifdef VMS
+ fname = vms_fixfilename(fname);
+#endif
+
+ /* expand it if forced or not an absolute path */
+ if (force || !mch_isFullName(fname))
+ {
+ /*
+ * If the file name has a path, change to that directory for a moment,
+ * and then do the getwd() (and get back to where we were).
+ * This will get the correct path name with "../" things.
+ */
+#ifdef OS2
+ only_drive = 0;
+ if (((p = vim_strrchr(fname, '/')) != NULL)
+ || ((p = vim_strrchr(fname, '\\')) != NULL)
+ || (((p = vim_strchr(fname, ':')) != NULL) && ++only_drive))
+#else
+ if ((p = vim_strrchr(fname, '/')) != NULL)
+#endif
+ {
+#ifdef HAVE_FCHDIR
+ /*
+ * Use fchdir() if possible, it's said to be faster and more
+ * reliable. But on SunOS 4 it might not work. Check this by
+ * doing a fchdir() right now.
+ */
+ if (!dont_fchdir)
+ {
+ fd = open(".", O_RDONLY | O_EXTRA, 0);
+ if (fd >= 0 && fchdir(fd) < 0)
+ {
+ close(fd);
+ fd = -1;
+ dont_fchdir = TRUE; /* don't try again */
+ }
+ }
+#endif
+
+ /* Only change directory when we are sure we can return to where
+ * we are now. After doing "su" chdir(".") might not work. */
+ if (
+#ifdef HAVE_FCHDIR
+ fd < 0 &&
+#endif
+ (mch_dirname(olddir, MAXPATHL) == FAIL
+ || mch_chdir((char *)olddir) != 0))
+ {
+ p = NULL; /* can't get current dir: don't chdir */
+ retval = FAIL;
+ }
+ else
+ {
+#ifdef OS2
+ /*
+ * compensate for case where ':' from "D:" was the only
+ * path separator detected in the file name; the _next_
+ * character has to be removed, and then restored later.
+ */
+ if (only_drive)
+ p++;
+#endif
+ /* The directory is copied into buf[], to be able to remove
+ * the file name without changing it (could be a string in
+ * read-only memory) */
+ if (p - fname >= len)
+ retval = FAIL;
+ else
+ {
+ STRNCPY(buf, fname, p - fname);
+ buf[p - fname] = NUL;
+ if (mch_chdir((char *)buf))
+ retval = FAIL;
+ else
+ fname = p + 1;
+ *buf = NUL;
+ }
+#ifdef OS2
+ if (only_drive)
+ {
+ p--;
+ if (retval != FAIL)
+ fname--;
+ }
+#endif
+ }
+ }
+ if (mch_dirname(buf, len) == FAIL)
+ {
+ retval = FAIL;
+ *buf = NUL;
+ }
+ if (p != NULL)
+ {
+#ifdef HAVE_FCHDIR
+ if (fd >= 0)
+ {
+ l = fchdir(fd);
+ close(fd);
+ }
+ else
+#endif
+ l = mch_chdir((char *)olddir);
+ if (l != 0)
+ EMSG(_(e_prev_dir));
+ }
+
+ l = STRLEN(buf);
+ if (l >= len)
+ retval = FAIL;
+#ifndef VMS
+ else
+ {
+ if (l > 0 && buf[l - 1] != '/' && *fname != NUL
+ && STRCMP(fname, ".") != 0)
+ STRCAT(buf, "/");
+ }
+#endif
+ }
+ /* Catch file names which are too long. */
+ if (retval == FAIL || STRLEN(buf) + STRLEN(fname) >= len)
+ return FAIL;
+
+ /* Do not append ".", "/dir/." is equal to "/dir". */
+ if (STRCMP(fname, ".") != 0)
+ STRCAT(buf, fname);
+
+ return OK;
+}
+
+/*
+ * Return TRUE if "fname" does not depend on the current directory.
+ */
+ int
+mch_isFullName(fname)
+ char_u *fname;
+{
+#ifdef __EMX__
+ return _fnisabs(fname);
+#else
+# ifdef VMS
+ return ( fname[0] == '/' || fname[0] == '.' ||
+ strchr((char *)fname,':') || strchr((char *)fname,'"') ||
+ (strchr((char *)fname,'[') && strchr((char *)fname,']'))||
+ (strchr((char *)fname,'<') && strchr((char *)fname,'>')) );
+# else
+ return (*fname == '/' || *fname == '~');
+# endif
+#endif
+}
+
+/*
+ * Get file permissions for 'name'.
+ * Returns -1 when it doesn't exist.
+ */
+ long
+mch_getperm(name)
+ char_u *name;
+{
+ struct stat statb;
+
+ /* Keep the #ifdef outside of stat(), it may be a macro. */
+#ifdef VMS
+ if (stat((char *)vms_fixfilename(name), &statb))
+#else
+ if (stat((char *)name, &statb))
+#endif
+ return -1;
+ return statb.st_mode;
+}
+
+/*
+ * set file permission for 'name' to 'perm'
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+mch_setperm(name, perm)
+ char_u *name;
+ long perm;
+{
+ return (chmod((char *)
+#ifdef VMS
+ vms_fixfilename(name),
+#else
+ name,
+#endif
+ (mode_t)perm) == 0 ? OK : FAIL);
+}
+
+#if defined(HAVE_ACL) || defined(PROTO)
+# ifdef HAVE_SYS_ACL_H
+# include <sys/acl.h>
+# endif
+# ifdef HAVE_SYS_ACCESS_H
+# include <sys/access.h>
+# endif
+
+# ifdef HAVE_SOLARIS_ACL
+typedef struct vim_acl_solaris_T {
+ int acl_cnt;
+ aclent_t *acl_entry;
+} vim_acl_solaris_T;
+# endif
+
+/*
+ * Return a pointer to the ACL of file "fname" in allocated memory.
+ * Return NULL if the ACL is not available for whatever reason.
+ */
+ vim_acl_T
+mch_get_acl(fname)
+ char_u *fname;
+{
+ vim_acl_T ret = NULL;
+#ifdef HAVE_POSIX_ACL
+ ret = (vim_acl_T)acl_get_file((char *)fname, ACL_TYPE_ACCESS);
+#else
+#ifdef HAVE_SOLARIS_ACL
+ vim_acl_solaris_T *aclent;
+
+ aclent = malloc(sizeof(vim_acl_solaris_T));
+ if ((aclent->acl_cnt = acl((char *)fname, GETACLCNT, 0, NULL)) < 0)
+ {
+ free(aclent);
+ return NULL;
+ }
+ aclent->acl_entry = malloc(aclent->acl_cnt * sizeof(aclent_t));
+ if (acl((char *)fname, GETACL, aclent->acl_cnt, aclent->acl_entry) < 0)
+ {
+ free(aclent->acl_entry);
+ free(aclent);
+ return NULL;
+ }
+ ret = (vim_acl_T)aclent;
+#else
+#if defined(HAVE_AIX_ACL)
+ int aclsize;
+ struct acl *aclent;
+
+ aclsize = sizeof(struct acl);
+ aclent = malloc(aclsize);
+ if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0)
+ {
+ if (errno == ENOSPC)
+ {
+ aclsize = aclent->acl_len;
+ aclent = realloc(aclent, aclsize);
+ if (statacl((char *)fname, STX_NORMAL, aclent, aclsize) < 0)
+ {
+ free(aclent);
+ return NULL;
+ }
+ }
+ else
+ {
+ free(aclent);
+ return NULL;
+ }
+ }
+ ret = (vim_acl_T)aclent;
+#endif /* HAVE_AIX_ACL */
+#endif /* HAVE_SOLARIS_ACL */
+#endif /* HAVE_POSIX_ACL */
+ return ret;
+}
+
+/*
+ * Set the ACL of file "fname" to "acl" (unless it's NULL).
+ */
+ void
+mch_set_acl(fname, aclent)
+ char_u *fname;
+ vim_acl_T aclent;
+{
+ if (aclent == NULL)
+ return;
+#ifdef HAVE_POSIX_ACL
+ acl_set_file((char *)fname, ACL_TYPE_ACCESS, (acl_t)aclent);
+#else
+#ifdef HAVE_SOLARIS_ACL
+ acl((char *)fname, SETACL, ((vim_acl_solaris_T *)aclent)->acl_cnt,
+ ((vim_acl_solaris_T *)aclent)->acl_entry);
+#else
+#ifdef HAVE_AIX_ACL
+ chacl((char *)fname, aclent, ((struct acl *)aclent)->acl_len);
+#endif /* HAVE_AIX_ACL */
+#endif /* HAVE_SOLARIS_ACL */
+#endif /* HAVE_POSIX_ACL */
+}
+
+ void
+mch_free_acl(aclent)
+ vim_acl_T aclent;
+{
+ if (aclent == NULL)
+ return;
+#ifdef HAVE_POSIX_ACL
+ acl_free((acl_t)aclent);
+#else
+#ifdef HAVE_SOLARIS_ACL
+ free(((vim_acl_solaris_T *)aclent)->acl_entry);
+ free(aclent);
+#else
+#ifdef HAVE_AIX_ACL
+ free(aclent);
+#endif /* HAVE_AIX_ACL */
+#endif /* HAVE_SOLARIS_ACL */
+#endif /* HAVE_POSIX_ACL */
+}
+#endif
+
+/*
+ * Set hidden flag for "name".
+ */
+/* ARGSUSED */
+ void
+mch_hide(name)
+ char_u *name;
+{
+ /* can't hide a file */
+}
+
+/*
+ * return TRUE if "name" is a directory
+ * return FALSE if "name" is not a directory
+ * return FALSE for error
+ */
+ int
+mch_isdir(name)
+ char_u *name;
+{
+ struct stat statb;
+
+ if (*name == NUL) /* Some stat()s don't flag "" as an error. */
+ return FALSE;
+ if (stat((char *)name, &statb))
+ return FALSE;
+#ifdef _POSIX_SOURCE
+ return (S_ISDIR(statb.st_mode) ? TRUE : FALSE);
+#else
+ return ((statb.st_mode & S_IFMT) == S_IFDIR ? TRUE : FALSE);
+#endif
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+
+static int executable_file __ARGS((char_u *name));
+
+/*
+ * Return 1 if "name" is an executable file, 0 if not or it doesn't exist.
+ */
+ static int
+executable_file(name)
+ char_u *name;
+{
+ struct stat st;
+
+ if (stat((char *)name, &st))
+ return 0;
+ return S_ISREG(st.st_mode) && mch_access((char *)name, X_OK) == 0;
+}
+
+/*
+ * Return 1 if "name" can be found in $PATH and executed, 0 if not.
+ * Return -1 if unknown.
+ */
+ int
+mch_can_exe(name)
+ char_u *name;
+{
+ char_u *buf;
+ char_u *p, *e;
+ int retval;
+
+ /* If it's an absolute or relative path don't need to use $PATH. */
+ if (mch_isFullName(name) || (name[0] == '.' && (name[1] == '/'
+ || (name[1] == '.' && name[2] == '/'))))
+ return executable_file(name);
+
+ p = (char_u *)getenv("PATH");
+ if (p == NULL || *p == NUL)
+ return -1;
+ buf = alloc((unsigned)(STRLEN(name) + STRLEN(p) + 2));
+ if (buf == NULL)
+ return -1;
+
+ /*
+ * Walk through all entries in $PATH to check if "name" exists there and
+ * is an executable file.
+ */
+ for (;;)
+ {
+ e = (char_u *)strchr((char *)p, ':');
+ if (e == NULL)
+ e = p + STRLEN(p);
+ if (e - p <= 1) /* empty entry means current dir */
+ STRCPY(buf, "./");
+ else
+ {
+ STRNCPY(buf, p, e - p);
+ buf[e - p] = NUL;
+ add_pathsep(buf);
+ }
+ STRCAT(buf, name);
+ retval = executable_file(buf);
+ if (retval == 1)
+ break;
+
+ if (*e != ':')
+ break;
+ p = e + 1;
+ }
+
+ vim_free(buf);
+ return retval;
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(name)
+ char_u *name;
+{
+ struct stat st;
+
+ if (stat((char *)name, &st))
+ return NODE_NORMAL;
+ if (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))
+ return NODE_NORMAL;
+#ifndef OS2
+ if (S_ISBLK(st.st_mode)) /* block device isn't writable */
+ return NODE_OTHER;
+#endif
+ /* Everything else is writable? */
+ return NODE_WRITABLE;
+}
+
+ void
+mch_early_init()
+{
+#ifdef HAVE_CHECK_STACK_GROWTH
+ int i;
+#endif
+
+#ifdef HAVE_CHECK_STACK_GROWTH
+ check_stack_growth((char *)&i);
+
+# ifdef HAVE_GETRLIMIT
+ get_stack_limit();
+# endif
+
+#endif
+
+ /*
+ * Setup an alternative stack for signals. Helps to catch signals when
+ * running out of stack space.
+ * Use of sigaltstack() is preferred, it's more portable.
+ * Ignore any errors.
+ */
+#if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
+ signal_stack = malloc(SIGSTKSZ);
+ init_signal_stack();
+#endif
+}
+
+static void exit_scroll __ARGS((void));
+
+/*
+ * Output a newline when exiting.
+ * Make sure the newline goes to the same stream as the text.
+ */
+ static void
+exit_scroll()
+{
+ if (newline_on_exit || msg_didout)
+ {
+ if (msg_use_printf())
+ {
+ if (info_message)
+ mch_msg("\n");
+ else
+ mch_errmsg("\r\n");
+ }
+ else
+ out_char('\n');
+ }
+ else
+ {
+ restore_cterm_colors(); /* get original colors back */
+ msg_clr_eos_force(); /* clear the rest of the display */
+ windgoto((int)Rows - 1, 0); /* may have moved the cursor */
+ }
+}
+
+ void
+mch_exit(r)
+ int r;
+{
+ exiting = TRUE;
+
+#if defined(FEAT_X11) && defined(FEAT_CLIPBOARD)
+ x11_export_final_selection();
+#endif
+
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+#endif
+ {
+ settmode(TMODE_COOK);
+#ifdef FEAT_TITLE
+ mch_restore_title(3); /* restore xterm title and icon name */
+#endif
+ /*
+ * When t_ti is not empty but it doesn't cause swapping terminal
+ * pages, need to output a newline when msg_didout is set. But when
+ * t_ti does swap pages it should not go to the shell page. Do this
+ * before stoptermcap().
+ */
+ if (swapping_screen() && !newline_on_exit)
+ exit_scroll();
+
+ /* Stop termcap: May need to check for T_CRV response, which
+ * requires RAW mode. */
+ stoptermcap();
+
+ /*
+ * A newline is only required after a message in the alternate screen.
+ * This is set to TRUE by wait_return().
+ */
+ if (!swapping_screen() || newline_on_exit)
+ exit_scroll();
+
+ /* Cursor may have been switched off without calling starttermcap()
+ * when doing "vim -u vimrc" and vimrc contains ":q". */
+ if (full_screen)
+ cursor_on();
+ }
+ out_flush();
+ ml_close_all(TRUE); /* remove all memfiles */
+ may_core_dump();
+#ifdef FEAT_GUI
+# ifndef FEAT_GUI_BEOS /* BeOS always has GUI */
+ if (gui.in_use)
+# endif
+ gui_exit(r);
+#endif
+#ifdef __QNX__
+ /* A core dump won't be created if the signal handler
+ * doesn't return, so we can't call exit() */
+ if (deadly_signal != 0)
+ return;
+#endif
+
+ exit(r);
+}
+
+ static void
+may_core_dump()
+{
+ if (deadly_signal != 0)
+ {
+ signal(deadly_signal, SIG_DFL);
+ kill(getpid(), deadly_signal); /* Die using the signal we caught */
+ }
+}
+
+#ifndef VMS
+
+ void
+mch_settmode(tmode)
+ int tmode;
+{
+ static int first = TRUE;
+
+ /* Why is NeXT excluded here (and not in os_unixx.h)? */
+#if defined(ECHOE) && defined(ICANON) && (defined(HAVE_TERMIO_H) || defined(HAVE_TERMIOS_H)) && !defined(__NeXT__)
+ /*
+ * for "new" tty systems
+ */
+# ifdef HAVE_TERMIOS_H
+ static struct termios told;
+ struct termios tnew;
+# else
+ static struct termio told;
+ struct termio tnew;
+# endif
+
+ if (first)
+ {
+ first = FALSE;
+# if defined(HAVE_TERMIOS_H)
+ tcgetattr(read_cmd_fd, &told);
+# else
+ ioctl(read_cmd_fd, TCGETA, &told);
+# endif
+ }
+
+ tnew = told;
+ if (tmode == TMODE_RAW)
+ {
+ /*
+ * ~ICRNL enables typing ^V^M
+ */
+ tnew.c_iflag &= ~ICRNL;
+ tnew.c_lflag &= ~(ICANON | ECHO | ISIG | ECHOE
+# if defined(IEXTEN) && !defined(__MINT__)
+ | IEXTEN /* IEXTEN enables typing ^V on SOLARIS */
+ /* but it breaks function keys on MINT */
+# endif
+ );
+# ifdef ONLCR /* don't map NL -> CR NL, we do it ourselves */
+ tnew.c_oflag &= ~ONLCR;
+# endif
+ tnew.c_cc[VMIN] = 1; /* return after 1 char */
+ tnew.c_cc[VTIME] = 0; /* don't wait */
+ }
+ else if (tmode == TMODE_SLEEP)
+ tnew.c_lflag &= ~(ECHO);
+
+# if defined(HAVE_TERMIOS_H)
+ {
+ int n = 10;
+
+ /* A signal may cause tcsetattr() to fail (e.g., SIGCONT). Retry a
+ * few times. */
+ while (tcsetattr(read_cmd_fd, TCSANOW, &tnew) == -1
+ && errno == EINTR && n > 0)
+ --n;
+ }
+# else
+ ioctl(read_cmd_fd, TCSETA, &tnew);
+# endif
+
+#else
+
+ /*
+ * for "old" tty systems
+ */
+# ifndef TIOCSETN
+# define TIOCSETN TIOCSETP /* for hpux 9.0 */
+# endif
+ static struct sgttyb ttybold;
+ struct sgttyb ttybnew;
+
+ if (first)
+ {
+ first = FALSE;
+ ioctl(read_cmd_fd, TIOCGETP, &ttybold);
+ }
+
+ ttybnew = ttybold;
+ if (tmode == TMODE_RAW)
+ {
+ ttybnew.sg_flags &= ~(CRMOD | ECHO);
+ ttybnew.sg_flags |= RAW;
+ }
+ else if (tmode == TMODE_SLEEP)
+ ttybnew.sg_flags &= ~(ECHO);
+ ioctl(read_cmd_fd, TIOCSETN, &ttybnew);
+#endif
+ curr_tmode = tmode;
+}
+
+/*
+ * Try to get the code for "t_kb" from the stty setting
+ *
+ * Even if termcap claims a backspace key, the user's setting *should*
+ * prevail. stty knows more about reality than termcap does, and if
+ * somebody's usual erase key is DEL (which, for most BSD users, it will
+ * be), they're going to get really annoyed if their erase key starts
+ * doing forward deletes for no reason. (Eric Fischer)
+ */
+ void
+get_stty()
+{
+ char_u buf[2];
+ char_u *p;
+
+ /* Why is NeXT excluded here (and not in os_unixx.h)? */
+#if defined(ECHOE) && defined(ICANON) && (defined(HAVE_TERMIO_H) || defined(HAVE_TERMIOS_H)) && !defined(__NeXT__)
+ /* for "new" tty systems */
+# ifdef HAVE_TERMIOS_H
+ struct termios keys;
+# else
+ struct termio keys;
+# endif
+
+# if defined(HAVE_TERMIOS_H)
+ if (tcgetattr(read_cmd_fd, &keys) != -1)
+# else
+ if (ioctl(read_cmd_fd, TCGETA, &keys) != -1)
+# endif
+ {
+ buf[0] = keys.c_cc[VERASE];
+ intr_char = keys.c_cc[VINTR];
+#else
+ /* for "old" tty systems */
+ struct sgttyb keys;
+
+ if (ioctl(read_cmd_fd, TIOCGETP, &keys) != -1)
+ {
+ buf[0] = keys.sg_erase;
+ intr_char = keys.sg_kill;
+#endif
+ buf[1] = NUL;
+ add_termcode((char_u *)"kb", buf, FALSE);
+
+ /*
+ * If <BS> and <DEL> are now the same, redefine <DEL>.
+ */
+ p = find_termcode((char_u *)"kD");
+ if (p != NULL && p[0] == buf[0] && p[1] == buf[1])
+ do_fixdel(NULL);
+ }
+#if 0
+ } /* to keep cindent happy */
+#endif
+}
+
+#endif /* VMS */
+
+#if defined(FEAT_MOUSE_TTY) || defined(PROTO)
+/*
+ * Set mouse clicks on or off.
+ */
+ void
+mch_setmouse(on)
+ int on;
+{
+ static int ison = FALSE;
+ int xterm_mouse_vers;
+
+ if (on == ison) /* return quickly if nothing to do */
+ return;
+
+ xterm_mouse_vers = use_xterm_mouse();
+ if (xterm_mouse_vers > 0)
+ {
+ if (on) /* enable mouse events, use mouse tracking if available */
+ out_str_nf((char_u *)
+ (xterm_mouse_vers > 1
+ ? IF_EB("\033[?1002h", ESC_STR "[?1002h")
+ : IF_EB("\033[?1000h", ESC_STR "[?1000h")));
+ else /* disable mouse events, could probably always send the same */
+ out_str_nf((char_u *)
+ (xterm_mouse_vers > 1
+ ? IF_EB("\033[?1002l", ESC_STR "[?1002l")
+ : IF_EB("\033[?1000l", ESC_STR "[?1000l")));
+ ison = on;
+ }
+
+# ifdef FEAT_MOUSE_DEC
+ else if (ttym_flags == TTYM_DEC)
+ {
+ if (on) /* enable mouse events */
+ out_str_nf((char_u *)"\033[1;2'z\033[1;3'{");
+ else /* disable mouse events */
+ out_str_nf((char_u *)"\033['z");
+ ison = on;
+ }
+# endif
+
+# ifdef FEAT_MOUSE_GPM
+ else
+ {
+ if (on)
+ {
+ if (gpm_open())
+ ison = TRUE;
+ }
+ else
+ {
+ gpm_close();
+ ison = FALSE;
+ }
+ }
+# endif
+
+# ifdef FEAT_MOUSE_JSB
+ else
+ {
+ if (on)
+ {
+ /* D - Enable Mouse up/down messages
+ * L - Enable Left Button Reporting
+ * M - Enable Middle Button Reporting
+ * R - Enable Right Button Reporting
+ * K - Enable SHIFT and CTRL key Reporting
+ * + - Enable Advanced messaging of mouse moves and up/down messages
+ * Q - Quiet No Ack
+ * # - Numeric value of mouse pointer required
+ * 0 = Multiview 2000 cursor, used as standard
+ * 1 = Windows Arrow
+ * 2 = Windows I Beam
+ * 3 = Windows Hour Glass
+ * 4 = Windows Cross Hair
+ * 5 = Windows UP Arrow
+ */
+#ifdef JSBTERM_MOUSE_NONADVANCED /* Disables full feedback of pointer movements */
+ out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK1Q\033\\",
+ ESC_STR "[0~ZwLMRK1Q" ESC_STR "\\"));
+#else
+ out_str_nf((char_u *)IF_EB("\033[0~ZwLMRK+1Q\033\\",
+ ESC_STR "[0~ZwLMRK+1Q" ESC_STR "\\"));
+#endif
+ ison = TRUE;
+ }
+ else
+ {
+ out_str_nf((char_u *)IF_EB("\033[0~ZwQ\033\\",
+ ESC_STR "[0~ZwQ" ESC_STR "\\"));
+ ison = FALSE;
+ }
+ }
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ else
+ {
+ /* 1 = button press, 6 = release, 7 = drag, 1h...9l = right button */
+ if (on)
+ out_str_nf("\033[>1h\033[>6h\033[>7h\033[>1h\033[>9l");
+ else
+ out_str_nf("\033[>1l\033[>6l\033[>7l\033[>1l\033[>9h");
+ ison = on;
+ }
+# endif
+}
+
+/*
+ * Set the mouse termcode, depending on the 'term' and 'ttymouse' options.
+ */
+ void
+check_mouse_termcode()
+{
+# ifdef FEAT_MOUSE_XTERM
+ if (use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ {
+ set_mouse_termcode(KS_MOUSE, (char_u *)(term_is_8bit(T_NAME)
+ ? IF_EB("\233M", CSI_STR "M") : IF_EB("\033[M", ESC_STR "[M")));
+ if (*p_mouse != NUL)
+ {
+ /* force mouse off and maybe on to send possibly new mouse
+ * activation sequence to the xterm, with(out) drag tracing. */
+ mch_setmouse(FALSE);
+ setmouse();
+ }
+ }
+ else
+ del_mouse_termcode(KS_MOUSE);
+# endif
+
+# ifdef FEAT_MOUSE_GPM
+ if (!use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MG", ESC_STR "MG"));
+# endif
+
+# ifdef FEAT_MOUSE_JSB
+ /* conflicts with xterm mouse: "\033[" and "\033[M" ??? */
+ if (!use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ set_mouse_termcode(KS_JSBTERM_MOUSE,
+ (char_u *)IF_EB("\033[0~zw", ESC_STR "[0~zw"));
+ else
+ del_mouse_termcode(KS_JSBTERM_MOUSE);
+# endif
+
+# ifdef FEAT_MOUSE_NET
+ /* There is no conflict, but one may type ESC } from Insert mode. Don't
+ * define it in the GUI or when using an xterm. */
+ if (!use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ set_mouse_termcode(KS_NETTERM_MOUSE,
+ (char_u *)IF_EB("\033}", ESC_STR "}"));
+ else
+ del_mouse_termcode(KS_NETTERM_MOUSE);
+# endif
+
+# ifdef FEAT_MOUSE_DEC
+ /* conflicts with xterm mouse: "\033[" and "\033[M" */
+ if (!use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ set_mouse_termcode(KS_DEC_MOUSE,
+ (char_u *)IF_EB("\033[", ESC_STR "["));
+ else
+ del_mouse_termcode(KS_DEC_MOUSE);
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ /* same as the dec mouse */
+ if (!use_xterm_mouse()
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ set_mouse_termcode(KS_PTERM_MOUSE,
+ (char_u *) IF_EB("\033[", ESC_STR "["));
+ else
+ del_mouse_termcode(KS_PTERM_MOUSE);
+# endif
+}
+#endif
+
+/*
+ * set screen mode, always fails.
+ */
+/* ARGSUSED */
+ int
+mch_screenmode(arg)
+ char_u *arg;
+{
+ EMSG(_(e_screenmode));
+ return FAIL;
+}
+
+#ifndef VMS
+
+/*
+ * Try to get the current window size:
+ * 1. with an ioctl(), most accurate method
+ * 2. from the environment variables LINES and COLUMNS
+ * 3. from the termcap
+ * 4. keep using the old values
+ * Return OK when size could be determined, FAIL otherwise.
+ */
+ int
+mch_get_shellsize()
+{
+ long rows = 0;
+ long columns = 0;
+ char_u *p;
+
+ /*
+ * For OS/2 use _scrsize().
+ */
+# ifdef __EMX__
+ {
+ int s[2];
+
+ _scrsize(s);
+ columns = s[0];
+ rows = s[1];
+ }
+# endif
+
+ /*
+ * 1. try using an ioctl. It is the most accurate method.
+ *
+ * Try using TIOCGWINSZ first, some systems that have it also define
+ * TIOCGSIZE but don't have a struct ttysize.
+ */
+# ifdef TIOCGWINSZ
+ {
+ struct winsize ws;
+ int fd = 1;
+
+ /* When stdout is not a tty, use stdin for the ioctl(). */
+ if (!isatty(fd) && isatty(read_cmd_fd))
+ fd = read_cmd_fd;
+ if (ioctl(fd, TIOCGWINSZ, &ws) == 0)
+ {
+ columns = ws.ws_col;
+ rows = ws.ws_row;
+ }
+ }
+# else /* TIOCGWINSZ */
+# ifdef TIOCGSIZE
+ {
+ struct ttysize ts;
+ int fd = 1;
+
+ /* When stdout is not a tty, use stdin for the ioctl(). */
+ if (!isatty(fd) && isatty(read_cmd_fd))
+ fd = read_cmd_fd;
+ if (ioctl(fd, TIOCGSIZE, &ts) == 0)
+ {
+ columns = ts.ts_cols;
+ rows = ts.ts_lines;
+ }
+ }
+# endif /* TIOCGSIZE */
+# endif /* TIOCGWINSZ */
+
+ /*
+ * 2. get size from environment
+ */
+ if (columns == 0 || rows == 0)
+ {
+ if ((p = (char_u *)getenv("LINES")))
+ rows = atoi((char *)p);
+ if ((p = (char_u *)getenv("COLUMNS")))
+ columns = atoi((char *)p);
+ }
+
+#ifdef HAVE_TGETENT
+ /*
+ * 3. try reading "co" and "li" entries from termcap
+ */
+ if (columns == 0 || rows == 0)
+ getlinecol(&columns, &rows);
+#endif
+
+ /*
+ * 4. If everything fails, use the old values
+ */
+ if (columns <= 0 || rows <= 0)
+ return FAIL;
+
+ Rows = rows;
+ Columns = columns;
+ return OK;
+}
+
+/*
+ * Try to set the window size to Rows and Columns.
+ */
+ void
+mch_set_shellsize()
+{
+ if (*T_CWS)
+ {
+ /*
+ * NOTE: if you get an error here that term_set_winsize() is
+ * undefined, check the output of configure. It could probably not
+ * find a ncurses, termcap or termlib library.
+ */
+ term_set_winsize((int)Rows, (int)Columns);
+ out_flush();
+ screen_start(); /* don't know where cursor is now */
+ }
+}
+
+#endif /* VMS */
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize()
+{
+ /* Nothing to do. */
+}
+
+ int
+mch_call_shell(cmd, options)
+ char_u *cmd;
+ int options; /* SHELL_*, see vim.h */
+{
+#ifdef VMS
+ char *ifn = NULL;
+ char *ofn = NULL;
+#endif
+ int tmode = cur_tmode;
+#ifdef USE_SYSTEM /* use system() to start the shell: simple but slow */
+ int x;
+# ifndef __EMX__
+ char_u *newcmd; /* only needed for unix */
+# else
+ /*
+ * Set the preferred shell in the EMXSHELL environment variable (but
+ * only if it is different from what is already in the environment).
+ * Emx then takes care of whether to use "/c" or "-c" in an
+ * intelligent way. Simply pass the whole thing to emx's system() call.
+ * Emx also starts an interactive shell if system() is passed an empty
+ * string.
+ */
+ char_u *p, *old;
+
+ if (((old = (char_u *)getenv("EMXSHELL")) == NULL) || STRCMP(old, p_sh))
+ {
+ /* should check HAVE_SETENV, but I know we don't have it. */
+ p = alloc(10 + strlen(p_sh));
+ if (p)
+ {
+ sprintf((char *)p, "EMXSHELL=%s", p_sh);
+ putenv((char *)p); /* don't free the pointer! */
+ }
+ }
+# endif
+
+ out_flush();
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+
+# ifdef __EMX__
+ if (cmd == NULL)
+ x = system(""); /* this starts an interactive shell in emx */
+ else
+ x = system((char *)cmd);
+ /* system() returns -1 when error occurs in starting shell */
+ if (x == -1 && !emsg_silent)
+ {
+ MSG_PUTS(_("\nCannot execute shell "));
+ msg_outtrans(p_sh);
+ msg_putchar('\n');
+ }
+# else /* not __EMX__ */
+ if (cmd == NULL)
+ x = system((char *)p_sh);
+ else
+ {
+# ifdef VMS
+ if (ofn = strchr((char *)cmd, '>'))
+ *ofn++ = '\0';
+ if (ifn = strchr((char *)cmd, '<'))
+ {
+ char *p;
+
+ *ifn++ = '\0';
+ p = strchr(ifn,' '); /* chop off any trailing spaces */
+ if (p)
+ *p = '\0';
+ }
+ if (ofn)
+ x = vms_sys((char *)cmd, ofn, ifn);
+ else
+ x = system((char *)cmd);
+# else
+ newcmd = lalloc(STRLEN(p_sh)
+ + (extra_shell_arg == NULL ? 0 : STRLEN(extra_shell_arg))
+ + STRLEN(p_shcf) + STRLEN(cmd) + 4, TRUE);
+ if (newcmd == NULL)
+ x = 0;
+ else
+ {
+ sprintf((char *)newcmd, "%s %s %s %s", p_sh,
+ extra_shell_arg == NULL ? "" : (char *)extra_shell_arg,
+ (char *)p_shcf,
+ (char *)cmd);
+ x = system((char *)newcmd);
+ vim_free(newcmd);
+ }
+# endif
+ }
+# ifdef VMS
+ x = vms_sys_status(x);
+# endif
+ if (emsg_silent)
+ ;
+ else if (x == 127)
+ MSG_PUTS(_("\nCannot execute shell sh\n"));
+# endif /* __EMX__ */
+ else if (x && !(options & SHELL_SILENT))
+ {
+ MSG_PUTS(_("\nshell returned "));
+ msg_outnum((long)x);
+ msg_putchar('\n');
+ }
+
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+# ifdef FEAT_TITLE
+ resettitle();
+# endif
+ return x;
+
+#else /* USE_SYSTEM */ /* don't use system(), use fork()/exec() */
+
+#define EXEC_FAILED 122 /* Exit code when shell didn't execute. Don't use
+ 127, some shell use that already */
+
+ char_u *newcmd = NULL;
+ pid_t pid;
+ pid_t wait_pid = 0;
+# ifdef HAVE_UNION_WAIT
+ union wait status;
+# else
+ int status = -1;
+# endif
+ int retval = -1;
+ char **argv = NULL;
+ int argc;
+ int i;
+ char_u *p;
+ int inquote;
+# ifdef FEAT_GUI
+ int pty_master_fd = -1; /* for pty's */
+ int pty_slave_fd = -1;
+ char *tty_name;
+ int fd_toshell[2]; /* for pipes */
+ int fd_fromshell[2];
+ int pipe_error = FALSE;
+# ifdef HAVE_SETENV
+ char envbuf[50];
+# else
+ static char envbuf_Rows[20];
+ static char envbuf_Columns[20];
+# endif
+# endif
+ int did_settmode = FALSE; /* TRUE when settmode(TMODE_RAW) called */
+
+ out_flush();
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+
+ /*
+ * 1: find number of arguments
+ * 2: separate them and built argv[]
+ */
+ newcmd = vim_strsave(p_sh);
+ if (newcmd == NULL) /* out of memory */
+ goto error;
+ for (i = 0; i < 2; ++i)
+ {
+ p = newcmd;
+ inquote = FALSE;
+ argc = 0;
+ for (;;)
+ {
+ if (i == 1)
+ argv[argc] = (char *)p;
+ ++argc;
+ while (*p && (inquote || (*p != ' ' && *p != TAB)))
+ {
+ if (*p == '"')
+ inquote = !inquote;
+ ++p;
+ }
+ if (*p == NUL)
+ break;
+ if (i == 1)
+ *p++ = NUL;
+ p = skipwhite(p);
+ }
+ if (i == 0)
+ {
+ argv = (char **)alloc((unsigned)((argc + 4) * sizeof(char *)));
+ if (argv == NULL) /* out of memory */
+ goto error;
+ }
+ }
+ if (cmd != NULL)
+ {
+ if (extra_shell_arg != NULL)
+ argv[argc++] = (char *)extra_shell_arg;
+ argv[argc++] = (char *)p_shcf;
+ argv[argc++] = (char *)cmd;
+ }
+ argv[argc] = NULL;
+
+# ifdef FEAT_GUI
+ /*
+ * For the GUI: Try using a pseudo-tty to get the stdin/stdout of the
+ * executed command into the Vim window. Or use a pipe.
+ */
+ if (gui.in_use && show_shell_mess)
+ {
+ /*
+ * Try to open a master pty.
+ * If this works, open the slave pty.
+ * If the slave can't be opened, close the master pty.
+ */
+ if (p_guipty)
+ {
+ pty_master_fd = OpenPTY(&tty_name); /* open pty */
+ if (pty_master_fd >= 0 && ((pty_slave_fd =
+ open(tty_name, O_RDWR | O_EXTRA, 0)) < 0))
+ {
+ close(pty_master_fd);
+ pty_master_fd = -1;
+ }
+ }
+ /*
+ * If not opening a pty or it didn't work, try using pipes.
+ */
+ if (pty_master_fd < 0)
+ {
+ pipe_error = (pipe(fd_toshell) < 0);
+ if (!pipe_error) /* pipe create OK */
+ {
+ pipe_error = (pipe(fd_fromshell) < 0);
+ if (pipe_error) /* pipe create failed */
+ {
+ close(fd_toshell[0]);
+ close(fd_toshell[1]);
+ }
+ }
+ if (pipe_error)
+ {
+ MSG_PUTS(_("\nCannot create pipes\n"));
+ out_flush();
+ }
+ }
+ }
+
+ if (!pipe_error) /* pty or pipe opened or not used */
+# endif
+
+ {
+# ifdef __BEOS__
+ beos_cleanup_read_thread();
+# endif
+ if ((pid = fork()) == -1) /* maybe we should use vfork() */
+ {
+ MSG_PUTS(_("\nCannot fork\n"));
+# ifdef FEAT_GUI
+ if (gui.in_use && show_shell_mess)
+ {
+ if (pty_master_fd >= 0) /* close the pseudo tty */
+ {
+ close(pty_master_fd);
+ close(pty_slave_fd);
+ }
+ else /* close the pipes */
+ {
+ close(fd_toshell[0]);
+ close(fd_toshell[1]);
+ close(fd_fromshell[0]);
+ close(fd_fromshell[1]);
+ }
+ }
+# endif
+ }
+ else if (pid == 0) /* child */
+ {
+ reset_signals(); /* handle signals normally */
+
+ if (!show_shell_mess || (options & SHELL_EXPAND))
+ {
+ int fd;
+
+ /*
+ * Don't want to show any message from the shell. Can't just
+ * close stdout and stderr though, because some systems will
+ * break if you try to write to them after that, so we must
+ * use dup() to replace them with something else -- webb
+ * Connect stdin to /dev/null too, so ":n `cat`" doesn't hang,
+ * waiting for input.
+ */
+ fd = open("/dev/null", O_RDWR | O_EXTRA, 0);
+ fclose(stdin);
+ fclose(stdout);
+ fclose(stderr);
+
+ /*
+ * If any of these open()'s and dup()'s fail, we just continue
+ * anyway. It's not fatal, and on most systems it will make
+ * no difference at all. On a few it will cause the execvp()
+ * to exit with a non-zero status even when the completion
+ * could be done, which is nothing too serious. If the open()
+ * or dup() failed we'd just do the same thing ourselves
+ * anyway -- webb
+ */
+ if (fd >= 0)
+ {
+ dup(fd); /* To replace stdin (file descriptor 0) */
+ dup(fd); /* To replace stdout (file descriptor 1) */
+ dup(fd); /* To replace stderr (file descriptor 2) */
+
+ /* Don't need this now that we've duplicated it */
+ close(fd);
+ }
+ }
+# ifdef FEAT_GUI
+ else if (gui.in_use)
+ {
+
+# ifdef HAVE_SETSID
+ (void)setsid();
+# endif
+ /* push stream discipline modules */
+ if (options & SHELL_COOKED)
+ SetupSlavePTY(pty_slave_fd);
+# ifdef TIOCSCTTY
+ /* try to become controlling tty (probably doesn't work,
+ * unless run by root) */
+ ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
+# endif
+ /* Simulate to have a dumb terminal (for now) */
+# ifdef HAVE_SETENV
+ setenv("TERM", "dumb", 1);
+ sprintf((char *)envbuf, "%ld", Rows);
+ setenv("ROWS", (char *)envbuf, 1);
+ sprintf((char *)envbuf, "%ld", Rows);
+ setenv("LINES", (char *)envbuf, 1);
+ sprintf((char *)envbuf, "%ld", Columns);
+ setenv("COLUMNS", (char *)envbuf, 1);
+# else
+ /*
+ * Putenv does not copy the string, it has to remain valid.
+ * Use a static array to avoid loosing allocated memory.
+ */
+ putenv("TERM=dumb");
+ sprintf(envbuf_Rows, "ROWS=%ld", Rows);
+ putenv(envbuf_Rows);
+ sprintf(envbuf_Rows, "LINES=%ld", Rows);
+ putenv(envbuf_Rows);
+ sprintf(envbuf_Columns, "COLUMNS=%ld", Columns);
+ putenv(envbuf_Columns);
+# endif
+
+ if (pty_master_fd >= 0)
+ {
+ close(pty_master_fd); /* close master side of pty */
+
+ /* set up stdin/stdout/stderr for the child */
+ close(0);
+ dup(pty_slave_fd);
+ close(1);
+ dup(pty_slave_fd);
+ close(2);
+ dup(pty_slave_fd);
+
+ close(pty_slave_fd); /* has been dupped, close it now */
+ }
+ else
+ {
+ /* set up stdin for the child */
+ close(fd_toshell[1]);
+ close(0);
+ dup(fd_toshell[0]);
+ close(fd_toshell[0]);
+
+ /* set up stdout for the child */
+ close(fd_fromshell[0]);
+ close(1);
+ dup(fd_fromshell[1]);
+ close(fd_fromshell[1]);
+
+ /* set up stderr for the child */
+ close(2);
+ dup(1);
+ }
+ }
+# endif /* FEAT_GUI */
+ /*
+ * There is no type cast for the argv, because the type may be
+ * different on different machines. This may cause a warning
+ * message with strict compilers, don't worry about it.
+ * Call _exit() instead of exit() to avoid closing the connection
+ * to the X server (esp. with GTK, which uses atexit()).
+ */
+ execvp(argv[0], argv);
+ _exit(EXEC_FAILED); /* exec failed, return failure code */
+ }
+ else /* parent */
+ {
+ /*
+ * While child is running, ignore terminating signals.
+ */
+ catch_signals(SIG_IGN, SIG_ERR);
+
+# ifdef FEAT_GUI
+
+ /*
+ * For the GUI we redirect stdin, stdout and stderr to our window.
+ */
+ if (gui.in_use && show_shell_mess)
+ {
+# define BUFLEN 100 /* length for buffer, pseudo tty limit is 128 */
+ char_u buffer[BUFLEN + 1];
+# ifdef FEAT_MBYTE
+ int buffer_off = 0; /* valid bytes in buffer[] */
+# endif
+ char_u ta_buf[BUFLEN + 1]; /* TypeAHead */
+ int ta_len = 0; /* valid bytes in ta_buf[] */
+ int len;
+ int p_more_save;
+ int old_State;
+ int c;
+ int toshell_fd;
+ int fromshell_fd;
+
+ if (pty_master_fd >= 0)
+ {
+ close(pty_slave_fd); /* close slave side of pty */
+ fromshell_fd = pty_master_fd;
+ toshell_fd = dup(pty_master_fd);
+ }
+ else
+ {
+ close(fd_toshell[0]);
+ close(fd_fromshell[1]);
+ toshell_fd = fd_toshell[1];
+ fromshell_fd = fd_fromshell[0];
+ }
+
+ /*
+ * Write to the child if there are typed characters.
+ * Read from the child if there are characters available.
+ * Repeat the reading a few times if more characters are
+ * available. Need to check for typed keys now and then, but
+ * not too often (delays when no chars are available).
+ * This loop is quit if no characters can be read from the pty
+ * (WaitForChar detected special condition), or there are no
+ * characters available and the child has exited.
+ * Only check if the child has exited when there is no more
+ * output. The child may exit before all the output has
+ * been printed.
+ *
+ * Currently this busy loops!
+ * This can probably dead-lock when the write blocks!
+ */
+ p_more_save = p_more;
+ p_more = FALSE;
+ old_State = State;
+ State = EXTERNCMD; /* don't redraw at window resize */
+
+ for (;;)
+ {
+ /*
+ * Check if keys have been typed, write them to the child
+ * if there are any. Don't do this if we are expanding
+ * wild cards (would eat typeahead). Don't get extra
+ * characters when we already have one.
+ */
+ len = 0;
+ if (!(options & SHELL_EXPAND)
+ && (ta_len > 0
+ || (len = ui_inchar(ta_buf, BUFLEN, 10L,
+ 0)) > 0))
+ {
+ /*
+ * For pipes:
+ * Check for CTRL-C: send interrupt signal to child.
+ * Check for CTRL-D: EOF, close pipe to child.
+ */
+ if (len == 1 && (pty_master_fd < 0 || cmd != NULL))
+ {
+# ifdef SIGINT
+ /*
+ * Send SIGINT to the child's group or all
+ * processes in our group.
+ */
+ if (ta_buf[ta_len] == Ctrl_C
+ || ta_buf[ta_len] == intr_char)
+# ifdef HAVE_SETSID
+ kill(-pid, SIGINT);
+# else
+ kill(0, SIGINT);
+# endif
+# endif
+ if (pty_master_fd < 0 && toshell_fd >= 0
+ && ta_buf[ta_len] == Ctrl_D)
+ {
+ close(toshell_fd);
+ toshell_fd = -1;
+ }
+ }
+
+ /* replace K_BS by <BS> and K_DEL by <DEL> */
+ for (i = ta_len; i < ta_len + len; ++i)
+ {
+ if (ta_buf[i] == CSI && len - i > 2)
+ {
+ c = TERMCAP2KEY(ta_buf[i + 1], ta_buf[i + 2]);
+ if (c == K_DEL || c == K_KDEL || c == K_BS)
+ {
+ mch_memmove(ta_buf + i + 1, ta_buf + i + 3,
+ (size_t)(len - i - 2));
+ if (c == K_DEL || c == K_KDEL)
+ ta_buf[i] = DEL;
+ else
+ ta_buf[i] = Ctrl_H;
+ len -= 2;
+ }
+ }
+ else if (ta_buf[i] == '\r')
+ ta_buf[i] = '\n';
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ i += (*mb_ptr2len_check)(ta_buf + i) - 1;
+# endif
+ }
+
+ /*
+ * For pipes: echo the typed characters.
+ * For a pty this does not seem to work.
+ */
+ if (pty_master_fd < 0)
+ {
+ for (i = ta_len; i < ta_len + len; ++i)
+ {
+ if (ta_buf[i] == '\n' || ta_buf[i] == '\b')
+ msg_putchar(ta_buf[i]);
+# ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ {
+ int l = (*mb_ptr2len_check)(ta_buf + i);
+
+ msg_outtrans_len(ta_buf + i, l);
+ i += l - 1;
+ }
+# endif
+ else
+ msg_outtrans_len(ta_buf + i, 1);
+ }
+ windgoto(msg_row, msg_col);
+ out_flush();
+ }
+
+ ta_len += len;
+
+ /*
+ * Write the characters to the child, unless EOF has
+ * been typed for pipes. Write one character at a
+ * time, to avoid loosing too much typeahead.
+ */
+ if (toshell_fd >= 0)
+ {
+ len = write(toshell_fd, (char *)ta_buf, (size_t)1);
+ if (len > 0)
+ {
+ ta_len -= len;
+ mch_memmove(ta_buf, ta_buf + len, ta_len);
+ }
+ }
+ }
+
+ /*
+ * Check if the child has any characters to be printed.
+ * Read them and write them to our window. Repeat this as
+ * long as there is something to do, avoid the 10ms wait
+ * for mch_inchar(), or sending typeahead characters to
+ * the external process.
+ * TODO: This should handle escape sequences, compatible
+ * to some terminal (vt52?).
+ */
+ while (RealWaitForChar(fromshell_fd, 10L, NULL))
+ {
+ len = read(fromshell_fd, (char *)buffer
+# ifdef FEAT_MBYTE
+ + buffer_off, (size_t)(BUFLEN - buffer_off)
+# else
+ , (size_t)BUFLEN
+# endif
+ );
+ if (len <= 0) /* end of file or error */
+ goto finished;
+# ifdef FEAT_MBYTE
+ len += buffer_off;
+ buffer[len] = NUL;
+ if (has_mbyte)
+ {
+ int l;
+
+ /* Check if the last character in buffer[] is
+ * incomplete, keep these bytes for the next
+ * round. */
+ for (p = buffer; p < buffer + len; p += l)
+ {
+ if (enc_utf8) /* exclude composing chars */
+ l = utf_ptr2len_check(p);
+ else
+ l = (*mb_ptr2len_check)(p);
+ if (l == 0)
+ l = 1; /* NUL byte? */
+ else if (MB_BYTE2LEN(*p) != l)
+ break;
+ }
+ if (p == buffer) /* no complete character */
+ {
+ /* avoid getting stuck at an illegal byte */
+ if (len >= 12)
+ ++p;
+ else
+ {
+ buffer_off = len;
+ continue;
+ }
+ }
+ c = *p;
+ *p = NUL;
+ msg_puts(buffer);
+ if (p < buffer + len)
+ {
+ *p = c;
+ buffer_off = (buffer + len) - p;
+ mch_memmove(buffer, p, buffer_off);
+ continue;
+ }
+ buffer_off = 0;
+ }
+ else
+# endif /* FEAT_MBYTE */
+ {
+ buffer[len] = NUL;
+ msg_puts(buffer);
+ }
+
+ windgoto(msg_row, msg_col);
+ cursor_on();
+ out_flush();
+ if (got_int)
+ break;
+ }
+
+ /*
+ * Check if the child still exists, before checking for
+ * typed characters (otherwise we would loose typeahead).
+ */
+# ifdef __NeXT__
+ wait_pid = wait4(pid, &status, WNOHANG, (struct rusage *) 0);
+# else
+ wait_pid = waitpid(pid, &status, WNOHANG);
+# endif
+ if ((wait_pid == (pid_t)-1 && errno == ECHILD)
+ || (wait_pid == pid && WIFEXITED(status)))
+ {
+ wait_pid = pid;
+ break;
+ }
+ wait_pid = 0;
+ }
+finished:
+ p_more = p_more_save;
+
+# ifndef MACOS_X_UNIX /* TODO: Is it needed for MACOS_X ? */
+ /*
+ * Give all typeahead that wasn't used back to ui_inchar().
+ */
+ if (ta_len)
+ ui_inchar_undo(ta_buf, ta_len);
+# endif
+ State = old_State;
+ if (toshell_fd >= 0)
+ close(toshell_fd);
+ close(fromshell_fd);
+ }
+# endif /* FEAT_GUI */
+
+ /*
+ * Wait until our child has exited.
+ * Ignore wait() returning pids of other children and returning
+ * because of some signal like SIGWINCH.
+ * Don't wait if wait_pid was already set above, indicating the
+ * child already exited.
+ */
+ while (wait_pid != pid)
+ {
+#ifdef _THREAD_SAFE
+ /* Ugly hack: when compiled with Python threads are probably
+ * used, in which case wait() sometimes hangs for no obvious
+ * reason. Use waitpid() instead and loop (like the GUI). */
+# ifdef __NeXT__
+ wait_pid = wait4(pid, &status, WNOHANG, (struct rusage *)0);
+# else
+ wait_pid = waitpid(pid, &status, WNOHANG);
+# endif
+ if (wait_pid == 0)
+ {
+ /* Wait for 1/100 sec before trying again. */
+ mch_delay(10L, TRUE);
+ continue;
+ }
+#else
+ wait_pid = wait(&status);
+#endif
+ if (wait_pid <= 0
+# ifdef ECHILD
+ && errno == ECHILD
+# endif
+ )
+ break;
+ }
+
+ /*
+ * Set to raw mode right now, otherwise a CTRL-C after
+ * catch_signals() will kill Vim.
+ */
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW);
+ did_settmode = TRUE;
+ set_signals();
+
+ if (WIFEXITED(status))
+ {
+ retval = WEXITSTATUS(status);
+ if (retval && !emsg_silent)
+ {
+ if (retval == EXEC_FAILED)
+ {
+ MSG_PUTS(_("\nCannot execute shell "));
+ msg_outtrans(p_sh);
+ msg_putchar('\n');
+ }
+ else if (!(options & SHELL_SILENT))
+ {
+ MSG_PUTS(_("\nshell returned "));
+ msg_outnum((long)retval);
+ msg_putchar('\n');
+ }
+ }
+ }
+ else
+ MSG_PUTS(_("\nCommand terminated\n"));
+ }
+ }
+ vim_free(argv);
+
+error:
+ if (!did_settmode)
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+# ifdef FEAT_TITLE
+ resettitle();
+# endif
+ vim_free(newcmd);
+
+ return retval;
+
+#endif /* USE_SYSTEM */
+}
+
+/*
+ * Check for CTRL-C typed by reading all available characters.
+ * In cooked mode we should get SIGINT, no need to check.
+ */
+ void
+mch_breakcheck()
+{
+ if (curr_tmode == TMODE_RAW && RealWaitForChar(read_cmd_fd, 0L, NULL))
+ fill_input_buf(FALSE);
+}
+
+/*
+ * Wait "msec" msec until a character is available from the keyboard or from
+ * inbuf[]. msec == -1 will block forever.
+ * When a GUI is being used, this will never get called -- webb
+ */
+ static int
+WaitForChar(msec)
+ long msec;
+{
+#ifdef FEAT_MOUSE_GPM
+ int gpm_process_wanted;
+#endif
+#ifdef FEAT_XCLIPBOARD
+ int rest;
+#endif
+ int avail;
+
+ if (input_available()) /* something in inbuf[] */
+ return 1;
+
+#if defined(FEAT_MOUSE_DEC)
+ /* May need to query the mouse position. */
+ if (WantQueryMouse)
+ {
+ WantQueryMouse = 0;
+ mch_write((char_u *)IF_EB("\033[1'|", ESC_STR "[1'|"), 5);
+ }
+#endif
+
+ /*
+ * For FEAT_MOUSE_GPM and FEAT_XCLIPBOARD we loop here to process mouse
+ * events. This is a bit complicated, because they might both be defined.
+ */
+#if defined(FEAT_MOUSE_GPM) || defined(FEAT_XCLIPBOARD)
+# ifdef FEAT_XCLIPBOARD
+ rest = 0;
+ if (do_xterm_trace())
+ rest = msec;
+# endif
+ do
+ {
+# ifdef FEAT_XCLIPBOARD
+ if (rest != 0)
+ {
+ msec = XT_TRACE_DELAY;
+ if (rest >= 0 && rest < XT_TRACE_DELAY)
+ msec = rest;
+ if (rest >= 0)
+ rest -= msec;
+ }
+# endif
+# ifdef FEAT_MOUSE_GPM
+ gpm_process_wanted = 0;
+ avail = RealWaitForChar(read_cmd_fd, msec, &gpm_process_wanted);
+# else
+ avail = RealWaitForChar(read_cmd_fd, msec, NULL);
+# endif
+ if (!avail)
+ {
+ if (input_available())
+ return 1;
+# ifdef FEAT_XCLIPBOARD
+ if (rest == 0 || !do_xterm_trace())
+# endif
+ break;
+ }
+ }
+ while (FALSE
+# ifdef FEAT_MOUSE_GPM
+ || (gpm_process_wanted && mch_gpm_process() == 0)
+# endif
+# ifdef FEAT_XCLIPBOARD
+ || (!avail && rest != 0)
+# endif
+ );
+
+#else
+ avail = RealWaitForChar(read_cmd_fd, msec, NULL);
+#endif
+ return avail;
+}
+
+/*
+ * Wait "msec" msec until a character is available from file descriptor "fd".
+ * Time == -1 will block forever.
+ * When a GUI is being used, this will not be used for input -- webb
+ * Returns also, when a request from Sniff is waiting -- toni.
+ * Or when a Linux GPM mouse event is waiting.
+ */
+/* ARGSUSED */
+#if defined(__BEOS__)
+ int
+#else
+ static int
+#endif
+RealWaitForChar(fd, msec, check_for_gpm)
+ int fd;
+ long msec;
+ int *check_for_gpm;
+{
+ int ret;
+#if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP)
+ static int busy = FALSE;
+
+ /* May retry getting characters after an event was handled. */
+# define MAY_LOOP
+
+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+ /* Remember at what time we started, so that we know how much longer we
+ * should wait after being interrupted. */
+# define USE_START_TV
+ struct timeval start_tv;
+
+ if (msec > 0 && (
+# ifdef FEAT_XCLIPBOARD
+ xterm_Shell != (Widget)0
+# ifdef USE_XSMP
+ ||
+# endif
+# endif
+# ifdef USE_XSMP
+ xsmp_icefd != -1
+# endif
+ ))
+ gettimeofday(&start_tv, NULL);
+# endif
+
+ /* Handle being called recursively. This may happen for the session
+ * manager stuff, it may save the file, which does a breakcheck. */
+ if (busy)
+ return 0;
+#endif
+
+#ifdef MAY_LOOP
+ while (1)
+#endif
+ {
+#ifdef MAY_LOOP
+ int finished = TRUE; /* default is to 'loop' just once */
+#endif
+#ifndef HAVE_SELECT
+ struct pollfd fds[5];
+ int nfd;
+# ifdef FEAT_XCLIPBOARD
+ int xterm_idx = -1;
+# endif
+# ifdef FEAT_MOUSE_GPM
+ int gpm_idx = -1;
+# endif
+# ifdef USE_XSMP
+ int xsmp_idx = -1;
+# endif
+
+ fds[0].fd = fd;
+ fds[0].events = POLLIN;
+ nfd = 1;
+
+# ifdef FEAT_SNIFF
+# define SNIFF_IDX 1
+ if (want_sniff_request)
+ {
+ fds[SNIFF_IDX].fd = fd_from_sniff;
+ fds[SNIFF_IDX].events = POLLIN;
+ nfd++;
+ }
+# endif
+# ifdef FEAT_XCLIPBOARD
+ if (xterm_Shell != (Widget)0)
+ {
+ xterm_idx = nfd;
+ fds[nfd].fd = ConnectionNumber(xterm_dpy);
+ fds[nfd].events = POLLIN;
+ nfd++;
+ }
+# endif
+# ifdef FEAT_MOUSE_GPM
+ if (check_for_gpm != NULL && gpm_flag && gpm_fd >= 0)
+ {
+ gpm_idx = nfd;
+ fds[nfd].fd = gpm_fd;
+ fds[nfd].events = POLLIN;
+ nfd++;
+ }
+# endif
+# ifdef USE_XSMP
+ if (xsmp_icefd != -1)
+ {
+ xsmp_idx = nfd;
+ fds[nfd].fd = xsmp_icefd;
+ fds[nfd].events = POLLIN;
+ nfd++;
+ }
+# endif
+
+ ret = poll(fds, nfd, (int)msec);
+
+# ifdef FEAT_SNIFF
+ if (ret < 0)
+ sniff_disconnect(1);
+ else if (want_sniff_request)
+ {
+ if (fds[SNIFF_IDX].revents & POLLHUP)
+ sniff_disconnect(1);
+ if (fds[SNIFF_IDX].revents & POLLIN)
+ sniff_request_waiting = 1;
+ }
+# endif
+# ifdef FEAT_XCLIPBOARD
+ if (xterm_Shell != (Widget)0 && (fds[xterm_idx].revents & POLLIN))
+ {
+ xterm_update(); /* Maybe we should hand out clipboard */
+ if (--ret == 0 && !input_available())
+ /* Try again */
+ finished = FALSE;
+ }
+# endif
+# ifdef FEAT_MOUSE_GPM
+ if (gpm_idx >= 0 && (fds[gpm_idx].revents & POLLIN))
+ {
+ *check_for_gpm = 1;
+ }
+# endif
+# ifdef USE_XSMP
+ if (xsmp_idx >= 0 && (fds[xsmp_idx].revents & (POLLIN | POLLHUP)))
+ {
+ if (fds[xsmp_idx].revents & POLLIN)
+ {
+ busy = TRUE;
+ xsmp_handle_requests();
+ busy = FALSE;
+ }
+ else if (fds[xsmp_idx].revents & POLLHUP)
+ {
+ if (p_verbose > 0)
+ MSG(_("XSMP lost ICE connection"));
+ xsmp_close();
+ }
+ if (--ret == 0)
+ /* Try again */
+ finished = FALSE;
+ }
+# endif
+
+
+#else /* HAVE_SELECT */
+
+ struct timeval tv;
+ fd_set rfds, efds;
+ int maxfd;
+
+# ifdef __EMX__
+ /* don't check for incoming chars if not in raw mode, because select()
+ * always returns TRUE then (in some version of emx.dll) */
+ if (curr_tmode != TMODE_RAW)
+ return 0;
+# endif
+
+ if (msec >= 0)
+ {
+ tv.tv_sec = msec / 1000;
+ tv.tv_usec = (msec % 1000) * (1000000/1000);
+ }
+
+ /*
+ * Select on ready for reading and exceptional condition (end of file).
+ */
+ FD_ZERO(&rfds); /* calls bzero() on a sun */
+ FD_ZERO(&efds);
+ FD_SET(fd, &rfds);
+# if !defined(__QNX__) && !defined(__CYGWIN32__)
+ /* For QNX select() always returns 1 if this is set. Why? */
+ FD_SET(fd, &efds);
+# endif
+ maxfd = fd;
+
+# ifdef FEAT_SNIFF
+ if (want_sniff_request)
+ {
+ FD_SET(fd_from_sniff, &rfds);
+ FD_SET(fd_from_sniff, &efds);
+ if (maxfd < fd_from_sniff)
+ maxfd = fd_from_sniff;
+ }
+# endif
+# ifdef FEAT_XCLIPBOARD
+ if (xterm_Shell != (Widget)0)
+ {
+ FD_SET(ConnectionNumber(xterm_dpy), &rfds);
+ if (maxfd < ConnectionNumber(xterm_dpy))
+ maxfd = ConnectionNumber(xterm_dpy);
+ }
+# endif
+# ifdef FEAT_MOUSE_GPM
+ if (check_for_gpm != NULL && gpm_flag && gpm_fd >= 0)
+ {
+ FD_SET(gpm_fd, &rfds);
+ FD_SET(gpm_fd, &efds);
+ if (maxfd < gpm_fd)
+ maxfd = gpm_fd;
+ }
+# endif
+# ifdef USE_XSMP
+ if (xsmp_icefd != -1)
+ {
+ FD_SET(xsmp_icefd, &rfds);
+ FD_SET(xsmp_icefd, &efds);
+ if (maxfd < xsmp_icefd)
+ maxfd = xsmp_icefd;
+ }
+# endif
+
+# ifdef OLD_VMS
+ /* Old VMS as v6.2 and older have broken select(). It waits more than
+ * required. Should not be used */
+ ret = 0;
+# else
+ ret = select(maxfd + 1, &rfds, NULL, &efds, (msec >= 0) ? &tv : NULL);
+# endif
+
+# ifdef FEAT_SNIFF
+ if (ret < 0 )
+ sniff_disconnect(1);
+ else if (ret > 0 && want_sniff_request)
+ {
+ if (FD_ISSET(fd_from_sniff, &efds))
+ sniff_disconnect(1);
+ if (FD_ISSET(fd_from_sniff, &rfds))
+ sniff_request_waiting = 1;
+ }
+# endif
+# ifdef FEAT_XCLIPBOARD
+ if (ret > 0 && xterm_Shell != (Widget)0
+ && FD_ISSET(ConnectionNumber(xterm_dpy), &rfds))
+ {
+ xterm_update(); /* Maybe we should hand out clipboard */
+ /* continue looping when we only got the X event and the input
+ * buffer is empty */
+ if (--ret == 0 && !input_available())
+ {
+ /* Try again */
+ finished = FALSE;
+ }
+ }
+# endif
+# ifdef FEAT_MOUSE_GPM
+ if (ret > 0 && gpm_flag && check_for_gpm != NULL && gpm_fd >= 0)
+ {
+ if (FD_ISSET(gpm_fd, &efds))
+ gpm_close();
+ else if (FD_ISSET(gpm_fd, &rfds))
+ *check_for_gpm = 1;
+ }
+# endif
+# ifdef USE_XSMP
+ if (ret > 0 && xsmp_icefd != -1)
+ {
+ if (FD_ISSET(xsmp_icefd, &efds))
+ {
+ if (p_verbose > 0)
+ MSG(_("XSMP lost ICE connection"));
+ xsmp_close();
+ if (--ret == 0)
+ finished = FALSE; /* keep going if event was only one */
+ }
+ else if (FD_ISSET(xsmp_icefd, &rfds))
+ {
+ busy = TRUE;
+ xsmp_handle_requests();
+ busy = FALSE;
+ if (--ret == 0)
+ finished = FALSE; /* keep going if event was only one */
+ }
+ }
+# endif
+
+#endif /* HAVE_SELECT */
+
+#ifdef MAY_LOOP
+ if (finished || msec == 0)
+ break;
+
+ /* We're going to loop around again, find out for how long */
+ if (msec > 0)
+ {
+# ifdef USE_START_TV
+ struct timeval mtv;
+
+ /* Compute remaining wait time. */
+ gettimeofday(&mtv, NULL);
+ msec -= (mtv.tv_sec - start_tv.tv_sec) * 1000L
+ + (mtv.tv_usec - start_tv.tv_usec) / 1000L;
+# else
+ /* Guess we got interrupted halfway. */
+ msec = msec / 2;
+# endif
+ if (msec <= 0)
+ break; /* waited long enough */
+ }
+#endif
+ }
+
+ return (ret > 0);
+}
+
+#ifndef VMS
+
+#ifndef NO_EXPANDPATH
+ static int
+pstrcmp(a, b)
+ const void *a, *b;
+{
+ return (pathcmp(*(char **)a, *(char **)b));
+}
+
+/*
+ * Recursively expand one path component into all matching files and/or
+ * directories.
+ * "path" has backslashes before chars that are not to be expanded, starting
+ * at "path + wildoff".
+ * Return the number of matches found.
+ */
+ int
+mch_expandpath(gap, path, flags)
+ garray_T *gap;
+ char_u *path;
+ int flags; /* EW_* flags */
+{
+ return unix_expandpath(gap, path, 0, flags);
+}
+
+ static int
+unix_expandpath(gap, path, wildoff, flags)
+ garray_T *gap;
+ char_u *path;
+ int wildoff;
+ int flags; /* EW_* flags */
+{
+ char_u *buf;
+ char_u *path_end;
+ char_u *p, *s, *e;
+ int start_len, c;
+ char_u *pat;
+ DIR *dirp;
+ regmatch_T regmatch;
+ struct dirent *dp;
+ int starts_with_dot;
+ int matches;
+ int len;
+
+ start_len = gap->ga_len;
+ buf = alloc(STRLEN(path) + BASENAMELEN + 5);/* make room for file name */
+ if (buf == NULL)
+ return 0;
+
+/*
+ * Find the first part in the path name that contains a wildcard.
+ * Copy it into buf, including the preceding characters.
+ */
+ p = buf;
+ s = buf;
+ e = NULL;
+ path_end = path;
+ while (*path_end != NUL)
+ {
+ /* May ignore a wildcard that has a backslash before it; it will
+ * be removed by rem_backslash() or file_pat_to_reg_pat() below. */
+ if (path_end >= path + wildoff && rem_backslash(path_end))
+ *p++ = *path_end++;
+ else if (*path_end == '/')
+ {
+ if (e != NULL)
+ break;
+ s = p + 1;
+ }
+ else if (path_end >= path + wildoff
+ && vim_strchr((char_u *)"*?[{~$", *path_end) != NULL)
+ e = p;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ len = (*mb_ptr2len_check)(path_end);
+ STRNCPY(p, path_end, len);
+ p += len;
+ path_end += len;
+ }
+ else
+#endif
+ *p++ = *path_end++;
+ }
+ e = p;
+ *e = NUL;
+
+ /* now we have one wildcard component between s and e */
+ /* Remove backslashes between "wildoff" and the start of the wildcard
+ * component. */
+ for (p = buf + wildoff; p < s; ++p)
+ if (rem_backslash(p))
+ {
+ STRCPY(p, p + 1);
+ --e;
+ --s;
+ }
+
+ /* convert the file pattern to a regexp pattern */
+ starts_with_dot = (*s == '.');
+ pat = file_pat_to_reg_pat(s, e, NULL, FALSE);
+ if (pat == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* compile the regexp into a program */
+#ifdef MACOS_X /* Can/Should we use CASE_INSENSITIVE_FILENAME instead ?*/
+ regmatch.rm_ic = TRUE; /* Behave like Terminal.app */
+#else
+ regmatch.rm_ic = FALSE; /* Don't ever ignore case */
+#endif
+ regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+ vim_free(pat);
+
+ if (regmatch.regprog == NULL)
+ {
+ vim_free(buf);
+ return 0;
+ }
+
+ /* open the directory for scanning */
+ c = *s;
+ *s = NUL;
+ dirp = opendir(*buf == NUL ? "." : (char *)buf);
+ *s = c;
+
+ /* Find all matching entries */
+ if (dirp != NULL)
+ {
+ for (;;)
+ {
+ dp = readdir(dirp);
+ if (dp == NULL)
+ break;
+ if ((dp->d_name[0] != '.' || starts_with_dot)
+ && vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0))
+ {
+ STRCPY(s, dp->d_name);
+ len = STRLEN(buf);
+ STRCPY(buf + len, path_end);
+ if (mch_has_exp_wildcard(path_end)) /* handle more wildcards */
+ {
+ /* need to expand another component of the path */
+ /* remove backslashes for the remaining components only */
+ (void)unix_expandpath(gap, buf, len + 1, flags);
+ }
+ else
+ {
+ /* no more wildcards, check if there is a match */
+ /* remove backslashes for the remaining components only */
+ if (*path_end != NUL)
+ backslash_halve(buf + len + 1);
+ if (mch_getperm(buf) >= 0) /* add existing file */
+ addfile(gap, buf, flags);
+ }
+ }
+ }
+
+ closedir(dirp);
+ }
+
+ vim_free(buf);
+ vim_free(regmatch.regprog);
+
+ matches = gap->ga_len - start_len;
+ if (matches > 0)
+ qsort(((char_u **)gap->ga_data) + start_len, matches,
+ sizeof(char_u *), pstrcmp);
+ return matches;
+}
+#endif
+
+/*
+ * mch_expand_wildcards() - this code does wild-card pattern matching using
+ * the shell
+ *
+ * return OK for success, FAIL for error (you may lose some memory) and put
+ * an error message in *file.
+ *
+ * num_pat is number of input patterns
+ * pat is array of pointers to input patterns
+ * num_file is pointer to number of matched file names
+ * file is pointer to array of pointers to matched file names
+ */
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+#ifndef SEEK_END
+# define SEEK_END 2
+#endif
+
+/* ARGSUSED */
+ int
+mch_expand_wildcards(num_pat, pat, num_file, file, flags)
+ int num_pat;
+ char_u **pat;
+ int *num_file;
+ char_u ***file;
+ int flags; /* EW_* flags */
+{
+ int i;
+ size_t len;
+ char_u *p;
+ int dir;
+#ifdef __EMX__
+# define EXPL_ALLOC_INC 16
+ char_u **expl_files;
+ size_t files_alloced, files_free;
+ char_u *buf;
+ int has_wildcard;
+
+ *num_file = 0; /* default: no files found */
+ files_alloced = EXPL_ALLOC_INC; /* how much space is allocated */
+ files_free = EXPL_ALLOC_INC; /* how much space is not used */
+ *file = (char_u **)alloc(sizeof(char_u **) * files_alloced);
+ if (*file == NULL)
+ return FAIL;
+
+ for (; num_pat > 0; num_pat--, pat++)
+ {
+ expl_files = NULL;
+ if (vim_strchr(*pat, '$') || vim_strchr(*pat, '~'))
+ /* expand environment var or home dir */
+ buf = expand_env_save(*pat);
+ else
+ buf = vim_strsave(*pat);
+ expl_files = NULL;
+ has_wildcard = mch_has_exp_wildcard(buf); /* (still) wildcards in there? */
+ if (has_wildcard) /* yes, so expand them */
+ expl_files = (char_u **)_fnexplode(buf);
+
+ /*
+ * return value of buf if no wildcards left,
+ * OR if no match AND EW_NOTFOUND is set.
+ */
+ if ((!has_wildcard && ((flags & EW_NOTFOUND) || mch_getperm(buf) >= 0))
+ || (expl_files == NULL && (flags & EW_NOTFOUND)))
+ { /* simply save the current contents of *buf */
+ expl_files = (char_u **)alloc(sizeof(char_u **) * 2);
+ if (expl_files != NULL)
+ {
+ expl_files[0] = vim_strsave(buf);
+ expl_files[1] = NULL;
+ }
+ }
+ vim_free(buf);
+
+ /*
+ * Count number of names resulting from expansion,
+ * At the same time add a backslash to the end of names that happen to
+ * be directories, and replace slashes with backslashes.
+ */
+ if (expl_files)
+ {
+ for (i = 0; (p = expl_files[i]) != NULL; i++)
+ {
+ dir = mch_isdir(p);
+ /* If we don't want dirs and this is one, skip it */
+ if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
+ continue;
+
+ if (--files_free == 0)
+ {
+ /* need more room in table of pointers */
+ files_alloced += EXPL_ALLOC_INC;
+ *file = (char_u **)vim_realloc(*file,
+ sizeof(char_u **) * files_alloced);
+ if (*file == NULL)
+ {
+ EMSG(_(e_outofmem));
+ *num_file = 0;
+ return FAIL;
+ }
+ files_free = EXPL_ALLOC_INC;
+ }
+ slash_adjust(p);
+ if (dir)
+ {
+ /* For a directory we add a '/', unless it's already
+ * there. */
+ len = STRLEN(p);
+ if (((*file)[*num_file] = alloc(len + 2)) != NULL)
+ {
+ STRCPY((*file)[*num_file], p);
+ if (!vim_ispathsep((*file)[*num_file][len - 1]))
+ {
+ (*file)[*num_file][len] = psepc;
+ (*file)[*num_file][len + 1] = 0;
+ }
+ }
+ }
+ else
+ {
+ (*file)[*num_file] = vim_strsave(p);
+ }
+
+ /*
+ * Error message already given by either alloc or vim_strsave.
+ * Should return FAIL, but returning OK works also.
+ */
+ if ((*file)[*num_file] == NULL)
+ break;
+ (*num_file)++;
+ }
+ _fnexplodefree((char **)expl_files);
+ }
+ }
+ return OK;
+
+#else /* __EMX__ */
+
+ int j;
+ char_u *tempname;
+ char_u *command;
+ FILE *fd;
+ char_u *buffer;
+#define STYLE_ECHO 0 /* use "echo" to expand */
+#define STYLE_GLOB 1 /* use "glob" to expand, for csh */
+#define STYLE_PRINT 2 /* use "print -N" to expand, for zsh */
+#define STYLE_BT 3 /* `cmd` expansion, execute the pattern directly */
+ int shell_style = STYLE_ECHO;
+ int check_spaces;
+ static int did_find_nul = FALSE;
+ int ampersent = FALSE;
+
+ *num_file = 0; /* default: no files found */
+ *file = NULL;
+
+ /*
+ * If there are no wildcards, just copy the names to allocated memory.
+ * Saves a lot of time, because we don't have to start a new shell.
+ */
+ if (!have_wildcard(num_pat, pat))
+ return save_patterns(num_pat, pat, num_file, file);
+
+ /*
+ * Don't allow the use of backticks in secure and restricted mode.
+ */
+ if (secure || restricted)
+ for (i = 0; i < num_pat; ++i)
+ if (vim_strchr(pat[i], '`') != NULL
+ && (check_restricted() || check_secure()))
+ return FAIL;
+
+ /*
+ * get a name for the temp file
+ */
+ if ((tempname = vim_tempname('o')) == NULL)
+ {
+ EMSG(_(e_notmp));
+ return FAIL;
+ }
+
+ /*
+ * Let the shell expand the patterns and write the result into the temp
+ * file. if expanding `cmd` execute it directly.
+ * If we use csh, glob will work better than echo.
+ * If we use zsh, print -N will work better than glob.
+ */
+ if (num_pat == 1 && *pat[0] == '`'
+ && (len = STRLEN(pat[0])) > 2
+ && *(pat[0] + len - 1) == '`')
+ shell_style = STYLE_BT;
+ else if ((len = STRLEN(p_sh)) >= 3)
+ {
+ if (STRCMP(p_sh + len - 3, "csh") == 0)
+ shell_style = STYLE_GLOB;
+ else if (STRCMP(p_sh + len - 3, "zsh") == 0)
+ shell_style = STYLE_PRINT;
+ }
+
+ /* "unset nonomatch; print -N >" plus two is 29 */
+ len = STRLEN(tempname) + 29;
+ for (i = 0; i < num_pat; ++i) /* count the length of the patterns */
+ len += STRLEN(pat[i]) + 3; /* add space and two quotes */
+ command = alloc(len);
+ if (command == NULL)
+ {
+ /* out of memory */
+ vim_free(tempname);
+ return FAIL;
+ }
+
+ /*
+ * Build the shell command:
+ * - Set $nonomatch depending on EW_NOTFOUND (hopefully the shell
+ * recognizes this).
+ * - Add the shell command to print the expanded names.
+ * - Add the temp file name.
+ * - Add the file name patterns.
+ */
+ if (shell_style == STYLE_BT)
+ {
+ STRCPY(command, pat[0] + 1); /* exclude first backtick */
+ p = command + STRLEN(command) - 1;
+ *p = ' '; /* remove last backtick */
+ while (p > command && vim_iswhite(*p))
+ --p;
+ if (*p == '&') /* remove trailing '&' */
+ {
+ ampersent = TRUE;
+ *p = ' ';
+ }
+ STRCAT(command, ">");
+ }
+ else
+ {
+ if (flags & EW_NOTFOUND)
+ STRCPY(command, "set nonomatch; ");
+ else
+ STRCPY(command, "unset nonomatch; ");
+ if (shell_style == STYLE_GLOB)
+ STRCAT(command, "glob >");
+ else if (shell_style == STYLE_PRINT)
+ STRCAT(command, "print -N >");
+ else
+ STRCAT(command, "echo >");
+ }
+ STRCAT(command, tempname);
+ if (shell_style != STYLE_BT)
+ for (i = 0; i < num_pat; ++i)
+ {
+ /* When using system() always add extra quotes, because the shell
+ * is started twice. Otherwise only put quotes around spaces and
+ * single quotes. */
+#ifdef USE_SYSTEM
+ STRCAT(command, " \"");
+ STRCAT(command, pat[i]);
+ STRCAT(command, "\"");
+#else
+ p = command + STRLEN(command);
+ *p++ = ' ';
+ for (j = 0; pat[i][j] != NUL; )
+ if (vim_strchr((char_u *)" '", pat[i][j]) != NULL)
+ {
+ *p++ = '"';
+ while (pat[i][j] != NUL
+ && vim_strchr((char_u *)" '", pat[i][j]) != NULL)
+ *p++ = pat[i][j++];
+ *p++ = '"';
+ }
+ else
+ *p++ = pat[i][j++];
+ *p = NUL;
+#endif
+ }
+ if (flags & EW_SILENT)
+ show_shell_mess = FALSE;
+ if (ampersent)
+ STRCAT(command, "&"); /* put the '&' back after the
+ redirection */
+
+ /*
+ * Using zsh -G: If a pattern has no matches, it is just deleted from
+ * the argument list, otherwise zsh gives an error message and doesn't
+ * expand any other pattern.
+ */
+ if (shell_style == STYLE_PRINT)
+ extra_shell_arg = (char_u *)"-G"; /* Use zsh NULL_GLOB option */
+
+ /*
+ * If we use -f then shell variables set in .cshrc won't get expanded.
+ * vi can do it, so we will too, but it is only necessary if there is a "$"
+ * in one of the patterns, otherwise we can still use the fast option.
+ */
+ else if (shell_style == STYLE_GLOB && !have_dollars(num_pat, pat))
+ extra_shell_arg = (char_u *)"-f"; /* Use csh fast option */
+
+ /*
+ * execute the shell command
+ */
+ i = call_shell(command, SHELL_EXPAND | SHELL_SILENT);
+
+ /* When running in the background, give it some time to create the temp
+ * file, but don't wait for it to finish. */
+ if (ampersent)
+ mch_delay(10L, TRUE);
+
+ extra_shell_arg = NULL; /* cleanup */
+ show_shell_mess = TRUE;
+ vim_free(command);
+
+ if (i) /* mch_call_shell() failed */
+ {
+ mch_remove(tempname);
+ vim_free(tempname);
+ /*
+ * With interactive completion, the error message is not printed.
+ * However with USE_SYSTEM, I don't know how to turn off error messages
+ * from the shell, so screen may still get messed up -- webb.
+ */
+#ifndef USE_SYSTEM
+ if (!(flags & EW_SILENT))
+#endif
+ {
+ redraw_later_clear(); /* probably messed up screen */
+ msg_putchar('\n'); /* clear bottom line quickly */
+ cmdline_row = Rows - 1; /* continue on last line */
+#ifdef USE_SYSTEM
+ if (!(flags & EW_SILENT))
+#endif
+ {
+ MSG(_(e_wildexpand));
+ msg_start(); /* don't overwrite this message */
+ }
+ }
+ /* If a `cmd` expansion failed, don't list `cmd` as a match, even when
+ * EW_NOTFOUND is given */
+ if (shell_style == STYLE_BT)
+ return FAIL;
+ goto notfound;
+ }
+
+ /*
+ * read the names from the file into memory
+ */
+ fd = fopen((char *)tempname, READBIN);
+ if (fd == NULL)
+ {
+ /* Something went wrong, perhaps a file name with a special char. */
+ if (!(flags & EW_SILENT))
+ {
+ MSG(_(e_wildexpand));
+ msg_start(); /* don't overwrite this message */
+ }
+ vim_free(tempname);
+ goto notfound;
+ }
+ fseek(fd, 0L, SEEK_END);
+ len = ftell(fd); /* get size of temp file */
+ fseek(fd, 0L, SEEK_SET);
+ buffer = alloc(len + 1);
+ if (buffer == NULL)
+ {
+ /* out of memory */
+ mch_remove(tempname);
+ vim_free(tempname);
+ fclose(fd);
+ return FAIL;
+ }
+ i = fread((char *)buffer, 1, len, fd);
+ fclose(fd);
+ mch_remove(tempname);
+ if (i != len)
+ {
+ /* unexpected read error */
+ EMSG2(_(e_notread), tempname);
+ vim_free(tempname);
+ vim_free(buffer);
+ return FAIL;
+ }
+ vim_free(tempname);
+
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+ /* Translate <CR><NL> into <NL>. Caution, buffer may contain NUL. */
+ p = buffer;
+ for (i = 0; i < len; ++i)
+ if (!(buffer[i] == CAR && buffer[i + 1] == NL))
+ *p++ = buffer[i];
+ len = p - buffer;
+# endif
+
+
+ /* file names are separated with Space */
+ if (shell_style == STYLE_ECHO)
+ {
+ buffer[len] = '\n'; /* make sure the buffer ends in NL */
+ p = buffer;
+ for (i = 0; *p != '\n'; ++i) /* count number of entries */
+ {
+ while (*p != ' ' && *p != '\n')
+ ++p;
+ p = skipwhite(p); /* skip to next entry */
+ }
+ }
+ /* file names are separated with NL */
+ else if (shell_style == STYLE_BT)
+ {
+ buffer[len] = NUL; /* make sure the buffer ends in NUL */
+ p = buffer;
+ for (i = 0; *p != NUL; ++i) /* count number of entries */
+ {
+ while (*p != '\n' && *p != NUL)
+ ++p;
+ if (*p != NUL)
+ ++p;
+ p = skipwhite(p); /* skip leading white space */
+ }
+ }
+ /* file names are separated with NUL */
+ else
+ {
+ /*
+ * Some versions of zsh use spaces instead of NULs to separate
+ * results. Only do this when there is no NUL before the end of the
+ * buffer, otherwise we would never be able to use file names with
+ * embedded spaces when zsh does use NULs.
+ * When we found a NUL once, we know zsh is OK, set did_find_nul and
+ * don't check for spaces again.
+ */
+ check_spaces = FALSE;
+ if (shell_style == STYLE_PRINT && !did_find_nul)
+ {
+ /* If there is a NUL, set did_find_nul, else set check_spaces */
+ if (len && (int)STRLEN(buffer) < len - 1)
+ did_find_nul = TRUE;
+ else
+ check_spaces = TRUE;
+ }
+
+ /*
+ * Make sure the buffer ends with a NUL. For STYLE_PRINT there
+ * already is one, for STYLE_GLOB it needs to be added.
+ */
+ if (len && buffer[len - 1] == NUL)
+ --len;
+ else
+ buffer[len] = NUL;
+ i = 0;
+ for (p = buffer; p < buffer + len; ++p)
+ if (*p == NUL || (*p == ' ' && check_spaces)) /* count entry */
+ {
+ ++i;
+ *p = NUL;
+ }
+ if (len)
+ ++i; /* count last entry */
+ }
+ if (i == 0)
+ {
+ /*
+ * Can happen when using /bin/sh and typing ":e $NO_SUCH_VAR^I".
+ * /bin/sh will happily expand it to nothing rather than returning an
+ * error; and hey, it's good to check anyway -- webb.
+ */
+ vim_free(buffer);
+ goto notfound;
+ }
+ *num_file = i;
+ *file = (char_u **)alloc(sizeof(char_u *) * i);
+ if (*file == NULL)
+ {
+ /* out of memory */
+ vim_free(buffer);
+ return FAIL;
+ }
+
+ /*
+ * Isolate the individual file names.
+ */
+ p = buffer;
+ for (i = 0; i < *num_file; ++i)
+ {
+ (*file)[i] = p;
+ /* Space or NL separates */
+ if (shell_style == STYLE_ECHO || shell_style == STYLE_BT)
+ {
+ while (!(shell_style == STYLE_ECHO && *p == ' ') && *p != '\n')
+ ++p;
+ if (p == buffer + len) /* last entry */
+ *p = NUL;
+ else
+ {
+ *p++ = NUL;
+ p = skipwhite(p); /* skip to next entry */
+ }
+ }
+ else /* NUL separates */
+ {
+ while (*p && p < buffer + len) /* skip entry */
+ ++p;
+ ++p; /* skip NUL */
+ }
+ }
+
+ /*
+ * Move the file names to allocated memory.
+ */
+ for (j = 0, i = 0; i < *num_file; ++i)
+ {
+ /* Require the files to exist. Helps when using /bin/sh */
+ if (!(flags & EW_NOTFOUND) && mch_getperm((*file)[i]) < 0)
+ continue;
+
+ /* check if this entry should be included */
+ dir = (mch_isdir((*file)[i]));
+ if ((dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
+ continue;
+
+ p = alloc((unsigned)(STRLEN((*file)[i]) + 1 + dir));
+ if (p)
+ {
+ STRCPY(p, (*file)[i]);
+ if (dir)
+ STRCAT(p, "/"); /* add '/' to a directory name */
+ (*file)[j++] = p;
+ }
+ }
+ vim_free(buffer);
+ *num_file = j;
+
+ if (*num_file == 0) /* rejected all entries */
+ {
+ vim_free(*file);
+ *file = NULL;
+ goto notfound;
+ }
+
+ return OK;
+
+notfound:
+ if (flags & EW_NOTFOUND)
+ return save_patterns(num_pat, pat, num_file, file);
+ return FAIL;
+
+#endif /* __EMX__ */
+}
+
+#endif /* VMS */
+
+#ifndef __EMX__
+ static int
+save_patterns(num_pat, pat, num_file, file)
+ int num_pat;
+ char_u **pat;
+ int *num_file;
+ char_u ***file;
+{
+ int i;
+
+ *file = (char_u **)alloc(num_pat * sizeof(char_u *));
+ if (*file == NULL)
+ return FAIL;
+ for (i = 0; i < num_pat; i++)
+ (*file)[i] = vim_strsave(pat[i]);
+ *num_file = num_pat;
+ return OK;
+}
+#endif
+
+
+/*
+ * Return TRUE if the string "p" contains a wildcard that mch_expandpath() can
+ * expand.
+ */
+ int
+mch_has_exp_wildcard(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ {
+#ifndef OS2
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ else
+#endif
+ if (vim_strchr((char_u *)
+#ifdef VMS
+ "*?%"
+#else
+# ifdef OS2
+ "*?"
+# else
+ "*?[{'"
+# endif
+#endif
+ , *p) != NULL)
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * Return TRUE if the string "p" contains a wildcard.
+ * Don't recognize '~' at the end as a wildcard.
+ */
+ int
+mch_has_wildcard(p)
+ char_u *p;
+{
+ for ( ; *p; ++p)
+ {
+#ifndef OS2
+ if (*p == '\\' && p[1] != NUL)
+ ++p;
+ else
+#endif
+ if (vim_strchr((char_u *)
+#ifdef VMS
+ "*?%$"
+#else
+# ifdef OS2
+# ifdef VIM_BACKTICK
+ "*?$`"
+# else
+ "*?$"
+# endif
+# else
+ "*?[{`'$"
+# endif
+#endif
+ , *p) != NULL
+ || (*p == '~' && p[1] != NUL))
+ return TRUE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return FALSE;
+}
+
+#ifndef __EMX__
+ static int
+have_wildcard(num, file)
+ int num;
+ char_u **file;
+{
+ int i;
+
+ for (i = 0; i < num; i++)
+ if (mch_has_wildcard(file[i]))
+ return 1;
+ return 0;
+}
+
+ static int
+have_dollars(num, file)
+ int num;
+ char_u **file;
+{
+ int i;
+
+ for (i = 0; i < num; i++)
+ if (vim_strchr(file[i], '$') != NULL)
+ return TRUE;
+ return FALSE;
+}
+#endif /* ifndef __EMX__ */
+
+#ifndef HAVE_RENAME
+/*
+ * Scaled-down version of rename(), which is missing in Xenix.
+ * This version can only move regular files and will fail if the
+ * destination exists.
+ */
+ int
+mch_rename(src, dest)
+ const char *src, *dest;
+{
+ struct stat st;
+
+ if (stat(dest, &st) >= 0) /* fail if destination exists */
+ return -1;
+ if (link(src, dest) != 0) /* link file to new name */
+ return -1;
+ if (mch_remove(src) == 0) /* delete link to old name */
+ return 0;
+ return -1;
+}
+#endif /* !HAVE_RENAME */
+
+#ifdef FEAT_MOUSE_GPM
+/*
+ * Initializes connection with gpm (if it isn't already opened)
+ * Return 1 if succeeded (or connection already opened), 0 if failed
+ */
+ static int
+gpm_open()
+{
+ static Gpm_Connect gpm_connect; /* Must it be kept till closing ? */
+
+ if (!gpm_flag)
+ {
+ gpm_connect.eventMask = (GPM_UP | GPM_DRAG | GPM_DOWN);
+ gpm_connect.defaultMask = ~GPM_HARD;
+ /* Default handling for mouse move*/
+ gpm_connect.minMod = 0; /* Handle any modifier keys */
+ gpm_connect.maxMod = 0xffff;
+ if (Gpm_Open(&gpm_connect, 0) > 0)
+ {
+ /* gpm library tries to handling TSTP causes
+ * problems. Anyways, we close connection to Gpm whenever
+ * we are going to suspend or starting an external process
+ * so we should'nt have problem with this
+ */
+ signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
+ return 1; /* succeed */
+ }
+ if (gpm_fd == -2)
+ Gpm_Close(); /* We don't want to talk to xterm via gpm */
+ return 0;
+ }
+ return 1; /* already open */
+}
+
+/*
+ * Closes connection to gpm
+ * returns non-zero if connection succesfully closed
+ */
+ static void
+gpm_close()
+{
+ if (gpm_flag && gpm_fd >= 0) /* if Open */
+ Gpm_Close();
+}
+
+/* Reads gpm event and adds special keys to input buf. Returns length of
+ * generated key sequence.
+ * This function is made after gui_send_mouse_event
+ */
+ static int
+mch_gpm_process()
+{
+ int button;
+ static Gpm_Event gpm_event;
+ char_u string[6];
+ int_u vim_modifiers;
+ int row,col;
+ unsigned char buttons_mask;
+ unsigned char gpm_modifiers;
+ static unsigned char old_buttons = 0;
+
+ Gpm_GetEvent(&gpm_event);
+
+#ifdef FEAT_GUI
+ /* Don't put events in the input queue now. */
+ if (hold_gui_events)
+ return 0;
+#endif
+
+ row = gpm_event.y - 1;
+ col = gpm_event.x - 1;
+
+ string[0] = ESC; /* Our termcode */
+ string[1] = 'M';
+ string[2] = 'G';
+ switch (GPM_BARE_EVENTS(gpm_event.type))
+ {
+ case GPM_DRAG:
+ string[3] = MOUSE_DRAG;
+ break;
+ case GPM_DOWN:
+ buttons_mask = gpm_event.buttons & ~old_buttons;
+ old_buttons = gpm_event.buttons;
+ switch (buttons_mask)
+ {
+ case GPM_B_LEFT:
+ button = MOUSE_LEFT;
+ break;
+ case GPM_B_MIDDLE:
+ button = MOUSE_MIDDLE;
+ break;
+ case GPM_B_RIGHT:
+ button = MOUSE_RIGHT;
+ break;
+ default:
+ return 0;
+ /*Don't know what to do. Can more than one button be
+ * reported in one event? */
+ }
+ string[3] = (char_u)(button | 0x20);
+ SET_NUM_MOUSE_CLICKS(string[3], gpm_event.clicks + 1);
+ break;
+ case GPM_UP:
+ string[3] = MOUSE_RELEASE;
+ old_buttons &= ~gpm_event.buttons;
+ break;
+ default:
+ return 0;
+ }
+ /*This code is based on gui_x11_mouse_cb in gui_x11.c */
+ gpm_modifiers = gpm_event.modifiers;
+ vim_modifiers = 0x0;
+ /* I ignore capslock stats. Aren't we all just hate capslock mixing with
+ * Vim commands ? Besides, gpm_event.modifiers is unsigned char, and
+ * K_CAPSSHIFT is defined 8, so it probably isn't even reported
+ */
+ if (gpm_modifiers & ((1 << KG_SHIFT) | (1 << KG_SHIFTR) | (1 << KG_SHIFTL)))
+ vim_modifiers |= MOUSE_SHIFT;
+
+ if (gpm_modifiers & ((1 << KG_CTRL) | (1 << KG_CTRLR) | (1 << KG_CTRLL)))
+ vim_modifiers |= MOUSE_CTRL;
+ if (gpm_modifiers & ((1 << KG_ALT) | (1 << KG_ALTGR)))
+ vim_modifiers |= MOUSE_ALT;
+ string[3] |= vim_modifiers;
+ string[4] = (char_u)(col + ' ' + 1);
+ string[5] = (char_u)(row + ' ' + 1);
+ add_to_input_buf(string, 6);
+ return 6;
+}
+#endif /* FEAT_MOUSE_GPM */
+
+#if defined(FEAT_LIBCALL) || defined(PROTO)
+typedef char_u * (*STRPROCSTR)__ARGS((char_u *));
+typedef char_u * (*INTPROCSTR)__ARGS((int));
+typedef int (*STRPROCINT)__ARGS((char_u *));
+typedef int (*INTPROCINT)__ARGS((int));
+
+/*
+ * Call a DLL routine which takes either a string or int param
+ * and returns an allocated string.
+ */
+ int
+mch_libcall(libname, funcname, argstring, argint, string_result, number_result)
+ char_u *libname;
+ char_u *funcname;
+ char_u *argstring; /* NULL when using a argint */
+ int argint;
+ char_u **string_result;/* NULL when using number_result */
+ int *number_result;
+{
+# if defined(USE_DLOPEN)
+ void *hinstLib;
+# else
+ shl_t hinstLib;
+# endif
+ STRPROCSTR ProcAdd;
+ INTPROCSTR ProcAddI;
+ char_u *retval_str = NULL;
+ int retval_int = 0;
+ int success = FALSE;
+
+ /* Get a handle to the DLL module. */
+# if defined(USE_DLOPEN)
+ hinstLib = dlopen((char *)libname, RTLD_LAZY
+# ifdef RTLD_LOCAL
+ | RTLD_LOCAL
+# endif
+ );
+# else
+ hinstLib = shl_load((const char*)libname, BIND_IMMEDIATE|BIND_VERBOSE, 0L);
+# endif
+
+ /* If the handle is valid, try to get the function address. */
+ if (hinstLib != NULL)
+ {
+# ifdef HAVE_SETJMP_H
+ /*
+ * Catch a crash when calling the library function. For example when
+ * using a number where a string pointer is expected.
+ */
+ mch_startjmp();
+ if (SETJMP(lc_jump_env) != 0)
+ {
+ success = FALSE;
+ mch_didjmp();
+ }
+ else
+# endif
+ {
+ retval_str = NULL;
+ retval_int = 0;
+
+ if (argstring != NULL)
+ {
+# if defined(USE_DLOPEN)
+ ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname);
+# else
+ if (shl_findsym(&hinstLib, (const char *)funcname,
+ TYPE_PROCEDURE, (void *)&ProcAdd) < 0)
+ ProcAdd = NULL;
+# endif
+ if ((success = (ProcAdd != NULL)))
+ {
+ if (string_result == NULL)
+ retval_int = ((STRPROCINT)ProcAdd)(argstring);
+ else
+ retval_str = (ProcAdd)(argstring);
+ }
+ }
+ else
+ {
+# if defined(USE_DLOPEN)
+ ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname);
+# else
+ if (shl_findsym(&hinstLib, (const char *)funcname,
+ TYPE_PROCEDURE, (void *)&ProcAddI) < 0)
+ ProcAddI = NULL;
+# endif
+ if ((success = (ProcAddI != NULL)))
+ {
+ if (string_result == NULL)
+ retval_int = ((INTPROCINT)ProcAddI)(argint);
+ else
+ retval_str = (ProcAddI)(argint);
+ }
+ }
+
+ /* Save the string before we free the library. */
+ /* Assume that a "1" or "-1" result is an illegal pointer. */
+ if (string_result == NULL)
+ *number_result = retval_int;
+ else if (retval_str != NULL
+ && retval_str != (char_u *)1
+ && retval_str != (char_u *)-1)
+ *string_result = vim_strsave(retval_str);
+ }
+
+# ifdef HAVE_SETJMP_H
+ mch_endjmp();
+# ifdef SIGHASARG
+ if (lc_signal != 0)
+ {
+ int i;
+
+ /* try to find the name of this signal */
+ for (i = 0; signal_info[i].sig != -1; i++)
+ if (lc_signal == signal_info[i].sig)
+ break;
+ EMSG2("E368: got SIG%s in libcall()", signal_info[i].name);
+ }
+# endif
+# endif
+
+ /* Free the DLL module. */
+# if defined(USE_DLOPEN)
+ (void)dlclose(hinstLib);
+# else
+ (void)shl_unload(hinstLib);
+# endif
+ }
+
+ if (!success)
+ {
+ EMSG2(_(e_libcall), funcname);
+ return FAIL;
+ }
+
+ return OK;
+}
+#endif
+
+#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO)
+static int xterm_trace = -1; /* default: disabled */
+static int xterm_button;
+
+/*
+ * Setup a dummy window for X selections in a terminal.
+ */
+ void
+setup_term_clip()
+{
+ int z = 0;
+ char *strp = "";
+ Widget AppShell;
+
+ if (!x_connect_to_server())
+ return;
+
+ open_app_context();
+ if (app_context != NULL && xterm_Shell == (Widget)0)
+ {
+ int (*oldhandler)();
+#if defined(HAVE_SETJMP_H)
+ int (*oldIOhandler)();
+#endif
+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+ struct timeval start_tv;
+
+ if (p_verbose > 0)
+ gettimeofday(&start_tv, NULL);
+# endif
+
+ /* Ignore X errors while opening the display */
+ oldhandler = XSetErrorHandler(x_error_check);
+
+#if defined(HAVE_SETJMP_H)
+ /* Ignore X IO errors while opening the display */
+ oldIOhandler = XSetIOErrorHandler(x_IOerror_check);
+ mch_startjmp();
+ if (SETJMP(lc_jump_env) != 0)
+ {
+ mch_didjmp();
+ xterm_dpy = NULL;
+ }
+ else
+#endif
+ {
+ xterm_dpy = XtOpenDisplay(app_context, xterm_display,
+ "vim_xterm", "Vim_xterm", NULL, 0, &z, &strp);
+#if defined(HAVE_SETJMP_H)
+ mch_endjmp();
+#endif
+ }
+
+#if defined(HAVE_SETJMP_H)
+ /* Now handle X IO errors normally. */
+ (void)XSetIOErrorHandler(oldIOhandler);
+#endif
+ /* Now handle X errors normally. */
+ (void)XSetErrorHandler(oldhandler);
+
+ if (xterm_dpy == NULL)
+ {
+ if (p_verbose > 0)
+ MSG(_("Opening the X display failed"));
+ return;
+ }
+
+ /* Catch terminating error of the X server connection. */
+ (void)XSetIOErrorHandler(x_IOerror_handler);
+
+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+ if (p_verbose > 0)
+ xopen_message(&start_tv);
+# endif
+
+ /* Create a Shell to make converters work. */
+ AppShell = XtVaAppCreateShell("vim_xterm", "Vim_xterm",
+ applicationShellWidgetClass, xterm_dpy,
+ NULL);
+ if (AppShell == (Widget)0)
+ return;
+ xterm_Shell = XtVaCreatePopupShell("VIM",
+ topLevelShellWidgetClass, AppShell,
+ XtNmappedWhenManaged, 0,
+ XtNwidth, 1,
+ XtNheight, 1,
+ NULL);
+ if (xterm_Shell == (Widget)0)
+ return;
+
+ x11_setup_atoms(xterm_dpy);
+ if (x11_display == NULL)
+ x11_display = xterm_dpy;
+
+ XtRealizeWidget(xterm_Shell);
+ XSync(xterm_dpy, False);
+ xterm_update();
+ }
+ if (xterm_Shell != (Widget)0)
+ {
+ clip_init(TRUE);
+ if (x11_window == 0 && (strp = getenv("WINDOWID")) != NULL)
+ x11_window = (Window)atol(strp);
+ /* Check if $WINDOWID is valid. */
+ if (test_x11_window(xterm_dpy) == FAIL)
+ x11_window = 0;
+ if (x11_window != 0)
+ xterm_trace = 0;
+ }
+}
+
+ void
+start_xterm_trace(button)
+ int button;
+{
+ if (x11_window == 0 || xterm_trace < 0 || xterm_Shell == (Widget)0)
+ return;
+ xterm_trace = 1;
+ xterm_button = button;
+ do_xterm_trace();
+}
+
+
+ void
+stop_xterm_trace()
+{
+ if (xterm_trace < 0)
+ return;
+ xterm_trace = 0;
+}
+
+/*
+ * Query the xterm pointer and generate mouse termcodes if necessary
+ * return TRUE if dragging is active, else FALSE
+ */
+ static int
+do_xterm_trace()
+{
+ Window root, child;
+ int root_x, root_y;
+ int win_x, win_y;
+ int row, col;
+ int_u mask_return;
+ char_u buf[50];
+ char_u *strp;
+ long got_hints;
+ static char_u *mouse_code;
+ static char_u mouse_name[2] = {KS_MOUSE, KE_FILLER};
+ static int prev_row = 0, prev_col = 0;
+ static XSizeHints xterm_hints;
+
+ if (xterm_trace <= 0)
+ return FALSE;
+
+ if (xterm_trace == 1)
+ {
+ /* Get the hints just before tracking starts. The font size might
+ * have changed recently */
+ XGetWMNormalHints(xterm_dpy, x11_window, &xterm_hints, &got_hints);
+ if (!(got_hints & PResizeInc)
+ || xterm_hints.width_inc <= 1
+ || xterm_hints.height_inc <= 1)
+ {
+ xterm_trace = -1; /* Not enough data -- disable tracing */
+ return FALSE;
+ }
+
+ /* Rely on the same mouse code for the duration of this */
+ mouse_code = find_termcode(mouse_name);
+ prev_row = mouse_row;
+ prev_row = mouse_col;
+ xterm_trace = 2;
+
+ /* Find the offset of the chars, there might be a scrollbar on the
+ * left of the window and/or a menu on the top (eterm etc.) */
+ XQueryPointer(xterm_dpy, x11_window, &root, &child, &root_x, &root_y,
+ &win_x, &win_y, &mask_return);
+ xterm_hints.y = win_y - (xterm_hints.height_inc * mouse_row)
+ - (xterm_hints.height_inc / 2);
+ if (xterm_hints.y <= xterm_hints.height_inc / 2)
+ xterm_hints.y = 2;
+ xterm_hints.x = win_x - (xterm_hints.width_inc * mouse_col)
+ - (xterm_hints.width_inc / 2);
+ if (xterm_hints.x <= xterm_hints.width_inc / 2)
+ xterm_hints.x = 2;
+ return TRUE;
+ }
+ if (mouse_code == NULL)
+ {
+ xterm_trace = 0;
+ return FALSE;
+ }
+
+ XQueryPointer(xterm_dpy, x11_window, &root, &child, &root_x, &root_y,
+ &win_x, &win_y, &mask_return);
+
+ row = check_row((win_y - xterm_hints.y) / xterm_hints.height_inc);
+ col = check_col((win_x - xterm_hints.x) / xterm_hints.width_inc);
+ if (row == prev_row && col == prev_col)
+ return TRUE;
+
+ STRCPY(buf, mouse_code);
+ strp = buf + STRLEN(buf);
+ *strp++ = (xterm_button | MOUSE_DRAG) & ~0x20;
+ *strp++ = (char_u)(col + ' ' + 1);
+ *strp++ = (char_u)(row + ' ' + 1);
+ *strp = 0;
+ add_to_input_buf(buf, STRLEN(buf));
+
+ prev_row = row;
+ prev_col = col;
+ return TRUE;
+}
+
+# if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Destroy the display, window and app_context. Required for GTK.
+ */
+ void
+clear_xterm_clip()
+{
+ if (xterm_Shell != (Widget)0)
+ {
+ XtDestroyWidget(xterm_Shell);
+ xterm_Shell = (Widget)0;
+ }
+ if (xterm_dpy != NULL)
+ {
+#if 0
+ /* Lesstif and Solaris crash here, lose some memory */
+ XtCloseDisplay(xterm_dpy);
+#endif
+ if (x11_display == xterm_dpy)
+ x11_display = NULL;
+ xterm_dpy = NULL;
+ }
+#if 0
+ if (app_context != (XtAppContext)NULL)
+ {
+ /* Lesstif and Solaris crash here, lose some memory */
+ XtDestroyApplicationContext(app_context);
+ app_context = (XtAppContext)NULL;
+ }
+#endif
+}
+# endif
+
+/*
+ * Catch up with any queued X events. This may put keyboard input into the
+ * input buffer, call resize call-backs, trigger timers etc. If there is
+ * nothing in the X event queue (& no timers pending), then we return
+ * immediately.
+ */
+ static void
+xterm_update()
+{
+ XEvent event;
+
+ while (XtAppPending(app_context) && !vim_is_input_buf_full())
+ {
+ XtAppNextEvent(app_context, &event);
+#ifdef FEAT_CLIENTSERVER
+ {
+ XPropertyEvent *e = (XPropertyEvent *)&event;
+
+ if (e->type == PropertyNotify && e->window == commWindow
+ && e->atom == commProperty && e->state == PropertyNewValue)
+ serverEventProc(xterm_dpy, &event);
+ }
+#endif
+ XtDispatchEvent(&event);
+ }
+}
+
+ int
+clip_xterm_own_selection(cbd)
+ VimClipboard *cbd;
+{
+ if (xterm_Shell != (Widget)0)
+ return clip_x11_own_selection(xterm_Shell, cbd);
+ return FAIL;
+}
+
+ void
+clip_xterm_lose_selection(cbd)
+ VimClipboard *cbd;
+{
+ if (xterm_Shell != (Widget)0)
+ clip_x11_lose_selection(xterm_Shell, cbd);
+}
+
+ void
+clip_xterm_request_selection(cbd)
+ VimClipboard *cbd;
+{
+ if (xterm_Shell != (Widget)0)
+ clip_x11_request_selection(xterm_Shell, xterm_dpy, cbd);
+}
+
+ void
+clip_xterm_set_selection(cbd)
+ VimClipboard *cbd;
+{
+ clip_x11_set_selection(cbd);
+}
+#endif
+
+
+#if defined(USE_XSMP) || defined(PROTO)
+/*
+ * Code for X Session Management Protocol.
+ */
+static void xsmp_handle_save_yourself __ARGS((SmcConn smc_conn, SmPointer client_data, int save_type, Bool shutdown, int interact_style, Bool fast));
+static void xsmp_die __ARGS((SmcConn smc_conn, SmPointer client_data));
+static void xsmp_save_complete __ARGS((SmcConn smc_conn, SmPointer client_data));
+static void xsmp_shutdown_cancelled __ARGS((SmcConn smc_conn, SmPointer client_data));
+static void xsmp_ice_connection __ARGS((IceConn iceConn, IcePointer clientData, Bool opening, IcePointer *watchData));
+
+
+# if defined(FEAT_GUI) && defined(USE_XSMP_INTERACT)
+static void xsmp_handle_interaction __ARGS((SmcConn smc_conn, SmPointer client_data));
+
+/*
+ * This is our chance to ask the user if they want to save,
+ * or abort the logout
+ */
+/*ARGSUSED*/
+ static void
+xsmp_handle_interaction(smc_conn, client_data)
+ SmcConn smc_conn;
+ SmPointer client_data;
+{
+ cmdmod_T save_cmdmod;
+ int cancel_shutdown = False;
+
+ save_cmdmod = cmdmod;
+ cmdmod.confirm = TRUE;
+ if (check_changed_any(FALSE))
+ /* Mustn't logout */
+ cancel_shutdown = True;
+ cmdmod = save_cmdmod;
+ setcursor(); /* position cursor */
+ out_flush();
+
+ /* Done interaction */
+ SmcInteractDone(smc_conn, cancel_shutdown);
+
+ /* Finish off
+ * Only end save-yourself here if we're not cancelling shutdown;
+ * we'll get a cancelled callback later in which we'll end it.
+ * Hopefully get around glitchy SMs (like GNOME-1)
+ */
+ if (!cancel_shutdown)
+ {
+ xsmp.save_yourself = False;
+ SmcSaveYourselfDone(smc_conn, True);
+ }
+}
+# endif
+
+/*
+ * Callback that starts save-yourself.
+ */
+/*ARGSUSED*/
+ static void
+xsmp_handle_save_yourself(smc_conn, client_data, save_type,
+ shutdown, interact_style, fast)
+ SmcConn smc_conn;
+ SmPointer client_data;
+ int save_type;
+ Bool shutdown;
+ int interact_style;
+ Bool fast;
+{
+ /* Handle already being in saveyourself */
+ if (xsmp.save_yourself)
+ SmcSaveYourselfDone(smc_conn, True);
+ xsmp.save_yourself = True;
+ xsmp.shutdown = shutdown;
+
+ /* First up, preserve all files */
+ out_flush();
+ ml_sync_all(FALSE, FALSE); /* preserve all swap files */
+
+ if (p_verbose > 0)
+ MSG(_("XSMP handling save-yourself request"));
+
+# if defined(FEAT_GUI) && defined(USE_XSMP_INTERACT)
+ /* Now see if we can ask about unsaved files */
+ if (shutdown && !fast && gui.in_use)
+ /* Need to interact with user, but need SM's permission */
+ SmcInteractRequest(smc_conn, SmDialogError,
+ xsmp_handle_interaction, client_data);
+ else
+# endif
+ {
+ /* Can stop the cycle here */
+ SmcSaveYourselfDone(smc_conn, True);
+ xsmp.save_yourself = False;
+ }
+}
+
+
+/*
+ * Callback to warn us of imminent death.
+ */
+/*ARGSUSED*/
+ static void
+xsmp_die(smc_conn, client_data)
+ SmcConn smc_conn;
+ SmPointer client_data;
+{
+ xsmp_close();
+
+ /* quit quickly leaving swapfiles for modified buffers behind */
+ getout_preserve_modified(0);
+}
+
+
+/*
+ * Callback to tell us that save-yourself has completed.
+ */
+/*ARGSUSED*/
+ static void
+xsmp_save_complete(smc_conn, client_data)
+ SmcConn smc_conn;
+ SmPointer client_data;
+{
+ xsmp.save_yourself = False;
+}
+
+
+/*
+ * Callback to tell us that an instigated shutdown was cancelled
+ * (maybe even by us)
+ */
+/*ARGSUSED*/
+ static void
+xsmp_shutdown_cancelled(smc_conn, client_data)
+ SmcConn smc_conn;
+ SmPointer client_data;
+{
+ if (xsmp.save_yourself)
+ SmcSaveYourselfDone(smc_conn, True);
+ xsmp.save_yourself = False;
+ xsmp.shutdown = False;
+}
+
+
+/*
+ * Callback to tell us that a new ICE connection has been established.
+ */
+/*ARGSUSED*/
+ static void
+xsmp_ice_connection(iceConn, clientData, opening, watchData)
+ IceConn iceConn;
+ IcePointer clientData;
+ Bool opening;
+ IcePointer *watchData;
+{
+ /* Intercept creation of ICE connection fd */
+ if (opening)
+ {
+ xsmp_icefd = IceConnectionNumber(iceConn);
+ IceRemoveConnectionWatch(xsmp_ice_connection, NULL);
+ }
+}
+
+
+/* Handle any ICE processing that's required; return FAIL if SM lost */
+ int
+xsmp_handle_requests()
+{
+ Bool rep;
+
+ if (IceProcessMessages(xsmp.iceconn, NULL, &rep)
+ == IceProcessMessagesIOError)
+ {
+ /* Lost ICE */
+ if (p_verbose > 0)
+ MSG(_("XSMP lost ICE connection"));
+ xsmp_close();
+ return FAIL;
+ }
+ else
+ return OK;
+}
+
+static int dummy;
+
+/* Set up X Session Management Protocol */
+ void
+xsmp_init(void)
+{
+ char errorstring[80];
+ char *clientid;
+ SmcCallbacks smcallbacks;
+#if 0
+ SmPropValue smname;
+ SmProp smnameprop;
+ SmProp *smprops[1];
+#endif
+
+ if (p_verbose > 0)
+ MSG(_("XSMP opening connection"));
+
+ xsmp.save_yourself = xsmp.shutdown = False;
+
+ /* Set up SM callbacks - must have all, even if they're not used */
+ smcallbacks.save_yourself.callback = xsmp_handle_save_yourself;
+ smcallbacks.save_yourself.client_data = NULL;
+ smcallbacks.die.callback = xsmp_die;
+ smcallbacks.die.client_data = NULL;
+ smcallbacks.save_complete.callback = xsmp_save_complete;
+ smcallbacks.save_complete.client_data = NULL;
+ smcallbacks.shutdown_cancelled.callback = xsmp_shutdown_cancelled;
+ smcallbacks.shutdown_cancelled.client_data = NULL;
+
+ /* Set up a watch on ICE connection creations. The "dummy" argument is
+ * apparently required for FreeBSD (we get a BUS error when using NULL). */
+ if (IceAddConnectionWatch(xsmp_ice_connection, &dummy) == 0)
+ {
+ if (p_verbose > 0)
+ MSG(_("XSMP ICE connection watch failed"));
+ return;
+ }
+
+ /* Create an SM connection */
+ xsmp.smcconn = SmcOpenConnection(
+ NULL,
+ NULL,
+ SmProtoMajor,
+ SmProtoMinor,
+ SmcSaveYourselfProcMask | SmcDieProcMask
+ | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask,
+ &smcallbacks,
+ NULL,
+ &clientid,
+ sizeof(errorstring),
+ errorstring);
+ if (xsmp.smcconn == NULL)
+ {
+ char errorreport[132];
+ sprintf(errorreport, _("XSMP SmcOpenConnection failed: %s"),
+ errorstring);
+ if (p_verbose > 0)
+ MSG(errorreport);
+ return;
+ }
+ xsmp.iceconn = SmcGetIceConnection(xsmp.smcconn);
+
+#if 0
+ /* ID ourselves */
+ smname.value = "vim";
+ smname.length = 3;
+ smnameprop.name = "SmProgram";
+ smnameprop.type = "SmARRAY8";
+ smnameprop.num_vals = 1;
+ smnameprop.vals = &smname;
+
+ smprops[0] = &smnameprop;
+ SmcSetProperties(xsmp.smcconn, 1, smprops);
+#endif
+}
+
+
+/* Shut down XSMP comms. */
+ void
+xsmp_close()
+{
+ if (xsmp_icefd != -1)
+ {
+ SmcCloseConnection(xsmp.smcconn, 0, NULL);
+ xsmp_icefd = -1;
+ }
+}
+#endif /* USE_XSMP */
+
+
+#ifdef EBCDIC
+/* Translate character to its CTRL- value */
+char CtrlTable[] =
+{
+/* 00 - 5E */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* ^ */ 0x1E,
+/* - */ 0x1F,
+/* 61 - 6C */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* _ */ 0x1F,
+/* 6E - 80 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* a */ 0x01,
+/* b */ 0x02,
+/* c */ 0x03,
+/* d */ 0x37,
+/* e */ 0x2D,
+/* f */ 0x2E,
+/* g */ 0x2F,
+/* h */ 0x16,
+/* i */ 0x05,
+/* 8A - 90 */
+ 0, 0, 0, 0, 0, 0, 0,
+/* j */ 0x15,
+/* k */ 0x0B,
+/* l */ 0x0C,
+/* m */ 0x0D,
+/* n */ 0x0E,
+/* o */ 0x0F,
+/* p */ 0x10,
+/* q */ 0x11,
+/* r */ 0x12,
+/* 9A - A1 */
+ 0, 0, 0, 0, 0, 0, 0, 0,
+/* s */ 0x13,
+/* t */ 0x3C,
+/* u */ 0x3D,
+/* v */ 0x32,
+/* w */ 0x26,
+/* x */ 0x18,
+/* y */ 0x19,
+/* z */ 0x3F,
+/* AA - AC */
+ 0, 0, 0,
+/* [ */ 0x27,
+/* AE - BC */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* ] */ 0x1D,
+/* BE - C0 */ 0, 0, 0,
+/* A */ 0x01,
+/* B */ 0x02,
+/* C */ 0x03,
+/* D */ 0x37,
+/* E */ 0x2D,
+/* F */ 0x2E,
+/* G */ 0x2F,
+/* H */ 0x16,
+/* I */ 0x05,
+/* CA - D0 */ 0, 0, 0, 0, 0, 0, 0,
+/* J */ 0x15,
+/* K */ 0x0B,
+/* L */ 0x0C,
+/* M */ 0x0D,
+/* N */ 0x0E,
+/* O */ 0x0F,
+/* P */ 0x10,
+/* Q */ 0x11,
+/* R */ 0x12,
+/* DA - DF */ 0, 0, 0, 0, 0, 0,
+/* \ */ 0x1C,
+/* E1 */ 0,
+/* S */ 0x13,
+/* T */ 0x3C,
+/* U */ 0x3D,
+/* V */ 0x32,
+/* W */ 0x26,
+/* X */ 0x18,
+/* Y */ 0x19,
+/* Z */ 0x3F,
+/* EA - FF*/ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+char MetaCharTable[]=
+{/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ 0, 0, 0, 0,'\\', 0,'F', 0,'W','M','N', 0, 0, 0, 0, 0,
+ 0, 0, 0, 0,']', 0, 0,'G', 0, 0,'R','O', 0, 0, 0, 0,
+ '@','A','B','C','D','E', 0, 0,'H','I','J','K','L', 0, 0, 0,
+ 'P','Q', 0,'S','T','U','V', 0,'X','Y','Z','[', 0, 0,'^', 0
+};
+
+
+/* TODO: Use characters NOT numbers!!! */
+char CtrlCharTable[]=
+{/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ 124,193,194,195, 0,201, 0, 0, 0, 0, 0,210,211,212,213,214,
+ 215,216,217,226, 0,209,200, 0,231,232, 0, 0,224,189, 95,109,
+ 0, 0, 0, 0, 0, 0,230,173, 0, 0, 0, 0, 0,197,198,199,
+ 0, 0,229, 0, 0, 0, 0,196, 0, 0, 0, 0,227,228, 0,233,
+};
+
+
+#endif
diff --git a/src/os_unix.h b/src/os_unix.h
new file mode 100644
index 000000000..b78b23e7b
--- /dev/null
+++ b/src/os_unix.h
@@ -0,0 +1,531 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * NextStep has a problem with configure, undefine a few things:
+ */
+#ifdef NeXT
+# ifdef HAVE_UTIME
+# undef HAVE_UTIME
+# endif
+# ifdef HAVE_SYS_UTSNAME_H
+# undef HAVE_SYS_UTSNAME_H
+# endif
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+
+#ifdef VAXC
+# include <types.h>
+# include <stat.h>
+#else
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef __EMX__
+# define HAVE_TOTAL_MEM
+#endif
+
+#if defined(__CYGWIN__) || defined(__CYGWIN32__)
+# define WIN32UNIX /* Compiling for Win32 using Unix files. */
+# define BINARY_FILE_IO
+#endif
+
+/* On AIX 4.2 there is a conflicting prototype for ioctl() in stropts.h and
+ * unistd.h. This hack should fix that (suggested by Jeff George).
+ * But on AIX 4.3 it's alright (suggested by Jake Hamby). */
+#if defined(FEAT_GUI) && defined(_AIX) && !defined(_AIX43) && !defined(_NO_PROTO)
+# define _NO_PROTO
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_LIBC_H
+# include <libc.h> /* for NeXT */
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h> /* defines BSD, if it's a BSD system */
+#endif
+
+/*
+ * Sun defines FILE on SunOS 4.x.x, Solaris has a typedef for FILE
+ */
+#if defined(sun) && !defined(FILE)
+# define SOLARIS
+#endif
+
+/*
+ * Using getcwd() is preferred, because it checks for a buffer overflow.
+ * Don't use getcwd() on systems do use system("sh -c pwd"). There is an
+ * autoconf check for this.
+ * Use getcwd() anyway if getwd() isn't present.
+ */
+#if defined(HAVE_GETCWD) && !(defined(BAD_GETCWD) && defined(HAVE_GETWD))
+# define USE_GETCWD
+#endif
+
+#ifndef __ARGS
+ /* The AIX VisualAge cc compiler defines __EXTENDED__ instead of __STDC__
+ * because it includes pre-ansi features. */
+# if defined(__STDC__) || defined(__GNUC__) || defined(__EXTENDED__)
+# define __ARGS(x) x
+# else
+# define __ARGS(x) ()
+# endif
+#endif
+
+/* always use unlink() to remove files */
+#ifndef PROTO
+# ifdef VMS
+# define mch_remove(x) delete((char *)(x))
+# define vim_mkdir(x, y) mkdir((char *)(x), y)
+# ifdef VAX
+# else
+# define mch_rmdir(x) rmdir((char *)(x))
+# endif
+# else
+# define vim_mkdir(x, y) mkdir((char *)(x), y)
+# define mch_rmdir(x) rmdir((char *)(x))
+# define mch_remove(x) unlink((char *)(x))
+# endif
+#endif
+
+/* The number of arguments to a signal handler is configured here. */
+/* It used to be a long list of almost all systems. Any system that doesn't
+ * have an argument??? */
+#define SIGHASARG
+
+/* List 3 arg systems here. I guess __sgi, please test and correct me. jw. */
+#if defined(__sgi) && defined(HAVE_SIGCONTEXT)
+# define SIGHAS3ARGS
+#endif
+
+#ifdef SIGHASARG
+# ifdef SIGHAS3ARGS
+# define SIGPROTOARG (int, int, struct sigcontext *)
+# define SIGDEFARG(s) (s, sig2, scont) int s, sig2; struct sigcontext *scont;
+# define SIGDUMMYARG 0, 0, (struct sigcontext *)0
+# else
+# define SIGPROTOARG (int)
+# define SIGDEFARG(s) (s) int s;
+# define SIGDUMMYARG 0
+# endif
+#else
+# define SIGPROTOARG (void)
+# define SIGDEFARG(s) ()
+# define SIGDUMMYARG
+#endif
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+# ifndef NAMLEN
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+# endif
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+#if !defined(HAVE_SYS_TIME_H) || defined(TIME_WITH_SYS_TIME)
+# include <time.h> /* on some systems time.h should not be
+ included together with sys/time.h */
+#endif
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#include <signal.h>
+
+#if defined(DIRSIZ) && !defined(MAXNAMLEN)
+# define MAXNAMLEN DIRSIZ
+#endif
+
+#if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN)
+# define MAXNAMLEN UFS_MAXNAMLEN /* for dynix/ptx */
+#endif
+
+#if defined(NAME_MAX) && !defined(MAXNAMLEN)
+# define MAXNAMLEN NAME_MAX /* for Linux before .99p3 */
+#endif
+
+/*
+ * Note: if MAXNAMLEN has the wrong value, you will get error messages
+ * for not being able to open the swap file.
+ */
+#if !defined(MAXNAMLEN)
+# define MAXNAMLEN 512 /* for all other Unix */
+#endif
+
+#define BASENAMELEN (MAXNAMLEN - 5)
+
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+
+#ifdef HAVE_PWD_H
+# include <pwd.h>
+#endif
+
+#ifdef __COHERENT__
+# undef __ARGS
+#endif
+
+#if (defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT)) \
+ || (defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)) \
+ || defined(HAVE_SYSCTL) || defined(HAVE_SYSCONF)
+# define HAVE_TOTAL_MEM
+#endif
+
+#ifdef VMS
+#include <unixio.h>
+#include <unixlib.h>
+#include <signal.h>
+#include <file.h>
+#include <ssdef.h>
+#include <descrip.h>
+#include <libclidef.h>
+#include <lnmdef.h>
+#include <psldef.h>
+#include <prvdef.h>
+#include <dvidef.h>
+#include <dcdef.h>
+#include <stsdef.h>
+#include <iodef.h>
+#include <ttdef.h>
+#include <tt2def.h>
+#include <jpidef.h>
+#include <rms.h>
+#include <trmdef.h>
+#include <string.h>
+#include <starlet.h>
+#include <socket.h>
+#include <lib$routines.h>
+
+typedef struct dsc$descriptor DESC;
+#endif
+
+/*
+ * Unix system-dependent file names
+ */
+#ifndef SYS_VIMRC_FILE
+# define SYS_VIMRC_FILE "$VIM/vimrc"
+#endif
+#ifndef SYS_GVIMRC_FILE
+# define SYS_GVIMRC_FILE "$VIM/gvimrc"
+#endif
+#ifndef DFLT_HELPFILE
+# define DFLT_HELPFILE "$VIMRUNTIME/doc/help.txt"
+#endif
+#ifndef FILETYPE_FILE
+# define FILETYPE_FILE "filetype.vim"
+#endif
+#ifndef FTPLUGIN_FILE
+# define FTPLUGIN_FILE "ftplugin.vim"
+#endif
+#ifndef INDENT_FILE
+# define INDENT_FILE "indent.vim"
+#endif
+#ifndef FTOFF_FILE
+# define FTOFF_FILE "ftoff.vim"
+#endif
+#ifndef FTPLUGOF_FILE
+# define FTPLUGOF_FILE "ftplugof.vim"
+#endif
+#ifndef INDOFF_FILE
+# define INDOFF_FILE "indoff.vim"
+#endif
+#ifndef SYS_MENU_FILE
+# define SYS_MENU_FILE "$VIMRUNTIME/menu.vim"
+#endif
+
+#ifndef USR_EXRC_FILE
+# ifdef VMS
+# define USR_EXRC_FILE "sys$login:.exrc"
+# else
+# define USR_EXRC_FILE "$HOME/.exrc"
+# endif
+#endif
+
+#if !defined(USR_EXRC_FILE2) && defined(OS2)
+# define USR_EXRC_FILE2 "$VIM/.exrc"
+#endif
+#if !defined(USR_EXRC_FILE2) && defined(VMS)
+# define USR_EXRC_FILE2 "sys$login:_exrc"
+#endif
+
+#ifndef USR_VIMRC_FILE
+# ifdef VMS
+# define USR_VIMRC_FILE "sys$login:.vimrc"
+# else
+# define USR_VIMRC_FILE "$HOME/.vimrc"
+# endif
+#endif
+
+#if !defined(USR_VIMRC_FILE2) && defined(OS2)
+# define USR_VIMRC_FILE2 "$VIM/.vimrc"
+#endif
+#if !defined(USR_VIMRC_FILE2) && defined(VMS)
+# define USR_VIMRC_FILE2 "sys$login:_vimrc"
+#endif
+
+#ifndef USR_GVIMRC_FILE
+# ifdef VMS
+# define USR_GVIMRC_FILE "sys$login:.gvimrc"
+# else
+# define USR_GVIMRC_FILE "$HOME/.gvimrc"
+# endif
+#endif
+
+#ifdef VMS
+# ifndef USR_GVIMRC_FILE2
+# define USR_GVIMRC_FILE2 "sys$login:_gvimrc"
+# endif
+#endif
+
+#ifndef EVIM_FILE
+# define EVIM_FILE "$VIMRUNTIME/evim.vim"
+#endif
+
+#ifdef FEAT_VIMINFO
+# ifndef VIMINFO_FILE
+# ifdef VMS
+# define VIMINFO_FILE "sys$login:.viminfo"
+# else
+# define VIMINFO_FILE "$HOME/.viminfo"
+# endif
+# endif
+# if !defined(VIMINFO_FILE2) && defined(OS2)
+# define VIMINFO_FILE2 "$VIM/.viminfo"
+# endif
+# if !defined(VIMINFO_FILE2) && defined(VMS)
+# define VIMINFO_FILE2 "sys$login:_viminfo"
+# endif
+#endif
+
+#ifndef EXRC_FILE
+# define EXRC_FILE ".exrc"
+#endif
+
+#ifndef VIMRC_FILE
+# define VIMRC_FILE ".vimrc"
+#endif
+
+#ifdef FEAT_GUI
+# ifndef GVIMRC_FILE
+# define GVIMRC_FILE ".gvimrc"
+# endif
+#endif
+
+#ifndef SYNTAX_FNAME
+# define SYNTAX_FNAME "$VIMRUNTIME/syntax/%s.vim"
+#endif
+
+#ifndef DFLT_BDIR
+# ifdef OS2
+# define DFLT_BDIR ".,c:/tmp,~/tmp,~/"
+# else
+# ifdef VMS
+# define DFLT_BDIR "./,sys$login:,tmp:"
+# else
+# define DFLT_BDIR ".,~/tmp,~/" /* default for 'backupdir' */
+# endif
+# endif
+#endif
+
+#ifndef DFLT_DIR
+# ifdef OS2
+# define DFLT_DIR ".,~/tmp,c:/tmp,/tmp"
+# else
+# ifdef VMS
+# define DFLT_DIR "./,sys$login:,tmp:"
+# else
+# define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" /* default for 'directory' */
+# endif
+# endif
+#endif
+
+#ifndef DFLT_VDIR
+# ifdef OS2
+# define DFLT_VDIR "$VIM/vimfiles/view"
+# else
+# ifdef VMS
+# define DFLT_VDIR "sys$login:vimfiles/view"
+# else
+# define DFLT_VDIR "$HOME/.vim/view" /* default for 'viewdir' */
+# endif
+# endif
+#endif
+
+#define DFLT_ERRORFILE "errors.err"
+
+#ifdef OS2
+# define DFLT_RUNTIMEPATH "$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after"
+#else
+# ifdef VMS
+# define DFLT_RUNTIMEPATH "sys$login:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,sys$login:vimfiles/after"
+# else
+# ifdef RUNTIME_GLOBAL
+# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
+# else
+# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
+# endif
+# endif
+#endif
+
+#ifdef OS2
+/*
+ * Try several directories to put the temp files.
+ */
+# define TEMPDIRNAMES "$TMP", "$TEMP", "c:\\TMP", "c:\\TEMP", ""
+# define TEMPNAMELEN 128
+#else
+# ifdef VMS
+# ifndef VAX
+# define VMS_TEMPNAM /* to fix default .LIS extension */
+# endif
+# define TEMPNAME "TMP:v?XXXXXX.txt"
+# define TEMPNAMELEN 28
+# else
+# define TEMPDIRNAMES "$TMPDIR", "/tmp", ".", "$HOME"
+# define TEMPNAMELEN 256
+# endif
+#endif
+
+/* Special wildcards that need to be handled by the shell */
+#define SPECIAL_WILDCHAR "`'{"
+
+#ifndef HAVE_OPENDIR
+# define NO_EXPANDPATH
+#endif
+
+/*
+ * Unix has plenty of memory, use large buffers
+ */
+#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
+#define MAXPATHL 1024 /* Unix has long paths and plenty of memory */
+
+#define CHECK_INODE /* used when checking if a swap file already
+ exists for a file */
+#ifdef VMS /* Use less memory because of older systems */
+# ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM (2*1024)
+# endif
+# ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT (5*1024)
+# endif
+#else
+# ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM (5*1024) /* use up to 5 Mbyte for a buffer */
+# endif
+# ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT (10*1024) /* use up to 10 Mbyte for Vim */
+# endif
+#endif
+
+/* memmove is not present on all systems, use memmove, bcopy, memcpy or our
+ * own version */
+/* Some systems have (void *) arguments, some (char *). If we use (char *) it
+ * works for all */
+#ifdef USEMEMMOVE
+# define mch_memmove(to, from, len) memmove((char *)(to), (char *)(from), len)
+#else
+# ifdef USEBCOPY
+# define mch_memmove(to, from, len) bcopy((char *)(from), (char *)(to), len)
+# else
+# ifdef USEMEMCPY
+# define mch_memmove(to, from, len) memcpy((char *)(to), (char *)(from), len)
+# else
+# define VIM_MEMMOVE /* found in misc2.c */
+# endif
+# endif
+#endif
+
+#ifndef PROTO
+# ifdef HAVE_RENAME
+# define mch_rename(src, dst) rename(src, dst)
+# else
+int mch_rename __ARGS((const char *src, const char *dest));
+# endif
+# ifdef VMS
+# define mch_chdir(s) chdir(vms_fixfilename(s))
+# else
+# define mch_chdir(s) chdir(s)
+# endif
+# ifndef VMS
+# ifdef __MVS__
+ /* on OS390 Unix getenv() doesn't return a pointer to persistant
+ * storage -> use __getenv() */
+# define mch_getenv(x) (char_u *)__getenv((char *)(x))
+# else
+# define mch_getenv(x) (char_u *)getenv((char *)(x))
+# endif
+# define mch_setenv(name, val, x) setenv(name, val, x)
+# endif
+#endif
+
+#if !defined(S_ISDIR) && defined(S_IFDIR)
+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+#if !defined(S_ISREG) && defined(S_IFREG)
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+#if !defined(S_ISBLK) && defined(S_IFBLK)
+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#endif
+#if !defined(S_ISSOCK) && defined(S_IFSOCK)
+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+#endif
+#if !defined(S_ISFIFO) && defined(S_IFIFO)
+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#endif
+
+/* Note: Some systems need both string.h and strings.h (Savage). However,
+ * some systems can't handle both, only use string.h in that case. */
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
+# include <strings.h>
+#endif
+
+#if defined(HAVE_SETJMP_H)
+# include <setjmp.h>
+# ifdef HAVE_SIGSETJMP
+# define JMP_BUF sigjmp_buf
+# define SETJMP(x) sigsetjmp((x), 1)
+# define LONGJMP siglongjmp
+# else
+# define JMP_BUF jmp_buf
+# define SETJMP(x) setjmp(x)
+# define LONGJMP longjmp
+# endif
+#endif
+
+#define HAVE_DUP /* have dup() */
+#define HAVE_ST_MODE /* have stat.st_mode */
+
+/* We have three kinds of ACL support. */
+#define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL)
diff --git a/src/os_unixx.h b/src/os_unixx.h
new file mode 100644
index 000000000..9f4f7eb60
--- /dev/null
+++ b/src/os_unixx.h
@@ -0,0 +1,130 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * os_unixx.h -- include files that are only used in os_unix.c
+ */
+
+/*
+ * Stuff for signals
+ */
+#if defined(HAVE_SIGSET) && !defined(signal)
+# define signal sigset
+#endif
+
+ /* sun's sys/ioctl.h redefines symbols from termio world */
+#if defined(HAVE_SYS_IOCTL_H) && !defined(sun)
+# include <sys/ioctl.h>
+#endif
+
+#ifndef USE_SYSTEM /* use fork/exec to start the shell */
+
+# if defined(HAVE_SYS_WAIT_H) || defined(HAVE_UNION_WAIT)
+# include <sys/wait.h>
+# endif
+
+# if defined(HAVE_SYS_SELECT_H) && \
+ (!defined(HAVE_SYS_TIME_H) || defined(SYS_SELECT_WITH_SYS_TIME))
+# include <sys/select.h>
+# endif
+
+# ifndef WEXITSTATUS
+# ifdef HAVE_UNION_WAIT
+# define WEXITSTATUS(stat_val) ((stat_val).w_T.w_Retcode)
+# else
+# define WEXITSTATUS(stat_val) (((stat_val) >> 8) & 0377)
+# endif
+# endif
+
+# ifndef WIFEXITED
+# ifdef HAVE_UNION_WAIT
+# define WIFEXITED(stat_val) ((stat_val).w_T.w_Termsig == 0)
+# else
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+# endif
+# endif
+
+#endif /* !USE_SYSTEM */
+
+#ifdef HAVE_STROPTS_H
+#ifdef sinix
+#define buf_T __system_buf_t__
+#endif
+# include <stropts.h>
+#ifdef sinix
+#undef buf_T
+#endif
+#endif
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+
+#ifndef HAVE_SELECT
+# ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+# else
+# ifdef HAVE_POLL_H
+# include <poll.h>
+# endif
+# endif
+#endif
+
+#ifdef HAVE_SYS_STREAM_H
+# include <sys/stream.h>
+#endif
+
+#ifdef HAVE_SYS_UTSNAME_H
+# include <sys/utsname.h>
+#endif
+
+#ifdef HAVE_SYS_SYSTEMINFO_H
+/*
+ * foolish Sinix <sys/systeminfo.h> uses SYS_NMLN but doesn't include
+ * <limits.h>, where it is defined. Perhaps other systems have the same
+ * problem? Include it here. -- Slootman
+ */
+# if defined(HAVE_LIMITS_H) && !defined(_LIMITS_H)
+# include <limits.h> /* for SYS_NMLN (Sinix 5.41 / Unix SysV.4) */
+# endif
+# include <sys/systeminfo.h> /* for sysinfo */
+#endif
+
+/*
+ * We use termios.h if both termios.h and termio.h are available.
+ * Termios is supposed to be a superset of termio.h. Don't include them both,
+ * it may give problems on some systems (e.g. hpux).
+ * I don't understand why we don't want termios.h for apollo.
+ */
+#if defined(HAVE_TERMIOS_H) && !defined(apollo)
+# include <termios.h>
+#else
+# ifdef HAVE_TERMIO_H
+# include <termio.h>
+# else
+# ifdef HAVE_SGTTY_H
+# include <sgtty.h>
+# endif
+# endif
+#endif
+
+#ifdef HAVE_SYS_PTEM_H
+# include <sys/ptem.h> /* must be after termios.h for Sinix */
+# ifndef _IO_PTEM_H /* For UnixWare that should check for _IO_PT_PTEM_H */
+# define _IO_PTEM_H
+# endif
+#endif
+
+/* shared library access */
+#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
+# include <dlfcn.h>
+#else
+# if defined(HAVE_DL_H) && defined(HAVE_SHL_LOAD)
+# include <dl.h>
+# endif
+#endif
diff --git a/src/os_vms.c b/src/os_vms.c
new file mode 100644
index 000000000..ab5eca4e1
--- /dev/null
+++ b/src/os_vms.c
@@ -0,0 +1,657 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * VMS port by Henk Elbers
+ * VMS deport by Zoltan Arpadffy
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+typedef struct
+{
+ char class;
+ char type;
+ short width;
+ union
+ {
+ struct
+ {
+ char _basic[3];
+ char length;
+ } y;
+ int basic;
+ } x;
+ int extended;
+} TT_MODE;
+
+typedef struct
+{
+ short buflen;
+ short itemcode;
+ char *bufadrs;
+ int *retlen;
+} ITEM;
+
+typedef struct
+{
+ ITEM equ;
+ int nul;
+} ITMLST1;
+
+typedef struct
+{
+ ITEM index;
+ ITEM string;
+ int nul;
+} ITMLST2;
+
+static TT_MODE orgmode;
+static short iochan; /* TTY I/O channel */
+static short iosb[4]; /* IO status block */
+
+static int vms_match_num = 0;
+static int vms_match_free = 0;
+static char_u **vms_fmatch = NULL;
+static char *Fspec_Rms; /* rms file spec, passed implicitly between routines */
+
+
+
+static TT_MODE get_tty __ARGS((void));
+static void set_tty __ARGS((int row, int col));
+
+#define EXPL_ALLOC_INC 64
+
+#define EQN(S1,S2,LN) (strncmp(S1,S2,LN) == 0)
+#define SKIP_FOLLOWING_SLASHES(Str) while (Str[1] == '/') ++Str
+
+
+/*
+ * vul_desc vult een descriptor met een string en de lengte
+ * hier van.
+ */
+ static void
+vul_desc(DESC *des, char *str)
+{
+ des->dsc$b_dtype = DSC$K_DTYPE_T;
+ des->dsc$b_class = DSC$K_CLASS_S;
+ des->dsc$a_pointer = str;
+ des->dsc$w_length = str ? strlen(str) : 0;
+}
+
+/*
+ * vul_item vult een item met een aantal waarden
+ */
+ static void
+vul_item(ITEM *itm, short len, short cod, char *adr, int *ret)
+{
+ itm->buflen = len;
+ itm->itemcode = cod;
+ itm->bufadrs = adr;
+ itm->retlen = ret;
+}
+
+ void
+mch_settmode(int tmode)
+{
+ int status;
+
+ if ( tmode == TMODE_RAW )
+ set_tty(0, 0);
+ else{
+ switch (orgmode.width)
+ {
+ case 132: OUT_STR_NF((char_u *)"\033[?3h\033>"); break;
+ case 80: OUT_STR_NF((char_u *)"\033[?3l\033>"); break;
+ default: break;
+ }
+ out_flush();
+ status = sys$qiow(0, iochan, IO$_SETMODE, iosb, 0, 0,
+ &orgmode, sizeof(TT_MODE), 0,0,0,0);
+ if (status!=SS$_NORMAL || (iosb[0]&0xFFFF)!=SS$_NORMAL)
+ return;
+ (void)sys$dassgn(iochan);
+ iochan = 0;
+ }
+}
+
+ static void
+set_tty(int row, int col)
+{
+ int status;
+ TT_MODE newmode; /* New TTY mode bits */
+ static short first_time = TRUE;
+
+ if (first_time)
+ {
+ orgmode = get_tty();
+ first_time = FALSE;
+ }
+ newmode = get_tty();
+ if (col)
+ newmode.width = col;
+ if (row)
+ newmode.x.y.length = row;
+ newmode.x.basic |= (TT$M_NOECHO | TT$M_HOSTSYNC);
+ newmode.x.basic &= ~TT$M_TTSYNC;
+ newmode.extended |= TT2$M_PASTHRU;
+ status = sys$qiow(0, iochan, IO$_SETMODE, iosb, 0, 0,
+ &newmode, sizeof(newmode), 0, 0, 0, 0);
+ if (status!=SS$_NORMAL || (iosb[0]&0xFFFF)!=SS$_NORMAL)
+ return;
+}
+
+ static TT_MODE
+get_tty(void)
+{
+
+ static $DESCRIPTOR(odsc,"SYS$OUTPUT"); /* output descriptor */
+
+ int status;
+ TT_MODE tt_mode;
+
+ if (!iochan)
+ status = sys$assign(&odsc,&iochan,0,0);
+
+ status = sys$qiow(0, iochan, IO$_SENSEMODE, iosb, 0, 0,
+ &tt_mode, sizeof(tt_mode), 0, 0, 0, 0);
+ if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
+ {
+ tt_mode.width = 0;
+ tt_mode.type = 0;
+ tt_mode.class = 0;
+ tt_mode.x.basic = 0;
+ tt_mode.x.y.length = 0;
+ tt_mode.extended = 0;
+ }
+ return(tt_mode);
+}
+
+/*
+ * Get the current window size in Rows and Columns.
+ */
+ int
+mch_get_shellsize(void)
+{
+ TT_MODE tmode;
+
+ tmode = get_tty(); /* get size from VMS */
+ Columns = tmode.width;
+ Rows = tmode.x.y.length;
+ return OK;
+}
+
+/*
+ * Try to set the window size to Rows and new_Columns.
+ */
+ void
+mch_set_shellsize(void)
+{
+ set_tty(Rows, Columns);
+ switch (Columns)
+ {
+ case 132: OUT_STR_NF((char_u *)"\033[?3h\033>"); break;
+ case 80: OUT_STR_NF((char_u *)"\033[?3l\033>"); break;
+ default: break;
+ }
+ out_flush();
+ screen_start();
+}
+
+ char_u *
+mch_getenv(char_u *lognam)
+{
+ DESC d_file_dev, d_lognam ;
+ static char buffer[LNM$C_NAMLENGTH+1];
+ char_u *cp = NULL;
+ unsigned long attrib;
+ int lengte = 0, dum = 0, idx = 0;
+ ITMLST2 itmlst;
+ char *sbuf = NULL;
+
+ vul_desc(&d_lognam, (char *)lognam);
+ vul_desc(&d_file_dev, "LNM$FILE_DEV");
+ attrib = LNM$M_CASE_BLIND;
+ vul_item(&itmlst.index, sizeof(int), LNM$_INDEX, (char *)&idx, &dum);
+ vul_item(&itmlst.string, LNM$C_NAMLENGTH, LNM$_STRING, buffer, &lengte);
+ itmlst.nul = 0;
+ if (sys$trnlnm(&attrib, &d_file_dev, &d_lognam, NULL,&itmlst) == SS$_NORMAL)
+ {
+ buffer[lengte] = '\0';
+ if (cp = (char_u *)alloc((unsigned)(lengte+1)))
+ strcpy((char *)cp, buffer);
+ return(cp);
+ }
+ else if ((sbuf = getenv((char *)lognam)))
+ {
+ lengte = strlen(sbuf) + 1;
+ cp = (char_u *)malloc((size_t)lengte);
+ if (cp)
+ strcpy((char *)cp, sbuf);
+ return cp;
+ }
+ else
+ return(NULL);
+}
+
+/*
+ * mch_setenv VMS version of setenv()
+ */
+ int
+mch_setenv(char *var, char *value, int x)
+{
+ int res, dum;
+ long attrib = 0L;
+ char acmode = PSL$C_SUPER; /* needs SYSNAM privilege */
+ DESC tabnam, lognam;
+ ITMLST1 itmlst;
+
+ vul_desc(&tabnam, "LNM$JOB");
+ vul_desc(&lognam, var);
+ vul_item(&itmlst.equ, value ? strlen(value) : 0, value ? LNM$_STRING : 0,
+ value, &dum);
+ itmlst.nul = 0;
+ res = sys$crelnm(&attrib, &tabnam, &lognam, &acmode, &itmlst);
+ return((res == 1) ? 0 : -1);
+}
+
+ int
+vms_sys(char *cmd, char *out, char *inp)
+{
+ DESC cdsc, odsc, idsc;
+ long status;
+
+ if (cmd)
+ vul_desc(&cdsc, cmd);
+ if (out)
+ vul_desc(&odsc, out);
+ if (inp)
+ vul_desc(&idsc, inp);
+
+ lib$spawn(cmd ? &cdsc : NULL, /* command string */
+ inp ? &idsc : NULL, /* input file */
+ out ? &odsc : NULL, /* output file */
+ 0, 0, 0, &status, 0, 0, 0, 0, 0, 0);
+ return status;
+}
+
+/*
+ * Convert VMS system() or lib$spawn() return code to Unix-like exit value.
+ */
+ int
+vms_sys_status(int status)
+{
+ if (status != SS$_NORMAL && (status & STS$M_SUCCESS) == 0)
+ return status; /* Command failed. */
+ return 0;
+}
+
+/*
+ * vms_read()
+ * function for low level char input
+ *
+ * Returns: input length
+ */
+ int
+vms_read(char *inbuf, size_t nbytes)
+{
+ int status, function, len;
+ TT_MODE tt_mode;
+ ITEM itmlst[2];
+ static long trm_mask[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
+
+ /* whatever happened earlier we need an iochan here */
+ if (!iochan)
+ tt_mode = get_tty();
+
+ vul_item(&itmlst[0], 0, TRM$_MODIFIERS,
+ (char *)(TRM$M_TM_ESCAPE | TRM$M_TM_NOECHO | TRM$M_TM_NOEDIT |
+ TRM$M_TM_NOFILTR | TRM$M_TM_NORECALL | TRM$M_TM_TRMNOECHO), 0);
+ vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0);
+
+ function = (IO$_READLBLK | IO$M_EXTEND);
+ memset(inbuf, 0, nbytes);
+
+ while (1)
+ {
+ status = sys$qiow(0, iochan, function, &iosb, 0, 0, inbuf, nbytes - 1,
+ 0, 0, &itmlst, sizeof(itmlst));
+ len = strlen(inbuf);
+ if (len > 0)
+ break;
+ }
+ return len;
+}
+
+/*
+ * vms_wproc() is called for each matching filename by decc$to_vms().
+ * We want to save each match for later retrieval.
+ *
+ * Returns: 1 - continue finding matches
+ * 0 - stop trying to find any further mathces
+ */
+ static int
+vms_wproc(char *name, int val)
+{
+ int i;
+ int nlen;
+ static int vms_match_alloced = 0;
+
+ if (val != DECC$K_FILE) /* Directories and foreing non VMS files are not counting */
+ return 1;
+
+ if (vms_match_num == 0) {
+ /* first time through, setup some things */
+ if (NULL == vms_fmatch) {
+ vms_fmatch = (char_u **)alloc(EXPL_ALLOC_INC * sizeof(char *));
+ if (!vms_fmatch)
+ return 0;
+ vms_match_alloced = EXPL_ALLOC_INC;
+ vms_match_free = EXPL_ALLOC_INC;
+ }
+ else {
+ /* re-use existing space */
+ vms_match_free = vms_match_alloced;
+ }
+ }
+
+ vms_remove_version(name);
+
+ /* convert filename to lowercase */
+ nlen = strlen(name);
+ for (i = 0; i < nlen; i++)
+ name[i] = TOLOWER_ASC(name[i]);
+
+ /* if name already exists, don't add it */
+ for (i = 0; i<vms_match_num; i++) {
+ if (0 == STRCMP((char_u *)name,vms_fmatch[i]))
+ return 1;
+ }
+ if (--vms_match_free == 0) {
+ /* add more space to store matches */
+ vms_match_alloced += EXPL_ALLOC_INC;
+ vms_fmatch = (char_u **)realloc(vms_fmatch,
+ sizeof(char **) * vms_match_alloced);
+ if (!vms_fmatch)
+ return 0;
+ vms_match_free = EXPL_ALLOC_INC;
+ }
+ vms_fmatch[vms_match_num] = vim_strsave((char_u *)name);
+
+ ++vms_match_num;
+ return 1;
+}
+
+/*
+ * mch_expand_wildcards this code does wild-card pattern
+ * matching NOT using the shell
+ *
+ * return OK for success, FAIL for error (you may loose some
+ * memory) and put an error message in *file.
+ *
+ * num_pat number of input patterns
+ * pat array of pointers to input patterns
+ * num_file pointer to number of matched file names
+ * file pointer to array of pointers to matched file names
+ *
+ */
+ int
+mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, int flags)
+{
+ int i, j = 0, cnt = 0;
+ char *cp;
+ char_u buf[MAXPATHL];
+ int dir;
+ int files_alloced, files_free;
+
+ *num_file = 0; /* default: no files found */
+ files_alloced = EXPL_ALLOC_INC;
+ files_free = EXPL_ALLOC_INC;
+ *file = (char_u **) alloc(sizeof(char_u **) * files_alloced);
+ if (*file == NULL)
+ {
+ *num_file = 0;
+ return FAIL;
+ }
+ for (i = 0; i < num_pat; i++)
+ {
+ /* expand environment var or home dir */
+ if (vim_strchr(pat[i],'$') || vim_strchr(pat[i],'~'))
+ expand_env(pat[i],buf,MAXPATHL);
+ else
+ STRCPY(buf,pat[i]);
+
+ vms_match_num = 0; /* reset collection counter */
+ cnt = decc$to_vms(decc$translate_vms(vms_fixfilename(buf)), vms_wproc, 1, 0);
+ /* allow wild, no dir */
+ if (cnt > 0)
+ cnt = vms_match_num;
+
+ if (cnt < 1)
+ continue;
+
+ for (i = 0; i < cnt; i++)
+ {
+ /* files should exist if expanding interactively */
+ if (!(flags & EW_NOTFOUND) && mch_getperm(vms_fmatch[i]) < 0)
+ continue;
+ /* do not include directories */
+ dir = (mch_isdir(vms_fmatch[i]));
+ if (( dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
+ continue;
+ /* allocate memory for pointers */
+ if (--files_free < 1)
+ {
+ files_alloced += EXPL_ALLOC_INC;
+ *file = (char_u **)realloc(*file,
+ sizeof(char_u **) * files_alloced);
+ if (*file == NULL)
+ {
+ *file = (char_u **)"";
+ *num_file = 0;
+ return(FAIL);
+ }
+ files_free = EXPL_ALLOC_INC;
+ }
+
+ (*file)[*num_file++] = vms_fmatch[i];
+ }
+ }
+ return OK;
+}
+
+ int
+mch_expandpath(garray_T *gap, char_u *path, int flags)
+{
+ int i,cnt = 0;
+ char *cp;
+ vms_match_num = 0;
+
+ cnt = decc$to_vms(decc$translate_vms(vms_fixfilename(path)), vms_wproc, 1, 0);
+ /* allow wild, no dir */
+ if (cnt > 0)
+ cnt = vms_match_num;
+ for (i = 0; i < cnt; i++)
+ {
+ if (mch_getperm(vms_fmatch[i]) >= 0) /* add existing file */
+ addfile(gap, vms_fmatch[i], flags);
+ }
+ return cnt;
+}
+
+/*
+ * attempt to translate a mixed unix-vms file specification to pure vms
+ */
+ static void
+vms_unix_mixed_filespec(char *in, char *out)
+{
+ char *lastcolon;
+ char *end_of_dir;
+ char ch;
+ int len;
+
+ /* copy vms filename portion up to last colon
+ * (node and/or disk)
+ */
+ lastcolon = strrchr(in, ':'); /* find last colon */
+ if (lastcolon != NULL) {
+ len = lastcolon - in + 1;
+ strncpy(out, in, len);
+ out += len;
+ in += len;
+ }
+
+ end_of_dir = NULL; /* default: no directory */
+
+ /* start of directory portion */
+ ch = *in;
+ if ((ch == '[') || (ch == '/') || (ch == '<') ) { /* start of directory(s) ? */
+ ch = '[';
+ SKIP_FOLLOWING_SLASHES(in);
+ } else if (EQN(in, "../", 3)) { /* Unix parent directory? */
+ *out++ = '[';
+ *out++ = '-';
+ end_of_dir = out;
+ ch = '.';
+ in += 2;
+ SKIP_FOLLOWING_SLASHES(in);
+ } else { /* not a special character */
+ while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
+ in += 2;
+ SKIP_FOLLOWING_SLASHES(in);
+ }
+ if (strchr(in, '/') == NULL) { /* any more Unix directories ? */
+ strcpy(out, in); /* No - get rest of the spec */
+ return;
+ } else {
+ *out++ = '['; /* Yes, denote a Vms subdirectory */
+ ch = '.';
+ --in;
+ }
+ }
+
+ /* if we get here, there is a directory part of the filename */
+
+ /* initialize output file spec */
+ *out++ = ch;
+ ++in;
+
+ while (*in != '\0') {
+ ch = *in;
+ if ((ch == ']') || (ch == '/') || (ch == '>') ) { /* end of (sub)directory ? */
+ end_of_dir = out;
+ ch = '.';
+ SKIP_FOLLOWING_SLASHES(in);
+ }
+ else if (EQN(in, "../", 3)) { /* Unix parent directory? */
+ *out++ = '-';
+ end_of_dir = out;
+ ch = '.';
+ in += 2;
+ SKIP_FOLLOWING_SLASHES(in);
+ }
+ else {
+ while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
+ end_of_dir = out;
+ in += 2;
+ SKIP_FOLLOWING_SLASHES(in);
+ ch = *in;
+ }
+ }
+
+ /* Place next character into output file spec */
+ *out++ = ch;
+ ++in;
+ }
+
+ *out = '\0'; /* Terminate output file spec */
+
+ if (end_of_dir != NULL) /* Terminate directory portion */
+ *end_of_dir = ']';
+}
+
+
+/*
+ * for decc$to_vms in vms_fixfilename
+ */
+ static int
+vms_fspec_proc(char *fil, int val)
+{
+ strcpy(Fspec_Rms,fil);
+ return(1);
+}
+
+/*
+ * change unix and mixed filenames to VMS
+ */
+ void *
+vms_fixfilename(void *instring)
+{
+ static char *buf = NULL;
+ static size_t buflen = 0;
+ size_t len;
+
+ /* get a big-enough buffer */
+ len = strlen(instring) + 1;
+ if (len > buflen)
+ {
+ buflen = len + 128;
+ if (buf)
+ buf = (char *)realloc(buf, buflen);
+ else
+ buf = (char *)calloc(buflen, sizeof(char));
+ }
+
+#ifdef DEBUG
+ char *tmpbuf = NULL;
+ tmpbuf = (char *)calloc(buflen, sizeof(char));
+ strcpy(tmpbuf, instring);
+#endif
+
+ Fspec_Rms = buf; /* for decc$to_vms */
+
+ if ( strchr(instring,'/') == NULL )
+ /* It is already a VMS file spec */
+ strcpy(buf, instring);
+ else if ( strchr(instring,'"') == NULL ){ /* password in the path ? */
+ /* Seems it is a regular file, let guess that it is pure Unix fspec */
+ if ( decc$to_vms(instring, vms_fspec_proc, 0, 0) <= 0 )
+ /* No... it must be mixed */
+ vms_unix_mixed_filespec(instring, buf);
+ }
+ else
+ /* we have a password in the path */
+ /* decc$ functions can not handle */
+ /* this is our only hope to resolv */
+ vms_unix_mixed_filespec(instring, buf);
+
+ return buf;
+}
+/*
+ * Remove version number from file name
+ * we need it in some special cases as:
+ * creating swap file name and writing new file
+ */
+ void
+vms_remove_version(void * fname)
+{
+ char_u *cp;
+ char_u *fp;
+
+ if ((cp = vim_strchr( fname, ';')) != NULL) /* remove version */
+ *cp = '\0';
+ else if ((cp = vim_strrchr( fname, '.')) != NULL )
+ {
+ if ((fp = vim_strrchr( fname, ']')) != NULL ) {;}
+ else if ((fp = vim_strrchr( fname, '>')) != NULL ) {;}
+ else fp = fname;
+
+ while ( *fp != '\0' && fp < cp )
+ if ( *fp++ == '.' )
+ *cp = '\0';
+ }
+ return ;
+}
diff --git a/src/os_vms_conf.h b/src/os_vms_conf.h
new file mode 100644
index 000000000..006460824
--- /dev/null
+++ b/src/os_vms_conf.h
@@ -0,0 +1,185 @@
+/* os_vms_conf.h. Replaces auto/config.h for VMS */
+
+#define CASE_INSENSITIVE_FILENAME /* Open VMS is case insensitive */
+#define SPACE_IN_FILENAME /* There could be space between user and passwd */
+#define FNAME_ILLEGAL "|*#?%" /* Illegal characters in a file name */
+#define BINARY_FILE_IO /* Use binary fileio */
+#define USE_GETCWD
+#define USE_SYSTEM
+
+/* Define when terminfo support found */
+#undef TERMINFO
+
+/* Define when termcap.h contains ospeed */
+/* #define HAVE_OSPEED */
+
+/* Define when termcap.h contains UP, BC and PC */
+/* #define HAVE_UP_BC_PC */
+
+/* Define when termcap.h defines outfuntype */
+/*#define HAVE_OUTFUNTYPE */
+
+/* Define when __DATE__ " " __TIME__ can be used */
+#define HAVE_DATE_TIME
+
+/* Defined to the size of an int */
+#define SIZEOF_INT 4
+
+/* #undef USEBCOPY */
+#define USEMEMMOVE
+/* #undef USEMEMCPY */
+
+/* Define when "man -s 2" is to be used */
+/* #undef USEMAN_S */
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef mode_t */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef off_t */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef pid_t */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+/* #undef ino_t */
+
+/* Define if you have the nanosleep() function. */
+/* #undef HAVE_NANOSLEEP */
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME
+
+/* Define if you can safely include both <sys/time.h> and <sys/select.h>. */
+/* #undef SYS_SELECT_WITH_SYS_TIME */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define as the command at the end of signal handlers ("" or "return 0;"). */
+#define SIGRETURN return
+
+/* Define if struct sigcontext is present */
+#define HAVE_SIGCONTEXT
+
+/* Define if toupper/tolower only work on lower/upercase characters */
+/* #define BROKEN_TOUPPER */
+
+/* Define if tgetstr() has a second argument that is (char *) */
+/* #undef TGETSTR_CHAR_P */
+
+/* Define if you have the sigset() function. */
+/* #undef HAVE_SIGSET */
+
+/* Define if you have the setpgid() function. */
+/* #undef HAVE_SETPGID */
+
+/* Define if you have the setsid() function. */
+/* #undef HAVE_SETSID */
+
+/* Define if you have the sigset() function. */
+/* #undef HAVE_SIGSET */
+
+#define TGETENT_ZERO_ERR
+#define HAVE_GETCWD
+#define HAVE_STRCSPN
+#define HAVE_STRTOL
+#define HAVE_TGETENT
+#define HAVE_MEMSET
+#define HAVE_MEMCMP
+#define HAVE_STRERROR
+#define HAVE_FCHOWN
+#define HAVE_RENAME
+#define HAVE_QSORT
+#define HAVE_FSYNC
+#define HAVE_GETPWUID
+#define HAVE_GETPWNAM
+#define HAVE_STDLIB_H
+#define HAVE_STRING_H
+#define HAVE_ERRNO_H
+#define HAVE_OPENDIR
+#define HAVE_PUTENV
+#define HAVE_SETENV
+#define HAVE_SETJMP_H
+
+#undef HAVE_DIRENT_H
+#undef HAVE_SYS_NDIR_H
+#undef HAVE_SYS_DIR_H
+#undef HAVE_NDIR_H
+#undef HAVE_SYS_WAIT_H
+#undef HAVE_UNION_WAIT
+#undef HAVE_SYS_SELECT_H
+#undef HAVE_SYS_UTSNAME_H
+#undef HAVE_SYS_SYSTEMINFO_H
+#undef HAVE_TERMCAP_H
+#undef HAVE_SGTTY_H
+#undef HAVE_SYS_IOCTL_H
+#undef HAVE_TERMIO_H
+#undef HAVE_STROPTS_H
+#undef HAVE_SYS_STREAM_H
+#undef HAVE_SYS_PTEM_H
+#undef HAVE_TERMIOS_H
+#undef HAVE_LIBC_H
+#undef HAVE_SYS_STATFS_H
+#undef HAVE_SYS_POLL_H
+#undef HAVE_PWD_H
+#undef HAVE_FCHDIR
+
+/* Hardware specific */
+#ifdef VAX
+#undef HAVE_GETTIMEOFDAY
+#undef HAVE_USLEEP
+#undef HAVE_STRCASECMP
+#undef HAVE_STRINGS_H
+#undef HAVE_SIGSETJMP
+#else
+#define HAVE_GETTIMEOFDAY
+#define HAVE_USLEEP
+#define HAVE_STRCASECMP
+#define HAVE_STRINGS_H
+#define HAVE_SIGSETJMP
+#endif
+
+/* Compiler specific */
+#ifdef VAXC
+#undef HAVE_SELECT
+#undef HAVE_FCNTL_H
+#undef HAVE_UNISTD_H
+#undef HAVE_SYS_TIME_H
+#undef HAVE_LOCALE_H
+#define BROKEN_LOCALE
+#undef HAVE_ICONV_H
+#undef HAVE_ICONV
+#undef DYNAMIC_ICONV
+#undef HAVE_STRFTIME
+#else
+#define HAVE_SELECT
+#define HAVE_FCNTL_H
+#define HAVE_UNISTD_H 1
+#define HAVE_SYS_TIME_H
+#define HAVE_LOCALE_H
+#define BROKEN_LOCALE
+#undef HAVE_ICONV_H
+#undef HAVE_ICONV
+#undef DYNAMIC_ICONV
+#define HAVE_STRFTIME
+#endif
+
+/* GUI support defines */
+#ifdef FEAT_GUI_MOTIF
+#define HAVE_X11
+#define USE_FONTSET
+#undef X_LOCALE
+#endif
diff --git a/src/os_vms_fix.com b/src/os_vms_fix.com
new file mode 100644
index 000000000..8355a352d
--- /dev/null
+++ b/src/os_vms_fix.com
@@ -0,0 +1,276 @@
+$!
+$! OS_VMS_FIX.COM
+$! Copyright (C) 2000, Stephen P. Wall
+$!
+$! Filter files for "#if" line continuations using a '\' and convert
+$! them to use comments for the continuation. Necessary for VAXC - it
+$! doesn't understand the '\'.
+$!
+$! Yes, this is honkin' ugly code, but I deliberately avoided
+$! if ...
+$! then
+$! ....
+$! endif
+$! and call/subroutine/endsubroutine constructs, because I can still
+$! remember when DCL didn't have them, and I wanted this to be as
+$! portable as possible, so... If you want to structure it nicer for
+$! your own use, please feel free to do so. However, please only
+$! distribute it in it's original form.
+$!
+$! I wrote it in DCL for portability and ease of use - a C version
+$! would definitely run faster, but then I'd have to deal with compiler
+$! differences, and users would have to deal with configuring and
+$! building it. With DCL, it runs out-of-the-box.
+$!
+$! Note that if you use this from a VMS system to modify files on a
+$! mounted network drive, f$search() may return only the first matching
+$! file when it tries to resolve wildcards. I have been unable to find
+$! a way around this. Either copy the files to a local disk, or specify
+$! each file individually (Keep in mind if you do this that VMS limits
+$! you to eight parameters, so you'll only be able to filter eight files
+$! at a time).
+$!
+$! Ideas...
+$! - Use 'search filespec "#","if","\"/mat=and' to quickly eliminate
+$! files that definitely don't need filtering. This should speed
+$! things up considerable. Reading and writing every line from every
+$! file takes quite a bit of time...
+$! - Error handling isn't great. Come up with something better....
+$!
+$! E-mail addresses:
+$! Steve Wall hitched97@velnet.com
+$! Zoltan Arpadffy arpadffy@polarhome.com
+$! John W. Hamill jhamill3@ford.com
+$!
+$! Modification History:
+$! 13Jul00 SWall Initial Version
+$! 14Jul00 ZArpadffy Display usage
+$! 06Mar01 JHamill Ctrl-M problem fix
+$!
+$! If no parameters, or "-h" for a parameter, print usage and exit
+$
+$ all = "''p1'''p2'''p3'''p4'''p5'''p6'''p7'''p8'"
+$ if (all .nes. "") .and. (p1 .nes. "-h") .and. (p1 .nes. "-H") then goto startup
+$
+$ write sys$output "OS_VMS_FIX - DECC->VAXC pre-processor directive convert script"
+$ write sys$output "Usage: @OS_VMS_FIX <filename_1> <filename_2> <...>"
+$ write sys$output " @OS_VMS_FIX <filename with wildcard> <...>"
+$ write sys$output ""
+$ write sys$output "Example: @OS_VMS_FIX *.c *.h [.proto]*.pro"
+$ write sys$output "Please note, you can define up to 8 parameters."
+$ write sys$output ""
+$ exit
+$
+$! Create an FDL file to convert VFC format files to Stream_LF.
+$! VMS OPEN/WRITE command creates VFC files. When VFC files are read
+$! out under unix, they appear to have binary data embedded in them.
+$! To be friendly, we'll convert them to Stream_LF, which reads just
+$! file on unix.
+$
+$startup:
+$ on control_y then goto stopfdl
+$ open/write fdl []convert.fdl
+$ write fdl "SYSTEM"
+$ write fdl " SOURCE VAX/VMS"
+$ write fdl "FILE"
+$ write fdl " ORGANIZATION SEQUENTIAL"
+$ write fdl "RECORD"
+$ write fdl " BLOCK_SPAN YES"
+$ write fdl " CARRIAGE_CONTROL CARRIAGE_RETURN"
+$ write fdl " FORMAT STREAM"
+$ write fdl " SIZE 0"
+$ close fdl
+$ on control_y then goto endparamloop
+$
+$! Some symbols for use later on...
+$
+$ spc = ""
+$ spc[0,8] = 32
+$ tab = ""
+$ tab[0,8] = 9
+$
+$! Scan all positional arguments, do wildcard expansion, and call the
+$! filter routine on each resulting filename.
+$
+$ cnt = 0
+$paramloop:
+$ cnt = cnt + 1
+$
+$! VMS only allows command line parameters P1 - P8, so stop after
+$! processing 8 arguments.
+$
+$ if cnt .eq. 9 then goto endparamloop
+$
+$! Skip any empty parameter.
+$
+$ if P'cnt' .eqs. "" then goto paramloop
+$
+$! Got a parameter - do wildcard expansion.
+$
+$ arg = f$parse(P'cnt')
+$ write sys$output "Parsing ''arg'..."
+$ last = ""
+$fileloop:
+$ file = f$search(arg, 1)
+$
+$! f$search() returns "" after the last of multiple matches.
+$
+$ if file .eqs. "" then goto endfileloop
+$
+$! Strip the version number.
+$
+$ file = f$parse(file,,,"DEVICE") + f$parse(file,,,"DIRECTORY") + -
+ f$parse(file,,,"NAME") + f$parse(file,,,"TYPE")
+$
+$! f$search() returns the same filename over and over if there are no
+$! wildcards in it.
+$
+$ if file .eqs. last then goto endfileloop
+$ last = file
+$
+$! Got a valid file - filter it.
+$
+$ gosub filter
+$
+$! Reset our error handling.
+$
+$ on control_y then goto endparamloop
+$
+$! See if there's another matching filename.
+$
+$ goto fileloop
+$endfileloop:
+$
+$! Check for another parameter.
+$
+$ goto paramloop
+$endparamloop:
+$
+$! Finished - delete the FDL file.
+$
+$ delete []convert.fdl;
+$
+$! So long, and thanks for all the fish...
+$
+$ exit
+$
+$
+$! User aborted with Control-Y during creation of FDL file.
+$! Close the file, delete it, and exit with an error status.
+$
+$stopfdl:
+$ close fdl
+$ delete []convert.fdl;
+$ exit %X10000000
+$
+$
+$! Filter a file.
+$
+$filter:
+$ write sys$output "Filtering ''file'..."
+$
+$! Get a temporary filename from the subroutine parameter.
+$
+$ tmp = f$parse(file,,,"DEVICE") + f$parse(file,,,"DIRECTORY") + -
+ "tmp_" + f$parse(file,,,"NAME") + f$parse(file,,,"TYPE")
+$ on control_y then goto aborted
+$ open /read input 'file'
+$ open /write output 'tmp'
+$ changed = 0
+$readloop:
+$ read/end_of_file=endreadloop/error=readlooperror input line
+$
+$! Get the first 3 non-blank character on the line.
+$
+$ start = f$extract(0,3,f$edit(line,"COLLAPSE,LOWERCASE"))
+$
+$! If the line doesn't start with some form of "#if", just write it to
+$! the temp file.
+$
+$ if start .nes. "#if" then goto writeit
+$chkbkslsh:
+$
+$! See if the line ends in a backslash. If not, write it to the temp file.
+$
+$ if f$extract(f$length(line)-1,1,line) .nes. "\" then goto writeit
+$
+$! Ok, got a line that needs to be modified. Mark this file as changed,
+$! then replace the backslash at the end with the beginning of a comment
+$! (/*), and write it to the temp file.
+$
+$ changed = 1
+$ line = f$extract(0,f$length(line)-1,line) + "/*"
+$ write/symbol output line
+$
+$! Get another line from the input.
+$
+$ read/end_of_file=endreadloop/error=readlooperror input line
+$
+$! Grab all the blank space from the beginning of the line.
+$
+$ spaces = ""
+$spaceloop:
+$ if (f$extract(0,1,line) .nes. spc) .and. (f$extract(0,1,line) .nes. tab) -
+ then goto endspaceloop
+$ spaces = spaces + f$extract(0,1,line)
+$ line = f$extract(1,f$length(line)-1,line)
+$ goto spaceloop
+$endspaceloop:
+$
+$! Stick an end-comment (*/) after the leading blanks, then go back and
+$! check for a trailing backslash again, to catch code that continues
+$! across multiple lines.
+$
+$ line = spaces + "*/ " + line
+$ goto chkbkslsh
+$
+$! Write the current line, (will either be an untouched line, or the
+$! last line of a continuation) to the temp file, and go back to look
+$! for more input.
+$!
+$writeit:
+$ write/symbol output line
+$ goto readloop
+$
+$! Hit EOF. Close the input & output, and if the file was marked as
+$! changed, convert it from VMS VFC format, to the more common Stream_LF
+$! format, so it doesn't show up full of garbage if someone tries to
+$! edit it on another OS.
+$!
+$endreadloop:
+$ close input
+$ close output
+$ if changed .eq. 0 then goto nocopy
+$ convert 'tmp' 'file' /fdl=[]convert.fdl
+$nocopy:
+$ delete 'tmp';
+$
+$! Exit this subroutine.
+$
+$ goto endfunc
+$
+$! Got a read error. Say so, and trash the temp file.
+$
+$readlooperror:
+$ write sys$error "Error processing file ''file'"
+$ goto errorend
+$
+$! Got an interrupt. Say so, and trash the temp file.
+$
+$aborted:
+$ write sys$error "Aborted while processing file ''file'"
+$
+$! Common code for read errors and interrupts.
+$
+$errorend:
+$ close input
+$ close output
+$ delete 'tmp';
+$ return %X10000000
+$
+$! End of filter subroutine.
+$
+$endfunc:
+$ return
+$
+$! EOF
diff --git a/src/os_vms_mms.c b/src/os_vms_mms.c
new file mode 100644
index 000000000..d653860be
--- /dev/null
+++ b/src/os_vms_mms.c
@@ -0,0 +1,76 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unixio.h>
+#include "vim.h"
+int main(int argc, char *argv[])
+{
+ FILE *fpi, *fpo;
+ char cmd[132], buf[BUFSIZ], *argp, *error_file, target[132], *mms;
+ int err = 0, err_line = 0;
+
+ mms = "mms";
+ argc--;
+ argv++;
+ while (argc-- > 0)
+ {
+ argp = *argv++;
+ if (*argp == '-')
+ {
+ switch (*++argp)
+ {
+ case 'm':
+ mms = ++argp;
+ break;
+ case 'e':
+ if (!*(error_file = ++argp))
+ {
+ error_file = *argv++;
+ argc--;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ if (*target)
+ strcat(target, " ");
+ strcat(target, argp);
+ }
+ }
+ sprintf(cmd, "%s/output=tmp:errors.vim_tmp %s", mms, target);
+ system(cmd);
+ fpi = fopen("tmp:errors.vim_tmp", "r");
+ fpo = fopen(error_file, "w");
+ while (fgets(buf, BUFSIZ, fpi))
+ {
+ if (!memcmp(buf, "%CC-", 4))
+ {
+ err_line++;
+ buf[strlen(buf)-1] = '\0';
+ err++;
+ }
+ else
+ {
+ if (err_line)
+ {
+ if (strstr(buf, _("At line")))
+ {
+ err_line = 0;
+ fprintf(fpo, "@");
+ }
+ else
+ buf[strlen(buf)-1] = '\0';
+ }
+ }
+ fprintf(fpo, "%s", buf);
+ }
+ fclose(fpi);
+ fclose(fpo);
+ while (!delete("tmp:errors.vim_tmp"))
+ /*nop*/;
+ exit(err ? 44 : 1);
+ return(0);
+}
diff --git a/src/os_w32dll.c b/src/os_w32dll.c
new file mode 100644
index 000000000..9cfec1aa5
--- /dev/null
+++ b/src/os_w32dll.c
@@ -0,0 +1,24 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * Windows GUI: main program (DLL) entry point:
+ *
+ * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
+ */
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ return TRUE;
+}
+
diff --git a/src/os_w32exe.c b/src/os_w32exe.c
new file mode 100644
index 000000000..e37873b76
--- /dev/null
+++ b/src/os_w32exe.c
@@ -0,0 +1,136 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * GUI support by Robert Webb
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * Windows GUI: main program (EXE) entry point:
+ *
+ * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
+ */
+#include "vim.h"
+
+#ifdef __MINGW32__
+# ifndef _cdecl
+# define _cdecl
+# endif
+#endif
+
+/* cproto doesn't create a prototype for main() */
+int _cdecl
+#if defined(FEAT_GUI_W32)
+VimMain
+#else
+ main
+#endif
+ __ARGS((int argc, char **argv));
+int (_cdecl *pmain)(int, char **);
+
+#ifndef PROTO
+#ifdef FEAT_GUI
+#ifndef VIMDLL
+void _cdecl SaveInst(HINSTANCE hInst);
+#endif
+void (_cdecl *pSaveInst)(HINSTANCE);
+#endif
+
+ int WINAPI
+WinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInst,
+ LPSTR lpszCmdLine,
+ int nCmdShow)
+{
+ int argc;
+ char **argv;
+ char *tofree;
+ char prog[256];
+#ifdef VIMDLL
+ char *p;
+ HANDLE hLib;
+#endif
+
+ /* Ron: added full path name so that the $VIM variable will get set to our
+ * startup path (so the .vimrc file can be found w/o a VIM env. var.) */
+ GetModuleFileName(NULL, prog, 255);
+
+ /* Separate the command line into arguments. */
+ argc = get_cmd_args(prog, (char *)lpszCmdLine, &argv, &tofree);
+ if (argc == 0)
+ {
+ MessageBox(0, _("Could not allocate memory for command line."),
+ _("VIM Error"), 0);
+ return 0;
+ }
+
+#ifdef DYNAMIC_GETTEXT
+ /* Initialize gettext library */
+ dyn_libintl_init(NULL);
+#endif
+
+#ifdef VIMDLL
+ // LoadLibrary - get name of dll to load in here:
+ p = strrchr(prog, '\\');
+ if (p != NULL)
+ {
+# ifdef DEBUG
+ strcpy(p+1, "vim32d.dll");
+# else
+ strcpy(p+1, "vim32.dll");
+# endif
+ }
+ hLib = LoadLibrary(prog);
+ if (hLib == NULL)
+ {
+ MessageBox(0, _("Could not load vim32.dll!"), _("VIM Error"), 0);
+ goto errout;
+ }
+ // fix up the function pointers
+# ifdef FEAT_GUI
+ pSaveInst = GetProcAddress(hLib, (LPCSTR)2);
+# endif
+ pmain = GetProcAddress(hLib, (LPCSTR)1);
+ if (pmain == NULL)
+ {
+ MessageBox(0, _("Could not fix up function pointers to the DLL!"),
+ _("VIM Error"),0);
+ goto errout;
+ }
+#else
+# ifdef FEAT_GUI
+ pSaveInst = SaveInst;
+# endif
+ pmain =
+# if defined(FEAT_GUI_W32)
+ //&& defined(__MINGW32__)
+ VimMain
+# else
+ main
+# endif
+ ;
+#endif
+#ifdef FEAT_GUI
+ pSaveInst(
+#ifdef __MINGW32__
+ GetModuleHandle(NULL)
+#else
+ hInstance
+#endif
+ );
+#endif
+ pmain(argc, argv);
+
+#ifdef VIMDLL
+ FreeLibrary(hLib);
+errout:
+#endif
+ free(argv);
+ free(tofree);
+
+ return 0;
+}
+#endif
diff --git a/src/os_win16.c b/src/os_win16.c
new file mode 100644
index 000000000..1b1ccd700
--- /dev/null
+++ b/src/os_win16.c
@@ -0,0 +1,424 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * os_win16.c
+ *
+ * Win16 (Windows 3.1x) system-dependent routines.
+ * Carved brutally from os_win32.c by Vince Negri <vn@aslnet.co.uk>
+ */
+#ifdef __BORLANDC__
+# pragma warn -par
+# pragma warn -ucp
+# pragma warn -use
+# pragma warn -aus
+# pragma warn -obs
+#endif
+
+#include <io.h>
+#include "vim.h"
+
+#include <fcntl.h>
+#include <dos.h>
+#include <string.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
+#include <limits.h>
+#include <process.h>
+
+#undef chdir
+#include <direct.h>
+#include <shellapi.h> /* required for FindExecutable() */
+
+
+/* Record all output and all keyboard & mouse input */
+/* #define MCH_WRITE_DUMP */
+
+#ifdef MCH_WRITE_DUMP
+FILE* fdDump = NULL;
+#endif
+
+
+/*
+ * When generating prototypes for Win32 on Unix, these lines make the syntax
+ * errors disappear. They do not need to be correct.
+ */
+#ifdef PROTO
+typedef int HANDLE;
+typedef int SMALL_RECT;
+typedef int COORD;
+typedef int SHORT;
+typedef int WORD;
+typedef int DWORD;
+typedef int BOOL;
+typedef int LPSTR;
+typedef int LPTSTR;
+typedef int KEY_EVENT_RECORD;
+typedef int MOUSE_EVENT_RECORD;
+# define WINAPI
+typedef int CONSOLE_CURSOR_INFO;
+typedef char * LPCSTR;
+# define WINBASEAPI
+typedef int INPUT_RECORD;
+# define _cdecl
+#endif
+
+#ifdef __BORLANDC__
+/* being a more ANSI compliant compiler, BorlandC doesn't define _stricoll:
+ * but it does in BC 5.02! */
+# if __BORLANDC__ < 0x502
+int _stricoll(char *a, char *b);
+# endif
+#endif
+
+/* cproto doesn't create a prototype for main() */
+int _cdecl
+VimMain
+__ARGS((int argc, char **argv));
+int (_cdecl *pmain)(int, char **);
+
+#ifndef PROTO
+void _cdecl SaveInst(HINSTANCE hInst);
+void (_cdecl *pSaveInst)(HINSTANCE);
+
+int WINAPI
+WinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInst,
+ LPSTR lpszCmdLine,
+ int nCmdShow)
+{
+ int argc;
+ char **argv;
+ char *tofree;
+ char prog[256];
+
+ /*
+ * Ron: added full path name so that the $VIM variable will get set to our
+ * startup path (so the .vimrc file can be found w/o a VIM env. var.)
+ * Remove the ".exe" extension, and find the 1st non-space.
+ */
+ GetModuleFileName(hInstance, prog, 255);
+ if (*prog != NUL)
+ exe_name = FullName_save((char_u *)prog, FALSE);
+
+ /* Separate the command line into arguments. */
+ argc = get_cmd_args(prog, (char *)lpszCmdLine, &argv, &tofree);
+ if (argc == 0)
+ {
+ /* Error message? */
+ return 0;
+ }
+
+ pSaveInst = SaveInst;
+ pmain = VimMain;
+ pSaveInst(hInstance);
+ pmain(argc, argv);
+
+ free(argv);
+ free(tofree);
+
+ return 0;
+}
+#endif
+
+
+
+
+
+
+#ifdef FEAT_MOUSE
+
+/*
+ * For the GUI the mouse handling is in gui_w32.c.
+ */
+ void
+mch_setmouse(
+ int on)
+{
+}
+#endif /* FEAT_MOUSE */
+
+
+
+/*
+ * GUI version of mch_init().
+ */
+ void
+mch_init()
+{
+ extern int _fmode;
+
+
+ /* Let critical errors result in a failure, not in a dialog box. Required
+ * for the timestamp test to work on removed floppies. */
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+
+ _fmode = O_BINARY; /* we do our own CR-LF translation */
+
+ /* Specify window size. Is there a place to get the default from? */
+ Rows = 25;
+ Columns = 80;
+
+
+ set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0);
+
+#ifdef FEAT_CLIPBOARD
+ clip_init(TRUE);
+
+ /*
+ * Vim's own clipboard format recognises whether the text is char, line,
+ * or rectangular block. Only useful for copying between two Vims.
+ * "VimClipboard" was used for previous versions, using the first
+ * character to specify MCHAR, MLINE or MBLOCK.
+ */
+ clip_star.format = RegisterClipboardFormat("VimClipboard2");
+ clip_star.format_raw = RegisterClipboardFormat("VimRawBytes");
+#endif
+}
+
+
+
+/*
+ * Do we have an interactive window?
+ */
+ int
+mch_check_win(
+ int argc,
+ char **argv)
+{
+ int i;
+
+ return OK; /* GUI always has a tty */
+}
+
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ return (long)GetCurrentTask();
+}
+
+
+/*
+ * Specialised version of system().
+ * This version proceeds as follows:
+ * 1. Start the program with WinExec
+ * 2. Wait for the module use count of the program to go to 0
+ * (This is the best way of detecting the program has finished)
+ */
+
+ static int
+mch_system(char *cmd, int options)
+{
+ DWORD ret = 0;
+ UINT wShowWindow;
+ UINT h_module;
+ MSG msg;
+ BOOL again = TRUE;
+
+ /*
+ * It's nicer to run a filter command in a minimized window, but in
+ */
+ if (options & SHELL_DOOUT)
+ wShowWindow = SW_SHOWMINIMIZED;
+ else
+ wShowWindow = SW_SHOWNORMAL;
+
+ /* Now, run the command */
+ h_module = WinExec((LPCSTR)cmd, wShowWindow);
+
+ if (h_module < 32)
+ {
+ /*error*/
+ ret = -h_module;
+ }
+ else
+ {
+ /* Wait for the command to terminate before continuing */
+ while (GetModuleUsage((HINSTANCE)h_module) > 0 && again )
+ {
+ while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) && again )
+ {
+ if(msg.message == WM_QUIT)
+
+ {
+ PostQuitMessage(msg.wParam);
+ again = FALSE;
+ }
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ }
+
+ return ret;
+}
+
+/*
+ * Either execute a command by calling the shell or start a new shell
+ */
+ int
+mch_call_shell(
+ char_u *cmd,
+ int options) /* SHELL_, see vim.h */
+{
+ int x;
+ int tmode = cur_tmode;
+
+ out_flush();
+
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "mch_call_shell(\"%s\", %d)\n", cmd, options);
+ fflush(fdDump);
+ }
+#endif
+
+ /*
+ * Catch all deadly signals while running the external command, because a
+ * CTRL-C, Ctrl-Break or illegal instruction might otherwise kill us.
+ */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGILL, SIG_IGN);
+ signal(SIGFPE, SIG_IGN);
+ signal(SIGSEGV, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+ signal(SIGABRT, SIG_IGN);
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+
+ if (cmd == NULL)
+ {
+ x = mch_system(p_sh, options);
+ }
+ else
+ {
+ /* we use "command" or "cmd" to start the shell; slow but easy */
+ char_u *newcmd;
+
+ newcmd = lalloc(
+ STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10, TRUE);
+ if (newcmd != NULL)
+ {
+ if (STRNICMP(cmd, "start ", 6) == 0)
+ {
+ sprintf((char *)newcmd, "%s\0", cmd+6);
+ if (WinExec((LPCSTR)newcmd, SW_SHOWNORMAL) > 31)
+ x = 0;
+ else
+ x = -1;
+ }
+ else
+ {
+ sprintf((char *)newcmd, "%s%s %s %s",
+ "",
+ p_sh,
+ p_shcf,
+ cmd);
+ x = mch_system((char *)newcmd, options);
+ }
+ vim_free(newcmd);
+ }
+ }
+
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+
+ if (x && !(options & SHELL_SILENT) && !emsg_silent)
+ {
+ smsg(_("shell returned %d"), x);
+ msg_putchar('\n');
+ }
+#ifdef FEAT_TITLE
+ resettitle();
+#endif
+
+ signal(SIGINT, SIG_DFL);
+ signal(SIGILL, SIG_DFL);
+ signal(SIGFPE, SIG_DFL);
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGABRT, SIG_DFL);
+
+
+ return x;
+}
+
+
+/*
+ * Delay for half a second.
+ */
+ void
+mch_delay(
+ long msec,
+ int ignoreinput)
+{
+#ifdef MUST_FIX
+ Sleep((int)msec); /* never wait for input */
+#endif
+}
+
+
+/*
+ * check for an "interrupt signal": CTRL-break or CTRL-C
+ */
+ void
+mch_breakcheck()
+{
+ /* never used */
+}
+
+
+/*
+ * How much memory is available?
+ */
+ long_u
+mch_avail_mem(
+ int special)
+{
+ return GetFreeSpace(0);
+}
+
+
+/*
+ * Like rename(), returns 0 upon success, non-zero upon failure.
+ * Should probably set errno appropriately when errors occur.
+ */
+ int
+mch_rename(
+ const char *pszOldFile,
+ const char *pszNewFile)
+{
+
+ /*
+ * No need to play tricks, this isn't rubbish like Windows 95 <g>
+ */
+ return rename(pszOldFile, pszNewFile);
+
+}
+
+/*
+ * Get the default shell for the current hardware platform
+ */
+ char*
+default_shell()
+{
+ char* psz = NULL;
+
+ psz = "command.com";
+
+ return psz;
+}
diff --git a/src/os_win16.h b/src/os_win16.h
new file mode 100644
index 000000000..93b5891f6
--- /dev/null
+++ b/src/os_win16.h
@@ -0,0 +1,142 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Win16 (Windows 3.1x) machine-dependent things.
+ */
+
+#include "os_dos.h" /* common MS-DOS and Windows stuff */
+
+#define BINARY_FILE_IO
+#define USE_EXE_NAME /* use argv[0] for $VIM */
+#define NO_COOKED_INPUT /* mch_inchar() doesn't return whole lines */
+#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
+#define USE_TERM_CONSOLE
+#define HAVE_STRING_H
+#define HAVE_STRCSPN
+#define HAVE_STRICMP
+#define HAVE_STRNICMP
+#define HAVE_STRFTIME /* guessed */
+#define HAVE_MEMSET
+#define USE_TMPNAM /* use tmpnam() instead of mktemp() */
+#define HAVE_LOCALE_H
+#define HAVE_FCNTL_H
+#define HAVE_QSORT
+#define HAVE_ST_MODE /* have stat.st_mode */
+//#define USE_FNAME_CASE /* adjust case of file names */
+#ifndef FEAT_CLIPBOARD
+# define FEAT_CLIPBOARD /* include clipboard support */
+#endif
+#if defined(__DATE__) && defined(__TIME__)
+# define HAVE_DATE_TIME
+#endif
+#define HAVE_AVAIL_MEM
+
+#define SHORT_FNAME /* always 8.3 file name */
+
+#define SMALL_MALLOC /* 16 bit storage allocation */
+
+#ifdef __BORLANDC__
+# define HAVE_PUTENV /* at least Bcc 5.2 has it */
+#endif
+
+#ifdef FEAT_GUI_W16
+# define NO_CONSOLE /* don't included console-only code */
+#endif
+
+/* toupper() is not really broken, but it's very slow. Probably because of
+ * using unicde characters on Windows NT */
+#define BROKEN_TOUPPER
+
+#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
+
+#ifndef SIZEOF_INT
+# define SIZEOF_INT 2
+#endif
+
+typedef long off_t;
+
+#include <stdlib.h>
+#include <time.h>
+#include <dos.h>
+#include <dir.h>
+
+#ifndef STRICT
+# define STRICT
+#endif
+#ifndef COBJMACROS
+# define COBJMACROS /* For OLE: Enable "friendlier" access to objects */
+#endif
+#include <windows.h>
+
+/*
+ * plenty of memory, use large buffers
+ */
+#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
+
+
+#define BASENAMELEN (MAXPATHL-5) /* length of base of file name */
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM (256) /* use up to 256K for a buffer*/
+#endif
+
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */
+#endif
+
+/*
+ * Some simple debugging macros that look and behave a lot like their
+ * namesakes in MFC.
+ */
+
+#ifdef _DEBUG
+
+# if defined(_MSC_VER) && (_MSC_VER >= 1000)
+ /* Use the new debugging tools in Visual C++ 4.x */
+# include <crtdbg.h>
+# define ASSERT(f) _ASSERT(f)
+# else
+# include <assert.h>
+# define ASSERT(f) assert(f)
+# endif
+
+# define VERIFY(f) ASSERT(f)
+# define DEBUG_ONLY(f) (f)
+# define TRACE Trace
+# define TRACE0(sz) Trace(_T("%s"), _T(sz))
+# define TRACE1(sz, p1) Trace(_T(sz), p1)
+# define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2)
+# define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3)
+
+/* In debug version, writes trace messages to debug stream */
+void __cdecl
+Trace(char *pszFormat, ...);
+
+#else /* !_DEBUG */
+
+ /* These macros should all compile away to nothing */
+# define ASSERT(f) ((void)0)
+# define VERIFY(f) ((void)f)
+# define DEBUG_ONLY(f) ((void)0)
+# define TRACE 1 ? (void)0 : printf
+# define TRACE0(sz)
+# define TRACE1(sz, p1)
+# define TRACE2(sz, p1, p2)
+# define TRACE3(sz, p1, p2, p3)
+
+#endif /* !_DEBUG */
+
+
+#define ASSERT_POINTER(p, type) \
+ ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE))
+
+#define ASSERT_NULL_OR_POINTER(p, type) \
+ ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE))
+
+#define mch_setenv(name, val, x) setenv(name, val, x)
diff --git a/src/os_win32.c b/src/os_win32.c
new file mode 100644
index 000000000..74b896032
--- /dev/null
+++ b/src/os_win32.c
@@ -0,0 +1,4790 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * os_win32.c
+ *
+ * Used for both the console version and the Win32 GUI. A lot of code is for
+ * the console version only, so there is a lot of "#ifndef FEAT_GUI_W32".
+ *
+ * Win32 (Windows NT and Windows 95) system-dependent routines.
+ * Portions lifted from the Win32 SDK samples, the MSDOS-dependent code,
+ * NetHack 3.1.3, GNU Emacs 19.30, and Vile 5.5.
+ *
+ * George V. Reilly <george@reilly.org> wrote most of this.
+ * Roger Knobbe <rogerk@wonderware.com> did the initial port of Vim 3.0.
+ */
+
+#include <io.h>
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#include <sys/types.h>
+#include <errno.h>
+#include <signal.h>
+#include <limits.h>
+#include <process.h>
+
+#undef chdir
+#ifdef __GNUC__
+# ifndef __MINGW32__
+# include <dirent.h>
+# endif
+#else
+# include <direct.h>
+#endif
+
+#if defined(FEAT_TITLE) && !defined(FEAT_GUI_W32)
+# include <shellapi.h>
+#endif
+
+#ifdef __MINGW32__
+# ifndef FROM_LEFT_1ST_BUTTON_PRESSED
+# define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
+# endif
+# ifndef RIGHTMOST_BUTTON_PRESSED
+# define RIGHTMOST_BUTTON_PRESSED 0x0002
+# endif
+# ifndef FROM_LEFT_2ND_BUTTON_PRESSED
+# define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
+# endif
+# ifndef FROM_LEFT_3RD_BUTTON_PRESSED
+# define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
+# endif
+# ifndef FROM_LEFT_4TH_BUTTON_PRESSED
+# define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
+# endif
+
+/*
+ * EventFlags
+ */
+# ifndef MOUSE_MOVED
+# define MOUSE_MOVED 0x0001
+# endif
+# ifndef DOUBLE_CLICK
+# define DOUBLE_CLICK 0x0002
+# endif
+#endif
+
+/* Record all output and all keyboard & mouse input */
+/* #define MCH_WRITE_DUMP */
+
+#ifdef MCH_WRITE_DUMP
+FILE* fdDump = NULL;
+#endif
+
+/*
+ * When generating prototypes for Win32 on Unix, these lines make the syntax
+ * errors disappear. They do not need to be correct.
+ */
+#ifdef PROTO
+#define WINAPI
+#define WINBASEAPI
+typedef char * LPCSTR;
+typedef int ACCESS_MASK;
+typedef int BOOL;
+typedef int COLORREF;
+typedef int CONSOLE_CURSOR_INFO;
+typedef int COORD;
+typedef int DWORD;
+typedef int HANDLE;
+typedef int HDC;
+typedef int HFONT;
+typedef int HICON;
+typedef int HINSTANCE;
+typedef int HWND;
+typedef int INPUT_RECORD;
+typedef int KEY_EVENT_RECORD;
+typedef int LOGFONT;
+typedef int LPBOOL;
+typedef int LPCTSTR;
+typedef int LPDWORD;
+typedef int LPSTR;
+typedef int LPTSTR;
+typedef int LPVOID;
+typedef int MOUSE_EVENT_RECORD;
+typedef int PACL;
+typedef int PDWORD;
+typedef int PHANDLE;
+typedef int PRINTDLG;
+typedef int PSECURITY_DESCRIPTOR;
+typedef int PSID;
+typedef int SECURITY_INFORMATION;
+typedef int SHORT;
+typedef int SMALL_RECT;
+typedef int TEXTMETRIC;
+typedef int TOKEN_INFORMATION_CLASS;
+typedef int TRUSTEE;
+typedef int WORD;
+typedef int WCHAR;
+typedef void VOID;
+#endif
+
+#ifndef FEAT_GUI_W32
+/* Undocumented API in kernel32.dll needed to work around dead key bug in
+ * console-mode applications in NT 4.0. If you switch keyboard layouts
+ * in a console app to a layout that includes dead keys and then hit a
+ * dead key, a call to ToAscii will trash the stack. My thanks to Ian James
+ * and Michael Dietrich for helping me figure out this workaround.
+ */
+
+/* WINBASEAPI BOOL WINAPI GetConsoleKeyboardLayoutNameA(LPSTR); */
+#ifndef WINBASEAPI
+# define WINBASEAPI __stdcall
+#endif
+#if defined(__BORLANDC__)
+typedef BOOL (__stdcall *PFNGCKLN)(LPSTR);
+#else
+typedef WINBASEAPI BOOL (WINAPI *PFNGCKLN)(LPSTR);
+#endif
+PFNGCKLN s_pfnGetConsoleKeyboardLayoutName = NULL;
+#endif
+
+#if defined(__BORLANDC__)
+/* Strangely Borland uses a non-standard name. */
+# define wcsicmp(a, b) wcscmpi((a), (b))
+#endif
+
+#ifndef FEAT_GUI_W32
+/* Win32 Console handles for input and output */
+static HANDLE g_hConIn = INVALID_HANDLE_VALUE;
+static HANDLE g_hConOut = INVALID_HANDLE_VALUE;
+
+/* Win32 Screen buffer,coordinate,console I/O information */
+static SMALL_RECT g_srScrollRegion;
+static COORD g_coord; /* 0-based, but external coords are 1-based */
+
+/* The attribute of the screen when the editor was started */
+static WORD g_attrDefault = 7; /* lightgray text on black background */
+static WORD g_attrCurrent;
+
+static int g_fCBrkPressed = FALSE; /* set by ctrl-break interrupt */
+static int g_fCtrlCPressed = FALSE; /* set when ctrl-C or ctrl-break detected */
+static int g_fForceExit = FALSE; /* set when forcefully exiting */
+
+static void termcap_mode_start(void);
+static void termcap_mode_end(void);
+static void clear_chars(COORD coord, DWORD n);
+static void clear_screen(void);
+static void clear_to_end_of_display(void);
+static void clear_to_end_of_line(void);
+static void scroll(unsigned cLines);
+static void set_scroll_region(unsigned left, unsigned top,
+ unsigned right, unsigned bottom);
+static void insert_lines(unsigned cLines);
+static void delete_lines(unsigned cLines);
+static void gotoxy(unsigned x, unsigned y);
+static void normvideo(void);
+static void textattr(WORD wAttr);
+static void textcolor(WORD wAttr);
+static void textbackground(WORD wAttr);
+static void standout(void);
+static void standend(void);
+static void visual_bell(void);
+static void cursor_visible(BOOL fVisible);
+static BOOL write_chars(LPCSTR pchBuf, DWORD cchToWrite);
+static char_u tgetch(int *pmodifiers, char_u *pch2);
+static void create_conin(void);
+static int s_cursor_visible = TRUE;
+static int did_create_conin = FALSE;
+#else
+static int s_dont_use_vimrun = TRUE;
+static int need_vimrun_warning = FALSE;
+static char *vimrun_path = "vimrun ";
+#endif
+
+#ifndef FEAT_GUI_W32
+static int suppress_winsize = 1; /* don't fiddle with console */
+#endif
+
+ static void
+get_exe_name(void)
+{
+ char temp[256];
+
+ if (exe_name == NULL)
+ {
+ /* store the name of the executable, may be used for $VIM */
+ GetModuleFileName(NULL, temp, 255);
+ if (*temp != NUL)
+ exe_name = FullName_save((char_u *)temp, FALSE);
+ }
+}
+
+#if defined(DYNAMIC_GETTEXT) || defined(PROTO)
+# ifndef GETTEXT_DLL
+# define GETTEXT_DLL "libintl.dll"
+# endif
+/* Dummy funcitons */
+static char* null_libintl_gettext(const char *);
+static char* null_libintl_textdomain(const char *);
+static char* null_libintl_bindtextdomain(const char *, const char *);
+
+static HINSTANCE hLibintlDLL = 0;
+char* (*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
+char* (*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
+char* (*dyn_libintl_bindtextdomain)(const char *, const char *)
+ = null_libintl_bindtextdomain;
+
+ int
+dyn_libintl_init(char *libname)
+{
+ int i;
+ static struct
+ {
+ char *name;
+ FARPROC *ptr;
+ } libintl_entry[] =
+ {
+ {"gettext", (FARPROC*)&dyn_libintl_gettext},
+ {"textdomain", (FARPROC*)&dyn_libintl_textdomain},
+ {"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
+ {NULL, NULL}
+ };
+
+ /* No need to initialize twice. */
+ if (hLibintlDLL)
+ return 1;
+ /* Load gettext library (libintl.dll) */
+ hLibintlDLL = LoadLibrary(libname != NULL ? libname : GETTEXT_DLL);
+ if (!hLibintlDLL)
+ {
+ char_u dirname[_MAX_PATH];
+
+ /* Try using the path from gvim.exe to find the .dll there. */
+ get_exe_name();
+ STRCPY(dirname, exe_name);
+ STRCPY(gettail(dirname), GETTEXT_DLL);
+ hLibintlDLL = LoadLibrary((char *)dirname);
+ if (!hLibintlDLL)
+ {
+ if (p_verbose > 0)
+ EMSG2(_(e_loadlib), GETTEXT_DLL);
+ return 0;
+ }
+ }
+ for (i = 0; libintl_entry[i].name != NULL
+ && libintl_entry[i].ptr != NULL; ++i)
+ {
+ if ((*libintl_entry[i].ptr = (FARPROC)GetProcAddress(hLibintlDLL,
+ libintl_entry[i].name)) == NULL)
+ {
+ dyn_libintl_end();
+ if (p_verbose > 0)
+ EMSG2(_(e_loadfunc), libintl_entry[i].name);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+ void
+dyn_libintl_end()
+{
+ if (hLibintlDLL)
+ FreeLibrary(hLibintlDLL);
+ hLibintlDLL = NULL;
+ dyn_libintl_gettext = null_libintl_gettext;
+ dyn_libintl_textdomain = null_libintl_textdomain;
+ dyn_libintl_bindtextdomain = null_libintl_bindtextdomain;
+}
+
+ static char *
+null_libintl_gettext(const char* msgid)
+{
+ return (char*)msgid;
+}
+
+ static char *
+null_libintl_bindtextdomain(const char* domainname, const char* dirname)
+{
+ return NULL;
+}
+
+ static char *
+null_libintl_textdomain(const char* domainname)
+{
+ return NULL;
+}
+
+#endif /* DYNAMIC_GETTEXT */
+
+/* This symbol is not defined in older versions of the SDK or Visual C++ */
+
+#ifndef VER_PLATFORM_WIN32_WINDOWS
+# define VER_PLATFORM_WIN32_WINDOWS 1
+#endif
+
+DWORD g_PlatformId;
+
+#ifdef HAVE_ACL
+# include <aclapi.h>
+/*
+ * These are needed to dynamically load the ADVAPI DLL, which is not
+ * implemented under Windows 95 (and causes VIM to crash)
+ */
+typedef DWORD (WINAPI *PSNSECINFO) (LPTSTR, enum SE_OBJECT_TYPE,
+ SECURITY_INFORMATION, PSID, PSID, PACL, PACL);
+typedef DWORD (WINAPI *PGNSECINFO) (LPSTR, enum SE_OBJECT_TYPE,
+ SECURITY_INFORMATION, PSID *, PSID *, PACL *, PACL *,
+ PSECURITY_DESCRIPTOR *);
+
+static HANDLE advapi_lib = NULL; /* Handle for ADVAPI library */
+static PSNSECINFO pSetNamedSecurityInfo;
+static PGNSECINFO pGetNamedSecurityInfo;
+#endif
+
+/*
+ * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
+ * VER_PLATFORM_WIN32_WINDOWS (Win95).
+ */
+ void
+PlatformId(void)
+{
+ static int done = FALSE;
+
+ if (!done)
+ {
+ OSVERSIONINFO ovi;
+
+ ovi.dwOSVersionInfoSize = sizeof(ovi);
+ GetVersionEx(&ovi);
+
+ g_PlatformId = ovi.dwPlatformId;
+
+#ifdef HAVE_ACL
+ /*
+ * Load the ADVAPI runtime if we are on anything
+ * other than Windows 95
+ */
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ /*
+ * do this load. Problems: Doesn't unload at end of run (this is
+ * theoretically okay, since Windows should unload it when VIM
+ * terminates). Should we be using the 'mch_libcall' routines?
+ * Seems like a lot of overhead to load/unload ADVAPI32.DLL each
+ * time we verify security...
+ */
+ advapi_lib = LoadLibrary("ADVAPI32.DLL");
+ if (advapi_lib != NULL)
+ {
+ pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib,
+ "SetNamedSecurityInfoA");
+ pGetNamedSecurityInfo = (PGNSECINFO)GetProcAddress(advapi_lib,
+ "GetNamedSecurityInfoA");
+ if (pSetNamedSecurityInfo == NULL
+ || pGetNamedSecurityInfo == NULL)
+ {
+ /* If we can't get the function addresses, set advapi_lib
+ * to NULL so that we don't use them. */
+ FreeLibrary(advapi_lib);
+ advapi_lib = NULL;
+ }
+ }
+ }
+#endif
+ done = TRUE;
+ }
+}
+
+/*
+ * Return TRUE when running on Windows 95 (or 98 or ME).
+ * Only to be used after mch_init().
+ */
+ int
+mch_windows95(void)
+{
+ return g_PlatformId == VER_PLATFORM_WIN32_WINDOWS;
+}
+
+#ifdef FEAT_GUI_W32
+/*
+ * Used to work around the "can't do synchronous spawn"
+ * problem on Win32s, without resorting to Universal Thunk.
+ */
+static int old_num_windows;
+static int num_windows;
+
+ static BOOL CALLBACK
+win32ssynch_cb(HWND hwnd, LPARAM lparam)
+{
+ num_windows++;
+ return TRUE;
+}
+#endif
+
+#ifndef FEAT_GUI_W32
+
+#define SHIFT (SHIFT_PRESSED)
+#define CTRL (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)
+#define ALT (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)
+#define ALT_GR (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED)
+
+
+/* When uChar.AsciiChar is 0, then we need to look at wVirtualKeyCode.
+ * We map function keys to their ANSI terminal equivalents, as produced
+ * by ANSI.SYS, for compatibility with the MS-DOS version of Vim. Any
+ * ANSI key with a value >= '\300' is nonstandard, but provided anyway
+ * so that the user can have access to all SHIFT-, CTRL-, and ALT-
+ * combinations of function/arrow/etc keys.
+ */
+
+const static struct
+{
+ WORD wVirtKey;
+ BOOL fAnsiKey;
+ int chAlone;
+ int chShift;
+ int chCtrl;
+ int chAlt;
+} VirtKeyMap[] =
+{
+
+/* Key ANSI alone shift ctrl alt */
+ { VK_ESCAPE,FALSE, ESC, ESC, ESC, ESC, },
+
+ { VK_F1, TRUE, ';', 'T', '^', 'h', },
+ { VK_F2, TRUE, '<', 'U', '_', 'i', },
+ { VK_F3, TRUE, '=', 'V', '`', 'j', },
+ { VK_F4, TRUE, '>', 'W', 'a', 'k', },
+ { VK_F5, TRUE, '?', 'X', 'b', 'l', },
+ { VK_F6, TRUE, '@', 'Y', 'c', 'm', },
+ { VK_F7, TRUE, 'A', 'Z', 'd', 'n', },
+ { VK_F8, TRUE, 'B', '[', 'e', 'o', },
+ { VK_F9, TRUE, 'C', '\\', 'f', 'p', },
+ { VK_F10, TRUE, 'D', ']', 'g', 'q', },
+ { VK_F11, TRUE, '\205', '\207', '\211', '\213', },
+ { VK_F12, TRUE, '\206', '\210', '\212', '\214', },
+
+ { VK_HOME, TRUE, 'G', '\302', 'w', '\303', },
+ { VK_UP, TRUE, 'H', '\304', '\305', '\306', },
+ { VK_PRIOR, TRUE, 'I', '\307', '\204', '\310', }, /*PgUp*/
+ { VK_LEFT, TRUE, 'K', '\311', 's', '\312', },
+ { VK_RIGHT, TRUE, 'M', '\313', 't', '\314', },
+ { VK_END, TRUE, 'O', '\315', 'u', '\316', },
+ { VK_DOWN, TRUE, 'P', '\317', '\320', '\321', },
+ { VK_NEXT, TRUE, 'Q', '\322', 'v', '\323', }, /*PgDn*/
+ { VK_INSERT,TRUE, 'R', '\324', '\325', '\326', },
+ { VK_DELETE,TRUE, 'S', '\327', '\330', '\331', },
+
+ { VK_SNAPSHOT,TRUE, 0, 0, 0, 'r', }, /*PrtScrn*/
+
+#if 0
+ /* Most people don't have F13-F20, but what the hell... */
+ { VK_F13, TRUE, '\332', '\333', '\334', '\335', },
+ { VK_F14, TRUE, '\336', '\337', '\340', '\341', },
+ { VK_F15, TRUE, '\342', '\343', '\344', '\345', },
+ { VK_F16, TRUE, '\346', '\347', '\350', '\351', },
+ { VK_F17, TRUE, '\352', '\353', '\354', '\355', },
+ { VK_F18, TRUE, '\356', '\357', '\360', '\361', },
+ { VK_F19, TRUE, '\362', '\363', '\364', '\365', },
+ { VK_F20, TRUE, '\366', '\367', '\370', '\371', },
+#endif
+ { VK_ADD, TRUE, 'N', 'N', 'N', 'N', }, /* keyp '+' */
+ { VK_SUBTRACT, TRUE,'J', 'J', 'J', 'J', }, /* keyp '-' */
+ /* { VK_DIVIDE, TRUE,'N', 'N', 'N', 'N', }, keyp '/' */
+ { VK_MULTIPLY, TRUE,'7', '7', '7', '7', }, /* keyp '*' */
+
+ { VK_NUMPAD0,TRUE, '\332', '\333', '\334', '\335', },
+ { VK_NUMPAD1,TRUE, '\336', '\337', '\340', '\341', },
+ { VK_NUMPAD2,TRUE, '\342', '\343', '\344', '\345', },
+ { VK_NUMPAD3,TRUE, '\346', '\347', '\350', '\351', },
+ { VK_NUMPAD4,TRUE, '\352', '\353', '\354', '\355', },
+ { VK_NUMPAD5,TRUE, '\356', '\357', '\360', '\361', },
+ { VK_NUMPAD6,TRUE, '\362', '\363', '\364', '\365', },
+ { VK_NUMPAD7,TRUE, '\366', '\367', '\370', '\371', },
+ { VK_NUMPAD8,TRUE, '\372', '\373', '\374', '\375', },
+ /* Sorry, out of number space! <negri>*/
+ { VK_NUMPAD9,TRUE, '\376', '\377', '\377', '\367', },
+
+};
+
+
+#ifdef _MSC_VER
+// The ToAscii bug destroys several registers. Need to turn off optimization
+// or the GetConsoleKeyboardLayoutName hack will fail in non-debug versions
+# pragma optimize("", off)
+#endif
+
+#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__)
+# define AChar AsciiChar
+#else
+# define AChar uChar.AsciiChar
+#endif
+
+/* The return code indicates key code size. */
+ static int
+#ifdef __BORLANDC__
+ __stdcall
+#endif
+win32_kbd_patch_key(
+ KEY_EVENT_RECORD* pker)
+{
+ UINT uMods = pker->dwControlKeyState;
+ static int s_iIsDead = 0;
+ static WORD awAnsiCode[2];
+ static BYTE abKeystate[256];
+
+
+ if (s_iIsDead == 2)
+ {
+ pker->AChar = (CHAR) awAnsiCode[1];
+ s_iIsDead = 0;
+ return 1;
+ }
+
+ if (pker->AChar != 0)
+ return 1;
+
+ memset(abKeystate, 0, sizeof (abKeystate));
+
+ // Should only be non-NULL on NT 4.0
+ if (s_pfnGetConsoleKeyboardLayoutName != NULL)
+ {
+ CHAR szKLID[KL_NAMELENGTH];
+
+ if ((*s_pfnGetConsoleKeyboardLayoutName)(szKLID))
+ (void)LoadKeyboardLayout(szKLID, KLF_ACTIVATE);
+ }
+
+ /* Clear any pending dead keys */
+ ToAscii(VK_SPACE, MapVirtualKey(VK_SPACE, 0), abKeystate, awAnsiCode, 0);
+
+ if (uMods & SHIFT_PRESSED)
+ abKeystate[VK_SHIFT] = 0x80;
+ if (uMods & CAPSLOCK_ON)
+ abKeystate[VK_CAPITAL] = 1;
+
+ if ((uMods & ALT_GR) == ALT_GR)
+ {
+ abKeystate[VK_CONTROL] = abKeystate[VK_LCONTROL] =
+ abKeystate[VK_MENU] = abKeystate[VK_RMENU] = 0x80;
+ }
+
+ s_iIsDead = ToAscii(pker->wVirtualKeyCode, pker->wVirtualScanCode,
+ abKeystate, awAnsiCode, 0);
+
+ if (s_iIsDead > 0)
+ pker->AChar = (CHAR) awAnsiCode[0];
+
+ return s_iIsDead;
+}
+
+#ifdef _MSC_VER
+/* MUST switch optimization on again here, otherwise a call to
+ * decode_key_event() may crash (e.g. when hitting caps-lock) */
+# pragma optimize("", on)
+
+# if (_MSC_VER < 1100)
+/* MUST turn off global optimisation for this next function, or
+ * pressing ctrl-minus in insert mode crashes Vim when built with
+ * VC4.1. -- negri. */
+# pragma optimize("g", off)
+# endif
+#endif
+
+static BOOL g_fJustGotFocus = FALSE;
+
+/*
+ * Decode a KEY_EVENT into one or two keystrokes
+ */
+ static BOOL
+decode_key_event(
+ KEY_EVENT_RECORD *pker,
+ char_u *pch,
+ char_u *pch2,
+ int *pmodifiers,
+ BOOL fDoPost)
+{
+ int i;
+ const int nModifs = pker->dwControlKeyState & (SHIFT | ALT | CTRL);
+
+ *pch = *pch2 = NUL;
+ g_fJustGotFocus = FALSE;
+
+ /* ignore key up events */
+ if (!pker->bKeyDown)
+ return FALSE;
+
+ /* ignore some keystrokes */
+ switch (pker->wVirtualKeyCode)
+ {
+ /* modifiers */
+ case VK_SHIFT:
+ case VK_CONTROL:
+ case VK_MENU: /* Alt key */
+ return FALSE;
+
+ default:
+ break;
+ }
+
+ /* special cases */
+ if ((nModifs & CTRL) != 0 && (nModifs & ~CTRL) == 0 && pker->AChar == NUL)
+ {
+ /* Ctrl-6 is Ctrl-^ */
+ if (pker->wVirtualKeyCode == '6')
+ {
+ *pch = Ctrl_HAT;
+ return TRUE;
+ }
+ /* Ctrl-2 is Ctrl-@ */
+ else if (pker->wVirtualKeyCode == '2')
+ {
+ *pch = NUL;
+ return TRUE;
+ }
+ /* Ctrl-- is Ctrl-_ */
+ else if (pker->wVirtualKeyCode == 0xBD)
+ {
+ *pch = Ctrl__;
+ return TRUE;
+ }
+ }
+
+ /* Shift-TAB */
+ if (pker->wVirtualKeyCode == VK_TAB && (nModifs & SHIFT_PRESSED))
+ {
+ *pch = K_NUL;
+ *pch2 = '\017';
+ return TRUE;
+ }
+
+ for (i = sizeof(VirtKeyMap) / sizeof(VirtKeyMap[0]); --i >= 0; )
+ {
+ if (VirtKeyMap[i].wVirtKey == pker->wVirtualKeyCode)
+ {
+ if (nModifs == 0)
+ *pch = VirtKeyMap[i].chAlone;
+ else if ((nModifs & SHIFT) != 0 && (nModifs & ~SHIFT) == 0)
+ *pch = VirtKeyMap[i].chShift;
+ else if ((nModifs & CTRL) != 0 && (nModifs & ~CTRL) == 0)
+ *pch = VirtKeyMap[i].chCtrl;
+ else if ((nModifs & ALT) != 0 && (nModifs & ~ALT) == 0)
+ *pch = VirtKeyMap[i].chAlt;
+
+ if (*pch != 0)
+ {
+ if (VirtKeyMap[i].fAnsiKey)
+ {
+ *pch2 = *pch;
+ *pch = K_NUL;
+ }
+
+ return TRUE;
+ }
+ }
+ }
+
+ i = win32_kbd_patch_key(pker);
+
+ if (i < 0)
+ *pch = NUL;
+ else
+ {
+ *pch = (i > 0) ? pker->AChar : NUL;
+
+ if (pmodifiers != NULL)
+ {
+ /* Pass on the ALT key as a modifier, but only when not combined
+ * with CTRL (which is ALTGR). */
+ if ((nModifs & ALT) != 0 && (nModifs & CTRL) == 0)
+ *pmodifiers |= MOD_MASK_ALT;
+
+ /* Pass on SHIFT only for special keys, because we don't know when
+ * it's already included with the character. */
+ if ((nModifs & SHIFT) != 0 && *pch <= 0x20)
+ *pmodifiers |= MOD_MASK_SHIFT;
+
+ /* Pass on CTRL only for non-special keys, because we don't know
+ * when it's already included with the character. And not when
+ * combined with ALT (which is ALTGR). */
+ if ((nModifs & CTRL) != 0 && (nModifs & ALT) == 0
+ && *pch >= 0x20 && *pch < 0x80)
+ *pmodifiers |= MOD_MASK_CTRL;
+ }
+ }
+
+ return (*pch != NUL);
+}
+
+#ifdef _MSC_VER
+# pragma optimize("", on)
+#endif
+
+#endif /* FEAT_GUI_W32 */
+
+
+#ifdef FEAT_MOUSE
+
+/*
+ * For the GUI the mouse handling is in gui_w32.c.
+ */
+# ifdef FEAT_GUI_W32
+ void
+mch_setmouse(
+ int on)
+{
+}
+# else
+static int g_fMouseAvail = FALSE; /* mouse present */
+static int g_fMouseActive = FALSE; /* mouse enabled */
+static int g_nMouseClick = -1; /* mouse status */
+static int g_xMouse; /* mouse x coordinate */
+static int g_yMouse; /* mouse y coordinate */
+
+/*
+ * Enable or disable mouse input
+ */
+ void
+mch_setmouse(
+ int on)
+{
+ DWORD cmodein;
+
+ if (!g_fMouseAvail)
+ return;
+
+ g_fMouseActive = on;
+ GetConsoleMode(g_hConIn, &cmodein);
+
+ if (g_fMouseActive)
+ cmodein |= ENABLE_MOUSE_INPUT;
+ else
+ cmodein &= ~ENABLE_MOUSE_INPUT;
+
+ SetConsoleMode(g_hConIn, cmodein);
+}
+
+
+/*
+ * Decode a MOUSE_EVENT. If it's a valid event, return MOUSE_LEFT,
+ * MOUSE_MIDDLE, or MOUSE_RIGHT for a click; MOUSE_DRAG for a mouse
+ * move with a button held down; and MOUSE_RELEASE after a MOUSE_DRAG
+ * or a MOUSE_LEFT, _MIDDLE, or _RIGHT. We encode the button type,
+ * the number of clicks, and the Shift/Ctrl/Alt modifiers in g_nMouseClick,
+ * and we return the mouse position in g_xMouse and g_yMouse.
+ *
+ * Every MOUSE_LEFT, _MIDDLE, or _RIGHT will be followed by zero or more
+ * MOUSE_DRAGs and one MOUSE_RELEASE. MOUSE_RELEASE will be followed only
+ * by MOUSE_LEFT, _MIDDLE, or _RIGHT.
+ *
+ * For multiple clicks, we send, say, MOUSE_LEFT/1 click, MOUSE_RELEASE,
+ * MOUSE_LEFT/2 clicks, MOUSE_RELEASE, MOUSE_LEFT/3 clicks, MOUSE_RELEASE, ....
+ *
+ * Windows will send us MOUSE_MOVED notifications whenever the mouse
+ * moves, even if it stays within the same character cell. We ignore
+ * all MOUSE_MOVED messages if the position hasn't really changed, and
+ * we ignore all MOUSE_MOVED messages where no button is held down (i.e.,
+ * we're only interested in MOUSE_DRAG).
+ *
+ * All of this is complicated by the code that fakes MOUSE_MIDDLE on
+ * 2-button mouses by pressing the left & right buttons simultaneously.
+ * In practice, it's almost impossible to click both at the same time,
+ * so we need to delay a little. Also, we tend not to get MOUSE_RELEASE
+ * in such cases, if the user is clicking quickly.
+ */
+ static BOOL
+decode_mouse_event(
+ MOUSE_EVENT_RECORD* pmer)
+{
+ static int s_nOldButton = -1;
+ static int s_nOldMouseClick = -1;
+ static int s_xOldMouse = -1;
+ static int s_yOldMouse = -1;
+ static linenr_T s_old_topline = 0;
+#ifdef FEAT_DIFF
+ static int s_old_topfill = 0;
+#endif
+ static int s_cClicks = 1;
+ static BOOL s_fReleased = TRUE;
+ static DWORD s_dwLastClickTime = 0;
+ static BOOL s_fNextIsMiddle = FALSE;
+
+ static DWORD cButtons = 0; /* number of buttons supported */
+
+ const DWORD LEFT = FROM_LEFT_1ST_BUTTON_PRESSED;
+ const DWORD MIDDLE = FROM_LEFT_2ND_BUTTON_PRESSED;
+ const DWORD RIGHT = RIGHTMOST_BUTTON_PRESSED;
+ const DWORD LEFT_RIGHT = LEFT | RIGHT;
+
+ int nButton;
+
+ if (cButtons == 0 && !GetNumberOfConsoleMouseButtons(&cButtons))
+ cButtons = 2;
+
+ if (!g_fMouseAvail || !g_fMouseActive)
+ {
+ g_nMouseClick = -1;
+ return FALSE;
+ }
+
+ /* get a spurious MOUSE_EVENT immediately after receiving focus; ignore */
+ if (g_fJustGotFocus)
+ {
+ g_fJustGotFocus = FALSE;
+ return FALSE;
+ }
+
+ /* unprocessed mouse click? */
+ if (g_nMouseClick != -1)
+ return TRUE;
+
+ nButton = -1;
+ g_xMouse = pmer->dwMousePosition.X;
+ g_yMouse = pmer->dwMousePosition.Y;
+
+ if (pmer->dwEventFlags == MOUSE_MOVED)
+ {
+ /* ignore MOUSE_MOVED events if (x, y) hasn't changed. (We get these
+ * events even when the mouse moves only within a char cell.) */
+ if (s_xOldMouse == g_xMouse && s_yOldMouse == g_yMouse)
+ return FALSE;
+ }
+
+ /* If no buttons are pressed... */
+ if ((pmer->dwButtonState & ((1 << cButtons) - 1)) == 0)
+ {
+ /* If the last thing returned was MOUSE_RELEASE, ignore this */
+ if (s_fReleased)
+ return FALSE;
+
+ nButton = MOUSE_RELEASE;
+ s_fReleased = TRUE;
+ }
+ else /* one or more buttons pressed */
+ {
+ /* on a 2-button mouse, hold down left and right buttons
+ * simultaneously to get MIDDLE. */
+
+ if (cButtons == 2 && s_nOldButton != MOUSE_DRAG)
+ {
+ DWORD dwLR = (pmer->dwButtonState & LEFT_RIGHT);
+
+ /* if either left or right button only is pressed, see if the
+ * the next mouse event has both of them pressed */
+ if (dwLR == LEFT || dwLR == RIGHT)
+ {
+ for (;;)
+ {
+ /* wait a short time for next input event */
+ if (WaitForSingleObject(g_hConIn, p_mouset / 3)
+ != WAIT_OBJECT_0)
+ break;
+ else
+ {
+ DWORD cRecords = 0;
+ INPUT_RECORD ir;
+ MOUSE_EVENT_RECORD* pmer2 = &ir.Event.MouseEvent;
+
+ PeekConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+ if (cRecords == 0 || ir.EventType != MOUSE_EVENT
+ || !(pmer2->dwButtonState & LEFT_RIGHT))
+ break;
+ else
+ {
+ if (pmer2->dwEventFlags != MOUSE_MOVED)
+ {
+ ReadConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+ return decode_mouse_event(pmer2);
+ }
+ else if (s_xOldMouse == pmer2->dwMousePosition.X &&
+ s_yOldMouse == pmer2->dwMousePosition.Y)
+ {
+ /* throw away spurious mouse move */
+ ReadConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+ /* are there any more mouse events in queue? */
+ PeekConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+ if (cRecords==0 || ir.EventType != MOUSE_EVENT)
+ break;
+ }
+ else
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (s_fNextIsMiddle)
+ {
+ nButton = (pmer->dwEventFlags == MOUSE_MOVED)
+ ? MOUSE_DRAG : MOUSE_MIDDLE;
+ s_fNextIsMiddle = FALSE;
+ }
+ else if (cButtons == 2 &&
+ ((pmer->dwButtonState & LEFT_RIGHT) == LEFT_RIGHT))
+ {
+ nButton = MOUSE_MIDDLE;
+
+ if (! s_fReleased && pmer->dwEventFlags != MOUSE_MOVED)
+ {
+ s_fNextIsMiddle = TRUE;
+ nButton = MOUSE_RELEASE;
+ }
+ }
+ else if ((pmer->dwButtonState & LEFT) == LEFT)
+ nButton = MOUSE_LEFT;
+ else if ((pmer->dwButtonState & MIDDLE) == MIDDLE)
+ nButton = MOUSE_MIDDLE;
+ else if ((pmer->dwButtonState & RIGHT) == RIGHT)
+ nButton = MOUSE_RIGHT;
+
+ if (! s_fReleased && ! s_fNextIsMiddle
+ && nButton != s_nOldButton && s_nOldButton != MOUSE_DRAG)
+ return FALSE;
+
+ s_fReleased = s_fNextIsMiddle;
+ }
+
+ if (pmer->dwEventFlags == 0 || pmer->dwEventFlags == DOUBLE_CLICK)
+ {
+ /* button pressed or released, without mouse moving */
+ if (nButton != -1 && nButton != MOUSE_RELEASE)
+ {
+ DWORD dwCurrentTime = GetTickCount();
+
+ if (s_xOldMouse != g_xMouse
+ || s_yOldMouse != g_yMouse
+ || s_nOldButton != nButton
+ || s_old_topline != curwin->w_topline
+#ifdef FEAT_DIFF
+ || s_old_topfill != curwin->w_topfill
+#endif
+ || (int)(dwCurrentTime - s_dwLastClickTime) > p_mouset)
+ {
+ s_cClicks = 1;
+ }
+ else if (++s_cClicks > 4)
+ {
+ s_cClicks = 1;
+ }
+
+ s_dwLastClickTime = dwCurrentTime;
+ }
+ }
+ else if (pmer->dwEventFlags == MOUSE_MOVED)
+ {
+ if (nButton != -1 && nButton != MOUSE_RELEASE)
+ nButton = MOUSE_DRAG;
+
+ s_cClicks = 1;
+ }
+
+ if (nButton == -1)
+ return FALSE;
+
+ if (nButton != MOUSE_RELEASE)
+ s_nOldButton = nButton;
+
+ g_nMouseClick = nButton;
+
+ if (pmer->dwControlKeyState & SHIFT_PRESSED)
+ g_nMouseClick |= MOUSE_SHIFT;
+ if (pmer->dwControlKeyState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
+ g_nMouseClick |= MOUSE_CTRL;
+ if (pmer->dwControlKeyState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED))
+ g_nMouseClick |= MOUSE_ALT;
+
+ if (nButton != MOUSE_DRAG && nButton != MOUSE_RELEASE)
+ SET_NUM_MOUSE_CLICKS(g_nMouseClick, s_cClicks);
+
+ /* only pass on interesting (i.e., different) mouse events */
+ if (s_xOldMouse == g_xMouse
+ && s_yOldMouse == g_yMouse
+ && s_nOldMouseClick == g_nMouseClick)
+ {
+ g_nMouseClick = -1;
+ return FALSE;
+ }
+
+ s_xOldMouse = g_xMouse;
+ s_yOldMouse = g_yMouse;
+ s_old_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ s_old_topfill = curwin->w_topfill;
+#endif
+ s_nOldMouseClick = g_nMouseClick;
+
+ return TRUE;
+}
+
+# endif /* FEAT_GUI_W32 */
+#endif /* FEAT_MOUSE */
+
+
+#ifdef MCH_CURSOR_SHAPE
+/*
+ * Set the shape of the cursor.
+ * 'thickness' can be from 1 (thin) to 99 (block)
+ */
+ static void
+mch_set_cursor_shape(int thickness)
+{
+ CONSOLE_CURSOR_INFO ConsoleCursorInfo;
+ ConsoleCursorInfo.dwSize = thickness;
+ ConsoleCursorInfo.bVisible = s_cursor_visible;
+
+ SetConsoleCursorInfo(g_hConOut, &ConsoleCursorInfo);
+ if (s_cursor_visible)
+ SetConsoleCursorPosition(g_hConOut, g_coord);
+}
+
+ void
+mch_update_cursor(void)
+{
+ int idx;
+ int thickness;
+
+ /*
+ * How the cursor is drawn depends on the current mode.
+ */
+ idx = get_shape_idx(FALSE);
+
+ if (shape_table[idx].shape == SHAPE_BLOCK)
+ thickness = 99; /* 100 doesn't work on W95 */
+ else
+ thickness = shape_table[idx].percentage;
+ mch_set_cursor_shape(thickness);
+}
+#endif
+
+#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+/*
+ * Handle FOCUS_EVENT.
+ */
+ static void
+handle_focus_event(INPUT_RECORD ir)
+{
+ g_fJustGotFocus = ir.Event.FocusEvent.bSetFocus;
+ ui_focus_change((int)g_fJustGotFocus);
+}
+
+/*
+ * Wait until console input from keyboard or mouse is available,
+ * or the time is up.
+ * Return TRUE if something is available FALSE if not.
+ */
+ static int
+WaitForChar(long msec)
+{
+ DWORD dwNow = 0, dwEndTime = 0;
+ INPUT_RECORD ir;
+ DWORD cRecords;
+ char_u ch, ch2;
+
+ if (msec > 0)
+ /* Wait until the specified time has elapsed. */
+ dwEndTime = GetTickCount() + msec;
+ else if (msec < 0)
+ /* Wait forever. */
+ dwEndTime = INFINITE;
+
+ /* We need to loop until the end of the time period, because
+ * we might get multiple unusable mouse events in that time.
+ */
+ for (;;)
+ {
+#ifdef FEAT_CLIENTSERVER
+ serverProcessPendingMessages();
+#endif
+ if (0
+#ifdef FEAT_MOUSE
+ || g_nMouseClick != -1
+#endif
+#ifdef FEAT_CLIENTSERVER
+ || input_available()
+#endif
+ )
+ return TRUE;
+
+ if (msec > 0)
+ {
+ /* If the specified wait time has passed, return. */
+ dwNow = GetTickCount();
+ if (dwNow >= dwEndTime)
+ break;
+ }
+ if (msec != 0)
+ {
+#ifdef FEAT_CLIENTSERVER
+ /* Wait for either an event on the console input or a message in
+ * the client-server window. */
+ if (MsgWaitForMultipleObjects(1, &g_hConIn, FALSE,
+ dwEndTime - dwNow, QS_SENDMESSAGE) != WAIT_OBJECT_0)
+#else
+ if (WaitForSingleObject(g_hConIn, dwEndTime - dwNow)
+ != WAIT_OBJECT_0)
+#endif
+ continue;
+ }
+
+ cRecords = 0;
+ PeekConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+#ifdef FEAT_MBYTE_IME
+ if (State & CMDLINE && msg_row == Rows - 1)
+ {
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+ if (GetConsoleScreenBufferInfo(g_hConOut, &csbi))
+ {
+ if (csbi.dwCursorPosition.Y != msg_row)
+ {
+ /* The screen is now messed up, must redraw the
+ * command line and later all the windows. */
+ redraw_all_later(CLEAR);
+ cmdline_row -= (msg_row - csbi.dwCursorPosition.Y);
+ redrawcmd();
+ }
+ }
+ }
+#endif
+
+ if (cRecords > 0)
+ {
+ if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown)
+ {
+#ifdef FEAT_MBYTE_IME
+ /* Windows IME sends two '\n's with only one 'ENTER'. First:
+ * wVirtualKeyCode == 13. second: wVirtualKeyCode == 0 */
+ if (ir.Event.KeyEvent.uChar.UnicodeChar == 0
+ && ir.Event.KeyEvent.wVirtualKeyCode == 13)
+ {
+ ReadConsoleInput(g_hConIn, &ir, 1, &cRecords);
+ continue;
+ }
+#endif
+ if (decode_key_event(&ir.Event.KeyEvent, &ch, &ch2,
+ NULL, FALSE))
+ return TRUE;
+ }
+
+ ReadConsoleInput(g_hConIn, &ir, 1, &cRecords);
+
+ if (ir.EventType == FOCUS_EVENT)
+ handle_focus_event(ir);
+ else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT)
+ shell_resized();
+#ifdef FEAT_MOUSE
+ else if (ir.EventType == MOUSE_EVENT
+ && decode_mouse_event(&ir.Event.MouseEvent))
+ return TRUE;
+#endif
+ }
+ else if (msec == 0)
+ break;
+ }
+
+#ifdef FEAT_CLIENTSERVER
+ /* Something might have been received while we were waiting. */
+ if (input_available())
+ return TRUE;
+#endif
+ return FALSE;
+}
+
+#ifndef FEAT_GUI_MSWIN
+/*
+ * return non-zero if a character is available
+ */
+ int
+mch_char_avail()
+{
+ return WaitForChar(0L);
+}
+#endif
+
+/*
+ * Create the console input. Used when reading stdin doesn't work.
+ */
+ static void
+create_conin(void)
+{
+ g_hConIn = CreateFile("CONIN$", GENERIC_READ|GENERIC_WRITE,
+ FILE_SHARE_READ|FILE_SHARE_WRITE,
+ (LPSECURITY_ATTRIBUTES) NULL,
+ OPEN_EXISTING, (DWORD)NULL, (HANDLE)NULL);
+ did_create_conin = TRUE;
+}
+
+/*
+ * Get a keystroke or a mouse event
+ */
+ static char_u
+tgetch(int *pmodifiers, char_u *pch2)
+{
+ char_u ch;
+
+ for (;;)
+ {
+ INPUT_RECORD ir;
+ DWORD cRecords = 0;
+
+#ifdef FEAT_CLIENTSERVER
+ (void)WaitForChar(-1L);
+ if (input_available())
+ return 0;
+# ifdef FEAT_MOUSE
+ if (g_nMouseClick != -1)
+ return 0;
+# endif
+#endif
+ if (ReadConsoleInput(g_hConIn, &ir, 1, &cRecords) == 0)
+ {
+ if (did_create_conin)
+ read_error_exit();
+ create_conin();
+ continue;
+ }
+
+ if (ir.EventType == KEY_EVENT)
+ {
+ if (decode_key_event(&ir.Event.KeyEvent, &ch, pch2,
+ pmodifiers, TRUE))
+ return ch;
+ }
+ else if (ir.EventType == FOCUS_EVENT)
+ handle_focus_event(ir);
+ else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT)
+ shell_resized();
+#ifdef FEAT_MOUSE
+ else if (ir.EventType == MOUSE_EVENT)
+ {
+ if (decode_mouse_event(&ir.Event.MouseEvent))
+ return 0;
+ }
+#endif
+ }
+}
+#endif /* !FEAT_GUI_W32 */
+
+
+/*
+ * mch_inchar(): low-level input funcion.
+ * Get one or more characters from the keyboard or the mouse.
+ * If time == 0, do not wait for characters.
+ * If time == n, wait a short time for characters.
+ * If time == -1, wait forever for characters.
+ * Returns the number of characters read into buf.
+ */
+ int
+mch_inchar(
+ char_u *buf,
+ int maxlen,
+ long time,
+ int tb_change_cnt)
+{
+#ifndef FEAT_GUI_W32 /* this isn't used for the GUI */
+
+ int len;
+ int c;
+#ifdef FEAT_AUTOCMD
+ static int once_already = 0;
+#endif
+#define TYPEAHEADLEN 20
+ static char_u typeahead[TYPEAHEADLEN]; /* previously typed bytes. */
+ static int typeaheadlen = 0;
+
+ /* First use any typeahead that was kept because "buf" was too small. */
+ if (typeaheadlen > 0)
+ goto theend;
+
+#ifdef FEAT_SNIFF
+ if (want_sniff_request)
+ {
+ if (sniff_request_waiting)
+ {
+ /* return K_SNIFF */
+ typeahead[typeaheadlen++] = CSI;
+ typeahead[typeaheadlen++] = (char_u)KS_EXTRA;
+ typeahead[typeaheadlen++] = (char_u)KE_SNIFF;
+ sniff_request_waiting = 0;
+ want_sniff_request = 0;
+ goto theend;
+ }
+ else if (time < 0 || time > 250)
+ {
+ /* don't wait too long, a request might be pending */
+ time = 250;
+ }
+ }
+#endif
+
+ if (time >= 0)
+ {
+ if (!WaitForChar(time)) /* no character available */
+ {
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+ return 0;
+ }
+ }
+ else /* time == -1, wait forever */
+ {
+ mch_set_winsize_now(); /* Allow winsize changes from now on */
+
+#ifdef FEAT_AUTOCMD
+ /* If there is no character available within 2 seconds (default),
+ * write the autoscript file to disk */
+ if (once_already == 2)
+ updatescript(0);
+ else if (once_already == 1)
+ {
+ setcursor();
+ once_already = 2;
+ return 0;
+ }
+ else
+#endif
+ if (!WaitForChar(p_ut))
+ {
+#ifdef FEAT_AUTOCMD
+ if (has_cursorhold() && get_real_state() == NORMAL_BUSY)
+ {
+ apply_autocmds(EVENT_CURSORHOLD, NULL, NULL, FALSE, curbuf);
+ update_screen(VALID);
+ once_already = 1;
+ return 0;
+ }
+#endif
+ updatescript(0);
+ }
+ }
+
+ /*
+ * Try to read as many characters as there are, until the buffer is full.
+ */
+
+ /* we will get at least one key. Get more if they are available. */
+ g_fCBrkPressed = FALSE;
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputc('[', fdDump);
+#endif
+
+ /* Keep looping until there is something in the typeahead buffer and more
+ * to get and still room in the buffer (up to two bytes for a char and
+ * three bytes for a modifier). */
+ while ((typeaheadlen == 0 || WaitForChar(0L))
+ && typeaheadlen + 5 <= TYPEAHEADLEN)
+ {
+ if (typebuf_changed(tb_change_cnt))
+ {
+ /* "buf" may be invalid now if a client put something in the
+ * typeahead buffer and "buf" is in the typeahead buffer. */
+ typeaheadlen = 0;
+ break;
+ }
+#ifdef FEAT_MOUSE
+ if (g_nMouseClick != -1)
+ {
+# ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fprintf(fdDump, "{%02x @ %d, %d}",
+ g_nMouseClick, g_xMouse, g_yMouse);
+# endif
+ typeahead[typeaheadlen++] = ESC + 128;
+ typeahead[typeaheadlen++] = 'M';
+ typeahead[typeaheadlen++] = g_nMouseClick;
+ typeahead[typeaheadlen++] = g_xMouse + '!';
+ typeahead[typeaheadlen++] = g_yMouse + '!';
+ g_nMouseClick = -1;
+ }
+ else
+#endif
+ {
+ char_u ch2 = NUL;
+ int modifiers = 0;
+
+ c = tgetch(&modifiers, &ch2);
+
+ if (typebuf_changed(tb_change_cnt))
+ {
+ /* "buf" may be invalid now if a client put something in the
+ * typeahead buffer and "buf" is in the typeahead buffer. */
+ typeaheadlen = 0;
+ break;
+ }
+
+ if (c == Ctrl_C && ctrl_c_interrupts)
+ {
+#if defined(FEAT_CLIENTSERVER)
+ trash_input_buf();
+#endif
+ got_int = TRUE;
+ }
+
+#ifdef FEAT_MOUSE
+ if (g_nMouseClick == -1)
+#endif
+ {
+ int n = 1;
+
+ /* A key may have one or two bytes. */
+ typeahead[typeaheadlen] = c;
+ if (ch2 != NUL)
+ {
+ typeahead[typeaheadlen + 1] = ch2;
+ ++n;
+ }
+#ifdef FEAT_MBYTE
+ /* Only convert normal characters, not special keys. Need to
+ * convert before applying ALT, otherwise mapping <M-x> breaks
+ * when 'tenc' is set. */
+ if (input_conv.vc_type != CONV_NONE
+ && (ch2 == NUL || c != K_NUL))
+ n = convert_input(typeahead + typeaheadlen, n,
+ TYPEAHEADLEN - typeaheadlen);
+#endif
+
+ /* Use the ALT key to set the 8th bit of the character
+ * when it's one byte, the 8th bit isn't set yet and not
+ * using a double-byte encoding (would become a lead
+ * byte). */
+ if ((modifiers & MOD_MASK_ALT)
+ && n == 1
+ && (typeahead[typeaheadlen] & 0x80) == 0
+#ifdef FEAT_MBYTE
+ && !enc_dbcs
+#endif
+ )
+ {
+ typeahead[typeaheadlen] |= 0x80;
+ modifiers &= ~MOD_MASK_ALT;
+ }
+
+ if (modifiers != 0)
+ {
+ /* Prepend modifiers to the character. */
+ mch_memmove(typeahead + typeaheadlen + 3,
+ typeahead + typeaheadlen, n);
+ typeahead[typeaheadlen++] = K_SPECIAL;
+ typeahead[typeaheadlen++] = (char_u)KS_MODIFIER;
+ typeahead[typeaheadlen++] = modifiers;
+ }
+
+ typeaheadlen += n;
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputc(c, fdDump);
+#endif
+ }
+ }
+ }
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fputs("]\n", fdDump);
+ fflush(fdDump);
+ }
+#endif
+
+#ifdef FEAT_AUTOCMD
+ once_already = 0;
+#endif
+
+theend:
+ /* Move typeahead to "buf", as much as fits. */
+ len = 0;
+ while (len < maxlen && typeaheadlen > 0)
+ {
+ buf[len++] = typeahead[0];
+ mch_memmove(typeahead, typeahead + 1, --typeaheadlen);
+ }
+ return len;
+
+#else /* FEAT_GUI_W32 */
+ return 0;
+#endif /* FEAT_GUI_W32 */
+}
+
+#ifndef __MINGW32__
+# include <shellapi.h> /* required for FindExecutable() */
+#endif
+
+ static int
+executable_exists(char *name)
+{
+ char location[2 * _MAX_PATH + 2];
+ char widename[2 * _MAX_PATH];
+
+ /* There appears to be a bug in FindExecutableA() on Windows NT.
+ * Use FindExecutableW() instead... */
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)name, -1,
+ (LPWSTR)widename, _MAX_PATH);
+ if (FindExecutableW((LPCWSTR)widename, (LPCWSTR)"",
+ (LPWSTR)location) > (HINSTANCE)32)
+ return TRUE;
+ }
+ else
+ {
+ if (FindExecutableA((LPCTSTR)name, (LPCTSTR)"",
+ (LPTSTR)location) > (HINSTANCE)32)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#ifdef FEAT_GUI_W32
+
+/*
+ * GUI version of mch_init().
+ */
+ void
+mch_init()
+{
+#ifndef __MINGW32__
+ extern int _fmode;
+#endif
+
+ /* Let critical errors result in a failure, not in a dialog box. Required
+ * for the timestamp test to work on removed floppies. */
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+
+ _fmode = O_BINARY; /* we do our own CR-LF translation */
+
+ /* Specify window size. Is there a place to get the default from? */
+ Rows = 25;
+ Columns = 80;
+
+ /* Look for 'vimrun' */
+ if (!gui_is_win32s())
+ {
+ char_u vimrun_location[_MAX_PATH + 4];
+
+ /* First try in same directory as gvim.exe */
+ STRCPY(vimrun_location, exe_name);
+ STRCPY(gettail(vimrun_location), "vimrun.exe");
+ if (mch_getperm(vimrun_location) >= 0)
+ {
+ if (*skiptowhite(vimrun_location) != NUL)
+ {
+ /* Enclose path with white space in double quotes. */
+ mch_memmove(vimrun_location + 1, vimrun_location,
+ STRLEN(vimrun_location) + 1);
+ *vimrun_location = '"';
+ STRCPY(gettail(vimrun_location), "vimrun\" ");
+ }
+ else
+ STRCPY(gettail(vimrun_location), "vimrun ");
+
+ vimrun_path = (char *)vim_strsave(vimrun_location);
+ s_dont_use_vimrun = FALSE;
+ }
+ else if (executable_exists("vimrun.exe"))
+ s_dont_use_vimrun = FALSE;
+
+ /* Don't give the warning for a missing vimrun.exe right now, but only
+ * when vimrun was supposed to be used. Don't bother people that do
+ * not need vimrun.exe. */
+ if (s_dont_use_vimrun)
+ need_vimrun_warning = TRUE;
+ }
+
+ /*
+ * If "finstr.exe" doesn't exist, use "grep -n" for 'grepprg'.
+ * Otherwise the default "findstr /n" is used.
+ */
+ if (!executable_exists("findstr.exe"))
+ set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0);
+
+#ifdef FEAT_CLIPBOARD
+ clip_init(TRUE);
+
+ /*
+ * Vim's own clipboard format recognises whether the text is char, line, or
+ * rectangular block. Only useful for copying between two Vims.
+ * "VimClipboard" was used for previous versions, using the first
+ * character to specify MCHAR, MLINE or MBLOCK.
+ */
+ clip_star.format = RegisterClipboardFormat("VimClipboard2");
+ clip_star.format_raw = RegisterClipboardFormat("VimRawBytes");
+#endif
+}
+
+
+#else /* FEAT_GUI_W32 */
+
+#define SRWIDTH(sr) ((sr).Right - (sr).Left + 1)
+#define SRHEIGHT(sr) ((sr).Bottom - (sr).Top + 1)
+
+/*
+ * ClearConsoleBuffer()
+ * Description:
+ * Clears the entire contents of the console screen buffer, using the
+ * specified attribute.
+ * Returns:
+ * TRUE on success
+ */
+ static BOOL
+ClearConsoleBuffer(WORD wAttribute)
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ COORD coord;
+ DWORD NumCells, dummy;
+
+ if (!GetConsoleScreenBufferInfo(g_hConOut, &csbi))
+ return FALSE;
+
+ NumCells = csbi.dwSize.X * csbi.dwSize.Y;
+ coord.X = 0;
+ coord.Y = 0;
+ if (!FillConsoleOutputCharacter(g_hConOut, ' ', NumCells,
+ coord, &dummy))
+ {
+ return FALSE;
+ }
+ if (!FillConsoleOutputAttribute(g_hConOut, wAttribute, NumCells,
+ coord, &dummy))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * FitConsoleWindow()
+ * Description:
+ * Checks if the console window will fit within given buffer dimensions.
+ * Also, if requested, will shrink the window to fit.
+ * Returns:
+ * TRUE on success
+ */
+ static BOOL
+FitConsoleWindow(
+ COORD dwBufferSize,
+ BOOL WantAdjust)
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ COORD dwWindowSize;
+ BOOL NeedAdjust = FALSE;
+
+ if (GetConsoleScreenBufferInfo(g_hConOut, &csbi))
+ {
+ /*
+ * A buffer resize will fail if the current console window does
+ * not lie completely within that buffer. To avoid this, we might
+ * have to move and possibly shrink the window.
+ */
+ if (csbi.srWindow.Right >= dwBufferSize.X)
+ {
+ dwWindowSize.X = SRWIDTH(csbi.srWindow);
+ if (dwWindowSize.X > dwBufferSize.X)
+ dwWindowSize.X = dwBufferSize.X;
+ csbi.srWindow.Right = dwBufferSize.X - 1;
+ csbi.srWindow.Left = dwBufferSize.X - dwWindowSize.X;
+ NeedAdjust = TRUE;
+ }
+ if (csbi.srWindow.Bottom >= dwBufferSize.Y)
+ {
+ dwWindowSize.Y = SRHEIGHT(csbi.srWindow);
+ if (dwWindowSize.Y > dwBufferSize.Y)
+ dwWindowSize.Y = dwBufferSize.Y;
+ csbi.srWindow.Bottom = dwBufferSize.Y - 1;
+ csbi.srWindow.Top = dwBufferSize.Y - dwWindowSize.Y;
+ NeedAdjust = TRUE;
+ }
+ if (NeedAdjust && WantAdjust)
+ {
+ if (!SetConsoleWindowInfo(g_hConOut, TRUE, &csbi.srWindow))
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+typedef struct ConsoleBufferStruct
+{
+ BOOL IsValid;
+ CONSOLE_SCREEN_BUFFER_INFO Info;
+ PCHAR_INFO Buffer;
+ COORD BufferSize;
+} ConsoleBuffer;
+
+/*
+ * SaveConsoleBuffer()
+ * Description:
+ * Saves important information about the console buffer, including the
+ * actual buffer contents. The saved information is suitable for later
+ * restoration by RestoreConsoleBuffer().
+ * Returns:
+ * TRUE if all information was saved; FALSE otherwise
+ * If FALSE, still sets cb->IsValid if buffer characteristics were saved.
+ */
+ static BOOL
+SaveConsoleBuffer(
+ ConsoleBuffer *cb)
+{
+ DWORD NumCells;
+ COORD BufferCoord;
+ SMALL_RECT ReadRegion;
+ WORD Y, Y_incr;
+
+ if (cb == NULL)
+ return FALSE;
+
+ if (!GetConsoleScreenBufferInfo(g_hConOut, &cb->Info))
+ {
+ cb->IsValid = FALSE;
+ return FALSE;
+ }
+ cb->IsValid = TRUE;
+
+ /*
+ * Allocate a buffer large enough to hold the entire console screen
+ * buffer. If this ConsoleBuffer structure has already been initialized
+ * with a buffer of the correct size, then just use that one.
+ */
+ if (!cb->IsValid || cb->Buffer == NULL ||
+ cb->BufferSize.X != cb->Info.dwSize.X ||
+ cb->BufferSize.Y != cb->Info.dwSize.Y)
+ {
+ cb->BufferSize.X = cb->Info.dwSize.X;
+ cb->BufferSize.Y = cb->Info.dwSize.Y;
+ NumCells = cb->BufferSize.X * cb->BufferSize.Y;
+ if (cb->Buffer != NULL)
+ vim_free(cb->Buffer);
+ cb->Buffer = (PCHAR_INFO)alloc(NumCells * sizeof(CHAR_INFO));
+ if (cb->Buffer == NULL)
+ return FALSE;
+ }
+
+ /*
+ * We will now copy the console screen buffer into our buffer.
+ * ReadConsoleOutput() seems to be limited as far as how much you
+ * can read at a time. Empirically, this number seems to be about
+ * 12000 cells (rows * columns). Start at position (0, 0) and copy
+ * in chunks until it is all copied. The chunks will all have the
+ * same horizontal characteristics, so initialize them now. The
+ * height of each chunk will be (12000 / width).
+ */
+ BufferCoord.X = 0;
+ ReadRegion.Left = 0;
+ ReadRegion.Right = cb->Info.dwSize.X - 1;
+ Y_incr = 12000 / cb->Info.dwSize.X;
+ for (Y = 0; Y < cb->BufferSize.Y; Y += Y_incr)
+ {
+ /*
+ * Read into position (0, Y) in our buffer.
+ */
+ BufferCoord.Y = Y;
+ /*
+ * Read the region whose top left corner is (0, Y) and whose bottom
+ * right corner is (width - 1, Y + Y_incr - 1). This should define
+ * a region of size width by Y_incr. Don't worry if this region is
+ * too large for the remaining buffer; it will be cropped.
+ */
+ ReadRegion.Top = Y;
+ ReadRegion.Bottom = Y + Y_incr - 1;
+ if (!ReadConsoleOutput(g_hConOut, /* output handle */
+ cb->Buffer, /* our buffer */
+ cb->BufferSize, /* dimensions of our buffer */
+ BufferCoord, /* offset in our buffer */
+ &ReadRegion)) /* region to save */
+ {
+ vim_free(cb->Buffer);
+ cb->Buffer = NULL;
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/*
+ * RestoreConsoleBuffer()
+ * Description:
+ * Restores important information about the console buffer, including the
+ * actual buffer contents, if desired. The information to restore is in
+ * the same format used by SaveConsoleBuffer().
+ * Returns:
+ * TRUE on success
+ */
+ static BOOL
+RestoreConsoleBuffer(
+ ConsoleBuffer *cb,
+ BOOL RestoreScreen)
+{
+ COORD BufferCoord;
+ SMALL_RECT WriteRegion;
+
+ if (cb == NULL || !cb->IsValid)
+ return FALSE;
+
+ /*
+ * Before restoring the buffer contents, clear the current buffer, and
+ * restore the cursor position and window information. Doing this now
+ * prevents old buffer contents from "flashing" onto the screen.
+ */
+ if (RestoreScreen)
+ ClearConsoleBuffer(cb->Info.wAttributes);
+
+ FitConsoleWindow(cb->Info.dwSize, TRUE);
+ if (!SetConsoleScreenBufferSize(g_hConOut, cb->Info.dwSize))
+ return FALSE;
+ if (!SetConsoleTextAttribute(g_hConOut, cb->Info.wAttributes))
+ return FALSE;
+
+ if (!RestoreScreen)
+ {
+ /*
+ * No need to restore the screen buffer contents, so we're done.
+ */
+ return TRUE;
+ }
+
+ if (!SetConsoleCursorPosition(g_hConOut, cb->Info.dwCursorPosition))
+ return FALSE;
+ if (!SetConsoleWindowInfo(g_hConOut, TRUE, &cb->Info.srWindow))
+ return FALSE;
+
+ /*
+ * Restore the screen buffer contents.
+ */
+ if (cb->Buffer != NULL)
+ {
+ BufferCoord.X = 0;
+ BufferCoord.Y = 0;
+ WriteRegion.Left = 0;
+ WriteRegion.Top = 0;
+ WriteRegion.Right = cb->Info.dwSize.X - 1;
+ WriteRegion.Bottom = cb->Info.dwSize.Y - 1;
+ if (!WriteConsoleOutput(g_hConOut, /* output handle */
+ cb->Buffer, /* our buffer */
+ cb->BufferSize, /* dimensions of our buffer */
+ BufferCoord, /* offset in our buffer */
+ &WriteRegion)) /* region to restore */
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+#ifdef FEAT_RESTORE_ORIG_SCREEN
+static ConsoleBuffer g_cbOrig = { 0 };
+#endif
+static ConsoleBuffer g_cbNonTermcap = { 0 };
+static ConsoleBuffer g_cbTermcap = { 0 };
+
+#ifdef FEAT_TITLE
+#ifdef __BORLANDC__
+typedef HWND (__stdcall *GETCONSOLEWINDOWPROC)(VOID);
+#else
+typedef WINBASEAPI HWND (WINAPI *GETCONSOLEWINDOWPROC)(VOID);
+#endif
+char g_szOrigTitle[256] = { 0 };
+HWND g_hWnd = NULL; /* also used in os_mswin.c */
+static HICON g_hOrigIconSmall = NULL;
+static HICON g_hOrigIcon = NULL;
+static HICON g_hVimIcon = NULL;
+static BOOL g_fCanChangeIcon = FALSE;
+
+/* ICON* are not defined in VC++ 4.0 */
+#ifndef ICON_SMALL
+#define ICON_SMALL 0
+#endif
+#ifndef ICON_BIG
+#define ICON_BIG 1
+#endif
+/*
+ * GetConsoleIcon()
+ * Description:
+ * Attempts to retrieve the small icon and/or the big icon currently in
+ * use by a given window.
+ * Returns:
+ * TRUE on success
+ */
+ static BOOL
+GetConsoleIcon(
+ HWND hWnd,
+ HICON *phIconSmall,
+ HICON *phIcon)
+{
+ if (hWnd == NULL)
+ return FALSE;
+
+ if (phIconSmall != NULL)
+ {
+ *phIconSmall = (HICON) SendMessage(hWnd, WM_GETICON,
+ (WPARAM) ICON_SMALL, (LPARAM) 0);
+ }
+ if (phIcon != NULL)
+ {
+ *phIcon = (HICON) SendMessage(hWnd, WM_GETICON,
+ (WPARAM) ICON_BIG, (LPARAM) 0);
+ }
+ return TRUE;
+}
+
+/*
+ * SetConsoleIcon()
+ * Description:
+ * Attempts to change the small icon and/or the big icon currently in
+ * use by a given window.
+ * Returns:
+ * TRUE on success
+ */
+ static BOOL
+SetConsoleIcon(
+ HWND hWnd,
+ HICON hIconSmall,
+ HICON hIcon)
+{
+ HICON hPrevIconSmall;
+ HICON hPrevIcon;
+
+ if (hWnd == NULL)
+ return FALSE;
+
+ if (hIconSmall != NULL)
+ {
+ hPrevIconSmall = (HICON) SendMessage(hWnd, WM_SETICON,
+ (WPARAM) ICON_SMALL, (LPARAM) hIconSmall);
+ }
+ if (hIcon != NULL)
+ {
+ hPrevIcon = (HICON) SendMessage(hWnd, WM_SETICON,
+ (WPARAM) ICON_BIG, (LPARAM) hIcon);
+ }
+ return TRUE;
+}
+
+/*
+ * SaveConsoleTitleAndIcon()
+ * Description:
+ * Saves the current console window title in g_szOrigTitle, for later
+ * restoration. Also, attempts to obtain a handle to the console window,
+ * and use it to save the small and big icons currently in use by the
+ * console window. This is not always possible on some versions of Windows;
+ * nor is it possible when running Vim remotely using Telnet (since the
+ * console window the user sees is owned by a remote process).
+ */
+ static void
+SaveConsoleTitleAndIcon(void)
+{
+ GETCONSOLEWINDOWPROC GetConsoleWindowProc;
+
+ /* Save the original title. */
+ if (!GetConsoleTitle(g_szOrigTitle, sizeof(g_szOrigTitle)))
+ return;
+
+ /*
+ * Obtain a handle to the console window using GetConsoleWindow() from
+ * KERNEL32.DLL; we need to handle in order to change the window icon.
+ * This function only exists on NT-based Windows, starting with Windows
+ * 2000. On older operating systems, we can't change the window icon
+ * anyway.
+ */
+ if ((GetConsoleWindowProc = (GETCONSOLEWINDOWPROC)
+ GetProcAddress(GetModuleHandle("KERNEL32.DLL"),
+ "GetConsoleWindow")) != NULL)
+ {
+ g_hWnd = (*GetConsoleWindowProc)();
+ }
+ if (g_hWnd == NULL)
+ return;
+
+ /* Save the original console window icon. */
+ GetConsoleIcon(g_hWnd, &g_hOrigIconSmall, &g_hOrigIcon);
+ if (g_hOrigIconSmall == NULL || g_hOrigIcon == NULL)
+ return;
+
+ /* Extract the first icon contained in the Vim executable. */
+ g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
+ if (g_hVimIcon != NULL)
+ g_fCanChangeIcon = TRUE;
+}
+#endif
+
+static int g_fWindInitCalled = FALSE;
+static int g_fTermcapMode = FALSE;
+static CONSOLE_CURSOR_INFO g_cci;
+static DWORD g_cmodein = 0;
+static DWORD g_cmodeout = 0;
+
+/*
+ * non-GUI version of mch_init().
+ */
+ void
+mch_init()
+{
+#ifndef FEAT_RESTORE_ORIG_SCREEN
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+#endif
+#ifndef __MINGW32__
+ extern int _fmode;
+#endif
+
+ /* Let critical errors result in a failure, not in a dialog box. Required
+ * for the timestamp test to work on removed floppies. */
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+
+ _fmode = O_BINARY; /* we do our own CR-LF translation */
+ out_flush();
+
+ /* Obtain handles for the standard Console I/O devices */
+ if (read_cmd_fd == 0)
+ g_hConIn = GetStdHandle(STD_INPUT_HANDLE);
+ else
+ create_conin();
+ g_hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
+
+#ifdef FEAT_RESTORE_ORIG_SCREEN
+ /* Save the initial console buffer for later restoration */
+ SaveConsoleBuffer(&g_cbOrig);
+ g_attrCurrent = g_attrDefault = g_cbOrig.Info.wAttributes;
+#else
+ /* Get current text attributes */
+ GetConsoleScreenBufferInfo(g_hConOut, &csbi);
+ g_attrCurrent = g_attrDefault = csbi.wAttributes;
+#endif
+ if (cterm_normal_fg_color == 0)
+ cterm_normal_fg_color = (g_attrCurrent & 0xf) + 1;
+ if (cterm_normal_bg_color == 0)
+ cterm_normal_bg_color = ((g_attrCurrent >> 4) & 0xf) + 1;
+
+ /* set termcap codes to current text attributes */
+ update_tcap(g_attrCurrent);
+
+ GetConsoleCursorInfo(g_hConOut, &g_cci);
+ GetConsoleMode(g_hConIn, &g_cmodein);
+ GetConsoleMode(g_hConOut, &g_cmodeout);
+
+#ifdef FEAT_TITLE
+ SaveConsoleTitleAndIcon();
+ /*
+ * Set both the small and big icons of the console window to Vim's icon.
+ * Note that Vim presently only has one size of icon (32x32), but it
+ * automatically gets scaled down to 16x16 when setting the small icon.
+ */
+ if (g_fCanChangeIcon)
+ SetConsoleIcon(g_hWnd, g_hVimIcon, g_hVimIcon);
+#endif
+
+ ui_get_shellsize();
+
+#ifdef MCH_WRITE_DUMP
+ fdDump = fopen("dump", "wt");
+
+ if (fdDump)
+ {
+ time_t t;
+
+ time(&t);
+ fputs(ctime(&t), fdDump);
+ fflush(fdDump);
+ }
+#endif
+
+ g_fWindInitCalled = TRUE;
+
+#ifdef FEAT_MOUSE
+ g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT);
+#endif
+
+#ifdef FEAT_CLIPBOARD
+ clip_init(TRUE);
+
+ /*
+ * Vim's own clipboard format recognises whether the text is char, line, or
+ * rectangular block. Only useful for copying between two Vims.
+ * "VimClipboard" was used for previous versions, using the first
+ * character to specify MCHAR, MLINE or MBLOCK.
+ */
+ clip_star.format = RegisterClipboardFormat("VimClipboard2");
+ clip_star.format_raw = RegisterClipboardFormat("VimRawBytes");
+#endif
+
+ /* This will be NULL on anything but NT 4.0 */
+ s_pfnGetConsoleKeyboardLayoutName =
+ (PFNGCKLN) GetProcAddress(GetModuleHandle("kernel32.dll"),
+ "GetConsoleKeyboardLayoutNameA");
+}
+
+/*
+ * non-GUI version of mch_exit().
+ * Shut down and exit with status `r'
+ * Careful: mch_exit() may be called before mch_init()!
+ */
+ void
+mch_exit(int r)
+{
+ stoptermcap();
+
+ if (g_fWindInitCalled)
+ settmode(TMODE_COOK);
+
+ ml_close_all(TRUE); /* remove all memfiles */
+
+ if (g_fWindInitCalled)
+ {
+#ifdef FEAT_TITLE
+ mch_restore_title(3);
+ /*
+ * Restore both the small and big icons of the console window to
+ * what they were at startup. Don't do this when the window is
+ * closed, Vim would hang here.
+ */
+ if (g_fCanChangeIcon && !g_fForceExit)
+ SetConsoleIcon(g_hWnd, g_hOrigIconSmall, g_hOrigIcon);
+#endif
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ time_t t;
+
+ time(&t);
+ fputs(ctime(&t), fdDump);
+ fclose(fdDump);
+ }
+ fdDump = NULL;
+#endif
+ }
+
+ SetConsoleCursorInfo(g_hConOut, &g_cci);
+ SetConsoleMode(g_hConIn, g_cmodein);
+ SetConsoleMode(g_hConOut, g_cmodeout);
+
+#ifdef DYNAMIC_GETTEXT
+ dyn_libintl_end();
+#endif
+
+ exit(r);
+}
+#endif /* !FEAT_GUI_W32 */
+
+
+/*
+ * Do we have an interactive window?
+ */
+ int
+mch_check_win(
+ int argc,
+ char **argv)
+{
+ get_exe_name();
+
+#ifdef FEAT_GUI_W32
+ return OK; /* GUI always has a tty */
+#else
+ if (isatty(1))
+ return OK;
+ return FAIL;
+#endif
+}
+
+
+/*
+ * fname_case(): Set the case of the file name, if it already exists.
+ * When "len" is > 0, also expand short to long filenames.
+ */
+ void
+fname_case(
+ char_u *name,
+ int len)
+{
+ char szTrueName[_MAX_PATH + 2];
+ char *ptrue, *ptruePrev;
+ char *porig, *porigPrev;
+ int flen;
+ WIN32_FIND_DATA fb;
+ HANDLE hFind;
+ int c;
+
+ flen = (name != NULL) ? (int)STRLEN(name) : 0;
+ if (flen == 0 || flen > _MAX_PATH)
+ return;
+
+ slash_adjust(name);
+
+ /* Build the new name in szTrueName[] one component at a time. */
+ porig = name;
+ ptrue = szTrueName;
+
+ if (isalpha(porig[0]) && porig[1] == ':')
+ {
+ /* copy leading drive letter */
+ *ptrue++ = *porig++;
+ *ptrue++ = *porig++;
+ *ptrue = NUL; /* in case nothing follows */
+ }
+
+ while (*porig != NUL)
+ {
+ /* copy \ characters */
+ while (*porig == psepc)
+ *ptrue++ = *porig++;
+
+ ptruePrev = ptrue;
+ porigPrev = porig;
+ while (*porig != NUL && *porig != psepc)
+ {
+#ifdef FEAT_MBYTE
+ int l;
+
+ if (enc_dbcs)
+ {
+ l = (*mb_ptr2len_check)(porig);
+ while (--l >= 0)
+ *ptrue++ = *porig++;
+ }
+ else
+#endif
+ *ptrue++ = *porig++;
+ }
+ *ptrue = NUL;
+
+ /* Skip "", "." and "..". */
+ if (ptrue > ptruePrev
+ && (ptruePrev[0] != '.'
+ || (ptruePrev[1] != NUL
+ && (ptruePrev[1] != '.' || ptruePrev[2] != NUL)))
+ && (hFind = FindFirstFile(szTrueName, &fb))
+ != INVALID_HANDLE_VALUE)
+ {
+ c = *porig;
+ *porig = NUL;
+
+ /* Only use the match when it's the same name (ignoring case) or
+ * expansion is allowed and there is a match with the short name
+ * and there is enough room. */
+ if (_stricoll(porigPrev, fb.cFileName) == 0
+ || (len > 0
+ && (_stricoll(porigPrev, fb.cAlternateFileName) == 0
+ && (int)(ptruePrev - szTrueName)
+ + (int)strlen(fb.cFileName) < len)))
+ {
+ STRCPY(ptruePrev, fb.cFileName);
+
+ /* Look for exact match and prefer it if found. Must be a
+ * long name, otherwise there would be only one match. */
+ while (FindNextFile(hFind, &fb))
+ {
+ if (*fb.cAlternateFileName != NUL
+ && (strcoll(porigPrev, fb.cFileName) == 0
+ || (len > 0
+ && (_stricoll(porigPrev,
+ fb.cAlternateFileName) == 0
+ && (int)(ptruePrev - szTrueName)
+ + (int)strlen(fb.cFileName) < len))))
+ {
+ STRCPY(ptruePrev, fb.cFileName);
+ break;
+ }
+ }
+ }
+ FindClose(hFind);
+ *porig = c;
+ ptrue = ptruePrev + strlen(ptruePrev);
+ }
+ }
+
+ STRCPY(name, szTrueName);
+}
+
+
+/*
+ * Insert user name in s[len].
+ */
+ int
+mch_get_user_name(
+ char_u *s,
+ int len)
+{
+ char szUserName[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD cch = sizeof szUserName;
+
+ if (GetUserName(szUserName, &cch))
+ {
+ STRNCPY(s, szUserName, len);
+ return OK;
+ }
+ s[0] = NUL;
+ return FAIL;
+}
+
+
+/*
+ * Insert host name in s[len].
+ */
+ void
+mch_get_host_name(
+ char_u *s,
+ int len)
+{
+ DWORD cch = len;
+
+ if (!GetComputerName(s, &cch))
+ {
+ STRNCPY(s, "PC (Win32 Vim)", len);
+ s[len - 1] = NUL; /* make sure it's terminated */
+ }
+}
+
+
+/*
+ * return process ID
+ */
+ long
+mch_get_pid()
+{
+ return (long)GetCurrentProcessId();
+}
+
+
+/*
+ * Get name of current directory into buffer 'buf' of length 'len' bytes.
+ * Return OK for success, FAIL for failure.
+ */
+ int
+mch_dirname(
+ char_u *buf,
+ int len)
+{
+ /*
+ * Originally this was:
+ * return (getcwd(buf, len) != NULL ? OK : FAIL);
+ * But the Win32s known bug list says that getcwd() doesn't work
+ * so use the Win32 system call instead. <Negri>
+ */
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR wbuf[_MAX_PATH + 1];
+
+ if (GetCurrentDirectoryW(_MAX_PATH, wbuf) != 0)
+ {
+ char_u *p = ucs2_to_enc(wbuf, NULL);
+
+ if (p != NULL)
+ {
+ STRNCPY(buf, p, len - 1);
+ buf[len - 1] = NUL;
+ vim_free(p);
+ return OK;
+ }
+ }
+ /* Retry with non-wide function (for Windows 98). */
+ }
+#endif
+ return (GetCurrentDirectory(len, buf) != 0 ? OK : FAIL);
+}
+
+/*
+ * get file permissions for `name'
+ * -1 : error
+ * else FILE_ATTRIBUTE_* defined in winnt.h
+ */
+ long
+mch_getperm(
+ char_u *name)
+{
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR *p = enc_to_ucs2(name, NULL);
+ long n;
+
+ if (p != NULL)
+ {
+ n = (long)GetFileAttributesW(p);
+ vim_free(p);
+ if (n >= 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return n;
+ /* Retry with non-wide function (for Windows 98). */
+ }
+ }
+#endif
+ return (long)GetFileAttributes((char *)name);
+}
+
+
+/*
+ * set file permission for `name' to `perm'
+ */
+ int
+mch_setperm(
+ char_u *name,
+ long perm)
+{
+ perm |= FILE_ATTRIBUTE_ARCHIVE; /* file has changed, set archive bit */
+#ifdef FEAT_MBYTE
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ WCHAR *p = enc_to_ucs2(name, NULL);
+ long n;
+
+ if (p != NULL)
+ {
+ n = (long)SetFileAttributesW(p, perm);
+ vim_free(p);
+ if (n || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return n ? OK : FAIL;
+ /* Retry with non-wide function (for Windows 98). */
+ }
+ }
+#endif
+ return SetFileAttributes((char *)name, perm) ? OK : FAIL;
+}
+
+/*
+ * Set hidden flag for "name".
+ */
+ void
+mch_hide(char_u *name)
+{
+ int perm;
+#ifdef FEAT_MBYTE
+ WCHAR *p = NULL;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ p = enc_to_ucs2(name, NULL);
+#endif
+
+#ifdef FEAT_MBYTE
+ if (p != NULL)
+ {
+ perm = GetFileAttributesW(p);
+ if (perm < 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ /* Retry with non-wide function (for Windows 98). */
+ vim_free(p);
+ p = NULL;
+ }
+ }
+ if (p == NULL)
+#endif
+ perm = GetFileAttributes((char *)name);
+ if (perm >= 0)
+ {
+ perm |= FILE_ATTRIBUTE_HIDDEN;
+#ifdef FEAT_MBYTE
+ if (p != NULL)
+ {
+ if (SetFileAttributesW(p, perm) == 0
+ && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ /* Retry with non-wide function (for Windows 98). */
+ vim_free(p);
+ p = NULL;
+ }
+ }
+ if (p == NULL)
+#endif
+ SetFileAttributes((char *)name, perm);
+ }
+#ifdef FEAT_MBYTE
+ vim_free(p);
+#endif
+}
+
+/*
+ * return TRUE if "name" is a directory
+ * return FALSE if "name" is not a directory or upon error
+ */
+ int
+mch_isdir(char_u *name)
+{
+ int f = mch_getperm(name);
+
+ if (f == -1)
+ return FALSE; /* file does not exist at all */
+
+ return (f & FILE_ATTRIBUTE_DIRECTORY) != 0;
+}
+
+/*
+ * Return TRUE if file or directory "name" is writable (not readonly).
+ * Strange semantics of Win32: a readonly directory is writable, but you can't
+ * delete a file. Let's say this means it is writable.
+ */
+ int
+mch_writable(char_u *name)
+{
+ int perm = mch_getperm(name);
+
+ return (perm != -1 && (!(perm & FILE_ATTRIBUTE_READONLY)
+ || (perm & FILE_ATTRIBUTE_DIRECTORY)));
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return 1 if "name" can be executed, 0 if not.
+ * Return -1 if unknown.
+ */
+ int
+mch_can_exe(char_u *name)
+{
+ return executable_exists((char *)name);
+}
+#endif
+
+/*
+ * Check what "name" is:
+ * NODE_NORMAL: file or directory (or doesn't exist)
+ * NODE_WRITABLE: writable device, socket, fifo, etc.
+ * NODE_OTHER: non-writable things
+ */
+ int
+mch_nodetype(char_u *name)
+{
+ HANDLE hFile;
+ int type;
+
+ hFile = CreateFile(name, /* file name */
+ GENERIC_WRITE, /* access mode */
+ 0, /* share mode */
+ NULL, /* security descriptor */
+ OPEN_EXISTING, /* creation disposition */
+ 0, /* file attributes */
+ NULL); /* handle to template file */
+
+ if (hFile == INVALID_HANDLE_VALUE)
+ return NODE_NORMAL;
+
+ type = GetFileType(hFile);
+ CloseHandle(hFile);
+ if (type == FILE_TYPE_CHAR)
+ return NODE_WRITABLE;
+ if (type == FILE_TYPE_DISK)
+ return NODE_NORMAL;
+ return NODE_OTHER;
+}
+
+#ifdef HAVE_ACL
+struct my_acl
+{
+ PSECURITY_DESCRIPTOR pSecurityDescriptor;
+ PSID pSidOwner;
+ PSID pSidGroup;
+ PACL pDacl;
+ PACL pSacl;
+};
+#endif
+
+/*
+ * Return a pointer to the ACL of file "fname" in allocated memory.
+ * Return NULL if the ACL is not available for whatever reason.
+ */
+ vim_acl_T
+mch_get_acl(fname)
+ char_u *fname;
+{
+#ifndef HAVE_ACL
+ return (vim_acl_T)NULL;
+#else
+ struct my_acl *p = NULL;
+
+ /* This only works on Windows NT and 2000. */
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT && advapi_lib != NULL)
+ {
+ p = (struct my_acl *)alloc_clear((unsigned)sizeof(struct my_acl));
+ if (p != NULL)
+ {
+ if (pGetNamedSecurityInfo(
+ (LPTSTR)fname, // Abstract filename
+ SE_FILE_OBJECT, // File Object
+ // Retrieve the entire security descriptor.
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION |
+ SACL_SECURITY_INFORMATION,
+ &p->pSidOwner, // Ownership information.
+ &p->pSidGroup, // Group membership.
+ &p->pDacl, // Discretionary information.
+ &p->pSacl, // For auditing purposes.
+ &p->pSecurityDescriptor
+ ) != ERROR_SUCCESS)
+ {
+ mch_free_acl((vim_acl_T)p);
+ p = NULL;
+ }
+ }
+ }
+
+ return (vim_acl_T)p;
+#endif
+}
+
+/*
+ * Set the ACL of file "fname" to "acl" (unless it's NULL).
+ * Errors are ignored.
+ * This must only be called with "acl" equal to what mch_get_acl() returned.
+ */
+ void
+mch_set_acl(fname, acl)
+ char_u *fname;
+ vim_acl_T acl;
+{
+#ifdef HAVE_ACL
+ struct my_acl *p = (struct my_acl *)acl;
+
+ if (p != NULL && advapi_lib != NULL)
+ (void)pSetNamedSecurityInfo(
+ (LPTSTR)fname, // Abstract filename
+ SE_FILE_OBJECT, // File Object
+ // Retrieve the entire security descriptor.
+ OWNER_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ DACL_SECURITY_INFORMATION |
+ SACL_SECURITY_INFORMATION,
+ p->pSidOwner, // Ownership information.
+ p->pSidGroup, // Group membership.
+ p->pDacl, // Discretionary information.
+ p->pSacl // For auditing purposes.
+ );
+#endif
+}
+
+ void
+mch_free_acl(acl)
+ vim_acl_T acl;
+{
+#ifdef HAVE_ACL
+ struct my_acl *p = (struct my_acl *)acl;
+
+ if (p != NULL)
+ {
+ LocalFree(p->pSecurityDescriptor); // Free the memory just in case
+ vim_free(p);
+ }
+#endif
+}
+
+#ifndef FEAT_GUI_W32
+
+/*
+ * handler for ctrl-break, ctrl-c interrupts, and fatal events.
+ */
+ static BOOL WINAPI
+handler_routine(
+ DWORD dwCtrlType)
+{
+ switch (dwCtrlType)
+ {
+ case CTRL_C_EVENT:
+ if (ctrl_c_interrupts)
+ g_fCtrlCPressed = TRUE;
+ return TRUE;
+
+ case CTRL_BREAK_EVENT:
+ g_fCBrkPressed = TRUE;
+ return TRUE;
+
+ /* fatal events: shut down gracefully */
+ case CTRL_CLOSE_EVENT:
+ case CTRL_LOGOFF_EVENT:
+ case CTRL_SHUTDOWN_EVENT:
+ windgoto((int)Rows - 1, 0);
+ g_fForceExit = TRUE;
+
+ sprintf((char *)IObuff, _("Vim: Caught %s event\n"),
+ (dwCtrlType == CTRL_CLOSE_EVENT
+ ? _("close")
+ : dwCtrlType == CTRL_LOGOFF_EVENT
+ ? _("logoff")
+ : _("shutdown")));
+#ifdef DEBUG
+ OutputDebugString(IObuff);
+#endif
+
+ preserve_exit(); /* output IObuff, preserve files and exit */
+
+ return TRUE; /* not reached */
+
+ default:
+ return FALSE;
+ }
+}
+
+
+/*
+ * set the tty in (raw) ? "raw" : "cooked" mode
+ */
+ void
+mch_settmode(
+ int tmode)
+{
+ DWORD cmodein;
+ DWORD cmodeout;
+ BOOL bEnableHandler;
+
+ GetConsoleMode(g_hConIn, &cmodein);
+ GetConsoleMode(g_hConOut, &cmodeout);
+ if (tmode == TMODE_RAW)
+ {
+ cmodein &= ~(ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT |
+ ENABLE_ECHO_INPUT);
+#ifdef FEAT_MOUSE
+ if (g_fMouseActive)
+ cmodein |= ENABLE_MOUSE_INPUT;
+#endif
+ cmodeout &= ~(ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
+ bEnableHandler = TRUE;
+ }
+ else /* cooked */
+ {
+ cmodein |= (ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT |
+ ENABLE_ECHO_INPUT);
+ cmodeout |= (ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
+ bEnableHandler = FALSE;
+ }
+ SetConsoleMode(g_hConIn, cmodein);
+ SetConsoleMode(g_hConOut, cmodeout);
+ SetConsoleCtrlHandler(handler_routine, bEnableHandler);
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "mch_settmode(%s, in = %x, out = %x)\n",
+ tmode == TMODE_RAW ? "raw" :
+ tmode == TMODE_COOK ? "cooked" : "normal",
+ cmodein, cmodeout);
+ fflush(fdDump);
+ }
+#endif
+}
+
+
+/*
+ * Get the size of the current window in `Rows' and `Columns'
+ * Return OK when size could be determined, FAIL otherwise.
+ */
+ int
+mch_get_shellsize()
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+ if (!g_fTermcapMode && g_cbTermcap.IsValid)
+ {
+ /*
+ * For some reason, we are trying to get the screen dimensions
+ * even though we are not in termcap mode. The 'Rows' and 'Columns'
+ * variables are really intended to mean the size of Vim screen
+ * while in termcap mode.
+ */
+ Rows = g_cbTermcap.Info.dwSize.Y;
+ Columns = g_cbTermcap.Info.dwSize.X;
+ }
+ else if (GetConsoleScreenBufferInfo(g_hConOut, &csbi))
+ {
+ Rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+ Columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
+ }
+ else
+ {
+ Rows = 25;
+ Columns = 80;
+ }
+ return OK;
+}
+
+/*
+ * Set a console window to `xSize' * `ySize'
+ */
+ static void
+ResizeConBufAndWindow(
+ HANDLE hConsole,
+ int xSize,
+ int ySize)
+{
+ CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */
+ SMALL_RECT srWindowRect; /* hold the new console size */
+ COORD coordScreen;
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "ResizeConBufAndWindow(%d, %d)\n", xSize, ySize);
+ fflush(fdDump);
+ }
+#endif
+
+ /* get the largest size we can size the console window to */
+ coordScreen = GetLargestConsoleWindowSize(hConsole);
+
+ /* define the new console window size and scroll position */
+ srWindowRect.Left = srWindowRect.Top = (SHORT) 0;
+ srWindowRect.Right = (SHORT) (min(xSize, coordScreen.X) - 1);
+ srWindowRect.Bottom = (SHORT) (min(ySize, coordScreen.Y) - 1);
+
+ if (GetConsoleScreenBufferInfo(g_hConOut, &csbi))
+ {
+ int sx, sy;
+
+ sx = csbi.srWindow.Right - csbi.srWindow.Left + 1;
+ sy = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+ if (sy < ySize || sx < xSize)
+ {
+ /*
+ * Increasing number of lines/columns, do buffer first.
+ * Use the maximal size in x and y direction.
+ */
+ if (sy < ySize)
+ coordScreen.Y = ySize;
+ else
+ coordScreen.Y = sy;
+ if (sx < xSize)
+ coordScreen.X = xSize;
+ else
+ coordScreen.X = sx;
+ SetConsoleScreenBufferSize(hConsole, coordScreen);
+ }
+ }
+
+ if (!SetConsoleWindowInfo(g_hConOut, TRUE, &srWindowRect))
+ {
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "SetConsoleWindowInfo failed: %lx\n",
+ GetLastError());
+ fflush(fdDump);
+ }
+#endif
+ }
+
+ /* define the new console buffer size */
+ coordScreen.X = xSize;
+ coordScreen.Y = ySize;
+
+ if (!SetConsoleScreenBufferSize(hConsole, coordScreen))
+ {
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "SetConsoleScreenBufferSize failed: %lx\n",
+ GetLastError());
+ fflush(fdDump);
+ }
+#endif
+ }
+}
+
+
+/*
+ * Set the console window to `Rows' * `Columns'
+ */
+ void
+mch_set_shellsize()
+{
+ COORD coordScreen;
+
+ /* Don't change window size while still starting up */
+ if (suppress_winsize != 0)
+ {
+ suppress_winsize = 2;
+ return;
+ }
+
+ if (term_console)
+ {
+ coordScreen = GetLargestConsoleWindowSize(g_hConOut);
+
+ /* Clamp Rows and Columns to reasonable values */
+ if (Rows > coordScreen.Y)
+ Rows = coordScreen.Y;
+ if (Columns > coordScreen.X)
+ Columns = coordScreen.X;
+
+ ResizeConBufAndWindow(g_hConOut, Columns, Rows);
+ }
+}
+
+/*
+ * Rows and/or Columns has changed.
+ */
+ void
+mch_new_shellsize()
+{
+ set_scroll_region(0, 0, Columns - 1, Rows - 1);
+}
+
+
+/*
+ * Called when started up, to set the winsize that was delayed.
+ */
+ void
+mch_set_winsize_now()
+{
+ if (suppress_winsize == 2)
+ {
+ suppress_winsize = 0;
+ mch_set_shellsize();
+ shell_resized();
+ }
+ suppress_winsize = 0;
+}
+#endif /* FEAT_GUI_W32 */
+
+
+
+#if defined(FEAT_GUI_W32) || defined(PROTO)
+
+/*
+ * Specialised version of system() for Win32 GUI mode.
+ * This version proceeds as follows:
+ * 1. Create a console window for use by the subprocess
+ * 2. Run the subprocess (it gets the allocated console by default)
+ * 3. Wait for the subprocess to terminate and get its exit code
+ * 4. Prompt the user to press a key to close the console window
+ */
+ static int
+mch_system(char *cmd, int options)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ DWORD ret = 0;
+ HWND hwnd = GetFocus();
+
+ si.cb = sizeof(si);
+ si.lpReserved = NULL;
+ si.lpDesktop = NULL;
+ si.lpTitle = NULL;
+ si.dwFlags = STARTF_USESHOWWINDOW;
+ /*
+ * It's nicer to run a filter command in a minimized window, but in
+ * Windows 95 this makes the command MUCH slower. We can't do it under
+ * Win32s either as it stops the synchronous spawn workaround working.
+ */
+ if ((options & SHELL_DOOUT) && !mch_windows95() && !gui_is_win32s())
+ si.wShowWindow = SW_SHOWMINIMIZED;
+ else
+ si.wShowWindow = SW_SHOWNORMAL;
+ si.cbReserved2 = 0;
+ si.lpReserved2 = NULL;
+
+ /* There is a strange error on Windows 95 when using "c:\\command.com".
+ * When the "c:\\" is left out it works OK...? */
+ if (mch_windows95()
+ && (STRNICMP(cmd, "c:/command.com", 14) == 0
+ || STRNICMP(cmd, "c:\\command.com", 14) == 0))
+ cmd += 3;
+
+ /* Now, run the command */
+ CreateProcess(NULL, /* Executable name */
+ cmd, /* Command to execute */
+ NULL, /* Process security attributes */
+ NULL, /* Thread security attributes */
+ FALSE, /* Inherit handles */
+ CREATE_DEFAULT_ERROR_MODE | /* Creation flags */
+ CREATE_NEW_CONSOLE,
+ NULL, /* Environment */
+ NULL, /* Current directory */
+ &si, /* Startup information */
+ &pi); /* Process information */
+
+
+ /* Wait for the command to terminate before continuing */
+ if (g_PlatformId != VER_PLATFORM_WIN32s)
+ {
+#ifdef FEAT_GUI
+ int delay = 1;
+
+ /* Keep updating the window while waiting for the shell to finish. */
+ for (;;)
+ {
+ MSG msg;
+
+ if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
+ break;
+
+ /* We start waiting for a very short time and then increase it, so
+ * that we respond quickly when the process is quick, and don't
+ * consume too much overhead when it's slow. */
+ if (delay < 50)
+ delay += 10;
+ }
+#else
+ WaitForSingleObject(pi.hProcess, INFINITE);
+#endif
+
+ /* Get the command exit code */
+ GetExitCodeProcess(pi.hProcess, &ret);
+ }
+ else
+ {
+ /*
+ * This ugly code is the only quick way of performing
+ * a synchronous spawn under Win32s. Yuk.
+ */
+ num_windows = 0;
+ EnumWindows(win32ssynch_cb, 0);
+ old_num_windows = num_windows;
+ do
+ {
+ Sleep(1000);
+ num_windows = 0;
+ EnumWindows(win32ssynch_cb, 0);
+ } while (num_windows == old_num_windows);
+ ret = 0;
+ }
+
+ /* Close the handles to the subprocess, so that it goes away */
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+
+ /* Try to get input focus back. Doesn't always work though. */
+ PostMessage(hwnd, WM_SETFOCUS, 0, 0);
+
+ return ret;
+}
+#else
+
+# define mch_system(c, o) system(c)
+
+#endif
+
+/*
+ * Either execute a command by calling the shell or start a new shell
+ */
+ int
+mch_call_shell(
+ char_u *cmd,
+ int options) /* SHELL_*, see vim.h */
+{
+ int x = 0;
+ int tmode = cur_tmode;
+#ifdef FEAT_TITLE
+ char szShellTitle[512];
+
+ /* Change the title to reflect that we are in a subshell. */
+ if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
+ {
+ if (cmd == NULL)
+ strcat(szShellTitle, " :sh");
+ else
+ {
+ strcat(szShellTitle, " - !");
+ if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
+ strcat(szShellTitle, cmd);
+ }
+ mch_settitle(szShellTitle, NULL);
+ }
+#endif
+
+ out_flush();
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fprintf(fdDump, "mch_call_shell(\"%s\", %d)\n", cmd, options);
+ fflush(fdDump);
+ }
+#endif
+
+ /*
+ * Catch all deadly signals while running the external command, because a
+ * CTRL-C, Ctrl-Break or illegal instruction might otherwise kill us.
+ */
+ signal(SIGINT, SIG_IGN);
+#if defined(__GNUC__) && !defined(__MINGW32__)
+ signal(SIGKILL, SIG_IGN);
+#else
+ signal(SIGBREAK, SIG_IGN);
+#endif
+ signal(SIGILL, SIG_IGN);
+ signal(SIGFPE, SIG_IGN);
+ signal(SIGSEGV, SIG_IGN);
+ signal(SIGTERM, SIG_IGN);
+ signal(SIGABRT, SIG_IGN);
+
+ if (options & SHELL_COOKED)
+ settmode(TMODE_COOK); /* set to normal mode */
+
+ if (cmd == NULL)
+ {
+ x = mch_system(p_sh, options);
+ }
+ else
+ {
+ /* we use "command" or "cmd" to start the shell; slow but easy */
+ char_u *newcmd;
+
+ newcmd = lalloc((long_u) (
+#ifdef FEAT_GUI_W32
+ STRLEN(vimrun_path) +
+#endif
+ STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10), TRUE);
+ if (newcmd != NULL)
+ {
+ char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
+
+ if ((STRNICMP(cmdbase, "start", 5) == 0) && vim_iswhite(cmdbase[5]))
+ {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+
+ si.cb = sizeof(si);
+ si.lpReserved = NULL;
+ si.lpDesktop = NULL;
+ si.lpTitle = NULL;
+ si.dwFlags = 0;
+ si.cbReserved2 = 0;
+ si.lpReserved2 = NULL;
+
+ cmdbase = skipwhite(cmdbase + 5);
+ if ((STRNICMP(cmdbase, "/min", 4) == 0)
+ && vim_iswhite(cmdbase[4]))
+ {
+ cmdbase = skipwhite(cmdbase + 4);
+ si.dwFlags = STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_SHOWMINNOACTIVE;
+ }
+
+ /* When the command is in double quotes, but 'shellxquote' is
+ * empty, keep the double quotes around the command.
+ * Otherwise remove the double quotes, they aren't needed
+ * here, because we don't use a shell to run the command. */
+ if (*cmd == '"' && *p_sxq == NUL)
+ {
+ newcmd[0] = '"';
+ STRCPY(newcmd + 1, cmdbase);
+ }
+ else
+ {
+ STRCPY(newcmd, cmdbase);
+ if (*cmd == '"' && *newcmd != NUL)
+ newcmd[STRLEN(newcmd) - 1] = NUL;
+ }
+
+ /*
+ * Now, start the command as a process, so that it doesn't
+ * inherit our handles which causes unpleasant dangling swap
+ * files if we exit before the spawned process
+ */
+ if (CreateProcess (NULL, // Executable name
+ newcmd, // Command to execute
+ NULL, // Process security attributes
+ NULL, // Thread security attributes
+ FALSE, // Inherit handles
+ CREATE_NEW_CONSOLE, // Creation flags
+ NULL, // Environment
+ NULL, // Current directory
+ &si, // Startup information
+ &pi)) // Process information
+ x = 0;
+ else
+ {
+ x = -1;
+#ifdef FEAT_GUI_W32
+ EMSG(_("E371: Command not found"));
+#endif
+ }
+ /* Close the handles to the subprocess, so that it goes away */
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ }
+ else
+ {
+#if defined(FEAT_GUI_W32)
+ if (need_vimrun_warning)
+ {
+ MessageBox(NULL,
+ _("VIMRUN.EXE not found in your $PATH.\n"
+ "External commands will not pause after completion.\n"
+ "See :help win32-vimrun for more information."),
+ _("Vim Warning"),
+ MB_ICONWARNING);
+ need_vimrun_warning = FALSE;
+ }
+ if (!s_dont_use_vimrun)
+ /* Use vimrun to execute the command. It opens a console
+ * window, which can be closed without killing Vim. */
+ sprintf((char *)newcmd, "%s%s%s %s %s",
+ vimrun_path,
+ (msg_silent != 0 || (options & SHELL_DOOUT))
+ ? "-s " : "",
+ p_sh, p_shcf, cmd);
+ else
+#endif
+ sprintf((char *)newcmd, "%s %s %s", p_sh, p_shcf, cmd);
+ x = mch_system((char *)newcmd, options);
+ }
+ vim_free(newcmd);
+ }
+ }
+
+ if (tmode == TMODE_RAW)
+ settmode(TMODE_RAW); /* set to raw mode */
+
+ /* Print the return value, unless "vimrun" was used. */
+ if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
+#if defined(FEAT_GUI_W32)
+ && ((options & SHELL_DOOUT) || s_dont_use_vimrun)
+#endif
+ )
+ {
+ smsg(_("shell returned %d"), x);
+ msg_putchar('\n');
+ }
+#ifdef FEAT_TITLE
+ resettitle();
+#endif
+
+ signal(SIGINT, SIG_DFL);
+#if defined(__GNUC__) && !defined(__MINGW32__)
+ signal(SIGKILL, SIG_DFL);
+#else
+ signal(SIGBREAK, SIG_DFL);
+#endif
+ signal(SIGILL, SIG_DFL);
+ signal(SIGFPE, SIG_DFL);
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGABRT, SIG_DFL);
+
+ return x;
+}
+
+
+#ifndef FEAT_GUI_W32
+
+/*
+ * Start termcap mode
+ */
+ static void
+termcap_mode_start(void)
+{
+ DWORD cmodein;
+
+ if (g_fTermcapMode)
+ return;
+
+ SaveConsoleBuffer(&g_cbNonTermcap);
+
+ if (g_cbTermcap.IsValid)
+ {
+ /*
+ * We've been in termcap mode before. Restore certain screen
+ * characteristics, including the buffer size and the window
+ * size. Since we will be redrawing the screen, we don't need
+ * to restore the actual contents of the buffer.
+ */
+ RestoreConsoleBuffer(&g_cbTermcap, FALSE);
+ SetConsoleWindowInfo(g_hConOut, TRUE, &g_cbTermcap.Info.srWindow);
+ Rows = g_cbTermcap.Info.dwSize.Y;
+ Columns = g_cbTermcap.Info.dwSize.X;
+ }
+ else
+ {
+ /*
+ * This is our first time entering termcap mode. Clear the console
+ * screen buffer, and resize the buffer to match the current window
+ * size. We will use this as the size of our editing environment.
+ */
+ ClearConsoleBuffer(g_attrCurrent);
+ ResizeConBufAndWindow(g_hConOut, Columns, Rows);
+ }
+
+#ifdef FEAT_TITLE
+ resettitle();
+#endif
+
+ GetConsoleMode(g_hConIn, &cmodein);
+#ifdef FEAT_MOUSE
+ if (g_fMouseActive)
+ cmodein |= ENABLE_MOUSE_INPUT;
+ else
+ cmodein &= ~ENABLE_MOUSE_INPUT;
+#endif
+ cmodein |= ENABLE_WINDOW_INPUT;
+ SetConsoleMode(g_hConIn, cmodein);
+
+ redraw_later_clear();
+ g_fTermcapMode = TRUE;
+}
+
+
+/*
+ * End termcap mode
+ */
+ static void
+termcap_mode_end(void)
+{
+ DWORD cmodein;
+ ConsoleBuffer *cb;
+ COORD coord;
+ DWORD dwDummy;
+
+ if (!g_fTermcapMode)
+ return;
+
+ SaveConsoleBuffer(&g_cbTermcap);
+
+ GetConsoleMode(g_hConIn, &cmodein);
+ cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
+ SetConsoleMode(g_hConIn, cmodein);
+
+#ifdef FEAT_RESTORE_ORIG_SCREEN
+ cb = exiting ? &g_cbOrig : &g_cbNonTermcap;
+#else
+ cb = &g_cbNonTermcap;
+#endif
+ RestoreConsoleBuffer(cb, p_rs);
+ SetConsoleCursorInfo(g_hConOut, &g_cci);
+
+ if (p_rs || exiting)
+ {
+ /*
+ * Clear anything that happens to be on the current line.
+ */
+ coord.X = 0;
+ coord.Y = (SHORT) (p_rs ? cb->Info.dwCursorPosition.Y : (Rows - 1));
+ FillConsoleOutputCharacter(g_hConOut, ' ',
+ cb->Info.dwSize.X, coord, &dwDummy);
+ /*
+ * The following is just for aesthetics. If we are exiting without
+ * restoring the screen, then we want to have a prompt string
+ * appear at the bottom line. However, the command interpreter
+ * seems to always advance the cursor one line before displaying
+ * the prompt string, which causes the screen to scroll. To
+ * counter this, move the cursor up one line before exiting.
+ */
+ if (exiting && !p_rs)
+ coord.Y--;
+ /*
+ * Position the cursor at the leftmost column of the desired row.
+ */
+ SetConsoleCursorPosition(g_hConOut, coord);
+ }
+
+ g_fTermcapMode = FALSE;
+}
+#endif /* FEAT_GUI_W32 */
+
+
+#ifdef FEAT_GUI_W32
+ void
+mch_write(
+ char_u *s,
+ int len)
+{
+ /* never used */
+}
+
+#else
+
+/*
+ * clear `n' chars, starting from `coord'
+ */
+ static void
+clear_chars(
+ COORD coord,
+ DWORD n)
+{
+ DWORD dwDummy;
+
+ FillConsoleOutputCharacter(g_hConOut, ' ', n, coord, &dwDummy);
+ FillConsoleOutputAttribute(g_hConOut, g_attrCurrent, n, coord, &dwDummy);
+}
+
+
+/*
+ * Clear the screen
+ */
+ static void
+clear_screen(void)
+{
+ g_coord.X = g_coord.Y = 0;
+ clear_chars(g_coord, Rows * Columns);
+}
+
+
+/*
+ * Clear to end of display
+ */
+ static void
+clear_to_end_of_display(void)
+{
+ clear_chars(g_coord, (Rows - g_coord.Y - 1)
+ * Columns + (Columns - g_coord.X));
+}
+
+
+/*
+ * Clear to end of line
+ */
+ static void
+clear_to_end_of_line(void)
+{
+ clear_chars(g_coord, Columns - g_coord.X);
+}
+
+
+/*
+ * Scroll the scroll region up by `cLines' lines
+ */
+ static void
+scroll(
+ unsigned cLines)
+{
+ COORD oldcoord = g_coord;
+
+ gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Top + 1);
+ delete_lines(cLines);
+
+ g_coord = oldcoord;
+}
+
+
+/*
+ * Set the scroll region
+ */
+ static void
+set_scroll_region(
+ unsigned left,
+ unsigned top,
+ unsigned right,
+ unsigned bottom)
+{
+ if (left >= right
+ || top >= bottom
+ || right > (unsigned) Columns - 1
+ || bottom > (unsigned) Rows - 1)
+ return;
+
+ g_srScrollRegion.Left = left;
+ g_srScrollRegion.Top = top;
+ g_srScrollRegion.Right = right;
+ g_srScrollRegion.Bottom = bottom;
+}
+
+
+/*
+ * Insert `cLines' lines at the current cursor position
+ */
+ static void
+insert_lines(
+ unsigned cLines)
+{
+ SMALL_RECT source;
+ COORD dest;
+ CHAR_INFO fill;
+
+ dest.X = 0;
+ dest.Y = g_coord.Y + cLines;
+
+ source.Left = 0;
+ source.Top = g_coord.Y;
+ source.Right = g_srScrollRegion.Right;
+ source.Bottom = g_srScrollRegion.Bottom - cLines;
+
+ fill.Char.AsciiChar = ' ';
+ fill.Attributes = g_attrCurrent;
+
+ ScrollConsoleScreenBuffer(g_hConOut, &source, NULL, dest, &fill);
+
+ /* Here we have to deal with a win32 console flake: If the scroll
+ * region looks like abc and we scroll c to a and fill with d we get
+ * cbd... if we scroll block c one line at a time to a, we get cdd...
+ * vim expects cdd consistently... So we have to deal with that
+ * here... (this also occurs scrolling the same way in the other
+ * direction). */
+
+ if (source.Bottom < dest.Y)
+ {
+ COORD coord;
+
+ coord.X = 0;
+ coord.Y = source.Bottom;
+ clear_chars(coord, Columns * (dest.Y - source.Bottom));
+ }
+}
+
+
+/*
+ * Delete `cLines' lines at the current cursor position
+ */
+ static void
+delete_lines(
+ unsigned cLines)
+{
+ SMALL_RECT source;
+ COORD dest;
+ CHAR_INFO fill;
+ int nb;
+
+ dest.X = 0;
+ dest.Y = g_coord.Y;
+
+ source.Left = 0;
+ source.Top = g_coord.Y + cLines;
+ source.Right = g_srScrollRegion.Right;
+ source.Bottom = g_srScrollRegion.Bottom;
+
+ fill.Char.AsciiChar = ' ';
+ fill.Attributes = g_attrCurrent;
+
+ ScrollConsoleScreenBuffer(g_hConOut, &source, NULL, dest, &fill);
+
+ /* Here we have to deal with a win32 console flake: If the scroll
+ * region looks like abc and we scroll c to a and fill with d we get
+ * cbd... if we scroll block c one line at a time to a, we get cdd...
+ * vim expects cdd consistently... So we have to deal with that
+ * here... (this also occurs scrolling the same way in the other
+ * direction). */
+
+ nb = dest.Y + (source.Bottom - source.Top) + 1;
+
+ if (nb < source.Top)
+ {
+ COORD coord;
+
+ coord.X = 0;
+ coord.Y = nb;
+ clear_chars(coord, Columns * (source.Top - nb));
+ }
+}
+
+
+/*
+ * Set the cursor position
+ */
+ static void
+gotoxy(
+ unsigned x,
+ unsigned y)
+{
+ if (x < 1 || x > (unsigned)Columns || y < 1 || y > (unsigned)Rows)
+ return;
+
+ /* external cursor coords are 1-based; internal are 0-based */
+ g_coord.X = x - 1;
+ g_coord.Y = y - 1;
+ SetConsoleCursorPosition(g_hConOut, g_coord);
+}
+
+
+/*
+ * Set the current text attribute = (foreground | background)
+ * See ../doc/os_win32.txt for the numbers.
+ */
+ static void
+textattr(
+ WORD wAttr)
+{
+ g_attrCurrent = wAttr;
+
+ SetConsoleTextAttribute(g_hConOut, wAttr);
+}
+
+
+ static void
+textcolor(
+ WORD wAttr)
+{
+ g_attrCurrent = (g_attrCurrent & 0xf0) + wAttr;
+
+ SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
+}
+
+
+ static void
+textbackground(
+ WORD wAttr)
+{
+ g_attrCurrent = (g_attrCurrent & 0x0f) + (wAttr << 4);
+
+ SetConsoleTextAttribute(g_hConOut, g_attrCurrent);
+}
+
+
+/*
+ * restore the default text attribute (whatever we started with)
+ */
+ static void
+normvideo()
+{
+ textattr(g_attrDefault);
+}
+
+
+static WORD g_attrPreStandout = 0;
+
+/*
+ * Make the text standout, by brightening it
+ */
+ static void
+standout(void)
+{
+ g_attrPreStandout = g_attrCurrent;
+ textattr((WORD) (g_attrCurrent|FOREGROUND_INTENSITY|BACKGROUND_INTENSITY));
+}
+
+
+/*
+ * Turn off standout mode
+ */
+ static void
+standend()
+{
+ if (g_attrPreStandout)
+ {
+ textattr(g_attrPreStandout);
+ g_attrPreStandout = 0;
+ }
+}
+
+
+/*
+ * Set normal fg/bg color, based on T_ME. Called whem t_me has been set.
+ */
+ void
+mch_set_normal_colors()
+{
+ char_u *p;
+ int n;
+
+ cterm_normal_fg_color = (g_attrDefault & 0xf) + 1;
+ cterm_normal_bg_color = ((g_attrDefault >> 4) & 0xf) + 1;
+ if (T_ME[0] == ESC && T_ME[1] == '|')
+ {
+ p = T_ME + 2;
+ n = getdigits(&p);
+ if (*p == 'm' && n > 0)
+ {
+ cterm_normal_fg_color = (n & 0xf) + 1;
+ cterm_normal_bg_color = ((n >> 4) & 0xf) + 1;
+ }
+ }
+}
+
+
+/*
+ * visual bell: flash the screen
+ */
+ static void
+visual_bell()
+{
+ COORD coordOrigin = {0, 0};
+ WORD attrFlash = ~g_attrCurrent & 0xff;
+
+ DWORD dwDummy;
+ LPWORD oldattrs = (LPWORD)alloc(Rows * Columns * sizeof(WORD));
+
+ if (oldattrs == NULL)
+ return;
+ ReadConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
+ coordOrigin, &dwDummy);
+ FillConsoleOutputAttribute(g_hConOut, attrFlash, Rows * Columns,
+ coordOrigin, &dwDummy);
+
+ Sleep(15); /* wait for 15 msec */
+ WriteConsoleOutputAttribute(g_hConOut, oldattrs, Rows * Columns,
+ coordOrigin, &dwDummy);
+ vim_free(oldattrs);
+}
+
+
+/*
+ * Make the cursor visible or invisible
+ */
+ static void
+cursor_visible(
+ BOOL fVisible)
+{
+ s_cursor_visible = fVisible;
+#ifdef MCH_CURSOR_SHAPE
+ mch_update_cursor();
+#endif
+}
+
+
+/*
+ * write `cchToWrite' characters in `pchBuf' to the screen
+ * Returns the number of characters actually written (at least one).
+ */
+ static BOOL
+write_chars(
+ LPCSTR pchBuf,
+ DWORD cchToWrite)
+{
+ COORD coord = g_coord;
+ DWORD written;
+
+ FillConsoleOutputAttribute(g_hConOut, g_attrCurrent, cchToWrite,
+ coord, &written);
+ /* When writing fails or didn't write a single character, pretend one
+ * character was written, otherwise we get stuck. */
+ if (WriteConsoleOutputCharacter(g_hConOut, pchBuf, cchToWrite,
+ coord, &written) == 0
+ || written == 0)
+ written = 1;
+
+ g_coord.X += (SHORT) written;
+
+ while (g_coord.X > g_srScrollRegion.Right)
+ {
+ g_coord.X -= (SHORT) Columns;
+ if (g_coord.Y < g_srScrollRegion.Bottom)
+ g_coord.Y++;
+ }
+
+ gotoxy(g_coord.X + 1, g_coord.Y + 1);
+
+ return written;
+}
+
+
+/*
+ * mch_write(): write the output buffer to the screen, translating ESC
+ * sequences into calls to console output routines.
+ */
+ void
+mch_write(
+ char_u *s,
+ int len)
+{
+ s[len] = NUL;
+
+ if (!term_console)
+ {
+ write(1, s, (unsigned)len);
+ return;
+ }
+
+ /* translate ESC | sequences into faked bios calls */
+ while (len--)
+ {
+ /* optimization: use one single write_chars for runs of text,
+ * rather than once per character It ain't curses, but it helps. */
+ DWORD prefix = strcspn(s, "\n\r\b\a\033");
+
+ if (p_wd)
+ {
+ WaitForChar(p_wd);
+ if (prefix != 0)
+ prefix = 1;
+ }
+
+ if (prefix != 0)
+ {
+ DWORD nWritten;
+
+ nWritten = write_chars(s, prefix);
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fputc('>', fdDump);
+ fwrite(s, sizeof(char_u), nWritten, fdDump);
+ fputs("<\n", fdDump);
+ }
+#endif
+ len -= (nWritten - 1);
+ s += nWritten;
+ }
+ else if (s[0] == '\n')
+ {
+ /* \n, newline: go to the beginning of the next line or scroll */
+ if (g_coord.Y == g_srScrollRegion.Bottom)
+ {
+ scroll(1);
+ gotoxy(g_srScrollRegion.Left + 1, g_srScrollRegion.Bottom + 1);
+ }
+ else
+ {
+ gotoxy(g_srScrollRegion.Left + 1, g_coord.Y + 2);
+ }
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputs("\\n\n", fdDump);
+#endif
+ s++;
+ }
+ else if (s[0] == '\r')
+ {
+ /* \r, carriage return: go to beginning of line */
+ gotoxy(g_srScrollRegion.Left+1, g_coord.Y + 1);
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputs("\\r\n", fdDump);
+#endif
+ s++;
+ }
+ else if (s[0] == '\b')
+ {
+ /* \b, backspace: move cursor one position left */
+ if (g_coord.X > g_srScrollRegion.Left)
+ g_coord.X--;
+ else if (g_coord.Y > g_srScrollRegion.Top)
+ {
+ g_coord.X = g_srScrollRegion.Right;
+ g_coord.Y--;
+ }
+ gotoxy(g_coord.X + 1, g_coord.Y + 1);
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputs("\\b\n", fdDump);
+#endif
+ s++;
+ }
+ else if (s[0] == '\a')
+ {
+ /* \a, bell */
+ MessageBeep(0xFFFFFFFF);
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fputs("\\a\n", fdDump);
+#endif
+ s++;
+ }
+ else if (s[0] == ESC && len >= 3-1 && s[1] == '|')
+ {
+#ifdef MCH_WRITE_DUMP
+ char_u* old_s = s;
+#endif
+ char_u* p;
+ int arg1 = 0, arg2 = 0;
+
+ switch (s[2])
+ {
+ /* one or two numeric arguments, separated by ';' */
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ p = s + 2;
+ arg1 = getdigits(&p); /* no check for length! */
+ if (p > s + len)
+ break;
+
+ if (*p == ';')
+ {
+ ++p;
+ arg2 = getdigits(&p); /* no check for length! */
+ if (p > s + len)
+ break;
+
+ if (*p == 'H')
+ gotoxy(arg2, arg1);
+ else if (*p == 'r')
+ set_scroll_region(0, arg1 - 1, Columns - 1, arg2 - 1);
+ }
+ else if (*p == 'A')
+ {
+ /* move cursor up arg1 lines in same column */
+ gotoxy(g_coord.X + 1,
+ max(g_srScrollRegion.Top, g_coord.Y - arg1) + 1);
+ }
+ else if (*p == 'C')
+ {
+ /* move cursor right arg1 columns in same line */
+ gotoxy(min(g_srScrollRegion.Right, g_coord.X + arg1) + 1,
+ g_coord.Y + 1);
+ }
+ else if (*p == 'H')
+ {
+ gotoxy(1, arg1);
+ }
+ else if (*p == 'L')
+ {
+ insert_lines(arg1);
+ }
+ else if (*p == 'm')
+ {
+ if (arg1 == 0)
+ normvideo();
+ else
+ textattr((WORD) arg1);
+ }
+ else if (*p == 'f')
+ {
+ textcolor((WORD) arg1);
+ }
+ else if (*p == 'b')
+ {
+ textbackground((WORD) arg1);
+ }
+ else if (*p == 'M')
+ {
+ delete_lines(arg1);
+ }
+
+ len -= p - s;
+ s = p + 1;
+ break;
+
+
+ /* Three-character escape sequences */
+
+ case 'A':
+ /* move cursor up one line in same column */
+ gotoxy(g_coord.X + 1,
+ max(g_srScrollRegion.Top, g_coord.Y - 1) + 1);
+ goto got3;
+
+ case 'B':
+ visual_bell();
+ goto got3;
+
+ case 'C':
+ /* move cursor right one column in same line */
+ gotoxy(min(g_srScrollRegion.Right, g_coord.X + 1) + 1,
+ g_coord.Y + 1);
+ goto got3;
+
+ case 'E':
+ termcap_mode_end();
+ goto got3;
+
+ case 'F':
+ standout();
+ goto got3;
+
+ case 'f':
+ standend();
+ goto got3;
+
+ case 'H':
+ gotoxy(1, 1);
+ goto got3;
+
+ case 'j':
+ clear_to_end_of_display();
+ goto got3;
+
+ case 'J':
+ clear_screen();
+ goto got3;
+
+ case 'K':
+ clear_to_end_of_line();
+ goto got3;
+
+ case 'L':
+ insert_lines(1);
+ goto got3;
+
+ case 'M':
+ delete_lines(1);
+ goto got3;
+
+ case 'S':
+ termcap_mode_start();
+ goto got3;
+
+ case 'V':
+ cursor_visible(TRUE);
+ goto got3;
+
+ case 'v':
+ cursor_visible(FALSE);
+ goto got3;
+
+ got3:
+ s += 3;
+ len -= 2;
+ }
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fputs("ESC | ", fdDump);
+ fwrite(old_s + 2, sizeof(char_u), s - old_s - 2, fdDump);
+ fputc('\n', fdDump);
+ }
+#endif
+ }
+ else
+ {
+ /* Write a single character */
+ DWORD nWritten;
+
+ nWritten = write_chars(s, 1);
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ {
+ fputc('>', fdDump);
+ fwrite(s, sizeof(char_u), nWritten, fdDump);
+ fputs("<\n", fdDump);
+ }
+#endif
+
+ len -= (nWritten - 1);
+ s += nWritten;
+ }
+ }
+
+#ifdef MCH_WRITE_DUMP
+ if (fdDump)
+ fflush(fdDump);
+#endif
+}
+
+#endif /* FEAT_GUI_W32 */
+
+
+/*
+ * Delay for half a second.
+ */
+ void
+mch_delay(
+ long msec,
+ int ignoreinput)
+{
+#ifdef FEAT_GUI_W32
+ Sleep((int)msec); /* never wait for input */
+#else
+ if (ignoreinput)
+ Sleep((int)msec);
+ else
+ WaitForChar(msec);
+#endif
+}
+
+
+/*
+ * this version of remove is not scared by a readonly (backup) file
+ * Return 0 for success, -1 for failure.
+ */
+ int
+mch_remove(char_u *name)
+{
+#ifdef FEAT_MBYTE
+ WCHAR *wn = NULL;
+ int n;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ wn = enc_to_ucs2(name, NULL);
+ if (wn != NULL)
+ {
+ SetFileAttributesW(wn, FILE_ATTRIBUTE_NORMAL);
+ n = DeleteFileW(wn) ? 0 : -1;
+ vim_free(wn);
+ if (n == 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return n;
+ /* Retry with non-wide function (for Windows 98). */
+ }
+ }
+#endif
+ SetFileAttributes(name, FILE_ATTRIBUTE_NORMAL);
+ return DeleteFile(name) ? 0 : -1;
+}
+
+
+/*
+ * check for an "interrupt signal": CTRL-break or CTRL-C
+ */
+ void
+mch_breakcheck()
+{
+#ifndef FEAT_GUI_W32 /* never used */
+ if (g_fCtrlCPressed || g_fCBrkPressed)
+ {
+ g_fCtrlCPressed = g_fCBrkPressed = FALSE;
+ got_int = TRUE;
+ }
+#endif
+}
+
+
+/*
+ * How much memory is available?
+ * Return sum of available physical and page file memory.
+ */
+ long_u
+mch_avail_mem(
+ int special)
+{
+ MEMORYSTATUS ms;
+
+ ms.dwLength = sizeof(MEMORYSTATUS);
+ GlobalMemoryStatus(&ms);
+ return (long_u) (ms.dwAvailPhys + ms.dwAvailPageFile);
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Same code as below, but with wide functions and no comments.
+ * Return 0 for success, non-zero for failure.
+ */
+ int
+mch_wrename(WCHAR *wold, WCHAR *wnew)
+{
+ WCHAR *p;
+ int i;
+ WCHAR szTempFile[_MAX_PATH + 1];
+ WCHAR szNewPath[_MAX_PATH + 1];
+ HANDLE hf;
+
+ if (!mch_windows95())
+ {
+ p = wold;
+ for (i = 0; wold[i] != NUL; ++i)
+ if ((wold[i] == '/' || wold[i] == '\\' || wold[i] == ':')
+ && wold[i + 1] != 0)
+ p = wold + i + 1;
+ if ((int)(wold + i - p) < 8 || p[6] != '~')
+ return (MoveFileW(wold, wnew) == 0);
+ }
+
+ if (GetFullPathNameW(wnew, _MAX_PATH, szNewPath, &p) == 0 || p == NULL)
+ return -1;
+ *p = NUL;
+
+ if (GetTempFileNameW(szNewPath, L"VIM", 0, szTempFile) == 0)
+ return -2;
+
+ if (!DeleteFileW(szTempFile))
+ return -3;
+
+ if (!MoveFileW(wold, szTempFile))
+ return -4;
+
+ if ((hf = CreateFileW(wold, GENERIC_WRITE, 0, NULL, CREATE_NEW,
+ FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
+ return -5;
+ if (!CloseHandle(hf))
+ return -6;
+
+ if (!MoveFileW(szTempFile, wnew))
+ {
+ (void)MoveFileW(szTempFile, wold);
+ return -7;
+ }
+
+ DeleteFileW(szTempFile);
+
+ if (!DeleteFileW(wold))
+ return -8;
+
+ return 0;
+}
+#endif
+
+
+/*
+ * mch_rename() works around a bug in rename (aka MoveFile) in
+ * Windows 95: rename("foo.bar", "foo.bar~") will generate a
+ * file whose short file name is "FOO.BAR" (its long file name will
+ * be correct: "foo.bar~"). Because a file can be accessed by
+ * either its SFN or its LFN, "foo.bar" has effectively been
+ * renamed to "foo.bar", which is not at all what was wanted. This
+ * seems to happen only when renaming files with three-character
+ * extensions by appending a suffix that does not include ".".
+ * Windows NT gets it right, however, with an SFN of "FOO~1.BAR".
+ *
+ * There is another problem, which isn't really a bug but isn't right either:
+ * When renaming "abcdef~1.txt" to "abcdef~1.txt~", the short name can be
+ * "abcdef~1.txt" again. This has been reported on Windows NT 4.0 with
+ * service pack 6. Doesn't seem to happen on Windows 98.
+ *
+ * Like rename(), returns 0 upon success, non-zero upon failure.
+ * Should probably set errno appropriately when errors occur.
+ */
+ int
+mch_rename(
+ const char *pszOldFile,
+ const char *pszNewFile)
+{
+ char szTempFile[_MAX_PATH+1];
+ char szNewPath[_MAX_PATH+1];
+ char *pszFilePart;
+ HANDLE hf;
+#ifdef FEAT_MBYTE
+ WCHAR *wold = NULL;
+ WCHAR *wnew = NULL;
+ int retval = -1;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ {
+ wold = enc_to_ucs2((char_u *)pszOldFile, NULL);
+ wnew = enc_to_ucs2((char_u *)pszNewFile, NULL);
+ if (wold != NULL && wnew != NULL)
+ retval = mch_wrename(wold, wnew);
+ vim_free(wold);
+ vim_free(wnew);
+ if (retval == 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return retval;
+ /* Retry with non-wide function (for Windows 98). */
+ }
+#endif
+
+ /*
+ * No need to play tricks if not running Windows 95, unless the file name
+ * contains a "~" as the seventh character.
+ */
+ if (!mch_windows95())
+ {
+ pszFilePart = (char *)gettail((char_u *)pszOldFile);
+ if (STRLEN(pszFilePart) < 8 || pszFilePart[6] != '~')
+ return rename(pszOldFile, pszNewFile);
+ }
+
+ /* Get base path of new file name. Undocumented feature: If pszNewFile is
+ * a directory, no error is returned and pszFilePart will be NULL. */
+ if (GetFullPathName(pszNewFile, _MAX_PATH, szNewPath, &pszFilePart) == 0
+ || pszFilePart == NULL)
+ return -1;
+ *pszFilePart = NUL;
+
+ /* Get (and create) a unique temporary file name in directory of new file */
+ if (GetTempFileName(szNewPath, "VIM", 0, szTempFile) == 0)
+ return -2;
+
+ /* blow the temp file away */
+ if (!DeleteFile(szTempFile))
+ return -3;
+
+ /* rename old file to the temp file */
+ if (!MoveFile(pszOldFile, szTempFile))
+ return -4;
+
+ /* now create an empty file called pszOldFile; this prevents the operating
+ * system using pszOldFile as an alias (SFN) if we're renaming within the
+ * same directory. For example, we're editing a file called
+ * filename.asc.txt by its SFN, filena~1.txt. If we rename filena~1.txt
+ * to filena~1.txt~ (i.e., we're making a backup while writing it), the
+ * SFN for filena~1.txt~ will be filena~1.txt, by default, which will
+ * cause all sorts of problems later in buf_write. So, we create an empty
+ * file called filena~1.txt and the system will have to find some other
+ * SFN for filena~1.txt~, such as filena~2.txt
+ */
+ if ((hf = CreateFile(pszOldFile, GENERIC_WRITE, 0, NULL, CREATE_NEW,
+ FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE)
+ return -5;
+ if (!CloseHandle(hf))
+ return -6;
+
+ /* rename the temp file to the new file */
+ if (!MoveFile(szTempFile, pszNewFile))
+ {
+ /* Renaming failed. Rename the file back to its old name, so that it
+ * looks like nothing happened. */
+ (void)MoveFile(szTempFile, pszOldFile);
+
+ return -7;
+ }
+
+ /* Seems to be left around on Novell filesystems */
+ DeleteFile(szTempFile);
+
+ /* finally, remove the empty old file */
+ if (!DeleteFile(pszOldFile))
+ return -8;
+
+ return 0; /* success */
+}
+
+/*
+ * Get the default shell for the current hardware platform
+ */
+ char *
+default_shell()
+{
+ char* psz = NULL;
+
+ PlatformId();
+
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT) /* Windows NT */
+ psz = "cmd.exe";
+ else if (g_PlatformId == VER_PLATFORM_WIN32_WINDOWS) /* Windows 95 */
+ psz = "command.com";
+
+ return psz;
+}
+
+/*
+ * mch_access() extends access() to do more detailed check on network drives.
+ * Returns 0 if file "n" has access rights according to "p", -1 otherwise.
+ */
+ int
+mch_access(char *n, int p)
+{
+ HANDLE hFile;
+ DWORD am;
+ int retval = -1; /* default: fail */
+#ifdef FEAT_MBYTE
+ WCHAR *wn = NULL;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+ wn = enc_to_ucs2(n, NULL);
+#endif
+
+ if (mch_isdir(n))
+ {
+ char TempName[_MAX_PATH + 16] = "";
+#ifdef FEAT_MBYTE
+ WCHAR TempNameW[_MAX_PATH + 16] = L"";
+#endif
+
+ if (p & R_OK)
+ {
+ /* Read check is performed by seeing if we can do a find file on
+ * the directory for any file. */
+#ifdef FEAT_MBYTE
+ if (wn != NULL)
+ {
+ int i;
+ WIN32_FIND_DATAW d;
+
+ for (i = 0; i < _MAX_PATH && wn[i] != 0; ++i)
+ TempNameW[i] = wn[i];
+ if (TempNameW[i - 1] != '\\' && TempNameW[i - 1] != '/')
+ TempNameW[i++] = '\\';
+ TempNameW[i++] = '*';
+ TempNameW[i++] = 0;
+
+ hFile = FindFirstFileW(TempNameW, &d);
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ goto getout;
+
+ /* Retry with non-wide function (for Windows 98). */
+ vim_free(wn);
+ wn = NULL;
+ }
+ else
+ (void)FindClose(hFile);
+ }
+ if (wn == NULL)
+#endif
+ {
+ char *pch;
+ WIN32_FIND_DATA d;
+
+ STRNCPY(TempName, n, _MAX_PATH);
+ pch = TempName + STRLEN(TempName) - 1;
+ if (*pch != '\\' && *pch != '/')
+ *++pch = '\\';
+ *++pch = '*';
+ *++pch = NUL;
+
+ hFile = FindFirstFile(TempName, &d);
+ if (hFile == INVALID_HANDLE_VALUE)
+ goto getout;
+ (void)FindClose(hFile);
+ }
+ }
+
+ if (p & W_OK)
+ {
+ /* Trying to create a temporary file in the directory should catch
+ * directories on read-only network shares. However, in
+ * directories whose ACL allows writes but denies deletes will end
+ * up keeping the temporary file :-(. */
+#ifdef FEAT_MBYTE
+ if (wn != NULL)
+ {
+ if (!GetTempFileNameW(wn, L"VIM", 0, TempNameW))
+ {
+ if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ goto getout;
+
+ /* Retry with non-wide function (for Windows 98). */
+ vim_free(wn);
+ wn = NULL;
+ }
+ else
+ DeleteFileW(TempNameW);
+ }
+ if (wn == NULL)
+#endif
+ {
+ if (!GetTempFileName(n, "VIM", 0, TempName))
+ goto getout;
+ mch_remove((char_u *)TempName);
+ }
+ }
+ }
+ else
+ {
+ /* Trying to open the file for the required access does ACL, read-only
+ * network share, and file attribute checks. */
+ am = ((p & W_OK) ? GENERIC_WRITE : 0)
+ | ((p & R_OK) ? GENERIC_READ : 0);
+#ifdef FEAT_MBYTE
+ if (wn != NULL)
+ {
+ hFile = CreateFileW(wn, am, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (hFile == INVALID_HANDLE_VALUE
+ && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ /* Retry with non-wide function (for Windows 98). */
+ vim_free(wn);
+ wn = NULL;
+ }
+ }
+ if (wn == NULL)
+#endif
+ hFile = CreateFile(n, am, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ goto getout;
+ CloseHandle(hFile);
+ }
+
+ retval = 0; /* success */
+getout:
+#ifdef FEAT_MBYTE
+ vim_free(wn);
+#endif
+ return retval;
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Version of open() that may use ucs2 file name.
+ */
+ int
+mch_open(char *name, int flags, int mode)
+{
+ WCHAR *wn;
+ int f;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
+# ifdef __BORLANDC__
+ /* Wide functions of Borland C 5.5 do not work on Windows 98. */
+ && g_PlatformId == VER_PLATFORM_WIN32_NT
+# endif
+ )
+ {
+ wn = enc_to_ucs2(name, NULL);
+ if (wn != NULL)
+ {
+ f = _wopen(wn, flags, mode);
+ vim_free(wn);
+ if (f >= 0)
+ return f;
+ /* Retry with non-wide function (for Windows 98). Can't use
+ * GetLastError() here and it's unclear what errno gets set to if
+ * the _wopen() fails for missing wide functions. */
+ }
+ }
+
+ return open(name, flags, mode);
+}
+
+/*
+ * Version of fopen() that may use ucs2 file name.
+ */
+ FILE *
+mch_fopen(char *name, char *mode)
+{
+ WCHAR *wn, *wm;
+ FILE *f = NULL;
+
+ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
+# ifdef __BORLANDC__
+ /* Wide functions of Borland C 5.5 do not work on Windows 98. */
+ && g_PlatformId == VER_PLATFORM_WIN32_NT
+# endif
+ )
+ {
+ wn = enc_to_ucs2(name, NULL);
+ wm = enc_to_ucs2(mode, NULL);
+ if (wn != NULL && wm != NULL)
+ f = _wfopen(wn, wm);
+ vim_free(wn);
+ vim_free(wm);
+ if (f != NULL)
+ return f;
+ /* Retry with non-wide function (for Windows 98). Can't use
+ * GetLastError() here and it's unclear what errno gets set to if
+ * the _wfopen() fails for missing wide functions. */
+ }
+
+ return fopen(name, mode);
+}
+#endif
+
+#ifdef FEAT_MBYTE
+/*
+ * SUB STREAM (aka info stream) handling:
+ *
+ * NTFS can have sub streams for each file. Normal contents of file is
+ * stored in the main stream, and extra contents (author information and
+ * title and so on) can be stored in sub stream. After Windows 2000, user
+ * can access and store those informations in sub streams via explorer's
+ * property menuitem in right click menu. Those informations in sub streams
+ * were lost when copying only the main stream. So we have to copy sub
+ * streams.
+ *
+ * Incomplete explanation:
+ * http://msdn.microsoft.com/library/en-us/dnw2k/html/ntfs5.asp
+ * More useful info and an example:
+ * http://www.sysinternals.com/ntw2k/source/misc.shtml#streams
+ */
+
+/*
+ * Copy info stream data "substream". Read from the file with BackupRead(sh)
+ * and write to stream "substream" of file "to".
+ * Errors are ignored.
+ */
+ static void
+copy_substream(HANDLE sh, void *context, WCHAR *to, WCHAR *substream, long len)
+{
+ HANDLE hTo;
+ WCHAR *to_name;
+
+ to_name = malloc((wcslen(to) + wcslen(substream) + 1) * sizeof(WCHAR));
+ wcscpy(to_name, to);
+ wcscat(to_name, substream);
+
+ hTo = CreateFileW(to_name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ if (hTo != INVALID_HANDLE_VALUE)
+ {
+ long done;
+ DWORD todo;
+ DWORD readcnt, written;
+ char buf[4096];
+
+ /* Copy block of bytes at a time. Abort when something goes wrong. */
+ for (done = 0; done < len; done += written)
+ {
+ /* (size_t) cast for Borland C 5.5 */
+ todo = (size_t)(len - done) > sizeof(buf) ? sizeof(buf)
+ : (size_t)(len - done);
+ if (!BackupRead(sh, (LPBYTE)buf, todo, &readcnt,
+ FALSE, FALSE, context)
+ || readcnt != todo
+ || !WriteFile(hTo, buf, todo, &written, NULL)
+ || written != todo)
+ break;
+ }
+ CloseHandle(hTo);
+ }
+
+ free(to_name);
+}
+
+/*
+ * Copy info streams from file "from" to file "to".
+ */
+ static void
+copy_infostreams(char_u *from, char_u *to)
+{
+ WCHAR *fromw;
+ WCHAR *tow;
+ HANDLE sh;
+ WIN32_STREAM_ID sid;
+ int headersize;
+ WCHAR streamname[_MAX_PATH];
+ DWORD readcount;
+ void *context = NULL;
+ DWORD lo, hi;
+ int len;
+
+ /* Convert the file names to wide characters. */
+ fromw = enc_to_ucs2(from, NULL);
+ tow = enc_to_ucs2(to, NULL);
+ if (fromw != NULL && tow != NULL)
+ {
+ /* Open the file for reading. */
+ sh = CreateFileW(fromw, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (sh != INVALID_HANDLE_VALUE)
+ {
+ /* Use BackupRead() to find the info streams. Repeat until we
+ * have done them all.*/
+ for (;;)
+ {
+ /* Get the header to find the length of the stream name. If
+ * the "readcount" is zero we have done all info streams. */
+ ZeroMemory(&sid, sizeof(WIN32_STREAM_ID));
+ headersize = (char *)&sid.cStreamName - (char *)&sid.dwStreamId;
+ if (!BackupRead(sh, (LPBYTE)&sid, headersize,
+ &readcount, FALSE, FALSE, &context)
+ || readcount == 0)
+ break;
+
+ /* We only deal with streams that have a name. The normal
+ * file data appears to be without a name, even though docs
+ * suggest it is called "::$DATA". */
+ if (sid.dwStreamNameSize > 0)
+ {
+ /* Read the stream name. */
+ if (!BackupRead(sh, (LPBYTE)streamname,
+ sid.dwStreamNameSize,
+ &readcount, FALSE, FALSE, &context))
+ break;
+
+ /* Copy an info stream with a name ":anything:$DATA".
+ * Skip "::$DATA", it has no stream name (examples suggest
+ * it might be used for the normal file contents).
+ * Note that BackupRead() counts bytes, but the name is in
+ * wide characters. */
+ len = readcount / sizeof(WCHAR);
+ streamname[len] = 0;
+ if (len > 7 && wcsicmp(streamname + len - 6,
+ L":$DATA") == 0)
+ {
+ streamname[len - 6] = 0;
+ copy_substream(sh, &context, tow, streamname,
+ (long)sid.Size.LowPart);
+ }
+ }
+
+ /* Advance to the next stream. We might try seeking too far,
+ * but BackupSeek() doesn't skip over stream borders, thus
+ * that's OK. */
+ (void)BackupSeek(sh, sid.Size.LowPart, sid.Size.HighPart,
+ &lo, &hi, &context);
+ }
+
+ /* Clear the context. */
+ (void)BackupRead(sh, NULL, 0, &readcount, TRUE, FALSE, &context);
+
+ CloseHandle(sh);
+ }
+ }
+ vim_free(fromw);
+ vim_free(tow);
+}
+#endif
+
+/*
+ * Copy file attributes from file "from" to file "to".
+ * For Windows NT and later we copy info streams.
+ * Always returns zero, errors are ignored.
+ */
+ int
+mch_copy_file_attribute(char_u *from, char_u *to)
+{
+#ifdef FEAT_MBYTE
+ /* File streams only work on Windows NT and later. */
+ PlatformId();
+ if (g_PlatformId == VER_PLATFORM_WIN32_NT)
+ copy_infostreams(from, to);
+#endif
+ return 0;
+}
+
+#if defined(MYRESETSTKOFLW) || defined(PROTO)
+/*
+ * Recreate a destroyed stack guard page in win32.
+ * Written by Benjamin Peterson.
+ */
+
+/* These magic numbers are from the MS header files */
+#define MIN_STACK_WIN9X 17
+#define MIN_STACK_WINNT 2
+
+/*
+ * This function does the same thing as _resetstkoflw(), which is only
+ * available in DevStudio .net and later.
+ * Returns 0 for failure, 1 for success.
+ */
+ int
+myresetstkoflw(void)
+{
+ BYTE *pStackPtr;
+ BYTE *pGuardPage;
+ BYTE *pStackBase;
+ BYTE *pLowestPossiblePage;
+ MEMORY_BASIC_INFORMATION mbi;
+ SYSTEM_INFO si;
+ DWORD nPageSize;
+ DWORD dummy;
+
+ /* This code will not work on win32s. */
+ PlatformId();
+ if (g_PlatformId == VER_PLATFORM_WIN32s)
+ return 0;
+
+ /* We need to know the system page size. */
+ GetSystemInfo(&si);
+ nPageSize = si.dwPageSize;
+
+ /* ...and the current stack pointer */
+ pStackPtr = (BYTE*)_alloca(1);
+
+ /* ...and the base of the stack. */
+ if (VirtualQuery(pStackPtr, &mbi, sizeof mbi) == 0)
+ return 0;
+ pStackBase = (BYTE*)mbi.AllocationBase;
+
+ /* ...and the page thats min_stack_req pages away from stack base; this is
+ * the lowest page we could use. */
+ pLowestPossiblePage = pStackBase + ((g_PlatformId == VER_PLATFORM_WIN32_NT)
+ ? MIN_STACK_WINNT : MIN_STACK_WIN9X) * nPageSize;
+
+ /* On Win95, we want the next page down from the end of the stack. */
+ if (g_PlatformId == VER_PLATFORM_WIN32_WINDOWS)
+ {
+ /* Find the page that's only 1 page down from the page that the stack
+ * ptr is in. */
+ pGuardPage = (BYTE*)((DWORD)nPageSize * (((DWORD)pStackPtr
+ / (DWORD)nPageSize) - 1));
+ if (pGuardPage < pLowestPossiblePage)
+ return 0;
+
+ /* Apply the noaccess attribute to the page -- there's no guard
+ * attribute in win95-type OSes. */
+ if (!VirtualProtect(pGuardPage, nPageSize, PAGE_NOACCESS, &dummy))
+ return 0;
+ }
+ else
+ {
+ /* On NT, however, we want the first committed page in the stack Start
+ * at the stack base and move forward through memory until we find a
+ * committed block. */
+ BYTE *pBlock = pStackBase;
+
+ while (1)
+ {
+ if (VirtualQuery(pBlock, &mbi, sizeof mbi) == 0)
+ return 0;
+
+ pBlock += mbi.RegionSize;
+
+ if (mbi.State & MEM_COMMIT)
+ break;
+ }
+
+ /* mbi now describes the first committed block in the stack. */
+ if (mbi.Protect & PAGE_GUARD)
+ return 1;
+
+ /* decide where the guard page should start */
+ if ((long_u)(mbi.BaseAddress) < (long_u)pLowestPossiblePage)
+ pGuardPage = pLowestPossiblePage;
+ else
+ pGuardPage = (BYTE*)mbi.BaseAddress;
+
+ /* allocate the guard page */
+ if (!VirtualAlloc(pGuardPage, nPageSize, MEM_COMMIT, PAGE_READWRITE))
+ return 0;
+
+ /* apply the guard attribute to the page */
+ if (!VirtualProtect(pGuardPage, nPageSize, PAGE_READWRITE | PAGE_GUARD,
+ &dummy))
+ return 0;
+ }
+
+ return 1;
+}
+
+#endif
diff --git a/src/os_win32.h b/src/os_win32.h
new file mode 100644
index 000000000..d9aaa6e54
--- /dev/null
+++ b/src/os_win32.h
@@ -0,0 +1,190 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Win32 (Windows NT and Windows 95) machine-dependent things.
+ */
+
+#include "os_dos.h" /* common MS-DOS and Win32 stuff */
+#ifndef __CYGWIN__
+#include <direct.h> /* for _mkdir() */
+#endif
+
+#define BINARY_FILE_IO
+#define USE_EXE_NAME /* use argv[0] for $VIM */
+#define NO_COOKED_INPUT /* mch_inchar() doesn't return whole lines */
+#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
+#define USE_TERM_CONSOLE
+#ifndef HAVE_STRING_H
+# define HAVE_STRING_H
+#endif
+#define HAVE_STRCSPN
+#ifndef __GNUC__
+#define HAVE_STRICMP
+#define HAVE_STRNICMP
+#endif
+#ifndef HAVE_STRFTIME
+# define HAVE_STRFTIME /* guessed */
+#endif
+#define HAVE_MEMSET
+#ifndef HAVE_LOCALE_H
+# define HAVE_LOCALE_H 1
+#endif
+#ifndef HAVE_FCNTL_H
+# define HAVE_FCNTL_H
+#endif
+#ifndef HAVE_STDARG_H
+# define HAVE_STDARG_H
+#endif
+#define HAVE_QSORT
+#define HAVE_ST_MODE /* have stat.st_mode */
+
+#define FEAT_SHORTCUT /* resolve shortcuts */
+
+#if !defined(__MINGW32__) \
+ && !defined(__CYGWIN__) \
+ && (!defined(__BORLANDC__) || __BORLANDC__ >= 0x550) \
+ && (!defined(_MSC_VER) || _MSC_VER > 1020)
+/*
+ * Access Control List (actually security info).
+ * Mingw and Cygwin don't have the acl stuff.
+ * Borland only in version 5.5 and later.
+ * MSVC in 5.0, not in 4.2, don't know about 4.3.
+ */
+# define HAVE_ACL
+#endif
+
+#define USE_FNAME_CASE /* adjust case of file names */
+#if !defined(FEAT_CLIPBOARD) && defined(FEAT_VISUAL) && defined(FEAT_MOUSE)
+# define FEAT_CLIPBOARD /* include clipboard support */
+#endif
+#if defined(__DATE__) && defined(__TIME__)
+# define HAVE_DATE_TIME
+#endif
+#ifndef FEAT_GUI_W32 /* GUI works different */
+# define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */
+#endif
+#define HAVE_AVAIL_MEM
+
+#define HAVE_PUTENV /* at least Bcc 5.2 and MSC have it */
+
+#ifdef FEAT_GUI_W32
+# define NO_CONSOLE /* don't included console-only code */
+#endif
+
+/* toupper() is not really broken, but it's very slow. Probably because of
+ * using Unicode characters on Windows NT */
+#define BROKEN_TOUPPER
+
+#define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */
+
+#include <stdlib.h>
+#include <time.h>
+
+#ifndef STRICT
+# define STRICT
+#endif
+#ifndef COBJMACROS
+# define COBJMACROS /* For OLE: Enable "friendlier" access to objects */
+#endif
+#include <windows.h>
+
+/*
+ * Win32 has plenty of memory, use large buffers
+ */
+#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
+
+/* _MAX_PATH is only 256 (stdlib.h), but we want more for the 'path' option,
+ * thus use a larger number. */
+#define MAXPATHL 1024
+
+#ifndef BASENAMELEN
+# define BASENAMELEN (_MAX_PATH - 5) /* length of base of file name */
+#endif
+
+#define TEMPNAMELEN _MAX_PATH /* length of temp file name path */
+
+#ifndef DFLT_MAXMEM
+# define DFLT_MAXMEM (2*1024) /* use up to 2 Mbyte for a buffer */
+#endif
+
+#ifndef DFLT_MAXMEMTOT
+# define DFLT_MAXMEMTOT (5*1024) /* use up to 5 Mbyte for Vim */
+#endif
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+ /* Support for __try / __except. All versions of MSVC and Borland C are
+ * expected to have this. Any other compilers that support it? */
+# define HAVE_TRY_EXCEPT 1
+# include <malloc.h> /* for _resetstkoflw() */
+# if defined(_MSC_VER) && (_MSC_VER >= 1300)
+# define RESETSTKOFLW _resetstkoflw
+# else
+# define RESETSTKOFLW myresetstkoflw
+# define MYRESETSTKOFLW
+# endif
+#endif
+
+/*
+ * Some simple debugging macros that look and behave a lot like their
+ * namesakes in MFC.
+ */
+
+#ifdef _DEBUG
+
+# if defined(_MSC_VER) && (_MSC_VER >= 1000)
+ /* Use the new debugging tools in Visual C++ 4.x */
+# include <crtdbg.h>
+# define ASSERT(f) _ASSERT(f)
+# else
+# include <assert.h>
+# define ASSERT(f) assert(f)
+# endif
+
+# define VERIFY(f) ASSERT(f)
+# define DEBUG_ONLY(f) (f)
+# define TRACE Trace
+# define TRACE0(sz) Trace(_T("%s"), _T(sz))
+# define TRACE1(sz, p1) Trace(_T(sz), p1)
+# define TRACE2(sz, p1, p2) Trace(_T(sz), p1, p2)
+# define TRACE3(sz, p1, p2, p3) Trace(_T(sz), p1, p2, p3)
+# define TRACE4(sz, p1, p2, p3, p4) Trace(_T(sz), p1, p2, p3, p4)
+
+/* In debug version, writes trace messages to debug stream */
+void __cdecl
+Trace(char *pszFormat, ...);
+
+#else /* !_DEBUG */
+
+ /* These macros should all compile away to nothing */
+# define ASSERT(f) ((void)0)
+# define VERIFY(f) ((void)f)
+# define DEBUG_ONLY(f) ((void)0)
+# define TRACE 1 ? (void)0 : printf
+# define TRACE0(sz)
+# define TRACE1(sz, p1)
+# define TRACE2(sz, p1, p2)
+# define TRACE3(sz, p1, p2, p3)
+# define TRACE4(sz, p1, p2, p3, p4)
+
+#endif /* !_DEBUG */
+
+
+#define ASSERT_POINTER(p, type) \
+ ASSERT(((p) != NULL) && IsValidAddress((p), sizeof(type), FALSE))
+
+#define ASSERT_NULL_OR_POINTER(p, type) \
+ ASSERT(((p) == NULL) || IsValidAddress((p), sizeof(type), FALSE))
+
+#define mch_setenv(name, val, x) setenv(name, val, x)
+#define mch_getenv(x) (char_u *)getenv((char *)(x))
+#ifdef __BORLANDC__
+# define vim_mkdir(x, y) mkdir(x)
+#else
+# define vim_mkdir(x, y) _mkdir(x)
+#endif
diff --git a/src/osdef.sh b/src/osdef.sh
new file mode 100755
index 000000000..d7d4f2ac2
--- /dev/null
+++ b/src/osdef.sh
@@ -0,0 +1,99 @@
+#! /bin/sh
+#
+# osdef.sh -- copy osdef.h.in to osdef.h while removing declarations
+# found in the system header files. Caution: weird sed magic going on here.
+# Warnings are printed if sed did not survive.
+#
+# (C) Michael Schroeder, Juergen Weigert
+#
+# osdef.h.in has been split into osdef1.h.in and osdef2.h.in, because some
+# sed's could not handle the amount of commands (is 50 commands the limit?).
+#
+# 31.10.95 jw.
+
+if test -z "$CC"; then
+ CC=cc
+fi
+if test -z "$srcdir"; then
+ srcdir=.
+fi
+
+rm -f core* *.core
+
+cat << EOF > osdef0.c
+#ifndef __APPLE__
+# define select select_declared_wrong
+#endif
+#define tgetstr tgetstr_declared_wrong
+#include "auto/config.h"
+#include "os_unix.h" /* bring in most header files, more follow below */
+#include "os_unixx.h" /* bring in header files for os_unix.c */
+
+#ifdef HAVE_TERMCAP_H
+# include <termcap.h> /* only for term.c */
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* only used in a few files */
+#endif
+
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/types.h>
+# include <sys/statfs.h> /* only for memfile.c */
+#endif
+
+#ifdef HAVE_X11
+# include <X11/Intrinsic.h>
+#endif
+EOF
+
+# Mac uses precompiled headers, but we need real headers here.
+case `uname` in
+ Darwin) $CC -I. -I$srcdir -E -no-cpp-precomp osdef0.c >osdef0.cc;;
+ *) $CC -I. -I$srcdir -E osdef0.c >osdef0.cc;;
+esac
+
+# insert a space in front of each line, so that a function name at the
+# start of the line is matched with "[)*, ]\1[ (]"
+sed < osdef0.cc -e '/\(..*\)/s// \1/' > osdef0.ccc
+
+sed < $srcdir/osdef1.h.in -n -e '/^extern/s@.*[)* ][)* ]*\([a-zA-Z_][a-zA-Z0-9_]*\) __ARGS.*@/[)*, ][(]*\1[)]*[ (]/i\\\
+\\/\\[^a-zA-Z_\\]\1 __ARGS\\/d@p' > osdef11.sed
+
+sed < $srcdir/osdef2.h.in -n -e '/^extern/s@.*[)* ][)* ]*\([a-zA-Z_][a-zA-Z0-9_]*\) __ARGS.*@/[)*, ][(]*\1[)]*[ (]/i\\\
+\\/\\[^a-zA-Z_\\]\1 __ARGS\\/d@p' > osdef21.sed
+
+cat << EOF > osdef2.sed
+1i\\
+/*
+1i\\
+ * osdef.h is automagically created from osdef?.h.in by osdef.sh -- DO NOT EDIT
+1i\\
+ */
+EOF
+
+cat osdef0.ccc | sed -n -f osdef11.sed >> osdef2.sed
+sed -f osdef2.sed < $srcdir/osdef1.h.in > auto/osdef.h
+
+cat osdef0.ccc | sed -n -f osdef21.sed > osdef2.sed
+sed -f osdef2.sed < $srcdir/osdef2.h.in >> auto/osdef.h
+
+rm osdef0.c osdef0.cc osdef0.ccc osdef11.sed osdef21.sed osdef2.sed
+
+if test -f core*; then
+ file core*
+ echo " Sorry, your sed is broken. Call the system administrator."
+ echo " Meanwhile, you may try to compile Vim with an empty osdef.h file."
+ echo " If you compiler complains about missing prototypes, move the needed"
+ echo " ones from osdef1.h.in and osdef2.h.in to osdef.h."
+ exit 1
+fi
+cat $srcdir/osdef1.h.in $srcdir/osdef2.h.in >osdefX.h.in
+if eval test "`diff auto/osdef.h osdefX.h.in | wc -l`" -eq 4; then
+ echo " Hmm, sed is very pessimistic about your system header files."
+ echo " But it did not dump core -- strange! Let's continue carefully..."
+ echo " If this fails, you may want to remove offending lines from osdef.h"
+ echo " or try with an empty osdef.h file, if your compiler can do without"
+ echo " function declarations."
+fi
+rm osdefX.h.in
diff --git a/src/osdef1.h.in b/src/osdef1.h.in
new file mode 100644
index 000000000..fac78e001
--- /dev/null
+++ b/src/osdef1.h.in
@@ -0,0 +1,137 @@
+/* autoconf cannot fiddle out declarations. Use our homebrewn tools. (jw) */
+/*
+ * Declarations that may cause conflicts belong here so that osdef.sh
+ * can clean out the forest. Everything else belongs in os_unix.h
+ *
+ * How this works:
+ * - This file contains all unix prototypes that Vim might need.
+ * - The shell script osdef.sh is executed at compile time to remove all the
+ * prototypes that are in an include file. This results in osdef.h.
+ * - osdef.h is included in vim.h.
+ *
+ * sed cannot always handle so many commands, this is file 1 of 2
+ */
+
+extern int printf __ARGS((char *, ...));
+extern int fprintf __ARGS((FILE *, char *, ...));
+extern int sprintf __ARGS((char *, char *, ...));
+extern int sscanf __ARGS((char *, char *, ...));
+#ifndef fopen /* could be redefined to fopen64() */
+extern FILE *fopen __ARGS((const char *, const char *));
+#endif
+extern int fclose __ARGS((FILE *));
+extern int fseek __ARGS((FILE *, long, int));
+#ifdef HAVE_FSEEKO
+extern int fseeko __ARGS((FILE *, off_t, int));
+#endif
+extern long ftell __ARGS((FILE *));
+#ifdef HAVE_FTELLO
+extern off_t ftello __ARGS((FILE *));
+#endif
+extern void rewind __ARGS((FILE *));
+extern int fread __ARGS((char *, int, int, FILE *));
+extern int fwrite __ARGS((char *, int, int, FILE *));
+extern int fputs __ARGS((char *, FILE *));
+#ifndef ferror /* let me say it again: "macros should never have prototypes" */
+extern int ferror __ARGS((FILE *));
+#endif
+extern int fflush __ARGS((FILE *));
+#if defined(sun) || defined(_SEQUENT_)
+/* used inside of stdio macros getc(), puts(), putchar()... */
+extern int _flsbuf __ARGS((int, FILE *));
+extern int _filbuf __ARGS((FILE *));
+#endif
+
+#if !defined(HAVE_SELECT)
+struct pollfd; /* for poll __ARGS */
+extern int poll __ARGS((struct pollfd *, long, int));
+#endif
+
+#ifdef HAVE_MEMSET
+extern void *memset __ARGS((void *, int, size_t));
+#endif
+#ifdef HAVE_BCMP
+extern int bcmp __ARGS((void *, void *, size_t));
+#endif
+#ifdef HAVE_MEMCMP
+extern int memcmp __ARGS((const void *, const void *, size_t));
+#endif
+#ifdef HAVE_STRPBRK
+extern char *strpbrk __ARGS((const char *, const char *));
+#endif
+#ifdef USEBCOPY
+extern void bcopy __ARGS((char *, char *, int));
+#else
+# ifdef USEMEMCPY
+extern void memcpy __ARGS((char *, char *, int));
+# else
+# ifdef USEMEMMOVE
+extern void memmove __ARGS((char *, char *, int));
+# endif
+# endif
+#endif
+/* used inside of FD_ZERO macro: */
+extern void bzero __ARGS((void *, size_t));
+#ifdef HAVE_SETSID
+extern pid_t setsid __ARGS((void));
+#endif
+#ifdef HAVE_SETPGID
+extern int setpgid __ARGS((pid_t, pid_t));
+#endif
+#ifdef HAVE_STRTOL
+extern int strtol __ARGS((char *, char **, int));
+#endif
+#ifdef HAVE_STRFTIME
+extern size_t strftime __ARGS((char *, size_t, char *, struct tm *));
+#endif
+#ifdef HAVE_STRCASECMP
+extern int strcasecmp __ARGS((char *, char *));
+#endif
+#ifdef HAVE_STRNCASECMP
+extern int strncasecmp __ARGS((char *, char *, size_t));
+#endif
+#ifndef strdup
+extern char *strdup __ARGS((const char *));
+#endif
+extern int atoi __ARGS((char *));
+extern int atol __ARGS((char *));
+
+#ifndef USE_SYSTEM
+extern int fork __ARGS((void));
+extern int execvp __ARGS((const char *, const char **));
+extern int wait __ARGS((int *)); /* will this break things ...? */
+extern int waitpid __ARGS((pid_t, int *, int));
+#endif
+
+extern int toupper __ARGS((int));
+extern int tolower __ARGS((int));
+
+extern RETSIGTYPE (*signal __ARGS((int, RETSIGTYPE (*func) SIGPROTOARG))) __ARGS(SIGPROTOARG);
+#ifdef HAVE_SIGSET
+extern RETSIGTYPE (*sigset __ARGS((int, RETSIGTYPE (*func) SIGPROTOARG))) __ARGS(SIGPROTOARG);
+#endif
+
+#if defined(HAVE_SETJMP_H)
+# ifdef HAVE_SIGSETJMP
+extern int sigsetjmp __ARGS((sigjmp_buf, int));
+extern void siglongjmp __ARGS((sigjmp_buf, int));
+# else
+extern int setjmp __ARGS((jmp_buf));
+extern void longjmp __ARGS((jmp_buf, int));
+# endif
+#endif
+
+extern int kill __ARGS((int, int));
+
+extern int access __ARGS((char *, int));
+extern int fsync __ARGS((int));
+extern int fchown __ARGS((int, int, int));
+#if defined(HAVE_GETCWD) && !defined(sun)
+extern char *getcwd __ARGS((char *, int));
+#else
+extern char *getwd __ARGS((char *));
+#endif
+#ifndef __alpha /* suggested by Campbell */
+extern int ioctl __ARGS((int, int, ...));
+#endif
+extern int chmod __ARGS((const char *, mode_t));
diff --git a/src/osdef2.h.in b/src/osdef2.h.in
new file mode 100644
index 000000000..cca78b07c
--- /dev/null
+++ b/src/osdef2.h.in
@@ -0,0 +1,88 @@
+/*
+ * osdef2.h.in - See osdef1.h.in for a description.
+ */
+
+extern int remove __ARGS((const char *));
+extern int rename __ARGS((const char *, const char *));
+extern int free __ARGS((char *));
+extern char *malloc __ARGS((unsigned int));
+extern char *realloc __ARGS((char *, int));
+extern char *getenv __ARGS((char *));
+extern int setenv __ARGS((char *, char *, int));
+extern int putenv __ARGS((const char *));
+
+extern int gethostname __ARGS((char *, int));
+extern void perror __ARGS((char *));
+
+extern int sleep __ARGS((int));
+extern int usleep __ARGS((unsigned int));
+extern unsigned int alarm __ARGS((unsigned int));
+extern int chdir __ARGS((char *));
+extern int fchdir __ARGS((int));
+#ifndef stat /* could be redefined to stat64() */
+extern int stat __ARGS((const char *, struct stat *));
+#endif
+#ifndef lstat /* could be redefined to lstat64() */
+extern int lstat __ARGS((const char *, struct stat *));
+#endif
+extern int fstat __ARGS((int, struct stat *));
+extern int open __ARGS((const char *, int, ...));
+extern int close __ARGS((int));
+extern int read __ARGS((int, char *, size_t));
+extern int write __ARGS((int, char *, size_t));
+extern int pipe __ARGS((int *));
+extern off_t lseek __ARGS((int, off_t, int));
+extern void sync __ARGS((void));
+extern uid_t getuid __ARGS((void));
+extern gid_t getgid __ARGS((void));
+extern void qsort __ARGS((void *, size_t, size_t, int (*)(const void *, const void *)));
+
+extern int isatty __ARGS((int));
+extern int getpid __ARGS((void));
+extern int dup __ARGS((int));
+extern int unlink __ARGS((const char *));
+extern int link __ARGS((const char *, const char *));
+extern int mkdir __ARGS((const char *, mode_t));
+extern int rmdir __ARGS((const char *));
+
+extern int tgetent __ARGS((char *, char *));
+extern int tgetnum __ARGS((char *));
+extern int tgetflag __ARGS((char *));
+extern char *tgoto __ARGS((char *, int, int));
+extern int tputs __ARGS((char *, int, int (*)(int)));
+
+#ifdef HAVE_TERMIOS_H
+struct termios; /* for tcgetattr __ARGS */
+extern int tcgetattr __ARGS((int, struct termios *));
+extern int tcsetattr __ARGS((int, int, const struct termios *));
+#endif
+
+#ifdef HAVE_SYS_STATFS_H
+struct statfs; /* for fstatfs __ARGS */
+extern int fstatfs __ARGS((int, struct statfs *, int, int));
+#endif
+
+#ifdef HAVE_GETTIMEOFDAY
+struct timeval; /* for gettimeofday __ARGS */
+struct timezone; /* for gettimeofday __ARGS */
+extern int gettimeofday __ARGS((struct timeval *tp, struct timezone *tzp));
+extern time_t time __ARGS((time_t *));
+#endif
+
+#ifdef HAVE_GETPWNAM
+struct passwd; /* for getpwnam __ARGS */
+extern struct passwd *getpwnam __ARGS((const char *));
+#endif
+
+#ifdef USE_TMPNAM
+extern char *tmpnam __ARGS((char *));
+#else
+extern char *mktemp __ARGS((char *));
+#endif
+
+#ifdef ISC
+extern int _Xmblen __ARGS((char const *, size_t));
+#else
+ /* This is different from the header but matches mblen() */
+extern int _Xmblen __ARGS((char *, size_t));
+#endif
diff --git a/src/pathdef.sh b/src/pathdef.sh
new file mode 100755
index 000000000..b2a83a017
--- /dev/null
+++ b/src/pathdef.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+# pathdef.sh: adjust pathdef.c for auto/link.sed, if it exists
+#
+if test -s auto/link.sed; then
+ cp auto/pathdef.c auto/pathdef.tmp
+ sed -f auto/link.sed <auto/pathdef.tmp >auto/pathdef.c
+ rm -f auto/pathdef.tmp
+fi
+
+# vim:set sw=2 et:
diff --git a/src/po/Make_ming.mak b/src/po/Make_ming.mak
new file mode 100644
index 000000000..810efb036
--- /dev/null
+++ b/src/po/Make_ming.mak
@@ -0,0 +1,67 @@
+# Makefile for the Vim message translations for mingw32
+#
+# Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
+#
+# Read the README_ming.txt file before using it.
+#
+# Use at your own risk but with care, it could even kill your canary.
+#
+# Previous to all you must have the environment variable LANGUAGE set to your
+# language (xx) and add it to the next three lines.
+#
+
+LANGUAGES = af ca cs de en_GB es fr it ja ko no pl ru sk sv uk zh_TW \
+ zh_TW.UTF-8 zh_CN zh_CN.UTF-8
+MOFILES = af.mo ca.mo cs.mo de.mo en_GB.mo es.mo fr.mo it.mo ja.mo \
+ ko.mo no.mo pl.mo ru.mo sk.mo sv.mo uk.mo \
+ zh_TW.mo zh_TW.UTF-8.mo zh_CN.mo zh_CN.UTF-8.mo
+
+PACKAGE = vim
+
+# Uncomment one of the lines below or modify it to put the path to your
+# gettex binaries; I use the first
+#GETTEXT_PATH = C:/gettext.win32/bin/
+#GETTEXT_PATH = C:/gettext-0.10.35-w32/win32/Release/
+#GETTEXT_PATH = C:/cygwin/bin/
+
+MSGFMT = $(GETTEXT_PATH)msgfmt
+XGETTEXT = $(GETTEXT_PATH)xgettext
+MSGMERGE = $(GETTEXT_PATH)msgmerge
+
+MV = move
+CP = copy
+RM = del
+MKD = mkdir
+
+.SUFFIXES:
+.SUFFIXES: .po .mo .pot
+.PHONY: first_time all install clean $(LANGUAGES)
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+all: $(MOFILES)
+
+first_time:
+ $(XGETTEXT) --default-domain=$(LANGUAGE) \
+ --add-comments --keyword=_ --keyword=N_ $(wildcard ../*.c) ../if_perl.xs $(wildcard ../globals.h)
+
+$(LANGUAGES):
+ $(XGETTEXT) --default-domain=$(PACKAGE) \
+ --add-comments --keyword=_ --keyword=N_ $(wildcard ../*.c) ../if_perl.xs $(wildcard ../globals.h)
+ $(MV) $(PACKAGE).po $(PACKAGE).pot
+ $(CP) $@.po $@.po.orig
+ $(MV) $@.po $@.po.old
+ $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
+ $(RM) $@.po.old
+
+install:
+ $(MKD) $(VIMRUNTIME)\lang\$(LANGUAGE)
+ $(MKD) $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
+ $(CP) $(LANGUAGE).mo $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES\$(PACKAGE).mo
+
+clean:
+ $(RM) *.mo
+ $(RM) *.pot
+
+
diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak
new file mode 100644
index 000000000..b69b5abc5
--- /dev/null
+++ b/src/po/Make_mvc.mak
@@ -0,0 +1,62 @@
+# Makefile for the Vim message translations for MSVC
+# (based on make_ming.mak)
+#
+# Mike Williams <mrw@eandem.co.uk>
+#
+# Please read README_mvc.txt before using this file.
+#
+
+LANGUAGES = af ca cs de en_GB es fr it ja ko no pl ru sk sv uk zh_TW \
+ zh_TW.UTF-8 zh_CN zh_CN.UTF-8
+MOFILES = af.mo ca.mo cs.mo de.mo en_GB.mo es.mo fr.mo it.mo ja.mo \
+ ko.mo no.mo pl.mo ru.mo sk.mo sv.mo uk.mo \
+ zh_TW.mo zh_TW.UTF-8.mo zh_CN.mo zh_CN.UTF-8.mo
+
+PACKAGE = vim
+
+# Correct the following line for the installation directory of gettext
+GETTEXT_PATH = H:\gettext.win32.msvcrt\bin
+
+MSGFMT = $(GETTEXT_PATH)\msgfmt
+XGETTEXT = $(GETTEXT_PATH)\xgettext
+MSGMERGE = $(GETTEXT_PATH)\msgmerge
+
+MV = move
+CP = copy
+RM = del
+MKD = mkdir
+LS = dir
+
+LSFLAGS = /b /on /l /s
+
+INSTALLDIR = $(VIMRUNTIME)\lang\$(LANGUAGE)\LC_MESSAGES
+
+.SUFFIXES:
+.SUFFIXES: .po .mo .pot
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+all: $(MOFILES)
+
+files:
+ $(LS) $(LSFLAGS) ..\*.c ..\if_perl.xs ..\globals.h > .\files
+
+first_time: files
+ $(XGETTEXT) --default-domain=$(LANGUAGE) --add-comments --keyword=_ --keyword=N_ --files-from=.\files
+
+$(LANGUAGES): files
+ $(XGETTEXT) --default-domain=$(PACKAGE) --add-comments --keyword=_ --keyword=N_ --files-from=.\files
+ $(MV) $(PACKAGE).po $(PACKAGE).pot
+ $(CP) $@.po $@.po.orig
+ $(MV) $@.po $@.po.old
+ $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po
+ $(RM) $@.po.old
+
+install:
+ if not exist $(INSTALLDIR) $(MKD) $(INSTALLDIR)
+ $(CP) $(LANGUAGE).mo $(INSTALLDIR)\$(PACKAGE).mo
+
+clean:
+ $(RM) *.mo
+ $(RM) *.pot
diff --git a/src/po/Makefile b/src/po/Makefile
new file mode 100644
index 000000000..d54913062
--- /dev/null
+++ b/src/po/Makefile
@@ -0,0 +1,135 @@
+# Makefile for the Vim message translations.
+
+# TODO make this configurable
+# Note: ja.sjis, *.cp1250 and zh_CN.cp936 are only for MS-Windows, they are
+# not installed on Unix
+
+LANGUAGES = af ca cs de en_GB es fr it ja ko no pl ru sk sv uk zh_TW \
+ zh_TW.UTF-8 zh_CN zh_CN.UTF-8
+MOFILES = af.mo ca.mo cs.mo de.mo en_GB.mo es.mo fr.mo it.mo ja.mo \
+ ko.mo no.mo pl.mo ru.mo sk.mo sv.mo uk.mo \
+ zh_TW.mo zh_TW.UTF-8.mo zh_CN.mo zh_CN.UTF-8.mo
+
+PACKAGE = vim
+SHELL = /bin/sh
+
+# The OLD_PO_FILE_INPUT and OLD_PO_FILE_OUTPUT are for the new GNU gettext
+# tools 0.10.37, which use a slightly different .po file format that is not
+# compatible with Solaris (and old gettext implementations) unless these are
+# set. gettext 0.10.36 will not work!
+MSGFMT = OLD_PO_FILE_INPUT=yes msgfmt -v
+XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext
+MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge
+
+.SUFFIXES:
+.SUFFIXES: .po .mo .pot
+.PHONY: all install uninstall check clean distclean $(LANGUAGES)
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+all: $(MOFILES)
+
+install: $(MOFILES)
+ @$(MAKE) check
+ for lang in $(LANGUAGES); do \
+ dir=$(LOCALEDIR)/$$lang/; \
+ if test ! -x "$$dir"; then \
+ mkdir $$dir; chmod 755 $$dir; \
+ fi; \
+ dir=$(LOCALEDIR)/$$lang/LC_MESSAGES; \
+ if test ! -x "$$dir"; then \
+ mkdir $$dir; chmod 755 $$dir; \
+ fi; \
+ if test -r $$lang.mo; then \
+ $(INSTALL_DATA) $$lang.mo $$dir/$(PACKAGE).mo; \
+ chmod $(FILEMOD) $$dir/$(PACKAGE).mo; \
+ fi; \
+ done
+
+uninstall:
+ @$(MAKE) check
+ for cat in $(MOFILES); do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(LOCALEDIR)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
+ done
+
+converted: ja.sjis.mo cs.cp1250.mo pl.cp1250.mo sk.cp1250.mo zh_CN.cp936.mo \
+ ru.cp1251.mo
+
+# Convert ja.po to create ja.sjis.po. Requires doubling backslashes in the
+# second byte. Don't depend on sjiscorr, it should only be compiled when
+# ja.sjis.po is outdated.
+ja.sjis.po: ja.po
+ @$(MAKE) sjiscorr
+ rm -f ja.sjis.po
+ iconv -f euc-jp -t cp932 ja.po | ./sjiscorr > ja.sjis.po
+
+sjiscorr: sjiscorr.c
+ $(CC) -o sjiscorr sjiscorr.c
+
+# Convert cs.po to create cs.cp1250.po.
+cs.cp1250.po: cs.po
+ rm -f cs.cp1250.po
+ iconv -f iso-8859-2 -t cp1250 cs.po | \
+ sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from cs.po, DO NOT EDIT/' > cs.cp1250.po
+
+# Convert pl.po to create pl.cp1250.po.
+pl.cp1250.po: pl.po
+ rm -f pl.cp1250.po
+ iconv -f iso-8859-2 -t cp1250 pl.po | \
+ sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from pl.po, DO NOT EDIT/' > pl.cp1250.po
+
+# Convert sk.po to create sk.cp1250.po.
+sk.cp1250.po: sk.po
+ rm -f sk.cp1250.po
+ iconv -f iso-8859-2 -t cp1250 sk.po | \
+ sed -e 's/charset=ISO-8859-2/charset=cp1250/' -e 's/# Original translations/# Generated from sk.po, DO NOT EDIT/' > sk.cp1250.po
+
+# Convert zh_CN.po to create zh_CN.cp936.po.
+# set 'charset' to gbk to avoid that msfmt generates a warning
+zh_CN.cp936.po: zh_CN.po
+ rm -f zh_CN.cp936.po
+ iconv -f gb2312 -t cp936 zh_CN.po | \
+ sed -e 's/charset=gb2312/charset=gbk/' -e 's/# Original translations/# Generated from zh_CN.po, DO NOT EDIT/' > zh_CN.cp936.po
+
+# Convert ru.po to create ru.cp1251.po.
+ru.cp1251.po: ru.po
+ rm -f ru.cp1251.po
+ iconv -f koi8-r -t cp1251 ru.po | \
+ sed -e 's/charset=koi8-r/charset=cp1251/' -e 's/# Original translations/# Generated from ru.po, DO NOT EDIT/' > ru.cp1251.po
+
+check:
+ @if test "x" = "x$(prefix)"; then \
+ echo "******************************************"; \
+ echo " please use make from the src directory "; \
+ echo "******************************************"; \
+ exit 1; \
+ fi
+
+clean:
+ rm -f core core.* *.old.po *.mo *.pot sjiscorr
+
+distclean: clean
+
+#
+# NOTE: If you get an error for gvimext.cpp not found, you need to unpack the
+# extra archive.
+#
+$(PACKAGE).pot: ../*.c ../if_perl.xs ../GvimExt/gvimext.cpp ../globals.h
+ cd ..; $(XGETTEXT) --default-domain=$(PACKAGE) \
+ --add-comments --keyword=_ --keyword=N_ \
+ *.c if_perl.xs GvimExt/gvimext.cpp globals.h
+ mv -f ../$(PACKAGE).po $(PACKAGE).pot
+
+# Don't add a dependency here, we only want to update the .po files manually
+$(LANGUAGES):
+ @$(MAKE) $(PACKAGE).pot
+ if test ! -f $@.po.orig; then cp $@.po $@.po.orig; fi
+ mv $@.po $@.po.old
+ if $(MSGMERGE) $@.po.old $(PACKAGE).pot -o $@.po; then \
+ rm -f $@.po.old; \
+ else \
+ echo "msgmerge for $@.po failed!"; mv $@.po.old $@.po; \
+ fi
diff --git a/src/po/README.txt b/src/po/README.txt
new file mode 100644
index 000000000..b023ef364
--- /dev/null
+++ b/src/po/README.txt
@@ -0,0 +1,104 @@
+TRANSLATING VIM MESSAGES
+
+In this directory you will find xx.po files, where "xx" is a language code.
+Each file contains the translation of English Vim messages for one language.
+The files are in "po" format, used by the gettext package. Please refer to
+the gettext documentation for more information.
+
+The GNU gettext library, starting with version 0.10.37, supports converting
+messages from one encoding to another. This requires that it was compiled
+with HAVE_ICONV. The result is that the messages may be in any encoding
+supported by iconv and will be automatically converted to the currently used
+encoding.
+
+The GNU gettext library, starting with version 0.10.36, uses a new format for
+some encodings. This folows the C99 standard for strings. It means that when
+a multi-byte character includes the 0x5c byte, this is not recognized as a
+backslash. Since this format is incompatible with Solaris, Vim uses the old
+format. This is done by setting the OLD_PO_FILE_OUTPUT and OLD_PO_FILE_INPUT
+environment variables. When you use the Makefile in this directory that will
+be done for you. This does NOT work with gettext 0.10.36. Don't use it, get
+0.10.37.
+
+
+ON MS-WINDOWS
+
+The distributed files are generated on Unix, but this should also be possible
+on MS-Windows. Download the gettext packages, for example from:
+
+ http://sourceforge.net/projects/gettext
+
+You might have to do the commands manually. Example:
+
+ cd c:\vim\vim60
+ mkdir runtime\lang\ja\LC_MESSAGES
+ msgfmt -o runtime\lang\ja\LC_MESSAGES\vim.mo src\po\ja.po
+
+
+WHEN THERE IS A MISTAKE
+
+If you find there is a mistake in one of the translations, please report this
+to the maintainer of the translation. His/her E-mail address is in the
+comments at the start of the file. You can also see this with the ":messages"
+command in Vim when the translation is being used.
+
+
+CREATING A NEW PO FILE
+
+We will use "xx.po" as an example here, replace "xx" with the name of your
+language.
+
+- Edit Makefile to add xx to LANGUAGES and xx.mo to MOFILES.
+- Copy the header of an existing file, e.g., de.po, to xx.po. Do not copy any
+ of the translated messages, delete everything after the "msgstr".
+- The remaining work is like updating, see the next section.
+
+
+UPDATING A PO FILE
+
+If you are the maintainer of a .po file, this is how you update the file. We
+will use "xx.po" as an example here, replace "xx" with the name of your
+language.
+
+(1) Add new and changed messages from the Vim sources:
+
+ make xx
+
+ This will extract all the strings from Vim and merge them in with the
+ existing translations. Requires the GNU gettext utilities. Also requires
+ unpacking the extra archive.
+ Your original xx.po file will be copied to xx.po.orig
+
+ -- After you do this, you MUST do the next three steps! --
+
+(2) Translate
+ See the gettext documentation on how to do this. You can also find
+ examples in the other po files.
+ Search the po file for items that require translation:
+
+ /fuzzy\|^msgstr ""\(\n"\)\@!
+
+ Remove the "#, fuzzy" line after adding the translation.
+
+ There is one special message:
+ msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+ You should include your name and E-mail address instead, for example:
+ msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
+
+(3) Clean up
+ This is very important to make sure the translation works on all systems.
+ Comment-out all non-translated strings. There are two types:
+ - items marked with "#, fuzzy"
+ - items with an empty msgstr
+ You can do this with the cleanup.vim script:
+
+ :source cleanup.vim
+
+ Background: on Solaris an empty msgstr results in an empty message; GNU
+ gettext ignores empty strings and items marked with "#, fuzzy".
+
+(4) Check:
+
+ make xx.mo
+
+ Look out for syntax errors and fix them.
diff --git a/src/po/README_mingw.txt b/src/po/README_mingw.txt
new file mode 100644
index 000000000..7ba98e607
--- /dev/null
+++ b/src/po/README_mingw.txt
@@ -0,0 +1,101 @@
+TRANSLATING VIM MESSAGES
+
+This file explains how to create and maintain po files using
+gnu-gettext.win32, a MINGW32 Windows port of gettext by Franco Bez
+<franco.bez@gmx.de>. You can find it at:
+
+ http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
+
+First read the README.txt file for the general remarks
+
+
+The file that does the work is Make_ming.mak in the po directory. It is an
+adaptation of the Unix Makefile, but it does NOT test the presence of any po,
+pot, or mo files, so use it at your own risk but with care: it could even kill
+your canary. It has been tested by me several times (and with different
+languages) with success.
+
+The make utility must be run from the po directory.
+
+First of all you must set the enviroment variable LANGUAGE to xx, where xx is
+the name of your language. You can do it from the command line or adding a
+line to your autoexec.bat file: set LANGUAGE=xx. You must also add your
+language to the Make_ming.mak file in the lines LANGUAGES, MOFILES, AND
+POFILES.
+
+If you don't have a xx.po file, you must create it with the command:
+
+ make -f Make_ming.mak first_time
+
+This will produce a new brand xx.po file with all the messages in Vim ready
+for translation. Then you must source the cleanup.vim script from inside Vim;
+it will comment the untranslated messages (now, all). I recommend to use
+syntax highlighting so you can identify the untranslated messages easily.
+You also must remove the '..\' that prepends the name of the source files.
+(I don't no why, but make is unable to change the directory from po to src and
+back to po, so all the work must be done from the po dir, hence the '..\')
+
+Then you must go step (2) below.
+
+If you are updating a po file you must follow the next steps (they are nearly
+the same as in the Unix case, only the commands change):
+
+(1) Add new and changed messages from the Vim sources:
+
+ make -f Make_ming.mak xx
+
+ This will extract all the strings from Vim and merge them in with the
+ existing translations. Requires the GNU gettext utilities. Also requires
+ unpacking the extra archive.
+ Your original xx.po file will be copied to xx.po.orig
+
+ -- After you do this, you MUST do the next three steps! --
+
+(2) Translate
+ See the gettext documentation on how to do this. You can also find
+ examples in the other po files.
+ Search the po file for items that require translation:
+ /\#\~ and also the fuzzy translations, /\#, fuzzy
+ Remove "#~" and "#, fuzzy" after adding the translation.
+
+ There is one special message:
+ msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+ You should include your name and E-mail address instead, for example:
+ msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
+
+(3) Clean up
+ This is very important to make sure the translation works on all systems.
+ Comment-out all non-translated strings. There are two types:
+ - items marked with "#, fuzzy"
+ - items with an empty msgstr
+ You can do this with the cleanup.vim script:
+
+ :source cleanup.vim
+
+(4) Check:
+
+ make -f Make_ming.mak xx.mo
+
+ Look out for syntax errors and fix them.
+
+(5) This is an extra step, ;-). If you want the vim.mo file installed in your
+ system you must run:
+
+ make -f Make_ming.mak install
+
+ This will create the xx\LC_MESSAGES directory (if it does not exist) and
+ will copy vim.po to it.
+
+(6) Another extra step ;-)). The command:
+
+ make -f Make_ming.mak clean
+
+ will delete the temp files created during the process.
+
+Suggestions will be welcomed.
+
+Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
+
+Happy Vimming with NLS!!
+
+vim:tw=78:
diff --git a/src/po/README_mvc.txt b/src/po/README_mvc.txt
new file mode 100644
index 000000000..cd107debf
--- /dev/null
+++ b/src/po/README_mvc.txt
@@ -0,0 +1,94 @@
+TRANSLATING VIM MESSAGES
+
+This file explains how to create and maintain po files using
+gnu-gettext.win32, a Windows port of gettext by Franco Bez
+<franco.bez@gmx.de>. You can find it at:
+
+ http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
+
+First read the README.txt file in this directory for general remarks on
+translating Vim messages.
+
+
+SETUP
+
+Set the enviroment variable LANGUAGE to the language code for the language you
+are translating Vim messages to. Languagde codes are typically two characters
+and you can find a list of them at:
+
+ http://www.geocities.com/click2speak/languages.html
+
+The LANGUAGE environment variable can be set from the command line, by adding
+a line to your autoexec.bat file, or by defining a user variable from the
+Advanced tab in the System control panel.
+
+Next, edit Make_mvc.mak so that GETTEXT_PATH points the binary directory of
+the intallation.
+
+
+CREATING A NEW TRANSLATION
+
+When creating a new translation you must add your language code to the
+Make_mvc.mak file in the lines defining LANGUAGES and MOFILES. To create the
+initial .po file for your language you must use the command:
+
+ make -f make_mvc.mak first_time
+
+Note: You need to be in the po directory when using this makefile.
+
+Once you have your new .po file load it into Vim and source cleanup.vim, this
+will convert untranslated messages to comments. If you have syntax
+highlighting turned on then untranslated messages will stand out more easily.
+
+You will also need to edit the file names in the comments in the .po file.
+You need to remove the absolute directory specification (which has the form
+c:\vim61\src\). You can do this in Vim with the following command with the
+appropriate directory specfication for where you have installed the Vim
+source:
+
+ %s/c:\\vim61\\src\\//g
+
+
+UPDATING A TRANSLATION
+
+If there are new or changed messages in Vim that need translating, then the
+first thing to do is merge them into the existing translations. This is done
+with the following command:
+
+ nmake -f Make_mvc.mak xx.po
+
+where xx is the langauge code for the language needing translations. The
+original .po file is copied to xx.po.orig.
+
+
+DOING THE TRANSLATION
+
+Now that you have a .po file you can do the translations for all messages that
+need it. See README.txt for specific instructions.
+
+Once you have finished translating the messages you should make sure all
+non-translated strings are commented out. This can be done by sourcing
+cleanup.vim once again.
+
+
+CHECKING THE TRANSLATION
+
+Check the translation with the following command:
+
+ nmake -f make_mvc.mak xx.mo
+
+Correct any syntax errors reported. When there are no more errors, the
+translation is ready to be installed.
+
+
+INSTALLING THE TRANSLATION
+
+Install your translation with the following command:
+
+ nmake -f make_mvc.mak install
+
+This will create the xx\LC_MESSAGES directory in runtime\lang if it does not
+already exist.
+
+
+vim:tw=78:
diff --git a/src/po/af.po b/src/po/af.po
new file mode 100644
index 000000000..3828481f1
--- /dev/null
+++ b/src/po/af.po
@@ -0,0 +1,6244 @@
+# Afrikaans translation for Vim
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+# Danie Roux <droux@tuks.co.za>, 2001
+# Edited: Jean Jordaan (njj) <jean@upfrontsystems.co.za>, 10/01/2001
+# Edited by Danie on 10/31/2001
+#
+# njj: Save == Stoor. Write == Skryf.
+# njj: "deleted" == "geskrap"; "remove" == "verwyder"
+# njj: "source" == "uitvoer", want "sourced" lêers word uitgevoer
+# njj: "abort" == "staak"
+# close == sluit
+# Onseker:
+# X Display - vertoonskerm? (njj: ek dink dis reg.)
+# open vim in another GTK Widget - het vertaal as element (njj: OK, maar
+# 'n element is algemener as 'n widget: mens kry byvoorbeeld HTML
+# en XML elemente. Maar ek kan nie nou aan 'n spesifieker woord dink
+# nie.)
+# Printing aborted - drukkery gestaak? (njj: ek dink dis reg.)
+
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.0\n"
+"POT-Creation-Date: 2001-10-31 12:43+0200\n"
+"PO-Revision-Date: Wed Oct 31 13:41 SAST 2001\n"
+"Last-Translator: Danie Roux <droux@tuks.co.za>\n"
+"Language-Team: Danie Roux <droux@tuks.co.za>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO_8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Kan nie buffer toeken nie, program sluit..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Kan nie buffer toeken nie, gaan ander een gebruik..."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "Geen buffers is uitgelaai nie"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "Geen buffers is geskrap nie"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "Geen buffers is geskrap nie"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "1 buffer uitgelaai"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d buffers uitgelaai"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "1 buffer geskrap"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buffers geskrap"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "1 buffer geskrap"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d buffers geskrap"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: Geen veranderde buffer gevind nie"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: Daar is geen gelyste buffer nie"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Kan nie na buffer %ld gaan nie"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Kan nie verby laaste buffer gaan nie"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Kan nie vóór eerste buffer gaan nie"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr ""
+"E89: Buffer %ld nog ongestoor sedert vorige wysiging (gebruik ! om te dwing)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Kan nie laaste buffer uitlaai nie"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Waarskuwing: Lêerlys loop oor"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: buffer %ld kon nie gevind word nie"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Meer as een treffer vir %s"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Geen buffer wat by %s pas nie"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "reël %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer met hierdie naam bestaan alreeds"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [Gewysig]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[Ongewysig]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[Nuwe lêer]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[Leesfoute]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[lees alleen]"
+
+#: buffer.c:2510
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 reël --%d%%--"
+
+#: buffer.c:2510
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld reëls --%d%%--"
+
+#: buffer.c:2518
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "reël %ld van %ld --%d%%-- kolom "
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[Geen lêer]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "help"
+
+#: buffer.c:3151 screen.c:4671
+msgid "[help]"
+msgstr "[help]"
+
+#: buffer.c:3183 screen.c:4677
+msgid "[Preview]"
+msgstr "[Voorskou]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "Alles"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "Ond"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "Bo"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Buffer lys:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[Foutlys]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[Geen lêer]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Tekens ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "Tekens vir %s:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " reël=%ld id=%d naam=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Kan nie meer as %ld buffers 'diff' nie"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Kan nie 'diffs' skep nie "
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Laslap lêer"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: Kan nie 'diff' afvoer lees nie"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Huidige buffer is nie in 'diff' modus nie"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Geen ander buffer in 'diff' modus nie"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: Meer as twee buffers in 'diff' modus, weet nie watter een om te "
+"gebruik nie"
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Kan buffer %s nie vind nie"
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffer \"%s\" is nie in 'diff' modus nie"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: 'Escape' nie toegelaat in digraaf nie"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "Sleutelbindinglêer nie gevind nie"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :loadkeymap word buite 'n uitvoerlêer gebruik"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Sleutelwoord voltooiing (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X modus (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Sleutelwoord Lokale voltooiing (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Hele-reël voltooiing (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Lêernaam voltooiing (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Etiketvoltooiing (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Gidspatroon voltooiing (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Definisievoltooiing (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Woordeboekvoltooiing (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Tesourusvoltooiing (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Bevelreëlvoltooiing (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Het einde van paragraaf getref"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus' opsie is leeg"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "'dictionary' opsie is leeg"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Deursoek woordeboek: %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (invoeg) Rol (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (vervang) Rol (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "Soek vir: %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "Deursoek etikette."
+
+#: edit.c:3189
+msgid " Adding"
+msgstr " Word bygevoeg"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- Soekend..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "Terug by oorspronklike"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "Woord van ander reël"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "Die enigste treffer"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "treffer %d van %d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "treffer %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Onbekende veranderlike: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Ontbrekende hakies: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Geen veranderlike: \"%s\""
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Ontbrekende ':' na '?'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: Ontbrekende ')'"
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: Ontbrekende ']'"
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Opsienaam ontbreek: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Onbekende opsie: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Ontbrekende aanhalingsteken: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Ontbrekende aanhalingsteken: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Ongeldige parameters vir funksie %s"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Onbekende funksie: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Te veel parameters vir funksie: %s"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Te min parameters vir funksie: %s"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> word buite skripkonteks gebruik: %s"
+
+#: eval.c:3575
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld reëls: "
+
+#: eval.c:4690
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Kanselleer"
+
+#: eval.c:5513
+msgid "E240: No connection to Vim server"
+msgstr "E240: Geen verbinding met Vim bediener"
+
+#: eval.c:5603
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Kon bediener-terugvoer nie lees nie"
+
+#: eval.c:5628
+msgid "E258: Unable to send to client"
+msgstr "E258: Kan nie na kliënt stuur nie"
+
+#: eval.c:5669
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Kan nie na %s stuur nie"
+
+#: eval.c:5767
+msgid "(Invalid)"
+msgstr "(Ongeldig)"
+
+#: eval.c:6770
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Ongedefinieerde veranderlike: %s"
+
+#: eval.c:7468
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: Funksie %s bestaan alreeds, gebruik ! om te vervang"
+
+#: eval.c:7510
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Ongedefinieerde funksie: %s"
+
+#: eval.c:7523
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Ontbrekende '(': %s"
+
+#: eval.c:7555
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Ongeldige parameter: %s"
+
+#: eval.c:7641
+msgid "E126: Missing :endfunction"
+msgstr "E126: Ontbrekende ':endfunction'"
+
+#: eval.c:7720
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Kan funksie %s nie herdefinieer nie: Dit is in gebruik"
+
+#: eval.c:7777
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Funksienaam moet met 'n hoofletter begin: %s"
+
+#: eval.c:7783
+msgid "E129: Function name required"
+msgstr "E129: Funksienaam vereis"
+
+#: eval.c:7876
+msgid "function "
+msgstr "funksie "
+
+#: eval.c:7991
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Ongedefinieerde funksie: %s"
+
+#: eval.c:7996
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Kan funksie %s nie verwyder nie: Dit is in gebruik"
+
+#: eval.c:8043
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Funksieroepdiepte is groter as 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8094
+#, c-format
+msgid "calling %s"
+msgstr "roep %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8119 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "vervolg in %s"
+
+#: eval.c:8173
+msgid "E133: :return not inside a function"
+msgstr "E133: ':return' buite funksie"
+
+#: eval.c:8251
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s lewer #%ld op"
+
+#: eval.c:8254
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s lewer \"%s\" op"
+
+#: eval.c:8395
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globale veranderlikes:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktaal %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Skuif reëls in hulself in"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "1 reël geskuif"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld reëls geskuif"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld reëls filtreer"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Outobevele mag nie die huidige buffer verander nie"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Ongestoor sedert vorige verandering]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s in reël: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Te veel foute, slaan die res van die lêer oor"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Besig om viminfo lêer \"%s\"%s%s%s te lees"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " inligting"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " merkers"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " GEFAAL"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo lêer is nie skryfbaar nie: %s"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Kan nie viminfo lêer %s stoor nie!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Besig om viminfo lêer \"%s\" te stoor"
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Hierdie viminfo lêer is gegenereer deur Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Jy mag dit wysig as jy versigtig is!\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Waarde van 'encoding' toe hierdie lêer gestoor is\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Ongeldige beginkarakter"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Stoor As"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Lêer is gelaai in ander buffer"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Skryf gedeeltelike lêer?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Gebruik ! om gedeeltelike buffer te skryf"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Oorskryf bestaande lêer \"%.*s\"?"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Geen lêernaam vir buffer %ld nie"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Lêer nie gestoor nie: Stoor is afgeskakel deur die 'write' opsie"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"'readonly' opsie is aan vir \"%.*s\".\n"
+"Wil jy dit forseer?"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "Verander lêer"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Outobevele het nuwe buffer %s onverwags geskrap"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: nie-numeriese parameter vir :z"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Dop bevele nie toegelaat in rvim"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Patrone kan nie deur letters afgebaken word nie"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "vervang met %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(Onderbreek) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "1 vervanging"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld vervangings"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " op 1 reël"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " op %ld reëls"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Kan nie :global rekursief doen nie "
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Patroon ontbreek uit globaal"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Patroon gevind in elke reël: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Vorige Vervangstring:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Jammer, geen hulp vir %s nie"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Jammer, hulplêer \"%s\" kan nie gevind word nie"
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: Nie 'n gids nie: %s"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Kan nie %s oopmaak om te skryf nie"
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Kan nie %s oop maak om te lees nie"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplikaat etiket \"%s\" in lêer %s"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Onbekende funksie: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: Ontbrekende tekennaam"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E77: Te veel tekens gedefinieer"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Ongeldige tekenteks: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Onbekende opsie: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: Ontbrekende tekennommer"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Ongeldige buffernaam: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Ongeldige teken ID: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[Geskrap]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Ontfoutmodus begin nou. Tik \"cont\" om te verlaat."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "reël %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Inspeksiepunt in \"%s%s\" reël %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Inspeksiepunt kon nie gevind word nie: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Geen inspeksiepunte gedefinieer nie"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s reël %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Stoor veranderinge na \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "Ongetiteld"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" is nie geskryf sedert vorige wysiging nie"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Waarskuwing: Ander buffer onverwags betree (kyk na outobevele)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Daar is net een lêer om te bewerk"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Kan nie vóór die eerste lêer gaan nie"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Kan nie verby die laaste lêer gaan nie"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Besig om te soek vir \"%s\" in \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Besig om te soek vir \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "kon nie in 'runtimepath' gevind word nie: \"%s\""
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "Voer Makro uit"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Kan nie gids uitvoer nie: \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "kon nie \"%s\" uitvoer nie"
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "reël %ld: kon nie \"%s\" uitvoer nie"
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "besig om \"%s\" uit te voer"
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "reël %ld: voer nou \"%s\" uit"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "%s klaar uitgevoer"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Waarskuwing: Verkeerde reëlskeiding, ^M ontbreek dalk"
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: ':scriptencoding' buite 'n uitvoerlêer gebruik"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: ':finish' buite 'n uitvoerlêer gebruik"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "Geen teks om te druk nie"
+
+#: ex_cmds2.c:2898
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Druk nou bladsy %d (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopie %d van %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "Gedruk: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "Drukkery gestaak"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Kan nie na 'PostScript' afvoerlêer skryf nie"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Kan nie 'PostScript' afvoerlêer oopmaak nie"
+
+#: ex_cmds2.c:4057
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Kan nie lêer %s oopmaak nie"
+
+#: ex_cmds2.c:4068
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Kan nie 'PostScript' hulpbron-lêer \"%s\" lees nie"
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "Besig om te stuur na drukker..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Kon nie 'PostScript' lêer druk nie"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr "Druktaak gestuur."
+
+#: ex_cmds2.c:4651
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Huidige %staal: \"%s\""
+
+#: ex_cmds2.c:4658
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Kan nie taal na \"%s\" verander nie"
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Betree Ex modus. Tik \"visual\" om na Normale modus terug te keer."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "By lêereinde"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: Bevel te rekursief"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: Ontbrekende ':endwhile'"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: Ontbrekende ':endif'"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Einde van uitvoerlêer"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Einde van funksie "
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Dubbelsinnige gebruik van gebruiker-gedefinieerde bevel"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Nie 'n verwerkerbevel nie"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "Bly kalm!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Terugwaardse omvang gegee"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Terugwaardse omvang gegee, OK om te ruil"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Gebruik w of w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Jammer, die bevel is nie geïmplementeer nie"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: Slegs een lêernaam toegelaat"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Nog %d lêers om te bewerk. Stop in elk geval?"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Nog %ld lêers om te bewerk"
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Bevel bestaan alreeds: gebruik ! om te herdefinieer"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Naam Args Reeks Klaar Definisie"
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "Geen gebruiker-gedefinieerde bevele gevind nie"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: Geen eienskappe gespesifiseer nie"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Ongeldige aantal parameters"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Telling kan nie twee keer gespesifiseer word nie"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: Ongeldige verstekwaarde vir telling"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: parameter nodig vir voltooiing"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Ongeldige voltooiingswaarde: %s"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Ongeldige eienskap: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: Ongeldige bevelnaam"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Gebruiker-gedefinieerde bevele moet met 'n hoofletter begin"
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Geen gebruiker-gedefinieerde bevel nie: %s"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Kan nie kleurskema %s vind nie"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "Goeiedag, Vim gebruiker!"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "Bewerk lêer in nuwe venster"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "Geen ruillêer"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "Las aan by lêer"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: Geen vorige gids nie"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: Onbekend"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Vensterposisie: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: Verkryging van vensterposisie is nie vir hierdie platform "
+"geïmplementeer nie"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "Stoor Herversturing"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "Stoor Oorsig"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "Stoor Sessie"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "Stoor konfigurasie"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" bestaan (gebruik ! om te dwing)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Kan \"%s\" nie oopmaak vir skryf nie"
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr ""
+"E191: Parameter moet 'n letter of 'n terug/vorentoe aanhalingsteken wees"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursiewe gebruik van ':normal' te diep"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr "geneste ':if' te diep"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr "':endif' sonder ':if'"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr "':else' sonder ':if'"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr "':elseif' sonder ':if'"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr "':while' te diep genes"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr "':continue' sonder ':while'"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr "':break' sonder ':while'"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr "':endwhile' sonder ':while'"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: ':endfunction' nie in 'n funksie nie"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Geen alternatiewe lêernaam vir '#' nie"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "geen outobevel-lêernaam om \"<afile>\" mee te vervang nie"
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "geen outobevel buffernommer om \"<abuf>\" mee te vervang nie"
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr "geen outobevel treffernaam om \"<amatch>\" mee te vervang nie"
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "geen ':source' lêernaam om \"<sfile>\" mee te vervang nie"
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Leë lêernaam vir '%' of '#', werk slegs met \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "Evalueer na 'n leë string"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Kan 'viminfo' lêer nie oopmaak om te lees nie"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: Geen digrawe in hierdie weergawe nie"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "etiketnaam"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr " tipe lêer\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "'history' opsie is nul"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Geskiedenis (van nuutste na oudste):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "Bevelreël"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "Soekstring"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "Uitdrukking"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "Invoer Lyn"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: 'cmd_pchar' verby die einde van opdraglengte"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktiewe venster of buffer geskrap"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "Ongeldige lêernaam"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "is 'n gids"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "is nie 'n lêer nie"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[Nuwe lêer]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[Toestemming Geweier]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: '*ReadPre' outobevele het die lêer onleesbaar gemaak"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: '*ReadPre' outobevele mag nie die huidige buffer verander nie"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Lees nou vanaf 'stdin'...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "Lees nou vanaf stdin... "
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Omsetting het lêer onleesbaar gemaak!"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[CR ontbreek]"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[NL gevind]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[lang reëls verdeel]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[NIE omgesit nie]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[omgesit]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[gekodeer]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "[OMSETTINGSFOUT]"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[LEESFOUTE]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "Kan nie tydelike lêer vir omsetting vind nie"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "Omsetting met 'charconvert' het gefaal"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "kan afvoer van 'charconvert' nie lees nie"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Outobevele het die skryfbuffer geskrap of uitgelaai"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Outobevel het etlike reëls op onverwagse wyse verander "
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "is nie 'n lêer of 'n skryfbare toestel nie"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "is lees-alleen (gebruik ! om te dwing)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Kan nie na rugsteunlêer skryf nie (gebruik ! om te dwing)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "Sluitfout vir rugsteunlêer (gebruik ! om te dwing)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Kan rugsteunlêer nie lees nie (gebruik ! om te dwing)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Kan rugsteunlêer nie skep nie (gebruik ! om te dwing)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "Kan rugsteunlêer nie skep nie (gebruik ! om te dwing)"
+
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "Die hulpbronvurk sal verlore gaan (gebruik ! om te dwing)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Kan nie tydelike lêer vind vir skryf nie"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Kan nie omsit nie (gebruik ! om te skryf sonder omsetting)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Kan lêer nie oopmaak vir skryf nie"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: Kan lêer nie oopmaak vir skryf nie"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "Sluiting gefaal"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "skryffout, omsetting gefaal"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "skryffout (lêerstelsel vol?)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr " OMSETTINGSFOUT"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[Toestel]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[Nuut]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " bygevoeg"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " geskryf"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: kan oorspronklike lêer nie stoor nie"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: kan leë oorspronglêer nie 'touch' nie"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: Kan rugsteunlêer nie verwyder nie"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"WAARSKUWING: Oorspronklike lêer mag verlore of beskadig wees\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "moenie die verwerker verlaat voor die lêer suksesvol geskryf is nie!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos formaat]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac formaat]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix formaat]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 reël, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld reëls, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "1 karakter"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld karakters"
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[Onvoltooide laaste reël]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "WAARSKUWING: Die lêer het verander sedert dit gelees is!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "Wil jy regtig soontoe skryf?"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Kan nie skryf na \"%s\""
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Kan \"%s\" nie sluit nie"
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Kan \"%s\" nie lees nie"
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: 'FileChangedShell' outobevel het buffer verwyder"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Waarskuwing: Lêer \"%s\" is nie meer beskikbaar nie"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Waarskuwing: Lêer \"%s\" het verander sedert bewerking begin het en die "
+"buffer in Vim het ook verander"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Waarskuwing: Lêer \"%s\" het verander sedert bewerking begin het"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: Waarskuwing: Modus van lêer \"%s\" het verander sedert bewerking begin "
+"het"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Waarskuwing: Lêer \"%s\" is geskep sedert bewerking begin het"
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "Waarskuwing"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Laai Lêer"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Kon nie \"%s\" herlaai nie"
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--Geskrap--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Geen sodanige groep nie: \"%s\""
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Ongeldige karakter na *: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Geen sodanige gebeurtenis nie: %s"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Outobevele ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Kan nie outobevele uitvoer vir 'ALL' gebeurtenisse nie"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "Geen passende outobevele nie"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: outobevele te diep genes"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s outobevele vir \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "Voer %s uit"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "outobevel %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: Ontbrekende {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: Ontbrekende }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "Geen vou gevind nie"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Kan nie vou skep met huidige 'foldmethod' nie"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Kan nie vou skrap met huidige 'foldmethod' nie"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: 'commentstring' opsie is leeg"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: Voeg by leesbuffer"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: rekursiewe binding"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: globale afkorting bestaan alreeds vir %s"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: globale binding bestaan alreeds vir %s"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: afkorting bestaan already vir %s"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: binding bestaan alreeds vir %s"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "Geen afkorting gevind nie"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "Geen binding gevind nie"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Ongeldige modus"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Kan nie die GUI begin nie"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Kan nie lees uit \"%s\" nie"
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ongeldig"
+
+#: gui.c:3926
+msgid "Error"
+msgstr "Fout"
+
+#: gui.c:3927
+msgid "&Ok"
+msgstr "&Ok"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<kan nie oopmaak nie> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "'vim_SelFile': kan font %s nie kry nie"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "'vim_SelFile': Kan nie terugkeer na huidige gids nie"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Gidsnaam:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: Kan nie huidige gids verkry nie"
+
+#: gui_at_fs.c:2571 gui_motif.c:1607
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "Kanselleer"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Rolstaafelement: Kon nie pikselmatriks-duimnael se geometrie kry nie"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim dialooghokkie"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Kan nie BalloonEval skep met beide boodskap en terugroep nie"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim dialooghokkie..."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Soek en Vervang..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - Soek..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "Soek na:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "Vervang met:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "Tref slegs presiese woord"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "Rigting"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "Op"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "Af"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "Vind volgende"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "Vervang"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "Vervang alles"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: kan nie vertoonskerm oopmaak nie"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:2002
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Onbekende fontstel: %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "Fontkeuse"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1838
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Onbekende font: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1862
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Font \"%s\" is nie 'n vaste-wydte font nie"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: Kleurnaam is onbekend: %s"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "'CUT_BUFFER0' is gebruik in plaas van leë seleksie"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "Gidse"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "Hulp"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "Lêers"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "Seleksie"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "Herroep"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Kan nie Zap font '%s' laai nie"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Kan nie font %s gebruik nie"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: Ontbrekende kleur: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Besig om doodsboodskap aan kindproses te stuur.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Parameter nie bekend: \"-%s\"; Gebruik die OLE weergawe."
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Vind string (gebruik '\\\\' om 'n '\\' te vind"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Vind & vervang string (gebruik '\\\\' om 'n '\\' te vind"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Kan nie kleurkaart-inskrywing toeken nie, sommige kleure mag "
+"verkeerd wees"
+
+#: gui_x11.c:1992
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr ""
+"E250: Fonte vir die volgende karakterstelle ontbreek in fontversameling %s:"
+
+#: gui_x11.c:2035
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Fontstel naam: %s"
+
+#: gui_x11.c:2036
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Font '%s' is nie 'n vaste-wydte font nie"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Fonstel naam: %s\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2058
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Font%d wydte is nie twee keer díe van font0 nie\n"
+
+#: gui_x11.c:2059
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Font0 wydte: %ld\n"
+
+#: gui_x11.c:2060
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Font1 wydte: %ld\n"
+"\n"
+
+#: gui_x11.c:2206
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Kan nie kleur %s toeken nie"
+
+#: gui_x11.c:3256
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Fout -- kon nie tekendata lees nie!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul outomatiserings FOUT"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr "Gebruik: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Voeg 'n nuwe databasis by"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "Soek vir 'n patroon"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Wys hierdie boodskap"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Sluit 'n verbinding"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Herstel alle verbindings"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Wys verbindings"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr ""
+"Hierdie 'cscope' bevel ondersteun nie die splitsing van die venster nie.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Gebruik: 'cstag <ident>'"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: 'cstag': etiket nie gevind nie"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "'stat(%s)' fout: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "'cscope' databasis %s bygevoeg"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s is nie 'n gids of 'n geldige 'cscope' databasis nie"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "'cscope' verbinding %d kon nie gelees word nie"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "onbekende 'cscope' soektipe"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "Kon nie 'cscope' pype skep nie"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "'cs_create_connection' uitvoering het misluk"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "'cs_create_connection': 'fdopen' vir 'to_fp' het misluk"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "'cs_create_connection': 'fdopen' vir 'fr_fp' het misluk"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "geen 'cscope' verbindings nie"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: geen treffers gevind vir 'cscope' versoek %s van %s nie"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "'cscope' bevele:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Gebruik: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "duplikaat 'cscope' databasis nie bygevoeg nie"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "maksimum aantal 'cscope' verbindings bereik"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: 'cscope' verbinding nie gevind nie"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: 'cscope' verbinding %s nie gevind nie"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "'cscope' verbinding gesluit"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "'cscope' verbinding %s gesluit\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "fatale fout in 'cs_manage_matches'"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: 'cscope' verbinding %d kon nie gelees word nie"
+
+# njj: dalk 'verbinding' ipv 'verbinding' orals?
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "kon nie 'malloc' nie\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope etiket: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # reël"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "lêernaam / konteks / reël\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "Alle 'cscope' databasisse herstel"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "geen 'cscope' verbindings nie\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid databasis naam gidsvoorvoegsel\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <geen>\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Jammer, hierdie bevel is afgeskakel, die Python biblioteek lêer kon "
+"nie gelaai word nie."
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "kan nie 'OutputObject' eienskappe skrap nie"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "'softspace' moet 'n heelgetal wees"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "ongeldige eienskap"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "'writelines()' benodig 'n lys van stringe"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Kon nie I/O objekte inwy nie"
+
+# njj: net 'n voorstel ..
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "ongeldige uitdrukking"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "uitdrukkings afgeskakel tydens kompilering"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "poging om na 'n geskrapte buffer te verwys"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "reëlnommer buite omvang"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffervoorwerp (geskrap) by %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "onbekende merknaam"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "buffer bestaan nie"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "poging om na geskrapte venster te verwys"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "leesalleen eienskap"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "loperposisie buite buffer"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<venster voorwerp (geskrap) by %.8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<verwyder voorwerp (onbekend) by %.8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<venster %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "geen sodanige venster nie"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "kan nie herwin-inligting stoor nie"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "kan reël nie verwyder nie"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "kan reël nie vervang nie"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "kan reël nie byvoeg nie"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "string kan nie 'newlines' bevat nie"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Jammer, hierdie bevel is afgeskakel, die Ruby biblioteeklêer kon nie "
+"gelaai word nie."
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Onbekende 'longjmp' status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Stel en herstel implimentasie/definisie"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Wys basisklas van"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Wys vervangde lidfunksie"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Gaan haal uit lêer"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Gaan haal uit projek"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Gaan haal uit alle projekte"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Gaan haal"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Wys kode van"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Vind simbool"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Kyk klas deur"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Wys klas in hiërargie"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Wys klas in beperkte hiërargie"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref verwys na"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref verwys deur"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref het 'n"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref gebruik deur"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Wys 'docu' van"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Genereer 'docu' vir"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Kan nie 'n verbinding met 'SNiFF+' maak nie. Kyk of die omgewing reg is "
+"('sniffemacs' moet in '$PATH' gevind word).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Fout gedurende lees. Verbinding gebreek"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ is tans"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "nie "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "gekonnekteer"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Onbekende SNiFF+ versoek: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Fout in konnekteer met SNiFF+"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ is nie gekonnekteer nie"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Nie 'n SNiFF+ buffer nie"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Fout gedurende stoor. Verbinding gebreek"
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "ongeldige buffernommer"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "nog nie geïmplementeer nie"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "onbekende opsie"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "kan nie reël(s) stel nie"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "merker nie gestel nie"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "ry %d kolom %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "kan nie reël invoeg/aanlas nie"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "onbekende vlag: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "onbekende 'vimOption'"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "sleutelbordonderbreking"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "vim fout"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "kan nie buffer/venster bevel skep nie: voorwerp word geskrap"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"kan nie terugroepbevel registreer nie: buffer/venster word alreeds geskrap"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATALE FOUT: verwlys korrup!? Rapporteer dit asb. aan <vim-dev@vim."
+"org>"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"kan terugroepbevel nie registreer nie: buffer/vensterverwysing nie gevind nie"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"Jammer, hierdie bevel is afgeskakel, die Tcl biblioteek kon nie gelaai "
+"wordnie."
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL FOUT: verlaatkode is nie 'n 'int'!? Rapporteer dit asb. aan <vim-"
+"dev@vim.org>"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "kan nie reël kry nie"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "Kon nie bevelbediener naam registreer nie"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: geen geregistreerde bediener genaamd \"%s\""
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Het gefaal om bevel na doel program te stuur"
+
+#: if_xcmdsrv.c:714
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Ongeldige bediener-id gebruik: %s"
+
+#: if_xcmdsrv.c:1061
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: kon nie VIM instansie register-kenmerk lees nie"
+
+#: if_xcmdsrv.c:1072
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM instansie register-kenmerk is swak gevorm. Geskrap!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Onbekende opsie"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Te veel redigeer-parameters"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Parameter ontbreek na"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Gemors na opsie"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Te veel \"+command\" of \"-c command\" parameters"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Ongeldige parameter vir"
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Hierdie Vim is nie gekompileer met 'diff' funksionaliteit nie."
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "Probeer weer om skriplêer oop te maak: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "Kan nie oopmaak om te lees nie: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "Kan nie oopmaak vir skrip-afvoer nie: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d lêers om te bewerk\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Waarskuwing: Afvoer gaan nie na 'n terminaal nie\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Waarskuwing: Invoer kom nie vanaf 'n terminaal nie\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "vóór-'vimrc' bevelreël"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Kan nie lees uit \"%s\" nie"
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Meer inligting met: \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[lêer ..] bewerk lêer(s)"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- lees teks uit 'stdin'"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag bewerk lêer waar etiket gedefinieer is"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [foutlêer] bewerk lêer met eerste fout"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"gebruik:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr " vim [parameters] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" of:"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Parameters:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tSlegs lêername hierna"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistreer hierdie gvim vir OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tOnregistreer gvim vir OLE"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tVoer uit met die GUI (soos \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tVoorgrond: Moenie vurk wanneer GUI begin nie"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi modus (soos \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx modus (soos \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tStil (bondel) modus (slegs vir \"ex\")"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff modus (soos \"vimdiff\")"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tEasy modus (soos \"evim\", modusloos)"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tLeesalleen modus (soos \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tBeperkte modus (soos \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tVeranderings (skryf van lêers) nie toegelaat nie"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tVeranderings aan teks nie toegelaat nie"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinêre modus"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp modus"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tVersoenbaar met Vi: 'compatible'"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tNie ten volle Vi-versoenbaar nie: 'nocompatible'"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tOmslagtigheidsgraad"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tOntfoutmodus"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tGeen ruillêer, gebruik slegs geheue"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tLys ruillêers en verlaat vim"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (met lêer naam)\tHerwin ineengestorte sessie"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tSelfde as -r"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tMoet nie 'newcli' gebruik om venster oop te maak nie"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <toestel>\t\tGebruik <toestel> vir I/O"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tbegin in Hebreeuse modus"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tbegin in Farsi modus"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminaal>\tStel terminaaltipe na <terminaal>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tGebruik <vimrc> in plaas van enige ander .vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tGebruik <gvimrc> in plaas van enige .gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tMoet nie inpropskripte laai nie"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tMaak N vensters oop (verstek: een vir elke lêer)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tsoos -o maar verdeel vertikaal"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tBegin by einde van lêer"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tBegin by reël <lnum>"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <bevel>\tVoer <bevel> uit voor enige .vimrc-lêer gelaai word"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <bevel>\t\tVoer <bevel> uit na eerste lêer gelaai is"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr ""
+"-S <sessie>\t\tVoer bevele in lêer <sessie> uit na eerste lêer gelaai is"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <skripin>\t\tLees Normale-modus bevele van lêer <skripin>"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <skripuit>\tLas alle getikte bevele aan by lêer <skripuit>"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <skripuit>\tSkryf alle getikte bevele na lêer <skripuit>"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tBewerk geënkripteerde lêers"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tKoppel vim aan hierdie X-bediener"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tMoet nie verbinding met X-bediener maak nie"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tMaak Vim in 'n ander GTK element oop"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <lêers>\tWysig die <lêers> in a Vim bediener en verlaat"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <lêers> Soos '--remote', maar wag vir lêers om gewysigte word"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr ""
+"--remote-send <sleutels>\tStuur <sleutels> na 'n Vim-bediener en verlaat"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <expr>\tEvalueer <expr> in 'n Vim-bediener en druk resultaat"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tLys beskikbare Vim-bediener name en verlaat"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <naam>\tStuur na/word die Vim-bediener <naam>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tGebruik <viminfo> in plaas van .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tskryf Hulp (hierdie boodskap) en sluit"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tskryf weergawe-inligting en sluit"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Parameters deur gvim herken (Motif weergawe):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Parameters deur gvim herken (Athena weergawe):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tVoer vim op <display> uit"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tBegin vim as ikoon"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tGebruik hulpbron asof vim <name> was"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Nog nie geïmplementeer nie)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <kleur>\tGebruik <kleur> vir die agtergrond (ook: -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-voorgrond <kleur>\tGebruik <kleur> vir normale teks (ook: -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tGebruik <font> vir normale teks (ook -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "­boldfont <font>\t Gebruik <font> vir vetletter teks"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tGebruik <font> vir kursiewe teks"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tGebruik <geom> vir aanvanklike geometrie"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <wydte>\tGebruik 'n grenswydte van <wydte> (ook: -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <wydte>\tGebruik 'n rolstaafwydte van <wydte> (ook: -sw>"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr ""
+"-menuheight <hoogte>\tGebruik a kieslysstaafhoogte van <hoogte> (ook: -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tGebruik tru-video (ook: -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tMoet nie tru-video gebruik nie (ook: +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <hulpbron>\tStel die gespesifiseerde hulpbron"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Parameters wat gvim verstaan (RISC OS weergawe):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <aantal>\tAanvanklike wydte van venster in kolomme"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <aantal>\tAanvanklike hoogte van venster in rye"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Parameters wat gvim verstaan (GTK+ weergawe):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <skerm>\tVoer vim op <skerm> uit: (ook --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tWys Gnome parameters"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Stuur het gefaal.\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Stuur het gefaal. Probeer om lokaal uit te voer\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d van %d lêers bewerk"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "Stuur van uitdrukking het gefaal.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Geen merkers gestel nie"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Geen merkers pas op \"%s\" nie"
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"merk reël kol lêer/teks"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" spring reël kol lêer/teks"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Lêermerkers:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Springlys (nuutste eerste):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Geskiedenis van merkers in lêers (nuutste tot oudste):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "Ontbrekende '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Nie 'n geldige kodeblad nie"
+
+#: mbyte.c:3014
+msgid "E284: Cannot set IC values"
+msgstr "E284: Kan nie IC waardes stel nie"
+
+#: mbyte.c:3166
+msgid "E285: Failed to create input context"
+msgstr "E285: Gefaal met die skep van invoerkonteks"
+
+#: mbyte.c:3313
+msgid "E286: Failed to open input method"
+msgstr "E286: Gefaal om invoermetode oop te maak"
+
+#: mbyte.c:3324
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Waarskuwing: Kon nie uitwis-terugroep na IM stel nie"
+
+#: mbyte.c:3330
+msgid "E288: input method doesn't support any style"
+msgstr "E288: invoermetode ondersteun geen styl nie"
+
+#: mbyte.c:3387
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: invoermetode ondersteun nie my voor-bewerking tipe nie"
+
+#: mbyte.c:3461
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: oor-die-plek styl vereis fontstel"
+
+#: mbyte.c:3489
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Jou GTK+ is ouer as 1.2.3. Statusarea afgeskakel"
+
+#: mbyte.c:3726
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Invoermetodebediener voer nie uit nie"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: blok was nie gesluit nie"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Soekfout in lees van ruillêer"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: Leesfout in ruillêer"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Soekfout in skryf van ruillêer"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: Skryffout in ruillêer"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Ruillêer bestaan alreeds! ('symlink' probleem?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Het nie blok no 0 gekry nie?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Het nie blok no 1 gekry nie?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Het nie blok no 2 gekry nie?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Hiert, die ruillêer is weg!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Kon nie ruillêer vernoem nie"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Kon nie ruillêer oopmaak vir \"%s\" nie, herwinning onmoontlik"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: 'ml_timestamp': Het nie blok 0 gekry nie??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Geen ruillêer gevind vir %s nie"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Tik die nommer van die ruillêer om te gebruik (0 om te stop)"
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Kan %s nie oopmaak nie"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Kan nie blok 0 lees vanaf "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Vim het die ruillêer nie opgedateer nie. Dalk was niks verander nie."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " kan nie gebruik word met hierdie weergawe van Vim nie.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Gebruik Vim weergawe 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s lyk nie soos 'n Vim ruillêer nie"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " kan nie gebruik word op hierdie rekenaar nie.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Die lêer is geskep op "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"of die lêer is beskadig."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Gebruik ruillêer \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Oorspronklike lêer \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Waarskuwing: Oorspronklike lêer is dalk gewysig"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Kan nie block 1 lees van %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???BAIE REËLS WEG"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???REËLTELLING FOUTIEF"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???LEË BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???REËLS WEG"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: Blok 1 se ID is foutief (%s nie 'n .swp lêer nie?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???BLOK WEG"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? van hier tot ???END mag reëls deurmekaar wees"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? van hier tot ???END mag daar reëls ingevoeg/geskrap wees"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Herwinning onderbreek"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Foute raakgesien gedurende herwinning; soek vir reëls wat begin met ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Herwinning is klaar. Kyk of alles reg is."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Jy wil dalk die lêer stoor onder 'n ander naam\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "en dit \"diff\" teen die oorspronklike lêer om wysigings te soek)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Verwyder die .swp-lêer na die tyd.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Ruillêers gevind:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " In huidige gids:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Wat gespesifiseerde naam gebruik:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " In gids "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- geen --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " eienaar: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " gedateer: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " gedateer: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [van Vim weergawe 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [lyk nie soos 'n Vim ruillêer nie]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " lêernaam: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" gewysig: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "JA"
+
+#: memline.c:1524
+msgid "no"
+msgstr "nee"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" gebruikersnaam: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " gasheernaam: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" gasheernaam: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" proses ID: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (nog steeds aan die uitvoer)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nie bruikbaar met hierdie weergawe van Vim nie]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nie bruikbaar op hierdie rekenaar nie]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [kan nie gelees word nie]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [kan nie oopgemaak word nie]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Kan nie bewaar nie, daar is geen ruillêer nie"
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Lêer bewaar"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Kon nie bewaar nie"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: 'ml_get': ongeldige 'lnum': %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: 'ml_get': kan reël %ld nie vind nie"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: wyser blok id verkeerd 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "'stack_idx' moet 0 wees"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Te veel blokke opgedateer?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: wyser blok id verkeerd 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "verwyder blok 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Kan nie reël %ld vind nie"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: wyser blok id verkeerd"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "'pe_line_count' is nul"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: reëlnommer buite perke: %ld verby die einde"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: reëltelling mag verkeerd wees in blok %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Stapel grootte verhoog"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: wyser blok id verkeerd 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: LET OP"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Het 'n ruillêer gevind met die naam \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Tydens oopmaak van lêer \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " NUWER as die ruillêer!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) 'n Ander program mag besig wees met hierdie lêer.\n"
+" Indien wel, pas op om nie met twee verskillende weergawes\n"
+" van dieselfde lêer te sit wanneer veranderinge gemaak word nie.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Stop, of gaan versigtig voort.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) 'n Bewerkingsessie van hierdie lêer het ineengestort.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Indien wel, gebruik \":recover\" of \"vim -r"
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" om die veranderinge te herwin (sien \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Indien jy dit alreeds gedoen het, verwyder die ruillêer \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" om hierdie boodskap te vermy.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Ruillêer \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" bestaan alreeds!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - LET OP"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Ruillêer bestaan alreeds!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Maak as lees-alleen oop\n"
+"&Bewerk in elk geval\n"
+"&Herwin\n"
+"&Stop"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Maak as lees-alleen oop\n"
+"&Bewerk in elk geval\n"
+"&Herwin\n"
+"&Stop\n"
+"S&krap dit"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Te veel ruillêers gevind"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Deel van kieslys-item pad is nie 'n sub-kieslys nie"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Kieslys bestaan slegs in 'n ander modus"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Geen kieslys met daardie naam nie"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Kieslyspad moenie lei na 'n sub-kieslys nie"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Moenie kieslysitems direk by kieslysstaaf voeg nie"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Verdeler kan nie deel wees van kieslyspad nie"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Kieslyste ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "Skeur die kieslys af"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Kieslyspad moet lei na 'n kieslysitem"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Kieslys nie gevind nie: %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Kieslys nie gedefinieer vir %s modus nie"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Kieslyspad moet lei na 'n sub-kieslys"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Kieslys nie gevind nie - maak seker oor die kieslys name"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Fout ontdek tydens verwerking van %s: "
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "reël %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[string te lank]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Boodskappe onderhouers: Danie Roux en Jean Jordaan <droux@tuks.co.za>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "Onderbreek: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "Druk ENTER om voort te gaan"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "Druk ENTER of tik 'n bevel om voort te gaan"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- Meer --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: reël, SPACE/b: bladsy, d/u: halwe bladsy, q: los dit"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: reël, SPACE: bladsy, d: halwe bladsy, q: los dit"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "Vraag"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ja\n"
+"&Nee"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nee\n"
+"&Kanselleer"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nee\n"
+"Stoor &alles\n"
+"&Gooi alles weg\n"
+"&Kanselleer"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "Stoor Lêer dialooghokkie"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "Maak lêer oop dialooghokkie"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Jammer, lêerblaaier nie beskikbaar in konsole-modus nie"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Waarskuwing: Jy wysig aan 'n leesalleen lêer"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "1 reël meer"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "1 reël minder"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld meer reëls"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld minder reëls"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr " (Onderbreek)"
+
+#: misc1.c:6245
+msgid "Vim: preserving files...\n"
+msgstr "Vim: bewaar lêers...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6255
+msgid "Vim: Finished.\n"
+msgstr "Vim: Klaar.\n"
+
+#: misc2.c:647 misc2.c:663
+msgid "ERROR: "
+msgstr "FOUT: "
+
+#: misc2.c:667
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[grepe] totaal 'alloc'-vrygelaat %lu-%lu, in gebruik %lu, piekgebruik %lu\n"
+
+#: misc2.c:669
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[roepe] totaal re/malloc()'s %lu, totale free()'s %lu\n"
+"\n"
+
+#: misc2.c:724
+msgid "E340: Line is becoming too long"
+msgstr "E340: Rëel word te lank"
+
+#: misc2.c:768
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Interne fout: 'lalloc(%ld, )'"
+
+#: misc2.c:876
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Geheue is op! (ken %lu grepe toe)"
+
+#: misc2.c:2511
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Roep dop om uit te voer: \"%s\""
+
+#: misc2.c:2706 misc2.c:5148 option.c:4584
+msgid "Missing colon"
+msgstr "Ontbrekende dubbelpunt"
+
+#: misc2.c:2708 misc2.c:2735
+msgid "Illegal mode"
+msgstr "Ongeldige modus"
+
+#: misc2.c:2774
+msgid "Illegal mouseshape"
+msgstr "Ongeldige muisvorm"
+
+#: misc2.c:2814 misc2.c:5168
+msgid "digit expected"
+msgstr "syfer verwag"
+
+#: misc2.c:2819
+msgid "Illegal percentage"
+msgstr "Ongeldige persentasie"
+
+#: misc2.c:3123
+msgid "Enter encryption key: "
+msgstr "Voer enkripsie-sleutel in: "
+
+#: misc2.c:3124
+msgid "Enter same key again: "
+msgstr "Voer die sleutel weer in: "
+
+#: misc2.c:3134
+msgid "Keys don't match!"
+msgstr "Sleutels verskil!"
+
+#: misc2.c:3648
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Ongeldige pad: '**[nommer]' moet aan die einde van 'n pad wees of "
+"gevolg wees deur %s'."
+
+#: misc2.c:4905
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Kan nie gids \"%s\" in 'cdpath' vind nie"
+
+#: misc2.c:4908
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Kan lêer \"%s\" nie vind in pad nie"
+
+#: misc2.c:4914
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Geen gids \"%s\" meer gevind in 'cdpath' nie"
+
+#: misc2.c:4917
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Geen lêer \"%s\" meer gevind in pad nie"
+
+#: misc2.c:5160
+msgid "Illegal component"
+msgstr "Ongeldige komponent"
+
+#: normal.c:2813
+msgid "Warning: terminal cannot highlight"
+msgstr "Waarskuwing: terminaal kan nie teks uitlig nie"
+
+#: normal.c:3008
+msgid "E348: No string under cursor"
+msgstr "E348: Geen string onder loper nie"
+
+#: normal.c:3010
+msgid "E349: No identifier under cursor"
+msgstr "E349: Geen identifiseerder onder loper nie"
+
+#: normal.c:4175
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Kan nie voue verwyder met huidige 'foldmethod' nie"
+
+# Het te doen met < en >
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 reël 1 keer ge-%s"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 reël ge-%s %d keer"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld reëls 1 keer ge-%s"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld reëls ge-%s %d keer"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld reëls om in te keep..."
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "1 reël ingekeep "
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld reëls ingekeep "
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "kan nie pluk nie: verwyder in elk geval"
+
+#: ops.c:2018
+msgid "1 line ~ed"
+msgstr "1 reël ge-~"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines ~ed"
+msgstr "%ld reëls ge-~"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "laat %ld reëls gaan"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "1 reël gepluk"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld reëls gepluk"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Niks in register %s nie"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registers ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "Ongeldige registernaam"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registers:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "Onbekende registertipe %d"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Ongeldige registernaam: '%s'"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Kolomme; "
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "%s%ld van %ld reëls gekies; %ld van %ld Woorde; %ld van %ld Grepe"
+
+# njj: Karakters kan meerdere grepe wees, sien ':h multibyte'
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Kol %s van %s; Reël %ld van %ld; Woord %ld van %ld; Greep %ld van %ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld vir 'BOM')"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Dankie dat jy vlieg met Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Opsie is nie ondersteun nie"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Nie toegelaat in 'n moduslyn nie"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tLaas gestel vanaf "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Nommer vereis na ="
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Nie gevind in 'termcap' nie"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Ongeldige karakter <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "Nie hier toegelaat nie"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "Kan nie 'term' stel na leë string nie"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "Kan nie 'term' verander in GUI nie"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "Gebruik \":gui\" om die GUI te begin"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "'backupext' en 'patchmode' is dieselfde"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "Nul-lengte string"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "Ontbrekende nommer na <%s>"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "Ontbrekende komma"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "Moet 'n ' waarde spesifiseer"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "bevat 'n ondrukbare karakter"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "Ongeldige font(e)"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "kan nie fontstel kies nie"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "Ongeldige fontstel"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "kan nie wye font kies nie"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "Ongeldige wye font"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Ongeldige karakter na <%c>"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "komma benodig"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' moet leeg wees of %s bevat"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "Geen muisondersteuning nie"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "Onvoltooide uitdrukkingreeks"
+
+#: option.c:5403
+msgid "too many items"
+msgstr "te veel items"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "ongebalanseerde groepe"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "Daar bestaan reeds 'n voorskouvenster"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' kan nie kleiner as 'winminheight' wees nie"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' kan nie kleiner as 'winminwidth' wees nie"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "Benodig ten minste %d reëls"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "Benodig ten minste %d kolomme"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Onbekende opsie: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Terminaal kodes ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Globale opsie waardes ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Lokale opsie waardes ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Opsies ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: 'get_varp' FOUT"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Passende karakter ontbreek vir %s"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap: Ekstra karakters na kommapunt: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "kan nie oopmaak nie "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Kan nie venster oopmaak nie!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Benodig Amigados weergawe 2.04 of later\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Benodig %s weergawe %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Kan nie NIL: oopmaak nie\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "Kan nie skep nie: "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim stop met %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "kan konsole-modus nie verander nie ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Skermmodus instelling nie ondersteun nie"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "'mch_get_shellsize': nie 'n konsole nie??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Kan nie dop met -f opsie uitvoer nie"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Kan nie uitvoer nie "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "dop "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " teruggekeer\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "'ANCHOR_BUF_SIZE' is te klein"
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O FOUT"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(afgekap)"
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' is nie 80 nie, kan nie eksterne bevele uitvoer nie"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Biblioteekroep het gefaal vir \"%s\"()"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: Drukker-seleksie het gefaal"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "na %s op %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Drukfout: %s"
+
+#: os_mswin.c:1460
+msgid "Unknown"
+msgstr "Onbekend"
+
+#: os_mswin.c:1487
+#, c-format
+msgid "Printing '%s'"
+msgstr "Druk nou '%s'"
+
+#: os_mswin.c:2551
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Ongeldige karakterstelnaam \"%s\" in fontnaam \"%s\""
+
+#: os_mswin.c:2559
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Ongeldige karakter '%c' in fontnaam \"%s\""
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Ongeldige 'osfiletype' opsie - gaan Text gebruik"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Dubbel sein, staak\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Het dodelike sein %s gevang\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Het dodelike sein gevang\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Om die X-vertoonskerm oop te maak het %ld msek gevat"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Het X fout ontvang\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "Toetsing van die X-vertoonskerm het gefaal"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "Oopmaak van die X-vertoonskerm het uitgetel"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Kan nie dop uitvoer nie "
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Kan nie dop 'sh' uitvoer nie\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"dop lewer "
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Kan nie pype skep nie\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Kan nie vurk nie\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Bevel beëindig\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "Oopmaak van die X vertoonskerm het gefaal"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "By reël"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Kon nie 'vim32.dll' laai nie!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM Fout"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Kon nie funksiewysers na die DLL opstel nie!"
+
+#: os_win16.c:578 os_win32.c:3021
+#, c-format
+msgid "shell returned %d"
+msgstr "dop het %d gelewer"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Het %s gebeurtenis gevang\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "maak toe"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "teken uit"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "sit af"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: Bevel nie gevind nie"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"'VIMRUN.EXE' nie gevind in '$PATH' nie.\n"
+"Eksterne opdragte sal nie wag na voltooiing nie\n"
+"Sien ':help win32-vimrun' vir meer inligting."
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Vim Waarskuwing"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Te veel %%%c in formaatstring"
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Onverwagte %%%c in formaatstring"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: Ontbrekende ] in formaatstring"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Ongesteunde %%%c in formaatstring"
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Ongeldige %%%c in formaatstringvoorvoegsel"
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Ongeldige %%%c in formaatstring"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' bevat geen patroon nie"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Ontbrekende of leë gidsnaam"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "Geen items meer nie"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d van %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (reël verwyder)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Onder aan 'quickfix' stapel"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Bo aan 'quickfix' stapel"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "foutelys %d van %d; %d foute"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Kan nie skryf nie, 'buftype' opsie is aan"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: Patroon te lank"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Geneste %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Geneste %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c volg niks"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Sintaksfout in %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Ineenstorting onderskep. Patroon te kompleks?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: patroon het lëe-stapel fout veroorsaak"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "Eksterne subtreffers:\n"
+
+#: screen.c:2054
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld reëls gevou "
+
+#: screen.c:7426
+msgid " VREPLACE"
+msgstr " VVERVANG"
+
+#: screen.c:7430
+msgid " REPLACE"
+msgstr " VERVANG"
+
+#: screen.c:7435
+msgid " REVERSE"
+msgstr " OMKEER"
+
+#: screen.c:7437
+msgid " INSERT"
+msgstr " INVOEG"
+
+#: screen.c:7440
+msgid " (insert)"
+msgstr " (invoeg)"
+
+#: screen.c:7442
+msgid " (replace)"
+msgstr " (vervang)"
+
+#: screen.c:7444
+msgid " (vreplace)"
+msgstr " (vvervang)"
+
+#: screen.c:7447
+msgid " Hebrew"
+msgstr " Hebreeus"
+
+#: screen.c:7455
+msgid " (lang)"
+msgstr " (taal)"
+
+#: screen.c:7458
+msgid " (paste)"
+msgstr " (plak)"
+
+#: screen.c:7464
+msgid " SELECT"
+msgstr " KIES"
+
+#: screen.c:7466
+msgid " VISUAL"
+msgstr " VISUELE"
+
+#: screen.c:7468
+msgid " BLOCK"
+msgstr " BLOK"
+
+#: screen.c:7470
+msgid " LINE"
+msgstr " REËL"
+
+#: screen.c:7483 screen.c:7537
+msgid "recording"
+msgstr "besig om op te neem"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "soektog het BO getref, gaan voort van ONDER af"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "soektog het ONDER getref, gaan voort van BO af"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Ongeldige soekstring: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: soektog het BO getref sonder treffer vir: %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: soektog het ONDER getref sonder treffer vir: %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Verwag '?' of '/' na ';'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (sluit in vorige gelyste treffer)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- Ingeslote lêers"
+
+#: search.c:3498
+msgid "not found "
+msgstr "nie gevind nie "
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "in pad ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (Alreeds gelys)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " NIE GEVIND NIE"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Deursoek ingeslote lêer: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: Treffer is op huidige reël"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "Alle ingeslote lêers is gevind"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "Geen ingeslote lêers nie"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: Kon definisie nie vind nie"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Kon patroon nie vind nie"
+
+#: syntax.c:2991
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Ongeldige parameter: %s"
+
+#: syntax.c:3168
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Geen sodanige sintakskluster nie: %s"
+
+#: syntax.c:3332
+msgid "No Syntax items defined for this buffer"
+msgstr "Geen Sintaks-items gedefinieer vir hierdie buffer nie"
+
+#: syntax.c:3340
+msgid "syncing on C-style comments"
+msgstr "sinchroniseer met C-styl kommentaar"
+
+#: syntax.c:3348
+msgid "no syncing"
+msgstr "geen sinchronisering"
+
+#: syntax.c:3351
+msgid "syncing starts "
+msgstr "sinchronisasie begin "
+
+#: syntax.c:3353 syntax.c:3422
+msgid " lines before top line"
+msgstr " reëls voor boonste lyn"
+
+#: syntax.c:3357
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Sintaks sync items ---"
+
+#: syntax.c:3360
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"sinchronisering met items"
+
+#: syntax.c:3365
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Sintaks items ---"
+
+#: syntax.c:3388
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Geen sodanige sintakskluster nie: %s"
+
+#: syntax.c:3412
+msgid "minimal "
+msgstr "minimaal "
+
+#: syntax.c:3419
+msgid "maximal "
+msgstr "maksimaal "
+
+#: syntax.c:4047
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: 'group[t]here' nie hier aanvaar nie"
+
+#: syntax.c:4071
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Kon nie omgewingsitem vind vir %s nie"
+
+#: syntax.c:4099
+msgid "E395: contains argument not accepted here"
+msgstr "E395: bevat parameters nie hier aanvaar nie"
+
+#: syntax.c:4110
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: 'containedin' parameter nie hier aanvaar nie"
+
+#: syntax.c:4188
+msgid "E397: Filename required"
+msgstr "E397: Lêernaam benodig"
+
+#: syntax.c:4524
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Ontbrekende '=': %s"
+
+#: syntax.c:4680
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Nie genoeg parameters nie: sintaksomgewing %s"
+
+#: syntax.c:5011
+msgid "E400: No cluster specified"
+msgstr "E400: Geen kluster gespesifiseer nie"
+
+#: syntax.c:5048
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Patroonbegrenser nie gevind nie: %s"
+
+#: syntax.c:5123
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Gemors na patroon: %s"
+
+#: syntax.c:5205
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: sintaks sync: reëlvoortgaanpatroon twee keer gespesifiseer"
+
+#: syntax.c:5262
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Ongeldige parameters: %s"
+
+#: syntax.c:5312
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Ontbrekende gelykaanteken: %s"
+
+#: syntax.c:5318
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Leë parameter: %s"
+
+#: syntax.c:5345
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s nie toegelaat hier nie"
+
+#: syntax.c:5352
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s moet vóór in 'contains' lys wees"
+
+#: syntax.c:5422
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Onbekende groepnaam: %s"
+
+#: syntax.c:5645
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Ongeldige :syntax subbevel %s"
+
+#: syntax.c:6024
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: uitliggroep nie gevind nie: %s"
+
+#: syntax.c:6048
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Te min parameters: \":highlight link %s\""
+
+#: syntax.c:6055
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Te veel parameters: \":highlight link %s\""
+
+#: syntax.c:6075
+msgid "E414: group has settings, highlight link ignored"
+msgstr ""
+"E414: groep het instellings, uitligskakel ('highlight link') geïgnoreer"
+
+#: syntax.c:6204
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: onverwagte gelykaanteken: %s"
+
+#: syntax.c:6240
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ontbrekende gelykaanteken: %s"
+
+#: syntax.c:6262
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ontbrekende parameter: %s"
+
+#: syntax.c:6299
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Ongeldige waarde: %s"
+
+#: syntax.c:6418
+msgid "E419: FG color unknown"
+msgstr "E419: FG kleur onbekend"
+
+#: syntax.c:6429
+msgid "E420: BG color unknown"
+msgstr "E420: BG kleur onbekend"
+
+#: syntax.c:6484
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Kleurnaam of -nommer nie herken nie: %s"
+
+#: syntax.c:6688
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminaalkode te lank: %s"
+
+#: syntax.c:6735
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Ongeldige parameter: %s"
+
+#: syntax.c:7264
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Te veel verskillende uitlig-eienskappe in gebruik"
+
+# njj: 'inkleur' vir 'uitlig'? net 'n idee ..
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "onderaan etiketstapel"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "bo-aan etiketstapel"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Kan nie vóór eerste etiket-treffer gaan nie"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: etiket nie gevind nie: %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri tipe etiket"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "lêer\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Sleutel nommer van keuse in (<CR> om te stop): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Daar is slegs een etiket-treffer"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Kan nie verby laaste etiket-treffer gaan nie"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Lêer \"%s\" bestaan nie"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "etiket %d van %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " of meer"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Gaan etiket met ander kas gebruik!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Lêer \"%s\" bestaan nie"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # NA etiket VAN reël in lêer/teks"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Liniêre etiketsoek"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binêre etiketsoek"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Deursoek etiketlêer %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Etiketlêergids afgekap vir %s\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Formaatfout in etiketlêer \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "Voor greep %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Etiketlêer ongesorteer: %s"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: Geen etiketlêer nie"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Kan nie etiketpatroon vind nie"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Kon nie etiket vind nie, ek raai maar!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' onbekend. Beskikbare ingeboude terminale is:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "gebruik verstek '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "Kan nie 'termcap'-lêer oopmaak nie"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminaalinskrywing nie in 'terminfo' gevind nie"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "Terminaalinskrywing nie in 'termcap' gevind nie"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Geen \"%s\" inskrywing in termcap nie"
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: terminaalvermoë \"cm\" vereis"
+
+#. Highlight title
+#: term.c:4878
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Terminaal sleutels ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "nuwe dop begin\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Fout met lees van invoer, verlaat...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "Geen herstel moontlik; gaan in elk geval voort"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: reëlnommers foutief"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "1 verandering"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "%ld veranderinge"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: herstellys korrup"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: herstelreël ontbreek"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32-bis GUI weergawe"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32-bis GUI version"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr " in Win32s modus"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr " met OLE ondersteuning"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32-bis konsole weergawe"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16-bis weergawe"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32-bis MS-DOS weergawe"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16-bis MS-DOS weergawe"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) weergawe"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X weergawe"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS weergawe"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS weergawe"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Ingeslote laslappies:"
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Gekompileer op "
+
+#: version.c:731
+msgid "by "
+msgstr "deur "
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Enorme weergawe "
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Groot weergawe "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normale weergawe "
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Klein weergawe "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Piepklein weergawe "
+
+#: version.c:760
+msgid "without GUI."
+msgstr "sonder GUI."
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "met GTK-GNOME GUI."
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "met GTK GUI"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "met X11-Motif GUI."
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "met X11-Athena GUI"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "met BeOS GUI"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "met Photon GUI."
+
+#: version.c:782
+msgid "with GUI."
+msgstr "met GUI."
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "met Carbon GUI."
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "met Cocoa GUI."
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "met (klassieke) GUI."
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " Kenmerke in- (+) of uitgesluit (-):\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " stelsel vimrc-lêer: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " gebruiker vimrc-lêer: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " 2de gebruiker vimrc-lêer \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " 3de gebruiker vimrc-lêer \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " gebruiker exrc-lêer: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " 2de gebruiker exrc-lêer: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " stelsel gvimrc-lêer: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " gebruiker gvimrc-lêer: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr "2de gebruiker gvimrc-lêer: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr "3de gebruiker gvimrc-lêer: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " stelsel kieslys-lêer: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " bystand vir $VIM: \""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " bystand vir $VIMRUNTIME: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "Kompilering: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "Kompileerder: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "Koppeling: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " ONTFOUTINGS-KOMPILERING"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi Met skop"
+
+# njj: :))
+#: version.c:936
+msgid "version "
+msgstr "Weergawe "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "deur Bram Moolenaar et al."
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim is vryekode, en vrylik verspreibaar"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "Help arm kinders in Uganda!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "tik :help iccf<Enter> vir meer inligting hieroor "
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "tik :q<Enter> om program verlaat "
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "tik :help<Enter> of <F1> vir aanlyn hulp "
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "tik :help version6<Enter> vir weergawe-inligting"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Voer tans uit in Vi-versoenbare modus"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "tik :set nocp<Enter> vir Vim verstekwaardes "
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "tik :help cp-default<Enter> vir meer inligting hieroor"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "WAARSKUWING: Windows 95/98/ME bespeur"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "tik :help windows95<Enter> vir meer inligting hieroor"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Daar is nie 'n voorskou-venster nie"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Kan nie bo-links en onder-regs terselfdertyd verdeel nie"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Kan nie roteer terwyl 'n ander venster verdeel is nie"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: Kan nie laaste venster toemaak nie"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "Daar is alreeds slegs een venster"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: Die ander venster bevat veranderinge"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: Geen lêernaam onder loper"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Kan lêer \"%s\" nie vind in pad nie"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Wysig met &meer as een Vim"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Wysig met 'n enkel &Vim"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Wysig met &Vim"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Wysig met bestaande Vim - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Wysig die gekose lêer(s) met Vim"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "FOut met die skep van proses: Kyk of gvim in jou pad is!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "'gvimext.dll' fout"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Pad-lengte te lank"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--Geen reëls in buffer--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "Bevel gekansellleer"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "Parameter benodig"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ moet gevolg word deur /, ? of &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Ongeldig in bevelreël venster: <CR> voer uit, CTRL-C stop"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Bevel uit exrc/vimrc nie toegelaat in huidige gids- of etiketsoektog nie"
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Lêer bestaan (gebruik ! om te dwing)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "Bevel het gefaal"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "Interne fout"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "Onderbreek"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: Ongeldige adres"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "Ongeldige parameter"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Ongeldige parameter: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Ongeldige uitdrukking: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: Ongeldige omvang"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "Ongeldige bevel"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" is 'n gids"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Onverwagte karakters voor '='"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Merker het ongeldige reëlnommer"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: Merker nie gestel nie"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Kan nie wysig nie, 'modifiable' is af"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skripte te diep ge-nes"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: Geen alternatiewe lêer nie"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: Afkorting bestaan nie"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "Geen ! toegelaat nie"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI kan nie gebruik word nie: Nie tydens kompilering gekies nie"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E26: Hebreeus kan nie gebruik word nie: Nie tydens kompilering gekies nie\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E27: Farsi kan nie gebruik word nie: Nie tydens kompilering gekies nie\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Geen sodanige uitliggroepnaam nie: %s"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: Nog geen ingevoegde teks nie"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: Geen vorige bevelreël nie"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: Geen so 'n binding nie"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "Geen treffer nie"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "Geen treffer: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: Geen lêernaam"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Geen vorige vervangingspatroon nie"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: Geen vorige bevel nie"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: Geen vorige patroon nie"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "Geen omvang toegelaat nie"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: Te min plek"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "Kan nie lêer %s skep nie"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "Kan nie tydelike lêernaam kry nie"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "Kan nie lêer %s oopmaak nie"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "Kan nie lêer %s lees nie"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: Ongeskryf sedert vorige verandering (gebruik ! om te dwing)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: Nul parameter"
+
+# njj: hmm, hoe hanteer mens die onderskeid tussen 'Null' (afwesig) en
+# njj: 'Zero' (die nommer)?
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: Nommer verwag"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Kan nie foutlêer %s oopmaak nie"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: Geheue op!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "Patroon nie gevind nie"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Patroon nie gevind nie: %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "Parameter moet positief wees"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: Geen Foute"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: Beskadige trefferstring"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Korrupte patroonprogram"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: 'readonly' opsie is aan (gebruik ! om te dwing)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Kan nie lees-alleen veranderlike stel nie \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Fout tydens lees van 'errorfile'"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Nie toegelaat in sandput nie"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: Ongeldige rolgrootte"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell' (dop) opsie is leeg"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: Sluitfout met ruillêer"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: etiketstapel leeg"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: Bevel te kompleks"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: Naam te lank"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: Te veel ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: Te veel lêername"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "Oorbodige karakters"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: Onbekende merker"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Kan nie plekhouers uitbrei nie"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: Fout tydens skryfoperasie"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "Nul telling"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Gebruik van '<SID>' buite skripkonteks"
+
+#~ msgid "E258: no matches found in cscope connections"
+#~ msgstr "E258: geen treffers gevind in 'cscope' verbindings nie"
+
+#~ msgid "No servers found for this display"
+#~ msgstr "Geen bedieners gevind vir die 'display' nie"
+
+#~ msgid "Missing filename"
+#~ msgstr "Ontbrekende lêernaam"
+
+#~ msgid "Invalid line number: %ld"
+#~ msgstr "Ongeldige reëlnommer: %ld"
+
+#~ msgid "Cannot use :normal from event handler"
+#~ msgstr "Kan ':normal' nie vanuit gebeurtenishanteerder gebruik nie"
+
+#~ msgid "%ldL, %ldC"
+#~ msgstr "%ldR, %ldK"
+
+#~ msgid "VIM - Help on..."
+#~ msgstr "VIM - Hulp met.."
+
+#~ msgid "Topic:"
+#~ msgstr "Onderwerp:"
+
+#~ msgid "Error: During loading fontset %s"
+#~ msgstr "Fout: Gedurende die laai van fontstel %s"
+
+#~ msgid "locale is not set correctly"
+#~ msgstr "lokaal is nie korrek gestel nie"
+
+#~ msgid "Set LANG environment variable to your locale"
+#~ msgstr "Stel die 'LANG' omgewingsveranderlike na jou lokaal toe"
+
+#~ msgid "For korean:"
+#~ msgstr "Vir Afrikaans:"
+
+#~ msgid " csh: setenv LANG ko"
+#~ msgstr " csh: setenv LANG af"
+
+#~ msgid " sh : export LANG=ko"
+#~ msgstr " sh: export LANG=af"
+
+#~ msgid "fontset name: %s"
+#~ msgstr "fontstel naam: %s"
+
+#~ msgid "Your language Font missing"
+#~ msgstr "Jou taal Font ontbreek"
+
+#~ msgid "loaded fontname: %s"
+#~ msgstr "gelaaide fontnaam: %s"
+
+#~ msgid "Cannot allocate memory for debugger sign"
+#~ msgstr "Kan nie geheue toeken vir ontfouterteken nie"
+
+#~ msgid "automata ERROR: internal"
+#~ msgstr "automata FOUT: intern"
+
+#~ msgid "cs_add_common: alloc fail #1"
+#~ msgstr "'cs_add_common': toeken onsuksesvol #1"
+
+#~ msgid "cs_add_common: alloc fail #2"
+#~ msgstr "'cs_add_common': toeken onsuksesvol #2"
+
+#~ msgid "cs_add_common: alloc fail #3"
+#~ msgstr "'cs_add_common': toeken onsuksesvol #3"
+
+#~ msgid "cs_add_common: alloc fail #4"
+#~ msgstr "'cs_add_common': toeken onsuksesvol #4"
+
+#~ msgid "Retrieve next symbol"
+#~ msgstr "Kry volgende simbool"
+
+#~ msgid "-- SNiFF+ commands --"
+#~ msgstr "-- SNiFF+ bevele --"
+
+#~ msgid "Unrecognized sniff request [%s]"
+#~ msgstr "Onbekende sniff versoek [%s]"
+
+#~ msgid "Can't create input context."
+#~ msgstr "Kan nie invoerkonteks skep nie."
+
+#~ msgid "Sorry, deleting a menu is not possible in the Athena version"
+#~ msgstr ""
+#~ "Jammer, in die Athena weergawe is dit onmoontlik om 'n kieslys te skrap"
+
+#~ msgid "Out of memory"
+#~ msgstr "Geheue op"
+
+#~ msgid "PC (32 bits Vim)"
+#~ msgstr "PC (32 bisse Vim)"
+
+#~ msgid "PC (16 bits Vim)"
+#~ msgstr "PC (16 bisse Vim)"
+
+#~ msgid "Unsupported screen mode"
+#~ msgstr "Ongesteunde skermmodus"
+
+#~ msgid "deadly signal"
+#~ msgstr "dodelike sein"
+
+#~ msgid "some"
+#~ msgstr "sommige"
+
+#~ msgid "Library call failed"
+#~ msgstr "Biblioteekfunksieroep het gefaal"
+
+#~ msgid "Cannot clear all highlight groups"
+#~ msgstr "Kan nie alle uitliggroepe leegmaak nie"
+
+#~ msgid "GUI is not running"
+#~ msgstr "GUI voer nie uit nie"
+
+#~ msgid "Command too long"
+#~ msgstr "Bevel te lank"
+
+#~ msgid "Ambiguous mapping"
+#~ msgstr "Dubbelsinnige binding"
+
+#~ msgid "Ambiguous mapping, conflicts with \"%s\""
+#~ msgstr "Dubbelsinnige binding, bots met \"%s\""
+
+#~ msgid "Too many \\z("
+#~ msgstr "Te veel \\z("
+
+#~ msgid "Too many \\("
+#~ msgstr "Te veel \\("
+
+#~ msgid "Unmatched \\z("
+#~ msgstr "Onpaar \\z("
+
+#~ msgid "Unmatched \\%("
+#~ msgstr "Onpaar \\z"
+
+#~ msgid "Unmatched \\("
+#~ msgstr "Onpaar \\("
+
+#~ msgid "Unmatched \\)"
+#~ msgstr "Onpaar \\)"
+
+#~ msgid "*, \\+ or \\{ operand could be empty"
+#~ msgstr "*, \\+ of \\{ operand mag leeg wees"
+
+#~ msgid "invalid character after \\@"
+#~ msgstr "ongeldige karakter na \\@"
+
+#~ msgid "Too many complex \\{...}s"
+#~ msgstr "Te veel komplekse \\{...}ies"
+
+#~ msgid "Nested *, \\=, \\+, \\! or \\{"
+#~ msgstr "Geneste *, \\=, \\+, \\! of \\{"
+
+#~ msgid "invalid use of \\_"
+#~ msgstr "ongeldige gebruik van \\_"
+
+#~ msgid "\\= follows nothing"
+#~ msgstr "\\= volg niks"
+
+#~ msgid "\\+ follows nothing"
+#~ msgstr "\\+ volg niks"
+
+#~ msgid "\\@ follows nothing"
+#~ msgstr "\\@ volg niks"
+
+#~ msgid "\\{ follows nothing"
+#~ msgstr "\\{ volg niks"
+
+#~ msgid "\\* follows nothing"
+#~ msgstr "\\* volg niks"
+
+#~ msgid "Illegal back reference"
+#~ msgstr "Ongeldige tru-verwysing"
+
+#~ msgid "\\z( not allowed here"
+#~ msgstr "\\z( nie hier toegelaat nie"
+
+#~ msgid "\\z1 et al. not allowed here"
+#~ msgstr "\\z1 e.a. nie hier toegelaat nie"
+
+#~ msgid "Invalid character after \\z"
+#~ msgstr "ongeldige karakter na \\z"
+
+#~ msgid "Missing ] after \\%["
+#~ msgstr "Ontbrekende ] na \\%["
+
+#~ msgid "Empty \\%[]"
+#~ msgstr "Leë \\%[]"
+
+#~ msgid "Invalid character after \\%"
+#~ msgstr "ongeldige karakter na \\%"
+
+#~ msgid "Unexpected magic character; check META."
+#~ msgstr "Onverwagte toorkarakter; kyk na META."
+
+#~ msgid "type :help uganda<Enter> if you like Vim "
+#~ msgstr "tik :help uganda<Enter> as jy hou van Vim "
+
+#~ msgid " WARNING: Intel CPU detected. "
+#~ msgstr " WAARSKUWING: Intel SVE bespeur. "
+
+#~ msgid " PPC has a much better architecture. "
+#~ msgstr " PPC het 'n veel beter argitektuur. "
+
+#~ msgid "Security error: new viminfo file is a symbolic link"
+#~ msgstr "Sekuriteitsfout: nuwe viminfo lêer is a simboliese skakel"
+
+#~ msgid "line ~%ld: %s"
+#~ msgstr "reël ~%ld: %s"
+
+#~ msgid "makeef option not set"
+#~ msgstr "'makeef' opsie nie aan nie"
+
+#~ msgid "Security error: filter output is a symbolic link: %s"
+#~ msgstr "Sekuriteitsfout: filter afvoer is 'n simboliese skakel"
+
+#~ msgid "Security error: 'charconvert' output is a symbolic link"
+#~ msgstr "Sekuriteitsfout: 'charconvert' afvoer is 'n simboliese skakel"
+
+#~ msgid "Security error: filter input is a symbolic link: %s"
+#~ msgstr "Sekuriteitsfout: filter invoer is 'n simboliese skakel"
+
+#~ msgid "Fold must be at least two lines"
+#~ msgstr "'n Vou moet ten minste 2 reëls wees"
+
+#~ msgid "No fold at this line"
+#~ msgstr "Geen vou by hierdie reël nie"
+
+#~ msgid "Security error: shell command output is a symbolic link"
+#~ msgstr "Sekuriteitsfout: Dop-bevel afvoer is 'n simboliese skakel"
+
+#~ msgid "Warning: %s option changed from modeline"
+#~ msgstr "Waarskuwing: %s opsie verander vanaf moduslyn"
+
+#~ msgid "Change dir debugging enabled."
+#~ msgstr "Verandergids ontfouting in staat gestel"
+
+#~ msgid "Not a proper file name: '%s'"
+#~ msgstr "Nie 'n geldige lêernaam nie: '%s'"
+
+#~ msgid "File name '%s' is valid"
+#~ msgstr "lêernaam '%s is ongeldig"
+
+#~ msgid "Leave: %s"
+#~ msgstr "Verlaat: %s"
+
+#~ msgid "WARNING: tag command changed a buffer!!!"
+#~ msgstr "WAARSKUWING: etiketbevel het buffer verander!!!"
diff --git a/src/po/ca.po b/src/po/ca.po
new file mode 100644
index 000000000..6a50ef6c1
--- /dev/null
+++ b/src/po/ca.po
@@ -0,0 +1,6341 @@
+# Catalan messages for vim.
+# Copyright (C) 2003, 2004, Ernest Adrogué <eadrogue@gmx.net>.
+# This file is distributed under the GNU General Public License.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim 6.2\n"
+"POT-Creation-Date: 2003-11-01 20:10+0100\n"
+"PO-Revision-Date: 2004-01-19 13:57+0100\n"
+"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: No s'ha pogut assignar memòria per cap buffer, sortint..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: No s'ha pogut assignar memòria pel buffer, usant-ne un altre..."
+
+# unload: Treu el buffer de la memòria però el deixa a la llista
+# delete: Treu el buffer de la memòria i de la llista de buffers
+# wipe out: Elimina el buffer amb totes les opcions, marques, etc.
+#
+#: buffer.c:797
+msgid "E515: No buffers were unloaded"
+msgstr "E515: No s'ha alliberat cap buffer"
+
+#: buffer.c:799
+msgid "E516: No buffers were deleted"
+msgstr "E516: No s'ha eliminat cap buffer"
+
+#: buffer.c:801
+msgid "E517: No buffers were wiped out"
+msgstr "E517: No s'ha destruït cap buffer"
+
+#: buffer.c:809
+msgid "1 buffer unloaded"
+msgstr "S'ha alliberat 1 buffer"
+
+#: buffer.c:811
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "S'han alliberat %d buffers"
+
+#: buffer.c:816
+msgid "1 buffer deleted"
+msgstr "S'ha eliminat 1 buffer"
+
+#: buffer.c:818
+#, c-format
+msgid "%d buffers deleted"
+msgstr "S'han eliminat %d buffers"
+
+#: buffer.c:823
+msgid "1 buffer wiped out"
+msgstr "S'ha destruït 1 buffer"
+
+#: buffer.c:825
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "S'han destruït %d buffers"
+
+#: buffer.c:886
+msgid "E84: No modified buffer found"
+msgstr "E84: No s'ha trobat cap buffer modificat"
+
+#. back where we started, didn't find anything.
+#: buffer.c:925
+msgid "E85: There is no listed buffer"
+msgstr "E85: No hi ha cap buffer a la llista"
+
+#: buffer.c:937
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: No s'ha pogut anar al buffer %ld"
+
+#: buffer.c:940
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: No es pot anar més enllà de l'últim buffer"
+
+#: buffer.c:942
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: No es pot anar més enllà del primer buffer"
+
+#: buffer.c:966
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: No s'ha desat el buffer %ld (afegiu ! per confirmar)"
+
+#: buffer.c:982
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: No es pot alliberar l'últim buffer"
+
+#: buffer.c:1500
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Atenció: S'ha desbordat la llista de noms de fitxers"
+
+#: buffer.c:1671
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: No s'ha trobat el buffer %ld"
+
+#: buffer.c:1902
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Hi ha més d'una coincidència per %s"
+
+#: buffer.c:1904
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: No hi ha cap coincidència per %s"
+
+#: buffer.c:2299 ex_docmd.c:6560
+#, c-format
+msgid "line %ld"
+msgstr "línia %ld"
+
+#: buffer.c:2382
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Ja existeix un buffer amb aquest nom"
+
+#: buffer.c:2675
+msgid " [Modified]"
+msgstr " [Modificat]"
+
+#: buffer.c:2680
+msgid "[Not edited]"
+msgstr "[No editat]"
+
+#: buffer.c:2685
+msgid "[New file]"
+msgstr "[Fitxer nou]"
+
+#: buffer.c:2686
+msgid "[Read errors]"
+msgstr "[Lectura errònia]"
+
+#: buffer.c:2688 fileio.c:1918
+msgid "[readonly]"
+msgstr "[només lectura]"
+
+#: buffer.c:2703
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 línia --%d%%--"
+
+#: buffer.c:2705
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld línies --%d%%--"
+
+#: buffer.c:2712
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "línia %ld de %ld --%d%%-- col "
+
+#: buffer.c:2813
+msgid "[No file]"
+msgstr "[Cap fitxer]"
+
+#. must be a help buffer
+#: buffer.c:2853
+msgid "help"
+msgstr "ajuda"
+
+#: buffer.c:3412 screen.c:4996
+msgid "[help]"
+msgstr "[ajuda]"
+
+#: buffer.c:3444 screen.c:5002
+msgid "[Preview]"
+msgstr "[Vista prèvia]"
+
+#: buffer.c:3724
+msgid "All"
+msgstr "Tot"
+
+#: buffer.c:3724
+msgid "Bot"
+msgstr "Baix"
+
+#: buffer.c:3726
+msgid "Top"
+msgstr "Dalt"
+
+#: buffer.c:4470
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr "\n# Llista de buffers:\n"
+
+#: buffer.c:4503
+msgid "[Error List]"
+msgstr "[Llista d'errors]"
+
+#: buffer.c:4516 memline.c:1501
+msgid "[No File]"
+msgstr "[Cap fitxer]"
+
+#: buffer.c:4819
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr "\n--- Senyals ---"
+
+#: buffer.c:4838
+#, c-format
+msgid "Signs for %s:"
+msgstr "Senyals per %s:"
+
+#: buffer.c:4844
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " línia=%ld id=%d nom=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: No es poden mostrar diferències amb més de %ld buffers"
+
+#: diff.c:651
+msgid "E97: Cannot create diffs"
+msgstr "E97: No s'han pogut mostrar les diferències"
+
+# És el nom d'un diàleg. Menú "Split patched by..."
+#: diff.c:750
+msgid "Patch file"
+msgstr "Fitxer de diferències"
+
+#: diff.c:1001
+msgid "E98: Cannot read diff output"
+msgstr "E98: No s'ha pogut llegir la sortida de diff"
+
+#: diff.c:1742
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: El buffer actual no es troba en mode diff"
+
+#: diff.c:1754
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: No hi ha cap altre buffer en mode diff"
+
+#: diff.c:1762
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Hi ha més de 2 buffers en mode diff, no se sap quin usar"
+
+#: diff.c:1785
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: No s'ha trobat el buffer \"%s\""
+
+#: diff.c:1791
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: El buffer \"%s\" no es troba en mode diff"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: No es permeten caràcters d'escapada en un dígraf"
+
+#: digraph.c:2344
+msgid "E544: Keymap file not found"
+msgstr "E544: No s'ha trobat el fitxer de mapa de tecles"
+
+# traducció de «sourced file». eac
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: L'ordre :loadkeymap només es pot usar en fitxers"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Completar paraules clau (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " Mode ^X (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Completar paraules clau locals (^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Completar línies senceres (^L/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Completar noms de fitxer (^F/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Completar etiquetes (^]/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Completar ubicacions (^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Completar definicions (^D/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Completar paraules de diccionari (^K/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Completar sinònims (^T/^N/^P)"
+
+# buscar un nom, en lloc del verb «completar». eac
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Completar ordres (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "S'ha arribat al final del paràgraf"
+
+#: edit.c:955
+msgid "'thesaurus' option is empty"
+msgstr "L'opció 'thesaurus' no està definida"
+
+#: edit.c:1159
+msgid "'dictionary' option is empty"
+msgstr "L'opció 'dictionary' no està definida"
+
+#: edit.c:2144
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "S'està examinant el diccionari: %s"
+
+#: edit.c:2350
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (inserir) Desplaçar (^E/^Y)"
+
+#: edit.c:2352
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (substituir) Desplaçar (^E/^Y)"
+
+#: edit.c:2666
+#, c-format
+msgid "Scanning: %s"
+msgstr "Examinant: %s"
+
+#: edit.c:2701
+msgid "Scanning tags."
+msgstr "S'estan examinant les etiquetes."
+
+#: edit.c:3363
+msgid " Adding"
+msgstr " Afegint"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3412
+msgid "-- Searching..."
+msgstr "-- Cercant..."
+
+#: edit.c:3468
+msgid "Back at original"
+msgstr "Original"
+
+#: edit.c:3473
+msgid "Word from other line"
+msgstr "Paraula d'una altra línia"
+
+#: edit.c:3478
+msgid "The only match"
+msgstr "Única coincidència"
+
+#: edit.c:3537
+#, c-format
+msgid "match %d of %d"
+msgstr "coincidència %d de %d"
+
+#: edit.c:3540
+#, c-format
+msgid "match %d"
+msgstr "coincidència %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:979
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: La variable és desconeguda: \"%s\""
+
+#: eval.c:1275
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Falten parèntesis: %s"
+
+#: eval.c:1380 eval.c:1394
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: No existeix tal variable: \"%s\""
+
+#: eval.c:1650
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Falta un ':' després de '?'"
+
+#: eval.c:2266
+msgid "E110: Missing ')'"
+msgstr "E110: Falta un ')'"
+
+#: eval.c:2323
+msgid "E111: Missing ']'"
+msgstr "E111: Falta un ']'"
+
+#: eval.c:2399
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Falta el nom de l'opció: %s"
+
+#: eval.c:2417
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: L'opció és desconeguda: %s"
+
+#: eval.c:2481
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Falten cometes: %s"
+
+#: eval.c:2613
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Falten cometes: %s"
+
+#: eval.c:2964
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Arguments no vàlids per la funció %s"
+
+#: eval.c:2993
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: La funció és desconeguda: %s"
+
+#: eval.c:2994
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Massa arguments per la funció: %s"
+
+#: eval.c:2995
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Falten arguments per la funció: %s"
+
+# traducció "lliure". eac
+#: eval.c:2996
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Heu usat <SID> en un context no vàlid: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3586 gui.c:4254 gui_gtk.c:1997
+msgid "&Ok"
+msgstr "&D'acord"
+
+#: eval.c:4121
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld línies: "
+
+#: eval.c:5346
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&D'acord\n"
+"&Cancel·la"
+
+#: eval.c:5386
+msgid "called inputrestore() more often than inputsave()"
+msgstr "s'ha cridat inputrestore() més sovint que inputsave()"
+
+#: eval.c:6301
+msgid "E240: No connection to Vim server"
+msgstr "E240: No hi ha connexió amb el servidor Vim"
+
+#: eval.c:6398
+msgid "E277: Unable to read a server reply"
+msgstr "E277: No s'ha pogut llegir la resposta del servidor"
+
+# «res» ? eac
+#: eval.c:6426
+msgid "E258: Unable to send to client"
+msgstr "E258: No s'ha pogut enviar res al client"
+
+# «res» ? eac
+#: eval.c:6474
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: No s'ha pogut enviar res a %s"
+
+#: eval.c:6574
+msgid "(Invalid)"
+msgstr "(No vàlid)"
+
+#: eval.c:7689
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: La variable no està definida: %s"
+
+#: eval.c:8121
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: El nom de la variable és il·legal: %s"
+
+#: eval.c:8409
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: La funció %s ja existeix, afegiu ! per substituir-la"
+
+#: eval.c:8476
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: La funció no està definida: %s"
+
+#: eval.c:8489
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Falta un '(': %s"
+
+#: eval.c:8522
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: L'argument és il·legal: %s"
+
+#: eval.c:8601
+msgid "E126: Missing :endfunction"
+msgstr "E126: Falta una declaració :endfunction"
+
+#: eval.c:8684
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: No s'ha pogut redefinir la funció %s: s'està utilitzant"
+
+#: eval.c:8752
+msgid "E129: Function name required"
+msgstr "E129: Es requereix un nom de funció"
+
+#: eval.c:8803
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: El nom de la funció ha de començar en majúscula: %s"
+
+#: eval.c:8995
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: La funció no està definida: %s"
+
+#: eval.c:9000
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: No s'ha pogut eliminar la funció %s: s'està utilitzant"
+
+#: eval.c:9048
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: La profunditat de crides a funcions és superior a 'maxfuncdeptg'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9101
+#, c-format
+msgid "calling %s"
+msgstr "cridant a %s"
+
+#: eval.c:9163
+#, c-format
+msgid "%s aborted"
+msgstr "s'ha avortat %s"
+
+#: eval.c:9165
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ha retornat #%ld"
+
+#: eval.c:9172
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ha retornat \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9188 ex_cmds2.c:2244
+#, c-format
+msgid "continuing in %s"
+msgstr "continuant a %s"
+
+#: eval.c:9214
+msgid "E133: :return not inside a function"
+msgstr "E133: L'ordre :return no es troba dins d'una funció"
+
+#: eval.c:9545
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr "\n# variables globals:\n"
+
+#: ex_cmds2.c:83
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Mode de depuració. Escriviu \"cont\" per continuar."
+
+#: ex_cmds2.c:87 ex_docmd.c:854
+#, c-format
+msgid "line %ld: %s"
+msgstr "línia %ld: %s"
+
+#: ex_cmds2.c:89
+#, c-format
+msgid "cmd: %s"
+msgstr "ordre: %s"
+
+#: ex_cmds2.c:281
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Punt de ruptura a \"%s%s\" línia %ld"
+
+#: ex_cmds2.c:531
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: No s'ha trobat el punt de ruptura: %s"
+
+#: ex_cmds2.c:557
+msgid "No breakpoints defined"
+msgstr "No s'han definit punts de ruptura"
+
+#: ex_cmds2.c:562
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s línia %ld"
+
+# Títol d'un diàleg [:browse w]. eac
+#: ex_cmds.c:2082 ex_cmds.c:2347 ex_cmds2.c:754
+msgid "Save As"
+msgstr "Anomena i desa"
+
+#: ex_cmds2.c:777
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Voleu desar els canvis a \"%.*s\"?"
+
+#: ex_cmds2.c:779 ex_docmd.c:8917
+msgid "Untitled"
+msgstr "Sense-nom"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: No s'han desat els canvis en el buffer \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Atenció: S'ha canviat de buffer inesperadament (reviseu les auto-ordres)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Només hi ha un fitxer per editar"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: No es pot anar més enllà del primer fitxer"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: No es pot anar més enllà de l'últim fitxer"
+
+#: ex_cmds2.c:1841
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Cercant \"%s\" a \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Cercant \"%s\""
+
+# «runtimepath». eac
+#: ex_cmds2.c:1884
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "no s'ha trobat en el 'runtimepath': \"%s\""
+
+# Títol d'un diàleg [:browse source]. eac
+#: ex_cmds2.c:1918
+msgid "Source Vim script"
+msgstr "Executa un script Vim"
+
+#: ex_cmds2.c:2069
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "No es pot executar un directori: \"%s\""
+
+#: ex_cmds2.c:2099
+#, c-format
+msgid "could not source \"%s\""
+msgstr "no s'ha pogut executar \"%s\""
+
+#: ex_cmds2.c:2101
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "línia %ld: no s'ha pogut executar \"%s\""
+
+#: ex_cmds2.c:2115
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "executant \"%s\""
+
+#: ex_cmds2.c:2117
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "línia %ld: executant \"%s\""
+
+#: ex_cmds2.c:2242
+#, c-format
+msgid "finished sourcing %s"
+msgstr "ha finalitzat l'execució de %s"
+
+#: ex_cmds2.c:2580
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Atenció: El separador de línia no és vàlid, potser falta un ^M"
+
+# «sourced file». eac
+#: ex_cmds2.c:2629
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: L'ordre :scriptencoding només es pot utilitzar en scripts"
+
+# «sourced file». eac
+#: ex_cmds2.c:2662
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: L'ordre :finish només es pot utilitzar en scripts"
+
+#: ex_cmds2.c:3105
+#, c-format
+msgid "Page %d"
+msgstr "Pàgina %d"
+
+#: ex_cmds2.c:3261
+msgid "No text to be printed"
+msgstr "No hi ha text per imprimir"
+
+#: ex_cmds2.c:3339
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "S'està imprimint la pàgina %d (%d%%)"
+
+#: ex_cmds2.c:3348
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Còpia %d de %d"
+
+#: ex_cmds2.c:3406
+#, c-format
+msgid "Printed: %s"
+msgstr "S'ha imprès: %s"
+
+#: ex_cmds2.c:3413
+msgid "Printing aborted"
+msgstr "S'ha avortat l'impressió"
+
+#: ex_cmds2.c:3778
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Error en escriure el fitxer PostScript"
+
+#: ex_cmds2.c:4053
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: No s'ha pogut obrir el fitxer \"%s\""
+
+#: ex_cmds2.c:4063 ex_cmds2.c:4688
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: No s'ha pogut llegir el fitxer de recursos PostScript \"%s\""
+
+#: ex_cmds2.c:4071
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: El fitxer \"%s\" no és un fitxer de recursos PostScript"
+
+#: ex_cmds2.c:4086 ex_cmds2.c:4106 ex_cmds2.c:4121 ex_cmds2.c:4143
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: El fitxer de recursos PostScript \"%s\" no està suportat"
+
+#: ex_cmds2.c:4173
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: La versió del fitxer de recursos \"%s\" no és vàlida"
+
+#: ex_cmds2.c:4640
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: No s'ha pogut obrir el fitxer PostScript generat"
+
+#: ex_cmds2.c:4673
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: No s'ha pogut obrir el fitxer \"%s\""
+
+#: ex_cmds2.c:4792
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: No s'ha trobat el fitxer de recursos PostScript \"prolog.ps\""
+
+#: ex_cmds2.c:4823
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: No s'ha trobat el fitxer de recursos PostScript \"%s.ps\""
+
+#: ex_cmds2.c:4841
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: No s'ha pogut convertir la codificació multi-octet a \"%s\""
+
+#: ex_cmds2.c:4966
+msgid "Sending to printer..."
+msgstr "S'està enviant a la impressora..."
+
+#: ex_cmds2.c:4970
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Error en imprimir el fitxer PostScript"
+
+#: ex_cmds2.c:4972
+msgid "Print job sent."
+msgstr "S'ha enviat la tasca d'impressió."
+
+# les cadenes substituïdes no es poden traduïr. eac
+#: ex_cmds2.c:5381
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Idioma actual ( %s): \"%s\""
+
+#: ex_cmds2.c:5392
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: No s'ha pogut canviar l'idioma a \"%s\""
+
+# E.G: :ascii
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Octal %03o"
+
+#: ex_cmds.c:433
+msgid "E134: Move lines into themselves"
+msgstr "E134: No es poden moure línies cap a elles mateixes"
+
+#: ex_cmds.c:502
+msgid "1 line moved"
+msgstr "1 línia desplaçada"
+
+#: ex_cmds.c:504
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld línies desplaçades"
+
+#: ex_cmds.c:909
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld línies filtrades"
+
+#: ex_cmds.c:937
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Les auto-ordres *Filter* no poden canviar el buffer actual"
+
+#: ex_cmds.c:1022
+msgid "[No write since last change]\n"
+msgstr "[No s'han desat els últims canvis]\n"
+
+#: ex_cmds.c:1268
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s a la línia: "
+
+#: ex_cmds.c:1273
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Hi han massa errors, s'omet la resta del fitxer"
+
+# les tres següents van juntes. eac
+#: ex_cmds.c:1308
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Llegint el fitxer viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1309
+msgid " info"
+msgstr " per info"
+
+#: ex_cmds.c:1310
+msgid " marks"
+msgstr " per marques"
+
+#: ex_cmds.c:1311
+msgid " FAILED"
+msgstr " ERROR"
+
+#: ex_cmds.c:1403
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: El fitxer viminfo no es pot escriure: %s"
+
+#: ex_cmds.c:1528
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: No s'ha pogut escriure el fitxer viminfo %s!"
+
+#: ex_cmds.c:1536
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Escrivint el fitxer viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1634
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Aquest fitxer viminfo ha estat generat pel Vim %s.\n"
+
+#: ex_cmds.c:1636
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr "# El podeu editar, si aneu amb compte!\n\n"
+
+#: ex_cmds.c:1638
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Valor de 'encoding' en el moment d'escriure aquest fitxer\n"
+
+#: ex_cmds.c:1737
+msgid "Illegal starting char"
+msgstr "Caràcter inicial il·legal"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2125
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: El fitxer està carregat en un altre buffer"
+
+#: ex_cmds.c:2159
+msgid "Write partial file?"
+msgstr "Voleu escriure un fitxer parcial?"
+
+#: ex_cmds.c:2166
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Useu ! per desar una part del buffer"
+
+#: ex_cmds.c:2281
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Voleu sobrescriure el fitxer existent \"%.*s\"?"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: No hi ha nom de fitxer pel buffer %ld"
+
+#: ex_cmds.c:2390
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: No s'ha escrit el fitxer: L'opció 'write' ho impedeix"
+
+#: ex_cmds.c:2410
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"L'opció 'readonly' està activa per \"%.*s\",\n"
+"Voleu escriure'l de totes maneres?"
+
+# és un títol de diàleg [:browse edit]. eac
+#: ex_cmds.c:2575
+msgid "Edit File"
+msgstr "Edita un fitxer"
+
+#: ex_cmds.c:3147
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Una auto-ordre ha eliminat el buffer nou %s inesperadament"
+
+#: ex_cmds.c:3279
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: Argument no numèric per :z"
+
+#: ex_cmds.c:3364
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Les ordres shell no estan permeses en rvim"
+
+#: ex_cmds.c:3471
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Les expressions regulars no poden estar delimitades per lletres"
+
+# «amb» o «per» + tecles. eac
+#: ex_cmds.c:3817
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "substituir amb %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4189
+msgid "(Interrupted) "
+msgstr "(Interromput) "
+
+#: ex_cmds.c:4193
+msgid "1 substitution"
+msgstr "1 substitució"
+
+#: ex_cmds.c:4195
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld substitucions"
+
+#: ex_cmds.c:4198
+msgid " on 1 line"
+msgstr " en 1 línia"
+
+#: ex_cmds.c:4200
+#, c-format
+msgid " on %ld lines"
+msgstr " en %ld línies"
+
+#: ex_cmds.c:4251
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: No es pot executar una ordre global de forma recursiva"
+
+#: ex_cmds.c:4286
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Les ordres globals requereixen una expressió regular"
+
+#: ex_cmds.c:4335
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "S'ha trobat el patró a cada línia: %s"
+
+#: ex_cmds.c:4416
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Última cadena substituïda:\n"
+"$"
+
+#: ex_cmds.c:4529
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: No hi ha ajuda per %s"
+
+#: ex_cmds.c:4563
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "El fitxer d'ajuda \"%s\" no s'ha trobat"
+
+#: ex_cmds.c:5039
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: No és un directori: %s"
+
+#: ex_cmds.c:5067
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: No s'ha pogut obrir %s amb permís d'escriptura"
+
+#: ex_cmds.c:5102
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: No s'ha pogut obrir %s amb permís de lectura"
+
+#: ex_cmds.c:5181
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: L'etiqueta \"%s\" està duplicada en el fitxer %s"
+
+#: ex_cmds.c:5288
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Ordre de senyalització desconeguda: %s"
+
+#: ex_cmds.c:5308
+msgid "E156: Missing sign name"
+msgstr "E156: Falta el nom del senyal"
+
+#: ex_cmds.c:5354
+msgid "E612: Too many signs defined"
+msgstr "E612: Hi han massa senyals definits"
+
+#: ex_cmds.c:5421
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: El text del senyal no és vàlid: %s"
+
+#: ex_cmds.c:5452 ex_cmds.c:5638
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: El senyal és desconegut: %s"
+
+#: ex_cmds.c:5498
+msgid "E159: Missing sign number"
+msgstr "E159: Falta el número del senyal"
+
+#: ex_cmds.c:5578
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: El nom del buffer no és vàlid: %s"
+
+#: ex_cmds.c:5617
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: L'ID del senyal no és vàlida: %ld"
+
+#: ex_cmds.c:5788
+msgid "[Deleted]"
+msgstr "[Eliminat]"
+
+#: ex_docmd.c:489
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Mode Ex. Escriviu \"visual\" per tornar al mode Normal."
+
+#. must be at EOF
+#: ex_docmd.c:525
+msgid "E501: At end-of-file"
+msgstr "E501: Final del fitxer"
+
+#: ex_docmd.c:627
+msgid "E169: Command too recursive"
+msgstr "E169: L'ordre és massa recursiva"
+
+#: ex_docmd.c:1094
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: No s'ha interceptat l'excepció: %s"
+
+#: ex_docmd.c:1180
+msgid "End of sourced file"
+msgstr "Final del fitxer executat"
+
+#: ex_docmd.c:1181
+msgid "End of function"
+msgstr "Final de la funció"
+
+#: ex_docmd.c:1633
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Ús ambigu d'una ordre definida per l'usuari"
+
+#: ex_docmd.c:1647
+msgid "E492: Not an editor command"
+msgstr "E492: No és una ordre d'edició"
+
+#: ex_docmd.c:1737
+msgid "E478: Don't panic!"
+msgstr "E478: Calma!"
+
+#: ex_docmd.c:1756
+msgid "E493: Backwards range given"
+msgstr "E493: Heu especificat un interval decreixent"
+
+# és una pregunta. eac
+#: ex_docmd.c:1765
+msgid "Backwards range given, OK to swap"
+msgstr "Heu especificat un interval decreixent. El voleu invertir"
+
+#: ex_docmd.c:1876
+msgid "E494: Use w or w>>"
+msgstr "E494: Useu w o bé w>>"
+
+#: ex_docmd.c:3463
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Aquesta ordre no està disponible en aquesta versió"
+
+#: ex_docmd.c:3649
+msgid "E172: Only one file name allowed"
+msgstr "E172: Només està permès un nom de fitxer"
+
+#: ex_docmd.c:4211
+msgid "1 more file to edit. Quit anyway?"
+msgstr "Queda 1 fitxer per editar. Voleu sortir de totes maneres?"
+
+#: ex_docmd.c:4214
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Queden %d fitxers per editar. Voleu sortir de totes maneres?"
+
+#: ex_docmd.c:4221
+msgid "E173: 1 more file to edit"
+msgstr "E173: Queda 1 fitxer per editar"
+
+#: ex_docmd.c:4223
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Queden %ld fitxers per editar"
+
+#: ex_docmd.c:4318
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: L'ordre ja existeix: afegiu ! per substituir-la"
+
+#: ex_docmd.c:4428
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr "\n Nom Args Abast Completar Definició"
+
+#: ex_docmd.c:4517
+msgid "No user-defined commands found"
+msgstr "No s'han trobat ordres definides per l'usuari"
+
+#: ex_docmd.c:4549
+msgid "E175: No attribute specified"
+msgstr "E175: No heu especificat cap atribut"
+
+#: ex_docmd.c:4601
+msgid "E176: Invalid number of arguments"
+msgstr "E176: El nombre d'arguments no és vàlid"
+
+#: ex_docmd.c:4616
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: El comptador no es pot especificar dos cops"
+
+#: ex_docmd.c:4626
+msgid "E178: Invalid default value for count"
+msgstr "E178: El valor per omissió del comptador no és vàlid"
+
+# «completar» eac
+#: ex_docmd.c:4657
+msgid "E179: argument required for complete"
+msgstr "E179: La funció completar requereix un argument"
+
+# «completar» eac
+#: ex_docmd.c:4689
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: El valor per la funció completar no és vàlid: %s"
+
+# «completar» eac
+#: ex_docmd.c:4694
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Els esquemes de completar requereixen una funció com a argument"
+
+# «completar» eac
+#: ex_docmd.c:4699
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: L'argument de completar només està permès en esquemes personalitzats"
+
+#: ex_docmd.c:4709
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: L'atribut no és vàlid: %s"
+
+#: ex_docmd.c:4752
+msgid "E182: Invalid command name"
+msgstr "E182: El nom de l'ordre no és vàlid"
+
+#: ex_docmd.c:4767
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Les ordres definides per l'usuari han de començar en majúscula"
+
+#: ex_docmd.c:4837
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: No existeix tal ordre definida per l'usuari: %s"
+
+#: ex_docmd.c:5294
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: No s'ha trobat l'esquema de colors %s"
+
+#: ex_docmd.c:5302
+msgid "Greetings, Vim user!"
+msgstr "Salutacions, usuari de Vim!"
+
+# Títol d'un diàleg [:browse split] eac
+#: ex_docmd.c:6013
+msgid "Edit File in new window"
+msgstr "Edita un fitxer en una finestra nova"
+
+#: ex_docmd.c:6300
+msgid "No swap file"
+msgstr "No hi ha fitxer d'intercanvi"
+
+# És un títol d'un diàleg [:browse read] eac
+#: ex_docmd.c:6404
+msgid "Append File"
+msgstr "Afegeix un fitxer"
+
+#: ex_docmd.c:6468
+msgid "E186: No previous directory"
+msgstr "E186: No hi ha cap directori anterior"
+
+#: ex_docmd.c:6550
+msgid "E187: Unknown"
+msgstr "E187: Desconegut"
+
+#: ex_docmd.c:6635
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: L'ordre :winsize requereix dos arguments numèrics"
+
+#: ex_docmd.c:6686
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Posició de la finestra: X %d, Y %d"
+
+#: ex_docmd.c:6691
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: En aquesta plataforma no es pot obtenir la posició de la finestra"
+
+#: ex_docmd.c:6701
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: L'ordre :winpos requereix dos arguments numèrics"
+
+# És el títol d'un diàleg. eac
+#: ex_docmd.c:6980
+msgid "Save Redirection"
+msgstr "Desa la redirecció"
+
+# És el títol d'un diàleg. eac
+#: ex_docmd.c:7131
+msgid "Save View"
+msgstr "Desa la vista"
+
+# És el títol d'un diàleg. eac
+#: ex_docmd.c:7132
+msgid "Save Session"
+msgstr "Desa la sessió"
+
+# És el títol d'un diàleg. eac
+#: ex_docmd.c:7134
+msgid "Save Setup"
+msgstr "Desa la configuració"
+
+#: ex_docmd.c:7285
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" existeix (afegiu ! per confirmar)"
+
+#: ex_docmd.c:7290
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: No s'ha pogut obrir \"%s\" amb permís d'escriptura"
+
+#. set mark
+#: ex_docmd.c:7314
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: L'argument ha de ser una lletra o bé un accent obert o tancat"
+
+#: ex_docmd.c:7356
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Ús recursiu de :normal massa profund"
+
+#: ex_docmd.c:7869
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: No hi ha cap nom de fitxer alternatiu per substituir '#'"
+
+#: ex_docmd.c:7900
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: No hi ha cap nom de fitxer d'auto-ordres per substituir \"<afile>\""
+
+#: ex_docmd.c:7908
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: No hi ha cap nombre de buffer d'auto-ordres per substituir \"<abuf>\""
+
+#: ex_docmd.c:7919
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: No hi ha cap nom d'auto-ordre per substituir \"<amatch>\""
+
+#: ex_docmd.c:7929
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: No hi ha cap script per substituir \"<sfile>\""
+
+#: ex_docmd.c:7970
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: El nom de fitxer per '%' o '#' està buit, només funciona amb \":p:h\""
+
+#: ex_docmd.c:7972
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: S'evalua com a cadena buida"
+
+#: ex_docmd.c:8899
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: No s'ha pogut obrir el fitxer viminfo amb permís de lectura"
+
+#: ex_docmd.c:9072
+msgid "E196: No digraphs in this version"
+msgstr "E196: Aquesta versió no suporta dígrafs"
+
+#: ex_eval.c:423
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: No es poden generar exepcions amb el prefix 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:509
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Excepció generada: %s"
+
+#: ex_eval.c:556
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Exepció finalitzada: %s"
+
+#: ex_eval.c:557
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Exepció descartada: %s"
+
+#: ex_eval.c:600 ex_eval.c:644
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, línia %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:618
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Excepció interceptada: %s"
+
+#: ex_eval.c:693
+#, c-format
+msgid "%s made pending"
+msgstr "%s està pendent"
+
+#: ex_eval.c:696
+#, c-format
+msgid "%s resumed"
+msgstr "%s s'ha continuat"
+
+#: ex_eval.c:700
+#, c-format
+msgid "%s discarded"
+msgstr "%s s'ha descartat"
+
+#: ex_eval.c:726
+msgid "Exception"
+msgstr "Exepció"
+
+#: ex_eval.c:732
+msgid "Error and interrupt"
+msgstr "Error i interrupció"
+
+#: ex_eval.c:734 gui.c:4253
+msgid "Error"
+msgstr "Error"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:736
+msgid "Interrupt"
+msgstr "Interrupció"
+
+#: ex_eval.c:810
+msgid "E579: :if nesting too deep"
+msgstr "E579: Imbricació de :if massa profunda"
+
+#: ex_eval.c:847
+msgid "E580: :endif without :if"
+msgstr "E580: Declaració :endif sense :if"
+
+#: ex_eval.c:891
+msgid "E581: :else without :if"
+msgstr "E581: Declaració :else sense :if"
+
+#: ex_eval.c:894
+msgid "E582: :elseif without :if"
+msgstr "E582: Declaració :elseif sense :if"
+
+#: ex_eval.c:901
+msgid "E583: multiple :else"
+msgstr "E583: Múltiples :else"
+
+#: ex_eval.c:904
+msgid "E584: :elseif after :else"
+msgstr "E584: Declaració :elseif després de :else"
+
+#: ex_eval.c:971
+msgid "E585: :while nesting too deep"
+msgstr "E585: Imbricació de :while massa profunda"
+
+#: ex_eval.c:1027
+msgid "E586: :continue without :while"
+msgstr "E586: Declaració :continue sense :while"
+
+#: ex_eval.c:1067
+msgid "E587: :break without :while"
+msgstr "E587: Declaració :break sense :while"
+
+#: ex_eval.c:1266
+msgid "E601: :try nesting too deep"
+msgstr "E601: Imbricació de :try massa profunda"
+
+#: ex_eval.c:1346
+msgid "E603: :catch without :try"
+msgstr "E603: Declaració :catch sense :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1368
+msgid "E604: :catch after :finally"
+msgstr "E604: Declaració :catch després de :finally"
+
+#: ex_eval.c:1501
+msgid "E606: :finally without :try"
+msgstr "E606: Declaració :finally sense :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1525
+msgid "E607: multiple :finally"
+msgstr "E607: Múltiples :finally"
+
+#: ex_eval.c:1634
+msgid "E602: :endtry without :try"
+msgstr "E602: Declaració :endtry sense :try"
+
+#: ex_eval.c:1966
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: Declaració :endfunction fora d'una funció"
+
+# context? eac
+#: ex_getln.c:3153
+msgid "tagname"
+msgstr "nom de l'etiqueta"
+
+# context? eac
+#: ex_getln.c:3156
+msgid " kind file\n"
+msgstr " tipus de fitxer\n"
+
+#: ex_getln.c:4507
+msgid "'history' option is zero"
+msgstr "l'opció 'history' és zero"
+
+#: ex_getln.c:4747
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr "\n# Historial %s (de més a menys recent):\n"
+
+#: ex_getln.c:4748
+msgid "Command Line"
+msgstr "d'ordres"
+
+#: ex_getln.c:4749
+msgid "Search String"
+msgstr "de cadenes cercades"
+
+#: ex_getln.c:4750
+msgid "Expression"
+msgstr "d'expressions"
+
+#: ex_getln.c:4751
+msgid "Input Line"
+msgstr "de línies d'entrada"
+
+#: ex_getln.c:4781
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar fora de l'àrea de l'ordre"
+
+#: ex_getln.c:4958
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: S'ha eliminat la finestra o el buffer actiu"
+
+#: fileio.c:373
+msgid "Illegal file name"
+msgstr "El nom de fitxer és il·legal"
+
+#: fileio.c:397 fileio.c:522 fileio.c:2690 fileio.c:2731
+msgid "is a directory"
+msgstr "és un directori"
+
+#: fileio.c:399
+msgid "is not a file"
+msgstr "no és un fitxer"
+
+#: fileio.c:544 fileio.c:3840
+msgid "[New File]"
+msgstr "[Fitxer nou]"
+
+#: fileio.c:566
+msgid "[Permission Denied]"
+msgstr "[Permís denegat]"
+
+#: fileio.c:670
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Auto-ordres *ReadPre han deixat el fitxer illegible"
+
+#: fileio.c:672
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Les auto-ordres *ReadPre no poden canviar el buffer actual"
+
+#: fileio.c:693
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Llegint l'entrada estàndard...\n"
+
+#: fileio.c:699
+msgid "Reading from stdin..."
+msgstr "Llegint l'entrada estàndard..."
+
+#. Re-opening the original file failed!
+#: fileio.c:944
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: La conversió ha deixat el fitxer illegible!"
+
+#: fileio.c:1896
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1903
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1910
+msgid "[socket]"
+msgstr "[socket]"
+
+# eac només-lectura (nl)
+#: fileio.c:1918
+msgid "[RO]"
+msgstr "[NL]"
+
+#: fileio.c:1928
+msgid "[CR missing]"
+msgstr "[falten caràcters CR]"
+
+# entra en conflicte amb NL (només lectura)
+#: fileio.c:1933
+msgid "[NL found]"
+msgstr "[s'han trobat caràcters NL]"
+
+#: fileio.c:1938
+msgid "[long lines split]"
+msgstr "[línies llargues partides]"
+
+#: fileio.c:1944 fileio.c:3824
+msgid "[NOT converted]"
+msgstr "[NO convertit]"
+
+#: fileio.c:1949 fileio.c:3829
+msgid "[converted]"
+msgstr "[convertit]"
+
+#: fileio.c:1956 fileio.c:3854
+msgid "[crypted]"
+msgstr "[xifrat]"
+
+#: fileio.c:1963
+msgid "[CONVERSION ERROR]"
+msgstr "[ERROR DE CONVERSIÓ]"
+
+#: fileio.c:1969
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[OCTET IL·LEGAL a la línia %ld]"
+
+#: fileio.c:1976
+msgid "[READ ERRORS]"
+msgstr "[ERRORS DE LECTURA]"
+
+#: fileio.c:2192
+msgid "Can't find temp file for conversion"
+msgstr "No s'ha trobat el fitxer temporal per la conversió"
+
+#: fileio.c:2199
+msgid "Conversion with 'charconvert' failed"
+msgstr "La conversió amb 'charconvert' ha fallat"
+
+#: fileio.c:2202
+msgid "can't read output of 'charconvert'"
+msgstr "No s'ha pogut llegir la sortida de 'charconvert'"
+
+#: fileio.c:2605
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Auto-ordres han eliminat o alliberat el buffer a escriure"
+
+#: fileio.c:2628
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Una auto-ordre ha canviat el nombre de línies de forma inesperada"
+
+#: fileio.c:2696 fileio.c:2714
+msgid "is not a file or writable device"
+msgstr "no és un fitxer o dispositiu que es pugui escriure"
+
+#: fileio.c:2766
+msgid "is read-only (add ! to override)"
+msgstr "és un fitxer de només lectura (afegiu ! per confirmar)"
+
+#: fileio.c:3072
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: No s'ha pogut escriure la còpia de seguretat (afegiu ! per confirmar)"
+
+#: fileio.c:3084
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: Error en tancar el fitxer còpia de seguretat (afegiu ! per confirmar)"
+
+#: fileio.c:3086
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: Error de lectura en fer la còpia de seguretat (afegiu ! per confirmar)"
+
+#: fileio.c:3102
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: No s'ha pogut crear la còpia de seguretat (afegiu ! per confirmar)"
+
+#: fileio.c:3205
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: No s'ha pogut fer la còpia de seguretat (afegiu ! per confirmar)"
+
+# «resource fork» (MacOS) ?
+#: fileio.c:3267
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: La bifurcació de recursos es perdrà (afegiu ! per confirmar)"
+
+#: fileio.c:3368
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: No s'ha trobat el fitxer temporal per escriure-hi"
+
+#: fileio.c:3386
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: No s'ha pogut convertir (afegiu ! per desar sense conversió)"
+
+#: fileio.c:3421
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: No s'ha pogut obrir el fitxer enllaçat per escriure-hi"
+
+#: fileio.c:3425
+msgid "E212: Can't open file for writing"
+msgstr "E212: No s'ha pogut obrir el fitxer amb permís d'escriptura"
+
+#: fileio.c:3675
+msgid "E512: Close failed"
+msgstr "E512: Error en tancar"
+
+#: fileio.c:3746
+msgid "E513: write error, conversion failed"
+msgstr "E512: Error d'escriptura, ha fallat la conversió"
+
+#: fileio.c:3752
+msgid "E514: write error (file system full?)"
+msgstr "E514: Error d'escriptura (sistema de fitxers ple?)"
+
+#: fileio.c:3819
+msgid " CONVERSION ERROR"
+msgstr " ERROR DE CONVERSIÓ"
+
+#: fileio.c:3835
+msgid "[Device]"
+msgstr "[Dispositiu]"
+
+#: fileio.c:3840
+msgid "[New]"
+msgstr "[Nou]"
+
+#: fileio.c:3862
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:3862
+msgid " appended"
+msgstr " afegits"
+
+#: fileio.c:3864
+msgid " [w]"
+msgstr " [e]"
+
+#: fileio.c:3864
+msgid " written"
+msgstr " escrits"
+
+#: fileio.c:3917
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: no s'ha pogut desar el fitxer original"
+
+#: fileio.c:3939
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: no s'ha pogut tocar el fitxer original buit"
+
+#: fileio.c:3954
+msgid "E207: Can't delete backup file"
+msgstr "E207: No s'ha pogut eliminar la còpia de seguretat"
+
+#: fileio.c:4018
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr "\nATENCIÓ: El fitxer original es pot haver fet malbé\n"
+
+#: fileio.c:4020
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "no sortiu de l'editor fins que s'hagi desat el fitxer amb èxit!"
+
+#: fileio.c:4109
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4109
+msgid "[dos format]"
+msgstr "[format dos]"
+
+#: fileio.c:4116
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4116
+msgid "[mac format]"
+msgstr "[format mac]"
+
+#: fileio.c:4123
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4123
+msgid "[unix format]"
+msgstr "[format unix]"
+
+#: fileio.c:4150
+msgid "1 line, "
+msgstr "1 línia, "
+
+#: fileio.c:4152
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld línies, "
+
+#: fileio.c:4155
+msgid "1 character"
+msgstr "1 caràcter"
+
+#: fileio.c:4157
+#, c-format
+msgid "%ld characters"
+msgstr "%ld caràcters"
+
+# «no final de línia» eac
+#: fileio.c:4167
+msgid "[noeol]"
+msgstr "[nofl]"
+
+#: fileio.c:4167
+msgid "[Incomplete last line]"
+msgstr "[Última línia incompleta]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4186
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ATENCIÓ: El fitxer ha canviat des de que s'ha llegit!!!"
+
+# pregunta ask_yesno() eac
+#: fileio.c:4188
+msgid "Do you really want to write to it"
+msgstr "Esteu segurs que voleu escriure'l"
+
+#: fileio.c:5229
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Error en escriure \"%s\""
+
+#: fileio.c:5236
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Error en tancar \"%s\""
+
+#: fileio.c:5239
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Error en llegir \"%s\""
+
+#: fileio.c:5459
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: L'auto-ordre FileChangedShell ha eliminat el buffer"
+
+#: fileio.c:5467
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Atenció: El fitxer \"%s\" ha deixat d'estar disponible"
+
+#: fileio.c:5480
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: Atenció: Tant el fitxer \"%s\" com el buffer del Vim han canviat"
+
+# massa llarg? eac
+#: fileio.c:5483
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Atenció: El fitxer \"%s\" ha canviat des de que s'ha començat a editar"
+
+# massa llarg? eac
+#: fileio.c:5485
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Atenció: Els permisos de \"%s\" han canviat des que s'ha començat a editar"
+
+# massa llarg? eac
+#: fileio.c:5495
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Atenció: El fitxer \"%s\" ha estat creat després que s'ha començat a editar"
+
+#: fileio.c:5512
+msgid "Warning"
+msgstr "Atenció"
+
+#: fileio.c:5513
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&D'acord\n"
+"&Carrega el fitxer"
+
+#: fileio.c:5611
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: No s'han pogut fer les preparacions per rellegir \"%s\""
+
+#: fileio.c:5630
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: No s'ha pogut rellegir \"%s\""
+
+#: fileio.c:6212
+msgid "--Deleted--"
+msgstr "--Eliminat--"
+
+#. the group doesn't exist
+#: fileio.c:6372
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: No existeix tal grup: \"%s\""
+
+#: fileio.c:6497
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Caràcter il·legal després de *: %s"
+
+#: fileio.c:6508
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: No existeix tal esdeveniment: %s"
+
+#. Highlight title
+#: fileio.c:6657
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr "\n--- Auto-ordres ---"
+
+#: fileio.c:6928
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: No es poden executar auto-ordres per TOTS els esdeveniments"
+
+#: fileio.c:6951
+msgid "No matching autocommands"
+msgstr "No coincideix cap auto-ordre"
+
+#: fileio.c:7271
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: Imbricació d'auto-ordres massa profunda"
+
+#: fileio.c:7539
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "auto-ordres %s per \"%s\""
+
+#: fileio.c:7547
+#, c-format
+msgid "Executing %s"
+msgstr "Executant %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7615
+#, c-format
+msgid "autocommand %s"
+msgstr "auto-ordre %s"
+
+#: fileio.c:8182
+msgid "E219: Missing {."
+msgstr "E219: Falta un {."
+
+#: fileio.c:8184
+msgid "E220: Missing }."
+msgstr "E220: Falta un }."
+
+#: fold.c:66
+msgid "E490: No fold found"
+msgstr "E490: No s'ha trobat cap plec"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: No es pot crear cap plec amb el 'foldmethod' actual"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: No pot eliminar el plec amb el 'foldmethod' actual"
+
+#: getchar.c:246
+msgid "E222: Add to read buffer"
+msgstr "E222: No es pot modificar un buffer de lectura"
+
+#: getchar.c:2156
+msgid "E223: recursive mapping"
+msgstr "E223: assignació recursiva"
+
+#: getchar.c:3022
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: ja existeix una abreviació global per %s"
+
+#: getchar.c:3025
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: ja existeix una assignació global per %s"
+
+#: getchar.c:3152
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: ja existeix una abreviació per %s"
+
+#: getchar.c:3155
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: ja existeix una assignació per %s"
+
+#: getchar.c:3219
+msgid "No abbreviation found"
+msgstr "No s'ha trobat cap abreviació"
+
+#: getchar.c:3221
+msgid "No mapping found"
+msgstr "No s'ha trobat cap assignació"
+
+#: getchar.c:4111
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Mode il·legal"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<no es pot obrir> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: no s'ha pogut obtenir la font %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: no s'ha pogut tornar al directori actual"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Ubicació:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: no s'ha pogut obtenir el directori actual"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "D'acord"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2634 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Cancel·la"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Diàleg del Vim"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Barra de desplaçament: No s'ha pogut obtenir la mida del mapa de bits."
+
+#: gui_beval.c:98
+#~ msgid "E232: Cannot create BalloonEval with both message and callback"
+#~ msgstr ""
+
+#: gui.c:219
+msgid "E229: Cannot start the GUI"
+msgstr "E229: No s'ha pogut iniciar l'interfície gràfica"
+
+#: gui.c:348
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: No s'ha pogut llegir \"%s\""
+
+#: gui.c:473
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: El valor de 'guifontwide' no és vàlid"
+
+#: gui.c:3939
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: No s'ha pogut assignar memòria pel color %s"
+
+#: gui_gtk.c:1563
+msgid "Vim dialog..."
+msgstr "Diàleg del Vim..."
+
+#: gui_gtk.c:1998 message.c:2766
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Sí\n"
+"&No\n"
+"&Cancel·la"
+
+#: gui_gtk.c:2161
+msgid "Input _Methods"
+msgstr "_Mètodes d'entrada"
+
+#: gui_gtk.c:2427 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Cerca i substitueix..."
+
+#: gui_gtk.c:2435 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Cerca..."
+
+#: gui_gtk.c:2467 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Cerca:"
+
+#: gui_gtk.c:2487 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Substituieix amb:"
+
+#. whole word only button
+#: gui_gtk.c:2519 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Només paraules senceres"
+
+#. match case button
+#: gui_gtk.c:2532 gui_motif.c:3048
+msgid "Match case"
+msgstr "Sensible a les majúscules"
+
+#: gui_gtk.c:2544 gui_motif.c:2990
+msgid "Direction"
+msgstr "Direcció"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2556 gui_motif.c:3002
+msgid "Up"
+msgstr "Amunt"
+
+#: gui_gtk.c:2560 gui_motif.c:3010
+msgid "Down"
+msgstr "Avall"
+
+#: gui_gtk.c:2586 gui_gtk.c:2588 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Cerca el següent"
+
+#: gui_gtk.c:2605 gui_gtk.c:2607 gui_motif.c:2809
+msgid "Replace"
+msgstr "Substitueix"
+
+#: gui_gtk.c:2618 gui_gtk.c:2620 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Substitueix-les totes"
+
+#: gui_gtk_x11.c:2285
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: S'ha rebut una petició \"die\" del gestor de sessions\n"
+
+#: gui_gtk_x11.c:3474
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: La finestra principal ha estat destruïda inesperadament\n"
+
+#: gui_gtk_x11.c:4088
+msgid "Font Selection"
+msgstr "Selecció de tipus de lletra"
+
+#: gui_gtk_x11.c:5944 ui.c:2009
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "S'ha usat CUT_BUFFER0 en lloc d'una selecció buida"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtre"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Directoris"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Ajuda"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Fitxers"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Selecció"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Desfés"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: No s'ha pogut carregar el tipus Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: No es pot utilitzar el tipus %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr "\nEnviant un missatge per finalitzar el procés fill.\n"
+
+#: gui_w32.c:760
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument no suportat: \"-%s\"; Useu la versió OLE."
+
+#: gui_w48.c:2048
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Cerca una cadena (useu '\\\\' per cercar '\\')"
+
+#: gui_w48.c:2073
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Cerca i substitueix (useu '\\\\' per cercar '\\')"
+
+#: gui_x11.c:1479
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: No s'ha pogut assignar memòria per colors, poden ser incorrectes"
+
+#: gui_x11.c:2060
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: En el conjunt %s falten tipus pels següents jocs de caràcters:"
+
+#: gui_x11.c:2103
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nom del conjunt de tipus: %s"
+
+#: gui_x11.c:2104
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "El tipus '%s' no és d'amplada fixa"
+
+#: gui_x11.c:2123
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nom del conjunt de tipus: %s\n"
+
+#: gui_x11.c:2124
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Tipus0: %s\n"
+
+#: gui_x11.c:2125
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Tipus1: %s\n"
+
+#: gui_x11.c:2126
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "L'amplada del tipus%d no és el doble que la del tipus0\n"
+
+#: gui_x11.c:2127
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Amplada del tipus0: %ld\n"
+
+#: gui_x11.c:2128
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr "Amplada del tipus1: %ld\n\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ERROR de l'autòmata hangul"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Afegeix una base de dades nova"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Consulta un patró"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Mostra aquest missatge"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Talla una connexió"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Reinicia totes les connexions"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Mostra les connexions"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Forma d'ús: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Aquesta ordre de cscope no suporta divisió de finestres.\n"
+
+#: if_cscope.c:170
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Forma d'ús: cstag <despl>"
+
+#: if_cscope.c:226
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: No s'ha trobat l'etiqueta"
+
+#: if_cscope.c:404
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: Error de stat(%s): %d"
+
+#: if_cscope.c:414
+msgid "E563: stat error"
+msgstr "E563: Error de stat()"
+
+#: if_cscope.c:511
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s no és un directori o una base de dades de cscope vàlida"
+
+#: if_cscope.c:526
+#, c-format
+msgid "Added cscope database %s"
+msgstr "S'ha afegit la base de dades cscope %s"
+
+#: if_cscope.c:581
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: Error en llegir la connexió cscope %ld"
+
+#: if_cscope.c:686
+msgid "E561: unknown cscope search type"
+msgstr "E561: Tipus de cerca cscope desconeguda"
+
+#: if_cscope.c:728
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: No s'han pogut crear canonades cscope"
+
+#: if_cscope.c:745
+msgid "E622: Could not fork for cscope"
+msgstr "E622: No s'ha pogut bifurcar el procés cscope"
+
+#: if_cscope.c:839 if_cscope.c:889
+msgid "cs_create_connection exec failed"
+msgstr "l'execució de cs_create_connection ha fallat"
+
+#: if_cscope.c:890
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: No s'ha pogut generar un procés per cscope"
+
+#: if_cscope.c:903
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen per to_fp ha fallat"
+
+#: if_cscope.c:905
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen per fr_fp ha fallat"
+
+#: if_cscope.c:943
+msgid "E567: no cscope connections"
+msgstr "E567: No hi han connexions cscope"
+
+#: if_cscope.c:1017
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: Cap resultat per la consulta cscope %s de %s"
+
+#: if_cscope.c:1074
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: El senyal cscopequickfix %c no és vàlid per %c"
+
+#: if_cscope.c:1131
+msgid "cscope commands:\n"
+msgstr "ordres de cscope:\n"
+
+#: if_cscope.c:1134
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Forma d'ús: %s)"
+
+#: if_cscope.c:1232
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: No s'ha pogut obrir la base de dades cscope: %s"
+
+#: if_cscope.c:1250
+msgid "E626: cannot get cscope database information"
+msgstr "E626: No s'ha pogut obtenir l'informació de la base de dades cscope"
+
+#: if_cscope.c:1275
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: No s'ha afegit una base de dades cscope duplicada"
+
+#: if_cscope.c:1286
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: S'ha assolit el màxim nombre de connexions cscope"
+
+#: if_cscope.c:1402
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: No s'ha trobat la connexió cscope %s"
+
+#: if_cscope.c:1436
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "s'ha tancat la connexió cscope %s"
+
+#. should not reach here
+#: if_cscope.c:1576
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: Error fatal a cs_manage_matches"
+
+#: if_cscope.c:1836
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Etiqueta cscope: %s"
+
+#: if_cscope.c:1840
+msgid ""
+"\n"
+" # line"
+msgstr "\n # línia"
+
+#: if_cscope.c:1842
+msgid "filename / context / line\n"
+msgstr "fitxer / context / línia\n"
+
+#: if_cscope.c:1993
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Error de cscope: %s"
+
+#: if_cscope.c:2155
+msgid "All cscope databases reset"
+msgstr "S'han reiniciat totes les bases de dades cscope"
+
+#: if_cscope.c:2223
+msgid "no cscope connections\n"
+msgstr "no hi ha connexions cscope\n"
+
+#: if_cscope.c:2227
+msgid " # pid database name prepend path\n"
+msgstr " # pid base de dades prefix d'ubicació\n"
+
+#: if_python.c:394
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: Aquesta ordre està deshabilitada, no s'ha pogut carregar Python."
+
+#: if_python.c:596
+msgid "can't delete OutputObject attributes"
+msgstr "no s'han pogut eliminar els atributs de l'OutputObject"
+
+#: if_python.c:603
+msgid "softspace must be an integer"
+msgstr "'softspace' ha de ser un nombre enter"
+
+#: if_python.c:611
+msgid "invalid attribute"
+msgstr "l'atribut no és vàlid"
+
+#: if_python.c:650 if_python.c:664
+msgid "writelines() requires list of strings"
+msgstr "la funció writelines() requereix una llista de cadenes"
+
+#: if_python.c:790
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Error en inicialitzar els objectes d'E/S"
+
+#: if_python.c:975 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "l'expressió no és vàlida"
+
+#: if_python.c:989 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "no s'ha compilat suport per expressions"
+
+#: if_python.c:1002
+msgid "attempt to refer to deleted buffer"
+msgstr "intent de referència a un buffer eliminat"
+
+#: if_python.c:1017 if_python.c:1058 if_python.c:1122 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "nombre de línia fora d'abast"
+
+#: if_python.c:1257
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<objecte buffer (eliminat) a %8lX>"
+
+#: if_python.c:1348 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "nom de marca no vàlid"
+
+#: if_python.c:1623
+msgid "no such buffer"
+msgstr "no existeix tal buffer"
+
+#: if_python.c:1711
+msgid "attempt to refer to deleted window"
+msgstr "intent de referir-se a una finestra eliminada"
+
+#: if_python.c:1756
+msgid "readonly attribute"
+msgstr "atribut de només lectura"
+
+#: if_python.c:1769
+msgid "cursor position outside buffer"
+msgstr "posició del cursor fora del buffer"
+
+#: if_python.c:1846
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objecte finestra (eliminat) a %.8lX>"
+
+#: if_python.c:1858
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objecte finestra (desconegut) a %.8lX>"
+
+#: if_python.c:1860
+#, c-format
+msgid "<window %d>"
+msgstr "<finestra %d>"
+
+#: if_python.c:1936
+msgid "no such window"
+msgstr "no existeix tal finestra"
+
+#: if_python.c:2193 if_python.c:2228 if_python.c:2278 if_python.c:2346
+#: if_python.c:2466 if_python.c:2518 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1998
+msgid "cannot save undo information"
+msgstr "no s'ha pogut desar l'informació de desfer"
+
+#: if_python.c:2195 if_python.c:2285 if_python.c:2357
+msgid "cannot delete line"
+msgstr "no s'ha pogut esborrar la línia"
+
+#: if_python.c:2230 if_python.c:2373 if_tcl.c:690 if_tcl.c:2020
+msgid "cannot replace line"
+msgstr "no s'ha pogut substituir la línia"
+
+#: if_python.c:2389 if_python.c:2468 if_python.c:2526
+msgid "cannot insert line"
+msgstr "no s'ha pogut inserir la línia"
+
+#: if_python.c:2630
+msgid "string cannot contain newlines"
+msgstr "la cadena no pot contenir salts de línia"
+
+#: if_ruby.c:396
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: Ordre deshabilitada, no s'ha pogut carregar la biblioteca Ruby."
+
+#: if_ruby.c:459
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: estat de longjmp desconegut %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Commuta implementació/definició"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Mostra la classe base de"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Mostra el membre de la funció invalidat"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Obtenir d'un fitxer"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Obtenir d'un projecte"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Obtenir de tots els projectes"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Obtenir"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Mostra el codi font de"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Cerca un símbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Explora les classes"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Mostra la jerarquia de classes"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Mostra la jerarquia de classes restringida"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref es refereix a"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref referenciada per"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref té un"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref usada per"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Mostra docu de"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Genera docu per"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "No s'ha pogut connectar amb SNiFF+. Reviseu l'entorn (sniffemacs ha d'estar en el $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Error de lectura. Desconnectat"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "no "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "està connectat"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Petició SNiFF+ desconeguda: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Error en connectar a SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ no connectat"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: No és un buffer SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Error d'escriptura. Desconnectat"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "nombre de buffer no vàlid"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "no implementat (encara)"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "opció desconeguda"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "no s'ha pogut establir el nombre de línies"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "marca no establerta"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "fila %d columna %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "no s'ha pogut inserir/afegir la línia"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "senyal desconegut: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "vimOption desconeguda"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "interrupció de teclat"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "error de vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "no s'ha pogut crear l'ordre de buffer/finestra: l'objecte està siguent eliminat"
+
+#: if_tcl.c:1545
+#~ msgid ""
+#~ "cannot register callback command: buffer/window is already being deleted"
+#~ msgstr ""
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: ERROR FATAL DE TCL: llista de referències corrupta!? Comuniqueu-ho a vim-dev@vim.org."
+
+#: if_tcl.c:1563
+#~ msgid "cannot register callback command: buffer/window reference not found"
+#~ msgstr ""
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "E571: Aquesta ordre està deshabilitada: No s'ha pogut carregar la llibreria Tcl."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: ERROR DE TCL: el codi de retorn no és un enter!? Comuniqueu-ho a vim-dev@vim.org."
+
+#: if_tcl.c:2006
+msgid "cannot get line"
+msgstr "no s'ha pogut obtenir la línia"
+
+#: if_xcmdsrv.c:215
+msgid "Unable to register a command server name"
+msgstr "No s'ha pogut registrar un nom de servidor d'ordres"
+
+#: if_xcmdsrv.c:465
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: No s'ha pogut enviar l'ordre al programa destinatari"
+
+#: if_xcmdsrv.c:735
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: S'ha usat una ID de servidor no vàlida: %s"
+
+#: if_xcmdsrv.c:1098
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: El registre de l'instància de VIM està mal format. S'ha esborrat!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "L'opció és desconeguda"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Massa arguments d'edició"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Falta un argument després de"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Porqueria després de l'opció"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "Massa arguments \"+ordre\", \"-c ordre\" o \"--cmd ordre\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Argument no vàlid per"
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Aquest Vim no ha estat compilat amb suport per diff."
+
+#: main.c:928
+msgid "Attempt to open script file again: \""
+msgstr "Reintent d'obrir l'script: \""
+
+#: main.c:932 main.c:939 main.c:983 memline.c:3682 memline.c:3686
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:937
+msgid "Cannot open for reading: \""
+msgstr "No s'ha pogut obrir amb permís de lectura: \""
+
+#: main.c:981
+msgid "Cannot open for script output: \""
+msgstr "No s'ha pogut obrir per desar-hi l'exida de l'script: \""
+
+#: main.c:1115
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d fitxers per editar\n"
+
+#: main.c:1205
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Atenció: La sortida no està connectada a un terminal\n"
+
+#: main.c:1207
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Atenció: L'entrada no està connectada a un terminal\n"
+
+#. just in case..
+#: main.c:1269
+msgid "pre-vimrc command line"
+msgstr "línia d'ordres pre-vimrc"
+
+#: main.c:1304
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: No s'ha pogut llegir \"%s\""
+
+#: main.c:2346
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr "\nMés informació amb: \"vim -h\"\n"
+
+#: main.c:2379
+msgid "[file ..] edit specified file(s)"
+msgstr "[fitxer ...] edita el(s) fitxer(s) especificat(s)"
+
+#: main.c:2380
+msgid "- read text from stdin"
+msgstr "- edita el text de l'entrada estàndard"
+
+#: main.c:2381
+msgid "-t tag edit file where tag is defined"
+msgstr "-t etiqueta edita el fitxer on hi ha l'etiqueta"
+
+#: main.c:2383
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [ftxerrors] edita el fitxer on hi ha el primer error"
+
+#: main.c:2392
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr "\n\n ús:"
+
+#: main.c:2395
+msgid " vim [arguments] "
+msgstr " vim [arguments] "
+
+#: main.c:2399
+msgid ""
+"\n"
+" or:"
+msgstr "\no bé:"
+
+#: main.c:2402
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr "\n\nArguments:\n"
+
+#: main.c:2403
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tDesprés d'això només noms de fitxers"
+
+#: main.c:2405
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tNo expandeix patrons de noms"
+
+#: main.c:2408
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistra aquest gvim per OLE"
+
+#: main.c:2409
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tDesregistra aquest gvim per OLE"
+
+#: main.c:2412
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tUsa una interfície gràfica (com \"gvim\")"
+
+#: main.c:2413
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f o --nofork\tNo crea un procés nou per la GUI"
+
+#: main.c:2415
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tMode Vi (com \"vi\")"
+
+#: main.c:2416
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tMode Ex (com \"ex\")"
+
+#: main.c:2417
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tMode silenciós (només per \"ex\")"
+
+#: main.c:2419
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tMode diff (com \"vimdiff\")"
+
+#: main.c:2421
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tMode senzill (com \"evim\", sense modes)"
+
+#: main.c:2422
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tMode només lectura (com \"view\")"
+
+#: main.c:2423
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tMode restringit (com \"rvim)"
+
+#: main.c:2424
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tNo permet modificar (escriure) fitxers"
+
+#: main.c:2425
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tNo permet modificar el text"
+
+#: main.c:2426
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tMode binari"
+
+#: main.c:2428
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tMode Lisp"
+
+#: main.c:2430
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tCompatible amb Vi"
+
+#: main.c:2431
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tNo del tot compatible amb Vi"
+
+#: main.c:2432
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tNivell de loquacitat"
+
+#: main.c:2433
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tMode de depuració"
+
+#: main.c:2434
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNo usa fitxers d'intercanvi, només memòria"
+
+#: main.c:2435
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tLlista els fitxers d'intercanvi i surt"
+
+#: main.c:2436
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (amb nom de fitxer) Recupera una sessió accidentada"
+
+#: main.c:2437
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tIgual que -r"
+
+#: main.c:2439
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNo obre una finestra nova amb newcli"
+
+#: main.c:2440
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <dispositiu>\t\tUsa <dispositiu> per l'E/S"
+
+#: main.c:2443
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tComença en mode àrab"
+
+#: main.c:2446
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tComença en mode hebreu"
+
+#: main.c:2449
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\t Comença en mode farsi"
+
+#: main.c:2451
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tDefineix el tipus de terminal"
+
+#: main.c:2452
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tUsa <vimrc> en lloc de qualsevol altre .vimrc"
+
+#: main.c:2454
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tUsa <gvimrc> en lloc de qualsevol altre .gvimrc"
+
+#: main.c:2456
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNo carrega cap plugin"
+
+#: main.c:2457
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tObre N finestres (per omissió: una per fitxer)"
+
+#: main.c:2458
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tCom -o però amb divisions verticals"
+
+#: main.c:2459
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tComença al final del fitxer"
+
+#: main.c:2460
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnúm>\t\tComença a la línia <lnúm>"
+
+#: main.c:2462
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <ordre>\tExecuta <ordre> abans de llegir els fitxers vimrc"
+
+#: main.c:2464
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <ordre>\t\tExecuta <ordre> després de carregar el primer fitxer"
+
+#: main.c:2465
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <fitxer>\t\tEvalua <fitxer> un cop carregat el primer fitxer"
+
+#: main.c:2466
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <script>\t\tLlegeix ordres del mode Normal del fitxer <script>"
+
+#: main.c:2467
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <script>\t\tAfegeix totes les ordres executades al fitxer <script>"
+
+#: main.c:2468
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <script>\t\tEscriu totes les ordres executades al fitxer <script>"
+
+#: main.c:2470
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEdita fitxers amb xifrat"
+
+#: main.c:2474
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <pantalla>\tConnecta el Vim a un servidor X particular"
+
+#: main.c:2476
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNo es connecta a cap servidor X"
+
+#: main.c:2479
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <fitxers>\tEdita <fitxers> en un servidor Vim, si és possible"
+
+#: main.c:2480
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <fitxers> Igual, no es queixa si no hi ha servidor"
+
+#: main.c:2481
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <fitxers> Com --remote, però espera que s'editin els fitxers"
+
+#: main.c:2482
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <fitxers> Igual, no es queixa si no hi ha servidor"
+
+#: main.c:2483
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <tecles> Envia <tecles> a un servidor Vim i surt"
+
+#: main.c:2484
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tEvaula <expr> en un servidor Vim i mostra el resultat"
+
+#: main.c:2485
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tLlista els noms dels servidors Vim accessibles"
+
+#: main.c:2486
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <nom>\tEnvia a o es converteix en servidor Vim <nom>"
+
+#: main.c:2489
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tUsa <viminfo> en lloc de .viminfo"
+
+#: main.c:2491
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h o --help\tMostra aquesta ajuda i surt"
+
+#: main.c:2492
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tMostra informació sobre la versió i surt"
+
+#: main.c:2496
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr "\nArguments reconeguts pel gvim (versió Motif):\n"
+
+#: main.c:2500
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr "\nArguments reconeguts pel gvim (versió neXtaw>:\n"
+
+#: main.c:2502
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr "\nArguments reconeguts pel gvim (versió Athena):\n"
+
+#: main.c:2506
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <pantalla>\tExecuta vim a <pantalla>"
+
+#: main.c:2507
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tComença iconificat"
+
+#: main.c:2509
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nom>\t\tUsa els recursos com si vim fós <nom>"
+
+#: main.c:2510
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (No implementat)\n"
+
+#: main.c:2512
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\tUsa <color> pel fons (també: -bg)"
+
+#: main.c:2513
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tUsa <color> pel text normal (també: -fg)"
+
+#: main.c:2514 main.c:2534
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <tipus>\tUsa <tipus> pel text normal (també: -fn)"
+
+#: main.c:2515
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <tipus>\tUsa <tipus> pel text en negreta"
+
+#: main.c:2516
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <tipus>\tUsa <tipus> pel text en cursiva"
+
+#: main.c:2517 main.c:2535
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tUsa <geom> com a geometria inicial (també: -geom)"
+
+#: main.c:2518
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <amplada>\tUsa un marge d'amplada <amplada> (també: -bw)"
+
+#: main.c:2519
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <amplada> Amplada de la barra de desplaçament (també: -sw)"
+
+#: main.c:2521
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <alçada>\tAlçada de la barra de menú (també: -mh)"
+
+#: main.c:2523 main.c:2536
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tUsa el mode de video invers (també: -rv)"
+
+#: main.c:2524
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNo usa el mode de video invers (també: +rv)"
+
+#: main.c:2525
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <recurs>\tEstableix el recurs especificat"
+
+#: main.c:2528
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr "\nArguments reconeguts pel gvim (versió RISC OS):\n"
+
+#: main.c:2529
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <nombre>\tAmplada inicial de la finestra en columnes"
+
+#: main.c:2530
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <nombre>\tAlçada inicial de la finestra en files"
+
+#: main.c:2533
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr "\nArguments reconeguts pel gvim (versió GTK+):\n"
+
+#: main.c:2537
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <pantalla>\tExecuta vim a <pantalla> (també: --display)"
+
+#: main.c:2539
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <rol>\t\tUsa un únic rol per identificar la finestra principal"
+
+#: main.c:2541
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tObre el vim dins d'una altra aplicació GTK"
+
+#: main.c:2543
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tMostra els arguments per Gnome"
+
+#: main.c:2775
+msgid "No display"
+msgstr "No hi ha cap pantalla"
+
+#. Failed to send, abort.
+#: main.c:2790
+msgid ": Send failed.\n"
+msgstr ": Error en enviar.\n"
+
+#. Let vim start normally.
+#: main.c:2796
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Error en enviar. Intentant l'execució local\n"
+
+#: main.c:2834 main.c:2855
+#, c-format
+msgid "%d of %d edited"
+msgstr "editat %d de %d"
+
+#: main.c:2877
+msgid "No display: Send expression failed.\n"
+msgstr "No hi ha cap pantalla: Error en enviar l'expressió.\n"
+
+#: main.c:2889
+msgid ": Send expression failed.\n"
+msgstr ": Error en enviar l'expressió.\n"
+
+#: mark.c:656
+msgid "No marks set"
+msgstr "No hi ha marques definides"
+
+#: mark.c:658
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Cap marca coincideix amb \"%s\""
+
+#. Highlight title
+#: mark.c:669
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr "\nmarca lín col fitxer/text"
+
+#. Highlight title
+#: mark.c:707
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr "\n salt lín col fitxer/text"
+
+#: mark.c:1072
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr "\n# Marques de fitxer:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1107
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr "\n# Llista de salts (de més a menys recent):\n"
+
+#: mark.c:1202
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr "\n# Historial de marques en fitxers (de més a menys recent):\n"
+
+#: mark.c:1285
+msgid "Missing '>'"
+msgstr "Falta un '>'"
+
+#: mbyte.c:409
+msgid "E543: Not a valid codepage"
+msgstr "E543: No és un codi de pàgina vàlid"
+
+#: mbyte.c:4081
+msgid "E284: Cannot set IC values"
+msgstr "E284: No s'han pogut establir els valors del context d'entrada"
+
+#: mbyte.c:4233
+msgid "E285: Failed to create input context"
+msgstr "E285: Error en crear el context d'entrada"
+
+#: mbyte.c:4380
+msgid "E286: Failed to open input method"
+msgstr "E286: Error en obrir el mètode d'entrada"
+
+#: mbyte.c:4391
+#~ msgid "E287: Warning: Could not set destroy callback to IM"
+#~ msgstr ""
+
+#: mbyte.c:4397
+msgid "E288: input method doesn't support any style"
+msgstr "E288: el mètode d'entrada no suporta cap estil"
+
+#: mbyte.c:4454
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: el mètode d'entrada no suporta el tipus de preedició"
+
+#: mbyte.c:4528
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: L'estil over-the-spot requereix un conjunt de tipus"
+
+#: mbyte.c:4560
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: La llibreria GTK+ és anterior a 1.2.3. Es deshabilita l'àrea d'estat"
+
+#: mbyte.c:4839
+msgid "E292: Input Method Server is not running"
+msgstr "E292: El servidor de mètodes d'entrada (IMS) no està funcionant"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: El bloc no estava bloquejat"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Error de posició quan es llegia el fitxer d'intercanvi"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: Error de lectura en el fitxer d'intercanvi"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Error de posició quan s'escrivia el fitxer d'intercanvi"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: Error d'escriptura en el fitxer d'intercanvi"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: El fitxer d'intercanvi encara existeix"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: No s'ha pogut obtenir el bloc 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: No s'ha pogut obtenir el bloc 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: No s'ha pogut obtenir el bloc 3?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ep! El fitxer d'intercanvi s'ha perdut!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: No s'ha pogut reanomenar el fitxer d'intercanvi"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Error en obrir el fitxer d'intercanvi de \"%s\", no es podrà recuperar"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: No s'ha pogut obtenir el bloc 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: No s'ha trobat el fitxer d'intercanvi de %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Entreu el número del fitxer d'intercanvi a utilitzar (0 per sortir): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: No s'ha pogut obrir %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "No s'ha pogut llegir el bloc 0 de "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr "\nO bé no s'han fet canvis, o el Vim no ha actualitzat el fitxer d'intercanvi."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " no es pot utilitzar amb aquesta versió de Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Useu Vim versió 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s no sembla un fitxer d'intercanvi de Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " no es pot utilitzar en aquest ordinador.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "El fitxer va ser creat el "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"o el fitxer està fet malbé."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "S'està utilitzant el fitxer d'intercanvi \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Fitxer original \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Atenció: El fitxer original pot haver canviat"
+
+#: memline.c:963
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: No s'ha pogut llegir el bloc 1 de %s"
+
+#: memline.c:967
+msgid "???MANY LINES MISSING"
+msgstr "???FALTEN MOLTES LÍNIES"
+
+#: memline.c:983
+msgid "???LINE COUNT WRONG"
+msgstr "???COMPTADOR DE LÍNIA INCORRECTE"
+
+#: memline.c:990
+msgid "???EMPTY BLOCK"
+msgstr "???BLOC BUIT"
+
+#: memline.c:1016
+msgid "???LINES MISSING"
+msgstr "???FALTEN LÍNIES"
+
+#: memline.c:1048
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: L'ID del bloc 1 no és correcta (%s no és un fitxer .swp?)"
+
+#: memline.c:1053
+msgid "???BLOCK MISSING"
+msgstr "???FALTA UN BLOC"
+
+#: memline.c:1069
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? Des d'aquí fins ???FINAL les línies poden estar equivocades"
+
+#: memline.c:1085
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? Des d'aquí fins ???FINAL hi pot haver línies inserides/eliminades"
+
+#: memline.c:1105
+msgid "???END"
+msgstr "???FINAL"
+
+#: memline.c:1131
+msgid "E311: Recovery Interrupted"
+msgstr "E311: S'ha interromput la recuperació"
+
+#: memline.c:1133
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: S'han detectat errors en la recuperació; busqueu línies amb ???"
+
+#: memline.c:1136
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "S'ha completat la recuperació. Haurieu de revisar que tot sigui correcte."
+
+#: memline.c:1137
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr "\n(Potser voleu desar aquest fitxer amb un altre nom\n"
+
+#: memline.c:1138
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "i fer un diff amb el fitxer original per veure els canvis)\n"
+
+#: memline.c:1139
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr "Elimina el fitxer .swp tot seguit.\n\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1195
+msgid "Swap files found:"
+msgstr "Fitxers d'intercanvi trobats:"
+
+#: memline.c:1373
+msgid " In current directory:\n"
+msgstr " En el directori actual:\n"
+
+#: memline.c:1375
+msgid " Using specified name:\n"
+msgstr " Usant el nom especificat:\n"
+
+#: memline.c:1379
+msgid " In directory "
+msgstr " En el directori "
+
+#: memline.c:1397
+msgid " -- none --\n"
+msgstr " -- cap --\n"
+
+#: memline.c:1469
+msgid " owned by: "
+msgstr " propietat de: "
+
+#: memline.c:1471
+msgid " dated: "
+msgstr " amb data: "
+
+#: memline.c:1475 memline.c:3689
+msgid " dated: "
+msgstr " amb data: "
+
+#: memline.c:1491
+msgid " [from Vim version 3.0]"
+msgstr " [del Vim versió 3.0]"
+
+#: memline.c:1495
+msgid " [does not look like a Vim swap file]"
+msgstr " [no sembla un fitxer d'intercanvi de Vim]"
+
+#: memline.c:1499
+msgid " file name: "
+msgstr " nom del fitxer: "
+
+#: memline.c:1505
+msgid ""
+"\n"
+" modified: "
+msgstr "\n modificat: "
+
+#: memline.c:1506
+msgid "YES"
+msgstr "SÍ"
+
+#: memline.c:1506
+msgid "no"
+msgstr "no"
+
+#: memline.c:1510
+msgid ""
+"\n"
+" user name: "
+msgstr "\n nom de l'usuari: "
+
+#: memline.c:1517
+msgid " host name: "
+msgstr " màquina: "
+
+#: memline.c:1519
+msgid ""
+"\n"
+" host name: "
+msgstr "\n màquina: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" process ID: "
+msgstr "\n ID del procés: "
+
+#: memline.c:1531
+msgid " (still running)"
+msgstr " (encara funcionant)"
+
+#: memline.c:1543
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr "\n [no usable amb aquesta versió de Vim]"
+
+#: memline.c:1546
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr "\n [no usable en aquesta computadora]"
+
+#: memline.c:1551
+msgid " [cannot be read]"
+msgstr " [no es pot llegir]"
+
+#: memline.c:1555
+msgid " [cannot be opened]"
+msgstr " [no es pot obrir]"
+
+#: memline.c:1745
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: No s'ha pogut preservar, no hi ha fitxer d'intercanvi"
+
+#: memline.c:1798
+msgid "File preserved"
+msgstr "S'ha preservat el fitxer"
+
+#: memline.c:1800
+msgid "E314: Preserve failed"
+msgstr "E314: La preservació ha fallat"
+
+#: memline.c:1871
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: lnum no vàlid: %ld"
+
+#: memline.c:1897
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: no s'ha trobat la línia %ld"
+
+#: memline.c:2287
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: Punter a la id d'un bloc incorrecte 3"
+
+#: memline.c:2367
+msgid "stack_idx should be 0"
+msgstr "stack_idx hauria de ser 0"
+
+#: memline.c:2429
+msgid "E318: Updated too many blocks?"
+msgstr "E318: S'han actualitzat massa blocs?"
+
+#: memline.c:2611
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: Punter a la id d'un bloc incorrecte 4"
+
+#: memline.c:2638
+msgid "deleted block 1?"
+msgstr "s'ha eliminat el bloc 1?"
+
+#: memline.c:2838
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: No s'ha trobat la línia %ld"
+
+#: memline.c:3081
+msgid "E317: pointer block id wrong"
+msgstr "E317: Punter a la id d'un bloc incorrecte"
+
+#: memline.c:3097
+msgid "pe_line_count is zero"
+msgstr "po_line_count és zero"
+
+#: memline.c:3126
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: Nombre de línia fora d'abast: %ld passat el final"
+
+#: memline.c:3130
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: Comptador de línia incorrecte al bloc %ld"
+
+#: memline.c:3179
+msgid "Stack size increases"
+msgstr "La mida de la pila s'incrementa"
+
+#: memline.c:3225
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: Punter a la id d'un bloc incorrecte 2"
+
+#: memline.c:3679
+msgid "E325: ATTENTION"
+msgstr "E325: ATENCIÓ"
+
+#: memline.c:3680
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr "\nS'ha trobat un fitxer d'intercanvi de nom \""
+
+#: memline.c:3684
+msgid "While opening file \""
+msgstr "Mentre s'obria el fitxer \""
+
+#: memline.c:3693
+msgid " NEWER than swap file!\n"
+msgstr " MÉS NOU que el fitxer d'intercanvi!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3697
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Un altre programa pot estar editant aquest mateix fitxer.\n"
+" En aquest cas, aneu amb compte de no acabar amb dues\n"
+" instàncies diferents del mateix fitxer quan feu canvis.\n"
+
+#: memline.c:3698
+msgid " Quit, or continue with caution.\n"
+msgstr " Sortiu, o continueu amb precaució.\n"
+
+#: memline.c:3699
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr "\n(2) El Vim s'ha estrellat mentre s'editava aquest fitxer.\n"
+
+#: memline.c:3700
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " En aquest cas, useu \":recover\" o bé \"vim -r "
+
+#: memline.c:3702
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" per recuperar els canvis (vegeu \":help recovery\").\n"
+
+#: memline.c:3703
+msgid " If you did this already, delete the swap file \""
+msgstr " Si ja ho heu fet, elimineu el fitxer \""
+
+#: memline.c:3705
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" per evitar aquest missatge.\n"
+
+#: memline.c:3719 memline.c:3723
+msgid "Swap file \""
+msgstr "El fitxer d'intercanvi \""
+
+#: memline.c:3720 memline.c:3726
+msgid "\" already exists!"
+msgstr "\" ja existeix!"
+
+#: memline.c:3729
+msgid "VIM - ATTENTION"
+msgstr "VIM - ATENCIÓ"
+
+#: memline.c:3731
+msgid "Swap file already exists!"
+msgstr "El fitxer d'intercanvi ja existeix!"
+
+#: memline.c:3735
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Obre en mode només lectura\n"
+"&Edita\n"
+"&Recupera\n"
+"&Surt"
+
+#: memline.c:3737
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Obre en mode només lectura\n"
+"&Edita\n"
+"&Recupera\n"
+"&Surt\n"
+"E&limina'l"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: S'han trobat massa fitxers d'intercanvi"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Part de l'ubicació del menú no és submenú"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: El menú només existeix en un altre mode"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: No hi ha cap menú amb aquest nom"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: L'ubicació del menú no pot portar a un submenú"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: No es poden afegir ítems de menú directament a la barra de menú"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Un separador no pot formar part de l'ubicació de menú"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1079
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr "\n--- Menús ---"
+
+#: menu.c:1996
+msgid "Tear off this menu"
+msgstr "Estripa aquest menú"
+
+#: menu.c:2061
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: L'ubicació de menú ha de portar a un ítem de menú"
+
+#: menu.c:2081
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: No s'ha trobat el menú: %s"
+
+#: menu.c:2150
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: El menú no està definit pel mode %s"
+
+#: menu.c:2188
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: L'ubicació de menú ha de portar a un submenú"
+
+#: menu.c:2209
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: No s'ha trobat el menú - reviseu els noms dels menús"
+
+#: message.c:519
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "S'ha detectat un error en processar %s:"
+
+#: message.c:535
+#, c-format
+msgid "line %4ld:"
+msgstr "línia %4ld:"
+
+#: message.c:575
+msgid "[string too long]"
+msgstr "[cadena massa llarga]"
+
+#: message.c:721
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Traducció dels missatges: Ernest Adrogué <eadrogue@gmx.net>"
+
+#: message.c:945
+msgid "Interrupt: "
+msgstr "Interrupció: "
+
+#: message.c:948
+msgid "Hit ENTER to continue"
+msgstr "Premeu ENTRAR per continuar"
+
+#: message.c:950
+msgid "Hit ENTER or type command to continue"
+msgstr "Premeu ENTRAR o introduïu una ordre per continuar"
+
+#: message.c:2253
+msgid "-- More --"
+msgstr "-- Més --"
+
+#: message.c:2256
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (ENTRAR/RETROCÉS: línia, ESPAI/b; pàgina, d/u; mitja pàgina, q: surt)"
+
+#: message.c:2257
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (ENTRAR: línia, ESPAI: pàgina, d: mitja pàgina, q: surt)"
+
+#: message.c:2749 message.c:2764
+msgid "Question"
+msgstr "Pregunta"
+
+#: message.c:2751
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Sí\n"
+"&No"
+
+#: message.c:2784
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Sí\n"
+"&No\n"
+"Desa-ho &tot\n"
+"&Descarta-ho tot\n"
+"&Cancel·la"
+
+#: message.c:2825
+msgid "Save File dialog"
+msgstr "Diàleg de desar fitxer"
+
+#: message.c:2827
+msgid "Open File dialog"
+msgstr "Diàleg d'obrir fitxer"
+
+#. TODO: non-GUI file selector here
+#: message.c:2898
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: No hi ha un explorador de fitxers en mode consola"
+
+#: misc1.c:2681
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Atenció: S'està canviant un fitxer de només lectura"
+
+#: misc1.c:2916
+msgid "1 more line"
+msgstr "1 línia més"
+
+#: misc1.c:2918
+msgid "1 line less"
+msgstr "1 línia menys"
+
+#: misc1.c:2923
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld línies més"
+
+#: misc1.c:2925
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld línies menys"
+
+#: misc1.c:2928
+msgid " (Interrupted)"
+msgstr " (Interromput)"
+
+#: misc1.c:6620
+msgid "Vim: preserving files...\n"
+msgstr "Vim: preservant els fitxers...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6630
+msgid "Vim: Finished.\n"
+msgstr "Vim: Finalitzat.\n"
+
+#: misc2.c:670 misc2.c:686
+msgid "ERROR: "
+msgstr "ERROR: "
+
+#: misc2.c:690
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr "\n[octets] total assignat-alliberat %lu-%lu, en ús %lu, màxim ús %lu\n"
+
+#: misc2.c:692
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr "[crides] total re/malloc() %lu, total free() %lu\n\n"
+
+#: misc2.c:747
+msgid "E340: Line is becoming too long"
+msgstr "E340: La línia s'està tornant massa llarga"
+
+#: misc2.c:791
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Error intern: lalloc(%ld, )"
+
+#: misc2.c:899
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Memòria exhaurida! (assignant %lu octets)"
+
+#: misc2.c:2565
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "S'està cridant l'intèrpret d'ordres per executar: \"%s\""
+
+#: misc2.c:2786
+msgid "E545: Missing colon"
+msgstr "E545: Falta un caràcter \":\""
+
+#: misc2.c:2788 misc2.c:2815
+msgid "E546: Illegal mode"
+msgstr "E546: Mode il·legal"
+
+#: misc2.c:2854
+msgid "E547: Illegal mouseshape"
+msgstr "E547: La forma del punter del ratolí és il·legal"
+
+#: misc2.c:2894
+msgid "E548: digit expected"
+msgstr "E548: S'esperava un dígit"
+
+#: misc2.c:2899
+msgid "E549: Illegal percentage"
+msgstr "E549: Percentatge il·legal"
+
+#: misc2.c:3209
+msgid "Enter encryption key: "
+msgstr "Introduïu la clau de xifrat: "
+
+#: misc2.c:3210
+msgid "Enter same key again: "
+msgstr "Introduïu la mateixa clau un altre cop: "
+
+#: misc2.c:3220
+msgid "Keys don't match!"
+msgstr "La claus no coincideixen!"
+
+#: misc2.c:3769
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: Path no vàlid: '**[núm]' ha d'estar al final del path, o seguit de '%s'"
+
+#: misc2.c:5045
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: No s'ha trobat el directori \"%s\" en el cdpath"
+
+#: misc2.c:5048
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: No s'ha trobat el fitxer \"%s\" en el path"
+
+#: misc2.c:5054
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: No s'ha trobat cap més directori \"%s\" en el cdpath"
+
+#: misc2.c:5057
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: No s'ha trobat cap més fitxer \"%s\" en el path"
+
+#: misc2.c:5291
+msgid "E550: Missing colon"
+msgstr "E550: Falta un caràcter \":\""
+
+#: misc2.c:5303
+msgid "E551: Illegal component"
+msgstr "E551: Component il·legal"
+
+#: misc2.c:5311
+msgid "E552: digit expected"
+msgstr "E552: S'esperava un dígit"
+
+#. Get here when the server can't be found.
+#: netbeans.c:282
+msgid "Cannot connect to Netbeans #2"
+msgstr "No s'ha pogut connectar amb Netbeans #2"
+
+#: netbeans.c:290
+msgid "Cannot connect to Netbeans"
+msgstr "No s'ha pogut connectar amb Netbeans"
+
+#: netbeans.c:564
+msgid "read from Netbeans socket"
+msgstr "lectura d'un socket Netbeans"
+
+#: normal.c:2916
+msgid "Warning: terminal cannot highlight"
+msgstr "Atenció: el terminal no suporta ressalt"
+
+#: normal.c:3131
+msgid "E348: No string under cursor"
+msgstr "E348: No hi ha cap cadena sota el cursor"
+
+#: normal.c:3133
+msgid "E349: No identifier under cursor"
+msgstr "E349: No hi ha cap identificador sota el cursor"
+
+#: normal.c:4351
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: No es poden eliminar plecs amb el 'foldmethod' actual"
+
+#: ops.c:295
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 línia %sada 1 vegada"
+
+#: ops.c:297
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 línia %sada %d vegades"
+
+#: ops.c:302
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld línies %sades 1 vegada"
+
+#: ops.c:305
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld línies %sades %d vegades"
+
+#: ops.c:663
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld línies a sagnar... "
+
+#: ops.c:713
+msgid "1 line indented "
+msgstr "1 línia sagnada "
+
+#: ops.c:715
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld línies sagnades "
+
+#. must display the prompt
+#: ops.c:1647
+msgid "cannot yank; delete anyway"
+msgstr "no s'ha pogut copiar; voleu elimiar el text de totes maneres"
+
+#: ops.c:2155
+msgid "1 line changed"
+msgstr "1 línia canviada"
+
+#: ops.c:2157
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld línies canviades"
+
+#: ops.c:2541
+#, c-format
+msgid "freeing %ld lines"
+msgstr "alliberant %ld línies"
+
+#: ops.c:2822
+msgid "1 line yanked"
+msgstr "1 línia copiada"
+
+#: ops.c:2824
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld línies copiades"
+
+#: ops.c:3109
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: No hi ha res en el registre %s"
+
+#. Highlight title
+#: ops.c:3666
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr "\n--- Registres ---"
+
+#: ops.c:4875
+msgid "Illegal register name"
+msgstr "El nom de registre és il·legal"
+
+#: ops.c:4961
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr "\n# Registres:\n"
+
+#: ops.c:4994
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: El tipus de registre %d és desconegut"
+
+#: ops.c:5480
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: El nom de registre no és vàlid: '%s'"
+
+#: ops.c:5841
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Cols; "
+
+#: ops.c:5848
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "%s%ld de %ld Línies seleccionades; %ld de %ld Paraules; %ld de %ld Octets"
+
+#: ops.c:5864
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Col %s de %s; Línia %ld de %ld; Paraula %ld de %ld; Octet %ld de %ld"
+
+#: ops.c:5875
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld per la BOM)"
+
+#: option.c:1623
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Pàgina %N"
+
+#: option.c:2072
+msgid "Thanks for flying Vim"
+msgstr "Gràcies per utilitzar el Vim"
+
+#: option.c:3344 option.c:3451
+msgid "E518: Unknown option"
+msgstr "E518: L'opció és desconeguda"
+
+#: option.c:3357
+msgid "E519: Option not supported"
+msgstr "E519: L'opció no està suportada"
+
+#: option.c:3382
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: No està permès en una línia de mode"
+
+#: option.c:3438
+msgid ""
+"\n"
+"\tLast set from "
+msgstr "\n Definit per últim cop a "
+
+#: option.c:3577
+msgid "E521: Number required after ="
+msgstr "E521: Es requereix un número després de ="
+
+#: option.c:3903 option.c:4520
+msgid "E522: Not found in termcap"
+msgstr "E522: No s'ha trobat a la base de dades termcap"
+
+#: option.c:3969
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Caràcter il·legal <%s>"
+
+#: option.c:4512
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: No es pot definir 'term' com a cadena buida"
+
+#: option.c:4515
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: No es pot canviar de terminal en mode GUI"
+
+#: option.c:4517
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Useu \":gui\" per ininciar l'interfície d'usuari gràfica"
+
+#: option.c:4538
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: Les opcions 'backupext' i 'patchmode' coincideixen"
+
+#: option.c:4723
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: L'interfície GTK+ 2 no permet canviar la codificació"
+
+#: option.c:4879
+msgid "E524: Missing colon"
+msgstr "E524: Falta un caràcter \":\""
+
+#: option.c:4881
+msgid "E525: Zero length string"
+msgstr "E525: La llargada de la cadena és zero"
+
+#: option.c:4949
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Falta un número després de <%s>"
+
+#: option.c:4963
+msgid "E527: Missing comma"
+msgstr "E527: Falta una coma"
+
+#: option.c:4970
+msgid "E528: Must specify a ' value"
+msgstr "E528: Heu d'especificar un valor '"
+
+#: option.c:5011
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: Conté un caràcter no imprimible o ample"
+
+#: option.c:5060
+msgid "E596: Invalid font(s)"
+msgstr "E596: El tipus de lletra no és vàlid"
+
+#: option.c:5068
+msgid "E597: can't select fontset"
+msgstr "E597: No s'ha pogut seleccionar el conjunt de tipus"
+
+#: option.c:5070
+msgid "E598: Invalid fontset"
+msgstr "E598: El conjunt de tipus de lletra no és vàlid"
+
+#: option.c:5077
+msgid "E533: can't select wide font"
+msgstr "E533: No s'ha pogut seleccionar el tipus de lletra ample"
+
+#: option.c:5079
+msgid "E534: Invalid wide font"
+msgstr "E534: El tipus de lletra ample no és vàlid"
+
+#: option.c:5349
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Caràcter il·legal després de <%c>"
+
+#: option.c:5454
+msgid "E536: comma required"
+msgstr "E536: Es requereix una coma"
+
+#: option.c:5464
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: L'opció 'commentstring' ha d'estar indefinida o contenir %s"
+
+#: option.c:5537
+msgid "E538: No mouse support"
+msgstr "E538: No hi ha suport per ratolí"
+
+#: option.c:5805
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: La seqüència d'expressions no està acabada"
+
+#: option.c:5809
+msgid "E541: too many items"
+msgstr "E541: Hi han massa ítems"
+
+#: option.c:5811
+msgid "E542: unbalanced groups"
+msgstr "E542: Grups desequilibrats"
+
+#: option.c:6032
+msgid "E590: A preview window already exists"
+msgstr "E590: Ja hi ha una finestra de vista prèvia"
+
+#: option.c:6289
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: L'àrab requereix UTF-8, feu ':set encoding=utf-8'"
+
+#: option.c:6606
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Es necessiten com a mínim %d línies"
+
+#: option.c:6615
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Es necessiten com a mínim %d columnes"
+
+#: option.c:6920
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: L'opció és desconeguda: %s"
+
+#: option.c:7029
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr "\n--- Codis de terminal ---"
+
+#: option.c:7031
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr "\n--- Valors de les opcions globals ---"
+
+#: option.c:7033
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr "\n--- Valors de les opcions locals ---"
+
+#: option.c:7035
+msgid ""
+"\n"
+"--- Options ---"
+msgstr "\n--- Opcions ---"
+
+#: option.c:7736
+msgid "E356: get_varp ERROR"
+msgstr "E356: Error en get_varp()"
+
+#: option.c:8707
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': No s'ha trobat el caràcter corresponent a %s"
+
+#: option.c:8741
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Sobren caràcters després del punt i coma: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "no s'ha pogut obrir "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: No s'ha pogut obrir la finestra!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Es requereix Amigados versió 2.04 o posterior\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Es requereix %s versió %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "No s'ha pogut obrir NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "No s'ha pogut crear "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ha finalitzat amb %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "no s'ha pogut canviar el mode de consola ?!\n"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: no és una consola??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1143
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: No s'ha pogut executar l'intèrpret d'ordres amb l'opció -f"
+
+#: os_amiga.c:1184 os_amiga.c:1274
+msgid "Cannot execute "
+msgstr "No s'ha pogut executar "
+
+#: os_amiga.c:1187 os_amiga.c:1284
+msgid "shell "
+msgstr "l'intèrpret d'ordres "
+
+#: os_amiga.c:1207 os_amiga.c:1309
+msgid " returned\n"
+msgstr " ha retornat\n"
+
+#: os_amiga.c:1450
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "un valor ANCHOR_BUF_SIZE massa petit."
+
+#: os_amiga.c:1454
+msgid "I/O ERROR"
+msgstr "ERROR d'E/S"
+
+#: os_mswin.c:517
+msgid "...(truncated)"
+msgstr "...(truncat)"
+
+#: os_mswin.c:619
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "L'opció 'columns' no és 80, no es poden executar ordres externes"
+
+#: os_mswin.c:1854
+msgid "E237: Printer selection failed"
+msgstr "E237: La selecció d'impressora ha fallat"
+
+# a IMPRESSORA a PORT ?
+#: os_mswin.c:1894
+#, c-format
+msgid "to %s on %s"
+msgstr "a %s a %s"
+
+#: os_mswin.c:1909
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Tipus de lletra d'impressió desconegut: %s"
+
+#: os_mswin.c:1959 os_mswin.c:1969
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Error d'impressió: %s"
+
+#: os_mswin.c:1970
+msgid "Unknown"
+msgstr "Desconegut"
+
+#: os_mswin.c:1997
+#, c-format
+msgid "Printing '%s'"
+msgstr "S'està imprimint '%s'"
+
+#: os_mswin.c:3083
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Conjunt de caràcters \"%s\" il·legal en el tipus \"%s\""
+
+#: os_mswin.c:3091
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Caràcter '%c' il·legal en el tipus \"%s\""
+
+#: os_riscos.c:1258
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: L'opció 'osfiletype' no és vàlida - s'usa Text"
+
+#: os_unix.c:887
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: S'ha rebut un doble senyal, sortint\n"
+
+#: os_unix.c:893
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: S'ha rebut un senyal letal %s\n"
+
+#: os_unix.c:896
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: S'ha rebut un senyal letal\n"
+
+# display
+#: os_unix.c:1159
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "S'ha trigat %ld mseg en obrir el display X"
+
+#: os_unix.c:1186
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr "\nVim: Error de X\n"
+
+# display
+#: os_unix.c:1294
+msgid "Testing the X display failed"
+msgstr "Ha fallat la comprovació del display X"
+
+# display
+#: os_unix.c:1433
+msgid "Opening the X display timed out"
+msgstr "S'ha esgotat el temps mentre es tractava d'obrir el display X"
+
+#: os_unix.c:3173 os_unix.c:3853
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr "\nNo s'ha pogut executar la shell "
+
+#: os_unix.c:3221
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr "\nNo s'ha pogut executar la shell sh\n"
+
+#: os_unix.c:3225 os_unix.c:3859
+msgid ""
+"\n"
+"shell returned "
+msgstr "\nla shell ha retornat "
+
+#: os_unix.c:3360
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr "\nNo s'han pogut crear canonades\n"
+
+#: os_unix.c:3375
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr "\nNo s'ha pogut bifurcar\n"
+
+#: os_unix.c:3866
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr "\nL'ordre ha finalitzat\n"
+
+#: os_unix.c:4119 os_unix.c:4244 os_unix.c:5902
+msgid "XSMP lost ICE connection"
+msgstr "XSMP: s'ha perdut la connexió ICE"
+
+# display
+#: os_unix.c:5486
+msgid "Opening the X display failed"
+msgstr "Ha fallat l'obertura del display X"
+
+#: os_unix.c:5808
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP: s'està duent a terme la petició save-yourself"
+
+#: os_unix.c:5925
+msgid "XSMP opening connection"
+msgstr "XSMP: obrint la connexió"
+
+#: os_unix.c:5943
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP: Ha fallat l'inspecció de la connexió ICE"
+
+#: os_unix.c:5963
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP: Ha fallat la rutina SmcOpenConnection: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "A la línia"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "No s'ha pogut assignar memòria per la línia d'ordres."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "Error del VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "No s'ha pogut carregar vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "No s'han pogut reassignar els punters de funcions a la DLL!"
+
+#: os_win16.c:341 os_win32.c:3049
+#, c-format
+msgid "shell returned %d"
+msgstr "la shell ha retornat %d"
+
+#: os_win32.c:2507
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: S'ha rebut un event %s\n"
+
+#: os_win32.c:2509
+msgid "close"
+msgstr "de finalització"
+
+#: os_win32.c:2511
+msgid "logoff"
+msgstr "de final de sessió"
+
+#: os_win32.c:2512
+msgid "shutdown"
+msgstr "d'apagament del sistema"
+
+#: os_win32.c:3002
+msgid "E371: Command not found"
+msgstr "E371: No s'ha trobat l'ordre"
+
+#: os_win32.c:3015
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"El programa VIMRUN.EXE no es troba en el $PATH.\n"
+"Les ordres externes no faran una pausa un cop finalitzades.\n"
+"Vegeu :help win32-vimrun per a més informació."
+
+#: os_win32.c:3018
+msgid "Vim Warning"
+msgstr "Vim Atenció"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Sobren %%%c a la cadena de format"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: %%%c inesperat a la cadena de format"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E364: Falta un ] a la cadena de format"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c no suportat a la cadena de format"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: %%%c no vàlid en el prefix de la cadena de format"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: %%%c no vàlid a la cadena de format"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: L'opció 'errorformat' no conté cap patró"
+
+#: quickfix.c:497
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Falta un nom de directori"
+
+#: quickfix.c:984
+msgid "E553: No more items"
+msgstr "E553: No hi ha més ítems"
+
+#: quickfix.c:1221
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d de %d)%s%s: "
+
+#: quickfix.c:1223
+msgid " (line deleted)"
+msgstr " (línia eliminada)"
+
+#: quickfix.c:1432
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Baix de la pila quickfix"
+
+#: quickfix.c:1441
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Dalt de la pila quickfix"
+
+#: quickfix.c:1453
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "llista d'errors %d de %d; %d errors"
+
+#: quickfix.c:1927
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: No s'ha pogut escriure, l'opció 'buftype' no està definida"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: Ítem no vàlid a %s%%[]"
+
+#: regexp.c:827
+msgid "E339: Pattern too long"
+msgstr "E339: El patró és massa llarg"
+
+#: regexp.c:996
+msgid "E50: Too many \\z("
+msgstr "E50: Sobren \\z("
+
+#: regexp.c:1007
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Sobren %s("
+
+#: regexp.c:1064
+msgid "E52: Unmatched \\z("
+msgstr "E52: \\z( desequilibrat"
+
+#: regexp.c:1068
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: %s%%( desequilibrat"
+
+#: regexp.c:1070
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: %s( desequilibrat"
+
+#: regexp.c:1075
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: %s) desequilibrat"
+
+#: regexp.c:1244
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: L'operand %s* podria estar buit"
+
+#: regexp.c:1247
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: L'operand %s+ podria estar buit"
+
+#: regexp.c:1301
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: Hi ha un caràcter no vàlid després de %s@"
+
+#: regexp.c:1326
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: L'operand %s{ podria estar buit"
+
+#: regexp.c:1336
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: La construcció %s{...} és massa complexa"
+
+#: regexp.c:1352
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: %s* imbricats"
+
+#: regexp.c:1355
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: %s%c imbricats"
+
+#: regexp.c:1473
+msgid "E63: invalid use of \\_"
+msgstr "E63: Ús no vàlid de \\_"
+
+#: regexp.c:1518
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E46: No ha ha res abans de %s%c"
+
+#: regexp.c:1574
+msgid "E65: Illegal back reference"
+msgstr "E65: Referència il·legal a l'element anterior"
+
+#: regexp.c:1587
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( no està permès aquí"
+
+#: regexp.c:1606
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et al. no estan permesos aquí"
+
+#: regexp.c:1617
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Hi ha un caràcter no vàlid després de \\z"
+
+#: regexp.c:1666
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Falta un ] després de %s%%["
+
+#: regexp.c:1682
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Element %s%%[] buit"
+
+#: regexp.c:1742
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Hi ha un caràcter invàlid després de %s%%"
+
+#: regexp.c:2539
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Error de sintaxi a %s{...}"
+
+#: regexp.c:2800
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Programa inestable; expressió regular massa complexa?"
+
+#: regexp.c:2941
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: El patró ha provocat un error de desbordament de pila"
+
+#: regexp.c:3180
+msgid "External submatches:\n"
+msgstr "Subcoincidències externes:\n"
+
+#: screen.c:2113
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld línies plegades "
+
+#: screen.c:7892
+msgid " VREPLACE"
+msgstr " SUBSTITUIRV"
+
+#: screen.c:7896
+msgid " REPLACE"
+msgstr " SUBSTITUIR"
+
+# En el mode d'escriptura de dreta a esquerra
+# surt el missatge «REVERSE INSERT»
+#: screen.c:7901
+msgid " REVERSE"
+msgstr " INVERS"
+
+#: screen.c:7903
+msgid " INSERT"
+msgstr " INSERIR"
+
+#: screen.c:7906
+msgid " (insert)"
+msgstr " (inserir)"
+
+#: screen.c:7908
+msgid " (replace)"
+msgstr " (substituir)"
+
+#: screen.c:7910
+msgid " (vreplace)"
+msgstr " (substituirv)"
+
+#: screen.c:7913
+msgid " Hebrew"
+msgstr " Hebreu"
+
+#: screen.c:7924
+msgid " Arabic"
+msgstr " Àrab"
+
+#: screen.c:7927
+msgid " (lang)"
+msgstr " (lang)"
+
+#: screen.c:7931
+msgid " (paste)"
+msgstr " (enganxar)"
+
+#: screen.c:7937
+msgid " SELECT"
+msgstr " SELECCIONAR"
+
+#: screen.c:7939
+msgid " VISUAL"
+msgstr " VISUAL"
+
+#: screen.c:7941
+msgid " BLOCK"
+msgstr " BLOC"
+
+#: screen.c:7943
+msgid " LINE"
+msgstr " LÍNIA"
+
+#: screen.c:7956 screen.c:8016
+msgid "recording"
+msgstr "enregistrant"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "la cerca ha arribat a DALT, es continua a BAIX"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "la cerca ha arribat a BAIX, es continua a DALT"
+
+#: search.c:525
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Cadena de cerca no vàlida: %s"
+
+#: search.c:852
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: la cerca ha arribat a DALT sense resultats per: %s"
+
+#: search.c:855
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: la cerca ha arribat a BAIX sense resultats per: %s"
+
+#: search.c:1247
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: S'esperava '?' o '/' després de ';'"
+
+#: search.c:3685
+msgid " (includes previously listed match)"
+msgstr " (inclou resultats llistats anteriorment)"
+
+#. cursor at status line
+#: search.c:3705
+msgid "--- Included files "
+msgstr "--- Fitxers inclosos "
+
+#: search.c:3707
+msgid "not found "
+msgstr "no s'ha trobat"
+
+#: search.c:3708
+msgid "in path ---\n"
+msgstr "en el path ---\n"
+
+#: search.c:3747
+msgid " (Already listed)"
+msgstr " (Ja s'havia llistat)"
+
+#: search.c:3749
+msgid " NOT FOUND"
+msgstr " NO TROBAT"
+
+#: search.c:3801
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Examinant el fitxer inclòs: %s"
+
+#: search.c:4019
+msgid "E387: Match is on current line"
+msgstr "E387: El resultat es troba a la línia actual"
+
+#: search.c:4162
+msgid "All included files were found"
+msgstr "S'han trobat tots els fitxers inclosos"
+
+#: search.c:4164
+msgid "No included files"
+msgstr "No hi han fitxers inclosos"
+
+#: search.c:4180
+msgid "E388: Couldn't find definition"
+msgstr "E388: No s'ha trobat la definició"
+
+#: search.c:4182
+msgid "E389: Couldn't find pattern"
+msgstr "E389: No s'ha trobat el patró"
+
+#: syntax.c:3015
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: L'argument és il·legal: %s"
+
+#: syntax.c:3195
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: No existeix tal grup de sintaxi: %s"
+
+#: syntax.c:3359
+msgid "No Syntax items defined for this buffer"
+msgstr "No hi ha ítems de sintaxi definits en aquest buffer"
+
+#: syntax.c:3367
+msgid "syncing on C-style comments"
+msgstr "s'està sincronitzant a partir de comentaris estil C"
+
+#: syntax.c:3375
+msgid "no syncing"
+msgstr "no es sincronitza"
+
+# va junta amb la següent
+#: syntax.c:3378
+msgid "syncing starts "
+msgstr "comença la sincronització"
+
+# va junta amb l'anterior
+#: syntax.c:3380 syntax.c:3455
+msgid " lines before top line"
+msgstr " línies abans de la línia superior"
+
+#: syntax.c:3385
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr "\n--- Ítems de sincronització de sintaxi ---"
+
+#: syntax.c:3390
+msgid ""
+"\n"
+"syncing on items"
+msgstr "\ns'està sincronitzant a partir d'ítems"
+
+#: syntax.c:3396
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr "\n--- Ítems de sintaxi ---"
+
+#: syntax.c:3419
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: No existeix tal grup de sintaxi: %s"
+
+#: syntax.c:3445
+msgid "minimal "
+msgstr "mínim "
+
+#: syntax.c:3452
+msgid "maximal "
+msgstr "màxim "
+
+#: syntax.c:3464
+msgid "; match "
+msgstr "; coincidència "
+
+#: syntax.c:3466
+msgid " line breaks"
+msgstr " salts de línia"
+
+#: syntax.c:4100
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: L'opció group[t]here no s'accepta aquí"
+
+#: syntax.c:4124
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: No s'ha trobat cap regió d'ítems per %s"
+
+#: syntax.c:4152
+msgid "E395: contains argument not accepted here"
+msgstr "E395: Conté un argument que no s'accepta aquí"
+
+#: syntax.c:4163
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: L'argument 'containedin' no s'accepta aquí"
+
+#: syntax.c:4241
+msgid "E397: Filename required"
+msgstr "E397: Es requereix un nom de fitxer"
+
+#: syntax.c:4579
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Falta un '=': %s"
+
+# 'syntax region' és una ordre
+#: syntax.c:4737
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Falten arguments: syntax region %s"
+
+#: syntax.c:5068
+msgid "E400: No cluster specified"
+msgstr "E400: No heu especificat cap grup"
+
+#: syntax.c:5105
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: No s'ha trobat el patró de delimitació: %s"
+
+#: syntax.c:5180
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Hi ha porqueria després del patró: %s"
+
+#: syntax.c:5270
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax sync: el patró de continuació de línia està repetit"
+
+#: syntax.c:5327
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Arguments il·legals: %s"
+
+#: syntax.c:5377
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Falta un signe d'igual: %s"
+
+#: syntax.c:5383
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Argument buit: %s"
+
+#: syntax.c:5410
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E402: %s no està permès aquí"
+
+#: syntax.c:5417
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ha d'anar al principi de la llista 'contains'"
+
+#: syntax.c:5487
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: El nom del grup és desconegut: %s"
+
+#: syntax.c:5720
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Sub-ordre de sintaxi no vàlida: %s"
+
+#: syntax.c:6099
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: No s'ha trobat el grup de ressalt: %s"
+
+#: syntax.c:6123
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Falten arguments: \":highlight link %s\""
+
+#: syntax.c:6130
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Sobren arguments: \":highlight link %s\""
+
+#: syntax.c:6150
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: El grup ja ha estat definit, s'ignora l'enllaç de ressalt"
+
+#: syntax.c:6279
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: Signe d'igual inesperat: %s"
+
+#: syntax.c:6315
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: Falta un signe d'igual: %s"
+
+#: syntax.c:6337
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: Falta un argument: %s"
+
+#: syntax.c:6374
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: El valor és il·legal: %s"
+
+#: syntax.c:6493
+msgid "E419: FG color unknown"
+msgstr "E419: Color de primer terme desconegut"
+
+#: syntax.c:6504
+msgid "E420: BG color unknown"
+msgstr "E420: Color de fons desconegut"
+
+#: syntax.c:6565
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Nom o número de color no identificat: %s"
+
+#: syntax.c:6771
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: El codi de terminal és massa llarg: %s"
+
+#: syntax.c:6818
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: L'argument és il·legal: %s"
+
+#: syntax.c:7347
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Hi ha massa atributs de ressalt diferents en ús"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: Baix de la pila d'etiquetes"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: Dalt de la pila d'etiquetes"
+
+#: tag.c:396
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: No es pot anar abans de la primera etiqueta coincident"
+
+#: tag.c:516
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: No s'ha trobat l'etiqueta: %s"
+
+#: tag.c:549
+msgid " # pri kind tag"
+msgstr " # pri tip etiqueta"
+
+#: tag.c:552
+msgid "file\n"
+msgstr "fitxer\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:710
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Entreu un número (<Entrar> per avortar): "
+
+#: tag.c:750
+msgid "E427: There is only one matching tag"
+msgstr "E427: Només hi ha una sola etiqueta que coincideixi"
+
+#: tag.c:752
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: No es pot anar més enllà de l'última etiqueta coincident"
+
+#: tag.c:772
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "El fitxer \"%s\" no existeix"
+
+#. Give an indication of the number of matching tags
+#: tag.c:785
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "etiqueta %d de %d%s"
+
+#: tag.c:788
+msgid " or more"
+msgstr " o més"
+
+#: tag.c:790
+msgid " Using tag with different case!"
+msgstr " No es fa distinció entre majúscules i minúscules!"
+
+#: tag.c:834
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: El fitxer \"%s\" no existeix"
+
+#. Highlight title
+#: tag.c:903
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr "\n # A etiq DES DE línia en fitxer/text"
+
+#: tag.c:1204
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Cercant en el fitxer d'etiquetes %s"
+
+#: tag.c:1388
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: S'ha truncat l'ubicació del fitxer d'etiquetes per %s\n"
+
+#: tag.c:1918
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Error de format en el fitxer d'etiquetes \"%s\""
+
+#: tag.c:1922
+#, c-format
+msgid "Before byte %ld"
+msgstr "Abans de l'octet %ld"
+
+#: tag.c:1943
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: El fitxer d'etiquetes no està ordenat: %s"
+
+#. never opened any tags file
+#: tag.c:1983
+msgid "E433: No tags file"
+msgstr "E433: No hi ha cap fitxer d'etiquetes"
+
+#: tag.c:2684
+msgid "E434: Can't find tag pattern"
+msgstr "E434: No s'ha trobat l'etiqueta"
+
+#: tag.c:2695
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: No s'ha trobat l'etiqueta exacta!"
+
+# «terminal» és masculí
+#: term.c:1745
+msgid "' not known. Available builtin terminals are:"
+msgstr "' no identificat. Els terminals disponibles són:"
+
+#: term.c:1769
+msgid "defaulting to '"
+msgstr "per omissió '"
+
+#: term.c:2127
+msgid "E557: Cannot open termcap file"
+msgstr "E557: No s'ha pogut obrir el fitxer termcap"
+
+#: term.c:2131
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: No s'ha trobat l'informació del terminal a terminfo"
+
+#: term.c:2133
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: No s'ha trobat l'informació del terminal a termcap"
+
+#: term.c:2292
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: No hi ha cap entrada \"%s\" a termcap"
+
+#: term.c:2766
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Es requereix la capacitat \"cm\" per part del terminal"
+
+#. Highlight title
+#: term.c:4970
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr "\n--- Tecles del terminal ---"
+
+#: ui.c:252
+msgid "new shell started\n"
+msgstr "s'ha iniciat una nova shell\n"
+
+#: ui.c:1784
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Error en llegir l'entrada, sortint...\n"
+
+#. must display the prompt
+#: undo.c:394
+msgid "No undo possible; continue anyway"
+msgstr "No es pot desfer res; voleu continuar"
+
+#: undo.c:549
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: els nombres de línia no són correctes"
+
+#: undo.c:718
+msgid "1 change"
+msgstr "1 canvi"
+
+#: undo.c:720
+#, c-format
+msgid "%ld changes"
+msgstr "%ld canvis"
+
+#: undo.c:764
+msgid "E439: undo list corrupt"
+msgstr "E439: La llista de desfer està corrompuda"
+
+#: undo.c:796
+msgid "E440: undo line missing"
+msgstr "E440: Falta una línia de desfer"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:696
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr "\nVersió GUI per MS-Windows 16/32 bits"
+
+#: version.c:698
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr "\nVersió GUI per MS-Windows 32 bits"
+
+#: version.c:701
+msgid " in Win32s mode"
+msgstr " en mode Win32s"
+
+#: version.c:703
+msgid " with OLE support"
+msgstr " amb suport per OLE"
+
+#: version.c:706
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr "\nVersió consola per MS-Windows 32 bits"
+
+#: version.c:710
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr "\nVersió per MS-Windows 16 bits"
+
+#: version.c:714
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr "\nVersió per MS-DOS 32 bits"
+
+#: version.c:716
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr "\nVersió per MS-DOS 16 bits"
+
+#: version.c:722
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr "\nVersió per MacOS X (Unix)"
+
+#: version.c:724
+msgid ""
+"\n"
+"MacOS X version"
+msgstr "\nVersió per MacOS X"
+
+#: version.c:727
+msgid ""
+"\n"
+"MacOS version"
+msgstr "\nVersió per MacOS"
+
+#: version.c:732
+msgid ""
+"\n"
+"RISC OS version"
+msgstr "\nVersió per RISC OS"
+
+#: version.c:742
+msgid ""
+"\n"
+"Included patches: "
+msgstr "\nModificacions incloses: "
+
+#: version.c:768 version.c:1117
+msgid "Modified by "
+msgstr "Modificat per "
+
+#: version.c:775
+msgid ""
+"\n"
+"Compiled "
+msgstr "\nCompilat "
+
+#: version.c:778
+msgid "by "
+msgstr "per "
+
+#: version.c:790
+msgid ""
+"\n"
+"Huge version "
+msgstr "\nVersió enorme "
+
+#: version.c:793
+msgid ""
+"\n"
+"Big version "
+msgstr "\nVersió gran "
+
+#: version.c:796
+msgid ""
+"\n"
+"Normal version "
+msgstr "\nVersió normal "
+
+#: version.c:799
+msgid ""
+"\n"
+"Small version "
+msgstr "\nVersió reduïda "
+
+#: version.c:801
+msgid ""
+"\n"
+"Tiny version "
+msgstr "\nVersió mínima "
+
+#: version.c:807
+msgid "without GUI."
+msgstr "sense GUI."
+
+#: version.c:812
+msgid "with GTK2-GNOME GUI."
+msgstr "amb GUI GTK2-GNOME."
+
+#: version.c:814
+msgid "with GTK-GNOME GUI."
+msgstr "amb GUI GTK-GNOME."
+
+#: version.c:818
+msgid "with GTK2 GUI."
+msgstr "amb GUI GTK2."
+
+#: version.c:820
+msgid "with GTK GUI."
+msgstr "amb GUI GTK."
+
+#: version.c:825
+msgid "with X11-Motif GUI."
+msgstr "amb GUI X11-Motif."
+
+#: version.c:829
+msgid "with X11-neXtaw GUI."
+msgstr "amb GUI X11-neXtaw."
+
+#: version.c:831
+msgid "with X11-Athena GUI."
+msgstr "amb GUI X11-Athena."
+
+#: version.c:835
+msgid "with BeOS GUI."
+msgstr "amb GUI BeOS."
+
+#: version.c:838
+msgid "with Photon GUI."
+msgstr "amb GUI Photon."
+
+#: version.c:841
+msgid "with GUI."
+msgstr "amb GUI."
+
+#: version.c:844
+msgid "with Carbon GUI."
+msgstr "amb GUI Carbon."
+
+#: version.c:847
+msgid "with Cocoa GUI."
+msgstr "amb GUI Cocoa."
+
+#: version.c:850
+msgid "with (classic) GUI."
+msgstr "amb GUI (clàssic)."
+
+#: version.c:861
+msgid " Features included (+) or not (-):\n"
+msgstr " Funcions incloses (+) o excloses (-):\n"
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:873
+msgid " system vimrc file: \""
+msgstr " fitxer vimrc del sistema: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:878
+msgid " user vimrc file: \""
+msgstr " fitxer vimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:883
+msgid " 2nd user vimrc file: \""
+msgstr " 2n fitxer vimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:888
+msgid " 3rd user vimrc file: \""
+msgstr " 3r fitxer vimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:893
+msgid " user exrc file: \""
+msgstr " fitxer exrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:898
+msgid " 2nd user exrc file: \""
+msgstr " 2n fitxer exrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:904
+msgid " system gvimrc file: \""
+msgstr " fitxer gvimrc del sistema: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:908
+msgid " user gvimrc file: \""
+msgstr " fitxer gvimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:912
+msgid "2nd user gvimrc file: \""
+msgstr "2n fitxer gvimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:917
+msgid "3rd user gvimrc file: \""
+msgstr "3r fitxer gvimrc de l'usuari: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:924
+msgid " system menu file: \""
+msgstr " fitxer de menú del sistema: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:932
+msgid " fall-back for $VIM: \""
+msgstr " alternativa per a $VIM: \""
+
+# 29 caràcters fins el ":" (inclòs)
+#: version.c:938
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " alt per a $VIMRUNTIME: \""
+
+#: version.c:942
+msgid "Compilation: "
+msgstr "Compilat amb: "
+
+#: version.c:948
+msgid "Compiler: "
+msgstr "Compilador: "
+
+#: version.c:953
+msgid "Linking: "
+msgstr "Enllaçat amb: "
+
+#: version.c:958
+msgid " DEBUG BUILD"
+msgstr " VERSIÓ DE DEPURACIÓ"
+
+#: version.c:996
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:998
+msgid "version "
+msgstr "versió "
+
+#: version.c:999
+msgid "by Bram Moolenaar et al."
+msgstr "per Bram Moolenaar et al."
+
+#: version.c:1003
+msgid "Vim is open source and freely distributable"
+msgstr "Vim és un programa de codi obert i lliure distribució"
+
+#: version.c:1005
+msgid "Help poor children in Uganda!"
+msgstr "Ajudeu els nens pobres d'Uganda!"
+
+# amplada 53 caràcters
+#: version.c:1006
+msgid "type :help iccf<Enter> for information "
+msgstr "feu :help iccf<Entrar> per més informació "
+
+# amplada 53 caràcters
+#: version.c:1008
+msgid "type :q<Enter> to exit "
+msgstr "feu :q<Entrar> per sortir "
+
+# amplada 53 caràcters
+#: version.c:1009
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "feu :help<Entrar> o <F1> per obtenir ajuda "
+
+# amplada 53 caràcters
+#: version.c:1010
+msgid "type :help version6<Enter> for version info"
+msgstr "feu :help version6<Entrar> per info de la versió "
+
+#: version.c:1013
+msgid "Running in Vi compatible mode"
+msgstr "Funcionant en mode compatible amb Vi"
+
+# amplada 53 caràcters
+#: version.c:1014
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "feu :set nocp<Entrar> pels valors per omissió"
+
+# amplada 53 caràcters
+#: version.c:1015
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "feu :help cp-default<Entrar> per info sobre el tema "
+
+# amplada 53 caràcters
+#: version.c:1030
+msgid "menu Help->Orphans for information "
+msgstr "menú Ajuda->Orfes per informació"
+
+#: version.c:1032
+msgid "Running modeless, typed text is inserted"
+msgstr "Funcionant sense modes, el text escrit s'insereix"
+
+# Això ha de lligar amb la traducció del menú
+# amplada 53 caràcters
+#: version.c:1033
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menú Edita->Opcions globals->Mode d'inserció "
+
+# amplada 53 caràcters
+#: version.c:1034
+msgid " for two modes "
+msgstr " per dos modes"
+
+# Això ha de lligar amb la traducció del menú
+# amplada 53 caràcters
+#: version.c:1038
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menú Edita->Opcions globals->Compatible amb Vi "
+
+# amplada 53 caràcters
+#: version.c:1039
+msgid " for Vim defaults "
+msgstr " pels valors per omissió"
+
+#: version.c:1085
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ATENCIÓ: S'ha detectat Windows 95/98/ME"
+
+# amplada 53 caràcters
+#: version.c:1088
+msgid "type :help windows95<Enter> for info on this"
+msgstr "feu :help windows95<Entrar> per info sobre el tema "
+
+#: window.c:204
+msgid "E441: There is no preview window"
+msgstr "E441: No hi ha cap finestra de previsualització"
+
+#: window.c:582
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: No es pot dividir horitzontal i verticalment al mateix temps"
+
+#: window.c:1341
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E442: No hi pot haver rotació quan hi ha finestres dividides"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: No es pot tancar l'última finestra"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Només hi ha una finestra"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Hi han altres finestres que contenen canvis"
+
+#: window.c:4460
+msgid "E446: No file name under cursor"
+msgstr "E446: No hi ha cap nom de fitxer sota el cursor"
+
+#: window.c:4579
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: No s'ha trobat el fitxer \"%s\" en el path"
+
+#: globals.h:1208 if_perl.xs:363
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: No s'ha pogut carregar la biblioteca %s"
+
+#: if_perl.xs:591
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "Aquesta ordre no està habilitada: no s'ha pogut carregar la biblioteca Perl."
+
+#: if_perl.xs:637
+#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+#~ msgstr ""
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Edita en &múltiples Vims"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Edita en un sol &Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "Mostra les &diferències amb Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Edita amb el &Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Edita amb el Vim existent - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Edita el(s) fitxer(s) seleccionat(s) amb el Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Error en crear el procés: Comproveu que gvim es trobi en el path!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "error de la biblioteca gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "La llargada del path és excessiva"
+
+#: globals.h:998
+msgid "--No lines in buffer--"
+msgstr "--Cap línia en el buffer--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1161
+msgid "E470: Command aborted"
+msgstr "E470: S'ha avortat l'ordre"
+
+#: globals.h:1162
+msgid "E471: Argument required"
+msgstr "E471: Es requereix un argument"
+
+#: globals.h:1163
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ hauria de continuar amb /, ? o &"
+
+#: globals.h:1165
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: No és vàlid a la línia d'ordres: <ENTRAR> executa, CTRL-C surt"
+
+#: globals.h:1167
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: Ordre en exrc/vimrc no permesa en l'actual cerca d'etiquetes o directoris"
+
+#: globals.h:1169
+msgid "E171: Missing :endif"
+msgstr "E171: Falta una declaració :endif"
+
+#: globals.h:1170
+msgid "E600: Missing :endtry"
+msgstr "E600: Falta una declaració :endtry"
+
+#: globals.h:1171
+msgid "E170: Missing :endwhile"
+msgstr "E170: Falta una declaració :endwhile"
+
+#: globals.h:1172
+msgid "E588: :endwhile without :while"
+msgstr "E588: Declaració :endwhile sense :while"
+
+#: globals.h:1174
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: El fitxer existeix (afegiu ! per confirmar)"
+
+#: globals.h:1175
+msgid "E472: Command failed"
+msgstr "E472: L'ordre ha fallat"
+
+#: globals.h:1177
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Conjunt de tipus desconegut: %s"
+
+#: globals.h:1181
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Tipus de lletra desconegut: %s"
+
+#: globals.h:1184
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: El tipus de lletra \"%s\" no és d'amplada fixa"
+
+#: globals.h:1186
+msgid "E473: Internal error"
+msgstr "E473: Error intern"
+
+#: globals.h:1187
+msgid "Interrupted"
+msgstr "Interromput"
+
+#: globals.h:1188
+msgid "E14: Invalid address"
+msgstr "E14: L'adreça no és vàlida"
+
+#: globals.h:1189
+msgid "E474: Invalid argument"
+msgstr "E474: L'argument no és vàlid"
+
+#: globals.h:1190
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: L'argument no és vàlid: %s"
+
+#: globals.h:1192
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: L'expressió no és vàlida: %s"
+
+#: globals.h:1194
+msgid "E16: Invalid range"
+msgstr "E16: L'interval no és vàlid"
+
+#: globals.h:1195
+msgid "E476: Invalid command"
+msgstr "E476: L'ordre no és vàlida"
+
+#: globals.h:1197
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" és un directori"
+
+#: globals.h:1200
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Caràcters inesperats abans de '='"
+
+#: globals.h:1203
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: La crida a la biblioteca a fallat per \"%s()\""
+
+#: globals.h:1209
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: No s'ha pogut carregar la funció %s"
+
+#: globals.h:1211
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Marca amb un número de línia no vàlid"
+
+#: globals.h:1212
+msgid "E20: Mark not set"
+msgstr "E20: Marca no establerta"
+
+#: globals.h:1213
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: No es poden fer canvis, l'opció 'modifiable' està desactivada"
+
+#: globals.h:1214
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Imbricació d'scripts massa profunda"
+
+#: globals.h:1215
+msgid "E23: No alternate file"
+msgstr "E23: No hi ha cap fitxer alternatiu"
+
+#: globals.h:1216
+msgid "E24: No such abbreviation"
+msgstr "E24: No existeix tal abreviació"
+
+#: globals.h:1217
+msgid "E477: No ! allowed"
+msgstr "E477: ! no permès"
+
+#: globals.h:1219
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: No es pot usar la GUI: No ha estat compilada"
+
+#: globals.h:1222
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: No es pot usar el mode Hebreu: No ha estat compilat\n"
+
+#: globals.h:1225
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: No es pot usar el mode Farsi: No ha estat compilat\n"
+
+#: globals.h:1228
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: No es pot usar el mode àrab: No ha estat compilat\n"
+
+#: globals.h:1231
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: No existeix tal grup de ressalt: %s"
+
+#: globals.h:1233
+msgid "E29: No inserted text yet"
+msgstr "E29: Encara no s'ha inserit text"
+
+#: globals.h:1234
+msgid "E30: No previous command line"
+msgstr "E30: No hi ha cap ordre anterior"
+
+#: globals.h:1235
+msgid "E31: No such mapping"
+msgstr "E31: No existeix tal assignació"
+
+#: globals.h:1236
+msgid "E479: No match"
+msgstr "E479: Cap coincidència"
+
+#: globals.h:1237
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Cap coincidència: %s"
+
+#: globals.h:1238
+msgid "E32: No file name"
+msgstr "E32: Falta un nom de fitxer"
+
+#: globals.h:1239
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: No hi ha cap expressió de substitució anterior"
+
+#: globals.h:1240
+msgid "E34: No previous command"
+msgstr "E34: No hi ha cap ordre anterior"
+
+#: globals.h:1241
+msgid "E35: No previous regular expression"
+msgstr "E35: No hi ha cap expressió regular anterior"
+
+#: globals.h:1242
+msgid "E481: No range allowed"
+msgstr "E481: No es permet cap interval"
+
+#: globals.h:1244
+msgid "E36: Not enough room"
+msgstr "E36: No hi ha prou espai"
+
+#: globals.h:1247
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: No hi ha cap servidor registrat amb aquest nom \"%s\""
+
+#: globals.h:1249
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: No es pot crear el fitxer %s"
+
+#: globals.h:1250
+msgid "E483: Can't get temp file name"
+msgstr "E483: No s'ha pogut obtenir el nom del fitxer temporal"
+
+#: globals.h:1251
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: No es pot obrir el fitxer %s"
+
+#: globals.h:1252
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: No es pot llegir el fitxer %s"
+
+#: globals.h:1253
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: No s'han desat els canvis (afegiu ! per confirmar)"
+
+#: globals.h:1254
+msgid "E38: Null argument"
+msgstr "E38: Argument nul"
+
+#: globals.h:1256
+msgid "E39: Number expected"
+msgstr "E39: S'esperava un número"
+
+#: globals.h:1259
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: No s'ha pogut obrir el fitxer d'errors %s"
+
+#: globals.h:1262
+msgid "E233: cannot open display"
+msgstr "E233: No s'ha pogut obrir la pantalla"
+
+#: globals.h:1264
+msgid "E41: Out of memory!"
+msgstr "E41: Memòria exhaurida!"
+
+#: globals.h:1266
+msgid "Pattern not found"
+msgstr "No s'ha trobat el patró"
+
+#: globals.h:1268
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: No s'ha trobat el patró: %s"
+
+#: globals.h:1269
+msgid "E487: Argument must be positive"
+msgstr "E487: L'argument ha de ser un número positiu"
+
+#: globals.h:1271
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: No es pot tornar al directori anterior"
+
+#: globals.h:1275
+msgid "E42: No Errors"
+msgstr "E42: No hi han errors"
+
+#: globals.h:1277
+msgid "E43: Damaged match string"
+msgstr "E43: S'ha corromput la cadena amb l'expressió regular"
+
+#: globals.h:1278
+msgid "E44: Corrupted regexp program"
+msgstr "E44: S'ha corromput el programa d'expressió regular"
+
+#: globals.h:1279
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: L'opció 'readonly' està definida (afegiu ! per confirmar)"
+
+#: globals.h:1281
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: No s'ha pogut definir la variable de només lectura \"%s\""
+
+#: globals.h:1284
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Error en llegir el fitxer d'errors"
+
+#: globals.h:1287
+#~ msgid "E48: Not allowed in sandbox"
+#~ msgstr ""
+
+#: globals.h:1289
+msgid "E523: Not allowed here"
+msgstr "E523: No està permès aquí"
+
+#: globals.h:1292
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: La funció d'ajustar el mode de pantalla no està suportada"
+
+#: globals.h:1294
+msgid "E49: Invalid scroll size"
+msgstr "E49: La distància de desplaçament no és vàlida"
+
+#: globals.h:1295
+msgid "E91: 'shell' option is empty"
+msgstr "E91: L'opció 'shell' no conté res"
+
+#: globals.h:1297
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: No s'han pogut llegir les dades del senyal!"
+
+#: globals.h:1299
+msgid "E72: Close error on swap file"
+msgstr "E72: Error en tancar el fitxer d'intercanvi"
+
+#: globals.h:1300
+msgid "E73: tag stack empty"
+msgstr "E73: La pila d'etiquetes està buida"
+
+#: globals.h:1301
+msgid "E74: Command too complex"
+msgstr "E74: L'ordre és massa complexa"
+
+#: globals.h:1302
+msgid "E75: Name too long"
+msgstr "E75: El nom és massa llarg"
+
+#: globals.h:1303
+msgid "E76: Too many ["
+msgstr "E76: Sobren caràcters ["
+
+#: globals.h:1304
+msgid "E77: Too many file names"
+msgstr "E77: Sobren noms de fitxer"
+
+#: globals.h:1305
+msgid "E488: Trailing characters"
+msgstr "E488: Sobren caràcters"
+
+#: globals.h:1306
+msgid "E78: Unknown mark"
+msgstr "E78: La marca és desconeguda"
+
+#: globals.h:1307
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: No s'ha pogut expandir el nom de fitxer"
+
+#: globals.h:1309
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: L'opció 'winheight' no pot ser menor que 'winminheight'"
+
+#: globals.h:1311
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: L'opció 'winwidth' no pot ser menor que 'winminwidth'"
+
+#: globals.h:1314
+msgid "E80: Error while writing"
+msgstr "E80: Error d'escriptura"
+
+#: globals.h:1315
+msgid "Zero count"
+msgstr "Comptador a zero"
+
+#: globals.h:1317
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Ús de <SID> en un context equivocat"
+
+#: globals.h:1320
+msgid "E449: Invalid expression received"
+msgstr "E449: S'ha rebut una expressió no vàlida"
+
+#: globals.h:1323
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: La regió està protegida, no es pot modificar"
diff --git a/src/po/cleanup.vim b/src/po/cleanup.vim
new file mode 100644
index 000000000..cb697e8b1
--- /dev/null
+++ b/src/po/cleanup.vim
@@ -0,0 +1,7 @@
+" Vim script to cleanup a .po file: comment-out fuzzy and empty messages.
+" Make sure there is a space before the string (required for Solaris).
+" Requires Vim 6.0 (because of multi-line search patterns).
+g/^#, fuzzy\(, .*\)\=\nmsgid ""\@!/.+1,/^$/-1s/^/#\~ /
+g/^msgstr"/s//msgstr "/
+g/^msgid"/s//msgid "/
+g/^msgstr ""\(\n"\)\@!/?^msgid?,.s/^/#\~ /
diff --git a/src/po/cs.cp1250.po b/src/po/cs.cp1250.po
new file mode 100644
index 000000000..04370dc07
--- /dev/null
+++ b/src/po/cs.cp1250.po
@@ -0,0 +1,5954 @@
+# Czech translation of vim
+# Jiøí Pavlovský <jpavlovsky@mbox.vol.cz>, 2000 - 2002.
+# Some completion for vim6.0 added by Jiøí Bøezina <brz@centrum.cz>
+# Some bugfixes by Tomáš Zellerin <zellerin@volny.cz>
+#
+# Generated from cs.po, DO NOT EDIT.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim-6.0\n"
+"POT-Creation-Date: 2001-10-08 08:27-0700\n"
+"PO-Revision-Date: 2002-02-06 22:29+0100\n"
+"Last-Translator: Jiøí Pavlovský <jpavlovsky@mbox.vol.cz>\n"
+"Language-Team: Czech <cs@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp1250\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nelze alokovat žádný buffer, konèím..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nelze alokovat buffer, použiji jiný..."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "Žádný buffer nebyl deaktivován"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "Žádný buffer nebyl smazán"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "Žádný buffer nebyl zahozen"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "Poèet deaktivovaných bufferù: 1"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "Poèet deaktivovaných bufferù: %d"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "Poèet smazaných bufferù: 1"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "Poèet smazaných bufferù: %d"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "Poèet zahozených bufferù: 1"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "Poèet zahozených bufferù: %d"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: Nebyl nalezen žádný zmìnìný buffer"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: Seznam bufferù je prázdný"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Nelze pøeskoèit na buffer %ld"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Za poslední buffer nelze pøeskoèit"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Pøed první buffer nelze pøeskoèit"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: Zmìny v bufferu %ld nebyly uloženy (! pro vynucení)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Poslední buffer nelze deaktivovat"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Varování: pøeteèení seznamu s názvy souborù"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Buffer %ld nenalezen"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Vzoru %s vyhovuje více bufferù"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Vzoru %s nevyhovuje žádný buffer"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "øádek %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer tohoto jména již existuje"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [Zmìnìný]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[Needitovaný]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[Nový soubor]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[Chyby pøi ètení]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[Pouze pro ètení]"
+
+#: buffer.c:2510
+msgid "1 line --%d%%--"
+msgstr "øádkù: --%d%%--"
+
+#: buffer.c:2510
+msgid "%ld lines --%d%%--"
+msgstr "øádkù: %ld --%d%%--"
+
+#: buffer.c:2518
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "øádek %ld/%ld --%d%%-- sloupec"
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[Žádný soubor]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "nápovìda"
+
+#: buffer.c:3151 screen.c:4671
+msgid "[help]"
+msgstr "[nápovìda]"
+
+#: buffer.c:3183 screen.c:4677
+msgid "[Preview]"
+msgstr "[náhled]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "Vše"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "Konec"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "Zaèátek"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Seznam bufferù:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[seznam chyb]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[žádný soubor]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaky ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaky pro %s:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " øádek=%ld id=%d jméno=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nelze pøekroèit maximální poèet %ld diff bufferù"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nelze vytvoøit diffy"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Soubor se záplatou"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nelze èíst výstup programu diff"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktuální buffer není v diff režimu"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: To byl poslední buffer v diff režimu"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: V diff režimu jsou více než dva buffery. Nevím, který mám použít."
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nelze nalézt buffer \"%s\""
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffer \"%s\" není v diff režimu"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: digraph nesmí obsahovat Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "Soubor s mapou klávesnice nebyl nalezen"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :loadkeymap mimo interpretovaný soubor"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Doplòování klíèových slov (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X režim (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Lokální doplòování klíèových slov (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Doplòování celých øádkù (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Doplòování názvù souborù (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Doplòování tagù (^I/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Doplòování vzoru cest (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Doplòování definic (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Doplòování podle slovníku (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Doplòování podle tezauru (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Doplòování pøíkazové øádky (^I/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Konec odstavce"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "volba 'thesaurus' je prázdná"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "volba 'dictionary' je prázdná"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Prohledávám slovník %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insert) Rolování (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (replace) Rolování (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "Prohledávám %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "Prohledávám tagy"
+
+#: edit.c:3189
+msgid " Adding"
+msgstr "Pøidávám"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- Hledám..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "Výchozí podoba"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "Slovo z jiného øádku"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "Jediná shoda"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "shoda %d/%d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "shoda %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Neznámá promìnná: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Chybí závorky: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Promìnná \"%s\" neexistuje"
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Po '?' chybí ':'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: Chybìjící ')'"
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: Chybìjící ']'"
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Chybí jméno volby: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Neznámá volba: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Chybí uvozovky: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Chybí uvozovky: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Chybné argumenty pro funkci %s"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Neznámá funkce: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Pøíliš mnoho argumentù pro funkci %s"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Pøíliš málo argumentù pro funkci %s"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Použití <SID> mimo kontext skriptu: %s"
+
+#: eval.c:3575
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld øádkù:"
+
+#: eval.c:4690
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Zrušit"
+
+#: eval.c:5513
+msgid "E240: No connection to Vim server"
+msgstr "E240: Neexistuje pøipojení k Vim serveru"
+
+#: eval.c:5603
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Nelze èíst odpovìï serveru"
+
+#: eval.c:5628
+msgid "E258: Unable to send to client"
+msgstr "E258: Nelze pøedat klientovi"
+
+#: eval.c:5669
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nelze pøedat do %s"
+
+#: eval.c:5767
+msgid "(Invalid)"
+msgstr "(Chybný)"
+
+#: eval.c:6770
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nedefinovaná promìnná: %s"
+
+#: eval.c:7468
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: Funkce %s již existuje. Použijte ! pro její nahrazení."
+
+#: eval.c:7510
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nedefinovaná funkce: %s"
+
+#: eval.c:7523
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Chybí '(': %s"
+
+#: eval.c:7555
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Nepøípustný argument: %s"
+
+#: eval.c:7641
+msgid "E126: Missing :endfunction"
+msgstr "E126: Chybí :endfunction"
+
+#: eval.c:7720
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nelze pøedefinovat funkci %s: je používána"
+
+#: eval.c:7777
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Název funkce musí zaèínat velkým písmenem: %s"
+
+#: eval.c:7783
+msgid "E129: Function name required"
+msgstr "E129: Je vyžadováno jméno funkce"
+
+#: eval.c:7876
+msgid "function "
+msgstr "funkce "
+
+#: eval.c:7991
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nedefinovaná funkce: %s"
+
+#: eval.c:7996
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nelze smazat funkci %s: je již používána"
+
+#: eval.c:8043
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zanoøení funkce je hlubší než 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8094
+#, c-format
+msgid "calling %s"
+msgstr "volám %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8119 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "pokraèuji v %s"
+
+#: eval.c:8173
+msgid "E133: :return not inside a function"
+msgstr "E133: :return mimo funkci"
+
+#: eval.c:8251
+#, c-format
+msgid "%s returning #%ld"
+msgstr "dokonèeno provádìní %s. Návratová hodnota #%ld"
+
+#: eval.c:8254
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "dokonèeno provádìní %s. Návratová hodnota \"%s\""
+
+#: eval.c:8395
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globální promìnné:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, šestnáctkovì %02x, osmièkovì %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Nelze pøesunout øádky na pùvodní místo"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "poèet pøesunutých øádkù: 1"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "Poèet pøesunutých øádkù: %ld"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "Poèet filtrovaných øádkù: %ld"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Automatické pøíkazy *Filter* nesmí mìnit aktuální buffer"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Neuložené zmìny]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s na øádku: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: pøíliš mnoho chyb, pøeskakuji zbytek souboru"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Ètu viminfo soubor \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " informace"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " znaèky"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " se nezdaøilo"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: do viminfo souboru %s nelze zapisovat"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nelze uložit viminfo soubor %s!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Ukládám viminfo souboru \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Tento viminfo soubor byl vytvoøen editorem Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Pokud budete opatrný, mùžete jej upravovat.\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Hodnota volby 'encoding' v dobì uložení tohoto souboru\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Nepøípustný poèáteèní znak"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Uložit jako"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Soubor je nahrán v jiném bufferu"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Uložit neúplný soubor?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Použijte ! pro uložení neúplného bufferu"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Pøepsat soubor \"%.*s\"?"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Žádný název souboru pro buffer %ld"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Soubor nebyl uložen: Ukládání je zakázáno volbou 'write'"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Pro \"%.*s\" je nastavena volba 'readonly'.\n"
+"Pøejete si ji potlaèit?"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "Editovat soubor"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Automatické pøíkazy neoèekávanì smazaly nový buffer %s"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: neèíselný argument pro :z"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim nepovoluje použití pøíkazù shellu"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regulární výrazy nesmí být oddìleny písmeny"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "nahradit za %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(Pøerušeno) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "1 nahrazení"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld nahrazení"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " na jednom øádku"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " na %ld øádcích"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global nelze volat rekurzivnì"
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: U pøíkazu 'global' chybí regulární výraz"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Vzor nalezen na každém øádku: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Poslední nahrazující øetìzec:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Lituji, pro %s není žádná nápovìda"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Lituji, soubor \"%s\" s nápovìdou nebyl nalezen"
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s není adresáøem"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nelze otevøít %s pro zápis"
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nelze otevøít %s pro zápis"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplicitní tag \"%s\" v souboru %s"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Neznámá volba pøíkazu: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: Chybí jméno volby"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E255: Nastaveno pøíliš mnoho voleb"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Neplatný text volby: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Neznámá volba: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: Chybí identifikátor volby"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: chybné jméno bufferu: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Chybné ID volby: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[Vymazáno]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Spouštím ladící režim. Pro ukonèení napište \"cont\"."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "øádek %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "pøíkaz: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Bod pøerušení v \"%s%s\" na øádku %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Bod pøerušení nenalezen: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Nebyly definovánu žádné body pøerušení"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s øádek %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Uložit zmìny do \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "Nepojmenováno"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" obsahuje neuložené zmìny"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Varování: Neèekaný vstup do jiného bufferu (zkontrolujte automatické pøíkazy)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Pro editaci byl zadán pouze jeden soubor"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Pøed první soubor nelze pøeskoèit"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Za poslední soubor nelze pøeskoèit"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Hledám \"%s\" v \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Hledám \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "soubor \"%s\" nebyl nalezen v 'runtimepath'"
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "Spustit makro"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "nelze interpretovat adresáø: \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nelze interpretovat \"%s\""
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "øádek %ld: nelze interpretovat \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "interpretuji \"%s\""
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "øádek %ld: interpretuji %s"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "dokonèena interpretace %s"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Varování: chybný oddìlovaè øádkù. Možná chybí ^M."
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding použito mimo interpretovaný soubor"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish použito mimo interpretovaný soubor"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "Žádný text k vytištìní"
+
+#: ex_cmds2.c:2898
+msgid "Printing page %d (%d%%)"
+msgstr "Tisknu stranu %d (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopie %d z %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "Vytištìno: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "Tisk zrušen"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nelze zapisovat do výstupního PostScriptového souboru"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nelze otevøít výstupní PostScriptový soubor"
+
+#: ex_cmds2.c:4057
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nelze otevøít soubor \"%s\""
+
+#: ex_cmds2.c:4068
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nelze èíst zdrojový PostScriptový soubor \"%s\""
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "Odesílám na tiskárnu..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Selhal tisk PostScriptového souboru"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr "Tisková úloha odeslána."
+
+#: ex_cmds2.c:4651
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Aktuální %sjazyk: \"%s\""
+
+#: ex_cmds2.c:4658
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nelze nastavit jazyk na \"%s\""
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Spouštím Ex mód. Napište \"visual\" pro návrat do normálního módu."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "Konec souboru"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: Pøíkaz je pøíliš rekurzivní"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: Chybí :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: Chybí :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Konec interpretovaného souboru"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Konec funkce"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Nejednoznaèné použití uživatelsky definovaného pøíkazu"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Není pøíkazem editoru"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "Nepanikaøte!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Zadán zpìtný rozsah"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Zadán zpìtný rozsah. Prohodit hranice"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Použijte w èi w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Pøíkaz není této verzi bohužel implementován"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: Pøípustný je pouze jeden název souboru"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Ještì zbývají soubory k editaci (%d). Chcete pøesto ukonèit editor?"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Ještì zbývají soubory k editaci (%ld)."
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Pøíkaz již existuje: použijte ! pro pøedefinování"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Jméno Args Rozsah Úplnost Definice"
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "Nebyly nalezeny žádné uživatelsky definované pøíkazy"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: Nebyly zadány žádné atributy"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Chybný poèet argumentù"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Opakování nemùže být zadáno dvakrát"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: Chybná implicitní hodnota pro poèet"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: chybná implicitní hodnota pro opakování"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Chybná hodnota doplnìní: %s"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Chybný atribut: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: Chybné jméno pøíkazu"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Uživatelsky definované pøíkazy musí zaèínat velikým písmenem."
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Uživatelsky definovaný pøíkaz %s neexistuje"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Nelze nalézt barevné schéma %s"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "Blahopøeji, uživateli Vimu!"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "Editovat soubor v novém oknì"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "Žádný odkládací soubor"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "Uložit soubor"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: Žádný pøedchozí adresáø"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: Neznámý"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Umístìní okna: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Na této platformì nelze umístìní okna zjistit"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "Uložit pøesmìrování"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "Uložit pohled"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "Uložit sezení"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "Uložit nastavení"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" existuje (použijte ! pro vynucení)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nelze otevøít \"%s\" pro zápis"
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argumentem mùže být pouze písmeno nebo pravý èi levý apostrof"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Vnoøení :normal je pøíliš hluboké"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr "vnoøení :if je pøíliš hluboké"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr ":endif bez odpovídajícího :if"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr ":else bez odpovídajícího :if"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr ":elseif bez odpovídajícího :if"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr "vnoøení :while je pøíliš hluboké"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr ":continue bez odpovídajícího :while"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr ":break bez odpovídajícího :while"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr ":endwhile bez odpovídajícího :while"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction mimo funkci"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr ""
+"E194: Žádný alternativní název souboru, kterým by bylo možné nahradit '#'"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "Žádný název souboru, kterým by bylo možné nahradit \"<afile>\""
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "Žádné èíslo bufferu, kterým by bylo možné nahradit \"<abuf>\""
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"Žádná shoda automatických pøíkazù, kterou by bylo možné nahradit \"<amatch>\""
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "Žádný interpretovaný soubor, kterým by bylo možné nahradit \"<sfile>\""
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Prázdný název souboru pro '%' èi '#' funguje pouze s \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "Výsledkem vyhodnocení je prázdný øetìzec"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nelze otevøít pro ètení viminfo soubor"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: V této verzi nejsou spøežky podporovány"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "jméno tagu"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr " typ soubor\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "'volba 'history' je nastavena na nulu"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historie %s (poèínaje nejnovìjší položkou):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "pøíkazové øádky"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "vyhledávaných øetìzcù"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "výrazù"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "vstupní øádky"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar pøekraèuje délku pøíkazu"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Smazáno aktivní okno èi buffer"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "nepøípustný název souboru"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "je adresáøem"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "není souborem"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[nový soubor]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[pøístup odmítnut]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre automatické pøíkazy uèinily soubor neèitelným"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre automatické pøíkazy nesmí mìnit aktuální buffer"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Ètu ze standardního vstupu...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "Ètu ze standardního vstupu..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Po konverzi je soubor neèitelný!"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[pojmenovaná roura/soket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[pojmenovaná roura]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[soket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[chybí CR]"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[nalezeno NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[dlouhé øádky zalomeny]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[nezkonvertován]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[zkonvertován]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[zašifrován]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "[CHYBA PØEVODU]"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[CHYBY ÈTENÍ]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "Nelze nalézt doèasný soubor pro konverzi"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konverze s 'charconvert' se nezdaøila"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "nelze èíst výstup 'charconvert'"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Automatické pøíkazy smazaly èi deaktivovaly buffer, který mìl být "
+"uložen"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Automatický pøíkaz neèekaným zpùsobem zmìnil poèet øádkù"
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "není souborem ani zaøízením na nìž lze zapisovat"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "je pouze pro ètení (použijte ! pro vynucení)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Nelze zapisovat do záložního souboru (použijte ! pro vynucení)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "Chyba pøi uzavírání záložního souboru (použijte ! pro vynucení)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Nelze naèíst soubor pro zálohu (použijte ! pro vynucení)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Nelze vytvoøit záložní soubor (použijte ! pro vynucení)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "Nelze vytvoøit záložní soubor (použijte ! pro vynucení)"
+
+# resource fork ?!
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "'Resource fork' bude ztracen (použijte ! pro vynucení)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nelze najít doèasný temp soubor pro zápis"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Nelze pøevést (použijte ! pro zápis bez pøevodu)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Nelze otevøít pøipojený soubor pro zápis"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: Nelze otevøít soubor pro zápis"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "Volání close selhalo"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "chyba pøi zápisu, konverze se nezdaøila"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "chyba pøi ukládání (je volné místo na disku?)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr " CHYBA PØEVODU"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[zaøízení]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[Nový]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr " [p]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " pøipojen"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr " [u]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " uložen"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: nelze uložit pùvodní soubor"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nelze zapisovat do prázdného pùvodního souboru"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nelze smazat záložní soubor"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"VAROVÁNÍ: Obsah pùvodního souboru mùže být ztracen èi poškozen\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "neukonèujte editor døíve, než bude soubor úspìšnì uložen!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos formát]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac formát]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix formát]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 øádek, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld øádkù, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znakù, "
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[žádný eol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[neúplný poslední øádek]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "VAROVÁNÍ: od jeho naètení byl obsah souboru zmìnìn!!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "Chcete jej opravdu uložit"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Chyba pøi zápisu do \"%s\""
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Chyb pøi uzavírání \"%s\""
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Chyba pøi ètení \"%s\""
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand zrušil buffer"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: wa1: soubor \"%s\" již není dostupný"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Varování: soubor \"%s\" byl po poèátku editace zmìnìn a buffer ve Vim "
+"také"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: wc2: soubor \"%s\" byl po poèátku editace zmìnìn"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Varování: Mód souboru \"%s\" byl zmìnìn od zapoènutí editace"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: wc4: po poèátku editace vytvoøen soubor \"%s\""
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "Varování"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Nahrát soubor"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Nelze znovuotevøít \"%s\""
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--Vymazáno--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Skupina \"%s\" neexistuje"
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Nepøípustný znak po *: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Událost %s neexistuje"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Automatické pøíkazy ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Automatické pøíkazy nelze spustit pro VŠECHNY události"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "Žádné vyhovující automatické pøíkazy"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: vnoøení automatického pøíkazu pøíliš hluboká"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s automatické pøíkazy pro \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "spouštím %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "Automatický pøíkaz %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: Chybí {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: Chybí }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "Žádný záhyb nebyl nalezen"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: pomocí aktuální 'foldmethod' nelze vytvoøit záhyb"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: pomocí aktuální 'foldmethod' nelze vytvoøit záhyb"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: volba 'commentstring' je prázdná"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: Pøidat do bufferu pro ètení"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: rekurzivní mapování"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: pro %s již globální zkratka již existuje"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: pro %s již globální mapování již existuje"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: pro %s již zkratka již existuje"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: pro %s již mapování již existuje"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "Žádná zkratka nebyl nalezena"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "Žádné mapování nebylo nalezeno"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: nepøípustný mód"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nelze spustit GUI"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nelze èíst z \"%s\""
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: volba 'guifontwide' je chybnì nastavena"
+
+#: gui.c:3926
+msgid "Error"
+msgstr "Chyba"
+
+#: gui.c:3927
+msgid "&Ok"
+msgstr "&Ok"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<nelze otevøít> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: písmo %s není dostupné"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: nelze se vrátit do aktuálního adresáøe"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Název cesty:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: nelze zjistit aktuální adresáø"
+
+#: gui_at_fs.c:2571 gui_motif.c:1607
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "Zrušit"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Pøípravek posunovací lišty: nelze zjistit geometrii obrázku"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim dialog"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: BalloonEval nelze vytvoøit se zprávou a zároveò zpìtným voláním"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim dialog.."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Nalézt a nahradit..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - Nalézt..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "Vyhledat:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "Nový text:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "hledat pouze celá slova"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "Smìr"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "Nahoru"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "Dolù"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "Najít další"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "Nahradit"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "Nahradit vše"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: nelze otevøít display"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:2002
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Neznámá sada písem: %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "Výbìr písma"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1838
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Neznámé písmo: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1862
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Písmo \"%s\" nemá pevnou šíøku"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: Neznámé jméno barvy: %s"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Místo prádné schránky použito CUT_BUFFER0"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "Filtr"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "Adresáøe"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "Nápovìda"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "Soubory"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "Výbìr"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "Zpìt"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Nelze naèíst Zap font '%s'"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Nelze použít font %s"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: Chybí barva: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Posílám signál k ukonèení synovského procesu.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument nepodporován: \"-%s\"; Použijte OLE verzi."
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Najít øetìzec (použijte '\\\\' k nalezení '\\')"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Najít & Nahradit (použijte '\\\\' k nalezení '\\')"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: nelze alokovat položku barevné mapy. Nìkteré barvy mohou být "
+"nesprávné"
+
+#: gui_x11.c:1992
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: písma pro následující znakové sady chybí v sadì písem %s:"
+
+#: gui_x11.c:2035
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: název sady písem: %s"
+
+#: gui_x11.c:2036
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Písmo '%s' nemá pevnou šíøku"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: název sady písem: %s\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Písmo0: %s\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Písmo1: %s\n"
+
+#: gui_x11.c:2058
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Šíøka písma%d není dvojnásoblem šíøky písma0\n"
+
+#: gui_x11.c:2059
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Šíøka písma0: %ld\n"
+
+#: gui_x11.c:2060
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Šíøka písma1: %ld\n"
+"\n"
+
+#: gui_x11.c:2206
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: nelze alokovat barvu %s"
+
+#: gui_x11.c:3256
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Chyba -- nelze pøeèíst sign data!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: CYBA Hangul automatu"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Pøidat novou databázi"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "Hledání vzorku"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Zobrazit tuto zprávu"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Ukonèit spojení"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Znovu inicializovat všechna spojení"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Zobrazit spojení"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Tento cscope pøíkaz nepodporuje rozdìlení okna.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Použití: cstag <odsazení>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tag nenalezen"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) chyba: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Pøidána cscope databáze %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s není ani adresáøem ani správnou cscope databází"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "chyba pøi ètení cscope spojení %d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "neznámý typ cscope hledání"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "nelze vytvoøit cscope roury"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "spuštìní cs_create_connection selhalo"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: volání fdopen pro to_fp selhalo"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: volání fdopen pro fr_fp selhalo"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "žádná cscope spojení"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscope hledání %s vzorku %s nenašlo žádnou shodu"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "pøíkazy cscope:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Použití: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "duplicitní cscope databáze nebyla pøidána"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "dosažen maximální poèet cscope spojení"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: connection spojení nenalezeno"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: connection spojení %s nenalezeno"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "closed spojení uzavøeno"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope spojení %s uzavøeno\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "osudová chyba v cs_manage_matches"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: pøi ètení cscope spojení %d"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "volání malloc selhalo\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope tag: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # øádek"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "název souboru/ kontext/ øádek\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "Všechny cscope databáze resetovány"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "žádné cscope spojení\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid název databáze pøedpona cesty\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <žádný>\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Lituji, tento pøíkaz je deaktivován; knihovnu jazyka Python nelze "
+"nahrát."
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "nelze smazat atributy OutputObject"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "softspace musí být kladné celé èíslo"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "chybný atribut"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "writelines() vyžaduje seznam øetìzcù"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: chyba pøi inicializaci I/O objektù"
+
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "Chybný výraz"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "podpora výrazù byla vypnuta pøi pøekladu programu"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "pokus o odkaz na smazaný buffer"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "èíslo øádku mimo rozsah"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer objekt (smazán) na %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "chybné jméno znaèky"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "žádný takový buffer"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "pokus o odkaz na smazané okno"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "atribut pouze_pro_ètení"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "umístìní kurzoru mimo buffer"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objekt okna (smazán) na %8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objekt okna (neznámý) na %8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "žádné takové okno"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "nelze uložit informace pro pøíkaz undo"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "nelze smazat øádek"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "nelze nahradit øádek"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "nelze vložit øádek"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "øetìzec nesmí obsahovat znaky nového øádku"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Lituji, ale tento pøíkaz je deaktivován; knihovnu jazyka Ruby nelze "
+"nahrát."
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: neznámý longjmp stav %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prohození implementace/definice"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Zobrazení base class z"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Zobrazení overridden member funkce"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Znovuzískáno ze souboru"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Znovuzískáno z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Znovzískáno ze všech projektù"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Znovuzískáno"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Zobrazení zdroje"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Najít symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Prohlížet class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Zobrazení class v hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Zobrazení class v restricted hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odkazuje na"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref odkazoval na"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref má"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref použit"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Zobrazení documentace"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generována dokumentace pro"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Nelze se pøipojit k SNiFF+. Zkontrolujte promìnné (sniffemacs musí "
+"být)uvedena v $PATH.\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Chyba pøi ètení. Odpojeno"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ je právì "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ne "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pøipojen"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Neznámý požadavek SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Chybné pøipojení k SNiFF+"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ nepøipojen"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Není SNiFF+ buffer"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Chyba pøi zápisu. Odpojeno."
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "chybný název bufferu"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "není ještì podporováno"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "neznámá volba"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "nelze nastavit øádky"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "znaèka není nastavena"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "øádek %d sloupec %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "nelze vložit/pøipojit øádek"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "neznámý pøíznak: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "neznámá vimOption"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "pøerušení z klávesnice"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "chyba vim"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nelze vytvoøit pøíkaz bufferu/okna: objekt smazán"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"nelze zaregistrovat pøíkaz zpìtného volání: buffer/okno již bylo smazáno"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to "
+"vim-dev@vim.org"
+msgstr ""
+"E280: TCL FATAL ERROR: reflist poškozen!? Oznamte, prosím, tuto chybu na "
+"vim-dev@vim.org"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"nelze zaregistrovat pøíkaz zpìtného volání: odkaz na buffer/okno nenalezen"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"Lituji, ale tento pøíkaz je deaktivován; knihovnu jazyka Tcl nelze nahrát."
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL CHYBA: návratový kód není celé èíslo!? Oznamte, prosím, tuto chybu "
+"na vim-dev@vim.org"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "nelze pøeèíst øádek"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "Není možné zaznamenat jméno command serveru"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: Neexistuje registrovaný server jménem \"%s\""
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Selhalo zaslání pøíkazu urèenému programu"
+
+#: if_xcmdsrv.c:714
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Použit chybný id serveru: %s"
+
+#: if_xcmdsrv.c:1061
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: nelze èíst VIM instanci registry property"
+
+#: if_xcmdsrv.c:1072
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr ""
+"E251: VIM instance registry property byla špatnì vytvoøenaa byla smazána!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Neznámá volba"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Pøíliš mnoho edit argumentù"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Chybí argument po"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Chyby za volbou"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Pøíliš mnoho \"+pøíkaz\" èi \"-c pøíkaz\" argumentù"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Chybný argument pro"
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "VIM nebyl pøeložen s volbou +diff"
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "Pokus o opìtovné otevøení skriptu: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "Nelze otevøít pro zápis: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "Nelze otevøít pro výstup skriptu: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "poèet souborù pro editaci: %d\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Varování: výstup nesmìøuje na terminál\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Varování: vstup nepochází z terminálu\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc pøíkazový øádek"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nelze èíst z \"%s\""
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Podrobnìjší informace získáte pomocí \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[SOUBOR] .. editovat SOUBOR(y)"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- èíst text ze standardního vstupu"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t TAG editovat soubor na místì definice TAGU"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [chybový soubor] editovat soubor na místì výskytu první chyby"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"použití:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr "vim [pøepínaèe] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" nebo"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tMohou následovat pouze názvy souborù"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tpøihlásit gvim na OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-register\t\todhlásit gvim z OLE"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tspustit v GUI režimu (stejné jako \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tPopøedí: pøi startu GUI se neoddìlí od shellu"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi mód (stejné jako \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-v\t\t\tEx mód (stejné jako \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tTichý (dávkový) režim (pouze pro \"ex\")"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff režim (stejné jako \"vimdiff\")"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-v\t\t\tSnadný režim (stejné jako \"evim\", žádné módy )"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tRežim pouze_pro_ètení (jako \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tOmezený režim (stejné jako \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tZmìny (ukládání souborù) zakázány"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZmìny (ukládání souborù) zakázány"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinární režim"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp režim"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatabilní s Vi: 'compatible'"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tKompatibilita s Vi vypnuta: 'nocompatible'"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tÚroveò výpisu hlášek"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tLadící režim"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNebude vytváøet odkládací soubor, bude používat pouze pamì"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tVypíše seznam odkládacích souborù a skonèí"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r název souboru\tObnoví pøerušené sezení"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tStejné jako -r"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNebude používat newcli pro otevøení okna"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <zaøízení>\t\tPoužít <zaøízení> pro I/O"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tnastartuje v hebrejském režimu"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tnastartuje ve Farsi režimu"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminál>\tNastaví typ terminálu na <terminál>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tPoužije <vimrc> místo jakéhokoliv .vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tPoužije <gvimrc> místo jakéhokoliv .gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNenahraje 'plugin' skripty"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtevøe N oken (implicitnì jedno pro každý soubor)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tJako -o but split vertically"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tNastaví kurzor na konec souboru"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<øádek>\t\tNastaví kurzor na <øádek>"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <pøíkaz>\tPo nahrání prvního souboru vykoná <pøíkaz>"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <pøíkaz>\t\tPo nahrání prvního souboru vykoná <pøíkaz>"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr ""
+"-S <sezení>\t\tPo nahrání prvního souboru vykoná pøíkazy v souboru <sezení>"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <skript>\t\tNaète pøíkazy normálního módu ze <skriptu>"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <skript>\t\tPøipojí všechny napsané pøíkazy do souboru <skript>"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <skript>\t\tUloží všechny napsané pøíkazy do souboru <skript>"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEditace zašifrovaných souborù"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tSpustí vim na daný X-server"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNepøipojí se k X serveru"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtevøe Vim uvnitø jiného GTK widgetu"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <soubory>\tEdituje <soubory> na Vim serveru a skonèí"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <soubory> Jako --remote, ale èeká na soubory k editaci"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <klávesy>\tPøedá <klávesy> Vim serveru a skonèí"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <výraz>\tProvede <výraz> na serveru a zobrazí výsledek"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVypíše seznam dostupných Vim serverù a skonèí"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr ""
+"--servername <jméno>\tZašle serveru <jméno>/stane se Vim serverem <jméno>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tPoužije <viminfo> místo jakéhokoliv .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tVypíše tuto nápovìdu a skonèí"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tvypíše informace o verzi a skonèí"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (Motif verzi):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (Athena verzi):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tSpustí vim na <display>"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tSpustí vim minimalizované"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <název>\t\tPoužije resource jako by vim mìl <název>"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (není implementováno)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <barva>\tNastaví <barvu> pozadí (také -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <barva>\tNastaví <barvu> popøedí (také -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <písmo>\t\tNastaví <písmo> normálního textu (také -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <písmo>\tNastaví <písmo> pro zvýraznìný text"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <písmo>\tNastaví <písmo> pro kurzívu"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geometrie>\tNastaví <geometrii> (také -geom)"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <šíøka>\tNastaví <šíøku> okrajù (také -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <šíøku> Nastaví <šíøku> posunovací lišty (také: -sw)"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <výška>\tNastaví <výšku> nabídky (také -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tPoužije reverzní barvy (také -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNepoužije reverzní barvy (také +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tNastaví zadaný <resource>"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (RISC OS verzi):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <poèet>\t<poèet> sloupcù na okno"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <poèet>\t<poèet> øádkù na okno"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (GTK+ verzi):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tSpustí vim na <display> (také --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tVypíše Gnome pøepínaèe"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Pøedání výrazu selhalo.\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Pøedání selhalo. Zkouším provést lokálnì\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d z %d editováno"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "Pøedání výrazu selhalo.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Nejsou nastaveny žádné znaèky"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: \"%s\" nevyhovují žádné znaèky"
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"znaèka øádek sloupec soubor/text"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok øádek sloupec soubor/text"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Souborové znaèky:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Seznam skokù (poèínaje nejnovìjší položkou):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historie znaèek v souborech (poèínaje nejnovìjší položkou):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "Chybí '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Chybná kódová stránka"
+
+#: mbyte.c:3014
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nelze nastavit IC hodnoty"
+
+#: mbyte.c:3166
+msgid "E285: Failed to create input context"
+msgstr "E285: Nepodaøilo se vytvoøit vstupní kontext"
+
+#: mbyte.c:3313
+msgid "E286: Failed to open input method"
+msgstr "E286: Nepodaøilo se otevøít vstupní metodu"
+
+#: mbyte.c:3324
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Varování: likvidaèní zpìtné volání nelze nastavit na IM"
+
+#: mbyte.c:3330
+msgid "E288: input method doesn't support any style"
+msgstr "E288: vstupní metoda nepodporuje žádný styl"
+
+#: mbyte.c:3387
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: vstupní metoda nepodporuje mùj 'preedit' typ"
+
+#: mbyte.c:3461
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: Nadbodový styl vyžaduje fontset"
+
+#: mbyte.c:3489
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Máte GTK+ verze starší než 1.2.3. Stavová plocha vypnuta."
+
+#: mbyte.c:3726
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server vstupních metod nebìží"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: blok nebyl zamknut"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Chyba posunu ukazovátka pøi ètení odkládacího souboru"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: Chyba pøi ètení odkládacího souboru"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Chyba posunu ukazovátka pøi ukládání do odkládacího souboru"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: Chyba pøi ukládání do odkládacího souboru"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr ""
+"E300: Odkládací soubor již existuje! (Nìkdo hackujepøes nastražený symlink?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nelze získat blok 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nelze získat blok 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: nelze získat blok 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Jéje, odkládací soubor byl ztracen!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nelze pøejmenovat odkládací soubor"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nelze otevøít odkládací soubor pro \"%s\""
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: nelze získat blok 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Odkládací soubor pro %s nebyl nalezen"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"Zadejte èíslo odkládacího souboru, který se má použít (0 pro ukonèení): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nelze otevøít %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nelze èíst blok 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Možná nedošlo k žádným zmìnám, nebo Vim neaktualizoval odkládací soubor."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nelze použít s touto verzí Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Použijte Vim verze 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s se nezdá být odkládacím souborem Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nelze použít na tomto poèítaèi.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Soubor byl vytvoøen "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"nebo byl soubor poškozen."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Používám odkládací soubor \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Pùvodní soubor \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Varování: Pùvodní soubor mohl být zmìnìn"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nelze èíst blok 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???CHYBÍ MNOHO ØÁDKÙ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???CHYBNÝ POÈET ØÁDKÙ"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PRÁZDNÝ BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???CHYBÌJÍCÍ ØÁDKY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID bloku 1 je chybné (je %s odkládacím souborem?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???CHYBÍ BLOK"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "od ??? po ???END mohou být øádky pomíchané"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "od ??? po ???END mohou být vložené/smazané øádky"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Obnova pøerušena"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: V prùbìhu obnovy došlo k chybám; zkontrolujte øádky zaèínající na ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Obnova dokonèena. Zkontrolujte, zda je vše v poøádku."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Zvažte uložení tohoto souboru pod jiným názvem\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "a kontrolu zmìn pomocí programu diff.)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr "Poté smažte odkládací soubor.\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Nalezené odkládací soubory:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " V aktuálním adresáøi:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Se zadaným názvem:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " V adresáøi "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- žádné --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " vlastník: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " datum vytvoøení: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " datum vytvoøení: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [od Vim verze 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [nevypadá jako odkládací soubor Vim]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " název souboru: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" datum zmìny: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ANO"
+
+#: memline.c:1524
+msgid "no"
+msgstr "ne"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" uživatelské jméno: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " název poèítaèe: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" název poèítaèe: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu : "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (stále aktivní)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nepoužitelné s touto verzí Vim]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nepoužitelné na tomto poèítaèi]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [nelze pøeèíst]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [nelze otevøít]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nelze zachovat - odkládací soubor neexistuje."
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Soubor zachován"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Uchování se nezdaøilo"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: chybné èíslo øádku: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nelze nalézt øádek %ld"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: chybné id ukazatele na blok 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx by mìlo mít hodnotu 3"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Aktualizováno pøíliš mnoho blokù?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: chybné id ukazatele na blok 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "smazán blok 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nelze nalézt øádek %ld"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: chybné id ukazatele na blok"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count má nulovou hodnotu"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: poèet øádkù mimo rozsah: %ld > celkový poèet øádkù"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: chybný poèet øádkù v bloku %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Nárùst velikosti zásobníku"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: chybné id ukazatele na blok 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: POZOR"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Nalezen odkládací soubor se jménem \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Pøi otevírání souboru\""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " NOVÌJŠÍ než odkládací soubor!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Soubor mùže být editován jiným programem.\n"
+" Je-li tomu tak, pak si dejte pozor, aby jste po uložení zmìn\n"
+" nemìli dvì rùzné verze téhož souboru.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Ukonèete program, nebo opatrnì pokraèujte v editaci.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Editace tohoto souboru byla pøerušena neèekaným ukonèením programu.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Je-li tomu tak, pak použijte \":recover\" èi \"vim -r "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" pro odstranìní zmìn (viz \":help recovery)\".\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Pokud jste tak již uèinil, tak smažte odkládací soubor \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" a tato zpráva se již nebude objevovat.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Odkládací soubor \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" již existuje!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - POZOR"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Odkládací soubor již existuje!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Otevøít pouze pro ètení\n"
+"&Pokraèovat v editaci\n"
+"O&bnovit soubor\n"
+"&Konec"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Otevøít pouze pro ètení\n"
+"&Pokraèovat v editaci\n"
+"O&bnovit soubor\n"
+"&Konec\n"
+"&Smazat"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Pøíliš mnoho odkládacích souborù"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Èásti cesty k pøedmìtu nabídky není podnabídkou"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Nabídka existuje pouze v jiném módu"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Nabídka tohoto jména neexistuje"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Cesta nabídkou nesmí vést do podnabídky"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Položky nabídky nelze pøidávat pøímo na lištu"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Oddìlovaè nesmí být èástí cesty nabídkou"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Nabídky ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "Odtrhnout tuto nabídku"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Cesta nabídkou musí vést k položce nabídky"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Vzor nenalezen: %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: V %s módu není nabídka definována"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Cesta nabídkou musí vést do podnabídky"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Nabídka nenalezena - zkontrolujte názvy nabídek"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Chyba pøi zpracování %s:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "øádek %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[pøíliš dlouhý øetìzec]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Správce zpráv: Bram Moolenaar <Bram@vim.org>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "Pøerušení: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "pokraèování stiskem ENTER"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "Pro pokraèování stisknìte ENTER nebo zadejte pøíkaz"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- Pokraèování --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: øádek, MEZERNÍK/b: stránka, d/u: 0.5 stránky, q: konec)"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: øádek, MEZERNÍK: stránka, d: 0.5 stránky, q: konec)"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "Otázka"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ano\n"
+"&Ne"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ano\n"
+"&Ne\n"
+"&Zrušit"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ano\n"
+"&Ne\n"
+"&Uložit vše\n"
+"Zahodit &vše\n"
+"&Zrušit"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "Dialog pro ukládání souborù"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "Dialog pro otevírání souborù"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Lituji, ale konzolová verze nepodporuje prohlížeè souborù"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: wc1: mìním soubor pouze_pro_ètení"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "poèet nových øádkù: 1"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "poèet smazaných øádkù: 1"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr "poèet nových øádkù: %ld"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "poèet smazaných øádkù: %ld"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr "(Pøerušeno)"
+
+#: misc1.c:6245
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachovávám soubory...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6255
+msgid "Vim: Finished.\n"
+msgstr "Vim: ukonèen\n"
+
+#: misc2.c:647 misc2.c:663
+msgid "ERROR: "
+msgstr "CHYBA: "
+
+#: misc2.c:667
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtù] celkem uvolnìno-alokováno %lu-%lu, využito %lu, maximální využití "
+"%lu\n"
+
+#: misc2.c:669
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[volání] celkem re/malloc(): %lu, celkem free() %lu\n"
+"\n"
+
+#: misc2.c:724
+msgid "E340: Line is becoming too long"
+msgstr "E340: Øádek se stává pøíliš dlouhým"
+
+#: misc2.c:768
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Vnitøní chyba: lalloc(%ld, )"
+
+#: misc2.c:876
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Nedostatek pamìti! (potøebuji alokovat bajtù: %lu)"
+
+#: misc2.c:2511
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Spouštím pøíkaz \"%s\" pomocí shellu"
+
+#: misc2.c:2706 misc2.c:5148 option.c:4584
+msgid "Missing colon"
+msgstr "Chybí dvojteèka"
+
+#: misc2.c:2708 misc2.c:2735
+msgid "Illegal mode"
+msgstr "nepøípustný mód"
+
+#: misc2.c:2774
+msgid "Illegal mouseshape"
+msgstr "Chybný tvar myši"
+
+#: misc2.c:2814 misc2.c:5168
+msgid "digit expected"
+msgstr "oèekávána èíslice"
+
+#: misc2.c:2819
+msgid "Illegal percentage"
+msgstr "nepøípustné procento"
+
+#: misc2.c:3123
+msgid "Enter encryption key: "
+msgstr "Zadejte šifrovací klíè: "
+
+#: misc2.c:3124
+msgid "Enter same key again: "
+msgstr "Zadejte ještì jednou tentýž klíè:"
+
+#: misc2.c:3134
+msgid "Keys don't match!"
+msgstr "Klíèe se neshodují"
+
+#: misc2.c:3648
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Chybná cesta: '**[èíslo] musí být buï na konci cesty, nebo musí být\n"
+"následováno'%s. Viz :help path."
+
+#: misc2.c:4905
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Adresáø \"%s\" nelze v cdpath nalézt"
+
+#: misc2.c:4908
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Soubor \"%s\" nelze v path nalézt"
+
+#: misc2.c:4914
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Žádný další adresáø \"%s\" nebyl v cdpath nalezen"
+
+#: misc2.c:4917
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Žádný další soubor \"%s\" nebyl v cestì nalezen"
+
+#: misc2.c:5160
+msgid "Illegal component"
+msgstr "nepøípustná souèást"
+
+#: normal.c:2813
+msgid "Warning: terminal cannot highlight"
+msgstr "Varování: terminál nepodporuje zvýrazòování"
+
+#: normal.c:3008
+msgid "E348: No string under cursor"
+msgstr "E348: pod kurzorem není žádný øetìzec"
+
+#: normal.c:3010
+msgid "E349: No identifier under cursor"
+msgstr "E349: pod kurzorem není žádný identifikátor"
+
+#: normal.c:4175
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: pomocí aktuální 'foldmethod' nelze mazat záhyby"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "poèet øádkù posunutých jednou pomocí %s : 1"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "Poèet øádkù posunutých pomocí %s %d-krát : 1"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "Poèet øádkù: %ld (posunutých jednou pomocí %s)"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "Poèet øádkù: %ld (posunutých pomocí %s %d-krát)"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "poèet øádkù k odsazení: %ld"
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "poèet øádkù k odsazení: 1"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "poèet odsazených øádkù: %ld"
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "nelze kopírovat; pøesto smazáno"
+
+#: ops.c:2018
+msgid "1 line changed"
+msgstr "poèet øádek se zmìnìnou velikostí písmen: 1"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines changed"
+msgstr "poèet øádek se zmìnìnou velikostí písmen: %ld"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "poèet uvolòovaných øádkù: %ld"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "poèet zkopírovaných øádkù: 1"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "poèet zkopírovaných øádkù: %ld"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Registr %s je prázdný"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registry ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "nepøípustný název registru"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registry:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "%d není známým typem registru"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: '%s' není pøípustné jméno registru"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "øádkù: %ld;"
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Vybráno %s%ld z %ld øádkù; %ld z %ld slov; %ld z %ld Bytù"
+
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Sloupec %s z %s; Øádek %ld z %ld; Slovo %ld z %ld; Byte %ld z %ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld pro BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Dìkuji za použití Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Volba není podporována"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Není v modeline povoleno"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tNaposledy nastavena z "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Po = je vyžadováno èíslo"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Nenalezen v termcapu"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Nepøípustný znak <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "Toto zde není povoleno"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "volba 'term' nemùže být prázdná"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "V GUI nelze mìnit term"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "Použijte \"gui\" pro spuštìní GUI"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "volby 'backupext' a 'patchmode' mají stejnou hodnotu"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "øetìzec o nulové délce"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "Po <%s> chybí èíslo"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "Chybí èárka"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "Je nutné zadat hodnotu '"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "obsahuje netisknutelné znaky"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "Chybná písma"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "nelze vybrat sadu písem"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "chybná sada písem"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "nelze vybrat široký font"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "Chybné široké písmo"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Nepøípustný znak po <%c>"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "je nutná èárka"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "volba `commentstring` musí být buï prázdná nebo nastavená na %s"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "Bez podpory myši"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "neuzavøená sekvence výrazù"
+
+#: option.c:5403
+msgid "too many items"
+msgstr "pøíliš mnoho položek"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "nevyvážené skupiny"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "Okno náhledu již existuje"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr ""
+"hodnota volby 'winheight' nesmí být menší než hodnota volby 'winminheight'"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr ""
+"hodnota volby 'winwidth' nesmí být menší než hodnota volby 'winminwidth'"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "minimální potøebný poèet øádkù: %d"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "minimální potøebný poèet sloupcù: %d"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Neznámá volba: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kódy terminálu ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Nastavení globálních voleb ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Nastavení lokálních voleb ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Volby ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp CHYBA"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': pro %s chybí vyhovující znak"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': nadbyteèné znaky po støedníku: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "nelze otevøít "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nelze otevøít nové okno!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Vyžaduje Amigados verze 2.04 nebo vyšší\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Vyžaduje %s verze %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Nelze otevøít NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr " Nelze vytvoøit "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim bude ukonèen %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "Nelze zmìnit mód konzole ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Nastavování režimu obrazovky není podporováno"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: neni konzole??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nelze spustit shell s parametrem -f"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Nelze spustit "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " návratová hodnota shellu\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE je pøíliš malá."
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O CHYBA"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(kráceno)"
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' není 80, nelze spustit externí pøíkaz"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Volání knihovní funkce \"%s()\" selhalo"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: Nelze zvolit tiskárnu"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "do %s v %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Chyba tisku: %s"
+
+#: os_mswin.c:1460
+msgid "Unknown"
+msgstr "Neznámý"
+
+#: os_mswin.c:1487
+#, c-format
+msgid "Printing '%s'"
+msgstr "Vytištìno '%s'"
+
+#: os_mswin.c:2551
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Nepøípustná jméno znakové sady \"%s\" ve fontu \"%s\""
+
+#: os_mswin.c:2559
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Nepøípustný znak '%c' ve fontu \"%s\""
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Neplatný 'osfiletype' - použit Text"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "VIm: dvojitý signál, konèím\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Zachycen smrtelný signál %s\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Zachycen smrtelný signál\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Doba otevírání X displeje (v ms): %ld"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: chyba X11\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "Test X displeje se nezdaøil"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "Vypršel èas pøi èekání na otevøení X displeje"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"nelze spustit shell "
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nelze spustit sh shell\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+" návratová hodnota shellu "
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nelze vytvoøit roury\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Volání fork selhalo\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Pøíkaz ukonèen\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "Otevøení X displeje se nezdaøilo"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Na øádku"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Nelze naèíst vim32.dll!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "Chyba VIMu"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nelze nastavit ukazatele funkcí na DLL"
+
+#: os_win16.c:578 os_win32.c:3021
+#, c-format
+msgid "shell returned %d"
+msgstr "návratová hodnota shellu %d"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Zachycen %s signál\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "zavøít"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "logoff"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "shutdown"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: Pøíkaz není k dispozici"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE se nevyskytuje ve Vaší $PATH.\n"
+"Externí pøíkazy nebudou "
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Varování"
+
+#: quickfix.c:281
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Pøíliš mnoho %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:294
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Neoèekávaný výskyt %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: Ve formátovacím øetìzci chybí ]"
+
+#: quickfix.c:362
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c Nepodporovaná formátová specifikace ve formátovacím øetìzci"
+
+#: quickfix.c:380
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Nepøípustné %%%c v prefixu formátovacího øetìzce"
+
+#: quickfix.c:388
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Nepøípustné %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' neobsahuje žádný vzorek"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Chybìjící nebo prázdný název adresáøe"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "Žádné další položky"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d/%d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (øádek smazán)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Konec quickfix seznamu"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Zaèátek quickfix seznamu"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "seznam chyb %d z %d; poèet chyb: %d"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nelze uložit, je nastavena volba 'buftype'"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: Vzor je pøíliš dlouhý"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c nic není"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Chyba syntaxe v %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Zachyceno pøeteèení zásobníku: pøíliš složitý regulární výraz?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: vzorek zpùsobil pøeteèení zásobníku"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "Vnìjší podøazené shody:\n"
+
+#: screen.c:2054
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "poèet øádkù v záhybu: %3ld"
+
+#: screen.c:7426
+msgid " VREPLACE"
+msgstr " VREPLACE"
+
+#: screen.c:7430
+msgid " REPLACE"
+msgstr " REPLACE"
+
+#: screen.c:7435
+msgid " REVERSE"
+msgstr " REVERSE"
+
+#: screen.c:7437
+msgid " INSERT"
+msgstr " INSERT"
+
+#: screen.c:7440
+msgid " (insert)"
+msgstr " (insert)"
+
+#: screen.c:7442
+msgid " (replace)"
+msgstr " (replace)"
+
+#: screen.c:7444
+msgid " (vreplace)"
+msgstr " (vreplace)"
+
+#: screen.c:7447
+msgid " Hebrew"
+msgstr " hebrejský"
+
+#: screen.c:7455
+msgid " (lang)"
+msgstr " (lang)"
+
+#: screen.c:7458
+msgid " (paste)"
+msgstr " (paste)"
+
+#: screen.c:7464
+msgid " SELECT"
+msgstr " SHODY"
+
+#: screen.c:7466
+msgid " VISUAL"
+msgstr " VIZUÁLNÍ"
+
+#: screen.c:7468
+msgid " BLOCK"
+msgstr " BLOK"
+
+#: screen.c:7470
+msgid " LINE"
+msgstr " ØÁDEK"
+
+#: screen.c:7483 screen.c:7537
+msgid "recording"
+msgstr "nahrávám"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "hledání dosáhlo zaèátku, pokraèování od konce"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "hledání dosáhlo konce, pokraèování od zaèátku"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Nepøípustný hledaný øetìzec: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: hledaný dosáhlo zaèátku bez nalezení %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: hledaný dosáhlo konce bez nalezení %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Po ';' oèekávám '?' nebo '/'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (vèetnì již vypsaných shod)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- Vložené soubory"
+
+#: search.c:3498
+msgid "not found "
+msgstr " nenalezeny"
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "v cestì ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (Již vypsáno)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " NENALEZENY"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Prohledávám vložené soubory: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: Shoda je na aktuálním øádku"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "Všechny vložené soubory byly nalezeny"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "Žádné vložené soubory"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nelze nalézt definici"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nelze nalézt vzorek"
+
+#: syntax.c:2991
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: nepøípustný argument: %s"
+
+#: syntax.c:3168
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Syntaktická sestava %s neexistuje"
+
+#: syntax.c:3332
+msgid "No Syntax items defined for this buffer"
+msgstr "Pro tento buffer nejsou definovány žádné pøedmìty syntaxe"
+
+#: syntax.c:3340
+msgid "syncing on C-style comments"
+msgstr "synchronizuji komentáøe v C stylu"
+
+#: syntax.c:3348
+msgid "no syncing"
+msgstr "žádná synchronizace"
+
+#: syntax.c:3351
+msgid "syncing starts "
+msgstr "synchronizace zaèíná "
+
+#: syntax.c:3353 syntax.c:3422
+msgid " lines before top line"
+msgstr " øádkù pøed zaèátkem"
+
+#: syntax.c:3357
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Položky synchronizace syntaxe ---"
+
+#: syntax.c:3360
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizuji pøedmìty"
+
+#: syntax.c:3365
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Pøedmìty syntaxe ---"
+
+#: syntax.c:3388
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Syntaktická sestava %s neexistuje"
+
+#: syntax.c:3412
+msgid "minimal "
+msgstr "minimální "
+
+#: syntax.c:3419
+msgid "maximal "
+msgstr "maximální "
+
+#: syntax.c:4047
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here nesmí být na tomto místì"
+
+#: syntax.c:4071
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Pro %s chybí položka regionu"
+
+#: syntax.c:4099
+msgid "E395: contains argument not accepted here"
+msgstr "E395: obsahuje argumenty, které zde nejsou povoleny"
+
+#: syntax.c:4110
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: obsahuje argumenty, které zde nejsou povoleny"
+
+#: syntax.c:4188
+msgid "E397: Filename required"
+msgstr "E397: Vyžadován název souboru"
+
+#: syntax.c:4524
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Chybí '=': %s"
+
+#: syntax.c:4680
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Pøíliš málo argumentù: oblast syntaxe %s"
+
+#: syntax.c:5011
+msgid "E400: No cluster specified"
+msgstr "E400: Nebyla zadána žádná sestava"
+
+#: syntax.c:5048
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Oddìlovaè vzorku %s nenalezen"
+
+#: syntax.c:5123
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Chyba za vzorkem %s"
+
+#: syntax.c:5205
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: synchronizace syntaxe: vzorek pokraèování øádkù zadán dvakrát"
+
+#: syntax.c:5262
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: nepøípustný argument: %s"
+
+#: syntax.c:5312
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Chybí rovnítko: %s"
+
+#: syntax.c:5318
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Prázdný argument: %s"
+
+#: syntax.c:5345
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s zde není povoleno"
+
+#: syntax.c:5352
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musí být první v 'contains' seznamu"
+
+#: syntax.c:5422
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Neznámá název skupiny: %s"
+
+#: syntax.c:5645
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: chybný podøazený pøíkaz :syntax : %s "
+
+#: syntax.c:6024
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: skupina zvýraznìní %s nebyla nalezena"
+
+#: syntax.c:6048
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Pøíliš málo argumentù: \":highlight link %s\""
+
+#: syntax.c:6055
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Pøíliš mnoho argumentù: \":highlight link %s\""
+
+#: syntax.c:6075
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: skupina je nastavena, odkaz na zvýrazòovací skupinu ignorován"
+
+#: syntax.c:6204
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: neèekané rovnítko : %s"
+
+#: syntax.c:6240
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: chybné rovnítko: %s"
+
+#: syntax.c:6262
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: chybí argument: %s"
+
+#: syntax.c:6299
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: nepøípustná hodnota: %s"
+
+#: syntax.c:6418
+msgid "E419: FG color unknown"
+msgstr "E419: barva popøedí není známá"
+
+#: syntax.c:6429
+msgid "E420: BG color unknown"
+msgstr "E420: barva popøedí není známá"
+
+#: syntax.c:6484
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: název èi èíslo barvy %s nebylo rozpoznáno"
+
+#: syntax.c:6688
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminálový kód %s je pøíliš dlouhý"
+
+#: syntax.c:6735
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: nepøípustný argument: %s"
+
+#: syntax.c:7264
+msgid "E424: Too many different highlighting attributes in use"
+msgstr ""
+"E424: Je používáno pøíliš velké množství odlišných zvýrazòovacích atributù"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "konec seznamu tagù"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "zaèátek seznamu tagù"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Pøed první vyhovující tag nelze pøeskoèit"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tag %s nenalezen"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri typ tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "soubor\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Zadejte èíslo (<CR> pro ukonèení): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Vyhovuje pouze jeden tag"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Za poslední vyhovující tag nelze pøeskoèit"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Soubor \"%s\" neexistuje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d z celkového poètu %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " nebo více"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Používám tag s písmeny jiné velikosti!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: \"%s\" neexistuje"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # CÍL tag START øádek v souboru/textu"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Lineární hledání tagu"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binární hledání tagu"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Prohledávám soubor tagù %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Soubor tagù %s byl oøezán\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Chyba formátu v souboru tagù \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "Pøed bajtem %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Obsah soubor tagù %s není seøazen"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: Žádný soubor tagù"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nelze najít vzorek tagù"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Tag nelze nalézt, pouze hádám!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' není znám. Dostupné vestavìné terminály:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "implicitní terminál '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "Nelze otevøít termcap"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminfo neobsahuje položku pro tento terminál"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "Termcap neobsahuje položku pro tento terminál"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Termcap neobsahuje položku pro \"%s\""
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminál musí mít schopnost \"cm\""
+
+#. Highlight title
+#: term.c:4878
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klávesy terminálu ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "spuštìn nový shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: chyba pøi ètení vstupu, konèím...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "odstranìní zmìn není možné; chcete pøesto pokraèovat"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: èísla øádkù jsou chybná"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "poèet zmìn: 1"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "poèet zmìn: %ld"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: záznam o zmìnách poškozen"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: chybí undo øádek"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitová GUI verze pro MS Windows"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitová GUI verze pro MS Windows"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr " ve Win32s režimu"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr " s OLE podporou"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitová verze pro MS Windows konzolu"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitová verze pro MS Windows"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitová verze pro MS Windows"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitová MS-DOS verze"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) verze"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X verze"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS verze"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS verze"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Použité záplaty: "
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"pøeložil "
+
+#: version.c:731
+msgid "by "
+msgstr " "
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"maximální verze"
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"velká verze "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"normální verze"
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"malá verze "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"minimální verze"
+
+#: version.c:760
+msgid "without GUI."
+msgstr "bez grafického rozhraní"
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "s rozhraním GTK-GNOME"
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "s rozhraním GTK"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "s rozhraním X11-Motif"
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "S rozhraním X11-Athena"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "s rozhraním BeOS"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "s rozhraním Photon"
+
+#: version.c:782
+msgid "with GUI."
+msgstr "s grafickým rozhraním"
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "s grafickým rozhraním Carbon"
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "s grafickým rozhraním Cocoa"
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "s (clasickým) grafickým rozhraním"
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " Vlastnosti zahrnuté (+) a nezahrnuté (-):\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " systémový vimrc soubor: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " uživatelský vimrc soubor: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " druhý uživatelský vimrc soubor: \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " tøetí uživatelský vimrc soubor: \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " uživatelský exrc soubor: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " druhý uživatelský exrc soubor: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " systémový gvimrc soubor: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " uživatelský gvimrc soubor: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr "druhý uživatelský gvimrc soubor: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr "tøetí uživatelský gvimrc soubor: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " systémový soubor s menu: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " implicitní hodnota $VIM:\""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " implicitní hodnota $VIMRUNTIME: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "Pøeklad: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "Pøekladaè: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "Linkuji: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " PODPORA LADÌNÍ"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:936
+msgid "version "
+msgstr "verze "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar a další"
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim je volnì šiøitelný program s otevøeným zdrojovým kódem"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "Pomozte chudým dìtem v Ugandì!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "podrobnìjší informace získáte pomocí :help iccf<Enter>"
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "zadejte :q<Enter> pro ukonèení programu"
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "zadejte :help<Enter> èi <F1> pro nápovìdu"
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "zadejte :help version6<Enter> pro informace o verzi 6"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Bìžím v režimu kompatibility s Vi"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "zadejte :set nocp<Enter> pro implicitní nastavení Vim"
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "podrobnìjší informace získáte pomocí :help cp-default<Enter>"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "VAROVÁNÍ: detekovány Windows 95/98/ME"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "zadejte :help windows95<Enter> pro podrobnìjší informace"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Není žádné preview okno není"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Okno nelze rozdìlit zároveò topleft a botright"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nelze rotovat, pokud je jiné okno rozdìleno"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: Poslední okno nelze uzavøít"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "Již existuje pouze jedno okno"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: Jiné okno obsahuje zmìny"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: Pod kurzorem se nenachází název souboru"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Soubor \"%s\" nelze v path nalézt"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Editace &multiple Vimy"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Editace jedním $Vim -em"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Editace &Vim -em"
+
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Editace existujícím Vimem - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Editace vybraných souborù Vimem"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Chyba pøi spouštìní procesu: Zkontrolujte zdali je gvim v $PATH!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "chyba gvimext.dll"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Název (v path) je pøíliš dlouhý"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--Buffer neobsahuje žádný øádek--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "Pøíkaz pøerušen"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "Je vyžadován argument"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ by mìl následovat /. ? nebo &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Chyba v oknì pøíkazové øádky; <CR> pro spuštšní, CTRL-C pro ukonèení"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Pøíkaz není z exrc/vimrc v aktuálním adresáøi èi pøi hledání tagu "
+"povolen."
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Soubor existuje (použijte ! pro vynucení)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "Pøíkaz selhal"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "Vnitøní chyba"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "Pøerušeno"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: Chybná adresa"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "Chybný argument"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Chybný argument: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Chybný výraz: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: Chybný rozsah"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "Chybný pøíkaz"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" je adresáøem"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Neoèekávané znaky pøed '='"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Znaèka má chybné èíslo øádku"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: není nastavena"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nelze mìnit, je nastavena volba 'modifiable'"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript vnoøen pøíliš hluboko"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: Žádný alternativní soubor"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: Taková zkratka neexistuje"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "! není povoleno"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: Nelze použít GUI: nebylo zapnuto pøi pøekladu programu"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E26: nelze použít hebrejský režim: nebyl zapnut pøi pøekladu programu\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Nelze použít farsi režim: nebyl zapnut pøi pøekladu programu\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Skupina zvýraznìní %s neexistuje"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: Zatím není žádný vložený text"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: Žádná pøedchozí pøíkazová øádka"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: Žádné takové mapování"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "Žádná shoda"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "Žádná shoda: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: Žádný název souboru"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: žádný pøedchozí regulární výraz"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: Žádný pøedchozí pøíkaz"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: žádný pøedchozí regulární výraz"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "Rozsah není povolen"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: Nedostatek místa"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "Nelze vytvoøit soubor %s"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "Nelze získat název doèasného souboru"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "Nelze otevøít soubor %s"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "Nelze èíst soubor %s"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: Neuložené zmìny (použijte ! pro vynucení)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: Nulový argument"
+
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: Oèekáváno èíslo"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nelze otevøít chybový soubor %s"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: Nedostatek pamìti!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "Vzor nenalezen"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Vzor nenalezen: %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "Argument musí být kladný"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: Žádné chyby"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: Poškozený øetìzec pro vyhledávání"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: poškozený regexp program"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: 'nastavena volba 'readonly' (použijte ! pro vynucení)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nelze nastavit pouze_pro_ètení promìnnou \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Chyba pøi ètení chybového souboru"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Není v bezpeènostní schránce povoleno"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: Chybná hodnota volby 'scroll'"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: volba 'shell' je prázdná"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: Chyba pøi uzavírání odkládacího souboru"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: seznam tagù je prázdný"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: Pøíkaz je pøíliš složitý"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: Název je pøíliš dlouhý"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: pøíliš mnoho ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: Pøíliš mnoho názvù souborù"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "Nadbyteèné znaky na konci"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: Neznámá znaèka"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nelze expandovat žolíkové znaky"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: Chyba pøi ukládání"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "Nulový poèet"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Použití <SID> mimo kontext skriptu"
diff --git a/src/po/cs.po b/src/po/cs.po
new file mode 100644
index 000000000..e38c66527
--- /dev/null
+++ b/src/po/cs.po
@@ -0,0 +1,5954 @@
+# Czech translation of vim
+# Jiøí Pavlovský <jpavlovsky@mbox.vol.cz>, 2000 - 2002.
+# Some completion for vim6.0 added by Jiøí Bøezina <brz@centrum.cz>
+# Some bugfixes by Tomá¹ Zellerin <zellerin@volny.cz>
+#
+# Original translations.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim-6.0\n"
+"POT-Creation-Date: 2001-10-08 08:27-0700\n"
+"PO-Revision-Date: 2002-02-06 22:29+0100\n"
+"Last-Translator: Jiøí Pavlovský <jpavlovsky@mbox.vol.cz>\n"
+"Language-Team: Czech <cs@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nelze alokovat ¾ádný buffer, konèím..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nelze alokovat buffer, pou¾iji jiný..."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "®ádný buffer nebyl deaktivován"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "®ádný buffer nebyl smazán"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "®ádný buffer nebyl zahozen"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "Poèet deaktivovaných bufferù: 1"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "Poèet deaktivovaných bufferù: %d"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "Poèet smazaných bufferù: 1"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "Poèet smazaných bufferù: %d"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "Poèet zahozených bufferù: 1"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "Poèet zahozených bufferù: %d"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: Nebyl nalezen ¾ádný zmìnìný buffer"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: Seznam bufferù je prázdný"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Nelze pøeskoèit na buffer %ld"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Za poslední buffer nelze pøeskoèit"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Pøed první buffer nelze pøeskoèit"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: Zmìny v bufferu %ld nebyly ulo¾eny (! pro vynucení)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Poslední buffer nelze deaktivovat"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Varování: pøeteèení seznamu s názvy souborù"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Buffer %ld nenalezen"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Vzoru %s vyhovuje více bufferù"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Vzoru %s nevyhovuje ¾ádný buffer"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "øádek %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer tohoto jména ji¾ existuje"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [Zmìnìný]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[Needitovaný]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[Nový soubor]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[Chyby pøi ètení]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[Pouze pro ètení]"
+
+#: buffer.c:2510
+msgid "1 line --%d%%--"
+msgstr "øádkù: --%d%%--"
+
+#: buffer.c:2510
+msgid "%ld lines --%d%%--"
+msgstr "øádkù: %ld --%d%%--"
+
+#: buffer.c:2518
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "øádek %ld/%ld --%d%%-- sloupec"
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[®ádný soubor]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "nápovìda"
+
+#: buffer.c:3151 screen.c:4671
+msgid "[help]"
+msgstr "[nápovìda]"
+
+#: buffer.c:3183 screen.c:4677
+msgid "[Preview]"
+msgstr "[náhled]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "V¹e"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "Konec"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "Zaèátek"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Seznam bufferù:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[seznam chyb]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[¾ádný soubor]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaky ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaky pro %s:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " øádek=%ld id=%d jméno=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nelze pøekroèit maximální poèet %ld diff bufferù"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nelze vytvoøit diffy"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Soubor se záplatou"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nelze èíst výstup programu diff"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktuální buffer není v diff re¾imu"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: To byl poslední buffer v diff re¾imu"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: V diff re¾imu jsou více ne¾ dva buffery. Nevím, který mám pou¾ít."
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nelze nalézt buffer \"%s\""
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffer \"%s\" není v diff re¾imu"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: digraph nesmí obsahovat Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "Soubor s mapou klávesnice nebyl nalezen"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :loadkeymap mimo interpretovaný soubor"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Doplòování klíèových slov (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X re¾im (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Lokální doplòování klíèových slov (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Doplòování celých øádkù (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Doplòování názvù souborù (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Doplòování tagù (^I/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Doplòování vzoru cest (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Doplòování definic (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Doplòování podle slovníku (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Doplòování podle tezauru (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Doplòování pøíkazové øádky (^I/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Konec odstavce"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "volba 'thesaurus' je prázdná"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "volba 'dictionary' je prázdná"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Prohledávám slovník %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insert) Rolování (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (replace) Rolování (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "Prohledávám %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "Prohledávám tagy"
+
+#: edit.c:3189
+msgid " Adding"
+msgstr "Pøidávám"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- Hledám..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "Výchozí podoba"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "Slovo z jiného øádku"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "Jediná shoda"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "shoda %d/%d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "shoda %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Neznámá promìnná: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Chybí závorky: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Promìnná \"%s\" neexistuje"
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Po '?' chybí ':'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: Chybìjící ')'"
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: Chybìjící ']'"
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Chybí jméno volby: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Neznámá volba: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Chybí uvozovky: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Chybí uvozovky: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Chybné argumenty pro funkci %s"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Neznámá funkce: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Pøíli¹ mnoho argumentù pro funkci %s"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Pøíli¹ málo argumentù pro funkci %s"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Pou¾ití <SID> mimo kontext skriptu: %s"
+
+#: eval.c:3575
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld øádkù:"
+
+#: eval.c:4690
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Zru¹it"
+
+#: eval.c:5513
+msgid "E240: No connection to Vim server"
+msgstr "E240: Neexistuje pøipojení k Vim serveru"
+
+#: eval.c:5603
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Nelze èíst odpovìï serveru"
+
+#: eval.c:5628
+msgid "E258: Unable to send to client"
+msgstr "E258: Nelze pøedat klientovi"
+
+#: eval.c:5669
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nelze pøedat do %s"
+
+#: eval.c:5767
+msgid "(Invalid)"
+msgstr "(Chybný)"
+
+#: eval.c:6770
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nedefinovaná promìnná: %s"
+
+#: eval.c:7468
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: Funkce %s ji¾ existuje. Pou¾ijte ! pro její nahrazení."
+
+#: eval.c:7510
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nedefinovaná funkce: %s"
+
+#: eval.c:7523
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Chybí '(': %s"
+
+#: eval.c:7555
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Nepøípustný argument: %s"
+
+#: eval.c:7641
+msgid "E126: Missing :endfunction"
+msgstr "E126: Chybí :endfunction"
+
+#: eval.c:7720
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nelze pøedefinovat funkci %s: je pou¾ívána"
+
+#: eval.c:7777
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Název funkce musí zaèínat velkým písmenem: %s"
+
+#: eval.c:7783
+msgid "E129: Function name required"
+msgstr "E129: Je vy¾adováno jméno funkce"
+
+#: eval.c:7876
+msgid "function "
+msgstr "funkce "
+
+#: eval.c:7991
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nedefinovaná funkce: %s"
+
+#: eval.c:7996
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nelze smazat funkci %s: je ji¾ pou¾ívána"
+
+#: eval.c:8043
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zanoøení funkce je hlub¹í ne¾ 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8094
+#, c-format
+msgid "calling %s"
+msgstr "volám %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8119 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "pokraèuji v %s"
+
+#: eval.c:8173
+msgid "E133: :return not inside a function"
+msgstr "E133: :return mimo funkci"
+
+#: eval.c:8251
+#, c-format
+msgid "%s returning #%ld"
+msgstr "dokonèeno provádìní %s. Návratová hodnota #%ld"
+
+#: eval.c:8254
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "dokonèeno provádìní %s. Návratová hodnota \"%s\""
+
+#: eval.c:8395
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globální promìnné:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, ¹estnáctkovì %02x, osmièkovì %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Nelze pøesunout øádky na pùvodní místo"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "poèet pøesunutých øádkù: 1"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "Poèet pøesunutých øádkù: %ld"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "Poèet filtrovaných øádkù: %ld"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Automatické pøíkazy *Filter* nesmí mìnit aktuální buffer"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Neulo¾ené zmìny]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s na øádku: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: pøíli¹ mnoho chyb, pøeskakuji zbytek souboru"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Ètu viminfo soubor \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " informace"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " znaèky"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " se nezdaøilo"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: do viminfo souboru %s nelze zapisovat"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nelze ulo¾it viminfo soubor %s!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Ukládám viminfo souboru \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Tento viminfo soubor byl vytvoøen editorem Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Pokud budete opatrný, mù¾ete jej upravovat.\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Hodnota volby 'encoding' v dobì ulo¾ení tohoto souboru\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Nepøípustný poèáteèní znak"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Ulo¾it jako"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Soubor je nahrán v jiném bufferu"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Ulo¾it neúplný soubor?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Pou¾ijte ! pro ulo¾ení neúplného bufferu"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Pøepsat soubor \"%.*s\"?"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ®ádný název souboru pro buffer %ld"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Soubor nebyl ulo¾en: Ukládání je zakázáno volbou 'write'"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Pro \"%.*s\" je nastavena volba 'readonly'.\n"
+"Pøejete si ji potlaèit?"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "Editovat soubor"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Automatické pøíkazy neoèekávanì smazaly nový buffer %s"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: neèíselný argument pro :z"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim nepovoluje pou¾ití pøíkazù shellu"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regulární výrazy nesmí být oddìleny písmeny"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "nahradit za %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(Pøeru¹eno) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "1 nahrazení"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld nahrazení"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " na jednom øádku"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " na %ld øádcích"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global nelze volat rekurzivnì"
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: U pøíkazu 'global' chybí regulární výraz"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Vzor nalezen na ka¾dém øádku: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Poslední nahrazující øetìzec:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Lituji, pro %s není ¾ádná nápovìda"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Lituji, soubor \"%s\" s nápovìdou nebyl nalezen"
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s není adresáøem"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nelze otevøít %s pro zápis"
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nelze otevøít %s pro zápis"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplicitní tag \"%s\" v souboru %s"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Neznámá volba pøíkazu: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: Chybí jméno volby"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E255: Nastaveno pøíli¹ mnoho voleb"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Neplatný text volby: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Neznámá volba: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: Chybí identifikátor volby"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: chybné jméno bufferu: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Chybné ID volby: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[Vymazáno]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Spou¹tím ladící re¾im. Pro ukonèení napi¹te \"cont\"."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "øádek %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "pøíkaz: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Bod pøeru¹ení v \"%s%s\" na øádku %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Bod pøeru¹ení nenalezen: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Nebyly definovánu ¾ádné body pøeru¹ení"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s øádek %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Ulo¾it zmìny do \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "Nepojmenováno"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" obsahuje neulo¾ené zmìny"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Varování: Neèekaný vstup do jiného bufferu (zkontrolujte automatické pøíkazy)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Pro editaci byl zadán pouze jeden soubor"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Pøed první soubor nelze pøeskoèit"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Za poslední soubor nelze pøeskoèit"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Hledám \"%s\" v \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Hledám \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "soubor \"%s\" nebyl nalezen v 'runtimepath'"
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "Spustit makro"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "nelze interpretovat adresáø: \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nelze interpretovat \"%s\""
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "øádek %ld: nelze interpretovat \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "interpretuji \"%s\""
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "øádek %ld: interpretuji %s"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "dokonèena interpretace %s"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Varování: chybný oddìlovaè øádkù. Mo¾ná chybí ^M."
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding pou¾ito mimo interpretovaný soubor"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish pou¾ito mimo interpretovaný soubor"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "®ádný text k vyti¹tìní"
+
+#: ex_cmds2.c:2898
+msgid "Printing page %d (%d%%)"
+msgstr "Tisknu stranu %d (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopie %d z %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "Vyti¹tìno: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "Tisk zru¹en"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nelze zapisovat do výstupního PostScriptového souboru"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nelze otevøít výstupní PostScriptový soubor"
+
+#: ex_cmds2.c:4057
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nelze otevøít soubor \"%s\""
+
+#: ex_cmds2.c:4068
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nelze èíst zdrojový PostScriptový soubor \"%s\""
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "Odesílám na tiskárnu..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Selhal tisk PostScriptového souboru"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr "Tisková úloha odeslána."
+
+#: ex_cmds2.c:4651
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Aktuální %sjazyk: \"%s\""
+
+#: ex_cmds2.c:4658
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nelze nastavit jazyk na \"%s\""
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Spou¹tím Ex mód. Napi¹te \"visual\" pro návrat do normálního módu."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "Konec souboru"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: Pøíkaz je pøíli¹ rekurzivní"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: Chybí :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: Chybí :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Konec interpretovaného souboru"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Konec funkce"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Nejednoznaèné pou¾ití u¾ivatelsky definovaného pøíkazu"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Není pøíkazem editoru"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "Nepanikaøte!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Zadán zpìtný rozsah"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Zadán zpìtný rozsah. Prohodit hranice"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Pou¾ijte w èi w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Pøíkaz není této verzi bohu¾el implementován"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: Pøípustný je pouze jeden název souboru"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Je¹tì zbývají soubory k editaci (%d). Chcete pøesto ukonèit editor?"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Je¹tì zbývají soubory k editaci (%ld)."
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Pøíkaz ji¾ existuje: pou¾ijte ! pro pøedefinování"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Jméno Args Rozsah Úplnost Definice"
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "Nebyly nalezeny ¾ádné u¾ivatelsky definované pøíkazy"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: Nebyly zadány ¾ádné atributy"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Chybný poèet argumentù"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Opakování nemù¾e být zadáno dvakrát"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: Chybná implicitní hodnota pro poèet"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: chybná implicitní hodnota pro opakování"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Chybná hodnota doplnìní: %s"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Chybný atribut: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: Chybné jméno pøíkazu"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: U¾ivatelsky definované pøíkazy musí zaèínat velikým písmenem."
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: U¾ivatelsky definovaný pøíkaz %s neexistuje"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Nelze nalézt barevné schéma %s"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "Blahopøeji, u¾ivateli Vimu!"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "Editovat soubor v novém oknì"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "®ádný odkládací soubor"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "Ulo¾it soubor"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: ®ádný pøedchozí adresáø"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: Neznámý"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Umístìní okna: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Na této platformì nelze umístìní okna zjistit"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "Ulo¾it pøesmìrování"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "Ulo¾it pohled"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "Ulo¾it sezení"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "Ulo¾it nastavení"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" existuje (pou¾ijte ! pro vynucení)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nelze otevøít \"%s\" pro zápis"
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argumentem mù¾e být pouze písmeno nebo pravý èi levý apostrof"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Vnoøení :normal je pøíli¹ hluboké"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr "vnoøení :if je pøíli¹ hluboké"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr ":endif bez odpovídajícího :if"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr ":else bez odpovídajícího :if"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr ":elseif bez odpovídajícího :if"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr "vnoøení :while je pøíli¹ hluboké"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr ":continue bez odpovídajícího :while"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr ":break bez odpovídajícího :while"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr ":endwhile bez odpovídajícího :while"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction mimo funkci"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr ""
+"E194: ®ádný alternativní název souboru, kterým by bylo mo¾né nahradit '#'"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "®ádný název souboru, kterým by bylo mo¾né nahradit \"<afile>\""
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "®ádné èíslo bufferu, kterým by bylo mo¾né nahradit \"<abuf>\""
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"®ádná shoda automatických pøíkazù, kterou by bylo mo¾né nahradit \"<amatch>\""
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "®ádný interpretovaný soubor, kterým by bylo mo¾né nahradit \"<sfile>\""
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Prázdný název souboru pro '%' èi '#' funguje pouze s \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "Výsledkem vyhodnocení je prázdný øetìzec"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nelze otevøít pro ètení viminfo soubor"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: V této verzi nejsou spøe¾ky podporovány"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "jméno tagu"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr " typ soubor\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "'volba 'history' je nastavena na nulu"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historie %s (poèínaje nejnovìj¹í polo¾kou):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "pøíkazové øádky"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "vyhledávaných øetìzcù"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "výrazù"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "vstupní øádky"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar pøekraèuje délku pøíkazu"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Smazáno aktivní okno èi buffer"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "nepøípustný název souboru"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "je adresáøem"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "není souborem"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[nový soubor]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[pøístup odmítnut]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre automatické pøíkazy uèinily soubor neèitelným"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre automatické pøíkazy nesmí mìnit aktuální buffer"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Ètu ze standardního vstupu...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "Ètu ze standardního vstupu..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Po konverzi je soubor neèitelný!"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[pojmenovaná roura/soket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[pojmenovaná roura]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[soket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[chybí CR]"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[nalezeno NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[dlouhé øádky zalomeny]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[nezkonvertován]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[zkonvertován]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[za¹ifrován]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "[CHYBA PØEVODU]"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[CHYBY ÈTENÍ]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "Nelze nalézt doèasný soubor pro konverzi"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konverze s 'charconvert' se nezdaøila"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "nelze èíst výstup 'charconvert'"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Automatické pøíkazy smazaly èi deaktivovaly buffer, který mìl být "
+"ulo¾en"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Automatický pøíkaz neèekaným zpùsobem zmìnil poèet øádkù"
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "není souborem ani zaøízením na nì¾ lze zapisovat"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "je pouze pro ètení (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Nelze zapisovat do zálo¾ního souboru (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "Chyba pøi uzavírání zálo¾ního souboru (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Nelze naèíst soubor pro zálohu (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Nelze vytvoøit zálo¾ní soubor (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "Nelze vytvoøit zálo¾ní soubor (pou¾ijte ! pro vynucení)"
+
+# resource fork ?!
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "'Resource fork' bude ztracen (pou¾ijte ! pro vynucení)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nelze najít doèasný temp soubor pro zápis"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Nelze pøevést (pou¾ijte ! pro zápis bez pøevodu)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Nelze otevøít pøipojený soubor pro zápis"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: Nelze otevøít soubor pro zápis"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "Volání close selhalo"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "chyba pøi zápisu, konverze se nezdaøila"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "chyba pøi ukládání (je volné místo na disku?)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr " CHYBA PØEVODU"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[zaøízení]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[Nový]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr " [p]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " pøipojen"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr " [u]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " ulo¾en"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: nelze ulo¾it pùvodní soubor"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nelze zapisovat do prázdného pùvodního souboru"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nelze smazat zálo¾ní soubor"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"VAROVÁNÍ: Obsah pùvodního souboru mù¾e být ztracen èi po¹kozen\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "neukonèujte editor døíve, ne¾ bude soubor úspì¹nì ulo¾en!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos formát]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac formát]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix formát]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 øádek, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld øádkù, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znakù, "
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[¾ádný eol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[neúplný poslední øádek]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "VAROVÁNÍ: od jeho naètení byl obsah souboru zmìnìn!!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "Chcete jej opravdu ulo¾it"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Chyba pøi zápisu do \"%s\""
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Chyb pøi uzavírání \"%s\""
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Chyba pøi ètení \"%s\""
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand zru¹il buffer"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: wa1: soubor \"%s\" ji¾ není dostupný"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Varování: soubor \"%s\" byl po poèátku editace zmìnìn a buffer ve Vim "
+"také"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: wc2: soubor \"%s\" byl po poèátku editace zmìnìn"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Varování: Mód souboru \"%s\" byl zmìnìn od zapoènutí editace"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: wc4: po poèátku editace vytvoøen soubor \"%s\""
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "Varování"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Nahrát soubor"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Nelze znovuotevøít \"%s\""
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--Vymazáno--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Skupina \"%s\" neexistuje"
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Nepøípustný znak po *: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Událost %s neexistuje"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Automatické pøíkazy ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Automatické pøíkazy nelze spustit pro V©ECHNY události"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "®ádné vyhovující automatické pøíkazy"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: vnoøení automatického pøíkazu pøíli¹ hluboká"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s automatické pøíkazy pro \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "spou¹tím %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "Automatický pøíkaz %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: Chybí {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: Chybí }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "®ádný záhyb nebyl nalezen"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: pomocí aktuální 'foldmethod' nelze vytvoøit záhyb"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: pomocí aktuální 'foldmethod' nelze vytvoøit záhyb"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: volba 'commentstring' je prázdná"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: Pøidat do bufferu pro ètení"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: rekurzivní mapování"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: pro %s ji¾ globální zkratka ji¾ existuje"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: pro %s ji¾ globální mapování ji¾ existuje"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: pro %s ji¾ zkratka ji¾ existuje"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: pro %s ji¾ mapování ji¾ existuje"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "®ádná zkratka nebyl nalezena"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "®ádné mapování nebylo nalezeno"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: nepøípustný mód"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nelze spustit GUI"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nelze èíst z \"%s\""
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: volba 'guifontwide' je chybnì nastavena"
+
+#: gui.c:3926
+msgid "Error"
+msgstr "Chyba"
+
+#: gui.c:3927
+msgid "&Ok"
+msgstr "&Ok"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<nelze otevøít> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: písmo %s není dostupné"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: nelze se vrátit do aktuálního adresáøe"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Název cesty:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: nelze zjistit aktuální adresáø"
+
+#: gui_at_fs.c:2571 gui_motif.c:1607
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "Zru¹it"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Pøípravek posunovací li¹ty: nelze zjistit geometrii obrázku"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim dialog"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: BalloonEval nelze vytvoøit se zprávou a zároveò zpìtným voláním"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim dialog.."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Nalézt a nahradit..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - Nalézt..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "Vyhledat:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "Nový text:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "hledat pouze celá slova"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "Smìr"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "Nahoru"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "Dolù"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "Najít dal¹í"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "Nahradit"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "Nahradit v¹e"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: nelze otevøít display"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:2002
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Neznámá sada písem: %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "Výbìr písma"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1838
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Neznámé písmo: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1862
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Písmo \"%s\" nemá pevnou ¹íøku"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: Neznámé jméno barvy: %s"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Místo prádné schránky pou¾ito CUT_BUFFER0"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "Filtr"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "Adresáøe"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "Nápovìda"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "Soubory"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "Výbìr"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "Zpìt"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Nelze naèíst Zap font '%s'"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Nelze pou¾ít font %s"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: Chybí barva: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Posílám signál k ukonèení synovského procesu.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument nepodporován: \"-%s\"; Pou¾ijte OLE verzi."
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Najít øetìzec (pou¾ijte '\\\\' k nalezení '\\')"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Najít & Nahradit (pou¾ijte '\\\\' k nalezení '\\')"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: nelze alokovat polo¾ku barevné mapy. Nìkteré barvy mohou být "
+"nesprávné"
+
+#: gui_x11.c:1992
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: písma pro následující znakové sady chybí v sadì písem %s:"
+
+#: gui_x11.c:2035
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: název sady písem: %s"
+
+#: gui_x11.c:2036
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Písmo '%s' nemá pevnou ¹íøku"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: název sady písem: %s\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Písmo0: %s\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Písmo1: %s\n"
+
+#: gui_x11.c:2058
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "©íøka písma%d není dvojnásoblem ¹íøky písma0\n"
+
+#: gui_x11.c:2059
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "©íøka písma0: %ld\n"
+
+#: gui_x11.c:2060
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"©íøka písma1: %ld\n"
+"\n"
+
+#: gui_x11.c:2206
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: nelze alokovat barvu %s"
+
+#: gui_x11.c:3256
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Chyba -- nelze pøeèíst sign data!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: CYBA Hangul automatu"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Pøidat novou databázi"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "Hledání vzorku"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Zobrazit tuto zprávu"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Ukonèit spojení"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Znovu inicializovat v¹echna spojení"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Zobrazit spojení"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Tento cscope pøíkaz nepodporuje rozdìlení okna.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Pou¾ití: cstag <odsazení>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tag nenalezen"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) chyba: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Pøidána cscope databáze %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s není ani adresáøem ani správnou cscope databází"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "chyba pøi ètení cscope spojení %d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "neznámý typ cscope hledání"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "nelze vytvoøit cscope roury"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "spu¹tìní cs_create_connection selhalo"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: volání fdopen pro to_fp selhalo"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: volání fdopen pro fr_fp selhalo"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "¾ádná cscope spojení"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscope hledání %s vzorku %s nena¹lo ¾ádnou shodu"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "pøíkazy cscope:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Pou¾ití: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "duplicitní cscope databáze nebyla pøidána"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "dosa¾en maximální poèet cscope spojení"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: connection spojení nenalezeno"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: connection spojení %s nenalezeno"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "closed spojení uzavøeno"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope spojení %s uzavøeno\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "osudová chyba v cs_manage_matches"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: pøi ètení cscope spojení %d"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "volání malloc selhalo\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope tag: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # øádek"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "název souboru/ kontext/ øádek\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "V¹echny cscope databáze resetovány"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "¾ádné cscope spojení\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid název databáze pøedpona cesty\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <¾ádný>\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Lituji, tento pøíkaz je deaktivován; knihovnu jazyka Python nelze "
+"nahrát."
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "nelze smazat atributy OutputObject"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "softspace musí být kladné celé èíslo"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "chybný atribut"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "writelines() vy¾aduje seznam øetìzcù"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: chyba pøi inicializaci I/O objektù"
+
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "Chybný výraz"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "podpora výrazù byla vypnuta pøi pøekladu programu"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "pokus o odkaz na smazaný buffer"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "èíslo øádku mimo rozsah"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer objekt (smazán) na %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "chybné jméno znaèky"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "¾ádný takový buffer"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "pokus o odkaz na smazané okno"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "atribut pouze_pro_ètení"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "umístìní kurzoru mimo buffer"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objekt okna (smazán) na %8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objekt okna (neznámý) na %8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "¾ádné takové okno"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "nelze ulo¾it informace pro pøíkaz undo"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "nelze smazat øádek"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "nelze nahradit øádek"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "nelze vlo¾it øádek"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "øetìzec nesmí obsahovat znaky nového øádku"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Lituji, ale tento pøíkaz je deaktivován; knihovnu jazyka Ruby nelze "
+"nahrát."
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: neznámý longjmp stav %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prohození implementace/definice"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Zobrazení base class z"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Zobrazení overridden member funkce"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Znovuzískáno ze souboru"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Znovuzískáno z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Znovzískáno ze v¹ech projektù"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Znovuzískáno"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Zobrazení zdroje"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Najít symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Prohlí¾et class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Zobrazení class v hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Zobrazení class v restricted hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odkazuje na"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref odkazoval na"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref má"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref pou¾it"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Zobrazení documentace"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generována dokumentace pro"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Nelze se pøipojit k SNiFF+. Zkontrolujte promìnné (sniffemacs musí "
+"být)uvedena v $PATH.\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Chyba pøi ètení. Odpojeno"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ je právì "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ne "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pøipojen"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Neznámý po¾adavek SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Chybné pøipojení k SNiFF+"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ nepøipojen"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Není SNiFF+ buffer"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Chyba pøi zápisu. Odpojeno."
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "chybný název bufferu"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "není je¹tì podporováno"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "neznámá volba"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "nelze nastavit øádky"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "znaèka není nastavena"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "øádek %d sloupec %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "nelze vlo¾it/pøipojit øádek"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "neznámý pøíznak: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "neznámá vimOption"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "pøeru¹ení z klávesnice"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "chyba vim"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nelze vytvoøit pøíkaz bufferu/okna: objekt smazán"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"nelze zaregistrovat pøíkaz zpìtného volání: buffer/okno ji¾ bylo smazáno"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to "
+"vim-dev@vim.org"
+msgstr ""
+"E280: TCL FATAL ERROR: reflist po¹kozen!? Oznamte, prosím, tuto chybu na "
+"vim-dev@vim.org"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"nelze zaregistrovat pøíkaz zpìtného volání: odkaz na buffer/okno nenalezen"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"Lituji, ale tento pøíkaz je deaktivován; knihovnu jazyka Tcl nelze nahrát."
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL CHYBA: návratový kód není celé èíslo!? Oznamte, prosím, tuto chybu "
+"na vim-dev@vim.org"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "nelze pøeèíst øádek"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "Není mo¾né zaznamenat jméno command serveru"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: Neexistuje registrovaný server jménem \"%s\""
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Selhalo zaslání pøíkazu urèenému programu"
+
+#: if_xcmdsrv.c:714
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Pou¾it chybný id serveru: %s"
+
+#: if_xcmdsrv.c:1061
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: nelze èíst VIM instanci registry property"
+
+#: if_xcmdsrv.c:1072
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr ""
+"E251: VIM instance registry property byla ¹patnì vytvoøenaa byla smazána!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Neznámá volba"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Pøíli¹ mnoho edit argumentù"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Chybí argument po"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Chyby za volbou"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Pøíli¹ mnoho \"+pøíkaz\" èi \"-c pøíkaz\" argumentù"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Chybný argument pro"
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "VIM nebyl pøelo¾en s volbou +diff"
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "Pokus o opìtovné otevøení skriptu: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "Nelze otevøít pro zápis: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "Nelze otevøít pro výstup skriptu: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "poèet souborù pro editaci: %d\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Varování: výstup nesmìøuje na terminál\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Varování: vstup nepochází z terminálu\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc pøíkazový øádek"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nelze èíst z \"%s\""
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Podrobnìj¹í informace získáte pomocí \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[SOUBOR] .. editovat SOUBOR(y)"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- èíst text ze standardního vstupu"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t TAG editovat soubor na místì definice TAGU"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [chybový soubor] editovat soubor na místì výskytu první chyby"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"pou¾ití:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr "vim [pøepínaèe] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" nebo"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tMohou následovat pouze názvy souborù"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tpøihlásit gvim na OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-register\t\todhlásit gvim z OLE"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tspustit v GUI re¾imu (stejné jako \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tPopøedí: pøi startu GUI se neoddìlí od shellu"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi mód (stejné jako \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-v\t\t\tEx mód (stejné jako \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tTichý (dávkový) re¾im (pouze pro \"ex\")"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff re¾im (stejné jako \"vimdiff\")"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-v\t\t\tSnadný re¾im (stejné jako \"evim\", ¾ádné módy )"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tRe¾im pouze_pro_ètení (jako \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tOmezený re¾im (stejné jako \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tZmìny (ukládání souborù) zakázány"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZmìny (ukládání souborù) zakázány"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinární re¾im"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp re¾im"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatabilní s Vi: 'compatible'"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tKompatibilita s Vi vypnuta: 'nocompatible'"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tÚroveò výpisu hlá¹ek"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tLadící re¾im"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNebude vytváøet odkládací soubor, bude pou¾ívat pouze pamì»"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tVypí¹e seznam odkládacích souborù a skonèí"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r název souboru\tObnoví pøeru¹ené sezení"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tStejné jako -r"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNebude pou¾ívat newcli pro otevøení okna"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <zaøízení>\t\tPou¾ít <zaøízení> pro I/O"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tnastartuje v hebrejském re¾imu"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tnastartuje ve Farsi re¾imu"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminál>\tNastaví typ terminálu na <terminál>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tPou¾ije <vimrc> místo jakéhokoliv .vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tPou¾ije <gvimrc> místo jakéhokoliv .gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNenahraje 'plugin' skripty"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtevøe N oken (implicitnì jedno pro ka¾dý soubor)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tJako -o but split vertically"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tNastaví kurzor na konec souboru"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<øádek>\t\tNastaví kurzor na <øádek>"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <pøíkaz>\tPo nahrání prvního souboru vykoná <pøíkaz>"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <pøíkaz>\t\tPo nahrání prvního souboru vykoná <pøíkaz>"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr ""
+"-S <sezení>\t\tPo nahrání prvního souboru vykoná pøíkazy v souboru <sezení>"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <skript>\t\tNaète pøíkazy normálního módu ze <skriptu>"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <skript>\t\tPøipojí v¹echny napsané pøíkazy do souboru <skript>"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <skript>\t\tUlo¾í v¹echny napsané pøíkazy do souboru <skript>"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEditace za¹ifrovaných souborù"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tSpustí vim na daný X-server"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNepøipojí se k X serveru"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtevøe Vim uvnitø jiného GTK widgetu"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <soubory>\tEdituje <soubory> na Vim serveru a skonèí"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <soubory> Jako --remote, ale èeká na soubory k editaci"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <klávesy>\tPøedá <klávesy> Vim serveru a skonèí"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <výraz>\tProvede <výraz> na serveru a zobrazí výsledek"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVypí¹e seznam dostupných Vim serverù a skonèí"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr ""
+"--servername <jméno>\tZa¹le serveru <jméno>/stane se Vim serverem <jméno>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tPou¾ije <viminfo> místo jakéhokoliv .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tVypí¹e tuto nápovìdu a skonèí"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tvypí¹e informace o verzi a skonèí"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (Motif verzi):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (Athena verzi):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tSpustí vim na <display>"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tSpustí vim minimalizované"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <název>\t\tPou¾ije resource jako by vim mìl <název>"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (není implementováno)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <barva>\tNastaví <barvu> pozadí (také -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <barva>\tNastaví <barvu> popøedí (také -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <písmo>\t\tNastaví <písmo> normálního textu (také -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <písmo>\tNastaví <písmo> pro zvýraznìný text"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <písmo>\tNastaví <písmo> pro kurzívu"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geometrie>\tNastaví <geometrii> (také -geom)"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <¹íøka>\tNastaví <¹íøku> okrajù (také -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <¹íøku> Nastaví <¹íøku> posunovací li¹ty (také: -sw)"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <vý¹ka>\tNastaví <vý¹ku> nabídky (také -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tPou¾ije reverzní barvy (také -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNepou¾ije reverzní barvy (také +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tNastaví zadaný <resource>"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (RISC OS verzi):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <poèet>\t<poèet> sloupcù na okno"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <poèet>\t<poèet> øádkù na okno"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Pøepínaèe pro gvim (GTK+ verzi):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tSpustí vim na <display> (také --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tVypí¹e Gnome pøepínaèe"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Pøedání výrazu selhalo.\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Pøedání selhalo. Zkou¹ím provést lokálnì\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d z %d editováno"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "Pøedání výrazu selhalo.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Nejsou nastaveny ¾ádné znaèky"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: \"%s\" nevyhovují ¾ádné znaèky"
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"znaèka øádek sloupec soubor/text"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok øádek sloupec soubor/text"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Souborové znaèky:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Seznam skokù (poèínaje nejnovìj¹í polo¾kou):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historie znaèek v souborech (poèínaje nejnovìj¹í polo¾kou):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "Chybí '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Chybná kódová stránka"
+
+#: mbyte.c:3014
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nelze nastavit IC hodnoty"
+
+#: mbyte.c:3166
+msgid "E285: Failed to create input context"
+msgstr "E285: Nepodaøilo se vytvoøit vstupní kontext"
+
+#: mbyte.c:3313
+msgid "E286: Failed to open input method"
+msgstr "E286: Nepodaøilo se otevøít vstupní metodu"
+
+#: mbyte.c:3324
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Varování: likvidaèní zpìtné volání nelze nastavit na IM"
+
+#: mbyte.c:3330
+msgid "E288: input method doesn't support any style"
+msgstr "E288: vstupní metoda nepodporuje ¾ádný styl"
+
+#: mbyte.c:3387
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: vstupní metoda nepodporuje mùj 'preedit' typ"
+
+#: mbyte.c:3461
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: Nadbodový styl vy¾aduje fontset"
+
+#: mbyte.c:3489
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Máte GTK+ verze star¹í ne¾ 1.2.3. Stavová plocha vypnuta."
+
+#: mbyte.c:3726
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server vstupních metod nebì¾í"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: blok nebyl zamknut"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Chyba posunu ukazovátka pøi ètení odkládacího souboru"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: Chyba pøi ètení odkládacího souboru"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Chyba posunu ukazovátka pøi ukládání do odkládacího souboru"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: Chyba pøi ukládání do odkládacího souboru"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr ""
+"E300: Odkládací soubor ji¾ existuje! (Nìkdo hackujepøes nastra¾ený symlink?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nelze získat blok 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nelze získat blok 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: nelze získat blok 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Jéje, odkládací soubor byl ztracen!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nelze pøejmenovat odkládací soubor"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nelze otevøít odkládací soubor pro \"%s\""
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: nelze získat blok 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Odkládací soubor pro %s nebyl nalezen"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"Zadejte èíslo odkládacího souboru, který se má pou¾ít (0 pro ukonèení): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nelze otevøít %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nelze èíst blok 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Mo¾ná nedo¹lo k ¾ádným zmìnám, nebo Vim neaktualizoval odkládací soubor."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nelze pou¾ít s touto verzí Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Pou¾ijte Vim verze 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s se nezdá být odkládacím souborem Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nelze pou¾ít na tomto poèítaèi.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Soubor byl vytvoøen "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"nebo byl soubor po¹kozen."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Pou¾ívám odkládací soubor \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Pùvodní soubor \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Varování: Pùvodní soubor mohl být zmìnìn"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nelze èíst blok 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???CHYBÍ MNOHO ØÁDKÙ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???CHYBNÝ POÈET ØÁDKÙ"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PRÁZDNÝ BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???CHYBÌJÍCÍ ØÁDKY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID bloku 1 je chybné (je %s odkládacím souborem?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???CHYBÍ BLOK"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "od ??? po ???END mohou být øádky pomíchané"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "od ??? po ???END mohou být vlo¾ené/smazané øádky"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Obnova pøeru¹ena"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: V prùbìhu obnovy do¹lo k chybám; zkontrolujte øádky zaèínající na ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Obnova dokonèena. Zkontrolujte, zda je v¹e v poøádku."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Zva¾te ulo¾ení tohoto souboru pod jiným názvem\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "a kontrolu zmìn pomocí programu diff.)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr "Poté sma¾te odkládací soubor.\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Nalezené odkládací soubory:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " V aktuálním adresáøi:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Se zadaným názvem:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " V adresáøi "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- ¾ádné --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " vlastník: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " datum vytvoøení: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " datum vytvoøení: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [od Vim verze 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [nevypadá jako odkládací soubor Vim]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " název souboru: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" datum zmìny: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ANO"
+
+#: memline.c:1524
+msgid "no"
+msgstr "ne"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" u¾ivatelské jméno: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " název poèítaèe: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" název poèítaèe: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu : "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (stále aktivní)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nepou¾itelné s touto verzí Vim]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nepou¾itelné na tomto poèítaèi]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [nelze pøeèíst]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [nelze otevøít]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nelze zachovat - odkládací soubor neexistuje."
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Soubor zachován"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Uchování se nezdaøilo"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: chybné èíslo øádku: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nelze nalézt øádek %ld"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: chybné id ukazatele na blok 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx by mìlo mít hodnotu 3"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Aktualizováno pøíli¹ mnoho blokù?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: chybné id ukazatele na blok 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "smazán blok 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nelze nalézt øádek %ld"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: chybné id ukazatele na blok"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count má nulovou hodnotu"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: poèet øádkù mimo rozsah: %ld > celkový poèet øádkù"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: chybný poèet øádkù v bloku %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Nárùst velikosti zásobníku"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: chybné id ukazatele na blok 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: POZOR"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Nalezen odkládací soubor se jménem \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Pøi otevírání souboru\""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " NOVÌJ©Í ne¾ odkládací soubor!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Soubor mù¾e být editován jiným programem.\n"
+" Je-li tomu tak, pak si dejte pozor, aby jste po ulo¾ení zmìn\n"
+" nemìli dvì rùzné verze tého¾ souboru.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Ukonèete program, nebo opatrnì pokraèujte v editaci.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Editace tohoto souboru byla pøeru¹ena neèekaným ukonèením programu.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Je-li tomu tak, pak pou¾ijte \":recover\" èi \"vim -r "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" pro odstranìní zmìn (viz \":help recovery)\".\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Pokud jste tak ji¾ uèinil, tak sma¾te odkládací soubor \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" a tato zpráva se ji¾ nebude objevovat.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Odkládací soubor \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" ji¾ existuje!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - POZOR"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Odkládací soubor ji¾ existuje!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Otevøít pouze pro ètení\n"
+"&Pokraèovat v editaci\n"
+"O&bnovit soubor\n"
+"&Konec"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Otevøít pouze pro ètení\n"
+"&Pokraèovat v editaci\n"
+"O&bnovit soubor\n"
+"&Konec\n"
+"&Smazat"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Pøíli¹ mnoho odkládacích souborù"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Èásti cesty k pøedmìtu nabídky není podnabídkou"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Nabídka existuje pouze v jiném módu"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Nabídka tohoto jména neexistuje"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Cesta nabídkou nesmí vést do podnabídky"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Polo¾ky nabídky nelze pøidávat pøímo na li¹tu"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Oddìlovaè nesmí být èástí cesty nabídkou"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Nabídky ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "Odtrhnout tuto nabídku"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Cesta nabídkou musí vést k polo¾ce nabídky"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Vzor nenalezen: %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: V %s módu není nabídka definována"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Cesta nabídkou musí vést do podnabídky"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Nabídka nenalezena - zkontrolujte názvy nabídek"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Chyba pøi zpracování %s:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "øádek %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[pøíli¹ dlouhý øetìzec]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Správce zpráv: Bram Moolenaar <Bram@vim.org>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "Pøeru¹ení: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "pokraèování stiskem ENTER"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "Pro pokraèování stisknìte ENTER nebo zadejte pøíkaz"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- Pokraèování --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: øádek, MEZERNÍK/b: stránka, d/u: 0.5 stránky, q: konec)"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: øádek, MEZERNÍK: stránka, d: 0.5 stránky, q: konec)"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "Otázka"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ano\n"
+"&Ne"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ano\n"
+"&Ne\n"
+"&Zru¹it"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ano\n"
+"&Ne\n"
+"&Ulo¾it v¹e\n"
+"Zahodit &v¹e\n"
+"&Zru¹it"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "Dialog pro ukládání souborù"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "Dialog pro otevírání souborù"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Lituji, ale konzolová verze nepodporuje prohlí¾eè souborù"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: wc1: mìním soubor pouze_pro_ètení"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "poèet nových øádkù: 1"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "poèet smazaných øádkù: 1"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr "poèet nových øádkù: %ld"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "poèet smazaných øádkù: %ld"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr "(Pøeru¹eno)"
+
+#: misc1.c:6245
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachovávám soubory...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6255
+msgid "Vim: Finished.\n"
+msgstr "Vim: ukonèen\n"
+
+#: misc2.c:647 misc2.c:663
+msgid "ERROR: "
+msgstr "CHYBA: "
+
+#: misc2.c:667
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtù] celkem uvolnìno-alokováno %lu-%lu, vyu¾ito %lu, maximální vyu¾ití "
+"%lu\n"
+
+#: misc2.c:669
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[volání] celkem re/malloc(): %lu, celkem free() %lu\n"
+"\n"
+
+#: misc2.c:724
+msgid "E340: Line is becoming too long"
+msgstr "E340: Øádek se stává pøíli¹ dlouhým"
+
+#: misc2.c:768
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Vnitøní chyba: lalloc(%ld, )"
+
+#: misc2.c:876
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Nedostatek pamìti! (potøebuji alokovat bajtù: %lu)"
+
+#: misc2.c:2511
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Spou¹tím pøíkaz \"%s\" pomocí shellu"
+
+#: misc2.c:2706 misc2.c:5148 option.c:4584
+msgid "Missing colon"
+msgstr "Chybí dvojteèka"
+
+#: misc2.c:2708 misc2.c:2735
+msgid "Illegal mode"
+msgstr "nepøípustný mód"
+
+#: misc2.c:2774
+msgid "Illegal mouseshape"
+msgstr "Chybný tvar my¹i"
+
+#: misc2.c:2814 misc2.c:5168
+msgid "digit expected"
+msgstr "oèekávána èíslice"
+
+#: misc2.c:2819
+msgid "Illegal percentage"
+msgstr "nepøípustné procento"
+
+#: misc2.c:3123
+msgid "Enter encryption key: "
+msgstr "Zadejte ¹ifrovací klíè: "
+
+#: misc2.c:3124
+msgid "Enter same key again: "
+msgstr "Zadejte je¹tì jednou tentý¾ klíè:"
+
+#: misc2.c:3134
+msgid "Keys don't match!"
+msgstr "Klíèe se neshodují"
+
+#: misc2.c:3648
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Chybná cesta: '**[èíslo] musí být buï na konci cesty, nebo musí být\n"
+"následováno'%s. Viz :help path."
+
+#: misc2.c:4905
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Adresáø \"%s\" nelze v cdpath nalézt"
+
+#: misc2.c:4908
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Soubor \"%s\" nelze v path nalézt"
+
+#: misc2.c:4914
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ®ádný dal¹í adresáø \"%s\" nebyl v cdpath nalezen"
+
+#: misc2.c:4917
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ®ádný dal¹í soubor \"%s\" nebyl v cestì nalezen"
+
+#: misc2.c:5160
+msgid "Illegal component"
+msgstr "nepøípustná souèást"
+
+#: normal.c:2813
+msgid "Warning: terminal cannot highlight"
+msgstr "Varování: terminál nepodporuje zvýrazòování"
+
+#: normal.c:3008
+msgid "E348: No string under cursor"
+msgstr "E348: pod kurzorem není ¾ádný øetìzec"
+
+#: normal.c:3010
+msgid "E349: No identifier under cursor"
+msgstr "E349: pod kurzorem není ¾ádný identifikátor"
+
+#: normal.c:4175
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: pomocí aktuální 'foldmethod' nelze mazat záhyby"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "poèet øádkù posunutých jednou pomocí %s : 1"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "Poèet øádkù posunutých pomocí %s %d-krát : 1"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "Poèet øádkù: %ld (posunutých jednou pomocí %s)"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "Poèet øádkù: %ld (posunutých pomocí %s %d-krát)"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "poèet øádkù k odsazení: %ld"
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "poèet øádkù k odsazení: 1"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "poèet odsazených øádkù: %ld"
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "nelze kopírovat; pøesto smazáno"
+
+#: ops.c:2018
+msgid "1 line changed"
+msgstr "poèet øádek se zmìnìnou velikostí písmen: 1"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines changed"
+msgstr "poèet øádek se zmìnìnou velikostí písmen: %ld"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "poèet uvolòovaných øádkù: %ld"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "poèet zkopírovaných øádkù: 1"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "poèet zkopírovaných øádkù: %ld"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Registr %s je prázdný"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registry ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "nepøípustný název registru"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registry:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "%d není známým typem registru"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: '%s' není pøípustné jméno registru"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "øádkù: %ld;"
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Vybráno %s%ld z %ld øádkù; %ld z %ld slov; %ld z %ld Bytù"
+
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Sloupec %s z %s; Øádek %ld z %ld; Slovo %ld z %ld; Byte %ld z %ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld pro BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Dìkuji za pou¾ití Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Volba není podporována"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Není v modeline povoleno"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tNaposledy nastavena z "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Po = je vy¾adováno èíslo"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Nenalezen v termcapu"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Nepøípustný znak <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "Toto zde není povoleno"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "volba 'term' nemù¾e být prázdná"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "V GUI nelze mìnit term"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "Pou¾ijte \"gui\" pro spu¹tìní GUI"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "volby 'backupext' a 'patchmode' mají stejnou hodnotu"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "øetìzec o nulové délce"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "Po <%s> chybí èíslo"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "Chybí èárka"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "Je nutné zadat hodnotu '"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "obsahuje netisknutelné znaky"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "Chybná písma"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "nelze vybrat sadu písem"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "chybná sada písem"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "nelze vybrat ¹iroký font"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "Chybné ¹iroké písmo"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Nepøípustný znak po <%c>"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "je nutná èárka"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "volba `commentstring` musí být buï prázdná nebo nastavená na %s"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "Bez podpory my¹i"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "neuzavøená sekvence výrazù"
+
+#: option.c:5403
+msgid "too many items"
+msgstr "pøíli¹ mnoho polo¾ek"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "nevyvá¾ené skupiny"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "Okno náhledu ji¾ existuje"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr ""
+"hodnota volby 'winheight' nesmí být men¹í ne¾ hodnota volby 'winminheight'"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr ""
+"hodnota volby 'winwidth' nesmí být men¹í ne¾ hodnota volby 'winminwidth'"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "minimální potøebný poèet øádkù: %d"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "minimální potøebný poèet sloupcù: %d"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Neznámá volba: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kódy terminálu ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Nastavení globálních voleb ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Nastavení lokálních voleb ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Volby ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp CHYBA"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': pro %s chybí vyhovující znak"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': nadbyteèné znaky po støedníku: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "nelze otevøít "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nelze otevøít nové okno!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Vy¾aduje Amigados verze 2.04 nebo vy¹¹í\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Vy¾aduje %s verze %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Nelze otevøít NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr " Nelze vytvoøit "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim bude ukonèen %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "Nelze zmìnit mód konzole ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Nastavování re¾imu obrazovky není podporováno"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: neni konzole??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nelze spustit shell s parametrem -f"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Nelze spustit "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " návratová hodnota shellu\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE je pøíli¹ malá."
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O CHYBA"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(kráceno)"
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' není 80, nelze spustit externí pøíkaz"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Volání knihovní funkce \"%s()\" selhalo"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: Nelze zvolit tiskárnu"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "do %s v %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Chyba tisku: %s"
+
+#: os_mswin.c:1460
+msgid "Unknown"
+msgstr "Neznámý"
+
+#: os_mswin.c:1487
+#, c-format
+msgid "Printing '%s'"
+msgstr "Vyti¹tìno '%s'"
+
+#: os_mswin.c:2551
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Nepøípustná jméno znakové sady \"%s\" ve fontu \"%s\""
+
+#: os_mswin.c:2559
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Nepøípustný znak '%c' ve fontu \"%s\""
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Neplatný 'osfiletype' - pou¾it Text"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "VIm: dvojitý signál, konèím\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Zachycen smrtelný signál %s\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Zachycen smrtelný signál\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Doba otevírání X displeje (v ms): %ld"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: chyba X11\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "Test X displeje se nezdaøil"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "Vypr¹el èas pøi èekání na otevøení X displeje"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"nelze spustit shell "
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nelze spustit sh shell\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+" návratová hodnota shellu "
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nelze vytvoøit roury\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Volání fork selhalo\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Pøíkaz ukonèen\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "Otevøení X displeje se nezdaøilo"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Na øádku"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Nelze naèíst vim32.dll!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "Chyba VIMu"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nelze nastavit ukazatele funkcí na DLL"
+
+#: os_win16.c:578 os_win32.c:3021
+#, c-format
+msgid "shell returned %d"
+msgstr "návratová hodnota shellu %d"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Zachycen %s signál\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "zavøít"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "logoff"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "shutdown"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: Pøíkaz není k dispozici"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE se nevyskytuje ve Va¹í $PATH.\n"
+"Externí pøíkazy nebudou "
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Varování"
+
+#: quickfix.c:281
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Pøíli¹ mnoho %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:294
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Neoèekávaný výskyt %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: Ve formátovacím øetìzci chybí ]"
+
+#: quickfix.c:362
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c Nepodporovaná formátová specifikace ve formátovacím øetìzci"
+
+#: quickfix.c:380
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Nepøípustné %%%c v prefixu formátovacího øetìzce"
+
+#: quickfix.c:388
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Nepøípustné %%%c ve formátovacím øetìzci"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' neobsahuje ¾ádný vzorek"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Chybìjící nebo prázdný název adresáøe"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "®ádné dal¹í polo¾ky"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d/%d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (øádek smazán)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Konec quickfix seznamu"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Zaèátek quickfix seznamu"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "seznam chyb %d z %d; poèet chyb: %d"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nelze ulo¾it, je nastavena volba 'buftype'"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: Vzor je pøíli¹ dlouhý"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c nic není"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Chyba syntaxe v %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Zachyceno pøeteèení zásobníku: pøíli¹ slo¾itý regulární výraz?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: vzorek zpùsobil pøeteèení zásobníku"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "Vnìj¹í podøazené shody:\n"
+
+#: screen.c:2054
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "poèet øádkù v záhybu: %3ld"
+
+#: screen.c:7426
+msgid " VREPLACE"
+msgstr " VREPLACE"
+
+#: screen.c:7430
+msgid " REPLACE"
+msgstr " REPLACE"
+
+#: screen.c:7435
+msgid " REVERSE"
+msgstr " REVERSE"
+
+#: screen.c:7437
+msgid " INSERT"
+msgstr " INSERT"
+
+#: screen.c:7440
+msgid " (insert)"
+msgstr " (insert)"
+
+#: screen.c:7442
+msgid " (replace)"
+msgstr " (replace)"
+
+#: screen.c:7444
+msgid " (vreplace)"
+msgstr " (vreplace)"
+
+#: screen.c:7447
+msgid " Hebrew"
+msgstr " hebrejský"
+
+#: screen.c:7455
+msgid " (lang)"
+msgstr " (lang)"
+
+#: screen.c:7458
+msgid " (paste)"
+msgstr " (paste)"
+
+#: screen.c:7464
+msgid " SELECT"
+msgstr " SHODY"
+
+#: screen.c:7466
+msgid " VISUAL"
+msgstr " VIZUÁLNÍ"
+
+#: screen.c:7468
+msgid " BLOCK"
+msgstr " BLOK"
+
+#: screen.c:7470
+msgid " LINE"
+msgstr " ØÁDEK"
+
+#: screen.c:7483 screen.c:7537
+msgid "recording"
+msgstr "nahrávám"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "hledání dosáhlo zaèátku, pokraèování od konce"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "hledání dosáhlo konce, pokraèování od zaèátku"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Nepøípustný hledaný øetìzec: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: hledaný dosáhlo zaèátku bez nalezení %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: hledaný dosáhlo konce bez nalezení %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Po ';' oèekávám '?' nebo '/'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (vèetnì ji¾ vypsaných shod)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- Vlo¾ené soubory"
+
+#: search.c:3498
+msgid "not found "
+msgstr " nenalezeny"
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "v cestì ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (Ji¾ vypsáno)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " NENALEZENY"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Prohledávám vlo¾ené soubory: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: Shoda je na aktuálním øádku"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "V¹echny vlo¾ené soubory byly nalezeny"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "®ádné vlo¾ené soubory"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nelze nalézt definici"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nelze nalézt vzorek"
+
+#: syntax.c:2991
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: nepøípustný argument: %s"
+
+#: syntax.c:3168
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Syntaktická sestava %s neexistuje"
+
+#: syntax.c:3332
+msgid "No Syntax items defined for this buffer"
+msgstr "Pro tento buffer nejsou definovány ¾ádné pøedmìty syntaxe"
+
+#: syntax.c:3340
+msgid "syncing on C-style comments"
+msgstr "synchronizuji komentáøe v C stylu"
+
+#: syntax.c:3348
+msgid "no syncing"
+msgstr "¾ádná synchronizace"
+
+#: syntax.c:3351
+msgid "syncing starts "
+msgstr "synchronizace zaèíná "
+
+#: syntax.c:3353 syntax.c:3422
+msgid " lines before top line"
+msgstr " øádkù pøed zaèátkem"
+
+#: syntax.c:3357
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Polo¾ky synchronizace syntaxe ---"
+
+#: syntax.c:3360
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizuji pøedmìty"
+
+#: syntax.c:3365
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Pøedmìty syntaxe ---"
+
+#: syntax.c:3388
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Syntaktická sestava %s neexistuje"
+
+#: syntax.c:3412
+msgid "minimal "
+msgstr "minimální "
+
+#: syntax.c:3419
+msgid "maximal "
+msgstr "maximální "
+
+#: syntax.c:4047
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here nesmí být na tomto místì"
+
+#: syntax.c:4071
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Pro %s chybí polo¾ka regionu"
+
+#: syntax.c:4099
+msgid "E395: contains argument not accepted here"
+msgstr "E395: obsahuje argumenty, které zde nejsou povoleny"
+
+#: syntax.c:4110
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: obsahuje argumenty, které zde nejsou povoleny"
+
+#: syntax.c:4188
+msgid "E397: Filename required"
+msgstr "E397: Vy¾adován název souboru"
+
+#: syntax.c:4524
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Chybí '=': %s"
+
+#: syntax.c:4680
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Pøíli¹ málo argumentù: oblast syntaxe %s"
+
+#: syntax.c:5011
+msgid "E400: No cluster specified"
+msgstr "E400: Nebyla zadána ¾ádná sestava"
+
+#: syntax.c:5048
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Oddìlovaè vzorku %s nenalezen"
+
+#: syntax.c:5123
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Chyba za vzorkem %s"
+
+#: syntax.c:5205
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: synchronizace syntaxe: vzorek pokraèování øádkù zadán dvakrát"
+
+#: syntax.c:5262
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: nepøípustný argument: %s"
+
+#: syntax.c:5312
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Chybí rovnítko: %s"
+
+#: syntax.c:5318
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Prázdný argument: %s"
+
+#: syntax.c:5345
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s zde není povoleno"
+
+#: syntax.c:5352
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musí být první v 'contains' seznamu"
+
+#: syntax.c:5422
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Neznámá název skupiny: %s"
+
+#: syntax.c:5645
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: chybný podøazený pøíkaz :syntax : %s "
+
+#: syntax.c:6024
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: skupina zvýraznìní %s nebyla nalezena"
+
+#: syntax.c:6048
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Pøíli¹ málo argumentù: \":highlight link %s\""
+
+#: syntax.c:6055
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Pøíli¹ mnoho argumentù: \":highlight link %s\""
+
+#: syntax.c:6075
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: skupina je nastavena, odkaz na zvýrazòovací skupinu ignorován"
+
+#: syntax.c:6204
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: neèekané rovnítko : %s"
+
+#: syntax.c:6240
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: chybné rovnítko: %s"
+
+#: syntax.c:6262
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: chybí argument: %s"
+
+#: syntax.c:6299
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: nepøípustná hodnota: %s"
+
+#: syntax.c:6418
+msgid "E419: FG color unknown"
+msgstr "E419: barva popøedí není známá"
+
+#: syntax.c:6429
+msgid "E420: BG color unknown"
+msgstr "E420: barva popøedí není známá"
+
+#: syntax.c:6484
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: název èi èíslo barvy %s nebylo rozpoznáno"
+
+#: syntax.c:6688
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminálový kód %s je pøíli¹ dlouhý"
+
+#: syntax.c:6735
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: nepøípustný argument: %s"
+
+#: syntax.c:7264
+msgid "E424: Too many different highlighting attributes in use"
+msgstr ""
+"E424: Je pou¾íváno pøíli¹ velké mno¾ství odli¹ných zvýrazòovacích atributù"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "konec seznamu tagù"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "zaèátek seznamu tagù"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Pøed první vyhovující tag nelze pøeskoèit"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tag %s nenalezen"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri typ tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "soubor\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Zadejte èíslo (<CR> pro ukonèení): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Vyhovuje pouze jeden tag"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Za poslední vyhovující tag nelze pøeskoèit"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Soubor \"%s\" neexistuje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d z celkového poètu %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " nebo více"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Pou¾ívám tag s písmeny jiné velikosti!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: \"%s\" neexistuje"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # CÍL tag START øádek v souboru/textu"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Lineární hledání tagu"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binární hledání tagu"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Prohledávám soubor tagù %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Soubor tagù %s byl oøezán\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Chyba formátu v souboru tagù \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "Pøed bajtem %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Obsah soubor tagù %s není seøazen"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: ®ádný soubor tagù"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nelze najít vzorek tagù"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Tag nelze nalézt, pouze hádám!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' není znám. Dostupné vestavìné terminály:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "implicitní terminál '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "Nelze otevøít termcap"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminfo neobsahuje polo¾ku pro tento terminál"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "Termcap neobsahuje polo¾ku pro tento terminál"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Termcap neobsahuje polo¾ku pro \"%s\""
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminál musí mít schopnost \"cm\""
+
+#. Highlight title
+#: term.c:4878
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klávesy terminálu ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "spu¹tìn nový shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: chyba pøi ètení vstupu, konèím...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "odstranìní zmìn není mo¾né; chcete pøesto pokraèovat"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: èísla øádkù jsou chybná"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "poèet zmìn: 1"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "poèet zmìn: %ld"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: záznam o zmìnách po¹kozen"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: chybí undo øádek"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitová GUI verze pro MS Windows"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitová GUI verze pro MS Windows"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr " ve Win32s re¾imu"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr " s OLE podporou"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitová verze pro MS Windows konzolu"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitová verze pro MS Windows"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitová verze pro MS Windows"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitová MS-DOS verze"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) verze"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X verze"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS verze"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS verze"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Pou¾ité záplaty: "
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"pøelo¾il "
+
+#: version.c:731
+msgid "by "
+msgstr " "
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"maximální verze"
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"velká verze "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"normální verze"
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"malá verze "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"minimální verze"
+
+#: version.c:760
+msgid "without GUI."
+msgstr "bez grafického rozhraní"
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "s rozhraním GTK-GNOME"
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "s rozhraním GTK"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "s rozhraním X11-Motif"
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "S rozhraním X11-Athena"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "s rozhraním BeOS"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "s rozhraním Photon"
+
+#: version.c:782
+msgid "with GUI."
+msgstr "s grafickým rozhraním"
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "s grafickým rozhraním Carbon"
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "s grafickým rozhraním Cocoa"
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "s (clasickým) grafickým rozhraním"
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " Vlastnosti zahrnuté (+) a nezahrnuté (-):\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " systémový vimrc soubor: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " u¾ivatelský vimrc soubor: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " druhý u¾ivatelský vimrc soubor: \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " tøetí u¾ivatelský vimrc soubor: \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " u¾ivatelský exrc soubor: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " druhý u¾ivatelský exrc soubor: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " systémový gvimrc soubor: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " u¾ivatelský gvimrc soubor: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr "druhý u¾ivatelský gvimrc soubor: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr "tøetí u¾ivatelský gvimrc soubor: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " systémový soubor s menu: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " implicitní hodnota $VIM:\""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " implicitní hodnota $VIMRUNTIME: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "Pøeklad: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "Pøekladaè: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "Linkuji: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " PODPORA LADÌNÍ"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:936
+msgid "version "
+msgstr "verze "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar a dal¹í"
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim je volnì ¹iøitelný program s otevøeným zdrojovým kódem"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "Pomozte chudým dìtem v Ugandì!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "podrobnìj¹í informace získáte pomocí :help iccf<Enter>"
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "zadejte :q<Enter> pro ukonèení programu"
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "zadejte :help<Enter> èi <F1> pro nápovìdu"
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "zadejte :help version6<Enter> pro informace o verzi 6"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Bì¾ím v re¾imu kompatibility s Vi"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "zadejte :set nocp<Enter> pro implicitní nastavení Vim"
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "podrobnìj¹í informace získáte pomocí :help cp-default<Enter>"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "VAROVÁNÍ: detekovány Windows 95/98/ME"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "zadejte :help windows95<Enter> pro podrobnìj¹í informace"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Není ¾ádné preview okno není"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Okno nelze rozdìlit zároveò topleft a botright"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nelze rotovat, pokud je jiné okno rozdìleno"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: Poslední okno nelze uzavøít"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "Ji¾ existuje pouze jedno okno"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: Jiné okno obsahuje zmìny"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: Pod kurzorem se nenachází název souboru"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Soubor \"%s\" nelze v path nalézt"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Editace &multiple Vimy"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Editace jedním $Vim -em"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Editace &Vim -em"
+
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Editace existujícím Vimem - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Editace vybraných souborù Vimem"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Chyba pøi spou¹tìní procesu: Zkontrolujte zdali je gvim v $PATH!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "chyba gvimext.dll"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Název (v path) je pøíli¹ dlouhý"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--Buffer neobsahuje ¾ádný øádek--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "Pøíkaz pøeru¹en"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "Je vy¾adován argument"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ by mìl následovat /. ? nebo &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Chyba v oknì pøíkazové øádky; <CR> pro spu¹t¹ní, CTRL-C pro ukonèení"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Pøíkaz není z exrc/vimrc v aktuálním adresáøi èi pøi hledání tagu "
+"povolen."
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Soubor existuje (pou¾ijte ! pro vynucení)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "Pøíkaz selhal"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "Vnitøní chyba"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "Pøeru¹eno"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: Chybná adresa"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "Chybný argument"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Chybný argument: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Chybný výraz: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: Chybný rozsah"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "Chybný pøíkaz"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" je adresáøem"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Neoèekávané znaky pøed '='"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Znaèka má chybné èíslo øádku"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: není nastavena"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nelze mìnit, je nastavena volba 'modifiable'"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript vnoøen pøíli¹ hluboko"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: ®ádný alternativní soubor"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: Taková zkratka neexistuje"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "! není povoleno"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: Nelze pou¾ít GUI: nebylo zapnuto pøi pøekladu programu"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E26: nelze pou¾ít hebrejský re¾im: nebyl zapnut pøi pøekladu programu\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Nelze pou¾ít farsi re¾im: nebyl zapnut pøi pøekladu programu\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Skupina zvýraznìní %s neexistuje"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: Zatím není ¾ádný vlo¾ený text"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: ®ádná pøedchozí pøíkazová øádka"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: ®ádné takové mapování"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "®ádná shoda"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "®ádná shoda: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: ®ádný název souboru"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ¾ádný pøedchozí regulární výraz"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: ®ádný pøedchozí pøíkaz"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: ¾ádný pøedchozí regulární výraz"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "Rozsah není povolen"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: Nedostatek místa"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "Nelze vytvoøit soubor %s"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "Nelze získat název doèasného souboru"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "Nelze otevøít soubor %s"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "Nelze èíst soubor %s"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: Neulo¾ené zmìny (pou¾ijte ! pro vynucení)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: Nulový argument"
+
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: Oèekáváno èíslo"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nelze otevøít chybový soubor %s"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: Nedostatek pamìti!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "Vzor nenalezen"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Vzor nenalezen: %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "Argument musí být kladný"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: ®ádné chyby"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: Po¹kozený øetìzec pro vyhledávání"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: po¹kozený regexp program"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: 'nastavena volba 'readonly' (pou¾ijte ! pro vynucení)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nelze nastavit pouze_pro_ètení promìnnou \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Chyba pøi ètení chybového souboru"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Není v bezpeènostní schránce povoleno"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: Chybná hodnota volby 'scroll'"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: volba 'shell' je prázdná"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: Chyba pøi uzavírání odkládacího souboru"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: seznam tagù je prázdný"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: Pøíkaz je pøíli¹ slo¾itý"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: Název je pøíli¹ dlouhý"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: pøíli¹ mnoho ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: Pøíli¹ mnoho názvù souborù"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "Nadbyteèné znaky na konci"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: Neznámá znaèka"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nelze expandovat ¾olíkové znaky"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: Chyba pøi ukládání"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "Nulový poèet"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Pou¾ití <SID> mimo kontext skriptu"
diff --git a/src/po/de.po b/src/po/de.po
new file mode 100644
index 000000000..84d262816
--- /dev/null
+++ b/src/po/de.po
@@ -0,0 +1,6091 @@
+# German Translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# Previous-Translator(s): Johannes Zellner <johannes@zellner.org>
+#
+# thoughts (Gedanken)
+#
+# - mark : Markierung oder Marke?
+# - ambigous: Mehrdeutig, Nicht-eindeutig
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(deutsch)\n"
+"POT-Creation-Date: 2002-04-20 18:15+0200\n"
+"PO-Revision-Date: 2004-05-12 20:49+0200\n"
+"Last-Translator: Gerfried Fuchs <alfie@ist.org>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO_8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Kein Puffer kann alloziert werden; beenden..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Puffer kann nicht alloziert werden; benutze einen anderen..."
+
+#: buffer.c:706
+msgid "No buffers were unloaded"
+msgstr "Keine Puffer wurden ausgeladen"
+
+#: buffer.c:708
+msgid "No buffers were deleted"
+msgstr "Keine Puffer wurden gelöscht"
+
+#: buffer.c:710
+msgid "No buffers were wiped out"
+msgstr "Keine Puffer wurden gelöscht"
+
+#: buffer.c:718
+msgid "1 buffer unloaded"
+msgstr "1 Puffer ausgeladen"
+
+#: buffer.c:720
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d Puffer ausgeladen"
+
+#: buffer.c:725
+msgid "1 buffer deleted"
+msgstr "1 Puffer gelöscht"
+
+#: buffer.c:727
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d Puffer gelöscht"
+
+#: buffer.c:732
+msgid "1 buffer wiped out"
+msgstr "1 Puffer gelöscht"
+
+#: buffer.c:734
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d Puffer gelöscht"
+
+#: buffer.c:791
+msgid "E84: No modified buffer found"
+msgstr "E84: Es wurde keine veränderten Puffer gefunden"
+
+#. back where we started, didn't find anything.
+#: buffer.c:830
+msgid "E85: There is no listed buffer"
+msgstr "E85: Es gibt keine angezeigte Puffer"
+
+#: buffer.c:842
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Kann nicht zum Puffer %ld wechseln"
+
+#: buffer.c:845
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Kann nicht über den letzten Puffer hinaus gehen"
+
+#: buffer.c:847
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Kann nicht vor den ersten Puffer gehen"
+
+#: buffer.c:871
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr ""
+"E89: Puffer %ld wurde seit der letzten Änderung nicht geschrieben (erzwinge "
+"mit !)"
+
+#: buffer.c:887
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: letzter Puffer kann nicht heraus-geladen werden"
+
+#: buffer.c:1342
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Achtung: Überlauf der Liste der Dateinamen"
+
+#: buffer.c:1508
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: kein Puffer %ld gefunden"
+
+#: buffer.c:1734
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Mehr als eine Möglichkeit für %s"
+
+#: buffer.c:1736
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Kein Puffer passt zu %s"
+
+#: buffer.c:2141 ex_docmd.c:6089
+#, c-format
+msgid "line %ld"
+msgstr "Zeile %ld"
+
+#: buffer.c:2224
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Ein Puffer mit diesem Namen existiert bereits"
+
+#: buffer.c:2517
+msgid " [Modified]"
+msgstr " [Verändert]"
+
+#: buffer.c:2522
+msgid "[Not edited]"
+msgstr "[Nicht editiert]"
+
+#: buffer.c:2527
+msgid "[New file]"
+msgstr "[Neue Datei]"
+
+#: buffer.c:2528
+msgid "[Read errors]"
+msgstr "[Lese-Fehler]"
+
+#: buffer.c:2530 fileio.c:1777
+msgid "[readonly]"
+msgstr "[nur Lesen]"
+
+#: buffer.c:2545
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 Zeile --%d%%--"
+
+#: buffer.c:2547
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld Zeilen --%d%%--"
+
+#: buffer.c:2554
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "Zeile %ld von %ld --%d%%-- Spalte "
+
+#: buffer.c:2642
+msgid "[No file]"
+msgstr "[Keine Datei]"
+
+#. must be a help buffer
+#: buffer.c:2682
+msgid "help"
+msgstr "[Hilfe]"
+
+#: buffer.c:3193 screen.c:4754
+msgid "[help]"
+msgstr "[Hilfe]"
+
+#: buffer.c:3225 screen.c:4760
+msgid "[Preview]"
+msgstr "[Voransicht]"
+
+#: buffer.c:3431
+msgid "All"
+msgstr "Alles"
+
+# Ende sounds better than "Unten"
+#: buffer.c:3431
+msgid "Bot"
+msgstr "Ende"
+
+# Anfang sounds better than "Oben"
+#: buffer.c:3433
+msgid "Top"
+msgstr "Anfang"
+
+#: buffer.c:4169
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Liste der Puffer:\n"
+
+#: buffer.c:4202
+msgid "[Error List]"
+msgstr "[Fehlerliste]"
+
+#: buffer.c:4215 memline.c:1513
+msgid "[No File]"
+msgstr "[Keine Datei]"
+
+#: buffer.c:4435
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Optionen ---"
+
+#: buffer.c:4445
+#, c-format
+msgid "Signs for %s:"
+msgstr "Vorzeichen für %s:"
+
+#: buffer.c:4451
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " Zeile=%ld id=%d Name=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: \"diff\" ist für mehr als %ld Puffer nicht möglich"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Kann keine \"diffs\" erstellen"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Patch-Datei"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: \"diff\"-Ausgabe kann nicht gelesen werden"
+
+#: diff.c:1732
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktueller Puffer ist nicht im \"diff\"-Modus"
+
+#: diff.c:1744
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Kein weiterer Puffer ist im \"diff\"-Modus"
+
+#: diff.c:1752
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: mehrdeutig: Mehr als zwei Puffer im \"diff\"-Modus"
+
+#: diff.c:1775
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Puffer \"%s\" kann nicht gefunden werden"
+
+#: diff.c:1781
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Puffer \"%s\" ist nicht im \"diff\"-Modus"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: 'Escape' ist in einem Digraphen nicht erlaubt"
+
+#: digraph.c:2344
+msgid "Keymap file not found"
+msgstr "\"Keymap\"-Datei nicht gefunden"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :loadkeymap außerhalb einer eingelesenen Datei"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Stichwort-Ergänzung (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X-Modus (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " lokale Stichwort-Ergänzung (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Zeilen-Ergänzung (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Datei-Namens-Ergänzung (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Tag-Ergänzung (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Pfad-Muster-Ergänzung (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Definitions-Ergänzung (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Wörterbuch-Ergänzung (^K/^N/^P) "
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus-Ergänzung (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Kommando-Zeilen-Ergänzung (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Stieß an das Ende eines Absatzes"
+
+#: edit.c:907
+msgid "'thesaurus' option is empty"
+msgstr "Die Option 'thesaurus' ist leer"
+
+#: edit.c:1083
+msgid "'dictionary' option is empty"
+msgstr "Die Option 'dictionary' ist leer"
+
+#: edit.c:2007
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Durchsuchen des Wörterbuchs: %s"
+
+#: edit.c:2198
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (Einfügen) Scrollen (^E/^Y)"
+
+#: edit.c:2200
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (Ersetzen) Scrollen (^E/^Y)"
+
+#: edit.c:2512
+#, c-format
+msgid "Scanning: %s"
+msgstr "Durchsuche: %s"
+
+#: edit.c:2547
+msgid "Scanning tags."
+msgstr "Durchsuchen von Tags."
+
+#: edit.c:3207
+msgid " Adding"
+msgstr " Hinzufügung der"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3256
+msgid "-- Searching..."
+msgstr "-- Suche..."
+
+#: edit.c:3312
+msgid "Back at original"
+msgstr "Zurück am Ursprung"
+
+#: edit.c:3317
+msgid "Word from other line"
+msgstr "Wort aus anderer Zeile"
+
+#: edit.c:3322
+msgid "The only match"
+msgstr "Einziger Treffer"
+
+#: edit.c:3381
+#, c-format
+msgid "match %d of %d"
+msgstr "Treffer %d von %d"
+
+#: edit.c:3384
+#, c-format
+msgid "match %d"
+msgstr "Treffer %d"
+
+#: eval.c:698
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Unbekannte Variable: \"%s\""
+
+#: eval.c:977
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Fehlende Klammern: %s"
+
+#: eval.c:1057 eval.c:1073
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Keine solche Variable: \"%s\""
+
+#: eval.c:1315
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: fehlender ':' nach '?'"
+
+#: eval.c:1929
+msgid "E110: Missing ')'"
+msgstr "E110: fehlende ')'"
+
+#: eval.c:1979
+msgid "E111: Missing ']'"
+msgstr "E111: fehlende ']'"
+
+#: eval.c:2054
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Options-Bezeichnung fehlt: %s"
+
+#: eval.c:2072
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Unbekannte Option: %s"
+
+#: eval.c:2134
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Fehlendes Anführungszeichen: %s"
+
+#: eval.c:2251
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Fehlendes Anführungszeichen: %s"
+
+#: eval.c:2569
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Unzulässige Argumente für Funktion %s"
+
+#: eval.c:2570
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Unbekannte Funktion: %s"
+
+#: eval.c:2571
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Zu viele Argumente für Funktion: %s"
+
+#: eval.c:2572
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Nicht genug Argumente für Funktion: %s"
+
+#: eval.c:2573
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> wurde nicht in einer Skript-Umgebung benutzt: %s"
+
+#: eval.c:3172 gui.c:3990
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:3678
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld Zeilen: "
+
+#: eval.c:4794
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Abbrechen"
+
+#: eval.c:5626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Keine Verbindung zum Vim-Server"
+
+#: eval.c:5716
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Server-Antwort kann nicht gelesen werden"
+
+#: eval.c:5741
+msgid "E258: Unable to send to client"
+msgstr "E258: Kann nicht zum Client senden"
+
+#: eval.c:5786
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Kann nicht zu %s senden"
+
+#: eval.c:5884
+msgid "(Invalid)"
+msgstr "(ungültig)"
+
+#: eval.c:6895
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Variable nicht definiert: %s"
+
+#: eval.c:7593
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: Die Funktion %s existiert bereits; ersetze sie mit !"
+
+#: eval.c:7635
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Funktion nicht definiert: %s"
+
+#: eval.c:7648
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: fehlendes '(': %s"
+
+#: eval.c:7680
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Unzulässiges Argument: %s"
+
+#: eval.c:7766
+msgid "E126: Missing :endfunction"
+msgstr "E126: fehlendes :endfunction"
+
+#: eval.c:7845
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Funktion %s kann nicht umdefiniert werden: sie ist in Verwendung"
+
+#: eval.c:7903
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Funktions-Name muss mit Großbuchstaben beginnen: %s"
+
+#: eval.c:7909
+msgid "E129: Function name required"
+msgstr "E129: Funktions-Name wird verlangt"
+
+#: eval.c:8002
+msgid "function "
+msgstr "Funktion "
+
+#: eval.c:8117
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Funktion nicht definiert: %s"
+
+#: eval.c:8122
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Funktion %s kann nicht gelöscht werden: sie ist in Verwendung"
+
+#: eval.c:8169
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Funktionsaufruf-Tiefe überschreitet 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8220
+#, c-format
+msgid "calling %s"
+msgstr "rufe %s auf"
+
+#. always scroll up, don't overwrite
+#: eval.c:8245 ex_cmds2.c:1988
+#, c-format
+msgid "continuing in %s"
+msgstr "weiter in %s"
+
+#: eval.c:8299
+msgid "E133: :return not inside a function"
+msgstr "E133: :return außerhalb einer Funktion"
+
+#: eval.c:8377
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s lieferte #%ld zurück"
+
+#: eval.c:8380
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s lieferte \"%s\" zurück"
+
+#: eval.c:8521
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globale Variablen:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktal %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Verschiebe Zeilen in sich selbst"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "1 Zeile verschoben"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld Zeilen verschoben"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld Zeilen gefiltert"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter*-Auto-Kommandos dürfen den aktuellen Puffer nicht ändern"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Kein Schreiben seit der letzten Änderung]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s in Zeile: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Zu viele Fehler; überspringe Rest der Datei"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Lesen der viminfo-Datei \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " Information"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr "Markierungen"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " DURCHGEFALLEN"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo-Datei ist nicht schreibbar: %s"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Schreiben in die viminfo-Datei %s ist nicht möglich!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Schreiben der viminfo-Datei \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Diese viminfo-Datei wurde von Vim %s generiert.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Sie können sie verändern, wenn Sie vorsichtig vorgehen!\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Wert von 'encoding', als diese Datei geschrieben wurde\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Unzulässiges Zeichen am Anfang"
+
+#: ex_cmds.c:2053 ex_cmds.c:2310 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Schreibe Als"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Datei ist in einem anderen Puffer geladen"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Partielle Datei schreiben?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Verwenden Sie ! zum Schreiben von partiellen Puffern"
+
+#: ex_cmds.c:2244
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Überschreibe existierende Datei \"%.*s\"?"
+
+# Cursor: Schreibmarke Positionsmarke
+#: ex_cmds.c:2315
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Kein Dateiname für Puffer %ld"
+
+#: ex_cmds.c:2353
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr ""
+"E142: Datei wurde nicht geschrieben: Schreiben ist durch die 'write'-Option "
+"ausgeschaltet"
+
+#: ex_cmds.c:2373
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"'readonly'-Option ist für \"%.*s\" gesetzt.\n"
+"Möchten Sie trotzdem schreiben?"
+
+#: ex_cmds.c:2538
+msgid "Edit File"
+msgstr "Editiere Datei"
+
+#: ex_cmds.c:3061
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Auto-Kommandos löschten unerwartet neuen Puffer %s"
+
+#: ex_cmds.c:3193
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: nicht numerisches Argument für :z"
+
+#: ex_cmds.c:3278
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Shell Befehle sind in rvim nicht erlaubt"
+
+#: ex_cmds.c:3385
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Reguläre Ausdrücke können nicht durch Buchstaben begrenzt werden"
+
+#: ex_cmds.c:3727
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "ersetze durch %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4092
+msgid "(Interrupted) "
+msgstr "(Unterbrochen) "
+
+#: ex_cmds.c:4096
+msgid "1 substitution"
+msgstr "eine Ersetzung"
+
+#: ex_cmds.c:4098
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld Ersetzungen"
+
+#: ex_cmds.c:4101
+msgid " on 1 line"
+msgstr " auf einer Zeile"
+
+#: ex_cmds.c:4103
+#, c-format
+msgid " on %ld lines"
+msgstr " auf %ld Zeilen"
+
+#: ex_cmds.c:4154
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Kann :global nicht rekursiv ausführen"
+
+#: ex_cmds.c:4189
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Regulärer Ausdruck fehlt in global"
+
+#: ex_cmds.c:4238
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Muster in jeder Zeile gefunden: %s"
+
+#: ex_cmds.c:4319
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Letzte ersetzte Zeichenkette:\n"
+"$"
+
+#: ex_cmds.c:4421
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Schade, keine Hilfe für %s"
+
+#: ex_cmds.c:4455
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Hilfe-Datei \"%s\" nicht gefunden"
+
+#: ex_cmds.c:4917
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: kein Verzeichnis: %s"
+
+#: ex_cmds.c:4945
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: %s kann nicht zum Schreiben geöffnet werden"
+
+#: ex_cmds.c:4959
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: %s kann nicht zum Lesen geöffnet werden"
+
+#: ex_cmds.c:5038
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Tag \"%s\" ist mehrmals in der Datei %s"
+
+#: ex_cmds.c:5139
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Unbekannter \"sign\"-Befehl: %s"
+
+#: ex_cmds.c:5159
+msgid "E156: Missing sign name"
+msgstr "E156: Name des Zeichens fehlt"
+
+#: ex_cmds.c:5205
+msgid "E255: Too many signs defined"
+msgstr "E255: Zu viele Zeichen definiert"
+
+#: ex_cmds.c:5247
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Ungültiger Text für ein Zeichen: %s"
+
+#: ex_cmds.c:5271 ex_cmds.c:5457
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Unbekanntes Zeichen: %s"
+
+#: ex_cmds.c:5317
+msgid "E159: Missing sign number"
+msgstr "E159: Fehlende Zeichen-Nummer"
+
+#: ex_cmds.c:5397
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: ungültige Puffer-Nummer: %s"
+
+#: ex_cmds.c:5436
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: ungültige Zeichen-ID: %ld"
+
+#: ex_cmds.c:5607
+msgid "[Deleted]"
+msgstr "[gelöscht]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Debug-Modus. Geben Sie \"cont\" zum Verlassen ein."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "Zeile %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "Befehl: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Haltepunkt in \"%s%s\" Zeile %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Haltepunkt nicht gefunden: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Keine Haltepunkte definiert"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s Zeile %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Änderungen in \"%.*s\" speichern?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8673
+msgid "Untitled"
+msgstr "Unbenannt"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Puffer \"%s\" wurde seit der letzten Änderung nicht geschrieben"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Achtung: Unerwarteter Eintritt in einen andren Puffer (überprüfen Siedie "
+"Autocommands)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Es gibt nur eine Datei zum Editieren"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Kann nicht über die erste Datei hinausgehen"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Kann nicht über die letzte Datei hinausgehen"
+
+#: ex_cmds2.c:1634
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Suche nach \"%s\" in \"%s\""
+
+#: ex_cmds2.c:1656
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Suche nach \"%s\""
+
+#: ex_cmds2.c:1680
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "im 'runtimepath' nicht gefunden: \"%s\""
+
+#: ex_cmds2.c:1714
+msgid "Source Vim script"
+msgstr "Vim Skript"
+
+#: ex_cmds2.c:1832
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Kann kein Verzeichnis einlesen: \"%s\""
+
+#: ex_cmds2.c:1862
+#, c-format
+msgid "could not source \"%s\""
+msgstr "\"%s\" konnte nicht gelesen werden"
+
+#: ex_cmds2.c:1864
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "Zeile %ld: \"%s\" konnte nicht gelesen werden"
+
+#: ex_cmds2.c:1878
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "lese \"%s\""
+
+#: ex_cmds2.c:1880
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "Zeile %ld: lese \"%s\""
+
+#: ex_cmds2.c:1986
+#, c-format
+msgid "finished sourcing %s"
+msgstr "Lesen von %s beendet"
+
+#: ex_cmds2.c:2287
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Achtung: Falscher Zeilentrenner, vielleicht fehlt ein ^M"
+
+#: ex_cmds2.c:2336
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding außerhalb einer eingelesenen Datei"
+
+#: ex_cmds2.c:2369
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish außerhalb einer eingelesenen Datei"
+
+#: ex_cmds2.c:2838
+msgid "No text to be printed"
+msgstr "Kein Text zum Drucken"
+
+#: ex_cmds2.c:2916
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Drucke Seite %d (%d%%)"
+
+#: ex_cmds2.c:2925
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopie %d von %d"
+
+#: ex_cmds2.c:2977
+#, c-format
+msgid "Printed: %s"
+msgstr "Gedruckt: %s"
+
+#: ex_cmds2.c:2984
+msgid "Printing aborted"
+msgstr "Drucken abgebrochen"
+
+#: ex_cmds2.c:3367
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Fehler beim Schreiben der PostScript Ausgabe-Datei"
+
+#: ex_cmds2.c:4042
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: PostScript Ausgabe-Datei kann nicht geöffnet werden"
+
+#: ex_cmds2.c:4080
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Datei \"%s\" kann nicht geöffnet werden"
+
+#: ex_cmds2.c:4091
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: PostScript 'resource'-Datei \"%s\" kann nicht gelesen werden"
+
+#: ex_cmds2.c:4289
+msgid "Sending to printer..."
+msgstr "Schicke zum Drucker..."
+
+#: ex_cmds2.c:4293
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Druck der PostScript-Datei schlug fehl"
+
+#: ex_cmds2.c:4295
+msgid "Print job sent."
+msgstr "Druckauftrag abgeschickt"
+
+#: ex_cmds2.c:4691
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Momentane %sSprache: \"%s\""
+
+#: ex_cmds2.c:4702
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Sprache kann nicht auf \"%s\" gesetzt werden"
+
+#: ex_docmd.c:490
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr ""
+"Ex-Modus. Geben Sie \"visual\" ein, um zum Normal-Modus zurückzukehren."
+
+#. must be at EOF
+#: ex_docmd.c:526
+msgid "At end-of-file"
+msgstr "Am Dateiende"
+
+#: ex_docmd.c:601
+msgid "E169: Command too recursive"
+msgstr "E169: Befehl zu rekursiv"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: fehlendes :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: fehlendes :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Ende der eingelesenen Datei"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Ende der Funktion"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Nicht-eindeutige Verwendung eines benutzerdefinierten Befehls"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Kein Editor-Befehl"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "Nur keine Panik!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Bereichsgrenzen rückwärts"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Bereichsgrenzen rückwärts; vertauschen"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Verwenden Sie w oder w>>"
+
+#: ex_docmd.c:3097
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Der Befehl ist in dieser Version nicht implementiert"
+
+#: ex_docmd.c:3267
+msgid "E172: Only one file name allowed"
+msgstr "E172: Nur ein Dateiname erlaubt"
+
+#: ex_docmd.c:3823
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "%d weitere Dateien zum Editieren. Trotzdem beenden?"
+
+#: ex_docmd.c:3830
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: %ld weitere Dateien zum Editieren"
+
+#: ex_docmd.c:3924
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Befehl existiert bereits: verwenden Sie ! zum Umdefinierten"
+
+#: ex_docmd.c:4029
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Name Args Bereich Fertig Definition"
+
+#: ex_docmd.c:4118
+msgid "No user-defined commands found"
+msgstr "Keine vom Benutzer definierten Befehle gefunden"
+
+#: ex_docmd.c:4149
+msgid "E175: No attribute specified"
+msgstr "E175: Kein Attribut angegeben"
+
+#: ex_docmd.c:4201
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Falsche Anzahl von Argumenten"
+
+#: ex_docmd.c:4216
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Zähler kann nicht zweimal angegeben werden"
+
+#: ex_docmd.c:4226
+msgid "E178: Invalid default value for count"
+msgstr "E178: Ungültige Voreinstellung für den Zähler"
+
+#: ex_docmd.c:4254
+msgid "E179: argument required for complete"
+msgstr "E179: Argument wird zur Vervollständigung benötigt"
+
+#: ex_docmd.c:4273
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Ungültiger Vervollständigungs-Wert: %s"
+
+#: ex_docmd.c:4281
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Ungültiges Attribut: %s"
+
+#: ex_docmd.c:4322
+msgid "E182: Invalid command name"
+msgstr "E182: Ungültiger Befehls-Name"
+
+#: ex_docmd.c:4337
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Benutzerdefinierte Befehle müssen mit Großbuchstaben beginnen"
+
+#: ex_docmd.c:4406
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Unbekannter benutzerdefinierter Befehl: %s"
+
+#: ex_docmd.c:4857
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Zeile %s kann nicht gefunden werden"
+
+#: ex_docmd.c:4865
+msgid "Greetings, Vim user!"
+msgstr "Herzliche Grüße, Vim Benutzer!"
+
+#: ex_docmd.c:5569
+msgid "Edit File in new window"
+msgstr "Editiere Datei in einem neuen Fenster"
+
+#: ex_docmd.c:5839
+msgid "No swap file"
+msgstr "Keine Auslagerungs-Datei"
+
+#: ex_docmd.c:5943
+msgid "Append File"
+msgstr "Füge Datei an"
+
+#: ex_docmd.c:6002
+msgid "E186: No previous directory"
+msgstr "E186: Kein vorheriges Verzeichnis"
+
+#: ex_docmd.c:6079
+msgid "E187: Unknown"
+msgstr "E187: Unbekannt"
+
+#: ex_docmd.c:6197
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Fenster-Position: X %d, Y %d"
+
+#: ex_docmd.c:6202
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: die Fenster-Position kann für dieses Terminal nicht bestimmt werden"
+
+#: ex_docmd.c:6474
+msgid "Save Redirection"
+msgstr "Umleitung Speichern"
+
+#: ex_docmd.c:6623
+msgid "Save View"
+msgstr "Ansichten Speichern"
+
+#: ex_docmd.c:6624
+msgid "Save Session"
+msgstr "Sitzung Speichern"
+
+#: ex_docmd.c:6626
+msgid "Save Setup"
+msgstr "Einstellungen Speichern"
+
+#: ex_docmd.c:6775
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" existiert (erzwinge durch !)"
+
+#: ex_docmd.c:6780
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: \"%s\" kann nicht zum Schreiben geöffnet werden"
+
+#. set mark
+#: ex_docmd.c:6804
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr ""
+"E191: Argument muss ein Buchstabe oder vorwärts/rückwärts-Anführungszeichen "
+"sein"
+
+#: ex_docmd.c:6847
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursive Verwendung von :normal zu tief"
+
+#: ex_docmd.c:7208
+msgid ":if nesting too deep"
+msgstr ":if Schachtelung zu tief"
+
+#: ex_docmd.c:7243
+msgid ":endif without :if"
+msgstr ":endif ohne :if"
+
+#: ex_docmd.c:7263
+msgid ":else without :if"
+msgstr ":else ohne :if"
+
+#: ex_docmd.c:7265
+msgid ":elseif without :if"
+msgstr ":elseif ohne :if"
+
+#: ex_docmd.c:7317
+msgid ":while nesting too deep"
+msgstr ":while Schachtelung zu tief"
+
+#: ex_docmd.c:7363
+msgid ":continue without :while"
+msgstr ":continue ohne :while"
+
+#: ex_docmd.c:7390
+msgid ":break without :while"
+msgstr ":break ohne :while"
+
+#: ex_docmd.c:7413 ex_docmd.c:7418
+msgid ":endwhile without :while"
+msgstr ":endwhile ohne :while"
+
+#: ex_docmd.c:7439
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction außerhalb einer Funktion"
+
+#: ex_docmd.c:7619
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Kein anderer Dateiname zur Ersetzung mit '#'"
+
+#: ex_docmd.c:7650
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "kein Auto-Kommando-Datei-Name zur Ersetzung mit \"<afile>\""
+
+#: ex_docmd.c:7658
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "keine Auto-Kommando-Puffer-Nummer zur Ersetzung mit \"<abuf>\""
+
+#: ex_docmd.c:7669
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"kein passender Name eines Auto-Kommandos zur Ersetzung mit \"<amatch>\""
+
+#: ex_docmd.c:7679
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "kein :source Dateiname zur Ersetzung mit \"<sfile>\""
+
+#: ex_docmd.c:7720
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Leerer Dateiname für '%' oder '#', funktioniert nur mit \":p:h\""
+
+#: ex_docmd.c:7722
+msgid "Evaluates to an empty string"
+msgstr "Ergibt eine leere Zeichenkette"
+
+#: ex_docmd.c:8655
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: viminfo kann nicht zum Lesen geöffnet werden"
+
+#: ex_docmd.c:8828
+msgid "E196: No digraphs in this version"
+msgstr "ed9) Keine Digraphen in dieser Version"
+
+#: ex_getln.c:2833
+msgid "tagname"
+msgstr "Tag-Name"
+
+#: ex_getln.c:2836
+msgid " kind file\n"
+msgstr " verwandte Datei\n"
+
+#: ex_getln.c:4049
+msgid "'history' option is zero"
+msgstr "'history'-Option ist Null"
+
+#: ex_getln.c:4289
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Geschichte (neueste bis älteste):\n"
+
+#: ex_getln.c:4290
+msgid "Command Line"
+msgstr "Befehlszeile"
+
+#: ex_getln.c:4291
+msgid "Search String"
+msgstr "Suchausdruck"
+
+#: ex_getln.c:4292
+msgid "Expression"
+msgstr "Ausdruck"
+
+#: ex_getln.c:4293
+msgid "Input Line"
+msgstr "Eingabe-Zeile"
+
+#: ex_getln.c:4323
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar über die Länge des Befehls hinaus"
+
+#: ex_getln.c:4491
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: aktives Fenster oder Puffer gelöscht"
+
+#: fileio.c:351
+msgid "Illegal file name"
+msgstr "unzulässiger Dateiname"
+
+#: fileio.c:375 fileio.c:500 fileio.c:2516 fileio.c:2554
+msgid "is a directory"
+msgstr "ist ein Verzeichnis"
+
+#: fileio.c:377
+msgid "is not a file"
+msgstr "ist keine Datei"
+
+#: fileio.c:522 fileio.c:3646
+msgid "[New File]"
+msgstr "[Neue Datei]"
+
+#: fileio.c:540
+msgid "[Permission Denied]"
+msgstr "[Keine Erlaubnis]"
+
+#: fileio.c:634
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Auto-Kommandos haben die Datei unlesbar gemacht"
+
+#: fileio.c:636
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr ""
+"E201: *ReadPre Auto-Kommandos dürfen nicht den aktuellen Puffer wechseln"
+
+#: fileio.c:657
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Lese von stdin...\n"
+
+#: fileio.c:663
+msgid "Reading from stdin..."
+msgstr "Lese von stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:892
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Datei wurde unlesbar durch Umwandlung"
+
+#: fileio.c:1755
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1762
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1769
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1777
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1787
+msgid "[CR missing]"
+msgstr "[CR fehlt]"
+
+#: fileio.c:1792
+msgid "[NL found]"
+msgstr "[NL gefunden]"
+
+#: fileio.c:1797
+msgid "[long lines split]"
+msgstr "[lange Zeilen geteilt]"
+
+#: fileio.c:1803 fileio.c:3630
+msgid "[NOT converted]"
+msgstr "[NICHT konvertiert]"
+
+#: fileio.c:1808 fileio.c:3635
+msgid "[converted]"
+msgstr "[konvertiert]"
+
+#: fileio.c:1815 fileio.c:3660
+msgid "[crypted]"
+msgstr "[verschlüsselt]"
+
+#: fileio.c:1822
+msgid "[CONVERSION ERROR]"
+msgstr "[UMWANDLUNGS-FEHLER]"
+
+#: fileio.c:1829
+msgid "[READ ERRORS]"
+msgstr "[LESE-FEHLER]"
+
+#: fileio.c:2036
+msgid "Can't find temp file for conversion"
+msgstr "temporäre Datei kann nicht zum Umwandeln geöffnet werden"
+
+#: fileio.c:2043
+msgid "Conversion with 'charconvert' failed"
+msgstr "Fehler bei der Umwandlung mit 'charconvert'"
+
+#: fileio.c:2046
+msgid "can't read output of 'charconvert'"
+msgstr "Ausgabe von 'charconvert' kann nicht gelesen werden"
+
+#: fileio.c:2432
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Auto-Kommandos haben den zu schreibenden Puffer gelöscht oder heraus "
+"geladen"
+
+#: fileio.c:2455
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr ""
+"E204: Auto-Kommandos haben die Anzahl der Zeilen in unerwarteter Weise "
+"verändert"
+
+#: fileio.c:2521 fileio.c:2538
+msgid "is not a file or writable device"
+msgstr "ist keine Datei oder beschreibbares Device"
+
+#: fileio.c:2584
+msgid "is read-only (use ! to override)"
+msgstr "ist Schreibgeschützt (erzwinge durch !)"
+
+#: fileio.c:2886
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Sicherungs-Datei kann nicht geschrieben werden (erzwinge mit !)"
+
+#: fileio.c:2898
+msgid "Close error for backup file (use ! to override)"
+msgstr "Fehler beim Schließen der Sicherungs-Datei (erzwinge mit !)"
+
+#: fileio.c:2900
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Datei zum Backup kann nicht gelesen werden (erzwinge mit !)"
+
+#: fileio.c:2916
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Backup-Datei kann nicht angelegt werden (erzwinge mit !)"
+
+#: fileio.c:3018
+msgid "Can't make backup file (use ! to override)"
+msgstr "Backup-Datei kann nicht erstellt werden (erzwinge mit !)"
+
+#: fileio.c:3080
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "Der Resourcefork geht verloren (erzwinge mit !)"
+
+#: fileio.c:3169
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: temporäre Datei kann nicht zum Schreiben geöffnet werden"
+
+#: fileio.c:3187
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Fehler bei der Umwandlung (schreibe ohne Umwandlung mit !)"
+
+#: fileio.c:3222
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Gelinkte Datei kann nicht zum Schreiben geöffnet werden"
+
+#: fileio.c:3226
+msgid "E212: Can't open file for writing"
+msgstr "E212: Datei kann nicht zum Schreiben geöffnet werden"
+
+#: fileio.c:3475
+msgid "Close failed"
+msgstr "Fehler beim Schließen"
+
+#: fileio.c:3546
+msgid "write error, conversion failed"
+msgstr "Schreib-Fehler, Umwandlung schlug fehl"
+
+#: fileio.c:3552
+msgid "write error (file system full?)"
+msgstr "Schreibfehler (Dateisystem voll?)"
+
+#: fileio.c:3625
+msgid " CONVERSION ERROR"
+msgstr "KONVERTIERUNGS-FEHLER"
+
+#: fileio.c:3641
+msgid "[Device]"
+msgstr "[Ausgabegerät]"
+
+#: fileio.c:3646
+msgid "[New]"
+msgstr "[Neu]"
+
+#: fileio.c:3668
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:3668
+msgid " appended"
+msgstr " angefügt"
+
+#: fileio.c:3670
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:3670
+msgid " written"
+msgstr " geschrieben"
+
+#: fileio.c:3720
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: Original-Datei kann nicht gespeichert werden"
+
+#: fileio.c:3742
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: leere Original-Datei kann nicht verändert werden"
+
+#: fileio.c:3757
+msgid "E207: Can't delete backup file"
+msgstr "E207: Backup-Datei kann nicht gelöscht werden"
+
+#: fileio.c:3809
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ACHTUNG: Original-Datei kann verloren oder zerstört sein\n"
+
+#: fileio.c:3811
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "beende nicht den Editor bis die Datei erfolgreich geschrieben wurde!"
+
+#: fileio.c:3891
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3891
+msgid "[dos format]"
+msgstr "[dos Format]"
+
+#: fileio.c:3898
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3898
+msgid "[mac format]"
+msgstr "[mac Format]"
+
+#: fileio.c:3905
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3905
+msgid "[unix format]"
+msgstr "[unix Format]"
+
+#: fileio.c:3932
+msgid "1 line, "
+msgstr "1 Zeile, "
+
+#: fileio.c:3934
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld Zeilen, "
+
+#: fileio.c:3937
+msgid "1 character"
+msgstr "1 Zeichen"
+
+#: fileio.c:3939
+#, c-format
+msgid "%ld characters"
+msgstr "%ld Zeichen"
+
+#: fileio.c:3949
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3949
+msgid "[Incomplete last line]"
+msgstr "[Unvollständige letzte Zeile]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3968
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ACHTUNG: Die Datei wurde seit dem letzten Lesen geändert!!!"
+
+#: fileio.c:3970
+msgid "Do you really want to write to it"
+msgstr "Möchten Sie es wirklich schreiben"
+
+#: fileio.c:4933
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Fehler während des Schreibens nach \"%s\""
+
+#: fileio.c:4940
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Fehler beim Schließen von \"%s\""
+
+#: fileio.c:4943
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Fehler beim Lesen von \"%s\""
+
+#: fileio.c:5115
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell Autokommando löschte Puffer"
+
+#: fileio.c:5123
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Achtung: Datei \"%s\" ist nicht länger vorhanden"
+
+#: fileio.c:5136
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Achtung: Datei \"%s\" wurde verändert und der Puffer wurde ebenfalls in "
+"Vim verändert"
+
+#: fileio.c:5139
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr ""
+"W11: Achtung: Datei \"%s\" wurde verändert, seit mit dem Editieren "
+"angefangen wurde"
+
+#: fileio.c:5141
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W11: Achtung: Mode der Datei \"%s\" wurde verändert seit mit dem Editieren "
+"angefangen wurde"
+
+#: fileio.c:5151
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr ""
+"W13: Achtug: Datei \"%s\" wurde erstellt, nachdem mit dem Editieren begonnen "
+"wurde"
+
+#: fileio.c:5168
+msgid "Warning"
+msgstr "Warnung"
+
+#: fileio.c:5169
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Lese Datei"
+
+#: fileio.c:5248
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: \"%s\" konnte nicht neu geladen werden"
+
+#: fileio.c:5779
+msgid "--Deleted--"
+msgstr "--gelöscht--"
+
+#. the group doesn't exist
+#: fileio.c:5939
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Keine solche Gruppe: \"%s\""
+
+#: fileio.c:6064
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Unzulässiges Zeichen nach *: %s"
+
+#: fileio.c:6075
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Kein derartiges Ereignis: %s"
+
+#. Highlight title
+#: fileio.c:6224
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Kommandos ---"
+
+#: fileio.c:6495
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Auto-Kommandos können nicht für ALL Ereignisse ausgeführt werden"
+
+#: fileio.c:6518
+msgid "No matching autocommands"
+msgstr "Keine passenden Auto-Kommandos"
+
+#: fileio.c:6790
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: Auto-Kommando Schachtelung zu tief"
+
+#: fileio.c:7077
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto-Kommandos für \"%s\""
+
+#: fileio.c:7085
+#, c-format
+msgid "Executing %s"
+msgstr "Ausführung von %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7153
+#, c-format
+msgid "autocommand %s"
+msgstr "Autokommando %s"
+
+#: fileio.c:7675
+msgid "E219: Missing {."
+msgstr "E219: Es fehlt ein {."
+
+#: fileio.c:7677
+msgid "E220: Missing }."
+msgstr "E220: Es fehlt ein }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "Keine Faltung gefunden"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr ""
+"E350: Faltung kann mit der eingestellten Methode 'foldmethod' nicht erzeugt "
+"werden"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr ""
+"E351: Faltung kann mit der eingestellten Methode 'foldmethod' nicht entfernt "
+"werden"
+
+#: getchar.c:247
+msgid "E222: Add to read buffer"
+msgstr "E222: Zum Lese-Puffer Hinzufügen"
+
+#: getchar.c:2106
+msgid "E223: recursive mapping"
+msgstr "E223: rekursive Zuordnung"
+
+#: getchar.c:2948
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: Globale Abkürzung für %s existiert bereits"
+
+#: getchar.c:2951
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: Globale Zuordnung für %s existiert bereits"
+
+#: getchar.c:3078
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: Abkürzung für %s existiert bereits"
+
+#: getchar.c:3081
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: Zuordnung für %s existiert bereits"
+
+#: getchar.c:3145
+msgid "No abbreviation found"
+msgstr "Keine Abkürzung gefunden"
+
+#: getchar.c:3147
+msgid "No mapping found"
+msgstr "Keine Zuordnung gefunden"
+
+#: getchar.c:3992
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Unzulässiger Modus"
+
+#: gui.c:203
+msgid "E229: Cannot start the GUI"
+msgstr "E229: GUI kann nicht gestartet werden"
+
+#: gui.c:328
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Kann nicht von \"%s\" lesen"
+
+#: gui.c:453
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ungültig"
+
+#: gui.c:3704
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Farbe für %s kann nicht alloziert werden"
+
+#: gui.c:3989
+msgid "Error"
+msgstr "Fehler"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<kann nicht öffnen>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: Schriftart %s kann nicht erhalten werden"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: kann nicht zum laufenden Verzeichnis zurückkehren"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Pfad:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: laufendes Verzeichnis kann nicht ermittelt werden"
+
+#: gui_at_fs.c:2571 gui_motif.c:1619
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1740 gui_motif.c:1614 gui_motif.c:2835
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: Geometrie des Bildchens kann nicht ermittelt werden"
+
+#: gui_athena.c:1956 gui_motif.c:1867
+msgid "Vim dialog"
+msgstr "VIM - Dialog..."
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr ""
+"E232: BalloonEval kann nicht mit sowohl \"message\" und \"callback\" erzeugt "
+"werden"
+
+#: gui_gtk.c:1190
+msgid "Vim dialog..."
+msgstr "VIM - Dialog..."
+
+#: gui_gtk.c:1576 gui_motif.c:2754
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Suchen und Ersetzen..."
+
+#: gui_gtk.c:1581 gui_motif.c:2756
+msgid "VIM - Search..."
+msgstr "VIM - Suchen..."
+
+#: gui_gtk.c:1604 gui_motif.c:2874
+msgid "Find what:"
+msgstr "Wonach suchen:"
+
+#: gui_gtk.c:1622 gui_motif.c:2906
+msgid "Replace with:"
+msgstr "Ersetzen mit:"
+
+#. exact match only button
+#: gui_gtk.c:1654 gui_motif.c:3008
+msgid "Match exact word only"
+msgstr "Passend für einzelne Wörter"
+
+#: gui_gtk.c:1666 gui_motif.c:2976
+msgid "Direction"
+msgstr "Richtung"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1678 gui_motif.c:2988
+msgid "Up"
+msgstr "Auf"
+
+#: gui_gtk.c:1682 gui_motif.c:2996
+msgid "Down"
+msgstr "Ab"
+
+#. 'Find Next' button
+#: gui_gtk.c:1704 gui_motif.c:2778
+msgid "Find Next"
+msgstr "Suche Nächstes"
+
+#. 'Replace' button
+#: gui_gtk.c:1721 gui_motif.c:2795
+msgid "Replace"
+msgstr "Ersetzen"
+
+#. 'Replace All' button
+#: gui_gtk.c:1730 gui_motif.c:2808
+msgid "Replace All"
+msgstr "Alle Ersetzen"
+
+#: gui_gtk_x11.c:1079 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: Display kann nicht geöffnet werden"
+
+#: gui_gtk_x11.c:2494 gui_x11.c:1999
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Unbekannter Fontset: %s"
+
+#: gui_gtk_x11.c:2518
+msgid "Font Selection"
+msgstr "Auswahl der Schriftart"
+
+#: gui_gtk_x11.c:2764 gui_mac.c:2982 gui_w48.c:1197 gui_x11.c:1835
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Unbekannte Schriftart: %s"
+
+#: gui_gtk_x11.c:2775 gui_x11.c:1859
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Schriftart \"%s\" hat keine feste Breite"
+
+#: gui_gtk_x11.c:3580 ui.c:1971
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "CUT_BUFFER0 anstatt der leeren Auswahl benutzt"
+
+#: gui_motif.c:1613 gui_motif.c:1616
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1615
+msgid "Directories"
+msgstr "Verzeichnisse"
+
+#: gui_motif.c:1617
+msgid "Help"
+msgstr "Hilfe"
+
+#: gui_motif.c:1618
+msgid "Files"
+msgstr "Dateien"
+
+#: gui_motif.c:1620
+msgid "Selection"
+msgstr "Auswahl"
+
+#: gui_motif.c:2821
+msgid "Undo"
+msgstr "Rückgängig"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Zap-Schriftart '%s' kann nicht geladen werden"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Schriftart %s kann nicht verwendet werden"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Sende Nachricht zum Beenden des Kind-Prozesses.\n"
+
+#: gui_w32.c:840
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr ""
+"E243: Argument wird nicht unterstützt: \"-%s\"; verwende die OLE Version."
+
+#. TODO: May be changed this message
+#: gui_w32.c:3448 gui_w32.c:3481 gui_x11.c:3252
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Fehler -- Daten für Debugger-Symbol konnten nicht gelesen werden"
+
+#: gui_w48.c:2081
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Suche Zeichenkette (benütze '\\\\' um ein '\\' zu finden)"
+
+#: gui_w48.c:2106
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Suche & Ersetze (use '\\\\' um ein '\\' zu finden)"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: \"Colormap\"-Eintrag kann nicht alloziert werden, einige Farben "
+"können falsch sein"
+
+#: gui_x11.c:1989
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr ""
+"E250: Schriftarten für die folgenden Zeichensätze fehlen im \"fontset\" %s:"
+
+#: gui_x11.c:2032
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Fontset Name: %s"
+
+#: gui_x11.c:2033
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Schriftart '%s' hat keine feste breite"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Fontset Name: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Schriftart 0: %s\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Schriftart 1: %s\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Schriftart%d ist nicht doppelt so breit wie Schriftart0\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Schriftart0 Breite: %ld\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Schriftart1 Breite: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul-Automat Fehler"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr "Verwendung: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Datenbank hinzufügen"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "Muster suchen"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "diese Nachricht anzeigen"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Verbindung abbrechen"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Verbindungen reinitialisieren"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Verbindungen anzeigen"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Dieser cscope-Befehl unterstützt nicht Teilen des Fensters.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Verwendung: cstag <ident>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: Tag nicht gefunden"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) Fehler: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "csope Datenbank %s hinzugefügt"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s ist kein Verzeichnis oder zulässige cscope Datenbank"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "Fehler beim Lesen aus der cscope Verbindung %d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "unbekannter cscope Suchtyp"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "cscope Pipes konnten nicht angelegt werden"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection exec misslang"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen von to_fp misslang"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen von fr_fp misslang"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "keine Verbindungen zu cscope"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: keine Treffer gefunden für cscope Anfragen %s aus %s"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "cscope Befehle:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Verwendung: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "cscope Datenbank nicht doppelt hinzugefügt"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "maximale Anzahl von cscope Verbindungen erreicht"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: keine cscope Verbindung gefunden"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope Verbindung %s nicht gefunden"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope Verbindung geschlossen"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope Verbindung %s geschlossen\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "fataler Fehler in cs_manage_matches"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: Fehler beim Lesen aus der cscope Verbindung %d"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "Fehler beim allozieren\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope Tag: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # Zeile"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "Dateiname / Kontext / Zeile\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "alle cscope Datenbanken zurückgesetzt"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "keine cscope-Verbindungen\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid Datenbank Name\t führender Pfad\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <keine>\n"
+
+#: if_python.c:255 if_ruby.c:260 if_tcl.c:195 mbyte.c:2633 os_win32.c:269
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Bibliothek %s konnte nicht geladen werden"
+
+#: if_python.c:267 if_ruby.c:272 if_tcl.c:206 mbyte.c:2649 os_win32.c:281
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Bibliotheks-Funktion %s konnte nicht geladen werden"
+
+#: if_python.c:392
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Dieser Befehl ist nicht verfügbar, die Python Bibliothek konnte nicht "
+"geladen werden"
+
+#: if_python.c:592
+msgid "can't delete OutputObject attributes"
+msgstr "OutputObject-Attribute können nicht gelöscht werden"
+
+#: if_python.c:599
+msgid "softspace must be an integer"
+msgstr "\"softspace\" muss eine ganze Zahl sein"
+
+#: if_python.c:607
+msgid "invalid attribute"
+msgstr "unzulässiges Attribut"
+
+#: if_python.c:646 if_python.c:660
+msgid "writelines() requires list of strings"
+msgstr "writelines() verlangt eine Liste von Zeichenfolgen"
+
+#: if_python.c:786
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Fehler bei der Initialisierung von I/O Objekten"
+
+#: if_python.c:971 if_tcl.c:1403
+msgid "invalid expression"
+msgstr "ungültiger Ausdruck"
+
+#: if_python.c:985 if_tcl.c:1408
+msgid "expressions disabled at compile time"
+msgstr "Ausdrücke wurden zur Zeit des Übersetzens nicht zugelassen"
+
+#: if_python.c:998
+msgid "attempt to refer to deleted buffer"
+msgstr "Versuch, Bezug auf einen gelöschten Puffer zu nehmen"
+
+#: if_python.c:1013 if_python.c:1054 if_python.c:1118 if_tcl.c:1215
+msgid "line number out of range"
+msgstr "Zeilennummer außerhalb des zulässigen Bereichs"
+
+#: if_python.c:1251
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<Pufferobjekt (gelöscht) bei %8lX>"
+
+#: if_python.c:1342 if_tcl.c:837
+msgid "invalid mark name"
+msgstr "ungültiger Name einer Markierung"
+
+#: if_python.c:1617
+msgid "no such buffer"
+msgstr "kein solcher Puffer vorhanden"
+
+#: if_python.c:1705
+msgid "attempt to refer to deleted window"
+msgstr "Versuch, Bezug auf eine gelöschtes Fenster zu nehmen"
+
+#: if_python.c:1750
+msgid "readonly attribute"
+msgstr "nur-Lesen Attribut"
+
+#: if_python.c:1763
+msgid "cursor position outside buffer"
+msgstr "Cursor Position außerhalb des Puffers"
+
+#: if_python.c:1840
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<Fensterobjekt (gelöscht) bei %.8lX>"
+
+#: if_python.c:1852
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<Fensterobjekt (unbekannt) bei %.8lX>"
+
+#: if_python.c:1854
+#, c-format
+msgid "<window %d>"
+msgstr "<Fenster %d>"
+
+#: if_python.c:1930
+msgid "no such window"
+msgstr "ungültiges Fenster"
+
+#: if_python.c:2187 if_python.c:2222 if_python.c:2272 if_python.c:2335
+#: if_python.c:2455 if_python.c:2507 if_tcl.c:685 if_tcl.c:730 if_tcl.c:804
+#: if_tcl.c:874 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "Revertierungs-Information kann nicht gespeichert werden"
+
+#: if_python.c:2189 if_python.c:2279 if_python.c:2346
+msgid "cannot delete line"
+msgstr "Zeile kann nicht gelöscht werden"
+
+#: if_python.c:2224 if_python.c:2362 if_tcl.c:691 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "Zeile kann nicht ersetzt werden"
+
+#: if_python.c:2378 if_python.c:2457 if_python.c:2515
+msgid "cannot insert line"
+msgstr "Zeile kann nicht eingefügt werden"
+
+#: if_python.c:2619
+msgid "string cannot contain newlines"
+msgstr "Zeichenfolge kann keine Zeilen-wechsel enthalten"
+
+#: if_ruby.c:401
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Dieser Befehl ist nicht verfügbar, die Ruby Bibliothek konnte nicht "
+"geladen werden"
+
+#: if_ruby.c:464
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Unbekannter longjmp Status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Umschaltung zwischen Implementierung/Definition"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Zeige Basis-Klasse von"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Zeige überschriebene Mitglieds-Funktion"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Beziehe aus Datei"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Beziehe aus Projekt"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Beziehe aus allen Projekten"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Beziehe"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Zeige die Quelle von"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Finde Symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Durchsehe Klassen"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Zeige Klasse in Hierarchie"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Zeige Klasse in eingeschränkter Hierarchie"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref bezieht sich auf"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref hat Bezüge zu"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref hat ein"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref wird verwendet von"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Zeige Docu aus"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generiere Docu für"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Kann keine verbindung zu SNiFF+ aufnehemen. Prüfe die Umgebung (sniffemacs "
+"muss in $PATH) zu finden sein.\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Fehler beim Lesen. Verbindung abgebrochen"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ ist zur Zeit"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "nicht"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "verbunden"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Unbekannte SNiFF+ Anfrage: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Fehler beim Herstellen der Verbindung mit SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ist nicht verbunden"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Ist kein SNiFF+ Puffer"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Fehler beim Schreiben. Verbindung abgebrochen"
+
+#: if_tcl.c:419
+msgid "invalid buffer number"
+msgstr "ungültige Puffer-Nummer"
+
+#: if_tcl.c:465 if_tcl.c:932 if_tcl.c:1111
+msgid "not implemented yet"
+msgstr "nicht implementiert"
+
+#: if_tcl.c:502
+msgid "unknown option"
+msgstr "unbekannte Option"
+
+#. ???
+#: if_tcl.c:775
+msgid "cannot set line(s)"
+msgstr "kann keine Zeile/Zeilen setzen"
+
+#: if_tcl.c:846
+msgid "mark not set"
+msgstr "Marke nicht gesetzt"
+
+#: if_tcl.c:852 if_tcl.c:1067
+#, c-format
+msgid "row %d column %d"
+msgstr "Zeile %d Spalte %d"
+
+#: if_tcl.c:882
+msgid "cannot insert/append line"
+msgstr "kann Zeile nicht ein-/anfügen"
+
+#: if_tcl.c:1269
+msgid "unknown flag: "
+msgstr "unbekanntes Flag: "
+
+#: if_tcl.c:1339
+msgid "unknown vimOption"
+msgstr "unbekannte vim Option"
+
+#: if_tcl.c:1424
+msgid "keyboard interrupt"
+msgstr "Tastatur-Unterbrechung"
+
+#: if_tcl.c:1429
+msgid "vim error"
+msgstr "vim Fehler"
+
+#: if_tcl.c:1472
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr ""
+"Puffer/Fenster-Befehl kann nicht ausgeführt werden: das Objekt wird gelöscht"
+
+#: if_tcl.c:1546
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"kann keinen Callback-Befehl registrieren: Puffer/Fenster ist bereits gelöscht"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1563
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATALER FEHLER: reflist kaputt!? Bitte benachrichtigen Sie vim-"
+"dev@vim.org"
+
+#: if_tcl.c:1564
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"kann keinen Callback-Befehl registrieren: Puffer/Fenster-Referenz nicht "
+"gefunden"
+
+#: if_tcl.c:1725
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"Dieser Befehl ist nicht verfügbar, da die Tcl Bibliothek nicht geladen "
+"werden konnte"
+
+#: if_tcl.c:1887
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL FEHLER: Exit-Code ist nicht int!? Bitte benachrichtigen Sie vim-"
+"dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "kann Zeile nicht erhalten"
+
+#: if_xcmdsrv.c:213
+msgid "Unable to register a command server name"
+msgstr "Befehls-Server Name kann nicht registriert werden"
+
+#: if_xcmdsrv.c:434 os_mswin.c:2108
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: Kein registrierter Server-Name \"%s\""
+
+#: if_xcmdsrv.c:463
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Schicken des Befehls zum Ziel-Programm schlug fehl"
+
+#: if_xcmdsrv.c:732
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Ungültige Server-ID verwendet: %s"
+
+#: if_xcmdsrv.c:1079
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: Registry-Eigenschaft der VIM Instanz konnte nicht gelesen werden"
+
+#: if_xcmdsrv.c:1090
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: Registry-Eigenschaft der VIM Instanz ist fehlerhaft. Gelöscht!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Unbekannte Option"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Zu viele Editor Argumente"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Argument fehlt nach"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Schrott nach der Option"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Zu viele \"+command\" oder \"-c command\" Argumente"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Ungültiges Argument für"
+
+#: main.c:450
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Vim wurde nicht mit der \"diff\"-Eigenschaft übersetzt"
+
+#: main.c:875
+msgid "Attempt to open script file again: \""
+msgstr "Versuche, die Skript-Datei erneut zu öffnen: \""
+
+#: main.c:879 main.c:886 main.c:930 memline.c:3673 memline.c:3677
+#: version.c:858 version.c:863 version.c:868 version.c:873 version.c:878
+#: version.c:883 version.c:889 version.c:893 version.c:897 version.c:902
+#: version.c:909 version.c:917 version.c:923
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:884
+msgid "Cannot open for reading: \""
+msgstr "kann nicht zum Lesen geöffnet werden: \""
+
+#: main.c:928
+msgid "Cannot open for script output: \""
+msgstr "kann nicht zur Skript-Ausgabe geöffnet werden: \""
+
+#: main.c:1044
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d Dateien zur Bearbeitung\n"
+
+#: main.c:1118
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Warnung: Die Ausgabe erfolgt nicht auf einem Terminal\n"
+
+#: main.c:1120
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Warnung: Die Eingabe kommt nicht von einem Terminal\n"
+
+#. just in case..
+#: main.c:1195
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc Befehls-Zeile"
+
+#: main.c:1230
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Kann nicht von \"%s\" lesen"
+
+#: main.c:2209
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Weitere Informationen mit: \"vim -h\"\n"
+
+#: main.c:2242
+msgid "[file ..] edit specified file(s)"
+msgstr "[Datei ..] editiere die angegebenen Datei(-en)"
+
+#: main.c:2243
+msgid "- read text from stdin"
+msgstr "- lese Text von stdin"
+
+#: main.c:2244
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag editiere Datei in der der Tag definiert wurde"
+
+#: main.c:2246
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [Fehler-Datei] editiere Datei mit erstem Fehler"
+
+#: main.c:2255
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"Verwendung:"
+
+#: main.c:2258
+msgid " vim [arguments] "
+msgstr " vim [Argumente] "
+
+#: main.c:2262
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" oder:"
+
+#: main.c:2265
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumente:\n"
+
+#: main.c:2266
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tHiernach nur Datei-Namen"
+
+#: main.c:2268
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tPlatzhalter werden nicht ausgewertet"
+
+#: main.c:2271
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistriere diesen gvim in OLE"
+
+#: main.c:2272
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tDeregistriere gvim aus OLE"
+
+#: main.c:2275
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tStart als GUI (wie \"gvim\")"
+
+#: main.c:2276
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tFordergrund: Kein \"fork\" beim Start des GUI"
+
+#: main.c:2278
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi Modus (wie \"vi\")"
+
+#: main.c:2279
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx Modus (wie \"ex\")"
+
+#: main.c:2280
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tLeiser (batch) Modus (nur für \"ex\")"
+
+#: main.c:2282
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff Modus (wie \"vimdiff\")"
+
+#: main.c:2284
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tLeichter Modus (wie \"evim\", ohne Modi)"
+
+#: main.c:2285
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tModus ohne Schreibrechte (wie \"view\")"
+
+#: main.c:2286
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tEingeschränkter Modus (wie \"rvim\")"
+
+#: main.c:2287
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModifikatioen (beim Schreiben von Dateien) sind nicht erlaubt"
+
+#: main.c:2288
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tModifikatioen im Text nicht erlaubt"
+
+#: main.c:2289
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinärmodus"
+
+#: main.c:2291
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tList Modus"
+
+#: main.c:2293
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatibel zu Vi: 'compatible'"
+
+#: main.c:2294
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tNicht ganz kompatibel zu Vi: 'nocompatible'"
+
+#: main.c:2295
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose Stufe"
+
+#: main.c:2296
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tDebug Modus"
+
+#: main.c:2297
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tKeine Auslagerungs-Datei, verwende nur Speicher"
+
+#: main.c:2298
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tListe nur Auslagerungs-Dateien auf"
+
+#: main.c:2299
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (mit Dateiname)\tStelle abgestürzte Session wieder her"
+
+#: main.c:2300
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tGenauso wie z -r"
+
+#: main.c:2302
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tVerwende nicht newcli zum Öffnen eines neuen Fensters"
+
+#: main.c:2303
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tVerwende <device> for I/O"
+
+#: main.c:2306
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tStart im Hebräischen Modus"
+
+#: main.c:2309
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tStart im Farsi Modus"
+
+#: main.c:2311
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tSetze Terminal-Typ auf <terminal>"
+
+#: main.c:2312
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tBenutze <vimrc> anstatt jeglicher .vimrc"
+
+#: main.c:2314
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tBenutze <gvimrc> anstatt jeglicher .gvimrc"
+
+#: main.c:2316
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tlade keine \"plugin\"-Skripte"
+
+#: main.c:2317
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tÖffne N Fenster (Vorgabe: einzeln für jede Datei)"
+
+#: main.c:2318
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\twie -o, aber teile vertikal"
+
+#: main.c:2319
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tStarte am Ende der Datei"
+
+#: main.c:2320
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tStart in Zeile <lnum>"
+
+#: main.c:2322
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <Befehl>\tFühre <Befehl> vor dem Laden jeglicher vimrc Datei aus"
+
+#: main.c:2324
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <Befehl>\t\tFühre <Befehl> nach dem Laden der ersten Datei aus"
+
+#: main.c:2325
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\tLese Datei <session> nach dem Laden der ersten Datei"
+
+#: main.c:2326
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr ""
+"-s <scriptin>\tLese Normal-Modus Befehle aus der Skript-Datei <scriptin>"
+
+#: main.c:2327
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tBefehle am Ende der Skript-Datei <scriptout> anfügen"
+
+#: main.c:2328
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tSchreibe Befehle in die Skript-Datei <scriptout>"
+
+#: main.c:2330
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEditiere kodierte Dateien"
+
+#: main.c:2334
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tStarte vim <display>"
+
+#: main.c:2336
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tstelle keine Verbindung zum X-server her"
+
+#: main.c:2338
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÖffne Vim in einem anderen GTK widget"
+
+#: main.c:2342
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <Dateien>\tEditiere <Dateien> in einem Vim Server und beende"
+
+#: main.c:2343
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <Dateien> Wie --remote, aber warte, bis die <Dateien> "
+"editiert wurden"
+
+#: main.c:2344
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tSchicke <keys> zu einem Vim Server und beende"
+
+#: main.c:2345
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <Ausdruck>\tFühre <Ausdruck> in einem Vim Server aus und "
+"drucke das Ergebnis"
+
+#: main.c:2346
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tDrucke verfügbare Vim Server Namen und beende"
+
+#: main.c:2347
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <Name>\tBenutze den Vim server <Name>"
+
+#: main.c:2350
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tBenutze <viminfo> statt .viminfo"
+
+#: main.c:2352
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tdrucke nur Hilfe (diese Nachricht)"
+
+#: main.c:2353
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tDrucke nur Versions-Informationen"
+
+#: main.c:2357
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumente für die gvim Motif Version:\n"
+
+#: main.c:2360
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumente für die gvim Athena Version:\n"
+
+#: main.c:2363
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tStarte vim auf <display>"
+
+#: main.c:2364
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tStarte vim als Icon"
+
+#: main.c:2366
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tBenutze so als ob vim <name> hieße"
+
+#: main.c:2367
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Nicht implementiert)\n"
+
+#: main.c:2369
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr ""
+"-background <Farbe>\tBenutze <Farbe> für den Hintergrund (auch mit: -bg)"
+
+#: main.c:2370
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr ""
+"-foreground <Farbe>\tBenutze <Farbe> für den Text Vordergrund (auch mit: -fg)"
+
+#: main.c:2371 main.c:2391
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr ""
+"-font <Schriftart>\tBenutze <Schriftart> für normalen Text (auch mit: -fn)"
+
+#: main.c:2372
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <Schriftart>\tBenutze <Schriftart> für Fettschrift"
+
+#: main.c:2373
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <Schriftart>\tBenutze <Schriftart> für geneigten Text"
+
+#: main.c:2374 main.c:2392
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <geom>\tbenutze <geom> für die Anfangs Abmessungen (auch mit: -"
+"geom)"
+
+#: main.c:2375
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr ""
+"-borderwidth <Breite>\tBenutze einen Rahmen der Breite <Breite> (auch mit: -"
+"bw)"
+
+#: main.c:2376
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <Breite> Benutze eine Scrollbar der Breite <Breite> (auch "
+"mit: -sw)"
+
+#: main.c:2378
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr ""
+"-menuheight <Höhe>\tBenutze einen Menü-Balken der Höhe <Höhe> (auch mit: -mh)"
+
+#: main.c:2380 main.c:2393
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tBenutze invertierte Farben (auch mit: -rv)"
+
+#: main.c:2381
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tBenutze keine invertierten Farben (auch mit: +rv)"
+
+#: main.c:2382
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tSetze die gegebene Resource"
+
+#: main.c:2385
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumente für die gvim RISC-OS Version:\n"
+
+#: main.c:2386
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <Nummer>\tAnfangsbreite des Fensters in Spalten"
+
+#: main.c:2387
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <Nummer>\tAnfangshöhe des Fensters in Zeilen"
+
+#: main.c:2390
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumente für die gvim GTK+ Version:\n"
+
+#: main.c:2394
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tStarte vim auf <display> (auch mit: --display)"
+
+#: main.c:2396
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tZeige Gnome-Argumente"
+
+#. Failed to send, abort.
+#: main.c:2638
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Schicken des Ausdrucks schlug fehl.\n"
+
+#. Let vim start normally.
+#: main.c:2643
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Schicken schlug fehl. Versuche lokal auszuführen\n"
+
+#: main.c:2676 main.c:2697
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d von %d editiert"
+
+#: main.c:2720
+msgid "Send expression failed.\n"
+msgstr "Schicken des Ausdrucks schlug fehl.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Keine Markierungen gesetzt"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Keine Markierungen passen zu \"%s\""
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"Mark Zeile Sp Datei/Text"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" Sprung Zeile Sp Datei/Text"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Datei-Marken:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Geschichte (neueste bis älteste):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Geschichte der Markierungen innerhalb von Dateien (neueste bis älteste):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "'>' fehlt"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Ist nicht eine zulässige Code-Seite"
+
+#: mbyte.c:3107
+msgid "E284: Cannot set IC values"
+msgstr "E284: Kann die IC Werte nicht setzen"
+
+#: mbyte.c:3259
+msgid "E285: Failed to create input context"
+msgstr "E285: Eingabe-Kontext konnte nicht erzeugt werden"
+
+#: mbyte.c:3406
+msgid "E286: Failed to open input method"
+msgstr "E286: Eingabe-Methode konnte geöffnet werden"
+
+#: mbyte.c:3417
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Achtung: Destroy Callabck konnte nicht auf IM gesetzt werden"
+
+#: mbyte.c:3423
+msgid "E288: input method doesn't support any style"
+msgstr "E288: Eingabe-Methode unterstützt keinen einzigen Stil"
+
+#: mbyte.c:3480
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: Eingabe-Methode unterstützt nicht meinen Voreditier-Typen"
+
+#: mbyte.c:3554
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: der Über-dem-Punkt Stil benötigt fontset"
+
+#: mbyte.c:3582
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr ""
+"E291: Ihr GTK+ ist älter als 1.2.3. Der Status-Bereich wird abgeschaltet"
+
+#: mbyte.c:3849
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server der Eingabe-Methode läuft nicht"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: Block war nicht gesperrt"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Positionier-Fehler beim Lesen der Auslagerungs-Datei"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: Lese-Fehler in der Auslagerungs-Datei"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Positionier-Fehler beim Schreiben in die Auslagerungs-Datei"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: Fehler beim Schreiben in die Auslagerungs-Datei"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Auslagerungs-Datei ist bereits vorhanden (symlink Attacke?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Block Nr. 0 nicht erhalten?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Block Nr. 1 nicht erhalten?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Block Nr. 2 nicht erhalten?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ups, Verlust der Auslagerungs-Datei!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Auslagerungs-Datei konnte nicht umbenannt werden"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr ""
+"E303: Auslagerungs-Datei für \"%s\" konnte nicht geöffnet werden, "
+"Wiederherstellung unmöglich"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Block Nr. 0 nicht erhalten?"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Keine Auslagerungs-Datei für %s gefunden"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"Geben Sie die Nummer der Auslagerungs-Datei ein die verwendet werden soll (0 "
+"um abzubrechen): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: %s kann nicht geöffnet werden"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Block 0 kann nicht gelesen werden aus "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Vielleicht wurden keine Änderungen vorgenommen oder Vim hatte die "
+"Auslagerungs-Datei nicht aktualisiert."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " kann nicht zusammen mit dieser Vim Version verwendet werden.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Benutze Vim Version 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s sieht nicht wie eine Vim Auslagerungs-Datei aus"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " kann auf diesem Rechner nicht verwendet werden.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Die Datei wurde erstellt um "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"oder die Datei wurde zerstört."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Verwende Auslagerungs-Datei \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Original-Datei \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Warnung: Die Original-Datei könnte verändert worden sein"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Block 1 kann nicht nicht von %s gelesen werden"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???VIELE ZEILEN FEHLEN"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???ZEILEN ZÄHLER FALSCH"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???LEERER BLOCK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???ZEILEN FEHLEN"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: Block 1 ID falsch (ist %s keine .swp-Datei?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???BLOCK FEHLT"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? von hier bis ???ENDE könnten die Zeilen falsch sein"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? von hier bis ???ENDE könnten Zeilen eingefügt oder gelöscht sein"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???ENDE"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Wiederherstellung unterbrochen"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Fehler wurden festgestellt während der Wiederherstellung: suche nach "
+"Zeilen die mit ??? beginnen"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Wiederherstellung beendet. Prüfen Sie, ob alles alles OK ist."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Wollen Sie vielleicht diese Datei unter einem neuen Namen speichern\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "und \"diff\" zur Original-Datei machen, um Änderungen zu prüfen)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Löschen Sie die .swp-Datei danach.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Auslagerungs-Dateien gefunden:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " Im laufenden Verzeichnis:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Benutze gegebenen Namen:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " Im Verzeichnis "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- Nichts --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " Eigentum von: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " vom: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " vom: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [von Vim Version 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [sieht nicht wie eine Vim Auslagerungs-Datei aus]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " Dateiname: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" verändert: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "JA"
+
+#: memline.c:1524
+msgid "no"
+msgstr "nein"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" Benutzer Name: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " Host Name: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" Host Name: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" Process ID: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (läuft noch)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nicht verwendbar zusammen mit dieser Vim-Version]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nicht verwendbar auf diesem Rechner]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [kann nicht gelesen werden]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [kann nicht geöffnet werden]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Kann nicht absichern, es gibt keine Auslagerungs-Datei"
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Datei gesichert"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Absicherung fehlgeschlagen"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: unzulässige lnum: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: Zeile %ld kann nicht gefunden werden"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: Zeiger-Block id falsch 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx sollte 0 sein"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Zu viele Blocks aktualisiert?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: Zeiger Block id falsch 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "Block 1 gelöscht?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Zeile %ld kann nicht gefunden werden"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: Zeiger Block id ist falsch"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ist Null"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: Zeilennummer nicht im zulässigen Bereich: %ld nach dem Ende"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: Zeilen Zähler falsch in Block %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Stapel Größe wächst"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: Zeiger Block id falsch 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: ACHTUNG"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Auslagerungs-Datei mit folgendem Namen gefunden: \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Beim Öffnen der Datei \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " neuer als Auslagerungs-Datei!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Ein anderes Programm editiert möglicherweise diese Datei.\n"
+" Wenn dies der Fall ist, sollten Sie vorsichtig sein, damit\n"
+" es nicht zu Überschneidungen kommt.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Ende, oder Fortsetzung mit Vorsicht.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Eine Editier-Sitzung für diese Datei ist abgestürzt.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr ""
+" Wenn dies der Fall ist, so verwenden Sie \":recover\" oder \"vim -r "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" um die Änderungen wiederherzustellen (siehe \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr ""
+" Wenn dies bereits geschehen ist, löschen Sie die Auslagerungs-Datei \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" um diese Nachricht zu vermeiden.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Auslagerungs-Datei \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" ist bereits vorhanden!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - ACHTUNG"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Auslagerungs-Datei ist bereits vorhanden!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"Öffnen nur zum &Lesen\n"
+"Trotzdem &editieren\n"
+"&Wiederherstellen\n"
+"&Abbrechen"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"Öffnen nur zum &Lesen\n"
+"Trotzdem &editieren\n"
+"&Wiederherstellen\n"
+"&Abbrechen\n"
+"Ent&fernen"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Zu viele Auslagerungs-Dateien gefunden"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Teil des Menüpunkt-Pfades muss zum Untermenü führen"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Menü existiert nur in anderen Modus"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Kein Menü mit diesem Namen"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Menü-Pfad darf nicht zum Untermenü führen"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr ""
+"E331: Menü-Punkt können nicht direkt zum Menü-Balken hinzugefügt werden"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Trenner kann nicht Teil des Menü-Pfades sein"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1070
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menüs ---"
+
+#: menu.c:1987
+msgid "Tear off this menu"
+msgstr "Reiße dieses Menü ab"
+
+#: menu.c:2052
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Menü-Pfad muss zu einem Menü-Punkt führen"
+
+#: menu.c:2072
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Menü nicht gefunden: %s"
+
+#: menu.c:2141
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Menü ist für %s Modus nicht definiert"
+
+#: menu.c:2179
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Menü-Pfad muss zum Untermenü führen"
+
+#: menu.c:2200
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Menü nicht gefunden - überprüfe Menü-Namen"
+
+#: message.c:470
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Fehler beim Ausführen von \"%s\":"
+
+#: message.c:486
+#, c-format
+msgid "line %4ld:"
+msgstr "Zeile %4ld:"
+
+#: message.c:526
+msgid "[string too long]"
+msgstr "[Zeichenkette zu lang]"
+
+#: message.c:672
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Übersetzt von Johannes Zellner <johannes@zellner.org>"
+
+#: message.c:885
+msgid "Interrupt: "
+msgstr "Unterbrechung: "
+
+#: message.c:888
+msgid "Hit ENTER to continue"
+msgstr "weiter mit der EINGABETASTE"
+
+#: message.c:890
+msgid "Hit ENTER or type command to continue"
+msgstr "Drücken Sie die EINGABETASTE oder geben Sie einen Befehl ein"
+
+#: message.c:1961
+msgid "-- More --"
+msgstr "-- Mehr --"
+
+#: message.c:1964
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: Zeile, LEERZEICHEN/b: Seite, d/u: Halbe Seite, q: Ende)"
+
+#: message.c:1965
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: Zeile, LEERZEICHEN: Seite, d: Halbe Seite, q: Ende)"
+
+#: message.c:2441 message.c:2456
+msgid "Question"
+msgstr "Frage"
+
+#: message.c:2443
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ja\n"
+"&Nein"
+
+#: message.c:2458
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nein\n"
+"&Abbrechen"
+
+#: message.c:2476
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nein\n"
+"Alle &Speichern\n"
+"Alle &Verwerfen\n"
+"&Abbrechen"
+
+#: message.c:2517
+msgid "Save File dialog"
+msgstr "Datei Speichern Dialog"
+
+#: message.c:2519
+msgid "Open File dialog"
+msgstr "Datei Öffnen Dialog"
+
+#. TODO: non-GUI file selector here
+#: message.c:2590
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: kein Datei-Dialog im Konsole-Modus"
+
+#: misc1.c:2462
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Warnung: Ändern einer schreibgeschützten Datei"
+
+#: misc1.c:2691
+msgid "1 more line"
+msgstr "eine Zeile mehr"
+
+#: misc1.c:2693
+msgid "1 line less"
+msgstr "eine Zeile weniger"
+
+#: misc1.c:2698
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld Zeilen mehr"
+
+#: misc1.c:2700
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld Zeilen weniger"
+
+#: misc1.c:2703
+msgid " (Interrupted)"
+msgstr " (Unterbrochen)"
+
+#: misc1.c:6321
+msgid "Vim: preserving files...\n"
+msgstr "Vim: Sichern der Dateien...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6331
+msgid "Vim: Finished.\n"
+msgstr "Vim: Beendet.\n"
+
+#: misc2.c:666 misc2.c:682
+msgid "ERROR: "
+msgstr "FEHLER: "
+
+#: misc2.c:686
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[Bytes] gesamt alloziert-frei %lu-%lu, in Verwendung %lu, maximale "
+"Verwendung %lu\n"
+
+#: misc2.c:688
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[Aufrufe] gesamt re/malloc()s %lu, gesamt free()s %lu\n"
+"\n"
+
+#: misc2.c:743
+msgid "E340: Line is becoming too long"
+msgstr "E340: Zeile wird zu lang"
+
+#: misc2.c:787
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Interner Fehler: lalloc(%ld, )"
+
+#: misc2.c:895
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Kein Speicherplatz mehr vorhanden (%lu bytes alloziert)"
+
+#: misc2.c:2546
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Rufe Shell auf, um \"%s\" auszuführen"
+
+#: misc2.c:2745 misc2.c:5230 option.c:4636
+msgid "Missing colon"
+msgstr "fehlendes Komma"
+
+#: misc2.c:2747 misc2.c:2774
+msgid "Illegal mode"
+msgstr "Unzulässiger Modus"
+
+#: misc2.c:2813
+msgid "Illegal mouseshape"
+msgstr "Unzulässige Maus-Form"
+
+#: misc2.c:2853 misc2.c:5250
+msgid "digit expected"
+msgstr "Ziffer erwartet"
+
+#: misc2.c:2858
+msgid "Illegal percentage"
+msgstr "Unzulässige Prozentangabe"
+
+#: misc2.c:3162
+msgid "Enter encryption key: "
+msgstr "Geben Sie bitte den Schlüssel ein: "
+
+#: misc2.c:3163
+msgid "Enter same key again: "
+msgstr "Geben Sie den gleichen Schlüssel nochmals ein:"
+
+#: misc2.c:3173
+msgid "Keys don't match!"
+msgstr "Die Schlüssel stimmen nicht überein!"
+
+#: misc2.c:3712
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Ungültiger Pfad: '**[Nummer]' muss am Ende des Pfads sein, oder von "
+"'%s' gefolgt werden. Siehe :help path."
+
+#: misc2.c:4984
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Verzeichnis \"%s\" kann im 'cdpath' nicht gefunden werden"
+
+#: misc2.c:4987
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Datei \"%s\" kann im Pfad nicht gefunden werden"
+
+#: misc2.c:4993
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Kein weiteres Verzeichnis \"%s\" im 'cdpath' gefunden"
+
+#: misc2.c:4996
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Keine weitere Datei \"%s\" im Pfad gefunden"
+
+#: misc2.c:5242
+msgid "Illegal component"
+msgstr "Unzulässige Komponente"
+
+#: normal.c:2857
+msgid "Warning: terminal cannot highlight"
+msgstr "Achtung: Terminal unterstützt keine Hervorhebung"
+
+#: normal.c:3052
+msgid "E348: No string under cursor"
+msgstr "E348: Keine Zeichenkette unter dem Cursor"
+
+# Identifizierungszeichen/merkmal, Bezeichner
+#: normal.c:3054
+msgid "E349: No identifier under cursor"
+msgstr "E349: Kein Merkmal unter dem Cursor"
+
+#: normal.c:4225
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr ""
+"E352: Faltung kann mit der eingestellten Methode 'foldmethod' nicht gelöscht "
+"werden"
+
+#: ops.c:283
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "eine Zeile ein Mal %s"
+
+#: ops.c:285
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 Zeile %s %d Mal"
+
+#: ops.c:290
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld Zeilen %s ein Mal"
+
+#: ops.c:293
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld Zeilen %s %d Mal"
+
+#: ops.c:651
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld Zeilen zum Einrücken... "
+
+#: ops.c:701
+msgid "1 line indented "
+msgstr "1 Zeile eingerückt... "
+
+#: ops.c:703
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld Zeilen eingerückt... "
+
+#. must display the prompt
+#: ops.c:1546
+msgid "cannot yank; delete anyway"
+msgstr "kann nicht kopieren; lösche trotzdem"
+
+#: ops.c:2079
+msgid "1 line changed"
+msgstr "1 Zeile ~"
+
+#: ops.c:2081
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld Zeilen geändert"
+
+#: ops.c:2438
+#, c-format
+msgid "freeing %ld lines"
+msgstr "gebe %ld Zeilen frei"
+
+#: ops.c:2719
+msgid "1 line yanked"
+msgstr "Eine Zeile kopiert"
+
+#: ops.c:2721
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld Zeilen kopiert"
+
+#: ops.c:3014
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Register %s ist leer"
+
+#. Highlight title
+#: ops.c:3572
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Register ---"
+
+#: ops.c:4730
+msgid "Illegal register name"
+msgstr "Unzulässiger Register Name"
+
+#: ops.c:4816
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Register:\n"
+
+#: ops.c:4844
+#, c-format
+msgid "Unknown register type %d"
+msgstr "Unbekannter Register Typ %d"
+
+#: ops.c:5236
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Unzulässiger Register Name: '%s'"
+
+#: ops.c:5585
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Spalten; "
+
+#: ops.c:5592
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "%s%ld von %ld Zeilen; %ld von %ld Worten; %ld von %ld Bytes"
+
+#: ops.c:5608
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Spal %s von %s; Zeile %ld von %ld; Wort %ld von %ld; Byte %ld von %ld"
+
+#: ops.c:5619
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld für BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Danke für die Benutzung von Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Option nicht unterstützt"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Nicht erlaubt in einer 'modeline'"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tZuletzt gesetzt von "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Brauche Zahl nach ="
+
+#: option.c:3714 option.c:4322
+msgid "Not found in termcap"
+msgstr "Nicht gefunden in termcap"
+
+#: option.c:3780
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Unzulässiges Zeichen <%s>"
+
+#: option.c:4307 option.c:5573
+msgid "Not allowed here"
+msgstr "hier nicht erlaubt"
+
+#: option.c:4314
+msgid "Cannot set 'term' to empty string"
+msgstr "'term' kann keine leere Zeichenkette sein"
+
+#: option.c:4317
+msgid "Cannot change term in GUI"
+msgstr "'term' kann im GUI nicht verändert werden"
+
+#: option.c:4319
+msgid "Use \":gui\" to start the GUI"
+msgstr "Verwende \":gui\", um die GUI-Version zu starten"
+
+#: option.c:4340
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "'backupext' und 'patchmode' sind gleich"
+
+#: option.c:4638
+msgid "Zero length string"
+msgstr "Zeichenkette der Länge Null"
+
+#: option.c:4706
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "fehlende Zahl nach <%s>"
+
+#: option.c:4720
+msgid "Missing comma"
+msgstr "Komma fehlt"
+
+#: option.c:4727
+msgid "Must specify a ' value"
+msgstr "ein '-Wert muss angegeben werden"
+
+#: option.c:4767
+msgid "contains unprintable character"
+msgstr "enthält nicht-druckbare Zeichen"
+
+#: option.c:4800
+msgid "Invalid font(s)"
+msgstr "Ungültiger Schriftsatz"
+
+# what's the difference ?
+#: option.c:4807
+msgid "can't select fontset"
+msgstr "\"fontset\" kann nicht eingestellt werden"
+
+#: option.c:4809
+msgid "Invalid fontset"
+msgstr "Ungültiger Fontset"
+
+#: option.c:4816
+msgid "can't select wide font"
+msgstr "Weiter Schriftart kann nicht engestellt werden"
+
+#: option.c:4818
+msgid "Invalid wide font"
+msgstr "Ungültiger weiter Schriftsatz"
+
+#: option.c:5088
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Unzulässiges Zeichen nach <%c>"
+
+#: option.c:5171
+msgid "comma required"
+msgstr "Komma benötigt"
+
+#: option.c:5179
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' muß leer sein, oder %s enthalten"
+
+#: option.c:5226
+msgid "No mouse support"
+msgstr "Keine Maus-Unterstützung"
+
+# XXX
+#: option.c:5475
+msgid "Unclosed expression sequence"
+msgstr "Nicht geschlossene Ausdrucks Folge"
+
+#: option.c:5479
+msgid "too many items"
+msgstr "zu viele Punkte"
+
+#: option.c:5481
+msgid "unbalanced groups"
+msgstr "nicht ausgewogene Gruppen"
+
+#: option.c:5696
+msgid "A preview window already exists"
+msgstr "Ein Fenster zur Voransicht existiert bereits"
+
+#: option.c:5957 option.c:5986
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' kann nicht kleiner sein als 'winminheight'"
+
+#: option.c:6002 option.c:6021
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' kann nicht kleiner sein als 'winminwidth'"
+
+#: option.c:6162
+#, c-format
+msgid "Need at least %d lines"
+msgstr "mindestens %d Zeilen werden benötigt"
+
+#: option.c:6171
+#, c-format
+msgid "Need at least %d columns"
+msgstr "mindestens %d Spalten werden benötigt"
+
+#: option.c:6468
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Unbekannte Option: %s"
+
+#: option.c:6577
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Terminal Codes ---"
+
+#: option.c:6579
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Werte globaler Optionen ---"
+
+#: option.c:6581
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Werte lokaler Optionen ---"
+
+#: option.c:6583
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Optionen ---"
+
+#: option.c:7272
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp FEHLER"
+
+#: option.c:8230
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Passendes Zeichen fehlt für %s"
+
+#: option.c:8264
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Überschüssige Zeichen nach dem Semikolon: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "kann nicht öffnen"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Fenster kann nicht geöffnet werden!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Brauche Amigados Version 2.04 oder neuere\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Benötige %s Version %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Kann NIL nicht öffnen:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "Kann nicht anlegen "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim steigt aus mit %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "kann Konsolen Modus nicht wechseln ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1177 os_mswin.c:629 os_riscos.c:757 os_unix.c:2803
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Bildschirm Modus wird nicht unterstützt"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_winsize: ist keine Konsole??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Kann Shell nicht mit der -f Option aus führen"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Kann nicht ausführen "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "Shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " zurückgegeben\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE zu klein."
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O FEHLER"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(abgeschnitten)"
+
+#: os_mswin.c:604
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' beträgt nicht 80, kann externe Befehle nicht ausführen"
+
+#: os_mswin.c:716 os_unix.c:5116
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Bibliotheks-Aufruf für \"%s()\" schlug fehl"
+
+#: os_mswin.c:1365
+msgid "E237: Printer selection failed"
+msgstr "E237: Drucker-Auswahl fehlgeschlagen"
+
+#: os_mswin.c:1405
+#, c-format
+msgid "to %s on %s"
+msgstr "nach %s auf %s"
+
+#: os_mswin.c:1420
+#, c-format
+msgid "E448: Unknown font: %s"
+msgstr "E448: Unbekannte Schriftart: %s"
+
+#: os_mswin.c:1470 os_mswin.c:1480
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Fehler beim Drucken: %s"
+
+#: os_mswin.c:1481
+msgid "Unknown"
+msgstr "Unbekannt"
+
+#: os_mswin.c:1508
+#, c-format
+msgid "Printing '%s'"
+msgstr "Drucke '%s'"
+
+#: os_mswin.c:2596
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Unzulässiger Zeichensatz-Name \"%s\" im Schriftart-Namen \"%s\""
+
+#: os_mswin.c:2604
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Unzulässiges Zeichen '%c' in der Schriftart \"%s\""
+
+#: os_riscos.c:1256
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Unzulässige 'osfiletype'-Option - verwende Text"
+
+#: os_unix.c:862
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Doppel-Signal, beenden\n"
+
+#: os_unix.c:868
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Erhielt tödliches Signal %s\n"
+
+#: os_unix.c:871
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Erhielt tödliches Signal\n"
+
+#: os_unix.c:1125
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Öffnen des X-Displays dauerte %ld msec"
+
+#: os_unix.c:1152
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: ein X11 Fehler trat auf\n"
+
+#: os_unix.c:1219
+msgid "Testing the X display failed"
+msgstr "Test des X-Displays schlug fehl"
+
+#: os_unix.c:1363
+msgid "Opening the X display timed out"
+msgstr "Zeitüberschreitung während des Öffnens des X-Displays"
+
+#: os_unix.c:2976 os_unix.c:3634
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Shell kann nicht ausführt werden "
+
+#: os_unix.c:3021
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Shell sh kann nicht ausführt werden\n"
+
+#: os_unix.c:3025 os_unix.c:3640
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell beendet "
+
+#: os_unix.c:3159
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Pipes können nicht angelegt werden\n"
+
+#: os_unix.c:3174
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"'fork' schlug fehl\n"
+
+#: os_unix.c:3647
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Befehl beendet\n"
+
+#: os_unix.c:5164
+msgid "Opening the X display failed"
+msgstr "Öffnen des X-Displays schlug fehl"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "In Zeile"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Konnte vim32.dll nicht laden!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM Fehler"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Konnte Funktions-Zeiger in der DLL nicht korrigieren!"
+
+#: os_win16.c:578 os_win32.c:3037
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell gab %d zurück"
+
+#: os_win32.c:2505
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Fing Ereignis %s ein\n"
+
+#: os_win32.c:2507
+msgid "close"
+msgstr "schließe"
+
+#: os_win32.c:2509
+msgid "logoff"
+msgstr "aus-loggen"
+
+#: os_win32.c:2510
+msgid "shutdown"
+msgstr "beenden"
+
+#: os_win32.c:2991
+msgid "E371: Command not found"
+msgstr "E371: Befehl nicht gefunden"
+
+#: os_win32.c:3004
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE wurde im Pfad $PATH nicht gefunden.\n"
+"Externe Befehle werden nach Ausführung nicht anhalten.\n"
+"Siehe :help win32-vimrun für mehr Information."
+
+#: os_win32.c:3007
+msgid "Vim Warning"
+msgstr "Vim Warnung"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Zu viele %%%c im Format"
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Unerwartetes %%%c im Format"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: fehlendes ] im Format"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c wird im Format nicht unterstützt"
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Unzulässiges %%%c im Prefix des Formats"
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Unzulässiges %%%c im Format"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' enthält kein Muster"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Fehlender oder leerer Verzeichnisname"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "Keine weiteren Punkte"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d aus %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (Zeile gelöscht)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Am Anfang der quickfix Liste"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: An Ende der quickfix Liste"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "Fehlerliste %d aus %d; %d Fehler"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Kann nicht schreiben, 'buftype'-Option ist gesetzt"
+
+#: regexp.c:822
+msgid "E339: Pattern too long"
+msgstr "E339: Muster zu lang"
+
+#: regexp.c:1339
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Verschachteltes %s*"
+
+#: regexp.c:1342
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Verschachteltes %s%c"
+
+#: regexp.c:1493
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c nach Nichts"
+
+#: regexp.c:2510
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Syntax Fehler in %s{...}"
+
+#: regexp.c:2757
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Absturz verhindert; Ist der reguläre Ausdruck zu kompliziert?"
+
+#: regexp.c:2892
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: Muster erzeugte einen Stapel-Überlauf-Fehler"
+
+#: regexp.c:3128
+msgid "External submatches:\n"
+msgstr "externe 'submatches':\n"
+
+#: screen.c:2063
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld Zeilen gefaltet "
+
+#: screen.c:7535
+msgid " VREPLACE"
+msgstr " V-ERSETZEN"
+
+#: screen.c:7539
+msgid " REPLACE"
+msgstr " ERSETZEN"
+
+#: screen.c:7544
+msgid " REVERSE"
+msgstr " INVERTIERT"
+
+#: screen.c:7546
+msgid " INSERT"
+msgstr " EINFÜGEN"
+
+#: screen.c:7549
+msgid " (insert)"
+msgstr " (einfügen)"
+
+#: screen.c:7551
+msgid " (replace)"
+msgstr " (ersetzen)"
+
+#: screen.c:7553
+msgid " (vreplace)"
+msgstr " (v-ersetzen)"
+
+#: screen.c:7556
+msgid " Hebrew"
+msgstr " Hebräisch"
+
+#: screen.c:7564
+msgid " (lang)"
+msgstr " (Sprache)"
+
+# einkleben ist echt Scheiße, aber einfügen
+# gibts schon ...
+#: screen.c:7567
+msgid " (paste)"
+msgstr " (einkleben)"
+
+#: screen.c:7573
+msgid " SELECT"
+msgstr " AUSWAHL"
+
+#: screen.c:7575
+msgid " VISUAL"
+msgstr " VISUELL"
+
+#: screen.c:7577
+msgid " BLOCK"
+msgstr "ER BLOCK"
+
+#: screen.c:7579
+msgid " LINE"
+msgstr "E ZEILE"
+
+#: screen.c:7592 screen.c:7652
+msgid "recording"
+msgstr "aufzeichnen"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "Suche erreichte den ANFANG und wurde am ENDE fortgesetzt"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "Suche erreichte das ENDE und wurde am ANFANG fortgesetzt"
+
+#: search.c:455
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Unzulässiges Suchmuster: %s"
+
+#: search.c:782
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: Suche erreichte den ANFANG ohne Treffer für: %s"
+
+#: search.c:784
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: Suche erreichte das ENDE ohne Treffer für: %s"
+
+#: search.c:1157
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Erwarte '?' oder '/' nach ';'"
+
+#: search.c:3537
+msgid " (includes previously listed match)"
+msgstr " (enthält bereits vorher aufgezählte Treffer)"
+
+#. cursor at status line
+#: search.c:3557
+msgid "--- Included files "
+msgstr "--- Eingefügte Dateien "
+
+#: search.c:3559
+msgid "not found "
+msgstr "nicht gefunden "
+
+#: search.c:3560
+msgid "in path ---\n"
+msgstr "im Pfad ---\n"
+
+#: search.c:3599
+msgid " (Already listed)"
+msgstr " (Bereits aufgelistet)"
+
+#: search.c:3601
+msgid " NOT FOUND"
+msgstr " NICHT GEFUNDEN"
+
+#: search.c:3653
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Scanne eingefügte Datei: %s"
+
+#: search.c:3871
+msgid "E387: Match is on current line"
+msgstr "E387: Treffer ist auf der momentanen Zeile"
+
+#: search.c:4011
+msgid "All included files were found"
+msgstr "Alle eingefügten Dateien wurden gefunden"
+
+#: search.c:4013
+msgid "No included files"
+msgstr "Keine eingefügten Dateien"
+
+#: search.c:4029
+msgid "E388: Couldn't find definition"
+msgstr "E388: Definition konnte nicht gefunden werden"
+
+#: search.c:4031
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Muster konnte nicht gefunden werden"
+
+#: syntax.c:2999
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Unzulässiges Argument: %s"
+
+#: syntax.c:3179
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Kein solches Syntax-Cluster: %s"
+
+#: syntax.c:3343
+msgid "No Syntax items defined for this buffer"
+msgstr "Keine Syntax-Elemente definiert für diesen Puffer"
+
+#: syntax.c:3351
+msgid "syncing on C-style comments"
+msgstr "Synchronisation an C-Stil Kommentaren"
+
+#: syntax.c:3359
+msgid "no syncing"
+msgstr "keine Synchronisation"
+
+#: syntax.c:3362
+msgid "syncing starts "
+msgstr "Synchronisation beginnt "
+
+#: syntax.c:3364 syntax.c:3439
+msgid " lines before top line"
+msgstr " Zeilen vor der obersten Zeile"
+
+#: syntax.c:3369
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Syntax Synchronisations-Elemente ---"
+
+#: syntax.c:3374
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"Synchronisation an Elementen"
+
+#: syntax.c:3380
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Satzbau Elemente ---"
+
+#: syntax.c:3403
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Kein solches Syntax-Cluster: %s"
+
+#: syntax.c:3429
+msgid "minimal "
+msgstr "minimal "
+
+#: syntax.c:3436
+msgid "maximal "
+msgstr "maximal "
+
+#: syntax.c:3448
+msgid "; match "
+msgstr "; Treffer "
+
+#: syntax.c:3450
+msgid " line breaks"
+msgstr " Zeilen-Umbrüche"
+
+#: syntax.c:4078
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: \"group[t]here\" ist an dieser Stelle ungültig"
+
+#: syntax.c:4102
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: \"region\"-Element für \"%s\" konnte nicht gefunden werden"
+
+#: syntax.c:4130
+msgid "E395: contains argument not accepted here"
+msgstr "E395: \"contains\"-Argument ist an dieser Stelle ungültig"
+
+#: syntax.c:4141
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: \"containedin\"-Argument ist an dieser Stelle ungültig"
+
+#: syntax.c:4219
+msgid "E397: Filename required"
+msgstr "E397: Dateiname wird benötigt"
+
+#: syntax.c:4557
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Fehlendes '=': %s"
+
+#: syntax.c:4715
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Nicht ausreichend viele Argumente: syntax region %s"
+
+#: syntax.c:5046
+msgid "E400: No cluster specified"
+msgstr "E400: Kein Cluster angegeben"
+
+#: syntax.c:5083
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Muster Abgrenzer nicht gefunden: %s"
+
+#: syntax.c:5158
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Schrott nach Muster: %s"
+
+#: syntax.c:5245
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax sync: Zeilen Fortsetzungs Muster zweifach angegeben"
+
+#: syntax.c:5302
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Unzulässige Argumente; %s"
+
+#: syntax.c:5352
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Gleichheitszeichen fehlt: %s"
+
+#: syntax.c:5358
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Leeres Argument: %s"
+
+#: syntax.c:5385
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ist hier nicht erlaubt"
+
+#: syntax.c:5392
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr ""
+"E408: %s muss als Erstes in der Liste der enthaltenen Elemente auftreten"
+
+#: syntax.c:5462
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Unbekannter Gruppen-Name: %s"
+
+#: syntax.c:5692
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Ungültiger :syntax Befehl: %s"
+
+#: syntax.c:6071
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: Hervorhebungs-Gruppe nicht gefunden: %s"
+
+#: syntax.c:6095
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Nicht ausreichend viele Argumente: \":highlight link %s\""
+
+#: syntax.c:6102
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E412: Zu viele Argumente: \":highlight link %s\""
+
+#: syntax.c:6122
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: Gruppe hat Einstellungen, Unterstreichungs Link ignoriert"
+
+#: syntax.c:6251
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: unerwartetes Gleichheitszeichen: %s"
+
+#: syntax.c:6287
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: fehlendes Gleichheitszeichen: %s"
+
+#: syntax.c:6309
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: fehlendes Argument: %s"
+
+#: syntax.c:6346
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Unzulässiger Wert: %s"
+
+#: syntax.c:6465
+msgid "E419: FG color unknown"
+msgstr "E419: FG Farbe unbekannt"
+
+#: syntax.c:6476
+msgid "E420: BG color unknown"
+msgstr "E420: BG Farbe unbekannt"
+
+#: syntax.c:6537
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Unbekannte Farb-Bezeichnung oder -Nummer: %s"
+
+#: syntax.c:6745
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: Terminal-Code zu lang: %s"
+
+#: syntax.c:6792
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Unzulässiges Argument: %s"
+
+#: syntax.c:7321
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Zu viele verschieden Hervorhebungs-Attribute in Gebrauch"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "am Anfang der Tag-Liste"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "am Ende der Tag-Liste"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Kann nicht vor den ersten passenden Tag hinausgehen"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: Tag \"%s\" konnte nicht gefunden werden"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri verw. tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "Datei\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Gewünschte Nummer (abbrechen mit <CR>): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Es gibt nur einen passenden Tag"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Kann nicht über den letzten passenden Tag hinausgehen"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Die Datei \"%s\" existiert nicht"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "Tag %d aus %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " oder mehr"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Verwendung eines Tags mit abgewandelter Groß/Klein-Schreibung"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Die Datei \"%s\" existiert nicht"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # NACH TAG VON Zeile in Datei/Text"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Lineare Tag-Suche"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binäre Tag-Suche"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "tags file %s wird durchsucht"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag-Dateipfad wurde abgeschnitten für %s\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Format Fehler in Tag-Datei \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "vor byte %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag-Datei ist nicht sortiert: %s"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: Keine Tag-Datei"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Tag-Muster kann nicht gefunden werden"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Tag konnte nicht gefunden werden, das ist nur eine Vermutung!"
+
+#: term.c:1737
+msgid "' not known. Available builtin terminals are:"
+msgstr ""
+"' nicht bekannt. Zur Verfügung stehen die folgenden eingebauten Terminals:"
+
+#: term.c:1761
+msgid "defaulting to '"
+msgstr "Voreinstellung '"
+
+#: term.c:2114
+msgid "Cannot open termcap file"
+msgstr "termpcap-Datei kann nicht geöffnet werden"
+
+#: term.c:2117
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminal-Eintrag konnte in der terminfo-Datei nicht gefunden werden"
+
+#: term.c:2119
+msgid "Terminal entry not found in termcap"
+msgstr "Terminal-Eintrag konnte in der termcap-Datei nicht gefunden werden"
+
+#: term.c:2278
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Kein \"%s\" Eintrag in termcap"
+
+#: term.c:2752
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminal-Fähigkeit \"cm\" wird benötigt"
+
+#. Highlight title
+#: term.c:4891
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Terminal Tasten ---"
+
+#: ui.c:251
+msgid "new shell started\n"
+msgstr "neue Shell gestartet\n"
+
+#: ui.c:1747
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Fehler beim Lesen der Eingabe, Abbruch...\n"
+
+# TODO: need more work!
+#. must display the prompt
+#: undo.c:383
+msgid "No undo possible; continue anyway"
+msgstr "Rückgängigmachung nicht möglich; setze trotz dem fort"
+
+#: undo.c:538
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: Zeilennummer falsch"
+
+#: undo.c:707
+msgid "1 change"
+msgstr "1 Änderung"
+
+#: undo.c:709
+#, c-format
+msgid "%ld changes"
+msgstr "%ld Änderungen"
+
+#: undo.c:753
+msgid "E439: undo list corrupt"
+msgstr "E439: Rückgangbarkeitsliste kaputt"
+
+#: undo.c:785
+msgid "E440: undo line missing"
+msgstr "E440: Rückgangbarkeitsliste fehlt"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:691
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 Bit GUI Version"
+
+#: version.c:693
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit GUI Version"
+
+#: version.c:696
+msgid " in Win32s mode"
+msgstr " in Win32s Modus"
+
+#: version.c:698
+msgid " with OLE support"
+msgstr " mit OLE Unterstützung"
+
+#: version.c:701
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit Konsolen Version"
+
+#: version.c:705
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16 Bit Version"
+
+#: version.c:709
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 Bit MS-DOS Version"
+
+#: version.c:711
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 Bit MS-DOS Version"
+
+#: version.c:717
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) Version"
+
+#: version.c:719
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X Version"
+
+#: version.c:722
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS Version"
+
+#: version.c:727
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS Version"
+
+#: version.c:737
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Inclusive der Korrekturen: "
+
+#: version.c:763 version.c:1098
+msgid "Modified by "
+msgstr "Verändert von "
+
+#: version.c:770
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Übersetzt "
+
+#: version.c:773
+msgid "by "
+msgstr "von "
+
+#: version.c:785
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Monster Version "
+
+#: version.c:788
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Große Version "
+
+#: version.c:791
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normale Version "
+
+#: version.c:794
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Kleine Version "
+
+#: version.c:796
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Winzige Version "
+
+#: version.c:802
+msgid "without GUI."
+msgstr "ohne GUI."
+
+#: version.c:806
+msgid "with GTK-GNOME GUI."
+msgstr "mit GTK-GNOME GUI."
+
+#: version.c:808
+msgid "with GTK GUI."
+msgstr "mit GTK GUI."
+
+#: version.c:812
+msgid "with X11-Motif GUI."
+msgstr "mit X11-Motif GUI."
+
+#: version.c:815
+msgid "with X11-Athena GUI."
+msgstr "mit X11-Athena GUI."
+
+#: version.c:818
+msgid "with BeOS GUI."
+msgstr "mit BeOS GUI."
+
+#: version.c:821
+msgid "with Photon GUI."
+msgstr "mit Photon GUI."
+
+#: version.c:824
+msgid "with GUI."
+msgstr "mit GTK."
+
+#: version.c:827
+msgid "with Carbon GUI."
+msgstr "mit Carbon GUI."
+
+#: version.c:830
+msgid "with Cocoa GUI."
+msgstr "mit Cocoa GUI."
+
+#: version.c:833
+msgid "with (classic) GUI."
+msgstr "mit (klassischem) GUI."
+
+#: version.c:844
+msgid " Features included (+) or not (-):\n"
+msgstr " Ein- (+) oder ausschließlich (-) der Eigenschaften:\n"
+
+#: version.c:856
+msgid " system vimrc file: \""
+msgstr " System-vimrc-Datei: \""
+
+#: version.c:861
+msgid " user vimrc file: \""
+msgstr " Benutzer-vimrc-Datei: \""
+
+#: version.c:866
+msgid " 2nd user vimrc file: \""
+msgstr " zweite Benutzer-vimrc-Datei: \""
+
+#: version.c:871
+msgid " 3rd user vimrc file: \""
+msgstr " dritte Benutzer-vimrc-Datei: \""
+
+#: version.c:876
+msgid " user exrc file: \""
+msgstr " Benutzer-exrc-Datei: \""
+
+#: version.c:881
+msgid " 2nd user exrc file: \""
+msgstr " zweite Benutzer-vimrc-Datei: \""
+
+#: version.c:887
+msgid " system gvimrc file: \""
+msgstr " System-gvimrc-Datei: \""
+
+#: version.c:891
+msgid " user gvimrc file: \""
+msgstr " Benutzer-gvimrc-Datei: \""
+
+#: version.c:895
+msgid "2nd user gvimrc file: \""
+msgstr "zweite Benutzer-gvimrc-Datei: \""
+
+#: version.c:900
+msgid "3rd user gvimrc file: \""
+msgstr "dritte Benutzer-gvimrc-Datei: \""
+
+#: version.c:907
+msgid " system menu file: \""
+msgstr " System-Menü-Datei: \""
+
+#: version.c:915
+msgid " fall-back for $VIM: \""
+msgstr " Voreinstellung für $VIM: \""
+
+#: version.c:921
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " und für $VIMRUNTIME: \""
+
+#: version.c:925
+msgid "Compilation: "
+msgstr "Übersetzt: "
+
+#: version.c:931
+msgid "Compiler: "
+msgstr "Compiler: "
+
+#: version.c:936
+msgid "Linking: "
+msgstr "Linken: "
+
+#: version.c:941
+msgid " DEBUG BUILD"
+msgstr " DEBUG-VERSION"
+
+#: version.c:977
+msgid "VIM - Vi IMproved"
+msgstr "VIM - verbesserter Vi"
+
+#: version.c:979
+msgid "version "
+msgstr "Version "
+
+#: version.c:980
+msgid "by Bram Moolenaar et al."
+msgstr "von Bram Moolenaar und Anderen"
+
+#: version.c:984
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ist Open Source und kann frei weitergegeben werden"
+
+#: version.c:986
+msgid "Help poor children in Uganda!"
+msgstr "Helfen Sie armen Kindern in Uganda!"
+
+#: version.c:987
+msgid "type :help iccf<Enter> for information "
+msgstr "tippe :help iccf<Enter> für Informationen darüber "
+
+#: version.c:989
+msgid "type :q<Enter> to exit "
+msgstr "tippe :q<Enter> zum Beenden "
+
+#: version.c:990
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "tippe :help<Enter> oder <F1> für Online Hilfe "
+
+#: version.c:991
+msgid "type :help version6<Enter> for version info"
+msgstr "tippe :help version6<Enter> für Versions-Informationen"
+
+#: version.c:994
+msgid "Running in Vi compatible mode"
+msgstr "Vi kompatible Einstellung"
+
+#: version.c:995
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "tippe :set nocp<Enter> für Vim-Voreinstellungen "
+
+#: version.c:996
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "tippe :help cp-default<Enter> für Informationen darüber "
+
+#: version.c:1011
+msgid "menu Help->Orphans for information "
+msgstr "Menü Hilfe->Waisen für Informationen darüber "
+
+#: version.c:1013
+msgid "Running modeless, typed text is inserted"
+msgstr "Mode-freier Betrieb, getippter Text wird eingefügt"
+
+#: version.c:1014
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "Menü Editieren->Globale Einstellung->Einfüge-Modus ein- und ausschalten "
+
+#: version.c:1015
+msgid " for two modes "
+msgstr " für zwei Modi "
+
+#: version.c:1019
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "Menü Editieren->Globale Einstellung->Vi-Kompatibilität ein- und ausschalten"
+
+#: version.c:1020
+msgid " for Vim defaults "
+msgstr " für Vim Voreinstellungen "
+
+#: version.c:1066
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ACHTUNG: Windows 95/98/ME wurde erkannt"
+
+#: version.c:1069
+msgid "type :help windows95<Enter> for info on this"
+msgstr "tippe :help windows95<Enter> für Informationen darüber "
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Es gibt kein Fenster zur Voransicht"
+
+# should read: topleft / botright
+#: window.c:580
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: topleft und botright können nicht gleichzeitig verwendet werden"
+
+#: window.c:1339
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Rotieren nicht möglich wenn ein anderes Fenster geteilt ist"
+
+#: window.c:1841
+msgid "E444: Cannot close last window"
+msgstr "E444: Letztes Fenster kann nicht geschlossen werden"
+
+#: window.c:2505
+msgid "Already only one window"
+msgstr "Bereits nur ein Fenster"
+
+#: window.c:2552
+msgid "E445: Other window contains changes"
+msgstr "E445: Anderes Fenster enthält Änderungen"
+
+# Cursor: Schreibmarke Positionsmarke
+#: window.c:4379
+msgid "E446: No file name under cursor"
+msgstr "E446: Kein Dateiname unter dem Cursor"
+
+#: window.c:4498
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Datei \"%s\" kann im Pfad nicht gefunden werden"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Editiere mit &mehreren Vims"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Editiere mit einem &Vim"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Editiere mit &Vim"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Editiere mit existierendem Vim - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Editiere die ausgewählten Datei(en) mit Vim"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Fehler beim Starten des Prozesses: Ist gvim im Pfad?"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll Fehler"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Pfad-Länge zu lang!"
+
+#: globals.h:900
+msgid "--No lines in buffer--"
+msgstr "--Keine Zeilen im Puffer--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1048
+msgid "Command aborted"
+msgstr "Befehl abgebrochen"
+
+#: globals.h:1049
+msgid "Argument required"
+msgstr "Argument wird benötigt"
+
+#: globals.h:1050
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ sollte von /, ? or & gefolgt werden"
+
+#: globals.h:1052
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Ungültig im Kommando-Zeilen Fenster; <CR> führt aus, CTRL-C beendet"
+
+#: globals.h:1054
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Befehl nicht zulässig vom exrc/vimrc in der momentanen Verzeichnis- "
+"oder Tag-Suche"
+
+#: globals.h:1055
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Datei existiert bereits (erzwinge durch !)"
+
+#: globals.h:1056
+msgid "Command failed"
+msgstr "Befehl schlug fehl"
+
+#: globals.h:1057
+msgid "Internal error"
+msgstr "Interner Fehler"
+
+#: globals.h:1058
+msgid "Interrupted"
+msgstr "Unterbrochen"
+
+#: globals.h:1059
+msgid "E14: Invalid address"
+msgstr "E14: Ungültige Adresse"
+
+#: globals.h:1060
+msgid "Invalid argument"
+msgstr "Ungültiges Argument"
+
+#: globals.h:1061
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Ungültiges Argument: %s"
+
+#: globals.h:1063
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ungültiger Ausdruck: %s"
+
+#: globals.h:1065
+msgid "E16: Invalid range"
+msgstr "E16: Ungültiger Bereich"
+
+#: globals.h:1066
+msgid "Invalid command"
+msgstr "Ungültiger Befehls-Name"
+
+#: globals.h:1068
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ist ein Verzeichnis"
+
+#: globals.h:1071
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Unerwartetes Zeichen vor '='"
+
+#: globals.h:1073
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Marke hat ungültige Zeilennummer"
+
+#: globals.h:1074
+msgid "E20: Mark not set"
+msgstr "E20: Marke nicht gesetzt"
+
+#: globals.h:1075
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Kann keine Änderungen machen, 'modifiable' ist aus"
+
+#: globals.h:1076
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript-Schachtelung zu tief"
+
+#: globals.h:1077
+msgid "E23: No alternate file"
+msgstr "E23: Keine alternative Datei"
+
+#: globals.h:1078
+msgid "E24: No such abbreviation"
+msgstr "E24: Keine Abkürzung gefunden"
+
+#: globals.h:1079
+msgid "No ! allowed"
+msgstr "! nicht erlaubt"
+
+#: globals.h:1081
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr ""
+"E25: GUI kann nicht benutzt werden: wurde zum Zeitpunkt des Übersetzens "
+"nicht eingeschaltet."
+
+#: globals.h:1084
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E26: Hebräisch kann nicht benutzt werden: wurde zum Zeitpunkt des "
+"Übersetzens nicht eingeschaltet.\n"
+
+#: globals.h:1087
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E27: Farsi kann nicht benutzt werden: wurde zum Zeitpunkt des Übersetzens "
+"nicht eingeschaltet.\n"
+
+#: globals.h:1090
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Hervorhebungs-Gruppe existiert nicht: %s"
+
+#: globals.h:1092
+msgid "E29: No inserted text yet"
+msgstr "E29: Noch kein eingefügter Text"
+
+#: globals.h:1093
+msgid "E30: No previous command line"
+msgstr "E30: Keine vorherige Befehlszeile"
+
+#: globals.h:1094
+msgid "E31: No such mapping"
+msgstr "E31: Keine Zuordnung gefunden"
+
+#: globals.h:1095
+msgid "No match"
+msgstr "Kein Treffer"
+
+#: globals.h:1096
+#, c-format
+msgid "No match: %s"
+msgstr "Kein Treffer für: %s"
+
+#: globals.h:1097
+msgid "E32: No file name"
+msgstr "E32: Kein Dateiname"
+
+#: globals.h:1098
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Kein vorheriger regulärer Ersetzungs-Ausdruck"
+
+#: globals.h:1099
+msgid "E34: No previous command"
+msgstr "E34: Kein vorheriger Befehl"
+
+#: globals.h:1100
+msgid "E35: No previous regular expression"
+msgstr "E35: Keine vorheriger regulärer Ausdruck"
+
+#: globals.h:1101
+msgid "No range allowed"
+msgstr "Bereich unzulässig"
+
+#: globals.h:1103
+msgid "E36: Not enough room"
+msgstr "E36: zu wenig Platz"
+
+#: globals.h:1105
+#, c-format
+msgid "Can't create file %s"
+msgstr "Datei kann nicht erzeugt werden: %s"
+
+#: globals.h:1106
+msgid "Can't get temp file name"
+msgstr "temp-Datei kann nicht erzeugt werden"
+
+#: globals.h:1107
+#, c-format
+msgid "Can't open file %s"
+msgstr "Datei %s kann nicht geöffnet werden"
+
+#: globals.h:1108
+#, c-format
+msgid "Can't read file %s"
+msgstr "Datei %s kann nicht gelesen werden"
+
+#: globals.h:1109
+msgid "E37: No write since last change (use ! to override)"
+msgstr ""
+"E37: seit der letzten Änderung wurde nicht geschrieben (erzwinge mit !)"
+
+#: globals.h:1110
+msgid "E38: Null argument"
+msgstr "E38: Null-Argument"
+
+#: globals.h:1112
+msgid "E39: Number expected"
+msgstr "E39: Nummer erwartet"
+
+#: globals.h:1115
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Fehler-Datei %s kann nicht geöffnet werden"
+
+#: globals.h:1118
+msgid "E41: Out of memory!"
+msgstr "E41: Speicher erschöpft!"
+
+#: globals.h:1121
+msgid "Pattern not found"
+msgstr "Muster nicht gefunden"
+
+#: globals.h:1123
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Muster nicht gefunden: %s"
+
+#: globals.h:1124
+msgid "Argument must be positive"
+msgstr "Argument muss positiv sein"
+
+#: globals.h:1126
+msgid "E42: No Errors"
+msgstr "E42: Kein Fehler"
+
+#: globals.h:1128
+msgid "E43: Damaged match string"
+msgstr "E43: Beschädigter Suchausdruck"
+
+#: globals.h:1129
+msgid "E44: Corrupted regexp program"
+msgstr "E44: schadhaftes regexp Programm"
+
+#: globals.h:1130
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr ""
+"E45: Die Schreibschutz-Option 'readonly' ist gesetzt (erzwinge durch !)"
+
+#: globals.h:1132
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Variable \"%s\" kann nur gelesen werden"
+
+#: globals.h:1135
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Fehler während des Lesens der Fehler-Datei"
+
+#: globals.h:1138
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: In einer Sandbox nicht erlaubt"
+
+#: globals.h:1140
+msgid "E49: Invalid scroll size"
+msgstr "E49: Ungültige Scroll-Größe"
+
+#: globals.h:1141
+msgid "E91: 'shell' option is empty"
+msgstr "E91: Die Option 'shell' ist leer"
+
+#: globals.h:1142
+msgid "E72: Close error on swap file"
+msgstr "E72: Fehler beim Schließen der Auslagerungs-Datei"
+
+#: globals.h:1143
+msgid "E73: tag stack empty"
+msgstr "E73: tag Stapel leer."
+
+#: globals.h:1144
+msgid "E74: Command too complex"
+msgstr "E74: Befehl zu kompliziert"
+
+#: globals.h:1145
+msgid "E75: Name too long"
+msgstr "E75: Name zu lang"
+
+#: globals.h:1146
+msgid "E76: Too many ["
+msgstr "E76: zu viele ["
+
+#: globals.h:1147
+msgid "E77: Too many file names"
+msgstr "E77: zu viele Datei-Namen"
+
+#: globals.h:1148
+msgid "Trailing characters"
+msgstr "Überschüssige Zeichen"
+
+#: globals.h:1149
+msgid "E78: Unknown mark"
+msgstr "E78: Unbekannte Mark"
+
+#: globals.h:1150
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Kann \"wildcards\" nicht erweitern"
+
+#: globals.h:1151
+msgid "E80: Error while writing"
+msgstr "E80: Fehler während des Schreibens"
+
+#: globals.h:1152
+msgid "Zero count"
+msgstr "Null-Zähler"
+
+#: globals.h:1154
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> wurde nicht in einer Skript-Umgebung benutzt"
+
+#: globals.h:1157
+msgid "E449: Invalid expression received"
+msgstr "E449: ungültiger Ausdruck"
diff --git a/src/po/en_GB.po b/src/po/en_GB.po
new file mode 100644
index 000000000..152092a54
--- /dev/null
+++ b/src/po/en_GB.po
@@ -0,0 +1,48 @@
+# UK English Translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Mike Williams <mrw@eandem.co.uk>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(UK English)\n"
+"POT-Creation-Date: 2003-02-23 10:27+0000\n"
+"PO-Revision-Date: 2003-02-25 11:05+0000\n"
+"Last-Translator: Mike Williams <mrw@eandem.co.uk>\n"
+"Language-Team: Mike Williams <mrw@eandem.co.uk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO_8859-1\n"
+"Content-Transfer-Encoding: 7bit\n"
+
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Cannot find colour scheme %s"
+
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Cannot allocate colour %s"
+
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Cannot allocate colourmap entry, some colours may be incorrect"
+
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <colour>\tUse <colour> for the background (also: -bg)"
+
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <colour>\tUse <colour> for normal text (also: -fg)"
+
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Messages maintainer: Mike Williams <mrw@eandem.co.uk>"
+
+msgid "E419: FG color unknown"
+msgstr "E419: FG colour unknown"
+
+msgid "E420: BG color unknown"
+msgstr "E420: BG colour unknown"
+
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Colour name or number not recognised: %s"
diff --git a/src/po/es.po b/src/po/es.po
new file mode 100644
index 000000000..24fdec1bf
--- /dev/null
+++ b/src/po/es.po
@@ -0,0 +1,6780 @@
+# Spanish translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Eduardo F. Amatria <eferna1@platea.pntic.mec.es>, 2001.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.3a.16 (Español)\n"
+"Report-Msgid-Bugs-To: Alejandro López-Valencia <dradul@yahoo.com>\n"
+"POT-Creation-Date: 2004-05-12 18:38-0500\n"
+"PO-Revision-Date: 2004-05-12 20:34-0500\n"
+"Last-Translator: Alejandro López-Valencia <dradul@yahoo.com>\n"
+"Language-Team: Alejandro López-Valencia <dradul@yahoo.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: No se puede asignar memoria para ningún «buffer», saliendo..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: No se puede asignar memoria para el «buffer», usando otro..."
+
+#: buffer.c:805
+msgid "E515: No buffers were unloaded"
+msgstr "E515: No se descargó ningún «buffer»."
+
+#: buffer.c:807
+msgid "E516: No buffers were deleted"
+msgstr "E516: No se borró ningún «buffer»."
+
+#: buffer.c:809
+msgid "E517: No buffers were wiped out"
+msgstr "E517: No se eliminó ningún «buffer»."
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "Un «buffer» descargado."
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d «buffers» descargados."
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "Un «buffer» suprimido."
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d «buffers» suprimidos."
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "1 «buffer» eliminado."
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d «buffers» eliminados."
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: No he encontrado ningún «buffer» modificado."
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: No hay «buffers» en la lista."
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: El «buffer» %ld no existe."
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: No puedo ir más allá del último «buffer»."
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: No puedo ir más atrás del primer buffer."
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr ""
+"E89: No ha guardado el fichero desde el último cambio del «buffer» %ld "
+"(añada ! para forzar)."
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: No se puede descargar el último buffer."
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Advertencia: lista de nombres de ficheros demasiado larga."
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: No se ha encontrado el buffer %ld"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Más de una coincidencia con %s."
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: No hay un buffer que coincida con %s."
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "línea %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Ya existe un buffer con este nombre."
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [Modificado]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[Sin editar]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[Fichero nuevo]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[Errores de lectura]"
+
+#: buffer.c:2726 fileio.c:2112
+msgid "[readonly]"
+msgstr "[Sólo lectura]"
+
+#: buffer.c:2747
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 línea --%d%%--"
+
+#: buffer.c:2749
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld líneas --%d%%--"
+
+#: buffer.c:2756
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "línea %ld de %ld --%d%%-- col "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[Sin fichero]"
+
+# must be a help buffer
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "ayuda"
+
+#: buffer.c:3463 screen.c:5075
+msgid "[help]"
+msgstr "[ayuda]"
+
+#: buffer.c:3495 screen.c:5081
+msgid "[Preview]"
+msgstr "[Vista previa]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "Todo"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "Final"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "Comienzo"
+
+#: buffer.c:4523
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Lista de «buffers»:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[Lista de errores]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[Sin fichero]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Signos ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "Signos para %s"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " línea=%ld id=%d nombre=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: No puedo usar «diff» con más de %ld «buffers»."
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: No puedo crear «diffs»."
+
+#: diff.c:818
+msgid "Patch file"
+msgstr "Fichero de parches."
+
+#: diff.c:1069
+msgid "E98: Cannot read diff output"
+msgstr "E98: no puedo leer la salida de «diff»."
+
+#: diff.c:1819
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: El «buffer» actual no está en modo «diff»."
+
+#: diff.c:1831
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Ningún otro «buffer» está en modo «diff»."
+
+#: diff.c:1839
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Más de dos «buffers» en modo «diff», no se cual usar."
+
+#: diff.c:1862
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: No puedo encontrar el «buffer» «%s»."
+
+#: diff.c:1868
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: El «buffer» «%s» no está en modo «diff»."
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: El código de escape no se permite en un dígrafo."
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: No encontré el fichero «keymap»."
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: «:loadkeymap» en un fichero que no contiene instrucciones ejecutables."
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Completar palabra clave (^N^P)."
+
+# ctrl_x_mode == 0, ^P/^N compl.
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " modo ^X (^E^Y^L^]^F^I^K^D^V^N^P)."
+
+# Scroll has it's own msgs, in it's place there is the msg for local
+# * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Completar palabra clave local (^N^P)."
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Completar toda la línea (^L^N^P)."
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Completar nombre de fichero (^F^N^P)."
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Completar «tag» (^]^N^P)."
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Completar patrón de ruta (^N^P)."
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Completar definición (^D^N^P)."
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Completar diccionario (^K^N^P)."
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Completar diccionario de sinónimos (^T^N^P)."
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Completar línea de comandos (^V^N^P)."
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "He llegado al final del párrafo."
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "La opción «thesaurus» está vacía."
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "La opción «dictionary» está vacía."
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Buscando en el diccionario: %s."
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insertar) «Scroll» (^E/^Y)."
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (reemplazar) «Scroll» (^E/^Y)."
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Buscando: %s."
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "Buscando «tags»."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr "Añadiendo."
+
+# showmode might reset the internal line pointers, so it must
+# * be called before line = ml_get(), or when this address is no
+# * longer needed. -- Acevedo.
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Buscando..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "De vuelta al original."
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Palabra de otra línea."
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "La única coincidencia."
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "coincidencia %d de %d."
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "coincidencia %d."
+
+# Skip further arguments but do continue to
+# * search for a trailing command.
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Variable desconocida: «%s»."
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Faltan llaves: %s."
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: No existe tal variable: «%s»."
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Falta «:» después de «?»."
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Falta un «)»."
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Falta un «]»."
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Falta el nombre de la opción: %s."
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Opción desconocida: %s."
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Faltan comillas: %s."
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Faltan comillas: %s."
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Argumentos no válidos para la función %s."
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Función desconocida: %s."
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Demasiados argumentos para la función: %s."
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Argumentos insuficientes para la función: %s."
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Usando <SID> en un contexto que no es de «script»: %s."
+
+# * Yes this is ugly, I don't particularly like it either. But doing it
+# * this way has the compelling advantage that translations need not to
+# * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4382 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld líneas: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&Aceptar\n"
+"&Cancelar"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "He llamado a «inputrestore()» más veces que a «inputsave()»."
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: Hay demasiados enlaces symbólicos (¿referencia circular?)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Sin conexión al servidor Vim."
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Incapaz de leer una respuesta del servidor."
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: Incapaz de enviar al cliente."
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Incapaz de enviar a %s."
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(No válido)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Variable sin definir: %s."
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E244: ¡Nombre ilegal para una variable! %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E226: La función %s ya existe, añada «!» para reemplazarla."
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Función sin definir: %s."
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Falta «(»: %s."
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Argumento ilegal: %s."
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: Falta «:endfunction»."
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: No se puede redefinir la función %s: está en uso."
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: Se requiere el nombre de la función."
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: El nombre de la función debe empezar con mayúscula: %s."
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Función sin definir: %s."
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: No se puede eliminar la función %s: está en uso."
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr ""
+"E132: La profundidad de la llamada a la función es mayor que «maxfuncdepth»."
+
+# always scroll up, don't overwrite
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "Llamando a %s."
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "He abortado a %s."
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s devuelve #%ld."
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s devuelve «%s»."
+
+# always scroll up, don't overwrite
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "continuando en %s."
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: «:return» no está dentro de una función."
+
+#: eval.c:9952
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# variables globales:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Octal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Octal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Octal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Moviendo líneas sobre sí mismas."
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 línea movida."
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld líneas movidas."
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld líneas filtradas."
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filtro* Los autocomandos no deben cambiar el «buffer» en curso."
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[No se ha escrito al disco nada desde el último cambio]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s en la línea: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Hay demasiados errores, omitiendo el resto del fichero."
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Leyendo el fichero «viminfo» «%s»%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " info"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " marcas"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " FALLÓ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: No hay permiso de escritura para el fichero viminfo: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: ¡No puedo escribir el fichero viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Escribiendo fichero viminfo «%s»"
+
+# Write the info:
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Este fichero viminfo fue generado por Vim %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Usted puede editarlo, ¡solo si tiene cuidado!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Valor de «encoding» cuando se escribió este fichero\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Carácter de comienzo ilegal"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "Guardar como"
+
+# Overwriting a file that is loaded in another buffer is not a
+# * good idea.
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: El fichero está cargado en otro «buffer»."
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "¿Escribir un fichero parcial?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Use ! para escribir un «buffer» parcial."
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "¿Escribir sobre el fichero existente «%.*s»?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: No existe un nombre de fichero para el «buffer» %ld"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr ""
+"E142: No se ha escrito el fichero: escritura desactivada por la opción "
+"«write»."
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Se ha activado la opción «readonly» para «%.*s».\n"
+"¿Quiere escribirlo de todas formas?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "Editar fichero"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr ""
+"E143: Los autocomandos han eliminado inesperadamente el nuevo «buffer» %s"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: Argumento no numérico para «:z»."
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Rvim no permite acceso al procesador de comandos."
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Las expresiones regulares no se pueden delimitar con letras."
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "¿Reemplazar con %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4270
+msgid "(Interrupted) "
+msgstr "(Interrumpido)"
+
+#: ex_cmds.c:4274
+msgid "1 substitution"
+msgstr "1 sustitución"
+
+#: ex_cmds.c:4276
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld sustituciones"
+
+#: ex_cmds.c:4279
+msgid " on 1 line"
+msgstr " en 1 línea"
+
+#: ex_cmds.c:4281
+#, c-format
+msgid " on %ld lines"
+msgstr " en %ld líneas"
+
+#: ex_cmds.c:4332
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: «:global» no puede ser recursivo."
+
+#: ex_cmds.c:4367
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Falta una expresión regular en el comando global."
+
+#: ex_cmds.c:4416
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Patrón encontrado en cada línea: %s"
+
+#: ex_cmds.c:4497
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Última cadena de sustitución:\n"
+"$"
+
+#: ex_cmds.c:4598
+msgid "E478: Don't panic!"
+msgstr "E478: ¡No entre en pánico!"
+
+#: ex_cmds.c:4650
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E149: Lo siento, no hay ayuda «%s» para %s."
+
+#: ex_cmds.c:4653
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Lo siento, no hay ayuda para %s"
+
+#: ex_cmds.c:4687
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Lo siento, no encuentro el fichero de ayuda «%s»."
+
+#: ex_cmds.c:5170
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: No es un directorio: %s"
+
+#: ex_cmds.c:5309
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: No se puede abrir %s para escritura."
+
+#: ex_cmds.c:5345
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Incapaz de abrir %s para lectura"
+
+#: ex_cmds.c:5367
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr ""
+"E670: Mezcla de codificaciones de ficheros de ayuda dentro de un lenguaje: %s"
+
+#: ex_cmds.c:5445
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Tag «%s» duplicada en el fichero %s"
+
+#: ex_cmds.c:5557
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Comando desconocido de signo: %s"
+
+#: ex_cmds.c:5577
+msgid "E156: Missing sign name"
+msgstr "E156: Falta el nombre del signo."
+
+#: ex_cmds.c:5623
+msgid "E612: Too many signs defined"
+msgstr "E612: Demasiados signos definidos."
+
+#: ex_cmds.c:5691
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Texto de signo no válido: %s"
+
+#: ex_cmds.c:5722 ex_cmds.c:5913
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Signo desconocida: %s"
+
+#: ex_cmds.c:5771
+msgid "E159: Missing sign number"
+msgstr "E159: Falta el número del signo."
+
+#: ex_cmds.c:5853
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E159: El nombre del «buffer» no es válido: %s"
+
+#: ex_cmds.c:5892
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: El id del signo no es válido: %ld"
+
+#: ex_cmds.c:5962
+msgid " (NOT FOUND)"
+msgstr " (NO ENCONTRADO)"
+
+#: ex_cmds.c:5964
+msgid " (not supported)"
+msgstr " (no hay apoyo para la función pedida)"
+
+#: ex_cmds.c:6063
+msgid "[Deleted]"
+msgstr "[Suprimido]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Entrando al modo de depuración. Oprima \"cont\" para continuar."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "línea %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "«Breakpoint» en «%s%s» línea %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: No se ha encontrado el «breakpoint»: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "No hay «breakpoints» definidos."
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s línea %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "¿Guardar los cambios en «%.*s»?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9378
+msgid "Untitled"
+msgstr "Sin título"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: No se ha grabado nada desde el último cambio en el buffer «%s»"
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Advertencia: se ha entrado en otro «buffer» en forma inesperada (verifique "
+"los autocomandos)."
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Hay sólo un fichero que editar."
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: No se puede ir antes del primer fichero."
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: No se puede ir más allá del último fichero."
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: El compilador no tiene apoyo en esta versión: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Buscando «%s» en «%s»."
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Buscando «%s»."
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "No se ha encontrado en «runtimepath»: «%s»"
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "Ejecute script de Vim."
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "No se puede ejecutar un directorio: «%s»."
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "No se pudo ejecutar «%s»."
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "línea %ld: no se pudo ejecutar «%s»."
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "ejecutando «%s»."
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "línea %ld: ejecutando «%s»."
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "La ejecución de «%s» ha terminado."
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Advertencia: separador de línea equivocado, puede que falte ^M"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: Ha usado «:scriptencoding» fuera de un fichero de instrucciones ejecutables."
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: Ha usado «:finish» fuera de un fichero de instrucciones ejecutables."
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "Página %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "No hay texto que imprimir."
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Imprimiendo la página %d (%d%%)."
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr "Copia %d de %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "Impreso: %s."
+
+#: ex_cmds2.c:3549
+msgid "Printing aborted"
+msgstr "Impresión abortada."
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Error escribiendo al fichero PostScript de salida."
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E456: No se puede abrir el fichero «%s»."
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: No se puede leer el fichero de recursos de PostScript «%s»."
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: El fichero \"%s\" no es un fichero de recursos PostScript."
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: El fichero «%s» no es un recurso PostScript que pueda usar."
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: El fichero de recursos «%s» tiene la versión equivocada."
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: No puedo abrir el fichero PostScript de salida."
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: No puedo abrir el fichero «%s»."
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr ""
+"E456: No encuentro el fichero de recursos PostScript «prolog.ps»."
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: No hallo el fichero de recursos PostScript «%s.ps»."
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: No puedo convertir de «multi-byte» a la codificación \"%s\"."
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "Envíando a la impresora..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: No pude imprimir el fichero PostScript."
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "Tarea de impresión envíada."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Idioma actual «%s»: «%s»."
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: No se puede establecer la opción del idioma a «%s»."
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Entrando al modo Ex. Escriba «visual» para ir al modo Normal."
+
+# must be at EOF
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Estoy al final del fichero."
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: El comando recurre excesivamente."
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: La excepción %s no se atrapó."
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "Fin del fichero de instrcucciones ejecutables."
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "Fin de la función."
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Uso ambiguo de un comando definido por el usuario."
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E371: No es un comando del editor."
+
+#: ex_docmd.c:2028
+msgid "E493: Backwards range given"
+msgstr "E493: Me ha dado un rango invertido."
+
+#: ex_docmd.c:2037
+msgid "Backwards range given, OK to swap"
+msgstr "Me ha dado un rango invertido, ¿está bien intercambiarlo?"
+
+#: ex_docmd.c:2160
+msgid "E494: Use w or w>>"
+msgstr "E494: Use «w» o «w>>»."
+
+#: ex_docmd.c:3786
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Lo siento, el comando no está disponible en esta versión."
+
+#: ex_docmd.c:3989
+msgid "E172: Only one file name allowed"
+msgstr "E172: Sólo se permite un nombre de fichero."
+
+#: ex_docmd.c:4569
+msgid "1 more file to edit. Quit anyway?"
+msgstr "Un fichero más para editar. ¿Termino de todas formas?"
+
+#: ex_docmd.c:4572
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Hay %d ficheros más en edición. ¿Termino de todas formas?"
+
+#: ex_docmd.c:4579
+msgid "E173: 1 more file to edit"
+msgstr "E173: Un fichero más para editar."
+
+#: ex_docmd.c:4581
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Hay %ld ficheros en edición."
+
+#: ex_docmd.c:4676
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: El comando ya existe. Añada «!» para reemplazarlo."
+
+#: ex_docmd.c:4787
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Nombre Args Rango Completar Definición"
+
+#: ex_docmd.c:4876
+msgid "No user-defined commands found"
+msgstr "No se han encontrado comandos definidos por el usuario"
+
+#: ex_docmd.c:4908
+msgid "E175: No attribute specified"
+msgstr "E175: No se ha especificado el atributo."
+
+#: ex_docmd.c:4960
+msgid "E176: Invalid number of arguments"
+msgstr "E176: El número de argumentos no es válido."
+
+#: ex_docmd.c:4975
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: El recuento no se puede especificar dos veces."
+
+#: ex_docmd.c:4985
+msgid "E178: Invalid default value for count"
+msgstr "E178: El valor predeterminado para el recuento no es válido."
+
+#: ex_docmd.c:5016
+msgid "E179: argument required for complete"
+msgstr "E179: se necesita un argumento para completar."
+
+#: ex_docmd.c:5048
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: El valor para completar no es válido: %s."
+
+#: ex_docmd.c:5057
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr ""
+"E468: El argumento de finalización solo se permite en finalizaciones "
+"definidas por el usuario."
+
+#: ex_docmd.c:5063
+msgid "E467: Custom completion requires a function argument"
+msgstr ""
+"E467: Las finalizatines definidad por el usuario requieren de un argumento "
+"de función."
+
+#: ex_docmd.c:5074
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: El atributo no es válido: %s"
+
+#: ex_docmd.c:5117
+msgid "E182: Invalid command name"
+msgstr "E182: El nombre de comando no es válido."
+
+#: ex_docmd.c:5132
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr ""
+"E183: Los comandos definidos por el usuario deben comenzar con una letra "
+"mayúscula."
+
+#: ex_docmd.c:5203
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: No existe tal comando definido por el usuario: %s"
+
+#: ex_docmd.c:5664
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: No se puede encontrar el esquema de colores %s"
+
+#: ex_docmd.c:5672
+msgid "Greetings, Vim user!"
+msgstr "¡Saludos, usuario de Vim!"
+
+#: ex_docmd.c:6389
+msgid "Edit File in new window"
+msgstr "Editar fichero en una ventana nueva"
+
+#: ex_docmd.c:6684
+msgid "No swap file"
+msgstr "No hay fichero de intercambio"
+
+#: ex_docmd.c:6788
+msgid "Append File"
+msgstr "Añadir fichero"
+
+#: ex_docmd.c:6852
+msgid "E186: No previous directory"
+msgstr "E186: No hay directorio previo."
+
+#: ex_docmd.c:6934
+msgid "E187: Unknown"
+msgstr "E187: Desconocido."
+
+#: ex_docmd.c:7019
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: «:winsize» requiere de dos argumentos numéricos."
+
+#: ex_docmd.c:7075
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Posición de la ventana: X %d, Y %d"
+
+#: ex_docmd.c:7080
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: La obtención de la posición de la ventana no está implementada en esta "
+"plataforma."
+
+#: ex_docmd.c:7090
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: «:winpos» require de dos argumentos numéricos."
+
+#: ex_docmd.c:7368
+msgid "Save Redirection"
+msgstr "Guardar redirección."
+
+#: ex_docmd.c:7558
+msgid "Save View"
+msgstr "Guardar vista"
+
+#: ex_docmd.c:7559
+msgid "Save Session"
+msgstr "Guardar sesión"
+
+#: ex_docmd.c:7561
+msgid "Save Setup"
+msgstr "Guardar configuración"
+
+#: ex_docmd.c:7713
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ya existe (añada ! para sobreescribir.)"
+
+#: ex_docmd.c:7718
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: No se puede abrir «%s» para escritura"
+
+# set mark
+#. set mark
+#: ex_docmd.c:7742
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr ""
+"E191: El argumento debe ser una letra o un apóstrofo/apóstrofo invertido"
+
+#: ex_docmd.c:7784
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Uso recursivo demasiado profundo de «:normal»."
+
+#: ex_docmd.c:8302
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: No hay un nombre de fichero alternativo que sustituya a «#»."
+
+#: ex_docmd.c:8333
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr ""
+"E495: No ha dado un nombre de fichero de autocomandos para sustituir a "
+"\"<afile>\""
+
+#: ex_docmd.c:8341
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr ""
+"E496: No existe un «buffer» de autocomando para sustituir por \"<abuf>\""
+
+#: ex_docmd.c:8352
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"E497: Ningún nombre de autocomando concuerda para sustituir «<amatch>»."
+
+#: ex_docmd.c:8362
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr ""
+"E498: No hay un nombre de fichero «:source» que sustituya a \"<sfile>\"."
+
+#: ex_docmd.c:8403
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Un nombre de fichero vacio solo funciona con \":p:h\"."
+
+#: ex_docmd.c:8405
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: La expresión evalua a un «string» vacio."
+
+#: ex_docmd.c:9360
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: No se puede abrir el fichero «viminfo» para lectura."
+
+#: ex_docmd.c:9533
+msgid "E196: No digraphs in this version"
+msgstr "E196: No hay dígrafos en esta versión."
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr ""
+"E608: No puedo lanzar (':throw') excepciones si tienen el prefijo 'Vim'."
+
+# always scroll up, don't overwrite
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "He encontrado una excepción: %s."
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Exepción finalizada: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "He descartado una excepción: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, en la línea %ld."
+
+# always scroll up, don't overwrite
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Exception atrapada: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "He puesto a %s en la lista de pendientes."
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "He resumido a %s."
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "He descartado a %s."
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Exepción."
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "Error e interrupción"
+
+#: ex_eval.c:754 gui.c:4381
+msgid "Error"
+msgstr "Error"
+
+# if (pending & CSTP_INTERRUPT)
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Interrupción"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: Anidamineot de «:if» demasiado profundo."
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: ¡:endif sin un :if!"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else sin un :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif sin un :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: «:else» múltiple."
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif después de :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: ¡«:while» se anida muy profundamente!"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue sin un :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break sin :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E218: ¡«:try» se anida muy profundamente!"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch sin un :try"
+
+# Give up for a ":catch" after ":finally" and ignore it.
+# * Just parse.
+# Give up for a ":catch" after ":finally" and ignore it.
+# * Just parse.
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch después de :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally sin un :try"
+
+# Give up for a multiple ":finally" and ignore it.
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: ¡«:finally» múltiple!"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry sin un :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: «:endfunction» no está dentro de una función."
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "Nombre del «tag»"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " tipo de fichero\n"
+
+#: ex_getln.c:4752
+msgid "'history' option is zero"
+msgstr "La opción 'history' es cero."
+
+#: ex_getln.c:5023
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historia de «%s» (de lo más nuevo a lo más antiguo):\n"
+
+#: ex_getln.c:5024
+msgid "Command Line"
+msgstr "Línea de comandos"
+
+#: ex_getln.c:5025
+msgid "Search String"
+msgstr "Cadena de búsqueda"
+
+#: ex_getln.c:5026
+msgid "Expression"
+msgstr "Expresión"
+
+#: ex_getln.c:5027
+msgid "Input Line"
+msgstr "Línea de entrada"
+
+#: ex_getln.c:5065
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: «cmd_pchar» más allá de la longitud del comando."
+
+#: ex_getln.c:5242
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Se ha suprimido la ventana o el buffer activos."
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "Nombre de fichero ilegal"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "es un directorio"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "no es un fichero"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[Fichero nuevo]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[Permiso negado]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Los autocomandos «*ReadPre» hicieron ilegible al fichero."
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Los autocomandos «*ReadPre» no deben cambiar el buffer en curso."
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: leyendo la entrada estándar...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "Leyendo la entrada estándar..."
+
+# Re-opening the original file failed!
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ¡La conversión ha hecho el fichero ilegible!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[Falta un CR]"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[Se ha encontrado un NL]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[he partido las líneas largas]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[NO convertido]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[convertido]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[encriptado]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[ERROR DE CONVERSIÓN]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[BYTE ILEGAL en la línea %ld]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[ERRORES DE LECTURA]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "No se puede encontrar el fichero temporal para la conversión."
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "La conversión con '«charconvert»' ha fallado."
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "No puedo leer la salida de «charconvert»."
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Los autocomandos fueron suprimidos o el «buffer» se descargó para ser "
+"grabado en disco."
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr ""
+"E204: El autocomando ha cambiado el número de líneas en forma inesperada."
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans no permite que se escriba sobre «buffers» sin modificar."
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "No se permite la escritura parcial de los «buffers» de NetBeans."
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "no es un fichero o dispositivo en el que se pueda escribir."
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "Es de solo lectura (añada ! para obreescribir)."
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr ""
+"E506: No puedo escribir al fichero de respaldo (añada ! para forzar el "
+"comando)."
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr ""
+"E507: Error al cerrar el fichero de la copia de respaldo (añada ! para "
+"forzar el comando)."
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr ""
+"E508: No puedo leer el fichero para crear la copia de respaldo (añada ! para "
+"forzar el comando)."
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr ""
+"E509: No puedo crear el fichero para la copia de respaldo (añada ! para "
+"forzar el comando)."
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr ""
+"E510: No puedo hacer un fichero de copia de respaldo (añada ! para forzar el "
+"comando)."
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr ""
+"E460: Se perdería el segmento («fork») de recursos! (añada ! para forzar el "
+"comando)."
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: No puedo encontrar el fichero temporal para escribir en él."
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr ""
+"E213: No puedo convertirlo (añada ! para escribir el fichero sin conversión)."
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: No puedo abrir el fichero enlazado para escribir en él."
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: No puedo abrir el fichero para escribir en él."
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: falló «fsync»"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E314: Falló el cierre del fichero."
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: Error de escritura, la conversión falló."
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: Error de escritura (¿Sistema de ficheros lleno?"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr "ERROR DE CONVERSIÓN"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[Dispositivo]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[Nuevo]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " añadido"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " escritos"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Modo «patch»: no se puede guardar el fichero original."
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Modo «patch»: no se puede tocar el fichero original vacío."
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: No se puede borrar el fichero de respaldo."
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"AVISO: el fichero original puede haberse perdido o haberse dañado\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "¡no salga del editor hasta que el fichero se haya escrito!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[DOS]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[formato DOS]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[Mac]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[formato Mac]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[UNIX]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[formato UNIX]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 línea, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld líneas, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 carácter"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "%ld caracteres"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[no hay fin de línea]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[Última línea incompleta]"
+
+# don't overwrite messages here
+# must give this prompt
+# don't use emsg() here, don't want to flush the buffers
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ADVERTENCIA: ¡¡¡El fichero ha cambiado desde que se leyó!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "¿Quiere realmente escribir a él?"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Error al escribir a «%s»."
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Error al cerrar «%s»."
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Error al leer «%s»."
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: el autocomando «FileChangedShell» ha borrado el buffer."
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Advertencia: el fichero «%s» ya no está disponible"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Advertencia: el fichero «%s» ha cambiado y el buffer fue cambiado "
+"también en Vim."
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr ""
+"W11: Advertencia: el fichero «%s» ha cambiado desde que comenzó la edición."
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: Advertencia: el modo del fichero «%s» ha cambiado desde que comenzó la "
+"edición."
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr ""
+"W13: Advertencia: el fichero «%s» ha sido creado después de comenzar la "
+"edición."
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "Vea «:help w11» para más información."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "Advertencia"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Cargar fichero"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: No pude prepararme para recargar a \"%s\"."
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: No se pudo recargar «%s»."
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--Suprimido--"
+
+# the group doesn't exist
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: No existe el grupo: «%s»."
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Carácter ilegal después de *: «%s»."
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: No existe tal hecho: «%s»"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: No existe tal grupo o evento: %s"
+
+# Highlight title
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-comandos ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr ""
+"E217: No se pueden ejecutar los autocomandos para TODOS los eventos de "
+"ejecución."
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "Ningún autocomando coincide."
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: El autocomando se anida en demasiados bucles."
+
+#: fileio.c:8088
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto comandos para «%s»"
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "Ejecutando %s"
+
+# always scroll up, don't overwrite
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "autocomando %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: Falta un {."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: Falta un }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: No encontré ningún pliegue."
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: No puedo crear el pliegue con el 'folmethod' activo."
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: No puedo borrar el pliegue con el 'foldmethod' activo."
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Añadir al «buffer» de lectura"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: asociación recursiva"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: ya existe una abreviatura global para «%s»."
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: ya existe una asociación global para «%s»."
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: ya existe una abreviatura para «%s»."
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: ya existe una asociación para «%s»."
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "No encontré ninguna abreviatura."
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "No encontré ninguna asociación."
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: «makemap»: modo ilegal."
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: No se puede iniciar la interface gráfica («GUI»)."
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: No puedo leer a «%s»."
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr ""
+"E665: No puedo inicial la interfase gráfica (GUI), no encontré ninguna "
+"fuente de impresión válida."
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: El valor de «guifontwide» no es válido."
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: El valor de «imactivatekey» no es válido."
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: No se puede asignar el color «%s»."
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<no puedo abrirlo>"
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: «vim_SelFile»: No puedo hallar la fuente de impresión %s."
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: «vim_SelFile»: no puedo regresar al directorio actual."
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Nombre de la ruta:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr ""
+"E615: v«vim_SelFile»: No puedo obtener la localización del directorio actual."
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: No pude obtener la geometría del «pixmap» miniatura."
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Diálogo de Vim"
+
+#: gui_beval.c:101 gui_w32.c:3945
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr ""
+"E232: No puedo crear un «BalloonEval» que contenga tanto el mensaje como el "
+"«callback»."
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Diálogo de Vim..."
+
+#: gui_gtk.c:2060 message.c:2999
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Si\n"
+"&No\n"
+"&Cancelar"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "Métodos de Entrada («Input_Methods»)"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Buscar y reemplazar..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Buscar..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "¿Encontrar qué?:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Reemplazar con:"
+
+# whole word only button
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Encontrar solo palabras completas."
+
+# match case button
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "La única coincidencia"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Dirección"
+
+# 'Up' and 'Down' buttons
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "Hacia arriba"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "Hacia abajo"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Encontrar siguiente"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Reemplazar"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Reemplazar todos"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Recibí una solicitud \"die\" del administrador de sesiones.\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: La ventana principal fue destruida inesperadamente.\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Selección de tipos de letra"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Se ha usado «CUT_BUFFER0» en vez de una selección vacía."
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtro"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Directorios"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Ayuda"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Ficheros"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Selección"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Deshacer"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: No puedo cargar la fuente de impresión Zap '%s'."
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: No puedo usar la fuente de impresión %s."
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Enviando mensaje para terminar los procesos dependientes («hijo»).\n"
+
+#: gui_w32.c:834
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argumento no admitido: «-%s»; use la versión OLE."
+
+#: gui_w48.c:2147
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Buscar cadena (use «\\\\» para encontrar un «\\»)"
+
+#: gui_w48.c:2172
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Buscar y reemplazar (use «\\\\» para encontra una «\\»)"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: no se puede asignar una entrada al mapa de colores; algunos "
+"colores tal vez no sean correctos."
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr ""
+"E250: Faltan las fuentes de impresión para los siguientes conjuntos de "
+"caracteres en el conjunto de fuentes «%s»:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nombre del conjunto de fuentes de impresión: «%s»"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "La fuente de impresión «%s» no es de ancho fijo."
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nombre del conjunto de fuentes de impresión: «%s»\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Fuente de impresión 0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Fuente de impresión 1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%ld width is not twice that of font0\n"
+msgstr ""
+"La anchura de la fuente de impresión %ld no es el doble de la de la fuente "
+"de impresión 0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Anchura de la fuente de impresión 0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Anchura de la fuente de impresión 1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ERROR del autómata Hangul."
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Añadir una nueva base de datos."
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Petición de un patrón."
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Mostrar este mensaje."
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Matar una conexión."
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Reiniciar todas las conexiones."
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Mostrar las conexiones."
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Forma de uso: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Este comando «cscope» no admite la división de la ventana.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Forma de uso: cstag <identificador>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: «tag» no encontrado."
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: Error en stat(%s): %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: error en la función «stat()»."
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s no es un directorio ni una base de datos válida de cscope."
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Se ha añadido la base de datos «cscope» %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: Error al leer la conexión %ld con cscope."
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: Tipo de búsqueda desconocido para cscope."
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: No pude crear la conexión «pipe» para comunicarme con cscope."
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: No pude crear un nuevo proceso («fork») para usar cscope."
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "Falló la ejecución de «cs_create_connection»"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: No pude crear un nuevo proceso («spawn») de cscope."
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "«cs_create_connection»: Falló «fdopen» para «to_fp»."
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "«cs_create_connection»: Falló «fdopen» para «fr_fp»."
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: No hay conexiones con cscope."
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr ""
+"E259: No se encontraron coincidencias para la búsqueda cscope %s de %s."
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: La marca «cscopequickfix» %c para %c no es válida."
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "comandos de «cscope»:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Modo de uso: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: No puedo abrir la base de datos cscope: %s."
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: No puedo obtener información acerca de la base de datos cscope."
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: No se añadió una base de datos de cscope duplicada."
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: Se ha alcanzado el número máximo de conexiones con cscope."
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: no se ha encontrado la conexión «cscope» %s"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "Conexión «cscope» %s cerrada."
+
+# should not reach here
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: Error fatal en «cs_manage_matches»."
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "«tag» de cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # línea"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "nombre del fichero / contexto / línea\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Error de «cscope»: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Se han vaciado todas las bases de datos de «cscope»"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "no hay conexiones «cscope»\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " nº pid base de datos prefijo ruta\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Lo siento, este comando está desactivado pues no se pudo cargar la "
+"biblioteca de Python."
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: No puedo invocar a Python recursivamente."
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "no se pueden borrar los atributos de «OutputObject»."
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "«softspace» debe ser un entero."
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "atributo no válido."
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "«writelines()» requiere una lista de cadenas."
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: error de inicialización de objetos de E/S."
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "expresión no válida."
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "expresiones desactivadas al compilar."
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "intento de referirse a un buffer suprimido."
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "número de la línea fuera del rango."
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<objeto «buffer» (suprimido) en %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "nombre de marca no válido"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "no existe tal buffer"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "intento de referirse a una ventana suprimida"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "atributo de sólo lectura"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "posición del cursor fuera del buffer"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objeto ventana (suprimido) en %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objeto ventana (desconocido) en %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<ventana %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "no existe tal ventana"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "No puedo guardar la información para deshacer."
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "no puedo suprimir la línea"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "no puedo reemplazar la línea"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "no puedo insertar la línea"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "La cadena no puede contener quiebres de línea"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Lo siento, este comando está desactivado pues no se pudo cargar la "
+"biblioteca de Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: El estatus %d de «longjmp» no es conocido."
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Intercambiar implementación/definición"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Mostrar la clase base de"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Mostrar la función miembro que se ha sobrepasado con el código nuevo."
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Restaurar del fichero"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Restaurar del proyecto"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Restaurar de todos los proyectos"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Restaurar"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Mostrar el orígen de "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Buscar símbolo"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Hojear la clase"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Mostrar la clase en su jerarquía"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Mostrar la clase en jerarquía restringida"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref se refiere a"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref referida por"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref tiene un"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref usada por"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Mostrar docu de"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generar docu de"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"No puedo conectarme a SNiFF+. Verifique el entorno («sniffemacs» debe estar "
+"en $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Error al leer. Desconectado"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ está actualmente "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "no "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "conectado"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Petición de SNiFF+ desconocida: «%s»"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Error al conectarme a SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ no está conectado"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: No es un «buffer» de SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: error al escribir. Desconectado"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "número de «buffer» no válido"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "no implementado aún"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "opción desconocida"
+
+# ???
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "no se puede(n) poner la(s) línea(s)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "marca sin poner"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "fila %d columna %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "no se puede insertar/añadir línea"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "indicador desconocido: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "«vimOption» desconocida"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "interrupción desde el teclado"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "error de vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "no puedo crear el comando de buffer/ventana: el objeto será suprimido"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"No puedo registrar el comando «callback»: El «buffer» o la ventana ya fué "
+"eliminado."
+
+# This should never happen. Famous last word?
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: ERROR FATAL DE TCL: ¿¡«reflist» corrupta!? Por favor, informe de esto "
+"a vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"No puedo registrar el comando «callback»: No puedo encontrar la referencia "
+"al «buffer» o la ventana."
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Lo siento, este comando está desactivado pues no se pudo cargar la "
+"biblioteca de Tcl."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: ERROR DE TCL: ¿¡el código de salida no es «int»!? Por favor informe de "
+"esto a vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "no puedo obtener la línea"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Incapaz de registrar un nombre de servidor de comandos"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: No pude enviar el comando al programa de destino"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: El ID del usuario del servidor no es válido: «%s»."
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM instance registry property is badly formed. Deleted!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Opción desconocida"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Demasiados argumentos de edición."
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Falta el argumento después de"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Basura después de la opción"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr ""
+"Demasiados argumentos tales como: «+comando», «-c comando» o «--cmd comando»."
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Argumento no válido para"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Este Vim no ha sido compilado con la característica «diff»."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "Intento de abrir de nuevo el fichero «script»: «"
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "No puedo abrir para leer: «"
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "No puedo abrir para escribir la salida del «script»: «"
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d ficheros que editar\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Advertencia: la salida no es a un terminal\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Advertencia: la entrada no es desde un terminal\n"
+
+# just in case..
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "Línea de comandos anter de «vimrc»"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: No puedo leer desde «%s»"
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Más información con: «vim -h»\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[fichero ...] edita el/los fichero(s) especificado(s)"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- lee texto de la entrada estándar"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t «tag» edita el fichero donde está definido «tag»"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [fich. err.] edita el fichero con el primer error"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"Uso:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [argumentos]"
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" o:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumentos:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tSólo nombres de ficheros después de esto"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tNo expandir comodines"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistrar este «gvim» para «OLE»"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tSuprimir el registro de gvim para OLE"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tEjecutar usando el GUI (como «gvim»)"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr ""
+"-f o --nofork\tPrimer plano: No separarse («fork») cuando se inicia la "
+"interface gráfica (GUI)."
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tModo Vi (como «vi»)"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tModo Ex (como «ex»)"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tModo silencioso o «batch» (sólo para «ex»)"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tModo «diff» (como «vimdiff»)"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tModo fácil (como «evim», sin modo)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tModo de sólo lectura (como «view»)"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tModo restringido (como «rvim»)"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModificaciones no permitidas (escritura de ficheros)"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tModificaciones en el texto no permitidas"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tModo binario"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tModo lisp"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tCompatible con Vi: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tNo totalmente compatible con Vi: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tNivel de detalle de la ejecución"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tModo de depuración"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tSin fichero de intercambio, usa sólo la memoria"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tDar una lista de los fichero de intercambio y salir"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (con nombre del fichero)\tRecuperar sesión fallida"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tIgual que -r"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNo usar «newcli» para abrir la ventana"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <dispositivo>\t\tUse <dispositivo> para E/S"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tIniciar en modo árabe"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tIniciar en modo hebreo"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tIniciar en modo persa (farsi)"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tDetermina el tipo de terminal a <<terminal>>"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tUsa <vimrc> en lugar de cualquier .vimrc"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tUsa <gvimrc> en lugar de cualquier .gvimrc"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNo carga los «plugin scripts»"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tAbre N ventanas (valor predeterminado: una por fichero)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tComo «-o» pero divide las ventanas verticalmente."
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tComienza al final del fichero"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tComienza en la línea <lnum>"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <comando>\tEjecuta <comando> antes de cargar algún fichero vimrc"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <comando>\t\tEjecuta <comando> después de cargar el primer fichero"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr ""
+"-S <sesión>\t\tEjecuta los comandos del fichero <sesión> después\n"
+" \t\tde cargar el primer fichero"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\tLee los comandos en modo Normal del fichero <scriptin>"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr ""
+"-w <scriptout>\tAñade todos los comandos escritos al fichero <scriptout>"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr ""
+"-W <scriptout>\tGraba todos los comandos escritos al fichero <scriptout>"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEdita ficheros cifrados"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <pantalla>\tConecta vim a este servidor X11 en particular"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNo se conecta al servidor X11"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr ""
+"--remote <ficheros>\tEdita los <ficheros> en un servidor Vim si es posible."
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-silent <ficheros> Lo mismo pero no se queja si no existe un "
+"servidor disponible."
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <ficheros>\tComo --remote pero espera a que los ficheros "
+"terminen de editarse"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <ficheros> Lo mismo pero no se queja si no hay un "
+"servidor disponible."
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <teclas>\tEnvía <teclas> a un servidor Vim y sale"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <expr>\tEvalúa <expr> en servidor Vim e imprime el resultado"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr ""
+"--serverlist\t\tEmite una lista de los servidores Vim disponibles y sale"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr ""
+"--servername <nombre>\tEnvía a/se convierte en el servidor Vim de nombre "
+"<nombre>"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tUsa <viminfo> en lugar de .viminfo"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h or --help\tImprime la ayuda de comandos (este mensaje) y termina."
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tImprime la información de versión y termina."
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumentos reconocidos por gvim (versión Motif):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Argumentos reconocidos por gvim (versión neXtaw):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumentos reconocidos por gvim (versión Athena):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <pantalla>\tEjecuta vim en <pantalla>"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tArranca vim «iconizado»"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nombre>\t\tUsa un recurso como si vim fuese <nombre>"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Sin implementar)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\tUsa <color> para el fondo (también: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tUsa <color> para el texto normal (también: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr ""
+"-font <tipo>\t\tUsa <fuente de impresión> para el texto normal (también: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <tipo>\tUsa <fuente de impresión> para texto en negrita"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <tipo>\tUsa <fuente de impresión> para texto en cursiva"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <geom>\tUsa <geom> para la geometría inicial (también: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <ancho>\tUsa un ancho de borde de <ancho> (también: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <ancho> Usa una barra de desplazamiento de ancho <ancho> "
+"(también: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr ""
+"-menuheight <alt>\tUsa una barra de menú de altura <alt> (también: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tUsar vídeo inverso (también: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNo usar vídeo inverso (también: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <recurso>\tEstablece el recurso especificado"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumentos reconocidos por gvim (versión para RISC OS):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <número>\tAnchura inicial de la ventana, en columnas"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <número>\tAltura inicial de la ventana, en filas"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumentos reconocidos por gvim (versión GTK+):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <pantalla>\tEjecuta vim en <pantalla> (también: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr ""
+"--role <role>\tDefine un rol único para identificar la ventana principal."
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tAbre a Vim dentro de otro «widget» GTK."
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <título ventana padre>\tAbrir a Vim dentro de la aplicación padre."
+
+#: main.c:2847
+msgid "No display"
+msgstr "No hay una ventana"
+
+# Failed to send, abort.
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": Falló el envio.\n"
+
+# Let vim start normally.
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ""
+": Falló el inicio de sesión remota («send»). Intentado una ejecución local.\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d de %d editados"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "No hay una ventana en el destino: El envio de la expresión falló.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Falló el envio de la expresión.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "No hay ninguna marca fijada"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: No hay marcas que coincidan con «%s»"
+
+# Highlight title
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"marca línea col fichero/texto"
+
+# Highlight title
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" salto línea col fichero/texto"
+
+# Highlight title
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"marca línea col fichero/texto"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Marcas en el fichero:\n"
+
+# Write the jumplist with -'
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Lista de saltos (el más reciente va primero):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historia de las marcas en los ficheros (de la más reciente a la más "
+"antigua):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Falta «>»"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: No es una página de código válida."
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: No se pueden fijar los valores IC"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: Falló la creación del contexto de entrada"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Falló la apertura del método de entrada"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Advertencia: No pude crear un callbacl de destrucción al IM."
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: el método de entrada no admite ningún estilo"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: El método de entrada no soporta mi tipo de preedición."
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: El estilo «sobre el punto» requiere del uso de un «fontset»."
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Su GTK+ es anterior a 1.2.3. Área de estado desactivada"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: El servidor de método de entrada (IME) no está funcionando"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: El bloque no estaba asegurado"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Error de búsqueda al leer el fichero de intercambio"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: Error de lectura en el fichero de intercambio"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Error de búsqueda al escribir en el fichero de intercambio"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: Error de escritura en el fichero de intercambio"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Ya existe un fichero de intercambio (¿ataque de symlink?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ¿No se obtuvo el bloque nº 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ¿No se obtuvo el bloque nº 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ¿No se obtuvo el bloque nº 2?"
+
+# could not (re)open the swap file, what can we do????
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: ¡¡¡Eeeh, se ha perdido el fichero de intercambio!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: No se pudo cambiar el nombre del fichero de intercambio"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr ""
+"E303: Incapaz de abrir el fichero de intercambio para «%s», recuperación "
+"imposible"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: «ml_timestamp»: ¿No se obtuvo el bloque 0?"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: No se encontró el fichero de intercambio para %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"Introduzca el número del fichero de intercambio a usar (0 para salir): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: No puedo abrir %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Incapaz de leer el bloque 0 de "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Tal vez no se han hecho cambios o Vim no actualizó el fichero de intercambio"
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " no puede usarse con esta versión de Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Use la versión 3.0 de Vim.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s no parece un fichero de intercambio de Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr "no puede usarse en este ordenador.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "El fichero fue creado el "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"o el fichero ha sido dañado."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Usando el fichero de intercambio «%s»"
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Fichero original «%s»"
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Advertencia: el fichero original puede haber sido cambiado"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Incapaz de leer el bloque 1 de %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???FALTAN MUCHAS LÍNEAS"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???RECUENTO DE LÍNEAS EQUIVOCADO"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???BLOQUE VACÍO"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???FALTAN LÍNEAS"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID del bloque 1 equivocado (¿no es %s un fichero .swp?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???FALTA UN BLOQUE"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? desde aquí hast ???FIN las líneas pueden estar desordenadas"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr ""
+"??? desde aquí hasta ???FIN las líneas pueden haber sido insertadas/borradas"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???FIN"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Recuperación interrumpida"
+
+#: memline.c:1148
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Se han detectado errores al recuperar; busque líneas que empiecen "
+"con ???"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "Vea «:help E312» para más información."
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Recuperación completada. Ud. debería comprobar que todo está bien."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Podría querer guardar este fichero con otro nombre\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr ""
+"y ejecutar «diff» con el fichero original para comprobar los cambios)\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Suprimir el fichero .swp, después de terminar.\n"
+"\n"
+
+# use msg() to start the scrolling properly
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "Se han encontrado ficheros de intercambio:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " En el directorio actual:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " Usando el nombre especificado:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " En el directorio "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ninguno --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " propiedad de: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " de fecha: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " de fecha: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [desde la versión 3.0 de Vim]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [no parece un fichero de intercambio de Vim]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " nombre del fichero: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" modificado: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "SI"
+
+#: memline.c:1525
+msgid "no"
+msgstr "no"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" nombre del usuario: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " nombre del «host»: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" nombre del «host»: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID del proceso: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (aún en ejecución)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [no se peude usar con esta versión de Vim]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [no se puede usar en este ordenador]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [no se puede leer]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [no se puede abrir]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: No puedo preservarlo, no existe un fichero de intercambio"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "fichero preservado"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: Falló la preservación del fichero"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: «ml_get»: número de línea no válido: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: «ml_get»: no puedo encontrar la línea %ld"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: El id del bloque de punteros está equivocado. 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "«stack_idx» debería ser 0"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ¿Demasiados bloques actualizados?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: El id del bloque de punteros está equivocado. 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "¿bloque 1 suprimido?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: No puedo encontrar la línea %ld"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: El id del bloque de punteros está equivocado."
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "«pe_line_count» es cero"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: número de línea fuera de rango: %ld más allá del final"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: recuento de líneas erróneo en el bloque %ld"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "El tamaño de la pila aumenta"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E310: El id del bloque de punteros está equivocado. 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: ATENCIÓN"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Se ha encontrado un fichero de intercambio con el nombre «"
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "al abrir el fichero «"
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " MÁS NUEVO que el fichero de intercambio!\n"
+
+# Some of these messages are long to allow translation to
+# * other languages.
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Otro programa puede estar editando el mismo fichero.\n"
+" De ser así, tenga cuidado de no acabar con dos\n"
+" ejemplares diferentes del mismo fichero al hacer cambios.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " Salga del programa o continue con precaución.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Falló una sesión de edición de este fichero.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Si es así, use «:recover» o «vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"»\n"
+" para recuperar los cambios (véa «:help recovery»).\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " Si Ud. ya ha hecho esto, borre el fichero de intercambio «"
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"»\n"
+" para evitar este mensaje.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "¡El fichero de intercambio «"
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "» ya existe!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - ATENCIÓN"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "¡Ya existe un fichero de intercambio!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&Abrir para lectura únicamente\n"
+"&Editar de todas formas\n"
+"&Recuperar\n"
+"&Salir\n"
+"&Abortar"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&Abrir para lectura únicamente\n"
+"&Editar de todas formas\n"
+"&Recuperar\n"
+"&Salir\n"
+"&Abortar\n"
+"&Borrarlo"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: Se han encontrado demasiados ficheros de intercambio"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Parte de la ruta del item del menú no es un sub-menú"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: El menú sólo existe en otro modo de operación"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: No existe un menú con ese nombre"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: La ruta del menú no debe conducir a un sub-menú"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr ""
+"E331: No se deben añadir items del menú directamente a la barra del menú"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: El separador no puede ser parte de una ruta de menú"
+
+# Now we have found the matching menu, and we list the mappings
+# Highlight title
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menús ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Desprender y flotar este menú"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: La ruta del menu debe conducir a un item del menú"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: No se ha encontrado el menú: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: El menú no está definido para el modo %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: La ruta del menú debe conducir a un sub-menú"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: No se ha encontrado el menú - verifique los nombres de los menús"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Se ha detectado un error al procesar %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "línea %4ld"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[cadena demasiado larga]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"Mantenedor de los mensajes: Alejandro López-Valencia <dradul@yahoo.com>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Interrupción: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "Pulse INTRO para continuar"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Pulse INTRO o escriba un comando para continuar"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Más --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: línea, ESPACIO/b: página, d/u: media página, q: salir)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: línea, ESPACIO: página, d: media página, q: salir)"
+
+#: message.c:2982 message.c:2997
+msgid "Question"
+msgstr "Pregunta"
+
+#: message.c:2984
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Si\n"
+"&No"
+
+#: message.c:3017
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Si\n"
+"&No\n"
+"&Guardar todo\n"
+"&Descartar todo\n"
+"&Cancelar"
+
+#: message.c:3058
+msgid "Save File dialog"
+msgstr "Diálogo de Guardar Fichero"
+
+#: message.c:3060
+msgid "Open File dialog"
+msgstr "Diálogo de Abrir Fichero"
+
+#. TODO: non-GUI file selector here
+#: message.c:3131
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Lo siento, no hay hojeador de ficheros en modo de consola"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Advertencia: cambiando un fichero de sólo lectura"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "1 línea más"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "1 línea menos"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld líneas más"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld líneas menos"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (Interrumpido)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "Vim: preservando ficheros...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "Vim: finalizado.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "ERROR: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] total liberado por alloc %lu-%lu, en uso %lu, uso máximo %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[lamadas] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: La línea se está haciendo demasiado larga"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Error interno: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ¡Memoria agotada! (al asignar %lu bytes)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Llamando a la «shell» para ejecutar: «%s»"
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: Falta un símbolo de dos puntos."
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: Modo de operación ilegal."
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: El «mouseshape» no es válido."
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: Se esperaba un dígito."
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: Porcentaje ilegal."
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "Introduzca la clave de cifrado: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr "Introduzca la misma clave de cifrado otra vez: "
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "¡Las claves de cifrado no coinciden!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Ruta no válida: '**[número]' debe estar al final de la ruta o seguido "
+"de «%s»."
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: No se puede encontrar el directorio «%s» en «cdpath»"
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: No se puede encontrar el fichero «%s» en la ruta"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: No se han encontrado mas directorios «%s» en «cdpath»"
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: No se han encontrado mas ficheros «%s» en la ruta"
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: Falta un símbolo de dos puntos."
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: Componente ilegal."
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: se esperaba un dígito."
+
+# Get here when the server can't be found.
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "No puedo conectarme a Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "No puedo conectarme a Netbeans"
+
+# c-format
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr "E668: El dueño(a) del fichero de conexión NetBeans no es válido: «%s»"
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "leido del socket Netbeans"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Se perdió la conexión NetBeans para el «buffer» %ld."
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "Advertencia: el terminal no puede realzar el texto"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: No hay ninguna cadena bajo el cursor"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: No hay ningún identificador bajo el cursor"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: No puedo borar pliegues con el «folmethod» actual."
+
+#: normal.c:6740
+msgid "E664: changelist is empty"
+msgstr "E664: La lista de cambios está vacía."
+
+#: normal.c:6742
+msgid "E662: At start of changelist"
+msgstr "E662: Al comienzo de la lista de cambios."
+
+#: normal.c:6744
+msgid "E663: At end of changelist"
+msgstr "E663: Al final de la lista de cambios."
+
+#: normal.c:8005
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Escriba :quit<enter> para terminar la ejecución de Vim."
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 línea %sed 1 vez."
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 línea %sed %d veces."
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld líneas %sed 1 vez."
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld líneas %sed %d veces."
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld líneas por sangrar..."
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 línea sangrada"
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld líneas sangradas"
+
+# Debe mostrar la línea de comandos.
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "No puedo hacer un «yank»; ¿Lo borro de todas formas?"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "1 línea cambiada"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld líneas cambiadas"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "liberando %ld líneas"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "1 línea copiada"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld líneas copiadas"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: No hay nada en el registro %s"
+
+# Highlight title
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registros ---"
+
+#: ops.c:5075
+msgid "Illegal register name"
+msgstr "Nombre de registro ilegal"
+
+#: ops.c:5163
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registros:\n"
+
+#: ops.c:5213
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Registro desconocido de tipo «%d»."
+
+#: ops.c:5698
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Nombre de registro no válido: '%s'"
+
+#: ops.c:6058
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Cols; "
+
+#: ops.c:6065
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr ""
+"Seleccionadas %s%ld de %ld Líneas; %ld de %ld Palabras; %ld de %ld Caracteres"
+
+#: ops.c:6081
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr ""
+"Col %s de %s; Línea %ld de %ld; Palabra %ld de %ld; Carácter %ld de %ld"
+
+#: ops.c:6092
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld para BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Página %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Gracias por volar con Vim"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Opción desconocida."
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Opción no admitida"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: No se permite en una «modeline»"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tSe definió por última vez en "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Se necesita un número despues de «=»"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: No lo encontré en el «termcap»."
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Carácter ilegal <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: No puedo definir «term» como una cadena de caracteres vacía."
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: No puedo cambiar «term» en la GUI."
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Use «:gui» para iniciar la GUI."
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: «backupext» y «patchmode» son iguales."
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: No puede cambiarse en el GUI de GTK+ 2."
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Falta un símbolo de dos puntos."
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Cadena de caracteres de largo cero."
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Falta el número despues de <%s>."
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Falta una coma."
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Debe especificar un valor '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: Contiene un caracter no imprimible o de más de un byte de ancho."
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Las fuente(s) de impresión no son válidas."
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: No puedo seleccionar ese «fontset»."
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: El conjunto de fuentes de impresión no es válido."
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr ""
+"E533: No puedo seleccionar la fuente de impresión «ancha» (de byte doble)."
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: Fuente de impresión «ancha» inválida."
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: arácter ilegal después de <%c>."
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: Se requiere una coma."
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: «commentstring» debe estar vacio o contener «%s»."
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: No hay soporte para el ratón."
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: SEcuencia de expresión sin cerrar."
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: Demasiados ítems."
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: Grupos desbalanceados."
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: Ya existe una ventana de visualización previa."
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr ""
+"W17: El uso de árabe requiere la codificación UTF-8, use «:set encoding=utf-"
+"8» primero."
+
+#: option.c:6783
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Necesita al menos %d líneas."
+
+#: option.c:6793
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Necesita al menos %d columnas."
+
+#: option.c:7100
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Opción desconocida: %s"
+
+#: option.c:7220
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Códigos de terminal ---"
+
+#: option.c:7222
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Valores de las opciones globales ---"
+
+#: option.c:7224
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Valores de las opciones locales ---"
+
+#: option.c:7226
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Opciones ---"
+
+#: option.c:7932
+msgid "E356: get_varp ERROR"
+msgstr "E356: ERROR de «get_varp»"
+
+#: option.c:8903
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: «langmap»: falta carácter coincidente para %s"
+
+#: option.c:8937
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: «langmap»: caracteres extra después del punto y coma: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "No puedo abrirlo"
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ¡No puedo abrir la ventana!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Necesito la versión 2.04 o posterior de Amigados\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Necesito %s versión %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "No puedo abrir NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "No puedo crear "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Saliendo de Vim con %d\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "¡¿No puedo cambiar el modo de la consola?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "«mch_get_shellsize»: ¿No es una consola?\n"
+
+# if Vim opened a window: Executing a shell may cause crashes
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: No se puede ejecutar la «shell» con la opción -f"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "No puedo ejecutarlo "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "«shell» "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " devuelto\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "«ANCHOR_BUF_SIZE» demasiado pequeño"
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "ERROR E/S"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(truncado)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' no es 80, no se pueden ejecutar comandos externos"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E237: FAlló la selectión de impresora."
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "para %s en %s"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Fuente de impresión desconocida en la impresora: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Error de impresión: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "Desconocido"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "Imprimiendo «%s»"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr ""
+"E244: El nombre del conjunto de caracteres «%s» no es válido en el nombre de "
+"la fuente de impresión «%s»"
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Carácter «%c» ilegal en el nombre de la fuente de impresión «%s»"
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Opción «osfiletype» inválida - usando Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: doble señal, saliendo\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: capté una señal de muerte %s\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: capté una señal de muerte\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Abrir la pantalla X tomó %ld ms"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Hay un error de X11\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "Falló la prueba del sistema X11"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "El «display» de X no abrió a tiempo."
+
+#: os_unix.c:3230 os_unix.c:3910
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"No puedo ejecutar la «shell» "
+
+#: os_unix.c:3278
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"No puedo ejecutar la «shell» «sh»\n"
+
+#: os_unix.c:3282 os_unix.c:3916
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"La «shell» ha devuelto "
+
+#: os_unix.c:3417
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"No puedo crear «pipes»\n"
+
+#: os_unix.c:3432
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"No puedo usar «fork»\n"
+
+#: os_unix.c:3923
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Comando finalizado\n"
+
+#: os_unix.c:4187 os_unix.c:4312 os_unix.c:5978
+msgid "XSMP lost ICE connection"
+msgstr "XSMP perdió la conexión ICE."
+
+#: os_unix.c:5561
+msgid "Opening the X display failed"
+msgstr "Falló la apertura de la pantalla X11"
+
+#: os_unix.c:5883
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP está manejando una solicitud de «guardelo usted mismo»."
+
+#: os_unix.c:6002
+msgid "XSMP opening connection"
+msgstr "XSMP está abriendo una conexión."
+
+#: os_unix.c:6021
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP Falló el monitoreo de la conexión ICE."
+
+#: os_unix.c:6041
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection ha fallado: %s."
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "En la línea"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "No pude designar memoria para la línea de comandos."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "Error de Vim"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "¡No pude cargar vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "¡No pude fijar los punteros de la función a la DLL!"
+
+#: os_win16.c:342 os_win32.c:3248
+#, c-format
+msgid "shell returned %d"
+msgstr "La «shell» ha devuelto %d"
+
+#: os_win32.c:2706
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Capté el evento %s\n"
+
+#: os_win32.c:2708
+msgid "close"
+msgstr "cerrar"
+
+#: os_win32.c:2710
+msgid "logoff"
+msgstr "salida"
+
+#: os_win32.c:2711
+msgid "shutdown"
+msgstr "apagar"
+
+#: os_win32.c:3201
+msgid "E371: Command not found"
+msgstr "E371: No se encuentra el comando"
+
+#: os_win32.c:3214
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE no se encuentra en su $PATH.\n"
+"Los comandos externos no harán una pausa al finalizar.\n"
+"Véase :help win32-vimrun para más información"
+
+#: os_win32.c:3217
+msgid "Vim Warning"
+msgstr "Advertencia de Vim"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Demasiados %%%c en la cadena de formato"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: %%%c inesperado en la cadena de formato"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Falta ] en la cadena de formato"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c no admitido en cadena de formato"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: %%%c no válido en el prefijo de una cadena de formato"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: %%%c no válido en una cadena de formato"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: «errorformat» no contiene un patrón"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: El nombre del directorio falta o está vacío"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: No hay más ítems."
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d de %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (línea borrada)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Al final de la pila de correción rápida"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Al principio de la pila de correción rápida"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "lista de errores %d de %d: %d errores"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: No se puede grabar, la opción «buftype» está activada"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: El ítem en %s%%[] no es válido."
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: Patrón demasiado largo"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: Demasiados \\z("
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Hay demasiados %s("
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: \\z( sin complemento."
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: %s%%( sin complemento."
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: %s( sin complemento."
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: %s) sin complemento."
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: El operando %s* podría estar vacío."
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: EL operando %s+ podría estar vacío."
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: Carácter inválido después de %s@"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: EL operando %s{ podría estar vacío."
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Hay demasiados %s{...}s complejos."
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Anidado %s*"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Anidado %s%c"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: Uso inválido de \\_"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c no sigue a nada"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: Refernecia reversa ilegal."
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: No se permite \\z( aquí."
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et al. no están permitidos aquí."
+
+# Es preferible traducir "invalid" por "no [es] válido" pues "inválido" no es lo suficientemente claro. Además, no es políticamente correcto :-)
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Hay un carácter no válido después de \\z"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Falta ] despues de %s%%["
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] vacío."
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Carácter ilegal después de %s%%"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Eror de sintáxis en %s{...}."
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Intercepté un «crash»; ¿expresión regular muy compleja?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: el patrón ha provocado un error «out-of-stack»"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "Subcoincidencias externas:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld líneas plegadas"
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " REEMPLAZAMIENTO VIRTUAL"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " REEMPLAZAR"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " INVERTIR"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " INSERTAR"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (insertar)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (reemplazar)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (reemplazamiento virtual)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Hebreo"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " árabe"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (idioma)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (pegar)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " VISUAL"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " LÍNEA VISUAL"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " BLOQUE VISUAL"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " SELECCIONAR"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " SELECCIONAR LÍNEA"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " SELECCIONAR BLOQUE"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "grabando"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "La búsqueda ha llegado al PRINCIPIO, continuando desde el FINAL."
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "La búsqueda ha llegado al FINAL, continuando desde el PRINCIPIO"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Cadena de búsqueda no válida: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: La búsqueda ha llegado al PRINCIPIO sin coincidencias con: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: La búsqueda ha llegado al FINAL sin coincidencias con: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Esperaba «?» o «/» después de «;»"
+
+#: search.c:3759
+msgid " (includes previously listed match)"
+msgstr " (incluye la coincidencia mostrada previamente)."
+
+# cursor at status line
+#. cursor at status line
+#: search.c:3779
+msgid "--- Included files "
+msgstr "--- Ficheros incluidos "
+
+#: search.c:3781
+msgid "not found "
+msgstr "no lo encontré"
+
+#: search.c:3782
+msgid "in path ---\n"
+msgstr "en la ruta ---\n"
+
+#: search.c:3839
+msgid " (Already listed)"
+msgstr " (Ya lo enumeré)"
+
+#: search.c:3841
+msgid " NOT FOUND"
+msgstr " NO SE ENCONTRÓ"
+
+#: search.c:3893
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Explorando el fichero incluido: %s"
+
+#: search.c:4111
+msgid "E387: Match is on current line"
+msgstr "E387: La coincidencia está en la línea en curso."
+
+#: search.c:4254
+msgid "All included files were found"
+msgstr "Se han encontrado todos los ficheros incluidos"
+
+#: search.c:4256
+msgid "No included files"
+msgstr "No hay ficheros incluidos"
+
+#: search.c:4272
+msgid "E388: Couldn't find definition"
+msgstr "E388: No se pudo encontrar la definición"
+
+#: search.c:4274
+msgid "E389: Couldn't find pattern"
+msgstr "E389: No se pudo encontrar el patrón"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Argumento ilegal: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: No existe tal agrupamiento sintáctico: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "No hay ítems sintácticos definidos para este «buffer»"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "Sincronizando en los comentarios de estilo «C»."
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "no hay sincronización"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "Comenzando sincronización."
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " líneas antes de la línea superior"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Ítems de sincronización de sintáxis ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"sincronizando en los ítems"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Items sintácticos ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: No existe tal agrupamiento sintáctico: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "mínimo"
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "máximo"
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; coincide"
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " líneas de quiebre"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here not accepted here"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: No se encuentra el item de región para %s"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: el contenido del argumento no se acepta aquí"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: el argumento «containedin» no se acepta aquí"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Hace falta un nombre de fichero"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Falta el «=»: %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Argumentos insuficientes: región de sintaxis %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: No se ha especificado una agrupación"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: No hay un delimitador de patrón: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Basura después del patrón: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr ""
+"E403: Sincronización de sintáxis: Se especificó dos veces un patrón de "
+"continuaciones de línea."
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Argumentos ilegales: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Falta el signo igual: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Argumento vacío: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s no está permitido aquí"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s debe ser el primero en la lista de contenido"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Nombre de grupo desconocido: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Subcomando «:syntax» no válido: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: grupo realzado no encontrado: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Argumentos insuficientes: «:highlight link %s»"
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Demasiados argumentos: «:highlight link %s»"
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr ""
+"E414: El grupo tiene opciones asignadas, se ha ignorado el enlace de "
+"colorización."
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: Signo igual inesperado: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: falta el signo igual: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: falta el argumento: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Valor ilegal: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: color de primer plano desconocido"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: Color de fondo desconocido"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Nombre o número de color desconocido: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: código de terminal demasiado largo: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Argumento ilegal: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Hay demasiados atributos de realzado en uso"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Caracter no imprimible en el nombre del grupo."
+
+# Es preferible traducir "invalid" por "no [es] válido" pues "inválido"
+# no es lo suficientemente claro. Además, no es políticamente correcto :-)
+# ALV
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: Hay un carácter no válido en el nobre del grupo."
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: En el final de la pila de correción rápida"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: En el principio de la pila de correción rápida"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: No se puede ir antes del primer «tag» coincidente"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: «tag» no encontrado: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # marca tipo pri"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "fichero\n"
+
+# * Ask to select a tag from the list.
+# * When using ":silent" assume that <CR> was entered.
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Introduzca el nº de la elección (<INTRO> para abortar): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: Hay sólo un «tag» que coincide"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E420: No se puede ir más allá del último «tag» que coincida"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "No existe el fichero «%s»."
+
+# Give an indication of the number of matching tags
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "«tag» %d de %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " o más"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " Uso de un «tag» con caja diferente"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: El fichero «%s» no existe"
+
+# Highlight title
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # A «tag» DESDE la línea en el fichero/texto"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Buscando el fichero de «tags» %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Ruta del fichero de «tags» truncada para %s\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Error de formato en el fichero de «tags» «%s»"
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Adelante del byte %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Fichero de «tags» sin ordenar: %s"
+
+# never opened any tags file
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: No hay fichero de «tags»"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: No se puede encontrar el patrón de «tags»"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: No se pudo encontrar el «tag», ¡adivino solamente!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' desconocido. Los terminales incorporados disponibles son:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "Usando ' por defecto."
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: No puedo abrir el fichero «termcap»."
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: No se ha encontrado la definición del terminal en «terminfo»."
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: No se ha encontrado la definición del terminal en «termcap»."
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: la entrada «%s» no existe en el fichero «termcap»."
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Se necesita la capacidad de terminal «cm»"
+
+# Highlight title
+# Highlight title
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Teclas del terminal ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "Inicié una «shell» nueva\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: error al leer la entrada, saliendo...\n"
+
+# must display the prompt
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "No es posible deshacer; continuando de todos modos"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: «u_undo»: números de línea erróneos"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 cambio"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld cambios"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: la lista de deshacer se dañó."
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: falta la línea deshacer."
+
+# Only MS VC 4.1 and earlier can do Win32s
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:739
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"Versión GUI de 16/32 bits para MS-Windows"
+
+#: version.c:741
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"Versión GUI de 32 bits para MS-Windows"
+
+#: version.c:744
+msgid " in Win32s mode"
+msgstr " en modo Win32s"
+
+#: version.c:746
+msgid " with OLE support"
+msgstr " con soporte para OLE"
+
+#: version.c:749
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"Versión de 32 bits para consola de MS-Windows"
+
+#: version.c:753
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"Versión de 16 bits para MS-Windows"
+
+#: version.c:757
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"Versión de 32 bits para MS-DOS"
+
+#: version.c:759
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"Versión de 16 bits para MS-DOS"
+
+#: version.c:765
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"Versión X (unix) para MacOS"
+
+#: version.c:767
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"Versión X para MacOS"
+
+#: version.c:770
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"Versión para MacOS"
+
+#: version.c:775
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"Versión para RISC OS"
+
+#: version.c:785
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Parches incluidos: "
+
+#: version.c:811 version.c:1179
+msgid "Modified by "
+msgstr "Modificado por "
+
+#: version.c:818
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compilado "
+
+#: version.c:821
+msgid "by "
+msgstr "por "
+
+#: version.c:833
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Versión «enorme» "
+
+#: version.c:836
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Versión «grande» "
+
+#: version.c:839
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Versión «normal» "
+
+#: version.c:842
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Versión «pequeña» "
+
+#: version.c:844
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Versión «diminuta» "
+
+#: version.c:850
+msgid "without GUI."
+msgstr "sin GUI."
+
+#: version.c:855
+msgid "with GTK2-GNOME GUI."
+msgstr "con GUI GTK2-GNOME."
+
+#: version.c:857
+msgid "with GTK-GNOME GUI."
+msgstr "con GUI GTK-GNOME."
+
+#: version.c:861
+msgid "with GTK2 GUI."
+msgstr "con GUI GTK2."
+
+#: version.c:863
+msgid "with GTK GUI."
+msgstr "con GUI GTK."
+
+#: version.c:868
+msgid "with X11-Motif GUI."
+msgstr "con GUI X11-Motif."
+
+#: version.c:872
+msgid "with X11-neXtaw GUI."
+msgstr "con GUI X11-neXtaw."
+
+#: version.c:874
+msgid "with X11-Athena GUI."
+msgstr "con GUI X11-Athena."
+
+#: version.c:878
+msgid "with BeOS GUI."
+msgstr "con GUI para BeOS."
+
+#: version.c:881
+msgid "with Photon GUI."
+msgstr "con GUI para Photon."
+
+#: version.c:884
+msgid "with GUI."
+msgstr "con GUI."
+
+#: version.c:887
+msgid "with Carbon GUI."
+msgstr "con Carbon GUI."
+
+#: version.c:890
+msgid "with Cocoa GUI."
+msgstr "con Cocoa GUI."
+
+#: version.c:893
+msgid "with (classic) GUI."
+msgstr "con GUI (clásico)."
+
+#: version.c:904
+msgid " Features included (+) or not (-):\n"
+msgstr " Aspectos incluidos (+) o no (-):\n"
+
+#: version.c:916
+msgid " system vimrc file: \""
+msgstr " fichero «vimrc» del sistema: \""
+
+#: version.c:921
+msgid " user vimrc file: \""
+msgstr " fichero «vimrc» del usuario: \""
+
+#: version.c:926
+msgid " 2nd user vimrc file: \""
+msgstr " 2º fichero «vimrc» del usuario: \""
+
+#: version.c:931
+msgid " 3rd user vimrc file: \""
+msgstr " 3er fichero «vimrc» del usuario: \""
+
+#: version.c:936
+msgid " user exrc file: \""
+msgstr " fichero «exrc» del usuario: \""
+
+#: version.c:941
+msgid " 2nd user exrc file: \""
+msgstr " 2º fichero «exrc» del usuario: \""
+
+#: version.c:947
+msgid " system gvimrc file: \""
+msgstr " fichero «gvimrc» del sistema: \""
+
+#: version.c:951
+msgid " user gvimrc file: \""
+msgstr " fichero «gvimrc» del usuario: \""
+
+#: version.c:955
+msgid "2nd user gvimrc file: \""
+msgstr " 2º fichero «gvimrc» del usuario: \""
+
+#: version.c:960
+msgid "3rd user gvimrc file: \""
+msgstr "3er fichero «gvimrc» del usuario: \""
+
+#: version.c:967
+msgid " system menu file: \""
+msgstr " fichero de menú del sistema: \""
+
+#: version.c:975
+msgid " fall-back for $VIM: \""
+msgstr " localización de $VIM: \""
+
+#: version.c:981
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " localización de $VIMRUNTIME: \""
+
+#: version.c:985
+msgid "Compilation: "
+msgstr "Compilación: "
+
+#: version.c:991
+msgid "Compiler: "
+msgstr "Compilador: "
+
+#: version.c:996
+msgid "Linking: "
+msgstr "Enlazado: "
+
+#: version.c:1001
+msgid " DEBUG BUILD"
+msgstr " COMPILACIÓN CON SÍMBOLOS DE DEPURACIÓN"
+
+#: version.c:1040
+msgid "VIM - Vi IMproved"
+msgstr "VIM - VI Mejorado"
+
+#: version.c:1042
+msgid "version "
+msgstr "versión "
+
+#: version.c:1043
+msgid "by Bram Moolenaar et al."
+msgstr "por Bram Moolenaar et al."
+
+#: version.c:1047
+msgid "Vim is open source and freely distributable"
+msgstr "Vim es código abierto y se puede distribuir libremente"
+
+#: version.c:1049
+msgid "Help poor children in Uganda!"
+msgstr "¡Ayude a los niños pobres de Uganda!"
+
+#: version.c:1050
+msgid "type :help iccf<Enter> for information "
+msgstr "escriba «:help iccf<Intro>» para más información "
+
+#: version.c:1052
+msgid "type :q<Enter> to exit "
+msgstr "escriba «:q<Intro>» para salir "
+
+#: version.c:1053
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "escriba «:help<Intro> o <F1>» para obtener ayuda "
+
+#: version.c:1054
+msgid "type :help version6<Enter> for version info"
+msgstr "escriba «:help version6<Intro>» para información de la versión"
+
+#: version.c:1057
+msgid "Running in Vi compatible mode"
+msgstr "Ejecutando en modo compatible con Vi"
+
+#: version.c:1058
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "escriba «:set nocp<Intro>» para los valores predefinidos de Vim"
+
+#: version.c:1059
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "escriba «:help cp-default<Intro>» para más información"
+
+#: version.c:1074
+msgid "menu Help->Orphans for information "
+msgstr "menú Ayuda->Ayude a los niños huérfanos para más información "
+
+#: version.c:1076
+msgid "Running modeless, typed text is inserted"
+msgstr "Ejecución no modal, el texto escrito se inserta directamente"
+
+#: version.c:1077
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Editar->Opciones globales->Activar/Desactivar modo de inserción"
+
+#: version.c:1078
+msgid " for two modes "
+msgstr " para dos modos "
+
+#: version.c:1082
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr ""
+"menu Editar->Opciones globales->Activar/Desactivar compatibilidad con Vi"
+
+#: version.c:1083
+msgid " for Vim defaults "
+msgstr ""
+" para los valores predeterminados de Vim"
+
+#: version.c:1130
+msgid "Sponsor Vim development!"
+msgstr "¡Patrocine el desarrollo de Vim!"
+
+#: version.c:1131
+msgid "Become a registered Vim user!"
+msgstr "¡Conviertase en un usuario registrado de Vim!"
+
+#: version.c:1134
+msgid "type :help sponsor<Enter> for information "
+msgstr "escriba :help sponsor<Intro> para más información "
+
+#: version.c:1135
+msgid "type :help register<Enter> for information "
+msgstr "escriba «:help register<Intro>» para más información "
+
+#: version.c:1137
+msgid "menu Help->Sponsor/Register for information "
+msgstr "menu Ayuda->Benefactor/Regístrese para más información."
+
+#: version.c:1147
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "AVISO: se ha detectado Windows 95/98/ME"
+
+#: version.c:1150
+msgid "type :help windows95<Enter> for info on this"
+msgstr "escriba: «:help windows95<Intro>» para más información"
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: No hay una ventana de vista previa"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: No se puede dividir arriba-izq y abajo-der al mismo tiempo"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: No se puede rotar cuando otra ventana está dividida."
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: No se puede cerrar la última ventana."
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Sólo hay una ventana."
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Otra ventana contiene cambios."
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: No hay un nombre de fichero bajo el cursor"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: No se puede encontrar el fichero «%s» en la ruta"
+
+#: if_perl.xs:326 globals.h:1236
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: No se pudo cargar la biblioteca dinámica %s."
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"E263: Lo siento, este comando está desactivado, no se pudo cargar la "
+"biblioteca dinámica de Perl."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: No se permite la evaluación de código Perl en la caja de arena sin el "
+"uso del módulo «Safe»."
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Editar con Vims &múltiples"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Editar con un solo &Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Diff con Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Editar con &Vim"
+
+# Now concatenate
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Editar con un Vim existente - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Editar el(los) ficheros seleccionado(s) con Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Error al crear el proceso: Asegúrese de que gvim es en su «path»!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "error en gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "¡La ruta de acceso es demasiado larga!"
+
+#: globals.h:1026
+msgid "--No lines in buffer--"
+msgstr "--No hay líneas en el buffer--"
+
+# * The error messages that can be shared are included here.
+# * Excluded are errors that are only used once and debugging messages.
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1189
+msgid "E470: Command aborted"
+msgstr "E470: El comando abortó."
+
+#: globals.h:1190
+msgid "E471: Argument required"
+msgstr "E471: Se requiere un argumento."
+
+#: globals.h:1191
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ debería ir seguido de /, ? o &."
+
+#: globals.h:1193
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: No es válido en la ventana de la línea de comandos: <CR> ejecuta, CTRL-"
+"C sale."
+
+#: globals.h:1195
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Comando no permitido desde exrc/vimrc en el dir en curso o al buscar "
+"«tags»"
+
+#: globals.h:1197
+msgid "E171: Missing :endif"
+msgstr "E171: Falta «:endif»"
+
+#: globals.h:1198
+msgid "E600: Missing :endtry"
+msgstr "E600: Falta «:endtry»"
+
+#: globals.h:1199
+msgid "E170: Missing :endwhile"
+msgstr "E170: Falta «:endwhile»"
+
+#: globals.h:1200
+msgid "E588: :endwhile without :while"
+msgstr "E588: «:endwhile» sin «:while»."
+
+#: globals.h:1202
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: El fichero ya existe (use ! para sobreescribir)"
+
+#: globals.h:1203
+msgid "E472: Command failed"
+msgstr "E472: Falló el comando"
+
+#: globals.h:1205
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Conjunto de fuentes de impresión desconocido: %s"
+
+#: globals.h:1209
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Fuente de impresión desconocida: %s"
+
+#: globals.h:1212
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: La fuente de impresión «%s» no es de ancho fijo"
+
+#: globals.h:1214
+msgid "E473: Internal error"
+msgstr "E473: Error interno."
+
+#: globals.h:1215
+msgid "Interrupted"
+msgstr "Interrumpido"
+
+#: globals.h:1216
+msgid "E14: Invalid address"
+msgstr "E14: Dirección no válida"
+
+#: globals.h:1217
+msgid "E474: Invalid argument"
+msgstr "E474: argumento no válido"
+
+#: globals.h:1218
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Argumento no válido: %s."
+
+#: globals.h:1220
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Expresión no válida: %s"
+
+#: globals.h:1222
+msgid "E16: Invalid range"
+msgstr "E16: Rango no válido"
+
+#: globals.h:1223
+msgid "E476: Invalid command"
+msgstr "E476: Nombre de comando no válido"
+
+#: globals.h:1225
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: «%s» es un directorio"
+
+#: globals.h:1228
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Caracteres inesperados delante de «=»"
+
+#: globals.h:1231
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Falló la llamada a biblioteca para «%s»()"
+
+#: globals.h:1237
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Could not load library function %s"
+
+#: globals.h:1239
+msgid "E19: Mark has invalid line number"
+msgstr "E19: La marca tiene un número de línea no válido"
+
+#: globals.h:1240
+msgid "E20: Mark not set"
+msgstr "E20: Marca sin poner"
+
+#: globals.h:1241
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: No se pueden hacer cambios, «modifiable» está desactivado"
+
+#: globals.h:1242
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Demasiados «scripts» anidados"
+
+#: globals.h:1243
+msgid "E23: No alternate file"
+msgstr "E23: No hay un fichero alternativo"
+
+#: globals.h:1244
+msgid "E24: No such abbreviation"
+msgstr "E24: Tal abreviatura no existe"
+
+#: globals.h:1245
+msgid "E477: No ! allowed"
+msgstr "E477: «!» no está permitido."
+
+#: globals.h:1247
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: No se puede usar el GUI: no se ha activado al compilar."
+
+#: globals.h:1250
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: No se puede usar el hebreo: no se ha activado al compilar\n"
+
+#: globals.h:1253
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E27: No se puede usar el persa (farsi): no se ha activado al compilar\n"
+
+#: globals.h:1256
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: No se puede usar el árabe: no se ha activado al compilar\n"
+
+#: globals.h:1259
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: No existe el grupo de realzado con ese nombre: %s"
+
+#: globals.h:1261
+msgid "E29: No inserted text yet"
+msgstr "E29: Aún no ha insertado texto."
+
+#: globals.h:1262
+msgid "E30: No previous command line"
+msgstr "E30: No hay una línea de comandos previa"
+
+#: globals.h:1263
+msgid "E31: No such mapping"
+msgstr "E31: No existe tal asociación."
+
+#: globals.h:1264
+msgid "E479: No match"
+msgstr "E479: No hay coincidencia."
+
+#: globals.h:1265
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: No coincide: %s"
+
+#: globals.h:1266
+msgid "E32: No file name"
+msgstr "E32: No hay un nombre de fichero."
+
+#: globals.h:1267
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: No existe una expresión regular de sustitución previa."
+
+#: globals.h:1268
+msgid "E34: No previous command"
+msgstr "E34: No existe un comando previo."
+
+#: globals.h:1269
+msgid "E35: No previous regular expression"
+msgstr "E35: No existe una expresión regular previa."
+
+#: globals.h:1270
+msgid "E481: No range allowed"
+msgstr "E481: El rango no está permitido."
+
+#: globals.h:1272
+msgid "E36: Not enough room"
+msgstr "E36: No hay espacio suficiente."
+
+#: globals.h:1275
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: El servidor «%s» no está registrado."
+
+#: globals.h:1277
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: No se puede crear el fichero «%s»"
+
+#: globals.h:1278
+msgid "E483: Can't get temp file name"
+msgstr "E483: No puedo obtener el nombre del fichero temporal."
+
+#: globals.h:1279
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: No puedo abrir el fichero «%s»"
+
+#: globals.h:1280
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: No puedo leer el fichero «%s»."
+
+#: globals.h:1281
+msgid "E37: No write since last change (add ! to override)"
+msgstr ""
+"E37: No se ha guardado el fichero desde el último cambio (añada ! para "
+"forzar)."
+
+#: globals.h:1282
+msgid "E38: Null argument"
+msgstr "E38: Argumento nulo."
+
+#: globals.h:1284
+msgid "E39: Number expected"
+msgstr "E39: Esperaba un número."
+
+#: globals.h:1287
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: No puedo abrir el fichero de errores %s."
+
+#: globals.h:1290
+msgid "E233: cannot open display"
+msgstr "E233: No se puede abrir la pantalla."
+
+#: globals.h:1292
+msgid "E41: Out of memory!"
+msgstr "E41: ¡Memoria agotada!"
+
+#: globals.h:1294
+msgid "Pattern not found"
+msgstr "No se encontró el patrón de búsqueda."
+
+#: globals.h:1296
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: No se encontró el patrón de búsqueda: %s"
+
+#: globals.h:1297
+msgid "E487: Argument must be positive"
+msgstr "E487: El argumento debe ser positivo."
+
+#: globals.h:1299
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: No puedo regresar al directorio previo."
+
+#: globals.h:1303
+msgid "E42: No Errors"
+msgstr "E42: No hay errores"
+
+#: globals.h:1305
+msgid "E43: Damaged match string"
+msgstr "E43: Cadena de concidencia dañada."
+
+#: globals.h:1306
+msgid "E44: Corrupted regexp program"
+msgstr "E44: El programa «regexp» está corrupto."
+
+#: globals.h:1307
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: Está activa la opción «readonly» (añada «!» para forzar)."
+
+#: globals.h:1309
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: No se puede definir la variable de sólo lectura «%s»."
+
+#: globals.h:1312
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Error al leer el fichero de errores."
+
+#: globals.h:1315
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: No se permite en el ambiente protegido."
+
+#: globals.h:1317
+msgid "E523: Not allowed here"
+msgstr "E523: No se permite aquí."
+
+#: globals.h:1320
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: La configuración de la pantalla no es válida."
+
+#: globals.h:1322
+msgid "E49: Invalid scroll size"
+msgstr "E49: El tamaño de desplazamiento no válido."
+
+#: globals.h:1323
+msgid "E91: 'shell' option is empty"
+msgstr "E91: La opción «shell» está vacía."
+
+#: globals.h:1325
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: ¡No se pudo leer los datos de los signos!"
+
+#: globals.h:1327
+msgid "E72: Close error on swap file"
+msgstr "E72: Error de cierre en el fichero de intercambio"
+
+#: globals.h:1328
+msgid "E73: tag stack empty"
+msgstr "E73: La pila de «tags» está vacía."
+
+#: globals.h:1329
+msgid "E74: Command too complex"
+msgstr "E74: El comando es demasiado complejo."
+
+#: globals.h:1330
+msgid "E75: Name too long"
+msgstr "E75: El nombre es demasiado largo."
+
+#: globals.h:1331
+msgid "E76: Too many ["
+msgstr "E76: Hay demasiados ["
+
+#: globals.h:1332
+msgid "E77: Too many file names"
+msgstr "E77: Hay demasiados nombres de ficheros."
+
+#: globals.h:1333
+msgid "E488: Trailing characters"
+msgstr "E488: Caracteres en exceso al final de la línea."
+
+#: globals.h:1334
+msgid "E78: Unknown mark"
+msgstr "E78: Marca desconocida."
+
+#: globals.h:1335
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: No puedo expandir los comodines."
+
+#: globals.h:1337
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: «winheight» no puede ser más pequeño que «winminheight»."
+
+#: globals.h:1339
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: «winwidth» no puede ser más pequeño que «winminwidth»."
+
+#: globals.h:1342
+msgid "E80: Error while writing"
+msgstr "E80: Error al escribir el fichero."
+
+#: globals.h:1343
+msgid "Zero count"
+msgstr "El recuento es cero."
+
+#: globals.h:1345
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Usando <SID> en un contexto que no es de «script»"
+
+#: globals.h:1348
+msgid "E449: Invalid expression received"
+msgstr "E449: Recibí una expresión inválida."
+
+#: globals.h:1351
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: La región está protegida, no puedo modificarla."
+
+#~ msgid "\"\n"
+#~ msgstr "»\n"
+
+#~ msgid " BLOCK"
+#~ msgstr " BLOQUE"
+
+#~ msgid " LINE"
+#~ msgstr " LÍNEA"
diff --git a/src/po/fr.po b/src/po/fr.po
new file mode 100644
index 000000000..22ae4bd3a
--- /dev/null
+++ b/src/po/fr.po
@@ -0,0 +1,6888 @@
+# French Translation for Vim
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR DindinX <David.Odin@bigfoot.com> 2000.
+# SECOND AUTHOR Adrien Beau <version.francaise@free.fr> 2002, 2003.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Ce fichier n'est pas finalisé ! Le gros du travail a été fait, mais la touche
+# finale reste à apporter. Je pense que tout sera bel et bien fini pour Vim 6.3
+# (hum, c'était censé être le cas pour Vim 6.2).
+#
+# Consultez http://version.francaise.free.fr/ pour les mises à jour de ce
+# fichier, ainsi que pour les versions françaises des menus et du tutoriel.
+#
+# Si vous avez des remarques à faire sur ce fichier, écrivez à
+# version.francaise@free.fr. Cette adresse est consultée régulièrement.
+#
+# En cas d'erreur technique au niveau de version.francaise@free.fr, ou si vous
+# ne recevez aucune réponse plusieurs jours après votre envoi, vérifiez si un
+# message n'a pas été posté sur le site web. Si cette option se révèle
+# infructueuse, essayez de me contacter à mes autres adresses, chez free.fr ou
+# chez yahoo.com. Mon nom d'utilisateur est la concaténation de mon prénom et
+# de mon nom.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# This file still needs work! The rough work has been done, some polishing
+# needs to be applied. I expect everything to be bright and shiny for Vim 6.3
+# (err, that was supposed to be Vim 6.2).
+#
+# Go to http://version.francaise.free.fr/ for updates to this file, and to the
+# French versions of the menus and the tutor.
+#
+# Send your comments about this file by email, to version.francaise@free.fr.
+# This address is checked regularly.
+#
+# In case of technical error at version.francaise@free.fr, or if you don't get
+# any answer several days after writing, check if there is a message at
+# http://version.francaise.free.fr/. If this option fails to work, try to
+# write to my other addresses at free.fr and yahoo.com. Concatene my first and
+# last name to get my username.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# ChangeLog:
+#
+# 2002-03-04 AB Bulk translation (done in 16 hours!)
+# - That's 1.35 msg/min for ya
+# 2002-03-23 AB Initial release (ships with Vim 6.1)
+# - Much cleaner than the first version :)
+# 2002-09-30 AB Patch #200 update (released on web site)
+# - Five new messages
+# - Corrected three typos in printf()-style expressions
+# (thanks Mik)
+# 2003-05-09 AB Patch #474 update (unreleased)
+# - Polishing done on three more files (the three first
+# ones have been reworked, too)
+# - Many comments have been added in the polished
+# section
+# 2003-05-29 AB Vim 6.2 pending release
+# - Finish work on Vim 6.1.474 (quickly!)
+# - Thirty-three new messages (rough translation)
+# - Some of the English messages have been altered
+# (fuzzy entries), deal with it
+# 2003-05-29 AB Vim 6.2 release candidate (sent to Bram Moolenaar)
+# - Update to Vim 6.2f.014 (quickly, too)
+# - Fifty-nine new messages (rough translation)
+# - Hundreds of error messages numbers added (wow)
+#
+# Translated: 1392/1392 (100.00%)
+#
+# Polishing done on:
+# buffer.c
+# diff.c
+# digraph.c
+# edit.c
+# eval.c
+# ex_cmds.c
+#
+# Other files still to do.
+#
+# Notations used in the comments of the unpolished part of this file:
+# TODO There's work to do there, and it's important
+# todo There's work to do there, but it's less important
+# (no comment) Perhaps there's work to do there?
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Français)\n"
+"POT-Creation-Date: 2003-05-28 23:09+0200\n"
+"PO-Revision-Date: 2003-05-29 04:01+0200\n"
+"Last-Translator: Adrien Beau <version.francaise@free.fr>\n"
+"Language-Team: Adrien Beau <version.francaise@free.fr>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO_8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Aucun tampon ne peut être alloué, Vim doit s'arrêter"
+
+# AB - La situation est probablement plus grave que la version anglaise ne le
+# laisse entendre (voir l'aide en ligne). La version française est plus
+# explicite.
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: L'allocation du tampon a échoué: arrêtez Vim, libérez de la mémoire"
+
+#: buffer.c:797
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Aucun tampon n'a été déchargé"
+
+#: buffer.c:799
+msgid "E516: No buffers were deleted"
+msgstr "E516: Aucun tampon n'a été effacé"
+
+#: buffer.c:801
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Aucun tampon n'a été détruit"
+
+#: buffer.c:809
+msgid "1 buffer unloaded"
+msgstr "1 tampon a été déchargé"
+
+#: buffer.c:811
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d tampons ont été déchargés"
+
+#: buffer.c:816
+msgid "1 buffer deleted"
+msgstr "1 tampon a été effacé"
+
+#: buffer.c:818
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d tampons ont été effacés"
+
+#: buffer.c:823
+msgid "1 buffer wiped out"
+msgstr "1 tampon a été détruit"
+
+#: buffer.c:825
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d tampons ont été détruits"
+
+# AB - La version française est meilleure que la version anglaise.
+#: buffer.c:886
+msgid "E84: No modified buffer found"
+msgstr "E84: Aucun tampon n'est modifié"
+
+#. back where we started, didn't find anything.
+#: buffer.c:925
+msgid "E85: There is no listed buffer"
+msgstr "E85: Aucun tampon n'est listé"
+
+# AB - Vu le code source, la version française est meilleure que la
+# version anglaise.
+#: buffer.c:937
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Le tampon %ld n'existe pas"
+
+# AB - Je ne suis pas sûr que l'on puisse obtenir ce message.
+#: buffer.c:940
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Impossible d'aller après le dernier tampon"
+
+# AB - Je ne suis pas sûr que l'on puisse obtenir ce message.
+#: buffer.c:942
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Impossible d'aller avant le premier tampon"
+
+#: buffer.c:966
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: Le tampon %ld n'a pas été enregistré (ajoutez ! pour passer outre)"
+
+#: buffer.c:982
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Impossible de décharger le dernier tampon"
+
+#: buffer.c:1500
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Alerte: La liste des noms de fichier déborde"
+
+# AB - Vu le code source, la version française est meilleure que la
+# version anglaise. Ce message est similaire au message E86.
+#: buffer.c:1671
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Le tampon %ld n'existe pas"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+#: buffer.c:1902
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Plusieurs tampons correspondent à %s"
+
+#: buffer.c:1904
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Aucun tampon ne correspond à %s"
+
+#: buffer.c:2299 ex_docmd.c:6560
+#, c-format
+msgid "line %ld"
+msgstr "ligne %ld"
+
+#: buffer.c:2382
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Un tampon porte déjà ce nom"
+
+#: buffer.c:2675
+msgid " [Modified]"
+msgstr "[Modifié]"
+
+# AB - "[Inédité]" est plus correct, mais sonne faux.
+#: buffer.c:2680
+msgid "[Not edited]"
+msgstr "[Pas édité]"
+
+#: buffer.c:2685
+msgid "[New file]"
+msgstr "[Nouveau fichier]"
+
+#: buffer.c:2686
+msgid "[Read errors]"
+msgstr "[Erreurs de lecture]"
+
+# AB - La version courte, "[RO]", devrait-elle être traduite par "[LS]" ?
+# Il faudrait faire un sondage auprès des utilisateurs francophones.
+#: buffer.c:2688 fileio.c:1914
+msgid "[readonly]"
+msgstr "[lecture-seule]"
+
+#: buffer.c:2703
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 ligne --%d%%--"
+
+#: buffer.c:2705
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld lignes --%d%%--"
+
+# AB - Faut-il remplacer "sur" par "de" ?
+#: buffer.c:2712
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ligne %ld sur %ld --%d%%-- col "
+
+#: buffer.c:2813
+msgid "[No file]"
+msgstr "[Pas de fichier]"
+
+#. must be a help buffer
+#: buffer.c:2853
+msgid "help"
+msgstr "aide"
+
+#: buffer.c:3412 screen.c:4996
+msgid "[help]"
+msgstr "[aide]"
+
+# AB - "Prévisualisation" prend beaucoup de place. "Prévision" est une
+# traduction littérale et brève, mais qui risque fort d'être mal comprise.
+# J'ai finalement choisi d'utiliser une abréviation, mais cela ne me
+# satisfait pas.
+#: buffer.c:3444 screen.c:5002
+msgid "[Preview]"
+msgstr "[Prévisu]"
+
+#: buffer.c:3724
+msgid "All"
+msgstr "Tout"
+
+#: buffer.c:3724
+msgid "Bot"
+msgstr "Bas"
+
+# AB - Attention, on passe de trois à quatre lettres.
+#: buffer.c:3726
+msgid "Top"
+msgstr "Haut"
+
+#: buffer.c:4470
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Liste des tampons:\n"
+
+#: buffer.c:4503
+msgid "[Error List]"
+msgstr "[Liste d'erreurs]"
+
+# AB - Ce message est déjà présent quelques lignes plus haut.
+#: buffer.c:4516 memline.c:1501
+msgid "[No File]"
+msgstr "[Pas de fichier]"
+
+#: buffer.c:4819
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Symboles ---"
+
+#: buffer.c:4838
+#, c-format
+msgid "Signs for %s:"
+msgstr "Symboles dans %s:"
+
+#: buffer.c:4844
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ligne=%ld id=%d nom=%s"
+
+# AB - Je n'ai pas trouvé de traduction satisfaisante au verbe "diff". Comme
+# Vim fait en pratique appel au programme "diff" pour evaluer les
+# différences entre fichiers, "to diff" a été traduit par "utiliser diff"
+# et d'autres expressions appropriées.
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Impossible d'utiliser diff sur plus de %ld tampons"
+
+# AB - La version française est meilleure que la version anglaise.
+#: diff.c:651
+msgid "E97: Cannot create diffs"
+msgstr "E97: diff ne fonctionne pas"
+
+# AB - Ceci est un titre de boîte de dialogue.
+#: diff.c:750
+msgid "Patch file"
+msgstr "Sélectionner un patch - Vim"
+
+# AB - La version française est correcte, mais trop technique.
+# AB - "output" est difficile à traduire clairement.
+#: diff.c:1001
+msgid "E98: Cannot read diff output"
+msgstr "E98: Le fichier intermédiaire produit par diff n'a pu être lu"
+
+#: diff.c:1742
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Le tampon courant n'est pas en mode diff"
+
+#: diff.c:1754
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Aucun autre tampon n'est en mode diff"
+
+# AB - La version française est meilleure que la version anglaise, mais elle
+# peut être améliorée.
+#: diff.c:1762
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Plus de deux tampons sont en mode diff, soyez plus précis"
+
+#: diff.c:1785
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Le tampon %s est introuvable"
+
+#: diff.c:1791
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Le tampon %s n'est pas en mode diff"
+
+# AB - Je cherche une traduction plus concise pour "escape".
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Un digraphe ne peut contenir le caractère d'échappement"
+
+# AB - La version française est trop verbeuse.
+#: digraph.c:2344
+msgid "E544: Keymap file not found"
+msgstr "E544: Le fichier descripteur de clavier est introuvable"
+
+# AB - La version française est meilleure que la version anglaise.
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :loadkeymap ne peut être utilisé que dans un script Vim"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Complétion de mot-clé (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " mode ^X (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Complétion locale de mot-clé (^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Complétion de ligne entière (^L/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Complétion de nom de fichier (^F/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Complétion d'étiquette (^]/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+# AB - J'ai dû avoir une bonne raison de faire une version française aussi
+# différente de la version anglaise. Il me faut la retrouver.
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Complétion globale de mot-clé (^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Complétion de définition (^D/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+# AB - Trouver une meilleure formulation que "selon le".
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Complétion selon le dictionnaire (^K/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+# AB - Trouver une meilleure formulation que "selon le".
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Complétion selon le thésaurus (^T/^N/^P)"
+
+# AB - Remplacer "complétion" par "complètement" ? Voir l'éthymologie
+# d'"accrétion".
+# AB - La version française est meilleure que la version anglaise.
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Complétion de commande Vim (^V/^N/^P)"
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+# Il faut éviter de le faire trop long. Je pense que la version française
+# est suffisamment compréhensible dans le contexte dans lequel elle est
+# affichée.
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Fin du paragraphe"
+
+#: edit.c:955
+msgid "'thesaurus' option is empty"
+msgstr "L'option 'thesaurus' est vide"
+
+#: edit.c:1159
+msgid "'dictionary' option is empty"
+msgstr "L'option 'dictionary' est vide"
+
+#: edit.c:2144
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Examen du dictionnaire: %s"
+
+#: edit.c:2350
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insertion) Défilement (^E/^Y)"
+
+#: edit.c:2352
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (remplacement) Défilement (^E/^Y)"
+
+#: edit.c:2666
+#, c-format
+msgid "Scanning: %s"
+msgstr "Examen: %s"
+
+#: edit.c:2701
+msgid "Scanning tags."
+msgstr "Examen des étiquettes."
+
+# AB - Cette chaîne de caractères est ajoutée en début de ligne lorsqu'une
+# opération de complétion est répétée (typiquement avec CTRL-X CTRL-N).
+# Que ce soit en anglais ou en français, il y a un problème de majuscules.
+# Bien qu'insatisfaisante, cette traduction semble optimale.
+#: edit.c:3363
+msgid " Adding"
+msgstr " Ajout"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3412
+msgid "-- Searching..."
+msgstr "-- Recherche en cours..."
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+# AB - Faut-il utiliser "origine" ou "originel" au lieu d'"original" ?
+#: edit.c:3468
+msgid "Back at original"
+msgstr "De retour à l'original"
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+#: edit.c:3473
+msgid "Word from other line"
+msgstr "Mot d'une autre ligne"
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+#: edit.c:3478
+msgid "The only match"
+msgstr "La seule correspondance"
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+# AB - Faut-il remplacer "sur" par "de" ?
+#: edit.c:3537
+#, c-format
+msgid "match %d of %d"
+msgstr "Correspondance %d sur %d"
+
+# AB - Ce texte s'ajoute à la fin d'un des messages de complétion ci-dessus.
+#: edit.c:3540
+#, c-format
+msgid "match %d"
+msgstr "Correspondance %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:979
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Variable inconnue: %s"
+
+# AB - La version française est meilleure que la version anglaise.
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:1275
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Il manque '(' après %s"
+
+#: eval.c:1380 eval.c:1394
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Variable inexistante: %s"
+
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:1650
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Il manque ':' après '?'"
+
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:2266
+msgid "E110: Missing ')'"
+msgstr "E110: Il manque ')'"
+
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:2323
+msgid "E111: Missing ']'"
+msgstr "E111: Il manque ']'"
+
+# AB - La version française est meilleure que la version anglaise.
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:2399
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Il manque un nom d'option après %s"
+
+#: eval.c:2417
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Option inconnue: %s"
+
+# AB - La version française est meilleure que la version anglaise, qui est
+# erronée, d'ailleurs : il s'agit d'une "double quote" et non d'une
+# "quote".
+#: eval.c:2481
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Il manque \" à la fin de %s"
+
+# AB - La version française est meilleure que la version anglaise.
+#: eval.c:2613
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Il manque ' à la fin de %s"
+
+# AB - La version française est meilleure que la version anglaise.
+#: eval.c:2963
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Un argument de la fonction %s est invalide"
+
+#: eval.c:2992
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Fonction inconnue: %s"
+
+#: eval.c:2993
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: La fonction %s a trop d'arguments"
+
+#: eval.c:2994
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: La fonction %s n'a pas assez d'arguments"
+
+#: eval.c:2995
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ne peut être utilisé en dehors d'un script: %s"
+
+# AB - Texte par défaut du bouton de la boîte de dialogue affichée par la
+# fonction confirm().
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3585 gui.c:4254 gui_gtk.c:1997
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4120
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld lignes: "
+
+# AB - Textes des boutons de la boîte de dialogue affichée par inputdialog().
+#: eval.c:5345
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&Ok\n"
+"&Annuler"
+
+# AB - La version française est meilleure que la version anglaise.
+#: eval.c:5385
+msgid "called inputrestore() more often than inputsave()"
+msgstr "inputrestore() a été appelé plus de fois qu'inputsave()"
+
+# AB - À mon avis, la version anglaise est erronée.
+#: eval.c:6300
+msgid "E240: No connection to Vim server"
+msgstr "E240: Pas de connection au serveur X"
+
+#: eval.c:6397
+msgid "E277: Unable to read a server reply"
+msgstr "E277: La réponse du serveur n'a pu être lue"
+
+# AB - La version française est meilleure que la version anglaise.
+#: eval.c:6425
+msgid "E258: Unable to send to client"
+msgstr "E258: La réponse n'a pu être envoyée au client"
+
+# AB - La version française est meilleure que la version anglaise.
+#: eval.c:6473
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: L'envoi au serveur %s à échoué"
+
+#: eval.c:6573
+msgid "(Invalid)"
+msgstr "(Invalide)"
+
+#: eval.c:7688
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Variable indéfinie: %s"
+
+# AB - "illégal" est un terme trop fort à mon goût.
+#: eval.c:8120
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: Nom de variable illégal: %s"
+
+#: eval.c:8408
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: La fonction %s existe déjà (ajoutez ! pour la remplacer)"
+
+#: eval.c:8475
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Fonction indéfinie: %s"
+
+# AB - La version française est plus consistante que la version anglaise.
+# AB - Je suis partagé entre la concision d'une traduction assez littérale et
+# la lourdeur d'une traduction plus correcte.
+#: eval.c:8488
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Il manque '(' après %s"
+
+# AB - "illégal" est un terme trop fort à mon goût.
+#: eval.c:8521
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Argument illégal: %s"
+
+#: eval.c:8600
+msgid "E126: Missing :endfunction"
+msgstr "E126: Il manque :endfunction"
+
+# AB - Il est difficile de créer une version française qui fasse moins de 80
+# caractères de long, nom de la fonction compris : "It is in use" est une
+# expression très dense. Traductions possibles : "elle est utilisée",
+# "elle s'exécute" ou "elle est occupée".
+#: eval.c:8683
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Impossible de redéfinir %s: cette fonction est occupée"
+
+#: eval.c:8751
+msgid "E129: Function name required"
+msgstr "E129: Nom de fonction requis"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+#: eval.c:8802
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: %s ne commence pas par une majuscule"
+
+#: eval.c:8994
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Fonction indéfinie: %s"
+
+# AB - Il est difficile de créer une version française qui fasse moins de 80
+# caractères de long, nom de la fonction compris : "It is in use" est une
+# expression très dense. Traductions possibles : "elle est utilisée",
+# "elle s'exécute" ou "elle est occupée".
+#: eval.c:8999
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Impossible d'effacer %s: cette fonction est occupée"
+
+# AB - Vérifier dans la littérature technique s'il n'existe pas une meilleure
+# traduction pour "function call depth".
+#: eval.c:9047
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: La profondeur d'appel de fonction est supérieure à 'maxfuncdepth'"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#. always scroll up, don't overwrite
+#: eval.c:9100
+#, c-format
+msgid "calling %s"
+msgstr "appel de %s"
+
+# AB - Vérifier.
+#: eval.c:9162
+#, c-format
+msgid "%s aborted"
+msgstr "%s annulée"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: eval.c:9164
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s a retourné #%ld"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: eval.c:9171
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s a retourné \"%s\""
+
+# AB - Ce texte fait partie d'un message de débogage.
+#. always scroll up, don't overwrite
+#: eval.c:9187 ex_cmds2.c:2244
+#, c-format
+msgid "continuing in %s"
+msgstr "de retour dans %s"
+
+#: eval.c:9213
+msgid "E133: :return not inside a function"
+msgstr "E133: :return n'est pas à l'intérieur d'une fonction"
+
+# AB - La version française est capitalisée pour être en accord avec les autres
+# commentaires enregistrés dans le fichier viminfo.
+#: eval.c:9544
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# Variables globales:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Octal %03o"
+
+# AB - La version anglaise est très mauvaise, ce qui m'oblige a inventer une
+# version française.
+#: ex_cmds.c:433
+msgid "E134: Move lines into themselves"
+msgstr "E134: La destination est dans la plage d'origine"
+
+#: ex_cmds.c:502
+msgid "1 line moved"
+msgstr "1 ligne déplacée"
+
+#: ex_cmds.c:504
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld lignes déplacées"
+
+#: ex_cmds.c:909
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld lignes filtrées"
+
+# AB - J'ai volontairement omis l'astérisque initiale car je pense que le
+# motif "Filter*" décrit plus clairement les quatre autocommandes liées
+# au filtrage (FilterReadPre, FilterReadPost, FilterWritePre et
+# FilterWritePost) que "*Filter*" que l'on confond avec une tentative de
+# mise en valeur.
+#: ex_cmds.c:937
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr ""
+"E135: Les autocommandes Filter* ne doivent pas changer le tampon courant"
+
+# AB - Il faut respecter l'esprit plus que la lettre. Dans le cas présent,
+# nettement plus.
+#: ex_cmds.c:1022
+msgid "[No write since last change]\n"
+msgstr "[Attention: tout n'est pas enregistré]\n"
+
+# AB - Le numéro et le message d'erreur (%s ci-dessous) et le "numéro" de ligne
+# sont des chaînes de caractères dont le contenu est à la discrétion de
+# l'appelant de la fonction viminfo_error().
+#: ex_cmds.c:1268
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s à la ligne "
+
+# AB - La version française est meilleure que la version anglaise.
+#: ex_cmds.c:1273
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr ""
+"E136: Il y a trop d'erreurs; interruption de la lecture du fichier viminfo"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: ex_cmds.c:1308
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Lecture du fichier viminfo \"%s\"%s%s%s"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: ex_cmds.c:1309
+msgid " info"
+msgstr " info"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: ex_cmds.c:1310
+msgid " marks"
+msgstr " marques"
+
+# AB - Ce texte fait partie d'un message de débogage.
+#: ex_cmds.c:1311
+msgid " FAILED"
+msgstr " ÉCHEC"
+
+# AB - J'espère que la plupart des utilisateurs aura l'idée d'aller vérifier
+# ses droits d'accès.
+# AB - Le mot "viminfo" a été retiré pour que le message ne dépasse pas 80
+# caractères dans le cas courant où %s = /home/12345678/.viminfo
+#: ex_cmds.c:1403
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: L'écriture dans le fichier %s est interdite"
+
+# AB - Le point d'exclamation est superflu.
+# AB - Le mot "viminfo" a été retiré pour que le message ne dépasse pas 80
+# caractères dans le cas courant où %s = /home/12345678/.viminfo
+#: ex_cmds.c:1528
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Impossible d'écrire le fichier %s"
+
+# AB - Ce texte est un message de débogage.
+#: ex_cmds.c:1536
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Écriture du fichier viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1634
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Ce fichier viminfo a été généré par Vim %s.\n"
+
+# AB - Les deux versions, bien que différentes, se valent.
+#: ex_cmds.c:1636
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Vous pouvez l'éditer, mais soyez prudent.\n"
+"\n"
+
+# AB - Je préfère "Valeur de 'encoding'" à "Valeur d''encoding'".
+#: ex_cmds.c:1638
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' dans lequel ce fichier a été écrit\n"
+
+# AB - Ce texte est passé en argument à la fonction viminfo_error().
+# AB - "illégal" est un terme trop fort à mon goût.
+#: ex_cmds.c:1737
+msgid "Illegal starting char"
+msgstr "Caractère initial illégal"
+
+# AB - Ceci est un titre de boîte de dialogue. Vérifier que la version
+# française est correcte pour les trois références ; j'ai un doute quant
+# à la troisième.
+#: ex_cmds.c:2082 ex_cmds.c:2347 ex_cmds2.c:754
+msgid "Save As"
+msgstr "Enregistrer sous - Vim"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2125
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Le fichier est chargé dans un autre tampon"
+
+# AB - Ceci est un contenu de boîte de dialogue (éventuellement en mode texte).
+# AB - La version française est meilleure que la version anglaise.
+#: ex_cmds.c:2159
+msgid "Write partial file?"
+msgstr "Perdre une partie du fichier ?"
+
+# AB - La version française est nettement meilleure que la version anglaise.
+#: ex_cmds.c:2166
+msgid "E140: Use ! to write partial buffer"
+msgstr ""
+"E140: Une partie du fichier serait perdue (ajoutez ! pour passer outre)"
+
+# AB - Ceci est un contenu de boîte de dialogue (éventuellement en mode texte).
+#: ex_cmds.c:2281
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Écraser le fichier %.*s existant ?"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Pas de nom de fichier pour le tampon %ld"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+#: ex_cmds.c:2390
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: L'option 'nowrite' est activée et empêche toute écriture de fichier"
+
+# AB - Ceci est un contenu de boîte de dialogue (éventuellement en mode texte).
+# AB - "activée pour" n'est pas une formulation très heureuse.
+#: ex_cmds.c:2410
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"L'option 'readonly' est activée pour %.*s.\n"
+"Voulez-vous quand même enregistrer ?"
+
+# AB - Ceci est un titre de boîte de dialogue.
+#: ex_cmds.c:2575
+msgid "Edit File"
+msgstr "Ouvrir un fichier - Vim"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+# AB - J'hésite à ajouter "à sa création" après le nom du tampon. Ce message
+# devrait n'être affiché qu'après une tentative d'ouverture de fichier,
+# la version actuelle devrait donc suffire.
+#: ex_cmds.c:3147
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Une autocommande a effacé le tampon %s"
+
+#: ex_cmds.c:3279
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: L'argument de :z n'est pas numérique"
+
+# AB - La version française fera peut-être mieux passer l'amère pillule.
+# La consultation de l'aide donnera l'explication complète à ceux qui
+# ne comprendraient pas à quoi ce message est dû.
+#: ex_cmds.c:3364
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Les commandes externes sont indisponibles"
+
+#: ex_cmds.c:3471
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Les expressions régulières ne peuvent être délimitées par des lettres"
+
+#: ex_cmds.c:3817
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "remplacer par %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4189
+msgid "(Interrupted) "
+msgstr "(Interrompu) "
+
+#: ex_cmds.c:4193
+msgid "1 substitution"
+msgstr "1 substitution"
+
+#: ex_cmds.c:4195
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld substitutions"
+
+#: ex_cmds.c:4198
+msgid " on 1 line"
+msgstr " sur 1 ligne"
+
+#: ex_cmds.c:4200
+#, c-format
+msgid " on %ld lines"
+msgstr " sur %ld lignes"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+# AB - Ce message devrait contenir une référence à :vglobal.
+#: ex_cmds.c:4251
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ne peut exécuter :global"
+
+# AB - Ce message devrait contenir une référence à :vglobal.
+#: ex_cmds.c:4286
+msgid "E148: Regular expression missing from global"
+msgstr "E148: :global doit être suivi par une expression régulière"
+
+# AB - Ce message est utilisé lorsque :vglobal ne trouve rien. Lorsque :global
+# ne trouve rien, c'est "Pattern not found: %s" / "Motif introuvable: %s"
+# qui est utilisé.
+#: ex_cmds.c:4335
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Motif trouvé à chaque ligne: %s"
+
+# AB - Ne pas traduire le dollar.
+# AB - Ce message n'est volontairement pas traduit. En effet, il fait partie
+# d'un groupe de trois messages dans viminfo, dont deux ne sont pas soumis
+# à internationalisation. J'attends que les deux autres messages soient
+# traduisibles pour traduire celui-ci.
+#: ex_cmds.c:4416
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+
+#: ex_cmds.c:4529
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Désolé, pas d'aide pour %s"
+
+#: ex_cmds.c:4563
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Désolé, le fichier d'aide %s est introuvable"
+
+#: ex_cmds.c:5039
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s n'est pas un répertoire"
+
+# AB - La version anglaise est plus précise, mais trop technique.
+#: ex_cmds.c:5067
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Impossible d'écrire %s"
+
+# AB - La version anglaise est plus précise, mais trop technique.
+#: ex_cmds.c:5102
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Impossible de lire %s"
+
+# AB - L'étiquette la plus longue fait 27 caractères. Le nom de fichier le plus
+# long fait 12 caractères. Il faudrait donc idéalement faire une
+# traduction de 40 caractères ou moins. Ce qui est loin d'être le cas
+# présent.
+#: ex_cmds.c:5181
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: L'étiquette \"%s\" apparaît deux fois dans le fichier %s"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+#: ex_cmds.c:5288
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Commande inconnue: :sign %s"
+
+# AB - La version française est meilleure que la version anglaise.
+#: ex_cmds.c:5308
+msgid "E156: Missing sign name"
+msgstr "E156: Il manque le nom du symbole"
+
+#: ex_cmds.c:5354
+msgid "E612: Too many signs defined"
+msgstr "E612: Trop de symboles sont définis"
+
+# AB - Cette traduction ne me satisfait pas.
+#: ex_cmds.c:5421
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: La version texte du symbole est invalide: %s"
+
+#: ex_cmds.c:5452 ex_cmds.c:5638
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Symbole inconnu: %s"
+
+# AB - La version française est meilleure que la version anglaise.
+#: ex_cmds.c:5498
+msgid "E159: Missing sign number"
+msgstr "E159: Il manque l'ID du symbole"
+
+# AB - Vu le code source, la version française est meilleure que la
+# version anglaise. Ce message est similaire au message E102.
+#: ex_cmds.c:5578
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Le tampon %s est introuvable"
+
+# AB - Vu le code source, la version française est meilleure que la
+# version anglaise.
+#: ex_cmds.c:5617
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Le symbole %ld est introuvable"
+
+#: ex_cmds.c:5788
+msgid "[Deleted]"
+msgstr "[Effacé]"
+
+# AB - La version française de la première phrase ne me satisfait pas.
+#: ex_cmds2.c:83
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Début du déboguage. Tapez \"cont\" pour continuer."
+
+#: ex_cmds2.c:87 ex_docmd.c:854
+#, c-format
+msgid "line %ld: %s"
+msgstr "ligne %ld: %s"
+
+#: ex_cmds2.c:89
+#, c-format
+msgid "cmd: %s"
+msgstr "cmde: %s"
+
+#: ex_cmds2.c:281
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Point d'interruption dans %s%s ligne %ld"
+
+#: ex_cmds2.c:531
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Le point d'interruption %s est introuvable"
+
+#: ex_cmds2.c:557
+msgid "No breakpoints defined"
+msgstr "Aucun point d'interruption n'est défini"
+
+# AB - Le deuxième %s est remplacé par "func" ou "file" sans que l'on puisse
+# traduire ces mots.
+#: ex_cmds2.c:562
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ligne %ld"
+
+# AB - "changes to" est redondant et a été omis de la version française.
+#: ex_cmds2.c:777
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Enregistrer %.*s ?"
+
+# AB - Si les parenthèses posent problème, il faudra remettre les guillements
+# ci-dessus.
+#: ex_cmds2.c:779 ex_docmd.c:8917
+msgid "Untitled"
+msgstr "(sans titre)"
+
+# AB - Il faut respecter l'esprit plus que la lettre.
+# AB - Ce message est similaire au message E89.
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Le tampon %s n'a pas été enregistré"
+
+# ## HERE ###
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Alerte: Entrée inattendue dans un autre tampon (vérifier autocmdes)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Il n'y a qu'un seul fichier à éditer"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Ne peut aller avant le premier fichier"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Ne peut aller au delà du dernier fichier"
+
+#: ex_cmds2.c:1841
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Recherche de \"%s\" dans \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Recherche de \"%s\""
+
+#: ex_cmds2.c:1884
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "introuvable dans 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1918
+msgid "Source Vim script"
+msgstr "Sourcer un script - Vim"
+
+#: ex_cmds2.c:2069
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Ne peut sourcer un répertoire: \"%s\""
+
+#: ex_cmds2.c:2099
+#, c-format
+msgid "could not source \"%s\""
+msgstr "pas pu sourcer \"%s\""
+
+#: ex_cmds2.c:2101
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "ligne %ld: pas pu sourcer \"%s\""
+
+#: ex_cmds2.c:2115
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "sourçage \"%s\""
+
+# TODO
+#: ex_cmds2.c:2117
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "ligne %ld: sourçage de \"%s\""
+
+# todo
+#: ex_cmds2.c:2242
+#, c-format
+msgid "finished sourcing %s"
+msgstr "fin du sourçage de %s"
+
+#: ex_cmds2.c:2580
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Warning: Mauvais séparateur de ligne, ^M manque peut-être"
+
+#: ex_cmds2.c:2629
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding utilisé en dehors d'un fichier sourcé"
+
+# todo
+#: ex_cmds2.c:2662
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish utilisé en dehors d'un fichier sourcé"
+
+#: ex_cmds2.c:3105
+#, c-format
+msgid "Page %d"
+msgstr "Page %d"
+
+#: ex_cmds2.c:3261
+msgid "No text to be printed"
+msgstr "Pas de texte à imprimer"
+
+#: ex_cmds2.c:3339
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Impression de la page %d (%d%%)"
+
+#: ex_cmds2.c:3348
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Copie %d de %d"
+
+#: ex_cmds2.c:3406
+#, c-format
+msgid "Printed: %s"
+msgstr "Imprimé: %s"
+
+#: ex_cmds2.c:3413
+msgid "Printing aborted"
+msgstr "Impression interrompue"
+
+#: ex_cmds2.c:3778
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Erreur lors de l'écriture du fichier PostScript de sortie"
+
+#: ex_cmds2.c:4053
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Peut pas ouvrir le fichier \"%s\""
+
+#: ex_cmds2.c:4063 ex_cmds2.c:4688
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Peut pas lire le fichier de ressource PostScript \"%s\""
+
+#: ex_cmds2.c:4071
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: \"%s\" n'est pas un fichier de ressource PostScript"
+
+#: ex_cmds2.c:4086 ex_cmds2.c:4106 ex_cmds2.c:4121 ex_cmds2.c:4143
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: \"%s\" n'est pas un fichier de ressource PostScript supporté"
+
+#: ex_cmds2.c:4173
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: La version du fichier de ressource \"%s\" est mauvaise"
+
+#: ex_cmds2.c:4640
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Peut pas ouvrir le fichier PostScript de sortie"
+
+#: ex_cmds2.c:4673
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Peut pas ouvrir le fichier \"%s\""
+
+#: ex_cmds2.c:4792
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Le fichier de ressource PostScript \"prolog.ps\" est introuvable"
+
+#: ex_cmds2.c:4823
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Le fichier de ressource PostScript \"%s.ps\" est introuvable"
+
+# TODO
+#: ex_cmds2.c:4841
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: La conversion du multi-octet à l'encodage \"%s\" a échoué"
+
+#: ex_cmds2.c:4966
+msgid "Sending to printer..."
+msgstr "Envoi à l'imprimante..."
+
+#: ex_cmds2.c:4970
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: L'impression du fichier PostScript a échoué"
+
+#: ex_cmds2.c:4972
+msgid "Print job sent."
+msgstr "Job d'impression envoyé."
+
+#: ex_cmds2.c:5381
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Langage %scourant: \"%s\""
+
+#: ex_cmds2.c:5392
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Pas pu régler le langage sur \"%s\""
+
+#: ex_docmd.c:489
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Démarrage du mode Ex. Tapez \"visual\" pour aller en mode Normal."
+
+#. must be at EOF
+#: ex_docmd.c:525
+msgid "E501: At end-of-file"
+msgstr "E501: À la fin du fichier"
+
+#: ex_docmd.c:627
+msgid "E169: Command too recursive"
+msgstr "E169: Commande trop récursive"
+
+# TODO
+#: ex_docmd.c:1094
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Exception pas attrapée: %s"
+
+# todo
+#: ex_docmd.c:1180
+msgid "End of sourced file"
+msgstr "Fin du fichier sourcé"
+
+#: ex_docmd.c:1181
+msgid "End of function"
+msgstr "Fin de la fonction"
+
+#: ex_docmd.c:1633
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Utilisation ambigüe d'une commande définie par l'utilisateur"
+
+#: ex_docmd.c:1647
+msgid "E492: Not an editor command"
+msgstr "E492: Pas une commande de l'éditeur"
+
+# TODO This message should *so* be E42!
+#: ex_docmd.c:1737
+msgid "E478: Don't panic!"
+msgstr "E478: Ne paniquez pas !"
+
+#: ex_docmd.c:1756
+msgid "E493: Backwards range given"
+msgstr "E493: Champ d'action inversé reçu"
+
+# todo
+#: ex_docmd.c:1765
+msgid "Backwards range given, OK to swap"
+msgstr "Champ d'action inversé reçu, OK pour inverser"
+
+#: ex_docmd.c:1876
+msgid "E494: Use w or w>>"
+msgstr "E494: Utilisez w ou w>>"
+
+#: ex_docmd.c:3463
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Désolé, cette commande n'est pas disponible dans cette version"
+
+#: ex_docmd.c:3649
+msgid "E172: Only one file name allowed"
+msgstr "E172: Un seul nom de fichier autorisé"
+
+#: ex_docmd.c:4211
+msgid "1 more file to edit. Quit anyway?"
+msgstr "Encore un fichier à éditer. Quitter quand même ?"
+
+#: ex_docmd.c:4214
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Encore %d fichiers à éditer. Quitter quand même ?"
+
+#: ex_docmd.c:4221
+msgid "E173: 1 more file to edit"
+msgstr "E173: encore un fichier à éditer"
+
+#: ex_docmd.c:4223
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: encore %ld fichiers à éditer"
+
+#: ex_docmd.c:4318
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: La commande existe déjà: ajoutez ! pour la redéfinir"
+
+# TODO
+#: ex_docmd.c:4428
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Nom Args Champ Complét. Définition"
+
+#: ex_docmd.c:4517
+msgid "No user-defined commands found"
+msgstr "Aucune commande définie par l'utilisateur trouvée"
+
+#: ex_docmd.c:4549
+msgid "E175: No attribute specified"
+msgstr "E175: Pas d'attribut spécifié"
+
+#: ex_docmd.c:4601
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Nombre d'arguments invalide"
+
+#: ex_docmd.c:4616
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: La quantité ne peut être indiquée deux fois"
+
+#: ex_docmd.c:4626
+msgid "E178: Invalid default value for count"
+msgstr "E178: La valeur par défaut de la quantité est invalide"
+
+# TODO
+#: ex_docmd.c:4657
+msgid "E179: argument required for complete"
+msgstr "E179: argument requis pour complete"
+
+#: ex_docmd.c:4689
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Valeur complète invalide: %s"
+
+#: ex_docmd.c:4694
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: La complétion personnalisée requiert une fonction en argument"
+
+#: ex_docmd.c:4699
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Seule la complétion personnalisée prend un argument"
+
+#: ex_docmd.c:4709
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Attribut invalide: %s"
+
+#: ex_docmd.c:4752
+msgid "E182: Invalid command name"
+msgstr "E182: Nom de commande invalide"
+
+# TODO
+#: ex_docmd.c:4767
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Commandes définies par utilisateur doivent commencer par majuscule"
+
+#: ex_docmd.c:4837
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Pas de telle commande définie par l'utilisateur: %s"
+
+#: ex_docmd.c:5294
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Ne peut trouver le style de couleurs %s"
+
+#: ex_docmd.c:5302
+msgid "Greetings, Vim user!"
+msgstr "Bienvenue, utilisateur de Vim !"
+
+#: ex_docmd.c:6013
+msgid "Edit File in new window"
+msgstr "Ouvrir un fichier dans une nouvelle fenêtre - Vim"
+
+#: ex_docmd.c:6300
+msgid "No swap file"
+msgstr "Pas de fichier d'échange"
+
+#: ex_docmd.c:6404
+msgid "Append File"
+msgstr "Ajouter fichier"
+
+#: ex_docmd.c:6468
+msgid "E186: No previous directory"
+msgstr "E186: Pas de répertoire précédent"
+
+#: ex_docmd.c:6550
+msgid "E187: Unknown"
+msgstr "E187: Inconnu"
+
+#: ex_docmd.c:6635
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize requiert deux arguments numériques"
+
+#: ex_docmd.c:6686
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Position de la fenêtre: X %d, Y %d"
+
+# TODO
+#: ex_docmd.c:6691
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: La récupération de la position de la fenêtre n'est pas dispo. ici"
+
+#: ex_docmd.c:6701
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos requiert deux arguments numériques"
+
+# todo
+#: ex_docmd.c:6980
+msgid "Save Redirection"
+msgstr "Enregistrer la redirection"
+
+# todo
+#: ex_docmd.c:7131
+msgid "Save View"
+msgstr "Enregistrer la vue - Vim"
+
+#: ex_docmd.c:7132
+msgid "Save Session"
+msgstr "Enregistrer la session - Vim"
+
+# TODO
+#: ex_docmd.c:7134
+msgid "Save Setup"
+msgstr "Enregistrer les réglages - Vim"
+
+#: ex_docmd.c:7285
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" existe (ajoutez ! pour passer outre)"
+
+#: ex_docmd.c:7290
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Ne peut ouvrir \"%s\" pour y écrire"
+
+#. set mark
+#: ex_docmd.c:7314
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: L'argument doit être une lettre ou une apostrophe avant/arrière"
+
+#: ex_docmd.c:7356
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Appel récursif de :normal trop important"
+
+#: ex_docmd.c:7869
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Pas de nom de fichier alternatif à substituer à '#'"
+
+# TODO
+#: ex_docmd.c:7900
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: pas de nom de ficher d'autocommmande à substituer à \"<afile>\""
+
+# TODO
+#: ex_docmd.c:7908
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: pas de numéro de tampon d'autocommande à substituer à \"<abuf>\""
+
+# TODO
+#: ex_docmd.c:7919
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: pas de nom de corresp. d'autocommande à substituer à \"<amatch>\""
+
+#: ex_docmd.c:7929
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: pas de nom de fichier :source à substituer à \"<sfile>\""
+
+#: ex_docmd.c:7970
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Nom de fichier vide pour '%' ou '#', ne marche qu'avec \":p:h\""
+
+#: ex_docmd.c:7972
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Résulte en une chaîne vide"
+
+#: ex_docmd.c:8899
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Ne peut ouvrir viminfo pour y lire"
+
+#: ex_docmd.c:9072
+msgid "E196: No digraphs in this version"
+msgstr "E196: Pas de digraphes dans cette version"
+
+#: ex_eval.c:423
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Impossible de lancer des exceptions avec 'Vim' comme préfixe"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:509
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Exception lancée: %s"
+
+#: ex_eval.c:556
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Exception terminée: %s"
+
+#: ex_eval.c:557
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Exception défaussée: %s"
+
+#: ex_eval.c:600 ex_eval.c:644
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, ligne %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:618
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Exception attrapée: %s"
+
+#: ex_eval.c:693
+#, c-format
+msgid "%s made pending"
+msgstr "%s a été mise en pause"
+
+#: ex_eval.c:696
+#, c-format
+msgid "%s resumed"
+msgstr "%s a été relancée"
+
+#: ex_eval.c:700
+#, c-format
+msgid "%s discarded"
+msgstr "%s a été défaussée"
+
+#: ex_eval.c:726
+msgid "Exception"
+msgstr "Exception"
+
+#: ex_eval.c:732
+msgid "Error and interrupt"
+msgstr "Erreur et interruption"
+
+#: ex_eval.c:734 gui.c:4253
+msgid "Error"
+msgstr "Erreur"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:736
+msgid "Interrupt"
+msgstr "Interruption: "
+
+#: ex_eval.c:810
+msgid "E579: :if nesting too deep"
+msgstr "E579: Imbrication de :if trop importante"
+
+#: ex_eval.c:847
+msgid "E580: :endif without :if"
+msgstr "E580: :endif sans :if"
+
+#: ex_eval.c:891
+msgid "E581: :else without :if"
+msgstr "E581: :else sans :if"
+
+#: ex_eval.c:894
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif sans :if"
+
+#: ex_eval.c:901
+msgid "E583: multiple :else"
+msgstr "E583: Il ne peut y avoir qu'un seul :else"
+
+#: ex_eval.c:904
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif après :else"
+
+#: ex_eval.c:971
+msgid "E585: :while nesting too deep"
+msgstr "E585: Imbrication de :while trop importante"
+
+#: ex_eval.c:1027
+msgid "E586: :continue without :while"
+msgstr "E586: :continue sans :while"
+
+#: ex_eval.c:1067
+msgid "E587: :break without :while"
+msgstr "E587: :break sans :while"
+
+#: ex_eval.c:1266
+msgid "E601: :try nesting too deep"
+msgstr "E601: Imbrication de :try trop importante"
+
+#: ex_eval.c:1346
+msgid "E603: :catch without :try"
+msgstr "E603: :catch sans :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1368
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch après :finally"
+
+#: ex_eval.c:1501
+msgid "E606: :finally without :try"
+msgstr "E606: :finally sans :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1525
+msgid "E607: multiple :finally"
+msgstr "E607: Il ne peut y avoir qu'un seul :finally"
+
+#: ex_eval.c:1634
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry sans :try"
+
+#: ex_eval.c:1966
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction à l'extérieur d'une fonction"
+
+# TODO
+#: ex_getln.c:3145
+msgid "tagname"
+msgstr "tagname"
+
+# TODO
+#: ex_getln.c:3148
+msgid " kind file\n"
+msgstr " genre de fichier\n"
+
+#: ex_getln.c:4499
+msgid "'history' option is zero"
+msgstr "l'option 'history' vaut zéro"
+
+#: ex_getln.c:4739
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Historique (chronologie décroissante):\n"
+
+#: ex_getln.c:4740
+msgid "Command Line"
+msgstr "Ligne de commande"
+
+#: ex_getln.c:4741
+msgid "Search String"
+msgstr "Chaîne de recherche"
+
+#: ex_getln.c:4742
+msgid "Expression"
+msgstr "Expression"
+
+#: ex_getln.c:4743
+msgid "Input Line"
+msgstr "Ligne d'entrée"
+
+#: ex_getln.c:4773
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar au delà de la longueur de la commande"
+
+#: ex_getln.c:4950
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Tampon ou fenêtre active effacé(e)"
+
+#: fileio.c:373
+msgid "Illegal file name"
+msgstr "Nom de fichier illégal"
+
+#: fileio.c:397 fileio.c:522 fileio.c:2686 fileio.c:2727
+msgid "is a directory"
+msgstr "est un répertoire"
+
+#: fileio.c:399
+msgid "is not a file"
+msgstr "n'est pas un fichier"
+
+#: fileio.c:544 fileio.c:3836
+msgid "[New File]"
+msgstr "[Nouveau fichier]"
+
+#: fileio.c:566
+msgid "[Permission Denied]"
+msgstr "[Autorisation refusée]"
+
+#: fileio.c:670
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Les autocommandes *ReadPre ont rendu le fichier illisible"
+
+# TODO
+#: fileio.c:672
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr ""
+"E201: Autocommandes *ReadPre ne doivent pas changer le contenu du tampon "
+"courant"
+
+#: fileio.c:693
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Lecture de stdin...\n"
+
+#: fileio.c:699
+msgid "Reading from stdin..."
+msgstr "Lecture de stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:944
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: La conversion a rendu le fichier illisble !"
+
+#: fileio.c:1892
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1899
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1906
+msgid "[socket]"
+msgstr "[socket]"
+
+# TODO
+#: fileio.c:1914
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1924
+msgid "[CR missing]"
+msgstr "[CR manquant]"
+
+#: fileio.c:1929
+msgid "[NL found]"
+msgstr "[NL trouvé]"
+
+#: fileio.c:1934
+msgid "[long lines split]"
+msgstr "[longues lignes divisées]"
+
+#: fileio.c:1940 fileio.c:3820
+msgid "[NOT converted]"
+msgstr "[PAS converti]"
+
+#: fileio.c:1945 fileio.c:3825
+msgid "[converted]"
+msgstr "[converti]"
+
+#: fileio.c:1952 fileio.c:3850
+msgid "[crypted]"
+msgstr "[chiffré]"
+
+#: fileio.c:1959
+msgid "[CONVERSION ERROR]"
+msgstr "[ERREUR DE CONVERSION]"
+
+#: fileio.c:1965
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[OCTET ILLÉGAL à la ligne %ld]"
+
+#: fileio.c:1972
+msgid "[READ ERRORS]"
+msgstr "[ERREURS DE LECTURE]"
+
+#: fileio.c:2188
+msgid "Can't find temp file for conversion"
+msgstr "Peut pas trouver de fichier temporaire pour la conversion"
+
+#: fileio.c:2195
+msgid "Conversion with 'charconvert' failed"
+msgstr "La conversion avec 'charconvert' a échoué"
+
+#: fileio.c:2198
+msgid "can't read output of 'charconvert'"
+msgstr "peut pas lire la sortie de 'charconvert'"
+
+#: fileio.c:2601
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Des autocommandes ont effacé ou déchargé le tamon à écrire"
+
+#: fileio.c:2624
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: L'autocommande a changé le nombre de lignes de manière inattendue"
+
+#: fileio.c:2692 fileio.c:2710
+msgid "is not a file or writable device"
+msgstr "n'est pas un fichier ou un périphérique inscriptible"
+
+#: fileio.c:2762
+msgid "is read-only (add ! to override)"
+msgstr "est en lecture seule (ajoutez ! pour passer outre)"
+
+#: fileio.c:3068
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Peut pas écrire dans la copie de secours (ajoutez ! pour passer outre)"
+
+# todo
+#: fileio.c:3080
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr ""
+"E507: Erreur de fermeture de la copie de secours (ajoutez ! pour passer outre)"
+
+# TODO
+#: fileio.c:3082
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr ""
+"E508: Peut pas lire le fichier pour une copie de secours (ajoutez ! pour passer outre)"
+
+#: fileio.c:3098
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Peut pas créer de copie de secours (ajoutez ! pour passer outre)"
+
+# TODO
+#: fileio.c:3201
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Peut pas créer de copie de secours (ajoutez ! pour passer outre)"
+
+# TODO
+#: fileio.c:3263
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr ""
+"E460: La section des ressources serait perdue (ajoutez ! pour passer outre)"
+
+#: fileio.c:3364
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Peut pas trouver le fichier temporaire pour y écrire"
+
+#: fileio.c:3382
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: Peut pas convertir (ajoutez ! pour écrire sans convertir)"
+
+# todo
+#: fileio.c:3417
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Peut pas ouvrir le fichier lié pour y écrire"
+
+#: fileio.c:3421
+msgid "E212: Can't open file for writing"
+msgstr "E212: Peut pas ouvrir le fichier pour y écrire"
+
+#: fileio.c:3671
+msgid "E512: Close failed"
+msgstr "E512: Erreur de fermeture de fichier"
+
+#: fileio.c:3742
+msgid "E513: write error, conversion failed"
+msgstr "E513: Erreur d'écriture, la conversion a échoué"
+
+#: fileio.c:3748
+msgid "E514: write error (file system full?)"
+msgstr "E514: erreur d'écriture (système de fichiers plein ?)"
+
+#: fileio.c:3815
+msgid " CONVERSION ERROR"
+msgstr " ERREUR DE CONVERSION"
+
+#: fileio.c:3831
+msgid "[Device]"
+msgstr "[Périph.]"
+
+#: fileio.c:3836
+msgid "[New]"
+msgstr "[Nouveau]"
+
+#: fileio.c:3858
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:3858
+msgid " appended"
+msgstr " ajouté(s)"
+
+#: fileio.c:3860
+msgid " [w]"
+msgstr " [e]"
+
+#: fileio.c:3860
+msgid " written"
+msgstr " écrit(s)"
+
+#: fileio.c:3913
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: peut pas sauver le fichier original"
+
+#: fileio.c:3935
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: peut pas toucher le fichier original vide"
+
+#: fileio.c:3950
+msgid "E207: Can't delete backup file"
+msgstr "E207: Peut pas effacer la copie de secours"
+
+#: fileio.c:4014
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ALERTE: Le fichier original est peut-être perdu ou endommagé\n"
+
+#: fileio.c:4016
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ne quittez pas l'éditeur sans que le fichier soit bien enregistré !"
+
+#: fileio.c:4105
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4105
+msgid "[dos format]"
+msgstr "[format dos]"
+
+#: fileio.c:4112
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4112
+msgid "[mac format]"
+msgstr "[format mac]"
+
+#: fileio.c:4119
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4119
+msgid "[unix format]"
+msgstr "[format unix]"
+
+#: fileio.c:4146
+msgid "1 line, "
+msgstr "1 ligne, "
+
+#: fileio.c:4148
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld lignes, "
+
+#: fileio.c:4151
+msgid "1 character"
+msgstr "1 caractère"
+
+#: fileio.c:4153
+#, c-format
+msgid "%ld characters"
+msgstr "%ld caractères"
+
+# TODO
+#: fileio.c:4163
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4163
+msgid "[Incomplete last line]"
+msgstr "[Dernière ligne incomplète]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4182
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ALERTE: Le fichier a été modifié depuis que Vim l'a lu !"
+
+#: fileio.c:4184
+msgid "Do you really want to write to it"
+msgstr "Voulez-vous vraiment écrire dedans"
+
+#: fileio.c:5225
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Erreur lors de l'écriture dans \"%s\""
+
+#: fileio.c:5232
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Erreur lors de la fermeture de \"%s\""
+
+#: fileio.c:5235
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Erreur lors de la lecture de \"%s\""
+
+#: fileio.c:5455
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: L'auto-commande FileChangedShell a effacé le tampon"
+
+#: fileio.c:5463
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Alerte: Le fichier \"%s\" n'est plus disponible"
+
+# todo
+#: fileio.c:5476
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: Alerte: Le fichier \"%s\" a changé et le tampon a par ailleurs été modifié dans Vim"
+
+#: fileio.c:5479
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Alerte: Le fichier \"%s\" a changé depuis le début de l'édition"
+
+#: fileio.c:5481
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Alerte: Les permissions de \"%s\" ont changé depuis le début de l'édition"
+
+#: fileio.c:5491
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Alerte: Le fichier \"%s\" a été créé après le début de l'édition"
+
+#: fileio.c:5508
+msgid "Warning"
+msgstr "Alerte"
+
+#: fileio.c:5509
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&Ok\n"
+"&Charge le fichier"
+
+#: fileio.c:5607
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Pas pu préparer le rechargement de \"%s\""
+
+#: fileio.c:5626
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Pas pu recharger \"%s\""
+
+#: fileio.c:6208
+msgid "--Deleted--"
+msgstr "--Effacé--"
+
+#. the group doesn't exist
+#: fileio.c:6368
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Pas de tel groupe: \"%s\""
+
+#: fileio.c:6493
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Caractère illégal après *: %s"
+
+#: fileio.c:6504
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Pas de tel évènement: %s"
+
+#. Highlight title
+#: fileio.c:6653
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-commandes ---"
+
+#: fileio.c:6924
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Impossible d'exécuter une autocommande pour TOUS les évènements"
+
+#: fileio.c:6947
+msgid "No matching autocommands"
+msgstr "Pas d'autocommande correspondante"
+
+#: fileio.c:7267
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommandes trop imbriquées"
+
+#: fileio.c:7535
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commandes pour \"%s\""
+
+#: fileio.c:7543
+#, c-format
+msgid "Executing %s"
+msgstr "Exécution de %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7611
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommande %s"
+
+#: fileio.c:8178
+msgid "E219: Missing {."
+msgstr "E219: { manquant."
+
+#: fileio.c:8180
+msgid "E220: Missing }."
+msgstr "E220: } manquant."
+
+#: fold.c:66
+msgid "E490: No fold found"
+msgstr "E490: Pas trouvé de repli"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Ne peut créer de repli avec la 'foldmethod' courante"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Ne peut effacer le repli avec la 'foldmethod' courante"
+
+#: getchar.c:246
+msgid "E222: Add to read buffer"
+msgstr "E222: Ajout au tampon de lecture"
+
+#: getchar.c:2156
+msgid "E223: recursive mapping"
+msgstr "E223: mapping récursif"
+
+#: getchar.c:3022
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: une abbréviation globale existe déjà pour %s"
+
+#: getchar.c:3025
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: un mapping global existe déjà pour %s"
+
+#: getchar.c:3152
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: une abbréviation existe déjà pour %s"
+
+#: getchar.c:3155
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: un mapping existe déjà pour %s"
+
+#: getchar.c:3219
+msgid "No abbreviation found"
+msgstr "Pas d'abbréviation trouvée"
+
+# TODO
+#: getchar.c:3221
+msgid "No mapping found"
+msgstr "Pas de mapping trouvé"
+
+#: getchar.c:4111
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Mode illégal"
+
+#: gui.c:219
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Impossible de démarrer l'interface graphique"
+
+#: gui.c:348
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Pas pu lire \"%s\""
+
+#: gui.c:473
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' est invalide"
+
+#: gui.c:3939
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Peut pas allouer la couleur %s"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<pas pu ouvrir> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: pas pu récupérer la fonte %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: pas pu revenir dans le répertoire courant"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Chemin:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: pas pu récupérer le répertoire courant"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "Ok"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2634 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Annuler"
+
+# TODO
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Widget scrollbar: Pas pu récupérer la géométrie du thumb pixmap. '^_^"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Vim"
+
+# todo
+#: gui_beval.c:98
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Ne peut créer BalloonEval avec message ET callback"
+
+#: gui_gtk.c:1563
+msgid "Vim dialog..."
+msgstr "Vim"
+
+#: gui_gtk.c:1998 message.c:2757
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Oui\n"
+"&Non\n"
+"&Annuler"
+
+# todo '_' is for hotkey, i guess?
+#: gui_gtk.c:2161
+msgid "Input _Methods"
+msgstr "_Méthodes de saisie"
+
+#: gui_gtk.c:2427 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "Remplacer - Vim"
+
+#: gui_gtk.c:2435 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "Rechercher - Vim"
+
+#: gui_gtk.c:2467 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Rechercher :"
+
+#: gui_gtk.c:2487 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Remplacer par :"
+
+# todo
+#. whole word only button
+#: gui_gtk.c:2519 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Mots entiers seulement"
+
+#. match case button
+#: gui_gtk.c:2532 gui_motif.c:3048
+msgid "Match case"
+msgstr "Respecter casse"
+
+#: gui_gtk.c:2544 gui_motif.c:2990
+msgid "Direction"
+msgstr "Direction"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2556 gui_motif.c:3002
+msgid "Up"
+msgstr "Haut"
+
+#: gui_gtk.c:2560 gui_motif.c:3010
+msgid "Down"
+msgstr "Bas"
+
+#: gui_gtk.c:2586 gui_gtk.c:2588 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Suivant"
+
+#: gui_gtk.c:2605 gui_gtk.c:2607 gui_motif.c:2809
+msgid "Replace"
+msgstr "Remplacer"
+
+#: gui_gtk.c:2618 gui_gtk.c:2620 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Remplacer tout"
+
+# todo
+#: gui_gtk_x11.c:2285
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Une requête \"meurs\" a été reçue du gestionnaire de session\n"
+
+#: gui_gtk_x11.c:3474
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: Fenêtre principale détruite inattendûment\n"
+
+#: gui_gtk_x11.c:4088
+msgid "Font Selection"
+msgstr "Choisir une police - Vim"
+
+# todo
+#: gui_gtk_x11.c:5940 ui.c:2009
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Utilisé CUT_BUFFER0 au lieu d'une sélection vide"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtre"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Répertoires"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Aide"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Fichiers"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Sélection"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Annuler"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Ne peut charger la fonte Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Ne peut utiliser la fonte %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Envoi d'un message pour interrompre le processus fils.\n"
+
+#: gui_w32.c:760
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument insupporté: \"-%s\"; Utilisez la version OLE."
+
+#: gui_w48.c:2048
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Trouver un texte (utilisez '\\\\' pour trouver un '\\')"
+
+#: gui_w48.c:2073
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Chercher et remplacer (utilisez '\\\\' pour trouver un '\\')"
+
+# todo
+#: gui_x11.c:1479
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Erreur d'allocation de couleur, couleurs incorrectes possibles"
+
+#: gui_x11.c:2060
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Pas de fontes pour ces charsets dans le fontset %s:"
+
+#: gui_x11.c:2103
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nom du fontset: %s"
+
+# todo
+#: gui_x11.c:2104
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "La fonte '%s' n'a pas une largeur fixe"
+
+# TODO
+#: gui_x11.c:2123
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nom du fontset: %s\n"
+
+#: gui_x11.c:2124
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2125
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2126
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "La largeur de Font%d n'est pas le double de celle de Font0\n"
+
+#: gui_x11.c:2127
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Largeur Font0: %ld\n"
+
+#: gui_x11.c:2128
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Largeur Font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ERREUR de l'automate Hangul"
+
+#: if_cscope.c:76
+msgid "Add a new database"
+msgstr "Ajouter une base de données"
+
+#: if_cscope.c:78
+msgid "Query for a pattern"
+msgstr "Requête selon un motif"
+
+#: if_cscope.c:80
+msgid "Show this message"
+msgstr "Afficher ce message"
+
+#: if_cscope.c:82
+msgid "Kill a connection"
+msgstr "Casser une connection"
+
+#: if_cscope.c:84
+msgid "Reinit all connections"
+msgstr "Réinitialiser les connections"
+
+#: if_cscope.c:86
+msgid "Show connections"
+msgstr "Montrer les connections"
+
+#: if_cscope.c:94
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Utilisation: cs[cope] %s"
+
+#: if_cscope.c:126
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Cette commande cscope ne supporte pas la séparation de la fenêtre.\n"
+
+#: if_cscope.c:167
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Utilisation: cstag <ident>"
+
+#: if_cscope.c:223
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: étiquette introuvable"
+
+#: if_cscope.c:401
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: Erreur stat(%s): %d"
+
+#: if_cscope.c:411
+msgid "E563: stat error"
+msgstr "E563: Erreur stat"
+
+#: if_cscope.c:508
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s n'est pas un répertoire ou une base de données cscope valide"
+
+#: if_cscope.c:523
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Ajouté la base de données cscope %s"
+
+#: if_cscope.c:578
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: erreur lors de la lecture de la connection cscope %ld"
+
+#: if_cscope.c:683
+msgid "E561: unknown cscope search type"
+msgstr "E561: type de recherche cscope inconnu"
+
+# todo
+#: if_cscope.c:725
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Pas pu créer de tuyaux (pipes) cscope"
+
+# TODO
+#: if_cscope.c:742
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Pas pu forker pour cscope"
+
+#: if_cscope.c:836 if_cscope.c:886
+msgid "cs_create_connection exec failed"
+msgstr "exec de cs_create_connection a échoué"
+
+#: if_cscope.c:887
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Pas pu engendrer le processus cscope"
+
+#: if_cscope.c:900
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen pour to_fp a échoué"
+
+#: if_cscope.c:902
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen pour fr_fp a échoué"
+
+#: if_cscope.c:940
+msgid "E567: no cscope connections"
+msgstr "E567: pas de connection cscope"
+
+#: if_cscope.c:1014
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: pas de corresp. trouvée pour la requête cscope %s de %s"
+
+# todo
+#: if_cscope.c:1071
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: Drapeau cscopequickfix %c pour %c invalide"
+
+#: if_cscope.c:1128
+msgid "cscope commands:\n"
+msgstr "commandes cscope:\n"
+
+#: if_cscope.c:1131
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Utilisation: %s)"
+
+#: if_cscope.c:1224
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: impossible d'ouvrir la base de données cscope: %s"
+
+# todo
+#: if_cscope.c:1241
+msgid "E626: cannot get cscope database information"
+msgstr "E626: impossible d'obtenir des infos sur la base de données cscope"
+
+# todo
+#: if_cscope.c:1261
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: base de données cscope redondante pas ajoutée"
+
+#: if_cscope.c:1272
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: nombre maximum de connections cscope atteint"
+
+#: if_cscope.c:1388
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: la connection cscope %s n'a pas été trouvée"
+
+#: if_cscope.c:1422
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "connection cscope %s est fermée"
+
+#. should not reach here
+#: if_cscope.c:1562
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: erreur fatale dans cs_manage_matches"
+
+#: if_cscope.c:1822
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Étiquette cscope: %s"
+
+#: if_cscope.c:1826
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # ligne"
+
+#: if_cscope.c:1828
+msgid "filename / context / line\n"
+msgstr "nom-fichier / context / ligne\n"
+
+#: if_cscope.c:1979
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Erreur cscope: %s"
+
+#: if_cscope.c:2141
+msgid "All cscope databases reset"
+msgstr "Toutes les bases de données cscope ont été remises à zéro"
+
+#: if_cscope.c:2209
+msgid "no cscope connections\n"
+msgstr "pas de connection cscope\n"
+
+#: if_cscope.c:2213
+msgid " # pid database name prepend path\n"
+msgstr " # pid nom dans base de données insérer chemin\n"
+
+#: if_python.c:394
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: Désolé, cette commande est désactivée, la bibliothèque Python n'a pu être chargée."
+
+#: if_python.c:596
+msgid "can't delete OutputObject attributes"
+msgstr "impossible d'effacer les attributs d'OutputObject"
+
+#: if_python.c:603
+msgid "softspace must be an integer"
+msgstr "softspace doit être un nombre entier"
+
+#: if_python.c:611
+msgid "invalid attribute"
+msgstr "attribut invalide"
+
+#: if_python.c:650 if_python.c:664
+msgid "writelines() requires list of strings"
+msgstr "writelines() requiert une liste de chaînes"
+
+#: if_python.c:790
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Erreur d'initialisation des objets d'E/S"
+
+#: if_python.c:975 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "expression invalide"
+
+#: if_python.c:989 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "expressions désactivée lors de la compilation"
+
+#: if_python.c:1002
+msgid "attempt to refer to deleted buffer"
+msgstr "tentative de référence à un tampon effacé"
+
+#: if_python.c:1017 if_python.c:1058 if_python.c:1122 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "numéro de ligne hors limites"
+
+#: if_python.c:1257
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<objet tampon (effacé) à %8lX>"
+
+#: if_python.c:1348 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "nom de marque invalide"
+
+#: if_python.c:1623
+msgid "no such buffer"
+msgstr "pas de tel tampon"
+
+#: if_python.c:1711
+msgid "attempt to refer to deleted window"
+msgstr "tentative de référence à une fenêtre effacée"
+
+#: if_python.c:1756
+msgid "readonly attribute"
+msgstr "attribut en lecture seule"
+
+#: if_python.c:1769
+msgid "cursor position outside buffer"
+msgstr "curseur positionné en dehors du tampon"
+
+#: if_python.c:1846
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objet fenêtre (effacé) à %.8lX>"
+
+#: if_python.c:1858
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objet fenêtre (inconnu) à %.8lX>"
+
+#: if_python.c:1860
+#, c-format
+msgid "<window %d>"
+msgstr "<fenêtre %d>"
+
+#: if_python.c:1936
+msgid "no such window"
+msgstr "pas de telle fenêtre"
+
+#: if_python.c:2193 if_python.c:2228 if_python.c:2278 if_python.c:2346
+#: if_python.c:2466 if_python.c:2518 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1998
+msgid "cannot save undo information"
+msgstr "impossible d'enregistrer les informations d'annulation"
+
+#: if_python.c:2195 if_python.c:2285 if_python.c:2357
+msgid "cannot delete line"
+msgstr "impossible d'effacer la ligne"
+
+#: if_python.c:2230 if_python.c:2373 if_tcl.c:690 if_tcl.c:2020
+msgid "cannot replace line"
+msgstr "impossible de remplacer la ligne"
+
+#: if_python.c:2389 if_python.c:2468 if_python.c:2526
+msgid "cannot insert line"
+msgstr "impossible d'insérer la ligne"
+
+#: if_python.c:2630
+msgid "string cannot contain newlines"
+msgstr "la chaîne ne peut contenir de retour à la ligne"
+
+#: if_ruby.c:396
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: Désolé, commande inactive, la bibliothèque Ruby n'a pu être chargée."
+
+#: if_ruby.c:459
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: statut longjmp inconnu: %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Basculer implémentation/définition"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Montrer la classe de base de"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Montrer les fonctions membres surchargées"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Récupérer du fichier"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Récupérer du projet"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Récupérer de tous les projets"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Récupérer"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Montrer source de"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Trouver symboles"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Parcourir classe"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Montrer classe dans hiérarchie"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Montrer classe dans hiérarchie restreinte"
+
+# todo
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref référence"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref est référencé par"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref a un(e)"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref utilisée par"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Montrer docu de"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Génération de docu pour"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "Connection à SNiFF+ impossible. Vérifiez l'environnement (sniffemacs doit être dans le $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Erreur de lecture. Déconnecté"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ est actuellement "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "pas "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "connecté"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Requête SNiFF+ inconnue: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Erreur de connection à SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ n'est pas connecté"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Ceci n'est pas un tampon SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Erreur d'écriture. Déconnection"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "numéro de tampon invalide"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "pas encore implémenté"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "option inconnue"
+
+# TODO
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "peut pas régler la/les ligne(s) '^_^"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "marque absente"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "ligne %d colonne %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "peut pas insérer/ajouter ligne"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "drapeau inconnu: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "vimOption inconnue"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "interruption clavier"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "erreur vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "peut pas créer cmde tampon/fenêtre: objet en train d'être effacé"
+
+# TODO
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "peut pas inscrire commande de rappel: tampon/fenêtre en effacement"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: ERREUR FATALE TCL: reflist corrompue ?! Contactez vim-dev@vim.org, svp."
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "peut pas inscrire commande de rappel: réf. tampon/fenêtre introuvable"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Désolé, commande désactivée: la bibliothèque Tcl n'a pu être chargée."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: ERREUR TCL: code de sortie pas int ?! Contacter vim-dev@vim.org"
+
+#: if_tcl.c:2006
+msgid "cannot get line"
+msgstr "pas pu récupérer la ligne"
+
+# todo
+#: if_xcmdsrv.c:215
+msgid "Unable to register a command server name"
+msgstr "Incapable d'inscrire un nom de serveur de commande"
+
+#: if_xcmdsrv.c:465
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Échec de l'envoi de la commande au programme de destination"
+
+#: if_xcmdsrv.c:735
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: Utilisé une Id de serveur invalide: %s"
+
+#: if_xcmdsrv.c:1098
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: Entrée registre de l'instance de Vim mal formattée. Effacée !"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Option inconnue"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Trop d'arguments d'édition"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Argument manquant après"
+
+# todo
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Détritus après l'option"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "Trop d'arguments \"+command\", \"-c command\" ou \"--cmd command\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Argument invalide pour"
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Ce Vim n'a pas été compilé avec la fonctionnalité diff"
+
+#: main.c:926
+msgid "Attempt to open script file again: \""
+msgstr "Nvle tentative pour ouvrir le script: \""
+
+#: main.c:930 main.c:937 main.c:981 memline.c:3682 memline.c:3686
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:935
+msgid "Cannot open for reading: \""
+msgstr "Ne peut ouvrir en lecture: \""
+
+# todo
+#: main.c:979
+msgid "Cannot open for script output: \""
+msgstr "Ne peut ouvrir pour la sortie script: \""
+
+#: main.c:1113
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d fichiers à éditer\n"
+
+#: main.c:1203
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Alerte: La sortie ne s'effectue pas sur un terminal\n"
+
+#: main.c:1205
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Alerte: L'entrée ne se fait pas sur un terminal\n"
+
+#. just in case..
+#: main.c:1267
+msgid "pre-vimrc command line"
+msgstr "ligne de commande pre-vimrc"
+
+#: main.c:1302
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Ne peut lire \"%s\""
+
+#: main.c:2344
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Plus d'info avec: \"vim -h\"\n"
+
+#: main.c:2377
+msgid "[file ..] edit specified file(s)"
+msgstr "[fichier ...] ouvrir le/s fichier/s spécifié/s"
+
+#: main.c:2378
+msgid "- read text from stdin"
+msgstr "- lire le texte à partir de stdin"
+
+#: main.c:2379
+msgid "-t tag edit file where tag is defined"
+msgstr "-t étiquette ouvrir le fichier qui contient l'étiquette"
+
+#: main.c:2381
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [fichErr] ouvrir au niveau de la première erreur"
+
+#: main.c:2390
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"utiliser:"
+
+#: main.c:2393
+msgid " vim [arguments] "
+msgstr " vim [args] "
+
+#: main.c:2397
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ou:"
+
+#: main.c:2400
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Arguments:\n"
+
+#: main.c:2401
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\tPlus que des noms de fichier après ceci"
+
+#: main.c:2403
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\tNe pas développer les métacaractères"
+
+#: main.c:2406
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\tInscrire ce gvim pour l'OLE"
+
+#: main.c:2407
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\tDésinscrire gvim de l'OLE"
+
+#: main.c:2410
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\tLancer l'interface graphique (comme \"gvim\")"
+
+#: main.c:2411
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f, --nofork\tAvant-plan; ne pas détacher l'interface graphique du terminal"
+
+#: main.c:2413
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\tMode Vi (comme \"vi\")"
+
+#: main.c:2414
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\tMode Ex (comme \"ex\")"
+
+#: main.c:2415
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\tMode silencieux (batch) (seulement pour \"ex\")"
+
+#: main.c:2417
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\tMode Diff (comme \"vimdiff\")"
+
+#: main.c:2419
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\tMode facile (comme \"evim\", vim sans modes)"
+
+#: main.c:2420
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\tMode lecture seule (comme \"view\")"
+
+#: main.c:2421
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\tMode restreint (comme \"rvim\")"
+
+#: main.c:2422
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\tInterdire l'enregistrement de fichiers"
+
+#: main.c:2423
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\tInterdire toute modification de texte"
+
+#: main.c:2424
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\tMode binaire"
+
+#: main.c:2426
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\tMode lisp"
+
+#: main.c:2428
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\tCompatible avec Vi: 'compatible'"
+
+#: main.c:2429
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\tPas tellement compatible avec Vi: 'nocompatible'"
+
+#: main.c:2430
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\tNiveau de verbosité"
+
+#: main.c:2431
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\tMode de débogage"
+
+#: main.c:2432
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\tNe pas utiliser de fichier d'échange, seulement la mémoire"
+
+#: main.c:2433
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\tLister les fichiers d'échange puis quitter"
+
+#: main.c:2434
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r <fichier>\tRécupérer une session plantée"
+
+#: main.c:2435
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\tComme -r"
+
+#: main.c:2437
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\tNe pas utiliser newcli pour l'ouverture des fenêtres"
+
+#: main.c:2438
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <périf>\tUtiliser <périphérique> pour les E/S"
+
+#: main.c:2441
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\tDémarrer en mode arabique"
+
+#: main.c:2444
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\tDémarrer en mode hébreu"
+
+#: main.c:2447
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\tDémarrer en mode farsi"
+
+#: main.c:2449
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <term>\tRégler le type du terminal sur <terminal>"
+
+#: main.c:2450
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\tUtiliser <vimrc> au lieu du vimrc habituel"
+
+#: main.c:2452
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\tUtiliser <gvimrc> au lieu du gvimrc habituel"
+
+# todo
+#: main.c:2454
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\tNe charger aucun plugin scripté"
+
+#: main.c:2455
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\tOuvrir N fenêtres (défaut: une pour chaque fichier)"
+
+#: main.c:2456
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\tComme -o, mais séparer verticalement"
+
+#: main.c:2457
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\tDémarrer en bas du fichier"
+
+#: main.c:2458
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<numL>\tDémarrer à la ligne <numL>"
+
+#: main.c:2460
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <cmde>\tExécuter <commande> avant même de charger les vimrc"
+
+#: main.c:2462
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <cmde>\tExécuter <commande> une fois le 1er fichier chargé"
+
+#: main.c:2463
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\tLire le fichier <session> une fois le 1er fichier chargé"
+
+#: main.c:2464
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <src>\tLire les commandes du mode Normal à partir du fichier <src>"
+
+#: main.c:2465
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <dest>\tAjouter toutes les commandes tapées dans le fichier <dest>"
+
+#: main.c:2466
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <dest>\tÉcrire toutes les commandes tapées dans le fichier <dest>"
+
+#: main.c:2468
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tÉditer des fichiers encodés"
+
+#: main.c:2472
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <écran>\tConnecter Vim au serveur X indiqué dans <écran>"
+
+#: main.c:2474
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNe se connecter à aucun serveur X"
+
+#: main.c:2477
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <fich>\tÉditer les <fichiers> dans un serveur Vim si possible"
+
+#: main.c:2478
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-silent ...\tPareil, mais pas de plainte s'il n'y a pas de serveur"
+
+#: main.c:2479
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <fich>\tComme --remote mais ne quitter qu'à la fin de l'édition"
+
+#: main.c:2480
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent\tPareil, mais pas de plainte s'il n'y a pas de "
+"serveur"
+
+#: main.c:2481
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <tche>\tEnvoyer <touches> à un serveur Vim puis quitter"
+
+#: main.c:2482
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tÉvaluer <exp> dans un serveur Vim, afficher le résultat"
+
+#: main.c:2483
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr ""
+"--serverlist\t\tLister les noms des serveurs Vim disponibles et quitter"
+
+#: main.c:2484
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <nom>\tEnvoyer au / Devenir le serveur Vim nommé <nom>"
+
+#: main.c:2487
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tUtiliser <viminfo> au lieu du viminfo habituel"
+
+#: main.c:2489
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h ou --help\t\tAfficher l'aide (ce message) puis quitter"
+
+#: main.c:2490
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tAfficher les informations de version puis quitter"
+
+#: main.c:2494
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Arguments reconnus par gvim (version Motif):\n"
+
+#: main.c:2498
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Arguments reconnus par gvim (version neXtaw):\n"
+
+#: main.c:2500
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Arguments reconnus par gvim (version Athena):\n"
+
+#: main.c:2504
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <écran>\tLancer Vim sur cet <écran>"
+
+#: main.c:2505
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tIconifier Vim au démarrage"
+
+#: main.c:2507
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nom>\t\tEmployer les ressources comme si Vim s'appelait <nom>"
+
+#: main.c:2508
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (pas implémenté)\n"
+
+#: main.c:2510
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <coul>\tUtiliser <couleur> pour l'arrière-plan\t (abrv: -bg)"
+
+#: main.c:2511
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr ""
+"-foreground <coul>\tUtiliser <couleur> pour le texte normal\t (abrv: -fg)"
+
+#: main.c:2512 main.c:2532
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <fonte>\tUtiliser <fonte> pour le texte normal\t (abrv: -fn)"
+
+#: main.c:2513
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <fonte>\tUtiliser <fonte> pour le texte gras"
+
+#: main.c:2514
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <fonte>\tUtiliser <fonte> pour le texte italique"
+
+#: main.c:2515 main.c:2533
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <géom>\tUtiliser cette <géométrie> initiale\t (abrv: -geom)"
+
+#: main.c:2516
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <épais>\tUtiliser cette <épaisseur> de bordure\t (abrv: -bw)"
+
+#: main.c:2517
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <lg>\tUtiliser cette <largeur> de barre de défil. (abrv: -sw)"
+
+#: main.c:2519
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <haut>\tUtiliser cette <hauteur> de menu\t (abrv: -mh)"
+
+#: main.c:2521 main.c:2534
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tUtiliser la vidéo inversée\t\t (abrv: -rv)"
+
+#: main.c:2522
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNe pas utiliser de vidéo inversée\t (abrv: +rv)"
+
+#: main.c:2523
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <ressource>\tConfigurer la <ressource> spécifiée"
+
+#: main.c:2526
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Arguments reconnus par gvim (version RISC OS):\n"
+
+#: main.c:2527
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <nombre>\tNombre de colonnes initial de la fenêtre"
+
+#: main.c:2528
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <nombre>\tNombre de lignes initial de la fenêtre"
+
+#: main.c:2531
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Arguments reconnus par gvim (version GTK+):\n"
+
+#: main.c:2535
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <écran>\tLancer Vim sur cet <écran>\t (également: --display)"
+
+#: main.c:2537
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr ""
+"--role <rôle>\t\tEndosse un rôle unique pour identifier la fenêtre principale"
+
+#: main.c:2539
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOuvrir Vim dans un autre widget GTK"
+
+#: main.c:2541
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tAfficher les arguments GNOME"
+
+# TODO
+#: main.c:2773
+msgid "No display"
+msgstr "Pas de display"
+
+#. Failed to send, abort.
+#: main.c:2788
+msgid ": Send failed.\n"
+msgstr ": L'envoi a échoué.\n"
+
+#. Let vim start normally.
+#: main.c:2794
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": L'envoi a échoué. Tentative d'exécution locale\n"
+
+#: main.c:2832 main.c:2853
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d de %d édités"
+
+# TODO
+#: main.c:2875
+msgid "No display: Send expression failed.\n"
+msgstr "Pas de display: L'envoi de l'expression a échoué.\n"
+
+#: main.c:2887
+msgid ": Send expression failed.\n"
+msgstr ": L'envoi de l'expression a échoué.\n"
+
+#: mark.c:656
+msgid "No marks set"
+msgstr "Aucune marque activée"
+
+#: mark.c:658
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Aucune marque ne correspond à \"%s\""
+
+#. Highlight title
+#: mark.c:669
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"marq ligne col fichier/texte"
+
+#. Highlight title
+#: mark.c:707
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" saut ligne col fichier/texte"
+
+#: mark.c:1072
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Marques dans le fichier:\n"
+
+# TODO
+#. Write the jumplist with -'
+#: mark.c:1107
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# List de saut (le plus récent en premier):\n"
+
+#: mark.c:1202
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historique des marques dans les fichiers (chronologie décroissante):\n"
+
+#: mark.c:1285
+msgid "Missing '>'"
+msgstr "'>' manquant"
+
+#: mbyte.c:409
+msgid "E543: Not a valid codepage"
+msgstr "E543: Pas une page de codes valable"
+
+#: mbyte.c:4014
+msgid "E284: Cannot set IC values"
+msgstr "E284: Impossible de régler les valeurs IC"
+
+#: mbyte.c:4166
+msgid "E285: Failed to create input context"
+msgstr "E285: Erreur de création du contexte de saisie"
+
+#: mbyte.c:4313
+msgid "E286: Failed to open input method"
+msgstr "E286: Erreur d'ouverture de la méthode de saisie"
+
+# TODO
+#: mbyte.c:4324
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Alerte: Pas pu établir d'appel de destruction dans la MS"
+
+#: mbyte.c:4330
+msgid "E288: input method doesn't support any style"
+msgstr "E288: la méthode de saisie ne supporte aucun style"
+
+#: mbyte.c:4387
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: la méthode de saisie ne supporte pas mon type de préédition"
+
+# TODO
+#: mbyte.c:4461
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: le style over-the-spot nécessite un fontset"
+
+#: mbyte.c:4493
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Votre GTK+ est plus ancien que 1.2.3. Zone d'état désactivée"
+
+#: mbyte.c:4772
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Le Serveur de Méthodes de Saisie n'est pas lancé"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: le bloc n'était pas verouillé"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Erreur de positionnement lors de la lecture du fichier d'échange"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: Erreur de lecture dans le fichier d'échange"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Erreur de positionnement lors de l'écriture du fichier d'échange"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: Erreur d'écriture dans le fichier d'échange"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Le fichier d'échange existe déjà (attaque par symlink ?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Pas récupéré le bloc n°0 ?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Pas récupéré le bloc n°1 ?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Pas récupéré le bloc n°2 ?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Oups, on a perdu le fichier d'échange !"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Pas pu renommer le fichier d'échange"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Pas pu ouvrir fichier .swp pour \"%s\", récup. impossible"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Pas récupéré le bloc 0 ?!"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Pas de fichier d'échange trouvé pour %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Entre le numéro du fichier d'échange à utiliser (0 pour quitter): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Ne peut ouvrir %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Incapable de lire le bloc 0 de "
+
+# TODO
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Peut-être qu'aucune modif. n'a été faite ou Vim n'a pas mis à jour le fichier d'échange."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ne peut être utilisé avec cette version de Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Utilisez Vim version 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ne semble pas être un fichier d'échange de Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ne peut être utilisé sur cet ordinateur.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Le fichier a été créé le "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"ou le fichier a été endommagé."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Utilisation du fichier d'échange \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Fichier original \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Alerte: Le fichier original a pu être changé"
+
+#: memline.c:963
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Incapable de lire le bloc 1 de %s"
+
+#: memline.c:967
+msgid "???MANY LINES MISSING"
+msgstr "???BEAUCOUP DE LIGNES MANQUENT"
+
+#: memline.c:983
+msgid "???LINE COUNT WRONG"
+msgstr "???NOMBRE DE LIGNES ERRONÉ"
+
+#: memline.c:990
+msgid "???EMPTY BLOCK"
+msgstr "???BLOC VIDE"
+
+#: memline.c:1016
+msgid "???LINES MISSING"
+msgstr "???LIGNES MANQUANTES"
+
+#: memline.c:1048
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID du bloc 1 erronée (%s n'est pas un fichier d'échange ?)"
+
+#: memline.c:1053
+msgid "???BLOCK MISSING"
+msgstr "???BLOC MANQUANT"
+
+#: memline.c:1069
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? d'ici jusqu'à ???FIN des lignes peuvent être corrompues"
+
+#: memline.c:1085
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? d'ici jusqu'à ???FIN des lignes ont pu être insérée/effacées"
+
+#: memline.c:1105
+msgid "???END"
+msgstr "???FIN"
+
+#: memline.c:1131
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Récupération interrompue"
+
+#: memline.c:1133
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: Erreurs lors de la récupération; examinez les lignes commençant par ???"
+
+#: memline.c:1136
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Récupération achevée. Vérifiez si tout est OK."
+
+#: memline.c:1137
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Vous voudrez peut-être enregistrer ce fichier sous un autre nom\n"
+
+#: memline.c:1138
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "et lancer diff avec le fichier original pour repérer les changements)\n"
+
+#: memline.c:1139
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Effacez le fichier .swp ensuite.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1195
+msgid "Swap files found:"
+msgstr "Fichiers d'échange trouvés:"
+
+#: memline.c:1373
+msgid " In current directory:\n"
+msgstr " Dans le répertoire courant:\n"
+
+#: memline.c:1375
+msgid " Using specified name:\n"
+msgstr "Utilisant le nom indiqué:\n"
+
+#: memline.c:1379
+msgid " In directory "
+msgstr " Dans le répertoire "
+
+#: memline.c:1397
+msgid " -- none --\n"
+msgstr " -- aucun --\n"
+
+#: memline.c:1469
+msgid " owned by: "
+msgstr " propriété de: "
+
+#: memline.c:1471
+msgid " dated: "
+msgstr " daté: "
+
+#: memline.c:1475 memline.c:3689
+msgid " dated: "
+msgstr " daté: "
+
+#: memline.c:1491
+msgid " [from Vim version 3.0]"
+msgstr " [de Vim version 3.0]"
+
+#: memline.c:1495
+msgid " [does not look like a Vim swap file]"
+msgstr " [ne semble pas être un fichier d'échange Vim]"
+
+#: memline.c:1499
+msgid " file name: "
+msgstr " nom de fichier: "
+
+#: memline.c:1505
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" modifié: "
+
+#: memline.c:1506
+msgid "YES"
+msgstr "OUI"
+
+#: memline.c:1506
+msgid "no"
+msgstr "non"
+
+#: memline.c:1510
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" nom d'utilisateur: "
+
+#: memline.c:1517
+msgid " host name: "
+msgstr " nom d'hôte: "
+
+#: memline.c:1519
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" nom d'hôte: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" processus n°: "
+
+#: memline.c:1531
+msgid " (still running)"
+msgstr " (en cours d'exécution)"
+
+#: memline.c:1543
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [inutilisable avec cette version de Vim]"
+
+#: memline.c:1546
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [inutilisable sur cet ordinateur]"
+
+#: memline.c:1551
+msgid " [cannot be read]"
+msgstr " [ne peut être lu]"
+
+#: memline.c:1555
+msgid " [cannot be opened]"
+msgstr " [ne peut être ouvert]"
+
+#: memline.c:1745
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Préservation impossible, il n'y a pas de fichier d'échange"
+
+#: memline.c:1798
+msgid "File preserved"
+msgstr "Fichier préservé"
+
+# todo
+#: memline.c:1800
+msgid "E314: Preserve failed"
+msgstr "E314: Échec de la préservation"
+
+#: memline.c:1871
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: lnum invalide: %ld"
+
+#: memline.c:1897
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ligne %ld introuvable"
+
+#: memline.c:2287
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: mauvais id de pointeur de bloc 3"
+
+#: memline.c:2367
+msgid "stack_idx should be 0"
+msgstr "stack_idx devrait être 0"
+
+#: memline.c:2429
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Trop de blocs mis à jour ?"
+
+# todo
+#: memline.c:2611
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: mauvais id de pointeur de bloc 4"
+
+#: memline.c:2638
+msgid "deleted block 1?"
+msgstr "bloc 1 effacé ?"
+
+#: memline.c:2838
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Ligne %ld introuvable"
+
+# todo
+#: memline.c:3081
+msgid "E317: pointer block id wrong"
+msgstr "E317: mauvais id de pointeur de bloc"
+
+#: memline.c:3097
+msgid "pe_line_count is zero"
+msgstr "pe_line_count vaut zéro"
+
+# todo dela delà
+#: memline.c:3126
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: numéro de ligne hors limites: %ld au dela de la fin"
+
+#: memline.c:3130
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: nombre de lignes erroné dans le bloc %ld"
+
+#: memline.c:3179
+msgid "Stack size increases"
+msgstr "La taille de la pile s'accroît"
+
+#: memline.c:3225
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: mauvais id de pointeur de block 2"
+
+#: memline.c:3679
+msgid "E325: ATTENTION"
+msgstr "E325: ATTENTION"
+
+#: memline.c:3680
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Trouvé un fichier d'échange nommé \""
+
+#: memline.c:3684
+msgid "While opening file \""
+msgstr "Lors de l'ouverture du fichier \""
+
+#: memline.c:3693
+msgid " NEWER than swap file!\n"
+msgstr " PLUS RÉCENT que le fichier d'échange !\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3697
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Un autre programme est peut-être en train d'éditer ce fichier.\n"
+" Si c'est le cas, faites attention à ne pas vous retrouver avec\n"
+" deux version différentes du même fichier en faisant des modifications.\n"
+
+#: memline.c:3698
+msgid " Quit, or continue with caution.\n"
+msgstr " Quittez, ou continuez prudemment.\n"
+
+#: memline.c:3699
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Une session d'édition pour ce fichier a planté.\n"
+
+#: memline.c:3700
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Si c'est le cas, utilisez \":recover\" ou \"vim -r "
+
+#: memline.c:3702
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" pour récupérer les changements (voir \":help recovery\").\n"
+
+#: memline.c:3703
+msgid " If you did this already, delete the swap file \""
+msgstr " Si vous l'avez déjà fait, effacez le fichier d'échange \""
+
+#: memline.c:3705
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" pour éviter ce message.\n"
+
+#: memline.c:3719 memline.c:3723
+msgid "Swap file \""
+msgstr "Le fichier d'échange \""
+
+#: memline.c:3720 memline.c:3726
+msgid "\" already exists!"
+msgstr "\" existe déjà !"
+
+#: memline.c:3729
+msgid "VIM - ATTENTION"
+msgstr "VIM - ATTENTION"
+
+#: memline.c:3731
+msgid "Swap file already exists!"
+msgstr "Un fichier d'échange existe déjà !"
+
+#: memline.c:3735
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Ouvrir en lecture seule\n"
+"&Editer quand même\n"
+"&Récupérer\n"
+"&Quitter"
+
+#: memline.c:3737
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Ouvrir en lecture seule\n"
+"&Editer quand même\n"
+"&Récupérer\n"
+"&Quitter\n"
+"Le &supprimer"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: Trop de fichiers d'échange trouvés"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Une partie du chemin d'éléments de menu n'est pas un sous-menu"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Le menu n'existe que dans un autre mode"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Pas de menu de ce nom"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Le chemin de menu ne doit pas conduire à un sous-menu"
+
+# todo
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Ajout d'éléments directement dans barre de menu interdit"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Un séparateur ne peut faire partie d'un chemin de menu"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1079
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menus ---"
+
+#: menu.c:1996
+msgid "Tear off this menu"
+msgstr "Arracher ce menu"
+
+#: menu.c:2061
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Le chemin du menu doit conduire à un élément de menu"
+
+#: menu.c:2081
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Menu introuvable: %s"
+
+#: menu.c:2150
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Le menu n'est pas défini pour le mode %s"
+
+# todo
+#: menu.c:2188
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Le chemin du menu doit conduire à un sous-menu"
+
+#: menu.c:2209
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Menu introuvable - vérifiez les noms des menus"
+
+# todo
+#: message.c:519
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Erreur détectée en traitant %s:"
+
+#: message.c:535
+#, c-format
+msgid "line %4ld:"
+msgstr "ligne %4ld:"
+
+#: message.c:575
+msgid "[string too long]"
+msgstr "[chaîne trop longue]"
+
+# todo
+#: message.c:721
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Mainteneur des messages: Adrien Beau <version.francaise@free.fr>"
+
+#: message.c:945
+msgid "Interrupt: "
+msgstr "Interruption: "
+
+#: message.c:948
+msgid "Hit ENTER to continue"
+msgstr "Appuyez sur ENTRÉE pour continuer"
+
+#: message.c:950
+msgid "Hit ENTER or type command to continue"
+msgstr "Appuyez sur ENTRÉE ou tapez une commande pour continuer"
+
+#: message.c:2244
+msgid "-- More --"
+msgstr "-- Plus --"
+
+# TODO
+#: message.c:2247
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (ENTR/RA: ligne, ESPCE/b: page, d/u: demi page, q: quitte)"
+
+#: message.c:2248
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (ENTR: ligne, ESPCE: page, d: demi page, q: quitte)"
+
+#: message.c:2740 message.c:2755
+msgid "Question"
+msgstr "Question"
+
+#: message.c:2742
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Oui\n"
+"&Non"
+
+# todo
+#: message.c:2775
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Oui\n"
+"&Non\n"
+"Tout &sauver\n"
+"Tout &rejeter\n"
+"&Annuler"
+
+# todo
+#: message.c:2816
+msgid "Save File dialog"
+msgstr "Boîte de dialogue 'Enregistrer'"
+
+# todo
+#: message.c:2818
+msgid "Open File dialog"
+msgstr "Boîte de dialogue 'Ouvrir'"
+
+# TODO
+#. TODO: non-GUI file selector here
+#: message.c:2889
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Désolé, pas d'explorateur de fichiers en mode console"
+
+#: misc1.c:2692
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Alerte: Modification d'un fichier en lecture seule"
+
+#: misc1.c:2927
+msgid "1 more line"
+msgstr "1 ligne en plus"
+
+#: misc1.c:2929
+msgid "1 line less"
+msgstr "1 ligne en moins"
+
+#: misc1.c:2934
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld lignes en plus"
+
+#: misc1.c:2936
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld lignes en moins"
+
+#: misc1.c:2939
+msgid " (Interrupted)"
+msgstr " (Interrompu)"
+
+#: misc1.c:6631
+msgid "Vim: preserving files...\n"
+msgstr "Vim: préservation des fichiers...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6641
+msgid "Vim: Finished.\n"
+msgstr "Vim: Fini.\n"
+
+#: misc2.c:670 misc2.c:686
+msgid "ERROR: "
+msgstr "ERREUR: "
+
+#: misc2.c:690
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[octets] total alloué-libéré %lu-%lu, utilisé %lu, pic %lu\n"
+
+#: misc2.c:692
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[appels] total re/malloc() %lu, total free() %lu\n"
+"\n"
+
+#: misc2.c:747
+msgid "E340: Line is becoming too long"
+msgstr "E340: La ligne devient trop lingue"
+
+#: misc2.c:791
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Erreur interne: lalloc(%ld, )"
+
+#: misc2.c:899
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Mémoire épuisée ! (allocation de %lu octets)"
+
+#: misc2.c:2565
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Appel du shell pour exécuter: \"%s\""
+
+#: misc2.c:2786
+msgid "E545: Missing colon"
+msgstr "E545: Deux-points manquant"
+
+#: misc2.c:2788 misc2.c:2815
+msgid "E546: Illegal mode"
+msgstr "E546: Mode illégal"
+
+#: misc2.c:2854
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Forme de curseur illégale"
+
+#: misc2.c:2894
+msgid "E548: digit expected"
+msgstr "E548: chiffre attendu"
+
+#: misc2.c:2899
+msgid "E549: Illegal percentage"
+msgstr "E549: Pourcentage illégal"
+
+#: misc2.c:3209
+msgid "Enter encryption key: "
+msgstr "Tapez la clé d'encodage: "
+
+#: misc2.c:3210
+msgid "Enter same key again: "
+msgstr "Réentrez la même clé: "
+
+#: misc2.c:3220
+msgid "Keys don't match!"
+msgstr "Les clés ne correspondent pas !"
+
+#: misc2.c:3769
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: Chemin invalide: '**[nombre]' doit être à la fin du chemin ou être suivi de '%s'."
+
+#: misc2.c:5045
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Répertoire \"%s\" introuvable dans le cdpath"
+
+#: misc2.c:5048
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Fichier \"%s\" introuvable dans le chemin"
+
+# todo
+#: misc2.c:5054
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Plus de répertoire \"%s\" dans le cdpath"
+
+#: misc2.c:5057
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Plus de fichier \"%s\" dans le chemin"
+
+#: misc2.c:5291
+msgid "E550: Missing colon"
+msgstr "E550: Deux-points manquant"
+
+#: misc2.c:5303
+msgid "E551: Illegal component"
+msgstr "E551: Composant illégal"
+
+#: misc2.c:5311
+msgid "E552: digit expected"
+msgstr "E552: chiffre attendu"
+
+#. Get here when the server can't be found.
+#: netbeans.c:283
+msgid "Cannot connect to Netbeans #2"
+msgstr "Impossible de se connecter à Netbeans n°2"
+
+#: netbeans.c:291
+msgid "Cannot connect to Netbeans"
+msgstr "Impossible de se connecter à Netbeans"
+
+# TODO
+#: netbeans.c:565
+msgid "read from Netbeans socket"
+msgstr "lu en provenance du socket Netbeans"
+
+#: normal.c:2916
+msgid "Warning: terminal cannot highlight"
+msgstr "Alerte: le terminal ne peut surligner"
+
+#: normal.c:3131
+msgid "E348: No string under cursor"
+msgstr "E348: Pas de chaîne sous le curseur"
+
+#: normal.c:3133
+msgid "E349: No identifier under cursor"
+msgstr "E349: Pas d'identifiant sous le curseur"
+
+#: normal.c:4351
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Les replis ne peuvent être effacés avec la 'foldmethod' actuelle"
+
+# TODO
+#: ops.c:295
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 ligne %sée 1 fois"
+
+# TODO
+#: ops.c:297
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 ligne %sée %d fois"
+
+# TODO
+#: ops.c:302
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld lignes %sées 1 fois"
+
+#: ops.c:305
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld lignes %sées %d fois"
+
+#: ops.c:663
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld lignes à indenter... "
+
+#: ops.c:713
+msgid "1 line indented "
+msgstr "1 ligne indentée "
+
+#: ops.c:715
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld lignes indentées "
+
+#. must display the prompt
+#: ops.c:1647
+msgid "cannot yank; delete anyway"
+msgstr "copie impossible; effacement en tout cas"
+
+#: ops.c:2155
+msgid "1 line changed"
+msgstr "1 ligne modifiée"
+
+#: ops.c:2157
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld lignes modifiées"
+
+#: ops.c:2541
+#, c-format
+msgid "freeing %ld lines"
+msgstr "libération de %ld lignes"
+
+#: ops.c:2822
+msgid "1 line yanked"
+msgstr "1 ligne copiée"
+
+#: ops.c:2824
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld lignes copiées"
+
+#: ops.c:3109
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Le registre %s est vide"
+
+#. Highlight title
+#: ops.c:3666
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registres ---"
+
+#: ops.c:4875
+msgid "Illegal register name"
+msgstr "Nom de registre illégal"
+
+#: ops.c:4961
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Resgistres:\n"
+
+#: ops.c:4994
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Type de registre %d inconnu"
+
+#: ops.c:5480
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Nom de registre invalide: '%s'"
+
+#: ops.c:5841
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Cols; "
+
+#: ops.c:5848
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Sélectionné %s%ld de %ld Lignes; %ld de %ld Mots; %ld de %ld Octets"
+
+#: ops.c:5864
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Col %s de %s; Ligne %ld de %ld; Mot %ld de %ld; Octet %ld de %ld"
+
+# todo
+#: ops.c:5875
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld pour le BOM)"
+
+#: option.c:1623
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Page %N"
+
+#: option.c:2072
+msgid "Thanks for flying Vim"
+msgstr "Merci d'avoir choisi Vim"
+
+#: option.c:3344 option.c:3451
+msgid "E518: Unknown option"
+msgstr "E518: Option inconnue"
+
+#: option.c:3357
+msgid "E519: Option not supported"
+msgstr "E519: Option pas supportée"
+
+# todo
+#: option.c:3382
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Interdit dans une ligne de mode"
+
+# TODO
+#: option.c:3438
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tRéglé récemment dans "
+
+#: option.c:3577
+msgid "E521: Number required after ="
+msgstr "E521: Nombre requis après ="
+
+#: option.c:3903 option.c:4520
+msgid "E522: Not found in termcap"
+msgstr "E522: Pas trouvé dans termcap"
+
+#: option.c:3969
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Caractère <%s> illégal"
+
+#: option.c:4512
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: 'term' ne peut pas être une chaîne vide"
+
+#: option.c:4515
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Changement de term impossible dans l'interface graphique"
+
+#: option.c:4517
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Utilisez \":gui\" pour démarrer l'interface graphique"
+
+#: option.c:4538
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' et 'patchmode' sont égaux"
+
+#: option.c:4723
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Inchangeable dans l'interface GTK+ 2"
+
+#: option.c:4879
+msgid "E524: Missing colon"
+msgstr "E524: Deux-points manquant"
+
+#: option.c:4881
+msgid "E525: Zero length string"
+msgstr "E525: Chaîne de longueur nulle"
+
+#: option.c:4949
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Nombre manquant après <%s>"
+
+#: option.c:4963
+msgid "E527: Missing comma"
+msgstr "E527: Virgule manquante"
+
+#: option.c:4970
+msgid "E528: Must specify a ' value"
+msgstr "E528: Une valeur ' doit être spécifiée"
+
+# todo
+#: option.c:5011
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: contient des caractères multi-octets ou inaffichables"
+
+#: option.c:5060
+msgid "E596: Invalid font(s)"
+msgstr "E596: Fonte(s) invalide(s)"
+
+#: option.c:5068
+msgid "E597: can't select fontset"
+msgstr "E597: sélection de fontset impossible"
+
+# todo
+#: option.c:5070
+msgid "E598: Invalid fontset"
+msgstr "E598: Fontset invalide"
+
+# TODO
+#: option.c:5077
+msgid "E533: can't select wide font"
+msgstr "E533: Sélection de fonte large impossible"
+
+#: option.c:5079
+msgid "E534: Invalid wide font"
+msgstr "E534: Fonte large invalide"
+
+#: option.c:5349
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Caractère illégal après <%c>"
+
+#: option.c:5453
+msgid "E536: comma required"
+msgstr "E536: virgule requise"
+
+#: option.c:5461
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' doit être vide ou contenir %s"
+
+#: option.c:5534
+msgid "E538: No mouse support"
+msgstr "E538: La souris n'est pas supportée"
+
+# todo
+#: option.c:5802
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Séquence d'expression mal fermée"
+
+#: option.c:5806
+msgid "E541: too many items"
+msgstr "E541: trop d'éléments"
+
+#: option.c:5808
+msgid "E542: unbalanced groups"
+msgstr "E542: groupes déséquilibrés"
+
+#: option.c:6029
+msgid "E590: A preview window already exists"
+msgstr "E590: Il y a déjà une fenêtre de prévisualisation"
+
+#: option.c:6286
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: L'arabique requiert l'UTF-8, tapez ':set encoding=utf-8'"
+
+#: option.c:6603
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Nécessite au moins %d lignes"
+
+#: option.c:6612
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Nécessite au moins %d colonnes"
+
+#: option.c:6917
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Option inconnue: %s"
+
+#: option.c:7026
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Codes de terminal ---"
+
+#: option.c:7028
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Valeur des options globales ---"
+
+#: option.c:7030
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Valeur des options locales ---"
+
+#: option.c:7032
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Options ---"
+
+#: option.c:7733
+msgid "E356: get_varp ERROR"
+msgstr "E356: ERREUR get_varp"
+
+#: option.c:8704
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Caractère correspondant manquant pour %s"
+
+#: option.c:8738
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Caractères surnuméraires après point-virgule: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "ne peut ouvir "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Ouverture de la fenêtre impossible !\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Nécessite Amigados version 2.04 ou ultérieure\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Nécessité %s version %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Ne peut ouvrir NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "Ne peut créer "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim sort avec %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "changement du mode de console impossible ?!\n"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: pas une console ?!\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1143
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Exécution de shell impossible avec l'option -f"
+
+#: os_amiga.c:1184 os_amiga.c:1274
+msgid "Cannot execute "
+msgstr "Ne peut exécuter "
+
+# todo
+#: os_amiga.c:1187 os_amiga.c:1284
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1207 os_amiga.c:1309
+msgid " returned\n"
+msgstr " retourné\n"
+
+#: os_amiga.c:1450
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE trop petit."
+
+#: os_amiga.c:1454
+msgid "I/O ERROR"
+msgstr "ERREUR d'E/S"
+
+#: os_mswin.c:517
+msgid "...(truncated)"
+msgstr "...(tronqué)"
+
+#: os_mswin.c:619
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ne vaut pas 80, exécution de commandes externes impossible"
+
+#: os_mswin.c:1854
+msgid "E237: Printer selection failed"
+msgstr "E237: La sélection de l'imprimante a échoué"
+
+# TODO
+#: os_mswin.c:1894
+#, c-format
+msgid "to %s on %s"
+msgstr "vers %s sur %s"
+
+#: os_mswin.c:1909
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Fonte d'imprimante inconnue: %s"
+
+#: os_mswin.c:1959 os_mswin.c:1969
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Erreur d'impression: %s"
+
+#: os_mswin.c:1970
+msgid "Unknown"
+msgstr "Inconnu"
+
+#: os_mswin.c:1997
+#, c-format
+msgid "Printing '%s'"
+msgstr "Impression de '%s'"
+
+# todo
+#: os_mswin.c:3083
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Nom de jeu de carac. \"%s\" illégal dans nom de fonte \"%s\""
+
+#: os_mswin.c:3091
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Caractère '%c' illégal dans le nom de fonte \"%s\""
+
+#: os_riscos.c:1258
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Option 'osfiletype' invalide - Text est utilisé"
+
+#: os_unix.c:887
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Signal double, sortie\n"
+
+#: os_unix.c:893
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Signal mortel %s intercepté\n"
+
+#: os_unix.c:896
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Signal mortel intercepté\n"
+
+#: os_unix.c:1159
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "L'ouverture de l'affichage X a pris %ld msec"
+
+#: os_unix.c:1186
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Reçu l'erreur X\n"
+
+# TODO
+#: os_unix.c:1294
+msgid "Testing the X display failed"
+msgstr "Le test de l'affichage X a échoué"
+
+# TODO
+#: os_unix.c:1433
+msgid "Opening the X display timed out"
+msgstr "L'ouverture de l'affichage X a dépassé les délais"
+
+#: os_unix.c:3165 os_unix.c:3845
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Échec de l'exécution du shell "
+
+# todo
+#: os_unix.c:3213
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Échec de l'exécution du shell sh\n"
+
+#: os_unix.c:3217 os_unix.c:3851
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"le shell a retourné "
+
+# TODO
+#: os_unix.c:3352
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Création de tuyaux (pipes) impossible\n"
+
+# todo
+#: os_unix.c:3367
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Séparation impossible\n"
+
+#: os_unix.c:3858
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Commande interrompue\n"
+
+#: os_unix.c:4111 os_unix.c:4236 os_unix.c:5894
+msgid "XSMP lost ICE connection"
+msgstr "XSMP a perdu la connection ICE"
+
+# TODO
+#: os_unix.c:5478
+msgid "Opening the X display failed"
+msgstr "L'ouverture da l'affichage X a échoué"
+
+# TODO
+#: os_unix.c:5800
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP gère une requête sauvez-vous"
+
+#: os_unix.c:5917
+msgid "XSMP opening connection"
+msgstr "ouverture de connection XSMP"
+
+#: os_unix.c:5935
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP: échec de la surveillance de connection ICE"
+
+#: os_unix.c:5955
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection a échoué: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "À la ligne"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Pas pu allouer de la mémoire pour la ligne de commande."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "Erreur VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Le chargement de vim32.dll a échoué !"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Les pointeurs de fonction n'ont pu être ajustés à la DLL !"
+
+#: os_win16.c:341 os_win32.c:3049
+#, c-format
+msgid "shell returned %d"
+msgstr "le shell a retourné %d"
+
+#: os_win32.c:2507
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Évènement %s intercepté\n"
+
+#: os_win32.c:2509
+msgid "close"
+msgstr "fermeture"
+
+#: os_win32.c:2511
+msgid "logoff"
+msgstr "déconnection"
+
+#: os_win32.c:2512
+msgid "shutdown"
+msgstr "arrêt"
+
+#: os_win32.c:3002
+msgid "E371: Command not found"
+msgstr "E371: Commande introuvable"
+
+#: os_win32.c:3015
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE n'est pas dans votre $PATH.\n"
+"Les commandes externes ne feront pas de pause une fois terminées.\n"
+"Voir :help win32-vimrun pour plus d'informations."
+
+# todo
+#: os_win32.c:3018
+msgid "Vim Warning"
+msgstr "Alerte Vim"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Trop de %%%c dans le patron de formattage"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: %%%c inattendu dans le patron de formattage"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: ] manquant dans le patron de formattage"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c insupporté dans le patron de formattage"
+
+# todo
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: %%%c invalide dans le préfixe du patron de formattage"
+
+# todo
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: %%%c invalide dans le patron de formattage"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' ne contient aucun motif"
+
+#: quickfix.c:497
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Nom de répertoire vide ou absent"
+
+#: quickfix.c:984
+msgid "E553: No more items"
+msgstr "E553: Plus d'éléments"
+
+#: quickfix.c:1221
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d de %d)%s%s: "
+
+#: quickfix.c:1223
+msgid " (line deleted)"
+msgstr " (ligne effacée)"
+
+#: quickfix.c:1433
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: En bas de la pile quickfix"
+
+# todo
+#: quickfix.c:1442
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Au sommet de la pile quickfix"
+
+#: quickfix.c:1454
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "liste d'erreurs %d sur %d; %d erreurs"
+
+#: quickfix.c:1928
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Écriture impossible, option 'buftype' activée"
+
+# todo
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: élément invalide dans %s%%[]"
+
+#: regexp.c:827
+msgid "E339: Pattern too long"
+msgstr "E339: Motif trop long"
+
+#: regexp.c:996
+msgid "E50: Too many \\z("
+msgstr "E50: Trop de \\z("
+
+#: regexp.c:1007
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Trop de %s("
+
+#: regexp.c:1064
+msgid "E52: Unmatched \\z("
+msgstr "E52: Pas de correspondance pour \\z("
+
+#: regexp.c:1068
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Pas de correspondance pour %s%%("
+
+#: regexp.c:1070
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Pas de correspondance pour %s("
+
+#: regexp.c:1075
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Pas de correspondance pour %s)"
+
+# TODO
+#: regexp.c:1244
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: L'opérande %s* pourrait être vide"
+
+# TODO
+#: regexp.c:1247
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: L'opérande %s* pourrait être vide"
+
+#: regexp.c:1301
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: caractère invalide après %s@"
+
+# TODO
+#: regexp.c:1326
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: L'opérande %s{ pourrait être vide"
+
+# todo
+#: regexp.c:1336
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Trop de %s{...}s complexes"
+
+#: regexp.c:1352
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: %s* imbriqué"
+
+#: regexp.c:1355
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: %s%c imbriqué"
+
+#: regexp.c:1473
+msgid "E63: invalid use of \\_"
+msgstr "E63: utilisation invalide de \\_"
+
+#: regexp.c:1518
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c ne suit rien"
+
+# todo
+#: regexp.c:1574
+msgid "E65: Illegal back reference"
+msgstr "E65: Rétroréférence illégale"
+
+#: regexp.c:1587
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( n'est pas autorisé ici"
+
+#: regexp.c:1606
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et co. ne sont pas autorisés ici"
+
+#: regexp.c:1617
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Caractère invalide après \\z"
+
+#: regexp.c:1666
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Il manque ] après %s%%["
+
+#: regexp.c:1682
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] vide"
+
+#: regexp.c:1742
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Caractère invalide après %s%%"
+
+#: regexp.c:2539
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Erreur de syntaxe dans %s{...}"
+
+#: regexp.c:2800
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Plantage intercepté; exp.rég. trop complexe ?"
+
+#: regexp.c:2941
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: un motif a fait déborder la pile"
+
+#: regexp.c:3180
+msgid "External submatches:\n"
+msgstr "Sous-correspondances externes:\n"
+
+#: screen.c:2113
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld lignes pliées "
+
+#: screen.c:7884
+msgid " VREPLACE"
+msgstr " REMPLACEMENT-V"
+
+#: screen.c:7888
+msgid " REPLACE"
+msgstr " REMPLACEMENT"
+
+# TODO
+#: screen.c:7893
+msgid " REVERSE"
+msgstr " REVERSE"
+
+#: screen.c:7895
+msgid " INSERT"
+msgstr " INSERTION"
+
+#: screen.c:7898
+msgid " (insert)"
+msgstr " (insertion)"
+
+#: screen.c:7900
+msgid " (replace)"
+msgstr " (remplacement)"
+
+#: screen.c:7902
+msgid " (vreplace)"
+msgstr " (remplacement-v)"
+
+#: screen.c:7905
+msgid " Hebrew"
+msgstr " hébreu"
+
+#: screen.c:7916
+msgid " Arabic"
+msgstr " arabique"
+
+#: screen.c:7919
+msgid " (lang)"
+msgstr " (langue)"
+
+#: screen.c:7923
+msgid " (paste)"
+msgstr " (collage)"
+
+#: screen.c:7929
+msgid " SELECT"
+msgstr " SELECTION"
+
+#: screen.c:7931
+msgid " VISUAL"
+msgstr " VISUEL"
+
+#: screen.c:7933
+msgid " BLOCK"
+msgstr " BLOC"
+
+#: screen.c:7935
+msgid " LINE"
+msgstr " LIGNE"
+
+#: screen.c:7948 screen.c:8008
+msgid "recording"
+msgstr "enregistrement"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "La recherche a atteint le HAUT, et continue en BAS"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "La recherche a atteint le BAS, et continue en HAUT"
+
+#: search.c:525
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Texte de recherche invalide: %s"
+
+#: search.c:852
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: la recherche a atteint le HAUT sans trouver: %s"
+
+#: search.c:855
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: la recherche a atteint le BAS sans trouver: %s"
+
+#: search.c:1247
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: '?' ou '/' attendu après ';'"
+
+#: search.c:3685
+msgid " (includes previously listed match)"
+msgstr " (inclut des correspondances listées précédemment)"
+
+#. cursor at status line
+#: search.c:3705
+msgid "--- Included files "
+msgstr "--- Fichiers inclus "
+
+#: search.c:3707
+msgid "not found "
+msgstr "introuvable "
+
+#: search.c:3708
+msgid "in path ---\n"
+msgstr "dans le chemin ---\n"
+
+#: search.c:3747
+msgid " (Already listed)"
+msgstr " (Déjà listé)"
+
+#: search.c:3749
+msgid " NOT FOUND"
+msgstr " INTROUVABLE"
+
+#: search.c:3801
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Examen des fichiers inclus: %s"
+
+#: search.c:4019
+msgid "E387: Match is on current line"
+msgstr "E387: La correspondance est sur la ligne courante"
+
+#: search.c:4162
+msgid "All included files were found"
+msgstr "Tous les fichiers inclus ont été trouvés"
+
+# todo
+#: search.c:4164
+msgid "No included files"
+msgstr "Pas de fichiers inclus"
+
+#: search.c:4180
+msgid "E388: Couldn't find definition"
+msgstr "E388: Définition introuvable"
+
+#: search.c:4182
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Motif introuvable"
+
+#: syntax.c:3015
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Argument illégal: %s"
+
+#: syntax.c:3195
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Pas de tel surgroupe syntactique: %s"
+
+#: syntax.c:3359
+msgid "No Syntax items defined for this buffer"
+msgstr "Pas d'éléments syntactiques définis pour ce tampon"
+
+#: syntax.c:3367
+msgid "syncing on C-style comments"
+msgstr "synchro sur les commentaire style C"
+
+#: syntax.c:3375
+msgid "no syncing"
+msgstr "pas de synchro"
+
+#: syntax.c:3378
+msgid "syncing starts "
+msgstr "la synchro commence "
+
+#: syntax.c:3380 syntax.c:3455
+msgid " lines before top line"
+msgstr " lignes avant la ligne du haut"
+
+# todo
+#: syntax.c:3385
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Éléments de synchro syntactique ---"
+
+# todo
+#: syntax.c:3390
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronisation sur éléments"
+
+#: syntax.c:3396
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Éléments de syntaxe ---"
+
+#: syntax.c:3419
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Pas de tel surgroupe de syntaxe: %s"
+
+#: syntax.c:3445
+msgid "minimal "
+msgstr "minimal "
+
+#: syntax.c:3452
+msgid "maximal "
+msgstr "maximal "
+
+# todo
+#: syntax.c:3464
+msgid "; match "
+msgstr "; correspondance"
+
+#: syntax.c:3466
+msgid " line breaks"
+msgstr " fins de ligne"
+
+# todo
+#: syntax.c:4100
+msgid "E393: group[t]here not accepted here"
+msgstr "E394: group[t]here pas accepté ici"
+
+# todo
+#: syntax.c:4124
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Pas trouvé d'objet region pour %s"
+
+#: syntax.c:4152
+msgid "E395: contains argument not accepted here"
+msgstr "E395: L'argument contains n'est pas accepté ici"
+
+#: syntax.c:4163
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: L'argument containedin n'est pas accepté ici"
+
+#: syntax.c:4241
+msgid "E397: Filename required"
+msgstr "E397: Nom de fichier requis"
+
+#: syntax.c:4579
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: '=' manquant: %s"
+
+#: syntax.c:4737
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Pas assez d'arguments: syntax region %s"
+
+# TODO
+#: syntax.c:5068
+msgid "E400: No cluster specified"
+msgstr "E400: Aucun surgroupe spécifié"
+
+#: syntax.c:5105
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Délimiteur de motif introuvable: %s"
+
+# todo
+#: syntax.c:5180
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Détritus après le motif: %s"
+
+# todo
+#: syntax.c:5270
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: synchro syntax: motif de continuation de ligne présent deux fois"
+
+#: syntax.c:5327
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Arguments illégaux: %s"
+
+#: syntax.c:5377
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Signe égal manquant: %s"
+
+#: syntax.c:5383
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Argument vide: %s"
+
+#: syntax.c:5410
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s n'est pas permis ici"
+
+#: syntax.c:5417
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s doit être le premier élément d'une liste contains"
+
+#: syntax.c:5487
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Nom de groupe inconnu: %s"
+
+#: syntax.c:5720
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Sous-commande de :syntax invalide: %s"
+
+#: syntax.c:6099
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: groupe de surlignage introuvable: %s"
+
+#: syntax.c:6123
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Pas assez d'arguments: \":highlight link %s\""
+
+#: syntax.c:6130
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Trop d'arguments: \":highlight link %s\""
+
+# TODO
+#: syntax.c:6150
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: le groupe a des réglages, lien de surlignage ignoré"
+
+#: syntax.c:6279
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: signe égal inattendu: %s"
+
+#: syntax.c:6315
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: signe égal manquant: %s"
+
+#: syntax.c:6337
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: argument manquant: %s"
+
+#: syntax.c:6374
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Valeur illégale: %s"
+
+#: syntax.c:6493
+msgid "E419: FG color unknown"
+msgstr "E419: Couleur de premier plan inconnue"
+
+#: syntax.c:6504
+msgid "E420: BG color unknown"
+msgstr "E420: Couleur d'arrière-plan inconnue"
+
+#: syntax.c:6565
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Nom ou numéro de couleur non reconnu: %s"
+
+#: syntax.c:6771
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: le code de terminal est trop long: %s"
+
+#: syntax.c:6818
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Argument illégal: %s"
+
+#: syntax.c:7347
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Trop d'attributs de surlignage différents en cours d'utilisation"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: En bas de la pile d'étiquettes"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: Au sommet de la pile d'étiquettes"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Ne peut aller avant la première étiquette correspondante"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: Étiquette introuvable: %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri type étiquette"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "fichier\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Entrez le no choisi (<CR> pour annuler): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Il n'y a qu'une étiquette correspondante"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Ne peut aller au delà de la dernière étiquette correspondante"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Le fichier \"%s\" n'existe pas"
+
+#. Give an indication of the number of matching tags
+#: tag.c:781
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "étiquette %d de %d%s"
+
+#: tag.c:784
+msgid " or more"
+msgstr " ou plus"
+
+#: tag.c:786
+msgid " Using tag with different case!"
+msgstr " Utilisation d'une étiquette dans une casse différente !"
+
+#: tag.c:830
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Le fichier \"%s\" n'existe pas"
+
+# todo
+#. Highlight title
+#: tag.c:899
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # VERS étiquette DE ligne dans fichier/texte"
+
+#: tag.c:1200
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Examen du fichier d'étiquettes %s"
+
+#: tag.c:1384
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Chemin de fichiers d'étiquettes tronqué pour %s\n"
+
+#: tag.c:1914
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Erreur de format dans le fichier d'étiquettes \"%s\""
+
+#: tag.c:1918
+#, c-format
+msgid "Before byte %ld"
+msgstr "Avant l'octet %ld"
+
+#: tag.c:1939
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Le fichier d'étiquettes n'est pas classé: %s"
+
+#. never opened any tags file
+#: tag.c:1979
+msgid "E433: No tags file"
+msgstr "E433: Par de fichier d'étiquettes"
+
+# todo
+#: tag.c:2666
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Le motif de l'étiquette est introuvable"
+
+#: tag.c:2677
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Étiquette introuvable, on se contente de deviner !"
+
+#: term.c:1745
+msgid "' not known. Available builtin terminals are:"
+msgstr "' inconnu. Les terminaux internes sont:"
+
+# todo
+#: term.c:1769
+msgid "defaulting to '"
+msgstr "utilisation par défaut de '"
+
+#: term.c:2127
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Le fichier termcap ne peut être ouvert"
+
+#: term.c:2131
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: La description du terminal n'a pas été trouvée dans terminfo"
+
+#: term.c:2133
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: La description du terminal n'a pas été trouvée dans termcap"
+
+# todo
+#: term.c:2292
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Pas d'entrée \"%s\" dans termcap"
+
+# todo
+#: term.c:2766
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: capacité de terminal \"cm\" requise"
+
+#. Highlight title
+#: term.c:4970
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Touches du terminal ---"
+
+# todo
+#: ui.c:252
+msgid "new shell started\n"
+msgstr "nouveau shell démarré\n"
+
+# todo
+#: ui.c:1784
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Erreur en lisant l'entrée, sortie...\n"
+
+# todo
+#. must display the prompt
+#: undo.c:394
+msgid "No undo possible; continue anyway"
+msgstr "Annulation impossible; on continue quand même"
+
+#: undo.c:549
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: numéros de ligne erronés"
+
+#: undo.c:718
+msgid "1 change"
+msgstr "1 changement"
+
+#: undo.c:720
+#, c-format
+msgid "%ld changes"
+msgstr "%ld changements"
+
+#: undo.c:764
+msgid "E439: undo list corrupt"
+msgstr "E439: la liste d'annulation est corrompue"
+
+# todo
+#: undo.c:796
+msgid "E440: undo line missing"
+msgstr "E440: ligne d'annulation manquante"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:724
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"Version graphique MS-Windows 16/32 bits"
+
+#: version.c:726
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"Version graphique MS-Windows 32 bits"
+
+#: version.c:729
+msgid " in Win32s mode"
+msgstr " lancée en mode Win32s"
+
+#: version.c:731
+msgid " with OLE support"
+msgstr " supportant l'OLE"
+
+#: version.c:734
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"Version console MS-Windows 32 bits"
+
+#: version.c:738
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"Version MS-Windows 16 bits"
+
+#: version.c:742
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"Version MS-DOS 32 bits"
+
+#: version.c:744
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"Version MS-DOS 16 bits"
+
+#: version.c:750
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"Version MaxOS X (unix)"
+
+#: version.c:752
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"Version MacOS X"
+
+#: version.c:755
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"Version MacOS"
+
+#: version.c:760
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"Version RISC OS"
+
+# todo
+#: version.c:770
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Patches inclus: "
+
+#: version.c:796 version.c:1145
+msgid "Modified by "
+msgstr "Modifié par "
+
+#: version.c:803
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compilé "
+
+#: version.c:806
+msgid "by "
+msgstr "par "
+
+#: version.c:818
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Énorme version "
+
+#: version.c:821
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Grosse version "
+
+#: version.c:824
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Version normale "
+
+#: version.c:827
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Petite version "
+
+#: version.c:829
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Version minuscule "
+
+#: version.c:835
+msgid "without GUI."
+msgstr "sans interface graphique."
+
+#: version.c:840
+msgid "with GTK2-GNOME GUI."
+msgstr "avec interface GTK2-GNOME."
+
+#: version.c:842
+msgid "with GTK-GNOME GUI."
+msgstr "avec interface GTK-GNOME."
+
+#: version.c:846
+msgid "with GTK2 GUI."
+msgstr "avec interface GTK2."
+
+#: version.c:848
+msgid "with GTK GUI."
+msgstr "avec interface GTK."
+
+#: version.c:853
+msgid "with X11-Motif GUI."
+msgstr "avec interface X11-Motif."
+
+#: version.c:857
+msgid "with X11-neXtaw GUI."
+msgstr "avec interface X11-neXtaw."
+
+#: version.c:859
+msgid "with X11-Athena GUI."
+msgstr "avec interface X11-Athena."
+
+#: version.c:863
+msgid "with BeOS GUI."
+msgstr "avec interface BeOS."
+
+#: version.c:866
+msgid "with Photon GUI."
+msgstr "avec interface Photon."
+
+#: version.c:869
+msgid "with GUI."
+msgstr "avec une interface graphique."
+
+#: version.c:872
+msgid "with Carbon GUI."
+msgstr "avec interface Carbon."
+
+#: version.c:875
+msgid "with Cocoa GUI."
+msgstr "avec interface Cocoa."
+
+#: version.c:878
+msgid "with (classic) GUI."
+msgstr "avec interface (classique)."
+
+#: version.c:889
+msgid " Features included (+) or not (-):\n"
+msgstr " Fonctionnalités incluses (+) ou non (-):\n"
+
+#: version.c:901
+msgid " system vimrc file: \""
+msgstr " fichier vimrc système: \""
+
+#: version.c:906
+msgid " user vimrc file: \""
+msgstr " fichier vimrc utilisateur: \""
+
+#: version.c:911
+msgid " 2nd user vimrc file: \""
+msgstr " 2me fichier vimrc utilisateur: \""
+
+#: version.c:916
+msgid " 3rd user vimrc file: \""
+msgstr " 3me fichier vimrc utilisateur: \""
+
+#: version.c:921
+msgid " user exrc file: \""
+msgstr " fichier exrc utilisateur: \""
+
+#: version.c:926
+msgid " 2nd user exrc file: \""
+msgstr " 2me fichier exrc utilisateur: \""
+
+#: version.c:932
+msgid " system gvimrc file: \""
+msgstr " fichier gvimrc système: \""
+
+#: version.c:936
+msgid " user gvimrc file: \""
+msgstr " fichier gvimrc utilisateur: \""
+
+#: version.c:940
+msgid "2nd user gvimrc file: \""
+msgstr "2me fichier gvimrc utilisateur: \""
+
+#: version.c:945
+msgid "3rd user gvimrc file: \""
+msgstr "3me fichier gvimrc utilisateur: \""
+
+#: version.c:952
+msgid " system menu file: \""
+msgstr " fichier menu système: \""
+
+#: version.c:960
+msgid " fall-back for $VIM: \""
+msgstr " $VIM par défaut: \""
+
+#: version.c:966
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME par défaut: \""
+
+#: version.c:970
+msgid "Compilation: "
+msgstr "Compilation: "
+
+#: version.c:976
+msgid "Compiler: "
+msgstr "Compilateur: "
+
+#: version.c:981
+msgid "Linking: "
+msgstr "Édition de liens: "
+
+#: version.c:986
+msgid " DEBUG BUILD"
+msgstr " VERSION DE DÉBOGAGE"
+
+#: version.c:1024
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi Amélioré"
+
+#: version.c:1026
+msgid "version "
+msgstr "version "
+
+#: version.c:1027
+msgid "by Bram Moolenaar et al."
+msgstr "par Bram Moolenaar et al."
+
+# todo
+#: version.c:1031
+msgid "Vim is open source and freely distributable"
+msgstr "Vim est un logiciel libre"
+
+#: version.c:1033
+msgid "Help poor children in Uganda!"
+msgstr "Aidez de pauvres enfants en Ouganda !"
+
+#: version.c:1034
+msgid "type :help iccf<Enter> for information "
+msgstr "tapez :help iccf<Entrée> pour plus d'informations"
+
+#: version.c:1036
+msgid "type :q<Enter> to exit "
+msgstr "tapez :q<Entrée> pour sortir du programme "
+
+#: version.c:1037
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "tapez :help<Entrée> ou <F1> pour accéder à l'aide en ligne "
+
+#: version.c:1038
+msgid "type :help version6<Enter> for version info"
+msgstr "tapez :help version6<Entrée> pour lire les notes de mise à jour"
+
+#: version.c:1041
+msgid "Running in Vi compatible mode"
+msgstr "Compatibilité Vi activée"
+
+#: version.c:1042
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "tapez :set nocp<Entrée> pour déf. de Vim"
+
+#: version.c:1043
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "tapez :help cp-default<Entrée> pour plus d'info"
+
+#: version.c:1058
+msgid "menu Help->Orphans for information "
+msgstr "menu Aide->Orphelins pour plus d'info"
+
+#: version.c:1060
+msgid "Running modeless, typed text is inserted"
+msgstr "Les modes sont désactivés, tout texte est inséré"
+
+# TODO
+#: version.c:1061
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Edition->Réglages Globaux->Insertion Perm. "
+
+#: version.c:1062
+msgid " for two modes "
+msgstr " pour les modes "
+
+# TODO
+#: version.c:1066
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Édition->Réglages Globaux->Compatibilité Vi"
+
+#: version.c:1067
+msgid " for Vim defaults "
+msgstr " pour déf. de Vim "
+
+#: version.c:1113
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ALERTE: Windows 95/98/ME détecté"
+
+#: version.c:1116
+msgid "type :help windows95<Enter> for info on this"
+msgstr "tapez :help windows95<Entrée> pour plus d'information"
+
+#: window.c:204
+msgid "E441: There is no preview window"
+msgstr "E441: Il n'y a pas de fenêtre de prévisualisation"
+
+#: window.c:582
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Ne peut séparer hautgauche et basdroite en même temps"
+
+# todo
+#: window.c:1341
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Rotation impossible quand des fenêtres sont séparées"
+
+#: window.c:1832
+msgid "E444: Cannot close last window"
+msgstr "E444: Fermeture de la dernière fenêtre impossible"
+
+#: window.c:2563
+msgid "Already only one window"
+msgstr "Il n'y a déjà plus qu'une fenêtre"
+
+# TODO
+#: window.c:2610
+msgid "E445: Other window contains changes"
+msgstr "E445: L'autre fenêtre n'a pas été enregistrée"
+
+#: window.c:4456
+msgid "E446: No file name under cursor"
+msgstr "E446: Pas de nom de fichier sous le curseur"
+
+# todo
+#: window.c:4575
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Le fichier \"%s\" n'est pas dans le chemin"
+
+#: globals.h:1208 if_perl.xs:363
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Le chargement de la bibliothèque %s"
+
+#: if_perl.xs:591
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "Désolé, commande désactivée: la bibliothèque Perl n'a pu être chargée."
+
+#: if_perl.xs:637
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr "E299: Évaluation Perl interdite dans bac à sable sans module Safe"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Édite dans &plusieurs Vims"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Édite dans un seul &Vim"
+
+# todo
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Comparer dans Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Édite dans &Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Éditer dans le Vim existant - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Éditer le(s) fichier(s) sélectionné(s) avec Vim"
+
+# todo
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Erreur de création du processus: Vérifiez si gvim est bien dans votre chemin!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "Erreur de gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Le chemin est trop long !"
+
+# msgstr "--Pas de lignes dans le tampon--"
+#: globals.h:998
+msgid "--No lines in buffer--"
+msgstr "--Le tampon est vide--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1161
+msgid "E470: Command aborted"
+msgstr "E470: Commande annulée"
+
+#: globals.h:1162
+msgid "E471: Argument required"
+msgstr "E471: Argument requis"
+
+#: globals.h:1163
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ devrait être suivi de /, ? ou &"
+
+# todo
+#: globals.h:1165
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Invalide dans la fenêtre ligne-de-commande; <CR> exécute, CTRL-C q"
+
+# TODO
+#: globals.h:1167
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: Cmde interdite à partir d'un exrc/vimrc dans rép. cour. ou tag search"
+
+#: globals.h:1169
+msgid "E171: Missing :endif"
+msgstr "E171: :endif manquant"
+
+#: globals.h:1170
+msgid "E600: Missing :endtry"
+msgstr "E600: :endtry manquant"
+
+#: globals.h:1171
+msgid "E170: Missing :endwhile"
+msgstr "E170: :endwhile manquant"
+
+#: globals.h:1172
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile sans :while"
+
+#: globals.h:1174
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Le fichier existe déjà (ajoutez ! pour passer outre)"
+
+#: globals.h:1175
+msgid "E472: Command failed"
+msgstr "E472: La commande a échoué"
+
+# todo
+#: globals.h:1177
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Fontset inconnu: %s"
+
+#: globals.h:1181
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Fonte inconnue: %s"
+
+# TODO
+#: globals.h:1184
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: La fonte \"%s\" n'a pas une largeur fixe"
+
+#: globals.h:1186
+msgid "E473: Internal error"
+msgstr "E473: Erreur interne"
+
+#: globals.h:1187
+msgid "Interrupted"
+msgstr "Interrompu"
+
+#: globals.h:1188
+msgid "E14: Invalid address"
+msgstr "E14: Adresse invalide"
+
+#: globals.h:1189
+msgid "E474: Invalid argument"
+msgstr "E474: Argument invalide"
+
+#: globals.h:1190
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Argument invalide: %s"
+
+#: globals.h:1192
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Expression invalide: %s"
+
+# todo
+#: globals.h:1194
+msgid "E16: Invalid range"
+msgstr "E16: Domaine invalide"
+
+#: globals.h:1195
+msgid "E476: Invalid command"
+msgstr "E476: Commande invalide"
+
+#: globals.h:1197
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" est un répertoire"
+
+#: globals.h:1200
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Caractères inattendus avant '='"
+
+#: globals.h:1203
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: L'appel dans la bibliothèque a échoué pour \"%s()\""
+
+#: globals.h:1209
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Pas pu charger la fonction %s de la bibliothèque"
+
+#: globals.h:1211
+msgid "E19: Mark has invalid line number"
+msgstr "E19: La marque a un numéro de ligne invalide"
+
+# todo
+#: globals.h:1212
+msgid "E20: Mark not set"
+msgstr "E20: Marque non positionnée"
+
+#: globals.h:1213
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Ne peut rien changer, 'modifiable' est désactivé"
+
+#: globals.h:1214
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Niveau de récursion trop élevé dans les scripts"
+
+# todo
+#: globals.h:1215
+msgid "E23: No alternate file"
+msgstr "E23: Pas de fichier alternatif"
+
+#: globals.h:1216
+msgid "E24: No such abbreviation"
+msgstr "E24: Pas de telle abréviation"
+
+#: globals.h:1217
+msgid "E477: No ! allowed"
+msgstr "E477: Le ! n'est pas autorisé"
+
+#: globals.h:1219
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: L'interface graphique n'a pas été compilée dans cette version"
+
+#: globals.h:1222
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Le support de l'hébreu n'a pas été compilé dans cette version\n"
+
+#: globals.h:1225
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Le support du farsi n'a pas été compilé dans cette version\n"
+
+#: globals.h:1228
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Le support de l'arabique n'a pas été compilé dans cette version\n"
+
+# todo
+#: globals.h:1231
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Pas de tel nom de groupe de surlignage: %s"
+
+#: globals.h:1233
+msgid "E29: No inserted text yet"
+msgstr "E29: Pas encore de texte inséré"
+
+#: globals.h:1234
+msgid "E30: No previous command line"
+msgstr "E30: Pas de ligne de commande précédente"
+
+# todo
+#: globals.h:1235
+msgid "E31: No such mapping"
+msgstr "E31: Pas de tel mapping"
+
+#: globals.h:1236
+msgid "E479: No match"
+msgstr "E479: Pas de correspondance"
+
+#: globals.h:1237
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Pas de correspondance: %s"
+
+#: globals.h:1238
+msgid "E32: No file name"
+msgstr "E32: Pas de nom de fichier"
+
+# todo
+#: globals.h:1239
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Pas d'expression régulière de substitution précédente"
+
+#: globals.h:1240
+msgid "E34: No previous command"
+msgstr "E34: Pas de commande précédente"
+
+#: globals.h:1241
+msgid "E35: No previous regular expression"
+msgstr "E35: Pas d'expression régulière précédente"
+
+#: globals.h:1242
+msgid "E481: No range allowed"
+msgstr "E481: Les domaines ne sont pas autorisés"
+
+#: globals.h:1244
+msgid "E36: Not enough room"
+msgstr "E36: Pas assez de place"
+
+#: globals.h:1247
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: pas de serveur nommé \"%s\" inscrit"
+
+#: globals.h:1249
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Ne peut créer le fichier %s"
+
+#: globals.h:1250
+msgid "E483: Can't get temp file name"
+msgstr "E483: Ne peut obtenir de nom de fichier temporaire"
+
+#: globals.h:1251
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Impossible d'ouvrir le fichier \"%s\""
+
+#: globals.h:1252
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Impossible de lire le fichier %s"
+
+#: globals.h:1253
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Modifications non enregistrées (ajoutez ! pour passer outre)"
+
+#: globals.h:1254
+msgid "E38: Null argument"
+msgstr "E38: Argument nul"
+
+#: globals.h:1256
+msgid "E39: Number expected"
+msgstr "E39: Nombre attendu"
+
+#: globals.h:1259
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Ne peut ouvrir le fichier d'erreurs %s"
+
+# TODO
+#: globals.h:1262
+msgid "E233: cannot open display"
+msgstr "E233: ouverture de l'affichage impossible"
+
+#: globals.h:1264
+msgid "E41: Out of memory!"
+msgstr "E41: Mémoire épuisée"
+
+#: globals.h:1266
+msgid "Pattern not found"
+msgstr "Motif introuvable"
+
+#: globals.h:1268
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Motif introuvable: %s"
+
+#: globals.h:1269
+msgid "E487: Argument must be positive"
+msgstr "E487: L'argument doit être positif"
+
+#: globals.h:1271
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Impossible de retourner au répertoire précédent"
+
+#: globals.h:1275
+msgid "E42: No Errors"
+msgstr "E42: Pas d'erreurs"
+
+#: globals.h:1277
+msgid "E43: Damaged match string"
+msgstr "E43: Le texte de la recherche est endommagé"
+
+#: globals.h:1278
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Le programme regexp est corrompu"
+
+#: globals.h:1279
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: L'option 'readonly' est activée (ajoutez ! pour passer outre)"
+
+#: globals.h:1281
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: La variable \"%s\" est en lecture seule"
+
+#: globals.h:1284
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Erreur lors de la lecture du fichier d'erreurs"
+
+#: globals.h:1287
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Opération interdite dans le bac à sable"
+
+#: globals.h:1289
+msgid "E523: Not allowed here"
+msgstr "E523: Interdit à cet endroit"
+
+# todo
+#: globals.h:1292
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Choix du mode d'écran non supporté"
+
+#: globals.h:1294
+msgid "E49: Invalid scroll size"
+msgstr "E49: L'ampleur du défilement est invalide"
+
+#: globals.h:1295
+msgid "E91: 'shell' option is empty"
+msgstr "E91: L'option 'shell' est vide"
+
+# todo
+#: globals.h:1297
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Pas pu lire les données du symbole!"
+
+#: globals.h:1299
+msgid "E72: Close error on swap file"
+msgstr "E72: Erreur lors de la fermeture du fichier d'échange"
+
+#: globals.h:1300
+msgid "E73: tag stack empty"
+msgstr "E73: La pile des étiquettes est vide"
+
+#: globals.h:1301
+msgid "E74: Command too complex"
+msgstr "E74: Commande trop complexe"
+
+#: globals.h:1302
+msgid "E75: Name too long"
+msgstr "E75: Nom trop long"
+
+#: globals.h:1303
+msgid "E76: Too many ["
+msgstr "E76: Trop de ["
+
+#: globals.h:1304
+msgid "E77: Too many file names"
+msgstr "E77: Trop de noms de fichiers"
+
+#: globals.h:1305
+msgid "E488: Trailing characters"
+msgstr "E488: Caractères surnuméraires"
+
+#: globals.h:1306
+msgid "E78: Unknown mark"
+msgstr "E78: Marque inconnue"
+
+#: globals.h:1307
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Impossible de développer les métacaractères"
+
+#: globals.h:1309
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' ne peut être plus petit que 'winminheight'"
+
+#: globals.h:1311
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' ne peut être plus petit que 'winminwidth'"
+
+#: globals.h:1314
+msgid "E80: Error while writing"
+msgstr "E80: Erreur lors de l'écriture"
+
+# todo
+#: globals.h:1315
+msgid "Zero count"
+msgstr "Le compte vaut zéro"
+
+#: globals.h:1317
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> utilisé en dehors d'un script"
+
+# todo
+#: globals.h:1320
+msgid "E449: Invalid expression received"
+msgstr "E449: Expression invalide reçue"
+
+# todo
+#: globals.h:1323
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Cette zone est verrouillée et ne peut être modifiée"
+
+#~ msgid "error reading cscope connection %d"
+#~ msgstr "erreur lors de la lecture de la connection cscope %d"
+
+#~ msgid "E260: cscope connection not found"
+#~ msgstr "E260: la connection cscope n'a pas été trouvée"
+
+#~ msgid "cscope connection closed"
+#~ msgstr "La connection cscope est fermée"
+
+#~ msgid "couldn't malloc\n"
+#~ msgstr "malloc a échoué\n"
+
+#~ msgid "%2d %-5ld %-34s <none>\n"
+#~ msgstr "%2d %-5ld %-34s <aucun>\n"
+
+#~ msgid "E448: Unknown font: %s"
+#~ msgstr "E448: Fonte inconnue: %s"
+
+#~ msgid "Linear tag search"
+#~ msgstr "Recherche linéaire d'étiquette"
+
+#~ msgid "Binary tag search"
+#~ msgstr "Recherche binaire d'étiquette"
+
+#~ msgid "Can't open file %s"
+#~ msgstr "Ne peut ouvrir le fichier %s"
+
+#~ msgid "E249: couldn't read VIM instance registry property"
+#~ msgstr "E249: Pas pu lire entrée registre de l'instance de Vim"
diff --git a/src/po/it.po b/src/po/it.po
new file mode 100644
index 000000000..cc966fadd
--- /dev/null
+++ b/src/po/it.po
@@ -0,0 +1,6638 @@
+# Italian Translation for Vim
+#
+# FIRST AUTHOR Antonio Colombo <antonio.colombo@jrc.it>, 2000
+#
+# Ogni commento è benvenuto...
+# Every remark is very welcome...
+#
+# Translation done under Linux and using an Italian keyboard.
+# English words left in the text are unmodified at plural.
+# Option names are mostly left untouched.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim 6.3\n"
+"POT-Creation-Date: 2004-06-02 20:02+0200\n"
+"PO-Revision-Date: 2004-06-02 20:02+0200\n"
+"Last-Translator: Vlad Sandrini <marco@sandrini.biz>\n"
+"Language-Team: Italian"
+" Antonio Colombo <antonio.colombo@jrc.it>\n"
+" Vlad Sandrini <marco@sandrini.biz>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO_8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Non riesco ad allocare alcun buffer, esco..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Non riesco ad allocare un buffer, uso l'altro..."
+
+#: buffer.c:808
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Nessun buffer scaricato"
+
+#: buffer.c:810
+msgid "E516: No buffers were deleted"
+msgstr "E516: Nessun buffer tolto dalla lista"
+
+#: buffer.c:812
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Nessun buffer cancellato"
+
+#: buffer.c:820
+msgid "1 buffer unloaded"
+msgstr "1 buffer scaricato"
+
+#: buffer.c:822
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d buffer scaricati"
+
+#: buffer.c:827
+msgid "1 buffer deleted"
+msgstr "1 buffer tolto dalla lista"
+
+#: buffer.c:829
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buffer tolti dalla lista"
+
+#: buffer.c:834
+msgid "1 buffer wiped out"
+msgstr "1 buffer cancellato"
+
+#: buffer.c:836
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d buffer cancellati"
+
+#: buffer.c:897
+msgid "E84: No modified buffer found"
+msgstr "E84: Nessun buffer risulta modificato"
+
+#. back where we started, didn't find anything.
+#: buffer.c:936
+msgid "E85: There is no listed buffer"
+msgstr "E85: Non c'è alcun buffer elencato"
+
+#: buffer.c:948
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Non esiste il buffer %ld"
+
+#: buffer.c:951
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Non posso oltrepassare l'ultimo buffer"
+
+#: buffer.c:953
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Non posso andare prima del primo buffer"
+
+#: buffer.c:991
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr ""
+"E89: Buffer %ld non salvato dopo modifica (aggiungi ! per eseguire comunque)"
+
+#: buffer.c:1008
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Non riesco a scaricare l'ultimo buffer"
+
+#: buffer.c:1544
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Attenzione: Superato limite della lista dei nomi di file"
+
+#: buffer.c:1716
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Buffer %ld non trovato"
+
+#: buffer.c:1947
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Più di una corrispondenza per %s"
+
+#: buffer.c:1949
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Nessun buffer corrispondente a %s"
+
+#: buffer.c:2344
+#, c-format
+msgid "line %ld"
+msgstr "linea %ld"
+
+#: buffer.c:2429
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: C'è già un buffer con questo nome"
+
+#: buffer.c:2724
+msgid " [Modified]"
+msgstr " [Modificato]"
+
+#: buffer.c:2729
+msgid "[Not edited]"
+msgstr "[Non elaborato]"
+
+#: buffer.c:2734
+msgid "[New file]"
+msgstr "[File nuovo]"
+
+#: buffer.c:2735
+msgid "[Read errors]"
+msgstr "[Errori in lettura]"
+
+#: buffer.c:2737 fileio.c:2124
+msgid "[readonly]"
+msgstr "[in sola lettura]"
+
+#: buffer.c:2758
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 linea --%d%%--"
+
+#: buffer.c:2760
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld linee --%d%%--"
+
+#: buffer.c:2767
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "linea %ld di %ld --%d%%-- col "
+
+#: buffer.c:2875
+msgid "[No file]"
+msgstr "[Senza nome]"
+
+#. must be a help buffer
+#: buffer.c:2915
+msgid "help"
+msgstr "aiuto"
+
+#: buffer.c:3474 screen.c:5075
+msgid "[help]"
+msgstr "[aiuto]"
+
+#: buffer.c:3506 screen.c:5081
+msgid "[Preview]"
+msgstr "[Anteprima]"
+
+#: buffer.c:3786
+msgid "All"
+msgstr "Tut"
+
+#: buffer.c:3786
+msgid "Bot"
+msgstr "Fon"
+
+#: buffer.c:3788
+msgid "Top"
+msgstr "Cim"
+
+#: buffer.c:4536
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Lista Buffer:\n"
+
+#: buffer.c:4569
+msgid "[Error List]"
+msgstr "[Lista Errori]"
+
+#: buffer.c:4582 memline.c:1521
+msgid "[No File]"
+msgstr "[Senza nome]"
+
+#: buffer.c:4895
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Segni ---"
+
+#: buffer.c:4914
+#, c-format
+msgid "Signs for %s:"
+msgstr "Segni per %s:"
+
+#: buffer.c:4920
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " linea=%ld id=%d, nome=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Non supporto differenze fra più di %ld buffer"
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: Non riesco a creare differenze "
+
+#: diff.c:818
+msgid "Patch file"
+msgstr "File di differenze"
+
+#: diff.c:1069
+msgid "E98: Cannot read diff output"
+msgstr "E98: Non riesco a leggere output del comando 'diff'"
+
+#: diff.c:1819
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Buffer corrente non in modalità 'diff'"
+
+#: diff.c:1831
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Non c'è nessun altro buffer in modalità 'diff'"
+
+#: diff.c:1839
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Più di due buffer in modalità 'diff', non so quale usare"
+
+#: diff.c:1862
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Non riesco a trovare il buffer: \"%s\""
+
+#: diff.c:1868
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Il buffer \"%s\" non è in modalità 'diff'"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Escape not ammesso nei digrammi"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: File keymap non trovato"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Uso di :loadkeymap fuori da un file di comandi"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Completamento Keyword (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " modalità ^X (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Completamento Keyword Locale (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Completamento Linea Intera (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Completamento nomi File (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Completamento Tag (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Completamento modello Path (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Completamento Definizione (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Completamento Dizionario (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Completamento Thesaurus (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Completamento linea comandi (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Giunto alla fine del paragrafo"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "l'opzione 'thesaurus' è vuota"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "l'opzione 'dictionary' è vuota"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Scansione dizionario: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (inserisci) Scroll (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (sostituisci) Scroll (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Scansione: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "Scansione tag."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " Aggiungo"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Ricerca..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Ritorno all'originale"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Parola da un'altra linea"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "L'unica corrispondenza"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "corrispondenza %d di %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "corripondenza %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Variabile inesistente: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Mancano graffe: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Variabile inesistente: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Manca ':' dopo '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Manca ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Manca ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Nome Opzione mancante: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Opzione inesistente: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Manca '\"': %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Manca apostrofo: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Argomento non valido per la funzione %s"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Funzione inesistente: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Troppi argomenti per la funzione: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Argomenti insufficienti per la funzione: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Uso di <SID> fuori dal contesto di uno script: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4382 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&OK"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld linee: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Non eseguire"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "inputrestore() chiamata più volte di inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: Troppi link simbolici (circolarità?)"
+
+#: eval.c:6626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Manca connessione con server Vim"
+
+#: eval.c:6724
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Non riesco a leggere una risposta del server"
+
+#: eval.c:6752
+msgid "E258: Unable to send to client"
+msgstr "E258: Impossibile inviare al client"
+
+#: eval.c:6800
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Impossibile inviare a %s"
+
+#: eval.c:6900
+msgid "(Invalid)"
+msgstr "(Non valido)"
+
+#: eval.c:8078
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Variabile non definita: %s"
+
+#: eval.c:8510
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: Nome di variabile non ammesso: %s"
+
+#: eval.c:8802
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: La funzione %s esiste già, aggiungi ! per sostituirla"
+
+#: eval.c:8875
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Funzione non definita: %s"
+
+#: eval.c:8888
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Manca '(': %s"
+
+#: eval.c:8921
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Argomento non ammesso: %s"
+
+#: eval.c:9000
+msgid "E126: Missing :endfunction"
+msgstr "E126: Manca :endfunction"
+
+#: eval.c:9107
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Non posso ridefinire la funzione %s: E' in uso"
+
+#: eval.c:9177
+msgid "E129: Function name required"
+msgstr "E129: Nome funzione necessario"
+
+#: eval.c:9228
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Il nome funzione deve iniziare con una lettera maiuscola: %s"
+
+#: eval.c:9420
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Funzione non definita: %s"
+
+#: eval.c:9425
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Non posso eliminare la funzione %s: E' in uso"
+
+#: eval.c:9473
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr ""
+"E132: Nidificazione della chiamata di funzione maggiore di 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9526
+#, c-format
+msgid "calling %s"
+msgstr "chiamo %s"
+
+#: eval.c:9588
+#, c-format
+msgid "%s aborted"
+msgstr "%s non completata"
+
+#: eval.c:9590
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ritorno #%ld"
+
+#: eval.c:9597
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ritorno \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9613 ex_cmds2.c:2370
+#, c-format
+msgid "continuing in %s"
+msgstr "continuo in %s"
+
+#: eval.c:9639
+msgid "E133: :return not inside a function"
+msgstr "E133: :return fuori da una funzione"
+
+#: eval.c:9970
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# variabili globali:\n"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Entro modalità Debug. Batti \"cont\" per continuare."
+
+#: ex_cmds2.c:96 ex_docmd.c:968
+#, c-format
+msgid "line %ld: %s"
+msgstr "linea %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "com: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Pausa in \"%s%s\" linea %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Breakpoint %s non trovato"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Nessun 'breakpoint' definito"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s linea %ld"
+
+#: ex_cmds2.c:761 ex_cmds.c:2097
+msgid "Save As"
+msgstr "Salva con Nome"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Salvare modifiche a \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9398
+msgid "Untitled"
+msgstr "Senza Nome"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" non salvato dopo modifica"
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Attenzione: Entrato in altro buffer inaspettatamente (controllare "
+"autocomandi)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: C'è un solo file da elaborare"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Non posso andare davanti al primo file"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Non posso oltrepassare l'ultimo file"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: compilatore non supportato: %s"
+
+#: ex_cmds2.c:1901
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Cerco \"%s\" in \"%s\""
+
+#: ex_cmds2.c:1923
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Cerco \"%s\""
+
+#: ex_cmds2.c:1945
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "non trovato in 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1979
+msgid "Source Vim script"
+msgstr "Esegui script Vim"
+
+#: ex_cmds2.c:2169
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Non riesco ad eseguire una directory: \"%s\""
+
+#: ex_cmds2.c:2207
+#, c-format
+msgid "could not source \"%s\""
+msgstr "non riesco ad eseguire \"%s\""
+
+#: ex_cmds2.c:2209
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "linea %ld: non riesco ad eseguire \"%s\""
+
+#: ex_cmds2.c:2223
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "eseguo \"%s\""
+
+#: ex_cmds2.c:2225
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "linea %ld: eseguo \"%s\""
+
+#: ex_cmds2.c:2368
+#, c-format
+msgid "finished sourcing %s"
+msgstr "esecuzione di %s terminata"
+
+#: ex_cmds2.c:2712
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Attenzione: Separatore di linea errato, forse manca ^M"
+
+#: ex_cmds2.c:2761
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding usato fuori da un file di comandi"
+
+#: ex_cmds2.c:2794
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish usato fuori da file di comandi"
+
+#: ex_cmds2.c:3243
+#, c-format
+msgid "Page %d"
+msgstr "Pagina %d"
+
+#: ex_cmds2.c:3399
+msgid "No text to be printed"
+msgstr "Manca testo da stampare"
+
+#: ex_cmds2.c:3477
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Sto stampando pagina %d (%d%%)"
+
+#: ex_cmds2.c:3489
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Copia %d di %d"
+
+#: ex_cmds2.c:3547
+#, c-format
+msgid "Printed: %s"
+msgstr "Stampato: %s"
+
+#: ex_cmds2.c:3554
+msgid "Printing aborted"
+msgstr "Stampa non completata'"
+
+#: ex_cmds2.c:3919
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Errore in scrittura a file PostScript di output"
+
+#: ex_cmds2.c:4194
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Non riesco ad aprire il file \"%s\""
+
+#: ex_cmds2.c:4204 ex_cmds2.c:4829
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Non riesco a leggere file risorse PostScript \"%s\""
+
+#: ex_cmds2.c:4212
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: file \"%s\" non è un file di risorse PostScript"
+
+#: ex_cmds2.c:4227 ex_cmds2.c:4247 ex_cmds2.c:4262 ex_cmds2.c:4284
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: file \"%s\" non è un file di risorse PostScript supportato"
+
+#: ex_cmds2.c:4314
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: il file di risorse \"%s\" ha una versione sbagliata"
+
+#: ex_cmds2.c:4781
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Non riesco ad aprire file PostScript di output"
+
+#: ex_cmds2.c:4814
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Non riesco ad aprire il file \"%s\""
+
+#: ex_cmds2.c:4933
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Non trovo file risorse PostScript \"prolog.ps\""
+
+#: ex_cmds2.c:4964
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Non trovo file risorse PostScript \"%s.ps\""
+
+#: ex_cmds2.c:4982
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: Impossibile convertire da multi-byte a codifica \"%s\""
+
+#: ex_cmds2.c:5107
+msgid "Sending to printer..."
+msgstr "Invio a stampante..."
+
+#: ex_cmds2.c:5111
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Non riesco ad aprire file PostScript"
+
+#: ex_cmds2.c:5113
+msgid "Print job sent."
+msgstr "Richiesta di stampa inviata."
+
+#: ex_cmds2.c:5623
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Lingua %sin uso: \"%s\""
+
+#: ex_cmds2.c:5634
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Non posso impostare lingua a \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Esa %02x, Ottale %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Esa %04x, Ottale %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Esa %08x, Ottale %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Movimento di linee verso se stesse"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 linea mossa"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld linee mosse"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld linee filtrate"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Gli autocomandi non devono modificare il buffer in uso"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Non salvato dopo l'ultima modifica]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s nella linea: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Troppi errori, ignoro il resto del file"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Lettura file viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " informazione"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " mark"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " FALLITO"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: File viminfo \"%s\" inaccessibile in scrittura"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Non riesco a scrivere il file viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Scrivo file viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Questo file viminfo è stato generato da Vim %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# File modificabile, attento a quel che fai!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Valore di 'encoding' al momento della scrittura di questo file\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Carattere iniziale non ammesso"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: File già caricato in un altro buffer"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Scrivo il file incompleto?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Usa ! per scrivere il buffer incompleto"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Riscrittura del file esistente \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Manca nome file per il buffer %ld"
+
+#: ex_cmds.c:2406
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: File non scritto: Scrittura inibita da opzione 'write'"
+
+#: ex_cmds.c:2426
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"opzione 'readonly' attiva per \"%.*s\".\n"
+"Vuoi scrivere comunque?"
+
+#: ex_cmds.c:2599
+msgid "Edit File"
+msgstr "Elabora File"
+
+#: ex_cmds.c:3207
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr ""
+"E143: Gli autocomandi hanno inaspettatamente cancellato il nuovo buffer %s"
+
+#: ex_cmds.c:3341
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: argomento non-numerico a :z"
+
+#: ex_cmds.c:3426
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Comandi Shell non permessi in rvim"
+
+#: ex_cmds.c:3533
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Le espressioni regolari non possono essere delimitate da lettere"
+
+#: ex_cmds.c:3879
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "sostituire con %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4272
+msgid "(Interrupted) "
+msgstr "(Interrotto) "
+
+#: ex_cmds.c:4276
+msgid "1 substitution"
+msgstr "1 sostituzione"
+
+#: ex_cmds.c:4278
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld sostituzioni"
+
+#: ex_cmds.c:4281
+msgid " on 1 line"
+msgstr " in 1 linea"
+
+#: ex_cmds.c:4283
+#, c-format
+msgid " on %ld lines"
+msgstr " in %ld linee"
+
+#: ex_cmds.c:4334
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global non può essere usato ricorsivamente"
+
+#: ex_cmds.c:4369
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Manca espressione regolare nel comando 'global'"
+
+#: ex_cmds.c:4418
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Espressione trovata su ogni linea: %s"
+
+#: ex_cmds.c:4499
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ultima Stringa Sostituzione:\n"
+"$"
+
+#: ex_cmds.c:4600
+msgid "E478: Don't panic!"
+msgstr "E478: Non lasciarti prendere dal panico!"
+
+#: ex_cmds.c:4652
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Spiacente, nessun aiuto '%s' per %s"
+
+#: ex_cmds.c:4655
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Spiacente, nessun aiuto per %s"
+
+#: ex_cmds.c:4689
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Spiacente, non trovo file di aiuto \"%s\""
+
+#: ex_cmds.c:5192
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s non è una directory"
+
+#: ex_cmds.c:5331
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Non posso aprire %s in scrittura"
+
+#: ex_cmds.c:5367
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Non riesco ad aprire %s in lettura"
+
+#: ex_cmds.c:5389
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: Codifiche diverse fra file di aiuto nella stessa lingua: %s"
+
+#: ex_cmds.c:5467
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Tag duplicata \"%s\" nel file %s"
+
+#: ex_cmds.c:5579
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Comando 'sign' sconosciuto: %s"
+
+#: ex_cmds.c:5599
+msgid "E156: Missing sign name"
+msgstr "E156: Manca nome 'sign'"
+
+#: ex_cmds.c:5645
+msgid "E612: Too many signs defined"
+msgstr "E612: Troppi 'sign' definiti"
+
+#: ex_cmds.c:5713
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Testo 'sign' non valido: %s"
+
+#: ex_cmds.c:5744 ex_cmds.c:5935
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: 'sign' sconosciuto: %s"
+
+#: ex_cmds.c:5793
+msgid "E159: Missing sign number"
+msgstr "E159: Manca numero 'sign'"
+
+#: ex_cmds.c:5875
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Nome buffer non valido: %s"
+
+#: ex_cmds.c:5914
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: ID 'sign' non valido: %ld"
+
+#: ex_cmds.c:5984
+msgid " (NOT FOUND)"
+msgstr " (NON TROVATO)"
+
+#: ex_cmds.c:5986
+msgid " (not supported)"
+msgstr " (non supportata)"
+
+#: ex_cmds.c:6085
+msgid "[Deleted]"
+msgstr "[Cancellato]"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Entro modalità Ex. Batti \"visual\" per tornare a modalità Normale."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Alla fine-file"
+
+#: ex_docmd.c:670
+msgid "E169: Command too recursive"
+msgstr "E169: Comando troppo ricorsivo"
+
+#: ex_docmd.c:1232
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Eccezione non intercettata: %s"
+
+#: ex_docmd.c:1320
+msgid "End of sourced file"
+msgstr "Fine del file di comandi"
+
+#: ex_docmd.c:1321
+msgid "End of function"
+msgstr "Fine funzione "
+
+#: ex_docmd.c:1910
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Uso ambiguo di comando definito dall'utente"
+
+#: ex_docmd.c:1924
+msgid "E492: Not an editor command"
+msgstr "E492: Non è un comando dell'editor"
+
+#: ex_docmd.c:2031
+msgid "E493: Backwards range given"
+msgstr "E493: Intervallo rovesciato"
+
+#: ex_docmd.c:2040
+msgid "Backwards range given, OK to swap"
+msgstr "Intervallo rovesciato, OK invertirlo"
+
+#: ex_docmd.c:2163
+msgid "E494: Use w or w>>"
+msgstr "E494: Usa w oppure w>>"
+
+#: ex_docmd.c:3789
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Spiacente, comando non disponibile in questa versione"
+
+#: ex_docmd.c:3992
+msgid "E172: Only one file name allowed"
+msgstr "E172: Ammesso un solo nome file"
+
+#: ex_docmd.c:4572
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 ulteriore file da elaborare. Esco lo stesso?"
+
+#: ex_docmd.c:4575
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "%d ulteriori file da elaborare. Esco lo stesso?"
+
+#: ex_docmd.c:4582
+msgid "E173: 1 more file to edit"
+msgstr "E173: ancora 1 file da elaborare"
+
+#: ex_docmd.c:4584
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: ancora %ld file da elaborare"
+
+#: ex_docmd.c:4679
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Il comando esiste già: aggiungi ! per sostituirlo"
+
+#: ex_docmd.c:4790
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Nome Arg. Inter Completo Definizione"
+
+#: ex_docmd.c:4879
+msgid "No user-defined commands found"
+msgstr "Non trovo comandi definiti dall'utente"
+
+#: ex_docmd.c:4911
+msgid "E175: No attribute specified"
+msgstr "E175: Nessun attributo specificato"
+
+#: ex_docmd.c:4963
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Numero di argomenti non valido"
+
+#: ex_docmd.c:4978
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Non si può specificare due volte il contatore"
+
+#: ex_docmd.c:4988
+msgid "E178: Invalid default value for count"
+msgstr "E178: Valore predefinito del contatore non valido"
+
+#: ex_docmd.c:5019
+msgid "E179: argument required for complete"
+msgstr "E179: argomento necessario per complete"
+
+#: ex_docmd.c:5051
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Valore %s non valido per 'complete'"
+
+#: ex_docmd.c:5060
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr ""
+"E468: Argomento di completamento permesso solo per completamento "
+"personalizzato"
+
+#: ex_docmd.c:5066
+msgid "E467: Custom completion requires a function argument"
+msgstr ""
+"E467: Il completamento personalizzato richiede un argomento di funzione"
+
+#: ex_docmd.c:5077
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Attributo non valido: %s"
+
+#: ex_docmd.c:5120
+msgid "E182: Invalid command name"
+msgstr "E182: Nome comando non valido"
+
+#: ex_docmd.c:5135
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr ""
+"E183 I comandi definiti dall'utente devono iniziare con lettera maiuscola"
+
+#: ex_docmd.c:5206
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Comando definito dall'utente %s inesistente"
+
+#: ex_docmd.c:5667
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Non riesco a trovare schema colore %s"
+
+#: ex_docmd.c:5675
+msgid "Greetings, Vim user!"
+msgstr "Salve, utente Vim!"
+
+#: ex_docmd.c:6393
+msgid "Edit File in new window"
+msgstr "Apri il File in una nuova finestra"
+
+#: ex_docmd.c:6688
+msgid "No swap file"
+msgstr "Non posso creare un file di swap"
+
+#: ex_docmd.c:6792
+msgid "Append File"
+msgstr "In aggiunta al File"
+
+#: ex_docmd.c:6856
+msgid "E186: No previous directory"
+msgstr "E186: Non c'è una directory precedente"
+
+#: ex_docmd.c:6938
+msgid "E187: Unknown"
+msgstr "E187: Sconosciuto"
+
+#: ex_docmd.c:7023
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize richiede due argomenti numerici"
+
+#: ex_docmd.c:7079
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Posizione finestra: X %d, Y %d"
+
+#: ex_docmd.c:7084
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: Informazioni posizione finestra non disponibili su questa piattaforma"
+
+#: ex_docmd.c:7094
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos richiede due argomenti numerici"
+
+#: ex_docmd.c:7372
+msgid "Save Redirection"
+msgstr "Salva Redirezione"
+
+#: ex_docmd.c:7562
+msgid "Save View"
+msgstr "Salva Veduta"
+
+#: ex_docmd.c:7563
+msgid "Save Session"
+msgstr "Salva Sessione"
+
+#: ex_docmd.c:7565
+msgid "Save Setup"
+msgstr "Salva Setup"
+
+#: ex_docmd.c:7717
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" esiste (aggiungi ! per eseguire comunque)"
+
+#: ex_docmd.c:7722
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Non riesco ad aprire \"%s\" in scrittura"
+
+#. set mark
+#: ex_docmd.c:7746
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr ""
+"E191: L'argomento deve essere una lettera, oppure un apice/apice retroverso"
+
+#: ex_docmd.c:7788
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Uso ricorsivo di :normal troppo esteso"
+
+#: ex_docmd.c:8306
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Nessun nome file alternativo da sostituire a '#'"
+
+#: ex_docmd.c:8337
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: nessun file di autocomandi da sostituire per \"<afile>\""
+
+#: ex_docmd.c:8345
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr ""
+"E496: nessun numero di buffer di autocomandi da sostituire per \"<abuf>\""
+
+#: ex_docmd.c:8356
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"E497: nessun nome di autocomandi trovato da sostituire per \"<amatch>\""
+
+#: ex_docmd.c:8366
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr ""
+"E498: nessun nome di file :source trovato da sostituire per \"<sfile>\""
+
+#: ex_docmd.c:8407
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Un nome di file nullo per '%' or '#', va bene solo con \":p:h\""
+
+#: ex_docmd.c:8409
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Il valore è una stringa nulla"
+
+#: ex_docmd.c:9380
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Non posso aprire il file viminfo in lettura"
+
+#: ex_docmd.c:9553
+msgid "E196: No digraphs in this version"
+msgstr "E196: Digrammi non supportati in questa versione"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Impossibile lanciare eccezioni con prefisso 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Eccezione lanciata: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Eccezione finita: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Eccezione scartata: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, linea %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Eccezione intercettata: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s reso 'pending'"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s ripristinato"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s scartato"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Eccezione"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "Errore ed interruzione"
+
+#: ex_eval.c:754 gui.c:4381
+msgid "Error"
+msgstr "Errore"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Interruzione"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: nidificazione di :if troppo estesa"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif senza :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else senza :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif senza :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: :else multipli"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif dopo :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: nidificazione di :while troppo estesa"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue senza :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break senza :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: nidificazione di :try troppo estesa"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch senza :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch dopo :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally senza :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: :finally multipli"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry senza :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction non contenuto in una funzione"
+
+#: ex_getln.c:3299
+msgid "tagname"
+msgstr "nome_tag"
+
+#: ex_getln.c:3302
+msgid " kind file\n"
+msgstr " tipo file\n"
+
+#: ex_getln.c:4768
+msgid "'history' option is zero"
+msgstr "l'opzione 'history' è a zero"
+
+#: ex_getln.c:5039
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Storia (da più recente a meno recente):\n"
+
+#: ex_getln.c:5040
+msgid "Command Line"
+msgstr "Linea di Comando"
+
+#: ex_getln.c:5041
+msgid "Search String"
+msgstr "Stringa di Ricerca"
+
+#: ex_getln.c:5042
+msgid "Expression"
+msgstr "Espressione"
+
+#: ex_getln.c:5043
+msgid "Input Line"
+msgstr "Linea di Input"
+
+#: ex_getln.c:5081
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar dopo la fine del comando"
+
+#: ex_getln.c:5258
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Finestra attiva o buffer cancellato"
+
+#: fileio.c:378
+msgid "Illegal file name"
+msgstr "Nome di file non ammesso"
+
+#: fileio.c:402 fileio.c:540 fileio.c:2925 fileio.c:2966
+msgid "is a directory"
+msgstr "è una directory"
+
+#: fileio.c:404
+msgid "is not a file"
+msgstr "non è un file"
+
+#: fileio.c:562 fileio.c:4143
+msgid "[New File]"
+msgstr "[File nuovo]"
+
+#: fileio.c:595
+msgid "[Permission Denied]"
+msgstr "[Tipo di accesso non consentito]"
+
+#: fileio.c:706
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Gli autocomand *ReadPre hanno reso il file illeggibile"
+
+#: fileio.c:708
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Gli autocomandi *ReadPre non devono modificare il buffer in uso"
+
+#: fileio.c:729
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Leggo da 'stdin'...\n"
+
+#: fileio.c:735
+msgid "Reading from stdin..."
+msgstr "Leggo da 'stdin'..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1012
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: La conversione ha reso il file illeggibile!"
+
+#: fileio.c:2102
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:2109
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2116
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:2124
+msgid "[RO]"
+msgstr "[Sola Lettura]"
+
+#: fileio.c:2134
+msgid "[CR missing]"
+msgstr "[manca CR]"
+
+#: fileio.c:2139
+msgid "[NL found]"
+msgstr "[trovata NL]"
+
+#: fileio.c:2144
+msgid "[long lines split]"
+msgstr "[linee lunghe divise]"
+
+#: fileio.c:2150 fileio.c:4127
+msgid "[NOT converted]"
+msgstr "[NON convertito]"
+
+#: fileio.c:2155 fileio.c:4132
+msgid "[converted]"
+msgstr "[convertito]"
+
+#: fileio.c:2162 fileio.c:4157
+msgid "[crypted]"
+msgstr "[crittografato]"
+
+#: fileio.c:2169
+msgid "[CONVERSION ERROR]"
+msgstr "[ERRORE DI CONVERSIONE]"
+
+#: fileio.c:2175
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[BYTE NON VALIDO alla linea %ld]"
+
+#: fileio.c:2182
+msgid "[READ ERRORS]"
+msgstr "[ERRORI IN LETTURA]"
+
+#: fileio.c:2398
+msgid "Can't find temp file for conversion"
+msgstr "Non riesco a trovare il file temp per leggerlo"
+
+#: fileio.c:2405
+msgid "Conversion with 'charconvert' failed"
+msgstr "Conversione fallita con 'charconvert'"
+
+#: fileio.c:2408
+msgid "can't read output of 'charconvert'"
+msgstr "non riesco a leggere il risultato di 'charconvert'"
+
+#: fileio.c:2808
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Buffer in scrittuta cancellato o scaricato dagli autocomandi"
+
+#: fileio.c:2831
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: L'autocomando ha modificato numero linee in maniera imprevista"
+
+#: fileio.c:2869
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans non permette la scrittura di un buffer non modificato"
+
+#: fileio.c:2877
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "Scrittura parziale disabilitata per i buffer di NetBeans"
+
+#: fileio.c:2931 fileio.c:2949
+msgid "is not a file or writable device"
+msgstr "non è un file o un dispositivo su cui si possa scrivere"
+
+#: fileio.c:3001
+msgid "is read-only (add ! to override)"
+msgstr "è in sola letture (aggiungi ! per eseguire comunque)"
+
+#: fileio.c:3347
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr ""
+"E506: Non posso scrivere sul file di backup (aggiungi ! per eseguire "
+"comunque)"
+
+#: fileio.c:3359
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr ""
+"E507: Errore in chiusura sul file di backup (aggiungi ! per eseguire "
+"comunque)"
+
+#: fileio.c:3361
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr ""
+"E508: Non riesco a leggere il file di backup (aggiungi ! per eseguire "
+"comunque)"
+
+#: fileio.c:3377
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr ""
+"E509: Non posso creare il file di backup (aggiungi ! per eseguire comunque)"
+
+#: fileio.c:3480
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr ""
+"E510: Non posso fare il file di backup (aggiungi ! per eseguire comunque)"
+
+#: fileio.c:3542
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr ""
+"E460: La 'fork' sulla risorsa verrebbe persa (aggiungi ! per eseguire "
+"comunque)"
+
+#: fileio.c:3652
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Non riesco a trovare un file 'temp' su cui scrivere"
+
+#: fileio.c:3670
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr ""
+"E213: Non riesco a convertire (aggiungi ! per scrivere senza conversione)"
+
+#: fileio.c:3705
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Non posso aprire il file collegato ('linked') in scrittura"
+
+#: fileio.c:3709
+msgid "E212: Can't open file for writing"
+msgstr "E212: Non posso aprire il file in scrittura"
+
+#: fileio.c:3971
+msgid "E667: Fsync failed"
+msgstr "E667: Fsync fallito"
+
+#: fileio.c:3978
+msgid "E512: Close failed"
+msgstr "E512: Chiusura fallita"
+
+#: fileio.c:4049
+msgid "E513: write error, conversion failed"
+msgstr "E513: errore in scrittura, conversione fallita"
+
+#: fileio.c:4055
+msgid "E514: write error (file system full?)"
+msgstr "E514: errore in scrittura ('File System' pieno?)"
+
+#: fileio.c:4122
+msgid " CONVERSION ERROR"
+msgstr " ERRORE DI CONVERSIONE"
+
+#: fileio.c:4138
+msgid "[Device]"
+msgstr "[Dispositivo]"
+
+#: fileio.c:4143
+msgid "[New]"
+msgstr "[Nuovo]"
+
+#: fileio.c:4165
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4165
+msgid " appended"
+msgstr " aggiunto in fondo"
+
+#: fileio.c:4167
+msgid " [w]"
+msgstr " [s]"
+
+#: fileio.c:4167
+msgid " written"
+msgstr " scritti"
+
+#: fileio.c:4217
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patchmode: non posso salvare il file originale"
+
+#: fileio.c:4239
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: non posso alterare il file vuoto originale"
+
+#: fileio.c:4254
+msgid "E207: Can't delete backup file"
+msgstr "E193: Non riesco a cancellare il file di backup"
+
+#: fileio.c:4318
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ATTENZIONE: Il file originale può essere perso o danneggiato\n"
+
+#: fileio.c:4320
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "non uscire dall'editor prima della fine della scrittura del file!"
+
+#: fileio.c:4409
+msgid "[dos]"
+msgstr "[DOS]"
+
+#: fileio.c:4409
+msgid "[dos format]"
+msgstr "[in formato DOS]"
+
+#: fileio.c:4416
+msgid "[mac]"
+msgstr "[MAC]"
+
+#: fileio.c:4416
+msgid "[mac format]"
+msgstr "[in formato MAC]"
+
+#: fileio.c:4423
+msgid "[unix]"
+msgstr "[UNIX]"
+
+#: fileio.c:4423
+msgid "[unix format]"
+msgstr "[in formato UNIX]"
+
+#: fileio.c:4450
+msgid "1 line, "
+msgstr "1 linea, "
+
+#: fileio.c:4452
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld linee,"
+
+#: fileio.c:4455
+msgid "1 character"
+msgstr "1 carattere"
+
+#: fileio.c:4457
+#, c-format
+msgid "%ld characters"
+msgstr "%ld caratteri"
+
+#: fileio.c:4467
+msgid "[noeol]"
+msgstr "[manca carattere di fine linea]"
+
+#: fileio.c:4467
+msgid "[Incomplete last line]"
+msgstr "[Ultima linea incompleta]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4486
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ATTENZIONE: File modificato dopo essere stato letto dall'Editor!!!"
+
+#: fileio.c:4488
+msgid "Do you really want to write to it"
+msgstr "Vuoi davvero riscriverlo"
+
+#: fileio.c:5738
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Errore in scrittura di \"%s\""
+
+#: fileio.c:5745
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Errore in chiusura di \"%s\""
+
+#: fileio.c:5748
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Errore in lettura di \"%s\""
+
+#: fileio.c:5982
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: L'autocomando 'FileChnagedShell' ha cancellato il buffer"
+
+#: fileio.c:5989
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Attenzione: Il file \"%s\" non esiste più"
+
+#: fileio.c:6003
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Attenzione: File \"%s\" modificato su disco ed anche nel buffer di Vim"
+
+#: fileio.c:6006
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Attenzione: File \"%s\" modificato dopo l'apertura"
+
+#: fileio.c:6008
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Attenzione: Modo File \"%s\" modificato dopo l'apertura"
+
+#: fileio.c:6018
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Attenzione: Il file \"%s\" risulta creato dopo l'apertura"
+
+#: fileio.c:6031
+msgid "See \":help W11\" for more info."
+msgstr "Vedere \":help W11\" per ulteriori informazioni."
+
+#: fileio.c:6045
+msgid "Warning"
+msgstr "Attenzione"
+
+#: fileio.c:6046
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Carica File"
+
+#: fileio.c:6152
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Non riesco a preparare per ri-caricare \"%s\""
+
+#: fileio.c:6171
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Non riesco a ri-caricare \"%s\""
+
+#: fileio.c:6752
+msgid "--Deleted--"
+msgstr "--Cancellato--"
+
+#. the group doesn't exist
+#: fileio.c:6912
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Gruppo inesistente: \"%s\""
+
+#: fileio.c:7038
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Carattere non ammesso dopo *: %s"
+
+#: fileio.c:7050
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Evento inesistente: %s"
+
+#: fileio.c:7052
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: Evento o gruppo inesistente: %s"
+
+#. Highlight title
+#: fileio.c:7210
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Comandi ---"
+
+#: fileio.c:7481
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Non posso eseguire autocomandi for TUTTI gli eventi"
+
+#: fileio.c:7504
+msgid "No matching autocommands"
+msgstr "Nessun autocomando corrispondente"
+
+#: fileio.c:7825
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: nidificazione dell'autocomando troppo estesa"
+
+#: fileio.c:8100
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto comandi per \"%s\""
+
+#: fileio.c:8108
+#, c-format
+msgid "Executing %s"
+msgstr "Eseguo %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8176
+#, c-format
+msgid "autocommand %s"
+msgstr "autocomando %s"
+
+#: fileio.c:8743
+msgid "E219: Missing {."
+msgstr "E219: Manca {."
+
+#: fileio.c:8745
+msgid "E220: Missing }."
+msgstr "E220: Manca }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Non trovo alcuna piegatura"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Non posso create piegatura con il 'foldmethod' in uso"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Non posso cancellare piegatura con il 'foldmethod' in uso"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Aggiunto al buffer di lettura"
+
+#: getchar.c:2208
+msgid "E223: recursive mapping"
+msgstr "E223: mapping ricorsivo"
+
+#: getchar.c:3087
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: una abbreviazione globale già esiste per %s"
+
+#: getchar.c:3090
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: un mapping globale già esiste per %s"
+
+#: getchar.c:3222
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: una abbreviazione già esiste per %s"
+
+#: getchar.c:3225
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: un mapping già esiste per %s"
+
+#: getchar.c:3289
+msgid "No abbreviation found"
+msgstr "Non trovo l'abbreviazione"
+
+#: getchar.c:3291
+msgid "No mapping found"
+msgstr "Non trovo il mapping"
+
+#: getchar.c:4183
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: modo non consentito"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<non posso aprire> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: non riesco a trovare il font %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: non posso tornare alla directory in uso"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Nome percorso:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: non riesco ad ottenere la directory in uso"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Non eseguire"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Dialogo Vim"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: Non riesco a ottenere geometria del 'thumb pixmap'."
+
+#: gui_beval.c:101 gui_w32.c:3978
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Non riesco a creare 'BalloonEval' con sia messaggio che callback"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Non posso inizializzare la GUI"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Non posso leggere da \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: Non posso inizializzare la GUI, nessun font valido trovato"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' non valido"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: Il valore di 'imactivatekey' non è valido"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Non riesco ad allocare il colore %s"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Dialogo Vim..."
+
+#: gui_gtk.c:2060 message.c:2999
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Y Sì\n"
+"&No\n"
+"&C Ignora"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "_Metodi di inserimento"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Sostituisci..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Cerca..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Trova cosa:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Sostituisci con:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Cerca solo la parola intera"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Maiuscole/minuscole"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Direzione"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "Su"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "Giù"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Trova il Prossimo"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Sostituisci"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Sostituisci Tutto"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Ricevuta richiesta \"die\" dal session manager\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: Finestra principale distrutta inaspettatamente\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Selezione Font"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Uso CUT_BUFFER0 invece che una scelta nulla"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtro"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Directory"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Aiuto"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "File"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Selezione"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Disfa"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Non riesco a caricate il fonte Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Non riesco a usare il font %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Spedisco un messaggio per terminare il processo figlio.\n"
+
+#: gui_w32.c:839
+#, c-format
+msgid "E671: Cannot find window title \"%s\""
+msgstr "E671: Non trovo il titolo della finestra \"%s\""
+
+#: gui_w32.c:847
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argomento non supportato: \"-%s\"; Usa la versione OLE."
+
+#: gui_w32.c:1100
+msgid "E672: Unable to open window inside MDI application"
+msgstr "E672: Non posso aprire la finestra in un'applicazione MDI"
+
+#: gui_w48.c:2163
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Stringa di ricerca (usa '\\\\' per cercare un '\\')"
+
+#: gui_w48.c:2188
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Sostituisci (usa '\\\\' per cercare un '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Non riesco ad allocare elemento di colormap, possibili colori "
+"errati"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Mancano descrizioni per i seguenti caratteri nel font: %s"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nome fontset: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Il font '%s' non di larghezza fissa"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nome fontset: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%ld width is not twice that of font0\n"
+msgstr "La larghezza di font%ld non è doppia di quella di font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Larghezza di Font0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Larghezza di Font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ERRORE processore Hangul"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Aggiungi un nuovo database"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Cerca un modello"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Visualizza questo messaggio"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Termina una connessione"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Rinizializza tutte le connessioni"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Visualizza connessioni"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Uso: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Questo comando cscope non gestisce la divisione delle schermo.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Uso: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tag non trovata"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: errore stat(%s): %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: errore stat"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s non è una directory o un database cscope valido"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Aggiunto database cscope %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: errore leggendo connessione cscope %ld"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: tipo di ricerca cscope sconosciuta"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Non riesco a creare pipes cscope"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Non riesco a fare fork per cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection exec fallita"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Non riesco a generare processo cscope"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen di to_fp fallita"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen di fr_fp fallita"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: nessuna connessione cscope"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: nessuna corrispondenza trovata per la richiesta cscope %s di %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: flag cscopequickfix %c non valido per %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "comandi cscope:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Uso: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: impossibile aprire database cscope: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: impossibile leggere informazioni sul database cscope"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: database cscope duplicato, non aggiunto"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: raggiunto numero massimo di connessioni cscope"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: connessione cscope %s non trovata"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "connessione cscope %s chiusa"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: errore irreparabile in cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Tag cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # linea"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "nomefile / contest / linea\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Errore cscope: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Tutti i databese cscope annullati"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "nessuna connessione cscope\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid database nome prepend path\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Spiacente, comando non disponibile, non riesco a caricare libreria "
+"programmi Python."
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Python non può essere chiamato ricorsivamente"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "non riesco a cancellare gli attributi OutputObject"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace deve essere un numero intero"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "atrributo non valido"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() richiede una lista di stringhe"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Errore inizializzazione oggetti I/O"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "espressione non valida"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "espressioni disabilitate in compilazione"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "tentativo di referenza a buffer cancellato"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "numero linea non nell'intervallo"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer oggetto (cancellato) a %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "nome di mark non valido"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "buffer inesistente"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "tentativo di referenza a una finestra cancellata"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "attributo 'readonly'"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "posizione cursore fuori dal buffer"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<finestra oggetto (cancellata) a %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<finestra oggetto (sconosciuta) a %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<finestra %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "finestra inesistente"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "non riesco a salvare informazioni per 'undo'"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "non posso cancellare la linea"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "non posso sostituire la linea"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "non posso inserire la linea"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "la stringa non può contenere caratteri 'A CAPO'"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Spiacente, comando non disponibile, non riesco a caricare libreria "
+"programmi Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: tipo sconosciuto di salto nel programma %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Implementazione/definizione Sì/No"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Visualizza classe base di"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Visualizza funzione modulo sovrascritto"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Carica da file"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Carica da progetto"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Carica da tutti i progetti"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Carica successivo"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Visualizza sorgente di"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Trova simbolo"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Esplora classe"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Visualizza classe in gerarchia"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Visualizza classe nella gerarchia ristretta"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref si riferisce a"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref referenziato da"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ha un"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref usato da"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Visualizza docu di"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Genera docu per"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Non riesco a connettermi a SNiFF+. Controllare ambiente (sniffemacs deve "
+"essere presente in $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Errore in lettura. Disconnessione."
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ è al momento "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "non "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "connesso"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Richiesta SNiFF+ sconosciuta: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Errore connettendosi a SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ non connesso"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Non è un buffer SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Errore in scrittura. Disconnesso"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "numero buffer non valido"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "non ancora implementato"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "opzione inesistente"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "non posso impostare linea(e)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "mark non impostato"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "riga %d colonna %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "non riesco a inserire/aggiungere linea"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "opzione inesistente: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "'vimOption' inesistente"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "interruzione dalla tastiera"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "errore vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr ""
+"non riesco a creare comando buffer/finestra: oggetto in via di cancellazione"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"non posso registrare comando callback: buffer/finestra già in cancellazione"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: ERRORE FATALE TCL: reflist corrotta!? Si prega notificare a vim-"
+"dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"non posso registrare comando callback: referenza a buffer/finestra "
+"inesistente"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Spiacente, comando non disponibile, non riesco a caricare libreria "
+"programmi Tcl."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: ERRORE TCL: codice di ritorno non int!? Si prega notificare a vim-"
+"dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "non riesco a ottenere la linea"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Non riesco a registrare un nome di server comando"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Fallito invio comando a programma destinatario"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: Identificativo di server non valido: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: Proprietà registry relative a VIM non adeguate. Cancellate!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Opzione inesistente"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Troppi argomenti di edit"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Argomento mancante dopo"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Spazzatura dopo opzione"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "Troppi argomenti \"+command\", \"-c command\" o \"--cmd command\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Argomento non valido per"
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Vim non compilato con opzione 'diff'."
+
+#: main.c:935
+msgid "Attempt to open script file again: \""
+msgstr "Tento di riaprire lo script file: \""
+
+#: main.c:944
+msgid "Cannot open for reading: \""
+msgstr "Non posso aprire in lettura: \""
+
+#: main.c:988
+msgid "Cannot open for script output: \""
+msgstr "Non posso aprire come script output: \""
+
+#: main.c:1135
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d file da elaborare\n"
+
+#: main.c:1236
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Attenzione: Output non diretto a un terminale\n"
+
+#: main.c:1238
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Attenzione: Input non proveniente da un terminale\n"
+
+#. just in case..
+#: main.c:1306
+msgid "pre-vimrc command line"
+msgstr "linea comandi prima di vimrc"
+
+#: main.c:1347
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Non posso leggere da \"%s\""
+
+#: main.c:2420
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Maggiori informazioni con: \"vim -h\"\n"
+
+#: main.c:2453
+msgid "[file ..] edit specified file(s)"
+msgstr "[file ..] apri file(s) specificati"
+
+#: main.c:2454
+msgid "- read text from stdin"
+msgstr "- leggi testo da 'stdin'"
+
+#: main.c:2455
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag apri file in cui è definita la tag"
+
+#: main.c:2457
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] apri file col primo errore"
+
+#: main.c:2466
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" uso:"
+
+#: main.c:2469
+msgid " vim [arguments] "
+msgstr " vim [argomenti] "
+
+#: main.c:2473
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" o:"
+
+#: main.c:2476
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argomenti:\n"
+
+#: main.c:2477
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tSolo nomi file da qui in poi"
+
+#: main.c:2479
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tNon espandere wildcard"
+
+#: main.c:2482
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistra questo gvim a OLE"
+
+#: main.c:2483
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tDeregistra gvim a OLE"
+
+#: main.c:2486
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tEsegui usando GUI (come \"gvim\")"
+
+#: main.c:2487
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f opp. --nofork\tForeground: Non usare 'fork' inizializzando GUI"
+
+#: main.c:2489
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tModalità Vi (come \"vi\")"
+
+#: main.c:2490
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tModalità Ex (come \"ex\")"
+
+#: main.c:2491
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tModalità Silenziosa (batch) (solo per \"ex\")"
+
+#: main.c:2493
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tModalità Diff (come \"vimdiff\")"
+
+#: main.c:2495
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tModalità Facile (come \"evim\", senza modalità)"
+
+#: main.c:2496
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tModalità Sola Lettura (come \"view\")"
+
+#: main.c:2497
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tModalità Ristretta (come \"rvim\")"
+
+#: main.c:2498
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tRiscritture del file non permesse"
+
+#: main.c:2499
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tModifiche nel file non permesse"
+
+#: main.c:2500
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tModalità Binaria"
+
+#: main.c:2502
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tModalità Lisp"
+
+#: main.c:2504
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tCompatibile con Vi: 'compatible'"
+
+#: main.c:2505
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tNon interamente compatibile con Vi: 'nocompatible'"
+
+#: main.c:2506
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tLivello Verbosità"
+
+#: main.c:2507
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tModalità Debug"
+
+#: main.c:2508
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNiente file di swap, usa solo memoria"
+
+#: main.c:2509
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tLista swap file ed esci"
+
+#: main.c:2510
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (e nome file)\tRecupera da sessione finita male"
+
+#: main.c:2511
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tCome -r"
+
+#: main.c:2513
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNon usare newcli per aprire finestra"
+
+#: main.c:2514
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <dispositivo>\t\tUsa <dispositivo> per I/O"
+
+#: main.c:2517
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tComincia in modalità Araba"
+
+#: main.c:2520
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tComincia in modalità Ebraica"
+
+#: main.c:2523
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tComincia in modalità Farsi (Persiano)"
+
+#: main.c:2525
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminale>\tImposta tipo terminale a <terminale>"
+
+#: main.c:2526
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tUsa <vimrc> invece di .vimrc"
+
+#: main.c:2528
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tUsa <gvimrc> invece di .gvimrc"
+
+#: main.c:2530
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNon caricare script plugin"
+
+#: main.c:2531
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tApri N finestre (predefinito: una per ogni file)"
+
+#: main.c:2532
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tCome -o ma dividi le finestre in verticale"
+
+#: main.c:2533
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tPosizionati alla fine del file"
+
+#: main.c:2534
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tPosizionati alla linea <lnum>"
+
+#: main.c:2536
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr ""
+"--cmd <comando>\t\tEsegui <comando> prima di caricare eventuali file vimrc"
+
+#: main.c:2538
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <comando>\t\tEsegui <comando> dopo caricamento primo file"
+
+#: main.c:2539
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr ""
+"-S <sessione>\tEsegui comandi in file <sessione> dopo caricamento primo file"
+
+#: main.c:2540
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\tLeggi comandi in modalità normale da file <scriptin>"
+
+#: main.c:2541
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tAggiungi tutti i comandi immessi a file <scriptout>"
+
+#: main.c:2542
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tScrivi tutti i comandi immessi in file <scriptout>"
+
+#: main.c:2544
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tApri un file crittato"
+
+#: main.c:2548
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <schermo>\tEsegui vim a questo particolare server X"
+
+#: main.c:2550
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNon connetterti a server X"
+
+#: main.c:2553
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <file>\tApri <file> in un server Vim se possibile"
+
+#: main.c:2554
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <files> Stessa cosa, ignora se non esiste un server"
+
+#: main.c:2555
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <file> Come --remote ma aspetta che file siano elaborati"
+
+#: main.c:2556
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <files> Stessa cosa, ignora se non esiste un server"
+
+#: main.c:2557
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <tasti>\tInvia <tasti> a un server Vim ed esci"
+
+#: main.c:2558
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote--expr <expr>\tEsegui <expr> in un server Vim e stampa risultato"
+
+#: main.c:2559
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tLista nomi server Vim disponibili ed esci"
+
+#: main.c:2560
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <nome>\tInvia a/diventa server Vim di nome <nome>"
+
+#: main.c:2563
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tUsa <viminfo> invece di .viminfo"
+
+#: main.c:2565
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h opp. --help\tStampa Aiuto (questo messaggio) ed esci"
+
+#: main.c:2566
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tStampa informazioni sulla versione ed esci"
+
+#: main.c:2570
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Opzioni accettate da gvim (versione Motif):\n"
+
+#: main.c:2574
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Opzioni accettate da gvim (versione neXtaw):\n"
+
+#: main.c:2576
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Opzioni accettate da gvim (versione Athena):\n"
+
+#: main.c:2580
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <schermo>\tEsegui vim su <schermo>"
+
+#: main.c:2581
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tInizia vim riducendolo ad icona"
+
+#: main.c:2583
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nome>\t\tUsa risorsa come se vim fosse <nome>"
+
+#: main.c:2584
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Non implementato)\n"
+
+#: main.c:2586
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <colore>\tUsa <colore> come sfondo (anche: -bg)"
+
+#: main.c:2587
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <colore>\tUsa <colore> per il testo normale (anche: -fg)"
+
+#: main.c:2588 main.c:2608
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tUsa <font> for il testo normale (anche: -fn)"
+
+#: main.c:2589
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tUsa <font> per testo in grassetto"
+
+#: main.c:2590
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tUsa <font> per testo in corsivo"
+
+#: main.c:2591 main.c:2609
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tUsa <geom> per la geometria iniziale (anche: -geom)"
+
+#: main.c:2592
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <larg>\tUsa larghezza <larg> per bordo (anche: -bw)"
+
+#: main.c:2593
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <larg> Usa larghezza <larg> per scrollbar (anche: -sw)"
+
+#: main.c:2595
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <alt>\tUsa altezza <alt> per barra menu (anche: -mh)"
+
+#: main.c:2597 main.c:2610
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tUsa colori invertiti (anche: -rv)"
+
+#: main.c:2598
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNon usare colori invertiti (anche: +rv)"
+
+#: main.c:2599
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <risorsa>\tImposta la risorsa specificata"
+
+#: main.c:2602
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argomenti accettati da gvim (versione RISC OS):\n"
+
+#: main.c:2603
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <numero>\tLarghezza iniziale finestra in colonne"
+
+#: main.c:2604
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <numero>\tAltezza iniziale finestra in righe"
+
+#: main.c:2607
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argomenti accettati da gvim (versione GTK+):\n"
+
+#: main.c:2611
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <schermo>\tEsegui vim su <schermo> (anche: --display)"
+
+#: main.c:2613
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr ""
+"--role <ruolo>\tImposta un ruolo univoco per identificare la finestra "
+"principale"
+
+#: main.c:2615
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tApri Vim dentro un altro 'widget' GTK"
+
+#: main.c:2618
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <titolo padre>\tApri Vim in un'applicazione padre"
+
+#: main.c:2856
+msgid "No display"
+msgstr "Manca display"
+
+#. Failed to send, abort.
+#: main.c:2871
+msgid ": Send failed.\n"
+msgstr ": Invio fallito.\n"
+
+#. Let vim start normally.
+#: main.c:2877
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Invio fallito. Tento di eseguire localmente\n"
+
+#: main.c:2915 main.c:2936
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d di %d elaborato"
+
+#: main.c:2958
+msgid "No display: Send expression failed.\n"
+msgstr "Nessun display: Invio di espressione fallito.\n"
+
+#: main.c:2970
+msgid ": Send expression failed.\n"
+msgstr ": Invio di espressione fallito.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "Nessun mark impostato"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Nessun mark corrispondente a \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"mark linea col.file/testo"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" salt.linea col.file/testo"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"modif linea col testo"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# File mark:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (dai più recenti):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Storia dei mark all'interno dei files (dai più recenti ai meno recenti):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Manca '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: Codepage non valido"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: Non posso assegnare valori IC"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: Creazione di un contesto di input fallita"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Apertura 'input method' fallita"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Attenzione: Non posso assegnare IM a 'destroy callback'"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: 'input method' non sopporta alcuno stile"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: 'input method' non supporta il mio tipo di preedit"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: stile 'over-the-spot' richiede fontset"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr ""
+"E291: Il tuo GTK+ è anteriore a versione 1.2.3. Area Status disabilitata"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server di 'Input Method' non in esecuzione"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: il blocco non era riservato"
+
+#: memfile.c:1010
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Errore di posizionamento durante lettura swap file"
+
+#: memfile.c:1015
+msgid "E295: Read error in swap file"
+msgstr "E295: Errore leggendo swap file"
+
+#: memfile.c:1067
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Errore di posizionamento scrivendo swap file"
+
+#: memfile.c:1085
+msgid "E297: Write error in swap file"
+msgstr "E297: Errore scrivendo swap file"
+
+#: memfile.c:1282
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Lo swap file esiste già (un link simbolico?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Non riesco a leggere blocco numero 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Non riesco a leggere blocco numero 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Non riesco a leggere blocco numero 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:444
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ahimè, lo swap file è perduto!!!"
+
+#: memline.c:449
+msgid "E302: Could not rename swap file"
+msgstr "E302: Non riesco a rinominare lo swap file"
+
+#: memline.c:519
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr ""
+"E303: Non riesco ad aprile lo swap file per \"%s\", recupero impossible"
+
+#: memline.c:618
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Non riesco a leggere blocco 0??"
+
+#: memline.c:758
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Nessun swap file trovato per %s"
+
+#: memline.c:768
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Dimmi numero di swap file da usare (0 per lasciar perdere): "
+
+#: memline.c:813
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Non riesco ad aprire %s"
+
+#: memline.c:835
+msgid "Unable to read block 0 from "
+msgstr "Non riesco a leggere il blocco 0 da "
+
+#: memline.c:838
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Forse non ci sono state modifiche oppure Vim non ha aggiornato lo swap file."
+
+#: memline.c:848 memline.c:865
+msgid " cannot be used with this version of Vim.\n"
+msgstr " non può essere usato con questa versione di Vim.\n"
+
+#: memline.c:850
+msgid "Use Vim version 3.0.\n"
+msgstr "Usa Vim versione 3.0.\n"
+
+#: memline.c:856
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s non sembra uno swap file Vim"
+
+#: memline.c:869
+msgid " cannot be used on this computer.\n"
+msgstr " non può essere usato su questo computer.\n"
+
+#: memline.c:871
+msgid "The file was created on "
+msgstr "Il file è stato creato il "
+
+#: memline.c:875
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"o il file è stato danneggiato."
+
+#: memline.c:904
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Uso swap file \"%s\""
+
+#: memline.c:910
+#, c-format
+msgid "Original file \"%s\""
+msgstr "File originale \"%s\""
+
+#: memline.c:923
+msgid "E308: Warning: Original file may have been changed"
+msgstr ""
+"E308: Attenzione: il file originale può essere stato modificato nel frattempo"
+
+#: memline.c:976
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Impossibile leggere blocco 1 da %s"
+
+#: memline.c:980
+msgid "???MANY LINES MISSING"
+msgstr "???MOLTE LINEE MANCANTI"
+
+#: memline.c:996
+msgid "???LINE COUNT WRONG"
+msgstr "???CONTATORE LINEE ERRATO"
+
+#: memline.c:1003
+msgid "???EMPTY BLOCK"
+msgstr "???BLOCCO VUOTO"
+
+#: memline.c:1029
+msgid "???LINES MISSING"
+msgstr "???LINEE MANCANTI"
+
+#: memline.c:1061
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID del Blocco 1 errato (che %s non sia un .swp file?)"
+
+#: memline.c:1066
+msgid "???BLOCK MISSING"
+msgstr "???BLOCCO MANCANTE"
+
+#: memline.c:1082
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? da qui fino a ???END le linee possono essere fuori ordine"
+
+#: memline.c:1098
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr ""
+"??? da qui fino a ???END linee possono essere state inserite/cancellate"
+
+#: memline.c:1118
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1144
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Recupero Interrotto"
+
+#: memline.c:1149
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: Errori durante recupero; controlla linee che iniziano con ???"
+
+#: memline.c:1151
+msgid "See \":help E312\" for more information."
+msgstr "Vedere \":help E312\" per ulteriori informazioni."
+
+#: memline.c:1156
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Recupero completato. Dovresti controllare se va tutto bene."
+
+#: memline.c:1157
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Potresti salvare questo file con un altro nome ed eseguire\n"
+
+#: memline.c:1158
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "'diff' rispetto al file originale per vedere le differenze)\n"
+
+#: memline.c:1159
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Cancella il file .swp in seguito.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1215
+msgid "Swap files found:"
+msgstr "Swap file trovati:"
+
+#: memline.c:1393
+msgid " In current directory:\n"
+msgstr " Nella directory in uso:\n"
+
+#: memline.c:1395
+msgid " Using specified name:\n"
+msgstr " Uso il nome fornito:\n"
+
+#: memline.c:1399
+msgid " In directory "
+msgstr " Nella directory "
+
+#: memline.c:1417
+msgid " -- none --\n"
+msgstr " -- nessuno --\n"
+
+#: memline.c:1489
+msgid " owned by: "
+msgstr " proprietario: "
+
+#: memline.c:1491
+msgid " dated: "
+msgstr " datato: "
+
+#: memline.c:1495 memline.c:3685
+msgid " dated: "
+msgstr " datato: "
+
+#: memline.c:1511
+msgid " [from Vim version 3.0]"
+msgstr " [da Vim versione 3.0]"
+
+#: memline.c:1515
+msgid " [does not look like a Vim swap file]"
+msgstr " [non assomiglia ad uno swap file Vim]"
+
+#: memline.c:1519
+msgid " file name: "
+msgstr " nome file: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" modificato: "
+
+#: memline.c:1526
+msgid "YES"
+msgstr "YES"
+
+#: memline.c:1526
+msgid "no"
+msgstr "no"
+
+#: memline.c:1530
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" nome utente: "
+
+#: memline.c:1537
+msgid " host name: "
+msgstr " nome computer: "
+
+#: memline.c:1539
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" nome computer: "
+
+#: memline.c:1545
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID del processo: "
+
+#: memline.c:1551
+msgid " (still running)"
+msgstr " (ancora attivo)"
+
+#: memline.c:1563
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [non utilizzabile con questa versione di Vim]"
+
+#: memline.c:1566
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [not utilizzabile su questo computer]"
+
+#: memline.c:1571
+msgid " [cannot be read]"
+msgstr " [non leggibile]"
+
+#: memline.c:1575
+msgid " [cannot be opened]"
+msgstr " [non riesco ad aprire]"
+
+#: memline.c:1765
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Non posso preservare, manca swap file"
+
+#: memline.c:1818
+msgid "File preserved"
+msgstr "File preservato"
+
+#: memline.c:1820
+msgid "E314: Preserve failed"
+msgstr "E314: Preservazione fallita"
+
+#: memline.c:1891
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: numero linea non valido: %ld"
+
+#: memline.c:1917
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: non riesco a trovare la linea %ld"
+
+#: memline.c:2307
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: ID blocco puntatori errato 3"
+
+#: memline.c:2387
+msgid "stack_idx should be 0"
+msgstr "stack_idx dovrebbe essere 0"
+
+#: memline.c:2449
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Aggiornati troppi blocchi?"
+
+#: memline.c:2631
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: ID blocco puntatori errato 4"
+
+#: memline.c:2658
+msgid "deleted block 1?"
+msgstr "cancellato blocco 1?"
+
+#: memline.c:2858
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Non riesco a trovare la linea %ld"
+
+#: memline.c:3101
+msgid "E317: pointer block id wrong"
+msgstr "E317: ID blocco puntatori errato"
+
+#: memline.c:3117
+msgid "pe_line_count is zero"
+msgstr "pe_line_count a zero"
+
+#: memline.c:3146
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: numero linea non ammissibile: %ld dopo la fine"
+
+#: memline.c:3150
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: contatore linee errato nel blocco %ld"
+
+#: memline.c:3199
+msgid "Stack size increases"
+msgstr "Dimensione 'stack' aumentata"
+
+#: memline.c:3245
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: ID blocco puntatori errato 2"
+
+#: memline.c:3675
+msgid "E325: ATTENTION"
+msgstr "E325: ATTENZIONE"
+
+#: memline.c:3676
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Trovato uno swap file di nome \""
+
+#: memline.c:3680
+msgid "While opening file \""
+msgstr "Mentre aprivo file \""
+
+#: memline.c:3689
+msgid " NEWER than swap file!\n"
+msgstr " più RECENTE dello swap file!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3693
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Un altro programma può essere in edit sullo stesso file.\n"
+" Se è così, attenzione a non trovarti con due versioni\n"
+" differenti dello stesso file a cui vengono apportate modifiche.\n"
+
+#: memline.c:3694
+msgid " Quit, or continue with caution.\n"
+msgstr " Esci, o continua con prudenza.\n"
+
+#: memline.c:3695
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Una sessione di edit per questo file è finita male.\n"
+
+#: memline.c:3696
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Se è così, usa \":recover\" oppure \"vim -r "
+
+#: memline.c:3698
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" per recuperare modifiche fatte (vedi \":help recovery\").\n"
+
+#: memline.c:3699
+msgid " If you did this already, delete the swap file \""
+msgstr " Se hai già fatto ciò, cancella il file di swap \""
+
+#: memline.c:3701
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" per non ricevere ancora questo messaggio.\n"
+
+#: memline.c:3715 memline.c:3719
+msgid "Swap file \""
+msgstr "Swap file \""
+
+#: memline.c:3716 memline.c:3722
+msgid "\" already exists!"
+msgstr "\" già esistente!"
+
+#: memline.c:3725
+msgid "VIM - ATTENTION"
+msgstr "VIM - ATTENZIONE"
+
+#: memline.c:3727
+msgid "Swap file already exists!"
+msgstr "Lo swap file esiste già!"
+
+#: memline.c:3731
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&O Apri sola-lettura\n"
+"&E Apri comunque\n"
+"&Recupera\n"
+"&Q Esci\n"
+"&Annulla"
+
+#: memline.c:3733
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&O Apri sola-lettura\n"
+"&E Apri comunque\n"
+"&Recupera\n"
+"&Q Esci\n"
+"&Annulla\n"
+"&D Cancellalo"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: Trovati troppi swap file"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr ""
+"E327: Parte del percorso di questo elemento di Menu non è un sotto-Menu"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: I Menu esistono solo in un'altra modalità"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Nessun Menu con quel nome"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Il percorso del Menu non deve condurre a un sotto-Menu"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr ""
+"E331: Non devi aggiungere elementi di Menu direttamente alla barra Menu"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Il separatore non può far parte di un percorso di Menu"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menu ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Togli questo Menu"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Il percorso Menu deve condurre ad un elemento Menu"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Menu non trovato: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Menu non definito per la modalità %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Il percorso Menu deve condurre ad un sotto-Menu"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Menu non trovato - controlla nomi Menu"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Errore/i eseguendo %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "linea %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[stringa troppo lunga]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Manutentore messaggi: Vlad Sandrini <marco@sandrini.biz>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Interruzione: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "INVIO per proseguire"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Batti INVIO o un comando per proseguire"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Ancora --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: linea, SPAZIO/b: pagina, d/u: mezza pagina, q: esci)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: linea, SPAZIO: pagina, d: mezza pagina, q: esci)"
+
+#: message.c:2982 message.c:2997
+msgid "Question"
+msgstr "Domanda"
+
+#: message.c:2984
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Y Sì\n"
+"&No"
+
+#: message.c:3017
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Y Sì\n"
+"&No\n"
+"&A Salva tutto\n"
+"&D Scarta Tutto\n"
+"&Cancella"
+
+#: message.c:3058
+msgid "Save File dialog"
+msgstr "Salva File dialogo"
+
+#: message.c:3060
+msgid "Open File dialog"
+msgstr "Apri File dialogo"
+
+#. TODO: non-GUI file selector here
+#: message.c:3131
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Spiacente, niente esplorazione file in modalità console"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Attenzione: Modifica a un file in sola-lettura"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "1 linea in più"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "1 linea in meno"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld linee in più"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld linee in meno"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (Interrotto)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "Vim: preservo file...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "Vim: Finito.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "ERRORE: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] totali alloc-rilasc %lu-%lu, in uso %lu, max uso %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[chiamate] totale re/malloc() %lu, totale free() %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: La linea sta diventando troppo lunga"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Errore interno: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Non c'è più memoria! (stavo allocando %lu bytes)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Chiamo lo shell per eseguire: \"%s\""
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: Manca ':'"
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: Modalità non valida"
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Forma del mouse non valida"
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: aspettavo un numero"
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: Percentuale non valida"
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "Immetti chiave di crittazione: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr "Ribatti per conferma la stessa chiave: "
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "Le chiavi non corrispondono!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Percorso non valido: '**[numero]' deve essere a fine percorso o essere "
+"seguito da '%s'."
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Non riesco a trovare la directory \"%s\" nel 'cdpath'"
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Non riesco a trovare il file \"%s\" nel percorso"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Nessun altra directory \"%s\" trovata nel 'cdpath'"
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Nessun altro file \"%s\" trovato nel percorso"
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: Manca ':'"
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: Componente non valido"
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: aspettavo un numero"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Non posso connettermi a Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Non posso connettermi a Netbeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: Modalità errata di accesso a file info connessione NetBeans: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "lettura da socket Netbeans"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Connessione NetBeans persa per il buffer %ld"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "Attenzione: il terminale non è in grado di evidenziare"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: Nessuna stringa sotto il cursore"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: Nessun identificativo sotto il cursore"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Non posso togliere piegature con il 'foldmethod' in uso"
+
+#: normal.c:6740
+msgid "E664: changelist is empty"
+msgstr "E664: lista modifiche vuota"
+
+#: normal.c:6742
+msgid "E662: At start of changelist"
+msgstr "E662: All'inizio della lista modifiche"
+
+#: normal.c:6744
+msgid "E663: At end of changelist"
+msgstr "E663: Alla fine della lista modifiche"
+
+#: normal.c:8006
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Batti :quit<Invio> per uscire da Vim"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 linea %sa 1 volta"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 linea %sa %d volte"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld linee %se 1 volta"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld linee %se %d volte"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld linee da rientrare... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 linea rientrata "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld linee rientrate "
+
+#. must display the prompt
+#: ops.c:1688
+msgid "cannot yank; delete anyway"
+msgstr "non riesco a salvare in un registro; cancello comunque"
+
+#: ops.c:2274
+msgid "1 line changed"
+msgstr "1 linea cambiata"
+
+#: ops.c:2276
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld linee cambiate"
+
+#: ops.c:2660
+#, c-format
+msgid "freeing %ld lines"
+msgstr "libero %ld linee"
+
+#: ops.c:2941
+msgid "1 line yanked"
+msgstr "1 linea messa in registro"
+
+#: ops.c:2943
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld linee messe in registro"
+
+#: ops.c:3228
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Niente nel registro %s"
+
+#. Highlight title
+#: ops.c:3779
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registri ---"
+
+#: ops.c:5088
+msgid "Illegal register name"
+msgstr "Nome registro non ammesso"
+
+#: ops.c:5176
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registri:\n"
+
+#: ops.c:5226
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Tipo di registro sconosciuto: %d"
+
+#: ops.c:5711
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Nome registro non valido: '%s'"
+
+#: ops.c:6071
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Col.; "
+
+#: ops.c:6078
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Selezionate %s%ld di %ld linee; %ld di %ld parole; %ld di %ld caratt."
+
+#: ops.c:6094
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Col. %s di %s; Linea %ld di %ld; Parola %ld di %ld; Caratt. %ld di %ld"
+
+#: ops.c:6105
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld per BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Pagina %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Grazie per aver volato con Vim"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Opzione inesistente"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Opzione non supportata"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Non consentito in una 'modeline'"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tImpostata l'ultima volta da "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Ci vuole un numero dopo ="
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: Non trovato in 'termcap'"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Carattere non ammesso <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Non posso assegnare a 'term' il valore 'stringa nulla'"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Non posso modificare 'term' mentre sono nella GUI"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Usa \":gui\" per far partire la GUI"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' e 'patchmode' sono uguali"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Non può essere cambiato nella GUI GTK+ 2"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Manca ':'"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Stringa nulla"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Manca numero dopo <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Manca virgola"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Devi specificare un valore '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: contiene carattere 'wide' o non-stampabile"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Font non validi"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: non posso selezionare fontset"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: Fontset non valido"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: non posso selezionare 'wide font'"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: 'Wide font' non valido"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Carattere non ammesso dopo <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: virgola mancante"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' deve essere nulla o contenere %s"
+
+#: option.c:5682
+msgid "E538: No mouse support"
+msgstr "E538: Manca supporto mouse"
+
+#: option.c:5950
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Espressione non terminata"
+
+#: option.c:5954
+msgid "E541: too many items"
+msgstr "E541: troppi elementi"
+
+#: option.c:5956
+msgid "E542: unbalanced groups"
+msgstr "E542: gruppi sbilanciati"
+
+#: option.c:6196
+msgid "E590: A preview window already exists"
+msgstr "E590: Una finestra di pre-visualizzazione esiste già"
+
+#: option.c:6453
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: Arabo richiede UTF-8, esegui ':set encoding=utf-8'"
+
+#: option.c:6786
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Servono almeno %d linee"
+
+#: option.c:6796
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Servono almeno %d colonne"
+
+#: option.c:7103
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Opzione inesistente: %s"
+
+#: option.c:7223
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Codici terminale ---"
+
+#: option.c:7225
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Valori opzioni globali ---"
+
+#: option.c:7227
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Valore opzioni globali ---"
+
+#: option.c:7229
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Opzioni ---"
+
+#: option.c:7935
+msgid "E356: get_varp ERROR"
+msgstr "E356: ERRORE get_varp"
+
+#: option.c:8906
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Manca carattere corrispondente per %s"
+
+#: option.c:8940
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Caratteri in più dopo il ';': %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "non riesco ad aprire "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Non riesco ad aprire la finestra!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Serve Amigados versione 2.04 o successiva\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Serve %s versione %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "Non riesco ad aprire NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Non riesco a creare "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim esce con %d\n"
+
+#: os_amiga.c:941
+msgid "cannot change console mode ?!\n"
+msgstr "non posso modificare modalità console ?!\n"
+
+#: os_amiga.c:1012
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: non una console??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1161
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Non posso eseguire lo shell con l'opzione -f"
+
+#: os_amiga.c:1202 os_amiga.c:1292
+msgid "Cannot execute "
+msgstr "Non riesco a eseguire "
+
+#: os_amiga.c:1205 os_amiga.c:1302
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1225 os_amiga.c:1327
+msgid " returned\n"
+msgstr " ottenuto\n"
+
+#: os_amiga.c:1468
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE troppo piccolo."
+
+#: os_amiga.c:1472
+msgid "I/O ERROR"
+msgstr "ERRORE I/O"
+
+#: os_mswin.c:548
+msgid "...(truncated)"
+msgstr "...(troncato)"
+
+#: os_mswin.c:650
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' non vale 80, non riesco ad eseguire comandi esterni"
+
+#: os_mswin.c:1982
+msgid "E237: Printer selection failed"
+msgstr "E237: Scelta stampante non riuscita"
+
+#: os_mswin.c:2022
+#, c-format
+msgid "to %s on %s"
+msgstr "a %s su %s"
+
+#: os_mswin.c:2037
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Font per stampante sconosciuto: %s"
+
+#: os_mswin.c:2086 os_mswin.c:2096
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Errore durante stampa: %s"
+
+#: os_mswin.c:2097
+msgid "Unknown"
+msgstr "Sconosciuto"
+
+#: os_mswin.c:2124
+#, c-format
+msgid "Printing '%s'"
+msgstr "Stampato: '%s'"
+
+#: os_mswin.c:3213
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Nome di charset non ammesso \"%s\" nel fonte di nome \"%s\""
+
+#: os_mswin.c:3221
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Carattere non ammesso '%c' nel font di nome \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Opzione 'osfiletype' non valida - uso 'Text'"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Segnale doppio, esco\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Intercettato segnale fatale %s\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Intercettato segnale fatale\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Attivazione visualizzazione X ha richiesto %ld msec"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Preso errore X\n"
+
+#: os_unix.c:1338
+msgid "Testing the X display failed"
+msgstr "Prova visualizzazione X fallita"
+
+#: os_unix.c:1477
+msgid "Opening the X display timed out"
+msgstr "Apertura visualizzazione X: tempo scaduto"
+
+#: os_unix.c:3234 os_unix.c:3914
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Non riesco a eseguire shell "
+
+#: os_unix.c:3282
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Non riesco a eseguire shell sh\n"
+
+#: os_unix.c:3286 os_unix.c:3920
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"shell terminato con return-code "
+
+#: os_unix.c:3421
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Non posso creare 'pipe'\n"
+
+#: os_unix.c:3436
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Non riesco ad effettuare 'fork'\n"
+
+#: os_unix.c:3927
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Comando terminato\n"
+
+#: os_unix.c:4191 os_unix.c:4316 os_unix.c:5982
+msgid "XSMP lost ICE connection"
+msgstr "XSMP ha perso la connessione ICE"
+
+#: os_unix.c:5565
+msgid "Opening the X display failed"
+msgstr "Apertura visualizzazione X fallita"
+
+#: os_unix.c:5887
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP gestione richiesta 'save-yourself'"
+
+#: os_unix.c:6006
+msgid "XSMP opening connection"
+msgstr "XSMP apertura connessione"
+
+#: os_unix.c:6025
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP osservazione connessione ICE fallita"
+
+#: os_unix.c:6045
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection fallita: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Alla linea"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Non riesco ad allocare memoria per linea di comando."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "Errore VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Non riesco a caricare vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Non sono riuscito a impostare puntatori di funzione verso la DLL!"
+
+#: os_win16.c:342 os_win32.c:3248
+#, c-format
+msgid "shell returned %d"
+msgstr "shell terminato con return-code %d"
+
+#: os_win32.c:2706
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Intercettato evento %s\n"
+
+#: os_win32.c:2708
+msgid "close"
+msgstr "chiusura"
+
+#: os_win32.c:2710
+msgid "logoff"
+msgstr "logoff"
+
+#: os_win32.c:2711
+msgid "shutdown"
+msgstr "shutdown"
+
+#: os_win32.c:3201
+msgid "E371: Command not found"
+msgstr "E371: Comando non trovato"
+
+#: os_win32.c:3214
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE non trovato nel tuo $PATH.\n"
+"I comandi esterni non farano una pausa dopo aver finito l'esecuzione.\n"
+"Vedi :help win32-vimrun per ulteriori informazioni."
+
+#: os_win32.c:3217
+msgid "Vim Warning"
+msgstr "Avviso da Vim"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Troppi %%%c nella stringa di 'format'"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: %%%c imprevisto nella stringa di 'format'"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Manca ] nella stringa di 'format'"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c non supportato nella stringa di 'format'"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: %%%c non valido nel prefisso della stringa di 'format'"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: %%%c non valido nella stringa di 'format'"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' non contiene alcun modello"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Nome directory mancante o nullo"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Non ci sono più elementi"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d di %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (linea cancellata)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Al fondo della 'stack' di quickfix"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: In cima alla 'stack' di quickfix"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "lista errori %d di %d; %d errori"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Non posso scrivere, l'opzione 'buftype' è impostata"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: elemento non valido in %s%%[]"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: Espressione troppo lunga"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: Troppe \\z("
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Troppe %s("
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: Senza riscontro: \\z("
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Senza riscontro: %s%%("
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Senza riscontro: %s("
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Senza riscontro: %s)"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: l'operando %s* non può essere vuoto"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: l'operando %s+ non può essere vuoto"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: Carattere non ammesso dopo %s@"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: l'operando %s{ potrebbe essere vuoto"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Troppi %s{...}s complessi"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: %s* nidificato"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: %s%c nidificato"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: uso non valido di \\_"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c senza nulla prima"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: Riferimento all'indietro non ammesso"
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( non consentito qui"
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et al. non consentiti qui"
+
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Carattere non ammesso dopo \\z"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Manca ] dopo %s%%["
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] vuoto"
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Carattere non ammesso dopo %s%%"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Errore sintattico in %s{...}"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Intercettata fine anormale; 'regexp' troppo complessa?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: errore di supero-capacità-stack causato da espressione"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "Sotto-corrispondenze esterne:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld linee piegate"
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " V-SOSTITUISCI"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " SOSTITUISCI"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " INVERTITO"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " INSERISCI"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (inserisci)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (sostituisci)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (v-sostituisci)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Ebraico"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " Arabo"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (lingua)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (incolla)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " VISUALE"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " VISUALE LINEA"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " VISUALE BLOCCO"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " SELEZIONA"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " SELEZIONA LINEA"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " SELEZIONA BLOCCO"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "registrazione"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "raggiunta la CIMA nella ricerca, continuo dal FONDO"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "raggiunto il FONDO nella ricerca, continuo dalla CIMA"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Stringa di ricerca non valida: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: la ricerca ha raggiunto la CIMA senza successo per: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: la ricerca ha raggiunto il FONDO senza successo per: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: '?' o '/' atteso dopo ';'"
+
+#: search.c:3768
+msgid " (includes previously listed match)"
+msgstr " (comprese corrispondenze elencate prima)"
+
+#. cursor at status line
+#: search.c:3788
+msgid "--- Included files "
+msgstr "--- File inclusi "
+
+#: search.c:3790
+msgid "not found "
+msgstr "non trovati "
+
+#: search.c:3791
+msgid "in path ---\n"
+msgstr "nel percorso ---\n"
+
+#: search.c:3848
+msgid " (Already listed)"
+msgstr " (Già elencati)"
+
+#: search.c:3850
+msgid " NOT FOUND"
+msgstr " NON TROVATO"
+
+#: search.c:3902
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Scandisco file incluso: %s"
+
+#: search.c:4120
+msgid "E387: Match is on current line"
+msgstr "E387: Corrispondenza nella linea corrente"
+
+#: search.c:4263
+msgid "All included files were found"
+msgstr "Tutti i file inclusi sono stati trovati"
+
+#: search.c:4265
+msgid "No included files"
+msgstr "Nessun file incluso"
+
+#: search.c:4281
+msgid "E388: Couldn't find definition"
+msgstr "E388: Non sono riuscito a trovare la definizione"
+
+#: search.c:4283
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Non son riuscito a trovare il modello"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Argomento non ammesso: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: 'cluster' sintattico inesistente: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "Nessun elemento sintattico definito per questo buffer"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "sincronizzo i commenti nello stile C"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "nessuna ssincronizzazione"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "la sincronizzazione inizia "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " linee prima della linea iniziale"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Elementi sincronizzazione sintassi ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"sincronizzo elementi"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Elementi sintattici ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: 'cluster' sintattico inesistente: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimale "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "massimale "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; corrisp. "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " interruzioni di linea"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here non ammesso qui"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Elemento di 'region' non trovato per %s"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: contiene argomenti non accettati qui"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: argomento 'containedin' non accettato qui"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Nome file necessario"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Manca '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Argomenti non sufficienti per: 'syntax region' %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Nessun 'cluster' specificato"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Delimitatore di espressione non trovato: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Spazzatura dopo espressione: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr ""
+"E403: syntax sync: espressione di continuazione linea specificata due volte"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Argomenti non validi: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Manca '=': %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Argomento nullo: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s non consentito qui"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s deve venire per primo nella lista 'contains'"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Nome gruppo sconosciuto: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Sotto-comando :syntax non valido: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: gruppo evidenziazione non trovato: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Argomenti non sufficienti: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Troppi argomenti: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: 'group' ha impostazioni, 'highlight link' ignorato"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: segno '=' inatteso: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: manca segno '=': %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: manca argomento: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Valore non ammesso: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: colore di testo sconosciuto"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: colore di sfondo sconosciuto"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Numero o nome di colore non riconosciuto: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: codice terminale troppo lungo: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Argomento non ammesso: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Troppi gruppi evidenziazione differenti in uso"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Carattere non stampabile in un nome di gruppo"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: Carattere non ammesso in un nome di gruppo"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: al fondo della 'stack' delle tag"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: in cima alla 'stack' delle tag"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Non posso andare prima della prima tag corrispondente"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tag non trovata: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri tipo tag"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "file\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Batti n. di scelta (<INVIO> per lasciar perdere): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: C'è solo una tag corrispondente"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Non posso andare oltre l'ultima tag corrispondente"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Il file \"%s\" non esiste"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d di %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " o più"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " Uso tag ignorando maiuscole/minuscole!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Il file \"%s\" non esiste"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # A tag DA__ linea in file/testo"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Ricerca nel tag file %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Percorso tag file troncato per %s\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Errore di formato nel tag file \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Prima del byte %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag file non ordinato alfabeticamente: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: Nessun tag file"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Non riesco a trovare modello tag"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Non riesco a trovare tag, sto solo tirando a indovinare!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' non noto. Terminali disponibili predisposti sono:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "predefinito a '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Non posso aprire file 'termcap'"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Descrizione terminale non trovata in 'terminfo'"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Descrizione terminale non trovata in 'termcap'"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Nessuna descrizione per \"%s\" in 'termcap'"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: capacità \"cm\" del terminale necessaria"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Tasti Terminale ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "fatto eseguire nuovo shell\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Errore leggendo l'input, esco...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "'undo' non più possibile; continuo comunque"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: numeri linee errati"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 modifica"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld modifiche"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: lista 'undo' non valida"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: linea di 'undo' mancante"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:759
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"versione MS-Windows 16/32 bit GUI"
+
+#: version.c:761
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"Versione MS-Windows 32 bit GUI"
+
+#: version.c:764
+msgid " in Win32s mode"
+msgstr " in modalità Win32s"
+
+#: version.c:766
+msgid " with OLE support"
+msgstr " con supporto OLE"
+
+#: version.c:769
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"Versione MS-Windows 32 bit console"
+
+#: version.c:773
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"Versione MS-Windows 16 bit"
+
+#: version.c:777
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"Version MS-DOS 32 bit"
+
+#: version.c:779
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"Versione MS-DOS 16 bit"
+
+#: version.c:785
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"Versione MacOS X (unix)"
+
+#: version.c:787
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"Versione X MacOS"
+
+#: version.c:790
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"Versione MacOS"
+
+#: version.c:795
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"Versione RISC OS"
+
+#: version.c:805
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Patch incluse: "
+
+#: version.c:831 version.c:1199
+msgid "Modified by "
+msgstr "Modificato da "
+
+#: version.c:838
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compilato "
+
+#: version.c:841
+msgid "by "
+msgstr "da "
+
+#: version.c:853
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Versione gigante "
+
+#: version.c:856
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Versione grande "
+
+#: version.c:859
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Versione normale "
+
+#: version.c:862
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Versione piccola "
+
+#: version.c:864
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Versione minuscola "
+
+#: version.c:870
+msgid "without GUI."
+msgstr "senza GUI."
+
+#: version.c:875
+msgid "with GTK2-GNOME GUI."
+msgstr "con GUI GTK2-GNOME."
+
+#: version.c:877
+msgid "with GTK-GNOME GUI."
+msgstr "con GUI GTK-GNOME."
+
+#: version.c:881
+msgid "with GTK2 GUI."
+msgstr "con GUI GTK2."
+
+#: version.c:883
+msgid "with GTK GUI."
+msgstr "con GUI GTK."
+
+#: version.c:888
+msgid "with X11-Motif GUI."
+msgstr "con GUI X11-Motif."
+
+#: version.c:892
+msgid "with X11-neXtaw GUI."
+msgstr "con GUI X11-neXtaw."
+
+#: version.c:894
+msgid "with X11-Athena GUI."
+msgstr "con GUI X11-Athena."
+
+#: version.c:898
+msgid "with BeOS GUI."
+msgstr "con GUI BeOS."
+
+#: version.c:901
+msgid "with Photon GUI."
+msgstr "con GUI Photon."
+
+#: version.c:904
+msgid "with GUI."
+msgstr "con GUI."
+
+#: version.c:907
+msgid "with Carbon GUI."
+msgstr "con GUI Carbon."
+
+#: version.c:910
+msgid "with Cocoa GUI."
+msgstr "con GUI Cocoa."
+
+#: version.c:913
+msgid "with (classic) GUI."
+msgstr "con GUI (classica)."
+
+#: version.c:924
+msgid " Features included (+) or not (-):\n"
+msgstr " Opzioni incluse (+) o escluse (-):\n"
+
+#: version.c:936
+msgid " system vimrc file: \""
+msgstr " file vimrc di sistema: \""
+
+#: version.c:941
+msgid " user vimrc file: \""
+msgstr " file vimrc utente: \""
+
+#: version.c:946
+msgid " 2nd user vimrc file: \""
+msgstr " II file vimrc utente: \""
+
+#: version.c:951
+msgid " 3rd user vimrc file: \""
+msgstr " III file vimrc utente: \""
+
+#: version.c:956
+msgid " user exrc file: \""
+msgstr " file exrc utente: \""
+
+#: version.c:961
+msgid " 2nd user exrc file: \""
+msgstr " II file exrc utente: \""
+
+#: version.c:967
+msgid " system gvimrc file: \""
+msgstr " file gvimrc di sistema: \""
+
+#: version.c:971
+msgid " user gvimrc file: \""
+msgstr " file gvimrc utente: \""
+
+#: version.c:975
+msgid "2nd user gvimrc file: \""
+msgstr " II file gvimrc utente: \""
+
+#: version.c:980
+msgid "3rd user gvimrc file: \""
+msgstr " III file gvimrc utente: \""
+
+#: version.c:987
+msgid " system menu file: \""
+msgstr " file menu di sistema: \""
+
+#: version.c:995
+msgid " fall-back for $VIM: \""
+msgstr " $VIM di riserva: \""
+
+#: version.c:1001
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME di riserva: \""
+
+#: version.c:1005
+msgid "Compilation: "
+msgstr "Compilazione: "
+
+#: version.c:1011
+msgid "Compiler: "
+msgstr "Compilatore: "
+
+#: version.c:1016
+msgid "Linking: "
+msgstr "Link: "
+
+#: version.c:1021
+msgid " DEBUG BUILD"
+msgstr " VERSIONE DEBUG"
+
+#: version.c:1060
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved (VI Migliorato)"
+
+#: version.c:1062
+msgid "version "
+msgstr "versione "
+
+#: version.c:1063
+msgid "by Bram Moolenaar et al."
+msgstr "di Bram Moolenaar et al."
+
+#: version.c:1067
+msgid "Vim is open source and freely distributable"
+msgstr "Vim è 'open source' e può essere distribuito liberamente"
+
+#: version.c:1069
+msgid "Help poor children in Uganda!"
+msgstr "Aiuta i bambini poveri dell'Uganda!"
+
+#: version.c:1070
+msgid "type :help iccf<Enter> for information "
+msgstr "batti :help iccf<Invio> per informazioni "
+
+#: version.c:1072
+msgid "type :q<Enter> to exit "
+msgstr "batti :q<Invio> per uscire "
+
+#: version.c:1073
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "batti :help<Invio> o <F1> per aiuto online "
+
+#: version.c:1074
+msgid "type :help version6<Enter> for version info"
+msgstr "batti :help version6<Invio> per informazioni su versione"
+
+#: version.c:1077
+msgid "Running in Vi compatible mode"
+msgstr "Eseguo in modalità compatibile Vi"
+
+#: version.c:1078
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "batti :set nocp<Invio> per valori predefiniti Vim"
+
+#: version.c:1079
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "batti :help cp-default<Enter> per info al riguardo"
+
+#: version.c:1094
+msgid "menu Help->Orphans for information "
+msgstr "menu Aiuto->Orfani per informazioni "
+
+#: version.c:1096
+msgid "Running modeless, typed text is inserted"
+msgstr "Esecuzione senza modalità: solo inserimento"
+
+#: version.c:1097
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Modifica->Impost.Globali->Modal.Inser. Sì/No"
+
+#: version.c:1098
+msgid " for two modes "
+msgstr " per modo Inser./Comandi"
+
+#: version.c:1102
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Modifica->Impost.Globali->Compatibile Vi Sì/No"
+
+#: version.c:1103
+msgid " for Vim defaults "
+msgstr " modo Vim predefinito "
+
+#: version.c:1150
+msgid "Sponsor Vim development!"
+msgstr "Sponsorizza lo sviluppo di Vim!"
+
+#: version.c:1151
+msgid "Become a registered Vim user!"
+msgstr "Diventa un utente Vim registrato!"
+
+#: version.c:1154
+msgid "type :help sponsor<Enter> for information "
+msgstr "batti :help sponsor<Invio> per informazioni "
+
+#: version.c:1155
+msgid "type :help register<Enter> for information "
+msgstr "batti :help register<Invio> per informazioni "
+
+#: version.c:1157
+msgid "menu Help->Sponsor/Register for information "
+msgstr "menu Aiuto->Sponsor/Registrazione per informazioni "
+
+#: version.c:1167
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ATTENZIONE: Trovato Windows 95/98/ME"
+
+#: version.c:1170
+msgid "type :help windows95<Enter> for info on this"
+msgstr "batti :help windows95<Enter> per info al riguardo"
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Non c'è una finestra di pre-visualizzazione"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Non riesco a dividere ALTO-SX e BASSO-DX contemporaneamente"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Non posso ruotare quando un'altra finestra è divisa in due"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: Non riesco a chiudere l'ultima finestra"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "C'è già una finestra sola"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Altre finestre contengono modifiche"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Nessun nome file sotto il cursore"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Non riesco a trovare il file \"%s\" nel percorso"
+
+#: if_perl.xs:326 globals.h:1241
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Non posso caricare la libreria %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"Spiacente, comando non disponibile, non riesco a caricare libreria programmi "
+"Perl."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: Valorizzazione Perl vietata in ambiente protetto senza il modulo Safe"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Apri con &molti Vim"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Apri con un solo &Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Differenza con Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Apri con &Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Apri con Vim esistente - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Apri i(l) file scelto(i) con Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr ""
+"Errore creando il processo: Controllate che gvim sia incluso nel vostro "
+"cammino (PATH)"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "errore gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Percorso file troppo lungo!"
+
+#: globals.h:1031
+msgid "--No lines in buffer--"
+msgstr "--File vuoto--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1194
+msgid "E470: Command aborted"
+msgstr "E470: Comando finito male"
+
+#: globals.h:1195
+msgid "E471: Argument required"
+msgstr "E471: Argomento necessario"
+
+#: globals.h:1196
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ dovrebbe essere seguito da /, ? oppure &"
+
+#: globals.h:1198
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Non valido nella finestra comandi; <INVIO> esegue, CTRL-C ignora"
+
+#: globals.h:1200
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Comando non ammesso da exrc/vimrc nella dir. in uso o nella ricerca tag"
+
+#: globals.h:1202
+msgid "E171: Missing :endif"
+msgstr "E171: Manca :endif"
+
+#: globals.h:1203
+msgid "E600: Missing :endtry"
+msgstr "E600: Manca :endtry"
+
+#: globals.h:1204
+msgid "E170: Missing :endwhile"
+msgstr "E170: Manca :endwhile"
+
+#: globals.h:1205
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile senza :while"
+
+#: globals.h:1207
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: File esistente (aggiungi ! per riscriverlo)"
+
+#: globals.h:1208
+msgid "E472: Command failed"
+msgstr "E472: Comando fallito"
+
+#: globals.h:1210
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Fontset sconosciuto: %s"
+
+#: globals.h:1214
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Font sconosciuto: %s"
+
+#: globals.h:1217
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Font \"%s\" non di larghezza fissa"
+
+#: globals.h:1219
+msgid "E473: Internal error"
+msgstr "E473: Errore interno"
+
+#: globals.h:1220
+msgid "Interrupted"
+msgstr "Interrotto"
+
+#: globals.h:1221
+msgid "E14: Invalid address"
+msgstr "E14: Indirizzo non valido"
+
+#: globals.h:1222
+msgid "E474: Invalid argument"
+msgstr "E474: Argomento non valido"
+
+#: globals.h:1223
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Argomento non valido: %s"
+
+#: globals.h:1225
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Espressione non valida: %s"
+
+#: globals.h:1227
+msgid "E16: Invalid range"
+msgstr "E16: Intervallo non valido"
+
+#: globals.h:1228
+msgid "E476: Invalid command"
+msgstr "E476: Comando non valido"
+
+#: globals.h:1230
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" è una directory"
+
+#: globals.h:1233
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Caratteri non previsti prima di '='"
+
+#: globals.h:1236
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Chiamata a libreria fallita per \"%s()\""
+
+#: globals.h:1242
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Non posso caricare la funzione di libreria %s"
+
+#: globals.h:1244
+msgid "E19: Mark has invalid line number"
+msgstr "E19: 'Mark' con numero linea non valido"
+
+#: globals.h:1245
+msgid "E20: Mark not set"
+msgstr "E20: 'Mark' non impostato"
+
+#: globals.h:1246
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Non posso fare modifiche, 'modifiable' è inibito"
+
+#: globals.h:1247
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Script troppo nidificati"
+
+#: globals.h:1248
+msgid "E23: No alternate file"
+msgstr "E23: Nessun file alternato"
+
+#: globals.h:1249
+msgid "E24: No such abbreviation"
+msgstr "E24: Abbreviazione inesistente"
+
+#: globals.h:1250
+msgid "E477: No ! allowed"
+msgstr "E477: ! non consentito"
+
+#: globals.h:1252
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI non utilizzabile: Non abilitata in compilazione"
+
+#: globals.h:1255
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Ebraico non utilizzabile: Non abilitato in compilazione\n"
+
+#: globals.h:1258
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Farsi non utilizzabile: Non abilitato in compilazione\n"
+
+#: globals.h:1261
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Arabo non utilizzabile: Non abilitato in compilazione\n"
+
+#: globals.h:1264
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Nome di gruppo di evidenziazione inesistente: %s"
+
+#: globals.h:1266
+msgid "E29: No inserted text yet"
+msgstr "E29: Ancora nessun testo inserito"
+
+#: globals.h:1267
+msgid "E30: No previous command line"
+msgstr "E30: Nessuna linea comandi precedente"
+
+#: globals.h:1268
+msgid "E31: No such mapping"
+msgstr "E31: Mapping inesistente"
+
+#: globals.h:1269
+msgid "E479: No match"
+msgstr "E479: Nessuna corrispondenza"
+
+#: globals.h:1270
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Nessuna corrispondenza: %s"
+
+#: globals.h:1271
+msgid "E32: No file name"
+msgstr "E32: Manca nome file"
+
+#: globals.h:1272
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Nessuna espressione regolare precedente di 'substitute'"
+
+#: globals.h:1273
+msgid "E34: No previous command"
+msgstr "E34: Nessun comando precedente"
+
+#: globals.h:1274
+msgid "E35: No previous regular expression"
+msgstr "E35: Nessuna espressione regolare precedente"
+
+#: globals.h:1275
+msgid "E481: No range allowed"
+msgstr "E481: Nessun intervallo consentito"
+
+#: globals.h:1277
+msgid "E36: Not enough room"
+msgstr "E36: Manca spazio"
+
+#: globals.h:1280
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: non esiste server registrato con nome \"%s\""
+
+#: globals.h:1282
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Non riesco a creare il file %s"
+
+#: globals.h:1283
+msgid "E483: Can't get temp file name"
+msgstr "E483: Non riesco ad ottenere nome file 'temp'"
+
+#: globals.h:1284
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Non riesco ad aprire il file %s"
+
+#: globals.h:1285
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Non riesco a leggere il file %s"
+
+#: globals.h:1286
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Non salvato dopo modifica (aggiungi ! per eseguire comunque)"
+
+#: globals.h:1287
+msgid "E38: Null argument"
+msgstr "E38: Argomento nullo"
+
+#: globals.h:1289
+msgid "E39: Number expected"
+msgstr "E39: Mi aspettavo un numero"
+
+#: globals.h:1292
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Non riesco ad aprire il file errori %s"
+
+#: globals.h:1295
+msgid "E233: cannot open display"
+msgstr "E233: non riesco ad aprire lo schermo"
+
+#: globals.h:1297
+msgid "E41: Out of memory!"
+msgstr "E41: Non c'è più memoria!"
+
+#: globals.h:1299
+msgid "Pattern not found"
+msgstr "Espressione non trovata"
+
+#: globals.h:1301
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Espressione non trovata: %s"
+
+#: globals.h:1302
+msgid "E487: Argument must be positive"
+msgstr "E487: L'argomento deve essere positivo"
+
+#: globals.h:1304
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Non posso tornare alla directory precedente"
+
+#: globals.h:1308
+msgid "E42: No Errors"
+msgstr "E42: Nessun Errore"
+
+#: globals.h:1310
+msgid "E43: Damaged match string"
+msgstr "E43: Stringa di confronto danneggiata"
+
+#: globals.h:1311
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Programma 'regexp' corrotto"
+
+#: globals.h:1312
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: file in sola lettura (aggiungi ! per eseguire comunque)"
+
+#: globals.h:1314
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Non posso impostare la variabile read-only \"%s\""
+
+#: globals.h:1317
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Errore leggendo il file errori"
+
+#: globals.h:1320
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Non ammesso in ambiente protetto"
+
+#: globals.h:1322
+msgid "E523: Not allowed here"
+msgstr "E523: Non consentito qui"
+
+#: globals.h:1325
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Impostazione modalità schermo non supportata"
+
+#: globals.h:1327
+msgid "E49: Invalid scroll size"
+msgstr "E49: Quantità di 'scroll' non valida"
+
+#: globals.h:1328
+msgid "E91: 'shell' option is empty"
+msgstr "E91: opzione 'shell' vuota"
+
+#: globals.h:1330
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Errore -- non sono riuscito a leggere i dati del 'sign'!"
+
+#: globals.h:1332
+msgid "E72: Close error on swap file"
+msgstr "E72: Errore durante chiusura swap file"
+
+#: globals.h:1333
+msgid "E73: tag stack empty"
+msgstr "E73: tag stack vuota"
+
+#: globals.h:1334
+msgid "E74: Command too complex"
+msgstr "E74: Comando troppo complesso"
+
+#: globals.h:1335
+msgid "E75: Name too long"
+msgstr "E75: Nome troppo lungo"
+
+#: globals.h:1336
+msgid "E76: Too many ["
+msgstr "E76: Troppe ["
+
+#: globals.h:1337
+msgid "E77: Too many file names"
+msgstr "E77: Troppi nomi file"
+
+#: globals.h:1338
+msgid "E488: Trailing characters"
+msgstr "E488: Caratteri in più a fine comando"
+
+#: globals.h:1339
+msgid "E78: Unknown mark"
+msgstr "E78: 'Mark' sconosciuto"
+
+#: globals.h:1340
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Non posso espandere 'wildcard'"
+
+#: globals.h:1342
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' non può essere inferiore a 'winminheight'"
+
+#: globals.h:1344
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' non può essere inferiore a 'winminwidth'"
+
+#: globals.h:1347
+msgid "E80: Error while writing"
+msgstr "E80: Errore in scrittura"
+
+#: globals.h:1348
+msgid "Zero count"
+msgstr "Contatore a zero"
+
+#: globals.h:1350
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Uso di <SID> fuori dal contesto di uno script"
+
+#: globals.h:1353
+msgid "E449: Invalid expression received"
+msgstr "E449: Ricevuta un'espressione non valida"
+
+#: globals.h:1356
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Regione protetta, impossibile modificare"
diff --git a/src/po/ja.po b/src/po/ja.po
new file mode 100644
index 000000000..17d94d516
--- /dev/null
+++ b/src/po/ja.po
@@ -0,0 +1,6587 @@
+# Japanese translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# MURAOKA Taro <koron@tka.att.ne.jp>, 2001-4.
+# Last Change: 29-Apr-2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.2\n"
+"POT-Creation-Date: 2004-04-29 13:16+0900\n"
+"PO-Revision-Date: 2004-04-29 13:00+0900\n"
+"Last-Translator: MURAOKA Taro <koron@tka.att.ne.jp>\n"
+"Language-Team: MURAOKA Taro <koron@tka.att.ne.jp>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=euc-jp\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ¥Ð¥Ã¥Õ¥¡¤ò1¤Ä¤âºîÀ®¤Ç¤­¤Ê¤¤¤Î¤Ç, ½ªÎ»¤·¤Þ¤¹..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ¥Ð¥Ã¥Õ¥¡¤òºîÀ®¤Ç¤­¤Ê¤¤¤Î¤Ç, ¾¤Î¤ò»ÈÍѤ·¤Þ¤¹..."
+
+#: buffer.c:805
+msgid "E515: No buffers were unloaded"
+msgstr "E515: ²òÊü¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: buffer.c:807
+msgid "E516: No buffers were deleted"
+msgstr "E516: ºï½ü¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: buffer.c:809
+msgid "E517: No buffers were wiped out"
+msgstr "E517: ÇË´þ¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "1 ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬²òÊü¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬²òÊü¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "1 ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬ºï½ü¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬ºï½ü¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "1 ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬ÇË´þ¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d ¸Ä¤Î¥Ð¥Ã¥Õ¥¡¤¬ÇË´þ¤µ¤ì¤Þ¤·¤¿"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: Êѹ¹¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: ¥ê¥¹¥Èɽ¼¨¤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: ¥Ð¥Ã¥Õ¥¡ %ld ¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ºÇ¸å¤Î¥Ð¥Ã¥Õ¥¡¤ò±Û¤¨¤Æ°ÜÆ°¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ºÇ½é¤Î¥Ð¥Ã¥Õ¥¡¤è¤êÁ°¤Ø¤Ï°ÜÆ°¤Ç¤­¤Þ¤»¤ó"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: ¥Ð¥Ã¥Õ¥¡ %ld ¤ÎÊѹ¹¤ÏÊݸ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó (! ¤ÇÊѹ¹¤òÇË´þ)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ºÇ¸å¤Î¥Ð¥Ã¥Õ¥¡¤Ï²òÊü¤Ç¤­¤Þ¤»¤ó"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ·Ù¹ð: ¥Õ¥¡¥¤¥ë̾¤Î¥ê¥¹¥È¤¬Ä¹¤¹¤®¤Þ¤¹"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: ¥Ð¥Ã¥Õ¥¡ %ld ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: %s ¤ËÊ£¿ô¤Î³ºÅö¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: %s ¤Ë³ºÅö¤¹¤ë¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "¹Ô %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ¤³¤Î̾Á°¤Î¥Ð¥Ã¥Õ¥¡¤Ï´û¤Ë¤¢¤ê¤Þ¤¹"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [Êѹ¹¤¢¤ê]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[̤ÊÔ½¸]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[¿·¥Õ¥¡¥¤¥ë]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[Æɹþ¥¨¥é¡¼]"
+
+#: buffer.c:2726 fileio.c:2049
+msgid "[readonly]"
+msgstr "[ÆɹþÀìÍÑ]"
+
+#: buffer.c:2747
+msgid "1 line --%d%%--"
+msgstr "1 ¹Ô --%d%%--"
+
+#: buffer.c:2749
+msgid "%ld lines --%d%%--"
+msgstr "%ld ¹Ô --%d%%--"
+
+#: buffer.c:2756
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "¹Ô %ld (Á´ÂÎ %ld) --%d%%-- col "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[̵Âê]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "¥Ø¥ë¥×"
+
+#: buffer.c:3463 screen.c:5038
+msgid "[help]"
+msgstr "[¥Ø¥ë¥×]"
+
+#: buffer.c:3495 screen.c:5044
+msgid "[Preview]"
+msgstr "[¥×¥ì¥Ó¥å¡¼]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "Á´¤Æ"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "ËöÈø"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "ÀèƬ"
+
+#: buffer.c:4523
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# ¥Ð¥Ã¥Õ¥¡¥ê¥¹¥È:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[¥¨¥é¡¼¥ê¥¹¥È]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[̵Âê]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ¥µ¥¤¥ó ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s ¤Î¥µ¥¤¥ó:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ¹Ô=%ld ¼±ÊÌ»Ò=%d ̾Á°=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: %ld °Ê¾å¤Î¥Ð¥Ã¥Õ¥¡¤Ïdiff¤Ç¤­¤Þ¤»¤ó"
+
+#: diff.c:709
+msgid "E97: Cannot create diffs"
+msgstr "E97: º¹Ê¬¤òºîÀ®¤Ç¤­¤Þ¤»¤ó "
+
+#: diff.c:814
+msgid "Patch file"
+msgstr "¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë"
+
+#: diff.c:1065
+msgid "E98: Cannot read diff output"
+msgstr "E98: diff¤Î½ÐÎϤòÆɹþ¤á¤Þ¤»¤ó"
+
+#: diff.c:1815
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ¸½ºß¤Î¥Ð¥Ã¥Õ¥¡¤Ïº¹Ê¬¥â¡¼¥É¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: diff.c:1827
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: º¹Ê¬¥â¡¼¥É¤Ç¤¢¤ë¾¤Î¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: diff.c:1835
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: º¹Ê¬¥â¡¼¥É¤Î¥Ð¥Ã¥Õ¥¡¤¬2¸Ä°Ê¾å¤¢¤ë¤Î¤Ç¡¢¤É¤ì¤ò»È¤¦¤«ÆÃÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: diff.c:1858
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: ¥Ð¥Ã¥Õ¥¡ \"%s\" ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: diff.c:1864
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: ¥Ð¥Ã¥Õ¥¡ \"%s\" ¤Ïº¹Ê¬¥â¡¼¥É¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: ¹ç»ú¤ËEscape¤Ï»ÈÍѤǤ­¤Þ¤»¤ó"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: ¥­¡¼¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :source ¤Ç¼è¹þ¤à¥Õ¥¡¥¤¥ë°Ê³°¤Ç¤Ï :loadkeymap ¤ò»È¤¨¤Þ¤»¤ó"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " ¥­¡¼¥ï¡¼¥ÉÊä´° (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X ¥â¡¼¥É (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " ¶É½ê¥­¡¼¥ï¡¼¥ÉÊä´° (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " ¹Ô(Á´ÂÎ)Êä´° (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr "¥Õ¥¡¥¤¥ë̾Êä´° (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " ¥¿¥°Êä´° (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " ¥Ñ¥¹¥Ñ¥¿¡¼¥óÊä´° (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " ÄêµÁÊä´° (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " ¼­½ñÊä´° (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " ¥·¥½¡¼¥é¥¹Êä´° (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " ¥³¥Þ¥ó¥É¥é¥¤¥óÊä´° (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "ÃÊÍî¤ÎºÇ¸å¤Ë¥Ò¥Ã¥È"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus' ¥ª¥×¥·¥ç¥ó¤¬¶õ¤Ç¤¹"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "'dictionary' ¥ª¥×¥·¥ç¥ó¤¬¶õ¤Ç¤¹"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "¼­½ñ¤ò¥¹¥­¥ã¥óÃæ: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (ÁÞÆþ) ¥¹¥¯¥í¡¼¥ë(^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (ÃÖ´¹) ¥¹¥¯¥í¡¼¥ë (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "¥¹¥­¥ã¥óÃæ: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "¥¿¥°¤ò¥¹¥­¥ã¥óÃæ."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " ÄɲÃÃæ"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- ¸¡º÷Ãæ..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "»Ï¤á¤ËÌá¤ë"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "¾¤Î¹Ô¤Îñ¸ì"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "Í£°ì¤Î³ºÅö"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "%d ÈÖÌܤγºÅö (Á´³ºÅö %d ¸ÄÃæ)"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "%d ÈÖÌܤγºÅö"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: ̤ÃΤÎÊÑ¿ô: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ¥«¥Ã¥³ '(' ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: ¤½¤ÎÊÑ¿ô¤Ï¤¢¤ê¤Þ¤»¤ó: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' ¤Î¸å¤Ë ':' ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: ')' ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: ']' ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ¥ª¥×¥·¥ç¥ó̾¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ̤ÃΤΥª¥×¥·¥ç¥ó¤Ç¤¹: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: °úÍÑÉä (\") ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: °úÍÑÉä (') ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: ´Ø¿ô %s ¤Ë¤Ï̵¸ú¤Ê°ú¿ô¤Ç¤¹"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: ̤ÃΤδؿô¤Ç¤¹: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: ´Ø¿ô¤Î°ú¿ô¤¬Â¿¤¹¤®¤Þ¤¹: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: ´Ø¿ô¤Î°ú¿ô¤¬Â­¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: ¥¹¥¯¥ê¥×¥È°Ê³°¤Ç<SID>¤¬»È¤ï¤ì¤Þ¤·¤¿: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4376 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ¹Ô:"
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"·èÄê(&O)\n"
+"¥­¥ã¥ó¥»¥ë(&C)"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "inputrestore() ¤¬ inputsave() ¤è¤ê¤â¿¤¯¸Æ¤Ð¤ì¤Þ¤·¤¿"
+
+# Added at 10-Mar-2004.
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬Â¿²á¤®¤Þ¤¹ (½Û´Ä¤·¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Vim ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ¥µ¡¼¥Ð¤Î±þÅú¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: ¥¯¥é¥¤¥¢¥ó¥È¤ØÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: %s ¤ØÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(̵¸ú)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: ̤ÄêµÁ¤ÎÊÑ¿ô¤Ç¤¹: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: ÉÔÀµ¤ÊÊÑ¿ô̾¤Ç¤¹: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: ´Ø¿ô %s ¤ÏÄêµÁºÑ¤Ç¤¹, ºÆÄêµÁ¤¹¤ë¤Ë¤Ï ! ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤"
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: ̤ÄêµÁ¤Î´Ø¿ô¤Ç¤¹: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: '(' ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: ÉÔÀµ¤Ê°ú¿ô¤Ç¤¹: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: :endfunction ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: ´Ø¿ô %s ¤òºÆÄêµÁ¤Ç¤­¤Þ¤»¤ó: »ÈÍÑÃæ¤Ç¤¹"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: ´Ø¿ô̾¤¬Í׵ᤵ¤ì¤Þ¤¹"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: ´Ø¿ô̾¤ÏÂçʸ»ú¤Ç»Ï¤Þ¤é¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: ̤ÄêµÁ¤Î´Ø¿ô¤Ç¤¹: %s"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: ´Ø¿ô %s ¤òºï½ü¤Ç¤­¤Þ¤»¤ó: »ÈÍÑÃæ¤Ç¤¹"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: ´Ø¿ô¸Æ½Ð¤ÎÆþ¤ì»Ò¿ô¤¬ 'maxfuncdepth' ¤òĶ¤¨¤Þ¤·¤¿"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "%s ¤ò¼Â¹ÔÃæ¤Ç¤¹"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "%s ¤¬ÃæÃǤµ¤ì¤Þ¤·¤¿"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ¤¬ #%ld ¤òÊÖ¤·¤Þ¤·¤¿"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ¤¬ \"%s\" ¤òÊÖ¤·¤Þ¤·¤¿"
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "%s ¤Î¼Â¹Ô¤ò·Ñ³Ãæ¤Ç¤¹"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: ´Ø¿ô³°¤Ë :return ¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: eval.c:9952
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ¥°¥í¡¼¥Ð¥ëÊÑ¿ô:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, 16¿Ê¿ô %02x, 8¿Ê¿ô %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, 16¿Ê¿ô %04x, 8¿Ê¿ô %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, 16¿Ê¿ô %08x, 8¿Ê¿ô %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: ¹Ô¤ò¤½¤ì¼«¿È¤Ë¤Ï°ÜÆ°¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 ¹Ô¤¬°ÜÆ°¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld ¹Ô¤¬°ÜÆ°¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld ¹Ô¤¬¥Õ¥£¥ë¥¿½èÍý¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *¥Õ¥£¥ë¥¿* autocommand¤Ï¸½ºß¤Î¥Ð¥Ã¥Õ¥¡¤òÊѹ¹¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[ºÇ¸å¤ÎÊѹ¹¤¬Êݸ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s ¹ÔÌÜ: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ¥¨¥é¡¼¤¬Â¿²á¤®¤ë¤Î¤Ç, °Ê¹ß¤Ï¥¹¥­¥Ã¥×¤·¤Þ¤¹"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "viminfo¥Õ¥¡¥¤¥ë \"%s\"%s%s%s ¤òÆɹþ¤ßÃæ "
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " ¾ðÊó"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " ¥Þ¡¼¥¯"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " ¼ºÇÔ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: viminfo¥Õ¥¡¥¤¥ë¤¬½ñ¹þ¤ß¤Ç¤­¤Þ¤»¤ó: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: viminfo¥Õ¥¡¥¤¥ë %s ¤òÊݸ¤Ç¤­¤Þ¤»¤ó!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "viminfo¥Õ¥¡¥¤¥ë \"%s\" ¤ò½ñ¹þ¤ßÃæ"
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# ¤³¤Î viminfo ¥Õ¥¡¥¤¥ë¤Ï Vim %s ¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤Þ¤·¤¿.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Êѹ¹¤¹¤ëºÝ¤Ë¤Ï½½Ê¬Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# ¤³¤Î¥Õ¥¡¥¤¥ë¤¬½ñ¤«¤ì¤¿»þ¤Î 'encoding' ¤ÎÃÍ\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "ÉÔÀµ¤ÊÀèƬʸ»ú¤Ç¤¹"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "ÊÌ̾¤ÇÊݸ"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Ʊ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¾¤Î¥Ð¥Ã¥Õ¥¡¤ÇÆɹþ¤Þ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "¥Õ¥¡¥¤¥ë¤òÉôʬŪ¤ËÊݸ¤·¤Þ¤¹¤«?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ¥Ð¥Ã¥Õ¥¡¤òÉôʬŪ¤ËÊݸ¤¹¤ë¤Ë¤Ï ! ¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "´û¸¤Î¥Õ¥¡¥¤¥ë \"%.*s\" ¤ò¾å½ñ¤­¤·¤Þ¤¹¤«?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ¥Ð¥Ã¥Õ¥¡ %ld ¤Ë¤Ï̾Á°¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ¥Õ¥¡¥¤¥ë¤ÏÊݸ¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿: 'write' ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê̵¸ú¤Ç¤¹"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" ¤Ë¤Ï 'readonly' ¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹\n"
+"¶¯À©Åª¤Ë¾å½ñ¤­¤·¤Þ¤¹¤«?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "¥Õ¥¡¥¤¥ë¤òÊÔ½¸"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: autocommand¤¬Í½´ü¤»¤º¿·¤·¤¤¥Ð¥Ã¥Õ¥¡ %s ¤òºï½ü¤·¤Þ¤·¤¿"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ¿ô¤Ç¤Ï¤Ê¤¤°ú¿ô¤¬ :z ¤ËÅϤµ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim¤Ç¤Ï¥·¥§¥ë¥³¥Þ¥ó¥É¤ò»È¤¨¤Þ¤»¤ó"
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Àµµ¬É½¸½¤Ïʸ»ú¤Ç¶èÀڤ뤳¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "%s ¤ËÃÖ´¹¤·¤Þ¤¹¤«? (y/n/a/q/l/^E/^Y)"
+
+#: ex_cmds.c:4270
+msgid "(Interrupted) "
+msgstr "(³ä¹þ¤Þ¤ì¤Þ¤·¤¿)"
+
+#: ex_cmds.c:4274
+msgid "1 substitution"
+msgstr "1 ²Õ½êÃÖ´¹¤·¤Þ¤·¤¿"
+
+#: ex_cmds.c:4276
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld ²Õ½êÃÖ´¹¤·¤Þ¤·¤¿"
+
+#: ex_cmds.c:4279
+msgid " on 1 line"
+msgstr " (·× 1 ¹ÔÆâ)"
+
+#: ex_cmds.c:4281
+#, c-format
+msgid " on %ld lines"
+msgstr " (·× %ld ¹ÔÆâ)"
+
+#: ex_cmds.c:4332
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ¤òºÆµ¢Åª¤Ë¤Ï»È¤¨¤Þ¤»¤ó"
+
+#: ex_cmds.c:4367
+msgid "E148: Regular expression missing from global"
+msgstr "E148: global¥³¥Þ¥ó¥É¤ËÀµµ¬É½¸½¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: ex_cmds.c:4416
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "¥Ñ¥¿¡¼¥ó¤¬Á´¤Æ¤Î¹Ô¤Ç¤ß¤Ä¤«¤ê¤Þ¤·¤¿: %s"
+
+#: ex_cmds.c:4497
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# ºÇ¸å¤ËÃÖ´¹¤µ¤ì¤¿Ê¸»úÎó:\n"
+"$"
+
+#: ex_cmds.c:4598 ex_docmd.c:2011
+msgid "E478: Don't panic!"
+msgstr "E478: ¹²¤Æ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤"
+
+#: ex_cmds.c:4650
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: »ÄÇ°¤Ç¤¹¤¬ '%s' ¤Î¥Ø¥ë¥×¤¬ %s ¤Ë¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:4653
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: »ÄÇ°¤Ç¤¹¤¬ %s ¤Ë¤Ï¥Ø¥ë¥×¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:4687
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "»ÄÇ°¤Ç¤¹¤¬¥Ø¥ë¥×¥Õ¥¡¥¤¥ë \"%s\" ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:5170
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: ex_cmds.c:5309
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ½ñ¹þ¤ßÍÑ¤Ë %s ¤ò³«¤±¤Þ¤»¤ó"
+
+#: ex_cmds.c:5345
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: ÆɹþÍÑ¤Ë %s ¤ò³«¤±¤Þ¤»¤ó"
+
+# Added at 29-Apr-2004.
+#: ex_cmds.c:5367
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: 1¤Ä¤Î¸À¸ì¤Î¥Ø¥ë¥×¥Õ¥¡¥¤¥ë¤ËÊ£¿ô¤Î¥¨¥ó¥³¡¼¥É¤¬º®ºß¤·¤Æ¤¤¤Þ¤¹: %s"
+
+#: ex_cmds.c:5445
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ¥¿¥° \"%s\" ¤¬¥Õ¥¡¥¤¥ë %s ¤Ë½ÅÊ£¤·¤Æ¤¤¤Þ¤¹"
+
+#: ex_cmds.c:5557
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: ̤ÃΤÎsign¥³¥Þ¥ó¥É¤Ç¤¹: %s"
+
+#: ex_cmds.c:5577
+msgid "E156: Missing sign name"
+msgstr "E156: sign̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:5623
+msgid "E612: Too many signs defined"
+msgstr "E612: sign¤ÎÄêµÁ¤¬Â¿¿ô¸«¤Ä¤«¤ê¤Þ¤·¤¿"
+
+#: ex_cmds.c:5691
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ̵¸ú¤Êsign¤Î¥Æ¥­¥¹¥È¤Ç¤¹: %s"
+
+#: ex_cmds.c:5722 ex_cmds.c:5913
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ̤ÃΤÎsign¤Ç¤¹: %s"
+
+#: ex_cmds.c:5771
+msgid "E159: Missing sign number"
+msgstr "E159: sign¤ÎÈֹ椬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds.c:5853
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: ̵¸ú¤Ê¥Ð¥Ã¥Õ¥¡Ì¾¤Ç¤¹: %s"
+
+#: ex_cmds.c:5892
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: ̵¸ú¤Êsign¼±Ê̻ҤǤ¹: %ld"
+
+# Added at 27-Jan-2004.
+#: ex_cmds.c:5962
+msgid " (NOT FOUND)"
+msgstr " (¤ß¤Ä¤«¤ê¤Þ¤»¤ó)"
+
+#: ex_cmds.c:5964
+msgid " (not supported)"
+msgstr " (È󥵥ݡ¼¥È)"
+
+#: ex_cmds.c:6063
+msgid "[Deleted]"
+msgstr "[ºï½üºÑ]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹. ³¤±¤ë¤Ë¤Ï \"cont\" ¤ÈÆþÎϤ·¤Æ¤¯¤À¤µ¤¤."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "¹Ô %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "¥³¥Þ¥ó¥É: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È \"%s%s\" ¹Ô %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ¹Ô %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Êѹ¹¤ò \"%.*s\" ¤ËÊݸ¤·¤Þ¤¹¤«?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9356
+msgid "Untitled"
+msgstr "̵Âê"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ¥Ð¥Ã¥Õ¥¡ \"%s\" ¤ÎÊѹ¹¤ÏÊݸ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "·Ù¹ð: ͽ´ü¤»¤ºÂ¾¥Ð¥Ã¥Õ¥¡¤Ø°ÜÆ°¤·¤Þ¤·¤¿ (autocommands ¤òÄ´¤Ù¤Æ¤¯¤À¤µ¤¤)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: ÊÔ½¸¤¹¤ë¥Õ¥¡¥¤¥ë¤Ï1¤Ä¤·¤«¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: ºÇ½é¤Î¥Õ¥¡¥¤¥ë¤è¤êÁ°¤Ë¤Ï¹Ô¤±¤Þ¤»¤ó"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ºÇ¸å¤Î¥Õ¥¡¥¤¥ë¤ò±Û¤¨¤Æ¸å¤Ë¤Ï¹Ô¤±¤Þ¤»¤ó"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: ¤½¤Î¥³¥ó¥Ñ¥¤¥é¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "\"%s\" ¤ò \"%s\" ¤«¤é¸¡º÷Ãæ"
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "\"%s\" ¤ò¸¡º÷Ãæ"
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "'runtimepath' ¤ÎÃæ¤Ë¤Ï¤ß¤Ä¤«¤ê¤Þ¤»¤ó: \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "Vim¥¹¥¯¥ê¥×¥È¤Î¼è¹þ¤ß"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼è¹þ¤á¤Þ¤»¤ó: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "\"%s\" ¤ò¼è¹þ¤á¤Þ¤»¤ó"
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "¹Ô %ld: \"%s\" ¤ò¼è¹þ¤á¤Þ¤»¤ó"
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "\"%s\" ¤ò¼è¹þÃæ"
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "¹Ô %ld: %s ¤ò¼è¹þÃæ"
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "%s ¤Î¼è¹þ¤ò´°Î»"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: ·Ù¹ð: ¹Ô¶èÀÚ¤¬ÉÔÀµ¤Ç¤¹. ^M ¤¬¤Ê¤¤¤Î¤Ç¤·¤ç¤¦"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding ¤¬¼è¹þ¥¹¥¯¥ê¥×¥È°Ê³°¤Ç»ÈÍѤµ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish ¤¬¼è¹þ¥¹¥¯¥ê¥×¥È°Ê³°¤Ç»ÈÍѤµ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "%d ¥Ú¡¼¥¸"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "°õºþ¤¹¤ë¥Æ¥­¥¹¥È¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds2.c:3472
+msgid "Printing page %d (%d%%)"
+msgstr "°õºþÃæ: ¥Ú¡¼¥¸ %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " ¥³¥Ô¡¼ %d (Á´ %d Ãæ)"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "°õºþ¤·¤Þ¤·¤¿: %s"
+
+#: ex_cmds2.c:3549
+msgid "Printing aborted"
+msgstr "°õºþ¤¬Ãæ»ß¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: PostScript½ÐÎÏ¥Õ¥¡¥¤¥ë¤Î½ñ¹þ¤ß¥¨¥é¡¼¤Ç¤¹"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: ¥Õ¥¡¥¤¥ë \"%s\" ¤ò³«¤±¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: PostScript¤Î¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë \"%s\" ¤òÆɹþ¤á¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: ¥Õ¥¡¥¤¥ë \"%s\" ¤Ï PostScript ¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: ¥Õ¥¡¥¤¥ë \"%s\" ¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤ PostScript ¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤¹"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: ¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë \"%s\" ¤Ï¥Ð¡¼¥¸¥ç¥ó¤¬°Û¤Ê¤ê¤Þ¤¹"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: PostScript½ÐÎÏÍѤΥե¡¥¤¥ë¤ò³«¤±¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: ¥Õ¥¡¥¤¥ë \"%s\" ¤ò³«¤±¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: PostScript¤Î¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë \"prolog.ps\" ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: PostScript¤Î¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë \"%s.ps\" ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¥¨¥ó¥³¡¼¥É \"%s\" ¤ØÊÑ´¹¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "¥×¥ê¥ó¥¿¤ËÁ÷¿®Ãæ..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: PostScript¥Õ¥¡¥¤¥ë¤Î°õºþ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "°õºþ¥¸¥ç¥Ö¤òÁ÷¿®¤·¤Þ¤·¤¿."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "¸½ºß¤Î %s¸À¸ì: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ¸À¸ì¤ò \"%s\" ¤ËÀßÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Ex¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹. ¥Î¡¼¥Þ¥ë¤ËÌá¤ë¤Ë¤Ï\"visual\"¤ÈÆþÎϤ·¤Æ¤¯¤À¤µ¤¤."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: ¥Õ¥¡¥¤¥ë¤Î½ªÎ»°ÌÃÖ"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: ¥³¥Þ¥ó¥É¤¬ºÆµ¢Åª²á¤®¤Þ¤¹"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Îã³°¤¬Ê᪤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "¼è¹þ¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ç¤¹"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "´Ø¿ô¤ÎºÇ¸å¤Ç¤¹"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: ¥æ¡¼¥¶ÄêµÁ¥³¥Þ¥ó¥É¤Î¤¢¤¤¤Þ¤¤¤Ê»ÈÍѤǤ¹"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: ¥¨¥Ç¥£¥¿¤Î¥³¥Þ¥ó¥É¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:2030
+msgid "E493: Backwards range given"
+msgstr "E493: µÕ¤µ¤Þ¤ÎÈϰϤ¬»ØÄꤵ¤ì¤Þ¤·¤¿"
+
+#: ex_docmd.c:2039
+msgid "Backwards range given, OK to swap"
+msgstr "µÕ¤µ¤Þ¤ÎÈϰϤ¬»ØÄꤵ¤ì¤Þ¤·¤¿, ÆþÂؤ¨¤Þ¤¹¤«?"
+
+#: ex_docmd.c:2162
+msgid "E494: Use w or w>>"
+msgstr "E494: w ¤â¤·¤¯¤Ï w>> ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤"
+
+#: ex_docmd.c:3788
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤³¤Î¥³¥Þ¥ó¥É¤ÏÍøÍѤǤ­¤Þ¤»¤ó, ¤´¤á¤ó¤Ê¤µ¤¤"
+
+#: ex_docmd.c:3991
+msgid "E172: Only one file name allowed"
+msgstr "E172: ¥Õ¥¡¥¤¥ë̾¤Ï 1 ¤Ä¤Ë¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: ex_docmd.c:4571
+msgid "1 more file to edit. Quit anyway?"
+msgstr "ÊÔ½¸¤¹¤Ù¤­¥Õ¥¡¥¤¥ë¤¬ 1 ¸Ä¤¢¤ê¤Þ¤¹¤¬, ½ªÎ»¤·¤Þ¤¹¤«?"
+
+#: ex_docmd.c:4574
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "ÊÔ½¸¤¹¤Ù¤­¥Õ¥¡¥¤¥ë¤¬¤¢¤È %d ¸Ä¤¢¤ê¤Þ¤¹¤¬, ½ªÎ»¤·¤Þ¤¹¤«?"
+
+#: ex_docmd.c:4581
+msgid "E173: 1 more file to edit"
+msgstr "E173: ÊÔ½¸¤¹¤Ù¤­¥Õ¥¡¥¤¥ë¤¬ 1 ¸Ä¤¢¤ê¤Þ¤¹"
+
+#: ex_docmd.c:4583
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: ÊÔ½¸¤¹¤Ù¤­¥Õ¥¡¥¤¥ë¤¬¤¢¤È %ld ¸Ä¤¢¤ê¤Þ¤¹"
+
+#: ex_docmd.c:4678
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: ¥³¥Þ¥ó¥É¤¬´û¤Ë¤¢¤ê¤Þ¤¹: ºÆÄêµÁ¤¹¤ë¤Ë¤Ï ! ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤"
+
+#: ex_docmd.c:4789
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" ̾Á° °ú¿ô ÈÏ°Ï Êä´° ÄêµÁ"
+
+#: ex_docmd.c:4878
+msgid "No user-defined commands found"
+msgstr "¥æ¡¼¥¶ÄêµÁ¥³¥Þ¥ó¥É¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: ex_docmd.c:4910
+msgid "E175: No attribute specified"
+msgstr "E175: °À­¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: ex_docmd.c:4962
+msgid "E176: Invalid number of arguments"
+msgstr "E176: °ú¿ô¤Î¿ô¤¬Ìµ¸ú¤Ç¤¹"
+
+#: ex_docmd.c:4977
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ¥«¥¦¥ó¥È¤ò2½Å»ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_docmd.c:4987
+msgid "E178: Invalid default value for count"
+msgstr "E178: ¥«¥¦¥ó¥È¤Î¾ÊάÃͤ¬Ìµ¸ú¤Ç¤¹"
+
+#: ex_docmd.c:5018
+msgid "E179: argument required for complete"
+msgstr "E179: Êä´°¤Î¤¿¤á¤Î°ú¿ô¤¬É¬ÍפǤ¹"
+
+#: ex_docmd.c:5050
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ̵¸ú¤ÊÊä´°»ØÄê¤Ç¤¹: %s"
+
+#: ex_docmd.c:5059
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Êä´°°ú¿ô¤Ï¥«¥¹¥¿¥àÊä´°¤Ç¤·¤«»ÈÍѤǤ­¤Þ¤»¤ó"
+
+#: ex_docmd.c:5065
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: ¥«¥¹¥¿¥àÊä´°¤Ë¤Ï°ú¿ô¤È¤·¤Æ´Ø¿ô¤¬É¬ÍפǤ¹"
+
+#: ex_docmd.c:5076
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ̵¸ú¤Ê°À­¤Ç¤¹: %s"
+
+#: ex_docmd.c:5119
+msgid "E182: Invalid command name"
+msgstr "E182: ̵¸ú¤Ê¥³¥Þ¥ó¥É̾¤Ç¤¹"
+
+#: ex_docmd.c:5134
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: ¥æ¡¼¥¶ÄêµÁ¥³¥Þ¥ó¥É¤Ï±ÑÂçʸ»ú¤Ç»Ï¤Þ¤é¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:5205
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ¤½¤Î¥æ¡¼¥¶ÄêµÁ¥³¥Þ¥ó¥É¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: ex_docmd.c:5666
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: ¥«¥é¡¼¥¹¥­¡¼¥à %s ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:5674
+msgid "Greetings, Vim user!"
+msgstr "Vim »È¤¤¤µ¤ó¡¢¤ä¤¢!"
+
+#: ex_docmd.c:6391
+msgid "Edit File in new window"
+msgstr "¿·¤·¤¤¥¦¥£¥ó¥É¥¦¤Ç¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Þ¤¹"
+
+#: ex_docmd.c:6686
+msgid "No swap file"
+msgstr "¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:6790
+msgid "Append File"
+msgstr "Äɲåե¡¥¤¥ë"
+
+#: ex_docmd.c:6854
+msgid "E186: No previous directory"
+msgstr "E186: Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:6936
+msgid "E187: Unknown"
+msgstr "E187: ̤ÃÎ"
+
+#: ex_docmd.c:7021
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: "
+
+#: ex_docmd.c:7077
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "¥¦¥£¥ó¥É¥¦°ÌÃÖ: X %d, Y %d"
+
+#: ex_docmd.c:7082
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: ¤³¤Î¥×¥é¥Ã¥È¥Û¡¼¥à¤Ë¤Ï¥¦¥£¥ó¥É¥¦°ÌÃ֤μèÆÀµ¡Ç½¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: ex_docmd.c:7092
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos ¤Ë¤Ï2¤Ä¤Î¿ôÃͤΰú¿ô¤¬É¬ÍפǤ¹"
+
+#: ex_docmd.c:7370
+msgid "Save Redirection"
+msgstr "¥ê¥À¥¤¥ì¥¯¥È¤òÊݸ¤·¤Þ¤¹"
+
+#: ex_docmd.c:7560
+msgid "Save View"
+msgstr "¥Ó¥å¡¼¤òÊݸ¤·¤Þ¤¹"
+
+#: ex_docmd.c:7561
+msgid "Save Session"
+msgstr "¥»¥Ã¥·¥ç¥ó¾ðÊó¤òÊݸ¤·¤Þ¤¹"
+
+#: ex_docmd.c:7563
+msgid "Save Setup"
+msgstr "ÀßÄê¤òÊݸ¤·¤Þ¤¹"
+
+#: ex_docmd.c:7715
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ¤¬Â¸ºß¤·¤Þ¤¹ (¾å½ñ¤¹¤ë¤Ë¤Ï ! ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤)"
+
+#: ex_docmd.c:7720
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: \"%s\" ¤ò½ñ¹þ¤ßÍѤȤ·¤Æ³«¤±¤Þ¤»¤ó"
+
+#. set mark
+#: ex_docmd.c:7744
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: °ú¿ô¤Ïʸ»ú¤«Á°¿Ê/¸åÂ९¥©¡¼¥È¤Ç¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó"
+
+#: ex_docmd.c:7786
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal ¤ÎºÆµ¢ÍøÍѤ¬¿¼¤¯¤Ê¤ê¤¹¤®¤Þ¤·¤¿"
+
+#: ex_docmd.c:8304
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: '#'¤òÃÖ¤­´¹¤¨¤ëÉû¥Õ¥¡¥¤¥ë¤Î̾Á°¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:8335
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: \"<afile>\"¤òÃÖ¤­´¹¤¨¤ëautocommand¤Î¥Õ¥¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:8343
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: \"<abuf>\"¤òÃÖ¤­´¹¤¨¤ëautocommand¥Ð¥Ã¥Õ¥¡Èֹ椬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:8354
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: \"<amatch>\"¤òÃÖ¤­´¹¤¨¤ëautocommand¤Î³ºÅö̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:8364
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: \"<sfile>\"¤òÃÖ¤­´¹¤¨¤ë :source Âоݥե¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_docmd.c:8405
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr ""
+"E499: '%' ¤ä '#' ¤¬ÌµÌ¾¥Õ¥¡¥¤¥ë¤Ê¤Î¤Ç \":p:h\" ¤òȼ¤ï¤Ê¤¤»È¤¤Êý¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: ex_docmd.c:8407
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: ¶õʸ»úÎó¤È¤·¤Æɾ²Á¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_docmd.c:9338
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: viminfo¥Õ¥¡¥¤¥ë¤òÆɹþÍѤȤ·¤Æ³«¤±¤Þ¤»¤ó"
+
+#: ex_docmd.c:9511
+msgid "E196: No digraphs in this version"
+msgstr "E196: ¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¹ç»ú¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: 'Vim' ¤Ç»Ï¤Þ¤ëÎã³°¤Ï :throw ¤Ç¤­¤Þ¤»¤ó"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Îã³°¤¬È¯À¸¤·¤Þ¤·¤¿: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Îã³°¤¬¼ý«¤·¤Þ¤·¤¿: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Îã³°¤¬ÇË´þ¤µ¤ì¤Þ¤·¤¿: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, ¹Ô %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Îã³°¤¬Ê᪤µ¤ì¤Þ¤·¤¿: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s ¤Ë¤è¤ê̤·èÄê¾õÂÖ¤¬À¸¤¸¤Þ¤·¤¿"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s ¤¬ºÆ³«¤·¤Þ¤·¤¿"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s ¤¬ÇË´þ¤µ¤ì¤Þ¤·¤¿"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Îã³°"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "¥¨¥é¡¼¤È³ä¹þ¤ß"
+
+#: ex_eval.c:754 gui.c:4375
+msgid "Error"
+msgstr "¥¨¥é¡¼"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "³ä¹þ¤ß"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if ¤ÎÆþ¤ì»Ò¤¬¿¼²á¤®¤Þ¤¹"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :if ¤Î¤Ê¤¤ :endif ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :if ¤Î¤Ê¤¤ :else ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :if ¤Î¤Ê¤¤ :elseif ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: Ê£¿ô¤Î :else ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :else ¤Î¸å¤Ë :elseif ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: :while ¤ÎÆþ¤ì»Ò¤¬¿¼¤¯²á¤®¤Þ¤¹"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :while ¤Î¤Ê¤¤ :continue ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :while ¤Î¤Ê¤¤ :break ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: :try ¤ÎÆþ¤ì»Ò¤¬¿¼²á¤®¤Þ¤¹"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :try ¤Î¤Ê¤¤ :catch ¤¬¤¢¤ê¤Þ¤¹"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :finally ¤Î¸å¤Ë :catch ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :try ¤Î¤Ê¤¤ :finally ¤¬¤¢¤ê¤Þ¤¹"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: Ê£¿ô¤Î :finalyy ¤¬¤¢¤ê¤Þ¤¹"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :try ¤Î¤Ê¤¤ :endtry ¤Ç¤¹"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: ´Ø¿ô¤Î³°¤Ë :endfunction ¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: ex_getln.c:3295
+msgid "tagname"
+msgstr "¥¿¥°Ì¾"
+
+#: ex_getln.c:3298
+msgid " kind file\n"
+msgstr " ¥Õ¥¡¥¤¥ë¼ïÎà\n"
+
+#: ex_getln.c:4751
+msgid "'history' option is zero"
+msgstr "¥ª¥×¥·¥ç¥ó 'history' ¤¬¥¼¥í¤Ç¤¹"
+
+#: ex_getln.c:5017
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s ¹àÌܤÎÍúÎò (¿·¤·¤¤¤â¤Î¤«¤é¸Å¤¤¤â¤Î¤Ø):\n"
+
+#: ex_getln.c:5018
+msgid "Command Line"
+msgstr "¥³¥Þ¥ó¥É¥é¥¤¥ó"
+
+#: ex_getln.c:5019
+msgid "Search String"
+msgstr "¸¡º÷ʸ»úÎó"
+
+#: ex_getln.c:5020
+msgid "Expression"
+msgstr "¼°"
+
+#: ex_getln.c:5021
+msgid "Input Line"
+msgstr "ÆþÎϹÔ"
+
+#: ex_getln.c:5059
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ¤¬¥³¥Þ¥ó¥ÉŤòĶ¤¨¤Þ¤·¤¿"
+
+#: ex_getln.c:5236
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: ¥¢¥¯¥Æ¥£¥Ö¤Ê¥¦¥£¥ó¥É¥¦¤«¥Ð¥Ã¥Õ¥¡¤¬ºï½ü¤µ¤ì¤Þ¤·¤¿"
+
+#: fileio.c:371
+msgid "Illegal file name"
+msgstr "ÉÔÀµ¤Ê¥Õ¥¡¥¤¥ë̾"
+
+#: fileio.c:395 fileio.c:529 fileio.c:2850 fileio.c:2891
+msgid "is a directory"
+msgstr " ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹"
+
+#: fileio.c:397
+msgid "is not a file"
+msgstr " ¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: fileio.c:551 fileio.c:4057
+msgid "[New File]"
+msgstr "[¿·¥Õ¥¡¥¤¥ë]"
+
+#: fileio.c:584
+msgid "[Permission Denied]"
+msgstr "[ǧ²Ä¤¬¤¢¤ê¤Þ¤»¤ó]"
+
+#: fileio.c:688
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre autocommand ¤¬¥Õ¥¡¥¤¥ë¤òÆɹþÉԲĤˤ·¤Þ¤·¤¿"
+
+#: fileio.c:690
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre autocommand ¤Ï¸½ºß¤Î¥Ð¥Ã¥Õ¥¡¤òÊѤ¨¤é¤ì¤Þ¤»¤ó"
+
+#: fileio.c:711
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: ɸ½àÆþÎϤ«¤éÆɹþÃæ...\n"
+
+#: fileio.c:717
+msgid "Reading from stdin..."
+msgstr "ɸ½àÆþÎϤ«¤éÆɹþ¤ßÃæ..."
+
+#. Re-opening the original file failed!
+#: fileio.c:988
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ÊÑ´¹¤¬¥Õ¥¡¥¤¥ë¤òÆɹþÉԲĤˤ·¤Þ¤·¤¿"
+
+#: fileio.c:2027
+msgid "[fifo/socket]"
+msgstr "[FIFO/¥½¥±¥Ã¥È]"
+
+#: fileio.c:2034
+msgid "[fifo]"
+msgstr "[FIFO]"
+
+#: fileio.c:2041
+msgid "[socket]"
+msgstr "[¥½¥±¥Ã¥È]"
+
+#: fileio.c:2049
+msgid "[RO]"
+msgstr "[ÆÉÀì]"
+
+#: fileio.c:2059
+msgid "[CR missing]"
+msgstr "[CR̵]"
+
+#: fileio.c:2064
+msgid "[NL found]"
+msgstr "[NLÍ­]"
+
+#: fileio.c:2069
+msgid "[long lines split]"
+msgstr "[Ĺ¹Ôʬ³ä]"
+
+#: fileio.c:2075 fileio.c:4041
+msgid "[NOT converted]"
+msgstr "[̤ÊÑ´¹]"
+
+#: fileio.c:2080 fileio.c:4046
+msgid "[converted]"
+msgstr "[ÊÑ´¹ºÑ]"
+
+#: fileio.c:2087 fileio.c:4071
+msgid "[crypted]"
+msgstr "[°Å¹æ²½]"
+
+#: fileio.c:2094
+msgid "[CONVERSION ERROR]"
+msgstr "[ÊÑ´¹¥¨¥é¡¼]"
+
+#: fileio.c:2100
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[%ld ¹ÔÌܤÎÉÔÀµ¤Ê¥Ð¥¤¥È]"
+
+#: fileio.c:2107
+msgid "[READ ERRORS]"
+msgstr "[Æɹþ¥¨¥é¡¼]"
+
+#: fileio.c:2323
+msgid "Can't find temp file for conversion"
+msgstr "ÊÑ´¹¤ËɬÍפʰì»þ¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: fileio.c:2330
+msgid "Conversion with 'charconvert' failed"
+msgstr "'charconvert' ¤Ë¤è¤ëÊÑ´¹¤¬¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: fileio.c:2333
+msgid "can't read output of 'charconvert'"
+msgstr "'charconvert' ¤Î½ÐÎϤòÆɹþ¤á¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: fileio.c:2733
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Êݸ¤¹¤ë¥Ð¥Ã¥Õ¥¡¤òautocommand¤¬ºï½ü¤«²òÊü¤·¤Þ¤·¤¿"
+
+#: fileio.c:2756
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: autocommand¤¬Í½´ü¤»¤ÌÊýË¡¤Ç¹Ô¿ô¤òÊѹ¹¤·¤Þ¤·¤¿"
+
+# Added at 19-Jan-2004.
+#: fileio.c:2794
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans¤Ï̤Êѹ¹¤Î¥Ð¥Ã¥Õ¥¡¤ò¾å½ñ¤¹¤ë¤³¤È¤Ïµö²Ä¤·¤Æ¤¤¤Þ¤»¤ó"
+
+#: fileio.c:2802
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "NetBeans¥Ð¥Ã¥Õ¥¡¤Î°ìÉô¤ò½ñ¤­½Ð¤¹¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: fileio.c:2856 fileio.c:2874
+msgid "is not a file or writable device"
+msgstr "¤Ï¥Õ¥¡¥¤¥ë¤Ç¤â½ñ¹þ¤ß²Äǽ¥Ç¥Ð¥¤¥¹¤Ç¤â¤¢¤ê¤Þ¤»¤ó"
+
+#: fileio.c:2926
+msgid "is read-only (add ! to override)"
+msgstr "¤ÏÆɹþÀìÍѤǤ¹ (¶¯À©½ñ¹þ¤Ë¤Ï ! ¤òÄɲÃ)"
+
+#: fileio.c:3272
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤òÊݸ¤Ç¤­¤Þ¤»¤ó (! ¤òÄɲäǶ¯À©Êݸ)"
+
+#: fileio.c:3284
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr ""
+"E507: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤òÊĤ¸¤ëºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿ (! ¤òÄɲäǶ¯À©)"
+
+#: fileio.c:3286
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: ¥Ð¥Ã¥¯¥¢¥Ã¥×ÍÑ¥Õ¥¡¥¤¥ë¤òÆɹþ¤á¤Þ¤»¤ó (! ¤òÄɲäǶ¯À©Æɹþ)"
+
+#: fileio.c:3302
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤òºî¤ì¤Þ¤»¤ó (! ¤òÄɲäǶ¯À©ºîÀ®)"
+
+#: fileio.c:3405
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤òºî¤ì¤Þ¤»¤ó (! ¤òÄɲäǶ¯À©ºîÀ®)"
+
+#: fileio.c:3467
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: ¥ê¥½¡¼¥¹¥Õ¥©¡¼¥¯¤¬¼º¤ï¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó (! ¤òÄɲäǶ¯À©)"
+
+#: fileio.c:3566
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: ÊݸÍÑ°ì»þ¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: fileio.c:3584
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: ÊÑ´¹¤Ç¤­¤Þ¤»¤ó (! ¤òÄɲäÇÊÑ´¹¤»¤º¤ËÊݸ)"
+
+#: fileio.c:3619
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ¥ê¥ó¥¯¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë½ñ¹þ¤á¤Þ¤»¤ó"
+
+#: fileio.c:3623
+msgid "E212: Can't open file for writing"
+msgstr "E212: ½ñ¹þ¤ßÍѤ˥ե¡¥¤¥ë¤ò³«¤±¤Þ¤»¤ó"
+
+#: fileio.c:3885
+msgid "E667: Fsync failed"
+msgstr "E667: fsync ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: fileio.c:3892
+msgid "E512: Close failed"
+msgstr "E512: ÊĤ¸¤ë¤³¤È¤Ë¼ºÇÔ"
+
+#: fileio.c:3963
+msgid "E513: write error, conversion failed"
+msgstr "E513: ½ñ¹þ¤ß¥¨¥é¡¼, ÊÑ´¹¼ºÇÔ"
+
+#: fileio.c:3969
+msgid "E514: write error (file system full?)"
+msgstr "E514: ½ñ¹þ¤ß¥¨¥é¡¼, (¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ËþÇÕ?)"
+
+#: fileio.c:4036
+msgid " CONVERSION ERROR"
+msgstr " ÊÑ´¹¥¨¥é¡¼"
+
+#: fileio.c:4052
+msgid "[Device]"
+msgstr "[¥Ç¥Ð¥¤¥¹]"
+
+#: fileio.c:4057
+msgid "[New]"
+msgstr "[¿·]"
+
+#: fileio.c:4079
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4079
+msgid " appended"
+msgstr " ÄɲÃ"
+
+#: fileio.c:4081
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4081
+msgid " written"
+msgstr " ½ñ¹þ¤ß"
+
+#: fileio.c:4131
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: ¸¶ËÜ¥Õ¥¡¥¤¥ë¤òÊݸ¤Ç¤­¤Þ¤»¤ó"
+
+#: fileio.c:4153
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: ¶õ¤Î¸¶ËÜ¥Õ¥¡¥¤¥ë¤òtouch¤Ç¤­¤Þ¤»¤ó"
+
+#: fileio.c:4168
+msgid "E207: Can't delete backup file"
+msgstr "E207: ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤ò¾Ã¤»¤Þ¤»¤ó"
+
+#: fileio.c:4232
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"·Ù¹ð: ¸¶ËÜ¥Õ¥¡¥¤¥ë¤¬¼º¤ï¤ì¤¿¤«Êѹ¹¤µ¤ì¤Þ¤·¤¿\n"
+
+#: fileio.c:4234
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "¥Õ¥¡¥¤¥ë¤ÎÊݸ¤ËÀ®¸ù¤¹¤ë¤Þ¤Ç¥¨¥Ç¥£¥¿¤ò½ªÎ»¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤!"
+
+#: fileio.c:4323
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4323
+msgid "[dos format]"
+msgstr "[dos¥Õ¥©¡¼¥Þ¥Ã¥È]"
+
+#: fileio.c:4330
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4330
+msgid "[mac format]"
+msgstr "[mac¥Õ¥©¡¼¥Þ¥Ã¥È]"
+
+#: fileio.c:4337
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4337
+msgid "[unix format]"
+msgstr "[unix¥Õ¥©¡¼¥Þ¥Ã¥È]"
+
+#: fileio.c:4364
+msgid "1 line, "
+msgstr "1 ¹Ô, "
+
+#: fileio.c:4366
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ¹Ô, "
+
+#: fileio.c:4369
+msgid "1 character"
+msgstr "1 ʸ»ú"
+
+#: fileio.c:4371
+#, c-format
+msgid "%ld characters"
+msgstr "%ld ʸ»ú"
+
+#: fileio.c:4381
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4381
+msgid "[Incomplete last line]"
+msgstr "[ºÇ½ª¹Ô¤¬ÉÔ´°Á´]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4400
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "·Ù¹ð: Æɹþ¤ó¤À¸å¤Ë¥Õ¥¡¥¤¥ë¤ËÊѹ¹¤¬¤¢¤ê¤Þ¤·¤¿!!!"
+
+#: fileio.c:4402
+msgid "Do you really want to write to it"
+msgstr "ËÜÅö¤Ë¾å½ñ¤­¤·¤Þ¤¹¤«"
+
+#: fileio.c:5566
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: \"%s\" ¤ò½ñ¹þ¤ßÃæ¤Î¥¨¥é¡¼¤Ç¤¹"
+
+#: fileio.c:5573
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: \"%s\" ¤òÊĤ¸¤ë»þ¤Ë¥¨¥é¡¼¤Ç¤¹"
+
+#: fileio.c:5576
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: \"%s\" ¤òÆɹþÃæ¤Î¥¨¥é¡¼¤Ç¤¹"
+
+#: fileio.c:5810
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: autocommand ¤Î FileChangedShell ¤¬¥Ð¥Ã¥Õ¥¡¤òºï½ü¤·¤Þ¤·¤¿"
+
+#: fileio.c:5817
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: ·Ù¹ð: ¥Õ¥¡¥¤¥ë \"%s\" ¤Ï´û¤Ë¸ºß¤·¤Þ¤»¤ó"
+
+#: fileio.c:5831
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: ·Ù¹ð: ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Êѹ¹¤µ¤ìVim¤Î¥Ð¥Ã¥Õ¥¡¤âÊѹ¹¤µ¤ì¤Þ¤·¤¿"
+
+#: fileio.c:5834
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: ·Ù¹ð: ¥Õ¥¡¥¤¥ë \"%s\" ¤ÏÊÔ½¸³«»Ï¸å¤ËÊѹ¹¤µ¤ì¤Þ¤·¤¿"
+
+#: fileio.c:5836
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: ·Ù¹ð: ¥Õ¥¡¥¤¥ë \"%s\" ¤Î¥â¡¼¥É¤¬ÊÔ½¸³«»Ï¸å¤ËÊѹ¹¤µ¤ì¤Þ¤·¤¿"
+
+#: fileio.c:5846
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: ·Ù¹ð: ¥Õ¥¡¥¤¥ë \"%s\" ¤ÏÊÔ½¸³«»Ï¸å¤ËºîÀ®¤µ¤ì¤Þ¤·¤¿"
+
+#: fileio.c:5859
+msgid "See \":help W11\" for more info."
+msgstr "¾ÜºÙ¤Ï \":help W11\" ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: fileio.c:5873
+msgid "Warning"
+msgstr "·Ù¹ð"
+
+#: fileio.c:5874
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"¥Õ¥¡¥¤¥ëÆɹþ(&L)"
+
+#: fileio.c:5980
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: \"%s\" ¤ò¥ê¥í¡¼¥É¤¹¤ë½àÈ÷¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: fileio.c:5999
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: \"%s\" ¤Ï¥ê¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: fileio.c:6580
+msgid "--Deleted--"
+msgstr "--ºï½üºÑ--"
+
+#. the group doesn't exist
+#: fileio.c:6740
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: ¤½¤Î¥°¥ë¡¼¥×¤Ï¤¢¤ê¤Þ¤»¤ó: \"%s\""
+
+#: fileio.c:6866
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * ¤Î¸å¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤·¤¿: %s"
+
+#: fileio.c:6878
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ¤½¤Î¤è¤¦¤Ê¥¤¥Ù¥ó¥È¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: fileio.c:6880
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: ¤½¤Î¤è¤¦¤Ê¥°¥ë¡¼¥×¤â¤·¤¯¤Ï¥¤¥Ù¥ó¥È¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#. Highlight title
+#: fileio.c:7038
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:7309
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Á´¤Æ¤Î¥¤¥Ù¥ó¥È¤ËÂФ·¤Æ¤Îautocommand¤Ï¼Â¹Ô¤Ç¤­¤Þ¤»¤ó"
+
+#: fileio.c:7332
+msgid "No matching autocommands"
+msgstr "³ºÅö¤¹¤ëautocommand¤Ï¸ºß¤·¤Þ¤»¤ó"
+
+#: fileio.c:7653
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand¤ÎÆþ¤ì»Ò¤¬¿¼¤¹¤®¤Þ¤¹"
+
+#: fileio.c:7928
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands for \"%s\""
+
+#: fileio.c:7936
+#, c-format
+msgid "Executing %s"
+msgstr "%s ¤ò¼Â¹Ô¤·¤Æ¤¤¤Þ¤¹"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8004
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:8571
+msgid "E219: Missing {."
+msgstr "E219: { ¤¬¤¢¤ê¤Þ¤»¤ó."
+
+#: fileio.c:8573
+msgid "E220: Missing }."
+msgstr "E220: } ¤¬¤¢¤ê¤Þ¤»¤ó."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: ÀÞ¾ö¤ß¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: ¸½ºß¤Î 'foldmethod' ¤Ç¤ÏÀÞ¾ö¤ß¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: ¸½ºß¤Î 'foldmethod' ¤Ç¤ÏÀÞ¾ö¤ß¤òºï½ü¤Ç¤­¤Þ¤»¤ó"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Æɹþ¥Ð¥Ã¥Õ¥¡¤ØÄɲÃ"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: ºÆµ¢Åª¥Þ¥Ã¥Ô¥ó¥°"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s ¤È¤¤¤¦¥°¥í¡¼¥Ð¥ëû½ÌÆþÎϤϴû¤Ë¸ºß¤·¤Þ¤¹"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s ¤È¤¤¤¦¥°¥í¡¼¥Ð¥ë¥Þ¥Ã¥Ô¥ó¥°¤Ï´û¤Ë¸ºß¤·¤Þ¤¹"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ¤È¤¤¤¦Ã»½ÌÆþÎϤϴû¤Ë¸ºß¤·¤Þ¤¹"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s ¤È¤¤¤¦¥Þ¥Ã¥Ô¥ó¥°¤Ï´û¤Ë¸ºß¤·¤Þ¤¹"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "û½ÌÆþÎϤϤߤĤ«¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "¥Þ¥Ã¥Ô¥ó¥°¤Ï¤ß¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ÉÔÀµ¤Ê¥â¡¼¥É"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: GUI¤ò³«»Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: \"%s\"¤«¤éÆɹþ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: Í­¸ú¤Ê¥Õ¥©¥ó¥È¤¬¸«¤Ä¤«¤é¤Ê¤¤¤Î¤Ç, GUI¤ò³«»Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ¤¬Ìµ¸ú¤Ç¤¹"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: 'imactivatekey' ¤ËÀßÄꤵ¤ì¤¿Ãͤ¬Ìµ¸ú¤Ç¤¹"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: %s ¤Î¿§¤ò³ä¤êÅö¤Æ¤é¤ì¤Þ¤»¤ó"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<³«¤±¤Þ¤»¤ó>"
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ¥Õ¥©¥ó¥È %s ¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: ¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÌá¤ì¤Þ¤»¤ó"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "¥Ñ¥¹Ì¾:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: ¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "¥­¥ã¥ó¥»¥ë"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "¥¹¥¯¥í¡¼¥ë¥Ð¡¼: ²èÁü¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿."
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Vim ¥À¥¤¥¢¥í¥°"
+
+#: gui_beval.c:101 gui_w32.c:3830
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ¥á¥Ã¥»¡¼¥¸¤È¥³¡¼¥ë¥Ð¥Ã¥¯¤Î¤¢¤ë BalloonEval ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Vim ¥À¥¤¥¢¥í¥°..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"¤Ï¤¤(&Y)\n"
+"¤¤¤¤¤¨(&N)\n"
+"¥­¥ã¥ó¥»¥ë(&C)"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ¸¡º÷¤ÈÃÖ´¹..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - ¸¡º÷..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "¸¡º÷ʸ»úÎó:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "ÃÖ´¹Ê¸»úÎó:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Àµ³Î¤Ë³ºÅö¤¹¤ë¤â¤Î¤À¤±"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Âçʸ»ú/¾®Ê¸»ú¤ò¶èÊ̤¹¤ë"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Êý¸þ"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "¾å"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "²¼"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "¼¡¤ò¸¡º÷"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "ÃÖ´¹"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Á´¤ÆÃÖ´¹"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: ¥»¥Ã¥·¥ç¥ó¥Þ¥Í¡¼¥¸¥ã¤«¤é \"die\" Í×µá¤ò¼õ¤±¼è¤ê¤Þ¤·¤¿\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤¬ÉÔ°Õ¤ËÇ˲õ¤µ¤ì¤Þ¤·¤¿\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "¥Õ¥©¥ó¥ÈÁªÂò"
+
+#: gui_gtk_x11.c:6035 ui.c:2117
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "¶õ¤ÎÁªÂòÎΰè¤Î¤«¤ï¤ê¤ËCUT_BUFFER0¤¬»ÈÍѤµ¤ì¤Þ¤·¤¿"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "¥Õ¥£¥ë¥¿"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "¥Ø¥ë¥×"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "¥Õ¥¡¥¤¥ë"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "ÁªÂò"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "¥¢¥ó¥É¥¥"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Zap¥Õ¥©¥ó¥È '%s' ¤òÆɹþ¤á¤Þ¤»¤ó"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: ¥Õ¥©¥ó¥È %s ¤ò»ÈÍѤǤ­¤Þ¤»¤ó"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"»Ò¥×¥í¥»¥¹¤ØÄä»ß¥á¥Ã¥»¡¼¥¸¤òÁ÷¿®Ãæ¤Ç¤¹.\n"
+
+#: gui_w32.c:830
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: °ú¿ô¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó: \"-%s\"; OLEÈǤò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "¸¡º÷ʸ»úÎó ('\\' ¤ò¸¡º÷¤¹¤ë¤Ë¤Ï '\\\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "¸¡º÷¡¦ÃÖ´¹ ('\\' ¤ò¸¡º÷¤¹¤ë¤Ë¤Ï '\\\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: ¿§»ØÄ꤬Àµ¤·¤¯¤Ê¤¤¤Î¤Ç¥¨¥ó¥È¥ê¤ò³ä¤êÅö¤Æ¤é¤ì¤Þ¤»¤ó"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: °Ê²¼¤Îʸ»ú¥»¥Ã¥È¤Î¥Õ¥©¥ó¥È¤¬¤¢¤ê¤Þ¤»¤ó %s:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ¥Õ¥©¥ó¥È¥»¥Ã¥È̾: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "¥Õ¥©¥ó¥È '%s' ¤Ï¸ÇÄêÉý¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ¥Õ¥©¥ó¥È¥»¥Ã¥È̾: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "¥Õ¥©¥ó¥È0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "¥Õ¥©¥ó¥È1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "¥Õ¥©¥ó¥È%d ¤ÎÉý¤¬¥Õ¥©¥ó¥È0¤ÎÇܤǤϤ¢¤ê¤Þ¤»¤ó\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "¥Õ¥©¥ó¥È0¤ÎÉý: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"¥Õ¥©¥ó¥È1¤ÎÉý: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ¥Ï¥ó¥°¥ë¥ª¡¼¥È¥Þ¥È¥ó¥¨¥é¡¼"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "¿·¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÄɲÃ"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "¥Ñ¥¿¡¼¥ó¤Î¥¯¥¨¥ê¡¼¤òÄɲÃ"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Àܳ¤ò½ªÎ»¤¹¤ë"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Á´¤Æ¤ÎÀܳ¤òºÆ½é´ü²½¤¹¤ë"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Àܳ¤òɽ¼¨¤¹¤ë"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: »ÈÍÑÊýË¡: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "¤³¤Îcscope¥³¥Þ¥ó¥É¤Ïʬ³ä¥¦¥£¥ó¥É¥¦¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: »ÈÍÑË¡: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ¥¿¥°¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) ¥¨¥é¡¼: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: stat ¥¨¥é¡¼"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s ¤Ï¥Ç¥£¥ì¥¯¥È¥êµÚ¤ÓÍ­¸ú¤Êcscope¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "cscope¥Ç¡¼¥¿¥Ù¡¼¥¹ %s ¤òÄɲÃ"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: cscope¤ÎÀܳ %ld ¤òÆɹþ¤ßÃæ¤Î¥¨¥é¡¼¤Ç¤¹"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: ̤ÃΤÎcscope¸¡º÷·¿¤Ç¤¹"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: cscope¥Ñ¥¤¥×¤òºîÀ®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: cscope¤Îµ¯Æ°½àÈ÷(fork)¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection ¤Î¼Â¹Ô¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: cscope¥×¥í¥»¥¹¤òµ¯Æ°¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: to_fp ¤Î fdopen ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fr_fp ¤Î fdopen ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: cscopeÀܳ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscope¥¯¥¨¥ê¡¼ %s of %s ¤Ë³ºÅö¤¬¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: ̵¸ú¤Ê cscopequickfix ¥Õ¥é¥° %c ¤Î %c ¤Ç¤¹"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "cscope¥³¥Þ¥ó¥É:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (»ÈÍÑË¡: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: cscope¥Ç¡¼¥¿¥Ù¡¼¥¹: %s ¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: cscope¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¾ðÊó¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: ½ÅÊ£¤¹¤ëcscope¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÄɲ䵤ì¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: cscopeÀܳ¤ÎºÇÂç¿ô¤Ë㤷¤Þ¤·¤¿"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscopeÀܳ %s ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "cscopeÀܳ %s ¤¬ÊĤ¸¤é¤ì¤Þ¤·¤¿"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: cs_manage_matches ¤ÇÃ×̿Ū¤Ê¥¨¥é¡¼¤Ç¤¹"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Cscope ¥¿¥°: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # ¹ÔÈÖ¹æ"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "¥Õ¥¡¥¤¥ë̾ / ʸ̮ / ¹Ô\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: cscope¥¨¥é¡¼: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Á´¤Æ¤Îcscope¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥ê¥»¥Ã¥È¤·¤Þ¤¹"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "cscopeÀܳ¤¬¤¢¤ê¤Þ¤»¤ó\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid ¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾ prepend ¥Ñ¥¹\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: ¤³¤Î¥³¥Þ¥ó¥É¤Ï̵¸ú¤Ç¤¹,¤´¤á¤ó¤Ê¤µ¤¤: "
+"Python¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿."
+
+# Added at 07-Feb-2004.
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Python ¤òºÆµ¢Åª¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "OutputObject°À­¤ò¾Ã¤»¤Þ¤»¤ó"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace ¤Ï integer ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "̵¸ú¤Ê°À­¤Ç¤¹"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() ¤Ë¤Ïʸ»úÎó¤Î¥ê¥¹¥È¤¬É¬ÍפǤ¹"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: I/O¥ª¥Ö¥¸¥§¥¯¥È¤Î½é´ü²½Ãæ¤Ë¥¨¥é¡¼¤Ç¤¹"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "̵¸ú¤Ê¼°¤Ç¤¹"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "¼°¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Ë̵¸ú¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "¾Ã¤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡¤¬»²¾È¤µ¤ì¤Þ¤·¤¿"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "Èϰϳ°¤Î¹ÔÈÖ¹æ¤Ç¤¹"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<¥Ð¥Ã¥Õ¥¡¥ª¥Ö¥¸¥§¥¯¥È (¾ÃµîºÑ¤ß) %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "̵¸ú¤Ê¥Þ¡¼¥¯Ì¾¤Ç¤¹"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "¤½¤Î¤è¤¦¤Ê¥Ð¥Ã¥Õ¥¡¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "¾Ã¤µ¤ì¤¿¥¦¥£¥ó¥É¥¦¤¬»²¾È¤µ¤ì¤Þ¤·¤¿"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "ÆɹþÀìÍÑ°À­"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "¥«¡¼¥½¥ë¤¬¥Ð¥Ã¥Õ¥¡¤Î³°¤Ë¤¢¤ê¤Þ¤¹"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<¥¦¥£¥ó¥É¥¦¥ª¥Ö¥¸¥§¥¯¥È (¾ÃµîºÑ) %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<¥¦¥£¥ó¥É¥¦¥ª¥Ö¥¸¥§¥¯¥È (̤ÃÎ) %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<¥¦¥£¥ó¥É¥¦ %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "¤½¤Î¤è¤¦¤Ê¥¦¥£¥ó¥É¥¦¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "¥¢¥ó¥É¥¥¾ðÊó¤¬Êݸ¤Ç¤­¤Þ¤»¤ó"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "¹Ô¤ò¾Ã¤»¤Þ¤»¤ó"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "¹Ô¤òÃÖ´¹¤Ç¤­¤Þ¤»¤ó"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "¹Ô¤òÁÞÆþ¤Ç¤­¤Þ¤»¤ó"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "ʸ»úÎó¤Ë¤Ï²þ¹Ôʸ»ú¤ò´Þ¤á¤é¤ì¤Þ¤»¤ó"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: ¤³¤Î¥³¥Þ¥ó¥É¤Ï̵¸ú¤Ç¤¹,¤´¤á¤ó¤Ê¤µ¤¤: "
+"Ruby¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: ̤ÃΤÎlongjmp¾õÂÖ: %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "¼ÂÁõ¤ÈÄêµÁ¤òÀÚ¤êÂؤ¨¤ë"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "¼¡¤Î¥¯¥é¥¹¤Î´ðÄì¤òɽ¼¨"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "¥ª¡¼¥Ð¡¼¥é¥¤¥É¤µ¤ì¤¿¥á¥ó¥Ð´Ø¿ô¤òɽ¼¨"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "¥Õ¥¡¥¤¥ë¤«¤é²óÉü¤¹¤ë"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "¥×¥í¥¸¥§¥¯¥È¤«¤é²óÉü¤¹¤ë"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Á´¤Æ¤Î¥×¥í¥¸¥§¥¯¥È¤«¤é²óÉü¤¹¤ë"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "²óÉü"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "¼¡¤Î¥½¡¼¥¹¤òɽ¼¨¤¹¤ë"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "¤ß¤Ä¤±¤¿¥·¥ó¥Ü¥ë"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "¥¯¥é¥¹¤ò»²¾È"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "³¬Áؤǥ¯¥é¥¹¤òɽ¼¨"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "¸ÂÄꤵ¤ì¤¿³¬Áؤǥ¯¥é¥¹¤òɽ¼¨"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ¤Î»²¾ÈÀè"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ¤¬»²¾È¤µ¤ì¤ë"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ¤¬¼¡¤Î¤â¤Î¤ò¤â¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ¤¬»ÈÍѤµ¤ì¤ë"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "¼¡¤Îʸ¾Ï¤òɽ¼¨"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "¼¡¤Îʸ¾Ï¤òÀ¸À®"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"SNiFF+¤ËÀܳ¤Ç¤­¤Þ¤»¤ó. ´Ä¶­¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤(sniffemacs ¤¬ $PATH "
+"¤Ë¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: ÆɹþÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿. ÀÚÃǤ·¤Þ¤·¤¿"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "¸½ºßSNiFF+ ¤Î¾õÂ֤ϡÖ"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "̤"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "Àܳ¡×¤Ç¤¹"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ̤ÃΤΠSNiFF+ ¥ê¥¯¥¨¥¹¥È¤Ç¤¹: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: SNiFF+ ¤Ø¤ÎÀܳÃæ¤Î¥¨¥é¡¼¤Ç¤¹"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ¤ËÀܳ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: SNiFF+ ¥Ð¥Ã¥Õ¥¡¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: ½ñ¹þ¤ßÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤Î¤ÇÀÚÃǤ·¤Þ¤·¤¿"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "̵¸ú¤Ê¥Ð¥Ã¥Õ¥¡ÈÖ¹æ¤Ç¤¹"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "̤ÃΤΥª¥×¥·¥ç¥ó¤Ç¤¹"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "¹Ô¤òÀßÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "¥Þ¡¼¥¯¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "¹Ô %d Îó %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "¹Ô¤ÎÁÞÆþ/Äɲäò¤Ç¤­¤Þ¤»¤ó"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "̤ÃΤΥե饰:"
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "̤ÃΤΠvimOption ¤Ç¤¹"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "¥­¡¼¥Ü¡¼¥É³ä¹þ¤ß"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim ¥¨¥é¡¼"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr ""
+"¥Ð¥Ã¥Õ¥¡/¥¦¥£¥ó¥É¥¦ºîÀ®¥³¥Þ¥ó¥É¤òºîÀ®¤Ç¤­¤Þ¤»¤ó: "
+"¥ª¥Ö¥¸¥§¥¯¥È¤¬¾Ãµî¤µ¤ì¤Æ¤¤¤Þ¤·¤¿"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"¥³¡¼¥ë¥Ð¥Ã¥¯¥³¥Þ¥ó¥É¤òÅÐÏ¿¤Ç¤­¤Þ¤»¤ó: ¥Ð¥Ã¥Õ¥¡/¥¦¥£¥ó¥É¥¦¤¬´û¤Ë¾Ãµî¤µ¤ì¤Þ¤·¤¿"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to "
+"vim-dev@vim.org"
+msgstr ""
+"E280: TCL Ã×̿Ū¥¨¥é¡¼: reflist ±øÀ÷!? vim-dev@vim.org ¤ËÊó¹ð¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"¥³¡¼¥ë¥Ð¥Ã¥¯¥³¥Þ¥ó¥É¤òÅÐÏ¿¤Ç¤­¤Þ¤»¤ó: "
+"¥Ð¥Ã¥Õ¥¡/¥¦¥£¥ó¥É¥¦¤Î»²¾È¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: ¤³¤Î¥³¥Þ¥ó¥É¤Ï̵¸ú¤Ç¤¹,¤´¤á¤ó¤Ê¤µ¤¤: "
+"Tcl¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL ¥¨¥é¡¼: ½ªÎ»¥³¡¼¥É¤¬À°¿ôÃͤǤϤ¢¤ê¤Þ¤»¤ó!? vim-dev@vim.org "
+"¤ËÊó¹ð¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "¹Ô¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Ì¿Î᥵¡¼¥Ð¤Î̾Á°¤òÅÐÏ¿¤Ç¤­¤Þ¤»¤ó"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ÌÜŪ¤Î¥×¥í¥°¥é¥à¤Ø¤Î¥³¥Þ¥ó¥ÉÁ÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: ̵¸ú¤Ê¥µ¡¼¥ÐID¤¬»È¤ï¤ì¤Þ¤·¤¿: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM ¼ÂÂΤÎÅÐÏ¿¥×¥í¥Ñ¥Æ¥£¤¬ÉÔÀµ¤Ç¤¹. ¾Ãµî¤·¤Þ¤·¤¿!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "̤ÃΤΥª¥×¥·¥ç¥ó¤Ç¤¹"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "ÊÔ½¸°ú¿ô¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "°ú¿ô¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "¥ª¥×¥·¥ç¥ó¤Î¸å¤Ë¥´¥ß¤¬¤¢¤ê¤Þ¤¹"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "\"+command\", \"-c command\", \"--cmd command\" ¤Î°ú¿ô¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "̵¸ú¤Ê°ú¿ô¤Ç¤¹: "
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "¤³¤ÎVim¤Ë¤Ïdiffµ¡Ç½¤¬¤¢¤ê¤Þ¤»¤ó(¥³¥ó¥Ñ¥¤¥ë»þÀßÄê)."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ë¤òºÆ¤Ó³«¤¤¤Æ¤ß¤Þ¤¹: \""
+
+# msgid "\"\n"
+# msgstr "\"\n"
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "ÆɹþÍѤȤ·¤Æ³«¤±¤Þ¤»¤ó"
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "¥¹¥¯¥ê¥×¥È½ÐÎÏÍѤò³«¤±¤Þ¤»¤ó"
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d ¸Ä¤Î¥Õ¥¡¥¤¥ë¤¬ÊÔ½¸¤ò¹µ¤¨¤Æ¤¤¤Þ¤¹\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: ·Ù¹ð: üËö¤Ø¤Î½ÐÎϤǤϤ¢¤ê¤Þ¤»¤ó\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: ·Ù¹ð: üËö¤«¤é¤ÎÆþÎϤǤϤ¢¤ê¤Þ¤»¤ó\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "vimrcÁ°¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: \"%s\"¤«¤éÆɹþ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤Ï: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[¥Õ¥¡¥¤¥ë..] ¤¢¤ë¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤¹¤ë"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- ɸ½àÆþÎϤ«¤é¥Æ¥­¥¹¥È¤òÆɹþ¤à"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t ¥¿¥° ¥¿¥°¤¬ÄêµÁ¤µ¤ì¤¿¤È¤³¤í¤«¤éÊÔ½¸¤¹¤ë"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] ºÇ½é¤Î¥¨¥é¡¼¤ÇÊÔ½¸¤¹¤ë"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"»ÈÍÑË¡:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [°ú¿ô]"
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ¤â¤·¤¯¤Ï:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"°ú¿ô:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\t¤³¤Î¤¢¤È¤Ë¤Ï¥Õ¥¡¥¤¥ë̾¤À¤±"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\t¥ï¥¤¥ë¥É¥«¡¼¥É¤òŸ³«¤·¤Ê¤¤"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t¤³¤Îgvim¤òOLE¤È¤·¤ÆÅÐÏ¿¤¹¤ë"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tgvim¤ÎOLEÅÐÏ¿¤ò²ò½ü¤¹¤ë"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tGUI¤Çµ¯Æ°¤¹¤ë (\"gvim\" ¤ÈƱ¤¸)"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f or --nofork\t¥Õ¥©¥¢¥°¥é¥¦¥ó¥É: GUI¤ò»Ï¤á¤ë¤È¤­¤Ëfork¤·¤Ê¤¤"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi¥â¡¼¥É (\"vi\" ¤ÈƱ¤¸)"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx¥â¡¼¥É (\"ex\" ¤ÈƱ¤¸)"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\t¥µ¥¤¥ì¥ó¥È(¥Ð¥Ã¥Á)¥â¡¼¥É (\"ex\" ÀìÍÑ)"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tº¹Ê¬¥â¡¼¥É (\"vidiff\" ¤ÈƱ¤¸)"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\t¥¤¡¼¥¸¡¼¥â¡¼¥É (\"evim\" ¤ÈƱ¤¸, ¥â¡¼¥É̵)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tÆɹþÀìÍѥ⡼¥É (\"view\" ¤ÈƱ¤¸)"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tÀ©¸Â¥â¡¼¥É (\"rvim\" ¤ÈƱ¤¸)"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tÊѹ¹ (¥Õ¥¡¥¤¥ëÊݸ»þ) ¤ò¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤¹¤ë"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\t¥Æ¥­¥¹¥È¤ÎÊÔ½¸¤ò¹Ô¤Ê¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤ë"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t¥Ð¥¤¥Ê¥ê¥â¡¼¥É"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp¥â¡¼¥É"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tVi¸ß´¹¥â¡¼¥É: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tViÈó¸ß´¹¥â¡¼¥É: 'nocompatible"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose ¥ì¥Ù¥ë"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\t¥Ç¥Ð¥Ã¥°¥â¡¼¥É"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\t¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ»¤º¥á¥â¥ê¤À¤±"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤òÎóµó¤·½ªÎ»"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (¥Õ¥¡¥¤¥ë̾)\t¥¯¥é¥Ã¥·¥å¤·¤¿¥»¥Ã¥·¥ç¥ó¤òÉüµ¢"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\t-r¤ÈƱ¤¸"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\t¥¦¥£¥ó¥É¥¦¤ò³«¤¯¤Î¤Ë newcli ¤ò»ÈÍѤ·¤Ê¤¤"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tI/O¤Ë <device> ¤ò»ÈÍѤ¹¤ë"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\t¥¢¥é¥Ó¥¢¸ì¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\t¥Ø¥Ö¥é¥¤¸ì¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\t¥Ú¥ë¥·¥¢¸ì¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tüËö¤ò <terminal> ¤ËÀßÄꤹ¤ë"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t.vimrc¤ÎÂå¤ï¤ê¤Ë <vimrc> ¤ò»È¤¦"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t.gvimrc¤ÎÂå¤ï¤ê¤Ë <gvimrc> ¤ò»È¤¦"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\t¥×¥é¥°¥¤¥ó¥¹¥¯¥ê¥×¥È¤ò¥í¡¼¥É¤·¤Ê¤¤"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tN ¸Ä¥¦¥£¥ó¥É¥¦¤ò³«¤¯(¾ÊάÃÍ: ¥Õ¥¡¥¤¥ë¤Ë¤Ä¤­1¸Ä)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\t-o¤ÈƱ¤¸¤À¤¬¿âľʬ³ä"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\t¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤«¤é¤Ï¤¸¤á¤ë"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\t<lnum> ¹Ô¤«¤é¤Ï¤¸¤á¤ë"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\tvimrc¤ò¥í¡¼¥É¤¹¤ëÁ°¤Ë <command> ¤ò¼Â¹Ô¤¹¤ë"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\tºÇ½é¤Î¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¸å <command> ¤ò¼Â¹Ô¤¹¤ë"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\tºÇ½é¤Î¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¸å¥Õ¥¡¥¤¥ë <session> ¤ò¼è¹þ¤à"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t¥Õ¥¡¥¤¥ë <scriptin> ¤«¤é¥Î¡¼¥Þ¥ë¥³¥Þ¥ó¥É¤òÆɹþ¤à"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tÆþÎϤ·¤¿Á´¥³¥Þ¥ó¥É¤ò¥Õ¥¡¥¤¥ë <scriptout> ¤ËÄɲ乤ë"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tÆþÎϤ·¤¿Á´¥³¥Þ¥ó¥É¤ò¥Õ¥¡¥¤¥ë <scriptout> ¤ËÊݸ¤¹¤ë"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t°Å¹æ²½¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤¹¤ë"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tvim¤ò»ØÄꤷ¤¿ X ¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tX¥µ¡¼¥Ð¤ËÀܳ¤·¤Ê¤¤"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <files>\t²Äǽ¤Ê¤é¤ÐVim¥µ¡¼¥Ð¤Ç <files> ¤òÊÔ½¸¤¹¤ë"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silnet <files> Ʊ¾å, ¥µ¡¼¥Ð¤¬Ìµ¤¯¤Æ¤â·Ù¹ðʸ¤ò½ÐÎϤ·¤Ê¤¤"
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files>\t--remote¸å ¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¤¬½ª¤ï¤ë¤Î¤òÂÔ¤Ä"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <files> Ʊ¾å, ¥µ¡¼¥Ð¤¬Ìµ¤¯¤Æ¤â·Ù¹ðʸ¤ò½ÐÎϤ·¤Ê¤¤"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tVim¥µ¡¼¥Ð¤Ë <keys> ¤òÁ÷¿®¤·¤Æ½ªÎ»¤¹¤ë"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\t¥µ¡¼¥Ð¤Ç <expr> ¤ò¼Â¹Ô¤·¤Æ·ë²Ì¤òɽ¼¨¤¹¤ë"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVim¥µ¡¼¥Ð̾¤Î°ìÍ÷¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servename <name>\t\tVim¥µ¡¼¥Ð <name> ¤ËÁ÷¿®/̾Á°ÀßÄꤹ¤ë"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t.viminfo¤ÎÂå¤ï¤ê¤Ë <viminfo> ¤ò»È¤¦"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h or --help\t¥Ø¥ë¥×(¤³¤Î¥á¥Ã¥»¡¼¥¸)¤òɽ¼¨¤·½ªÎ»¤¹¤ë"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\t¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·½ªÎ»¤¹¤ë"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ë°ú¿ô(Motif¥Ð¡¼¥¸¥ç¥ó):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"gvim¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ë°ú¿ô(neXtaw¥Ð¡¼¥¸¥ç¥ó):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ë°ú¿ô(Athena¥Ð¡¼¥¸¥ç¥ó):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\t<display> ¤Çvim¤ò¼Â¹Ô¤¹¤ë"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tºÇ¾®²½¤·¤¿¾õÂÖ¤Çvim¤òµ¯Æ°¤¹¤ë"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tvim¤Î̾¤¬ <name> ¤Ç¤¢¤ë¤È¤·¤Æ¥ê¥½¡¼¥¹¤ò»È¤¦"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\tÇØ·Ê¿§¤Ë <color> ¤ò»È¤¦(ƱµÁ: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tÁ°·Ê¿§¤Ë <color> ¤ò»È¤¦(ƱµÁ: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\t¥Æ¥­¥¹¥Èɽ¼¨¤Ë <font> ¤ò»È¤¦(ƱµÁ: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tÂÀ»ú¤Ë <font> ¤ò»È¤¦"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <for>\t¼ÐÂλú¤Ë <font> ¤ò»È¤¦"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\t½é´üÇÛÃÖ¤Ë <geom> ¤ò»È¤¦(ƱµÁ: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t¶­³¦¤ÎÉý¤ò <width> ¤Ë¤¹¤ë(ƱµÁ: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <width> ¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤ÎÉý¤ò <width> ¤Ë¤¹¤ë(ƱµÁ: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\t¥á¥Ë¥å¡¼¥Ð¡¼¤Î¹â¤µ¤ò <height> ¤Ë¤¹¤ë(ƱµÁ: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tȿž±ÇÁü¤ò»ÈÍѤ¹¤ë(ƱµÁ: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tȿž±ÇÁü¤ò»ÈÍѤ·¤Ê¤¤(ƱµÁ: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tÆÃÄê¤Î¥ê¥½¡¼¥¹¤ò»ÈÍѤ¹¤ë"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ë°ú¿ô(RISC OS¥Ð¡¼¥¸¥ç¥ó):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t½é´ü¤Î¥¦¥£¥ó¥É¥¦¤Î¥³¥é¥àñ°Ì¤ÎÉý"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t½é´ü¤Î¥¦¥£¥ó¥É¥¦¤Î¹Ôñ°Ì¤Î¹â¤µ"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤ë°ú¿ô(GTK+¥Ð¡¼¥¸¥ç¥ó):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\t<display> ¤Çvim¤ò¼Â¹Ô¤¹¤ë(ƱµÁ: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\t¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤ò¼±Ê̤¹¤ë°ì°Õ¤ÊÌò³ä(role)¤òÀßÄꤹ¤ë"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\t°Û¤Ê¤ëGTK widget¤ÇVim¤ò³«¤¯"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <¿Æ¤Î¥¿¥¤¥È¥ë>\tVim¤ò¿Æ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÎÃæ¤Çµ¯Æ°¤¹¤ë"
+
+# msgid "--help\t\tShow Gnome arguments"
+# msgstr "--help\t\tGNOME¤Î°ú¿ô¤ò¸«¤»¤ë"
+#: main.c:2847
+msgid "No display"
+msgstr "¥Ç¥£¥¹¥×¥ì¥¤¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": Á÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Á÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿. ¥í¡¼¥«¥ë¤Ç¤Î¼Â¹Ô¤ò»î¤ß¤Æ¤¤¤Þ¤¹\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d ¸Ä (%d ¸ÄÃæ) ¤Î¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Þ¤·¤¿"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "¥Ç¥£¥¹¥×¥ì¥¤¤¬¤¢¤ê¤Þ¤»¤ó: ¼°¤ÎÁ÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": ¼°¤ÎÁ÷¿®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "¥Þ¡¼¥¯¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: \"%s\" ¤Ë³ºÅö¤¹¤ë¥Þ¡¼¥¯¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"mark ¹Ô Îó ¥Õ¥¡¥¤¥ë/¥Æ¥­¥¹¥È"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" jump ¹Ô Îó ¥Õ¥¡¥¤¥ë/¥Æ¥­¥¹¥È"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"Êѹ¹ ¹Ô Îó ¥Æ¥­¥¹¥È"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# ¥Õ¥¡¥¤¥ë¥Þ¡¼¥¯:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# ¥¸¥ã¥ó¥×¥ê¥¹¥È (¿·¤·¤¤¤â¤Î¤¬Àè):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ¥Õ¥¡¥¤¥ëÆâ¥Þ¡¼¥¯¤ÎÍúÎò (¿·¤·¤¤¤â¤Î¤«¤é¸Å¤¤¤â¤Î):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "'>' ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: ̵¸ú¤Ê¥³¡¼¥É¥Ú¡¼¥¸¤Ç¤¹"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: IC¤ÎÃͤòÀßÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: ¥¤¥ó¥×¥Ã¥È¥³¥ó¥Æ¥­¥¹¥È¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: ¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É¤Î¥ª¡¼¥×¥ó¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: ·Ù¹ð: IM¤ÎÇ˲õ¥³¡¼¥ë¥Ð¥Ã¥¯¤òÀßÄê¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É¤Ï¤É¤ó¤Ê¥¹¥¿¥¤¥ë¤â¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É¤Ï my preedit type ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot ¥¹¥¿¥¤¥ë¤Ë¤Ïfontset¤¬É¬ÍפǤ¹"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: GTK+¤¬1.2.3¤è¤ê¤â¸Å¤¤¤Î¤Ç¥¹¥Æ¡¼¥¿¥¹¥¨¥ê¥¢¤¬Ìµ¸ú¤Ç¤¹"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É¥µ¡¼¥Ð ¤¬Æ°ºî¤·¤Æ¤¤¤Þ¤»¤ó"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: ¥Ö¥í¥Ã¥¯¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ëÆɹþ»þ¤Ë¥·¡¼¥¯¥¨¥é¡¼¤Ç¤¹"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÆɹþ¤ß¥¨¥é¡¼¤Ç¤¹"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë½ñ¹þ¤ß»þ¤Ë¥·¡¼¥¯¥¨¥é¡¼¤Ç¤¹"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î½ñ¹þ¤ß¥¨¥é¡¼¤Ç¤¹"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Þ¤¹ (symlink¤Ë¤è¤ë¹¶·â?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ¥Ö¥í¥Ã¥¯ 0 ¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ¥Ö¥í¥Ã¥¯ 1 ¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ¥Ö¥í¥Ã¥¯ 2 ¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: ¤ª¤Ã¤È, ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¼º¤ï¤ì¤Þ¤·¤¿!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÊѤ¨¤é¤ì¤Þ¤»¤ó"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: \"%s\" ¤Î¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ò³«¤±¤Ê¤¤¤Î¤Ç¥ê¥«¥Ð¥ê¤ÏÉÔ²Äǽ¤Ç¤¹"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: ¥Ö¥í¥Ã¥¯ 0 ¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: %s ¤Ë¤Ï¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "»ÈÍѤ¹¤ë¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÈÖ¹æ¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤(0 ¤Ç½ªÎ»): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: %s ¤ò³«¤±¤Þ¤»¤ó"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "¥Ö¥í¥Ã¥¯ 0 ¤òÆɹþ¤á¤Þ¤»¤ó "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"¶²¤é¤¯Êѹ¹¤¬¤µ¤ì¤Æ¤¤¤Ê¤¤¤«Vim¤¬¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ò¹¹¿·¤·¤Æ¤¤¤Þ¤»¤ó."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " Vim¤Î¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Vim¤Î¥Ð¡¼¥¸¥ç¥ó3.0¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ¤ÏVim¤Î¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¤è¤¦¤Ç¤¹"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ¤³¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¼¡¤Î¾ì½ê¤Çºî¤é¤ì¤Þ¤·¤¿ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"¤â¤·¤¯¤Ï¥Õ¥¡¥¤¥ë¤¬Â»½ý¤·¤Æ¤¤¤Þ¤¹."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë \"%s\" ¤ò»ÈÍÑÃæ"
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "¸¶ËÜ¥Õ¥¡¥¤¥ë \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: ·Ù¹ð: ¸¶ËÜ¥Õ¥¡¥¤¥ë¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: %s ¤«¤é¥Ö¥í¥Ã¥¯ 1 ¤òÆɹþ¤á¤Þ¤»¤ó"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???¿¤¯¤Î¹Ô¤¬¼º¤ï¤ì¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???¹Ô¿ô¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???¥Ö¥í¥Ã¥¯¤¬¶õ¤Ç¤¹"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???¹Ô¤¬¼º¤ï¤ì¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ¥Ö¥í¥Ã¥¯ 1 ¤ÎID¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹(%s ¤¬.swp¥Õ¥¡¥¤¥ë¤Ç¤Ê¤¤?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???¥Ö¥í¥Ã¥¯¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ¤³¤³¤«¤é???END¤Þ¤Ç¤Î¹Ô¤¬Ç˲õ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ç¤¹"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ¤³¤³¤«¤é??END¤Þ¤Ç¤Î¹Ô¤¬ÁÞÆþ¤«ºï½ü¤µ¤ì¤¿¤è¤¦¤Ç¤¹"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: ¥ê¥«¥Ð¥ê¤¬³ä¹þ¤Þ¤ì¤Þ¤·¤¿"
+
+#: memline.c:1148
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: ¥ê¥«¥Ð¥ê¤ÎºÇÃæ¤Ë¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤Þ¤·¤¿; ???¤Ç»Ï¤Þ¤ë¹Ô¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "¾ÜºÙ¤Ï \":help E312\" ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "¥ê¥«¥Ð¥ê¤¬½ªÎ»¤·¤Þ¤·¤¿. Á´¤Æ¤¬Àµ¤·¤¤¤«¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Êѹ¹¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Ë, ¤³¤Î¥Õ¥¡¥¤¥ë¤òÊ̤Î̾Á°¤ÇÊݸ¤·¤¿¾å¤Ç\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "¸¶ËÜ¥Õ¥¡¥¤¥ë¤È¤Î diff ¤ò¼Â¹Ô¤¹¤ë¤ÈÎɤ¤¤Ç¤·¤ç¤¦)\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"¤½¤ì¤«¤é.swp¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬Ê£¿ô¸«¤Ä¤«¤ê¤Þ¤·¤¿:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " ¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " ¤¢¤ë̾Á°¤ò»ÈÍÑÃæ:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " ¥Ç¥£¥ì¥¯¥È¥ê "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ¤Ê¤· --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " ½êÍ­¼Ô: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " ÆüÉÕ: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " ÆüÉÕ: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [from Vim version 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [Vim¤Î¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¤¤è¤¦¤Ç¤¹]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " ¥Õ¥¡¥¤¥ë̾: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" Êѹ¹¾õÂÖ: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "¤¢¤ê"
+
+#: memline.c:1525
+msgid "no"
+msgstr "¤Ê¤·"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ¥æ¡¼¥¶Ì¾: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " ¥Û¥¹¥È̾: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" ¥Û¥¹¥È̾: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ¥×¥í¥»¥¹ID: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (¤Þ¤À¼Â¹ÔÃæ)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [¤³¤ÎVim¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [¤³¤Î¥³¥ó¥Ô¥å¡¼¥¿¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [Æɹþ¤á¤Þ¤»¤ó]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [³«¤±¤Þ¤»¤ó]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬Ìµ¤¤¤Î¤Ç°Ý»ý¤Ç¤­¤Þ¤»¤ó"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "¥Õ¥¡¥¤¥ë¤¬°Ý»ý¤µ¤ì¤Þ¤¹"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: °Ý»ý¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ̵¸ú¤Êlnum¤Ç¤¹: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ¹Ô %ld ¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: ¥Ý¥¤¥ó¥¿¥Ö¥í¥Ã¥¯¤ÎID¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "stack_idx ¤Ï 0 ¤Ç¤¢¤ë¤Ù¤­¤Ç¤¹"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ¹¹¿·¤µ¤ì¤¿¥Ö¥í¥Ã¥¯¤¬Â¿¤¹¤®¤ë¤«¤â?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: ¥Ý¥¤¥ó¥¿¥Ö¥í¥Ã¥¯¤ÎID¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "¥Ö¥í¥Ã¥¯ 1 ¤Ï¾Ã¤µ¤ì¤¿?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: ¹Ô %ld ¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: ¥Ý¥¤¥ó¥¿¥Ö¥í¥Ã¥¯¤ÎID¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ¤¬¥¼¥í¤Ç¤¹"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: ¹ÔÈֹ椬Èϰϳ°¤Ç¤¹: %ld Ķ¤¨¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ¥Ö¥í¥Ã¥¯ %ld ¤Î¹Ô¥«¥¦¥ó¥È¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤¬Áý¤¨¤Þ¤¹"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: ¥Ý¥¤¥ó¥¿¥Ö¥í¥Ã¥¯¤ÎID¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: Ãí°Õ"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"¼¡¤Î̾Á°¤Ç¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤Þ¤·¤¿ \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "¼¡¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¤¤Æ¤¤¤ëºÇÃæ \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤è¤ê¤â¿·¤·¤¤¤Ç¤¹!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ÊÌ¤Î¥×¥í¥°¥é¥à¤¬Æ±¤¸¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó.\n"
+" ¤³¤Î¾ì¹ç¤Ë¤Ï, Êѹ¹¤ò¤·¤¿ºÝ¤ËºÇ½ªÅª¤Ë, Ʊ¤¸¥Õ¥¡¥¤¥ë¤Î°Û¤Ê¤ë\n"
+" 2¤Ä¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤¬¤Ç¤­¤Æ¤·¤Þ¤¦¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " ½ªÎ»¤¹¤ë¤«, Ãí°Õ¤·¤Ê¤¬¤é³¤±¤Þ¤¹.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸¥»¥Ã¥·¥ç¥ó¤¬¥¯¥é¥Ã¥·¥å¤·¤¿.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ¤³¤Î¾ì¹ç¤Ë¤Ï \":recover\" ¤« \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" ¤ò»ÈÍѤ·¤ÆÊѹ¹¤ò¥ê¥«¥Ð¡¼¤·¤Þ¤¹(\":help recover\" ¤ò»²¾È).\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " ´û¤Ë¤³¤ì¤ò¹Ô¤Ê¤Ã¤¿¤Î¤Ê¤é¤Ð, ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ¤ò¾Ã¤»¤Ð¤³¤Î¥á¥Ã¥»¡¼¥¸¤ò²óÈò¤Ç¤­¤Þ¤¹.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" ¤¬´û¤Ë¤¢¤ê¤Þ¤¹!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - Ãí°Õ"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬´û¤Ë¸ºß¤·¤Þ¤¹!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"ÆɹþÀìÍѤdz«¤¯(&O)\n"
+"¤È¤Ë¤«¤¯ÊÔ½¸¤¹¤ë(&E)\n"
+"Éü³è¤µ¤»¤ë(&R)ecover\n"
+"½ªÎ»¤¹¤ë(&Q)\n"
+"Ãæ»ß¤¹¤ë(&A)"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"ÆɹþÀìÍѤdz«¤¯(&O)\n"
+"¤È¤Ë¤«¤¯ÊÔ½¸¤¹¤ë(&E)\n"
+"Éü³è¤µ¤»¤ë(&R)ecover\n"
+"½ªÎ»¤¹¤ë(&Q)\n"
+"Ãæ»ß¤¹¤ë(&A)\n"
+"¾Ãµî¤¹¤ë(&D)"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤¬Â¿¿ô¸«¤Ä¤«¤ê¤Þ¤·¤¿"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ¥á¥Ë¥å¡¼¥¢¥¤¥Æ¥à¤Î¥Ñ¥¹¤ÎÉôʬ¤¬¥µ¥Ö¥á¥Ë¥å¡¼¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: ¥á¥Ë¥å¡¼¤Ï¾¤Î¥â¡¼¥É¤Ë¤À¤±¤¢¤ê¤Þ¤¹"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ¤½¤Î̾Á°¤Î¥á¥Ë¥å¡¼¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ¥á¥Ë¥å¡¼¥Ñ¥¹¤Ï¥µ¥Ö¥á¥Ë¥å¡¼¤òÀ¸¤¸¤ë¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ¥á¥Ë¥å¡¼¥Ð¡¼¤Ë¤ÏľÀÜ¥á¥Ë¥å¡¼¥¢¥¤¥Æ¥à¤òÄɲäǤ­¤Þ¤»¤ó"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ¶èÀÚ¤ê¤Ï¥á¥Ë¥å¡¼¥Ñ¥¹¤Î°ìÉô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- ¥á¥Ë¥å¡¼ ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "¤³¤Î¥á¥Ë¥å¡¼¤òÀÚ¤ê¼è¤ë"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ¥á¥Ë¥å¡¼¥Ñ¥¹¤Ï¥á¥Ë¥å¡¼¥¢¥¤¥Æ¥à¤òÀ¸¤¸¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: ¥á¥Ë¥å¡¼¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s ¤Ë¤Ï¥á¥Ë¥å¡¼¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ¥á¥Ë¥å¡¼¥Ñ¥¹¤Ï¥µ¥Ö¥á¥Ë¥å¡¼¤òÀ¸¤¸¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: ¥á¥Ë¥å¡¼¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó - ¥á¥Ë¥å¡¼Ì¾¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "%s ¤Î½èÍýÃæ¤Ë¥¨¥é¡¼¤¬¸¡½Ð¤µ¤ì¤Þ¤·¤¿:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "¹Ô %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[ʸ»úÎó¤¬Ä¹¤¹¤®¤Þ¤¹]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "ÆüËܸì¥á¥Ã¥»¡¼¥¸ËÝÌõ/´Æ½¤: ¼²¬ ÂÀϺ <koron@tka.att.ne.jp>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "³ä¹þ¤ß: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "³¤±¤ë¤Ë¤ÏENTER¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "³¤±¤ë¤Ë¤ÏENTER¤ò²¡¤¹¤«¥³¥Þ¥ó¥É¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- ·Ñ³ --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ¹ÔÁ÷¤ê, SPACE/b: ¥Ú¡¼¥¸Á÷¤ê, d/u: Ⱦ¥Ú¡¼¥¸Á÷¤ê, q: ½ªÎ»)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ¹ÔÁ÷¤ê, SPACE: ¥Ú¡¼¥¸Á÷¤ê, d: Ⱦ¥Ú¡¼¥¸Á÷¤ê, q: ½ªÎ»)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "¼ÁÌä"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"¤Ï¤¤(&Y)\n"
+"¤¤¤¤¤¨(&N)"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"¤Ï¤¤(&Y)\n"
+"¤¤¤¤¤¨(&N)\n"
+"Á´¤ÆÊݸ(&A)\n"
+"Á´¤ÆÊü´þ(&D)\n"
+"¥­¥ã¥ó¥»¥ë(&C)"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "¥Õ¥¡¥¤¥ëÊݸ¥À¥¤¥¢¥í¥°"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "¥Õ¥¡¥¤¥ëÆɹþ¥À¥¤¥¢¥í¥°"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ¥³¥ó¥½¡¼¥ë¥â¡¼¥É¤Ç¤Ï¥Õ¥¡¥¤¥ë¥Ö¥é¥¦¥¶¤ò»È¤¨¤Þ¤»¤ó, ¤´¤á¤ó¤Ê¤µ¤¤"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: ·Ù¹ð: ÆɹþÀìÍÑ¥Õ¥¡¥¤¥ë¤òÊѹ¹¤·¤Þ¤¹"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "1 ¹Ô Äɲä·¤Þ¤·¤¿"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "1 ¹Ô ºï½ü¤·¤Þ¤·¤¿"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld ¹Ô Äɲä·¤Þ¤·¤¿"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld ¹Ô ºï½ü¤·¤Þ¤·¤¿"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (³ä¹þ¤Þ¤ì¤Þ¤·¤¿)"
+
+#: misc1.c:7582
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ¥Õ¥¡¥¤¥ë¤òÊݸÃæ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7592
+msgid "Vim: Finished.\n"
+msgstr "Vim: ½ªÎ»¤·¤Þ¤·¤¿.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "¥¨¥é¡¼: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[¥á¥â¥ê(¥Ð¥¤¥È)] Áí³äÅö-²òÊüÎÌ %lu-%lu, »ÈÍÑÎÌ %lu, ¥Ô¡¼¥¯»þ %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[¸Æ½Ð] Áí re/malloc() ²ó¿ô %lu, Áí free() ²ó¿ô %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: ¹Ô¤¬Ä¹¤¯¤Ê¤ê¤¹¤®¤Þ¤·¤¿"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ÆâÉô¥¨¥é¡¼: lalloc(%ld,)"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ¥á¥â¥ê¤¬Â­¤ê¤Þ¤»¤ó! (%lu ¥Ð¥¤¥È¤ò³äÅöÍ×µá)"
+
+#: misc2.c:2593
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "¼Â¹Ô¤Î¤¿¤á¤Ë¥·¥§¥ë¤ò¸Æ½Ð¤·Ãæ: \"%s\""
+
+#: misc2.c:2815
+msgid "E545: Missing colon"
+msgstr "E545: ¥³¥í¥ó¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:2817 misc2.c:2844
+msgid "E546: Illegal mode"
+msgstr "E546: ÉÔÀµ¤Ê¥â¡¼¥É¤Ç¤¹"
+
+#: misc2.c:2883
+msgid "E547: Illegal mouseshape"
+msgstr "E547: ÉÔÀµ¤Ê 'mouseshape' ¤Ç¤¹"
+
+#: misc2.c:2923
+msgid "E548: digit expected"
+msgstr "E548: ¿ôÃͤ¬É¬ÍפǤ¹"
+
+#: misc2.c:2928
+msgid "E549: Illegal percentage"
+msgstr "E549: ÉÔÀµ¤Ê¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¤Ç¤¹"
+
+#: misc2.c:3238
+msgid "Enter encryption key: "
+msgstr "°Å¹æ²½ÍѤΥ­¡¼¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤: "
+
+#: misc2.c:3239
+msgid "Enter same key again: "
+msgstr "¤â¤¦°ìÅÙƱ¤¸¥­¡¼¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤: "
+
+#: misc2.c:3249
+msgid "Keys don't match!"
+msgstr "¥­¡¼¤¬°ìÃפ·¤Þ¤»¤ó"
+
+#: misc2.c:3798
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: ̵¸ú¤Ê¥Ñ¥¹¤Ç¤¹: '**[¿ôÃÍ]' ¤Ïpath¤ÎºÇ¸å¤« '%s' "
+"¤¬Â³¤¤¤Æ¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó."
+
+#: misc2.c:5077
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath¤Ë¤Ï \"%s\" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:5080
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: path¤Ë¤Ï \"%s\" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:5086
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: cdpath¤Ë¤Ï¤³¤ì°Ê¾å \"%s\" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:5089
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ¥Ñ¥¹¤Ë¤Ï¤³¤ì°Ê¾å \"%s\" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:5323
+msgid "E550: Missing colon"
+msgstr "E550: ¥³¥í¥ó¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: misc2.c:5335
+msgid "E551: Illegal component"
+msgstr "E551: ÉÔÀµ¤Ê¹½Ê¸Í×ÁǤǤ¹"
+
+#: misc2.c:5343
+msgid "E552: digit expected"
+msgstr "E552: ¿ôÃͤ¬É¬ÍפǤ¹"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Netbeans #2 ¤ËÀܳ¤Ç¤­¤Þ¤»¤ó"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Netbeans ¤ËÀܳ¤Ç¤­¤Þ¤»¤ó"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: NetBeans¤ÎÀܳ¾ðÊó¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¥â¡¼¥É¤ËÌäÂ꤬¤¢¤ê¤Þ¤¹: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "Netbeans ¤Î¥½¥±¥Ã¥È¤òÆɹþ¤ß"
+
+#: netbeans.c:1638
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: ¥Ð¥Ã¥Õ¥¡ %ld ¤Î NetBeans Àܳ¤¬¼º¤ï¤ì¤Þ¤·¤¿"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "·Ù¹ð: »ÈÍѤ·¤Æ¤¤¤ëüËö¤Ï¥Ï¥¤¥é¥¤¥È¤Ç¤­¤Þ¤»¤ó"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: ¥«¡¼¥½¥ë¤Î°ÌÃ֤ˤÏʸ»úÎ󤬤¢¤ê¤Þ¤»¤ó"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: ¥«¡¼¥½¥ë¤Î°ÌÃ֤ˤϼ±Ê̻Ҥ¬¤¢¤ê¤Þ¤»¤ó"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: ¸½ºß¤Î 'foldmethod' ¤Ç¤ÏÀÞ¾ö¤ß¤ò¾Ãµî¤Ç¤­¤Þ¤»¤ó"
+
+#: normal.c:6708
+msgid "E664: changelist is empty"
+msgstr "E664: Êѹ¹¥ê¥¹¥È¤¬¶õ¤Ç¤¹"
+
+#: normal.c:6710
+msgid "E662: At start of changelist"
+msgstr "E662: Êѹ¹¥ê¥¹¥È¤ÎÀèƬ"
+
+#: normal.c:6712
+msgid "E663: At end of changelist"
+msgstr "E663: Êѹ¹¥ê¥¹¥È¤ÎËöÈø"
+
+#: normal.c:7973
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Vim¤ò½ªÎ»¤¹¤ë¤Ë¤Ï :quit<Enter> ¤ÈÆþÎϤ·¤Æ¤¯¤À¤µ¤¤"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 ¹Ô¤¬ %s ¤Ç 1 ²ó½èÍý¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 ¹Ô¤¬ %s ¤Ç %d ²ó½èÍý¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld ¹Ô¤¬ %s ¤Ç 1 ²ó½èÍý¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld ¹Ô¤¬ %s ¤Ç %d ²ó½èÍý¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld ¹Ô¤¬¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Þ¤¹... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 ¹Ô¤ò¥¤¥ó¥Ç¥ó¥È¤·¤Þ¤·¤¿"
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld ¹Ô¤ò¥¤¥ó¥Ç¥ó¥È¤·¤Þ¤·¤¿"
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "¥ä¥ó¥¯¤Ç¤­¤Þ¤»¤ó; ¤È¤Ë¤«¤¯¾Ãµî"
+
+#: ops.c:2185
+msgid "1 line changed"
+msgstr "1 ¹Ô¤¬Êѹ¹¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:2187
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld ¹Ô¤¬Êѹ¹¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:2571
+#, c-format
+msgid "freeing %ld lines"
+msgstr "%ld ¹Ô¤ò³«ÊüÃæ"
+
+#: ops.c:2852
+msgid "1 line yanked"
+msgstr "1 ¹Ô¤¬¥ä¥ó¥¯¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:2854
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld ¹Ô¤¬¥ä¥ó¥¯¤µ¤ì¤Þ¤·¤¿"
+
+#: ops.c:3139
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ¥ì¥¸¥¹¥¿ %s ¤Ë¤Ï²¿¤â¤¢¤ê¤Þ¤»¤ó"
+
+#. Highlight title
+#: ops.c:3690
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ¥ì¥¸¥¹¥¿ ---"
+
+#: ops.c:4997
+msgid "Illegal register name"
+msgstr "ÉÔÀµ¤Ê¥ì¥¸¥¹¥¿Ì¾"
+
+#: ops.c:5085
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ¥ì¥¸¥¹¥¿:\n"
+
+#: ops.c:5135
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: ̤ÃΤΥ쥸¥¹¥¿·¿ %d ¤Ç¤¹"
+
+#: ops.c:5620
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: ̵¸ú¤Ê¥ì¥¸¥¹¥¿Ì¾: '%s'"
+
+#: ops.c:5980
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Îó; "
+
+#: ops.c:5987
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "ÁªÂò %s%ld / %ld ¹Ô; %ld / %ld ñ¸ì; %ld / %ld ʸ»ú"
+
+#: ops.c:6003
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Îó %s / %s; ¹Ô %ld of %ld; ñ¸ì %ld / %ld; ʸ»ú %ld / %ld"
+
+#: ops.c:6014
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=%N ¥Ú¡¼¥¸"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Vim ¤ò»È¤Ã¤Æ¤¯¤ì¤Æ¤¢¤ê¤¬¤È¤¦"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: ̤ÃΤΥª¥×¥·¥ç¥ó¤Ç¤¹"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: ¥ª¥×¥·¥ç¥ó¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: modeline ¤Ç¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tLast set from "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: = ¤Î¸å¤Ë¤Ï¿ô»ú¤¬É¬ÍפǤ¹"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: termcap Æâ¤Ë¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: ÉÔÀµ¤Êʸ»ú¤Ç¤¹ <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: 'term' ¤Ë¤Ï¶õʸ»úÎó¤òÀßÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: GUI¤Ç¤Ï 'term' ¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: GUI¤ò¥¹¥¿¡¼¥È¤¹¤ë¤Ë¤Ï \":gui\" ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' ¤È 'patchmode' ¤¬Æ±¤¸¤Ç¤¹"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: GTK+2 GUI¤Ç¤ÏÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: ¥³¥í¥ó¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: ʸ»úÎó¤ÎŤµ¤¬¥¼¥í¤Ç¤¹"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: <%s> ¤Î¸å¤Ë¿ô»ú¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: ¥«¥ó¥Þ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: ' ¤ÎÃͤò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: ɽ¼¨¤Ç¤­¤Ê¤¤Ê¸»ú¤«¥ï¥¤¥Éʸ»ú¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: ̵¸ú¤Ê¥Õ¥©¥ó¥È¤Ç¤¹"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: ¥Õ¥©¥ó¥È¥»¥Ã¥È¤òÁªÂò¤Ç¤­¤Þ¤»¤ó"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: ̵¸ú¤Ê¥Õ¥©¥ó¥È¥»¥Ã¥È¤Ç¤¹"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: ¥ï¥¤¥É¥Õ¥©¥ó¥È¤òÁªÂò¤Ç¤­¤Þ¤»¤ó"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: ̵¸ú¤Ê¥ï¥¤¥É¥Õ¥©¥ó¥È¤Ç¤¹"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: <%c> ¤Î¸å¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤¹"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: ¥«¥ó¥Þ¤¬É¬ÍפǤ¹"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' ¤Ï¶õ¤Ç¤¢¤ë¤« %s ¤ò´Þ¤àɬÍפ¬¤¢¤ê¤Þ¤¹"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: ¥Þ¥¦¥¹¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: ¼°¤¬½ªÎ»¤·¤Æ¤¤¤Þ¤»¤ó"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: Í×ÁǤ¬Â¿¤¹¤®¤Þ¤¹"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: ¥°¥ë¡¼¥×¤¬Äà¹ç¤¤¤Þ¤»¤ó"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: ¥×¥ì¥Ó¥å¡¼¥¦¥£¥ó¥É¥¦¤¬´û¤Ë¸ºß¤·¤Þ¤¹"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr ""
+"W17: ¥¢¥é¥Ó¥¢Ê¸»ú¤Ë¤ÏUTF-8¤¬É¬ÍפʤΤÇ, ':set encoding=utf-8' ¤·¤Æ¤¯¤À¤µ¤¤"
+
+#: option.c:6776
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: ºÇÄã %d ¤Î¹Ô¿ô¤¬É¬ÍפǤ¹"
+
+#: option.c:6786
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: ºÇÄã %d ¤Î¥«¥é¥àÉý¤¬É¬ÍפǤ¹"
+
+#: option.c:7093
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ̤ÃΤΥª¥×¥·¥ç¥ó¤Ç¤¹: %s"
+
+#: option.c:7213
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- üËö¥³¡¼¥É ---"
+
+#: option.c:7215
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- ¥°¥í¡¼¥Ð¥ë¥ª¥×¥·¥ç¥óÃÍ ---"
+
+#: option.c:7217
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- ¥í¡¼¥«¥ë¥ª¥×¥·¥ç¥óÃÍ ---"
+
+#: option.c:7219
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- ¥ª¥×¥·¥ç¥ó ---"
+
+#: option.c:7925
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ¥¨¥é¡¼"
+
+#: option.c:8896
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': %s ¤ËÂбþ¤¹¤ëʸ»ú¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: option.c:8930
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ¥»¥ß¥³¥í¥ó¤Î¸å¤Ë;ʬ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤¹: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "³«¤±¤Þ¤»¤ó "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ¥¦¥£¥ó¥É¥¦¤ò³«¤±¤Þ¤»¤ó!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Amigados¤Î¥Ð¡¼¥¸¥ç¥ó 2.04¤«¤½¤ì°Ê¹ß¤¬É¬ÍפǤ¹\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "%s ¤Î¥Ð¡¼¥¸¥ç¥ó %ld ¤¬É¬ÍפǤ¹\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "NIL¤ò³«¤±¤Þ¤»¤ó:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "ºîÀ®¤Ç¤­¤Þ¤»¤ó "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim¤Ï %d ¤Ç½ªÎ»¤·¤Þ¤¹\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "¥³¥ó¥½¡¼¥ë¥â¡¼¥É¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ¥³¥ó¥½¡¼¥ë¤Ç¤Ï¤Ê¤¤??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: -f ¥ª¥×¥·¥ç¥ó¤Ç¥·¥§¥ë¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "¼Â¹Ô¤Ç¤­¤Þ¤»¤ó "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "¥·¥§¥ë "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " Ìá¤ê¤Þ¤·¤¿\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ¤¬¾®¤µ¤¹¤®¤Þ¤¹."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "Æþ½ÐÎÏ¥¨¥é¡¼"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(¾Êά)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ¤¬80¤Ç¤Ï¤Ê¤¤¤¿¤á, ³°Éô¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E237: ¥×¥ê¥ó¥¿¤ÎÁªÂò¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "%s ¤Ø (%s ¾å¤Î)"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: ̤ÃΤΥץê¥ó¥¿¥ª¥×¥·¥ç¥ó¤Ç¤¹: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: °õºþ¥¨¥é¡¼: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "ÉÔÌÀ"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "°õºþ¤·¤Æ¤¤¤Þ¤¹: '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: ʸ»ú¥»¥Ã¥È̾ \"%s\" ¤ÏÉÔÀµ¤Ç¤¹ (¥Õ¥©¥ó¥È̾ \"%s\")"
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: '%c' ¤ÏÉÔÀµ¤Êʸ»ú¤Ç¤¹ (¥Õ¥©¥ó¥È̾ \"%s\")"
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ̵¸ú¤Ê 'osfiletype' ¥ª¥×¥·¥ç¥ó - \"Text\" ¤ò»È¤¤¤Þ¤¹"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: 2½Å¤Î¥·¥°¥Ê¥ë¤Î¤¿¤á, ½ªÎ»¤·¤Þ¤¹\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Ã×̿Ū¥·¥°¥Ê¥ë %s ¤ò¸¡ÃΤ·¤Þ¤·¤¿\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Ã×̿Ū¥·¥°¥Ê¥ë¤ò¸¡ÃΤ·¤Þ¤·¤¿\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "X¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤Ë %ld ¥ß¥êÉ䫤«¤ê¤Þ¤·¤¿"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X ¤Î¥¨¥é¡¼¤ò¸¡½Ð¤·¤Þ¤·¤¿r\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "X display ¤Î¥Á¥§¥Ã¥¯¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "X display ¤Î open ¤¬¥¿¥¤¥à¥¢¥¦¥È¤·¤Þ¤·¤¿"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"¥·¥§¥ë¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"sh ¥·¥§¥ë¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"¥·¥§¥ë¤¬ÃͤòÊÖ¤·¤Þ¤·¤¿ "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"¥Ñ¥¤¥×¤òºîÀ®¤Ç¤­¤Þ¤»¤ó\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"fork ¤Ç¤­¤Þ¤»¤ó\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"¥³¥Þ¥ó¥É¤òÃæÃǤ·¤Þ¤·¤¿\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP ¤¬ICEÀܳ¤ò¼º¤¤¤Þ¤·¤¿"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "X display ¤Î open ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP ¤¬save-yourselfÍ×µá¤ò½èÍý¤·¤Æ¤¤¤Þ¤¹"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP ¤¬Àܳ¤ò³«»Ï¤·¤Æ¤¤¤Þ¤¹"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP ICEÀܳ¤¬¼ºÇÔ¤·¤¿¤è¤¦¤Ç¤¹"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection¤¬¼ºÇÔ¤·¤Þ¤·¤¿: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "¹Ô"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤é¤ì¤Þ¤»¤ó"
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "VIM¥¨¥é¡¼"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "vim32.dll ¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "DLL¤«¤é´Ø¿ô¥Ý¥¤¥ó¥¿¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: os_win16.c:342 os_win32.c:3197
+#, c-format
+msgid "shell returned %d"
+msgstr "¥·¥§¥ë¤¬¥³¡¼¥É %d ¤Ç½ªÎ»¤·¤Þ¤·¤¿"
+
+#: os_win32.c:2655
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: ¥¤¥Ù¥ó¥È %s ¤ò¸¡ÃÎ\n"
+
+#: os_win32.c:2657
+msgid "close"
+msgstr "ÊĤ¸¤ë"
+
+#: os_win32.c:2659
+msgid "logoff"
+msgstr "¥í¥°¥ª¥Õ"
+
+#: os_win32.c:2660
+msgid "shutdown"
+msgstr "¥·¥ã¥Ã¥È¥À¥¦¥ó"
+
+#: os_win32.c:3150
+msgid "E371: Command not found"
+msgstr "E371: ¥³¥Þ¥ó¥É¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: os_win32.c:3163
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE¤¬ $PATH ¤ÎÃæ¤Ë¤ß¤Ä¤«¤ê¤Þ¤»¤ó.\n"
+"³°Éô¥³¥Þ¥ó¥É¤Î½ªÎ»¸å¤Ë°ì»þÄä»ß¤ò¤·¤Þ¤»¤ó.\n"
+"¾ÜºÙ¤Ï :help win32-vimrun ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤."
+
+#: os_win32.c:3166
+msgid "Vim Warning"
+msgstr "Vim¤Î·Ù¹ð"
+
+#: quickfix.c:258
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ë %%%c ¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: quickfix.c:271
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ëͽ´ü¤»¤Ì %%%c ¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ë ] ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: quickfix.c:339
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ç¤Ï %%%c ¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó"
+
+#: quickfix.c:357
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤ÎÁ°ÃÖ¤Ë̵¸ú¤Ê %%%c ¤¬¤¢¤ê¤Þ¤¹"
+
+#: quickfix.c:365
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»úÎó¤Ë̵¸ú¤Ê %%%c ¤¬¤¢¤ê¤Þ¤¹"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' ¤Ë¥Ñ¥¿¡¼¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ¥Ç¥£¥ì¥¯¥È¥ê̾¤¬Ìµ¤¤¤«¶õ¤Ç¤¹"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Í×ÁǤ¬¤â¤¦¤¢¤ê¤Þ¤»¤ó"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d of %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (¹Ô¤¬ºï½ü¤µ¤ì¤Þ¤·¤¿)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: quickfix ¥¹¥¿¥Ã¥¯¤ÎËöÈø¤Ç¤¹"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: quickfix ¥¹¥¿¥Ã¥¯¤ÎÀèƬ¤Ç¤¹"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "¥¨¥é¡¼°ìÍ÷ %d of %d; %d ¸Ä¥¨¥é¡¼"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: 'buftype' ¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç½ñ¹þ¤ß¤Þ¤»¤ó"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: ¥Ñ¥¿¡¼¥ó¤¬Ä¹¤¹¤®¤Þ¤¹"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: \\z( ¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: %s( ¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: \\z( ¤¬Äà¤ê¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó"
+
+#: regexp.c:1081
+msgid "E53: Unmatched %s%%("
+msgstr "E53: %s%%( ¤¬Äà¤ê¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó"
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: %s( ¤¬Äà¤ê¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó"
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: %s) ¤¬Äà¤ê¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s* ¤¬¶õʸ»úÎó¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: %s+ ¤¬¶õʸ»úÎó¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: %s@ ¤Î¸å¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{ ¤¬¶õʸ»úÎó¤Ë¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Ê£»¨¤Ê %s{...} ¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61:%s* ¤¬Æþ¤ì»Ò¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62:%s%c ¤¬Æþ¤ì»Ò¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹"
+
+#
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: \\_ ¤Î̵¸ú¤Ê»ÈÍÑÊýË¡¤Ç¤¹"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64:%s%c ¤Î¸å¤Ë¤Ê¤Ë¤â¤¢¤ê¤Þ¤»¤ó"
+
+#
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: ÉÔÀµ¤Ê¸åÊý»²¾È¤Ç¤¹"
+
+#
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ¤Ï¥³¥³¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 ¤½¤Î¾¤Ï¥³¥³¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: \\z ¤Î¸å¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#
+#: regexp.c:1684
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: %s%%[ ¤Î¸å¤Ë ] ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: regexp.c:1700
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] ¤¬¶õ¤Ç¤¹"
+
+#
+#: regexp.c:1760
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: %s%% ¤Î¸å¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤·¤¿"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: %s{...} Æâ¤Ëʸˡ¥¨¥é¡¼¤¬¤¢¤ê¤Þ¤¹"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ¥¯¥é¥Ã¥·¥å¤Ë¤è¤êÃæÃÇ; Àµµ¬É½¸½¤¬Ê£»¨²á¤®¤ë¤«¤â?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: ¥Ñ¥¿¡¼¥ó¤Ë¤è¤ë¥¹¥¿¥Ã¥¯ÉÔ­¥¨¥é¡¼¤Ç¤¹"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "³°Éô¤ÎÉôʬ³ºÅö:\n"
+
+#: screen.c:2143
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld ¹Ô¤¬ÀÞ¾ö¤Þ¤ì¤Þ¤·¤¿"
+
+#: screen.c:7959
+msgid " VREPLACE"
+msgstr " ²¾ÁÛÃÖ´¹"
+
+#: screen.c:7963
+msgid " REPLACE"
+msgstr " ÃÖ´¹"
+
+#: screen.c:7968
+msgid " REVERSE"
+msgstr " ȿž"
+
+#: screen.c:7970
+msgid " INSERT"
+msgstr " ÁÞÆþ"
+
+#: screen.c:7973
+msgid " (insert)"
+msgstr " (ÁÞÆþ)"
+
+#: screen.c:7975
+msgid " (replace)"
+msgstr " (ÃÖ´¹)"
+
+#: screen.c:7977
+msgid " (vreplace)"
+msgstr " (²¾ÁÛÃÖ´¹)"
+
+#: screen.c:7980
+msgid " Hebrew"
+msgstr " ¥Ø¥Ö¥é¥¤"
+
+#: screen.c:7991
+msgid " Arabic"
+msgstr " ¥¢¥é¥Ó¥¢"
+
+#: screen.c:7994
+msgid " (lang)"
+msgstr " (¸À¸ì)"
+
+#: screen.c:7998
+msgid " (paste)"
+msgstr " (Ž¤êÉÕ¤±)"
+
+#: screen.c:8011
+msgid " VISUAL"
+msgstr " ¥Ó¥¸¥å¥¢¥ë"
+
+#: screen.c:8012
+msgid " VISUAL LINE"
+msgstr " ¥Ó¥¸¥å¥¢¥ë ¹Ô"
+
+#: screen.c:8013
+msgid " VISUAL BLOCK"
+msgstr " ¥Ó¥¸¥å¥¢¥ë ¶ë·Á"
+
+#: screen.c:8014
+msgid " SELECT"
+msgstr " ¥»¥ì¥¯¥È"
+
+#: screen.c:8015
+msgid " SELECT LINE"
+msgstr " ¹Ô»Ø¸þÁªÂò"
+
+#: screen.c:8016
+msgid " SELECT BLOCK"
+msgstr " ¶ë·ÁÁªÂò"
+
+# msgid " BLOCK"
+# msgstr " ¥Ö¥í¥Ã¥¯"
+# msgid " LINE"
+# msgstr " ¹Ô"
+#: screen.c:8031 screen.c:8094
+msgid "recording"
+msgstr "µ­Ï¿Ãæ"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "¾å¤Þ¤Ç¸¡º÷¤·¤¿¤Î¤Ç²¼¤ËÌá¤ê¤Þ¤¹"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "²¼¤Þ¤Ç¸¡º÷¤·¤¿¤Î¤Ç¾å¤ËÌá¤ê¤Þ¤¹"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: ̵¸ú¤Ê¸¡º÷ʸ»úÎó¤Ç¤¹: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ¾å¤Þ¤Ç¸¡º÷¤·¤¿¤±¤ì¤É³ºÅö²Õ½ê¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ²¼¤Þ¤Ç¸¡º÷¤·¤¿¤±¤ì¤É³ºÅö²Õ½ê¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ';' ¤Î¤¢¤È¤Ë¤Ï '?' ¤« '/' ¤¬´üÂÔ¤µ¤ì¤Æ¤¤¤ë"
+
+#: search.c:3758
+msgid " (includes previously listed match)"
+msgstr " (Á°¤ËÎóµó¤·¤¿³ºÅö²Õ½ê¤ò´Þ¤à)"
+
+#. cursor at status line
+#: search.c:3778
+msgid "--- Included files "
+msgstr "--- ¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë"
+
+#: search.c:3780
+msgid "not found "
+msgstr "¤ß¤Ä¤«¤ê¤Þ¤»¤ó "
+
+#: search.c:3781
+msgid "in path ---\n"
+msgstr "¥Ñ¥¹¤Ë ----\n"
+
+#: search.c:3820
+msgid " (Already listed)"
+msgstr " (´û¤ËÎóµó)"
+
+#: search.c:3822
+msgid " NOT FOUND"
+msgstr " ¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: search.c:3874
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¥¹¥­¥ã¥óÃæ: %s"
+
+#: search.c:4092
+msgid "E387: Match is on current line"
+msgstr "E387: ¸½ºß¹Ô¤Ë³ºÅö¤¬¤¢¤ê¤Þ¤¹"
+
+#: search.c:4235
+msgid "All included files were found"
+msgstr "Á´¤Æ¤Î¥¤¥ó¥¯¥ë¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¤ß¤Ä¤«¤ê¤Þ¤·¤¿"
+
+#: search.c:4237
+msgid "No included files"
+msgstr "¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: search.c:4253
+msgid "E388: Couldn't find definition"
+msgstr "E388: ÄêµÁ¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: search.c:4255
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ¥Ñ¥¿¡¼¥ó¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: ÉÔÀµ¤Ê°ú¿ô¤Ç¤¹: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ¤½¤Î¤è¤¦¤Ê¹½Ê¸¥¯¥é¥¹¥¿¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "¤³¤Î¥Ð¥Ã¥Õ¥¡¤ËÄêµÁ¤µ¤ì¤¿¹½Ê¸Í×ÁǤϤ¢¤ê¤Þ¤»¤ó"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "C¸À¸ìÉ÷¥³¥á¥ó¥È¤«¤éƱ´üÃæ"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "ÈóƱ´ü"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "Ʊ´ü³«»Ï "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " ¹ÔÁ°(¥È¥Ã¥×¹Ô¤è¤ê¤â)"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- ¹½Ê¸Æ±´üÍ×ÁÇ ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"Í×ÁǾå¤ÇƱ´üÃæ"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- ¹½Ê¸Í×ÁÇ ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ¤½¤Î¤è¤¦¤Ê¹½Ê¸¥¯¥é¥¹¥¿¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimal"
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "maximal"
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; ³ºÅö "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " ¸Ä¤Î²þ¹Ô"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ¤³¤³¤Ç¤Ï¥°¥ë¡¼¥×¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: %s ¤ÎÈÏ°ÏÍ×ÁǤ¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ¤³¤Î¾ì½ê¤Ç¤Ï°ú¿ôcontains¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ¤³¤Î¾ì½ê¤Ç¤Ï°ú¿ôcontainedin¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: ¥Õ¥¡¥¤¥ë̾¤¬É¬ÍפǤ¹"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: '=' ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: °ú¿ô¤¬Â­¤ê¤Þ¤»¤ó: ¹½Ê¸ÈÏ°Ï %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: ¥¯¥é¥¹¥¿¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ¥Ñ¥¿¡¼¥ó¶èÀڤ꤬¤ß¤Ä¤«¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: ¥Ñ¥¿¡¼¥ó¤Î¤¢¤È¤Ë¥´¥ß¤¬¤¢¤ê¤Þ¤¹: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: ¹½Ê¸Æ±´ü: Ϣ³¹Ô¥Ñ¥¿¡¼¥ó¤¬2ÅÙ»ØÄꤵ¤ì¤Þ¤·¤¿"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: ÉÔÀµ¤Ê°ú¿ô¤Ç¤¹: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Åù¤·¤¤ sign ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ¶õ¤Î°ú¿ô: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ¤Ï¥³¥³¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ¤ÏÆâÍƥꥹ¥È¤ÎÀèƬ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ̤ÃΤΥ°¥ë¡¼¥×̾: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ̵¸ú¤Ê :syntax ¤Î¥µ¥Ö¥³¥Þ¥ó¥É: %s"
+
+#: syntax.c:6134
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ¥Ï¥¤¥é¥¤¥È¥°¥ë¡¼¥×¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:6158
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: °ú¿ô¤¬½¼Ê¬¤Ç¤Ï¤Ê¤¤: \":highlight link %s\""
+
+#: syntax.c:6165
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: °ú¿ô¤¬Â¿¤¹¤®¤Þ¤¹: \":highlight link %s\""
+
+#: syntax.c:6185
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ¥°¥ë¡¼¥×¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¥Ï¥¤¥é¥¤¥È¥ê¥ó¥¯¤Ï̵»ë¤µ¤ì¤Þ¤¹"
+
+#: syntax.c:6314
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ͽ´ü¤»¤ÌƱ¤¸ sign ¤Ç¤¹: %s"
+
+#: syntax.c:6350
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: Ʊ¤¸ sign ¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:6378
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: °ú¿ô¤¬¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: syntax.c:6415
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ÉÔÀµ¤ÊÃͤǤ¹: %s"
+
+#: syntax.c:6534
+msgid "E419: FG color unknown"
+msgstr "E419: ̤ÃΤÎÁ°·Ê¿§¤Ç¤¹"
+
+#: syntax.c:6545
+msgid "E420: BG color unknown"
+msgstr "E420: ̤ÃΤÎÇØ·Ê¿§¤Ç¤¹"
+
+#: syntax.c:6606
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: ¥«¥é¡¼Ì¾¤äÈÖ¹æ¤òǧ¼±¤Ç¤­¤Þ¤»¤ó: %s"
+
+#: syntax.c:6812
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: ½ªÃ¼¥³¡¼¥É¤¬Ä¹¤¹¤®¤Þ¤¹: %s"
+
+#: syntax.c:6859
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: ÉÔÀµ¤Ê°ú¿ô¤Ç¤¹: %s"
+
+#: syntax.c:7388
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ¿¤¯¤Î°Û¤Ê¤ë¥Ï¥¤¥é¥¤¥È°À­¤¬»È¤ï¤ì¤¹¤®¤Æ¤¤¤Þ¤¹"
+
+#: syntax.c:7909
+msgid "E669: Unprintable character in group name"
+msgstr "E669: ¥°¥ë¡¼¥×̾¤Ë°õºþÉÔ²Äǽ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤¹"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7916
+msgid "W18: Invalid character in group name"
+msgstr "W18: ¥°¥ë¡¼¥×̾¤ËÉÔÀµ¤Êʸ»ú¤¬¤¢¤ê¤Þ¤¹"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: ¥¿¥°¥¹¥¿¥Ã¥¯¤ÎËöÈø¤Ç¤¹"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: ¥¿¥°¥¹¥¿¥Ã¥¯¤ÎÀèƬ¤Ç¤¹"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ºÇ½é¤Î³ºÅö¥¿¥°¤òĶ¤¨¤ÆÌá¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ¥¿¥°¤¬¤ß¤Ä¤«¤ê¤Þ¤»¤ó: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "¥Õ¥¡¥¤¥ë\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "ÁªÂò¤¹¤ëÈÖ¹æ¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤ (<CR>¤ÇÃæ»ß): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: ³ºÅö¥¿¥°¤¬1¤Ä¤À¤±¤·¤«¤¢¤ê¤Þ¤»¤ó"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ºÇ¸å¤Ë³ºÅö¤¹¤ë¥¿¥°¤òĶ¤¨¤Æ¿Ê¤à¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "¥Õ¥¡¥¤¥ë \"%s\" ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "¥¿¥° %d (Á´%d%s)"
+
+#: tag.c:826
+msgid " or more"
+msgstr " ¤«¤½¤ì°Ê¾å"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " ¥¿¥°¤ò°Û¤Ê¤ëcase¤Ç»ÈÍѤ·¤Þ¤¹!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: ¥Õ¥¡¥¤¥ë \"%s\" ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # TO ¥¿¥° FROM ¹Ô in file/text"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "¥¿¥°¥Õ¥¡¥¤¥ë %s ¤ò¸¡º÷Ãæ"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: ¥¿¥°¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤¬ %s ¤ËÀÚ¤ê¼Î¤Æ¤é¤ì¤Þ¤·¤¿\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: ¥¿¥°¥Õ¥¡¥¤¥ë \"%s\" ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¥¨¥é¡¼¤¬¤¢¤ê¤Þ¤¹"
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "ľÁ°¤Î %ld ¥Ð¥¤¥È"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: ¥¿¥°¥Õ¥¡¥¤¥ë¤¬¥½¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: ¥¿¥°¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: ¥¿¥°¥Ñ¥¿¡¼¥ó¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: ¥¿¥°¤ò¤ß¤Ä¤±¤é¤ì¤Ê¤¤¤Î¤Çñ¤Ë¿ä¬¤·¤Þ¤¹!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ¤Ï̤ÃΤǤ¹. ¸½¹Ô¤ÎÁȤ߹þ¤ßüËö¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "¾ÊάÃͤò¼¡¤Î¤è¤¦¤ËÀßÄꤷ¤Þ¤¹ '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: termcap¥Õ¥¡¥¤¥ë¤ò³«¤±¤Þ¤»¤ó"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: terminfo¤ËüËö¥¨¥ó¥È¥ê¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: termcap¤ËüËö¥¨¥ó¥È¥ê¤ò¤ß¤Ä¤±¤é¤ì¤Þ¤»¤ó"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap¤Ë \"%s\" ¤Î¥¨¥ó¥È¥ê¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: üËö¤Ë \"cm\" µ¡Ç½¤¬É¬ÍפǤ¹"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- üËö¥­¡¼ ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "¿·¤·¤¤¥·¥§¥ë¤òµ¯Æ°¤·¤Þ¤¹\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: ÆþÎϤòÆɹþ¤ßÃæ¤Î¥¨¥é¡¼¤Ë¤è¤ê½ªÎ»¤·¤Þ¤¹...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "²Äǽ¤Ê¥¢¥ó¥É¥¥¤Ï¤¢¤ê¤Þ¤»¤ó: ¤È¤ê¤¢¤¨¤ºÂ³¤±¤Þ¤¹"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ¹ÔÈֹ椬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 ²Õ½êÊѹ¹¤·¤Þ¤·¤¿"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld ²Õ½êÊѹ¹¤·¤Þ¤·¤¿"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: ¥¢¥ó¥É¥¥¥ê¥¹¥È¤¬²õ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: ¥¢¥ó¥É¥¥¹Ô¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:1731
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 ¥Ó¥Ã¥È GUI ÈÇ"
+
+#: version.c:1733
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 ¥Ó¥Ã¥È GUI ÈÇ"
+
+#: version.c:1736
+msgid " in Win32s mode"
+msgstr " in Win32s ¥â¡¼¥É"
+
+#: version.c:1738
+msgid " with OLE support"
+msgstr " with OLE ¥µ¥Ý¡¼¥È"
+
+#: version.c:1741
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 ¥Ó¥Ã¥È ¥³¥ó¥½¡¼¥ë ÈÇ"
+
+#: version.c:1745
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16 ¥Ó¥Ã¥È ÈÇ"
+
+#: version.c:1749
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 ¥Ó¥Ã¥È MS-DOS ÈÇ"
+
+#: version.c:1751
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 ¥Ó¥Ã¥È MS-DOS ÈÇ"
+
+#: version.c:1757
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) ÈÇ"
+
+#: version.c:1759
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X ÈÇ"
+
+#: version.c:1762
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS ÈÇ"
+
+#: version.c:1767
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS ÈÇ"
+
+#: version.c:1777
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"ŬÍѺѥѥåÁ: "
+
+#: version.c:1803 version.c:2171
+msgid "Modified by "
+msgstr "Modified by "
+
+#: version.c:1810
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compiled "
+
+#: version.c:1813
+msgid "by "
+msgstr "by "
+
+#: version.c:1825
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Huge ÈÇ "
+
+#: version.c:1828
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Big ÈÇ "
+
+#: version.c:1831
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Ä̾ï ÈÇ "
+
+#: version.c:1834
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Small ÈÇ "
+
+#: version.c:1836
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Tiny ÈÇ "
+
+#: version.c:1842
+msgid "without GUI."
+msgstr "without GUI."
+
+#: version.c:1847
+msgid "with GTK2-GNOME GUI."
+msgstr "with GTK2-GNOME GUI."
+
+#: version.c:1849
+msgid "with GTK-GNOME GUI."
+msgstr "with GTK-GNOME GUI."
+
+#: version.c:1853
+msgid "with GTK2 GUI."
+msgstr "with GTK2 GUI."
+
+#: version.c:1855
+msgid "with GTK GUI."
+msgstr "with GTK GUI."
+
+#: version.c:1860
+msgid "with X11-Motif GUI."
+msgstr "with X11-Motif GUI."
+
+#: version.c:1864
+msgid "with X11-neXtaw GUI."
+msgstr "with X11-neXtaw GUI."
+
+#: version.c:1866
+msgid "with X11-Athena GUI."
+msgstr "with X11-Athena GUI."
+
+#: version.c:1870
+msgid "with BeOS GUI."
+msgstr "with BeOS GUI."
+
+#: version.c:1873
+msgid "with Photon GUI."
+msgstr "with Photon GUI."
+
+#: version.c:1876
+msgid "with GUI."
+msgstr "with GUI."
+
+#: version.c:1879
+msgid "with Carbon GUI."
+msgstr "with Carbon GUI."
+
+#: version.c:1882
+msgid "with Cocoa GUI."
+msgstr "with Cocoa GUI."
+
+#: version.c:1885
+msgid "with (classic) GUI."
+msgstr "with (¥¯¥é¥·¥Ã¥¯) GUI."
+
+#: version.c:1896
+msgid " Features included (+) or not (-):\n"
+msgstr " µ¡Ç½¤Î°ìÍ÷ Í­¸ú(+)/̵¸ú(-)\n"
+
+#: version.c:1908
+msgid " system vimrc file: \""
+msgstr " ¥·¥¹¥Æ¥à vimrc: \""
+
+#: version.c:1913
+msgid " user vimrc file: \""
+msgstr " ¥æ¡¼¥¶ vimrc: \""
+
+#: version.c:1918
+msgid " 2nd user vimrc file: \""
+msgstr " Âè2¥æ¡¼¥¶ vimrc: \""
+
+#: version.c:1923
+msgid " 3rd user vimrc file: \""
+msgstr " Âè3¥æ¡¼¥¶ vimrc: \""
+
+#: version.c:1928
+msgid " user exrc file: \""
+msgstr " ¥æ¡¼¥¶ exrc: \""
+
+#: version.c:1933
+msgid " 2nd user exrc file: \""
+msgstr " Âè2¥æ¡¼¥¶ exrc: \""
+
+#: version.c:1939
+msgid " system gvimrc file: \""
+msgstr " ¥·¥¹¥Æ¥à gvimrc: \""
+
+#: version.c:1943
+msgid " user gvimrc file: \""
+msgstr " ¥æ¡¼¥¶ gvimrc: \""
+
+#: version.c:1947
+msgid "2nd user gvimrc file: \""
+msgstr " Âè2¥æ¡¼¥¶ gvimrc: \""
+
+#: version.c:1952
+msgid "3rd user gvimrc file: \""
+msgstr " Âè3¥æ¡¼¥¶ gvimrc: \""
+
+#: version.c:1959
+msgid " system menu file: \""
+msgstr " ¥·¥¹¥Æ¥à¥á¥Ë¥å¡¼: \""
+
+#: version.c:1967
+msgid " fall-back for $VIM: \""
+msgstr " ¾Êά»þ¤Î $VIM: \""
+
+#: version.c:1973
+msgid " f-b for $VIMRUNTIME: \""
+msgstr "¾Êά»þ¤Î $VIMRUNTIME: \""
+
+#: version.c:1977
+msgid "Compilation: "
+msgstr "¥³¥ó¥Ñ¥¤¥ë: "
+
+#: version.c:1983
+msgid "Compiler: "
+msgstr "¥³¥ó¥Ñ¥¤¥é: "
+
+#: version.c:1988
+msgid "Linking: "
+msgstr "¥ê¥ó¥¯: "
+
+#: version.c:1993
+msgid " DEBUG BUILD"
+msgstr "¥Ç¥Ð¥Ã¥°¥Ó¥ë¥É"
+
+#: version.c:2032
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:2034
+msgid "version "
+msgstr "version "
+
+#: version.c:2035
+msgid "by Bram Moolenaar et al."
+msgstr "by Bram Moolenaar ¾."
+
+#: version.c:2039
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ¤Ï¥ª¡¼¥×¥ó¥½¡¼¥¹¤Ç¤¢¤ê¼«Í³¤ËÇÛÉÛ²Äǽ¤Ç¤¹"
+
+#: version.c:2041
+msgid "Help poor children in Uganda!"
+msgstr "¥¦¥¬¥ó¥À¤Î·Ã¤Þ¤ì¤Ê¤¤»Ò¶¡¤¿¤Á¤Ë±ç½õ¤ò!"
+
+#: version.c:2042
+msgid "type :help iccf<Enter> for information "
+msgstr "¾ÜºÙ¤Ê¾ðÊó¤Ï :help iccf<Enter> "
+
+#: version.c:2044
+msgid "type :q<Enter> to exit "
+msgstr "½ªÎ»¤¹¤ë¤Ë¤Ï :q<Enter> "
+
+#: version.c:2045
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¤Ï :help<Enter> ¤« <F1> "
+
+#: version.c:2046
+msgid "type :help version6<Enter> for version info"
+msgstr "¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤Ï :help version6<Enter> "
+
+#: version.c:2049
+msgid "Running in Vi compatible mode"
+msgstr "Vi¸ß´¹¥â¡¼¥É¤ÇÆ°ºîÃæ"
+
+#: version.c:2050
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "Vim¿ä¾©Ãͤˤ¹¤ë¤Ë¤Ï :set nocp<Enter> "
+
+#: version.c:2051
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "¾ÜºÙ¤Ê¾ðÊó¤Ï :help cp-default<Enter>"
+
+#: version.c:2066
+msgid "menu Help->Orphans for information "
+msgstr "¾ÜºÙ¤Ï¥á¥Ë¥å¡¼¤Î ¥Ø¥ë¥×¢ª¸É»ù ¤ò»²¾È¤·¤Æ²¼¤µ¤¤ "
+
+#: version.c:2068
+msgid "Running modeless, typed text is inserted"
+msgstr "¥â¡¼¥É̵¤Ç¼Â¹ÔÃæ, ¥¿¥¤¥×¤·¤¿Ê¸»ú¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹"
+
+#: version.c:2069
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "¥á¥Ë¥å¡¼¤Î ÊÔ½¸¢ªÁ´ÂÎÀßÄꢪÁÞÆþ(½é¿´¼Ô)¥â¡¼¥ÉÀÚÂØ"
+
+#: version.c:2070
+msgid " for two modes "
+msgstr " ¤Ç¥â¡¼¥ÉÍ­¤Ë "
+
+#: version.c:2074
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "¥á¥Ë¥å¡¼¤Î ÊÔ½¸¢ªÁ´ÂÎÀßÄꢪVi¸ß´¹¥â¡¼¥ÉÀÚÂØ "
+
+#: version.c:2075
+msgid " for Vim defaults "
+msgstr " ¤ÇVim¤È¤·¤ÆÆ°ºî "
+
+#: version.c:2122
+msgid "Sponsor Vim development!"
+msgstr "Vim¤Î³«È¯¤ò±þ±ç¤·¤Æ¤¯¤À¤µ¤¤!"
+
+#: version.c:2123
+msgid "Become a registered Vim user!"
+msgstr "Vim¤ÎÅÐÏ¿¥æ¡¼¥¶¤Ë¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤!"
+
+#: version.c:2126
+msgid "type :help sponsor<Enter> for information "
+msgstr "¾ÜºÙ¤Ê¾ðÊó¤Ï :help sponsor<Enter> "
+
+#: version.c:2127
+msgid "type :help register<Enter> for information "
+msgstr "¾ÜºÙ¤Ê¾ðÊó¤Ï :help register<Enter> "
+
+#: version.c:2129
+msgid "menu Help->Sponsor/Register for information "
+msgstr "¾ÜºÙ¤Ï¥á¥Ë¥å¡¼¤Î ¥Ø¥ë¥×¢ª¥¹¥Ý¥ó¥µ¡¼/ÅÐÏ¿ ¤ò»²¾È¤·¤Æ²¼¤µ¤¤ "
+
+#: version.c:2139
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr " ·Ù¹ð: Windows 95/98/Me ¤ò¸¡½Ð "
+
+#: version.c:2142
+msgid "type :help windows95<Enter> for info on this"
+msgstr " ¾ÜºÙ¤Ê¾ðÊó¤Ï :help windows95<Enter> "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: ¥×¥ì¥Ó¥å¡¼¥¦¥£¥ó¥É¥¦¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: º¸¾å¤È±¦²¼¤òƱ»þ¤Ëʬ³ä¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ¾¤Î¥¦¥£¥ó¥É¥¦¤¬Ê¬³ä¤µ¤ì¤Æ¤¤¤ë»þ¤Ë¤Ï½ç²ó¤Ç¤­¤Þ¤»¤ó"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: ºÇ¸å¤Î¥¦¥£¥ó¥É¥¦¤òÊĤ¸¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "´û¤Ë¥¦¥£¥ó¥É¥¦¤Ï1¤Ä¤·¤«¤¢¤ê¤Þ¤»¤ó"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: ¾¤Î¥¦¥£¥ó¥É¥¦¤Ë¤ÏÊѹ¹¤¬¤¢¤ê¤Þ¤¹"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: ¥«¡¼¥½¥ë¤Î²¼¤Ë¥Õ¥¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: path¤Ë¤Ï \"%s\" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1232 if_perl.xs:326
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: ¥é¥¤¥Ö¥é¥ê %s ¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"¤³¤Î¥³¥Þ¥ó¥É¤Ï̵¸ú¤Ç¤¹, ¤´¤á¤ó¤Ê¤µ¤¤: Perl¥é¥¤¥Ö¥é¥ê¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: ¥µ¥ó¥É¥Ü¥Ã¥¯¥¹¤Ç¤Ï Safe "
+"¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ·¤Ê¤¤Perl¥¹¥¯¥ê¥×¥È¤Ï¶Ø¤¸¤é¤ì¤Æ¤¤¤Þ¤¹"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "³Æ¥Õ¥¡¥¤¥ë¤òÊÌ¡¹¤Î Vim ¤ÇÊÔ½¸(&M)"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Á´¥Õ¥¡¥¤¥ë¤ò1¤Ä¤Î Vim ¤ÇÊÔ½¸(&V)"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "Vim ¤Çº¹Ê¬ÊÔ½¸(&D)"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Vim ¤ÇÊÔ½¸(&V)"
+
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "´û¸¤Î Vim ¤ÇÊÔ½¸ - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "ÁªÂò¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò Vim ¤ÇÊÔ½¸"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "µ¯Æ°¥¨¥é¡¼: gvim ¤Ë¥Ñ¥¹¤¬Ä̤äƤ¤¤ë¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ¥¨¥é¡¼"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "¥Ñ¥¹¤¬Ä¹¤¹¤®¤Þ¤¹!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "--¥Ð¥Ã¥Õ¥¡¤Ë¹Ô¤¬¤¢¤ê¤Þ¤»¤ó--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: ¥³¥Þ¥ó¥É¤¬ÃæÃǤµ¤ì¤Þ¤·¤¿"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: °ú¿ô¤¬É¬ÍפǤ¹"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ ¤Î¸å¤Ï / ¤« ? ¤« & ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç¤Ï̵¸ú¤Ç¤¹; <CR>¤Ç¼Â¹Ô, CTRL-C¤Ç¤ä¤á¤ë"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: ¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ä¥¿¥°¸¡º÷¤Ç¤Ïexrc/vimrc¤Î¥³¥Þ¥ó¥É¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: :endif ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: :endtry ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: :endwhile ¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: :while ¤Î¤Ê¤¤ :endwhile ¤¬¤¢¤ê¤Þ¤¹"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤¹ (! ¤òÄɲäǾå½ñ)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: ¥³¥Þ¥ó¥É¤¬¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ̤ÃΤΥե©¥ó¥È¥»¥Ã¥È: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: ̤ÃΤΥե©¥ó¥È: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: ¥Õ¥©¥ó¥È \"%s\" ¤Ï¸ÇÄêÉý¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: ÆâÉô¥¨¥é¡¼¤Ç¤¹"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "³ä¹þ¤Þ¤ì¤Þ¤·¤¿"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: ̵¸ú¤Ê¥¢¥É¥ì¥¹¤Ç¤¹"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: ̵¸ú¤Ê°ú¿ô¤Ç¤¹"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: ̵¸ú¤Ê°ú¿ô¤Ç¤¹: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ̵¸ú¤Ê¼°¤Ç¤¹: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: ̵¸ú¤ÊÈϰϤǤ¹"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: ̵¸ú¤Ê¥³¥Þ¥ó¥É¤Ç¤¹"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: ͽ´ü¤»¤Ìʸ»ú¤¬ '=' ¤ÎÁ°¤Ë¤¢¤ê¤Þ¤·¤¿"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: \"%s\"() ¤Î¥é¥¤¥Ö¥é¥ê¸Æ½Ð¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô %s ¤ò¥í¡¼¥É¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ¥Þ¡¼¥¯¤Ë̵¸ú¤Ê¹ÔÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤·¤¿"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "E20: ¥Þ¡¼¥¯¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: 'modifiable' ¤¬¥ª¥Õ¤Ê¤Î¤Ç, Êѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: ¥¹¥¯¥ê¥×¥È¤ÎÆþ¤ì»Ò¤¬¿¼¤¹¤®¤Þ¤¹"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: Éû¥Õ¥¡¥¤¥ë¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: ¤½¤Î¤è¤¦¤Êû½ÌÆþÎϤϤ¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: ! ¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI¤Ï»ÈÍÑÉÔ²Äǽ¤Ç¤¹: ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë̵¸ú¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: ¥Ø¥Ö¥é¥¤¸ì¤Ï»ÈÍÑÉÔ²Äǽ¤Ç¤¹: ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë̵¸ú¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: ¥Ú¥ë¥·¥¢¸ì¤Ï»ÈÍÑÉÔ²Äǽ¤Ç¤¹: ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë̵¸ú¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: ¥¢¥é¥Ó¥¢¸ì¤Ï»ÈÍÑÉÔ²Äǽ¤Ç¤¹: ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë̵¸ú¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ¤½¤Î¤è¤¦¤Ê̾¤Î¥Ï¥¤¥é¥¤¥È¥°¥ë¡¼¥×¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: ¤Þ¤À¥Æ¥­¥¹¥È¤¬ÁÞÆþ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: °ÊÁ°¤Ë¥³¥Þ¥ó¥É¹Ô¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: ¤½¤Î¤è¤¦¤Ê¥Þ¥Ã¥Ô¥ó¥°¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: ³ºÅö¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: ³ºÅö¤Ï¤¢¤ê¤Þ¤»¤ó: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: ¥Õ¥¡¥¤¥ë̾¤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Àµµ¬É½¸½ÃÖ´¹¤¬¤Þ¤À¼Â¹Ô¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: ¥³¥Þ¥ó¥É¤¬¤Þ¤À¼Â¹Ô¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: Àµµ¬É½¸½¤¬¤Þ¤À¼Â¹Ô¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: ÈÏ°Ï»ØÄê¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: ½¼Ê¬¤ÊÍÆÎ̤¬¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: %s ¤È¤¤¤¦Ì¾Á°¤ÎÅÐÏ¿¤µ¤ì¤¿¥µ¡¼¥Ð¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: °ì»þ¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: ¥Õ¥¡¥¤¥ë \"%s\" ¤ò³«¤±¤Þ¤»¤ó"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: ¥Õ¥¡¥¤¥ë %s ¤òÆɹþ¤á¤Þ¤»¤ó"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: ºÇ¸å¤ÎÊѹ¹¤¬Êݸ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó (! ¤òÄɲäÇÊѹ¹¤òÇË´þ)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: °ú¿ô¤¬¶õ¤Ç¤¹"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: ¿ôÃͤ¬Í׵ᤵ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ¥¨¥é¡¼¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: ¥Ç¥£¥¹¥×¥ì¥¤¤ò³«¤±¤Þ¤»¤ó"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: ¥á¥â¥ê¤¬¿Ô¤­²Ì¤Æ¤Þ¤·¤¿!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "¥Ñ¥¿¡¼¥ó¤Ï¤ß¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: ¥Ñ¥¿¡¼¥ó¤Ï¤ß¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: °ú¿ô¤ÏÀµ¤ÎÃͤǤʤ±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÌá¤ì¤Þ¤»¤ó"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: ¥¨¥é¡¼¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: ³ºÅöʸ»úÎó¤¬ÇË»¤·¤Æ¤¤¤Þ¤¹"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: ÉÔÀµ¤ÊÀµµ¬É½¸½¥×¥í¥°¥é¥à¤Ç¤¹"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 'readonly' ¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹ (! ¤òÄɲäǾå½ñ¤­)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: ÆɼèÀìÍÑÊÑ¿ô \"%s\" ¤ËÀßÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ¥¨¥é¡¼¥Õ¥¡¥¤¥ë¤ÎÆɹþÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ¥µ¥ó¥É¥Ü¥Ã¥¯¥¹¤Ç¤Ïµö¤µ¤ì¤Þ¤»¤ó"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: ¤³¤³¤Ç¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤ÎÀßÄê¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Þ¤»¤ó"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: ̵¸ú¤Ê¥¹¥¯¥í¡¼¥ëÎ̤Ǥ¹"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell' ¥ª¥×¥·¥ç¥ó¤¬¶õ¤Ç¤¹"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: sign ¤Î¥Ç¡¼¥¿¤òÆɹþ¤á¤Þ¤»¤ó¤Ç¤·¤¿"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º»þ¥¨¥é¡¼¤Ç¤¹"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: ¥¿¥°¥¹¥¿¥Ã¥¯¤¬¶õ¤Ç¤¹"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: ¥³¥Þ¥ó¥É¤¬Ê£»¨¤¹¤®¤Þ¤¹"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: ̾Á°¤¬Ä¹¤¹¤®¤Þ¤¹"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: [ ¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: ¥Õ¥¡¥¤¥ë̾¤¬Â¿¤¹¤®¤Þ¤¹"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: ;ʬ¤Êʸ»ú¤¬¸å¤í¤Ë¤¢¤ê¤Þ¤¹"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: ̤ÃΤΥޡ¼¥¯"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ¥ï¥¤¥ë¥É¥«¡¼¥É¤òŸ³«¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' ¤Ï 'winminheight' ¤è¤ê¾®¤µ¤¯¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' ¤Ï 'winminwidth' ¤è¤ê¾®¤µ¤¯¤Ç¤­¤Þ¤»¤ó"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: ½ñ¹þ¤ßÃæ¤Î¥¨¥é¡¼"
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "¥¼¥í¥«¥¦¥ó¥È"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: ¥¹¥¯¥ê¥×¥È°Ê³°¤Ç<SID>¤¬»È¤ï¤ì¤Þ¤·¤¿"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: ̵¸ú¤Ê¼°¤ò¼õ¤±¼è¤ê¤Þ¤·¤¿"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Îΰ褬Êݸ¤ì¤Æ¤¤¤ë¤Î¤Ç, Êѹ¹¤Ç¤­¤Þ¤»¤ó"
diff --git a/src/po/ja.sjis.po b/src/po/ja.sjis.po
new file mode 100644
index 000000000..ae5c110c3
--- /dev/null
+++ b/src/po/ja.sjis.po
@@ -0,0 +1,6587 @@
+# Japanese translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# MURAOKA Taro <koron@tka.att.ne.jp>, 2001-4.
+# Last Change: 29-Apr-2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.2\n"
+"POT-Creation-Date: 2004-04-29 13:16+0900\n"
+"PO-Revision-Date: 2004-04-29 13:00+0900\n"
+"Last-Translator: MURAOKA Taro <koron@tka.att.ne.jp>\n"
+"Language-Team: MURAOKA Taro <koron@tka.att.ne.jp>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp932\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ƒoƒbƒtƒ@‚ð1‚‚à쬂ł«‚È‚¢‚Ì‚Å, I—¹‚µ‚Ü‚·..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ƒoƒbƒtƒ@‚ð쬂ł«‚È‚¢‚Ì‚Å, ‘¼‚Ì‚ðŽg—p‚µ‚Ü‚·..."
+
+#: buffer.c:805
+msgid "E515: No buffers were unloaded"
+msgstr "E515: ‰ð•ú‚³‚ꂽƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:807
+msgid "E516: No buffers were deleted"
+msgstr "E516: 휂³‚ꂽƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:809
+msgid "E517: No buffers were wiped out"
+msgstr "E517: ”jŠü‚³‚ꂽƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "1 ŒÂ‚̃oƒbƒtƒ@‚ª‰ð•ú‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d ŒÂ‚̃oƒbƒtƒ@‚ª‰ð•ú‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "1 ŒÂ‚̃oƒbƒtƒ@‚ªíœ‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d ŒÂ‚̃oƒbƒtƒ@‚ªíœ‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "1 ŒÂ‚̃oƒbƒtƒ@‚ª”jŠü‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d ŒÂ‚̃oƒbƒtƒ@‚ª”jŠü‚³‚ê‚Ü‚µ‚½"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: •ÏX‚³‚ꂽƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: ƒŠƒXƒg•\\Ž¦‚³‚ê‚éƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: ƒoƒbƒtƒ@ %ld ‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ÅŒã‚̃oƒbƒtƒ@‚ð‰z‚¦‚Ĉړ®‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ʼn‚̃oƒbƒtƒ@‚æ‚è‘O‚ւ͈ړ®‚Å‚«‚Ü‚¹‚ñ"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: ƒoƒbƒtƒ@ %ld ‚Ì•ÏX‚Í•Û‘¶‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ (! ‚Å•ÏX‚ð”jŠü)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ÅŒã‚̃oƒbƒtƒ@‚͉ð•ú‚Å‚«‚Ü‚¹‚ñ"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Œx: ƒtƒ@ƒCƒ‹–¼‚̃ŠƒXƒg‚ª’·‚·‚¬‚Ü‚·"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: ƒoƒbƒtƒ@ %ld ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: %s ‚É•¡”‚ÌŠY“–‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: %s ‚ÉŠY“–‚·‚éƒoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "s %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ‚±‚Ì–¼‘O‚̃oƒbƒtƒ@‚ÍŠù‚É‚ ‚è‚Ü‚·"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [•ÏX‚ ‚è]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[–¢•ÒW]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[Vƒtƒ@ƒCƒ‹]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[“ÇžƒGƒ‰[]"
+
+#: buffer.c:2726 fileio.c:2049
+msgid "[readonly]"
+msgstr "[“Çžê—p]"
+
+#: buffer.c:2747
+msgid "1 line --%d%%--"
+msgstr "1 s --%d%%--"
+
+#: buffer.c:2749
+msgid "%ld lines --%d%%--"
+msgstr "%ld s --%d%%--"
+
+#: buffer.c:2756
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "s %ld (‘S‘Ì %ld) --%d%%-- col "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[–³‘è]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "ƒwƒ‹ƒv"
+
+#: buffer.c:3463 screen.c:5038
+msgid "[help]"
+msgstr "[ƒwƒ‹ƒv]"
+
+#: buffer.c:3495 screen.c:5044
+msgid "[Preview]"
+msgstr "[ƒvƒŒƒrƒ…[]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "‘S‚Ä"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "––”ö"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "擪"
+
+#: buffer.c:4523
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# ƒoƒbƒtƒ@ƒŠƒXƒg:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[ƒGƒ‰[ƒŠƒXƒg]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[–³‘è]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ƒTƒCƒ“ ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s ‚̃TƒCƒ“:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " s=%ld Ž¯•ÊŽq=%d –¼‘O=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: %ld ˆÈã‚̃oƒbƒtƒ@‚Ídiff‚Å‚«‚Ü‚¹‚ñ"
+
+#: diff.c:709
+msgid "E97: Cannot create diffs"
+msgstr "E97: ·•ª‚ð쬂ł«‚Ü‚¹‚ñ "
+
+#: diff.c:814
+msgid "Patch file"
+msgstr "ƒpƒbƒ`ƒtƒ@ƒCƒ‹"
+
+#: diff.c:1065
+msgid "E98: Cannot read diff output"
+msgstr "E98: diff‚Ìo—Í‚ð“Çž‚ß‚Ü‚¹‚ñ"
+
+#: diff.c:1815
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Œ»Ý‚̃oƒbƒtƒ@‚Í·•ªƒ‚[ƒh‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: diff.c:1827
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: ·•ªƒ‚[ƒh‚Å‚ ‚鑼‚̃oƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: diff.c:1835
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: ·•ªƒ‚[ƒh‚̃oƒbƒtƒ@‚ª2ŒÂˆÈã‚ ‚é‚Ì‚ÅA‚Ç‚ê‚ðŽg‚¤‚©“Á’è‚Å‚«‚Ü‚¹‚ñ"
+
+#: diff.c:1858
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: ƒoƒbƒtƒ@ \"%s\" ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: diff.c:1864
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: ƒoƒbƒtƒ@ \"%s\" ‚Í·•ªƒ‚[ƒh‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: ‡Žš‚ÉEscape‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: ƒL[ƒ}ƒbƒvƒtƒ@ƒCƒ‹‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: :source ‚ÅŽæž‚Þƒtƒ@ƒCƒ‹ˆÈŠO‚Å‚Í :loadkeymap ‚ðŽg‚¦‚Ü‚¹‚ñ"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " ƒL[ƒ[ƒh•âŠ® (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X ƒ‚[ƒh (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " ‹ÇŠƒL[ƒ[ƒh•âŠ® (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " s(‘S‘Ì)•âŠ® (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr "ƒtƒ@ƒCƒ‹–¼•âŠ® (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " ƒ^ƒO•âŠ® (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " ƒpƒXƒpƒ^[ƒ“•âŠ® (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " ’è‹`•âŠ® (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Ž«‘•âŠ® (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " ƒVƒ\\[ƒ‰ƒX•âŠ® (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“•âŠ® (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "’i—Ž‚ÌÅŒã‚Ƀqƒbƒg"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus' ƒIƒvƒVƒ‡ƒ“‚ª‹ó‚Å‚·"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "'dictionary' ƒIƒvƒVƒ‡ƒ“‚ª‹ó‚Å‚·"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Ž«‘‚ðƒXƒLƒƒƒ“’†: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (‘}“ü) ƒXƒNƒ[ƒ‹(^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (’uŠ·) ƒXƒNƒ[ƒ‹ (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "ƒXƒLƒƒƒ“’†: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "ƒ^ƒO‚ðƒXƒLƒƒƒ“’†."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " ’ljÁ’†"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- ŒŸõ’†..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Žn‚ß‚É–ß‚é"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "‘¼‚Ìs‚Ì’PŒê"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "—Bˆê‚ÌŠY“–"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "%d ”Ô–Ú‚ÌŠY“– (‘SŠY“– %d ŒÂ’†)"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "%d ”Ô–Ú‚ÌŠY“–"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: –¢’m‚Ì•Ï”: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ƒJƒbƒR '(' ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: ‚»‚Ì•Ï”‚Í‚ ‚è‚Ü‚¹‚ñ: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' ‚ÌŒã‚É ':' ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: ')' ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: ']' ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ƒIƒvƒVƒ‡ƒ“–¼‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: –¢’m‚̃IƒvƒVƒ‡ƒ“‚Å‚·: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: ˆø—p•„ (\") ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ˆø—p•„ (') ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: ŠÖ” %s ‚É‚Í–³Œø‚Ȉø”‚Å‚·"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: –¢’m‚ÌŠÖ”‚Å‚·: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: ŠÖ”‚̈ø”‚ª‘½‚·‚¬‚Ü‚·: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: ŠÖ”‚̈ø”‚ª‘«‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: ƒXƒNƒŠƒvƒgˆÈŠO‚Å<SID>‚ªŽg‚í‚ê‚Ü‚µ‚½: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4376 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld s:"
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"Œˆ’è(&O)\n"
+"ƒLƒƒƒ“ƒZƒ‹(&C)"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "inputrestore() ‚ª inputsave() ‚æ‚è‚à‘½‚­ŒÄ‚΂ê‚Ü‚µ‚½"
+
+# Added at 10-Mar-2004.
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: ƒVƒ“ƒ{ƒŠƒbƒNƒŠƒ“ƒN‚ª‘½‰ß‚¬‚Ü‚· (zŠÂ‚µ‚Ä‚¢‚é‰Â”\\«‚ª‚ ‚è‚Ü‚·)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Vim ƒT[ƒo‚Ö‚ÌÚ‘±‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ƒT[ƒo‚̉ž“š‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: ƒNƒ‰ƒCƒAƒ“ƒg‚Ö‘—‚邱‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: %s ‚Ö‘—‚邱‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(–³Œø)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: –¢’è‹`‚Ì•Ï”‚Å‚·: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: •s³‚È•Ï”–¼‚Å‚·: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: ŠÖ” %s ‚Í’è‹`Ï‚Å‚·, Ä’è‹`‚·‚é‚É‚Í ! ‚ð’ljÁ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: –¢’è‹`‚ÌŠÖ”‚Å‚·: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: '(' ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: •s³‚Ȉø”‚Å‚·: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: :endfunction ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: ŠÖ” %s ‚ðÄ’è‹`‚Å‚«‚Ü‚¹‚ñ: Žg—p’†‚Å‚·"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: ŠÖ”–¼‚ª—v‹‚³‚ê‚Ü‚·"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: ŠÖ”–¼‚͑啶Žš‚ÅŽn‚Ü‚ç‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: –¢’è‹`‚ÌŠÖ”‚Å‚·: %s"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: ŠÖ” %s ‚ð휂ł«‚Ü‚¹‚ñ: Žg—p’†‚Å‚·"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: ŠÖ”ŒÄo‚Ì“ü‚êŽq”‚ª 'maxfuncdepth' ‚ð’´‚¦‚Ü‚µ‚½"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "%s ‚ðŽÀs’†‚Å‚·"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "%s ‚ª’†’f‚³‚ê‚Ü‚µ‚½"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ‚ª #%ld ‚ð•Ô‚µ‚Ü‚µ‚½"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ‚ª \"%s\" ‚ð•Ô‚µ‚Ü‚µ‚½"
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "%s ‚ÌŽÀs‚ðŒp‘±’†‚Å‚·"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: ŠÖ”ŠO‚É :return ‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: eval.c:9952
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ƒOƒ[ƒoƒ‹•Ï”:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, 16i” %02x, 8i” %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, 16i” %04x, 8i” %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, 16i” %08x, 8i” %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: s‚ð‚»‚êŽ©g‚ɂ͈ړ®‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 s‚ªˆÚ“®‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld s‚ªˆÚ“®‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld s‚ªƒtƒBƒ‹ƒ^ˆ—‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *ƒtƒBƒ‹ƒ^* autocommand‚ÍŒ»Ý‚̃oƒbƒtƒ@‚ð•ÏX‚µ‚Ä‚Í‚¢‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[ÅŒã‚Ì•ÏX‚ª•Û‘¶‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s s–Ú: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ƒGƒ‰[‚ª‘½‰ß‚¬‚é‚Ì‚Å, ˆÈ~‚̓XƒLƒbƒv‚µ‚Ü‚·"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "viminfoƒtƒ@ƒCƒ‹ \"%s\"%s%s%s ‚ð“Çž‚Ý’† "
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " î•ñ"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " ƒ}[ƒN"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " Ž¸”s"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: viminfoƒtƒ@ƒCƒ‹‚ª‘ž‚Ý‚Å‚«‚Ü‚¹‚ñ: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: viminfoƒtƒ@ƒCƒ‹ %s ‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñ!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "viminfoƒtƒ@ƒCƒ‹ \"%s\" ‚ð‘ž‚Ý’†"
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# ‚±‚Ì viminfo ƒtƒ@ƒCƒ‹‚Í Vim %s ‚É‚æ‚Á‚Ķ¬‚³‚ê‚Ü‚µ‚½.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# •ÏX‚·‚éÛ‚É‚Í\\•ª’ˆÓ‚µ‚Ä‚­‚¾‚³‚¢!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# ‚±‚̃tƒ@ƒCƒ‹‚ª‘‚©‚ꂽŽž‚Ì 'encoding' ‚Ì’l\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "•s³‚È擪•¶Žš‚Å‚·"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "•Ê–¼‚Å•Û‘¶"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: “¯‚¶–¼‘O‚̃tƒ@ƒCƒ‹‚ª‘¼‚̃oƒbƒtƒ@‚Å“Çž‚Ü‚ê‚Ä‚¢‚Ü‚·"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "ƒtƒ@ƒCƒ‹‚ð•”•ª“I‚É•Û‘¶‚µ‚Ü‚·‚©?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ƒoƒbƒtƒ@‚ð•”•ª“I‚É•Û‘¶‚·‚é‚É‚Í ! ‚ðŽg‚Á‚Ä‚­‚¾‚³‚¢"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Šù‘¶‚̃tƒ@ƒCƒ‹ \"%.*s\" ‚ðã‘‚«‚µ‚Ü‚·‚©?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ƒoƒbƒtƒ@ %ld ‚É‚Í–¼‘O‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ƒtƒ@ƒCƒ‹‚Í•Û‘¶‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½: 'write' ƒIƒvƒVƒ‡ƒ“‚É‚æ‚è–³Œø‚Å‚·"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" ‚É‚Í 'readonly' ƒIƒvƒVƒ‡ƒ“‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚·\n"
+"‹­§“I‚Éã‘‚«‚µ‚Ü‚·‚©?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "ƒtƒ@ƒCƒ‹‚ð•ÒW"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: autocommand‚ª—\\Šú‚¹‚¸V‚µ‚¢ƒoƒbƒtƒ@ %s ‚ð휂µ‚Ü‚µ‚½"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ”‚Å‚Í‚È‚¢ˆø”‚ª :z ‚É“n‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim‚ł̓VƒFƒ‹ƒRƒ}ƒ“ƒh‚ðŽg‚¦‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: ³‹K•\\Œ»‚Í•¶Žš‚Å‹æ؂邱‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "%s ‚É’uŠ·‚µ‚Ü‚·‚©? (y/n/a/q/l/^E/^Y)"
+
+#: ex_cmds.c:4270
+msgid "(Interrupted) "
+msgstr "(Š„ž‚Ü‚ê‚Ü‚µ‚½)"
+
+#: ex_cmds.c:4274
+msgid "1 substitution"
+msgstr "1 ‰ÓŠ’uŠ·‚µ‚Ü‚µ‚½"
+
+#: ex_cmds.c:4276
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld ‰ÓŠ’uŠ·‚µ‚Ü‚µ‚½"
+
+#: ex_cmds.c:4279
+msgid " on 1 line"
+msgstr " (Œv 1 s“à)"
+
+#: ex_cmds.c:4281
+#, c-format
+msgid " on %ld lines"
+msgstr " (Œv %ld s“à)"
+
+#: ex_cmds.c:4332
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ‚ðÄ‹A“I‚É‚ÍŽg‚¦‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:4367
+msgid "E148: Regular expression missing from global"
+msgstr "E148: globalƒRƒ}ƒ“ƒh‚ɳ‹K•\\Œ»‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:4416
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "ƒpƒ^[ƒ“‚ª‘S‚Ä‚Ìs‚ł݂‚©‚è‚Ü‚µ‚½: %s"
+
+#: ex_cmds.c:4497
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# ÅŒã‚É’uŠ·‚³‚ꂽ•¶Žš—ñ:\n"
+"$"
+
+#: ex_cmds.c:4598 ex_docmd.c:2011
+msgid "E478: Don't panic!"
+msgstr "E478: Q‚Ä‚È‚¢‚Å‚­‚¾‚³‚¢"
+
+#: ex_cmds.c:4650
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Žc”O‚Å‚·‚ª '%s' ‚̃wƒ‹ƒv‚ª %s ‚É‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:4653
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Žc”O‚Å‚·‚ª %s ‚ɂ̓wƒ‹ƒv‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:4687
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Žc”O‚Å‚·‚ªƒwƒ‹ƒvƒtƒ@ƒCƒ‹ \"%s\" ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:5170
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: ƒfƒBƒŒƒNƒgƒŠ‚Å‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: ex_cmds.c:5309
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ‘ž‚Ý—p‚É %s ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:5345
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: “Çž—p‚É %s ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+# Added at 29-Apr-2004.
+#: ex_cmds.c:5367
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: 1‚‚̌¾Œê‚̃wƒ‹ƒvƒtƒ@ƒCƒ‹‚É•¡”‚̃Gƒ“ƒR[ƒh‚ª¬Ý‚µ‚Ä‚¢‚Ü‚·: %s"
+
+#: ex_cmds.c:5445
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ƒ^ƒO \"%s\" ‚ªƒtƒ@ƒCƒ‹ %s ‚Éd•¡‚µ‚Ä‚¢‚Ü‚·"
+
+#: ex_cmds.c:5557
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: –¢’m‚ÌsignƒRƒ}ƒ“ƒh‚Å‚·: %s"
+
+#: ex_cmds.c:5577
+msgid "E156: Missing sign name"
+msgstr "E156: sign–¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:5623
+msgid "E612: Too many signs defined"
+msgstr "E612: sign‚Ì’è‹`‚ª‘½”Œ©‚‚©‚è‚Ü‚µ‚½"
+
+#: ex_cmds.c:5691
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: –³Œø‚Èsign‚̃eƒLƒXƒg‚Å‚·: %s"
+
+#: ex_cmds.c:5722 ex_cmds.c:5913
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: –¢’m‚Ìsign‚Å‚·: %s"
+
+#: ex_cmds.c:5771
+msgid "E159: Missing sign number"
+msgstr "E159: sign‚̔Ԇ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds.c:5853
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: –³Œø‚ȃoƒbƒtƒ@–¼‚Å‚·: %s"
+
+#: ex_cmds.c:5892
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: –³Œø‚ÈsignŽ¯•ÊŽq‚Å‚·: %ld"
+
+# Added at 27-Jan-2004.
+#: ex_cmds.c:5962
+msgid " (NOT FOUND)"
+msgstr " (‚݂‚©‚è‚Ü‚¹‚ñ)"
+
+#: ex_cmds.c:5964
+msgid " (not supported)"
+msgstr " (”ñƒTƒ|[ƒg)"
+
+#: ex_cmds.c:6063
+msgid "[Deleted]"
+msgstr "[íœÏ]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "ƒfƒoƒbƒOƒ‚[ƒh‚É“ü‚è‚Ü‚·. ‘±‚¯‚é‚É‚Í \"cont\" ‚Æ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "s %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "ƒRƒ}ƒ“ƒh: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "ƒuƒŒ[ƒNƒ|ƒCƒ“ƒg \"%s%s\" s %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ƒuƒŒ[ƒNƒ|ƒCƒ“ƒg‚ª‚݂‚©‚è‚Ü‚¹‚ñ: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "ƒuƒŒ[ƒNƒ|ƒCƒ“ƒg‚ª’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s s %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "•ÏX‚ð \"%.*s\" ‚É•Û‘¶‚µ‚Ü‚·‚©?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9356
+msgid "Untitled"
+msgstr "–³‘è"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ƒoƒbƒtƒ@ \"%s\" ‚Ì•ÏX‚Í•Û‘¶‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Œx: —\\Šú‚¹‚¸‘¼ƒoƒbƒtƒ@‚ÖˆÚ“®‚µ‚Ü‚µ‚½ (autocommands ‚𒲂ׂĂ­‚¾‚³‚¢)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: •ÒW‚·‚éƒtƒ@ƒCƒ‹‚Í1‚‚µ‚©‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: ʼn‚̃tƒ@ƒCƒ‹‚æ‚è‘O‚É‚Ís‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ÅŒã‚̃tƒ@ƒCƒ‹‚ð‰z‚¦‚ÄŒã‚É‚Ís‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: ‚»‚̃Rƒ“ƒpƒCƒ‰‚ɂ͑Ήž‚µ‚Ä‚¢‚Ü‚¹‚ñ: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "\"%s\" ‚ð \"%s\" ‚©‚猟õ’†"
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "\"%s\" ‚ðŒŸõ’†"
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "'runtimepath' ‚Ì’†‚ɂ݂͂‚©‚è‚Ü‚¹‚ñ: \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "VimƒXƒNƒŠƒvƒg‚ÌŽæž‚Ý"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "ƒfƒBƒŒƒNƒgƒŠ‚ÍŽæž‚ß‚Ü‚¹‚ñ: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "\"%s\" ‚ðŽæž‚ß‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "s %ld: \"%s\" ‚ðŽæž‚ß‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "\"%s\" ‚ðŽæž’†"
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "s %ld: %s ‚ðŽæž’†"
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "%s ‚ÌŽæž‚ðŠ®—¹"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Œx: s‹æØ‚ª•s³‚Å‚·. ^M ‚ª‚È‚¢‚Ì‚Å‚µ‚傤"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding ‚ªŽæžƒXƒNƒŠƒvƒgˆÈŠO‚ÅŽg—p‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish ‚ªŽæžƒXƒNƒŠƒvƒgˆÈŠO‚ÅŽg—p‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "%d ƒy[ƒW"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "ˆóü‚·‚éƒeƒLƒXƒg‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:3472
+msgid "Printing page %d (%d%%)"
+msgstr "ˆóü’†: ƒy[ƒW %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " ƒRƒs[ %d (‘S %d ’†)"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "ˆóü‚µ‚Ü‚µ‚½: %s"
+
+#: ex_cmds2.c:3549
+msgid "Printing aborted"
+msgstr "ˆóü‚ª’†Ž~‚³‚ê‚Ü‚µ‚½"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: PostScripto—̓tƒ@ƒCƒ‹‚Ì‘ž‚݃Gƒ‰[‚Å‚·"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: ƒtƒ@ƒCƒ‹ \"%s\" ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: PostScript‚̃Šƒ\\[ƒXƒtƒ@ƒCƒ‹ \"%s\" ‚ð“Çž‚ß‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: ƒtƒ@ƒCƒ‹ \"%s\" ‚Í PostScript ƒŠƒ\\[ƒXƒtƒ@ƒCƒ‹‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: ƒtƒ@ƒCƒ‹ \"%s\" ‚͑Ήž‚µ‚Ä‚¢‚È‚¢ PostScript ƒŠƒ\\[ƒXƒtƒ@ƒCƒ‹‚Å‚·"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: ƒŠƒ\\[ƒXƒtƒ@ƒCƒ‹ \"%s\" ‚̓o[ƒWƒ‡ƒ“‚ªˆÙ‚È‚è‚Ü‚·"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: PostScripto—Í—p‚̃tƒ@ƒCƒ‹‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: ƒtƒ@ƒCƒ‹ \"%s\" ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: PostScript‚̃Šƒ\\[ƒXƒtƒ@ƒCƒ‹ \"prolog.ps\" ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: PostScript‚̃Šƒ\\[ƒXƒtƒ@ƒCƒ‹ \"%s.ps\" ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: ƒ}ƒ‹ƒ`ƒoƒCƒg•¶Žš‚ðƒGƒ“ƒR[ƒh \"%s\" ‚Ö•ÏŠ·‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "ƒvƒŠƒ“ƒ^‚É‘—M’†..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: PostScriptƒtƒ@ƒCƒ‹‚̈óü‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "ˆóüƒWƒ‡ƒu‚ð‘—M‚µ‚Ü‚µ‚½."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Œ»Ý‚Ì %sŒ¾Œê: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Œ¾Œê‚ð \"%s\" ‚ÉÝ’è‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Exƒ‚[ƒh‚É“ü‚è‚Ü‚·. ƒm[ƒ}ƒ‹‚É–ß‚é‚É‚Í\"visual\"‚Æ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: ƒtƒ@ƒCƒ‹‚ÌI—¹ˆÊ’u"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: ƒRƒ}ƒ“ƒh‚ªÄ‹A“I‰ß‚¬‚Ü‚·"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: —áŠO‚ª•ß‘¨‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "Žæžƒtƒ@ƒCƒ‹‚ÌÅŒã‚Å‚·"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "ŠÖ”‚ÌÅŒã‚Å‚·"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: ƒ†[ƒU’è‹`ƒRƒ}ƒ“ƒh‚Ì‚ ‚¢‚Ü‚¢‚ÈŽg—p‚Å‚·"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: ƒGƒfƒBƒ^‚̃Rƒ}ƒ“ƒh‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:2030
+msgid "E493: Backwards range given"
+msgstr "E493: ‹t‚³‚܂͈̔͂ªŽw’肳‚ê‚Ü‚µ‚½"
+
+#: ex_docmd.c:2039
+msgid "Backwards range given, OK to swap"
+msgstr "‹t‚³‚܂͈̔͂ªŽw’肳‚ê‚Ü‚µ‚½, “ü‘Ö‚¦‚Ü‚·‚©?"
+
+#: ex_docmd.c:2162
+msgid "E494: Use w or w>>"
+msgstr "E494: w ‚à‚µ‚­‚Í w>> ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: ex_docmd.c:3788
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ‚±‚̃o[ƒWƒ‡ƒ“‚Å‚Í‚±‚̃Rƒ}ƒ“ƒh‚Í—˜—p‚Å‚«‚Ü‚¹‚ñ, ‚²‚ß‚ñ‚È‚³‚¢"
+
+#: ex_docmd.c:3991
+msgid "E172: Only one file name allowed"
+msgstr "E172: ƒtƒ@ƒCƒ‹–¼‚Í 1 ‚‚ɂµ‚Ä‚­‚¾‚³‚¢"
+
+#: ex_docmd.c:4571
+msgid "1 more file to edit. Quit anyway?"
+msgstr "•ÒW‚·‚ׂ«ƒtƒ@ƒCƒ‹‚ª 1 ŒÂ‚ ‚è‚Ü‚·‚ª, I—¹‚µ‚Ü‚·‚©?"
+
+#: ex_docmd.c:4574
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "•ÒW‚·‚ׂ«ƒtƒ@ƒCƒ‹‚ª‚ ‚Æ %d ŒÂ‚ ‚è‚Ü‚·‚ª, I—¹‚µ‚Ü‚·‚©?"
+
+#: ex_docmd.c:4581
+msgid "E173: 1 more file to edit"
+msgstr "E173: •ÒW‚·‚ׂ«ƒtƒ@ƒCƒ‹‚ª 1 ŒÂ‚ ‚è‚Ü‚·"
+
+#: ex_docmd.c:4583
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: •ÒW‚·‚ׂ«ƒtƒ@ƒCƒ‹‚ª‚ ‚Æ %ld ŒÂ‚ ‚è‚Ü‚·"
+
+#: ex_docmd.c:4678
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: ƒRƒ}ƒ“ƒh‚ªŠù‚É‚ ‚è‚Ü‚·: Ä’è‹`‚·‚é‚É‚Í ! ‚ð’ljÁ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: ex_docmd.c:4789
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" –¼‘O ˆø” ”ÍˆÍ •âŠ® ’è‹`"
+
+#: ex_docmd.c:4878
+msgid "No user-defined commands found"
+msgstr "ƒ†[ƒU’è‹`ƒRƒ}ƒ“ƒh‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: ex_docmd.c:4910
+msgid "E175: No attribute specified"
+msgstr "E175: ‘®«‚Í’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:4962
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ˆø”‚Ì”‚ª–³Œø‚Å‚·"
+
+#: ex_docmd.c:4977
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ƒJƒEƒ“ƒg‚ð2dŽw’è‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:4987
+msgid "E178: Invalid default value for count"
+msgstr "E178: ƒJƒEƒ“ƒg‚ÌÈ—ª’l‚ª–³Œø‚Å‚·"
+
+#: ex_docmd.c:5018
+msgid "E179: argument required for complete"
+msgstr "E179: •âŠ®‚Ì‚½‚߂̈ø”‚ª•K—v‚Å‚·"
+
+#: ex_docmd.c:5050
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: –³Œø‚ȕ⊮Žw’è‚Å‚·: %s"
+
+#: ex_docmd.c:5059
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: •âŠ®ˆø”‚̓JƒXƒ^ƒ€•âŠ®‚Å‚µ‚©Žg—p‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:5065
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: ƒJƒXƒ^ƒ€•âŠ®‚ɂ͈ø”‚Æ‚µ‚ÄŠÖ”‚ª•K—v‚Å‚·"
+
+#: ex_docmd.c:5076
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: –³Œø‚È‘®«‚Å‚·: %s"
+
+#: ex_docmd.c:5119
+msgid "E182: Invalid command name"
+msgstr "E182: –³Œø‚ȃRƒ}ƒ“ƒh–¼‚Å‚·"
+
+#: ex_docmd.c:5134
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: ƒ†[ƒU’è‹`ƒRƒ}ƒ“ƒh‚͉p‘啶Žš‚ÅŽn‚Ü‚ç‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:5205
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ‚»‚̃†[ƒU’è‹`ƒRƒ}ƒ“ƒh‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: ex_docmd.c:5666
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: ƒJƒ‰[ƒXƒL[ƒ€ %s ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:5674
+msgid "Greetings, Vim user!"
+msgstr "Vim Žg‚¢‚³‚ñA‚â‚ !"
+
+#: ex_docmd.c:6391
+msgid "Edit File in new window"
+msgstr "V‚µ‚¢ƒEƒBƒ“ƒhƒE‚Ńtƒ@ƒCƒ‹‚ð•ÒW‚µ‚Ü‚·"
+
+#: ex_docmd.c:6686
+msgid "No swap file"
+msgstr "ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:6790
+msgid "Append File"
+msgstr "’ljÁƒtƒ@ƒCƒ‹"
+
+#: ex_docmd.c:6854
+msgid "E186: No previous directory"
+msgstr "E186: ‘O‚̃fƒBƒŒƒNƒgƒŠ‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:6936
+msgid "E187: Unknown"
+msgstr "E187: –¢’m"
+
+#: ex_docmd.c:7021
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: "
+
+#: ex_docmd.c:7077
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "ƒEƒBƒ“ƒhƒEˆÊ’u: X %d, Y %d"
+
+#: ex_docmd.c:7082
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: ‚±‚̃vƒ‰ƒbƒgƒz[ƒ€‚ɂ̓EƒBƒ“ƒhƒEˆÊ’u‚̎擾‹@”\\‚ÍŽÀ‘•‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:7092
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos ‚É‚Í2‚‚̔’l‚̈ø”‚ª•K—v‚Å‚·"
+
+#: ex_docmd.c:7370
+msgid "Save Redirection"
+msgstr "ƒŠƒ_ƒCƒŒƒNƒg‚ð•Û‘¶‚µ‚Ü‚·"
+
+#: ex_docmd.c:7560
+msgid "Save View"
+msgstr "ƒrƒ…[‚ð•Û‘¶‚µ‚Ü‚·"
+
+#: ex_docmd.c:7561
+msgid "Save Session"
+msgstr "ƒZƒbƒVƒ‡ƒ“î•ñ‚ð•Û‘¶‚µ‚Ü‚·"
+
+#: ex_docmd.c:7563
+msgid "Save Setup"
+msgstr "Ý’è‚ð•Û‘¶‚µ‚Ü‚·"
+
+#: ex_docmd.c:7715
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ‚ª‘¶Ý‚µ‚Ü‚· (ã‘‚·‚é‚É‚Í ! ‚ð’ljÁ‚µ‚Ä‚­‚¾‚³‚¢)"
+
+#: ex_docmd.c:7720
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: \"%s\" ‚ð‘ž‚Ý—p‚Æ‚µ‚ÄŠJ‚¯‚Ü‚¹‚ñ"
+
+#. set mark
+#: ex_docmd.c:7744
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: ˆø”‚Í•¶Žš‚©‘Oi/Œã‘ÞƒNƒH[ƒg‚Å‚µ‚È‚¯‚ê‚΂¢‚¯‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:7786
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal ‚ÌÄ‹A—˜—p‚ª[‚­‚È‚è‚·‚¬‚Ü‚µ‚½"
+
+#: ex_docmd.c:8304
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: '#'‚ð’u‚«Š·‚¦‚é•›ƒtƒ@ƒCƒ‹‚Ì–¼‘O‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8335
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: \"<afile>\"‚ð’u‚«Š·‚¦‚éautocommand‚̃tƒ@ƒCƒ‹–¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8343
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: \"<abuf>\"‚ð’u‚«Š·‚¦‚éautocommandƒoƒbƒtƒ@”Ô†‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8354
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: \"<amatch>\"‚ð’u‚«Š·‚¦‚éautocommand‚ÌŠY“––¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8364
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: \"<sfile>\"‚ð’u‚«Š·‚¦‚é :source ‘ÎÛƒtƒ@ƒCƒ‹–¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8405
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr ""
+"E499: '%' ‚â '#' ‚ª–³–¼ƒtƒ@ƒCƒ‹‚È‚Ì‚Å \":p:h\" ‚𔺂í‚È‚¢Žg‚¢•û‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:8407
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: ‹ó•¶Žš—ñ‚Æ‚µ‚Ä•]‰¿‚³‚ê‚Ü‚µ‚½"
+
+#: ex_docmd.c:9338
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: viminfoƒtƒ@ƒCƒ‹‚ð“Çž—p‚Æ‚µ‚ÄŠJ‚¯‚Ü‚¹‚ñ"
+
+#: ex_docmd.c:9511
+msgid "E196: No digraphs in this version"
+msgstr "E196: ‚±‚̃o[ƒWƒ‡ƒ“‚ɇŽš‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: 'Vim' ‚ÅŽn‚Ü‚é—áŠO‚Í :throw ‚Å‚«‚Ü‚¹‚ñ"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "—áŠO‚ª”­¶‚µ‚Ü‚µ‚½: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "—áŠO‚ªŽû‘©‚µ‚Ü‚µ‚½: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "—áŠO‚ª”jŠü‚³‚ê‚Ü‚µ‚½: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, s %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "—áŠO‚ª•ß‘¨‚³‚ê‚Ü‚µ‚½: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s ‚É‚æ‚è–¢Œˆ’èó‘Ô‚ª¶‚¶‚Ü‚µ‚½"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s ‚ªÄŠJ‚µ‚Ü‚µ‚½"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s ‚ª”jŠü‚³‚ê‚Ü‚µ‚½"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "—áŠO"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "ƒGƒ‰[‚ÆŠ„ž‚Ý"
+
+#: ex_eval.c:754 gui.c:4375
+msgid "Error"
+msgstr "ƒGƒ‰["
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Š„ž‚Ý"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if ‚Ì“ü‚êŽq‚ª[‰ß‚¬‚Ü‚·"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :if ‚Ì‚È‚¢ :endif ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :if ‚Ì‚È‚¢ :else ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :if ‚Ì‚È‚¢ :elseif ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: •¡”‚Ì :else ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :else ‚ÌŒã‚É :elseif ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: :while ‚Ì“ü‚êŽq‚ª[‚­‰ß‚¬‚Ü‚·"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :while ‚Ì‚È‚¢ :continue ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :while ‚Ì‚È‚¢ :break ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: :try ‚Ì“ü‚êŽq‚ª[‰ß‚¬‚Ü‚·"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :try ‚Ì‚È‚¢ :catch ‚ª‚ ‚è‚Ü‚·"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :finally ‚ÌŒã‚É :catch ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :try ‚Ì‚È‚¢ :finally ‚ª‚ ‚è‚Ü‚·"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: •¡”‚Ì :finalyy ‚ª‚ ‚è‚Ü‚·"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :try ‚Ì‚È‚¢ :endtry ‚Å‚·"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: ŠÖ”‚ÌŠO‚É :endfunction ‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: ex_getln.c:3295
+msgid "tagname"
+msgstr "ƒ^ƒO–¼"
+
+#: ex_getln.c:3298
+msgid " kind file\n"
+msgstr " ƒtƒ@ƒCƒ‹Ží—Þ\n"
+
+#: ex_getln.c:4751
+msgid "'history' option is zero"
+msgstr "ƒIƒvƒVƒ‡ƒ“ 'history' ‚ªƒ[ƒ‚Å‚·"
+
+#: ex_getln.c:5017
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s €–Ú‚Ì—š—ð (V‚µ‚¢‚à‚Ì‚©‚çŒÃ‚¢‚à‚Ì‚Ö):\n"
+
+#: ex_getln.c:5018
+msgid "Command Line"
+msgstr "ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“"
+
+#: ex_getln.c:5019
+msgid "Search String"
+msgstr "ŒŸõ•¶Žš—ñ"
+
+#: ex_getln.c:5020
+msgid "Expression"
+msgstr "Ž®"
+
+#: ex_getln.c:5021
+msgid "Input Line"
+msgstr "“ü—Ís"
+
+#: ex_getln.c:5059
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ‚ªƒRƒ}ƒ“ƒh’·‚ð’´‚¦‚Ü‚µ‚½"
+
+#: ex_getln.c:5236
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: ƒAƒNƒeƒBƒu‚ȃEƒBƒ“ƒhƒE‚©ƒoƒbƒtƒ@‚ªíœ‚³‚ê‚Ü‚µ‚½"
+
+#: fileio.c:371
+msgid "Illegal file name"
+msgstr "•s³‚ȃtƒ@ƒCƒ‹–¼"
+
+#: fileio.c:395 fileio.c:529 fileio.c:2850 fileio.c:2891
+msgid "is a directory"
+msgstr " ‚̓fƒBƒŒƒNƒgƒŠ‚Å‚·"
+
+#: fileio.c:397
+msgid "is not a file"
+msgstr " ‚̓tƒ@ƒCƒ‹‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: fileio.c:551 fileio.c:4057
+msgid "[New File]"
+msgstr "[Vƒtƒ@ƒCƒ‹]"
+
+#: fileio.c:584
+msgid "[Permission Denied]"
+msgstr "[”F‰Â‚ª‚ ‚è‚Ü‚¹‚ñ]"
+
+#: fileio.c:688
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre autocommand ‚ªƒtƒ@ƒCƒ‹‚ð“Çž•s‰Â‚É‚µ‚Ü‚µ‚½"
+
+#: fileio.c:690
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre autocommand ‚ÍŒ»Ý‚̃oƒbƒtƒ@‚ð•Ï‚¦‚ç‚ê‚Ü‚¹‚ñ"
+
+#: fileio.c:711
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: •W€“ü—Í‚©‚ç“Çž’†...\n"
+
+#: fileio.c:717
+msgid "Reading from stdin..."
+msgstr "•W€“ü—Í‚©‚ç“Çž‚Ý’†..."
+
+#. Re-opening the original file failed!
+#: fileio.c:988
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: •ÏŠ·‚ªƒtƒ@ƒCƒ‹‚ð“Çž•s‰Â‚É‚µ‚Ü‚µ‚½"
+
+#: fileio.c:2027
+msgid "[fifo/socket]"
+msgstr "[FIFO/ƒ\\ƒPƒbƒg]"
+
+#: fileio.c:2034
+msgid "[fifo]"
+msgstr "[FIFO]"
+
+#: fileio.c:2041
+msgid "[socket]"
+msgstr "[ƒ\\ƒPƒbƒg]"
+
+#: fileio.c:2049
+msgid "[RO]"
+msgstr "[“Çê]"
+
+#: fileio.c:2059
+msgid "[CR missing]"
+msgstr "[CR–³]"
+
+#: fileio.c:2064
+msgid "[NL found]"
+msgstr "[NL—L]"
+
+#: fileio.c:2069
+msgid "[long lines split]"
+msgstr "[’·s•ªŠ„]"
+
+#: fileio.c:2075 fileio.c:4041
+msgid "[NOT converted]"
+msgstr "[–¢•ÏŠ·]"
+
+#: fileio.c:2080 fileio.c:4046
+msgid "[converted]"
+msgstr "[•ÏŠ·Ï]"
+
+#: fileio.c:2087 fileio.c:4071
+msgid "[crypted]"
+msgstr "[ˆÃ†‰»]"
+
+#: fileio.c:2094
+msgid "[CONVERSION ERROR]"
+msgstr "[•ÏŠ·ƒGƒ‰[]"
+
+#: fileio.c:2100
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[%ld s–Ú‚Ì•s³‚ȃoƒCƒg]"
+
+#: fileio.c:2107
+msgid "[READ ERRORS]"
+msgstr "[“ÇžƒGƒ‰[]"
+
+#: fileio.c:2323
+msgid "Can't find temp file for conversion"
+msgstr "•ÏŠ·‚É•K—v‚Ȉꎞƒtƒ@ƒCƒ‹‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: fileio.c:2330
+msgid "Conversion with 'charconvert' failed"
+msgstr "'charconvert' ‚É‚æ‚é•ÏŠ·‚ªŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: fileio.c:2333
+msgid "can't read output of 'charconvert'"
+msgstr "'charconvert' ‚Ìo—Í‚ð“Çž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: fileio.c:2733
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: •Û‘¶‚·‚éƒoƒbƒtƒ@‚ðautocommand‚ªíœ‚©‰ð•ú‚µ‚Ü‚µ‚½"
+
+#: fileio.c:2756
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: autocommand‚ª—\\Šú‚¹‚Ê•û–@‚Ås”‚ð•ÏX‚µ‚Ü‚µ‚½"
+
+# Added at 19-Jan-2004.
+#: fileio.c:2794
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans‚Í–¢•ÏX‚̃oƒbƒtƒ@‚ðã‘‚·‚邱‚Æ‚Í‹–‰Â‚µ‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: fileio.c:2802
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "NetBeansƒoƒbƒtƒ@‚̈ꕔ‚ð‘‚«o‚·‚±‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: fileio.c:2856 fileio.c:2874
+msgid "is not a file or writable device"
+msgstr "‚̓tƒ@ƒCƒ‹‚Å‚à‘ž‚݉”\\ƒfƒoƒCƒX‚Å‚à‚ ‚è‚Ü‚¹‚ñ"
+
+#: fileio.c:2926
+msgid "is read-only (add ! to override)"
+msgstr "‚Í“Çžê—p‚Å‚· (‹­§‘ž‚É‚Í ! ‚ð’ljÁ)"
+
+#: fileio.c:3272
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: ƒoƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å‹­§•Û‘¶)"
+
+#: fileio.c:3284
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr ""
+"E507: ƒoƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹‚ð•Â‚¶‚éۂɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½ (! ‚ð’ljÁ‚Å‹­§)"
+
+#: fileio.c:3286
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: ƒoƒbƒNƒAƒbƒv—pƒtƒ@ƒCƒ‹‚ð“Çž‚ß‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å‹­§“Çž)"
+
+#: fileio.c:3302
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: ƒoƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹‚ðì‚ê‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å‹­§ì¬)"
+
+#: fileio.c:3405
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: ƒoƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹‚ðì‚ê‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å‹­§ì¬)"
+
+#: fileio.c:3467
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: ƒŠƒ\\[ƒXƒtƒH[ƒN‚ªŽ¸‚í‚ê‚é‚©‚à‚µ‚ê‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å‹­§)"
+
+#: fileio.c:3566
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: •Û‘¶—pˆêŽžƒtƒ@ƒCƒ‹‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: fileio.c:3584
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: •ÏŠ·‚Å‚«‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å•ÏŠ·‚¹‚¸‚É•Û‘¶)"
+
+#: fileio.c:3619
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ƒŠƒ“ƒN‚³‚ꂽƒtƒ@ƒCƒ‹‚É‘ž‚ß‚Ü‚¹‚ñ"
+
+#: fileio.c:3623
+msgid "E212: Can't open file for writing"
+msgstr "E212: ‘ž‚Ý—p‚Ƀtƒ@ƒCƒ‹‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: fileio.c:3885
+msgid "E667: Fsync failed"
+msgstr "E667: fsync ‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: fileio.c:3892
+msgid "E512: Close failed"
+msgstr "E512: •Â‚¶‚邱‚Æ‚ÉŽ¸”s"
+
+#: fileio.c:3963
+msgid "E513: write error, conversion failed"
+msgstr "E513: ‘ž‚݃Gƒ‰[, •ÏŠ·Ž¸”s"
+
+#: fileio.c:3969
+msgid "E514: write error (file system full?)"
+msgstr "E514: ‘ž‚݃Gƒ‰[, (ƒtƒ@ƒCƒ‹ƒVƒXƒeƒ€‚ª–ž”t?)"
+
+#: fileio.c:4036
+msgid " CONVERSION ERROR"
+msgstr " •ÏŠ·ƒGƒ‰["
+
+#: fileio.c:4052
+msgid "[Device]"
+msgstr "[ƒfƒoƒCƒX]"
+
+#: fileio.c:4057
+msgid "[New]"
+msgstr "[V]"
+
+#: fileio.c:4079
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4079
+msgid " appended"
+msgstr " ’ljÁ"
+
+#: fileio.c:4081
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4081
+msgid " written"
+msgstr " ‘ž‚Ý"
+
+#: fileio.c:4131
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: Œ´–{ƒtƒ@ƒCƒ‹‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñ"
+
+#: fileio.c:4153
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: ‹ó‚ÌŒ´–{ƒtƒ@ƒCƒ‹‚ðtouch‚Å‚«‚Ü‚¹‚ñ"
+
+#: fileio.c:4168
+msgid "E207: Can't delete backup file"
+msgstr "E207: ƒoƒbƒNƒAƒbƒvƒtƒ@ƒCƒ‹‚ðÁ‚¹‚Ü‚¹‚ñ"
+
+#: fileio.c:4232
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"Œx: Œ´–{ƒtƒ@ƒCƒ‹‚ªŽ¸‚í‚ꂽ‚©•ÏX‚³‚ê‚Ü‚µ‚½\n"
+
+#: fileio.c:4234
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ƒtƒ@ƒCƒ‹‚Ì•Û‘¶‚ɬŒ÷‚·‚é‚܂ŃGƒfƒBƒ^‚ðI—¹‚µ‚È‚¢‚Å‚­‚¾‚³‚¢!"
+
+#: fileio.c:4323
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4323
+msgid "[dos format]"
+msgstr "[dosƒtƒH[ƒ}ƒbƒg]"
+
+#: fileio.c:4330
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4330
+msgid "[mac format]"
+msgstr "[macƒtƒH[ƒ}ƒbƒg]"
+
+#: fileio.c:4337
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4337
+msgid "[unix format]"
+msgstr "[unixƒtƒH[ƒ}ƒbƒg]"
+
+#: fileio.c:4364
+msgid "1 line, "
+msgstr "1 s, "
+
+#: fileio.c:4366
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld s, "
+
+#: fileio.c:4369
+msgid "1 character"
+msgstr "1 •¶Žš"
+
+#: fileio.c:4371
+#, c-format
+msgid "%ld characters"
+msgstr "%ld •¶Žš"
+
+#: fileio.c:4381
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4381
+msgid "[Incomplete last line]"
+msgstr "[ÅIs‚ª•sŠ®‘S]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4400
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "Œx: “Çž‚ñ‚¾Œã‚Ƀtƒ@ƒCƒ‹‚É•ÏX‚ª‚ ‚è‚Ü‚µ‚½!!!"
+
+#: fileio.c:4402
+msgid "Do you really want to write to it"
+msgstr "–{“–‚Éã‘‚«‚µ‚Ü‚·‚©"
+
+#: fileio.c:5566
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: \"%s\" ‚ð‘ž‚Ý’†‚̃Gƒ‰[‚Å‚·"
+
+#: fileio.c:5573
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: \"%s\" ‚ð•Â‚¶‚鎞‚ɃGƒ‰[‚Å‚·"
+
+#: fileio.c:5576
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: \"%s\" ‚ð“Çž’†‚̃Gƒ‰[‚Å‚·"
+
+#: fileio.c:5810
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: autocommand ‚Ì FileChangedShell ‚ªƒoƒbƒtƒ@‚ð휂µ‚Ü‚µ‚½"
+
+#: fileio.c:5817
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Œx: ƒtƒ@ƒCƒ‹ \"%s\" ‚ÍŠù‚É‘¶Ý‚µ‚Ü‚¹‚ñ"
+
+#: fileio.c:5831
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: Œx: ƒtƒ@ƒCƒ‹ \"%s\" ‚ª•ÏX‚³‚êVim‚̃oƒbƒtƒ@‚à•ÏX‚³‚ê‚Ü‚µ‚½"
+
+#: fileio.c:5834
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Œx: ƒtƒ@ƒCƒ‹ \"%s\" ‚Í•ÒWŠJŽnŒã‚É•ÏX‚³‚ê‚Ü‚µ‚½"
+
+#: fileio.c:5836
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Œx: ƒtƒ@ƒCƒ‹ \"%s\" ‚̃‚[ƒh‚ª•ÒWŠJŽnŒã‚É•ÏX‚³‚ê‚Ü‚µ‚½"
+
+#: fileio.c:5846
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Œx: ƒtƒ@ƒCƒ‹ \"%s\" ‚Í•ÒWŠJŽnŒã‚É쬂³‚ê‚Ü‚µ‚½"
+
+#: fileio.c:5859
+msgid "See \":help W11\" for more info."
+msgstr "Ú×‚Í \":help W11\" ‚ðŽQÆ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: fileio.c:5873
+msgid "Warning"
+msgstr "Œx"
+
+#: fileio.c:5874
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"ƒtƒ@ƒCƒ‹“Çž(&L)"
+
+#: fileio.c:5980
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: \"%s\" ‚ðƒŠƒ[ƒh‚·‚途õ‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: fileio.c:5999
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: \"%s\" ‚̓Šƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: fileio.c:6580
+msgid "--Deleted--"
+msgstr "--íœÏ--"
+
+#. the group doesn't exist
+#: fileio.c:6740
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: ‚»‚̃Oƒ‹[ƒv‚Í‚ ‚è‚Ü‚¹‚ñ: \"%s\""
+
+#: fileio.c:6866
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * ‚ÌŒã‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚µ‚½: %s"
+
+#: fileio.c:6878
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ‚»‚̂悤‚ȃCƒxƒ“ƒg‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: fileio.c:6880
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: ‚»‚̂悤‚ȃOƒ‹[ƒv‚à‚µ‚­‚̓Cƒxƒ“ƒg‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#. Highlight title
+#: fileio.c:7038
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:7309
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: ‘S‚ẴCƒxƒ“ƒg‚ɑ΂µ‚Ä‚Ìautocommand‚ÍŽÀs‚Å‚«‚Ü‚¹‚ñ"
+
+#: fileio.c:7332
+msgid "No matching autocommands"
+msgstr "ŠY“–‚·‚éautocommand‚Í‘¶Ý‚µ‚Ü‚¹‚ñ"
+
+#: fileio.c:7653
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand‚Ì“ü‚êŽq‚ª[‚·‚¬‚Ü‚·"
+
+#: fileio.c:7928
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands for \"%s\""
+
+#: fileio.c:7936
+#, c-format
+msgid "Executing %s"
+msgstr "%s ‚ðŽÀs‚µ‚Ä‚¢‚Ü‚·"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8004
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:8571
+msgid "E219: Missing {."
+msgstr "E219: { ‚ª‚ ‚è‚Ü‚¹‚ñ."
+
+#: fileio.c:8573
+msgid "E220: Missing }."
+msgstr "E220: } ‚ª‚ ‚è‚Ü‚¹‚ñ."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Üô‚Ý‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Œ»Ý‚Ì 'foldmethod' ‚Å‚ÍÜô‚Ý‚ð쬂ł«‚Ü‚¹‚ñ"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Œ»Ý‚Ì 'foldmethod' ‚Å‚ÍÜô‚Ý‚ð휂ł«‚Ü‚¹‚ñ"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: “Çžƒoƒbƒtƒ@‚֒ljÁ"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: Ä‹A“Iƒ}ƒbƒsƒ“ƒO"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s ‚Æ‚¢‚¤ƒOƒ[ƒoƒ‹’Zk“ü—Í‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s ‚Æ‚¢‚¤ƒOƒ[ƒoƒ‹ƒ}ƒbƒsƒ“ƒO‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ‚Æ‚¢‚¤’Zk“ü—Í‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s ‚Æ‚¢‚¤ƒ}ƒbƒsƒ“ƒO‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "’Zk“ü—݂͂͂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "ƒ}ƒbƒsƒ“ƒO‚݂͂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: •s³‚ȃ‚[ƒh"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: GUI‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: \"%s\"‚©‚ç“Çž‚Þ‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: —LŒø‚ȃtƒHƒ“ƒg‚ªŒ©‚‚©‚ç‚È‚¢‚Ì‚Å, GUI‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ‚ª–³Œø‚Å‚·"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: 'imactivatekey' ‚Éݒ肳‚ꂽ’l‚ª–³Œø‚Å‚·"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: %s ‚ÌF‚ðŠ„‚è“–‚Ä‚ç‚ê‚Ü‚¹‚ñ"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<ŠJ‚¯‚Ü‚¹‚ñ>"
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ƒtƒHƒ“ƒg %s ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: Œ»Ý‚̃fƒBƒŒƒNƒgƒŠ‚É–ß‚ê‚Ü‚¹‚ñ"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "ƒpƒX–¼:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: Œ»Ý‚̃fƒBƒŒƒNƒgƒŠ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "ƒLƒƒƒ“ƒZƒ‹"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "ƒXƒNƒ[ƒ‹ƒo[: ‰æ‘œ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½."
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Vim ƒ_ƒCƒAƒƒO"
+
+#: gui_beval.c:101 gui_w32.c:3830
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ƒƒbƒZ[ƒW‚ƃR[ƒ‹ƒoƒbƒN‚Ì‚ ‚é BalloonEval ‚ð쬂ł«‚Ü‚¹‚ñ"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Vim ƒ_ƒCƒAƒƒO..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"‚Í‚¢(&Y)\n"
+"‚¢‚¢‚¦(&N)\n"
+"ƒLƒƒƒ“ƒZƒ‹(&C)"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "ƒCƒ“ƒvƒbƒgƒƒ\\ƒbƒh"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ŒŸõ‚Æ’uŠ·..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - ŒŸõ..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "ŒŸõ•¶Žš—ñ:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "’uŠ·•¶Žš—ñ:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "³Šm‚ÉŠY“–‚·‚é‚à‚Ì‚¾‚¯"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "‘啶Žš/¬•¶Žš‚ð‹æ•Ê‚·‚é"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "•ûŒü"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "ã"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "‰º"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "ŽŸ‚ðŒŸõ"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "’uŠ·"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "‘S‚Ä’uŠ·"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: ƒZƒbƒVƒ‡ƒ“ƒ}ƒl[ƒWƒƒ‚©‚ç \"die\" —v‹‚ðŽó‚¯Žæ‚è‚Ü‚µ‚½\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚ª•sˆÓ‚É”j‰ó‚³‚ê‚Ü‚µ‚½\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "ƒtƒHƒ“ƒg‘I‘ð"
+
+#: gui_gtk_x11.c:6035 ui.c:2117
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "‹ó‚Ì‘I‘ð—̈æ‚Ì‚©‚í‚è‚ÉCUT_BUFFER0‚ªŽg—p‚³‚ê‚Ü‚µ‚½"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "ƒtƒBƒ‹ƒ^"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "ƒfƒBƒŒƒNƒgƒŠ"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "ƒwƒ‹ƒv"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "ƒtƒ@ƒCƒ‹"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "‘I‘ð"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "ƒAƒ“ƒhƒD"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: ZapƒtƒHƒ“ƒg '%s' ‚ð“Çž‚ß‚Ü‚¹‚ñ"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: ƒtƒHƒ“ƒg %s ‚ðŽg—p‚Å‚«‚Ü‚¹‚ñ"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ŽqƒvƒƒZƒX‚Ö’âŽ~ƒƒbƒZ[ƒW‚ð‘—M’†‚Å‚·.\n"
+
+#: gui_w32.c:830
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ˆø”‚̓Tƒ|[ƒg‚³‚ê‚Ü‚¹‚ñ: \"-%s\"; OLE”Å‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "ŒŸõ•¶Žš—ñ ('\\' ‚ðŒŸõ‚·‚é‚É‚Í '\\\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "ŒŸõE’uŠ· ('\\' ‚ðŒŸõ‚·‚é‚É‚Í '\\\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: FŽw’肪³‚µ‚­‚È‚¢‚̂ŃGƒ“ƒgƒŠ‚ðŠ„‚è“–‚Ä‚ç‚ê‚Ü‚¹‚ñ"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: ˆÈ‰º‚Ì•¶ŽšƒZƒbƒg‚̃tƒHƒ“ƒg‚ª‚ ‚è‚Ü‚¹‚ñ %s:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ƒtƒHƒ“ƒgƒZƒbƒg–¼: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "ƒtƒHƒ“ƒg '%s' ‚͌Œ蕂ł͂ ‚è‚Ü‚¹‚ñ"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ƒtƒHƒ“ƒgƒZƒbƒg–¼: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "ƒtƒHƒ“ƒg0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "ƒtƒHƒ“ƒg1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "ƒtƒHƒ“ƒg%d ‚Ì•‚ªƒtƒHƒ“ƒg0‚Ì”{‚Å‚Í‚ ‚è‚Ü‚¹‚ñ\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "ƒtƒHƒ“ƒg0‚Ì•: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"ƒtƒHƒ“ƒg1‚Ì•: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ƒnƒ“ƒOƒ‹ƒI[ƒgƒ}ƒgƒ“ƒGƒ‰["
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Vƒf[ƒ^ƒx[ƒX‚ð’ljÁ"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "ƒpƒ^[ƒ“‚̃NƒGƒŠ[‚ð’ljÁ"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "‚±‚̃ƒbƒZ[ƒW‚ð•\\Ž¦‚·‚é"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Ú‘±‚ðI—¹‚·‚é"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "‘S‚Ä‚ÌÚ‘±‚ðĉŠú‰»‚·‚é"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Ú‘±‚ð•\\Ž¦‚·‚é"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Žg—p•û–@: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "‚±‚ÌcscopeƒRƒ}ƒ“ƒh‚Í•ªŠ„ƒEƒBƒ“ƒhƒE‚ł̓Tƒ|[ƒg‚³‚ê‚Ü‚¹‚ñ.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Žg—p–@: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ƒ^ƒO‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) ƒGƒ‰[: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: stat ƒGƒ‰["
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s ‚̓fƒBƒŒƒNƒgƒŠ‹y‚Ñ—LŒø‚Ècscope‚̃f[ƒ^ƒx[ƒX‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "cscopeƒf[ƒ^ƒx[ƒX %s ‚ð’ljÁ"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: cscope‚ÌÚ‘± %ld ‚ð“Çž‚Ý’†‚̃Gƒ‰[‚Å‚·"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: –¢’m‚ÌcscopeŒŸõŒ^‚Å‚·"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: cscopeƒpƒCƒv‚ð쬂ł«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: cscope‚Ì‹N“®€”õ(fork)‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection ‚ÌŽÀs‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: cscopeƒvƒƒZƒX‚ð‹N“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: to_fp ‚Ì fdopen ‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fr_fp ‚Ì fdopen ‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: cscopeÚ‘±‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscopeƒNƒGƒŠ[ %s of %s ‚ÉŠY“–‚ª‚ ‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: –³Œø‚È cscopequickfix ƒtƒ‰ƒO %c ‚Ì %c ‚Å‚·"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "cscopeƒRƒ}ƒ“ƒh:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Žg—p–@: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: cscopeƒf[ƒ^ƒx[ƒX: %s ‚ðŠJ‚­‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: cscopeƒf[ƒ^ƒx[ƒX‚Ìî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: d•¡‚·‚écscopeƒf[ƒ^ƒx[ƒX‚͒ljÁ‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: cscopeÚ‘±‚Ìő唂ɒB‚µ‚Ü‚µ‚½"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscopeÚ‘± %s ‚ª‚݂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "cscopeÚ‘± %s ‚ª•Â‚¶‚ç‚ê‚Ü‚µ‚½"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: cs_manage_matches ‚Å’v–½“I‚ȃGƒ‰[‚Å‚·"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Cscope ƒ^ƒO: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # s”Ô†"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "ƒtƒ@ƒCƒ‹–¼ / •¶–¬ / s\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: cscopeƒGƒ‰[: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "‘S‚Ä‚Ìcscopeƒf[ƒ^ƒx[ƒX‚ðƒŠƒZƒbƒg‚µ‚Ü‚·"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "cscopeÚ‘±‚ª‚ ‚è‚Ü‚¹‚ñ\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid ƒf[ƒ^ƒx[ƒX–¼ prepend ƒpƒX\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: ‚±‚̃Rƒ}ƒ“ƒh‚Í–³Œø‚Å‚·,‚²‚ß‚ñ‚È‚³‚¢: "
+"Pythonƒ‰ƒCƒuƒ‰ƒŠ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½."
+
+# Added at 07-Feb-2004.
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Python ‚ðÄ‹A“I‚ÉŽÀs‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "OutputObject‘®«‚ðÁ‚¹‚Ü‚¹‚ñ"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace ‚Í integer ‚Å‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "–³Œø‚È‘®«‚Å‚·"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() ‚É‚Í•¶Žš—ñ‚̃ŠƒXƒg‚ª•K—v‚Å‚·"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: I/OƒIƒuƒWƒFƒNƒg‚̉Šú‰»’†‚ɃGƒ‰[‚Å‚·"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "–³Œø‚ÈŽ®‚Å‚·"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "Ž®‚̓Rƒ“ƒpƒCƒ‹Žž‚É–³Œø‚É‚³‚ê‚Ä‚¢‚Ü‚·"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "Á‚³‚ꂽƒoƒbƒtƒ@‚ªŽQÆ‚³‚ê‚Ü‚µ‚½"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "”͈͊O‚Ìs”Ô†‚Å‚·"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<ƒoƒbƒtƒ@ƒIƒuƒWƒFƒNƒg (Á‹ŽÏ‚Ý) %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "–³Œø‚ȃ}[ƒN–¼‚Å‚·"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "‚»‚̂悤‚ȃoƒbƒtƒ@‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "Á‚³‚ꂽƒEƒBƒ“ƒhƒE‚ªŽQÆ‚³‚ê‚Ü‚µ‚½"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "“Çžê—p‘®«"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "ƒJ[ƒ\\ƒ‹‚ªƒoƒbƒtƒ@‚ÌŠO‚É‚ ‚è‚Ü‚·"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<ƒEƒBƒ“ƒhƒEƒIƒuƒWƒFƒNƒg (Á‹ŽÏ) %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<ƒEƒBƒ“ƒhƒEƒIƒuƒWƒFƒNƒg (–¢’m) %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<ƒEƒBƒ“ƒhƒE %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "‚»‚̂悤‚ȃEƒBƒ“ƒhƒE‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "ƒAƒ“ƒhƒDî•ñ‚ª•Û‘¶‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "s‚ðÁ‚¹‚Ü‚¹‚ñ"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "s‚ð’uŠ·‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "s‚ð‘}“ü‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "•¶Žš—ñ‚ɂ͉üs•¶Žš‚ðŠÜ‚ß‚ç‚ê‚Ü‚¹‚ñ"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: ‚±‚̃Rƒ}ƒ“ƒh‚Í–³Œø‚Å‚·,‚²‚ß‚ñ‚È‚³‚¢: "
+"Rubyƒ‰ƒCƒuƒ‰ƒŠ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: –¢’m‚Ìlongjmpó‘Ô: %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "ŽÀ‘•‚Æ’è‹`‚ðØ‚è‘Ö‚¦‚é"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "ŽŸ‚̃Nƒ‰ƒX‚ÌŠî’ê‚ð•\\Ž¦"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "ƒI[ƒo[ƒ‰ƒCƒh‚³‚ꂽƒƒ“ƒoŠÖ”‚ð•\\Ž¦"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "ƒtƒ@ƒCƒ‹‚©‚ç‰ñ•œ‚·‚é"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "ƒvƒƒWƒFƒNƒg‚©‚ç‰ñ•œ‚·‚é"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "‘S‚ẴvƒƒWƒFƒNƒg‚©‚ç‰ñ•œ‚·‚é"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "‰ñ•œ"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "ŽŸ‚̃\\[ƒX‚ð•\\Ž¦‚·‚é"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "‚݂‚¯‚½ƒVƒ“ƒ{ƒ‹"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ƒNƒ‰ƒX‚ðŽQÆ"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "ŠK‘w‚ŃNƒ‰ƒX‚ð•\\Ž¦"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "ŒÀ’肳‚ꂽŠK‘w‚ŃNƒ‰ƒX‚ð•\\Ž¦"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ‚ÌŽQÆæ"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ‚ªŽQÆ‚³‚ê‚é"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ‚ªŽŸ‚Ì‚à‚Ì‚ð‚à‚Á‚Ä‚¢‚Ü‚·"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ‚ªŽg—p‚³‚ê‚é"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "ŽŸ‚Ì•¶Í‚ð•\\Ž¦"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "ŽŸ‚Ì•¶Í‚ð¶¬"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"SNiFF+‚ÉÚ‘±‚Å‚«‚Ü‚¹‚ñ. ŠÂ‹«‚ðƒ`ƒFƒbƒN‚µ‚Ä‚­‚¾‚³‚¢(sniffemacs ‚ª $PATH "
+"‚É‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: “Çž’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½. Ø’f‚µ‚Ü‚µ‚½"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "Œ»ÝSNiFF+ ‚Ìó‘Ô‚Íu"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "–¢"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "Ú‘±v‚Å‚·"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: –¢’m‚Ì SNiFF+ ƒŠƒNƒGƒXƒg‚Å‚·: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: SNiFF+ ‚Ö‚ÌÚ‘±’†‚̃Gƒ‰[‚Å‚·"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ‚ÉÚ‘±‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: SNiFF+ ƒoƒbƒtƒ@‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: ‘ž‚Ý’†‚ɃGƒ‰[‚ª”­¶‚µ‚½‚Ì‚ÅØ’f‚µ‚Ü‚µ‚½"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "–³Œø‚ȃoƒbƒtƒ@”Ô†‚Å‚·"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "‚Ü‚¾ŽÀ‘•‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "–¢’m‚̃IƒvƒVƒ‡ƒ“‚Å‚·"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "s‚ðÝ’è‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "ƒ}[ƒN‚Íݒ肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "s %d —ñ %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "s‚Ì‘}“ü/’ljÁ‚ð‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "–¢’m‚̃tƒ‰ƒO:"
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "–¢’m‚Ì vimOption ‚Å‚·"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "ƒL[ƒ{[ƒhŠ„ž‚Ý"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim ƒGƒ‰["
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr ""
+"ƒoƒbƒtƒ@/ƒEƒBƒ“ƒhƒE쬃Rƒ}ƒ“ƒh‚ð쬂ł«‚Ü‚¹‚ñ: "
+"ƒIƒuƒWƒFƒNƒg‚ªÁ‹Ž‚³‚ê‚Ä‚¢‚Ü‚µ‚½"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"ƒR[ƒ‹ƒoƒbƒNƒRƒ}ƒ“ƒh‚ð“o˜^‚Å‚«‚Ü‚¹‚ñ: ƒoƒbƒtƒ@/ƒEƒBƒ“ƒhƒE‚ªŠù‚ÉÁ‹Ž‚³‚ê‚Ü‚µ‚½"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to "
+"vim-dev@vim.org"
+msgstr ""
+"E280: TCL ’v–½“IƒGƒ‰[: reflist ‰˜õ!? vim-dev@vim.org ‚É•ñ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"ƒR[ƒ‹ƒoƒbƒNƒRƒ}ƒ“ƒh‚ð“o˜^‚Å‚«‚Ü‚¹‚ñ: "
+"ƒoƒbƒtƒ@/ƒEƒBƒ“ƒhƒE‚ÌŽQÆ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: ‚±‚̃Rƒ}ƒ“ƒh‚Í–³Œø‚Å‚·,‚²‚ß‚ñ‚È‚³‚¢: "
+"Tclƒ‰ƒCƒuƒ‰ƒŠ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL ƒGƒ‰[: I—¹ƒR[ƒh‚ª®”’l‚Å‚Í‚ ‚è‚Ü‚¹‚ñ!? vim-dev@vim.org "
+"‚É•ñ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "s‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "–½—߃T[ƒo‚Ì–¼‘O‚ð“o˜^‚Å‚«‚Ü‚¹‚ñ"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: –Ú“I‚̃vƒƒOƒ‰ƒ€‚ւ̃Rƒ}ƒ“ƒh‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: –³Œø‚ȃT[ƒoID‚ªŽg‚í‚ê‚Ü‚µ‚½: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM ŽÀ‘Ì‚Ì“o˜^ƒvƒƒpƒeƒB‚ª•s³‚Å‚·. Á‹Ž‚µ‚Ü‚µ‚½!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "–¢’m‚̃IƒvƒVƒ‡ƒ“‚Å‚·"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "•ÒWˆø”‚ª‘½‚·‚¬‚Ü‚·"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "ˆø”‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "ƒIƒvƒVƒ‡ƒ“‚ÌŒã‚ɃSƒ~‚ª‚ ‚è‚Ü‚·"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "\"+command\", \"-c command\", \"--cmd command\" ‚̈ø”‚ª‘½‚·‚¬‚Ü‚·"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "–³Œø‚Ȉø”‚Å‚·: "
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "‚±‚ÌVim‚É‚Ídiff‹@”\\‚ª‚ ‚è‚Ü‚¹‚ñ(ƒRƒ“ƒpƒCƒ‹ŽžÝ’è)."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "ƒXƒNƒŠƒvƒgƒtƒ@ƒCƒ‹‚ðÄ‚ÑŠJ‚¢‚Ä‚Ý‚Ü‚·: \""
+
+# msgid "\"\n"
+# msgstr "\"\n"
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "“Çž—p‚Æ‚µ‚ÄŠJ‚¯‚Ü‚¹‚ñ"
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "ƒXƒNƒŠƒvƒgo—Í—p‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d ŒÂ‚̃tƒ@ƒCƒ‹‚ª•ÒW‚ðT‚¦‚Ä‚¢‚Ü‚·\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Œx: ’[––‚Ö‚Ìo—Í‚Å‚Í‚ ‚è‚Ü‚¹‚ñ\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Œx: ’[––‚©‚ç‚Ì“ü—Í‚Å‚Í‚ ‚è‚Ü‚¹‚ñ\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "vimrc‘O‚̃Rƒ}ƒ“ƒhƒ‰ƒCƒ“"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: \"%s\"‚©‚ç“Çž‚Þ‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ"
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"‚æ‚èÚׂÈî•ñ‚Í: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[ƒtƒ@ƒCƒ‹..] ‚ ‚éƒtƒ@ƒCƒ‹‚ð•ÒW‚·‚é"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- •W€“ü—Í‚©‚çƒeƒLƒXƒg‚ð“Çž‚Þ"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t ƒ^ƒO ƒ^ƒO‚ª’è‹`‚³‚ꂽ‚Æ‚±‚ë‚©‚ç•ÒW‚·‚é"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] ʼn‚̃Gƒ‰[‚Å•ÒW‚·‚é"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"Žg—p–@:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [ˆø”]"
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ‚à‚µ‚­‚Í:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"ˆø”:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\t‚±‚Ì‚ ‚Ƃɂ̓tƒ@ƒCƒ‹–¼‚¾‚¯"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tƒƒCƒ‹ƒhƒJ[ƒh‚ð“WŠJ‚µ‚È‚¢"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t‚±‚Ìgvim‚ðOLE‚Æ‚µ‚Ä“o˜^‚·‚é"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tgvim‚ÌOLE“o˜^‚ð‰ðœ‚·‚é"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tGUI‚Å‹N“®‚·‚é (\"gvim\" ‚Æ“¯‚¶)"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f or --nofork\tƒtƒHƒAƒOƒ‰ƒEƒ“ƒh: GUI‚ðŽn‚ß‚é‚Æ‚«‚Éfork‚µ‚È‚¢"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tViƒ‚[ƒh (\"vi\" ‚Æ“¯‚¶)"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tExƒ‚[ƒh (\"ex\" ‚Æ“¯‚¶)"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tƒTƒCƒŒƒ“ƒg(ƒoƒbƒ`)ƒ‚[ƒh (\"ex\" ê—p)"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\t·•ªƒ‚[ƒh (\"vidiff\" ‚Æ“¯‚¶)"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tƒC[ƒW[ƒ‚[ƒh (\"evim\" ‚Æ“¯‚¶, ƒ‚[ƒh–³)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\t“Çžê—pƒ‚[ƒh (\"view\" ‚Æ“¯‚¶)"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\t§ŒÀƒ‚[ƒh (\"rvim\" ‚Æ“¯‚¶)"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\t•ÏX (ƒtƒ@ƒCƒ‹•Û‘¶Žž) ‚ð‚Å‚«‚È‚¢‚悤‚É‚·‚é"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tƒeƒLƒXƒg‚Ì•ÒW‚ðs‚È‚¦‚È‚¢‚悤‚É‚·‚é"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tƒoƒCƒiƒŠƒ‚[ƒh"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLispƒ‚[ƒh"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tViŒÝŠ·ƒ‚[ƒh: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tVi”ñŒÝŠ·ƒ‚[ƒh: 'nocompatible"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose ƒŒƒxƒ‹"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tƒfƒoƒbƒOƒ‚[ƒh"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ðŽg—p‚¹‚¸ƒƒ‚ƒŠ‚¾‚¯"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ð—ñ‹“‚µI—¹"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (ƒtƒ@ƒCƒ‹–¼)\tƒNƒ‰ƒbƒVƒ…‚µ‚½ƒZƒbƒVƒ‡ƒ“‚𕜋A"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\t-r‚Æ“¯‚¶"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tƒEƒBƒ“ƒhƒE‚ðŠJ‚­‚Ì‚É newcli ‚ðŽg—p‚µ‚È‚¢"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tI/O‚É <device> ‚ðŽg—p‚·‚é"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tƒAƒ‰ƒrƒAŒêƒ‚[ƒh‚Å‹N“®‚·‚é"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tƒwƒuƒ‰ƒCŒêƒ‚[ƒh‚Å‹N“®‚·‚é"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tƒyƒ‹ƒVƒAŒêƒ‚[ƒh‚Å‹N“®‚·‚é"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\t’[––‚ð <terminal> ‚ÉÝ’è‚·‚é"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t.vimrc‚Ì‘ã‚í‚è‚É <vimrc> ‚ðŽg‚¤"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t.gvimrc‚Ì‘ã‚í‚è‚É <gvimrc> ‚ðŽg‚¤"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tƒvƒ‰ƒOƒCƒ“ƒXƒNƒŠƒvƒg‚ðƒ[ƒh‚µ‚È‚¢"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tN ŒÂƒEƒBƒ“ƒhƒE‚ðŠJ‚­(È—ª’l: ƒtƒ@ƒCƒ‹‚ɂ‚«1ŒÂ)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\t-o‚Æ“¯‚¶‚¾‚ª‚’¼•ªŠ„"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tƒtƒ@ƒCƒ‹‚ÌŌォ‚ç‚Í‚¶‚ß‚é"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\t<lnum> s‚©‚ç‚Í‚¶‚ß‚é"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\tvimrc‚ðƒ[ƒh‚·‚é‘O‚É <command> ‚ðŽÀs‚·‚é"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\tʼn‚̃tƒ@ƒCƒ‹‚ðƒ[ƒhŒã <command> ‚ðŽÀs‚·‚é"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\tʼn‚̃tƒ@ƒCƒ‹‚ðƒ[ƒhŒãƒtƒ@ƒCƒ‹ <session> ‚ðŽæž‚Þ"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\tƒtƒ@ƒCƒ‹ <scriptin> ‚©‚çƒm[ƒ}ƒ‹ƒRƒ}ƒ“ƒh‚ð“Çž‚Þ"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t“ü—Í‚µ‚½‘SƒRƒ}ƒ“ƒh‚ðƒtƒ@ƒCƒ‹ <scriptout> ‚ɒljÁ‚·‚é"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t“ü—Í‚µ‚½‘SƒRƒ}ƒ“ƒh‚ðƒtƒ@ƒCƒ‹ <scriptout> ‚É•Û‘¶‚·‚é"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tˆÃ†‰»‚³‚ꂽƒtƒ@ƒCƒ‹‚ð•ÒW‚·‚é"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tvim‚ðŽw’肵‚½ X ƒT[ƒo‚ÉÚ‘±‚·‚é"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tXƒT[ƒo‚ÉÚ‘±‚µ‚È‚¢"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <files>\t‰Â”\\‚È‚ç‚ÎVimƒT[ƒo‚Å <files> ‚ð•ÒW‚·‚é"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silnet <files> “¯ã, ƒT[ƒo‚ª–³‚­‚Ä‚àŒx•¶‚ðo—Í‚µ‚È‚¢"
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files>\t--remoteŒã ƒtƒ@ƒCƒ‹‚Ì•ÒW‚ªI‚í‚é‚Ì‚ð‘Ò‚Â"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <files> “¯ã, ƒT[ƒo‚ª–³‚­‚Ä‚àŒx•¶‚ðo—Í‚µ‚È‚¢"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tVimƒT[ƒo‚É <keys> ‚ð‘—M‚µ‚ÄI—¹‚·‚é"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tƒT[ƒo‚Å <expr> ‚ðŽÀs‚µ‚ÄŒ‹‰Ê‚ð•\\Ž¦‚·‚é"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVimƒT[ƒo–¼‚̈ꗗ‚ð•\\Ž¦‚µ‚ÄI—¹‚·‚é"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servename <name>\t\tVimƒT[ƒo <name> ‚É‘—M/–¼‘OÝ’è‚·‚é"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t.viminfo‚Ì‘ã‚í‚è‚É <viminfo> ‚ðŽg‚¤"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h or --help\tƒwƒ‹ƒv(‚±‚̃ƒbƒZ[ƒW)‚ð•\\Ž¦‚µI—¹‚·‚é"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tƒo[ƒWƒ‡ƒ“î•ñ‚ð•\\Ž¦‚µI—¹‚·‚é"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim‚É‚æ‚Á‚ĉðŽß‚³‚ê‚éˆø”(Motifƒo[ƒWƒ‡ƒ“):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"gvim‚É‚æ‚Á‚ĉðŽß‚³‚ê‚éˆø”(neXtawƒo[ƒWƒ‡ƒ“):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim‚É‚æ‚Á‚ĉðŽß‚³‚ê‚éˆø”(Athenaƒo[ƒWƒ‡ƒ“):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\t<display> ‚Åvim‚ðŽÀs‚·‚é"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tŬ‰»‚µ‚½ó‘Ô‚Åvim‚ð‹N“®‚·‚é"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tvim‚Ì–¼‚ª <name> ‚Å‚ ‚é‚Æ‚µ‚ăŠƒ\\[ƒX‚ðŽg‚¤"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (ŽÀ‘•‚³‚ê‚Ä‚¢‚È‚¢)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\t”wŒiF‚É <color> ‚ðŽg‚¤(“¯‹`: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\t‘OŒiF‚É <color> ‚ðŽg‚¤(“¯‹`: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tƒeƒLƒXƒg•\\Ž¦‚É <font> ‚ðŽg‚¤(“¯‹`: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\t‘¾Žš‚É <font> ‚ðŽg‚¤"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <for>\tŽÎ‘ÌŽš‚É <font> ‚ðŽg‚¤"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\t‰Šú”z’u‚É <geom> ‚ðŽg‚¤(“¯‹`: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t‹«ŠE‚Ì•‚ð <width> ‚É‚·‚é(“¯‹`: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <width> ƒXƒNƒ[ƒ‹ƒo[‚Ì•‚ð <width> ‚É‚·‚é(“¯‹`: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tƒƒjƒ…[ƒo[‚Ì‚‚³‚ð <height> ‚É‚·‚é(“¯‹`: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\t”½“]‰f‘œ‚ðŽg—p‚·‚é(“¯‹`: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\t”½“]‰f‘œ‚ðŽg—p‚µ‚È‚¢(“¯‹`: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\t“Á’è‚̃Šƒ\\[ƒX‚ðŽg—p‚·‚é"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim‚É‚æ‚Á‚ĉðŽß‚³‚ê‚éˆø”(RISC OSƒo[ƒWƒ‡ƒ“):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t‰Šú‚̃EƒBƒ“ƒhƒE‚̃Rƒ‰ƒ€’PˆÊ‚Ì•"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t‰Šú‚̃EƒBƒ“ƒhƒE‚Ìs’PˆÊ‚Ì‚‚³"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim‚É‚æ‚Á‚ĉðŽß‚³‚ê‚éˆø”(GTK+ƒo[ƒWƒ‡ƒ“):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\t<display> ‚Åvim‚ðŽÀs‚·‚é(“¯‹`: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\tƒƒCƒ“ƒEƒBƒ“ƒhƒE‚ðŽ¯•Ê‚·‚éˆêˆÓ‚È–ðŠ„(role)‚ðÝ’è‚·‚é"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tˆÙ‚È‚éGTK widget‚ÅVim‚ðŠJ‚­"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <e‚̃^ƒCƒgƒ‹>\tVim‚ðeƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Ì’†‚Å‹N“®‚·‚é"
+
+# msgid "--help\t\tShow Gnome arguments"
+# msgstr "--help\t\tGNOME‚̈ø”‚ðŒ©‚¹‚é"
+#: main.c:2847
+msgid "No display"
+msgstr "ƒfƒBƒXƒvƒŒƒC‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": ‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": ‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½. ƒ[ƒJƒ‹‚Å‚ÌŽÀs‚ðŽŽ‚Ý‚Ä‚¢‚Ü‚·\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d ŒÂ (%d ŒÂ’†) ‚̃tƒ@ƒCƒ‹‚ð•ÒW‚µ‚Ü‚µ‚½"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "ƒfƒBƒXƒvƒŒƒC‚ª‚ ‚è‚Ü‚¹‚ñ: Ž®‚Ì‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Ž®‚Ì‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "ƒ}[ƒN‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: \"%s\" ‚ÉŠY“–‚·‚éƒ}[ƒN‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"mark s —ñ ƒtƒ@ƒCƒ‹/ƒeƒLƒXƒg"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" jump s —ñ ƒtƒ@ƒCƒ‹/ƒeƒLƒXƒg"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"•ÏX s —ñ ƒeƒLƒXƒg"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# ƒtƒ@ƒCƒ‹ƒ}[ƒN:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# ƒWƒƒƒ“ƒvƒŠƒXƒg (V‚µ‚¢‚à‚Ì‚ªæ):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ƒtƒ@ƒCƒ‹“àƒ}[ƒN‚Ì—š—ð (V‚µ‚¢‚à‚Ì‚©‚çŒÃ‚¢‚à‚Ì):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "'>' ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: –³Œø‚ȃR[ƒhƒy[ƒW‚Å‚·"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: IC‚Ì’l‚ðÝ’è‚Å‚«‚Ü‚¹‚ñ"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: ƒCƒ“ƒvƒbƒgƒRƒ“ƒeƒLƒXƒg‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: ƒCƒ“ƒvƒbƒgƒƒ\\ƒbƒh‚̃I[ƒvƒ“‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Œx: IM‚Ì”j‰óƒR[ƒ‹ƒoƒbƒN‚ðÝ’è‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ƒCƒ“ƒvƒbƒgƒƒ\\ƒbƒh‚Í‚Ç‚ñ‚ȃXƒ^ƒCƒ‹‚àƒTƒ|[ƒg‚µ‚Ü‚¹‚ñ"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ƒCƒ“ƒvƒbƒgƒƒ\\ƒbƒh‚Í my preedit type ‚ðƒTƒ|[ƒg‚µ‚Ü‚¹‚ñ"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot ƒXƒ^ƒCƒ‹‚É‚Ífontset‚ª•K—v‚Å‚·"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: GTK+‚ª1.2.3‚æ‚è‚àŒÃ‚¢‚̂ŃXƒe[ƒ^ƒXƒGƒŠƒA‚ª–³Œø‚Å‚·"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ƒCƒ“ƒvƒbƒgƒƒ\\ƒbƒhƒT[ƒo ‚ª“®ì‚µ‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: ƒuƒƒbƒN‚ªƒƒbƒN‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ƒXƒƒbƒvƒtƒ@ƒCƒ‹“ÇžŽž‚ɃV[ƒNƒGƒ‰[‚Å‚·"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚Ì“Çž‚݃Gƒ‰[‚Å‚·"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‘ž‚ÝŽž‚ɃV[ƒNƒGƒ‰[‚Å‚·"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚Ì‘ž‚݃Gƒ‰[‚Å‚·"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ªŠù‚É‘¶Ý‚µ‚Ü‚· (symlink‚É‚æ‚éUŒ‚?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ƒuƒƒbƒN 0 ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ƒuƒƒbƒN 1 ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ƒuƒƒbƒN 2 ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: ‚¨‚Á‚Æ, ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ªŽ¸‚í‚ê‚Ü‚µ‚½!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚Ì–¼‘O‚ð•Ï‚¦‚ç‚ê‚Ü‚¹‚ñ"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: \"%s\" ‚̃Xƒƒbƒvƒtƒ@ƒCƒ‹‚ðŠJ‚¯‚È‚¢‚̂ŃŠƒJƒoƒŠ‚Í•s‰Â”\\‚Å‚·"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: ƒuƒƒbƒN 0 ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: %s ‚ɂ̓Xƒƒbƒvƒtƒ@ƒCƒ‹‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Žg—p‚·‚éƒXƒƒbƒvƒtƒ@ƒCƒ‹‚̔Ԇ‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢(0 ‚ÅI—¹): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: %s ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "ƒuƒƒbƒN 0 ‚ð“Çž‚ß‚Ü‚¹‚ñ "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"‹°‚ç‚­•ÏX‚ª‚³‚ê‚Ä‚¢‚È‚¢‚©Vim‚ªƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ðXV‚µ‚Ä‚¢‚Ü‚¹‚ñ."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " Vim‚Ì‚±‚̃o[ƒWƒ‡ƒ“‚Å‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Vim‚̃o[ƒWƒ‡ƒ“3.0‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ‚ÍVim‚̃Xƒƒbƒvƒtƒ@ƒCƒ‹‚Å‚Í‚È‚¢‚悤‚Å‚·"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ‚±‚̃Rƒ“ƒsƒ…[ƒ^‚Å‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "‚±‚̃tƒ@ƒCƒ‹‚ÍŽŸ‚ÌꊂÅì‚ç‚ê‚Ü‚µ‚½ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"‚à‚µ‚­‚̓tƒ@ƒCƒ‹‚ª‘¹‚µ‚Ä‚¢‚Ü‚·."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "ƒXƒƒbƒvƒtƒ@ƒCƒ‹ \"%s\" ‚ðŽg—p’†"
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Œ´–{ƒtƒ@ƒCƒ‹ \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Œx: Œ´–{ƒtƒ@ƒCƒ‹‚ª•ÏX‚³‚ê‚Ä‚¢‚Ü‚·"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: %s ‚©‚çƒuƒƒbƒN 1 ‚ð“Çž‚ß‚Ü‚¹‚ñ"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???‘½‚­‚Ìs‚ªŽ¸‚í‚ê‚Ä‚¢‚Ü‚·"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???s”‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???ƒuƒƒbƒN‚ª‹ó‚Å‚·"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???s‚ªŽ¸‚í‚ê‚Ä‚¢‚Ü‚·"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ƒuƒƒbƒN 1 ‚ÌID‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·(%s ‚ª.swpƒtƒ@ƒCƒ‹‚Å‚È‚¢?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???ƒuƒƒbƒN‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ‚±‚±‚©‚ç???END‚Ü‚Å‚Ìs‚ª”j‰ó‚³‚ê‚Ä‚¢‚é‚悤‚Å‚·"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ‚±‚±‚©‚ç??END‚Ü‚Å‚Ìs‚ª‘}“ü‚©íœ‚³‚ꂽ‚悤‚Å‚·"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: ƒŠƒJƒoƒŠ‚ªŠ„ž‚Ü‚ê‚Ü‚µ‚½"
+
+#: memline.c:1148
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: ƒŠƒJƒoƒŠ‚ÌÅ’†‚ɃGƒ‰[‚ªŒŸo‚³‚ê‚Ü‚µ‚½; ???‚ÅŽn‚Ü‚és‚ðŽQÆ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "Ú×‚Í \":help E312\" ‚ðŽQÆ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "ƒŠƒJƒoƒŠ‚ªI—¹‚µ‚Ü‚µ‚½. ‘S‚Ä‚ª³‚µ‚¢‚©ƒ`ƒFƒbƒN‚µ‚Ä‚­‚¾‚³‚¢."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(•ÏX‚ðƒ`ƒFƒbƒN‚·‚邽‚ß‚É, ‚±‚̃tƒ@ƒCƒ‹‚ð•Ê‚Ì–¼‘O‚Å•Û‘¶‚µ‚½ã‚Å\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "Œ´–{ƒtƒ@ƒCƒ‹‚Æ‚Ì diff ‚ðŽÀs‚·‚é‚Æ—Ç‚¢‚Å‚µ‚傤)\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"‚»‚ê‚©‚ç.swpƒtƒ@ƒCƒ‹‚ð휂µ‚Ä‚­‚¾‚³‚¢\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ª•¡”Œ©‚‚©‚è‚Ü‚µ‚½:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " Œ»Ý‚̃fƒBƒŒƒNƒgƒŠ:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " ‚ ‚é–¼‘O‚ðŽg—p’†:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " ƒfƒBƒŒƒNƒgƒŠ "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ‚È‚µ --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " Š—LŽÒ: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " “ú•t: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " “ú•t: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [from Vim version 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [Vim‚̃Xƒƒbƒvƒtƒ@ƒCƒ‹‚Å‚Í‚È‚¢‚悤‚Å‚·]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " ƒtƒ@ƒCƒ‹–¼: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" •ÏXó‘Ô: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "‚ ‚è"
+
+#: memline.c:1525
+msgid "no"
+msgstr "‚È‚µ"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ƒ†[ƒU–¼: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " ƒzƒXƒg–¼: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" ƒzƒXƒg–¼: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ƒvƒƒZƒXID: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (‚Ü‚¾ŽÀs’†)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [‚±‚ÌVimƒo[ƒWƒ‡ƒ“‚Å‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [‚±‚̃Rƒ“ƒsƒ…[ƒ^‚Å‚ÍŽg—p‚Å‚«‚Ü‚¹‚ñ]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [“Çž‚ß‚Ü‚¹‚ñ]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [ŠJ‚¯‚Ü‚¹‚ñ]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ª–³‚¢‚̂ňێ‚Å‚«‚Ü‚¹‚ñ"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "ƒtƒ@ƒCƒ‹‚ªˆÛŽ‚³‚ê‚Ü‚·"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: ˆÛŽ‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: –³Œø‚Èlnum‚Å‚·: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: s %ld ‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: ƒ|ƒCƒ“ƒ^ƒuƒƒbƒN‚ÌID‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚· 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "stack_idx ‚Í 0 ‚Å‚ ‚é‚ׂ«‚Å‚·"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: XV‚³‚ꂽƒuƒƒbƒN‚ª‘½‚·‚¬‚é‚©‚à?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: ƒ|ƒCƒ“ƒ^ƒuƒƒbƒN‚ÌID‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚· 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "ƒuƒƒbƒN 1 ‚ÍÁ‚³‚ꂽ?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: s %ld ‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: ƒ|ƒCƒ“ƒ^ƒuƒƒbƒN‚ÌID‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ‚ªƒ[ƒ‚Å‚·"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: s”Ô†‚ª”͈͊O‚Å‚·: %ld ’´‚¦‚Ä‚¢‚Ü‚·"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ƒuƒƒbƒN %ld ‚ÌsƒJƒEƒ“ƒg‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "ƒXƒ^ƒbƒNƒTƒCƒY‚ª‘‚¦‚Ü‚·"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: ƒ|ƒCƒ“ƒ^ƒuƒƒbƒN‚ÌID‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚· 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: ’ˆÓ"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"ŽŸ‚Ì–¼‘O‚ŃXƒƒbƒvƒtƒ@ƒCƒ‹‚ðŒ©‚Â‚¯‚Ü‚µ‚½ \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "ŽŸ‚̃tƒ@ƒCƒ‹‚ðŠJ‚¢‚Ä‚¢‚éÅ’† \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚æ‚è‚àV‚µ‚¢‚Å‚·!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) •Ê‚̃vƒƒOƒ‰ƒ€‚ª“¯‚¶ƒtƒ@ƒCƒ‹‚ð•ÒW‚µ‚Ä‚¢‚é‚©‚à‚µ‚ê‚Ü‚¹‚ñ.\n"
+" ‚±‚ÌꇂɂÍ, •ÏX‚ð‚µ‚½Û‚ÉÅI“I‚É, “¯‚¶ƒtƒ@ƒCƒ‹‚̈قȂé\n"
+" 2‚‚̃Cƒ“ƒXƒ^ƒ“ƒX‚ª‚Å‚«‚Ä‚µ‚Ü‚¤‚±‚Æ‚É’ˆÓ‚µ‚Ä‚­‚¾‚³‚¢.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " I—¹‚·‚é‚©, ’ˆÓ‚µ‚È‚ª‚瑱‚¯‚Ü‚·.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ‚±‚̃tƒ@ƒCƒ‹‚Ì•ÒWƒZƒbƒVƒ‡ƒ“‚ªƒNƒ‰ƒbƒVƒ…‚µ‚½.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ‚±‚Ìê‡‚É‚Í \":recover\" ‚© \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" ‚ðŽg—p‚µ‚Ä•ÏX‚ðƒŠƒJƒo[‚µ‚Ü‚·(\":help recover\" ‚ðŽQÆ).\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " Šù‚É‚±‚ê‚ðs‚È‚Á‚½‚Ì‚È‚ç‚Î, ƒXƒƒbƒvƒtƒ@ƒCƒ‹ \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ‚ðÁ‚¹‚΂±‚̃ƒbƒZ[ƒW‚ð‰ñ”ð‚Å‚«‚Ü‚·.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "ƒXƒƒbƒvƒtƒ@ƒCƒ‹ \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" ‚ªŠù‚É‚ ‚è‚Ü‚·!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - ’ˆÓ"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ªŠù‚É‘¶Ý‚µ‚Ü‚·!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"“Çžê—p‚ÅŠJ‚­(&O)\n"
+"‚Æ‚É‚©‚­•ÒW‚·‚é(&E)\n"
+"•œŠˆ‚³‚¹‚é(&R)ecover\n"
+"I—¹‚·‚é(&Q)\n"
+"’†Ž~‚·‚é(&A)"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"“Çžê—p‚ÅŠJ‚­(&O)\n"
+"‚Æ‚É‚©‚­•ÒW‚·‚é(&E)\n"
+"•œŠˆ‚³‚¹‚é(&R)ecover\n"
+"I—¹‚·‚é(&Q)\n"
+"’†Ž~‚·‚é(&A)\n"
+"Á‹Ž‚·‚é(&D)"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚ª‘½”Œ©‚‚©‚è‚Ü‚µ‚½"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ƒƒjƒ…[ƒAƒCƒeƒ€‚̃pƒX‚Ì•”•ª‚ªƒTƒuƒƒjƒ…[‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: ƒƒjƒ…[‚Í‘¼‚̃‚[ƒh‚É‚¾‚¯‚ ‚è‚Ü‚·"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ‚»‚Ì–¼‘O‚̃ƒjƒ…[‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ƒƒjƒ…[ƒpƒX‚̓Tƒuƒƒjƒ…[‚𶂶‚é‚ׂ«‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ƒƒjƒ…[ƒo[‚É‚Í’¼Úƒƒjƒ…[ƒAƒCƒeƒ€‚ð’ljÁ‚Å‚«‚Ü‚¹‚ñ"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ‹æØ‚è‚̓ƒjƒ…[ƒpƒX‚̈ꕔ‚Å‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- ƒƒjƒ…[ ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "‚±‚̃ƒjƒ…[‚ðØ‚èŽæ‚é"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ƒƒjƒ…[ƒpƒX‚̓ƒjƒ…[ƒAƒCƒeƒ€‚𶂶‚È‚¯‚ê‚΂¢‚¯‚Ü‚¹‚ñ"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: ƒƒjƒ…[‚ª‚݂‚©‚è‚Ü‚¹‚ñ: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s ‚ɂ̓ƒjƒ…[‚ª’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ƒƒjƒ…[ƒpƒX‚̓Tƒuƒƒjƒ…[‚𶂶‚È‚¯‚ê‚΂¢‚¯‚Ü‚¹‚ñ"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: ƒƒjƒ…[‚ª‚݂‚©‚è‚Ü‚¹‚ñ - ƒƒjƒ…[–¼‚ðŠm”F‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "%s ‚̈—’†‚ɃGƒ‰[‚ªŒŸo‚³‚ê‚Ü‚µ‚½:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "s %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[•¶Žš—ñ‚ª’·‚·‚¬‚Ü‚·]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "“ú–{ŒêƒƒbƒZ[ƒW–|–ó/ŠÄC: ‘º‰ª ‘¾˜Y <koron@tka.att.ne.jp>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Š„ž‚Ý: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "‘±‚¯‚é‚É‚ÍENTER‚ð‰Ÿ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "‘±‚¯‚é‚É‚ÍENTER‚ð‰Ÿ‚·‚©ƒRƒ}ƒ“ƒh‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Œp‘± --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: s‘—‚è, SPACE/b: ƒy[ƒW‘—‚è, d/u: ”¼ƒy[ƒW‘—‚è, q: I—¹)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: s‘—‚è, SPACE: ƒy[ƒW‘—‚è, d: ”¼ƒy[ƒW‘—‚è, q: I—¹)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "Ž¿–â"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"‚Í‚¢(&Y)\n"
+"‚¢‚¢‚¦(&N)"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"‚Í‚¢(&Y)\n"
+"‚¢‚¢‚¦(&N)\n"
+"‘S‚Ä•Û‘¶(&A)\n"
+"‘S‚Ä•úŠü(&D)\n"
+"ƒLƒƒƒ“ƒZƒ‹(&C)"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "ƒtƒ@ƒCƒ‹•Û‘¶ƒ_ƒCƒAƒƒO"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "ƒtƒ@ƒCƒ‹“Çžƒ_ƒCƒAƒƒO"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ƒRƒ“ƒ\\[ƒ‹ƒ‚[ƒh‚ł̓tƒ@ƒCƒ‹ƒuƒ‰ƒEƒU‚ðŽg‚¦‚Ü‚¹‚ñ, ‚²‚ß‚ñ‚È‚³‚¢"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Œx: “Çžê—pƒtƒ@ƒCƒ‹‚ð•ÏX‚µ‚Ü‚·"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "1 s ’ljÁ‚µ‚Ü‚µ‚½"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "1 s 휂µ‚Ü‚µ‚½"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld s ’ljÁ‚µ‚Ü‚µ‚½"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld s 휂µ‚Ü‚µ‚½"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (Š„ž‚Ü‚ê‚Ü‚µ‚½)"
+
+#: misc1.c:7582
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ƒtƒ@ƒCƒ‹‚ð•Û‘¶’†...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7592
+msgid "Vim: Finished.\n"
+msgstr "Vim: I—¹‚µ‚Ü‚µ‚½.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "ƒGƒ‰[: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[ƒƒ‚ƒŠ(ƒoƒCƒg)] ‘Š„“–-‰ð•ú—Ê %lu-%lu, Žg—p—Ê %lu, ƒs[ƒNŽž %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[ŒÄo] ‘ re/malloc() ‰ñ” %lu, ‘ free() ‰ñ” %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: s‚ª’·‚­‚È‚è‚·‚¬‚Ü‚µ‚½"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: “à•”ƒGƒ‰[: lalloc(%ld,)"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ƒƒ‚ƒŠ‚ª‘«‚è‚Ü‚¹‚ñ! (%lu ƒoƒCƒg‚ðŠ„“–—v‹)"
+
+#: misc2.c:2593
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "ŽÀs‚Ì‚½‚߂ɃVƒFƒ‹‚ðŒÄo‚µ’†: \"%s\""
+
+#: misc2.c:2815
+msgid "E545: Missing colon"
+msgstr "E545: ƒRƒƒ“‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:2817 misc2.c:2844
+msgid "E546: Illegal mode"
+msgstr "E546: •s³‚ȃ‚[ƒh‚Å‚·"
+
+#: misc2.c:2883
+msgid "E547: Illegal mouseshape"
+msgstr "E547: •s³‚È 'mouseshape' ‚Å‚·"
+
+#: misc2.c:2923
+msgid "E548: digit expected"
+msgstr "E548: ”’l‚ª•K—v‚Å‚·"
+
+#: misc2.c:2928
+msgid "E549: Illegal percentage"
+msgstr "E549: •s³‚ȃp[ƒZƒ“ƒe[ƒW‚Å‚·"
+
+#: misc2.c:3238
+msgid "Enter encryption key: "
+msgstr "ˆÃ†‰»—p‚̃L[‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢: "
+
+#: misc2.c:3239
+msgid "Enter same key again: "
+msgstr "‚à‚¤ˆê“x“¯‚¶ƒL[‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢: "
+
+#: misc2.c:3249
+msgid "Keys don't match!"
+msgstr "ƒL[‚ªˆê’v‚µ‚Ü‚¹‚ñ"
+
+#: misc2.c:3798
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: –³Œø‚ȃpƒX‚Å‚·: '**[”’l]' ‚Ípath‚ÌŌォ '%s' "
+"‚ª‘±‚¢‚Ä‚È‚¢‚Æ‚¢‚¯‚Ü‚¹‚ñ."
+
+#: misc2.c:5077
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath‚É‚Í \"%s\" ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:5080
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: path‚É‚Í \"%s\" ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:5086
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: cdpath‚É‚Í‚±‚êˆÈã \"%s\" ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:5089
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ƒpƒX‚É‚Í‚±‚êˆÈã \"%s\" ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:5323
+msgid "E550: Missing colon"
+msgstr "E550: ƒRƒƒ“‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: misc2.c:5335
+msgid "E551: Illegal component"
+msgstr "E551: •s³‚È\\•¶—v‘f‚Å‚·"
+
+#: misc2.c:5343
+msgid "E552: digit expected"
+msgstr "E552: ”’l‚ª•K—v‚Å‚·"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Netbeans #2 ‚ÉÚ‘±‚Å‚«‚Ü‚¹‚ñ"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Netbeans ‚ÉÚ‘±‚Å‚«‚Ü‚¹‚ñ"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: NetBeans‚ÌÚ‘±î•ñƒtƒ@ƒCƒ‹‚̃AƒNƒZƒXƒ‚[ƒh‚É–â‘肪‚ ‚è‚Ü‚·: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "Netbeans ‚̃\\ƒPƒbƒg‚ð“Çž‚Ý"
+
+#: netbeans.c:1638
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: ƒoƒbƒtƒ@ %ld ‚Ì NetBeans Ú‘±‚ªŽ¸‚í‚ê‚Ü‚µ‚½"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "Œx: Žg—p‚µ‚Ä‚¢‚é’[––‚̓nƒCƒ‰ƒCƒg‚Å‚«‚Ü‚¹‚ñ"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: ƒJ[ƒ\\ƒ‹‚̈ʒu‚É‚Í•¶Žš—ñ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: ƒJ[ƒ\\ƒ‹‚̈ʒu‚É‚ÍŽ¯•ÊŽq‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Œ»Ý‚Ì 'foldmethod' ‚Å‚ÍÜô‚Ý‚ðÁ‹Ž‚Å‚«‚Ü‚¹‚ñ"
+
+#: normal.c:6708
+msgid "E664: changelist is empty"
+msgstr "E664: •ÏXƒŠƒXƒg‚ª‹ó‚Å‚·"
+
+#: normal.c:6710
+msgid "E662: At start of changelist"
+msgstr "E662: •ÏXƒŠƒXƒg‚Ì擪"
+
+#: normal.c:6712
+msgid "E663: At end of changelist"
+msgstr "E663: •ÏXƒŠƒXƒg‚Ì––”ö"
+
+#: normal.c:7973
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Vim‚ðI—¹‚·‚é‚É‚Í :quit<Enter> ‚Æ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 s‚ª %s ‚Å 1 ‰ñˆ—‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 s‚ª %s ‚Å %d ‰ñˆ—‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld s‚ª %s ‚Å 1 ‰ñˆ—‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld s‚ª %s ‚Å %d ‰ñˆ—‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld s‚ªƒCƒ“ƒfƒ“ƒg‚³‚ê‚Ü‚·... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 s‚ðƒCƒ“ƒfƒ“ƒg‚µ‚Ü‚µ‚½"
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld s‚ðƒCƒ“ƒfƒ“ƒg‚µ‚Ü‚µ‚½"
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "ƒ„ƒ“ƒN‚Å‚«‚Ü‚¹‚ñ; ‚Æ‚É‚©‚­Á‹Ž"
+
+#: ops.c:2185
+msgid "1 line changed"
+msgstr "1 s‚ª•ÏX‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:2187
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld s‚ª•ÏX‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:2571
+#, c-format
+msgid "freeing %ld lines"
+msgstr "%ld s‚ðŠJ•ú’†"
+
+#: ops.c:2852
+msgid "1 line yanked"
+msgstr "1 s‚ªƒ„ƒ“ƒN‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:2854
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld s‚ªƒ„ƒ“ƒN‚³‚ê‚Ü‚µ‚½"
+
+#: ops.c:3139
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ƒŒƒWƒXƒ^ %s ‚ɂ͉½‚à‚ ‚è‚Ü‚¹‚ñ"
+
+#. Highlight title
+#: ops.c:3690
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ƒŒƒWƒXƒ^ ---"
+
+#: ops.c:4997
+msgid "Illegal register name"
+msgstr "•s³‚ȃŒƒWƒXƒ^–¼"
+
+#: ops.c:5085
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ƒŒƒWƒXƒ^:\n"
+
+#: ops.c:5135
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: –¢’m‚̃ŒƒWƒXƒ^Œ^ %d ‚Å‚·"
+
+#: ops.c:5620
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: –³Œø‚ȃŒƒWƒXƒ^–¼: '%s'"
+
+#: ops.c:5980
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld —ñ; "
+
+#: ops.c:5987
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "‘I‘ð %s%ld / %ld s; %ld / %ld ’PŒê; %ld / %ld •¶Žš"
+
+#: ops.c:6003
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "—ñ %s / %s; s %ld of %ld; ’PŒê %ld / %ld; •¶Žš %ld / %ld"
+
+#: ops.c:6014
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=%N ƒy[ƒW"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Vim ‚ðŽg‚Á‚Ä‚­‚ê‚Ä‚ ‚肪‚Æ‚¤"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: –¢’m‚̃IƒvƒVƒ‡ƒ“‚Å‚·"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: ƒIƒvƒVƒ‡ƒ“‚̓Tƒ|[ƒg‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: modeline ‚Å‚Í‹–‰Â‚³‚ê‚Ü‚¹‚ñ"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tLast set from "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: = ‚ÌŒã‚É‚Í”Žš‚ª•K—v‚Å‚·"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: termcap “à‚ɂ݂‚©‚è‚Ü‚¹‚ñ"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: •s³‚È•¶Žš‚Å‚· <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: 'term' ‚ɂ͋󕶎š—ñ‚ðÝ’è‚Å‚«‚Ü‚¹‚ñ"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: GUI‚Å‚Í 'term' ‚ð•ÏX‚Å‚«‚Ü‚¹‚ñ"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: GUI‚ðƒXƒ^[ƒg‚·‚é‚É‚Í \":gui\" ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' ‚Æ 'patchmode' ‚ª“¯‚¶‚Å‚·"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: GTK+2 GUI‚Å‚Í•ÏX‚Å‚«‚Ü‚¹‚ñ"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: ƒRƒƒ“‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: •¶Žš—ñ‚Ì’·‚³‚ªƒ[ƒ‚Å‚·"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: <%s> ‚ÌŒã‚É”Žš‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: ƒJƒ“ƒ}‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: ' ‚Ì’l‚ðŽw’肵‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: •\\Ž¦‚Å‚«‚È‚¢•¶Žš‚©ƒƒCƒh•¶Žš‚ðŠÜ‚ñ‚Å‚¢‚Ü‚·"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: –³Œø‚ȃtƒHƒ“ƒg‚Å‚·"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: ƒtƒHƒ“ƒgƒZƒbƒg‚ð‘I‘ð‚Å‚«‚Ü‚¹‚ñ"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: –³Œø‚ȃtƒHƒ“ƒgƒZƒbƒg‚Å‚·"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: ƒƒCƒhƒtƒHƒ“ƒg‚ð‘I‘ð‚Å‚«‚Ü‚¹‚ñ"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: –³Œø‚ȃƒCƒhƒtƒHƒ“ƒg‚Å‚·"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: <%c> ‚ÌŒã‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚·"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: ƒJƒ“ƒ}‚ª•K—v‚Å‚·"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' ‚Í‹ó‚Å‚ ‚é‚© %s ‚ðŠÜ‚Þ•K—v‚ª‚ ‚è‚Ü‚·"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: ƒ}ƒEƒX‚̓Tƒ|[ƒg‚³‚ê‚Ü‚¹‚ñ"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Ž®‚ªI—¹‚µ‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: —v‘f‚ª‘½‚·‚¬‚Ü‚·"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: ƒOƒ‹[ƒv‚ª’Þ‡‚¢‚Ü‚¹‚ñ"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: ƒvƒŒƒrƒ…[ƒEƒBƒ“ƒhƒE‚ªŠù‚É‘¶Ý‚µ‚Ü‚·"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr ""
+"W17: ƒAƒ‰ƒrƒA•¶Žš‚É‚ÍUTF-8‚ª•K—v‚È‚Ì‚Å, ':set encoding=utf-8' ‚µ‚Ä‚­‚¾‚³‚¢"
+
+#: option.c:6776
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Å’á %d ‚Ìs”‚ª•K—v‚Å‚·"
+
+#: option.c:6786
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Å’á %d ‚̃Jƒ‰ƒ€•‚ª•K—v‚Å‚·"
+
+#: option.c:7093
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: –¢’m‚̃IƒvƒVƒ‡ƒ“‚Å‚·: %s"
+
+#: option.c:7213
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- ’[––ƒR[ƒh ---"
+
+#: option.c:7215
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- ƒOƒ[ƒoƒ‹ƒIƒvƒVƒ‡ƒ“’l ---"
+
+#: option.c:7217
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- ƒ[ƒJƒ‹ƒIƒvƒVƒ‡ƒ“’l ---"
+
+#: option.c:7219
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- ƒIƒvƒVƒ‡ƒ“ ---"
+
+#: option.c:7925
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ƒGƒ‰["
+
+#: option.c:8896
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': %s ‚ɑΉž‚·‚镶Žš‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: option.c:8930
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ƒZƒ~ƒRƒƒ“‚ÌŒã‚É—]•ª‚È•¶Žš‚ª‚ ‚è‚Ü‚·: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "ŠJ‚¯‚Ü‚¹‚ñ "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ƒEƒBƒ“ƒhƒE‚ðŠJ‚¯‚Ü‚¹‚ñ!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Amigados‚̃o[ƒWƒ‡ƒ“ 2.04‚©‚»‚êˆÈ~‚ª•K—v‚Å‚·\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "%s ‚̃o[ƒWƒ‡ƒ“ %ld ‚ª•K—v‚Å‚·\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "NIL‚ðŠJ‚¯‚Ü‚¹‚ñ:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "쬂ł«‚Ü‚¹‚ñ "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim‚Í %d ‚ÅI—¹‚µ‚Ü‚·\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "ƒRƒ“ƒ\\[ƒ‹ƒ‚[ƒh‚ð•ÏX‚Å‚«‚Ü‚¹‚ñ?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ƒRƒ“ƒ\\[ƒ‹‚Å‚Í‚È‚¢??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: -f ƒIƒvƒVƒ‡ƒ“‚ŃVƒFƒ‹‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "ŽÀs‚Å‚«‚Ü‚¹‚ñ "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "ƒVƒFƒ‹ "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " –ß‚è‚Ü‚µ‚½\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ‚ª¬‚³‚·‚¬‚Ü‚·."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "“üo—̓Gƒ‰["
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(È—ª)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ‚ª80‚Å‚Í‚È‚¢‚½‚ß, ŠO•”ƒRƒ}ƒ“ƒh‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E237: ƒvƒŠƒ“ƒ^‚Ì‘I‘ð‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "%s ‚Ö (%s ã‚Ì)"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: –¢’m‚̃vƒŠƒ“ƒ^ƒIƒvƒVƒ‡ƒ“‚Å‚·: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ˆóüƒGƒ‰[: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "•s–¾"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "ˆóü‚µ‚Ä‚¢‚Ü‚·: '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: •¶ŽšƒZƒbƒg–¼ \"%s\" ‚Í•s³‚Å‚· (ƒtƒHƒ“ƒg–¼ \"%s\")"
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: '%c' ‚Í•s³‚È•¶Žš‚Å‚· (ƒtƒHƒ“ƒg–¼ \"%s\")"
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: –³Œø‚È 'osfiletype' ƒIƒvƒVƒ‡ƒ“ - \"Text\" ‚ðŽg‚¢‚Ü‚·"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: 2d‚̃VƒOƒiƒ‹‚Ì‚½‚ß, I—¹‚µ‚Ü‚·\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: ’v–½“IƒVƒOƒiƒ‹ %s ‚ðŒŸ’m‚µ‚Ü‚µ‚½\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: ’v–½“IƒVƒOƒiƒ‹‚ðŒŸ’m‚µ‚Ü‚µ‚½\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "XƒT[ƒo‚Ö‚ÌÚ‘±‚É %ld ƒ~ƒŠ•b‚©‚©‚è‚Ü‚µ‚½"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X ‚̃Gƒ‰[‚ðŒŸo‚µ‚Ü‚µ‚½r\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "X display ‚̃`ƒFƒbƒN‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "X display ‚Ì open ‚ªƒ^ƒCƒ€ƒAƒEƒg‚µ‚Ü‚µ‚½"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"ƒVƒFƒ‹‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"sh ƒVƒFƒ‹‚ðŽÀs‚Å‚«‚Ü‚¹‚ñ\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"ƒVƒFƒ‹‚ª’l‚ð•Ô‚µ‚Ü‚µ‚½ "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"ƒpƒCƒv‚ð쬂ł«‚Ü‚¹‚ñ\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"fork ‚Å‚«‚Ü‚¹‚ñ\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"ƒRƒ}ƒ“ƒh‚ð’†’f‚µ‚Ü‚µ‚½\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP ‚ªICEÚ‘±‚ðŽ¸‚¢‚Ü‚µ‚½"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "X display ‚Ì open ‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP ‚ªsave-yourself—v‹‚ðˆ—‚µ‚Ä‚¢‚Ü‚·"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP ‚ªÚ‘±‚ðŠJŽn‚µ‚Ä‚¢‚Ü‚·"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP ICEÚ‘±‚ªŽ¸”s‚µ‚½‚悤‚Å‚·"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection‚ªŽ¸”s‚µ‚Ü‚µ‚½: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "s"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚Ƀƒ‚ƒŠ‚ðŠ„‚è“–‚Ä‚ç‚ê‚Ü‚¹‚ñ"
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "VIMƒGƒ‰["
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "vim32.dll ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "DLL‚©‚çŠÖ”ƒ|ƒCƒ“ƒ^‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: os_win16.c:342 os_win32.c:3197
+#, c-format
+msgid "shell returned %d"
+msgstr "ƒVƒFƒ‹‚ªƒR[ƒh %d ‚ÅI—¹‚µ‚Ü‚µ‚½"
+
+#: os_win32.c:2655
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: ƒCƒxƒ“ƒg %s ‚ðŒŸ’m\n"
+
+#: os_win32.c:2657
+msgid "close"
+msgstr "•Â‚¶‚é"
+
+#: os_win32.c:2659
+msgid "logoff"
+msgstr "ƒƒOƒIƒt"
+
+#: os_win32.c:2660
+msgid "shutdown"
+msgstr "ƒVƒƒƒbƒgƒ_ƒEƒ“"
+
+#: os_win32.c:3150
+msgid "E371: Command not found"
+msgstr "E371: ƒRƒ}ƒ“ƒh‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: os_win32.c:3163
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE‚ª $PATH ‚Ì’†‚ɂ݂‚©‚è‚Ü‚¹‚ñ.\n"
+"ŠO•”ƒRƒ}ƒ“ƒh‚ÌI—¹Œã‚Ɉꎞ’âŽ~‚ð‚µ‚Ü‚¹‚ñ.\n"
+"Ú×‚Í :help win32-vimrun ‚ðŽQÆ‚µ‚Ä‚­‚¾‚³‚¢."
+
+#: os_win32.c:3166
+msgid "Vim Warning"
+msgstr "Vim‚ÌŒx"
+
+#: quickfix.c:258
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚É %%%c ‚ª‘½‚·‚¬‚Ü‚·"
+
+#: quickfix.c:271
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚É—\\Šú‚¹‚Ê %%%c ‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚É ] ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: quickfix.c:339
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚Å‚Í %%%c ‚̓Tƒ|[ƒg‚³‚ê‚Ü‚¹‚ñ"
+
+#: quickfix.c:357
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚Ì‘O’u‚É–³Œø‚È %%%c ‚ª‚ ‚è‚Ü‚·"
+
+#: quickfix.c:365
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: ƒtƒH[ƒ}ƒbƒg•¶Žš—ñ‚É–³Œø‚È %%%c ‚ª‚ ‚è‚Ü‚·"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' ‚Ƀpƒ^[ƒ“‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ƒfƒBƒŒƒNƒgƒŠ–¼‚ª–³‚¢‚©‹ó‚Å‚·"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: —v‘f‚ª‚à‚¤‚ ‚è‚Ü‚¹‚ñ"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d of %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (s‚ªíœ‚³‚ê‚Ü‚µ‚½)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: quickfix ƒXƒ^ƒbƒN‚Ì––”ö‚Å‚·"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: quickfix ƒXƒ^ƒbƒN‚Ì擪‚Å‚·"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "ƒGƒ‰[ˆê—— %d of %d; %d ŒÂƒGƒ‰["
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: 'buftype' ƒIƒvƒVƒ‡ƒ“‚ªÝ’肳‚ê‚Ä‚¢‚é‚Ì‚Å‘ž‚Ý‚Ü‚¹‚ñ"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: ƒpƒ^[ƒ“‚ª’·‚·‚¬‚Ü‚·"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: \\z( ‚ª‘½‚·‚¬‚Ü‚·"
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: %s( ‚ª‘½‚·‚¬‚Ü‚·"
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: \\z( ‚ª’ނ臂Á‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: regexp.c:1081
+msgid "E53: Unmatched %s%%("
+msgstr "E53: %s%%( ‚ª’ނ臂Á‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: %s( ‚ª’ނ臂Á‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: %s) ‚ª’ނ臂Á‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s* ‚ª‹ó•¶Žš—ñ‚É‚È‚é‰Â”\\«‚ª‚ ‚è‚Ü‚·"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: %s+ ‚ª‹ó•¶Žš—ñ‚É‚È‚é‰Â”\\«‚ª‚ ‚è‚Ü‚·"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: %s@ ‚ÌŒã‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{ ‚ª‹ó•¶Žš—ñ‚É‚È‚é‰Â”\\«‚ª‚ ‚è‚Ü‚·"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: •¡ŽG‚È %s{...} ‚ª‘½‚·‚¬‚Ü‚·"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61:%s* ‚ª“ü‚êŽq‚É‚È‚Á‚Ä‚¢‚Ü‚·"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62:%s%c ‚ª“ü‚êŽq‚É‚È‚Á‚Ä‚¢‚Ü‚·"
+
+#
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: \\_ ‚Ì–³Œø‚ÈŽg—p•û–@‚Å‚·"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64:%s%c ‚ÌŒã‚É‚È‚É‚à‚ ‚è‚Ü‚¹‚ñ"
+
+#
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: •s³‚ÈŒã•ûŽQÆ‚Å‚·"
+
+#
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ‚̓RƒR‚Å‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 ‚»‚Ì‘¼‚̓RƒR‚Å‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: \\z ‚ÌŒã‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚µ‚½"
+
+#
+#: regexp.c:1684
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: %s%%[ ‚ÌŒã‚É ] ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: regexp.c:1700
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] ‚ª‹ó‚Å‚·"
+
+#
+#: regexp.c:1760
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: %s%% ‚ÌŒã‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚µ‚½"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: %s{...} “à‚É•¶–@ƒGƒ‰[‚ª‚ ‚è‚Ü‚·"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ƒNƒ‰ƒbƒVƒ…‚É‚æ‚è’†’f; ³‹K•\\Œ»‚ª•¡ŽG‰ß‚¬‚é‚©‚à?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: ƒpƒ^[ƒ“‚É‚æ‚éƒXƒ^ƒbƒN•s‘«ƒGƒ‰[‚Å‚·"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "ŠO•”‚Ì•”•ªŠY“–:\n"
+
+#: screen.c:2143
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld s‚ªÜô‚Ü‚ê‚Ü‚µ‚½"
+
+#: screen.c:7959
+msgid " VREPLACE"
+msgstr " ‰¼‘z’uŠ·"
+
+#: screen.c:7963
+msgid " REPLACE"
+msgstr " ’uŠ·"
+
+#: screen.c:7968
+msgid " REVERSE"
+msgstr " ”½“]"
+
+#: screen.c:7970
+msgid " INSERT"
+msgstr " ‘}“ü"
+
+#: screen.c:7973
+msgid " (insert)"
+msgstr " (‘}“ü)"
+
+#: screen.c:7975
+msgid " (replace)"
+msgstr " (’uŠ·)"
+
+#: screen.c:7977
+msgid " (vreplace)"
+msgstr " (‰¼‘z’uŠ·)"
+
+#: screen.c:7980
+msgid " Hebrew"
+msgstr " ƒwƒuƒ‰ƒC"
+
+#: screen.c:7991
+msgid " Arabic"
+msgstr " ƒAƒ‰ƒrƒA"
+
+#: screen.c:7994
+msgid " (lang)"
+msgstr " (Œ¾Œê)"
+
+#: screen.c:7998
+msgid " (paste)"
+msgstr " (“\\‚è•t‚¯)"
+
+#: screen.c:8011
+msgid " VISUAL"
+msgstr " ƒrƒWƒ…ƒAƒ‹"
+
+#: screen.c:8012
+msgid " VISUAL LINE"
+msgstr " ƒrƒWƒ…ƒAƒ‹ s"
+
+#: screen.c:8013
+msgid " VISUAL BLOCK"
+msgstr " ƒrƒWƒ…ƒAƒ‹ ‹éŒ`"
+
+#: screen.c:8014
+msgid " SELECT"
+msgstr " ƒZƒŒƒNƒg"
+
+#: screen.c:8015
+msgid " SELECT LINE"
+msgstr " sŽwŒü‘I‘ð"
+
+#: screen.c:8016
+msgid " SELECT BLOCK"
+msgstr " ‹éŒ`‘I‘ð"
+
+# msgid " BLOCK"
+# msgstr " ƒuƒƒbƒN"
+# msgid " LINE"
+# msgstr " s"
+#: screen.c:8031 screen.c:8094
+msgid "recording"
+msgstr "‹L˜^’†"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ã‚Ü‚ÅŒŸõ‚µ‚½‚̂ʼnº‚É–ß‚è‚Ü‚·"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "‰º‚Ü‚ÅŒŸõ‚µ‚½‚Ì‚Åã‚É–ß‚è‚Ü‚·"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: –³Œø‚ÈŒŸõ•¶Žš—ñ‚Å‚·: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ã‚Ü‚ÅŒŸõ‚µ‚½‚¯‚ê‚ÇŠY“–‰ÓŠ‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ‰º‚Ü‚ÅŒŸõ‚µ‚½‚¯‚ê‚ÇŠY“–‰ÓŠ‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ';' ‚Ì‚ ‚Æ‚É‚Í '?' ‚© '/' ‚ªŠú‘Ò‚³‚ê‚Ä‚¢‚é"
+
+#: search.c:3758
+msgid " (includes previously listed match)"
+msgstr " (‘O‚É—ñ‹“‚µ‚½ŠY“–‰ÓŠ‚ðŠÜ‚Þ)"
+
+#. cursor at status line
+#: search.c:3778
+msgid "--- Included files "
+msgstr "--- ƒCƒ“ƒNƒ‹[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹"
+
+#: search.c:3780
+msgid "not found "
+msgstr "‚݂‚©‚è‚Ü‚¹‚ñ "
+
+#: search.c:3781
+msgid "in path ---\n"
+msgstr "ƒpƒX‚É ----\n"
+
+#: search.c:3820
+msgid " (Already listed)"
+msgstr " (Šù‚É—ñ‹“)"
+
+#: search.c:3822
+msgid " NOT FOUND"
+msgstr " ‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: search.c:3874
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "ƒCƒ“ƒNƒ‹[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚ðƒXƒLƒƒƒ“’†: %s"
+
+#: search.c:4092
+msgid "E387: Match is on current line"
+msgstr "E387: Œ»Ýs‚ÉŠY“–‚ª‚ ‚è‚Ü‚·"
+
+#: search.c:4235
+msgid "All included files were found"
+msgstr "‘S‚ẴCƒ“ƒNƒ‹[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚ª‚݂‚©‚è‚Ü‚µ‚½"
+
+#: search.c:4237
+msgid "No included files"
+msgstr "ƒCƒ“ƒNƒ‹[ƒhƒtƒ@ƒCƒ‹‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: search.c:4253
+msgid "E388: Couldn't find definition"
+msgstr "E388: ’è‹`‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: search.c:4255
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ƒpƒ^[ƒ“‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: •s³‚Ȉø”‚Å‚·: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ‚»‚̂悤‚È\\•¶ƒNƒ‰ƒXƒ^‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "‚±‚̃oƒbƒtƒ@‚É’è‹`‚³‚ꂽ\\•¶—v‘f‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "CŒ¾Œê•—ƒRƒƒ“ƒg‚©‚瓯Šú’†"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "”ñ“¯Šú"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "“¯ŠúŠJŽn "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " s‘O(ƒgƒbƒvs‚æ‚è‚à)"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- \\•¶“¯Šú—v‘f ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"—v‘fã‚Å“¯Šú’†"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- \\•¶—v‘f ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ‚»‚̂悤‚È\\•¶ƒNƒ‰ƒXƒ^‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimal"
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "maximal"
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; ŠY“– "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " ŒÂ‚̉üs"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ‚±‚±‚ł̓Oƒ‹[ƒv‚Í‹–‰Â‚³‚ê‚Ü‚¹‚ñ"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: %s ‚͈̔͗v‘f‚ª‚݂‚©‚è‚Ü‚¹‚ñ"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ‚±‚Ìꊂł͈ø”contains‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ‚±‚Ìꊂł͈ø”containedin‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: ƒtƒ@ƒCƒ‹–¼‚ª•K—v‚Å‚·"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: '=' ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: ˆø”‚ª‘«‚è‚Ü‚¹‚ñ: \\•¶”ÍˆÍ %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: ƒNƒ‰ƒXƒ^‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ƒpƒ^[ƒ“‹æ؂肪‚݂‚©‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: ƒpƒ^[ƒ“‚Ì‚ ‚ƂɃSƒ~‚ª‚ ‚è‚Ü‚·: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: \\•¶“¯Šú: ˜A‘±sƒpƒ^[ƒ“‚ª2“xŽw’肳‚ê‚Ü‚µ‚½"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: •s³‚Ȉø”‚Å‚·: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: “™‚µ‚¢ sign ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ‹ó‚̈ø”: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ‚̓RƒR‚Å‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ‚Í“à—eƒŠƒXƒg‚Ì擪‚Å‚È‚¯‚ê‚΂Ȃç‚È‚¢"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: –¢’m‚̃Oƒ‹[ƒv–¼: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: –³Œø‚È :syntax ‚̃TƒuƒRƒ}ƒ“ƒh: %s"
+
+#: syntax.c:6134
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ƒnƒCƒ‰ƒCƒgƒOƒ‹[ƒv‚ª‚݂‚©‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:6158
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: ˆø”‚ª[•ª‚Å‚Í‚È‚¢: \":highlight link %s\""
+
+#: syntax.c:6165
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: ˆø”‚ª‘½‚·‚¬‚Ü‚·: \":highlight link %s\""
+
+#: syntax.c:6185
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ƒOƒ‹[ƒv‚ªÝ’肳‚ê‚Ä‚¢‚é‚̂ŃnƒCƒ‰ƒCƒgƒŠƒ“ƒN‚Í–³Ž‹‚³‚ê‚Ü‚·"
+
+#: syntax.c:6314
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: —\\Šú‚¹‚Ê“¯‚¶ sign ‚Å‚·: %s"
+
+#: syntax.c:6350
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: “¯‚¶ sign ‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:6378
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ˆø”‚ª‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:6415
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: •s³‚È’l‚Å‚·: %s"
+
+#: syntax.c:6534
+msgid "E419: FG color unknown"
+msgstr "E419: –¢’m‚Ì‘OŒiF‚Å‚·"
+
+#: syntax.c:6545
+msgid "E420: BG color unknown"
+msgstr "E420: –¢’m‚Ì”wŒiF‚Å‚·"
+
+#: syntax.c:6606
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: ƒJƒ‰[–¼‚â”Ô†‚ð”FŽ¯‚Å‚«‚Ü‚¹‚ñ: %s"
+
+#: syntax.c:6812
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: I’[ƒR[ƒh‚ª’·‚·‚¬‚Ü‚·: %s"
+
+#: syntax.c:6859
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: •s³‚Ȉø”‚Å‚·: %s"
+
+#: syntax.c:7388
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ‘½‚­‚̈قȂéƒnƒCƒ‰ƒCƒg‘®«‚ªŽg‚í‚ê‚·‚¬‚Ä‚¢‚Ü‚·"
+
+#: syntax.c:7909
+msgid "E669: Unprintable character in group name"
+msgstr "E669: ƒOƒ‹[ƒv–¼‚Ɉóü•s‰Â”\\‚È•¶Žš‚ª‚ ‚è‚Ü‚·"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7916
+msgid "W18: Invalid character in group name"
+msgstr "W18: ƒOƒ‹[ƒv–¼‚É•s³‚È•¶Žš‚ª‚ ‚è‚Ü‚·"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: ƒ^ƒOƒXƒ^ƒbƒN‚Ì––”ö‚Å‚·"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: ƒ^ƒOƒXƒ^ƒbƒN‚Ì擪‚Å‚·"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ʼn‚ÌŠY“–ƒ^ƒO‚ð’´‚¦‚Ė߂邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ƒ^ƒO‚ª‚݂‚©‚è‚Ü‚¹‚ñ: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "ƒtƒ@ƒCƒ‹\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "‘I‘ð‚·‚é”Ô†‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢ (<CR>‚Å’†Ž~): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: ŠY“–ƒ^ƒO‚ª1‚‚¾‚¯‚µ‚©‚ ‚è‚Ü‚¹‚ñ"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ÅŒã‚ÉŠY“–‚·‚éƒ^ƒO‚ð’´‚¦‚Äi‚Þ‚±‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "ƒtƒ@ƒCƒ‹ \"%s\" ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ƒ^ƒO %d (‘S%d%s)"
+
+#: tag.c:826
+msgid " or more"
+msgstr " ‚©‚»‚êˆÈã"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " ƒ^ƒO‚ðˆÙ‚È‚écase‚ÅŽg—p‚µ‚Ü‚·!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: ƒtƒ@ƒCƒ‹ \"%s\" ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # TO ƒ^ƒO FROM s in file/text"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "ƒ^ƒOƒtƒ@ƒCƒ‹ %s ‚ðŒŸõ’†"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: ƒ^ƒOƒtƒ@ƒCƒ‹‚̃pƒX‚ª %s ‚ÉØ‚èŽÌ‚Ä‚ç‚ê‚Ü‚µ‚½\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: ƒ^ƒOƒtƒ@ƒCƒ‹ \"%s\" ‚̃tƒH[ƒ}ƒbƒg‚ɃGƒ‰[‚ª‚ ‚è‚Ü‚·"
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "’¼‘O‚Ì %ld ƒoƒCƒg"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: ƒ^ƒOƒtƒ@ƒCƒ‹‚ªƒ\\[ƒg‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: ƒ^ƒOƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: ƒ^ƒOƒpƒ^[ƒ“‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: ƒ^ƒO‚ð‚݂‚¯‚ç‚ê‚È‚¢‚Ì‚Å’P‚É„‘ª‚µ‚Ü‚·!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ‚Í–¢’m‚Å‚·. Œ»s‚Ì‘g‚Ýž‚Ý’[––‚ÍŽŸ‚Ì‚Æ‚¨‚è‚Å‚·:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "È—ª’l‚ðŽŸ‚Ì‚æ‚¤‚Éݒ肵‚Ü‚· '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: termcapƒtƒ@ƒCƒ‹‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: terminfo‚É’[––ƒGƒ“ƒgƒŠ‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: termcap‚É’[––ƒGƒ“ƒgƒŠ‚ð‚݂‚¯‚ç‚ê‚Ü‚¹‚ñ"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap‚É \"%s\" ‚̃Gƒ“ƒgƒŠ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ’[––‚É \"cm\" ‹@”\\‚ª•K—v‚Å‚·"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- ’[––ƒL[ ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "V‚µ‚¢ƒVƒFƒ‹‚ð‹N“®‚µ‚Ü‚·\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: “ü—Í‚ð“Çž‚Ý’†‚̃Gƒ‰[‚É‚æ‚èI—¹‚µ‚Ü‚·...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "‰Â”\\‚ȃAƒ“ƒhƒD‚Í‚ ‚è‚Ü‚¹‚ñ: ‚Æ‚è‚ ‚¦‚¸‘±‚¯‚Ü‚·"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: s”Ô†‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 ‰ÓŠ•ÏX‚µ‚Ü‚µ‚½"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld ‰ÓŠ•ÏX‚µ‚Ü‚µ‚½"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: ƒAƒ“ƒhƒDƒŠƒXƒg‚ª‰ó‚ê‚Ä‚¢‚Ü‚·"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: ƒAƒ“ƒhƒDs‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:1731
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 ƒrƒbƒg GUI ”Å"
+
+#: version.c:1733
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 ƒrƒbƒg GUI ”Å"
+
+#: version.c:1736
+msgid " in Win32s mode"
+msgstr " in Win32s ƒ‚[ƒh"
+
+#: version.c:1738
+msgid " with OLE support"
+msgstr " with OLE ƒTƒ|[ƒg"
+
+#: version.c:1741
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 ƒrƒbƒg ƒRƒ“ƒ\\[ƒ‹ ”Å"
+
+#: version.c:1745
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16 ƒrƒbƒg ”Å"
+
+#: version.c:1749
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 ƒrƒbƒg MS-DOS ”Å"
+
+#: version.c:1751
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 ƒrƒbƒg MS-DOS ”Å"
+
+#: version.c:1757
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) Ӂ"
+
+#: version.c:1759
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X Ӂ"
+
+#: version.c:1762
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS Ӂ"
+
+#: version.c:1767
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS Ӂ"
+
+#: version.c:1777
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"“K—pσpƒbƒ`: "
+
+#: version.c:1803 version.c:2171
+msgid "Modified by "
+msgstr "Modified by "
+
+#: version.c:1810
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compiled "
+
+#: version.c:1813
+msgid "by "
+msgstr "by "
+
+#: version.c:1825
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Huge Ӂ "
+
+#: version.c:1828
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Big Ӂ "
+
+#: version.c:1831
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"’Êí ”Å "
+
+#: version.c:1834
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Small Ӂ "
+
+#: version.c:1836
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Tiny Ӂ "
+
+#: version.c:1842
+msgid "without GUI."
+msgstr "without GUI."
+
+#: version.c:1847
+msgid "with GTK2-GNOME GUI."
+msgstr "with GTK2-GNOME GUI."
+
+#: version.c:1849
+msgid "with GTK-GNOME GUI."
+msgstr "with GTK-GNOME GUI."
+
+#: version.c:1853
+msgid "with GTK2 GUI."
+msgstr "with GTK2 GUI."
+
+#: version.c:1855
+msgid "with GTK GUI."
+msgstr "with GTK GUI."
+
+#: version.c:1860
+msgid "with X11-Motif GUI."
+msgstr "with X11-Motif GUI."
+
+#: version.c:1864
+msgid "with X11-neXtaw GUI."
+msgstr "with X11-neXtaw GUI."
+
+#: version.c:1866
+msgid "with X11-Athena GUI."
+msgstr "with X11-Athena GUI."
+
+#: version.c:1870
+msgid "with BeOS GUI."
+msgstr "with BeOS GUI."
+
+#: version.c:1873
+msgid "with Photon GUI."
+msgstr "with Photon GUI."
+
+#: version.c:1876
+msgid "with GUI."
+msgstr "with GUI."
+
+#: version.c:1879
+msgid "with Carbon GUI."
+msgstr "with Carbon GUI."
+
+#: version.c:1882
+msgid "with Cocoa GUI."
+msgstr "with Cocoa GUI."
+
+#: version.c:1885
+msgid "with (classic) GUI."
+msgstr "with (ƒNƒ‰ƒVƒbƒN) GUI."
+
+#: version.c:1896
+msgid " Features included (+) or not (-):\n"
+msgstr " ‹@”\\‚̈ꗗ —LŒø(+)/–³Œø(-)\n"
+
+#: version.c:1908
+msgid " system vimrc file: \""
+msgstr " ƒVƒXƒeƒ€ vimrc: \""
+
+#: version.c:1913
+msgid " user vimrc file: \""
+msgstr " ƒ†[ƒU vimrc: \""
+
+#: version.c:1918
+msgid " 2nd user vimrc file: \""
+msgstr " ‘æ2ƒ†[ƒU vimrc: \""
+
+#: version.c:1923
+msgid " 3rd user vimrc file: \""
+msgstr " ‘æ3ƒ†[ƒU vimrc: \""
+
+#: version.c:1928
+msgid " user exrc file: \""
+msgstr " ƒ†[ƒU exrc: \""
+
+#: version.c:1933
+msgid " 2nd user exrc file: \""
+msgstr " ‘æ2ƒ†[ƒU exrc: \""
+
+#: version.c:1939
+msgid " system gvimrc file: \""
+msgstr " ƒVƒXƒeƒ€ gvimrc: \""
+
+#: version.c:1943
+msgid " user gvimrc file: \""
+msgstr " ƒ†[ƒU gvimrc: \""
+
+#: version.c:1947
+msgid "2nd user gvimrc file: \""
+msgstr " ‘æ2ƒ†[ƒU gvimrc: \""
+
+#: version.c:1952
+msgid "3rd user gvimrc file: \""
+msgstr " ‘æ3ƒ†[ƒU gvimrc: \""
+
+#: version.c:1959
+msgid " system menu file: \""
+msgstr " ƒVƒXƒeƒ€ƒƒjƒ…[: \""
+
+#: version.c:1967
+msgid " fall-back for $VIM: \""
+msgstr " È—ªŽž‚Ì $VIM: \""
+
+#: version.c:1973
+msgid " f-b for $VIMRUNTIME: \""
+msgstr "È—ªŽž‚Ì $VIMRUNTIME: \""
+
+#: version.c:1977
+msgid "Compilation: "
+msgstr "ƒRƒ“ƒpƒCƒ‹: "
+
+#: version.c:1983
+msgid "Compiler: "
+msgstr "ƒRƒ“ƒpƒCƒ‰: "
+
+#: version.c:1988
+msgid "Linking: "
+msgstr "ƒŠƒ“ƒN: "
+
+#: version.c:1993
+msgid " DEBUG BUILD"
+msgstr "ƒfƒoƒbƒOƒrƒ‹ƒh"
+
+#: version.c:2032
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:2034
+msgid "version "
+msgstr "version "
+
+#: version.c:2035
+msgid "by Bram Moolenaar et al."
+msgstr "by Bram Moolenaar ‘¼."
+
+#: version.c:2039
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ‚̓I[ƒvƒ“ƒ\\[ƒX‚Å‚ ‚莩—R‚É”z•z‰Â”\\‚Å‚·"
+
+#: version.c:2041
+msgid "Help poor children in Uganda!"
+msgstr "ƒEƒKƒ“ƒ_‚ÌŒb‚Ü‚ê‚È‚¢Žq‹Ÿ‚½‚¿‚ɉ‡•‚ð!"
+
+#: version.c:2042
+msgid "type :help iccf<Enter> for information "
+msgstr "ÚׂÈî•ñ‚Í :help iccf<Enter> "
+
+#: version.c:2044
+msgid "type :q<Enter> to exit "
+msgstr "I—¹‚·‚é‚É‚Í :q<Enter> "
+
+#: version.c:2045
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "ƒIƒ“ƒ‰ƒCƒ“ƒwƒ‹ƒv‚Í :help<Enter> ‚© <F1> "
+
+#: version.c:2046
+msgid "type :help version6<Enter> for version info"
+msgstr "ƒo[ƒWƒ‡ƒ“î•ñ‚Í :help version6<Enter> "
+
+#: version.c:2049
+msgid "Running in Vi compatible mode"
+msgstr "ViŒÝŠ·ƒ‚[ƒh‚Å“®ì’†"
+
+#: version.c:2050
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "Vim„§’l‚É‚·‚é‚É‚Í :set nocp<Enter> "
+
+#: version.c:2051
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "ÚׂÈî•ñ‚Í :help cp-default<Enter>"
+
+#: version.c:2066
+msgid "menu Help->Orphans for information "
+msgstr "Úׂ̓ƒjƒ…[‚Ì ƒwƒ‹ƒv¨ŒÇŽ™ ‚ðŽQÆ‚µ‚ĉº‚³‚¢ "
+
+#: version.c:2068
+msgid "Running modeless, typed text is inserted"
+msgstr "ƒ‚[ƒh–³‚ÅŽÀs’†, ƒ^ƒCƒv‚µ‚½•¶Žš‚ª‘}“ü‚³‚ê‚Ü‚·"
+
+#: version.c:2069
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "ƒƒjƒ…[‚Ì •ÒW¨‘S‘Ìݒ訑}“ü(‰SŽÒ)ƒ‚[ƒhØ‘Ö"
+
+#: version.c:2070
+msgid " for two modes "
+msgstr " ‚Ń‚[ƒh—L‚É "
+
+#: version.c:2074
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "ƒƒjƒ…[‚Ì •ÒW¨‘S‘ÌÝ’è¨ViŒÝŠ·ƒ‚[ƒhØ‘Ö "
+
+#: version.c:2075
+msgid " for Vim defaults "
+msgstr " ‚ÅVim‚Æ‚µ‚Ä“®ì "
+
+#: version.c:2122
+msgid "Sponsor Vim development!"
+msgstr "Vim‚ÌŠJ”­‚ð‰ž‰‡‚µ‚Ä‚­‚¾‚³‚¢!"
+
+#: version.c:2123
+msgid "Become a registered Vim user!"
+msgstr "Vim‚Ì“o˜^ƒ†[ƒU‚É‚È‚Á‚Ä‚­‚¾‚³‚¢!"
+
+#: version.c:2126
+msgid "type :help sponsor<Enter> for information "
+msgstr "ÚׂÈî•ñ‚Í :help sponsor<Enter> "
+
+#: version.c:2127
+msgid "type :help register<Enter> for information "
+msgstr "ÚׂÈî•ñ‚Í :help register<Enter> "
+
+#: version.c:2129
+msgid "menu Help->Sponsor/Register for information "
+msgstr "Úׂ̓ƒjƒ…[‚Ì ƒwƒ‹ƒv¨ƒXƒ|ƒ“ƒT[/“o˜^ ‚ðŽQÆ‚µ‚ĉº‚³‚¢ "
+
+#: version.c:2139
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr " Œx: Windows 95/98/Me ‚ðŒŸo "
+
+#: version.c:2142
+msgid "type :help windows95<Enter> for info on this"
+msgstr " ÚׂÈî•ñ‚Í :help windows95<Enter> "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: ƒvƒŒƒrƒ…[ƒEƒBƒ“ƒhƒE‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ¶ã‚ƉE‰º‚𓯎ž‚É•ªŠ„‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ‘¼‚̃EƒBƒ“ƒhƒE‚ª•ªŠ„‚³‚ê‚Ä‚¢‚鎞‚ɂ͇‰ñ‚Å‚«‚Ü‚¹‚ñ"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: ÅŒã‚̃EƒBƒ“ƒhƒE‚ð•Â‚¶‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Šù‚ɃEƒBƒ“ƒhƒE‚Í1‚‚µ‚©‚ ‚è‚Ü‚¹‚ñ"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: ‘¼‚̃EƒBƒ“ƒhƒE‚É‚Í•ÏX‚ª‚ ‚è‚Ü‚·"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: ƒJ[ƒ\\ƒ‹‚̉º‚Ƀtƒ@ƒCƒ‹–¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: path‚É‚Í \"%s\" ‚Æ‚¢‚¤ƒtƒ@ƒCƒ‹‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1232 if_perl.xs:326
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: ƒ‰ƒCƒuƒ‰ƒŠ %s ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"‚±‚̃Rƒ}ƒ“ƒh‚Í–³Œø‚Å‚·, ‚²‚ß‚ñ‚È‚³‚¢: Perlƒ‰ƒCƒuƒ‰ƒŠ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: ƒTƒ“ƒhƒ{ƒbƒNƒX‚Å‚Í Safe "
+"ƒ‚ƒWƒ…[ƒ‹‚ðŽg—p‚µ‚È‚¢PerlƒXƒNƒŠƒvƒg‚Í‹Ö‚¶‚ç‚ê‚Ä‚¢‚Ü‚·"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Šeƒtƒ@ƒCƒ‹‚ð•ÊX‚Ì Vim ‚Å•ÒW(&M)"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "‘Sƒtƒ@ƒCƒ‹‚ð1‚Â‚Ì Vim ‚Å•ÒW(&V)"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "Vim ‚Å·•ª•ÒW(&D)"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Vim ‚Å•ÒW(&V)"
+
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Šù‘¶‚Ì Vim ‚Å•ÒW - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "‘I‘ð‚³‚ê‚½ƒtƒ@ƒCƒ‹‚ð Vim ‚Å•ÒW"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "‹N“®ƒGƒ‰[: gvim ‚ɃpƒX‚ª’Ê‚Á‚Ä‚¢‚é‚©Šm‚©‚ß‚Ä‚­‚¾‚³‚¢!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ƒGƒ‰["
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "ƒpƒX‚ª’·‚·‚¬‚Ü‚·!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "--ƒoƒbƒtƒ@‚És‚ª‚ ‚è‚Ü‚¹‚ñ--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: ƒRƒ}ƒ“ƒh‚ª’†’f‚³‚ê‚Ü‚µ‚½"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: ˆø”‚ª•K—v‚Å‚·"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ ‚ÌŒã‚Í / ‚© ? ‚© & ‚Å‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚Å‚Í–³Œø‚Å‚·; <CR>‚ÅŽÀs, CTRL-C‚Å‚â‚ß‚é"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Œ»Ý‚̃fƒBƒŒƒNƒgƒŠ‚âƒ^ƒOŒŸõ‚Å‚Íexrc/vimrc‚̃Rƒ}ƒ“ƒh‚Í‹–‰Â‚³‚ê‚Ü‚¹‚ñ"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: :endif ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: :endtry ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: :endwhile ‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: :while ‚Ì‚È‚¢ :endwhile ‚ª‚ ‚è‚Ü‚·"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: ƒtƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚Ü‚· (! ‚ð’ljÁ‚Åã‘)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: ƒRƒ}ƒ“ƒh‚ªŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: –¢’m‚̃tƒHƒ“ƒgƒZƒbƒg: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: –¢’m‚̃tƒHƒ“ƒg: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: ƒtƒHƒ“ƒg \"%s\" ‚͌Œ蕂ł͂ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: “à•”ƒGƒ‰[‚Å‚·"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "Š„ž‚Ü‚ê‚Ü‚µ‚½"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: –³Œø‚ȃAƒhƒŒƒX‚Å‚·"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: –³Œø‚Ȉø”‚Å‚·"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: –³Œø‚Ȉø”‚Å‚·: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: –³Œø‚ÈŽ®‚Å‚·: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: –³Œø‚Ȕ͈͂ł·"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: –³Œø‚ȃRƒ}ƒ“ƒh‚Å‚·"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ‚̓fƒBƒŒƒNƒgƒŠ‚Å‚·"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: —\\Šú‚¹‚Ê•¶Žš‚ª '=' ‚Ì‘O‚É‚ ‚è‚Ü‚µ‚½"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: \"%s\"() ‚̃‰ƒCƒuƒ‰ƒŠŒÄo‚ÉŽ¸”s‚µ‚Ü‚µ‚½"
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: ƒ‰ƒCƒuƒ‰ƒŠ‚ÌŠÖ” %s ‚ðƒ[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ƒ}[ƒN‚É–³Œø‚Ès”Ô†‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚µ‚½"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "E20: ƒ}[ƒN‚Íݒ肳‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: 'modifiable' ‚ªƒIƒt‚È‚Ì‚Å, •ÏX‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: ƒXƒNƒŠƒvƒg‚Ì“ü‚êŽq‚ª[‚·‚¬‚Ü‚·"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: •›ƒtƒ@ƒCƒ‹‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: ‚»‚̂悤‚È’Zk“ü—Í‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: ! ‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI‚ÍŽg—p•s‰Â”\\‚Å‚·: ƒRƒ“ƒpƒCƒ‹Žž‚É–³Œø‚É‚³‚ê‚Ä‚¢‚Ü‚·"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: ƒwƒuƒ‰ƒCŒê‚ÍŽg—p•s‰Â”\\‚Å‚·: ƒRƒ“ƒpƒCƒ‹Žž‚É–³Œø‚É‚³‚ê‚Ä‚¢‚Ü‚·\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: ƒyƒ‹ƒVƒAŒê‚ÍŽg—p•s‰Â”\\‚Å‚·: ƒRƒ“ƒpƒCƒ‹Žž‚É–³Œø‚É‚³‚ê‚Ä‚¢‚Ü‚·\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: ƒAƒ‰ƒrƒAŒê‚ÍŽg—p•s‰Â”\\‚Å‚·: ƒRƒ“ƒpƒCƒ‹Žž‚É–³Œø‚É‚³‚ê‚Ä‚¢‚Ü‚·\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ‚»‚̂悤‚È–¼‚̃nƒCƒ‰ƒCƒgƒOƒ‹[ƒv‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: ‚Ü‚¾ƒeƒLƒXƒg‚ª‘}“ü‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: ˆÈ‘O‚ɃRƒ}ƒ“ƒhs‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: ‚»‚̂悤‚ȃ}ƒbƒsƒ“ƒO‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: ŠY“–‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: ŠY“–‚Í‚ ‚è‚Ü‚¹‚ñ: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: ƒtƒ@ƒCƒ‹–¼‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ³‹K•\\Œ»’uŠ·‚ª‚Ü‚¾ŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: ƒRƒ}ƒ“ƒh‚ª‚Ü‚¾ŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: ³‹K•\\Œ»‚ª‚Ü‚¾ŽÀs‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: ”͈͎w’è‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: [•ª‚È—e—Ê‚ª‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: %s ‚Æ‚¢‚¤–¼‘O‚Ì“o˜^‚³‚ꂽƒT[ƒo‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: ƒtƒ@ƒCƒ‹ %s ‚ð쬂ł«‚Ü‚¹‚ñ"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: ˆêŽžƒtƒ@ƒCƒ‹‚Ì–¼‘O‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: ƒtƒ@ƒCƒ‹ \"%s\" ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: ƒtƒ@ƒCƒ‹ %s ‚ð“Çž‚ß‚Ü‚¹‚ñ"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: ÅŒã‚Ì•ÏX‚ª•Û‘¶‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ (! ‚ð’ljÁ‚Å•ÏX‚ð”jŠü)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: ˆø”‚ª‹ó‚Å‚·"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: ”’l‚ª—v‹‚³‚ê‚Ä‚¢‚Ü‚·"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ƒGƒ‰[ƒtƒ@ƒCƒ‹ %s ‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: ƒfƒBƒXƒvƒŒƒC‚ðŠJ‚¯‚Ü‚¹‚ñ"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: ƒƒ‚ƒŠ‚ªs‚«‰Ê‚Ä‚Ü‚µ‚½!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "ƒpƒ^[ƒ“‚݂͂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: ƒpƒ^[ƒ“‚݂͂‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: ˆø”‚ͳ‚Ì’l‚Å‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: ‘O‚̃fƒBƒŒƒNƒgƒŠ‚É–ß‚ê‚Ü‚¹‚ñ"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: ƒGƒ‰[‚Í‚ ‚è‚Ü‚¹‚ñ"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: ŠY“–•¶Žš—ñ‚ª”j‘¹‚µ‚Ä‚¢‚Ü‚·"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: •s³‚ȳ‹K•\\Œ»ƒvƒƒOƒ‰ƒ€‚Å‚·"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 'readonly' ƒIƒvƒVƒ‡ƒ“‚ªÝ’肳‚ê‚Ä‚¢‚Ü‚· (! ‚ð’ljÁ‚Åã‘‚«)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: “ÇŽæê—p•Ï” \"%s\" ‚ÉÝ’è‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ƒGƒ‰[ƒtƒ@ƒCƒ‹‚Ì“Çž’†‚ɃGƒ‰[‚ª”­¶‚µ‚Ü‚µ‚½"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ƒTƒ“ƒhƒ{ƒbƒNƒX‚Å‚Í‹–‚³‚ê‚Ü‚¹‚ñ"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: ‚±‚±‚Å‚Í‹–‰Â‚³‚ê‚Ü‚¹‚ñ"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ƒXƒNƒŠ[ƒ“ƒ‚[ƒh‚ÌÝ’è‚ɂ͑Ήž‚µ‚Ä‚¢‚Ü‚¹‚ñ"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: –³Œø‚ȃXƒNƒ[ƒ‹—Ê‚Å‚·"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell' ƒIƒvƒVƒ‡ƒ“‚ª‹ó‚Å‚·"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: sign ‚̃f[ƒ^‚ð“Çž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: ƒXƒƒbƒvƒtƒ@ƒCƒ‹‚̃Nƒ[ƒYŽžƒGƒ‰[‚Å‚·"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: ƒ^ƒOƒXƒ^ƒbƒN‚ª‹ó‚Å‚·"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: ƒRƒ}ƒ“ƒh‚ª•¡ŽG‚·‚¬‚Ü‚·"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: –¼‘O‚ª’·‚·‚¬‚Ü‚·"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: [ ‚ª‘½‚·‚¬‚Ü‚·"
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: ƒtƒ@ƒCƒ‹–¼‚ª‘½‚·‚¬‚Ü‚·"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: —]•ª‚È•¶Žš‚ªŒã‚ë‚É‚ ‚è‚Ü‚·"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: –¢’m‚̃}[ƒN"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ƒƒCƒ‹ƒhƒJ[ƒh‚ð“WŠJ‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' ‚Í 'winminheight' ‚æ‚謂³‚­‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' ‚Í 'winminwidth' ‚æ‚謂³‚­‚Å‚«‚Ü‚¹‚ñ"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: ‘ž‚Ý’†‚̃Gƒ‰["
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "ƒ[ƒƒJƒEƒ“ƒg"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: ƒXƒNƒŠƒvƒgˆÈŠO‚Å<SID>‚ªŽg‚í‚ê‚Ü‚µ‚½"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: –³Œø‚ÈŽ®‚ðŽó‚¯Žæ‚è‚Ü‚µ‚½"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: —̈悪•ÛŒì‚³‚ê‚Ä‚¢‚é‚Ì‚Å, •ÏX‚Å‚«‚Ü‚¹‚ñ"
diff --git a/src/po/ko.po b/src/po/ko.po
new file mode 100644
index 000000000..2b4ca8575
--- /dev/null
+++ b/src/po/ko.po
@@ -0,0 +1,6580 @@
+# Korean translation for Vim
+#
+# FIRST AUTHOR Nam SungHyun <namsh@kldp.org>, 2000-2004
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim 6.3\n"
+"Report-Msgid-Bugs-To: Nam SungHyun <namsh@kldp.org>\n"
+"POT-Creation-Date: 2004-05-17 17:27+0900\n"
+"PO-Revision-Date: 2004-05-17 18:17+0900\n"
+"Last-Translator: Nam SungHyun <namsh@kldp.org>\n"
+"Language-Team: GTP Korean <gnome-kr-translation@gnome.or.kr>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=euc-kr\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ¹öÆÛ¸¦ ÇÒ´çÇÒ ¼ö ¾ø¾î¼­ ³¡³À´Ï´Ù..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ¹öÆÛ¸¦ ÇÒ´çÇÒ ¼ö ¾ø¾î¼­ ´Ù¸¥ °É »ç¿ëÇÕ´Ï´Ù..."
+
+#: buffer.c:805
+#, c-format
+msgid "E515: No buffers were unloaded"
+msgstr "E515: ³»·ÁÁø ¹öÆÛ°¡ ¾ø½À´Ï´Ù"
+
+#: buffer.c:807
+#, c-format
+msgid "E516: No buffers were deleted"
+msgstr "E516: Áö¿öÁø ¹öÆÛ°¡ ¾ø½À´Ï´Ù"
+
+#: buffer.c:809
+#, c-format
+msgid "E517: No buffers were wiped out"
+msgstr "E517: ¿ÏÀüÈ÷ Áö¿öÁø ¹öÆÛ°¡ ¾ø½À´Ï´Ù"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "¹öÆÛ ÇÑ °³°¡ ³»·ÁÁ³½À´Ï´Ù"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "¹öÆÛ %d °³°¡ ³»·ÁÁ³½À´Ï´Ù"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "¹öÆÛ ÇÑ °³°¡ Áö¿öÁ³½À´Ï´Ù"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "¹öÆÛ %d °³°¡ Áö¿öÁ³½À´Ï´Ù"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "¹öÆÛ ÇÑ °³°¡ ¿ÏÀüÈ÷ Áö¿öÁ³½À´Ï´Ù"
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "¹öÆÛ %d°³°¡ ¿ÏÀüÈ÷ Áö¿öÁ³½À´Ï´Ù"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: ¹Ù²ï ¹öÆÛ¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: ³ª¿­µÈ ¹öÆÛ°¡ ¾ø½À´Ï´Ù"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: ¹öÆÛ %ldÀÌ(°¡) Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ¸¶Áö¸· ¹öÆÛÀÔ´Ï´Ù"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ù ¹ø° ¹öÆÛÀÔ´Ï´Ù"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr ""
+"E89: ¹öÆÛ %ldÀ»(¸¦) ¸¶Áö¸·À¸·Î °íÄ£ µÚ ÀúÀåÇÏÁö ¾Ê¾Ò½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇÏ"
+"±â)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ¸¶Áö¸· ¹öÆÛ¸¦ ³»¸± ¼ö ¾ø½À´Ï´Ù"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: °æ°í: ÆÄÀÏ À̸§ ¸ñ·ÏÀÌ ³ÑÃƽÀ´Ï´Ù"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: ¹öÆÛ %ldÀ»(¸¦) ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: %sÀ»(¸¦) Çϳª ÀÌ»ó ã¾Ò½À´Ï´Ù"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: %s¿Í ¸Â´Â ¹öÆÛ°¡ ¾ø½À´Ï´Ù"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "%ld ÁÙ"
+
+#: buffer.c:2422
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ÀÌ À̸§À» °¡Áø ¹öÆÛ°¡ ÀÌ¹Ì ÀÖ½À´Ï´Ù"
+
+#: buffer.c:2717
+msgid " [Modified]"
+msgstr " [¹Ù²ñ]"
+
+#: buffer.c:2722
+msgid "[Not edited]"
+msgstr "[°íÄ¡Áö ¾Ê¾ÒÀ½]"
+
+#: buffer.c:2727
+msgid "[New file]"
+msgstr "[»õ ÆÄÀÏ]"
+
+#: buffer.c:2728
+msgid "[Read errors]"
+msgstr "[Àб⠿¡·¯]"
+
+#: buffer.c:2730 fileio.c:2112
+msgid "[readonly]"
+msgstr "[Àбâ Àü¿ë]"
+
+#: buffer.c:2751
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 ÁÙ --%d%%--"
+
+#: buffer.c:2753
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld ÁÙ --%d%%--"
+
+#: buffer.c:2760
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "%ld / %ld ÁÙ --%d%%-- Ä­ "
+
+#: buffer.c:2868
+msgid "[No file]"
+msgstr "[ÆÄÀÏ ¾øÀ½]"
+
+#. must be a help buffer
+#: buffer.c:2908
+msgid "help"
+msgstr "µµ¿ò¸»"
+
+#: buffer.c:3467 screen.c:5075
+msgid "[help]"
+msgstr "[µµ¿ò¸»]"
+
+#: buffer.c:3499 screen.c:5081
+msgid "[Preview]"
+msgstr "[¹Ì¸® º¸±â]"
+
+#: buffer.c:3779
+msgid "All"
+msgstr "¸ðµÎ"
+
+#: buffer.c:3779
+msgid "Bot"
+msgstr "¹Ù´Ú"
+
+#: buffer.c:3781
+msgid "Top"
+msgstr "²À´ë±â"
+
+#: buffer.c:4529
+#, c-format
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# ¹öÆÛ ¸ñ·Ï:\n"
+
+#: buffer.c:4562
+msgid "[Error List]"
+msgstr "[¿¡·¯ ¸ñ·Ï]"
+
+#: buffer.c:4575 memline.c:1521
+msgid "[No File]"
+msgstr "[ÆÄÀÏ ¾øÀ½]"
+
+#: buffer.c:4888
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ±âÈ£ ---"
+
+#: buffer.c:4907
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s¿¡ ´ëÇÑ ±âÈ£:"
+
+#: buffer.c:4913
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ÁÙ=%ld id=%d À̸§=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: %ld°³ ÀÌ»óÀÇ ¹öÆÛ¿¡ ´ëÇؼ­´Â diff¸¦ ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: diff¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: diff.c:818
+msgid "Patch file"
+msgstr "ÆÐÅ° ÆÄÀÏ"
+
+#: diff.c:1069
+msgid "E98: Cannot read diff output"
+msgstr "E98: diff Ãâ·ÂÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: diff.c:1819
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ÇöÀç ¹öÆÛ´Â diff »óÅ°¡ ¾Æ´Õ´Ï´Ù"
+
+#: diff.c:1831
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: ´Ù¸¥ ¹öÆÛÁß¿¡ diff »óÅÂÀÎ °Ô ¾ø½À´Ï´Ù"
+
+#: diff.c:1839
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: µÎ°³ ÀÌ»óÀÇ ¹öÆÛ°¡ diff »óÅ¿©¼­ ¾î¶² °ÍÀ» ½á¾ßÇÒ Áö ¾Ë ¼ö ¾ø½À´Ï´Ù"
+
+#: diff.c:1862
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: \"%s\" ¹öÆÛ¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: diff.c:1868
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: \"%s\" ¹öÆÛ´Â diff »óÅ°¡ ¾Æ´Õ´Ï´Ù"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: digraph¿¡´Â EscapeÀ» ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: Å°¸Ê ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ºÒ·¯µéÀÎ ÆÄÀÏ¿¡¼­ :loadkeymapÀ» »ç¿ëÇÏÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " ³¹¸» ¿Ï¼º (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X ¸ðµå (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " ³¹¸» ·ÎÄà ¿Ï¼º (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Àüü ÁÙ ¿Ï¼º (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " ÆÄÀÏ À̸§ ¿Ï¼º (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " ÅÂ±× ¿Ï¼º (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " °æ·Î ÆÐÅÏ ¿Ï¼º (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Á¤ÀÇ ¿Ï¼º (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " ÀÚ·á¹æ ¿Ï¼º (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " ¹é°ú»çÀü ¿Ï¼º (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " ¸í·ÉÇà ¿Ï¼º (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "´Ü¶ôÀÇ ¸¶Áö¸· ¸¸³²"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus' ¿É¼ÇÀÌ ºñ¾ú½À´Ï´Ù"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "'dictionary' ¿É¼ÇÀÌ ºñ¾ú½À´Ï´Ù"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "»çÀü ã´Â Áß: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (³¢¿ö³Ö±â) ½ºÅ©·Ñ (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (¹Ù²Þ) ½ºÅ©·Ñ (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "ã´Â Áß: %s"
+
+#: edit.c:2719
+#, c-format
+msgid "Scanning tags."
+msgstr "ÅÂ±× Ã£´Â Áß."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " ´õÇϱâ"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- ã´Â Áß..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "¿ø·¡´ë·Î º¹±¸"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "´Ù¸¥ ÁÙ¿¡ ³¹¸»"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "The only match"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "match %d of %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "match %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: ¸ð¸£´Â º¯¼ö: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: °ýÈ£ ¾øÀ½: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: ÀÌ·± º¯¼ö ¾øÀ½: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' µÚ¿¡ ':'ÀÌ ¾ø½À´Ï´Ù"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: ')'°¡ ¾ø½À´Ï´Ù"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: ']'ÀÌ ¾ø½À´Ï´Ù"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ¿É¼Ç À̸§ ¾øÀ½: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ¸ð¸£´Â ¿É¼Ç: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: µû¿ÈÇ¥ ¾øÀ½: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: µû¿ÈÇ¥ ¾øÀ½: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: ÇÔ¼ö %s(À¸)·Î À߸øµÈ ÀÎÀÚ°¡ ³Ñ°ÜÁ³½À´Ï´Ù"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: ¸ð¸£´Â ÇÔ¼ö: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: ÇÔ¼ö¿¡ ³Ê¹« ¸¹Àº ÀÎÀÚ ³Ñ±è: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: ÇÔ¼ö¿¡ ÀûÀº ÀÎÀÚ ³Ñ±è: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: ½ºÅ©¸³Æ® ÄÜÅؽºÆ® ¹Û¿¡¼­ <SID> »ç¿ë: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4382 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "È®ÀÎ(&O)"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ÁÙ: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"È®ÀÎ(&O)\n"
+"Ãë¼Ò(&C)"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "inputrestore()°¡ inputsave()º¸´Ù ¸¹ÀÌ ºÒ·ÁÁ³½À´Ï´Ù"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: ³Ê¹« ¸¹Àº ½Éº¼¸¯ ¸µÅ© (¹Ýº¹¼øȯ?)"
+
+#: eval.c:6626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Vim ¼­¹ö¿¡ ¿¬°áµÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: eval.c:6724
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ¼­¹öÀÇ ÀÀ´äÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: eval.c:6752
+msgid "E258: Unable to send to client"
+msgstr "E258: Ŭ¶óÀ̾ðÆ®·Î º¸³¾ ¼ö ¾ø½À´Ï´Ù"
+
+#: eval.c:6800
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: %s(À¸)·Î º¸³¾ ¼ö ¾ø½À´Ï´Ù"
+
+#: eval.c:6900
+msgid "(Invalid)"
+msgstr "(À߸øµÇ¾ú½À´Ï´Ù)"
+
+#: eval.c:8078
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Á¤ÀÇ ¾È µÈ º¯¼ö: %s"
+
+#: eval.c:8510
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: ºñÁ¤»óÀûÀÎ º¯¼ö ¸í: %s"
+
+#: eval.c:8802
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: ÇÔ¼ö %sÀÌ(°¡) ÀÌ¹Ì ÀÖ½À´Ï´Ù, ¹Ù²Ù·Á¸é !À» ´õÇϼ¼¿ä"
+
+#: eval.c:8875
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Á¤ÀÇ ¾È µÈ ÇÔ¼ö: %s"
+
+#: eval.c:8888
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: '('°¡ ¾øÀ½: %s"
+
+#: eval.c:8921
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: À߸øµÈ ÀÎÀÚ: %s"
+
+#: eval.c:9000
+msgid "E126: Missing :endfunction"
+msgstr "E126: :endfunctionÀÌ ¾ø½À´Ï´Ù"
+
+#: eval.c:9107
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: ÇÔ¼ö %sÀ»(¸¦) ´Ù½Ã Á¤ÀÇÇÒ ¼ö ¾ø½À´Ï´Ù: »ç¿ëÁßÀÔ´Ï´Ù"
+
+#: eval.c:9177
+msgid "E129: Function name required"
+msgstr "E129: ÇÔ¼ö À̸§ÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: eval.c:9228
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: ÇÔ¼ö À̸§Àº ´ë¹®ÀÚ·Î ½ÃÀÛÇØ¾ß ÇÔ: %s"
+
+#: eval.c:9420
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Á¤ÀÇ ¾È µÈ ÇÔ¼ö: %s"
+
+#: eval.c:9425
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: ÇÔ¼ö %sÀ»(¸¦) Áö¿ï ¼ö ¾ø½À´Ï´Ù: »ç¿ëÁßÀÔ´Ï´Ù"
+
+#: eval.c:9473
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: ÇÔ¼ö¸¦ ºÎ¸¥ ±íÀÌ°¡ 'maxfuncdepth'º¸´Ù Å®´Ï´Ù"
+
+#. always scroll up, don't overwrite
+#: eval.c:9526
+#, c-format
+msgid "calling %s"
+msgstr "%s ºÎ¸£´Â Áß"
+
+#: eval.c:9588
+#, c-format
+msgid "%s aborted"
+msgstr "%sÀÌ(°¡) ÁßÁöµÇ¾ú½À´Ï´Ù"
+
+#: eval.c:9590
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%sÀÌ(°¡) #%ldÀ»(¸¦) µ¹·ÁÁÖ¾ú½À´Ï´Ù"
+
+#: eval.c:9597
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%sÀÌ(°¡) \"%s\"À»(¸¦) µ¹·ÁÁÖ¾ú½À´Ï´Ù"
+
+#. always scroll up, don't overwrite
+#: eval.c:9613 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "%s¿¡¼­ °è¼Ó"
+
+#: eval.c:9639
+msgid "E133: :return not inside a function"
+msgstr "E133: :returnÀÌ ÇÔ¼ö ¾È¿¡ ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: eval.c:9970
+#, c-format
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# Àü¿ª º¯¼ö:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, ½ÊÀ°Áø %02x, ÆÈÁø %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, ½ÊÀ°Áø %04x, ÆÈÁø %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, ½ÊÀ°Áø %08x, ÆÈÁø %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: ÁÙÀ» ±× ÀÚ½ÅÀ¸·Î À̵¿ÇÏ·Á°í Çß½À´Ï´Ù"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 ÁÙ ¿Å°ÜÁ³½À´Ï´Ù"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld ÁÙ ¿Å°ÜÁ³½À´Ï´Ù"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld ÁÙÀ» °É·¶½À´Ï´Ù"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* ÀÚµ¿¸í·ÉÀº ÇöÀç ¹öÆÛ¸¦ ¹Ù²Ù¾î¼­´Â ¾È µË´Ï´Ù"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[¸¶Áö¸·À¸·Î °íÄ£ µÚ ÀúÀå ¾È ÇÔ]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: ÁÙ¿¡ %s: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ³Ê¹« ¸¹Àº ¿¡·¯, ³ª¸ÓÁö °Ç³Ê¶Ü"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "viminfo ÆÄÀÏ \"%s\"%s%s%sÀ»(¸¦) Àд Áß"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " ÀÎÆ÷"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " ¸¶Å©"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " ½ÇÆÐ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo ÆÄÀÏÀÇ ¾²±â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Viminfo ÆÄÀÏ %sÀ»(¸¦) ¾µ ¼ö ¾ø½À´Ï´Ù!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Viminfo ÆÄÀÏ \"%s\"À»(¸¦) ¾²´Â Áß"
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# ÀÌ viminfo ÆÄÀÏÀº ºöÀÌ ¸¸µç °ÍÀÔ´Ï´Ù Vim %s.\n"
+
+#: ex_cmds.c:1651
+#, c-format
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Á¶½É¸¸ ÇÑ´Ù¸é °íÄ¥ ¼öµµ ÀÖ½À´Ï´Ù!\n"
+"\n"
+
+#: ex_cmds.c:1653
+#, c-format
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# ÀÌ ÆÄÀÏÀÌ ÀúÀåµÇ¾úÀ» ¶§ÀÇ 'encoding'ÀÇ °ª\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "ÀÌ»óÇÑ ½ÃÀÛ ±ÛÀÚ"
+
+#: ex_cmds.c:2097 ex_cmds2.c:761
+msgid "Save As"
+msgstr "´Ù¸¥ À̸§À¸·Î ÀúÀå"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: ÆÄÀÏÀÌ ´Ù¸¥ ¹öÆÛ¿¡ ·ÎµùµÇ¾î ÀÖ½À´Ï´Ù"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "ÆÄÀÏ ÀϺθ¸ ÀúÀåÇÒ±î¿ä?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ¹öÆÛ ÀϺθ¸ ¾²·Á¸é !À» »ç¿ëÇϽʽÿÀ"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "ÀÌ¹Ì ÀÖ´Â \"%.*s\" ÆÄÀÏÀ» µ¤¾î¾µ±î¿ä?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ¹öÆÛ %ldÀÇ ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:2406
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ÆÄÀÏÀÌ ½áÁöÁö ¾ÊÀ½: 'write' ¿É¼Ç¿¡ ÀÇÇØ ¾µ ¼ö°¡ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:2426
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"'readonly' ¿É¼ÇÀÌ \"%.*s\"¿¡ ´ëÇØ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.\n"
+"±×·¡µµ ¾²±â¸¦ ¿øÇϽʴϱî?"
+
+#: ex_cmds.c:2599
+msgid "Edit File"
+msgstr "ÆÄÀÏ °íÄ¡±â"
+
+#: ex_cmds.c:3207
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommand°¡ ¶æ ¹Û¿¡ »õ ¹öÆÛ %sÀ»(¸¦) Áö¿ü½À´Ï´Ù"
+
+#: ex_cmds.c:3341
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ¼ýÀÚ°¡ ¾Æ´Ñ ÀÎÀÚ°¡ :z¿¡ ÁÖ¾îÁ³½À´Ï´Ù"
+
+#: ex_cmds.c:3426
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim¿¡¼­´Â ½© ¸í·ÉÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:3533
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Á¤±ÔÇ¥Çö½ÄÀº ±ÛÀÚ·Î ±¸ºÐµÉ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:3879
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "%s(À¸)·Î ¹Ù²Þ (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4272
+msgid "(Interrupted) "
+msgstr "(ÁߴܵǾú½À´Ï´Ù) "
+
+#: ex_cmds.c:4276
+msgid "1 substitution"
+msgstr "1 °³ ¹Ù²åÀ½"
+
+#: ex_cmds.c:4278
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld °³ ¹Ù²åÀ½"
+
+#: ex_cmds.c:4281
+msgid " on 1 line"
+msgstr " ÇÑ ÁÙ¿¡¼­"
+
+#: ex_cmds.c:4283
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld ÁÙ¿¡¼­"
+
+#: ex_cmds.c:4334
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :globalÀº Àç±Í È£Ãâ µÉ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:4369
+msgid "E148: Regular expression missing from global"
+msgstr "E148: global¿¡¼­ Á¤±ÔÇ¥Çö½ÄÀÌ ºüÁ³½À´Ï´Ù"
+
+#: ex_cmds.c:4418
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "¿©·¯ ÁÙ¿¡¼­ ÆÐÅÏÀ» ã¾Ò½À´Ï´Ù: %s"
+
+#: ex_cmds.c:4499
+#, c-format
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# ¸¶Áö¸·À¸·Î ¹Ù²Û ¹®ÀÚ¿­:\n"
+"$"
+
+#: ex_cmds.c:4600
+msgid "E478: Don't panic!"
+msgstr "E478: ´çȲÇÏÁö ¸¶½Ê½Ã¿À!"
+
+#: ex_cmds.c:4652
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: ¹Ì¾ÈÇÕ´Ï´Ù, µµ¿ò¸» '%s'ÀÌ(°¡) %s¿¡ ´ëÇØ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:4655
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ¹Ì¾ÈÇÕ´Ï´Ù, %s¿¡ ´ëÇÑ µµ¿ò¸»ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:4689
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "¹Ì¾ÈÇÕ´Ï´Ù, µµ¿ò¸» ÆÄÀÏ \"%s\"À»(¸¦) ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:5172
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: ÀÚ·á¹æÀÌ ¾Æ´Ô: %s"
+
+#: ex_cmds.c:5311
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ¾²±â À§ÇÑ %sÀ»(¸¦) ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:5347
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Àбâ À§ÇÑ %sÀ»(¸¦) ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:5369
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: ÇÑ ¾ð¾î³»¿¡¼­ ¿©·¯ ÀÎÄÚµù »ç¿ë: %s"
+
+#: ex_cmds.c:5447
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ÅÂ±× \"%s\"ÀÌ(°¡) ÆÄÀÏ %s¿¡ Áߺ¹µÇ¾î ÀÖ½À´Ï´Ù"
+
+#: ex_cmds.c:5559
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: ¸ð¸£´Â sign ¸í·É: %s"
+
+#: ex_cmds.c:5579
+msgid "E156: Missing sign name"
+msgstr "E156: sign À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:5625
+msgid "E612: Too many signs defined"
+msgstr "E612: ³Ê¹« ¸¹Àº signÀÌ Á¤ÀǵǾî ÀÖ½À´Ï´Ù"
+
+#: ex_cmds.c:5693
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: À߸øµÈ sign ÅؽºÆ®: %s"
+
+#: ex_cmds.c:5724 ex_cmds.c:5915
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ¸ð¸£´Â sign: %s"
+
+#: ex_cmds.c:5773
+msgid "E159: Missing sign number"
+msgstr "E159: sign ¹øÈ£°¡ ¾ø½À´Ï´Ù"
+
+#: ex_cmds.c:5855
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: À߸øµÈ ¹öÆÛ À̸§: %s"
+
+#: ex_cmds.c:5894
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: À߸øµÈ sign ID: %ld"
+
+#: ex_cmds.c:5964
+msgid " (NOT FOUND)"
+msgstr " (¸ø ã¾ÒÀ½)"
+
+#: ex_cmds.c:5966
+msgid " (not supported)"
+msgstr " (Áö¿øµÇÁö ¾ÊÀ½)"
+
+#: ex_cmds.c:6065
+msgid "[Deleted]"
+msgstr "[Áö¿öÁ³½À´Ï´Ù]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "µð¹ö±× »óÅ·Πµé¾î°¨. °è¼ÓÇÏ·Á¸é \"cont\"¸¦ ÀÔ·ÂÇϽʽÿÀ."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "%ld ÁÙ: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "¸í·É: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "ÁßÁöÁ¡: \"%s%s\" %ld ÁÙ"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ÁßÁöÁ¡À» ãÀ» ¼ö ¾ø½À´Ï´Ù: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "ÁßÁöÁ¡ÀÌ Á¤ÀǵǾî ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s %ld ÁÙ"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "\"%.*s\"¿¡ ¹Ù²ï ³»¿ëÀ» ÀúÀåÇÒ±î¿ä?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9379
+msgid "Untitled"
+msgstr "Á¦¸ñ ¾øÀ½"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ¹öÆÛ \"%s\"¿¡ ³ªÁß¿¡ ¹Ù²ï ³»¿ëÀÌ ½áÁöÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "°æ°í: ¶æ ¹Û¿¡ ´Ù¸¥ ¹öÆÛ·Î µé¾î°¬½À´Ï´Ù (autocommand¸¦ È®ÀÎÇϽʽÿÀ)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: °íÄ¥ ÆÄÀÏÀÌ Çϳª ¹Û¿¡ ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: ù ¹ø° ÆÄÀÏ ÀÌÀüÀ¸·Î´Â °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ¸¶Áö¸· ÆÄÀÏ µÚ·Î´Â °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: ÄÄÆÄÀÏ·¯°¡ Áö¿øµÇÁö ¾ÊÀ½: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "\"%s\"À»(¸¦) \"%s\"¿¡¼­ ã´Â Áß"
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "\"%s\"À»(¸¦) ã´Â Áß"
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "'runtimepath'¿¡¼­ ãÀ» ¼ö ¾øÀ½: \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "ºö ½ºÅ©¸³Æ® ·Îµå"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "ÀÚ·á¹æÀº ºÒ·¯ µéÀÏ ¼ö ¾øÀ½: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "\"%s\"À»(¸¦) ºÒ·¯ µéÀÏ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "%ld ÁÙ: \"%s\"À»(¸¦) ºÒ·¯ µéÀÏ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "\"%s\"À»(¸¦) ºÒ·¯µéÀÌ´Â Áß"
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "%ld ÁÙ: \"%s\" ºÒ·¯µéÀÌ´Â Áß"
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "%s ºÒ·¯µéÀ̱⠳¡"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: °æ°í: À߸øµÈ ÁÙ ±¸ºÐÀÚ. ^MÀÌ ¾ø´Â °Í °°½À´Ï´Ù"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencodingÀÌ ºÒ·¯µéÀÎ ÆÄÀÏ ¹Û¿¡¼­ »ç¿ëµÇ¾ú½À´Ï´Ù"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish°¡ ºÒ·¯µéÀÎ ÆÄÀÏ ¹Û¿¡¼­ »ç¿ëµÇ¾ú½À´Ï´Ù"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "ÆäÀÌÁö %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "ÀμâµÉ ÅؽºÆ®°¡ ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "ÆäÀÌÁö %d ÀμâÁß (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " º¹»ç %d / %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "ÀμâµÊ: %s"
+
+#: ex_cmds2.c:3549
+#, c-format
+msgid "Printing aborted"
+msgstr "ÀμⰡ Ãë¼ÒµÇ¾ú½À´Ï´Ù."
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Æ÷½ºÆ®½ºÅ©¸³Æ® Ãâ·ÂÆÄÀÏ¿¡ ¾µ ¼ö ¾ø½À´Ï´Ù."
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: \"%s\" ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Æ÷½ºÆ®½ºÅ©¸³Æ® ¸®¼Ò½º ÆÄÀÏ \"%s\"À»(¸¦) ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: ÆÄÀÏ \"%s\"Àº(´Â) Æ÷½ºÆ®½ºÅ©¸³Æ® ¸®¼Ò½º ÆÄÀÏÀÌ ¾Æ´Õ´Ï´Ù"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: ÆÄÀÏ \"%s\"Àº(´Â) Áö¿øµÇ´Â Æ÷½ºÆ®½ºÅ©¸³Æ® ¸®¼Ò½º ÆÄÀÏÀÌ ¾Æ´Õ´Ï´Ù"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: \"%s\" ¸®¼Ò½º ÆÄÀÏÀº ¹öÀüÀÌ À߸øµÇ¾ú½À´Ï´Ù"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Æ÷½ºÆ®½ºÅ©¸³Æ® Ãâ·ÂÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: \"%s\" ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Æ÷½ºÆ®½ºÅ©¸³Æ® ¸®¼Ò½º ÆÄÀÏ \"prolog.ps\"¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Æ÷½ºÆ®½ºÅ©¸³Æ® ¸®¼Ò½º ÆÄÀÏ \"%s.ps\"¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: ´ÙÁß¹ÙÀÌÆ®¸¦ \"%s\" ÀÎÄÚµùÀ¸·Î º¯È¯ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "ÇÁ¸°ÅÍ·Î º¸³»´Â Áß..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Æ÷½ºÆ®½ºÅ©¸³Æ® ÆÄÀÏÀ» ÀμâÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "ÀμâÀÛ¾÷ÀÌ ³¡³µ½À´Ï´Ù."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "ÇöÀç %s¾ð¾î: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ¾ð¾î¸¦ \"%s\"(À¸)·Î ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Ex »óÅ·ΠÀüȯ. Normal »óÅ·Π°¡·Á¸é \"visual\"À» ÀÔ·ÂÇϽʽÿÀ."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: ÆÄÀÏÀÇ ¸¶Áö¸·ÀÔ´Ï´Ù"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: ¸í·ÉÀÌ ³Ê¹« ¸¹ÀÌ ´Ù½Ã ¹Ýº¹µÇ¾ú½À´Ï´Ù"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: ¿¹¿Ü°¡ ¹ß»ýÇÏÁö ¾Ê¾Ò½À´Ï´Ù: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "ºÒ·¯µéÀÎ ÆÄÀÏÀÇ ¸¶Áö¸·"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "ÇÔ¼öÀÇ ¸¶Áö¸·"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: »ç¿ëÀÚ Á¤ÀÇ ¸í·ÉÀ» ¸ðÈ£ÇÏ°Ô »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: ÆíÁý±â ¸í·ÉÀÌ ¾Æ´Õ´Ï´Ù"
+
+#: ex_docmd.c:2028
+msgid "E493: Backwards range given"
+msgstr "E493: ¹Ý´ë ¿µ¿ªÀÌ ÁÖ¾îÁ³½À´Ï´Ù"
+
+#: ex_docmd.c:2037
+msgid "Backwards range given, OK to swap"
+msgstr "¹Ý´ë ¿µ¿ªÀÌ ÁÖ¾îÁ³½À´Ï´Ù, µÚÁýÀ»±î¿ä"
+
+#: ex_docmd.c:2160
+msgid "E494: Use w or w>>"
+msgstr "E494: w³ª w>>¸¦ »ç¿ëÇϽʽÿÀ"
+
+#: ex_docmd.c:3786
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ¹Ì¾ÈÇÕ´Ï´Ù, ±× ¸í·ÉÀº ÇöÀç ÆÇ¿¡¼­ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:3989
+msgid "E172: Only one file name allowed"
+msgstr "E172: ¿À·ÎÁö ÇϳªÀÇ ÆÄÀÏ À̸§¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù"
+
+#: ex_docmd.c:4569
+msgid "1 more file to edit. Quit anyway?"
+msgstr "°íÄ¥ ÆÄÀÏÀÌ ÇÑ °³ ´õ ÀÖ½À´Ï´Ù. ±×·¡µµ ³¡³¾±î¿ä?"
+
+#: ex_docmd.c:4572
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "°íÄ¥ ÆÄÀÏÀÌ %d °³ ´õ ÀÖ½À´Ï´Ù. ±×·¡µµ ³¡³¾±î¿ä?"
+
+#: ex_docmd.c:4579
+msgid "E173: 1 more file to edit"
+msgstr "E173: °íÄ¥ ÆÄÀÏÀÌ ÇÑ °³ ´õ ÀÖ½À´Ï´Ù"
+
+#: ex_docmd.c:4581
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: °íÄ¥ ÆÄÀÏÀÌ %ld °³ ´õ ÀÖ½À´Ï´Ù"
+
+#: ex_docmd.c:4676
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: ¸í·ÉÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù: ¹Ù²Ù·Á¸é !À» ´õÇϼ¼¿ä"
+
+#: ex_docmd.c:4787
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" À̸§ ÀÎÀÚ ¹üÀ§ ¿Ï¼º Á¤ÀÇ"
+
+#: ex_docmd.c:4876
+msgid "No user-defined commands found"
+msgstr "»ç¿ëÀÚ Á¤ÀÇ ¸í·ÉÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:4908
+msgid "E175: No attribute specified"
+msgstr "E175: ¸í½ÃµÈ ¼Ó¼ºÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:4960
+msgid "E176: Invalid number of arguments"
+msgstr "E176: À߸øµÈ ÀÎÀÚ °¹¼ö"
+
+#: ex_docmd.c:4975
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Ä«¿îÆ®´Â µÎ ¹ø ÀÌ»ó ¸í½ÃµÉ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:4985
+msgid "E178: Invalid default value for count"
+msgstr "E178: À߸øµÈ ±âº» Ä«¿îÆ® °ª"
+
+#: ex_docmd.c:5016
+msgid "E179: argument required for complete"
+msgstr "E179: ³¡³»±â À§ÇØ ÀÎÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: ex_docmd.c:5048
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: À߸øµÈ ³¡³»±â °ª: %s"
+
+#: ex_docmd.c:5057
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: ¿Ï¼º ÀÎÀÚ´Â »ç¿ëÀÚ ¿Ï¼º¿¡¼­¸¸ Çã¿ëµË´Ï´Ù"
+
+#: ex_docmd.c:5063
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: »ç¿ëÀÚ ¿Ï¼ºÀº ÇÔ¼ö ÀÎÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: ex_docmd.c:5074
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: À߸øµÈ ¼Ó¼º: %s"
+
+#: ex_docmd.c:5117
+msgid "E182: Invalid command name"
+msgstr "E182: À߸øµÈ ¸í·É À̸§"
+
+#: ex_docmd.c:5132
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: »ç¿ëÀÚ Á¤ÀÇ ¸í·ÉÀº ´ë¹®ÀÚ·Î ½ÃÀÛÇØ¾ß ÇÕ´Ï´Ù"
+
+#: ex_docmd.c:5203
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ±×·± »ç¿ëÀÚ Á¤ÀÇ ¸í·É ¾øÀ½: %s"
+
+#: ex_docmd.c:5664
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: »ö ½ºÅ´ %sÀ»(¸¦) ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:5672
+msgid "Greetings, Vim user!"
+msgstr "ºö »ç¿ëÀÚ´Ô, ȯ¿µÇÕ´Ï´Ù!"
+
+#: ex_docmd.c:6390
+msgid "Edit File in new window"
+msgstr "»õ â¿¡¼­ ÆÄÀÏ °íÄ¡±â"
+
+#: ex_docmd.c:6685
+msgid "No swap file"
+msgstr "½º¿Ò ÆÄÀÏÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:6789
+msgid "Append File"
+msgstr "ÆÄÀÏ Ãß°¡"
+
+#: ex_docmd.c:6853
+msgid "E186: No previous directory"
+msgstr "E186: ÀÌÀü ÀÚ·á¹æÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:6935
+msgid "E187: Unknown"
+msgstr "E187: ¸ð¸§"
+
+#: ex_docmd.c:7020
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize´Â µÎ°³ÀÇ ÀÎÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: ex_docmd.c:7076
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "â À§Ä¡: X %d, Y %d"
+
+#: ex_docmd.c:7081
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: ÀÌ Ç÷§Æû¿¡ ´ëÇÑ Ã¢ À§Ä¡ ¾ò´Â ±â´ÉÀ» ±¸ÇöµÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: ex_docmd.c:7091
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos¿¡´Â µÎ°³ÀÇ ÀÎÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: ex_docmd.c:7369
+msgid "Save Redirection"
+msgstr "¸®µð·º¼Ç ÀúÀå"
+
+#: ex_docmd.c:7559
+msgid "Save View"
+msgstr "º¸±â ÀúÀå"
+
+#: ex_docmd.c:7560
+msgid "Save Session"
+msgstr "¼¼¼Ç ÀúÀå"
+
+#: ex_docmd.c:7562
+msgid "Save Setup"
+msgstr "¼³Á¤ ÀúÀå"
+
+#: ex_docmd.c:7714
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\"ÀÌ(°¡) Á¸ÀçÇÕ´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: ex_docmd.c:7719
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: ¾²±â À§ÇÑ \"%s\"À»(¸¦) ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#. set mark
+#: ex_docmd.c:7743
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: ÀÎÀÚ´Â ±ÛÀÚ³ª ¾Õ/µÚ ÀÎ¿ë ºÎÈ£¿©¾ß ÇÕ´Ï´Ù"
+
+#: ex_docmd.c:7785
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normalÀÇ Àç±Í È£ÃâÀÌ ³Ê¹« ¸¹ÀÌ »ý°å½À´Ï´Ù"
+
+#: ex_docmd.c:8303
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: '#'¿¡ ´ëÇØ Ä¡È¯ÇÒ ±³Ã¼ ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:8334
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: \"<afile>\"¿¡ ´ëÇØ Ä¡È¯ÇÒ ÀÚµ¿¸í·É ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:8342
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: \"<abuf>\"¿¡ ´ëÇØ Ä¡È¯ÇÒ ÀÚµ¿¸í·É ¹öÆÛ ¹øÈ£°¡ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:8353
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: \"<amatch>\"¿¡ ´ëÇØ Ä¡È¯ÇÒ ÀÚµ¿¸í·É ¸ÅÄ¡ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:8363
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: \"<sfile>\"¿¡ ´ëÇØ Ä¡È¯ÇÒ :source ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:8404
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: '%'³ª '#'¿¡ ´ëÇÑ ºó ÆÄÀÏ À̸§, ¿À·ÎÁö \":p:h\"¿Í¸¸ µ¿ÀÛÇÕ´Ï´Ù"
+
+#: ex_docmd.c:8406
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: ºó ¹®ÀÚ¿­¿¡¼­ °ªÀ» ±¸ÇÏ·Á°í ÇÕ´Ï´Ù"
+
+#: ex_docmd.c:9361
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: ÀÐÀ» viminfo ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: ex_docmd.c:9534
+msgid "E196: No digraphs in this version"
+msgstr "E196: ÀÌ ÆÇ¿¡´Â digraph°¡ ¾ø½À´Ï´Ù"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: 'Vim' Á¢µÎ»ç·Î ¿¹¿Ü¸¦ :throwÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "¿¹¿Ü thrown: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "¿¹¿Ü Á¾·áµÊ: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "¿¹¿Ü ¹ö·ÁÁü: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, %ld ÁÙ"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "¿¹¿Ü ¹ß»ý: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%sÀÌ(°¡) pending µÇ¾ú½À´Ï´Ù"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%sÀÌ(°¡) Àç°³ µÇ¾ú½À´Ï´Ù"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%sÀÌ(°¡) ¹ö·ÁÁ³½À´Ï´Ù"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "¿¹¿Ü"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "¿¡·¯¿Í ÀÎÅÍ·´Æ®"
+
+#: ex_eval.c:754 gui.c:4381
+msgid "Error"
+msgstr "¿¡·¯"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "ÀÎÅÍ·´Æ®"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if°¡ ³Ê¹« ±í°Ô ÁßøµÇ¾ú½À´Ï´Ù"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :if¾øÀÌ :endif°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :if¾øÀÌ :else°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :if¾øÀÌ :elseif°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: ¿©·¯°³ÀÇ :else°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :else µÚ¿¡ :elseif°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: :whileÀÌ ³Ê¹« ±í°Ô ÁßøµÇ¾ú½À´Ï´Ù"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :while¾øÀÌ :continue°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :while¾øÀÌ :break°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: :try°¡ ³Ê¹« ±í°Ô ÁßøµÇ¾ú½À´Ï´Ù"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :try¾øÀÌ :catch°¡ ÀÖ½À´Ï´Ù"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :finally µÚ¿¡ :catch°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :try¾øÀÌ :finally°¡ ÀÖ½À´Ï´Ù"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: ¿©·¯°³ÀÇ :finally°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :try¾øÀÌ :endtry°¡ ÀÖ½À´Ï´Ù"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunctionÀÌ function ³»¿¡ ¾ø½À´Ï´Ù"
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "ű×À̸§"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " kind file\n"
+
+#: ex_getln.c:4765
+msgid "'history' option is zero"
+msgstr "'history' ¿É¼ÇÀÌ 0ÀÔ´Ï´Ù"
+
+#: ex_getln.c:5036
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s È÷½ºÅ丮 (»õ°ÍºÎÅÍ ¿À·¡µÈ °Í ¼ø):\n"
+
+#: ex_getln.c:5037
+msgid "Command Line"
+msgstr "¸í·É ÁÙ"
+
+#: ex_getln.c:5038
+msgid "Search String"
+msgstr "ãÀ» ¹®ÀÚ¿­"
+
+#: ex_getln.c:5039
+msgid "Expression"
+msgstr "Ç¥Çö"
+
+#: ex_getln.c:5040
+msgid "Input Line"
+msgstr "ÀÔ·Â ÁÙ"
+
+#: ex_getln.c:5078
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar°¡ ¸í·É ±æÀ̸¦ ¹þ¾î³µ½À´Ï´Ù"
+
+#: ex_getln.c:5255
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: È°¼ºµÈ âÀ̳ª ¹öÆÛ°¡ Áö¿öÁ³½À´Ï´Ù"
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "À߸øµÈ ÆÄÀÏ À̸§"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "´Â ÀÚ·á¹æÀÔ´Ï´Ù"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "´Â ÆÄÀÏÀÌ ¾Æ´Õ´Ï´Ù"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[»õ ÆÄÀÏ]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[Çã¿ë ¾È µË´Ï´Ù]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre ÀÚµ¿¸í·ÉÀÌ ÆÄÀÏÀ» ÀÐÁö ¸øÇÏ°Ô ¸¸µé¾ú½À´Ï´Ù"
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre ÀÚµ¿¸í·ÉÀº ÇöÀç ¹öÆÛ¸¦ ¹Ù²Ù¸é ¾È µË´Ï´Ù"
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "ºö: Ç¥ÁØÀԷ¿¡¼­ Àд Áß...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "Ç¥ÁØÀԷ¿¡¼­ Àд Áß..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: º¯È¯µÈ ÆÄÀÏÀ» ÀÐÀ» ¼ö°¡ ¾ø½À´Ï´Ù!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[ÇÇÆ÷/¼ÒÄÏ]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[ÇÇÆ÷]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[¼ÒÄÏ]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[Àбâ Àü¿ë]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[CR ¾øÀ½]"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[NL Æ÷ÇÔ]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[±ä ÁÙ À߸²]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[º¯È¯ ¾È µË´Ï´Ù]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[º¯È¯ µÇ¾ú½À´Ï´Ù]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[¾Ïȣȭ µÇ¾ú½À´Ï´Ù]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[º¯È¯ ¿¡·¯]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[%ld ÁÙ¿¡ À߸øµÈ ¹ÙÀÌÆ®]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[Àб⠿¡·¯]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "º¯È¯Çϱâ À§ÇÑ Àӽà ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "'charconvert'¸¦ »ç¿ëÇÑ º¯È¯ÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "'charconvert'ÀÇ Ãâ·Â°á°ú¸¦ ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: ¾µ ¹öÆÛ¸¦ ÀÚµ¿¸í·ÉÀÌ Áö¿ì°Å³ª ´Ý¾Ò½À´Ï´Ù"
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand°¡ À߸øµÈ ¹æ¹ýÀ¸·Î ÁÙÀ» ¹Ù²Ù¾ú½À´Ï´Ù"
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans¿¡¼­´Â ¹Ù²îÁö ¾ÊÀº ¹öÆÛ¸¦ ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "NetBeans ¹öÆÛ¿¡ ´ëÇؼ­´Â ºÎºÐ ÀúÀåÀ» ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "ÆÄÀÏ È¤Àº ¾µ ¼ö ÀÖ´Â ÀåÄ¡°¡ ¾Æ´Õ´Ï´Ù"
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "Àбâ Àü¿ëÀÔ´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: ¹é¾÷ÆÄÀÏÀ» ¾µ ¼ö ¾ø½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: ¹é¾÷ÆÄÀÏ ´Ý±â ¿¡·¯ (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: ¹é¾÷ÇÒ ÆÄÀÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: ¹é¾÷ÆÄÀÏÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: ¹é¾÷ÆÄÀÏÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: The resource fork will be lost (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: ¾µ Àӽà ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: º¯È¯ÇÒ ¼ö ¾ø½À´Ï´Ù (º¯È¯ ¾øÀÌ ÀúÀåÇÏ·Á¸é ! ´õÇϱâ)"
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ¾µ ¿¬°áµÈ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: ¾µ ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: Fsync°¡ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E512: ´Ý±â°¡ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: ¾²±â ¿¡·¯, º¯È¯ÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: ¾²±â ¿¡·¯ (ÆÄÀÏ ½Ã½ºÅÛÀÌ ²Ëᳪ¿ä?)"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr " º¯È¯ ¿¡·¯"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[ÀåÄ¡]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[»õ·Î¿î]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " ´õÇß½À´Ï´Ù"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " ÀúÀå Çß½À´Ï´Ù"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: ÆÐÄ¡ »óÅÂ: ¿ø·¡ ÆÄÀÏÀ» ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: ÆÐÄ¡ »óÅÂ: ºó ¿ø·¡ ÆÄÀÏÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: ¹é¾÷ ÆÄÀÏÀ» Áö¿ï ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"°æ°í: ¿ø·¡ ÆÄÀÏÀÌ ¾ø¾îÁ³°Å³ª ±úÁ³À» ¼ö ÀÖ½À´Ï´Ù\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ÆÄÀÏÀÌ ¼º°øÀûÀ¸·Î ÀúÀåµÉ ¶§±îÁö ÆíÁý±â¸¦ ³¡³»Áö ¸¶½Ê½Ã¿À!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[µµ½º]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[µµ½º Çü½Ä]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[¸Æ]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[¸Æ Çü½Ä]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[À¯´Ð½º]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[À¯´Ð½º Çü½Ä]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 ÁÙ, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ÁÙ, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 ±ÛÀÚ"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "%ld ±ÛÀÚ"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[ºÒ¿ÏÀüÇÑ ¸¶Áö¸· ÁÙ]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "°æ°í: ÆÄÀÏÀÌ ÀÐÀº µÚ¿¡ ¹Ù²î¾ú½À´Ï´Ù!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "Á¤¸»·Î ¾²±â¸¦ ¿øÇϽʴϱî"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: \"%s\"¿¡ ¾²±â ¿¡·¯"
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: \"%s\" ´Ý±â ¿¡·¯"
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: \"%s\" Àб⠿¡·¯"
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell ÀÚµ¿¸í·ÉÀÌ ¹öÆÛ¸¦ Áö¿ü½À´Ï´Ù"
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: °æ°í: ÆÄÀÏ \"%s\"À»(¸¦) ´õ ÀÌ»ó »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: °æ°í: ÆÄÀÏ \"%s\"ÀÌ(°¡) ¹Ù²î¾ú°í ¸¶Âù°¡Áö·Î ºöÀÇ ¹öÆÛµµ ¹Ù²î¾ú½À´Ï´Ù"
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: °æ°í: ÆÄÀÏ \"%s\"ÀÌ(°¡) °íÄ¡±â ½ÃÀÛÇÑ µÚ¿¡ ¹Ù²î¾ú½À´Ï´Ù"
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: °æ°í: ÆÄÀÏ \"%s\"ÀÇ »óÅ°¡ °íÄ¡±â ½ÃÀÛÇÑ µÚ¿¡ ¹Ù²î¾ú½À´Ï´Ù"
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: °æ°í: ÆÄÀÏ \"%s\"ÀÌ(°¡) °íÄ¡±â ½ÃÀÛÇÑ µÚ¿¡ ¸¸µé¾ú½À´Ï´Ù"
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "´õ ¸¹Àº Á¤º¸¸¦ º¸·Á¸é \":help W11\"À» ÀÔ·ÂÇϼ¼¿ä."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "°æ°í"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"È®ÀÎ(&O)\n"
+"ÆÄÀÏ ºÒ·¯¿À±â(&L)"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: \"%s\"ÀÇ Àç·Îµå¸¦ ÁغñÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: \"%s\"À»(¸¦) ´Ù½Ã ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--Áö¿öÁü--"
+
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: ÀÌ·± ±×·ì ¾øÀ½: \"%s\""
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * µÚ¿¡ ÀÌ»óÇÑ ±ÛÀÚ: %s"
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ±×·± À̺¥Æ® ¾øÀ½: %s"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: ±×·± ±×·ìÀ̳ª À̺¥Æ® ¾øÀ½: %s"
+
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- ÀÚµ¿-¸í·É ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: ALL À̺¥Æ®¿¡ ´ëÇØ ÀÚµ¿¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "¸Â´Â ÀÚµ¿¸í·ÉÀÌ ¾ø½À´Ï´Ù"
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: ÀÚµ¿¸í·ÉÀÌ ³Ê¹« ±í°Ô ÁßøµÇ¾ú½À´Ï´Ù"
+
+#: fileio.c:8088
+#, c-format
+#~ msgid "%s Auto commands for \"%s\""
+#~ msgstr ""
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "%s ½ÇÇàÁß"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "ÀÚµ¿¸í·É %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: {°¡ ¾ø½À´Ï´Ù."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: }°¡ ¾ø½À´Ï´Ù."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: fold°¡ ¾ø½À´Ï´Ù"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: ÇöÀçÀÇ 'foldmethod'À¸·Î Á¢±â¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: ÇöÀçÀÇ 'foldmethod'À¸·Î Á¢±â¸¦ Áö¿ï ¼ö ¾ø½À´Ï´Ù"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: ÀÐÇôÁø ¹öÆÛ¿¡ ´õÇϱâ"
+
+#: getchar.c:2208
+msgid "E223: recursive mapping"
+msgstr "E223: Àç±Í ¸ÊÇÎ"
+
+#: getchar.c:3087
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s Àü¿ª ¾à¾î°¡ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù"
+
+#: getchar.c:3090
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s Àü¿ª ¸ÅÇÎÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù"
+
+#: getchar.c:3222
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ¾à¾î°¡ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù"
+
+#: getchar.c:3225
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s ¸ÅÇÎÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù"
+
+#: getchar.c:3289
+msgid "No abbreviation found"
+msgstr "¾à¾î¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: getchar.c:3291
+msgid "No mapping found"
+msgstr "¸ÊÇÎÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: getchar.c:4183
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ÀÌ»óÇÑ »óÅÂ"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: GUI¸¦ ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: \"%s\"¿¡¼­ ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: ¾µ¸¸ÇÑ ±Û²ÃÀ» ãÀ» ¼ö ¾ø¾î¼­ GUI¸¦ ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide'°¡ ÀÌ»óÇÕ´Ï´Ù"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: 'imactivatekey' °ªÀÌ ÀÌ»óÇÕ´Ï´Ù"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: »ö %sÀ»(¸¦) ÇÒ´çÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<¿­ ¼ö ¾øÀ½> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ±Û²Ã %sÀ»(¸¦) ¾òÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: ÇöÀç µð·ºÅ丮·Î µ¹¾Æ°¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "°æ·Î À̸§:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: ÇöÀç µð·ºÅ丮¸¦ ¾òÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "È®ÀÎ"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Ãë¼Ò"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "½ºÅ©·Ñ¹Ù À§Á¬: ½æ ÇȽº¸ÊÀÇ Áö¿À¹ÌÆ®¸®¸¦ ¾òÀ» ¼ö ¾ø½À´Ï´Ù."
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "ºö ´ëÈ­»óÀÚ"
+
+#: gui_beval.c:101 gui_w32.c:3954
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ¸Þ½ÃÁö¿Í ÄÝ¹é ¸ðµÎ¸¦ »ç¿ëÇؼ­´Â BalloonEvalÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "ºö ´ëÈ­»óÀÚ..."
+
+#: gui_gtk.c:2060 message.c:2999
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"¿¹(&Y)\n"
+"¾Æ´Ï¿À(&N)\n"
+"Ãë¼Ò(&C)"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "ÀÔ·Â ¹æ¹ý(_M)"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "ºö - ã¾Æ¼­ ¹Ù²Ù±â..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "ºö - ã±â..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "¹«¾ó ãÀ»±î¿ä:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "¹Ù²Ü ¹®ÀÚ¿­:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "¶È°°Àº ³¹¸»¸¸"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+#~ msgid "Match case"
+#~ msgstr ""
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "¹æÇâ"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "À§·Î"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "¾Æ·¡·Î"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "´ÙÀ½ ã±â"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "¹Ù²Ù±â"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "¸ðµÎ ¹Ù²Ù±â"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "ºö: ¼¼¼Ç °ü¸®ÀڷκÎÅÍ \"die\" ¿äûÀ» ¹Þ¾Ò½À´Ï´Ù\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "ºö: ¸ÞÀΠâÀÌ Á×°Ô µÉ °ÍÀÔ´Ï´Ù\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "±Û²Ã °í¸£±â"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "ºó °í¸£±â ´ë½Å CUT_BUFFER0À» »ç¿ëÇß½À´Ï´Ù"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "°Å¸£°³"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "ÀÚ·á¹æ"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "µµ¿ò¸»"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "ÆÄÀÏ"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "°í¸£±â"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Ãë¼Ò"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Zap ±Û²Ã '%s'À»(¸¦) ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: ±Û²Ã %sÀ»(¸¦) »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ³¡³»±â À§ÇØ ¸Þ½ÃÁö¸¦ º¸³Â½À´Ï´Ù.\n"
+
+#: gui_w32.c:843
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Áö¿øµÇÁö ¾Ê´Â ÀÎÀÚ: \"-%s\": OLE ÆÇÀ» »ç¿ëÇϽʽÿÀ."
+
+#: gui_w48.c:2163
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "¹®ÀÚ¿­ ã±â ('\\'¸¦ ãÀ¸·Á¸é '\\\\' »ç¿ë)"
+
+#: gui_w48.c:2188
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "¹®ÀÚ¿­ ã¾Æ ¹Ù²Ù±â ('\\'¸¦ ãÀ¸·Á¸é '\\\\' »ç¿ë)"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"ºö E458: »ö»ó¸Ê ¿£Æ®¸®¸¦ ÇÒ´çÇÒ ¼ö ¾ø½À´Ï´Ù, ¸î¸î »öÀÌ À߸øµÉ ¼ö ÀÖ½À´Ï´Ù"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: ´ÙÀ½ ±ÛÀÚ¼ÂÀÇ ±Û²ÃÀÌ ±Û²Ã¼Â %s¿¡ ¾ø½À´Ï´Ù:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ±Û²Ã¼Â À̸§: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "±Û²Ã '%s'Àº(´Â) °íÁ¤³ÐÀÌ°¡ ¾Æ´Õ´Ï´Ù"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ±Û²Ã¼Â À̸§: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "±Û²Ã0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "±Û²Ã1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%ld width is not twice that of font0\n"
+msgstr "±Û²Ã%ld ³Êºñ°¡ ±Û²Ã0ÀÇ µÎ¹è°¡ ¾Æ´Õ´Ï´Ù\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "±Û²Ã0 ³Êºñ: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"±Û²Ã1 ³Êºñ: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ÇÑ±Û ¿ÀÅ丶Ÿ ¿¡·¯"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "»õ µ¥ÀÌÅͺ£À̽º ´õÇϱâ"
+
+#: if_cscope.c:79
+#~ msgid "Query for a pattern"
+#~ msgstr ""
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "ÀÌ ¸Þ½ÃÁö º¸À̱â"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "¿¬°á ²÷±â"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "¸ðµç ¿¬°á ´Ù½Ã ÃʱâÈ­"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "¿¬°á º¸¿©ÁÖ±â"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: »ç¿ë¹ý: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "ÀÌ cscope ¸í·ÉÀº â ³ª´©±â¸¦ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: »ç¿ë¹ý: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ű׸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) ¿¡·¯: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: stat ¿¡·¯"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %sÀº(´Â) µð·ºÅ丮µµ ȤÀº cscope µ¥ÀÌÅͺ£À̽º°¡ ¾Æ´Õ´Ï´Ù"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "cscope µ¥ÀÌÅͺ£À̽º %s¿¡ ´õÇß½À´Ï´Ù."
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: cscope ¿¬°á %ld Àб⠿¡·¯"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: ¸ð¸£´Â cscope ã±â Çü½Ä"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: cscope ÆÄÀÌÇÁ¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: cscope¸¦ forkÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection ½ÇÇàÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: cscope ÇÁ·Î¼¼½º¸¦ spawnÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: to_fp¿¡ ´ëÇÑ fdopen ½ÇÆÐ"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fr_fp¿¡ ´ëÇÑ fdopen ½ÇÆÐ"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: cscope ¿¬°áÀÌ ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:1025
+#, c-format
+#~ msgid "E259: no matches found for cscope query %s of %s"
+#~ msgstr ""
+
+#: if_cscope.c:1082
+#, c-format
+#~ msgid "E469: invalid cscopequickfix flag %c for %c"
+#~ msgstr ""
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "cscope ¸í·É:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (»ç¿ë¹ý: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: cscope µ¥ÀÌÅͺ£À̽º¸¦ ¿­ ¼ö ¾øÀ½: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: cscope µ¥ÀÌÅͺ£À̽º Á¤º¸¸¦ ¾òÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: Áߺ¹µÈ cscope µ¥ÀÌÅͺ£À̽º´Â ´õÇØÁöÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: cscope ¿¬°á Çã¿ëÄ¡ÀÇ ÃÖ´ë °ª¿¡ µµ´ÞÇß½À´Ï´Ù"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope ¿¬°á %sÀ»(¸¦) ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "cscope ¿¬°á %sÀÌ(°¡) ´ÝÇû½À´Ï´Ù"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: cs_manage_matches¿¡ ½É°¢ÇÑ ¿¡·¯"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Cscope ű×: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # ÁÙ"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "ÆÄÀÏ À̸§ / ÄÜÅؽºÆ® / ÁÙ\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Cscope ¿¡·¯: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "¸ðµç cscope µ¥ÀÌÅͺ£À̽º ¸®¼Â"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "cscope ¿¬°áÀÌ ¾ø½À´Ï´Ù\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid µ¥ÀÌÅͺ£À̽º À̸§ prepend path\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: ¹Ì¾ÈÇÕ´Ï´Ù, ÀÌ ¸í·ÉÀº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù, ÆÄÀ̽㠶óÀ̺귯¸®¸¦ ·ÎµùÇÒ "
+"¼ö ¾ø½À´Ï´Ù."
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: PythonÀ» Àç±ÍÈ£ÃâÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "OutputObject ¼Ó¼ºÀ» Áö¿ï ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace´Â Á¤¼ö¿©¾ß¸¸ ÇÕ´Ï´Ù"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "À߸øµÈ ¼Ó¼º"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines()´Â ¹®ÀÚ¿­ ¸ñ·ÏÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: ÆÄÀ̽ã: I/O °´Ã¼ ÃʱâÈ­Áß ¿¡·¯°¡ »ý°å½À´Ï´Ù"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "À߸øµÈ Ç¥Çö½Ä"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "Ç¥Çö½ÄÀ» Áö¿øÇÏÁö ¾Êµµ·Ï ÄÄÆÄÀÏ µÇ¾ú½À´Ï´Ù"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "Áö¿öÁø ¹öÆÛ¸¦ ÂüÁ¶ÇÏ·Á°í ÇÏ¿´½À´Ï´Ù"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "ÁÙ ¹øÈ£°¡ ¹üÀ§¸¦ ¹þ¾î³µ½À´Ï´Ù"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<%8lX¿¡ ¹öÆÛ °´Ã¼ (Áö¿öÁ³½À´Ï´Ù)>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "À߸øµÈ ¸¶Å© À̸§"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "±×·± ¹öÆÛ´Â ¾ø½À´Ï´Ù"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "Áö¿öÁø âÀ» ÂüÁ¶ÇÏ·Á°í ÇÏ¿´½À´Ï´Ù"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "Àбâ Àü¿ë ¼Ó¼º"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "ÆÛ¼­ À§Ä¡°¡ ¹öÆÛ ¹Û¿¡ ÀÖ½À´Ï´Ù"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<%.8lX¿¡ â °´Ã¼ (Áö¿öÁ³½À´Ï´Ù)>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<%.8lX¿¡ â °´Ã¼ (¸ð¸§)>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<â %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "±×·± âÀº ¾ø½À´Ï´Ù"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "undo Á¤º¸¸¦ ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "ÁÙÀ» Áö¿ï ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "ÁÙÀ» ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "ÁÙÀ» ³¢¿ö³ÖÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "¹®ÀÚ¿­Àº newlineÀ» Æ÷ÇÔÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: ¹Ì¾ÈÇÕ´Ï´Ù, ÀÌ ¸í·ÉÀº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù, ·çºñ ¶óÀ̺귯¸®¸¦ ·ÎµùÇÒ ¼ö "
+"¾ø½À´Ï´Ù."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: ¸ð¸£´Â longjmp »óÅ %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Åä±Û ±¸Çö/Á¤ÀÇ"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "...ÀÇ ±âº» Ŭ·¡½º º¸¿©ÁÖ±â"
+
+#: if_sniff.c:69
+#~ msgid "Show overridden member function"
+#~ msgstr ""
+
+#: if_sniff.c:70
+#~ msgid "Retrieve from file"
+#~ msgstr ""
+
+#: if_sniff.c:71
+#~ msgid "Retrieve from project"
+#~ msgstr ""
+
+#: if_sniff.c:73
+#~ msgid "Retrieve from all projects"
+#~ msgstr ""
+
+#: if_sniff.c:74
+#~ msgid "Retrieve"
+#~ msgstr ""
+
+#: if_sniff.c:75
+#~ msgid "Show source of"
+#~ msgstr ""
+
+#: if_sniff.c:76
+#~ msgid "Find symbol"
+#~ msgstr ""
+
+#: if_sniff.c:77
+#~ msgid "Browse class"
+#~ msgstr ""
+
+#: if_sniff.c:78
+#~ msgid "Show class in hierarchy"
+#~ msgstr ""
+
+#: if_sniff.c:79
+#~ msgid "Show class in restricted hierarchy"
+#~ msgstr ""
+
+#: if_sniff.c:80
+#~ msgid "Xref refers to"
+#~ msgstr ""
+
+#: if_sniff.c:81
+#~ msgid "Xref referred by"
+#~ msgstr ""
+
+#: if_sniff.c:82
+#~ msgid "Xref has a"
+#~ msgstr ""
+
+#: if_sniff.c:83
+#~ msgid "Xref used by"
+#~ msgstr ""
+
+#: if_sniff.c:84
+#~ msgid "Show docu of"
+#~ msgstr ""
+
+#: if_sniff.c:85
+#~ msgid "Generate docu for"
+#~ msgstr ""
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"SNiFF+·Î ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù. ȯ°æÀ» È®ÀÎÇϽʽÿÀ (sniffemacs°¡ $PATH¿¡¼­ ã¾Æ"
+"Á®¾ß ÇÕ´Ï´Ù).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Àд Áß ¿¡·¯. ²÷±è"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ is currently "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "not "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "connected"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ¸ð¸£´Â SNiFF+ ¿äû: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: SNiFF+¿¡ ¿¬°á ¿¡·¯"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SniFF+°¡ ¿¬°áµÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: SniFF+ ¹öÆÛ°¡ ¾Æ´Õ´Ï´Ù"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: ¾²´Â µµÁß ¿¡·¯. ²÷°å½À´Ï´Ù"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "À߸øµÈ ¹öÆÛ ¹øÈ£"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "¾ÆÁ÷ ±¸ÇöµÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "¸ð¸£´Â ¿É¼Ç"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "ÁÙÀ» ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "¸¶Å©°¡ ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "Çà %d ¿­ %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "ÁÙÀ» ³¢¿ö³Ö°Å³ª ´õÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "¸ð¸£´Â Ç÷¡±×: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "¸ð¸£´Â ºö ¿É¼Ç"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "Å°º¸µå ÀÎÅÍ·´Æ®"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "ºö ¿¡·¯"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "¹öÆÛ/â ¸í·ÉÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù: °´Ã¼°¡ Áö¿öÁý´Ï´Ù"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "ÄÝ¹é ¸í·ÉÀ» µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù: ¹öÆÛ/âÀÌ ÀÌ¹Ì Áö¿öÁ³½À´Ï´Ù"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL ½É°¢ÇÑ ¿¡·¯: reflist°¡ ±úÁ³³ª!? ÀÌ ¹®Á¦¸¦ vim-dev@vim.org·Î ¾Ë·ÁÁÖ"
+"½Ê½Ã¿À"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "ÄÝ¹é ¸í·ÉÀ» µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù: ¹öÆÛ/â ÂüÁ¶¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: ¹Ì¾ÈÇÕ´Ï´Ù, ÀÌ ¸í·ÉÀº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù, Tcl ¶óÀ̺귯¸®¸¦ ·ÎµùÇÒ ¼ö ¾ø"
+"½À´Ï´Ù."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL ¿¡·¯: ³¡³»±â Äڵ尡 Á¤¼ö°¡ ¾Æ´Ñ°¡!? ÀÌ ¹®Á¦¸¦ vim-dev@vim.org·Î ¾Ë"
+"·ÁÁֽʽÿÀ"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "ÁÙÀ» ¾òÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "¸í·É ¼­¹ö À̸§À» µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ´ë»óÇÁ·Î±×·¥À¸·Î ¸í·É º¸³»±â°¡ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: À߸øµÈ ¼­¹ö id »ç¿ëµÊ: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: ºö ÀνºÅϽº ·¹Áö½ºÆ®¸® ¼Ó¼ºÀÌ À߸øµÇ¾î ÀÖ½À´Ï´Ù. Áö¿ü½À´Ï´Ù!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "¸ð¸£´Â ¿É¼Ç"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "³Ê¹« ¸¹Àº ÆíÁý ÀÎÀÚ"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "µÚ¿¡ ÀÎÀÚ°¡ ¾øÀ½"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "¿É¼Ç µÚ¿¡ ¾²·¹±â °ª"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "³Ê¹« ¸¹Àº \"+command\" \"-c command\" ȤÀº \"--cmd command\" ÀÎÀÚ"
+
+#: main.c:70
+#~ msgid "Invalid argument for"
+#~ msgstr ""
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "ÀÌ ºöÀº diff ±â´É ¾øÀÌ ÄÄÆÄÀÏ µÇ¾ú½À´Ï´Ù."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "½ºÅ©¸³Æ® ÆÄÀÏÀ» ´Ù½Ã ¿­·Á°í ½Ãµµ: \""
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "Àбâ À§ÇØ ¿­ ¼ö ¾øÀ½: \""
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "½ºÅ©¸³Æ® Ãâ·ÂÀ» ¿­ ¼ö ¾øÀ½: \""
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d ÆÄÀÏÀ» °íÄ¡±â\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "ºö: °æ°í: Å͹̳ηΠÃâ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "ºö: °æ°í: Å͹̳ηΠºÎÅÍ ÀԷ¹ÞÀ» ¼ö ¾ø½À´Ï´Ù\n"
+
+#. just in case..
+#: main.c:1297
+#~ msgid "pre-vimrc command line"
+#~ msgstr ""
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: \"%s\"¿¡¼­ ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"´õ ¸¹Àº Á¤º¸¸¦ ¿øÇϽøé: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[ÆÄÀÏ ..] ÁÖ¾îÁø ÆÄÀÏ °íÄ¡±â"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- Ç¥ÁØÀԷ¿¡¼­ ÅؽºÆ® Àбâ"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag űװ¡ Á¤ÀÇµÈ À§Ä¡¿¡¼­ ÆÄÀÏ °íÄ¡±â"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [¿¡·¯ÆÄÀÏ] ù ¹ø° ¿¡·¯°¡ ³­ ÆÄÀÏ °íÄ¡±â"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"»ç¿ë¹ý:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [ÀÎÀÚ] "
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ȤÀº:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"ÀÎÀÚ:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tÀÌ µÚ¿¡´Â ÆÄÀÏ À̸§¸¸"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\t¿ÍÀϵåÄ«µå¸¦ È®ÀåÇÏÁö ¾ÊÀ½"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tÀÌ gvim OLE¿¡ µî·Ï"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tgvimÀ» OLE¿¡¼­ µî·ÏÃë¼Ò"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tGUI·Î ½ÇÇà (\"gvim\"°ú °°À½)"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f ȤÀº --nofork\tÆ÷±×¶ó¿îµå: GUI·Î ½ÃÀÛÇÒ ¶§ forkÇÏÁö ¸» °Í"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi »óÅ (\"vi\"¿Í °°À½)"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx »óÅ (\"ex\"¿Í °°À½)"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tÁ¶¿ëÇÑ (¹èÄ¡) »óÅ (\"ex\"¸¸)"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff »óÅ (\"vimdiff\"¿Í °°À½)"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\t½¬¿î »óÅ (\"evim\"°ú °°À½, modeless)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tÀбâ Àü¿ë »óÅ (\"view\"¿Í °°À½)"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tÁ¦ÇÑµÈ »óÅ (\"rvim\"°ú °°À½)"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\t¼öÁ¤(ÆÄÀÏ ¾²±â)ÀÌ Çã¿ëµÇÁö ¾ÊÀ½"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tÅؽºÆ® ¼öÁ¤ÀÌ Çã¿ëµÇÁö ¾ÊÀ½"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tÀÌÁø »óÅÂ"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\t¸®½ºÇÁ »óÅÂ"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tVi ȣȯ: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tVi¿Í ȣȯµÇÁö ¾ÊÀ½: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose ·¹º§"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tµð¹ö±ë »óÅÂ"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\t½º¿Ò ÆÄÀÏ ¾øÀÌ ¸Þ¸ð¸®¸¸ »ç¿ë"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t½º¿Ò ÆÄÀÏ ¸ñ·ÏÀ» Ç¥½ÃÇÑ µÚ ³¡³»±â"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (ÆÄÀÏ À̸§°ú ÇÔ²²)\tÆļյǾú´ø ¼¼¼Ç º¹±¸"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\t-r°ú °°À½"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tâÀ» ¿­ ¶§ newcli »ç¿ëÇÏÁö ¾ÊÀ½"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <ÀåÄ¡>\t\tI/O¿¡ <ÀåÄ¡> »ç¿ë"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tArabic ¸ðµå·Î ½ÃÀÛ"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tHebrew ¸ðµå·Î ½ÃÀÛ"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tFarsi ¸ðµå·Î ½ÃÀÛ"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tÅ͹̳ΠÁ¾·ù¸¦ <terminal>·Î ¼³Á¤"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t.vimrc ´ë½Å <vimrc>¸¦ »ç¿ë"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t.gvimrc ´ë½Å <gvimrc>¸¦ »ç¿ë"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tÇ÷¯±×ÀÎ ½ºÅ©¸³Æ®¸¦ ºÒ·¯µéÀÌÁö ¾ÊÀ½"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tN°³ÀÇ Ã¢ ¿­±â (±âº»: ÆÄÀϺ°·Î Çϳª)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\t-o¿Í °°Áö¸¸ âÀ» ¼öÁ÷À¸·Î ³ª´©±â"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tÆÄÀÏ ¸¶Áö¸·¿¡¼­ ½ÃÀÛ"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\t<lnum> ÁÙ¿¡¼­ ½ÃÀÛ"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <¸í·É>\tvimrc ÆÄÀÏÀ» Àбâ Àü¿¡ <¸í·É>À» ½ÇÇà"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <¸í·É>\t\tù° ÆÄÀÏÀ» ÀÐÀº µÚ <¸í·É>À» ½ÇÇà"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <¼¼¼Ç>\t\tù° ÆÄÀÏÀ» ÀÐÀº µÚ <¼¼¼Ç> ÆÄÀÏ ºÒ·¯ µéÀ̱â"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t<scriptin> ÆÄÀÏ¿¡¼­ Normal »óÅ ¸í·É Àбâ"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t¸ðµç ÀÔ·ÂµÈ ¸í·ÉÀ» <scriptout> ÆÄÀÏ¿¡ Ãß°¡"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t¸ðµç ÀÔ·ÂµÈ ¸í·ÉÀ» <scriptout> ÆÄÀÏ¿¡ ÀúÀå"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t¾ÏȣȭµÈ ÆÄÀÏ °íÄ¡±â"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tºöÀ» ƯÁ¤ X-¼­¹ö¿Í ¿¬°á"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tX ¼­¹ö¿¡ ¿¬°áÇÏÁö ¾ÊÀ½"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <files>\t°¡´ÉÇÏ¸é ºö ¼­¹ö¿¡¼­ <files> ÆíÁý"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <files> °°À½, ¼­¹ö°¡ ¾ø´Ù°í ºÒÆòÇÏÁö ¾ÊÀ½"
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> --remote¿Í °°Áö¸¸ ´Ù °íÄ¥ ¶§±îÁö ±â´Ù¸³´Ï´Ù"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <files> °°À½, ¼­¹ö°¡ ¾ø´Ù°í ºÒÆòÇÏÁö ¾ÊÀ½"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tºö ¼­¹ö·Î <keys>¸¦ º¸³»°í ³¡³»±â"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tºö ¼­¹ö¿¡¼­ <expr> ½ÇÇàÇÏ°í °á°ú Ãâ·Â"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\t»ç¿ë °¡´ÉÇÑ ºö ¼­¹ö À̸§À» Ç¥½ÃÇÏ°í ³¡³»±â"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\tºö ¼­¹ö <name>ÀÌ µÇ°Å³ª ¼­¹ö·Î º¸³»±â"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t.viminfo ´ë½Å <viminfo>¸¦ »ç¿ë"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h ȤÀº --help\tµµ¿ò¸»(ÀÌ ¸Þ½ÃÁö)À» Ãâ·ÂÇÑ µÚ ³¡³»±â"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tÆÇ Á¤º¸¸¦ Ãâ·ÂÇÑ µÚ ³¡³»±â"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvimÀÌ ¾Ë°í ÀÖ´Â ÀÎÀÚ (¸ðƼÇÁ ÆÇ):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"gvimÀÌ ¾Ë°í ÀÖ´Â ÀÎÀÚ (neXtaw ÆÇ):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvimÀÌ ¾Ë°í ÀÖ´Â ÀÎÀÚ (¾ÆÅ׳ª ÆÇ):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tºöÀ» <display>¿¡¼­ ½ÇÇà"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\t¾ÆÀÌÄÜ »óÅ·Πºö ½ÃÀÛ"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tºöÀÌ <name>ÀÎ °Íó·³ ¸®¼Ò½º »ç¿ë"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (±¸ÇöµÇÁö ¾ÊÀ½)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\t¹ÙÅÁ »öÀ¸·Î <color> »ç¿ë (also: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tÀÏ¹Ý »ö¿¡ <color> »ç¿ë (also: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tÀÏ¹Ý ÅؽºÆ®¿¡ <font> »ç¿ë (also: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\t±½Àº ÅؽºÆ®¿¡ <font> »ç¿ë"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\t±â¿ïÀÓ ÅؽºÆ®¿¡ <font> »ç¿ë"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tÃʱâ Áö¿À¹ÌÆ®¸®¿¡ <geom> »ç¿ë (also: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t°¡ÀåÀÚ¸® ³ÐÀÌ¿¡ <width> »ç¿ë (also: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> ½ºÅ©·Ñ¹Ù ³ÐÀÌ¿¡ <width> »ç¿ë (also: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tÂ÷¸²Ç¥ ¸·´ë ³ôÀÌ¿¡ <height> »ç¿ë (also: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\t¹ÝÀü ºñµð¿À »ç¿ë (also: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\t¹ÝÀü ºñµð¿À »ç¿ë ¾È ÇÔ (also: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\t¸í½ÃµÈ ¸®¼Ò½º ¼³Á¤"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvimÀÌ ¾Ë°íÀÖ´Â ÀÎÀÚ (RISC OS ÆÇ):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <¼ýÀÚ>\tÄ­¿¡¼­ â Ãʱ⠳ʺñ"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <¼ýÀÚ>\tÁÙ¿¡¼­ â Ãʱ⠳ôÀÌ"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvimÀÌ ¾Ë°íÀÖ´Â ÀÎÀÚ (GTK+ ÆÇ):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tºöÀ» <display>¿¡¼­ ½ÇÇà (also: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\t¸ÞÀΠâ ±¸ºÐÀ» À§ÇØ À¯ÀÏÇÑ ¿ªÇÒ ¼³Á¤"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tºöÀ» ´Ù¸¥ GTK À§Á¬ ¾È¿¡¼­ ¿­À½"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <parent title>\tVimÀ» ºÎ¸ð ÀÀ¿ë ÇÁ·Î±×·¥ ³»¿¡¼­ ¿­±â"
+
+#: main.c:2847
+msgid "No display"
+msgstr "µð½ºÇ÷¹ÀÌ°¡ ¾ø½À´Ï´Ù"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": º¸³»±â°¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": º¸³»±â ½ÇÆÐ. ·ÎÄÿ¡¼­ ½ÇÇàµË´Ï´Ù\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+#~ msgid "%d of %d edited"
+#~ msgstr ""
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "µð½ºÇ÷¹ÀÌ ¾øÀ½: Ç¥Çö½Ä º¸³»±â°¡ ½ÇÆÐÇß½À´Ï´Ù.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Ç¥Çö½Ä º¸³»±â°¡ ½ÇÆÐÇß½À´Ï´Ù.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "¼³Á¤µÈ ¸¶Å©°¡ ¾ø½À´Ï´Ù"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: \"%s\"¿¡ ¸Â´Â ¸¶Å©°¡ ¾ø½À´Ï´Ù"
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"¸¶Å© ¶óÀÎ col ÆÄÀÏ/ÅؽºÆ®"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" Á¡ÇÁ ¶óÀÎ col ÆÄÀÏ/ÅؽºÆ®"
+
+#. Highlight title
+#: mark.c:805
+#~ msgid ""
+#~ "\n"
+#~ "change line col text"
+#~ msgstr ""
+
+#: mark.c:1281
+#, c-format
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# ÆÄÀÏ ¸¶Å©:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+#, c-format
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Á¡ÇÁ¸ñ·Ï (»õ°ÍÀÌ ¸ÕÀú):\n"
+
+#: mark.c:1412
+#, c-format
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ÆÄÀϳ»ÀÇ ¸¶Å© È÷½ºÅ丮 (»õ°ÍºÎÅÍ ¿À·¡µÈ ¼ø):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "'>'ÀÌ ¾ø½À´Ï´Ù"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: Á¤»óÀûÀÎ ÄÚµåÆäÀÌÁö°¡ ¾Æ´Õ´Ï´Ù"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: IC °ªÀ» ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: ÀÔ·Â ÄÜÅؽºÆ®¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: ÀÔ·Â ¹æ½ÄÀ» ¿­´Ù°¡ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: °æ°í: IM¿¡ Æı« ÄݹéÀ» ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ÀÔ·Â ¹æ½ÄÀÌ ¾î¶² Çü½Äµµ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ÀÔ·Â ¹æ½ÄÀÌ ³» preedit Çü½ÄÀ» Áö¿øÇÏÁö ¾Ê½À´Ï´Ù"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot Çü½ÄÀº fontsetÀÌ »ç¿ëµÇ¾î¾ß ÇÕ´Ï´Ù"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: GTK+°¡ 1.2.3 ÀÌÀü ÆÇÀÔ´Ï´Ù. »óÅ ¿µ¿ªÀ» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ÀÔ·Â ¼­¹ö°¡ ½ÇÇàµÇÁö ¾Ê°í ÀÖ½À´Ï´Ù"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: ±¸¿ªÀÌ Àá±ÅÁöÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: memfile.c:1010
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ½º¿Ò ÆÄÀÏÀ» Àбâ À§ÇØ Æ¯Á¤ À§Ä¡·Î °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: memfile.c:1015
+msgid "E295: Read error in swap file"
+msgstr "E295: ½º¿Ò ÆÄÀÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: memfile.c:1067
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ½º¿Ò ÆÄÀÏÀ» ¾²±â À§ÇØ Æ¯Á¤ À§Ä¡·Î °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: memfile.c:1085
+msgid "E297: Write error in swap file"
+msgstr "E297: ½º¿Ò ÆÄÀÏÀ» ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: memfile.c:1282
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ½º¿Ò ÆÄÀÏÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù (symlink °ø°Ý?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ±¸¿ª ¹øÈ£ 0À» ¾òÁö ¸øÇß³ª¿ä?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ±¸¿ª ¹øÈ£ 1À» ¾òÁö ¸øÇß³ª¿ä?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ±¸¿ª ¹øÈ£ 2¸¦ ¾òÁö ¸øÇß³ª¿ä?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:444
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: À¸À¹, ½º¿Ò ÆÄÀÏÀ» ÀÒ¾î¹ö·È½À´Ï´Ù!!!"
+
+#: memline.c:449
+msgid "E302: Could not rename swap file"
+msgstr "E302: ½º¿Ò ÆÄÀÏ À̸§À» ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:519
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: \"%s\"ÀÇ ½º¿Ò ÆÄÀÏÀ» ¿­ ¼ö ¾ø¾î¼­ º¹±¸´Â ºÒ°¡´ÉÇÕ´Ï´Ù"
+
+#: memline.c:618
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: ±¸¿ª 0À» ¾òÁö ¸øÇß³ª¿ä??"
+
+#: memline.c:758
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: %sÀÇ ½º¿Ò ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:768
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "»ç¿ëÇÒ ½º¿Ò ÆÄÀÏ ¹øÈ£¸¦ ÀÔ·ÂÇϽʽÿÀ (0Àº ³¡³»±â): "
+
+#: memline.c:813
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: %sÀ»(¸¦) ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:835
+msgid "Unable to read block 0 from "
+msgstr "Unable to read block 0 from "
+
+#: memline.c:838
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"¾î¶² ¼öÁ¤µµ ¾ø¾ú°Å³ª ºöÀÌ ½º¿Ò ÆÄÀÏÀ» °»½ÅÇÏÁö ¾ÊÀº °Í °°½À´Ï´Ù."
+
+#: memline.c:848 memline.c:865
+msgid " cannot be used with this version of Vim.\n"
+msgstr " cannot be used with this version of Vim.\n"
+
+#: memline.c:850
+msgid "Use Vim version 3.0.\n"
+msgstr "ºö 3.0 ÆÇÀ» »ç¿ëÇϽʽÿÀ.\n"
+
+#: memline.c:856
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %sÀº(´Â) ºö ½º¿Ò ÆÄÀÏÀÌ ¾Æ´Ñ °Í °°½À´Ï´Ù"
+
+#: memline.c:869
+msgid " cannot be used on this computer.\n"
+msgstr " ÀÌ ÄÄÇ»ÅÍ¿¡¼­´Â »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù.\n"
+
+#: memline.c:871
+msgid "The file was created on "
+msgstr "The file was created on "
+
+#: memline.c:875
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"or the file has been damaged."
+
+#: memline.c:904
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "½º¿Ò ÆÄÀÏ \"%s\"À»(¸¦) »ç¿ëÇÕ´Ï´Ù"
+
+#: memline.c:910
+#, c-format
+msgid "Original file \"%s\""
+msgstr "¿ø·¡ ÆÄÀÏ \"%s\""
+
+#: memline.c:923
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: °æ°í: ¿ø·¡ ÆÄÀÏÀÌ ¹Ù²î¾ú½À´Ï´Ù"
+
+#: memline.c:976
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: %sÀÇ ±¸¿ª 1À» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:980
+msgid "???MANY LINES MISSING"
+msgstr "???¸¹Àº ÁÙÀ» ÀÒ¾î¹ö¸²"
+
+#: memline.c:996
+msgid "???LINE COUNT WRONG"
+msgstr "???ÁÙ ¹øÈ£°¡ À߸øµÇ¾ú½À´Ï´Ù"
+
+#: memline.c:1003
+msgid "???EMPTY BLOCK"
+msgstr "???ºó ±¸¿ª"
+
+#: memline.c:1029
+msgid "???LINES MISSING"
+msgstr "???ÁÙÀ» ÀÒ¾î¹ö¸²"
+
+#: memline.c:1061
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ±¸¿ª 1ÀÇ ID°¡ À߸øµÇ¾ú½À´Ï´Ù (%sÀÌ(°¡) .swp ÆÄÀÏÀÌ ¾Æ´Ñ°¡?)"
+
+#: memline.c:1066
+msgid "???BLOCK MISSING"
+msgstr "???±¸¿ª ÀÒ¾î¹ö¸²"
+
+#: memline.c:1082
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ¿©±âºÎÅÍ ???³¡±îÁöÀÇ ÁÙÀÌ ¼¯¿´½À´Ï´Ù"
+
+#: memline.c:1098
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ¿©±âºÎÅÍ ???³¡±îÁöÀÇ ÁÙÀÌ ³¢¿öÁö°Å³ª Áö¿öÁ® ¹ö¸° °Í °°½À´Ï´Ù"
+
+#: memline.c:1118
+msgid "???END"
+msgstr "???³¡"
+
+#: memline.c:1144
+msgid "E311: Recovery Interrupted"
+msgstr "E311: º¹±¸ ÁߴܵǾú½À´Ï´Ù"
+
+#: memline.c:1149
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: º¹±¸ µµÁß ¿¡·¯ »ý°å½À´Ï´Ù; ???·Î ½ÃÀÛÇÏ´Â ÁÙÀ» ã¾Æº¸½Ê½Ã¿À"
+
+#: memline.c:1151
+msgid "See \":help E312\" for more information."
+msgstr "´õ ¸¹Àº Á¤º¸¸¦ º¸·Á¸é \":help E312\"¸¦ ÀÔ·ÂÇϼ¼¿ä."
+
+#: memline.c:1156
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "º¹±¸°¡ ³¡³µ½À´Ï´Ù. ¸ðµç °Ô Á¤»óÀÎ Áö È®ÀÎÇØ º¸¼Å¾ß¸¸ ÇÕ´Ï´Ù."
+
+#: memline.c:1157
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(¾î¼¸é ´Ù¸¥ À̸§À¸·Î ÀúÀåÇÏ°í ½ÍÀ¸½Ç Áöµµ ¸ð¸£°Ú½À´Ï´Ù\n"
+
+#: memline.c:1158
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "±×¸®°í ¹Ù²ï ³»¿ëÀ» È®ÀÎÇÏ·Á¸é diff¸¦ ÀÌ¿ëÇϽʽÿÀ)\n"
+
+#: memline.c:1159
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"³ªÁß¿¡ .swp ÆÄÀÏÀ» Áö¿ì½Ê½Ã¿À.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1215
+msgid "Swap files found:"
+msgstr "½º¿Ò ÆÄÀÏÀ» ã¾ÒÀ½:"
+
+#: memline.c:1393
+msgid " In current directory:\n"
+msgstr " ÇöÀç ÀÚ·á¹æ¿¡:\n"
+
+#: memline.c:1395
+msgid " Using specified name:\n"
+msgstr " ¸í½ÃµÈ À̸§À» »ç¿ë:\n"
+
+#: memline.c:1399
+msgid " In directory "
+msgstr " In directory "
+
+#: memline.c:1417
+msgid " -- none --\n"
+msgstr " -- ¾øÀ½ --\n"
+
+#: memline.c:1489
+msgid " owned by: "
+msgstr " ¼ÒÀ¯ÀÚ: "
+
+#: memline.c:1491
+msgid " dated: "
+msgstr " ³¯Â¥: "
+
+#: memline.c:1495 memline.c:3685
+msgid " dated: "
+msgstr " ³¯Â¥: "
+
+#: memline.c:1511
+msgid " [from Vim version 3.0]"
+msgstr " [ºö 3.0 ÆÇÀÇ °Í]"
+
+#: memline.c:1515
+msgid " [does not look like a Vim swap file]"
+msgstr " [ºö ½º¿Ò ÆÄÀÏ·Î º¸ÀÌÁö ¾Ê½À´Ï´Ù]"
+
+#: memline.c:1519
+msgid " file name: "
+msgstr " ÆÄÀÏ À̸§: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" ¼öÁ¤: "
+
+#: memline.c:1526
+msgid "YES"
+msgstr "¿¹"
+
+#: memline.c:1526
+msgid "no"
+msgstr "¾Æ´Ï¿À"
+
+#: memline.c:1530
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" »ç¿ëÀÚ À̸§: "
+
+#: memline.c:1537
+msgid " host name: "
+msgstr " È£½ºÆ® À̸§: "
+
+#: memline.c:1539
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" È£½ºÆ® À̸§: "
+
+#: memline.c:1545
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ÇÁ·Î¼¼½º ID: "
+
+#: memline.c:1551
+msgid " (still running)"
+msgstr " (¾ÆÁ÷ ½ÇÇàÁß)"
+
+#: memline.c:1563
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [ºö À̹ø ÆÇ¿¡¼­´Â »ç¿ëÇÒ ¼ö ¾øÀ½]"
+
+#: memline.c:1566
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [ÀÌ ÄÄÇ»ÅÍ¿¡¼­´Â »ç¿ëÇÒ ¼ö ¾øÀ½]"
+
+#: memline.c:1571
+msgid " [cannot be read]"
+msgstr " [ÀÐÀ» ¼ö ¾øÀ½]"
+
+#: memline.c:1575
+msgid " [cannot be opened]"
+msgstr " [¿­ ¼ö ¾øÀ½]"
+
+#: memline.c:1765
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: º¸Á¸ÇÒ ¼ö ¾ø½À´Ï´Ù, ½º¿Ò ÆÄÀÏÀÌ ¾ø½À´Ï´Ù"
+
+#: memline.c:1818
+msgid "File preserved"
+msgstr "ÆÄÀÏÀÌ º¸Á¸µÇ¾ú½À´Ï´Ù"
+
+#: memline.c:1820
+msgid "E314: Preserve failed"
+msgstr "E314: ÆÄÀÏ º¸Á¸À» ½ÇÆÐÇß½À´Ï´Ù"
+
+#: memline.c:1891
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: À߸øµÈ lnum: %ld"
+
+#: memline.c:1917
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: %ld ÁÙÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:2307
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: À߸øµÈ Æ÷ÀÎÅÍ ±¸¿ª id 3"
+
+#: memline.c:2387
+msgid "stack_idx should be 0"
+msgstr "stack_idx´Â 0¿©¾ß¸¸ ÇÕ´Ï´Ù"
+
+#: memline.c:2449
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ³Ê¹« ¸¹Àº ±¸¿ªÀÌ °»½ÅµÇ¾ú³ª¿ä?"
+
+#: memline.c:2631
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: À߸øµÈ Æ÷ÀÎÅÍ ±¸¿ª id 4"
+
+#: memline.c:2658
+msgid "deleted block 1?"
+msgstr "±¸¿ª 1ÀÌ Áö¿öÁ³³ª¿ä?"
+
+#: memline.c:2858
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: %ld ÁÙÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: memline.c:3101
+msgid "E317: pointer block id wrong"
+msgstr "E317: À߸øµÈ Æ÷ÀÎÅÍ ±¸¿ª id"
+
+#: memline.c:3117
+msgid "pe_line_count is zero"
+msgstr "pe_line_count°¡ 0ÀÔ´Ï´Ù"
+
+#: memline.c:3146
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: ÁÙ ¹øÈ£°¡ ¹üÀ§¸¦ ¹þ¾î³µ½À´Ï´Ù: ¸¶Áö¸·¿¡¼­ %ld ¸¸Å­"
+
+#: memline.c:3150
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ±¸¿ª %ldÀÇ ÁÙ °¹¼ö°¡ Ʋ·È½À´Ï´Ù"
+
+#: memline.c:3199
+msgid "Stack size increases"
+msgstr "½ºÅà ũ±â Áõ°¡"
+
+#: memline.c:3245
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: À߸øµÈ Æ÷ÀÎÅÍ ±¸¿ª id 2"
+
+#: memline.c:3675
+msgid "E325: ATTENTION"
+msgstr "E325: ÁÖ¸ñ"
+
+#: memline.c:3676
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Found a swap file by the name \""
+
+#: memline.c:3680
+msgid "While opening file \""
+msgstr "While opening file \""
+
+#: memline.c:3689
+msgid " NEWER than swap file!\n"
+msgstr " NEWER than swap file!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3693
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ´Ù¸¥ ÇÁ·Î±×·¥ÀÌ °°Àº ÆÄÀÏÀ» °íÄ¡°í ÀÖ´ÂÁßÀÏ ¼ö ÀÖ½À´Ï´Ù.\n"
+" ¸¸¾à ±×·¸´Ù¸é °°Àº ÆÄÀÏÀ» µÎ °³ÀÇ ÇÁ·Î±×·¥¿¡¼­ °íÄ¡Áö\n"
+" ¾Êµµ·Ï Á¶½ÉÇϽñ⠹ٶø´Ï´Ù.\n"
+
+#: memline.c:3694
+msgid " Quit, or continue with caution.\n"
+msgstr " ³¡³»°Å³ª À§ÇèÀ» °¨¼öÇϽ÷Á¸é °è¼ÓÇϽʽÿÀ.\n"
+
+#: memline.c:3695
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ÆÄÀÏÀ» °íÄ¡´Ù°¡ Á×¾ú¾ú½À´Ï´Ù.\n"
+
+#: memline.c:3696
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ¸¸¾à ±×·¸´Ù¸é \":recover\" ȤÀº \"vim -r "
+
+#: memline.c:3698
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" À» »ç¿ëÇÏ¿© º¹±¸ÇϽʽÿÀ (\":help recovery\" Âü°í).\n"
+
+#: memline.c:3699
+msgid " If you did this already, delete the swap file \""
+msgstr " ÀÌ¹Ì º¹±¸Çϼ̾ú´Ù¸é ½º¿ÒÆÄÀÏ \""
+
+#: memline.c:3701
+#~ msgid ""
+#~ "\"\n"
+#~ " to avoid this message.\n"
+#~ msgstr ""
+
+#: memline.c:3715 memline.c:3719
+msgid "Swap file \""
+msgstr "½º¿Ò ÆÄÀÏ \""
+
+#: memline.c:3716 memline.c:3722
+msgid "\" already exists!"
+msgstr "\"ÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù!"
+
+#: memline.c:3725
+msgid "VIM - ATTENTION"
+msgstr "ºö - ÁÖ¸ñ"
+
+#: memline.c:3727
+msgid "Swap file already exists!"
+msgstr "½º¿Ò ÆÄÀÏÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù!"
+
+#: memline.c:3731
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"Àбâ Àü¿ëÀ¸·Î ¿­±â(&O)\n"
+"±×³É °íÄ¡±â(&E)\n"
+"º¹±¸(&R)\n"
+"³¡³»±â(&Q)\n"
+"¹ö¸®±â(&A)"
+
+#: memline.c:3733
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"Àбâ Àü¿ëÀ¸·Î ¿­±â(&O)\n"
+"±×³É °íÄ¡±â(&E)\n"
+"º¹±¸(&R)\n"
+"³¡³»±â(&Q)\n"
+"¹ö¸®±â(&A)\n"
+"Áö¿ì±â(&D)"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: ³Ê¹« ¸¹Àº ½º¿Ò ÆÄÀÏÀÌ ¹ß°ßµÇ¾ú½À´Ï´Ù"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Â÷¸²Ç¥ Ç׸ñ °æ·ÎÀÇ ºÎºÐÀÌ ÇÏÀ§ Â÷¸²Ç¥°¡ ¾Æ´Õ´Ï´Ù"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Â÷¸²Ç¥´Â ¿À·ÎÁö ´Ù¸¥ »óÅ¿¡¼­¸¸ Á¸ÀçÇÕ´Ï´Ù"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ±×·± À̸§À» °¡Áø Â÷¸²Ç¥°¡ ¾ø½À´Ï´Ù"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ÇÏÀ§ Â÷¸²Ç¥ ¾Õ¿¡´Â Â÷¸²Ç¥ °æ·Î°¡ ºÙÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Â÷¸²Ç¥ ¸·´ë¿¡ °ð¹Ù·Î Â÷¸²Ç¥ Ç׸ñÀ» ´õÇÒ ¼ö´Â ¾ø½À´Ï´Ù"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ±¸ºÐÀÚ´Â Â÷¸²Ç¥ °æ·ÎÀÇ ºÎºÐÀÌ µÉ ¼ö ¾ø½À´Ï´Ù"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Â÷¸²Ç¥ ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "ÀÌ Â÷¸²Ç¥¸¦ ¶¼¾î³¿"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Â÷¸²Ç¥ Ç׸ñ ¾Õ¿¡´Â Â÷¸²Ç¥ °æ·Î°¡ ÀÖ¾î¾ß ÇÕ´Ï´Ù"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Â÷¸²Ç¥¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s »óÅ¿¡ ´ëÇÑ Â÷¸²Ç¥°¡ Á¤ÀǵǾî ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ÇÏÀ§ Â÷¸²Ç¥ ¾Õ¿¡ Â÷¸²Ç¥ °æ·Î°¡ ÀÖ¾î¾ß ÇÕ´Ï´Ù"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Â÷¸²Ç¥¸¦ ãÀ» ¼ö ¾øÀ½ - Â÷¸²Ç¥ À̸§À» È®ÀÎÇϽʽÿÀ"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "%s ¼öÇàÁß ¿¡·¯ ¹ß°ß:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "%4ld ÁÙ:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[³Ê¹« ±ä ¹®ÀÚ¿­]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "¸Þ½ÃÁö ¹ø¿ª: Sung-Hyun Nam <namsh@kldp.org>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Áß´Ü: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "°è¼ÓÇÏ·Á¸é ¿£ÅÍÅ°¸¦ ´©¸£½Ê½Ã¿À"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "°è¼ÓÇÏ·Á¸é ¿£ÅÍ È¤Àº ¸í·ÉÀ» ÀÔ·ÂÇϽʽÿÀ"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- ´õ --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ÁÙ, SPACE/b: ÂÊ, d/u: ¹ÝÂÊ, q: ³¡³»±â)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ÁÙ, SPACE: ÂÊ, d: ¹ÝÂÊ, q: ³¡³»±â)"
+
+#: message.c:2982 message.c:2997
+msgid "Question"
+msgstr "Áú¹®"
+
+#: message.c:2984
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"¿¹(&Y)\n"
+"¾Æ´Ï¿À(&N)"
+
+#: message.c:3017
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"¿¹(&Y)\n"
+"¾Æ´Ï¿À(&N)\n"
+"¸ðµÎ ÀúÀå(&A)\n"
+"¸ðµÎ ¹ö¸²(&D)\n"
+"Ãë¼Ò(&C)"
+
+#: message.c:3058
+msgid "Save File dialog"
+msgstr "ÆÄÀÏ ÀúÀå ´ëÈ­»óÀÚ"
+
+#: message.c:3060
+msgid "Open File dialog"
+msgstr "ÆÄÀÏ ¿­±â ´ëÈ­»óÀÚ"
+
+#. TODO: non-GUI file selector here
+#: message.c:3131
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ¹Ì¾ÈÇÕ´Ï´Ù, ÄÜ¼Ö »óÅ¿¡´Â ÆÄÀÏ ºê¶ó¿ìÀú°¡ ¾ø½À´Ï´Ù"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: °æ°í: Àбâ Àü¿ë ÆÄÀÏÀ» °íÄ¡°í ÀÖ½À´Ï´Ù"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "ÇÑ ÁÙ ÀÌ»ó"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "ÇÑ ÁÙ ÀÌÇÏ"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld º¸´Ù ¸¹Àº ÁÙ"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld º¸´Ù ÀûÀº ÁÙ"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (ÁߴܵǾú½À´Ï´Ù)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "ºö: ÆÄÀÏ º¸Á¸Áß...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "ºö: ²ø³µ½À´Ï´Ù.\n"
+
+#: misc2.c:695 misc2.c:711
+#, c-format
+msgid "ERROR: "
+msgstr "¿¡·¯: "
+
+#: misc2.c:715
+#, c-format
+#~ msgid ""
+#~ "\n"
+#~ "[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+#~ msgstr ""
+
+#: misc2.c:717
+#, c-format
+#~ msgid ""
+#~ "[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+#~ "\n"
+#~ msgstr ""
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: ÁÙÀÌ ³Ê¹« ±æ¾îÁ³½À´Ï´Ù"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ³»ºÎ ¿¡·¯: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ¸Þ¸ð¸® ºÎÁ·! (%lu ¹ÙÀÌÆ®¸¦ ÇÒ´ç)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "½ÇÇàÇÏ·Á°í ½© ºÎ¸§: \"%s\""
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: ÄÝ·ÐÀÌ ¾ø½À´Ï´Ù"
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: ÀÌ»óÇÑ ¸ðµå"
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: ÀÌ»óÇÑ ¸¶¿ì½º¸ð¾ç"
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: ¼ýÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: ÀÌ»óÇÑ ¹éºÐÀ²"
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "¾ÏÈ£ Å° ÀÔ·Â: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr "°°Àº Å°¸¦ ´Ù½Ã ÀÔ·Â: "
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "Å°°¡ ¸ÂÁö ¾Ê½À´Ï´Ù!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: À߸øµÈ °æ·Î: '**[¹øÈ£]'´Â °æ·ÎÀÇ ¸¶Áö¸·¿¡ À§Ä¡Çϰųª '%s' µÚ¿¡ ÀÖ¾î¾ß "
+"ÇÕ´Ï´Ù."
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath¿¡¼­ \"%s\" ÀÚ·á¹æÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: path¿¡¼­ \"%s\" ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: cdpath¿¡¼­ ´õ ÀÌ»óÀÇ \"%s\" ÀÚ·á¹æÀº ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: path¿¡¼­ ´õ ÀÌ»óÀÇ \"%s\" ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: ÄÝ·ÐÀÌ ¾ø½À´Ï´Ù"
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: ÀÌ»óÇÑ ÄÄÆ÷³ÍÆ®"
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: ¼ýÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Netbeans #2¿¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Netbeans¿¡ ¿¬°áÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr "E668: NetBeans ¿¬°á Á¤º¸ ÆÄÀÏÀÌ Á¢±Ù ¸ðµå°¡ À߸øµÊ: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "Netbeans ¼ÒÄÏ¿¡¼­ Àбâ"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: ¹öÆÛ %ld¿¡ ´ëÇÑ NetBeans ¿¬°áÀ» ÀÒ¾î¹ö·È½À´Ï´Ù"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "°æ°í: Å͹̳ÎÀÌ ºñÁê¾ó »óŸ¦ Ç¥½ÃÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: Ä¿¼­ ¹Ø¿¡ ¹®ÀÚ¿­ÀÌ ¾ø½À´Ï´Ù"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: Ä¿¼­ ¹Ø¿¡ ½Äº°ÀÚ°¡ ¾ø½À´Ï´Ù"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: ÇöÀçÀÇ 'foldmethod'À¸·Î Á¢±â¸¦ Áö¿ï ¼ö ¾ø½À´Ï´Ù"
+
+#: normal.c:6740
+msgid "E664: changelist is empty"
+msgstr "E664: changelist°¡ ºñ¾ú½À´Ï´Ù"
+
+#: normal.c:6742
+#~ msgid "E662: At start of changelist"
+#~ msgstr ""
+
+#: normal.c:6744
+#~ msgid "E663: At end of changelist"
+#~ msgstr ""
+
+#: normal.c:8005
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "VIMÀ» ¸¶Ä¡·Á¸é :quit<Enter> ÀÔ·Â"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 line %sed 1 time"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 line %sed %d times"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld lines %sed 1 time"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld lines %sed %d times"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld lines to indent... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 line indented "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld lines indented "
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "cannot yank; delete anyway"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "1 line changed"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld lines changed"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "freeing %ld lines"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "1 line yanked"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld lines yanked"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: %s ·¹Áö½ºÅÍ¿¡ ¾Æ¹« °Íµµ ¾ø½À´Ï´Ù"
+
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ·¹Áö½ºÅÍ ---"
+
+#: ops.c:5075
+msgid "Illegal register name"
+msgstr "ÀÌ»óÇÑ ·¹Áö½ºÅÍ À̸§"
+
+#: ops.c:5163
+#, c-format
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ·¹Áö½ºÅÍ:\n"
+
+#: ops.c:5213
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: ¸ð¸£´Â ·¹Áö½ºÅÍ Çü½Ä %d"
+
+#: ops.c:5698
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: À߸øµÈ ·¹Áö½ºÅÍ À̸§: '%s'"
+
+#: ops.c:6058
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld ¿­; "
+
+#: ops.c:6065
+#, c-format
+#~ msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+#~ msgstr ""
+
+#: ops.c:6081
+#, c-format
+#~ msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+#~ msgstr ""
+
+#: ops.c:6092
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=ÆäÀÌÁö %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "ºöÀ» ³¯°Ô ÇØ Áּż­ °í¸¿½À´Ï´Ù"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: ¸ð¸£´Â ¿É¼Ç"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Áö¿øµÇÁö ¾Ê´Â ¿É¼ÇÀÔ´Ï´Ù"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: ¸ðµå¶óÀο¡¼­ »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tLast set from "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: = µÚ¿¡ ¼ýÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: termcap¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: ÀÌ»óÇÑ ±ÛÀÚ <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: 'term'À» ºó ¹®ÀÚ¿­·Î ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: GUI¿¡¼­´Â termÀ» ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: GUI¸¦ ½ÃÀÛÇÏ·Á¸é \":gui\"¸¦ »ç¿ëÇϽʽÿÀ"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext'¿Í 'patchmode'°¡ µ¿ÀÏÇÕ´Ï´Ù"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: GTK+ 2 GUI¿¡¼­´Â ¹Ù²ð ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: ÄÝ·ÐÀÌ ¾ø½À´Ï´Ù"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: ºó ¹®ÀÚ¿­ÀÔ´Ï´Ù"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: <%s> µÚ¿¡ ¼ýÀÚ°¡ ¾ø½À´Ï´Ù"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: ÄÞ¸¶°¡ ¾ø½À´Ï´Ù"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: ' °ªÀ» ¸í½ÃÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: Ãâ·ÂÇÒ ¼ö ¾ø´Â, ȤÀº ¿ÍÀÌµå ¹®ÀÚ¸¦ Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: À߸øµÈ ±Û²Ã(µé)"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: ±Û²Ã¼ÂÀ» °í¸¦ ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: À߸øµÈ ±Û²Ã¼Â"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: ¿ÍÀÌµå ±Û²ÃÀ» °í¸¦ ¼ö ¾ø½À´Ï´Ù"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: À߸øµÈ ¿ÍÀÌµå ±Û²Ã"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: <%c> µÚ¿¡ ÀÌ»óÇÑ ±ÛÀÚ"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: ÄÞ¸¶°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring'Àº ºñ°Å³ª %sÀ»(¸¦) Æ÷ÇÔÇØ¾ß ÇÕ´Ï´Ù"
+
+#: option.c:5682
+msgid "E538: No mouse support"
+msgstr "E538: ¸¶¿ì½º¸¦ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù"
+
+#: option.c:5950
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: ´ÝÈ÷Áö ¾ÊÀº Ç¥Çö½Ä ¹è¿­"
+
+#: option.c:5954
+msgid "E541: too many items"
+msgstr "E541: ³Ê¹« ¸¹Àº Ç׸ñ"
+
+#: option.c:5956
+msgid "E542: unbalanced groups"
+msgstr "E542: ±ÕÇüÀÌ ¾È ÀâÈù ±×·ì"
+
+#: option.c:6196
+msgid "E590: A preview window already exists"
+msgstr "E590: ¹Ì¸® º¸±â âÀÌ ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù"
+
+#: option.c:6453
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: ArabicÀº UTF-8 ÀÎÄÚµù ÇÊ¿ä, ':set encoding=utf-8' Çϼ¼¿ä"
+
+#: option.c:6786
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Àû¾îµµ %d ÁÙÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: option.c:6796
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Àû¾îµµ %d Ä­ÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: option.c:7103
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ¸ð¸£´Â ¿É¼Ç: %s"
+
+#: option.c:7223
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Å͹̳ΠÄÚµå ---"
+
+#: option.c:7225
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Àü¿ª ¿É¼Ç °ª ---"
+
+#: option.c:7227
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Áö¿ª ¿É¼Ç °ª ---"
+
+#: option.c:7229
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- ¿É¼Ç ---"
+
+#: option.c:7935
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ¿¡·¯"
+
+#: option.c:8906
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': %s¿¡ ´ëÇÑ ¸Â´Â ±ÛÀÚ°¡ ¾ø½À´Ï´Ù"
+
+#: option.c:8940
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ¼¼¹ÌÄÝ·Ð µÚ¿¡ ±ÛÀÚ°¡ ´õ ÀÖÀ½: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "cannot open "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "ºö: âÀ» ¿­ ¼ö ¾ø½À´Ï´Ù!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "¾Æ¹Ì°¡µµ½º 2.04³ª ´õ ³ôÀº ÆÇÀÌ ÇÊ¿äÇÕ´Ï´Ù\n"
+
+#: os_amiga.c:344
+#, c-format
+#~ msgid "Need %s version %ld\n"
+#~ msgstr ""
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "NILÀ» ¿­ ¼ö ¾øÀ½:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Cannot create "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "ºöÀÌ %d °ªÀ¸·Î ³¡³À´Ï´Ù\n"
+
+#: os_amiga.c:941
+msgid "cannot change console mode ?!\n"
+msgstr "ÄÜ¼Ö »óŸ¦ ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù ?!\n"
+
+#: os_amiga.c:1012
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ÄܼÖÀÌ ¾Æ´Ñ°¡??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1161
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: -f ¿É¼ÇÀÌ »ç¿ëµÈ °æ¿ì ½©À» ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: os_amiga.c:1202 os_amiga.c:1292
+msgid "Cannot execute "
+msgstr "Cannot execute "
+
+#: os_amiga.c:1205 os_amiga.c:1302
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1225 os_amiga.c:1327
+msgid " returned\n"
+msgstr " returned\n"
+
+#: os_amiga.c:1468
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE°¡ ³Ê¹« ÀÛ½À´Ï´Ù."
+
+#: os_amiga.c:1472
+msgid "I/O ERROR"
+msgstr "I/O ¿¡·¯"
+
+#: os_mswin.c:543
+msgid "...(truncated)"
+msgstr "...(À߸²)"
+
+#: os_mswin.c:645
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns'ÀÌ 80ÀÌ ¾Æ´Ï¾î¼­, ¿ÜºÎ ¸í·ÉÀ» ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: os_mswin.c:1977
+msgid "E237: Printer selection failed"
+msgstr "E237: ÇÁ¸°Å͸¦ °í¸£Áö ¸øÇß½À´Ï´Ù"
+
+#: os_mswin.c:2017
+#, c-format
+#~ msgid "to %s on %s"
+#~ msgstr ""
+
+#: os_mswin.c:2032
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: ¸ð¸£´Â ÇÁ¸°ÅÍ ±Û²Ã: %s"
+
+#: os_mswin.c:2081 os_mswin.c:2091
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Àμ⠿¡·¯: %s"
+
+#: os_mswin.c:2092
+msgid "Unknown"
+msgstr "¸ð¸§"
+
+#: os_mswin.c:2119
+#, c-format
+msgid "Printing '%s'"
+msgstr "'%s' ÀμâÁß"
+
+#: os_mswin.c:3208
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: À߸øµÈ ±ÛÀڼ À̸§ \"%s\"ÀÌ(°¡) ±Û²Ã À̸§ \"%s\"¿¡ ÀÖ½À´Ï´Ù"
+
+#: os_mswin.c:3216
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: À߸øµÈ ±ÛÀÚ '%c'ÀÌ(°¡) ±Û²Ã À̸§ \"%s\"¿¡ ÀÖ½À´Ï´Ù"
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: À߸øµÈ 'osfiletype' ¿É¼Ç - Text¸¦ »ç¿ëÇÕ´Ï´Ù"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "ºö: °°Àº ½Ã±×³Î µÎ ¹ø, ³¡³À´Ï´Ù\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "ºö: %s ½Ã±×³ÎÀ» Àâ¾Ò½À´Ï´Ù\n"
+
+#: os_unix.c:936
+#, c-format
+msgid "Vim: Caught deadly signal\n"
+msgstr "ºö: Á×À» ½Ã±×³ÎÀ» Àâ¾Ò½À´Ï´Ù\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "X µð½ºÇ÷¹À̸¦ ¿©´Â µ¥ %ld msecÀÌ °É·È½À´Ï´Ù"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"ºö: X ¿¡·¯°¡ »ý°å½À´Ï´Ù\n"
+
+#: os_unix.c:1338
+msgid "Testing the X display failed"
+msgstr "X µð½ºÇ÷¹ÀÌ ½ÃÇèÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: os_unix.c:1477
+msgid "Opening the X display timed out"
+msgstr "X µð½ºÇ÷¹À̸¦ ¿­´Ù°¡ ½Ã°£ÀÌ ÃÊ°úµÇ¾ú½À´Ï´Ù"
+
+#: os_unix.c:3234 os_unix.c:3914
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Cannot execute shell "
+
+#: os_unix.c:3282
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"½© sh¸¦ ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù\n"
+
+#: os_unix.c:3286 os_unix.c:3920
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"shell returned "
+
+#: os_unix.c:3421
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"ÆÄÀÌÇÁ¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù\n"
+
+#: os_unix.c:3436
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"ÀÚ½Ä ÇÁ·Î¼¼½º¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù\n"
+
+#: os_unix.c:3927
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"¸í·ÉÀÌ ³¡¸¶ÃÄÁ³½À´Ï´Ù\n"
+
+#: os_unix.c:4191 os_unix.c:4316 os_unix.c:5982
+msgid "XSMP lost ICE connection"
+msgstr "XSMP°¡ ICE ¿¬°áÀ» ÀÒ¾î¹ö·È½À´Ï´Ù"
+
+#: os_unix.c:5565
+msgid "Opening the X display failed"
+msgstr "X µð½ºÇ÷¹ÀÌ ¿­±â°¡ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: os_unix.c:5887
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP°¡ save-yourself ¿äûÀ» ½ÇÇàÇÏ°í ÀÖ½À´Ï´Ù"
+
+#: os_unix.c:6006
+msgid "XSMP opening connection"
+msgstr "XSMP°¡ ¿¬°áÀ» ¿©´Â ÁßÀÔ´Ï´Ù"
+
+#: os_unix.c:6025
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP°¡ ICE ¿¬°á °¨½Ã¸¦ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: os_unix.c:6045
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection ½ÇÆÐ: %s"
+
+#: os_vms_mms.c:59
+#~ msgid "At line"
+#~ msgstr ""
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "¸í·ÉÇàÀ» À§ÇÑ ¸Þ¸ð¸®¸¦ ÇÒ´çÇÒ ¼ö ¾ø½À´Ï´Ù."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "ºö ¿¡·¯"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "vim32.dllÀ» ºÒ·¯ µéÀÏ ¼ö ¾ø½À´Ï´Ù!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "ÇÔ¼ö Æ÷ÀÎÅ͸¦ DLL·Î ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù!"
+
+#: os_win16.c:342 os_win32.c:3229
+#, c-format
+msgid "shell returned %d"
+msgstr "½©ÀÌ %dÀ»(¸¦) µ¹·ÁÁÖ¾ú½À´Ï´Ù"
+
+#: os_win32.c:2687
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "ºö: %s À̺¥Æ®¸¦ Àâ¾Ò½À´Ï´Ù\n"
+
+#: os_win32.c:2689
+msgid "close"
+msgstr "´Ý±â"
+
+#: os_win32.c:2691
+msgid "logoff"
+msgstr "·Î±×¾Æ¿ô"
+
+#: os_win32.c:2692
+msgid "shutdown"
+msgstr "¼Ë´Ù¿î"
+
+#: os_win32.c:3182
+msgid "E371: Command not found"
+msgstr "E371: ¸í·ÉÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: os_win32.c:3195
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE¸¦ $PATH¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù.\n"
+"¿ÜºÎ ¸í·ÉÀÌ ³¡³­ µÚ ¸ØÃâ ¼ö ¾ø½À´Ï´Ù.\n"
+"´Ù ¸¹Àº Á¤º¸¸¦ º¸½Ã·Á¸é :help win32-vimrunÀ» º¸½Ê½Ã¿À."
+
+#: os_win32.c:3198
+msgid "Vim Warning"
+msgstr "ºö °æ°í"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Çü½Ä ¹®ÀÚ¿­¿¡ %%%cÀÌ(°¡) ³Ê¹« ¸¹½À´Ï´Ù"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Çü½Ä ¹®ÀÚ¿­¿¡ %%%cÀÌ(°¡) À߸øµÇ¾ú½À´Ï´Ù"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Çü½Ä ¹®ÀÚ¿­¿¡ ]°¡ ¾ø½À´Ï´Ù"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Çü½Ä ¹®ÀÚ¿­¿¡ Áö¿øµÇÁö ¾Ê´Â %%%cÀÌ(°¡) ÀÖ½À´Ï´Ù"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Çü½Ä ¹®ÀÚ¿­ ¼­µÎ¿¡ À߸øµÈ %%%cÀÌ(°¡) ÀÖ½À´Ï´Ù"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Çü½Ä ¹®ÀÚ¿­¿¡ À߸øµÈ %%%cÀÌ(°¡) ÀÖ½À´Ï´Ù"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat'ÀÌ ¾î¶² ÆÐÅϵµ Æ÷ÇÔÇÏ°í ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ºüÁ³°Å³ª ºó ÀÚ·á¹æ À̸§"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: ´õ ÀÌ»óÀÇ Ç׸ñÀÌ ¾ø½À´Ï´Ù"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d of %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (ÁÙÀ» Áö¿üÀ½)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: ÄüÇȽº ½ºÅÃÀÇ ¹Ù´ÚÀÔ´Ï´Ù"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: ÄüÇȽº ½ºÅÃÀÇ ²À´ë±âÀÔ´Ï´Ù"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "error list %d of %d; %d errors"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: ¾µ ¼ö ¾øÀ½, 'buftype' ¿É¼ÇÀÌ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: %s%%[]¿¡ À߸øµÈ Ç׸ñ"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: ÆÐÅÏÀÌ ³Ê¹« ±é´Ï´Ù"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: \\z(°¡ ³Ê¹« ¸¹½À´Ï´Ù"
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: %s(°¡ ³Ê¹« ¸¹½À´Ï´Ù"
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: ¸ÂÁö ¾Ê´Â \\z("
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: ¸ÂÁö ¾Ê´Â %s%%("
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: ¸ÂÁö ¾Ê´Â %s("
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: ¸ÂÁö ¾Ê´Â %s)"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s* ¿¬»ê¼ö´Â ºô ¼ö ÀÖ½À´Ï´Ù"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: %s+ ¿¬»ê¼ö´Â ºô ¼ö ÀÖ½À´Ï´Ù"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: %s@ µÚ¿¡ À߸øµÈ ¹®ÀÚ"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{ ¿¬»ê¼ö´Â ºô ¼ö ÀÖ½À´Ï´Ù"
+
+#: regexp.c:1354
+#, c-format
+#~ msgid "E60: Too many complex %s{...}s"
+#~ msgstr ""
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Nested %s*"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Nested %s%c"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: \\_¸¦ Àß ¸ø »ç¿ë"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c µÚ¿¡ ¾Æ¹«°Íµµ ¾ø½À´Ï´Ù"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: ÀÌ»óÇÑ ÈÄÀ§ ÂüÁ¶"
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z(´Â ¿©±â¿¡¼­ Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 µîÀº ¿©±â¿¡¼­ Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: \\z µÚ¿¡ ÀÌ»óÇÑ ¹®ÀÚ"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: %s%%[ µÚ¿¡ ]°¡ ¾ø½À´Ï´Ù"
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: ºó %s%%[]"
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: %s%% µÚ¿¡ ÀÌ»óÇÑ ¹®ÀÚ"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: %s{...}¿¡ ±¸¹® ¿¡·¯"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Á×À½ °¡·Îè; Á¤±ÔÇ¥Çö½ÄÀÌ ³Ê¹« º¹ÀâÇÑ°¡¿ä?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: ÆÐÅÏ¿¡ ÀÇÇØ ½ºÅóÑħ ¿¡·¯°¡ »ý°å½À´Ï´Ù"
+
+#: regexp.c:3258
+#~ msgid "External submatches:\n"
+#~ msgstr ""
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld ÁÙ Á¢Èû "
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " ¼±ÅÃġȯ"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " ¹Ù²Ù±â"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " ¹Ý´ë"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " ³¢¿ö³Ö±â"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (³¢¿ö³Ö±â)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (¹Ù²Ù±â)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (¼±ÅÃġȯ)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Çìºê·ç"
+
+#: screen.c:8028
+#~ msgid " Arabic"
+#~ msgstr ""
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (¾ð¾î)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (ºÙÀ̱â)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " ºñÁÖ¾ó"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " ºñÁÖ¾ó ¶óÀÎ"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " ºñÁÖ¾ó ºí·Ï"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " °í¸£±â"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " ¶óÀÎ °í¸£±â"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " ºí·Ï °í¸£±â"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "±â·ÏÁß"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "óÀ½±îÁö ã¾ÒÀ½, ³¡¿¡¼­ °è¼Ó"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "³¡±îÁö ã¾ÒÀ½, óÀ½ºÎÅÍ °è¼Ó"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: À߸øµÈ ã±â ¹®ÀÚ¿­: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: óÀ½±îÁö ¸Â´Â ¹®ÀÚ¿­ÀÌ ¾ø½À´Ï´Ù: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ³¡±îÁö ¸Â´Â ¹®ÀÚ¿­ÀÌ ¾ø½À´Ï´Ù: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ';' µÚ¿¡´Â '?'³ª '/'°¡ ¿Í¾ß ÇÕ´Ï´Ù"
+
+#: search.c:3759
+msgid " (includes previously listed match)"
+msgstr " (ÀÌÀü¿¡ ¸Â¾Ò´ø ¸ñ·Ï Æ÷ÇÔ)"
+
+#. cursor at status line
+#: search.c:3779
+msgid "--- Included files "
+msgstr "--- Included files "
+
+#: search.c:3781
+msgid "not found "
+msgstr "not found "
+
+#: search.c:3782
+msgid "in path ---\n"
+msgstr "in path ---\n"
+
+#: search.c:3839
+msgid " (Already listed)"
+msgstr " (Already listed)"
+
+#: search.c:3841
+msgid " NOT FOUND"
+msgstr " ¸ø ã¾ÒÀ½"
+
+#: search.c:3893
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Æ÷ÇÔµÈ ÆÄÀÏ Ã£´Â Áß: %s"
+
+#: search.c:4111
+msgid "E387: Match is on current line"
+msgstr "E387: ¸Â´Â °Ô ÇöÀç ÁÙ¿¡ ÀÖ½À´Ï´Ù"
+
+#: search.c:4254
+msgid "All included files were found"
+msgstr "¸ðµç Æ÷ÇÔµÈ ÆÄÀÏÀ» ã¾Ò½À´Ï´Ù"
+
+#: search.c:4256
+msgid "No included files"
+msgstr "Æ÷ÇÔµÈ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù"
+
+#: search.c:4272
+msgid "E388: Couldn't find definition"
+msgstr "E388: Á¤ÀǸ¦ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: search.c:4274
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ÆÐÅÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: À߸øµÈ ÀÎÀÚ: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ÀÌ·± ±¸¹® Ŭ·¯½ºÅÍ´Â ¾ø½À´Ï´Ù: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "ÀÌ ¹öÆÛ¿¡ ´ëÇØ Á¤ÀÇµÈ ±¸¹® Ç׸ñÀÌ ¾ø½À´Ï´Ù"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "C-Çü½Ä ÁÖ¼®¹®¿¡ µ¿±â¸ÂÃã"
+
+#: syntax.c:3410
+#~ msgid "no syncing"
+#~ msgstr ""
+
+#: syntax.c:3413
+#~ msgid "syncing starts "
+#~ msgstr ""
+
+#: syntax.c:3415 syntax.c:3490
+#~ msgid " lines before top line"
+#~ msgstr ""
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Syntax µ¿±â Ç׸ñµé ---"
+
+#: syntax.c:3425
+#~ msgid ""
+#~ "\n"
+#~ "syncing on items"
+#~ msgstr ""
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Syntax Ç׸ñ ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ÀÌ·± ±¸¹® Ŭ·¯½ºÅÍ´Â ¾ø½À´Ï´Ù: %s"
+
+#: syntax.c:3480
+#~ msgid "minimal "
+#~ msgstr ""
+
+#: syntax.c:3487
+#~ msgid "maximal "
+#~ msgstr ""
+
+#: syntax.c:3499
+#~ msgid "; match "
+#~ msgstr ""
+
+#: syntax.c:3501
+#~ msgid " line breaks"
+#~ msgstr ""
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here´Â ¿©±â¿¡¼­ »ç¿ëµÉ ¼ö ¾ø½À´Ï´Ù"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: %s¿¡ ´ëÇÑ region Ç׸ñÀ» ãÁö ¸øÇß½À´Ï´Ù"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: contains ÀÎÀÚ´Â ¿©±â¿¡ ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: containedin ÀÎÀÚ´Â ¿©±â¿¡ ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: ÆÄÀÏÀ̸§ÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: '='ÀÌ ¾ø½À´Ï´Ù: %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: ÃæºÐÄ¡ ¾ÊÀº ÀÎÀÚ: ±¸¹® ¿µ¿ª %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Ŭ·¯½ºÅÍ°¡ ¸í½ÃµÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ÆÐÅÏ ±¸ºÐÀÚ¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: ÆÐÅÏ µÚ¿¡ ¾²·¹±â: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax sync: ÁÙ ¿¬¼Ó ÆÐÅÏÀÌ µÎ ¹ø »ç¿ëµÇ¾ú½À´Ï´Ù"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: ºñÁ¤»óÀûÀÎ ÀÎÀÚ: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: ÀÌÄ÷ ±âÈ£°¡ ºüÁ³À½: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ºó ÀÎÀÚ: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %sÀº(´Â) ¿©±â¿¡¼­ Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %sÀº(´Â) contains ¸ñ·ÏÀÇ Ã¹ ¹ø°¿©¾ß ÇÕ´Ï´Ù"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ¸ð¸£´Â ±×·ì À̸§: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: À߸øµÈ :syntax ÇÏÀ§ ¸í·É: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ÇÏÀ̶óÀÌÆ® ±×·ìÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: ÃæºÐÄ¡ ¾ÊÀº ÀÎÀÚ: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: ³Ê¹« ¸¹Àº ÀÎÀÚ: \":highlight link %s\""
+
+#: syntax.c:6187
+#~ msgid "E414: group has settings, highlight link ignored"
+#~ msgstr ""
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ¶æ¹ÛÀÇ ÀÌÄ÷ ±âÈ£: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ÀÌÄ÷ ±âÈ£°¡ ºüÁ³À½: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ÀÎÀÚ°¡ ºüÁ³À½: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ºñÁ¤»óÀûÀÎ °ª: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: ¸ð¸£´Â FG »ö»ó"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: ¸ð¸£´Â BG »ö»ó"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: »ö À̸§À̳ª ¼ýÀÚ¸¦ ÀνÄÇÒ ¼ö ¾øÀ½: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: Å͹̳ΠÄڵ尡 ³Ê¹« ±è: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: À߸øµÈ ÀÎÀÚ: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ³Ê¹« ¸¹Àº ´Ù¸¥ ÇÏÀ̶óÀÌÆ® ¼Ó¼ºÀÌ »ç¿ëµÇ°í ÀÖ½À´Ï´Ù"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: ±×·ì À̸§¿¡ Ãâ·ÂÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: ±×·ì À̸§¿¡ ÀÌ»óÇÑ ¹®ÀÚ"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: ÅÂ±× ½ºÅÃÀÇ ³¡ÀÔ´Ï´Ù"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: ÅÂ±× ½ºÅÃÀÇ Ã³À½ÀÔ´Ï´Ù"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ù ¹ø° ¸Â´Â ÅÂ±× ÀÌÀüÀ¸·Î´Â °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ű׸¦ ãÀ» ¼ö ¾øÀ½: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "ÆÄÀÏ\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "°í¸¦ ¼ýÀÚ ÀÔ·Â (<CR>Àº ÁßÁö):"
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: ¸Â´Â űװ¡ Çϳª ¹Û¿¡ ¾ø½À´Ï´Ù"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ¸¶Áö¸· ¸Â´Â ÅÂ±× µÚ·Î´Â °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "ÆÄÀÏ \"%s\"ÀÌ(°¡) Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d of %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " or more"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " Using tag with different case!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: ÆÄÀÏ \"%s\"ÀÌ(°¡) Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # TO tag FROM line in file/text"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "ÅÂ±× ÆÄÀÏ %s ã´Â Áß"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: %s¿¡ ´ëÇÑ ÅÂ±× ÆÄÀÏ °æ·Î°¡ À߷ȽÀ´Ï´Ù\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: ÅÂ±× ÆÄÀÏ \"%s\"¿¡ Çü½Ä ¿¡·¯°¡ ÀÖ½À´Ï´Ù"
+
+#: tag.c:2207
+#, c-format
+#~ msgid "Before byte %ld"
+#~ msgstr ""
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: ÅÂ±× ÆÄÀÏÀÌ Á¤·ÄµÇ¾î ÀÖÁö ¾ÊÀ½: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: ÅÂ±× ÆÄÀÏÀÌ ¾ø½À´Ï´Ù"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: ÅÂ±× ÆÐÅÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: ű׸¦ ãÀ» ¼ö ¾øÁö¸¸ ÀÌ°Å °°½À´Ï´Ù!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' not known. Available builtin terminals are:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "defaulting to '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: termcap ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Å͹̳ΠÇ׸ñÀ» terminfo¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Å͹̳ΠÇ׸ñÀ» termcap¿¡¼­ ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap¿¡ \"%s\" Ç׸ñÀÌ ¾ø½À´Ï´Ù"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Å͹̳ÎÀÌ \"cm\" ±â´ÉÀ» Áö¿øÇØ¾ß ÇÕ´Ï´Ù"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Å͹̳ΠŰ ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "»õ ½©ÀÌ ½ÃÀ۵Ǿú½À´Ï´Ù\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "ºö: ÀÔ·Â Àд Áß ¿¡·¯, ³¡³»´ÂÁß...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "Ãë¼Ò ºÒ°¡´É; ¾î·µç °è¼ÓÇÕ´Ï´Ù"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: À߸øµÈ ÁÙ ¹øÈ£"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "Çϳª ¹Ù²Ù¾ú½À´Ï´Ù"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld°³¸¦ ¹Ù²Ù¾ú½À´Ï´Ù"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: undo ¸ñ·ÏÀÌ ±úÁ³½À´Ï´Ù"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: undo ÁÙÀÌ ¾ø½À´Ï´Ù"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:707
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 ºñÆ® GUI ÆÇ"
+
+#: version.c:709
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 ºñÆ® GUI ÆÇ"
+
+#: version.c:712
+msgid " in Win32s mode"
+msgstr " Win32s »óÅÂ"
+
+#: version.c:714
+msgid " with OLE support"
+msgstr " OLE Áö¿ø"
+
+#: version.c:717
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 ºñÆ® ÄÜ¼Ö ÆÇ"
+
+#: version.c:721
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16 ºñÆ® ÆÇ"
+
+#: version.c:725
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 ºñÆ® MS-DOS ÆÇ"
+
+#: version.c:727
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 ºñÆ® MS-DOS ÆÇ"
+
+#: version.c:733
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (À¯´Ð½º) ÆÇ"
+
+#: version.c:735
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X ÆÇ"
+
+#: version.c:738
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS ÆÇ"
+
+#: version.c:743
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS ÆÇ"
+
+#: version.c:753
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Æ÷ÇÔµÈ ÆÐÄ¡: "
+
+#: version.c:779 version.c:1147
+#~ msgid "Modified by "
+#~ msgstr ""
+
+#: version.c:786
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Compiled "
+
+#: version.c:789
+msgid "by "
+msgstr "by "
+
+#: version.c:801
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"°Å´ëÇÑ ÆÇ "
+
+#: version.c:804
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Å« ÆÇ "
+
+#: version.c:807
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"º¸Åë ÆÇ "
+
+#: version.c:810
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"ÀÛÀº ÆÇ "
+
+#: version.c:812
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"¾ÆÁÖ ÀÛÀº ÆÇ "
+
+#: version.c:818
+msgid "without GUI."
+msgstr "GUI ¾øÀ½."
+
+#: version.c:823
+msgid "with GTK2-GNOME GUI."
+msgstr "GTK2-GNOME GUI."
+
+#: version.c:825
+msgid "with GTK-GNOME GUI."
+msgstr "GTK-GNOME GUI."
+
+#: version.c:829
+msgid "with GTK2 GUI."
+msgstr "GTK2 GUI."
+
+#: version.c:831
+msgid "with GTK GUI."
+msgstr "GTK GUI."
+
+#: version.c:836
+msgid "with X11-Motif GUI."
+msgstr "X11-Motif GUI."
+
+#: version.c:840
+msgid "with X11-neXtaw GUI."
+msgstr "X11-neXtaw GUI."
+
+#: version.c:842
+msgid "with X11-Athena GUI."
+msgstr "X11-Athena GUI."
+
+#: version.c:846
+msgid "with BeOS GUI."
+msgstr "BeOS GUI."
+
+#: version.c:849
+msgid "with Photon GUI."
+msgstr "Æ÷Åæ GUI."
+
+#: version.c:852
+msgid "with GUI."
+msgstr "GUI."
+
+#: version.c:855
+msgid "with Carbon GUI."
+msgstr "Carbon GUI."
+
+#: version.c:858
+msgid "with Cocoa GUI."
+msgstr "Cocoa GUI."
+
+#: version.c:861
+msgid "with (classic) GUI."
+msgstr "(Ŭ·¡½Ä) GUI."
+
+#: version.c:872
+msgid " Features included (+) or not (-):\n"
+msgstr " ±â´É (+: Æ÷ÇÔµÊ, -: Æ÷ÇÔ ¾È µÊ):\n"
+
+#: version.c:884
+msgid " system vimrc file: \""
+msgstr " ½Ã½ºÅÛ vimrc ÆÄÀÏ: \""
+
+#: version.c:889
+msgid " user vimrc file: \""
+msgstr " »ç¿ëÀÚ vimrc ÆÄÀÏ: \""
+
+#: version.c:894
+msgid " 2nd user vimrc file: \""
+msgstr " »ç¿ëÀÚ µÎ ¹ø° vimrc ÆÄÀÏ: \""
+
+#: version.c:899
+msgid " 3rd user vimrc file: \""
+msgstr " »ç¿ëÀÚ ¼¼ ¹ø° vimrc ÆÄÀÏ: \""
+
+#: version.c:904
+msgid " user exrc file: \""
+msgstr " »ç¿ëÀÚ exrc ÆÄÀÏ: \""
+
+#: version.c:909
+msgid " 2nd user exrc file: \""
+msgstr " »ç¿ëÀÚ µÎ ¹ø° exrc ÆÄÀÏ: \""
+
+#: version.c:915
+msgid " system gvimrc file: \""
+msgstr " ½Ã½ºÅÛ gvimrc ÆÄÀÏ: \""
+
+#: version.c:919
+msgid " user gvimrc file: \""
+msgstr " »ç¿ëÀÚ gvimrc ÆÄÀÏ: \""
+
+#: version.c:923
+msgid "2nd user gvimrc file: \""
+msgstr "»ç¿ëÀÚ µÎ ¹ø° gvimrc ÆÄÀÏ: \""
+
+#: version.c:928
+msgid "3rd user gvimrc file: \""
+msgstr "»ç¿ëÀÚ ¼¼ ¹ø° gvimrc ÆÄÀÏ: \""
+
+#: version.c:935
+msgid " system menu file: \""
+msgstr " ½Ã½ºÅÛ Â÷¸²Ç¥ ÆÄÀÏ: \""
+
+#: version.c:943
+msgid " fall-back for $VIM: \""
+msgstr " fall-back for $VIM: \""
+
+#: version.c:949
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " f-b for $VIMRUNTIME: \""
+
+#: version.c:953
+msgid "Compilation: "
+msgstr "ÄÄÆÄÀÏ: "
+
+#: version.c:959
+msgid "Compiler: "
+msgstr "ÄÄÆÄÀÏ·¯: "
+
+#: version.c:964
+msgid "Linking: "
+msgstr "¸µÅ©: "
+
+#: version.c:969
+msgid " DEBUG BUILD"
+msgstr " µð¹ö±× ºôµå"
+
+#: version.c:1008
+msgid "VIM - Vi IMproved"
+msgstr "ºö - Çâ»óµÈ Vi"
+
+#: version.c:1010
+msgid "version "
+msgstr "ÆÇ "
+
+#: version.c:1011
+msgid "by Bram Moolenaar et al."
+msgstr "by Bram Moolenaar et al."
+
+#: version.c:1015
+msgid "Vim is open source and freely distributable"
+msgstr "ºöÀº ¼Ò½º°¡ ¿­·Á ÀÖ°í °øÂ¥·Î ¹èÆ÷µË´Ï´Ù"
+
+#: version.c:1017
+msgid "Help poor children in Uganda!"
+msgstr "¿ì°£´Ù¿¡ »ç´Â °¡³­ÇÑ ¾ÆÀ̸¦ µµ¿ÍÁÖ¼¼¿ä!"
+
+#: version.c:1018
+msgid "type :help iccf<Enter> for information "
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é :help iccf<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1020
+msgid "type :q<Enter> to exit "
+msgstr "³¡³»·Á¸é :q<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1021
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "¿Â¶óÀÎ µµ¿ò¸»À» º¸·Á¸é :help<¿£ÅÍ> ¶Ç´Â <F1> ÀÔ·Â"
+
+#: version.c:1022
+msgid "type :help version6<Enter> for version info"
+msgstr "ÆÇ Á¤º¸¸¦ º¸·Á¸é :help version6<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1025
+msgid "Running in Vi compatible mode"
+msgstr "Vi ȣȯ »óÅ·Π½ÇÇàÁßÀÔ´Ï´Ù"
+
+#: version.c:1026
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "ºö ±âº»°ªÀ» »ç¿ëÇÏ·Á¸é :set nocp<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1027
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é :help cp-default<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1042
+msgid "menu Help->Orphans for information "
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é ¸Þ´º¿¡¼­ µµ¿ò¸»->°í¾Æ ¼±ÅÃ"
+
+#: version.c:1044
+msgid "Running modeless, typed text is inserted"
+msgstr "¸ðµå¾øÀÌ ¼öÇàÁßÀ̸ç, ÀÔ·ÂµÈ ¹®ÀÚ´Â »ðÀԵ˴ϴÙ"
+
+#: version.c:1045
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "¸Þ´º¿¡¼­ ÆíÁý->Àü¿ª ¼³Á¤->»ðÀÔ ¸ðµå Åä±ÛÀ» ¼±ÅÃÇϽøé "
+
+#: version.c:1046
+msgid " for two modes "
+msgstr " µÎ ¸ðµå¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù "
+
+#: version.c:1050
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "¸Þ´º¿¡¼­ ÆíÁý->Àü¿ª ¼³Á¤->Vi ȣȯ Åä±ÛÀ» ¼±ÅÃÇϽøé "
+
+#: version.c:1051
+msgid " for Vim defaults "
+msgstr " VimÀÌ ±âº»°ªÀ¸·Î µ¿ÀÛÇÕ´Ï´Ù "
+
+#: version.c:1098
+msgid "Sponsor Vim development!"
+msgstr "ºö °³¹ßÀ» ÈÄ¿øÇØ ÁÖ¼¼¿ä!"
+
+#: version.c:1099
+msgid "Become a registered Vim user!"
+msgstr "ºö »ç¿ëÀÚ·Î µî·ÏÇϼ¼¿ä!"
+
+#: version.c:1102
+msgid "type :help sponsor<Enter> for information "
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é :help sponsor<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1103
+msgid "type :help register<Enter> for information "
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é :help register<¿£ÅÍ> ÀÔ·Â"
+
+#: version.c:1105
+msgid "menu Help->Sponsor/Register for information "
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é ¸Þ´º µµ¿ò¸»->Sponsor/Register"
+
+#: version.c:1115
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "°æ°í: À©µµ¿ìÁî 95/98/ME¸¦ ã¾ÒÀ½"
+
+#: version.c:1118
+msgid "type :help windows95<Enter> for info on this"
+msgstr "ÀÌ¿¡ ´ëÇÑ Á¤º¸¸¦ º¸·Á¸é :help windows95<¿£ÅÍ> ÀÔ·Â"
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: ¹Ì¸® º¸±â âÀÌ ¾ø½À´Ï´Ù"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: À§ ¿ÞÂÊ°ú ¾Æ·¡ ¿À¸¥ÂÊÀ» µ¿½Ã¿¡ ³ª´­ ¼ö ¾ø½À´Ï´Ù"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ´Ù¸¥ âÀÌ ³ª´²Á³À» ¶§¿¡´Â ȸÀüÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: ¸¶Áö¸· âÀ» ´ÝÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "ÀÌ¹Ì ÇϳªÀÇ Ã¢¸¸ ÀÖ½À´Ï´Ù"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: ´Ù¸¥ âÀÌ ¹Ù²î¾ú½À´Ï´Ù"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Ä¿¼­ ¹Ø¿¡ ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: path¿¡¼­ \"%s\" ÆÄÀÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: if_perl.xs:326 globals.h:1241
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: %s ¶óÀ̺귯¸®¸¦ ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "¹Ì¾ÈÇÕ´Ï´Ù, ÀÌ ¸í·ÉÀº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù, Perl ¶óÀ̺귯¸®¸¦ ·ÎµùÇÒ ¼ö ¾ø"
+"½À´Ï´Ù."
+
+#: if_perl.xs:607
+#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+#~ msgstr ""
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "¿©·¯ ºöÀ¸·Î ÆíÁý(&M)"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "ÇϳªÀÇ ºöÀ¸·Î¸¸ ÆíÁý(&V)"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "ºöÀ¸·Î Diff(&D)"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "ºöÀ¸·Î ÆíÁý(&V)"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+#~ msgid "Edit with existing Vim - &"
+#~ msgstr ""
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "¼±ÅÃµÈ ÆÄÀÏ(µé)À» ºöÀ¸·Î ÆíÁý"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "ÇÁ·Î¼¼½º »ý¼º ¿¡·¯: gvimÀÌ path¿¡ ÀÖ´Â Áö È®ÀÎÇϼ¼¿ä!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ¿¡·¯"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "°æ·Î°¡ ³Ê¹« ±é´Ï´Ù"
+
+#: globals.h:1031
+msgid "--No lines in buffer--"
+msgstr "--¹öÆÛ¿¡ ÁÙ ¾øÀ½--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1194
+msgid "E470: Command aborted"
+msgstr "E470: ¸í·ÉÀÌ ÁßÁöµÇ¾ú½À´Ï´Ù"
+
+#: globals.h:1195
+msgid "E471: Argument required"
+msgstr "E471: ÀÎÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: globals.h:1196
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: /, ? ȤÀº &´Â \\ µÚ¿¡ ¿Í¾ß ÇÕ´Ï´Ù"
+
+#: globals.h:1198
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ¸í·ÉÁ٠â¿¡ À߸øµÊ; <CR> ½ÇÇà, CTRL-C ³¡³»±â"
+
+#: globals.h:1200
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: ÇöÀç ÀÚ·á¹æ ¶ÇÀº ÅÂ±× Ã£±â¿¡¼­ exrc/vimrc¿¡¼­ÀÇ ¸í·ÉÀº Çã¿ë ¾È µË´Ï´Ù"
+
+#: globals.h:1202
+msgid "E171: Missing :endif"
+msgstr "E171: :endif°¡ ¾ø½À´Ï´Ù"
+
+#: globals.h:1203
+msgid "E600: Missing :endtry"
+msgstr "E600: :endtry°¡ ¾ø½À´Ï´Ù"
+
+#: globals.h:1204
+msgid "E170: Missing :endwhile"
+msgstr "E170: :endwhileÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1205
+msgid "E588: :endwhile without :while"
+msgstr "E588: :while¾øÀÌ :endwhileÀÌ ÀÖ½À´Ï´Ù"
+
+#: globals.h:1207
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: ÆÄÀÏÀÌ ÀÖ½À´Ï´Ù (µ¤¾î¾²·Á¸é ! »ç¿ë)"
+
+#: globals.h:1208
+msgid "E472: Command failed"
+msgstr "E472: ¸í·ÉÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+
+#: globals.h:1210
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ¸ð¸£´Â ±Û²Ã¼Â: %s"
+
+#: globals.h:1214
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: ¸ð¸£´Â ±Û²Ã: %s"
+
+#: globals.h:1217
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: ±Û²Ã \"%s\"Àº(´Â) °íÁ¤³ÐÀÌ°¡ ¾Æ´Õ´Ï´Ù"
+
+#: globals.h:1219
+msgid "E473: Internal error"
+msgstr "E473: ³»ºÎ ¿¡·¯"
+
+#: globals.h:1220
+msgid "Interrupted"
+msgstr "ÁߴܵǾú½À´Ï´Ù"
+
+#: globals.h:1221
+msgid "E14: Invalid address"
+msgstr "E14: À߸øµÈ ÁÖ¼Ò"
+
+#: globals.h:1222
+msgid "E474: Invalid argument"
+msgstr "E474: À߸øµÈ ÀÎÀÚ"
+
+#: globals.h:1223
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: À߸øµÈ ÀÎÀÚ: %s"
+
+#: globals.h:1225
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: À߸øµÈ Ç¥Çö½Ä: %s"
+
+#: globals.h:1227
+msgid "E16: Invalid range"
+msgstr "E16: À߸øµÈ ¹üÀ§"
+
+#: globals.h:1228
+msgid "E476: Invalid command"
+msgstr "E476: À߸øµÈ ¸í·É"
+
+#: globals.h:1230
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\"Àº(´Â) ÀÚ·á¹æÀÔ´Ï´Ù"
+
+#: globals.h:1233
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' Àü¿¡ »ý°¢Áö ¸øÇÑ ±ÛÀÚ"
+
+#: globals.h:1236
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: ¶óÀ̺귯¸® \"%s()\" ºÎ¸£±â ½ÇÆÐ"
+
+#: globals.h:1242
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: %s ¶óÀ̺귯¸® ÇÔ¼ö¸¦ ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1244
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ¸¶Å©°¡ À߸øµÈ ÁÙ ¹øÈ£¸¦ °¡Áö°í ÀÖ½À´Ï´Ù"
+
+#: globals.h:1245
+msgid "E20: Mark not set"
+msgstr "E20: ¸¶Å©°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1246
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: ¹Ù²Ü ¼ö ¾øÀ½, 'modifiable'ÀÌ ²¨Á®ÀÖ½À´Ï´Ù"
+
+#: globals.h:1247
+msgid "E22: Scripts nested too deep"
+msgstr "E22: ½ºÅ©¸³Æ®°¡ ³Ê¹« ±í°Ô ÁßøµÇ¾ú½À´Ï´Ù"
+
+#: globals.h:1248
+msgid "E23: No alternate file"
+msgstr "E23: ´Ù¸¥ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1249
+msgid "E24: No such abbreviation"
+msgstr "E24: ±×·± ¾à¾î´Â ¾ø½À´Ï´Ù"
+
+#: globals.h:1250
+msgid "E477: No ! allowed"
+msgstr "E477: !Àº Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1252
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù: ÄÄÆÄÀÏ ¶§ Æ÷ÇÔµÇÁö ¾Ê¾Ò½À´Ï´Ù"
+
+#: globals.h:1255
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Hebrew´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù: ÄÄÆÄÀÏ ¶§ Æ÷ÇÔµÇÁö ¾Ê¾Ò½À´Ï´Ù\n"
+
+#: globals.h:1258
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Farsi´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù: ÄÄÆÄÀÏ ¶§ Æ÷ÇÔµÇÁö ¾Ê¾Ò½À´Ï´Ù\n"
+
+#: globals.h:1261
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: ArabicÀº »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù: ÄÄÆÄÀÏ ¶§ Æ÷ÇÔµÇÁö ¾Ê¾Ò½À´Ï´Ù\n"
+
+#: globals.h:1264
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ÀÌ·± ÇÏÀ̶óÀÌÆ® ±×·ì À̸§Àº ¾ø½À´Ï´Ù: %s"
+
+#: globals.h:1266
+msgid "E29: No inserted text yet"
+msgstr "E29: ÀÔ·ÂµÈ ÅؽºÆ®°¡ ¾ÆÁ÷ ¾ø½À´Ï´Ù"
+
+#: globals.h:1267
+msgid "E30: No previous command line"
+msgstr "E30: ÀÌÀü ¸í·É ÁÙÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1268
+msgid "E31: No such mapping"
+msgstr "E31: ±×·± ¸ÊÇÎÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1269
+msgid "E479: No match"
+msgstr "E479: ¸ÂÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1270
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: ¸ÂÁö ¾ÊÀ½: %s"
+
+#: globals.h:1271
+msgid "E32: No file name"
+msgstr "E32: ÆÄÀÏ À̸§ÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1272
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ÀÌÀü ¹Ù²Ù±â Á¤±Ô Ç¥Çö½ÄÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1273
+msgid "E34: No previous command"
+msgstr "E34: ÀÌÀü ¸í·ÉÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1274
+msgid "E35: No previous regular expression"
+msgstr "E35: ÀÌÀü Á¤±ÔÇ¥Çö½ÄÀÌ ¾ø½À´Ï´Ù"
+
+#: globals.h:1275
+msgid "E481: No range allowed"
+msgstr "E481: ¹üÀ§´Â Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1277
+msgid "E36: Not enough room"
+msgstr "E36: ºó °ø°£ÀÌ ÃæºÐÇÏÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1280
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: \"%s\"Àº(´Â) µî·ÏµÈ ¼­¹ö¸íÀÌ ¾Æ´Õ´Ï´Ù"
+
+#: globals.h:1282
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: %s ÆÄÀÏÀ» ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1283
+msgid "E483: Can't get temp file name"
+msgstr "E483: Àӽà ÆÄÀÏ À̸§À» ¾òÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1284
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: %s ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1285
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: %s ÆÄÀÏÀ» ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1286
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: ¸¶Áö¸·À¸·Î °íÄ£ µÚ ÀúÀåµÇÁö ¾Ê¾Ò½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: globals.h:1287
+msgid "E38: Null argument"
+msgstr "E38: ³Î ÀÎÀÚ"
+
+#: globals.h:1289
+msgid "E39: Number expected"
+msgstr "E39: ¼ýÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù"
+
+#: globals.h:1292
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ¿¡·¯ÆÄÀÏ %sÀ»(¸¦) ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1295
+msgid "E233: cannot open display"
+msgstr "E233: µð½ºÇ÷¹À̸¦ ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1297
+msgid "E41: Out of memory!"
+msgstr "E41: ¸Þ¸ð¸®°¡ ¹Ù´Ú³µ½À´Ï´Ù!"
+
+#: globals.h:1299
+msgid "Pattern not found"
+msgstr "ÆÐÅÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1301
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: ÆÐÅÏÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù: %s"
+
+#: globals.h:1302
+msgid "E487: Argument must be positive"
+msgstr "E487: ÀÎÀÚ´Â ¾ç¼öÀ̾î¾ß ÇÕ´Ï´Ù"
+
+#: globals.h:1304
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: ÀÌÀü µð·ºÅ丮·Î °¥ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1308
+msgid "E42: No Errors"
+msgstr "E42: ¿¡·¯ ¾øÀ½"
+
+#: globals.h:1310
+msgid "E43: Damaged match string"
+msgstr "E43: ±úÁø ¸Â´Â ¹®ÀÚ¿­"
+
+#: globals.h:1311
+msgid "E44: Corrupted regexp program"
+msgstr "E44: ±úÁø Á¤±ÔÇ¥Çö½Ä ÇÁ·Î±×·¥"
+
+#: globals.h:1312
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 'readonly' ¿É¼ÇÀÌ ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù (µ¤¾î¾²·Á¸é ! ´õÇϱâ)"
+
+#: globals.h:1314
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Àбâ Àü¿ë º¯¼ö \"%s\"À»(¸¦) ¼³Á¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1317
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ¿¡·¯ÆÄÀÏ Àд µµÁß¿¡ ¿¡·¯"
+
+#: globals.h:1320
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: sandbox¿¡¼­´Â Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1322
+msgid "E523: Not allowed here"
+msgstr "E523: ¿©±â¿¡¼­ Çã¿ëµÇÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1325
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ½ºÅ©¸° »óÅ ¼³Á¤Àº Áö¿øµÇÁö ¾Ê½À´Ï´Ù"
+
+#: globals.h:1327
+msgid "E49: Invalid scroll size"
+msgstr "E49: ½ºÅ©·Ñ Å©±â°¡ À߸øµÇ¾ú½À´Ï´Ù"
+
+#: globals.h:1328
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell' ¿É¼ÇÀÌ ºñ¾ú½À´Ï´Ù"
+
+#: globals.h:1330
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: sign ÀڷḦ ÀÐÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1332
+msgid "E72: Close error on swap file"
+msgstr "E72: ½º¿Ò ÆÄÀÏÀ» ´ÝÀ» ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1333
+msgid "E73: tag stack empty"
+msgstr "E73: ÅÂ±× ½ºÅÃÀÌ ºñ¾ú½À´Ï´Ù"
+
+#: globals.h:1334
+msgid "E74: Command too complex"
+msgstr "E74: ¸í·ÉÀÌ ³Ê¹« º¹ÀâÇÕ´Ï´Ù"
+
+#: globals.h:1335
+msgid "E75: Name too long"
+msgstr "E75: À̸§ÀÌ ³Ê¹« ±é´Ï´Ù"
+
+#: globals.h:1336
+msgid "E76: Too many ["
+msgstr "E76: [°¡ ³Ê¹« ¸¹½À´Ï´Ù"
+
+#: globals.h:1337
+msgid "E77: Too many file names"
+msgstr "E77: ÆÄÀÏ À̸§ÀÌ ³Ê¹« ¸¹½À´Ï´Ù"
+
+#: globals.h:1338
+msgid "E488: Trailing characters"
+msgstr "E488: ³¡¿¡ ¹®ÀÚ°¡ ´õ ÀÖ½À´Ï´Ù"
+
+#: globals.h:1339
+msgid "E78: Unknown mark"
+msgstr "E78: ¸ð¸£´Â ¸¶Å©"
+
+#: globals.h:1340
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ¸¸´É ±ÛÀÚ¸¦ È®ÀåÇÒ ¼ö ¾ø½À´Ï´Ù"
+
+#: globals.h:1342
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight'´Â 'winminheight'º¸´Ù Ä¿¾ß ÇÕ´Ï´Ù"
+
+#: globals.h:1344
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth'´Â 'winminwidth'º¸´Ù Ä¿¾ß ÇÕ´Ï´Ù"
+
+#: globals.h:1347
+msgid "E80: Error while writing"
+msgstr "E80: ¾²´Â Áß¿¡ ¿¡·¯"
+
+#: globals.h:1348
+#~ msgid "Zero count"
+#~ msgstr ""
+
+#: globals.h:1350
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: ½ºÅ©¸³Æ® ÄÜÅؽºÆ® ¹Û¿¡¼­ <SID> »ç¿ë"
+
+#: globals.h:1353
+msgid "E449: Invalid expression received"
+msgstr "E449: À߸øµÈ Ç¥Çö½ÄÀÌ ¹Þ¾ÆÁ³½À´Ï´Ù"
+
+#: globals.h:1356
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: ¿µ¿ªÀÌ º¸È£µÇ°í À־ ¼öÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù"
diff --git a/src/po/no.po b/src/po/no.po
new file mode 100644
index 000000000..817440e47
--- /dev/null
+++ b/src/po/no.po
@@ -0,0 +1,6630 @@
+# Norwegian (Bokmål) translation of Vim.
+# Copyright (C) 2003-2004 Free Software Foundation, Inc.
+# FIRST AUTHOR Øyvind A. Holm <sunny@sunbase.org>, 2003-2004.
+# no.po 317 2004-06-11 12:54:59Z sunny
+#
+# Comments and error reports appreciated.
+#
+# Information about the "Vim in Norwegian" project:
+#
+# http://www.sunbase.org/src/vim/norwegian/
+#
+# New versions of the translation files can be downloaded in .tar.gz
+# format from
+#
+# http://svn.sunbase.org/repos/norwegian_vim/download/
+#
+# The files are stored in the Subversion version control system and
+# users of this software can check out the latest version with
+#
+# svn checkout http://svn.sunbase.org/repos/norwegian_vim/trunk/msgs norwegian_vim-msgs
+#
+# This will place the message files into the "norwegian_vim-msgs"
+# directory.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.x\n"
+"POT-Creation-Date: 2004-06-11 14:38+0200\n"
+"PO-Revision-Date: 2003-05-13 08:19+0200\n"
+"Last-Translator: Øyvind A. Holm <sunny@sunbase.org>\n"
+"Language-Team: Norwegian <vim.in.norwegian@sunbase.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Report-Msgid-Bugs-To: sunny@sunbase.org\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Kan ikke reservere plass til noen buffere, avslutter ..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Kan ikke reservere plass til buffer, bruker en annen ..."
+
+#: buffer.c:808
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Ingen buffere ble lastet ut"
+
+#: buffer.c:810
+msgid "E516: No buffers were deleted"
+msgstr "E516: Ingen buffere ble slettet"
+
+#: buffer.c:812
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Ingen buffere ble visket ut"
+
+#: buffer.c:820
+msgid "1 buffer unloaded"
+msgstr "1 buffer ble lastet ut"
+
+#: buffer.c:822
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d buffere ble lastet ut"
+
+#: buffer.c:827
+msgid "1 buffer deleted"
+msgstr "1 buffer ble slettet"
+
+#: buffer.c:829
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buffere ble slettet"
+
+#: buffer.c:834
+msgid "1 buffer wiped out"
+msgstr "1 buffer ble visket ut"
+
+#: buffer.c:836
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d buffere ble visket ut"
+
+#: buffer.c:897
+msgid "E84: No modified buffer found"
+msgstr "E84: Fant ingen modifisert buffer"
+
+#. back where we started, didn't find anything.
+#: buffer.c:936
+msgid "E85: There is no listed buffer"
+msgstr "E85: Det finnes ingen listede buffere"
+
+#: buffer.c:948
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Bufferen %ld finnes ikke"
+
+#: buffer.c:951
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Kan ikke gå forbi siste buffer"
+
+#: buffer.c:953
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Kan ikke gå forbi første buffer"
+
+#: buffer.c:991
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr ""
+"E89: Ikke lagret siden forrige forandring av bufferen %ld (legg til ! for å "
+"overstyre)"
+
+#: buffer.c:1008
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Kan ikke laste ut siste buffer"
+
+#: buffer.c:1544
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Advarsel: Listen med filnavn er overfylt"
+
+#: buffer.c:1716
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Fant ikke bufferen %ld"
+
+#: buffer.c:1947
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Mer enn ett treff for %s"
+
+#: buffer.c:1949
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Ingen samsvarende buffer for %s"
+
+#: buffer.c:2344
+#, c-format
+msgid "line %ld"
+msgstr "linje %ld"
+
+#: buffer.c:2429
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: En buffer med dette navnet finnes allerede"
+
+#: buffer.c:2724
+msgid " [Modified]"
+msgstr " [Modifisert]"
+
+#: buffer.c:2729
+msgid "[Not edited]"
+msgstr "[Uredigert]"
+
+#: buffer.c:2734
+msgid "[New file]"
+msgstr "[Ny fil]"
+
+#: buffer.c:2735
+msgid "[Read errors]"
+msgstr "[Lesefeil]"
+
+#: buffer.c:2737 fileio.c:2124
+msgid "[readonly]"
+msgstr "[skrivebeskyttet]"
+
+#: buffer.c:2758
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 linje --%d%%--"
+
+#: buffer.c:2760
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld linjer --%d%%--"
+
+#: buffer.c:2767
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "linje %ld av %ld --%d%%-- kol "
+
+#: buffer.c:2875
+msgid "[No file]"
+msgstr "[Uten navn]"
+
+#. must be a help buffer
+#: buffer.c:2915
+msgid "help"
+msgstr "hjelp"
+
+#: buffer.c:3474 screen.c:5079
+msgid "[help]"
+msgstr "[hjelp]"
+
+#: buffer.c:3506 screen.c:5085
+msgid "[Preview]"
+msgstr "[Forhåndsvisning]"
+
+#: buffer.c:3786
+msgid "All"
+msgstr "Alt"
+
+#: buffer.c:3786
+msgid "Bot"
+msgstr "Bunn"
+
+#: buffer.c:3788
+msgid "Top"
+msgstr "Topp"
+
+#: buffer.c:4536
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Bufferliste:\n"
+
+#: buffer.c:4569
+msgid "[Error List]"
+msgstr "[Feilliste]"
+
+#: buffer.c:4582 memline.c:1521
+msgid "[No File]"
+msgstr "[Uten navn]"
+
+#: buffer.c:4895
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Skilt ---"
+
+#: buffer.c:4914
+#, c-format
+msgid "Signs for %s:"
+msgstr "Skilt for %s:"
+
+#: buffer.c:4920
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " linje=%ld id=%d navn=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Kan ikke sammenligne flere enn %ld buffere"
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: Kan ikke lage differansefiler"
+
+#: diff.c:819
+msgid "Patch file"
+msgstr "Patch fil"
+
+#: diff.c:1072
+msgid "E98: Cannot read diff output"
+msgstr "E98: Kan ikke lese differanse-utdata"
+
+#: diff.c:1822
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Nåværende buffer er ikke i differansemodus"
+
+#: diff.c:1834
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Ingen annen buffer i differansemodus"
+
+#: diff.c:1842
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: Mer enn to buffere i differansemodus, vet ikke hvilken som skal brukes"
+
+#: diff.c:1865
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Kan ikke finne buffer \"%s\""
+
+#: diff.c:1871
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Bufferen \"%s\" er ikke i differansemodus"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Escape er ikke lovlig i spesialtegn"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: Fant ikke keymap-fil"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Bruk av :loadkeymap utenfor en kjørt fil"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Nøkkelordfullføring (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X-modus (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Lokal nøkkelordfullføring (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Fullføring av hel linje (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Fullføring av filnavn (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Fullføring av tag (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Stimønster-fullføring (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Fullføring av defineringer (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Fullføring fra ordliste (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Thesaurus-fullføring (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Kommandolinje-fullføring (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Kom til slutten av avsnittet"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus'-valget er tomt"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "'dictionary'-valget er tomt"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Leter gjennom ordliste: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (sett inn) Rulling (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (erstatt) Rulling (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Leter: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "Leter gjennom tagger."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " Legger til"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Søker ..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Tilbake i originalen"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Ord fra annen linje"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "Det eneste treffet"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "treff %d av %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "treff %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Ukjent variabel: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Mangler parenteser: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Variabelen finnes ikke: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Mangler ':' etter '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Mangler ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Mangler ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Navn på valg mangler: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Ukjent valg: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Mangler anførselstegn (\"): %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Mangler apostrof ('): %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Ugyldige parametere til funksjon %s"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Ukjent funksjon: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: For mange parametere til funksjonen: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Ikke nok parametere til funksjonen: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Bruk av \"<SID>\" utenfor skript-sammenheng: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4385 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld linjer: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Avbryt"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "kalte inputrestore() oftere enn inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: For mange symbolske linker (runddans?)"
+
+#: eval.c:6626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Ingen forbindelse med Vim-tjeneren"
+
+#: eval.c:6724
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Klarer ikke lese svar fra tjeneren"
+
+#: eval.c:6752
+msgid "E258: Unable to send to client"
+msgstr "E258: Klarer ikke sende til klienten"
+
+#: eval.c:6800
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Klarer ikke sende til %s"
+
+#: eval.c:6900
+msgid "(Invalid)"
+msgstr "(Ugyldig)"
+
+#: eval.c:8078
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Udefinert variabel: %s"
+
+#: eval.c:8510
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: Ugyldig variabelnavn: %s"
+
+#: eval.c:8802
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: Funksjonen %s eksisterer allerede, legg til ! for å erstatte den"
+
+#: eval.c:8875
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Udefinert funksjon: %s"
+
+#: eval.c:8888
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Mangler '(': %s"
+
+#: eval.c:8921
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Ugyldig parameter: %s"
+
+#: eval.c:9000
+msgid "E126: Missing :endfunction"
+msgstr "E126: Mangler :endfunction"
+
+#: eval.c:9107
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Kan ikke omdefinere funksjonen %s: Den er i bruk"
+
+#: eval.c:9177
+msgid "E129: Function name required"
+msgstr "E129: Funksjonsnavn nødvendig"
+
+#: eval.c:9228
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Funksjonsnavn må ha stor forbokstav: %s"
+
+#: eval.c:9420
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Udefinert funksjon: %s"
+
+#: eval.c:9425
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Kan ikke slette funksjonen %s: Den er i bruk"
+
+#: eval.c:9473
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Funksjonskalldybden er større enn 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9526
+#, c-format
+msgid "calling %s"
+msgstr "kaller %s"
+
+#: eval.c:9588
+#, c-format
+msgid "%s aborted"
+msgstr "%s avbrutt"
+
+#: eval.c:9590
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s returnerer #%ld"
+
+#: eval.c:9597
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s returnerer \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9613 ex_cmds2.c:2370
+#, c-format
+msgid "continuing in %s"
+msgstr "fortsetter i %s"
+
+#: eval.c:9639
+msgid "E133: :return not inside a function"
+msgstr "E133: :return er ikke innenfor en funksjon"
+
+#: eval.c:9970
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globale variabler:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Oktal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Oktal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Flytting av linjer inn i seg selv"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 linje flyttet"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld linjer flyttet"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld linjer filtrert"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autokommandoer må ikke forandre nåværende buffer"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Ikke lagret siden forrige forandring]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s i linje: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: For mange feil, hopper over resten av filen"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Leser viminfo-fil \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " info"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " merker"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " FEILET"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo-fil er ikke skrivbar: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Kan ikke lagre viminfo-fil %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Lagrer viminfo-fil \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Denne viminfo-filen ble generert av Vim %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Du kan redigere den hvis du er forsiktig!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Verdien av 'encoding' når denne filen ble skrevet\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Ulovlig starttegn"
+
+#: ex_cmds.c:2097 ex_cmds2.c:761
+msgid "Save As"
+msgstr "Lagre som"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Filen er lastet i en annen buffer"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Skrive delvis fil?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Bruk ! for å skrive delvis buffer"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Overskrive eksisterende fil \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Mangler filnavn for buffer %ld"
+
+#: ex_cmds.c:2406
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Filen ble ikke lagret: Lagring er deaktivert med 'write'-valget"
+
+#: ex_cmds.c:2426
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"'readonly'-valget er satt for \"%.*s\".\n"
+"Vil du lagre likevel?"
+
+#: ex_cmds.c:2599
+msgid "Edit File"
+msgstr "Rediger fil"
+
+#: ex_cmds.c:3206
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autokommandoer slettet uventet den nye bufferen %s"
+
+#: ex_cmds.c:3340
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: Ikke-numerisk parameter til :z"
+
+#: ex_cmds.c:3425
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Skallkommandoer er ikke tillatt i rvim"
+
+#: ex_cmds.c:3532
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regulære uttrykk kan ikke bli adskilt av bokstaver"
+
+#: ex_cmds.c:3878
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "Erstatt med %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4271
+msgid "(Interrupted) "
+msgstr "(Avbrutt) "
+
+#: ex_cmds.c:4275
+msgid "1 substitution"
+msgstr "1 erstatning"
+
+#: ex_cmds.c:4277
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld erstatninger"
+
+#: ex_cmds.c:4280
+msgid " on 1 line"
+msgstr " i 1 linje"
+
+#: ex_cmds.c:4282
+#, c-format
+msgid " on %ld lines"
+msgstr " i %ld linjer"
+
+#: ex_cmds.c:4333
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Kan ikke gjøre :global rekursiv"
+
+#: ex_cmds.c:4368
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Regulært uttrykk mangler i global kommando"
+
+#: ex_cmds.c:4417
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Søkestreng funnet i alle linjene: %s"
+
+#: ex_cmds.c:4498
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Siste erstatningstekst:\n"
+"$"
+
+#: ex_cmds.c:4599
+msgid "E478: Don't panic!"
+msgstr "E478: Ingen panikk!"
+
+#: ex_cmds.c:4651
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Dessverre ingen '%s' hjelp for %s"
+
+#: ex_cmds.c:4654
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Dessverre ingen hjelp for %s"
+
+#: ex_cmds.c:4688
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Fant ikke hjelpefilen \"%s\""
+
+#: ex_cmds.c:5191
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: Er ikke en katalog: %s"
+
+#: ex_cmds.c:5332
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Kan ikke åpne %s for skriving"
+
+#: ex_cmds.c:5368
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Kan ikke åpne %s for lesing"
+
+#: ex_cmds.c:5404
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: Tegnsettblanding i hjelpefilen innenfor samme språk: %s"
+
+#: ex_cmds.c:5483
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s/%s"
+msgstr "E154: Duplikat-tag \"%s\" i filen %s/%s"
+
+#: ex_cmds.c:5599
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Ukjent skiltkommando: %s"
+
+#: ex_cmds.c:5619
+msgid "E156: Missing sign name"
+msgstr "E156: Mangler skiltnavn"
+
+#: ex_cmds.c:5665
+msgid "E612: Too many signs defined"
+msgstr "E612: For mange skilt definert"
+
+#: ex_cmds.c:5733
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Ugyldig skilttekst: %s"
+
+#: ex_cmds.c:5764 ex_cmds.c:5955
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Ukjent skilt: %s"
+
+#: ex_cmds.c:5813
+msgid "E159: Missing sign number"
+msgstr "E159: Mangler skiltnummer"
+
+#: ex_cmds.c:5895
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Ugyldig buffernavn: %s"
+
+#: ex_cmds.c:5934
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Ulovlig skilt-ID: %ld"
+
+#: ex_cmds.c:6004
+msgid " (NOT FOUND)"
+msgstr " (IKKE FUNNET)"
+
+#: ex_cmds.c:6006
+msgid " (not supported)"
+msgstr " (ikke støttet)"
+
+#: ex_cmds.c:6105
+msgid "[Deleted]"
+msgstr "[Slettet]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Går inn i debuggingsmodus. Skriv \"cont\" for å fortsette."
+
+#: ex_cmds2.c:96 ex_docmd.c:968
+#, c-format
+msgid "line %ld: %s"
+msgstr "linje %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "kommando: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Stoppunkt i \"%s%s\" linje %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Fant ikke stoppunkt: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Ingen stoppunkt definert"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s linje %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Lagre forandringer til \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9407
+msgid "Untitled"
+msgstr "Uten navn"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Ikke lagret siden siste forandringer i bufferen \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Advarsel: Gikk uventet inn i en annen buffer (sjekk autokommandoer)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Det er bare en fil å redigere"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Kan ikke gå forbi første fil"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Kan ikke gå forbi siste fil"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: Kompilatoren er ikke støttet: %s"
+
+#: ex_cmds2.c:1901
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Søker etter \"%s\" i \"%s\""
+
+#: ex_cmds2.c:1923
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Søker etter \"%s\""
+
+#: ex_cmds2.c:1945
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "ikke funnet i 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1979
+msgid "Source Vim script"
+msgstr "Kjør Vim-skript"
+
+#: ex_cmds2.c:2169
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Kan ikke kjøre en katalog: \"%s\""
+
+#: ex_cmds2.c:2207
+#, c-format
+msgid "could not source \"%s\""
+msgstr "kunne ikke kjøre \"%s\""
+
+#: ex_cmds2.c:2209
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "linje %ld: Kunne ikke kjøre \"%s\""
+
+#: ex_cmds2.c:2223
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "kjører \"%s\""
+
+#: ex_cmds2.c:2225
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "linje %ld: kjører \"%s\""
+
+#: ex_cmds2.c:2368
+#, c-format
+msgid "finished sourcing %s"
+msgstr "ferdig med kjøring av %s"
+
+#: ex_cmds2.c:2712
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Advarsel: Feil linjeseparator, det er mulig ^M mangler"
+
+#: ex_cmds2.c:2761
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding brukt utenfor en kjørt fil"
+
+#: ex_cmds2.c:2794
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish brukt utenfor en kjørt fil"
+
+#: ex_cmds2.c:3243
+#, c-format
+msgid "Page %d"
+msgstr "Side %d"
+
+#: ex_cmds2.c:3399
+msgid "No text to be printed"
+msgstr "Ingen tekst for utskrift"
+
+#: ex_cmds2.c:3477
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Skriver ut side %d (%d%%)"
+
+#: ex_cmds2.c:3489
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopi %d av %d"
+
+#: ex_cmds2.c:3547
+#, c-format
+msgid "Printed: %s"
+msgstr "Skrevet ut: %s"
+
+#: ex_cmds2.c:3554
+msgid "Printing aborted"
+msgstr "Utskrift avbrutt"
+
+#: ex_cmds2.c:3919
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Feil under skriving til Postscript-fil"
+
+#: ex_cmds2.c:4194
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Kan ikke åpne filen \"%s\""
+
+#: ex_cmds2.c:4204 ex_cmds2.c:4829
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Kan ikke lese Postscript-ressursfil \"%s\""
+
+#: ex_cmds2.c:4212
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: Filen \"%s\" er ikke en Postscript-ressursfil"
+
+#: ex_cmds2.c:4227 ex_cmds2.c:4247 ex_cmds2.c:4262 ex_cmds2.c:4284
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: Det er ikke støtte for Postscript-ressursfilen \"%s\""
+
+#: ex_cmds2.c:4314
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: Ressursfilen \"%s\" er feil versjon"
+
+#: ex_cmds2.c:4781
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Kan ikke åpne Postscript-fil for skriving"
+
+#: ex_cmds2.c:4814
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Kan ikke åpne filen \"%s\""
+
+#: ex_cmds2.c:4933
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Fant ikke Postscript-ressursfilen \"prolog.ps\""
+
+#: ex_cmds2.c:4964
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Fant ikke Postscript-ressursfilen \"%s.ps\""
+
+#: ex_cmds2.c:4982
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: Klarte ikke konvertere fra multibyte til \"%s\"-tegnsett"
+
+#: ex_cmds2.c:5107
+msgid "Sending to printer..."
+msgstr "Sender til skriver ..."
+
+#: ex_cmds2.c:5111
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Feil under utskrift av Postscript-fil"
+
+#: ex_cmds2.c:5113
+msgid "Print job sent."
+msgstr "Skriverjobb sendt."
+
+#: ex_cmds2.c:5623
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Nåværende %sspråk: \"%s\""
+
+#: ex_cmds2.c:5634
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Kan ikke sette språk til \"%s\""
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Går inn i Ex-modus. Skriv \"visual\" for å gå til normalmodus."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Ved slutten av filen"
+
+#: ex_docmd.c:670
+msgid "E169: Command too recursive"
+msgstr "E169: Kommando altfor rekursiv"
+
+#: ex_docmd.c:1232
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Unntak ikke fanget opp: %s"
+
+#: ex_docmd.c:1320
+msgid "End of sourced file"
+msgstr "Slutt på kjørt fil"
+
+#: ex_docmd.c:1321
+msgid "End of function"
+msgstr "Slutt på funksjon"
+
+#: ex_docmd.c:1910
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Flertydig bruk av brukerdefinert kommando"
+
+#: ex_docmd.c:1924
+msgid "E492: Not an editor command"
+msgstr "E492: Er ikke en editorkommando"
+
+#: ex_docmd.c:2031
+msgid "E493: Backwards range given"
+msgstr "E493: Område bakover er angitt"
+
+#: ex_docmd.c:2040
+msgid "Backwards range given, OK to swap"
+msgstr "Område bakover er angitt, OK å swappe"
+
+#: ex_docmd.c:2163
+msgid "E494: Use w or w>>"
+msgstr "E494: Bruk w eller w>>"
+
+#: ex_docmd.c:3789
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Kommandoen er ikke tilgjengelig i denne versjonen"
+
+#: ex_docmd.c:3992
+msgid "E172: Only one file name allowed"
+msgstr "E172: Bare ett filnavn tillatt"
+
+#: ex_docmd.c:4572
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 annen fil å redigere. Avslutt likevel?"
+
+#: ex_docmd.c:4575
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "%d andre filer å redigere. Avslutt likevel?"
+
+#: ex_docmd.c:4582
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 annen fil å redigere"
+
+#: ex_docmd.c:4584
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: %ld andre filer å redigere"
+
+#: ex_docmd.c:4679
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Kommandoen finnes allerede: Legg til ! for å erstatte den"
+
+#: ex_docmd.c:4790
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Navn Prm. Områd Fullfør Definering"
+
+#: ex_docmd.c:4879
+msgid "No user-defined commands found"
+msgstr "Ingen brukerdefinerte kommandoer funnet"
+
+#: ex_docmd.c:4911
+msgid "E175: No attribute specified"
+msgstr "E175: Ingen attributt spesifisert"
+
+#: ex_docmd.c:4963
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Ugyldig antall parametere"
+
+#: ex_docmd.c:4978
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Antall repeteringer kan ikke bli spesifisert to ganger"
+
+#: ex_docmd.c:4988
+msgid "E178: Invalid default value for count"
+msgstr "E178: Ugyldig standardverdi for antall repeteringer"
+
+#: ex_docmd.c:5019
+msgid "E179: argument required for complete"
+msgstr "E179: Trenger parameter til \"complete\""
+
+#: ex_docmd.c:5051
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Ugyldig \"complete\"-verdi: %s"
+
+#: ex_docmd.c:5060
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Fullføringsparameter er bare tillatt for tilpasset fullføring"
+
+#: ex_docmd.c:5066
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Tilpassede fullføringer trenger et funksjonsparameter"
+
+#: ex_docmd.c:5077
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Ugyldig attributt: %s"
+
+#: ex_docmd.c:5120
+msgid "E182: Invalid command name"
+msgstr "E182: Ugyldig kommandonavn"
+
+#: ex_docmd.c:5135
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Brukerdefinerte kommandoer må ha stor forbokstav"
+
+#: ex_docmd.c:5206
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Brukerdefinert kommando finnes ikke: %s"
+
+#: ex_docmd.c:5667
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Kan ikke finne fargeoppsettet %s"
+
+#: ex_docmd.c:5675
+msgid "Greetings, Vim user!"
+msgstr "Vær hilset, Vim-bruker!"
+
+#: ex_docmd.c:6396
+msgid "Edit File in new window"
+msgstr "Rediger fil i nytt vindu"
+
+#: ex_docmd.c:6697
+msgid "No swap file"
+msgstr "Ingen swapfil"
+
+#: ex_docmd.c:6801
+msgid "Append File"
+msgstr "Legg til fil"
+
+#: ex_docmd.c:6865
+msgid "E186: No previous directory"
+msgstr "E186: Ingen tidligere katalog"
+
+#: ex_docmd.c:6947
+msgid "E187: Unknown"
+msgstr "E187: Ukjent"
+
+#: ex_docmd.c:7032
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize trenger to numeriske parametere"
+
+#: ex_docmd.c:7088
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Vindusposisjon: X %d, Y %d"
+
+#: ex_docmd.c:7093
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: Lesing av vindusposisjon er ikke implementert på denne plattformen"
+
+#: ex_docmd.c:7103
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos trenger to numeriske parametere"
+
+#: ex_docmd.c:7381
+msgid "Save Redirection"
+msgstr "Lagre omdirigering"
+
+#: ex_docmd.c:7571
+msgid "Save View"
+msgstr "Lagre utseende"
+
+#: ex_docmd.c:7572
+msgid "Save Session"
+msgstr "Lagre økt"
+
+#: ex_docmd.c:7574
+msgid "Save Setup"
+msgstr "Lagre oppsett"
+
+#: ex_docmd.c:7726
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" finnes (legg til ! for å overstyre)"
+
+#: ex_docmd.c:7731
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Kan ikke åpne \"%s\" for skriving"
+
+#. set mark
+#: ex_docmd.c:7755
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Parameter må være en bokstav eller vanlig/baklengs apostrof"
+
+#: ex_docmd.c:7797
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursiv bruk av :normal er for dyp"
+
+#: ex_docmd.c:8315
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Ingen alternative filnavn tilgjengelig som erstatning for '#'"
+
+#: ex_docmd.c:8346
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr ""
+"E495: Ingen autokommandofilnavn tilgjengelig som erstatning for \"<afile>\""
+
+#: ex_docmd.c:8354
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr ""
+"E496: Ingen buffernummer tilgjengelig som erstatning for \"<abuf>\" i "
+"autokommando"
+
+#: ex_docmd.c:8365
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"E497: Ingen autokommandonavn tilgjengelig som erstatning for \"<amatch>\""
+
+#: ex_docmd.c:8375
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr ""
+"E498: Ingen ':source'-filnavn tilgjengelig som erstatning for \"<sfile>\""
+
+#: ex_docmd.c:8416
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Tomt filnavn for '%' eller '#', virker bare med \":p:h\""
+
+#: ex_docmd.c:8418
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Resulterer i en tom streng"
+
+#: ex_docmd.c:9389
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Kan ikke åpne viminfo-fil for lesing"
+
+#: ex_docmd.c:9562
+msgid "E196: No digraphs in this version"
+msgstr "E196: Ingen spesialtegn i denne versjonen"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Kan ikke :throw unntak med 'Vim'-forstavelse"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+#~ msgid "Exception thrown: %s"
+#~ msgstr ""
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Unntak fullført: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Unntak forkastet: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, linje %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Unntak fanget opp: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s satt på venting"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s gjenopptatt"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s forkastet"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Unntak"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "Feil og avbrudd"
+
+#: ex_eval.c:754 gui.c:4384
+msgid "Error"
+msgstr "Feil"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Avbrudd"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: Nøsting av :if for dyp"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif uten :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else uten :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif uten :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: Flere forekomster av :else"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif etter :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: Nøsting av :while for dyp"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue uten :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break uten :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: Nøsting av :try for dyp"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch uten :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch etter :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally uten :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: Flere forekomster av :finally"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry uten :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction er ikke innenfor en funksjon"
+
+#: ex_getln.c:3299
+msgid "tagname"
+msgstr "navn på tag"
+
+#: ex_getln.c:3302
+#~ msgid " kind file\n"
+#~ msgstr ""
+
+#: ex_getln.c:4768
+msgid "'history' option is zero"
+msgstr "'history'-valget er null"
+
+#: ex_getln.c:5039
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s-historie (nyeste til eldste):\n"
+
+#: ex_getln.c:5040
+msgid "Command Line"
+msgstr "Kommandolinje"
+
+#: ex_getln.c:5041
+msgid "Search String"
+msgstr "Søkestreng"
+
+#: ex_getln.c:5042
+msgid "Expression"
+msgstr "Uttrykk"
+
+#: ex_getln.c:5043
+msgid "Input Line"
+msgstr "Inndatalinje"
+
+#: ex_getln.c:5081
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar utenfor kommandolengden"
+
+#: ex_getln.c:5258
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktivt vindu eller buffer slettet"
+
+#: fileio.c:378
+msgid "Illegal file name"
+msgstr "Ulovlig filnavn"
+
+#: fileio.c:402 fileio.c:540 fileio.c:2925 fileio.c:2966
+msgid "is a directory"
+msgstr "er en katalog"
+
+#: fileio.c:404
+msgid "is not a file"
+msgstr "er ikke en fil"
+
+#: fileio.c:562 fileio.c:4143
+msgid "[New File]"
+msgstr "[Ny fil]"
+
+#: fileio.c:595
+msgid "[Permission Denied]"
+msgstr "[Tilgang nektet]"
+
+#: fileio.c:706
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: \"*ReadPre\"-autokommandoer gjorde filen uleselig"
+
+#: fileio.c:708
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: \"*ReadPre\"-autokommandoer må ikke forandre nåværende buffer"
+
+#: fileio.c:729
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Leser fra stdin ...\n"
+
+#: fileio.c:735
+msgid "Reading from stdin..."
+msgstr "Leser fra stdin ..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1012
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Konverteringen gjorde filen uleselig!"
+
+#: fileio.c:2102
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:2109
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2116
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:2124
+msgid "[RO]"
+msgstr "[SB]"
+
+#: fileio.c:2134
+msgid "[CR missing]"
+msgstr "[CR mangler]"
+
+#: fileio.c:2139
+msgid "[NL found]"
+msgstr "[NL funnet]"
+
+#: fileio.c:2144
+msgid "[long lines split]"
+msgstr "[lange linjer splittes]"
+
+#: fileio.c:2150 fileio.c:4127
+msgid "[NOT converted]"
+msgstr "[IKKE konvertert]"
+
+#: fileio.c:2155 fileio.c:4132
+msgid "[converted]"
+msgstr "[konvertert]"
+
+#: fileio.c:2162 fileio.c:4157
+msgid "[crypted]"
+msgstr "[kryptert]"
+
+#: fileio.c:2169
+msgid "[CONVERSION ERROR]"
+msgstr "[KONVERTERINGSFEIL]"
+
+#: fileio.c:2175
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[ULOVLIG BYTE i linje %ld]"
+
+#: fileio.c:2182
+msgid "[READ ERRORS]"
+msgstr "[LESEFEIL]"
+
+#: fileio.c:2398
+msgid "Can't find temp file for conversion"
+msgstr "Kan ikke finne midlertidig fil for konvertering"
+
+#: fileio.c:2405
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konvertering med 'charconvert' feilet"
+
+#: fileio.c:2408
+msgid "can't read output of 'charconvert'"
+msgstr "Kan ikke lese utdata fra 'charconvert'"
+
+#: fileio.c:2808
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autokommandoer slettet eller lastet ut buffer som skulle lagres"
+
+#: fileio.c:2831
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autokommando forandret linjeantall på en uventet måte"
+
+#: fileio.c:2869
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans forbyr lagring av buffere som ikke er forandret"
+
+#: fileio.c:2877
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "Delvis lagring ikke tillatt for NetBeans-buffere"
+
+#: fileio.c:2931 fileio.c:2949
+msgid "is not a file or writable device"
+msgstr "er ikke en fil eller skrivbar enhet"
+
+#: fileio.c:3001
+msgid "is read-only (add ! to override)"
+msgstr "er skrivebeskyttet (legg til ! for å overstyre)"
+
+#: fileio.c:3347
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Kan ikke skrive til backupfil (legg til ! for å overstyre)"
+
+#: fileio.c:3359
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: Feil under lukking av backupfil (legg til ! for å overstyre)"
+
+#: fileio.c:3361
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: Kan ikke lese fil for backup (legg til ! for å overstyre)"
+
+#: fileio.c:3377
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Kan ikke lese backupfil (legg til ! for å overstyre)"
+
+#: fileio.c:3480
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Kan ikke lage backupfil (legg til ! for å overstyre)"
+
+#: fileio.c:3542
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Ressursforgreningen ville gått tapt (legg til ! for å overstyre)"
+
+#: fileio.c:3652
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Kan ikke finne midlertidig fil for skriving"
+
+#: fileio.c:3670
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: Kan ikke konvertere (legg til ! for å lagre uten konvertering)"
+
+#: fileio.c:3705
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Kan ikke åpne lenket fil for skriving"
+
+#: fileio.c:3709
+msgid "E212: Can't open file for writing"
+msgstr "E212: Kan ikke åpne fil for skriving"
+
+#: fileio.c:3971
+msgid "E667: Fsync failed"
+msgstr "E667: Fsync feilet"
+
+#: fileio.c:3978
+msgid "E512: Close failed"
+msgstr "E512: Lukking feilet"
+
+#: fileio.c:4049
+msgid "E513: write error, conversion failed"
+msgstr "E513: Feil under skriving, konvertering feilet"
+
+#: fileio.c:4055
+msgid "E514: write error (file system full?)"
+msgstr "E514: Feil under lagring (full disk?)"
+
+#: fileio.c:4122
+msgid " CONVERSION ERROR"
+msgstr " KONVERTERINGSFEIL"
+
+#: fileio.c:4138
+msgid "[Device]"
+msgstr "[Enhet]"
+
+#: fileio.c:4143
+msgid "[New]"
+msgstr "[Ny]"
+
+#: fileio.c:4165
+msgid " [a]"
+msgstr " [l]"
+
+#: fileio.c:4165
+msgid " appended"
+msgstr " lagt til"
+
+#: fileio.c:4167
+msgid " [w]"
+msgstr " [s]"
+
+#: fileio.c:4167
+msgid " written"
+msgstr " skrevet"
+
+#: fileio.c:4217
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patchmode: Kan ikke lagre originalfil"
+
+#: fileio.c:4239
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: Kan ikke oppdatere tom originalfil"
+
+#: fileio.c:4254
+msgid "E207: Can't delete backup file"
+msgstr "E207: Kan ikke slette backupfil"
+
+#: fileio.c:4318
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ADVARSEL: Originalfilen kan bli tapt eller ødelagt\n"
+
+#: fileio.c:4320
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ikke avslutt editoren før filen er skikkelig lagret!"
+
+#: fileio.c:4409
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4409
+msgid "[dos format]"
+msgstr "[dos-format]"
+
+#: fileio.c:4416
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4416
+msgid "[mac format]"
+msgstr "[mac-format]"
+
+#: fileio.c:4423
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4423
+msgid "[unix format]"
+msgstr "[unix-format]"
+
+#: fileio.c:4450
+msgid "1 line, "
+msgstr "1 linje, "
+
+#: fileio.c:4452
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld linjer, "
+
+#: fileio.c:4455
+msgid "1 character"
+msgstr "1 tegn"
+
+#: fileio.c:4457
+#, c-format
+msgid "%ld characters"
+msgstr "%ld tegn"
+
+#: fileio.c:4467
+msgid "[noeol]"
+msgstr "[ingenlinjeslutt]"
+
+#: fileio.c:4467
+msgid "[Incomplete last line]"
+msgstr "[Ufullstendig sistelinje]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4486
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ADVARSEL: Filen er blitt forandret siden den ble lest!!!"
+
+#: fileio.c:4488
+msgid "Do you really want to write to it"
+msgstr "Vil du virkelig skrive til den"
+
+#: fileio.c:5738
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Feil under skriving til \"%s\""
+
+#: fileio.c:5745
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Feil under lukking av \"%s\""
+
+#: fileio.c:5748
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Feil under lesing av \"%s\""
+
+#: fileio.c:5982
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: Autokommandoen \"FileChangedShell\" slettet buffer"
+
+#: fileio.c:5989
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Advarsel: Filen \"%s\" er ikke lenger tilgjengelig"
+
+#: fileio.c:6003
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Advarsel: Filen \"%s\" er forandret og bufferen var også forandret i Vim"
+
+#: fileio.c:6006
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Advarsel: Filen \"%s\" er forandret siden redigeringen startet"
+
+#: fileio.c:6008
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: Advarsel: Rettighetene til filen \"%s\" er forandret siden redigeringen "
+"startet"
+
+#: fileio.c:6018
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr ""
+"W13: Advarsel: Filen \"%s\" er blitt opprettet etter at redigeringen startet"
+
+#: fileio.c:6031
+msgid "See \":help W11\" for more info."
+msgstr "Se \":help W11\" for mer informasjon."
+
+#: fileio.c:6045
+msgid "Warning"
+msgstr "Advarsel"
+
+#: fileio.c:6046
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Åpne fil"
+
+#: fileio.c:6152
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Kunne ikke forberede for relasting \"%s\""
+
+#: fileio.c:6171
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Kunne ikke laste \"%s\" på nytt"
+
+#: fileio.c:6752
+msgid "--Deleted--"
+msgstr "--Slettet--"
+
+#. the group doesn't exist
+#: fileio.c:6912
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Gruppen finnes ikke: \"%s\""
+
+#: fileio.c:7038
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Ulovlig tegn etter *: %s"
+
+#: fileio.c:7050
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Handlingen finnes ikke: %s"
+
+#: fileio.c:7052
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: Gruppen eller handlingen finnes ikke: %s"
+
+#. Highlight title
+#: fileio.c:7210
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Autokommandoer ---"
+
+#: fileio.c:7481
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Kan ikke utføre autokommandoer for ALLE hendelser"
+
+#: fileio.c:7504
+msgid "No matching autocommands"
+msgstr "Ingen samsvarende autokommandoer"
+
+#: fileio.c:7825
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: Nøsting av autokommandoer for dyp"
+
+#: fileio.c:8100
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Autokommandoer for \"%s\""
+
+#: fileio.c:8108
+#, c-format
+msgid "Executing %s"
+msgstr "Utfører %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8176
+#, c-format
+msgid "autocommand %s"
+msgstr "autokommando %s"
+
+#: fileio.c:8743
+msgid "E219: Missing {."
+msgstr "E219: Mangler {."
+
+#: fileio.c:8745
+msgid "E220: Missing }."
+msgstr "E220: Mangler }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Ingen fold funnet"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Kan ikke lage fold med nåværende 'foldmethod'"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Kan ikke slette fold med nåværende 'foldmethod'"
+
+#: getchar.c:248
+#~ msgid "E222: Add to read buffer"
+#~ msgstr ""
+
+#: getchar.c:2208
+msgid "E223: recursive mapping"
+msgstr "E223: Rekursiv mapping"
+
+#: getchar.c:3087
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: Global forkortelse finnes allerede for %s"
+
+#: getchar.c:3090
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: Global mapping finnes allerede for %s"
+
+#: getchar.c:3222
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: Forkortelse finnes allerede for %s"
+
+#: getchar.c:3225
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: Mappingen finnes allerede for %s"
+
+#: getchar.c:3289
+msgid "No abbreviation found"
+msgstr "Ingen forkortelse funnet"
+
+#: getchar.c:3291
+msgid "No mapping found"
+msgstr "Ingen mapping funnet"
+
+#: getchar.c:4183
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Ulovlig modus"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Kan ikke starte grafisk brukergrensesnitt (GUI)"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Kan ikke lese fra \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr ""
+"E665: Kan ikke starte grafisk brukergrensesnitt, fant ingen gyldig font"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ugyldig"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: Verdien for 'imactivatekey' er ugyldig"
+
+#: gui.c:4064
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Kan ikke reservere farge %s"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<kan ikke åpne> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: Kan ikke bruke skrifttypen %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: Kan ikke returnere til nåværende katalog"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Sti:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: Kan ikke finne nåværende katalog"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Rullefeltelement: Klarte ikke hente dimensjoner på \"thumb pixmap\"."
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Dialogvindu for Vim"
+
+#: gui_beval.c:101 gui_w32.c:3978
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Kan ikke lage BalloonEval med både melding og tilbakekall"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Vim dialogvindu ..."
+
+#: gui_gtk.c:2060 message.c:2999
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nei\n"
+"&Avbryt"
+
+#: gui_gtk.c:2268
+#~ msgid "Input _Methods"
+#~ msgstr ""
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Søk og erstatt ..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Søk ..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Finn hva:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Erstatt med:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Finn kun hele ord"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Forskjell på store/små bokstaver"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Retning"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "Opp"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "Ned"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Finn neste"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Erstatt"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Erstatt alle"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Mottok \"dø\"-forespørsel fra øktbehandleren\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: Uventet ødeleggelse av hovedvinduet\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Velge skrifttype"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Brukte CUT_BUFFER0 istedenfor tomt valg"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Kataloger"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Hjelp"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Filer"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Valg"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Angre"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Kan ikke laste Zap-skrifttype '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Kan ikke bruke skrifttype %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Sender beskjed om å avslutte barneprosess.\n"
+
+#: gui_w32.c:839
+#, c-format
+msgid "E671: Cannot find window title \"%s\""
+msgstr "E671: Fant ikke vindutittel \"%s\""
+
+#: gui_w32.c:847
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Parameter ikke støttet: \"-%s\"; Bruk OLE-versjonen."
+
+#: gui_w32.c:1100
+msgid "E672: Unable to open window inside MDI application"
+msgstr "E672: Klarer ikke åpne vindu inne i MDI-applikasjon"
+
+#: gui_w48.c:2163
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Finn streng (bruk '\\\\' for å finne en '\\')"
+
+#: gui_w48.c:2188
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Søk og erstatt (bruk '\\\\' for å finne en '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: Kan ikke reservere fargekart, noen farger kan være feil"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Skrifttyper for de følgende tegnsett mangler i fontsett %s:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Navn på skrifttypesett: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Skrifttypen '%s' har ikke konstant bredde"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Navn på skrifttypesett: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%ld width is not twice that of font0\n"
+msgstr "Font%ld-bredde er ikke to ganger bredden av font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Font0-bredde: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Font1-bredde: %ld\n"
+"\n"
+
+#: hangulin.c:610
+#~ msgid "E256: Hangul automata ERROR"
+#~ msgstr ""
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Legg til en ny database"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Forespørsel etter søkestreng"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Vis denne meldingen"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Drep en forbindelse"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Reinitialiser alle forbindelser"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Vis forbindelser"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Bruk: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Denne cscope-kommandoen støtter ikke splitting av vinduet.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Bruk: cstag <identifikator>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: Tag ikke funnet"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) feil: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: \"stat\"-feil"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s er ikke en katalog eller gyldig cscope-database"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "La til cscope-database %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: Feil under lesing av cscope-forbindelse %ld"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: Ukjent cscope-søketype"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Kunne ikke lage cscope-rør (\"pipe\")"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Klarte ikke lage tvillingprosess for cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "Utføring av cs_create_connection feilet"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Klarte ikke starte cscope-prosess"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen for to_fp feilet"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen for fr_fp feilet"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: Ingen cscope-forbindelse"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: Ingen treff funnet for cscope-forespørsel %s av %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: Ugyldig \"cscopequickfix\"-flagg %c for %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "cscope-kommandoer:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Bruk: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: Kan ikke åpne cscope-database: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: Kan ikke hente informasjon om cscope-database"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: Duplisert cscope-database ikke lagt til"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: Maksimum antall cscope-forbindelser nådd"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope-forbindelse %s ikke funnet"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "cscope-forbindelsen %s stengt"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: Kritisk feil i cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Cscope-tag: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # linje"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "filnavn / kontekst / linje\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Cscope-feil: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Alle cscope-databaser resatt"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "ingen cscope-forbindelser\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid databasenavn legg til sti\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Denne kommandoen er deaktivert, Python-biblioteket kunne ikke lastes."
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Kan ikke starte Python rekursivt"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "Kan ikke slette \"OutputObject\"-attributter"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "\"softspace\" må være et heltall"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "ugyldig attributt"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() krever en liste av strenger"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Feil under initialisering av I/U-objekter"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "ugyldig uttrykk"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "uttrykk deaktivert på kompileringsstadiet"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "forsøk på å referere til slettet buffer"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "linjenummer utenfor område"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<bufferobjekt (slettet) ved %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "ugyldig merkenavn"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "bufferen finnes ikke"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "forsøk på å referere til slettet vindu"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "skrivebeskyttet attributt"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "markørposisjon utenfor buffer"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<vindusobjekt (slettet) ved %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<vindusobjekt (ukjent) ved %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<vindu %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "vinduet finnes ikke"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "kan ikke lagre angre-informasjon"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "kan ikke slette linje"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "kan ikke erstatte linje"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "kan ikke sette inn linje"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "streng kan ikke inneholde linjeskift"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Denne kommandoen er deaktivert, Ruby-biblioteket kunne ikke lastes."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Ukjent longjmp-status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Bytt mellom implementasjon/definisjon"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Vis basisklasse av"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Vis overstyrt medlemsfunksjon"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Hent fra fil"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Hent fra prosjekt"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Hent fra alle prosjekter"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Hent"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Vis kilde til"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Finn symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Bla gjennom klasse"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Vis klasse i hierarki"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Vis klasse i begrenset hierarki"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref refererer til"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref referert av"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref har en"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref brukt av"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Vis docu av"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generer docu for"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Kan ikke koble til SNiFF+. Sjekk miljøet (\"environment\") (sniffemacs må "
+"bli funnet i $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Feil under lesing. Frakoblet"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ er for øyeblikket "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ikke "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "oppkoblet"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Ukjent SNiFF+-forespørsel: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Feil ved oppkobling til SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ikke tilkoblet"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Ikke en SNiFF+-buffer"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Feil under skriving. Frakoblet"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "ugyldig buffernummer"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "ikke implementert enda"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "ukjent valg"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "kan ikke sette linje(r)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "merke ikke satt"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "rad %d kolonne %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "kan ikke sette inn/legge til linje"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "ukjent flagg: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "ukjent vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "tastaturavbrudd"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim-feil"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "kan ikke opprette buffer/vindukommando: Objektet slettes"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"kan ikke registrere callback-kommando: Buffer/vindu er allerede slettet"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL KRITISK FEIL: reflist skadet!? Vennligst rapporter dette til vim-"
+"dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"kan ikke registrere callback-kommando: Buffer/vindureferanse ikke funnet"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Denne kommandoen er deaktivert, Tcl-biblioteket kunne ikke lastes."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL-FEIL: Avslutningskode er ikke int!? Vennligst rapporter dette til "
+"vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "kan ikke hente linje"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Klarer ikke registrere kommandotjenernavn"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Klarte ikke sende kommando til destinasjonsprogrammet"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: Ugyldig tjener-id brukt: %s"
+
+#: if_xcmdsrv.c:1110
+#~ msgid "E251: VIM instance registry property is badly formed. Deleted!"
+#~ msgstr ""
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Ukjent valg"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "For mange redigeringsparametere"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Parameter mangler etter"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Søppel etter valg"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr ""
+"For mange \"+command\"-, \"-c command\"- eller \"--cmd kommando\"-parametere"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Ugyldig parameter for"
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Denne Vim-versjonen er kompilert uten differansefunksjonen."
+
+#: main.c:935
+msgid "Attempt to open script file again: \""
+msgstr "Forsøk på å åpne skriptfilen igjen: \""
+
+#: main.c:944
+msgid "Cannot open for reading: \""
+msgstr "Kan ikke åpne for lesing: \""
+
+#: main.c:988
+msgid "Cannot open for script output: \""
+msgstr "Kan ikke åpne for skript-utdata: \""
+
+#: main.c:1135
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d filer å redigere\n"
+
+#: main.c:1236
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Advarsel: Utdata går ikke til en terminal\n"
+
+#: main.c:1238
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Advarsel: Inndata kommer ikke fra en terminal\n"
+
+#. just in case..
+#: main.c:1306
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc kommandolinje"
+
+#: main.c:1347
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Kan ikke lese fra \"%s\""
+
+#: main.c:2420
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Mer info med: \"vim -h\"\n"
+
+#: main.c:2453
+msgid "[file ..] edit specified file(s)"
+msgstr "[file ..] rediger spesifisert(e) fil(er)"
+
+#: main.c:2454
+msgid "- read text from stdin"
+msgstr "- les tekst fra stdin"
+
+#: main.c:2455
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag rediger fil hvor en tag er definert"
+
+#: main.c:2457
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [feilfil] rediger fil med første feil"
+
+#: main.c:2466
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"bruk:"
+
+#: main.c:2469
+msgid " vim [arguments] "
+msgstr " vim [parametere] "
+
+#: main.c:2473
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" eller:"
+
+#: main.c:2476
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Parametere:\n"
+
+#: main.c:2477
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tBare filnavn etter dette"
+
+#: main.c:2479
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tIkke utvid jokertegn"
+
+#: main.c:2482
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistrer gvim for OLE"
+
+#: main.c:2483
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tFjern OLE-registrering for gvim"
+
+#: main.c:2486
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tKjør med GUI (som \"gvim\")"
+
+#: main.c:2487
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f eller --nofork\tForgrunn: Ikke fork når GUI-et startes"
+
+#: main.c:2489
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi-modus (som \"vi\")"
+
+#: main.c:2490
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx-modus (som \"ex\")"
+
+#: main.c:2491
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tStille (batch) modus (bare for \"ex\")"
+
+#: main.c:2493
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDifferanse-modus (som \"vimdiff\")"
+
+#: main.c:2495
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tLett modus (som \"evim\", uten modus)"
+
+#: main.c:2496
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tSkrivebeskyttet modus (som \"view\")"
+
+#: main.c:2497
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tBegrenset modus (som \"rvim\")"
+
+#: main.c:2498
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModifisering (lagring av filer) ikke tillatt"
+
+#: main.c:2499
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tModifiseringer i teksten ikke tillatt"
+
+#: main.c:2500
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinærmodus"
+
+#: main.c:2502
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp-modus"
+
+#: main.c:2504
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatibel med Vi: 'compatible'"
+
+#: main.c:2505
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tIkke helt Vi-kompatibel: 'nocompatible'"
+
+#: main.c:2506
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tInformasjonsnivå (\"Verbose\")"
+
+#: main.c:2507
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tDebuggingsmodus"
+
+#: main.c:2508
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tIngen swapfil, bruk bare hukommelsen"
+
+#: main.c:2509
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tList swapfiler og avslutt"
+
+#: main.c:2510
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (med filnavn)\tGjenopprett kræsjet økt"
+
+#: main.c:2511
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tSamme som -r"
+
+#: main.c:2513
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tIkke bruk newcli for å åpne vindu"
+
+#: main.c:2514
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <enhet>\t\tBruk <enhet> for I/U"
+
+#: main.c:2517
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tStart i arabisk modus"
+
+#: main.c:2520
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tStart in hebraisk modus"
+
+#: main.c:2523
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tStart i persisk (Farsi) modus"
+
+#: main.c:2525
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tSett terminaltypen til <terminal>"
+
+#: main.c:2526
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tBruk <vimrc> istedenfor eventuell .vimrc"
+
+#: main.c:2528
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tBruk <gvimrc> istedenfor eventuell .gvimrc"
+
+#: main.c:2530
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tIkke last plugin-skripts"
+
+#: main.c:2531
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tÅpne N vinduer (standard: Ett for hver fil)"
+
+#: main.c:2532
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tSom -o men splitt loddrett"
+
+#: main.c:2533
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tStart på slutten av filen"
+
+#: main.c:2534
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnr>\t\tStart på linje <lnr>"
+
+#: main.c:2536
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <kommando>\tKjør <kommando> før lasting av vimrc-filer"
+
+#: main.c:2538
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <kommando>\t\tKjør <kommando> etter lasting av første fil"
+
+#: main.c:2539
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <økt>\t\tKjør filen <økt> etter lasting av første fil"
+
+#: main.c:2540
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <innskript>\tLes normalmodus-kommandoer fra filen <innskript>"
+
+#: main.c:2541
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <utskript>\tLegg alle skrevne kommandoer til filen <utskript>"
+
+#: main.c:2542
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <utskript>\tSkriv alle skrevne kommandoer til filen <utskript>"
+
+#: main.c:2544
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tRediger krypterte filer"
+
+#: main.c:2548
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tKoble vim til denne spesielle X-tjeneren"
+
+#: main.c:2550
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tUnngå oppkobling til X-tjener"
+
+#: main.c:2553
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <filer>\tRediger <filer> på en Vim-tjener hvis mulig"
+
+#: main.c:2554
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <filer> Samme, ikke klag hvis tjeneren mangler"
+
+#: main.c:2555
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <filer> Som --remote men vent på filer som blir redigert"
+
+#: main.c:2556
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <files> Samme, ikke klag hvis tjeneren mangler"
+
+#: main.c:2557
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <nøkler>\tSend <nøkler> til en Vim-tjener og avslutt"
+
+#: main.c:2558
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <uttrykk>\tEvaluer <uttrykk> på en Vim-tjener og skriv "
+"resultatet"
+
+#: main.c:2559
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tList navn på tilgjengelige Vim-tjenere og avslutt"
+
+#: main.c:2560
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <navn>\tSend til/bli Vim-tjeneren <navn>"
+
+#: main.c:2563
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tBruk <viminfo> istedenfor .viminfo"
+
+#: main.c:2565
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h eller --help\tSkriv hjelpen (denne teksten) og avslutt"
+
+#: main.c:2566
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tSkriv versjonsinformasjon og avslutt"
+
+#: main.c:2570
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Parametere gjenkjent av gvim (Motif-versjon):\n"
+
+#: main.c:2574
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Parametere gjenkjent av gvim (neXtaw-versjon):\n"
+
+#: main.c:2576
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Parametere gjenkjent av gvim (Athena-versjon):\n"
+
+#: main.c:2580
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tKjør vim på <display>"
+
+#: main.c:2581
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tStart vim som ikon"
+
+#: main.c:2583
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <navn>\t\tBruk ressurs som om Vim var <navn>"
+
+#: main.c:2584
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Ikke implementert)\n"
+
+#: main.c:2586
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <farge>\tBruk <farge> på bakgrunnen (også: -bg)"
+
+#: main.c:2587
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <farge>\tBruk <farge> på normal tekst (også: -fg)"
+
+#: main.c:2588 main.c:2608
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <skrifttype>\t\tBruk <skrifttype> på normal tekst (også: -fn)"
+
+#: main.c:2589
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <skrifttype>\tBruk <skrifttype> på fet skrift"
+
+#: main.c:2590
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <skrifttype>\tBruk <skrifttype> på skrå tekst"
+
+#: main.c:2591 main.c:2609
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <geom>\tBruk <geom> for innledende vindusplassering (også: -geom)"
+
+#: main.c:2592
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr ""
+"-borderwidth <bredde>\tBruk en rammebredde tilsvarende <bredde> (også: -bw)"
+
+#: main.c:2593
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <bredde> Bruk en rullefeltbredde tilsvarende <bredde> "
+"(også: -sw)"
+
+#: main.c:2595
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr ""
+"-menuheight <høyde>\tBruk en menyblokkhøyde tilsvarende <høyde> (også: -mh)"
+
+#: main.c:2597 main.c:2610
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tBruk invers video (også: -rv)"
+
+#: main.c:2598
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tIkke bruk invers video (også: +rv)"
+
+#: main.c:2599
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <ressurs>\tSett den spesifiserte ressursen"
+
+#: main.c:2602
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Parametere gjenkjent av gvim (RISC OS-versjon):\n"
+
+#: main.c:2603
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <antall>\tInnledende bredde på vindu i kolonner"
+
+#: main.c:2604
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <antall>\tInnledende høyde på vindu i rader"
+
+#: main.c:2607
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Parametere gjenkjent av gvim (GTK+-versjon):\n"
+
+#: main.c:2611
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tKjør vim på <display> (også: --display)"
+
+#: main.c:2613
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\tSett en unik \"role\" for å identifisere hovedvinduet"
+
+#: main.c:2615
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÅpne Vim innenfor et annet GTK-skjermelement"
+
+#: main.c:2618
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <foreldretittel>\tStart Vim innenfor et foreldreprogram"
+
+#: main.c:2856
+msgid "No display"
+msgstr "Ingen display"
+
+#. Failed to send, abort.
+#: main.c:2871
+msgid ": Send failed.\n"
+msgstr ": Send feilet.\n"
+
+#. Let vim start normally.
+#: main.c:2877
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Send feilet. Prøver å utføre lokalt\n"
+
+#: main.c:2915 main.c:2936
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d av %d redigert"
+
+#: main.c:2958
+msgid "No display: Send expression failed.\n"
+msgstr "Ingen display: Sending av uttrykk feilet.\n"
+
+#: main.c:2970
+msgid ": Send expression failed.\n"
+msgstr ": Sending av uttrykk feilet.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "Ingen merker satt"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Ingen merker samsvarer med \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"merk linje kol fil/tekst"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" hopp linje kol fil/tekst"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"forand linje kol tekst"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Filmerker:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Hoppliste (nyeste først):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historie for merker inne i filer (yngst til eldst):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Mangler '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: Er ikke en gyldig codepage"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: Kan ikke sette IC-verdier (\"Input Context\")"
+
+#: mbyte.c:4583
+#~ msgid "E285: Failed to create input context"
+#~ msgstr ""
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Klarte ikke åpne inndatametode"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr ""
+"E287: Advarsel: Klarte ikke sette \"destroy callback\" til inndatametode"
+
+#: mbyte.c:4758
+#~ msgid "E288: input method doesn't support any style"
+#~ msgstr ""
+
+#: mbyte.c:4815
+#~ msgid "E289: input method doesn't support my preedit type"
+#~ msgstr ""
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: \"over-the-spot\"-stil trenger et skrifttypesett"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Din GTK+ er eldre enn 1.2.3. Statusområde deaktivert"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Inndatametodetjener kjører ikke"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: Blokken var ikke låst"
+
+#: memfile.c:1010
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Søkefeil i lesing av swapfil"
+
+#: memfile.c:1015
+msgid "E295: Read error in swap file"
+msgstr "E295: Lesefeil i swapfil"
+
+#: memfile.c:1067
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Søkefeil i skriving til swapfil"
+
+#: memfile.c:1085
+msgid "E297: Write error in swap file"
+msgstr "E297: Skrivefeil i swapfil"
+
+#: memfile.c:1282
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Swapfilen finnes allerede (symlenke-angrep?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Hentet ikke blokk nummer 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Hentet ikke blokk nummer 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Hentet ikke blokk nummer 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:444
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Opps, mistet swapfilen!!!"
+
+#: memline.c:449
+msgid "E302: Could not rename swap file"
+msgstr "E302: Klarte ikke skifte navn på swapfil"
+
+#: memline.c:519
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Klarte ikke åpne swapfil for \"%s\", gjenoppretting umulig"
+
+#: memline.c:618
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Hentet ikke blokk 0??"
+
+#: memline.c:758
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Ingen swapfil funnet for %s"
+
+#: memline.c:768
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Skriv nummeret på swapfil som skal brukes (0 for å avslutte): "
+
+#: memline.c:813
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Kan ikke åpne %s"
+
+#: memline.c:835
+msgid "Unable to read block 0 from "
+msgstr "Klarte ikke lese blokk 0 fra "
+
+#: memline.c:838
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Det er mulig ingen forandringer ble gjort, eller Vim oppdaterte ikke "
+"swapfilen."
+
+#: memline.c:848 memline.c:865
+msgid " cannot be used with this version of Vim.\n"
+msgstr " kan ikke brukes med denne Vim-versjonen.\n"
+
+#: memline.c:850
+msgid "Use Vim version 3.0.\n"
+msgstr "Bruk Vim versjon 3.0.\n"
+
+#: memline.c:856
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ser ikke ut som en Vim-swapfil"
+
+#: memline.c:869
+msgid " cannot be used on this computer.\n"
+msgstr " kan ikke brukes på denne maskinen.\n"
+
+#: memline.c:871
+msgid "The file was created on "
+msgstr "Filen ble laget på "
+
+#: memline.c:875
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"eller filen er blitt ødelagt."
+
+#: memline.c:904
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Bruker swapfilen \"%s\""
+
+#: memline.c:910
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Originalfil \"%s\""
+
+#: memline.c:923
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Advarsel: Originalfilen kan ha blitt forandret"
+
+#: memline.c:976
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Klarte ikke lese blokk 1 fra %s"
+
+#: memline.c:980
+msgid "???MANY LINES MISSING"
+msgstr "???MANGE LINJER MANGLER"
+
+#: memline.c:996
+msgid "???LINE COUNT WRONG"
+msgstr "???FEIL LINJEANTALL"
+
+#: memline.c:1003
+msgid "???EMPTY BLOCK"
+msgstr "???TOM BLOKK"
+
+#: memline.c:1029
+msgid "???LINES MISSING"
+msgstr "???LINJER MANGLER"
+
+#: memline.c:1061
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID til blokk 1 er feil (%s ikke en \".swp\"-fil?)"
+
+#: memline.c:1066
+msgid "???BLOCK MISSING"
+msgstr "???BLOKK MANGLER"
+
+#: memline.c:1082
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? Herfra til ???SLUTT kan linjer være rotet til"
+
+#: memline.c:1098
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? Herfra til ???SLUTT kan linjer ha blitt lagt til eller slettet"
+
+#: memline.c:1118
+msgid "???END"
+msgstr "???SLUTT"
+
+#: memline.c:1144
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Gjenoppretting avbrutt"
+
+#: memline.c:1149
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Feil oppdaget under gjenoppretting; se etter linjer som starter med ???"
+
+#: memline.c:1151
+msgid "See \":help E312\" for more information."
+msgstr "Se \":help E312\" for mer informasjon."
+
+#: memline.c:1156
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Gjenoppretting komplett. Du bør sjekke at alt er i orden."
+
+#: memline.c:1157
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Du vil kanskje lagre denne filen under et annet navn\n"
+
+#: memline.c:1158
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "og sammenligne den mot den originale filen for å finne forandringer)\n"
+
+#: memline.c:1159
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Slett \".swp\"-filen etterpå.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1215
+msgid "Swap files found:"
+msgstr "Swapfiler funnet:"
+
+#: memline.c:1393
+msgid " In current directory:\n"
+msgstr " I nåværende katalog:\n"
+
+#: memline.c:1395
+msgid " Using specified name:\n"
+msgstr " Bruker spesifisert navn:\n"
+
+#: memline.c:1399
+msgid " In directory "
+msgstr " I katalog "
+
+#: memline.c:1417
+msgid " -- none --\n"
+msgstr " -- ingen --\n"
+
+#: memline.c:1489
+msgid " owned by: "
+msgstr " eies av: "
+
+#: memline.c:1491
+msgid " dated: "
+msgstr " datert: "
+
+#: memline.c:1495 memline.c:3685
+msgid " dated: "
+msgstr " datert: "
+
+#: memline.c:1511
+msgid " [from Vim version 3.0]"
+msgstr " [fra Vim versjon 3.0]"
+
+#: memline.c:1515
+msgid " [does not look like a Vim swap file]"
+msgstr " [ser ikke ut som en Vim-swapfil]"
+
+#: memline.c:1519
+msgid " file name: "
+msgstr " filnavn: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" modifisert: "
+
+#: memline.c:1526
+msgid "YES"
+msgstr "JA"
+
+#: memline.c:1526
+msgid "no"
+msgstr "nei"
+
+#: memline.c:1530
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" brukernavn: "
+
+#: memline.c:1537
+msgid " host name: "
+msgstr " vertsnavn: "
+
+#: memline.c:1539
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" vertsnavn: "
+
+#: memline.c:1545
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" prosess-ID: "
+
+#: memline.c:1551
+msgid " (still running)"
+msgstr " (kjører fortsatt)"
+
+#: memline.c:1563
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [ikke brukbar med denne Vim-versjonen]"
+
+#: memline.c:1566
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [ikke brukbar på denne maskinen]"
+
+#: memline.c:1571
+msgid " [cannot be read]"
+msgstr " [kan ikke leses]"
+
+#: memline.c:1575
+msgid " [cannot be opened]"
+msgstr " [kan ikke åpnes]"
+
+#: memline.c:1765
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Kan ikke bevare, swapfil mangler"
+
+#: memline.c:1818
+msgid "File preserved"
+msgstr "Fil bevart"
+
+#: memline.c:1820
+msgid "E314: Preserve failed"
+msgstr "E314: Bevaring feilet"
+
+#: memline.c:1891
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: Ugyldig lnum: %ld"
+
+#: memline.c:1917
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: Kan ikke finne linje %ld"
+
+#: memline.c:2307
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: Pekerblokk-id feil 3"
+
+#: memline.c:2387
+msgid "stack_idx should be 0"
+msgstr "stack_idx skulle være 0"
+
+#: memline.c:2449
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Oppdaterte for mange blokker?"
+
+#: memline.c:2631
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: Pekerblokk-id feil 4"
+
+#: memline.c:2658
+msgid "deleted block 1?"
+msgstr "slettet blokk 1?"
+
+#: memline.c:2858
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Kan ikke finne linje %ld"
+
+#: memline.c:3101
+msgid "E317: pointer block id wrong"
+msgstr "E317: Pekerblokk-id feil"
+
+#: memline.c:3117
+msgid "pe_line_count is zero"
+msgstr "pe_line_count er null"
+
+#: memline.c:3146
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: Linjenummer utenfor område: %ld forbi slutten"
+
+#: memline.c:3150
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: Linjeantall feil i blokk %ld"
+
+#: memline.c:3199
+msgid "Stack size increases"
+msgstr "Stackstørrelse øker"
+
+#: memline.c:3245
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: Pekerblokk-id feil 2"
+
+#: memline.c:3675
+msgid "E325: ATTENTION"
+msgstr "E325: VIKTIG"
+
+#: memline.c:3676
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Fant en swapfil ved navn \""
+
+#: memline.c:3680
+msgid "While opening file \""
+msgstr "Under åpning av filen \""
+
+#: memline.c:3689
+msgid " NEWER than swap file!\n"
+msgstr " NYERE enn swapfil!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3693
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Det er mulig et annet program redigerer den samme filen.\n"
+" Hvis det er tilfelle, vær forsiktig så du ikke ender opp med to\n"
+" forskjellige utgaver av den samme filen når du gjør forandringer.\n"
+
+#: memline.c:3694
+msgid " Quit, or continue with caution.\n"
+msgstr " Avslutt, eller fortsett med varsomhet.\n"
+
+#: memline.c:3695
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) En økt for denne filen kræsjet.\n"
+
+#: memline.c:3696
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Hvis det er tilfelle, bruk \":recover\" eller \"vim -r "
+
+#: memline.c:3698
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" for å gjenopprette forandringene (se \":help recovery\").\n"
+
+#: memline.c:3699
+msgid " If you did this already, delete the swap file \""
+msgstr " Hvis du har gjort dette allerede, slett swapfilen \""
+
+#: memline.c:3701
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" for å unngå denne meldingen.\n"
+
+#: memline.c:3715 memline.c:3719
+msgid "Swap file \""
+msgstr "Swapfilen \""
+
+#: memline.c:3716 memline.c:3722
+msgid "\" already exists!"
+msgstr "\" finnes allerede!"
+
+#: memline.c:3725
+msgid "VIM - ATTENTION"
+msgstr "VIM - VIKTIG"
+
+#: memline.c:3727
+msgid "Swap file already exists!"
+msgstr "Swapfilen eksisterer allerede!"
+
+#: memline.c:3731
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&Åpne skrivebeskyttet\n"
+"&Rediger likevel\n"
+"&Gjenopprett\n"
+"&Avslutt\n"
+"Av&bryt"
+
+#: memline.c:3733
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&Åpne skrivebeskyttet\n"
+"&Rediger likevel\n"
+"&Gjenopprett\n"
+"&Avslutt\n"
+"Av&bryt\n"
+"&Slette den"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: For mange swapfiler funnet"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Del av menyelement er ikke undermeny"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Menyen eksisterer bare i en annen modus"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Ingen meny med dette navnet"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Menysti kan ikke lede til en undermeny"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Kan ikke legge til menyelementer direkte på menylinjen"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Skilletegn kan ikke være del av en menysti"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menyer ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Riv av denne menyen"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Menystien må lede til et menyvalg"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Fant ikke menyen: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Menyen er ikke definert for %s-modus"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Menystien må lede til en undermeny"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Fant ikke menyen - sjekk menynavnet"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Feil oppdaget under prosessering av %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "linje %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[strengen er for lang]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"Vedlikeholder for norsk oversettelse: Øyvind A. Holm <sunny@sunbase.org>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Avbryt: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "Trykk ENTER for å fortsette"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Trykk ENTER eller skriv en kommando for å fortsette"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Mer --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr ""
+" (ENTER/BACKSPACE: Linje, MELLOMROM/b: Side, Pil ned/Pil opp: Halv side, q: "
+"Avslutt)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (ENTER: Linje, MELLOMROM: Side, d: Halv side, q: Avslutt)"
+
+#: message.c:2982 message.c:2997
+msgid "Question"
+msgstr "Spørsmål"
+
+#: message.c:2984
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ja\n"
+"&Nei"
+
+#: message.c:3017
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nei\n"
+"&Lagre alle\n"
+"&Forkast alle\n"
+"&Avbryt"
+
+#: message.c:3058
+msgid "Save File dialog"
+msgstr "\"Lagre fil\"-dialogvindu"
+
+#: message.c:3060
+msgid "Open File dialog"
+msgstr "\"Åpne fil\"-dialogvindu"
+
+#. TODO: non-GUI file selector here
+#: message.c:3131
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Dessverre ingen filbehandler i konsollmodus"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Advarsel: Forandrer en skrivebeskyttet fil"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "1 linje lagt til"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "1 linje fjernet"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld linjer lagt til"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld linjer fjernet"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (Avbrutt)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "Vim: Bevarer filer ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "Vim: Ferdig.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "FEIL: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] totalt alloc-frigjort %lu-%lu, i bruk %lu, topp-bruk %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[kall] totale \"re/malloc()\"-er %lu, totale \"free()\"-er %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: Linjen blir for lang"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Intern feil: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Ikke mer ledig hukommelse! (Reserverer %lu bytes)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Kaller skall for å utføre \"%s\""
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: Mangler kolon"
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: Ulovlig modus"
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Ulovlig utseende på musepekeren"
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: Siffer forventet"
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: Ulovlig prosent"
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "Skriv krypteringsnøkkel: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr "Gjenta krypteringsnøkkelen: "
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "Krypteringsnøklene stemmer ikke overens!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Ugyldig sti: '**[nummer]' må være på slutten av stien eller bli "
+"etterfulgt av '%s'."
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Kan ikke finne katalogen \"%s\" i \"cdpath\""
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Kan ikke finne filen \"%s\" i stien"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Ingen flere katalog-\"%s\" funnet i \"cdpath\""
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Ingen flere fil-\"%s\" funnet i stien"
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: Mangler kolon"
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: Ulovlig komponent"
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: Siffer forventet"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Kan ikke koble til Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Kan ikke koble til Netbeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: Feil tilgangsmodus for infofilen til NetBeans-forbindelse: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "les fra Netbeans-socket"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Mistet NetBeans-forbindelse for buffer %ld"
+
+#: normal.c:2983
+msgid "Warning: terminal cannot highlight"
+msgstr "Advarsel: Terminalen kan ikke utheve"
+
+#: normal.c:3279
+msgid "E348: No string under cursor"
+msgstr "E348: Ingen streng under markør"
+
+#: normal.c:3281
+msgid "E349: No identifier under cursor"
+msgstr "E349: Ingen identifikator under markør"
+
+#: normal.c:4522
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Kan ikke slette folder med nåværende 'foldmethod'"
+
+#: normal.c:6743
+msgid "E664: changelist is empty"
+msgstr "E664: Forandringslisten er tom"
+
+#: normal.c:6745
+msgid "E662: At start of changelist"
+msgstr "E662: Ved starten av forandringsliste"
+
+#: normal.c:6747
+msgid "E663: At end of changelist"
+msgstr "E663: Ved slutten av forandringsliste"
+
+#: normal.c:8009
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Skriv :quit<Enter> for å avslutte Vim"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 linje \"%s\"-et 1 gang"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 linje \"%s\"-et %d ganger"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld linjer \"%s\"-et 1 gang"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld linjer \"%s\"-et %d ganger"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld linjer å rykke inn ... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 linje rykket inn "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld linjer rykket inn "
+
+#. must display the prompt
+#: ops.c:1688
+msgid "cannot yank; delete anyway"
+msgstr "kan ikke kopiere til utklippstavle; slett likevel"
+
+#: ops.c:2274
+msgid "1 line changed"
+msgstr "1 linje forandret"
+
+#: ops.c:2276
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld linjer forandret"
+
+#: ops.c:2660
+#, c-format
+msgid "freeing %ld lines"
+msgstr "frigjør %ld linjer"
+
+#: ops.c:2941
+msgid "1 line yanked"
+msgstr "1 linje kopiert til utklippstavlen"
+
+#: ops.c:2943
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld linjer kopiert til utklippstavlen"
+
+#: ops.c:3228
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Ingenting i register %s"
+
+#. Highlight title
+#: ops.c:3779
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registere ---"
+
+#: ops.c:5088
+msgid "Illegal register name"
+msgstr "Ulovlig registernavn"
+
+#: ops.c:5176
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registere:\n"
+
+#: ops.c:5226
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Ukjent registertype %d"
+
+#: ops.c:5711
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Ugyldig registernavn: '%s'"
+
+#: ops.c:6071
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Kol; "
+
+#: ops.c:6078
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Valgte %s%ld av %ld linjer; %ld av %ld ord; %ld av %ld bytes"
+
+#: ops.c:6094
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Kol %s av %s; Linje %ld av %ld; Ord %ld av %ld; Byte %ld av %ld"
+
+#: ops.c:6105
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Side %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Takk for at du fløy Vim"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Ukjent valg"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Valget er ikke støttet"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Ikke tillatt i moduslinje"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tSist satt fra "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Nummer nødvendig etter ="
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: Ikke funnet i termcap"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Ulovlig tegn <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Kan ikke sette 'term' til tom streng"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Kan ikke forandre \"term\" i grafisk brukergrensesnitt"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Bruk \":gui\" for å starte med grafisk brukergrensesnitt"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' og 'patchmode' er like"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Kan ikke forandres i GTK+ 2 GUI"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Mangler kolon"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Tom streng"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Mangler nummer etter <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Mangler komma"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Må spesifisere en \"'\"-verdi"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: Inneholder uskrivelige eller brede tegn"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Ugyldig(e) skrifttype(r)"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: Kan ikke velge skrifttypesett"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: Ugyldig skrifttypesett"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: Kan ikke velge bred skrifttype"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: Ugyldig bred skrifttype"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Ulovlig tegn etter <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: Komma nødvendig"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' må være tom eller inneholde %s"
+
+#: option.c:5682
+msgid "E538: No mouse support"
+msgstr "E538: Ingen støtte for mus"
+
+#: option.c:5950
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Uttrykkssekvens som ikke er lukket"
+
+#: option.c:5954
+msgid "E541: too many items"
+msgstr "E541: For mange elementer"
+
+#: option.c:5956
+msgid "E542: unbalanced groups"
+msgstr "E542: Ubalanserte grupper"
+
+#: option.c:6196
+msgid "E590: A preview window already exists"
+msgstr "E590: Det finnes allerede et forhåndsvisningsvindu"
+
+#: option.c:6453
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: Arabisk trenger UTF-8, utfør ':set encoding=utf-8'"
+
+#: option.c:6786
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Trenger minst %d linjer"
+
+#: option.c:6796
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Trenger minst %d kolonner"
+
+#: option.c:7103
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Ukjent valg: %s"
+
+#: option.c:7223
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Terminalkoder ---"
+
+#: option.c:7225
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Globale valgverdier ---"
+
+#: option.c:7227
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Lokale valgverdier ---"
+
+#: option.c:7229
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Valg ---"
+
+#: option.c:7935
+msgid "E356: get_varp ERROR"
+msgstr "E356: \"get_varp\"-FEIL"
+
+#: option.c:8906
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Samsvarende tegn mangler for %s"
+
+#: option.c:8940
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Ekstra tegn etter semikolon: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "kan ikke åpne "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Kan ikke åpne vindu!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Trenger Amigados versjon 2.04 eller nyere\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Trenger %s versjon %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "Kan ikke åpne NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Kan ikke opprette "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim avslutter med %d\n"
+
+#: os_amiga.c:941
+msgid "cannot change console mode ?!\n"
+msgstr "kan ikke forandre konsollmodus ?!\n"
+
+#: os_amiga.c:1012
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: Ikke et konsoll??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1161
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Kan ikke kjøre skall med \"-f\"-valg"
+
+#: os_amiga.c:1202 os_amiga.c:1292
+msgid "Cannot execute "
+msgstr "Kan ikke utføre "
+
+#: os_amiga.c:1205 os_amiga.c:1302
+msgid "shell "
+msgstr "skall "
+
+#: os_amiga.c:1225 os_amiga.c:1327
+msgid " returned\n"
+msgstr " returnerte\n"
+
+#: os_amiga.c:1468
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE for liten."
+
+#: os_amiga.c:1472
+msgid "I/O ERROR"
+msgstr "I/U-FEIL"
+
+#: os_mswin.c:548
+msgid "...(truncated)"
+msgstr " ...(kuttet)"
+
+#: os_mswin.c:650
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' er ikke 80, kan ikke utføre eksterne kommandoer"
+
+#: os_mswin.c:1982
+msgid "E237: Printer selection failed"
+msgstr "E237: Valg av skriver feilet"
+
+#: os_mswin.c:2022
+#, c-format
+msgid "to %s on %s"
+msgstr "til %s på %s"
+
+#: os_mswin.c:2037
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Ukjent skrifttype for skriver: %s"
+
+#: os_mswin.c:2086 os_mswin.c:2096
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Feil under utskrift: %s"
+
+#: os_mswin.c:2097
+msgid "Unknown"
+msgstr "Ukjent"
+
+#: os_mswin.c:2124
+#, c-format
+msgid "Printing '%s'"
+msgstr "Skriver ut '%s'"
+
+#: os_mswin.c:3213
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Ulovlig navn på tegnsett \"%s\" i skrifttypenavn \"%s\""
+
+#: os_mswin.c:3221
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Ulovlig tegn '%c' i skrifttypenavn \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Ugyldig 'osfiletype'-valg - bruker Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Dobbelt signal, avslutter\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Mottok dødelig signal %s\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Mottok dødelig signal\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Åpning av X-display tok %ld millisekunder"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Mottok X-feil\n"
+
+#: os_unix.c:1338
+msgid "Testing the X display failed"
+msgstr "Test av X-display feilet"
+
+#: os_unix.c:1477
+msgid "Opening the X display timed out"
+msgstr "Tidsavbrudd for åpning av X-display"
+
+#: os_unix.c:3234 os_unix.c:3914
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Kan ikke kjøre skall "
+
+#: os_unix.c:3282
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Kan ikke kjøre skallet sh\n"
+
+#: os_unix.c:3286 os_unix.c:3920
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"skallet returnerte "
+
+#: os_unix.c:3421
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Kan ikke opprette rør (\"pipe\")\n"
+
+#: os_unix.c:3436
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Kan ikke opprette tvillingprosess (\"fork\")\n"
+
+#: os_unix.c:3927
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Kommando avsluttet\n"
+
+#: os_unix.c:4191 os_unix.c:4316 os_unix.c:5982
+msgid "XSMP lost ICE connection"
+msgstr "XSMP mistet ICE-forbindelsen"
+
+#: os_unix.c:5565
+msgid "Opening the X display failed"
+msgstr "Åpning av X-display feilet"
+
+#: os_unix.c:5887
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP håndterer \"redd-deg-selv\"-forespørsel"
+
+#: os_unix.c:6006
+msgid "XSMP opening connection"
+msgstr "XSMP åpner forbindelse"
+
+#: os_unix.c:6025
+msgid "XSMP ICE connection watch failed"
+msgstr "Overvåkning av XSMP ICE-forbindelse feilet"
+
+#: os_unix.c:6045
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection feilet: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "På linje"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Klarte ikke reservere hukommelse for kommandolinjen."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "VIM-feil"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Klarte ikke laste vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Klarte ikke ordne opp i funksjonspekere til DLL-en!"
+
+#: os_win16.c:342 os_win32.c:3248
+#, c-format
+msgid "shell returned %d"
+msgstr "skallet returnerte %d"
+
+#: os_win32.c:2706
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Mottok \"%s\"-hendelse\n"
+
+#: os_win32.c:2708
+msgid "close"
+msgstr "lukk"
+
+#: os_win32.c:2710
+msgid "logoff"
+msgstr "logg av"
+
+#: os_win32.c:2711
+msgid "shutdown"
+msgstr "kjør ned"
+
+#: os_win32.c:3201
+msgid "E371: Command not found"
+msgstr "E371: Kommando ikke funnet"
+
+#: os_win32.c:3214
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE ikke funnet i $PATH.\n"
+"Eksterne kommandoer kommer ikke til å vente etter fullføring.\n"
+"Se \":help win32-vimrun\" for mer informasjon."
+
+#: os_win32.c:3217
+msgid "Vim Warning"
+msgstr "Vim-advarsel"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: For mange %%%c i formatstreng"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Uventet %%%c i formatstreng"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Mangler ] i formatstreng"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c ikke støttet i formatstreng"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Ugyldig %%%c i formatstreng-prefiks"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Ugyldig %%%c i formatstreng"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' inneholder ikke søkestreng"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Manglende eller tomt katalognavn"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Ingen flere elementer"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d av %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (linjen slettet)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: På bunnen av quickfix-stack"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: På toppen av quickfix-stack"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "feilliste %d av %d; %d feil"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Kan ikke lagre, 'buftype'-valget er satt"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: Ugyldig element i %s%%[]"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: Søkestrengen er for lang"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: For mange \\z("
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: For mange %s("
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: Usamsvarende \\z("
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Usamsvarende %s%%("
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Usamsvarende %s("
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Usamsvarende %s)"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: \"%s*\"-operatoren kunne være tom"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: \"%s+\"-operatoren kunne være tom"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: Ugyldig tegn etter %s@"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: \"%s{\"-operatoren kunne være tom"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: For mange komplekse %s{...}s"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Nøstede %s*"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Nøstede %s%c"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: Ugyldig bruk av \\_"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c etterfølger ingenting"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: Ulovlig tilbakereferanse"
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ikke tillatt her"
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 med venner er ikke tillatt her"
+
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Ugyldig tegn etter \\z"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Mangler ] etter %s%%["
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Tom %s%%[]"
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Ugyldig tegn etter %s%%"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Syntaksfeil i %s{...}"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Kræsj fanget opp; regulært uttrykk for komplekst?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: Søkestreng forårsaket ut-av-stack-feil"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "Eksterne deltreff:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld linjer foldet "
+
+#: screen.c:8000
+msgid " VREPLACE"
+msgstr " V-ERSTATT"
+
+#: screen.c:8004
+msgid " REPLACE"
+msgstr " ERSTATT"
+
+#: screen.c:8009
+msgid " REVERSE"
+msgstr " OMVENDT"
+
+#: screen.c:8011
+msgid " INSERT"
+msgstr " SETT INN"
+
+#: screen.c:8014
+msgid " (insert)"
+msgstr " (sett inn)"
+
+#: screen.c:8016
+msgid " (replace)"
+msgstr " (erstatt)"
+
+#: screen.c:8018
+msgid " (vreplace)"
+msgstr " (v-erstatt)"
+
+#: screen.c:8021
+msgid " Hebrew"
+msgstr " hebraisk"
+
+#: screen.c:8032
+msgid " Arabic"
+msgstr " arabisk"
+
+#: screen.c:8035
+msgid " (lang)"
+msgstr " (lang)"
+
+#: screen.c:8039
+msgid " (paste)"
+msgstr " (lim inn)"
+
+#: screen.c:8052
+msgid " VISUAL"
+msgstr " VISUELL"
+
+#: screen.c:8053
+msgid " VISUAL LINE"
+msgstr " VISUELL LINJE"
+
+#: screen.c:8054
+msgid " VISUAL BLOCK"
+msgstr " VISUELL BLOKK"
+
+#: screen.c:8055
+msgid " SELECT"
+msgstr " VELG"
+
+#: screen.c:8056
+msgid " SELECT LINE"
+msgstr " VELG LINJE"
+
+#: screen.c:8057
+msgid " SELECT BLOCK"
+msgstr " VELG BLOKK"
+
+#: screen.c:8072 screen.c:8135
+msgid "recording"
+msgstr "spiller inn"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "Søket traff TOPPEN, fortsetter fra BUNNEN"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "Søket traff BUNNEN, fortsetter fra TOPPEN"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Ugyldig søkestreng: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: Søket kom til TOPPEN uten treff på: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: Søket kom til BUNNEN uten treff på: %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Forventet '?' eller '/' etter ';'"
+
+#: search.c:3768
+msgid " (includes previously listed match)"
+msgstr " (inkluderer tidligere utlistede treff)"
+
+#. cursor at status line
+#: search.c:3788
+msgid "--- Included files "
+msgstr "--- Inkluderte filer "
+
+#: search.c:3790
+msgid "not found "
+msgstr "ikke funnet "
+
+#: search.c:3791
+msgid "in path ---\n"
+msgstr "i sti ---\n"
+
+#: search.c:3848
+msgid " (Already listed)"
+msgstr " (Allerede listet)"
+
+#: search.c:3850
+msgid " NOT FOUND"
+msgstr " IKKE FUNNET"
+
+#: search.c:3902
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Leter gjennom inkludert fil: %s"
+
+#: search.c:4120
+msgid "E387: Match is on current line"
+msgstr "E387: Treffet er på nåværende linje"
+
+#: search.c:4263
+msgid "All included files were found"
+msgstr "Alle inkluderte filer ble funnet"
+
+#: search.c:4265
+msgid "No included files"
+msgstr "Ingen inkluderte filer"
+
+#: search.c:4281
+msgid "E388: Couldn't find definition"
+msgstr "E388: Fant ikke definisjonen"
+
+#: search.c:4283
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Fant ikke søketeksten"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Ulovlig parameter: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Syntaksklyngen finnes ikke: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "Ingen syntakselementer er definert for denne bufferen"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "synkroniserer C-lignende kommentarer"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "ingen synkronisering"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "synkronisering starter "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " linjer før topplinje"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- \"Syntax sync\"-elementer ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synkroniserer på elementer"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Syntakselementer ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Syntaksklyngen finnes ikke: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimal "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "maksimal "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; samsvarer med "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " linjeskift"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: \"group[t]here\" aksepteres ikke her"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Fant ikke regionelement for %s"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: \"contains\"-parameter aksepteres ikke her"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: \"containedin\"-parameter aksepteres ikke her"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Trenger filnavn"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Mangler '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Ikke nok parametere: syntax region %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Ingen klynge er spesifisert"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Skilletegn for søketekst ble ikke funnet: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Søppel etter søketekst: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr ""
+"E403: syntax sync: Søkestreng for linjefortsettelser er spesifisert to ganger"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Ulovlige parametere: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Mangler \"er lik\"-tegn: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Tomt parameter: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s er ikke tillatt her"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s må være først i \"contains\"-liste"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Ukjent gruppenavn: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Ugyldig \":syntax\"-delkommando: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: Fant ikke uthevingsgruppe: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Ikke nok parametere: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: For mange parametere: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: Syntaxgruppen har oppsett, uthevingslenke ignoreres"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: Uventet \"er lik\"-tegn: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: Mangler \"er lik\"-tegn: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: Mangler parameter: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Ulovlig verdi: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: Ukjent forgrunnsfarge"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: Ukjent bakgrunnsfarge"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Kjenner ikke til fargenavnet eller -nummeret: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: Terminalkoden er for lang: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Ulovlig parameter: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: For mange forskjellige uthevingsattributter i bruk"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Ikke-skrivbart tegn i gruppenavn"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: Ugyldig tegn i gruppenavn"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: På bunnen av tag-stack"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: På toppen av tag-stack"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Kan ikke gå før første samsvarende tag"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: Fant ikke tag: %s"
+
+#: tag.c:583
+#~ msgid " # pri kind tag"
+#~ msgstr ""
+
+#: tag.c:586
+msgid "file\n"
+msgstr "fil\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Velg tag fra listen (<CR> for å avbryte): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: Det finnes bare en samsvarende tag"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Kan ikke gå bak siste samsvarende tag"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Filen \"%s\" finnes ikke"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d av %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " eller mer"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " Bruker tag med forskjellig bokstavstørrelse!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Filen \"%s\" finnes ikke"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # TIL tag FRA linje i fil/tekst"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Leter i tagfil %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Sti til tagfil kuttet for %s\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Formatfeil i tagfil \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Før byte %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tagfil ikke sortert: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: Ingen tagfil"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Kan ikke finne tagsøkestreng"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Kunne ikke finne tag, bare gjetter!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ikke kjent. Tilgjengelige innebygde terminaler er:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "faller tilbake på '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Kan ikke åpne termcap-fil"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Fant ikke terminaloppføring i terminfo"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Fant ikke terminaloppføring i termcap"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Ingen \"%s\"-oppføring i termcap"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminalfunksjonen \"cm\" nødvendig"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Terminaltaster ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "nytt skall startet\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Feil under lesing av inndata, avslutter ...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "Ingen angremuligheter; fortsett likevel"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: Gale linjenummer"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 forandring"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld forandringer"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: Angrelisten er skadet"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: Angrelisten mangler"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:711
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32-bits GUI-versjon"
+
+#: version.c:713
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32-bits GUI-versjon"
+
+#: version.c:716
+msgid " in Win32s mode"
+msgstr " i Win32s-modus"
+
+#: version.c:718
+msgid " with OLE support"
+msgstr " med OLE-støtte"
+
+#: version.c:721
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32-bits konsollversjon"
+
+#: version.c:725
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16-bits versjon"
+
+#: version.c:729
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32-bits MS-DOS-versjon"
+
+#: version.c:731
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16-bits MS-DOS-versjon"
+
+#: version.c:737
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix)-versjon"
+
+#: version.c:739
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X-versjon"
+
+#: version.c:742
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS-versjon"
+
+#: version.c:747
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS-versjon"
+
+#: version.c:757
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Inkluderte patcher: "
+
+#: version.c:783 version.c:1151
+msgid "Modified by "
+msgstr "Modifisert av "
+
+#: version.c:790
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Kompilert "
+
+#: version.c:793
+msgid "by "
+msgstr "av "
+
+#: version.c:805
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Diger (\"huge\") versjon "
+
+#: version.c:808
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Stor (\"big\") versjon "
+
+#: version.c:811
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normal versjon "
+
+#: version.c:814
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Liten (\"small\") versjon "
+
+#: version.c:816
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Spinkel (\"tiny\") versjon "
+
+#: version.c:822
+msgid "without GUI."
+msgstr "uten GUI."
+
+#: version.c:827
+msgid "with GTK2-GNOME GUI."
+msgstr "med GTK2-GNOME GUI."
+
+#: version.c:829
+msgid "with GTK-GNOME GUI."
+msgstr "med GTK-GNOME GUI."
+
+#: version.c:833
+msgid "with GTK2 GUI."
+msgstr "med GTK2 GUI."
+
+#: version.c:835
+msgid "with GTK GUI."
+msgstr "med GTK GUI."
+
+#: version.c:840
+msgid "with X11-Motif GUI."
+msgstr "med X11-Motif GUI."
+
+#: version.c:844
+msgid "with X11-neXtaw GUI."
+msgstr "med X11-neXtaw GUI."
+
+#: version.c:846
+msgid "with X11-Athena GUI."
+msgstr "med X11-Athena GUI."
+
+#: version.c:850
+msgid "with BeOS GUI."
+msgstr "med BeOS GUI."
+
+#: version.c:853
+msgid "with Photon GUI."
+msgstr "med Photon GUI."
+
+#: version.c:856
+msgid "with GUI."
+msgstr "med GUI."
+
+#: version.c:859
+msgid "with Carbon GUI."
+msgstr "med Carbon GUI."
+
+#: version.c:862
+msgid "with Cocoa GUI."
+msgstr "med Cocoa GUI."
+
+#: version.c:865
+msgid "with (classic) GUI."
+msgstr "med (klassisk) GUI."
+
+#: version.c:876
+msgid " Features included (+) or not (-):\n"
+msgstr " Funksjoner inkludert (+) eller ikke (-):\n"
+
+#: version.c:888
+msgid " system vimrc file: \""
+msgstr " vimrc-fil på systemet: \""
+
+#: version.c:893
+msgid " user vimrc file: \""
+msgstr " vimrc-fil for brukere: \""
+
+#: version.c:898
+msgid " 2nd user vimrc file: \""
+msgstr " vimrc-fil nr. 2 for brukere: \""
+
+#: version.c:903
+msgid " 3rd user vimrc file: \""
+msgstr " vimrc-fil nr. 3 for brukere: \""
+
+#: version.c:908
+msgid " user exrc file: \""
+msgstr " exrc-fil for brukere: \""
+
+#: version.c:913
+msgid " 2nd user exrc file: \""
+msgstr " exrc-fil nr. 2 for brukere: \""
+
+#: version.c:919
+msgid " system gvimrc file: \""
+msgstr " gvimrc-fil på systemet: \""
+
+#: version.c:923
+msgid " user gvimrc file: \""
+msgstr " gvimrc-fil for brukere: \""
+
+#: version.c:927
+msgid "2nd user gvimrc file: \""
+msgstr " gvimrc-fil nr. 2 for brukere: \""
+
+#: version.c:932
+msgid "3rd user gvimrc file: \""
+msgstr " gvimrc-fil nr. 3 for brukere: \""
+
+#: version.c:939
+msgid " system menu file: \""
+msgstr " menyfil på systemet: \""
+
+#: version.c:947
+msgid " fall-back for $VIM: \""
+msgstr " $VIM faller tilbake på: \""
+
+#: version.c:953
+msgid " f-b for $VIMRUNTIME: \""
+msgstr "$VIMRUNTIME faller tilbake på: \""
+
+#: version.c:957
+msgid "Compilation: "
+msgstr "Kompilering: "
+
+#: version.c:963
+msgid "Compiler: "
+msgstr "Kompilator: "
+
+#: version.c:968
+msgid "Linking: "
+msgstr "Linking: "
+
+#: version.c:973
+msgid " DEBUG BUILD"
+msgstr " DEBUGGINGSVERSJON"
+
+#: version.c:1012
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved - Forbedret Vi"
+
+#: version.c:1014
+msgid "version "
+msgstr "versjon "
+
+#: version.c:1015
+msgid "by Bram Moolenaar et al."
+msgstr "av Bram Moolenaar med flere"
+
+#: version.c:1019
+msgid "Vim is open source and freely distributable"
+msgstr "Vim er åpen kildekode og kan fritt distribueres"
+
+#: version.c:1021
+msgid "Help poor children in Uganda!"
+msgstr "Hjelp fattige barn i Uganda!"
+
+#: version.c:1022
+msgid "type :help iccf<Enter> for information "
+msgstr "skriv :help iccf<Enter> for informasjon "
+
+#: version.c:1024
+msgid "type :q<Enter> to exit "
+msgstr "skriv :q<Enter> for å avslutte "
+
+#: version.c:1025
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "skriv :help<Enter> eller <F1> for on-line hjelp"
+
+#: version.c:1026
+msgid "type :help version6<Enter> for version info"
+msgstr "skriv :help version6<Enter> for versjonsinfo "
+
+#: version.c:1029
+msgid "Running in Vi compatible mode"
+msgstr "Kjører i Vi-kompatibel modus"
+
+#: version.c:1030
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "skriv :set nocp<Enter> for standard Vim "
+
+#: version.c:1031
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "skriv :help cp-default<Enter> for informasjon "
+
+#: version.c:1046
+msgid "menu Help->Orphans for information "
+msgstr "meny: Hjelp->Foreldreløse for informasjon "
+
+#: version.c:1048
+msgid "Running modeless, typed text is inserted"
+msgstr "Kjører uten modus, tastetrykk blir lagt inn i teksten"
+
+#: version.c:1049
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "meny: Rediger->Globale innstillinger->Innsettingsmodus av/på"
+
+#: version.c:1050
+msgid " for two modes "
+msgstr " for to moduser "
+
+#: version.c:1054
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "meny: Rediger->Globale innstillinger->Vi-kompatibilitet av/på"
+
+#: version.c:1055
+msgid " for Vim defaults "
+msgstr " for standard Vim "
+
+#: version.c:1102
+msgid "Sponsor Vim development!"
+msgstr "Støtt utviklingen av Vim!"
+
+#: version.c:1103
+msgid "Become a registered Vim user!"
+msgstr "Bli registrert bruker av Vim!"
+
+#: version.c:1106
+msgid "type :help sponsor<Enter> for information "
+msgstr "skriv :help sponsor<Enter> for informasjon "
+
+#: version.c:1107
+msgid "type :help register<Enter> for information "
+msgstr "skriv :help register<Enter> for informasjon "
+
+#: version.c:1109
+msgid "menu Help->Sponsor/Register for information "
+msgstr "meny: Hjelp->Støtte/Registrering for informasjon "
+
+#: version.c:1119
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ADVARSEL: Windows 95/98/ME oppdaget"
+
+#: version.c:1122
+msgid "type :help windows95<Enter> for info on this"
+msgstr "skriv :help windows95<Enter> for informasjon "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Vindu for forhåndsvisning finnes ikke"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Kan ikke splitte \"topleft\" og \"botright\" på en gang"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Kan ikke rotere når et annet vindu er splittet"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: Kan ikke lukke det siste vinduet"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Allerede bare ett vindu"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Annet vindu inneholder forandringer"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Ingen filnavn under markøren"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Kan ikke finne filen \"%s\" i stien"
+
+#: globals.h:1241 if_perl.xs:326
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Klarte ikke laste bibliotek %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "Denne kommandoen er deaktivert, Perl-biblioteket kunne ikke lastes."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: Evaluering av Perl er ikke tillatt i sandkassen uten \"Safe\"-modulen"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Rediger med &flere Vim-er"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Rediger med enkel &Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Differanse med Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Rediger med &Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Rediger med eksisterende Vim - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Redigerer de(n) valgte filen(e) med Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Klarte ikke lage prosess: Sjekk at gvim er i stien!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "Feil i gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Lengden på stien er for lang!"
+
+#: globals.h:1031
+msgid "--No lines in buffer--"
+msgstr "--Ingen linjer i bufferen--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1194
+msgid "E470: Command aborted"
+msgstr "E470: Kommandoen avbrutt"
+
+#: globals.h:1195
+msgid "E471: Argument required"
+msgstr "E471: Parameter nødvendig"
+
+#: globals.h:1196
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ skulle ha vært fulgt av /, ? eller &"
+
+#: globals.h:1198
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Ugyldig i kommandolinjevindu; <ENTER> utfører, CTRL-C avslutter"
+
+#: globals.h:1200
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Kommandoen er ikke tillatt fra exrc/vimrc i nåværende katalog eller "
+"tagsøk"
+
+#: globals.h:1202
+msgid "E171: Missing :endif"
+msgstr "E171: Mangler :endif"
+
+#: globals.h:1203
+msgid "E600: Missing :endtry"
+msgstr "E600: Mangler :endtry"
+
+#: globals.h:1204
+msgid "E170: Missing :endwhile"
+msgstr "E170: Mangler :endwhile"
+
+#: globals.h:1205
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile uten :while"
+
+#: globals.h:1207
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Filen finnes (legg til ! for å overstyre)"
+
+#: globals.h:1208
+msgid "E472: Command failed"
+msgstr "E472: Kommandoen feilet"
+
+#: globals.h:1210
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Ukjent skrifttypesett: %s"
+
+#: globals.h:1214
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Ukjent skrifttype: %s"
+
+#: globals.h:1217
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Skrifttypen \"%s\" har ikke fast bredde"
+
+#: globals.h:1219
+msgid "E473: Internal error"
+msgstr "E473: Intern feil"
+
+#: globals.h:1220
+msgid "Interrupted"
+msgstr "Avbrutt"
+
+#: globals.h:1221
+msgid "E14: Invalid address"
+msgstr "E14: Ugyldig adresse"
+
+#: globals.h:1222
+msgid "E474: Invalid argument"
+msgstr "E474: Ugyldig parameter"
+
+#: globals.h:1223
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Ugyldig paramter: %s"
+
+#: globals.h:1225
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Ugyldig uttrykk: %s"
+
+#: globals.h:1227
+msgid "E16: Invalid range"
+msgstr "E16: Ugyldig område"
+
+#: globals.h:1228
+msgid "E476: Invalid command"
+msgstr "E476: Ugyldig kommando"
+
+#: globals.h:1230
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" er en katalog"
+
+#: globals.h:1233
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Uventede tegn før '='"
+
+#: globals.h:1236
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Bibliotek-kall feilet for \"%s()\""
+
+#: globals.h:1242
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Klarte ikke laste biblioteksfunksjon %s"
+
+#: globals.h:1244
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Merket har et ugyldig linjenummer"
+
+#: globals.h:1245
+msgid "E20: Mark not set"
+msgstr "E20: Merket ble ikke satt"
+
+#: globals.h:1246
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Kan ikke gjøre forandringer, 'modifiable' er av"
+
+#: globals.h:1247
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skripts nøstet for dypt"
+
+#: globals.h:1248
+msgid "E23: No alternate file"
+msgstr "E23: Ingen alternativ fil"
+
+#: globals.h:1249
+msgid "E24: No such abbreviation"
+msgstr "E24: Forkortelsen finnes ikke"
+
+#: globals.h:1250
+msgid "E477: No ! allowed"
+msgstr "E477: Ingen ! tillatt"
+
+#: globals.h:1252
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI kan ikke brukes: Ikke slått på under kompilering"
+
+#: globals.h:1255
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Hebraisk kan ikke brukes: Ikke slått på under kompilering\n"
+
+#: globals.h:1258
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E27: Persisk (Farsi) kan ikke brukes: Ikke slått på under kompilering\n"
+
+#: globals.h:1261
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Arabisk kan ikke brukes: Ikke slått på under kompilering\n"
+
+#: globals.h:1264
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Uthevingsgruppe finnes ikke: %s"
+
+#: globals.h:1266
+msgid "E29: No inserted text yet"
+msgstr "E29: Ingen innlagt tekst enda"
+
+#: globals.h:1267
+msgid "E30: No previous command line"
+msgstr "E30: Ingen tidligere kommandolinje"
+
+#: globals.h:1268
+msgid "E31: No such mapping"
+msgstr "E31: Mappingen finnes ikke"
+
+#: globals.h:1269
+msgid "E479: No match"
+msgstr "E479: Ingen treff"
+
+#: globals.h:1270
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Ingen treff: %s"
+
+#: globals.h:1271
+msgid "E32: No file name"
+msgstr "E32: Mangler filnavn"
+
+#: globals.h:1272
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Ingen tidligere erstatninger med regulære uttrykk"
+
+#: globals.h:1273
+msgid "E34: No previous command"
+msgstr "E34: Ingen tidligere kommando"
+
+#: globals.h:1274
+msgid "E35: No previous regular expression"
+msgstr "E35: Ingen tidligere regulære uttrykk"
+
+#: globals.h:1275
+msgid "E481: No range allowed"
+msgstr "E481: Område er ikke tillatt"
+
+#: globals.h:1277
+msgid "E36: Not enough room"
+msgstr "E36: Ikke nok plass"
+
+#: globals.h:1280
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: Ingen registrert tjener kalt \"%s\""
+
+#: globals.h:1282
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Kan ikke opprette filen %s"
+
+#: globals.h:1283
+msgid "E483: Can't get temp file name"
+msgstr "E483: Kan ikke hente navn på midlertidig fil"
+
+#: globals.h:1284
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Kan ikke åpne filen %s"
+
+#: globals.h:1285
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Kan ikke lese filen %s"
+
+#: globals.h:1286
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Ikke lagret siden forrige forandring (legg til ! for å overstyre)"
+
+#: globals.h:1287
+msgid "E38: Null argument"
+msgstr "E38: Nullparameter"
+
+#: globals.h:1289
+msgid "E39: Number expected"
+msgstr "E39: Nummer forventet"
+
+#: globals.h:1292
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Kan ikke åpne feilfilen %s"
+
+#: globals.h:1295
+msgid "E233: cannot open display"
+msgstr "E233: Kan ikke åpne display"
+
+#: globals.h:1297
+msgid "E41: Out of memory!"
+msgstr "E41: Ikke mer ledig hukommelse!"
+
+#: globals.h:1299
+msgid "Pattern not found"
+msgstr "Fant ikke søketeksten"
+
+#: globals.h:1301
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Fant ikke søketeksten: %s"
+
+#: globals.h:1302
+msgid "E487: Argument must be positive"
+msgstr "E487: Parameteret må være positivt"
+
+#: globals.h:1304
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Kan ikke gå tilbake til tidligere katalog"
+
+#: globals.h:1308
+msgid "E42: No Errors"
+msgstr "E42: Ingen feil"
+
+#: globals.h:1310
+msgid "E43: Damaged match string"
+msgstr "E43: Ødelagt søkestreng"
+
+#: globals.h:1311
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Skadet program med regulært uttrykk"
+
+#: globals.h:1312
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 'readonly'-valget er satt (legg til ! for å overstyre)"
+
+#: globals.h:1314
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Kan ikke sette skrivebeskyttet variabel \"%s\""
+
+#: globals.h:1317
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Feil under lesing av feilfilen"
+
+#: globals.h:1320
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Ikke tillatt i sandkassen"
+
+#: globals.h:1322
+msgid "E523: Not allowed here"
+msgstr "E523: Ikke tillatt her"
+
+#: globals.h:1325
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Forandring av skjermmodus er ikke støttet"
+
+#: globals.h:1327
+msgid "E49: Invalid scroll size"
+msgstr "E49: Ugyldig \"scroll\"-verdi"
+
+#: globals.h:1328
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell'-valget er tomt"
+
+#: globals.h:1330
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Kunne ikke lese inn skiltdata!"
+
+#: globals.h:1332
+msgid "E72: Close error on swap file"
+msgstr "E72: Feil under lukking av swapfil"
+
+#: globals.h:1333
+msgid "E73: tag stack empty"
+msgstr "E73: Tag-stack tom"
+
+#: globals.h:1334
+msgid "E74: Command too complex"
+msgstr "E74: Kommandoen er for kompleks"
+
+#: globals.h:1335
+msgid "E75: Name too long"
+msgstr "E75: Navnet er for langt"
+
+#: globals.h:1336
+msgid "E76: Too many ["
+msgstr "E76: For mange ["
+
+#: globals.h:1337
+msgid "E77: Too many file names"
+msgstr "E77: For mange filnavn"
+
+#: globals.h:1338
+msgid "E488: Trailing characters"
+msgstr "E488: Etterfølgende tegn"
+
+#: globals.h:1339
+msgid "E78: Unknown mark"
+msgstr "E78: Ukjent merke"
+
+#: globals.h:1340
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Klarte ikke utvide jokertegn"
+
+#: globals.h:1342
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' kan ikke være mindre enn 'winminheight'"
+
+#: globals.h:1344
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' kan ikke være mindre enn 'winminwidth'"
+
+#: globals.h:1347
+msgid "E80: Error while writing"
+msgstr "E80: Feil under skriving"
+
+#: globals.h:1348
+msgid "Zero count"
+msgstr "Antall repeteringer er null"
+
+#: globals.h:1350
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Bruker <SID> utenom skript-kontekst"
+
+#: globals.h:1353
+msgid "E449: Invalid expression received"
+msgstr "E449: Ugyldig uttrykk mottatt"
+
+#: globals.h:1356
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Regionen er beskyttet og kan ikke modifiseres"
diff --git a/src/po/pl.cp1250.po b/src/po/pl.cp1250.po
new file mode 100644
index 000000000..f569ae6bb
--- /dev/null
+++ b/src/po/pl.cp1250.po
@@ -0,0 +1,6576 @@
+# translation of pl.po to Polish
+# Polish Translation for Vim
+#
+# updated 2001 for vim-6.0
+# FIRST AUTHOR Marcin Dalecki <dalecki@cyber.cs.net.pl>, 2000.
+# Mikolaj Machowski <mikmach@wp.pl>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: pl\n"
+"POT-Creation-Date: 2004-05-23 21:41+0200\n"
+"PO-Revision-Date: 2004-05-23 22:00+0200\n"
+"Last-Translator: Mikolaj Machowski <mikmach@wp.pl>\n"
+"Language-Team: Polish <pl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp1250\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nie mogê zarezerwowaæ bufora; zakoñczenie..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nie mogê zarezerwowaæ bufora; u¿ywam innego..."
+
+#: buffer.c:805
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Nie wy³adowano ¿adnego bufora"
+
+#: buffer.c:807
+msgid "E516: No buffers were deleted"
+msgstr "E516: Nie skasowano ¿adnego bufora"
+
+#: buffer.c:809
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Nie wyrzucono ¿adnego bufora"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "1 bufor wy³adowany"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "wy³adowano %d buforów"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "1 bufor skasowany"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buforów skasowano"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "wyrzucono 1 bufor "
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "wyrzucono %d buforów"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: Nie znaleziono zmienionych buforów"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: Nie ma wylistowanych buforów"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Bufor \"%ld\" nie istnieje"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Nie mogê przejœæ poza ostatni bufor"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Nie mogê przejœæ przed pierwszy bufor"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89 Nie zapisano zmian w buforze %ld (wymuœ przez !)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Nie mogê wy³adowaæ ostatniego bufora"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: OSTRZE¯ENIE: Przepe³nienie listy nazw plików"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Nie znaleziono bufora %ld"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Wielokrotne dopasowania dla %s"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: ¯aden bufor nie pasuje do %s"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "wiersz %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Bufor o tej nazwie ju¿ istnieje"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [Zmieniony]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[Nie edytowany]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[Nowy Plik]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[B³¹d odczytu]"
+
+#: buffer.c:2726 fileio.c:2112
+msgid "[readonly]"
+msgstr "[tylko odczyt]"
+
+#: buffer.c:2747
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 wiersz --%d%%--"
+
+#: buffer.c:2749
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld wiersze --%d%%--"
+
+#: buffer.c:2756
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "wiersz %ld z %ld --%d%%-- kol "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[Brak pliku]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "pomoc"
+
+#: buffer.c:3463 screen.c:5075
+msgid "[help]"
+msgstr "[pomoc]"
+
+#: buffer.c:3495 screen.c:5081
+msgid "[Preview]"
+msgstr "[Podgl¹d]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "Wszystko"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "Dó³"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "Góra"
+
+#: buffer.c:4523
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Lista buforów:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[Lista B³êdów]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[Brak Pliku]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaki ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaki dla %s:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " wiersz=%ld id=%d nazwa=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nie mogê zró¿nicowaæ wiêcej ni¿ %ld buforów"
+
+#: diff.c:709
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nie mogê stworzyæ ró¿nic"
+
+#: diff.c:814
+msgid "Patch file"
+msgstr "Plik ³ata"
+
+#: diff.c:1065
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nie mogê wczytaæ wyjœcia ró¿nicy"
+
+#: diff.c:1815
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Bie¿¹cy bufor nie jest w trybie ró¿nic"
+
+#: diff.c:1827
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Brak innego bufora w trybie ró¿nic"
+
+#: diff.c:1835
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Wiêcej ni¿ jeden bufor w trybie ró¿nicowania, nie wiem którego u¿yæ"
+
+#: diff.c:1858
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nie mogê znaleŸæ bufora \"%s\""
+
+#: diff.c:1864
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Bufor \"%s\" nie jest w trybie ró¿nicowania"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Escape jest niedozwolone w dwugrafie"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: Nie znaleziono pliku rozk³adu klawiszy"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Zastosowano :loadkeymap w niewczytanym pliku"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Dope³nianie s³ów kluczowych (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X tryb (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Lokalne dope³nianie s³ów kluczowych (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Dope³nianie pe³nych wierszy (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Dope³nianie nazw plików (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Dope³nianie znaczników (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Dope³nianie wzorców tropów (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Dope³nianie definicji (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Dope³nianie ze s³owników (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Dope³nianie z tezaurusa (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Dope³nianie wiersza poleceñ (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Dobi³em do koñca akapitu"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "opcja 'thesaurus' jest pusta"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "opcja 'dictionary' jest pusta"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Przegl¹dam s³ownik: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (wprowadzanie) Przewijanie (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (zamiana) Przewijanie (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Przegl¹dam: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "Przegl¹dam znaczniki."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " Dodajê"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Szukam..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Z powrotem na pierwotnym"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Wyraz z innego wiersza"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "Jedyne dopasowanie"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "pasuje %d z %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "pasuje %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Nieznana zmienna: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Brak nawiasów: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Nie istnieje zmienna: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Brak ':' po '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Brak ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Brak ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Brak nazwy opcji: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Nieznana opcja: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Brak cudzys³owu: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Brak cudzys³owu: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Niew³aœciwe argumenty dla funkcji %s"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Nieznana funkcja: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Zbyt wiele argumentów dla funkcji: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Za ma³o argumentów dla funkcji: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Zastosowano <SID> poza skryptem: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4376 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld wierszy: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Zakoñcz"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "wywo³ano inputrestore() wiêcej razy ni¿ inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: Za du¿o dowi¹zañ symbolicznych (pêtla?)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Brak po³¹czenia z serwerem Vim"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Nie mogê czytaæ odpowiedzi serwera"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: Nie mogê wys³aæ do klienta"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nie mogê wys³aæ do %s"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(Niew³aœciwe)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nieokreœlona zmienna: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E418: Niedozwolona nazwa zmiennej: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: Funkcja %s ju¿ istnieje; aby j¹ zamieniæ u¿yj !"
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nieokreœlona funkcja: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Brak '(': %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Niedozwolony argument: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: Brak :endfunction"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nie mogê przedefiniowaæ funkcji %s: jest w u¿yciu"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: Wymagana jest nazwa funkcji"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Nazwa funkcji musi rozpoczynaæ siê du¿¹ liter¹: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nieokreœlona funkcja: %s"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nie mogê skasowaæ funkcji %s: jest w u¿yciu"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zagnie¿d¿enie wywo³añ funkcji ponad 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "wywo³ujê %s"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "porzucono %s"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s zwraca #%ld"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s zwraca \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "kontynuacja w %s"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: :return poza funkcj¹"
+
+#: eval.c:9952
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# zmienne globalne:\n"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Wchodzê w tryb odpluskwiania. WprowadŸ \"cont\" aby kontynuowaæ."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "wiersz %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Punkt kontrolny w \"%s%s\" wiersz %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Nie znaleziono punktu kontrolnego: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Nie okreœlono ¿adnych punktów kontrolnych"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s wiersz %ld"
+
+#: ex_cmds2.c:763 ex_cmds.c:2097 ex_cmds.c:2362
+msgid "Save As"
+msgstr "Zapisz jako"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Zachowaj zmiany w \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9380
+msgid "Untitled"
+msgstr "Bez Tytu³u"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Nie zapisano zmian w buforze \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "OSTRZE¯ENIE: Nieoczekiwane wejœcie w inny bufor (sprawdŸ autokomendy)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Tylko jeden plik w edycji"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Nie mo¿na przejœæ przed pierwszy plik"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Nie mo¿na przejœæ za ostatni plik"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: nie wspierany kompilator: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Szukanie \"%s\" w \"%s\""
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Szukanie \"%s\""
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "nie znaleziono w 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "Wczytaj skrypt Vima"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Nie mo¿na wczytaæ katalogu: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nie mog³em wczytaæ \"%s\""
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "wiersz: %ld nie mog³em wczytaæ \"%s\""
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "wczytywanie \"%s\""
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "wiersz %ld: wczytywanie \"%s\""
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "skoñczono wczytywanie %s"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: OSTRZE¯ENIE: Niew³aœciwy separator wierszy, pewnie brak ^M"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: u¿yto :scriptencoding poza wczytywanym plikiem"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: u¿yto :finish poza wczytywanym plikiem"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "Strona %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "Brak tekstu do drukowania"
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Drukujê stronê %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopia %d z %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "Wydrukowano: %s"
+
+#: ex_cmds2.c:3549
+msgid "Printing aborted"
+msgstr "Drukowanie odwo³ane"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nie mo¿na zapisaæ do wyjœciowego pliku PostScriptu"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Nie mogê otworzyæ pliku \"%s\""
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nie mo¿na odczytaæ pliku zasobów PostScriptu \"%s\""
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: plik \"%s\" nie jest plikiem zasobów PostScriptu"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: plik \"%s\" nie jest wspieranym plikiem zasobów PostScriptu"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: \"%s\" nieprawid³owa wersja pliku zasobów"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nie mo¿na otworzyæ pliku PostScript do wyjœcia"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nie mogê otworzyæ pliku \"%s\""
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Nie mo¿na znaleŸæ pliku zasobów PostScriptu \"prolog.ps\""
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Nie mo¿na znaleŸæ pliku zasobów PostScriptu \"%s.ps\""
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: Nie mo¿na przekonwertowaæ z multi-byte do kodowania \"%s\""
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "Przesy³am do drukarki..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Drukowanie pliku PostScript nie powiod³o siê"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "Zadanie drukowanie przes³ane."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Bie¿¹cy %sjêzyk: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nie mogê ustawiæ jêzyka na \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Oktal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Oktal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Przeniesienie wierszy na siebie samych"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 wiersz przeniesiony"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld wiersze przeniesione"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld wierszy przefiltrowanych"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Autokomendy *Filter* nie mog¹ zmieniaæ bie¿¹cego bufora"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Brak zapisu od czasu ostatniej zmiany]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s w wierszu: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Zbyt wiele b³êdów; pomijam resztê pliku"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Wczytujê plik viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " informacja"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " zak³adki"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " NIE POWIOD£O SIÊ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Plik viminfo jest niezapisywalny: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nie mogê zapisaæ pliku viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Zapisujê plik viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Ten plik viminfo zosta³ wygenerowany przez Vima %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Mo¿esz go ostro¿nie edytowaæ!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# WartoϾ 'encoding' w czasie zapsu tego pliku\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Niedopuszczalny pocz¹tkowy znak"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Plik jest za³adowany w innym buforze"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Zapisaæ czêœciowo plik?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Stosuj ! do zapisania czêœciowo bufora"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Nadpisaæ istniej¹cy plik \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Brak nazwy pliku dla bufora %ld"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Plik niezapisany: Zapis jest wy³¹czony opcj¹ 'write'"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"opcja 'readonly' nastawiona dla \"%.*s\".\n"
+"Czy chcesz go pomimo tego zapisaæ?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "Edytuj Plik"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autokomendy nieoczekiwanie skasowa³y nowy bufor %s"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: nienumeryczny argument dla :z"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Komendy pow³oki s¹ niedozwolone w rvim"
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Wzorce regularne nie mog¹ byæ rozgraniczane literami"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "zamieñ na %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4266
+msgid "(Interrupted) "
+msgstr "(Przerwane) "
+
+#: ex_cmds.c:4270
+msgid "1 substitution"
+msgstr "1 podstawienie "
+
+#: ex_cmds.c:4272
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld podstawieñ"
+
+#: ex_cmds.c:4275
+msgid " on 1 line"
+msgstr " w 1 wierszu"
+
+#: ex_cmds.c:4277
+#, c-format
+msgid " on %ld lines"
+msgstr " w %ld wierszach"
+
+#: ex_cmds.c:4328
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Nie mogê wykonaæ :global rekursywnie"
+
+#: ex_cmds.c:4363
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Brak wzorca regularnego w :global"
+
+# c-format
+#: ex_cmds.c:4412
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Wzorzec znaleziono w ka¿dym wierszu: %s"
+
+#: ex_cmds.c:4493
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ostatni podstawiany ci¹g:\n"
+"$"
+
+#: ex_cmds.c:4594 ex_docmd.c:2011
+msgid "E478: Don't panic!"
+msgstr "E478: Nie panikuj!"
+
+#: ex_cmds.c:4646
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Przykro mi, brak '%s' pomocy dla %s"
+
+#: ex_cmds.c:4649
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Przykro mi, ale brak pomocy o %s"
+
+#: ex_cmds.c:4683
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Przykro mi, nie ma pliku pomocy \"%s\""
+
+#: ex_cmds.c:5166
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: Nie jest katalogiem: %s"
+
+#: ex_cmds.c:5305
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nie mogê otworzyæ %s do zapisu"
+
+#: ex_cmds.c:5341
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nie mogê otworzyæ %s do odczytu"
+
+#: ex_cmds.c:5363
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: Mieszanka kodowañ w pliku pomocy w ramach jêzyka: %s"
+
+#: ex_cmds.c:5441
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Dwukrotny znacznik \"%s\" w pliku %s"
+
+#: ex_cmds.c:5553
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Nieznana komenda znaku: %s"
+
+#: ex_cmds.c:5573
+msgid "E156: Missing sign name"
+msgstr "E156: Brak nazwy znaku"
+
+#: ex_cmds.c:5619
+msgid "E612: Too many signs defined"
+msgstr "E255: Zbyt wiele nazw znaków"
+
+#: ex_cmds.c:5687
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Niew³aœciwy tekst znaku: %s"
+
+#: ex_cmds.c:5718 ex_cmds.c:5909
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Nieznany znak: %s"
+
+#: ex_cmds.c:5767
+msgid "E159: Missing sign number"
+msgstr "E159: Brak numeru znaku"
+
+#: ex_cmds.c:5849
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Niew³aœciwa nazwa bufora: %s"
+
+#: ex_cmds.c:5888
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Niew³aœciwe ID znaku: %ld"
+
+#: ex_cmds.c:5958
+msgid " (NOT FOUND)"
+msgstr " (NIE ZNALEZIONO)"
+
+#: ex_cmds.c:5960
+msgid " (not supported)"
+msgstr "(nie wspomagane)"
+
+#: ex_cmds.c:6059
+msgid "[Deleted]"
+msgstr "[Skasowano]"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Wchodzê w tryb Ex. WprowadŸ \"visual\" aby przejœæ do trybu Normal."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Na koñcu pliku"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: Komenda zbyt rekursywna"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Nie znaleziono wyj¹tku: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "Koniec wczytywanego pliku"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "Koniec funkcji"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Niejednoznaczne zastosowanie komendy zdefiniowanej przez u¿ytkownika"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: Nie jest komend¹ edytora"
+
+#: ex_docmd.c:2030
+msgid "E493: Backwards range given"
+msgstr "E493: Dano wsteczny zakres"
+
+#: ex_docmd.c:2039
+msgid "Backwards range given, OK to swap"
+msgstr "Dano wsteczny zakres; zamiana jest mo¿liwa"
+
+#: ex_docmd.c:2162
+msgid "E494: Use w or w>>"
+msgstr "E494: Stosuj w lub w>>"
+
+#: ex_docmd.c:3788
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Przykro mi, ale ta komenda nie jest dostêpna w tej wersji"
+
+#: ex_docmd.c:3991
+msgid "E172: Only one file name allowed"
+msgstr "E172: Tylko pojedyncza nazwa pliku dozwolona"
+
+#: ex_docmd.c:4571
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 wiêcej plik do edycji. Mimo to wyjœæ?"
+
+#: ex_docmd.c:4574
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "jeszcze %d plików do edycji. Mimo to wyjœæ?"
+
+#: ex_docmd.c:4581
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 wiêcej plik do edycji"
+
+#: ex_docmd.c:4583
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: jeszcze %ld plików do edycji"
+
+#: ex_docmd.c:4678
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Komenda ju¿ istnieje; aby j¹ przedefiniowaæ stosuj !"
+
+#: ex_docmd.c:4789
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Nazwa Arg. Zak. GotowoϾ Definicja"
+
+#: ex_docmd.c:4878
+msgid "No user-defined commands found"
+msgstr "Nie znaleziono komend zdefiniowanych przez u¿ytkownika"
+
+#: ex_docmd.c:4910
+msgid "E175: No attribute specified"
+msgstr "E175: Nie okreœlono atrybutu"
+
+#: ex_docmd.c:4962
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Niew³aœciwa iloœæ argumentów"
+
+#: ex_docmd.c:4977
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Mno¿nik nie mo¿e byæ podany dwukrotnie"
+
+#: ex_docmd.c:4987
+msgid "E178: Invalid default value for count"
+msgstr "E178: Niew³aœciwa domyœlna wartoœæ mno¿nika"
+
+#: ex_docmd.c:5018
+msgid "E179: argument required for complete"
+msgstr "E179: argument wymagany do dope³niania"
+
+#: ex_docmd.c:5050
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Niew³aœciwa wartoœæ dope³niania: %s"
+
+#: ex_docmd.c:5059
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Argument depe³niania dozwolony wy³¹cznie dla dope³niania u¿ytkownika"
+
+#: ex_docmd.c:5065
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Dope³nianie u¿ytkownika wymaga funkcji jako argumentu"
+
+#: ex_docmd.c:5076
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Niew³aœciwy atrybut: %s"
+
+#: ex_docmd.c:5119
+msgid "E182: Invalid command name"
+msgstr "E182: Niew³aœciwa nazwa komendy"
+
+#: ex_docmd.c:5134
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr ""
+"E183: Komendy zdefiniowane przez u¿ytkownika musz¹ rozpoczynaæ siê du¿¹ "
+"liter¹"
+
+#: ex_docmd.c:5205
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Nie ma takiej komendy u¿ytkownika: %s"
+
+#: ex_docmd.c:5666
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Nie mogê znaleŸæ zestawu kolorów %s"
+
+#: ex_docmd.c:5674
+msgid "Greetings, Vim user!"
+msgstr "Witaj u¿ytkowniku Vima!"
+
+#: ex_docmd.c:6391
+msgid "Edit File in new window"
+msgstr "Edytuj plik w nowym oknie"
+
+#: ex_docmd.c:6686
+msgid "No swap file"
+msgstr "Brak pliku wymiany"
+
+#: ex_docmd.c:6790
+msgid "Append File"
+msgstr "Do³¹cz plik"
+
+#: ex_docmd.c:6854
+msgid "E186: No previous directory"
+msgstr "E186: Nie ma poprzedniego katalogu"
+
+#: ex_docmd.c:6936
+msgid "E187: Unknown"
+msgstr "E187: Nieznany"
+
+#: ex_docmd.c:7021
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize wymaga dwóch argumentów numerycznych"
+
+#: ex_docmd.c:7077
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Pozycja okna: X %d, Y %d"
+
+#: ex_docmd.c:7082
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Pozyskiwanie pozycji okna nie jest zaimplementowane dla tego systemu"
+
+#: ex_docmd.c:7092
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos wymaga dwóch argumentów numerycznych"
+
+#: ex_docmd.c:7370
+msgid "Save Redirection"
+msgstr "Zapisz przekierowanie"
+
+#: ex_docmd.c:7560
+msgid "Save View"
+msgstr "Zapisz widok"
+
+#: ex_docmd.c:7561
+msgid "Save Session"
+msgstr "Zapisz sesjê"
+
+#: ex_docmd.c:7563
+msgid "Save Setup"
+msgstr "Zapisz ustawienia"
+
+#: ex_docmd.c:7715
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" istnieje (wymuœ poprzez !)"
+
+#: ex_docmd.c:7720
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nie mogê otworzyæ \"%s\" do zapisu"
+
+#. set mark
+#: ex_docmd.c:7744
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argument musi byæ liter¹ albo cudzys³owem w przód/ty³"
+
+#: ex_docmd.c:7786
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursywne zastosowanie :normal za g³êbokie"
+
+#: ex_docmd.c:8304
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Brak nazwy zamiennego pliku do podstawienia pod '#'"
+
+#: ex_docmd.c:8335
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: brak nazwy pliku autokomend do podstawienia pod \"<afile>\""
+
+#: ex_docmd.c:8343
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: brak numeru bufora autokomend do podstawienia pod \"<abuf>\""
+
+#: ex_docmd.c:8354
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: brak nazwy dopasowania autokomend pod \"<amatch>\""
+
+#: ex_docmd.c:8364
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: brak nazwy pliku :source do postawienia pod \"<sfile>\""
+
+#: ex_docmd.c:8405
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Pusta nazwa pliku dla '%' lub '#', dzia³a tylko z \":p:h\""
+
+#: ex_docmd.c:8407
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Wynikiem jest pusty ci¹g"
+
+#: ex_docmd.c:9362
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nie mogê otworzyæ pliku viminfo do odczytu"
+
+#: ex_docmd.c:9535
+msgid "E196: No digraphs in this version"
+msgstr "E196: Brak dwugrafów w tej wersji"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Nie mo¿na ':throw' wyj¹tków z prefiksem 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Wyj¹tek: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Wyj¹tek zakoñczony: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Wyj¹tek odrzucony: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, wiersz %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Wyj¹tek przechwycony: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s zosta³ zawieszony"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s przywrócony"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s odrzucony"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Wyj¹tek"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "B³¹d i przerwanie"
+
+#: ex_eval.c:754 gui.c:4375
+msgid "Error"
+msgstr "B³¹d"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Przerwanie"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: zbyt g³êbokie zagnie¿d¿enie :if"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif bez :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else bez :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif bez :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: wielokrotne :else"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif po :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: zbyt g³êbokie zagnie¿d¿enie :while"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue bez :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break bez :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: zbyt g³êbokie zagnie¿d¿enie :try"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch bez :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch za :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally bez :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: wielokrotne :finally"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry bez :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction poza funkcj¹"
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "nazwa znacznika"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " pokrewny plik\n"
+
+#: ex_getln.c:4752
+msgid "'history' option is zero"
+msgstr "opcja 'history' jest zerowa"
+
+#: ex_getln.c:5023
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Historia (od najnowszych po najstarsze):\n"
+
+#: ex_getln.c:5024
+msgid "Command Line"
+msgstr "Wiersz poleceñ"
+
+#: ex_getln.c:5025
+msgid "Search String"
+msgstr "Szukany ci¹g"
+
+#: ex_getln.c:5026
+msgid "Expression"
+msgstr "Wyra¿enie"
+
+#: ex_getln.c:5027
+msgid "Input Line"
+msgstr "Wiersz wprowadzeñ"
+
+#: ex_getln.c:5065
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar przekracza d³ugoœæ polecenia"
+
+#: ex_getln.c:5242
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktywny widok lub bufor skasowany"
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "Niedopuszczalna nazwa pliku"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "jest katalogiem"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "nie jest plikiem"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[Nowy Plik]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[Nie dozwolono]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Autokomendy *ReadPre zrobi³y plik nieodczytywalnym"
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Autokomendy *ReadPre nie mog¹ zmieniaæ bie¿¹cego bufora"
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Wczytywanie ze stdin...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "Wczytywanie ze stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Plik stworzony poprzez przemianê jest nieodczytywalny!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[brak CR]'"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[znaleziono NL]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[d³ugie wiersze rozdzielane]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[NIE przemienione]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[przemienione]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[zakodowane]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[B£¥D W PRZEMIANIE]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[NIEDOZWOLONY BAJT w wierszu %ld]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[B£ÊDY W ODCZYCIE]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "Nie mogê znaleŸæ pliku tymczasowego w celu przemiany"
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "Nieudana przemiana z 'charconvert'"
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "nie mogê odczytaæ wyjœcia z 'charconvert'"
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autokomendy skasowa³y lub wy³adowa³y bufor przeznaczony do zapisu"
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autokomenda zmieni³a liczbê wierszy w nieoczekiwany sposób"
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans nie pozwala na zapis niezmodyfikowanych buforów"
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "Czêœciowy zapis niemo¿liwy dla buforów NetBeans"
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "nie jest plikiem lub zapisywalnym przyrz¹dem"
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "jest tylko do odczytu (wymuœ poprzez !)"
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Nie mogê zapisaæ do pliku zabezpieczenia (wymuœ przez !)"
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: B³¹d podczas zamykania pliku zabezpieczenia (wymuœ przez !)"
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: Nie mogê odczytaæ pliku w celu zabezpieczenia (wymuœ przez !)"
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Nie mogê stworzyæ pliku zabezpieczenia (wymuœ przez !)"
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Nie mogê zrobiæ pliku zabezpieczenia (wymuœ przez !)"
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Rozdzia³ zasobów zostanie utracony (wymuœ przez !)"
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nie mogê znaleŸæ pliku tymczasowego do zapisania"
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: Nie mogê przemieniæ (u¿yj ! by zapisaæ bez przemiany)"
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Nie mogê otworzyæ pod³¹czonego pliku do zapisu"
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: Nie mogê otworzyæ pliku do zapisu"
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: Fsync nie powiód³ siê"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E512: Zamkniêcie siê nie powiod³o"
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: b³¹d w zapisie, przemiana siê nie powiod³a"
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: b³¹d w zapisie (mo¿e system plików jest przepe³niony?)"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr " B£¥D W PRZEMIANIE"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[Urz¹dzenie]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[Nowy]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " do³¹czono"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " zapisano"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patchmode: nie mogê zapisaæ oryginalnego pliku"
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nie mogê stworzyæ pustego oryginalnego pliku"
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nie mogê skasowaæ pliku zabezpieczenia"
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"OSTRZE¯ENIE: Oryginalny plik mo¿e zostaæ utracony lub uszkodzony\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "nie wychodŸ edytora, dopóki plik nie zosta³ poprawnie zapisany!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[format dos-a]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[format mac-a]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[format unix-a]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 wiersz, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld wierszy, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znaków"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[Niekompletny ostatni wiersz]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "OSTRZE¯ENIE: Plik zmieni³ siê od czasu ostatniego odczytu!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "Czy naprawdê chcesz go zapisaæ"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: B³¹d zapisywania do \"%s\""
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: B³¹d w trakcie zamykania \"%s\""
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: B³¹d odczytu \"%s\""
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: Autokomenda FileChangedShell skasowa³a bufor"
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: OSTRZE¯ENIE: Plik \"%s\" nie jest d³u¿ej dostêpny"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: OSTRZE¯ENIE: Plik \"%s\" zmieni³ siê od czasu rozpoczêcia edycji, bufor "
+"w Vimie równie¿ zosta³ zmieniony"
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: OSTRZE¯ENIE: Plik \"%s\" zmieni³ siê od czasu rozpoczêcia edycji"
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: OSTRZE¯ENIE: Tryb pliku \"%s\" zmieni³ siê od czasu rozpoczêcia edycji"
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: OSTRZE¯ENIE: Plik \"%s\" zosta³ stworzony po rozpoczêciu edycji"
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "Patrz \":help W11\" dla dalszych informacji."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "OSTRZE¯ENIE"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Za³aduj Plik"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Nie mo¿na przygotowaæ prze³adowania \"%s\""
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Nie mo¿na prze³adowaæ \"%s\""
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--Skasowano--"
+
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Nie ma takiej grupy: \"%s\""
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Niedopuszczalny znak po *: %s"
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Nie ma takiego wydarzenia: %s"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: Nie ma takiej grupy lub wydarzenia: %s"
+
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Autokomendy ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Nie mo¿na wykonywaæ autokomend dla wydarzeñ ALL"
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "Brak pasuj¹cych autokomend"
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: zbyt g³êbokie zagnie¿d¿enie autokomend"
+
+#: fileio.c:8088
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Autokomend dla \"%s\""
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "Wykonujê %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "autokomenda %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: Brak {."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: Brak }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Nie znaleziono zwiniêcia"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Nie mo¿na utworzyæ zwiniêcia przy bie¿¹cej 'foldmethod'"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Nie mo¿na skasowaæ zwiniêcia przy bie¿¹cej 'foldmethod'"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Dodaj do bufora odczytu"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: rekursywne przyporz¹dkowanie"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: istnieje ju¿ globalny skrót dla %s"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: istnieje ju¿ globalne przyporz¹dkowanie dla %s"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: istnieje ju¿ skrót dla %s"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: istnieje ju¿ przyporz¹dkowanie dla %s"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "Nie znaleziono skrótu"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "Nie znaleziono przyporz¹dkowania"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Niedopuszczalny tryb"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<nie mogê otworzyæ> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: nie mogê otrzymaæ czcionki %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: nie mogê powróciæ do bie¿¹cego katalogu"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Trop:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: nie mogê otrzymaæ bie¿¹cego katalogu"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Zakoñcz"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "VIM - Dialog"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: Nie mog³em otrzymaæ rozmiarów rysunku na przycisku."
+
+#: gui_beval.c:101 gui_w32.c:3830
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Nie mogê stworzyæ BalloonEval z powiadomieniem i wywo³aniem"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nie mogê odpaliæ GUI"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nie mogê czytaæ z \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: Nie mo¿na uruchomiæ GUI, brak prawid³owej czcionki"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: Niew³aœciwe 'guifontwide'"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: Nieprawid³owa wartoœæ 'imactivatekey'"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Nie mogê zarezerwowaæ koloru %s"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Dialog Vima..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Tak\n"
+"&Nie\n"
+"&Zakoñcz"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "Input _Methods"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Szukaj i Zamieniaj..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Szukaj..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "ZnajdŸ:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Zamieñ na:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Dopasuj tylko ca³e wyrazy"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Dopasuj wielkoϾ liter"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Kierunek"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "W górê"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "W dó³"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "ZnajdŸ nastêpne"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Zamieñ"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Zamieñ wszystkie"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: otrzymano ¿¹danie \"die\" od manad¿era sesji\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: G³ówne okno nieoczekiwanie zniszczone\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Wybór czcionki"
+
+#: gui_gtk_x11.c:6035 ui.c:2117
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "U¿ywam CUT_BUFFER0 zamiast pustego wyboru"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtr"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Katalogi"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Pomoc"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Pliki"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Wybór"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Cofnij"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Nie mogê za³adowaæ czcionki Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Nie mogê u¿yæ czcionki %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Wysy³am zawiadomienie koñcz¹ce proces pochodny.\n"
+
+#: gui_w32.c:830
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument nie jest wspomagany: \"-%s\"; U¿ywaj wersji OLE."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "ZnajdŸ ci¹g (u¿yj '\\\\' do szukania '\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Szukanie i Zamiana (u¿yj '\\\\' do szukania '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Nie mogê zarezerwowaæ mapy kolorów, pewne kolory mog¹ byæ "
+"nieprawid³owe"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Brak czcionek dla nastêpuj¹cych zestawów znaków w zestawie czcionek %s:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nazwa zestawu czcionek: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Czcionka '%s' nie posiada znaków jednolitej szerokoœci"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nazwa zestawu czcionek: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "szerokoœæ font%d nie jest podwójn¹ szerokoœci¹ font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "SzerokoϾ font0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"SzerokoϾ font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: B£¥D w automacie Hangul"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Dodaj now¹ bazê danych"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Zapytane o wzorzec"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Poka¿ ten komunikat"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Zabij po³¹czenie"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Ponów wszelkie po³¹czenia"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Poka¿ po³¹czenia"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Zastosowanie: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Ta komenda cscope nie wspomaga podzielenia okna.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Zastosowanie: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: nie znaleziono znacznika"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) b³¹d: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: b³¹d stat"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s nie jest katalogiem lub poprawn¹ baz¹ danych cscope"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Dodano bazê danych cscope %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: b³¹d odczytu po³¹czenia z cscope %ld"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: nieznany typ szukania cscope"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Nie mog³em stworzyæ potoku do cscope"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Nie mog³em utworzyæ rozwidlenia dla cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "wykonanie cs_create_connection nie powiod³o siê"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Nie mog³em stworzyæ procesu cscope"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen dla to_fp nie powiod³o siê"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen dla fr_fp nie powiod³o siê"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: brak po³¹czenia z cscope"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: brak dopasowañ dla zapytania cscope %s o %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: nieprawid³owa flaga cscopequickfix %c dla %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "komendy cscope:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (U¿ycie: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: nie mogê otworzyæ bazy danych cscope: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: nie mogê uzyskaæ informacji z bazy danych cscope"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: nie dodano duplikatu bazy danych cscope"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: wyczerpano maksymaln¹ liczbê po³¹czeñ cscope"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: nie ma po³¹czenia %s z cscope"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "po³¹czenie %s z cscope zosta³o zamkniête"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: b³¹d krytyczny w cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Znacznik cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # wiersz"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "nazwa pliku / kontekst / wiersz\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: B³¹d cscope: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Wszystkie bazy danych cscope prze³adowano"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "brak po³¹czeñ z cscope\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid nazwa bazy danych przedsionek tropu\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Przykro mi, ta komenda jest wy³¹czona, bo nie mo¿na za³adowaæ "
+"biblioteki Pythona"
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Nie mo¿na wywo³aæ Pythona rekursywnie"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "nie mogê skasowaæ atrybutów OutputObject"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace musi byæ liczb¹ ca³kowit¹"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "niepoprawny atrybut"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() wymaga listy ci¹gów"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: B³¹d w inicjalizacji obiektów I/O"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "niepoprawne wyra¿enie"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "wyra¿enia wy³¹czone podczas kompilacji"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "próba odniesienia do skasowanego bufora"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "numer wiersza poza zakresem"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<obiekt bufora (skasowany) w %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "niepoprawna nazwa zak³adki"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "nie ma takiego bufora"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "próba odniesienia do skasowanego okna"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "atrybut tylko do odczytu"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "pozycja kursora poza buforem"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<obiekt okna (skasowany) w %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<obiekt okna (nieznany) w %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "nie ma takiego okna"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "nie mogê zachowaæ informacji cofania"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "nie mogê skasowaæ wiersza"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "nie mogê zamieniæ wiersza"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "nie mogê wprowadziæ wiersza"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "ci¹g nie mo¿e zawieraæ znaków nowego wiersza"
+
+#: if_ruby.c:422
+msgid "E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E263: Przykro mi, ta komenda jest wy³¹czona, bo nie mo¿na za³adowaæ "
+"biblioteki Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Nieznany status longjmp %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prze³¹cz miêdzy implementacj¹/okreœleniem"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Poka¿ bazê klasy"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Poka¿ przepisan¹ funkcjê cz³onkow¹"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Pobieraj z pliku"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Pobieraj z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Pobieraj z wszystkich projektów"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Pobierz"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Poka¿ Ÿród³o dla"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "ZnajdŸ symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Przejrzyj klasê"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Poka¿ klasê w hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Poka¿ klasê w ograniczonej hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odnosi siê do"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ma odniesienia od"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ma"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref u¿yte przez"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Poka¿ dokumentacjê dla"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Wygeneruj dokumentacjê dla"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Nie mogê pod³¹czyæ do SNiFF+. SprawdŸ œrodowisko (sniffemacs musi byæ "
+"odnaleziony w $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: B³¹d podczas czytania. Roz³¹czenie"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ jest obecnie "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "nie "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pod³¹czony"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Nieznane zapytanie SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: B³¹d w trakcie pod³¹czania do SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ niepod³¹czony"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Nie jest buforem SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: B³¹d w trakcie zapisu. Roz³¹czony"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "niew³aœciwy numer bufora"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "obecnie nie zaimplementowano"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "nieznana opcja"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "nie mogê ustawiæ wiersza(y)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "zak³adka nie ustawiona"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "wiersz %d kolumna %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "nie mogê wprowadziæ/do³¹czyæ wiersza"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "nieznana flaga: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "nieznane vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "przerwanie klawiatury"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "b³¹d vima"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nie mogê stworzyæ bufora/okna komendy: obiekt jest kasowany"
+
+#: if_tcl.c:1545
+msgid "cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"nie mogê zarejestrowaæ wstecznego wywo³ania komendy: bufor/okno ju¿ zosta³a "
+"skasowana"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATALNY B£¥D: reflist zepsuta!? Proszê z³o¿yæ raport o tym na vim-"
+"dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"nie mogê zarejestrowaæ wstecznego wywo³ania komendy: brak odniesienia do "
+"bufora/okna"
+
+#: if_tcl.c:1724
+msgid "E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "Przykro mi, ta komenda jest wy³¹czona, bo nie mo¿na za³adowaæ biblioteki Tcl."
+
+#: if_tcl.c:1886
+msgid "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: B£¥D TCL: kod zakoñczeniowy nie jest ca³kowity!? Proszê z³o¿yæ raport "
+"o tym na vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "nie mogê dostaæ wiersza"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Nie mogê zarejestrowaæ nazwy serwera komend"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Wys³anie komendy do programu docelowego nie powiod³o siê"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: U¿yto niew³aœciwego id serwera: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: wcielenia instancji rejestru Vima jest Ÿle sformowane. Skasowano!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Nieznana opcja"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Zbyt wiele argumentów"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Brak argumentu po"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Œmiecie po opcji"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "Zbyt wiele argumentów \"+komenda\", \"-c komenda\" lub \"--cmd komenda\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Niew³aœciwy argument dla"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Ta wersja Vima nie by³a skompilowanego z opcj¹ ró¿nic (diff)."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "Próba ponownego otworzenia pliku skryptu: \""
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "Nie mogê otworzyæ do odczytu: \""
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "Nie mogê otworzyæ dla wyjœcia skryptu: \""
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d plików do edycji\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: OSTRZE¯ENIE: Wyjœcie nie jest terminalem\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: OSTRZE¯ENIE: Wejœcie nie pochodzi z terminala\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "linia poleceñ pre-vimrc"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nie mogê czytaæ z \"%s\""
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Dalsze informacje poprzez: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[plik ..] edytuj zadane pliki"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- czytaj tekst ze stdin"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t znacznik edytuj plik, w którym dany znacznik jest zdefiniowany"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] edytuj plik, zawieraj¹cy pierwszy b³¹d"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"u¿ycie:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [argumenty]"
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" lub:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tTylko nazwy plików po tym"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tNie rozwijaj znaków specjalnych"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tZarejestruj tego gvima w OLE"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tWyrejestruj gvima z OLE"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tStartuj w GUI (tak jak \"gvim\")"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f lub --nofork\tPierwszy plan: Nie wydzielaj przy odpalaniu GUI"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tTryb vi (jak \"vi\")"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tTryb ex (jak \"ex\")"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tCichy tryb (t³a) (tylko dla \"ex\")"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tTryb ró¿nic (jak \"vimdiff\")"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tTryb ³atwy (jak \"evim\", bez trybów)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tTryb wy³¹cznie do odczytu (jak \"view\")"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tTryb ograniczenia (jak \"rvim\")"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModyfikacje (zapisywanie plików) niedozwolone"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZakaz modyfikacji tekstu"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tTryb binarny"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tTryb lisp"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tB¹dŸ zgodny z Vi: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tB¹dŸ niezupe³nie zgodny z Vi: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tStopieñ gadatliwoœci"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tTryb odpluskwiania"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tZamiast pliku wymiany, u¿ywaj tylko pamiêci"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tWylicz pliki wymiany i zakoñcz"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (z nazw¹ pliku)\tOdtwórz za³aman¹ sesjê"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tTo¿same z -r"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNie stosuj newcli do otwierania okien"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tU¿ywaj <device> do I/O"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\trozpocznij w trybie arabskim"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\trozpocznij w trybie hebrajskim"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\trozpocznij w trybie farsi"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tUstaw typ terminala na <terminal>"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tU¿yj <vimrc> zamiast jakiegokolwiek .vimrc"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tU¿yj <gvimrc> zamiast jakiegokolwiek .gvimrc"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNie ³aduj skryptów wtyczek"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtwórz N okien (domyœlnie: po jednym dla ka¿dego pliku)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\ttak samo jak -o tylko dziel okno pionowo"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tZacznij na koñcu pliku"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tZacznij w wierszu <lnum>"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr ""
+"-cmd <command>\t\tWykonaj komendê <command> przed za³adowaniem "
+"jakiegokolwiek pliku vimrc"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\tWykonaj komendê <command> po za³adowaniu pierwszego pliku"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <sesja>\t\tWczytaj plik <sesja> po za³adowaniu pierwszego pliku"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\tWczytuj komendy trybu normalnego z pliku <scriptin>"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tDo³¹cz wszystkie wprowadzane komendy do pliku <scriptout>"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tZapisuj wszystkie wprowadzane komendy do pliku <scriptout>"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEdytuj zakodowane pliki"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tPod³¹cz vima to danego X-serwera"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNie ³¹cz z serwerem X"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <pliki>\tEdytuj pliki w serwerze Vima jeœli mo¿liwe"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <pliki> To samo, nie narzekaj jeœli nie ma serwera"
+
+#: main.c:2546
+msgid "--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <pliki>\tTak jak --remote, lecz czekaj na pliki przed edycj¹"
+
+#: main.c:2547
+msgid "--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <pliki> To samo, nie narzekaj jeœli nie ma serwera"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <klawisze>\tWyœlij <klawisze> do serwera Vima i zakoñcz"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <wyr>\tWykonaj <wyra¿enie> w serwerze i wypisz wynik"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tWymieñ nazwy dostêpnych serwerów Vima i zakoñcz"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <nazwa>\t\tOdsy³aj do/stañ siê serwerem Vim <nazwa>"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tU¿ywaj <viminfo> zamiast .viminfo"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h lub --help\twyœwietl Pomoc (czyli tê wiadomoœæ) i zakoñcz"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\twyœwietl informacjê o wersji i zakoñcz"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja Motif):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja neXtaw):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja Athena):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tZa³aduj vim na <display>"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tZacznij Vim jako ikonê"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nazwa>\t\tU¿ywaj zasobów tak jak by Vim by³ <nazwa>"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Niezaimplementowane)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <kolor>\tU¿ywaj <kolor> dla t³a (równie¿: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <kolor>\tU¿ywaj <kolor> dla normalnego tekstu (równie¿: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tU¿ywaj <font> dla normalnego tekstu (równie¿: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tU¿ywaj <font> dla wyt³uszczonego tekstu"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tU¿ywaj <font> dla pochy³ego"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tU¿ywaj <geom> dla pocz¹tkowych rozmiarów (równie¿: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <szer>\tU¿yj ramki o gruboœci <szer> (równie¿: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <szer> U¿ywaj przewijacza o szerokoœci <szer> (równie¿: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tStosuj belkê menu o wysokoœci <height> (równie¿: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tStosuj negatyw kolorów (równie¿: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNie stosuj negatywu kolorów (równie¿: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tUstaw okreœlony zasób"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja RISC OS):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\tPocz¹tkowa szerokoœæ okna w kolumnach"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\tPocz¹tkowa wysokoœæ okna w wierszach"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja GTK+):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tZastartuj vim na <display> (równie¿: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\tUstaw unikatow¹ rolê do identyfikacji g³ównego okna"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtwórz Vim wewn¹trz innego widgetu GTK"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <tytu³ rodzica>\tOtwórz Vima wewn¹trz rodzicielskiej aplikacji"
+
+#: main.c:2847
+msgid "No display"
+msgstr "Brak display"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": Wys³anie nie powiod³o siê.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Wys³anie nie powiod³o siê. Próbujê wykonaæ na miejscu\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "otworzono %d z %d"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "Brak terminala: Wys³anie wyra¿enia nie powiod³o siê.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Wys³anie wyra¿enia nie powiod³o siê.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "Brak zak³adek"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: ¯adna zak³adka nie pasuje do \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"zak³. wiersz kol plik/tekst"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok wiersz kol plik/tekst"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"zmieñ wrsz. kol tekst"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Zak³adki w plikach:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Lista odniesieñ (pocz¹wszy od najnowszych):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historia zak³adek w plikach (od najnowszych po najstarsze):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Brak '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: To nie jest wa¿na strona kodowa"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nie mogê nastawiæ wartoœci IC"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: Nie mog³em stworzyæ kontekstu wprowadzeñ"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Nie mog³em otworzyæ sposobu wprowadzeñ"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: OSTRZE¯ENIE: Nie mog³em zlikwidowaæ wywo³ania dla IM"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: metoda wprowadzeñ nie wspomaga ¿adnego stylu"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: metoda wprowadzeñ nie wspomaga mojego typu preedit"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: styl nadpunktowy wymaga +fontset"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Twój GTK+ jest starszy ni¿ 1.2.3. Pole statusu wy³¹czono"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Serwer metod wprowadzeñ nie jest uruchomiony"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: blok nie by³ zablokowany"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: B³¹d w trakcie czytania pliku wymiany"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: B³¹d odczytu pliku wymiany"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: B³¹d szukania w pliku wymiany"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: B³¹d zapisu w pliku wymiany"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Plik wymiany ju¿ istnieje (atak symlink?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nie otrzyma³em bloku nr 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nie otrzyma³em bloku nr 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Nie otrzyma³em bloku nr 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ojej, zgubi³em plik wymiany!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nie mog³em zmieniæ nazwy pliku wymiany"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nie mogê otworzyæ pliku wymiany dla \"%s\"; odtworzenie niemo¿liwe"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Nie otrzyma³em bloku 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Nie znaleziono pliku wymiany dla %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "WprowadŸ numer pliku wymiany, którego u¿yæ (0 by wyjœæ): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nie mogê otworzyæ %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nie mogê odczytaæ bloku 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Mo¿e nie wykonano zmian albo Vim nie zaktualizowa³ pliku wymiany."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nie mo¿e byæ stosowany z t¹ wersj¹ Vima.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "U¿yj Vima w wersji 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s nie wygl¹da na plik wymiany Vima"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nie mo¿e byæ stosowany na tym komputerze.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Ten plik zosta³ stworzony na "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"lub plik zosta³ uszkodzony."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "U¿ywam pliku wymiany \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Oryginalny plik \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: OSTRZE¯ENIE: Oryginalny plik móg³ byæ zmieniony"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nie mogê odczytaæ bloku 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???BRAKUJE WIELU WIERSZY"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???LICZNIK WIERSZY NIEZGODNY"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PUSTY BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???BRAKUJE WIERSZY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: Niew³aœciwe ID bloku 1 (mo¿e %s nie jest plikiem .swp?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???BRAK BLOKU"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? od tego miejsca po ???KONIEC wiersze mog¹ byæ pomieszane"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? od tego miejsca po ???KONIEC wiersze mog¹ byæ w³o¿one/skasowane"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONIEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Przerwanie odtwarzania"
+
+#: memline.c:1148
+msgid "E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: Wykryto b³êdy podczas odtwarzania; od których wierszy zacz¹æ ???"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "Patrz \":help E312\" dla dalszych informacji."
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Odtwarzanie zakoñczono. Powinieneœ sprawdziæ czy wszystko jest w porz¹dku."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Mo¿esz chcieæ zapisaæ ten plik pod inn¹ nazw¹\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "i wykonaæ diff z oryginalnym plikiem aby sprawdziæ zmiany)\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Skasuj potem plik .swp.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "Znalezione pliki wymiany:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " W bie¿¹cym katalogu:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " U¿ywam podanej nazwy:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " W katalogu "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ¿aden --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " posiadany przez: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " data: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " data: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [po Vimie wersja 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [nie wygl¹da na plik wymiany Vima]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " nazwa pliku: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" zmieniono: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "TAK"
+
+#: memline.c:1525
+msgid "no"
+msgstr "nie"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" u¿ytkownik: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " nazwa hosta: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" nazwa hosta: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (dalej dzia³a)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nie nadaje siê dla tej wersji Vima]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nie do u¿ytku na tym komputerze]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [nieodczytywalny]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [nieotwieralny]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nie mogê zabezpieczyæ, bo brak pliku wymiany"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "Plik zabezpieczono"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: Nieudane zabezpieczenie"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: niew³aœciwy lnum: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nie znaleziono wiersza %ld"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: niepoprawne id wskaŸnika bloku 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "stack_idx powinien byæ 0"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Zaktualizowano zbyt wiele bloków?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: niepoprawne id wskaŸnika bloku 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "blok nr 1 skasowany?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nie mogê znaleŸæ wiersza %ld"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: niepoprawne id bloku odniesienia"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "pe_line_count wynosi zero"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: numer wiersza poza zakresem: %ld jest poza koñcem"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: liczba wierszy niepoprawna w bloku %ld"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "WielkoϾ stosu wzrasta"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: niepoprawne id bloku odniesienia 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: UWAGA"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Znalaz³em plik wymiany o nazwie \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "Podczas otwierania pliku \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " NOWSZE od pliku wymiany!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Pewnie inny program obrabia ten sam plik.\n"
+" Jeœli tak, b¹dŸ ostro¿ny, aby nie skoñczyæ z dwoma\n"
+" ró¿nymi wersjami jednego tego samego pliku po zmianach.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " Zakoñcz lub ostro¿nie kontynuuj.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Sesja edycji dla pliku za³ama³a siê.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Jeœli tak, to u¿yj \":recover\" lub \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" aby odzyskaæ zmiany (patrz \":help recovery)\").\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " Jeœli ju¿ to zrobi³eœ, usuñ plik wymiany \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" aby unikn¹æ tej wiadomoœci.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "Plik wymiany \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" ju¿ istnieje!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - UWAGA"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "Plik wymiany ju¿ istnieje!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&Otwórz Read-Only\n"
+"&Edytuj pomimo\n"
+"O&dtwórz\n"
+"&Zakoñcz\n"
+"&Porzuæ"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&Otwórz Read-Only\n"
+"&Edytuj pomimo\n"
+"O&dtwórz\n"
+"&Zakoñcz\n"
+"&Porzuæ\n"
+"&Skasuj go"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: Znaleziono zbyt wiele plików wymiany"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Czêœæ tropu punktu menu nie okreœla podmenu"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Menu istnieje tylko w innym trybie"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Nie ma menu o tej nazwie"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Trop menu nie mo¿e prowadziæ do podmenu"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Nie wolno dodawaæ punktów menu wprost do paska menu"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Separator nie mo¿e byæ czêœci¹ tropu menu"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menu ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Oderwij to menu"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Trop menu musi prowadziæ do punktu menu"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Nie znaleziono menu: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Menu nie jest zdefiniowane dla trybu %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Trop menu musi prowadziæ do podmenu"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Nie znaleziono menu - sprawdŸ nazwy menu"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Wykryto b³¹d podczas przetwarzania %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "wiersz %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[ci¹g zbyt d³ugi]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"Opiekun komunikatów: Marcin Dalecki <dalecki@cs.net.pl>, Miko³aj Machowski "
+"<mikmach@wp.pl>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Przerwanie: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "Naciœnij ENTER aby kontynuowaæ"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Naciœnij ENTER lub wprowadŸ komendê aby kontynuowaæ"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Wiêcej --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: wiersz, SPACE/b: stronê, d/u: pó³ strony, q: zakoñcz)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: wiersz, SPACE: stronê, d: pó³ strony, q: zakoñczenie)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "Pytanie"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Tak\n"
+"&Nie"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Tak\n"
+"&Nie\n"
+"Zapisz &wszystkie\n"
+"&Odrzuæ wszystkie\n"
+"&Zakoñcz"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "Dialog zapisywania pliku"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "Dialog otwierania pliku"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Przykro mi, nie ma przegl¹darki plików w trybie konsoli"
+
+#: misc1.c:2754
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: OSTRZE¯ENIE: Zmiany w pliku tylko do odczytu"
+
+#: misc1.c:3002
+msgid "1 more line"
+msgstr "1 wiersz wiêcej"
+
+#: misc1.c:3004
+msgid "1 line less"
+msgstr "1 wiersz mniej"
+
+#: misc1.c:3009
+#, c-format
+msgid "%ld more lines"
+msgstr "dodano %ld wierszy"
+
+#: misc1.c:3011
+#, c-format
+msgid "%ld fewer lines"
+msgstr "usuniêto %ld wierszy"
+
+#: misc1.c:3014
+msgid " (Interrupted)"
+msgstr " (Przerwane)"
+
+#: misc1.c:7563
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachowujê plik...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7573
+msgid "Vim: Finished.\n"
+msgstr "Vim: Zakoñczono.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "B£¥D: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtów] totalne alokacje-zwolnienia %lu-%lu, w u¿ytku %lu, maksymalne "
+"u¿ycie %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[wywo³ania] wszystkich re/malloc()-ów %lu, wszystkich free()-ów %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: Wiersz staje siê zbyt d³ugi"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Wewnêtrzny b³¹d: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Brak pamiêci! (rezerwacja %lu bajtów)"
+
+#: misc2.c:2593
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Wywo³ujê pow³okê do wykonania: \"%s\""
+
+#: misc2.c:2815
+msgid "E545: Missing colon"
+msgstr "E545: Brak dwukropka"
+
+#: misc2.c:2817 misc2.c:2844
+msgid "E546: Illegal mode"
+msgstr "E546: Niedozwolony tryb"
+
+#: misc2.c:2883
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Niedozwolony obrys myszki"
+
+#: misc2.c:2923
+msgid "E548: digit expected"
+msgstr "E548: oczekiwano cyfry"
+
+#: misc2.c:2928
+msgid "E549: Illegal percentage"
+msgstr "E459: Niedozwolony procent"
+
+#: misc2.c:3238
+msgid "Enter encryption key: "
+msgstr "WprowadŸ klucz do odkodowania: "
+
+#: misc2.c:3239
+msgid "Enter same key again: "
+msgstr "WprowadŸ ponownie ten sam klucz: "
+
+#: misc2.c:3249
+msgid "Keys don't match!"
+msgstr "Klucze nie pasuj¹ do siebie!"
+
+#: misc2.c:3798
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Niew³aœciwy trop: '**[numer]' musi byæ na koñcu tropu lub po nim musi "
+"byæ '%s'."
+
+#: misc2.c:5077
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Nie mogê znaleŸæ katalogu \"%s\" w cdpath"
+
+#: misc2.c:5080
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Nie mogê znaleŸæ pliku \"%s\" w tropie"
+
+#: misc2.c:5086
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Katalogu \"%s\" nie ma wiêcej w cdpath"
+
+#: misc2.c:5089
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Pliku \"%s\" nie ma wiêcej w tropie"
+
+#: misc2.c:5323
+msgid "E550: Missing colon"
+msgstr "E550: Brak dwukropka"
+
+#: misc2.c:5335
+msgid "E551: Illegal component"
+msgstr "E551: Niedozwolona czêœæ"
+
+#: misc2.c:5343
+msgid "E552: digit expected"
+msgstr "E552: oczekiwano cyfry"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Nie mo¿na po³¹czyæ z Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Nie mo¿na po³¹czyæ z Netbeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr "E668: B³êdny tryb dostêpu pliku info po³¹czenia NetBeans: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "odczyt z gniazda Netbeans"
+
+#: netbeans.c:1638
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Bufor %ld utraci³ po³¹czenie z NetBeans"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "OSTRZE¯ENIE: terminal nie wykonuje podœwietlania"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: Brak ci¹gu pod kursorem"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: Brak identyfikatora pod kursorem"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Nie mogê skasowaæ zwiniêcia z bie¿¹c¹ 'foldmethod'"
+
+#: normal.c:6740
+msgid "E662: At start of changelist"
+msgstr "E662: Na pocz¹tku listy zmian"
+
+#: normal.c:6742
+msgid "E663: At end of changelist"
+msgstr "E663: Na koñcu listy zmian"
+
+#: normal.c:8003
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "wprowadŸ :quit<Enter> zakoñczenie programu"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 wiersz %sed 1 raz"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 wiersz %sed %d razy"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld wierszy %sed 1 raz"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld wierszy %sed %d razy"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld wierszy do wciêcia... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 wiersz wciêty "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld wierszy wciêtych "
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "nie mogê skopiowaæ, mimo to kasujê"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "1 wiersz zmieniono"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld wierszy zmieniono"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "zwalniam %ld wierszy"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "1 wiersz przekopiowano"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld wierszy przekopiowanych"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Pusty rejestr %s"
+
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Rejestry ---"
+
+#: ops.c:5073
+msgid "Illegal register name"
+msgstr "Niedozwolona nazwa rejestru"
+
+#: ops.c:5161
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Rejestry:\n"
+
+#: ops.c:5211
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Nieznany typ rejestru %d"
+
+#: ops.c:5696
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Niew³aœciwa nazwa rejestru: '%s'"
+
+#: ops.c:6056
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Kolumn; "
+
+#: ops.c:6063
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Wybrano %s%ld z %ld Wierszy; %ld z %ld S³ów; %ld z %ld Bajtów"
+
+#: ops.c:6079
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Kol %s z %s; Wiersz %ld z %ld; S³owo %ld z %ld; Bajt %ld z %ld"
+
+#: ops.c:6090
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld dla BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Strona %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Dziêki za lot Vimem"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Nieznana opcja"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Opcja nie jest wspomagana"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Niedozwolone w modeline"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tOstatnie ustawienie przez "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Po = wymagany jest numer"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: Nie znaleziono w termcap"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Niedozwolony znak <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Nie mogê ustawiæ 'term' na pusty ci¹g"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Nie mogê zmieniæ term w GUI"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: U¿yj \":gui\" do odpalenia GUI"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' i 'patchmode' s¹ to¿same"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Nie mogê zmieniæ w GTK+2 GUI"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Brak dwukropka"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Ci¹g o zerowej d³ugoœci"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Brak numeru po <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Brak przecinka"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Musi okreœlaæ wartoœæ '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: zawiera niewyœwietlalny lub szeroki znak"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Niedozwolona czcionka/ki"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: nie mogê wybraæ zestawu czcionek"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: Niedozwolony zestaw czcionek"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: nie mogê wybraæ szerokiej czcionki"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: Niedozwolona szeroka czcionka"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Niedozwolony znak po <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: wymagany przecinek"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' musi byæ pusty lub zawieraæ %s"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: Brak wspomagania myszki"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Niedomkniêty ci¹g wyra¿eñ"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: zbyt wiele elementów"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: niezbalansowane grupy"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: okno podgl¹du ju¿ istnieje"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: Arabski wymaga UTF-8, zrób ':set encoding=utf-8'"
+
+#: option.c:6783
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Potrzebujê przynajmniej %d wierszy"
+
+#: option.c:6793
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Potrzebujê przynajmniej %d kolumn"
+
+#: option.c:7100
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Nieznana opcja: %s"
+
+#: option.c:7220
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kody terminala ---"
+
+#: option.c:7222
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Globalne wartoœci opcji ---"
+
+#: option.c:7224
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Lokalne wartoœci opcji ---"
+
+#: option.c:7226
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Opcje ---"
+
+#: option.c:7932
+msgid "E356: get_varp ERROR"
+msgstr "E356: B£¥D get_varp"
+
+#: option.c:8903
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Brak pasuj¹cego znaku dla %s"
+
+#: option.c:8937
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Dodatkowe znaki po œredniku: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "nie mogê otworzyæ "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nie mogê otworzyæ okna!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Potrzebujê Amigados w wersji 2.04 lub póŸniejsz¹\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Potrzebujê %s w wersji %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "Nie mogê otworzyæ NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Nie mogê stworzyæ "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim koñczy pracê z %d\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "nie mogê zmieniæ trybu konsoli ?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: nie jest konsol¹??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nie mogê wykonaæ pow³oki z opcj¹ -f"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "Nie mogê wykonaæ "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "pow³oka "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " zwróci³\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE zbyt niskie."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "B£¥D I/O"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(obciêty)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' nie wynosi 80, nie mogê wykonaæ zewnêtrznych komend"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E237: Wybór drukarki nie powiód³ siê"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "do %s z %s"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Nieznana czcionka drukarki: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: B³¹d drukarki: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "Nieznane"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "Wydrukowano '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Niedozwolona nazwa zestawu znaków \"%s\" w nazwie czcionki \"%s\""
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Niedozwolony znak '%c' w nazwie czcionki \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Niew³aœciwa opcja 'osfiletype' - u¿ywam Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Podwójny sygna³, wychodzê\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Za³apa³ œmiertelny sygna³ %s\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Za³apa³ œmiertelny sygna³\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Otwieranie ekranu X trwa³o %ld msec"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Dosta³ b³¹d X\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "Test ekranu X nie powiód³ siê"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "Próba otwarcia ekranu X trwa³a zbyt d³ugo"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Nie mogê wykonaæ pow³oki "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nie mogê wykonaæ pow³oki sh\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"pow³oka zwróci³a "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nie mogê stworzyæ potoków\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Nie mogê rozdzieliæ siê\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Komenda zakoñczona\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP straci³ po³¹czenie ICE"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "Otwarcie ekranu X nie powiod³o siê"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP obs³uguje ¿¹danie samozapisu"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP otwiera po³¹czenie"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "Obserwacja po³¹czenia XSMP ICE nie powiod³a siê"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection nie powiod³o siê: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "W wierszu"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Nie mogê zarezerwowaæ pamiêci dla linii poleceñ."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "B³¹d VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Nie mogê za³adowaæ vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nie zdo³a³em poprawiæ wskaŸników funkcji w DLL!"
+
+#: os_win16.c:342 os_win32.c:3197
+#, c-format
+msgid "shell returned %d"
+msgstr "pow³oka zwróci³a %d"
+
+#: os_win32.c:2655
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Za³apa³ wydarzenie %s\n"
+
+#: os_win32.c:2657
+msgid "close"
+msgstr "zamknij"
+
+#: os_win32.c:2659
+msgid "logoff"
+msgstr "wyloguj"
+
+#: os_win32.c:2660
+msgid "shutdown"
+msgstr "zakoñcz"
+
+#: os_win32.c:3150
+msgid "E371: Command not found"
+msgstr "E371: Nie znaleziono komendy"
+
+#: os_win32.c:3163
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE nie znaleziono w twoim $PATH.\n"
+"Zewnêtrzne komendy nie bêd¹ wstrzymane po wykonaniu.\n"
+"Patrz :help wim32-vimrun aby otrzymaæ wiêcej informacji."
+
+#: os_win32.c:3166
+msgid "Vim Warning"
+msgstr "Vim Ostrze¿enie"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Zbyt wiele %%%c w ci¹gu formatuj¹cym"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Nieoczekiwane %%%c w ci¹gu formatuj¹cym"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Brak ] w ci¹gu formatuj¹cym"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Niewspomagane %%%c w ci¹gu formatuj¹cym"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Niepoprawne %%%c w prefiksie ci¹gu formatuj¹cego"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Niepoprawne %%%c w ci¹gu formatuj¹cym"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' nie zawiera wzorca"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Pusta nazwa katalogu lub jej brak"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Nie ma wiêcej elementów"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d z %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (wiersz skasowany)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Na dole stosu quickfix"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Na górze stosu quickfix"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "lista b³êdów %d z %d; %d b³êdów"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nie mogê zapisaæ, opcja 'buftype' jest ustawiona"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: Niew³aœciwy element w %s%%[]"
+
+#: regexp.c:840
+msgid "E339: Pattern too long"
+msgstr "E339: Zbyt d³ugi wzorzec"
+
+#: regexp.c:1011
+msgid "E50: Too many \\z("
+msgstr "E50: Zbyt wiele \\z("
+
+#: regexp.c:1022
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Zbyt wiele %s("
+
+#: regexp.c:1079
+msgid "E52: Unmatched \\z("
+msgstr "E52: Niesparowany \\z("
+
+#: regexp.c:1083
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Niesparowany %s%%("
+
+#: regexp.c:1085
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Niesparowany %s("
+
+#: regexp.c:1090
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Niesparowany %s)"
+
+#: regexp.c:1260
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: operand %s* móg³ byæ pusty"
+
+#: regexp.c:1263
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: operand %s+ móg³ byæ pusty"
+
+#: regexp.c:1318
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: niedozwolony znak po %s@"
+
+#: regexp.c:1346
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: operand %s{ móg³ byæ pusty"
+
+#: regexp.c:1356
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Zbyt wiele z³o¿onych %s{...}"
+
+#: regexp.c:1372
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Zagnie¿d¿one %s*"
+
+#: regexp.c:1375
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Zagnie¿d¿one %s%c"
+
+#: regexp.c:1493
+msgid "E63: invalid use of \\_"
+msgstr "E63: Niedozwolone u¿ycie \\_"
+
+#: regexp.c:1538
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c po niczym"
+
+#: regexp.c:1594
+msgid "E65: Illegal back reference"
+msgstr "E65: Niew³aœciwe odwo³anie wsteczne"
+
+#: regexp.c:1607
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( jest niedozwolone w tym miejscu"
+
+#: regexp.c:1626
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 i podobne s¹ niedozwolone w tym miejscu"
+
+#: regexp.c:1637
+msgid "E68: Invalid character after \\z"
+msgstr "E68: niedopuszczalny znak po \\z"
+
+#: regexp.c:1686
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Brak ] po %s%%["
+
+#: regexp.c:1702
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Pusty %s%%[]"
+
+#: regexp.c:1762
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Niedozwolony znak po %s%%"
+
+#: regexp.c:2559
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: B³¹d sk³adni w %s{...}"
+
+#: regexp.c:2865 regexp.c:3018
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Przechwycono za³amanie; regexp zbyt z³o¿ony?"
+
+#: regexp.c:3006 regexp.c:3015
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: wzorzec spowodowa³ b³¹d out-of-stack"
+
+#: regexp.c:3260
+msgid "External submatches:\n"
+msgstr "Zewnêtrzne poddopasowania:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld wierszy zwiniêto "
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " V-ZAMIANA"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " ZAMIANA"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " NEGATYW"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " WPROWADZANIE"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (wprowadzanie)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (zamiana)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (v-zamiana)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Hebrajski"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " Arabski"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (jêzyk)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (wklejanie)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " WIZUALNY"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " WIZUALNY LINIOWY"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " WIZUALNY BLOKOWY"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " ZAZNACZANIE"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " ZAZNACZANIE LINIOWE"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " ZAZNACZANIE BLOKOWE"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "zapis"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "szukanie dobi³o GÓRY; kontynuacja od KOÑCA"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "szukanie dobi³o KOÑCA; kontynuacja od GÓRY"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Niew³aœciwy ci¹g do szukania: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: szukanie dobi³o GÓRY bez znalezienia: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: szukanie dobi³o KOÑCA bez znalezienia : %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Oczekujê '?' lub '/' po ';'"
+
+#: search.c:3758
+msgid " (includes previously listed match)"
+msgstr " (zawiera poprzednio wymienione dopasowanie)"
+
+#. cursor at status line
+#: search.c:3778
+msgid "--- Included files "
+msgstr "--- Zawarte pliki "
+
+#: search.c:3780
+msgid "not found "
+msgstr "nie znaleziono"
+
+#: search.c:3781
+msgid "in path ---\n"
+msgstr "w tropie ---\n"
+
+#: search.c:3820
+msgid " (Already listed)"
+msgstr " (Ju¿ wymienione)"
+
+#: search.c:3822
+msgid " NOT FOUND"
+msgstr " NIE ZNALEZIONO"
+
+#: search.c:3874
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Przegl¹d w³¹czonego pliku: %s"
+
+#: search.c:4092
+msgid "E387: Match is on current line"
+msgstr "E387: Wzorzec pasuje w bie¿¹cym wierszu"
+
+#: search.c:4235
+msgid "All included files were found"
+msgstr "Wszelkie w³¹czane pliki odnaleziono"
+
+#: search.c:4237
+msgid "No included files"
+msgstr "Brak w³¹czanych plików"
+
+#: search.c:4253
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nie znalaz³em definicji"
+
+#: search.c:4255
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nie znalaz³em wzorca"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Niedozwolony argument: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Nie ma takiego klastra sk³adni: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "Brak elementów sk³adni okreœlonych dla tego bufora"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "synchronizacja komentarzy w stylu C"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "brak synchronizacji"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "pocz¹tek synchronizacji"
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " wierszy przed górn¹ lini¹"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Elementy synchronizacji sk³adni ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizujê na elementach"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Elementy sk³adni ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Nie ma takiego klastra sk³adni: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimalnie "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "maksymalnie "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; pasuje "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr "znaków nowego wiersza"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here niedozwolone w tym miejscu"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Nie znalaz³em elementów regionu dla %s"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: argument contains niedozwolony w tym miejscu"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: argument containedin niedozwolony w tym miejscu"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Wymagana nazwa pliku"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Brak '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Za ma³o argumentów: syntax region %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Brak specyfikacji klastra"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Brak ogranicznika wzorca: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Œmieci po wzorcu: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax sync: wielokrotnie podane wzorce kontynuacji wiersza"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Niedozwolone argumenty: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Brak znaku równoœci: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Pusty argument: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s jest niedozwolone w tym miejscu"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musi byæ pierwsze w liœcie contains"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Nieznana nazwa grupy: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Niew³aœciwa podkomenda :syntax : %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: nie znaleziono grupy podœwietlania: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Zbyt ma³o argumentów: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Zbyt wiele argumentów: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: grupa ma ustawienia; zignorowane pod³¹czenie podœwietlania"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: nieoczekiwany znak równoœci: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: brak znaku równoœci: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: brak argumentu: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Niedozwolona wartoϾ: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: Kolor FG nieznany"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: Kolor BG nieznany"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Nazwa lub liczba koloru nierozpoznana: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: za d³ugi kod terminala: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Niedozwolony argument: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Zbyt wiele ró¿nych atrybutów podkreœlania w u¿yciu"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Niedrukowalny znak w nazwie grupy"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: nieprawid³owy znak w nazwie grupy"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: na dole stosu znaczników"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: na górze stosu znaczników"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Nie mo¿na przejœæ przed pierwszy pasuj¹cy znacznik"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: nie znaleziono znacznika: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri rodzaj znacznik"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "plik\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "WprowadŸ nr wyboru (<CR> przerywa): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: Pasuje tylko jeden znacznik"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Nie mo¿na przejœæ za ostatni pasuj¹cy znacznik"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Plik \"%s\" nie istnieje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "znacznik %d z %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " lub wiêcej"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " U¿ywam znacznika o odmiennej wielkoœci liter!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Plik \"%s\" nie istnieje"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # DO znacznik OD wiersza w pliku/tekœcie"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Szukam w pliku znaczników %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Trop szukania pliku znaczników obciêty dla %s\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: B³¹d formatu w pliku znaczników \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Przed bajtem %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Plik znaczników nieuporz¹dkowany: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: Brak pliku znaczników"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nie mogê znaleŸæ wzorca znacznika"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Nie znalaz³em znacznika - tylko zgadujê!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' nieznany. Mo¿liwe typy wbudowanych terminali:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "domyœlnie jest '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Nie mogê otworzyæ pliku termcap"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Nie ma opisu takiego terminala w terminfo"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Nie ma opisu takiego terminala w termcap"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Brak opisu \"%s\" w termcap"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: wymagana zdolnoϾ \"cm\" terminala"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klawisze terminala ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "uruchomiono now¹ pow³okê\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: B³¹d podczas wczytywania wejœcia, koñczê...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "Cofniêcie niemo¿liwe; mimo to kontynuujê"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: niew³aœciwe numery wierszy"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 zmiana"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld zmian"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: uszkodzona lista cofania"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: brak wiersza cofania"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:1769
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitowa wersja GUI dla MS-Windows"
+
+#: version.c:1771
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitowa wersja GUI dla MS-Windows"
+
+#: version.c:1774
+msgid " in Win32s mode"
+msgstr " w trybie Win32s"
+
+#: version.c:1776
+msgid " with OLE support"
+msgstr " ze wspomaganiem OLE"
+
+#: version.c:1779
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitowa wersja na konsolê dla MS-Windows"
+
+#: version.c:1783
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitowa wersja dla MS-Windows"
+
+#: version.c:1787
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitowa wersja dla MS-DOS"
+
+#: version.c:1789
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitowa wersja dla MS-DOS"
+
+#: version.c:1795
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"wersja dla MacOS X (unix)"
+
+#: version.c:1797
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"wersja dla MacOS X"
+
+#: version.c:1800
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"wersja dla MacOS"
+
+#: version.c:1805
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"wersja dla RISC OS"
+
+#: version.c:1815
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Zadane ³aty: "
+
+#: version.c:1841 version.c:2209
+msgid "Modified by "
+msgstr "Zmieniony przez "
+
+#: version.c:1848
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Skompilowany "
+
+#: version.c:1851
+msgid "by "
+msgstr "przez "
+
+#: version.c:1863
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Olbrzymia wersja "
+
+#: version.c:1866
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Du¿a wersja "
+
+#: version.c:1869
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normalna wersja "
+
+#: version.c:1872
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Ma³a wersja "
+
+#: version.c:1874
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Malutka wersja "
+
+#: version.c:1880
+msgid "without GUI."
+msgstr "bez GUI."
+
+#: version.c:1885
+msgid "with GTK2-GNOME GUI."
+msgstr "z GTK2-GNOME GUI."
+
+#: version.c:1887
+msgid "with GTK-GNOME GUI."
+msgstr "z GTK-GNOME GUI."
+
+#: version.c:1891
+msgid "with GTK2 GUI."
+msgstr "z GTK2 GUI."
+
+#: version.c:1893
+msgid "with GTK GUI."
+msgstr "z GTK GUI."
+
+#: version.c:1898
+msgid "with X11-Motif GUI."
+msgstr "z X11-Motif GUI."
+
+#: version.c:1902
+msgid "with X11-neXtaw GUI."
+msgstr "z X11-neXtaw GUI."
+
+#: version.c:1904
+msgid "with X11-Athena GUI."
+msgstr "z X11-Athena GUI."
+
+#: version.c:1908
+msgid "with BeOS GUI."
+msgstr "z BeOS GUI."
+
+#: version.c:1911
+msgid "with Photon GUI."
+msgstr "z Photon GUI."
+
+#: version.c:1914
+msgid "with GUI."
+msgstr "z GUI."
+
+#: version.c:1917
+msgid "with Carbon GUI."
+msgstr "z Carbon GUI."
+
+#: version.c:1920
+msgid "with Cocoa GUI."
+msgstr "z Cocoa GUI."
+
+#: version.c:1923
+msgid "with (classic) GUI."
+msgstr "z (klasycznym) GUI."
+
+#: version.c:1934
+msgid " Features included (+) or not (-):\n"
+msgstr " Opcje w³¹czone (+) lub nie (-):\n"
+
+#: version.c:1946
+msgid " system vimrc file: \""
+msgstr " vimrc systemu: \""
+
+#: version.c:1951
+msgid " user vimrc file: \""
+msgstr " vimrc u¿ytkownika: \""
+
+#: version.c:1956
+msgid " 2nd user vimrc file: \""
+msgstr " 2-gi plik vimrc u¿ytkownika: \""
+
+#: version.c:1961
+msgid " 3rd user vimrc file: \""
+msgstr " 3-ci plik vimrc u¿ytkownika: \""
+
+#: version.c:1966
+msgid " user exrc file: \""
+msgstr " exrc u¿ytkownika: \""
+
+#: version.c:1971
+msgid " 2nd user exrc file: \""
+msgstr " 2-gi plik exrc u¿ytkownika: \""
+
+#: version.c:1977
+msgid " system gvimrc file: \""
+msgstr " gvimrc systemu: \""
+
+#: version.c:1981
+msgid " user gvimrc file: \""
+msgstr " gvimrc u¿ytkownika: \""
+
+#: version.c:1985
+msgid "2nd user gvimrc file: \""
+msgstr "2-gi plik gvimrc u¿ytkownika: \""
+
+#: version.c:1990
+msgid "3rd user gvimrc file: \""
+msgstr "3-ci plik gvimrc u¿ytkownika: \""
+
+#: version.c:1997
+msgid " system menu file: \""
+msgstr " systemowy plik menu: \""
+
+#: version.c:2005
+msgid " fall-back for $VIM: \""
+msgstr " odwet dla $VIM-a: \""
+
+#: version.c:2011
+msgid " f-b for $VIMRUNTIME: \""
+msgstr "f-b dla $VIMRUNTIME: \""
+
+#: version.c:2015
+msgid "Compilation: "
+msgstr "Kompilacja: "
+
+#: version.c:2021
+msgid "Compiler: "
+msgstr "Kompilator: "
+
+#: version.c:2026
+msgid "Linking: "
+msgstr "Konsolidacja: "
+
+#: version.c:2031
+msgid " DEBUG BUILD"
+msgstr " KOMPILACJA DEBUG"
+
+#: version.c:2070
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi rozbudowany"
+
+#: version.c:2072
+msgid "version "
+msgstr "wersja "
+
+#: version.c:2073
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar i Inni."
+
+#: version.c:2077
+msgid "Vim is open source and freely distributable"
+msgstr "Vim jest open source i rozprowadzany darmowo"
+
+#: version.c:2079
+msgid "Help poor children in Uganda!"
+msgstr "Pomó¿ biednym dzieciom w Ugandzie!"
+
+#: version.c:2080
+msgid "type :help iccf<Enter> for information "
+msgstr "wprowadŸ :help iccf<Enter> dla informacji o tym "
+
+#: version.c:2082
+msgid "type :q<Enter> to exit "
+msgstr "wprowadŸ :q<Enter> zakoñczenie programu "
+
+#: version.c:2083
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "wprowadŸ :help<Enter> lub <F1> pomoc na bie¿¹co "
+
+#: version.c:2084
+msgid "type :help version6<Enter> for version info"
+msgstr "wprowadŸ :help version6<Enter> dla informacji o wersji"
+
+#: version.c:2087
+msgid "Running in Vi compatible mode"
+msgstr "Dzia³am w trybie zgodnoœci z Vi"
+
+#: version.c:2088
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "wprowadŸ :set nocp<Enter> wartoœci domyœlne Vim-a"
+
+#: version.c:2089
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "wprowadŸ :help cp-default<Enter> dla informacji to tym "
+
+#: version.c:2104
+msgid "menu Help->Orphans for information "
+msgstr "wprowadŸ :help iccf<Enter> dla informacji to tym "
+
+#: version.c:2106
+msgid "Running modeless, typed text is inserted"
+msgstr "Uruchomiony bez trybów, wpisany tekst jest wprowadzany"
+
+#: version.c:2107
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Edytuj->Ustawienia globalne->Tryb wstawiania"
+
+#: version.c:2108
+msgid " for two modes "
+msgstr " dla dwóch trybów "
+
+#: version.c:2112
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Edytuj->Ustawienia globalne->KompatybilnoϾ z Vi"
+
+#: version.c:2113
+msgid " for Vim defaults "
+msgstr " dla domyœlnych ustawieñ Vima "
+
+#: version.c:2160
+msgid "Sponsor Vim development!"
+msgstr "Sponsoruj rozwój Vima!"
+
+#: version.c:2161
+msgid "Become a registered Vim user!"
+msgstr "Zostañ zarejestrowanym u¿ytkownikiem Vima!"
+
+#: version.c:2164
+msgid "type :help sponsor<Enter> for information "
+msgstr "wprowadŸ :help sponsor<Enter> dla informacji"
+
+#: version.c:2165
+msgid "type :help register<Enter> for information "
+msgstr "wprowadŸ :help register<Enter> dla informacji"
+
+#: version.c:2167
+msgid "menu Help->Sponsor/Register for information "
+msgstr "menu Pomoc->Sponsoruj/Zarejestruj siê dla informacji"
+
+#: version.c:2177
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "OSTRZE¯ENIE: wykryto Windows 95/98/ME"
+
+#: version.c:2180
+msgid "type :help windows95<Enter> for info on this"
+msgstr "wprowadŸ :help windows95<Enter> dla informacji to tym "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Nie ma okna podgl¹du"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Nie mogê rozdzieliæ lewo-górnego i prawo-dolnego jednoczeœnie"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nie mogê przekrêciæ, gdy inne okno jest rozdzielone"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: Nie mogê zamkn¹æ ostatniego okna"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Ju¿ jest tylko jeden widok"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Inne okno zawiera zmiany"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Brak nazwy pliku pod kursorem"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Nie mogê znaleŸæ pliku \"%s\" w tropie"
+
+#: if_perl.xs:326 globals.h:1232
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Nie mog³em za³adowaæ biblioteki %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "Przykro mi, ta komenda jest wy³¹czona: nie mog³em za³adowaæ biblioteki Perla."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr "E299: wyliczenie Perla zabronione w piaskownicy bez modu³u Safe"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Edytuj w &wielu Vimach"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Edytuj w pojedynczym &Vimie"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Diff z Vimem"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Edytuj w &Vimie"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Edytuj z istniej¹cym Vimem - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Edytuj wybrane pliki w Vimie"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "B³¹d tworzenia procesu: SprawdŸ czy gvim jest w twojej œcie¿ce!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "b³¹d gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Za d³uga œcie¿ka!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "--Brak wierszy w buforze--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: Przerwanie komendy"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: wymagany argument"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ powinno byæ /, ? lub &"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Niedozwolone w oknie wiersza poleceñ; <CR> wykonuje, CTRL-C opuszcza"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Komenda niedozwolona z exrc/vimrc w bie¿¹cym szukaniu katalogu lub "
+"znacznika"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: Brak :endif"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: Brak :endtry"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: Brak :endwhile"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile bez :while"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Plik istnieje (wymuœ poprzez !)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: Komenda nie powiod³a siê"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Nieznany zestaw czcionek: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Nieznana czcionka: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Czcionka \"%s\" nie ma sta³ej szerokoœci znaków"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: B³¹d wewnêtrzny"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "Przerwane"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: Niew³aœciwy adres"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: Niew³aœciwy argument"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Niew³aœciwy argument: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Niew³aœciwe wyra¿enie: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: Niew³aœciwy zakres"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: Niew³aœciwa komenda"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" jest katalogiem"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Nieoczekiwane znaki przed '='"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Wywo³anie z biblioteki nie powiod³o siê dla \"%s()\""
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Nie mo¿na za³adowaæ funkcji biblioteki %s"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Zak³adka ma niew³aœciwy numer wiersza"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "E20: Zak³adka nienastawiona"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nie mogê wykonaæ zmian, 'modifiable' jest wy³¹czone"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Zbyt g³êbokie zagnie¿d¿enie skryptów"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: Brak pliku zamiany"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: Nie ma takiego skrótu"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: Niedozwolone !"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI nie mo¿e byæ u¿yte: Nie w³¹czono podczas kompilacji"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Hebrajski nie mo¿e byæ u¿yty: Nie w³¹czono podczas kompilacji\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Farsi nie mo¿e byæ u¿yty: Nie w³¹czono podczas kompilacji\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Arabski nie mo¿e byæ u¿yty: Nie w³¹czono podczas kompilacji\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Brak takiej nazwy grupy podœwietlania: %s"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: Nie wprowadzono jeszcze ¿adnego tekstu"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: Nie ma poprzedniego wiersza poleceñ"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: Nie ma takiego przyporz¹dkowania"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: Brak dopasowañ"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Brak dopasowañ: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: Brak nazwy pliku"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Brak poprzedniego podstawieniowego wyra¿enia regularnego"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: Brak poprzedniej komendy"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: Brak poprzedniego wyra¿enia regularnego"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: Zakres niedozwolony"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: Brak miejsca"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: brak zarejestrowanego serwera o nazwie \"%s\""
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Nie mogê stworzyæ pliku %s"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: Nie mogê pobraæ nazwy pliku tymczasowego"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Nie mogê otworzyæ pliku %s"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Nie mogê odczytaæ pliku %s"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Nie zapisano od ostatniej zmiany (wymuœ przez !)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: Zerowy argument"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: Oczekujê liczby"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nie mogê otworzyæ pliku b³êdów %s"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: nie mogê otworzyæ ekranu"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: Pamiêæ wyczerpana!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "Nie znaleziono wzorca"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Nie znaleziono wzorca: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: Argument musi byæ dodatni"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Nie mo¿na przejœæ do poprzedniego katalogu"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: Brak B³êdów"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: Popsuty ci¹g wzorca"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Zepsuty program wyra¿eñ regularnych"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: opcja 'readonly' jest ustawiona (wymuœ poprzez !)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nie mogê ustawiæ zmiennej tylko do odczytu \"%s\""
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: B³¹d w trakcie czytania pliku b³êdów"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Niedozwolone w piaskownicy"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: Niedozwolone w tym miejscu"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Ustawianie trybu ekranu niewspomagane"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: Niew³aœciwa wielkoœæ przewiniêcia"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: opcja 'shell' jest pusta"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Nie mog³em wczytaæ danych znaku!"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: B³¹d podczas zamykania pliku wymiany"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: stos znaczników jest pusty"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: Komenda jest zbyt skomplikowana"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: Zbyt d³uga nazwa"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: Zbyt wiele ["
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: Zbyt wiele nazw plików"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: Nadstêpne znaczki"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: Nieznana zak³adka"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nie mog¹ rozwin¹æ znaków wieloznacznych"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' nie mo¿e byæ mniejsze ni¿ 'winminheight'"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' nie mo¿e byæ mniejsze ni¿ 'winminwidth'"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: B³¹d w trakcie zapisu"
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "Zerowy licznik"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: U¿ycie <SID> poza kontekstem skryptu"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: Odebra³em niew³aœciwe wyra¿enie"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Region jest chroniony, nie mogê zmieniæ"
+
diff --git a/src/po/pl.po b/src/po/pl.po
new file mode 100644
index 000000000..303d3344a
--- /dev/null
+++ b/src/po/pl.po
@@ -0,0 +1,6576 @@
+# translation of pl.po to Polish
+# Polish Translation for Vim
+#
+# updated 2001 for vim-6.0
+# FIRST AUTHOR Marcin Dalecki <dalecki@cyber.cs.net.pl>, 2000.
+# Mikolaj Machowski <mikmach@wp.pl>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: pl\n"
+"POT-Creation-Date: 2004-05-23 21:41+0200\n"
+"PO-Revision-Date: 2004-05-23 22:00+0200\n"
+"Last-Translator: Mikolaj Machowski <mikmach@wp.pl>\n"
+"Language-Team: Polish <pl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nie mogê zarezerwowaæ bufora; zakoñczenie..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nie mogê zarezerwowaæ bufora; u¿ywam innego..."
+
+#: buffer.c:805
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Nie wy³adowano ¿adnego bufora"
+
+#: buffer.c:807
+msgid "E516: No buffers were deleted"
+msgstr "E516: Nie skasowano ¿adnego bufora"
+
+#: buffer.c:809
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Nie wyrzucono ¿adnego bufora"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "1 bufor wy³adowany"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "wy³adowano %d buforów"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "1 bufor skasowany"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buforów skasowano"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "wyrzucono 1 bufor "
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "wyrzucono %d buforów"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: Nie znaleziono zmienionych buforów"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: Nie ma wylistowanych buforów"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Bufor \"%ld\" nie istnieje"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Nie mogê przej¶æ poza ostatni bufor"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Nie mogê przej¶æ przed pierwszy bufor"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89 Nie zapisano zmian w buforze %ld (wymu¶ przez !)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Nie mogê wy³adowaæ ostatniego bufora"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: OSTRZE¯ENIE: Przepe³nienie listy nazw plików"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Nie znaleziono bufora %ld"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Wielokrotne dopasowania dla %s"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: ¯aden bufor nie pasuje do %s"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "wiersz %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Bufor o tej nazwie ju¿ istnieje"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [Zmieniony]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[Nie edytowany]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[Nowy Plik]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[B³±d odczytu]"
+
+#: buffer.c:2726 fileio.c:2112
+msgid "[readonly]"
+msgstr "[tylko odczyt]"
+
+#: buffer.c:2747
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 wiersz --%d%%--"
+
+#: buffer.c:2749
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld wiersze --%d%%--"
+
+#: buffer.c:2756
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "wiersz %ld z %ld --%d%%-- kol "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[Brak pliku]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "pomoc"
+
+#: buffer.c:3463 screen.c:5075
+msgid "[help]"
+msgstr "[pomoc]"
+
+#: buffer.c:3495 screen.c:5081
+msgid "[Preview]"
+msgstr "[Podgl±d]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "Wszystko"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "Dó³"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "Góra"
+
+#: buffer.c:4523
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Lista buforów:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[Lista B³êdów]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[Brak Pliku]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaki ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaki dla %s:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " wiersz=%ld id=%d nazwa=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nie mogê zró¿nicowaæ wiêcej ni¿ %ld buforów"
+
+#: diff.c:709
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nie mogê stworzyæ ró¿nic"
+
+#: diff.c:814
+msgid "Patch file"
+msgstr "Plik ³ata"
+
+#: diff.c:1065
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nie mogê wczytaæ wyj¶cia ró¿nicy"
+
+#: diff.c:1815
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Bie¿±cy bufor nie jest w trybie ró¿nic"
+
+#: diff.c:1827
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Brak innego bufora w trybie ró¿nic"
+
+#: diff.c:1835
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Wiêcej ni¿ jeden bufor w trybie ró¿nicowania, nie wiem którego u¿yæ"
+
+#: diff.c:1858
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nie mogê znale¼æ bufora \"%s\""
+
+#: diff.c:1864
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Bufor \"%s\" nie jest w trybie ró¿nicowania"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Escape jest niedozwolone w dwugrafie"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: Nie znaleziono pliku rozk³adu klawiszy"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Zastosowano :loadkeymap w niewczytanym pliku"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Dope³nianie s³ów kluczowych (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " ^X tryb (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Lokalne dope³nianie s³ów kluczowych (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Dope³nianie pe³nych wierszy (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Dope³nianie nazw plików (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Dope³nianie znaczników (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Dope³nianie wzorców tropów (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Dope³nianie definicji (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Dope³nianie ze s³owników (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Dope³nianie z tezaurusa (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Dope³nianie wiersza poleceñ (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Dobi³em do koñca akapitu"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "opcja 'thesaurus' jest pusta"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "opcja 'dictionary' jest pusta"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Przegl±dam s³ownik: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (wprowadzanie) Przewijanie (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (zamiana) Przewijanie (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Przegl±dam: %s"
+
+#: edit.c:2719
+msgid "Scanning tags."
+msgstr "Przegl±dam znaczniki."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " Dodajê"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Szukam..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Z powrotem na pierwotnym"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Wyraz z innego wiersza"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "Jedyne dopasowanie"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "pasuje %d z %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "pasuje %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Nieznana zmienna: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Brak nawiasów: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Nie istnieje zmienna: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Brak ':' po '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Brak ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Brak ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Brak nazwy opcji: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Nieznana opcja: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Brak cudzys³owu: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Brak cudzys³owu: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Niew³a¶ciwe argumenty dla funkcji %s"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Nieznana funkcja: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Zbyt wiele argumentów dla funkcji: %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Za ma³o argumentów dla funkcji: %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Zastosowano <SID> poza skryptem: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4376 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld wierszy: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Zakoñcz"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "wywo³ano inputrestore() wiêcej razy ni¿ inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E655: Za du¿o dowi±zañ symbolicznych (pêtla?)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Brak po³±czenia z serwerem Vim"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Nie mogê czytaæ odpowiedzi serwera"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: Nie mogê wys³aæ do klienta"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nie mogê wys³aæ do %s"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(Niew³a¶ciwe)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nieokre¶lona zmienna: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E418: Niedozwolona nazwa zmiennej: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: Funkcja %s ju¿ istnieje; aby j± zamieniæ u¿yj !"
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nieokre¶lona funkcja: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Brak '(': %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Niedozwolony argument: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: Brak :endfunction"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nie mogê przedefiniowaæ funkcji %s: jest w u¿yciu"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: Wymagana jest nazwa funkcji"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Nazwa funkcji musi rozpoczynaæ siê du¿± liter±: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nieokre¶lona funkcja: %s"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nie mogê skasowaæ funkcji %s: jest w u¿yciu"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zagnie¿d¿enie wywo³añ funkcji ponad 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "wywo³ujê %s"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "porzucono %s"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s zwraca #%ld"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s zwraca \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "kontynuacja w %s"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: :return poza funkcj±"
+
+#: eval.c:9952
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# zmienne globalne:\n"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Wchodzê w tryb odpluskwiania. Wprowad¼ \"cont\" aby kontynuowaæ."
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "wiersz %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Punkt kontrolny w \"%s%s\" wiersz %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Nie znaleziono punktu kontrolnego: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Nie okre¶lono ¿adnych punktów kontrolnych"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s wiersz %ld"
+
+#: ex_cmds2.c:763 ex_cmds.c:2097 ex_cmds.c:2362
+msgid "Save As"
+msgstr "Zapisz jako"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Zachowaj zmiany w \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9380
+msgid "Untitled"
+msgstr "Bez Tytu³u"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Nie zapisano zmian w buforze \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "OSTRZE¯ENIE: Nieoczekiwane wej¶cie w inny bufor (sprawd¼ autokomendy)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Tylko jeden plik w edycji"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Nie mo¿na przej¶æ przed pierwszy plik"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Nie mo¿na przej¶æ za ostatni plik"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: nie wspierany kompilator: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Szukanie \"%s\" w \"%s\""
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Szukanie \"%s\""
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "nie znaleziono w 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "Wczytaj skrypt Vima"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Nie mo¿na wczytaæ katalogu: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nie mog³em wczytaæ \"%s\""
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "wiersz: %ld nie mog³em wczytaæ \"%s\""
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "wczytywanie \"%s\""
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "wiersz %ld: wczytywanie \"%s\""
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "skoñczono wczytywanie %s"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: OSTRZE¯ENIE: Niew³a¶ciwy separator wierszy, pewnie brak ^M"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: u¿yto :scriptencoding poza wczytywanym plikiem"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: u¿yto :finish poza wczytywanym plikiem"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "Strona %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "Brak tekstu do drukowania"
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Drukujê stronê %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopia %d z %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "Wydrukowano: %s"
+
+#: ex_cmds2.c:3549
+msgid "Printing aborted"
+msgstr "Drukowanie odwo³ane"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nie mo¿na zapisaæ do wyj¶ciowego pliku PostScriptu"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Nie mogê otworzyæ pliku \"%s\""
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nie mo¿na odczytaæ pliku zasobów PostScriptu \"%s\""
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: plik \"%s\" nie jest plikiem zasobów PostScriptu"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: plik \"%s\" nie jest wspieranym plikiem zasobów PostScriptu"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: \"%s\" nieprawid³owa wersja pliku zasobów"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nie mo¿na otworzyæ pliku PostScript do wyj¶cia"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nie mogê otworzyæ pliku \"%s\""
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Nie mo¿na znale¼æ pliku zasobów PostScriptu \"prolog.ps\""
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Nie mo¿na znale¼æ pliku zasobów PostScriptu \"%s.ps\""
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: Nie mo¿na przekonwertowaæ z multi-byte do kodowania \"%s\""
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "Przesy³am do drukarki..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Drukowanie pliku PostScript nie powiod³o siê"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "Zadanie drukowanie przes³ane."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Bie¿±cy %sjêzyk: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nie mogê ustawiæ jêzyka na \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Oktal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Oktal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Przeniesienie wierszy na siebie samych"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 wiersz przeniesiony"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld wiersze przeniesione"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld wierszy przefiltrowanych"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Autokomendy *Filter* nie mog± zmieniaæ bie¿±cego bufora"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Brak zapisu od czasu ostatniej zmiany]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s w wierszu: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: Zbyt wiele b³êdów; pomijam resztê pliku"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Wczytujê plik viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " informacja"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " zak³adki"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " NIE POWIOD£O SIÊ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Plik viminfo jest niezapisywalny: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nie mogê zapisaæ pliku viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Zapisujê plik viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Ten plik viminfo zosta³ wygenerowany przez Vima %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Mo¿esz go ostro¿nie edytowaæ!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Warto¶æ 'encoding' w czasie zapsu tego pliku\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Niedopuszczalny pocz±tkowy znak"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Plik jest za³adowany w innym buforze"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Zapisaæ czê¶ciowo plik?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Stosuj ! do zapisania czê¶ciowo bufora"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Nadpisaæ istniej±cy plik \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Brak nazwy pliku dla bufora %ld"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Plik niezapisany: Zapis jest wy³±czony opcj± 'write'"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"opcja 'readonly' nastawiona dla \"%.*s\".\n"
+"Czy chcesz go pomimo tego zapisaæ?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "Edytuj Plik"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autokomendy nieoczekiwanie skasowa³y nowy bufor %s"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: nienumeryczny argument dla :z"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Komendy pow³oki s± niedozwolone w rvim"
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Wzorce regularne nie mog± byæ rozgraniczane literami"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "zamieñ na %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4266
+msgid "(Interrupted) "
+msgstr "(Przerwane) "
+
+#: ex_cmds.c:4270
+msgid "1 substitution"
+msgstr "1 podstawienie "
+
+#: ex_cmds.c:4272
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld podstawieñ"
+
+#: ex_cmds.c:4275
+msgid " on 1 line"
+msgstr " w 1 wierszu"
+
+#: ex_cmds.c:4277
+#, c-format
+msgid " on %ld lines"
+msgstr " w %ld wierszach"
+
+#: ex_cmds.c:4328
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Nie mogê wykonaæ :global rekursywnie"
+
+#: ex_cmds.c:4363
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Brak wzorca regularnego w :global"
+
+# c-format
+#: ex_cmds.c:4412
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Wzorzec znaleziono w ka¿dym wierszu: %s"
+
+#: ex_cmds.c:4493
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ostatni podstawiany ci±g:\n"
+"$"
+
+#: ex_cmds.c:4594 ex_docmd.c:2011
+msgid "E478: Don't panic!"
+msgstr "E478: Nie panikuj!"
+
+#: ex_cmds.c:4646
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Przykro mi, brak '%s' pomocy dla %s"
+
+#: ex_cmds.c:4649
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Przykro mi, ale brak pomocy o %s"
+
+#: ex_cmds.c:4683
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Przykro mi, nie ma pliku pomocy \"%s\""
+
+#: ex_cmds.c:5166
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: Nie jest katalogiem: %s"
+
+#: ex_cmds.c:5305
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nie mogê otworzyæ %s do zapisu"
+
+#: ex_cmds.c:5341
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nie mogê otworzyæ %s do odczytu"
+
+#: ex_cmds.c:5363
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: Mieszanka kodowañ w pliku pomocy w ramach jêzyka: %s"
+
+#: ex_cmds.c:5441
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Dwukrotny znacznik \"%s\" w pliku %s"
+
+#: ex_cmds.c:5553
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Nieznana komenda znaku: %s"
+
+#: ex_cmds.c:5573
+msgid "E156: Missing sign name"
+msgstr "E156: Brak nazwy znaku"
+
+#: ex_cmds.c:5619
+msgid "E612: Too many signs defined"
+msgstr "E255: Zbyt wiele nazw znaków"
+
+#: ex_cmds.c:5687
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Niew³a¶ciwy tekst znaku: %s"
+
+#: ex_cmds.c:5718 ex_cmds.c:5909
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Nieznany znak: %s"
+
+#: ex_cmds.c:5767
+msgid "E159: Missing sign number"
+msgstr "E159: Brak numeru znaku"
+
+#: ex_cmds.c:5849
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Niew³a¶ciwa nazwa bufora: %s"
+
+#: ex_cmds.c:5888
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Niew³a¶ciwe ID znaku: %ld"
+
+#: ex_cmds.c:5958
+msgid " (NOT FOUND)"
+msgstr " (NIE ZNALEZIONO)"
+
+#: ex_cmds.c:5960
+msgid " (not supported)"
+msgstr "(nie wspomagane)"
+
+#: ex_cmds.c:6059
+msgid "[Deleted]"
+msgstr "[Skasowano]"
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Wchodzê w tryb Ex. Wprowad¼ \"visual\" aby przej¶æ do trybu Normal."
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Na koñcu pliku"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: Komenda zbyt rekursywna"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Nie znaleziono wyj±tku: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "Koniec wczytywanego pliku"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "Koniec funkcji"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Niejednoznaczne zastosowanie komendy zdefiniowanej przez u¿ytkownika"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: Nie jest komend± edytora"
+
+#: ex_docmd.c:2030
+msgid "E493: Backwards range given"
+msgstr "E493: Dano wsteczny zakres"
+
+#: ex_docmd.c:2039
+msgid "Backwards range given, OK to swap"
+msgstr "Dano wsteczny zakres; zamiana jest mo¿liwa"
+
+#: ex_docmd.c:2162
+msgid "E494: Use w or w>>"
+msgstr "E494: Stosuj w lub w>>"
+
+#: ex_docmd.c:3788
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Przykro mi, ale ta komenda nie jest dostêpna w tej wersji"
+
+#: ex_docmd.c:3991
+msgid "E172: Only one file name allowed"
+msgstr "E172: Tylko pojedyncza nazwa pliku dozwolona"
+
+#: ex_docmd.c:4571
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 wiêcej plik do edycji. Mimo to wyj¶æ?"
+
+#: ex_docmd.c:4574
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "jeszcze %d plików do edycji. Mimo to wyj¶æ?"
+
+#: ex_docmd.c:4581
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 wiêcej plik do edycji"
+
+#: ex_docmd.c:4583
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: jeszcze %ld plików do edycji"
+
+#: ex_docmd.c:4678
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Komenda ju¿ istnieje; aby j± przedefiniowaæ stosuj !"
+
+#: ex_docmd.c:4789
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Nazwa Arg. Zak. Gotowo¶æ Definicja"
+
+#: ex_docmd.c:4878
+msgid "No user-defined commands found"
+msgstr "Nie znaleziono komend zdefiniowanych przez u¿ytkownika"
+
+#: ex_docmd.c:4910
+msgid "E175: No attribute specified"
+msgstr "E175: Nie okre¶lono atrybutu"
+
+#: ex_docmd.c:4962
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Niew³a¶ciwa ilo¶æ argumentów"
+
+#: ex_docmd.c:4977
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Mno¿nik nie mo¿e byæ podany dwukrotnie"
+
+#: ex_docmd.c:4987
+msgid "E178: Invalid default value for count"
+msgstr "E178: Niew³a¶ciwa domy¶lna warto¶æ mno¿nika"
+
+#: ex_docmd.c:5018
+msgid "E179: argument required for complete"
+msgstr "E179: argument wymagany do dope³niania"
+
+#: ex_docmd.c:5050
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Niew³a¶ciwa warto¶æ dope³niania: %s"
+
+#: ex_docmd.c:5059
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Argument depe³niania dozwolony wy³±cznie dla dope³niania u¿ytkownika"
+
+#: ex_docmd.c:5065
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Dope³nianie u¿ytkownika wymaga funkcji jako argumentu"
+
+#: ex_docmd.c:5076
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Niew³a¶ciwy atrybut: %s"
+
+#: ex_docmd.c:5119
+msgid "E182: Invalid command name"
+msgstr "E182: Niew³a¶ciwa nazwa komendy"
+
+#: ex_docmd.c:5134
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr ""
+"E183: Komendy zdefiniowane przez u¿ytkownika musz± rozpoczynaæ siê du¿± "
+"liter±"
+
+#: ex_docmd.c:5205
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Nie ma takiej komendy u¿ytkownika: %s"
+
+#: ex_docmd.c:5666
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Nie mogê znale¼æ zestawu kolorów %s"
+
+#: ex_docmd.c:5674
+msgid "Greetings, Vim user!"
+msgstr "Witaj u¿ytkowniku Vima!"
+
+#: ex_docmd.c:6391
+msgid "Edit File in new window"
+msgstr "Edytuj plik w nowym oknie"
+
+#: ex_docmd.c:6686
+msgid "No swap file"
+msgstr "Brak pliku wymiany"
+
+#: ex_docmd.c:6790
+msgid "Append File"
+msgstr "Do³±cz plik"
+
+#: ex_docmd.c:6854
+msgid "E186: No previous directory"
+msgstr "E186: Nie ma poprzedniego katalogu"
+
+#: ex_docmd.c:6936
+msgid "E187: Unknown"
+msgstr "E187: Nieznany"
+
+#: ex_docmd.c:7021
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize wymaga dwóch argumentów numerycznych"
+
+#: ex_docmd.c:7077
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Pozycja okna: X %d, Y %d"
+
+#: ex_docmd.c:7082
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Pozyskiwanie pozycji okna nie jest zaimplementowane dla tego systemu"
+
+#: ex_docmd.c:7092
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos wymaga dwóch argumentów numerycznych"
+
+#: ex_docmd.c:7370
+msgid "Save Redirection"
+msgstr "Zapisz przekierowanie"
+
+#: ex_docmd.c:7560
+msgid "Save View"
+msgstr "Zapisz widok"
+
+#: ex_docmd.c:7561
+msgid "Save Session"
+msgstr "Zapisz sesjê"
+
+#: ex_docmd.c:7563
+msgid "Save Setup"
+msgstr "Zapisz ustawienia"
+
+#: ex_docmd.c:7715
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" istnieje (wymu¶ poprzez !)"
+
+#: ex_docmd.c:7720
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nie mogê otworzyæ \"%s\" do zapisu"
+
+#. set mark
+#: ex_docmd.c:7744
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argument musi byæ liter± albo cudzys³owem w przód/ty³"
+
+#: ex_docmd.c:7786
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursywne zastosowanie :normal za g³êbokie"
+
+#: ex_docmd.c:8304
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Brak nazwy zamiennego pliku do podstawienia pod '#'"
+
+#: ex_docmd.c:8335
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: brak nazwy pliku autokomend do podstawienia pod \"<afile>\""
+
+#: ex_docmd.c:8343
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: brak numeru bufora autokomend do podstawienia pod \"<abuf>\""
+
+#: ex_docmd.c:8354
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: brak nazwy dopasowania autokomend pod \"<amatch>\""
+
+#: ex_docmd.c:8364
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: brak nazwy pliku :source do postawienia pod \"<sfile>\""
+
+#: ex_docmd.c:8405
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Pusta nazwa pliku dla '%' lub '#', dzia³a tylko z \":p:h\""
+
+#: ex_docmd.c:8407
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Wynikiem jest pusty ci±g"
+
+#: ex_docmd.c:9362
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nie mogê otworzyæ pliku viminfo do odczytu"
+
+#: ex_docmd.c:9535
+msgid "E196: No digraphs in this version"
+msgstr "E196: Brak dwugrafów w tej wersji"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Nie mo¿na ':throw' wyj±tków z prefiksem 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Wyj±tek: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Wyj±tek zakoñczony: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Wyj±tek odrzucony: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, wiersz %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Wyj±tek przechwycony: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s zosta³ zawieszony"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s przywrócony"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s odrzucony"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Wyj±tek"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "B³±d i przerwanie"
+
+#: ex_eval.c:754 gui.c:4375
+msgid "Error"
+msgstr "B³±d"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Przerwanie"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: zbyt g³êbokie zagnie¿d¿enie :if"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif bez :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else bez :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif bez :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: wielokrotne :else"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif po :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: zbyt g³êbokie zagnie¿d¿enie :while"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue bez :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break bez :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: zbyt g³êbokie zagnie¿d¿enie :try"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch bez :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch za :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally bez :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: wielokrotne :finally"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry bez :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction poza funkcj±"
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "nazwa znacznika"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " pokrewny plik\n"
+
+#: ex_getln.c:4752
+msgid "'history' option is zero"
+msgstr "opcja 'history' jest zerowa"
+
+#: ex_getln.c:5023
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Historia (od najnowszych po najstarsze):\n"
+
+#: ex_getln.c:5024
+msgid "Command Line"
+msgstr "Wiersz poleceñ"
+
+#: ex_getln.c:5025
+msgid "Search String"
+msgstr "Szukany ci±g"
+
+#: ex_getln.c:5026
+msgid "Expression"
+msgstr "Wyra¿enie"
+
+#: ex_getln.c:5027
+msgid "Input Line"
+msgstr "Wiersz wprowadzeñ"
+
+#: ex_getln.c:5065
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar przekracza d³ugo¶æ polecenia"
+
+#: ex_getln.c:5242
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktywny widok lub bufor skasowany"
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "Niedopuszczalna nazwa pliku"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "jest katalogiem"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "nie jest plikiem"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[Nowy Plik]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[Nie dozwolono]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: Autokomendy *ReadPre zrobi³y plik nieodczytywalnym"
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Autokomendy *ReadPre nie mog± zmieniaæ bie¿±cego bufora"
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Wczytywanie ze stdin...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "Wczytywanie ze stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Plik stworzony poprzez przemianê jest nieodczytywalny!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[brak CR]'"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[znaleziono NL]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[d³ugie wiersze rozdzielane]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[NIE przemienione]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[przemienione]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[zakodowane]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[B£¡D W PRZEMIANIE]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[NIEDOZWOLONY BAJT w wierszu %ld]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[B£ÊDY W ODCZYCIE]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "Nie mogê znale¼æ pliku tymczasowego w celu przemiany"
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "Nieudana przemiana z 'charconvert'"
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "nie mogê odczytaæ wyj¶cia z 'charconvert'"
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autokomendy skasowa³y lub wy³adowa³y bufor przeznaczony do zapisu"
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autokomenda zmieni³a liczbê wierszy w nieoczekiwany sposób"
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans nie pozwala na zapis niezmodyfikowanych buforów"
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "Czê¶ciowy zapis niemo¿liwy dla buforów NetBeans"
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "nie jest plikiem lub zapisywalnym przyrz±dem"
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "jest tylko do odczytu (wymu¶ poprzez !)"
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Nie mogê zapisaæ do pliku zabezpieczenia (wymu¶ przez !)"
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: B³±d podczas zamykania pliku zabezpieczenia (wymu¶ przez !)"
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: Nie mogê odczytaæ pliku w celu zabezpieczenia (wymu¶ przez !)"
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Nie mogê stworzyæ pliku zabezpieczenia (wymu¶ przez !)"
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Nie mogê zrobiæ pliku zabezpieczenia (wymu¶ przez !)"
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Rozdzia³ zasobów zostanie utracony (wymu¶ przez !)"
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nie mogê znale¼æ pliku tymczasowego do zapisania"
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: Nie mogê przemieniæ (u¿yj ! by zapisaæ bez przemiany)"
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Nie mogê otworzyæ pod³±czonego pliku do zapisu"
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: Nie mogê otworzyæ pliku do zapisu"
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: Fsync nie powiód³ siê"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E512: Zamkniêcie siê nie powiod³o"
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: b³±d w zapisie, przemiana siê nie powiod³a"
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: b³±d w zapisie (mo¿e system plików jest przepe³niony?)"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr " B£¡D W PRZEMIANIE"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[Urz±dzenie]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[Nowy]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " do³±czono"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " zapisano"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patchmode: nie mogê zapisaæ oryginalnego pliku"
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nie mogê stworzyæ pustego oryginalnego pliku"
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nie mogê skasowaæ pliku zabezpieczenia"
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"OSTRZE¯ENIE: Oryginalny plik mo¿e zostaæ utracony lub uszkodzony\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "nie wychod¼ edytora, dopóki plik nie zosta³ poprawnie zapisany!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[format dos-a]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[format mac-a]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[format unix-a]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 wiersz, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld wierszy, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znaków"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[Niekompletny ostatni wiersz]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "OSTRZE¯ENIE: Plik zmieni³ siê od czasu ostatniego odczytu!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "Czy naprawdê chcesz go zapisaæ"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: B³±d zapisywania do \"%s\""
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: B³±d w trakcie zamykania \"%s\""
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: B³±d odczytu \"%s\""
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: Autokomenda FileChangedShell skasowa³a bufor"
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: OSTRZE¯ENIE: Plik \"%s\" nie jest d³u¿ej dostêpny"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: OSTRZE¯ENIE: Plik \"%s\" zmieni³ siê od czasu rozpoczêcia edycji, bufor "
+"w Vimie równie¿ zosta³ zmieniony"
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: OSTRZE¯ENIE: Plik \"%s\" zmieni³ siê od czasu rozpoczêcia edycji"
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: OSTRZE¯ENIE: Tryb pliku \"%s\" zmieni³ siê od czasu rozpoczêcia edycji"
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: OSTRZE¯ENIE: Plik \"%s\" zosta³ stworzony po rozpoczêciu edycji"
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "Patrz \":help W11\" dla dalszych informacji."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "OSTRZE¯ENIE"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Za³aduj Plik"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Nie mo¿na przygotowaæ prze³adowania \"%s\""
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Nie mo¿na prze³adowaæ \"%s\""
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--Skasowano--"
+
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Nie ma takiej grupy: \"%s\""
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Niedopuszczalny znak po *: %s"
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Nie ma takiego wydarzenia: %s"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: Nie ma takiej grupy lub wydarzenia: %s"
+
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Autokomendy ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Nie mo¿na wykonywaæ autokomend dla wydarzeñ ALL"
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "Brak pasuj±cych autokomend"
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: zbyt g³êbokie zagnie¿d¿enie autokomend"
+
+#: fileio.c:8088
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Autokomend dla \"%s\""
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "Wykonujê %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "autokomenda %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: Brak {."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: Brak }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Nie znaleziono zwiniêcia"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Nie mo¿na utworzyæ zwiniêcia przy bie¿±cej 'foldmethod'"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Nie mo¿na skasowaæ zwiniêcia przy bie¿±cej 'foldmethod'"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Dodaj do bufora odczytu"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: rekursywne przyporz±dkowanie"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: istnieje ju¿ globalny skrót dla %s"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: istnieje ju¿ globalne przyporz±dkowanie dla %s"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: istnieje ju¿ skrót dla %s"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: istnieje ju¿ przyporz±dkowanie dla %s"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "Nie znaleziono skrótu"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "Nie znaleziono przyporz±dkowania"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Niedopuszczalny tryb"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<nie mogê otworzyæ> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: nie mogê otrzymaæ czcionki %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: nie mogê powróciæ do bie¿±cego katalogu"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Trop:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: nie mogê otrzymaæ bie¿±cego katalogu"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Zakoñcz"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "VIM - Dialog"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: Nie mog³em otrzymaæ rozmiarów rysunku na przycisku."
+
+#: gui_beval.c:101 gui_w32.c:3830
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Nie mogê stworzyæ BalloonEval z powiadomieniem i wywo³aniem"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nie mogê odpaliæ GUI"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nie mogê czytaæ z \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr "E665: Nie mo¿na uruchomiæ GUI, brak prawid³owej czcionki"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: Niew³a¶ciwe 'guifontwide'"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: Nieprawid³owa warto¶æ 'imactivatekey'"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Nie mogê zarezerwowaæ koloru %s"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Dialog Vima..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Tak\n"
+"&Nie\n"
+"&Zakoñcz"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "Input _Methods"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Szukaj i Zamieniaj..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Szukaj..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Znajd¼:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Zamieñ na:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Dopasuj tylko ca³e wyrazy"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Dopasuj wielko¶æ liter"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Kierunek"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "W górê"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "W dó³"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Znajd¼ nastêpne"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Zamieñ"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Zamieñ wszystkie"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: otrzymano ¿±danie \"die\" od manad¿era sesji\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: G³ówne okno nieoczekiwanie zniszczone\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Wybór czcionki"
+
+#: gui_gtk_x11.c:6035 ui.c:2117
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "U¿ywam CUT_BUFFER0 zamiast pustego wyboru"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filtr"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Katalogi"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Pomoc"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Pliki"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Wybór"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Cofnij"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Nie mogê za³adowaæ czcionki Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Nie mogê u¿yæ czcionki %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Wysy³am zawiadomienie koñcz±ce proces pochodny.\n"
+
+#: gui_w32.c:830
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument nie jest wspomagany: \"-%s\"; U¿ywaj wersji OLE."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Znajd¼ ci±g (u¿yj '\\\\' do szukania '\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Szukanie i Zamiana (u¿yj '\\\\' do szukania '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Nie mogê zarezerwowaæ mapy kolorów, pewne kolory mog± byæ "
+"nieprawid³owe"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Brak czcionek dla nastêpuj±cych zestawów znaków w zestawie czcionek %s:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Nazwa zestawu czcionek: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Czcionka '%s' nie posiada znaków jednolitej szeroko¶ci"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Nazwa zestawu czcionek: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "szeroko¶æ font%d nie jest podwójn± szeroko¶ci± font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Szeroko¶æ font0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Szeroko¶æ font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: B£¡D w automacie Hangul"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Dodaj now± bazê danych"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Zapytane o wzorzec"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Poka¿ ten komunikat"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Zabij po³±czenie"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Ponów wszelkie po³±czenia"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Poka¿ po³±czenia"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Zastosowanie: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Ta komenda cscope nie wspomaga podzielenia okna.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Zastosowanie: cstag <ident>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: nie znaleziono znacznika"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) b³±d: %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: b³±d stat"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s nie jest katalogiem lub poprawn± baz± danych cscope"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Dodano bazê danych cscope %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: b³±d odczytu po³±czenia z cscope %ld"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: nieznany typ szukania cscope"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Nie mog³em stworzyæ potoku do cscope"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Nie mog³em utworzyæ rozwidlenia dla cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "wykonanie cs_create_connection nie powiod³o siê"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Nie mog³em stworzyæ procesu cscope"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen dla to_fp nie powiod³o siê"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen dla fr_fp nie powiod³o siê"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: brak po³±czenia z cscope"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: brak dopasowañ dla zapytania cscope %s o %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: nieprawid³owa flaga cscopequickfix %c dla %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "komendy cscope:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (U¿ycie: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: nie mogê otworzyæ bazy danych cscope: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: nie mogê uzyskaæ informacji z bazy danych cscope"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: nie dodano duplikatu bazy danych cscope"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: wyczerpano maksymaln± liczbê po³±czeñ cscope"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: nie ma po³±czenia %s z cscope"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "po³±czenie %s z cscope zosta³o zamkniête"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: b³±d krytyczny w cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Znacznik cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # wiersz"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "nazwa pliku / kontekst / wiersz\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: B³±d cscope: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Wszystkie bazy danych cscope prze³adowano"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "brak po³±czeñ z cscope\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid nazwa bazy danych przedsionek tropu\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Przykro mi, ta komenda jest wy³±czona, bo nie mo¿na za³adowaæ "
+"biblioteki Pythona"
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Nie mo¿na wywo³aæ Pythona rekursywnie"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "nie mogê skasowaæ atrybutów OutputObject"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "softspace musi byæ liczb± ca³kowit±"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "niepoprawny atrybut"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() wymaga listy ci±gów"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: B³±d w inicjalizacji obiektów I/O"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "niepoprawne wyra¿enie"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "wyra¿enia wy³±czone podczas kompilacji"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "próba odniesienia do skasowanego bufora"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "numer wiersza poza zakresem"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<obiekt bufora (skasowany) w %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "niepoprawna nazwa zak³adki"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "nie ma takiego bufora"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "próba odniesienia do skasowanego okna"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "atrybut tylko do odczytu"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "pozycja kursora poza buforem"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<obiekt okna (skasowany) w %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<obiekt okna (nieznany) w %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "nie ma takiego okna"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "nie mogê zachowaæ informacji cofania"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "nie mogê skasowaæ wiersza"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "nie mogê zamieniæ wiersza"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "nie mogê wprowadziæ wiersza"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "ci±g nie mo¿e zawieraæ znaków nowego wiersza"
+
+#: if_ruby.c:422
+msgid "E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E263: Przykro mi, ta komenda jest wy³±czona, bo nie mo¿na za³adowaæ "
+"biblioteki Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Nieznany status longjmp %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prze³±cz miêdzy implementacj±/okre¶leniem"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Poka¿ bazê klasy"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Poka¿ przepisan± funkcjê cz³onkow±"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Pobieraj z pliku"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Pobieraj z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Pobieraj z wszystkich projektów"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Pobierz"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Poka¿ ¼ród³o dla"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Znajd¼ symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Przejrzyj klasê"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Poka¿ klasê w hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Poka¿ klasê w ograniczonej hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odnosi siê do"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ma odniesienia od"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ma"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref u¿yte przez"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Poka¿ dokumentacjê dla"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Wygeneruj dokumentacjê dla"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Nie mogê pod³±czyæ do SNiFF+. Sprawd¼ ¶rodowisko (sniffemacs musi byæ "
+"odnaleziony w $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: B³±d podczas czytania. Roz³±czenie"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ jest obecnie "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "nie "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pod³±czony"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Nieznane zapytanie SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: B³±d w trakcie pod³±czania do SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ niepod³±czony"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Nie jest buforem SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: B³±d w trakcie zapisu. Roz³±czony"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "niew³a¶ciwy numer bufora"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "obecnie nie zaimplementowano"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "nieznana opcja"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "nie mogê ustawiæ wiersza(y)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "zak³adka nie ustawiona"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "wiersz %d kolumna %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "nie mogê wprowadziæ/do³±czyæ wiersza"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "nieznana flaga: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "nieznane vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "przerwanie klawiatury"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "b³±d vima"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nie mogê stworzyæ bufora/okna komendy: obiekt jest kasowany"
+
+#: if_tcl.c:1545
+msgid "cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"nie mogê zarejestrowaæ wstecznego wywo³ania komendy: bufor/okno ju¿ zosta³a "
+"skasowana"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATALNY B£¡D: reflist zepsuta!? Proszê z³o¿yæ raport o tym na vim-"
+"dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"nie mogê zarejestrowaæ wstecznego wywo³ania komendy: brak odniesienia do "
+"bufora/okna"
+
+#: if_tcl.c:1724
+msgid "E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "Przykro mi, ta komenda jest wy³±czona, bo nie mo¿na za³adowaæ biblioteki Tcl."
+
+#: if_tcl.c:1886
+msgid "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: B£¡D TCL: kod zakoñczeniowy nie jest ca³kowity!? Proszê z³o¿yæ raport "
+"o tym na vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "nie mogê dostaæ wiersza"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Nie mogê zarejestrowaæ nazwy serwera komend"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Wys³anie komendy do programu docelowego nie powiod³o siê"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: U¿yto niew³a¶ciwego id serwera: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: wcielenia instancji rejestru Vima jest ¼le sformowane. Skasowano!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Nieznana opcja"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Zbyt wiele argumentów"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Brak argumentu po"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "¦miecie po opcji"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr "Zbyt wiele argumentów \"+komenda\", \"-c komenda\" lub \"--cmd komenda\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Niew³a¶ciwy argument dla"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Ta wersja Vima nie by³a skompilowanego z opcj± ró¿nic (diff)."
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "Próba ponownego otworzenia pliku skryptu: \""
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "Nie mogê otworzyæ do odczytu: \""
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "Nie mogê otworzyæ dla wyj¶cia skryptu: \""
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d plików do edycji\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: OSTRZE¯ENIE: Wyj¶cie nie jest terminalem\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: OSTRZE¯ENIE: Wej¶cie nie pochodzi z terminala\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "linia poleceñ pre-vimrc"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nie mogê czytaæ z \"%s\""
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Dalsze informacje poprzez: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[plik ..] edytuj zadane pliki"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- czytaj tekst ze stdin"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t znacznik edytuj plik, w którym dany znacznik jest zdefiniowany"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] edytuj plik, zawieraj±cy pierwszy b³±d"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"u¿ycie:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [argumenty]"
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" lub:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tTylko nazwy plików po tym"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tNie rozwijaj znaków specjalnych"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tZarejestruj tego gvima w OLE"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tWyrejestruj gvima z OLE"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tStartuj w GUI (tak jak \"gvim\")"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f lub --nofork\tPierwszy plan: Nie wydzielaj przy odpalaniu GUI"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tTryb vi (jak \"vi\")"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tTryb ex (jak \"ex\")"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tCichy tryb (t³a) (tylko dla \"ex\")"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tTryb ró¿nic (jak \"vimdiff\")"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tTryb ³atwy (jak \"evim\", bez trybów)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tTryb wy³±cznie do odczytu (jak \"view\")"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tTryb ograniczenia (jak \"rvim\")"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModyfikacje (zapisywanie plików) niedozwolone"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZakaz modyfikacji tekstu"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tTryb binarny"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tTryb lisp"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tB±d¼ zgodny z Vi: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tB±d¼ niezupe³nie zgodny z Vi: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tStopieñ gadatliwo¶ci"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tTryb odpluskwiania"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tZamiast pliku wymiany, u¿ywaj tylko pamiêci"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tWylicz pliki wymiany i zakoñcz"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (z nazw± pliku)\tOdtwórz za³aman± sesjê"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tTo¿same z -r"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNie stosuj newcli do otwierania okien"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tU¿ywaj <device> do I/O"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\trozpocznij w trybie arabskim"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\trozpocznij w trybie hebrajskim"
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\trozpocznij w trybie farsi"
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tUstaw typ terminala na <terminal>"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tU¿yj <vimrc> zamiast jakiegokolwiek .vimrc"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tU¿yj <gvimrc> zamiast jakiegokolwiek .gvimrc"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNie ³aduj skryptów wtyczek"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtwórz N okien (domy¶lnie: po jednym dla ka¿dego pliku)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\ttak samo jak -o tylko dziel okno pionowo"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tZacznij na koñcu pliku"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tZacznij w wierszu <lnum>"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr ""
+"-cmd <command>\t\tWykonaj komendê <command> przed za³adowaniem "
+"jakiegokolwiek pliku vimrc"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\tWykonaj komendê <command> po za³adowaniu pierwszego pliku"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <sesja>\t\tWczytaj plik <sesja> po za³adowaniu pierwszego pliku"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\tWczytuj komendy trybu normalnego z pliku <scriptin>"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tDo³±cz wszystkie wprowadzane komendy do pliku <scriptout>"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tZapisuj wszystkie wprowadzane komendy do pliku <scriptout>"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tEdytuj zakodowane pliki"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tPod³±cz vima to danego X-serwera"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNie ³±cz z serwerem X"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <pliki>\tEdytuj pliki w serwerze Vima je¶li mo¿liwe"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <pliki> To samo, nie narzekaj je¶li nie ma serwera"
+
+#: main.c:2546
+msgid "--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <pliki>\tTak jak --remote, lecz czekaj na pliki przed edycj±"
+
+#: main.c:2547
+msgid "--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-wait-silent <pliki> To samo, nie narzekaj je¶li nie ma serwera"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <klawisze>\tWy¶lij <klawisze> do serwera Vima i zakoñcz"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <wyr>\tWykonaj <wyra¿enie> w serwerze i wypisz wynik"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tWymieñ nazwy dostêpnych serwerów Vima i zakoñcz"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <nazwa>\t\tOdsy³aj do/stañ siê serwerem Vim <nazwa>"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tU¿ywaj <viminfo> zamiast .viminfo"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h lub --help\twy¶wietl Pomoc (czyli tê wiadomo¶æ) i zakoñcz"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\twy¶wietl informacjê o wersji i zakoñcz"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja Motif):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja neXtaw):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja Athena):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tZa³aduj vim na <display>"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tZacznij Vim jako ikonê"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <nazwa>\t\tU¿ywaj zasobów tak jak by Vim by³ <nazwa>"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Niezaimplementowane)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <kolor>\tU¿ywaj <kolor> dla t³a (równie¿: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <kolor>\tU¿ywaj <kolor> dla normalnego tekstu (równie¿: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t\tU¿ywaj <font> dla normalnego tekstu (równie¿: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tU¿ywaj <font> dla wyt³uszczonego tekstu"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tU¿ywaj <font> dla pochy³ego"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tU¿ywaj <geom> dla pocz±tkowych rozmiarów (równie¿: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <szer>\tU¿yj ramki o grubo¶ci <szer> (równie¿: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <szer> U¿ywaj przewijacza o szeroko¶ci <szer> (równie¿: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tStosuj belkê menu o wysoko¶ci <height> (równie¿: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tStosuj negatyw kolorów (równie¿: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNie stosuj negatywu kolorów (równie¿: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tUstaw okre¶lony zasób"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja RISC OS):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\tPocz±tkowa szeroko¶æ okna w kolumnach"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\tPocz±tkowa wysoko¶æ okna w wierszach"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumenty rozpoznawane przez gvim (wersja GTK+):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tZastartuj vim na <display> (równie¿: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\tUstaw unikatow± rolê do identyfikacji g³ównego okna"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtwórz Vim wewn±trz innego widgetu GTK"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <tytu³ rodzica>\tOtwórz Vima wewn±trz rodzicielskiej aplikacji"
+
+#: main.c:2847
+msgid "No display"
+msgstr "Brak display"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": Wys³anie nie powiod³o siê.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Wys³anie nie powiod³o siê. Próbujê wykonaæ na miejscu\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "otworzono %d z %d"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "Brak terminala: Wys³anie wyra¿enia nie powiod³o siê.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Wys³anie wyra¿enia nie powiod³o siê.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "Brak zak³adek"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: ¯adna zak³adka nie pasuje do \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"zak³. wiersz kol plik/tekst"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok wiersz kol plik/tekst"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"zmieñ wrsz. kol tekst"
+
+#: mark.c:1281
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Zak³adki w plikach:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Lista odniesieñ (pocz±wszy od najnowszych):\n"
+
+#: mark.c:1412
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historia zak³adek w plikach (od najnowszych po najstarsze):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Brak '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: To nie jest wa¿na strona kodowa"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nie mogê nastawiæ warto¶ci IC"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: Nie mog³em stworzyæ kontekstu wprowadzeñ"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Nie mog³em otworzyæ sposobu wprowadzeñ"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: OSTRZE¯ENIE: Nie mog³em zlikwidowaæ wywo³ania dla IM"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: metoda wprowadzeñ nie wspomaga ¿adnego stylu"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: metoda wprowadzeñ nie wspomaga mojego typu preedit"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: styl nadpunktowy wymaga +fontset"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Twój GTK+ jest starszy ni¿ 1.2.3. Pole statusu wy³±czono"
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Serwer metod wprowadzeñ nie jest uruchomiony"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: blok nie by³ zablokowany"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: B³±d w trakcie czytania pliku wymiany"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: B³±d odczytu pliku wymiany"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: B³±d szukania w pliku wymiany"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: B³±d zapisu w pliku wymiany"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Plik wymiany ju¿ istnieje (atak symlink?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nie otrzyma³em bloku nr 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nie otrzyma³em bloku nr 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Nie otrzyma³em bloku nr 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ojej, zgubi³em plik wymiany!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nie mog³em zmieniæ nazwy pliku wymiany"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nie mogê otworzyæ pliku wymiany dla \"%s\"; odtworzenie niemo¿liwe"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Nie otrzyma³em bloku 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Nie znaleziono pliku wymiany dla %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Wprowad¼ numer pliku wymiany, którego u¿yæ (0 by wyj¶æ): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nie mogê otworzyæ %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nie mogê odczytaæ bloku 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Mo¿e nie wykonano zmian albo Vim nie zaktualizowa³ pliku wymiany."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nie mo¿e byæ stosowany z t± wersj± Vima.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "U¿yj Vima w wersji 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s nie wygl±da na plik wymiany Vima"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nie mo¿e byæ stosowany na tym komputerze.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Ten plik zosta³ stworzony na "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"lub plik zosta³ uszkodzony."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "U¿ywam pliku wymiany \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Oryginalny plik \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: OSTRZE¯ENIE: Oryginalny plik móg³ byæ zmieniony"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nie mogê odczytaæ bloku 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???BRAKUJE WIELU WIERSZY"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???LICZNIK WIERSZY NIEZGODNY"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PUSTY BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???BRAKUJE WIERSZY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: Niew³a¶ciwe ID bloku 1 (mo¿e %s nie jest plikiem .swp?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???BRAK BLOKU"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? od tego miejsca po ???KONIEC wiersze mog± byæ pomieszane"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? od tego miejsca po ???KONIEC wiersze mog± byæ w³o¿one/skasowane"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONIEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Przerwanie odtwarzania"
+
+#: memline.c:1148
+msgid "E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: Wykryto b³êdy podczas odtwarzania; od których wierszy zacz±æ ???"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "Patrz \":help E312\" dla dalszych informacji."
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Odtwarzanie zakoñczono. Powiniene¶ sprawdziæ czy wszystko jest w porz±dku."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Mo¿esz chcieæ zapisaæ ten plik pod inn± nazw±\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "i wykonaæ diff z oryginalnym plikiem aby sprawdziæ zmiany)\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Skasuj potem plik .swp.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "Znalezione pliki wymiany:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " W bie¿±cym katalogu:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " U¿ywam podanej nazwy:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " W katalogu "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ¿aden --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " posiadany przez: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " data: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " data: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [po Vimie wersja 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [nie wygl±da na plik wymiany Vima]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " nazwa pliku: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" zmieniono: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "TAK"
+
+#: memline.c:1525
+msgid "no"
+msgstr "nie"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" u¿ytkownik: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " nazwa hosta: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" nazwa hosta: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (dalej dzia³a)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nie nadaje siê dla tej wersji Vima]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nie do u¿ytku na tym komputerze]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [nieodczytywalny]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [nieotwieralny]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nie mogê zabezpieczyæ, bo brak pliku wymiany"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "Plik zabezpieczono"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: Nieudane zabezpieczenie"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: niew³a¶ciwy lnum: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nie znaleziono wiersza %ld"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: niepoprawne id wska¼nika bloku 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "stack_idx powinien byæ 0"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Zaktualizowano zbyt wiele bloków?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: niepoprawne id wska¼nika bloku 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "blok nr 1 skasowany?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nie mogê znale¼æ wiersza %ld"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: niepoprawne id bloku odniesienia"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "pe_line_count wynosi zero"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: numer wiersza poza zakresem: %ld jest poza koñcem"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: liczba wierszy niepoprawna w bloku %ld"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "Wielko¶æ stosu wzrasta"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: niepoprawne id bloku odniesienia 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: UWAGA"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Znalaz³em plik wymiany o nazwie \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "Podczas otwierania pliku \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " NOWSZE od pliku wymiany!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Pewnie inny program obrabia ten sam plik.\n"
+" Je¶li tak, b±d¼ ostro¿ny, aby nie skoñczyæ z dwoma\n"
+" ró¿nymi wersjami jednego tego samego pliku po zmianach.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " Zakoñcz lub ostro¿nie kontynuuj.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Sesja edycji dla pliku za³ama³a siê.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Je¶li tak, to u¿yj \":recover\" lub \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" aby odzyskaæ zmiany (patrz \":help recovery)\").\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " Je¶li ju¿ to zrobi³e¶, usuñ plik wymiany \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" aby unikn±æ tej wiadomo¶ci.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "Plik wymiany \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" ju¿ istnieje!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - UWAGA"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "Plik wymiany ju¿ istnieje!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&Otwórz Read-Only\n"
+"&Edytuj pomimo\n"
+"O&dtwórz\n"
+"&Zakoñcz\n"
+"&Porzuæ"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&Otwórz Read-Only\n"
+"&Edytuj pomimo\n"
+"O&dtwórz\n"
+"&Zakoñcz\n"
+"&Porzuæ\n"
+"&Skasuj go"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: Znaleziono zbyt wiele plików wymiany"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Czê¶æ tropu punktu menu nie okre¶la podmenu"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Menu istnieje tylko w innym trybie"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Nie ma menu o tej nazwie"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Trop menu nie mo¿e prowadziæ do podmenu"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Nie wolno dodawaæ punktów menu wprost do paska menu"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Separator nie mo¿e byæ czê¶ci± tropu menu"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menu ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Oderwij to menu"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Trop menu musi prowadziæ do punktu menu"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Nie znaleziono menu: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Menu nie jest zdefiniowane dla trybu %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Trop menu musi prowadziæ do podmenu"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Nie znaleziono menu - sprawd¼ nazwy menu"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Wykryto b³±d podczas przetwarzania %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "wiersz %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[ci±g zbyt d³ugi]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"Opiekun komunikatów: Marcin Dalecki <dalecki@cs.net.pl>, Miko³aj Machowski "
+"<mikmach@wp.pl>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Przerwanie: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "Naci¶nij ENTER aby kontynuowaæ"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Naci¶nij ENTER lub wprowad¼ komendê aby kontynuowaæ"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Wiêcej --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: wiersz, SPACE/b: stronê, d/u: pó³ strony, q: zakoñcz)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: wiersz, SPACE: stronê, d: pó³ strony, q: zakoñczenie)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "Pytanie"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Tak\n"
+"&Nie"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Tak\n"
+"&Nie\n"
+"Zapisz &wszystkie\n"
+"&Odrzuæ wszystkie\n"
+"&Zakoñcz"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "Dialog zapisywania pliku"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "Dialog otwierania pliku"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Przykro mi, nie ma przegl±darki plików w trybie konsoli"
+
+#: misc1.c:2754
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: OSTRZE¯ENIE: Zmiany w pliku tylko do odczytu"
+
+#: misc1.c:3002
+msgid "1 more line"
+msgstr "1 wiersz wiêcej"
+
+#: misc1.c:3004
+msgid "1 line less"
+msgstr "1 wiersz mniej"
+
+#: misc1.c:3009
+#, c-format
+msgid "%ld more lines"
+msgstr "dodano %ld wierszy"
+
+#: misc1.c:3011
+#, c-format
+msgid "%ld fewer lines"
+msgstr "usuniêto %ld wierszy"
+
+#: misc1.c:3014
+msgid " (Interrupted)"
+msgstr " (Przerwane)"
+
+#: misc1.c:7563
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachowujê plik...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7573
+msgid "Vim: Finished.\n"
+msgstr "Vim: Zakoñczono.\n"
+
+#: misc2.c:695 misc2.c:711
+msgid "ERROR: "
+msgstr "B£¡D: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtów] totalne alokacje-zwolnienia %lu-%lu, w u¿ytku %lu, maksymalne "
+"u¿ycie %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[wywo³ania] wszystkich re/malloc()-ów %lu, wszystkich free()-ów %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: Wiersz staje siê zbyt d³ugi"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Wewnêtrzny b³±d: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Brak pamiêci! (rezerwacja %lu bajtów)"
+
+#: misc2.c:2593
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Wywo³ujê pow³okê do wykonania: \"%s\""
+
+#: misc2.c:2815
+msgid "E545: Missing colon"
+msgstr "E545: Brak dwukropka"
+
+#: misc2.c:2817 misc2.c:2844
+msgid "E546: Illegal mode"
+msgstr "E546: Niedozwolony tryb"
+
+#: misc2.c:2883
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Niedozwolony obrys myszki"
+
+#: misc2.c:2923
+msgid "E548: digit expected"
+msgstr "E548: oczekiwano cyfry"
+
+#: misc2.c:2928
+msgid "E549: Illegal percentage"
+msgstr "E459: Niedozwolony procent"
+
+#: misc2.c:3238
+msgid "Enter encryption key: "
+msgstr "Wprowad¼ klucz do odkodowania: "
+
+#: misc2.c:3239
+msgid "Enter same key again: "
+msgstr "Wprowad¼ ponownie ten sam klucz: "
+
+#: misc2.c:3249
+msgid "Keys don't match!"
+msgstr "Klucze nie pasuj± do siebie!"
+
+#: misc2.c:3798
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Niew³a¶ciwy trop: '**[numer]' musi byæ na koñcu tropu lub po nim musi "
+"byæ '%s'."
+
+#: misc2.c:5077
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Nie mogê znale¼æ katalogu \"%s\" w cdpath"
+
+#: misc2.c:5080
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Nie mogê znale¼æ pliku \"%s\" w tropie"
+
+#: misc2.c:5086
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Katalogu \"%s\" nie ma wiêcej w cdpath"
+
+#: misc2.c:5089
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Pliku \"%s\" nie ma wiêcej w tropie"
+
+#: misc2.c:5323
+msgid "E550: Missing colon"
+msgstr "E550: Brak dwukropka"
+
+#: misc2.c:5335
+msgid "E551: Illegal component"
+msgstr "E551: Niedozwolona czê¶æ"
+
+#: misc2.c:5343
+msgid "E552: digit expected"
+msgstr "E552: oczekiwano cyfry"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Nie mo¿na po³±czyæ z Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Nie mo¿na po³±czyæ z Netbeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr "E668: B³êdny tryb dostêpu pliku info po³±czenia NetBeans: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "odczyt z gniazda Netbeans"
+
+#: netbeans.c:1638
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Bufor %ld utraci³ po³±czenie z NetBeans"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "OSTRZE¯ENIE: terminal nie wykonuje pod¶wietlania"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: Brak ci±gu pod kursorem"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: Brak identyfikatora pod kursorem"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Nie mogê skasowaæ zwiniêcia z bie¿±c± 'foldmethod'"
+
+#: normal.c:6740
+msgid "E662: At start of changelist"
+msgstr "E662: Na pocz±tku listy zmian"
+
+#: normal.c:6742
+msgid "E663: At end of changelist"
+msgstr "E663: Na koñcu listy zmian"
+
+#: normal.c:8003
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "wprowad¼ :quit<Enter> zakoñczenie programu"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 wiersz %sed 1 raz"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 wiersz %sed %d razy"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld wierszy %sed 1 raz"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld wierszy %sed %d razy"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld wierszy do wciêcia... "
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "1 wiersz wciêty "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld wierszy wciêtych "
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "nie mogê skopiowaæ, mimo to kasujê"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "1 wiersz zmieniono"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld wierszy zmieniono"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "zwalniam %ld wierszy"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "1 wiersz przekopiowano"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld wierszy przekopiowanych"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Pusty rejestr %s"
+
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Rejestry ---"
+
+#: ops.c:5073
+msgid "Illegal register name"
+msgstr "Niedozwolona nazwa rejestru"
+
+#: ops.c:5161
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Rejestry:\n"
+
+#: ops.c:5211
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Nieznany typ rejestru %d"
+
+#: ops.c:5696
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Niew³a¶ciwa nazwa rejestru: '%s'"
+
+#: ops.c:6056
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Kolumn; "
+
+#: ops.c:6063
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Wybrano %s%ld z %ld Wierszy; %ld z %ld S³ów; %ld z %ld Bajtów"
+
+#: ops.c:6079
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Kol %s z %s; Wiersz %ld z %ld; S³owo %ld z %ld; Bajt %ld z %ld"
+
+#: ops.c:6090
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld dla BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Strona %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Dziêki za lot Vimem"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Nieznana opcja"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Opcja nie jest wspomagana"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Niedozwolone w modeline"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tOstatnie ustawienie przez "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Po = wymagany jest numer"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: Nie znaleziono w termcap"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Niedozwolony znak <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Nie mogê ustawiæ 'term' na pusty ci±g"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Nie mogê zmieniæ term w GUI"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: U¿yj \":gui\" do odpalenia GUI"
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' i 'patchmode' s± to¿same"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Nie mogê zmieniæ w GTK+2 GUI"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Brak dwukropka"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Ci±g o zerowej d³ugo¶ci"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Brak numeru po <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Brak przecinka"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Musi okre¶laæ warto¶æ '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: zawiera niewy¶wietlalny lub szeroki znak"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Niedozwolona czcionka/ki"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: nie mogê wybraæ zestawu czcionek"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: Niedozwolony zestaw czcionek"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: nie mogê wybraæ szerokiej czcionki"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: Niedozwolona szeroka czcionka"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Niedozwolony znak po <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: wymagany przecinek"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' musi byæ pusty lub zawieraæ %s"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: Brak wspomagania myszki"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Niedomkniêty ci±g wyra¿eñ"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: zbyt wiele elementów"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: niezbalansowane grupy"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: okno podgl±du ju¿ istnieje"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: Arabski wymaga UTF-8, zrób ':set encoding=utf-8'"
+
+#: option.c:6783
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Potrzebujê przynajmniej %d wierszy"
+
+#: option.c:6793
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Potrzebujê przynajmniej %d kolumn"
+
+#: option.c:7100
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Nieznana opcja: %s"
+
+#: option.c:7220
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kody terminala ---"
+
+#: option.c:7222
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Globalne warto¶ci opcji ---"
+
+#: option.c:7224
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Lokalne warto¶ci opcji ---"
+
+#: option.c:7226
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Opcje ---"
+
+#: option.c:7932
+msgid "E356: get_varp ERROR"
+msgstr "E356: B£¡D get_varp"
+
+#: option.c:8903
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Brak pasuj±cego znaku dla %s"
+
+#: option.c:8937
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Dodatkowe znaki po ¶redniku: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "nie mogê otworzyæ "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nie mogê otworzyæ okna!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Potrzebujê Amigados w wersji 2.04 lub pó¼niejsz±\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Potrzebujê %s w wersji %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "Nie mogê otworzyæ NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Nie mogê stworzyæ "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim koñczy pracê z %d\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "nie mogê zmieniæ trybu konsoli ?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: nie jest konsol±??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nie mogê wykonaæ pow³oki z opcj± -f"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "Nie mogê wykonaæ "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "pow³oka "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " zwróci³\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE zbyt niskie."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "B£¡D I/O"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(obciêty)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' nie wynosi 80, nie mogê wykonaæ zewnêtrznych komend"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E237: Wybór drukarki nie powiód³ siê"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "do %s z %s"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Nieznana czcionka drukarki: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: B³±d drukarki: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "Nieznane"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "Wydrukowano '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Niedozwolona nazwa zestawu znaków \"%s\" w nazwie czcionki \"%s\""
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Niedozwolony znak '%c' w nazwie czcionki \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Niew³a¶ciwa opcja 'osfiletype' - u¿ywam Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Podwójny sygna³, wychodzê\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Za³apa³ ¶miertelny sygna³ %s\n"
+
+#: os_unix.c:936
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Za³apa³ ¶miertelny sygna³\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Otwieranie ekranu X trwa³o %ld msec"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Dosta³ b³±d X\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "Test ekranu X nie powiód³ siê"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "Próba otwarcia ekranu X trwa³a zbyt d³ugo"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Nie mogê wykonaæ pow³oki "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nie mogê wykonaæ pow³oki sh\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"pow³oka zwróci³a "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nie mogê stworzyæ potoków\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Nie mogê rozdzieliæ siê\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Komenda zakoñczona\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP straci³ po³±czenie ICE"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "Otwarcie ekranu X nie powiod³o siê"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP obs³uguje ¿±danie samozapisu"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP otwiera po³±czenie"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "Obserwacja po³±czenia XSMP ICE nie powiod³a siê"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection nie powiod³o siê: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "W wierszu"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Nie mogê zarezerwowaæ pamiêci dla linii poleceñ."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "B³±d VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Nie mogê za³adowaæ vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nie zdo³a³em poprawiæ wska¼ników funkcji w DLL!"
+
+#: os_win16.c:342 os_win32.c:3197
+#, c-format
+msgid "shell returned %d"
+msgstr "pow³oka zwróci³a %d"
+
+#: os_win32.c:2655
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Za³apa³ wydarzenie %s\n"
+
+#: os_win32.c:2657
+msgid "close"
+msgstr "zamknij"
+
+#: os_win32.c:2659
+msgid "logoff"
+msgstr "wyloguj"
+
+#: os_win32.c:2660
+msgid "shutdown"
+msgstr "zakoñcz"
+
+#: os_win32.c:3150
+msgid "E371: Command not found"
+msgstr "E371: Nie znaleziono komendy"
+
+#: os_win32.c:3163
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE nie znaleziono w twoim $PATH.\n"
+"Zewnêtrzne komendy nie bêd± wstrzymane po wykonaniu.\n"
+"Patrz :help wim32-vimrun aby otrzymaæ wiêcej informacji."
+
+#: os_win32.c:3166
+msgid "Vim Warning"
+msgstr "Vim Ostrze¿enie"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Zbyt wiele %%%c w ci±gu formatuj±cym"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Nieoczekiwane %%%c w ci±gu formatuj±cym"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Brak ] w ci±gu formatuj±cym"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Niewspomagane %%%c w ci±gu formatuj±cym"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Niepoprawne %%%c w prefiksie ci±gu formatuj±cego"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Niepoprawne %%%c w ci±gu formatuj±cym"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' nie zawiera wzorca"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Pusta nazwa katalogu lub jej brak"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Nie ma wiêcej elementów"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d z %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (wiersz skasowany)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Na dole stosu quickfix"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Na górze stosu quickfix"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "lista b³êdów %d z %d; %d b³êdów"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nie mogê zapisaæ, opcja 'buftype' jest ustawiona"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: Niew³a¶ciwy element w %s%%[]"
+
+#: regexp.c:840
+msgid "E339: Pattern too long"
+msgstr "E339: Zbyt d³ugi wzorzec"
+
+#: regexp.c:1011
+msgid "E50: Too many \\z("
+msgstr "E50: Zbyt wiele \\z("
+
+#: regexp.c:1022
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Zbyt wiele %s("
+
+#: regexp.c:1079
+msgid "E52: Unmatched \\z("
+msgstr "E52: Niesparowany \\z("
+
+#: regexp.c:1083
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Niesparowany %s%%("
+
+#: regexp.c:1085
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Niesparowany %s("
+
+#: regexp.c:1090
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Niesparowany %s)"
+
+#: regexp.c:1260
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: operand %s* móg³ byæ pusty"
+
+#: regexp.c:1263
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: operand %s+ móg³ byæ pusty"
+
+#: regexp.c:1318
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: niedozwolony znak po %s@"
+
+#: regexp.c:1346
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: operand %s{ móg³ byæ pusty"
+
+#: regexp.c:1356
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Zbyt wiele z³o¿onych %s{...}"
+
+#: regexp.c:1372
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Zagnie¿d¿one %s*"
+
+#: regexp.c:1375
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Zagnie¿d¿one %s%c"
+
+#: regexp.c:1493
+msgid "E63: invalid use of \\_"
+msgstr "E63: Niedozwolone u¿ycie \\_"
+
+#: regexp.c:1538
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c po niczym"
+
+#: regexp.c:1594
+msgid "E65: Illegal back reference"
+msgstr "E65: Niew³a¶ciwe odwo³anie wsteczne"
+
+#: regexp.c:1607
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( jest niedozwolone w tym miejscu"
+
+#: regexp.c:1626
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 i podobne s± niedozwolone w tym miejscu"
+
+#: regexp.c:1637
+msgid "E68: Invalid character after \\z"
+msgstr "E68: niedopuszczalny znak po \\z"
+
+#: regexp.c:1686
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Brak ] po %s%%["
+
+#: regexp.c:1702
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Pusty %s%%[]"
+
+#: regexp.c:1762
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Niedozwolony znak po %s%%"
+
+#: regexp.c:2559
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: B³±d sk³adni w %s{...}"
+
+#: regexp.c:2865 regexp.c:3018
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Przechwycono za³amanie; regexp zbyt z³o¿ony?"
+
+#: regexp.c:3006 regexp.c:3015
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: wzorzec spowodowa³ b³±d out-of-stack"
+
+#: regexp.c:3260
+msgid "External submatches:\n"
+msgstr "Zewnêtrzne poddopasowania:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld wierszy zwiniêto "
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " V-ZAMIANA"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " ZAMIANA"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " NEGATYW"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " WPROWADZANIE"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (wprowadzanie)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (zamiana)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (v-zamiana)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Hebrajski"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " Arabski"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (jêzyk)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (wklejanie)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " WIZUALNY"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " WIZUALNY LINIOWY"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " WIZUALNY BLOKOWY"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " ZAZNACZANIE"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " ZAZNACZANIE LINIOWE"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " ZAZNACZANIE BLOKOWE"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "zapis"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "szukanie dobi³o GÓRY; kontynuacja od KOÑCA"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "szukanie dobi³o KOÑCA; kontynuacja od GÓRY"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Niew³a¶ciwy ci±g do szukania: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: szukanie dobi³o GÓRY bez znalezienia: %s"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: szukanie dobi³o KOÑCA bez znalezienia : %s"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Oczekujê '?' lub '/' po ';'"
+
+#: search.c:3758
+msgid " (includes previously listed match)"
+msgstr " (zawiera poprzednio wymienione dopasowanie)"
+
+#. cursor at status line
+#: search.c:3778
+msgid "--- Included files "
+msgstr "--- Zawarte pliki "
+
+#: search.c:3780
+msgid "not found "
+msgstr "nie znaleziono"
+
+#: search.c:3781
+msgid "in path ---\n"
+msgstr "w tropie ---\n"
+
+#: search.c:3820
+msgid " (Already listed)"
+msgstr " (Ju¿ wymienione)"
+
+#: search.c:3822
+msgid " NOT FOUND"
+msgstr " NIE ZNALEZIONO"
+
+#: search.c:3874
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Przegl±d w³±czonego pliku: %s"
+
+#: search.c:4092
+msgid "E387: Match is on current line"
+msgstr "E387: Wzorzec pasuje w bie¿±cym wierszu"
+
+#: search.c:4235
+msgid "All included files were found"
+msgstr "Wszelkie w³±czane pliki odnaleziono"
+
+#: search.c:4237
+msgid "No included files"
+msgstr "Brak w³±czanych plików"
+
+#: search.c:4253
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nie znalaz³em definicji"
+
+#: search.c:4255
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nie znalaz³em wzorca"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Niedozwolony argument: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Nie ma takiego klastra sk³adni: %s"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "Brak elementów sk³adni okre¶lonych dla tego bufora"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "synchronizacja komentarzy w stylu C"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "brak synchronizacji"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "pocz±tek synchronizacji"
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " wierszy przed górn± lini±"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Elementy synchronizacji sk³adni ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizujê na elementach"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Elementy sk³adni ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Nie ma takiego klastra sk³adni: %s"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "minimalnie "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "maksymalnie "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; pasuje "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr "znaków nowego wiersza"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here niedozwolone w tym miejscu"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Nie znalaz³em elementów regionu dla %s"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: argument contains niedozwolony w tym miejscu"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: argument containedin niedozwolony w tym miejscu"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Wymagana nazwa pliku"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Brak '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Za ma³o argumentów: syntax region %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Brak specyfikacji klastra"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Brak ogranicznika wzorca: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: ¦mieci po wzorcu: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax sync: wielokrotnie podane wzorce kontynuacji wiersza"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Niedozwolone argumenty: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Brak znaku równo¶ci: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Pusty argument: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s jest niedozwolone w tym miejscu"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musi byæ pierwsze w li¶cie contains"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Nieznana nazwa grupy: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Niew³a¶ciwa podkomenda :syntax : %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: nie znaleziono grupy pod¶wietlania: %s"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Zbyt ma³o argumentów: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Zbyt wiele argumentów: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: grupa ma ustawienia; zignorowane pod³±czenie pod¶wietlania"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: nieoczekiwany znak równo¶ci: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: brak znaku równo¶ci: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: brak argumentu: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Niedozwolona warto¶æ: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: Kolor FG nieznany"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: Kolor BG nieznany"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Nazwa lub liczba koloru nierozpoznana: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: za d³ugi kod terminala: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Niedozwolony argument: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Zbyt wiele ró¿nych atrybutów podkre¶lania w u¿yciu"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Niedrukowalny znak w nazwie grupy"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: nieprawid³owy znak w nazwie grupy"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: na dole stosu znaczników"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: na górze stosu znaczników"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Nie mo¿na przej¶æ przed pierwszy pasuj±cy znacznik"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: nie znaleziono znacznika: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # pri rodzaj znacznik"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "plik\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Wprowad¼ nr wyboru (<CR> przerywa): "
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: Pasuje tylko jeden znacznik"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Nie mo¿na przej¶æ za ostatni pasuj±cy znacznik"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Plik \"%s\" nie istnieje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "znacznik %d z %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " lub wiêcej"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " U¿ywam znacznika o odmiennej wielko¶ci liter!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Plik \"%s\" nie istnieje"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # DO znacznik OD wiersza w pliku/tek¶cie"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Szukam w pliku znaczników %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Trop szukania pliku znaczników obciêty dla %s\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: B³±d formatu w pliku znaczników \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Przed bajtem %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Plik znaczników nieuporz±dkowany: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: Brak pliku znaczników"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nie mogê znale¼æ wzorca znacznika"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Nie znalaz³em znacznika - tylko zgadujê!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' nieznany. Mo¿liwe typy wbudowanych terminali:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "domy¶lnie jest '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Nie mogê otworzyæ pliku termcap"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Nie ma opisu takiego terminala w terminfo"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Nie ma opisu takiego terminala w termcap"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Brak opisu \"%s\" w termcap"
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: wymagana zdolno¶æ \"cm\" terminala"
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klawisze terminala ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "uruchomiono now± pow³okê\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: B³±d podczas wczytywania wej¶cia, koñczê...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "Cofniêcie niemo¿liwe; mimo to kontynuujê"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: niew³a¶ciwe numery wierszy"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "1 zmiana"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "%ld zmian"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: uszkodzona lista cofania"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: brak wiersza cofania"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:1769
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitowa wersja GUI dla MS-Windows"
+
+#: version.c:1771
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitowa wersja GUI dla MS-Windows"
+
+#: version.c:1774
+msgid " in Win32s mode"
+msgstr " w trybie Win32s"
+
+#: version.c:1776
+msgid " with OLE support"
+msgstr " ze wspomaganiem OLE"
+
+#: version.c:1779
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitowa wersja na konsolê dla MS-Windows"
+
+#: version.c:1783
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitowa wersja dla MS-Windows"
+
+#: version.c:1787
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitowa wersja dla MS-DOS"
+
+#: version.c:1789
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitowa wersja dla MS-DOS"
+
+#: version.c:1795
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"wersja dla MacOS X (unix)"
+
+#: version.c:1797
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"wersja dla MacOS X"
+
+#: version.c:1800
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"wersja dla MacOS"
+
+#: version.c:1805
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"wersja dla RISC OS"
+
+#: version.c:1815
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Zadane ³aty: "
+
+#: version.c:1841 version.c:2209
+msgid "Modified by "
+msgstr "Zmieniony przez "
+
+#: version.c:1848
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Skompilowany "
+
+#: version.c:1851
+msgid "by "
+msgstr "przez "
+
+#: version.c:1863
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Olbrzymia wersja "
+
+#: version.c:1866
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Du¿a wersja "
+
+#: version.c:1869
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normalna wersja "
+
+#: version.c:1872
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Ma³a wersja "
+
+#: version.c:1874
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Malutka wersja "
+
+#: version.c:1880
+msgid "without GUI."
+msgstr "bez GUI."
+
+#: version.c:1885
+msgid "with GTK2-GNOME GUI."
+msgstr "z GTK2-GNOME GUI."
+
+#: version.c:1887
+msgid "with GTK-GNOME GUI."
+msgstr "z GTK-GNOME GUI."
+
+#: version.c:1891
+msgid "with GTK2 GUI."
+msgstr "z GTK2 GUI."
+
+#: version.c:1893
+msgid "with GTK GUI."
+msgstr "z GTK GUI."
+
+#: version.c:1898
+msgid "with X11-Motif GUI."
+msgstr "z X11-Motif GUI."
+
+#: version.c:1902
+msgid "with X11-neXtaw GUI."
+msgstr "z X11-neXtaw GUI."
+
+#: version.c:1904
+msgid "with X11-Athena GUI."
+msgstr "z X11-Athena GUI."
+
+#: version.c:1908
+msgid "with BeOS GUI."
+msgstr "z BeOS GUI."
+
+#: version.c:1911
+msgid "with Photon GUI."
+msgstr "z Photon GUI."
+
+#: version.c:1914
+msgid "with GUI."
+msgstr "z GUI."
+
+#: version.c:1917
+msgid "with Carbon GUI."
+msgstr "z Carbon GUI."
+
+#: version.c:1920
+msgid "with Cocoa GUI."
+msgstr "z Cocoa GUI."
+
+#: version.c:1923
+msgid "with (classic) GUI."
+msgstr "z (klasycznym) GUI."
+
+#: version.c:1934
+msgid " Features included (+) or not (-):\n"
+msgstr " Opcje w³±czone (+) lub nie (-):\n"
+
+#: version.c:1946
+msgid " system vimrc file: \""
+msgstr " vimrc systemu: \""
+
+#: version.c:1951
+msgid " user vimrc file: \""
+msgstr " vimrc u¿ytkownika: \""
+
+#: version.c:1956
+msgid " 2nd user vimrc file: \""
+msgstr " 2-gi plik vimrc u¿ytkownika: \""
+
+#: version.c:1961
+msgid " 3rd user vimrc file: \""
+msgstr " 3-ci plik vimrc u¿ytkownika: \""
+
+#: version.c:1966
+msgid " user exrc file: \""
+msgstr " exrc u¿ytkownika: \""
+
+#: version.c:1971
+msgid " 2nd user exrc file: \""
+msgstr " 2-gi plik exrc u¿ytkownika: \""
+
+#: version.c:1977
+msgid " system gvimrc file: \""
+msgstr " gvimrc systemu: \""
+
+#: version.c:1981
+msgid " user gvimrc file: \""
+msgstr " gvimrc u¿ytkownika: \""
+
+#: version.c:1985
+msgid "2nd user gvimrc file: \""
+msgstr "2-gi plik gvimrc u¿ytkownika: \""
+
+#: version.c:1990
+msgid "3rd user gvimrc file: \""
+msgstr "3-ci plik gvimrc u¿ytkownika: \""
+
+#: version.c:1997
+msgid " system menu file: \""
+msgstr " systemowy plik menu: \""
+
+#: version.c:2005
+msgid " fall-back for $VIM: \""
+msgstr " odwet dla $VIM-a: \""
+
+#: version.c:2011
+msgid " f-b for $VIMRUNTIME: \""
+msgstr "f-b dla $VIMRUNTIME: \""
+
+#: version.c:2015
+msgid "Compilation: "
+msgstr "Kompilacja: "
+
+#: version.c:2021
+msgid "Compiler: "
+msgstr "Kompilator: "
+
+#: version.c:2026
+msgid "Linking: "
+msgstr "Konsolidacja: "
+
+#: version.c:2031
+msgid " DEBUG BUILD"
+msgstr " KOMPILACJA DEBUG"
+
+#: version.c:2070
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi rozbudowany"
+
+#: version.c:2072
+msgid "version "
+msgstr "wersja "
+
+#: version.c:2073
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar i Inni."
+
+#: version.c:2077
+msgid "Vim is open source and freely distributable"
+msgstr "Vim jest open source i rozprowadzany darmowo"
+
+#: version.c:2079
+msgid "Help poor children in Uganda!"
+msgstr "Pomó¿ biednym dzieciom w Ugandzie!"
+
+#: version.c:2080
+msgid "type :help iccf<Enter> for information "
+msgstr "wprowad¼ :help iccf<Enter> dla informacji o tym "
+
+#: version.c:2082
+msgid "type :q<Enter> to exit "
+msgstr "wprowad¼ :q<Enter> zakoñczenie programu "
+
+#: version.c:2083
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "wprowad¼ :help<Enter> lub <F1> pomoc na bie¿±co "
+
+#: version.c:2084
+msgid "type :help version6<Enter> for version info"
+msgstr "wprowad¼ :help version6<Enter> dla informacji o wersji"
+
+#: version.c:2087
+msgid "Running in Vi compatible mode"
+msgstr "Dzia³am w trybie zgodno¶ci z Vi"
+
+#: version.c:2088
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "wprowad¼ :set nocp<Enter> warto¶ci domy¶lne Vim-a"
+
+#: version.c:2089
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "wprowad¼ :help cp-default<Enter> dla informacji to tym "
+
+#: version.c:2104
+msgid "menu Help->Orphans for information "
+msgstr "wprowad¼ :help iccf<Enter> dla informacji to tym "
+
+#: version.c:2106
+msgid "Running modeless, typed text is inserted"
+msgstr "Uruchomiony bez trybów, wpisany tekst jest wprowadzany"
+
+#: version.c:2107
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Edytuj->Ustawienia globalne->Tryb wstawiania"
+
+#: version.c:2108
+msgid " for two modes "
+msgstr " dla dwóch trybów "
+
+#: version.c:2112
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Edytuj->Ustawienia globalne->Kompatybilno¶æ z Vi"
+
+#: version.c:2113
+msgid " for Vim defaults "
+msgstr " dla domy¶lnych ustawieñ Vima "
+
+#: version.c:2160
+msgid "Sponsor Vim development!"
+msgstr "Sponsoruj rozwój Vima!"
+
+#: version.c:2161
+msgid "Become a registered Vim user!"
+msgstr "Zostañ zarejestrowanym u¿ytkownikiem Vima!"
+
+#: version.c:2164
+msgid "type :help sponsor<Enter> for information "
+msgstr "wprowad¼ :help sponsor<Enter> dla informacji"
+
+#: version.c:2165
+msgid "type :help register<Enter> for information "
+msgstr "wprowad¼ :help register<Enter> dla informacji"
+
+#: version.c:2167
+msgid "menu Help->Sponsor/Register for information "
+msgstr "menu Pomoc->Sponsoruj/Zarejestruj siê dla informacji"
+
+#: version.c:2177
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "OSTRZE¯ENIE: wykryto Windows 95/98/ME"
+
+#: version.c:2180
+msgid "type :help windows95<Enter> for info on this"
+msgstr "wprowad¼ :help windows95<Enter> dla informacji to tym "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Nie ma okna podgl±du"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Nie mogê rozdzieliæ lewo-górnego i prawo-dolnego jednocze¶nie"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nie mogê przekrêciæ, gdy inne okno jest rozdzielone"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: Nie mogê zamkn±æ ostatniego okna"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Ju¿ jest tylko jeden widok"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: Inne okno zawiera zmiany"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Brak nazwy pliku pod kursorem"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Nie mogê znale¼æ pliku \"%s\" w tropie"
+
+#: if_perl.xs:326 globals.h:1232
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Nie mog³em za³adowaæ biblioteki %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr "Przykro mi, ta komenda jest wy³±czona: nie mog³em za³adowaæ biblioteki Perla."
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr "E299: wyliczenie Perla zabronione w piaskownicy bez modu³u Safe"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Edytuj w &wielu Vimach"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Edytuj w pojedynczym &Vimie"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Diff z Vimem"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Edytuj w &Vimie"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Edytuj z istniej±cym Vimem - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Edytuj wybrane pliki w Vimie"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "B³±d tworzenia procesu: Sprawd¼ czy gvim jest w twojej ¶cie¿ce!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "b³±d gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Za d³uga ¶cie¿ka!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "--Brak wierszy w buforze--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: Przerwanie komendy"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: wymagany argument"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ powinno byæ /, ? lub &"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Niedozwolone w oknie wiersza poleceñ; <CR> wykonuje, CTRL-C opuszcza"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Komenda niedozwolona z exrc/vimrc w bie¿±cym szukaniu katalogu lub "
+"znacznika"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: Brak :endif"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: Brak :endtry"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: Brak :endwhile"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile bez :while"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Plik istnieje (wymu¶ poprzez !)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: Komenda nie powiod³a siê"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Nieznany zestaw czcionek: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Nieznana czcionka: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Czcionka \"%s\" nie ma sta³ej szeroko¶ci znaków"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: B³±d wewnêtrzny"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "Przerwane"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: Niew³a¶ciwy adres"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: Niew³a¶ciwy argument"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Niew³a¶ciwy argument: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Niew³a¶ciwe wyra¿enie: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: Niew³a¶ciwy zakres"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: Niew³a¶ciwa komenda"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" jest katalogiem"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Nieoczekiwane znaki przed '='"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Wywo³anie z biblioteki nie powiod³o siê dla \"%s()\""
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Nie mo¿na za³adowaæ funkcji biblioteki %s"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Zak³adka ma niew³a¶ciwy numer wiersza"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "E20: Zak³adka nienastawiona"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nie mogê wykonaæ zmian, 'modifiable' jest wy³±czone"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Zbyt g³êbokie zagnie¿d¿enie skryptów"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: Brak pliku zamiany"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: Nie ma takiego skrótu"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: Niedozwolone !"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI nie mo¿e byæ u¿yte: Nie w³±czono podczas kompilacji"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Hebrajski nie mo¿e byæ u¿yty: Nie w³±czono podczas kompilacji\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Farsi nie mo¿e byæ u¿yty: Nie w³±czono podczas kompilacji\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Arabski nie mo¿e byæ u¿yty: Nie w³±czono podczas kompilacji\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Brak takiej nazwy grupy pod¶wietlania: %s"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: Nie wprowadzono jeszcze ¿adnego tekstu"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: Nie ma poprzedniego wiersza poleceñ"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: Nie ma takiego przyporz±dkowania"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: Brak dopasowañ"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Brak dopasowañ: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: Brak nazwy pliku"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Brak poprzedniego podstawieniowego wyra¿enia regularnego"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: Brak poprzedniej komendy"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: Brak poprzedniego wyra¿enia regularnego"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: Zakres niedozwolony"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: Brak miejsca"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: brak zarejestrowanego serwera o nazwie \"%s\""
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Nie mogê stworzyæ pliku %s"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: Nie mogê pobraæ nazwy pliku tymczasowego"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Nie mogê otworzyæ pliku %s"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Nie mogê odczytaæ pliku %s"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Nie zapisano od ostatniej zmiany (wymu¶ przez !)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: Zerowy argument"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: Oczekujê liczby"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nie mogê otworzyæ pliku b³êdów %s"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: nie mogê otworzyæ ekranu"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: Pamiêæ wyczerpana!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "Nie znaleziono wzorca"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Nie znaleziono wzorca: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: Argument musi byæ dodatni"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Nie mo¿na przej¶æ do poprzedniego katalogu"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: Brak B³êdów"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: Popsuty ci±g wzorca"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Zepsuty program wyra¿eñ regularnych"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: opcja 'readonly' jest ustawiona (wymu¶ poprzez !)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nie mogê ustawiæ zmiennej tylko do odczytu \"%s\""
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: B³±d w trakcie czytania pliku b³êdów"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Niedozwolone w piaskownicy"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: Niedozwolone w tym miejscu"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Ustawianie trybu ekranu niewspomagane"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: Niew³a¶ciwa wielko¶æ przewiniêcia"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: opcja 'shell' jest pusta"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Nie mog³em wczytaæ danych znaku!"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: B³±d podczas zamykania pliku wymiany"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: stos znaczników jest pusty"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: Komenda jest zbyt skomplikowana"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: Zbyt d³uga nazwa"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: Zbyt wiele ["
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: Zbyt wiele nazw plików"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: Nadstêpne znaczki"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: Nieznana zak³adka"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nie mog± rozwin±æ znaków wieloznacznych"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' nie mo¿e byæ mniejsze ni¿ 'winminheight'"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' nie mo¿e byæ mniejsze ni¿ 'winminwidth'"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: B³±d w trakcie zapisu"
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "Zerowy licznik"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: U¿ycie <SID> poza kontekstem skryptu"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: Odebra³em niew³a¶ciwe wyra¿enie"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Region jest chroniony, nie mogê zmieniæ"
+
diff --git a/src/po/ru.cp1251.po b/src/po/ru.cp1251.po
new file mode 100644
index 000000000..f0b0ac2a4
--- /dev/null
+++ b/src/po/ru.cp1251.po
@@ -0,0 +1,6658 @@
+# Russian translation for Vim
+#
+# Îá óñëîâèÿõ èñïîëüçîâàíèÿ ÷èòàéòå â ðåäàêòîðå Vim ":help uganda"
+# Î ëþäÿõ, äåëàþùèõ Vim ÷èòàéòå â ðåäàêòîðå ":help àâòîðû"
+#
+# vassily "vr" ragosin <vrr@users.sourceforge.net>, 2004
+#
+# Generated from ru.po, DO NOT EDIT.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.3a\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-05-10 21:37+0400\n"
+"PO-Revision-Date: 2004-05-10 21:37+0400\n"
+"Last-Translator: vassily ragosin <vrr@users.sourceforge.net>\n"
+"Language-Team: vassily ragosin <vrr@users.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp1251\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Íåâîçìîæíî âûäåëèòü ïàìÿòü äàæå äëÿ îäíîãî áóôåðà, âûõîä..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Íåâîçìîæíî âûäåëèòü ïàìÿòü äëÿ áóôåðà, èñïîëüçóåì äðóãîé áóôåð..."
+
+#: buffer.c:805
+#, c-format
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Íè îäèí áóôåð íå áûë âûãðóæåí èç ïàìÿòè"
+
+#: buffer.c:807
+#, c-format
+msgid "E516: No buffers were deleted"
+msgstr "E516: Íè îäèí áóôåð íå áûë óäàë¸í"
+
+#: buffer.c:809
+#, c-format
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Íè îäèí áóôåð íå áûë î÷èùåí"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "Îäèí áóôåð âûãðóæåí èç ïàìÿòè"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "Âñåãî âûãðóæåíî áóôåðîâ èç ïàìÿòè: %d"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "Îäèí áóôåð óäàë¸í"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "Âñåãî óäàëåíî áóôåðîâ: %d"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "Îäèí áóôåð î÷èùåí"
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "Âñåãî î÷èùåíî áóôåðîâ: %d"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: Èçìåí¸ííûõ áóôåðîâ íå îáíàðóæåíî"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: Áóôåðû â ñïèñêå îòñóòñòâóþò"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Áóôåð %ld íå ñóùåñòâóåò"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Ýòî ïîñëåäíèé áóôåð"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Ýòî ïåðâûé áóôåð"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: Èçìåíåíèÿ â áóôåðå %ld íå ñîõðàíåíû (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Íåâîçìîæíî âûãðóçèòü èç ïàìÿòè ïîñëåäíèé áóôåð"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Ïðåäóïðåæäåíèå: ïåðåïîëíåíèå ñïèñêà èì¸í ôàéëîâ"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Áóôåð %ld íå íàéäåí"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Íåñêîëüêî ñîîòâåòñòâèé äëÿ %s"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Íåò ñîîòâåòñòâóþùåãî %s áóôåðà"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "ñòðîêà %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Áóôåð ñ òàêèì èìåíåì óæå ñóùåñòâóåò"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [Èçìåí¸í]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[Íå ðåäàêòèðîâàëñÿ]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[Íîâûé ôàéë]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[Îøèáêè ÷òåíèÿ]"
+
+#: buffer.c:2726 fileio.c:2112
+msgid "[readonly]"
+msgstr "[òîëüêî äëÿ ÷òåíèÿ]"
+
+#: buffer.c:2747
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "Îäíà ñòðîêà --%d%%--"
+
+#: buffer.c:2749
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld ñòð. --%d%%--"
+
+#: buffer.c:2756
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ñòð. %ld èç %ld --%d%%-- êîë. "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[Íåò ôàéëà]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "ñïðàâêà"
+
+#: buffer.c:3463 screen.c:5075
+msgid "[help]"
+msgstr "[ñïðàâêà]"
+
+#: buffer.c:3495 screen.c:5081
+msgid "[Preview]"
+msgstr "[Ïðåäïðîñìîòð]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "Âåñü"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "Âíèçó"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "Íàâåðõó"
+
+#: buffer.c:4523
+#, c-format
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Ñïèñîê áóôåðîâ:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[Ñïèñîê îøèáîê]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[Íåò ôàéëà]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Çíà÷êè ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "Çíà÷êè äëÿ %s:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ñòðîêà=%ld id=%d èìÿ=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Ñëåäèòü çà îòëè÷èÿìè ìîæíî íå áîëåå ÷åì â %ld áóôåðàõ"
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: Íåâîçìîæíî ñîçäàòü ôàéëû îòëè÷èé"
+
+#: diff.c:818
+msgid "Patch file"
+msgstr "Ôàéë-çàïëàòêà"
+
+#: diff.c:1069
+msgid "E98: Cannot read diff output"
+msgstr "E98: Íåâîçìîæíî ïðî÷èòàòü âûâîä êîìàíäû diff"
+
+#: diff.c:1819
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Àêòèâíûé áóôåð íå íàõîäèòñÿ â ðåæèìå îòëè÷èé"
+
+#: diff.c:1831
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Áîëüøå íåò áóôåðîâ â ðåæèìå îòëè÷èé"
+
+#: diff.c:1839
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101:  ðåæèìå îòëè÷èé áîëåå äâóõ áóôåðîâ, íå ìîãó âûáðàòü"
+
+#: diff.c:1862
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Íå ìîãó íàéòè áóôåð \"%s\""
+
+#: diff.c:1868
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Áóôåð \"%s\" íå íàõîäèòñÿ â ðåæèìå îòëè÷èé"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Ýêðàíèðóþùèé ñèìâîë Escape íåëüçÿ èñïîëüçîâàòü â äèãðàôå"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: Ôàéë ñ ðàñêëàäêîé êëàâèàòóðû íå íàéäåí"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Êîìàíäà :loadkeymap ïðèìåíåíà âíå ôàéëà ñöåíàðèÿ"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " Àâòîäîïîëíåíèå êëþ÷åâîãî ñëîâà (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " Àâòîäîïîëíåíèå ^X (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " Ìåñòíîå àâòîäîïîëíåíèå êëþ÷åâîãî ñëîâà (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " Àâòîäîïîëíåíèå öåëîé ñòðîêè (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " Àâòîäîïîëíåíèå èìåíè ôàéëà (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " Àâòîäîïîëíåíèå ìåòêè (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " Àâòîäîïîëíåíèå øàáëîíà ïóòè (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " Àâòîäîïîëíåíèå îïðåäåëåíèÿ (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " Àâòîäîïîëíåíèå ïî ñëîâàðþ (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " Àâòîäîïîëíåíèå ñèíîíèìîâ (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " Àâòîäîïîëíåíèå êîìàíäíîé ñòðîêè (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Êîíåö àáçàöà"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "Íå çàäàíî çíà÷åíèå îïöèè 'thesaurus'"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "Íå çàäàíî çíà÷åíèå îïöèè 'dictionary'"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Ïðîñìîòð ñëîâàðÿ: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (âñòàâêà) Ïðîêðóòêà (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (çàìåíà) Ïðîêðóòêà (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "Ïðîñìîòð: %s"
+
+#: edit.c:2719
+#, c-format
+msgid "Scanning tags."
+msgstr "Âûïîëíÿåòñÿ ïîèñê ñðåäè ìåòîê."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " Äîáàâëåíèå"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- Ïîèñê..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "Èñõîäíîå ñëîâî"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "Ñëîâî èç äðóãîé ñòðîêè"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "Åäèíñòâåííîå ñîîòâåòñòâèå"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "ñîîòâåòñòâèå %d èç %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "ñîîòâåòñòâèå %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Íåèçâåñòíàÿ ïåðåìåííàÿ: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Ïðîïóùåíû ñêîáêè: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Íåò òàêîé ïåðåìåííîé: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Ïðîïóùåíî ':' ïîñëå '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: Ïðîïóùåíà ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: Ïðîïóùåíà ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Íå óêàçàíî èìÿ îïöèè: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Íåèçâåñòíàÿ îïöèÿ: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Ïðîïóùåíà êàâû÷êà: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Ïðîïóùåíà êàâû÷êà: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Ïàðàìåòðû äëÿ ôóíêöèè %s çàäàíû íåâåðíî"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Íåèçâåñòíàÿ ôóíêöèÿ: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Ñëèøêîì ìíîãî ïàðàìåòðîâ äëÿ ôóíêöèè %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Íåäîñòàòî÷íî ïàðàìåòðîâ äëÿ ôóíêöèè %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> èñïîëüçóåòñÿ âíå ñöåíàðèÿ: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4382 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ñòðîê: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"Î&òìåíà"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "Ôóíêöèÿ inputrestore() âûçûâàåòñÿ ÷àùå, ÷åì ôóíêöèÿ inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E656: Ñëèøêîì ìíîãî ñèìâîëè÷åñêèõ ññûëîê (öèêë?)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: Íåò ñâÿçè ñ ñåðâåðîì Vim"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E227: Ñåðâåð íå îòâå÷àåò"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: Íå ìîãó îòâåòèòü êëèåíòó"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Íå ìîãó îòïðàâèòü ñîîáùåíèå äëÿ %s"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(Íåïðàâèëüíî)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Íåîïðåäåëåííàÿ ïåðåìåííàÿ: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: Íåäîïóñòèìîå èìÿ ïåðåìåííîé: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: Ôóíêöèÿ %s óæå ñóùåñòâóåò. Äîáàâüòå !, ÷òîáû çàìåíèòü å¸."
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Íåîïðåäåëåííàÿ ôóíêöèÿ: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Ïðîïóùåíà '(': %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Íåäîïóñòèìûé ïàðàìåòð: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: Ïðîïóùåíà êîìàíäà :endfunction"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Íåâîçìîæíî ïåðåîïðåäåëèòü ôóíêöèþ %s, îíà èñïîëüçóåòñÿ"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: Òðåáóåòñÿ èìÿ ôóíêöèè"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Èìÿ ôóíêöèè äîëæíî íà÷èíàòüñÿ ñ ïðîïèñíîé áóêâû: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Ôóíêöèÿ %s íå îïðåäåëåíà"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Íåâîçìîæíî óäàëèòü ôóíêöèþ %s, îíà èñïîëüçóåòñÿ"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Ãëóáèíà âûçîâà ôóíêöèè áîëüøå, ÷åì çíà÷åíèå 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "âûçîâ %s"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "%s ïðåðâàíà"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s âîçâðàùàåò #%ld"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s âîçâðàùàåò \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "ïðîäîëæåíèå â %s"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: êîìàíäà :return âíå ôóíêöèè"
+
+#: eval.c:9952
+#, c-format
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ãëîáàëüíûå ïåðåìåííûå:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Octal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Octal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Octal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Ñòðîêè ïåðåìåùàþòñÿ ñàìè íà ñåáÿ"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "Ïåðåìåùåíà îäíà ñòðîêà"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "Ïåðåìåùåíî ñòðîê: %ld"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "Ïðîïóùåíî ÷åðåç ôèëüòð ñòðîê: %ld"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Àâòîêîìàíäû *Filter* íå äîëæíû èçìåíÿòü àêòèâíûé áóôåð"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Èçìåíåíèÿ íå ñîõðàíåíû]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s â ñòðîêå: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr ""
+"E136: viminfo: Ñëèøêîì ìíîãî îøèáîê, îñòàëüíàÿ ÷àñòü ôàéëà áóäåò ïðîïóùåíà"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "×òåíèå ôàéëà viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " èíôî"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " îòìåòîê"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " ÍÅÓÄÀ×ÍÎ"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Ïðàâà íà çàïèñü ôàéëà viminfo îòñóòñòâóþò: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Íåâîçìîæíî çàïèñàòü ôàéë viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Çàïèñü ôàéëà viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Ýòîò ôàéë viminfo àâòîìàòè÷åñêè ñîçäàí Vim %s.\n"
+
+#: ex_cmds.c:1651
+#, c-format
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Åãî ìîæíî (îñòîðîæíî!) ðåäàêòèðîâàòü.\n"
+"\n"
+
+#: ex_cmds.c:1653
+#, c-format
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Çíà÷åíèå îïöèè 'encoding' â ìîìåíò çàïèñè ôàéëà\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Íåäîïóñòèìûé íà÷àëüíûé ñèìâîë"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "Ñîõðàíèòü êàê"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Ôàéë çàãðóæåí â äðóãîì áóôåðå"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Çàïèñàòü ôàéë ÷àñòè÷íî?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Äëÿ çàïèñè ÷àñòè áóôåðà èñïîëüçóéòå !"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Ïåðåïèñàòü ñóùåñòâóþùèé ôàéë \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Áóôåð %ld íå ñâÿçàí ñ èìåíåì ôàéëà"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Ôàéë íå ñîõðàí¸í: çàïèñü îòêëþ÷åíà îïöèåé 'write'"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Äëÿ \"%.*s\" âêëþ÷åíà îïöèÿ 'readonly'.\n"
+"Çàïèñàòü?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "Ðåäàêòèðîâàíèå ôàéëà"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Àâòîêîìàíäû íåîæèäàííî óáèëè íîâûé áóôåð %s"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: Ïàðàìåòð êîìàíäû :z äîëæåí áûòü ÷èñëîì"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Èñïîëüçîâàíèå êîìàíä îáîëî÷êè íå äîïóñêàåòñÿ â rvim."
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Ðåãóëÿðíûå âûðàæåíèÿ íå ìîãóò ðàçäåëÿòüñÿ áóêâàìè"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "çàìåíèòü íà %s? (y/n/a/q/l/^E/^Y)"
+
+#: ex_cmds.c:4270
+msgid "(Interrupted) "
+msgstr "(Ïðåðâàíî)"
+
+#: ex_cmds.c:4274
+msgid "1 substitution"
+msgstr "Îäíà çàìåíà"
+
+#: ex_cmds.c:4276
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld çàìåí"
+
+#: ex_cmds.c:4279
+msgid " on 1 line"
+msgstr " â îäíîé ñòðîêå"
+
+#: ex_cmds.c:4281
+#, c-format
+msgid " on %ld lines"
+msgstr " â %ld ñòð."
+
+#: ex_cmds.c:4332
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Êîìàíäà :global íå ìîæåò áûòü ðåêóðñèâíîé"
+
+#: ex_cmds.c:4367
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Â êîìàíäå :global ïðîïóùåíî ðåãóëÿðíîå âûðàæåíèå"
+
+#: ex_cmds.c:4416
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Ñîîòâåòñòâèå øàáëîíó íàéäåíî íà êàæäîé ñòðîêå: %s"
+
+#: ex_cmds.c:4497
+#, c-format
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ïîñëåäíÿÿ ñòðîêà äëÿ çàìåíû:\n"
+"$"
+
+#: ex_cmds.c:4598
+msgid "E478: Don't panic!"
+msgstr "E478: Ñïîêîéñòâèå, òîëüêî ñïîêîéñòâèå!"
+
+#: ex_cmds.c:4650
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: ê ñîæàëåíèþ, ñïðàâêà '%s' äëÿ %s îòñóòñòâóåò"
+
+#: ex_cmds.c:4653
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Ê ñîæàëåíèþ ñïðàâêà äëÿ %s îòñóòñòâóåò"
+
+#: ex_cmds.c:4687
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Èçâèíèòå, ôàéë ñïðàâêè \"%s\" íå íàéäåí"
+
+#: ex_cmds.c:5170
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s íå ÿâëÿåòñÿ êàòàëîãîì"
+
+#: ex_cmds.c:5309
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Íåâîçìîæíî îòêðûòü %s äëÿ çàïèñè"
+
+#: ex_cmds.c:5345
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Íåâîçìîæíî îòêðûòü %s äëÿ ÷òåíèÿ"
+
+#: ex_cmds.c:5367
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: Ôàéëû ñïðàâêè èñïîëüçóþò ðàçíûå êîäèðîâêè äëÿ îäíîãî ÿçûêà: %s"
+
+#: ex_cmds.c:5445
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Ïîâòîðÿþùàÿñÿ ìåòêà \"%s\" â ôàéëå %s"
+
+#: ex_cmds.c:5557
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Íåèçâåñòíàÿ êîìàíäà çíà÷êà %s"
+
+#: ex_cmds.c:5577
+msgid "E156: Missing sign name"
+msgstr "E156: Ïðîïóùåíî èìÿ çíà÷êà"
+
+#: ex_cmds.c:5623
+msgid "E612: Too many signs defined"
+msgstr "E612: Îïðåäåëåíî ñëèøêîì ìíîãî çíà÷êîâ"
+
+#: ex_cmds.c:5691
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Íåïðàâèëüíûé òåêñò çíà÷êà: %s"
+
+#: ex_cmds.c:5722 ex_cmds.c:5913
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Íåèçâåñòíûé çíà÷îê: %s"
+
+#: ex_cmds.c:5771
+msgid "E159: Missing sign number"
+msgstr "E159: Ïðîïóùåí íîìåð çíà÷êà"
+
+#: ex_cmds.c:5853
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Íåïðàâèëüíîå èìÿ áóôåðà: %s"
+
+#: ex_cmds.c:5892
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Íåïðàâèëüíûé ID çíà÷êà: %ld"
+
+#: ex_cmds.c:5962
+msgid " (NOT FOUND)"
+msgstr " (ÍÅ ÍÀÉÄÅÍÎ)"
+
+#: ex_cmds.c:5964
+msgid " (not supported)"
+msgstr " (íå ïîääåðæèâàåòñÿ)"
+
+#: ex_cmds.c:6063
+msgid "[Deleted]"
+msgstr "[Óäàëåíî]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Âêëþ÷¸í ðåæèì îòëàäêè. Äëÿ ïðîäîëæåíèÿ íàáåðèòå \"cont\""
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "ñòðîêà %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "êîìàíäà: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Òî÷êà îñòàíîâêè â \"%s%s\" ñòð. %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Òî÷êà îñòàíîâêè íå íàéäåíà: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Òî÷êè îñòàíîâêè íå îïðåäåëåíû"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ñòð. %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Ñîõðàíèòü èçìåíåíèÿ â \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9378
+msgid "Untitled"
+msgstr "Áåç èìåíè"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Íåñîõðàí¸ííûå èçìåíåíèÿ â áóôåðå \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"Ïðåäóïðåæäåíèå: Íåîæèäàííûé ïåðåõîä â äðóãîé áóôåð (ïðîâåðüòå àâòîêîìàíäû)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Äëÿ ðåäàêòèðîâàíèÿ äîñòóïåí òîëüêî îäèí ôàéë"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Ýòî ïåðâûé ôàéë"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Ýòî ïîñëåäíèé ôàéë"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: êîìïèëÿòîð íå ïîääåðæèâàåòñÿ: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Ïîèñê \"%s\" â \"%s\""
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Ïîèñê \"%s\""
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "íå íàéäåíî â 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "Âûïîëíèòü ñöåíàðèé Vim"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Íåëüçÿ ñ÷èòàòü êàòàëîã: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "íåâîçìîæíî ñ÷èòàòü \"%s\""
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "ñòðîêà %ld: íåâîçìîæíî ñ÷èòàòü \"%s\""
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "ñ÷èòûâàíèå ñöåíàðèÿ \"%s\""
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "ñòðîêà %ld: ñ÷èòûâàíèå \"%s\""
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "ñ÷èòûâàíèå ñöåíàðèÿ %s çàâåðøåíî"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr ""
+"W15: Ïðåäóïðåæäåíèå: íåïðàâèëüíûé ðàçäåëèòåëü ñòðîêè. Âîçìîæíî ïðîïóùåíî ^M"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: Êîìàíäà :scriptencoding èñïîëüçóåòñÿ âíå ôàéëà ñöåíàðèÿ"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: Êîìàíäà :finish èñïîëüçóåòñÿ âíå ôàéëà ñöåíàðèÿ"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "Ñòðàíèöà %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "Ïå÷àòàòü íå÷åãî"
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Ïå÷àòü ñòð. %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Êîïèÿ %d èç %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "Íàïå÷àòàíî: %s"
+
+#: ex_cmds2.c:3549
+#, c-format
+msgid "Printing aborted"
+msgstr "Ïå÷àòü ïðåêðàùåíà"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Îøèáêà çàïèñè â ôàéë PostScript"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Íåâîçìîæíî îòêðûòü ôàéë \"%s\""
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Íåâîçìîæíî ïðî÷èòàòü ôàéë ðåñóðñîâ PostScript \"%s\""
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: ôàéë \"%s\" íå ÿâëÿåòñÿ ôàéëîì ðåñóðñîâ PostScript"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: ôàéë \"%s\" íå ÿâëÿåòñÿ äîïóñòèìûì ôàéëîì ðåñóðñîâ PostScript"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: ôàéë ðåñóðñîâ \"%s\" íåèçâåñòíîé âåðñèè"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Íåâîçìîæíî îòêðûòü ôàéë PostScript"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Íåâîçìîæíî îòêðûòü ôàéë \"%s\""
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Ôàéë ðåñóðñîâ PostScript \"prolog.ps\" íå íàéäåí"
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Ôàéë ðåñóðñîâ PostScript \"%s.ps\" íå íàéäåí"
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr ""
+"E620: Ïðåîáðàçîâàíèå èç ìóëüòèáàéòíûõ ñèìâîëîâ â êîäèðîâêó \"%s\" íåâîçìîæíî"
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "Îòïðàâêà íà ïå÷àòü..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Íå óäàëîñü âûïîëíèòü ïå÷àòü ôàéëà PostScript"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "Çàäàíèå íà ïå÷àòü îòïðàâëåíî."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Àêòèâíûé %sÿçûê: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Íåâîçìîæíî ñìåíèòü ÿçûê íà \"%s\""
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Ïåðåõîä â ðåæèì Ex. Äëÿ ïåðåõîäà â Îáû÷íûé ðåæèì íàáåðèòå \"visual\""
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: Â êîíöå ôàéëà"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: Cëèøêîì ðåêóðñèâíàÿ êîìàíäà"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Èñêëþ÷èòåëüíàÿ ñèòóàöèÿ íå îáðàáîòàíà: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "Êîíåö ñ÷èòàííîãî ôàéëà"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "Êîíåö ôóíêöèè"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Íåîäíîçíà÷íîå èñïîëüçîâàíèå êîìàíäû ïîëüçîâàòåëÿ"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: Ýòî íå êîìàíäà ðåäàêòîðà"
+
+#: ex_docmd.c:2028
+msgid "E493: Backwards range given"
+msgstr "E493: Çàäàí îáðàòíûé äèàïàçîí"
+
+#: ex_docmd.c:2037
+msgid "Backwards range given, OK to swap"
+msgstr "Çàäàí îáðàòíûé äèàïàçîí, ìåíÿåì ãðàíèöû ìåñòàìè"
+
+#: ex_docmd.c:2160
+msgid "E494: Use w or w>>"
+msgstr "E494: Èñïîëüçóéòå w èëè w>>"
+
+#: ex_docmd.c:3786
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Èçâèíèòå, ýòà êîìàíäà íåäîñòóïíà â äàííîé âåðñèè"
+
+#: ex_docmd.c:3989
+msgid "E172: Only one file name allowed"
+msgstr "E172: Ðàçðåøåíî èñïîëüçîâàòü òîëüêî îäíî èìÿ ôàéëà"
+
+#: ex_docmd.c:4569
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 ôàéë îæèäàåò ðåäàêòèðîâàíèÿ. Âûéòè?"
+
+#: ex_docmd.c:4572
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Åñòü íåîòðåäàêòèðîâàííûå ôàéëû (%d). Âûéòè?"
+
+#: ex_docmd.c:4579
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 ôàéë îæèäàåò ðåäàêòèðîâàíèÿ."
+
+#: ex_docmd.c:4581
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Åñòü íåîòðåäàêòèðîâàííûå ôàéëû (%d)."
+
+#: ex_docmd.c:4676
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Êîìàíäà óæå ñóùåñòâóåò. Äîáàâüòå ! äëÿ çàìåíû."
+
+#: ex_docmd.c:4787
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Èìÿ Ïàðàì. Äèàï. Äîïîëí. Îïðåäåëåíèå"
+
+#: ex_docmd.c:4876
+msgid "No user-defined commands found"
+msgstr "Êîìàíäû, îïðåäåë¸ííûå ïîëüçîâàòåëåì, íå îáíàðóæåíû."
+
+#: ex_docmd.c:4908
+msgid "E175: No attribute specified"
+msgstr "E175: ïàðàìåòð íå çàäàí"
+
+#: ex_docmd.c:4960
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Íåïðàâèëüíîå êîëè÷åñòâî ïàðàìåòðîâ"
+
+#: ex_docmd.c:4975
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ×èñëî-ïðèñòàâêó íåëüçÿ óêàçûâàòü äâàæäû"
+
+#: ex_docmd.c:4985
+msgid "E178: Invalid default value for count"
+msgstr "E178: Íåïðàâèëüíîå çíà÷åíèå ÷èñëà-ïðèñòàâêè ïî óìîë÷àíèþ"
+
+#: ex_docmd.c:5016
+msgid "E179: argument required for complete"
+msgstr "E179: äëÿ çàâåðøåíèÿ òðåáóåòñÿ óêàçàòü ïàðàìåòð"
+
+#: ex_docmd.c:5048
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Íåïðàâèëüíîå çíà÷åíèå äîïîëíåíèÿ: %s"
+
+#: ex_docmd.c:5057
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr ""
+"E468: Ïàðàìåòð àâòîäîïîëíåíèÿ ìîæíî èñïîëüçîâàòü òîëüêî ñ îñîáûì äîïîëíåíèåì"
+
+#: ex_docmd.c:5063
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Îñîáîå äîïîëíåíèå òðåáóåò óêàçàíèÿ ïàðàìåòðà ôóíêöèè"
+
+#: ex_docmd.c:5074
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Íåïðàâèëüíûé àòðèáóò: %s"
+
+#: ex_docmd.c:5117
+msgid "E182: Invalid command name"
+msgstr "E182: Íåïðàâèëüíîå èìÿ êîìàíäû"
+
+#: ex_docmd.c:5132
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Êîìàíäà ïîëüçîâàòåëÿ äîëæíà íà÷èíàòüñÿ ñ çàãëàâíîé áóêâû"
+
+#: ex_docmd.c:5203
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Íåò òàêîé êîìàíäû ïîëüçîâàòåëÿ: %s"
+
+#: ex_docmd.c:5664
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Öâåòîâàÿ ñõåìà %s íå íàéäåíà"
+
+#: ex_docmd.c:5672
+msgid "Greetings, Vim user!"
+msgstr "Ïðèâåò, ïîëüçîâàòåëü Vim!"
+
+#: ex_docmd.c:6389
+msgid "Edit File in new window"
+msgstr "Ðåäàêòèðîâàòü ôàéë â íîâîì îêíå"
+
+#: ex_docmd.c:6684
+msgid "No swap file"
+msgstr "Áåç ñâîï-ôàéëà"
+
+#: ex_docmd.c:6788
+msgid "Append File"
+msgstr "Äîáàâèòü ôàéë"
+
+#: ex_docmd.c:6852
+msgid "E186: No previous directory"
+msgstr "E186: Íåò ïðåäûäóùåãî êàòàëîãà"
+
+#: ex_docmd.c:6934
+msgid "E187: Unknown"
+msgstr "E187: Íåèçâåñòíî"
+
+#: ex_docmd.c:7019
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: êîìàíäà :winsize òðåáóåò óêàçàíèÿ äâóõ ÷èñëîâûõ ïàðàìåòðîâ"
+
+#: ex_docmd.c:7075
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Ïîëîæåíèå îêíà: X %d, Y %d"
+
+#: ex_docmd.c:7080
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Â äàííîé ñèñòåìå îïðåäåëåíèå ïîëîæåíèÿ îêíà íå ðàáîòàåò"
+
+#: ex_docmd.c:7090
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: êîìàíäà :winpos òðåáóåò óêàçàíèÿ äâóõ ÷èñëîâûõ ïàðàìåòðîâ"
+
+#: ex_docmd.c:7368
+msgid "Save Redirection"
+msgstr "Ïåðåíàïðàâëåíèå çàïèñè"
+
+#: ex_docmd.c:7558
+msgid "Save View"
+msgstr "Ñîõðàíåíèå âèäà"
+
+#: ex_docmd.c:7559
+msgid "Save Session"
+msgstr "Ñîõðàíåíèå ñåàíñà"
+
+#: ex_docmd.c:7561
+msgid "Save Setup"
+msgstr "Ñîõðàíåíèå íàñòðîåê"
+
+#: ex_docmd.c:7713
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ñóùåñòâóåò (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: ex_docmd.c:7718
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Íåâîçìîæíî îòêðûòü äëÿ çàïèñè \"%s\""
+
+#. set mark
+#: ex_docmd.c:7742
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Ïàðàìåòð äîëæåí áûòü ïðÿìîé/îáðàòíîé êàâû÷êîé èëè áóêâîé"
+
+#: ex_docmd.c:7784
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Ñëèøêîì ãëóáîêàÿ ðåêóðñèÿ ïðè èñïîëüçîâàíèè êîìàíäû :normal"
+
+#: ex_docmd.c:8302
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Íåò ñîñåäíåãî èìåíè ôàéëà äëÿ çàìåíû '#'"
+
+#: ex_docmd.c:8333
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: Íåò àâòîêîìàíäíîãî èìåíè ôàéëà äëÿ çàìåíû \"<afile>\""
+
+#: ex_docmd.c:8341
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: Íåò àâòîêîìàíäíîãî íîìåðà áóôåðà äëÿ çàìåíû \"<abuf>\""
+
+#: ex_docmd.c:8352
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: Íåò àâòîêîìàíäíîãî èìåíè ñîîòâåòñòâèÿ äëÿ çàìåíû \"<amatch>\""
+
+#: ex_docmd.c:8362
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: íåò èìåíè ôàéëà :source äëÿ çàìåíû \"<sfile>\""
+
+#: ex_docmd.c:8403
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Ïóñòîå èìÿ ôàéëà äëÿ '%' èëè '#', âîçìîæíî òîëüêî c \":p:h\""
+
+#: ex_docmd.c:8405
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Ðåçóëüòàòîì âûðàæåíèÿ ÿâëÿåòñÿ ïóñòàÿ ñòðîêà"
+
+#: ex_docmd.c:9360
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Íåâîçìîæíî îòêðûòü ôàéë viminfo äëÿ ÷òåíèÿ"
+
+#: ex_docmd.c:9533
+msgid "E196: No digraphs in this version"
+msgstr "E196: Â ýòîé âåðñèè äèãðàôû íå ðàáîòàþò"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr ""
+"E608: Íåâîçìîæíî âûïîëíèòü êîìàíäó :throw äëÿ èñêëþ÷åíèé ñ ïðèñòàâêîé 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Èñêëþ÷èòåëüíàÿ ñèòóàöèÿ: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Çàâåðøåíà îáðàáîòêà èñêëþ÷èòåëüíîé ñèòóàöèè: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Èñêëþ÷èòåëüíàÿ ñèòóàöèÿ ïðîèãíîðèðîâàíà: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, ñòðîêà %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Îáðàáîòêà èñêëþ÷èòåëüíîé ñèòóàöèè: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s âûïîëíÿåò îæèäàíèå"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s âîçîáíîâëåíî"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s ïðîïóùåíî"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "Èñêëþ÷èòåëüíàÿ ñèòóàöèÿ"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "Îøèáêà è ïðåðûâàíèå"
+
+#: ex_eval.c:754 gui.c:4381
+msgid "Error"
+msgstr "Îøèáêà"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "Ïðåðûâàíèå"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: ñëèøêîì ãëóáîêî âëîæåííûé :if"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif áåç :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else áåç :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif áåç :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: îáíàðóæåíî íåñêîëüêî :else"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif ïîñëå :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: ñëèøêîì ãëóáîêî âëîæåííûé :while"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue áåç :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break áåç :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: ñëèøêîì ãëóáîêî âëîæåííûé :try"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch áåç :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch áåç :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally áåç :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: îáíàðóæåíî íåñêîëüêî :finally"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry áåç :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: êîìàíäà :endfunction ìîæåò èñïîëüçîâàòüñÿ òîëüêî âíóòðè ôóíêöèè"
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "èìÿ ìåòêè"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " òèï ôàéëà\n"
+
+#: ex_getln.c:4752
+msgid "'history' option is zero"
+msgstr "çíà÷åíèå îïöèè 'history' ðàâíî íóëþ"
+
+#: ex_getln.c:5023
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s, èñòîðèÿ (íà÷èíàÿ îò ñâåæåãî ê ñòàðîìó):\n"
+
+#: ex_getln.c:5024
+msgid "Command Line"
+msgstr "Êîìàíäíàÿ ñòðîêà"
+
+#: ex_getln.c:5025
+msgid "Search String"
+msgstr "Ñòðîêà ïîèñêà"
+
+#: ex_getln.c:5026
+msgid "Expression"
+msgstr "Âûðàæåíèå"
+
+#: ex_getln.c:5027
+msgid "Input Line"
+msgstr "Ñòðîêà ââîäà"
+
+#: ex_getln.c:5065
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar áîëüøå äëèíû êîìàíäû"
+
+#: ex_getln.c:5242
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Óäàëåíî àêòèâíîå îêíî èëè áóôåð"
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "Íåäîïóñòèìîå èìÿ ôàéëà"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "ÿâëÿåòñÿ êàòàëîãîì"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "íå ÿâëÿåòñÿ ôàéëîì"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[Íîâûé ôàéë]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[Äîñòóï çàïðåù¸í]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200:  ðåçóëüòàòå âûïîëíåíèÿ àâòîêîìàíä *ReadPre ôàéë ñòàë íå÷èòàåìûì"
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: àâòîêîìàíäû *ReadPre íå äîëæíû èçìåíÿòü àêòèâíûé áóôåð"
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: âûïîëíÿåòñÿ ÷òåíèå èç ñòàíäàðòíîãî ïîòîêà ââîäà stdin...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "Âûïîëíÿåòñÿ ÷òåíèå èç ñòàíäàðòíîãî ïîòîêà ââîäà stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202:  ðåçóëüòàòå ïðåîáðàçîâàíèÿ ôàéë ñòàë íå÷èòàåìûì!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[fifo/ãíåçäî]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[ãíåçäî]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[ïðîïóùåíû ñèìâîëû CR]"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[Îáíàðóæåíû ñèìâîëû NL]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[äëèííûå ñòðîêè ðàçáèòû]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[ÁÅÇ ïðåîáðàçîâàíèé]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[ïåðåêîäèðîâàíî]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[çàøèôðîâàíî]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[ÎØÈÁÊÀ ÏÐÅÎÁÐÀÇÎÂÀÍÈß]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[ÍÅÄÎÏÓÑÒÈÌÛÉ ÁÀÉÒ â ñòðîêå %ld]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[ÎØÈÁÊÈ ×ÒÅÍÈß]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "Âðåìåííûé ôàéë äëÿ ïåðåêîäèðîâàíèÿ íå íàéäåí"
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "Ïðåîáðàçîâàíèå ñ ïîìîùüþ 'charconvert' íå âûïîëíåíî"
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "íåâîçìîæíî ïðî÷èòàòü âûâîä 'charconvert'"
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Áóôåð, êîòîðûé òðåáîâàëîñü çàïèñàòü, óäàë¸í èëè âûãðóæåí àâòîêîìàíäîé"
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Êîëè÷åñòâî ñòðîê èçìåíåíî àâòîêîìàíäîé íåîæèäàííûì îáðàçîì"
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans íå ïîçâîëÿåò âûïîëíÿòü çàïèñü íåèçìåí¸ííûõ áóôåðîâ"
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "×àñòè÷íàÿ çàïèñü áóôåðîâ NetBeans íå äîïóñêàåòñÿ"
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "íå ÿâëÿåòñÿ ôàéëîì èëè óñòðîéñòâîì, äîñòóïíûì äëÿ çàïèñè"
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "îòêðûò òîëüêî äëÿ ÷òåíèÿ (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Çàïèñü â ðåçåðâíûé ôàéë íåâîçìîæíà (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: Îøèáêà çàêðûòèÿ ðåçåðâíîãî ôàéëà (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: Íåâîçìîæíî ïðî÷èòàòü ðåçåðâíûé ôàéë (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Íåâîçìîæíî ñîçäàòü ðåçåðâíûé ôàéë (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Íåâîçìîæíî ñîçäàòü ðåçåðâíûé ôàéë (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Âèëêà ðåñóðñà áóäåò ïîòåðÿíà (!, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Âðåìåííûé ôàéë äëÿ çàïèñè íå íàéäåí"
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: Ïåðåêîäèðîâêà íåâîçìîæíà (! äëÿ çàïèñè áåç ïåðåêîäèðîâêè)"
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Íåâîçìîæíî îòêðûòü ñâÿçàííûé ôàéë äëÿ çàïèñè"
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: Íåâîçìîæíî îòêðûòü ôàéë äëÿ çàïèñè"
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: Íå óäàëîñü âûïîëíèòü ôóíêöèþ fsync()"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E512: Îïåðàöèÿ çàêðûòèÿ íå óäàëàñü"
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: Îøèáêà çàïèñè, ïðåîáðàçîâàíèå íå óäàëîñü"
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: îøèáêà çàïèñè (íåò ñâîáîäíîãî ìåñòà?)"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr " ÎØÈÁÊÀ ÏÐÅÎÁÐÀÇÎÂÀÍÈß"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[Óñòðîéñòâî]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[Íîâûé]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " äîáàâëåíî"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " çàïèñàíî"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Ðåæèì çàïëàòêè: íåâîçìîæíî ñîõðàíåíèå èñõîäíîãî ôàéëà"
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr ""
+"E206: Ðåæèì çàïëàòêè: íåâîçìîæíî ñìåíèòü ïàðàìåòðû ïóñòîãî èñõîäíîãî ôàéëà"
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: Íåâîçìîæíî óäàëèòü ðåçåðâíûé ôàéë"
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ÏÐÅÄÓÏÐÅÆÄÅÍÈÅ: Èñõîäíûé ôàéë ìîæåò áûòü óòðà÷åí èëè ïîâðåæä¸í\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "íå âûõîäèòå èç ðåäàêòîðà, ïîêà ôàéë íå áóäåò óñïåøíî çàïèñàí!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[ôîðìàò dos]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[ôîðìàò mac]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[ôîðìàò unix]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 ñòðîêà, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "ñòðîê: %ld, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 ñèìâîë"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "ñèìâîëîâ: %ld"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[Íåçàâåðø¸ííàÿ ïîñëåäíÿÿ ñòðîêà]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ÏÐÅÄÓÏÐÅÆÄÅÍÈÅ: Ôàéë èçìåí¸í ñ ìîìåíòà ÷òåíèÿ!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "Ñåðü¸çíî õîòèòå çàïèñàòü â ýòîò ôàéë"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Îøèáêà çàïèñè â \"%s\""
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Îøèáêà çàêðûòèÿ \"%s\""
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Îøèáêà ÷òåíèÿ \"%s\""
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: Áóôåð óäàë¸í ïðè âûïîëíåíèè àâòîêîìàíäû FileChangedShell"
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Ïðåäóïðåæäåíèå: ôàéë \"%s\" áîëüøå íå äîñòóïåí"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Ïðåäóïðåæäåíèå: ôàéë \"%s\" è áóôåð Vim áûëè èçìåíåíû íåçàâèñèìî äðóã "
+"îò äðóãà"
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr ""
+"W11: Ïðåäóïðåæäåíèå: ôàéë \"%s\" áûë èçìåí¸í ïîñëå íà÷àëà ðåäàêòèðîâàíèÿ"
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: Ïðåäóïðåæäåíèå: ðåæèì äîñòóïà ê ôàéëó \"%s\" áûë èçìåí¸í ïîñëå íà÷àëà "
+"ðåäàêòèðîâàíèÿ"
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr ""
+"W13: Ïðåäóïðåæäåíèå: ôàéë \"%s\" áûë ñîçäàí ïîñëå íà÷àëà ðåäàêòèðîâàíèÿ"
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "Ñì. äîïîëíèòåëüíóþ èíôîðìàöèþ â \":help W11\"."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "Ïðåäóïðåæäåíèå"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Çàãðóçèòü ôàéë"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Íåâîçìîæíî ïîäãîòîâèòüñÿ ê ïåðåçàãðóçêå \"%s\""
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Íåâîçìîæíî âûïîëíèòü ïåðåçàãðóçêó \"%s\""
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--Óäàëåíî--"
+
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Ãðóïïà \"%s\" íå ñóùåñòâóåò"
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Íåäîïóñòèìûå ñèìâîëû ïîñëå *: %s"
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Íåñóùåñòâóþùåå ñîáûòèå: %s"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: Íåñóùåñòâóþùàÿ ãðóïïà èëè ñîáûòèå: %s"
+
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Àâòîêîìàíäû ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Íåâîçìîæíî âûïîëíèòü àâòîêîìàíäû äëÿ ÂÑÅÕ ñîáûòèé"
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "Íåò ïîäõîäÿùèõ àâòîêîìàíä"
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: ñëèøêîì ãëóáîêî âëîæåííûå àâòîêîìàíäû"
+
+#: fileio.c:8088
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Àâòîêîìàíäû äëÿ \"%s\""
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "Âûïîëíåíèå %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "àâòîêîìàíäà %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: Ïðîïóùåíà {."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: Ïðîïóùåíà }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: Ñêëàäîê íå îáíàðóæåíî"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr ""
+"E350: Ñêëàäêà íå ìîæåò áûòü ñîçäàíà ñ òåêóùèì çíà÷åíèåì îïöèè 'foldmethod'"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr ""
+"E351: Ñêëàäêà íå ìîæåò áûòü óäàëåíà ñ òåêóùèì çíà÷åíèåì îïöèè 'foldmethod'"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: Äîáàâëåíèå â áóôåð ÷òåíèÿ"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: ðåêóðñèâíàÿ ïðèâÿçêà"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: óæå åñòü ãëîáàëüíîå ñîêðàùåíèå äëÿ %s"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: óæå åñòü ãëîáàëüíàÿ ïðèâÿçêà äëÿ %s"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: óæå åñòü ñîêðàùåíèå äëÿ %s"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: óæå åñòü ïðèâÿçêà äëÿ %s"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "Ñîêðàùåíèÿ íå íàéäåíû"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "Ïðèâÿçêè íå íàéäåíû"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: íåäîïóñòèìûé ðåæèì"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Íåâîçìîæíî ïåðåéòè â ðåæèì ãðàôè÷åñêîãî èíòåðôåéñà"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Íåâîçìîæíî âûïîëíèòü ÷òåíèå \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr ""
+"E665: Íåâîçìîæíî ïåðåéòè â ðåæèì ãðàô. èíòåðôåéñà, íåïðàâèëüíî çàäàíû øðèôòû"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: íåïðàâèëüíîå çíà÷åíèå îïöèè 'guifontwide'"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: íåïðàâèëüíîå çíà÷åíèå îïöèè 'imactivatekey'"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Íåâîçìîæíî íàçíà÷èòü öâåò %s"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<íåëüçÿ îòêðûòü> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: øðèôò %s íå íàéäåí"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: âîçâðàò â òåêóùèé êàòàëîã íåâîçìîæåí"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Ïóòü ê ôàéëó:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: íå ìîãó íàéòè òåêóùèé êàòàëîã"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "Äà"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Îòìåíà"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Ïîëîñà ïðîêðóòêè: íå ìîãó îïðåäåëèòü ãåîìåòðèþ ïîëçóíêà"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Äèàëîãîâîå îêíî Vim"
+
+#: gui_beval.c:101 gui_w32.c:3829
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr ""
+"E232: \"Ïóçûðü\" äëÿ âû÷èñëåíèé, âêëþ÷àþùèé è ñîîáùåíèå, è îáðàòíûé âûçîâ, "
+"íå ìîæåò áûòü ñîçäàí"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "Äèàëîãîâîå îêíî Vim..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Äà\n"
+"&Íåò\n"
+"Î&òìåíà"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "Ìåòîäû Ââîäà"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Ïîèñê è çàìåíà..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Ïîèñê..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "×òî èùåì:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Íà ÷òî çàìåíÿåì:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Òîëüêî òî÷íûå ñîîòâåòñòâèÿ"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "Ðåãèñòðîçàâèñèìûå ñîîòâåòñòâèÿ"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "Íàïðàâëåíèå"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "Ââåðõ"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "Âíèç"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Íàéòè ñëåäóþùåå"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "Çàìåíà"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Çàìåíèòü âñå"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Ïîëó÷åí çàïðîñ íà ïðåêðàùåíèå ðàáîòû îò äèñïåò÷åðà ñåàíñîâ\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: Îñíîâíîå îêíî áûëî íåîæèäàííî çàêðûòî\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "Âûáîð øðèôòà"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Âìåñòî ïóñòîãî âûäåëåíèÿ èñïîëüçóåòñÿ CUT_BUFFER0"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Ôèëüòð"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Êàòàëîãè"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Ñïðàâêà"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Ôàéëû"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Âûäåëåíèå"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Îòìåíà"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Íåâîçìîæíî çàãðóçèòü øðèôò Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Íåâîçìîæíî èñïîëüçîâàòü øðèôò %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Îòïðàâêà ñîîáùåíèÿ äëÿ óíè÷òîæåíèÿ ïðîöåññà-ïîòîìêà.\n"
+
+#: gui_w32.c:829
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Ïàðàìåòð íå ïîääåðæèâàåòñÿ: \"-%s\"; èñïîëüçóéòå âåðñèþ OLE."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Ïîèñê ñòðîêè (èñïîëüçóéòå '\\\\' äëÿ ïîèñêà '\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Ïîèñê è çàìåíà (èñïîëüçóéòå '\\\\' äëÿ ïîèñêà '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: íåâîçìîæíî âûäåëèòü çàïèñü â òàáëèöå öâåòà, íåêîòîðûå öâåòàìîãóò "
+"îòîáðàæàòüñÿ íåïðàâèëüíî"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: â íàáîðå øðèôòîâ %s îòñóòñòâóþò øðèôòû äëÿ ñëåäóþùèõ êîäèðîâîê:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Íàáîð øðèôòîâ: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Øðèôò '%s' íå ÿâëÿåòñÿ ìîíîøèðèííûì"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Íàáîð øðèôòîâ: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+msgid "Font%ld width is not twice that of font0\n"
+msgstr "Øèðèíà øðèôòà font%ld äîëæíà áûòü âäâîå áîëüøå øèðèíû øðèôòà font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Øèðèíà øðèôòà font0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Øèðèíà øðèôòà font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "Ó256Æ ÎØÈÁÊÀ àâòîìàòèêè Õàíãûë"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Äîáàâèòü íîâóþ áàçó äàííûõ"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Çàïðîñ ïî øàáëîíó"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Ïîêàçàòü ýòî ñîîáùåíèå"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Óáèòü ñîåäèíåíèå"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Çàíîâî èíèöèàëèçèðîâàòü âñå ñîåäèíåíèÿ"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Ïîêàçàòü ñîåäèíåíèÿ"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Èñïîëüçîâàíèå: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Ýòà êîìàíäà cscope íå ïîääåðæèâàåò ðàçäåëåíèå îêíà.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Èñïîëüçîâàíèå: cstag <èìÿ>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ìåòêà íå íàéäåíà"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "îøèáêà stat(%s): %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: îøèáêà stat"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s íå ÿâëÿåòñÿ êàòàëîãîì èëè èìåíåì áàçû cscope"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Äîáàâëåíà áàçà äàííûõ cscope %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: îøèáêà ïîëó÷åíèÿ èíôîðìàöèè îò ñîåäèíåíèÿ cscope %d"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: íåèçâåñòíûé òèï ïîèñêà cscope"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Íåâîçìîæíî ñîçäàòü òðóáó äëÿ cscope"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Íåâîçìîæíî âûïîëíèòü fork() äëÿ cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "íå óäàëîñü âûïîëíèòü cs_create_connection"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Íå óäàëîñü çàïóñòèòü ïðîöåññ cscope"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: íå óäàëîñü âûïîëíèòü fdopen äëÿ to_fp"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: íå óäàëîñü âûïîëíèòü fdopen äëÿ fr_fp"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: ñîåäèíåíèé ñ cscope íå ñîçäàíî"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: íå íàéäåíî ñîîòâåòñòâèé ïî çàïðîñó cscope %s äëÿ %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: íåïðàâèëüíûé ôëàã cscopequickfix %c äëÿ %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "êîìàíäû cscope:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Èñïîëüçîâàíèå: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: íåâîçìîæíî îòêðûòü áàçó äàííûõ cscope: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: èíôîðìàöèÿ î áàçå äàííûõ cscope íå äîñòóïíà"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: äàííàÿ áàçà äàííûõ cscope óæå ïîäñîåäèíåíà"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: äîñòèãíóòî ìàêñèìàëüíîå çíà÷åíèå îòêðûòûõ ñîåäèíåíèé ñ cscope"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: ñîåäèíåíèå ñ cscope %s íå îáíàðóæåíî"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "ñîåäèíåíèå ñ cscope çàêðûòî"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: êðèòè÷åñêàÿ îøèáêà â cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Ìåòêà cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # ñòðîêà"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "èìÿ ôàéëà / êîíòåêñò / ñòðîêà\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Îøèáêà cscope: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "Ïåðåçàãðóçêà âñåõ áàç äàííûõ cscope"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "ñîåäèíåíèÿ ñ cscope îòñóòñòâóþò\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid áàçà äàííûõ íà÷àëüíûé ïóòü\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Ê ñîæàëåíèþ ýòà êîìàíäà íå ðàáîòàåò, ïîñêîëüêó íå çàãðóæåíà áèáëèîòåêà "
+"Python"
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: Íåâîçìîæíî âûïîëíèòü ðåêóðñèâíûé âûçîâ Python"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "íåâîçìîæíî óäàëèòü àòðèáóòû OutputObject"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "çíà÷åíèå softspace äîëæíî áûòü öåëûì ÷èñëîì"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "íåïðàâèëüíûé àòðèáóò"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() òðåáóåò óêàçàíèÿ ñïèñêà ñòðîê"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Îøèáêà èíèöèàëèçàöèè îáúåêòîâ I/O"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "íåïðàâèëüíîå âûðàæåíèå"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "âûðàæåíèÿ îòêëþ÷åíû ïðè êîìïèëÿöèè"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "ïîïûòêà ñîñëàòüñÿ íà óíè÷òîæåííûé áóôåð"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "çàïðåäåëüíûé íîìåð ñòðîêè"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<îáúåêò áóôåðà (óäàëåí) â %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "íåïðàâèëüíîå èìÿ îòìåòêè"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "íåò òàêîãî áóôåðà"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "ïîïûòêà ñîñëàòüñÿ íà çàêðûòîå îêíî"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "àòðèáóò äîñòóïåí òîëüêî äëÿ ÷òåíèÿ"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "ïîçèöèÿ êóðñîðà íàõîäèòñÿ âíå áóôåðà"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<îáúåêò îêíà (óäàëåí) â %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<îáúåêò îêíà (íåèçâåñòåí) â %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<îêíî %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "íåò òàêîãî îêíà"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "íåâîçìîæíî ñîõðàíèòü èíôîðìàöèþ îá îòìåíå îïåðàöèè"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "íåâîçìîæíî óäàëèòü ñòðîêó"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "íåâîçìîæíî çàìåíèòü ñòðîêó"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "íåâîçìîæíî âñòàâèòü ñòðîêó"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "ñòðîêà íå ìîæåò ñîäåðæàòü ñèìâîë íîâîé ñòðîêè"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Ê ñîæàëåíèþ ýòà êîìàíäà íå ðàáîòàåò, ïîñêîëüêó íå çàãðóæåíà áèáëèîòåêà "
+"Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: íåèçâåñòíîå ñîñòîÿíèå longjmp %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Ïåðåêëþ÷åíèå ìåæäó ðåàëèçàöèåé/îïðåäåëåíèåì"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Ïîêàçàòü áàçîâûé êëàññ "
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Ïîêàçàòü ïåðåãðóæåííûå ôóíêöèè"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Ïîëó÷åíèå èç ôàéëà"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Ïîëó÷åíèå èç ïðîåêòà"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Ïîëó÷åíèå èç âñåõ ïðîåêòîâ"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Ïîëó÷åíèå"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Ïîêàçàòü èñõîäíûé êîä"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Íàéòè ñèìâîë"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Ïðîñìîòð êëàññà"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Ïîêàçàòü êëàññ â èåðàðõèè"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Ïîêàçàòü êëàññ â îãðàíè÷åííîé èåðàðõèè"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ññûëàåòñÿ íà"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Ññûëêà íà xref èç"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref èìååò"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref èñïîëüçóåòñÿ"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Ïîêàçàòü docu"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Ñîçäàòü docu"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Íåâîçìîæíî ïîäñîåäèíèòüñÿ ê SNiFF+. Ïðîâåðüòå íàñòðîéêè îêðóæåíèÿ."
+"(sniffemacs äîëæíû áûòü óêàçàíû â ïåðåìåííîé $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Îøèáêà âî âðåìÿ ÷òåíèÿ. Îòñîåäèíåíèå"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "Â íàñòîÿùèé ìîìåíò SNiFF+ "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "íå "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "ïîäñîåäèí¸í"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Íåèçâåñòíûé çàïðîñ SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Îøèáêà ñîåäèíåíèÿ ñî SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ íå ïîäñîåäèí¸í"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Ýòî íå áóôåð SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Îøèáêà âî âðåìÿ çàïèñè. Îòñîåäèíåíèå"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "íåïðàâèëüíûé íîìåð áóôåðà"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "ïîêà íå ðåàëèçîâàíî"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "íåèçâåñòíàÿ îïöèÿ"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "íåâîçìîæíî íàçíà÷èòü ñòðîêó èëè ñòðîêè"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "îòìåòêà íå óñòàíîâëåíà"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "ðÿä %d êîëîíêà %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "íåâîçìîæíî âñòàâèòü èëè äîáàâèòü ñòðîêó"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "íåèçâåñòíûé ôëàã: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "íåèçâåñòíàÿ vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "êëàâèàòóðíîå ïðåðûâàíèå"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "îøèáêà vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "íåâîçìîæíî ñîçäàòü êîìàíäó áóôåðà èëè îêíà: îáúåêò â ïðîöåññå óäàëåíèÿ"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"íåâîçìîæíî çàðåãèñòðèðîâàòü êîìàíäó ñ îáðàòíûì âûçîâîì: áóôåð èëè îêíî â "
+"ïðîöåññå óäàëåíèÿ"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: ÊÐÈÒÈ×ÅÑÊÀß ÎØÈÁÊÀ TCL: ïîâðåæä¸í ñïèñîê ññûëîê?! Ñîîáùèòå îá ýòîì ïî "
+"àäðåñó vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"íåâîçìîæíî çàðåãèñòðèðîâàòü êîìàíäó ñ îáðàòíûì âûçîâîì: ññûëêà íà áóôåð èëè "
+"îêíî íå îáíàðóæåíà"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Ê ñîæàëåíèþ ýòà êîìàíäà íå ðàáîòàåò, ïîñêîëüêó íå çàãðóæåíà áèáëèîòåêà "
+"Tcl"
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: ÎØÈÁÊÀ TCL: Êîä âûõîäà íå ÿâëÿåòñÿ öåëûì ÷èñëîì?! Ñîîáùèòå îá ýòîì â "
+"vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "íåâîçìîæíî ïîëó÷èòü ñòðîêó"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "Íåâîçìîæíî çàðåãèñòðèðîâàòü èìÿ ñåðâåðà êîìàíä"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Îòïðàâêà êîìàíäû â äðóãóþ ïðîãðàììó íå óäàëàñü"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: Èñïîëüçóåòñÿ íåïðàâèëüíûé id ñåðâåðà: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr ""
+"E251: Íåïðàâèëüíî ñôîðìèðîâàíî çíà÷åíèå äàííîãî ïðîöåññà VIM â ðååñòðå. "
+"Óäàëåíî!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Íåèçâåñòíûé àðãóìåíò"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "Ñëèøêîì ìíîãî àðãóìåíòîâ ðåäàêòèðîâàíèÿ"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Ïðîïóùåí àðãóìåíò ïîñëå"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Ìóñîð ïîñëå àðãóìåíòà"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr ""
+"Ñëèøêîì ìíîãî àðãóìåíòîâ \"+êîìàíäà\", \"-c êîìàíäà\" èëè \"--cmd êîìàíäà\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Íåäîïóñòèìûå àðãóìåíòû äëÿ"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr ""
+"Äàííûé Vim áûë ñêîìïèëèðîâàí ñ âûêëþ÷åííîé îñîáåííîñòüþ ïðîñìîòðà îòëè÷èé"
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "Ïîïûòêà ïîâòîðíîãî îòêðûòèÿ ôàéëà ñöåíàðèÿ: \""
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "Íåâîçìîæíî îòêðûòü äëÿ ÷òåíèÿ: \""
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "Íåâîçìîæíî îòêðûòü äëÿ âûâîäà ñöåíàðèÿ: \""
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "Ôàéëîâ äëÿ ðåäàêòèðîâàíèÿ: %d\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Ïðåäóïðåæäåíèå: Âûâîä îñóùåñòâëÿåòñÿ íå íà òåðìèíàë\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Ïðåäóïðåæäåíèå: Ââîä ïðîèñõîäèò íå ñ òåðìèíàëà\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "êîìàíäíàÿ ñòðîêà ïåðåä âûïîëíåíèåì vimrc"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Íåâîçìîæíî âûïîëíèòü ÷òåíèå èç \"%s\""
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Äîïîëíèòåëüíàÿ èíôîðìàöèÿ: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[ôàéë ..] ðåäàêòèðîâàíèå óêàçàííûõ ôàéëîâ"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- ÷òåíèå òåêñòà èç ïîòîêà ââîäà stdin"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t ìåòêà ðåäàêòèðîâàíèå ôàéëà ñ óêàçàííîé ìåòêîé"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [ôàéë îøèáîê] ðåäàêòèðîâàíèå ôàéëà ñ ïåðâîé îøèáêîé"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"Èñïîëüçîâàíèå:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [àðãóìåíòû] "
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" èëè:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Àðãóìåíòû:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tÄàëåå óêàçûâàþòñÿ òîëüêî èìåíà ôàéëîâ"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tÍå âûïîëíÿòü ïîäñòàíîâêó ïî ìàñêå"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tÇàðåãèñòðèðîâàòü ýòîò gvim äëÿ OLE"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tÎòêëþ÷èòü ðåãèñòðàöèþ äàííîãî gvim äëÿ OLE"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tÇàïóñòèòü ñ ãðàôè÷åñêèì èíòåðôåéñîì (êàê \"gvim\")"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f èëè --nofork\t àêòèâíîé çàäà÷å: Íå âûïîëíÿòü fork ïðè çàïóñêå GUI"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tÐåæèì Vi (êàê \"vi\")"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tÐåæèì Ex (êàê \"ex\")"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tÒèõèé (ïàêåòíûé) ðåæèì (òîëüêî äëÿ \"ex\")"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tÐåæèì îòëè÷èé (êàê \"vimdiff\")"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tÏðîñòîé ðåæèì (êàê \"evim\", áåçðåæèìíûé)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tÒîëüêî äëÿ ÷òåíèÿ (êàê \"view\")"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tÎãðàíè÷åííûé ðåæèì (êàê \"rvim\")"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tÁåç âîçìîæíîñòè ñîõðàíåíèÿ èçìåíåíèé (çàïèñè ôàéëîâ)"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tÁåç âîçìîæíîñòè âíåñåíèÿ èçìåíåíèé â òåêñò"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tÁèíàðíûé ðåæèì"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tÐåæèì Lisp"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tÐåæèì ñîâìåñòèìîñòè ñ Vi: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tÐåæèì íåïîëíîé ñîâìåñòèìîñòè ñ Vi: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tÓðîâåíü ïîäðîáíîñòè ñîîáùåíèé"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tÐåæèì îòëàäêè"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tÁåç ñâîï-ôàéëà, èñïîëüçóåòñÿ òîëüêî ïàìÿòü"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tÂûâåñòè ñïèñîê ñâîï-ôàéëîâ è çàâåðøèòü ðàáîòó"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (ñ èìåíåì ôàéëà)\tÂîññòàíîâèòü àâàðèéíî çàâåðø¸ííûé ñåàíñ"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tÒî æå, ÷òî è -r"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tÍå èñïîëüçîâàòü newcli äëÿ îòêðûòèÿ îêíà"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <óñòðîéñòâî>\t\tÈñïîëüçîâàòü äëÿ I/O óêàçàííîå <óñòðîéñòâî>"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tÇàïóñê â Àðàáñêîì ðåæèìå"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tÇàïóñê â ðåæèìå \"Èâðèò\""
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tÇàïóñê â ðåæèìå \"Ôàðñè\""
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <òåðìèíàë>\tÍàçíà÷èòü óêàçàííûé òèï <òåðìèíàëà>"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tÈñïîëüçîâàòü <vimrc> âìåñòî ëþáûõ ôàéëîâ .vimrc"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tÈñïîëüçîâàòü <gvimrc> âìåñòî ëþáûõ ôàéëîâ .gvimrc"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tÍå çàãðóæàòü ñöåíàðèè ìîäóëåé"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tÎòêðûòü N îêîí (ïî óìîë÷àíèþ: ïî îäíîìó íà êàæäûé ôàéë)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tÒî æå, ÷òî è -o, íî ñ âåðòèêàëüíûì ðàçäåëåíèåì îêîí"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tÍà÷àòü ðåäàêòèðîâàíèå â êîíöå ôàéëà"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tÍà÷àòü ðåäàêòèðîâàíèå â ñòðîêå ñ íîìåðîì <lnum>"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <êîìàíäà>\tÂûïîëíèòü <êîìàíäó> ïåðåä çàãðóçêîé ôàéëà vimrc"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <êîìàíäà>\t\tÂûïîëíèòü <êîìàíäó> ïîñëå çàãðóçêè ïåðâîãî ôàéëà"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <ñåàíñ>\t\tÏðî÷èòàòü ñöåíàðèé <ñåàíñà> ïîñëå çàãðóçêè ïåðâîãî ôàéëà"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <ñöåíàðèé>\tÏðî÷èòàòü êîìàíäû Îáû÷íîãî ðåæèìà èç ôàéëà <ñöåíàðèÿ>"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <ñöåíàðèé>\tÄîáàâëÿòü âñå ââåä¸ííûå êîìàíäû â ôàéë <ñöåíàðèÿ>"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <ñöåíàðèé>\tÇàïèñàòü âñå ââåä¸ííûå êîìàíäû â ôàéë <ñöåíàðèÿ>"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tÐåäàêòèðîâàíèå çàøèôðîâàííûõ ôàéëîâ"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <ýêðàí>\tÏîäñîåäèíèòü vim ê óêàçàííîìó ñåðâåðó X"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tÍå âûïîëíÿòü ñîåäèíåíèå ñ ñåðâåðîì X"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <ôàéëû>\tÏî âîçìîæíîñòè ðåäàêòèðîâàòü <ôàéëû> íà ñåðâåðå Vim"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <ôàéëû> Òî æå, íî áåç æàëîá íà îòñóòñòâèå ñåðâåðà"
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <ôàéëû> Òî æå, ÷òî è --remote, íî ñ îæèäàíèåì çàâåðøåíèÿ"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <ôàéëû> Òî æå, íî áåç æàëîá íà îòñóòñòâèå ñåðâåðà"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <êíîïêè>\tÎòïðàâèòü <êíîïêè> íà ñåðâåð Vim è âûéòè"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <âûðàæ>\tÂû÷èñëèòü <âûðàæ> íà ñåðâåðå Vim è íàïå÷àòàòü"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tÏîêàçàòü ñïèñîê èì¸í ñåðâåðîâ Vim è çàâåðøèòü ðàáîòó"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr ""
+"--servername <èìÿ>\tÎòïðàâèòü íà/ñòàòü ñåðâåðîì Vim ñ óêàçàííûì <èìåíåì>"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tÈñïîëüçîâàòü âìåñòî .viminfo ôàéë <viminfo>"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h èëè --help\tÂûâåñòè ñïðàâêó (ýòî ñîîáùåíèå) è çàâåðøèòü ðàáîòó"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tÂûâåñòè èíôîðìàöèþ î âåðñèè Vim è çàâåðøèòü ðàáîòó"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Àðãóìåíòû äëÿ gvim (âåðñèÿ Motif):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Àðãóìåíòû äëÿ gvim (âåðñèÿ neXtaw):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Àðãóìåíòû äëÿ gvim (âåðñèÿ Athena):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <äèñïëåé>\tÇàïóñòèòü vim íà óêàçàííîì <äèñïëåå>"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tÇàïóñòèòü vim â ñâ¸ðíóòîì âèäå"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <èìÿ>\t\tÈñïîëüçîâàòü ðåñóðñ, êàê åñëè áû vim áûë <èìåíåì>"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Íå ðåàëèçîâàíî)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr ""
+"-background <öâåò>\tÈñïîëüçîâàòü óêàçàííûé <öâåò> äëÿ ôîíà (òàêæå: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr ""
+"-foreground <öâåò>\tÈñïîëüçîâàòü <öâåò> äëÿ îáû÷íîãî òåêñòà (òàêæå: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <øðèôò>\t\tÈñïîëüçîâàòü <øðèôò> äëÿ îáû÷íîãî òåêñòà (òàêæå: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <øðèôò>\tÈñïîëüçîâàòü <øðèôò> äëÿ æèðíîãî òåêñòà"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <øðèôò>\tÈñïîëüçîâàòü <øðèôò> äëÿ íàêëîííîãî òåêñòà"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <ãåîìåòðèÿ>\tÈñïîëüçîâàòü íà÷àëüíóþ <ãåîìåòðèþ> (òàêæå: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <øèðèíà>\tÈñïîëüçîâàòü <øèðèíó> áîðäþðà (òàêæå: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <øèðèíà> Èñïîëüçîâàòü øèðèíó ïîëîñû ïðîêðóòêè (òàêæå: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <âûñîòà>\tÈñïîëüçîâàòü <âûñîòó> ìåíþ (òàêæå: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tÈñïîëüçîâàòü èíâåðñíûé âèäåîðåæèì (òàêæå: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tÍå èñïîëüçîâàòü èíâåðñíûé âèäåîðåæèì (òàêæå: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <ðåñóðñ>\tÓñòàíîâèòü óêàçàííûé <ðåñóðñ>"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Àðãóìåíòû äëÿ gvim (âåðñèÿ RISC OS):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <÷èñëî>\tÏåðâîíà÷àëüíàÿ øèðèíà îêíà â êîëîíêàõ"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <÷èñëî>\tÏåðâîíà÷àëüíàÿ âûñîòà îêíà â ñòðîêàõ"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Àðãóìåíòû äëÿ gvim (âåðñèÿ GTK+):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr ""
+"-display <äèñïëåé>\tÇàïóñòèòü vim íà óêàçàííîì <äèñïëåå> (òàêæå: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr ""
+"--role <ðîëü>\tÓñòàíîâèòü óíèêàëüíóþ <ðîëü> äëÿ èäåíòèôèêàöèè ãëàâíîãî îêíà"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÎòêðûòü Vim âíóòðè äðóãîãî êîìïîíåíòà GTK"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <çàãîëîâîê ðîäèòåëÿ>\tÎòêðûòü Vim â ðîäèòåëüñêîì ïðèëîæåíèè"
+
+#: main.c:2847
+msgid "No display"
+msgstr "Íåò äèñïëåÿ"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": Îòïðàâêà íå óäàëàñü.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Îòïðàâêà íå óäàëàñü. Ïîïûòêà ìåñòíîãî âûïîëíåíèÿ\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "îòðåäàêòèðîâàíî %d èç %d"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "Íåò äèñïëåÿ: îòïðàâêà âûðàæåíèÿ íå óäàëàñü.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": Îòïðàâêà âûðàæåíèÿ íå óäàëàñü.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "Íåò óñòàíîâëåííûõ îòìåòîê"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Íåò îòìåòîê, ñîâïàäàþùèõ ñ \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"îòìåò ñòð êîë ôàéë/òåêñò"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+"ïðûæîê ñòð êîë ôàéë/òåêñò"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"èçìåí. ñòð êîë òåêñò"
+
+#: mark.c:1281
+#, c-format
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Ãëîáàëüíûå îòìåòêè:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+#, c-format
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Ñïèñîê ïðûæêîâ (ñíà÷àëà áîëåå ñâåæèå):\n"
+
+#: mark.c:1412
+#, c-format
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Èñòîðèÿ ìåñòíûõ îòìåòîê (îò áîëåå ñâåæèõ ê ñòàðûì):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "Ïðîïóùåíà '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: Íåäîïóñòèìîå èìÿ êîäèðîâêè"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: Íåâîçìîæíî íàçíà÷èòü çíà÷åíèÿ êîíòåêñòà ââîäà"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: Íåâîçìîæíî ñîçäàòü êîíòåêñò ââîäà"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: Íåóäà÷íàÿ ïîïûòêà îòêðûòü ìåòîä ââîäà"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr ""
+"E287: Ïðåäóïðåæäåíèå: íåâîçìîæíî íàçíà÷èòü îáð. âûçîâ óíè÷òîæåíèÿ ìåòîäà "
+"ââîäà"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ìåòîä ââîäà íå ïîääåðæèâàåò ñòèëè"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr ""
+"E289: ìåòîä ââîäà íå ïîääåðæèâàåò ìîé òèï ïðåäâàðèòåëüíîãî ðåäàêòèðîâàíèÿ"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: ñòèëü \"íàä ìåñòîì\" òðåáóåò óêàçàíèÿ øðèôòîâîãî íàáîðà"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr ""
+"E291: GTK+ áîëåå ðàííåé âåðñèè, ÷åì 1.2.3. Îáëàñòü ñîñòîÿíèÿ íå ðàáîòàåò."
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Ñåðâåð ìåòîäà ââîäà íå çàïóùåí"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: áëîê íå çàáëîêèðîâàí"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Îøèáêà ïîèñêà ïðè ÷òåíèè ñâîï-ôàéëà"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: Îøèáêà ÷òåíèÿ ñâîï-ôàéëà"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Îøèáêà ïîèñêà ïðè çàïèñè ñâîï-ôàéëà"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: Îøèáêà ïðè çàïèñè ñâîï-ôàéëà"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr ""
+"E300: Ñâîï-ôàéë óæå ñóùåñòâóåò (àòàêà ñ èñïîëüçîâàíèåì ñèìâîëüíîé ññûëêè?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Íå ïîëó÷åí áëîê íîìåð 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Íå ïîëó÷åí áëîê íîìåð 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Íå ïîëó÷åí áëîê íîìåð 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Îé, ïîòåðÿëñÿ ñâîï-ôàéë!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Íåâîçìîæíî ïåðåèìåíîâàòü ñâîï-ôàéë"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr ""
+"E303: Íå óäàëîñü îòêðûòü ñâîï-ôàéë äëÿ \"%s\", âîññòàíîâëåíèå íåâîçìîæíî"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Íå ïîëó÷åí áëîê 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Ñâîï-ôàéë äëÿ %s íå íàéäåí"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"Ââåäèòå íîìåð ñâîï-ôàéëà, êîòîðûé ñëåäóåò èñïîëüçîâàòü (0 äëÿ âûõîäà): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Íå ìîãó îòêðûòü %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Íåâîçìîæíî ïðî÷èòàòü áëîê 0 èç "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Íåò èçìåíåíèé, èëè Vim íå ñìîã îáíîâèòü ñâîï-ôàéë"
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " íåëüçÿ èñïîëüçîâàòü â äàííîé âåðñèè Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Èñïîëüçóéòå Vim âåðñèè 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s íå ÿâëÿåòñÿ ñâîï-ôàéëîì Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " íåëüçÿ èñïîëüçîâàòü íà ýòîì êîìïüþòåðå.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Ôàéë áûë ñîçäàí "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"ëèáî ôàéë áûë ïîâðåæä¸í."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Èñïîëüçóåòñÿ ñâîï-ôàéë \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Èñõîäíûé ôàéë \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Ïðåäóïðåæäåíèå: èñõîäíûé ôàéë ìîã áûòü èçìåí¸í"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Íåâîçìîæíî ïðî÷èòàòü áëîê 1 èç %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???ÎÒÑÓÒÑÒÂÓÅÒ ÌÍÎÃÎ ÑÒÐÎÊ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???ÍÅÏÐÀÂÈËÜÍÎÅ ÇÍÀ×ÅÍÈÅ Ñ×ÅÒ×ÈÊÀ ÑÒÐÎÊ"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???ÏÓÑÒÎÉ ÁËÎÊ"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???ÎÒÑÓÒÑÒÂÓÞÒ ÑÒÐÎÊÈ"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: íåïðàâèëüíûé áëîê 1 ID (%s íå ÿâëÿåòñÿ ôàéëîì .swp?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???ÏÐÎÏÓÙÅÍ ÁËÎÊ"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "???ñòðîêè ìîãóò áûòü èñïîð÷åíû îòñþäà äî ???ÊÎÍÖÀ"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "???ñòðîêè ìîãëè áûòü âñòàâëåíû èëè óäàëåíû îòñþäà äî ???ÊÎÍÖÀ"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???ÊÎÍÅÖ"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Âîññòàíîâëåíèå ïðåðâàíî"
+
+#: memline.c:1148
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Âî âðåìÿ âîññòàíîâëåíèÿ îáíàðóæåíû îøèáêè; ñì. ñòðîêè, íà÷èíàþùèåñÿ "
+"ñ ???"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "Ñì. äîïîëíèòåëüíóþ èíôîðìàöèþ â ñïðàâî÷íèêå (\":help E312\")"
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Âîññòàíîâëåíèå çàâåðøåíî. Ïðîâåðüòå, âñ¸ ëè â ïîðÿäêå."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Ìîæåòå çàïèñàòü ôàéë ïîä äðóãèì èìåíåì è ñðàâíèòü åãî ñ èñõîäíûì\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "ôàéëîì ïðè ïîìîùè ïðîãðàììû diff).\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Çàòåì óäàëèòå ôàéë .swp.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "Îáíàðóæåíû ñâîï-ôàéëû:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " Â òåêóùåì êàòàëîãå:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " Ñ óêàçàííûì èìåíåì:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " Â êàòàëîãå "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- íåò --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " âëàäåëåö: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " äàòà: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " äàòà: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [îò Vim âåðñèè 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [íå ÿâëÿåòñÿ ñâîï-ôàéëîì Vim]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " èìÿ ôàéëà: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" èçìåí¸í: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "ÄÀ"
+
+#: memline.c:1525
+msgid "no"
+msgstr "íåò"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ïîëüçîâàòåëü: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " êîìïüþòåð: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" êîìïüþòåð: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ïðîöåññ: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (åù¸ âûïîëíÿåòñÿ)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [íå ïðèãîäåí äëÿ èñïîëüçîâàíèÿ ñ äàííîé âåðñèåé Vim]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [íå ïðèãîäåí äëÿ èñïîëüçîâàíèÿ íà ýòîì êîìïüþòåðå]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [íå ÷èòàåòñÿ]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [íå îòêðûâàåòñÿ]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Íåâîçìîæíî îáíîâèòü ñâîï-ôàéë, ïîñêîëüêó îí íå îáíàðóæåí"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "Ñâîï-ôàéë îáíîâë¸í"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: Íåóäà÷íàÿ ïîïûòêà îáíîâëåíèÿ ñâîï-ôàéëà"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: íåïðàâèëüíîå çíà÷åíèå lnum: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: íåâîçìîæíî íàéòè ñòðîêó %ld"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "íåïðàâèëüíîå çíà÷åíèå óêàçàòåëÿ áëîêà 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "çíà÷åíèå stack_idx äîëæíî áûòü ðàâíî 0"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Îáíîâëåíî ñëèøêîì ìíîãî áëîêîâ?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: íåïðàâèëüíîå çíà÷åíèå óêàçàòåëÿ áëîêà 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "óäàë¸í áëîê 1?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Ñòðîêà %ld íå îáíàðóæåíà"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: íåïðàâèëüíîå çíà÷åíèå óêàçàòåëÿ áëîêà"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "çíà÷åíèå pe_line_count ðàâíî íóëþ"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: íîìåð ñòðîêè çà ïðåäåëàìè äèàïàçîíà: %ld"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: íåïðàâèëüíîå çíà÷åíèå ñ÷¸ò÷èêà ñòðîê â áëîêå %ld"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "Ðàçìåð ñòåêà óâåëè÷åí"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: íåïðàâèëüíîå çíà÷åíèå óêàçàòåëÿ áëîêà 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: ÂÍÈÌÀÍÈÅ"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Îáíàðóæåí ñâîï-ôàéë ñ èìåíåì \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "Ïðè îòêðûòèè ôàéëà: \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " Áîëåå ÑÂÅÆÈÉ, ÷åì ñâîï-ôàéë!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Âîçìîæíî, ðåäàêòèðîâàíèå ôàéëà âûïîëíÿåòñÿ â äðóãîé ïðîãðàììå.\n"
+" Åñëè ýòî òàê, òî áóäüòå âíèìàòåëüíû ïðè âíåñåíèè èçìåíåíèé,\n"
+" ÷òîáû ó âàñ íå ïîÿâèëîñü äâà ðàçíûõ âàðèàíòà îäíîãî è òîãî æå ôàéëà.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " Çàâåðøèòå ðàáîòó èëè ïðîäîëæàéòå ñ îñòîðîæíîñòüþ.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Ïðåäûäóùèé ñåàíñ ðåäàêòèðîâàíèÿ ýòîãî ôàéëà çàâåðø¸í àâàðèéíî.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr "  ýòîì ñëó÷àå, èñïîëüçóéòå êîìàíäó \":recover\" èëè \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" äëÿ âîññòàíîâëåíèÿ èçìåíåíèé (ñì. \":help âîññòàíîâëåíèå\").\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " Åñëè âû óæå âûïîëíÿëè ýòó îïåðàöèþ, óäàëèòå ñâîï-ôàéë \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ÷òîáû èçáåæàòü ïîÿâëåíèÿ ýòîãî ñîîáùåíèÿ â áóäóùåì.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "Ñâîï-ôàéë \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" óæå ñóùåñòâóåò!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - ÂÍÈÌÀÍÈÅ"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "Ñâîï-ôàéë óæå ñóùåñòâóåò!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&O Îòêðûòü äëÿ ÷òåíèÿ\n"
+"&E Ðåäàêòèðîâàòü\n"
+"&R Âîññòàíîâèòü\n"
+"&Q Âûõîä\n"
+"&A Ïðåðâàòü"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&O Îòêðûòü äëÿ ÷òåíèÿ\n"
+"&E Ðåäàêòèðîâàòü\n"
+"&R Âîññòàíîâèòü\n"
+"&Q Âûõîä\n"
+"&A Ïðåðâàòü\n"
+"&D Óäàëèòü"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: Îáíàðóæåíî ñëèøêîì ìíîãî ñâîï-ôàéëîâ"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Êîìïîíåíò ïóòè ê ýëåìåíòó ìåíþ íå ÿâëÿåòñÿ ïîäìåíþ"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Ìåíþ â ýòîì ðåæèìå íå ñóùåñòâóåò"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Íåò ìåíþ ñ òàêèì èìåíåì"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Ïóòü ê ìåíþ íå äîëæåí âåñòè ê ïîäìåíþ"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Ýëåìåíòû ìåíþ íåëüçÿ äîáàâëÿòü íåïîñðåäñòâåííî â ïîëîñêó ìåíþ"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Ðàçäåëèòåëè íå ìîãóò áûòü êîìïîíåíòîì ïóòè ê ìåíþ"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Ìåíþ ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "Îòîðâàòü ýòî ìåíþ"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Ïóòü ê ìåíþ äîëæåí âåñòè ê ýëåìåíòó ìåíþ"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Ìåíþ íå íàéäåíî: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Ìåíþ íå îïðåäåëåíî äëÿ ðåæèìà %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Ïóòü ê ìåíþ äîëæåí âåñòè ê ïîäìåíþ"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Ìåíþ íå íàéäåíî -- ïðîâåðüòå èìåíà ìåíþ"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Îáíàðóæåíà îøèáêà ïðè îáðàáîòêå %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "ñòðîêà %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[ñëèøêîì äëèííàÿ ñòðîêà]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"Ïåðåâîä ñîîáùåíèé íà ðóññêèé ÿçûê: Âàñèëèé Ðàãîçèí <vrr@users.sourceforge."
+"net>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "Ïðåðûâàíèå: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "Äëÿ ïðîäîëæåíèÿ íàæìèòå ENTER"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "Äëÿ ïðîäîëæåíèÿ íàæìèòå ENTER èëè ââåäèòå êîìàíäó"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- Ïðîäîëæåíèå ñëåäóåò --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ñòðîêà, SPACE/b: ñòðàíèöà, d/u: ïîëñòðàíèöû, q: âûõîä)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ñòðîêà, SPACE: ñòðàíèöà, d: ïîëñòðàíèöû, q: âûõîä)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "Âîïðîñ"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Äà\n"
+"&Íåò"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Äà\n"
+"&Íåò\n"
+"Ñîõðàíèòü &âñå\n"
+"&Ïîòåðÿòü âñå\n"
+"Î&òìåíà"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "Ñîõðàíåíèå ôàéëà"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "Îòêðûòèå ôàéëà"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr ""
+"E338: Èçâèíèòå, íî â êîíñîëüíîì ðåæèìå íåò ïðîâîäíèêà ïî ôàéëîâîé ñèñòåìå"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Ïðåäóïðåæäåíèå: Èçìåíåíèå ôàéëà ñ ïðàâàìè òîëüêî äëÿ ÷òåíèÿ"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "Äîáàâëåíà îäíà ñòðîêà"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "Óäàëåíà îäíà ñòðîêà"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "Äîáàâëåíî ñòðîê: %ld"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "Óäàëåíî ñòðîê: %ld"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (Ïðåðâàíî)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ñîõðàíÿþòñÿ ôàéëû...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "Vim: Ãîòîâî.\n"
+
+#: misc2.c:695 misc2.c:711
+#, c-format
+msgid "ERROR: "
+msgstr "ÎØÈÁÊÀ: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[áàéò] âñåãî âûäåë.-îñâîá. %lu-%lu, èñïîëüç. %lu, ìàêñ. èñïîëüç. %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[âûçîâû] re/malloc() âñåãî %lu, free() âñåãî %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: Ñòðîêà ñòàíîâèòñÿ ñëèøêîì äëèííîé"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Âíóòðåííÿÿ îøèáêà: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Íå õâàòàåò ïàìÿòè! (âûäåëÿåòñÿ %lu áàéò)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Âûçîâ îáîëî÷êè äëÿ èñïîëíåíèÿ: \"%s\""
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: Ïðîïóùåíî äâîåòî÷èå"
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: Íåäîïóñòèìûé ðåæèì"
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Íåäîïóñòèìàÿ ôîðìà êóðñîðà"
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: òðåáóåòñÿ ââåñòè öèôðó"
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: Íåäîïóñòèìîå çíà÷åíèå ïðîöåíòîâ"
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "Ââåäèòå ïàðîëü äëÿ øèôðîâàíèÿ: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr " Ïîâòîðèòå ââîä ïàðîëÿ:"
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "Ââåä¸ííûå ïàðîëè íå ñîâïàäàþò!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Íåïðàâèëüíî çàäàí ïóòü: '**[÷èñëî]' äîëæíî áûòü ëèáî â êîíöå ïóòè, "
+"ëèáî çà íèì äîëæíî ñëåäîâàòü '%s'"
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Êàòàëîã \"%s\" íå íàéäåí â ïóòè äëÿ ñìåíû êàòàëîãà"
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Ôàéë \"%s\" â èçâåñòíûõ êàòàëîãàõ íå íàéäåí"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Â ïóòè ñìåíû êàòàëîãà áîëüøå íåò êàòàëîãîâ \"%s\""
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Â èçâåñòíûõ êàòàëîãàõ áîëüøå íåò ôàéëîâ \"%s\""
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: Ïðîïóùåíî äâîåòî÷èå"
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: Íåäîïóñòèìûé êîìïîíåíò"
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: Òðåáóåòñÿ óêàçàòü öèôðó"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "Íåâîçìîæíî ñîåäèíèòüñÿ ñ Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "Íåâîçìîæíî ñîåäèíèòüñÿ ñ NetBeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: Íåïðàâèëüíûé ðåæèì äîñòóïà ê èíôîðìàöèè î ñîåäèíåíèè ñ NetBeans: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "÷òåíèå èç ãíåçäà NetBeans"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: Ïîòåðÿíî ñîåäèíåíèå ñ NetBeans äëÿ áóôåðà %ld"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "Ïðåäóïðåæäåíèå: òåðìèíàë íå ìîæåò âûïîëíÿòü ïîäñâåòêó"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: Íåò ñòðîêè â ïîçèöèè êóðñîðà"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: Íåò èìåíè â ïîçèöèè êóðñîðà"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr ""
+"E352: Íåâîçìîæíî ñòåðåòü ñêëàäêè ñ òåêóùèì çíà÷åíèåì îïöèè 'foldmethod'"
+
+#: normal.c:6740
+msgid "E664: changelist is empty"
+msgstr "E664: ñïèñîê èçìåíåíèé ïóñòîé"
+
+#: normal.c:6742
+msgid "E662: At start of changelist"
+msgstr "E662:  íà÷àëå ñïèñêà èçìåíåíèé"
+
+#: normal.c:6744
+msgid "E663: At end of changelist"
+msgstr "E662: Â êîíöå ñïèñêà èçìåíåíèé"
+
+#: normal.c:8005
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "Ââåäèòå :quit<Enter> äëÿ âûõîäà èç Vim"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "Èçìåíåíû îòñòóïû â 1 ñòðîêå (%s 1 ðàç)"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "Èçìåíåíû îòñòóïû â 1 ñòðîêå (%s %d ðàç)"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "Èçìåíåíû îòñòóïû, %ld ñòðîê (%s 1 ðàç)"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "Èçìåíåíû îòñòóïû, %ld ñòðîê (%s %d ðàç)"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "Èçìåíÿþòñÿ îòñòóïû ñòðîêàõ (%ld)..."
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "Èçìåí¸í îòñòóï â îäíîé ñòðîêå "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "Èçìåíåíû îòñòóïû â ñòðîêàõ (%ld) "
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "ñêîïèðîâàòü íå óäàëîñü, óäàëåíèå âûïîëíåíî"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "èçìåíåíà 1 ñòðîêà"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "èçìåíåíî ñòðîê: %ld"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "î÷èùåíî ñòðîê: %ld"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "ñêîïèðîâàíà îäíà ñòðîêà"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "ñêîïèðîâàíî ñòðîê: %ld"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353:  ðåãèñòðå %s íè÷åãî íåò"
+
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Ðåãèñòðû ---"
+
+#: ops.c:5075
+msgid "Illegal register name"
+msgstr "Íåäîïóñòèìîå èìÿ ðåãèñòðà"
+
+#: ops.c:5163
+#, c-format
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Ðåãèñòðû:\n"
+
+#: ops.c:5213
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Íåèçâåñòíûé òèï ðåãèñòðà %d"
+
+#: ops.c:5698
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Íåäîïóñòèìîå èìÿ ðåãèñòðà: '%s'"
+
+#: ops.c:6058
+#, c-format
+msgid "%ld Cols; "
+msgstr "Êîëîíîê: %ld; "
+
+#: ops.c:6065
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Âûäåëåíî %s%ld èç %ld ñòðîê; %ld èç %ld ñëîâ; %ld èç %ld áàéò"
+
+#: ops.c:6081
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Êîë. %s èç %s; ñòð. %ld èç %ld; ñëîâî %ld èç %ld; áàéò %ld èç %ld"
+
+#: ops.c:6092
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld ñ ó÷¸òîì BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Ñòð. %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "Áëàãîäàðèì çà èñïîëüçîâàíèå Vim"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: Íåèçâåñòíàÿ îïöèÿ"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: Îïöèÿ íå ïîääåðæèâàåòñÿ"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Íå äîïóñêàåòñÿ â ðåæèìíîé ñòðîêå"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t ïîñëåäíèé ðàç îïöèÿ èçìåíåíà â "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: Ïîñëå = òðåáóåòñÿ óêàçàòü ÷èñëî"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: Íå îáíàðóæåíî â termcap"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Íåäîïóñòèìûé ñèìâîë <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Çíà÷åíèå îïöèè 'term' íå ìîæåò áûòü ïóñòîé ñòðîêîé"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530:  ãðàôè÷åñêîì èíòåðôåéñå èçìåíÿòü òåðìèíàë íåâîçìîæíî"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Äëÿ çàïóñêà ãðàôè÷åñêîãî èíòåðôåéñà èñïîëüçóéòå \":gui\""
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: çíà÷åíèÿ îïöèé 'backupext' è 'patchmode' ðàâíû"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Íå ìîæåò áûòü èçìåíåíî â ãðàôè÷åñêîì èíòåðôåéñå GTK+ 2"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: Ïðîïóùåíî äâîåòî÷èå"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: Ñòðîêà ñ íóëåâîé äëèíîé"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Ïðîïóùåíî ÷èñëî ïîñëå <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: Ïðîïóùåíà çàïÿòàÿ"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: Íåîáõîäèìî óêàçàòü çíà÷åíèå äëÿ '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: ñîäåðæèò íåïå÷àòíûé ñèìâîë èëè ñèìâîë äâîéíîé øèðèíû"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: Íåïðàâèëüíûå øðèôòû"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: íåâîçìîæíî âûáðàòü øðèôòîâîé íàáîð"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: Íåïðàâèëüíûé øðèôòîâîé íàáîð"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: íåâîçìîæíî âûáðàòü øðèôò ñ ñèìâîëàìè äâîéíîé øèðèíû"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: Íåïðàâèëüíûé øðèôò ñ ñèìâîëàìè äâîéíîé øèðèíû"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Íåïðàâèëüíûé ñèìâîë ïîñëå <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: òðåáóåòñÿ çàïÿòàÿ"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr ""
+"E537: Çíà÷åíèå îïöèÿ 'commentstring' äîëæíî áûòü ïóñòîé ñòðîêîé èëè "
+"ñîäåðæàòü %s"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: Ìûøü íå ïîääåðæèâàåòñÿ"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Íåçàêðûòàÿ ïîñëåäîâàòåëüíîñòü âûðàæåíèÿ"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: ñëèøêîì ìíîãî ýëåìåíòîâ"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: íåñáàëàíñèðîâàííûå ãðóïïû"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: Îêíî ïðåäïðîñìîòðà óæå åñòü"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr ""
+"W17: Àðàáñêèé òðåáóåò èñïîëüçîâàíèÿ UTF-8, ââåäèòå ':set encoding=utf-8'"
+
+#: option.c:6783
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Íóæíî õîòÿ áû %d ñòðîê"
+
+#: option.c:6793
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Íóæíî õîòÿ áû %d êîëîíîê"
+
+#: option.c:7100
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Íåèçâåñòíàÿ îïöèÿ: %s"
+
+#: option.c:7220
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Òåðìèíàëüíûå êîäû ---"
+
+#: option.c:7222
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Ãëîáàëüíûå çíà÷åíèÿ îïöèé ---"
+
+#: option.c:7224
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Ìåñòíûå çíà÷åíèÿ îïöèé ---"
+
+#: option.c:7226
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Îïöèè ---"
+
+#: option.c:7932
+msgid "E356: get_varp ERROR"
+msgstr "E356: ÎØÈÁÊÀ get_varp"
+
+#: option.c:8903
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Íåò ñîîòâåòñòâóþùåãî ñèìâîëà äëÿ %s"
+
+#: option.c:8937
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Ëèøíèå ñèìâîëû ïîñëå òî÷êè ñ çàïÿòîé: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "íåâîçìîæíî îòêðûòü "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Íåâîçìîæíî îòêðûòü îêíî!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Íåîáõîäèìà Amigados âåðñèè 2.04 èëè áîëåå ïîçäíåé\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Íåîáõîäèìà %s âåðñèè %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "Íåâîçìîæíî îòêðûòü NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "Íåâîçìîæíî ñîçäàòü "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Ïðåêðàùåíèå ðàáîòû Vim ñ êîäîì %d\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "íåâîçìîæíî ñìåíèòü ðåæèì êîíñîëè?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: íå â êîíñîëè??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Íåâîçìîæíî âûïîëíèòü îáîëî÷êó ñ àðãóìåíòîì -f"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "Íåâîçìîæíî âûïîëíèòü "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "îáîëî÷êà "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " çàâåðøèëà ðàáîòó\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ñëèøêîì ìàëàÿ âåëè÷èíà ANCHOR_BUF_SIZE."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "ÎØÈÁÊÀ ÂÂÎÄÀ/ÂÛÂÎÄÀ"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(îáðåçàíî)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "Çíà÷åíèå îïöèè 'columns' íå ðàâíî 80, âíåøíèå ïðîãðàììû íå âûïîëíÿþòñÿ"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E327: Íåóäà÷íîå çàâåðøåíèå âûáîðà ïðèíòåðà"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "â %s íà %s"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Íåèçâåñòíûé øðèôò ïðèíòåðà: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Îøèáêà ïå÷àòè: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "Íåèçâåñòíî"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "Ïå÷àòü '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Íåäîïóñòèìîå èìÿ êîäèðîâêè \"%s\" â èìåíè øðèôòà \"%s\""
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Íåäîïóñòèìûé ñèìâîë '%c' â èìåíè øðèôòà \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Íåäîïóñòèìîå çíà÷åíèå îïöèè 'osfiletype' -- èñïîëüçóåòñÿ Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Äâîéíîé ñèãíàë, çàâåðøåíèå ðàáîòû\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Ïîëó÷åí óáèéñòâåííûé ñèãíàë %s\n"
+
+#: os_unix.c:936
+#, c-format
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Ïîëó÷åí óáèéñòâåííûé ñèãíàë\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Îòêðûòèå äèñïëåÿ X çàíÿëî %ld msec"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Îøèáêà X\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "Ïðîâåðêà äèñïëåÿ X çàâåðøåíà íåóäà÷íî"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "Îòêðûòèå äèñïëåÿ X íå âûïîëíåíî â îòâåä¸ííîå âðåìÿ"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Íåâîçìîæíî çàïóñòèòü îáîëî÷êó "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Íåâîçìîæíî çàïóñòèòü îáîëî÷êó sh\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Îáîëî÷êà çàâåðøèëà ðàáîòó "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Íåâîçìîæíî ñîçäàòü òðóáû\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Íåâîçìîæíî âûïîëíèòü fork()\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Âûïîëíåíèå êîìàíäû ïðåðâàíî\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP óòåðÿíî ñîåäèíåíèå ICE"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "Íåóäà÷íîå îòêðûòèå äèñïëåÿ X"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP îáðàáàòûâàåò çàïðîñ ñàìîñîõðàíåíèÿ"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP îòêðûâàåò ñîåäèíåíèå"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP ïîòåðÿíî ñëåæåíèå çà ñîåäèíåíèåì ICE"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP íåóäà÷íî âûïîëíåíî SmcOpenConnection: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Â ñòðîêå"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Íåâîçìîæíî âûäåëèòü ïàìÿòü äëÿ êîìàíäíîé ñòðîêè."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "Îøèáêà VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Íåâîçìîæíî çàãðóçèòü vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Íåâîçìîæíî èñïðàâèòü óêàçàòåëè ôóíêöèé äëÿ DLL!"
+
+#: os_win16.c:342 os_win32.c:3216
+#, c-format
+msgid "shell returned %d"
+msgstr "çàâåðøåíèå ðàáîòû îáîëî÷êè ñ êîäîì %d"
+
+#: os_win32.c:2674
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Ïåðåõâà÷åíî ñîáûòèå %s\n"
+
+#: os_win32.c:2676
+msgid "close"
+msgstr "çàêðûòèå"
+
+#: os_win32.c:2678
+msgid "logoff"
+msgstr "îòêëþ÷åíèå"
+
+#: os_win32.c:2679
+msgid "shutdown"
+msgstr "çàâåðøåíèå"
+
+#: os_win32.c:3169
+msgid "E371: Command not found"
+msgstr "E371: Êîìàíäà íå íàéäåíà"
+
+#: os_win32.c:3182
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE íå íàéäåí â ïóòè, çàäàííîì â $PATH.\n"
+"Âíåøíèå êîìàíäû íå áóäóò îñòàíàâëèâàòüñÿ ïîñëå âûïîëíåíèÿ.\n"
+"Äîïîëíèòåëüíàÿ èíôîðìàöèÿ â :help win32-vimrun"
+
+#: os_win32.c:3185
+msgid "Vim Warning"
+msgstr "Ïðåäóïðåæäåíèå Vim"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Â ñòðîêå ôîðìàòà ñëèøêîì ìíîãî %%%c"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Íåîæèäàííûé ýëåìåíò %%%c â ñòðîêå ôîðìàòà"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Â ñòðîêå ôîðìàòà ïðîïóùåíà ]"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c íå ïîääåðæèâàåòñÿ â ñòðîêå ôîðìàòà"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Íåäîïóñòèìûé %%%c â ïðèñòàâêå â ñòðîêå ôîðìàòà"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Íåäîïóñòèìûé %%%c â ñòðîêå ôîðìàòà"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378:  çíà÷åíèè îïöèè 'errorformat' îòñóòñòâóåò øàáëîí"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: èìÿ êàòàëîãà íå çàäàíî èëè ðàâíî ïóñòîé ñòðîêå"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: Áîëüøå íåò ýëåìåíòîâ"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d èç %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (ñòðîêà óäàëåíà)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Âíèçó ñòåêà áûñòðûõ èñïðàâëåíèé"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Íàâåðõó ñòåêà áûñòðûõ èñïðàâëåíèé"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "ñïèñîê îøèáîê %d èç %d; %d îøèáîê"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr ""
+"E382: Çàïèñü íåâîçìîæíà, çíà÷åíèå îïöèè 'buftype' íå ÿâëÿåòñÿ ïóñòîé ñòðîêîé"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: íåäîïóñòèìûé ýëåìåíò â %s%%[]"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: Ñëèøêîì äëèííûé øàáëîí"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: Ñëèøêîì ìíîãî \\z("
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: Ñëèøêîì ìíîãî %s("
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: Íåò ïàðû äëÿ \\z("
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Íåò ïàðû äëÿ %s%%("
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Íåò ïàðû äëÿ %s("
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Íåò ïàðû äëÿ %s)"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: âîçìîæíî ïóñòîé îïåðàíä %s*"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: âîçìîæíî ïóñòîé îïåðàíä %s+"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: íåäîïóñòèìûé ñèìâîë ïîñëå %s@"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: âîçìîæíî ïóñòîé îïåðàíä %s{"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: Ñëèøêîì ìíîãî ñëîæíûõ êîíñòðóêöèé %s{...}"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Âëîæåííûå %s*"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Âëîæåííûå %s%c"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: íåäîïóñòèìîå èñïîëüçîâàíèå \\_"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c íè çà ÷åì íå ñëåäóåò"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: Íåäîïóñòèìàÿ îáðàòíàÿ ññûëêà"
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( íå ìîæåò áûòü èñïîëüçîâàíî çäåñü"
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 è ò.ï. íå ìîãóò áûòü èñïîëüçîâàíû çäåñü"
+
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Íåäîïóñòèìûé ñèìâîë ïîñëå \\z"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Ïðîïóùåíà ] ïîñëå %s%%["
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Ïóñòîå %s%%[]"
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Íåäîïóñòèìûé ñèìâîë ïîñëå %s%%"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Ñèíòàêñè÷åñêàÿ îøèáêà â %s{...}"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr ""
+"E361: Ïðåäîòâðàùåíî àâàðèéíîå çàâåðøåíèå: ñëèøêîì ñëîæíîå ðåãóëÿðíîå "
+"âûðàæåíèå?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: ïðèìåíåíèå øàáëîíà ïðèâåëî ê îøèáêå âûõîäà çà ïðåäåëû ñòåêà"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "Âíåøíèå ïîäñîîòâåòñòâèÿ:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld ñòðîê â ñêëàäêå"
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " ÂÈÐÒÓÀËÜÍÀß ÇÀÌÅÍÀ"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " ÇÀÌÅÍÀ"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " ÎÁÐÀÒÍÀß"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " ÂÑÒÀÂÊÀ"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (âñòàâêà)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (çàìåíà)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (âèðòóàëüíàÿ çàìåíà)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " Èâðèò"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " Àðàáñêèé"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (ÿçûê)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (âêëåéêà)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " ÂÈÇÓÀËÜÍÛÉ ÐÅÆÈÌ"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " ÂÈÇÓÀËÜÍÀß ÑÒÐÎÊÀ"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " ÂÈÇÓÀËÜÍÛÉ ÁËÎÊ"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " ÂÛÄÅËÅÍÈÅ"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " ÂÛÄÅËÅÍÈÅ ÑÒÐÎÊÈ"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " ÂÛÄÅËÅÍÈÅ ÁËÎÊÀ"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "çàïèñü"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ïîèñê áóäåò ïðîäîëæåí ñ ÊÎÍÖÀ äîêóìåíòà"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "ïîèñê áóäåò ïðîäîëæåí ñ ÍÀ×ÀËÀ äîêóìåíòà"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Íåïðàâèëüíàÿ ñòðîêà ïîèñêà: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ïîèñê çàêîí÷åí â ÍÀ×ÀËÅ äîêóìåíòà; %s íå íàéäåíî"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ïîèñê çàêîí÷åí â ÊÎÍÖÅ äîêóìåíòà; %s íå íàéäåíî"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Ïîñëå ';' îæèäàåòñÿ ââîä '?' èëè '/'"
+
+#: search.c:3759
+msgid " (includes previously listed match)"
+msgstr " (âêëþ÷àåò ðàííåå ïîêàçàííûå ñîîòâåòñòâèÿ)"
+
+#. cursor at status line
+#: search.c:3779
+msgid "--- Included files "
+msgstr "--- Âêëþ÷¸ííûå ôàéëû "
+
+#: search.c:3781
+msgid "not found "
+msgstr "íå íàéäåíî "
+
+#: search.c:3782
+msgid "in path ---\n"
+msgstr "ïî ïóòè ---\n"
+
+#: search.c:3839
+msgid " (Already listed)"
+msgstr " (Óæå ïîêàçàíî)"
+
+#: search.c:3841
+msgid " NOT FOUND"
+msgstr " ÍÅ ÍÀÉÄÅÍÎ"
+
+#: search.c:3893
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Ïðîñìîòð âêëþ÷¸ííûõ ôàéëîâ: %s"
+
+#: search.c:4111
+msgid "E387: Match is on current line"
+msgstr "E387: Ñîîòâåòñòâèå â òåêóùåé ñòðîêå"
+
+#: search.c:4254
+msgid "All included files were found"
+msgstr "Íàéäåíû âñå âêëþ÷¸ííûå ôàéëû"
+
+#: search.c:4256
+msgid "No included files"
+msgstr "Âêëþ÷¸ííûõ ôàéëîâ íåò"
+
+#: search.c:4272
+msgid "E388: Couldn't find definition"
+msgstr "E388: Îïðåäåëåíèå íå íàéäåíî"
+
+#: search.c:4274
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Øàáëîí íå íàéäåí"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Íåäîïóñòèìûé àðãóìåíò: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Ñèíòàêñè÷åñêèé êëàñòåð %s íå íàéäåí"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "Ñèíòàêñè÷åñêèå ýëåìåíòû äëÿ äàííîãî áóôåðà íå îïðåäåëåíû"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "Ñèíõðîíèçàöèÿ ïî êîììåíòàðèÿì â ñòèëå ÿçûêà C"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "áåç ñèíõðîíèçàöèè"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "ñèíõðîíèçàöèÿ íà÷àòà "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " ñòðîê ïåðåä âåðõíåé ñòðîêîé"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Ýëåìåíòû ñèíõðîíèçàöèè ñèíòàêñèñà ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"ñèíõðîíèçàöèÿ ïî ýëåìåíòàì"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Ñèíòàêñè÷åñêèå ýëåìåíòû ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Ñèíòàêñè÷åñêèé êëàñòåð %s íå íàéäåí"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "ìèíèìóì "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "ìàêñèìóì "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; ñîîòâåòñòâèå "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " ïåðåíîñîâ ñòðîê"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: çäåñü íåëüçÿ èñïîëüçîâàòü group[t]here"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Ýëåìåíò îáëàñòè äëÿ %s íå íàéäåí"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: çäåñü íåëüçÿ èñïîëüçîâàòü àðãóìåíò contains"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: çäåñü íåëüçÿ èñïîëüçîâàòü àðãóìåíò containedin"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: Òðåáóåòñÿ óêàçàòü èìÿ ôàéëà"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Ïðîïóùåíî '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Íå õâàòàåò àðãóìåíòîâ: ñèíòàêñè÷åñêèé ðåãèîí %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: Êëàñòåð íå óêàçàí"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Íå íàéäåí ðàçäåëèòåëü øàáëîíîâ: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Ìóñîð ïîñëå øàáëîíà: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr ""
+"E403: ñèíõðîíèçàöèÿ ñèíòàêñèñà: øàáëîí ïðîäîëæåíèé ñòðîêè óêàçàí äâàæäû"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Íåäîïóñòèìûå àðãóìåíòû: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Ïðîïóùåí çíàê ðàâåíñòâà: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Ïóñòîé àðãóìåíò: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s íå äîïóñêàåòñÿ â ýòîì ìåñòå"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s äîëæíî áûòü ïåðâûì â ñïèñêå contains"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Íåèçâåñòíàÿ ãðóïïà: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Íåïðàâèëüíàÿ ïîäêîìàíäà :syntax: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ãðóïïà ïîäñâåòêè ñèíòàêñèñà %s íå íàéäåíà"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Íå õâàòàåò àðãóìåíòîâ: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Ñëèøêîì ìíîãî àðãóìåíòîâ: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ó ãðóïïû åñòü ñîáñòâåííûå íàñòðîéêè, ññûëêà èãíîðèðóåòñÿ"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: íåîæèäàííûé çíàê ðàâåíñòâà: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ïðîïóùåí çíàê ðàâåíñòâà: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ïðîïóùåí àðãóìåíò: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Íåäîïóñòèìîå çíà÷åíèå: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: Íåèçâåñòíûé öâåò òåêñòà"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: Íåèçâåñòíûé öâåò ôîíà"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Èìÿ èëè íîìåð öâåòà íå èçâåñòíî: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: ñëèøêîì äëèííûé êîä òåðìèíàëà: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Íåäîïóñòèìûé àðãóìåíò: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Èñïîëüçóåòñÿ ñëèøêîì ìíîãî ðàçíûõ àòðèáóòîâ ïîäñâåòêè ñèíòàêñèñà"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: Íåïå÷àòíûé ñèìâîë â èìåíè ãðóïïû"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: Íåäîïóñòèìûé ñèìâîë â èìåíè ãðóïïû"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: âíèçó ñòåêà ìåòîê"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: íàâåðõó ñòåêà ìåòîê"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Íåâîçìîæíî ïåðåéòè â ïîçèöèþ äî ïåðâîé ñîâïàäàþùåé ìåòêè"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: Ìåòêà íå íàéäåíà: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # ïðè òèï ìåòêà"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "ôàéë\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Âûáåðèòå íóæíûé íîìåð (<CR> äëÿ îòêàçà):"
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: Åñòü òîëüêî îäíà ñîâïàäàþùàÿ ìåòêà"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Íåâîçìîæíî ïåðåéòè â ïîçèöèþ çà ïîñëåäíåé ñîâïàäàþùåé ìåòêîé"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Ôàéë \"%s\" íå ñóùåñòâóåò"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ìåòêà %d èç %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " è áîëåå"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " Èñïîëüçóåòñÿ ìåòêà ñ ñèìâîëàìè â äðóãîì ðåãèñòðå!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Ôàéë \"%s\" íå ñóùåñòâóåò"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # Ê ìåòêå ÎÒ ñòð. â ôàéëå/òåêñòå"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Ïîèñê â ôàéëå ìåòîê %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Ïóòü ê ôàéëó ìåòîê %s îáðåçàí\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Îøèáêà ôîðìàòà â ôàéëå ìåòîê \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "Ïåðåä áàéòîì %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Ôàéë ìåòîê íå îòñîðòèðîâàí: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: Ôàéë ìåòîê íå îáíàðóæåí"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Íå íàéäåí øàáëîí ìåòêè"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Ìåòêà íå íàéäåíà, ïûòàåìñÿ óãàäàòü!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' íå èçâåñòåí. Äîñòóïíû âñòðîåííûå òåðìèíàëû:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "ïî óìîë÷àíèþ '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Íåâîçìîæíî îòêðûòü ôàéë termcap"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Â terminfo íåò çàïèñè îá ýòîì òåðìèíàëå"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Â termcap íåò çàïèñè îá ýòîì òåðìèíàëå"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Â termcap íåò çàïèñè \"%s\""
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: òðåáóåòñÿ ñïîñîáíîñòü òåðìèíàëà \"cm\""
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Êíîïêè òåðìèíàëà ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "çàïóñê íîâîé îáîëî÷êè\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Îøèáêà ÷òåíèÿ ââîäà, âûõîä...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "Îòìåíà íåâîçìîæíà; ïðîäîëæàòü âûïîëíåíèå"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: íåïðàâèëüíûå íîìåðà ñòðîê"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "Åäèíñòâåííîå èçìåíåíèå"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "Èçìåíåíèé: %ld"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: Ïîâðåæä¸í ñïèñîê îòìåíû"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: ïîòåðÿíà ñòðîêà îòìåíû"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:721
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"Âåðñèÿ ñ ãðàôè÷åñêèì èíòåðôåéñîì äëÿ MS-Windows 16/32 áèò"
+
+#: version.c:723
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"Âåðñèÿ ñ ãðàôè÷åñêèì èíòåðôåéñîì äëÿ MS-Windows 32 áèò"
+
+#: version.c:726
+msgid " in Win32s mode"
+msgstr " â ðåæèìå Win32s"
+
+#: version.c:728
+msgid " with OLE support"
+msgstr " ñ ïîääåðæêîé OLE"
+
+#: version.c:731
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"Êîíñîëüíàÿ âåðñèÿ äëÿ MS-Windows 32 áèò"
+
+#: version.c:735
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MS-Windows 16 áèò"
+
+#: version.c:739
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MS-DOS 32 áèò"
+
+#: version.c:741
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MS-DOS 16 áèò"
+
+#: version.c:747
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MacOS X (unix)"
+
+#: version.c:749
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MacOS X"
+
+#: version.c:752
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ MacOS"
+
+#: version.c:757
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"Âåðñèÿ äëÿ RISC OS"
+
+#: version.c:767
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Çàïëàòêè: "
+
+#: version.c:793 version.c:1161
+msgid "Modified by "
+msgstr "Ñ èçìåíåíèÿìè, âíåñ¸ííûìè "
+
+#: version.c:800
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Ñêîìïèëèðîâàí "
+
+#: version.c:803
+msgid "by "
+msgstr " "
+
+#: version.c:815
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Îãðîìíàÿ âåðñèÿ "
+
+#: version.c:818
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Áîëüøàÿ âåðñèÿ "
+
+#: version.c:821
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Îáû÷íàÿ âåðñèÿ "
+
+#: version.c:824
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Ìàëàÿ âåðñèÿ "
+
+#: version.c:826
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Âåðñèÿ \"Êðîõà\" "
+
+#: version.c:832
+msgid "without GUI."
+msgstr "áåç ãðàôè÷åñêîãî èíòåðôåéñà."
+
+#: version.c:837
+msgid "with GTK2-GNOME GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì GTK2-GNOME."
+
+#: version.c:839
+msgid "with GTK-GNOME GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì GTK-GNOME."
+
+#: version.c:843
+msgid "with GTK2 GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì GTK2."
+
+#: version.c:845
+msgid "with GTK GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì GTK."
+
+#: version.c:850
+msgid "with X11-Motif GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì X11-Motif."
+
+#: version.c:854
+msgid "with X11-neXtaw GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì X11-neXtaw."
+
+#: version.c:856
+msgid "with X11-Athena GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì X11-Athena."
+
+#: version.c:860
+msgid "with BeOS GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì BeOS."
+
+#: version.c:863
+msgid "with Photon GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì Photon."
+
+#: version.c:866
+msgid "with GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì."
+
+#: version.c:869
+msgid "with Carbon GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì Carbon."
+
+#: version.c:872
+msgid "with Cocoa GUI."
+msgstr "ñ ãðàôè÷åñêèì èíòåðôåéñîì Cocoa."
+
+#: version.c:875
+msgid "with (classic) GUI."
+msgstr "ñ êëàññè÷åñêèì ãðàôè÷åñêèì èíòåðôåéñîì."
+
+#: version.c:886
+msgid " Features included (+) or not (-):\n"
+msgstr " Âêëþ÷¸ííûå (+) è îòêëþ÷¸ííûå (-) îñîáåííîñòè:\n"
+
+#: version.c:898
+msgid " system vimrc file: \""
+msgstr " îáùåñèñòåìíûé ôàéë vimrc: \""
+
+#: version.c:903
+msgid " user vimrc file: \""
+msgstr " ïîëüçîâàòåëüñêèé ôàéë vimrc: \""
+
+#: version.c:908
+msgid " 2nd user vimrc file: \""
+msgstr " âòîðîé ïîëüçîâàòåëüñêèé ôàéë vimrc: \""
+
+#: version.c:913
+msgid " 3rd user vimrc file: \""
+msgstr " òðåòèé ïîëüçîâàòåëüñêèé ôàéë vimrc: \""
+
+#: version.c:918
+msgid " user exrc file: \""
+msgstr " ïîëüçîâàòåëüñêèé ôàéë exrc: \""
+
+#: version.c:923
+msgid " 2nd user exrc file: \""
+msgstr " âòîðîé ïîëüçîâàòåëüñêèé ôàéë exrc: \""
+
+#: version.c:929
+msgid " system gvimrc file: \""
+msgstr " îáùåñèñòåìíûé ôàéë gvimrc: \""
+
+#: version.c:933
+msgid " user gvimrc file: \""
+msgstr " ïîëüçîâàòåëüñêèé ôàéë gvimrc: \""
+
+#: version.c:937
+msgid "2nd user gvimrc file: \""
+msgstr " âòîðîé ïîëüçîâàòåëüñêèé ôàéë gvimrc: \""
+
+#: version.c:942
+msgid "3rd user gvimrc file: \""
+msgstr " òðåòèé ïîëüçîâàòåëüñêèé ôàéë gvimrc: \""
+
+#: version.c:949
+msgid " system menu file: \""
+msgstr " îáùåñèñòåìíûé ôàéë ìåíþ: \""
+
+#: version.c:957
+msgid " fall-back for $VIM: \""
+msgstr " çíà÷åíèå $VIM ïî óìîë÷àíèþ: \""
+
+#: version.c:963
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " çíà÷åíèå $VIMRUNTIME ïî óìîë÷àíèþ: \""
+
+#: version.c:967
+msgid "Compilation: "
+msgstr "Ïàðàìåòðû êîìïèëÿöèè: "
+
+#: version.c:973
+msgid "Compiler: "
+msgstr "Êîìïèëÿòîð: "
+
+#: version.c:978
+msgid "Linking: "
+msgstr "Ñáîðêà: "
+
+#: version.c:983
+msgid " DEBUG BUILD"
+msgstr " ÎÒËÀÄÎ×ÍÀß ÑÁÎÐÊÀ"
+
+#: version.c:1022
+msgid "VIM - Vi IMproved"
+msgstr "VIM ::: Vi IMproved (Óëó÷øåííûé Vi) ::: Ðóññêàÿ âåðñèÿ"
+
+#: version.c:1024
+msgid "version "
+msgstr "âåðñèÿ "
+
+#: version.c:1025
+msgid "by Bram Moolenaar et al."
+msgstr "Áðàì Ìîîëåíààð è äðóãèå"
+
+#: version.c:1029
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ýòî ñâîáîäíî ðàñïðîñòðàíÿåìàÿ ïðîãðàììà ñ îòêðûòûì êîäîì"
+
+#: version.c:1031
+msgid "Help poor children in Uganda!"
+msgstr "Áåäíûì äåòÿì â Óãàíäå íóæíà âàøà ïîìîùü!"
+
+#: version.c:1032
+msgid "type :help iccf<Enter> for information "
+msgstr "íàáåðèòå :help iccf<Enter> äëÿ äîïîëíèòåëüíîé èíôîðìàöèè"
+
+#: version.c:1034
+msgid "type :q<Enter> to exit "
+msgstr "íàáåðèòå :q<Enter> ÷òîáû âûéòè èç ïðîãðàììû "
+
+#: version.c:1035
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "íàáåðèòå :help<Enter> èëè <F1> äëÿ ïîëó÷åíèÿ ñïðàâêè "
+
+#: version.c:1036
+msgid "type :help version6<Enter> for version info"
+msgstr "íàáåðèòå :help version6<Enter> ÷òîáû óçíàòü îá ýòîé âåðñèè "
+
+#: version.c:1039
+msgid "Running in Vi compatible mode"
+msgstr "Ðàáîòà â Vi-ñîâìåñòèìîì ðåæèìå"
+
+#: version.c:1040
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "íàáåðèòå :set nocp<Enter> äëÿ ïåðåõîäà â ðåæèì Vim "
+
+#: version.c:1041
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "íàáåðèòå :help cp-default<Enter> äëÿ äîïîëíèòåëüíîé èíôîðìàöèè"
+
+#: version.c:1056
+msgid "menu Help->Orphans for information "
+msgstr "ìåíþ Ñïðàâêà->Ñèðîòû äëÿ ïîëó÷åíèÿ èíôîðìàöèè "
+
+#: version.c:1058
+msgid "Running modeless, typed text is inserted"
+msgstr "Áåçðåæèìíàÿ ðàáîòû, âñòàâêà ââåä¸ííîãî òåêñòà"
+
+#: version.c:1059
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "ìåíþ Ïðàâêà->Îáùèå Íàñòðîéêè->Ðåæèì Âñòàâêè "
+
+#: version.c:1060
+msgid " for two modes "
+msgstr " äëÿ äâóõ ðåæèìîâ "
+
+#: version.c:1064
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "ìåíþ Ïðàâêà->Îáùèå Íàñòðîéêè->Ñîâìåñòèìîñòü ñ Vi "
+
+#: version.c:1065
+msgid " for Vim defaults "
+msgstr " äëÿ ïåðåõîäà â ðåæèì Vim "
+
+#: version.c:1112
+msgid "Sponsor Vim development!"
+msgstr "Ïîìîãèòå â ðàçðàáîòêå Vim!"
+
+#: version.c:1113
+msgid "Become a registered Vim user!"
+msgstr "Ñòàíüòå çàðåãèñòðèðîâàííûì ïîëüçîâàòåëåì Vim!"
+
+#: version.c:1116
+msgid "type :help sponsor<Enter> for information "
+msgstr "íàáåðèòå :help sponsor<Enter> äëÿ ïîëó÷åíèÿ èíôîðìàöèè "
+
+#: version.c:1117
+msgid "type :help register<Enter> for information "
+msgstr "íàáåðèòå :help register<Enter> äëÿ ïîëó÷åíèÿ èíôîðìàöèè "
+
+#: version.c:1119
+msgid "menu Help->Sponsor/Register for information "
+msgstr "ìåíþ Ñïðàâêà->Ïîìîùü/Ðåãèñòðàöèÿ äëÿ ïîëó÷åíèÿ èíôîðìàöèè "
+
+#: version.c:1129
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ÏÐÅÄÓÏÐÅÆÄÅÍÈÅ: îáíàðóæåíà Windows 95/98/ME"
+
+#: version.c:1132
+msgid "type :help windows95<Enter> for info on this"
+msgstr "íàáåðèòå :help windows95<Enter> äëÿ ïîëó÷åíèÿ èíôîðìàöèè "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Îêíî ïðåäïðîñìîòðà îòñóòñòâóåò"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Îêíî íå ìîæåò áûòü îäíîâðåìåííî ñëåâà ââåðõó è ñïðàâà âíèçó"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Íåâîçìîæíî ïîìåíÿòü ìåñòàìè, ïîêà äðóãîå îêíî ðàçäåëåíî"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: Íåëüçÿ çàêðûòü ïîñëåäíåå îêíî"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "Íà ýêðàíå âñåãî îäíî îêíî"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445:  äðóãîì îêíå åñòü íåñîõðàí¸ííûå èçìåíåíèÿ"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: Íåò èìåíè ôàéëà â ïîçèöèè êóðñîðà"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Ôàéë \"%s\" íå íàéäåí ïî èçâåñòíûì ïóòÿì"
+
+#: if_perl.xs:326 globals.h:1232
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Íåâîçìîæíî çàãðóçèòü áèáëèîòåêó %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"Èçâèíèòå, äàííàÿ êîìàíäà îòêëþ÷åíà: íåâîçìîæíî çàãðóçèòü áèáëèîòåêó Perl"
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: Íå äîïóñêàåòñÿ âû÷èñëåíèå Perl â ïåñî÷íèöå áåç ìîäóëÿ áåçîïàñíîñòè"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Ðåäàêòèðîâàòü â &ðàçíûõ Vim-àõ"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Ðåäàêòèðîâàòü â &îäíîì Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Ñðàâíèòü ñ ïîìîùüþ Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Ðå&äàêòèðîâàòü ñ ïîìîùüþ Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Ðåäàêòèðîâàòü â çàïóùåííîì Vim - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Ðåäàêòèðîâàòü âûäåëåííûå ôàéëû ñ ïîìîùüþ Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Îøèáêà ñîçäàíèÿ ïðîöåññà: ïðîâåðüòå äîñòóïíîñòü gvim â ïóòè!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "îøèáêà gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Ñëèøêîì äëèííûé ïóòü!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "-- Íåò ñòðîê â áóôåðå --"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: Âûïîëíåíèå êîìàíäû ïðåðâàíî"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: Òðåáóåòñÿ óêàçàòü ïàðàìåòð"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: Ïîñëå \\ äîëæåí èäòè ñèìâîë /, ? èëè &"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Íåäîïóñòèìî â îêíå êîìàíäíîé ñòðîêè; <CR> âûïîëíåíèå, CTRL-C âûõîä"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Êîìàíäà íå äîïóñêàåòñÿ â exrc/vimrc â òåêóùåì êàòàëîãå èëè ïîèñêå ìåòîê"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: Îòñóòñòâóåò êîìàíäà :endif"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: Îòñóòñòâóåò êîìàíäà :endtry"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: Îòñóòñòâóåò êîìàíäà :endwhile"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: Êîìàíäà :endwhile áåç ïàðíîé êîìàíäû :while"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Ôàéë ñóùåñòâóåò (äëÿ ïåðåçàïèñè äîáàâüòå !)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: Íå óäàëîñü âûïîëíèòü êîìàíäó"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Íåèçâåñòíûé øðèôòîâîé íàáîð: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Íåèçâåñòíûé øðèôò: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Øðèôò \"%s\" íå ÿâëÿåòñÿ ìîíîøèðèííûì øðèôòîì"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: Âíóòðåííÿÿ îøèáêà"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "Ïðåðâàíî"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: Íåäîïóñòèìûé àäðåñ"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: Íåäîïóñòèìûé àðãóìåíò"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Íåäîïóñòèìûé àðãóìåíò: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Íåäîïóñòèìîå âûðàæåíèå: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: Íåäîïóñòèìûé äèàïàçîí"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: Íåäîïóñòèìàÿ êîìàíäà"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ÿâëÿåòñÿ êàòàëîãîì"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Ïåðåä '=' îáíàðóæåíû íåîæèäàííûå ñèìâîëû"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Íåóäà÷íûé âûçîâ ôóíêöèè \"%s()\" èç áèáëèîòåêè"
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Íå óäàëîñü çàãðóçèòü ôóíêöèþ %s èç áèáëèîòåêè"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Îòìåòêà óêàçûâàåò íà íåïðàâèëüíûé íîìåð ñòðîêè"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "Îòìåòêà íå îïðåäåëåíà"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Èçìåíåíèÿ íåâîçìîæíû, òàê êàê îòêëþ÷åíà îïöèÿ 'modifiable'"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Ñëèøêîì ãëóáîêî âëîæåííûå ñöåíàðèè"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: Ñîñåäíèé ôàéë íå ñóùåñòâóåò"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: Íåò òàêîãî ñîêðàùåíèÿ"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: ! íå äîïóñêàåòñÿ"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr ""
+"E25: Âîçìîæíîñòü èñïîëüçîâàíèÿ ãðàôè÷åñêîãî èíòåðôåéñà âûêëþ÷åíà ïðè "
+"êîìïèëÿöèè"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Èâðèò âûêëþ÷åí ïðè êîìïèëÿöèè\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Ôàðñè âûêëþ÷åíî ïðè êîìïèëÿöèè\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Àðàáñêèé âûêëþ÷åí ïðè êîìïèëÿöèè\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Ãðóïïà ïîäñâåòêè ñèíòàêñèñà %s íå ñóùåñòâóåò"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: Ïîêà íåò âñòàâëåííîãî òåêñòà"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: Ïðåäûäóùåé êîìàíäíîé ñòðîêè íåò"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: Òàêîé ïðèâÿçêè íå ñóùåñòâóåò"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: Íåò ñîîòâåòñòâèÿ"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Íåò ñîîòâåòñòâèÿ: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: Íåò èìåíè ôàéëà"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Íåò ïðåäûäóùåãî ðåãóëÿðíîãî âûðàæåíèÿ äëÿ çàìåíû"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: Íåò ïðåäûäóùåé êîìàíäû"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: Íåò ïðåäûäóùåãî ðåãóëÿðíîãî âûðàæåíèÿ"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: Èñïîëüçîâàíèå äèàïàçîíà íå äîïóñêàåòñÿ"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: Íåäîñòàòî÷íî ìåñòà"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ñåðâåð \"%s\" íå çàðåãèñòðèðîâàí"
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Íåâîçìîæíî ñîçäàòü ôàéë %s"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: Íåâîçìîæíî ïîëó÷èòü èìÿ âðåìåííîãî ôàéëà"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Íåâîçìîæíî îòêðûòü ôàéë %s"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Íåâîçìîæíî ïðî÷èòàòü ôàéë %s"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: Èçìåíåíèÿ íå ñîõðàíåíû (äîáàâüòå !, ÷òîáû îáîéòè ïðîâåðêó)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: Íóëåâîé àðãóìåíò"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: Òðåáóåòñÿ ÷èñëî"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Íå óäàëîñü îòêðûòü ôàéë îøèáîê %s"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: íåâîçìîæíî îòêðûòü äèñïëåé"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: Íå õâàòàåò ïàìÿòè!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "Øàáëîí íå íàéäåí"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Øàáëîí íå íàéäåí: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: Ïàðàìåòð äîëæåí áûòü ïîëîæèòåëüíûì ÷èñëîì"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Âîçâðàò â ïðåäûäóùèé êàòàëîã íåâîçìîæåí"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: Îøèáîê íåò"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: Ïîâðåæäåíà ñòðîêà ñîîòâåòñòâèÿ"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Ïðîãðàììà îáðàáîòêè ðåãóëÿðíûõ âûðàæåíèé ïîâðåæäåíà"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr ""
+"E45: Âêëþ÷åíà îïöèÿ 'readonly' (äîáàâüòå !, ÷òîáû íå îáðàùàòü âíèìàíèÿ)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Íåâîçìîæíî èçìåíèòü äîñòóïíóþ òîëüêî äëÿ ÷òåíèÿ ïåðåìåííóþ \"%s\""
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Îøèáêà ïðè ÷òåíèè ôàéëà îøèáîê"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Íå äîïóñêàåòñÿ â ïåñî÷íèöå"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: Çäåñü íå ðàçðåøåíî"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Äàííûé ðåæèì ýêðàíà íå ïîääåðæèâàåòñÿ"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: Íåäîïóñòèìûé ðàçìåð ïðîêðóòêè"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: Çíà÷åíèåì îïöèè 'shell' ÿâëÿåòñÿ ïóñòàÿ ñòðîêà"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Íåâîçìîæíî ïðî÷èòàòü äàííûå î çíà÷êàõ!"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: Îøèáêà çàêðûòèÿ ñâîï-ôàéëà"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: Ñòåê ìåòîê ïóñòîé"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: Ñëèøêîì ñëîæíàÿ êîìàíäà"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: Ñëèøêîì äëèííîå èìÿ"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: Ñëèøêîì ìíîãî ñèìâîëîâ ["
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: Ñëèøêîì ìíîãî èì¸í ôàéëîâ"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: Ëèøíèå ñèìâîëû íà õâîñòå"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: Íåèçâåñòíàÿ îòìåòêà"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Íåâîçìîæíî âûïîëíèòü ïîäñòàíîâêó ïî ìàñêå"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr ""
+"E591: Çíà÷åíèå îïöèè 'winheight' íå ìîæåò áûòü ìåíüøå çíà÷åíèÿ 'winminheight'"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr ""
+"E592: Çíà÷åíèå îïöèè 'winwidth' íå ìîæåò áûòü ìåíüøå çíà÷åíèÿ 'winminwidth'"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: Îøèáêà ïðè çàïèñè"
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "Íóëåâîå çíà÷åíèå ñ÷¸ò÷èêà"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Èñïîëüçîâàíèå <SID> âíå êîíòåêñòà ñöåíàðèÿ"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: Ïîëó÷åíî íåäîïóñòèìîå âûðàæåíèå"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Íåâîçìîæíî èçìåíèòü îõðàíÿåìóþ îáëàñòü"
+
+#~ msgid "\"\n"
+#~ msgstr "\"\n"
diff --git a/src/po/ru.po b/src/po/ru.po
new file mode 100644
index 000000000..b08bc0230
--- /dev/null
+++ b/src/po/ru.po
@@ -0,0 +1,6658 @@
+# Russian translation for Vim
+#
+# ï ÕÓÌÏ×ÉÑÈ ÉÓÐÏÌØÚÏ×ÁÎÉÑ ÞÉÔÁÊÔÅ × ÒÅÄÁËÔÏÒÅ Vim ":help uganda"
+# ï ÌÀÄÑÈ, ÄÅÌÁÀÝÉÈ Vim ÞÉÔÁÊÔÅ × ÒÅÄÁËÔÏÒÅ ":help Á×ÔÏÒÙ"
+#
+# vassily "vr" ragosin <vrr@users.sourceforge.net>, 2004
+#
+# Original translations.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.3a\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-05-10 21:37+0400\n"
+"PO-Revision-Date: 2004-05-10 21:37+0400\n"
+"Last-Translator: vassily ragosin <vrr@users.sourceforge.net>\n"
+"Language-Team: vassily ragosin <vrr@users.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=koi8-r\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:102
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: îÅ×ÏÚÍÏÖÎÏ ×ÙÄÅÌÉÔØ ÐÁÍÑÔØ ÄÁÖÅ ÄÌÑ ÏÄÎÏÇÏ ÂÕÆÅÒÁ, ×ÙÈÏÄ..."
+
+#: buffer.c:105
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: îÅ×ÏÚÍÏÖÎÏ ×ÙÄÅÌÉÔØ ÐÁÍÑÔØ ÄÌÑ ÂÕÆÅÒÁ, ÉÓÐÏÌØÚÕÅÍ ÄÒÕÇÏÊ ÂÕÆÅÒ..."
+
+#: buffer.c:805
+#, c-format
+msgid "E515: No buffers were unloaded"
+msgstr "E515: îÉ ÏÄÉÎ ÂÕÆÅÒ ÎÅ ÂÙÌ ×ÙÇÒÕÖÅÎ ÉÚ ÐÁÍÑÔÉ"
+
+#: buffer.c:807
+#, c-format
+msgid "E516: No buffers were deleted"
+msgstr "E516: îÉ ÏÄÉÎ ÂÕÆÅÒ ÎÅ ÂÙÌ ÕÄÁÌ£Î"
+
+#: buffer.c:809
+#, c-format
+msgid "E517: No buffers were wiped out"
+msgstr "E517: îÉ ÏÄÉÎ ÂÕÆÅÒ ÎÅ ÂÙÌ ÏÞÉÝÅÎ"
+
+#: buffer.c:817
+msgid "1 buffer unloaded"
+msgstr "ïÄÉÎ ÂÕÆÅÒ ×ÙÇÒÕÖÅÎ ÉÚ ÐÁÍÑÔÉ"
+
+#: buffer.c:819
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "÷ÓÅÇÏ ×ÙÇÒÕÖÅÎÏ ÂÕÆÅÒÏ× ÉÚ ÐÁÍÑÔÉ: %d"
+
+#: buffer.c:824
+msgid "1 buffer deleted"
+msgstr "ïÄÉÎ ÂÕÆÅÒ ÕÄÁÌ£Î"
+
+#: buffer.c:826
+#, c-format
+msgid "%d buffers deleted"
+msgstr "÷ÓÅÇÏ ÕÄÁÌÅÎÏ ÂÕÆÅÒÏ×: %d"
+
+#: buffer.c:831
+msgid "1 buffer wiped out"
+msgstr "ïÄÉÎ ÂÕÆÅÒ ÏÞÉÝÅÎ"
+
+#: buffer.c:833
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "÷ÓÅÇÏ ÏÞÉÝÅÎÏ ÂÕÆÅÒÏ×: %d"
+
+#: buffer.c:894
+msgid "E84: No modified buffer found"
+msgstr "E84: éÚÍÅΣÎÎÙÈ ÂÕÆÅÒÏ× ÎÅ ÏÂÎÁÒÕÖÅÎÏ"
+
+#. back where we started, didn't find anything.
+#: buffer.c:933
+msgid "E85: There is no listed buffer"
+msgstr "E85: âÕÆÅÒÙ × ÓÐÉÓËÅ ÏÔÓÕÔÓÔ×ÕÀÔ"
+
+#: buffer.c:945
+#, c-format
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: âÕÆÅÒ %ld ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: buffer.c:948
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: üÔÏ ÐÏÓÌÅÄÎÉÊ ÂÕÆÅÒ"
+
+#: buffer.c:950
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: üÔÏ ÐÅÒ×ÙÊ ÂÕÆÅÒ"
+
+#: buffer.c:988
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: éÚÍÅÎÅÎÉÑ × ÂÕÆÅÒÅ %ld ÎÅ ÓÏÈÒÁÎÅÎÙ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: buffer.c:1005
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: îÅ×ÏÚÍÏÖÎÏ ×ÙÇÒÕÚÉÔØ ÉÚ ÐÁÍÑÔÉ ÐÏÓÌÅÄÎÉÊ ÂÕÆÅÒ"
+
+#: buffer.c:1538
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÐÅÒÅÐÏÌÎÅÎÉÅ ÓÐÉÓËÁ ÉͣΠÆÁÊÌÏ×"
+
+#: buffer.c:1709
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: âÕÆÅÒ %ld ÎÅ ÎÁÊÄÅÎ"
+
+#: buffer.c:1940
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: îÅÓËÏÌØËÏ ÓÏÏÔ×ÅÔÓÔ×ÉÊ ÄÌÑ %s"
+
+#: buffer.c:1942
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: îÅÔ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÇÏ %s ÂÕÆÅÒÁ"
+
+#: buffer.c:2337
+#, c-format
+msgid "line %ld"
+msgstr "ÓÔÒÏËÁ %ld"
+
+#: buffer.c:2420
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: âÕÆÅÒ Ó ÔÁËÉÍ ÉÍÅÎÅÍ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: buffer.c:2713
+msgid " [Modified]"
+msgstr " [éÚÍÅΣÎ]"
+
+#: buffer.c:2718
+msgid "[Not edited]"
+msgstr "[îÅ ÒÅÄÁËÔÉÒÏ×ÁÌÓÑ]"
+
+#: buffer.c:2723
+msgid "[New file]"
+msgstr "[îÏ×ÙÊ ÆÁÊÌ]"
+
+#: buffer.c:2724
+msgid "[Read errors]"
+msgstr "[ïÛÉÂËÉ ÞÔÅÎÉÑ]"
+
+#: buffer.c:2726 fileio.c:2112
+msgid "[readonly]"
+msgstr "[ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ]"
+
+#: buffer.c:2747
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "ïÄÎÁ ÓÔÒÏËÁ --%d%%--"
+
+#: buffer.c:2749
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld ÓÔÒ. --%d%%--"
+
+#: buffer.c:2756
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ÓÔÒ. %ld ÉÚ %ld --%d%%-- ËÏÌ. "
+
+#: buffer.c:2864
+msgid "[No file]"
+msgstr "[îÅÔ ÆÁÊÌÁ]"
+
+#. must be a help buffer
+#: buffer.c:2904
+msgid "help"
+msgstr "ÓÐÒÁ×ËÁ"
+
+#: buffer.c:3463 screen.c:5075
+msgid "[help]"
+msgstr "[ÓÐÒÁ×ËÁ]"
+
+#: buffer.c:3495 screen.c:5081
+msgid "[Preview]"
+msgstr "[ðÒÅÄÐÒÏÓÍÏÔÒ]"
+
+#: buffer.c:3775
+msgid "All"
+msgstr "÷ÅÓØ"
+
+#: buffer.c:3775
+msgid "Bot"
+msgstr "÷ÎÉÚÕ"
+
+#: buffer.c:3777
+msgid "Top"
+msgstr "îÁ×ÅÒÈÕ"
+
+#: buffer.c:4523
+#, c-format
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# óÐÉÓÏË ÂÕÆÅÒÏ×:\n"
+
+#: buffer.c:4556
+msgid "[Error List]"
+msgstr "[óÐÉÓÏË ÏÛÉÂÏË]"
+
+#: buffer.c:4569 memline.c:1520
+msgid "[No File]"
+msgstr "[îÅÔ ÆÁÊÌÁ]"
+
+#: buffer.c:4882
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- úÎÁÞËÉ ---"
+
+#: buffer.c:4901
+#, c-format
+msgid "Signs for %s:"
+msgstr "úÎÁÞËÉ ÄÌÑ %s:"
+
+#: buffer.c:4907
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ÓÔÒÏËÁ=%ld id=%d ÉÍÑ=%s"
+
+#: diff.c:139
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: óÌÅÄÉÔØ ÚÁ ÏÔÌÉÞÉÑÍÉ ÍÏÖÎÏ ÎÅ ÂÏÌÅÅ ÞÅÍ × %ld ÂÕÆÅÒÁÈ"
+
+#: diff.c:713
+msgid "E97: Cannot create diffs"
+msgstr "E97: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÆÁÊÌÙ ÏÔÌÉÞÉÊ"
+
+#: diff.c:818
+msgid "Patch file"
+msgstr "æÁÊÌ-ÚÁÐÌÁÔËÁ"
+
+#: diff.c:1069
+msgid "E98: Cannot read diff output"
+msgstr "E98: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ×Ù×ÏÄ ËÏÍÁÎÄÙ diff"
+
+#: diff.c:1819
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: áËÔÉ×ÎÙÊ ÂÕÆÅÒ ÎÅ ÎÁÈÏÄÉÔÓÑ × ÒÅÖÉÍÅ ÏÔÌÉÞÉÊ"
+
+#: diff.c:1831
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: âÏÌØÛÅ ÎÅÔ ÂÕÆÅÒÏ× × ÒÅÖÉÍÅ ÏÔÌÉÞÉÊ"
+
+#: diff.c:1839
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: ÷ ÒÅÖÉÍÅ ÏÔÌÉÞÉÊ ÂÏÌÅÅ Ä×ÕÈ ÂÕÆÅÒÏ×, ÎÅ ÍÏÇÕ ×ÙÂÒÁÔØ"
+
+#: diff.c:1862
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: îÅ ÍÏÇÕ ÎÁÊÔÉ ÂÕÆÅÒ \"%s\""
+
+#: diff.c:1868
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: âÕÆÅÒ \"%s\" ÎÅ ÎÁÈÏÄÉÔÓÑ × ÒÅÖÉÍÅ ÏÔÌÉÞÉÊ"
+
+#: digraph.c:2199
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: üËÒÁÎÉÒÕÀÝÉÊ ÓÉÍ×ÏÌ Escape ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ × ÄÉÇÒÁÆÅ"
+
+#: digraph.c:2384
+msgid "E544: Keymap file not found"
+msgstr "E544: æÁÊÌ Ó ÒÁÓËÌÁÄËÏÊ ËÌÁ×ÉÁÔÕÒÙ ÎÅ ÎÁÊÄÅÎ"
+
+#: digraph.c:2411
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ëÏÍÁÎÄÁ :loadkeymap ÐÒÉÍÅÎÅÎÁ ×ÎÅ ÆÁÊÌÁ ÓÃÅÎÁÒÉÑ"
+
+#: edit.c:40
+msgid " Keyword completion (^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ËÌÀÞÅ×ÏÇÏ ÓÌÏ×Á (^N^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ^X (^E^Y^L^]^F^I^K^D^V^N^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N^P)"
+msgstr " íÅÓÔÎÏÅ Á×ÔÏÄÏÐÏÌÎÅÎÉÅ ËÌÀÞÅ×ÏÇÏ ÓÌÏ×Á (^N^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÃÅÌÏÊ ÓÔÒÏËÉ (^L^N^P)"
+
+#: edit.c:46
+msgid " File name completion (^F^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÉÍÅÎÉ ÆÁÊÌÁ (^F^N^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÍÅÔËÉ (^]^N^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÛÁÂÌÏÎÁ ÐÕÔÉ (^N^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÏÐÒÅÄÅÌÅÎÉÑ (^D^N^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÐÏ ÓÌÏ×ÁÒÀ (^K^N^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ÓÉÎÏÎÉÍÏ× (^T^N^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V^N^P)"
+msgstr " á×ÔÏÄÏÐÏÌÎÅÎÉÅ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ (^V^N^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "ëÏÎÅà ÁÂÚÁÃÁ"
+
+#: edit.c:962
+msgid "'thesaurus' option is empty"
+msgstr "îÅ ÚÁÄÁÎÏ ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'thesaurus'"
+
+#: edit.c:1166
+msgid "'dictionary' option is empty"
+msgstr "îÅ ÚÁÄÁÎÏ ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'dictionary'"
+
+#: edit.c:2162
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "ðÒÏÓÍÏÔÒ ÓÌÏ×ÁÒÑ: %s"
+
+#: edit.c:2368
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (×ÓÔÁ×ËÁ) ðÒÏËÒÕÔËÁ (^E/^Y)"
+
+#: edit.c:2370
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (ÚÁÍÅÎÁ) ðÒÏËÒÕÔËÁ (^E/^Y)"
+
+#: edit.c:2684
+#, c-format
+msgid "Scanning: %s"
+msgstr "ðÒÏÓÍÏÔÒ: %s"
+
+#: edit.c:2719
+#, c-format
+msgid "Scanning tags."
+msgstr "÷ÙÐÏÌÎÑÅÔÓÑ ÐÏÉÓË ÓÒÅÄÉ ÍÅÔÏË."
+
+#: edit.c:3381
+msgid " Adding"
+msgstr " äÏÂÁ×ÌÅÎÉÅ"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3430
+msgid "-- Searching..."
+msgstr "-- ðÏÉÓË..."
+
+#: edit.c:3486
+msgid "Back at original"
+msgstr "éÓÈÏÄÎÏÅ ÓÌÏ×Ï"
+
+#: edit.c:3491
+msgid "Word from other line"
+msgstr "óÌÏ×Ï ÉÚ ÄÒÕÇÏÊ ÓÔÒÏËÉ"
+
+#: edit.c:3496
+msgid "The only match"
+msgstr "åÄÉÎÓÔ×ÅÎÎÏÅ ÓÏÏÔ×ÅÔÓÔ×ÉÅ"
+
+#: edit.c:3555
+#, c-format
+msgid "match %d of %d"
+msgstr "ÓÏÏÔ×ÅÔÓÔ×ÉÅ %d ÉÚ %d"
+
+#: edit.c:3558
+#, c-format
+msgid "match %d"
+msgstr "ÓÏÏÔ×ÅÔÓÔ×ÉÅ %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1024
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: îÅÉÚ×ÅÓÔÎÁÑ ÐÅÒÅÍÅÎÎÁÑ: \"%s\""
+
+#: eval.c:1320
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ðÒÏÐÕÝÅÎÙ ÓËÏÂËÉ: %s"
+
+#: eval.c:1435 eval.c:1449
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: îÅÔ ÔÁËÏÊ ÐÅÒÅÍÅÎÎÏÊ: \"%s\""
+
+#: eval.c:1705
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: ðÒÏÐÕÝÅÎÏ ':' ÐÏÓÌÅ '?'"
+
+#: eval.c:2327
+msgid "E110: Missing ')'"
+msgstr "E110: ðÒÏÐÕÝÅÎÁ ')'"
+
+#: eval.c:2389
+msgid "E111: Missing ']'"
+msgstr "E111: ðÒÏÐÕÝÅÎÁ ']'"
+
+#: eval.c:2466
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: îÅ ÕËÁÚÁÎÏ ÉÍÑ ÏÐÃÉÉ: %s"
+
+#: eval.c:2484
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ: %s"
+
+#: eval.c:2555
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: ðÒÏÐÕÝÅÎÁ ËÁ×ÙÞËÁ: %s"
+
+#: eval.c:2698
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ðÒÏÐÕÝÅÎÁ ËÁ×ÙÞËÁ: %s"
+
+#: eval.c:3054
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: ðÁÒÁÍÅÔÒÙ ÄÌÑ ÆÕÎËÃÉÉ %s ÚÁÄÁÎÙ ÎÅ×ÅÒÎÏ"
+
+#: eval.c:3083
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: îÅÉÚ×ÅÓÔÎÁÑ ÆÕÎËÃÉÑ: %s"
+
+#: eval.c:3084
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: óÌÉÛËÏÍ ÍÎÏÇÏ ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ÆÕÎËÃÉÉ %s"
+
+#: eval.c:3085
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: îÅÄÏÓÔÁÔÏÞÎÏ ÐÁÒÁÍÅÔÒÏ× ÄÌÑ ÆÕÎËÃÉÉ %s"
+
+#: eval.c:3086
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ÉÓÐÏÌØÚÕÅÔÓÑ ×ÎÅ ÓÃÅÎÁÒÉÑ: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3687 gui.c:4382 gui_gtk.c:2059
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4226
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ÓÔÒÏË: "
+
+#: eval.c:5477
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"ï&ÔÍÅÎÁ"
+
+#: eval.c:5517
+msgid "called inputrestore() more often than inputsave()"
+msgstr "æÕÎËÃÉÑ inputrestore() ×ÙÚÙ×ÁÅÔÓÑ ÞÁÝÅ, ÞÅÍ ÆÕÎËÃÉÑ inputsave()"
+
+#: eval.c:5977
+msgid "E655: Too many symbolic links (cycle?)"
+msgstr "E656: óÌÉÛËÏÍ ÍÎÏÇÏ ÓÉÍ×ÏÌÉÞÅÓËÉÈ ÓÓÙÌÏË (ÃÉËÌ?)"
+
+#: eval.c:6609
+msgid "E240: No connection to Vim server"
+msgstr "E240: îÅÔ Ó×ÑÚÉ Ó ÓÅÒ×ÅÒÏÍ Vim"
+
+#: eval.c:6706
+msgid "E277: Unable to read a server reply"
+msgstr "E227: óÅÒ×ÅÒ ÎÅ ÏÔ×ÅÞÁÅÔ"
+
+#: eval.c:6734
+msgid "E258: Unable to send to client"
+msgstr "E258: îÅ ÍÏÇÕ ÏÔ×ÅÔÉÔØ ËÌÉÅÎÔÕ"
+
+#: eval.c:6782
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: îÅ ÍÏÇÕ ÏÔÐÒÁ×ÉÔØ ÓÏÏÂÝÅÎÉÅ ÄÌÑ %s"
+
+#: eval.c:6882
+msgid "(Invalid)"
+msgstr "(îÅÐÒÁ×ÉÌØÎÏ)"
+
+#: eval.c:8060
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: îÅÏÐÒÅÄÅÌÅÎÎÁÑ ÐÅÒÅÍÅÎÎÁÑ: %s"
+
+#: eval.c:8492
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÐÅÒÅÍÅÎÎÏÊ: %s"
+
+#: eval.c:8784
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: æÕÎËÃÉÑ %s ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ. äÏÂÁ×ØÔÅ !, ÞÔÏÂÙ ÚÁÍÅÎÉÔØ Å£."
+
+#: eval.c:8857
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: îÅÏÐÒÅÄÅÌÅÎÎÁÑ ÆÕÎËÃÉÑ: %s"
+
+#: eval.c:8870
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: ðÒÏÐÕÝÅÎÁ '(': %s"
+
+#: eval.c:8903
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: îÅÄÏÐÕÓÔÉÍÙÊ ÐÁÒÁÍÅÔÒ: %s"
+
+#: eval.c:8982
+msgid "E126: Missing :endfunction"
+msgstr "E126: ðÒÏÐÕÝÅÎÁ ËÏÍÁÎÄÁ :endfunction"
+
+#: eval.c:9089
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÏÐÒÅÄÅÌÉÔØ ÆÕÎËÃÉÀ %s, ÏÎÁ ÉÓÐÏÌØÚÕÅÔÓÑ"
+
+#: eval.c:9159
+msgid "E129: Function name required"
+msgstr "E129: ôÒÅÂÕÅÔÓÑ ÉÍÑ ÆÕÎËÃÉÉ"
+
+#: eval.c:9210
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: éÍÑ ÆÕÎËÃÉÉ ÄÏÌÖÎÏ ÎÁÞÉÎÁÔØÓÑ Ó ÐÒÏÐÉÓÎÏÊ ÂÕË×Ù: %s"
+
+#: eval.c:9402
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: æÕÎËÃÉÑ %s ÎÅ ÏÐÒÅÄÅÌÅÎÁ"
+
+#: eval.c:9407
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÆÕÎËÃÉÀ %s, ÏÎÁ ÉÓÐÏÌØÚÕÅÔÓÑ"
+
+#: eval.c:9455
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: çÌÕÂÉÎÁ ×ÙÚÏ×Á ÆÕÎËÃÉÉ ÂÏÌØÛÅ, ÞÅÍ ÚÎÁÞÅÎÉÅ 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9508
+#, c-format
+msgid "calling %s"
+msgstr "×ÙÚÏ× %s"
+
+#: eval.c:9570
+#, c-format
+msgid "%s aborted"
+msgstr "%s ÐÒÅÒ×ÁÎÁ"
+
+#: eval.c:9572
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ×ÏÚ×ÒÁÝÁÅÔ #%ld"
+
+#: eval.c:9579
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ×ÏÚ×ÒÁÝÁÅÔ \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9595 ex_cmds2.c:2365
+#, c-format
+msgid "continuing in %s"
+msgstr "ÐÒÏÄÏÌÖÅÎÉÅ × %s"
+
+#: eval.c:9621
+msgid "E133: :return not inside a function"
+msgstr "E133: ËÏÍÁÎÄÁ :return ×ÎÅ ÆÕÎËÃÉÉ"
+
+#: eval.c:9952
+#, c-format
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ÇÌÏÂÁÌØÎÙÅ ÐÅÒÅÍÅÎÎÙÅ:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Octal %03o"
+
+#: ex_cmds.c:118
+#, c-format
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Octal %o"
+
+#: ex_cmds.c:119
+#, c-format
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Octal %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: óÔÒÏËÉ ÐÅÒÅÍÅÝÁÀÔÓÑ ÓÁÍÉ ÎÁ ÓÅÂÑ"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "ðÅÒÅÍÅÝÅÎÁ ÏÄÎÁ ÓÔÒÏËÁ"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "ðÅÒÅÍÅÝÅÎÏ ÓÔÒÏË: %ld"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "ðÒÏÐÕÝÅÎÏ ÞÅÒÅÚ ÆÉÌØÔÒ ÓÔÒÏË: %ld"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: á×ÔÏËÏÍÁÎÄÙ *Filter* ÎÅ ÄÏÌÖÎÙ ÉÚÍÅÎÑÔØ ÁËÔÉ×ÎÙÊ ÂÕÆÅÒ"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[éÚÍÅÎÅÎÉÑ ÎÅ ÓÏÈÒÁÎÅÎÙ]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s × ÓÔÒÏËÅ: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr ""
+"E136: viminfo: óÌÉÛËÏÍ ÍÎÏÇÏ ÏÛÉÂÏË, ÏÓÔÁÌØÎÁÑ ÞÁÓÔØ ÆÁÊÌÁ ÂÕÄÅÔ ÐÒÏÐÕÝÅÎÁ"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "þÔÅÎÉÅ ÆÁÊÌÁ viminfo \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " ÉÎÆÏ"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " ÏÔÍÅÔÏË"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " îåõäáþîï"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: ðÒÁ×Á ÎÁ ÚÁÐÉÓØ ÆÁÊÌÁ viminfo ÏÔÓÕÔÓÔ×ÕÀÔ: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: îÅ×ÏÚÍÏÖÎÏ ÚÁÐÉÓÁÔØ ÆÁÊÌ viminfo %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "úÁÐÉÓØ ÆÁÊÌÁ viminfo \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# üÔÏÔ ÆÁÊÌ viminfo Á×ÔÏÍÁÔÉÞÅÓËÉ ÓÏÚÄÁÎ Vim %s.\n"
+
+#: ex_cmds.c:1651
+#, c-format
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# åÇÏ ÍÏÖÎÏ (ÏÓÔÏÒÏÖÎÏ!) ÒÅÄÁËÔÉÒÏ×ÁÔØ.\n"
+"\n"
+
+#: ex_cmds.c:1653
+#, c-format
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# úÎÁÞÅÎÉÅ ÏÐÃÉÉ 'encoding' × ÍÏÍÅÎÔ ÚÁÐÉÓÉ ÆÁÊÌÁ\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "îÅÄÏÐÕÓÔÉÍÙÊ ÎÁÞÁÌØÎÙÊ ÓÉÍ×ÏÌ"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "óÏÈÒÁÎÉÔØ ËÁË"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: æÁÊÌ ÚÁÇÒÕÖÅÎ × ÄÒÕÇÏÍ ÂÕÆÅÒÅ"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "úÁÐÉÓÁÔØ ÆÁÊÌ ÞÁÓÔÉÞÎÏ?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: äÌÑ ÚÁÐÉÓÉ ÞÁÓÔÉ ÂÕÆÅÒÁ ÉÓÐÏÌØÚÕÊÔÅ !"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "ðÅÒÅÐÉÓÁÔØ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: âÕÆÅÒ %ld ÎÅ Ó×ÑÚÁÎ Ó ÉÍÅÎÅÍ ÆÁÊÌÁ"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: æÁÊÌ ÎÅ ÓÏÈÒÁΣÎ: ÚÁÐÉÓØ ÏÔËÌÀÞÅÎÁ ÏÐÃÉÅÊ 'write'"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"äÌÑ \"%.*s\" ×ËÌÀÞÅÎÁ ÏÐÃÉÑ 'readonly'.\n"
+"úÁÐÉÓÁÔØ?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÎÉÅ ÆÁÊÌÁ"
+
+#: ex_cmds.c:3205
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: á×ÔÏËÏÍÁÎÄÙ ÎÅÏÖÉÄÁÎÎÏ ÕÂÉÌÉ ÎÏ×ÙÊ ÂÕÆÅÒ %s"
+
+#: ex_cmds.c:3339
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ðÁÒÁÍÅÔÒ ËÏÍÁÎÄÙ :z ÄÏÌÖÅÎ ÂÙÔØ ÞÉÓÌÏÍ"
+
+#: ex_cmds.c:3424
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: éÓÐÏÌØÚÏ×ÁÎÉÅ ËÏÍÁÎÄ ÏÂÏÌÏÞËÉ ÎÅ ÄÏÐÕÓËÁÅÔÓÑ × rvim."
+
+#: ex_cmds.c:3531
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: òÅÇÕÌÑÒÎÙÅ ×ÙÒÁÖÅÎÉÑ ÎÅ ÍÏÇÕÔ ÒÁÚÄÅÌÑÔØÓÑ ÂÕË×ÁÍÉ"
+
+#: ex_cmds.c:3877
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "ÚÁÍÅÎÉÔØ ÎÁ %s? (y/n/a/q/l/^E/^Y)"
+
+#: ex_cmds.c:4270
+msgid "(Interrupted) "
+msgstr "(ðÒÅÒ×ÁÎÏ)"
+
+#: ex_cmds.c:4274
+msgid "1 substitution"
+msgstr "ïÄÎÁ ÚÁÍÅÎÁ"
+
+#: ex_cmds.c:4276
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld ÚÁÍÅÎ"
+
+#: ex_cmds.c:4279
+msgid " on 1 line"
+msgstr " × ÏÄÎÏÊ ÓÔÒÏËÅ"
+
+#: ex_cmds.c:4281
+#, c-format
+msgid " on %ld lines"
+msgstr " × %ld ÓÔÒ."
+
+#: ex_cmds.c:4332
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: ëÏÍÁÎÄÁ :global ÎÅ ÍÏÖÅÔ ÂÙÔØ ÒÅËÕÒÓÉ×ÎÏÊ"
+
+#: ex_cmds.c:4367
+msgid "E148: Regular expression missing from global"
+msgstr "E148: ÷ ËÏÍÁÎÄÅ :global ÐÒÏÐÕÝÅÎÏ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ"
+
+#: ex_cmds.c:4416
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "óÏÏÔ×ÅÔÓÔ×ÉÅ ÛÁÂÌÏÎÕ ÎÁÊÄÅÎÏ ÎÁ ËÁÖÄÏÊ ÓÔÒÏËÅ: %s"
+
+#: ex_cmds.c:4497
+#, c-format
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# ðÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ ÄÌÑ ÚÁÍÅÎÙ:\n"
+"$"
+
+#: ex_cmds.c:4598
+msgid "E478: Don't panic!"
+msgstr "E478: óÐÏËÏÊÓÔ×ÉÅ, ÔÏÌØËÏ ÓÐÏËÏÊÓÔ×ÉÅ!"
+
+#: ex_cmds.c:4650
+#, c-format
+msgid "E661: Sorry, no '%s' help for %s"
+msgstr "E661: Ë ÓÏÖÁÌÅÎÉÀ, ÓÐÒÁ×ËÁ '%s' ÄÌÑ %s ÏÔÓÕÔÓÔ×ÕÅÔ"
+
+#: ex_cmds.c:4653
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ë ÓÏÖÁÌÅÎÉÀ ÓÐÒÁ×ËÁ ÄÌÑ %s ÏÔÓÕÔÓÔ×ÕÅÔ"
+
+#: ex_cmds.c:4687
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "éÚ×ÉÎÉÔÅ, ÆÁÊÌ ÓÐÒÁ×ËÉ \"%s\" ÎÅ ÎÁÊÄÅÎ"
+
+#: ex_cmds.c:5170
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ"
+
+#: ex_cmds.c:5309
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ %s ÄÌÑ ÚÁÐÉÓÉ"
+
+#: ex_cmds.c:5345
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ %s ÄÌÑ ÞÔÅÎÉÑ"
+
+#: ex_cmds.c:5367
+#, c-format
+msgid "E670: Mix of help file encodings within a language: %s"
+msgstr "E670: æÁÊÌÙ ÓÐÒÁ×ËÉ ÉÓÐÏÌØÚÕÀÔ ÒÁÚÎÙÅ ËÏÄÉÒÏ×ËÉ ÄÌÑ ÏÄÎÏÇÏ ÑÚÙËÁ: %s"
+
+#: ex_cmds.c:5445
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ðÏ×ÔÏÒÑÀÝÁÑÓÑ ÍÅÔËÁ \"%s\" × ÆÁÊÌÅ %s"
+
+#: ex_cmds.c:5557
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: îÅÉÚ×ÅÓÔÎÁÑ ËÏÍÁÎÄÁ ÚÎÁÞËÁ %s"
+
+#: ex_cmds.c:5577
+msgid "E156: Missing sign name"
+msgstr "E156: ðÒÏÐÕÝÅÎÏ ÉÍÑ ÚÎÁÞËÁ"
+
+#: ex_cmds.c:5623
+msgid "E612: Too many signs defined"
+msgstr "E612: ïÐÒÅÄÅÌÅÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÚÎÁÞËÏ×"
+
+#: ex_cmds.c:5691
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: îÅÐÒÁ×ÉÌØÎÙÊ ÔÅËÓÔ ÚÎÁÞËÁ: %s"
+
+#: ex_cmds.c:5722 ex_cmds.c:5913
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: îÅÉÚ×ÅÓÔÎÙÊ ÚÎÁÞÏË: %s"
+
+#: ex_cmds.c:5771
+msgid "E159: Missing sign number"
+msgstr "E159: ðÒÏÐÕÝÅÎ ÎÏÍÅÒ ÚÎÁÞËÁ"
+
+#: ex_cmds.c:5853
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: îÅÐÒÁ×ÉÌØÎÏÅ ÉÍÑ ÂÕÆÅÒÁ: %s"
+
+#: ex_cmds.c:5892
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: îÅÐÒÁ×ÉÌØÎÙÊ ID ÚÎÁÞËÁ: %ld"
+
+#: ex_cmds.c:5962
+msgid " (NOT FOUND)"
+msgstr " (îå îáêäåîï)"
+
+#: ex_cmds.c:5964
+msgid " (not supported)"
+msgstr " (ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ)"
+
+#: ex_cmds.c:6063
+msgid "[Deleted]"
+msgstr "[õÄÁÌÅÎÏ]"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "÷ËÌÀޣΠÒÅÖÉÍ ÏÔÌÁÄËÉ. äÌÑ ÐÒÏÄÏÌÖÅÎÉÑ ÎÁÂÅÒÉÔÅ \"cont\""
+
+#: ex_cmds2.c:96 ex_docmd.c:966
+#, c-format
+msgid "line %ld: %s"
+msgstr "ÓÔÒÏËÁ %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "ËÏÍÁÎÄÁ: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "ôÏÞËÁ ÏÓÔÁÎÏ×ËÉ × \"%s%s\" ÓÔÒ. %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ôÏÞËÁ ÏÓÔÁÎÏ×ËÉ ÎÅ ÎÁÊÄÅÎÁ: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "ôÏÞËÉ ÏÓÔÁÎÏ×ËÉ ÎÅ ÏÐÒÅÄÅÌÅÎÙ"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ÓÔÒ. %ld"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "óÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ × \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9378
+msgid "Untitled"
+msgstr "âÅÚ ÉÍÅÎÉ"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: îÅÓÏÈÒÁΣÎÎÙÅ ÉÚÍÅÎÅÎÉÑ × ÂÕÆÅÒÅ \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: îÅÏÖÉÄÁÎÎÙÊ ÐÅÒÅÈÏÄ × ÄÒÕÇÏÊ ÂÕÆÅÒ (ÐÒÏ×ÅÒØÔÅ Á×ÔÏËÏÍÁÎÄÙ)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: äÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÄÏÓÔÕÐÅÎ ÔÏÌØËÏ ÏÄÉÎ ÆÁÊÌ"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: üÔÏ ÐÅÒ×ÙÊ ÆÁÊÌ"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: üÔÏ ÐÏÓÌÅÄÎÉÊ ÆÁÊÌ"
+
+#: ex_cmds2.c:1804
+#, c-format
+msgid "E666: compiler not supported: %s"
+msgstr "E666: ËÏÍÐÉÌÑÔÏÒ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ: %s"
+
+#: ex_cmds2.c:1897
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "ðÏÉÓË \"%s\" × \"%s\""
+
+#: ex_cmds2.c:1919
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "ðÏÉÓË \"%s\""
+
+#: ex_cmds2.c:1940
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "ÎÅ ÎÁÊÄÅÎÏ × 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1974
+msgid "Source Vim script"
+msgstr "÷ÙÐÏÌÎÉÔØ ÓÃÅÎÁÒÉÊ Vim"
+
+#: ex_cmds2.c:2164
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "îÅÌØÚÑ ÓÞÉÔÁÔØ ËÁÔÁÌÏÇ: \"%s\""
+
+#: ex_cmds2.c:2202
+#, c-format
+msgid "could not source \"%s\""
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÞÉÔÁÔØ \"%s\""
+
+#: ex_cmds2.c:2204
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "ÓÔÒÏËÁ %ld: ÎÅ×ÏÚÍÏÖÎÏ ÓÞÉÔÁÔØ \"%s\""
+
+#: ex_cmds2.c:2218
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "ÓÞÉÔÙ×ÁÎÉÅ ÓÃÅÎÁÒÉÑ \"%s\""
+
+#: ex_cmds2.c:2220
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "ÓÔÒÏËÁ %ld: ÓÞÉÔÙ×ÁÎÉÅ \"%s\""
+
+#: ex_cmds2.c:2363
+#, c-format
+msgid "finished sourcing %s"
+msgstr "ÓÞÉÔÙ×ÁÎÉÅ ÓÃÅÎÁÒÉÑ %s ÚÁ×ÅÒÛÅÎÏ"
+
+#: ex_cmds2.c:2707
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr ""
+"W15: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅÐÒÁ×ÉÌØÎÙÊ ÒÁÚÄÅÌÉÔÅÌØ ÓÔÒÏËÉ. ÷ÏÚÍÏÖÎÏ ÐÒÏÐÕÝÅÎÏ ^M"
+
+#: ex_cmds2.c:2756
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: ëÏÍÁÎÄÁ :scriptencoding ÉÓÐÏÌØÚÕÅÔÓÑ ×ÎÅ ÆÁÊÌÁ ÓÃÅÎÁÒÉÑ"
+
+#: ex_cmds2.c:2789
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: ëÏÍÁÎÄÁ :finish ÉÓÐÏÌØÚÕÅÔÓÑ ×ÎÅ ÆÁÊÌÁ ÓÃÅÎÁÒÉÑ"
+
+#: ex_cmds2.c:3238
+#, c-format
+msgid "Page %d"
+msgstr "óÔÒÁÎÉÃÁ %d"
+
+#: ex_cmds2.c:3394
+msgid "No text to be printed"
+msgstr "ðÅÞÁÔÁÔØ ÎÅÞÅÇÏ"
+
+#: ex_cmds2.c:3472
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "ðÅÞÁÔØ ÓÔÒ. %d (%d%%)"
+
+#: ex_cmds2.c:3484
+#, c-format
+msgid " Copy %d of %d"
+msgstr " ëÏÐÉÑ %d ÉÚ %d"
+
+#: ex_cmds2.c:3542
+#, c-format
+msgid "Printed: %s"
+msgstr "îÁÐÅÞÁÔÁÎÏ: %s"
+
+#: ex_cmds2.c:3549
+#, c-format
+msgid "Printing aborted"
+msgstr "ðÅÞÁÔØ ÐÒÅËÒÁÝÅÎÁ"
+
+#: ex_cmds2.c:3914
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: ïÛÉÂËÁ ÚÁÐÉÓÉ × ÆÁÊÌ PostScript"
+
+#: ex_cmds2.c:4189
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ \"%s\""
+
+#: ex_cmds2.c:4199 ex_cmds2.c:4824
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÆÁÊÌ ÒÅÓÕÒÓÏ× PostScript \"%s\""
+
+#: ex_cmds2.c:4207
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: ÆÁÊÌ \"%s\" ÎÅ Ñ×ÌÑÅÔÓÑ ÆÁÊÌÏÍ ÒÅÓÕÒÓÏ× PostScript"
+
+#: ex_cmds2.c:4222 ex_cmds2.c:4242 ex_cmds2.c:4257 ex_cmds2.c:4279
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: ÆÁÊÌ \"%s\" ÎÅ Ñ×ÌÑÅÔÓÑ ÄÏÐÕÓÔÉÍÙÍ ÆÁÊÌÏÍ ÒÅÓÕÒÓÏ× PostScript"
+
+#: ex_cmds2.c:4309
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: ÆÁÊÌ ÒÅÓÕÒÓÏ× \"%s\" ÎÅÉÚ×ÅÓÔÎÏÊ ×ÅÒÓÉÉ"
+
+#: ex_cmds2.c:4776
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ PostScript"
+
+#: ex_cmds2.c:4809
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ \"%s\""
+
+#: ex_cmds2.c:4928
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: æÁÊÌ ÒÅÓÕÒÓÏ× PostScript \"prolog.ps\" ÎÅ ÎÁÊÄÅÎ"
+
+#: ex_cmds2.c:4959
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: æÁÊÌ ÒÅÓÕÒÓÏ× PostScript \"%s.ps\" ÎÅ ÎÁÊÄÅÎ"
+
+#: ex_cmds2.c:4977
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr ""
+"E620: ðÒÅÏÂÒÁÚÏ×ÁÎÉÅ ÉÚ ÍÕÌØÔÉÂÁÊÔÎÙÈ ÓÉÍ×ÏÌÏ× × ËÏÄÉÒÏ×ËÕ \"%s\" ÎÅ×ÏÚÍÏÖÎÏ"
+
+#: ex_cmds2.c:5102
+msgid "Sending to printer..."
+msgstr "ïÔÐÒÁ×ËÁ ÎÁ ÐÅÞÁÔØ..."
+
+#: ex_cmds2.c:5106
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: îÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ ÐÅÞÁÔØ ÆÁÊÌÁ PostScript"
+
+#: ex_cmds2.c:5108
+msgid "Print job sent."
+msgstr "úÁÄÁÎÉÅ ÎÁ ÐÅÞÁÔØ ÏÔÐÒÁ×ÌÅÎÏ."
+
+#: ex_cmds2.c:5618
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "áËÔÉ×ÎÙÊ %sÑÚÙË: \"%s\""
+
+#: ex_cmds2.c:5629
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: îÅ×ÏÚÍÏÖÎÏ ÓÍÅÎÉÔØ ÑÚÙË ÎÁ \"%s\""
+
+#: ex_docmd.c:525
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "ðÅÒÅÈÏÄ × ÒÅÖÉÍ Ex. äÌÑ ÐÅÒÅÈÏÄÁ × ïÂÙÞÎÙÊ ÒÅÖÉÍ ÎÁÂÅÒÉÔÅ \"visual\""
+
+#. must be at EOF
+#: ex_docmd.c:561
+msgid "E501: At end-of-file"
+msgstr "E501: ÷ ËÏÎÃÅ ÆÁÊÌÁ"
+
+#: ex_docmd.c:669
+msgid "E169: Command too recursive"
+msgstr "E169: CÌÉÛËÏÍ ÒÅËÕÒÓÉ×ÎÁÑ ËÏÍÁÎÄÁ"
+
+#: ex_docmd.c:1229
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: éÓËÌÀÞÉÔÅÌØÎÁÑ ÓÉÔÕÁÃÉÑ ÎÅ ÏÂÒÁÂÏÔÁÎÁ: %s"
+
+#: ex_docmd.c:1317
+msgid "End of sourced file"
+msgstr "ëÏÎÅà ÓÞÉÔÁÎÎÏÇÏ ÆÁÊÌÁ"
+
+#: ex_docmd.c:1318
+msgid "End of function"
+msgstr "ëÏÎÅà ÆÕÎËÃÉÉ"
+
+#: ex_docmd.c:1907
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: îÅÏÄÎÏÚÎÁÞÎÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ËÏÍÁÎÄÙ ÐÏÌØÚÏ×ÁÔÅÌÑ"
+
+#: ex_docmd.c:1921
+msgid "E492: Not an editor command"
+msgstr "E492: üÔÏ ÎÅ ËÏÍÁÎÄÁ ÒÅÄÁËÔÏÒÁ"
+
+#: ex_docmd.c:2028
+msgid "E493: Backwards range given"
+msgstr "E493: úÁÄÁÎ ÏÂÒÁÔÎÙÊ ÄÉÁÐÁÚÏÎ"
+
+#: ex_docmd.c:2037
+msgid "Backwards range given, OK to swap"
+msgstr "úÁÄÁÎ ÏÂÒÁÔÎÙÊ ÄÉÁÐÁÚÏÎ, ÍÅÎÑÅÍ ÇÒÁÎÉÃÙ ÍÅÓÔÁÍÉ"
+
+#: ex_docmd.c:2160
+msgid "E494: Use w or w>>"
+msgstr "E494: éÓÐÏÌØÚÕÊÔÅ w ÉÌÉ w>>"
+
+#: ex_docmd.c:3786
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: éÚ×ÉÎÉÔÅ, ÜÔÁ ËÏÍÁÎÄÁ ÎÅÄÏÓÔÕÐÎÁ × ÄÁÎÎÏÊ ×ÅÒÓÉÉ"
+
+#: ex_docmd.c:3989
+msgid "E172: Only one file name allowed"
+msgstr "E172: òÁÚÒÅÛÅÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ ÏÄÎÏ ÉÍÑ ÆÁÊÌÁ"
+
+#: ex_docmd.c:4569
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 ÆÁÊÌ ÏÖÉÄÁÅÔ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ÷ÙÊÔÉ?"
+
+#: ex_docmd.c:4572
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "åÓÔØ ÎÅÏÔÒÅÄÁËÔÉÒÏ×ÁÎÎÙÅ ÆÁÊÌÙ (%d). ÷ÙÊÔÉ?"
+
+#: ex_docmd.c:4579
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 ÆÁÊÌ ÏÖÉÄÁÅÔ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ."
+
+#: ex_docmd.c:4581
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: åÓÔØ ÎÅÏÔÒÅÄÁËÔÉÒÏ×ÁÎÎÙÅ ÆÁÊÌÙ (%d)."
+
+#: ex_docmd.c:4676
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: ëÏÍÁÎÄÁ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ. äÏÂÁ×ØÔÅ ! ÄÌÑ ÚÁÍÅÎÙ."
+
+#: ex_docmd.c:4787
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" éÍÑ ðÁÒÁÍ. äÉÁÐ. äÏÐÏÌÎ. ïÐÒÅÄÅÌÅÎÉÅ"
+
+#: ex_docmd.c:4876
+msgid "No user-defined commands found"
+msgstr "ëÏÍÁÎÄÙ, ÏÐÒÅÄÅÌ£ÎÎÙÅ ÐÏÌØÚÏ×ÁÔÅÌÅÍ, ÎÅ ÏÂÎÁÒÕÖÅÎÙ."
+
+#: ex_docmd.c:4908
+msgid "E175: No attribute specified"
+msgstr "E175: ÐÁÒÁÍÅÔÒ ÎÅ ÚÁÄÁÎ"
+
+#: ex_docmd.c:4960
+msgid "E176: Invalid number of arguments"
+msgstr "E176: îÅÐÒÁ×ÉÌØÎÏÅ ËÏÌÉÞÅÓÔ×Ï ÐÁÒÁÍÅÔÒÏ×"
+
+#: ex_docmd.c:4975
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: þÉÓÌÏ-ÐÒÉÓÔÁ×ËÕ ÎÅÌØÚÑ ÕËÁÚÙ×ÁÔØ Ä×ÁÖÄÙ"
+
+#: ex_docmd.c:4985
+msgid "E178: Invalid default value for count"
+msgstr "E178: îÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÞÉÓÌÁ-ÐÒÉÓÔÁ×ËÉ ÐÏ ÕÍÏÌÞÁÎÉÀ"
+
+#: ex_docmd.c:5016
+msgid "E179: argument required for complete"
+msgstr "E179: ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÔÒÅÂÕÅÔÓÑ ÕËÁÚÁÔØ ÐÁÒÁÍÅÔÒ"
+
+#: ex_docmd.c:5048
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: îÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÄÏÐÏÌÎÅÎÉÑ: %s"
+
+#: ex_docmd.c:5057
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr ""
+"E468: ðÁÒÁÍÅÔÒ Á×ÔÏÄÏÐÏÌÎÅÎÉÑ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ Ó ÏÓÏÂÙÍ ÄÏÐÏÌÎÅÎÉÅÍ"
+
+#: ex_docmd.c:5063
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: ïÓÏÂÏÅ ÄÏÐÏÌÎÅÎÉÅ ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ ÐÁÒÁÍÅÔÒÁ ÆÕÎËÃÉÉ"
+
+#: ex_docmd.c:5074
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: îÅÐÒÁ×ÉÌØÎÙÊ ÁÔÒÉÂÕÔ: %s"
+
+#: ex_docmd.c:5117
+msgid "E182: Invalid command name"
+msgstr "E182: îÅÐÒÁ×ÉÌØÎÏÅ ÉÍÑ ËÏÍÁÎÄÙ"
+
+#: ex_docmd.c:5132
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: ëÏÍÁÎÄÁ ÐÏÌØÚÏ×ÁÔÅÌÑ ÄÏÌÖÎÁ ÎÁÞÉÎÁÔØÓÑ Ó ÚÁÇÌÁ×ÎÏÊ ÂÕË×Ù"
+
+#: ex_docmd.c:5203
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: îÅÔ ÔÁËÏÊ ËÏÍÁÎÄÙ ÐÏÌØÚÏ×ÁÔÅÌÑ: %s"
+
+#: ex_docmd.c:5664
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: ã×ÅÔÏ×ÁÑ ÓÈÅÍÁ %s ÎÅ ÎÁÊÄÅÎÁ"
+
+#: ex_docmd.c:5672
+msgid "Greetings, Vim user!"
+msgstr "ðÒÉ×ÅÔ, ÐÏÌØÚÏ×ÁÔÅÌØ Vim!"
+
+#: ex_docmd.c:6389
+msgid "Edit File in new window"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÔØ ÆÁÊÌ × ÎÏ×ÏÍ ÏËÎÅ"
+
+#: ex_docmd.c:6684
+msgid "No swap file"
+msgstr "âÅÚ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: ex_docmd.c:6788
+msgid "Append File"
+msgstr "äÏÂÁ×ÉÔØ ÆÁÊÌ"
+
+#: ex_docmd.c:6852
+msgid "E186: No previous directory"
+msgstr "E186: îÅÔ ÐÒÅÄÙÄÕÝÅÇÏ ËÁÔÁÌÏÇÁ"
+
+#: ex_docmd.c:6934
+msgid "E187: Unknown"
+msgstr "E187: îÅÉÚ×ÅÓÔÎÏ"
+
+#: ex_docmd.c:7019
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: ËÏÍÁÎÄÁ :winsize ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ Ä×ÕÈ ÞÉÓÌÏ×ÙÈ ÐÁÒÁÍÅÔÒÏ×"
+
+#: ex_docmd.c:7075
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "ðÏÌÏÖÅÎÉÅ ÏËÎÁ: X %d, Y %d"
+
+#: ex_docmd.c:7080
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: ÷ ÄÁÎÎÏÊ ÓÉÓÔÅÍÅ ÏÐÒÅÄÅÌÅÎÉÅ ÐÏÌÏÖÅÎÉÑ ÏËÎÁ ÎÅ ÒÁÂÏÔÁÅÔ"
+
+#: ex_docmd.c:7090
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: ËÏÍÁÎÄÁ :winpos ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ Ä×ÕÈ ÞÉÓÌÏ×ÙÈ ÐÁÒÁÍÅÔÒÏ×"
+
+#: ex_docmd.c:7368
+msgid "Save Redirection"
+msgstr "ðÅÒÅÎÁÐÒÁ×ÌÅÎÉÅ ÚÁÐÉÓÉ"
+
+#: ex_docmd.c:7558
+msgid "Save View"
+msgstr "óÏÈÒÁÎÅÎÉÅ ×ÉÄÁ"
+
+#: ex_docmd.c:7559
+msgid "Save Session"
+msgstr "óÏÈÒÁÎÅÎÉÅ ÓÅÁÎÓÁ"
+
+#: ex_docmd.c:7561
+msgid "Save Setup"
+msgstr "óÏÈÒÁÎÅÎÉÅ ÎÁÓÔÒÏÅË"
+
+#: ex_docmd.c:7713
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ÓÕÝÅÓÔ×ÕÅÔ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: ex_docmd.c:7718
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÌÑ ÚÁÐÉÓÉ \"%s\""
+
+#. set mark
+#: ex_docmd.c:7742
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: ðÁÒÁÍÅÔÒ ÄÏÌÖÅÎ ÂÙÔØ ÐÒÑÍÏÊ/ÏÂÒÁÔÎÏÊ ËÁ×ÙÞËÏÊ ÉÌÉ ÂÕË×ÏÊ"
+
+#: ex_docmd.c:7784
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: óÌÉÛËÏÍ ÇÌÕÂÏËÁÑ ÒÅËÕÒÓÉÑ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ËÏÍÁÎÄÙ :normal"
+
+#: ex_docmd.c:8302
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: îÅÔ ÓÏÓÅÄÎÅÇÏ ÉÍÅÎÉ ÆÁÊÌÁ ÄÌÑ ÚÁÍÅÎÙ '#'"
+
+#: ex_docmd.c:8333
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: îÅÔ Á×ÔÏËÏÍÁÎÄÎÏÇÏ ÉÍÅÎÉ ÆÁÊÌÁ ÄÌÑ ÚÁÍÅÎÙ \"<afile>\""
+
+#: ex_docmd.c:8341
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: îÅÔ Á×ÔÏËÏÍÁÎÄÎÏÇÏ ÎÏÍÅÒÁ ÂÕÆÅÒÁ ÄÌÑ ÚÁÍÅÎÙ \"<abuf>\""
+
+#: ex_docmd.c:8352
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: îÅÔ Á×ÔÏËÏÍÁÎÄÎÏÇÏ ÉÍÅÎÉ ÓÏÏÔ×ÅÔÓÔ×ÉÑ ÄÌÑ ÚÁÍÅÎÙ \"<amatch>\""
+
+#: ex_docmd.c:8362
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: ÎÅÔ ÉÍÅÎÉ ÆÁÊÌÁ :source ÄÌÑ ÚÁÍÅÎÙ \"<sfile>\""
+
+#: ex_docmd.c:8403
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: ðÕÓÔÏÅ ÉÍÑ ÆÁÊÌÁ ÄÌÑ '%' ÉÌÉ '#', ×ÏÚÍÏÖÎÏ ÔÏÌØËÏ c \":p:h\""
+
+#: ex_docmd.c:8405
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: òÅÚÕÌØÔÁÔÏÍ ×ÙÒÁÖÅÎÉÑ Ñ×ÌÑÅÔÓÑ ÐÕÓÔÁÑ ÓÔÒÏËÁ"
+
+#: ex_docmd.c:9360
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ viminfo ÄÌÑ ÞÔÅÎÉÑ"
+
+#: ex_docmd.c:9533
+msgid "E196: No digraphs in this version"
+msgstr "E196: ÷ ÜÔÏÊ ×ÅÒÓÉÉ ÄÉÇÒÁÆÙ ÎÅ ÒÁÂÏÔÁÀÔ"
+
+#: ex_eval.c:440
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr ""
+"E608: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ :throw ÄÌÑ ÉÓËÌÀÞÅÎÉÊ Ó ÐÒÉÓÔÁ×ËÏÊ 'Vim'"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:529
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "éÓËÌÀÞÉÔÅÌØÎÁÑ ÓÉÔÕÁÃÉÑ: %s"
+
+#: ex_eval.c:576
+#, c-format
+msgid "Exception finished: %s"
+msgstr "úÁ×ÅÒÛÅÎÁ ÏÂÒÁÂÏÔËÁ ÉÓËÌÀÞÉÔÅÌØÎÏÊ ÓÉÔÕÁÃÉÉ: %s"
+
+#: ex_eval.c:577
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "éÓËÌÀÞÉÔÅÌØÎÁÑ ÓÉÔÕÁÃÉÑ ÐÒÏÉÇÎÏÒÉÒÏ×ÁÎÁ: %s"
+
+#: ex_eval.c:620 ex_eval.c:664
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, ÓÔÒÏËÁ %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:638
+#, c-format
+msgid "Exception caught: %s"
+msgstr "ïÂÒÁÂÏÔËÁ ÉÓËÌÀÞÉÔÅÌØÎÏÊ ÓÉÔÕÁÃÉÉ: %s"
+
+#: ex_eval.c:713
+#, c-format
+msgid "%s made pending"
+msgstr "%s ×ÙÐÏÌÎÑÅÔ ÏÖÉÄÁÎÉÅ"
+
+#: ex_eval.c:716
+#, c-format
+msgid "%s resumed"
+msgstr "%s ×ÏÚÏÂÎÏ×ÌÅÎÏ"
+
+#: ex_eval.c:720
+#, c-format
+msgid "%s discarded"
+msgstr "%s ÐÒÏÐÕÝÅÎÏ"
+
+#: ex_eval.c:746
+msgid "Exception"
+msgstr "éÓËÌÀÞÉÔÅÌØÎÁÑ ÓÉÔÕÁÃÉÑ"
+
+#: ex_eval.c:752
+msgid "Error and interrupt"
+msgstr "ïÛÉÂËÁ É ÐÒÅÒÙ×ÁÎÉÅ"
+
+#: ex_eval.c:754 gui.c:4381
+msgid "Error"
+msgstr "ïÛÉÂËÁ"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:756
+msgid "Interrupt"
+msgstr "ðÒÅÒÙ×ÁÎÉÅ"
+
+#: ex_eval.c:830
+msgid "E579: :if nesting too deep"
+msgstr "E579: ÓÌÉÛËÏÍ ÇÌÕÂÏËÏ ×ÌÏÖÅÎÎÙÊ :if"
+
+#: ex_eval.c:867
+msgid "E580: :endif without :if"
+msgstr "E580: :endif ÂÅÚ :if"
+
+#: ex_eval.c:911
+msgid "E581: :else without :if"
+msgstr "E581: :else ÂÅÚ :if"
+
+#: ex_eval.c:914
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif ÂÅÚ :if"
+
+#: ex_eval.c:921
+msgid "E583: multiple :else"
+msgstr "E583: ÏÂÎÁÒÕÖÅÎÏ ÎÅÓËÏÌØËÏ :else"
+
+#: ex_eval.c:924
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif ÐÏÓÌÅ :else"
+
+#: ex_eval.c:991
+msgid "E585: :while nesting too deep"
+msgstr "E585: ÓÌÉÛËÏÍ ÇÌÕÂÏËÏ ×ÌÏÖÅÎÎÙÊ :while"
+
+#: ex_eval.c:1047
+msgid "E586: :continue without :while"
+msgstr "E586: :continue ÂÅÚ :while"
+
+#: ex_eval.c:1087
+msgid "E587: :break without :while"
+msgstr "E587: :break ÂÅÚ :while"
+
+#: ex_eval.c:1286
+msgid "E601: :try nesting too deep"
+msgstr "E601: ÓÌÉÛËÏÍ ÇÌÕÂÏËÏ ×ÌÏÖÅÎÎÙÊ :try"
+
+#: ex_eval.c:1366
+msgid "E603: :catch without :try"
+msgstr "E603: :catch ÂÅÚ :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1388
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch ÂÅÚ :finally"
+
+#: ex_eval.c:1521
+msgid "E606: :finally without :try"
+msgstr "E606: :finally ÂÅÚ :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1545
+msgid "E607: multiple :finally"
+msgstr "E607: ÏÂÎÁÒÕÖÅÎÏ ÎÅÓËÏÌØËÏ :finally"
+
+#: ex_eval.c:1654
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry ÂÅÚ :try"
+
+#: ex_eval.c:1986
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: ËÏÍÁÎÄÁ :endfunction ÍÏÖÅÔ ÉÓÐÏÌØÚÏ×ÁÔØÓÑ ÔÏÌØËÏ ×ÎÕÔÒÉ ÆÕÎËÃÉÉ"
+
+#: ex_getln.c:3296
+msgid "tagname"
+msgstr "ÉÍÑ ÍÅÔËÉ"
+
+#: ex_getln.c:3299
+msgid " kind file\n"
+msgstr " ÔÉÐ ÆÁÊÌÁ\n"
+
+#: ex_getln.c:4752
+msgid "'history' option is zero"
+msgstr "ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'history' ÒÁ×ÎÏ ÎÕÌÀ"
+
+#: ex_getln.c:5023
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s, ÉÓÔÏÒÉÑ (ÎÁÞÉÎÁÑ ÏÔ Ó×ÅÖÅÇÏ Ë ÓÔÁÒÏÍÕ):\n"
+
+#: ex_getln.c:5024
+msgid "Command Line"
+msgstr "ëÏÍÁÎÄÎÁÑ ÓÔÒÏËÁ"
+
+#: ex_getln.c:5025
+msgid "Search String"
+msgstr "óÔÒÏËÁ ÐÏÉÓËÁ"
+
+#: ex_getln.c:5026
+msgid "Expression"
+msgstr "÷ÙÒÁÖÅÎÉÅ"
+
+#: ex_getln.c:5027
+msgid "Input Line"
+msgstr "óÔÒÏËÁ ××ÏÄÁ"
+
+#: ex_getln.c:5065
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ÂÏÌØÛÅ ÄÌÉÎÙ ËÏÍÁÎÄÙ"
+
+#: ex_getln.c:5242
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: õÄÁÌÅÎÏ ÁËÔÉ×ÎÏÅ ÏËÎÏ ÉÌÉ ÂÕÆÅÒ"
+
+#: fileio.c:377
+msgid "Illegal file name"
+msgstr "îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÆÁÊÌÁ"
+
+#: fileio.c:401 fileio.c:535 fileio.c:2913 fileio.c:2954
+msgid "is a directory"
+msgstr "Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ"
+
+#: fileio.c:403
+msgid "is not a file"
+msgstr "ÎÅ Ñ×ÌÑÅÔÓÑ ÆÁÊÌÏÍ"
+
+#: fileio.c:557 fileio.c:4131
+msgid "[New File]"
+msgstr "[îÏ×ÙÊ ÆÁÊÌ]"
+
+#: fileio.c:590
+msgid "[Permission Denied]"
+msgstr "[äÏÓÔÕÐ ÚÁÐÒÅÝ£Î]"
+
+#: fileio.c:694
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: ÷ ÒÅÚÕÌØÔÁÔÅ ×ÙÐÏÌÎÅÎÉÑ Á×ÔÏËÏÍÁÎÄ *ReadPre ÆÁÊÌ ÓÔÁÌ ÎÅÞÉÔÁÅÍÙÍ"
+
+#: fileio.c:696
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: Á×ÔÏËÏÍÁÎÄÙ *ReadPre ÎÅ ÄÏÌÖÎÙ ÉÚÍÅÎÑÔØ ÁËÔÉ×ÎÙÊ ÂÕÆÅÒ"
+
+#: fileio.c:717
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: ×ÙÐÏÌÎÑÅÔÓÑ ÞÔÅÎÉÅ ÉÚ ÓÔÁÎÄÁÒÔÎÏÇÏ ÐÏÔÏËÁ ××ÏÄÁ stdin...\n"
+
+#: fileio.c:723
+msgid "Reading from stdin..."
+msgstr "÷ÙÐÏÌÎÑÅÔÓÑ ÞÔÅÎÉÅ ÉÚ ÓÔÁÎÄÁÒÔÎÏÇÏ ÐÏÔÏËÁ ××ÏÄÁ stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:1000
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ÷ ÒÅÚÕÌØÔÁÔÅ ÐÒÅÏÂÒÁÚÏ×ÁÎÉÑ ÆÁÊÌ ÓÔÁÌ ÎÅÞÉÔÁÅÍÙÍ!"
+
+#: fileio.c:2090
+msgid "[fifo/socket]"
+msgstr "[fifo/ÇÎÅÚÄÏ]"
+
+#: fileio.c:2097
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:2104
+msgid "[socket]"
+msgstr "[ÇÎÅÚÄÏ]"
+
+#: fileio.c:2112
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:2122
+msgid "[CR missing]"
+msgstr "[ÐÒÏÐÕÝÅÎÙ ÓÉÍ×ÏÌÙ CR]"
+
+#: fileio.c:2127
+msgid "[NL found]"
+msgstr "[ïÂÎÁÒÕÖÅÎÙ ÓÉÍ×ÏÌÙ NL]"
+
+#: fileio.c:2132
+msgid "[long lines split]"
+msgstr "[ÄÌÉÎÎÙÅ ÓÔÒÏËÉ ÒÁÚÂÉÔÙ]"
+
+#: fileio.c:2138 fileio.c:4115
+msgid "[NOT converted]"
+msgstr "[âåú ÐÒÅÏÂÒÁÚÏ×ÁÎÉÊ]"
+
+#: fileio.c:2143 fileio.c:4120
+msgid "[converted]"
+msgstr "[ÐÅÒÅËÏÄÉÒÏ×ÁÎÏ]"
+
+#: fileio.c:2150 fileio.c:4145
+msgid "[crypted]"
+msgstr "[ÚÁÛÉÆÒÏ×ÁÎÏ]"
+
+#: fileio.c:2157
+msgid "[CONVERSION ERROR]"
+msgstr "[ïûéâëá ðòåïâòáúï÷áîéñ]"
+
+#: fileio.c:2163
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[îåäïðõóôéíùê âáêô × ÓÔÒÏËÅ %ld]"
+
+#: fileio.c:2170
+msgid "[READ ERRORS]"
+msgstr "[ïûéâëé þôåîéñ]"
+
+#: fileio.c:2386
+msgid "Can't find temp file for conversion"
+msgstr "÷ÒÅÍÅÎÎÙÊ ÆÁÊÌ ÄÌÑ ÐÅÒÅËÏÄÉÒÏ×ÁÎÉÑ ÎÅ ÎÁÊÄÅÎ"
+
+#: fileio.c:2393
+msgid "Conversion with 'charconvert' failed"
+msgstr "ðÒÅÏÂÒÁÚÏ×ÁÎÉÅ Ó ÐÏÍÏÝØÀ 'charconvert' ÎÅ ×ÙÐÏÌÎÅÎÏ"
+
+#: fileio.c:2396
+msgid "can't read output of 'charconvert'"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ×Ù×ÏÄ 'charconvert'"
+
+#: fileio.c:2796
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: âÕÆÅÒ, ËÏÔÏÒÙÊ ÔÒÅÂÏ×ÁÌÏÓØ ÚÁÐÉÓÁÔØ, ÕÄẠ́ΠÉÌÉ ×ÙÇÒÕÖÅÎ Á×ÔÏËÏÍÁÎÄÏÊ"
+
+#: fileio.c:2819
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: ëÏÌÉÞÅÓÔ×Ï ÓÔÒÏË ÉÚÍÅÎÅÎÏ Á×ÔÏËÏÍÁÎÄÏÊ ÎÅÏÖÉÄÁÎÎÙÍ ÏÂÒÁÚÏÍ"
+
+#: fileio.c:2857
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans ÎÅ ÐÏÚ×ÏÌÑÅÔ ×ÙÐÏÌÎÑÔØ ÚÁÐÉÓØ ÎÅÉÚÍÅΣÎÎÙÈ ÂÕÆÅÒÏ×"
+
+#: fileio.c:2865
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "þÁÓÔÉÞÎÁÑ ÚÁÐÉÓØ ÂÕÆÅÒÏ× NetBeans ÎÅ ÄÏÐÕÓËÁÅÔÓÑ"
+
+#: fileio.c:2919 fileio.c:2937
+msgid "is not a file or writable device"
+msgstr "ÎÅ Ñ×ÌÑÅÔÓÑ ÆÁÊÌÏÍ ÉÌÉ ÕÓÔÒÏÊÓÔ×ÏÍ, ÄÏÓÔÕÐÎÙÍ ÄÌÑ ÚÁÐÉÓÉ"
+
+#: fileio.c:2989
+msgid "is read-only (add ! to override)"
+msgstr "ÏÔËÒÙÔ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3335
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: úÁÐÉÓØ × ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ ÎÅ×ÏÚÍÏÖÎÁ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3347
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: ïÛÉÂËÁ ÚÁËÒÙÔÉÑ ÒÅÚÅÒ×ÎÏÇÏ ÆÁÊÌÁ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3349
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3365
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3468
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3530
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: ÷ÉÌËÁ ÒÅÓÕÒÓÁ ÂÕÄÅÔ ÐÏÔÅÒÑÎÁ (!, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: fileio.c:3640
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: ÷ÒÅÍÅÎÎÙÊ ÆÁÊÌ ÄÌÑ ÚÁÐÉÓÉ ÎÅ ÎÁÊÄÅÎ"
+
+#: fileio.c:3658
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: ðÅÒÅËÏÄÉÒÏ×ËÁ ÎÅ×ÏÚÍÏÖÎÁ (! ÄÌÑ ÚÁÐÉÓÉ ÂÅÚ ÐÅÒÅËÏÄÉÒÏ×ËÉ)"
+
+#: fileio.c:3693
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ Ó×ÑÚÁÎÎÙÊ ÆÁÊÌ ÄÌÑ ÚÁÐÉÓÉ"
+
+#: fileio.c:3697
+msgid "E212: Can't open file for writing"
+msgstr "E212: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ ÄÌÑ ÚÁÐÉÓÉ"
+
+#: fileio.c:3959
+msgid "E667: Fsync failed"
+msgstr "E667: îÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ ÆÕÎËÃÉÀ fsync()"
+
+#: fileio.c:3966
+msgid "E512: Close failed"
+msgstr "E512: ïÐÅÒÁÃÉÑ ÚÁËÒÙÔÉÑ ÎÅ ÕÄÁÌÁÓØ"
+
+#: fileio.c:4037
+msgid "E513: write error, conversion failed"
+msgstr "E513: ïÛÉÂËÁ ÚÁÐÉÓÉ, ÐÒÅÏÂÒÁÚÏ×ÁÎÉÅ ÎÅ ÕÄÁÌÏÓØ"
+
+#: fileio.c:4043
+msgid "E514: write error (file system full?)"
+msgstr "E514: ÏÛÉÂËÁ ÚÁÐÉÓÉ (ÎÅÔ Ó×ÏÂÏÄÎÏÇÏ ÍÅÓÔÁ?)"
+
+#: fileio.c:4110
+msgid " CONVERSION ERROR"
+msgstr " ïûéâëá ðòåïâòáúï÷áîéñ"
+
+#: fileio.c:4126
+msgid "[Device]"
+msgstr "[õÓÔÒÏÊÓÔ×Ï]"
+
+#: fileio.c:4131
+msgid "[New]"
+msgstr "[îÏ×ÙÊ]"
+
+#: fileio.c:4153
+msgid " [a]"
+msgstr " [a]"
+
+#: fileio.c:4153
+msgid " appended"
+msgstr " ÄÏÂÁ×ÌÅÎÏ"
+
+#: fileio.c:4155
+msgid " [w]"
+msgstr " [w]"
+
+#: fileio.c:4155
+msgid " written"
+msgstr " ÚÁÐÉÓÁÎÏ"
+
+#: fileio.c:4205
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: òÅÖÉÍ ÚÁÐÌÁÔËÉ: ÎÅ×ÏÚÍÏÖÎÏ ÓÏÈÒÁÎÅÎÉÅ ÉÓÈÏÄÎÏÇÏ ÆÁÊÌÁ"
+
+#: fileio.c:4227
+msgid "E206: patchmode: can't touch empty original file"
+msgstr ""
+"E206: òÅÖÉÍ ÚÁÐÌÁÔËÉ: ÎÅ×ÏÚÍÏÖÎÏ ÓÍÅÎÉÔØ ÐÁÒÁÍÅÔÒÙ ÐÕÓÔÏÇÏ ÉÓÈÏÄÎÏÇÏ ÆÁÊÌÁ"
+
+#: fileio.c:4242
+msgid "E207: Can't delete backup file"
+msgstr "E207: îÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÒÅÚÅÒ×ÎÙÊ ÆÁÊÌ"
+
+#: fileio.c:4306
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ðòåäõðòåöäåîéå: éÓÈÏÄÎÙÊ ÆÁÊÌ ÍÏÖÅÔ ÂÙÔØ ÕÔÒÁÞÅÎ ÉÌÉ ÐÏ×ÒÅÖÄ£Î\n"
+
+#: fileio.c:4308
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ÎÅ ×ÙÈÏÄÉÔÅ ÉÚ ÒÅÄÁËÔÏÒÁ, ÐÏËÁ ÆÁÊÌ ÎÅ ÂÕÄÅÔ ÕÓÐÅÛÎÏ ÚÁÐÉÓÁÎ!"
+
+#: fileio.c:4397
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4397
+msgid "[dos format]"
+msgstr "[ÆÏÒÍÁÔ dos]"
+
+#: fileio.c:4404
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4404
+msgid "[mac format]"
+msgstr "[ÆÏÒÍÁÔ mac]"
+
+#: fileio.c:4411
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4411
+msgid "[unix format]"
+msgstr "[ÆÏÒÍÁÔ unix]"
+
+#: fileio.c:4438
+msgid "1 line, "
+msgstr "1 ÓÔÒÏËÁ, "
+
+#: fileio.c:4440
+#, c-format
+msgid "%ld lines, "
+msgstr "ÓÔÒÏË: %ld, "
+
+#: fileio.c:4443
+msgid "1 character"
+msgstr "1 ÓÉÍ×ÏÌ"
+
+#: fileio.c:4445
+#, c-format
+msgid "%ld characters"
+msgstr "ÓÉÍ×ÏÌÏ×: %ld"
+
+#: fileio.c:4455
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4455
+msgid "[Incomplete last line]"
+msgstr "[îÅÚÁ×ÅÒÛ£ÎÎÁÑ ÐÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4474
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ðòåäõðòåöäåîéå: æÁÊÌ ÉÚÍÅÎ£Î Ó ÍÏÍÅÎÔÁ ÞÔÅÎÉÑ!!!"
+
+#: fileio.c:4476
+msgid "Do you really want to write to it"
+msgstr "óÅÒØ£ÚÎÏ ÈÏÔÉÔÅ ÚÁÐÉÓÁÔØ × ÜÔÏÔ ÆÁÊÌ"
+
+#: fileio.c:5726
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: ïÛÉÂËÁ ÚÁÐÉÓÉ × \"%s\""
+
+#: fileio.c:5733
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: ïÛÉÂËÁ ÚÁËÒÙÔÉÑ \"%s\""
+
+#: fileio.c:5736
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: ïÛÉÂËÁ ÞÔÅÎÉÑ \"%s\""
+
+#: fileio.c:5970
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: âÕÆÅÒ ÕÄẠ́ΠÐÒÉ ×ÙÐÏÌÎÅÎÉÉ Á×ÔÏËÏÍÁÎÄÙ FileChangedShell"
+
+#: fileio.c:5977
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÆÁÊÌ \"%s\" ÂÏÌØÛÅ ÎÅ ÄÏÓÔÕÐÅÎ"
+
+#: fileio.c:5991
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÆÁÊÌ \"%s\" É ÂÕÆÅÒ Vim ÂÙÌÉ ÉÚÍÅÎÅÎÙ ÎÅÚÁ×ÉÓÉÍÏ ÄÒÕÇ "
+"ÏÔ ÄÒÕÇÁ"
+
+#: fileio.c:5994
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr ""
+"W11: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÆÁÊÌ \"%s\" ÂÙÌ ÉÚÍÅΣΠÐÏÓÌÅ ÎÁÞÁÌÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ"
+
+#: fileio.c:5996
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÒÅÖÉÍ ÄÏÓÔÕÐÁ Ë ÆÁÊÌÕ \"%s\" ÂÙÌ ÉÚÍÅΣΠÐÏÓÌÅ ÎÁÞÁÌÁ "
+"ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ"
+
+#: fileio.c:6006
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr ""
+"W13: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÆÁÊÌ \"%s\" ÂÙÌ ÓÏÚÄÁÎ ÐÏÓÌÅ ÎÁÞÁÌÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ"
+
+#: fileio.c:6019
+msgid "See \":help W11\" for more info."
+msgstr "óÍ. ÄÏÐÏÌÎÉÔÅÌØÎÕÀ ÉÎÆÏÒÍÁÃÉÀ × \":help W11\"."
+
+#: fileio.c:6033
+msgid "Warning"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ"
+
+#: fileio.c:6034
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&úÁÇÒÕÚÉÔØ ÆÁÊÌ"
+
+#: fileio.c:6140
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: îÅ×ÏÚÍÏÖÎÏ ÐÏÄÇÏÔÏ×ÉÔØÓÑ Ë ÐÅÒÅÚÁÇÒÕÚËÅ \"%s\""
+
+#: fileio.c:6159
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÐÅÒÅÚÁÇÒÕÚËÕ \"%s\""
+
+#: fileio.c:6740
+msgid "--Deleted--"
+msgstr "--õÄÁÌÅÎÏ--"
+
+#. the group doesn't exist
+#: fileio.c:6900
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: çÒÕÐÐÁ \"%s\" ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: fileio.c:7026
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: îÅÄÏÐÕÓÔÉÍÙÅ ÓÉÍ×ÏÌÙ ÐÏÓÌÅ *: %s"
+
+#: fileio.c:7038
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: îÅÓÕÝÅÓÔ×ÕÀÝÅÅ ÓÏÂÙÔÉÅ: %s"
+
+#: fileio.c:7040
+#, c-format
+msgid "E216: No such group or event: %s"
+msgstr "E216: îÅÓÕÝÅÓÔ×ÕÀÝÁÑ ÇÒÕÐÐÁ ÉÌÉ ÓÏÂÙÔÉÅ: %s"
+
+#. Highlight title
+#: fileio.c:7198
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- á×ÔÏËÏÍÁÎÄÙ ---"
+
+#: fileio.c:7469
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ Á×ÔÏËÏÍÁÎÄÙ ÄÌÑ ÷óåè ÓÏÂÙÔÉÊ"
+
+#: fileio.c:7492
+msgid "No matching autocommands"
+msgstr "îÅÔ ÐÏÄÈÏÄÑÝÉÈ Á×ÔÏËÏÍÁÎÄ"
+
+#: fileio.c:7813
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: ÓÌÉÛËÏÍ ÇÌÕÂÏËÏ ×ÌÏÖÅÎÎÙÅ Á×ÔÏËÏÍÁÎÄÙ"
+
+#: fileio.c:8088
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s á×ÔÏËÏÍÁÎÄÙ ÄÌÑ \"%s\""
+
+#: fileio.c:8096
+#, c-format
+msgid "Executing %s"
+msgstr "÷ÙÐÏÌÎÅÎÉÅ %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:8164
+#, c-format
+msgid "autocommand %s"
+msgstr "Á×ÔÏËÏÍÁÎÄÁ %s"
+
+#: fileio.c:8731
+msgid "E219: Missing {."
+msgstr "E219: ðÒÏÐÕÝÅÎÁ {."
+
+#: fileio.c:8733
+msgid "E220: Missing }."
+msgstr "E220: ðÒÏÐÕÝÅÎÁ }."
+
+#: fold.c:68
+msgid "E490: No fold found"
+msgstr "E490: óËÌÁÄÏË ÎÅ ÏÂÎÁÒÕÖÅÎÏ"
+
+#: fold.c:593
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr ""
+"E350: óËÌÁÄËÁ ÎÅ ÍÏÖÅÔ ÂÙÔØ ÓÏÚÄÁÎÁ Ó ÔÅËÕÝÉÍ ÚÎÁÞÅÎÉÅÍ ÏÐÃÉÉ 'foldmethod'"
+
+#: fold.c:595
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr ""
+"E351: óËÌÁÄËÁ ÎÅ ÍÏÖÅÔ ÂÙÔØ ÕÄÁÌÅÎÁ Ó ÔÅËÕÝÉÍ ÚÎÁÞÅÎÉÅÍ ÏÐÃÉÉ 'foldmethod'"
+
+#: getchar.c:248
+msgid "E222: Add to read buffer"
+msgstr "E222: äÏÂÁ×ÌÅÎÉÅ × ÂÕÆÅÒ ÞÔÅÎÉÑ"
+
+#: getchar.c:2198
+msgid "E223: recursive mapping"
+msgstr "E223: ÒÅËÕÒÓÉ×ÎÁÑ ÐÒÉ×ÑÚËÁ"
+
+#: getchar.c:3077
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: ÕÖÅ ÅÓÔØ ÇÌÏÂÁÌØÎÏÅ ÓÏËÒÁÝÅÎÉÅ ÄÌÑ %s"
+
+#: getchar.c:3080
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: ÕÖÅ ÅÓÔØ ÇÌÏÂÁÌØÎÁÑ ÐÒÉ×ÑÚËÁ ÄÌÑ %s"
+
+#: getchar.c:3212
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: ÕÖÅ ÅÓÔØ ÓÏËÒÁÝÅÎÉÅ ÄÌÑ %s"
+
+#: getchar.c:3215
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: ÕÖÅ ÅÓÔØ ÐÒÉ×ÑÚËÁ ÄÌÑ %s"
+
+#: getchar.c:3279
+msgid "No abbreviation found"
+msgstr "óÏËÒÁÝÅÎÉÑ ÎÅ ÎÁÊÄÅÎÙ"
+
+#: getchar.c:3281
+msgid "No mapping found"
+msgstr "ðÒÉ×ÑÚËÉ ÎÅ ÎÁÊÄÅÎÙ"
+
+#: getchar.c:4173
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ÎÅÄÏÐÕÓÔÉÍÙÊ ÒÅÖÉÍ"
+
+#: gui.c:220
+msgid "E229: Cannot start the GUI"
+msgstr "E229: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ÒÅÖÉÍ ÇÒÁÆÉÞÅÓËÏÇÏ ÉÎÔÅÒÆÅÊÓÁ"
+
+#: gui.c:349
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÞÔÅÎÉÅ \"%s\""
+
+#: gui.c:472
+msgid "E665: Cannot start GUI, no valid font found"
+msgstr ""
+"E665: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ÒÅÖÉÍ ÇÒÁÆ. ÉÎÔÅÒÆÅÊÓÁ, ÎÅÐÒÁ×ÉÌØÎÏ ÚÁÄÁÎÙ ÛÒÉÆÔÙ"
+
+#: gui.c:477
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'guifontwide'"
+
+#: gui.c:547
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'imactivatekey'"
+
+#: gui.c:4061
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: îÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ Ã×ÅÔ %s"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<ÎÅÌØÚÑ ÏÔËÒÙÔØ> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ÛÒÉÆÔ %s ÎÅ ÎÁÊÄÅÎ"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: ×ÏÚ×ÒÁÔ × ÔÅËÕÝÉÊ ËÁÔÁÌÏÇ ÎÅ×ÏÚÍÏÖÅÎ"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "ðÕÔØ Ë ÆÁÊÌÕ:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: ÎÅ ÍÏÇÕ ÎÁÊÔÉ ÔÅËÕÝÉÊ ËÁÔÁÌÏÇ"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "äÁ"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2731 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "ïÔÍÅÎÁ"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "ðÏÌÏÓÁ ÐÒÏËÒÕÔËÉ: ÎÅ ÍÏÇÕ ÏÐÒÅÄÅÌÉÔØ ÇÅÏÍÅÔÒÉÀ ÐÏÌÚÕÎËÁ"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "äÉÁÌÏÇÏ×ÏÅ ÏËÎÏ Vim"
+
+#: gui_beval.c:101 gui_w32.c:3829
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr ""
+"E232: \"ðÕÚÙÒØ\" ÄÌÑ ×ÙÞÉÓÌÅÎÉÊ, ×ËÌÀÞÁÀÝÉÊ É ÓÏÏÂÝÅÎÉÅ, É ÏÂÒÁÔÎÙÊ ×ÙÚÏ×, "
+"ÎÅ ÍÏÖÅÔ ÂÙÔØ ÓÏÚÄÁÎ"
+
+#: gui_gtk.c:1607
+msgid "Vim dialog..."
+msgstr "äÉÁÌÏÇÏ×ÏÅ ÏËÎÏ Vim..."
+
+#: gui_gtk.c:2060 message.c:2993
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&äÁ\n"
+"&îÅÔ\n"
+"ï&ÔÍÅÎÁ"
+
+#: gui_gtk.c:2268
+msgid "Input _Methods"
+msgstr "íÅÔÏÄÙ ÷×ÏÄÁ"
+
+#: gui_gtk.c:2534 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ðÏÉÓË É ÚÁÍÅÎÁ..."
+
+#: gui_gtk.c:2542 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - ðÏÉÓË..."
+
+#: gui_gtk.c:2574 gui_motif.c:2888
+msgid "Find what:"
+msgstr "þÔÏ ÉÝÅÍ:"
+
+#: gui_gtk.c:2592 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "îÁ ÞÔÏ ÚÁÍÅÎÑÅÍ:"
+
+#. whole word only button
+#: gui_gtk.c:2624 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "ôÏÌØËÏ ÔÏÞÎÙÅ ÓÏÏÔ×ÅÔÓÔ×ÉÑ"
+
+#. match case button
+#: gui_gtk.c:2635 gui_motif.c:3048
+msgid "Match case"
+msgstr "òÅÇÉÓÔÒÏÚÁ×ÉÓÉÍÙÅ ÓÏÏÔ×ÅÔÓÔ×ÉÑ"
+
+#: gui_gtk.c:2645 gui_motif.c:2990
+msgid "Direction"
+msgstr "îÁÐÒÁ×ÌÅÎÉÅ"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2657 gui_motif.c:3002
+msgid "Up"
+msgstr "÷×ÅÒÈ"
+
+#: gui_gtk.c:2661 gui_motif.c:3010
+msgid "Down"
+msgstr "÷ÎÉÚ"
+
+#: gui_gtk.c:2683 gui_gtk.c:2685 gui_motif.c:2792
+msgid "Find Next"
+msgstr "îÁÊÔÉ ÓÌÅÄÕÀÝÅÅ"
+
+#: gui_gtk.c:2702 gui_gtk.c:2704 gui_motif.c:2809
+msgid "Replace"
+msgstr "úÁÍÅÎÁ"
+
+#: gui_gtk.c:2715 gui_gtk.c:2717 gui_motif.c:2822
+msgid "Replace All"
+msgstr "úÁÍÅÎÉÔØ ×ÓÅ"
+
+#: gui_gtk_x11.c:2327
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: ðÏÌÕÞÅÎ ÚÁÐÒÏÓ ÎÁ ÐÒÅËÒÁÝÅÎÉÅ ÒÁÂÏÔÙ ÏÔ ÄÉÓÐÅÔÞÅÒÁ ÓÅÁÎÓÏ×\n"
+
+#: gui_gtk_x11.c:3519
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: ïÓÎÏ×ÎÏÅ ÏËÎÏ ÂÙÌÏ ÎÅÏÖÉÄÁÎÎÏ ÚÁËÒÙÔÏ\n"
+
+#: gui_gtk_x11.c:4138
+msgid "Font Selection"
+msgstr "÷ÙÂÏÒ ÛÒÉÆÔÁ"
+
+#: gui_gtk_x11.c:6035 ui.c:2120
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "÷ÍÅÓÔÏ ÐÕÓÔÏÇÏ ×ÙÄÅÌÅÎÉÑ ÉÓÐÏÌØÚÕÅÔÓÑ CUT_BUFFER0"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "æÉÌØÔÒ"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "ëÁÔÁÌÏÇÉ"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "óÐÒÁ×ËÁ"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "æÁÊÌÙ"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "÷ÙÄÅÌÅÎÉÅ"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "ïÔÍÅÎÁ"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÛÒÉÆÔ Zap '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: îÅ×ÏÚÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÛÒÉÆÔ %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ïÔÐÒÁ×ËÁ ÓÏÏÂÝÅÎÉÑ ÄÌÑ ÕÎÉÞÔÏÖÅÎÉÑ ÐÒÏÃÅÓÓÁ-ÐÏÔÏÍËÁ.\n"
+
+#: gui_w32.c:829
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ðÁÒÁÍÅÔÒ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ: \"-%s\"; ÉÓÐÏÌØÚÕÊÔÅ ×ÅÒÓÉÀ OLE."
+
+#: gui_w48.c:2090
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "ðÏÉÓË ÓÔÒÏËÉ (ÉÓÐÏÌØÚÕÊÔÅ '\\\\' ÄÌÑ ÐÏÉÓËÁ '\\')"
+
+#: gui_w48.c:2115
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "ðÏÉÓË É ÚÁÍÅÎÁ (ÉÓÐÏÌØÚÕÊÔÅ '\\\\' ÄÌÑ ÐÏÉÓËÁ '\\')"
+
+#: gui_x11.c:1537
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: ÎÅ×ÏÚÍÏÖÎÏ ×ÙÄÅÌÉÔØ ÚÁÐÉÓØ × ÔÁÂÌÉÃÅ Ã×ÅÔÁ, ÎÅËÏÔÏÒÙÅ Ã×ÅÔÁÍÏÇÕÔ "
+"ÏÔÏÂÒÁÖÁÔØÓÑ ÎÅÐÒÁ×ÉÌØÎÏ"
+
+#: gui_x11.c:2118
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: × ÎÁÂÏÒÅ ÛÒÉÆÔÏ× %s ÏÔÓÕÔÓÔ×ÕÀÔ ÛÒÉÆÔÙ ÄÌÑ ÓÌÅÄÕÀÝÉÈ ËÏÄÉÒÏ×ÏË:"
+
+#: gui_x11.c:2161
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: îÁÂÏÒ ÛÒÉÆÔÏ×: %s"
+
+#: gui_x11.c:2162
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "ûÒÉÆÔ '%s' ÎÅ Ñ×ÌÑÅÔÓÑ ÍÏÎÏÛÉÒÉÎÎÙÍ"
+
+#: gui_x11.c:2181
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: îÁÂÏÒ ÛÒÉÆÔÏ×: %s\n"
+
+#: gui_x11.c:2182
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2183
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2184
+msgid "Font%ld width is not twice that of font0\n"
+msgstr "ûÉÒÉÎÁ ÛÒÉÆÔÁ font%ld ÄÏÌÖÎÁ ÂÙÔØ ×Ä×ÏÅ ÂÏÌØÛÅ ÛÉÒÉÎÙ ÛÒÉÆÔÁ font0\n"
+
+#: gui_x11.c:2185
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "ûÉÒÉÎÁ ÛÒÉÆÔÁ font0: %ld\n"
+
+#: gui_x11.c:2186
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"ûÉÒÉÎÁ ÛÒÉÆÔÁ font1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "õ256ö ïûéâëá Á×ÔÏÍÁÔÉËÉ èÁÎÇÙÌ"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "äÏÂÁ×ÉÔØ ÎÏ×ÕÀ ÂÁÚÕ ÄÁÎÎÙÈ"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "úÁÐÒÏÓ ÐÏ ÛÁÂÌÏÎÕ"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "ðÏËÁÚÁÔØ ÜÔÏ ÓÏÏÂÝÅÎÉÅ"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "õÂÉÔØ ÓÏÅÄÉÎÅÎÉÅ"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "úÁÎÏ×Ï ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ×ÓÅ ÓÏÅÄÉÎÅÎÉÑ"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "ðÏËÁÚÁÔØ ÓÏÅÄÉÎÅÎÉÑ"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: éÓÐÏÌØÚÏ×ÁÎÉÅ: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "üÔÁ ËÏÍÁÎÄÁ cscope ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÒÁÚÄÅÌÅÎÉÅ ÏËÎÁ.\n"
+
+#: if_cscope.c:175
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: éÓÐÏÌØÚÏ×ÁÎÉÅ: cstag <ÉÍÑ>"
+
+#: if_cscope.c:231
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ÍÅÔËÁ ÎÅ ÎÁÊÄÅÎÁ"
+
+#: if_cscope.c:409
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "ÏÛÉÂËÁ stat(%s): %d"
+
+#: if_cscope.c:419
+msgid "E563: stat error"
+msgstr "E563: ÏÛÉÂËÁ stat"
+
+#: if_cscope.c:516
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s ÎÅ Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ ÉÌÉ ÉÍÅÎÅÍ ÂÁÚÙ cscope"
+
+#: if_cscope.c:534
+#, c-format
+msgid "Added cscope database %s"
+msgstr "äÏÂÁ×ÌÅÎÁ ÂÁÚÁ ÄÁÎÎÙÈ cscope %s"
+
+#: if_cscope.c:589
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: ÏÛÉÂËÁ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ ÏÔ ÓÏÅÄÉÎÅÎÉÑ cscope %d"
+
+#: if_cscope.c:694
+msgid "E561: unknown cscope search type"
+msgstr "E561: ÎÅÉÚ×ÅÓÔÎÙÊ ÔÉÐ ÐÏÉÓËÁ cscope"
+
+#: if_cscope.c:736
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÔÒÕÂÕ ÄÌÑ cscope"
+
+#: if_cscope.c:753
+msgid "E622: Could not fork for cscope"
+msgstr "E622: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ fork() ÄÌÑ cscope"
+
+#: if_cscope.c:847 if_cscope.c:897
+msgid "cs_create_connection exec failed"
+msgstr "ÎÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ cs_create_connection"
+
+#: if_cscope.c:898
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: îÅ ÕÄÁÌÏÓØ ÚÁÐÕÓÔÉÔØ ÐÒÏÃÅÓÓ cscope"
+
+#: if_cscope.c:911
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: ÎÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ fdopen ÄÌÑ to_fp"
+
+#: if_cscope.c:913
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: ÎÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ fdopen ÄÌÑ fr_fp"
+
+#: if_cscope.c:951
+msgid "E567: no cscope connections"
+msgstr "E567: ÓÏÅÄÉÎÅÎÉÊ Ó cscope ÎÅ ÓÏÚÄÁÎÏ"
+
+#: if_cscope.c:1025
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: ÎÅ ÎÁÊÄÅÎÏ ÓÏÏÔ×ÅÔÓÔ×ÉÊ ÐÏ ÚÁÐÒÏÓÕ cscope %s ÄÌÑ %s"
+
+#: if_cscope.c:1082
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: ÎÅÐÒÁ×ÉÌØÎÙÊ ÆÌÁÇ cscopequickfix %c ÄÌÑ %c"
+
+#: if_cscope.c:1152
+msgid "cscope commands:\n"
+msgstr "ËÏÍÁÎÄÙ cscope:\n"
+
+#: if_cscope.c:1155
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (éÓÐÏÌØÚÏ×ÁÎÉÅ: %s)"
+
+#: if_cscope.c:1253
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: ÎÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÂÁÚÕ ÄÁÎÎÙÈ cscope: %s"
+
+#: if_cscope.c:1271
+msgid "E626: cannot get cscope database information"
+msgstr "E626: ÉÎÆÏÒÍÁÃÉÑ Ï ÂÁÚÅ ÄÁÎÎÙÈ cscope ÎÅ ÄÏÓÔÕÐÎÁ"
+
+#: if_cscope.c:1296
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: ÄÁÎÎÁÑ ÂÁÚÁ ÄÁÎÎÙÈ cscope ÕÖÅ ÐÏÄÓÏÅÄÉÎÅÎÁ"
+
+#: if_cscope.c:1307
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: ÄÏÓÔÉÇÎÕÔÏ ÍÁËÓÉÍÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÏÔËÒÙÔÙÈ ÓÏÅÄÉÎÅÎÉÊ Ó cscope"
+
+#: if_cscope.c:1424
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: ÓÏÅÄÉÎÅÎÉÅ Ó cscope %s ÎÅ ÏÂÎÁÒÕÖÅÎÏ"
+
+#: if_cscope.c:1458
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "ÓÏÅÄÉÎÅÎÉÅ Ó cscope ÚÁËÒÙÔÏ"
+
+#. should not reach here
+#: if_cscope.c:1598
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: ËÒÉÔÉÞÅÓËÁÑ ÏÛÉÂËÁ × cs_manage_matches"
+
+#: if_cscope.c:1848
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "íÅÔËÁ cscope: %s"
+
+#: if_cscope.c:1870
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # ÓÔÒÏËÁ"
+
+#: if_cscope.c:1872
+msgid "filename / context / line\n"
+msgstr "ÉÍÑ ÆÁÊÌÁ / ËÏÎÔÅËÓÔ / ÓÔÒÏËÁ\n"
+
+#: if_cscope.c:1990
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: ïÛÉÂËÁ cscope: %s"
+
+#: if_cscope.c:2176
+msgid "All cscope databases reset"
+msgstr "ðÅÒÅÚÁÇÒÕÚËÁ ×ÓÅÈ ÂÁÚ ÄÁÎÎÙÈ cscope"
+
+#: if_cscope.c:2244
+msgid "no cscope connections\n"
+msgstr "ÓÏÅÄÉÎÅÎÉÑ Ó cscope ÏÔÓÕÔÓÔ×ÕÀÔ\n"
+
+#: if_cscope.c:2248
+msgid " # pid database name prepend path\n"
+msgstr " # pid ÂÁÚÁ ÄÁÎÎÙÈ ÎÁÞÁÌØÎÙÊ ÐÕÔØ\n"
+
+#: if_python.c:436
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: ë ÓÏÖÁÌÅÎÉÀ ÜÔÁ ËÏÍÁÎÄÁ ÎÅ ÒÁÂÏÔÁÅÔ, ÐÏÓËÏÌØËÕ ÎÅ ÚÁÇÒÕÖÅÎÁ ÂÉÂÌÉÏÔÅËÁ "
+"Python"
+
+#: if_python.c:500
+msgid "E659: Cannot invoke Python recursively"
+msgstr "E659: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÒÅËÕÒÓÉ×ÎÙÊ ×ÙÚÏ× Python"
+
+#: if_python.c:701
+msgid "can't delete OutputObject attributes"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÁÔÒÉÂÕÔÙ OutputObject"
+
+#: if_python.c:708
+msgid "softspace must be an integer"
+msgstr "ÚÎÁÞÅÎÉÅ softspace ÄÏÌÖÎÏ ÂÙÔØ ÃÅÌÙÍ ÞÉÓÌÏÍ"
+
+#: if_python.c:716
+msgid "invalid attribute"
+msgstr "ÎÅÐÒÁ×ÉÌØÎÙÊ ÁÔÒÉÂÕÔ"
+
+#: if_python.c:755 if_python.c:769
+msgid "writelines() requires list of strings"
+msgstr "writelines() ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ ÓÐÉÓËÁ ÓÔÒÏË"
+
+#: if_python.c:895
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: ïÛÉÂËÁ ÉÎÉÃÉÁÌÉÚÁÃÉÉ ÏÂßÅËÔÏ× I/O"
+
+#: if_python.c:1080 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "ÎÅÐÒÁ×ÉÌØÎÏÅ ×ÙÒÁÖÅÎÉÅ"
+
+#: if_python.c:1094 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "×ÙÒÁÖÅÎÉÑ ÏÔËÌÀÞÅÎÙ ÐÒÉ ËÏÍÐÉÌÑÃÉÉ"
+
+#: if_python.c:1107
+msgid "attempt to refer to deleted buffer"
+msgstr "ÐÏÐÙÔËÁ ÓÏÓÌÁÔØÓÑ ÎÁ ÕÎÉÞÔÏÖÅÎÎÙÊ ÂÕÆÅÒ"
+
+#: if_python.c:1122 if_python.c:1163 if_python.c:1227 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "ÚÁÐÒÅÄÅÌØÎÙÊ ÎÏÍÅÒ ÓÔÒÏËÉ"
+
+#: if_python.c:1362
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<ÏÂßÅËÔ ÂÕÆÅÒÁ (ÕÄÁÌÅÎ) × %8lX>"
+
+#: if_python.c:1453 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "ÎÅÐÒÁ×ÉÌØÎÏÅ ÉÍÑ ÏÔÍÅÔËÉ"
+
+#: if_python.c:1733
+msgid "no such buffer"
+msgstr "ÎÅÔ ÔÁËÏÇÏ ÂÕÆÅÒÁ"
+
+#: if_python.c:1821
+msgid "attempt to refer to deleted window"
+msgstr "ÐÏÐÙÔËÁ ÓÏÓÌÁÔØÓÑ ÎÁ ÚÁËÒÙÔÏÅ ÏËÎÏ"
+
+#: if_python.c:1866
+msgid "readonly attribute"
+msgstr "ÁÔÒÉÂÕÔ ÄÏÓÔÕÐÅÎ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ"
+
+#: if_python.c:1879
+msgid "cursor position outside buffer"
+msgstr "ÐÏÚÉÃÉÑ ËÕÒÓÏÒÁ ÎÁÈÏÄÉÔÓÑ ×ÎÅ ÂÕÆÅÒÁ"
+
+#: if_python.c:1956
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<ÏÂßÅËÔ ÏËÎÁ (ÕÄÁÌÅÎ) × %.8lX>"
+
+#: if_python.c:1968
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<ÏÂßÅËÔ ÏËÎÁ (ÎÅÉÚ×ÅÓÔÅÎ) × %.8lX>"
+
+#: if_python.c:1970
+#, c-format
+msgid "<window %d>"
+msgstr "<ÏËÎÏ %d>"
+
+#: if_python.c:2046
+msgid "no such window"
+msgstr "ÎÅÔ ÔÁËÏÇÏ ÏËÎÁ"
+
+#: if_python.c:2307 if_python.c:2341 if_python.c:2396 if_python.c:2464
+#: if_python.c:2586 if_python.c:2638 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÈÒÁÎÉÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ÏÔÍÅÎÅ ÏÐÅÒÁÃÉÉ"
+
+#: if_python.c:2309 if_python.c:2403 if_python.c:2475
+msgid "cannot delete line"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÕÄÁÌÉÔØ ÓÔÒÏËÕ"
+
+#: if_python.c:2346 if_python.c:2491 if_tcl.c:690 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÚÁÍÅÎÉÔØ ÓÔÒÏËÕ"
+
+#: if_python.c:2509 if_python.c:2588 if_python.c:2646
+msgid "cannot insert line"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ×ÓÔÁ×ÉÔØ ÓÔÒÏËÕ"
+
+#: if_python.c:2750
+msgid "string cannot contain newlines"
+msgstr "ÓÔÒÏËÁ ÎÅ ÍÏÖÅÔ ÓÏÄÅÒÖÁÔØ ÓÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ"
+
+#: if_ruby.c:422
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: ë ÓÏÖÁÌÅÎÉÀ ÜÔÁ ËÏÍÁÎÄÁ ÎÅ ÒÁÂÏÔÁÅÔ, ÐÏÓËÏÌØËÕ ÎÅ ÚÁÇÒÕÖÅÎÁ ÂÉÂÌÉÏÔÅËÁ "
+"Ruby."
+
+#: if_ruby.c:485
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: ÎÅÉÚ×ÅÓÔÎÏÅ ÓÏÓÔÏÑÎÉÅ longjmp %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "ðÅÒÅËÌÀÞÅÎÉÅ ÍÅÖÄÕ ÒÅÁÌÉÚÁÃÉÅÊ/ÏÐÒÅÄÅÌÅÎÉÅÍ"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "ðÏËÁÚÁÔØ ÂÁÚÏ×ÙÊ ËÌÁÓÓ "
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "ðÏËÁÚÁÔØ ÐÅÒÅÇÒÕÖÅÎÎÙÅ ÆÕÎËÃÉÉ"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "ðÏÌÕÞÅÎÉÅ ÉÚ ÆÁÊÌÁ"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "ðÏÌÕÞÅÎÉÅ ÉÚ ÐÒÏÅËÔÁ"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "ðÏÌÕÞÅÎÉÅ ÉÚ ×ÓÅÈ ÐÒÏÅËÔÏ×"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "ðÏÌÕÞÅÎÉÅ"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "ðÏËÁÚÁÔØ ÉÓÈÏÄÎÙÊ ËÏÄ"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "îÁÊÔÉ ÓÉÍ×ÏÌ"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ðÒÏÓÍÏÔÒ ËÌÁÓÓÁ"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "ðÏËÁÚÁÔØ ËÌÁÓÓ × ÉÅÒÁÒÈÉÉ"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "ðÏËÁÚÁÔØ ËÌÁÓÓ × ÏÇÒÁÎÉÞÅÎÎÏÊ ÉÅÒÁÒÈÉÉ"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ÓÓÙÌÁÅÔÓÑ ÎÁ"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "óÓÙÌËÁ ÎÁ xref ÉÚ"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ÉÍÅÅÔ"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ÉÓÐÏÌØÚÕÅÔÓÑ"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "ðÏËÁÚÁÔØ docu"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "óÏÚÄÁÔØ docu"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"îÅ×ÏÚÍÏÖÎÏ ÐÏÄÓÏÅÄÉÎÉÔØÓÑ Ë SNiFF+. ðÒÏ×ÅÒØÔÅ ÎÁÓÔÒÏÊËÉ ÏËÒÕÖÅÎÉÑ."
+"(sniffemacs ÄÏÌÖÎÙ ÂÙÔØ ÕËÁÚÁÎÙ × ÐÅÒÅÍÅÎÎÏÊ $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: ïÛÉÂËÁ ×Ï ×ÒÅÍÑ ÞÔÅÎÉÑ. ïÔÓÏÅÄÉÎÅÎÉÅ"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "÷ ÎÁÓÔÏÑÝÉÊ ÍÏÍÅÎÔ SNiFF+ "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ÎÅ "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "ÐÏÄÓÏÅÄÉΣÎ"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: îÅÉÚ×ÅÓÔÎÙÊ ÚÁÐÒÏÓ SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: ïÛÉÂËÁ ÓÏÅÄÉÎÅÎÉÑ ÓÏ SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ÎÅ ÐÏÄÓÏÅÄÉΣÎ"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: üÔÏ ÎÅ ÂÕÆÅÒ SNiFF+"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: ïÛÉÂËÁ ×Ï ×ÒÅÍÑ ÚÁÐÉÓÉ. ïÔÓÏÅÄÉÎÅÎÉÅ"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "ÎÅÐÒÁ×ÉÌØÎÙÊ ÎÏÍÅÒ ÂÕÆÅÒÁ"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "ÐÏËÁ ÎÅ ÒÅÁÌÉÚÏ×ÁÎÏ"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ÓÔÒÏËÕ ÉÌÉ ÓÔÒÏËÉ"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "ÏÔÍÅÔËÁ ÎÅ ÕÓÔÁÎÏ×ÌÅÎÁ"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "ÒÑÄ %d ËÏÌÏÎËÁ %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ×ÓÔÁ×ÉÔØ ÉÌÉ ÄÏÂÁ×ÉÔØ ÓÔÒÏËÕ"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "ÎÅÉÚ×ÅÓÔÎÙÊ ÆÌÁÇ: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "ÎÅÉÚ×ÅÓÔÎÁÑ vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "ËÌÁ×ÉÁÔÕÒÎÏÅ ÐÒÅÒÙ×ÁÎÉÅ"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "ÏÛÉÂËÁ vim"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ËÏÍÁÎÄÕ ÂÕÆÅÒÁ ÉÌÉ ÏËÎÁ: ÏÂßÅËÔ × ÐÒÏÃÅÓÓÅ ÕÄÁÌÅÎÉÑ"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"ÎÅ×ÏÚÍÏÖÎÏ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÔØ ËÏÍÁÎÄÕ Ó ÏÂÒÁÔÎÙÍ ×ÙÚÏ×ÏÍ: ÂÕÆÅÒ ÉÌÉ ÏËÎÏ × "
+"ÐÒÏÃÅÓÓÅ ÕÄÁÌÅÎÉÑ"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: ëòéôéþåóëáñ ïûéâëá TCL: ÐÏ×ÒÅÖģΠÓÐÉÓÏË ÓÓÙÌÏË?! óÏÏÂÝÉÔÅ Ï ÜÔÏÍ ÐÏ "
+"ÁÄÒÅÓÕ vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"ÎÅ×ÏÚÍÏÖÎÏ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÔØ ËÏÍÁÎÄÕ Ó ÏÂÒÁÔÎÙÍ ×ÙÚÏ×ÏÍ: ÓÓÙÌËÁ ÎÁ ÂÕÆÅÒ ÉÌÉ "
+"ÏËÎÏ ÎÅ ÏÂÎÁÒÕÖÅÎÁ"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: ë ÓÏÖÁÌÅÎÉÀ ÜÔÁ ËÏÍÁÎÄÁ ÎÅ ÒÁÂÏÔÁÅÔ, ÐÏÓËÏÌØËÕ ÎÅ ÚÁÇÒÕÖÅÎÁ ÂÉÂÌÉÏÔÅËÁ "
+"Tcl"
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: ïûéâëá TCL: ëÏÄ ×ÙÈÏÄÁ ÎÅ Ñ×ÌÑÅÔÓÑ ÃÅÌÙÍ ÞÉÓÌÏÍ?! óÏÏÂÝÉÔÅ Ï ÜÔÏÍ × "
+"vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÐÏÌÕÞÉÔØ ÓÔÒÏËÕ"
+
+#: if_xcmdsrv.c:225
+msgid "Unable to register a command server name"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÔØ ÉÍÑ ÓÅÒ×ÅÒÁ ËÏÍÁÎÄ"
+
+#: if_xcmdsrv.c:473
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ïÔÐÒÁ×ËÁ ËÏÍÁÎÄÙ × ÄÒÕÇÕÀ ÐÒÏÇÒÁÍÍÕ ÎÅ ÕÄÁÌÁÓØ"
+
+#: if_xcmdsrv.c:747
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: éÓÐÏÌØÚÕÅÔÓÑ ÎÅÐÒÁ×ÉÌØÎÙÊ id ÓÅÒ×ÅÒÁ: %s"
+
+#: if_xcmdsrv.c:1110
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr ""
+"E251: îÅÐÒÁ×ÉÌØÎÏ ÓÆÏÒÍÉÒÏ×ÁÎÏ ÚÎÁÞÅÎÉÅ ÄÁÎÎÏÇÏ ÐÒÏÃÅÓÓÁ VIM × ÒÅÅÓÔÒÅ. "
+"õÄÁÌÅÎÏ!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "îÅÉÚ×ÅÓÔÎÙÊ ÁÒÇÕÍÅÎÔ"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "óÌÉÛËÏÍ ÍÎÏÇÏ ÁÒÇÕÍÅÎÔÏ× ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "ðÒÏÐÕÝÅÎ ÁÒÇÕÍÅÎÔ ÐÏÓÌÅ"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "íÕÓÏÒ ÐÏÓÌÅ ÁÒÇÕÍÅÎÔÁ"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr ""
+"óÌÉÛËÏÍ ÍÎÏÇÏ ÁÒÇÕÍÅÎÔÏ× \"+ËÏÍÁÎÄÁ\", \"-c ËÏÍÁÎÄÁ\" ÉÌÉ \"--cmd ËÏÍÁÎÄÁ\""
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "îÅÄÏÐÕÓÔÉÍÙÅ ÁÒÇÕÍÅÎÔÙ ÄÌÑ"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr ""
+"äÁÎÎÙÊ Vim ÂÙÌ ÓËÏÍÐÉÌÉÒÏ×ÁÎ Ó ×ÙËÌÀÞÅÎÎÏÊ ÏÓÏÂÅÎÎÏÓÔØÀ ÐÒÏÓÍÏÔÒÁ ÏÔÌÉÞÉÊ"
+
+#: main.c:932
+msgid "Attempt to open script file again: \""
+msgstr "ðÏÐÙÔËÁ ÐÏ×ÔÏÒÎÏÇÏ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ ÓÃÅÎÁÒÉÑ: \""
+
+#: main.c:941
+msgid "Cannot open for reading: \""
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÌÑ ÞÔÅÎÉÑ: \""
+
+#: main.c:985
+msgid "Cannot open for script output: \""
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÌÑ ×Ù×ÏÄÁ ÓÃÅÎÁÒÉÑ: \""
+
+#: main.c:1132
+#, c-format
+msgid "%d files to edit\n"
+msgstr "æÁÊÌÏ× ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ: %d\n"
+
+#: main.c:1233
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÷Ù×ÏÄ ÏÓÕÝÅÓÔ×ÌÑÅÔÓÑ ÎÅ ÎÁ ÔÅÒÍÉÎÁÌ\n"
+
+#: main.c:1235
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÷×ÏÄ ÐÒÏÉÓÈÏÄÉÔ ÎÅ Ó ÔÅÒÍÉÎÁÌÁ\n"
+
+#. just in case..
+#: main.c:1297
+msgid "pre-vimrc command line"
+msgstr "ËÏÍÁÎÄÎÁÑ ÓÔÒÏËÁ ÐÅÒÅÄ ×ÙÐÏÌÎÅÎÉÅÍ vimrc"
+
+#: main.c:1338
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÞÔÅÎÉÅ ÉÚ \"%s\""
+
+#: main.c:2411
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"äÏÐÏÌÎÉÔÅÌØÎÁÑ ÉÎÆÏÒÍÁÃÉÑ: \"vim -h\"\n"
+
+#: main.c:2444
+msgid "[file ..] edit specified file(s)"
+msgstr "[ÆÁÊÌ ..] ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÕËÁÚÁÎÎÙÈ ÆÁÊÌÏ×"
+
+#: main.c:2445
+msgid "- read text from stdin"
+msgstr "- ÞÔÅÎÉÅ ÔÅËÓÔÁ ÉÚ ÐÏÔÏËÁ ××ÏÄÁ stdin"
+
+#: main.c:2446
+msgid "-t tag edit file where tag is defined"
+msgstr "-t ÍÅÔËÁ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÆÁÊÌÁ Ó ÕËÁÚÁÎÎÏÊ ÍÅÔËÏÊ"
+
+#: main.c:2448
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [ÆÁÊÌ ÏÛÉÂÏË] ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÆÁÊÌÁ Ó ÐÅÒ×ÏÊ ÏÛÉÂËÏÊ"
+
+#: main.c:2457
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"éÓÐÏÌØÚÏ×ÁÎÉÅ:"
+
+#: main.c:2460
+msgid " vim [arguments] "
+msgstr " vim [ÁÒÇÕÍÅÎÔÙ] "
+
+#: main.c:2464
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ÉÌÉ:"
+
+#: main.c:2467
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"áÒÇÕÍÅÎÔÙ:\n"
+
+#: main.c:2468
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\täÁÌÅÅ ÕËÁÚÙ×ÁÀÔÓÑ ÔÏÌØËÏ ÉÍÅÎÁ ÆÁÊÌÏ×"
+
+#: main.c:2470
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tîÅ ×ÙÐÏÌÎÑÔØ ÐÏÄÓÔÁÎÏ×ËÕ ÐÏ ÍÁÓËÅ"
+
+#: main.c:2473
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\túÁÒÅÇÉÓÔÒÉÒÏ×ÁÔØ ÜÔÏÔ gvim ÄÌÑ OLE"
+
+#: main.c:2474
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tïÔËÌÀÞÉÔØ ÒÅÇÉÓÔÒÁÃÉÀ ÄÁÎÎÏÇÏ gvim ÄÌÑ OLE"
+
+#: main.c:2477
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\túÁÐÕÓÔÉÔØ Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ (ËÁË \"gvim\")"
+
+#: main.c:2478
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f ÉÌÉ --nofork\t÷ ÁËÔÉ×ÎÏÊ ÚÁÄÁÞÅ: îÅ ×ÙÐÏÌÎÑÔØ fork ÐÒÉ ÚÁÐÕÓËÅ GUI"
+
+#: main.c:2480
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tòÅÖÉÍ Vi (ËÁË \"vi\")"
+
+#: main.c:2481
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tòÅÖÉÍ Ex (ËÁË \"ex\")"
+
+#: main.c:2482
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tôÉÈÉÊ (ÐÁËÅÔÎÙÊ) ÒÅÖÉÍ (ÔÏÌØËÏ ÄÌÑ \"ex\")"
+
+#: main.c:2484
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tòÅÖÉÍ ÏÔÌÉÞÉÊ (ËÁË \"vimdiff\")"
+
+#: main.c:2486
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tðÒÏÓÔÏÊ ÒÅÖÉÍ (ËÁË \"evim\", ÂÅÚÒÅÖÉÍÎÙÊ)"
+
+#: main.c:2487
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tôÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ (ËÁË \"view\")"
+
+#: main.c:2488
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tïÇÒÁÎÉÞÅÎÎÙÊ ÒÅÖÉÍ (ËÁË \"rvim\")"
+
+#: main.c:2489
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tâÅÚ ×ÏÚÍÏÖÎÏÓÔÉ ÓÏÈÒÁÎÅÎÉÑ ÉÚÍÅÎÅÎÉÊ (ÚÁÐÉÓÉ ÆÁÊÌÏ×)"
+
+#: main.c:2490
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tâÅÚ ×ÏÚÍÏÖÎÏÓÔÉ ×ÎÅÓÅÎÉÑ ÉÚÍÅÎÅÎÉÊ × ÔÅËÓÔ"
+
+#: main.c:2491
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tâÉÎÁÒÎÙÊ ÒÅÖÉÍ"
+
+#: main.c:2493
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tòÅÖÉÍ Lisp"
+
+#: main.c:2495
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tòÅÖÉÍ ÓÏ×ÍÅÓÔÉÍÏÓÔÉ Ó Vi: 'compatible'"
+
+#: main.c:2496
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tòÅÖÉÍ ÎÅÐÏÌÎÏÊ ÓÏ×ÍÅÓÔÉÍÏÓÔÉ Ó Vi: 'nocompatible'"
+
+#: main.c:2497
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tõÒÏ×ÅÎØ ÐÏÄÒÏÂÎÏÓÔÉ ÓÏÏÂÝÅÎÉÊ"
+
+#: main.c:2498
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tòÅÖÉÍ ÏÔÌÁÄËÉ"
+
+#: main.c:2499
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tâÅÚ Ó×ÏÐ-ÆÁÊÌÁ, ÉÓÐÏÌØÚÕÅÔÓÑ ÔÏÌØËÏ ÐÁÍÑÔØ"
+
+#: main.c:2500
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t÷Ù×ÅÓÔÉ ÓÐÉÓÏË Ó×ÏÐ-ÆÁÊÌÏ× É ÚÁ×ÅÒÛÉÔØ ÒÁÂÏÔÕ"
+
+#: main.c:2501
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (Ó ÉÍÅÎÅÍ ÆÁÊÌÁ)\t÷ÏÓÓÔÁÎÏ×ÉÔØ Á×ÁÒÉÊÎÏ ÚÁ×ÅÒÛ£ÎÎÙÊ ÓÅÁÎÓ"
+
+#: main.c:2502
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tôÏ ÖÅ, ÞÔÏ É -r"
+
+#: main.c:2504
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tîÅ ÉÓÐÏÌØÚÏ×ÁÔØ newcli ÄÌÑ ÏÔËÒÙÔÉÑ ÏËÎÁ"
+
+#: main.c:2505
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <ÕÓÔÒÏÊÓÔ×Ï>\t\téÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ I/O ÕËÁÚÁÎÎÏÅ <ÕÓÔÒÏÊÓÔ×Ï>"
+
+#: main.c:2508
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\túÁÐÕÓË × áÒÁÂÓËÏÍ ÒÅÖÉÍÅ"
+
+#: main.c:2511
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\túÁÐÕÓË × ÒÅÖÉÍÅ \"é×ÒÉÔ\""
+
+#: main.c:2514
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\túÁÐÕÓË × ÒÅÖÉÍÅ \"æÁÒÓÉ\""
+
+#: main.c:2516
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <ÔÅÒÍÉÎÁÌ>\tîÁÚÎÁÞÉÔØ ÕËÁÚÁÎÎÙÊ ÔÉÐ <ÔÅÒÍÉÎÁÌÁ>"
+
+#: main.c:2517
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\téÓÐÏÌØÚÏ×ÁÔØ <vimrc> ×ÍÅÓÔÏ ÌÀÂÙÈ ÆÁÊÌÏ× .vimrc"
+
+#: main.c:2519
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\téÓÐÏÌØÚÏ×ÁÔØ <gvimrc> ×ÍÅÓÔÏ ÌÀÂÙÈ ÆÁÊÌÏ× .gvimrc"
+
+#: main.c:2521
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tîÅ ÚÁÇÒÕÖÁÔØ ÓÃÅÎÁÒÉÉ ÍÏÄÕÌÅÊ"
+
+#: main.c:2522
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tïÔËÒÙÔØ N ÏËÏÎ (ÐÏ ÕÍÏÌÞÁÎÉÀ: ÐÏ ÏÄÎÏÍÕ ÎÁ ËÁÖÄÙÊ ÆÁÊÌ)"
+
+#: main.c:2523
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tôÏ ÖÅ, ÞÔÏ É -o, ÎÏ Ó ×ÅÒÔÉËÁÌØÎÙÍ ÒÁÚÄÅÌÅÎÉÅÍ ÏËÏÎ"
+
+#: main.c:2524
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tîÁÞÁÔØ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ × ËÏÎÃÅ ÆÁÊÌÁ"
+
+#: main.c:2525
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tîÁÞÁÔØ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ × ÓÔÒÏËÅ Ó ÎÏÍÅÒÏÍ <lnum>"
+
+#: main.c:2527
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <ËÏÍÁÎÄÁ>\t÷ÙÐÏÌÎÉÔØ <ËÏÍÁÎÄÕ> ÐÅÒÅÄ ÚÁÇÒÕÚËÏÊ ÆÁÊÌÁ vimrc"
+
+#: main.c:2529
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <ËÏÍÁÎÄÁ>\t\t÷ÙÐÏÌÎÉÔØ <ËÏÍÁÎÄÕ> ÐÏÓÌÅ ÚÁÇÒÕÚËÉ ÐÅÒ×ÏÇÏ ÆÁÊÌÁ"
+
+#: main.c:2530
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <ÓÅÁÎÓ>\t\tðÒÏÞÉÔÁÔØ ÓÃÅÎÁÒÉÊ <ÓÅÁÎÓÁ> ÐÏÓÌÅ ÚÁÇÒÕÚËÉ ÐÅÒ×ÏÇÏ ÆÁÊÌÁ"
+
+#: main.c:2531
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <ÓÃÅÎÁÒÉÊ>\tðÒÏÞÉÔÁÔØ ËÏÍÁÎÄÙ ïÂÙÞÎÏÇÏ ÒÅÖÉÍÁ ÉÚ ÆÁÊÌÁ <ÓÃÅÎÁÒÉÑ>"
+
+#: main.c:2532
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <ÓÃÅÎÁÒÉÊ>\täÏÂÁ×ÌÑÔØ ×ÓÅ ××ÅÄ£ÎÎÙÅ ËÏÍÁÎÄÙ × ÆÁÊÌ <ÓÃÅÎÁÒÉÑ>"
+
+#: main.c:2533
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <ÓÃÅÎÁÒÉÊ>\túÁÐÉÓÁÔØ ×ÓÅ ××ÅÄ£ÎÎÙÅ ËÏÍÁÎÄÙ × ÆÁÊÌ <ÓÃÅÎÁÒÉÑ>"
+
+#: main.c:2535
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tòÅÄÁËÔÉÒÏ×ÁÎÉÅ ÚÁÛÉÆÒÏ×ÁÎÎÙÈ ÆÁÊÌÏ×"
+
+#: main.c:2539
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <ÜËÒÁÎ>\tðÏÄÓÏÅÄÉÎÉÔØ vim Ë ÕËÁÚÁÎÎÏÍÕ ÓÅÒ×ÅÒÕ X"
+
+#: main.c:2541
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tîÅ ×ÙÐÏÌÎÑÔØ ÓÏÅÄÉÎÅÎÉÅ Ó ÓÅÒ×ÅÒÏÍ X"
+
+#: main.c:2544
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <ÆÁÊÌÙ>\tðÏ ×ÏÚÍÏÖÎÏÓÔÉ ÒÅÄÁËÔÉÒÏ×ÁÔØ <ÆÁÊÌÙ> ÎÁ ÓÅÒ×ÅÒÅ Vim"
+
+#: main.c:2545
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <ÆÁÊÌÙ> ôÏ ÖÅ, ÎÏ ÂÅÚ ÖÁÌÏ ÎÁ ÏÔÓÕÔÓÔ×ÉÅ ÓÅÒ×ÅÒÁ"
+
+#: main.c:2546
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <ÆÁÊÌÙ> ôÏ ÖÅ, ÞÔÏ É --remote, ÎÏ Ó ÏÖÉÄÁÎÉÅÍ ÚÁ×ÅÒÛÅÎÉÑ"
+
+#: main.c:2547
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <ÆÁÊÌÙ> ôÏ ÖÅ, ÎÏ ÂÅÚ ÖÁÌÏ ÎÁ ÏÔÓÕÔÓÔ×ÉÅ ÓÅÒ×ÅÒÁ"
+
+#: main.c:2548
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <ËÎÏÐËÉ>\tïÔÐÒÁ×ÉÔØ <ËÎÏÐËÉ> ÎÁ ÓÅÒ×ÅÒ Vim É ×ÙÊÔÉ"
+
+#: main.c:2549
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <×ÙÒÁÖ>\t÷ÙÞÉÓÌÉÔØ <×ÙÒÁÖ> ÎÁ ÓÅÒ×ÅÒÅ Vim É ÎÁÐÅÞÁÔÁÔØ"
+
+#: main.c:2550
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tðÏËÁÚÁÔØ ÓÐÉÓÏË ÉͣΠÓÅÒ×ÅÒÏ× Vim É ÚÁ×ÅÒÛÉÔØ ÒÁÂÏÔÕ"
+
+#: main.c:2551
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr ""
+"--servername <ÉÍÑ>\tïÔÐÒÁ×ÉÔØ ÎÁ/ÓÔÁÔØ ÓÅÒ×ÅÒÏÍ Vim Ó ÕËÁÚÁÎÎÙÍ <ÉÍÅÎÅÍ>"
+
+#: main.c:2554
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\téÓÐÏÌØÚÏ×ÁÔØ ×ÍÅÓÔÏ .viminfo ÆÁÊÌ <viminfo>"
+
+#: main.c:2556
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h ÉÌÉ --help\t÷Ù×ÅÓÔÉ ÓÐÒÁ×ËÕ (ÜÔÏ ÓÏÏÂÝÅÎÉÅ) É ÚÁ×ÅÒÛÉÔØ ÒÁÂÏÔÕ"
+
+#: main.c:2557
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\t÷Ù×ÅÓÔÉ ÉÎÆÏÒÍÁÃÉÀ Ï ×ÅÒÓÉÉ Vim É ÚÁ×ÅÒÛÉÔØ ÒÁÂÏÔÕ"
+
+#: main.c:2561
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÙ ÄÌÑ gvim (×ÅÒÓÉÑ Motif):\n"
+
+#: main.c:2565
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÙ ÄÌÑ gvim (×ÅÒÓÉÑ neXtaw):\n"
+
+#: main.c:2567
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÙ ÄÌÑ gvim (×ÅÒÓÉÑ Athena):\n"
+
+#: main.c:2571
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <ÄÉÓÐÌÅÊ>\túÁÐÕÓÔÉÔØ vim ÎÁ ÕËÁÚÁÎÎÏÍ <ÄÉÓÐÌÅÅ>"
+
+#: main.c:2572
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\túÁÐÕÓÔÉÔØ vim × Ó×£ÒÎÕÔÏÍ ×ÉÄÅ"
+
+#: main.c:2574
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <ÉÍÑ>\t\téÓÐÏÌØÚÏ×ÁÔØ ÒÅÓÕÒÓ, ËÁË ÅÓÌÉ ÂÙ vim ÂÙÌ <ÉÍÅÎÅÍ>"
+
+#: main.c:2575
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (îÅ ÒÅÁÌÉÚÏ×ÁÎÏ)\n"
+
+#: main.c:2577
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr ""
+"-background <Ã×ÅÔ>\téÓÐÏÌØÚÏ×ÁÔØ ÕËÁÚÁÎÎÙÊ <Ã×ÅÔ> ÄÌÑ ÆÏÎÁ (ÔÁËÖÅ: -bg)"
+
+#: main.c:2578
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr ""
+"-foreground <Ã×ÅÔ>\téÓÐÏÌØÚÏ×ÁÔØ <Ã×ÅÔ> ÄÌÑ ÏÂÙÞÎÏÇÏ ÔÅËÓÔÁ (ÔÁËÖÅ: -fg)"
+
+#: main.c:2579 main.c:2599
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <ÛÒÉÆÔ>\t\téÓÐÏÌØÚÏ×ÁÔØ <ÛÒÉÆÔ> ÄÌÑ ÏÂÙÞÎÏÇÏ ÔÅËÓÔÁ (ÔÁËÖÅ: -fn)"
+
+#: main.c:2580
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <ÛÒÉÆÔ>\téÓÐÏÌØÚÏ×ÁÔØ <ÛÒÉÆÔ> ÄÌÑ ÖÉÒÎÏÇÏ ÔÅËÓÔÁ"
+
+#: main.c:2581
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <ÛÒÉÆÔ>\téÓÐÏÌØÚÏ×ÁÔØ <ÛÒÉÆÔ> ÄÌÑ ÎÁËÌÏÎÎÏÇÏ ÔÅËÓÔÁ"
+
+#: main.c:2582 main.c:2600
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <ÇÅÏÍÅÔÒÉÑ>\téÓÐÏÌØÚÏ×ÁÔØ ÎÁÞÁÌØÎÕÀ <ÇÅÏÍÅÔÒÉÀ> (ÔÁËÖÅ: -geom)"
+
+#: main.c:2583
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <ÛÉÒÉÎÁ>\téÓÐÏÌØÚÏ×ÁÔØ <ÛÉÒÉÎÕ> ÂÏÒÄÀÒÁ (ÔÁËÖÅ: -bw)"
+
+#: main.c:2584
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <ÛÉÒÉÎÁ> éÓÐÏÌØÚÏ×ÁÔØ ÛÉÒÉÎÕ ÐÏÌÏÓÙ ÐÒÏËÒÕÔËÉ (ÔÁËÖÅ: -sw)"
+
+#: main.c:2586
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <×ÙÓÏÔÁ>\téÓÐÏÌØÚÏ×ÁÔØ <×ÙÓÏÔÕ> ÍÅÎÀ (ÔÁËÖÅ: -mh)"
+
+#: main.c:2588 main.c:2601
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\téÓÐÏÌØÚÏ×ÁÔØ ÉÎ×ÅÒÓÎÙÊ ×ÉÄÅÏÒÅÖÉÍ (ÔÁËÖÅ: -rv)"
+
+#: main.c:2589
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tîÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÎ×ÅÒÓÎÙÊ ×ÉÄÅÏÒÅÖÉÍ (ÔÁËÖÅ: +rv)"
+
+#: main.c:2590
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <ÒÅÓÕÒÓ>\tõÓÔÁÎÏ×ÉÔØ ÕËÁÚÁÎÎÙÊ <ÒÅÓÕÒÓ>"
+
+#: main.c:2593
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÙ ÄÌÑ gvim (×ÅÒÓÉÑ RISC OS):\n"
+
+#: main.c:2594
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <ÞÉÓÌÏ>\tðÅÒ×ÏÎÁÞÁÌØÎÁÑ ÛÉÒÉÎÁ ÏËÎÁ × ËÏÌÏÎËÁÈ"
+
+#: main.c:2595
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <ÞÉÓÌÏ>\tðÅÒ×ÏÎÁÞÁÌØÎÁÑ ×ÙÓÏÔÁ ÏËÎÁ × ÓÔÒÏËÁÈ"
+
+#: main.c:2598
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÙ ÄÌÑ gvim (×ÅÒÓÉÑ GTK+):\n"
+
+#: main.c:2602
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr ""
+"-display <ÄÉÓÐÌÅÊ>\túÁÐÕÓÔÉÔØ vim ÎÁ ÕËÁÚÁÎÎÏÍ <ÄÉÓÐÌÅÅ> (ÔÁËÖÅ: --display)"
+
+#: main.c:2604
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr ""
+"--role <ÒÏÌØ>\tõÓÔÁÎÏ×ÉÔØ ÕÎÉËÁÌØÎÕÀ <ÒÏÌØ> ÄÌÑ ÉÄÅÎÔÉÆÉËÁÃÉÉ ÇÌÁ×ÎÏÇÏ ÏËÎÁ"
+
+#: main.c:2606
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tïÔËÒÙÔØ Vim ×ÎÕÔÒÉ ÄÒÕÇÏÇÏ ËÏÍÐÏÎÅÎÔÁ GTK"
+
+#: main.c:2609
+msgid "-P <parent title>\tOpen Vim inside parent application"
+msgstr "-P <ÚÁÇÏÌÏ×ÏË ÒÏÄÉÔÅÌÑ>\tïÔËÒÙÔØ Vim × ÒÏÄÉÔÅÌØÓËÏÍ ÐÒÉÌÏÖÅÎÉÉ"
+
+#: main.c:2847
+msgid "No display"
+msgstr "îÅÔ ÄÉÓÐÌÅÑ"
+
+#. Failed to send, abort.
+#: main.c:2862
+msgid ": Send failed.\n"
+msgstr ": ïÔÐÒÁ×ËÁ ÎÅ ÕÄÁÌÁÓØ.\n"
+
+#. Let vim start normally.
+#: main.c:2868
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": ïÔÐÒÁ×ËÁ ÎÅ ÕÄÁÌÁÓØ. ðÏÐÙÔËÁ ÍÅÓÔÎÏÇÏ ×ÙÐÏÌÎÅÎÉÑ\n"
+
+#: main.c:2906 main.c:2927
+#, c-format
+msgid "%d of %d edited"
+msgstr "ÏÔÒÅÄÁËÔÉÒÏ×ÁÎÏ %d ÉÚ %d"
+
+#: main.c:2949
+msgid "No display: Send expression failed.\n"
+msgstr "îÅÔ ÄÉÓÐÌÅÑ: ÏÔÐÒÁ×ËÁ ×ÙÒÁÖÅÎÉÑ ÎÅ ÕÄÁÌÁÓØ.\n"
+
+#: main.c:2961
+msgid ": Send expression failed.\n"
+msgstr ": ïÔÐÒÁ×ËÁ ×ÙÒÁÖÅÎÉÑ ÎÅ ÕÄÁÌÁÓØ.\n"
+
+#: mark.c:709
+msgid "No marks set"
+msgstr "îÅÔ ÕÓÔÁÎÏ×ÌÅÎÎÙÈ ÏÔÍÅÔÏË"
+
+#: mark.c:711
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: îÅÔ ÏÔÍÅÔÏË, ÓÏ×ÐÁÄÁÀÝÉÈ Ó \"%s\""
+
+#. Highlight title
+#: mark.c:722
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"ÏÔÍÅÔ ÓÔÒ ËÏÌ ÆÁÊÌ/ÔÅËÓÔ"
+
+#. Highlight title
+#: mark.c:760
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+"ÐÒÙÖÏË ÓÔÒ ËÏÌ ÆÁÊÌ/ÔÅËÓÔ"
+
+#. Highlight title
+#: mark.c:805
+msgid ""
+"\n"
+"change line col text"
+msgstr ""
+"\n"
+"ÉÚÍÅÎ. ÓÔÒ ËÏÌ ÔÅËÓÔ"
+
+#: mark.c:1281
+#, c-format
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# çÌÏÂÁÌØÎÙÅ ÏÔÍÅÔËÉ:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1316
+#, c-format
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# óÐÉÓÏË ÐÒÙÖËÏ× (ÓÎÁÞÁÌÁ ÂÏÌÅÅ Ó×ÅÖÉÅ):\n"
+
+#: mark.c:1412
+#, c-format
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# éÓÔÏÒÉÑ ÍÅÓÔÎÙÈ ÏÔÍÅÔÏË (ÏÔ ÂÏÌÅÅ Ó×ÅÖÉÈ Ë ÓÔÁÒÙÍ):\n"
+
+#: mark.c:1501
+msgid "Missing '>'"
+msgstr "ðÒÏÐÕÝÅÎÁ '>'"
+
+#: mbyte.c:467
+msgid "E543: Not a valid codepage"
+msgstr "E543: îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ËÏÄÉÒÏ×ËÉ"
+
+#: mbyte.c:4431
+msgid "E284: Cannot set IC values"
+msgstr "E284: îÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ÚÎÁÞÅÎÉÑ ËÏÎÔÅËÓÔÁ ××ÏÄÁ"
+
+#: mbyte.c:4583
+msgid "E285: Failed to create input context"
+msgstr "E285: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ËÏÎÔÅËÓÔ ××ÏÄÁ"
+
+#: mbyte.c:4741
+msgid "E286: Failed to open input method"
+msgstr "E286: îÅÕÄÁÞÎÁÑ ÐÏÐÙÔËÁ ÏÔËÒÙÔØ ÍÅÔÏÄ ××ÏÄÁ"
+
+#: mbyte.c:4752
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr ""
+"E287: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ÏÂÒ. ×ÙÚÏ× ÕÎÉÞÔÏÖÅÎÉÑ ÍÅÔÏÄÁ "
+"××ÏÄÁ"
+
+#: mbyte.c:4758
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ÍÅÔÏÄ ××ÏÄÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÓÔÉÌÉ"
+
+#: mbyte.c:4815
+msgid "E289: input method doesn't support my preedit type"
+msgstr ""
+"E289: ÍÅÔÏÄ ××ÏÄÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ ÍÏÊ ÔÉÐ ÐÒÅÄ×ÁÒÉÔÅÌØÎÏÇÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ"
+
+#: mbyte.c:4889
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: ÓÔÉÌØ \"ÎÁÄ ÍÅÓÔÏÍ\" ÔÒÅÂÕÅÔ ÕËÁÚÁÎÉÑ ÛÒÉÆÔÏ×ÏÇÏ ÎÁÂÏÒÁ"
+
+#: mbyte.c:4925
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr ""
+"E291: GTK+ ÂÏÌÅÅ ÒÁÎÎÅÊ ×ÅÒÓÉÉ, ÞÅÍ 1.2.3. ïÂÌÁÓÔØ ÓÏÓÔÏÑÎÉÑ ÎÅ ÒÁÂÏÔÁÅÔ."
+
+#: mbyte.c:5232
+msgid "E292: Input Method Server is not running"
+msgstr "E292: óÅÒ×ÅÒ ÍÅÔÏÄÁ ××ÏÄÁ ÎÅ ÚÁÐÕÝÅÎ"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: ÂÌÏË ÎÅ ÚÁÂÌÏËÉÒÏ×ÁÎ"
+
+#: memfile.c:1005
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ïÛÉÂËÁ ÐÏÉÓËÁ ÐÒÉ ÞÔÅÎÉÉ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: memfile.c:1010
+msgid "E295: Read error in swap file"
+msgstr "E295: ïÛÉÂËÁ ÞÔÅÎÉÑ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: memfile.c:1062
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ïÛÉÂËÁ ÐÏÉÓËÁ ÐÒÉ ÚÁÐÉÓÉ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: memfile.c:1080
+msgid "E297: Write error in swap file"
+msgstr "E297: ïÛÉÂËÁ ÐÒÉ ÚÁÐÉÓÉ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: memfile.c:1277
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr ""
+"E300: ó×ÏÐ-ÆÁÊÌ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ (ÁÔÁËÁ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÓÉÍ×ÏÌØÎÏÊ ÓÓÙÌËÉ?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: îÅ ÐÏÌÕÞÅÎ ÂÌÏË ÎÏÍÅÒ 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: îÅ ÐÏÌÕÞÅÎ ÂÌÏË ÎÏÍÅÒ 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: îÅ ÐÏÌÕÞÅÎ ÂÌÏË ÎÏÍÅÒ 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: ïÊ, ÐÏÔÅÒÑÌÓÑ Ó×ÏÐ-ÆÁÊÌ!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÉÍÅÎÏ×ÁÔØ Ó×ÏÐ-ÆÁÊÌ"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr ""
+"E303: îÅ ÕÄÁÌÏÓØ ÏÔËÒÙÔØ Ó×ÏÐ-ÆÁÊÌ ÄÌÑ \"%s\", ×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ ÎÅ×ÏÚÍÏÖÎÏ"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: îÅ ÐÏÌÕÞÅÎ ÂÌÏË 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: ó×ÏÐ-ÆÁÊÌ ÄÌÑ %s ÎÅ ÎÁÊÄÅÎ"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr ""
+"÷×ÅÄÉÔÅ ÎÏÍÅÒ Ó×ÏÐ-ÆÁÊÌÁ, ËÏÔÏÒÙÊ ÓÌÅÄÕÅÔ ÉÓÐÏÌØÚÏ×ÁÔØ (0 ÄÌÑ ×ÙÈÏÄÁ): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: îÅ ÍÏÇÕ ÏÔËÒÙÔØ %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÂÌÏË 0 ÉÚ "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"îÅÔ ÉÚÍÅÎÅÎÉÊ, ÉÌÉ Vim ÎÅ ÓÍÏÇ ÏÂÎÏ×ÉÔØ Ó×ÏÐ-ÆÁÊÌ"
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ × ÄÁÎÎÏÊ ×ÅÒÓÉÉ Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "éÓÐÏÌØÚÕÊÔÅ Vim ×ÅÒÓÉÉ 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ÎÅ Ñ×ÌÑÅÔÓÑ Ó×ÏÐ-ÆÁÊÌÏÍ Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÎÁ ÜÔÏÍ ËÏÍÐØÀÔÅÒÅ.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "æÁÊÌ ÂÙÌ ÓÏÚÄÁÎ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"ÌÉÂÏ ÆÁÊÌ ÂÙÌ ÐÏ×ÒÅÖÄ£Î."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "éÓÐÏÌØÚÕÅÔÓÑ Ó×ÏÐ-ÆÁÊÌ \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "éÓÈÏÄÎÙÊ ÆÁÊÌ \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÉÓÈÏÄÎÙÊ ÆÁÊÌ ÍÏÇ ÂÙÔØ ÉÚÍÅΣÎ"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÂÌÏË 1 ÉÚ %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???ïôóõôóô÷õåô íîïçï óôòïë"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???îåðòá÷éìøîïå úîáþåîéå óþåôþéëá óôòïë"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???ðõóôïê âìïë"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???ïôóõôóô÷õàô óôòïëé"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ÎÅÐÒÁ×ÉÌØÎÙÊ ÂÌÏË 1 ID (%s ÎÅ Ñ×ÌÑÅÔÓÑ ÆÁÊÌÏÍ .swp?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???ðòïðõýåî âìïë"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "???ÓÔÒÏËÉ ÍÏÇÕÔ ÂÙÔØ ÉÓÐÏÒÞÅÎÙ ÏÔÓÀÄÁ ÄÏ ???ëïîãá"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "???ÓÔÒÏËÉ ÍÏÇÌÉ ÂÙÔØ ×ÓÔÁ×ÌÅÎÙ ÉÌÉ ÕÄÁÌÅÎÙ ÏÔÓÀÄÁ ÄÏ ???ëïîãá"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???ëïîåã"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: ÷ÏÓÓÔÁÎÏ×ÌÅÎÉÅ ÐÒÅÒ×ÁÎÏ"
+
+#: memline.c:1148
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: ÷Ï ×ÒÅÍÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ÏÂÎÁÒÕÖÅÎÙ ÏÛÉÂËÉ; ÓÍ. ÓÔÒÏËÉ, ÎÁÞÉÎÁÀÝÉÅÓÑ "
+"Ó ???"
+
+#: memline.c:1150
+msgid "See \":help E312\" for more information."
+msgstr "óÍ. ÄÏÐÏÌÎÉÔÅÌØÎÕÀ ÉÎÆÏÒÍÁÃÉÀ × ÓÐÒÁ×ÏÞÎÉËÅ (\":help E312\")"
+
+#: memline.c:1155
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "÷ÏÓÓÔÁÎÏ×ÌÅÎÉÅ ÚÁ×ÅÒÛÅÎÏ. ðÒÏ×ÅÒØÔÅ, ×Ó£ ÌÉ × ÐÏÒÑÄËÅ."
+
+#: memline.c:1156
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(íÏÖÅÔÅ ÚÁÐÉÓÁÔØ ÆÁÊÌ ÐÏÄ ÄÒÕÇÉÍ ÉÍÅÎÅÍ É ÓÒÁ×ÎÉÔØ ÅÇÏ Ó ÉÓÈÏÄÎÙÍ\n"
+
+#: memline.c:1157
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "ÆÁÊÌÏÍ ÐÒÉ ÐÏÍÏÝÉ ÐÒÏÇÒÁÍÍÙ diff).\n"
+
+#: memline.c:1158
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"úÁÔÅÍ ÕÄÁÌÉÔÅ ÆÁÊÌ .swp.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1214
+msgid "Swap files found:"
+msgstr "ïÂÎÁÒÕÖÅÎÙ Ó×ÏÐ-ÆÁÊÌÙ:"
+
+#: memline.c:1392
+msgid " In current directory:\n"
+msgstr " ÷ ÔÅËÕÝÅÍ ËÁÔÁÌÏÇÅ:\n"
+
+#: memline.c:1394
+msgid " Using specified name:\n"
+msgstr " ó ÕËÁÚÁÎÎÙÍ ÉÍÅÎÅÍ:\n"
+
+#: memline.c:1398
+msgid " In directory "
+msgstr " ÷ ËÁÔÁÌÏÇÅ "
+
+#: memline.c:1416
+msgid " -- none --\n"
+msgstr " -- ÎÅÔ --\n"
+
+#: memline.c:1488
+msgid " owned by: "
+msgstr " ×ÌÁÄÅÌÅÃ: "
+
+#: memline.c:1490
+msgid " dated: "
+msgstr " ÄÁÔÁ: "
+
+#: memline.c:1494 memline.c:3684
+msgid " dated: "
+msgstr " ÄÁÔÁ: "
+
+#: memline.c:1510
+msgid " [from Vim version 3.0]"
+msgstr " [ÏÔ Vim ×ÅÒÓÉÉ 3.0]"
+
+#: memline.c:1514
+msgid " [does not look like a Vim swap file]"
+msgstr " [ÎÅ Ñ×ÌÑÅÔÓÑ Ó×ÏÐ-ÆÁÊÌÏÍ Vim]"
+
+#: memline.c:1518
+msgid " file name: "
+msgstr " ÉÍÑ ÆÁÊÌÁ: "
+
+#: memline.c:1524
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" ÉÚÍÅΣÎ: "
+
+#: memline.c:1525
+msgid "YES"
+msgstr "äá"
+
+#: memline.c:1525
+msgid "no"
+msgstr "ÎÅÔ"
+
+#: memline.c:1529
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ÐÏÌØÚÏ×ÁÔÅÌØ: "
+
+#: memline.c:1536
+msgid " host name: "
+msgstr " ËÏÍÐØÀÔÅÒ: "
+
+#: memline.c:1538
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" ËÏÍÐØÀÔÅÒ: "
+
+#: memline.c:1544
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ÐÒÏÃÅÓÓ: "
+
+#: memline.c:1550
+msgid " (still running)"
+msgstr " (ÅÝ£ ×ÙÐÏÌÎÑÅÔÓÑ)"
+
+#: memline.c:1562
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [ÎÅ ÐÒÉÇÏÄÅÎ ÄÌÑ ÉÓÐÏÌØÚÏ×ÁÎÉÑ Ó ÄÁÎÎÏÊ ×ÅÒÓÉÅÊ Vim]"
+
+#: memline.c:1565
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [ÎÅ ÐÒÉÇÏÄÅÎ ÄÌÑ ÉÓÐÏÌØÚÏ×ÁÎÉÑ ÎÁ ÜÔÏÍ ËÏÍÐØÀÔÅÒÅ]"
+
+#: memline.c:1570
+msgid " [cannot be read]"
+msgstr " [ÎÅ ÞÉÔÁÅÔÓÑ]"
+
+#: memline.c:1574
+msgid " [cannot be opened]"
+msgstr " [ÎÅ ÏÔËÒÙ×ÁÅÔÓÑ]"
+
+#: memline.c:1764
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: îÅ×ÏÚÍÏÖÎÏ ÏÂÎÏ×ÉÔØ Ó×ÏÐ-ÆÁÊÌ, ÐÏÓËÏÌØËÕ ÏÎ ÎÅ ÏÂÎÁÒÕÖÅÎ"
+
+#: memline.c:1817
+msgid "File preserved"
+msgstr "ó×ÏÐ-ÆÁÊÌ ÏÂÎÏ×Ì£Î"
+
+#: memline.c:1819
+msgid "E314: Preserve failed"
+msgstr "E314: îÅÕÄÁÞÎÁÑ ÐÏÐÙÔËÁ ÏÂÎÏ×ÌÅÎÉÑ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: memline.c:1890
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ lnum: %ld"
+
+#: memline.c:1916
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ÎÅ×ÏÚÍÏÖÎÏ ÎÁÊÔÉ ÓÔÒÏËÕ %ld"
+
+#: memline.c:2306
+msgid "E317: pointer block id wrong 3"
+msgstr "ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÕËÁÚÁÔÅÌÑ ÂÌÏËÁ 3"
+
+#: memline.c:2386
+msgid "stack_idx should be 0"
+msgstr "ÚÎÁÞÅÎÉÅ stack_idx ÄÏÌÖÎÏ ÂÙÔØ ÒÁ×ÎÏ 0"
+
+#: memline.c:2448
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ïÂÎÏ×ÌÅÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÂÌÏËÏ×?"
+
+#: memline.c:2630
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÕËÁÚÁÔÅÌÑ ÂÌÏËÁ 4"
+
+#: memline.c:2657
+msgid "deleted block 1?"
+msgstr "ÕÄẠ́ΠÂÌÏË 1?"
+
+#: memline.c:2857
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: óÔÒÏËÁ %ld ÎÅ ÏÂÎÁÒÕÖÅÎÁ"
+
+#: memline.c:3100
+msgid "E317: pointer block id wrong"
+msgstr "E317: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÕËÁÚÁÔÅÌÑ ÂÌÏËÁ"
+
+#: memline.c:3116
+msgid "pe_line_count is zero"
+msgstr "ÚÎÁÞÅÎÉÅ pe_line_count ÒÁ×ÎÏ ÎÕÌÀ"
+
+#: memline.c:3145
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: ÎÏÍÅÒ ÓÔÒÏËÉ ÚÁ ÐÒÅÄÅÌÁÍÉ ÄÉÁÐÁÚÏÎÁ: %ld"
+
+#: memline.c:3149
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÓÞ£ÔÞÉËÁ ÓÔÒÏË × ÂÌÏËÅ %ld"
+
+#: memline.c:3198
+msgid "Stack size increases"
+msgstr "òÁÚÍÅÒ ÓÔÅËÁ Õ×ÅÌÉÞÅÎ"
+
+#: memline.c:3244
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: ÎÅÐÒÁ×ÉÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÕËÁÚÁÔÅÌÑ ÂÌÏËÁ 2"
+
+#: memline.c:3674
+msgid "E325: ATTENTION"
+msgstr "E325: ÷îéíáîéå"
+
+#: memline.c:3675
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"ïÂÎÁÒÕÖÅÎ Ó×ÏÐ-ÆÁÊÌ Ó ÉÍÅÎÅÍ \""
+
+#: memline.c:3679
+msgid "While opening file \""
+msgstr "ðÒÉ ÏÔËÒÙÔÉÉ ÆÁÊÌÁ: \""
+
+#: memline.c:3688
+msgid " NEWER than swap file!\n"
+msgstr " âÏÌÅÅ ó÷åöéê, ÞÅÍ Ó×ÏÐ-ÆÁÊÌ!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3692
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ÷ÏÚÍÏÖÎÏ, ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÆÁÊÌÁ ×ÙÐÏÌÎÑÅÔÓÑ × ÄÒÕÇÏÊ ÐÒÏÇÒÁÍÍÅ.\n"
+" åÓÌÉ ÜÔÏ ÔÁË, ÔÏ ÂÕÄØÔÅ ×ÎÉÍÁÔÅÌØÎÙ ÐÒÉ ×ÎÅÓÅÎÉÉ ÉÚÍÅÎÅÎÉÊ,\n"
+" ÞÔÏÂÙ Õ ×ÁÓ ÎÅ ÐÏÑ×ÉÌÏÓØ Ä×Á ÒÁÚÎÙÈ ×ÁÒÉÁÎÔÁ ÏÄÎÏÇÏ É ÔÏÇÏ ÖÅ ÆÁÊÌÁ.\n"
+
+#: memline.c:3693
+msgid " Quit, or continue with caution.\n"
+msgstr " úÁ×ÅÒÛÉÔÅ ÒÁÂÏÔÕ ÉÌÉ ÐÒÏÄÏÌÖÁÊÔÅ Ó ÏÓÔÏÒÏÖÎÏÓÔØÀ.\n"
+
+#: memline.c:3694
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ðÒÅÄÙÄÕÝÉÊ ÓÅÁÎÓ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ ÜÔÏÇÏ ÆÁÊÌÁ ÚÁ×ÅÒۣΠÁ×ÁÒÉÊÎÏ.\n"
+
+#: memline.c:3695
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ÷ ÜÔÏÍ ÓÌÕÞÁÅ, ÉÓÐÏÌØÚÕÊÔÅ ËÏÍÁÎÄÕ \":recover\" ÉÌÉ \"vim -r "
+
+#: memline.c:3697
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ÉÚÍÅÎÅÎÉÊ (ÓÍ. \":help ×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ\").\n"
+
+#: memline.c:3698
+msgid " If you did this already, delete the swap file \""
+msgstr " åÓÌÉ ×Ù ÕÖÅ ×ÙÐÏÌÎÑÌÉ ÜÔÕ ÏÐÅÒÁÃÉÀ, ÕÄÁÌÉÔÅ Ó×ÏÐ-ÆÁÊÌ \""
+
+#: memline.c:3700
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ÞÔÏÂÙ ÉÚÂÅÖÁÔØ ÐÏÑ×ÌÅÎÉÑ ÜÔÏÇÏ ÓÏÏÂÝÅÎÉÑ × ÂÕÄÕÝÅÍ.\n"
+
+#: memline.c:3714 memline.c:3718
+msgid "Swap file \""
+msgstr "ó×ÏÐ-ÆÁÊÌ \""
+
+#: memline.c:3715 memline.c:3721
+msgid "\" already exists!"
+msgstr "\" ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ!"
+
+#: memline.c:3724
+msgid "VIM - ATTENTION"
+msgstr "VIM - ÷îéíáîéå"
+
+#: memline.c:3726
+msgid "Swap file already exists!"
+msgstr "ó×ÏÐ-ÆÁÊÌ ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ!"
+
+#: memline.c:3730
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort"
+msgstr ""
+"&O ïÔËÒÙÔØ ÄÌÑ ÞÔÅÎÉÑ\n"
+"&E òÅÄÁËÔÉÒÏ×ÁÔØ\n"
+"&R ÷ÏÓÓÔÁÎÏ×ÉÔØ\n"
+"&Q ÷ÙÈÏÄ\n"
+"&A ðÒÅÒ×ÁÔØ"
+
+#: memline.c:3732
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Abort\n"
+"&Delete it"
+msgstr ""
+"&O ïÔËÒÙÔØ ÄÌÑ ÞÔÅÎÉÑ\n"
+"&E òÅÄÁËÔÉÒÏ×ÁÔØ\n"
+"&R ÷ÏÓÓÔÁÎÏ×ÉÔØ\n"
+"&Q ÷ÙÈÏÄ\n"
+"&A ðÒÅÒ×ÁÔØ\n"
+"&D õÄÁÌÉÔØ"
+
+#: memline.c:3789
+msgid "E326: Too many swap files found"
+msgstr "E326: ïÂÎÁÒÕÖÅÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ Ó×ÏÐ-ÆÁÊÌÏ×"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ëÏÍÐÏÎÅÎÔ ÐÕÔÉ Ë ÜÌÅÍÅÎÔÕ ÍÅÎÀ ÎÅ Ñ×ÌÑÅÔÓÑ ÐÏÄÍÅÎÀ"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: íÅÎÀ × ÜÔÏÍ ÒÅÖÉÍÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: îÅÔ ÍÅÎÀ Ó ÔÁËÉÍ ÉÍÅÎÅÍ"
+
+#: menu.c:525
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ðÕÔØ Ë ÍÅÎÀ ÎÅ ÄÏÌÖÅÎ ×ÅÓÔÉ Ë ÐÏÄÍÅÎÀ"
+
+#: menu.c:564
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: üÌÅÍÅÎÔÙ ÍÅÎÀ ÎÅÌØÚÑ ÄÏÂÁ×ÌÑÔØ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ × ÐÏÌÏÓËÕ ÍÅÎÀ"
+
+#: menu.c:570
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: òÁÚÄÅÌÉÔÅÌÉ ÎÅ ÍÏÇÕÔ ÂÙÔØ ËÏÍÐÏÎÅÎÔÏÍ ÐÕÔÉ Ë ÍÅÎÀ"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1097
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- íÅÎÀ ---"
+
+#: menu.c:2019
+msgid "Tear off this menu"
+msgstr "ïÔÏÒ×ÁÔØ ÜÔÏ ÍÅÎÀ"
+
+#: menu.c:2084
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ðÕÔØ Ë ÍÅÎÀ ÄÏÌÖÅÎ ×ÅÓÔÉ Ë ÜÌÅÍÅÎÔÕ ÍÅÎÀ"
+
+#: menu.c:2104
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: íÅÎÀ ÎÅ ÎÁÊÄÅÎÏ: %s"
+
+#: menu.c:2173
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: íÅÎÀ ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÄÌÑ ÒÅÖÉÍÁ %s"
+
+#: menu.c:2211
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ðÕÔØ Ë ÍÅÎÀ ÄÏÌÖÅÎ ×ÅÓÔÉ Ë ÐÏÄÍÅÎÀ"
+
+#: menu.c:2232
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: íÅÎÀ ÎÅ ÎÁÊÄÅÎÏ -- ÐÒÏ×ÅÒØÔÅ ÉÍÅÎÁ ÍÅÎÀ"
+
+#: message.c:414
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "ïÂÎÁÒÕÖÅÎÁ ÏÛÉÂËÁ ÐÒÉ ÏÂÒÁÂÏÔËÅ %s:"
+
+#: message.c:440
+#, c-format
+msgid "line %4ld:"
+msgstr "ÓÔÒÏËÁ %4ld:"
+
+#: message.c:647
+msgid "[string too long]"
+msgstr "[ÓÌÉÛËÏÍ ÄÌÉÎÎÁÑ ÓÔÒÏËÁ]"
+
+#: message.c:797
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"ðÅÒÅ×ÏÄ ÓÏÏÂÝÅÎÉÊ ÎÁ ÒÕÓÓËÉÊ ÑÚÙË: ÷ÁÓÉÌÉÊ òÁÇÏÚÉÎ <vrr@users.sourceforge."
+"net>"
+
+#: message.c:1025
+msgid "Interrupt: "
+msgstr "ðÒÅÒÙ×ÁÎÉÅ: "
+
+#: message.c:1028
+msgid "Hit ENTER to continue"
+msgstr "äÌÑ ÐÒÏÄÏÌÖÅÎÉÑ ÎÁÖÍÉÔÅ ENTER"
+
+#: message.c:1030
+msgid "Hit ENTER or type command to continue"
+msgstr "äÌÑ ÐÒÏÄÏÌÖÅÎÉÑ ÎÁÖÍÉÔÅ ENTER ÉÌÉ ××ÅÄÉÔÅ ËÏÍÁÎÄÕ"
+
+#: message.c:2351
+msgid "-- More --"
+msgstr "-- ðÒÏÄÏÌÖÅÎÉÅ ÓÌÅÄÕÅÔ --"
+
+#: message.c:2354
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ÓÔÒÏËÁ, SPACE/b: ÓÔÒÁÎÉÃÁ, d/u: ÐÏÌÓÔÒÁÎÉÃÙ, q: ×ÙÈÏÄ)"
+
+#: message.c:2355
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ÓÔÒÏËÁ, SPACE: ÓÔÒÁÎÉÃÁ, d: ÐÏÌÓÔÒÁÎÉÃÙ, q: ×ÙÈÏÄ)"
+
+#: message.c:2976 message.c:2991
+msgid "Question"
+msgstr "÷ÏÐÒÏÓ"
+
+#: message.c:2978
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&äÁ\n"
+"&îÅÔ"
+
+#: message.c:3011
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&äÁ\n"
+"&îÅÔ\n"
+"óÏÈÒÁÎÉÔØ &×ÓÅ\n"
+"&ðÏÔÅÒÑÔØ ×ÓÅ\n"
+"ï&ÔÍÅÎÁ"
+
+#: message.c:3052
+msgid "Save File dialog"
+msgstr "óÏÈÒÁÎÅÎÉÅ ÆÁÊÌÁ"
+
+#: message.c:3054
+msgid "Open File dialog"
+msgstr "ïÔËÒÙÔÉÅ ÆÁÊÌÁ"
+
+#. TODO: non-GUI file selector here
+#: message.c:3125
+msgid "E338: Sorry, no file browser in console mode"
+msgstr ""
+"E338: éÚ×ÉÎÉÔÅ, ÎÏ × ËÏÎÓÏÌØÎÏÍ ÒÅÖÉÍÅ ÎÅÔ ÐÒÏ×ÏÄÎÉËÁ ÐÏ ÆÁÊÌÏ×ÏÊ ÓÉÓÔÅÍÅ"
+
+#: misc1.c:2773
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: éÚÍÅÎÅÎÉÅ ÆÁÊÌÁ Ó ÐÒÁ×ÁÍÉ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ"
+
+#: misc1.c:3021
+msgid "1 more line"
+msgstr "äÏÂÁ×ÌÅÎÁ ÏÄÎÁ ÓÔÒÏËÁ"
+
+#: misc1.c:3023
+msgid "1 line less"
+msgstr "õÄÁÌÅÎÁ ÏÄÎÁ ÓÔÒÏËÁ"
+
+#: misc1.c:3028
+#, c-format
+msgid "%ld more lines"
+msgstr "äÏÂÁ×ÌÅÎÏ ÓÔÒÏË: %ld"
+
+#: misc1.c:3030
+#, c-format
+msgid "%ld fewer lines"
+msgstr "õÄÁÌÅÎÏ ÓÔÒÏË: %ld"
+
+#: misc1.c:3033
+msgid " (Interrupted)"
+msgstr " (ðÒÅÒ×ÁÎÏ)"
+
+#: misc1.c:7588
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ÓÏÈÒÁÎÑÀÔÓÑ ÆÁÊÌÙ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:7598
+msgid "Vim: Finished.\n"
+msgstr "Vim: çÏÔÏ×Ï.\n"
+
+#: misc2.c:695 misc2.c:711
+#, c-format
+msgid "ERROR: "
+msgstr "ïûéâëá: "
+
+#: misc2.c:715
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[ÂÁÊÔ] ×ÓÅÇÏ ×ÙÄÅÌ.-ÏÓ×ÏÂ. %lu-%lu, ÉÓÐÏÌØÚ. %lu, ÍÁËÓ. ÉÓÐÏÌØÚ. %lu\n"
+
+#: misc2.c:717
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[×ÙÚÏ×Ù] re/malloc() ×ÓÅÇÏ %lu, free() ×ÓÅÇÏ %lu\n"
+"\n"
+
+#: misc2.c:772
+msgid "E340: Line is becoming too long"
+msgstr "E340: óÔÒÏËÁ ÓÔÁÎÏ×ÉÔÓÑ ÓÌÉÛËÏÍ ÄÌÉÎÎÏÊ"
+
+#: misc2.c:816
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ÷ÎÕÔÒÅÎÎÑÑ ÏÛÉÂËÁ: lalloc(%ld, )"
+
+#: misc2.c:924
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ! (×ÙÄÅÌÑÅÔÓÑ %lu ÂÁÊÔ)"
+
+#: misc2.c:2594
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "÷ÙÚÏ× ÏÂÏÌÏÞËÉ ÄÌÑ ÉÓÐÏÌÎÅÎÉÑ: \"%s\""
+
+#: misc2.c:2816
+msgid "E545: Missing colon"
+msgstr "E545: ðÒÏÐÕÝÅÎÏ Ä×ÏÅÔÏÞÉÅ"
+
+#: misc2.c:2818 misc2.c:2845
+msgid "E546: Illegal mode"
+msgstr "E546: îÅÄÏÐÕÓÔÉÍÙÊ ÒÅÖÉÍ"
+
+#: misc2.c:2884
+msgid "E547: Illegal mouseshape"
+msgstr "E547: îÅÄÏÐÕÓÔÉÍÁÑ ÆÏÒÍÁ ËÕÒÓÏÒÁ"
+
+#: misc2.c:2924
+msgid "E548: digit expected"
+msgstr "E548: ÔÒÅÂÕÅÔÓÑ ××ÅÓÔÉ ÃÉÆÒÕ"
+
+#: misc2.c:2929
+msgid "E549: Illegal percentage"
+msgstr "E549: îÅÄÏÐÕÓÔÉÍÏÅ ÚÎÁÞÅÎÉÅ ÐÒÏÃÅÎÔÏ×"
+
+#: misc2.c:3239
+msgid "Enter encryption key: "
+msgstr "÷×ÅÄÉÔÅ ÐÁÒÏÌØ ÄÌÑ ÛÉÆÒÏ×ÁÎÉÑ: "
+
+#: misc2.c:3240
+msgid "Enter same key again: "
+msgstr " ðÏ×ÔÏÒÉÔÅ ××ÏÄ ÐÁÒÏÌÑ:"
+
+#: misc2.c:3250
+msgid "Keys don't match!"
+msgstr "÷×ÅÄ£ÎÎÙÅ ÐÁÒÏÌÉ ÎÅ ÓÏ×ÐÁÄÁÀÔ!"
+
+#: misc2.c:3799
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: îÅÐÒÁ×ÉÌØÎÏ ÚÁÄÁÎ ÐÕÔØ: '**[ÞÉÓÌÏ]' ÄÏÌÖÎÏ ÂÙÔØ ÌÉÂÏ × ËÏÎÃÅ ÐÕÔÉ, "
+"ÌÉÂÏ ÚÁ ÎÉÍ ÄÏÌÖÎÏ ÓÌÅÄÏ×ÁÔØ '%s'"
+
+#: misc2.c:5078
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: ëÁÔÁÌÏÇ \"%s\" ÎÅ ÎÁÊÄÅÎ × ÐÕÔÉ ÄÌÑ ÓÍÅÎÙ ËÁÔÁÌÏÇÁ"
+
+#: misc2.c:5081
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: æÁÊÌ \"%s\" × ÉÚ×ÅÓÔÎÙÈ ËÁÔÁÌÏÇÁÈ ÎÅ ÎÁÊÄÅÎ"
+
+#: misc2.c:5087
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ÷ ÐÕÔÉ ÓÍÅÎÙ ËÁÔÁÌÏÇÁ ÂÏÌØÛÅ ÎÅÔ ËÁÔÁÌÏÇÏ× \"%s\""
+
+#: misc2.c:5090
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ÷ ÉÚ×ÅÓÔÎÙÈ ËÁÔÁÌÏÇÁÈ ÂÏÌØÛÅ ÎÅÔ ÆÁÊÌÏ× \"%s\""
+
+#: misc2.c:5324
+msgid "E550: Missing colon"
+msgstr "E550: ðÒÏÐÕÝÅÎÏ Ä×ÏÅÔÏÞÉÅ"
+
+#: misc2.c:5336
+msgid "E551: Illegal component"
+msgstr "E551: îÅÄÏÐÕÓÔÉÍÙÊ ËÏÍÐÏÎÅÎÔ"
+
+#: misc2.c:5344
+msgid "E552: digit expected"
+msgstr "E552: ôÒÅÂÕÅÔÓÑ ÕËÁÚÁÔØ ÃÉÆÒÕ"
+
+#. Get here when the server can't be found.
+#: netbeans.c:396
+msgid "Cannot connect to Netbeans #2"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÓÏÅÄÉÎÉÔØÓÑ Ó Netbeans #2"
+
+#: netbeans.c:404
+msgid "Cannot connect to Netbeans"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÓÏÅÄÉÎÉÔØÓÑ Ó NetBeans"
+
+#: netbeans.c:450
+#, c-format
+msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\""
+msgstr ""
+"E668: îÅÐÒÁ×ÉÌØÎÙÊ ÒÅÖÉÍ ÄÏÓÔÕÐÁ Ë ÉÎÆÏÒÍÁÃÉÉ Ï ÓÏÅÄÉÎÅÎÉÉ Ó NetBeans: \"%s\""
+
+#: netbeans.c:749
+msgid "read from Netbeans socket"
+msgstr "ÞÔÅÎÉÅ ÉÚ ÇÎÅÚÄÁ NetBeans"
+
+#: netbeans.c:1643
+#, c-format
+msgid "E658: NetBeans connection lost for buffer %ld"
+msgstr "E658: ðÏÔÅÒÑÎÏ ÓÏÅÄÉÎÅÎÉÅ Ó NetBeans ÄÌÑ ÂÕÆÅÒÁ %ld"
+
+#: normal.c:2980
+msgid "Warning: terminal cannot highlight"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÔÅÒÍÉÎÁÌ ÎÅ ÍÏÖÅÔ ×ÙÐÏÌÎÑÔØ ÐÏÄÓ×ÅÔËÕ"
+
+#: normal.c:3276
+msgid "E348: No string under cursor"
+msgstr "E348: îÅÔ ÓÔÒÏËÉ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ"
+
+#: normal.c:3278
+msgid "E349: No identifier under cursor"
+msgstr "E349: îÅÔ ÉÍÅÎÉ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ"
+
+#: normal.c:4519
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr ""
+"E352: îÅ×ÏÚÍÏÖÎÏ ÓÔÅÒÅÔØ ÓËÌÁÄËÉ Ó ÔÅËÕÝÉÍ ÚÎÁÞÅÎÉÅÍ ÏÐÃÉÉ 'foldmethod'"
+
+#: normal.c:6740
+msgid "E664: changelist is empty"
+msgstr "E664: ÓÐÉÓÏË ÉÚÍÅÎÅÎÉÊ ÐÕÓÔÏÊ"
+
+#: normal.c:6742
+msgid "E662: At start of changelist"
+msgstr "E662: ÷ ÎÁÞÁÌÅ ÓÐÉÓËÁ ÉÚÍÅÎÅÎÉÊ"
+
+#: normal.c:6744
+msgid "E663: At end of changelist"
+msgstr "E662: ÷ ËÏÎÃÅ ÓÐÉÓËÁ ÉÚÍÅÎÅÎÉÊ"
+
+#: normal.c:8005
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "÷×ÅÄÉÔÅ :quit<Enter> ÄÌÑ ×ÙÈÏÄÁ ÉÚ Vim"
+
+#: ops.c:294
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "éÚÍÅÎÅÎÙ ÏÔÓÔÕÐÙ × 1 ÓÔÒÏËÅ (%s 1 ÒÁÚ)"
+
+#: ops.c:296
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "éÚÍÅÎÅÎÙ ÏÔÓÔÕÐÙ × 1 ÓÔÒÏËÅ (%s %d ÒÁÚ)"
+
+#: ops.c:301
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "éÚÍÅÎÅÎÙ ÏÔÓÔÕÐÙ, %ld ÓÔÒÏË (%s 1 ÒÁÚ)"
+
+#: ops.c:304
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "éÚÍÅÎÅÎÙ ÏÔÓÔÕÐÙ, %ld ÓÔÒÏË (%s %d ÒÁÚ)"
+
+#: ops.c:662
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "éÚÍÅÎÑÀÔÓÑ ÏÔÓÔÕÐÙ ÓÔÒÏËÁÈ (%ld)..."
+
+#: ops.c:712
+msgid "1 line indented "
+msgstr "éÚÍÅΣΠÏÔÓÔÕÐ × ÏÄÎÏÊ ÓÔÒÏËÅ "
+
+#: ops.c:714
+#, c-format
+msgid "%ld lines indented "
+msgstr "éÚÍÅÎÅÎÙ ÏÔÓÔÕÐÙ × ÓÔÒÏËÁÈ (%ld) "
+
+#. must display the prompt
+#: ops.c:1675
+msgid "cannot yank; delete anyway"
+msgstr "ÓËÏÐÉÒÏ×ÁÔØ ÎÅ ÕÄÁÌÏÓØ, ÕÄÁÌÅÎÉÅ ×ÙÐÏÌÎÅÎÏ"
+
+#: ops.c:2261
+msgid "1 line changed"
+msgstr "ÉÚÍÅÎÅÎÁ 1 ÓÔÒÏËÁ"
+
+#: ops.c:2263
+#, c-format
+msgid "%ld lines changed"
+msgstr "ÉÚÍÅÎÅÎÏ ÓÔÒÏË: %ld"
+
+#: ops.c:2647
+#, c-format
+msgid "freeing %ld lines"
+msgstr "ÏÞÉÝÅÎÏ ÓÔÒÏË: %ld"
+
+#: ops.c:2928
+msgid "1 line yanked"
+msgstr "ÓËÏÐÉÒÏ×ÁÎÁ ÏÄÎÁ ÓÔÒÏËÁ"
+
+#: ops.c:2930
+#, c-format
+msgid "%ld lines yanked"
+msgstr "ÓËÏÐÉÒÏ×ÁÎÏ ÓÔÒÏË: %ld"
+
+#: ops.c:3215
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ÷ ÒÅÇÉÓÔÒÅ %s ÎÉÞÅÇÏ ÎÅÔ"
+
+#. Highlight title
+#: ops.c:3766
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- òÅÇÉÓÔÒÙ ---"
+
+#: ops.c:5075
+msgid "Illegal register name"
+msgstr "îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÒÅÇÉÓÔÒÁ"
+
+#: ops.c:5163
+#, c-format
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# òÅÇÉÓÔÒÙ:\n"
+
+#: ops.c:5213
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: îÅÉÚ×ÅÓÔÎÙÊ ÔÉÐ ÒÅÇÉÓÔÒÁ %d"
+
+#: ops.c:5698
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ÒÅÇÉÓÔÒÁ: '%s'"
+
+#: ops.c:6058
+#, c-format
+msgid "%ld Cols; "
+msgstr "ëÏÌÏÎÏË: %ld; "
+
+#: ops.c:6065
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "÷ÙÄÅÌÅÎÏ %s%ld ÉÚ %ld ÓÔÒÏË; %ld ÉÚ %ld ÓÌÏ×; %ld ÉÚ %ld ÂÁÊÔ"
+
+#: ops.c:6081
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "ëÏÌ. %s ÉÚ %s; ÓÔÒ. %ld ÉÚ %ld; ÓÌÏ×Ï %ld ÉÚ %ld; ÂÁÊÔ %ld ÉÚ %ld"
+
+#: ops.c:6092
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld Ó ÕÞ£ÔÏÍ BOM)"
+
+#: option.c:1643
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=óÔÒ. %N"
+
+#: option.c:2092
+msgid "Thanks for flying Vim"
+msgstr "âÌÁÇÏÄÁÒÉÍ ÚÁ ÉÓÐÏÌØÚÏ×ÁÎÉÅ Vim"
+
+#: option.c:3419 option.c:3535
+msgid "E518: Unknown option"
+msgstr "E518: îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ"
+
+#: option.c:3432
+msgid "E519: Option not supported"
+msgstr "E519: ïÐÃÉÑ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ"
+
+#: option.c:3457
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: îÅ ÄÏÐÕÓËÁÅÔÓÑ × ÒÅÖÉÍÎÏÊ ÓÔÒÏËÅ"
+
+#: option.c:3522
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t÷ ÐÏÓÌÅÄÎÉÊ ÒÁÚ ÏÐÃÉÑ ÉÚÍÅÎÅÎÁ × "
+
+#: option.c:3661
+msgid "E521: Number required after ="
+msgstr "E521: ðÏÓÌÅ = ÔÒÅÂÕÅÔÓÑ ÕËÁÚÁÔØ ÞÉÓÌÏ"
+
+#: option.c:3989 option.c:4619
+msgid "E522: Not found in termcap"
+msgstr "E522: îÅ ÏÂÎÁÒÕÖÅÎÏ × termcap"
+
+#: option.c:4064
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ <%s>"
+
+#: option.c:4611
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: úÎÁÞÅÎÉÅ ÏÐÃÉÉ 'term' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÐÕÓÔÏÊ ÓÔÒÏËÏÊ"
+
+#: option.c:4614
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: ÷ ÇÒÁÆÉÞÅÓËÏÍ ÉÎÔÅÒÆÅÊÓÅ ÉÚÍÅÎÑÔØ ÔÅÒÍÉÎÁÌ ÎÅ×ÏÚÍÏÖÎÏ"
+
+#: option.c:4616
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: äÌÑ ÚÁÐÕÓËÁ ÇÒÁÆÉÞÅÓËÏÇÏ ÉÎÔÅÒÆÅÊÓÁ ÉÓÐÏÌØÚÕÊÔÅ \":gui\""
+
+#: option.c:4645
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: ÚÎÁÞÅÎÉÑ ÏÐÃÉÊ 'backupext' É 'patchmode' ÒÁ×ÎÙ"
+
+#: option.c:4860
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: îÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÏ × ÇÒÁÆÉÞÅÓËÏÍ ÉÎÔÅÒÆÅÊÓÅ GTK+ 2"
+
+#: option.c:5016
+msgid "E524: Missing colon"
+msgstr "E524: ðÒÏÐÕÝÅÎÏ Ä×ÏÅÔÏÞÉÅ"
+
+#: option.c:5018
+msgid "E525: Zero length string"
+msgstr "E525: óÔÒÏËÁ Ó ÎÕÌÅ×ÏÊ ÄÌÉÎÏÊ"
+
+#: option.c:5086
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: ðÒÏÐÕÝÅÎÏ ÞÉÓÌÏ ÐÏÓÌÅ <%s>"
+
+#: option.c:5100
+msgid "E527: Missing comma"
+msgstr "E527: ðÒÏÐÕÝÅÎÁ ÚÁÐÑÔÁÑ"
+
+#: option.c:5107
+msgid "E528: Must specify a ' value"
+msgstr "E528: îÅÏÂÈÏÄÉÍÏ ÕËÁÚÁÔØ ÚÎÁÞÅÎÉÅ ÄÌÑ '"
+
+#: option.c:5148
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: ÓÏÄÅÒÖÉÔ ÎÅÐÅÞÁÔÎÙÊ ÓÉÍ×ÏÌ ÉÌÉ ÓÉÍ×ÏÌ Ä×ÏÊÎÏÊ ÛÉÒÉÎÙ"
+
+#: option.c:5197
+msgid "E596: Invalid font(s)"
+msgstr "E596: îÅÐÒÁ×ÉÌØÎÙÅ ÛÒÉÆÔÙ"
+
+#: option.c:5205
+msgid "E597: can't select fontset"
+msgstr "E597: ÎÅ×ÏÚÍÏÖÎÏ ×ÙÂÒÁÔØ ÛÒÉÆÔÏ×ÏÊ ÎÁÂÏÒ"
+
+#: option.c:5207
+msgid "E598: Invalid fontset"
+msgstr "E598: îÅÐÒÁ×ÉÌØÎÙÊ ÛÒÉÆÔÏ×ÏÊ ÎÁÂÏÒ"
+
+#: option.c:5214
+msgid "E533: can't select wide font"
+msgstr "E533: ÎÅ×ÏÚÍÏÖÎÏ ×ÙÂÒÁÔØ ÛÒÉÆÔ Ó ÓÉÍ×ÏÌÁÍÉ Ä×ÏÊÎÏÊ ÛÉÒÉÎÙ"
+
+#: option.c:5216
+msgid "E534: Invalid wide font"
+msgstr "E534: îÅÐÒÁ×ÉÌØÎÙÊ ÛÒÉÆÔ Ó ÓÉÍ×ÏÌÁÍÉ Ä×ÏÊÎÏÊ ÛÉÒÉÎÙ"
+
+#: option.c:5486
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: îÅÐÒÁ×ÉÌØÎÙÊ ÓÉÍ×ÏÌ ÐÏÓÌÅ <%c>"
+
+#: option.c:5597
+msgid "E536: comma required"
+msgstr "E536: ÔÒÅÂÕÅÔÓÑ ÚÁÐÑÔÁÑ"
+
+#: option.c:5607
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr ""
+"E537: úÎÁÞÅÎÉÅ ÏÐÃÉÑ 'commentstring' ÄÏÌÖÎÏ ÂÙÔØ ÐÕÓÔÏÊ ÓÔÒÏËÏÊ ÉÌÉ "
+"ÓÏÄÅÒÖÁÔØ %s"
+
+#: option.c:5679
+msgid "E538: No mouse support"
+msgstr "E538: íÙÛØ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ"
+
+#: option.c:5947
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: îÅÚÁËÒÙÔÁÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ×ÙÒÁÖÅÎÉÑ"
+
+#: option.c:5951
+msgid "E541: too many items"
+msgstr "E541: ÓÌÉÛËÏÍ ÍÎÏÇÏ ÜÌÅÍÅÎÔÏ×"
+
+#: option.c:5953
+msgid "E542: unbalanced groups"
+msgstr "E542: ÎÅÓÂÁÌÁÎÓÉÒÏ×ÁÎÎÙÅ ÇÒÕÐÐÙ"
+
+#: option.c:6193
+msgid "E590: A preview window already exists"
+msgstr "E590: ïËÎÏ ÐÒÅÄÐÒÏÓÍÏÔÒÁ ÕÖÅ ÅÓÔØ"
+
+#: option.c:6450
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr ""
+"W17: áÒÁÂÓËÉÊ ÔÒÅÂÕÅÔ ÉÓÐÏÌØÚÏ×ÁÎÉÑ UTF-8, ××ÅÄÉÔÅ ':set encoding=utf-8'"
+
+#: option.c:6783
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: îÕÖÎÏ ÈÏÔÑ ÂÙ %d ÓÔÒÏË"
+
+#: option.c:6793
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: îÕÖÎÏ ÈÏÔÑ ÂÙ %d ËÏÌÏÎÏË"
+
+#: option.c:7100
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: îÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ: %s"
+
+#: option.c:7220
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- ôÅÒÍÉÎÁÌØÎÙÅ ËÏÄÙ ---"
+
+#: option.c:7222
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- çÌÏÂÁÌØÎÙÅ ÚÎÁÞÅÎÉÑ ÏÐÃÉÊ ---"
+
+#: option.c:7224
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- íÅÓÔÎÙÅ ÚÎÁÞÅÎÉÑ ÏÐÃÉÊ ---"
+
+#: option.c:7226
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- ïÐÃÉÉ ---"
+
+#: option.c:7932
+msgid "E356: get_varp ERROR"
+msgstr "E356: ïûéâëá get_varp"
+
+#: option.c:8903
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': îÅÔ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÇÏ ÓÉÍ×ÏÌÁ ÄÌÑ %s"
+
+#: option.c:8937
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ìÉÛÎÉÅ ÓÉÍ×ÏÌÙ ÐÏÓÌÅ ÔÏÞËÉ Ó ÚÁÐÑÔÏÊ: %s"
+
+#: os_amiga.c:280
+msgid "cannot open "
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ "
+
+#: os_amiga.c:314
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÏËÎÏ!\n"
+
+#: os_amiga.c:338
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "îÅÏÂÈÏÄÉÍÁ Amigados ×ÅÒÓÉÉ 2.04 ÉÌÉ ÂÏÌÅÅ ÐÏÚÄÎÅÊ\n"
+
+#: os_amiga.c:344
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "îÅÏÂÈÏÄÉÍÁ %s ×ÅÒÓÉÉ %ld\n"
+
+#: os_amiga.c:416
+msgid "Cannot open NIL:\n"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ NIL:\n"
+
+#: os_amiga.c:427
+msgid "Cannot create "
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ "
+
+#: os_amiga.c:905
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "ðÒÅËÒÁÝÅÎÉÅ ÒÁÂÏÔÙ Vim Ó ËÏÄÏÍ %d\n"
+
+#: os_amiga.c:937
+msgid "cannot change console mode ?!\n"
+msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÓÍÅÎÉÔØ ÒÅÖÉÍ ËÏÎÓÏÌÉ?!\n"
+
+#: os_amiga.c:1003
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ÎÅ × ËÏÎÓÏÌÉ??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1152
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÏÂÏÌÏÞËÕ Ó ÁÒÇÕÍÅÎÔÏÍ -f"
+
+#: os_amiga.c:1193 os_amiga.c:1283
+msgid "Cannot execute "
+msgstr "îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ "
+
+#: os_amiga.c:1196 os_amiga.c:1293
+msgid "shell "
+msgstr "ÏÂÏÌÏÞËÁ "
+
+#: os_amiga.c:1216 os_amiga.c:1318
+msgid " returned\n"
+msgstr " ÚÁ×ÅÒÛÉÌÁ ÒÁÂÏÔÕ\n"
+
+#: os_amiga.c:1459
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ÓÌÉÛËÏÍ ÍÁÌÁÑ ×ÅÌÉÞÉÎÁ ANCHOR_BUF_SIZE."
+
+#: os_amiga.c:1463
+msgid "I/O ERROR"
+msgstr "ïûéâëá ÷÷ïäá/÷ù÷ïäá"
+
+#: os_mswin.c:539
+msgid "...(truncated)"
+msgstr "...(ÏÂÒÅÚÁÎÏ)"
+
+#: os_mswin.c:641
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "úÎÁÞÅÎÉÅ ÏÐÃÉÉ 'columns' ÎÅ ÒÁ×ÎÏ 80, ×ÎÅÛÎÉÅ ÐÒÏÇÒÁÍÍÙ ÎÅ ×ÙÐÏÌÎÑÀÔÓÑ"
+
+#: os_mswin.c:1973
+msgid "E237: Printer selection failed"
+msgstr "E327: îÅÕÄÁÞÎÏÅ ÚÁ×ÅÒÛÅÎÉÅ ×ÙÂÏÒÁ ÐÒÉÎÔÅÒÁ"
+
+#: os_mswin.c:2013
+#, c-format
+msgid "to %s on %s"
+msgstr "× %s ÎÁ %s"
+
+#: os_mswin.c:2028
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: îÅÉÚ×ÅÓÔÎÙÊ ÛÒÉÆÔ ÐÒÉÎÔÅÒÁ: %s"
+
+#: os_mswin.c:2077 os_mswin.c:2087
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ïÛÉÂËÁ ÐÅÞÁÔÉ: %s"
+
+#: os_mswin.c:2088
+msgid "Unknown"
+msgstr "îÅÉÚ×ÅÓÔÎÏ"
+
+#: os_mswin.c:2115
+#, c-format
+msgid "Printing '%s'"
+msgstr "ðÅÞÁÔØ '%s'"
+
+#: os_mswin.c:3204
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: îÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ ËÏÄÉÒÏ×ËÉ \"%s\" × ÉÍÅÎÉ ÛÒÉÆÔÁ \"%s\""
+
+#: os_mswin.c:3212
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ '%c' × ÉÍÅÎÉ ÛÒÉÆÔÁ \"%s\""
+
+#: os_riscos.c:1259
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: îÅÄÏÐÕÓÔÉÍÏÅ ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'osfiletype' -- ÉÓÐÏÌØÚÕÅÔÓÑ Text"
+
+#: os_unix.c:927
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: ä×ÏÊÎÏÊ ÓÉÇÎÁÌ, ÚÁ×ÅÒÛÅÎÉÅ ÒÁÂÏÔÙ\n"
+
+#: os_unix.c:933
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: ðÏÌÕÞÅÎ ÕÂÉÊÓÔ×ÅÎÎÙÊ ÓÉÇÎÁÌ %s\n"
+
+#: os_unix.c:936
+#, c-format
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: ðÏÌÕÞÅÎ ÕÂÉÊÓÔ×ÅÎÎÙÊ ÓÉÇÎÁÌ\n"
+
+#: os_unix.c:1199
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "ïÔËÒÙÔÉÅ ÄÉÓÐÌÅÑ X ÚÁÎÑÌÏ %ld msec"
+
+#: os_unix.c:1226
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: ïÛÉÂËÁ X\n"
+
+#: os_unix.c:1334
+msgid "Testing the X display failed"
+msgstr "ðÒÏ×ÅÒËÁ ÄÉÓÐÌÅÑ X ÚÁ×ÅÒÛÅÎÁ ÎÅÕÄÁÞÎÏ"
+
+#: os_unix.c:1473
+msgid "Opening the X display timed out"
+msgstr "ïÔËÒÙÔÉÅ ÄÉÓÐÌÅÑ X ÎÅ ×ÙÐÏÌÎÅÎÏ × ÏÔ×ÅÄ£ÎÎÏÅ ×ÒÅÍÑ"
+
+#: os_unix.c:3227 os_unix.c:3907
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"îÅ×ÏÚÍÏÖÎÏ ÚÁÐÕÓÔÉÔØ ÏÂÏÌÏÞËÕ "
+
+#: os_unix.c:3275
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"îÅ×ÏÚÍÏÖÎÏ ÚÁÐÕÓÔÉÔØ ÏÂÏÌÏÞËÕ sh\n"
+
+#: os_unix.c:3279 os_unix.c:3913
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"ïÂÏÌÏÞËÁ ÚÁ×ÅÒÛÉÌÁ ÒÁÂÏÔÕ "
+
+#: os_unix.c:3414
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÔÒÕÂÙ\n"
+
+#: os_unix.c:3429
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ fork()\n"
+
+#: os_unix.c:3920
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"÷ÙÐÏÌÎÅÎÉÅ ËÏÍÁÎÄÙ ÐÒÅÒ×ÁÎÏ\n"
+
+#: os_unix.c:4184 os_unix.c:4309 os_unix.c:5975
+msgid "XSMP lost ICE connection"
+msgstr "XSMP ÕÔÅÒÑÎÏ ÓÏÅÄÉÎÅÎÉÅ ICE"
+
+#: os_unix.c:5558
+msgid "Opening the X display failed"
+msgstr "îÅÕÄÁÞÎÏÅ ÏÔËÒÙÔÉÅ ÄÉÓÐÌÅÑ X"
+
+#: os_unix.c:5880
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP ÏÂÒÁÂÁÔÙ×ÁÅÔ ÚÁÐÒÏÓ ÓÁÍÏÓÏÈÒÁÎÅÎÉÑ"
+
+#: os_unix.c:5999
+msgid "XSMP opening connection"
+msgstr "XSMP ÏÔËÒÙ×ÁÅÔ ÓÏÅÄÉÎÅÎÉÅ"
+
+#: os_unix.c:6018
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP ÐÏÔÅÒÑÎÏ ÓÌÅÖÅÎÉÅ ÚÁ ÓÏÅÄÉÎÅÎÉÅÍ ICE"
+
+#: os_unix.c:6038
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP ÎÅÕÄÁÞÎÏ ×ÙÐÏÌÎÅÎÏ SmcOpenConnection: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "÷ ÓÔÒÏËÅ"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "îÅ×ÏÚÍÏÖÎÏ ×ÙÄÅÌÉÔØ ÐÁÍÑÔØ ÄÌÑ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "ïÛÉÂËÁ VIM"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÉÓÐÒÁ×ÉÔØ ÕËÁÚÁÔÅÌÉ ÆÕÎËÃÉÊ ÄÌÑ DLL!"
+
+#: os_win16.c:342 os_win32.c:3216
+#, c-format
+msgid "shell returned %d"
+msgstr "ÚÁ×ÅÒÛÅÎÉÅ ÒÁÂÏÔÙ ÏÂÏÌÏÞËÉ Ó ËÏÄÏÍ %d"
+
+#: os_win32.c:2674
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: ðÅÒÅÈ×ÁÞÅÎÏ ÓÏÂÙÔÉÅ %s\n"
+
+#: os_win32.c:2676
+msgid "close"
+msgstr "ÚÁËÒÙÔÉÅ"
+
+#: os_win32.c:2678
+msgid "logoff"
+msgstr "ÏÔËÌÀÞÅÎÉÅ"
+
+#: os_win32.c:2679
+msgid "shutdown"
+msgstr "ÚÁ×ÅÒÛÅÎÉÅ"
+
+#: os_win32.c:3169
+msgid "E371: Command not found"
+msgstr "E371: ëÏÍÁÎÄÁ ÎÅ ÎÁÊÄÅÎÁ"
+
+#: os_win32.c:3182
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE ÎÅ ÎÁÊÄÅÎ × ÐÕÔÉ, ÚÁÄÁÎÎÏÍ × $PATH.\n"
+"÷ÎÅÛÎÉÅ ËÏÍÁÎÄÙ ÎÅ ÂÕÄÕÔ ÏÓÔÁÎÁ×ÌÉ×ÁÔØÓÑ ÐÏÓÌÅ ×ÙÐÏÌÎÅÎÉÑ.\n"
+"äÏÐÏÌÎÉÔÅÌØÎÁÑ ÉÎÆÏÒÍÁÃÉÑ × :help win32-vimrun"
+
+#: os_win32.c:3185
+msgid "Vim Warning"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ Vim"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ÷ ÓÔÒÏËÅ ÆÏÒÍÁÔÁ ÓÌÉÛËÏÍ ÍÎÏÇÏ %%%c"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: îÅÏÖÉÄÁÎÎÙÊ ÜÌÅÍÅÎÔ %%%c × ÓÔÒÏËÅ ÆÏÒÍÁÔÁ"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: ÷ ÓÔÒÏËÅ ÆÏÒÍÁÔÁ ÐÒÏÐÕÝÅÎÁ ]"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ × ÓÔÒÏËÅ ÆÏÒÍÁÔÁ"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: îÅÄÏÐÕÓÔÉÍÙÊ %%%c × ÐÒÉÓÔÁ×ËÅ × ÓÔÒÏËÅ ÆÏÒÍÁÔÁ"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: îÅÄÏÐÕÓÔÉÍÙÊ %%%c × ÓÔÒÏËÅ ÆÏÒÍÁÔÁ"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: ÷ ÚÎÁÞÅÎÉÉ ÏÐÃÉÉ 'errorformat' ÏÔÓÕÔÓÔ×ÕÅÔ ÛÁÂÌÏÎ"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ÉÍÑ ËÁÔÁÌÏÇÁ ÎÅ ÚÁÄÁÎÏ ÉÌÉ ÒÁ×ÎÏ ÐÕÓÔÏÊ ÓÔÒÏËÅ"
+
+#: quickfix.c:990
+msgid "E553: No more items"
+msgstr "E553: âÏÌØÛÅ ÎÅÔ ÜÌÅÍÅÎÔÏ×"
+
+#: quickfix.c:1229
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d ÉÚ %d)%s%s: "
+
+#: quickfix.c:1231
+msgid " (line deleted)"
+msgstr " (ÓÔÒÏËÁ ÕÄÁÌÅÎÁ)"
+
+#: quickfix.c:1444
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: ÷ÎÉÚÕ ÓÔÅËÁ ÂÙÓÔÒÙÈ ÉÓÐÒÁ×ÌÅÎÉÊ"
+
+#: quickfix.c:1453
+msgid "E381: At top of quickfix stack"
+msgstr "E381: îÁ×ÅÒÈÕ ÓÔÅËÁ ÂÙÓÔÒÙÈ ÉÓÐÒÁ×ÌÅÎÉÊ"
+
+#: quickfix.c:1465
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "ÓÐÉÓÏË ÏÛÉÂÏË %d ÉÚ %d; %d ÏÛÉÂÏË"
+
+#: quickfix.c:1943
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr ""
+"E382: úÁÐÉÓØ ÎÅ×ÏÚÍÏÖÎÁ, ÚÎÁÞÅÎÉÅ ÏÐÃÉÉ 'buftype' ÎÅ Ñ×ÌÑÅÔÓÑ ÐÕÓÔÏÊ ÓÔÒÏËÏÊ"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: ÎÅÄÏÐÕÓÔÉÍÙÊ ÜÌÅÍÅÎÔ × %s%%[]"
+
+#: regexp.c:838
+msgid "E339: Pattern too long"
+msgstr "E339: óÌÉÛËÏÍ ÄÌÉÎÎÙÊ ÛÁÂÌÏÎ"
+
+#: regexp.c:1009
+msgid "E50: Too many \\z("
+msgstr "E50: óÌÉÛËÏÍ ÍÎÏÇÏ \\z("
+
+#: regexp.c:1020
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: óÌÉÛËÏÍ ÍÎÏÇÏ %s("
+
+#: regexp.c:1077
+msgid "E52: Unmatched \\z("
+msgstr "E52: îÅÔ ÐÁÒÙ ÄÌÑ \\z("
+
+#: regexp.c:1081
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: îÅÔ ÐÁÒÙ ÄÌÑ %s%%("
+
+#: regexp.c:1083
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: îÅÔ ÐÁÒÙ ÄÌÑ %s("
+
+#: regexp.c:1088
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: îÅÔ ÐÁÒÙ ÄÌÑ %s)"
+
+#: regexp.c:1258
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: ×ÏÚÍÏÖÎÏ ÐÕÓÔÏÊ ÏÐÅÒÁÎÄ %s*"
+
+#: regexp.c:1261
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: ×ÏÚÍÏÖÎÏ ÐÕÓÔÏÊ ÏÐÅÒÁÎÄ %s+"
+
+#: regexp.c:1316
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: ÎÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ ÐÏÓÌÅ %s@"
+
+#: regexp.c:1344
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: ×ÏÚÍÏÖÎÏ ÐÕÓÔÏÊ ÏÐÅÒÁÎÄ %s{"
+
+#: regexp.c:1354
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: óÌÉÛËÏÍ ÍÎÏÇÏ ÓÌÏÖÎÙÈ ËÏÎÓÔÒÕËÃÉÊ %s{...}"
+
+#: regexp.c:1370
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: ÷ÌÏÖÅÎÎÙÅ %s*"
+
+#: regexp.c:1373
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: ÷ÌÏÖÅÎÎÙÅ %s%c"
+
+#: regexp.c:1491
+msgid "E63: invalid use of \\_"
+msgstr "E63: ÎÅÄÏÐÕÓÔÉÍÏÅ ÉÓÐÏÌØÚÏ×ÁÎÉÅ \\_"
+
+#: regexp.c:1536
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c ÎÉ ÚÁ ÞÅÍ ÎÅ ÓÌÅÄÕÅÔ"
+
+#: regexp.c:1592
+msgid "E65: Illegal back reference"
+msgstr "E65: îÅÄÏÐÕÓÔÉÍÁÑ ÏÂÒÁÔÎÁÑ ÓÓÙÌËÁ"
+
+#: regexp.c:1605
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎÏ ÚÄÅÓØ"
+
+#: regexp.c:1624
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 É Ô.Ð. ÎÅ ÍÏÇÕÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎÙ ÚÄÅÓØ"
+
+#: regexp.c:1635
+msgid "E68: Invalid character after \\z"
+msgstr "E68: îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ ÐÏÓÌÅ \\z"
+
+#: regexp.c:1684
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: ðÒÏÐÕÝÅÎÁ ] ÐÏÓÌÅ %s%%["
+
+#: regexp.c:1700
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: ðÕÓÔÏÅ %s%%[]"
+
+#: regexp.c:1760
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ ÐÏÓÌÅ %s%%"
+
+#: regexp.c:2557
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: óÉÎÔÁËÓÉÞÅÓËÁÑ ÏÛÉÂËÁ × %s{...}"
+
+#: regexp.c:2863 regexp.c:3016
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr ""
+"E361: ðÒÅÄÏÔ×ÒÁÝÅÎÏ Á×ÁÒÉÊÎÏÅ ÚÁ×ÅÒÛÅÎÉÅ: ÓÌÉÛËÏÍ ÓÌÏÖÎÏÅ ÒÅÇÕÌÑÒÎÏÅ "
+"×ÙÒÁÖÅÎÉÅ?"
+
+#: regexp.c:3004 regexp.c:3013
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: ÐÒÉÍÅÎÅÎÉÅ ÛÁÂÌÏÎÁ ÐÒÉ×ÅÌÏ Ë ÏÛÉÂËÅ ×ÙÈÏÄÁ ÚÁ ÐÒÅÄÅÌÙ ÓÔÅËÁ"
+
+#: regexp.c:3258
+msgid "External submatches:\n"
+msgstr "÷ÎÅÛÎÉÅ ÐÏÄÓÏÏÔ×ÅÔÓÔ×ÉÑ:\n"
+
+#: screen.c:2184
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld ÓÔÒÏË × ÓËÌÁÄËÅ"
+
+#: screen.c:7996
+msgid " VREPLACE"
+msgstr " ÷éòôõáìøîáñ úáíåîá"
+
+#: screen.c:8000
+msgid " REPLACE"
+msgstr " úáíåîá"
+
+#: screen.c:8005
+msgid " REVERSE"
+msgstr " ïâòáôîáñ"
+
+#: screen.c:8007
+msgid " INSERT"
+msgstr " ÷óôá÷ëá"
+
+#: screen.c:8010
+msgid " (insert)"
+msgstr " (×ÓÔÁ×ËÁ)"
+
+#: screen.c:8012
+msgid " (replace)"
+msgstr " (ÚÁÍÅÎÁ)"
+
+#: screen.c:8014
+msgid " (vreplace)"
+msgstr " (×ÉÒÔÕÁÌØÎÁÑ ÚÁÍÅÎÁ)"
+
+#: screen.c:8017
+msgid " Hebrew"
+msgstr " é×ÒÉÔ"
+
+#: screen.c:8028
+msgid " Arabic"
+msgstr " áÒÁÂÓËÉÊ"
+
+#: screen.c:8031
+msgid " (lang)"
+msgstr " (ÑÚÙË)"
+
+#: screen.c:8035
+msgid " (paste)"
+msgstr " (×ËÌÅÊËÁ)"
+
+#: screen.c:8048
+msgid " VISUAL"
+msgstr " ÷éúõáìøîùê òåöéí"
+
+#: screen.c:8049
+msgid " VISUAL LINE"
+msgstr " ÷éúõáìøîáñ óôòïëá"
+
+#: screen.c:8050
+msgid " VISUAL BLOCK"
+msgstr " ÷éúõáìøîùê âìïë"
+
+#: screen.c:8051
+msgid " SELECT"
+msgstr " ÷ùäåìåîéå"
+
+#: screen.c:8052
+msgid " SELECT LINE"
+msgstr " ÷ùäåìåîéå óôòïëé"
+
+#: screen.c:8053
+msgid " SELECT BLOCK"
+msgstr " ÷ùäåìåîéå âìïëá"
+
+#: screen.c:8068 screen.c:8131
+msgid "recording"
+msgstr "ÚÁÐÉÓØ"
+
+#: search.c:37
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ÐÏÉÓË ÂÕÄÅÔ ÐÒÏÄÏÌÖÅÎ Ó ëïîãá ÄÏËÕÍÅÎÔÁ"
+
+#: search.c:38
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "ÐÏÉÓË ÂÕÄÅÔ ÐÒÏÄÏÌÖÅÎ Ó îáþáìá ÄÏËÕÍÅÎÔÁ"
+
+#: search.c:526
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: îÅÐÒÁ×ÉÌØÎÁÑ ÓÔÒÏËÁ ÐÏÉÓËÁ: %s"
+
+#: search.c:853
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ÐÏÉÓË ÚÁËÏÎÞÅÎ × îáþáìå ÄÏËÕÍÅÎÔÁ; %s ÎÅ ÎÁÊÄÅÎÏ"
+
+#: search.c:856
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ÐÏÉÓË ÚÁËÏÎÞÅÎ × ëïîãå ÄÏËÕÍÅÎÔÁ; %s ÎÅ ÎÁÊÄÅÎÏ"
+
+#: search.c:1249
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ðÏÓÌÅ ';' ÏÖÉÄÁÅÔÓÑ ××ÏÄ '?' ÉÌÉ '/'"
+
+#: search.c:3759
+msgid " (includes previously listed match)"
+msgstr " (×ËÌÀÞÁÅÔ ÒÁÎÎÅÅ ÐÏËÁÚÁÎÎÙÅ ÓÏÏÔ×ÅÔÓÔ×ÉÑ)"
+
+#. cursor at status line
+#: search.c:3779
+msgid "--- Included files "
+msgstr "--- ÷ËÌÀÞ£ÎÎÙÅ ÆÁÊÌÙ "
+
+#: search.c:3781
+msgid "not found "
+msgstr "ÎÅ ÎÁÊÄÅÎÏ "
+
+#: search.c:3782
+msgid "in path ---\n"
+msgstr "ÐÏ ÐÕÔÉ ---\n"
+
+#: search.c:3839
+msgid " (Already listed)"
+msgstr " (õÖÅ ÐÏËÁÚÁÎÏ)"
+
+#: search.c:3841
+msgid " NOT FOUND"
+msgstr " îå îáêäåîï"
+
+#: search.c:3893
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "ðÒÏÓÍÏÔÒ ×ËÌÀÞ£ÎÎÙÈ ÆÁÊÌÏ×: %s"
+
+#: search.c:4111
+msgid "E387: Match is on current line"
+msgstr "E387: óÏÏÔ×ÅÔÓÔ×ÉÅ × ÔÅËÕÝÅÊ ÓÔÒÏËÅ"
+
+#: search.c:4254
+msgid "All included files were found"
+msgstr "îÁÊÄÅÎÙ ×ÓÅ ×ËÌÀÞ£ÎÎÙÅ ÆÁÊÌÙ"
+
+#: search.c:4256
+msgid "No included files"
+msgstr "÷ËÌÀÞ£ÎÎÙÈ ÆÁÊÌÏ× ÎÅÔ"
+
+#: search.c:4272
+msgid "E388: Couldn't find definition"
+msgstr "E388: ïÐÒÅÄÅÌÅÎÉÅ ÎÅ ÎÁÊÄÅÎÏ"
+
+#: search.c:4274
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ûÁÂÌÏÎ ÎÅ ÎÁÊÄÅÎ"
+
+#: syntax.c:3050
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: îÅÄÏÐÕÓÔÉÍÙÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:3230
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: óÉÎÔÁËÓÉÞÅÓËÉÊ ËÌÁÓÔÅÒ %s ÎÅ ÎÁÊÄÅÎ"
+
+#: syntax.c:3394
+msgid "No Syntax items defined for this buffer"
+msgstr "óÉÎÔÁËÓÉÞÅÓËÉÅ ÜÌÅÍÅÎÔÙ ÄÌÑ ÄÁÎÎÏÇÏ ÂÕÆÅÒÁ ÎÅ ÏÐÒÅÄÅÌÅÎÙ"
+
+#: syntax.c:3402
+msgid "syncing on C-style comments"
+msgstr "óÉÎÈÒÏÎÉÚÁÃÉÑ ÐÏ ËÏÍÍÅÎÔÁÒÉÑÍ × ÓÔÉÌÅ ÑÚÙËÁ C"
+
+#: syntax.c:3410
+msgid "no syncing"
+msgstr "ÂÅÚ ÓÉÎÈÒÏÎÉÚÁÃÉÉ"
+
+#: syntax.c:3413
+msgid "syncing starts "
+msgstr "ÓÉÎÈÒÏÎÉÚÁÃÉÑ ÎÁÞÁÔÁ "
+
+#: syntax.c:3415 syntax.c:3490
+msgid " lines before top line"
+msgstr " ÓÔÒÏË ÐÅÒÅÄ ×ÅÒÈÎÅÊ ÓÔÒÏËÏÊ"
+
+#: syntax.c:3420
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- üÌÅÍÅÎÔÙ ÓÉÎÈÒÏÎÉÚÁÃÉÉ ÓÉÎÔÁËÓÉÓÁ ---"
+
+#: syntax.c:3425
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"ÓÉÎÈÒÏÎÉÚÁÃÉÑ ÐÏ ÜÌÅÍÅÎÔÁÍ"
+
+#: syntax.c:3431
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- óÉÎÔÁËÓÉÞÅÓËÉÅ ÜÌÅÍÅÎÔÙ ---"
+
+#: syntax.c:3454
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: óÉÎÔÁËÓÉÞÅÓËÉÊ ËÌÁÓÔÅÒ %s ÎÅ ÎÁÊÄÅÎ"
+
+#: syntax.c:3480
+msgid "minimal "
+msgstr "ÍÉÎÉÍÕÍ "
+
+#: syntax.c:3487
+msgid "maximal "
+msgstr "ÍÁËÓÉÍÕÍ "
+
+#: syntax.c:3499
+msgid "; match "
+msgstr "; ÓÏÏÔ×ÅÔÓÔ×ÉÅ "
+
+#: syntax.c:3501
+msgid " line breaks"
+msgstr " ÐÅÒÅÎÏÓÏ× ÓÔÒÏË"
+
+#: syntax.c:4135
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ÚÄÅÓØ ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ group[t]here"
+
+#: syntax.c:4159
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: üÌÅÍÅÎÔ ÏÂÌÁÓÔÉ ÄÌÑ %s ÎÅ ÎÁÊÄÅÎ"
+
+#: syntax.c:4187
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ÚÄÅÓØ ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÁÒÇÕÍÅÎÔ contains"
+
+#: syntax.c:4198
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ÚÄÅÓØ ÎÅÌØÚÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÁÒÇÕÍÅÎÔ containedin"
+
+#: syntax.c:4276
+msgid "E397: Filename required"
+msgstr "E397: ôÒÅÂÕÅÔÓÑ ÕËÁÚÁÔØ ÉÍÑ ÆÁÊÌÁ"
+
+#: syntax.c:4614
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: ðÒÏÐÕÝÅÎÏ '=': %s"
+
+#: syntax.c:4772
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: îÅ È×ÁÔÁÅÔ ÁÒÇÕÍÅÎÔÏ×: ÓÉÎÔÁËÓÉÞÅÓËÉÊ ÒÅÇÉÏÎ %s"
+
+#: syntax.c:5103
+msgid "E400: No cluster specified"
+msgstr "E400: ëÌÁÓÔÅÒ ÎÅ ÕËÁÚÁÎ"
+
+#: syntax.c:5140
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: îÅ ÎÁÊÄÅÎ ÒÁÚÄÅÌÉÔÅÌØ ÛÁÂÌÏÎÏ×: %s"
+
+#: syntax.c:5215
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: íÕÓÏÒ ÐÏÓÌÅ ÛÁÂÌÏÎÁ: %s"
+
+#: syntax.c:5305
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr ""
+"E403: ÓÉÎÈÒÏÎÉÚÁÃÉÑ ÓÉÎÔÁËÓÉÓÁ: ÛÁÂÌÏÎ ÐÒÏÄÏÌÖÅÎÉÊ ÓÔÒÏËÉ ÕËÁÚÁÎ Ä×ÁÖÄÙ"
+
+#: syntax.c:5362
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: îÅÄÏÐÕÓÔÉÍÙÅ ÁÒÇÕÍÅÎÔÙ: %s"
+
+#: syntax.c:5412
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: ðÒÏÐÕÝÅÎ ÚÎÁË ÒÁ×ÅÎÓÔ×Á: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ðÕÓÔÏÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:5445
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ÎÅ ÄÏÐÕÓËÁÅÔÓÑ × ÜÔÏÍ ÍÅÓÔÅ"
+
+#: syntax.c:5452
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ÄÏÌÖÎÏ ÂÙÔØ ÐÅÒ×ÙÍ × ÓÐÉÓËÅ contains"
+
+#: syntax.c:5522
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: îÅÉÚ×ÅÓÔÎÁÑ ÇÒÕÐÐÁ: %s"
+
+#: syntax.c:5755
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: îÅÐÒÁ×ÉÌØÎÁÑ ÐÏÄËÏÍÁÎÄÁ :syntax: %s"
+
+#: syntax.c:6136
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ÇÒÕÐÐÁ ÐÏÄÓ×ÅÔËÉ ÓÉÎÔÁËÓÉÓÁ %s ÎÅ ÎÁÊÄÅÎÁ"
+
+#: syntax.c:6160
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: îÅ È×ÁÔÁÅÔ ÁÒÇÕÍÅÎÔÏ×: \":highlight link %s\""
+
+#: syntax.c:6167
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: óÌÉÛËÏÍ ÍÎÏÇÏ ÁÒÇÕÍÅÎÔÏ×: \":highlight link %s\""
+
+#: syntax.c:6187
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: Õ ÇÒÕÐÐÙ ÅÓÔØ ÓÏÂÓÔ×ÅÎÎÙÅ ÎÁÓÔÒÏÊËÉ, ÓÓÙÌËÁ ÉÇÎÏÒÉÒÕÅÔÓÑ"
+
+#: syntax.c:6316
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ÎÅÏÖÉÄÁÎÎÙÊ ÚÎÁË ÒÁ×ÅÎÓÔ×Á: %s"
+
+#: syntax.c:6352
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ÐÒÏÐÕÝÅÎ ÚÎÁË ÒÁ×ÅÎÓÔ×Á: %s"
+
+#: syntax.c:6380
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ÐÒÏÐÕÝÅÎ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:6417
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: îÅÄÏÐÕÓÔÉÍÏÅ ÚÎÁÞÅÎÉÅ: %s"
+
+#: syntax.c:6536
+msgid "E419: FG color unknown"
+msgstr "E419: îÅÉÚ×ÅÓÔÎÙÊ Ã×ÅÔ ÔÅËÓÔÁ"
+
+#: syntax.c:6547
+msgid "E420: BG color unknown"
+msgstr "E420: îÅÉÚ×ÅÓÔÎÙÊ Ã×ÅÔ ÆÏÎÁ"
+
+#: syntax.c:6608
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: éÍÑ ÉÌÉ ÎÏÍÅÒ Ã×ÅÔÁ ÎÅ ÉÚ×ÅÓÔÎÏ: %s"
+
+#: syntax.c:6814
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: ÓÌÉÛËÏÍ ÄÌÉÎÎÙÊ ËÏÄ ÔÅÒÍÉÎÁÌÁ: %s"
+
+#: syntax.c:6861
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: îÅÄÏÐÕÓÔÉÍÙÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:7390
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: éÓÐÏÌØÚÕÅÔÓÑ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÒÁÚÎÙÈ ÁÔÒÉÂÕÔÏ× ÐÏÄÓ×ÅÔËÉ ÓÉÎÔÁËÓÉÓÁ"
+
+#: syntax.c:7911
+msgid "E669: Unprintable character in group name"
+msgstr "E669: îÅÐÅÞÁÔÎÙÊ ÓÉÍ×ÏÌ × ÉÍÅÎÉ ÇÒÕÐÐÙ"
+
+#. This is an error, but since there previously was no check only
+#. * give a warning.
+#: syntax.c:7918
+msgid "W18: Invalid character in group name"
+msgstr "W18: îÅÄÏÐÕÓÔÉÍÙÊ ÓÉÍ×ÏÌ × ÉÍÅÎÉ ÇÒÕÐÐÙ"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: ×ÎÉÚÕ ÓÔÅËÁ ÍÅÔÏË"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: ÎÁ×ÅÒÈÕ ÓÔÅËÁ ÍÅÔÏË"
+
+#: tag.c:412
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ÐÏÚÉÃÉÀ ÄÏ ÐÅÒ×ÏÊ ÓÏ×ÐÁÄÁÀÝÅÊ ÍÅÔËÉ"
+
+#: tag.c:550
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: íÅÔËÁ ÎÅ ÎÁÊÄÅÎÁ: %s"
+
+#: tag.c:583
+msgid " # pri kind tag"
+msgstr " # ÐÒÉ ÔÉÐ ÍÅÔËÁ"
+
+#: tag.c:586
+msgid "file\n"
+msgstr "ÆÁÊÌ\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:744
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "÷ÙÂÅÒÉÔÅ ÎÕÖÎÙÊ ÎÏÍÅÒ (<CR> ÄÌÑ ÏÔËÁÚÁ):"
+
+#: tag.c:784
+msgid "E427: There is only one matching tag"
+msgstr "E427: åÓÔØ ÔÏÌØËÏ ÏÄÎÁ ÓÏ×ÐÁÄÁÀÝÁÑ ÍÅÔËÁ"
+
+#: tag.c:786
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: îÅ×ÏÚÍÏÖÎÏ ÐÅÒÅÊÔÉ × ÐÏÚÉÃÉÀ ÚÁ ÐÏÓÌÅÄÎÅÊ ÓÏ×ÐÁÄÁÀÝÅÊ ÍÅÔËÏÊ"
+
+#: tag.c:810
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "æÁÊÌ \"%s\" ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#. Give an indication of the number of matching tags
+#: tag.c:823
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ÍÅÔËÁ %d ÉÚ %d%s"
+
+#: tag.c:826
+msgid " or more"
+msgstr " É ÂÏÌÅÅ"
+
+#: tag.c:828
+msgid " Using tag with different case!"
+msgstr " éÓÐÏÌØÚÕÅÔÓÑ ÍÅÔËÁ Ó ÓÉÍ×ÏÌÁÍÉ × ÄÒÕÇÏÍ ÒÅÇÉÓÔÒÅ!"
+
+#: tag.c:872
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: æÁÊÌ \"%s\" ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#. Highlight title
+#: tag.c:941
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # ë ÍÅÔËÅ ïô ÓÔÒ. × ÆÁÊÌÅ/ÔÅËÓÔÅ"
+
+#: tag.c:1363
+#, c-format
+msgid "Searching tags file %s"
+msgstr "ðÏÉÓË × ÆÁÊÌÅ ÍÅÔÏË %s"
+
+#: tag.c:1550
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: ðÕÔØ Ë ÆÁÊÌÕ ÍÅÔÏË %s ÏÂÒÅÚÁÎ\n"
+
+#: tag.c:2203
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: ïÛÉÂËÁ ÆÏÒÍÁÔÁ × ÆÁÊÌÅ ÍÅÔÏË \"%s\""
+
+#: tag.c:2207
+#, c-format
+msgid "Before byte %ld"
+msgstr "ðÅÒÅÄ ÂÁÊÔÏÍ %ld"
+
+#: tag.c:2240
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: æÁÊÌ ÍÅÔÏË ÎÅ ÏÔÓÏÒÔÉÒÏ×ÁÎ: %s"
+
+#. never opened any tags file
+#: tag.c:2280
+msgid "E433: No tags file"
+msgstr "E433: æÁÊÌ ÍÅÔÏË ÎÅ ÏÂÎÁÒÕÖÅÎ"
+
+#: tag.c:3016
+msgid "E434: Can't find tag pattern"
+msgstr "E434: îÅ ÎÁÊÄÅÎ ÛÁÂÌÏÎ ÍÅÔËÉ"
+
+#: tag.c:3027
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: íÅÔËÁ ÎÅ ÎÁÊÄÅÎÁ, ÐÙÔÁÅÍÓÑ ÕÇÁÄÁÔØ!"
+
+#: term.c:1759
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ÎÅ ÉÚ×ÅÓÔÅÎ. äÏÓÔÕÐÎÙ ×ÓÔÒÏÅÎÎÙÅ ÔÅÒÍÉÎÁÌÙ:"
+
+#: term.c:1783
+msgid "defaulting to '"
+msgstr "ÐÏ ÕÍÏÌÞÁÎÉÀ '"
+
+#: term.c:2141
+msgid "E557: Cannot open termcap file"
+msgstr "E557: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ termcap"
+
+#: term.c:2145
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: ÷ terminfo ÎÅÔ ÚÁÐÉÓÉ ÏÂ ÜÔÏÍ ÔÅÒÍÉÎÁÌÅ"
+
+#: term.c:2147
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: ÷ termcap ÎÅÔ ÚÁÐÉÓÉ ÏÂ ÜÔÏÍ ÔÅÒÍÉÎÁÌÅ"
+
+#: term.c:2306
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: ÷ termcap ÎÅÔ ÚÁÐÉÓÉ \"%s\""
+
+#: term.c:2780
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ÔÒÅÂÕÅÔÓÑ ÓÐÏÓÏÂÎÏÓÔØ ÔÅÒÍÉÎÁÌÁ \"cm\""
+
+#. Highlight title
+#: term.c:4990
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- ëÎÏÐËÉ ÔÅÒÍÉÎÁÌÁ ---"
+
+#: ui.c:258
+msgid "new shell started\n"
+msgstr "ÚÁÐÕÓË ÎÏ×ÏÊ ÏÂÏÌÏÞËÉ\n"
+
+#: ui.c:1841
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: ïÛÉÂËÁ ÞÔÅÎÉÑ ××ÏÄÁ, ×ÙÈÏÄ...\n"
+
+#. must display the prompt
+#: undo.c:405
+msgid "No undo possible; continue anyway"
+msgstr "ïÔÍÅÎÁ ÎÅ×ÏÚÍÏÖÎÁ; ÐÒÏÄÏÌÖÁÔØ ×ÙÐÏÌÎÅÎÉÅ"
+
+#: undo.c:561
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ÎÅÐÒÁ×ÉÌØÎÙÅ ÎÏÍÅÒÁ ÓÔÒÏË"
+
+#: undo.c:757
+msgid "1 change"
+msgstr "åÄÉÎÓÔ×ÅÎÎÏÅ ÉÚÍÅÎÅÎÉÅ"
+
+#: undo.c:759
+#, c-format
+msgid "%ld changes"
+msgstr "éÚÍÅÎÅÎÉÊ: %ld"
+
+#: undo.c:812
+msgid "E439: undo list corrupt"
+msgstr "E439: ðÏ×ÒÅÖģΠÓÐÉÓÏË ÏÔÍÅÎÙ"
+
+#: undo.c:844
+msgid "E440: undo line missing"
+msgstr "E440: ÐÏÔÅÒÑÎÁ ÓÔÒÏËÁ ÏÔÍÅÎÙ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:721
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ ÄÌÑ MS-Windows 16/32 ÂÉÔ"
+
+#: version.c:723
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ ÄÌÑ MS-Windows 32 ÂÉÔ"
+
+#: version.c:726
+msgid " in Win32s mode"
+msgstr " × ÒÅÖÉÍÅ Win32s"
+
+#: version.c:728
+msgid " with OLE support"
+msgstr " Ó ÐÏÄÄÅÒÖËÏÊ OLE"
+
+#: version.c:731
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"ëÏÎÓÏÌØÎÁÑ ×ÅÒÓÉÑ ÄÌÑ MS-Windows 32 ÂÉÔ"
+
+#: version.c:735
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MS-Windows 16 ÂÉÔ"
+
+#: version.c:739
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MS-DOS 32 ÂÉÔ"
+
+#: version.c:741
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MS-DOS 16 ÂÉÔ"
+
+#: version.c:747
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MacOS X (unix)"
+
+#: version.c:749
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MacOS X"
+
+#: version.c:752
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ MacOS"
+
+#: version.c:757
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ ÄÌÑ RISC OS"
+
+#: version.c:767
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"úÁÐÌÁÔËÉ: "
+
+#: version.c:793 version.c:1161
+msgid "Modified by "
+msgstr "ó ÉÚÍÅÎÅÎÉÑÍÉ, ×ÎÅÓ£ÎÎÙÍÉ "
+
+#: version.c:800
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"óËÏÍÐÉÌÉÒÏ×ÁÎ "
+
+#: version.c:803
+msgid "by "
+msgstr " "
+
+#: version.c:815
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"ïÇÒÏÍÎÁÑ ×ÅÒÓÉÑ "
+
+#: version.c:818
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"âÏÌØÛÁÑ ×ÅÒÓÉÑ "
+
+#: version.c:821
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"ïÂÙÞÎÁÑ ×ÅÒÓÉÑ "
+
+#: version.c:824
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"íÁÌÁÑ ×ÅÒÓÉÑ "
+
+#: version.c:826
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"÷ÅÒÓÉÑ \"ëÒÏÈÁ\" "
+
+#: version.c:832
+msgid "without GUI."
+msgstr "ÂÅÚ ÇÒÁÆÉÞÅÓËÏÇÏ ÉÎÔÅÒÆÅÊÓÁ."
+
+#: version.c:837
+msgid "with GTK2-GNOME GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ GTK2-GNOME."
+
+#: version.c:839
+msgid "with GTK-GNOME GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ GTK-GNOME."
+
+#: version.c:843
+msgid "with GTK2 GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ GTK2."
+
+#: version.c:845
+msgid "with GTK GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ GTK."
+
+#: version.c:850
+msgid "with X11-Motif GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ X11-Motif."
+
+#: version.c:854
+msgid "with X11-neXtaw GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ X11-neXtaw."
+
+#: version.c:856
+msgid "with X11-Athena GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ X11-Athena."
+
+#: version.c:860
+msgid "with BeOS GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ BeOS."
+
+#: version.c:863
+msgid "with Photon GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ Photon."
+
+#: version.c:866
+msgid "with GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ."
+
+#: version.c:869
+msgid "with Carbon GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ Carbon."
+
+#: version.c:872
+msgid "with Cocoa GUI."
+msgstr "Ó ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ Cocoa."
+
+#: version.c:875
+msgid "with (classic) GUI."
+msgstr "Ó ËÌÁÓÓÉÞÅÓËÉÍ ÇÒÁÆÉÞÅÓËÉÍ ÉÎÔÅÒÆÅÊÓÏÍ."
+
+#: version.c:886
+msgid " Features included (+) or not (-):\n"
+msgstr " ÷ËÌÀÞ£ÎÎÙÅ (+) É ÏÔËÌÀÞ£ÎÎÙÅ (-) ÏÓÏÂÅÎÎÏÓÔÉ:\n"
+
+#: version.c:898
+msgid " system vimrc file: \""
+msgstr " ÏÂÝÅÓÉÓÔÅÍÎÙÊ ÆÁÊÌ vimrc: \""
+
+#: version.c:903
+msgid " user vimrc file: \""
+msgstr " ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ vimrc: \""
+
+#: version.c:908
+msgid " 2nd user vimrc file: \""
+msgstr " ×ÔÏÒÏÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ vimrc: \""
+
+#: version.c:913
+msgid " 3rd user vimrc file: \""
+msgstr " ÔÒÅÔÉÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ vimrc: \""
+
+#: version.c:918
+msgid " user exrc file: \""
+msgstr " ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ exrc: \""
+
+#: version.c:923
+msgid " 2nd user exrc file: \""
+msgstr " ×ÔÏÒÏÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ exrc: \""
+
+#: version.c:929
+msgid " system gvimrc file: \""
+msgstr " ÏÂÝÅÓÉÓÔÅÍÎÙÊ ÆÁÊÌ gvimrc: \""
+
+#: version.c:933
+msgid " user gvimrc file: \""
+msgstr " ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ gvimrc: \""
+
+#: version.c:937
+msgid "2nd user gvimrc file: \""
+msgstr " ×ÔÏÒÏÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ gvimrc: \""
+
+#: version.c:942
+msgid "3rd user gvimrc file: \""
+msgstr " ÔÒÅÔÉÊ ÐÏÌØÚÏ×ÁÔÅÌØÓËÉÊ ÆÁÊÌ gvimrc: \""
+
+#: version.c:949
+msgid " system menu file: \""
+msgstr " ÏÂÝÅÓÉÓÔÅÍÎÙÊ ÆÁÊÌ ÍÅÎÀ: \""
+
+#: version.c:957
+msgid " fall-back for $VIM: \""
+msgstr " ÚÎÁÞÅÎÉÅ $VIM ÐÏ ÕÍÏÌÞÁÎÉÀ: \""
+
+#: version.c:963
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " ÚÎÁÞÅÎÉÅ $VIMRUNTIME ÐÏ ÕÍÏÌÞÁÎÉÀ: \""
+
+#: version.c:967
+msgid "Compilation: "
+msgstr "ðÁÒÁÍÅÔÒÙ ËÏÍÐÉÌÑÃÉÉ: "
+
+#: version.c:973
+msgid "Compiler: "
+msgstr "ëÏÍÐÉÌÑÔÏÒ: "
+
+#: version.c:978
+msgid "Linking: "
+msgstr "óÂÏÒËÁ: "
+
+#: version.c:983
+msgid " DEBUG BUILD"
+msgstr " ïôìáäïþîáñ óâïòëá"
+
+#: version.c:1022
+msgid "VIM - Vi IMproved"
+msgstr "VIM ::: Vi IMproved (õÌÕÞÛÅÎÎÙÊ Vi) ::: òÕÓÓËÁÑ ×ÅÒÓÉÑ"
+
+#: version.c:1024
+msgid "version "
+msgstr "×ÅÒÓÉÑ "
+
+#: version.c:1025
+msgid "by Bram Moolenaar et al."
+msgstr "âÒÁÍ íÏÏÌÅÎÁÁÒ É ÄÒÕÇÉÅ"
+
+#: version.c:1029
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ÜÔÏ Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÁÑ ÐÒÏÇÒÁÍÍÁ Ó ÏÔËÒÙÔÙÍ ËÏÄÏÍ"
+
+#: version.c:1031
+msgid "Help poor children in Uganda!"
+msgstr "âÅÄÎÙÍ ÄÅÔÑÍ × õÇÁÎÄÅ ÎÕÖÎÁ ×ÁÛÁ ÐÏÍÏÝØ!"
+
+#: version.c:1032
+msgid "type :help iccf<Enter> for information "
+msgstr "ÎÁÂÅÒÉÔÅ :help iccf<Enter> ÄÌÑ ÄÏÐÏÌÎÉÔÅÌØÎÏÊ ÉÎÆÏÒÍÁÃÉÉ"
+
+#: version.c:1034
+msgid "type :q<Enter> to exit "
+msgstr "ÎÁÂÅÒÉÔÅ :q<Enter> ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ ÐÒÏÇÒÁÍÍÙ "
+
+#: version.c:1035
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "ÎÁÂÅÒÉÔÅ :help<Enter> ÉÌÉ <F1> ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÓÐÒÁ×ËÉ "
+
+#: version.c:1036
+msgid "type :help version6<Enter> for version info"
+msgstr "ÎÁÂÅÒÉÔÅ :help version6<Enter> ÞÔÏÂÙ ÕÚÎÁÔØ Ï ÜÔÏÊ ×ÅÒÓÉÉ "
+
+#: version.c:1039
+msgid "Running in Vi compatible mode"
+msgstr "òÁÂÏÔÁ × Vi-ÓÏ×ÍÅÓÔÉÍÏÍ ÒÅÖÉÍÅ"
+
+#: version.c:1040
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "ÎÁÂÅÒÉÔÅ :set nocp<Enter> ÄÌÑ ÐÅÒÅÈÏÄÁ × ÒÅÖÉÍ Vim "
+
+#: version.c:1041
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "ÎÁÂÅÒÉÔÅ :help cp-default<Enter> ÄÌÑ ÄÏÐÏÌÎÉÔÅÌØÎÏÊ ÉÎÆÏÒÍÁÃÉÉ"
+
+#: version.c:1056
+msgid "menu Help->Orphans for information "
+msgstr "ÍÅÎÀ óÐÒÁ×ËÁ->óÉÒÏÔÙ ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ "
+
+#: version.c:1058
+msgid "Running modeless, typed text is inserted"
+msgstr "âÅÚÒÅÖÉÍÎÁÑ ÒÁÂÏÔÙ, ×ÓÔÁ×ËÁ ××ÅÄ£ÎÎÏÇÏ ÔÅËÓÔÁ"
+
+#: version.c:1059
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "ÍÅÎÀ ðÒÁ×ËÁ->ïÂÝÉÅ îÁÓÔÒÏÊËÉ->òÅÖÉÍ ÷ÓÔÁ×ËÉ "
+
+#: version.c:1060
+msgid " for two modes "
+msgstr " ÄÌÑ Ä×ÕÈ ÒÅÖÉÍÏ× "
+
+#: version.c:1064
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "ÍÅÎÀ ðÒÁ×ËÁ->ïÂÝÉÅ îÁÓÔÒÏÊËÉ->óÏ×ÍÅÓÔÉÍÏÓÔØ Ó Vi "
+
+#: version.c:1065
+msgid " for Vim defaults "
+msgstr " ÄÌÑ ÐÅÒÅÈÏÄÁ × ÒÅÖÉÍ Vim "
+
+#: version.c:1112
+msgid "Sponsor Vim development!"
+msgstr "ðÏÍÏÇÉÔÅ × ÒÁÚÒÁÂÏÔËÅ Vim!"
+
+#: version.c:1113
+msgid "Become a registered Vim user!"
+msgstr "óÔÁÎØÔÅ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÎÎÙÍ ÐÏÌØÚÏ×ÁÔÅÌÅÍ Vim!"
+
+#: version.c:1116
+msgid "type :help sponsor<Enter> for information "
+msgstr "ÎÁÂÅÒÉÔÅ :help sponsor<Enter> ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ "
+
+#: version.c:1117
+msgid "type :help register<Enter> for information "
+msgstr "ÎÁÂÅÒÉÔÅ :help register<Enter> ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ "
+
+#: version.c:1119
+msgid "menu Help->Sponsor/Register for information "
+msgstr "ÍÅÎÀ óÐÒÁ×ËÁ->ðÏÍÏÝØ/òÅÇÉÓÔÒÁÃÉÑ ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ "
+
+#: version.c:1129
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ðòåäõðòåöäåîéå: ÏÂÎÁÒÕÖÅÎÁ Windows 95/98/ME"
+
+#: version.c:1132
+msgid "type :help windows95<Enter> for info on this"
+msgstr "ÎÁÂÅÒÉÔÅ :help windows95<Enter> ÄÌÑ ÐÏÌÕÞÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ "
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: ïËÎÏ ÐÒÅÄÐÒÏÓÍÏÔÒÁ ÏÔÓÕÔÓÔ×ÕÅÔ"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ïËÎÏ ÎÅ ÍÏÖÅÔ ÂÙÔØ ÏÄÎÏ×ÒÅÍÅÎÎÏ ÓÌÅ×Á ××ÅÒÈÕ É ÓÐÒÁ×Á ×ÎÉÚÕ"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: îÅ×ÏÚÍÏÖÎÏ ÐÏÍÅÎÑÔØ ÍÅÓÔÁÍÉ, ÐÏËÁ ÄÒÕÇÏÅ ÏËÎÏ ÒÁÚÄÅÌÅÎÏ"
+
+#: window.c:1836
+msgid "E444: Cannot close last window"
+msgstr "E444: îÅÌØÚÑ ÚÁËÒÙÔØ ÐÏÓÌÅÄÎÅÅ ÏËÎÏ"
+
+#: window.c:2567
+msgid "Already only one window"
+msgstr "îÁ ÜËÒÁÎÅ ×ÓÅÇÏ ÏÄÎÏ ÏËÎÏ"
+
+#: window.c:2614
+msgid "E445: Other window contains changes"
+msgstr "E445: ÷ ÄÒÕÇÏÍ ÏËÎÅ ÅÓÔØ ÎÅÓÏÈÒÁΣÎÎÙÅ ÉÚÍÅÎÅÎÉÑ"
+
+#: window.c:4480
+msgid "E446: No file name under cursor"
+msgstr "E446: îÅÔ ÉÍÅÎÉ ÆÁÊÌÁ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ"
+
+#: window.c:4599
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: æÁÊÌ \"%s\" ÎÅ ÎÁÊÄÅÎ ÐÏ ÉÚ×ÅÓÔÎÙÍ ÐÕÔÑÍ"
+
+#: if_perl.xs:326 globals.h:1232
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: îÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÂÉÂÌÉÏÔÅËÕ %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"éÚ×ÉÎÉÔÅ, ÄÁÎÎÁÑ ËÏÍÁÎÄÁ ÏÔËÌÀÞÅÎÁ: ÎÅ×ÏÚÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ÂÉÂÌÉÏÔÅËÕ Perl"
+
+#: if_perl.xs:607
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr ""
+"E299: îÅ ÄÏÐÕÓËÁÅÔÓÑ ×ÙÞÉÓÌÅÎÉÅ Perl × ÐÅÓÏÞÎÉÃÅ ÂÅÚ ÍÏÄÕÌÑ ÂÅÚÏÐÁÓÎÏÓÔÉ"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÔØ × &ÒÁÚÎÙÈ Vim-ÁÈ"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÔØ × &ÏÄÎÏÍ Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&óÒÁ×ÎÉÔØ Ó ÐÏÍÏÝØÀ Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "òÅ&ÄÁËÔÉÒÏ×ÁÔØ Ó ÐÏÍÏÝØÀ Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÔØ × ÚÁÐÕÝÅÎÎÏÍ Vim - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "òÅÄÁËÔÉÒÏ×ÁÔØ ×ÙÄÅÌÅÎÎÙÅ ÆÁÊÌÙ Ó ÐÏÍÏÝØÀ Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ÐÒÏÃÅÓÓÁ: ÐÒÏ×ÅÒØÔÅ ÄÏÓÔÕÐÎÏÓÔØ gvim × ÐÕÔÉ!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "ÏÛÉÂËÁ gvimext.dll"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "óÌÉÛËÏÍ ÄÌÉÎÎÙÊ ÐÕÔØ!"
+
+#: globals.h:1022
+msgid "--No lines in buffer--"
+msgstr "-- îÅÔ ÓÔÒÏË × ÂÕÆÅÒÅ --"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1185
+msgid "E470: Command aborted"
+msgstr "E470: ÷ÙÐÏÌÎÅÎÉÅ ËÏÍÁÎÄÙ ÐÒÅÒ×ÁÎÏ"
+
+#: globals.h:1186
+msgid "E471: Argument required"
+msgstr "E471: ôÒÅÂÕÅÔÓÑ ÕËÁÚÁÔØ ÐÁÒÁÍÅÔÒ"
+
+#: globals.h:1187
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: ðÏÓÌÅ \\ ÄÏÌÖÅÎ ÉÄÔÉ ÓÉÍ×ÏÌ /, ? ÉÌÉ &"
+
+#: globals.h:1189
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: îÅÄÏÐÕÓÔÉÍÏ × ÏËÎÅ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ; <CR> ×ÙÐÏÌÎÅÎÉÅ, CTRL-C ×ÙÈÏÄ"
+
+#: globals.h:1191
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: ëÏÍÁÎÄÁ ÎÅ ÄÏÐÕÓËÁÅÔÓÑ × exrc/vimrc × ÔÅËÕÝÅÍ ËÁÔÁÌÏÇÅ ÉÌÉ ÐÏÉÓËÅ ÍÅÔÏË"
+
+#: globals.h:1193
+msgid "E171: Missing :endif"
+msgstr "E171: ïÔÓÕÔÓÔ×ÕÅÔ ËÏÍÁÎÄÁ :endif"
+
+#: globals.h:1194
+msgid "E600: Missing :endtry"
+msgstr "E600: ïÔÓÕÔÓÔ×ÕÅÔ ËÏÍÁÎÄÁ :endtry"
+
+#: globals.h:1195
+msgid "E170: Missing :endwhile"
+msgstr "E170: ïÔÓÕÔÓÔ×ÕÅÔ ËÏÍÁÎÄÁ :endwhile"
+
+#: globals.h:1196
+msgid "E588: :endwhile without :while"
+msgstr "E588: ëÏÍÁÎÄÁ :endwhile ÂÅÚ ÐÁÒÎÏÊ ËÏÍÁÎÄÙ :while"
+
+#: globals.h:1198
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: æÁÊÌ ÓÕÝÅÓÔ×ÕÅÔ (ÄÌÑ ÐÅÒÅÚÁÐÉÓÉ ÄÏÂÁ×ØÔÅ !)"
+
+#: globals.h:1199
+msgid "E472: Command failed"
+msgstr "E472: îÅ ÕÄÁÌÏÓØ ×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ"
+
+#: globals.h:1201
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: îÅÉÚ×ÅÓÔÎÙÊ ÛÒÉÆÔÏ×ÏÊ ÎÁÂÏÒ: %s"
+
+#: globals.h:1205
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: îÅÉÚ×ÅÓÔÎÙÊ ÛÒÉÆÔ: %s"
+
+#: globals.h:1208
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: ûÒÉÆÔ \"%s\" ÎÅ Ñ×ÌÑÅÔÓÑ ÍÏÎÏÛÉÒÉÎÎÙÍ ÛÒÉÆÔÏÍ"
+
+#: globals.h:1210
+msgid "E473: Internal error"
+msgstr "E473: ÷ÎÕÔÒÅÎÎÑÑ ÏÛÉÂËÁ"
+
+#: globals.h:1211
+msgid "Interrupted"
+msgstr "ðÒÅÒ×ÁÎÏ"
+
+#: globals.h:1212
+msgid "E14: Invalid address"
+msgstr "E14: îÅÄÏÐÕÓÔÉÍÙÊ ÁÄÒÅÓ"
+
+#: globals.h:1213
+msgid "E474: Invalid argument"
+msgstr "E474: îÅÄÏÐÕÓÔÉÍÙÊ ÁÒÇÕÍÅÎÔ"
+
+#: globals.h:1214
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: îÅÄÏÐÕÓÔÉÍÙÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: globals.h:1216
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: îÅÄÏÐÕÓÔÉÍÏÅ ×ÙÒÁÖÅÎÉÅ: %s"
+
+#: globals.h:1218
+msgid "E16: Invalid range"
+msgstr "E16: îÅÄÏÐÕÓÔÉÍÙÊ ÄÉÁÐÁÚÏÎ"
+
+#: globals.h:1219
+msgid "E476: Invalid command"
+msgstr "E476: îÅÄÏÐÕÓÔÉÍÁÑ ËÏÍÁÎÄÁ"
+
+#: globals.h:1221
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" Ñ×ÌÑÅÔÓÑ ËÁÔÁÌÏÇÏÍ"
+
+#: globals.h:1224
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: ðÅÒÅÄ '=' ÏÂÎÁÒÕÖÅÎÙ ÎÅÏÖÉÄÁÎÎÙÅ ÓÉÍ×ÏÌÙ"
+
+#: globals.h:1227
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: îÅÕÄÁÞÎÙÊ ×ÙÚÏ× ÆÕÎËÃÉÉ \"%s()\" ÉÚ ÂÉÂÌÉÏÔÅËÉ"
+
+#: globals.h:1233
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: îÅ ÕÄÁÌÏÓØ ÚÁÇÒÕÚÉÔØ ÆÕÎËÃÉÀ %s ÉÚ ÂÉÂÌÉÏÔÅËÉ"
+
+#: globals.h:1235
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ïÔÍÅÔËÁ ÕËÁÚÙ×ÁÅÔ ÎÁ ÎÅÐÒÁ×ÉÌØÎÙÊ ÎÏÍÅÒ ÓÔÒÏËÉ"
+
+#: globals.h:1236
+msgid "E20: Mark not set"
+msgstr "ïÔÍÅÔËÁ ÎÅ ÏÐÒÅÄÅÌÅÎÁ"
+
+#: globals.h:1237
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: éÚÍÅÎÅÎÉÑ ÎÅ×ÏÚÍÏÖÎÙ, ÔÁË ËÁË ÏÔËÌÀÞÅÎÁ ÏÐÃÉÑ 'modifiable'"
+
+#: globals.h:1238
+msgid "E22: Scripts nested too deep"
+msgstr "E22: óÌÉÛËÏÍ ÇÌÕÂÏËÏ ×ÌÏÖÅÎÎÙÅ ÓÃÅÎÁÒÉÉ"
+
+#: globals.h:1239
+msgid "E23: No alternate file"
+msgstr "E23: óÏÓÅÄÎÉÊ ÆÁÊÌ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: globals.h:1240
+msgid "E24: No such abbreviation"
+msgstr "E24: îÅÔ ÔÁËÏÇÏ ÓÏËÒÁÝÅÎÉÑ"
+
+#: globals.h:1241
+msgid "E477: No ! allowed"
+msgstr "E477: ! ÎÅ ÄÏÐÕÓËÁÅÔÓÑ"
+
+#: globals.h:1243
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr ""
+"E25: ÷ÏÚÍÏÖÎÏÓÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÑ ÇÒÁÆÉÞÅÓËÏÇÏ ÉÎÔÅÒÆÅÊÓÁ ×ÙËÌÀÞÅÎÁ ÐÒÉ "
+"ËÏÍÐÉÌÑÃÉÉ"
+
+#: globals.h:1246
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: é×ÒÉÔ ×ÙËÌÀÞÅÎ ÐÒÉ ËÏÍÐÉÌÑÃÉÉ\n"
+
+#: globals.h:1249
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: æÁÒÓÉ ×ÙËÌÀÞÅÎÏ ÐÒÉ ËÏÍÐÉÌÑÃÉÉ\n"
+
+#: globals.h:1252
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: áÒÁÂÓËÉÊ ×ÙËÌÀÞÅÎ ÐÒÉ ËÏÍÐÉÌÑÃÉÉ\n"
+
+#: globals.h:1255
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: çÒÕÐÐÁ ÐÏÄÓ×ÅÔËÉ ÓÉÎÔÁËÓÉÓÁ %s ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: globals.h:1257
+msgid "E29: No inserted text yet"
+msgstr "E29: ðÏËÁ ÎÅÔ ×ÓÔÁ×ÌÅÎÎÏÇÏ ÔÅËÓÔÁ"
+
+#: globals.h:1258
+msgid "E30: No previous command line"
+msgstr "E30: ðÒÅÄÙÄÕÝÅÊ ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ ÎÅÔ"
+
+#: globals.h:1259
+msgid "E31: No such mapping"
+msgstr "E31: ôÁËÏÊ ÐÒÉ×ÑÚËÉ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ"
+
+#: globals.h:1260
+msgid "E479: No match"
+msgstr "E479: îÅÔ ÓÏÏÔ×ÅÔÓÔ×ÉÑ"
+
+#: globals.h:1261
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: îÅÔ ÓÏÏÔ×ÅÔÓÔ×ÉÑ: %s"
+
+#: globals.h:1262
+msgid "E32: No file name"
+msgstr "E32: îÅÔ ÉÍÅÎÉ ÆÁÊÌÁ"
+
+#: globals.h:1263
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: îÅÔ ÐÒÅÄÙÄÕÝÅÇÏ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ ÄÌÑ ÚÁÍÅÎÙ"
+
+#: globals.h:1264
+msgid "E34: No previous command"
+msgstr "E34: îÅÔ ÐÒÅÄÙÄÕÝÅÊ ËÏÍÁÎÄÙ"
+
+#: globals.h:1265
+msgid "E35: No previous regular expression"
+msgstr "E35: îÅÔ ÐÒÅÄÙÄÕÝÅÇÏ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ"
+
+#: globals.h:1266
+msgid "E481: No range allowed"
+msgstr "E481: éÓÐÏÌØÚÏ×ÁÎÉÅ ÄÉÁÐÁÚÏÎÁ ÎÅ ÄÏÐÕÓËÁÅÔÓÑ"
+
+#: globals.h:1268
+msgid "E36: Not enough room"
+msgstr "E36: îÅÄÏÓÔÁÔÏÞÎÏ ÍÅÓÔÁ"
+
+#: globals.h:1271
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ÓÅÒ×ÅÒ \"%s\" ÎÅ ÚÁÒÅÇÉÓÔÒÉÒÏ×ÁÎ"
+
+#: globals.h:1273
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÆÁÊÌ %s"
+
+#: globals.h:1274
+msgid "E483: Can't get temp file name"
+msgstr "E483: îÅ×ÏÚÍÏÖÎÏ ÐÏÌÕÞÉÔØ ÉÍÑ ×ÒÅÍÅÎÎÏÇÏ ÆÁÊÌÁ"
+
+#: globals.h:1275
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÆÁÊÌ %s"
+
+#: globals.h:1276
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÆÁÊÌ %s"
+
+#: globals.h:1277
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: éÚÍÅÎÅÎÉÑ ÎÅ ÓÏÈÒÁÎÅÎÙ (ÄÏÂÁ×ØÔÅ !, ÞÔÏÂÙ ÏÂÏÊÔÉ ÐÒÏ×ÅÒËÕ)"
+
+#: globals.h:1278
+msgid "E38: Null argument"
+msgstr "E38: îÕÌÅ×ÏÊ ÁÒÇÕÍÅÎÔ"
+
+#: globals.h:1280
+msgid "E39: Number expected"
+msgstr "E39: ôÒÅÂÕÅÔÓÑ ÞÉÓÌÏ"
+
+#: globals.h:1283
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: îÅ ÕÄÁÌÏÓØ ÏÔËÒÙÔØ ÆÁÊÌ ÏÛÉÂÏË %s"
+
+#: globals.h:1286
+msgid "E233: cannot open display"
+msgstr "E233: ÎÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÄÉÓÐÌÅÊ"
+
+#: globals.h:1288
+msgid "E41: Out of memory!"
+msgstr "E41: îÅ È×ÁÔÁÅÔ ÐÁÍÑÔÉ!"
+
+#: globals.h:1290
+msgid "Pattern not found"
+msgstr "ûÁÂÌÏÎ ÎÅ ÎÁÊÄÅÎ"
+
+#: globals.h:1292
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: ûÁÂÌÏÎ ÎÅ ÎÁÊÄÅÎ: %s"
+
+#: globals.h:1293
+msgid "E487: Argument must be positive"
+msgstr "E487: ðÁÒÁÍÅÔÒ ÄÏÌÖÅÎ ÂÙÔØ ÐÏÌÏÖÉÔÅÌØÎÙÍ ÞÉÓÌÏÍ"
+
+#: globals.h:1295
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: ÷ÏÚ×ÒÁÔ × ÐÒÅÄÙÄÕÝÉÊ ËÁÔÁÌÏÇ ÎÅ×ÏÚÍÏÖÅÎ"
+
+#: globals.h:1299
+msgid "E42: No Errors"
+msgstr "E42: ïÛÉÂÏË ÎÅÔ"
+
+#: globals.h:1301
+msgid "E43: Damaged match string"
+msgstr "E43: ðÏ×ÒÅÖÄÅÎÁ ÓÔÒÏËÁ ÓÏÏÔ×ÅÔÓÔ×ÉÑ"
+
+#: globals.h:1302
+msgid "E44: Corrupted regexp program"
+msgstr "E44: ðÒÏÇÒÁÍÍÁ ÏÂÒÁÂÏÔËÉ ÒÅÇÕÌÑÒÎÙÈ ×ÙÒÁÖÅÎÉÊ ÐÏ×ÒÅÖÄÅÎÁ"
+
+#: globals.h:1303
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr ""
+"E45: ÷ËÌÀÞÅÎÁ ÏÐÃÉÑ 'readonly' (ÄÏÂÁ×ØÔÅ !, ÞÔÏÂÙ ÎÅ ÏÂÒÁÝÁÔØ ×ÎÉÍÁÎÉÑ)"
+
+#: globals.h:1305
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: îÅ×ÏÚÍÏÖÎÏ ÉÚÍÅÎÉÔØ ÄÏÓÔÕÐÎÕÀ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ ÐÅÒÅÍÅÎÎÕÀ \"%s\""
+
+#: globals.h:1308
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ïÛÉÂËÁ ÐÒÉ ÞÔÅÎÉÉ ÆÁÊÌÁ ÏÛÉÂÏË"
+
+#: globals.h:1311
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: îÅ ÄÏÐÕÓËÁÅÔÓÑ × ÐÅÓÏÞÎÉÃÅ"
+
+#: globals.h:1313
+msgid "E523: Not allowed here"
+msgstr "E523: úÄÅÓØ ÎÅ ÒÁÚÒÅÛÅÎÏ"
+
+#: globals.h:1316
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: äÁÎÎÙÊ ÒÅÖÉÍ ÜËÒÁÎÁ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ"
+
+#: globals.h:1318
+msgid "E49: Invalid scroll size"
+msgstr "E49: îÅÄÏÐÕÓÔÉÍÙÊ ÒÁÚÍÅÒ ÐÒÏËÒÕÔËÉ"
+
+#: globals.h:1319
+msgid "E91: 'shell' option is empty"
+msgstr "E91: úÎÁÞÅÎÉÅÍ ÏÐÃÉÉ 'shell' Ñ×ÌÑÅÔÓÑ ÐÕÓÔÁÑ ÓÔÒÏËÁ"
+
+#: globals.h:1321
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: îÅ×ÏÚÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÄÁÎÎÙÅ Ï ÚÎÁÞËÁÈ!"
+
+#: globals.h:1323
+msgid "E72: Close error on swap file"
+msgstr "E72: ïÛÉÂËÁ ÚÁËÒÙÔÉÑ Ó×ÏÐ-ÆÁÊÌÁ"
+
+#: globals.h:1324
+msgid "E73: tag stack empty"
+msgstr "E73: óÔÅË ÍÅÔÏË ÐÕÓÔÏÊ"
+
+#: globals.h:1325
+msgid "E74: Command too complex"
+msgstr "E74: óÌÉÛËÏÍ ÓÌÏÖÎÁÑ ËÏÍÁÎÄÁ"
+
+#: globals.h:1326
+msgid "E75: Name too long"
+msgstr "E75: óÌÉÛËÏÍ ÄÌÉÎÎÏÅ ÉÍÑ"
+
+#: globals.h:1327
+msgid "E76: Too many ["
+msgstr "E76: óÌÉÛËÏÍ ÍÎÏÇÏ ÓÉÍ×ÏÌÏ× ["
+
+#: globals.h:1328
+msgid "E77: Too many file names"
+msgstr "E77: óÌÉÛËÏÍ ÍÎÏÇÏ ÉͣΠÆÁÊÌÏ×"
+
+#: globals.h:1329
+msgid "E488: Trailing characters"
+msgstr "E488: ìÉÛÎÉÅ ÓÉÍ×ÏÌÙ ÎÁ È×ÏÓÔÅ"
+
+#: globals.h:1330
+msgid "E78: Unknown mark"
+msgstr "E78: îÅÉÚ×ÅÓÔÎÁÑ ÏÔÍÅÔËÁ"
+
+#: globals.h:1331
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: îÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÐÏÄÓÔÁÎÏ×ËÕ ÐÏ ÍÁÓËÅ"
+
+#: globals.h:1333
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr ""
+"E591: úÎÁÞÅÎÉÅ ÏÐÃÉÉ 'winheight' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÍÅÎØÛÅ ÚÎÁÞÅÎÉÑ 'winminheight'"
+
+#: globals.h:1335
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr ""
+"E592: úÎÁÞÅÎÉÅ ÏÐÃÉÉ 'winwidth' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÍÅÎØÛÅ ÚÎÁÞÅÎÉÑ 'winminwidth'"
+
+#: globals.h:1338
+msgid "E80: Error while writing"
+msgstr "E80: ïÛÉÂËÁ ÐÒÉ ÚÁÐÉÓÉ"
+
+#: globals.h:1339
+msgid "Zero count"
+msgstr "îÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ ÓÞ£ÔÞÉËÁ"
+
+#: globals.h:1341
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: éÓÐÏÌØÚÏ×ÁÎÉÅ <SID> ×ÎÅ ËÏÎÔÅËÓÔÁ ÓÃÅÎÁÒÉÑ"
+
+#: globals.h:1344
+msgid "E449: Invalid expression received"
+msgstr "E449: ðÏÌÕÞÅÎÏ ÎÅÄÏÐÕÓÔÉÍÏÅ ×ÙÒÁÖÅÎÉÅ"
+
+#: globals.h:1347
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: îÅ×ÏÚÍÏÖÎÏ ÉÚÍÅÎÉÔØ ÏÈÒÁÎÑÅÍÕÀ ÏÂÌÁÓÔØ"
+
+#~ msgid "\"\n"
+#~ msgstr "\"\n"
diff --git a/src/po/sjiscorr.c b/src/po/sjiscorr.c
new file mode 100644
index 000000000..d7706ba73
--- /dev/null
+++ b/src/po/sjiscorr.c
@@ -0,0 +1,50 @@
+/*
+ * Simplistic program to correct SJIS inside strings. When a trail byte is a
+ * backslash it needs to be doubled.
+ * Public domain.
+ */
+#include <stdio.h>
+#include <string.h>
+
+ int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ char buffer[BUFSIZ];
+ char *p;
+
+ while (fgets(buffer, BUFSIZ, stdin) != NULL)
+ {
+ for (p = buffer; *p != 0; p++)
+ {
+ if (strncmp(p, "charset=euc-jp", 14) == 0)
+ {
+ fputs("charset=cp932", stdout);
+ p += 13;
+ }
+ else if (strncmp(p, "ja.po - Japanese message file", 29) == 0)
+ {
+ fputs("ja.sjis.po - Japanese message file for Vim (version 6.x)\n", stdout);
+ fputs("# generated from ja.po, DO NOT EDIT", stdout);
+ while (p[1] != '\n')
+ ++p;
+ }
+ else if (*(unsigned char *)p == 0x81 && p[1] == '_')
+ {
+ putchar('\\');
+ ++p;
+ }
+ else
+ {
+ if (*p & 0x80)
+ {
+ putchar(*p++);
+ if (*p == '\\')
+ putchar(*p);
+ }
+ putchar(*p);
+ }
+ }
+ }
+}
diff --git a/src/po/sk.cp1250.po b/src/po/sk.cp1250.po
new file mode 100644
index 000000000..3e91ad567
--- /dev/null
+++ b/src/po/sk.cp1250.po
@@ -0,0 +1,5998 @@
+# Slovak translation of vim
+# Martin Lacko <lacko@host.sk>, 2001.
+#
+# Generated from sk.po, DO NOT EDIT.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim\n"
+"POT-Creation-Date: 2002-03-26 21:54+0100\n"
+"PO-Revision-Date: 2002-03-26 21:58CEST\n"
+"Last-Translator: Martin Lacko <lacko@host.sk>\n"
+"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=cp1250\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.9.5\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nedá sa alokova buffer, konèím..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nedá sa alokova buffer, použijem iný..."
+
+#: buffer.c:706
+msgid "No buffers were unloaded"
+msgstr "Žiadny buffer nebol nájdený"
+
+#: buffer.c:708
+msgid "No buffers were deleted"
+msgstr "Žiadny buffer nebol vymazaný"
+
+#: buffer.c:710
+msgid "No buffers were wiped out"
+msgstr "Žiadny buffer nebol vymazaný"
+
+#: buffer.c:718
+msgid "1 buffer unloaded"
+msgstr "poèet deaktivovaných bufferov: 1"
+
+#: buffer.c:720
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "poèet deaktivovaných bufferov: %d"
+
+#: buffer.c:725
+msgid "1 buffer deleted"
+msgstr "poèet vymazaných bufferov: 1"
+
+#: buffer.c:727
+#, c-format
+msgid "%d buffers deleted"
+msgstr "poèet vymazaných bufferov: %d"
+
+#: buffer.c:732
+msgid "1 buffer wiped out"
+msgstr "poèet vymazaných bufferov: 1"
+
+#: buffer.c:734
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "poèet vymazaných bufferov: %d"
+
+#: buffer.c:791
+msgid "E84: No modified buffer found"
+msgstr "E84: Nebol nájdený žiadny zmenený buffer"
+
+#. back where we started, didn't find anything.
+#: buffer.c:830
+msgid "E85: There is no listed buffer"
+msgstr "E85: Nenašiel som žiadny buffer"
+
+#: buffer.c:842
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Nedá sa preskoèi na buffer %ld"
+
+#: buffer.c:845
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Za posledný buffer sa nedá preskoèi"
+
+#: buffer.c:847
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Pred prvý buffer sa nedá preskoèi"
+
+#: buffer.c:871
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: Zmeny v bufferi %ld neboly uložené (! pre vynútenie)"
+
+#: buffer.c:887
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Posledný buffer sa nedá odstráni"
+
+#: buffer.c:1337
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Varovanie: preteèenie zoznamu s názvami súborov"
+
+#: buffer.c:1503
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: buffer %ld nenájdený"
+
+#: buffer.c:1729
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Vzoru %s vyhovuje viac bufferov"
+
+#: buffer.c:1731
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Vzoru %s nevyhovuje žiadny buffer"
+
+#: buffer.c:2136 ex_docmd.c:6089
+#, c-format
+msgid "line %ld"
+msgstr "riadok %ld"
+
+#: buffer.c:2219
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer takéhoto mena už existuje"
+
+#: buffer.c:2512
+msgid " [Modified]"
+msgstr " [zmenený]"
+
+#: buffer.c:2517
+msgid "[Not edited]"
+msgstr "[neupravovaný]"
+
+#: buffer.c:2522
+msgid "[New file]"
+msgstr "[nový súbor]"
+
+#: buffer.c:2523
+msgid "[Read errors]"
+msgstr "[chyby pri èítaní]"
+
+#: buffer.c:2525 fileio.c:1777
+msgid "[readonly]"
+msgstr "[iba pre èítanie]"
+
+#: buffer.c:2540
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 riadok --%d%%--"
+
+#: buffer.c:2542
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "riadkov: %ld --%d%%--"
+
+#: buffer.c:2549
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "riadok %ld z %ld --%d%%-- ståpec"
+
+#: buffer.c:2637
+msgid "[No file]"
+msgstr "[žiadny súbor]"
+
+#. must be a help buffer
+#: buffer.c:2677
+msgid "help"
+msgstr "pomocník"
+
+#: buffer.c:3186 screen.c:4743
+msgid "[help]"
+msgstr "[pomocník]"
+
+#: buffer.c:3218 screen.c:4749
+msgid "[Preview]"
+msgstr "[náh¾ad]"
+
+#: buffer.c:3424
+msgid "All"
+msgstr "Všetko"
+
+#: buffer.c:3424
+msgid "Bot"
+msgstr "Koniec"
+
+#: buffer.c:3426
+msgid "Top"
+msgstr "Zaèiatok"
+
+#: buffer.c:4162
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# zoznam bufferov:\n"
+
+#: buffer.c:4195
+msgid "[Error List]"
+msgstr "[zoznam chýb]"
+
+#: buffer.c:4208 memline.c:1513
+msgid "[No File]"
+msgstr "[žiadny súbor]"
+
+#: buffer.c:4428
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaky ---"
+
+#: buffer.c:4438
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaky pre %s:"
+
+#: buffer.c:4444
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " line=%ld id=%d meno=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nemôžem porovna viac ako %ld bufferov"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nedajú sa vytvori porovnania"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Opravný súbor"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nedá sa èíta výstup porovnania"
+
+#: diff.c:1732
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktuálny buffer nie je v porovnacom móde"
+
+#: diff.c:1744
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: V porovnávacom móde sa nenachádza iný buffer"
+
+#: diff.c:1752
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Viac ako dva buffery v porovnávacom móde; neviem, ktorý použi"
+
+#: diff.c:1775
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nedá sa nájs buffer \"%s\""
+
+#: diff.c:1781
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffer \"%s\" nie je v porovnávacom móde"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: diagraph nesmie obsahova Escape"
+
+#: digraph.c:2344
+msgid "Keymap file not found"
+msgstr "Mapa kláves nenájdená"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Použite :loadkeymap v súbore, ktorý nie je zdrojový"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Doplòovanie k¾úèových slov (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X režim (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Miestne dopåòanie k¾úèových slov (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Doplòovanie celých riadkov (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Doplòovanie názvov súborov (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Doplòovanie tagov (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Doplòovanie vzoru ciest (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Doplòovanie definícií (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Doplòovanie pod¾a slovníka (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Doplòovanie pod¾a tezauru (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Doplòovòovanie príkazového riadka (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Koniec odstavca"
+
+#: edit.c:907
+msgid "'thesaurus' option is empty"
+msgstr "vo¾ba 'thesaurus' je prázdna"
+
+#: edit.c:1083
+msgid "'dictionary' option is empty"
+msgstr "vo¾ba 'dictionary' je prázdna"
+
+#: edit.c:2007
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "preh¾adávam slovník %s"
+
+#: edit.c:2198
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insert) Rolovanie (^E/^Y)"
+
+#: edit.c:2200
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (replace) Rolovanie (^E/^Y)"
+
+#: edit.c:2512
+#, c-format
+msgid "Scanning: %s"
+msgstr "Preh¾adávam: %s"
+
+#: edit.c:2547
+msgid "Scanning tags."
+msgstr "Preh¾adávam tagy."
+
+#: edit.c:3207
+msgid " Adding"
+msgstr " Pridávam"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3256
+msgid "-- Searching..."
+msgstr "-- H¾adám..."
+
+#: edit.c:3312
+msgid "Back at original"
+msgstr "Východzia podoba"
+
+#: edit.c:3317
+msgid "Word from other line"
+msgstr "Slovo z iného riadku"
+
+#: edit.c:3322
+msgid "The only match"
+msgstr "Jediná zhoda"
+
+#: edit.c:3381
+#, c-format
+msgid "match %d of %d"
+msgstr "zhoda %d z %d"
+
+#: edit.c:3384
+#, c-format
+msgid "match %d"
+msgstr "zhoda %d"
+
+#: eval.c:698
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Neznáma premenná: \"%s\""
+
+#: eval.c:977
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Chýbjú závorky: %s"
+
+#: eval.c:1057 eval.c:1073
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Premenná \"%s\" neexistuje"
+
+#: eval.c:1315
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Po '?' chýba ':'"
+
+#: eval.c:1929
+msgid "E110: Missing ')'"
+msgstr "E110: Chýba ')'"
+
+#: eval.c:1979
+msgid "E111: Missing ']'"
+msgstr "E111: Chýba ']'"
+
+#: eval.c:2054
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Chýba meno vo¾by: %s"
+
+#: eval.c:2072
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Neznáma vo¾ba: %s"
+
+#: eval.c:2134
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Chýbjú uvodzovky: %s"
+
+#: eval.c:2251
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Chýbjú uvodzovky: %s"
+
+#: eval.c:2569
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Chybné argumenty pre funkciu %s"
+
+#: eval.c:2570
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Neznáma funkcia: %s"
+
+#: eval.c:2571
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Príliš mnoho argumentov pre funkciu %s"
+
+#: eval.c:2572
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Príliš málo argumentov pre funkciu %s"
+
+#: eval.c:2573
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Použitie <SID> mimo kontext skriptu: %s"
+
+#: eval.c:3172 gui.c:3984
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:3678
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld riadky: "
+
+#: eval.c:4794
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&Ok\n"
+"&Zruši"
+
+#: eval.c:5626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Neexistuje pripojenie k Vim serveru"
+
+#: eval.c:5716
+msgid "E277: Unable to read a server reply"
+msgstr "E227: Nemôžem èíta odpoveï servra"
+
+#: eval.c:5741
+msgid "E258: Unable to send to client"
+msgstr "E258: Nemôžem posla klientovi"
+
+#: eval.c:5786
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nemôžem posla na %s"
+
+#: eval.c:5884
+msgid "(Invalid)"
+msgstr "(Chybný)"
+
+#: eval.c:6895
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nedefinovaná premenná: %s"
+
+#: eval.c:7593
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E112: Funkcia %s už existuje. Použite ! pre jej nahradenie."
+
+#: eval.c:7635
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nedefinovaná funkcia: %s"
+
+#: eval.c:7648
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Chýba '(': %s"
+
+#: eval.c:7680
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Neprístupný argument: %s"
+
+#: eval.c:7766
+msgid "E126: Missing :endfunction"
+msgstr "E126: Chýba :endfunction"
+
+#: eval.c:7845
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nedá sa predefinova funkcia %s: je používaná"
+
+#: eval.c:7903
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Názov funkcie musí zaèína ve¾kým písmenom: %s"
+
+#: eval.c:7909
+msgid "E129: Function name required"
+msgstr "E129: Je vyžadované meno funkcie"
+
+#: eval.c:8002
+msgid "function "
+msgstr "funkcia "
+
+#: eval.c:8117
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nedefinovaná funkcia: %s"
+
+#: eval.c:8122
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nedá sa vymaza funkcia %s: je už používaná"
+
+#: eval.c:8169
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zanorenie funkcií je hlbšie než 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8220
+#, c-format
+msgid "calling %s"
+msgstr "volám %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8245 ex_cmds2.c:1988
+#, c-format
+msgid "continuing in %s"
+msgstr "pokraèujem v %s"
+
+#: eval.c:8299
+msgid "E133: :return not inside a function"
+msgstr "E133: :return mimo funkciu"
+
+#: eval.c:8377
+#, c-format
+msgid "%s returning #%ld"
+msgstr "dokonèené %s. Návratová hodnota %ld"
+
+#: eval.c:8380
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "dokonèené %s. Návratová hodnota \"%s\""
+
+#: eval.c:8521
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globálne premenné:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, šestnástkovo %02x, osmièkovo %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Prekrytie riadkov sebou samými"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "poèet prerušených riadkov: 1"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "poèet prerušených riadkov: %ld"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "poèet filtrovaných riadkov: %ld"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Automatické príkazy *Filter* nesmie meni aktuálny buffer"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Neuložené zmeny]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s na riadku: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: príliš mnoho chýb, preskakujem zbytok súboru"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Èítam viminfo súbor \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " informácie"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " znaèky"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " ZLYHALO"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Do viminfo súboru %s sa nedá zapisova"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nedá sa uloži viminfo súbor %s!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Ukládám viminfo súboru \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Tento viminfo súbor bol vytvorený editorom Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Pokia¾ budete opatrnný, môžete ho upravova.\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Hodnota 'encoding' poèas zápisu tohoto súboru\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Neprístupný zaèiatoèný znak"
+
+#: ex_cmds.c:2053 ex_cmds.c:2310 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Uloži ako"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Súbor je naèítaný v inob buffere"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Uloži neúplný súbor?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Použite ! pre uloženie neúplného bufferu"
+
+#: ex_cmds.c:2244
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Prepísa súbor \"%.*s\"?"
+
+#: ex_cmds.c:2315
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Žiadny názov súboru pre buffer %ld"
+
+#: ex_cmds.c:2353
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Súbor nebol uložený: ukladanie je zakázané vo¾bou 'write'"
+
+#: ex_cmds.c:2373
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Pre \"%.*s\" je nastavená vo¾ba 'readonly' (iba na èítanie).\n"
+"Prajete si ju potlaèi?"
+
+#: ex_cmds.c:2538
+msgid "Edit File"
+msgstr "Upravova súbor"
+
+#: ex_cmds.c:3061
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Automatické príkazy neoèakávane zmazali nový buffer %s"
+
+#: ex_cmds.c:3193
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: neèíselný argument pre :z"
+
+#: ex_cmds.c:3278
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim nepovoluje použitie príkazov shellu"
+
+#: ex_cmds.c:3385
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regulárne výrazy nesmú by oddelené písmenami"
+
+#: ex_cmds.c:3727
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "nahradi %s (y/n/a/q/I/^E/^Y)?"
+
+#: ex_cmds.c:4092
+msgid "(Interrupted) "
+msgstr "(prerušený) "
+
+#: ex_cmds.c:4096
+msgid "1 substitution"
+msgstr "poèet nahradení na riadok: 1"
+
+#: ex_cmds.c:4098
+#, c-format
+msgid "%ld substitutions"
+msgstr "poèet nahradení na riadok: %ld"
+
+#: ex_cmds.c:4101
+msgid " on 1 line"
+msgstr " na 1 riadku"
+
+#: ex_cmds.c:4103
+#, c-format
+msgid " on %ld lines"
+msgstr " na %ld riadkov"
+
+#: ex_cmds.c:4154
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: global nedá sa vola rekurzívne"
+
+#: ex_cmds.c:4189
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Pri príkaze global chýba regulárny výraz"
+
+#: ex_cmds.c:4238
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Vzor nájdený na každom riadku: %s"
+
+#: ex_cmds.c:4319
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Posledný Reazec Podnadpisu:\n"
+"$"
+
+#: ex_cmds.c:4421
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ¼utujem, pre %s nie je žiadny pomocník"
+
+#: ex_cmds.c:4455
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "¼utujem, súbor \"%s\" s pomocníkom nebol nájdený"
+
+#: ex_cmds.c:4917
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s nie je adresárom"
+
+#: ex_cmds.c:4945
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nedá sa otvori %s pre zápis"
+
+#: ex_cmds.c:4959
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nedá sa otvori %s pre zápis"
+
+#: ex_cmds.c:5038
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplicitný tag \"%s\" v súbore %s"
+
+#: ex_cmds.c:5139
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Neznáma funkcia: %s"
+
+#: ex_cmds.c:5159
+msgid "E156: Missing sign name"
+msgstr "E156: Chýba identifikátor pre sign"
+
+#: ex_cmds.c:5205
+msgid "E255: Too many signs defined"
+msgstr "E255: Príliš mnoho definovaných oznaèení"
+
+#: ex_cmds.c:5247
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Chybne oznaèený text: %s"
+
+#: ex_cmds.c:5271 ex_cmds.c:5457
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Neznáme oznaèenie: %s"
+
+#: ex_cmds.c:5317
+msgid "E159: Missing sign number"
+msgstr "E159: Chýba èislo oznaèenia"
+
+#: ex_cmds.c:5397
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Chybné meno bufferu: %s"
+
+#: ex_cmds.c:5436
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Chybné ID oznaèenia: %ld"
+
+#: ex_cmds.c:5607
+msgid "[Deleted]"
+msgstr "[vymazaný]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Spúšam režim ladenia. Pre ukonèenie napíšte \"cont\"."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "riadok %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "príkaz: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Bod prerušenia v \"%s%s\" na riadku %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Bod prerušenia nenájdený: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Neboli definovné žiadne body prerušenia"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s riadok %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Uloži zmeny do \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8667
+msgid "Untitled"
+msgstr "Bez mena"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" obsahuje neuložené zmeny"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Varovanie: Neèakaný vstup do iného bufferu (skontrolujte automatické príkazy)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Pre úpravu bol zadaný iba jeden súbor"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Pred prvý súbor sa nedá preskoèi"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Za posledný súbor sa nedá preskoèi"
+
+#: ex_cmds2.c:1634
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "H¾adám \"%s\" v \"%s\""
+
+#: ex_cmds2.c:1656
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "H¾adám \"%s\""
+
+#: ex_cmds2.c:1680
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "súbor \"%s\" nebol nájdený v 'runtimepath'"
+
+#: ex_cmds2.c:1714
+msgid "Source Vim script"
+msgstr "Zdrojový skript Vim"
+
+#: ex_cmds2.c:1832
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "\"%s\" nie je adresárom"
+
+#: ex_cmds2.c:1862
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nedá sa interpretova \"%s\""
+
+#: ex_cmds2.c:1864
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "riadok %ld: nemôže by zdroj \"%s\""
+
+#: ex_cmds2.c:1878
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "interpretujem \"%s\""
+
+#: ex_cmds2.c:1880
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "riadok %ld je zdrojom \"%s\""
+
+#: ex_cmds2.c:1986
+#, c-format
+msgid "finished sourcing %s"
+msgstr "dokonèená interpretácia %s"
+
+#: ex_cmds2.c:2287
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Varovanie: chybný odde¾ovaè riadkov. Možná chýba ^M."
+
+#: ex_cmds2.c:2336
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :finish použité mimo interpretovaný súbor"
+
+#: ex_cmds2.c:2369
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish použité mimo interpretovaný súbor"
+
+#: ex_cmds2.c:2838
+msgid "No text to be printed"
+msgstr "Ïalší na tlaè"
+
+#: ex_cmds2.c:2916
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Tlaèím stranu %d (%d%%)"
+
+#: ex_cmds2.c:2925
+#, c-format
+msgid " Copy %d of %d"
+msgstr "Kópia %d z %d"
+
+#: ex_cmds2.c:2977
+#, c-format
+msgid "Printed: %s"
+msgstr "Vytlaèené: %s"
+
+#: ex_cmds2.c:2984
+msgid "Printing aborted"
+msgstr "Tlaè bola zrušená"
+
+#: ex_cmds2.c:3367
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nedá sa zapisova do výstupného PostScriptového súboru"
+
+#: ex_cmds2.c:4042
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nedá sa otvori výstupný PostScriptový súbor"
+
+#: ex_cmds2.c:4080
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nedá sa otvori súbor \"%s\""
+
+#: ex_cmds2.c:4091
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nedá sa èíta PostScriptový súbor \"%s\""
+
+#: ex_cmds2.c:4289
+msgid "Sending to printer..."
+msgstr "Posielam na tlaèiareò..."
+
+#: ex_cmds2.c:4293
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: PostScriptový súbor sa nepodarilo vytlaèi"
+
+#: ex_cmds2.c:4295
+msgid "Print job sent."
+msgstr "Tlaèová úloha bola odoslaná."
+
+#: ex_cmds2.c:4691
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Aktuálny %s jazyk: \"%s\""
+
+#: ex_cmds2.c:4702
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nedá sa nastavi jazyk na \"%s\""
+
+#: ex_docmd.c:490
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Spúšam Ex režim. Napište \"visual\" pre návrat do Normálního režimu."
+
+#. must be at EOF
+#: ex_docmd.c:526
+msgid "At end-of-file"
+msgstr "Koniec súboru"
+
+#: ex_docmd.c:601
+msgid "E169: Command too recursive"
+msgstr "E169: Príkaz je príliš zložitý"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: Chýba :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: Chýba :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Koniec zdrojového súboru"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Koniec funkcie"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Nejednoznaèné použitie používate¾om definovaného príkazu"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Nie je príkazom editoru"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "Žiadnu paniku!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Zadaný spätný rozsah"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Zadaný spätný rozsah. OK odloži"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Použite w èi w>>"
+
+#: ex_docmd.c:3097
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ¼utujem, ale tento príkaz nie je implementovaný"
+
+#: ex_docmd.c:3267
+msgid "E172: Only one file name allowed"
+msgstr "E172: Prípustný je iba jeden názov súboru"
+
+#: ex_docmd.c:3823
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "Ešte zostávajú %d súborov k úprave. Chcete napriek tomu ukonèi editor?"
+
+#: ex_docmd.c:3830
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: Ešte zostávajajú %ld súbory k úprave."
+
+#: ex_docmd.c:3924
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Príkaz už existuje: použite ! pre predefinovanie"
+
+#: ex_docmd.c:4029
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Meno Args Rozsah Úplnos Definícia"
+
+#: ex_docmd.c:4118
+msgid "No user-defined commands found"
+msgstr "Neboli nájdené žiadne použivate¾om definované príkazy"
+
+#: ex_docmd.c:4149
+msgid "E175: No attribute specified"
+msgstr "E175: Neboli zadané žiadne vlastnosti"
+
+#: ex_docmd.c:4201
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Chybný poèet argumentov"
+
+#: ex_docmd.c:4216
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Poèet nemôže by zadaný dvakrát"
+
+#: ex_docmd.c:4226
+msgid "E178: Invalid default value for count"
+msgstr "E178: Chybná implicitná hodnota pre poèet"
+
+#: ex_docmd.c:4254
+msgid "E179: argument required for complete"
+msgstr "E179: pre doplnenie je potrebný argument"
+
+#: ex_docmd.c:4273
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Chybná hodnota doplnenia: %s"
+
+#: ex_docmd.c:4281
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Chybná vlastnos: %s"
+
+#: ex_docmd.c:4322
+msgid "E182: Invalid command name"
+msgstr "E182: Chybné meno príkazu"
+
+#: ex_docmd.c:4337
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Používate¾om definované príkazy musia zaèína ve¾kým písmenom"
+
+#: ex_docmd.c:4406
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Používate¾om definovaný príkaz %s neexistuje"
+
+#: ex_docmd.c:4857
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Schéma farieb %s nenájdená"
+
+#: ex_docmd.c:4865
+msgid "Greetings, Vim user!"
+msgstr "Pozdraujem, Vim používate¾!"
+
+#: ex_docmd.c:5569
+msgid "Edit File in new window"
+msgstr "Upravi súbor v novom okne"
+
+#: ex_docmd.c:5839
+msgid "No swap file"
+msgstr "Žiadny odkladací súbor"
+
+#: ex_docmd.c:5943
+msgid "Append File"
+msgstr "Pripoji súbor"
+
+#: ex_docmd.c:6002
+msgid "E186: No previous directory"
+msgstr "E186: Žiadny predchádzajúci adresár"
+
+#: ex_docmd.c:6079
+msgid "E187: Unknown"
+msgstr "E187: Neznámy"
+
+#: ex_docmd.c:6197
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Umiestenie okna: X %d, Y %d"
+
+#: ex_docmd.c:6202
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Na tejto platforme sa nedá umiestnenie okna zisti"
+
+#: ex_docmd.c:6468
+msgid "Save Redirection"
+msgstr "Uloži presmerovanie"
+
+#: ex_docmd.c:6617
+msgid "Save View"
+msgstr "Uloži poh¾ad"
+
+#: ex_docmd.c:6618
+msgid "Save Session"
+msgstr "Uloži sedenie"
+
+#: ex_docmd.c:6620
+msgid "Save Setup"
+msgstr "Uloži nastavenie"
+
+#: ex_docmd.c:6769
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" existuje (použite ! pre vynútenie)"
+
+#: ex_docmd.c:6774
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nedá sa otvori \"%s\" pre zápis"
+
+#. set mark
+#: ex_docmd.c:6798
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argumentem môže by iba písiemo alebo pravý èi ¾avý apostrof"
+
+#: ex_docmd.c:6841
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Vnorenie :normal je príliš hlboké"
+
+#: ex_docmd.c:7202
+msgid ":if nesting too deep"
+msgstr "vnorenie :if je príliš hlboké"
+
+#: ex_docmd.c:7237
+msgid ":endif without :if"
+msgstr ":endif bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7257
+msgid ":else without :if"
+msgstr ":else bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7259
+msgid ":elseif without :if"
+msgstr ":elseif bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7311
+msgid ":while nesting too deep"
+msgstr "vnorenie :while je príliš hlboké"
+
+#: ex_docmd.c:7357
+msgid ":continue without :while"
+msgstr ":continue bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7384
+msgid ":break without :while"
+msgstr ":break bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7407 ex_docmd.c:7412
+msgid ":endwhile without :while"
+msgstr ":endwhile bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7433
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction mimo funkciu"
+
+#: ex_docmd.c:7613
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Žiadny alternatívny názov súboru, ktorým by bolo možné nahradi '#'"
+
+#: ex_docmd.c:7644
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "žiadny názov súboru, ktorým by bolo možné nahradi \"<afile>\""
+
+#: ex_docmd.c:7652
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "žiadne èíslo bufferu, ktorým by bolo možné nahradi \"<abuf>\""
+
+#: ex_docmd.c:7663
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"žiadna zhoda automatických príkazov, ktorou by bolo možné nahradi \"<amatch>"
+"\""
+
+#: ex_docmd.c:7673
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "žiadny :source súbor, ktorým by bolo možné nahradi \"<sfile>\""
+
+#: ex_docmd.c:7714
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Prázdný názov súboru pre '%' èi '#' funguje iba s \":p:h\""
+
+#: ex_docmd.c:7716
+msgid "Evaluates to an empty string"
+msgstr "Výsledkom vyhodnotenia je prázdny reazec"
+
+#: ex_docmd.c:8649
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nedá sa otvori pre èítaní viminfo súbor"
+
+#: ex_docmd.c:8822
+msgid "E196: No digraphs in this version"
+msgstr "E196: V tejto verzi nie sú diagraphy podporované"
+
+#: ex_getln.c:2833
+msgid "tagname"
+msgstr "meno tagu"
+
+#: ex_getln.c:2836
+msgid " kind file\n"
+msgstr " typ súboru\n"
+
+#: ex_getln.c:4049
+msgid "'history' option is zero"
+msgstr "'vo¾ba 'history' je nastavená na nulu"
+
+#: ex_getln.c:4289
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# História %s (zaèínajúci najnovšou položkou):\n"
+
+#: ex_getln.c:4290
+msgid "Command Line"
+msgstr "Príkazové Riadky"
+
+#: ex_getln.c:4291
+msgid "Search String"
+msgstr "Vyh¾adávaný Reazec"
+
+#: ex_getln.c:4292
+msgid "Expression"
+msgstr "Výraz"
+
+#: ex_getln.c:4293
+msgid "Input Line"
+msgstr "Vstupný Riadok"
+
+#: ex_getln.c:4323
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar prevyšuje dåžku príkazu"
+
+#: ex_getln.c:4491
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktívne okno alebo buffer bol vymazaný"
+
+#: fileio.c:351
+msgid "Illegal file name"
+msgstr "Neprístupný názov súboru"
+
+#: fileio.c:375 fileio.c:500 fileio.c:2516 fileio.c:2554
+msgid "is a directory"
+msgstr "je adresárom"
+
+#: fileio.c:377
+msgid "is not a file"
+msgstr "nie je súborom"
+
+#: fileio.c:522 fileio.c:3646
+msgid "[New File]"
+msgstr "[nový súbor]"
+
+#: fileio.c:540
+msgid "[Permission Denied]"
+msgstr "[prístup odmietnutý]"
+
+#: fileio.c:634
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre automatické príkazy urobili súbor neèitate¾ným"
+
+#: fileio.c:636
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre automatické príkazy nesmú meni aktuálny buffer"
+
+#: fileio.c:657
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: èítam z štandardného vstupu...\n"
+
+#: fileio.c:663
+msgid "Reading from stdin..."
+msgstr "Èítam z štandardného vstupu..."
+
+#. Re-opening the original file failed!
+#: fileio.c:892
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Po konverzii je súbor neèittate¾ný!"
+
+#: fileio.c:1755
+msgid "[fifo/socket]"
+msgstr "[fpomenovaná rúra/soket]"
+
+#: fileio.c:1762
+msgid "[fifo]"
+msgstr "[pomenovaná rúra]"
+
+#: fileio.c:1769
+msgid "[socket]"
+msgstr "[soket]"
+
+#: fileio.c:1777
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1787
+msgid "[CR missing]"
+msgstr "[chýba CR]"
+
+#: fileio.c:1792
+msgid "[NL found]"
+msgstr "[nájdené NL]"
+
+#: fileio.c:1797
+msgid "[long lines split]"
+msgstr "[dlhé riadky zalomené]"
+
+#: fileio.c:1803 fileio.c:3630
+msgid "[NOT converted]"
+msgstr "[neskonvertovaný]"
+
+#: fileio.c:1808 fileio.c:3635
+msgid "[converted]"
+msgstr "[skonvertovaný]"
+
+#: fileio.c:1815 fileio.c:3660
+msgid "[crypted]"
+msgstr "[zašifrovaný]"
+
+#: fileio.c:1822
+msgid "[CONVERSION ERROR]"
+msgstr "[CHYBA PREVODU]"
+
+#: fileio.c:1829
+msgid "[READ ERRORS]"
+msgstr "[CHYBY ÈÍTANIA]"
+
+#: fileio.c:2036
+msgid "Can't find temp file for conversion"
+msgstr "Nedá sa nájs doèasný súbor pre konverziu"
+
+#: fileio.c:2043
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konverzia s 'charconvert' sa nepodarila"
+
+#: fileio.c:2046
+msgid "can't read output of 'charconvert'"
+msgstr "nedá sa èíta výstup 'charconvert'"
+
+#: fileio.c:2432
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Automatické príkazy zmazali èi deaktivovali buffer, ktorý mal by "
+"uložený"
+
+#: fileio.c:2455
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Automatický príkaz neoèakávaným spôsobom zmenil poèet riadkov"
+
+#: fileio.c:2521 fileio.c:2538
+msgid "is not a file or writable device"
+msgstr "nie je súborom ani zariadením na ktoré sa dá zapisova"
+
+#: fileio.c:2584
+msgid "is read-only (use ! to override)"
+msgstr "je iba pre èítaníie(použite ! pre vynútenie)"
+
+#: fileio.c:2886
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Nedá sa zapisova do záložného súboru (použite ! pre vynútenie)"
+
+#: fileio.c:2898
+msgid "Close error for backup file (use ! to override)"
+msgstr "Chyba pri uzatváraní záložného súboru (použite ! pre vynútenie)"
+
+#: fileio.c:2900
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Nedá sa naèíta súbor pre zálohu (použite ! pre vynútenie)"
+
+#: fileio.c:2916
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Nedá sa vytvori záložný súbor (použite ! pre vynútenie)"
+
+#: fileio.c:3018
+msgid "Can't make backup file (use ! to override)"
+msgstr "Nedá sa vytvori záložný súbor (použite ! pre vynútenie)"
+
+# resource fork ?!
+#: fileio.c:3080
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "'Resource fork' bude stratený (použite ! pre vynútenie)"
+
+#: fileio.c:3169
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nedá sa nájs doèasný súbor pre ukladanie"
+
+#: fileio.c:3187
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Nedá sa previes (použite ! pre vynútenie prevodu)"
+
+#: fileio.c:3222
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Súbor sa nedá otvori pre ukladanie"
+
+#: fileio.c:3226
+msgid "E212: Can't open file for writing"
+msgstr "E212: Súbor sa nedá otvori pre ukladanie"
+
+#: fileio.c:3475
+msgid "Close failed"
+msgstr "Zatvorenie zlyhalo"
+
+#: fileio.c:3546
+msgid "write error, conversion failed"
+msgstr "chyba pri zápise, prevod sa nepodaril"
+
+#: fileio.c:3552
+msgid "write error (file system full?)"
+msgstr "chyba pri ukladaní (je vo¾né miesto na disku?)"
+
+#: fileio.c:3625
+msgid " CONVERSION ERROR"
+msgstr " CHYBA PREVODU"
+
+#: fileio.c:3641
+msgid "[Device]"
+msgstr "[zariadenie]"
+
+#: fileio.c:3646
+msgid "[New]"
+msgstr "[nový]"
+
+#: fileio.c:3668
+msgid " [a]"
+msgstr " [p]"
+
+#: fileio.c:3668
+msgid " appended"
+msgstr " pripojený"
+
+#: fileio.c:3670
+msgid " [w]"
+msgstr " [u]"
+
+#: fileio.c:3670
+msgid " written"
+msgstr " uložený"
+
+#: fileio.c:3720
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: nedá sa uloži pôvodný súbor"
+
+#: fileio.c:3742
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nedá sa zapisova do prázdneho pôvodného súboru"
+
+#: fileio.c:3757
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nedá sa vymaza záložný súbor"
+
+#: fileio.c:3809
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"VAROVANIE: Obsah pôvodného súboru môže by stratený alebo poškodený\n"
+
+#: fileio.c:3811
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "neukonèujte editor skôr, než bude súbor úspešne uložený!"
+
+#: fileio.c:3891
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3891
+msgid "[dos format]"
+msgstr "[dos formát]"
+
+#: fileio.c:3898
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3898
+msgid "[mac format]"
+msgstr "[mac formát]"
+
+#: fileio.c:3905
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3905
+msgid "[unix format]"
+msgstr "[unix formát]"
+
+#: fileio.c:3932
+msgid "1 line, "
+msgstr "1 riadok, "
+
+#: fileio.c:3934
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld riadkov, "
+
+#: fileio.c:3937
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:3939
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znakov"
+
+#: fileio.c:3949
+msgid "[noeol]"
+msgstr "[žiadny koniec riadku]"
+
+#: fileio.c:3949
+msgid "[Incomplete last line]"
+msgstr "[neúplný posledný riadok]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3968
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "VAROVANIE: od jeho naèítania bol obsah súboru zmenený!!!!"
+
+#: fileio.c:3970
+msgid "Do you really want to write to it"
+msgstr "Chcete ho naozaj uloži"
+
+#: fileio.c:4933
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Chyba pri zápise do \"%s\""
+
+#: fileio.c:4940
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Chyb pri uzatváraní \"%s\""
+
+#: fileio.c:4943
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Chyba pri èítaní \"%s\""
+
+#: fileio.c:5115
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell automatický príkaz vymazal buffer"
+
+#: fileio.c:5123
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Varovanie: súbor \"%s\" už nie je dostupný"
+
+#: fileio.c:5136
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Varovanie: súbor \"%s\" bol po zaèatí úpravy zmenený a Vim tiež zmenil "
+"buffer"
+
+#: fileio.c:5139
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Varovanie: súbor \"%s\" bol po zaèatí úpravy zmenený"
+
+#: fileio.c:5141
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Varovanie: Režim súboru \"%s\" bol po zaèatí úprav zmenený"
+
+#: fileio.c:5151
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Varovanie: po zaèatí úpravy vytvorený súbor \"%s\""
+
+#: fileio.c:5168
+msgid "Warning"
+msgstr "Varovanie"
+
+#: fileio.c:5169
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Naèíta súbor"
+
+#: fileio.c:5248
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: nedá sa obnovi \"%s\""
+
+#: fileio.c:5779
+msgid "--Deleted--"
+msgstr "--Vymazaný--"
+
+#. the group doesn't exist
+#: fileio.c:5939
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Skupina \"%s\" neexistuje"
+
+#: fileio.c:6064
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Neprístupný znak po *: %s"
+
+#: fileio.c:6075
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Udalos %s neexistuje"
+
+#. Highlight title
+#: fileio.c:6224
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Automatické príkazy ---"
+
+#: fileio.c:6495
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Automatické príkazy sa nedajú spusti pre VŠETKY udalosi"
+
+#: fileio.c:6518
+msgid "No matching autocommands"
+msgstr "Žiadne vyhovujúce automatické príkazy"
+
+#: fileio.c:6790
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: vnorenia automatického príkazu sú príliš hlboké"
+
+#: fileio.c:7077
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s automatické príkazy pre \"%s\""
+
+#: fileio.c:7085
+#, c-format
+msgid "Executing %s"
+msgstr "Spúšam %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7153
+#, c-format
+msgid "autocommand %s"
+msgstr "Automatický príkaz %s"
+
+#: fileio.c:7675
+msgid "E219: Missing {."
+msgstr "E219: Chýba {."
+
+#: fileio.c:7677
+msgid "E220: Missing }."
+msgstr "E220: Chýba }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "Žiadny záhyb nebol nájdený"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Pomocou 'foldmethod' sa nedá vytvori záhyb"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Pomocou 'foldmethod' sa nedá odstráni záhyb"
+
+#: getchar.c:247
+msgid "E222: Add to read buffer"
+msgstr "E222: Prida do bufferu pre èítanie"
+
+#: getchar.c:2106
+msgid "E223: recursive mapping"
+msgstr "E223: rekurzívne mapovanie"
+
+#: getchar.c:2948
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: pre %s už globálna skratka existuje"
+
+#: getchar.c:2951
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: pre %s už globálne mapovanie existuje"
+
+#: getchar.c:3078
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: pre %s už skratka existuje"
+
+#: getchar.c:3081
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: pre %s už mapovanie existuje"
+
+#: getchar.c:3145
+msgid "No abbreviation found"
+msgstr "Žiadna skratka nebola nájdená"
+
+#: getchar.c:3147
+msgid "No mapping found"
+msgstr "Žiadne mapovanie nebolo nájdené"
+
+#: getchar.c:3992
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: neprístupný mód"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<nedá sa otvori> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: písmo %s nie je dostupné"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: nedá sa vráti do aktuálneho adresára"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Názov cesty:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: nedá sa zisti aktuálny adresár"
+
+#: gui_at_fs.c:2571 gui_motif.c:1619
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1740 gui_motif.c:1614 gui_motif.c:2835
+msgid "Cancel"
+msgstr "Zruši"
+
+#: gui_athena.c:1956 gui_motif.c:1867
+msgid "Vim dialog"
+msgstr "Vim dialóg"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Prípravok posuvnej lišty: nedá sa zisti geometria obrázku"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: BalloonEval nedá sa vytvori správou a zároveò spätným volaním"
+
+#: gui.c:203
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nedá sa spusti GUI"
+
+#: gui.c:328
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nedá sa èíta z \"%s\""
+
+#: gui.c:453
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: vo¾ba 'guifontwide' je chybne nastavená"
+
+#: gui.c:3698
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Nedá sa alokova farba %s"
+
+#: gui.c:3983
+msgid "Error"
+msgstr "Chyba"
+
+#: gui_gtk.c:1190
+msgid "Vim dialog..."
+msgstr "Vim dialóg.."
+
+#: gui_gtk.c:1576 gui_motif.c:2754
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Nájs a nahradi..."
+
+#: gui_gtk.c:1581 gui_motif.c:2756
+msgid "VIM - Search..."
+msgstr "VIM - Nájs..."
+
+#: gui_gtk.c:1604 gui_motif.c:2874
+msgid "Find what:"
+msgstr "Vyh¾ada:"
+
+#: gui_gtk.c:1622 gui_motif.c:2906
+msgid "Replace with:"
+msgstr "Nový text:"
+
+#. exact match only button
+#: gui_gtk.c:1654 gui_motif.c:3008
+msgid "Match exact word only"
+msgstr "H¾ada len celé slová"
+
+#: gui_gtk.c:1666 gui_motif.c:2976
+msgid "Direction"
+msgstr "Smer"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1678 gui_motif.c:2988
+msgid "Up"
+msgstr "Hore"
+
+#: gui_gtk.c:1682 gui_motif.c:2996
+msgid "Down"
+msgstr "Dolu"
+
+#. 'Find Next' button
+#: gui_gtk.c:1704 gui_motif.c:2778
+msgid "Find Next"
+msgstr "Nájs ïalšie"
+
+#. 'Replace' button
+#: gui_gtk.c:1721 gui_motif.c:2795
+msgid "Replace"
+msgstr "Nahradi"
+
+#. 'Replace All' button
+#: gui_gtk.c:1730 gui_motif.c:2808
+msgid "Replace All"
+msgstr "Nahradi Všetko"
+
+#: gui_gtk_x11.c:1079 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: nedá sa otvori displej"
+
+#: gui_gtk_x11.c:2494 gui_x11.c:1999
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Neznáma sada písiem: %s"
+
+#: gui_gtk_x11.c:2518
+msgid "Font Selection"
+msgstr "Výber Písma"
+
+#: gui_gtk_x11.c:2764 gui_mac.c:2982 gui_w48.c:1197 gui_x11.c:1835
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Neznáme písmo: %s"
+
+#: gui_gtk_x11.c:2775 gui_x11.c:1859
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Písmo \"%s\" nemá pevnú šírku"
+
+#: gui_gtk_x11.c:3580 ui.c:1971
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Použitý CUT_BUFFER0 namiesto prázdneho výberu"
+
+#: gui_motif.c:1613 gui_motif.c:1616
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1615
+msgid "Directories"
+msgstr "Adresáre"
+
+#: gui_motif.c:1617
+msgid "Help"
+msgstr "Pomocník"
+
+#: gui_motif.c:1618
+msgid "Files"
+msgstr "Súbory"
+
+#: gui_motif.c:1620
+msgid "Selection"
+msgstr "Výber"
+
+#: gui_motif.c:2821
+msgid "Undo"
+msgstr "Spä"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Nemôžem naèíta chybný font '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Nedá sa použí písmo %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Posielam správu na ukonèenie synovského procesu.\n"
+
+#: gui_w32.c:836
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr ""
+"E243: Argument nie je podporovaný: \n"
+"-%s\"; Použite OLE verziu."
+
+#. TODO: May be changed this message
+#: gui_w32.c:3499 gui_w32.c:3532 gui_x11.c:3252
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Chyba -- nedájú sa preèíta oznaèovacie dáta!"
+
+#: gui_w48.c:2081
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Nájs reazec (použite '\\\\' ak chete nájs '\\')"
+
+#: gui_w48.c:2106
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Nájs a Nahradi (použite '\\\\' ak chcete nájs '\\')"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Nedá sa alokova položka mapy farieb. Niektoré farby môžu by "
+"nesprávne"
+
+#: gui_x11.c:1989
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Chýba písmo pre nasledujúce znakové sady %s:"
+
+#: gui_x11.c:2032
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Názov sady písiem: %s"
+
+#: gui_x11.c:2033
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Písmo '%s' nemá pevnou šírku"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Názov sady písiem: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Písmo0: %s\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Písmo1: %s\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Písmo%d nie je dvakrát širšie ako písmo0\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Šírka písma0: %ld\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Šírka písma1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata ERROR"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr "Použitie: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Prida novú databázu"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "H¾adanie vzoru"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Zobrazi túto správu"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Ukonèi spojenie"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Znovu inicializova všetky spojenia"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Zobrazi spojenia"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Táto cscope príkaz nepodporuje rozde¾ovanie okna.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Použitie: cstag <odsadenie>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tag nenájdený"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) chyba: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Pridaná cscope databáza %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s nie je ani adresárom ani správnou cscope databázou"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "chyba pri èítaní cscope spojenia %d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "neznámy typ cscope h¾adania"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "Nedajú sa vytvori cscope rúry"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "spustenie cs_create_connection zlyhalo"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: volanie fdopen pre to_fp zlyhalo"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: volanie fdopen pre fr_fp zlyhalo"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "žiadne cscope spojenia"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscope h¾adanie %s vo vzore %s nenašlo žiadnu zhodu"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "príkazy cscope:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Použitie: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "duplicitná cscope databáza nebola pridaná"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "dosiahnutý maximálny poèet cscope spojení"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: cscope spojenie nenájdené"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope spojenie %s nenájdené"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope spojenie ukonèené"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope spojenie %s ukonèené\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "osudová chyba v cs_manage_matches"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: chyba pri èítaní cscope spojenia %d"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "volanie malloc zlyhalo\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope tag: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # riadok"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "názov súboru/ kontext/ riadok\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "Všetky cscope databáze resetované"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "žiadne cscope spojenia\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid názov databáze predpona cesty\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <žiadny>\n"
+
+#: if_python.c:255 if_ruby.c:260 if_tcl.c:195 mbyte.c:2629 os_win32.c:269
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Nepodarilo sa nahra knižnicu %s"
+
+#: if_python.c:267 if_ruby.c:272 if_tcl.c:206 mbyte.c:2645 os_win32.c:281
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Nepodarilo sa nahra funkciu knižnice %s"
+
+#: if_python.c:392
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E262: Prepáète, tento príkaz je vypnutý, Python knižnica nemôže bynaèítaná."
+
+#: if_python.c:592
+msgid "can't delete OutputObject attributes"
+msgstr "nedá sa vymaza vlastnos OutputObject"
+
+#: if_python.c:599
+msgid "softspace must be an integer"
+msgstr "softspace musí by kladné celé èíslo"
+
+#: if_python.c:607
+msgid "invalid attribute"
+msgstr "chybná vlastnos"
+
+#: if_python.c:646 if_python.c:660
+msgid "writelines() requires list of strings"
+msgstr "writelines() vyžaduje zoznam reazcov"
+
+#: if_python.c:786
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Chyba pri inicializácii I/O objektov"
+
+#: if_python.c:971 if_tcl.c:1403
+msgid "invalid expression"
+msgstr "chybný výraz"
+
+#: if_python.c:985 if_tcl.c:1408
+msgid "expressions disabled at compile time"
+msgstr "podpora výrazov bola vypnutá pri preklade programu"
+
+#: if_python.c:998
+msgid "attempt to refer to deleted buffer"
+msgstr "pokus o odkaz na vymazaný buffer"
+
+#: if_python.c:1013 if_python.c:1054 if_python.c:1118 if_tcl.c:1215
+msgid "line number out of range"
+msgstr "èíslo riadka mimo rozsah"
+
+#: if_python.c:1251
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<objekt bufferu (vymazaný) na %8lX>"
+
+#: if_python.c:1342 if_tcl.c:837
+msgid "invalid mark name"
+msgstr "chybné meno znaèky"
+
+#: if_python.c:1617
+msgid "no such buffer"
+msgstr "žiadny taký buffer"
+
+#: if_python.c:1705
+msgid "attempt to refer to deleted window"
+msgstr "pokus o odkaz na vymazané okno"
+
+#: if_python.c:1750
+msgid "readonly attribute"
+msgstr "vlastnos iba pre èítanie"
+
+#: if_python.c:1763
+msgid "cursor position outside buffer"
+msgstr "umiestnenie kurzoru mimo buffer"
+
+#: if_python.c:1840
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objekt okna (vymazaný) na %.8lX>"
+
+#: if_python.c:1852
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objekt okna (neznámy) na %.8lX>"
+
+#: if_python.c:1854
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:1930
+msgid "no such window"
+msgstr "žiadne také okno"
+
+#: if_python.c:2187 if_python.c:2222 if_python.c:2272 if_python.c:2335
+#: if_python.c:2455 if_python.c:2507 if_tcl.c:685 if_tcl.c:730 if_tcl.c:804
+#: if_tcl.c:874 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "nedajú sa uloži spätné informácie"
+
+#: if_python.c:2189 if_python.c:2279 if_python.c:2346
+msgid "cannot delete line"
+msgstr "nedá sa vymaza riadok"
+
+#: if_python.c:2224 if_python.c:2362 if_tcl.c:691 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "nedá sa nahradi riadok"
+
+#: if_python.c:2378 if_python.c:2457 if_python.c:2515
+msgid "cannot insert line"
+msgstr "nedá sa vloži riadok"
+
+#: if_python.c:2619
+msgid "string cannot contain newlines"
+msgstr "reazec nesmie obsahova znaky nového riadku"
+
+#: if_ruby.c:401
+msgid "E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: Prepáète, tento príkaz je vypnutý, Ruby knižnica nemôže by naèítaná."
+
+#: if_ruby.c:464
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Neznámy 'longjmp' stav %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prepnú implementáciu/definíciu"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Ukáza základnú triedu"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Ukáza preaženú èlenskú funkciu"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Obnovi zo súboru"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Obnovi z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Obnovi zo všetkých projektov"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Obnovi"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Ukáza zdroj"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Nájs znak"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Prezrie triedu"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Ukáza triedu v hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Ukáza triedu v obmedzenej hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odkazuje na"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref odkázaný z"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref má"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref použitý"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Ukáza dokumentáciu"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Vytvori dokumentáciu pre"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Zlihalo pripojenie na SNiFF+, Preverte prostredie (sniffemacs sa musí "
+"nachádza v $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Chyba poèas èítania. Odpojené"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ je aktuálne "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ne"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pripojený"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Neznáma SNiFF+ požiadavka: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Chyba pripojenia na SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ nie je pripojený"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Nie je SNiFF+ bufferom"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Chyba zápisu. Odpojené"
+
+#: if_tcl.c:419
+msgid "invalid buffer number"
+msgstr "chybné èíslo bufferu"
+
+#: if_tcl.c:465 if_tcl.c:932 if_tcl.c:1111
+msgid "not implemented yet"
+msgstr "nie je ešte podporované"
+
+#: if_tcl.c:502
+msgid "unknown option"
+msgstr "neznáma vo¾ba"
+
+#. ???
+#: if_tcl.c:775
+msgid "cannot set line(s)"
+msgstr "nedajú sa nastavi riadky"
+
+#: if_tcl.c:846
+msgid "mark not set"
+msgstr "znaèka nie je nastavená"
+
+#: if_tcl.c:852 if_tcl.c:1067
+#, c-format
+msgid "row %d column %d"
+msgstr "riadok %d ståpec %d"
+
+#: if_tcl.c:882
+msgid "cannot insert/append line"
+msgstr "nedá sa vloži/pripoji riadok"
+
+#: if_tcl.c:1269
+msgid "unknown flag: "
+msgstr "neznámy príznak: "
+
+#: if_tcl.c:1339
+msgid "unknown vimOption"
+msgstr "neznáma vimMožnos"
+
+#: if_tcl.c:1424
+msgid "keyboard interrupt"
+msgstr "prerušenie z klávesnice"
+
+#: if_tcl.c:1429
+msgid "vim error"
+msgstr "chyba vim"
+
+#: if_tcl.c:1472
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nedá sa vytvori príkaz bufferu/okna: objekt vymazaný"
+
+#: if_tcl.c:1546
+msgid "cannot register callback command: buffer/window is already being deleted"
+msgstr "nedá sa zaregistrova príkaz spätného volania: buffer/okno už bol vymazaný"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1563
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATAL ERROR: reflist poškodený!? Oznámte, prosím, túto chybu na "
+"vim-dev@vim.org"
+
+#: if_tcl.c:1564
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "nedá sa zaregistrova príkaz spätného volania: odkaz na buffer/okno nenájdený"
+
+#: if_tcl.c:1725
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "Prepáète, tento príkaz je vypnutý, Tcl knižnica nemôže by naèítaná."
+
+#: if_tcl.c:1887
+msgid "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL CHYBA: návratový kód nie je celé èíslo!? Oznamte, presím, tuto "
+"chybu na vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "nedá sa preèíta riadok"
+
+#: if_xcmdsrv.c:213
+msgid "Unable to register a command server name"
+msgstr "Nemôžem zaregistrova meno príkazového servra"
+
+#: if_xcmdsrv.c:434 os_mswin.c:2108
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: meno registrovaného servra \"%s\" neexistuje"
+
+#: if_xcmdsrv.c:463
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Chyba poèas prenosu príkazu do cie¾ového programu"
+
+#: if_xcmdsrv.c:732
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Použíté chybné id servra: %s"
+
+#: if_xcmdsrv.c:1079
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: nemôžem èíta VIM registrovú vlastnos"
+
+#: if_xcmdsrv.c:1090
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM registrová žiados je zle formulovaná. Vymazané!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Neznáma vo¾ba"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Príliš mnoho upravovacích argumentov"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Chýba argument po"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Chyby za vo¾bou"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Príliš mnoho \"+príkaz\" èi \"-c príkaz\" argumentov"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Chybný argument pre"
+
+#: main.c:450
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Tento Vim nebol kompilovaný s porovnávacími funkciami."
+
+#: main.c:875
+msgid "Attempt to open script file again: \""
+msgstr "Pokus o opätovné otvorenie skriptu: \""
+
+#: main.c:879 main.c:886 main.c:930 memline.c:3673 memline.c:3677
+#: version.c:892 version.c:897 version.c:902 version.c:907 version.c:912
+#: version.c:917 version.c:923 version.c:927 version.c:931 version.c:936
+#: version.c:943 version.c:951 version.c:957
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:884
+msgid "Cannot open for reading: \""
+msgstr "Nedá sa otvori pre zápis: \""
+
+#: main.c:928
+msgid "Cannot open for script output: \""
+msgstr "Nedá sa otvori pre výstup skriptu: \""
+
+#: main.c:1044
+#, c-format
+msgid "%d files to edit\n"
+msgstr "poèet súborov pre úpravu: %d\n"
+
+#: main.c:1118
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Varovanie: Výstup nesmeruje na terminál\n"
+
+#: main.c:1120
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Varovanie: Vstup nepochádza z terminálu\n"
+
+#. just in case..
+#: main.c:1195
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc príkazový riadok"
+
+#: main.c:1230
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nedá sa èíta z \"%s\""
+
+#: main.c:2205
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Podrobnejšie informácie získáte pomocou \"vim -h\"\n"
+
+#: main.c:2238
+msgid "[file ..] edit specified file(s)"
+msgstr "[súbor ..] .. upravi súbor(y)"
+
+#: main.c:2239
+msgid "- read text from stdin"
+msgstr "- èíta text z štandardného vstupu"
+
+#: main.c:2240
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag upravi súbor na mieste definície tagu"
+
+#: main.c:2242
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [chybový súbor] upravi súbor na mieste výskytu prvej chyby"
+
+#: main.c:2251
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"použitie:"
+
+#: main.c:2254
+msgid " vim [arguments] "
+msgstr "vim [argumenty] "
+
+#: main.c:2258
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" alebo"
+
+#: main.c:2261
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2262
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tMôžu nasledova iba názvy súborov"
+
+#: main.c:2264
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tnepodarilo sa expandova žolíkové znaky (wildcards)"
+
+#: main.c:2267
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tprihlási gvim na OLE"
+
+#: main.c:2268
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-register\t\todhlási gvim z OLE"
+
+#: main.c:2271
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tspusti v GUI móde (rovnaké ako \"gvim\")"
+
+#: main.c:2272
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tPopredie: pri spustení GUI sa neoddelí od shellu"
+
+#: main.c:2274
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi mód (rovnaké ako \"vi\")"
+
+#: main.c:2275
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx mód (rovnaké ako \"ex\")"
+
+#: main.c:2276
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tTichý (dávkový) mód (iba pre \"ex\")"
+
+#: main.c:2278
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tPorovnávací mód (rovnaké ako \"vimdiff\")"
+
+#: main.c:2280
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tJednoduchý mód (rovnaké ako \"evim\", modeless)"
+
+#: main.c:2281
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tMód iba_pre_èítanie (ako \"view\")"
+
+#: main.c:2282
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tObmedzený mód (rovnaké ako \"rvim\")"
+
+#: main.c:2283
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tZmeny (ukladanie súborov) zakázané"
+
+#: main.c:2284
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZmeny v texte nie sú povolené"
+
+#: main.c:2285
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinárny mód"
+
+#: main.c:2287
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp mód"
+
+#: main.c:2289
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatabilný s Vi: 'compatible'"
+
+#: main.c:2290
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tKompatibilita s Vi vypnutá: 'nocompatible'"
+
+#: main.c:2291
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tÚroveò výpisu hlášok"
+
+#: main.c:2292
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tLadiaci mód"
+
+#: main.c:2293
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNebude vytvára odkladací súbor, bude používa iba pamä"
+
+#: main.c:2294
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tVypíše zoznam odkladacích súborov a skonèí"
+
+#: main.c:2295
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r názov súboru\tObnoví prerušené sedenie"
+
+#: main.c:2296
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tRovnaké ako -r"
+
+#: main.c:2298
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNebude používa newcli pre otvorenie okna"
+
+#: main.c:2299
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <zariadenie>\t\tPouži <zariadenie> pre I/O"
+
+#: main.c:2302
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tna spusteníe v hebrejskom móde"
+
+#: main.c:2305
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tna spusteníe vo Farsi móde"
+
+#: main.c:2307
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminál>\tNastaví typ terminálu na <terminál>"
+
+#: main.c:2308
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tPoužije <vimrc> namiesto akéhoko¾vek .vimrc"
+
+#: main.c:2310
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tPoužije <gvimrc> namiesto akéhoko¾vek .gvimrc"
+
+#: main.c:2312
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNenahrá 'plugin' skripty"
+
+#: main.c:2313
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtvorí N okien (implicitne jedno pre každý súbor)"
+
+#: main.c:2314
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tako -o ale rozdelí vertikálne"
+
+#: main.c:2315
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tNastaví kurzor na koniec súboru"
+
+#: main.c:2316
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<riadok>\t\tNastaví kurzor na <riadok>"
+
+#: main.c:2318
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <príkaz>\t\tVykoná <príkaz> pred nahraním vimrc súboru"
+
+#: main.c:2320
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <príkaz>\t\tPo nahraní prvého súboru vykoná <príkaz>"
+
+#: main.c:2321
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <sedenie>\t\tPo nahrání prvého súboru vykoná príkazy v súbore <sedenie>"
+
+#: main.c:2322
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <skript>\t\tNaèíta príkazy normálneho módu zo <skriptu>"
+
+#: main.c:2323
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <skript>\t\tPripojí všetky napísané príkazy do súboru <skript>"
+
+#: main.c:2324
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <skript>\t\tUloží všetky napísané príkazy do súboru <skript>"
+
+#: main.c:2326
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tÚprava zašifrovaných súborov"
+
+#: main.c:2330
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <displej>\tSpustí vim na <displej>"
+
+#: main.c:2332
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNepripojí sa k X serveru"
+
+#: main.c:2334
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtvorí Vim vnútri iného GTK programu."
+
+#: main.c:2338
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <súbory>\tUpravi <súbory> na Vim servri a skonèi"
+
+#: main.c:2339
+msgid "--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <súbory>\tAko --remote ale èaká na súbory pre ukonèenie úprav"
+
+#: main.c:2340
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <vo¾by>\tOdošle <vo¾by> na Vim server a skonèí"
+
+#: main.c:2341
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <výraz>\tSpusti <výraz> na servri a vytlaèí výsledok"
+
+#: main.c:2342
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVypíše zoznam mien dostupných Vim servrov a skonèí"
+
+#: main.c:2343
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <názov>\tOdošle na Vim server <názov>"
+
+#: main.c:2346
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tPoužije <viminfo> namiesto akéhoko¾vek .viminfo"
+
+#: main.c:2348
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tVypíše túto nápovedu a skonèí"
+
+#: main.c:2349
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tvypíše informácie o verzii a skonèí"
+
+#: main.c:2353
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (Motif verzia):\n"
+
+#: main.c:2356
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (Athena verzia):\n"
+
+#: main.c:2359
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <displej>\tSpustí vim na <displej>"
+
+#: main.c:2360
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tSpustí vim minimalizované"
+
+#: main.c:2362
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <názov>\t\tPoužije resource ako by vim mal <názov>"
+
+#: main.c:2363
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (nie je implementované)\n"
+
+#: main.c:2365
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <farba>\tNastaví sa <farba> pozadia (tiež -bg)"
+
+#: main.c:2366
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <farba>\tNastaví sa <farba> popredia (tiež -fg)"
+
+#: main.c:2367 main.c:2387
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <písmo>\t\tNastaví <písmo> normálneho textu (tiež -fn)"
+
+#: main.c:2368
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <písmo>\tNastaví <písmo> pre zvýraznený text"
+
+#: main.c:2369
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <písmo>\tNastaví <písmo> pre kurzívu"
+
+#: main.c:2370 main.c:2388
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geometrie>\tNastaví sa <geometria> (tiež -geom)"
+
+#: main.c:2371
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <šírka>\tNastaví <šírku> okrajov (tiež -bw)"
+
+#: main.c:2372
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <šírka> Nastaví <šírku> posuvnej lišty (tiež -sw)"
+
+#: main.c:2374
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <výška>\tNastaví <výšku> ponuky (tiež -mh)"
+
+#: main.c:2376 main.c:2389
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tPoužije reverzné farby (tiež -rv)"
+
+#: main.c:2377
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNepoužije reverzné farby (tiež +rv)"
+
+#: main.c:2378
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tNastaví zadaný <resource>"
+
+#: main.c:2381
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (RISC OS verzia):\n"
+
+#: main.c:2382
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <poèet>\t<poèet> ståpcov na okno"
+
+#: main.c:2383
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <poèet>\t<poèet> riadkov na okno"
+
+#: main.c:2386
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (GTK+ verzia):\n"
+
+#: main.c:2390
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <displej>\tspustí vim na <displej> (tiež --display)"
+
+#: main.c:2392
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tVypíše Gnome argumenty"
+
+#. Failed to send, abort.
+#: main.c:2634
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Odoslanie zlyhalo.\n"
+
+#. Let vim start normally.
+#: main.c:2639
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Odoslanie zlyhalo. Pokúšam sa spusti lokálne\n"
+
+#: main.c:2672 main.c:2693
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d upravených súborov z %d"
+
+#: main.c:2716
+msgid "Send expression failed.\n"
+msgstr "Odoslanie výrazu zlyhalo.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Nie sú nastavené žiadne znaèky"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283:\"%s\" nevyhovujú žiadne znaèky"
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"znaèka riadok ståpec súbor/text"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok riadok ståpec súbor/text"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Súborové znaèky:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Zoznam skokov (zaèínajúci najnovšou položkou):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# História znaèiek v súboroch (zaèínajúci najnovšou položkou):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "Chýba '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Chybná kódová stránka"
+
+#: mbyte.c:3103
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nedjú sa nastavi IC hodnoty"
+
+#: mbyte.c:3255
+msgid "E285: Failed to create input context"
+msgstr "E285: Nepodarilo sa vytvori vstupný kontext"
+
+#: mbyte.c:3402
+msgid "E286: Failed to open input method"
+msgstr "E286: Nepodarilo sa otvori vstupnú metódu"
+
+#: mbyte.c:3413
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Varovanie: likvidaèné spätné volanie sa nedá nastavi na IM"
+
+#: mbyte.c:3419
+msgid "E288: input method doesn't support any style"
+msgstr "E288: vstupná metóda nepodporuje žiadny štýl"
+
+#: mbyte.c:3476
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: vstupná metóda nepodporuje môj 'preedit' typ"
+
+#: mbyte.c:3550
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: Nadbodový štýl vyžaduje fontset"
+
+#: mbyte.c:3578
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Máte GTK+ verziu staršiu než 1.2.3. Stavová plocha vypnutá."
+
+#: mbyte.c:3843
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server vstupných metód nebeží"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: blok nebol zamknutý"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Chyba posunu pri èítaní odkladacieho súboru"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: Chyba pri èítaní odkladacieho súboru"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Chyba posunu pri ukladaní do odkladacieho súboru"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: Chyba pri ukladaní do odkladacieho súboru"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Odkladací súbor už existuje!"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nedá sa získa blok 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nedá sa získa blok 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Nedá sa získa blok 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ups, odkladací súbor bol stratený!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nedá sa premenova odkladací súbor"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nedá sa otvori odkladací súbor pre \"%s\", oprava nie je nemožná"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: nedá sa získa blok 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Odkladací súbor pre %s nebol nájdený"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Zadajte èíslo odkladacieho súboru, ktorý sa má použit (0 pre ukonèenie): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nedá sa otvori %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nedá sa èíta blok 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Možno nedošlo k žiadnym zmenám, alebo Vim neaktualizoval odkladací súbor."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nedá sa použi s touto verziou Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Použite Vim verziu 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s sa nezdá by odkladacím súborom Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nedá sa použí na tomto poèítaèi.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Súbor bol vytvorený "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"alebo bol súbor poškodený."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Používám odkladací súbor \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Pôvodný súbor \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Varovanie: Pôvodný súbor mohl by zmenený"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nedá sa èíta blok 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???CHÝBA MNOHO RIADKOV"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???CHYBNÝ POÈET RIADKOV"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PRÁZDNY BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???CHÝBAJÚCE RIADKY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID bloku 1 je chybné (je %s odkladacím súborom?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???CHÝBA BLOK"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "od ??? po ???END môžu by riadky pomiešané"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "od ??? po ???END môžu by vložené/vymazané riadky"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONIEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Obnova prerušená"
+
+#: memline.c:1145
+msgid "E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: V priebehu obnovy došlo k chybám; skontrolujte riadky zaèínajúce na ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Obnova dokonèená. Skontrolujte, èi je všetko v poriadku."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Zvážte uloženie tohoto súboru pod iným menom\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "a pomocou programu diff zistite zmeny oproti pôvodnému súboru.)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr "Potom vymažte odkladací súbor.\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Nájdené odkladacie súbory:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " V aktuálnom adresári:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " So zadaným menom:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " V adresári "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- žiadne --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " vlastník: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " dátum vytvorenia: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " dátum vytvorenia: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [od Vim verzie 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [nevypadá ako odkladací súbor Vim]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " názov súboru: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" dátum zmeny: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ÁNO"
+
+#: memline.c:1524
+msgid "no"
+msgstr "nie"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" užívate¾ské meno: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " názov poèítaèa: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" názov poèítaèa: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu : "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (stále aktívny)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nepoužite¾né s touto verziou Vim]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nepoužitelné na tomto poèítaèi]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [nedá sa preèíta]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [nedá sa otvori]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nedá sa zachova - odkladací súbor neexistuje."
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Súbor zachovaný"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Uchovanie sa nepodarilo"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: chybné èíslo riadku: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nedá sa nájs riadok %ld"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: chybné id ukazovate¾a na blok 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx by malo ma hodnotu 3"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Aktualizovaných príliš ve¾a blokov?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: chybné id ukazovate¾a na blok 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "vymazaný blok 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nedá sa nájs riadok %ld"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: chybné id ukazovate¾a na blok"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count má nulovú hodnotu"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: èíslo riadku je mimo rozsah: %ld (za koncom)"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: chybný poèet riadkov v bloku %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Nárast ve¾kosti zásobníku"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: chybný id ukazovate¾a na blok 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: POZOR"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Nájdený odkladací súbor s menom \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Pri otváraní súboru\""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " NOVŠÍ ako odkladací súbor!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Súbor môže by upravovaný iným programom.\n"
+" Ak je tomu tak, potom si dajte pozor, aby ste po uložení zmien\n"
+" nemali dve rôzne verzie toho istého súboru.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Ukonèite program, alebo opatrnne pokraèujte v úpravách.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Úprava tohoto súboru bola prerušená neoèakávaným ukonèením programu.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Ak je tomu tak, potom použite \":recover\" alebo \"vim -r "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" pre obnovenie zmien (viz \":help recovery)\".\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Pokia¾ ste tak už urobili, tak vymažte odkladací súbor \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" a táto správa sa už nebude objavova.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Odkladací súbor \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" už existuje!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - POZOR"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Odkladací súbor už existuje!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Otvori iba pre èítanie\n"
+"&Pokraèova v úpravách\n"
+"O&bnovi súbor\n"
+"&Koniec"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Otvori iba pre èítanie\n"
+"&Pokraèovat v úpravách\n"
+"O&bnovi súbor\n"
+"&Koniec\n"
+"&Zmaza"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Príliš mnoho odkladacích súborov"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Èas cesty k predmetu ponuky nie je podponukou"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Ponuka existuje iba v inom móde"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Ponuka tohoto mena neexistuje"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Cesta ponuky nesmie vies do podponuky"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Položky ponuky sa nedjú pridáva priamo na lištu"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Odde¾ovaè nesmie by èasou cesty ponuky"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1070
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Ponuky ---"
+
+#: menu.c:1987
+msgid "Tear off this menu"
+msgstr "Odtrhnú tuto ponuku"
+
+#: menu.c:2052
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Cesta ponuky musí vies k položke ponuky"
+
+#: menu.c:2072
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Vzor nenájdený: %s"
+
+#: menu.c:2141
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: V %s móde nie je ponuka definovaná"
+
+#: menu.c:2179
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Cesta ponuky musí vies do podponuky"
+
+#: menu.c:2200
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Ponuka nenájdená - skontrolujte názvy ponúk"
+
+#: message.c:470
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Chyba pri spracovaní %s:"
+
+#: message.c:486
+#, c-format
+msgid "line %4ld:"
+msgstr "riadok %4ld:"
+
+#: message.c:526
+msgid "[string too long]"
+msgstr "[príliš dlhý reazec]"
+
+#: message.c:672
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Správca správ: Martin Lacko <lacko@host.sk>"
+
+#: message.c:885
+msgid "Interrupt: "
+msgstr "Prerušenie: "
+
+#: message.c:888
+msgid "Hit ENTER to continue"
+msgstr "Pokraèovanie stlaèením ENTER"
+
+#: message.c:890
+msgid "Hit ENTER or type command to continue"
+msgstr "Pre pokraèovanie stlaète ENTER alebo zadajte príkaz"
+
+#: message.c:1961
+msgid "-- More --"
+msgstr "-- Pokraèovanie --"
+
+#: message.c:1964
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: riadok, MEDZERNÍK/b: stránka, d/u: 0.5 stránky, q: koniec)"
+
+#: message.c:1965
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: riadok, MEDZERNÍK: stránka, d: 0.5 stránky, q: koniec)"
+
+#: message.c:2441 message.c:2456
+msgid "Question"
+msgstr "Otázka"
+
+#: message.c:2443
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"Án&o\n"
+"&Nie"
+
+#: message.c:2458
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"Án&o\n"
+"&Nie\n"
+"&Zruši"
+
+#: message.c:2476
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"Án&o\n"
+"&Nie\n"
+"&Uloži všetko\n"
+"Zahodi &všetko\n"
+"&Zruši"
+
+#: message.c:2517
+msgid "Save File dialog"
+msgstr "Dialóg pre ukladanie súborov"
+
+#: message.c:2519
+msgid "Open File dialog"
+msgstr "Dialóg pre otváranie súborov"
+
+#. TODO: non-GUI file selector here
+#: message.c:2590
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ¼utujem, ale konzolová verzia nepodporuje prehliadaè súborov"
+
+#: misc1.c:2457
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Varovanie: mením súbor iba pre èítanie"
+
+#: misc1.c:2686
+msgid "1 more line"
+msgstr "poèet nových riadkov: 1"
+
+#: misc1.c:2688
+msgid "1 line less"
+msgstr "poèet vymazaných riadkov: 1"
+
+#: misc1.c:2693
+#, c-format
+msgid "%ld more lines"
+msgstr "poèet nových riadkov: %ld"
+
+#: misc1.c:2695
+#, c-format
+msgid "%ld fewer lines"
+msgstr "poèet vymazaných riadkov: %ld"
+
+#: misc1.c:2698
+msgid " (Interrupted)"
+msgstr " (Prerušené)"
+
+#: misc1.c:6316
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachovávam súbory...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6326
+msgid "Vim: Finished.\n"
+msgstr "Vim: ukonèený\n"
+
+#: misc2.c:661 misc2.c:677
+msgid "ERROR: "
+msgstr "CHYBA: "
+
+#: misc2.c:681
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtov] celkom uvolnené-alokované %lu-%lu, využité %lu, maximálne využitie %"
+"lu\n"
+
+#: misc2.c:683
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[volanie] celkom re/malloc(): %lu, celkom free() %lu\n"
+"\n"
+
+#: misc2.c:738
+msgid "E340: Line is becoming too long"
+msgstr "E340: Riadok sa stáva príliš dlhým"
+
+#: misc2.c:782
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Vnútorná chyba: lalloc(%ld, )"
+
+#: misc2.c:890
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Nedostatok pamäte! (alokujem %lu bytov)"
+
+#: misc2.c:2541
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Volám shell na spustenie: \"%s\""
+
+#: misc2.c:2740 misc2.c:5225 option.c:4636
+msgid "Missing colon"
+msgstr "Chýba dvojbodka"
+
+#: misc2.c:2742 misc2.c:2769
+msgid "Illegal mode"
+msgstr "Neprístupný mód"
+
+#: misc2.c:2808
+msgid "Illegal mouseshape"
+msgstr "Chybný tvar myši"
+
+#: misc2.c:2848 misc2.c:5245
+msgid "digit expected"
+msgstr "oèakávaná èíslica"
+
+#: misc2.c:2853
+msgid "Illegal percentage"
+msgstr "Neprístupné precento"
+
+#: misc2.c:3157
+msgid "Enter encryption key: "
+msgstr "Zadajte šifrovací k¾úè: "
+
+#: misc2.c:3158
+msgid "Enter same key again: "
+msgstr "Vložte k¾úè znova: "
+
+#: misc2.c:3168
+msgid "Keys don't match!"
+msgstr "K¾úè nie je správny!"
+
+#: misc2.c:3707
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Chybná cesta: '**[èíslo] musí by buï na konci cesty, alebo musí by\n"
+"nasledované '%s. Viz :help path."
+
+#: misc2.c:4979
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Adresár \"%s\" sa nedá v cdpath nájs"
+
+#: misc2.c:4982
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Súbor \"%s\" sa nepodarilo nájs"
+
+#: misc2.c:4988
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Žiadny ïalší adresár \"%s\" nebol v cdpath nájdený"
+
+#: misc2.c:4991
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Žiadny ïalší súbor \"%s\" nebol v ceste nájdený"
+
+#: misc2.c:5237
+msgid "Illegal component"
+msgstr "Neprístupný komponent"
+
+#: normal.c:2843
+msgid "Warning: terminal cannot highlight"
+msgstr "Varovanie: terminál nepodporuje zvýrazòovanie"
+
+#: normal.c:3038
+msgid "E348: No string under cursor"
+msgstr "E348: Pod kurzorom nie je žiadny reazec"
+
+#: normal.c:3040
+msgid "E349: No identifier under cursor"
+msgstr "E349: Pod kurzorom nie je žiadny identifikátor"
+
+#: normal.c:4211
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Pomocou 'foldmethod' sa nedá vymaza záhyb"
+
+#: ops.c:283
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "poèet riadkov posunutých naraz pomocou %s : 1"
+
+#: ops.c:285
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "poèet riadkov posunutých %s krát pomocou %d s : 1"
+
+#: ops.c:290
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld riadkov posunutých naraz pomocou %s"
+
+#: ops.c:293
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld riadkov posunutých pomocou %s %d krát"
+
+#: ops.c:651
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "poèet riadkov pre odsadenie: %ld"
+
+#: ops.c:701
+msgid "1 line indented "
+msgstr "poèet riadkov pre odsadenie: 1 "
+
+#: ops.c:703
+#, c-format
+msgid "%ld lines indented "
+msgstr "poèet odsadených riadkov: %ld"
+
+#. must display the prompt
+#: ops.c:1546
+msgid "cannot yank; delete anyway"
+msgstr "nedá sa kopírova; napriek tomu vymazané"
+
+#: ops.c:2080
+msgid "1 line changed"
+msgstr "poèet zmenených riadkov: 1"
+
+#: ops.c:2082
+#, c-format
+msgid "%ld lines changed"
+msgstr "poèet zmenených riadkov: %ld"
+
+#: ops.c:2439
+#, c-format
+msgid "freeing %ld lines"
+msgstr "poèet uvolòovaných riadkov: %ld"
+
+#: ops.c:2720
+msgid "1 line yanked"
+msgstr "poèet skopírovaných riadkov: 1"
+
+#: ops.c:2722
+#, c-format
+msgid "%ld lines yanked"
+msgstr "poèet skopírovaných riadkov: %ld"
+
+#: ops.c:2995
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Register %s je prázdny"
+
+#. Highlight title
+#: ops.c:3553
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registre ---"
+
+#: ops.c:4711
+msgid "Illegal register name"
+msgstr "Neprístupný názov registru"
+
+#: ops.c:4797
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registre:\n"
+
+#: ops.c:4825
+#, c-format
+msgid "Unknown register type %d"
+msgstr "%d nie je známým typom registru"
+
+#: ops.c:5217
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: '%s' nie je prístupné meno registru"
+
+#: ops.c:5560
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Buniek; "
+
+#: ops.c:5567
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Vybraných %s%ld z %ld riadkov; %ld zo %ld slov; %ld z %ld Bytov"
+
+#: ops.c:5583
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Bunka %s z %s; Riadok %ld z %ld; Slovo %ld z %ld; Byte %ld z %ld"
+
+#: ops.c:5594
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld pre BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Ïakujem za použitie Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Vo¾ba nie je podporovaná"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Nie je v modeline povolené"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tOstatné nastavenie z "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Po = je vyžadované èíslo"
+
+#: option.c:3714 option.c:4322
+msgid "Not found in termcap"
+msgstr "Nenájdený v termcapu"
+
+#: option.c:3780
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Neprístupný znak <%s>"
+
+#: option.c:4307 option.c:5570
+msgid "Not allowed here"
+msgstr "Toto nie je na tomto mieste povolené"
+
+#: option.c:4314
+msgid "Cannot set 'term' to empty string"
+msgstr "Vo¾ba 'term' nemôže by prázdna"
+
+#: option.c:4317
+msgid "Cannot change term in GUI"
+msgstr "V GUI sa nedá meni term"
+
+#: option.c:4319
+msgid "Use \":gui\" to start the GUI"
+msgstr "Použite \"gui\" pre spustenie GUI"
+
+#: option.c:4340
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "vo¾by 'backupext' a 'patchmode' majú rovnakú hodnotu"
+
+#: option.c:4638
+msgid "Zero length string"
+msgstr "Reazec s nulovou dåžkou"
+
+#: option.c:4706
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "Po <%s> chýba èíslo"
+
+#: option.c:4720
+msgid "Missing comma"
+msgstr "Chýba èiarka"
+
+#: option.c:4727
+msgid "Must specify a ' value"
+msgstr "Je nutné zada hodnotu '"
+
+#: option.c:4767
+msgid "contains unprintable character"
+msgstr "obsahuje netlaèite¾né znaky"
+
+#: option.c:4800
+msgid "Invalid font(s)"
+msgstr "Chybné písma"
+
+#: option.c:4807
+msgid "can't select fontset"
+msgstr "nedá sa vybra sada písiem"
+
+#: option.c:4809
+msgid "Invalid fontset"
+msgstr "Chybná sada písiem"
+
+#: option.c:4816
+msgid "can't select wide font"
+msgstr "nedá sa vybra široký font"
+
+#: option.c:4818
+msgid "Invalid wide font"
+msgstr "Chybné široké písmo"
+
+#: option.c:5088
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Neprístupný znak po <%c>"
+
+#: option.c:5171
+msgid "comma required"
+msgstr "je nutná èiarka"
+
+#: option.c:5179
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'komentár' musí by prázdny alebo musí obsahova %s"
+
+#: option.c:5226
+msgid "No mouse support"
+msgstr "Bez podpory myši"
+
+#: option.c:5472
+msgid "Unclosed expression sequence"
+msgstr "Neuzatvorené zoskupenie výrazov"
+
+#: option.c:5476
+msgid "too many items"
+msgstr "príliš mnoho položiek"
+
+#: option.c:5478
+msgid "unbalanced groups"
+msgstr "nevyvážené skupiny"
+
+#: option.c:5693
+msgid "A preview window already exists"
+msgstr "Okno náh¾adu už existuje"
+
+#: option.c:5954 option.c:5983
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "hodnota vo¾by 'winheight' nesmie by menšia než hodnota vo¾by 'winminheight'"
+
+#: option.c:5999 option.c:6018
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "hodnota vo¾by 'winwidth' nesmie by menšia než hodnota vol¾y 'winminwidth'"
+
+#: option.c:6159
+#, c-format
+msgid "Need at least %d lines"
+msgstr "Minimálne potrebný poèet riadkov: %d"
+
+#: option.c:6168
+#, c-format
+msgid "Need at least %d columns"
+msgstr "Minimálne potrebný poèet ståpcov: %d"
+
+#: option.c:6465
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Neznáma vo¾ba: %s"
+
+#: option.c:6574
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kódy terminálu ---"
+
+#: option.c:6576
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Nastavenie globálnych volieb ---"
+
+#: option.c:6578
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Nastavenie globálnych volieb ---"
+
+#: option.c:6580
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Možnosti ---"
+
+#: option.c:7269
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp CHYBA"
+
+#: option.c:8227
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': pre %s chýba vyhovujúci znak"
+
+#: option.c:8261
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': nadbytoèné znaky po bodkoèiarke: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "nedá sa otvori "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nedá sa otvori okno!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Je potrebná Amigados verzia 2.04 alebo novšia\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Potrebný %s verzia %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Nedá sa otvori NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "Nedá sa vytvori "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ukonèený s %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "nemôžem zmeni konzolový mód ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1177 os_mswin.c:629 os_riscos.c:757 os_unix.c:2803
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Nastavovanie režimu obrazovky nie je podporované"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: nie je konzolou??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nedá sa spusti shell s -f vo¾bou"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Nedá sa spusti "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " vrátené\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE príliš malá."
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O CHYBA"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(skrátené)"
+
+#: os_mswin.c:604
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'ståpce' nie je 80, nemôžem spusti externý príkaz"
+
+#: os_mswin.c:716 os_unix.c:5116
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Vyvolanie knižniènej funkcia zlyhalo pre \"%s()\""
+
+#: os_mswin.c:1365
+msgid "E237: Printer selection failed"
+msgstr "E237: Zlyhal výber tlaèiarne"
+
+#: os_mswin.c:1405
+#, c-format
+msgid "to %s on %s"
+msgstr "%s na %s"
+
+#: os_mswin.c:1420
+#, c-format
+msgid "E448: Unknown font: %s"
+msgstr "E448: Neznáme písmo: %s"
+
+#: os_mswin.c:1470 os_mswin.c:1480
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Chyba tlaèe: %s"
+
+#: os_mswin.c:1481
+msgid "Unknown"
+msgstr "Neznámy"
+
+#: os_mswin.c:1508
+#, c-format
+msgid "Printing '%s'"
+msgstr "Tlaèím '%s'"
+
+#: os_mswin.c:2596
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Chybný názov znakovej sady \"%s\" v názve písma \"%s\""
+
+#: os_mswin.c:2604
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Chybný znak '%c' v názve písma \"%s\""
+
+#: os_riscos.c:1256
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Chybná 'osfiletype' vo¾ba - použitie Textu"
+
+#: os_unix.c:862
+msgid "Vim: Double signal, exiting\n"
+msgstr "VIm: dvojitý signál, konèím\n"
+
+#: os_unix.c:868
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Zachytený smrtiaci signál %s\n"
+
+#: os_unix.c:871
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Zachytený smrtiaci signál\n"
+
+#: os_unix.c:1125
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Otváram X displej - zaberie %ld msec"
+
+#: os_unix.c:1152
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: chyba X\n"
+
+#: os_unix.c:1219
+msgid "Testing the X display failed"
+msgstr "Testovanie X displeja zlyhalo"
+
+#: os_unix.c:1363
+msgid "Opening the X display timed out"
+msgstr "Uplynul èas otvorenia X displeja"
+
+#: os_unix.c:2976 os_unix.c:3634
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Nedá sa spusti shell "
+
+#: os_unix.c:3021
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nedá sa spusti sh shell\n"
+
+#: os_unix.c:3025 os_unix.c:3640
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+" návratová hodnota shellu "
+
+#: os_unix.c:3159
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nedjú sa vytvori rúry\n"
+
+#: os_unix.c:3174
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Vyvolanie fork zlyhalo\n"
+
+#: os_unix.c:3647
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Príkaz ukonèený\n"
+
+#: os_unix.c:5164
+msgid "Opening the X display failed"
+msgstr "Otvorenie X displeja zlyhalo"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Na riadku"
+
+#: os_win16.c:578 os_win32.c:3037
+#, c-format
+msgid "shell returned %d"
+msgstr "návratová hodnota shellu %d"
+
+#: os_win32.c:2505
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Zachytená udalos %s\n"
+
+#: os_win32.c:2507
+msgid "close"
+msgstr "zavrie"
+
+#: os_win32.c:2509
+msgid "logoff"
+msgstr "odhlási"
+
+#: os_win32.c:2510
+msgid "shutdown"
+msgstr "vypnú"
+
+#: os_win32.c:2991
+msgid "E371: Command not found"
+msgstr "E371: Príkaz nenájdený"
+
+#: os_win32.c:3004
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE nenájdený v $PATH.\n"
+"Po dokonèení externých príkazov nebude výstup pozastavený.\n"
+"Pozrite :help win32-vimrun pre viac informácií."
+
+#: os_win32.c:3007
+msgid "Vim Warning"
+msgstr "Vim Varovanie"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Nemôžem nahra vim32.dll!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM Chyba"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nemôžem opravi odkazy funkcie na DLL!"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Príliš mnoho %%%c vo formátovacom reazci"
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Neoèakávaný výskyt %%%c vo formátovacom reazci"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: Vo formátovacom reazci chýba ]"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Nepodporovaná formátová špecifikácia %%%c vo formátovacom reazci"
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Neprístupné %%%c v prefixe formátovacieho reazca"
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Neprístupné %%%c vo formátovacom reazci"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' neobsahuje žiadny vzor"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Chýbajúci alebo prázdny názov adresára"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "Žiadne ïalšie položky"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d/%d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (riadok vymazaný)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Koniec quickfix zoznamu"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Zaèiatok quickfix zoznamu"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "zoznam chýb %d z %d; poèet chýb: %d"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nedá sa uloži, je nastavená vo¾ba 'buftype'"
+
+#: regexp.c:802
+msgid "E339: Pattern too long"
+msgstr "E339: Vzor je príliš dlhý"
+
+#: regexp.c:1319
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Vhniezdený %s*"
+
+#: regexp.c:1322
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Vhniezdené %s%c"
+
+#: regexp.c:1473
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c niè nenasleduje"
+
+#: regexp.c:2490
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Chyba syntaxe v %s{...}"
+
+#: regexp.c:2737
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Zachytené preteèenie zásobníku: príliš zložitý regulárny výraz?"
+
+#: regexp.c:2872
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: vzor spôsobil preteèenie zásobníku"
+
+#: regexp.c:3108
+msgid "External submatches:\n"
+msgstr "Vnútorné podradené zhody:\n"
+
+#: screen.c:2063
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld riadkov zahnutých "
+
+#: screen.c:7517
+msgid " VREPLACE"
+msgstr " NAHRADI VERTIKÁLNE"
+
+#: screen.c:7521
+msgid " REPLACE"
+msgstr " NAHRADI"
+
+#: screen.c:7526
+msgid " REVERSE"
+msgstr " OBRÁTI"
+
+#: screen.c:7528
+msgid " INSERT"
+msgstr " VLOŽI"
+
+#: screen.c:7531
+msgid " (insert)"
+msgstr " (vloži)"
+
+#: screen.c:7533
+msgid " (replace)"
+msgstr " (nahradi)"
+
+#: screen.c:7535
+msgid " (vreplace)"
+msgstr " (nahradi vertikálne)"
+
+#: screen.c:7538
+msgid " Hebrew"
+msgstr " hebrejský"
+
+#: screen.c:7546
+msgid " (lang)"
+msgstr " (jazyk)"
+
+#: screen.c:7549
+msgid " (paste)"
+msgstr " (vloži)"
+
+#: screen.c:7555
+msgid " SELECT"
+msgstr " ZHODY"
+
+#: screen.c:7557
+msgid " VISUAL"
+msgstr " VIZUÁLNE"
+
+#: screen.c:7559
+msgid " BLOCK"
+msgstr " BLOK"
+
+#: screen.c:7561
+msgid " LINE"
+msgstr " RIADOK"
+
+#: screen.c:7574 screen.c:7634
+msgid "recording"
+msgstr "nahrávam"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "h¾adanie dosiahlo zaèiatok, pokraèovanie od konca"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "h¾adanie dosiahlo koniec, pokraèovanie od zaèiatku"
+
+#: search.c:455
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Neprístupný h¾adaný reazec: %s"
+
+#: search.c:782
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: h¾adanie dosiahlo zaèiatok bez nájdenia %s"
+
+#: search.c:784
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: h¾adanie dosiahlo koniec bez nájdenia %s"
+
+#: search.c:1144
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Po ';' oèakávam '?' alebo '/'"
+
+#: search.c:3523
+msgid " (includes previously listed match)"
+msgstr " (vrátane už vypísaných zhôd)"
+
+#. cursor at status line
+#: search.c:3543
+msgid "--- Included files "
+msgstr "--- Vložené súbory"
+
+#: search.c:3545
+msgid "not found "
+msgstr "nenájdené "
+
+#: search.c:3546
+msgid "in path ---\n"
+msgstr "v ceste ---\n"
+
+#: search.c:3585
+msgid " (Already listed)"
+msgstr " (Už vypísané)"
+
+#: search.c:3587
+msgid " NOT FOUND"
+msgstr " NENÁJDENÉ"
+
+#: search.c:3639
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Preh¾adávam vložené súbory: %s"
+
+#: search.c:3857
+msgid "E387: Match is on current line"
+msgstr "E387: Zhoda je na aktuálnom riadku"
+
+#: search.c:3997
+msgid "All included files were found"
+msgstr "Všetky vložené súbory boli nájdené"
+
+#: search.c:3999
+msgid "No included files"
+msgstr "Žiadne vložené súbory"
+
+#: search.c:4015
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nedá sa nájs definícia"
+
+#: search.c:4017
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nedá sa nájs vzor"
+
+#: syntax.c:2999
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Neprístupný argument: %s"
+
+#: syntax.c:3179
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Syntaktická zostava %s neexistuje"
+
+#: syntax.c:3343
+msgid "No Syntax items defined for this buffer"
+msgstr "Pre tento buffer nie sú definované žiadne položky syntaxe"
+
+#: syntax.c:3351
+msgid "syncing on C-style comments"
+msgstr "synchronizujem komentáre v C štýle"
+
+#: syntax.c:3359
+msgid "no syncing"
+msgstr "žiadne synchronizácie"
+
+#: syntax.c:3362
+msgid "syncing starts "
+msgstr "synchronizácia zaèína "
+
+#: syntax.c:3364 syntax.c:3439
+msgid " lines before top line"
+msgstr " riadkov pred zaèiatkom"
+
+#: syntax.c:3369
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Položky synchronizácie syntaxe ---"
+
+#: syntax.c:3374
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizujem položky"
+
+#: syntax.c:3380
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Položky syntaxe ---"
+
+#: syntax.c:3403
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Syntaktická zostava %s neexistuje"
+
+#: syntax.c:3429
+msgid "minimal "
+msgstr "minimálne "
+
+#: syntax.c:3436
+msgid "maximal "
+msgstr "maximálne "
+
+#: syntax.c:3448
+msgid "; match "
+msgstr "; zhoda "
+
+#: syntax.c:3450
+msgid " line breaks"
+msgstr " riadkov"
+
+#: syntax.c:4078
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here nesmie by na tomto mieste"
+
+#: syntax.c:4102
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Pre %s chýba položka regiónu"
+
+#: syntax.c:4130
+msgid "E395: contains argument not accepted here"
+msgstr "E395: obsahuje argumenty, ktoré tu nie sú povolené"
+
+#: syntax.c:4141
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: obsahuje argumenty, ktoré tu nie sú povolené"
+
+#: syntax.c:4219
+msgid "E397: Filename required"
+msgstr "E397: Vyžadovaný názov súboru"
+
+#: syntax.c:4557
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Chýba '=': %s"
+
+#: syntax.c:4715
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Príliš málo argumentov: oblas syntaxe %s"
+
+#: syntax.c:5046
+msgid "E400: No cluster specified"
+msgstr "E400: Nebola zadaná žiadna zostava"
+
+#: syntax.c:5083
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Odde¾ovaè vzoru %s nenájdený"
+
+#: syntax.c:5158
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Chyba za vzorom %s"
+
+#: syntax.c:5245
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: synchronizácia syntaxe: vzor pokraèovania riadkov zadaný dvakrát"
+
+#: syntax.c:5302
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Chybné argumenty: %s"
+
+#: syntax.c:5352
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Chýba znamienko rovnása: %s"
+
+#: syntax.c:5358
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Prázdny argument: %s"
+
+#: syntax.c:5385
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s tu nie je povolené"
+
+#: syntax.c:5392
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musí by prvý v 'contains' zozname"
+
+#: syntax.c:5462
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Neznámy názov skupiny: %s"
+
+#: syntax.c:5692
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Chybný podradený príkaz :syntax : %s "
+
+#: syntax.c:6071
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: skupina zvíraznenia %s nebola nájdená"
+
+#: syntax.c:6095
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Príliš málo argumentov: \":highlight link %s\""
+
+#: syntax.c:6102
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Príliš mnoho argumentov: \":highlight link %s\""
+
+#: syntax.c:6122
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: skupina je nastavená, odkaz na zvýrazòovaciu skupinu ignorovaný"
+
+#: syntax.c:6251
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: neoèakávané znamienko rovnása : %s"
+
+#: syntax.c:6287
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: chýba znamienko rovnása: %s"
+
+#: syntax.c:6309
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: chýba argument: %s"
+
+#: syntax.c:6346
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Neprípustná hodnota: %s"
+
+#: syntax.c:6465
+msgid "E419: FG color unknown"
+msgstr "E419: farba popredia nie je známa"
+
+#: syntax.c:6476
+msgid "E420: BG color unknown"
+msgstr "E420: farba pozadia nie je známa"
+
+#: syntax.c:6537
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Názov alebo èíslo farby %s nebolo rozpoznané"
+
+#: syntax.c:6745
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminálový kód %s je príliš dlhý"
+
+#: syntax.c:6792
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Neprístupný argument: %s"
+
+#: syntax.c:7321
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Je používané príliš velké množstvo odlišných zvýrazòovacích vlastností"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "koniec zoznamu tagov"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "zaèiatok zoznamu tagov"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Nedá sa skoèi pred prvý vyhovujúci tag"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tag %s nenájdený"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "súbor\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Zadajte èíslo (<CR> pre ukonèenie): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Vyhovuje iba jeden tag"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Za posledný vyhovujúci tag sa nedá preskoèi"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Súbor \"%s\" neexistuje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d z celkového poètu %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " alebo viac"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Používam tag s písmom inej ve¾kosti!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Súbor \"%s\" neexistuje"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # CIE¼ tag ŠTART riadok v súbore/texte"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Lineárne h¾adanie tagu"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binárne h¾adanie tagu"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Preh¾adávam súbor tagov %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Súbor tagov %s bol orezaný\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Chyba formátu v súbore tagov \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "Pred bajtom %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Obsah súboru tagov %s nie je zoradený"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: Žiadny súbor tagov"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nedá sa nájs vzor tagov"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Tag sa nedá nájs, iba hádam!"
+
+#: term.c:1737
+msgid "' not known. Available builtin terminals are:"
+msgstr "' nie je známy. Dostupné vstavané terminály:"
+
+#: term.c:1761
+msgid "defaulting to '"
+msgstr "nastavujem na '"
+
+#: term.c:2114
+msgid "Cannot open termcap file"
+msgstr "Nedá sa otvori termcap súbor"
+
+#: term.c:2117
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminfo neobsahuje položku pre tento terminál"
+
+#: term.c:2119
+msgid "Terminal entry not found in termcap"
+msgstr "Termcap neobsahuje položku pre tento terminál"
+
+#: term.c:2278
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Termcap neobsahuje položku pre \"%s\""
+
+#: term.c:2752
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminál musí ma \"cm\" schopnos"
+
+#. Highlight title
+#: term.c:4891
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klávesy terminálu ---"
+
+#: ui.c:251
+msgid "new shell started\n"
+msgstr "spustený nový shell\n"
+
+#: ui.c:1747
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Chyba pri èítaní vstupu, konèím...\n"
+
+#. must display the prompt
+#: undo.c:383
+msgid "No undo possible; continue anyway"
+msgstr "Odstránenie zmien nie je možné; chcete napriek tomu pokraèova"
+
+#: undo.c:538
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: èísla riadkov sú chybné"
+
+#: undo.c:707
+msgid "1 change"
+msgstr "poèet zmien: 1"
+
+#: undo.c:709
+#, c-format
+msgid "%ld changes"
+msgstr "poèet zmien: %ld"
+
+#: undo.c:753
+msgid "E439: undo list corrupt"
+msgstr "E439: záznam o zmenách poškodený"
+
+#: undo.c:785
+msgid "E440: undo line missing"
+msgstr "E440: chýba riadok spä"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:725
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitová GUI verzia pre MS Windows"
+
+#: version.c:727
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitová GUI verzia pre MS Windows"
+
+#: version.c:730
+msgid " in Win32s mode"
+msgstr " v Win32 režime"
+
+#: version.c:732
+msgid " with OLE support"
+msgstr " s OLE podporou"
+
+#: version.c:735
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitová verzia pre MS Windows konzolu"
+
+#: version.c:739
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitová verzia pre MS Windows"
+
+#: version.c:743
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitová verzia pre MS-DOS"
+
+#: version.c:745
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitová MS-DOS verzia"
+
+#: version.c:751
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) verzia"
+
+#: version.c:753
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X verzia"
+
+#: version.c:756
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS verzia"
+
+#: version.c:761
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS verzia"
+
+#: version.c:771
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Použité záplaty: "
+
+#: version.c:797 version.c:1132
+msgid "Modified by "
+msgstr "Zmenil "
+
+#: version.c:804
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Preložená "
+
+#: version.c:807
+msgid "by "
+msgstr " "
+
+#: version.c:819
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Maximálna verzia"
+
+#: version.c:822
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Ve¾ká verzia "
+
+#: version.c:825
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normálna verzia"
+
+#: version.c:828
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Malá verzia "
+
+#: version.c:830
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Minimálna verzia "
+
+#: version.c:836
+msgid "without GUI."
+msgstr "bez grafického rozhrania."
+
+#: version.c:840
+msgid "with GTK-GNOME GUI."
+msgstr "s rozhraním GTK-GNOME."
+
+#: version.c:842
+msgid "with GTK GUI."
+msgstr "s rozhraním GTK."
+
+#: version.c:846
+msgid "with X11-Motif GUI."
+msgstr "s rozhraním X11-Motif."
+
+#: version.c:849
+msgid "with X11-Athena GUI."
+msgstr "s rozhraním X11-Athena."
+
+#: version.c:852
+msgid "with BeOS GUI."
+msgstr "s rozhraním BeOS."
+
+#: version.c:855
+msgid "with Photon GUI."
+msgstr "s rozhraním Photon."
+
+#: version.c:858
+msgid "with GUI."
+msgstr "s grafickým rozhraním."
+
+#: version.c:861
+msgid "with Carbon GUI."
+msgstr "s Carbon grafickým rozhraním."
+
+#: version.c:864
+msgid "with Cocoa GUI."
+msgstr "s Cocoa grafickým rozhraním."
+
+#: version.c:867
+msgid "with (classic) GUI."
+msgstr "s (klasickým) grafickým rozhraním."
+
+#: version.c:878
+msgid " Features included (+) or not (-):\n"
+msgstr " Vlastnosti zahrnuté (+) a nezahrnuté (-):\n"
+
+#: version.c:890
+msgid " system vimrc file: \""
+msgstr " systémový vimrc súbor: \""
+
+#: version.c:895
+msgid " user vimrc file: \""
+msgstr " užívate¾ský vimrc súbor: \""
+
+#: version.c:900
+msgid " 2nd user vimrc file: \""
+msgstr " druhý užívate¾ský vimrc súbor: \""
+
+#: version.c:905
+msgid " 3rd user vimrc file: \""
+msgstr " tretí užívate¾ský vimrc súbor: \""
+
+#: version.c:910
+msgid " user exrc file: \""
+msgstr " užívate¾ský exrc súbor: \""
+
+#: version.c:915
+msgid " 2nd user exrc file: \""
+msgstr " druhý užívate¾ský exrc súbor: \""
+
+#: version.c:921
+msgid " system gvimrc file: \""
+msgstr " systémový gvimrc súbor: \""
+
+#: version.c:925
+msgid " user gvimrc file: \""
+msgstr " užívate¾ský gvimrc súbor: \""
+
+#: version.c:929
+msgid "2nd user gvimrc file: \""
+msgstr "druhý užívate¾ský gvimrc súbor: \""
+
+#: version.c:934
+msgid "3rd user gvimrc file: \""
+msgstr "tretí užívate¾ský gvimrc súbor: \""
+
+#: version.c:941
+msgid " system menu file: \""
+msgstr " systémový súbor s ponukou: \""
+
+#: version.c:949
+msgid " fall-back for $VIM: \""
+msgstr " implicitná hodnota $VIM:\""
+
+#: version.c:955
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " f-b pre $VIMRUNTIME: \""
+
+#: version.c:959
+msgid "Compilation: "
+msgstr "Preklad: "
+
+#: version.c:965
+msgid "Compiler: "
+msgstr "Prekladaè: "
+
+#: version.c:970
+msgid "Linking: "
+msgstr "Linkujem: "
+
+#: version.c:975
+msgid " DEBUG BUILD"
+msgstr " PODPORA LADENIA"
+
+#: version.c:1011
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMpreved"
+
+#: version.c:1013
+msgid "version "
+msgstr "verzia "
+
+#: version.c:1014
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar a ïalší"
+
+#: version.c:1018
+msgid "Vim is open source and freely distributable"
+msgstr "Vim je vo¾ne šírite¾ný program"
+
+#: version.c:1020
+msgid "Help poor children in Uganda!"
+msgstr "Pomôžte chudobným deom v Ugande!"
+
+#: version.c:1021
+msgid "type :help iccf<Enter> for information "
+msgstr "podrobnejšie informácie získate pomocou :help iccf<Enter>"
+
+#: version.c:1023
+msgid "type :q<Enter> to exit "
+msgstr "zadajte :q<Enter> pre ukonèenie programu"
+
+#: version.c:1024
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "zadajte :help<Enter> alebo <F1> pre pomocníka"
+
+#: version.c:1025
+msgid "type :help version6<Enter> for version info"
+msgstr "zadajte :help version6<Enter> pre informácie o verzii"
+
+#: version.c:1028
+msgid "Running in Vi compatible mode"
+msgstr "Bežím v režime kompatibility s Vi"
+
+#: version.c:1029
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "zadajte :set nocp<Enter> pre implicitné nastavenie Vim"
+
+#: version.c:1030
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "podrobnejšie informácie získate pomocou :help cp-default<Enter>"
+
+#: version.c:1045
+msgid "menu Help->Orphans for information "
+msgstr "bližšie informácie v menu Pomocník->Samostatné"
+
+#: version.c:1047
+msgid "Running modeless, typed text is inserted"
+msgstr "Spúšam modeless, písaný text je vložený"
+
+#: version.c:1048
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Úpravy->Globálne možnosti->Prepnú režim vloženia "
+
+#: version.c:1049
+msgid " for two modes "
+msgstr " pre dva režimy "
+
+#: version.c:1053
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Úpravy->Globálne možnostt->Prepnú Vi kompatibilný režím"
+
+#: version.c:1054
+msgid " for Vim defaults "
+msgstr " pre predvolené vlastnosti Vim "
+
+#: version.c:1100
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "VAROVANIE: detekované Windows 95/98/ME"
+
+#: version.c:1103
+msgid "type :help windows95<Enter> for info on this"
+msgstr "zadajte :help windows95<Enter> pre podrobnejšie informácie"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Nenájdené žiadne okno náh¾adu"
+
+#: window.c:580
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Okno sa nedá rozdeli zároveò topleft a botright"
+
+#: window.c:1339
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nedá sa rotova, ak je iné okno rozdelené"
+
+#: window.c:1841
+msgid "E444: Cannot close last window"
+msgstr "E444: Posledné okno sa nedá zatvori"
+
+#: window.c:2505
+msgid "Already only one window"
+msgstr "Už existuje iba jedno okno"
+
+#: window.c:2552
+msgid "E445: Other window contains changes"
+msgstr "E445: Iné okno obsahuje zmeny"
+
+#: window.c:4379
+msgid "E446: No file name under cursor"
+msgstr "E446: Pod kurzorom sa nenachádza názov súboru"
+
+#: window.c:4498
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Súbor \"%s\" sa nedá v cdpath nájs"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Upravi s viacnásobný&m Vimom"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Upravi s jedným &Vimom"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Upravi s &Vimom"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Upravi s existujúcim Vimom - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Upravi vybrané súbory s Vimom"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Chyba vytváracieho procesu: Skontrolujte, èi je gvim vo vašej ceste!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "chyba gvimext.dll"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Príliš dlhá cesta!"
+
+#: globals.h:900
+msgid "--No lines in buffer--"
+msgstr "--Buffer neobsahuje žiadny riadok--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1042
+msgid "Command aborted"
+msgstr "Príkaz prerušený"
+
+#: globals.h:1043
+msgid "Argument required"
+msgstr "Je vyžadovaný argument"
+
+#: globals.h:1044
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ by malo nasledova /. ? alebo &"
+
+#: globals.h:1046
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Chybný príkaz v okne príkazového riadku; <Enter> spustíte, CTRL-C "
+"vypnete"
+
+#: globals.h:1048
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Príkaz nie je z exrc/vimrc v aktuálnom adresári alebo pri h¾adaní tagu "
+"povolený."
+
+#: globals.h:1049
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Súbor existuje (použite ! pre vynútenie)"
+
+#: globals.h:1050
+msgid "Command failed"
+msgstr "Príkaz zlyhal"
+
+#: globals.h:1051
+msgid "Internal error"
+msgstr "Vnútorná chyba"
+
+#: globals.h:1052
+msgid "Interrupted"
+msgstr "Prerušené"
+
+#: globals.h:1053
+msgid "E14: Invalid address"
+msgstr "E14: Chybná adresa"
+
+#: globals.h:1054
+msgid "Invalid argument"
+msgstr "Chybný argument"
+
+#: globals.h:1055
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Chybný argument: %s"
+
+#: globals.h:1057
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Chybný výraz: %s"
+
+#: globals.h:1059
+msgid "E16: Invalid range"
+msgstr "E16: Chybný rozsah"
+
+#: globals.h:1060
+msgid "Invalid command"
+msgstr "Chybný príkaz"
+
+#: globals.h:1062
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" je adresárom"
+
+#: globals.h:1065
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Neoèekávané znaky pred '='"
+
+#: globals.h:1067
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Znaèka má chybné èíslo riadku"
+
+#: globals.h:1068
+msgid "E20: Mark not set"
+msgstr "E20: Znaèka nie je nastavená"
+
+#: globals.h:1069
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nedá sa meni, je nastavená vo¾ba 'modifiable'"
+
+#: globals.h:1070
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript vnorený príliš hlboko"
+
+#: globals.h:1071
+msgid "E23: No alternate file"
+msgstr "E23: Žiadny alternatívny súbor"
+
+#: globals.h:1072
+msgid "E24: No such abbreviation"
+msgstr "E24: Taká skratka neexistuje"
+
+#: globals.h:1073
+msgid "No ! allowed"
+msgstr "! nie je povolené"
+
+#: globals.h:1075
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: Nedá sa použí GUI: nebolo zapnuté pri preklade programu"
+
+#: globals.h:1078
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Nedá sa použí hebrejský režim: nebol zapnutý pri preklade programu\n"
+
+#: globals.h:1081
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Nedá sa použí farsi režim: nebol zapnutý pri preklade programu\n"
+
+#: globals.h:1084
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Skupina zvíraznenia %s neexistuje"
+
+#: globals.h:1086
+msgid "E29: No inserted text yet"
+msgstr "E29: Zatia¾ nie je žiadny vložený text"
+
+#: globals.h:1087
+msgid "E30: No previous command line"
+msgstr "E30: Žiadny predchádzajúci príkazový riadok"
+
+#: globals.h:1088
+msgid "E31: No such mapping"
+msgstr "E31: Žiadne také mapovanie"
+
+#: globals.h:1089
+msgid "No match"
+msgstr "Žiadna zhoda"
+
+#: globals.h:1090
+#, c-format
+msgid "No match: %s"
+msgstr "Žiadna zhoda: %s"
+
+#: globals.h:1091
+msgid "E32: No file name"
+msgstr "E32: Žiadny názov súboru"
+
+#: globals.h:1092
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Žiadny predchádzajúci prislúchajúci správny výraz"
+
+#: globals.h:1093
+msgid "E34: No previous command"
+msgstr "E34: Žiadny predchádzajúci príkaz"
+
+#: globals.h:1094
+msgid "E35: No previous regular expression"
+msgstr "E35: Žiadny predchádzajúci regulárny výraz"
+
+#: globals.h:1095
+msgid "No range allowed"
+msgstr "Rozsah nie je povolený"
+
+#: globals.h:1097
+msgid "E36: Not enough room"
+msgstr "E36: Nedostatok miesta"
+
+#: globals.h:1099
+#, c-format
+msgid "Can't create file %s"
+msgstr "Nedá sa vytvori súbor %s"
+
+#: globals.h:1100
+msgid "Can't get temp file name"
+msgstr "Nedá sa získa názov doèasného súboru"
+
+#: globals.h:1101
+#, c-format
+msgid "Can't open file %s"
+msgstr "Nedá sa otvori súbor %s"
+
+#: globals.h:1102
+#, c-format
+msgid "Can't read file %s"
+msgstr "Nedá sa èíta súbor %s"
+
+#: globals.h:1103
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: Neuložené zmeny (použite ! pre vynútenie)"
+
+#: globals.h:1104
+msgid "E38: Null argument"
+msgstr "E38: Nulový argument"
+
+#: globals.h:1106
+msgid "E39: Number expected"
+msgstr "E39: Oèakávané èíslo"
+
+#: globals.h:1109
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nedá sa otvori chybový súbor %s"
+
+#: globals.h:1112
+msgid "E41: Out of memory!"
+msgstr "E41: Nedostatok pamäti!"
+
+#: globals.h:1115
+msgid "Pattern not found"
+msgstr "Vzor nenájdený"
+
+#: globals.h:1117
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Vzor nenájdený: %s"
+
+#: globals.h:1118
+msgid "Argument must be positive"
+msgstr "Argument musí by kladný"
+
+#: globals.h:1120
+msgid "E42: No Errors"
+msgstr "E42: Žiadne chyby"
+
+#: globals.h:1122
+msgid "E43: Damaged match string"
+msgstr "E43: Poškodený reazac pre vyh¾adávanie"
+
+#: globals.h:1123
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Poškodený regexp program"
+
+#: globals.h:1124
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: nastavená vo¾ba 'iba_pre_èítanie' (použite ! pre vynútenie)"
+
+#: globals.h:1126
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nedá sa nastavi premenná iba_pre_èítanie \"%s\""
+
+#: globals.h:1129
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Chyba pri èítaní chybového súboru"
+
+#: globals.h:1132
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Nie je v bezpeènostnej schránke povolené"
+
+#: globals.h:1134
+msgid "E49: Invalid scroll size"
+msgstr "E49: Chybná hodnota premennej 'scroll'"
+
+#: globals.h:1135
+msgid "E91: 'shell' option is empty"
+msgstr "E91: vo¾ba 'shell' je prázdna"
+
+#: globals.h:1136
+msgid "E72: Close error on swap file"
+msgstr "E72: Chyba pri uzatváraní odkladacieho súboru"
+
+#: globals.h:1137
+msgid "E73: tag stack empty"
+msgstr "E73: zoznam tagov je prázdny"
+
+#: globals.h:1138
+msgid "E74: Command too complex"
+msgstr "E74: Príkaz je príliš zložitý"
+
+#: globals.h:1139
+msgid "E75: Name too long"
+msgstr "E75: Názov je príliš dlhý"
+
+#: globals.h:1140
+msgid "E76: Too many ["
+msgstr "E76: Príliš mnoho ["
+
+#: globals.h:1141
+msgid "E77: Too many file names"
+msgstr "E77: Príliš mnoho názvov súborov"
+
+#: globals.h:1142
+msgid "Trailing characters"
+msgstr "Nadbytoèné znaky na konci"
+
+#: globals.h:1143
+msgid "E78: Unknown mark"
+msgstr "E78: Neznáma znaèka"
+
+#: globals.h:1144
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nedá sa expandova žolíkové znaky (wildcards)"
+
+#: globals.h:1145
+msgid "E80: Error while writing"
+msgstr "E80: Chyba pri ukladaní"
+
+#: globals.h:1146
+msgid "Zero count"
+msgstr "Nulový poèet"
+
+#: globals.h:1148
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Použitie <SID> mimo kontext skriptu"
+
+#: globals.h:1151
+msgid "E449: Invalid expression received"
+msgstr "E449: Bol prijatý chybný výraz"
+
diff --git a/src/po/sk.po b/src/po/sk.po
new file mode 100644
index 000000000..00fe87c5f
--- /dev/null
+++ b/src/po/sk.po
@@ -0,0 +1,5998 @@
+# Slovak translation of vim
+# Martin Lacko <lacko@host.sk>, 2001.
+#
+# Original translations.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim\n"
+"POT-Creation-Date: 2002-03-26 21:54+0100\n"
+"PO-Revision-Date: 2002-03-26 21:58CEST\n"
+"Last-Translator: Martin Lacko <lacko@host.sk>\n"
+"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 0.9.5\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Nedá sa alokova» buffer, konèím..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Nedá sa alokova» buffer, pou¾ijem iný..."
+
+#: buffer.c:706
+msgid "No buffers were unloaded"
+msgstr "®iadny buffer nebol nájdený"
+
+#: buffer.c:708
+msgid "No buffers were deleted"
+msgstr "®iadny buffer nebol vymazaný"
+
+#: buffer.c:710
+msgid "No buffers were wiped out"
+msgstr "®iadny buffer nebol vymazaný"
+
+#: buffer.c:718
+msgid "1 buffer unloaded"
+msgstr "poèet deaktivovaných bufferov: 1"
+
+#: buffer.c:720
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "poèet deaktivovaných bufferov: %d"
+
+#: buffer.c:725
+msgid "1 buffer deleted"
+msgstr "poèet vymazaných bufferov: 1"
+
+#: buffer.c:727
+#, c-format
+msgid "%d buffers deleted"
+msgstr "poèet vymazaných bufferov: %d"
+
+#: buffer.c:732
+msgid "1 buffer wiped out"
+msgstr "poèet vymazaných bufferov: 1"
+
+#: buffer.c:734
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "poèet vymazaných bufferov: %d"
+
+#: buffer.c:791
+msgid "E84: No modified buffer found"
+msgstr "E84: Nebol nájdený ¾iadny zmenený buffer"
+
+#. back where we started, didn't find anything.
+#: buffer.c:830
+msgid "E85: There is no listed buffer"
+msgstr "E85: Nena¹iel som ¾iadny buffer"
+
+#: buffer.c:842
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: Nedá sa preskoèi» na buffer %ld"
+
+#: buffer.c:845
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Za posledný buffer sa nedá preskoèi»"
+
+#: buffer.c:847
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Pred prvý buffer sa nedá preskoèi»"
+
+#: buffer.c:871
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: Zmeny v bufferi %ld neboly ulo¾ené (! pre vynútenie)"
+
+#: buffer.c:887
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Posledný buffer sa nedá odstráni»"
+
+#: buffer.c:1337
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Varovanie: preteèenie zoznamu s názvami súborov"
+
+#: buffer.c:1503
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: buffer %ld nenájdený"
+
+#: buffer.c:1729
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Vzoru %s vyhovuje viac bufferov"
+
+#: buffer.c:1731
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Vzoru %s nevyhovuje ¾iadny buffer"
+
+#: buffer.c:2136 ex_docmd.c:6089
+#, c-format
+msgid "line %ld"
+msgstr "riadok %ld"
+
+#: buffer.c:2219
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer takéhoto mena u¾ existuje"
+
+#: buffer.c:2512
+msgid " [Modified]"
+msgstr " [zmenený]"
+
+#: buffer.c:2517
+msgid "[Not edited]"
+msgstr "[neupravovaný]"
+
+#: buffer.c:2522
+msgid "[New file]"
+msgstr "[nový súbor]"
+
+#: buffer.c:2523
+msgid "[Read errors]"
+msgstr "[chyby pri èítaní]"
+
+#: buffer.c:2525 fileio.c:1777
+msgid "[readonly]"
+msgstr "[iba pre èítanie]"
+
+#: buffer.c:2540
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 riadok --%d%%--"
+
+#: buffer.c:2542
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "riadkov: %ld --%d%%--"
+
+#: buffer.c:2549
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "riadok %ld z %ld --%d%%-- ståpec"
+
+#: buffer.c:2637
+msgid "[No file]"
+msgstr "[¾iadny súbor]"
+
+#. must be a help buffer
+#: buffer.c:2677
+msgid "help"
+msgstr "pomocník"
+
+#: buffer.c:3186 screen.c:4743
+msgid "[help]"
+msgstr "[pomocník]"
+
+#: buffer.c:3218 screen.c:4749
+msgid "[Preview]"
+msgstr "[náhµad]"
+
+#: buffer.c:3424
+msgid "All"
+msgstr "V¹etko"
+
+#: buffer.c:3424
+msgid "Bot"
+msgstr "Koniec"
+
+#: buffer.c:3426
+msgid "Top"
+msgstr "Zaèiatok"
+
+#: buffer.c:4162
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# zoznam bufferov:\n"
+
+#: buffer.c:4195
+msgid "[Error List]"
+msgstr "[zoznam chýb]"
+
+#: buffer.c:4208 memline.c:1513
+msgid "[No File]"
+msgstr "[¾iadny súbor]"
+
+#: buffer.c:4428
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Znaky ---"
+
+#: buffer.c:4438
+#, c-format
+msgid "Signs for %s:"
+msgstr "Znaky pre %s:"
+
+#: buffer.c:4444
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " line=%ld id=%d meno=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Nemô¾em porovna» viac ako %ld bufferov"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: Nedajú sa vytvori» porovnania"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Opravný súbor"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: Nedá sa èíta» výstup porovnania"
+
+#: diff.c:1732
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktuálny buffer nie je v porovnacom móde"
+
+#: diff.c:1744
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: V porovnávacom móde sa nenachádza iný buffer"
+
+#: diff.c:1752
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: Viac ako dva buffery v porovnávacom móde; neviem, ktorý pou¾i»"
+
+#: diff.c:1775
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Nedá sa nájs» buffer \"%s\""
+
+#: diff.c:1781
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffer \"%s\" nie je v porovnávacom móde"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: diagraph nesmie obsahova» Escape"
+
+#: digraph.c:2344
+msgid "Keymap file not found"
+msgstr "Mapa kláves nenájdená"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Pou¾ite :loadkeymap v súbore, ktorý nie je zdrojový"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Doplòovanie kµúèových slov (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X re¾im (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Miestne dopåòanie kµúèových slov (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Doplòovanie celých riadkov (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Doplòovanie názvov súborov (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Doplòovanie tagov (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Doplòovanie vzoru ciest (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Doplòovanie definícií (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Doplòovanie podµa slovníka (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Doplòovanie podµa tezauru (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Doplòovòovanie príkazového riadka (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Koniec odstavca"
+
+#: edit.c:907
+msgid "'thesaurus' option is empty"
+msgstr "voµba 'thesaurus' je prázdna"
+
+#: edit.c:1083
+msgid "'dictionary' option is empty"
+msgstr "voµba 'dictionary' je prázdna"
+
+#: edit.c:2007
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "prehµadávam slovník %s"
+
+#: edit.c:2198
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (insert) Rolovanie (^E/^Y)"
+
+#: edit.c:2200
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (replace) Rolovanie (^E/^Y)"
+
+#: edit.c:2512
+#, c-format
+msgid "Scanning: %s"
+msgstr "Prehµadávam: %s"
+
+#: edit.c:2547
+msgid "Scanning tags."
+msgstr "Prehµadávam tagy."
+
+#: edit.c:3207
+msgid " Adding"
+msgstr " Pridávam"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3256
+msgid "-- Searching..."
+msgstr "-- Hµadám..."
+
+#: edit.c:3312
+msgid "Back at original"
+msgstr "Východzia podoba"
+
+#: edit.c:3317
+msgid "Word from other line"
+msgstr "Slovo z iného riadku"
+
+#: edit.c:3322
+msgid "The only match"
+msgstr "Jediná zhoda"
+
+#: edit.c:3381
+#, c-format
+msgid "match %d of %d"
+msgstr "zhoda %d z %d"
+
+#: edit.c:3384
+#, c-format
+msgid "match %d"
+msgstr "zhoda %d"
+
+#: eval.c:698
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Neznáma premenná: \"%s\""
+
+#: eval.c:977
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Chýbjú závorky: %s"
+
+#: eval.c:1057 eval.c:1073
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Premenná \"%s\" neexistuje"
+
+#: eval.c:1315
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Po '?' chýba ':'"
+
+#: eval.c:1929
+msgid "E110: Missing ')'"
+msgstr "E110: Chýba ')'"
+
+#: eval.c:1979
+msgid "E111: Missing ']'"
+msgstr "E111: Chýba ']'"
+
+#: eval.c:2054
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Chýba meno voµby: %s"
+
+#: eval.c:2072
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Neznáma voµba: %s"
+
+#: eval.c:2134
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Chýbjú uvodzovky: %s"
+
+#: eval.c:2251
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Chýbjú uvodzovky: %s"
+
+#: eval.c:2569
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Chybné argumenty pre funkciu %s"
+
+#: eval.c:2570
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Neznáma funkcia: %s"
+
+#: eval.c:2571
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: Príli¹ mnoho argumentov pre funkciu %s"
+
+#: eval.c:2572
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Príli¹ málo argumentov pre funkciu %s"
+
+#: eval.c:2573
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Pou¾itie <SID> mimo kontext skriptu: %s"
+
+#: eval.c:3172 gui.c:3984
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:3678
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld riadky: "
+
+#: eval.c:4794
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&Ok\n"
+"&Zru¹i»"
+
+#: eval.c:5626
+msgid "E240: No connection to Vim server"
+msgstr "E240: Neexistuje pripojenie k Vim serveru"
+
+#: eval.c:5716
+msgid "E277: Unable to read a server reply"
+msgstr "E227: Nemô¾em èíta» odpoveï servra"
+
+#: eval.c:5741
+msgid "E258: Unable to send to client"
+msgstr "E258: Nemô¾em posla» klientovi"
+
+#: eval.c:5786
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Nemô¾em posla» na %s"
+
+#: eval.c:5884
+msgid "(Invalid)"
+msgstr "(Chybný)"
+
+#: eval.c:6895
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Nedefinovaná premenná: %s"
+
+#: eval.c:7593
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E112: Funkcia %s u¾ existuje. Pou¾ite ! pre jej nahradenie."
+
+#: eval.c:7635
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Nedefinovaná funkcia: %s"
+
+#: eval.c:7648
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Chýba '(': %s"
+
+#: eval.c:7680
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Neprístupný argument: %s"
+
+#: eval.c:7766
+msgid "E126: Missing :endfunction"
+msgstr "E126: Chýba :endfunction"
+
+#: eval.c:7845
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Nedá sa predefinova» funkcia %s: je pou¾ívaná"
+
+#: eval.c:7903
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Názov funkcie musí zaèína» veµkým písmenom: %s"
+
+#: eval.c:7909
+msgid "E129: Function name required"
+msgstr "E129: Je vy¾adované meno funkcie"
+
+#: eval.c:8002
+msgid "function "
+msgstr "funkcia "
+
+#: eval.c:8117
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Nedefinovaná funkcia: %s"
+
+#: eval.c:8122
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Nedá sa vymaza» funkcia %s: je u¾ pou¾ívaná"
+
+#: eval.c:8169
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Zanorenie funkcií je hlb¹ie ne¾ 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8220
+#, c-format
+msgid "calling %s"
+msgstr "volám %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8245 ex_cmds2.c:1988
+#, c-format
+msgid "continuing in %s"
+msgstr "pokraèujem v %s"
+
+#: eval.c:8299
+msgid "E133: :return not inside a function"
+msgstr "E133: :return mimo funkciu"
+
+#: eval.c:8377
+#, c-format
+msgid "%s returning #%ld"
+msgstr "dokonèené %s. Návratová hodnota %ld"
+
+#: eval.c:8380
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "dokonèené %s. Návratová hodnota \"%s\""
+
+#: eval.c:8521
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globálne premenné:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, ¹estnástkovo %02x, osmièkovo %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: Prekrytie riadkov sebou samými"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "poèet preru¹ených riadkov: 1"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "poèet preru¹ených riadkov: %ld"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "poèet filtrovaných riadkov: %ld"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: Automatické príkazy *Filter* nesmie meni» aktuálny buffer"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[Neulo¾ené zmeny]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s na riadku: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: príli¹ mnoho chýb, preskakujem zbytok súboru"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Èítam viminfo súbor \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " informácie"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " znaèky"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " ZLYHALO"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Do viminfo súboru %s sa nedá zapisova»"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Nedá sa ulo¾i» viminfo súbor %s!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Ukládám viminfo súboru \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Tento viminfo súbor bol vytvorený editorom Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Pokiaµ budete opatrnný, mô¾ete ho upravova».\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Hodnota 'encoding' poèas zápisu tohoto súboru\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "Neprístupný zaèiatoèný znak"
+
+#: ex_cmds.c:2053 ex_cmds.c:2310 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Ulo¾i» ako"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Súbor je naèítaný v inob buffere"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "Ulo¾i» neúplný súbor?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Pou¾ite ! pre ulo¾enie neúplného bufferu"
+
+#: ex_cmds.c:2244
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Prepísa» súbor \"%.*s\"?"
+
+#: ex_cmds.c:2315
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ®iadny názov súboru pre buffer %ld"
+
+#: ex_cmds.c:2353
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Súbor nebol ulo¾ený: ukladanie je zakázané voµbou 'write'"
+
+#: ex_cmds.c:2373
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"Pre \"%.*s\" je nastavená voµba 'readonly' (iba na èítanie).\n"
+"Prajete si ju potlaèi»?"
+
+#: ex_cmds.c:2538
+msgid "Edit File"
+msgstr "Upravova» súbor"
+
+#: ex_cmds.c:3061
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Automatické príkazy neoèakávane zmazali nový buffer %s"
+
+#: ex_cmds.c:3193
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: neèíselný argument pre :z"
+
+#: ex_cmds.c:3278
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim nepovoluje pou¾itie príkazov shellu"
+
+#: ex_cmds.c:3385
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regulárne výrazy nesmú by» oddelené písmenami"
+
+#: ex_cmds.c:3727
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "nahradi» %s (y/n/a/q/I/^E/^Y)?"
+
+#: ex_cmds.c:4092
+msgid "(Interrupted) "
+msgstr "(preru¹ený) "
+
+#: ex_cmds.c:4096
+msgid "1 substitution"
+msgstr "poèet nahradení na riadok: 1"
+
+#: ex_cmds.c:4098
+#, c-format
+msgid "%ld substitutions"
+msgstr "poèet nahradení na riadok: %ld"
+
+#: ex_cmds.c:4101
+msgid " on 1 line"
+msgstr " na 1 riadku"
+
+#: ex_cmds.c:4103
+#, c-format
+msgid " on %ld lines"
+msgstr " na %ld riadkov"
+
+#: ex_cmds.c:4154
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: global nedá sa vola» rekurzívne"
+
+#: ex_cmds.c:4189
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Pri príkaze global chýba regulárny výraz"
+
+#: ex_cmds.c:4238
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Vzor nájdený na ka¾dom riadku: %s"
+
+#: ex_cmds.c:4319
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Posledný Re»azec Podnadpisu:\n"
+"$"
+
+#: ex_cmds.c:4421
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ¥utujem, pre %s nie je ¾iadny pomocník"
+
+#: ex_cmds.c:4455
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "¥utujem, súbor \"%s\" s pomocníkom nebol nájdený"
+
+#: ex_cmds.c:4917
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s nie je adresárom"
+
+#: ex_cmds.c:4945
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Nedá sa otvori» %s pre zápis"
+
+#: ex_cmds.c:4959
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Nedá sa otvori» %s pre zápis"
+
+#: ex_cmds.c:5038
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplicitný tag \"%s\" v súbore %s"
+
+#: ex_cmds.c:5139
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Neznáma funkcia: %s"
+
+#: ex_cmds.c:5159
+msgid "E156: Missing sign name"
+msgstr "E156: Chýba identifikátor pre sign"
+
+#: ex_cmds.c:5205
+msgid "E255: Too many signs defined"
+msgstr "E255: Príli¹ mnoho definovaných oznaèení"
+
+#: ex_cmds.c:5247
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Chybne oznaèený text: %s"
+
+#: ex_cmds.c:5271 ex_cmds.c:5457
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Neznáme oznaèenie: %s"
+
+#: ex_cmds.c:5317
+msgid "E159: Missing sign number"
+msgstr "E159: Chýba èislo oznaèenia"
+
+#: ex_cmds.c:5397
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Chybné meno bufferu: %s"
+
+#: ex_cmds.c:5436
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Chybné ID oznaèenia: %ld"
+
+#: ex_cmds.c:5607
+msgid "[Deleted]"
+msgstr "[vymazaný]"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "Spú¹»am re¾im ladenia. Pre ukonèenie napí¹te \"cont\"."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "riadok %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "príkaz: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Bod preru¹enia v \"%s%s\" na riadku %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Bod preru¹enia nenájdený: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "Neboli definovné ¾iadne body preru¹enia"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s riadok %ld"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Ulo¾i» zmeny do \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8667
+msgid "Untitled"
+msgstr "Bez mena"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Buffer \"%s\" obsahuje neulo¾ené zmeny"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Varovanie: Neèakaný vstup do iného bufferu (skontrolujte automatické príkazy)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Pre úpravu bol zadaný iba jeden súbor"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: Pred prvý súbor sa nedá preskoèi»"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Za posledný súbor sa nedá preskoèi»"
+
+#: ex_cmds2.c:1634
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Hµadám \"%s\" v \"%s\""
+
+#: ex_cmds2.c:1656
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Hµadám \"%s\""
+
+#: ex_cmds2.c:1680
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "súbor \"%s\" nebol nájdený v 'runtimepath'"
+
+#: ex_cmds2.c:1714
+msgid "Source Vim script"
+msgstr "Zdrojový skript Vim"
+
+#: ex_cmds2.c:1832
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "\"%s\" nie je adresárom"
+
+#: ex_cmds2.c:1862
+#, c-format
+msgid "could not source \"%s\""
+msgstr "nedá sa interpretova» \"%s\""
+
+#: ex_cmds2.c:1864
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "riadok %ld: nemô¾e by» zdroj \"%s\""
+
+#: ex_cmds2.c:1878
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "interpretujem \"%s\""
+
+#: ex_cmds2.c:1880
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "riadok %ld je zdrojom \"%s\""
+
+#: ex_cmds2.c:1986
+#, c-format
+msgid "finished sourcing %s"
+msgstr "dokonèená interpretácia %s"
+
+#: ex_cmds2.c:2287
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Varovanie: chybný oddeµovaè riadkov. Mo¾ná chýba ^M."
+
+#: ex_cmds2.c:2336
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :finish pou¾ité mimo interpretovaný súbor"
+
+#: ex_cmds2.c:2369
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish pou¾ité mimo interpretovaný súbor"
+
+#: ex_cmds2.c:2838
+msgid "No text to be printed"
+msgstr "Ïal¹í na tlaè"
+
+#: ex_cmds2.c:2916
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Tlaèím stranu %d (%d%%)"
+
+#: ex_cmds2.c:2925
+#, c-format
+msgid " Copy %d of %d"
+msgstr "Kópia %d z %d"
+
+#: ex_cmds2.c:2977
+#, c-format
+msgid "Printed: %s"
+msgstr "Vytlaèené: %s"
+
+#: ex_cmds2.c:2984
+msgid "Printing aborted"
+msgstr "Tlaè bola zru¹ená"
+
+#: ex_cmds2.c:3367
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Nedá sa zapisova» do výstupného PostScriptového súboru"
+
+#: ex_cmds2.c:4042
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Nedá sa otvori» výstupný PostScriptový súbor"
+
+#: ex_cmds2.c:4080
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Nedá sa otvori» súbor \"%s\""
+
+#: ex_cmds2.c:4091
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Nedá sa èíta» PostScriptový súbor \"%s\""
+
+#: ex_cmds2.c:4289
+msgid "Sending to printer..."
+msgstr "Posielam na tlaèiareò..."
+
+#: ex_cmds2.c:4293
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: PostScriptový súbor sa nepodarilo vytlaèi»"
+
+#: ex_cmds2.c:4295
+msgid "Print job sent."
+msgstr "Tlaèová úloha bola odoslaná."
+
+#: ex_cmds2.c:4691
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Aktuálny %s jazyk: \"%s\""
+
+#: ex_cmds2.c:4702
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Nedá sa nastavi» jazyk na \"%s\""
+
+#: ex_docmd.c:490
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Spú¹»am Ex re¾im. Napi¹te \"visual\" pre návrat do Normálního re¾imu."
+
+#. must be at EOF
+#: ex_docmd.c:526
+msgid "At end-of-file"
+msgstr "Koniec súboru"
+
+#: ex_docmd.c:601
+msgid "E169: Command too recursive"
+msgstr "E169: Príkaz je príli¹ zlo¾itý"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: Chýba :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: Chýba :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "Koniec zdrojového súboru"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "Koniec funkcie"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Nejednoznaèné pou¾itie pou¾ívateµom definovaného príkazu"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "Nie je príkazom editoru"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "®iadnu paniku!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Zadaný spätný rozsah"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Zadaný spätný rozsah. OK odlo¾i»"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "Pou¾ite w èi w>>"
+
+#: ex_docmd.c:3097
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ¥utujem, ale tento príkaz nie je implementovaný"
+
+#: ex_docmd.c:3267
+msgid "E172: Only one file name allowed"
+msgstr "E172: Prípustný je iba jeden názov súboru"
+
+#: ex_docmd.c:3823
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "E¹te zostávajú %d súborov k úprave. Chcete napriek tomu ukonèi» editor?"
+
+#: ex_docmd.c:3830
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: E¹te zostávajajú %ld súbory k úprave."
+
+#: ex_docmd.c:3924
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: Príkaz u¾ existuje: pou¾ite ! pre predefinovanie"
+
+#: ex_docmd.c:4029
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Meno Args Rozsah Úplnos» Definícia"
+
+#: ex_docmd.c:4118
+msgid "No user-defined commands found"
+msgstr "Neboli nájdené ¾iadne pou¾ivateµom definované príkazy"
+
+#: ex_docmd.c:4149
+msgid "E175: No attribute specified"
+msgstr "E175: Neboli zadané ¾iadne vlastnosti"
+
+#: ex_docmd.c:4201
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Chybný poèet argumentov"
+
+#: ex_docmd.c:4216
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Poèet nemô¾e by» zadaný dvakrát"
+
+#: ex_docmd.c:4226
+msgid "E178: Invalid default value for count"
+msgstr "E178: Chybná implicitná hodnota pre poèet"
+
+#: ex_docmd.c:4254
+msgid "E179: argument required for complete"
+msgstr "E179: pre doplnenie je potrebný argument"
+
+#: ex_docmd.c:4273
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Chybná hodnota doplnenia: %s"
+
+#: ex_docmd.c:4281
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Chybná vlastnos»: %s"
+
+#: ex_docmd.c:4322
+msgid "E182: Invalid command name"
+msgstr "E182: Chybné meno príkazu"
+
+#: ex_docmd.c:4337
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Pou¾ívateµom definované príkazy musia zaèína» veµkým písmenom"
+
+#: ex_docmd.c:4406
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Pou¾ívateµom definovaný príkaz %s neexistuje"
+
+#: ex_docmd.c:4857
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Schéma farieb %s nenájdená"
+
+#: ex_docmd.c:4865
+msgid "Greetings, Vim user!"
+msgstr "Pozdraujem, Vim pou¾ívateµ!"
+
+#: ex_docmd.c:5569
+msgid "Edit File in new window"
+msgstr "Upravi» súbor v novom okne"
+
+#: ex_docmd.c:5839
+msgid "No swap file"
+msgstr "®iadny odkladací súbor"
+
+#: ex_docmd.c:5943
+msgid "Append File"
+msgstr "Pripoji» súbor"
+
+#: ex_docmd.c:6002
+msgid "E186: No previous directory"
+msgstr "E186: ®iadny predchádzajúci adresár"
+
+#: ex_docmd.c:6079
+msgid "E187: Unknown"
+msgstr "E187: Neznámy"
+
+#: ex_docmd.c:6197
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Umiestenie okna: X %d, Y %d"
+
+#: ex_docmd.c:6202
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: Na tejto platforme sa nedá umiestnenie okna zisti»"
+
+#: ex_docmd.c:6468
+msgid "Save Redirection"
+msgstr "Ulo¾i» presmerovanie"
+
+#: ex_docmd.c:6617
+msgid "Save View"
+msgstr "Ulo¾i» pohµad"
+
+#: ex_docmd.c:6618
+msgid "Save Session"
+msgstr "Ulo¾i» sedenie"
+
+#: ex_docmd.c:6620
+msgid "Save Setup"
+msgstr "Ulo¾i» nastavenie"
+
+#: ex_docmd.c:6769
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" existuje (pou¾ite ! pre vynútenie)"
+
+#: ex_docmd.c:6774
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Nedá sa otvori» \"%s\" pre zápis"
+
+#. set mark
+#: ex_docmd.c:6798
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: Argumentem mô¾e by» iba písiemo alebo pravý èi µavý apostrof"
+
+#: ex_docmd.c:6841
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Vnorenie :normal je príli¹ hlboké"
+
+#: ex_docmd.c:7202
+msgid ":if nesting too deep"
+msgstr "vnorenie :if je príli¹ hlboké"
+
+#: ex_docmd.c:7237
+msgid ":endif without :if"
+msgstr ":endif bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7257
+msgid ":else without :if"
+msgstr ":else bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7259
+msgid ":elseif without :if"
+msgstr ":elseif bez zodpovedajúceho :if"
+
+#: ex_docmd.c:7311
+msgid ":while nesting too deep"
+msgstr "vnorenie :while je príli¹ hlboké"
+
+#: ex_docmd.c:7357
+msgid ":continue without :while"
+msgstr ":continue bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7384
+msgid ":break without :while"
+msgstr ":break bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7407 ex_docmd.c:7412
+msgid ":endwhile without :while"
+msgstr ":endwhile bez zodpovedajúceho :while"
+
+#: ex_docmd.c:7433
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction mimo funkciu"
+
+#: ex_docmd.c:7613
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: ®iadny alternatívny názov súboru, ktorým by bolo mo¾né nahradi» '#'"
+
+#: ex_docmd.c:7644
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "¾iadny názov súboru, ktorým by bolo mo¾né nahradi» \"<afile>\""
+
+#: ex_docmd.c:7652
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "¾iadne èíslo bufferu, ktorým by bolo mo¾né nahradi» \"<abuf>\""
+
+#: ex_docmd.c:7663
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"¾iadna zhoda automatických príkazov, ktorou by bolo mo¾né nahradi» \"<amatch>"
+"\""
+
+#: ex_docmd.c:7673
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "¾iadny :source súbor, ktorým by bolo mo¾né nahradi» \"<sfile>\""
+
+#: ex_docmd.c:7714
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "Prázdný názov súboru pre '%' èi '#' funguje iba s \":p:h\""
+
+#: ex_docmd.c:7716
+msgid "Evaluates to an empty string"
+msgstr "Výsledkom vyhodnotenia je prázdny re»azec"
+
+#: ex_docmd.c:8649
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Nedá sa otvori» pre èítaní viminfo súbor"
+
+#: ex_docmd.c:8822
+msgid "E196: No digraphs in this version"
+msgstr "E196: V tejto verzi nie sú diagraphy podporované"
+
+#: ex_getln.c:2833
+msgid "tagname"
+msgstr "meno tagu"
+
+#: ex_getln.c:2836
+msgid " kind file\n"
+msgstr " typ súboru\n"
+
+#: ex_getln.c:4049
+msgid "'history' option is zero"
+msgstr "'voµba 'history' je nastavená na nulu"
+
+#: ex_getln.c:4289
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# História %s (zaèínajúci najnov¹ou polo¾kou):\n"
+
+#: ex_getln.c:4290
+msgid "Command Line"
+msgstr "Príkazové Riadky"
+
+#: ex_getln.c:4291
+msgid "Search String"
+msgstr "Vyhµadávaný Re»azec"
+
+#: ex_getln.c:4292
+msgid "Expression"
+msgstr "Výraz"
+
+#: ex_getln.c:4293
+msgid "Input Line"
+msgstr "Vstupný Riadok"
+
+#: ex_getln.c:4323
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar prevy¹uje då¾ku príkazu"
+
+#: ex_getln.c:4491
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktívne okno alebo buffer bol vymazaný"
+
+#: fileio.c:351
+msgid "Illegal file name"
+msgstr "Neprístupný názov súboru"
+
+#: fileio.c:375 fileio.c:500 fileio.c:2516 fileio.c:2554
+msgid "is a directory"
+msgstr "je adresárom"
+
+#: fileio.c:377
+msgid "is not a file"
+msgstr "nie je súborom"
+
+#: fileio.c:522 fileio.c:3646
+msgid "[New File]"
+msgstr "[nový súbor]"
+
+#: fileio.c:540
+msgid "[Permission Denied]"
+msgstr "[prístup odmietnutý]"
+
+#: fileio.c:634
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre automatické príkazy urobili súbor neèitateµným"
+
+#: fileio.c:636
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre automatické príkazy nesmú meni» aktuálny buffer"
+
+#: fileio.c:657
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: èítam z ¹tandardného vstupu...\n"
+
+#: fileio.c:663
+msgid "Reading from stdin..."
+msgstr "Èítam z ¹tandardného vstupu..."
+
+#. Re-opening the original file failed!
+#: fileio.c:892
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Po konverzii je súbor neèittateµný!"
+
+#: fileio.c:1755
+msgid "[fifo/socket]"
+msgstr "[fpomenovaná rúra/soket]"
+
+#: fileio.c:1762
+msgid "[fifo]"
+msgstr "[pomenovaná rúra]"
+
+#: fileio.c:1769
+msgid "[socket]"
+msgstr "[soket]"
+
+#: fileio.c:1777
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1787
+msgid "[CR missing]"
+msgstr "[chýba CR]"
+
+#: fileio.c:1792
+msgid "[NL found]"
+msgstr "[nájdené NL]"
+
+#: fileio.c:1797
+msgid "[long lines split]"
+msgstr "[dlhé riadky zalomené]"
+
+#: fileio.c:1803 fileio.c:3630
+msgid "[NOT converted]"
+msgstr "[neskonvertovaný]"
+
+#: fileio.c:1808 fileio.c:3635
+msgid "[converted]"
+msgstr "[skonvertovaný]"
+
+#: fileio.c:1815 fileio.c:3660
+msgid "[crypted]"
+msgstr "[za¹ifrovaný]"
+
+#: fileio.c:1822
+msgid "[CONVERSION ERROR]"
+msgstr "[CHYBA PREVODU]"
+
+#: fileio.c:1829
+msgid "[READ ERRORS]"
+msgstr "[CHYBY ÈÍTANIA]"
+
+#: fileio.c:2036
+msgid "Can't find temp file for conversion"
+msgstr "Nedá sa nájs» doèasný súbor pre konverziu"
+
+#: fileio.c:2043
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konverzia s 'charconvert' sa nepodarila"
+
+#: fileio.c:2046
+msgid "can't read output of 'charconvert'"
+msgstr "nedá sa èíta» výstup 'charconvert'"
+
+#: fileio.c:2432
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Automatické príkazy zmazali èi deaktivovali buffer, ktorý mal by» "
+"ulo¾ený"
+
+#: fileio.c:2455
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Automatický príkaz neoèakávaným spôsobom zmenil poèet riadkov"
+
+#: fileio.c:2521 fileio.c:2538
+msgid "is not a file or writable device"
+msgstr "nie je súborom ani zariadením na ktoré sa dá zapisova»"
+
+#: fileio.c:2584
+msgid "is read-only (use ! to override)"
+msgstr "je iba pre èítaníie(pou¾ite ! pre vynútenie)"
+
+#: fileio.c:2886
+msgid "Can't write to backup file (use ! to override)"
+msgstr "Nedá sa zapisova» do zálo¾ného súboru (pou¾ite ! pre vynútenie)"
+
+#: fileio.c:2898
+msgid "Close error for backup file (use ! to override)"
+msgstr "Chyba pri uzatváraní zálo¾ného súboru (pou¾ite ! pre vynútenie)"
+
+#: fileio.c:2900
+msgid "Can't read file for backup (use ! to override)"
+msgstr "Nedá sa naèíta» súbor pre zálohu (pou¾ite ! pre vynútenie)"
+
+#: fileio.c:2916
+msgid "Cannot create backup file (use ! to override)"
+msgstr "Nedá sa vytvori» zálo¾ný súbor (pou¾ite ! pre vynútenie)"
+
+#: fileio.c:3018
+msgid "Can't make backup file (use ! to override)"
+msgstr "Nedá sa vytvori» zálo¾ný súbor (pou¾ite ! pre vynútenie)"
+
+# resource fork ?!
+#: fileio.c:3080
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "'Resource fork' bude stratený (pou¾ite ! pre vynútenie)"
+
+#: fileio.c:3169
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Nedá sa nájs» doèasný súbor pre ukladanie"
+
+#: fileio.c:3187
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: Nedá sa previes» (pou¾ite ! pre vynútenie prevodu)"
+
+#: fileio.c:3222
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Súbor sa nedá otvori» pre ukladanie"
+
+#: fileio.c:3226
+msgid "E212: Can't open file for writing"
+msgstr "E212: Súbor sa nedá otvori» pre ukladanie"
+
+#: fileio.c:3475
+msgid "Close failed"
+msgstr "Zatvorenie zlyhalo"
+
+#: fileio.c:3546
+msgid "write error, conversion failed"
+msgstr "chyba pri zápise, prevod sa nepodaril"
+
+#: fileio.c:3552
+msgid "write error (file system full?)"
+msgstr "chyba pri ukladaní (je voµné miesto na disku?)"
+
+#: fileio.c:3625
+msgid " CONVERSION ERROR"
+msgstr " CHYBA PREVODU"
+
+#: fileio.c:3641
+msgid "[Device]"
+msgstr "[zariadenie]"
+
+#: fileio.c:3646
+msgid "[New]"
+msgstr "[nový]"
+
+#: fileio.c:3668
+msgid " [a]"
+msgstr " [p]"
+
+#: fileio.c:3668
+msgid " appended"
+msgstr " pripojený"
+
+#: fileio.c:3670
+msgid " [w]"
+msgstr " [u]"
+
+#: fileio.c:3670
+msgid " written"
+msgstr " ulo¾ený"
+
+#: fileio.c:3720
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: patchmode: nedá sa ulo¾i» pôvodný súbor"
+
+#: fileio.c:3742
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchmode: nedá sa zapisova» do prázdneho pôvodného súboru"
+
+#: fileio.c:3757
+msgid "E207: Can't delete backup file"
+msgstr "E207: Nedá sa vymaza» zálo¾ný súbor"
+
+#: fileio.c:3809
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"VAROVANIE: Obsah pôvodného súboru mô¾e by» stratený alebo po¹kodený\n"
+
+#: fileio.c:3811
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "neukonèujte editor skôr, ne¾ bude súbor úspe¹ne ulo¾ený!"
+
+#: fileio.c:3891
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3891
+msgid "[dos format]"
+msgstr "[dos formát]"
+
+#: fileio.c:3898
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3898
+msgid "[mac format]"
+msgstr "[mac formát]"
+
+#: fileio.c:3905
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3905
+msgid "[unix format]"
+msgstr "[unix formát]"
+
+#: fileio.c:3932
+msgid "1 line, "
+msgstr "1 riadok, "
+
+#: fileio.c:3934
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld riadkov, "
+
+#: fileio.c:3937
+msgid "1 character"
+msgstr "1 znak"
+
+#: fileio.c:3939
+#, c-format
+msgid "%ld characters"
+msgstr "%ld znakov"
+
+#: fileio.c:3949
+msgid "[noeol]"
+msgstr "[¾iadny koniec riadku]"
+
+#: fileio.c:3949
+msgid "[Incomplete last line]"
+msgstr "[neúplný posledný riadok]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3968
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "VAROVANIE: od jeho naèítania bol obsah súboru zmenený!!!!"
+
+#: fileio.c:3970
+msgid "Do you really want to write to it"
+msgstr "Chcete ho naozaj ulo¾i»"
+
+#: fileio.c:4933
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Chyba pri zápise do \"%s\""
+
+#: fileio.c:4940
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Chyb pri uzatváraní \"%s\""
+
+#: fileio.c:4943
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Chyba pri èítaní \"%s\""
+
+#: fileio.c:5115
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell automatický príkaz vymazal buffer"
+
+#: fileio.c:5123
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Varovanie: súbor \"%s\" u¾ nie je dostupný"
+
+#: fileio.c:5136
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Varovanie: súbor \"%s\" bol po zaèatí úpravy zmenený a Vim tie¾ zmenil "
+"buffer"
+
+#: fileio.c:5139
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Varovanie: súbor \"%s\" bol po zaèatí úpravy zmenený"
+
+#: fileio.c:5141
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: Varovanie: Re¾im súboru \"%s\" bol po zaèatí úprav zmenený"
+
+#: fileio.c:5151
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Varovanie: po zaèatí úpravy vytvorený súbor \"%s\""
+
+#: fileio.c:5168
+msgid "Warning"
+msgstr "Varovanie"
+
+#: fileio.c:5169
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Naèíta» súbor"
+
+#: fileio.c:5248
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: nedá sa obnovi» \"%s\""
+
+#: fileio.c:5779
+msgid "--Deleted--"
+msgstr "--Vymazaný--"
+
+#. the group doesn't exist
+#: fileio.c:5939
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Skupina \"%s\" neexistuje"
+
+#: fileio.c:6064
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Neprístupný znak po *: %s"
+
+#: fileio.c:6075
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Udalos» %s neexistuje"
+
+#. Highlight title
+#: fileio.c:6224
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Automatické príkazy ---"
+
+#: fileio.c:6495
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Automatické príkazy sa nedajú spusti» pre V©ETKY udalos»i"
+
+#: fileio.c:6518
+msgid "No matching autocommands"
+msgstr "®iadne vyhovujúce automatické príkazy"
+
+#: fileio.c:6790
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: vnorenia automatického príkazu sú príli¹ hlboké"
+
+#: fileio.c:7077
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s automatické príkazy pre \"%s\""
+
+#: fileio.c:7085
+#, c-format
+msgid "Executing %s"
+msgstr "Spú¹»am %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7153
+#, c-format
+msgid "autocommand %s"
+msgstr "Automatický príkaz %s"
+
+#: fileio.c:7675
+msgid "E219: Missing {."
+msgstr "E219: Chýba {."
+
+#: fileio.c:7677
+msgid "E220: Missing }."
+msgstr "E220: Chýba }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "®iadny záhyb nebol nájdený"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Pomocou 'foldmethod' sa nedá vytvori» záhyb"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Pomocou 'foldmethod' sa nedá odstráni» záhyb"
+
+#: getchar.c:247
+msgid "E222: Add to read buffer"
+msgstr "E222: Prida» do bufferu pre èítanie"
+
+#: getchar.c:2106
+msgid "E223: recursive mapping"
+msgstr "E223: rekurzívne mapovanie"
+
+#: getchar.c:2948
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: pre %s u¾ globálna skratka existuje"
+
+#: getchar.c:2951
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: pre %s u¾ globálne mapovanie existuje"
+
+#: getchar.c:3078
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: pre %s u¾ skratka existuje"
+
+#: getchar.c:3081
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: pre %s u¾ mapovanie existuje"
+
+#: getchar.c:3145
+msgid "No abbreviation found"
+msgstr "®iadna skratka nebola nájdená"
+
+#: getchar.c:3147
+msgid "No mapping found"
+msgstr "®iadne mapovanie nebolo nájdené"
+
+#: getchar.c:3992
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: neprístupný mód"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<nedá sa otvori»> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: písmo %s nie je dostupné"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: nedá sa vráti» do aktuálneho adresára"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "Názov cesty:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: nedá sa zisti» aktuálny adresár"
+
+#: gui_at_fs.c:2571 gui_motif.c:1619
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1740 gui_motif.c:1614 gui_motif.c:2835
+msgid "Cancel"
+msgstr "Zru¹i»"
+
+#: gui_athena.c:1956 gui_motif.c:1867
+msgid "Vim dialog"
+msgstr "Vim dialóg"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Prípravok posuvnej li¹ty: nedá sa zisti» geometria obrázku"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: BalloonEval nedá sa vytvori» správou a zároveò spätným volaním"
+
+#: gui.c:203
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Nedá sa spusti» GUI"
+
+#: gui.c:328
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Nedá sa èíta» z \"%s\""
+
+#: gui.c:453
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: voµba 'guifontwide' je chybne nastavená"
+
+#: gui.c:3698
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Nedá sa alokova» farba %s"
+
+#: gui.c:3983
+msgid "Error"
+msgstr "Chyba"
+
+#: gui_gtk.c:1190
+msgid "Vim dialog..."
+msgstr "Vim dialóg.."
+
+#: gui_gtk.c:1576 gui_motif.c:2754
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Nájs» a nahradi»..."
+
+#: gui_gtk.c:1581 gui_motif.c:2756
+msgid "VIM - Search..."
+msgstr "VIM - Nájs»..."
+
+#: gui_gtk.c:1604 gui_motif.c:2874
+msgid "Find what:"
+msgstr "Vyhµada»:"
+
+#: gui_gtk.c:1622 gui_motif.c:2906
+msgid "Replace with:"
+msgstr "Nový text:"
+
+#. exact match only button
+#: gui_gtk.c:1654 gui_motif.c:3008
+msgid "Match exact word only"
+msgstr "Hµada» len celé slová"
+
+#: gui_gtk.c:1666 gui_motif.c:2976
+msgid "Direction"
+msgstr "Smer"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1678 gui_motif.c:2988
+msgid "Up"
+msgstr "Hore"
+
+#: gui_gtk.c:1682 gui_motif.c:2996
+msgid "Down"
+msgstr "Dolu"
+
+#. 'Find Next' button
+#: gui_gtk.c:1704 gui_motif.c:2778
+msgid "Find Next"
+msgstr "Nájs» ïal¹ie"
+
+#. 'Replace' button
+#: gui_gtk.c:1721 gui_motif.c:2795
+msgid "Replace"
+msgstr "Nahradi»"
+
+#. 'Replace All' button
+#: gui_gtk.c:1730 gui_motif.c:2808
+msgid "Replace All"
+msgstr "Nahradi» V¹etko"
+
+#: gui_gtk_x11.c:1079 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: nedá sa otvori» displej"
+
+#: gui_gtk_x11.c:2494 gui_x11.c:1999
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Neznáma sada písiem: %s"
+
+#: gui_gtk_x11.c:2518
+msgid "Font Selection"
+msgstr "Výber Písma"
+
+#: gui_gtk_x11.c:2764 gui_mac.c:2982 gui_w48.c:1197 gui_x11.c:1835
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Neznáme písmo: %s"
+
+#: gui_gtk_x11.c:2775 gui_x11.c:1859
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Písmo \"%s\" nemá pevnú ¹írku"
+
+#: gui_gtk_x11.c:3580 ui.c:1971
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Pou¾itý CUT_BUFFER0 namiesto prázdneho výberu"
+
+#: gui_motif.c:1613 gui_motif.c:1616
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1615
+msgid "Directories"
+msgstr "Adresáre"
+
+#: gui_motif.c:1617
+msgid "Help"
+msgstr "Pomocník"
+
+#: gui_motif.c:1618
+msgid "Files"
+msgstr "Súbory"
+
+#: gui_motif.c:1620
+msgid "Selection"
+msgstr "Výber"
+
+#: gui_motif.c:2821
+msgid "Undo"
+msgstr "Spä»"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: Nemô¾em naèíta» chybný font '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: Nedá sa pou¾í» písmo %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Posielam správu na ukonèenie synovského procesu.\n"
+
+#: gui_w32.c:836
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr ""
+"E243: Argument nie je podporovaný: \n"
+"-%s\"; Pou¾ite OLE verziu."
+
+#. TODO: May be changed this message
+#: gui_w32.c:3499 gui_w32.c:3532 gui_x11.c:3252
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Chyba -- nedájú sa preèíta» oznaèovacie dáta!"
+
+#: gui_w48.c:2081
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Nájs» re»azec (pou¾ite '\\\\' ak chete nájs» '\\')"
+
+#: gui_w48.c:2106
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Nájs» a Nahradi» (pou¾ite '\\\\' ak chcete nájs» '\\')"
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Nedá sa alokova» polo¾ka mapy farieb. Niektoré farby mô¾u by» "
+"nesprávne"
+
+#: gui_x11.c:1989
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Chýba písmo pre nasledujúce znakové sady %s:"
+
+#: gui_x11.c:2032
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Názov sady písiem: %s"
+
+#: gui_x11.c:2033
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Písmo '%s' nemá pevnou ¹írku"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Názov sady písiem: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Písmo0: %s\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Písmo1: %s\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Písmo%d nie je dvakrát ¹ir¹ie ako písmo0\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "©írka písma0: %ld\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"©írka písma1: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata ERROR"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr "Pou¾itie: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "Prida» novú databázu"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "Hµadanie vzoru"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Zobrazi» túto správu"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "Ukonèi» spojenie"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "Znovu inicializova» v¹etky spojenia"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Zobrazi» spojenia"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Táto cscope príkaz nepodporuje rozdeµovanie okna.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Pou¾itie: cstag <odsadenie>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tag nenájdený"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) chyba: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Pridaná cscope databáza %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s nie je ani adresárom ani správnou cscope databázou"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "chyba pri èítaní cscope spojenia %d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "neznámy typ cscope hµadania"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "Nedajú sa vytvori» cscope rúry"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "spustenie cs_create_connection zlyhalo"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: volanie fdopen pre to_fp zlyhalo"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: volanie fdopen pre fr_fp zlyhalo"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "¾iadne cscope spojenia"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: cscope hµadanie %s vo vzore %s nena¹lo ¾iadnu zhodu"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "príkazy cscope:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Pou¾itie: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "duplicitná cscope databáza nebola pridaná"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "dosiahnutý maximálny poèet cscope spojení"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: cscope spojenie nenájdené"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope spojenie %s nenájdené"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope spojenie ukonèené"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope spojenie %s ukonèené\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "osudová chyba v cs_manage_matches"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: chyba pri èítaní cscope spojenia %d"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "volanie malloc zlyhalo\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope tag: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # riadok"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "názov súboru/ kontext/ riadok\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "V¹etky cscope databáze resetované"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "¾iadne cscope spojenia\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid názov databáze predpona cesty\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <¾iadny>\n"
+
+#: if_python.c:255 if_ruby.c:260 if_tcl.c:195 mbyte.c:2629 os_win32.c:269
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Nepodarilo sa nahra» kni¾nicu %s"
+
+#: if_python.c:267 if_ruby.c:272 if_tcl.c:206 mbyte.c:2645 os_win32.c:281
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Nepodarilo sa nahra» funkciu kni¾nice %s"
+
+#: if_python.c:392
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E262: Prepáète, tento príkaz je vypnutý, Python kni¾nica nemô¾e by»naèítaná."
+
+#: if_python.c:592
+msgid "can't delete OutputObject attributes"
+msgstr "nedá sa vymaza» vlastnos» OutputObject"
+
+#: if_python.c:599
+msgid "softspace must be an integer"
+msgstr "softspace musí by» kladné celé èíslo"
+
+#: if_python.c:607
+msgid "invalid attribute"
+msgstr "chybná vlastnos»"
+
+#: if_python.c:646 if_python.c:660
+msgid "writelines() requires list of strings"
+msgstr "writelines() vy¾aduje zoznam re»azcov"
+
+#: if_python.c:786
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Chyba pri inicializácii I/O objektov"
+
+#: if_python.c:971 if_tcl.c:1403
+msgid "invalid expression"
+msgstr "chybný výraz"
+
+#: if_python.c:985 if_tcl.c:1408
+msgid "expressions disabled at compile time"
+msgstr "podpora výrazov bola vypnutá pri preklade programu"
+
+#: if_python.c:998
+msgid "attempt to refer to deleted buffer"
+msgstr "pokus o odkaz na vymazaný buffer"
+
+#: if_python.c:1013 if_python.c:1054 if_python.c:1118 if_tcl.c:1215
+msgid "line number out of range"
+msgstr "èíslo riadka mimo rozsah"
+
+#: if_python.c:1251
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<objekt bufferu (vymazaný) na %8lX>"
+
+#: if_python.c:1342 if_tcl.c:837
+msgid "invalid mark name"
+msgstr "chybné meno znaèky"
+
+#: if_python.c:1617
+msgid "no such buffer"
+msgstr "¾iadny taký buffer"
+
+#: if_python.c:1705
+msgid "attempt to refer to deleted window"
+msgstr "pokus o odkaz na vymazané okno"
+
+#: if_python.c:1750
+msgid "readonly attribute"
+msgstr "vlastnos» iba pre èítanie"
+
+#: if_python.c:1763
+msgid "cursor position outside buffer"
+msgstr "umiestnenie kurzoru mimo buffer"
+
+#: if_python.c:1840
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<objekt okna (vymazaný) na %.8lX>"
+
+#: if_python.c:1852
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<objekt okna (neznámy) na %.8lX>"
+
+#: if_python.c:1854
+#, c-format
+msgid "<window %d>"
+msgstr "<okno %d>"
+
+#: if_python.c:1930
+msgid "no such window"
+msgstr "¾iadne také okno"
+
+#: if_python.c:2187 if_python.c:2222 if_python.c:2272 if_python.c:2335
+#: if_python.c:2455 if_python.c:2507 if_tcl.c:685 if_tcl.c:730 if_tcl.c:804
+#: if_tcl.c:874 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "nedajú sa ulo¾i» spätné informácie"
+
+#: if_python.c:2189 if_python.c:2279 if_python.c:2346
+msgid "cannot delete line"
+msgstr "nedá sa vymaza» riadok"
+
+#: if_python.c:2224 if_python.c:2362 if_tcl.c:691 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "nedá sa nahradi» riadok"
+
+#: if_python.c:2378 if_python.c:2457 if_python.c:2515
+msgid "cannot insert line"
+msgstr "nedá sa vlo¾i» riadok"
+
+#: if_python.c:2619
+msgid "string cannot contain newlines"
+msgstr "re»azec nesmie obsahova» znaky nového riadku"
+
+#: if_ruby.c:401
+msgid "E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: Prepáète, tento príkaz je vypnutý, Ruby kni¾nica nemô¾e by» naèítaná."
+
+#: if_ruby.c:464
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: Neznámy 'longjmp' stav %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Prepnú» implementáciu/definíciu"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Ukáza» základnú triedu"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Ukáza» pre»a¾enú èlenskú funkciu"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Obnovi» zo súboru"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Obnovi» z projektu"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Obnovi» zo v¹etkých projektov"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Obnovi»"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Ukáza» zdroj"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Nájs» znak"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Prezrie» triedu"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Ukáza» triedu v hierarchii"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Ukáza» triedu v obmedzenej hierarchii"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref odkazuje na"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref odkázaný z"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref má"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref pou¾itý"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Ukáza» dokumentáciu"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Vytvori» dokumentáciu pre"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Zlihalo pripojenie na SNiFF+, Preverte prostredie (sniffemacs sa musí "
+"nachádza» v $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Chyba poèas èítania. Odpojené"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ je aktuálne "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ne"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "pripojený"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Neznáma SNiFF+ po¾iadavka: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Chyba pripojenia na SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ nie je pripojený"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Nie je SNiFF+ bufferom"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Chyba zápisu. Odpojené"
+
+#: if_tcl.c:419
+msgid "invalid buffer number"
+msgstr "chybné èíslo bufferu"
+
+#: if_tcl.c:465 if_tcl.c:932 if_tcl.c:1111
+msgid "not implemented yet"
+msgstr "nie je e¹te podporované"
+
+#: if_tcl.c:502
+msgid "unknown option"
+msgstr "neznáma voµba"
+
+#. ???
+#: if_tcl.c:775
+msgid "cannot set line(s)"
+msgstr "nedajú sa nastavi» riadky"
+
+#: if_tcl.c:846
+msgid "mark not set"
+msgstr "znaèka nie je nastavená"
+
+#: if_tcl.c:852 if_tcl.c:1067
+#, c-format
+msgid "row %d column %d"
+msgstr "riadok %d ståpec %d"
+
+#: if_tcl.c:882
+msgid "cannot insert/append line"
+msgstr "nedá sa vlo¾i»/pripoji» riadok"
+
+#: if_tcl.c:1269
+msgid "unknown flag: "
+msgstr "neznámy príznak: "
+
+#: if_tcl.c:1339
+msgid "unknown vimOption"
+msgstr "neznáma vimMo¾nos»"
+
+#: if_tcl.c:1424
+msgid "keyboard interrupt"
+msgstr "preru¹enie z klávesnice"
+
+#: if_tcl.c:1429
+msgid "vim error"
+msgstr "chyba vim"
+
+#: if_tcl.c:1472
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "nedá sa vytvori» príkaz bufferu/okna: objekt vymazaný"
+
+#: if_tcl.c:1546
+msgid "cannot register callback command: buffer/window is already being deleted"
+msgstr "nedá sa zaregistrova» príkaz spätného volania: buffer/okno u¾ bol vymazaný"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1563
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL FATAL ERROR: reflist po¹kodený!? Oznámte, prosím, túto chybu na "
+"vim-dev@vim.org"
+
+#: if_tcl.c:1564
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "nedá sa zaregistrova» príkaz spätného volania: odkaz na buffer/okno nenájdený"
+
+#: if_tcl.c:1725
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "Prepáète, tento príkaz je vypnutý, Tcl kni¾nica nemô¾e by» naèítaná."
+
+#: if_tcl.c:1887
+msgid "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL CHYBA: návratový kód nie je celé èíslo!? Oznamte, presím, tuto "
+"chybu na vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "nedá sa preèíta» riadok"
+
+#: if_xcmdsrv.c:213
+msgid "Unable to register a command server name"
+msgstr "Nemô¾em zaregistrova» meno príkazového servra"
+
+#: if_xcmdsrv.c:434 os_mswin.c:2108
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: meno registrovaného servra \"%s\" neexistuje"
+
+#: if_xcmdsrv.c:463
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Chyba poèas prenosu príkazu do cieµového programu"
+
+#: if_xcmdsrv.c:732
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "Pou¾íté chybné id servra: %s"
+
+#: if_xcmdsrv.c:1079
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: nemô¾em èíta» VIM registrovú vlastnos»"
+
+#: if_xcmdsrv.c:1090
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM registrová ¾iados» je zle formulovaná. Vymazané!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "Neznáma voµba"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Príli¹ mnoho upravovacích argumentov"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "Chýba argument po"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "Chyby za voµbou"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Príli¹ mnoho \"+príkaz\" èi \"-c príkaz\" argumentov"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "Chybný argument pre"
+
+#: main.c:450
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Tento Vim nebol kompilovaný s porovnávacími funkciami."
+
+#: main.c:875
+msgid "Attempt to open script file again: \""
+msgstr "Pokus o opätovné otvorenie skriptu: \""
+
+#: main.c:879 main.c:886 main.c:930 memline.c:3673 memline.c:3677
+#: version.c:892 version.c:897 version.c:902 version.c:907 version.c:912
+#: version.c:917 version.c:923 version.c:927 version.c:931 version.c:936
+#: version.c:943 version.c:951 version.c:957
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:884
+msgid "Cannot open for reading: \""
+msgstr "Nedá sa otvori» pre zápis: \""
+
+#: main.c:928
+msgid "Cannot open for script output: \""
+msgstr "Nedá sa otvori» pre výstup skriptu: \""
+
+#: main.c:1044
+#, c-format
+msgid "%d files to edit\n"
+msgstr "poèet súborov pre úpravu: %d\n"
+
+#: main.c:1118
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Varovanie: Výstup nesmeruje na terminál\n"
+
+#: main.c:1120
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Varovanie: Vstup nepochádza z terminálu\n"
+
+#. just in case..
+#: main.c:1195
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc príkazový riadok"
+
+#: main.c:1230
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Nedá sa èíta» z \"%s\""
+
+#: main.c:2205
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Podrobnej¹ie informácie získáte pomocou \"vim -h\"\n"
+
+#: main.c:2238
+msgid "[file ..] edit specified file(s)"
+msgstr "[súbor ..] .. upravi» súbor(y)"
+
+#: main.c:2239
+msgid "- read text from stdin"
+msgstr "- èíta» text z ¹tandardného vstupu"
+
+#: main.c:2240
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag upravi» súbor na mieste definície tagu"
+
+#: main.c:2242
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [chybový súbor] upravi» súbor na mieste výskytu prvej chyby"
+
+#: main.c:2251
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"pou¾itie:"
+
+#: main.c:2254
+msgid " vim [arguments] "
+msgstr "vim [argumenty] "
+
+#: main.c:2258
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" alebo"
+
+#: main.c:2261
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argumenty:\n"
+
+#: main.c:2262
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tMô¾u nasledova» iba názvy súborov"
+
+#: main.c:2264
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tnepodarilo sa expandova» ¾olíkové znaky (wildcards)"
+
+#: main.c:2267
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tprihlási» gvim na OLE"
+
+#: main.c:2268
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-register\t\todhlási» gvim z OLE"
+
+#: main.c:2271
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tspusti» v GUI móde (rovnaké ako \"gvim\")"
+
+#: main.c:2272
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tPopredie: pri spustení GUI sa neoddelí od shellu"
+
+#: main.c:2274
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi mód (rovnaké ako \"vi\")"
+
+#: main.c:2275
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx mód (rovnaké ako \"ex\")"
+
+#: main.c:2276
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tTichý (dávkový) mód (iba pre \"ex\")"
+
+#: main.c:2278
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tPorovnávací mód (rovnaké ako \"vimdiff\")"
+
+#: main.c:2280
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tJednoduchý mód (rovnaké ako \"evim\", modeless)"
+
+#: main.c:2281
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tMód iba_pre_èítanie (ako \"view\")"
+
+#: main.c:2282
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tObmedzený mód (rovnaké ako \"rvim\")"
+
+#: main.c:2283
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tZmeny (ukladanie súborov) zakázané"
+
+#: main.c:2284
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tZmeny v texte nie sú povolené"
+
+#: main.c:2285
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinárny mód"
+
+#: main.c:2287
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp mód"
+
+#: main.c:2289
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatabilný s Vi: 'compatible'"
+
+#: main.c:2290
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tKompatibilita s Vi vypnutá: 'nocompatible'"
+
+#: main.c:2291
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tÚroveò výpisu hlá¹ok"
+
+#: main.c:2292
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tLadiaci mód"
+
+#: main.c:2293
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tNebude vytvára» odkladací súbor, bude pou¾íva» iba pamä»"
+
+#: main.c:2294
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tVypí¹e zoznam odkladacích súborov a skonèí"
+
+#: main.c:2295
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r názov súboru\tObnoví preru¹ené sedenie"
+
+#: main.c:2296
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tRovnaké ako -r"
+
+#: main.c:2298
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tNebude pou¾íva» newcli pre otvorenie okna"
+
+#: main.c:2299
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <zariadenie>\t\tPou¾i» <zariadenie> pre I/O"
+
+#: main.c:2302
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tna spusteníe v hebrejskom móde"
+
+#: main.c:2305
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tna spusteníe vo Farsi móde"
+
+#: main.c:2307
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminál>\tNastaví typ terminálu na <terminál>"
+
+#: main.c:2308
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tPou¾ije <vimrc> namiesto akéhokoµvek .vimrc"
+
+#: main.c:2310
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tPou¾ije <gvimrc> namiesto akéhokoµvek .gvimrc"
+
+#: main.c:2312
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tNenahrá 'plugin' skripty"
+
+#: main.c:2313
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tOtvorí N okien (implicitne jedno pre ka¾dý súbor)"
+
+#: main.c:2314
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tako -o ale rozdelí vertikálne"
+
+#: main.c:2315
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tNastaví kurzor na koniec súboru"
+
+#: main.c:2316
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<riadok>\t\tNastaví kurzor na <riadok>"
+
+#: main.c:2318
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <príkaz>\t\tVykoná <príkaz> pred nahraním vimrc súboru"
+
+#: main.c:2320
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <príkaz>\t\tPo nahraní prvého súboru vykoná <príkaz>"
+
+#: main.c:2321
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <sedenie>\t\tPo nahrání prvého súboru vykoná príkazy v súbore <sedenie>"
+
+#: main.c:2322
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <skript>\t\tNaèíta príkazy normálneho módu zo <skriptu>"
+
+#: main.c:2323
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <skript>\t\tPripojí v¹etky napísané príkazy do súboru <skript>"
+
+#: main.c:2324
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <skript>\t\tUlo¾í v¹etky napísané príkazy do súboru <skript>"
+
+#: main.c:2326
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tÚprava za¹ifrovaných súborov"
+
+#: main.c:2330
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <displej>\tSpustí vim na <displej>"
+
+#: main.c:2332
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tNepripojí sa k X serveru"
+
+#: main.c:2334
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tOtvorí Vim vnútri iného GTK programu."
+
+#: main.c:2338
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <súbory>\tUpravi» <súbory> na Vim servri a skonèi»"
+
+#: main.c:2339
+msgid "--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <súbory>\tAko --remote ale èaká na súbory pre ukonèenie úprav"
+
+#: main.c:2340
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <voµby>\tOdo¹le <voµby> na Vim server a skonèí"
+
+#: main.c:2341
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <výraz>\tSpusti <výraz> na servri a vytlaèí výsledok"
+
+#: main.c:2342
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tVypí¹e zoznam mien dostupných Vim servrov a skonèí"
+
+#: main.c:2343
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <názov>\tOdo¹le na Vim server <názov>"
+
+#: main.c:2346
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tPou¾ije <viminfo> namiesto akéhokoµvek .viminfo"
+
+#: main.c:2348
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tVypí¹e túto nápovedu a skonèí"
+
+#: main.c:2349
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tvypí¹e informácie o verzii a skonèí"
+
+#: main.c:2353
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (Motif verzia):\n"
+
+#: main.c:2356
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (Athena verzia):\n"
+
+#: main.c:2359
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <displej>\tSpustí vim na <displej>"
+
+#: main.c:2360
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tSpustí vim minimalizované"
+
+#: main.c:2362
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <názov>\t\tPou¾ije resource ako by vim mal <názov>"
+
+#: main.c:2363
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (nie je implementované)\n"
+
+#: main.c:2365
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <farba>\tNastaví sa <farba> pozadia (tie¾ -bg)"
+
+#: main.c:2366
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <farba>\tNastaví sa <farba> popredia (tie¾ -fg)"
+
+#: main.c:2367 main.c:2387
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <písmo>\t\tNastaví <písmo> normálneho textu (tie¾ -fn)"
+
+#: main.c:2368
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <písmo>\tNastaví <písmo> pre zvýraznený text"
+
+#: main.c:2369
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <písmo>\tNastaví <písmo> pre kurzívu"
+
+#: main.c:2370 main.c:2388
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geometrie>\tNastaví sa <geometria> (tie¾ -geom)"
+
+#: main.c:2371
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <¹írka>\tNastaví <¹írku> okrajov (tie¾ -bw)"
+
+#: main.c:2372
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <¹írka> Nastaví <¹írku> posuvnej li¹ty (tie¾ -sw)"
+
+#: main.c:2374
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <vý¹ka>\tNastaví <vý¹ku> ponuky (tie¾ -mh)"
+
+#: main.c:2376 main.c:2389
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tPou¾ije reverzné farby (tie¾ -rv)"
+
+#: main.c:2377
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tNepou¾ije reverzné farby (tie¾ +rv)"
+
+#: main.c:2378
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tNastaví zadaný <resource>"
+
+#: main.c:2381
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (RISC OS verzia):\n"
+
+#: main.c:2382
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <poèet>\t<poèet> ståpcov na okno"
+
+#: main.c:2383
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <poèet>\t<poèet> riadkov na okno"
+
+#: main.c:2386
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argumenty pre gvim (GTK+ verzia):\n"
+
+#: main.c:2390
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <displej>\tspustí vim na <displej> (tie¾ --display)"
+
+#: main.c:2392
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tVypí¹e Gnome argumenty"
+
+#. Failed to send, abort.
+#: main.c:2634
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"Odoslanie zlyhalo.\n"
+
+#. Let vim start normally.
+#: main.c:2639
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Odoslanie zlyhalo. Pokú¹am sa spusti» lokálne\n"
+
+#: main.c:2672 main.c:2693
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d upravených súborov z %d"
+
+#: main.c:2716
+msgid "Send expression failed.\n"
+msgstr "Odoslanie výrazu zlyhalo.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "Nie sú nastavené ¾iadne znaèky"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283:\"%s\" nevyhovujú ¾iadne znaèky"
+
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"znaèka riadok ståpec súbor/text"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" skok riadok ståpec súbor/text"
+
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Súborové znaèky:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Zoznam skokov (zaèínajúci najnov¹ou polo¾kou):\n"
+
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# História znaèiek v súboroch (zaèínajúci najnov¹ou polo¾kou):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "Chýba '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "Chybná kódová stránka"
+
+#: mbyte.c:3103
+msgid "E284: Cannot set IC values"
+msgstr "E284: Nedjú sa nastavi» IC hodnoty"
+
+#: mbyte.c:3255
+msgid "E285: Failed to create input context"
+msgstr "E285: Nepodarilo sa vytvori» vstupný kontext"
+
+#: mbyte.c:3402
+msgid "E286: Failed to open input method"
+msgstr "E286: Nepodarilo sa otvori» vstupnú metódu"
+
+#: mbyte.c:3413
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Varovanie: likvidaèné spätné volanie sa nedá nastavi» na IM"
+
+#: mbyte.c:3419
+msgid "E288: input method doesn't support any style"
+msgstr "E288: vstupná metóda nepodporuje ¾iadny ¹týl"
+
+#: mbyte.c:3476
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: vstupná metóda nepodporuje môj 'preedit' typ"
+
+#: mbyte.c:3550
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: Nadbodový ¹týl vy¾aduje fontset"
+
+#: mbyte.c:3578
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Máte GTK+ verziu star¹iu ne¾ 1.2.3. Stavová plocha vypnutá."
+
+#: mbyte.c:3843
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Server vstupných metód nebe¾í"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: blok nebol zamknutý"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Chyba posunu pri èítaní odkladacieho súboru"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: Chyba pri èítaní odkladacieho súboru"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Chyba posunu pri ukladaní do odkladacieho súboru"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: Chyba pri ukladaní do odkladacieho súboru"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Odkladací súbor u¾ existuje!"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Nedá sa získa» blok 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Nedá sa získa» blok 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Nedá sa získa» blok 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Ups, odkladací súbor bol stratený!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Nedá sa premenova» odkladací súbor"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Nedá sa otvori» odkladací súbor pre \"%s\", oprava nie je nemo¾ná"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: nedá sa získa» blok 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Odkladací súbor pre %s nebol nájdený"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Zadajte èíslo odkladacieho súboru, ktorý sa má pou¾it (0 pre ukonèenie): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Nedá sa otvori» %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Nedá sa èíta» blok 0 z "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Mo¾no nedo¹lo k ¾iadnym zmenám, alebo Vim neaktualizoval odkladací súbor."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " nedá sa pou¾i» s touto verziou Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Pou¾ite Vim verziu 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s sa nezdá by» odkladacím súborom Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " nedá sa pou¾í» na tomto poèítaèi.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Súbor bol vytvorený "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"alebo bol súbor po¹kodený."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Pou¾ívám odkladací súbor \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Pôvodný súbor \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Varovanie: Pôvodný súbor mohl by» zmenený"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Nedá sa èíta» blok 1 z %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???CHÝBA MNOHO RIADKOV"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???CHYBNÝ POÈET RIADKOV"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???PRÁZDNY BLOK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???CHÝBAJÚCE RIADKY"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ID bloku 1 je chybné (je %s odkladacím súborom?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???CHÝBA BLOK"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "od ??? po ???END mô¾u by» riadky pomie¹ané"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "od ??? po ???END mô¾u by» vlo¾ené/vymazané riadky"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???KONIEC"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Obnova preru¹ená"
+
+#: memline.c:1145
+msgid "E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: V priebehu obnovy do¹lo k chybám; skontrolujte riadky zaèínajúce na ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Obnova dokonèená. Skontrolujte, èi je v¹etko v poriadku."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Zvá¾te ulo¾enie tohoto súboru pod iným menom\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "a pomocou programu diff zistite zmeny oproti pôvodnému súboru.)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr "Potom vyma¾te odkladací súbor.\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Nájdené odkladacie súbory:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " V aktuálnom adresári:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " So zadaným menom:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " V adresári "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- ¾iadne --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " vlastník: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " dátum vytvorenia: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " dátum vytvorenia: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [od Vim verzie 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [nevypadá ako odkladací súbor Vim]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " názov súboru: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" dátum zmeny: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ÁNO"
+
+#: memline.c:1524
+msgid "no"
+msgstr "nie"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" u¾ívateµské meno: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " názov poèítaèa: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" názov poèítaèa: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ID procesu : "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (stále aktívny)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [nepou¾iteµné s touto verziou Vim]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [nepou¾itelné na tomto poèítaèi]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [nedá sa preèíta»]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [nedá sa otvori»]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Nedá sa zachova» - odkladací súbor neexistuje."
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "Súbor zachovaný"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: Uchovanie sa nepodarilo"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: chybné èíslo riadku: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: nedá sa nájs» riadok %ld"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: chybné id ukazovateµa na blok 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx by malo ma» hodnotu 3"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Aktualizovaných príli¹ veµa blokov?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: chybné id ukazovateµa na blok 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "vymazaný blok 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Nedá sa nájs» riadok %ld"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: chybné id ukazovateµa na blok"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count má nulovú hodnotu"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: èíslo riadku je mimo rozsah: %ld (za koncom)"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: chybný poèet riadkov v bloku %ld"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "Nárast veµkosti zásobníku"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: chybný id ukazovateµa na blok 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: POZOR"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Nájdený odkladací súbor s menom \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "Pri otváraní súboru\""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " NOV©Í ako odkladací súbor!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Súbor mô¾e by» upravovaný iným programom.\n"
+" Ak je tomu tak, potom si dajte pozor, aby ste po ulo¾ení zmien\n"
+" nemali dve rôzne verzie toho istého súboru.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Ukonèite program, alebo opatrnne pokraèujte v úpravách.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) Úprava tohoto súboru bola preru¹ená neoèakávaným ukonèením programu.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Ak je tomu tak, potom pou¾ite \":recover\" alebo \"vim -r "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" pre obnovenie zmien (viz \":help recovery)\".\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Pokiaµ ste tak u¾ urobili, tak vyma¾te odkladací súbor \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" a táto správa sa u¾ nebude objavova».\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "Odkladací súbor \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" u¾ existuje!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - POZOR"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "Odkladací súbor u¾ existuje!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Otvori» iba pre èítanie\n"
+"&Pokraèova» v úpravách\n"
+"O&bnovi» súbor\n"
+"&Koniec"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Otvori» iba pre èítanie\n"
+"&Pokraèovat v úpravách\n"
+"O&bnovi» súbor\n"
+"&Koniec\n"
+"&Zmaza»"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: Príli¹ mnoho odkladacích súborov"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Èas» cesty k predmetu ponuky nie je podponukou"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Ponuka existuje iba v inom móde"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Ponuka tohoto mena neexistuje"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Cesta ponuky nesmie vies» do podponuky"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Polo¾ky ponuky sa nedjú pridáva» priamo na li¹tu"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Oddeµovaè nesmie by» èas»ou cesty ponuky"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1070
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Ponuky ---"
+
+#: menu.c:1987
+msgid "Tear off this menu"
+msgstr "Odtrhnú» tuto ponuku"
+
+#: menu.c:2052
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Cesta ponuky musí vies» k polo¾ke ponuky"
+
+#: menu.c:2072
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Vzor nenájdený: %s"
+
+#: menu.c:2141
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: V %s móde nie je ponuka definovaná"
+
+#: menu.c:2179
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Cesta ponuky musí vies» do podponuky"
+
+#: menu.c:2200
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Ponuka nenájdená - skontrolujte názvy ponúk"
+
+#: message.c:470
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Chyba pri spracovaní %s:"
+
+#: message.c:486
+#, c-format
+msgid "line %4ld:"
+msgstr "riadok %4ld:"
+
+#: message.c:526
+msgid "[string too long]"
+msgstr "[príli¹ dlhý re»azec]"
+
+#: message.c:672
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Správca správ: Martin Lacko <lacko@host.sk>"
+
+#: message.c:885
+msgid "Interrupt: "
+msgstr "Preru¹enie: "
+
+#: message.c:888
+msgid "Hit ENTER to continue"
+msgstr "Pokraèovanie stlaèením ENTER"
+
+#: message.c:890
+msgid "Hit ENTER or type command to continue"
+msgstr "Pre pokraèovanie stlaète ENTER alebo zadajte príkaz"
+
+#: message.c:1961
+msgid "-- More --"
+msgstr "-- Pokraèovanie --"
+
+#: message.c:1964
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: riadok, MEDZERNÍK/b: stránka, d/u: 0.5 stránky, q: koniec)"
+
+#: message.c:1965
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: riadok, MEDZERNÍK: stránka, d: 0.5 stránky, q: koniec)"
+
+#: message.c:2441 message.c:2456
+msgid "Question"
+msgstr "Otázka"
+
+#: message.c:2443
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"Án&o\n"
+"&Nie"
+
+#: message.c:2458
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"Án&o\n"
+"&Nie\n"
+"&Zru¹i»"
+
+#: message.c:2476
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"Án&o\n"
+"&Nie\n"
+"&Ulo¾i» v¹etko\n"
+"Zahodi» &v¹etko\n"
+"&Zru¹i»"
+
+#: message.c:2517
+msgid "Save File dialog"
+msgstr "Dialóg pre ukladanie súborov"
+
+#: message.c:2519
+msgid "Open File dialog"
+msgstr "Dialóg pre otváranie súborov"
+
+#. TODO: non-GUI file selector here
+#: message.c:2590
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ¥utujem, ale konzolová verzia nepodporuje prehliadaè súborov"
+
+#: misc1.c:2457
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Varovanie: mením súbor iba pre èítanie"
+
+#: misc1.c:2686
+msgid "1 more line"
+msgstr "poèet nových riadkov: 1"
+
+#: misc1.c:2688
+msgid "1 line less"
+msgstr "poèet vymazaných riadkov: 1"
+
+#: misc1.c:2693
+#, c-format
+msgid "%ld more lines"
+msgstr "poèet nových riadkov: %ld"
+
+#: misc1.c:2695
+#, c-format
+msgid "%ld fewer lines"
+msgstr "poèet vymazaných riadkov: %ld"
+
+#: misc1.c:2698
+msgid " (Interrupted)"
+msgstr " (Preru¹ené)"
+
+#: misc1.c:6316
+msgid "Vim: preserving files...\n"
+msgstr "Vim: zachovávam súbory...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6326
+msgid "Vim: Finished.\n"
+msgstr "Vim: ukonèený\n"
+
+#: misc2.c:661 misc2.c:677
+msgid "ERROR: "
+msgstr "CHYBA: "
+
+#: misc2.c:681
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bajtov] celkom uvolnené-alokované %lu-%lu, vyu¾ité %lu, maximálne vyu¾itie %"
+"lu\n"
+
+#: misc2.c:683
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[volanie] celkom re/malloc(): %lu, celkom free() %lu\n"
+"\n"
+
+#: misc2.c:738
+msgid "E340: Line is becoming too long"
+msgstr "E340: Riadok sa stáva príli¹ dlhým"
+
+#: misc2.c:782
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Vnútorná chyba: lalloc(%ld, )"
+
+#: misc2.c:890
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Nedostatok pamäte! (alokujem %lu bytov)"
+
+#: misc2.c:2541
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Volám shell na spustenie: \"%s\""
+
+#: misc2.c:2740 misc2.c:5225 option.c:4636
+msgid "Missing colon"
+msgstr "Chýba dvojbodka"
+
+#: misc2.c:2742 misc2.c:2769
+msgid "Illegal mode"
+msgstr "Neprístupný mód"
+
+#: misc2.c:2808
+msgid "Illegal mouseshape"
+msgstr "Chybný tvar my¹i"
+
+#: misc2.c:2848 misc2.c:5245
+msgid "digit expected"
+msgstr "oèakávaná èíslica"
+
+#: misc2.c:2853
+msgid "Illegal percentage"
+msgstr "Neprístupné precento"
+
+#: misc2.c:3157
+msgid "Enter encryption key: "
+msgstr "Zadajte ¹ifrovací kµúè: "
+
+#: misc2.c:3158
+msgid "Enter same key again: "
+msgstr "Vlo¾te kµúè znova: "
+
+#: misc2.c:3168
+msgid "Keys don't match!"
+msgstr "Kµúè nie je správny!"
+
+#: misc2.c:3707
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Chybná cesta: '**[èíslo] musí by» buï na konci cesty, alebo musí by»\n"
+"nasledované '%s. Viz :help path."
+
+#: misc2.c:4979
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Adresár \"%s\" sa nedá v cdpath nájs»"
+
+#: misc2.c:4982
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Súbor \"%s\" sa nepodarilo nájs»"
+
+#: misc2.c:4988
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ®iadny ïal¹í adresár \"%s\" nebol v cdpath nájdený"
+
+#: misc2.c:4991
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ®iadny ïal¹í súbor \"%s\" nebol v ceste nájdený"
+
+#: misc2.c:5237
+msgid "Illegal component"
+msgstr "Neprístupný komponent"
+
+#: normal.c:2843
+msgid "Warning: terminal cannot highlight"
+msgstr "Varovanie: terminál nepodporuje zvýrazòovanie"
+
+#: normal.c:3038
+msgid "E348: No string under cursor"
+msgstr "E348: Pod kurzorom nie je ¾iadny re»azec"
+
+#: normal.c:3040
+msgid "E349: No identifier under cursor"
+msgstr "E349: Pod kurzorom nie je ¾iadny identifikátor"
+
+#: normal.c:4211
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Pomocou 'foldmethod' sa nedá vymaza» záhyb"
+
+#: ops.c:283
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "poèet riadkov posunutých naraz pomocou %s : 1"
+
+#: ops.c:285
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "poèet riadkov posunutých %s krát pomocou %d s : 1"
+
+#: ops.c:290
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld riadkov posunutých naraz pomocou %s"
+
+#: ops.c:293
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld riadkov posunutých pomocou %s %d krát"
+
+#: ops.c:651
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "poèet riadkov pre odsadenie: %ld"
+
+#: ops.c:701
+msgid "1 line indented "
+msgstr "poèet riadkov pre odsadenie: 1 "
+
+#: ops.c:703
+#, c-format
+msgid "%ld lines indented "
+msgstr "poèet odsadených riadkov: %ld"
+
+#. must display the prompt
+#: ops.c:1546
+msgid "cannot yank; delete anyway"
+msgstr "nedá sa kopírova»; napriek tomu vymazané"
+
+#: ops.c:2080
+msgid "1 line changed"
+msgstr "poèet zmenených riadkov: 1"
+
+#: ops.c:2082
+#, c-format
+msgid "%ld lines changed"
+msgstr "poèet zmenených riadkov: %ld"
+
+#: ops.c:2439
+#, c-format
+msgid "freeing %ld lines"
+msgstr "poèet uvolòovaných riadkov: %ld"
+
+#: ops.c:2720
+msgid "1 line yanked"
+msgstr "poèet skopírovaných riadkov: 1"
+
+#: ops.c:2722
+#, c-format
+msgid "%ld lines yanked"
+msgstr "poèet skopírovaných riadkov: %ld"
+
+#: ops.c:2995
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Register %s je prázdny"
+
+#. Highlight title
+#: ops.c:3553
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Registre ---"
+
+#: ops.c:4711
+msgid "Illegal register name"
+msgstr "Neprístupný názov registru"
+
+#: ops.c:4797
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Registre:\n"
+
+#: ops.c:4825
+#, c-format
+msgid "Unknown register type %d"
+msgstr "%d nie je známým typom registru"
+
+#: ops.c:5217
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: '%s' nie je prístupné meno registru"
+
+#: ops.c:5560
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Buniek; "
+
+#: ops.c:5567
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Vybraných %s%ld z %ld riadkov; %ld zo %ld slov; %ld z %ld Bytov"
+
+#: ops.c:5583
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Bunka %s z %s; Riadok %ld z %ld; Slovo %ld z %ld; Byte %ld z %ld"
+
+#: ops.c:5594
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld pre BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "Ïakujem za pou¾itie Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "Voµba nie je podporovaná"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "Nie je v modeline povolené"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tOstatné nastavenie z "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "Po = je vy¾adované èíslo"
+
+#: option.c:3714 option.c:4322
+msgid "Not found in termcap"
+msgstr "Nenájdený v termcapu"
+
+#: option.c:3780
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "Neprístupný znak <%s>"
+
+#: option.c:4307 option.c:5570
+msgid "Not allowed here"
+msgstr "Toto nie je na tomto mieste povolené"
+
+#: option.c:4314
+msgid "Cannot set 'term' to empty string"
+msgstr "Voµba 'term' nemô¾e by» prázdna"
+
+#: option.c:4317
+msgid "Cannot change term in GUI"
+msgstr "V GUI sa nedá meni» term"
+
+#: option.c:4319
+msgid "Use \":gui\" to start the GUI"
+msgstr "Pou¾ite \"gui\" pre spustenie GUI"
+
+#: option.c:4340
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "voµby 'backupext' a 'patchmode' majú rovnakú hodnotu"
+
+#: option.c:4638
+msgid "Zero length string"
+msgstr "Re»azec s nulovou då¾kou"
+
+#: option.c:4706
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "Po <%s> chýba èíslo"
+
+#: option.c:4720
+msgid "Missing comma"
+msgstr "Chýba èiarka"
+
+#: option.c:4727
+msgid "Must specify a ' value"
+msgstr "Je nutné zada» hodnotu '"
+
+#: option.c:4767
+msgid "contains unprintable character"
+msgstr "obsahuje netlaèiteµné znaky"
+
+#: option.c:4800
+msgid "Invalid font(s)"
+msgstr "Chybné písma"
+
+#: option.c:4807
+msgid "can't select fontset"
+msgstr "nedá sa vybra» sada písiem"
+
+#: option.c:4809
+msgid "Invalid fontset"
+msgstr "Chybná sada písiem"
+
+#: option.c:4816
+msgid "can't select wide font"
+msgstr "nedá sa vybra» ¹iroký font"
+
+#: option.c:4818
+msgid "Invalid wide font"
+msgstr "Chybné ¹iroké písmo"
+
+#: option.c:5088
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "Neprístupný znak po <%c>"
+
+#: option.c:5171
+msgid "comma required"
+msgstr "je nutná èiarka"
+
+#: option.c:5179
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'komentár' musí by» prázdny alebo musí obsahova» %s"
+
+#: option.c:5226
+msgid "No mouse support"
+msgstr "Bez podpory my¹i"
+
+#: option.c:5472
+msgid "Unclosed expression sequence"
+msgstr "Neuzatvorené zoskupenie výrazov"
+
+#: option.c:5476
+msgid "too many items"
+msgstr "príli¹ mnoho polo¾iek"
+
+#: option.c:5478
+msgid "unbalanced groups"
+msgstr "nevyvá¾ené skupiny"
+
+#: option.c:5693
+msgid "A preview window already exists"
+msgstr "Okno náhµadu u¾ existuje"
+
+#: option.c:5954 option.c:5983
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "hodnota voµby 'winheight' nesmie by» men¹ia ne¾ hodnota voµby 'winminheight'"
+
+#: option.c:5999 option.c:6018
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "hodnota voµby 'winwidth' nesmie by» men¹ia ne¾ hodnota volµy 'winminwidth'"
+
+#: option.c:6159
+#, c-format
+msgid "Need at least %d lines"
+msgstr "Minimálne potrebný poèet riadkov: %d"
+
+#: option.c:6168
+#, c-format
+msgid "Need at least %d columns"
+msgstr "Minimálne potrebný poèet ståpcov: %d"
+
+#: option.c:6465
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Neznáma voµba: %s"
+
+#: option.c:6574
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Kódy terminálu ---"
+
+#: option.c:6576
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Nastavenie globálnych volieb ---"
+
+#: option.c:6578
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Nastavenie globálnych volieb ---"
+
+#: option.c:6580
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Mo¾nosti ---"
+
+#: option.c:7269
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp CHYBA"
+
+#: option.c:8227
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': pre %s chýba vyhovujúci znak"
+
+#: option.c:8261
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': nadbytoèné znaky po bodkoèiarke: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "nedá sa otvori» "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Nedá sa otvori» okno!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Je potrebná Amigados verzia 2.04 alebo nov¹ia\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Potrebný %s verzia %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "Nedá sa otvori» NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "Nedá sa vytvori» "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ukonèený s %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "nemô¾em zmeni» konzolový mód ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1177 os_mswin.c:629 os_riscos.c:757 os_unix.c:2803
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Nastavovanie re¾imu obrazovky nie je podporované"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: nie je konzolou??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Nedá sa spusti» shell s -f voµbou"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "Nedá sa spusti» "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " vrátené\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE príli¹ malá."
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O CHYBA"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(skrátené)"
+
+#: os_mswin.c:604
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'ståpce' nie je 80, nemô¾em spusti» externý príkaz"
+
+#: os_mswin.c:716 os_unix.c:5116
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Vyvolanie kni¾niènej funkcia zlyhalo pre \"%s()\""
+
+#: os_mswin.c:1365
+msgid "E237: Printer selection failed"
+msgstr "E237: Zlyhal výber tlaèiarne"
+
+#: os_mswin.c:1405
+#, c-format
+msgid "to %s on %s"
+msgstr "%s na %s"
+
+#: os_mswin.c:1420
+#, c-format
+msgid "E448: Unknown font: %s"
+msgstr "E448: Neznáme písmo: %s"
+
+#: os_mswin.c:1470 os_mswin.c:1480
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Chyba tlaèe: %s"
+
+#: os_mswin.c:1481
+msgid "Unknown"
+msgstr "Neznámy"
+
+#: os_mswin.c:1508
+#, c-format
+msgid "Printing '%s'"
+msgstr "Tlaèím '%s'"
+
+#: os_mswin.c:2596
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Chybný názov znakovej sady \"%s\" v názve písma \"%s\""
+
+#: os_mswin.c:2604
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Chybný znak '%c' v názve písma \"%s\""
+
+#: os_riscos.c:1256
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Chybná 'osfiletype' voµba - pou¾itie Textu"
+
+#: os_unix.c:862
+msgid "Vim: Double signal, exiting\n"
+msgstr "VIm: dvojitý signál, konèím\n"
+
+#: os_unix.c:868
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Zachytený smrtiaci signál %s\n"
+
+#: os_unix.c:871
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Zachytený smrtiaci signál\n"
+
+#: os_unix.c:1125
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Otváram X displej - zaberie %ld msec"
+
+#: os_unix.c:1152
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: chyba X\n"
+
+#: os_unix.c:1219
+msgid "Testing the X display failed"
+msgstr "Testovanie X displeja zlyhalo"
+
+#: os_unix.c:1363
+msgid "Opening the X display timed out"
+msgstr "Uplynul èas otvorenia X displeja"
+
+#: os_unix.c:2976 os_unix.c:3634
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Nedá sa spusti» shell "
+
+#: os_unix.c:3021
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Nedá sa spusti» sh shell\n"
+
+#: os_unix.c:3025 os_unix.c:3640
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+" návratová hodnota shellu "
+
+#: os_unix.c:3159
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Nedjú sa vytvori» rúry\n"
+
+#: os_unix.c:3174
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Vyvolanie fork zlyhalo\n"
+
+#: os_unix.c:3647
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Príkaz ukonèený\n"
+
+#: os_unix.c:5164
+msgid "Opening the X display failed"
+msgstr "Otvorenie X displeja zlyhalo"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "Na riadku"
+
+#: os_win16.c:578 os_win32.c:3037
+#, c-format
+msgid "shell returned %d"
+msgstr "návratová hodnota shellu %d"
+
+#: os_win32.c:2505
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Zachytená udalos» %s\n"
+
+#: os_win32.c:2507
+msgid "close"
+msgstr "zavrie»"
+
+#: os_win32.c:2509
+msgid "logoff"
+msgstr "odhlási»"
+
+#: os_win32.c:2510
+msgid "shutdown"
+msgstr "vypnú»"
+
+#: os_win32.c:2991
+msgid "E371: Command not found"
+msgstr "E371: Príkaz nenájdený"
+
+#: os_win32.c:3004
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE nenájdený v $PATH.\n"
+"Po dokonèení externých príkazov nebude výstup pozastavený.\n"
+"Pozrite :help win32-vimrun pre viac informácií."
+
+#: os_win32.c:3007
+msgid "Vim Warning"
+msgstr "Vim Varovanie"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "Nemô¾em nahra» vim32.dll!"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM Chyba"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Nemô¾em opravi» odkazy funkcie na DLL!"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: Príli¹ mnoho %%%c vo formátovacom re»azci"
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Neoèakávaný výskyt %%%c vo formátovacom re»azci"
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: Vo formátovacom re»azci chýba ]"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Nepodporovaná formátová ¹pecifikácia %%%c vo formátovacom re»azci"
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Neprístupné %%%c v prefixe formátovacieho re»azca"
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Neprístupné %%%c vo formátovacom re»azci"
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' neobsahuje ¾iadny vzor"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Chýbajúci alebo prázdny názov adresára"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "®iadne ïal¹ie polo¾ky"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d/%d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (riadok vymazaný)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Koniec quickfix zoznamu"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Zaèiatok quickfix zoznamu"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "zoznam chýb %d z %d; poèet chýb: %d"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Nedá sa ulo¾i», je nastavená voµba 'buftype'"
+
+#: regexp.c:802
+msgid "E339: Pattern too long"
+msgstr "E339: Vzor je príli¹ dlhý"
+
+#: regexp.c:1319
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Vhniezdený %s*"
+
+#: regexp.c:1322
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Vhniezdené %s%c"
+
+#: regexp.c:1473
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c niè nenasleduje"
+
+#: regexp.c:2490
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Chyba syntaxe v %s{...}"
+
+#: regexp.c:2737
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Zachytené preteèenie zásobníku: príli¹ zlo¾itý regulárny výraz?"
+
+#: regexp.c:2872
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: vzor spôsobil preteèenie zásobníku"
+
+#: regexp.c:3108
+msgid "External submatches:\n"
+msgstr "Vnútorné podradené zhody:\n"
+
+#: screen.c:2063
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld riadkov zahnutých "
+
+#: screen.c:7517
+msgid " VREPLACE"
+msgstr " NAHRADI« VERTIKÁLNE"
+
+#: screen.c:7521
+msgid " REPLACE"
+msgstr " NAHRADI«"
+
+#: screen.c:7526
+msgid " REVERSE"
+msgstr " OBRÁTI«"
+
+#: screen.c:7528
+msgid " INSERT"
+msgstr " VLO®I«"
+
+#: screen.c:7531
+msgid " (insert)"
+msgstr " (vlo¾i»)"
+
+#: screen.c:7533
+msgid " (replace)"
+msgstr " (nahradi»)"
+
+#: screen.c:7535
+msgid " (vreplace)"
+msgstr " (nahradi» vertikálne)"
+
+#: screen.c:7538
+msgid " Hebrew"
+msgstr " hebrejský"
+
+#: screen.c:7546
+msgid " (lang)"
+msgstr " (jazyk)"
+
+#: screen.c:7549
+msgid " (paste)"
+msgstr " (vlo¾i»)"
+
+#: screen.c:7555
+msgid " SELECT"
+msgstr " ZHODY"
+
+#: screen.c:7557
+msgid " VISUAL"
+msgstr " VIZUÁLNE"
+
+#: screen.c:7559
+msgid " BLOCK"
+msgstr " BLOK"
+
+#: screen.c:7561
+msgid " LINE"
+msgstr " RIADOK"
+
+#: screen.c:7574 screen.c:7634
+msgid "recording"
+msgstr "nahrávam"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "hµadanie dosiahlo zaèiatok, pokraèovanie od konca"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "hµadanie dosiahlo koniec, pokraèovanie od zaèiatku"
+
+#: search.c:455
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Neprístupný hµadaný re»azec: %s"
+
+#: search.c:782
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: hµadanie dosiahlo zaèiatok bez nájdenia %s"
+
+#: search.c:784
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: hµadanie dosiahlo koniec bez nájdenia %s"
+
+#: search.c:1144
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Po ';' oèakávam '?' alebo '/'"
+
+#: search.c:3523
+msgid " (includes previously listed match)"
+msgstr " (vrátane u¾ vypísaných zhôd)"
+
+#. cursor at status line
+#: search.c:3543
+msgid "--- Included files "
+msgstr "--- Vlo¾ené súbory"
+
+#: search.c:3545
+msgid "not found "
+msgstr "nenájdené "
+
+#: search.c:3546
+msgid "in path ---\n"
+msgstr "v ceste ---\n"
+
+#: search.c:3585
+msgid " (Already listed)"
+msgstr " (U¾ vypísané)"
+
+#: search.c:3587
+msgid " NOT FOUND"
+msgstr " NENÁJDENÉ"
+
+#: search.c:3639
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Prehµadávam vlo¾ené súbory: %s"
+
+#: search.c:3857
+msgid "E387: Match is on current line"
+msgstr "E387: Zhoda je na aktuálnom riadku"
+
+#: search.c:3997
+msgid "All included files were found"
+msgstr "V¹etky vlo¾ené súbory boli nájdené"
+
+#: search.c:3999
+msgid "No included files"
+msgstr "®iadne vlo¾ené súbory"
+
+#: search.c:4015
+msgid "E388: Couldn't find definition"
+msgstr "E388: Nedá sa nájs» definícia"
+
+#: search.c:4017
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Nedá sa nájs» vzor"
+
+#: syntax.c:2999
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Neprístupný argument: %s"
+
+#: syntax.c:3179
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Syntaktická zostava %s neexistuje"
+
+#: syntax.c:3343
+msgid "No Syntax items defined for this buffer"
+msgstr "Pre tento buffer nie sú definované ¾iadne polo¾ky syntaxe"
+
+#: syntax.c:3351
+msgid "syncing on C-style comments"
+msgstr "synchronizujem komentáre v C ¹týle"
+
+#: syntax.c:3359
+msgid "no syncing"
+msgstr "¾iadne synchronizácie"
+
+#: syntax.c:3362
+msgid "syncing starts "
+msgstr "synchronizácia zaèína "
+
+#: syntax.c:3364 syntax.c:3439
+msgid " lines before top line"
+msgstr " riadkov pred zaèiatkom"
+
+#: syntax.c:3369
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Polo¾ky synchronizácie syntaxe ---"
+
+#: syntax.c:3374
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synchronizujem polo¾ky"
+
+#: syntax.c:3380
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Polo¾ky syntaxe ---"
+
+#: syntax.c:3403
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Syntaktická zostava %s neexistuje"
+
+#: syntax.c:3429
+msgid "minimal "
+msgstr "minimálne "
+
+#: syntax.c:3436
+msgid "maximal "
+msgstr "maximálne "
+
+#: syntax.c:3448
+msgid "; match "
+msgstr "; zhoda "
+
+#: syntax.c:3450
+msgid " line breaks"
+msgstr " riadkov"
+
+#: syntax.c:4078
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]here nesmie by» na tomto mieste"
+
+#: syntax.c:4102
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Pre %s chýba polo¾ka regiónu"
+
+#: syntax.c:4130
+msgid "E395: contains argument not accepted here"
+msgstr "E395: obsahuje argumenty, ktoré tu nie sú povolené"
+
+#: syntax.c:4141
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: obsahuje argumenty, ktoré tu nie sú povolené"
+
+#: syntax.c:4219
+msgid "E397: Filename required"
+msgstr "E397: Vy¾adovaný názov súboru"
+
+#: syntax.c:4557
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Chýba '=': %s"
+
+#: syntax.c:4715
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Príli¹ málo argumentov: oblas» syntaxe %s"
+
+#: syntax.c:5046
+msgid "E400: No cluster specified"
+msgstr "E400: Nebola zadaná ¾iadna zostava"
+
+#: syntax.c:5083
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Oddeµovaè vzoru %s nenájdený"
+
+#: syntax.c:5158
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Chyba za vzorom %s"
+
+#: syntax.c:5245
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: synchronizácia syntaxe: vzor pokraèovania riadkov zadaný dvakrát"
+
+#: syntax.c:5302
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Chybné argumenty: %s"
+
+#: syntax.c:5352
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Chýba znamienko rovnása: %s"
+
+#: syntax.c:5358
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Prázdny argument: %s"
+
+#: syntax.c:5385
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s tu nie je povolené"
+
+#: syntax.c:5392
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s musí by» prvý v 'contains' zozname"
+
+#: syntax.c:5462
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Neznámy názov skupiny: %s"
+
+#: syntax.c:5692
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Chybný podradený príkaz :syntax : %s "
+
+#: syntax.c:6071
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: skupina zvíraznenia %s nebola nájdená"
+
+#: syntax.c:6095
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Príli¹ málo argumentov: \":highlight link %s\""
+
+#: syntax.c:6102
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: Príli¹ mnoho argumentov: \":highlight link %s\""
+
+#: syntax.c:6122
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: skupina je nastavená, odkaz na zvýrazòovaciu skupinu ignorovaný"
+
+#: syntax.c:6251
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: neoèakávané znamienko rovnása : %s"
+
+#: syntax.c:6287
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: chýba znamienko rovnása: %s"
+
+#: syntax.c:6309
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: chýba argument: %s"
+
+#: syntax.c:6346
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Neprípustná hodnota: %s"
+
+#: syntax.c:6465
+msgid "E419: FG color unknown"
+msgstr "E419: farba popredia nie je známa"
+
+#: syntax.c:6476
+msgid "E420: BG color unknown"
+msgstr "E420: farba pozadia nie je známa"
+
+#: syntax.c:6537
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Názov alebo èíslo farby %s nebolo rozpoznané"
+
+#: syntax.c:6745
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminálový kód %s je príli¹ dlhý"
+
+#: syntax.c:6792
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Neprístupný argument: %s"
+
+#: syntax.c:7321
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: Je pou¾ívané príli¹ velké mno¾stvo odli¹ných zvýrazòovacích vlastností"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "koniec zoznamu tagov"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "zaèiatok zoznamu tagov"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Nedá sa skoèi» pred prvý vyhovujúci tag"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tag %s nenájdený"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "súbor\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Zadajte èíslo (<CR> pre ukonèenie): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Vyhovuje iba jeden tag"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Za posledný vyhovujúci tag sa nedá preskoèi»"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Súbor \"%s\" neexistuje"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tag %d z celkového poètu %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " alebo viac"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " Pou¾ívam tag s písmom inej veµkosti!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Súbor \"%s\" neexistuje"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # CIE¥ tag ©TART riadok v súbore/texte"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "Lineárne hµadanie tagu"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "Binárne hµadanie tagu"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Prehµadávam súbor tagov %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Súbor tagov %s bol orezaný\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Chyba formátu v súbore tagov \"%s\""
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "Pred bajtom %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Obsah súboru tagov %s nie je zoradený"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: ®iadny súbor tagov"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Nedá sa nájs» vzor tagov"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Tag sa nedá nájs», iba hádam!"
+
+#: term.c:1737
+msgid "' not known. Available builtin terminals are:"
+msgstr "' nie je známy. Dostupné vstavané terminály:"
+
+#: term.c:1761
+msgid "defaulting to '"
+msgstr "nastavujem na '"
+
+#: term.c:2114
+msgid "Cannot open termcap file"
+msgstr "Nedá sa otvori» termcap súbor"
+
+#: term.c:2117
+msgid "Terminal entry not found in terminfo"
+msgstr "Terminfo neobsahuje polo¾ku pre tento terminál"
+
+#: term.c:2119
+msgid "Terminal entry not found in termcap"
+msgstr "Termcap neobsahuje polo¾ku pre tento terminál"
+
+#: term.c:2278
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Termcap neobsahuje polo¾ku pre \"%s\""
+
+#: term.c:2752
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: Terminál musí ma» \"cm\" schopnos»"
+
+#. Highlight title
+#: term.c:4891
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Klávesy terminálu ---"
+
+#: ui.c:251
+msgid "new shell started\n"
+msgstr "spustený nový shell\n"
+
+#: ui.c:1747
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Chyba pri èítaní vstupu, konèím...\n"
+
+#. must display the prompt
+#: undo.c:383
+msgid "No undo possible; continue anyway"
+msgstr "Odstránenie zmien nie je mo¾né; chcete napriek tomu pokraèova»"
+
+#: undo.c:538
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: èísla riadkov sú chybné"
+
+#: undo.c:707
+msgid "1 change"
+msgstr "poèet zmien: 1"
+
+#: undo.c:709
+#, c-format
+msgid "%ld changes"
+msgstr "poèet zmien: %ld"
+
+#: undo.c:753
+msgid "E439: undo list corrupt"
+msgstr "E439: záznam o zmenách po¹kodený"
+
+#: undo.c:785
+msgid "E440: undo line missing"
+msgstr "E440: chýba riadok spä»"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:725
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"16/32 bitová GUI verzia pre MS Windows"
+
+#: version.c:727
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"32 bitová GUI verzia pre MS Windows"
+
+#: version.c:730
+msgid " in Win32s mode"
+msgstr " v Win32 re¾ime"
+
+#: version.c:732
+msgid " with OLE support"
+msgstr " s OLE podporou"
+
+#: version.c:735
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"32 bitová verzia pre MS Windows konzolu"
+
+#: version.c:739
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"16 bitová verzia pre MS Windows"
+
+#: version.c:743
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 bitová verzia pre MS-DOS"
+
+#: version.c:745
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 bitová MS-DOS verzia"
+
+#: version.c:751
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) verzia"
+
+#: version.c:753
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X verzia"
+
+#: version.c:756
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS verzia"
+
+#: version.c:761
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS verzia"
+
+#: version.c:771
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Pou¾ité záplaty: "
+
+#: version.c:797 version.c:1132
+msgid "Modified by "
+msgstr "Zmenil "
+
+#: version.c:804
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Prelo¾ená "
+
+#: version.c:807
+msgid "by "
+msgstr " "
+
+#: version.c:819
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Maximálna verzia"
+
+#: version.c:822
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Veµká verzia "
+
+#: version.c:825
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normálna verzia"
+
+#: version.c:828
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Malá verzia "
+
+#: version.c:830
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Minimálna verzia "
+
+#: version.c:836
+msgid "without GUI."
+msgstr "bez grafického rozhrania."
+
+#: version.c:840
+msgid "with GTK-GNOME GUI."
+msgstr "s rozhraním GTK-GNOME."
+
+#: version.c:842
+msgid "with GTK GUI."
+msgstr "s rozhraním GTK."
+
+#: version.c:846
+msgid "with X11-Motif GUI."
+msgstr "s rozhraním X11-Motif."
+
+#: version.c:849
+msgid "with X11-Athena GUI."
+msgstr "s rozhraním X11-Athena."
+
+#: version.c:852
+msgid "with BeOS GUI."
+msgstr "s rozhraním BeOS."
+
+#: version.c:855
+msgid "with Photon GUI."
+msgstr "s rozhraním Photon."
+
+#: version.c:858
+msgid "with GUI."
+msgstr "s grafickým rozhraním."
+
+#: version.c:861
+msgid "with Carbon GUI."
+msgstr "s Carbon grafickým rozhraním."
+
+#: version.c:864
+msgid "with Cocoa GUI."
+msgstr "s Cocoa grafickým rozhraním."
+
+#: version.c:867
+msgid "with (classic) GUI."
+msgstr "s (klasickým) grafickým rozhraním."
+
+#: version.c:878
+msgid " Features included (+) or not (-):\n"
+msgstr " Vlastnosti zahrnuté (+) a nezahrnuté (-):\n"
+
+#: version.c:890
+msgid " system vimrc file: \""
+msgstr " systémový vimrc súbor: \""
+
+#: version.c:895
+msgid " user vimrc file: \""
+msgstr " u¾ívateµský vimrc súbor: \""
+
+#: version.c:900
+msgid " 2nd user vimrc file: \""
+msgstr " druhý u¾ívateµský vimrc súbor: \""
+
+#: version.c:905
+msgid " 3rd user vimrc file: \""
+msgstr " tretí u¾ívateµský vimrc súbor: \""
+
+#: version.c:910
+msgid " user exrc file: \""
+msgstr " u¾ívateµský exrc súbor: \""
+
+#: version.c:915
+msgid " 2nd user exrc file: \""
+msgstr " druhý u¾ívateµský exrc súbor: \""
+
+#: version.c:921
+msgid " system gvimrc file: \""
+msgstr " systémový gvimrc súbor: \""
+
+#: version.c:925
+msgid " user gvimrc file: \""
+msgstr " u¾ívateµský gvimrc súbor: \""
+
+#: version.c:929
+msgid "2nd user gvimrc file: \""
+msgstr "druhý u¾ívateµský gvimrc súbor: \""
+
+#: version.c:934
+msgid "3rd user gvimrc file: \""
+msgstr "tretí u¾ívateµský gvimrc súbor: \""
+
+#: version.c:941
+msgid " system menu file: \""
+msgstr " systémový súbor s ponukou: \""
+
+#: version.c:949
+msgid " fall-back for $VIM: \""
+msgstr " implicitná hodnota $VIM:\""
+
+#: version.c:955
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " f-b pre $VIMRUNTIME: \""
+
+#: version.c:959
+msgid "Compilation: "
+msgstr "Preklad: "
+
+#: version.c:965
+msgid "Compiler: "
+msgstr "Prekladaè: "
+
+#: version.c:970
+msgid "Linking: "
+msgstr "Linkujem: "
+
+#: version.c:975
+msgid " DEBUG BUILD"
+msgstr " PODPORA LADENIA"
+
+#: version.c:1011
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMpreved"
+
+#: version.c:1013
+msgid "version "
+msgstr "verzia "
+
+#: version.c:1014
+msgid "by Bram Moolenaar et al."
+msgstr "Autor: Bram Moolenaar a ïal¹í"
+
+#: version.c:1018
+msgid "Vim is open source and freely distributable"
+msgstr "Vim je voµne ¹íriteµný program"
+
+#: version.c:1020
+msgid "Help poor children in Uganda!"
+msgstr "Pomô¾te chudobným de»om v Ugande!"
+
+#: version.c:1021
+msgid "type :help iccf<Enter> for information "
+msgstr "podrobnej¹ie informácie získate pomocou :help iccf<Enter>"
+
+#: version.c:1023
+msgid "type :q<Enter> to exit "
+msgstr "zadajte :q<Enter> pre ukonèenie programu"
+
+#: version.c:1024
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "zadajte :help<Enter> alebo <F1> pre pomocníka"
+
+#: version.c:1025
+msgid "type :help version6<Enter> for version info"
+msgstr "zadajte :help version6<Enter> pre informácie o verzii"
+
+#: version.c:1028
+msgid "Running in Vi compatible mode"
+msgstr "Be¾ím v re¾ime kompatibility s Vi"
+
+#: version.c:1029
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "zadajte :set nocp<Enter> pre implicitné nastavenie Vim"
+
+#: version.c:1030
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "podrobnej¹ie informácie získate pomocou :help cp-default<Enter>"
+
+#: version.c:1045
+msgid "menu Help->Orphans for information "
+msgstr "bli¾¹ie informácie v menu Pomocník->Samostatné"
+
+#: version.c:1047
+msgid "Running modeless, typed text is inserted"
+msgstr "Spú¹»am modeless, písaný text je vlo¾ený"
+
+#: version.c:1048
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "menu Úpravy->Globálne mo¾nosti->Prepnú» re¾im vlo¾enia "
+
+#: version.c:1049
+msgid " for two modes "
+msgstr " pre dva re¾imy "
+
+#: version.c:1053
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "menu Úpravy->Globálne mo¾nostt->Prepnú» Vi kompatibilný re¾ím"
+
+#: version.c:1054
+msgid " for Vim defaults "
+msgstr " pre predvolené vlastnosti Vim "
+
+#: version.c:1100
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "VAROVANIE: detekované Windows 95/98/ME"
+
+#: version.c:1103
+msgid "type :help windows95<Enter> for info on this"
+msgstr "zadajte :help windows95<Enter> pre podrobnej¹ie informácie"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: Nenájdené ¾iadne okno náhµadu"
+
+#: window.c:580
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Okno sa nedá rozdeli» zároveò topleft a botright"
+
+#: window.c:1339
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Nedá sa rotova», ak je iné okno rozdelené"
+
+#: window.c:1841
+msgid "E444: Cannot close last window"
+msgstr "E444: Posledné okno sa nedá zatvori»"
+
+#: window.c:2505
+msgid "Already only one window"
+msgstr "U¾ existuje iba jedno okno"
+
+#: window.c:2552
+msgid "E445: Other window contains changes"
+msgstr "E445: Iné okno obsahuje zmeny"
+
+#: window.c:4379
+msgid "E446: No file name under cursor"
+msgstr "E446: Pod kurzorom sa nenachádza názov súboru"
+
+#: window.c:4498
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Súbor \"%s\" sa nedá v cdpath nájs»"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Upravi» s viacnásobný&m Vimom"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Upravi» s jedným &Vimom"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Upravi» s &Vimom"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Upravi» s existujúcim Vimom - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Upravi» vybrané súbory s Vimom"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Chyba vytváracieho procesu: Skontrolujte, èi je gvim vo va¹ej ceste!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "chyba gvimext.dll"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "Príli¹ dlhá cesta!"
+
+#: globals.h:900
+msgid "--No lines in buffer--"
+msgstr "--Buffer neobsahuje ¾iadny riadok--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1042
+msgid "Command aborted"
+msgstr "Príkaz preru¹ený"
+
+#: globals.h:1043
+msgid "Argument required"
+msgstr "Je vy¾adovaný argument"
+
+#: globals.h:1044
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: po \\ by malo nasledova» /. ? alebo &"
+
+#: globals.h:1046
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr ""
+"E11: Chybný príkaz v okne príkazového riadku; <Enter> spustíte, CTRL-C "
+"vypnete"
+
+#: globals.h:1048
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Príkaz nie je z exrc/vimrc v aktuálnom adresári alebo pri hµadaní tagu "
+"povolený."
+
+#: globals.h:1049
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Súbor existuje (pou¾ite ! pre vynútenie)"
+
+#: globals.h:1050
+msgid "Command failed"
+msgstr "Príkaz zlyhal"
+
+#: globals.h:1051
+msgid "Internal error"
+msgstr "Vnútorná chyba"
+
+#: globals.h:1052
+msgid "Interrupted"
+msgstr "Preru¹ené"
+
+#: globals.h:1053
+msgid "E14: Invalid address"
+msgstr "E14: Chybná adresa"
+
+#: globals.h:1054
+msgid "Invalid argument"
+msgstr "Chybný argument"
+
+#: globals.h:1055
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "Chybný argument: %s"
+
+#: globals.h:1057
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Chybný výraz: %s"
+
+#: globals.h:1059
+msgid "E16: Invalid range"
+msgstr "E16: Chybný rozsah"
+
+#: globals.h:1060
+msgid "Invalid command"
+msgstr "Chybný príkaz"
+
+#: globals.h:1062
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" je adresárom"
+
+#: globals.h:1065
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Neoèekávané znaky pred '='"
+
+#: globals.h:1067
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Znaèka má chybné èíslo riadku"
+
+#: globals.h:1068
+msgid "E20: Mark not set"
+msgstr "E20: Znaèka nie je nastavená"
+
+#: globals.h:1069
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Nedá sa meni», je nastavená voµba 'modifiable'"
+
+#: globals.h:1070
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript vnorený príli¹ hlboko"
+
+#: globals.h:1071
+msgid "E23: No alternate file"
+msgstr "E23: ®iadny alternatívny súbor"
+
+#: globals.h:1072
+msgid "E24: No such abbreviation"
+msgstr "E24: Taká skratka neexistuje"
+
+#: globals.h:1073
+msgid "No ! allowed"
+msgstr "! nie je povolené"
+
+#: globals.h:1075
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: Nedá sa pou¾í» GUI: nebolo zapnuté pri preklade programu"
+
+#: globals.h:1078
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Nedá sa pou¾í» hebrejský re¾im: nebol zapnutý pri preklade programu\n"
+
+#: globals.h:1081
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Nedá sa pou¾í» farsi re¾im: nebol zapnutý pri preklade programu\n"
+
+#: globals.h:1084
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Skupina zvíraznenia %s neexistuje"
+
+#: globals.h:1086
+msgid "E29: No inserted text yet"
+msgstr "E29: Zatiaµ nie je ¾iadny vlo¾ený text"
+
+#: globals.h:1087
+msgid "E30: No previous command line"
+msgstr "E30: ®iadny predchádzajúci príkazový riadok"
+
+#: globals.h:1088
+msgid "E31: No such mapping"
+msgstr "E31: ®iadne také mapovanie"
+
+#: globals.h:1089
+msgid "No match"
+msgstr "®iadna zhoda"
+
+#: globals.h:1090
+#, c-format
+msgid "No match: %s"
+msgstr "®iadna zhoda: %s"
+
+#: globals.h:1091
+msgid "E32: No file name"
+msgstr "E32: ®iadny názov súboru"
+
+#: globals.h:1092
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ®iadny predchádzajúci prislúchajúci správny výraz"
+
+#: globals.h:1093
+msgid "E34: No previous command"
+msgstr "E34: ®iadny predchádzajúci príkaz"
+
+#: globals.h:1094
+msgid "E35: No previous regular expression"
+msgstr "E35: ®iadny predchádzajúci regulárny výraz"
+
+#: globals.h:1095
+msgid "No range allowed"
+msgstr "Rozsah nie je povolený"
+
+#: globals.h:1097
+msgid "E36: Not enough room"
+msgstr "E36: Nedostatok miesta"
+
+#: globals.h:1099
+#, c-format
+msgid "Can't create file %s"
+msgstr "Nedá sa vytvori» súbor %s"
+
+#: globals.h:1100
+msgid "Can't get temp file name"
+msgstr "Nedá sa získa» názov doèasného súboru"
+
+#: globals.h:1101
+#, c-format
+msgid "Can't open file %s"
+msgstr "Nedá sa otvori» súbor %s"
+
+#: globals.h:1102
+#, c-format
+msgid "Can't read file %s"
+msgstr "Nedá sa èíta» súbor %s"
+
+#: globals.h:1103
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: Neulo¾ené zmeny (pou¾ite ! pre vynútenie)"
+
+#: globals.h:1104
+msgid "E38: Null argument"
+msgstr "E38: Nulový argument"
+
+#: globals.h:1106
+msgid "E39: Number expected"
+msgstr "E39: Oèakávané èíslo"
+
+#: globals.h:1109
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Nedá sa otvori» chybový súbor %s"
+
+#: globals.h:1112
+msgid "E41: Out of memory!"
+msgstr "E41: Nedostatok pamäti!"
+
+#: globals.h:1115
+msgid "Pattern not found"
+msgstr "Vzor nenájdený"
+
+#: globals.h:1117
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "Vzor nenájdený: %s"
+
+#: globals.h:1118
+msgid "Argument must be positive"
+msgstr "Argument musí by» kladný"
+
+#: globals.h:1120
+msgid "E42: No Errors"
+msgstr "E42: ®iadne chyby"
+
+#: globals.h:1122
+msgid "E43: Damaged match string"
+msgstr "E43: Po¹kodený re»azac pre vyhµadávanie"
+
+#: globals.h:1123
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Po¹kodený regexp program"
+
+#: globals.h:1124
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: nastavená voµba 'iba_pre_èítanie' (pou¾ite ! pre vynútenie)"
+
+#: globals.h:1126
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Nedá sa nastavi» premenná iba_pre_èítanie \"%s\""
+
+#: globals.h:1129
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Chyba pri èítaní chybového súboru"
+
+#: globals.h:1132
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Nie je v bezpeènostnej schránke povolené"
+
+#: globals.h:1134
+msgid "E49: Invalid scroll size"
+msgstr "E49: Chybná hodnota premennej 'scroll'"
+
+#: globals.h:1135
+msgid "E91: 'shell' option is empty"
+msgstr "E91: voµba 'shell' je prázdna"
+
+#: globals.h:1136
+msgid "E72: Close error on swap file"
+msgstr "E72: Chyba pri uzatváraní odkladacieho súboru"
+
+#: globals.h:1137
+msgid "E73: tag stack empty"
+msgstr "E73: zoznam tagov je prázdny"
+
+#: globals.h:1138
+msgid "E74: Command too complex"
+msgstr "E74: Príkaz je príli¹ zlo¾itý"
+
+#: globals.h:1139
+msgid "E75: Name too long"
+msgstr "E75: Názov je príli¹ dlhý"
+
+#: globals.h:1140
+msgid "E76: Too many ["
+msgstr "E76: Príli¹ mnoho ["
+
+#: globals.h:1141
+msgid "E77: Too many file names"
+msgstr "E77: Príli¹ mnoho názvov súborov"
+
+#: globals.h:1142
+msgid "Trailing characters"
+msgstr "Nadbytoèné znaky na konci"
+
+#: globals.h:1143
+msgid "E78: Unknown mark"
+msgstr "E78: Neznáma znaèka"
+
+#: globals.h:1144
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Nedá sa expandova» ¾olíkové znaky (wildcards)"
+
+#: globals.h:1145
+msgid "E80: Error while writing"
+msgstr "E80: Chyba pri ukladaní"
+
+#: globals.h:1146
+msgid "Zero count"
+msgstr "Nulový poèet"
+
+#: globals.h:1148
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Pou¾itie <SID> mimo kontext skriptu"
+
+#: globals.h:1151
+msgid "E449: Invalid expression received"
+msgstr "E449: Bol prijatý chybný výraz"
+
diff --git a/src/po/sv.po b/src/po/sv.po
new file mode 100644
index 000000000..4f84b2173
--- /dev/null
+++ b/src/po/sv.po
@@ -0,0 +1,6516 @@
+# Swedish translation for Vim.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Johan Svedberg <johan@svedberg.pp.se>, 2003.
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim 6.2\n"
+"POT-Creation-Date: 2004-01-30 11:57+0100\n"
+"PO-Revision-Date: 2004-04-24 21:54+0200\n"
+"Last-Translator: Johan Svedberg <johan@svedberg.pp.se>\n"
+"Language-Team: Swedish <sv@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: Kan inte allokera någon buffert, avslutar..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: Kan inte allokera buffert, använder en annan..."
+
+#: buffer.c:797
+msgid "E515: No buffers were unloaded"
+msgstr "E515: Inga buffertar blev urladdade"
+
+#: buffer.c:799
+msgid "E516: No buffers were deleted"
+msgstr "E516: Inga buffertar blev borttagna"
+
+#: buffer.c:801
+msgid "E517: No buffers were wiped out"
+msgstr "E517: Inga buffertar blev utraderade"
+
+#: buffer.c:809
+msgid "1 buffer unloaded"
+msgstr "1 buffert laddades ur"
+
+#: buffer.c:811
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "%d buffertar laddades ur"
+
+#: buffer.c:816
+msgid "1 buffer deleted"
+msgstr "1 buffert borttagen"
+
+#: buffer.c:818
+#, c-format
+msgid "%d buffers deleted"
+msgstr "%d buffertar borttagna"
+
+#: buffer.c:823
+msgid "1 buffer wiped out"
+msgstr "1 buffert utraderad"
+
+#: buffer.c:825
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "%d buffertar utraderade"
+
+#: buffer.c:886
+msgid "E84: No modified buffer found"
+msgstr "E84: Ingen modifierad buffert hittad"
+
+#. back where we started, didn't find anything.
+#: buffer.c:925
+msgid "E85: There is no listed buffer"
+msgstr "E85: Det finns inga listade buffertar"
+
+#: buffer.c:937
+msgid "E86: Buffer %ld does not exist"
+msgstr "E86: Buffert %ld existerar inte"
+
+#: buffer.c:940
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: Kan inte gå bortom sista buffert"
+
+#: buffer.c:942
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: Kan inte gå före första buffert"
+
+#: buffer.c:980
+#, c-format
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr ""
+"E89: Ingen skrivning sedan senaste ändring för buffert %ld (lägg till ! för "
+"att tvinga)"
+
+#: buffer.c:997
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Kan inte ladda ur senaste buffert"
+
+#: buffer.c:1530
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: Varning: Lista över filnamn flödar över"
+
+#: buffer.c:1701
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: Buffer %ld hittades inte"
+
+#: buffer.c:1932
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: Fler än en träff för %s"
+
+#: buffer.c:1934
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: Ingen matchande buffert för %s"
+
+#: buffer.c:2329 ex_docmd.c:6691
+#, c-format
+msgid "line %ld"
+msgstr "rad %ld"
+
+#: buffer.c:2412
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: Buffer med det här namnet existerar redan"
+
+#: buffer.c:2705
+msgid " [Modified]"
+msgstr " [Modifierad]"
+
+#: buffer.c:2710
+msgid "[Not edited]"
+msgstr "[Inte redigerad]"
+
+#: buffer.c:2715
+msgid "[New file]"
+msgstr "[Ny fil]"
+
+#: buffer.c:2716
+msgid "[Read errors]"
+msgstr "[Läsfel]"
+
+#: buffer.c:2718 fileio.c:1939
+msgid "[readonly]"
+msgstr "[skrivskyddad]"
+
+#: buffer.c:2739
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "1 rad --%d%%--"
+
+#: buffer.c:2741
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "%ld rader --%d%%--"
+
+#: buffer.c:2748
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "rad %ld av %ld --%d%%-- kol "
+
+#: buffer.c:2849
+msgid "[No file]"
+msgstr "[Ingen fil]"
+
+#. must be a help buffer
+#: buffer.c:2889
+msgid "help"
+msgstr "hjälp"
+
+#: buffer.c:3448 screen.c:4996
+msgid "[help]"
+msgstr "[hjälp]"
+
+#: buffer.c:3480 screen.c:5002
+msgid "[Preview]"
+msgstr "[Förhandsvisning]"
+
+#: buffer.c:3760
+msgid "All"
+msgstr "Alla"
+
+#: buffer.c:3760
+msgid "Bot"
+msgstr "Bott"
+
+#: buffer.c:3762
+msgid "Top"
+msgstr "Topp"
+
+#: buffer.c:4508
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# Buffertlista:\n"
+
+#: buffer.c:4541
+msgid "[Error List]"
+msgstr "[Fellista]"
+
+#: buffer.c:4554 memline.c:1513
+msgid "[No File]"
+msgstr "[Ingen fil]"
+
+#: buffer.c:4857
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- Tecken ---"
+
+#: buffer.c:4876
+#, c-format
+msgid "Signs for %s:"
+msgstr "Tecken för %s:"
+
+#: buffer.c:4882
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " line=%ld id=%d namn%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: Kan inte skilja fler än %ld buffertar"
+
+#: diff.c:651
+msgid "E97: Cannot create diffs"
+msgstr "E97: Kan inte skapa skiljare"
+
+#: diff.c:750
+msgid "Patch file"
+msgstr "Patchfil"
+
+#: diff.c:1001
+msgid "E98: Cannot read diff output"
+msgstr "E98: Kan inte läsa skiljeutdata"
+
+#: diff.c:1742
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Aktuell buffert är inte i skiljeläge"
+
+#: diff.c:1754
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: Ingen annan buffert i skiljeläge"
+
+#: diff.c:1762
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: Fler än två buffertar i skiljeläge, vet inte vilken som ska användas"
+
+#: diff.c:1785
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: Kan inte hitta buffert \"%s\""
+
+#: diff.c:1791
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: Buffert \"%s\" är inte i skiljeläge"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: Escape inte tillåtet i digraf"
+
+#: digraph.c:2344
+msgid "E544: Keymap file not found"
+msgstr "E544: Keymap-fil hittades inte"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: Användning av :loadkeymap utanför en körd fil"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " Nyckelordskomplettering (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X-läge (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " Lokal nyckelordskomplettering (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " Helradskomplettering (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " Filnamnskomplettering (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " Taggkomplettering (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " Sökvägsmönsterkomplettering (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " Definitionskomplettering (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " Ordbokskomplettering (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Tesaurkomplettering (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " Kommandoradskomplettering (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Stötte på slutet på stycket"
+
+#: edit.c:953
+msgid "'thesaurus' option is empty"
+msgstr "'thesaurus'-flagga är tom"
+
+#: edit.c:1157
+msgid "'dictionary' option is empty"
+msgstr "'dictionary'-flagga är tom"
+
+#: edit.c:2154
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "Söker igenom ordbok: %s"
+
+#: edit.c:2360
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (infoga) Rulla (^E/^Y)"
+
+#: edit.c:2362
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (ersätt) Rulla (^E/^Y)"
+
+#: edit.c:2676
+#, c-format
+msgid "Scanning: %s"
+msgstr "Söker igenom: %s"
+
+#: edit.c:2711
+msgid "Scanning tags."
+msgstr "Söker igenom taggar."
+
+#: edit.c:3373
+msgid " Adding"
+msgstr " Lägger till"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3422
+msgid "-- Searching..."
+msgstr "-- Söker..."
+
+#: edit.c:3478
+msgid "Back at original"
+msgstr "Tillbaka på orginalet"
+
+#: edit.c:3483
+msgid "Word from other line"
+msgstr "Ord från annan rad"
+
+#: edit.c:3488
+msgid "The only match"
+msgstr "Den enda träffen"
+
+#: edit.c:3547
+#, c-format
+msgid "match %d of %d"
+msgstr "träff %d av %d"
+
+#: edit.c:3550
+#, c-format
+msgid "match %d"
+msgstr "träff %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:1011
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: Okänd variabel: \"%s\""
+
+#: eval.c:1307
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: Saknar hakparantes: %s"
+
+#: eval.c:1412 eval.c:1426
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Ingen sådan variabel: \"%s\""
+
+#: eval.c:1682
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: Saknar ':' efter '?'"
+
+#: eval.c:2298
+msgid "E110: Missing ')'"
+msgstr "E110: Saknar ')'"
+
+#: eval.c:2355
+msgid "E111: Missing ']'"
+msgstr "E111: Saknar ']'"
+
+#: eval.c:2431
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: Flaggnamn saknas: %s"
+
+#: eval.c:2449
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: Okänd flagga: %s"
+
+#: eval.c:2520
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: Saknar citattecken: %s"
+
+#: eval.c:2663
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: Saknar citattecken: %s"
+
+#: eval.c:3018
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: Ogiltiga argument för funktion %s"
+
+#: eval.c:3048
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: Okänd funktion: %s"
+
+#: eval.c:3049
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: För många argument till funktion: %s"
+
+#: eval.c:3050
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: Inte tillräckligt med argument till funktion: %s"
+
+#: eval.c:3051
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: Använder <SID> inte i skriptsammanhang: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3641 gui.c:4260 gui_gtk.c:2001
+msgid "&Ok"
+msgstr "&Ok"
+
+#: eval.c:4180
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld rader: "
+
+#: eval.c:5406
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&OK\n"
+"&Avbryt"
+
+#: eval.c:5446
+msgid "called inputrestore() more often than inputsave()"
+msgstr "anropade inputrestore() oftare än inputsave()"
+
+#: eval.c:5904
+msgid "E655: Too much symbolic links (cycle?)"
+msgstr "E655: För många symboliska länkar (slinga?)"
+
+#: eval.c:6523
+msgid "E240: No connection to Vim server"
+msgstr "E240: Ingen anslutning till Vim-server"
+
+#: eval.c:6620
+msgid "E277: Unable to read a server reply"
+msgstr "E277: Kunde inte läsa ett serversvar"
+
+#: eval.c:6648
+msgid "E258: Unable to send to client"
+msgstr "E258: Kunde inte sända till klient"
+
+#: eval.c:6696
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: Kunde inte sända till %s"
+
+#: eval.c:6796
+msgid "(Invalid)"
+msgstr "(Ogiltig)"
+
+#: eval.c:7945
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: Odefinierad variabel: %s"
+
+#: eval.c:8377
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: Otillåtet variabelnamn: %s"
+
+#: eval.c:8665
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: Funktionen %s existerar redan, lägg till ! för att ersätta den"
+
+#: eval.c:8732
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: Odefinierad funktion: %s"
+
+#: eval.c:8745
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: Saknar '(': %s"
+
+#: eval.c:8778
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: Otillåtet argument: %s"
+
+#: eval.c:8857
+msgid "E126: Missing :endfunction"
+msgstr "E126: Saknar :endfunction"
+
+#: eval.c:8940
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: Kan inte omdefiniera funktion %s: Den används"
+
+#: eval.c:9008
+msgid "E129: Function name required"
+msgstr "E129: Funktionsnamn krävs"
+
+#: eval.c:9059
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: Funktionsnamn måste börja med en versal: %s"
+
+#: eval.c:9251
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: Odefinierad funktion: %s"
+
+#: eval.c:9256
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: Kan inte ta bort funktion %s: Den används"
+
+#: eval.c:9304
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: Djupet på funktionsanropet är högre än 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:9357
+#, c-format
+msgid "calling %s"
+msgstr "anropar %s"
+
+#: eval.c:9419
+#, c-format
+msgid "%s aborted"
+msgstr "%s avbröts"
+
+#: eval.c:9421
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s returnerar #%ld"
+
+#: eval.c:9428
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s returnerar \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:9444 ex_cmds2.c:2292
+#, c-format
+msgid "continuing in %s"
+msgstr "fortsätter i %s"
+
+#: eval.c:9470
+msgid "E133: :return not inside a function"
+msgstr "E133: :return inte inom en funktion"
+
+#: eval.c:9801
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# globala variabler:\n"
+
+#: ex_cmds2.c:92
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "Går in i felsökningsläge. Skriv \"cont\" för att fortsätta."
+
+#: ex_cmds2.c:96 ex_docmd.c:906
+#, c-format
+msgid "line %ld: %s"
+msgstr "rad %ld: %s"
+
+#: ex_cmds2.c:98
+#, c-format
+msgid "cmd: %s"
+msgstr "kommando: %s"
+
+#: ex_cmds2.c:290
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "Brytpunkt i \"%s%s\" rad %ld"
+
+#: ex_cmds2.c:540
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: Brytpunkt hittades inte: %s"
+
+#: ex_cmds2.c:566
+msgid "No breakpoints defined"
+msgstr "Inga brytpunkter definierade"
+
+#: ex_cmds2.c:571
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s rad %ld"
+
+#: ex_cmds.c:2097 ex_cmds.c:2362 ex_cmds2.c:763
+msgid "Save As"
+msgstr "Spara som"
+
+#: ex_cmds2.c:786
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "Spara ändringar till \"%.*s\"?"
+
+#: ex_cmds2.c:788 ex_docmd.c:9085
+msgid "Untitled"
+msgstr "Namnlös"
+
+#: ex_cmds2.c:915
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: Ingen skrivning sedan senaste ändring för buffert \"%s\""
+
+#: ex_cmds2.c:984
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "Varning: Gick in i andra buffertar oväntat (kontrollera autokommandon)"
+
+#: ex_cmds2.c:1387
+msgid "E163: There is only one file to edit"
+msgstr "E163: Det finns bara en fil att redigera"
+
+#: ex_cmds2.c:1389
+msgid "E164: Cannot go before first file"
+msgstr "E164: Kan inte gå före första filen"
+
+#: ex_cmds2.c:1391
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: Kan inte gå bortom sista filen"
+
+#: ex_cmds2.c:1842
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "Söker efter \"%s\" i \"%s\""
+
+#: ex_cmds2.c:1864
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "Söker efter \"%s\""
+
+#: ex_cmds2.c:1885
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "hittades inte i 'runtimepath': \"%s\""
+
+#: ex_cmds2.c:1919
+msgid "Source Vim script"
+msgstr "Läs Vim-skript"
+
+#: ex_cmds2.c:2109
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "Kan inte läsa en katalog: \"%s\""
+
+#: ex_cmds2.c:2147
+#, c-format
+msgid "could not source \"%s\""
+msgstr "kunde inte läsa \"%s\""
+
+#: ex_cmds2.c:2149
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "rad %ld: kunde inte läsa \"%s\""
+
+#: ex_cmds2.c:2163
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "läser \"%s\""
+
+#: ex_cmds2.c:2165
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "rad %ld: läser \"%s\""
+
+#: ex_cmds2.c:2290
+#, c-format
+msgid "finished sourcing %s"
+msgstr "läste klart %s"
+
+#: ex_cmds2.c:2634
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: Varning: Fel radavskiljare, ^M kan saknas"
+
+#: ex_cmds2.c:2683
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding används utanför en körd fil"
+
+#: ex_cmds2.c:2716
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish används utanför en körd fil"
+
+#: ex_cmds2.c:3159
+#, c-format
+msgid "Page %d"
+msgstr "Sida %d"
+
+#: ex_cmds2.c:3315
+msgid "No text to be printed"
+msgstr "Ingen text att skriva ut"
+
+#: ex_cmds2.c:3393
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "Skriver ut sida %d (%d%%)"
+
+#: ex_cmds2.c:3405
+#, c-format
+msgid " Copy %d of %d"
+msgstr " Kopia %d av %d"
+
+#: ex_cmds2.c:3463
+#, c-format
+msgid "Printed: %s"
+msgstr "Skrev ut: %s"
+
+#: ex_cmds2.c:3470
+msgid "Printing aborted"
+msgstr "Utskrift avbruten"
+
+#: ex_cmds2.c:3835
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: Fel vid skrivning av utdata till PostScript-fil"
+
+#: ex_cmds2.c:4110
+#, c-format
+msgid "E624: Can't open file \"%s\""
+msgstr "E624: Kan inte öppna fil \"%s\""
+
+#: ex_cmds2.c:4120 ex_cmds2.c:4745
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: Kan inte läsa PostScript-resursfil \"%s\""
+
+#: ex_cmds2.c:4128
+#, c-format
+msgid "E618: file \"%s\" is not a PostScript resource file"
+msgstr "E618: fil \"%s\" är inte en PostScript-resursfil"
+
+#: ex_cmds2.c:4143 ex_cmds2.c:4163 ex_cmds2.c:4178 ex_cmds2.c:4200
+#, c-format
+msgid "E619: file \"%s\" is not a supported PostScript resource file"
+msgstr "E619: fil \"%s\" är inte en PostScript-resursfil som stöds"
+
+#: ex_cmds2.c:4230
+#, c-format
+msgid "E621: \"%s\" resource file has wrong version"
+msgstr "E621: \"%s\"-källfilen har fel version"
+
+#: ex_cmds2.c:4697
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: Kan inte öppna PostScript-utfil"
+
+#: ex_cmds2.c:4730
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: Kan inte öppna fil \"%s\""
+
+#: ex_cmds2.c:4849
+msgid "E456: Can't find PostScript resource file \"prolog.ps\""
+msgstr "E456: Kan inte hitta PostScript-källfilen \"prolog.ps\""
+
+#: ex_cmds2.c:4880
+#, c-format
+msgid "E456: Can't find PostScript resource file \"%s.ps\""
+msgstr "E456: Kan inte hitta PostScript-källfilen \"%s.ps\""
+
+#: ex_cmds2.c:4898
+#, c-format
+msgid "E620: Unable to convert from multi-byte to \"%s\" encoding"
+msgstr "E620: Kunde inte konvertera från multi-byte till \"%s\" encoding"
+
+#: ex_cmds2.c:5023
+msgid "Sending to printer..."
+msgstr "Skickar till skrivare..."
+
+#: ex_cmds2.c:5027
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: Misslyckades med att skriva ut PostScript-fil"
+
+#: ex_cmds2.c:5029
+msgid "Print job sent."
+msgstr "Skrivarjobb skickat."
+
+#: ex_cmds2.c:5438
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Aktuellt %sspråk: \"%s\""
+
+#: ex_cmds2.c:5449
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: Kan inte sätta språk till \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Hex %02x, Oktalt %03o"
+
+#: ex_cmds.c:118
+msgid "> %d, Hex %04x, Octal %o"
+msgstr "> %d, Hex %04x, Oktalt %o"
+
+#: ex_cmds.c:119
+msgid "> %d, Hex %08x, Octal %o"
+msgstr "> %d, Hex %08x, Oktalt %o"
+
+#: ex_cmds.c:430
+msgid "E134: Move lines into themselves"
+msgstr "E134: Flytta rader in i dem själva"
+
+#: ex_cmds.c:499
+msgid "1 line moved"
+msgstr "1 rad flyttad"
+
+#: ex_cmds.c:501
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld rader flyttade"
+
+#: ex_cmds.c:924
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld rader filtrerade"
+
+#: ex_cmds.c:952
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter*-Autokommandon får inte ändra aktuell buffert"
+
+#: ex_cmds.c:1037
+msgid "[No write since last change]\n"
+msgstr "[Ingen skrivning sedan senaste ändring]\n"
+
+#: ex_cmds.c:1283
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s på rad: "
+
+#: ex_cmds.c:1288
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: För många fel, hoppar över resten av filen"
+
+#: ex_cmds.c:1323
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Läser viminfo-fil \"%s\"%s%s%s"
+
+#: ex_cmds.c:1324
+msgid " info"
+msgstr " info"
+
+#: ex_cmds.c:1325
+msgid " marks"
+msgstr " märken"
+
+#: ex_cmds.c:1326
+msgid " FAILED"
+msgstr " MISSLYCKADES"
+
+#: ex_cmds.c:1418
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo-fil är inte skrivbar: %s"
+
+#: ex_cmds.c:1543
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: Kan inte skriva viminfo-fil %s!"
+
+#: ex_cmds.c:1551
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "Skriver viminfo-fil \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1649
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# Den här viminfo-filen genererades av Vim %s.\n"
+
+#: ex_cmds.c:1651
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Du får redigera den om du är försiktig!\n"
+"\n"
+
+#: ex_cmds.c:1653
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# Värde av 'encoding' när den här filen blev skriven\n"
+
+#: ex_cmds.c:1752
+msgid "Illegal starting char"
+msgstr "Otillåtet starttecken"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2140
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: Filen är inläst i en annan buffert"
+
+#: ex_cmds.c:2174
+msgid "Write partial file?"
+msgstr "Skriv ofullständig fil?"
+
+#: ex_cmds.c:2181
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: Använd ! för att skriva ofullständig buffert"
+
+#: ex_cmds.c:2296
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Skriv över befintlig fil \"%.*s\"?"
+
+#: ex_cmds.c:2367
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: Inget filnamn för buffert %ld"
+
+#: ex_cmds.c:2405
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: Filen skrevs inte: Skrivning är inaktiverat med 'write'-flaggan"
+
+#: ex_cmds.c:2425
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"'readonly' flaggan är satt för \"%.*s\".\n"
+"Önskar du att skriva ändå?"
+
+#: ex_cmds.c:2597
+msgid "Edit File"
+msgstr "Redigera fil"
+
+#: ex_cmds.c:3170
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autokommandon tog oväntat bort ny buffert %s"
+
+#: ex_cmds.c:3302
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ickenumeriskt argument till :z"
+
+#: ex_cmds.c:3387
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: Skalkommandon inte tillåtna i rvim"
+
+#: ex_cmds.c:3494
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Reguljära uttryck kan inte vara åtskilda av bokstäver"
+
+#: ex_cmds.c:3840
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "ersätt med %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4216
+msgid "(Interrupted) "
+msgstr "(Avbruten) "
+
+#: ex_cmds.c:4220
+msgid "1 substitution"
+msgstr "1 ersättning"
+
+#: ex_cmds.c:4222
+#, c-format
+msgid "%ld substitutions"
+msgstr "%ld ersättningar"
+
+#: ex_cmds.c:4225
+msgid " on 1 line"
+msgstr " på 1 rad"
+
+#: ex_cmds.c:4227
+#, c-format
+msgid " on %ld lines"
+msgstr " på %ld rader"
+
+#: ex_cmds.c:4278
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: Kan inte göra :global rekursivt"
+
+#: ex_cmds.c:4313
+msgid "E148: Regular expression missing from global"
+msgstr "E148: Reguljärt uttryck saknas från global"
+
+#: ex_cmds.c:4362
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "Mönster funnet i varje rad: %s"
+
+#: ex_cmds.c:4443
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Senaste ersättningssträng:\n"
+"$"
+
+#: ex_cmds.c:4556
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: Tyvärr, ingen hjälp för %s"
+
+#: ex_cmds.c:4590
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "Tyvärr, hjälpfil \"%s\" hittades inte"
+
+#: ex_cmds.c:5067
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: Inte en katalog: %s"
+
+#: ex_cmds.c:5095
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: Kan inte öppna %s för skrivning"
+
+#: ex_cmds.c:5130
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: Kunde inte öppna %s för läsning"
+
+#: ex_cmds.c:5209
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: Duplicerad tagg \"%s\" i fil %s"
+
+#: ex_cmds.c:5316
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: Okänt signaturkommando: %s"
+
+#: ex_cmds.c:5336
+msgid "E156: Missing sign name"
+msgstr "E156: Saknar signaturnamn"
+
+#: ex_cmds.c:5382
+msgid "E612: Too many signs defined"
+msgstr "E612: För många signaturer definierade"
+
+#: ex_cmds.c:5449
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: Ogiltig signaturtext: %s"
+
+#: ex_cmds.c:5480 ex_cmds.c:5666
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: Okänd signatur: %s"
+
+#: ex_cmds.c:5526
+msgid "E159: Missing sign number"
+msgstr "E159: Saknar signaturnummer"
+
+#: ex_cmds.c:5606
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: Ogiltigt buffertnamn: %s"
+
+#: ex_cmds.c:5645
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Ogiltigt signatur-ID: %ld"
+
+#: ex_cmds.c:5715
+msgid " (NOT FOUND)"
+msgstr " (INTE HITTADE)"
+
+#: ex_cmds.c:5717
+msgid " (not supported)"
+msgstr " (stöds inte)"
+
+#: ex_cmds.c:5816
+msgid "[Deleted]"
+msgstr "[Borttagen]"
+
+#: ex_docmd.c:490
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "Går in i Ex-läge. Skriv \"visual\" för att gå till Normal-läge."
+
+#. must be at EOF
+#: ex_docmd.c:526
+msgid "E501: At end-of-file"
+msgstr "E501: Vid filslut"
+
+#: ex_docmd.c:632
+msgid "E169: Command too recursive"
+msgstr "E169: Kommando för rekursivt"
+
+#: ex_docmd.c:1155
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: Undantag inte fångat: %s"
+
+#: ex_docmd.c:1241
+msgid "End of sourced file"
+msgstr "Slut på läst fil"
+
+#: ex_docmd.c:1242
+msgid "End of function"
+msgstr "Slut på funktion"
+
+#: ex_docmd.c:1706
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: Otydlig användning av användardefinierat kommando"
+
+#: ex_docmd.c:1720
+msgid "E492: Not an editor command"
+msgstr "E492: Inte ett redigerarkommando"
+
+#: ex_docmd.c:1810
+msgid "E478: Don't panic!"
+msgstr "E478: Få inte panik!"
+
+#: ex_docmd.c:1829
+msgid "E493: Backwards range given"
+msgstr "E493: Bakåtområde givet"
+
+#: ex_docmd.c:1838
+msgid "Backwards range given, OK to swap"
+msgstr "Bakåtområde givet, OK att växla"
+
+#: ex_docmd.c:1961
+msgid "E494: Use w or w>>"
+msgstr "E494: Använd w eller w>>"
+
+#: ex_docmd.c:3570
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: Tyvärr, kommandot är inte tillgängligt i den här versionen"
+
+#: ex_docmd.c:3756
+msgid "E172: Only one file name allowed"
+msgstr "E172: Bara ett filnamn tillåtet"
+
+#: ex_docmd.c:4320
+msgid "1 more file to edit. Quit anyway?"
+msgstr "1 fil till att redigera. Avsluta ändå?"
+
+#: ex_docmd.c:4323
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "%d filer till att redigera. Avsluta ändå?"
+
+#: ex_docmd.c:4330
+msgid "E173: 1 more file to edit"
+msgstr "E173: 1 fil till att redigera"
+
+#: ex_docmd.c:4332
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: %ld filer till att redigera"
+
+#: ex_docmd.c:4427
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: Kommando existerar redan: lägg till ! för att ersätta det"
+
+#: ex_docmd.c:4537
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Namn Arg Område Färdigt Definition"
+
+#: ex_docmd.c:4626
+msgid "No user-defined commands found"
+msgstr "Inga användardefinierade kommandon hittade"
+
+#: ex_docmd.c:4658
+msgid "E175: No attribute specified"
+msgstr "E175: Inga attribut angivna"
+
+#: ex_docmd.c:4710
+msgid "E176: Invalid number of arguments"
+msgstr "E176: Ogiltigt antal argument"
+
+#: ex_docmd.c:4725
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: Antal kan inte anges två gånger"
+
+#: ex_docmd.c:4735
+msgid "E178: Invalid default value for count"
+msgstr "E178: Ogiltigt standardvärde för antal"
+
+#: ex_docmd.c:4766
+msgid "E179: argument required for complete"
+msgstr "E179: argument krävs för komplettering"
+
+#: ex_docmd.c:4798
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: Ogiltigt kompletteringsvärde: %s"
+
+#: ex_docmd.c:4803
+msgid "E467: Custom completion requires a function argument"
+msgstr "E467: Specialkomplettering kräver ett funktionsargument"
+
+#: ex_docmd.c:4808
+msgid "E468: Completion argument only allowed for custom completion"
+msgstr "E468: Kompletteringsargument bara tillåtet för specialkomplettering"
+
+#: ex_docmd.c:4818
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: Ogiltigt attribut: %s"
+
+#: ex_docmd.c:4861
+msgid "E182: Invalid command name"
+msgstr "E182: Ogiltigt kommandonamn"
+
+#: ex_docmd.c:4876
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Användardefinierade kommandon måste börja med en stor bokstav"
+
+#: ex_docmd.c:4946
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: Inget sådant användardefinierat kommando: %s"
+
+#: ex_docmd.c:5405
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: Kan inte hitta färgschema %s"
+
+#: ex_docmd.c:5413
+msgid "Greetings, Vim user!"
+msgstr "Välkommen, Vim-användare!"
+
+#: ex_docmd.c:6136
+msgid "Edit File in new window"
+msgstr "Redigera fil i nytt fönster"
+
+#: ex_docmd.c:6431
+msgid "No swap file"
+msgstr "Ingen växlingsfil"
+
+#: ex_docmd.c:6535
+msgid "Append File"
+msgstr "Lägg till fil"
+
+#: ex_docmd.c:6599
+msgid "E186: No previous directory"
+msgstr "E186: Ingen tidigare katalog"
+
+#: ex_docmd.c:6681
+msgid "E187: Unknown"
+msgstr "E187: Okänt"
+
+#: ex_docmd.c:6766
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize kräver två sifferargument"
+
+#: ex_docmd.c:6817
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "Fönsterposition: X %d, Y %d"
+
+#: ex_docmd.c:6822
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr ""
+"E188: Förskaffa fönsterposition inte implementerat för den här plattformen"
+
+#: ex_docmd.c:6832
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos kräver två sifferargument"
+
+#: ex_docmd.c:7111
+msgid "Save Redirection"
+msgstr "Spara omdirigering"
+
+#: ex_docmd.c:7292
+msgid "Save View"
+msgstr "Spara vy"
+
+#: ex_docmd.c:7293
+msgid "Save Session"
+msgstr "Spara session"
+
+#: ex_docmd.c:7295
+msgid "Save Setup"
+msgstr "Spara konfiguration"
+
+#: ex_docmd.c:7446
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" existerar (lägg till ! för att tvinga)"
+
+#: ex_docmd.c:7451
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: Kan inte öppna \"%s\" för skrivning"
+
+#. set mark
+#: ex_docmd.c:7475
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr ""
+"E191: Argument måste vara en bokstav eller framåt-/bakåtvänt citattecken"
+
+#: ex_docmd.c:7517
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: Rekursiv användning av :normal för djup"
+
+#: ex_docmd.c:8033
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: Inget alternativt filnamn att byta ut '#' med"
+
+#: ex_docmd.c:8064
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: inget autokommando-filnamn att ersätta \"<afile>\" med"
+
+#: ex_docmd.c:8072
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: inget autokommando-buffernummer att ersätta \"<abuf>\" med"
+
+#: ex_docmd.c:8083
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: inget autokommando-träffnamn att byta ut \"<amatch>\" med"
+
+#: ex_docmd.c:8093
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: inget :source-filnamn att byta ut \"<sfile>\" med"
+
+#: ex_docmd.c:8134
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: Tomt filnamn för '%' or '#', fungerar bara med \":p:h\""
+
+#: ex_docmd.c:8136
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: Evaluerar till en tom sträng"
+
+#: ex_docmd.c:9067
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: Kan inte öppna viminfo-fil för läsning"
+
+#: ex_docmd.c:9240
+msgid "E196: No digraphs in this version"
+msgstr "E196: Inga digrafer i den här versionen"
+
+#: ex_eval.c:423
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: Kan inte :throw undantag med 'Vim'-prefix"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:509
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "Undantag kastade: %s"
+
+#: ex_eval.c:556
+#, c-format
+msgid "Exception finished: %s"
+msgstr "Undantag färdiga: %s"
+
+#: ex_eval.c:557
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "Undantag förkastade: %s"
+
+#: ex_eval.c:600 ex_eval.c:644
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, rad %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:618
+#, c-format
+msgid "Exception caught: %s"
+msgstr "Undantag fångade: %s"
+
+#: ex_eval.c:693
+#, c-format
+msgid "%s made pending"
+msgstr "%s gjordes avvaktande"
+
+#: ex_eval.c:696
+#, c-format
+msgid "%s resumed"
+msgstr "%s återupptagen"
+
+#: ex_eval.c:700
+#, c-format
+msgid "%s discarded"
+msgstr "%s förkastad"
+
+#: ex_eval.c:726
+msgid "Exception"
+msgstr "Undantag"
+
+#: ex_eval.c:732
+msgid "Error and interrupt"
+msgstr "Fel och avbrytet"
+
+#: ex_eval.c:734 gui.c:4259
+msgid "Error"
+msgstr "Fel"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:736
+msgid "Interrupt"
+msgstr "Avbryt"
+
+#: ex_eval.c:810
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if nästlad för djupt"
+
+#: ex_eval.c:847
+msgid "E580: :endif without :if"
+msgstr "E580: :endif utan :if"
+
+#: ex_eval.c:891
+msgid "E581: :else without :if"
+msgstr "E581: :else utan :if"
+
+#: ex_eval.c:894
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif utan :if"
+
+#: ex_eval.c:901
+msgid "E583: multiple :else"
+msgstr "E583: flera :else"
+
+#: ex_eval.c:904
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif efter :else"
+
+#: ex_eval.c:971
+msgid "E585: :while nesting too deep"
+msgstr "E585: :while nästlad för djupt"
+
+#: ex_eval.c:1027
+msgid "E586: :continue without :while"
+msgstr "E586: :continue utan :while"
+
+#: ex_eval.c:1067
+msgid "E587: :break without :while"
+msgstr "E587: :break utan :while"
+
+#: ex_eval.c:1266
+msgid "E601: :try nesting too deep"
+msgstr "E601: :try nästlad för djupt"
+
+#: ex_eval.c:1346
+msgid "E603: :catch without :try"
+msgstr "E603: :catch utan :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1368
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch efter :finally"
+
+#: ex_eval.c:1501
+msgid "E606: :finally without :try"
+msgstr "E606: :finally utan :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1525
+msgid "E607: multiple :finally"
+msgstr "E607: flera :finally"
+
+#: ex_eval.c:1634
+msgid "E602: :endtry without :try"
+msgstr "E602: :endtry utan :try"
+
+#: ex_eval.c:1966
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction inte inom en funktion"
+
+#: ex_getln.c:3229
+msgid "tagname"
+msgstr "taggnamn"
+
+#: ex_getln.c:3232
+msgid " kind file\n"
+msgstr " snäll fil\n"
+
+#: ex_getln.c:4591
+msgid "'history' option is zero"
+msgstr "'history'-flagga är noll"
+
+#: ex_getln.c:4856
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s Historia (nyaste till äldsta):\n"
+
+#: ex_getln.c:4857
+msgid "Command Line"
+msgstr "Kommandorad"
+
+#: ex_getln.c:4858
+msgid "Search String"
+msgstr "Söksträng"
+
+#: ex_getln.c:4859
+msgid "Expression"
+msgstr "Uttryck"
+
+#: ex_getln.c:4860
+msgid "Input Line"
+msgstr "Inmatningsrad"
+
+#: ex_getln.c:4898
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar bortom kommandolängden"
+
+#: ex_getln.c:5075
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: Aktivt fönster eller buffert borttagen"
+
+#: fileio.c:369
+msgid "Illegal file name"
+msgstr "Otillåtet filnamn"
+
+#: fileio.c:393 fileio.c:518 fileio.c:2730 fileio.c:2771
+msgid "is a directory"
+msgstr "är en katalog"
+
+#: fileio.c:395
+msgid "is not a file"
+msgstr "är inte en fil"
+
+#: fileio.c:540 fileio.c:3892
+msgid "[New File]"
+msgstr "[Ny fil]"
+
+#: fileio.c:573
+msgid "[Permission Denied]"
+msgstr "[Tillåtelse nekas]"
+
+#: fileio.c:677
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre autokommandon gjorde filen oläsbar"
+
+#: fileio.c:679
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *ReadPre autokommandon får inte ändra nuvarande buffert"
+
+#: fileio.c:700
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: Läser från standard in...\n"
+
+#: fileio.c:706
+msgid "Reading from stdin..."
+msgstr "Läser från standard in..."
+
+#. Re-opening the original file failed!
+#: fileio.c:951
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Konvertering gjorde filen oläsbar!"
+
+#: fileio.c:1917
+msgid "[fifo/socket]"
+msgstr "[fifo/uttag]"
+
+#: fileio.c:1924
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1931
+msgid "[socket]"
+msgstr "[uttag]"
+
+#: fileio.c:1939
+msgid "[RO]"
+msgstr "[EL]"
+
+#: fileio.c:1949
+msgid "[CR missing]"
+msgstr "[CR saknas]"
+
+#: fileio.c:1954
+msgid "[NL found]"
+msgstr "[NL hittat]"
+
+#: fileio.c:1959
+msgid "[long lines split]"
+msgstr "[långa rader delade]"
+
+#: fileio.c:1965 fileio.c:3876
+msgid "[NOT converted]"
+msgstr "[INTE konverterad]"
+
+#: fileio.c:1970 fileio.c:3881
+msgid "[converted]"
+msgstr "[konverterad]"
+
+#: fileio.c:1977 fileio.c:3906
+msgid "[crypted]"
+msgstr "[krypterad]"
+
+#: fileio.c:1984
+msgid "[CONVERSION ERROR]"
+msgstr "[KONVERTERINGSFEL]"
+
+#: fileio.c:1990
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[OTILLÅTEN BIT på rad %ld]"
+
+#: fileio.c:1997
+msgid "[READ ERRORS]"
+msgstr "[LÄSFEL]"
+
+#: fileio.c:2213
+msgid "Can't find temp file for conversion"
+msgstr "Kan inte hitta temporär fil för konvertering"
+
+#: fileio.c:2220
+msgid "Conversion with 'charconvert' failed"
+msgstr "Konvertering med 'charconvert' misslyckades"
+
+#: fileio.c:2223
+msgid "can't read output of 'charconvert'"
+msgstr "kan inte läsa utdata av 'charconvert'"
+
+#: fileio.c:2617
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr ""
+"E203: Autokommandon tog bort eller laddade ur buffert som skulle skrivas"
+
+#: fileio.c:2640
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autokommado ändrade antal rader på ett oväntat sätt"
+
+#: fileio.c:2674
+msgid "NetBeans dissallows writes of unmodified buffers"
+msgstr "NetBeans tillåter inte skrivning av omodifierade buffertar"
+
+#: fileio.c:2682
+msgid "Partial writes disallowed for NetBeans buffers"
+msgstr "Delvisa skrivningar tillåts inte i NetBeans-buffertar"
+
+#: fileio.c:2736 fileio.c:2754
+msgid "is not a file or writable device"
+msgstr "är inte en fil eller skrivbar enhet"
+
+#: fileio.c:2806
+msgid "is read-only (add ! to override)"
+msgstr "är skrivskyddad (lägg till ! för att tvinga)"
+
+#: fileio.c:3124
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: Kan inte skriva till säkerhetskopia (lägg till ! för att tvinga)"
+
+#: fileio.c:3136
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: Stängningsfel för säkerhetskopia (lägg till ! för att tvinga)"
+
+#: fileio.c:3138
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr ""
+"E508: Kan inte läsa fil för säkerhetskopia (lägg till ! för att tvinga)"
+
+#: fileio.c:3154
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: Kan inte skapa säkerhetskopia (lägg till ! för att tvinga)"
+
+#: fileio.c:3257
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: Kan inte göra säkerhetskopia (lägg till ! för att tvinga)"
+
+#: fileio.c:3319
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Resursgrenen skulle tappas bort (lägg till ! för att tvinga)"
+
+#: fileio.c:3420
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: Kan inte hitta temporär fil för skrivning"
+
+#: fileio.c:3438
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr ""
+"E213: Kan inte konvertera (lägg till ! för att skriva utan konvertering)"
+
+#: fileio.c:3473
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: Kan inte öppna länkad fil för skrivning"
+
+#: fileio.c:3477
+msgid "E212: Can't open file for writing"
+msgstr "E212: Kan inte öppna fil för skrivning"
+
+#: fileio.c:3727
+msgid "E512: Close failed"
+msgstr "E512: Stängning misslyckades"
+
+#: fileio.c:3798
+msgid "E513: write error, conversion failed"
+msgstr "E513: skrivfel, konvertering misslyckades"
+
+#: fileio.c:3804
+msgid "E514: write error (file system full?)"
+msgstr "E514: skrivfel (filsystem fullt?)"
+
+#: fileio.c:3871
+msgid " CONVERSION ERROR"
+msgstr " KONVERTERINGSFEL"
+
+#: fileio.c:3887
+msgid "[Device]"
+msgstr "[Enhet]"
+
+#: fileio.c:3892
+msgid "[New]"
+msgstr "[Ny]"
+
+#: fileio.c:3914
+msgid " [a]"
+msgstr " [l]"
+
+#: fileio.c:3914
+msgid " appended"
+msgstr " lade till"
+
+#: fileio.c:3916
+msgid " [w]"
+msgstr " [s]"
+
+#: fileio.c:3916
+msgid " written"
+msgstr " skriven"
+
+#: fileio.c:3966
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patchläge: kan inte spara orginalfil"
+
+#: fileio.c:3988
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: patchläge: kan inte skapa tom orginalfil"
+
+#: fileio.c:4003
+msgid "E207: Can't delete backup file"
+msgstr "E207: Kan inte ta bort säkerhetskopia"
+
+#: fileio.c:4067
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"VARNING: Orginalfilen kan vara förlorad eller skadad\n"
+
+#: fileio.c:4069
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "avsluta inte redigeraren innan filen är framgångsrikt skriven"
+
+#: fileio.c:4158
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4158
+msgid "[dos format]"
+msgstr "[dos-format]"
+
+#: fileio.c:4165
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4165
+msgid "[mac format]"
+msgstr "[mac-format]"
+
+#: fileio.c:4172
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4172
+msgid "[unix format]"
+msgstr "[unix-format]"
+
+#: fileio.c:4199
+msgid "1 line, "
+msgstr "1 rad, "
+
+#: fileio.c:4201
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld rader, "
+
+#: fileio.c:4204
+msgid "1 character"
+msgstr "1 tecken"
+
+#: fileio.c:4206
+#, c-format
+msgid "%ld characters"
+msgstr "%ld tecken"
+
+#: fileio.c:4216
+msgid "[noeol]"
+msgstr "[inget radslut]"
+
+#: fileio.c:4216
+msgid "[Incomplete last line]"
+msgstr "[Ofullständig sistarad]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4235
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "VARNING: Filen har ändrats sedan den lästes in!!!"
+
+#: fileio.c:4237
+msgid "Do you really want to write to it"
+msgstr "Vill du verkligen skriva till den"
+
+#: fileio.c:5313
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: Fel vid skrivning till \"%s\""
+
+#: fileio.c:5320
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Fel vid stängning av \"%s\""
+
+#: fileio.c:5323
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Fel vid läsning av \"%s\""
+
+#: fileio.c:5543
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell-autokommandot tog bort buffert"
+
+#: fileio.c:5551
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: Varning: Filen \"%s\" är inte längre tillgänglig"
+
+#: fileio.c:5564
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: Varning: Filen \"%s\" har ändrats och bufferten ändrades i Vim också"
+
+#: fileio.c:5567
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: Varning: Filen \"%s\" har ändrats sedan redigeringen började"
+
+#: fileio.c:5569
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr ""
+"W16: Varning: Rättigheterna på filen \"%s\" har ändrats sedan redigeringen "
+"började"
+
+#: fileio.c:5579
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: Varning: Filen \"%s\" har skapats efter redigeringen började"
+
+#: fileio.c:5596
+msgid "Warning"
+msgstr "Varning"
+
+#: fileio.c:5597
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&OK\n"
+"&Läs in filen"
+
+#: fileio.c:5695
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: Kunde inte förbereda för att läsa om \"%s\""
+
+#: fileio.c:5714
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: Kunde inte läsa om \"%s\""
+
+#: fileio.c:6296
+msgid "--Deleted--"
+msgstr "--Borttagen--"
+
+#. the group doesn't exist
+#: fileio.c:6456
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: Ingen sådan grupp: \"%s\""
+
+#: fileio.c:6582
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: Otillåtet tecken efter *: %s"
+
+#: fileio.c:6594
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: Ingen sådan händelse: %s"
+
+#: fileio.c:6596
+msgid "E216: No such group or event: %s"
+msgstr "E216: Ingen sådan grupp eller händelse: %s"
+
+#. Highlight title
+#: fileio.c:6745
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Autokommandon ---"
+
+#: fileio.c:7016
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: Kan inte köra autokommandon för ALLA händelser"
+
+#: fileio.c:7039
+msgid "No matching autocommands"
+msgstr "Inga matchande autokommandon"
+
+#: fileio.c:7359
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autokommando nästlad för djupt"
+
+#: fileio.c:7627
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Autokommandon för \"%s\""
+
+#: fileio.c:7635
+#, c-format
+msgid "Executing %s"
+msgstr "Kör %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7703
+#, c-format
+msgid "autocommand %s"
+msgstr "autokommando %s"
+
+#: fileio.c:8270
+msgid "E219: Missing {."
+msgstr "E219: Saknar {."
+
+#: fileio.c:8272
+msgid "E220: Missing }."
+msgstr "E220: Saknar }."
+
+#: fold.c:66
+msgid "E490: No fold found"
+msgstr "E490: Inget veck funnet"
+
+#: fold.c:565
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: Kan inte skapa veck med nuvarande 'foldmethod'"
+
+#: fold.c:567
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: Kan inte ta bort veck med nuvarande 'foldmethod'"
+
+#: getchar.c:246
+msgid "E222: Add to read buffer"
+msgstr "E222: Lägg till i läsbuffert"
+
+#: getchar.c:2157
+msgid "E223: recursive mapping"
+msgstr "E223: rekursiv mappning"
+
+#: getchar.c:3023
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: global förkortning existerar redan för %s"
+
+#: getchar.c:3026
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: global mappning existerar redan för %s"
+
+#: getchar.c:3153
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: förkortning existerar redan för %s"
+
+#: getchar.c:3156
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: mappning existerar redan för %s"
+
+#: getchar.c:3220
+msgid "No abbreviation found"
+msgstr "Ingen förkortning hittades"
+
+#: getchar.c:3222
+msgid "No mapping found"
+msgstr "Ingen mappning hittades"
+
+#: getchar.c:4112
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: Otillåtet läge"
+
+#: gui_at_fs.c:300
+msgid "<cannot open> "
+msgstr "<kan inte öppna> "
+
+#: gui_at_fs.c:1136
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: kan inte hämta typsnitt %s"
+
+#: gui_at_fs.c:2781
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: Kan inte återvända till aktuell katalog"
+
+#: gui_at_fs.c:2801
+msgid "Pathname:"
+msgstr "Sökväg:"
+
+#: gui_at_fs.c:2807
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: kan inte hämta aktuell katalog"
+
+#: gui_at_fs.c:2815 gui_motif.c:1623
+msgid "OK"
+msgstr "OK"
+
+#: gui_at_fs.c:2815 gui_gtk.c:2638 gui_motif.c:1618 gui_motif.c:2849
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: gui_athena.c:2047 gui_motif.c:1871
+msgid "Vim dialog"
+msgstr "Vim-dialog"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Rullningslist: Kunde inte hämta geometrin på miniatyrbild."
+
+#: gui_beval.c:101 gui_w32.c:3772
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: Kan inte skapa BalloonEval med både meddelande och återkallning"
+
+#: gui.c:219
+msgid "E229: Cannot start the GUI"
+msgstr "E229: Kan inte starta GUI"
+
+#: gui.c:348
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: Kan inte läsa från \"%s\""
+
+#: gui.c:473
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ogiltig"
+
+#: gui.c:543
+msgid "E599: Value of 'imactivatekey' is invalid"
+msgstr "E599: Värdet av 'imactivatekey' är ogiltigt"
+
+#: gui.c:3945
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: Kan inte allokera färg %s"
+
+#: gui_gtk.c:1567
+msgid "Vim dialog..."
+msgstr "Vim-dialog..."
+
+#: gui_gtk.c:2002 message.c:2886
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nej\n"
+"&Avbryt"
+
+#: gui_gtk.c:2165
+msgid "Input _Methods"
+msgstr "Inmatnings_metoder"
+
+#: gui_gtk.c:2431 gui_motif.c:2768
+msgid "VIM - Search and Replace..."
+msgstr "VIM - Sök och ersätt..."
+
+#: gui_gtk.c:2439 gui_motif.c:2770
+msgid "VIM - Search..."
+msgstr "VIM - Sök..."
+
+#: gui_gtk.c:2471 gui_motif.c:2888
+msgid "Find what:"
+msgstr "Hitta vad:"
+
+#: gui_gtk.c:2491 gui_motif.c:2920
+msgid "Replace with:"
+msgstr "Ersätt med:"
+
+#. whole word only button
+#: gui_gtk.c:2523 gui_motif.c:3036
+msgid "Match whole word only"
+msgstr "Matcha endast hela ord"
+
+#. match case button
+#: gui_gtk.c:2536 gui_motif.c:3048
+msgid "Match case"
+msgstr "Skilj på stora/små bokstäver"
+
+#: gui_gtk.c:2548 gui_motif.c:2990
+msgid "Direction"
+msgstr "Riktning"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2560 gui_motif.c:3002
+msgid "Up"
+msgstr "Upp"
+
+#: gui_gtk.c:2564 gui_motif.c:3010
+msgid "Down"
+msgstr "Ned"
+
+#: gui_gtk.c:2590 gui_gtk.c:2592 gui_motif.c:2792
+msgid "Find Next"
+msgstr "Hitta nästa"
+
+#: gui_gtk.c:2609 gui_gtk.c:2611 gui_motif.c:2809
+msgid "Replace"
+msgstr "Ersätt"
+
+#: gui_gtk.c:2622 gui_gtk.c:2624 gui_motif.c:2822
+msgid "Replace All"
+msgstr "Ersätt alla"
+
+#: gui_gtk_x11.c:2248
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: Tog emot \"die\"-begäran från sessionshanteraren\n"
+
+#: gui_gtk_x11.c:3437
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: Huvudfönster oväntat förstört\n"
+
+#: gui_gtk_x11.c:4051
+msgid "Font Selection"
+msgstr "Typsnittsval"
+
+#: gui_gtk_x11.c:5907 ui.c:2016
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "Använd CUT_BUFFER0 istället för tomt val"
+
+#: gui_motif.c:1617 gui_motif.c:1620
+msgid "Filter"
+msgstr "Filter"
+
+#: gui_motif.c:1619
+msgid "Directories"
+msgstr "Kataloger"
+
+#: gui_motif.c:1621
+msgid "Help"
+msgstr "Hjälp"
+
+#: gui_motif.c:1622
+msgid "Files"
+msgstr "Filer"
+
+#: gui_motif.c:1624
+msgid "Selection"
+msgstr "Val"
+
+#: gui_motif.c:2835
+msgid "Undo"
+msgstr "Ångra"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: Kan inte läsa in Zap-typsnitt '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: Kan inte använda typsnitt %s"
+
+#: gui_riscos.c:3270
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"Skickar meddelande för att avsluta barnprocess.\n"
+
+#: gui_w32.c:803
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: Argument stöds inte: \"-%s\"; Används OLE-versionen."
+
+#: gui_w48.c:2079
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "Sök sträng (använd '\\\\' för att hitta '\\')"
+
+#: gui_w48.c:2104
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "Sök & ersätt (använd '\\\\' för att hitta '\\')"
+
+#: gui_x11.c:1523
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: Kan inte allokera post i färgkarta, några färger kan bli felaktiga"
+
+#: gui_x11.c:2104
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr ""
+"E250: Typsnitt för följande teckenkoder saknas i typsnittsuppsättningen %s:"
+
+#: gui_x11.c:2147
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: Typsnittsuppsättningsnamn: %s"
+
+#: gui_x11.c:2148
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "Font '%s' är inte fast bredd"
+
+#: gui_x11.c:2167
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: Typsnittsuppsättningsnamn: %s\n"
+
+#: gui_x11.c:2168
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Typsnitt0: %s\n"
+
+#: gui_x11.c:2169
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Typsnitt1: %s\n"
+
+#: gui_x11.c:2170
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "Typsnitt%d är inte dubbelt så bred som font0\n"
+
+#: gui_x11.c:2171
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "Typsnitt0 bredd: %ld\n"
+
+#: gui_x11.c:2172
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"Typsnitt1 bredd: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata FEL"
+
+#: if_cscope.c:77
+msgid "Add a new database"
+msgstr "Lägg till en ny databas"
+
+#: if_cscope.c:79
+msgid "Query for a pattern"
+msgstr "Fråga efter ett mönster"
+
+#: if_cscope.c:81
+msgid "Show this message"
+msgstr "Visa detta meddelande"
+
+#: if_cscope.c:83
+msgid "Kill a connection"
+msgstr "Döda en anslutning"
+
+#: if_cscope.c:85
+msgid "Reinit all connections"
+msgstr "Ominitiera alla anslutningar"
+
+#: if_cscope.c:87
+msgid "Show connections"
+msgstr "Visa anslutningar"
+
+#: if_cscope.c:95
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: Användning: cs[cope] %s"
+
+#: if_cscope.c:124
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Det här scope-kommandot stöder inte delning av fönstret.\n"
+
+#: if_cscope.c:170
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: Användning: cstag <identifierare>"
+
+#: if_cscope.c:226
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: tagg hittades inte"
+
+#: if_cscope.c:404
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s)-fel: %d"
+
+#: if_cscope.c:414
+msgid "E563: stat error"
+msgstr "E563: stat-fel"
+
+#: if_cscope.c:511
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s är inte en katalog eller en godkänd cscope-databas"
+
+#: if_cscope.c:529
+#, c-format
+msgid "Added cscope database %s"
+msgstr "Lade till cscope-databas %s"
+
+#: if_cscope.c:584
+#, c-format
+msgid "E262: error reading cscope connection %ld"
+msgstr "E262: fel vid läsning av cscope-anslutning %ld"
+
+#: if_cscope.c:689
+msgid "E561: unknown cscope search type"
+msgstr "E561: okänd cscope-söktyp"
+
+#: if_cscope.c:731
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: Kunde inte skapa cscope-rör"
+
+#: if_cscope.c:748
+msgid "E622: Could not fork for cscope"
+msgstr "E622: Kunde inte grena för cscope"
+
+#: if_cscope.c:842 if_cscope.c:892
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection-exekvering misslyckades"
+
+#: if_cscope.c:893
+msgid "E623: Could not spawn cscope process"
+msgstr "E623: Kunde inte starta cscope-process"
+
+#: if_cscope.c:906
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen för to_fp misslyckades"
+
+#: if_cscope.c:908
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen för fr_fp misslyckades"
+
+#: if_cscope.c:946
+msgid "E567: no cscope connections"
+msgstr "E567: inga cscope-anslutningar"
+
+#: if_cscope.c:1020
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: inga träffar funna för cscope-förfrågan %s av %s"
+
+#: if_cscope.c:1077
+#, c-format
+msgid "E469: invalid cscopequickfix flag %c for %c"
+msgstr "E469: ogiltig cscopequickfix flagga %c för %c"
+
+#: if_cscope.c:1146
+msgid "cscope commands:\n"
+msgstr "cscope-kommandon:\n"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)"
+msgstr "%-5s: %-30s (Användning: %s)"
+
+#: if_cscope.c:1247
+#, c-format
+msgid "E625: cannot open cscope database: %s"
+msgstr "E625: kan inte öppna cscope-databas: %s"
+
+#: if_cscope.c:1265
+msgid "E626: cannot get cscope database information"
+msgstr "E626: kan inte hämta cscope-databasinformation"
+
+#: if_cscope.c:1290
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: dubblerad cscope-databas inte lagd till"
+
+#: if_cscope.c:1301
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: maximalt antal av cscope-anslutningar nått"
+
+#: if_cscope.c:1417
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: cscope-anslutning %s hittades inte"
+
+#: if_cscope.c:1451
+#, c-format
+msgid "cscope connection %s closed"
+msgstr "cscope-anslutning %s stängd"
+
+#. should not reach here
+#: if_cscope.c:1591
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: ödesdigert fel i cs_manage_matches"
+
+#: if_cscope.c:1841
+#, c-format
+msgid "Cscope tag: %s"
+msgstr "Cscope-tagg: %s"
+
+#: if_cscope.c:1863
+msgid ""
+"\n"
+" # line"
+msgstr ""
+"\n"
+" # rad"
+
+#: if_cscope.c:1865
+msgid "filename / context / line\n"
+msgstr "filnamn / sammanhang / rad\n"
+
+#: if_cscope.c:1977
+#, c-format
+msgid "E609: Cscope error: %s"
+msgstr "E609: Cscope-fel: %s"
+
+#: if_cscope.c:2143
+msgid "All cscope databases reset"
+msgstr "Alla cscope-databaser återställda"
+
+#: if_cscope.c:2211
+msgid "no cscope connections\n"
+msgstr "inga cscope-anslutningar\n"
+
+#: if_cscope.c:2215
+msgid " # pid database name prepend path\n"
+msgstr " # pid databasnamn först i sökväg\n"
+
+#: if_python.c:413
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: Tyvärr, detta kommandot är inaktiverat, Python-biblioteket kunde inte "
+"läsas in."
+
+#: if_python.c:615
+msgid "can't delete OutputObject attributes"
+msgstr "kan inte ta bort OutputObject-attribut"
+
+#: if_python.c:622
+msgid "softspace must be an integer"
+msgstr "softspace måste vara ett heltal"
+
+#: if_python.c:630
+msgid "invalid attribute"
+msgstr "ogiltigt attribut"
+
+#: if_python.c:669 if_python.c:683
+msgid "writelines() requires list of strings"
+msgstr "writelines() kräver lista av strängar"
+
+#: if_python.c:809
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: Fel vid initiering av I/O-objekt"
+
+#: if_python.c:994 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "ogiltigt uttryck"
+
+#: if_python.c:1008 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "uttryck inaktiverat vid kompilering"
+
+#: if_python.c:1021
+msgid "attempt to refer to deleted buffer"
+msgstr "försök att referera till borttagen buffert"
+
+#: if_python.c:1036 if_python.c:1077 if_python.c:1141 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "radnummer utanför område"
+
+#: if_python.c:1276
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffertobjekt (borttaget) vid %8lX>"
+
+#: if_python.c:1367 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "ogiltigt märknamn"
+
+#: if_python.c:1647
+msgid "no such buffer"
+msgstr "ingen sådan buffert"
+
+#: if_python.c:1735
+msgid "attempt to refer to deleted window"
+msgstr "försök att referera till borttaget fönster"
+
+#: if_python.c:1780
+msgid "readonly attribute"
+msgstr "skrivskyddad attribut"
+
+#: if_python.c:1793
+msgid "cursor position outside buffer"
+msgstr "markörposition utanför buffert"
+
+#: if_python.c:1870
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<fönsterobjekt (borttaget) vid %.8lX>"
+
+#: if_python.c:1882
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<fönsterobjekt (okänt) vid %.8lX>"
+
+#: if_python.c:1884
+#, c-format
+msgid "<window %d>"
+msgstr "<fönster %d>"
+
+#: if_python.c:1960
+msgid "no such window"
+msgstr "inget sådant fönster"
+
+#: if_python.c:2221 if_python.c:2255 if_python.c:2310 if_python.c:2378
+#: if_python.c:2500 if_python.c:2552 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1998
+msgid "cannot save undo information"
+msgstr "kan inte spara ångra-information"
+
+#: if_python.c:2223 if_python.c:2317 if_python.c:2389
+msgid "cannot delete line"
+msgstr "kan inte ta bort rad"
+
+#: if_python.c:2260 if_python.c:2405 if_tcl.c:690 if_tcl.c:2020
+msgid "cannot replace line"
+msgstr "kan inte ersätta rad"
+
+#: if_python.c:2423 if_python.c:2502 if_python.c:2560
+msgid "cannot insert line"
+msgstr "kan inte infoga rad"
+
+#: if_python.c:2664
+msgid "string cannot contain newlines"
+msgstr "sträng kan inte innehålla nyrader"
+
+#: if_ruby.c:412
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: Tyvärr, detta kommandot är inaktiverat, Ruby-biblioteket kunde inte "
+"läsas in."
+
+#: if_ruby.c:475
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: okänt longjmp-status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Växla mellan implementation/definition"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Visa basklass av"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Visa åsidosatt medlemsfunktion"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Hämta från fil"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Hämta från projekt"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Hämta från alla projekt"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Hämta"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Visa källa för"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "Hitta symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "Bläddra i klass"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Visa klass i hierarki"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Visa klass i begränsad hierarki"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref refererar till"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref refereras av"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref har en"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref används av"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Visa docu av"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "Generera docu för"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"Kan inte ansluta till SNiFF+. Kontrollera miljö (sniffemacs måste kunna "
+"hittas i $PATH).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Fel vid läsning. Frånkopplad"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ är för närvarande "
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "inte "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "ansluten"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: Okänd SNiFF+-begäran: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Fel vid anslutning till SNiFF+"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ inte ansluten"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: Inte en SNiFF+-buffert"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: Fel vid skrivning. Frånkopplad"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "ogiltigt buffertnummer"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "inte implementerat än"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "okänd flagga"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "kan inte ställa in rad(er)"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "märke inte satt"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "rad %d kolumn %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "kan inte infoga/lägga till rad"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "okänd flagga: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "okänd vimOption"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "tangentbordsavbrott"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim-fel"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "kan inte skapa buffert/fönster-kommando: objekt håller på att tas bort"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr ""
+"kan inte registera återkallningskommando: buffert/fönster håller redan på "
+"att tas bort"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr ""
+"E280: TCL ÖDESDIGERT FEL: reflist trasig!? Var snäll och rapportera detta "
+"till vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr ""
+"kan inte registrera återkallningskommando: buffert-/fönsterreferens hittades "
+"inte"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: Tyvärr, detta kommando är inaktiverat: Tcl-biblioteket kunde inte "
+"läsas in."
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E281: TCL-FEL: Avslutningskoden är inte int!? Var snäll och rapportera detta "
+"till vim-dev@vim.org"
+
+#: if_tcl.c:2006
+msgid "cannot get line"
+msgstr "kan inte hämta rad"
+
+#: if_xcmdsrv.c:215
+msgid "Unable to register a command server name"
+msgstr "Kunde inte registrera ett kommandoservernamn"
+
+#: if_xcmdsrv.c:465
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: Misslyckades att skicka kommando till målprogrammet"
+
+#: if_xcmdsrv.c:739
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: Ogiltigt server-id använt: %s"
+
+#: if_xcmdsrv.c:1102
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM instansregisteregenskap är dåligt format. Borttaget!"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "Okänd flagga"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "För många redigeringsargument"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "Argument saknas efter"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "Skräp efter flagga"
+
+#: main.c:68
+msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"
+msgstr ""
+"För många \"+kommando\"-, \"-c kommando\"- eller \"--cmd kommando\"-argument"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "Ogiltigt argument för"
+
+#: main.c:466
+msgid "This Vim was not compiled with the diff feature."
+msgstr "Denna Vim blev inte kompilerad med diff-funktionen."
+
+#: main.c:925
+msgid "Attempt to open script file again: \""
+msgstr "Försök att öppna skriptfil igen: \""
+
+#: main.c:929 main.c:936 main.c:980 memline.c:3694 memline.c:3698
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:934
+msgid "Cannot open for reading: \""
+msgstr "Kan inte öppna för läsning: \""
+
+#: main.c:978
+msgid "Cannot open for script output: \""
+msgstr "Kan inte öppna för skriptutmatning: \""
+
+#: main.c:1112
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d filer att redigera\n"
+
+#: main.c:1202
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: Varning: Utmatning är inte till en terminal\n"
+
+#: main.c:1204
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: Varning: Inmatning är inte från en terminal\n"
+
+#. just in case..
+#: main.c:1266
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc kommandorad"
+
+#: main.c:1307
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: Kan inte läsa från \"%s\""
+
+#: main.c:2365
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"Mer info med: \"vim -h\"\n"
+
+#: main.c:2398
+msgid "[file ..] edit specified file(s)"
+msgstr "[fil ..] redigera angivna fil(er)"
+
+#: main.c:2399
+msgid "- read text from stdin"
+msgstr "- läs text från standard in"
+
+#: main.c:2400
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tagg redigera fil där tagg är definierad"
+
+#: main.c:2402
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [felfil] redigera fil med första fel"
+
+#: main.c:2411
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"användning:"
+
+#: main.c:2414
+msgid " vim [arguments] "
+msgstr " vim [argument] "
+
+#: main.c:2418
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" eller:"
+
+#: main.c:2421
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"Argument:\n"
+
+#: main.c:2422
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tBara filnamn efter det här"
+
+#: main.c:2424
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tExpandera inte jokertecken"
+
+#: main.c:2427
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tRegistrera gvim för OLE"
+
+#: main.c:2428
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tAvregistrera gvim för OLE"
+
+#: main.c:2431
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tKör som GUI (som \"gvim\")"
+
+#: main.c:2432
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f eller --nofork\tFörgrund: Grena inte vid start av GUI"
+
+#: main.c:2434
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi-läge (som \"vi\")"
+
+#: main.c:2435
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx-läge (som \"ex\")"
+
+#: main.c:2436
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tTyst (batch) läge (bara för \"ex\")"
+
+#: main.c:2438
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff-läge (som \"vimdiff\")"
+
+#: main.c:2440
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tLätt läge (som \"evim\", lägeslös)"
+
+#: main.c:2441
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tSkrivskyddat läge (som \"view\")"
+
+#: main.c:2442
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tBegränsat läge (som \"rvim\")"
+
+#: main.c:2443
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tModifieringar (skriva filer) inte tillåtet"
+
+#: main.c:2444
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tModifieringar i text inte tillåtet"
+
+#: main.c:2445
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\tBinärläge"
+
+#: main.c:2447
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp-läge"
+
+#: main.c:2449
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tKompatibelt med Vi: 'compatible'"
+
+#: main.c:2450
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tInte fullt Vi-kompatibel: 'nocompatible'"
+
+#: main.c:2451
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tMångordigt läge"
+
+#: main.c:2452
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tFelsökningsläge"
+
+#: main.c:2453
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tIngen växlingsfil, använd endast minnet"
+
+#: main.c:2454
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tLista växlingsfiler och avsluta"
+
+#: main.c:2455
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (med filnamn)\tÅterskapa kraschad session"
+
+#: main.c:2456
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tSamma som -r"
+
+#: main.c:2458
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tAnvända inte newcli för att öppna fönster"
+
+#: main.c:2459
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <enhet>\t\tAnvänd <enhet> för I/O"
+
+#: main.c:2462
+msgid "-A\t\t\tstart in Arabic mode"
+msgstr "-A\t\t\tstarta i arabiskt läge"
+
+#: main.c:2465
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\tStarta i hebreiskt läge"
+
+#: main.c:2468
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\tStarta i persiskt läge (Farsi)"
+
+#: main.c:2470
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tStäll in terminaltyp till <terminal>"
+
+#: main.c:2471
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tAnvänd <vimrc> istället för någon .vimrc"
+
+#: main.c:2473
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tAnvänd <gvimrc> istället för någon .gvimrc"
+
+#: main.c:2475
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tLäs inte in insticksskript"
+
+#: main.c:2476
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\tÖppna N fönster (standard: ett för varje fil)"
+
+#: main.c:2477
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tSom -o men dela vertikalt"
+
+#: main.c:2478
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tStarta vid slut av fil"
+
+#: main.c:2479
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnr>\t\tStarta på rad <rnr>"
+
+#: main.c:2481
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <kommando>\tKör <kommando> före inläsning av någon vimrc fil"
+
+#: main.c:2483
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <kommando>\tKör <kommando> efter inläsning av den första filen"
+
+#: main.c:2484
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\tKör fil <session> efter inläsning av den första filen"
+
+#: main.c:2485
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <inskript>\tLäs Normallägeskommandon från fil <inskript>"
+
+#: main.c:2486
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <utskript>\tLägg till alla skrivna kommandon till fil <utskript>"
+
+#: main.c:2487
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <utskript>\tSkriv alla skrivna kommandon till fil <utskript>"
+
+#: main.c:2489
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tRedigera krypterade filer"
+
+#: main.c:2493
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\tAnslut vim till just denna X-server"
+
+#: main.c:2495
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tAnslut inte till X server"
+
+#: main.c:2498
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <filer>\tRedigera <filer> i en Vim-server om möjligt"
+
+#: main.c:2499
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-silent <filer>\tSamma, klaga inte om det inte finns någon server"
+
+#: main.c:2500
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <filer>\tSom --remote men vänta på att filer har blivit "
+"redigerade"
+
+#: main.c:2501
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <filer>\tSamma, klaga inte om det inte finns någon "
+"server"
+
+#: main.c:2502
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr ""
+"--remote-send <nycklar>\tSkicka <nycklar> till en Vim-server och avsluta"
+
+#: main.c:2503
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <uttryck>\tEvaluera <uttryck> i en Vim-server och skriv ut "
+"resultatet"
+
+#: main.c:2504
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tLista tillgängliga Vim-servernamn och avsluta"
+
+#: main.c:2505
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <namn>\tSkicka till/för att bli Vim-servern <namn>"
+
+#: main.c:2508
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tAnvänd <viminfo> istället för .viminfo"
+
+#: main.c:2510
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h eller --help\tSkriv ut Hjälp (det här meddelandet) och avsluta"
+
+#: main.c:2511
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tSkriv ut versionsinformation och avsluta"
+
+#: main.c:2515
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"Argument som stöds av gvim (Motif-version):\n"
+
+#: main.c:2519
+msgid ""
+"\n"
+"Arguments recognised by gvim (neXtaw version):\n"
+msgstr ""
+"\n"
+"Argument som stöds av gvim (neXtaw-version):\n"
+
+#: main.c:2521
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"Argument som stöds av gvim (Athena-version):\n"
+
+#: main.c:2525
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tKör vim på <display>"
+
+#: main.c:2526
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tStarta vim som ikon"
+
+#: main.c:2528
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <namn>\t\tAnvänd resurs som om vim var <namn>"
+
+#: main.c:2529
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (Oimplementerat)\n"
+
+#: main.c:2531
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <färg>\tAnvänd <färg> för bakgrunden (även: -bg)"
+
+#: main.c:2532
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <färg>\tAnvänd <färg> för vanlig text (även: -fg)"
+
+#: main.c:2533 main.c:2553
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <typsnitt>\t\tAnvänd <typsnitt> för vanlig text (även: -fn)"
+
+#: main.c:2534
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "­boldfont <typsnitt>\tAnvänd <typsnitt> för fet text"
+
+#: main.c:2535
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <typsnitt>\tAnvänd <typsnitt> för kursiv text"
+
+#: main.c:2536 main.c:2554
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr ""
+"-geometry <geom>\tAnvänd <geom> för inledande fönsterplacering (även: -geom)"
+
+#: main.c:2537
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <bredd>\tAnvänd en rambredd med <bredd> (även: -bw)"
+
+#: main.c:2538
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr ""
+"-scrollbarwidth <bredd> Använd en rullningslistbredd på <bredd> (även: -sw)"
+
+#: main.c:2540
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <höjd>\tAnvänd en menyradshöjd med <höjd> (även: -mh)"
+
+#: main.c:2542 main.c:2555
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tAnvänd omvänd video (även: -rv)"
+
+#: main.c:2543
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tAnvänd inte omvänd video (även: +rv)"
+
+#: main.c:2544
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <tillgång>\tStäll in den angivna tillgången"
+
+#: main.c:2547
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"Argument igenkända av gvim (RISC OS-version):\n"
+
+#: main.c:2548
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <antal>\tInledande bredd på fönster i kolumner"
+
+#: main.c:2549
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <antal>\tInledande höjd på fönster i rader"
+
+#: main.c:2552
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"Argument igenkända av gvim (GTK+-version):\n"
+
+#: main.c:2556
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tKör vim på <display> (även: --display)"
+
+#: main.c:2558
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <roll>\tStäll in en unik roll för att identifiera huvudfönstret"
+
+#: main.c:2560
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÖppna Vim innanför en annan GTK-widget"
+
+#: main.c:2562
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tVisa Gnome-argument"
+
+#: main.c:2794
+msgid "No display"
+msgstr "Ingen display"
+
+#. Failed to send, abort.
+#: main.c:2809
+msgid ": Send failed.\n"
+msgstr ": Överföring misslyckades.\n"
+
+#. Let vim start normally.
+#: main.c:2815
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": Överföring misslyckades. Försöker att köra lokalt\n"
+
+#: main.c:2853 main.c:2874
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d av %d redigerade"
+
+#: main.c:2896
+msgid "No display: Send expression failed.\n"
+msgstr "Ingen display: Överföringsuttryck misslyckades.\n"
+
+#: main.c:2908
+msgid ": Send expression failed.\n"
+msgstr ": Överföringsuttryck misslyckades.\n"
+
+#: mark.c:662
+msgid "No marks set"
+msgstr "Inga märken satta"
+
+#: mark.c:664
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: Inga märken matchade \"%s\""
+
+#. Highlight title
+#: mark.c:675
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"märke rad kol fil/text"
+
+#. Highlight title
+#: mark.c:713
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" hopp rad kol fil/text"
+
+#: mark.c:1083
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Filmärken:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1118
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Hopplista (nyaste först):\n"
+
+#: mark.c:1214
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Historia för märken inne i filer (nyaste till äldsta):\n"
+
+#: mark.c:1297
+msgid "Missing '>'"
+msgstr "Saknar '>'"
+
+#: mbyte.c:415
+msgid "E543: Not a valid codepage"
+msgstr "E543: Inte en godkänd teckentabell"
+
+#: mbyte.c:4099
+msgid "E284: Cannot set IC values"
+msgstr "E284: Kan inte ställa in IC-värden"
+
+#: mbyte.c:4251
+msgid "E285: Failed to create input context"
+msgstr "E285: Misslyckades att skapa inmatningsmiljö"
+
+#: mbyte.c:4398
+msgid "E286: Failed to open input method"
+msgstr "E286: Misslyckades att öppna inmatningsmetod"
+
+#: mbyte.c:4409
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: Varning: Kunde inte ställa in förstörningsåterkallning till IM"
+
+#: mbyte.c:4415
+msgid "E288: input method doesn't support any style"
+msgstr "E288: inmatningsmetod stöder inte någon stil"
+
+#: mbyte.c:4472
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: inmatningsmetod stöder inte min förredigeringstyp"
+
+#: mbyte.c:4546
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: över-pricken-stil kräver typsnittsuppsättning"
+
+#: mbyte.c:4578
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: Din GTK+ är äldre än 1.2.3. Statusområde inaktiverat"
+
+#: mbyte.c:4857
+msgid "E292: Input Method Server is not running"
+msgstr "E292: Inmatningsmetodserver körs inte"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: block låstes inte"
+
+#: memfile.c:995
+msgid "E294: Seek error in swap file read"
+msgstr "E294: Sökfel i växelfilsläsning"
+
+#: memfile.c:1000
+msgid "E295: Read error in swap file"
+msgstr "E295: Läsfel i växelfil"
+
+#: memfile.c:1052
+msgid "E296: Seek error in swap file write"
+msgstr "E296: Sökfel i växelfilskrivning"
+
+#: memfile.c:1070
+msgid "E297: Write error in swap file"
+msgstr "E297: Skrivfel i växelfil"
+
+#: memfile.c:1267
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: Växelfil existerar redan (symlänksattack?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: Tog inte emot block nr 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: Tog inte emot block nr 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: Tog inte emot block nr 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: Hoppsan, tappat bort växelfilen!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: Kunde inte döpa om växelfil"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: Kunde inte öppna växelfil för \"%s\", återskapning omöjlig"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: Tog inte emot block 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: Ingen växelfil hittad för %s"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "Ange nummer på växelfil att använda (0 för att avsluta): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: Kan inte öppna %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "Kunde inte läsa block 0 från "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"Kanske gjordes inte några förändringar eller så uppdaterade inte Vim "
+"växlingsfilen."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " kan inte användas med den här versionen av Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "Använd Vim version 3.0.\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ser inte ut som en Vim-växlingsfil"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " kan inte användas på den här datorn.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "Filen skapades på "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"eller så har filen blivit skadad."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "Använder växlingsfil \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Orginalfil \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: Varning: Orginalfilen kan ha blivit skadad"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: Kunde inte läsa block 1 från %s"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???MÅNGA RADER SAKNAS"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???RADANTAL FEL"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???TOMT BLOCK"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???RADER SAKNAS"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: Block 1 ID fel (%s inte en .swp-fil?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???BLOCK SAKNAS"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? från här till ???SLUT kan rader vara tillstökade"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? från här till ???SLUT kan rader ha blivit infogade/borttagna"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "??SLUT"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: Återskapning avbruten"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: Fel upptäckt vid återskapning; titta efter rader som börjar med ???"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "Återskapning klar. Du borde kontrollera om allting är OK."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Du kanske vill spara den här filen under ett annat namn\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr ""
+"och kör diff med orginalfilen för att kontrollera efter förändringar)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"Ta bort .swp-filen efteråt.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "Växlingsfiler hittade:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " I aktuell katalog:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Använder angivet namn:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " I katalog "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- inget --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " ägd av: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " daterad: "
+
+#: memline.c:1487 memline.c:3701
+msgid " dated: "
+msgstr " daterad: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [från Vim version 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [ser inte ut som en Vim-växlingsfil]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " filnamn: "
+
+#: memline.c:1517
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" modifierad: "
+
+#: memline.c:1518
+msgid "YES"
+msgstr "JA"
+
+#: memline.c:1518
+msgid "no"
+msgstr "nej"
+
+#: memline.c:1522
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" användarnamn: "
+
+#: memline.c:1529
+msgid " host name: "
+msgstr " värdnamn: "
+
+#: memline.c:1531
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" värdnamn: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" process-ID: "
+
+#: memline.c:1543
+msgid " (still running)"
+msgstr " (körs fortfarande)"
+
+#: memline.c:1555
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [inte användbar med den här versionen av Vim]"
+
+#: memline.c:1558
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [inte användbar på den här datorn]"
+
+#: memline.c:1563
+msgid " [cannot be read]"
+msgstr " [kan inte läsas]"
+
+#: memline.c:1567
+msgid " [cannot be opened]"
+msgstr " [kan inte öppnas]"
+
+#: memline.c:1757
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: Kan inte bevara, det finns ingen växlingsfil"
+
+#: memline.c:1810
+msgid "File preserved"
+msgstr "Fil bevarad"
+
+#: memline.c:1812
+msgid "E314: Preserve failed"
+msgstr "E314: Bevaring misslyckades"
+
+#: memline.c:1883
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ogiltigt lnum: %ld"
+
+#: memline.c:1909
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: kan inte hitta rad %ld"
+
+#: memline.c:2299
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: pekarblock-id fel 3"
+
+#: memline.c:2379
+msgid "stack_idx should be 0"
+msgstr "stack_idx ska vara 0"
+
+#: memline.c:2441
+msgid "E318: Updated too many blocks?"
+msgstr "E318: Uppdaterade för många block?"
+
+#: memline.c:2623
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: pekarblock-id fel 4"
+
+#: memline.c:2650
+msgid "deleted block 1?"
+msgstr "tagit bort block 1?"
+
+#: memline.c:2850
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: Kan inte hitta rad %ld"
+
+#: memline.c:3093
+msgid "E317: pointer block id wrong"
+msgstr "E317: pekarblock-id fel"
+
+#: memline.c:3109
+msgid "pe_line_count is zero"
+msgstr "pe_line_count är noll"
+
+#: memline.c:3138
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: radnummer utanför område: %ld bakom slutet"
+
+#: memline.c:3142
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: radantal fel i block %ld"
+
+#: memline.c:3191
+msgid "Stack size increases"
+msgstr "Stackstorlek ökar"
+
+#: memline.c:3237
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: pekarblock-id fel 2"
+
+#: memline.c:3691
+msgid "E325: ATTENTION"
+msgstr "E325: LYSTRING"
+
+#: memline.c:3692
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"Hittade en växlingsfil med namnet \""
+
+#: memline.c:3696
+msgid "While opening file \""
+msgstr "Vid öppning av fil \""
+
+#: memline.c:3705
+msgid " NEWER than swap file!\n"
+msgstr " NYARE än växelfil!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3709
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) Ett annat program kan redigera samma fil.\n"
+" Om så är fallet, var försiktig så att det inte slutar med två\n"
+" versioner av samma fil vid förändringar.\n"
+
+#: memline.c:3710
+msgid " Quit, or continue with caution.\n"
+msgstr " Avsluta, eller fortsätt på egen risk.\n"
+
+#: memline.c:3711
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) En redigeringssession för den här filen kraschade.\n"
+
+#: memline.c:3712
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Om så är fallet, använd \":recover\" eller \"vim -r "
+
+#: memline.c:3714
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" för att återskapa förändringarna (se \":help recovery\").\n"
+
+#: memline.c:3715
+msgid " If you did this already, delete the swap file \""
+msgstr " Om du redan har gjort det, ta bort växlingsfilen \""
+
+#: memline.c:3717
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" för att undvika det här meddelandet.\n"
+
+#: memline.c:3731 memline.c:3735
+msgid "Swap file \""
+msgstr "Växlingsfil \""
+
+#: memline.c:3732 memline.c:3738
+msgid "\" already exists!"
+msgstr "\" existerar redan!"
+
+#: memline.c:3741
+msgid "VIM - ATTENTION"
+msgstr "VIM - LYSTRING"
+
+#: memline.c:3743
+msgid "Swap file already exists!"
+msgstr "Växlingsfil existerar redan!"
+
+#: memline.c:3747
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&Öppna skrivskyddad\n"
+"&Redigera ändå\n"
+"&Återskapa\n"
+"&Avsluta"
+
+#: memline.c:3749
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&Öppna skrivskyddad\n"
+"&Redigera ändå\n"
+"&Återskapa\n"
+"&Avsluta\n"
+"&Ta bort den"
+
+#: memline.c:3802
+msgid "E326: Too many swap files found"
+msgstr "E326: För många växlingsfiler hittade"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: Del av menyföremål sökväg är inte undermeny"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: Meny existerar bara i ett annat läge"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: Ingen meny med det namnet"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: Menysökväg får inte leda till en undermeny"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: Får inte lägga till menyföremål direkt till menyrad"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: Avskiljare kam inte vara en del av en menysökväg"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1081
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- Menyer ---"
+
+#: menu.c:1998
+msgid "Tear off this menu"
+msgstr "Ta loss den här menyn"
+
+#: menu.c:2063
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: Menysökväg måste leda till ett menyföremål"
+
+#: menu.c:2083
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: Meny hittades inte: %s"
+
+#: menu.c:2152
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: Meny inte definierad för %s läge"
+
+#: menu.c:2190
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: Menysökväg måste leda till en undermeny"
+
+#: menu.c:2211
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: Meny hittades inte - kontrollera menynamn"
+
+#: message.c:519
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "Fel upptäcktes vid bearbetning av %s:"
+
+#: message.c:535
+#, c-format
+msgid "line %4ld:"
+msgstr "rad %4ld:"
+
+#: message.c:575
+msgid "[string too long]"
+msgstr "[sträng för lång]"
+
+#: message.c:721
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "Meddelandeansvarig: Johan Svedberg <johan@svedberg.pp.se>"
+
+#: message.c:945
+msgid "Interrupt: "
+msgstr "Avbrott: "
+
+#: message.c:948
+msgid "Hit ENTER to continue"
+msgstr "Tryck RETUR för att fortsätta"
+
+#: message.c:950
+msgid "Hit ENTER or type command to continue"
+msgstr "Tryck RETUR eller skriv kommando för att fortsätta"
+
+#: message.c:2258
+msgid "-- More --"
+msgstr "-- Mer --"
+
+#: message.c:2261
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (ENT/BS: rad, BLANKSTEG/b: sida, d/u: halv sida q: avsluta"
+
+#: message.c:2262
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (ENT: rad, BLANKSTEG: sida d: halv sida q: avsluta)"
+
+#: message.c:2869 message.c:2884
+msgid "Question"
+msgstr "Fråga"
+
+#: message.c:2871
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Ja\n"
+"&Nej"
+
+#: message.c:2904
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Ja\n"
+"&Nej\n"
+"&Spara &alla\n"
+"&Kasta bort alla\n"
+"&Avbryt"
+
+#: message.c:2945
+msgid "Save File dialog"
+msgstr "Filsparandedialog"
+
+#: message.c:2947
+msgid "Open File dialog"
+msgstr "Filöppnandedialog"
+
+#. TODO: non-GUI file selector here
+#: message.c:3018
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Tyvärr, ingen filbläddrare i konsoll-läge"
+
+#: misc1.c:2679
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: Varning: Ändrar en skrivskyddad fil"
+
+#: misc1.c:2918
+msgid "1 more line"
+msgstr "1 rad till"
+
+#: misc1.c:2920
+msgid "1 line less"
+msgstr "1 rad mindre"
+
+#: misc1.c:2925
+#, c-format
+msgid "%ld more lines"
+msgstr "%ld rad till"
+
+#: misc1.c:2927
+#, c-format
+msgid "%ld fewer lines"
+msgstr "%ld färre rader"
+
+#: misc1.c:2930
+msgid " (Interrupted)"
+msgstr " (Avbruten)"
+
+#: misc1.c:6602
+msgid "Vim: preserving files...\n"
+msgstr "Vim: bevarar filer...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6612
+msgid "Vim: Finished.\n"
+msgstr "Vim: Färdig.\n"
+
+#: misc2.c:670 misc2.c:686
+msgid "ERROR: "
+msgstr "FEL: "
+
+#: misc2.c:690
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bitar] sammanlagd allok-frigjord %lu-%lu, i användning %lu, toppanvändning %"
+"lu\n"
+
+#: misc2.c:692
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[anrop] sammanlagda om/malloc()'s %lu, sammanlagda free()'s %lu\n"
+"\n"
+
+#: misc2.c:747
+msgid "E340: Line is becoming too long"
+msgstr "E340: Rad börjar bli för lång"
+
+#: misc2.c:791
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: Internt fel: lalloc(%ld, )"
+
+#: misc2.c:899
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: Slut på minne! (allokerar %lu bitar)"
+
+#: misc2.c:2565
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "Anropar skal att köra: \"%s\""
+
+#: misc2.c:2787
+msgid "E545: Missing colon"
+msgstr "E545: Saknar kolon"
+
+#: misc2.c:2789 misc2.c:2816
+msgid "E546: Illegal mode"
+msgstr "E546: Otillåtet läge"
+
+#: misc2.c:2855
+msgid "E547: Illegal mouseshape"
+msgstr "E547: Otillåten musform"
+
+#: misc2.c:2895
+msgid "E548: digit expected"
+msgstr "E548: siffra förväntades"
+
+#: misc2.c:2900
+msgid "E549: Illegal percentage"
+msgstr "E549: Otillåten procentsats"
+
+#: misc2.c:3210
+msgid "Enter encryption key: "
+msgstr "Ange krypteringsnyckel: "
+
+#: misc2.c:3211
+msgid "Enter same key again: "
+msgstr "Ange samma nyckel igen: "
+
+#: misc2.c:3221
+msgid "Keys don't match!"
+msgstr "Nycklar matchar inte!"
+
+#: misc2.c:3770
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: Ogiltig sökväg: '**[nummer]' måste vara i slutet på sökvägen eller "
+"följas av '%s'."
+
+#: misc2.c:5049
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: Kan inte hitta katalog \"%s\" i cdpath"
+
+#: misc2.c:5052
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: Kan inte hitta fil \"%s\" i sökväg"
+
+#: misc2.c:5058
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: Ingen katalog \"%s\" hittades i cdpath"
+
+#: misc2.c:5061
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: Ingen fil \"%s\" hittades i sökvägen"
+
+#: misc2.c:5295
+msgid "E550: Missing colon"
+msgstr "E550: Saknar kolon"
+
+#: misc2.c:5307
+msgid "E551: Illegal component"
+msgstr "E551: Otillåten komponent"
+
+#: misc2.c:5315
+msgid "E552: digit expected"
+msgstr "E552: siffra förväntades"
+
+#. Get here when the server can't be found.
+#: netbeans.c:346
+msgid "Cannot connect to Netbeans #2"
+msgstr "Kan inte ansluta till Netbeans #2"
+
+#: netbeans.c:354
+msgid "Cannot connect to Netbeans"
+msgstr "Kan inte ansluta till Netbeans"
+
+#: netbeans.c:633
+msgid "read from Netbeans socket"
+msgstr "läs från Netbeans-uttag"
+
+#: normal.c:2944
+msgid "Warning: terminal cannot highlight"
+msgstr "Varning: terminal kan inte framhäva"
+
+#: normal.c:3159
+msgid "E348: No string under cursor"
+msgstr "E348: Ingen sträng under markör"
+
+#: normal.c:3161
+msgid "E349: No identifier under cursor"
+msgstr "E349: Ingen identifierare under markör"
+
+#: normal.c:4379
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: Kan inte ta bort veck med aktuell 'foldmethod'"
+
+#: normal.c:7802
+msgid "Type :quit<Enter> to exit Vim"
+msgstr "skriv :q<Enter> för att avsluta Vim "
+
+#: ops.c:295
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "1 rad %sad 1 gång"
+
+#: ops.c:297
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "1 rad %sade %d gånger"
+
+#: ops.c:302
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld rader %sad 1 gång"
+
+#: ops.c:305
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld rader %sade %d gånger"
+
+#: ops.c:663
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "%ld rader att indentera... "
+
+#: ops.c:713
+msgid "1 line indented "
+msgstr "1 rad indenterad "
+
+#: ops.c:715
+#, c-format
+msgid "%ld lines indented "
+msgstr "%ld rader indenterade "
+
+#. must display the prompt
+#: ops.c:1647
+msgid "cannot yank; delete anyway"
+msgstr "kan inte kopiera; ta bort ändå"
+
+#: ops.c:2155
+msgid "1 line changed"
+msgstr "1 rad ändrad"
+
+#: ops.c:2157
+#, c-format
+msgid "%ld lines changed"
+msgstr "%ld rader ändrade"
+
+#: ops.c:2541
+#, c-format
+msgid "freeing %ld lines"
+msgstr "frigör %ld rader"
+
+#: ops.c:2822
+msgid "1 line yanked"
+msgstr "1 rad kopierad"
+
+#: ops.c:2824
+#, c-format
+msgid "%ld lines yanked"
+msgstr "%ld rader kopierade"
+
+#: ops.c:3109
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: Ingenting i register %s"
+
+#. Highlight title
+#: ops.c:3660
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- Register ---"
+
+#: ops.c:4875
+msgid "Illegal register name"
+msgstr "Otillåtet registernamn"
+
+#: ops.c:4961
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# Register:\n"
+
+#: ops.c:4994
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: Okänd registertyp %d"
+
+#: ops.c:5480
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: Otillåtet registernamn: '%s'"
+
+#: ops.c:5840
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld kolumner; "
+
+#: ops.c:5847
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Markerade %s%ld av %ld rader; %ld av %ld ord; %ld av %ld bitar"
+
+#: ops.c:5863
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Kol %s av %s; rad %ld av %ld; ord %ld av %ld; bit %ld av %ld"
+
+#: ops.c:5874
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld för BOM)"
+
+#: option.c:1633
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=Sida %N"
+
+#: option.c:2082
+msgid "Thanks for flying Vim"
+msgstr "Tack för att du flyger med Vim"
+
+#: option.c:3354 option.c:3461
+msgid "E518: Unknown option"
+msgstr "E518: Okänd flagga"
+
+#: option.c:3367
+msgid "E519: Option not supported"
+msgstr "E519: Flagga inte stödd"
+
+#: option.c:3392
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: Inte tillåtet i en lägesrad"
+
+#: option.c:3448
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tSenast satt från "
+
+#: option.c:3587
+msgid "E521: Number required after ="
+msgstr "E521: Nummer krävs efter ="
+
+#: option.c:3914 option.c:4531
+msgid "E522: Not found in termcap"
+msgstr "E522: Inte hittat i termcap"
+
+#: option.c:3980
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: Otillåtet tecken <%s>"
+
+#: option.c:4523
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: Kan inte sätta 'term' till tom sträng"
+
+#: option.c:4526
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: Kan inte ändra term i GUI"
+
+#: option.c:4528
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: Använd \":gui\" för att starta GUI"
+
+#: option.c:4549
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backuptext' och 'patchmode' är lika"
+
+#: option.c:4734
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: Kan inte bli ändrat i GTK+ 2-GUI"
+
+#: option.c:4890
+msgid "E524: Missing colon"
+msgstr "E524: Saknar kolon"
+
+#: option.c:4892
+msgid "E525: Zero length string"
+msgstr "E525: Nollängdssträng"
+
+#: option.c:4960
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: Saknar nummer efter <%s>"
+
+#: option.c:4974
+msgid "E527: Missing comma"
+msgstr "E527: Saknar komma"
+
+#: option.c:4981
+msgid "E528: Must specify a ' value"
+msgstr "E528: Måste ange ett '-värde"
+
+#: option.c:5022
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: innehåller outskrivbara eller breda tecken"
+
+#: option.c:5071
+msgid "E596: Invalid font(s)"
+msgstr "E596: Ogiltig(a) typsnitt"
+
+#: option.c:5079
+msgid "E597: can't select fontset"
+msgstr "E597: kan inte välja typsnittsuppsättning"
+
+#: option.c:5081
+msgid "E598: Invalid fontset"
+msgstr "E598: Ogiltig typsnittsuppsättning"
+
+#: option.c:5088
+msgid "E533: can't select wide font"
+msgstr "E533: kan inte välja brett typsnitt"
+
+#: option.c:5090
+msgid "E534: Invalid wide font"
+msgstr "E534: Ogiltigt brett typsnitt"
+
+#: option.c:5360
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: Otillåtet tecken efter <%c>"
+
+#: option.c:5465
+msgid "E536: comma required"
+msgstr "E536: komma krävs"
+
+#: option.c:5475
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' måste vara tom eller innehålla %s"
+
+#: option.c:5548
+msgid "E538: No mouse support"
+msgstr "E538: Inget musstöd"
+
+#: option.c:5816
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: Ostängd uttryckssekvens"
+
+#: option.c:5820
+msgid "E541: too many items"
+msgstr "E541: för många föremål"
+
+#: option.c:5822
+msgid "E542: unbalanced groups"
+msgstr "E542: obalanserade grupper"
+
+#: option.c:6062
+msgid "E590: A preview window already exists"
+msgstr "E590: Ett förhandsvisningsfönster existerar redan"
+
+#: option.c:6319
+msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'"
+msgstr "W17: Arabiska kräver UTF-8, gör ':set encoding=utf-8'"
+
+#: option.c:6636
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: Behöver åtminstone %d rader"
+
+#: option.c:6645
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: Behöver åtminstone %d kolumner"
+
+#: option.c:6950
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: Okänd flagga: %s"
+
+#: option.c:7060
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Terminalkoder ---"
+
+#: option.c:7062
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Globala flaggvärden ---"
+
+#: option.c:7064
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Lokala flaggvärden ---"
+
+#: option.c:7066
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Flaggor ---"
+
+#: option.c:7767
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp-FEL"
+
+#: option.c:8738
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': Matchande tecken saknas för %s"
+
+#: option.c:8772
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': Extra tecken efter semikolon: %s"
+
+#: os_amiga.c:275
+msgid "cannot open "
+msgstr "kan inte öppna "
+
+#: os_amiga.c:309
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: Kan inte öppna fönster!\n"
+
+#: os_amiga.c:333
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "Behöver Amigados version 2.04 eller senare\n"
+
+#: os_amiga.c:339
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "Behöver %s version %ld\n"
+
+#: os_amiga.c:411
+msgid "Cannot open NIL:\n"
+msgstr "Kan inte öppna NIL:\n"
+
+#: os_amiga.c:422
+msgid "Cannot create "
+msgstr "Kan inte skapa "
+
+#: os_amiga.c:900
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim avslutar med %d\n"
+
+#: os_amiga.c:932
+msgid "cannot change console mode ?!\n"
+msgstr "kan inte ändra konsoll-läge ?!\n"
+
+#: os_amiga.c:998
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: inte en konsoll??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1147
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: Kan inte köra skal med -f-flagga"
+
+#: os_amiga.c:1188 os_amiga.c:1278
+msgid "Cannot execute "
+msgstr "Kan inte köra "
+
+#: os_amiga.c:1191 os_amiga.c:1288
+msgid "shell "
+msgstr "skal "
+
+#: os_amiga.c:1211 os_amiga.c:1313
+msgid " returned\n"
+msgstr " returnerade\n"
+
+#: os_amiga.c:1454
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE för liten."
+
+#: os_amiga.c:1458
+msgid "I/O ERROR"
+msgstr "I/O-FEL"
+
+#: os_mswin.c:525
+msgid "...(truncated)"
+msgstr "...(trunkerade)"
+
+#: os_mswin.c:627
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' är inte 80, kan inte köra externa kommandon"
+
+#: os_mswin.c:1866
+msgid "E237: Printer selection failed"
+msgstr "E237: Skrivarval misslyckades"
+
+#: os_mswin.c:1906
+#, c-format
+msgid "to %s on %s"
+msgstr "till %s på %s"
+
+#: os_mswin.c:1921
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: Okänt skrivartypsnitt: %s"
+
+#: os_mswin.c:1971 os_mswin.c:1981
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: Skrivarfel: %s"
+
+#: os_mswin.c:1982
+msgid "Unknown"
+msgstr "Okänd"
+
+#: os_mswin.c:2009
+#, c-format
+msgid "Printing '%s'"
+msgstr "Skriver ut '%s'"
+
+#: os_mswin.c:3095
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: Otillåtet teckenkodsnamn \"%s\" i typsnittsnamn \"%s\""
+
+#: os_mswin.c:3103
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: Otillåtet tecken '%c' i typsnittsnamn \"%s\""
+
+#: os_riscos.c:1258
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: Ogiltig 'osfiletype'-flagga - använder Text"
+
+#: os_unix.c:897
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Dubbelsignal, avslutar\n"
+
+#: os_unix.c:903
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: Fångade dödlig signal %s\n"
+
+#: os_unix.c:906
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: Fångade dödlig signal\n"
+
+#: os_unix.c:1169
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "Öppning av X-display tog %ld ms"
+
+#: os_unix.c:1196
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: Fick X-error\n"
+
+#: os_unix.c:1304
+msgid "Testing the X display failed"
+msgstr "Testning av X-displayen misslyckades"
+
+#: os_unix.c:1443
+msgid "Opening the X display timed out"
+msgstr "Öppning av X-displayen tog för lång tid"
+
+#: os_unix.c:3190 os_unix.c:3870
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"Kan inte köra skal "
+
+#: os_unix.c:3238
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"Kan inte köra skal sh\n"
+
+#: os_unix.c:3242 os_unix.c:3876
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"skal returnerade "
+
+#: os_unix.c:3377
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"Kan inte skapa rör\n"
+
+#: os_unix.c:3392
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"Kan inte grena\n"
+
+#: os_unix.c:3883
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"Kommando avslutades\n"
+
+#: os_unix.c:4147 os_unix.c:4272 os_unix.c:5933
+msgid "XSMP lost ICE connection"
+msgstr "XSMP tappade ICE-anslutning"
+
+#: os_unix.c:5516
+msgid "Opening the X display failed"
+msgstr "Öppning av X-displayen misslyckades"
+
+#: os_unix.c:5838
+msgid "XSMP handling save-yourself request"
+msgstr "XSMP hanterar spara-själv-förfrågan"
+
+#: os_unix.c:5957
+msgid "XSMP opening connection"
+msgstr "XSMP öppnar anslutning"
+
+#: os_unix.c:5976
+msgid "XSMP ICE connection watch failed"
+msgstr "XSMP ICE-anslutning övervakning misslyckades"
+
+#: os_unix.c:5996
+#, c-format
+msgid "XSMP SmcOpenConnection failed: %s"
+msgstr "XSMP SmcOpenConnection misslyckades: %s"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "På rad"
+
+#: os_w32exe.c:65
+msgid "Could not allocate memory for command line."
+msgstr "Kunde inte allokera minne för kommandorad."
+
+#: os_w32exe.c:66 os_w32exe.c:89 os_w32exe.c:100
+msgid "VIM Error"
+msgstr "VIM-fel"
+
+#: os_w32exe.c:89
+msgid "Could not load vim32.dll!"
+msgstr "Kunde inte läsa in vim32.dll!"
+
+#: os_w32exe.c:99
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "Kunde inte ordna upp funktionspekare till DLL:en!"
+
+#: os_win16.c:341 os_win32.c:3064
+#, c-format
+msgid "shell returned %d"
+msgstr "skal returnerade %d"
+
+#: os_win32.c:2522
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: Fångade %s-händelse\n"
+
+#: os_win32.c:2524
+msgid "close"
+msgstr "stäng"
+
+#: os_win32.c:2526
+msgid "logoff"
+msgstr "logga ut"
+
+#: os_win32.c:2527
+msgid "shutdown"
+msgstr "stäng av"
+
+#: os_win32.c:3017
+msgid "E371: Command not found"
+msgstr "E371: Kommando hittades inte"
+
+#: os_win32.c:3030
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"VIMRUN.EXE hittades inte i din $PATH.\n"
+"Externa kommandon vill inte stå stilla efter färdigställning.\n"
+"Se :help win32-vimrun för mer information."
+
+#: os_win32.c:3033
+msgid "Vim Warning"
+msgstr "Vim-varning"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: För många %%%c i formatsträng"
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: Oväntad %%%c i formatsträng"
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: Saknar ] i formatsträng"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: Ostödd %%%c i formatsträng"
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: Ogiltig %%%c i formatsträngprefix"
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: Ogiltig %%%c i formatsträng"
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' innehåller inga mönster"
+
+#: quickfix.c:501
+msgid "E379: Missing or empty directory name"
+msgstr "E379: Saknar eller tomt katalognamn"
+
+#: quickfix.c:988
+msgid "E553: No more items"
+msgstr "E553: Inga fler föremål"
+
+#: quickfix.c:1225
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d av %d)%s%s: "
+
+#: quickfix.c:1227
+msgid " (line deleted)"
+msgstr " (rad borttagen)"
+
+#: quickfix.c:1440
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: På botten av quickfix-stack"
+
+#: quickfix.c:1449
+msgid "E381: At top of quickfix stack"
+msgstr "E381: På toppen av quickfix-stack"
+
+#: quickfix.c:1461
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "fellista %d av %d; %d fel"
+
+#: quickfix.c:1939
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: Kan inte skriva, 'buftype'-flagga är satt"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: ogiltigt föremål i %s%%[]"
+
+#: regexp.c:827
+msgid "E339: Pattern too long"
+msgstr "E339: Mönster för långt"
+
+#: regexp.c:996
+msgid "E50: Too many \\z("
+msgstr "E50: För många \\z("
+
+#: regexp.c:1007
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: För många %s("
+
+#: regexp.c:1064
+msgid "E52: Unmatched \\z("
+msgstr "E52: Omatchade \\z("
+
+#: regexp.c:1068
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: Omatchade %s%%("
+
+#: regexp.c:1070
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: Omatchade %s("
+
+#: regexp.c:1075
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: Omatchade %s)"
+
+#: regexp.c:1244
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s*-operand kan vara tom"
+
+#: regexp.c:1247
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E57: %s+-operand kan vara tom"
+
+#: regexp.c:1301
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: ogiltigt tecken efter %s@"
+
+#: regexp.c:1326
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{-operand kan vara tom"
+
+#: regexp.c:1336
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: För många komplexa %s{...}s"
+
+#: regexp.c:1352
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: Nästlade %s*"
+
+#: regexp.c:1355
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: Nästlade %s%c"
+
+#: regexp.c:1473
+msgid "E63: invalid use of \\_"
+msgstr "E63: ogiltig användning av \\_"
+
+#: regexp.c:1518
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c följer ingenting"
+
+#: regexp.c:1574
+msgid "E65: Illegal back reference"
+msgstr "E65: Otillåten bakåtreferens"
+
+#: regexp.c:1587
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z{ inte tillåtet här"
+
+#: regexp.c:1606
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 m.fl. inte tillåtet här"
+
+#: regexp.c:1617
+msgid "E68: Invalid character after \\z"
+msgstr "E68: Ogiltigt tecken efter \\z"
+
+#: regexp.c:1666
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: Saknar ] efter %s%%["
+
+#: regexp.c:1682
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: Tom %s%%[]"
+
+#: regexp.c:1742
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: Ogiltigt tecken efter %s%%"
+
+#: regexp.c:2539
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: Syntaxfel i %s{...}"
+
+#: regexp.c:2800
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: Krasch hejdad; reguljärt uttryck för komplext?"
+
+#: regexp.c:2941
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: mönster orsakade slut-på-stack-fel"
+
+#: regexp.c:3180
+msgid "External submatches:\n"
+msgstr "Externa underträffar:\n"
+
+#: screen.c:2115
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--%3ld rader vikta "
+
+#: screen.c:7892
+msgid " VREPLACE"
+msgstr " VERSÄTT"
+
+#: screen.c:7896
+msgid " REPLACE"
+msgstr " ERSÄTT"
+
+#: screen.c:7901
+msgid " REVERSE"
+msgstr " OMVÄND"
+
+#: screen.c:7903
+msgid " INSERT"
+msgstr " INFOGA"
+
+#: screen.c:7906
+msgid " (insert)"
+msgstr " (infoga)"
+
+#: screen.c:7908
+msgid " (replace)"
+msgstr " (ersätt)"
+
+#: screen.c:7910
+msgid " (vreplace)"
+msgstr " (versätt)"
+
+#: screen.c:7913
+msgid " Hebrew"
+msgstr " Hebreiska"
+
+#: screen.c:7924
+msgid " Arabic"
+msgstr " Arabiska"
+
+#: screen.c:7927
+msgid " (lang)"
+msgstr " (språk)"
+
+#: screen.c:7931
+msgid " (paste)"
+msgstr " (klistra in)"
+
+#: screen.c:7937
+msgid " SELECT"
+msgstr " MARKERA"
+
+#: screen.c:7939
+msgid " VISUAL"
+msgstr " VISUELL"
+
+#: screen.c:7941
+msgid " BLOCK"
+msgstr " BLOCK"
+
+#: screen.c:7943
+msgid " LINE"
+msgstr " RAD"
+
+#: screen.c:7956 screen.c:8016
+msgid "recording"
+msgstr "spelar in"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "sökning nådde TOPPEN, fortsätter vid BOTTEN"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "sökning nådde BOTTEN, forsätter vid TOPPEN"
+
+#: search.c:525
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: Ogiltig söksträng: %s"
+
+#: search.c:852
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: sökning nådde TOPPEN utan träff av: %s"
+
+#: search.c:855
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: sökning nådde BOTTEN utan träff av: %s"
+
+#: search.c:1247
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: Förväntade '?' eller '/' efter ';'"
+
+#: search.c:3709
+msgid " (includes previously listed match)"
+msgstr " (inkluderar tidigare listad träff)"
+
+#. cursor at status line
+#: search.c:3729
+msgid "--- Included files "
+msgstr "--- Inkluderade filer "
+
+#: search.c:3731
+msgid "not found "
+msgstr "hittades inte "
+
+#: search.c:3732
+msgid "in path ---\n"
+msgstr "i sökväg ---\n"
+
+#: search.c:3771
+msgid " (Already listed)"
+msgstr " (Redan listade)"
+
+#: search.c:3773
+msgid " NOT FOUND"
+msgstr " INTE HITTADE"
+
+#: search.c:3825
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "Söker igenom inkluderad fil: %s"
+
+#: search.c:4043
+msgid "E387: Match is on current line"
+msgstr "E387: Matchning är på aktuell rad"
+
+#: search.c:4186
+msgid "All included files were found"
+msgstr "Alla inkluderade filer hittades"
+
+#: search.c:4188
+msgid "No included files"
+msgstr "Inga inkluderade filer"
+
+#: search.c:4204
+msgid "E388: Couldn't find definition"
+msgstr "E388: Kunde inte hitta definition"
+
+#: search.c:4206
+msgid "E389: Couldn't find pattern"
+msgstr "E389: Kunde inte hitta mönster"
+
+#: syntax.c:3023
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: Otillåtet argument: %s"
+
+#: syntax.c:3203
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: Inget sådant syntax-kluster: %s"
+
+#: syntax.c:3367
+msgid "No Syntax items defined for this buffer"
+msgstr "Inga syntax-föremål definierade för den här bufferten"
+
+#: syntax.c:3375
+msgid "syncing on C-style comments"
+msgstr "synkning av C-stil-kommentarer"
+
+#: syntax.c:3383
+msgid "no syncing"
+msgstr "ingen synkning"
+
+#: syntax.c:3386
+msgid "syncing starts "
+msgstr "synkning startar"
+
+#: syntax.c:3388 syntax.c:3463
+msgid " lines before top line"
+msgstr " rader före topprad"
+
+#: syntax.c:3393
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Syntax-synkföremål ---"
+
+#: syntax.c:3398
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"synkning av föremål"
+
+#: syntax.c:3404
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Syntax föremål ---"
+
+#: syntax.c:3427
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: Inga sådana syntaxkluster: %s"
+
+#: syntax.c:3453
+msgid "minimal "
+msgstr "minimal "
+
+#: syntax.c:3460
+msgid "maximal "
+msgstr "maximal "
+
+#: syntax.c:3472
+msgid "; match "
+msgstr "; träff "
+
+#: syntax.c:3474
+msgid " line breaks"
+msgstr " radbrytningar"
+
+#: syntax.c:4108
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: grupper inte tillåtna här"
+
+#: syntax.c:4132
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: Hittade inte regionföremål för %s"
+
+#: syntax.c:4160
+msgid "E395: contains argument not accepted here"
+msgstr "E395: innehåller argument som inte är tillåtna här"
+
+#: syntax.c:4171
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: innehöll argument som inte är tillåtna här"
+
+#: syntax.c:4249
+msgid "E397: Filename required"
+msgstr "E397: Filnamn krävs"
+
+#: syntax.c:4587
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: Saknar '=': %s"
+
+#: syntax.c:4745
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: Inte tillräckliga argument: syntaxregion %s"
+
+#: syntax.c:5076
+msgid "E400: No cluster specified"
+msgstr "E400: Inget kluster angivet"
+
+#: syntax.c:5113
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: Mönsteravgränsare hittades inte: %s"
+
+#: syntax.c:5188
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: Skräp efter mönster: %s"
+
+#: syntax.c:5278
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax-synk: radfortsättningsmönster angivet två gånger"
+
+#: syntax.c:5335
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: Otillåtna argument: %s"
+
+#: syntax.c:5385
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: Saknar likamed-tecken: %s"
+
+#: syntax.c:5391
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: Tomt argument: %s"
+
+#: syntax.c:5418
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s inte tillåtet här"
+
+#: syntax.c:5425
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s måste vara först i innehållslista"
+
+#: syntax.c:5495
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: Okänt gruppnamn: %s"
+
+#: syntax.c:5728
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: Ogiltigt :syntax-underkommando: %s"
+
+#: syntax.c:6107
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: framhävningsgrupp hittades inte: %s"
+
+#: syntax.c:6131
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: Inte tillräckliga argument: \":highlight länk %s\""
+
+#: syntax.c:6138
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: För många argument: \":highlight länk %s\""
+
+#: syntax.c:6158
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: grupp har inställningar, framhävningslänk ignorerad"
+
+#: syntax.c:6287
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: oväntat likamed-tecken: %s"
+
+#: syntax.c:6323
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: saknar likamed-tecken: %s"
+
+#: syntax.c:6345
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: saknar argument: %s"
+
+#: syntax.c:6382
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: Otillåtet värde: %s"
+
+#: syntax.c:6501
+msgid "E419: FG color unknown"
+msgstr "E419: FG-färg okänd"
+
+#: syntax.c:6512
+msgid "E420: BG color unknown"
+msgstr "E420: BG-färg okänd"
+
+#: syntax.c:6573
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: Färgnamn eller nummer inte igenkänt: %s"
+
+#: syntax.c:6779
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: terminalkod för lång: %s"
+
+#: syntax.c:6826
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: Otillåtet argument: %s"
+
+#: syntax.c:7355
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: För många olika framhävningsattribut i användning"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: på botten av taggstack"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: på toppen av taggstack"
+
+#: tag.c:396
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: Kan inte gå före första matchande tagg"
+
+#: tag.c:516
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: tagg hittades inte: %s"
+
+#: tag.c:549
+msgid " # pri kind tag"
+msgstr " # pri-typ-tagg"
+
+#: tag.c:552
+msgid "file\n"
+msgstr "fil\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:710
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "Ange nr av val (<CR> för att avbryta): "
+
+#: tag.c:750
+msgid "E427: There is only one matching tag"
+msgstr "E427: Det finns bara en matchande tagg"
+
+#: tag.c:752
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: Kan inte gå bortom sista matchande tagg"
+
+#: tag.c:772
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Fil \"%s\" existerar inte"
+
+#. Give an indication of the number of matching tags
+#: tag.c:785
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "tagg %d av %d%s"
+
+#: tag.c:788
+msgid " or more"
+msgstr " eller fler"
+
+#: tag.c:790
+msgid " Using tag with different case!"
+msgstr " Använder tagg med annan storlek!"
+
+#: tag.c:834
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Fil \"%s\" existerar inte"
+
+#. Highlight title
+#: tag.c:903
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # TILL tagg FRÅN LINJE i fil/text"
+
+#: tag.c:1210
+#, c-format
+msgid "Searching tags file %s"
+msgstr "Söker tagg-fil %s"
+
+#: tag.c:1396
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Taggfilsökväg trunkerades för %s\n"
+
+#: tag.c:1969
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Formateringsfel i tagg-fil \"%s\""
+
+#: tag.c:1973
+#, c-format
+msgid "Before byte %ld"
+msgstr "Före byte %ld"
+
+#: tag.c:1994
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tagg-fil inte sorterad: %s"
+
+#. never opened any tags file
+#: tag.c:2034
+msgid "E433: No tags file"
+msgstr "E433: Ingen tagg-fil"
+
+#: tag.c:2742
+msgid "E434: Can't find tag pattern"
+msgstr "E434: Kan inte hitta taggmönster"
+
+#: tag.c:2753
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: Kunde inte hitta tagg, gissar bara!"
+
+#: term.c:1745
+msgid "' not known. Available builtin terminals are:"
+msgstr "' inte känd. Tillgängliga inbyggda terminaler är:"
+
+#: term.c:1769
+msgid "defaulting to '"
+msgstr "använder standard '"
+
+#: term.c:2127
+msgid "E557: Cannot open termcap file"
+msgstr "E557: Kan inte öppna termcap-fil"
+
+#: term.c:2131
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: Terminalnotering hittades inte i terminfo"
+
+#: term.c:2133
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: Terminalnotering hittades inte i termcap"
+
+#: term.c:2292
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: Ingen \"%s\"-notering i termcap"
+
+#: term.c:2766
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: terminalkapacitet \"cm\" krävs"
+
+#. Highlight title
+#: term.c:4973
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Terminalnycklar ---"
+
+#: ui.c:252
+msgid "new shell started\n"
+msgstr "nytt skal startat\n"
+
+#: ui.c:1791
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Fel vid läsning av inmatning, avslutar...\n"
+
+#. must display the prompt
+#: undo.c:394
+msgid "No undo possible; continue anyway"
+msgstr "Ingen ångring möjlig; fortsätter ändå"
+
+#: undo.c:549
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: radnummer fel"
+
+#: undo.c:718
+msgid "1 change"
+msgstr "1 ändring"
+
+#: undo.c:720
+#, c-format
+msgid "%ld changes"
+msgstr "%ld ändringar"
+
+#: undo.c:764
+msgid "E439: undo list corrupt"
+msgstr "E439: ångra-lista trasig"
+
+#: undo.c:796
+msgid "E440: undo line missing"
+msgstr "E440: ångra-rad saknas"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:1131
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32-bitars GUI-version"
+
+#: version.c:1133
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32-bitars GUI-version"
+
+#: version.c:1136
+msgid " in Win32s mode"
+msgstr " i Win32s-läge"
+
+#: version.c:1138
+msgid " with OLE support"
+msgstr " med OLE-stöd"
+
+#: version.c:1141
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32-bitars konsollversion"
+
+#: version.c:1145
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 16-bitars version"
+
+#: version.c:1149
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32-bitars MS-DOS-version"
+
+#: version.c:1151
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16-bitars MS-DOS-version"
+
+#: version.c:1157
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X-version (unix)"
+
+#: version.c:1159
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X-version"
+
+#: version.c:1162
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS-version"
+
+#: version.c:1167
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS-version"
+
+#: version.c:1177
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"Inkluderade patchar: "
+
+#: version.c:1203 version.c:1571
+msgid "Modified by "
+msgstr "Modifierad av "
+
+#: version.c:1210
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"Kompilerad "
+
+#: version.c:1213
+msgid "by "
+msgstr "av "
+
+#: version.c:1225
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"Enorm version "
+
+#: version.c:1228
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"Stor version "
+
+#: version.c:1231
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Normal version "
+
+#: version.c:1234
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"Liten version "
+
+#: version.c:1236
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"Jätteliten version "
+
+#: version.c:1242
+msgid "without GUI."
+msgstr "utan GUI."
+
+#: version.c:1247
+msgid "with GTK2-GNOME GUI."
+msgstr "med GTK2-GNOME-GUI."
+
+#: version.c:1249
+msgid "with GTK-GNOME GUI."
+msgstr "med GTK-GNOME-GUI."
+
+#: version.c:1253
+msgid "with GTK2 GUI."
+msgstr "med GTK2-GUI."
+
+#: version.c:1255
+msgid "with GTK GUI."
+msgstr "med GTK-GUI."
+
+#: version.c:1260
+msgid "with X11-Motif GUI."
+msgstr "med X11-Motif-GUI."
+
+#: version.c:1264
+msgid "with X11-neXtaw GUI."
+msgstr "med X11-neXtaw-GUI."
+
+#: version.c:1266
+msgid "with X11-Athena GUI."
+msgstr "med X11-Athena-GUI."
+
+#: version.c:1270
+msgid "with BeOS GUI."
+msgstr "med BeOS-GUI."
+
+#: version.c:1273
+msgid "with Photon GUI."
+msgstr "med Photon-GUI."
+
+#: version.c:1276
+msgid "with GUI."
+msgstr "med GUI."
+
+#: version.c:1279
+msgid "with Carbon GUI."
+msgstr "med Carbon-GUI."
+
+#: version.c:1282
+msgid "with Cocoa GUI."
+msgstr "med Cocoa-GUI."
+
+#: version.c:1285
+msgid "with (classic) GUI."
+msgstr "med (klassiskt) GUI."
+
+#: version.c:1296
+msgid " Features included (+) or not (-):\n"
+msgstr " Funktioner inkluderade (+) eller inte (-):\n"
+
+#: version.c:1308
+msgid " system vimrc file: \""
+msgstr " system-vimrc-fil: \""
+
+#: version.c:1313
+msgid " user vimrc file: \""
+msgstr " användar-vimrc-fil: \""
+
+#: version.c:1318
+msgid " 2nd user vimrc file: \""
+msgstr " Andra användar-vimrc-fil: \""
+
+#: version.c:1323
+msgid " 3rd user vimrc file: \""
+msgstr " Tredje användar-vimrc-fil: \""
+
+#: version.c:1328
+msgid " user exrc file: \""
+msgstr " användar-exrc-fil: \""
+
+#: version.c:1333
+msgid " 2nd user exrc file: \""
+msgstr " Andra användar-exrc-fil: \""
+
+#: version.c:1339
+msgid " system gvimrc file: \""
+msgstr " system-gvimrc-fil: \""
+
+#: version.c:1343
+msgid " user gvimrc file: \""
+msgstr " användar-gvimrc-fil: \""
+
+#: version.c:1347
+msgid "2nd user gvimrc file: \""
+msgstr "Andra användar-gvimrc-fil: \""
+
+#: version.c:1352
+msgid "3rd user gvimrc file: \""
+msgstr "Tredje användar-gvimrc-fil: \""
+
+#: version.c:1359
+msgid " system menu file: \""
+msgstr " systemmenyfil: \""
+
+#: version.c:1367
+msgid " fall-back for $VIM: \""
+msgstr " reserv för $VIM: \""
+
+#: version.c:1373
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " reserv för $VIMRUNTIME: \""
+
+#: version.c:1377
+msgid "Compilation: "
+msgstr "Kompilering: "
+
+#: version.c:1383
+msgid "Compiler: "
+msgstr "Kompilator: "
+
+#: version.c:1388
+msgid "Linking: "
+msgstr "Länkning: "
+
+#: version.c:1393
+msgid " DEBUG BUILD"
+msgstr " FELSÖKNINGSBYGGD"
+
+#: version.c:1432
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:1434
+msgid "version "
+msgstr "version "
+
+#: version.c:1435
+msgid "by Bram Moolenaar et al."
+msgstr "av Bram Moolenaar m.fl."
+
+#: version.c:1439
+msgid "Vim is open source and freely distributable"
+msgstr "Vim är öppen källkod och fri att distribuera"
+
+#: version.c:1441
+msgid "Help poor children in Uganda!"
+msgstr "Hjälp fattiga barn i Uganda!"
+
+#: version.c:1442
+msgid "type :help iccf<Enter> for information "
+msgstr "skriv :help iccf<Enter> för information "
+
+#: version.c:1444
+msgid "type :q<Enter> to exit "
+msgstr "skriv :q<Enter> för att avsluta "
+
+#: version.c:1445
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "skriv :help<Enter> eller <F1> för online-hjälp "
+
+#: version.c:1446
+msgid "type :help version6<Enter> for version info"
+msgstr "skriv :help version6<Enter> för versioninformation "
+
+#: version.c:1449
+msgid "Running in Vi compatible mode"
+msgstr "Kör i Vi-kompatibelt läge"
+
+#: version.c:1450
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "skriv :set nocp<Enter> för Vim- standarder "
+
+#: version.c:1451
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "skriv :help cp-default<Enter> för information om det här"
+
+#: version.c:1466
+msgid "menu Help->Orphans for information "
+msgstr "meny Hjälp->Föräldralösa för information "
+
+#: version.c:1468
+msgid "Running modeless, typed text is inserted"
+msgstr "Kör lägeslöst, skriven text blir infogad"
+
+#: version.c:1469
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "meny Redigera->Globala inställningar->Växla infogningsläge "
+
+#: version.c:1470
+msgid " for two modes "
+msgstr " för två lägen "
+
+#: version.c:1474
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "meny Redigera->Globala Inställningar->Växla Vi Komptaibel"
+
+#: version.c:1475
+msgid " for Vim defaults "
+msgstr " för vim-standardalternativ "
+
+#: version.c:1522
+msgid "Sponsor Vim development!"
+msgstr "Stöd utvecklingen av Vim!"
+
+#: version.c:1523
+msgid "Become a registered Vim user!"
+msgstr "Bli en registrerad Vim-användare!"
+
+#: version.c:1526
+msgid "type :help sponsor<Enter> for information "
+msgstr "skriv :help sponsor<Enter> för information "
+
+#: version.c:1527
+msgid "type :help register<Enter> for information "
+msgstr "skriv :help register<Enter> för information "
+
+#: version.c:1529
+msgid "menu Help->Sponsor/Register for information "
+msgstr "meny Hjälp->Stöd/Registrera för information "
+
+#: version.c:1539
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "VARNING: Windows 95/98/ME upptäckt"
+
+#: version.c:1542
+msgid "type :help windows95<Enter> for info on this"
+msgstr "skriv :help windows95<Enter> för info om det här"
+
+#: window.c:203
+msgid "E441: There is no preview window"
+msgstr "E441: Det finns inget förhandsvisningsfönster"
+
+#: window.c:581
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: Kan inte dela toppvänster och bottenhöger samtidigt"
+
+#: window.c:1340
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: Kan inte rotera när ett annat fönster är delat"
+
+#: window.c:1835
+msgid "E444: Cannot close last window"
+msgstr "E444: Kan inte stänga senaste fönstret"
+
+#: window.c:2566
+msgid "Already only one window"
+msgstr "Redan bara ett fönster"
+
+#: window.c:2613
+msgid "E445: Other window contains changes"
+msgstr "E445: Andra fönster innehåller ändringar"
+
+#: window.c:4474
+msgid "E446: No file name under cursor"
+msgstr "E446: Inget filnamn under markör"
+
+#: window.c:4593
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: Kan inte hitta fil \"%s\" i sökväg"
+
+#: globals.h:1209 if_perl.xs:326
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: Kunde inte läsa in bibliotek %s"
+
+#: if_perl.xs:554
+msgid "Sorry, this command is disabled: the Perl library could not be loaded."
+msgstr ""
+"Tyvärr, det här kommandot är inaktiverat: Perl-biblioteket kunde inte läsas "
+"in."
+
+#: if_perl.xs:600
+msgid "E299: Perl evaluation forbidden in sandbox without the Safe module"
+msgstr "E299: Perl-evaluering förbjuden i sandlåda utan Safe-modulen"
+
+#: GvimExt/gvimext.cpp:583
+msgid "Edit with &multiple Vims"
+msgstr "Redigera med &flera Vims"
+
+#: GvimExt/gvimext.cpp:589
+msgid "Edit with single &Vim"
+msgstr "Redigera med en &Vim"
+
+#: GvimExt/gvimext.cpp:598
+msgid "&Diff with Vim"
+msgstr "&Diff med Vim"
+
+#: GvimExt/gvimext.cpp:611
+msgid "Edit with &Vim"
+msgstr "Redigera med &Vim"
+
+#. Now concatenate
+#: GvimExt/gvimext.cpp:633
+msgid "Edit with existing Vim - &"
+msgstr "Redigera med befintlig Vim - &"
+
+#: GvimExt/gvimext.cpp:746
+msgid "Edits the selected file(s) with Vim"
+msgstr "Redigerar markerade fil(erna) med Vim"
+
+#: GvimExt/gvimext.cpp:885 GvimExt/gvimext.cpp:966
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "Felskapande process: Kontrollera om gvim är i din sökväg!"
+
+#: GvimExt/gvimext.cpp:886 GvimExt/gvimext.cpp:900 GvimExt/gvimext.cpp:967
+msgid "gvimext.dll error"
+msgstr "gvimext.dll-fel"
+
+#: GvimExt/gvimext.cpp:899
+msgid "Path length too long!"
+msgstr "Sökvägslängd för lång!"
+
+#: globals.h:999
+msgid "--No lines in buffer--"
+msgstr "--Inga rader i buffert--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1162
+msgid "E470: Command aborted"
+msgstr "E470: Kommando avbrutet"
+
+#: globals.h:1163
+msgid "E471: Argument required"
+msgstr "E471: Argument krävs"
+
+#: globals.h:1164
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ borde följas av /, ? eller &"
+
+#: globals.h:1166
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: Felaktighet i kommandoradsfönster; <CR> kör, CTRL-C avslutar"
+
+#: globals.h:1168
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr ""
+"E12: Kommando inte tillåtet från exrc/vimrc i aktuell katalog eller "
+"taggsökning"
+
+#: globals.h:1170
+msgid "E171: Missing :endif"
+msgstr "E171: Saknar :endif"
+
+#: globals.h:1171
+msgid "E600: Missing :endtry"
+msgstr "E600: Saknar :endtry"
+
+#: globals.h:1172
+msgid "E170: Missing :endwhile"
+msgstr "E170: Saknar :endwhile"
+
+#: globals.h:1173
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile utan :while"
+
+#: globals.h:1175
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Fil existerar (lägg till ! för att tvinga)"
+
+#: globals.h:1176
+msgid "E472: Command failed"
+msgstr "E472: Kommando misslyckades"
+
+#: globals.h:1178
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: Okänd typsnittsuppsättning: %s"
+
+#: globals.h:1182
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "E235: Okänt typsnitt: %s"
+
+#: globals.h:1185
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: Typsnitt \"%s\" är inte bredd-fixerad"
+
+#: globals.h:1187
+msgid "E473: Internal error"
+msgstr "E473: Internt fel"
+
+#: globals.h:1188
+msgid "Interrupted"
+msgstr "Avbruten"
+
+#: globals.h:1189
+msgid "E14: Invalid address"
+msgstr "E14: Ogiltig address"
+
+#: globals.h:1190
+msgid "E474: Invalid argument"
+msgstr "E474: Ogiltigt argument"
+
+#: globals.h:1191
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: Ogiltigt argument: %s"
+
+#: globals.h:1193
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: Ogiltigt uttryck: %s"
+
+#: globals.h:1195
+msgid "E16: Invalid range"
+msgstr "E16: Ogiltigt område"
+
+#: globals.h:1196
+msgid "E476: Invalid command"
+msgstr "E476: Ogiltigt kommando"
+
+#: globals.h:1198
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" är en katalog"
+
+#: globals.h:1201
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: Oväntade tecken före '='"
+
+#: globals.h:1204
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: Biblioteksanrop misslyckades för \"%s()\""
+
+#: globals.h:1210
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: Kunde inte läsa in biblioteksfunktion %s"
+
+#: globals.h:1212
+msgid "E19: Mark has invalid line number"
+msgstr "E19: Markering har ogiltigt radnummer"
+
+#: globals.h:1213
+msgid "E20: Mark not set"
+msgstr "E20: Markering inte satt"
+
+#: globals.h:1214
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: Kan inte göra ändringar, 'modifiable' är av"
+
+#: globals.h:1215
+msgid "E22: Scripts nested too deep"
+msgstr "E22: Skript nästlade för djupt"
+
+#: globals.h:1216
+msgid "E23: No alternate file"
+msgstr "E23: Ingen alternativ fil"
+
+#: globals.h:1217
+msgid "E24: No such abbreviation"
+msgstr "E24: Ingen sådan förkortning"
+
+#: globals.h:1218
+msgid "E477: No ! allowed"
+msgstr "E477: Inget ! tillåtet"
+
+#: globals.h:1220
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI kan inte användas: Inte aktiverat vid kompilering"
+
+#: globals.h:1223
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: Hebreiska kan inte användas: Inte aktiverat vid kompilering\n"
+
+#: globals.h:1226
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: Persiska kan inte användas: Inte aktiverat vid kompilering\n"
+
+#: globals.h:1229
+msgid "E800: Arabic cannot be used: Not enabled at compile time\n"
+msgstr "E800: Arabiska kan inte användas: Inte aktiverat vid kompilering\n"
+
+#: globals.h:1232
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: Inget sådant framhävningsgruppnamn: %s"
+
+#: globals.h:1234
+msgid "E29: No inserted text yet"
+msgstr "E29: Ingen infogad text än"
+
+#: globals.h:1235
+msgid "E30: No previous command line"
+msgstr "E30: Ingen tidigare kommandorad"
+
+#: globals.h:1236
+msgid "E31: No such mapping"
+msgstr "E31: Ingen sådan mappning"
+
+#: globals.h:1237
+msgid "E479: No match"
+msgstr "E479: Ingen träff"
+
+#: globals.h:1238
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: Ingen träff: %s"
+
+#: globals.h:1239
+msgid "E32: No file name"
+msgstr "E32: Inget filnamn"
+
+#: globals.h:1240
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: Inget tidigare utbytningsreguljäruttryck"
+
+#: globals.h:1241
+msgid "E34: No previous command"
+msgstr "E34: Inget tidigare kommando"
+
+#: globals.h:1242
+msgid "E35: No previous regular expression"
+msgstr "E35: Inget tidigare reguljärt uttryck"
+
+#: globals.h:1243
+msgid "E481: No range allowed"
+msgstr "E481: Inget område tillåtet"
+
+#: globals.h:1245
+msgid "E36: Not enough room"
+msgstr "E36: Inte tillräckligt med utrymme"
+
+#: globals.h:1248
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ingen registrerad server med namnet \"%s\""
+
+#: globals.h:1250
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: Kan inte skapa fil %s"
+
+#: globals.h:1251
+msgid "E483: Can't get temp file name"
+msgstr "E483: Kan inte hämta temporärt filnamn"
+
+#: globals.h:1252
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: Kan inte öppna fil %s"
+
+#: globals.h:1253
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: Kan inte läsa fil %s"
+
+#: globals.h:1254
+msgid "E37: No write since last change (add ! to override)"
+msgstr ""
+"E37: Ingen skrivning sedan senaste ändring (lägg till ! för att tvinga)"
+
+#: globals.h:1255
+msgid "E38: Null argument"
+msgstr "E38: Null-argument"
+
+#: globals.h:1257
+msgid "E39: Number expected"
+msgstr "E39: Nummer väntat"
+
+#: globals.h:1260
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: Kan inte öppna felfil %s"
+
+#: globals.h:1263
+msgid "E233: cannot open display"
+msgstr "E233: kan inte öppna display"
+
+#: globals.h:1265
+msgid "E41: Out of memory!"
+msgstr "E41: Slut på minne!"
+
+#: globals.h:1267
+msgid "Pattern not found"
+msgstr "Mönster hittades inte"
+
+#: globals.h:1269
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: Mönster hittades inte: %s"
+
+#: globals.h:1270
+msgid "E487: Argument must be positive"
+msgstr "E487: Argument måste vara positivt"
+
+#: globals.h:1272
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: Kan inte gå tillbaka till tidigare katalog"
+
+#: globals.h:1276
+msgid "E42: No Errors"
+msgstr "E42: Inga fel"
+
+#: globals.h:1278
+msgid "E43: Damaged match string"
+msgstr "E43: Skadad träffsträng"
+
+#: globals.h:1279
+msgid "E44: Corrupted regexp program"
+msgstr "E44: Trasigt program för reguljära uttryck"
+
+#: globals.h:1280
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 'readonly' flagga är satt (lägg till ! för att tvinga)"
+
+#: globals.h:1282
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: Kan inte sätta skrivskyddad variabel \"%s\""
+
+#: globals.h:1285
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Fel vid läsning av felfil"
+
+#: globals.h:1288
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: Inte tillåtet i sandlåda"
+
+#: globals.h:1290
+msgid "E523: Not allowed here"
+msgstr "E523: Inte tillåtet här"
+
+#: globals.h:1293
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: Skärmläge inställning inte stödd"
+
+#: globals.h:1295
+msgid "E49: Invalid scroll size"
+msgstr "E49: Ogiltig rullningsstorlek"
+
+#: globals.h:1296
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'shell' flagga är tom"
+
+#: globals.h:1298
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: Kunde inte läsa in teckendata!"
+
+#: globals.h:1300
+msgid "E72: Close error on swap file"
+msgstr "E72: Stängningsfel på växlingsfil"
+
+#: globals.h:1301
+msgid "E73: tag stack empty"
+msgstr "E73: taggstack tom"
+
+#: globals.h:1302
+msgid "E74: Command too complex"
+msgstr "E74: Kommando för komplext"
+
+#: globals.h:1303
+msgid "E75: Name too long"
+msgstr "E75: Namn för långt"
+
+#: globals.h:1304
+msgid "E76: Too many ["
+msgstr "E76: För många ["
+
+#: globals.h:1305
+msgid "E77: Too many file names"
+msgstr "E77: För många filnamn"
+
+#: globals.h:1306
+msgid "E488: Trailing characters"
+msgstr "E488: Eftersläpande tecken"
+
+#: globals.h:1307
+msgid "E78: Unknown mark"
+msgstr "E78: Okänt märke"
+
+#: globals.h:1308
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: Kan inte expandera jokertecken"
+
+#: globals.h:1310
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' kan inte vara mindre än 'winminheight'"
+
+#: globals.h:1312
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' kan inte vara mindre än 'winminwidth'"
+
+#: globals.h:1315
+msgid "E80: Error while writing"
+msgstr "E80: Fel vid skrivning"
+
+#: globals.h:1316
+msgid "Zero count"
+msgstr "Noll-längd"
+
+#: globals.h:1318
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: Använder inte <SID> i ett skriptsammanhang"
+
+#: globals.h:1321
+msgid "E449: Invalid expression received"
+msgstr "E449: Ogiltigt uttryck mottaget"
+
+#: globals.h:1324
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: Region är vaktad, kan inte modifiera"
+
+#~ msgid "E86: Cannot go to buffer %ld"
+#~ msgstr "E85: Kan inte gå till buffert %ld"
diff --git a/src/po/uk.po b/src/po/uk.po
new file mode 100644
index 000000000..f8223d3f2
--- /dev/null
+++ b/src/po/uk.po
@@ -0,0 +1,6225 @@
+#
+# Ukrainian Vim translation [uk]
+#
+# Copyright (C) 2001 Bohdan Vlasyuk <bohdan@vstu.edu.ua>
+#
+# Thanks to:
+# Dmytro Kovalov <dmytro.kovalov@nssmb.com> for useful suggestions
+# Dmytro O. Redchuk <dor@kiev-online.net> for viminfo bug
+#
+# Please, see readme at htpp://www.vstu.edu.ua/~bohdan/vim before any
+# complains, and even if you won't complain, read it anyway.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vim 6.0\n"
+"POT-Creation-Date: 2002-01-10 09:03+0200\n"
+"PO-Revision-Date: 2001-10-16 13:34+0300\n"
+"Last-Translator: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
+"Language-Team: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=koi8-u\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: îÅÍÁ¤ ÍÏÖÌÉ×ÏÓÔ¦ ÒÏÚͦÓÔÉÔÉ ÈÏÞ ÏÄÉÎ ÂÕÆÅÒ, ÚÁ×ÅÒÛÅÎÎÑ ÒÏÂÏÔÉ..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: îÅÍÁ¤ ÍÏÖÌÉ×ÏÓÔ¦ ÒÏÚͦÓÔÉÔÉ ÂÕÆÅÒ, ÂÕÄÅ ×ÉËÏÒÉÓÔÁÎÏ ¦ÎÛÉÊ..."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "öÏÄÅÎ Ú ÂÕÆÅÒ¦× ÎÅ ÂÕ× ×É×ÁÎÔÁÖÅÎÉÊ"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "öÏÄÅÎ Ú ÂÕÆÅÒ¦× ÎÅ ÂÕ× ×ÉÄÁÌÅÎÉÊ"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "öÏÄÅÎ Ú ÂÕÆÅÒ¦× ÎÅ ÂÕ× ×ÉÔÅÒÔÉÊ"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "÷É×ÁÎÔÁÖÅÎÏ ÏÄÉÎ ÂÕÆÅÒ"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "÷É×ÁÎÔÁÖÅÎÏ ÂÕÆÅÒ¦× -- %d"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "÷ÉÄÁÌÅÎÏ ÏÄÉÎ ÂÕÆÅÒ"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "÷ÉÄÁÌÅÎÏ ÂÕÆÅÒ¦× -- %d"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "÷ÉÔÅÒÔÏ ÏÄÉÎ ÂÕÆÅÒ"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "÷ÉÔÅÒÔÏ ÂÕÆÅÒ¦× -- %d"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: öÏÄÅÎ ÂÕÆÅÒ ÎÅ ÚͦÎÅÎÏ"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: õ ÓÐÉÓËÕ ÎÅÍÁ¤ ÂÕÆÅÒ¦×"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ × ÂÕÆÅÒ %ld"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÎÁÓÔÕÐÎÉÊ ÂÕÆÅÒ Ú ÏÓÔÁÎÎØÏÇÏ"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÐÏÐÅÒÅÄÎ¦Ê ÂÕÆÅÒ Ú ÐÅÒÛÏÇÏ"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr ""
+"E89: âÕÆÅÒ %ld ÎÅ ÚÁÐÉÓÁÎÉÊ Ð¦ÓÌÑ ÏÓÔÁÎÎØϧ ÚͦÎÉ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ "
+"Ú×ÁÖÁÔÉ)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: îÅ ÍÏÖÕ ×É×ÁÎÔÁÖÉÔÉ ÏÓÔÁÎÎ¦Ê ÂÕÆÅÒ"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ïÂÅÒÅÖÎÏ: óÐÉÓÏË ¦ÍÅÎ ÆÁÊÌ¦× ÐÅÒÅÐÏ×ÎÅÎÏ"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: âÕÆÅÒ %ld ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: úÎÁÊÄÅÎÏ Â¦ÌØÛÅ Î¦Ö ÏÄÉÎ ×ÁÒ¦ÁÎÔ ÄÌÑ %s"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: îÅ ÚÎÁÊÄÅÎÏ ×ÁÒ¦ÁÎÔ¦× ÄÌÑ %s"
+
+#: buffer.c:2105 ex_docmd.c:6066
+#, c-format
+msgid "line %ld"
+msgstr "ÒÑÄÏË %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: âÕÆÅÒ Ú ÔÁËÏÀ ÎÁÚ×ÏÀ ÕÖÅ ¦ÓÎÕ¤"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr "[úͦÎÅÎÏ]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[îÅ ÂÕÌÏ ÒÅÄÁÇÏ×ÁÎÏ]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[îÏ×ÉÊ ÆÁÊÌ]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[ðÏÍÉÌËÁ ÚÞÉÔÕ×ÁÎÎÑ]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[ÌÉÛÅ ÞÉÔÁÔÉ]"
+
+#: buffer.c:2510
+msgid "1 line --%d%%--"
+msgstr "ÏÄÉÎ ÒÑÄÏË --%d%%--"
+
+#: buffer.c:2510
+msgid "%ld lines --%d%%--"
+msgstr "(ÒÑÄ˦×: %ld) --%d%%--"
+
+#: buffer.c:2518
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ÒÑÄÏË %ld Ú %ld --%d%%-- ËÏÌÏÎËÁ"
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[îÏ×ÉÊ ÆÁÊÌ]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "ÄÏÐÏÍÏÇÁ"
+
+#: buffer.c:3151 screen.c:4691
+msgid "[help]"
+msgstr "[ÄÏÐÏÍÏÇÁ]"
+
+#: buffer.c:3183 screen.c:4697
+msgid "[Preview]"
+msgstr "[ÐÅÒÅÇÌÑÄ]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "õÓÅ"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "õÎÉÚÕ"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "÷ÇÏÒ¦"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# óÐÉÓÏË ÂÕÆÅÒ¦×:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[óÐÉÓÏË ÐÏÍÉÌÏË]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[îÏ×ÉÊ ÆÁÊÌ]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- úÎÁËÉ ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "úÎÁËÉ ÄÌÑ %s:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ÒÑÄÏË=%ld id=%d ¦Í'Ñ=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: îÅ ÍÏÖÕ ÐÏÒ¦×ÎÀ×ÁÔÉ ÐÏÎÁÄ %ld ÂÕÆÅÒ¦× "
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: îÅÍÏÖÎÁ ÓÔ×ÏÒÉÔÉ diff'É"
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "patch-ÆÁÊÌ"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: îÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ÒÅÚÕÌØÔÁÔ diff'Õ"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ãÅÊ ÂÕÆÅÒ ÎÅ × ÒÅÖÉͦ diff"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: îÅÍÁÅ ¦ÎÛÉÈ ÂÕÆÅÒ¦× × ÒÅÖÉͦ diff"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr ""
+"E101: ðÏÎÁÄ Ä×Á ÂÕÆÅÒÁ ÚÎÁÈÏÄÑÔØÓÑ × ÒÅÖÉͦ diff, ÎÅ ÚÒÏÚÕͦÌÏ ÑËÉÊ Ú ÎÉÈ "
+"×ÉËÏÒÉÓÔÁÔÉ"
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: âÕÆÅÒ \"%s\" ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: âÕÆÅÒ \"%s\" ÎÅ × ÒÅÖÉͦ diff"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: õ ÄÉÇÒÁÆÁÈ ÎÅ ÍÏÖŠͦÓÔÉÔÉÓÑ Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "æÁÊÌ ÒÏÚËÌÁÄËÉ ËÌÁצÁÔÕÒÉ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ÷ÉËÏÒÉÓÔÁÎÎÑ :loadkeymap ÎÅ × ÆÁÊ̦ ËÏÍÁÎÄ"
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " äÏÐÏ×ÎÅÎÎÑ ËÌÀÞÏ×ÉÈ ÓÌ¦× (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " òÅÖÉÍ ^X (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ Í¦ÓÃÅ×ÉÈ ËÌÀÞÏ×ÉÈ ÓÌ¦× (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ÕÓØÏÇÏ ÒÑÄËÁ (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ¦ÍÅΦ ÆÁÊÌÁ (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ÐÏͦÔÏË (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ÛÌÑÈÕ ÚÁ ÚÒÁÚËÏÍ (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ×ÉÚÎÁÞÅÎÎÑ (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ Ú ÓÌÏ×ÎÉËÁ (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ Ú ¦ÄÅÏÇÒÁÍÁÔÉÞÎÏÇÏ ÓÌÏ×ÎÉËÁ (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " äÏ×ÅÒÛÅÎÎÑ ËÏÍÁÎÄ (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "äÏÓÑÇÎÕÔÏ Ë¦ÎÅÃØ ÐÁÒÁÇÒÁÆÁ"
+
+#: edit.c:899
+msgid "'thesaurus' option is empty"
+msgstr "ÏÐÃ¦Ñ 'thesaurus' ÐÕÓÔÁ"
+
+#: edit.c:1075
+msgid "'dictionary' option is empty"
+msgstr "ÏÐÃ¦Ñ 'dictionary' ÐÕÓÔÁ"
+
+#: edit.c:1997
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "ÚÞÉÔÕÅÍÏ ÄÉÒÅËÔÏÒ¦À: %s"
+
+#: edit.c:2188
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (×ÓÔÁ×ËÁ) úÓÕ× (^E/^Y)"
+
+#: edit.c:2190
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (ÚÁͦÎÁ) úÓÕ× (^E/^Y)"
+
+#: edit.c:2501
+#, c-format
+msgid "Scanning: %s"
+msgstr "ðÏÛÕË Õ: %s"
+
+#: edit.c:2536
+msgid "Scanning tags."
+msgstr "ðÏÛÕË ÓÅÒÅÄ ÐÏͦÔÏË."
+
+#: edit.c:3194
+msgid " Adding"
+msgstr " äÏÄÁ¤ÍÏ"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3243
+msgid "-- Searching..."
+msgstr "-- ðÏÛÕË..."
+
+#: edit.c:3299
+msgid "Back at original"
+msgstr "îÁÚÁÄ ÄÏ ÐÏÞÁÔËÏ×ÏÇÏ ×ÁÒ¦ÁÎÔÕ"
+
+#: edit.c:3304
+msgid "Word from other line"
+msgstr "óÌÏ×Ï Ú ¦ÎÛÏÇÏ ÒÑÄËÁ"
+
+#: edit.c:3309
+msgid "The only match"
+msgstr "åÄÉÎÉÊ ×ÁÒ¦ÁÎÔ"
+
+#: edit.c:3368
+#, c-format
+msgid "match %d of %d"
+msgstr " ×ÁÒ¦ÁÎÔ %d Ú %d"
+
+#: edit.c:3371
+#, c-format
+msgid "match %d"
+msgstr "×ÁÒ¦ÁÎÔ %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: îÅצÄÏÍÁ ÚͦÎÎÁ: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: îÅÍÁÅ ÄÕÖÏË: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: úͦÎÎÁ ÎÅ ¦ÓÎÕ¤: \"%s\""
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: îÅÍÁÅ ':' ЦÓÌÑ '?'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: îÅÍÁ¤ ')'"
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: îÅÍÁ¤ ']'"
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: îÅÍÁ¤ ÎÁÚ×É ÏÐæ§: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: îÅצÄÏÍÁ ÏÐæÑ: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: îÅ ×ÉÓÔÁÞÁ¤ ÌÁÐËÉ: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ÷ÔÒÁÞÅÎÉÊ ÓÉÍ×ÏÌ '\"': %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: îÅצÒΦ ÁÒÇÕÍÅÎÔÉ ÄÌÑ ÆÕÎËæ§ %s"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: îÅצÄÏÍÁ ÆÕÎËæÑ: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: úÁÂÁÇÁÔÏ ÁÒÇÕÍÅÎÔ¦× ÄÌÑ ÆÕÎËæ§ %s"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: úÁÍÁÌÏ ÁÒÇÕÍÅÎÔ¦× ÄÌÑ ÆÕÎËæ§ %s"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ ÎÅ Õ ÆÁÊ̦ ËÏÍÁÎÄ: %s"
+
+#: eval.c:3575
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld: "
+
+#: eval.c:4690
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"&O:çÁÒÁÚÄ\n"
+"&C:÷¦ÄͦÎÁ"
+
+#: eval.c:5514
+msgid "E240: No connection to Vim server"
+msgstr "E240: îÅÍÁ¤ Ú'¤ÄÎÁÎÎÑ Ú Vim-ÓÅÒ×ÅÒÏÍ"
+
+#: eval.c:5604
+msgid "E277: Unable to read a server reply"
+msgstr "E277: îÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ×¦ÄÐÏצÄØ ÓÅÒ×ÅÒÁ"
+
+#: eval.c:5629
+msgid "E258: Unable to send to client"
+msgstr "E258: îÅ ÍÏÖÕ ÓЦÌËÕ×ÁÔÉÓÑ Ë̦¤ÎÔÏÍ"
+
+#: eval.c:5670
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: îÅ ÍÏÖÕ ÓЦÌËÕ×ÁÔÉÓÑ Ú %s"
+
+#: eval.c:5768
+msgid "(Invalid)"
+msgstr "(îÅÍÏÖÌÉ×Ï)"
+
+#: eval.c:6771
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: îÅ×ÉÚÎÁÞÅÎÁ ÚͦÎÎÁ: %s"
+
+#: eval.c:7469
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: æÕÎËÃ¦Ñ %s ÕÖÅ ¦ÓÎÕ¤ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÚÁͦÎÉÔÉ)"
+
+#: eval.c:7511
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: îÅ×ÉÚÎÁÞÅÎÁ ÆÕÎËæÑ: %s"
+
+#: eval.c:7524
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: âÒÁËÕ¤ '(': %s"
+
+#: eval.c:7556
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: îÅÄÏÚ×ÏÌÅÎÉÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: eval.c:7642
+msgid "E126: Missing :endfunction"
+msgstr "E126: âÒÁËÕ¤ :endfunction"
+
+#: eval.c:7721
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: îÅ ÍÏÖÕ ÚÁͦÎÉÔÉ ÆÕÎËæÀ %s: ÷ÏÎÁ ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ"
+
+#: eval.c:7778
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: îÁÚ×Á ÆÕÎËæ§ ÍÁ¤ ÐÏÞÉÎÁÔÉÑ Ú ×ÅÌÉËϧ ̦ÔÅÒÉ: %s"
+
+#: eval.c:7784
+msgid "E129: Function name required"
+msgstr "E129: îÅ ×ËÁÚÁÎÁ ÎÁÚ×Á ÆÕÎËæ§"
+
+#: eval.c:7877
+msgid "function "
+msgstr "ÆÕÎËÃ¦Ñ "
+
+#: eval.c:7992
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: îÅ×ÉÚÎÁÞÅÎÁ ÆÕÎËæÑ: %s"
+
+#: eval.c:7997
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÆÕÎËæÀ %s: ÷ÏÎÁ ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ"
+
+#: eval.c:8044
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: çÌÉÂÉÎÁ ×ÉËÌÉË¦× ÆÕÎËæ§ ÐÅÒÅ×ÉÝÕ¤ 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8095
+#, c-format
+msgid "calling %s"
+msgstr "×ÉËÌÉËÁ¤ÔØÓÑ %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8120 ex_cmds2.c:1988
+#, c-format
+msgid "continuing in %s"
+msgstr "ÐÒÏÄÏ×ÖÅÎÎÑ × %s"
+
+#: eval.c:8174
+msgid "E133: :return not inside a function"
+msgstr "E133: :return ÐÏÚÁ ÍÅÖÁÍÉ ÆÕÎËæ§"
+
+#: eval.c:8252
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ÐÏ×ÅÒÔÁ¤ #%ld"
+
+#: eval.c:8255
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ÐÏ×ÅÒÔÁ¤ \"%s\""
+
+#: eval.c:8396
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ÚÁÇÁÌØΦ ÚͦÎΦ:\n"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "ðÏÞÁÔÏË ÒÅÖÉÍÕ ÎÁÌÁÇÏÄÖÕ×ÁÎÎÑ. ÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ \"cont\" ÄÌÑ ×ÉÈÏÄÕ."
+
+#: ex_cmds2.c:74 ex_docmd.c:770
+#, c-format
+msgid "line %ld: %s"
+msgstr "ÒÑÄÏË %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "ËÏÍÁÎÄÁ: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "úÕÐÉÎËÁ × \"%s%s\" ÒÑÄÏË %ld"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ôÏÞËÕ ÚÕÐÉÎËÉ ÎÅ ÚÎÁÊÄÅÎÏ: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "öÏÄÎϧ ÔÏÞËÉ ÚÕÐÉÎËÉ ÎÅ ÂÕÌÏ ×ÉÚÎÁÞÅÎÏ"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ÒÑÄÏË %ld"
+
+#: ex_cmds.c:2053 ex_cmds.c:2310 ex_cmds2.c:602
+msgid "Save As"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÑË"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÚͦÎÉ × \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8646
+msgid "Untitled"
+msgstr "îÅÎÁÚ×ÁÎÉÊ"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: öÏÄÎÏÇÏ ÚÁÐÉÓÕ Ð¦ÓÌÑ ÏÓÔÁÎÎØϧ ÚͦÎÉ ÄÌÑ ÂÕÆÅÒÁ \"%s\""
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr ""
+"ïÂÅÒÅÖÎÏ: îÅÓÐÏĦ×ÁÎÏ ÐÏÔÒÁÐÔÌÅÎÏ × ¦ÎÛÉÊ ÂÕÆÅÒ (ÐÅÒÅצÒÔÅ Á×ÔÏËÏÍÁÎÄÉ)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: ìÉÛÅ ÏÄÉÎ ÆÁÊÌ ÒÅÄÁÇÕ¤ÔØÓÑ"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÐÏÐÅÒÅÄÎ¦Ê ÆÁÊÌ Ú ÐÅÒÛÏÇÏ"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ Õ ÎÁÓÔÕÐÎÉÊ ÆÁÊÌ Ú ÏÓÔÁÎÎØÏÇÏ"
+
+# msgstr "E195: "
+#: ex_cmds2.c:1634
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "ðÏÛÕË \"%s\" × \"%s\""
+
+#: ex_cmds2.c:1656
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "ðÏÛÕË \"%s\""
+
+#: ex_cmds2.c:1680
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "\"%s\" ÎÅ ÚÎÁÊÄÅÎÏ × 'runtimepath'"
+
+#: ex_cmds2.c:1714
+msgid "Run Macro"
+msgstr "÷ÉËÏÎÁÔÉ ÆÁÊÌ ËÏÍÁÎÄ"
+
+#: ex_cmds2.c:1832
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ ÄÉÒÅËÔÏÒ¦À: \"%s\""
+
+#: ex_cmds2.c:1862
+#, c-format
+msgid "could not source \"%s\""
+msgstr "ÎÅÍÏÖÌÉ×Ï ×ÉËÏÎÁÔÉ \"%s\""
+
+#: ex_cmds2.c:1864
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "ÒÑÄÏË %ld: ÎÅÍÏÖÌÉ×Ï ×ÉËÏÎÁÔÉ \"%s\""
+
+#: ex_cmds2.c:1878
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "×ÉËÏÎÕÅÔØÓÑ \"%s\""
+
+#: ex_cmds2.c:1880
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "ÒÑÄÏË %ld: ×ÉËÏÎÕ¤ÔØÓÑ \"%s\""
+
+#: ex_cmds2.c:1986
+#, c-format
+msgid "finished sourcing %s"
+msgstr "×ÉËÏÎÁÎÎÑ %s ÚÁ˦ÎÞÅÎÏ"
+
+#: ex_cmds2.c:2287
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: îÅצÒÎÉÊ ÒÏÚĦÌØÎÉË ÒÑÄ˦×, ÍÏÖÌÉ×Ï ÂÒÁËÕ¤ ^M"
+
+#: ex_cmds2.c:2336
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: :scriptencoding ×ÉËÏÒÉÓÔÁÎÏ ÐÏÚÁ ×ÉËÏÎÕ×ÁÎÉÍ ÆÁÊÌÏÍ"
+
+#: ex_cmds2.c:2369
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: :finish ×ÉËÏÒÉÓÔÁÎÏ ÐÏÚÁ ×ÉËÏÎÕ×ÁÎÉÍ ÆÁÊÌÏÍ"
+
+#: ex_cmds2.c:2835
+msgid "No text to be printed"
+msgstr "î¦ÞÏÇÏ ÄÒÕËÕ×ÁÔÉ"
+
+#: ex_cmds2.c:2913
+msgid "Printing page %d (%d%%)"
+msgstr "äÒÕËÕ¤ÔØÓÑ ÓÔÏÒ¦ÎËÁ %d (%d)"
+
+#: ex_cmds2.c:2922
+#, c-format
+msgid " Copy %d of %d"
+msgstr " ëÏÐ¦Ñ %d, ÕÓØÏÇÏ %d"
+
+#: ex_cmds2.c:2974
+#, c-format
+msgid "Printed: %s"
+msgstr "îÁÄÒÕËÏ×ÁÎÏ: %s"
+
+#: ex_cmds2.c:2981
+msgid "Printing aborted"
+msgstr "äÒÕË ÐÅÒÅÒ×ÁÎÏ"
+
+#: ex_cmds2.c:3359
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: îÅ ÍÏÖÕ ÐÉÓÁÔÉ × ×ÉȦÄÎÉÊ ÆÁÊÌ PostScrip"
+
+#: ex_cmds2.c:4034
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÑË ×ȦÄÎÉÊ ÆÁÊÌ PostScrip"
+
+#: ex_cmds2.c:4072
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ \"%s\""
+
+#: ex_cmds2.c:4083
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: îÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ÆÁÊÌ ÒÅÓÕÒÓ¦× PostScrip \"%s\""
+
+#: ex_cmds2.c:4281
+msgid "Sending to printer..."
+msgstr "÷¦ÄÓÉÌÁ¤ÍÏ ÎÁ ÄÒÕ˦×ÎÉË..."
+
+#: ex_cmds2.c:4285
+msgid "E365: Failed to print PostScript file"
+msgstr "E324: îÅ ÍÏÖÕ ÎÁÄÒÕËÕ×ÁÔÉ ÆÁÊÌ PostScrip"
+
+#: ex_cmds2.c:4287
+msgid "Print job sent."
+msgstr "úÁ×ÄÁÎÎÑ ÄÒÕËÕ ×¦Ä¦ÓÌÁÎÏ."
+
+#: ex_cmds2.c:4683
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "íÏ×Á (%s): \"%s\""
+
+#: ex_cmds2.c:4694
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: îÅ ÍÏÖÕ ×ÓÔÁÎÏ×ÉÔÉ ÍÏ×Õ \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Û¦Ó %02x, ×¦Ó %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: îÅÍÏÖÌÉ×Ï ÚͦÓÔÉÔÉ ÒÑÄËÉ ÓÁͦ Õ ÓÅÂÅ"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "1 ÒÑÄÏË ÚͦÝÅÎÏ"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "%ld ÒÑÄË¦× ÚͦÝÅÎÏ"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "%ld ÒÑÄË¦× ×¦ÄƦÌØÔÒÏ×ÁÎÏ"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: á×ÔÏËÏÍÁÎÄÉ *Filter* ÎÅ ÐÏ×ÉÎÎØ ÚͦÎÀ×ÁÔÉ ÂÕÆÅÒ"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[îÅ ÚÁÐÉÓÁÎÏ Ð¦ÓÌÑ ÏÓÔÁÎÎØϧ ÚͦÎÉ]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s × ÒÑÄËÕ"
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ÚÁÂÁÇÁÔÏ ÐÏÍÉÌÏË, ÒÅÛÔÁ ÆÁÊÌÁ ÏÐÕÝÅÎÏ"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "úÞÉÔÕ¤ÔØÓÑ ÆÁÊÌ viminfo: \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " ¦ÎÆÏÒÍÁæÑ"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " ÐÏÚÎÁÞËÉ"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " îå ÷äáìïóñ"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: õ ÆÁÊÌ viminfo (\"%s\") ÚÁÐÉÓ ÎÅ ÄÏÚ×ÏÌÅÎÏ"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ viminfo ÆÁÊÌ %s!"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "úÁÐÉÓÕ¤ÔØÓÑ viminfo ÆÁÊÌ \"%s\""
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# ãÅÊ ÆÁÊÌ Á×ÔÏÍÁÔÉÞÎÏ ÓÔ×ÏÒÉ× Vim %s.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr "# íÏÖÅÔÅ ÒÅÄÁÇÕ×ÁÔÉ, ÁÌÅ ïâåòåöîï!\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# úÎÁÞÅÎÎÑ 'encoding' ËÏÌÉ ÃÅÊ ÆÁÊÌ ÂÕÌÏ ÚÁÐÉÓÁÎÏ\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "îÅÄÏÚ×ÏÌÅÎÉÊ ÓÉÍ×ÏÌ ÎÁ ÐÏÞÁÔËÕ ÒÑÄËÁ"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: æÁÊÌ ÕÖÅ ÚÁ×ÁÎÔÁÖÅÎÏ Õ ¦ÎÛÏÍÕ ÂÕÆÅÒ¦"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "úÁÐÉÓÁÔÉ ÞÁÓÔÉÎÕ ÆÁÊÌÁ?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ ! ÄÌÑ ÚÁÐÉÓÕ ÞÁÓÔÉÎÉ ÂÕÆÅÒÁ"
+
+#: ex_cmds.c:2244
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "ðÅÒÅÚÁÐÉÓÁÔÉ ¦ÓÎÕÀÞÉÊ ÆÁÊÌ \"%*.s\"?"
+
+#: ex_cmds.c:2315
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: îÅÍÁ¤ ×ȦÄÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÂÕÆÅÒÁ %ld"
+
+#: ex_cmds.c:2353
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: æÁÊÌ ÎÅ ÚÁÐÉÓÁÎÏ: ÚÁÐÉÓ ÚÁÂÏÒÏÎÅÎÏ ÏÐæ¤À 'write'"
+
+#: ex_cmds.c:2373
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"äÌÑ \"%.*s\" ×ËÁÚÁÎÏ ÏÐæÀ 'readonly'.\n"
+"÷É ×ÓÅ ÝÅ ÂÁÖÁ¤ÔÅ ÐÒÏÄÏ×ÖÉÔÉ ÚÁÐÉÓ?"
+
+#: ex_cmds.c:2538
+msgid "Edit File"
+msgstr "òÅÄÁÇÕ×ÁÔÉ æÁÊÌ"
+
+#: ex_cmds.c:3061
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: á×ÔÏËÏÍÁÎÄÁ ÎÅÓÐÏĦ×ÁÎÏ ×ÉÄÁÌÉÌÁ ÎÏ×ÉÊ ÂÕÆÅÒ %s"
+
+#: ex_cmds.c:3193
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: ÎÅÞÉÓÌÏ×ÉÊ ÁÒÇÕÍÅÎÔ ÄÌÑ :z"
+
+#: ex_cmds.c:3278
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: õ rvim ÎÅ ÄÏÚ×ÏÌÅΦ ËÏÍÁÎÄÉ shell"
+
+#: ex_cmds.c:3385
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: ÚÒÁÚËÉ ÎÅ ÍÏÖÕÔØ ÂÕÔÉ ÒÏÚĦÌÅΦ ̦ÔÅÒÁÍÉ"
+
+#: ex_cmds.c:3723
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "úÁͦÎÉÔÉ ÎÁ %s (y/n/a/q/l/^E/^Y)?"
+
+#: ex_cmds.c:4087
+msgid "(Interrupted) "
+msgstr "(ðÅÒÅÒ×ÁÎÏ) "
+
+#: ex_cmds.c:4091
+msgid "1 substitution"
+msgstr "ïÄÎÁ ÚÁͦÎÁ"
+
+#: ex_cmds.c:4093
+#, c-format
+msgid "%ld substitutions"
+msgstr "úÁͦÎÅÎÏ -- %ld"
+
+#: ex_cmds.c:4096
+msgid " on 1 line"
+msgstr " × ÏÄÎÏÍÕ ÒÑÄËÕ"
+
+#: ex_cmds.c:4098
+#, c-format
+msgid " on %ld lines"
+msgstr " × %ld ÒÑÄËÁÈ"
+
+#: ex_cmds.c:4149
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ÎÅ ÍÏÖÅ ×ÉËÏÒÉÓÔÏ×Õ×ÁÔÉÓØ ÒÅËÕÒÓÉ×ÎÏ"
+
+#: ex_cmds.c:4184
+msgid "E148: Regular expression missing from global"
+msgstr "E148: âÒÁËÕ¤ ÚÒÁÚËÁ ÄÌÑ global"
+
+#: ex_cmds.c:4233
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "úÒÁÚÏË ÎÅ ÚÎÁÊÄÅÎÏ: %s"
+
+#: ex_cmds.c:4314
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# ïÓÔÁÎÎ¦Ê ÚÒÁÚÏË ÄÌÑ ÚÁͦÎÉ:\n"
+"$"
+
+#: ex_cmds.c:4413
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ÷ÉÂÁÞÔÅ, ÄÌÑ %s ÎÅÍÁ¤ ÄÏÐÏÍÏÇÉ"
+
+#: ex_cmds.c:4447
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "÷ÉÂÁÞÔÅ, ÆÁÊÌ ÄÏÐÏÍÏÇÉ \"%s\" ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: ex_cmds.c:4893
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s: îÅ ¤ ÄÉÒÅËÔÏÒ¦¤À"
+
+#: ex_cmds.c:4921
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ %s ÄÌÑ ÚÁÐÉÓÕ"
+
+#: ex_cmds.c:4935
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ %s ÄÌÑ ÞÉÔÁÎÎÑ"
+
+#: ex_cmds.c:5014
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ðÏÄצÊÎÁ ÐÏÚÎÁÞËÁ \"%s\" × ÆÁÊ̦ %s"
+
+#: ex_cmds.c:5115
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: îÅצÄÏÍÁ ËÏÍÁÎÄÁ sign: %s"
+
+#: ex_cmds.c:5135
+msgid "E156: Missing sign name"
+msgstr "E156: âÒÁËÕ¤ ÎÁÚ×É ÎÁÐÉÓÕ"
+
+#: ex_cmds.c:5181
+msgid "E255: Too many signs defined"
+msgstr "E255: ÷ÉÚÎÁÞÅÎÏ ÚÁÂÁÇÁÔÏ ÎÁÐÉÓ¦×"
+
+#: ex_cmds.c:5223
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: îÅצÒÎÉÊ ÎÁÐÉÓ: %s"
+
+#: ex_cmds.c:5247 ex_cmds.c:5433
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: îÅצÄÏÍÉÊ ÎÁÐÉÓ: %s"
+
+#: ex_cmds.c:5293
+msgid "E159: Missing sign number"
+msgstr "E159: âÒÁËÕ¤ ÁÒÇÕÍÅÎÔÕ ÎÁÐÉÓÕ"
+
+#: ex_cmds.c:5373
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: îÅצÒÎÁ ÎÁÚ×Á ÂÕÆÅÒÁ: %s"
+
+#: ex_cmds.c:5412
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: îÅצÒÎÉÊ ID ÎÁÐÉÓÕ: %ld"
+
+#: ex_cmds.c:5583
+msgid "[Deleted]"
+msgstr "[÷ÉÄÁÌÅÎÏ]"
+
+#: ex_docmd.c:490
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr ""
+"ðÏÞÁÔÏË ÒÅÖÉÍÕ Ex. ÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ \"visual\" ÄÌÑ ÐÏ×ÅÒÎÅÎÎÑ × ÎÏÒÍÁÌØÎÉÊ "
+"ÒÅÈÉÍ"
+
+#. must be at EOF
+#: ex_docmd.c:526
+msgid "At end-of-file"
+msgstr "â¦ÌÑ Ë¦ÎÃÑ ÆÁÊÌÁ"
+
+#: ex_docmd.c:601
+msgid "E169: Command too recursive"
+msgstr "E169: ëÏÍÁÎÄÁ ÚÁÎÁÄÔÏ ÒÅËÕÒÓÉ×ÎÁ"
+
+#: ex_docmd.c:910
+msgid "E170: Missing :endwhile"
+msgstr "E170: âÒÁËÕ¤ :endwhile"
+
+#: ex_docmd.c:912
+msgid "E171: Missing :endif"
+msgstr "E171: âÒÁËÕ¤ :endif"
+
+#: ex_docmd.c:922
+msgid "End of sourced file"
+msgstr "ë¦ÎÅÃØ ×ÉËÏÎÕ×ÁÎÏÇÏ ÆÁÊÌÁ"
+
+#: ex_docmd.c:923
+msgid "End of function"
+msgstr "ë¦ÎÅÃØ ÆÕÎËæ§"
+
+#: ex_docmd.c:1343
+msgid "Ambiguous use of user-defined command"
+msgstr "ä×ÏÚÎÁÞÎÉÊ ×ÖÉÔÏË ËÏÍÁÎÄÉ ËÏÒÉÓÔÕ×ÁÞÁ"
+
+#: ex_docmd.c:1357
+msgid "Not an editor command"
+msgstr "îÅ ¤ ËÏÍÁÎÄÏÀ ÒÅÄÁËÔÏÒÁ"
+
+#: ex_docmd.c:1440
+msgid "Don't panic!"
+msgstr "îÅ ÎÅÒ×ÕÊÔÅ!"
+
+#: ex_docmd.c:1459
+msgid "Backwards range given"
+msgstr "îÅ ÂÕÄÕ ÚÁÄËÕ×ÁÔÉ!"
+
+#: ex_docmd.c:1468
+msgid "Backwards range given, OK to swap"
+msgstr "îÅ ÂÕÄÕ ÚÁÄËÕ×ÁÔÉ, ÁÌÅ ÍÏÖÕ ÏÂÅÒÎÕÔÉÓÑ..."
+
+#: ex_docmd.c:1579
+msgid "Use w or w>>"
+msgstr "÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ :w ÁÂÏ :w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ÷ÉÂÁÊÔÅ, ÃÑ ËÏÍÁÎÄÁ ΊĦ¤"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: ô¦ÌØËÉ ÏÄÎÅ ¦Í'Ñ ÆÁÊÌÁ ÄÏÚ×ÏÌÅÎÏ"
+
+#: ex_docmd.c:3811
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "ýÅ ¤ %d ÎÅÒÅÄÁÇÏ×ÁÎÉÈ ÆÁÊ̦×. ÷ÉÊÔÉ?"
+
+#: ex_docmd.c:3818
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: úÁÌÉÛÉÌÏÓÑ %ld ÎÅÒÅÄÁÇÏ×ÁÎÉÈ ÆÁÊ̦×"
+
+#: ex_docmd.c:3912
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: ëÏÍÁÎÄÁ ×ÖÅ ¦ÓÎÕ¤, ×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ"
+
+#: ex_docmd.c:4017
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" îÁÚ×Á áÒÇ. íÅÖÁ äÏÐÏ×ÎÅÎÑ ÷ÉÚÎÁÞÅÎÎÑ"
+
+#: ex_docmd.c:4106
+msgid "No user-defined commands found"
+msgstr "îÅ ÚÎÁÊÄÅÎÏ ËÏÍÁÎÄ ËÏÒÉÓÔÕ×ÁÞÁ"
+
+#: ex_docmd.c:4137
+msgid "E175: No attribute specified"
+msgstr "E175: îÅ ×ËÁÚÁÎÏ ÁÔÒÉÂÕÔ"
+
+#: ex_docmd.c:4189
+msgid "E176: Invalid number of arguments"
+msgstr "E176: îÅצÒÎÁ ˦ÌØ˦ÓÔØ ÁÒÇÕÍÅÎÔ¦×"
+
+#: ex_docmd.c:4204
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ì¦ÞÉÌØÎÉË ÎÅ ÍÏÖÅ ÂÕÔÉ ×ËÁÚÁÎÏ Äצަ"
+
+# msgstr "E177: "
+#: ex_docmd.c:4214
+msgid "E178: Invalid default value for count"
+msgstr "E178: îÅצÒÎÅ ÐÏÞÁÔËÏ×Å ÚÎÁÞÅÎÎÑ ÄÌÑ count"
+
+# msgstr "E178: "
+#: ex_docmd.c:4242
+msgid "E179: argument required for complete"
+msgstr "E179: äÌÑ ÄÏÐÏ×ÎÅÎÎÑ ÎÅÏÂȦÄÅÎ ÁÒÇÕÍÅÎÔ"
+
+# msgstr "E179: "
+#: ex_docmd.c:4261
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: îÅצÒÎÁ ×ËÁÚ¦×ËÁ ÄÌÑ ÄÏÐÏ×ÎÅÎÎÑ: %s"
+
+# msgstr "E180: "
+#: ex_docmd.c:4269
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: îÅצÒÎÉÊ ÁÔÒÉÂÕÔ: %s"
+
+# msgstr "E181: "
+#: ex_docmd.c:4310
+msgid "E182: Invalid command name"
+msgstr "E182: îÅצÒÎÁ ÎÁÚ×Á ËÏÍÁÎÄÉ"
+
+# msgstr "E182: "
+#: ex_docmd.c:4325
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: ëÏÍÁÎÄÉ ËÏÒÉÓÔÕ×ÁÞÁ ÐÏצÎÎÉ ÐÏÞÉÎÁÔÉÓÑ Ú ×ÅÌÉËϧ ̦ÔÅÒÉ"
+
+# msgstr "E183: "
+#: ex_docmd.c:4394
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ëÏÍÁÎÄÕ ËÏÒÉÓÔÕ×ÁÞÁ ÎÅ ÚÎÁÊÄÅÎÏ: %s"
+
+# msgstr "E184: "
+#: ex_docmd.c:4845
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: îÅ ÍÏÖÎÁ ÚÎÁÊÔÉ ÓÈÅÍÕ ËÏÌØÏÒ¦× %s"
+
+#: ex_docmd.c:4853
+msgid "Greetings, Vim user!"
+msgstr "ñË ÖÉ×ÅÔØÓÑ, ËÏÒÉÓÔÕ×ÁÞ Vim ?"
+
+# msgstr "E185: "
+#: ex_docmd.c:5550
+msgid "Edit File in new window"
+msgstr "òÅÄÁÇÕ×ÁÔÉ ÆÁÊÌ Õ ÎÏ×ÏÍÕ ×¦ËΦ"
+
+#: ex_docmd.c:5816
+msgid "No swap file"
+msgstr "îÅÍÁ¤ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+#: ex_docmd.c:5920
+msgid "Append File"
+msgstr "äÏÐÉÓÁÔÉ ÆÁÊÌ"
+
+#: ex_docmd.c:5979
+msgid "E186: No previous directory"
+msgstr "E186: öÏÄÎϧ ÐÏÐÅÒÅÄÎØϧ ÄÉÒÅËÔÏÒ¦§"
+
+# msgstr "E186: "
+#: ex_docmd.c:6056
+msgid "E187: Unknown"
+msgstr "E187: îÅצÄÏÍÁ ÄÉÒÅËÔÏÒ¦Ñ"
+
+# msgstr "E187: "
+#: ex_docmd.c:6174
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "ðÏÚÉÃ¦Ñ ×¦ËÎÁ: X %d, Y %d"
+
+#: ex_docmd.c:6179
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: æÕÎËÃ¦Ñ ÏÂÒÁÈÕ×ÁÎÎÑ ÐÏÚÉæ§ צËÎÁ ΊĦ¤ ÄÌÑ ×ÁÛϧ ÐÌÁÔÆÏÒÍÉ"
+
+# msgstr "E188: "
+#: ex_docmd.c:6445
+msgid "Save Redirection"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÐÅÒÅÁÄÒÅÓÏ×ÁÎÉÊ ×ÉצÄ"
+
+#: ex_docmd.c:6594
+msgid "Save View"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ×ÉÇÌÑÄ"
+
+#: ex_docmd.c:6595
+msgid "Save Session"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÓÅÁÎÓ"
+
+#: ex_docmd.c:6597
+msgid "Save Setup"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÎÁÌÁÛÔÕ×ÁÎÎÑ"
+
+#: ex_docmd.c:6746
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: æÁÊÌ \"%s\" ¦ÓÎÕ¤, (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+# msgstr "E189: "
+#: ex_docmd.c:6751
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ \"%s\" ÄÌÑ ÞÉÔÁÎÎÑ"
+
+# msgstr "E190: "
+#. set mark
+#: ex_docmd.c:6775
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: áÒÇÕÍÅÎÔ ÍÁ¤ ÂÕÔÉ Ì¦ÔÅÒÏÀ, ` ÁÂÏ '"
+
+# msgstr "E191: "
+#: ex_docmd.c:6818
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: òÅËÕÒÓÉ×ÎÁ ÇÌÉÂÉÎÁ ×ÅËÏÒÉÓÔÁÎÎÑ :normal ÚÁÎÁÄÒÏ ×ÅÌÉËÁ"
+
+#: ex_docmd.c:7179
+msgid ":if nesting too deep"
+msgstr "úÁÎÁÄÔÏ ×ÅÌÉËÁ ˦ÌØ˦ÓÔØ ×ËÌÁÄÅÎÉÈ :if"
+
+#: ex_docmd.c:7214
+msgid ":endif without :if"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :if ÄÌÑ :endif"
+
+#: ex_docmd.c:7234
+msgid ":else without :if"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :if ÄÌÑ :else"
+
+#: ex_docmd.c:7236
+msgid ":elseif without :if"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :if ÄÌÑ :elseif"
+
+#: ex_docmd.c:7288
+msgid ":while nesting too deep"
+msgstr "úÁÎÁÄÔÏ ×ÅÌÉËÁ ˦ÌØ˦ÓÔØ ×ËÌÁÄÅÎÉÈ :while"
+
+#: ex_docmd.c:7334
+msgid ":continue without :while"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :while ÄÌÑ :continue"
+
+#: ex_docmd.c:7361
+msgid ":break without :while"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :while ÄÌÑ :break"
+
+#: ex_docmd.c:7384 ex_docmd.c:7389
+msgid ":endwhile without :while"
+msgstr "âÒÁËÕ¤ צÄÐÏצÄÎÏÇÏ :while ÄÌÑ :endwhile"
+
+#: ex_docmd.c:7410
+msgid "E193: :endfunction not inside a function"
+msgstr "E133: :endfunction ÐÏÚÁ ÍÅÖÁÍÉ ÆÕÎËæ§"
+
+# msgstr "E193: "
+#: ex_docmd.c:7590
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: îÅÍÁ¤ ×ÔÏÒÉÎÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÚÁͦÎÉ '#'"
+
+#: ex_docmd.c:7621
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "îÅ ÍÏÖÎÁ ÚÁͦÎÉÔÉ \"<afile>\" × Á×ÔÏËÏÍÁÎĦ, ¦Í'Ñ ÆÁÊÌÁ צÄÓÕÔΦ¤"
+
+#: ex_docmd.c:7629
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "îÅ ÍÏÖÎÁ ÚÁͦÎÉÔÉ \"<abuf>\" × Á×ÔÏËÏÍÁÎĦ, ÎÁÚ×Á ÂÕÆÅÒÁ צÄÓÕÔÎÑ"
+
+#: ex_docmd.c:7640
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr ""
+"îÅ ÍÏÖÎÁ ÚÁͦÎÉÔÉ \"<amatch>\" × Á×ÔÏËÏÍÁÎĦ, ÄÌÑ Ú¦ÇÕ ÎÅ ×ÉËÏÒÉÓÔÏ×ÁÌÏÓØ "
+"¦Í'Ñ"
+
+#: ex_docmd.c:7650
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "îÅ ÍÏÖÎÁ ÚÁͦÎÉÔÉ \"<sfile>\" × Á×ÔÏËÏÍÁÎĦ, ¦Í'Ñ ÆÁÊÌÁ צÄÓÕÔΦ¤"
+
+#: ex_docmd.c:7691
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "ðÏÒÏÖÎÅ ¦Í'Ñ ÆÁÊÌÁ ÄÌÑ '%' ÔÁ '#' ÐÒÁÃÀ¤ ÌÉÛÅ Ú \":p:h\""
+
+#: ex_docmd.c:7693
+msgid "Evaluates to an empty string"
+msgstr "òÅÚÕÌØÔÁÔ -- ÐÏÒÏÖÎ¦Ê ÒÑÄÏË"
+
+#: ex_docmd.c:8628
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ viminfo"
+
+#: ex_docmd.c:8801
+msgid "E196: No digraphs in this version"
+msgstr "E196: õ Ã¦Ê ×ÅÒÓ¦§ ÎÅÍÁ¤ ÄÉÇÒÁƦ×"
+
+# msgstr "E197: "
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "ÎÁÚ×Á ÐÏͦÔËÉ"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr " ÔÉÐ ÆÁÊÌÁ\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "ïÐÃ¦Ñ 'history' ÐÏÒÏÖÎÑ"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ðÏÐÅÒÅÄΦ %s:\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "ËÏÍÁÎÄÉ"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "ÚÒÁÚËÉ ÄÌÑ ÐÏÛÕËÕ"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "×ÉÒÁÚÉ"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "××ÅÄÅΦ ÒÑÄËÉ"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: "
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: áËÔÉ×ΊצËÎÏ ÁÂÏ ÂÕÆÅÒ ÂÕÌÏ ×ÉÄÁÌÅÎÏ"
+
+# msgstr "E199: "
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "îÅÄÏÚ×ÏÌÅÎÅ ¦Í'Ñ ÆÁÊÌÁ"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2493 fileio.c:2531
+msgid "is a directory"
+msgstr "ÃÅ ÄÉÒÅËÔÏÒ¦Ñ"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "ÎÅ ÆÁÊÌ"
+
+#: fileio.c:515 fileio.c:3604
+msgid "[New File]"
+msgstr "[îÏ×ÉÊ ÆÁÊÌ]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[÷¦ÄÍÏ×ÌÅÎÏ]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: á×ÔÏËÏÍÁÎÄÉ *ReadPre ÚÒÏÂÉÌÉ ÞÉÔÁÎÎÑ ÆÁÊÌÁ ÎÅÍÏÖÌÉ×ÉÍ"
+
+# msgstr "E200: "
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: á×ÔÏËÏÍÁÎÄÉ *ReadPre ÎÅ ÍÁ¤ÔØ ÐÒÁ×Á ÚͦÎÀ×ÁÔÉ ÂÕÆÅÒ"
+
+# msgstr "E201: "
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: þÉÔÁÅÍÏ Ú stdin...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "þÉÔÁÅÍÏ Ú stdin..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ëÏÎ×ÅÒÔÕ×ÁÎÎÑ ÚÒÏÂÉÌÏ ÞÉÔÁÎÎÑ ÆÁÊÌÁ ÎÅÍÏÖÌÉ×ÉÍ!"
+
+# msgstr "E202: "
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[fifo/ÓÏËÅÔ]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[ÓÏËÅÔ]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[RO]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[÷ÔÒÁÞÅÎÏ CR]"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[úÎÁÊÄÅÎÏ NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[äÏ×Ǧ ÒÑÄËÉ ÐÏÄÒ¦ÂÎÅÎÏ]"
+
+#: fileio.c:1780 fileio.c:3588
+msgid "[NOT converted]"
+msgstr "[îå ËÏÎ×ÅÒÔÏ×ÁÎÏ]"
+
+#: fileio.c:1785 fileio.c:3593
+msgid "[converted]"
+msgstr "[ËÏÎ×ÅÒÔÏ×ÁÎÏ]"
+
+#: fileio.c:1792 fileio.c:3618
+msgid "[crypted]"
+msgstr "[ÚÁÛÉÆÒÏ×ÁÎÏ]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "[ðïíéìëá ëïî÷åòôõ÷áîîñ]"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[ðïíéìëá úþéôõ÷áîîñ]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "îÅ ÍÏÖÕ Ð¦ÄÛÕËÁÔÉ ÔÉÍÞÁÓÏ×ÉÊ ÆÁÊÌ ÄÌÑ ËÏÎ×ÅÒÔÕ×ÁÎÎÑ"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "ëÏ×ÎÅÒÔÕ×ÁÎÎÑ Ú 'charconvert' ÎÅ ×ÄÁÌÏÓÑ"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "ÎÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ×É×¦Ä 'charconvert'"
+
+#: fileio.c:2409
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: á×ÔÏËÏÍÁÎÄÁ ×ÉÄÁÌÉÌÁ ÁÂÏ ×É×ÁÎÔÁÖÉÌÁ ÂÕÆÅÒ ÝÏ ÍÁ¤ ÂÕÔÉ ÚÁÐÉÓÁÎÉÊ"
+
+#: fileio.c:2432
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: á×ÔÏËÏÍÁÎÄÁ ÚͦÎÉÌÁ ˦ÌØËØÓÔØ ÒÑÄË¦× ÎÅÓÐÏĦ×ÁÎÉÍ ÞÉÎÏÍ"
+
+#: fileio.c:2498 fileio.c:2515
+msgid "is not a file or writable device"
+msgstr "ÎÅ ¤ ÆÁÊÌÏÍ ÞÉ ÐÒÉÓÔÒÏ¤Í Ú ÍÏÖÌÉצÓÔÀ ÚÁÐÉÓÕ"
+
+#: fileio.c:2561
+msgid "is read-only (use ! to override)"
+msgstr "ÍÏÖÎÁ ÌÉÛÅ ÞÉÔÁÔÉ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:2857
+msgid "Can't write to backup file (use ! to override)"
+msgstr "îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ ÒÅÚÅÒ×ÎÉÊ ÆÁÊÌ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:2869
+msgid "Close error for backup file (use ! to override)"
+msgstr "ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÓÐÒÏÂÉ ÚÁËÒÉÔÉ ÒÅÚÅÒ×ÎÉÊ ÆÁÊÌ"
+
+#: fileio.c:2871
+msgid "Can't read file for backup (use ! to override)"
+msgstr ""
+"îÅÍÁ¤ ÚÍÏÇÉ ÓÔ×ÏÒÉÔÉ ÆÁÊÌ ÄÌÑ ÒÅÚÅÒ×Îϧ ËÏЦ§ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:2887
+msgid "Cannot create backup file (use ! to override)"
+msgstr "îÅÍÁ¤ ÚÍÏÇÉ ÓÔ×ÏÒÉÔÉ ÒÅÚÅÒ×ÎÕ ËÏЦÀ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:2989
+msgid "Can't make backup file (use ! to override)"
+msgstr "îÅÍÁ¤ ÚÍÏÇÉ ÓÔ×ÏÒÉÔÉ ÒÅÚÅÒ×ÎÕ ËÏЦÀ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:3051
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "òÅÓÕÒÓÎÕ Ç¦ÌËÕ ÆÁÊÌÁ ÂÕÄÅ ×ÔÒÁÞÅÎÏ (! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: fileio.c:3140
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: îÅ ÍÏÖÕ Ð¦ÄÛÕËÁÔÉ ÔÉÍÞÁÓÏ×ÉÊ ÆÁÊÌ ÄÌÑ ÚÁÐÉÓÕ"
+
+#: fileio.c:3158
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr ""
+"E213: îÅ ÍÏÖÕ ËÏÎ×ÅÒÔÕ×ÁÔÉ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÚÁÐÉÓÁÔÉ ÂÅÚ ËÏÎ×ÅÒÔÕ×ÁÎÎÑ)"
+
+#: fileio.c:3193
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÄÌÑ ÚÁÐÉÓÕ ÆÁÊÌ ÎÁ ÑËÉÊ ×ËÁÚÕ¤ ÐÏÓÉÌÁÎÎÑ"
+
+#: fileio.c:3197
+msgid "E212: Can't open file for writing"
+msgstr "E212: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ ÄÌÑ ÚÁÐÉÓÕ"
+
+#: fileio.c:3446
+msgid "Close failed"
+msgstr "îÅ ×ÄÁÌÏÓÑ ÚÁËÒÉÔÉ ÆÁÊÌ"
+
+#: fileio.c:3504
+msgid "write error, conversion failed"
+msgstr "ÐÏÍÉÌËÁ ÚÁÐÉÓÕ, ËÏÎ×ÅÒÔÕ×ÁÎÎÑ ÎÅ ×ÄÁÌÏÓÑ"
+
+#: fileio.c:3510
+msgid "write error (file system full?)"
+msgstr "ÐÏÍÉÌËÁ ÚÁÐÉÓÕ (Ó˦ÎÞÉÌÏÓØ ×¦ÌØΊͦÓÃÅ??)"
+
+#: fileio.c:3583
+msgid " CONVERSION ERROR"
+msgstr " ðïíéìëá ëïî÷åòôõ÷áîîñ"
+
+#: fileio.c:3599
+msgid "[Device]"
+msgstr "[ðÒÉÓÔÒ¦Ê]"
+
+#: fileio.c:3604
+msgid "[New]"
+msgstr "[îÏ×ÉÊ]"
+
+#: fileio.c:3626
+msgid " [a]"
+msgstr "[Ä]"
+
+#: fileio.c:3626
+msgid " appended"
+msgstr " ÄÏÐÉÓÁÎÉÊ"
+
+#: fileio.c:3628
+msgid " [w]"
+msgstr "[Ú]"
+
+#: fileio.c:3628
+msgid " written"
+msgstr " ÚÁÐÉÓÁÎÉÊ"
+
+#: fileio.c:3678
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: òÅÖÉÍ patch: ÎÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ ÐÅÒ×ÉÎÎÉÊ ÆÁÊÌ"
+
+#: fileio.c:3700
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: òÅÖÉÍ patch: ÎÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÐÕÓÔÉÊ ÐÅÒ×ÉÎÎÉÊ ÆÁÊÌ"
+
+#: fileio.c:3715
+msgid "E207: Can't delete backup file"
+msgstr "E207: îÅ ÍÏÖÕ ×ÉÄÁÌÉÌÁ ÒÅÚÅÒ×ÎÉÊ ÆÁÊÌ"
+
+#: fileio.c:3767
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"õ÷áçá: ðÏÞÁÔËÏ×ÉÊ ÆÁÊÌ ÍÏÖÅ ÂÕÔÉ ×ÔÒÁÞÅÎÉÊ ÁÂÏ ×ÉÄÁÌÅÎÉÊ\n"
+
+#: fileio.c:3769
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "îÅ ×ÉÈÏÄØÔÅ Ú ÒÅÄÁËÔÏÒÁ ÄÏÐÏËÉ ÆÁÊÌ ÎÅ ÂÕÄÅ ÚÁÐÉÓÁÎÏ"
+
+#: fileio.c:3849
+msgid "[dos]"
+msgstr "[ÄÏÓ]"
+
+#: fileio.c:3849
+msgid "[dos format]"
+msgstr "[ÆÏÒÍÁÔ dos]"
+
+#: fileio.c:3856
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3856
+msgid "[mac format]"
+msgstr "[ÆÏÒÍÁÔ mac]"
+
+#: fileio.c:3863
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3863
+msgid "[unix format]"
+msgstr "[unix ÆÏÒÍÁÔ]"
+
+#: fileio.c:3890
+msgid "1 line, "
+msgstr "ÏÄÉÎ ÒÑÄÏË, "
+
+#: fileio.c:3892
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ÒÑÄ˦×, "
+
+#: fileio.c:3895
+msgid "1 character"
+msgstr "ÏÄÉÎ ÓÉÍ×ÏÌ"
+
+#: fileio.c:3897
+#, c-format
+msgid "%ld characters"
+msgstr "%ld ÓÉÍ×Ï̦×"
+
+#: fileio.c:3907
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3907
+msgid "[Incomplete last line]"
+msgstr "[ÎÅÐÏ×ÎÉÊ ÏÓÔÁÎ¦Ê ÒÑÄÏË]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3926
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "õ÷áçá: æÁÊÌ ÂÕÌÏ ÚͦÎÅÎÏ Ð¦ÓÌÑ ÚÞÉÔÁÎÎÑ!!!"
+
+#: fileio.c:3928
+msgid "Do you really want to write to it"
+msgstr "÷É Ä¦ÊÓÎÏ ÈÏÞÅÔÅ ÊÏÇÏ ÐÅÒÅÚÁÐÉÓÁÔÉ ??"
+
+#: fileio.c:4884
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: ðÏÍÉÌËÁ ÚÁÐÉÓÕ × \"%s\""
+
+#: fileio.c:4891
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÚÁËÒÉÔÔÑ \"%s\""
+
+#: fileio.c:4894
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÚÞÉÔÕ×ÁÎÎÑ \"%s\""
+
+#: fileio.c:5058
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: á×ÔÏËÏÍÁÎÄÁ FileChangedShell ×ÉÄÁÌÉÌÁ ÂÕÆÅÒ"
+
+#: fileio.c:5066
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: õ×ÁÇÁ: æÁÊÌ \"%s\" ÎÅÄÏÓÑÖÎÉÊ"
+
+#: fileio.c:5079
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr ""
+"W12: õ×ÁÇÁ: æÁÊÌ \"%s\" ÂÕÌÏ ÚͦÎÅÎÏ, ÁÌÅ Ê ÂÕÆÅÒ Õ Vim ÔÅÖ ÂÕÌÏ ÚͦÎÅÎÏ"
+
+#: fileio.c:5082
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: õ×ÁÇÁ: æÁÊÌ \"%s\" ÂÕÌÏ ÚͦÎÅÎÏ Ð¦ÓÌÑ ÐÏÞÁÔËÕ ÒÅÄÁÇÕ×ÁÎÎÑ"
+
+#: fileio.c:5084
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: õ×ÁÇÁ: òÅÖÉÍ ÆÁÊÌÁ \"%s\" ÂÕÌÏ ÚͦÎÅÎÏ Ð¦ÓÌÑ ÐÏÞÁÔËÕ ÒÅÄÁÇÕ×ÁÎÎÑ"
+
+#: fileio.c:5094
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: õ×ÁÇÁ: æÁÊÌ \"%s\" ÂÕÌÏ ÓÔ×ÏÒÅÎÏ Ð¦ÓÌÑ ÐÏÞÅÔËÕ ÒÅÄÁÇÕ×ÁÎÎÑ"
+
+#: fileio.c:5111
+msgid "Warning"
+msgstr "õ×ÁÇÁ"
+
+#: fileio.c:5112
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"&O:çÁÒÁÚÄ\n"
+"&L:úÁ×ÁÎÔÁÖÉÔÉ ÆÁÊÌ"
+
+#: fileio.c:5188
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: îÅ ÍÏÖÕ ÐÅÒÅ×ÁÎÔÁÖÉÔÉ \"%s\""
+
+#: fileio.c:5703
+msgid "--Deleted--"
+msgstr "--÷ÉÄÁÌÅÎÏ--"
+
+#. the group doesn't exist
+#: fileio.c:5863
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: çÒÕÐÁ ÎÅ ¦ÓÎÕ¤: \"%s\""
+
+#: fileio.c:5988
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: îÅÄÏÚ×ÏÌÅÎÉÊ ÓÉÍ×ÏÌ Ð¦ÓÌÑ *: %s"
+
+# msgstr "E215: "
+#: fileio.c:5999
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ðÏÄ¦Ñ ÎÅ ¦ÓÎÕ¤: %s"
+
+# msgstr "E216: "
+#. Highlight title
+#: fileio.c:6148
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- á×ÔÏËÏÍÁÎÄÉ ---"
+
+#: fileio.c:6419
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: îÅ ÍÏÖÕ ×ÉËÏÎÕ×ÁÔÉ Á×ÔÏËÏÍÁÎÄÉ ÄÌÑ õó¶è ÐÏĦÊ"
+
+# msgstr "E217: "
+#: fileio.c:6442
+msgid "No matching autocommands"
+msgstr "îÅ ¦ÓÎÕ¤ צÄÐÏצÄÎÉÈ Á×ÔÏËÏÍÁÎÄ"
+
+#: fileio.c:6714
+msgid "E218: autocommand nesting too deep"
+msgstr "úÁÎÁÄÔÏ ×ÅÌÉËÁ ˦ÌØ˦ÓÔØ ×ËÌÁÄÅÎÉÈ Á×ÔÏËÏÍÁÎÄ"
+
+# msgstr "E218: "
+#: fileio.c:7001
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s á×ÔÏËÏÍÁÎÄÉ ÄÌÑ \"%s\""
+
+#: fileio.c:7009
+#, c-format
+msgid "Executing %s"
+msgstr "÷ÉËÏÎÕÅÔØÓÑ %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7077
+#, c-format
+msgid "autocommand %s"
+msgstr "Á×ÔÏËÏÍÁÎÄÁ %s"
+
+#: fileio.c:7599
+msgid "E219: Missing {."
+msgstr "÷ÔÒÁÞÅÎÏ {."
+
+# msgstr "E219: "
+#: fileio.c:7601
+msgid "E220: Missing }."
+msgstr "÷ÔÒÁÞÅÎÏ }."
+
+# msgstr "E220: "
+#: fold.c:66
+msgid "No fold found"
+msgstr "úÇÏÒÔÏË ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E349: "
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÚÇÏÒÔÏË (Ú×ÁÖÁÀÞÉ ÎÁ 'foldmethod')"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: îÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÚÇÏÒÔÏË (Ú×ÁÖÁÀÞÉ ÎÁ 'foldmethod')"
+
+#: fold.c:1701
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: ÏÐÃ¦Ñ 'commentstring' ÐÏÒÏÖÎÑ"
+
+#: getchar.c:247
+msgid "E222: Add to read buffer"
+msgstr "E222: âÕÆÅÒ ÕÖÅ ÂÕÌÏ ÚÞÉÔÁÎÏ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: getchar.c:2106
+msgid "E223: recursive mapping"
+msgstr "E332: úÁͦÎÁ ÚÁÃÉËÌÅÎÁ"
+
+# msgstr "E223: "
+#: getchar.c:2958
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "úÁÇÁÌØÎÅ ÓËÏÒÏÞÅÎÎÑ ÄÌÑ %s ×ÖÅ ¦ÓÎÕ¤"
+
+# msgstr "E224: "
+#: getchar.c:2961
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "úÁÇÁÌØÎÁ ÚÁͦÎÁ ÄÌÑ %s ×ÖÅ ¦ÓÎÕ¤"
+
+# msgstr "E225: "
+#: getchar.c:3088
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "óËÏÒÏÞÅÎÎÑ ÄÌÑ %s ×ÓÅ ¦ÓÎÕ¤"
+
+# msgstr "E226: "
+#: getchar.c:3091
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "úÁͦÎÁ ÄÌÑ %s ×ÖÅ ¦ÓÎÕ¤"
+
+# msgstr "E227: "
+#: getchar.c:3155
+msgid "No abbreviation found"
+msgstr "óËÏÒÏÞÅÎÎÑ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: getchar.c:3157
+msgid "No mapping found"
+msgstr "úÁͦÎÉ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: getchar.c:3982
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ÷ÎÕÔÒ¦ÛÎÑ ÐÏÍÉÌËÁ"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<ÎÅÍÏÖÌÉ×Ï ×¦ÄËÒÉÔÉ> "
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: ÎÅ ÍÏÖÕ ÏÔÒÉÍÁÔÉ ÛÒÉÆÔ %s"
+
+#: gui_at_fs.c:2538
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: ÎÅ ÍÏÖÕ ÐÏ×ÅÒÎÉÔÕÓÑ × ÐÏÔÏÞÎÕ ÄÉÒÅËÔÏÒ¦À"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "ûÌÑÈ:"
+
+#: gui_at_fs.c:2563
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: ÎÅ ÍÏÖÕ Ä¦ÓÔÁÔÉ ÐÏÔÏÞÎÕ ÄÉÒÅËÔÏÒ¦À"
+
+#: gui_at_fs.c:2571 gui_motif.c:1607
+msgid "OK"
+msgstr "OK"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2571 gui_gtk.c:1689 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "Cancel"
+
+#: gui_athena.c:1938 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "ä¦ÁÌÏÇ Vim"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "Scrollbar Widget: ÎÅ ÍÏÖÕ ×ÚÎÁÔÉ ÒÏÚÍ¦Ò ÓËÏÒÏÞÅÎϧ ËÁÒÔÉÎËÉ."
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr ""
+"E232: îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ BalloonEval Ú ÐÏצÄÏÍÌÅÎÎÑÍ ¦ ÆÕÎËæ¤À ÏÄÎÏÞÁÓÎÏ"
+
+# msgstr "E228: "
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: îÅ ÍÏÖÕ ÒÏÚÐÏÞÁÔÉ GUI"
+
+# msgstr "E229: "
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: îÅ ÍÏÖÕ ÞÉÔÁÔÉ Ú \"%s\""
+
+# msgstr "E230: "
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: 'guifontwide' ×ÉÚÎÁÞÅÎÏ ÎÅצÒÎÏ"
+
+# msgstr "E231: "
+#: gui.c:3928
+msgid "Error"
+msgstr "ðÏÍÉÌËÁ"
+
+#: gui.c:3929
+msgid "&Ok"
+msgstr "&Ok"
+
+# msgstr "E232: "
+#: gui_gtk.c:1148
+msgid "Vim dialog..."
+msgstr "ä¦ÁÌÏÇ Vim..."
+
+#: gui_gtk.c:1525 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - úÎÁÊÔÉ ¦ ÚÁͦÎÉÔÉ..."
+
+#: gui_gtk.c:1530 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - ðÏÛÕË"
+
+#: gui_gtk.c:1553 gui_motif.c:2862
+msgid "Find what:"
+msgstr "úÎÁÊÔÉ:"
+
+#: gui_gtk.c:1571 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "úÁͦÎÁ:"
+
+#. exact match only button
+#: gui_gtk.c:1603 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "÷×ÁÖÁÔÉ ÚÁ ÚÂ¦Ç ÌÉÛÅ ÐÏ×ÎÅ ÓÌÏ×Ï"
+
+#: gui_gtk.c:1615 gui_motif.c:2964
+msgid "Direction"
+msgstr "îÁÐÒÑÍ"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1627 gui_motif.c:2976
+msgid "Up"
+msgstr "äÏÇÏÒÉ"
+
+#: gui_gtk.c:1631 gui_motif.c:2984
+msgid "Down"
+msgstr "õÎÉÚ"
+
+#. 'Find Next' button
+#: gui_gtk.c:1653 gui_motif.c:2766
+msgid "Find Next"
+msgstr "úÎÁÊÔÉ ÎÁÓÔÕÐÎÉÊ ×ÁÒ¦ÁÎÔ"
+
+#. 'Replace' button
+#: gui_gtk.c:1670 gui_motif.c:2783
+msgid "Replace"
+msgstr "úÁͦÎÉÔÉ"
+
+#. 'Replace All' button
+#: gui_gtk.c:1679 gui_motif.c:2796
+msgid "Replace All"
+msgstr "úÁͦÎÉÔÉ ÕÓ¦"
+
+#: gui_gtk_x11.c:1078 gui_x11.c:1199
+msgid "E233: cannot open display"
+msgstr "E233: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÄÉÓÐÌÅÊ"
+
+# msgstr "E233: "
+#: gui_gtk_x11.c:2435 gui_x11.c:2002
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: îÅצÄÏÍÉÊ fontset: %s"
+
+# msgstr "E234: "
+#: gui_gtk_x11.c:2462
+msgid "Font Selection"
+msgstr "÷ÉĦÌÅÎÎÑ"
+
+#: gui_gtk_x11.c:2704 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1838
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "îÅצÄÏÍÉÊ ÛÒÉÆÔ: %s"
+
+# msgstr "E235: "
+#: gui_gtk_x11.c:2715 gui_x11.c:1862
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: ûÒÉÆÔ \"%s\" ÎÅ ÍÏÎÏÛÉÒÉÎÎÉÊ"
+
+# msgstr "E236: "
+#: gui_gtk_x11.c:2845
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: îÅÚÒÏÚÕͦÌÁ ÎÁÚ×Á ËÏÌØÏÒÕ: %s"
+
+# msgstr "E242: "
+#: gui_gtk_x11.c:3521 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "÷ÉËÏÒÉÓÔÁÎÏ CUT_BUFFER0 ÚÁͦÓÔØ ÐÏÒÏÖÎØÏÇÏ ×ÉĦÌÅÎÎÑ"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "æ¦ÌØÔÒ"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "ÄÉÒÅËÔÏÒ¦§"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "äÏÐÏÍÏÇÁ"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "æÁÊÌÉ"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "÷ÉÂ¦Ò ÛÒÉÆÔÁ"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "÷¦ÄͦÎÁ"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr ""
+"E235: ñ ÎÅ ÚÎÁÀ ÝÏ ÔÁËÅ riscos, × õËÒÁ§Î¦ ÔÁËÏÇÏ ÎÅÍÁ¤.. (Á ÔÕÔ ÝÅ Ê ÑËÉÊÓØ "
+"ÛÒÉÆÔ ÎÅ ÈÏÞÅ ×ÁÎÔÁÖÉÔÉÓÑ: %s)"
+
+# msgstr "E235: "
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: îÅ ÍÏÖÕ ×ÉËÏÒÉÓÔÁÔÉ ÛÒÉÆÔ %s"
+
+# msgstr "E235: "
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: ÷ÔÒÁÞÅÎÏ ËÏ̦Ò: %s"
+
+# msgstr "E242: "
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ìÑËÁ¤ÍÏ Ä¦ÔÅÊ Í¦Ì¦Ã¦ÏÎÅÒÏÍ. :-)\n"
+
+#: gui_w32.c:825
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr ""
+"E243: áÒÇÕÍÅÎÔ ÎŠЦÄÔÒÉÍÕ¤ØÔØÓÑ: \"-%s\", ×ÉËÕÒÉÓÔÏ×ÕÊÔÅ ×ÅÒÓ¦À Ú OLE."
+
+# msgstr "E245: "
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "VIM - ðÏÛÕË"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "VIM - úÎÁÊÔÉ ¦ ÚÁͦÎÉÔÉ..."
+
+#: gui_x11.c:1419
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr ""
+"Vim E458: îÅÍÁ¤ צÌØÎÉÈ ÓÅËÃ¦Ê Õ ÔÁÂÌÉæ ËÏÌØÏÒ¦×. äÅÑ˦ ËÏÌØÏÒÉ ÍÏÖÕÔØ "
+"ÂÕÔÉ ×ÔÒÁÞÅΦ"
+
+#: gui_x11.c:1992
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: ûÒÉÆÔÉ ÄÌÑ ÃØÏÇÏ ÎÁÂÏÒÕ ÓÉÍ×ÏÌ¦× ×¦ÄÓÕÔΦ Õ fontset %s:"
+
+# msgstr "E250: "
+#: gui_x11.c:2035
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: îÁÚ×Á fontset: %s"
+
+# msgstr "E252: "
+#: gui_x11.c:2036
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "ûÒÉÆÔ '%s' ÎÅ ¤ ÍÏÎÏÛÉÒÉÎÎÉÍ"
+
+#: gui_x11.c:2055
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E252: îÁÚ×Á fontset: %s\n"
+
+#: gui_x11.c:2056
+#, c-format
+msgid "Font0: %s\n"
+msgstr "ûÒÉÆÔ0: %s\n"
+
+#: gui_x11.c:2057
+#, c-format
+msgid "Font1: %s\n"
+msgstr "ûÒÉÆÔ1: %s\n"
+
+#: gui_x11.c:2058
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "öÉÒΦÓÔØ ÛÒÉÆÔÁ %d ÍÁ¤ ÂÕÔÉ × Äצަ ¦ÌØÛÏÀ ÚÁ ÔÏ×ÝÉÎÕ font0\n"
+
+#: gui_x11.c:2059
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "öÉÒΦÓÔØ font0: %ld\n"
+
+#: gui_x11.c:2060
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"öÉÒΦÓÔØ font1: %ld\n"
+"\n"
+
+#: gui_x11.c:2206
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: îÅ ÍÏÖÕ ÒÏÚͦÓÔÉÔÉ ËÏÌ¦Ò %s"
+
+# msgstr "E254: "
+#: gui_x11.c:3256
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: îÅ ÍÏÖÎÁ ÚÞÉÔÁÔÉ ÄÁΦ ÎÁÐÉÓÕ!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: ðÏÍÉÌËÁ `Hangul automata' [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E255: "
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "äÏÄÁÔÉ ÎÏ×Õ ÂÁÚÕ ÄÁÎÉÈ"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "úÁÐÉÔ ÚÁ ÚÒÁÚËÏÍ"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "ðÏËÁÚÁÔÉ ÃÅ ÐÏצÄÏÍÌÅÎÎÑ"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "úÎÉÝÉÔÉ Ú'¤ÄÎÁÎÎÑ"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "òÏÚÐÏÞÁÔÉ Ú ÐÏÞÁÔËÕ ÕÓ¦ Ú'¤ÄÎÁÎÎÑ"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "ðÏËÁÚÁÔÉ Ú'¤ÄÎÁÎÎÑ"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "ãÑ ËÏÍÁÎÄÁ cscope ÎÅ Õͦ¤ ĦÌÉÔÉ ×¦ËÎÏ.\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ: cstag <ÐÏͦÔËÁ>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ÐÏͦÔËÕ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E257: "
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) ÐÏÍÉÌËÁ: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "äÏÄÁÎÏ ÂÁÚÕ ÄÁÎÉÈ cscope %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s ÎÅ ¤ Φ ÄÉÒÅËÔÏÒ¦¤À Φ ÂÁÚÏÀ ÄÁÎÉÈ cscope"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "ðÏÍÉÌËÁ ÞÉÔÁÎÎÑ Ú'¤ÄÎÁÎÎÑ cscope #%d"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "îÅצÄÏÍ¦Ê ÔÉÐ ÐÏÛÕËÕ cscope"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ËÁÎÁÌ ÄÏ cscope"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection: ÐÏÍÉÌËÁ Ð¦Ä ÞÁÓ ×ÉËÏÎÁÎÎÑ"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen ÄÌÑ to_fp ÎÅ ×ÄÁ×ÓÑ"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen ÄÌÑ fr_fp ÎÅ ×ÄÁ×ÓÑ"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "ÖÏÄÎÏÇÏ Ú'¤ÄÎÁÎÑ Ú cscope"
+
+# msgstr "E258: "
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: äÌÑ %s-ÚÁÐÉÔÕ cscope ÓÔÏÓÏ×ÎÏ %s ÎÅ ÚÎÁÊÄÅÎÏ Ó¦ÒÎÉ˦×"
+
+# msgstr "E259: "
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "ËÏÍÁÎÄÉ cscope:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (÷ÖÉ×ÁÊÔÅ: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "ÐÏ×ÔÏÒÎÁ ÂÁÚÁ ÄÁÎÉÈ cscope ÎÅ ÄÏÄÁÎÁ"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "˦ÌØ˦ÓÔØ Ú'¤ÄÎÁÎØ Ú cscope ÄÏÓÑÇÌÁ ÍÁËÓÉÍÕÍÕ"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: Ú'¤ÄÎÁÎÎÑ Ú cscope ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E260: "
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: Ú'¤ÄÎÁÎÎÑ Ú cscope %s ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E261: "
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "Ú'¤ÄÎÁÎÎÑ Ú cscope ÚÁ˦ÎÞÅÎÏ"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "Ú'¤ÄÎÁÎÎÑ Ú cscope %s ÚÁ˦ÎÞÅÎÏ\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "cs_manage_matches: Ó¦ÒÎÉË¦× Â¦ÌØÛÅ ÎÅÍÁ¤ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: ÐÏÍÉÌËÁ ÞÉÔÁÎÎÑ Ú Ú'¤ÄÎÁÎÎÑ cscope %d"
+
+# msgstr "E262: "
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "ÎÅ ÍÏÖÕ ×ÉĦÌÉÔÉ ÐÁÍ'ÑÔØ\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "ðÏͦÔËÁ cscope: %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # ÒÑÄÏË"
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "ÆÁÊÌ / ËÏÎÔÅËÓÔ / ÒÑÄÏË\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "õÓ¦ Ú'¤ÄÎÁÎÎÑ Ú cscope ÐÅÒÅÚÁ×ÁÎÔÁÖÅÎÏ"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "öÏÄÎÏÇÏ Ú'¤ÄÎÁÎÎÑ Ú cscope\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid ÎÁÚ×Á ÂÁÚÉ ÄÁÎÉÈ ÛÌÑÈ\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <ÖÏÖÎÏÇÏ>\n"
+
+#: if_python.c:246 if_ruby.c:260 if_tcl.c:195 mbyte.c:2568 os_win32.c:269
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: îÅ ÍÏÖÕ ÚÁ×ÁÎÔÁÖÉÔÉ Â¦Â̦ÏÔÅËÕ %s"
+
+#: if_python.c:258 if_ruby.c:272 if_tcl.c:206 mbyte.c:2584 os_win32.c:281
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: îÅ ÍÏÖÕ ÚÁ×ÁÎÔÁÖÉÔÉ Â¦Â̦ÏÔÅÞÎÕ ÆÕÎËæÀ %s"
+
+#: if_python.c:383
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr ""
+"E263: ÷ÉÂÁÞÔÅ, ÃÑ ËÏÍÁÎÄÁ ×ÉÍËÎÕÔÁ, ¦Â̦ÏÔÅËÁ Python ÎÅ ÍÏÖÅ ÂÕÔÉ "
+"ÚÁ×ÁÎÔÁÖÅÎÁ."
+
+#: if_python.c:583
+msgid "can't delete OutputObject attributes"
+msgstr "ÎÅ ÍÏÖÕ ×ÉÄÁÌÉÔÉ ÁÔÒÉÂÕÔÉ OutputObject"
+
+#: if_python.c:590
+msgid "softspace must be an integer"
+msgstr "softspace ÍÁ¤ ÂÕÔÉ ÎÁÔÕÒÁÌØÎÉÍ"
+
+# msgstr "E180: "
+#: if_python.c:598
+msgid "invalid attribute"
+msgstr "ÎÅצÒÎÉÊ ÁÔÒÉÂÕÔ"
+
+#: if_python.c:637 if_python.c:651
+msgid "writelines() requires list of strings"
+msgstr "writelines() ÐÏÔÒ¦ÂÅÎ ÓÐÉÓÏË ÒÑÄ˦×"
+
+#: if_python.c:777
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: ðÏÍÉÌËÁ ¦Î¦Ã¦Ñ̦ÚÁæ§ ÏÂ'¤ËÔ¦× ××ÏÄÕ/×É×ÏÄÕ"
+
+#: if_python.c:962 if_tcl.c:1403
+msgid "invalid expression"
+msgstr "ÎÅצÒÎÉÊ ×ÉÒÁÚ"
+
+#: if_python.c:976 if_tcl.c:1408
+msgid "expressions disabled at compile time"
+msgstr "ÏÂÒÏÂËÕ ×ÉÒÁÚ¦× ÚÁÂÏÒÏÎÅÎÏ ÐÏÄ ÞÁÓ ËÏÍЦÌÑæ§"
+
+#: if_python.c:989
+msgid "attempt to refer to deleted buffer"
+msgstr "ÓÐÒÏÂÁ ÞÉÔÁÔÉ ×ÉÄÁÌÅÎÉÊ ÂÕÆÅÒ"
+
+#: if_python.c:1004 if_python.c:1045 if_python.c:1109 if_tcl.c:1215
+msgid "line number out of range"
+msgstr "ÎÏÍÅÒ ÒÑÄËÁ ÚÁ ÍÅÖÁÍÉ ÆÁÊÌÁ"
+
+#: if_python.c:1242
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<ÏÂ'¤ËÔ ÂÕÆÅÒÁ (×ÉÄÁÌÅÎÏ) × %8lX>"
+
+#: if_python.c:1333 if_tcl.c:837
+msgid "invalid mark name"
+msgstr "ÎÅצÒÎÁ ÎÁÚ×Á ÐÏͦÔËÉ"
+
+#: if_python.c:1608
+msgid "no such buffer"
+msgstr "ÔÁËÏÇÏ ÂÕÆÅÒÁ ÎÅÍÁ¤"
+
+#: if_python.c:1696
+msgid "attempt to refer to deleted window"
+msgstr "ÓÔÒÏÂÁ Ú×ÅÒÎÕÔÉÓÑ ÄÏ ×ÉÄÁÌÅÎÏÇÏ ×¦ËÎÁ"
+
+#: if_python.c:1741
+msgid "readonly attribute"
+msgstr "ÌÉÛÅ ÄÌÑ ÞÉÔÁÎÎÑ"
+
+#: if_python.c:1754
+msgid "cursor position outside buffer"
+msgstr "ËÕÒÓÏÒ ÚÁ ÍÅÖÁÍÉ ÂÕÆÅÒÁ"
+
+#: if_python.c:1831
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<ÏÂ'¤ËÔ ×¦ËÎÁ (×ÉÄÁÌÅÎÏ) × %.8lX>"
+
+#: if_python.c:1843
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<ÏÂ'¤ËÔ ×¦ËÎÁ (ÎÅצÄÏÍÉÊ) × %.8lX>"
+
+#: if_python.c:1845
+#, c-format
+msgid "<window %d>"
+msgstr "<צËÎÏ %d>"
+
+#: if_python.c:1921
+msgid "no such window"
+msgstr "ÔÁËÏÇÏ ×¦ËÎÁ ÎÅÍÁ¤"
+
+#: if_python.c:2178 if_python.c:2213 if_python.c:2263 if_python.c:2326
+#: if_python.c:2446 if_python.c:2498 if_tcl.c:685 if_tcl.c:730 if_tcl.c:804
+#: if_tcl.c:874 if_tcl.c:1999
+msgid "cannot save undo information"
+msgstr "ÎÅ ÍÏÖÕ ÚÂÅÒÅÇÔÉ ¦ÎÆÏÒÍÁæÀ ÄÌÑ ×¦ÄͦÎÉ"
+
+#: if_python.c:2180 if_python.c:2270 if_python.c:2337
+msgid "cannot delete line"
+msgstr "ÎÅÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÑÄÏË"
+
+#: if_python.c:2215 if_python.c:2353 if_tcl.c:691 if_tcl.c:2021
+msgid "cannot replace line"
+msgstr "ÎÅÍÏÖÌÉ×Ï ÚÁͦÎÉÔÉ ÒÑÄÏË"
+
+#: if_python.c:2369 if_python.c:2448 if_python.c:2506
+msgid "cannot insert line"
+msgstr "ÎÅ ÍÏÖÕ ×ÓÔÁ×ÉÔÉ ÒÑÄÏË"
+
+#: if_python.c:2610
+msgid "string cannot contain newlines"
+msgstr "¦ÌØÛ Î¦Ö ÏÄÉÎ ÒÑÄÏË"
+
+#: if_ruby.c:401
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr ""
+"E266: ÷ÉÂÁÞÔÅ, ÃÑ ËÏÍÁÎÄÁ ×ÉÍËÎÕÔÁ, ¦Â̦ÏÔÅËÁ Ruby ÎÅ ÍÏÖÅ ÂÕÔÉ ÚÁ×ÁÎÔÁÖÅÎÁ."
+
+# msgstr "E233: "
+#: if_ruby.c:464
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E234: îÅצÄÏÍÉÊ ÓÔÁÔÕÓ longjmp: %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "ðÅÒÅÍËÎÕÔÉ implementation/definition"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "úÎÁÊÔÉ ÂÁÚÏ×ÉÊ ËÌÁÓ"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "ðÏËÁÚÁÔÉ ÚÁͦÎÅΦ(overridden) ÆÕÎËæ§-ÞÌÅÎÉ"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "úÞÉÔÁÔÉ Ú ÆÁÊÌÁ"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "úÞÉÔÁÔÉ Ú ÐÒÏÅËÔÕ"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "úÞÉÔÁÔÉ Ú ÕÓ¦È ÐÒÏÅËÔ¦×"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "úÞÉÔÁÔÉ"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "äÖÅÒÅÌÏ"
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "úÎÁÊÔÉ ÓÉÍ×ÏÌ"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ðÒÏÄÉ×ÉÔÉÓÑ ËÌÁÓ"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "úÎÁÊÔÉ ËÌÁÓ × ¦¤ÒÁÒȦ§"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "úÎÁÊÔÉ ËÌÁÓ × ÚÁÂÏÒÏÎÅÎ¦Ê §¤ÒÁÒȦ§"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ×ËÁÚÕ¤ ÎÁ"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "ÎÁ Xref ×ËÁÚÁÎÏ Ú"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ÍÁ¤"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ×ÉËÏÒÉÓÔÁÎÏ"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "ðÏËÁÚÁÔÉ docu"
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "óÔ×ÏÒÉÔÉ docu ÄÌÑ"
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr ""
+"îÅ ÍÏÖÕ Ú¤ÄÎÁÔÉÓÑ Ú SNiFF+. ðÅÒÅצÒÔÅ ÏÔÏÞÅÎÎÑ\n"
+"(sniffemacs ÎÅ ÂÕÌÏ ÚÎÁÊÄÅÎÏ Õ ÛÌÑÈÕ ÐÏÛÕËÕ).\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: ðÏÍÉÌËÁ ÐÁÄ ÞÁÓ ÚÞÉÔÕ×ÁÎÎÑ. ÷¦Ä¤ÄÎÁÎÏ"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "ÚÁÒÁÚ SNiFF"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "ÎÅ "
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "ЦĤÄÎÁÎÉÊ"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: îÅצÄÏÍÅ ÚÁÐÉÔÁÎÎÑ ÄÏ SNiFF+: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ Ú¤ÄÎÁÎÎÑ Ú SNiFF+"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: SNiFF+ ΊЦĤÄÎÁÎÏ"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: îÅ ¤ ÂÕÆÅÒÏÍ SNiFF+"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff. ÐÏÍÉÌËÁ ÚÁÐÉÓÕ. ÷¦Ä¤ÄÎÁÎÏ"
+
+#: if_tcl.c:419
+msgid "invalid buffer number"
+msgstr "ÎÅצÒÎÁ ÎÁÚ×Á ÂÕÆÅÒÁ"
+
+#: if_tcl.c:465 if_tcl.c:932 if_tcl.c:1111
+msgid "not implemented yet"
+msgstr "ΊĦ¤ (ÐÏËÉ ÝÏ)"
+
+#: if_tcl.c:502
+msgid "unknown option"
+msgstr "ÎÅצÄÏÍÁ ÏÐæÑ"
+
+#. ???
+#: if_tcl.c:775
+msgid "cannot set line(s)"
+msgstr "ÎÅ ÍÏÖÕ ÚÁÄÁÔÉ ÒÑÄËÉ"
+
+# msgstr "E19: "
+#: if_tcl.c:846
+msgid "mark not set"
+msgstr "ÐÏͦÔËÕ ÎÅ ×ËÁÚÁÎÏ"
+
+#: if_tcl.c:852 if_tcl.c:1067
+#, c-format
+msgid "row %d column %d"
+msgstr "ÒÑÄÏË %d ËÏÌÏÎËÁ %d"
+
+#: if_tcl.c:882
+msgid "cannot insert/append line"
+msgstr "îÅ ÍÏÖÕ ×ÓÔÁ×ÉÔÉ/ÄÏÄÁÔÉ ÒÑÄÏË"
+
+#: if_tcl.c:1269
+msgid "unknown flag: "
+msgstr "ÎÅצÄÏÍÉÊ ÐÒÁÐÏÒÅÃØ: "
+
+#: if_tcl.c:1339
+msgid "unknown vimOption"
+msgstr "îÅצÄÏÍÁ ÏÐæÑ"
+
+#: if_tcl.c:1424
+msgid "keyboard interrupt"
+msgstr "ÐÅÒÅÒ×ÁÎÏ ËÏÒÉÓÔÕ×ÁÞÅÍ"
+
+#: if_tcl.c:1429
+msgid "vim error"
+msgstr "ÐÏÍÉÌËÁ Vim"
+
+#: if_tcl.c:1472
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "ÎÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ËÏÍÁÎÄÕ ÄÌÑ ×¦ËÎÁ/ÂÕÆÅÒÁ: ÏÂ'ÅËÔ ×ÉÄÑÌѤÔØÓÑ"
+
+#: if_tcl.c:1546
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "îÅ ÍÏÖÕ ÚÁÒŤÓÔÒÕ×ÁÔÉ ÐÏĦÀ: ÂÕÆÅÒ/צËÎÏ ÕÖÅ ÚÎÉÝÕ¤ÔØÓÑ"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1563
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to "
+"vim-dev@vim.org"
+msgstr ""
+"E280: ðïíéìëá × ¦ÎÔÅÒÆÅÊÓ¦ Ú TCL: ÍÏÖÌÉ×Ï ÐÏÛËÏÄÖÅÎÏ ÓÐÉÓÏË ÐÏÓÉÌÁÎÎØ.. "
+"ðÏצÄÏÍÔÅ, ÂÕÄØÌÁÓËÁ, ÎÁ vim-dev@vim.org"
+
+#: if_tcl.c:1564
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "îÅ ÍÏÖÕ ÚÁÒŤÓÔÒÕ×ÁÔÉ ÐÏĦÀ: ÐÏÓÉÌÁÎÎÑ ÎÁ ÂÕÆÅÒ/צËÎÏ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: if_tcl.c:1725
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "÷ÉÂÁÞÔÅ, ÃÑ ËÏÍÁÎÄÁ ×ÉÍËÎÕÔÁ, ¦Â̦ÏÔÅËÁ Tcl ÎÅ ÍÏÖÅ ÂÕÔÉ ÚÁ×ÁÎÔÁÖÅÎÁ."
+
+#: if_tcl.c:1887
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr ""
+"E280: ðïíéìëá × ¦ÎÔÅÒÆÅÊÓ¦ Ú TCL: ÍÏÖÌÉ×Ï ÒÅÚÕÌØÔÁÔ ÎÅ int.. ðÏצÄÏÍÔÅ, "
+"ÂÕÄØÌÁÓËÁ, ÎÁ vim-dev@vim.org"
+
+#: if_tcl.c:2007
+msgid "cannot get line"
+msgstr "ÎÅ ÍÏÖÕ Ä¦ÓÔÁÔÉ ÒÑÄÏË"
+
+#: if_xcmdsrv.c:209
+msgid "Unable to register a command server name"
+msgstr "îÅ ÍÏÖÕ ÚÁÒŤÓÔÒÕ×ÁÔÉ ¦Í'Ñ ÓÅÒ×ÅÒÁ"
+
+#: if_xcmdsrv.c:422
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E354: îÅÍÁ¤ ÚÁÒÅÅÓÔÒÏ×ÁÎÉÈ ÓÅÒ×ÅÒ¦× ÎÁ ¦Í'Ñ \"%s\""
+
+#: if_xcmdsrv.c:451
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: îÅ ×ÄÁÌÏÓÑ ×¦Ä¦ÓÌÁÔÉ ËÏÍÁÎÄÕ ÄÏ Ë¦ÎÃÅ×ϧ ÐÒÏÇÒÁÍÉ"
+
+#: if_xcmdsrv.c:719
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "÷ÉËÏÒÉÓÔÁÎÏ ÎÅצÒÎÕ ÎÁÚ×Õ ÓÅÒ×ÅÒÁ :%s"
+
+#: if_xcmdsrv.c:1066
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: ÎÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ÞÁÓÔÉÎÕ ÒŤÓÔÒÕ ÚÒÁÚËÁ Vim"
+
+#: if_xcmdsrv.c:1077
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: ÞÁÓÔÉÎÁ ÒŤÓÔÒÕ ÚÒÁÚËÁ Vim ÎÅצÒÎÏ ÚÆÏÒÍÏ×ÁÎÁ. ÷ÉÄÁÌÅÎÏ!"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "îÅצÄÏÍÁ ÏÐæÑ"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "úÁÂÁÇÁÔÏ ÁÒÇÕÍÅÎÔ¦×"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "÷ÔÒÁÞÅÎÏ ÁÒÇÕÍÅÎÔÉ Ð¦ÓÌÑ"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "óͦÔÔÑ ÐÏÓÌÑ ÏÐæ§"
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "úÁÂÁÇÁÔÏ '+' ÁÂÏ '-c' ÁÒÇÕÍÅÎÔ¦×"
+
+# msgstr "E14: "
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "îÅצÒÎÉÊ ÁÒÇÕÍÅÎÔ ÄÌÑ"
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "ãÑ ×ÅÒÓ¦Ñ Vim ÎÅ ÂÕÌÁ ÚËÏÍЦÌØÏ×ÁÎÁ Ú Ð¦ÄÔÒÉÍËÏÀ diff."
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "óÐÒÏÂÁ צÄËÒÉÔÉ ÝÅ ÒÁÚ ÆÁÊÌ ËÏÍÁÎÄ \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:1058 version.c:1063 version.c:1068 version.c:1073 version.c:1078
+#: version.c:1083 version.c:1089 version.c:1093 version.c:1097 version.c:1102
+#: version.c:1109 version.c:1117 version.c:1123
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÑË ×¦È¦ÄÎÉÊ ÆÁÊÌ: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "%d ÆÁÊÌ¦× ÚÁÌÉÛÉÌÏÓØ\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: õ×ÁÇÁ: ÷ÉÈ¦Ä ÊÄÅ ÎÅ ÎÁ ÔÅÒͦÎÁÌ\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: õ×ÁÇÁ: ÷ȦÄÎ ÊÄÅ ÎÅ Ú ÔÅÒͦÎÁÌÕ\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "ËÏÍÁÎÄÉ Ñ˦ ×ÉËÏÎÕ×ÁÌÉÓÑ ÄÏ vimrc"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ \"%s\""
+
+# msgstr "E282: "
+#: main.c:2175
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"÷ÚÎÁÊÔŠ¦ÌØÛÅ: vim -h\n"
+
+#: main.c:2208
+msgid "[file ..] edit specified file(s)"
+msgstr "[ÆÁÊÌ ..] ÒÅÄÁÇÕ×ÁÔÉ ×ËÁÚÁÎÉÊ ÆÁÊÌ"
+
+#: main.c:2209
+msgid "- read text from stdin"
+msgstr "- ÞÉÔÁÔÉ ÔÅËÓÔ Ú stdin"
+
+#: main.c:2210
+msgid "-t tag edit file where tag is defined"
+msgstr "-t ÐÏͦÔËÁ ÐÅÒÅÔÉ ÄÏ ÐÏͦÔËÉ"
+
+#: main.c:2212
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [ÆÁÊÌ] ÐÅÒÅÊÔÉ ÄÏ ÐÅÒÛϧ ÐÏÍÉÌËÉ"
+
+#: main.c:2221
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+"÷ÖÉ×ÁÊÔÅ:"
+
+#: main.c:2224
+msgid " vim [arguments] "
+msgstr " vim [ÁÒÇÕÍÅÎÔÉ] "
+
+#: main.c:2228
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ÁÂÏ:"
+
+#: main.c:2231
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"áÒÇÕÍÅÎÔÉ:\n"
+
+#: main.c:2232
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tìÉÛÅ ¦ÍÅÎÁ ÆÁÊÌ¦× Ð¦ÓÌÑ ÃØÏÇÏ"
+
+#: main.c:2234
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\túÁÒŤÓÔÒÕ×ÁÔÉ ÃÅÊ gvim ÞÅÒÅÚ OLE"
+
+#: main.c:2235
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\t÷¦ÄͦÎÉÔÉ ÒŤÓÔÒÁæÀ ÃØÏÇÏ gvim ÞÅÒÅÚ OLE"
+
+#: main.c:2238
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\t÷ÉËÏÎÁÔÉ ×ÉËÏÒÉÓÔÏ×ÕÀÞÉ GUI (ΦÂÉ \"gvim\")"
+
+#: main.c:2239
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tîÅ ÚÁÌÉÛÁÔÉ ÔÅÒͦÎÁÌ Ð¦ÓÌÑ ÚÁÐÕÓËÕ GUI"
+
+#: main.c:2241
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tòÅÖÉÍ Vi (ΦÂÉ \"vi\")"
+
+#: main.c:2242
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tòÅÖÉÍ Ex (ΦÂÉ \"ex\")"
+
+#: main.c:2243
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tðÒÁÃÀ×ÁÔÉ ÍÏ×ÞËÉ (ÌÉÛÅ ÄÌÑ \"ex\")"
+
+#: main.c:2245
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tòÅÖÉÍ diff (ΦÂÉ \"vimdiff\")"
+
+#: main.c:2247
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tðÒÏÓÔÉÊ ÒÅÖÉÍ (ΦÂÉ \"evim\")"
+
+#: main.c:2248
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tòÅÖÉÍ ÐÅÒÅÇÌÑÄÕ (ΦÂÉ \"view\")"
+
+#: main.c:2249
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\túÁÂÏÒÏÎÅÎÉÊ ÒÅÖÉÍ (ΦÂÉ \"rvim\")"
+
+#: main.c:2250
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\túͦÎÉ (ÚÁÐÉÓ ÆÁÊ̦×) ÎÅ ÄÏÚ×ÏÌÅÎÏ"
+
+#: main.c:2251
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\túͦÎÉ × ÔÅËÓÔ¦ ÆÁÊÌ¦× ÎÅ ÄÏÚ×ÏÌÅÎÏ"
+
+#: main.c:2252
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\täצÊËÏ×ÉÊ ÒÅÖÉÍ"
+
+#: main.c:2254
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tòÅÖÍÉ lisp"
+
+#: main.c:2256
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\tòÅÖÉÍ, ÓÕͦÓÎÉÊ Ú Vi: 'compatible'"
+
+#: main.c:2257
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\tîÅ ÚÏ×Ó¦Í ÓÕͦÓÎÉÊ Ú Vi ÒÅÖÉÍ: 'nocompatible'"
+
+#: main.c:2258
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tò¦×ÅÎØ ÇÁÌÁÓÌÉ×ÏÓÔ¦"
+
+#: main.c:2259
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tòÅÖÉÍ ÎÁÌÁÇÏÄÖÕ×ÁÎÎÑ"
+
+#: main.c:2260
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tîÅ ËÏÒÉÓÔÕ×ÁÔÉÓÑ ÆÁÊÌÏÍ ÏÂͦÎÕ, ÔÒÉÍÁÔÉ ÕÓÅ × ÐÁÍ'ÑÔ¦"
+
+#: main.c:2261
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tðÏËÁÚÁÔÉ ÆÁÊÌÉ ÏÂͦÎÕ ¦ ×ÉÊÔÉ"
+
+#: main.c:2262
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (¦ÍÑ ÆÁÊÌÁ)\t÷¦ÄÎÏ×ÉÔÉ Á×ÁÒ¦ÊÎÏ ÚÁ˦ÎÞÅÎÉÊ ÓÅÁÎÓ"
+
+#: main.c:2263
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tôÅ ÓÁÍÅ ÝÏ Ê -r"
+
+#: main.c:2265
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tñ ÔÁË ÒÏÚÕͦÀ ÃÅ ÌÉÛÅ ÄÌÑ Amiga. ÷ÉÂÁÞ, Bram."
+
+#: main.c:2266
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <ÐÒÉÓÔÒ¦Ê>\t\t\t÷ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ÐÒÉÓÔÒ¦Ê ÄÌÑ ××ÏÄÕ/×É×ÏÄÕ"
+
+#: main.c:2269
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tòÏÚÐÏÞÁÔÉ ÒÅÖÉͦ Hebrew"
+
+#: main.c:2272
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tòÏÚÐÏÞÁÔÉ × ÐÅÒÓØËÏÍÕ ÒÅÖÉͦ"
+
+#: main.c:2274
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <ÔÅÒͦÎÁÌ>\t÷ÉÚÎÉÞÉÔÉ ÔÉÐ ÔÅÒͦÎÁÌÕ"
+
+#: main.c:2275
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t÷ÉËÏÒÉÓÔÁÔÉ ÐÏÄÁÎÉÊ ÆÁÊÌ ÑË .vimrc"
+
+#: main.c:2277
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-u <gvimrc>\t\t÷ÉËÏÒÉÓÔÁÔÉ ÐÏÄÁÎÉÊ ÆÁÊÌ ÑË .gvimrc"
+
+#: main.c:2279
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tîÅ ×ÁÎÔÁÖÉÔÉ ÆÁÊÌÉ-ÄÏÐÏ×ÎÅÎÎÑ"
+
+#: main.c:2280
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr ""
+"-o[N]\t\tòÏÚËÒÉÔÉ N צËÏÎ (ÑËÝÏ ÎÅ ×ËÁÚÁÎÏ -- ÐÏ\n"
+"\t\t\tÏÄÎÏÍÕ ÄÌÑ ËÏÖÎÏÇÏ ÆÁÊÌÁ)"
+
+#: main.c:2281
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tΦÂÉ -o, ÁÌÅ ÐÏĦÌÉÔÉ ×¦ËÎÁ ×ÅÒÔÉËÁÌØÎÏ"
+
+#: main.c:2282
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tòÏÚÐÏÞÁÔÉ × Ë¦Îæ ÆÁÊÌÁ"
+
+#: main.c:2283
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<ÒÑÄÏË>\t\tòÏÚÐÏÞÁÔÉ ÎÁ ×ËÁÚÁÎÏÍÕ ÒÑÄËÕ"
+
+#: main.c:2285
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr ""
+"--cmd <ËÏÍÁÎÄÁ>\t÷ÉËÏÎÁÔÉ ËÏÍÁÎÄÕ ÐÅÒÅÄ ×ÉËÏÎÁÎÎÑÍ ÂÕÄØ-ÑËÉÈ .*rc ÆÁÊ̦×"
+
+#: main.c:2287
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <ËÏÍÁÎÄÁ>\t\t÷ÉËÏÎÁÔÉ ËÏÍÁÎÄÕ Ð¦ÓÌÑ ÚÁ×ÁÎÔÁÖÅÎÎÑ ÐÅÒÛÏÇÏ ÆÁÊÌÁ"
+
+#: main.c:2288
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <ÓÅÁÎÓ>\t\t÷ÉËÏÎÁÔÉ ÐÏÄÁÎÉÊ ÆÁÊÌ Ð¦ÓÌÑ ÐÅÒÛÏÇÏ ÚÁ×ÁÎÔÁÖÅÎÏÇÏ ÆÁÊÌÁ"
+
+#: main.c:2289
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <ÆÁÊÌ>\t\túÞÉÔÁÔÉ ËÏÍÁÎÄÉ Ú ÆÁÊÌÁ <scriptin>"
+
+#: main.c:2290
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <ÆÁÊÌ>\t\täÏÐÉÓÁÔÉ ÕÓ¦ ÎÁÂÒÁΦ ËÏÍÁÎÄÉ ÄÏ ÐÏÄÁÎÏÇÏ ÆÁÊÌÁ"
+
+#: main.c:2291
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-w <ÆÁÊÌ>\t\túÁÐÉÓÁÔÉ ÕÓ¦ ÎÁÂÒÁΦ ËÏÍÁÎÄÉ Õ ÐÏÄÁÎÉÊ ÆÁÊÌ"
+
+#: main.c:2293
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\tòÅÄÁÇÕ×ÁÔÉ ÚÁÛÉÆÒÏ×ÁÎÉÊ ÆÁÊÌ"
+
+#: main.c:2297
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <ÄÉÓÐÌÅÊ>\t÷ÉËÏÎÁÔÉ vim ×ÉËÏÒÉÓÔÏ×ÕÀÞÉ ÐÏÄÁÎÉÊ ÄÉÓÐÌÅÊ"
+
+#: main.c:2299
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tîÅ Ú'¤ÄÎÕ×ÁÔÉÓÑ Ú X ÓÅÒ×ÅÒÏÍ"
+
+#: main.c:2301
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\t÷¦ÄËÔÉÒÉ Vim × ¦ÎÛÏÍÕ ÅÌÅÍÅÎÔ¦ ¦ÎÔÅÒÆÅÊÓÕ GTK"
+
+#: main.c:2305
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <ÆÁÊÌÉ>\tòÅÄÁÇÕ×ÁÔÉ ÆÁÊÌÉ ÎÁ Vim ÓÅÒ×ÅÒ¦ ¦ ÚÁ×ÅÒÛÉÔÉ ÒÏÂÏÔÕ"
+
+#: main.c:2306
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr ""
+"--remote-wait <ÆÁÊÌÉ> ..., ÁÌÅ ÚÁÞÅËÁÔÉ ÐÏËÉ ÕÓ¦ ÆÁÊÌÉ ÂÕÄŠצÄÒÅÄÁÇÏ×ÁÎÏ"
+
+#: main.c:2307
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <ÓÉÍ×ÏÌÉ> ÷¦Ä¦ÓÌÁÔÉ <ÓÉÍ×ÏÌÉ> ÓÅÒ×ÅÒÕ ¦ ÚÁ×ÅÒÛÉÔÉ ÒÏÂÏÔÕ"
+
+#: main.c:2308
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr ""
+"--remote-expr <×ÉÒÁÚ> ÷ÉËÏÎÁÔÉ ×ÉÒÁÚ ÎÁ ÓÅÒ×ÅÒ¦, ¦ ÎÁÄÒÕËÕ×ÁÔÉ ÒÅÚÕÌØÔÁÔ"
+
+#: main.c:2309
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr ""
+"--serverlist\t\tðÏËÁÚÁÔÉ ÓÐÉÓÏË ÎÁÑ×ÎÉÈ ÓÅÒ×ÅÒ¦× Vim ¦ ÚÁ×ÅÒÛÉÔÉ ÒÏÂÏÔÕ"
+
+#: main.c:2310
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <¦Í'Ñ>\tóЦÌËÕ×ÁÔÉÓÑ Ú/ÓÔÁÔÉ Vim ÓÅÒ×ÅÒÏÍ Ú ÐÏÄÁÎÉÍ ¦Í'ÑÍ"
+
+#: main.c:2313
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t÷ÉËÏÒÉÓÔÁÔÉ ÐÏÄÁÎÉÊ ÆÁÊÌ ÑË .viminfo"
+
+#: main.c:2315
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\tîÁÄÒÕËÕ×ÁÔÉ ÃÅ ÐÏצÄÏÍÌÅÎÎÑ, ¦ ×ÉÊÔÉ"
+
+#: main.c:2316
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\tÎÁÄÒÕËÕ×ÁÔÉ ¦ÎÆÏÒÍÁæÀ ÐÒÏ ×ÅÒÓ¦À ÐÒÏÇÒÁÍÉ"
+
+#: main.c:2320
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÉ ÄÌÑ gvim (×ÅÒÓ¦Ñ Motif)\n"
+
+#: main.c:2323
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÉ ÄÌÑ gvim (×ÅÒÓ¦Ñ Athena)\n"
+
+#: main.c:2326
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <ÄÉÓÐÌÅÊ>\t÷ÉËÏÎÁÔÉ vim ×ÉËÏÒÉÓÔÏ×ÕÀÞÉ ÐÏÄÁÎÉÊ ÄÉÓÐÌÅÊ"
+
+#: main.c:2327
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\túÁÐÉÓÔÉÔÉ Vim"
+
+#: main.c:2329
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <¦Í'Ñ>\t\t÷ÉËÏÒÉÓÔÁÔÉ ÒÅÓÕÒÓÉ ÄÌÑ <¦Í`Ñ>"
+
+#: main.c:2330
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (îŠĦ¤)\n"
+
+#: main.c:2332
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <ËÏ̦Ò>\t÷ÉËÏÒÉÓÔÁÔÉ <ËÏ̦Ò> ÄÌÑ ÆÏÎÕ (ÔÁËÏÖ: -bg)"
+
+#: main.c:2333
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr ""
+"-foreground <ËÏ̦Ò>\t÷ÉËÏÒÉÓÔÁÔÉ <ËÏ̦Ò> ÄÌÑ Ú×ÉÞÁÊÎÏÇÏ ÔÅËÓÔÕ (ÔÁËÏÖ: -fg)"
+
+#: main.c:2334 main.c:2354
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <ÛÒÉÆÔ>\t÷ÉËÏÒÉÓÔÁÔÉ <ÛÒÉÆÔ> ÄÌÑ Ú×ÉÞÁÊÎÏÇÏ ÔÅËÓÔÕ (ÔÁËÏÖ: -fn)"
+
+#: main.c:2335
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <ÛÒÉÆÔ>\t÷ÉËÏÒÉÓÔÁÔÉ <ÛÒÉÆÔ> ÄÌÑ ÖÉÒÎÏÇÏ ÔÅËÓÔÕ"
+
+#: main.c:2336
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <ÛÒÉÆÔ>\t÷ÉËÏÒÉÓÔÁÔÉ <ÛÒÉÆÔ> ÄÌÑ ÐÏÈÉÌÏÇÏ ÔÅËÓÔÕ"
+
+#: main.c:2337 main.c:2355
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <ÇÅÏÍ>\túÁÄÁÔÉ ÒÏÚͦÔÉ ÔÁ ÐÏÌÏÖÅÎÎÑ (ÔÁËÏÖ: -geom)"
+
+#: main.c:2338
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <ÔÏ×Ý>\t÷ÓÔÁÎÏ×ÉÔÉ ÔÏ×ÝÉÎÕ ÍÅÖ <ÔÏ×Ý> (ÔÁËÏÖ: -bw)"
+
+#: main.c:2339
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <ÔÏ×Ý> ÷ÓÔÁÎÏ×ÉÔÉ ÔÏ×ÝÉÎÕ Ì¦Î¦ÊËÉ ÚÓÕ×Õ (ÔÁËÏÖ: -sw)"
+
+#: main.c:2341
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <×ÉÓÏÔÁ>\t÷ÓÔÁÎÏ×ÉÔÉ ×ÉÓÏÔÕ ÍÅÎÀ <×ÉÓÏÔÁ> (ÔÁËÏÖ: -mh)"
+
+#: main.c:2343 main.c:2356
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tïÂÅÒÎÕÔÉ ËÏÌØÏÒÉ (ÔÁËÏÖ: -rv)"
+
+#: main.c:2344
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tîÅ ÏÂÅÒÔÁÔÉ ËÏÌØÏÒÉ (ÔÁËÏÖ: +rv)"
+
+#: main.c:2345
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <ÒÅÓÕÒÓ>\t÷ÓÔÁÎÏ×ÉÔÉ ×¦ÄÐÏצÄÎÉÊ ÒÅÓÕÒÓ"
+
+#: main.c:2348
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"áÒÛÕÍÅÎÔÉ ÄÏ gvim (×ÅÒÓ¦Ñ RISC OS):\n"
+
+#: main.c:2349
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <˦ÌØ˦ÓÔØ>\tðÏÞÁÔËÏ×Á ÛÉÒÉÎÁ צËÎÁ × ÓÉÍ×ÏÌÁÈ"
+
+#: main.c:2350
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <˦ÌØ˦ÓÔØ>\tðÏÞÁËÏ×Á ×ÉÓÏÔÁ צËÎÁ × ÒÑÄËÁÈ"
+
+#: main.c:2353
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"áÒÇÕÍÅÎÔÉ ÄÌÑ gvim (×ÅÒÓ¦Ñ GTK+)\n"
+
+#: main.c:2357
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr ""
+"-display <ÄÉÓÐÌÅÊ>\t÷ÉËÏÎÁÔÉ vim ÎÁ ÐÏÄÁÎÏÍÕ ÄÉÓÐÌŧ (ÔÁËÏÖ: --display)"
+
+#: main.c:2359
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tðÏËÁÚÁÔÉ ÁÒÇÕÍÅÎÔÉ Gnome"
+
+#. Failed to send, abort.
+#: main.c:2584
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"óÐÒÏÂÁ צĦÓÌÁÔÉ ×ÉÒÁÚ ÎÅ ×ÄÁÌÁÓÑ.\n"
+
+#. Let vim start normally.
+#: main.c:2589
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"îÅ ×ÄÁÌÏÓÑ ×¦Ä¦ÓÌÁÔÉ ÄÁΦ. óÐÒÏÂÕ¤ÍÏ ×ÉËÏÎÁÔÉ ÎÁ ͦÓæ\n"
+
+#: main.c:2622 main.c:2643
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d Ú %d ÆÁÊÌ¦× ×¦ÄÒÅÄÁÇÏ×ÁÎÏ"
+
+#: main.c:2666
+msgid "Send expression failed.\n"
+msgstr "óÐÒÏÂÁ צĦÓÌÁÔÉ ×ÉÒÁÚ ÎÅ ×ÄÁÌÁÓÑ.\n"
+
+#: mark.c:660
+msgid "No marks set"
+msgstr "öÏÄÎÉÈ ÐÏͦÔÏË ÎÅ ÂÕÌÏ ×ËÁÚÁÎÏ"
+
+#: mark.c:662
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: ðÏͦÔËÕ \"%s\" ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E283: "
+#. Highlight title
+#: mark.c:673
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"ÐÏÍ. ÒÑÄ. ËÏÌ. ÆÁÊÌ/ÔÅËÓÔ"
+
+#. Highlight title
+#: mark.c:711
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+
+# TODO
+#: mark.c:1073
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# ðÏͦÔËÉ:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1108
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# óÐÉÓÏË ÐÅÒÅÈÏĦ×\n"
+
+# TODO
+#: mark.c:1203
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ðÏÐÅÒÅÄΦ ÐÏͦÔËÉ × ÆÁÊÌÁÈ (ÓÐÏÞÁÔËÕ ÎÏצ):\n"
+
+#: mark.c:1286
+msgid "Missing '>'"
+msgstr "÷ÔÒÁÞÅÎÏ '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "ëÏÄÏ×Á ÓÔÏÒ¦ÎËÁ ÎÅ ¦ÓÎÕ¤"
+
+#: mbyte.c:3029
+msgid "E284: Cannot set IC values"
+msgstr "E284: îÅ ÍÏÖÕ ×ÓÔÁÎÏ×ÉÔÉ ÚÎÁÞÅÎÎÑ IC"
+
+#: mbyte.c:3181
+msgid "E285: Failed to create input context"
+msgstr "E285: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÓÔ×ÏÒÅÎÎÑ `input context'"
+
+#: mbyte.c:3328
+msgid "E286: Failed to open input method"
+msgstr "E286: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÓÔ×ÏÒÅÎÎÑ `input method'"
+
+# msgstr "E286: "
+#: mbyte.c:3339
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: õ×ÁÇÁ: ÎÅ ÍÏÖÕ ×ÓÔÁÎÏ×ÉÔÉ ÐÏĦÀ ÄÌÑ ÚÎÉÝÅÎÎÑ IM"
+
+# msgstr "E287: "
+#: mbyte.c:3345
+msgid "E288: input method doesn't support any style"
+msgstr "E288: `input method' ΊЦÄÔÒÉÍÕ¤ ÓÔÉ̦"
+
+# msgstr "E288: "
+#: mbyte.c:3402
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: `input method' ΊЦÄÔÒÉÍÕ¤ ÒÅÄÁÇÏ×ÁΦ ÔÉÐÉ"
+
+# msgstr "E289: "
+#: mbyte.c:3476
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: ÓÔÉÌØ ×ÉÍÁÇÁ¤ fontset"
+
+# msgstr "E290: "
+#: mbyte.c:3504
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: ÷ÅÒÓ¦Ñ Â¦Â̦ÏÔÅËÉ GTK+ ÍÅÎÛÁ ÚÁ 1.2.3. `Status area' ×ÉÍËÎÕÔÏ"
+
+# msgstr "E291: "
+#: mbyte.c:3741
+msgid "E292: Input Method Server is not running"
+msgstr "E292: IM ÓÅÒ×ÅÒ ÎÅ ÆÕÎËæÏÎÕ¤"
+
+# msgstr "E292: "
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: ÂÌÏË ÎÅ ÂÕÌÏ ÚÁƦËÓÏ×ÁÎÏ"
+
+# msgstr "E293: "
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ðÏÍÉÌËÁ ÚͦÎÉ ÐÏÚ¦ÃÉÉ Õ ÆÁÊ̦ ÏÂͦÎÕ"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: ðÏÍÉÌËÁ ÚÞÉÔÕ×ÁÎÎÑ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ðÏÍÉÌËÁ ÚͦÎÉ ÐÏÚ¦ÃÉÉ Ð¦Ä ÞÁÓ ÚÁÐÉÓÕ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: ðÏÍÉÌËÁ ÚÁÐÉÓÕ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: æÁÊÌ ÏÂͦÎÕ ÕÖÅ ¦ÓÎÕ¤! (ÚÌÏ×ÍÉÓÎÉË??)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: îÅÍÁ¤ ÂÌÏËÕ 0? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: îÅÍÁ¤ ÂÌÏËÕ 1? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E298: "
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: îÅÍÁ¤ ÂÌÏËÕ 2? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: æÁÊÌ ÏÂͦÎÕ ×ÔÒÁÞÅÎÏ!!!"
+
+# msgstr "E301: "
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: îÅ ÍÏÖÕ ÐÅÒÅÊÍÅÎÕ×ÁÔÉ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+# msgstr "E302: "
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: ÎÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÆÁÊÌ ÏÂͦÎÕ ÄÌÑ \"%s\", צÄÎÏ×ÌÅÎÎÑ ÎÅÍÏÖÌÉ×Å"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: îÅÍÁ¤ ÂÌÏËÕ 0?? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: îÅ ÚÎÁÊÄÅÎÏ ÆÁÊÌÕ ÏÂͦÎÕ ÄÌÑ %s"
+
+# msgstr "E305: "
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "ñËÉÊ ÓÁÍÅ ÆÁÊÌ ÏÂͦÎÕ ×ÉËÏÒÉÓÔÁÔÉ (0 ÄÌÑ ×ÉÈÏÄÕ):"
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "îÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ÂÌÏË 0 Ú "
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"îÁÐÅ×ÎÏ ÚͦΠÎÅ ÂÕÌÏ, ÁÂÏ Vim ÎÅ ÐÏÎÏ×É× ÆÁÊÌ ÏÂͦÎÕ."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ÎÅÐÒÉÄÁÔÎÉÊ ÄÌÑ ×ÉËÏÒÉÓÔÁÎÎÑ Ú Ã¦¤À ×ÅÒÓ¦¤À Vim.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "úÎÁÊĦÔØ Vim 3.0\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ÎÅ ÓÈÏÖÅ ÎÁ ÆÁÊÌ ÏÂͦÎÕ Vim"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ÎÅÐÒÉÄÁÔÎÉÊ ÄÏ ×ÉËÏÒÉÓÔÁÎÎÑ ÎÁ ×ÁÛ¦Ê ÁÒȦÔÅËÔÕÒ¦.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "æÁÊÌ ÂÕÌÏ ÓÔ×ÏÒÅÎÏ ÎÁ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"ÁÂÏ ÆÁÊÌ ÂÕÌÏ ÐÏÛËÏÄÖÅÎÏ."
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "÷ÉËÕÒÏÓÔÏ×À ÆÁÊÌ ÏÂͦÎÕ \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "ðÏÞÁÔËÏ×ÉÊ ÆÁÊÌ \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: õ×ÁÇÁ: íÏÖÌÉ×Ï, ÐÏÞÁÔËÏ×ÉÊ ÆÁÊÌ ÂÕÌÏ ÚͦÎÅÎÏ"
+
+# msgstr "E308: "
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: îÅ ÍÏÄÕ ÚÞÉÔÁÔÉ ÂÌÏË 1 Ú %s"
+
+# msgstr "E309: "
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "??? âÁÇÁÔÏ ÒÑÄË¦× ×ÔÒÁÞÅÎÏ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "??? îÅצÒÎÁ ˦ÌØ˦ÓÔØ ÒÑÄ˦×"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "??? ðÏÒÏÖÎ¦Ê ÂÌÏË"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "??? òÑÄËÉ ×ÔÒÁÞÅÎÏ"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: éÄÅÎÔÉƦËÁÔÏÒ ÂÌÏËÕ 1 ÎÅצÒÎÉÊ (ÍÏÖÌÉ×Ï %s ÎÅ ÆÁÊÌ ÏÂͦÎÕ?)"
+
+# msgstr "E310: "
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "??? âÌÏË ×ÔÒÁÞÅÎÏ"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ÷¦Ä ÃØÏÇÏ ÒÑÄËÁ ¦ ÄÏ `??? ë¦ÎÅÃØ' ÒÑÄËÉ ÍÏÖÕÔØ ÂÕÔÉ ÓÐÌÕÔÁΦ"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr ""
+"??? ÷¦Ä ÃØÏÇÏ ÒÑÄËÁ ¦ ÄÏ `??? ë¦ÎÅÃØ' ÒÑÄËÉ ÍÏÖÕÔØ ÂÕÔÉ ÄÏÄÁΦ/×ÔÒÁÞÅΦ"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "??? ë¦ÎÅÃØ"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: ÷¦ÄÎÏ×ÌÅÎÎÑ ÐÅÒÅÒ×ÁÎÏ"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr ""
+"E312: ð¦Ä ÞÁÓ ×¦ÄÎÏ×ÌÅÎÎÑ ÚÎÁÊÄÅÎ ÐÏÍÉÌËÉ.. ðÉÌØÎÕÊÔÅ ÒÑÄËÉ ÝÏ ÐÏÞÉÎÁÀÉÔØÓÑ "
+"Ú `???'"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "÷¦ÄÎÏ×ÌÅÎÎÑ ÚÁ˦ÎÞÅÎÏ, ÐÅÒÅצÒÔÅ ÞÉ ×ÓÅ ÐÒÁ×ÉÌØÎÏ."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(ñËÝÏ ÂÁÖÁ¤ÔÅ, ÍÏÖÅÔÅ ÚÁÐÁÍ'ÑÔÁÔÉ ÃÅÊ ÆÁÊÌ Ú ¦ÎÛÉÍ ¦ÍÅÎÅÍ\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "¦, ÐÏÒ¦×Ñ×ÛÉ Ú ÏÒÉǦÎÉÌÏÍ, ÐÅÒÅצÒÔÅ ÚͦÎÉ)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"ð¦ÓÌÑ ÃØÏÇÏ, ×ÉÄÁ̦ÔØ ÆÁÊÌ ÏÂͦÎÕ.\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "úÎÁÊÄÅÎÏ ÆÁÊÌÉ ÏÂͦÎÕ:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " ÷ ÐÏÔÏÞÎ¦Ê ÄÉÒÅËÔÏÒ¦§:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " ÷ÉËÏÒÉÓÔÏ×ÕÀÖÉ ×ËÁÚÁÎÕ ÎÁÚ×Õ:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " õ ÄÉÒÅËÔÏÒ¦§ "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- ÖÏÄÎÏÇÏ --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " ×ÌÁÓÎÉË: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " ÄÁÔÏ×ÁÎÏ: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " ÄÁÔÏ×ÁÎÏ: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [×¦Ä Vim 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [ÎÅ ÓÈÏÖÅ ÎÁ ÆÁÊÌ ÏÂͦÎÕ]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " ÎÁÚ×Á ÆÁÊÌÁ: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" ÚͦÎÅÎÏ: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ôáë"
+
+#: memline.c:1524
+msgid "no"
+msgstr "Φ"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ¦Í'Ñ ËÏÒÉÓÔÕ×ÁÞÁ: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " ÎÁÚ×Á ÓÉÓÔÅÍÉ: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" ÎÁÚ×Á ÓÉÓÔÅÍÉ: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ÎÏÍÅÒ ÐÒÏÃÅÓÕ: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (ÕÓÅ ÝÅ ×ÉËÏÎÕ¤ÔØÓÑ)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [îÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ Ú Ã¦¤À ×ÅÒÓ¦¤À Vim]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [ÎÅÐÒÉÄÁÔÎÉÊ ÄÏ ×ÉËÏÒÉÓÔÁÎÎÑ ÎÁ ×ÁÛ¦Ê ÁÒȦÔÅËÔÕÒ¦]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [ÎÅ ÍÏÖŠ¦ÔØ ÐÒÏÞÉÔÁÎÉÊ]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [ÎÅ ÍÏÖÅ ÂÕÔÉ ×¦ÄËÒÉÔÉÊ]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: îÅ ÍÏÖÕ ÚÂÅÒ¦ÇÔÉ, ÎÅÍÁ¤ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+# msgstr "E313: "
+#: memline.c:1816
+msgid "File preserved"
+msgstr "æÁÊÌ ÚÂÅÒÅÖÅÎÏ"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: úÂÅÒÅÖÅÎÎÑ ÎÅ ×ÄÁÌÏÓÑ"
+
+# msgstr "E314: "
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ÎÅצÒÎÉÊ lnum: %ld [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E315: "
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ÒÑÄÏË %ld ÎÅ ÚÎÁÊÄÅÎÏ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E316: "
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: ×ËÁÚ¦×ÎÉË ÂÌÏËÕ ÐÏÍÉÌËÏ×ÉÊ (3) [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E317: "
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx ÍÁ¤ ÂÕÔÉ Ò¦×ÎÉÍ 0 [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: úÁÂÁÇÁÔÏ ÂÌÏË¦× ÐÏÎÏ×ÌÅÎÏ? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: ×ËÁÚ¦×ÎÉË ÂÌÏËÕ ÐÏÍÉÌËÏ×ÉÊ (4) [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "ÂÌÏË 1 ×ÉÄÁÌÅÎÏ? [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÒÑÄÏË %ld [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: ×ËÁÚ¦×ÎÉË ÂÌÏËÕ ÐÏÍÉÌËÏ×ÉÊ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E317: "
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count Ò¦×ÅÎ 0 [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: ÎÏÍÅÒ ÒÑÄËÁ ×ÉÊÛÏ× ÚÁ ÍÅÖ¦: %ld [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E322: "
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ë¦ÌØ˦ÓÔØ ÒÑÄË¦× Õ ÂÌÏæ %ld ÐÏÍÉÌËÏ×Á"
+
+# msgstr "E323: "
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "òÏÚÍ¦Ò ÓÔÅËÕ Ú¦ÌØÛÕ¤ÔØÓÑ"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: ×ËÁÚ¦×ÎÉË ÂÌÏËÕ ÐÏÍÉÌËÏ×ÉÊ (2) [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E317: "
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: õ÷áçá"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"úÎÁÊÄÅÎÏ ÆÁÊÌ ÏÂͦÎÕ ÎÁ ¦Í'Ñ \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "îÁÍÁÇÁÀÞÉÓØ ×¦ÄËÒÉÔÉ ÆÁÊÌ \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " ðÏÞÁÔËÏÉÊ ÆÁÊÌ ÎÏצÝÉÊ ÚÁ ÆÁÊÌ ÏÂͦÎÕ\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) íÏÖÌÉ×Ï, ¦ÎÛÉÊ Vim ÕÖÅ ÒÅÄÁÇÕ¤ ÃÅÊ ÆÁÊÌ. âÕÄØÔÅ ÏÂÅÒÅÖΦ,\n"
+" ×É ÍÏÖÅÔÅ ÚÁÌÉÛ¦ÔØÓÑ Ú Ä×ÏÍÁ Ò¦ÚÎÉÍÉ ×ÅÒÓ¦ÑÍÉ ÆÁÊÌÕ.\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " ÷ÉÊĦÔØ, ÁÂÏ ÐÒÏÄÏ×ÖÕÊÔÅ Ú ÏÂÅÒÅÖΦÓÔÀ.\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ðÏÐÅÒÅÄÎ¦Ê ÓÅÁÎÓ ÒÅÄÁÇÕ×ÁÎÎÑ Á×ÁÒ¦ÊÎÏ ÚÁ×ÅÒÛÉ×ÓÑ.\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ÷ÉËÏÒÉÓÔÁÊÔÅ \":recover\" ÁÂÏ \"vim -r\" "
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"ÄÌÑ\n"
+" צÄÎÏ×ÌÅÎÎÑ ÚͦÎ. (ÄÉ×. \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " ñËÝÏ ×É ÃÅ ×ÖÅ ÒÏÂÉÌÉ, ×ÉÄÁ̦ÔØ ÆÁÊÌ ÏÂͦÎÕ \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ÝÏ ÐÏÚÂÁ×ÉÔÉÓÑ ÃØÏÇÏ ÐÏצÄÏÍÌÅÎÎÑ.\n"
+"\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "æÁÊÌ ÏÂͦÎÕ \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" ÕÖÅ ¦ÓÎÕ¤!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "Vim -- õ×ÁÇÁ"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "æÁÊÌ ÏÂͦÎÕ ÕÖÅ ¦ÓÎÕ¤!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"&O:÷¦ÄËÒÉÔÉ ÌÉÛÅ ÄÌÑ ÞÉÔÁÎÎÑ\n"
+"&E:õÓÅ ÏÄÎÏ ÒÅÄÁÇÕ×ÁÔÉ\n"
+"&R:÷¦ÄÎÏ×ÉÔÉ\n"
+"&Q:÷ÉÊÔÉ"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"&O:÷¦ÄËÒÉÔÉ ÌÉÛÅ ÄÌÑ ÞÉÔÁÎÎÑ\n"
+"&E:õÓÅ ÏÄÎÏ ÒÅÄÁÇÕ×ÁÔÉ\n"
+"&R:÷¦ÄÎÏ×ÉÔÉ\n"
+"&Q:÷ÉÊÔÉ\n"
+"&D:÷ÉÄÁÌÉÔÉ ÃÅÊ ÆÁÊÌ"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: úÁÂÁÇÁÔÏ ÆÁÊÌ¦× ÏÂͦÎÕ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E326: "
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ûÌÑÈÕ ÄÏ ÅÌÅÍÅÎÔÁ ÍÅÎÑ ÍÁ¤ ͦÓÔÉÔÉ ÌÉÛŠЦÄÍÅÎÀ"
+
+# msgstr "E327: "
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: íÅÎÀ ÎÅ ¦ÓÎÕ¤ Õ ×ËÁÚÁÎÉÈ ÒÅÖÉÍÁÈ"
+
+# msgstr "E328: "
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: îÅÍÁ¤ ÍÅÎÀ Ú ÔÁËÏÀ ÎÁÚ×ÏÀ"
+
+# msgstr "E329: "
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ûÌÑÈ ÄÏ ÍÅÎÑ ÎÅ ÐÏ×ÉÎÅÎ ×ÅÓÔÉ ÄÏ Ð¦ÄÍÅÎÀ"
+
+# msgstr "E330: "
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ÷¦ÄÍÏ×ÌÑÀÓØ ÄÏÄÁ×ÁÔÉ *ÅÌÅÍÅÎÔÉ* ÍÅÎÀ ÐÒÑÍÏ ÄÏ menubar"
+
+# msgstr "E331: "
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: òÏÚĦÌØÎÉË ÎÅ ÍÏÖÎÁ ÄÏÄÁ×ÁÔÉ × ÛÌÑÈ ÄÏ ÍÅÎÀ"
+
+# msgstr "E332: "
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- íÅÎÀ ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "÷¦Ä¦Ò×ÁÔÉ ÃÅ ÍÅÎÀ"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ûÌÑÈ ÐÏ×ÉÎÅÎ ×ÅÓÔÉ ÄÏ ÅÌÅÍÅÎÔÁ ÍÅÎÀ"
+
+# msgstr "E333: "
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: íÅÎÀ %s ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E334: "
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: ÷ ÒÅÖÉͦ `%s' ÍÅÎÀ ÎÅ ¦ÓÎÕ¤"
+
+# msgstr "E335: "
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ûÌÑÈ ÐÏ×ÉÎÅÎ ×ÅÓÔÉ ÄÏ Ð¦ÄÍÅÎÀ"
+
+# msgstr "E336: "
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: íÅÎÀ ÎÅ ÚÎÁÊÄÅÎÏ -- ÐÅÒÅצÒÔÅ ÎÁÚ×Õ"
+
+# msgstr "E337: "
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ×ÉËÏÎÁÎÎÑ %s:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "ÒÑÄÏË %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[ÒÑÄÏË ÚÁÎÁÄÎÏ ÄÏ×ÇÉÊ]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "÷¦ÄÐÏצÄÁÌØÎÉÊ ÚÁ ÐÏצÄÏÍÌÅÎÎÑ: âÏÇÄÁÎ ÷ÌÁÓÀË <bodq@yahoo.com>"
+
+#: message.c:882
+msgid "Interrupt: "
+msgstr "ðÅÒÅÒ×ÁÎÏ: "
+
+#: message.c:885
+msgid "Hit ENTER to continue"
+msgstr "îÁÔÉÓΦÔØ ENTER ÄÌÑ ÐÒÏÄÏ×ÖÅÎÎÑ"
+
+#: message.c:887
+msgid "Hit ENTER or type command to continue"
+msgstr "îÁÔÉÓΦÔØ ENTER ÁÂÏ ×ËÁÖ¦ÔØ ËÏÍÁÎÄÕ ÄÌÑ ÐÒÏÄÏ×ÖÅÎÎÑ"
+
+#: message.c:1942
+msgid "-- More --"
+msgstr "-- ýÅ --"
+
+#: message.c:1945
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ÒÑÄÏË, ðòïâ¶ì/b: ÌÉÓÔ, d/u: Ð¦× ÌÉÓÔÁ, q: ×ÉȦÄ)"
+
+#: message.c:1946
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ÒÑÄÏË, ðòïâ¶ì: ÌÉÓÔ, d: Ð¦× ÌÉÓÔÁ, q: ×ÉȦÄ)"
+
+#: message.c:2421 message.c:2436
+msgid "Question"
+msgstr "úÁÐÉÔÁÎÎÑ"
+
+#: message.c:2423
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Y:ôÁË\n"
+"&N:î¦"
+
+#: message.c:2438
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Y:ôÁË\n"
+"&N:î¦\n"
+"&C:÷¦ÄͦÎÉÔÉ"
+
+#: message.c:2456
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Y:ôÁË\n"
+"&N:î¦\n"
+"&A:õÓ¦\n"
+"&D:öÏÄÎÏÇÏ\n"
+"&C:÷¦ÄͦÎÉÔÉ"
+
+#: message.c:2496
+msgid "Save File dialog"
+msgstr "úÁÐÁÍ'ÑÔÁÔÉ ÆÁÊÌ"
+
+#: message.c:2498
+msgid "Open File dialog"
+msgstr "÷¦ÄËÒÉÔÉ ÆÁÊÌ"
+
+#. TODO: non-GUI file selector here
+#: message.c:2549
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ÷ÉÂÁÞÔÅ, ÁÌÅ × ËÏÎÓÏ̦ ÎÅÍÁ¤ ĦÁÌÏÇÕ ×ÉÂÏÒÕ ÆÁÊÌÁ"
+
+# msgstr "E338: "
+#: misc1.c:2455
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: õ×ÁÇÁ: úͦÎÀ¤ÔØÓÑ ÆÁÊÌ ÐÒÉÚÎÁÞÅÎÉÊ ÌÉÛÅ ÄÌÑ ÞÉÔÁÎÎÑ"
+
+#: misc1.c:2684
+msgid "1 more line"
+msgstr "ÚÎÉÝÅÎÏ ÏÄÉÎ ÒÑÄÏË"
+
+#: misc1.c:2686
+msgid "1 line less"
+msgstr "ÄÏÄÁÎÏ ÏÄÉÎ ÒÑÄÏË"
+
+#: misc1.c:2691
+#, c-format
+msgid "%ld more lines"
+msgstr "ÄÏÄÁÎÏ ÒÑÄ˦×: %ld"
+
+#: misc1.c:2693
+#, c-format
+msgid "%ld fewer lines"
+msgstr "ÚÎÉÝÅÎÏ ÒÑÄ˦×: %ld"
+
+#: misc1.c:2696
+msgid " (Interrupted)"
+msgstr " (ðÅÒÅÒ×ÁÎÏ)"
+
+#: misc1.c:6296
+msgid "Vim: preserving files...\n"
+msgstr "Vim: úÁÂÅÒ¦ÇÁÀ ÆÁÊÌÉ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6306
+msgid "Vim: Finished.\n"
+msgstr "Vim: úÁ×ÅÒÛÅÎÏ.\n"
+
+#: misc2.c:647 misc2.c:663
+msgid "ERROR: "
+msgstr "ðÏÍÉÌËÁ: "
+
+#: misc2.c:667
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[ÂÁÊÔ] ×ÓØÏÇÏ ÒÏÚÍ/ÚÎÉÝ. %lu/%lu, ×ÉËÏÒ. %lu, ÍÁËÓ. %lu\n"
+
+#: misc2.c:669
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[×ÉËÌÉËÉ] ÕÓØÏÇÏ re/malloc() - %lu, ÕÓØÏÇÏ free() - %lu\n"
+"\n"
+
+#: misc2.c:724
+msgid "E340: Line is becoming too long"
+msgstr "E340: òÑÄËÉ ÚÁÎÁÄÔÏ ÄÏ×Ǧ"
+
+# msgstr "E340: "
+#: misc2.c:768
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ÷ÎÕÔÒ¦ÛÎÑ ÐÏÍÉÌËÁ: lalloc(%ld, )"
+
+# msgstr "E341: "
+#: misc2.c:876
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: úÁÂÒÁËÌÏ ÐÁÍ'ÑÔ¦ (×ÉĦÌÑÌÏÓÑ %lu ÂÁÊÔ¦×)"
+
+# msgstr "E342: "
+#: misc2.c:2513
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "÷ÉËÏÎÕ¤ÍÏ ÚÏ×ΦÛÎÕ ËÏÍÁÎÄÕ: \"%s\""
+
+#: misc2.c:2712 misc2.c:5182 option.c:4584
+msgid "Missing colon"
+msgstr "÷ÔÒÁÞÅÎÏ Ä×ÏËÒÁÐËÕ"
+
+#: misc2.c:2714 misc2.c:2741
+msgid "Illegal mode"
+msgstr "îÅÐÒÉÊÎÑÔÎÉÊ ÒÅÖÉÍ"
+
+#: misc2.c:2780
+msgid "Illegal mouseshape"
+msgstr "îÅÐÒÉÊÎÑÔÎÉÊ ×ÉÇÌÑÄ ÍÉÛ¦"
+
+#: misc2.c:2820 misc2.c:5202
+msgid "digit expected"
+msgstr "ÐÏÔÒ¦ÂÎÁ ÃÉÆÒÁ"
+
+#: misc2.c:2825
+msgid "Illegal percentage"
+msgstr "îÅÐÒÁ×ÉÌØÎÉÊ ×¦ÄÓÏÔÏË"
+
+#: misc2.c:3129
+msgid "Enter encryption key: "
+msgstr "÷ËÁÖ¦ÔØ ËÌÀÞ ÛÉÆÒÕ: "
+
+#: misc2.c:3130
+msgid "Enter same key again: "
+msgstr "÷ËÁÖ¦ÔØ ÔÏÊ ÔÁÍÊ ËÌÀÞ: "
+
+#: misc2.c:3140
+msgid "Keys don't match!"
+msgstr "ëÌÀÞ¦ ÎÅ ÓЦ×ÐÁÄÁÀÔØ!"
+
+#: misc2.c:3679
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr ""
+"E343: îÅÐÒÉÊÎÑÔÎÅ ×ÉÚÎÁÞÅÎÎÑ 'path'. `**[ÃÉÆÒÁ]' ÐÏ×ÉÎÎÏ ÚÎÁÈÏÄÉÔÉÓÑ × Ë¦Îæ "
+"ÛÌÑÈÕ, ÁÂÏ ÐÅÒÅÄ '%s'."
+
+# msgstr "E343: "
+#: misc2.c:4939
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÄÉÒÅËÔÏÒ¦À \"%s\" Õ 'cdpath'"
+
+# msgstr "E344: "
+#: misc2.c:4942
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÆÁÊÌ \"%s\" Õ 'path'"
+
+# msgstr "E345: "
+#: misc2.c:4948
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: õ 'cdpath' ÎÅ ÚÎÁÊÄÅÎÏ ¦ÎÛÉÈ ÄÉÒÅËÔÏÒ¦Ê \"%s\""
+
+# msgstr "E346: "
+#: misc2.c:4951
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: õ ÛÌÑÈÕ ÐÏÛÕËÕ Â¦ÌØÛÅ ÎÅÍÁ¤ ÆÁÊÌ¦× \"%s\""
+
+# msgstr "E347: "
+#: misc2.c:5194
+msgid "Illegal component"
+msgstr "îÅÍÏÖÌÉ×ÉÊ ËÏÍÐÏÎÅÎÔ"
+
+#: normal.c:2825
+msgid "Warning: terminal cannot highlight"
+msgstr "õ×ÁÇÁ: ÔÅÒͦÎÁÌ ÎŠЦÄÔÒÉÍÕ¤ ËÏÌØÏÒÉ"
+
+#: normal.c:3020
+msgid "E348: No string under cursor"
+msgstr "E348: ÷É ÓÔϧÔÅ ÎÁ ÐÏÒÏÖÎØÏÍÕ ÒÑÄËÕ"
+
+# msgstr "E348: "
+#: normal.c:3022
+msgid "E349: No identifier under cursor"
+msgstr "E349: ÷É ÎÅ ÓÔϦÔÅ ÎÁ ÓÌÏצ"
+
+#: normal.c:4187
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: îÅ ÍÏÖÕ ÚÎÉÝÉÔÉ ÚÇÏÒÔËÉ (Ú×ÁÖÁÀÞÉ ÎÁ 'foldmethod')"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "ÏÄÉÎ ÒÑÄÏË %s-ÎÏ"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "ÏÄÉÎ ÒÑÄÏË %s-ÎÏ %d ÒÁÚ¦×"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld ÒÑÄË¦× %s-ÎÏ"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld ÒÑÄË¦× %s-ÎÏ %d ÒÁÚ¦×"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "úÁÌÉÛÉÌÏÓÑ ×ÉÒ¦×ÎÑÔÉ: %ld ÒÑÄ˦×"
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "ÏÄÉÎ ÒÑÄÏË ×ÉÒ¦×ÎÑÎÏ"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "×ÉÒ¦×ÎÑÎÏ ÒÑÄ˦×: %ld"
+
+#. must display the prompt
+#: ops.c:1531
+msgid "cannot yank; delete anyway"
+msgstr "ÐÒÏÂÌÅÍÉ Ú ÚÂÅÒÅÖÅÎÎÑÍ, ×ÓÅ ÏÄÎÏ ×ÉÄÁÌÉÔÉ?"
+
+#: ops.c:2021
+msgid "1 line changed"
+msgstr "ïÄÉÎ ÒÑÄÏË ÚͦÎÅÎÏ"
+
+#: ops.c:2023
+#, c-format
+msgid "%ld lines changed"
+msgstr "úͦÎÅÎÏ ÒÑÄ˦×: %ld"
+
+#: ops.c:2383
+#, c-format
+msgid "freeing %ld lines"
+msgstr "ÚצÌØÎÅÎÏ ÒÑÄ˦×: %ld"
+
+#: ops.c:2660
+msgid "1 line yanked"
+msgstr "òÑÄÏË ÚÂÅÒÅÖÅÎÏ"
+
+#: ops.c:2662
+#, c-format
+msgid "%ld lines yanked"
+msgstr "úÂÅÒÅÖÅÎÏ ÒÑÄ˦×: %ld"
+
+#: ops.c:2918
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: õ ÒÅǦÓÔÒ¦ %s ÐÏÒÏÖÎØÏ"
+
+# msgstr "E353: "
+#. Highlight title
+#: ops.c:3465
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- òÅǦÓÔÒÉ ---"
+
+#: ops.c:4597
+msgid "Illegal register name"
+msgstr "îÅÐÒÁ×ÉÌØÎÁ ÎÁÚ×Á ÒÅǦÓÔÒÁ"
+
+#: ops.c:4677
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# òÅǦÓÔÒÉ:\n"
+
+#: ops.c:4703
+#, c-format
+msgid "Unknown register type %d"
+msgstr "îÅצÄÏÍÉÊ ÔÅÐ ÒÅǦÓÔÒÁ: %d"
+
+#: ops.c:5084
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: îÅÐÒÁ×ÉÌØÎÁ ÎÁÚ×Á ÒÅǦÓÔÒÁ: '%s'"
+
+#: ops.c:5425
+#, c-format
+msgid "%ld Cols; "
+msgstr "ÄÏ×Ö.: %ld; "
+
+#: ops.c:5432
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "÷ÉÂÒÁÎÏ - %s%ld Ú %ld òÑÄ˦×; %ld Ú %ld ó̦×; %ld Ú %ld âÁÊÔ¦×"
+
+#: ops.c:5448
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "ëÏÌÏÎËÁ %s Ú %s; òÑÄÏË %ld Ú %ld; óÌÏ×Ï %ld Ú %ld; âÁÊÔ %ld Ú %ld"
+
+#: ops.c:5459
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld ÄÌÑ BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "äÑËÕ¤ÍÏ ÚÁ צÄצÄÁÎÎÑ Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "ïÐÃ¦Ñ ÎŠЦÄÔÒÉÍÕ¤ÔØÓÑ"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "îÅ ÄÏÚ×ÏÌÅÎÏ Õ modeline"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t÷ÏÓÔÁÎÎÅ ÚͦÎÅÎÕ Õ "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "ð¦ÓÌÑ = ÐÏÔÒ¦ÂÎÏ ×ËÁÚÁÔÉ ÞÉÓÌÏ"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "îÅ ÚÎÁÊÌÅÎÏ ÓÅÒÅÄ ÍÏÖÌÉ×ÏÓÔÅÊ ÔÅÒͦÎÁ̦×"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "îÅÄÏÚ×ÁÌÅÎÉÊ ÓÉÍ×ÏÌ <%s>"
+
+#: option.c:4294 option.c:5498
+msgid "Not allowed here"
+msgstr "ôÕÔ ÔÁËÏÇÏ ÎÅ ÌÀÂÌÑÔØ"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "îÅ ÍÏÖÕ ÓÐÏÒÏÖÎÉÔÉ 'term'"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "îÅ ÍÏÖÕ ÚͦÎÉÔÉ 'term' × GUI"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "÷ÉËÏÒÉÓÔÏ×ÕÊÔÅ \":gui\" ÄÌÑ ÔÏÇÏ ÝÏ ÒÏÚÐÏÞÁÔÉ GUI"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "ïÐæ§ 'backupext' ÔÁ 'patchmode' ÏÄÎÁËÏצ"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "òÑÄÏË ÐÏÒÏÖΦÊ"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "ð¦ÓÌÑ <%s> ×ÔÒÁÞÅÎÏ ÎÏÍÅÒ"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "÷ÔÒÁÞÅÎÏ ËÏÍÕ"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "úÎÁÞÅÎÎÑ ' ÎÅ ×ËÁÚÁÎÏ"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "ͦÓÔÉÔØ ÎÅÄÒÕËÏ×Φ ÓÉÍ×ÏÌÉ"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "îÅצÒÎÏ ×ËÁÚÁÎÏ ÛÒÉÆÔ(É)"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "ÎÅ ÍÏÖÕ ×ÉÂÒÁÔÉ fontset"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "îÅצÒÎÉÊ fontset"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "îÅ ÍÏÖÕ ×ÉËÏÒÉÓÔÁÔÉ ÛÉÒÏËÉÊ ÛÒÉÆÔ"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "îÅצÒÎÉÊ ÛÉÒÏËÉÊ ÛÒÉÆÔ"
+
+#: option.c:5015
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "îÅÄÏÚ×ÏÌÅÎÉÊ ÓÉÍ×ÏÌ Ð¦ÓÌÑ <%c>"
+
+#: option.c:5098
+msgid "comma required"
+msgstr "ÐÏÔÒ¦ÂÎÁ ËÏÍÁ"
+
+#: option.c:5107
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' ÍÁ¤ ͦÓÔÉÔÉ %s"
+
+#: option.c:5154
+msgid "No mouse support"
+msgstr "íÉÛÁ ΊЦÄÔÒÉÍÕÀ¤ÔØÓÑ"
+
+#: option.c:5400
+msgid "Unclosed expression sequence"
+msgstr "ðÏÓ̦ÄÏ×ΦÓÔØ ×ÉÒÁÚ¦× ÎÅ ÚÁ×ÅÒÛÅÎÏ"
+
+#: option.c:5404
+msgid "too many items"
+msgstr "ÚÁÂÁÇÁÔÏ ÞÁÓÔÉÎ"
+
+#: option.c:5406
+msgid "unbalanced groups"
+msgstr "ÇÒÕÐÉ ÎÅ ÚÂÁÌÁÎÓÏ×ÁÎÏ"
+
+#: option.c:5621
+msgid "A preview window already exists"
+msgstr "ðÏÐÅÒÅÄΊצËÎÏ ÕÖÅ ¦ÓÎÕ¤"
+
+#: option.c:5882 option.c:5911
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' ÎÅ ÍÏÖÅ ÂÕÔÉ ÍÅÎÛÅ ÚÁ 'winminheight'"
+
+#: option.c:5927 option.c:5946
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' ÎÅ ÍÏÖÅ ÂÕÔÉ ÍÅÎÛÅ ÚÁ 'winminwidth'"
+
+#: option.c:6086
+#, c-format
+msgid "Need at least %d lines"
+msgstr "ðÏÔÒ¦ÂÎÏ ÒÑÄ˦×: ÎÅ ÍÅÎÛÅ %d"
+
+#: option.c:6095
+#, c-format
+msgid "Need at least %d columns"
+msgstr "ðÏÔÒ¦ÂÎÏ ËÏÌÏÎÏË: ÎÅ ÍÅÎÛÅ %d"
+
+#: option.c:6392
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: îÅצÄÏÍÁ ÏÐæÑ: %s"
+
+# msgstr "E355: "
+#: option.c:6501
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- ëÏÄÉ ÔÅÒͦÎÁÌÁ ---"
+
+#: option.c:6503
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- úÁÇÁÌØΦ ÚÎÁÞÅÎÎÑ ÚͦÎÎÉÈ ---"
+
+#: option.c:6505
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- í¦ÓÃÅצ ÚÎÁÞÅÎÎÑ ÚͦÎÎÉÈ ---"
+
+#: option.c:6507
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- úͦÎΦ ---"
+
+#: option.c:7197
+msgid "E356: get_varp ERROR"
+msgstr "E356: ðÏÍÉÌËÁ get_varp [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E356: "
+#: option.c:8113
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': äÌÑ ÓÉÍ×ÏÌÕ %s ÎÅÍÁ¤ ÐÁÒÉ"
+
+# msgstr "E357: "
+#: option.c:8147
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': îÁÄÌÉÛËÏצ ÓÉÍ×ÏÌÉ Ð¦ÓÌÑ `;': %s"
+
+# msgstr "E358: "
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "ÎÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ "
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ×¦ËÎÏ!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "ðÏÔÒ¦ÂÎÏ Amigados 2.04 ÁÂÏ Ð¦ÚΦۦ ×ÅÒÓ¦§\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "ðÏÔÒ¦ÂÎÏ %s ×ÅÒÓ¦§ %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ÚÁ×ÅÒÛÕ¤ ÒÏÂÏÔÕ Ú %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "ÎÅ ÍÏÖÕ ÈͦÎÉÔÉ ÒÅÖÉÍ ËÏÎÓÏ̦ ?!\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2733
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: òÅÖÉÍ ÅËÒÁÎÕ ÎŠЦÄÔÒÉÍÕ¤ÔØÓÑ"
+
+# msgstr "E359: "
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ÎÅ ËÏÎÓÏÌØ??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ `shell' Ú ÏÐæ¤À -f"
+
+# msgstr "E360: "
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " ÐÏ×ÅÒÎÕÔÏ\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ÚÁÍÁÌÉÊ"
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "ðÏÍÉÌËÁ ××ÏÄÕ/×É×ÏÄÕ"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr "...(צÄÒ¦ÚÁÎÏ)"
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'commands' ÎÅ 80, ÎÅ ÍÏÖÕ ×ÉËÏÎÕ×ÁÔÉ ÚÏ×ΦÛΦ ËÏÍÁÎÄÉ"
+
+#: os_mswin.c:706 os_unix.c:4962
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: ÷ÉËÌÉË Ú Â¦Â̦ÏÔÅËÉ ÄÌÑ \"%s()\"ÎÅ ×ÄÁ×ÓÑ"
+
+# msgstr "E364: "
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: îÅ ×ÄÁÌÏÓÑ ×ÉÂÒÁÔÉ ÄÒÕ˦×ÎÉË"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "ÎÁ %s Ú %s"
+
+#: os_mswin.c:1403
+#, c-format
+msgid "E448: Unknown font: %s"
+msgstr "E488: îÅצÄÏÍÉÊ ÛÒÉÆÔ: %s"
+
+#: os_mswin.c:1453 os_mswin.c:1463
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ðÏÍÉÌËÁ ÄÒÕËÕ: %s"
+
+#: os_mswin.c:1464
+msgid "Unknown"
+msgstr "îÅצÄÏÍÏ"
+
+#: os_mswin.c:1491
+#, c-format
+msgid "Printing '%s'"
+msgstr "äÒÕËÕ¤ÍÏ '%s'"
+
+#: os_mswin.c:2555
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: ðÏÍÉÌËÏ×Á ÎÁÚ×Á ÎÁÂÏÒÕ ÓÉÍ×ÏÌ¦× \"%s\" Õ ÎÁÚצ ÛÒÉÆÔÁ \"%s\""
+
+#: os_mswin.c:2563
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ðÏÍÉÌËÏ×ÉÊ ÓÉÍ×ÏÌ %c × ÎÁÚצ ÛÒÉÆÔÁ \"%s\""
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: îÅצÒÎÁ ÏÐÃ¦Ñ 'osfiletype' -- ×ÉËÏÒÉÓÔÏ×ÕÀ `Text'"
+
+# msgstr "E366: "
+#: os_unix.c:803
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: ïÔÒÉÍÁÎÏ ÓÉÇÎÁÌ Äצަ, ÚÁ×ÅÒÛÕÀ\n"
+
+#: os_unix.c:809
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: ïÔÒÉÍÁÎÏ ÓÉÇÎÁÌ ÚÁ˦ÎÞÉÔÉ ÒÏÂÏÔÕ (%s)\n"
+
+#: os_unix.c:812
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: ïÔÒÉÍÁÎÏ ÓÉÇÎÁÌ ÚÁ˦ÎÞÉÔÉ ÒÏÂÏÔÕ\n"
+
+#: os_unix.c:1066
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "îÁ צÄËÒÉÔÔÑ X-ÄÁÓÐÌÅÀ ЦÛÌÏ %ld ̦ͦÓÅËÕÎÄ"
+
+#: os_unix.c:1093
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: ïÔÒÉÍÁÎÏ ÐÏÍÉÌËÕ X\n"
+
+#: os_unix.c:1160
+msgid "Testing the X display failed"
+msgstr "îÅ ×ÄÁÌÏÓÑ ÐÅÒÅצÒÉÔÉ ÄÉÓÐÌÅÊ X"
+
+#: os_unix.c:1304
+msgid "Opening the X display timed out"
+msgstr "äÕÖÅ ÄÏ×ÇÏ ×¦ÄËÒÉפÔØÓÑ ÄÉÓÐÌÅÊ X, ÐÅÒÅÒ×ÁÎÏ"
+
+#: os_unix.c:2906 os_unix.c:3490
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ `shell'"
+
+#: os_unix.c:2951
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"îÅ ÍÏÖÕ ×ÉËÏÎÁÔÉ `sh'\n"
+
+# msgstr "E362: "
+#: os_unix.c:2955 os_unix.c:3496
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"shell ÐÏ×ÅÒÔÁ¤: "
+
+#: os_unix.c:3089
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ËÁÎÁÌÉ\n"
+
+#: os_unix.c:3104
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"îÅ ÍÏÖÕ ÒÏÚÄ×ϧÔÉ ×ÉËÏÎÁÎÎÑ [fork()]\n"
+
+#: os_unix.c:3503
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"ëÏÍÁÎÄÁ ÚÁ˦ÎÞÉÌÁ ×ÉËÏÎÁÎÎÑ\n"
+
+#: os_unix.c:5010
+msgid "Opening the X display failed"
+msgstr "îÅ ×ÄÁÌÏÓÑ ×¦ÄËÒÉÔÉ ÄÉÓÐÌÅÊ X"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "òÑÄÏË:"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "îÅ ×ÄÁÌÏÓÑ ÚÁ×ÁÎÔÁÖÉÔÉ vim32.dll"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "ðÏÍÉÌËÁ Vim"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "îÅ ÍÏÖÕ ×ÉÐÒÁ×ÉÔÉ ×ËÁÚ¦×ÎÉËÉ ÎÁ ÆÕÎËæ§ DLL!"
+
+#: os_win16.c:578 os_win32.c:3067
+#, c-format
+msgid "shell returned %d"
+msgstr "shell ÐÏ×ÅÒÔÁ¤ %d"
+
+#: os_win32.c:2535
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: ïÔÒÉÍÁÎÏ %s-ÐÏĦÀ\n"
+
+#: os_win32.c:2537
+msgid "close"
+msgstr "close"
+
+#: os_win32.c:2539
+msgid "logoff"
+msgstr "logoff"
+
+#: os_win32.c:2540
+msgid "shutdown"
+msgstr "shutdown"
+
+#: os_win32.c:3021
+msgid "E371: Command not found"
+msgstr "E371: ëÏÍÁÎÄÕ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: os_win32.c:3034
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"æÁÊÌ VIMRUN.EXE ÎÅ ÚÎÁÊÄÅÎÏ Õ ×ÁÛÏÍÕ ÛÌÑÈÕ ÐÏÛÕËÕ.\n"
+"úÏ×ΦÛΦ ËÏÍÁÎÄÉ ÎÅ ÂÕÄÕÔØ ÐÒÉÚÕÐÉÎÅΦ ЦÓÌÑ ×ÉËÏÎÁÎÎÑ.\n"
+"äÉצÔØÓÑ :help win32-vimrun ÄÌÑ ÐÏÄÁÌØÛϧ ¦ÎÆÏÒÍÁæ§."
+
+#: os_win32.c:3037
+msgid "Vim Warning"
+msgstr "ðÏÐÅÒÅÄÖÅÎÎÑ Vim"
+
+# msgstr "E371: "
+#: quickfix.c:281
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: úÁÂÁÇÁÔÏ %%%c Õ ÒÑÄËÕ ÆÏÒÍÁÔÁ"
+
+# msgstr "E372: "
+#: quickfix.c:294
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: îÅÏÞ¦ËÕ×ÁÎÉÊ `%%%c' Õ ÒÑÄËÕ ÆÏÒÍÁÔÁ"
+
+# msgstr "E373: "
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: ÷ÔÒÁÞÅÎÏ ] Õ ÒÑÄËÕ ÆÏÒÍÁÔÁ"
+
+# msgstr "E374: "
+#: quickfix.c:362
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: %%%c Õ ÒÑÄËÕ ÆÏÒÍÁÔÁ ΊЦÄÔÒÉÍÕ¤ÔØÓÑ"
+
+# msgstr "E375: "
+#: quickfix.c:380
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ðÏÍÉÌËÏ×ÉÊ `%%%c' Õ ÐÒÅƦËÓ¦ ÒÑÄËÕ ÆÏÒÍÁÔÁ"
+
+# msgstr "E376: "
+#: quickfix.c:388
+msgid "E377: Invalid %%%c in format string"
+msgstr "E376: ðÏÍÉÌËÏ×ÉÊ `%%%c' Õ ÒÑÄËÕ ÆÏÒÍÁÔÁ"
+
+# msgstr "E377: "
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' ͦÓÔÉÔØ ÌÉÛÅ Ú×ÉÞÁÊΦ ÓÉÍ×ÏÌÉ"
+
+# msgstr "E378: "
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ÷ÔÒÁÞÅÎÏ ÎÁÚ×Õ ÄÉÒÅËÔÏÒ¦§"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "ïÓÔÁÎÎ¦Ê ÅÌÅÍÅÎÔ"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d Ú %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (ÒÑÄÏË ×ÉÄÁÌÅÎÏ)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: óÔÅË quickfix ÐÏÒÏÖΦÊ"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: ÷ÅÒÛÉÎÁ ÓÔÅËÕ quickfix"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "ÓÐÉÓÏË ÐÏÍÉÌÏË %d Ú %d; %d ÐÏÍÉÌÏË"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: îÅ ÍÏÖÕ ÚÁÐÉÓÁÔÉ, ×ËÁÚÁÎÁ ÏÐÃ¦Ñ 'buftype'"
+
+# msgstr "E382: "
+#: regexp.c:802
+msgid "E339: Pattern too long"
+msgstr "E339: úÒÁÚÏË ÚÁÎÁÄÔÏ ÄÏ×ÇÉÊ"
+
+# msgstr "E339: "
+#: regexp.c:1316
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: ÷ËÌÁÄÅΦ %s*"
+
+# msgstr "E61: "
+#: regexp.c:1319
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: ÷ËÌÁÄÅΦ %s%c"
+
+# msgstr "E62: "
+#: regexp.c:1470
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: ð¦ÓÌÑ %s%c ΦÞÏÇÏ ÎÅÍÁ¤"
+
+# msgstr "E64: "
+#: regexp.c:2480
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "óÉÎÔÁËÓÉÞÎÁ ÐÏÍÉÌËÁ × %s{...}"
+
+#: regexp.c:2727
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ÷¦ÄÂÕÌÁÓØ Á×ÁÒ¦Ñ; ÚÁÎÁÄÔÏ ÓËÌÁÄÎÉÊ ÚÒÁÚÏË?"
+
+#: regexp.c:2862
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: úÒÁÚÏË ÚÞÉÎÉ× ÐÏÍÉÌËÕ ÓÔÅËÕ"
+
+#: regexp.c:3098
+msgid "External submatches:\n"
+msgstr "úÏ×ΦÛΦ ЦÄÚ¦ÇÉ:\n"
+
+#: screen.c:2058
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--[ÚÇÏÒÔÏË](%3ld ÒÑÄ˦×)"
+
+#: screen.c:7451
+msgid " VREPLACE"
+msgstr " V-ÚÁͦÎÁ"
+
+#: screen.c:7455
+msgid " REPLACE"
+msgstr " úÁͦÎÁ"
+
+#: screen.c:7460
+msgid " REVERSE"
+msgstr " ïÂÅÒÎÕÔÏ"
+
+#: screen.c:7462
+msgid " INSERT"
+msgstr " ÷ÓÔÁ×ËÁ"
+
+#: screen.c:7465
+msgid " (insert)"
+msgstr " (×ÓÔÁ×ËÁ)"
+
+#: screen.c:7467
+msgid " (replace)"
+msgstr " (ÚÁͦÎÁ)"
+
+#: screen.c:7469
+msgid " (vreplace)"
+msgstr " (V-ÚÁͦÎÁ)"
+
+#: screen.c:7472
+msgid " Hebrew"
+msgstr " Hebrew"
+
+#: screen.c:7480
+msgid " (lang)"
+msgstr " (lang)"
+
+#: screen.c:7483
+msgid " (paste)"
+msgstr " (ÂÅÚ ÏÂÒÏÂËÉ)"
+
+#: screen.c:7489
+msgid " SELECT"
+msgstr " ÷ÉĦÌÅÎÎÑ"
+
+#: screen.c:7491
+msgid " VISUAL"
+msgstr " ÷ɦÒ"
+
+#: screen.c:7493
+msgid " BLOCK"
+msgstr " [âÌÏË]"
+
+#: screen.c:7495
+msgid " LINE"
+msgstr " [òÑÄËÉ]"
+
+#: screen.c:7508 screen.c:7562
+msgid "recording"
+msgstr "ÊÄÅ ÚÁÐÉÓ"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ðÏÛÕË Ä¦ÊÛÏ× ÄÏ ÇÏÒÉ, ÐÒÏÄÏ×ÖÕ¤ÍÏ ÕÎÉÚÕ"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "ðÏÛÕË Ä¦ÊÛÏ× ÄÏ ÎÉÚÕ, ÐÒÏÄÏ×ÖÕ¤ÍÏ Ú ÇÏÒÉ"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: îÅצÒÎÉÊ ÚÒÁÚÏË ÄÌÑ ÐÏÛÕËÕ: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ðÏÛÕË Ä¦ÊÛÏ× ÄÏ ÇÏÒÉ ÂÅÚ ÚÂ¦Ç¦× Ú %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ðÏÛÕË Ä¦ÊÛÏ× ÄÏ ÎÉÚÕ ÂÅÚ ÚÂ¦Ç¦× Ú %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ð¦ÓÌÑ `;' ÍÁ¤ ÊÔÉ `?' ÁÂÏ `/'"
+
+# msgstr "E386: "
+#: search.c:3479
+msgid " (includes previously listed match)"
+msgstr " (ÒÁÚÏÍ Ú ÐÏÐÅÒÅÄΦÍÉ Ú¦ÇÁÍÉ)"
+
+#. cursor at status line
+#: search.c:3499
+msgid "--- Included files "
+msgstr "--- ÷ËÌÀÞÅΦ ÆÁÊÌÉ "
+
+#: search.c:3501
+msgid "not found "
+msgstr "ÎÅ ÚÎÁÊÄÅÎÏ "
+
+#: search.c:3502
+msgid "in path ---\n"
+msgstr "Õ ÛÌÑÈÕ ÐÏÛÕËÕ ---\n"
+
+#: search.c:3541
+msgid " (Already listed)"
+msgstr " (õÖÅ Õ ÓÐÉÓËÕ)"
+
+#: search.c:3543
+msgid " NOT FOUND"
+msgstr " îÅ ÚÎÁÊÄÅÎÏ"
+
+#: search.c:3595
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "ðÏÛÕË Õ ×ËÌÀÞÅÎÏÍÕ ÆÁÊ̦: %s"
+
+#: search.c:3813
+msgid "E387: Match is on current line"
+msgstr "E387: úÂ¦Ç Õ ÐÏÔÏÞÎÏÍÕ ÒÑÄËÕ"
+
+#: search.c:3953
+msgid "All included files were found"
+msgstr "õÓ¦ ×ËÌÀÞÅΦ ÆÁÊÌÉ ÂÕÌÏ ÚÎÁÊÄÅÎÏ"
+
+#: search.c:3955
+msgid "No included files"
+msgstr "öÏÄÎÏÇÏ ×ËÌÀÞÅÎÏÇÏ ÆÁÊÌÁ"
+
+#: search.c:3971
+msgid "E388: Couldn't find definition"
+msgstr "E388: ÷ÉÚÎÁÞÅÎÎÑ ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: search.c:3973
+msgid "E389: Couldn't find pattern"
+msgstr "E389: úÒÁÚÏË ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: syntax.c:2998
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: îÅצÒÎÉÊ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:3176
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: îÅ ¦ÓÎÕÀÞÉÊ ËÌÁÓÅÔÒ ÓÉÎÔÁËÓÉÓÕ: %s"
+
+# msgstr "E391: "
+#: syntax.c:3340
+msgid "No Syntax items defined for this buffer"
+msgstr "äÌÑ ÂÕÆÅÒÕ ÎÅ ×ÉÚÎÁÞÅÎÏ ÅÌÅÍÅÎÔ¦× ÓÉÎÔÁËÓÉÓÕ"
+
+#: syntax.c:3348
+msgid "syncing on C-style comments"
+msgstr "ÓÉÎÈÒÏΦÚÁÃ¦Ñ ÂÁÚÕ¤ÔØÓÑ ÎÁ ó-ËÏÍÅÎÔÁÒ¦ÑÈ"
+
+#: syntax.c:3356
+msgid "no syncing"
+msgstr "ÓÉÎÈÒÏΦÚÁÃ¦Ñ ÎÅ ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ"
+
+#: syntax.c:3359
+msgid "syncing starts "
+msgstr "ÓÉÎÈÒÏΦÚÁÃ¦Ñ ÐÏÞÉÎÁ¤ÔØÓÑ ÚÁ "
+
+#: syntax.c:3361 syntax.c:3430
+msgid " lines before top line"
+msgstr " ÒÑÄË¦× ÐÅÒÅÄ ÐÅÒÛÉÍ ÒÑÄËÏÍ"
+
+#: syntax.c:3365
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- åÌÅÍÅÎÔÉ ÓÉÎÈÒÏΦÚÁæ§ ÓÉÎÔÁËÓÉÓÕ ---"
+
+#: syntax.c:3368
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"ÓÉÎÈÒÏΦÚÁæ§ ÂÁÚÕ¤ÔØÓÑ ÎÁ ÅÌÅÍÅÎÔÁÈ"
+
+#: syntax.c:3373
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- åÌÅÍÅÎÔÉ ÓÉÎÔÁËÓÉÓÕ ---"
+
+#: syntax.c:3396
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: îÅ ¦ÓÎÕÀÞÉÊ ËÌÁÓÅÔÒ ÓÉÎÔÁËÓÉÓÕ: %s"
+
+#: syntax.c:3420
+msgid "minimal "
+msgstr "ͦΦÍÁÌØÎÉÊ "
+
+#: syntax.c:3427
+msgid "maximal "
+msgstr "ÍÁËÓÉÍÁÌØÎÉÊ "
+
+#: syntax.c:4057
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: group[t]hete ÔÕÔ ÎÅ ÐÒÁÃÀ¤"
+
+#: syntax.c:4081
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: îÅ ÚÎÁÊÄÅÎÏ ÏÂÌÁÓÔ¦ ÄÌÑ %s"
+
+#: syntax.c:4109
+msgid "E395: contains argument not accepted here"
+msgstr "E395: í¦ÓÔÉÔØ ÁÒÇÕÍÅÎÔÉ ÝÏ ÎÅÐÒÉÊÎÑÔΦ ÔÕÔ"
+
+#: syntax.c:4120
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: áÒÇÕÍÅÎÔ ÎÅÐÒÉÊÎÑÔÎÉÊ ÔÕÔ"
+
+# msgstr "E396: "
+#: syntax.c:4198
+msgid "E397: Filename required"
+msgstr "E397: ðÏÔÒ¦ÂÎÁ ÎÁÚ×Á ÆÁÊÌÁ"
+
+#: syntax.c:4536
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: `=' ×ÔÒÁÞÅÎÏ: %s"
+
+# ---------------------------------------
+#: syntax.c:4694
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: îÅ ÄÏÓÉÔØ ÁÒÇÕÍÅÎÔ¦×: syntax region %s"
+
+#: syntax.c:5025
+msgid "E400: No cluster specified"
+msgstr "E400: ëÌÁÓÔÅÒ ÎÅ ×ËÁÚÁÎÏ"
+
+#: syntax.c:5062
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ë¦ÎÅÃØ ÚÒÁÚËÁ ÎÅ ÚÎÁÊÄÎÏ: %s"
+
+#: syntax.c:5137
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: óͦÔÔÑ Ð¦ÓÌÑ ÚÒÁÚËÁ: %s"
+
+# msgstr "E402: "
+#: syntax.c:5219
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: syntax syntax: ÚÒÁÚÏË ÄÌÑ ÐÒÏÄÏ×ÖÅÎÎÑ ÒÑÄËÁ ×ËÁÚÁÎÏ Äצަ"
+
+#: syntax.c:5276
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: îÅצÒΦ ÁÒÇÕÍÅÎÔÉ: %s"
+
+# msgstr "E404: "
+#: syntax.c:5326
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: îÅÍÁ¤ `=': %s"
+
+# msgstr "E405: "
+#: syntax.c:5332
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ðÏÒÏÖÎ¦Ê ÁÒÇÕÍÅÎÔ: %s"
+
+# msgstr "E406: "
+#: syntax.c:5359
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ÔÕÔ ÎÅ ÄÏÚ×ÏÌÅÎÏ"
+
+#: syntax.c:5366
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ÍÁ¤ ÂÕÔÉ ÐÅÒÛÉÍ ÒÑÄËÏÍ Õ ÆÁÊ̦"
+
+#: syntax.c:5436
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: îÅצÒÎÁ ÎÁÚ×Á ÇÒÕÐÉ: %s"
+
+# msgstr "E409: "
+#: syntax.c:5666
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: îÅצÒÎÁ ЦÄËÏÍÁÎÄÁ :syntax : %s"
+
+# msgstr "E410: "
+#: syntax.c:6045
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ëÏÌØÏÒ ÎÅ ÚÎÁÊÄÅÎÏ: %s"
+
+# msgstr "E411: "
+#: syntax.c:6069
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: îÅÄÏÓÔÁÔÎØÏ ÁÒÇÕÍÅÎÔ¦×: \"highlight link %s\""
+
+# msgstr "E412: "
+#: syntax.c:6076
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: úÁÂÁÇÁÔÏ ÁÒÇÕÍÅÎÔ¦×: \":highlight link %s\""
+
+# msgstr "E413: "
+#: syntax.c:6096
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ëÏÌ¦Ò ÕÖÅ ×ÓÔÁÎÏ×ÌÅÎÏ, \":highlight link\" ÐÒϦÇÎÏÒÏ×ÁÎÏ"
+
+# msgstr "E414: "
+#: syntax.c:6225
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: úÎÁË Ò¦×ÎÏÓÔ¦ ÎÅ ÐÏÔÒ¦ÂÅÎ: %s"
+
+# msgstr "E415: "
+#: syntax.c:6261
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ÷ÔÒÁÞÅÎÏ ÚÎÁË Ò¦×ÎÏÓÔ¦: %s"
+
+#: syntax.c:6283
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ÷ÔÒÁÞÅÎÏ ÁÒÇÕÍÅÎÔ: %s"
+
+#: syntax.c:6320
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: îÅצÒÎÅ ÚÎÁÞÅÎÎÑ: %s"
+
+# msgstr "E418: "
+#: syntax.c:6439
+msgid "E419: FG color unknown"
+msgstr "E419: îÅצÄÏÍÉÊ ËÏÌ¦Ò ÔÅËÓÔÕ"
+
+# msgstr "E419: "
+#: syntax.c:6450
+msgid "E420: BG color unknown"
+msgstr "E420: îÅצÄÏÍÉÊ ËÏÌ¦Ò ÆÏÎÕ"
+
+# msgstr "E420: "
+#: syntax.c:6511
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: îÅÚÒÏÚÕͦÌÁ ÎÁÚ×Á ÁÂÏ ÎÏÍÅÒ ËÏÌØÏÒÕ: %s"
+
+# msgstr "E421: "
+#: syntax.c:6719
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: úÁÎÁÄÔÏ ÄÏ×ÇÉÊ ËÏÄ ÔÅÒͦÎÁÌÕ: %s"
+
+# msgstr "E422: "
+#: syntax.c:6766
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: îÅצÒÎÉÊ ÁÒÇÕÍÅÎÔ: %s"
+
+# msgstr "E423: "
+#: syntax.c:7295
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: úÁÂÁÇÁÔÏ Ò¦ÚÎÉÈ ÁÔÒÉÂÕÔ ËÏÌØÏÒÕ"
+
+# msgstr "E424: "
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "ÓÔÅË ÐÏͦÔÏË ÐÏÒÏÖΦÊ"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "×ÅÒÛÉÎÁ ÓÔÅËÕ ÐÏͦÔÏË"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: îÅ ÍÏÖÕ ÐÅÒÅÊÔÉ ÄÏ ÐÏÐÅÒÅÄÎÏا ÐÏͦÔËÉ Ú ÐÅÒÛϧ"
+
+# msgstr "E425: "
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ÐÏͦÔËÕ %s ÎÅ ÚÎÁÊÄÅÎÏ"
+
+# msgstr "E426: "
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr ""
+
+#: tag.c:548
+msgid "file\n"
+msgstr "ÆÁÊÌ\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "ñËÕ ÓÁÍÅ ÐÏͦÔËÕ ×ÉËÏÒÉÓÔÁÔÉ (<CR> ÄÌÑ ×¦ÄͦÎÉ): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: ìÉÛÅ ÏÄÎÁ צÄÐÏצÄÎÁ ÐÏͦÔËÁ"
+
+# msgstr "E427: "
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ãÅ ÏÓÔÁÎÎÑ ×¦ÄÐÏצÄÎÏ ÐÏͦÔËÁ"
+
+# msgstr "E428: "
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "æÁÊÌ \"%s\" ÎÅ ¦ÓÎÕ¤"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ÐÏͦÔËÁ %d Ú %d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " ÁÂÏ Â¦ÌØÛÅ"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " ÷ÉËÏÒÉÓÔÏ×ÕÀ ÐÏͦÔËÕ ÎÅ ÒÏÚÒ¦ÚÎÑÀÞÉ ×ÅÌÉ˦ ÔÁ ÍÁ̦ ̦ÔÅÒÉ"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: æÁÊÌ \"%s\" ÎÅ ¦ÓÎÕ¤"
+
+# msgstr "E429: "
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "ì¦Î¦ÊÎÉÊ ÐÏÛÕË ÐÏͦÔËÉ"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "äצÊËÏ×ÉÊ ÐÏÛÕË ÐÏͦÔËÉ"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "ûÕËÁÀ Á ÆÁÊ̦ ÐÏͦÔÏË %s"
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: ûÌÑÈ ÄÌÑ %s × ÆÁÊ̦ ÐÏͦÔË ÚËÏÒÏÞÅÎÏ\n"
+
+# msgstr "E430: "
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: ðÏÍÉÌËÁ ÆÏÒÍÁÔÕ Õ ÆÁÊ̦ ÐÏͦÔÏË \"%s\""
+
+# msgstr "E431: "
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "ðÅÒÅÄ ÂÁÊÔÏÍ %ld"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: æÁÊÌ ÐÏͦÔÏË %s ÎÅ ×ÐÏÒÑÄËÏ×ÁÎÉÊ"
+
+# msgstr "E432: "
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: îÅÍÁ¤ ÆÁÌÁ ÐÏͦÔÏË"
+
+# msgstr "E433: "
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÐÏͦÔËÕ ÚÁ §§ ÚÒÁÚËÏÍ"
+
+# msgstr "E434: "
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: îÅ ÍÏÖÕ ÚÎÁÊÔÉ ÐÏͦÔËÕ, ÚÄÏÇÁÄÕÀÓØ!"
+
+# msgstr "E435: "
+#: term.c:1733
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ΊצÄÏÍÉÊ. ÷ÂÕÄÏ×ÁΦ ÔÅÒͦÎÁÌÉ:"
+
+#: term.c:1757
+msgid "defaulting to '"
+msgstr "ÂÕÄÅÍÏ ××ÁÖÁÔÉ ÝÏ ÃÅ '"
+
+#: term.c:2110
+msgid "Cannot open termcap file"
+msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ¦ÁÊÌ ÍÏÖÌÉ×ÏÓÔÅÊ ÔÅÒͦÎÁÌ¦× [termcap]"
+
+#: term.c:2113
+msgid "Terminal entry not found in terminfo"
+msgstr "îÅÍÁ¤ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÔÅÒͦÎÁÌ [terminfo]"
+
+#: term.c:2115
+msgid "Terminal entry not found in termcap"
+msgstr "îÅÍÁ¤ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÍÏÖÌÉ×ÏÓÔ¦ ÔÅÒͦÎÁÌÁ [termcap]"
+
+#: term.c:2274
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: îÅÍÁ¤ ¦ÎÆÏÒÍÁæ§ ÐÒÏ ÍÏÖÌÉ×ÏÓÔ¦ ÔÅÒͦÎÁÌÁ \"%s\" [termcap]"
+
+#: term.c:2748
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ÍÏÖÌÉצÓÔØ ÔÅÒͦÎÁÌÁ \"cm\" ÏÂÏ×'ÑÚËÏ×Á"
+
+#. Highlight title
+#: term.c:4888
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- ëÌÁצۦ ÔÅÒͦÎÁÌÁ ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "ÒÏÚÐÏÞÁÔÏ ÎÏ×ÉÊ shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: ðÏÍÉÌËÁ ÞÉÔÁÎÎÑ ××ÏÄÕ, ÚÁ×ÅÒÛÕÀ ÒÏÂÏÔÕ...\n"
+
+#. must display the prompt
+#: undo.c:383
+msgid "No undo possible; continue anyway"
+msgstr "÷¦ÄͦÎÁ ÎÅ ÂÕÄÅ ÍÏÖÌÉ×Á, ÐÒÏÄÏ×ÖÉÔÉ"
+
+#: undo.c:538
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ÎÅצÒΦ ÎÏÍÅÒÉ ÒÑÄË¦× [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E438: "
+#: undo.c:707
+msgid "1 change"
+msgstr "ÏÄÎÁ ÚͦÎÁ"
+
+#: undo.c:709
+#, c-format
+msgid "%ld changes"
+msgstr "ÚͦÎ: %ld"
+
+#: undo.c:753
+msgid "E439: undo list corrupt"
+msgstr "E439: óÐÉÓÏË ×¦ÄͦÎÉ ÐÏÛËÏÄÖÅÎÏ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E439: "
+#: undo.c:785
+msgid "E440: undo line missing"
+msgstr "E440: ×ÔÒÁÞÅÎÏ ÒÑÄÏË ×¦ÄͦÎÉ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+# msgstr "E440: "
+# ---------------------------------------
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:897
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 16/32 bit Windows Ú Ð¦ÄÔÒÉÍËÏÀ GUI"
+
+#: version.c:899
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 32 bit Windows Ú Ð¦ÄÔÒÉÍËÏÀ GUI"
+
+#: version.c:902
+msgid " in Win32s mode"
+msgstr " × ÒÅÖÉͦ Win32s"
+
+#: version.c:904
+msgid " with OLE support"
+msgstr " Ú Ð¦ÄÔÒÉÍËÏÀ OLE"
+
+#: version.c:907
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 32 bit Windows"
+
+#: version.c:911
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 16 bit Windows"
+
+#: version.c:915
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 32 bit MS-DOS"
+
+#: version.c:917
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ 16 bit MS-DOS"
+
+#: version.c:923
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ MacOS X (unix)"
+
+#: version.c:925
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ MacOS X"
+
+#: version.c:928
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ ÄÌÑ MacOS"
+
+#: version.c:933
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"×ÅÒÓ¦Ñ RISC OS"
+
+#: version.c:943
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"÷ËÌÀÞÅÎÏ ÌÁÔËÉ: "
+
+#: version.c:970
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"úËÏÍЦÌØÏ×ÁÎÏ "
+
+#: version.c:973
+msgid "by "
+msgstr "-- "
+
+#: version.c:985
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ `huge' "
+
+#: version.c:988
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ `big' "
+
+#: version.c:991
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ `normal' "
+
+#: version.c:994
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ `small' "
+
+#: version.c:996
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"÷ÅÒÓ¦Ñ `tiny' "
+
+#: version.c:1002
+msgid "without GUI."
+msgstr "ÂÅÚ Ð¦ÄÔÒÉÍËÉ GUI."
+
+#: version.c:1006
+msgid "with GTK-GNOME GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ GTK-GNOME GUI."
+
+#: version.c:1008
+msgid "with GTK GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ GTK GUI."
+
+#: version.c:1012
+msgid "with X11-Motif GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ X11-Motif GUI."
+
+#: version.c:1015
+msgid "with X11-Athena GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ X11-Athena GUI."
+
+#: version.c:1018
+msgid "with BeOS GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ BeOS GUI."
+
+#: version.c:1021
+msgid "with Photon GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ Photon GUI."
+
+#: version.c:1024
+msgid "with GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ GUI."
+
+#: version.c:1027
+msgid "with Carbon GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ Carbon GUI."
+
+#: version.c:1030
+msgid "with Cocoa GUI."
+msgstr "Ú Ð¦ÄÔÒÉÍËÏÀ Cocoa GUI."
+
+#: version.c:1033
+msgid "with (classic) GUI."
+msgstr "Ú (ËÌÁÓÉÞÎÉÍ) GUI."
+
+#: version.c:1044
+msgid " Features included (+) or not (-):\n"
+msgstr ""
+" \n"
+"í¦ÓÔÉÔØ (+) [ÁÂÏ ÎŠͦÓÔÉÔØ (-)] ÔÁ˦ ËÏÍÐÏÎÅÎÔÉ:\n"
+
+#: version.c:1056
+msgid " system vimrc file: \""
+msgstr " ÓÉÓÔÅÍÎÉÊ vimrc: \""
+
+#: version.c:1061
+msgid " user vimrc file: \""
+msgstr " vimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1066
+msgid " 2nd user vimrc file: \""
+msgstr " ÄÒÕÇÉÊ vimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1071
+msgid " 3rd user vimrc file: \""
+msgstr " ÔÒÅÔ¦Ê vimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1076
+msgid " user exrc file: \""
+msgstr " exrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1081
+msgid " 2nd user exrc file: \""
+msgstr " ÄÒÕÇÉÊ exrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1087
+msgid " system gvimrc file: \""
+msgstr " ÓÉÓÔÅÍÎÉÊ gvimrc: \""
+
+#: version.c:1091
+msgid " user gvimrc file: \""
+msgstr " gvimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1095
+msgid "2nd user gvimrc file: \""
+msgstr "ÄÒÕÇÉÊ gvimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1100
+msgid "3rd user gvimrc file: \""
+msgstr "ÔÒÅÔ¦Ê gvimrc ËÏÒÉÓÔÕ×ÁÞÁ: \""
+
+#: version.c:1107
+msgid " system menu file: \""
+msgstr " ÓÉÓÔÅÍÎÅ ÍÅÎÀ: \""
+
+#: version.c:1115
+msgid " fall-back for $VIM: \""
+msgstr " ÚÁͦÎÁ ÄÌÑ $VIM: \""
+
+#: version.c:1121
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " ÚÁͦÎÁ ÄÌÑ $VIMRUNTIME: \""
+
+#: version.c:1125
+msgid "Compilation: "
+msgstr "úËÏÍЦÌØÏ×ÁÎÏ: "
+
+#: version.c:1131
+msgid "Compiler: "
+msgstr "ëÏÍЦÌÑÔÏÒ: "
+
+#: version.c:1136
+msgid "Linking: "
+msgstr "úËÏÍÐÏÎÏ×ÁÎÏ: "
+
+#: version.c:1141
+msgid " DEBUG BUILD"
+msgstr " ÷åòó¶ñ äìñ îáìáçïäöåîîñ"
+
+#: version.c:1177
+msgid "VIM - Vi IMproved"
+msgstr "Vim - ðÏËÒÁÝÅÎÉÊ Vi"
+
+#: version.c:1179
+msgid "version "
+msgstr "×ÅÒÓ¦Ñ: "
+
+#: version.c:1180
+msgid "by Bram Moolenaar et al."
+msgstr " Á×ÔÏÒ: Bram Moolenaar ÔÁ ¦Î."
+
+#: version.c:1181
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ÊצÄËÒÉÔÁ ÐÒÏÇÒÁÍÁ, ×É ÍÏÖÅÔŠצÌØÎÏ ÒÏÚÐÏ×ÓÀÄÖÕ×ÁÔÉ §§"
+
+#: version.c:1183
+msgid "Help poor children in Uganda!"
+msgstr "äÏÐÏÍÏÖ¦ÔØ ÓÉÒÏÔÁÍ Ú õÇÁÎÄÉ!"
+
+#: version.c:1184
+msgid "type :help iccf<Enter> for information "
+msgstr ":help iccf<Enter> ÐÏÄÁÌØÛÁ ¦ÎÆÏÒÍÁÃ¦Ñ "
+
+#: version.c:1186
+msgid "type :q<Enter> to exit "
+msgstr ":q<Enter> ×ÉÈ¦Ä Ú Vim "
+
+#: version.c:1187
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr ":help<Enter> ÁÂÏ <F1> ÐÅÒÅÇÌÑÄ ÄÏÐÏÍÏÇÉ "
+
+#: version.c:1188
+msgid "type :help version6<Enter> for version info"
+msgstr ":help version6<Enter> ¦ÎÆÏÒÍÁÃ¦Ñ ÐÒÏ Vim 6 "
+
+#: version.c:1191
+msgid "Running in Vi compatible mode"
+msgstr "÷É ÐÒÁÃÀ¤ÔÅ × ÒÅÖÉͦ ÓÕͦÓÎÏÍÕ Ú Vi"
+
+#: version.c:1192
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr ":set nocp<Enter> ÒÅÖÉÍ ÎÅÓÕͦÓÎÉÊ Ú Vi "
+
+#: version.c:1193
+msgid "type :help cp-default<Enter> for info on this"
+msgstr ":help cp-default<Enter> ¦ÎÆÏÒÍÁÃ¦Ñ ÐÒÏ ÓÕͦÓΦÓÔØ"
+
+#: version.c:1205
+msgid "menu Help->Orphans for information "
+msgstr "ÍÅÎÀ Help->Orphans ÐÏÄÁÌØÛÁ ¦ÎÆÏÒÍÁæÑ"
+
+#: version.c:1207
+msgid "Running modeless, typed text is inserted"
+msgstr "ðÒÁÃÀ¤ÍÏ ÂÅÚ ÒÅÖÉͦ×, ÔÅËÓÔ ÝÏ ÎÁÂÒÁÎÏ ×ÓÔÁ×ÌѤÔØÓÑ"
+
+#: version.c:1208
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "ÍÅÎÀ Edit->Global Settings->Toggle Insert Mode "
+
+#: version.c:1209
+msgid " for two modes "
+msgstr " ÄÌÑ Ä×ÏÈ ÒÅÖÉÍ¦× "
+
+#: version.c:1213
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "ÍÅÎÀ Edit->Global Settings->Toggle Vi Compatible"
+
+#: version.c:1214
+#, fuzzy
+msgid " for Vim defaults "
+msgstr " ÄÌÑ Vim defaults "
+
+#: version.c:1260
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "õ÷áçá: ÷É ËÏÒÉÓÔÕ¤ÔÅÓÑ Windows 95/98/ME"
+
+#: version.c:1263
+msgid "type :help windows95<Enter> for info on this"
+msgstr ":help windows95<Enter> ¦ÎÆÏÒÍÁÃ¦Ñ ÐÒÏ ÃÅ "
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: ÷¦ËÎÏ ÐÅÒÅÇÌÑÄÕ ×¦ÄÓÕÔΤ"
+
+# msgstr "E441: "
+#: window.c:580
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: îÅ ÍÏÖÕ ÒÏÚͦÓÔÉÔÉ ×¦ËÎÏ ÏÄÎÏÞÁÓÎÏ × ÏÂÏÈ ËÕÔÁÈ"
+
+# msgstr "E442: "
+#: window.c:1339
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: îÅ ÍÏÖÕ ÚͦÓÔÉÔÉ ×¦ËÎÏ -- ¦ÎÛ¦ צËÎÁ ÚÁ×ÁÖÁÀÔØ"
+
+# msgstr "E443: "
+#: window.c:1837
+msgid "E444: Cannot close last window"
+msgstr "E444: îÅ ÍÏÖÕ ÚÁËÒÉÔÉ ÏÓÔÁÎΤ צËÎÏ"
+
+# msgstr "E444: "
+#: window.c:2501
+msgid "Already only one window"
+msgstr "ìÉÛÅ ÏÄΊצËÎÏ"
+
+#: window.c:2548
+msgid "E445: Other window contains changes"
+msgstr "E445: ¶ÎÛ¦ צËÎÁ ͦÓÔÑÔØ ÚͦÎÉ"
+
+# msgstr "E445: "
+#: window.c:4375
+msgid "E446: No file name under cursor"
+msgstr "E446: ÷É ÎÅ ÓÔϧÔÅ ÎÁ ¦ÍÅΦ ÆÁÊÌÁ"
+
+# msgstr "E446: "
+#: window.c:4494
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: æÁÊÌ \"%s\" ÎÅ ÚÎÁÊÄÅÎÏ Õ 'path'"
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "òÅÄÁÇÕ×ÁÔÉ (&m)Ò¦ÚÎÉÍÉ Vim"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "òÅÄÁÇÕ×ÁÔÉ ÏÄÎÉÍ (&V)im"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "òÅÄÁÇÕ×ÁÔÉ ÚÁ ÄÏÔÏÍÏÇÏÀ &Vim"
+
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "òÅÄÁÇÕ×ÁÔÉ (&e)¦ÓÎÕÀÞÉÍ Vim"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "òÅÄÁÇÕ×ÁÔÉ ×ÉÂÒÁΦ ÆÁÊÌÉ ÚÁ ÄÏÐÏÍÏÇÏÀ Vim"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "ðÏÍÉÌËÁ ÓÔ×ÏÒÅÎÎÑ ÐÒÏÃÅÓÕ, ÐÅÒÅצÒÔÅ ÞÉ gvim ¤ ÎÁ ÛÌÑÈÕ ÐÏÛÕËÕ!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "ÐÏÍÉÌËÁ gvimext.dll"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "ûÌÑÈ ÚÁÎÁÄÎÏ ÄÏ×ÇÉÊ!"
+
+# msgstr "E447: "
+#: globals.h:887
+msgid "--No lines in buffer--"
+msgstr "--öÏÄÎÏÇÏ ÒÑÄËÁ--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1028
+msgid "Command aborted"
+msgstr "ëÏÍÁÎÄÕ ÚÁ×ÅÒÛÅÎÏ"
+
+#: globals.h:1029
+msgid "Argument required"
+msgstr "îÅÏÂȦÄÎÏ ×ËÁÚÁÔÉ ÁÒÇÕÍÅÎÔ"
+
+#: globals.h:1030
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: úÁ \\ ÍÁ¤ ÊÔÉ /, ? ÁÂÏ &"
+
+# msgstr "E10: "
+#: globals.h:1032
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: îÅÐÒÉÐÕÓÔÉÍÏ × ×¦ËΦ ËÏÍÁÎÄ, <CR> ×ÉËÏÎÕ¤, CTRL-C ×ÉÈÏÄÉÔØ"
+
+#: globals.h:1034
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: ëÏÍÁÎÄÁ ÎÅ ÄÏÚ×ÏÌÅÎÁ Ú Í¦ÒËÕ×ÁÎØ ÂÅÚÐÅËÉ"
+
+#: globals.h:1035
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: æÁÊÌ ¦ÓÎÕ¤ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: globals.h:1036
+msgid "Command failed"
+msgstr "ëÏÍÁÎÄÁ ÎÁ ×ÄÁÌÁÓØ"
+
+#: globals.h:1037
+msgid "Internal error"
+msgstr "÷ÎÕÔÒ¦ÛÎÑ ÐÏÍÉÌËÁ"
+
+#: globals.h:1038
+msgid "Interrupted"
+msgstr "ðÅÒÅÒ×ÁÎÏ"
+
+#: globals.h:1039
+msgid "E14: Invalid address"
+msgstr "E14: îÅצÒÎÁ ÁÄÒÅÓÁ"
+
+# msgstr "E14: "
+#: globals.h:1040
+msgid "Invalid argument"
+msgstr "îÅצÒÎÉÊ ÁÒÇÕÍÅÎÔ"
+
+#: globals.h:1041
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "îÅצÒÎÉÊ ÁÒÇÕÍÅÎÔ %s"
+
+#: globals.h:1043
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: îÅצÒÎÉÊ ×ÉÒÁÚ: %s"
+
+# msgstr "E15: "
+#: globals.h:1045
+msgid "E16: Invalid range"
+msgstr "E16: îÅצÒΦ ÍÅÖ¦"
+
+# msgstr "E16: "
+#: globals.h:1046
+msgid "Invalid command"
+msgstr "îÅצÒÎÁ ËÏÍÁÎÄÁ"
+
+#: globals.h:1048
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ÃÅ ÄÉÒÅËÔÏÒ¦Ñ"
+
+# msgstr "E17: "
+#: globals.h:1051
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: îÅcÐÏĦ×ÁÎÉÊ ÓÉÍ×ÏÌ ÐÅÒÅÄ '='"
+
+# msgstr "E18: "
+#: globals.h:1053
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ðÏͦÔËÕ ×ËÁÚÁÎÏ Ú ÎÅÍÏÖÌÉ×ÉÍ ÎÏÍÅÒÏÍ ÒÑÄËÁ"
+
+# msgstr "E19: "
+#: globals.h:1054
+msgid "E20: Mark not set"
+msgstr "E20: ðÏͦÔËÕ ÎÅ ×ËÁÚÁÎÏ"
+
+# msgstr "E20: "
+#: globals.h:1055
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: úͦÎÉ ÎÅ ÄÏÚ×ÏÌÅΦ: 'modifiable' ×ÉÍËÎÕÔÏ"
+
+# msgstr "E21: "
+#: globals.h:1056
+msgid "E22: Scripts nested too deep"
+msgstr "E22: úÁÎÁÄÔÏ ×ÅÌÉËÁ ˦ÌØ˦ÓÔØ ×ËÌÁÄÅÎÉÈ ËÏÍÁÎÄÎÉÈ ÆÁÊ̦×"
+
+# msgstr "E22: "
+#: globals.h:1057
+msgid "E23: No alternate file"
+msgstr "E23: îÅÍÁ¤ ×ÔÏÒÉÎÎÏÇÏ ÆÁÊÌÁ"
+
+# msgstr "E23: "
+#: globals.h:1058
+msgid "E24: No such abbreviation"
+msgstr "E24: ôÁËÏÇÏ ÓËÏÒÏÞÅÎÎÑ ÎÅÍÁ¤"
+
+# msgstr "E24: "
+#: globals.h:1059
+msgid "No ! allowed"
+msgstr "ëÏÒÉÓÔÕ×ÁÔÁÔÉÓÑ ! ÎÅ ÄÏÚ×ÏÌÅÎÏ"
+
+#: globals.h:1061
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: GUI ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ -- ÎÅ ×צÍËÎÅÎÏ Ð¦Ä ÞÁÓ ËÏÍЦÌÑæ§"
+
+#: globals.h:1064
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E25: Hebrew ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ -- ÎÅ ×צÍËÎÅÎÏ Ð¦Ä ÞÁÓ ËÏÍЦÌÑæ§\n"
+
+#: globals.h:1067
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr ""
+"E25: Farsi ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ -- ÎÅ ×צÍËÎÅÎÏ Ð¦Ä ÞÁÓ ËÏÍЦÌÑæ§\n"
+
+# msgstr "E25: "
+#: globals.h:1070
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ëÏÌØÏÒ %s ÎÅ ¦ÓÎÕ¤"
+
+# msgstr "E28: "
+#: globals.h:1072
+msgid "E29: No inserted text yet"
+msgstr "E29: ôÅËÓÔ ÃÅ ÎÅ ÒÅÄÁÇÕ×Á×ÓÑ"
+
+# msgstr "E29: "
+#: globals.h:1073
+msgid "E30: No previous command line"
+msgstr "E30: ëÏÍÁÎÄÉ ÝÅ ÎÅ ×ÉËÏÒÉÓÔÏ×Õ×ÁÌÉÓÑ"
+
+# msgstr "E30: "
+#: globals.h:1074
+msgid "E31: No such mapping"
+msgstr "÷ËÁÚÁΦ ÚÁͦÎÁ ÎÅ ¦ÓÎÕ¤"
+
+# msgstr "E31: "
+#: globals.h:1075
+msgid "No match"
+msgstr "öÏÄÎÏÇÏ ×ÁÒ¦ÁÎÔÕ"
+
+#: globals.h:1076
+#, c-format
+msgid "No match: %s"
+msgstr "öÏÄÎÏÇÏ ×ÁÒ¦ÁÎÔÕ: %s"
+
+#: globals.h:1077
+msgid "E32: No file name"
+msgstr "âÒÁËÕ¤ ¦ÍÅΦ ÆÁÊÌÁ"
+
+# msgstr "E32: "
+#: globals.h:1078
+msgid "E33: No previous substitute regular expression"
+msgstr "úÁͦÎÁ ÚÒÁÚË¦× ÛÅ ÎÅ ×ÉËÏÒÉÓÔÏ×Õ×ÁÌÁÓØ"
+
+# msgstr "E33: "
+#: globals.h:1079
+msgid "E34: No previous command"
+msgstr "ëÏÍÁÎÄÉ ÝÅ ÎÅ ×ÉËÏÒÉÓÔÏ×Õ×ÁÌÉÓÑ"
+
+# msgstr "E34: "
+#: globals.h:1080
+msgid "E35: No previous regular expression"
+msgstr "úÒÁÚËÉ ÝÅ ÎÅ ×ÉËÏÒÉÓÔÏ×Õ×ÁÌÉÓÑ"
+
+# msgstr "E35: "
+#: globals.h:1081
+msgid "No range allowed"
+msgstr "îÅ ÄÏÚ×ÏÌÅÎÏ ×ËÁÚÕ×ÁÔÉ ÍÅÖ¦"
+
+#: globals.h:1083
+msgid "E36: Not enough room"
+msgstr "îÅ ÄÏÓÉÔØ Í¦ÓÃÑ"
+
+# msgstr "E36: "
+#: globals.h:1085
+#, c-format
+msgid "Can't create file %s"
+msgstr "îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ ÆÁÊÌ %s"
+
+#: globals.h:1086
+msgid "Can't get temp file name"
+msgstr "îÅ ÍÏÖÕ ÚÆÏÒÍÕ×ÁÔÉ ¦Í'Ñ ÄÌÑ ÔÉÍÞÁÓÏ×ÏÇÏ ÆÁÊÌÁ"
+
+#: globals.h:1087
+#, c-format
+msgid "Can't open file %s"
+msgstr "îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ %s"
+
+#: globals.h:1088
+#, c-format
+msgid "Can't read file %s"
+msgstr "îÅ ÍÏÖÕ ÚÞÉÔÁÔÉ ÆÁÊÌ %s"
+
+#: globals.h:1089
+msgid "E37: No write since last change (use ! to override)"
+msgstr ""
+"E37: öÏÄÎÏÇÏ ÚÁÐÉÓÕ Ð¦ÓÌÑ ÏÓÔÁÎÎØϧ ÚͦÎÉ (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: globals.h:1090
+msgid "E38: Null argument"
+msgstr "E38: ÷¦ÄÓÕÔÎ¦Ê ÁÒÇÕÍÅÎÔ"
+
+#: globals.h:1092
+msgid "E39: Number expected"
+msgstr "E39: ïÞ¦ËÕ×ÁÎÏ ÞÉÓÌÏ"
+
+#: globals.h:1095
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: îÅ ÍÏÖÕ ×¦ÄËÒÉÔÉ ÆÁÊÌ ÐÏÍÉÌÏË %s"
+
+#: globals.h:1098
+msgid "E41: Out of memory!"
+msgstr "E41: úÁÂÒÁËÌÏ ÐÁÍ'ÑÔ¦!"
+
+#: globals.h:1101
+msgid "Pattern not found"
+msgstr "úÒÁÚÏË ÎÅ ÚÎÁÊÄÅÎÏ"
+
+#: globals.h:1103
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "úÒÁÚÏË ÎÅ ÚÎÁÊÄÅÎÏ: %s"
+
+#: globals.h:1104
+msgid "Argument must be positive"
+msgstr "áÒÇÕÍÅÎÔ ÍÁ¤ ÂÕÔÉ ÄÏÄÁÔΦÊ"
+
+#: globals.h:1106
+msgid "E42: No Errors"
+msgstr "E42: öÏÄÎϧ ÐÏÍÉÌËÉ"
+
+#: globals.h:1108
+msgid "E43: Damaged match string"
+msgstr "E43: 'match string' ÐÏÛËÏÖÅÎÁ [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: globals.h:1109
+msgid "E44: Corrupted regexp program"
+msgstr "E44: óÐÏÔ×ÏÒÅÎÁ ÐÒÏÇÒÁÍÁ regexp [ÐÏÍÉÌËÁ ÐÒÏÇÒÁÍÉ]"
+
+#: globals.h:1110
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: ÷ÉÓÔÁ×ÌÅÎÁ ÏÐÃ¦Ñ 'readonly' (×ÉËÏÒÉÓÔÁÊÔÅ ! ÝÏ ÎÅ Ú×ÁÖÁÔÉ)"
+
+#: globals.h:1112
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: úͦÎÎÁ \"%s\" ÍÏÖÅ ÂÕÔÉ ÌÉÛÅ ÐÒÏÞÉÔÁÎÁ"
+
+#: globals.h:1115
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ðÏÍÉÌËÁ ÚÞÉÔÕ×ÁÎÎÑ ÆÁÊÌÁ ÐÏÍÉÌÏË"
+
+#: globals.h:1118
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: îÁ ÄÏÚ×ÏÌÅÎÏ Õ *******"
+
+#: globals.h:1120
+msgid "E49: Invalid scroll size"
+msgstr "E49: îÅÍÏÖÌÉ×ÉÊ ÒÏÚÍ¦Ò ÚÓÕ×Õ"
+
+#: globals.h:1121
+msgid "E91: 'shell' option is empty"
+msgstr "E91: ÏÐÃ¦Ñ 'shell' ÐÏÒÏÖÎÑ"
+
+#: globals.h:1122
+msgid "E72: Close error on swap file"
+msgstr "E72: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÚÁËÒÉÔÔÑ ÆÁÊÌÁ ÏÂͦÎÕ"
+
+#: globals.h:1123
+msgid "E73: tag stack empty"
+msgstr "E73: óÔÅË ÔÏͦÔÏË ÓÐÕÓÔÏÛÅÎÏ"
+
+#: globals.h:1124
+msgid "E74: Command too complex"
+msgstr "E74: úÁÎÁÄÔÏ ÓËÌÁÄÎÁ ËÏÍÁÎÄÁ"
+
+#: globals.h:1125
+msgid "E75: Name too long"
+msgstr "E75: úÁÄÏ×ÇÅ ¦Í'Ñ"
+
+#: globals.h:1126
+msgid "E76: Too many ["
+msgstr "E76: úÁÂÁÇÁÔÏ '['"
+
+#: globals.h:1127
+msgid "E77: Too many file names"
+msgstr "E77: úÁÂÁÇÁÔÏ ¦ÍÅÎ ÆÁÊ̦×"
+
+#: globals.h:1128
+msgid "Trailing characters"
+msgstr "îÁÄÌÉÛËÏצ ÓÉÍ×ÏÌÉ"
+
+#: globals.h:1129
+msgid "E78: Unknown mark"
+msgstr "E78: îÅצÄÏÍÁ ÐÏͦÔËÁ"
+
+#: globals.h:1130
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: îÅ ÍÏÖÕ ÚÒÏÚÕͦÔÉ ÚÒÁÚÏË"
+
+# msgstr "E79: "
+#: globals.h:1131
+msgid "E80: Error while writing"
+msgstr "E80: ðÏÍÉÌËÁ Ð¦Ä ÞÁÓ ÚÁÐÉÓÕ"
+
+#: globals.h:1132
+msgid "Zero count"
+msgstr "îÕÌØÏ×ÉÊ Ì¦ÞÉÌØÎÉË"
+
+#: globals.h:1134
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ ÎÅ Õ ÆÁÊ̦ ËÏÍÁÎÄ"
+
+#~ msgid "1 line ~ed"
+#~ msgstr "òÑÄÏË ¦Î×ÅÒÔÏ×ÁÎÏ"
+
+#~ msgid "%ld lines ~ed"
+#~ msgstr "¶Î×ÅÒÔÏ×ÁÎÏ ÒÑÄ˦×: %ld"
+
+#~ msgid "Unable to send reply"
+#~ msgstr "îÅ ÍÏÖÕ ×¦Ä¦ÓÌÁÔÉ ×¦ÄÐÏצÄØ"
+
+#~ msgid ""
+#~ "\n"
+#~ "Send failed. No command server present ?\n"
+#~ msgstr ""
+#~ "\n"
+#~ "îÅ ×ÄÁÌÏÓÑ ×¦Ä¦ÓÌÁÔÉ ÄÁΦ. íÏÖÌÉ×Ï, ÓÅÒ×ÅÒ ËÏÍÁÎÄ ×¦ÄÓÕÔÎ¦Ê ?\n"
+
+#~ msgid "E258: no matches found in cscope connections"
+#~ msgstr "E258: ÎÅ ÚÎÁÊÄÅÎÏ ×¦ÄÐÏצÄÎÏÇÏ Ú'¤ÄÎÁÎÎÑ Ú cscope"
diff --git a/src/po/zh_CN.UTF-8.po b/src/po/zh_CN.UTF-8.po
new file mode 100644
index 000000000..956a82a5c
--- /dev/null
+++ b/src/po/zh_CN.UTF-8.po
@@ -0,0 +1,5937 @@
+# Chinese (simplified) Translation for Vim
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Wang Jun <junw@turbolinux.com.cn>
+#
+# Original translations.
+#
+#, no-wrap
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Simplified Chinese)\n"
+"POT-Creation-Date: 2001-09-24 10:10+0800\n"
+"PO-Revision-Date: 2001-09-24 11:13+0800\n"
+"Last-Translator: Wang Jun <junw@turbolinux.com.cn>\n"
+"Language-Team: Wang Jun <junw@turbolinux.com.cn>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ä¸èƒ½åˆ†é…任何缓冲区,退出程åº..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ä¸èƒ½åˆ†é…缓冲区,使用å¦ä¸€ä¸ªç¼“冲区...."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "没有释放任何缓冲区"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "没有删除任何缓冲区"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "没有删除任何缓冲区"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "已释放一个缓冲区"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "已释放 %d 个缓冲区"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "已删除一个缓冲区"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "已删除 %d 个缓冲区"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "已删除一个缓冲区"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "已删除 %d 个缓冲区"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: 没有修改过的缓冲区"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: 没有å¯åˆ—出的缓冲区"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: ä¸èƒ½åˆ‡æ¢åˆ°ç¬¬ %ld 个缓冲区"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ä¸èƒ½åˆ‡æ¢åˆ°æ›´åŽé¢çš„缓冲区"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ä¸èƒ½åˆ‡æ¢åˆ°æ›´å‰é¢çš„缓冲区"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: 已更改过缓冲区 %ld 但尚未ä¿å­˜ (å¯ç”¨ ! 强制执行)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ä¸èƒ½é‡Šæ”¾æœ€åŽä¸€ä¸ªç¼“冲区"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: 警告: 文件å过多"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: 找ä¸åˆ°ç¬¬ %ld 个缓冲区"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: 找到一个以上的 %s"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: 找ä¸åˆ° %s"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "行 %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: 已有缓冲区使用这个åå­—"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [已修改]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[未编辑]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[新文件]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[读错误]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[åªè¯»]"
+
+#: buffer.c:2510
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "行数 1 --%d%%--"
+
+#: buffer.c:2510
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "行数 %ld --%d%%--"
+
+#: buffer.c:2518
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "行 %ld/%ld --%d%%-- 列 "
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[未命å]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "[帮助]"
+
+#: buffer.c:3151 screen.c:4657
+msgid "[help]"
+msgstr "[帮助]"
+
+#: buffer.c:3183 screen.c:4663
+msgid "[Preview]"
+msgstr "[预览]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "全部"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "底端"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "顶端"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# 缓冲区列表:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[错误列表]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[未命å]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ç¬¦å· ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s 的符å·:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " è¡Œ=%ld id=%d å称=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: ä¸èƒ½æ¯”较(diff) %ld个以上的缓冲区"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: ä¸èƒ½åˆ›å»º diff "
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Patch 文件"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: ä¸èƒ½è¯»å– diff 的输出"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ç›®å‰çš„缓冲区ä¸æ˜¯åœ¨ diff 模å¼"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: 没有缓冲区在 diff 模å¼"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: 有两个以上的缓冲区在 diff 模å¼ï¼Œä¸èƒ½å†³å®šè¦ç”¨å“ªä¸€ä¸ª"
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: 找ä¸åˆ°ç¼“冲区: \"%s\""
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: 缓冲区 \"%s\" ä¸æ˜¯åœ¨ diff 模å¼"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: å¤åˆå­—符(digraph)中ä¸èƒ½ä½¿ç”¨ Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "找ä¸åˆ° keymap 文件"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: 使用 :loadkeymap "
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " å…³é”®å­—è‡ªåŠ¨å®Œæˆ (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X æ¨¡å¼ (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " åŒºåŸŸå…³é”®å­—è‡ªåŠ¨å®Œæˆ (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " æ•´è¡Œè‡ªåŠ¨å®Œæˆ (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " 文件åè‡ªåŠ¨å®Œæˆ (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " æ ‡ç­¾è‡ªåŠ¨å®Œæˆ (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " è·¯å¾„è‡ªåŠ¨å®Œæˆ (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " å®šä¹‰è‡ªåŠ¨å®Œæˆ (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " å­—å…¸è‡ªåŠ¨å®Œæˆ (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus è‡ªåŠ¨å®Œæˆ (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " å‘½ä»¤è‡ªåŠ¨å®Œæˆ (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "已到段è½ç»“å°¾"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "选项 'thesaurus' 未设定"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "选项 'dictionary' 为空"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "扫æå­—å…¸: %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (æ’å…¥) Scroll (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (替æ¢) Scroll (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "扫æ中: %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "扫æ标签."
+
+#: edit.c:3189
+msgid " Adding"
+msgstr " 增加"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- æœå¯»ä¸­..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "回到起点"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "ä»Žå…¶å®ƒè¡Œå¼€å§‹çš„è¯ (?)"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "åªæœ‰æ­¤é¡¹åŒ¹é…"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "找到 %d / %d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "åŒ¹é… %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: 未定义的å˜é‡: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: 缺少对应的括å·: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: æ— æ­¤å˜é‡: \"%s\""
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' åŽç¼ºå°‘ ':'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: 缺少对应的 \")\""
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: 缺少对应的 \"]\""
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: 缺少选项å称: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ä¸æ­£ç¡®çš„选项: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: 缺少引å·: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: 缺少引å·: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: 函数 %s çš„å‚æ•°ä¸æ­£ç¡®"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: 未定义的函数: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: 函数 %s çš„å‚数过多"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: 函数 %s çš„å‚数太少"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ä¸èƒ½åœ¨ script 上下文外使用: %s"
+
+#: eval.c:3574
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld 行: "
+
+#: eval.c:4689
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"确定(&O)\n"
+"å–消(&C)"
+
+#: eval.c:5511
+msgid "E240: No connection to Vim server"
+msgstr "E240: 没有与 Vim Server 创建连接"
+
+#: eval.c:5601
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ä¸èƒ½è¯»å–æœåŠ¡å™¨çš„å“应"
+
+#: eval.c:5626
+msgid "E258: Unable to send to client"
+msgstr "E258: ä¸èƒ½ä¼ é€åˆ°å®¢æˆ·ç«¯"
+
+#: eval.c:5667
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: ä¸èƒ½ä¼ é€åˆ° %s"
+
+#: eval.c:5763
+msgid "(Invalid)"
+msgstr "(无效)"
+
+#: eval.c:6766
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: å˜é‡ %s 尚未定义"
+
+#: eval.c:7464
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: 函数 %s å·²ç»å­˜åœ¨, 请使用 ! 强制替æ¢"
+
+#: eval.c:7506
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: 函数 %s 尚未定义"
+
+#: eval.c:7519
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: 缺少 \"(\": %s"
+
+#: eval.c:7551
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: å‚æ•°ä¸æ­£ç¡®: %s"
+
+#: eval.c:7637
+msgid "E126: Missing :endfunction"
+msgstr "E126: 缺少 :endfunction"
+
+#: eval.c:7716
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: 函数 %s 正在使用中,ä¸èƒ½é‡æ–°å®šä¹‰"
+
+#: eval.c:7773
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: 函数å称第一个字æ¯å¿…须大写: %s"
+
+#: eval.c:7779
+msgid "E129: Function name required"
+msgstr "E129: 需è¦å‡½æ•°å称"
+
+#: eval.c:7872
+msgid "function "
+msgstr "函数 "
+
+#: eval.c:7987
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: 函数 %s 尚未定义"
+
+#: eval.c:7992
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: 函数 %s 正在使用中,ä¸èƒ½åˆ é™¤"
+
+#: eval.c:8039
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: 函数递归调用层数超过 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8090
+#, c-format
+msgid "calling %s"
+msgstr "调用 %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8115 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "继续: %s"
+
+#: eval.c:8169
+msgid "E133: :return not inside a function"
+msgstr "E133: :return 必须在函数里使用"
+
+#: eval.c:8247
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s 返回值 #%ld "
+
+#: eval.c:8250
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s 返回值 \"%s\""
+
+#: eval.c:8391
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# 全局å˜é‡:\n"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "进入调试模å¼. 输入 \"cont\" 以回到正常模å¼."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "行 %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "\"%s%s\" 中断点: 第 %ld 行"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: 找ä¸åˆ°ä¸­æ–­ç‚¹: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "没有定义中断点"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s 第 %ld 行"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "å¦å­˜ä¸º"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "将改å˜ä¿å­˜åˆ° \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "未命å"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: 已更改过缓冲区 \"%s\" 但尚未ä¿å­˜ (å¯ç”¨ ! 强制执行)"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "注æ„: 已切æ¢åˆ°å…¶å®ƒç¼“冲区 (请检查 Autocommands 有无错误)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: åªæœ‰ä¸€ä¸ªæ–‡ä»¶å¯ç¼–辑"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: å·²ç»åœ¨ç¬¬ä¸€ä¸ªæ–‡ä»¶äº†"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: å·²ç»åœ¨æœ€åŽä¸€ä¸ªæ–‡ä»¶äº†"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "查找中: \"%s\" -- \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "查找中: \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "在 'runtimepath' 里找ä¸åˆ° \"%s\""
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "执行å®"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "ä¸èƒ½æ‰§è¡Œç›®å½•ï¼š \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "ä¸èƒ½æ‰§è¡Œ \"%s\""
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "第 %ld è¡Œ: ä¸èƒ½æ‰§è¡Œ \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "执行 \"%s\" 中"
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "第 %ld è¡Œ: 结æŸæ‰§è¡Œ %s"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "结æŸæ‰§è¡Œ %s"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: 注æ„: 错误的行分隔字符,å¯èƒ½æ˜¯å°‘了 ^M"
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: 在执行 script 文件外ä¸å¯ä½¿ç”¨ :scriptencoding"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: 在执行 script 文件外ä¸å¯ä½¿ç”¨ :finish"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "没有è¦æ‰“å°çš„文字"
+
+#: ex_cmds2.c:2898
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "打å°ä¸­: 第 %d 页 (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr "å¤åˆ¶ %d / %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "已打å°: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "打å°ä¸­æ–­"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: 写入 PostScript 文件出错"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: ä¸èƒ½æ‰“å¼€ PostScript 输出文件"
+
+#: ex_cmds2.c:4057
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: ä¸èƒ½æ‰“开文件 \"%s\""
+
+#: ex_cmds2.c:4068
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: ä¸èƒ½è¯» PostScript 资æºæ–‡ä»¶ \"%s\""
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "å‘é€åˆ°æ‰“å°æœº..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: æ‰“å° PostScript 文件失败"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr ""
+
+#: ex_cmds2.c:4646
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "ç›®å‰çš„ %s语言: \"%s\""
+
+#: ex_cmds2.c:4653
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ä¸èƒ½è®¾å®šè¯­è¨€ä¸º \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, å六进制 %02x, 八进制 %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: ä¸èƒ½æŠŠè¡Œç§»åˆ°å®ƒè‡ªå·²å†…"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "已移动 1 行"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "å·²æ¬ç§» %ld è¡Œ"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "å·²å¤„ç† %ld è¡Œ"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autocommand ä¸å¯ä»¥æ›´æ”¹ç¼“冲区的内容"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[æ›´æ–°åŽå°šæœªä¿å­˜]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s 在行中: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: 过多错误, 忽略文件其余部分"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "è¯»å– viminfo 文件 \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " ä¿¡æ¯"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " 标记"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " 失败"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo 文件ä¸èƒ½å†™å…¥: %s"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: ä¸èƒ½å†™å…¥ viminfo 文件 %s !"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "写入 viminfo 文件 \"%s\" 中"
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# viminfo 文件是由 vim %s 所产生.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# 如果想è¦è‡ªè¡Œä¿®æ”¹è¯·ç‰¹åˆ«å°å¿ƒï¼\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' 在此文件建立时的值\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "无效的å¯åŠ¨å­—符"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: 您在å¦ä¸€ä¸ªç¼“冲区也加载了这个文件"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "è¦å†™å…¥éƒ¨åˆ†æ–‡ä»¶å—?"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: 请使用 ! æ¥å†™å…¥éƒ¨åˆ†ç¼“冲区"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "è¦è¦†ç›–已存在的文件 \"%.*s\"?"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: 缓冲区 %ld 没有文件å"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: 文件未写入,因为 'write' 选项关闭"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" 已设定 'readonly' 选项.\n"
+"确定è¦è¦†ç›–å—?"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "编辑文件"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommands æ„外地删除新缓冲区 %s"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: :z ä¸æŽ¥å—éžæ•°å­—çš„å‚æ•°"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim 中ç¦æ­¢ä½¿ç”¨ shell 命令"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: 正则表达å¼ä¸èƒ½ç”¨å­—æ¯åˆ†éš” (?)"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "替æ¢ä¸º %s (y/n/a/q/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(已中断) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "替æ¢ä¸€ç»„"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "æ›¿æ¢ %ld 组"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " 一行中"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld 行中"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ä¸èƒ½é€’归执行"
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: æ²¡æœ‰ä½¿ç”¨è¿‡æ­£åˆ™è¡¨è¾¾å¼ (?)"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "æ¯ä¸€è¡Œéƒ½æ‰¾ä¸åˆ°æ¨¡å¼: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# å‰ä¸€ç»„替代字符串:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: 抱歉, 没有 %s 的说明"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "抱歉, 找ä¸åˆ°å¸®åŠ©æ–‡ä»¶ \"%s\""
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ä¸æ˜¯ç›®å½•"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ä¸èƒ½ä»¥å†™å…¥æ¨¡å¼æ‰“å¼€ \"%s\""
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: ä¸èƒ½è¯»å–文件: %s"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: 标签(tag) \"%s\" 在文件 %s 里é‡å¤å‡ºçŽ°å¤šæ¬¡"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: 未定义的 sign command: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: 缺少 sign å称"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E326: 找到太多 signs"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ä¸æ­£ç¡®çš„ sign 文字: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ä¸æ­£ç¡®çš„ sign: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: 缺少 sign number"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: 缓冲区å称错误: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Sign ID 错误: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[已删除]"
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "进入 Ex 模å¼. 输入 \"visua\" 以回到正常模å¼."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "已到文件结尾"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: 命令递归层数过多"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: 缺少 :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: 缺少 :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "命令文件结æŸ"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "函数结尾"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "用户定义的命令会混淆"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "ä¸æ˜¯ç¼–辑器的命令"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "ä¸è¦æƒŠæ…Œ!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "指定了å‘å‰å‚考的范围"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "指定了å‘å‰å‚考的范围,OK to swap"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "请使用 w 或 w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: 抱歉, 本命令在此版本中未实现"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: åªèƒ½æœ‰ä¸€ä¸ªæ–‡ä»¶å"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "还有 %d 个文件未编辑. 确定è¦é€€å‡ºï¼Ÿ"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: 还有 %ld 个文件未编辑"
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: 命令已ç»å­˜åœ¨, 请使用 ! 强制é‡æ–°å®šä¹‰"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" å称 å‚æ•° 范围 完整 定义 "
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "找ä¸åˆ°ç”¨æˆ·è‡ªå®šä¹‰çš„命令"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: 没有指定的属性"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ä¸æ­£ç¡®çš„å‚数个数"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ä¸èƒ½æŒ‡å®šä¸¤æ¬¡"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: 计数的缺çœå€¼ä¸æ­£ç¡®"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: 指令需è¦å‚æ•°æ‰èƒ½å®Œæˆ"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ä¸å®Œæ•´çš„值: '%s'"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ä¸æ­£ç¡®çš„属性: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: 命令å称ä¸æ­£ç¡®"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: 用户自定义命令必须以大写字æ¯å¼€å§‹"
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: 没有用户自定义的命令: %s"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: 找ä¸åˆ°é¢œè‰²æ ·å¼ %s"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "你好, Vim 用户ï¼"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "在新窗å£ç¼–辑文件"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "无交æ¢æ–‡ä»¶"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "附加文件"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: å‰ä¸€ä¸ªç›®å½•ä¸å­˜åœ¨"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: ä¸èƒ½è¯†åˆ«çš„标记"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "窗å£ä½ç½®: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: 在您的平å°ä¸Šä¸èƒ½èŽ·å¾—窗å£ä½ç½®"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "ä¿å­˜é‡å®šå‘"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "ä¿å­˜è§†å›¾"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "ä¿å­˜ä¼šè¯"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "ä¿å­˜è®¾å®š"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" 已存在 (请用 ! 强制执行)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: ä¸èƒ½ä»¥å†™å…¥æ¨¡å¼æ‰“å¼€ \"%s\""
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: å‚数必须是英文字æ¯æˆ–å‘å‰/åŽçš„引å·"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal 递归层数过深"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr ":if 层数过深"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr ":endif 缺少对应的 :if"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr ":else 缺少对应的 :if"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr ":elseif 缺少对应的 :if"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr ":while 层数过深"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr ":continue 缺少对应的 :while"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr ":break 缺少对应的 :while"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr ":endwhile 缺少对应的 :while"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction 必须在函数内部使用"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: 没有 '#' å¯æ›¿ä»£çš„文件å"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "没有 Autocommand 文件åä»¥æ›¿æ¢ \"<afile>\""
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "没有 Autocommand 缓冲区åç§°ä»¥æ›¿æ¢ \"<abuf>\""
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr "没有 Autocommand Match name ä»¥æ›¿æ¢ \"<amatch>\""
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "没有 :source 文件åä»¥æ›¿æ¢ \"<sfile>\""
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "'%' 或 '#' 指å‘空文件å,åªèƒ½ç”¨æ–¼ \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "输入为空字符串"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: ä¸èƒ½è¯»å– viminfo"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: 本版本无å¤åˆå­—符(digraph)"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "标签å称"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr "类文件\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "选项 'history' 是零"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s 历å²è®°å½• (从新到旧):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "命令行"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "查找字符串"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "表达å¼"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "输入行"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar 超过命令长度"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: 已删除活动窗å£æˆ–缓存"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "ä¸æ­£ç¡®çš„文件å"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "是目录"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "ä¸æ˜¯æ–‡ä»¶"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[未命å]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[æƒé™ä¸è¶³]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Autocommand 使程åºä¸èƒ½è¯»å–此文件"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *Filter* Autocommand ä¸å¯ä»¥æ›´æ”¹ç¼“冲区的内容"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: 从标准输入读å–...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "从标准输入读..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: 转æ¢é”™è¯¯"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[åªè¯»]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[缺少CR]'"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[找到NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[分割过长行]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[未转æ¢]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[已转æ¢]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[已加密]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "转æ¢é”™è¯¯"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[读错误]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "找ä¸åˆ°è½¬æ¢ç”¨çš„临时文件"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "字符集转æ¢é”™è¯¯"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "ä¸èƒ½è¯»å– 'charconvert' 的输出"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autocommand 删除或释放了è¦å†™å…¥çš„缓冲区"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand æ„外地改å˜äº†è¡Œå·"
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "ä¸æ˜¯æ–‡ä»¶æˆ–å¯å†™çš„设备"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "是åªè¯»æ–‡ä»¶ (请使用 ! 强制执行)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "ä¸èƒ½å†™å¤‡ä»½æ–‡ä»¶ (请使用 ! 强制执行)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "关闭备份文件出错 (请使用 ! 强制执行)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "ä¸èƒ½è¯»å–文件以供备份 (请使用 ! 强制执行)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "ä¸èƒ½åˆ›å»ºå¤‡ä»½æ–‡ä»¶ (请使用 ! 强制执行)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "ä¸èƒ½ä½œå¤‡ä»½æ–‡ä»¶ (请使用 ! 强制执行)"
+
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "Resource fork 会消失 (请使用 ! 强制执行)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: 找ä¸åˆ°å†™å…¥ç”¨çš„交æ¢æ–‡ä»¶"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: ä¸èƒ½è½¬æ¢ (请使用 ! 强制ä¸è½¬æ¢å†™å…¥)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ä¸èƒ½ä»¥å†™å…¥æ¨¡å¼æ‰“开链接文件"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: ä¸èƒ½ä»¥å†™å…¥æ¨¡å¼æ‰“å¼€"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "关闭失败"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "ä¸èƒ½å†™å…¥ -- 转æ¢å¤±è´¥"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "写入错误 (文件系统已满?)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr "转æ¢é”™è¯¯"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[设备]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[æ–°]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr "[a]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " 已附加"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr "[w]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " 已写入"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patch 模å¼: ä¸èƒ½å‚¨å­˜åŽŸå§‹æ–‡ä»¶"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Patch 模å¼: ä¸èƒ½æ”¹å˜ç©ºçš„原始文件"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: ä¸èƒ½åˆ é™¤å¤‡ä»½æ–‡ä»¶"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"警告: 原始文件丢失或æŸå\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "在文件正确写入å‰è¯·å‹¿é€€å‡ºç¼–辑器!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos æ ¼å¼]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac æ ¼å¼]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix æ ¼å¼]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 行, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld 行, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "一个字符"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld个字符"
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[最åŽä¸€è¡Œä¸å®Œæ•´]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "警告: 本文件自上次读入åŽå·²å˜åŠ¨!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "确定è¦å†™å…¥å—"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: 写入文件 \"%s\" 错误"
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: 关闭文件 \"%s\" 错误"
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: 读å–文件 \"%s\" 错误"
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand 删除缓冲区"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: 警告: 文件 \"%s\" å·²ç»ä¸å­˜åœ¨"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: 警告: 文件 \"%s\" 自上次读入åŽå·²å˜åŠ¨, 而且编辑中的缓冲区也更动了"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: 警告: 文件 \"%s\" 自上次读入åŽå·²æ”¹å˜"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: 警告: 文件 \"%s\" 自上次读入åŽå·²æ”¹å˜"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: 警告: 文件 \"%s\" 在开始编辑åŽåˆè¢«åˆ›å»ºäº†"
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "警告"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"确定(&O)\n"
+"加载文件(&L)"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: ä¸èƒ½é‡æ–°åŠ è½½ \"%s\""
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--已删除--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: 组ä¸å­˜åœ¨: \"%s\""
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * åŽé¢æœ‰ä¸æ­£ç¡®çš„字符: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: 无此事件: %s"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: ä¸èƒ½å¯¹æ‰€æœ‰äº‹ä»¶æ‰§è¡Œ autocommand"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "找ä¸åˆ°å¯¹åº”çš„ autocommand"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand 层数过深"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands: \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "执行 %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: 缺少 {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: 缺少 }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "找ä¸åˆ°ä»»ä½• fold"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: ä¸èƒ½åœ¨ç›®å‰çš„ 'foldmethod' 下创建 fold"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: ä¸èƒ½åœ¨ç›®å‰çš„ 'foldmethod' 下删除 fold"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: 选项 'commentstring' 未设定"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: 加入读缓冲中"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: 递归 mapping"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s å·²ç»æœ‰å…¨å±€ abbreviation 了"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s å·²ç»æœ‰å…¨å±€ mapping 了"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s å·²ç»æœ‰ abbreviation 了"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s çš„ mapping å·²ç»å­˜åœ¨"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "找ä¸åˆ°ç¼©å†™"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "没有这个对应"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ä¸æ­£ç¡®çš„模å¼"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<ä¸èƒ½æ‰“å¼€>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: ä¸èƒ½ä½¿ç”¨ %s 字体"
+
+#: gui_at_fs.c:2535
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: ä¸èƒ½å›žåˆ°ç›®å‰ç›®å½•"
+
+#: gui_at_fs.c:2554
+msgid "Pathname:"
+msgstr "路径:"
+
+#: gui_at_fs.c:2560
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: ä¸èƒ½å–å¾—ç›®å‰ç›®å½•"
+
+#: gui_at_fs.c:2568 gui_motif.c:1607
+msgid "OK"
+msgstr "确定"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2568 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "å–消"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim 对è¯æ¡†"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "滚动æ¡: ä¸èƒ½è®¾å®š thumb pixmap çš„ä½ç½®"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ä¸èƒ½å¯¹ä¿¡æ¯ä¸Ž callback 创建 BallonEval"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: ä¸èƒ½å¯åŠ¨å›¾åž‹ç•Œé¢"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: ä¸èƒ½è¯»å–文件 \"%s\""
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ä¸æ­£ç¡®çš„ 'guifontwide'"
+
+#: gui.c:3919
+msgid "Error"
+msgstr "错误"
+
+#: gui.c:3920
+msgid "&Ok"
+msgstr "确定(&O)"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim 对è¯æ¡†..."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - 查找与替æ¢..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - 查找..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "查找:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "替æ¢ä¸º:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "åªåŒ¹é…完全相åŒçš„å­—"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "æ–¹å‘"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "å‘上"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "å‘下"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "找下一个"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "替æ¢"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "替æ¢å…¨éƒ¨"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1194
+msgid "E233: cannot open display"
+msgstr "E233: <ä¸èƒ½æ‰“å¼€ X Server DISPLAY>"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:1997
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ä¸æ­£ç¡®çš„字符集 (Fontset): %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "字体选择"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1833
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "ä¸æ­£ç¡®çš„字体å称: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1857
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: \"%s\" ä¸æ˜¯å›ºå®šå®½åº¦å­—体"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: %s 为ä¸èƒ½è¯†åˆ«çš„颜色å称"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "使用 CUT_BUFFER0 æ¥æ›¿æ¢ç©ºé€‰æ‹©"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "过滤器"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "目录"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "帮助"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "文件"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "选择"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "撤消"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: ä¸èƒ½æ‰“å¼€ Zap 字体 '%s'"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: ä¸èƒ½ä½¿ç”¨å­—体 %s"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: 找ä¸åˆ°é¢œè‰²: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"正在å‘é€ä¸­æ–­å­ç¨‹åºçš„ä¿¡æ¯.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ä¸æ”¯æŒå‚æ•° \"-%s\"。请用 OLE 版本。"
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "查找字符串 (使用 '\\\\' æ¥è¡¨ç¤º '\\')"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "查找åŠæ›¿æ¢å­—符串 (使用 '\\\\' æ¥è¡¨ç¤º '\\')"
+
+#: gui_x11.c:1414
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: ä¸èƒ½é…ç½® color map 对象,有些颜色看起æ¥ä¼šæ€ªæ€ªçš„"
+
+#: gui_x11.c:1987
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Fontset %s 没有设定正确的字体以供显示这些字符集:"
+
+#: gui_x11.c:2030
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: 字体集(Fontset)å称: %s"
+
+#: gui_x11.c:2031
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "'%s' ä¸æ˜¯å›ºå®šå®½åº¦å­—体"
+
+#: gui_x11.c:2050
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: 字体集(Fontset)å称: %s\n"
+
+#: gui_x11.c:2051
+#, c-format
+msgid "Font0: %s\n"
+msgstr "字体0: %s\n"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "Font1: %s\n"
+msgstr "字体1: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "字体%d宽度ä¸æ˜¯å­—体0的两å€\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "字体0的宽度:%ld\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"字体1宽度: %ld\n"
+"\n"
+
+#: gui_x11.c:2201
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: ä¸èƒ½é…置颜色 %s"
+
+#: gui_x11.c:3250
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: ä¸èƒ½è¯»å– sign data!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata 错误"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr ""
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "新增数æ®åº“"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "查询模å¼"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "显示此信æ¯"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "结æŸè¿žæŽ¥"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "é‡è®¾æ‰€æœ‰è¿žæŽ¥"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "显示连接"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "这个 cscope 命令ä¸æ”¯æŒåˆ†å‰²å±å¹•\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "用法: cstag <识别字>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: 找ä¸åˆ° tag"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) 错误: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "新增 cscope æ•°æ®åº“ %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s ä¸æ˜¯ç›®å½•æˆ– cscope æ•°æ®åº“"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "è¯»å– cscope 连接 %d 时错误"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "未知的 cscope 查找形æ€"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "ä¸èƒ½åˆ›å»ºä¸Ž cscope 连接的管é“"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection 执行失败"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen 失败 (to_fp)"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen 失败 (fr_fp)"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "没有 cscope 连接"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: 找ä¸åˆ°ç¬¦åˆ cscope çš„æœå¯» %s / %s"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "cscope 命令:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (用法: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "é‡å¤çš„ cscope æ•°æ®åº“未被加入"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "已达到 cscope 最大连接数目"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: 找ä¸åˆ° cscope 连接"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: 找ä¸åˆ° cscope 连接 %s"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope 连接已关闭"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope 连接 %s 已关闭\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "cs_manage_matches 严é‡é”™è¯¯"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: è¯»å– cscope 连接 %d 错误"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "ä¸èƒ½ä½¿ç”¨ malloc\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope 标签(tag): %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # 行 "
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "文件å / 上下文 / è¡Œå·\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "é‡è®¾æ‰€æœ‰ cscope æ•°æ®åº“"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "没有 cscope 连接\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid æ•°æ®åº“å称 prepend path\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <æ— >\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: 抱歉,这个命令ä¸èƒ½ä½¿ç”¨ï¼ŒPython 程åºåº“没有加载。"
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "ä¸èƒ½åˆ é™¤ OutputObject 属性"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "softspace 必需是整数"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "ä¸æ­£ç¡®çš„属性"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "writelines() éœ€è¦ string list 当å‚æ•°"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: ä¸èƒ½åˆå§‹åŒ– I/O 对象"
+
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "ä¸æ­£ç¡®çš„表达å¼"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "因为编译时没有加入表达å¼(expression)的程åºä»£ç ï¼Œæ‰€ä»¥ä¸èƒ½ä½¿ç”¨è¡¨è¾¾å¼"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "试图使用已被删除的缓冲区"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "è¡Œå·è¶…出范围"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer 对象 (已删除): %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "标记å称ä¸æ­£ç¡®"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "无此缓冲区"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "试图使用已被删除的窗å£"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "åªè¯»å±žæ€§"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "光标定ä½åœ¨ç¼“冲区之外"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<窗å£å¯¹è±¡(已删除): %.8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<窗å£å¯¹è±¡(未知): %.8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<çª—å£ %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "无此窗å£"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "ä¸èƒ½ä¿å­˜å¤åŽŸä¿¡æ¯"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "ä¸èƒ½åˆ é™¤æ­¤è¡Œ"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "ä¸èƒ½æ›¿æ¢æ­¤è¡Œ"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "ä¸èƒ½æ’入此行"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "字符串ä¸èƒ½åŒ…å«æ–°è¡Œ"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: 此命令ä¸èƒ½ä½¿ç”¨ï¼Œæ— æ³•åŠ è½½ Ruby 程åºåº“(Library)"
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: 未知的 longjmp çŠ¶æ€ %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "切æ¢å®žçŽ°/定义"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "显示 base class of:"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "显示被覆盖的æˆå‘˜å‡½æ•°"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "æ¢å¤: 从文件"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "æ¢å¤: 从对象"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "æ¢å¤: 从所有项目"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "æ¢å¤"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "显示æºä»£ç : "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "查找 symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "æµè§ˆ class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "显示层次关系的类"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "显示 restricted 层次关系的 class"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref å‚考到"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref 被è°å‚考:"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref 有"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref 被è°ä½¿ç”¨:"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "显示文件: "
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "产生文件: "
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "ä¸èƒ½è¿žæŽ¥åˆ° SNiFF+。请检查环境å˜é‡ ($PATH 里必需å¯ä»¥æ‰¾åˆ° sniffemacs)\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: 读å–错误. å–消连接"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ ç›®å‰"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "未"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "连接中"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ä¸æ­£ç¡®çš„ SNiff+ 调用: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: 连接到 SNiFF+ 失败"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: 未连接到 SNiFF+"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: ä¸æ˜¯ SNiFF+ 的缓冲区"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: 写入错误。结æŸè¿žæŽ¥"
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "ä¸æ­£ç¡®çš„缓冲区å·"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "尚未实现"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "ä¸æ­£ç¡®çš„选项"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "ä¸èƒ½è®¾å®šè¡Œ"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "没有设定标记"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "列 %d 行 %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "ä¸èƒ½æ’入或添加此行"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "错误的标志: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "ä¸æ­£ç¡®çš„ VIM 选项"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "键盘中断"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "vim 错误"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "ä¸èƒ½åˆ›å»ºç¼“冲区/窗å£å‘½ä»¤: 对象将被删除"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "ä¸èƒ½æ³¨å†Œ callback 命令: 缓冲区/窗å£å·²ç»è¢«åˆ é™¤äº†"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: TCL 严é‡é”™è¯¯: reflist ä¸å¯é !? 请报告给 to vim-dev@vim.org"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "ä¸èƒ½æ³¨å†Œ callback 命令: 找ä¸åˆ°ç¼“冲区/窗å£"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "此命令ä¸èƒ½ä½¿ç”¨, 因为无法加载 Tcl 程åºåº“(Library)"
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: TCL 错误: 退出返回值ä¸æ˜¯æ•´æ•°!? 请报告给 to vim-dev@vim.org"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "ä¸èƒ½å–得此行"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "ä¸èƒ½æ³¨å†Œå‘½ä»¤æœåŠ¡å™¨å称"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: 没有注册为 \"%s\" çš„æœåŠ¡å™¨"
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ä¸èƒ½é€å‡ºå‘½ä»¤åˆ°ç›®çš„地程åº"
+
+#: if_xcmdsrv.c:709
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "ä¸æ­£ç¡®çš„æœåŠ¡å™¨ id : %s"
+
+#: if_xcmdsrv.c:1056
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: ä¸èƒ½è¯»å– VIM çš„ 注册表属性"
+
+#: if_xcmdsrv.c:1067
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM 的注册表属性有误。已删除。"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "ä¸æ­£ç¡®çš„选项"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "太多编辑å‚æ•°"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "缺少必è¦çš„å‚æ•°:"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "ä¸èƒ½è¾¨è®¤æ­¤é€‰é¡¹åŽçš„命令: "
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "太多 \"+command\" 或 \"-c command\" å‚æ•°"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "ä¸æ­£ç¡®çš„å‚æ•°: "
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "您的 Vim 编译时没有加入 diff 的能力"
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "试图å†æ¬¡æ‰“å¼€ script 文件: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "ä¸èƒ½ä¸ºè¯»è€Œæ‰“å¼€: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "ä¸èƒ½ä¸º script 输出而打开: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "还有 %d 个文件等待编辑\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: 注æ„: 输出ä¸æ˜¯ç»ˆç«¯(å±å¹•)\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: 注æ„: 输入ä¸æ˜¯ç»ˆç«¯(键盘)\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc 命令行"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: ä¸èƒ½è¯»å–文件 \"%s\""
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"查询更多信æ¯è¯·æ‰§è¡Œ: \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[文件 ..] 编辑指定的文件"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- 从标准输入(stdin)读å–文本"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag 编辑时使用指定的 tag"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] 编辑时加载第一个错误"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" 用法:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr "vim [å‚æ•°] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" 或:"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"å‚æ•°:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tåªæœ‰åœ¨è¿™ä¹‹åŽçš„文件"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t注册 gvim 到 OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tå–消 OLE 中的 gvim 注册"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tä½¿ç”¨å›¾å½¢ç•Œé¢ (åŒ \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tå‰æ™¯: å¯åŠ¨å›¾å½¢ç•Œé¢æ—¶ä¸ fork"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi æ¨¡å¼ (åŒ \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx æ¨¡å¼ (åŒ \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tå®‰é™ (batch) æ¨¡å¼ (åªèƒ½ä¸Ž \"ex\" 一起使用)"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff æ¨¡å¼ (åŒ \"vimdiff\", å¯è¿…速比较两文件ä¸åŒå¤„)"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tç®€æ˜“æ¨¡å¼ (åŒ \"evim\", modeless)"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tåªè¯»æ¨¡å¼ (åŒ \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\té™åˆ¶æ¨¡å¼ (åŒ \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tä¸å¯ä¿®æ”¹ (写入文件)"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\t文本ä¸å¯ä¿®æ”¹"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t二进制模å¼"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp 模å¼"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\t'compatible' 传统 Vi 兼容模å¼"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\t'nocompatible' ä¸å®Œå…¨ä¸Žä¼ ç»Ÿ Vi 兼容,å¯ä½¿ç”¨ Vim 加强能力"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose 等级"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\t调试模å¼"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tä¸ä½¿ç”¨äº¤æ¢æ–‡ä»¶, åªä½¿ç”¨å†…å­˜"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t列出交æ¢æ–‡ä»¶åŽé€€å‡º"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (加文件å) \tæ¢å¤ä¸Šæ¬¡å´©æºƒçš„资料(Recover crashed session)"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\t与 -r 一样"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tä¸ä½¿ç”¨ newcli æ¥æ‰“开窗å£"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\t使用 <device> åšè¾“入输出设备"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tå¯åŠ¨ä¸º 希伯莱模å¼"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tå¯åŠ¨ä¸º Farsi 模å¼"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\t设定终端为 <terminal>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t使用 <vimrc> 替æ¢ä»»ä½• .vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t使用 <gvimrc> 替æ¢ä»»ä½• .gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tä¸åŠ è½½ä»»ä½• plugin"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\t打开 N ä¸ªçª—å£ (预设是æ¯ä¸ªæ–‡ä»¶ä¸€ä¸ª)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tåŒ -o 但使用垂直分割"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tå¯åŠ¨åŽè·³åˆ°æ–‡ä»¶ç»“å°¾"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tå¯åŠ¨åŽè·³åˆ°ç¬¬ <lnum> è¡Œ"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\t加载任何 vimrc å‰æ‰§è¡Œ <command>"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\t加载第一个文件åŽæ‰§è¡Œ <command>"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\t加载第一个文件åŽè½½å…¥ Session 文件<session>"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t从 <scriptin> 读入一般模å¼å‘½ä»¤"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t对文件 <scriptout> 附加(append)所有输入的命令"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t对文件 <scriptout> 写入所有输入的命令"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t编辑编ç è¿‡çš„文件"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\t将 vim 与指定的 X-server 连接"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tä¸è¦è¿žæŽ¥åˆ° X Server"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\t在å¦ä¸€ä¸ª GTK 组件内打开 Vim"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <files>\t编辑 Vim æœåŠ¡å™¨ä¸Šçš„文件并退出"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> 等效于 --remote, 但会等候文件完æˆç¼–辑"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\té€å‡º <keys> 到 Vim æœåŠ¡å™¨å¹¶é€€å‡º"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\t在æœåŠ¡å™¨ä¸Šæ±‚表达å¼çš„值并打å°ç»“æžœ"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\t列出å¯ç”¨çš„ Vim æœåŠ¡å™¨å称并退出"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\té€è‡³/æˆä¸º Vim æœåŠ¡å™¨ <name>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t使用 <viminfo> è€Œéž .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\t打å°è¯´æ˜Ž(也就是本信æ¯)åŽé€€å‡º"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\t打å°ç‰ˆæœ¬ä¿¡æ¯åŽé€€å‡º"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim å¯è¯†åˆ«çš„å‚æ•° (Motif 版):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim å¯è¯†åˆ«çš„å‚æ•° (Athena 版):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tåœ¨çª—å£ <display> 执行 vim"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tå¯åŠ¨åŽæœ€å°åŒ–(iconified)"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tè¯»å– Resource 时把 vim çš„å称视为 <name>"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (尚未实现)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\t设定 <color> 为背景色 (也å¯ç”¨ -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\t设定 <color> 为一般文字颜色 (也å¯ç”¨ -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t使用 <font> 为一般字体 (也å¯ç”¨ -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\t使用 <font> 为粗体字体"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\t使用 <font> 为斜体字体"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\t使用<geom>为åˆå§‹ä½ç½® (也å¯ç”¨ -geom)"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t使用宽度为 <width> 的边框 (也å¯ç”¨ -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> 设定滚动æ¡å®½åº¦ä¸º <width> (也å¯ç”¨ -sw)"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\t设定èœå•åˆ—的高度为 <height> (也å¯ç”¨ -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\t使用å显 (也å¯ç”¨ -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tä¸ä½¿ç”¨å显 (也å¯ç”¨ +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\t设定指定的资æº"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim å¯è¯†åˆ«çš„å‚æ•° (RISC OS 版):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t窗å£åˆå§‹å®½åº¦"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t窗å£åˆå§‹é«˜åº¦"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim å¯è¯†åˆ«çš„å‚æ•° (GTK+ 版):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\t在 <display> 执行 vim (也å¯ç”¨ --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\t显示 Gnome 相关å‚æ•°"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"å‘é€è¡¨è¾¾å¼å¤±è´¥ã€‚\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"é€å‡ºå¤±è´¥ã€‚试图在本地执行\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d 中 %d 已编辑"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "å‘é€è¡¨è¾¾å¼å¤±è´¥ã€‚\n"
+
+#: mark.c:655
+msgid "No marks set"
+msgstr "没有设定标记 (mark)"
+
+#: mark.c:657
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: 找ä¸åˆ°ç¬¦åˆ \"%s\" 的标记(mark)"
+
+#. Highlight title
+#: mark.c:668
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"标记 è¡Œå· åˆ— 文件/文本"
+
+#. Highlight title
+#: mark.c:706
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" 跳到 è¡Œå· åˆ— 文件/文本"
+
+#: mark.c:1068
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# 文件标记:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1103
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (从新到旧):\n"
+
+#: mark.c:1198
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# 文件内历å²è®°å½• (从新到旧):\n"
+
+#: mark.c:1281
+msgid "Missing '>'"
+msgstr "缺少对应的 '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "ä¸æ­£ç¡®çš„代ç é¡µ"
+
+#: mbyte.c:3005
+msgid "E284: Cannot set IC values"
+msgstr "E284: ä¸èƒ½è®¾å®š IC 数值"
+
+#: mbyte.c:3157
+msgid "E285: Failed to create input context"
+msgstr "E285: ä¸èƒ½åˆ›å»ºè¾“入上下文"
+
+#: mbyte.c:3304
+msgid "E286: Failed to open input method"
+msgstr "E286: ä¸èƒ½æ‰“开输入法"
+
+#: mbyte.c:3315
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: 警告: ä¸èƒ½ç§»é™¤ IM çš„ callback"
+
+#: mbyte.c:3321
+msgid "E288: input method doesn't support any style"
+msgstr "E288: 输入法ä¸æ”¯æŒä»»ä½• style"
+
+#: mbyte.c:3378
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: 输入法ä¸æ”¯æŒä»»ä½• style"
+
+#: mbyte.c:3452
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot 需è¦å­—体集(Fontset)"
+
+#: mbyte.c:3480
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: ä½ çš„ GTK+ 比 1.2.3 è€ã€‚ä¸èƒ½ä½¿ç”¨çŠ¶æ€åŒºã€‚"
+
+#: mbyte.c:3717
+msgid "E292: Input Method Server is not running"
+msgstr "E292: 输入法管ç†ç¨‹åº(Input Method Server)未è¿è¡Œ"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: å—未被é”定"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: 交æ¢æ–‡ä»¶è¯»å–错误"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: 交æ¢æ–‡ä»¶è¯»å–错误"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: 交æ¢æ–‡ä»¶å†™å…¥é”™è¯¯"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: 交æ¢æ–‡ä»¶å†™å…¥é”™è¯¯"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: 交æ¢æ–‡ä»¶å·²ç»å­˜åœ¨! (å°å¿ƒç¬¦å·è¿žç»“的安全æ¼æ´ž!?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: 找ä¸åˆ°å— 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: 找ä¸åˆ°å— 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: 找ä¸åˆ°å— 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: 噢噢, 交æ¢æ–‡ä»¶ä¸è§äº†!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: ä¸èƒ½æ”¹å˜äº¤æ¢æ–‡ä»¶çš„å称"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: ä¸èƒ½æ‰“开交æ¢æ–‡ä»¶ \"%s\", ä¸å¯èƒ½æ¢å¤äº†"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: 找ä¸åˆ°å— 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: 找ä¸åˆ° %s 的交æ¢æ–‡ä»¶"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "请选择你è¦ä½¿ç”¨çš„交æ¢æ–‡ä»¶ (按0 退出): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: ä¸èƒ½æ‰“å¼€ %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "ä¸èƒ½è¯»å–å— 0:"
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"å¯èƒ½ä½ æ²¡åšè¿‡ä»»ä½•ä¿®æ”¹æˆ–是 Vim 还æ¥ä¸åŠæ›´æ–°äº¤æ¢æ–‡ä»¶."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ä¸èƒ½åœ¨æœ¬ç‰ˆæœ¬çš„ Vim 中使用.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "使用 Vim 3.0。\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s 看起æ¥ä¸åƒæ˜¯ Vim 交æ¢æ–‡ä»¶"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ä¸èƒ½åœ¨è¿™å°ç”µè„‘上使用.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "本文件创建于 "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"或是这文件已被破å。"
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "使用交æ¢æ–‡ä»¶ \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "原文件 \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: 警告: 原始文件å¯èƒ½å·²ç»ä¿®æ”¹è¿‡äº†"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: ä¸èƒ½ä»Ž %s 读å–å— 1"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???缺少太多行"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???è¡Œå·é”™è¯¯"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???空的 å—"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???找ä¸åˆ°ä¸€äº›è¡Œ"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: å— 1 ID 错误 (%s ä¸æ˜¯äº¤æ¢æ–‡ä»¶?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???找ä¸åˆ°å—"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? 从这里到 ???END 的内容å¯èƒ½æœ‰é—®é¢˜"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? 从这里到 ???END 的内容å¯èƒ½è¢«åˆ é™¤/æ’入过"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: æ¢å¤å·²ä¸­æ–­"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: æ¢å¤æ—¶å‘生错误; 请注æ„开头为 ??? çš„è¡Œ"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "æ¢å¤å®Œæˆ. 请确定一切正常."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(ä½ å¯èƒ½æƒ³è¦æŠŠè¿™ä¸ªæ–‡ä»¶å¦å­˜ä¸ºåˆ«çš„文件å,\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "å†æ‰§è¡Œ diff 与原文件比较以检查是å¦æœ‰æ”¹å˜)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"(D)直接删除 .swp 交æ¢æ–‡ä»¶\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "找到以下的交æ¢æ–‡ä»¶:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " 在目å‰ç›®å½•:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Using specified name:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " 在目录 "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- æ—  --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " 所有者: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " 日期: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " 日期: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [从 Vim 版本 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [ä¸åƒ Vim 的交æ¢æ–‡ä»¶]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " 文件å: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" 修改过: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "是"
+
+#: memline.c:1524
+msgid "no"
+msgstr "å¦"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" 用户å: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " 主机å: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" 主机å: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" 进程 ID: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (正在执行)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [ä¸èƒ½åœ¨æœ¬ç‰ˆæœ¬çš„ Vim 上使用]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [ä¸èƒ½åœ¨æœ¬æœºä¸Šä½¿ç”¨]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [ä¸èƒ½è¯»å–]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [ä¸èƒ½æ‰“å¼€]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: ä¸èƒ½ä¿ç•™, ä¸ä½¿ç”¨äº¤æ¢æ–‡ä»¶"
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "文件已ä¿ç•™"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: ä¿ç•™å¤±è´¥"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: 错误的 lnum: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: 找ä¸åˆ°ç¬¬ %ld è¡Œ"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: æŒ‡é’ˆå— id 错误 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx 应该是 0"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: 更新太多�"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: æŒ‡é’ˆå— id 错误 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "åˆ é™¤å— 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: 找ä¸åˆ°ç¬¬ %ld è¡Œ"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: æŒ‡é’ˆå— id 错误"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count 为零"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: è¡Œå·è¶…出范围: %ld 超过结尾"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: å— %ld 行数错误"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "堆栈大å°å¢žåŠ "
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: æŒ‡é’ˆå— id é”™ 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: 注æ„"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"å‘现交æ¢æ–‡ä»¶ \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "当打开文件时 \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " 比交æ¢æ–‡ä»¶æ–°!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) å¯èƒ½æœ‰å¦ä¸€ä¸ªç¨‹åºä¹Ÿåœ¨ç¼–辑åŒä¸€ä¸ªæ–‡ä»¶.\n"
+" 如果是这样,请注æ„ä¸è¦ä¸€èµ·å†™å…¥ï¼Œä¸ç„¶ä½ çš„努力都会付诸东æµã€‚\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " 退出,或是继续编辑。\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) 上一次编辑此文件时崩溃\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " 如果是这样, 请用 \":recover\" 或 \"vim -r"
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" æ¢å¤ä¿®æ”¹å†…容 (进一步说明请看 \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " 如果该æ¢å¤çš„都已ç»æ¢å¤äº†, 请直接删除此交æ¢æ–‡ä»¶ \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" 以é¿å…å†çœ‹åˆ°æ­¤ä¿¡æ¯.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "交æ¢æ–‡ä»¶ \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" å·²ç»å­˜åœ¨äº†!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - 注æ„"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "交æ¢æ–‡ä»¶å·²ç»å­˜åœ¨!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"以åªè¯»æ–¹å¼æ‰“å¼€(&O)\n"
+"直接编辑(&E)\n"
+"æ¢å¤(&R)\n"
+"退出(&Q)"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"以åªè¯»æ–¹å¼æ‰“å¼€(&O)\n"
+"直接编辑(&E)\n"
+"æ¢å¤(&R)\n"
+"退出(&Q)\n"
+"删除交æ¢æ–‡ä»¶(&D)"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: 找到太多交æ¢æ–‡ä»¶"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: 部份èœå•é¡¹ä¸æ˜¯å­èœå•"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: èœå•åªèƒ½åœ¨å…¶å®ƒæ¨¡å¼ä¸­ä½¿ç”¨"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: 没有那样的èœå•"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: èœå•ä¸èƒ½æŒ‡å‘å­é€‰å•"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ä¸èƒ½ç›´æŽ¥æŠŠèœå•é¡¹åŠ åˆ°èœå•æ¡ä¸­"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: 分隔线ä¸èƒ½æ˜¯èœå•çš„一部分"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- èœå• ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "切下此èœå•"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: èœå•å¿…需指å‘一个èœå•é¡¹"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: [èœå•] 找ä¸åˆ° %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s 模å¼æœªå®šä¹‰èœå•"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: èœå•å¿…需指å‘å­èœå•"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: 找ä¸åˆ°èœå• - 请检查èœå•å称"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "å¤„ç† %s æ—¶å‘生错误:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "行 %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[字符串太长]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "简体中文信æ¯ç»´æŠ¤è€…: Wang Jun <junw@turbolinux.com.cn>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "已中断: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "请按 ENTER 继续"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "请按 ENTER 或其它命令继续"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- 更多 --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: å‘下/å‘上一行, 空格/b: 一页, d/u: åŠé¡µ, q: 退出)"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: å‘下一行, 空白键: 一页, d: åŠé¡µ, q: 退出)"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "问题"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Y是\n"
+"&Nå¦"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Y是\n"
+"&Nå¦\n"
+"&Cå–消"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Y是\n"
+"&Nå¦\n"
+"&A全部ä¿å­˜\n"
+"&D全部ä¸å­˜\n"
+"&Cå–消"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "ä¿å­˜æ–‡ä»¶å¯¹è¯æ¡†"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "打开文件对è¯æ¡†"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: 主控å°(Console)模å¼æ—¶æ²¡æœ‰æ–‡ä»¶æµè§ˆå™¨(file browser)"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: 注æ„: 你正在修改一个åªè¯»æ–‡ä»¶"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "还有一行"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "少于一行"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr " 还有 %ld 行"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "åªå‰© %ld è¡Œ"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr " (已中断)"
+
+#: misc1.c:6244
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ä¿ç•™æ–‡ä»¶ä¸­...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6254
+msgid "Vim: Finished.\n"
+msgstr "Vim: 结æŸ.\n"
+
+#: misc2.c:644 misc2.c:660
+msgid "ERROR: "
+msgstr "错误: "
+
+#: misc2.c:664
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] 全部 alloc-freed %lu-%lu, 使用中 %lu, peak 使用 %lu\n"
+
+#: misc2.c:666
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[调用] 全部 re/malloc(): %lu, 全部 free()': %lu\n"
+"\n"
+
+#: misc2.c:721
+msgid "E340: Line is becoming too long"
+msgstr "E340: 此行过长"
+
+#: misc2.c:765
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: 内部错误: lalloc(%ld, )"
+
+#: misc2.c:873
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: 内存ä¸è¶³! (å°è¯•é…ç½® %lu 字节组)"
+
+#: misc2.c:2508
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "调用 shell 执行: \"%s\""
+
+#: misc2.c:2703 misc2.c:5142 option.c:4584
+msgid "Missing colon"
+msgstr "缺少冒å·"
+
+#: misc2.c:2705 misc2.c:2732
+msgid "Illegal mode"
+msgstr "ä¸æ­£ç¡®çš„模å¼"
+
+#: misc2.c:2771
+msgid "Illegal mouseshape"
+msgstr "ä¸æ­£ç¡®çš„鼠标形状"
+
+#: misc2.c:2811 misc2.c:5162
+msgid "digit expected"
+msgstr "应该为数字"
+
+#: misc2.c:2816
+msgid "Illegal percentage"
+msgstr "ä¸æ­£ç¡®çš„百分比"
+
+#: misc2.c:3120
+msgid "Enter encryption key: "
+msgstr "输入密ç : "
+
+#: misc2.c:3121
+msgid "Enter same key again: "
+msgstr "请å†è¾“入一次: "
+
+#: misc2.c:3131
+msgid "Keys don't match!"
+msgstr "两次输入密ç ä¸åŒ!"
+
+#: misc2.c:3645
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: ä¸æ­£ç¡®çš„路径: '**[number]' 必需è¦åœ¨è·¯å¾„结尾或è¦æŽ¥è‘— '%s'"
+
+#: misc2.c:4899
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath 中没有目录 \"%s\""
+
+#: misc2.c:4902
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: 在路径中找ä¸åˆ°æ–‡ä»¶ \"%s\""
+
+#: misc2.c:4908
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: 在路径中找ä¸åˆ°æ›´å¤šçš„文件 \"%s\""
+
+#: misc2.c:4911
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: 在路径中找ä¸åˆ°æ›´å¤šçš„文件 \"%s\""
+
+#: misc2.c:5154
+msgid "Illegal component"
+msgstr "ä¸æ­£ç¡®çš„组件"
+
+#: normal.c:2798
+msgid "Warning: terminal cannot highlight"
+msgstr "注æ„: 你的终端ä¸èƒ½æ˜¾ç¤ºé«˜äº®åº¦"
+
+#: normal.c:2993
+msgid "E348: No string under cursor"
+msgstr "E348: 光标处没有字符串"
+
+#: normal.c:2995
+msgid "E349: No identifier under cursor"
+msgstr "E349: 光标处没有识别字"
+
+#: normal.c:4160
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: ä¸èƒ½åœ¨ç›®å‰çš„ 'foldmethod' 下删除 fold"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "一行 %s 过 一次"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "一行 %s 过 %d 次"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld 行 %s 过 一次"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld 行 %s 过 %d 次"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "识别 %ld 行..."
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "一行已识别"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "已识别 %ld 行"
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "ä¸èƒ½å¤åˆ¶; 直接删除"
+
+#: ops.c:2018
+msgid "1 line changed"
+msgstr " 1 行 ~ed"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines changed"
+msgstr " %ld 行 ~ed"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "释放 %ld 行中"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "å·²å¤åˆ¶ 1 è¡Œ"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "å·²å¤åˆ¶ %ld è¡Œ"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: 寄存器 %s 里没有东西"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- 寄存器 ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "ä¸æ­£ç¡®çš„寄存器å称"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# 寄存器:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "未知的注册类型: %d"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: 寄存器å称错误: '%s'"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld 列; "
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "选择了 %s%ld/%ld 行; %ld/%ld 字(Word); %ld/%ld 字符(Bytes)"
+
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "列 %s/%s; 行 %ld/%ld; 字(Word) %ld/%ld; 字符(Byte) %ld/%ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "感谢您选择 Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "ä¸æ”¯æŒè¯¥é€‰é¡¹"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "ä¸èƒ½åœ¨æ¨¡å¼è¡Œé‡Œå‡ºçŽ°"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t当å‰è®¾ç½®: "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "= åŽéœ€è¦æœ‰æ•°å­—"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Termcap 里é¢æ‰¾ä¸åˆ°"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "ä¸æ­£ç¡®çš„字符 <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "这里ä¸å¯ä½¿ç”¨"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "ä¸èƒ½è®¾å®š 'term' 为空字符串"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "在图型界é¢ä¸­ä¸èƒ½åˆ‡æ¢ç»ˆç«¯"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "输入 \":gui\" æ¥å¯åŠ¨å›¾å½¢ç•Œé¢"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "'backupext' 跟 'patchmode' 是一样的"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "零长度字符串"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "<%s> åŽç¼ºå°‘æ•°å­—"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "缺少逗å·"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "必需指定一个 ' 值"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "包å«ä¸èƒ½æ˜¾ç¤ºçš„字符"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "ä¸æ­£ç¡®çš„字体"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "ä¸èƒ½ä½¿ç”¨å­—体集(Fontset)"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "ä¸æ­£ç¡®çš„字体集(Fontset)"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "ä¸èƒ½ä½¿ç”¨è®¾å®šçš„宽字体(Widefont)"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "ä¸æ­£ç¡®çš„宽字体(Widefont)"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "<%c> åŽæœ‰ä¸æ­£ç¡®çš„字符"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "需è¦é€—å·"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' å¿…éœ€æ˜¯ç©ºç™½æˆ–åŒ…å« %s"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "ä¸æ”¯æŒé¼ æ ‡"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "没有结æŸçš„表达å¼: "
+
+#: option.c:5403
+msgid "too many items"
+msgstr "太多对象"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "ä¸å¯¹ç§°çš„组"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "预览窗å£å·²ç»å­˜åœ¨äº†"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' ä¸èƒ½æ¯” 'winminheight' æ›´å°‘"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' ä¸èƒ½æ¯” 'winminwidth' æ›´å°‘"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "è‡³å°‘éœ€è¦ %d è¡Œ"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "è‡³å°‘éœ€è¦ %d 列"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ä¸æ­£ç¡®çš„选项: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- ç»ˆç«¯ç¼–ç  ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- 全局 选项值 ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- 本地 选项值 ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- 选项 ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp 错误"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': 找ä¸åˆ° %s 对应的字符"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': 分å·åŽæœ‰å¤šä½™çš„字符: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "ä¸èƒ½æ‰“å¼€"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ä¸èƒ½æ‰“开窗å£!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "éœ€è¦ Amigados 版本 2.04 以上\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "éœ€è¦ %s 版本 %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "ä¸èƒ½æ‰“å¼€ NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "ä¸èƒ½åˆ›å»º "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim 返回值: %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "ä¸èƒ½åˆ‡æ¢ä¸»æŽ§å°(console)æ¨¡å¼ !?\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ä¸æ”¯æŒè®¾å®šå±å¹•æ¨¡å¼"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ä¸æ˜¯ä¸»æŽ§å°(console)??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: ä¸èƒ½ç”¨ -f 选项执行 shell"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "ä¸èƒ½æ‰§è¡Œ "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " 已返回\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE 太å°"
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O 错误"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr ""
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ä¸æ˜¯ 80, ä¸èƒ½æ‰§è¡Œå¤–部命令"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: 调用函数库 \"%s\"() 失败"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: ä¸èƒ½é€‰æ‹©æ­¤æ‰“å°æœº"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "从 %s 到 %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: 打å°é”™è¯¯: %s"
+
+#: os_mswin.c:1459
+msgid "Unknown"
+msgstr "未知"
+
+#: os_mswin.c:1486
+#, c-format
+msgid "Printing '%s'"
+msgstr "已打å°: '%s'"
+
+#: os_mswin.c:2550
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: 字符集 \"%s\" ä¸èƒ½å¯¹åº”字体\"%s\""
+
+#: os_mswin.c:2558
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ä¸æ­£ç¡®çš„字符 '%c' 出现在字体å称 \"%s\" 内"
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ä¸æ­£ç¡®çš„ 'filetype' 选项 - 使用纯文字模å¼"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: åŒé‡ä¿¡å·, 退出中\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: CVim: 拦截到信å·(signal) %s\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: 拦截到致命的信å·(deadly signale)\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "打开 X Window 用时 %ld 秒"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X 错误\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "测试 X Window 失败"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "打开 X Window 超时"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"ä¸èƒ½æ‰§è¡Œ shell"
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"ä¸èƒ½æ‰§è¡Œ shell sh\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell 已返回"
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"ä¸èƒ½å»ºç«‹ç®¡é“\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"ä¸èƒ½ fork\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"命令已结æŸ\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "打开 X Window 失败"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "åœ¨è¡Œå· "
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "ä¸èƒ½åŠ è½½ vim32.dllï¼"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM 错误"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "ä¸èƒ½ä¿®æ­£å‡½æ•°æŒ‡é’ˆåˆ° DLL!"
+
+#: os_win16.c:578 os_win32.c:3019
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell 返回值 %d"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: 拦截到 %s 事件\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "关闭"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "注消"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "关机"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: 找ä¸åˆ°å‘½ä»¤"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"在你的 $PATH 中找ä¸åˆ° VIMRUN.EXE.\n"
+"外部命令执行完毕åŽå°†ä¸ä¼šæš‚åœ.\n"
+"进一步说明请执行 :help win32-vimrun "
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Vim 警告"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: æ ¼å¼åŒ–字符串里有太多 %%%c "
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: æ ¼å¼åŒ–字符串ä¸åº”该出现 %%%c "
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: æ ¼å¼åŒ–字符串里少了 ]"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: æ ¼å¼åŒ–字符串里有ä¸æ”¯æŒçš„ %%%c "
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: æ ¼å¼åŒ–字符串开头里有ä¸æ­£ç¡®çš„ %%%c "
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: æ ¼å¼åŒ–字符串里有ä¸æ­£ç¡®çš„ %%%c "
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' 未设定"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: 找ä¸åˆ°ç›®å½•å称或是空的目录å称"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "没有其它对象"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d / %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (行已删除)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Quickfix 堆栈结尾"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Quickfix 堆栈顶端"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "错误列表 %d/%d; 共有 %d 项错误"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: ä¸èƒ½å†™å…¥ï¼Œ'buftype' 选项已设定"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: å字太长"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: 巢状 %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: 巢状 %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c 没有接东西"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "语法错误: %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ä¸èƒ½æ‰§è¡Œ; regular expression 太å¤æ‚?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: regular expression 造æˆå †æ ˆç”¨å…‰çš„错误"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "外部符åˆ:\n"
+
+#: screen.c:2051
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--已 fold %3ld 行"
+
+#: screen.c:7411
+msgid " VREPLACE"
+msgstr " V-替æ¢"
+
+#: screen.c:7415
+msgid " REPLACE"
+msgstr " 替æ¢"
+
+#: screen.c:7420
+msgid " REVERSE"
+msgstr " å转"
+
+#: screen.c:7422
+msgid " INSERT"
+msgstr " æ’å…¥"
+
+#: screen.c:7425
+msgid " (insert)"
+msgstr " (æ’å…¥)"
+
+#: screen.c:7427
+msgid " (replace)"
+msgstr " (替æ¢)"
+
+#: screen.c:7429
+msgid " (vreplace)"
+msgstr " (v-替æ¢)"
+
+#: screen.c:7432
+msgid " Hebrew"
+msgstr " 希伯莱"
+
+#: screen.c:7440
+msgid " (lang)"
+msgstr " (语言)"
+
+#: screen.c:7443
+msgid " (paste)"
+msgstr " (粘帖)"
+
+#: screen.c:7449
+msgid " SELECT"
+msgstr " 选å–"
+
+#: screen.c:7451
+msgid " VISUAL"
+msgstr " å¯è§†"
+
+#: screen.c:7453
+msgid " BLOCK"
+msgstr " å—"
+
+#: screen.c:7455
+msgid " LINE"
+msgstr " 行"
+
+#: screen.c:7468 screen.c:7522
+msgid "recording"
+msgstr "记录中"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "已查找到文件开头;å†ä»Žç»“尾继续查找"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "已查找到文件结尾;å†ä»Žå¼€å¤´ç»§ç»­æŸ¥æ‰¾"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: 错误的查找字符串: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: 已查找到文件开头ä»æ‰¾ä¸åˆ° %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: 已查找到文件结尾ä»æ‰¾ä¸åˆ° %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: 在 ';' åŽé¢åº”该有 '?' 或 '/'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (包括上次列出符åˆé¡¹)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- 包å«æ–‡ä»¶ "
+
+#: search.c:3498
+msgid "not found "
+msgstr "找ä¸åˆ° "
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "在路径 ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (已列出)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " 找ä¸åˆ°"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "查找包å«æ–‡ä»¶: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: 当å‰è¡ŒåŒ¹é…"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "所有包å«æ–‡ä»¶éƒ½å·²æ‰¾åˆ°"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "没有包å«æ–‡ä»¶"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: 找ä¸åˆ°å®šä¹‰"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: 找ä¸åˆ° pattern"
+
+#: syntax.c:2990
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: å‚æ•°ä¸æ­£ç¡®: %s"
+
+#: syntax.c:3167
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: 无此语法 cluster: \"%s\""
+
+#: syntax.c:3331
+msgid "No Syntax items defined for this buffer"
+msgstr "这个缓冲区没有定义任何语法项"
+
+#: syntax.c:3339
+msgid "syncing on C-style comments"
+msgstr "C风格注释åŒæ­¥ä¸­"
+
+#: syntax.c:3347
+msgid "no syncing"
+msgstr "没有åŒæ­¥"
+
+#: syntax.c:3350
+msgid "syncing starts "
+msgstr "åŒæ­¥å¼€å§‹"
+
+#: syntax.c:3352 syntax.c:3421
+msgid " lines before top line"
+msgstr "è¡Œå·è¶…出范围"
+
+#: syntax.c:3356
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- 语法åŒæ­¥é¡¹ç›® (Syntax sync items) ---"
+
+#: syntax.c:3359
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"åŒæ­¥ä¸­:"
+
+#: syntax.c:3364
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- 语法项目 ---"
+
+#: syntax.c:3387
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: 无此语法 cluster: \"%s\""
+
+#: syntax.c:3411
+msgid "minimal "
+msgstr "最å°"
+
+#: syntax.c:3418
+msgid "maximal "
+msgstr "最大"
+
+#: syntax.c:4046
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: 使用了ä¸æ­£ç¡®çš„å‚æ•°"
+
+#: syntax.c:4070
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: 找ä¸åˆ° %s çš„ region item"
+
+#: syntax.c:4098
+msgid "E395: contains argument not accepted here"
+msgstr "E395: 使用了ä¸æ­£ç¡®çš„å‚æ•°"
+
+#: syntax.c:4109
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: 使用了ä¸æ­£ç¡®çš„å‚æ•°"
+
+#: syntax.c:4187
+msgid "E397: Filename required"
+msgstr "E397: 需è¦æ–‡ä»¶å称"
+
+#: syntax.c:4523
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: 缺少 \"=\": %s"
+
+#: syntax.c:4679
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: syntax region %s çš„å‚数太少"
+
+#: syntax.c:5010
+msgid "E400: No cluster specified"
+msgstr "E400: 没有指定的属性"
+
+#: syntax.c:5047
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: 找ä¸åˆ°åˆ†éš”符å·: %s"
+
+#: syntax.c:5122
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: '%s' åŽé¢çš„东西ä¸èƒ½è¯†åˆ«"
+
+#: syntax.c:5204
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: 语法åŒæ­¥: 连接行符å·æŒ‡å®šäº†ä¸¤æ¬¡"
+
+#: syntax.c:5261
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: å‚æ•°ä¸æ­£ç¡®: %s"
+
+#: syntax.c:5311
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: 缺少等å·: %s"
+
+#: syntax.c:5317
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: 空å‚æ•°: %s"
+
+#: syntax.c:5344
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ä¸èƒ½åœ¨æ­¤å‡ºçŽ°"
+
+#: syntax.c:5351
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s 必须是列表里的第一个"
+
+#: syntax.c:5421
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ä¸æ­£ç¡®çš„组å: %s"
+
+#: syntax.c:5644
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ä¸æ­£ç¡®çš„ :syntax å­å‘½ä»¤: %s"
+
+#: syntax.c:6023
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: 找ä¸åˆ° highlight group: %s"
+
+#: syntax.c:6047
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: å‚数太少: \":highlight link %s\""
+
+#: syntax.c:6054
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: å‚数过多: \":highlight link %s\""
+
+#: syntax.c:6074
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: 已设定组, 忽略 highlight link"
+
+#: syntax.c:6203
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ä¸è¯¥æœ‰çš„ç­‰å·: %s"
+
+#: syntax.c:6239
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: 缺少等å·: %s"
+
+#: syntax.c:6261
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: 缺少å‚æ•°: %s"
+
+#: syntax.c:6298
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ä¸åˆæ³•çš„值: %s"
+
+#: syntax.c:6417
+msgid "E419: FG color unknown"
+msgstr "E419: 错误的å‰æ™¯é¢œè‰²"
+
+#: syntax.c:6428
+msgid "E420: BG color unknown"
+msgstr "E420: 错误的背景颜色"
+
+#: syntax.c:6483
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: 错误的颜色å称或数值: %s"
+
+#: syntax.c:6687
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: 终端编ç å¤ªé•¿: %s"
+
+#: syntax.c:6734
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: å‚æ•°ä¸æ­£ç¡®: %s"
+
+#: syntax.c:7263
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: 使用了太多ä¸åŒçš„高亮度属性"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "标签(tag)堆栈结尾"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "标签(tag)堆栈开头"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: å·²ç»åœ¨æœ€å‰é¢çš„标签(tag)了"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: 找ä¸åˆ°æ ‡ç­¾(tag): %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "文件\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "输入 nr 或选择 (<CR> 退出): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: åªæœ‰æ­¤é¡¹ç¬¦åˆ"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: å·±ç»åœ¨æœ€åŽä¸€ä¸ªç¬¦åˆçš„标签(tag)了"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "文件 \"%s\" ä¸å­˜åœ¨"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "找到 tag: %d/%d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " 或更多"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " 以ä¸åŒå¤§å°å†™æ¥ä½¿ç”¨ tag!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: 文件 \"%s\" ä¸å­˜åœ¨"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # 到 tag 从 行 在 文件/文本"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "线性查找标签 (Tags)"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "二进制查找(Binary search) 标签(Tags)"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "查找 tag 文件 \"%s\""
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag 文件路径被截断为 %s\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Tag 文件 \"%s\" æ ¼å¼é”™è¯¯"
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "在 %ld 字节之å‰"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag 文件未排åº: %s"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: 没有 tag 文件"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: 找ä¸åˆ° tag"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: 找ä¸åˆ° tag, 试ç€çŒœ!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ä¸èƒ½åŠ è½½ã€‚å¯ç”¨çš„内建终端形å¼æœ‰:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "预设: '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "ä¸èƒ½æ‰“å¼€ termcap 文件"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "在terminfo中未找到终端项"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "在termcap中未找到终端项"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap 没有 \"%s\" 项"
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ç»ˆç«¯éœ€è¦ \"cm\" 的能力"
+
+#. Highlight title
+#: term.c:4872
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- 终端按键 ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "å¯åŠ¨æ–° shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: 读错误,退出中...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "ä¸èƒ½è¿˜åŽŸï¼›è¯·ç»§ç»­"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: è¡Œå·é”™è¯¯"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "一项改å˜"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "%ld 项改å˜"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: 撤销列表æŸå"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: 找ä¸åˆ°è¦æ’¤é”€æ“作的行"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32ä½ å›¾åž‹ç•Œé¢ç‰ˆæœ¬"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit 图型界é¢ç‰ˆæœ¬"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr "Win32s 模å¼"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr "æ”¯æŒ OLE"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32ä½ å­—ç¬¦ç•Œé¢ç‰ˆæœ¬"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 32ä½ å­—ç¬¦ç•Œé¢ç‰ˆæœ¬"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 ä½ MS-DOS 版本"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 ä½ MS-DOS 版本"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) 版本"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X 版本"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS 版本"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS 版本"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"加入补ä¸: "
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"编译"
+
+#: version.c:731
+msgid "by "
+msgstr "者:"
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"超强版本 "
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"大型版本 "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"一般版本 "
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"简易版本 "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"精简版本 "
+
+#: version.c:760
+msgid "without GUI."
+msgstr "ä¸ä½¿ç”¨å›¾åž‹ç•Œé¢ã€‚"
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "使用 GTK-GNOME 图型界é¢ã€‚"
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "使用 GTK 图型界é¢ã€‚"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "使用 X11-Motif 图型界é¢ã€‚"
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "使用 X11-Athena 图型界é¢ã€‚"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "使用 BeOS 图型界é¢ã€‚"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "使用Photon图型界é¢ã€‚"
+
+#: version.c:782
+msgid "with GUI."
+msgstr "使用图型界é¢ã€‚"
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "使用 Carbon 图型界é¢ã€‚"
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "使用 Cocoa 图型界é¢ã€‚"
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "使用 (传统) 图型界é¢ã€‚"
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " ç›®å‰å¯ä½¿ç”¨(+)与ä¸å¯ä½¿ç”¨(-)的模å—列表:\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " 系统 vimrc é…置文件: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " 用户的 vimrc é…置文件: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " 第二组用户 vimrc 文件: \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " 第三组用户 vimrc 文件: \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " 用户的 exrc é…置文件: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " 第二组用户 exrc 文件: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " 系统 gvimrc 文件: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " 用户的 gvimrc é…置文件: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr " 第二组用户 gvimrc 文件: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr " 第三组用户 gvimrc 文件: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " 系统èœå•é…置文件: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " $VIM 预设值: \""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME 预设值: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "编译方å¼: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "编译器: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "链结方å¼: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " 调试版本"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:936
+msgid "version "
+msgstr "版本 "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "维护人: Bram Moolenaar et al."
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim 为å¯è‡ªç”±å‘行的开放æºä»£ç è½¯ä»¶"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "帮助乌干达的å¯æ€œå„¿ç«¥!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "进一步说明请输入 :help iccf<Enter>"
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "è¦é€€å‡ºè¯·è¾“å…¥ :q<Enter> "
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "在线帮助请输入 :help<Enter> "
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "新版本信æ¯è¯·è¾“å…¥ :help version6<Enter>"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Vi 兼容模å¼"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "如果è¦å®Œå…¨æ¨¡æ‹Ÿä¼ ç»Ÿ Vi 请输入 :set nocp<Enter>"
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "如果需è¦å¯¹ Vi 兼容模å¼è¿›ä¸€æ­¥è¯´æ˜Žè¯·è¾“å…¥ :help cp-default<Enter>"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "注æ„: 检测到 Windows 95/98/ME"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "如果需è¦å¯¹ Windows 95 支æŒçš„更多信æ¯è¯·è¾“å…¥ :help windows95<Enter>"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: 没有预览窗å£"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ä¸èƒ½åŒæ—¶åˆ†å‰²çª—å£ä¸ºå·¦ä¸Šå’Œå³ä¸‹è§’"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: 有其它分割窗å£æ—¶ä¸èƒ½æ—‹è½¬"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: ä¸èƒ½å…³é—­æœ€åŽä¸€ä¸ªçª—å£"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "å·²ç»åªå‰©ä¸€ä¸ªçª—å£äº†"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: 其它窗å£æœ‰æ”¹å˜çš„内容"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: 光标处没有文件å"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: 在路径中找ä¸åˆ°æ–‡ä»¶ \"%s\""
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "用 &multiple Vims 编辑"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "用 single &Vim 编辑"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "用 &Vim 编辑"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "用当å‰çš„ Vim 编辑 - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "用 Vim 编辑选择的文件"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "创建进程失败: 请检查gvim是å¦åœ¨å¯æ‰§è¡Œè·¯å¾„中!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll 出错"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "路径å太长"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--缓冲区无资料--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "命令被强制中断"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "需è¦æŒ‡ä»¤å‚æ•°"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ åŽé¢åº”该有 / ? 或 &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ä¸èƒ½åœ¨å‘½ä»¤è¡Œçª—å£ä¸­ä½¿ç”¨ã€‚<CR>执行,CTRL-C 退出"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: exrc/vimrc 里的指令ä¸èƒ½æ‰§è¡Œ"
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: 文件已ç»å­˜åœ¨ (å¯ç”¨ ! 强制替æ¢)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "命令执行失败"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "内部错误"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "已中断"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: ä¸æ­£ç¡®çš„地å€"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "ä¸æ­£ç¡®çš„å‚æ•°"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "ä¸æ­£ç¡®çš„å‚æ•°: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ä¸æ­£ç¡®çš„表达å¼: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: ä¸æ­£ç¡®çš„范围"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "ä¸æ­£ç¡®çš„命令"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" 是目录"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' å‰é¢å‡ºçŽ°äº†é”™è¯¯çš„字符"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: 标记的行å·é”™è¯¯"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: 没有设定标记"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: 因为 'modifiable' 选项是关闭的,所以ä¸èƒ½ä¿®æ”¹"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: 递归调用太多层"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: 没有替代的文件"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: 没有这个 abbreviation 对应"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "ä¸å¯ä½¿ç”¨ '!'"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: 因为编译时没有加入图型界é¢çš„程åºä»£ç ï¼Œæ‰€ä»¥ä¸èƒ½ä½¿ç”¨å›¾åž‹ç•Œé¢"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: 因为编译时没有加入希伯莱的程åºä»£ç ï¼Œæ‰€ä»¥ä¸èƒ½ä½¿ç”¨ Hebrew\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: 因为编译时没有加入 Farsi 的程åºä»£ç ï¼Œæ‰€ä»¥ä¸èƒ½ä½¿ç”¨ Farsi\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: 没有å为 '%s' çš„ highlight group"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: 没有æ’入过文字"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: 没有å‰ä¸€é¡¹å‘½ä»¤"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: 没有这个 mapping 对应"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "找ä¸åˆ°"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "找ä¸åˆ°: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: 没有文件å"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: 没有å‰ä¸€ä¸ªæŸ¥æ‰¾/替æ¢çš„命令"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: 没有å‰ä¸€ä¸ªå‘½ä»¤"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: 没有å‰ä¸€ä¸ªæŸ¥æ‰¾å‘½ä»¤"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "ä¸å¯ä½¿ç”¨èŒƒå›´å‘½ä»¤"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: 没有足够的空间"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "ä¸èƒ½åˆ›å»ºæ–‡ä»¶ %s"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "ä¸èƒ½å¾—到临时文件å"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "ä¸èƒ½æ‰“开文件 %s"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "ä¸èƒ½è¯»å–文件 %s"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: 文件内容已改å˜ä½†å°šæœªä¿å­˜ (å¯ç”¨ ! 强制执行)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: 空的 (Null) å‚æ•°"
+
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: 应该è¦æœ‰æ•°å­—"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ä¸èƒ½æ‰“开错误文件 %s"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: 内存ä¸è¶³!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "找ä¸åˆ°æ¨¡å¼"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "找ä¸åˆ°æ¨¡å¼ %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "å‚数应该是正数"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: 没有错误"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: 匹é…字符串有问题"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: 正则表达å¼æœ‰é—®é¢˜"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: 设定 'readonly' 选项(åªè¯») (å¯ç”¨ ! 强制执行)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: ä¸èƒ½è®¾å®šåªè¯»å˜é‡ \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: 读å–错误文件失败"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ä¸èƒ½åœ¨ sandbox 里出现"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: 错误的滚动大å°"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'E71: 选项 'shell' 未设定"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: 交æ¢æ–‡ä»¶å…³é—­é”™è¯¯"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: 标签堆栈已空"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: 命令太å¤æ‚"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: å字太长"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: 太多 ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: 太多文件å"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "你输入了多余的字符"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: ä¸èƒ½åŠžè¯†çš„标记"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ä¸èƒ½æ‰©å±•é€šé…符"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: 写入错误"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "数到零 (?)"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ä¸èƒ½åœ¨ script 本文外使用."
diff --git a/src/po/zh_CN.cp936.po b/src/po/zh_CN.cp936.po
new file mode 100644
index 000000000..53e6cbcb3
--- /dev/null
+++ b/src/po/zh_CN.cp936.po
@@ -0,0 +1,5937 @@
+# Chinese (simplified) Translation for Vim
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Wang Jun <junw@turbolinux.com.cn>
+#
+# Generated from zh_CN.po, DO NOT EDIT.
+#
+#, no-wrap
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Simplified Chinese)\n"
+"POT-Creation-Date: 2001-09-24 10:10+0800\n"
+"PO-Revision-Date: 2001-09-24 11:13+0800\n"
+"Last-Translator: Wang Jun <junw@turbolinux.com.cn>\n"
+"Language-Team: Wang Jun <junw@turbolinux.com.cn>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=gbk\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ²»ÄÜ·ÖÅäÈκλº³åÇø£¬Í˳ö³ÌÐò..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ²»ÄÜ·ÖÅ仺³åÇø£¬Ê¹ÓÃÁíÒ»¸ö»º³åÇø...."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "ûÓÐÊÍ·ÅÈκλº³åÇø"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "ûÓÐɾ³ýÈκλº³åÇø"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "ûÓÐɾ³ýÈκλº³åÇø"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "ÒÑÊÍ·ÅÒ»¸ö»º³åÇø"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "ÒÑÊÍ·Å %d ¸ö»º³åÇø"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "ÒÑɾ³ýÒ»¸ö»º³åÇø"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "ÒÑɾ³ý %d ¸ö»º³åÇø"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "ÒÑɾ³ýÒ»¸ö»º³åÇø"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "ÒÑɾ³ý %d ¸ö»º³åÇø"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: ûÓÐÐ޸ĹýµÄ»º³åÇø"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: ûÓпÉÁгöµÄ»º³åÇø"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: ²»ÄÜÇл»µ½µÚ %ld ¸ö»º³åÇø"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ²»ÄÜÇл»µ½¸üºóÃæµÄ»º³åÇø"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ²»ÄÜÇл»µ½¸üÇ°ÃæµÄ»º³åÇø"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: ÒѸü¸Ä¹ý»º³åÇø %ld µ«ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ²»ÄÜÊÍ·Å×îºóÒ»¸ö»º³åÇø"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ¾¯¸æ: ÎļþÃû¹ý¶à"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: ÕÒ²»µ½µÚ %ld ¸ö»º³åÇø"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: ÕÒµ½Ò»¸öÒÔÉ쵀 %s"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: ÕÒ²»µ½ %s"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "ÐÐ %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ÒÑÓлº³åÇøʹÓÃÕâ¸öÃû×Ö"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [ÒÑÐÞ¸Ä]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[δ±à¼­]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[ÐÂÎļþ]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[¶Á´íÎó]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[Ö»¶Á]"
+
+#: buffer.c:2510
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "ÐÐÊý 1 --%d%%--"
+
+#: buffer.c:2510
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "ÐÐÊý %ld --%d%%--"
+
+#: buffer.c:2518
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ÐÐ %ld/%ld --%d%%-- ÁÐ "
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[δÃüÃû]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "[°ïÖú]"
+
+#: buffer.c:3151 screen.c:4657
+msgid "[help]"
+msgstr "[°ïÖú]"
+
+#: buffer.c:3183 screen.c:4663
+msgid "[Preview]"
+msgstr "[Ô¤ÀÀ]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "È«²¿"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "µ×¶Ë"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "¶¥¶Ë"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# »º³åÇøÁбí:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[´íÎóÁбí]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[δÃüÃû]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ·ûºÅ ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s µÄ·ûºÅ:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ÐÐ=%ld id=%d Ãû³Æ=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: ²»ÄܱȽÏ(diff) %ld¸öÒÔÉϵĻº³åÇø"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: ²»ÄÜ´´½¨ diff "
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Patch Îļþ"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: ²»ÄܶÁÈ¡ diff µÄÊä³ö"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Ä¿Ç°µÄ»º³åÇø²»ÊÇÔÚ diff ģʽ"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: ûÓлº³åÇøÔÚ diff ģʽ"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: ÓÐÁ½¸öÒÔÉϵĻº³åÇøÔÚ diff ģʽ£¬²»Äܾö¶¨ÒªÓÃÄÄÒ»¸ö"
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: ÕÒ²»µ½»º³åÇø: \"%s\""
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: »º³åÇø \"%s\" ²»ÊÇÔÚ diff ģʽ"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: ¸´ºÏ×Ö·û(digraph)Öв»ÄÜʹÓà Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "ÕÒ²»µ½ keymap Îļþ"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ʹÓà :loadkeymap "
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " ¹Ø¼ü×Ö×Ô¶¯Íê³É (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X ģʽ (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " ÇøÓò¹Ø¼ü×Ö×Ô¶¯Íê³É (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " ÕûÐÐ×Ô¶¯Íê³É (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " ÎļþÃû×Ô¶¯Íê³É (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " ±êÇ©×Ô¶¯Íê³É (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " ·¾¶×Ô¶¯Íê³É (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " ¶¨Òå×Ô¶¯Íê³É (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " ×Öµä×Ô¶¯Íê³É (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus ×Ô¶¯Íê³É (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " ÃüÁî×Ô¶¯Íê³É (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Òѵ½¶ÎÂä½áβ"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "Ñ¡Ïî 'thesaurus' δÉ趨"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "Ñ¡Ïî 'dictionary' Ϊ¿Õ"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "ɨÃè×Öµä: %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (²åÈë) Scroll (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (Ìæ»») Scroll (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "ɨÃèÖÐ: %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "ɨÃè±êÇ©."
+
+#: edit.c:3189
+msgid " Adding"
+msgstr " Ôö¼Ó"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- ËÑÑ°ÖÐ..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "»Øµ½Æðµã"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "´ÓÆäËüÐпªÊ¼µÄ´Ê (?)"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "Ö»ÓдËÏîÆ¥Åä"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "ÕÒµ½ %d / %d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "Æ¥Åä %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: 䶨ÒåµÄ±äÁ¿: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ȱÉÙ¶ÔÓ¦µÄÀ¨ºÅ: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Î޴˱äÁ¿: \"%s\""
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' ºóȱÉÙ ':'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: ȱÉÙ¶ÔÓ¦µÄ \")\""
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: ȱÉÙ¶ÔÓ¦µÄ \"]\""
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ȱÉÙÑ¡ÏîÃû³Æ: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ²»ÕýÈ·µÄÑ¡Ïî: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: ȱÉÙÒýºÅ: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ȱÉÙÒýºÅ: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: º¯Êý %s µÄ²ÎÊý²»ÕýÈ·"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: 䶨ÒåµÄº¯Êý: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: º¯Êý %s µÄ²ÎÊý¹ý¶à"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: º¯Êý %s µÄ²ÎÊýÌ«ÉÙ"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ²»ÄÜÔÚ script ÉÏÏÂÎÄÍâʹÓÃ: %s"
+
+#: eval.c:3574
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ÐÐ: "
+
+#: eval.c:4689
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"È·¶¨(&O)\n"
+"È¡Ïû(&C)"
+
+#: eval.c:5511
+msgid "E240: No connection to Vim server"
+msgstr "E240: ûÓÐÓë Vim Server ´´½¨Á¬½Ó"
+
+#: eval.c:5601
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ²»ÄܶÁÈ¡·þÎñÆ÷µÄÏìÓ¦"
+
+#: eval.c:5626
+msgid "E258: Unable to send to client"
+msgstr "E258: ²»ÄÜ´«Ë͵½¿Í»§¶Ë"
+
+#: eval.c:5667
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: ²»ÄÜ´«Ë͵½ %s"
+
+#: eval.c:5763
+msgid "(Invalid)"
+msgstr "(ÎÞЧ)"
+
+#: eval.c:6766
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: ±äÁ¿ %s ÉÐ䶨Òå"
+
+#: eval.c:7464
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: º¯Êý %s ÒѾ­´æÔÚ, ÇëʹÓà ! Ç¿ÖÆÌæ»»"
+
+#: eval.c:7506
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: º¯Êý %s ÉÐ䶨Òå"
+
+#: eval.c:7519
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: ȱÉÙ \"(\": %s"
+
+#: eval.c:7551
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: ²ÎÊý²»ÕýÈ·: %s"
+
+#: eval.c:7637
+msgid "E126: Missing :endfunction"
+msgstr "E126: ȱÉÙ :endfunction"
+
+#: eval.c:7716
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: º¯Êý %s ÕýÔÚʹÓÃÖУ¬²»ÄÜÖØж¨Òå"
+
+#: eval.c:7773
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: º¯ÊýÃû³ÆµÚÒ»¸ö×Öĸ±ØÐë´óд: %s"
+
+#: eval.c:7779
+msgid "E129: Function name required"
+msgstr "E129: ÐèÒªº¯ÊýÃû³Æ"
+
+#: eval.c:7872
+msgid "function "
+msgstr "º¯Êý "
+
+#: eval.c:7987
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: º¯Êý %s ÉÐ䶨Òå"
+
+#: eval.c:7992
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: º¯Êý %s ÕýÔÚʹÓÃÖУ¬²»ÄÜɾ³ý"
+
+#: eval.c:8039
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: º¯ÊýµÝ¹éµ÷ÓòãÊý³¬¹ý 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8090
+#, c-format
+msgid "calling %s"
+msgstr "µ÷ÓÃ %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8115 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "¼ÌÐø: %s"
+
+#: eval.c:8169
+msgid "E133: :return not inside a function"
+msgstr "E133: :return ±ØÐëÔÚº¯ÊýÀïʹÓÃ"
+
+#: eval.c:8247
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ·µ»ØÖµ #%ld "
+
+#: eval.c:8250
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ·µ»ØÖµ \"%s\""
+
+#: eval.c:8391
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# È«¾Ö±äÁ¿:\n"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "½øÈëµ÷ÊÔģʽ. ÊäÈë \"cont\" ÒԻص½Õý³£Ä£Ê½."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "ÐÐ %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "\"%s%s\" Öжϵã: µÚ %ld ÐÐ"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ÕÒ²»µ½Öжϵã: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "ûÓж¨ÒåÖжϵã"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s µÚ %ld ÐÐ"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Áí´æΪ"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "½«¸Ä±ä±£´æµ½ \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "δÃüÃû"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ÒѸü¸Ä¹ý»º³åÇø \"%s\" µ«ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "×¢Òâ: ÒÑÇл»µ½ÆäËü»º³åÇø (Çë¼ì²é Autocommands ÓÐÎÞ´íÎó)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Ö»ÓÐÒ»¸öÎļþ¿É±à¼­"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: ÒѾ­ÔÚµÚÒ»¸öÎļþÁË"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ÒѾ­ÔÚ×îºóÒ»¸öÎļþÁË"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "²éÕÒÖÐ: \"%s\" -- \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "²éÕÒÖÐ: \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "ÔÚ 'runtimepath' ÀïÕÒ²»µ½ \"%s\""
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "Ö´Ðкê"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "²»ÄÜÖ´ÐÐĿ¼£º \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "²»ÄÜÖ´ÐÐ \"%s\""
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "µÚ %ld ÐÐ: ²»ÄÜÖ´ÐÐ \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "Ö´ÐÐ \"%s\" ÖÐ"
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "µÚ %ld ÐÐ: ½áÊøÖ´ÐÐ %s"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "½áÊøÖ´ÐÐ %s"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: ×¢Òâ: ´íÎóµÄÐзָô×Ö·û£¬¿ÉÄÜÊÇÉÙÁË ^M"
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: ÔÚÖ´ÐÐ script ÎļþÍâ²»¿ÉʹÓà :scriptencoding"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: ÔÚÖ´ÐÐ script ÎļþÍâ²»¿ÉʹÓà :finish"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "ûÓÐÒª´òÓ¡µÄÎÄ×Ö"
+
+#: ex_cmds2.c:2898
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "´òÓ¡ÖÐ: µÚ %d Ò³ (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr "¸´ÖÆ %d / %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "ÒÑ´òÓ¡: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "´òÓ¡ÖжÏ"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: дÈë PostScript Îļþ³ö´í"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: ²»ÄÜ´ò¿ª PostScript Êä³öÎļþ"
+
+#: ex_cmds2.c:4057
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: ²»ÄÜ´ò¿ªÎļþ \"%s\""
+
+#: ex_cmds2.c:4068
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: ²»ÄܶÁ PostScript ×ÊÔ´Îļþ \"%s\""
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "·¢Ë͵½´òÓ¡»ú..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: ´òÓ¡ PostScript Îļþʧ°Ü"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr ""
+
+#: ex_cmds2.c:4646
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Ä¿Ç°µÄ %sÓïÑÔ: \"%s\""
+
+#: ex_cmds2.c:4653
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ²»ÄÜÉ趨ÓïÑÔΪ \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Ê®Áù½øÖÆ %02x, °Ë½øÖÆ %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: ²»ÄÜ°ÑÐÐÒƵ½Ëü×ÔÒÑÄÚ"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "ÒÑÒƶ¯ 1 ÐÐ"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "ÒÑ°áÒÆ %ld ÐÐ"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "ÒÑ´¦Àí %ld ÐÐ"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autocommand ²»¿ÉÒÔ¸ü¸Ä»º³åÇøµÄÄÚÈÝ"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[¸üкóÉÐδ±£´æ]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s ÔÚÐÐÖÐ: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ¹ý¶à´íÎó, ºöÂÔÎļþÆäÓಿ·Ö"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "¶ÁÈ¡ viminfo Îļþ \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " ÐÅÏ¢"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " 񈬀"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " ʧ°Ü"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo Îļþ²»ÄÜдÈë: %s"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: ²»ÄÜдÈë viminfo Îļþ %s !"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "дÈë viminfo Îļþ \"%s\" ÖÐ"
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# viminfo ÎļþÊÇÓÉ vim %s Ëù²úÉú.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Èç¹ûÏëÒª×ÔÐÐÐÞ¸ÄÇëÌرðСÐÄ£¡\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' ÔÚ´ËÎļþ½¨Á¢Ê±µÄÖµ\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "ÎÞЧµÄÆô¶¯×Ö·û"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: ÄúÔÚÁíÒ»¸ö»º³åÇøÒ²¼ÓÔØÁËÕâ¸öÎļþ"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "ҪдÈ벿·ÖÎļþÂð£¿"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ÇëʹÓà ! À´Ð´È벿·Ö»º³åÇø"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Òª¸²¸ÇÒÑ´æÔÚµÄÎļþ \"%.*s\"£¿"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: »º³åÇø %ld ûÓÐÎļþÃû"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ÎļþδдÈ룬ÒòΪ 'write' Ñ¡Ïî¹Ø±Õ"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" ÒÑÉ趨 'readonly' Ñ¡Ïî.\n"
+"È·¶¨Òª¸²¸ÇÂð£¿"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "±à¼­Îļþ"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommands ÒâÍâµØɾ³ýлº³åÇø %s"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: :z ²»½ÓÊÜ·ÇÊý×ֵIJÎÊý"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim ÖнûֹʹÓà shell ÃüÁî"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: ÕýÔò±í´ïʽ²»ÄÜÓÃ×Öĸ·Ö¸ô (?)"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "Ì滻Ϊ %s (y/n/a/q/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(ÒÑÖжÏ) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "Ìæ»»Ò»×é"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "Ìæ»» %ld ×é"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " Ò»ÐÐÖÐ"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld ÐÐÖÐ"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ²»ÄܵݹéÖ´ÐÐ"
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: ûÓÐʹÓùýÕýÔò±í´ïʽ (?)"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "ÿһÐж¼ÕÒ²»µ½Ä£Ê½: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ç°Ò»×éÌæ´ú×Ö·û´®:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ±§Ç¸, ûÓÐ %s µÄ˵Ã÷"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "±§Ç¸, ÕÒ²»µ½°ïÖúÎļþ \"%s\""
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ²»ÊÇĿ¼"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ²»ÄÜÒÔдÈëģʽ´ò¿ª \"%s\""
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: ²»ÄܶÁÈ¡Îļþ: %s"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ±êÇ©(tag) \"%s\" ÔÚÎļþ %s ÀïÖظ´³öÏÖ¶à´Î"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: 䶨ÒåµÄ sign command: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: ȱÉÙ sign Ãû³Æ"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E326: ÕÒµ½Ì«¶à signs"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ²»ÕýÈ·µÄ sign ÎÄ×Ö: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ²»ÕýÈ·µÄ sign: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: ȱÉÙ sign number"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: »º³åÇøÃû³Æ´íÎó: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Sign ID ´íÎó: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[ÒÑɾ³ý]"
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "½øÈë Ex ģʽ. ÊäÈë \"visua\" ÒԻص½Õý³£Ä£Ê½."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "Òѵ½Îļþ½áβ"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: ÃüÁîµÝ¹é²ãÊý¹ý¶à"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: ȱÉÙ :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: ȱÉÙ :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "ÃüÁîÎļþ½áÊø"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "º¯Êý½áβ"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Óû§¶¨ÒåµÄÃüÁî»á»ìÏý"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "²»ÊDZ༭Æ÷µÄÃüÁî"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "²»Òª¾ª»Å!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Ö¸¶¨ÁËÏòÇ°²Î¿¼µÄ·¶Î§"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Ö¸¶¨ÁËÏòÇ°²Î¿¼µÄ·¶Î§£¬OK to swap"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "ÇëʹÓà w »ò w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ±§Ç¸, ±¾ÃüÁîÔÚ´Ë°æ±¾ÖÐδʵÏÖ"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: Ö»ÄÜÓÐÒ»¸öÎļþÃû"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "»¹ÓÐ %d ¸öÎļþδ±à¼­. È·¶¨ÒªÍ˳ö£¿"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: »¹ÓÐ %ld ¸öÎļþδ±à¼­"
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: ÃüÁîÒѾ­´æÔÚ, ÇëʹÓà ! Ç¿ÖÆÖØж¨Òå"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Ãû³Æ ²ÎÊý ·¶Î§ ÍêÕû ¶¨Òå "
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "ÕÒ²»µ½Óû§×Ô¶¨ÒåµÄÃüÁî"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: ûÓÐÖ¸¶¨µÄÊôÐÔ"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ²»ÕýÈ·µÄ²ÎÊý¸öÊý"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ²»ÄÜÖ¸¶¨Á½´Î"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: ¼ÆÊýµÄȱʡֵ²»ÕýÈ·"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: Ö¸ÁîÐèÒª²ÎÊý²ÅÄÜÍê³É"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ²»ÍêÕûµÄÖµ: '%s'"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ²»ÕýÈ·µÄÊôÐÔ: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: ÃüÁîÃû³Æ²»ÕýÈ·"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Óû§×Ô¶¨ÒåÃüÁî±ØÐëÒÔ´óд×Öĸ¿ªÊ¼"
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ûÓÐÓû§×Ô¶¨ÒåµÄÃüÁ %s"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: ÕÒ²»µ½ÑÕÉ«Ñùʽ %s"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "ÄãºÃ, Vim Óû§£¡"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "ÔÚд°¿Ú±à¼­Îļþ"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "ÎÞ½»»»Îļþ"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "¸½¼ÓÎļþ"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: Ç°Ò»¸öĿ¼²»´æÔÚ"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: ²»ÄÜʶ±ðµÄ±ê¼Ç"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "´°¿ÚλÖÃ: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: ÔÚÄúµÄƽ̨Éϲ»ÄÜ»ñµÃ´°¿ÚλÖÃ"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "±£´æÖض¨Ïò"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "±£´æÊÓͼ"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "±£´æ»á»°"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "±£´æÉ趨"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" ÒÑ´æÔÚ (ÇëÓÃ ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: ²»ÄÜÒÔдÈëģʽ´ò¿ª \"%s\""
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: ²ÎÊý±ØÐëÊÇÓ¢ÎÄ×Öĸ»òÏòÇ°/ºóµÄÒýºÅ"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal µÝ¹é²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr ":if ²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr ":endif ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr ":else ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr ":elseif ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr ":while ²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr ":continue ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr ":break ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr ":endwhile ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction ±ØÐëÔÚº¯ÊýÄÚ²¿Ê¹ÓÃ"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: ûÓÐ '#' ¿ÉÌæ´úµÄÎļþÃû"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "ûÓÐ Autocommand ÎļþÃûÒÔÌæ»» \"<afile>\""
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "ûÓÐ Autocommand »º³åÇøÃû³ÆÒÔÌæ»» \"<abuf>\""
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr "ûÓÐ Autocommand Match name ÒÔÌæ»» \"<amatch>\""
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "ûÓÐ :source ÎļþÃûÒÔÌæ»» \"<sfile>\""
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "'%' »ò '#' Ö¸Ïò¿ÕÎļþÃû£¬Ö»ÄÜÓÃì¶ \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "ÊäÈëΪ¿Õ×Ö·û´®"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: ²»ÄܶÁÈ¡ viminfo"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: ±¾°æ±¾ÎÞ¸´ºÏ×Ö·û(digraph)"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "±êÇ©Ãû³Æ"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr "ÀàÎļþ\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "Ñ¡Ïî 'history' ÊÇÁã"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s ÀúÊ·¼Ç¼ (´Óе½¾É):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "ÃüÁîÐÐ"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "²éÕÒ×Ö·û´®"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "±í´ïʽ"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "ÊäÈëÐÐ"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ³¬¹ýÃüÁ¶È"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: ÒÑɾ³ý»î¶¯´°¿Ú»ò»º´æ"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "²»ÕýÈ·µÄÎļþÃû"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "ÊÇĿ¼"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "²»ÊÇÎļþ"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[δÃüÃû]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[ȨÏÞ²»×ã]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Autocommand ʹ³ÌÐò²»ÄܶÁÈ¡´ËÎļþ"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *Filter* Autocommand ²»¿ÉÒÔ¸ü¸Ä»º³åÇøµÄÄÚÈÝ"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: ´Ó±ê×¼ÊäÈë¶ÁÈ¡...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "´Ó±ê×¼ÊäÈë¶Á..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ת»»´íÎó"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[Ö»¶Á]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[ȱÉÙCR]'"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[ÕÒµ½NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[·Ö¸î¹ý³¤ÐÐ]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[δת»»]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[ÒÑת»»]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[ÒѼÓÃÜ]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "ת»»´íÎó"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[¶Á´íÎó]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "ÕÒ²»µ½×ª»»ÓõÄÁÙʱÎļþ"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "×Ö·û¼¯×ª»»´íÎó"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "²»ÄܶÁÈ¡ 'charconvert' µÄÊä³ö"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autocommand ɾ³ý»òÊÍ·ÅÁËҪдÈëµÄ»º³åÇø"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand ÒâÍâµØ¸Ä±äÁËÐкÅ"
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "²»ÊÇÎļþ»ò¿ÉдµÄÉ豸"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "ÊÇÖ»¶ÁÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "²»ÄÜд±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "¹Ø±Õ±¸·ÝÎļþ³ö´í (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "²»ÄܶÁÈ¡ÎļþÒÔ¹©±¸·Ý (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "²»ÄÜ´´½¨±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "²»ÄÜ×÷±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "Resource fork »áÏûʧ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: ÕÒ²»µ½Ð´ÈëÓõĽ»»»Îļþ"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: ²»ÄÜת»» (ÇëʹÓà ! Ç¿ÖƲ»×ª»»Ð´Èë)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ²»ÄÜÒÔдÈëģʽ´ò¿ªÁ´½ÓÎļþ"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: ²»ÄÜÒÔдÈëģʽ´ò¿ª"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "¹Ø±Õʧ°Ü"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "²»ÄÜдÈë -- ת»»Ê§°Ü"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "дÈë´íÎó (ÎļþϵͳÒÑÂú£¿)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr "ת»»´íÎó"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[É豸]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[ÐÂ]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr "[a]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " ÒѸ½¼Ó"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr "[w]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " ÒÑдÈë"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patch ģʽ: ²»ÄÜ´¢´æԭʼÎļþ"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Patch ģʽ: ²»Äܸıä¿ÕµÄԭʼÎļþ"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: ²»ÄÜɾ³ý±¸·ÝÎļþ"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"¾¯¸æ: ԭʼÎļþ¶ªÊ§»òËð»µ\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ÔÚÎļþÕýȷдÈëÇ°ÇëÎðÍ˳ö±à¼­Æ÷!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos ¸ñʽ]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac ¸ñʽ]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix ¸ñʽ]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 ÐÐ, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ÐÐ, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "Ò»¸ö×Ö·û"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld¸ö×Ö·û"
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[×îºóÒ»Ðв»ÍêÕû]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "¾¯¸æ: ±¾Îļþ×ÔÉϴζÁÈëºóÒѱ䶯!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "È·¶¨ÒªÐ´ÈëÂð"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: дÈëÎļþ \"%s\" ´íÎó"
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: ¹Ø±ÕÎļþ \"%s\" ´íÎó"
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: ¶ÁÈ¡Îļþ \"%s\" ´íÎó"
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand ɾ³ý»º³åÇø"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: ¾¯¸æ: Îļþ \"%s\" ÒѾ­²»´æÔÚ"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѱ䶯, ¶øÇұ༭ÖеĻº³åÇøÒ²¸ü¶¯ÁË"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѸıä"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѸıä"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: ¾¯¸æ: Îļþ \"%s\" ÔÚ¿ªÊ¼±à¼­ºóÓÖ±»´´½¨ÁË"
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "¾¯¸æ"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"È·¶¨(&O)\n"
+"¼ÓÔØÎļþ(&L)"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: ²»ÄÜÖØмÓÔØ \"%s\""
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--ÒÑɾ³ý--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: ×é²»´æÔÚ: \"%s\""
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * ºóÃæÓв»ÕýÈ·µÄ×Ö·û: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ÎÞ´Ëʼþ: %s"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: ²»ÄܶÔËùÓÐʼþÖ´ÐÐ autocommand"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "ÕÒ²»µ½¶ÔÓ¦µÄ autocommand"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand ²ãÊý¹ýÉî"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands: \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "Ö´ÐÐ %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: ȱÉÙ {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: ȱÉÙ }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "ÕÒ²»µ½ÈκΠfold"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' Ï´´½¨ fold"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' ÏÂɾ³ý fold"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: Ñ¡Ïî 'commentstring' δÉ趨"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: ¼ÓÈë¶Á»º³åÖÐ"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: µÝ¹é mapping"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s ÒѾ­ÓÐÈ«¾Ö abbreviation ÁË"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s ÒѾ­ÓÐÈ«¾Ö mapping ÁË"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ÒѾ­ÓÐ abbreviation ÁË"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s µÄ mapping ÒѾ­´æÔÚ"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "ÕÒ²»µ½Ëõд"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "ûÓÐÕâ¸ö¶ÔÓ¦"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ²»ÕýÈ·µÄģʽ"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<²»ÄÜ´ò¿ª>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: ²»ÄÜʹÓà %s ×ÖÌå"
+
+#: gui_at_fs.c:2535
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: ²»Äܻص½Ä¿Ç°Ä¿Â¼"
+
+#: gui_at_fs.c:2554
+msgid "Pathname:"
+msgstr "·¾¶:"
+
+#: gui_at_fs.c:2560
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: ²»ÄÜÈ¡µÃĿǰĿ¼"
+
+#: gui_at_fs.c:2568 gui_motif.c:1607
+msgid "OK"
+msgstr "È·¶¨"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2568 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "È¡Ïû"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim ¶Ô»°¿ò"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "¹ö¶¯Ìõ: ²»ÄÜÉ趨 thumb pixmap µÄλÖÃ"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ²»ÄܶÔÐÅÏ¢Óë callback ´´½¨ BallonEval"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: ²»ÄÜÆô¶¯Í¼ÐͽçÃæ"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: ²»ÄܶÁÈ¡Îļþ \"%s\""
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ²»ÕýÈ·µÄ 'guifontwide'"
+
+#: gui.c:3919
+msgid "Error"
+msgstr "´íÎó"
+
+#: gui.c:3920
+msgid "&Ok"
+msgstr "È·¶¨(&O)"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim ¶Ô»°¿ò..."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ²éÕÒÓëÌæ»»..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - ²éÕÒ..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "²éÕÒ:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "Ì滻Ϊ:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "ֻƥÅäÍêÈ«ÏàͬµÄ×Ö"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "·½Ïò"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "ÏòÉÏ"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "ÏòÏÂ"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "ÕÒÏÂÒ»¸ö"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "Ìæ»»"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "Ì滻ȫ²¿"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1194
+msgid "E233: cannot open display"
+msgstr "E233: <²»ÄÜ´ò¿ª X Server DISPLAY>"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:1997
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ²»ÕýÈ·µÄ×Ö·û¼¯ (Fontset): %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "×ÖÌåÑ¡Ôñ"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1833
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "²»ÕýÈ·µÄ×ÖÌåÃû³Æ: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1857
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: \"%s\" ²»Êǹ̶¨¿í¶È×ÖÌå"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: %s Ϊ²»ÄÜʶ±ðµÄÑÕÉ«Ãû³Æ"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "ʹÓà CUT_BUFFER0 À´Ìæ»»¿ÕÑ¡Ôñ"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "¹ýÂËÆ÷"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "Ŀ¼"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "°ïÖú"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "Îļþ"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "Ñ¡Ôñ"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "³·Ïû"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: ²»ÄÜ´ò¿ª Zap ×ÖÌå '%s'"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: ²»ÄÜʹÓÃ×ÖÌå %s"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: ÕÒ²»µ½ÑÕÉ«: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ÕýÔÚ·¢ËÍÖжÏ×Ó³ÌÐòµÄÐÅÏ¢.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ²»Ö§³Ö²ÎÊý \"-%s\"¡£ÇëÓà OLE °æ±¾¡£"
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "²éÕÒ×Ö·û´® (ʹÓà '\\\\' À´±íʾ '\\')"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "²éÕÒ¼°Ìæ»»×Ö·û´® (ʹÓà '\\\\' À´±íʾ '\\')"
+
+#: gui_x11.c:1414
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: ²»ÄÜÅäÖà color map ¶ÔÏó£¬ÓÐЩÑÕÉ«¿´ÆðÀ´»á¹Ö¹ÖµÄ"
+
+#: gui_x11.c:1987
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Fontset %s ûÓÐÉ趨ÕýÈ·µÄ×ÖÌåÒÔ¹©ÏÔʾÕâЩ×Ö·û¼¯:"
+
+#: gui_x11.c:2030
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ×ÖÌ弯(Fontset)Ãû³Æ: %s"
+
+#: gui_x11.c:2031
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "'%s' ²»Êǹ̶¨¿í¶È×ÖÌå"
+
+#: gui_x11.c:2050
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ×ÖÌ弯(Fontset)Ãû³Æ: %s\n"
+
+#: gui_x11.c:2051
+#, c-format
+msgid "Font0: %s\n"
+msgstr "×ÖÌå0: %s\n"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "Font1: %s\n"
+msgstr "×ÖÌå1: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "×ÖÌå%d¿í¶È²»ÊÇ×ÖÌå0µÄÁ½±¶\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "×ÖÌå0µÄ¿í¶È£º%ld\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"×ÖÌå1¿í¶È: %ld\n"
+"\n"
+
+#: gui_x11.c:2201
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: ²»ÄÜÅäÖÃÑÕÉ« %s"
+
+#: gui_x11.c:3250
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: ²»ÄܶÁÈ¡ sign data!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata ´íÎó"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr ""
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "ÐÂÔöÊý¾Ý¿â"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "²éѯģʽ"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "ÏÔʾ´ËÐÅÏ¢"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "½áÊøÁ¬½Ó"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "ÖØÉèËùÓÐÁ¬½Ó"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "ÏÔʾÁ¬½Ó"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Õâ¸ö cscope ÃüÁî²»Ö§³Ö·Ö¸îÆÁÄ»\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Ó÷¨: cstag <ʶ±ð×Ö>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ÕÒ²»µ½ tag"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) ´íÎó: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "ÐÂÔö cscope Êý¾Ý¿â %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s ²»ÊÇĿ¼»ò cscope Êý¾Ý¿â"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "¶ÁÈ¡ cscope Á¬½Ó %d ʱ´íÎó"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "δ֪µÄ cscope ²éÕÒÐÎ̬"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "²»ÄÜ´´½¨Óë cscope Á¬½ÓµÄ¹ÜµÀ"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection Ö´ÐÐʧ°Ü"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen ʧ°Ü (to_fp)"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen ʧ°Ü (fr_fp)"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "ûÓÐ cscope Á¬½Ó"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: ÕÒ²»µ½·ûºÏ cscope µÄËÑÑ° %s / %s"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "cscope ÃüÁî:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Ó÷¨: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "Öظ´µÄ cscope Êý¾Ý¿âδ±»¼ÓÈë"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "ÒÑ´ïµ½ cscope ×î´óÁ¬½ÓÊýÄ¿"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: ÕÒ²»µ½ cscope Á¬½Ó"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: ÕÒ²»µ½ cscope Á¬½Ó %s"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope Á¬½ÓÒѹرÕ"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope Á¬½Ó %s ÒѹرÕ\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "cs_manage_matches ÑÏÖØ´íÎó"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: ¶ÁÈ¡ cscope Á¬½Ó %d ´íÎó"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "²»ÄÜʹÓà malloc\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope ±êÇ©(tag): %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # ÐÐ "
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "ÎļþÃû / ÉÏÏÂÎÄ / ÐкÅ\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "ÖØÉèËùÓÐ cscope Êý¾Ý¿â"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "ûÓÐ cscope Á¬½Ó\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid Êý¾Ý¿âÃû³Æ prepend path\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <ÎÞ>\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: ±§Ç¸£¬Õâ¸öÃüÁî²»ÄÜʹÓã¬Python ³ÌÐò¿âûÓмÓÔØ¡£"
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "²»ÄÜɾ³ý OutputObject ÊôÐÔ"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "softspace ±ØÐèÊÇÕûÊý"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "²»ÕýÈ·µÄÊôÐÔ"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "writelines() ÐèÒª string list µ±²ÎÊý"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: ²»Äܳõʼ»¯ I/O ¶ÔÏó"
+
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "²»ÕýÈ·µÄ±í´ïʽ"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "ÒòΪ±àÒëʱûÓмÓÈë±í´ïʽ(expression)µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓñí´ïʽ"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "ÊÔͼʹÓÃÒѱ»É¾³ýµÄ»º³åÇø"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "Ðкų¬³ö·¶Î§"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer ¶ÔÏó (ÒÑɾ³ý): %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "±ê¼ÇÃû³Æ²»ÕýÈ·"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "ÎÞ´Ë»º³åÇø"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "ÊÔͼʹÓÃÒѱ»É¾³ýµÄ´°¿Ú"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "Ö»¶ÁÊôÐÔ"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "¹â±ê¶¨Î»ÔÚ»º³åÇøÖ®Íâ"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<´°¿Ú¶ÔÏó(ÒÑɾ³ý): %.8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<´°¿Ú¶ÔÏó(δ֪): %.8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<´°¿Ú %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "ÎÞ´Ë´°¿Ú"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "²»Äܱ£´æ¸´Ô­ÐÅÏ¢"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "²»ÄÜɾ³ý´ËÐÐ"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "²»ÄÜÌæ»»´ËÐÐ"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "²»ÄܲåÈë´ËÐÐ"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "×Ö·û´®²»ÄÜ°üº¬ÐÂÐÐ"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: ´ËÃüÁî²»ÄÜʹÓã¬ÎÞ·¨¼ÓÔØ Ruby ³ÌÐò¿â(Library)"
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: δ֪µÄ longjmp ״̬ %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Çл»ÊµÏÖ/¶¨Òå"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "ÏÔʾ base class of:"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "ÏÔʾ±»¸²¸ÇµÄ³ÉÔ±º¯Êý"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "»Ö¸´: ´ÓÎļþ"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "»Ö¸´: ´Ó¶ÔÏó"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "»Ö¸´: ´ÓËùÓÐÏîÄ¿"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "»Ö¸´"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "ÏÔʾԴ´úÂë: "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "²éÕÒ symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ä¯ÀÀ class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "ÏÔʾ²ã´Î¹ØϵµÄÀà"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "ÏÔʾ restricted ²ã´Î¹ØϵµÄ class"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ²Î¿¼µ½"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ±»Ë­²Î¿¼:"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ÓÐ"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ±»Ë­Ê¹ÓÃ:"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "ÏÔʾÎļþ: "
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "²úÉúÎļþ: "
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "²»ÄÜÁ¬½Óµ½ SNiFF+¡£Çë¼ì²é»·¾³±äÁ¿ ($PATH Àï±ØÐè¿ÉÒÔÕÒµ½ sniffemacs)\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: ¶ÁÈ¡´íÎó. È¡ÏûÁ¬½Ó"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ Ä¿Ç°"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "δ"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "Á¬½ÓÖÐ"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ²»ÕýÈ·µÄ SNiff+ µ÷ÓÃ: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Á¬½Óµ½ SNiFF+ ʧ°Ü"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: δÁ¬½Óµ½ SNiFF+"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: ²»ÊÇ SNiFF+ µÄ»º³åÇø"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: дÈë´íÎó¡£½áÊøÁ¬½Ó"
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "²»ÕýÈ·µÄ»º³åÇøºÅ"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "ÉÐδʵÏÖ"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "²»ÕýÈ·µÄÑ¡Ïî"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "²»ÄÜÉ趨ÐÐ"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "ûÓÐÉ趨±ê¼Ç"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "ÁÐ %d ÐÐ %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "²»ÄܲåÈë»òÌí¼Ó´ËÐÐ"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "´íÎóµÄ±êÖ¾: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "²»ÕýÈ·µÄ VIM Ñ¡Ïî"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "¼üÅÌÖжÏ"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "vim ´íÎó"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "²»ÄÜ´´½¨»º³åÇø/´°¿ÚÃüÁî: ¶ÔÏ󽫱»É¾³ý"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "²»ÄÜ×¢²á callback ÃüÁî: »º³åÇø/´°¿ÚÒѾ­±»É¾³ýÁË"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: TCL ÑÏÖØ´íÎó: reflist ²»¿É¿¿!? Ç뱨¸æ¸ø to vim-dev@vim.org"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "²»ÄÜ×¢²á callback ÃüÁî: ÕÒ²»µ½»º³åÇø/´°¿Ú"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "´ËÃüÁî²»ÄÜʹÓÃ, ÒòΪÎÞ·¨¼ÓÔØ Tcl ³ÌÐò¿â(Library)"
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: TCL ´íÎó: Í˳ö·µ»ØÖµ²»ÊÇÕûÊý!? Ç뱨¸æ¸ø to vim-dev@vim.org"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "²»ÄÜÈ¡µÃ´ËÐÐ"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "²»ÄÜ×¢²áÃüÁî·þÎñÆ÷Ãû³Æ"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ûÓÐ×¢²áΪ \"%s\" µÄ·þÎñÆ÷"
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ²»ÄÜËͳöÃüÁĿµÄµØ³ÌÐò"
+
+#: if_xcmdsrv.c:709
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "²»ÕýÈ·µÄ·þÎñÆ÷ id : %s"
+
+#: if_xcmdsrv.c:1056
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: ²»ÄܶÁÈ¡ VIM µÄ ×¢²á±íÊôÐÔ"
+
+#: if_xcmdsrv.c:1067
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM µÄ×¢²á±íÊôÐÔÓÐÎó¡£ÒÑɾ³ý¡£"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "²»ÕýÈ·µÄÑ¡Ïî"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Ì«¶à±à¼­²ÎÊý"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "ȱÉÙ±ØÒªµÄ²ÎÊý:"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "²»ÄܱæÈÏ´ËÑ¡ÏîºóµÄÃüÁî: "
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Ì«¶à \"+command\" »ò \"-c command\" ²ÎÊý"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "²»ÕýÈ·µÄ²ÎÊý: "
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "ÄúµÄ Vim ±àÒëʱûÓмÓÈë diff µÄÄÜÁ¦"
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "ÊÔͼÔٴδò¿ª script Îļþ: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "²»ÄÜΪ¶Á¶ø´ò¿ª: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "²»ÄÜΪ script Êä³ö¶ø´ò¿ª: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "»¹ÓÐ %d ¸öÎļþµÈ´ý±à¼­\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: ×¢Òâ: Êä³ö²»ÊÇÖÕ¶Ë(ÆÁÄ»)\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: ×¢Òâ: ÊäÈë²»ÊÇÖÕ¶Ë(¼üÅÌ)\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc ÃüÁîÐÐ"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: ²»ÄܶÁÈ¡Îļþ \"%s\""
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"²éѯ¸ü¶àÐÅÏ¢ÇëÖ´ÐÐ: \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[Îļþ ..] ±à¼­Ö¸¶¨µÄÎļþ"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- ´Ó±ê×¼ÊäÈë(stdin)¶ÁÈ¡Îı¾"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag ±à¼­Ê±Ê¹ÓÃÖ¸¶¨µÄ tag"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] ±à¼­Ê±¼ÓÔصÚÒ»¸ö´íÎó"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" Ó÷¨:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr "vim [²ÎÊý] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" »ò:"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"²ÎÊý:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tÖ»ÓÐÔÚÕâÖ®ºóµÄÎļþ"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t×¢²á gvim µ½ OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tÈ¡Ïû OLE ÖÐµÄ gvim ×¢²á"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tʹÓÃͼÐνçÃæ (ͬ \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tÇ°¾°: Æô¶¯Í¼ÐνçÃæʱ²» fork"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi ģʽ (ͬ \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx ģʽ (ͬ \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\t°²¾² (batch) ģʽ (Ö»ÄÜÓë \"ex\" Ò»ÆðʹÓÃ)"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff ģʽ (ͬ \"vimdiff\", ¿ÉѸËٱȽÏÁ½Îļþ²»Í¬´¦)"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\t¼òÒ×ģʽ (ͬ \"evim\", modeless)"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tÖ»¶Áģʽ (ͬ \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tÏÞÖÆģʽ (ͬ \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\t²»¿ÉÐÞ¸Ä (дÈëÎļþ)"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tÎı¾²»¿ÉÐÞ¸Ä"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t¶þ½øÖÆģʽ"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp ģʽ"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\t'compatible' ´«Í³ Vi ¼æÈÝģʽ"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\t'nocompatible' ²»ÍêÈ«Ó봫ͳ Vi ¼æÈÝ£¬¿ÉʹÓà Vim ¼ÓÇ¿ÄÜÁ¦"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose µÈ¼¶"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tµ÷ÊÔģʽ"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\t²»Ê¹Óý»»»Îļþ, ֻʹÓÃÄÚ´æ"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tÁгö½»»»ÎļþºóÍ˳ö"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (¼ÓÎļþÃû) \t»Ö¸´ÉϴαÀÀ£µÄ×ÊÁÏ(Recover crashed session)"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tÓë -r Ò»Ñù"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\t²»Ê¹Óà newcli À´´ò¿ª´°¿Ú"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tʹÓà <device> ×öÊäÈëÊä³öÉ豸"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tÆô¶¯Îª Ï£²®À³Ä£Ê½"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tÆô¶¯Îª Farsi ģʽ"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tÉ趨ÖÕ¶ËΪ <terminal>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tʹÓà <vimrc> Ìæ»»ÈκΠ.vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tʹÓà <gvimrc> Ìæ»»ÈκΠ.gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\t²»¼ÓÔØÈκΠplugin"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\t´ò¿ª N ¸ö´°¿Ú (Ô¤ÉèÊÇÿ¸öÎļþÒ»¸ö)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tͬ -o µ«Ê¹Óô¹Ö±·Ö¸î"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tÆô¶¯ºóÌøµ½Îļþ½áβ"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tÆô¶¯ºóÌøµ½µÚ <lnum> ÐÐ"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\t¼ÓÔØÈκΠvimrc Ç°Ö´ÐÐ <command>"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\t¼ÓÔصÚÒ»¸öÎļþºóÖ´ÐÐ <command>"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\t¼ÓÔصÚÒ»¸öÎļþºóÔØÈë Session Îļþ<session>"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t´Ó <scriptin> ¶ÁÈëÒ»°ãģʽÃüÁî"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t¶ÔÎļþ <scriptout> ¸½¼Ó(append)ËùÓÐÊäÈëµÄÃüÁî"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t¶ÔÎļþ <scriptout> дÈëËùÓÐÊäÈëµÄÃüÁî"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t±à¼­±àÂë¹ýµÄÎļþ"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\t½« vim ÓëÖ¸¶¨µÄ X-server Á¬½Ó"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\t²»ÒªÁ¬½Óµ½ X Server"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÔÚÁíÒ»¸ö GTK ×é¼þÄÚ´ò¿ª Vim"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <files>\t±à¼­ Vim ·þÎñÆ÷ÉϵÄÎļþ²¢Í˳ö"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> µÈЧÓÚ --remote, µ«»áµÈºòÎļþÍê³É±à¼­"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tËͳö <keys> µ½ Vim ·þÎñÆ÷²¢Í˳ö"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tÔÚ·þÎñÆ÷ÉÏÇó±í´ïʽµÄÖµ²¢´òÓ¡½á¹û"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tÁгö¿ÉÓÃµÄ Vim ·þÎñÆ÷Ãû³Æ²¢Í˳ö"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\tËÍÖÁ/³ÉΪ Vim ·þÎñÆ÷ <name>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tʹÓà <viminfo> ¶ø·Ç .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\t´òӡ˵Ã÷(Ò²¾ÍÊDZ¾ÐÅÏ¢)ºóÍ˳ö"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\t´òÓ¡°æ±¾ÐÅÏ¢ºóÍ˳ö"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (Motif °æ):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (Athena °æ):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tÔÚ´°¿Ú <display> Ö´ÐÐ vim"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tÆô¶¯ºó×îС»¯(iconified)"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\t¶ÁÈ¡ Resource ʱ°Ñ vim µÄÃû³ÆÊÓΪ <name>"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (ÉÐδʵÏÖ)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\tÉ趨 <color> Ϊ±³¾°É« (Ò²¿ÉÓà -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tÉ趨 <color> Ϊһ°ãÎÄ×ÖÑÕÉ« (Ò²¿ÉÓà -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\tʹÓà <font> Ϊһ°ã×ÖÌå (Ò²¿ÉÓà -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tʹÓà <font> Ϊ´ÖÌå×ÖÌå"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tʹÓà <font> ΪбÌå×ÖÌå"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tʹÓÃ<geom>Ϊ³õʼλÖà (Ò²¿ÉÓà -geom)"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\tʹÓÿí¶ÈΪ <width> µÄ±ß¿ò (Ò²¿ÉÓà -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> É趨¹ö¶¯Ìõ¿í¶ÈΪ <width> (Ò²¿ÉÓà -sw)"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tÉ趨²Ëµ¥Áеĸ߶ÈΪ <height> (Ò²¿ÉÓà -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tʹÓ÷´ÏÔ (Ò²¿ÉÓà -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\t²»Ê¹Ó÷´ÏÔ (Ò²¿ÉÓà +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tÉ趨ָ¶¨µÄ×ÊÔ´"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (RISC OS °æ):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t´°¿Ú³õʼ¿í¶È"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t´°¿Ú³õʼ¸ß¶È"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (GTK+ °æ):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tÔÚ <display> Ö´ÐÐ vim (Ò²¿ÉÓà --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tÏÔʾ Gnome Ïà¹Ø²ÎÊý"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"·¢Ëͱí´ïʽʧ°Ü¡£\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Ëͳöʧ°Ü¡£ÊÔͼÔÚ±¾µØÖ´ÐÐ\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d ÖÐ %d Òѱ༭"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "·¢Ëͱí´ïʽʧ°Ü¡£\n"
+
+#: mark.c:655
+msgid "No marks set"
+msgstr "ûÓÐÉ趨±ê¼Ç (mark)"
+
+#: mark.c:657
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: ÕÒ²»µ½·ûºÏ \"%s\" µÄ±ê¼Ç(mark)"
+
+#. Highlight title
+#: mark.c:668
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"±ê¼Ç ÐкŠÁÐ Îļþ/Îı¾"
+
+#. Highlight title
+#: mark.c:706
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" Ìøµ½ ÐкŠÁÐ Îļþ/Îı¾"
+
+#: mark.c:1068
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Îļþ±ê¼Ç:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1103
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (´Óе½¾É):\n"
+
+#: mark.c:1198
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ÎļþÄÚÀúÊ·¼Ç¼ (´Óе½¾É):\n"
+
+#: mark.c:1281
+msgid "Missing '>'"
+msgstr "ȱÉÙ¶ÔÓ¦µÄ '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "²»ÕýÈ·µÄ´úÂëÒ³"
+
+#: mbyte.c:3005
+msgid "E284: Cannot set IC values"
+msgstr "E284: ²»ÄÜÉ趨 IC ÊýÖµ"
+
+#: mbyte.c:3157
+msgid "E285: Failed to create input context"
+msgstr "E285: ²»ÄÜ´´½¨ÊäÈëÉÏÏÂÎÄ"
+
+#: mbyte.c:3304
+msgid "E286: Failed to open input method"
+msgstr "E286: ²»ÄÜ´ò¿ªÊäÈë·¨"
+
+#: mbyte.c:3315
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: ¾¯¸æ: ²»ÄÜÒƳý IM µÄ callback"
+
+#: mbyte.c:3321
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ÊäÈë·¨²»Ö§³ÖÈκΠstyle"
+
+#: mbyte.c:3378
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ÊäÈë·¨²»Ö§³ÖÈκΠstyle"
+
+#: mbyte.c:3452
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot ÐèÒª×ÖÌ弯(Fontset)"
+
+#: mbyte.c:3480
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: ÄãµÄ GTK+ ±È 1.2.3 ÀÏ¡£²»ÄÜʹÓÃ״̬Çø¡£"
+
+#: mbyte.c:3717
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ÊäÈë·¨¹ÜÀí³ÌÐò(Input Method Server)δÔËÐÐ"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: ¿éδ±»Ëø¶¨"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ½»»»Îļþ¶ÁÈ¡´íÎó"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: ½»»»Îļþ¶ÁÈ¡´íÎó"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ½»»»ÎļþдÈë´íÎó"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: ½»»»ÎļþдÈë´íÎó"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ½»»»ÎļþÒѾ­´æÔÚ! (СÐÄ·ûºÅÁ¬½áµÄ°²È«Â©¶´!?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ÕÒ²»µ½¿é 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ÕÒ²»µ½¿é 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ÕÒ²»µ½¿é 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: àÞàÞ, ½»»»Îļþ²»¼ûÁË!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: ²»Äܸı佻»»ÎļþµÄÃû³Æ"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: ²»ÄÜ´ò¿ª½»»»Îļþ \"%s\", ²»¿ÉÄָܻ´ÁË"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: ÕÒ²»µ½¿é 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: ÕÒ²»µ½ %s µÄ½»»»Îļþ"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "ÇëÑ¡ÔñÄãҪʹÓõĽ»»»Îļþ (°´0 Í˳ö): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: ²»ÄÜ´ò¿ª %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "²»ÄܶÁÈ¡¿é 0:"
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"¿ÉÄÜÄãû×ö¹ýÈκÎÐ޸ĻòÊÇ Vim »¹À´²»¼°¸üн»»»Îļþ."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ²»ÄÜÔÚ±¾°æ±¾µÄ Vim ÖÐʹÓÃ.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "ʹÓà Vim 3.0¡£\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ¿´ÆðÀ´²»ÏñÊÇ Vim ½»»»Îļþ"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ²»ÄÜÔÚÕą̂µçÄÔÉÏʹÓÃ.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "±¾Îļþ´´½¨ÓÚ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"»òÊÇÕâÎļþÒѱ»ÆÆ»µ¡£"
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "ʹÓý»»»Îļþ \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Ô­Îļþ \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: ¾¯¸æ: ԭʼÎļþ¿ÉÄÜÒѾ­Ð޸ĹýÁË"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: ²»ÄÜ´Ó %s ¶ÁÈ¡¿é 1"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???ȱÉÙÌ«¶àÐÐ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???ÐкŴíÎó"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???¿ÕµÄ ¿é"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???ÕÒ²»µ½Ò»Ð©ÐÐ"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ¿é 1 ID ´íÎó (%s ²»Êǽ»»»Îļþ?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???ÕÒ²»µ½¿é"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ´ÓÕâÀïµ½ ???END µÄÄÚÈÝ¿ÉÄÜÓÐÎÊÌâ"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ´ÓÕâÀïµ½ ???END µÄÄÚÈÝ¿ÉÄܱ»É¾³ý/²åÈë¹ý"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: »Ö¸´ÒÑÖжÏ"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: »Ö¸´Ê±·¢Éú´íÎó; Çë×¢Ò⿪ͷΪ ??? µÄÐÐ"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "»Ö¸´Íê³É. ÇëÈ·¶¨Ò»ÇÐÕý³£."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Äã¿ÉÄÜÏëÒª°ÑÕâ¸öÎļþÁí´æΪ±ðµÄÎļþÃû£¬\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "ÔÙÖ´ÐÐ diff ÓëÔ­Îļþ±È½ÏÒÔ¼ì²éÊÇ·ñÓиıä)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"(D)Ö±½Óɾ³ý .swp ½»»»Îļþ\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "ÕÒµ½ÒÔϵĽ»»»Îļþ:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " ÔÚĿǰĿ¼:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Using specified name:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " ÔÚĿ¼ "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- ÎÞ --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " ËùÓÐÕß: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " ÈÕÆÚ: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " ÈÕÆÚ: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [´Ó Vim °æ±¾ 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [²»Ïñ Vim µÄ½»»»Îļþ]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " ÎļþÃû: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" Ð޸Ĺý: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ÊÇ"
+
+#: memline.c:1524
+msgid "no"
+msgstr "·ñ"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ̞: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " Ö÷»úÃû: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" Ö÷»úÃû: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ½ø³Ì ID: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (ÕýÔÚÖ´ÐÐ)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [²»ÄÜÔÚ±¾°æ±¾µÄ Vim ÉÏʹÓÃ]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [²»ÄÜÔÚ±¾»úÉÏʹÓÃ]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [²»ÄܶÁÈ¡]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [²»ÄÜ´ò¿ª]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: ²»Äܱ£Áô, ²»Ê¹Óý»»»Îļþ"
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "ÎļþÒѱ£Áô"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: ±£Áôʧ°Ü"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ´íÎóµÄ lnum: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ÕÒ²»µ½µÚ %ld ÐÐ"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: Ö¸Õë¿é id ´íÎó 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx Ó¦¸ÃÊÇ 0"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ¸üÐÂÌ«¶à¿é?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: Ö¸Õë¿é id ´íÎó 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "ɾ³ý¿é 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: ÕÒ²»µ½µÚ %ld ÐÐ"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: Ö¸Õë¿é id ´íÎó"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ΪÁã"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: Ðкų¬³ö·¶Î§: %ld ³¬¹ý½áβ"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ¿é %ld ÐÐÊý´íÎó"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "¶ÑÕ»´óСÔö¼Ó"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: Ö¸Õë¿é id ´í 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: ×¢Òâ"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"·¢ÏÖ½»»»Îļþ \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "µ±´ò¿ªÎļþʱ \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " ±È½»»»ÎļþÐÂ!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ¿ÉÄÜÓÐÁíÒ»¸ö³ÌÐòÒ²Ôڱ༭ͬһ¸öÎļþ.\n"
+" Èç¹ûÊÇÕâÑù£¬Çë×¢Òâ²»ÒªÒ»ÆðдÈ룬²»È»ÄãµÄŬÁ¦¶¼»á¸¶ÖÁ÷¡£\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Í˳ö£¬»òÊǼÌÐø±à¼­¡£\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ÉÏÒ»´Î±à¼­´ËÎļþʱ±ÀÀ£\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Èç¹ûÊÇÕâÑù, ÇëÓà \":recover\" »ò \"vim -r"
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" »Ö¸´ÐÞ¸ÄÄÚÈÝ (½øÒ»²½ËµÃ÷Çë¿´ \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Èç¹û¸Ã»Ö¸´µÄ¶¼ÒѾ­»Ö¸´ÁË, ÇëÖ±½Óɾ³ý´Ë½»»»Îļþ \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ÒÔ±ÜÃâÔÙ¿´µ½´ËÐÅÏ¢.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "½»»»Îļþ \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" ÒѾ­´æÔÚÁË!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - ×¢Òâ"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "½»»»ÎļþÒѾ­´æÔÚ!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"ÒÔÖ»¶Á·½Ê½´ò¿ª(&O)\n"
+"Ö±½Ó±à¼­(&E)\n"
+"»Ö¸´(&R)\n"
+"Í˳ö(&Q)"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"ÒÔÖ»¶Á·½Ê½´ò¿ª(&O)\n"
+"Ö±½Ó±à¼­(&E)\n"
+"»Ö¸´(&R)\n"
+"Í˳ö(&Q)\n"
+"ɾ³ý½»»»Îļþ(&D)"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: ÕÒµ½Ì«¶à½»»»Îļþ"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ²¿·Ý²Ëµ¥Ïî²»ÊÇ×Ӳ˵¥"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: ²Ëµ¥Ö»ÄÜÔÚÆäËüģʽÖÐʹÓÃ"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ûÓÐÄÇÑùµÄ²Ëµ¥"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ²Ëµ¥²»ÄÜÖ¸Ïò×ÓÑ¡µ¥"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ²»ÄÜÖ±½Ó°Ñ²Ëµ¥Ïî¼Óµ½²Ëµ¥ÌõÖÐ"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ·Ö¸ôÏß²»ÄÜÊDz˵¥µÄÒ»²¿·Ö"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- ²Ëµ¥ ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "ÇÐÏ´˲˵¥"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ²Ëµ¥±ØÐèÖ¸ÏòÒ»¸ö²Ëµ¥Ïî"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: [²Ëµ¥] ÕÒ²»µ½ %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s ģʽ䶨Òå²Ëµ¥"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ²Ëµ¥±ØÐèÖ¸Ïò×Ӳ˵¥"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: ÕÒ²»µ½²Ëµ¥ - Çë¼ì²é²Ëµ¥Ãû³Æ"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "´¦Àí %s ʱ·¢Éú´íÎó:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "ÐÐ %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[×Ö·û´®Ì«³¤]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "¼òÌåÖÐÎÄÐÅϢά»¤Õß: Wang Jun <junw@turbolinux.com.cn>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "ÒÑÖжÏ: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "Çë°´ ENTER ¼ÌÐø"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "Çë°´ ENTER »òÆäËüÃüÁî¼ÌÐø"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- ¸ü¶à --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ÏòÏÂ/ÏòÉÏÒ»ÐÐ, ¿Õ¸ñ/b: Ò»Ò³, d/u: °ëÒ³, q: Í˳ö)"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ÏòÏÂÒ»ÐÐ, ¿Õ°×¼ü: Ò»Ò³, d: °ëÒ³, q: Í˳ö)"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "ÎÊÌâ"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ\n"
+"&CÈ¡Ïû"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ\n"
+"&AÈ«²¿±£´æ\n"
+"&DÈ«²¿²»´æ\n"
+"&CÈ¡Ïû"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "±£´æÎļþ¶Ô»°¿ò"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "´ò¿ªÎļþ¶Ô»°¿ò"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Ö÷¿Ø̨(Console)ģʽʱûÓÐÎļþä¯ÀÀÆ÷(file browser)"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: ×¢Òâ: ÄãÕýÔÚÐÞ¸ÄÒ»¸öÖ»¶ÁÎļþ"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "»¹ÓÐÒ»ÐÐ"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "ÉÙÓÚÒ»ÐÐ"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr " »¹ÓÐ %ld ÐÐ"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "ֻʣ %ld ÐÐ"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr " (ÒÑÖжÏ)"
+
+#: misc1.c:6244
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ±£ÁôÎļþÖÐ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6254
+msgid "Vim: Finished.\n"
+msgstr "Vim: ½áÊø.\n"
+
+#: misc2.c:644 misc2.c:660
+msgid "ERROR: "
+msgstr "´íÎó: "
+
+#: misc2.c:664
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] È«²¿ alloc-freed %lu-%lu, ʹÓÃÖÐ %lu, peak ʹÓà %lu\n"
+
+#: misc2.c:666
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[µ÷ÓÃ] È«²¿ re/malloc(): %lu, È«²¿ free()': %lu\n"
+"\n"
+
+#: misc2.c:721
+msgid "E340: Line is becoming too long"
+msgstr "E340: ´ËÐйý³¤"
+
+#: misc2.c:765
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ÄÚ²¿´íÎó: lalloc(%ld, )"
+
+#: misc2.c:873
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ÄÚ´æ²»×ã! (³¢ÊÔÅäÖà %lu ×Ö½Ú×é)"
+
+#: misc2.c:2508
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "µ÷ÓÃ shell Ö´ÐÐ: \"%s\""
+
+#: misc2.c:2703 misc2.c:5142 option.c:4584
+msgid "Missing colon"
+msgstr "ȱÉÙðºÅ"
+
+#: misc2.c:2705 misc2.c:2732
+msgid "Illegal mode"
+msgstr "²»ÕýÈ·µÄģʽ"
+
+#: misc2.c:2771
+msgid "Illegal mouseshape"
+msgstr "²»ÕýÈ·µÄÊó±êÐÎ×´"
+
+#: misc2.c:2811 misc2.c:5162
+msgid "digit expected"
+msgstr "Ó¦¸ÃΪÊý×Ö"
+
+#: misc2.c:2816
+msgid "Illegal percentage"
+msgstr "²»ÕýÈ·µÄ°Ù·Ö±È"
+
+#: misc2.c:3120
+msgid "Enter encryption key: "
+msgstr "ÊäÈëÃÜÂë: "
+
+#: misc2.c:3121
+msgid "Enter same key again: "
+msgstr "ÇëÔÙÊäÈëÒ»´Î: "
+
+#: misc2.c:3131
+msgid "Keys don't match!"
+msgstr "Á½´ÎÊäÈëÃÜÂ벻ͬ!"
+
+#: misc2.c:3645
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: ²»ÕýÈ·µÄ·¾¶: '**[number]' ±ØÐèÒªÔÚ·¾¶½áβ»òÒª½ÓÖø '%s'"
+
+#: misc2.c:4899
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath ÖÐûÓÐĿ¼ \"%s\""
+
+#: misc2.c:4902
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: ÔÚ·¾¶ÖÐÕÒ²»µ½Îļþ \"%s\""
+
+#: misc2.c:4908
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ÔÚ·¾¶ÖÐÕÒ²»µ½¸ü¶àµÄÎļþ \"%s\""
+
+#: misc2.c:4911
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ÔÚ·¾¶ÖÐÕÒ²»µ½¸ü¶àµÄÎļþ \"%s\""
+
+#: misc2.c:5154
+msgid "Illegal component"
+msgstr "²»ÕýÈ·µÄ×é¼þ"
+
+#: normal.c:2798
+msgid "Warning: terminal cannot highlight"
+msgstr "×¢Òâ: ÄãµÄÖն˲»ÄÜÏÔʾ¸ßÁÁ¶È"
+
+#: normal.c:2993
+msgid "E348: No string under cursor"
+msgstr "E348: ¹â±ê´¦Ã»ÓÐ×Ö·û´®"
+
+#: normal.c:2995
+msgid "E349: No identifier under cursor"
+msgstr "E349: ¹â±ê´¦Ã»ÓÐʶ±ð×Ö"
+
+#: normal.c:4160
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' ÏÂɾ³ý fold"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "Ò»ÐÐ %s ¹ý Ò»´Î"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "Ò»ÐÐ %s ¹ý %d ´Î"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld ÐÐ %s ¹ý Ò»´Î"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld ÐÐ %s ¹ý %d ´Î"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "ʶ±ð %ld ÐÐ..."
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "Ò»ÐÐÒÑʶ±ð"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "ÒÑʶ±ð %ld ÐÐ"
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "²»Äܸ´ÖÆ; Ö±½Óɾ³ý"
+
+#: ops.c:2018
+msgid "1 line changed"
+msgstr " 1 ÐÐ ~ed"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines changed"
+msgstr " %ld ÐÐ ~ed"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "ÊÍ·Å %ld ÐÐÖÐ"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "ÒѸ´ÖÆ 1 ÐÐ"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "ÒѸ´ÖÆ %ld ÐÐ"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ¼Ä´æÆ÷ %s ÀïûÓж«Î÷"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ¼Ä´æÆ÷ ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "²»ÕýÈ·µÄ¼Ä´æÆ÷Ãû³Æ"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ¼Ä´æÆ÷:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "δ֪µÄ×¢²áÀàÐÍ: %d"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: ¼Ä´æÆ÷Ãû³Æ´íÎó: '%s'"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld ÁÐ; "
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Ñ¡ÔñÁË %s%ld/%ld ÐÐ; %ld/%ld ×Ö(Word); %ld/%ld ×Ö·û(Bytes)"
+
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "ÁÐ %s/%s; ÐÐ %ld/%ld; ×Ö(Word) %ld/%ld; ×Ö·û(Byte) %ld/%ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "¸ÐлÄúÑ¡Ôñ Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "²»Ö§³Ö¸ÃÑ¡Ïî"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "²»ÄÜÔÚģʽÐÐÀï³öÏÖ"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tµ±Ç°ÉèÖÃ: "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "= ºóÐèÒªÓÐÊý×Ö"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Termcap ÀïÃæÕÒ²»µ½"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "²»ÕýÈ·µÄ×Ö·û <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "ÕâÀï²»¿ÉʹÓÃ"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "²»ÄÜÉ趨 'term' Ϊ¿Õ×Ö·û´®"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "ÔÚͼÐͽçÃæÖв»ÄÜÇл»ÖÕ¶Ë"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "ÊäÈë \":gui\" À´Æô¶¯Í¼ÐνçÃæ"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "'backupext' ¸ú 'patchmode' ÊÇÒ»ÑùµÄ"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "Á㳤¶È×Ö·û´®"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "<%s> ºóȱÉÙÊý×Ö"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "ȱÉÙ¶ººÅ"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "±ØÐèÖ¸¶¨Ò»¸ö ' Öµ"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "°üº¬²»ÄÜÏÔʾµÄ×Ö·û"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "²»ÕýÈ·µÄ×ÖÌå"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "²»ÄÜʹÓÃ×ÖÌ弯(Fontset)"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "²»ÕýÈ·µÄ×ÖÌ弯(Fontset)"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "²»ÄÜʹÓÃÉ趨µÄ¿í×ÖÌå(Widefont)"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "²»ÕýÈ·µÄ¿í×ÖÌå(Widefont)"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "<%c> ºóÓв»ÕýÈ·µÄ×Ö·û"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "ÐèÒª¶ººÅ"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' ±ØÐèÊÇ¿Õ°×»ò°üº¬ %s"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "²»Ö§³ÖÊó±ê"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "ûÓнáÊøµÄ±í´ïʽ: "
+
+#: option.c:5403
+msgid "too many items"
+msgstr "Ì«¶à¶ÔÏó"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "²»¶Ô³ÆµÄ×é"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "Ô¤ÀÀ´°¿ÚÒѾ­´æÔÚÁË"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' ²»ÄÜ±È 'winminheight' ¸üÉÙ"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' ²»ÄÜ±È 'winminwidth' ¸üÉÙ"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "ÖÁÉÙÐèÒª %d ÐÐ"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "ÖÁÉÙÐèÒª %d ÁÐ"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ²»ÕýÈ·µÄÑ¡Ïî: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Öն˱àÂë ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- È«¾Ö Ñ¡ÏîÖµ ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- ±¾µØ Ñ¡ÏîÖµ ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Ñ¡Ïî ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ´íÎó"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': ÕÒ²»µ½ %s ¶ÔÓ¦µÄ×Ö·û"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ·ÖºÅºóÓжàÓàµÄ×Ö·û: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "²»ÄÜ´ò¿ª"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ²»ÄÜ´ò¿ª´°¿Ú!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "ÐèÒª Amigados °æ±¾ 2.04 ÒÔÉÏ\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "ÐèÒª %s °æ±¾ %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "²»ÄÜ´ò¿ª NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "²»ÄÜ´´½¨ "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ·µ»ØÖµ: %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "²»ÄÜÇл»Ö÷¿Ø̨(console)ģʽ !?\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ²»Ö§³ÖÉ趨ÆÁĻģʽ"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ²»ÊÇÖ÷¿Ø̨(console)??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: ²»ÄÜÓà -f Ñ¡ÏîÖ´ÐÐ shell"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "²»ÄÜÖ´ÐÐ "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " ÒÑ·µ»Ø\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ̫С"
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O ´íÎó"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr ""
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ²»ÊÇ 80, ²»ÄÜÖ´ÐÐÍⲿÃüÁî"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: µ÷Óú¯Êý¿â \"%s\"() ʧ°Ü"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: ²»ÄÜÑ¡Ôñ´Ë´òÓ¡»ú"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "´Ó %s µ½ %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ´òÓ¡´íÎó: %s"
+
+#: os_mswin.c:1459
+msgid "Unknown"
+msgstr "δ֪"
+
+#: os_mswin.c:1486
+#, c-format
+msgid "Printing '%s'"
+msgstr "ÒÑ´òÓ¡: '%s'"
+
+#: os_mswin.c:2550
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: ×Ö·û¼¯ \"%s\" ²»ÄܶÔÓ¦×ÖÌå\"%s\""
+
+#: os_mswin.c:2558
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ²»ÕýÈ·µÄ×Ö·û '%c' ³öÏÖÔÚ×ÖÌåÃû³Æ \"%s\" ÄÚ"
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ²»ÕýÈ·µÄ 'filetype' Ñ¡Ïî - ʹÓô¿ÎÄ×Öģʽ"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Ë«ÖØÐźÅ, Í˳öÖÐ\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: CVim: À¹½Øµ½ÐźÅ(signal) %s\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: À¹½Øµ½ÖÂÃüµÄÐźÅ(deadly signale)\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "´ò¿ª X Window ÓÃʱ %ld Ãë"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X ´íÎó\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "²âÊÔ X Window ʧ°Ü"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "´ò¿ª X Window ³¬Ê±"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"²»ÄÜÖ´ÐÐ shell"
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"²»ÄÜÖ´ÐÐ shell sh\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell ÒÑ·µ»Ø"
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"²»Äܽ¨Á¢¹ÜµÀ\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"²»ÄÜ fork\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"ÃüÁîÒѽáÊø\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "´ò¿ª X Window ʧ°Ü"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "ÔÚÐкŠ"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "²»ÄܼÓÔØ vim32.dll£¡"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM ´íÎó"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "²»ÄÜÐÞÕýº¯ÊýÖ¸Õëµ½ DLL!"
+
+#: os_win16.c:578 os_win32.c:3019
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell ·µ»ØÖµ %d"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: À¹½Øµ½ %s ʼþ\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "¹Ø±Õ"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "×¢Ïû"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "¹Ø»ú"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: ÕÒ²»µ½ÃüÁî"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"ÔÚÄãµÄ $PATH ÖÐÕÒ²»µ½ VIMRUN.EXE.\n"
+"ÍⲿÃüÁîÖ´ÐÐÍê±Ïºó½«²»»áÔÝÍ£.\n"
+"½øÒ»²½ËµÃ÷ÇëÖ´ÐÐ :help win32-vimrun "
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Vim ¾¯¸æ"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ¸ñʽ»¯×Ö·û´®ÀïÓÐÌ«¶à %%%c "
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: ¸ñʽ»¯×Ö·û´®²»Ó¦¸Ã³öÏÖ %%%c "
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: ¸ñʽ»¯×Ö·û´®ÀïÉÙÁË ]"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: ¸ñʽ»¯×Ö·û´®ÀïÓв»Ö§³ÖµÄ %%%c "
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ¸ñʽ»¯×Ö·û´®¿ªÍ·ÀïÓв»ÕýÈ·µÄ %%%c "
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: ¸ñʽ»¯×Ö·û´®ÀïÓв»ÕýÈ·µÄ %%%c "
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' δÉ趨"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ÕÒ²»µ½Ä¿Â¼Ãû³Æ»òÊÇ¿ÕµÄĿ¼Ãû³Æ"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "ûÓÐÆäËü¶ÔÏó"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d / %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (ÐÐÒÑɾ³ý)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Quickfix ¶ÑÕ»½áβ"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Quickfix ¶ÑÕ»¶¥¶Ë"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "´íÎóÁбí %d/%d; ¹²ÓÐ %d Ïî´íÎó"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: ²»ÄÜдÈ룬'buftype' Ñ¡ÏîÒÑÉ趨"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: Ãû×ÖÌ«³¤"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: ³²×´ %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: ³²×´ %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c ûÓнӶ«Î÷"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Óï·¨´íÎó: %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ²»ÄÜÖ´ÐÐ; regular expression Ì«¸´ÔÓ?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: regular expression Ôì³É¶ÑÕ»ÓùâµÄ´íÎó"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "Íⲿ·ûºÏ:\n"
+
+#: screen.c:2051
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--ÒÑ fold %3ld ÐÐ"
+
+#: screen.c:7411
+msgid " VREPLACE"
+msgstr " V-Ìæ»»"
+
+#: screen.c:7415
+msgid " REPLACE"
+msgstr " Ìæ»»"
+
+#: screen.c:7420
+msgid " REVERSE"
+msgstr " ·´×ª"
+
+#: screen.c:7422
+msgid " INSERT"
+msgstr " ²åÈë"
+
+#: screen.c:7425
+msgid " (insert)"
+msgstr " (²åÈë)"
+
+#: screen.c:7427
+msgid " (replace)"
+msgstr " (Ìæ»»)"
+
+#: screen.c:7429
+msgid " (vreplace)"
+msgstr " (v-Ìæ»»)"
+
+#: screen.c:7432
+msgid " Hebrew"
+msgstr " Ï£²®À³"
+
+#: screen.c:7440
+msgid " (lang)"
+msgstr " (ÓïÑÔ)"
+
+#: screen.c:7443
+msgid " (paste)"
+msgstr " (Õ³Ìû)"
+
+#: screen.c:7449
+msgid " SELECT"
+msgstr " Ñ¡È¡"
+
+#: screen.c:7451
+msgid " VISUAL"
+msgstr " ¿ÉÊÓ"
+
+#: screen.c:7453
+msgid " BLOCK"
+msgstr " ¿é"
+
+#: screen.c:7455
+msgid " LINE"
+msgstr " ÐÐ"
+
+#: screen.c:7468 screen.c:7522
+msgid "recording"
+msgstr "¼Ç¼ÖÐ"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ÒѲéÕÒµ½Îļþ¿ªÍ·£»ÔÙ´Ó½áβ¼ÌÐø²éÕÒ"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "ÒѲéÕÒµ½Îļþ½áβ£»ÔÙ´Ó¿ªÍ·¼ÌÐø²éÕÒ"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: ´íÎóµÄ²éÕÒ×Ö·û´®: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ÒѲéÕÒµ½Îļþ¿ªÍ·ÈÔÕÒ²»µ½ %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ÒѲéÕÒµ½Îļþ½áβÈÔÕÒ²»µ½ %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ÔÚ ';' ºóÃæÓ¦¸ÃÓÐ '?' »ò '/'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (°üÀ¨ÉÏ´ÎÁгö·ûºÏÏî)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- °üº¬Îļþ "
+
+#: search.c:3498
+msgid "not found "
+msgstr "ÕÒ²»µ½ "
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "ÔÚ·¾¶ ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (ÒÑÁгö)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " ÕÒ²»µ½"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "²éÕÒ°üº¬Îļþ: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: µ±Ç°ÐÐÆ¥Åä"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "ËùÓаüº¬Îļþ¶¼ÒÑÕÒµ½"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "ûÓаüº¬Îļþ"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: ÕÒ²»µ½¶¨Òå"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ÕÒ²»µ½ pattern"
+
+#: syntax.c:2990
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:3167
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ÎÞ´ËÓï·¨ cluster: \"%s\""
+
+#: syntax.c:3331
+msgid "No Syntax items defined for this buffer"
+msgstr "Õâ¸ö»º³åÇøûÓж¨ÒåÈκÎÓï·¨Ïî"
+
+#: syntax.c:3339
+msgid "syncing on C-style comments"
+msgstr "C·ç¸ñ×¢ÊÍͬ²½ÖÐ"
+
+#: syntax.c:3347
+msgid "no syncing"
+msgstr "ûÓÐͬ²½"
+
+#: syntax.c:3350
+msgid "syncing starts "
+msgstr "ͬ²½¿ªÊ¼"
+
+#: syntax.c:3352 syntax.c:3421
+msgid " lines before top line"
+msgstr "Ðкų¬³ö·¶Î§"
+
+#: syntax.c:3356
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Ó﷨ͬ²½ÏîÄ¿ (Syntax sync items) ---"
+
+#: syntax.c:3359
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"ͬ²½ÖÐ:"
+
+#: syntax.c:3364
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Óï·¨ÏîÄ¿ ---"
+
+#: syntax.c:3387
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ÎÞ´ËÓï·¨ cluster: \"%s\""
+
+#: syntax.c:3411
+msgid "minimal "
+msgstr "×îС"
+
+#: syntax.c:3418
+msgid "maximal "
+msgstr "×î´ó"
+
+#: syntax.c:4046
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4070
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: ÕÒ²»µ½ %s µÄ region item"
+
+#: syntax.c:4098
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4109
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4187
+msgid "E397: Filename required"
+msgstr "E397: ÐèÒªÎļþÃû³Æ"
+
+#: syntax.c:4523
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: ȱÉÙ \"=\": %s"
+
+#: syntax.c:4679
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: syntax region %s µÄ²ÎÊýÌ«ÉÙ"
+
+#: syntax.c:5010
+msgid "E400: No cluster specified"
+msgstr "E400: ûÓÐÖ¸¶¨µÄÊôÐÔ"
+
+#: syntax.c:5047
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ÕÒ²»µ½·Ö¸ô·ûºÅ: %s"
+
+#: syntax.c:5122
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: '%s' ºóÃæµÄ¶«Î÷²»ÄÜʶ±ð"
+
+#: syntax.c:5204
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: Ó﷨ͬ²½: Á¬½ÓÐзûºÅÖ¸¶¨ÁËÁ½´Î"
+
+#: syntax.c:5261
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:5311
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: ȱÉٵȺÅ: %s"
+
+#: syntax.c:5317
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ¿Õ²ÎÊý: %s"
+
+#: syntax.c:5344
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ²»ÄÜÔڴ˳öÏÖ"
+
+#: syntax.c:5351
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ±ØÐëÊÇÁбíÀïµÄµÚÒ»¸ö"
+
+#: syntax.c:5421
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ²»ÕýÈ·µÄ×éÃû: %s"
+
+#: syntax.c:5644
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ²»ÕýÈ·µÄ :syntax ×ÓÃüÁî: %s"
+
+#: syntax.c:6023
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ÕÒ²»µ½ highlight group: %s"
+
+#: syntax.c:6047
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: ²ÎÊýÌ«ÉÙ: \":highlight link %s\""
+
+#: syntax.c:6054
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: ²ÎÊý¹ý¶à: \":highlight link %s\""
+
+#: syntax.c:6074
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ÒÑÉ趨×é, ºöÂÔ highlight link"
+
+#: syntax.c:6203
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ²»¸ÃÓеĵȺÅ: %s"
+
+#: syntax.c:6239
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ȱÉٵȺÅ: %s"
+
+#: syntax.c:6261
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ȱÉÙ²ÎÊý: %s"
+
+#: syntax.c:6298
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ²»ºÏ·¨µÄÖµ: %s"
+
+#: syntax.c:6417
+msgid "E419: FG color unknown"
+msgstr "E419: ´íÎóµÄÇ°¾°ÑÕÉ«"
+
+#: syntax.c:6428
+msgid "E420: BG color unknown"
+msgstr "E420: ´íÎóµÄ±³¾°ÑÕÉ«"
+
+#: syntax.c:6483
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: ´íÎóµÄÑÕÉ«Ãû³Æ»òÊýÖµ: %s"
+
+#: syntax.c:6687
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: Öն˱àÂëÌ«³¤: %s"
+
+#: syntax.c:6734
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:7263
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ʹÓÃÁËÌ«¶à²»Í¬µÄ¸ßÁÁ¶ÈÊôÐÔ"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "±êÇ©(tag)¶ÑÕ»½áβ"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "±êÇ©(tag)¶ÑÕ»¿ªÍ·"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ÒѾ­ÔÚ×îÇ°ÃæµÄ±êÇ©(tag)ÁË"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ÕÒ²»µ½±êÇ©(tag): %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "Îļþ\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "ÊäÈë nr »òÑ¡Ôñ (<CR> Í˳ö): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Ö»ÓдËÏî·ûºÏ"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ¼º¾­ÔÚ×îºóÒ»¸ö·ûºÏµÄ±êÇ©(tag)ÁË"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Îļþ \"%s\" ²»´æÔÚ"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ÕÒµ½ tag: %d/%d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " »ò¸ü¶à"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " ÒÔ²»Í¬´óСдÀ´Ê¹Óà tag!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Îļþ \"%s\" ²»´æÔÚ"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # µ½ tag ´Ó ÐÐ ÔÚ Îļþ/Îı¾"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "ÏßÐÔ²éÕÒ±êÇ© (Tags)"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "¶þ½øÖƲéÕÒ(Binary search) ±êÇ©(Tags)"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "²éÕÒ tag Îļþ \"%s\""
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag Îļþ·¾¶±»½Ø¶ÏΪ %s\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Tag Îļþ \"%s\" ¸ñʽ´íÎó"
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "ÔÚ %ld ×Ö½Ú֮ǰ"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag ÎļþδÅÅÐò: %s"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: ûÓÐ tag Îļþ"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: ÕÒ²»µ½ tag"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: ÕÒ²»µ½ tag, ÊÔ×ŲÂ!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ²»ÄܼÓÔØ¡£¿ÉÓõÄÄÚ½¨ÖÕ¶ËÐÎʽÓÐ:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "Ô¤Éè: '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "²»ÄÜ´ò¿ª termcap Îļþ"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "ÔÚterminfoÖÐδÕÒµ½ÖÕ¶ËÏî"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "ÔÚtermcapÖÐδÕÒµ½ÖÕ¶ËÏî"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap ûÓÐ \"%s\" Ïî"
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ÖÕ¶ËÐèÒª \"cm\" µÄÄÜÁ¦"
+
+#. Highlight title
+#: term.c:4872
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Öն˰´¼ü ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "Æô¶¯Ð shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: ¶Á´íÎó£¬Í˳öÖÐ...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "²»ÄÜ»¹Ô­£»Çë¼ÌÐø"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ÐкŴíÎó"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "Ò»Ïî¸Ä±ä"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "%ld Ïî¸Ä±ä"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: ³·ÏúÁбíËð»µ"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: ÕÒ²»µ½Òª³·Ïú²Ù×÷µÄÐÐ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32λ ͼÐͽçÃæ°æ±¾"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit ͼÐͽçÃæ°æ±¾"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr "Win32s ģʽ"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr "Ö§³Ö OLE"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32λ ×Ö·û½çÃæ°æ±¾"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 32λ ×Ö·û½çÃæ°æ±¾"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 λ MS-DOS °æ±¾"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 λ MS-DOS °æ±¾"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) °æ±¾"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X °æ±¾"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS °æ±¾"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS °æ±¾"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"¼ÓÈë²¹¶¡: "
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"±àÒë"
+
+#: version.c:731
+msgid "by "
+msgstr "Õß:"
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"³¬Ç¿°æ±¾ "
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"´óÐÍ°æ±¾ "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Ò»°ã°æ±¾ "
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"¼òÒ×°æ±¾ "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"¾«¼ò°æ±¾ "
+
+#: version.c:760
+msgid "without GUI."
+msgstr "²»Ê¹ÓÃͼÐͽçÃæ¡£"
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "ʹÓà GTK-GNOME ͼÐͽçÃæ¡£"
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "ʹÓà GTK ͼÐͽçÃæ¡£"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "ʹÓà X11-Motif ͼÐͽçÃæ¡£"
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "ʹÓà X11-Athena ͼÐͽçÃæ¡£"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "ʹÓà BeOS ͼÐͽçÃæ¡£"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "ʹÓÃPhotonͼÐͽçÃæ¡£"
+
+#: version.c:782
+msgid "with GUI."
+msgstr "ʹÓÃͼÐͽçÃæ¡£"
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "ʹÓà Carbon ͼÐͽçÃæ¡£"
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "ʹÓà Cocoa ͼÐͽçÃæ¡£"
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "ʹÓà (´«Í³) ͼÐͽçÃæ¡£"
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " Ä¿Ç°¿ÉʹÓÃ(+)Óë²»¿ÉʹÓÃ(-)µÄÄ£¿éÁбí:\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " ϵͳ vimrc ÅäÖÃÎļþ: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " Óû§µÄ vimrc ÅäÖÃÎļþ: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " µÚ¶þ×éÓû§ vimrc Îļþ: \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " µÚÈý×éÓû§ vimrc Îļþ: \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " Óû§µÄ exrc ÅäÖÃÎļþ: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " µÚ¶þ×éÓû§ exrc Îļþ: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " ϵͳ gvimrc Îļþ: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " Óû§µÄ gvimrc ÅäÖÃÎļþ: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr " µÚ¶þ×éÓû§ gvimrc Îļþ: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr " µÚÈý×éÓû§ gvimrc Îļþ: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " ϵͳ²Ëµ¥ÅäÖÃÎļþ: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " $VIM Ô¤ÉèÖµ: \""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME Ô¤ÉèÖµ: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "±àÒ뷽ʽ: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "±àÒëÆ÷: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "Á´½á·½Ê½: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " µ÷ÊÔ°æ±¾"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:936
+msgid "version "
+msgstr "°æ±¾ "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "ά»¤ÈË: Bram Moolenaar et al."
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim Ϊ¿É×ÔÓÉ·¢ÐеĿª·ÅÔ´´úÂëÈí¼þ"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "°ïÖúÎڸɴïµÄ¿ÉÁ¯¶ùͯ!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "½øÒ»²½ËµÃ÷ÇëÊäÈë :help iccf<Enter>"
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "ÒªÍ˳öÇëÊäÈë :q<Enter> "
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "ÔÚÏß°ïÖúÇëÊäÈë :help<Enter> "
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "а汾ÐÅÏ¢ÇëÊäÈë :help version6<Enter>"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Vi ¼æÈÝģʽ"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "Èç¹ûÒªÍêÈ«Ä£Ä⴫ͳ Vi ÇëÊäÈë :set nocp<Enter>"
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "Èç¹ûÐèÒª¶Ô Vi ¼æÈÝģʽ½øÒ»²½ËµÃ÷ÇëÊäÈë :help cp-default<Enter>"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "×¢Òâ: ¼ì²âµ½ Windows 95/98/ME"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "Èç¹ûÐèÒª¶Ô Windows 95 Ö§³ÖµÄ¸ü¶àÐÅÏ¢ÇëÊäÈë :help windows95<Enter>"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: ûÓÐÔ¤ÀÀ´°¿Ú"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ²»ÄÜͬʱ·Ö¸î´°¿ÚΪ×óÉϺÍÓÒϽÇ"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ÓÐÆäËü·Ö¸î´°¿Úʱ²»ÄÜÐýת"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: ²»ÄܹرÕ×îºóÒ»¸ö´°¿Ú"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "ÒѾ­Ö»Ê£Ò»¸ö´°¿ÚÁË"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: ÆäËü´°¿ÚÓиıäµÄÄÚÈÝ"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: ¹â±ê´¦Ã»ÓÐÎļþÃû"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: ÔÚ·¾¶ÖÐÕÒ²»µ½Îļþ \"%s\""
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Óà &multiple Vims ±à¼­"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Óà single &Vim ±à¼­"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Óà &Vim ±à¼­"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Óõ±Ç°µÄ Vim ±à¼­ - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Óà Vim ±à¼­Ñ¡ÔñµÄÎļþ"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "´´½¨½ø³Ìʧ°Ü: Çë¼ì²égvimÊÇ·ñÔÚ¿ÉÖ´Ðз¾¶ÖÐ!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ³ö´í"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "·¾¶ÃûÌ«³¤"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--»º³åÇøÎÞ×ÊÁÏ--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "ÃüÁǿÖÆÖжÏ"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "ÐèÒªÖ¸Áî²ÎÊý"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ ºóÃæÓ¦¸ÃÓÐ / ? »ò &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ²»ÄÜÔÚÃüÁîÐд°¿ÚÖÐʹÓá£<CR>Ö´ÐУ¬CTRL-C Í˳ö"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: exrc/vimrc ÀïµÄÖ¸Áî²»ÄÜÖ´ÐÐ"
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: ÎļþÒѾ­´æÔÚ (¿ÉÓà ! Ç¿ÖÆÌæ»»)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "ÃüÁîÖ´ÐÐʧ°Ü"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "ÄÚ²¿´íÎó"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "ÒÑÖжÏ"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: ²»ÕýÈ·µÄµØÖ·"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "²»ÕýÈ·µÄ²ÎÊý"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "²»ÕýÈ·µÄ²ÎÊý: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ²»ÕýÈ·µÄ±í´ïʽ: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: ²»ÕýÈ·µÄ·¶Î§"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "²»ÕýÈ·µÄÃüÁî"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ÊÇĿ¼"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' Ç°Ãæ³öÏÖÁË´íÎóµÄ×Ö·û"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ±ê¼ÇµÄÐкŴíÎó"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: ûÓÐÉ趨±ê¼Ç"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: ÒòΪ 'modifiable' Ñ¡ÏîÊǹرյģ¬ËùÒÔ²»ÄÜÐÞ¸Ä"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: µÝ¹éµ÷ÓÃÌ«¶à²ã"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: ûÓÐÌæ´úµÄÎļþ"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: ûÓÐÕâ¸ö abbreviation ¶ÔÓ¦"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "²»¿ÉʹÓà '!'"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: ÒòΪ±àÒëʱûÓмÓÈëͼÐͽçÃæµÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓÃͼÐͽçÃæ"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: ÒòΪ±àÒëʱûÓмÓÈëÏ£²®À³µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓà Hebrew\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: ÒòΪ±àÒëʱûÓмÓÈë Farsi µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓà Farsi\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ûÓÐÃûΪ '%s' µÄ highlight group"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: ûÓвåÈë¹ýÎÄ×Ö"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: ûÓÐÇ°Ò»ÏîÃüÁî"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: ûÓÐÕâ¸ö mapping ¶ÔÓ¦"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "ÕÒ²»µ½"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "ÕÒ²»µ½: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: ûÓÐÎļþÃû"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ûÓÐÇ°Ò»¸ö²éÕÒ/Ìæ»»µÄÃüÁî"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: ûÓÐÇ°Ò»¸öÃüÁî"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: ûÓÐÇ°Ò»¸ö²éÕÒÃüÁî"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "²»¿ÉʹÓ÷¶Î§ÃüÁî"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: ûÓÐ×ã¹»µÄ¿Õ¼ä"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "²»ÄÜ´´½¨Îļþ %s"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "²»Äܵõ½ÁÙʱÎļþÃû"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "²»ÄÜ´ò¿ªÎļþ %s"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "²»ÄܶÁÈ¡Îļþ %s"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: ÎļþÄÚÈÝÒѸı䵫ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: ¿ÕµÄ (Null) ²ÎÊý"
+
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: Ó¦¸ÃÒªÓÐÊý×Ö"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ²»ÄÜ´ò¿ª´íÎóÎļþ %s"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: ÄÚ´æ²»×ã!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "ÕÒ²»µ½Ä£Ê½"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "ÕÒ²»µ½Ä£Ê½ %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "²ÎÊýÓ¦¸ÃÊÇÕýÊý"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: ûÓдíÎó"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: Æ¥Åä×Ö·û´®ÓÐÎÊÌâ"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: ÕýÔò±í´ïʽÓÐÎÊÌâ"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: É趨 'readonly' Ñ¡Ïî(Ö»¶Á) (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: ²»ÄÜÉ趨ֻ¶Á±äÁ¿ \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ¶ÁÈ¡´íÎóÎļþʧ°Ü"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ²»ÄÜÔÚ sandbox Àï³öÏÖ"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: ´íÎóµÄ¹ö¶¯´óС"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'E71: Ñ¡Ïî 'shell' δÉ趨"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: ½»»»Îļþ¹Ø±Õ´íÎó"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: ±êÇ©¶ÑÕ»ÒÑ¿Õ"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: ÃüÁîÌ«¸´ÔÓ"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: Ãû×ÖÌ«³¤"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: Ì«¶à ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: Ì«¶àÎļþÃû"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "ÄãÊäÈëÁ˶àÓàµÄ×Ö·û"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: ²»ÄÜ°ìʶµÄ±ê¼Ç"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ²»ÄÜÀ©Õ¹Í¨Åä·û"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: дÈë´íÎó"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "Êýµ½Áã (?)"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ²»ÄÜÔÚ script ±¾ÎÄÍâʹÓÃ."
diff --git a/src/po/zh_CN.po b/src/po/zh_CN.po
new file mode 100644
index 000000000..28fb5ad05
--- /dev/null
+++ b/src/po/zh_CN.po
@@ -0,0 +1,5937 @@
+# Chinese (simplified) Translation for Vim
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Wang Jun <junw@turbolinux.com.cn>
+#
+# Original translations.
+#
+#, no-wrap
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Simplified Chinese)\n"
+"POT-Creation-Date: 2001-09-24 10:10+0800\n"
+"PO-Revision-Date: 2001-09-24 11:13+0800\n"
+"Last-Translator: Wang Jun <junw@turbolinux.com.cn>\n"
+"Language-Team: Wang Jun <junw@turbolinux.com.cn>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=gb2312\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: ²»ÄÜ·ÖÅäÈκλº³åÇø£¬Í˳ö³ÌÐò..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: ²»ÄÜ·ÖÅ仺³åÇø£¬Ê¹ÓÃÁíÒ»¸ö»º³åÇø...."
+
+#: buffer.c:698
+msgid "No buffers were unloaded"
+msgstr "ûÓÐÊÍ·ÅÈκλº³åÇø"
+
+#: buffer.c:700
+msgid "No buffers were deleted"
+msgstr "ûÓÐɾ³ýÈκλº³åÇø"
+
+#: buffer.c:702
+msgid "No buffers were wiped out"
+msgstr "ûÓÐɾ³ýÈκλº³åÇø"
+
+#: buffer.c:710
+msgid "1 buffer unloaded"
+msgstr "ÒÑÊÍ·ÅÒ»¸ö»º³åÇø"
+
+#: buffer.c:712
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "ÒÑÊÍ·Å %d ¸ö»º³åÇø"
+
+#: buffer.c:717
+msgid "1 buffer deleted"
+msgstr "ÒÑɾ³ýÒ»¸ö»º³åÇø"
+
+#: buffer.c:719
+#, c-format
+msgid "%d buffers deleted"
+msgstr "ÒÑɾ³ý %d ¸ö»º³åÇø"
+
+#: buffer.c:724
+msgid "1 buffer wiped out"
+msgstr "ÒÑɾ³ýÒ»¸ö»º³åÇø"
+
+#: buffer.c:726
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "ÒÑɾ³ý %d ¸ö»º³åÇø"
+
+#: buffer.c:783
+msgid "E84: No modified buffer found"
+msgstr "E84: ûÓÐÐ޸ĹýµÄ»º³åÇø"
+
+#. back where we started, didn't find anything.
+#: buffer.c:822
+msgid "E85: There is no listed buffer"
+msgstr "E85: ûÓпÉÁгöµÄ»º³åÇø"
+
+#: buffer.c:834
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: ²»ÄÜÇл»µ½µÚ %ld ¸ö»º³åÇø"
+
+#: buffer.c:837
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: ²»ÄÜÇл»µ½¸üºóÃæµÄ»º³åÇø"
+
+#: buffer.c:839
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: ²»ÄÜÇл»µ½¸üÇ°ÃæµÄ»º³åÇø"
+
+#: buffer.c:863
+#, c-format
+msgid "E89: No write since last change for buffer %ld (use ! to override)"
+msgstr "E89: ÒѸü¸Ä¹ý»º³åÇø %ld µ«ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: buffer.c:879
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: ²»ÄÜÊÍ·Å×îºóÒ»¸ö»º³åÇø"
+
+#: buffer.c:1314
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ¾¯¸æ: ÎļþÃû¹ý¶à"
+
+#: buffer.c:1480
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: ÕÒ²»µ½µÚ %ld ¸ö»º³åÇø"
+
+#: buffer.c:1700
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: ÕÒµ½Ò»¸öÒÔÉ쵀 %s"
+
+#: buffer.c:1702
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: ÕÒ²»µ½ %s"
+
+#: buffer.c:2105 ex_docmd.c:6065
+#, c-format
+msgid "line %ld"
+msgstr "ÐÐ %ld"
+
+#: buffer.c:2188
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ÒÑÓлº³åÇøʹÓÃÕâ¸öÃû×Ö"
+
+#: buffer.c:2481
+msgid " [Modified]"
+msgstr " [ÒÑÐÞ¸Ä]"
+
+#: buffer.c:2486
+msgid "[Not edited]"
+msgstr "[δ±à¼­]"
+
+#: buffer.c:2491
+msgid "[New file]"
+msgstr "[ÐÂÎļþ]"
+
+#: buffer.c:2492
+msgid "[Read errors]"
+msgstr "[¶Á´íÎó]"
+
+#: buffer.c:2494 fileio.c:1754
+msgid "[readonly]"
+msgstr "[Ö»¶Á]"
+
+#: buffer.c:2510
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "ÐÐÊý 1 --%d%%--"
+
+#: buffer.c:2510
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "ÐÐÊý %ld --%d%%--"
+
+#: buffer.c:2518
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "ÐÐ %ld/%ld --%d%%-- ÁÐ "
+
+#: buffer.c:2606
+msgid "[No file]"
+msgstr "[δÃüÃû]"
+
+#. must be a help buffer
+#: buffer.c:2646
+msgid "help"
+msgstr "[°ïÖú]"
+
+#: buffer.c:3151 screen.c:4657
+msgid "[help]"
+msgstr "[°ïÖú]"
+
+#: buffer.c:3183 screen.c:4663
+msgid "[Preview]"
+msgstr "[Ô¤ÀÀ]"
+
+#: buffer.c:3389
+msgid "All"
+msgstr "È«²¿"
+
+#: buffer.c:3389
+msgid "Bot"
+msgstr "µ×¶Ë"
+
+#: buffer.c:3391
+msgid "Top"
+msgstr "¶¥¶Ë"
+
+#: buffer.c:4127
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# »º³åÇøÁбí:\n"
+
+#: buffer.c:4160
+msgid "[Error List]"
+msgstr "[´íÎóÁбí]"
+
+#: buffer.c:4173 memline.c:1513
+msgid "[No File]"
+msgstr "[δÃüÃû]"
+
+#: buffer.c:4393
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ·ûºÅ ---"
+
+#: buffer.c:4403
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s µÄ·ûºÅ:"
+
+#: buffer.c:4409
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ÐÐ=%ld id=%d Ãû³Æ=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: ²»ÄܱȽÏ(diff) %ld¸öÒÔÉϵĻº³åÇø"
+
+#: diff.c:648
+msgid "E97: Cannot create diffs"
+msgstr "E97: ²»ÄÜ´´½¨ diff "
+
+#: diff.c:747
+msgid "Patch file"
+msgstr "Patch Îļþ"
+
+#: diff.c:991
+msgid "E98: Cannot read diff output"
+msgstr "E98: ²»ÄܶÁÈ¡ diff µÄÊä³ö"
+
+#: diff.c:1704
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: Ä¿Ç°µÄ»º³åÇø²»ÊÇÔÚ diff ģʽ"
+
+#: diff.c:1716
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: ûÓлº³åÇøÔÚ diff ģʽ"
+
+#: diff.c:1724
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: ÓÐÁ½¸öÒÔÉϵĻº³åÇøÔÚ diff ģʽ£¬²»Äܾö¶¨ÒªÓÃÄÄÒ»¸ö"
+
+#: diff.c:1747
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: ÕÒ²»µ½»º³åÇø: \"%s\""
+
+#: diff.c:1753
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: »º³åÇø \"%s\" ²»ÊÇÔÚ diff ģʽ"
+
+#: digraph.c:2168
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: ¸´ºÏ×Ö·û(digraph)Öв»ÄÜʹÓà Escape"
+
+#: digraph.c:2340
+msgid "Keymap file not found"
+msgstr "ÕÒ²»µ½ keymap Îļþ"
+
+#: digraph.c:2367
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ʹÓà :loadkeymap "
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " ¹Ø¼ü×Ö×Ô¶¯Íê³É (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X ģʽ (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " ÇøÓò¹Ø¼ü×Ö×Ô¶¯Íê³É (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " ÕûÐÐ×Ô¶¯Íê³É (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " ÎļþÃû×Ô¶¯Íê³É (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " ±êÇ©×Ô¶¯Íê³É (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " ·¾¶×Ô¶¯Íê³É (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " ¶¨Òå×Ô¶¯Íê³É (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " ×Öµä×Ô¶¯Íê³É (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus ×Ô¶¯Íê³É (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " ÃüÁî×Ô¶¯Íê³É (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "Òѵ½¶ÎÂä½áβ"
+
+#: edit.c:894
+msgid "'thesaurus' option is empty"
+msgstr "Ñ¡Ïî 'thesaurus' δÉ趨"
+
+#: edit.c:1070
+msgid "'dictionary' option is empty"
+msgstr "Ñ¡Ïî 'dictionary' Ϊ¿Õ"
+
+#: edit.c:1992
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "ɨÃè×Öµä: %s"
+
+#: edit.c:2183
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (²åÈë) Scroll (^E/^Y)"
+
+#: edit.c:2185
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (Ìæ»») Scroll (^E/^Y)"
+
+#: edit.c:2496
+#, c-format
+msgid "Scanning: %s"
+msgstr "ɨÃèÖÐ: %s"
+
+#: edit.c:2531
+msgid "Scanning tags."
+msgstr "ɨÃè±êÇ©."
+
+#: edit.c:3189
+msgid " Adding"
+msgstr " Ôö¼Ó"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3238
+msgid "-- Searching..."
+msgstr "-- ËÑÑ°ÖÐ..."
+
+#: edit.c:3294
+msgid "Back at original"
+msgstr "»Øµ½Æðµã"
+
+#: edit.c:3299
+msgid "Word from other line"
+msgstr "´ÓÆäËüÐпªÊ¼µÄ´Ê (?)"
+
+#: edit.c:3304
+msgid "The only match"
+msgstr "Ö»ÓдËÏîÆ¥Åä"
+
+#: edit.c:3363
+#, c-format
+msgid "match %d of %d"
+msgstr "ÕÒµ½ %d / %d"
+
+#: edit.c:3366
+#, c-format
+msgid "match %d"
+msgstr "Æ¥Åä %d"
+
+#: eval.c:696
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: 䶨ÒåµÄ±äÁ¿: \"%s\""
+
+#: eval.c:975
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ȱÉÙ¶ÔÓ¦µÄÀ¨ºÅ: %s"
+
+#: eval.c:1043
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: Î޴˱äÁ¿: \"%s\""
+
+#: eval.c:1284
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' ºóȱÉÙ ':'"
+
+#: eval.c:1898
+msgid "E110: Missing ')'"
+msgstr "E110: ȱÉÙ¶ÔÓ¦µÄ \")\""
+
+#: eval.c:1948
+msgid "E111: Missing ']'"
+msgstr "E111: ȱÉÙ¶ÔÓ¦µÄ \"]\""
+
+#: eval.c:2023
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ȱÉÙÑ¡ÏîÃû³Æ: %s"
+
+#: eval.c:2041
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ²»ÕýÈ·µÄÑ¡Ïî: %s"
+
+#: eval.c:2103
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: ȱÉÙÒýºÅ: %s"
+
+#: eval.c:2220
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ȱÉÙÒýºÅ: %s"
+
+#: eval.c:2537
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: º¯Êý %s µÄ²ÎÊý²»ÕýÈ·"
+
+#: eval.c:2538
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: 䶨ÒåµÄº¯Êý: %s"
+
+#: eval.c:2539
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: º¯Êý %s µÄ²ÎÊý¹ý¶à"
+
+#: eval.c:2540
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: º¯Êý %s µÄ²ÎÊýÌ«ÉÙ"
+
+#: eval.c:2541
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ²»ÄÜÔÚ script ÉÏÏÂÎÄÍâʹÓÃ: %s"
+
+#: eval.c:3574
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ÐÐ: "
+
+#: eval.c:4689
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"È·¶¨(&O)\n"
+"È¡Ïû(&C)"
+
+#: eval.c:5511
+msgid "E240: No connection to Vim server"
+msgstr "E240: ûÓÐÓë Vim Server ´´½¨Á¬½Ó"
+
+#: eval.c:5601
+msgid "E277: Unable to read a server reply"
+msgstr "E277: ²»ÄܶÁÈ¡·þÎñÆ÷µÄÏìÓ¦"
+
+#: eval.c:5626
+msgid "E258: Unable to send to client"
+msgstr "E258: ²»ÄÜ´«Ë͵½¿Í»§¶Ë"
+
+#: eval.c:5667
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: ²»ÄÜ´«Ë͵½ %s"
+
+#: eval.c:5763
+msgid "(Invalid)"
+msgstr "(ÎÞЧ)"
+
+#: eval.c:6766
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: ±äÁ¿ %s ÉÐ䶨Òå"
+
+#: eval.c:7464
+#, c-format
+msgid "E122: Function %s already exists, use ! to replace"
+msgstr "E122: º¯Êý %s ÒѾ­´æÔÚ, ÇëʹÓà ! Ç¿ÖÆÌæ»»"
+
+#: eval.c:7506
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: º¯Êý %s ÉÐ䶨Òå"
+
+#: eval.c:7519
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: ȱÉÙ \"(\": %s"
+
+#: eval.c:7551
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: ²ÎÊý²»ÕýÈ·: %s"
+
+#: eval.c:7637
+msgid "E126: Missing :endfunction"
+msgstr "E126: ȱÉÙ :endfunction"
+
+#: eval.c:7716
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: º¯Êý %s ÕýÔÚʹÓÃÖУ¬²»ÄÜÖØж¨Òå"
+
+#: eval.c:7773
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: º¯ÊýÃû³ÆµÚÒ»¸ö×Öĸ±ØÐë´óд: %s"
+
+#: eval.c:7779
+msgid "E129: Function name required"
+msgstr "E129: ÐèÒªº¯ÊýÃû³Æ"
+
+#: eval.c:7872
+msgid "function "
+msgstr "º¯Êý "
+
+#: eval.c:7987
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: º¯Êý %s ÉÐ䶨Òå"
+
+#: eval.c:7992
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: º¯Êý %s ÕýÔÚʹÓÃÖУ¬²»ÄÜɾ³ý"
+
+#: eval.c:8039
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: º¯ÊýµÝ¹éµ÷ÓòãÊý³¬¹ý 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8090
+#, c-format
+msgid "calling %s"
+msgstr "µ÷ÓÃ %s"
+
+#. always scroll up, don't overwrite
+#: eval.c:8115 ex_cmds2.c:1973
+#, c-format
+msgid "continuing in %s"
+msgstr "¼ÌÐø: %s"
+
+#: eval.c:8169
+msgid "E133: :return not inside a function"
+msgstr "E133: :return ±ØÐëÔÚº¯ÊýÀïʹÓÃ"
+
+#: eval.c:8247
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ·µ»ØÖµ #%ld "
+
+#: eval.c:8250
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ·µ»ØÖµ \"%s\""
+
+#: eval.c:8391
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# È«¾Ö±äÁ¿:\n"
+
+#: ex_cmds2.c:70
+msgid "Entering Debug mode. Type \"cont\" to leave."
+msgstr "½øÈëµ÷ÊÔģʽ. ÊäÈë \"cont\" ÒԻص½Õý³£Ä£Ê½."
+
+#: ex_cmds2.c:74 ex_docmd.c:771
+#, c-format
+msgid "line %ld: %s"
+msgstr "ÐÐ %ld: %s"
+
+#: ex_cmds2.c:76
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:224
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "\"%s%s\" Öжϵã: µÚ %ld ÐÐ"
+
+#: ex_cmds2.c:388
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: ÕÒ²»µ½Öжϵã: %s"
+
+#: ex_cmds2.c:414
+msgid "No breakpoints defined"
+msgstr "ûÓж¨ÒåÖжϵã"
+
+#: ex_cmds2.c:419
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s µÚ %ld ÐÐ"
+
+#: ex_cmds.c:2053 ex_cmds.c:2289 ex_cmds2.c:602
+msgid "Save As"
+msgstr "Áí´æΪ"
+
+#: ex_cmds2.c:625
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "½«¸Ä±ä±£´æµ½ \"%.*s\"?"
+
+#: ex_cmds2.c:627 ex_docmd.c:8612
+msgid "Untitled"
+msgstr "δÃüÃû"
+
+#: ex_cmds2.c:763
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ÒѸü¸Ä¹ý»º³åÇø \"%s\" µ«ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: ex_cmds2.c:832
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "×¢Òâ: ÒÑÇл»µ½ÆäËü»º³åÇø (Çë¼ì²é Autocommands ÓÐÎÞ´íÎó)"
+
+#: ex_cmds2.c:1208
+msgid "E163: There is only one file to edit"
+msgstr "E163: Ö»ÓÐÒ»¸öÎļþ¿É±à¼­"
+
+#: ex_cmds2.c:1210
+msgid "E164: Cannot go before first file"
+msgstr "E164: ÒѾ­ÔÚµÚÒ»¸öÎļþÁË"
+
+#: ex_cmds2.c:1212
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ÒѾ­ÔÚ×îºóÒ»¸öÎļþÁË"
+
+#: ex_cmds2.c:1632
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "²éÕÒÖÐ: \"%s\" -- \"%s\""
+
+#: ex_cmds2.c:1654
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "²éÕÒÖÐ: \"%s\""
+
+#: ex_cmds2.c:1678
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "ÔÚ 'runtimepath' ÀïÕÒ²»µ½ \"%s\""
+
+#: ex_cmds2.c:1712
+msgid "Run Macro"
+msgstr "Ö´Ðкê"
+
+#: ex_cmds2.c:1817
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "²»ÄÜÖ´ÐÐĿ¼£º \"%s\""
+
+#: ex_cmds2.c:1847
+#, c-format
+msgid "could not source \"%s\""
+msgstr "²»ÄÜÖ´ÐÐ \"%s\""
+
+#: ex_cmds2.c:1849
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "µÚ %ld ÐÐ: ²»ÄÜÖ´ÐÐ \"%s\""
+
+#: ex_cmds2.c:1863
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "Ö´ÐÐ \"%s\" ÖÐ"
+
+#: ex_cmds2.c:1865
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "µÚ %ld ÐÐ: ½áÊøÖ´ÐÐ %s"
+
+#: ex_cmds2.c:1971
+#, c-format
+msgid "finished sourcing %s"
+msgstr "½áÊøÖ´ÐÐ %s"
+
+#: ex_cmds2.c:2272
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: ×¢Òâ: ´íÎóµÄÐзָô×Ö·û£¬¿ÉÄÜÊÇÉÙÁË ^M"
+
+#: ex_cmds2.c:2321
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: ÔÚÖ´ÐÐ script ÎļþÍâ²»¿ÉʹÓà :scriptencoding"
+
+#: ex_cmds2.c:2354
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: ÔÚÖ´ÐÐ script ÎļþÍâ²»¿ÉʹÓà :finish"
+
+#: ex_cmds2.c:2820
+msgid "No text to be printed"
+msgstr "ûÓÐÒª´òÓ¡µÄÎÄ×Ö"
+
+#: ex_cmds2.c:2898
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "´òÓ¡ÖÐ: µÚ %d Ò³ (%d%%)"
+
+#: ex_cmds2.c:2907
+#, c-format
+msgid " Copy %d of %d"
+msgstr "¸´ÖÆ %d / %d"
+
+#: ex_cmds2.c:2959
+#, c-format
+msgid "Printed: %s"
+msgstr "ÒÑ´òÓ¡: %s"
+
+#: ex_cmds2.c:2966
+msgid "Printing aborted"
+msgstr "´òÓ¡ÖжÏ"
+
+#: ex_cmds2.c:3344
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: дÈë PostScript Îļþ³ö´í"
+
+#: ex_cmds2.c:4019
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: ²»ÄÜ´ò¿ª PostScript Êä³öÎļþ"
+
+#: ex_cmds2.c:4057
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: ²»ÄÜ´ò¿ªÎļþ \"%s\""
+
+#: ex_cmds2.c:4068
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: ²»ÄܶÁ PostScript ×ÊÔ´Îļþ \"%s\""
+
+#: ex_cmds2.c:4266
+msgid "Sending to printer..."
+msgstr "·¢Ë͵½´òÓ¡»ú..."
+
+#: ex_cmds2.c:4270
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: ´òÓ¡ PostScript Îļþʧ°Ü"
+
+#: ex_cmds2.c:4272
+msgid "Print job sent."
+msgstr ""
+
+#: ex_cmds2.c:4646
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "Ä¿Ç°µÄ %sÓïÑÔ: \"%s\""
+
+#: ex_cmds2.c:4653
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ²»ÄÜÉ趨ÓïÑÔΪ \"%s\""
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, Ê®Áù½øÖÆ %02x, °Ë½øÖÆ %03o"
+
+#: ex_cmds.c:428
+msgid "E134: Move lines into themselves"
+msgstr "E134: ²»ÄÜ°ÑÐÐÒƵ½Ëü×ÔÒÑÄÚ"
+
+#: ex_cmds.c:497
+msgid "1 line moved"
+msgstr "ÒÑÒƶ¯ 1 ÐÐ"
+
+#: ex_cmds.c:499
+#, c-format
+msgid "%ld lines moved"
+msgstr "ÒÑ°áÒÆ %ld ÐÐ"
+
+#: ex_cmds.c:890
+#, c-format
+msgid "%ld lines filtered"
+msgstr "ÒÑ´¦Àí %ld ÐÐ"
+
+#: ex_cmds.c:918
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autocommand ²»¿ÉÒÔ¸ü¸Ä»º³åÇøµÄÄÚÈÝ"
+
+#: ex_cmds.c:1003
+msgid "[No write since last change]\n"
+msgstr "[¸üкóÉÐδ±£´æ]\n"
+
+#: ex_cmds.c:1248
+#, c-format
+msgid "viminfo: %s in line: "
+msgstr "viminfo: %s ÔÚÐÐÖÐ: "
+
+#: ex_cmds.c:1253
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ¹ý¶à´íÎó, ºöÂÔÎļþÆäÓಿ·Ö"
+
+#: ex_cmds.c:1282
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "¶ÁÈ¡ viminfo Îļþ \"%s\"%s%s%s"
+
+#: ex_cmds.c:1283
+msgid " info"
+msgstr " ÐÅÏ¢"
+
+#: ex_cmds.c:1284
+msgid " marks"
+msgstr " 񈬀"
+
+#: ex_cmds.c:1285
+msgid " FAILED"
+msgstr " ʧ°Ü"
+
+#: ex_cmds.c:1376
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo Îļþ²»ÄÜдÈë: %s"
+
+#: ex_cmds.c:1501
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: ²»ÄÜдÈë viminfo Îļþ %s !"
+
+#: ex_cmds.c:1509
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "дÈë viminfo Îļþ \"%s\" ÖÐ"
+
+#. Write the info:
+#: ex_cmds.c:1610
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# viminfo ÎļþÊÇÓÉ vim %s Ëù²úÉú.\n"
+
+#: ex_cmds.c:1612
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# Èç¹ûÏëÒª×ÔÐÐÐÞ¸ÄÇëÌرðСÐÄ£¡\n"
+"\n"
+
+#: ex_cmds.c:1614
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' ÔÚ´ËÎļþ½¨Á¢Ê±µÄÖµ\n"
+
+#: ex_cmds.c:1713
+msgid "Illegal starting char"
+msgstr "ÎÞЧµÄÆô¶¯×Ö·û"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2096
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: ÄúÔÚÁíÒ»¸ö»º³åÇøÒ²¼ÓÔØÁËÕâ¸öÎļþ"
+
+#: ex_cmds.c:2130
+msgid "Write partial file?"
+msgstr "ҪдÈ벿·ÖÎļþÂð£¿"
+
+#: ex_cmds.c:2137
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ÇëʹÓà ! À´Ð´È벿·Ö»º³åÇø"
+
+#: ex_cmds.c:2223
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "Òª¸²¸ÇÒÑ´æÔÚµÄÎļþ \"%.*s\"£¿"
+
+#: ex_cmds.c:2294
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: »º³åÇø %ld ûÓÐÎļþÃû"
+
+#: ex_cmds.c:2332
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ÎļþδдÈ룬ÒòΪ 'write' Ñ¡Ïî¹Ø±Õ"
+
+#: ex_cmds.c:2352
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" ÒÑÉ趨 'readonly' Ñ¡Ïî.\n"
+"È·¶¨Òª¸²¸ÇÂð£¿"
+
+#: ex_cmds.c:2517
+msgid "Edit File"
+msgstr "±à¼­Îļþ"
+
+#: ex_cmds.c:3024
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommands ÒâÍâµØɾ³ýлº³åÇø %s"
+
+#: ex_cmds.c:3156
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: :z ²»½ÓÊÜ·ÇÊý×ֵIJÎÊý"
+
+#: ex_cmds.c:3241
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim ÖнûֹʹÓà shell ÃüÁî"
+
+#: ex_cmds.c:3348
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: ÕýÔò±í´ïʽ²»ÄÜÓÃ×Öĸ·Ö¸ô (?)"
+
+#: ex_cmds.c:3686
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "Ì滻Ϊ %s (y/n/a/q/^E/^Y)?"
+
+#: ex_cmds.c:4050
+msgid "(Interrupted) "
+msgstr "(ÒÑÖжÏ) "
+
+#: ex_cmds.c:4054
+msgid "1 substitution"
+msgstr "Ìæ»»Ò»×é"
+
+#: ex_cmds.c:4056
+#, c-format
+msgid "%ld substitutions"
+msgstr "Ìæ»» %ld ×é"
+
+#: ex_cmds.c:4059
+msgid " on 1 line"
+msgstr " Ò»ÐÐÖÐ"
+
+#: ex_cmds.c:4061
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld ÐÐÖÐ"
+
+#: ex_cmds.c:4112
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global ²»ÄܵݹéÖ´ÐÐ"
+
+#: ex_cmds.c:4147
+msgid "E148: Regular expression missing from global"
+msgstr "E148: ûÓÐʹÓùýÕýÔò±í´ïʽ (?)"
+
+#: ex_cmds.c:4196
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "ÿһÐж¼ÕÒ²»µ½Ä£Ê½: %s"
+
+#: ex_cmds.c:4277
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# Ç°Ò»×éÌæ´ú×Ö·û´®:\n"
+"$"
+
+#: ex_cmds.c:4376
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ±§Ç¸, ûÓÐ %s µÄ˵Ã÷"
+
+#: ex_cmds.c:4410
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "±§Ç¸, ÕÒ²»µ½°ïÖúÎļþ \"%s\""
+
+#: ex_cmds.c:4856
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ²»ÊÇĿ¼"
+
+#: ex_cmds.c:4884
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: ²»ÄÜÒÔдÈëģʽ´ò¿ª \"%s\""
+
+#: ex_cmds.c:4898
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: ²»ÄܶÁÈ¡Îļþ: %s"
+
+#: ex_cmds.c:4977
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ±êÇ©(tag) \"%s\" ÔÚÎļþ %s ÀïÖظ´³öÏÖ¶à´Î"
+
+#: ex_cmds.c:5078
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: 䶨ÒåµÄ sign command: %s"
+
+#: ex_cmds.c:5098
+msgid "E156: Missing sign name"
+msgstr "E156: ȱÉÙ sign Ãû³Æ"
+
+#: ex_cmds.c:5144
+msgid "E255: Too many signs defined"
+msgstr "E326: ÕÒµ½Ì«¶à signs"
+
+#: ex_cmds.c:5186
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ²»ÕýÈ·µÄ sign ÎÄ×Ö: %s"
+
+#: ex_cmds.c:5210 ex_cmds.c:5396
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ²»ÕýÈ·µÄ sign: %s"
+
+#: ex_cmds.c:5256
+msgid "E159: Missing sign number"
+msgstr "E159: ȱÉÙ sign number"
+
+#: ex_cmds.c:5336
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: »º³åÇøÃû³Æ´íÎó: %s"
+
+#: ex_cmds.c:5375
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Sign ID ´íÎó: %ld"
+
+#: ex_cmds.c:5546
+msgid "[Deleted]"
+msgstr "[ÒÑɾ³ý]"
+
+#: ex_docmd.c:491
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "½øÈë Ex ģʽ. ÊäÈë \"visua\" ÒԻص½Õý³£Ä£Ê½."
+
+#. must be at EOF
+#: ex_docmd.c:527
+msgid "At end-of-file"
+msgstr "Òѵ½Îļþ½áβ"
+
+#: ex_docmd.c:602
+msgid "E169: Command too recursive"
+msgstr "E169: ÃüÁîµÝ¹é²ãÊý¹ý¶à"
+
+#: ex_docmd.c:911
+msgid "E170: Missing :endwhile"
+msgstr "E170: ȱÉÙ :endwhile"
+
+#: ex_docmd.c:913
+msgid "E171: Missing :endif"
+msgstr "E171: ȱÉÙ :endif"
+
+#: ex_docmd.c:923
+msgid "End of sourced file"
+msgstr "ÃüÁîÎļþ½áÊø"
+
+#: ex_docmd.c:924
+msgid "End of function"
+msgstr "º¯Êý½áβ"
+
+#: ex_docmd.c:1344
+msgid "Ambiguous use of user-defined command"
+msgstr "Óû§¶¨ÒåµÄÃüÁî»á»ìÏý"
+
+#: ex_docmd.c:1358
+msgid "Not an editor command"
+msgstr "²»ÊDZ༭Æ÷µÄÃüÁî"
+
+#: ex_docmd.c:1441
+msgid "Don't panic!"
+msgstr "²»Òª¾ª»Å!"
+
+#: ex_docmd.c:1460
+msgid "Backwards range given"
+msgstr "Ö¸¶¨ÁËÏòÇ°²Î¿¼µÄ·¶Î§"
+
+#: ex_docmd.c:1469
+msgid "Backwards range given, OK to swap"
+msgstr "Ö¸¶¨ÁËÏòÇ°²Î¿¼µÄ·¶Î§£¬OK to swap"
+
+#: ex_docmd.c:1580
+msgid "Use w or w>>"
+msgstr "ÇëʹÓà w »ò w>>"
+
+#: ex_docmd.c:3086
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ±§Ç¸, ±¾ÃüÁîÔÚ´Ë°æ±¾ÖÐδʵÏÖ"
+
+#: ex_docmd.c:3256
+msgid "E172: Only one file name allowed"
+msgstr "E172: Ö»ÄÜÓÐÒ»¸öÎļþÃû"
+
+#: ex_docmd.c:3810
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "»¹ÓÐ %d ¸öÎļþδ±à¼­. È·¶¨ÒªÍ˳ö£¿"
+
+#: ex_docmd.c:3817
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: »¹ÓÐ %ld ¸öÎļþδ±à¼­"
+
+#: ex_docmd.c:3911
+msgid "E174: Command already exists: use ! to redefine"
+msgstr "E174: ÃüÁîÒѾ­´æÔÚ, ÇëʹÓà ! Ç¿ÖÆÖØж¨Òå"
+
+#: ex_docmd.c:4016
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" Ãû³Æ ²ÎÊý ·¶Î§ ÍêÕû ¶¨Òå "
+
+#: ex_docmd.c:4105
+msgid "No user-defined commands found"
+msgstr "ÕÒ²»µ½Óû§×Ô¶¨ÒåµÄÃüÁî"
+
+#: ex_docmd.c:4136
+msgid "E175: No attribute specified"
+msgstr "E175: ûÓÐÖ¸¶¨µÄÊôÐÔ"
+
+#: ex_docmd.c:4188
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ²»ÕýÈ·µÄ²ÎÊý¸öÊý"
+
+#: ex_docmd.c:4203
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ²»ÄÜÖ¸¶¨Á½´Î"
+
+#: ex_docmd.c:4213
+msgid "E178: Invalid default value for count"
+msgstr "E178: ¼ÆÊýµÄȱʡֵ²»ÕýÈ·"
+
+#: ex_docmd.c:4241
+msgid "E179: argument required for complete"
+msgstr "E179: Ö¸ÁîÐèÒª²ÎÊý²ÅÄÜÍê³É"
+
+#: ex_docmd.c:4260
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ²»ÍêÕûµÄÖµ: '%s'"
+
+#: ex_docmd.c:4268
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ²»ÕýÈ·µÄÊôÐÔ: %s"
+
+#: ex_docmd.c:4309
+msgid "E182: Invalid command name"
+msgstr "E182: ÃüÁîÃû³Æ²»ÕýÈ·"
+
+#: ex_docmd.c:4324
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: Óû§×Ô¶¨ÒåÃüÁî±ØÐëÒÔ´óд×Öĸ¿ªÊ¼"
+
+#: ex_docmd.c:4393
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ûÓÐÓû§×Ô¶¨ÒåµÄÃüÁ %s"
+
+#: ex_docmd.c:4844
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: ÕÒ²»µ½ÑÕÉ«Ñùʽ %s"
+
+#: ex_docmd.c:4852
+msgid "Greetings, Vim user!"
+msgstr "ÄãºÃ, Vim Óû§£¡"
+
+#: ex_docmd.c:5549
+msgid "Edit File in new window"
+msgstr "ÔÚд°¿Ú±à¼­Îļþ"
+
+#: ex_docmd.c:5815
+msgid "No swap file"
+msgstr "ÎÞ½»»»Îļþ"
+
+#: ex_docmd.c:5919
+msgid "Append File"
+msgstr "¸½¼ÓÎļþ"
+
+#: ex_docmd.c:5978
+msgid "E186: No previous directory"
+msgstr "E186: Ç°Ò»¸öĿ¼²»´æÔÚ"
+
+#: ex_docmd.c:6055
+msgid "E187: Unknown"
+msgstr "E187: ²»ÄÜʶ±ðµÄ±ê¼Ç"
+
+#: ex_docmd.c:6173
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "´°¿ÚλÖÃ: X %d, Y %d"
+
+#: ex_docmd.c:6178
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: ÔÚÄúµÄƽ̨Éϲ»ÄÜ»ñµÃ´°¿ÚλÖÃ"
+
+#: ex_docmd.c:6444
+msgid "Save Redirection"
+msgstr "±£´æÖض¨Ïò"
+
+#: ex_docmd.c:6593
+msgid "Save View"
+msgstr "±£´æÊÓͼ"
+
+#: ex_docmd.c:6594
+msgid "Save Session"
+msgstr "±£´æ»á»°"
+
+#: ex_docmd.c:6596
+msgid "Save Setup"
+msgstr "±£´æÉ趨"
+
+#: ex_docmd.c:6745
+#, c-format
+msgid "E189: \"%s\" exists (use ! to override)"
+msgstr "E189: \"%s\" ÒÑ´æÔÚ (ÇëÓÃ ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: ex_docmd.c:6750
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: ²»ÄÜÒÔдÈëģʽ´ò¿ª \"%s\""
+
+#. set mark
+#: ex_docmd.c:6774
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: ²ÎÊý±ØÐëÊÇÓ¢ÎÄ×Öĸ»òÏòÇ°/ºóµÄÒýºÅ"
+
+#: ex_docmd.c:6803
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal µÝ¹é²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7171
+msgid ":if nesting too deep"
+msgstr ":if ²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7206
+msgid ":endif without :if"
+msgstr ":endif ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7226
+msgid ":else without :if"
+msgstr ":else ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7228
+msgid ":elseif without :if"
+msgstr ":elseif ȱÉÙ¶ÔÓ¦µÄ :if"
+
+#: ex_docmd.c:7280
+msgid ":while nesting too deep"
+msgstr ":while ²ãÊý¹ýÉî"
+
+#: ex_docmd.c:7326
+msgid ":continue without :while"
+msgstr ":continue ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7353
+msgid ":break without :while"
+msgstr ":break ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7376 ex_docmd.c:7381
+msgid ":endwhile without :while"
+msgstr ":endwhile ȱÉÙ¶ÔÓ¦µÄ :while"
+
+#: ex_docmd.c:7402
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction ±ØÐëÔÚº¯ÊýÄÚ²¿Ê¹ÓÃ"
+
+#: ex_docmd.c:7582
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: ûÓÐ '#' ¿ÉÌæ´úµÄÎļþÃû"
+
+#: ex_docmd.c:7613
+msgid "no autocommand file name to substitute for \"<afile>\""
+msgstr "ûÓÐ Autocommand ÎļþÃûÒÔÌæ»» \"<afile>\""
+
+#: ex_docmd.c:7621
+msgid "no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "ûÓÐ Autocommand »º³åÇøÃû³ÆÒÔÌæ»» \"<abuf>\""
+
+#: ex_docmd.c:7632
+msgid "no autocommand match name to substitute for \"<amatch>\""
+msgstr "ûÓÐ Autocommand Match name ÒÔÌæ»» \"<amatch>\""
+
+#: ex_docmd.c:7642
+msgid "no :source file name to substitute for \"<sfile>\""
+msgstr "ûÓÐ :source ÎļþÃûÒÔÌæ»» \"<sfile>\""
+
+#: ex_docmd.c:7683
+#, no-c-format
+msgid "Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "'%' »ò '#' Ö¸Ïò¿ÕÎļþÃû£¬Ö»ÄÜÓÃì¶ \":p:h\""
+
+#: ex_docmd.c:7685
+msgid "Evaluates to an empty string"
+msgstr "ÊäÈëΪ¿Õ×Ö·û´®"
+
+#: ex_docmd.c:8594
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: ²»ÄܶÁÈ¡ viminfo"
+
+#: ex_docmd.c:8767
+msgid "E196: No digraphs in this version"
+msgstr "E196: ±¾°æ±¾ÎÞ¸´ºÏ×Ö·û(digraph)"
+
+#: ex_getln.c:2785
+msgid "tagname"
+msgstr "±êÇ©Ãû³Æ"
+
+#: ex_getln.c:2788
+msgid " kind file\n"
+msgstr "ÀàÎļþ\n"
+
+#: ex_getln.c:3997
+msgid "'history' option is zero"
+msgstr "Ñ¡Ïî 'history' ÊÇÁã"
+
+#: ex_getln.c:4237
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s ÀúÊ·¼Ç¼ (´Óе½¾É):\n"
+
+#: ex_getln.c:4238
+msgid "Command Line"
+msgstr "ÃüÁîÐÐ"
+
+#: ex_getln.c:4239
+msgid "Search String"
+msgstr "²éÕÒ×Ö·û´®"
+
+#: ex_getln.c:4240
+msgid "Expression"
+msgstr "±í´ïʽ"
+
+#: ex_getln.c:4241
+msgid "Input Line"
+msgstr "ÊäÈëÐÐ"
+
+#: ex_getln.c:4271
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ³¬¹ýÃüÁ¶È"
+
+#: ex_getln.c:4435
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: ÒÑɾ³ý»î¶¯´°¿Ú»ò»º´æ"
+
+#: fileio.c:347
+msgid "Illegal file name"
+msgstr "²»ÕýÈ·µÄÎļþÃû"
+
+#: fileio.c:371 fileio.c:495 fileio.c:2491 fileio.c:2529
+msgid "is a directory"
+msgstr "ÊÇĿ¼"
+
+#: fileio.c:373
+msgid "is not a file"
+msgstr "²»ÊÇÎļþ"
+
+#: fileio.c:515 fileio.c:3581
+msgid "[New File]"
+msgstr "[δÃüÃû]"
+
+#: fileio.c:532
+msgid "[Permission Denied]"
+msgstr "[ȨÏÞ²»×ã]"
+
+#: fileio.c:624
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Autocommand ʹ³ÌÐò²»ÄܶÁÈ¡´ËÎļþ"
+
+#: fileio.c:626
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *Filter* Autocommand ²»¿ÉÒÔ¸ü¸Ä»º³åÇøµÄÄÚÈÝ"
+
+#: fileio.c:646
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: ´Ó±ê×¼ÊäÈë¶ÁÈ¡...\n"
+
+#: fileio.c:652
+msgid "Reading from stdin..."
+msgstr "´Ó±ê×¼ÊäÈë¶Á..."
+
+#. Re-opening the original file failed!
+#: fileio.c:876
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: ת»»´íÎó"
+
+#: fileio.c:1732
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1739
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1746
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1754
+msgid "[RO]"
+msgstr "[Ö»¶Á]"
+
+#: fileio.c:1764
+msgid "[CR missing]"
+msgstr "[ȱÉÙCR]'"
+
+#: fileio.c:1769
+msgid "[NL found]"
+msgstr "[ÕÒµ½NL]"
+
+#: fileio.c:1774
+msgid "[long lines split]"
+msgstr "[·Ö¸î¹ý³¤ÐÐ]"
+
+#: fileio.c:1780 fileio.c:3565
+msgid "[NOT converted]"
+msgstr "[δת»»]"
+
+#: fileio.c:1785 fileio.c:3570
+msgid "[converted]"
+msgstr "[ÒÑת»»]"
+
+#: fileio.c:1792 fileio.c:3595
+msgid "[crypted]"
+msgstr "[ÒѼÓÃÜ]"
+
+#: fileio.c:1799
+msgid "[CONVERSION ERROR]"
+msgstr "ת»»´íÎó"
+
+#: fileio.c:1806
+msgid "[READ ERRORS]"
+msgstr "[¶Á´íÎó]"
+
+#: fileio.c:2013
+msgid "Can't find temp file for conversion"
+msgstr "ÕÒ²»µ½×ª»»ÓõÄÁÙʱÎļþ"
+
+#: fileio.c:2020
+msgid "Conversion with 'charconvert' failed"
+msgstr "×Ö·û¼¯×ª»»´íÎó"
+
+#: fileio.c:2023
+msgid "can't read output of 'charconvert'"
+msgstr "²»ÄܶÁÈ¡ 'charconvert' µÄÊä³ö"
+
+#: fileio.c:2407
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autocommand ɾ³ý»òÊÍ·ÅÁËҪдÈëµÄ»º³åÇø"
+
+#: fileio.c:2430
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand ÒâÍâµØ¸Ä±äÁËÐкÅ"
+
+#: fileio.c:2496 fileio.c:2513
+msgid "is not a file or writable device"
+msgstr "²»ÊÇÎļþ»ò¿ÉдµÄÉ豸"
+
+#: fileio.c:2555
+msgid "is read-only (use ! to override)"
+msgstr "ÊÇÖ»¶ÁÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2851
+msgid "Can't write to backup file (use ! to override)"
+msgstr "²»ÄÜд±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2863
+msgid "Close error for backup file (use ! to override)"
+msgstr "¹Ø±Õ±¸·ÝÎļþ³ö´í (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2865
+msgid "Can't read file for backup (use ! to override)"
+msgstr "²»ÄܶÁÈ¡ÎļþÒÔ¹©±¸·Ý (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2881
+msgid "Cannot create backup file (use ! to override)"
+msgstr "²»ÄÜ´´½¨±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:2970
+msgid "Can't make backup file (use ! to override)"
+msgstr "²»ÄÜ×÷±¸·ÝÎļþ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:3032
+msgid "The resource fork will be lost (use ! to override)"
+msgstr "Resource fork »áÏûʧ (ÇëʹÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: fileio.c:3121
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: ÕÒ²»µ½Ð´ÈëÓõĽ»»»Îļþ"
+
+#: fileio.c:3139
+msgid "E213: Cannot convert (use ! to write without conversion)"
+msgstr "E213: ²»ÄÜת»» (ÇëʹÓà ! Ç¿ÖƲ»×ª»»Ð´Èë)"
+
+#: fileio.c:3176
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: ²»ÄÜÒÔдÈëģʽ´ò¿ªÁ´½ÓÎļþ"
+
+#: fileio.c:3180
+msgid "E212: Can't open file for writing"
+msgstr "E212: ²»ÄÜÒÔдÈëģʽ´ò¿ª"
+
+#: fileio.c:3423
+msgid "Close failed"
+msgstr "¹Ø±Õʧ°Ü"
+
+#: fileio.c:3481
+msgid "write error, conversion failed"
+msgstr "²»ÄÜдÈë -- ת»»Ê§°Ü"
+
+#: fileio.c:3487
+msgid "write error (file system full?)"
+msgstr "дÈë´íÎó (ÎļþϵͳÒÑÂú£¿)"
+
+#: fileio.c:3560
+msgid " CONVERSION ERROR"
+msgstr "ת»»´íÎó"
+
+#: fileio.c:3576
+msgid "[Device]"
+msgstr "[É豸]"
+
+#: fileio.c:3581
+msgid "[New]"
+msgstr "[ÐÂ]"
+
+#: fileio.c:3603
+msgid " [a]"
+msgstr "[a]"
+
+#: fileio.c:3603
+msgid " appended"
+msgstr " ÒѸ½¼Ó"
+
+#: fileio.c:3605
+msgid " [w]"
+msgstr "[w]"
+
+#: fileio.c:3605
+msgid " written"
+msgstr " ÒÑдÈë"
+
+#: fileio.c:3655
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patch ģʽ: ²»ÄÜ´¢´æԭʼÎļþ"
+
+#: fileio.c:3677
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Patch ģʽ: ²»Äܸıä¿ÕµÄԭʼÎļþ"
+
+#: fileio.c:3692
+msgid "E207: Can't delete backup file"
+msgstr "E207: ²»ÄÜɾ³ý±¸·ÝÎļþ"
+
+#: fileio.c:3744
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"¾¯¸æ: ԭʼÎļþ¶ªÊ§»òËð»µ\n"
+
+#: fileio.c:3746
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "ÔÚÎļþÕýȷдÈëÇ°ÇëÎðÍ˳ö±à¼­Æ÷!"
+
+#: fileio.c:3826
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:3826
+msgid "[dos format]"
+msgstr "[dos ¸ñʽ]"
+
+#: fileio.c:3833
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:3833
+msgid "[mac format]"
+msgstr "[mac ¸ñʽ]"
+
+#: fileio.c:3840
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:3840
+msgid "[unix format]"
+msgstr "[unix ¸ñʽ]"
+
+#: fileio.c:3867
+msgid "1 line, "
+msgstr "1 ÐÐ, "
+
+#: fileio.c:3869
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ÐÐ, "
+
+#: fileio.c:3872
+msgid "1 character"
+msgstr "Ò»¸ö×Ö·û"
+
+#: fileio.c:3874
+#, c-format
+msgid "%ld characters"
+msgstr "%ld¸ö×Ö·û"
+
+#: fileio.c:3884
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:3884
+msgid "[Incomplete last line]"
+msgstr "[×îºóÒ»Ðв»ÍêÕû]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:3903
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "¾¯¸æ: ±¾Îļþ×ÔÉϴζÁÈëºóÒѱ䶯!!!"
+
+#: fileio.c:3905
+msgid "Do you really want to write to it"
+msgstr "È·¶¨ÒªÐ´ÈëÂð"
+
+#: fileio.c:4861
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: дÈëÎļþ \"%s\" ´íÎó"
+
+#: fileio.c:4868
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: ¹Ø±ÕÎļþ \"%s\" ´íÎó"
+
+#: fileio.c:4871
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: ¶ÁÈ¡Îļþ \"%s\" ´íÎó"
+
+#: fileio.c:5035
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand ɾ³ý»º³åÇø"
+
+#: fileio.c:5043
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: ¾¯¸æ: Îļþ \"%s\" ÒѾ­²»´æÔÚ"
+
+#: fileio.c:5056
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѱ䶯, ¶øÇұ༭ÖеĻº³åÇøÒ²¸ü¶¯ÁË"
+
+#: fileio.c:5059
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѸıä"
+
+#: fileio.c:5061
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: ¾¯¸æ: Îļþ \"%s\" ×ÔÉϴζÁÈëºóÒѸıä"
+
+#: fileio.c:5071
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: ¾¯¸æ: Îļþ \"%s\" ÔÚ¿ªÊ¼±à¼­ºóÓÖ±»´´½¨ÁË"
+
+#: fileio.c:5088
+msgid "Warning"
+msgstr "¾¯¸æ"
+
+#: fileio.c:5089
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"È·¶¨(&O)\n"
+"¼ÓÔØÎļþ(&L)"
+
+#: fileio.c:5165
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: ²»ÄÜÖØмÓÔØ \"%s\""
+
+#: fileio.c:5670
+msgid "--Deleted--"
+msgstr "--ÒÑɾ³ý--"
+
+#. the group doesn't exist
+#: fileio.c:5830
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: ×é²»´æÔÚ: \"%s\""
+
+#: fileio.c:5955
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * ºóÃæÓв»ÕýÈ·µÄ×Ö·û: %s"
+
+#: fileio.c:5966
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: ÎÞ´Ëʼþ: %s"
+
+#. Highlight title
+#: fileio.c:6115
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:6386
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: ²»ÄܶÔËùÓÐʼþÖ´ÐÐ autocommand"
+
+#: fileio.c:6409
+msgid "No matching autocommands"
+msgstr "ÕÒ²»µ½¶ÔÓ¦µÄ autocommand"
+
+#: fileio.c:6681
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand ²ãÊý¹ýÉî"
+
+#: fileio.c:6968
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands: \"%s\""
+
+#: fileio.c:6976
+#, c-format
+msgid "Executing %s"
+msgstr "Ö´ÐÐ %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7044
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:7566
+msgid "E219: Missing {."
+msgstr "E219: ȱÉÙ {."
+
+#: fileio.c:7568
+msgid "E220: Missing }."
+msgstr "E220: ȱÉÙ }."
+
+#: fold.c:66
+msgid "No fold found"
+msgstr "ÕÒ²»µ½ÈκΠfold"
+
+#: fold.c:554
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' Ï´´½¨ fold"
+
+#: fold.c:556
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' ÏÂɾ³ý fold"
+
+#: fold.c:1700
+msgid "E221: 'commentstring' is empty"
+msgstr "E221: Ñ¡Ïî 'commentstring' δÉ趨"
+
+#: getchar.c:268
+msgid "E222: Add to read buffer"
+msgstr "E222: ¼ÓÈë¶Á»º³åÖÐ"
+
+#: getchar.c:2114
+msgid "E223: recursive mapping"
+msgstr "E223: µÝ¹é mapping"
+
+#: getchar.c:2966
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s ÒѾ­ÓÐÈ«¾Ö abbreviation ÁË"
+
+#: getchar.c:2969
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s ÒѾ­ÓÐÈ«¾Ö mapping ÁË"
+
+#: getchar.c:3096
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ÒѾ­ÓÐ abbreviation ÁË"
+
+#: getchar.c:3099
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s µÄ mapping ÒѾ­´æÔÚ"
+
+#: getchar.c:3163
+msgid "No abbreviation found"
+msgstr "ÕÒ²»µ½Ëõд"
+
+#: getchar.c:3165
+msgid "No mapping found"
+msgstr "ûÓÐÕâ¸ö¶ÔÓ¦"
+
+#: getchar.c:3990
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ²»ÕýÈ·µÄģʽ"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<²»ÄÜ´ò¿ª>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "vim_SelFile: can't get font %s"
+msgstr "vim_SelFile: ²»ÄÜʹÓà %s ×ÖÌå"
+
+#: gui_at_fs.c:2535
+msgid "vim_SelFile: can't return to current directory"
+msgstr "vim_SelFile: ²»Äܻص½Ä¿Ç°Ä¿Â¼"
+
+#: gui_at_fs.c:2554
+msgid "Pathname:"
+msgstr "·¾¶:"
+
+#: gui_at_fs.c:2560
+msgid "vim_SelFile: can't get current directory"
+msgstr "vim_SelFile: ²»ÄÜÈ¡µÃĿǰĿ¼"
+
+#: gui_at_fs.c:2568 gui_motif.c:1607
+msgid "OK"
+msgstr "È·¶¨"
+
+#. 'Cancel' button
+#: gui_at_fs.c:2568 gui_gtk.c:1683 gui_motif.c:1602 gui_motif.c:2823
+msgid "Cancel"
+msgstr "È¡Ïû"
+
+#: gui_athena.c:1928 gui_motif.c:1855
+msgid "Vim dialog"
+msgstr "Vim ¶Ô»°¿ò"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "¹ö¶¯Ìõ: ²»ÄÜÉ趨 thumb pixmap µÄλÖÃ"
+
+#: gui_beval.c:68
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ²»ÄܶÔÐÅÏ¢Óë callback ´´½¨ BallonEval"
+
+#: gui.c:181
+msgid "E229: Cannot start the GUI"
+msgstr "E229: ²»ÄÜÆô¶¯Í¼ÐͽçÃæ"
+
+#: gui.c:306
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: ²»ÄܶÁÈ¡Îļþ \"%s\""
+
+#: gui.c:431
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ²»ÕýÈ·µÄ 'guifontwide'"
+
+#: gui.c:3919
+msgid "Error"
+msgstr "´íÎó"
+
+#: gui.c:3920
+msgid "&Ok"
+msgstr "È·¶¨(&O)"
+
+#: gui_gtk.c:1144
+msgid "Vim dialog..."
+msgstr "Vim ¶Ô»°¿ò..."
+
+#: gui_gtk.c:1519 gui_motif.c:2742
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ²éÕÒÓëÌæ»»..."
+
+#: gui_gtk.c:1524 gui_motif.c:2744
+msgid "VIM - Search..."
+msgstr "VIM - ²éÕÒ..."
+
+#: gui_gtk.c:1547 gui_motif.c:2862
+msgid "Find what:"
+msgstr "²éÕÒ:"
+
+#: gui_gtk.c:1565 gui_motif.c:2894
+msgid "Replace with:"
+msgstr "Ì滻Ϊ:"
+
+#. exact match only button
+#: gui_gtk.c:1597 gui_motif.c:2996
+msgid "Match exact word only"
+msgstr "ֻƥÅäÍêÈ«ÏàͬµÄ×Ö"
+
+#: gui_gtk.c:1609 gui_motif.c:2964
+msgid "Direction"
+msgstr "·½Ïò"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:1621 gui_motif.c:2976
+msgid "Up"
+msgstr "ÏòÉÏ"
+
+#: gui_gtk.c:1625 gui_motif.c:2984
+msgid "Down"
+msgstr "ÏòÏÂ"
+
+#. 'Find Next' button
+#: gui_gtk.c:1647 gui_motif.c:2766
+msgid "Find Next"
+msgstr "ÕÒÏÂÒ»¸ö"
+
+#. 'Replace' button
+#: gui_gtk.c:1664 gui_motif.c:2783
+msgid "Replace"
+msgstr "Ìæ»»"
+
+#. 'Replace All' button
+#: gui_gtk.c:1673 gui_motif.c:2796
+msgid "Replace All"
+msgstr "Ì滻ȫ²¿"
+
+#: gui_gtk_x11.c:1076 gui_x11.c:1194
+msgid "E233: cannot open display"
+msgstr "E233: <²»ÄÜ´ò¿ª X Server DISPLAY>"
+
+#: gui_gtk_x11.c:2433 gui_x11.c:1997
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ²»ÕýÈ·µÄ×Ö·û¼¯ (Fontset): %s"
+
+#: gui_gtk_x11.c:2460
+msgid "Font Selection"
+msgstr "×ÖÌåÑ¡Ôñ"
+
+#: gui_gtk_x11.c:2702 gui_mac.c:2780 gui_w48.c:1197 gui_x11.c:1833
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "²»ÕýÈ·µÄ×ÖÌåÃû³Æ: %s"
+
+#: gui_gtk_x11.c:2713 gui_x11.c:1857
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: \"%s\" ²»Êǹ̶¨¿í¶È×ÖÌå"
+
+#: gui_gtk_x11.c:2843
+#, c-format
+msgid "E242: Color name not recognized: %s"
+msgstr "E242: %s Ϊ²»ÄÜʶ±ðµÄÑÕÉ«Ãû³Æ"
+
+#: gui_gtk_x11.c:3519 ui.c:1929
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "ʹÓà CUT_BUFFER0 À´Ìæ»»¿ÕÑ¡Ôñ"
+
+#: gui_motif.c:1601 gui_motif.c:1604
+msgid "Filter"
+msgstr "¹ýÂËÆ÷"
+
+#: gui_motif.c:1603
+msgid "Directories"
+msgstr "Ŀ¼"
+
+#: gui_motif.c:1605
+msgid "Help"
+msgstr "°ïÖú"
+
+#: gui_motif.c:1606
+msgid "Files"
+msgstr "Îļþ"
+
+#: gui_motif.c:1608
+msgid "Selection"
+msgstr "Ñ¡Ôñ"
+
+#: gui_motif.c:2809
+msgid "Undo"
+msgstr "³·Ïû"
+
+#: gui_riscos.c:951
+#, c-format
+msgid "E235: Can't load Zap font '%s'"
+msgstr "E235: ²»ÄÜ´ò¿ª Zap ×ÖÌå '%s'"
+
+#: gui_riscos.c:1047
+#, c-format
+msgid "E235: Can't use font %s"
+msgstr "E235: ²»ÄÜʹÓÃ×ÖÌå %s"
+
+#: gui_riscos.c:1167
+#, c-format
+msgid "E242: Missing color: %s"
+msgstr "E242: ÕÒ²»µ½ÑÕÉ«: %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"ÕýÔÚ·¢ËÍÖжÏ×Ó³ÌÐòµÄÐÅÏ¢.\n"
+
+#: gui_w32.c:823
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ²»Ö§³Ö²ÎÊý \"-%s\"¡£ÇëÓà OLE °æ±¾¡£"
+
+#: gui_w48.c:2068
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "²éÕÒ×Ö·û´® (ʹÓà '\\\\' À´±íʾ '\\')"
+
+#: gui_w48.c:2093
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "²éÕÒ¼°Ìæ»»×Ö·û´® (ʹÓà '\\\\' À´±íʾ '\\')"
+
+#: gui_x11.c:1414
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: ²»ÄÜÅäÖà color map ¶ÔÏó£¬ÓÐЩÑÕÉ«¿´ÆðÀ´»á¹Ö¹ÖµÄ"
+
+#: gui_x11.c:1987
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Fontset %s ûÓÐÉ趨ÕýÈ·µÄ×ÖÌåÒÔ¹©ÏÔʾÕâЩ×Ö·û¼¯:"
+
+#: gui_x11.c:2030
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ×ÖÌ弯(Fontset)Ãû³Æ: %s"
+
+#: gui_x11.c:2031
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "'%s' ²»Êǹ̶¨¿í¶È×ÖÌå"
+
+#: gui_x11.c:2050
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ×ÖÌ弯(Fontset)Ãû³Æ: %s\n"
+
+#: gui_x11.c:2051
+#, c-format
+msgid "Font0: %s\n"
+msgstr "×ÖÌå0: %s\n"
+
+#: gui_x11.c:2052
+#, c-format
+msgid "Font1: %s\n"
+msgstr "×ÖÌå1: %s\n"
+
+#: gui_x11.c:2053
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "×ÖÌå%d¿í¶È²»ÊÇ×ÖÌå0µÄÁ½±¶\n"
+
+#: gui_x11.c:2054
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "×ÖÌå0µÄ¿í¶È£º%ld\n"
+
+#: gui_x11.c:2055
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"×ÖÌå1¿í¶È: %ld\n"
+"\n"
+
+#: gui_x11.c:2201
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: ²»ÄÜÅäÖÃÑÕÉ« %s"
+
+#: gui_x11.c:3250
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: ²»ÄܶÁÈ¡ sign data!"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata ´íÎó"
+
+#: if_cscope.c:26
+#, c-format
+msgid "Usage: cs[cope] %s"
+msgstr ""
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "ÐÂÔöÊý¾Ý¿â"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "²éѯģʽ"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "ÏÔʾ´ËÐÅÏ¢"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "½áÊøÁ¬½Ó"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "ÖØÉèËùÓÐÁ¬½Ó"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "ÏÔʾÁ¬½Ó"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "Õâ¸ö cscope ÃüÁî²»Ö§³Ö·Ö¸îÆÁÄ»\n"
+
+#: if_cscope.c:143
+msgid "Usage: cstag <ident>"
+msgstr "Ó÷¨: cstag <ʶ±ð×Ö>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: ÕÒ²»µ½ tag"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "stat(%s) error: %d"
+msgstr "stat(%s) ´íÎó: %d"
+
+#: if_cscope.c:460 if_cscope.c:467
+#, c-format
+msgid "Added cscope database %s"
+msgstr "ÐÂÔö cscope Êý¾Ý¿â %s"
+
+#: if_cscope.c:474
+#, c-format
+msgid "%s is not a directory or a valid cscope database"
+msgstr "%s ²»ÊÇĿ¼»ò cscope Êý¾Ý¿â"
+
+#: if_cscope.c:557
+#, c-format
+msgid "error reading cscope connection %d"
+msgstr "¶ÁÈ¡ cscope Á¬½Ó %d ʱ´íÎó"
+
+#: if_cscope.c:633
+msgid "unknown cscope search type"
+msgstr "δ֪µÄ cscope ²éÕÒÐÎ̬"
+
+#: if_cscope.c:680
+msgid "Could not create cscope pipes"
+msgstr "²»ÄÜ´´½¨Óë cscope Á¬½ÓµÄ¹ÜµÀ"
+
+#: if_cscope.c:745
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection Ö´ÐÐʧ°Ü"
+
+#: if_cscope.c:755
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen ʧ°Ü (to_fp)"
+
+#: if_cscope.c:757
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen ʧ°Ü (fr_fp)"
+
+#: if_cscope.c:785
+msgid "no cscope connections"
+msgstr "ûÓÐ cscope Á¬½Ó"
+
+#: if_cscope.c:855
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: ÕÒ²»µ½·ûºÏ cscope µÄËÑÑ° %s / %s"
+
+#: if_cscope.c:899
+msgid "cscope commands:\n"
+msgstr "cscope ÃüÁî:\n"
+
+#: if_cscope.c:902
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (Ó÷¨: %s)\n"
+
+#: if_cscope.c:970
+msgid "duplicate cscope database not added"
+msgstr "Öظ´µÄ cscope Êý¾Ý¿âδ±»¼ÓÈë"
+
+#: if_cscope.c:981
+msgid "maximum number of cscope connections reached"
+msgstr "ÒÑ´ïµ½ cscope ×î´óÁ¬½ÓÊýÄ¿"
+
+#: if_cscope.c:1102
+msgid "E260: cscope connection not found"
+msgstr "E260: ÕÒ²»µ½ cscope Á¬½Ó"
+
+#: if_cscope.c:1105
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: ÕÒ²»µ½ cscope Á¬½Ó %s"
+
+#: if_cscope.c:1141
+msgid "cscope connection closed"
+msgstr "cscope Á¬½ÓÒѹرÕ"
+
+#: if_cscope.c:1149
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope Á¬½Ó %s ÒѹرÕ\n"
+
+#. should not reach here
+#: if_cscope.c:1290
+msgid "fatal error in cs_manage_matches"
+msgstr "cs_manage_matches ÑÏÖØ´íÎó"
+
+#: if_cscope.c:1341
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: ¶ÁÈ¡ cscope Á¬½Ó %d ´íÎó"
+
+#: if_cscope.c:1449
+msgid "couldn't malloc\n"
+msgstr "²»ÄÜʹÓà malloc\n"
+
+#: if_cscope.c:1454
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope ±êÇ©(tag): %s\n"
+
+#: if_cscope.c:1458
+msgid " # line"
+msgstr " # ÐÐ "
+
+#: if_cscope.c:1460
+msgid "filename / context / line\n"
+msgstr "ÎļþÃû / ÉÏÏÂÎÄ / ÐкÅ\n"
+
+#: if_cscope.c:1718
+msgid "All cscope databases reset"
+msgstr "ÖØÉèËùÓÐ cscope Êý¾Ý¿â"
+
+#: if_cscope.c:1785
+msgid "no cscope connections\n"
+msgstr "ûÓÐ cscope Á¬½Ó\n"
+
+#: if_cscope.c:1789
+msgid " # pid database name prepend path\n"
+msgstr " # pid Êý¾Ý¿âÃû³Æ prepend path\n"
+
+#: if_cscope.c:1800
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <ÎÞ>\n"
+
+#: if_python.c:376
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: ±§Ç¸£¬Õâ¸öÃüÁî²»ÄÜʹÓã¬Python ³ÌÐò¿âûÓмÓÔØ¡£"
+
+#: if_python.c:576
+msgid "can't delete OutputObject attributes"
+msgstr "²»ÄÜɾ³ý OutputObject ÊôÐÔ"
+
+#: if_python.c:583
+msgid "softspace must be an integer"
+msgstr "softspace ±ØÐèÊÇÕûÊý"
+
+#: if_python.c:591
+msgid "invalid attribute"
+msgstr "²»ÕýÈ·µÄÊôÐÔ"
+
+#: if_python.c:630 if_python.c:644
+msgid "writelines() requires list of strings"
+msgstr "writelines() ÐèÒª string list µ±²ÎÊý"
+
+#: if_python.c:770
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: ²»Äܳõʼ»¯ I/O ¶ÔÏó"
+
+#: if_python.c:955 if_tcl.c:1391
+msgid "invalid expression"
+msgstr "²»ÕýÈ·µÄ±í´ïʽ"
+
+#: if_python.c:969 if_tcl.c:1396
+msgid "expressions disabled at compile time"
+msgstr "ÒòΪ±àÒëʱûÓмÓÈë±í´ïʽ(expression)µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓñí´ïʽ"
+
+#: if_python.c:982
+msgid "attempt to refer to deleted buffer"
+msgstr "ÊÔͼʹÓÃÒѱ»É¾³ýµÄ»º³åÇø"
+
+#: if_python.c:997 if_python.c:1038 if_python.c:1102 if_tcl.c:1203
+msgid "line number out of range"
+msgstr "Ðкų¬³ö·¶Î§"
+
+#: if_python.c:1235
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer ¶ÔÏó (ÒÑɾ³ý): %8lX>"
+
+#: if_python.c:1326 if_tcl.c:825
+msgid "invalid mark name"
+msgstr "±ê¼ÇÃû³Æ²»ÕýÈ·"
+
+#: if_python.c:1601
+msgid "no such buffer"
+msgstr "ÎÞ´Ë»º³åÇø"
+
+#: if_python.c:1689
+msgid "attempt to refer to deleted window"
+msgstr "ÊÔͼʹÓÃÒѱ»É¾³ýµÄ´°¿Ú"
+
+#: if_python.c:1734
+msgid "readonly attribute"
+msgstr "Ö»¶ÁÊôÐÔ"
+
+#: if_python.c:1747
+msgid "cursor position outside buffer"
+msgstr "¹â±ê¶¨Î»ÔÚ»º³åÇøÖ®Íâ"
+
+#: if_python.c:1824
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<´°¿Ú¶ÔÏó(ÒÑɾ³ý): %.8lX>"
+
+#: if_python.c:1836
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<´°¿Ú¶ÔÏó(δ֪): %.8lX>"
+
+#: if_python.c:1838
+#, c-format
+msgid "<window %d>"
+msgstr "<´°¿Ú %d>"
+
+#: if_python.c:1914
+msgid "no such window"
+msgstr "ÎÞ´Ë´°¿Ú"
+
+#: if_python.c:2144 if_python.c:2175 if_python.c:2225 if_python.c:2285
+#: if_python.c:2402 if_python.c:2454 if_tcl.c:673 if_tcl.c:718 if_tcl.c:792
+#: if_tcl.c:862 if_tcl.c:1987
+msgid "cannot save undo information"
+msgstr "²»Äܱ£´æ¸´Ô­ÐÅÏ¢"
+
+#: if_python.c:2146 if_python.c:2232 if_python.c:2296
+msgid "cannot delete line"
+msgstr "²»ÄÜɾ³ý´ËÐÐ"
+
+#: if_python.c:2177 if_python.c:2312 if_tcl.c:679 if_tcl.c:2009
+msgid "cannot replace line"
+msgstr "²»ÄÜÌæ»»´ËÐÐ"
+
+#: if_python.c:2328 if_python.c:2404 if_python.c:2462
+msgid "cannot insert line"
+msgstr "²»ÄܲåÈë´ËÐÐ"
+
+#: if_python.c:2566
+msgid "string cannot contain newlines"
+msgstr "×Ö·û´®²»ÄÜ°üº¬ÐÂÐÐ"
+
+#: if_ruby.c:394
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: ´ËÃüÁî²»ÄÜʹÓã¬ÎÞ·¨¼ÓÔØ Ruby ³ÌÐò¿â(Library)"
+
+#: if_ruby.c:457
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: δ֪µÄ longjmp ״̬ %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "Çл»ÊµÏÖ/¶¨Òå"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "ÏÔʾ base class of:"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "ÏÔʾ±»¸²¸ÇµÄ³ÉÔ±º¯Êý"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "»Ö¸´: ´ÓÎļþ"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "»Ö¸´: ´Ó¶ÔÏó"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "»Ö¸´: ´ÓËùÓÐÏîÄ¿"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "»Ö¸´"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "ÏÔʾԴ´úÂë: "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "²éÕÒ symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ä¯ÀÀ class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "ÏÔʾ²ã´Î¹ØϵµÄÀà"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "ÏÔʾ restricted ²ã´Î¹ØϵµÄ class"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref ²Î¿¼µ½"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ±»Ë­²Î¿¼:"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ÓÐ"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ±»Ë­Ê¹ÓÃ:"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "ÏÔʾÎļþ: "
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "²úÉúÎļþ: "
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "²»ÄÜÁ¬½Óµ½ SNiFF+¡£Çë¼ì²é»·¾³±äÁ¿ ($PATH Àï±ØÐè¿ÉÒÔÕÒµ½ sniffemacs)\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: ¶ÁÈ¡´íÎó. È¡ÏûÁ¬½Ó"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ Ä¿Ç°"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "δ"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "Á¬½ÓÖÐ"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ²»ÕýÈ·µÄ SNiff+ µ÷ÓÃ: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: Á¬½Óµ½ SNiFF+ ʧ°Ü"
+
+#: if_sniff.c:1010
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: δÁ¬½Óµ½ SNiFF+"
+
+#: if_sniff.c:1019
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: ²»ÊÇ SNiFF+ µÄ»º³åÇø"
+
+#: if_sniff.c:1084
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: дÈë´íÎó¡£½áÊøÁ¬½Ó"
+
+#: if_tcl.c:407
+msgid "invalid buffer number"
+msgstr "²»ÕýÈ·µÄ»º³åÇøºÅ"
+
+#: if_tcl.c:453 if_tcl.c:920 if_tcl.c:1099
+msgid "not implemented yet"
+msgstr "ÉÐδʵÏÖ"
+
+#: if_tcl.c:490
+msgid "unknown option"
+msgstr "²»ÕýÈ·µÄÑ¡Ïî"
+
+#. ???
+#: if_tcl.c:763
+msgid "cannot set line(s)"
+msgstr "²»ÄÜÉ趨ÐÐ"
+
+#: if_tcl.c:834
+msgid "mark not set"
+msgstr "ûÓÐÉ趨±ê¼Ç"
+
+#: if_tcl.c:840 if_tcl.c:1055
+#, c-format
+msgid "row %d column %d"
+msgstr "ÁÐ %d ÐÐ %d"
+
+#: if_tcl.c:870
+msgid "cannot insert/append line"
+msgstr "²»ÄܲåÈë»òÌí¼Ó´ËÐÐ"
+
+#: if_tcl.c:1257
+msgid "unknown flag: "
+msgstr "´íÎóµÄ±êÖ¾: "
+
+#: if_tcl.c:1327
+msgid "unknown vimOption"
+msgstr "²»ÕýÈ·µÄ VIM Ñ¡Ïî"
+
+#: if_tcl.c:1412
+msgid "keyboard interrupt"
+msgstr "¼üÅÌÖжÏ"
+
+#: if_tcl.c:1417
+msgid "vim error"
+msgstr "vim ´íÎó"
+
+#: if_tcl.c:1460
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "²»ÄÜ´´½¨»º³åÇø/´°¿ÚÃüÁî: ¶ÔÏ󽫱»É¾³ý"
+
+#: if_tcl.c:1534
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "²»ÄÜ×¢²á callback ÃüÁî: »º³åÇø/´°¿ÚÒѾ­±»É¾³ýÁË"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1551
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: TCL ÑÏÖØ´íÎó: reflist ²»¿É¿¿!? Ç뱨¸æ¸ø to vim-dev@vim.org"
+
+#: if_tcl.c:1552
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "²»ÄÜ×¢²á callback ÃüÁî: ÕÒ²»µ½»º³åÇø/´°¿Ú"
+
+#: if_tcl.c:1713
+msgid "Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr "´ËÃüÁî²»ÄÜʹÓÃ, ÒòΪÎÞ·¨¼ÓÔØ Tcl ³ÌÐò¿â(Library)"
+
+#: if_tcl.c:1875
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: TCL ´íÎó: Í˳ö·µ»ØÖµ²»ÊÇÕûÊý!? Ç뱨¸æ¸ø to vim-dev@vim.org"
+
+#: if_tcl.c:1995
+msgid "cannot get line"
+msgstr "²»ÄÜÈ¡µÃ´ËÐÐ"
+
+#: if_xcmdsrv.c:204
+msgid "Unable to register a command server name"
+msgstr "²»ÄÜ×¢²áÃüÁî·þÎñÆ÷Ãû³Æ"
+
+#: if_xcmdsrv.c:417
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ûÓÐ×¢²áΪ \"%s\" µÄ·þÎñÆ÷"
+
+#: if_xcmdsrv.c:446
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: ²»ÄÜËͳöÃüÁĿµÄµØ³ÌÐò"
+
+#: if_xcmdsrv.c:709
+#, c-format
+msgid "Invalid server id used: %s"
+msgstr "²»ÕýÈ·µÄ·þÎñÆ÷ id : %s"
+
+#: if_xcmdsrv.c:1056
+msgid "E249: couldn't read VIM instance registry property"
+msgstr "E249: ²»ÄܶÁÈ¡ VIM µÄ ×¢²á±íÊôÐÔ"
+
+#: if_xcmdsrv.c:1067
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM µÄ×¢²á±íÊôÐÔÓÐÎó¡£ÒÑɾ³ý¡£"
+
+#: main.c:53 option.c:3162 option.c:3269
+msgid "Unknown option"
+msgstr "²»ÕýÈ·µÄÑ¡Ïî"
+
+#: main.c:55
+msgid "Too many edit arguments"
+msgstr "Ì«¶à±à¼­²ÎÊý"
+
+#: main.c:57
+msgid "Argument missing after"
+msgstr "ȱÉÙ±ØÒªµÄ²ÎÊý:"
+
+#: main.c:59
+msgid "Garbage after option"
+msgstr "²»ÄܱæÈÏ´ËÑ¡ÏîºóµÄÃüÁî: "
+
+#: main.c:61
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "Ì«¶à \"+command\" »ò \"-c command\" ²ÎÊý"
+
+#: main.c:63
+msgid "Invalid argument for"
+msgstr "²»ÕýÈ·µÄ²ÎÊý: "
+
+#: main.c:436
+msgid "This Vim was not compiled with the diff feature."
+msgstr "ÄúµÄ Vim ±àÒëʱûÓмÓÈë diff µÄÄÜÁ¦"
+
+#: main.c:858
+msgid "Attempt to open script file again: \""
+msgstr "ÊÔͼÔٴδò¿ª script Îļþ: \""
+
+#: main.c:862 main.c:869 main.c:913 memline.c:3673 memline.c:3677
+#: version.c:816 version.c:821 version.c:826 version.c:831 version.c:836
+#: version.c:841 version.c:847 version.c:851 version.c:855 version.c:860
+#: version.c:867 version.c:875 version.c:881
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:867
+msgid "Cannot open for reading: \""
+msgstr "²»ÄÜΪ¶Á¶ø´ò¿ª: \""
+
+#: main.c:911
+msgid "Cannot open for script output: \""
+msgstr "²»ÄÜΪ script Êä³ö¶ø´ò¿ª: \""
+
+#: main.c:1020
+#, c-format
+msgid "%d files to edit\n"
+msgstr "»¹ÓÐ %d ¸öÎļþµÈ´ý±à¼­\n"
+
+#: main.c:1094
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: ×¢Òâ: Êä³ö²»ÊÇÖÕ¶Ë(ÆÁÄ»)\n"
+
+#: main.c:1096
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: ×¢Òâ: ÊäÈë²»ÊÇÖÕ¶Ë(¼üÅÌ)\n"
+
+#. just in case..
+#: main.c:1171
+msgid "pre-vimrc command line"
+msgstr "pre-vimrc ÃüÁîÐÐ"
+
+#: main.c:1206
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: ²»ÄܶÁÈ¡Îļþ \"%s\""
+
+#: main.c:2157
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"²éѯ¸ü¶àÐÅÏ¢ÇëÖ´ÐÐ: \"vim -h\"\n"
+
+#: main.c:2190
+msgid "[file ..] edit specified file(s)"
+msgstr "[Îļþ ..] ±à¼­Ö¸¶¨µÄÎļþ"
+
+#: main.c:2191
+msgid "- read text from stdin"
+msgstr "- ´Ó±ê×¼ÊäÈë(stdin)¶ÁÈ¡Îı¾"
+
+#: main.c:2192
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag ±à¼­Ê±Ê¹ÓÃÖ¸¶¨µÄ tag"
+
+#: main.c:2194
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] ±à¼­Ê±¼ÓÔصÚÒ»¸ö´íÎó"
+
+#: main.c:2203
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" Ó÷¨:"
+
+#: main.c:2206
+msgid " vim [arguments] "
+msgstr "vim [²ÎÊý] "
+
+#: main.c:2210
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" »ò:"
+
+#: main.c:2213
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"²ÎÊý:\n"
+
+#: main.c:2214
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tÖ»ÓÐÔÚÕâÖ®ºóµÄÎļþ"
+
+#: main.c:2216
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t×¢²á gvim µ½ OLE"
+
+#: main.c:2217
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tÈ¡Ïû OLE ÖÐµÄ gvim ×¢²á"
+
+#: main.c:2220
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tʹÓÃͼÐνçÃæ (ͬ \"gvim\")"
+
+#: main.c:2221
+msgid "-f\t\t\tForeground: Don't fork when starting GUI"
+msgstr "-f\t\t\tÇ°¾°: Æô¶¯Í¼ÐνçÃæʱ²» fork"
+
+#: main.c:2223
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi ģʽ (ͬ \"vi\")"
+
+#: main.c:2224
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx ģʽ (ͬ \"ex\")"
+
+#: main.c:2225
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\t°²¾² (batch) ģʽ (Ö»ÄÜÓë \"ex\" Ò»ÆðʹÓÃ)"
+
+#: main.c:2227
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff ģʽ (ͬ \"vimdiff\", ¿ÉѸËٱȽÏÁ½Îļþ²»Í¬´¦)"
+
+#: main.c:2229
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\t¼òÒ×ģʽ (ͬ \"evim\", modeless)"
+
+#: main.c:2230
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tÖ»¶Áģʽ (ͬ \"view\")"
+
+#: main.c:2231
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\tÏÞÖÆģʽ (ͬ \"rvim\")"
+
+#: main.c:2232
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\t²»¿ÉÐÞ¸Ä (дÈëÎļþ)"
+
+#: main.c:2233
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tÎı¾²»¿ÉÐÞ¸Ä"
+
+#: main.c:2234
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t¶þ½øÖÆģʽ"
+
+#: main.c:2236
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp ģʽ"
+
+#: main.c:2238
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\t'compatible' ´«Í³ Vi ¼æÈÝģʽ"
+
+#: main.c:2239
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\t'nocompatible' ²»ÍêÈ«Ó봫ͳ Vi ¼æÈÝ£¬¿ÉʹÓà Vim ¼ÓÇ¿ÄÜÁ¦"
+
+#: main.c:2240
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose µÈ¼¶"
+
+#: main.c:2241
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\tµ÷ÊÔģʽ"
+
+#: main.c:2242
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\t²»Ê¹Óý»»»Îļþ, ֻʹÓÃÄÚ´æ"
+
+#: main.c:2243
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\tÁгö½»»»ÎļþºóÍ˳ö"
+
+#: main.c:2244
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (¼ÓÎļþÃû) \t»Ö¸´ÉϴαÀÀ£µÄ×ÊÁÏ(Recover crashed session)"
+
+#: main.c:2245
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tÓë -r Ò»Ñù"
+
+#: main.c:2247
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\t²»Ê¹Óà newcli À´´ò¿ª´°¿Ú"
+
+#: main.c:2248
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\tʹÓà <device> ×öÊäÈëÊä³öÉ豸"
+
+#: main.c:2251
+msgid "-H\t\t\tstart in Hebrew mode"
+msgstr "-H\t\t\tÆô¶¯Îª Ï£²®À³Ä£Ê½"
+
+#: main.c:2254
+msgid "-F\t\t\tstart in Farsi mode"
+msgstr "-F\t\t\tÆô¶¯Îª Farsi ģʽ"
+
+#: main.c:2256
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\tÉ趨ÖÕ¶ËΪ <terminal>"
+
+#: main.c:2257
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\tʹÓà <vimrc> Ìæ»»ÈκΠ.vimrc"
+
+#: main.c:2259
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\tʹÓà <gvimrc> Ìæ»»ÈκΠ.gvimrc"
+
+#: main.c:2261
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\t²»¼ÓÔØÈκΠplugin"
+
+#: main.c:2262
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\t´ò¿ª N ¸ö´°¿Ú (Ô¤ÉèÊÇÿ¸öÎļþÒ»¸ö)"
+
+#: main.c:2263
+msgid "-O[N]\t\tlike -o but split vertically"
+msgstr "-O[N]\t\tͬ -o µ«Ê¹Óô¹Ö±·Ö¸î"
+
+#: main.c:2264
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\tÆô¶¯ºóÌøµ½Îļþ½áβ"
+
+#: main.c:2265
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\tÆô¶¯ºóÌøµ½µÚ <lnum> ÐÐ"
+
+#: main.c:2267
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\t¼ÓÔØÈκΠvimrc Ç°Ö´ÐÐ <command>"
+
+#: main.c:2269
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\t¼ÓÔصÚÒ»¸öÎļþºóÖ´ÐÐ <command>"
+
+#: main.c:2270
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\t¼ÓÔصÚÒ»¸öÎļþºóÔØÈë Session Îļþ<session>"
+
+#: main.c:2271
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t´Ó <scriptin> ¶ÁÈëÒ»°ãģʽÃüÁî"
+
+#: main.c:2272
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t¶ÔÎļþ <scriptout> ¸½¼Ó(append)ËùÓÐÊäÈëµÄÃüÁî"
+
+#: main.c:2273
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t¶ÔÎļþ <scriptout> дÈëËùÓÐÊäÈëµÄÃüÁî"
+
+#: main.c:2275
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t±à¼­±àÂë¹ýµÄÎļþ"
+
+#: main.c:2279
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\t½« vim ÓëÖ¸¶¨µÄ X-server Á¬½Ó"
+
+#: main.c:2281
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\t²»ÒªÁ¬½Óµ½ X Server"
+
+#: main.c:2283
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\tÔÚÁíÒ»¸ö GTK ×é¼þÄÚ´ò¿ª Vim"
+
+#: main.c:2287
+msgid "--remote <files>\tEdit <files> in a Vim server and exit"
+msgstr "--remote <files>\t±à¼­ Vim ·þÎñÆ÷ÉϵÄÎļþ²¢Í˳ö"
+
+#: main.c:2288
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> µÈЧÓÚ --remote, µ«»áµÈºòÎļþÍê³É±à¼­"
+
+#: main.c:2289
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\tËͳö <keys> µ½ Vim ·þÎñÆ÷²¢Í˳ö"
+
+#: main.c:2290
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\tÔÚ·þÎñÆ÷ÉÏÇó±í´ïʽµÄÖµ²¢´òÓ¡½á¹û"
+
+#: main.c:2291
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\tÁгö¿ÉÓÃµÄ Vim ·þÎñÆ÷Ãû³Æ²¢Í˳ö"
+
+#: main.c:2292
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\tËÍÖÁ/³ÉΪ Vim ·þÎñÆ÷ <name>"
+
+#: main.c:2295
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\tʹÓà <viminfo> ¶ø·Ç .viminfo"
+
+#: main.c:2297
+msgid "-h\t\t\tprint Help (this message) and exit"
+msgstr "-h\t\t\t´òӡ˵Ã÷(Ò²¾ÍÊDZ¾ÐÅÏ¢)ºóÍ˳ö"
+
+#: main.c:2298
+msgid "--version\t\tprint version information and exit"
+msgstr "--version\t\t´òÓ¡°æ±¾ÐÅÏ¢ºóÍ˳ö"
+
+#: main.c:2302
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (Motif °æ):\n"
+
+#: main.c:2305
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (Athena °æ):\n"
+
+#: main.c:2308
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\tÔÚ´°¿Ú <display> Ö´ÐÐ vim"
+
+#: main.c:2309
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\tÆô¶¯ºó×îС»¯(iconified)"
+
+#: main.c:2311
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\t¶ÁÈ¡ Resource ʱ°Ñ vim µÄÃû³ÆÊÓΪ <name>"
+
+#: main.c:2312
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (ÉÐδʵÏÖ)\n"
+
+#: main.c:2314
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\tÉ趨 <color> Ϊ±³¾°É« (Ò²¿ÉÓà -bg)"
+
+#: main.c:2315
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\tÉ趨 <color> Ϊһ°ãÎÄ×ÖÑÕÉ« (Ò²¿ÉÓà -fg)"
+
+#: main.c:2316 main.c:2336
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\tʹÓà <font> Ϊһ°ã×ÖÌå (Ò²¿ÉÓà -fn)"
+
+#: main.c:2317
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\tʹÓà <font> Ϊ´ÖÌå×ÖÌå"
+
+#: main.c:2318
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\tʹÓà <font> ΪбÌå×ÖÌå"
+
+#: main.c:2319 main.c:2337
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\tʹÓÃ<geom>Ϊ³õʼλÖà (Ò²¿ÉÓà -geom)"
+
+#: main.c:2320
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\tʹÓÿí¶ÈΪ <width> µÄ±ß¿ò (Ò²¿ÉÓà -bw)"
+
+#: main.c:2321
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> É趨¹ö¶¯Ìõ¿í¶ÈΪ <width> (Ò²¿ÉÓà -sw)"
+
+#: main.c:2323
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\tÉ趨²Ëµ¥Áеĸ߶ÈΪ <height> (Ò²¿ÉÓà -mh)"
+
+#: main.c:2325 main.c:2338
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\tʹÓ÷´ÏÔ (Ò²¿ÉÓà -rv)"
+
+#: main.c:2326
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\t²»Ê¹Ó÷´ÏÔ (Ò²¿ÉÓà +rv)"
+
+#: main.c:2327
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\tÉ趨ָ¶¨µÄ×ÊÔ´"
+
+#: main.c:2330
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (RISC OS °æ):\n"
+
+#: main.c:2331
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t´°¿Ú³õʼ¿í¶È"
+
+#: main.c:2332
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t´°¿Ú³õʼ¸ß¶È"
+
+#: main.c:2335
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim ¿Éʶ±ðµÄ²ÎÊý (GTK+ °æ):\n"
+
+#: main.c:2339
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\tÔÚ <display> Ö´ÐÐ vim (Ò²¿ÉÓà --display)"
+
+#: main.c:2341
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tÏÔʾ Gnome Ïà¹Ø²ÎÊý"
+
+#. Failed to send, abort.
+#: main.c:2566
+msgid ""
+"\n"
+"Send failed.\n"
+msgstr ""
+"\n"
+"·¢Ëͱí´ïʽʧ°Ü¡£\n"
+
+#. Let vim start normally.
+#: main.c:2571
+msgid ""
+"\n"
+"Send failed. Trying to execute locally\n"
+msgstr ""
+"\n"
+"Ëͳöʧ°Ü¡£ÊÔͼÔÚ±¾µØÖ´ÐÐ\n"
+
+#: main.c:2604 main.c:2625
+#, c-format
+msgid "%d of %d edited"
+msgstr "%d ÖÐ %d Òѱ༭"
+
+#: main.c:2648
+msgid "Send expression failed.\n"
+msgstr "·¢Ëͱí´ïʽʧ°Ü¡£\n"
+
+#: mark.c:655
+msgid "No marks set"
+msgstr "ûÓÐÉ趨±ê¼Ç (mark)"
+
+#: mark.c:657
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: ÕÒ²»µ½·ûºÏ \"%s\" µÄ±ê¼Ç(mark)"
+
+#. Highlight title
+#: mark.c:668
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"±ê¼Ç ÐкŠÁÐ Îļþ/Îı¾"
+
+#. Highlight title
+#: mark.c:706
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" Ìøµ½ ÐкŠÁÐ Îļþ/Îı¾"
+
+#: mark.c:1068
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Îļþ±ê¼Ç:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1103
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (´Óе½¾É):\n"
+
+#: mark.c:1198
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# ÎļþÄÚÀúÊ·¼Ç¼ (´Óе½¾É):\n"
+
+#: mark.c:1281
+msgid "Missing '>'"
+msgstr "ȱÉÙ¶ÔÓ¦µÄ '>'"
+
+#: mbyte.c:395
+msgid "Not a valid codepage"
+msgstr "²»ÕýÈ·µÄ´úÂëÒ³"
+
+#: mbyte.c:3005
+msgid "E284: Cannot set IC values"
+msgstr "E284: ²»ÄÜÉ趨 IC ÊýÖµ"
+
+#: mbyte.c:3157
+msgid "E285: Failed to create input context"
+msgstr "E285: ²»ÄÜ´´½¨ÊäÈëÉÏÏÂÎÄ"
+
+#: mbyte.c:3304
+msgid "E286: Failed to open input method"
+msgstr "E286: ²»ÄÜ´ò¿ªÊäÈë·¨"
+
+#: mbyte.c:3315
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: ¾¯¸æ: ²»ÄÜÒƳý IM µÄ callback"
+
+#: mbyte.c:3321
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ÊäÈë·¨²»Ö§³ÖÈκΠstyle"
+
+#: mbyte.c:3378
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ÊäÈë·¨²»Ö§³ÖÈκΠstyle"
+
+#: mbyte.c:3452
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot ÐèÒª×ÖÌ弯(Fontset)"
+
+#: mbyte.c:3480
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: ÄãµÄ GTK+ ±È 1.2.3 ÀÏ¡£²»ÄÜʹÓÃ״̬Çø¡£"
+
+#: mbyte.c:3717
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ÊäÈë·¨¹ÜÀí³ÌÐò(Input Method Server)δÔËÐÐ"
+
+#: memfile.c:473
+msgid "E293: block was not locked"
+msgstr "E293: ¿éδ±»Ëø¶¨"
+
+#: memfile.c:972
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ½»»»Îļþ¶ÁÈ¡´íÎó"
+
+#: memfile.c:977
+msgid "E295: Read error in swap file"
+msgstr "E295: ½»»»Îļþ¶ÁÈ¡´íÎó"
+
+#: memfile.c:1029
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ½»»»ÎļþдÈë´íÎó"
+
+#: memfile.c:1047
+msgid "E297: Write error in swap file"
+msgstr "E297: ½»»»ÎļþдÈë´íÎó"
+
+#: memfile.c:1244
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ½»»»ÎļþÒѾ­´æÔÚ! (СÐÄ·ûºÅÁ¬½áµÄ°²È«Â©¶´!?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: ÕÒ²»µ½¿é 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: ÕÒ²»µ½¿é 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: ÕÒ²»µ½¿é 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: àÞàÞ, ½»»»Îļþ²»¼ûÁË!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: ²»Äܸı佻»»ÎļþµÄÃû³Æ"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: ²»ÄÜ´ò¿ª½»»»Îļþ \"%s\", ²»¿ÉÄָܻ´ÁË"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: ÕÒ²»µ½¿é 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: ÕÒ²»µ½ %s µÄ½»»»Îļþ"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "ÇëÑ¡ÔñÄãҪʹÓõĽ»»»Îļþ (°´0 Í˳ö): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: ²»ÄÜ´ò¿ª %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "²»ÄܶÁÈ¡¿é 0:"
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"¿ÉÄÜÄãû×ö¹ýÈκÎÐ޸ĻòÊÇ Vim »¹À´²»¼°¸üн»»»Îļþ."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " ²»ÄÜÔÚ±¾°æ±¾µÄ Vim ÖÐʹÓÃ.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "ʹÓà Vim 3.0¡£\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ¿´ÆðÀ´²»ÏñÊÇ Vim ½»»»Îļþ"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " ²»ÄÜÔÚÕą̂µçÄÔÉÏʹÓÃ.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "±¾Îļþ´´½¨ÓÚ "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"»òÊÇÕâÎļþÒѱ»ÆÆ»µ¡£"
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "ʹÓý»»»Îļþ \"%s\""
+
+#: memline.c:915
+#, c-format
+msgid "Original file \"%s\""
+msgstr "Ô­Îļþ \"%s\""
+
+#: memline.c:934
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: ¾¯¸æ: ԭʼÎļþ¿ÉÄÜÒѾ­Ð޸ĹýÁË"
+
+#: memline.c:975
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: ²»ÄÜ´Ó %s ¶ÁÈ¡¿é 1"
+
+#: memline.c:979
+msgid "???MANY LINES MISSING"
+msgstr "???ȱÉÙÌ«¶àÐÐ"
+
+#: memline.c:995
+msgid "???LINE COUNT WRONG"
+msgstr "???ÐкŴíÎó"
+
+#: memline.c:1002
+msgid "???EMPTY BLOCK"
+msgstr "???¿ÕµÄ ¿é"
+
+#: memline.c:1028
+msgid "???LINES MISSING"
+msgstr "???ÕÒ²»µ½Ò»Ð©ÐÐ"
+
+#: memline.c:1060
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: ¿é 1 ID ´íÎó (%s ²»Êǽ»»»Îļþ?)"
+
+#: memline.c:1065
+msgid "???BLOCK MISSING"
+msgstr "???ÕÒ²»µ½¿é"
+
+#: memline.c:1081
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ´ÓÕâÀïµ½ ???END µÄÄÚÈÝ¿ÉÄÜÓÐÎÊÌâ"
+
+#: memline.c:1097
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ´ÓÕâÀïµ½ ???END µÄÄÚÈÝ¿ÉÄܱ»É¾³ý/²åÈë¹ý"
+
+#: memline.c:1117
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1143
+msgid "E311: Recovery Interrupted"
+msgstr "E311: »Ö¸´ÒÑÖжÏ"
+
+#: memline.c:1145
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: »Ö¸´Ê±·¢Éú´íÎó; Çë×¢Ò⿪ͷΪ ??? µÄÐÐ"
+
+#: memline.c:1148
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "»Ö¸´Íê³É. ÇëÈ·¶¨Ò»ÇÐÕý³£."
+
+#: memline.c:1149
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(Äã¿ÉÄÜÏëÒª°ÑÕâ¸öÎļþÁí´æΪ±ðµÄÎļþÃû£¬\n"
+
+#: memline.c:1150
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "ÔÙÖ´ÐÐ diff ÓëÔ­Îļþ±È½ÏÒÔ¼ì²éÊÇ·ñÓиıä)\n"
+
+#: memline.c:1151
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"(D)Ö±½Óɾ³ý .swp ½»»»Îļþ\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1207
+msgid "Swap files found:"
+msgstr "ÕÒµ½ÒÔϵĽ»»»Îļþ:"
+
+#: memline.c:1385
+msgid " In current directory:\n"
+msgstr " ÔÚĿǰĿ¼:\n"
+
+#: memline.c:1387
+msgid " Using specified name:\n"
+msgstr " Using specified name:\n"
+
+#: memline.c:1391
+msgid " In directory "
+msgstr " ÔÚĿ¼ "
+
+#: memline.c:1409
+msgid " -- none --\n"
+msgstr " -- ÎÞ --\n"
+
+#: memline.c:1481
+msgid " owned by: "
+msgstr " ËùÓÐÕß: "
+
+#: memline.c:1483
+msgid " dated: "
+msgstr " ÈÕÆÚ: "
+
+#: memline.c:1487 memline.c:3680
+msgid " dated: "
+msgstr " ÈÕÆÚ: "
+
+#: memline.c:1503
+msgid " [from Vim version 3.0]"
+msgstr " [´Ó Vim °æ±¾ 3.0]"
+
+#: memline.c:1507
+msgid " [does not look like a Vim swap file]"
+msgstr " [²»Ïñ Vim µÄ½»»»Îļþ]"
+
+#: memline.c:1511
+msgid " file name: "
+msgstr " ÎļþÃû: "
+
+#: memline.c:1523
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" Ð޸Ĺý: "
+
+#: memline.c:1524
+msgid "YES"
+msgstr "ÊÇ"
+
+#: memline.c:1524
+msgid "no"
+msgstr "·ñ"
+
+#: memline.c:1528
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ̞: "
+
+#: memline.c:1535
+msgid " host name: "
+msgstr " Ö÷»úÃû: "
+
+#: memline.c:1537
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" Ö÷»úÃû: "
+
+#: memline.c:1543
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" ½ø³Ì ID: "
+
+#: memline.c:1549
+msgid " (still running)"
+msgstr " (ÕýÔÚÖ´ÐÐ)"
+
+#: memline.c:1561
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [²»ÄÜÔÚ±¾°æ±¾µÄ Vim ÉÏʹÓÃ]"
+
+#: memline.c:1564
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [²»ÄÜÔÚ±¾»úÉÏʹÓÃ]"
+
+#: memline.c:1569
+msgid " [cannot be read]"
+msgstr " [²»ÄܶÁÈ¡]"
+
+#: memline.c:1573
+msgid " [cannot be opened]"
+msgstr " [²»ÄÜ´ò¿ª]"
+
+#: memline.c:1763
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: ²»Äܱ£Áô, ²»Ê¹Óý»»»Îļþ"
+
+#: memline.c:1816
+msgid "File preserved"
+msgstr "ÎļþÒѱ£Áô"
+
+#: memline.c:1818
+msgid "E314: Preserve failed"
+msgstr "E314: ±£Áôʧ°Ü"
+
+#: memline.c:1889
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ´íÎóµÄ lnum: %ld"
+
+#: memline.c:1915
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: ÕÒ²»µ½µÚ %ld ÐÐ"
+
+#: memline.c:2303
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: Ö¸Õë¿é id ´íÎó 3"
+
+#: memline.c:2383
+msgid "stack_idx should be 0"
+msgstr "stack_idx Ó¦¸ÃÊÇ 0"
+
+#: memline.c:2445
+msgid "E318: Updated too many blocks?"
+msgstr "E318: ¸üÐÂÌ«¶à¿é?"
+
+#: memline.c:2602
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: Ö¸Õë¿é id ´íÎó 4"
+
+#: memline.c:2629
+msgid "deleted block 1?"
+msgstr "ɾ³ý¿é 1?"
+
+#: memline.c:2829
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: ÕÒ²»µ½µÚ %ld ÐÐ"
+
+#: memline.c:3072
+msgid "E317: pointer block id wrong"
+msgstr "E317: Ö¸Õë¿é id ´íÎó"
+
+#: memline.c:3088
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ΪÁã"
+
+#: memline.c:3117
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: Ðкų¬³ö·¶Î§: %ld ³¬¹ý½áβ"
+
+#: memline.c:3121
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: ¿é %ld ÐÐÊý´íÎó"
+
+#: memline.c:3170
+msgid "Stack size increases"
+msgstr "¶ÑÕ»´óСÔö¼Ó"
+
+#: memline.c:3216
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: Ö¸Õë¿é id ´í 2"
+
+#: memline.c:3670
+msgid "E325: ATTENTION"
+msgstr "E325: ×¢Òâ"
+
+#: memline.c:3671
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"·¢ÏÖ½»»»Îļþ \""
+
+#: memline.c:3675
+msgid "While opening file \""
+msgstr "µ±´ò¿ªÎļþʱ \""
+
+#: memline.c:3684
+msgid " NEWER than swap file!\n"
+msgstr " ±È½»»»ÎļþÐÂ!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3688
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ¿ÉÄÜÓÐÁíÒ»¸ö³ÌÐòÒ²Ôڱ༭ͬһ¸öÎļþ.\n"
+" Èç¹ûÊÇÕâÑù£¬Çë×¢Òâ²»ÒªÒ»ÆðдÈ룬²»È»ÄãµÄŬÁ¦¶¼»á¸¶ÖÁ÷¡£\n"
+
+#: memline.c:3689
+msgid " Quit, or continue with caution.\n"
+msgstr " Í˳ö£¬»òÊǼÌÐø±à¼­¡£\n"
+
+#: memline.c:3690
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) ÉÏÒ»´Î±à¼­´ËÎļþʱ±ÀÀ£\n"
+
+#: memline.c:3691
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " Èç¹ûÊÇÕâÑù, ÇëÓà \":recover\" »ò \"vim -r"
+
+#: memline.c:3693
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" »Ö¸´ÐÞ¸ÄÄÚÈÝ (½øÒ»²½ËµÃ÷Çë¿´ \":help recovery\").\n"
+
+#: memline.c:3694
+msgid " If you did this already, delete the swap file \""
+msgstr " Èç¹û¸Ã»Ö¸´µÄ¶¼ÒѾ­»Ö¸´ÁË, ÇëÖ±½Óɾ³ý´Ë½»»»Îļþ \""
+
+#: memline.c:3696
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ÒÔ±ÜÃâÔÙ¿´µ½´ËÐÅÏ¢.\n"
+
+#: memline.c:3710 memline.c:3714
+msgid "Swap file \""
+msgstr "½»»»Îļþ \""
+
+#: memline.c:3711 memline.c:3717
+msgid "\" already exists!"
+msgstr "\" ÒѾ­´æÔÚÁË!"
+
+#: memline.c:3720
+msgid "VIM - ATTENTION"
+msgstr "VIM - ×¢Òâ"
+
+#: memline.c:3722
+msgid "Swap file already exists!"
+msgstr "½»»»ÎļþÒѾ­´æÔÚ!"
+
+#: memline.c:3726
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"ÒÔÖ»¶Á·½Ê½´ò¿ª(&O)\n"
+"Ö±½Ó±à¼­(&E)\n"
+"»Ö¸´(&R)\n"
+"Í˳ö(&Q)"
+
+#: memline.c:3728
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"ÒÔÖ»¶Á·½Ê½´ò¿ª(&O)\n"
+"Ö±½Ó±à¼­(&E)\n"
+"»Ö¸´(&R)\n"
+"Í˳ö(&Q)\n"
+"ɾ³ý½»»»Îļþ(&D)"
+
+#: memline.c:3781
+msgid "E326: Too many swap files found"
+msgstr "E326: ÕÒµ½Ì«¶à½»»»Îļþ"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ²¿·Ý²Ëµ¥Ïî²»ÊÇ×Ӳ˵¥"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: ²Ëµ¥Ö»ÄÜÔÚÆäËüģʽÖÐʹÓÃ"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ûÓÐÄÇÑùµÄ²Ëµ¥"
+
+#: menu.c:503
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ²Ëµ¥²»ÄÜÖ¸Ïò×ÓÑ¡µ¥"
+
+#: menu.c:542
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ²»ÄÜÖ±½Ó°Ñ²Ëµ¥Ïî¼Óµ½²Ëµ¥ÌõÖÐ"
+
+#: menu.c:548
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ·Ö¸ôÏß²»ÄÜÊDz˵¥µÄÒ»²¿·Ö"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1063
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- ²Ëµ¥ ---"
+
+#: menu.c:1989
+msgid "Tear off this menu"
+msgstr "ÇÐÏ´˲˵¥"
+
+#: menu.c:2054
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ²Ëµ¥±ØÐèÖ¸ÏòÒ»¸ö²Ëµ¥Ïî"
+
+#: menu.c:2074
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: [²Ëµ¥] ÕÒ²»µ½ %s"
+
+#: menu.c:2143
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s ģʽ䶨Òå²Ëµ¥"
+
+#: menu.c:2181
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ²Ëµ¥±ØÐèÖ¸Ïò×Ӳ˵¥"
+
+#: menu.c:2202
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: ÕÒ²»µ½²Ëµ¥ - Çë¼ì²é²Ëµ¥Ãû³Æ"
+
+#: message.c:467
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "´¦Àí %s ʱ·¢Éú´íÎó:"
+
+#: message.c:483
+#, c-format
+msgid "line %4ld:"
+msgstr "ÐÐ %4ld:"
+
+#: message.c:523
+msgid "[string too long]"
+msgstr "[×Ö·û´®Ì«³¤]"
+
+#: message.c:669
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr "¼òÌåÖÐÎÄÐÅϢά»¤Õß: Wang Jun <junw@turbolinux.com.cn>"
+
+#: message.c:881
+msgid "Interrupt: "
+msgstr "ÒÑÖжÏ: "
+
+#: message.c:884
+msgid "Hit ENTER to continue"
+msgstr "Çë°´ ENTER ¼ÌÐø"
+
+#: message.c:886
+msgid "Hit ENTER or type command to continue"
+msgstr "Çë°´ ENTER »òÆäËüÃüÁî¼ÌÐø"
+
+#: message.c:1940
+msgid "-- More --"
+msgstr "-- ¸ü¶à --"
+
+#: message.c:1943
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ÏòÏÂ/ÏòÉÏÒ»ÐÐ, ¿Õ¸ñ/b: Ò»Ò³, d/u: °ëÒ³, q: Í˳ö)"
+
+#: message.c:1944
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ÏòÏÂÒ»ÐÐ, ¿Õ°×¼ü: Ò»Ò³, d: °ëÒ³, q: Í˳ö)"
+
+#: message.c:2419 message.c:2434
+msgid "Question"
+msgstr "ÎÊÌâ"
+
+#: message.c:2421
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ"
+
+#: message.c:2436
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ\n"
+"&CÈ¡Ïû"
+
+#: message.c:2454
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&YÊÇ\n"
+"&N·ñ\n"
+"&AÈ«²¿±£´æ\n"
+"&DÈ«²¿²»´æ\n"
+"&CÈ¡Ïû"
+
+#: message.c:2494
+msgid "Save File dialog"
+msgstr "±£´æÎļþ¶Ô»°¿ò"
+
+#: message.c:2496
+msgid "Open File dialog"
+msgstr "´ò¿ªÎļþ¶Ô»°¿ò"
+
+#. TODO: non-GUI file selector here
+#: message.c:2547
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: Ö÷¿Ø̨(Console)ģʽʱûÓÐÎļþä¯ÀÀÆ÷(file browser)"
+
+#: misc1.c:2449
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: ×¢Òâ: ÄãÕýÔÚÐÞ¸ÄÒ»¸öÖ»¶ÁÎļþ"
+
+#: misc1.c:2678
+msgid "1 more line"
+msgstr "»¹ÓÐÒ»ÐÐ"
+
+#: misc1.c:2680
+msgid "1 line less"
+msgstr "ÉÙÓÚÒ»ÐÐ"
+
+#: misc1.c:2685
+#, c-format
+msgid "%ld more lines"
+msgstr " »¹ÓÐ %ld ÐÐ"
+
+#: misc1.c:2687
+#, c-format
+msgid "%ld fewer lines"
+msgstr "ֻʣ %ld ÐÐ"
+
+#: misc1.c:2690
+msgid " (Interrupted)"
+msgstr " (ÒÑÖжÏ)"
+
+#: misc1.c:6244
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ±£ÁôÎļþÖÐ...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6254
+msgid "Vim: Finished.\n"
+msgstr "Vim: ½áÊø.\n"
+
+#: misc2.c:644 misc2.c:660
+msgid "ERROR: "
+msgstr "´íÎó: "
+
+#: misc2.c:664
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] È«²¿ alloc-freed %lu-%lu, ʹÓÃÖÐ %lu, peak ʹÓà %lu\n"
+
+#: misc2.c:666
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[µ÷ÓÃ] È«²¿ re/malloc(): %lu, È«²¿ free()': %lu\n"
+"\n"
+
+#: misc2.c:721
+msgid "E340: Line is becoming too long"
+msgstr "E340: ´ËÐйý³¤"
+
+#: misc2.c:765
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ÄÚ²¿´íÎó: lalloc(%ld, )"
+
+#: misc2.c:873
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: ÄÚ´æ²»×ã! (³¢ÊÔÅäÖà %lu ×Ö½Ú×é)"
+
+#: misc2.c:2508
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "µ÷ÓÃ shell Ö´ÐÐ: \"%s\""
+
+#: misc2.c:2703 misc2.c:5142 option.c:4584
+msgid "Missing colon"
+msgstr "ȱÉÙðºÅ"
+
+#: misc2.c:2705 misc2.c:2732
+msgid "Illegal mode"
+msgstr "²»ÕýÈ·µÄģʽ"
+
+#: misc2.c:2771
+msgid "Illegal mouseshape"
+msgstr "²»ÕýÈ·µÄÊó±êÐÎ×´"
+
+#: misc2.c:2811 misc2.c:5162
+msgid "digit expected"
+msgstr "Ó¦¸ÃΪÊý×Ö"
+
+#: misc2.c:2816
+msgid "Illegal percentage"
+msgstr "²»ÕýÈ·µÄ°Ù·Ö±È"
+
+#: misc2.c:3120
+msgid "Enter encryption key: "
+msgstr "ÊäÈëÃÜÂë: "
+
+#: misc2.c:3121
+msgid "Enter same key again: "
+msgstr "ÇëÔÙÊäÈëÒ»´Î: "
+
+#: misc2.c:3131
+msgid "Keys don't match!"
+msgstr "Á½´ÎÊäÈëÃÜÂ벻ͬ!"
+
+#: misc2.c:3645
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: ²»ÕýÈ·µÄ·¾¶: '**[number]' ±ØÐèÒªÔÚ·¾¶½áβ»òÒª½ÓÖø '%s'"
+
+#: misc2.c:4899
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath ÖÐûÓÐĿ¼ \"%s\""
+
+#: misc2.c:4902
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: ÔÚ·¾¶ÖÐÕÒ²»µ½Îļþ \"%s\""
+
+#: misc2.c:4908
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ÔÚ·¾¶ÖÐÕÒ²»µ½¸ü¶àµÄÎļþ \"%s\""
+
+#: misc2.c:4911
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ÔÚ·¾¶ÖÐÕÒ²»µ½¸ü¶àµÄÎļþ \"%s\""
+
+#: misc2.c:5154
+msgid "Illegal component"
+msgstr "²»ÕýÈ·µÄ×é¼þ"
+
+#: normal.c:2798
+msgid "Warning: terminal cannot highlight"
+msgstr "×¢Òâ: ÄãµÄÖն˲»ÄÜÏÔʾ¸ßÁÁ¶È"
+
+#: normal.c:2993
+msgid "E348: No string under cursor"
+msgstr "E348: ¹â±ê´¦Ã»ÓÐ×Ö·û´®"
+
+#: normal.c:2995
+msgid "E349: No identifier under cursor"
+msgstr "E349: ¹â±ê´¦Ã»ÓÐʶ±ð×Ö"
+
+#: normal.c:4160
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: ²»ÄÜÔÚÄ¿Ç°µÄ 'foldmethod' ÏÂɾ³ý fold"
+
+#: ops.c:271
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "Ò»ÐÐ %s ¹ý Ò»´Î"
+
+#: ops.c:273
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "Ò»ÐÐ %s ¹ý %d ´Î"
+
+#: ops.c:278
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld ÐÐ %s ¹ý Ò»´Î"
+
+#: ops.c:281
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld ÐÐ %s ¹ý %d ´Î"
+
+#: ops.c:638
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "ʶ±ð %ld ÐÐ..."
+
+#: ops.c:688
+msgid "1 line indented "
+msgstr "Ò»ÐÐÒÑʶ±ð"
+
+#: ops.c:690
+#, c-format
+msgid "%ld lines indented "
+msgstr "ÒÑʶ±ð %ld ÐÐ"
+
+#. must display the prompt
+#: ops.c:1528
+msgid "cannot yank; delete anyway"
+msgstr "²»Äܸ´ÖÆ; Ö±½Óɾ³ý"
+
+#: ops.c:2018
+msgid "1 line changed"
+msgstr " 1 ÐÐ ~ed"
+
+#: ops.c:2020
+#, c-format
+msgid "%ld lines changed"
+msgstr " %ld ÐÐ ~ed"
+
+#: ops.c:2381
+#, c-format
+msgid "freeing %ld lines"
+msgstr "ÊÍ·Å %ld ÐÐÖÐ"
+
+#: ops.c:2658
+msgid "1 line yanked"
+msgstr "ÒѸ´ÖÆ 1 ÐÐ"
+
+#: ops.c:2660
+#, c-format
+msgid "%ld lines yanked"
+msgstr "ÒѸ´ÖÆ %ld ÐÐ"
+
+#: ops.c:2916
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ¼Ä´æÆ÷ %s ÀïûÓж«Î÷"
+
+#. Highlight title
+#: ops.c:3454
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ¼Ä´æÆ÷ ---"
+
+#: ops.c:4565
+msgid "Illegal register name"
+msgstr "²»ÕýÈ·µÄ¼Ä´æÆ÷Ãû³Æ"
+
+#: ops.c:4645
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ¼Ä´æÆ÷:\n"
+
+#: ops.c:4671
+#, c-format
+msgid "Unknown register type %d"
+msgstr "δ֪µÄ×¢²áÀàÐÍ: %d"
+
+#: ops.c:5052
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: ¼Ä´æÆ÷Ãû³Æ´íÎó: '%s'"
+
+#: ops.c:5393
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld ÁÐ; "
+
+#: ops.c:5400
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "Ñ¡ÔñÁË %s%ld/%ld ÐÐ; %ld/%ld ×Ö(Word); %ld/%ld ×Ö·û(Bytes)"
+
+#: ops.c:5416
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "ÁÐ %s/%s; ÐÐ %ld/%ld; ×Ö(Word) %ld/%ld; ×Ö·û(Byte) %ld/%ld"
+
+#: ops.c:5427
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1989
+msgid "Thanks for flying Vim"
+msgstr "¸ÐлÄúÑ¡Ôñ Vim"
+
+#: option.c:3175
+msgid "Option not supported"
+msgstr "²»Ö§³Ö¸ÃÑ¡Ïî"
+
+#: option.c:3200
+msgid "Not allowed in a modeline"
+msgstr "²»ÄÜÔÚģʽÐÐÀï³öÏÖ"
+
+#: option.c:3256
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\tµ±Ç°ÉèÖÃ: "
+
+#: option.c:3395
+msgid "Number required after ="
+msgstr "= ºóÐèÒªÓÐÊý×Ö"
+
+#: option.c:3702 option.c:4309
+msgid "Not found in termcap"
+msgstr "Termcap ÀïÃæÕÒ²»µ½"
+
+#: option.c:3768
+#, c-format
+msgid "Illegal character <%s>"
+msgstr "²»ÕýÈ·µÄ×Ö·û <%s>"
+
+#: option.c:4294 option.c:5497
+msgid "Not allowed here"
+msgstr "ÕâÀï²»¿ÉʹÓÃ"
+
+#: option.c:4301
+msgid "Cannot set 'term' to empty string"
+msgstr "²»ÄÜÉ趨 'term' Ϊ¿Õ×Ö·û´®"
+
+#: option.c:4304
+msgid "Cannot change term in GUI"
+msgstr "ÔÚͼÐͽçÃæÖв»ÄÜÇл»ÖÕ¶Ë"
+
+#: option.c:4306
+msgid "Use \":gui\" to start the GUI"
+msgstr "ÊäÈë \":gui\" À´Æô¶¯Í¼ÐνçÃæ"
+
+#: option.c:4327
+msgid "'backupext' and 'patchmode' are equal"
+msgstr "'backupext' ¸ú 'patchmode' ÊÇÒ»ÑùµÄ"
+
+#: option.c:4586
+msgid "Zero length string"
+msgstr "Á㳤¶È×Ö·û´®"
+
+#: option.c:4654
+#, c-format
+msgid "Missing number after <%s>"
+msgstr "<%s> ºóȱÉÙÊý×Ö"
+
+#: option.c:4668
+msgid "Missing comma"
+msgstr "ȱÉÙ¶ººÅ"
+
+#: option.c:4675
+msgid "Must specify a ' value"
+msgstr "±ØÐèÖ¸¶¨Ò»¸ö ' Öµ"
+
+#: option.c:4715
+msgid "contains unprintable character"
+msgstr "°üº¬²»ÄÜÏÔʾµÄ×Ö·û"
+
+#: option.c:4728
+msgid "Invalid font(s)"
+msgstr "²»ÕýÈ·µÄ×ÖÌå"
+
+#: option.c:4734
+msgid "can't select fontset"
+msgstr "²»ÄÜʹÓÃ×ÖÌ弯(Fontset)"
+
+#: option.c:4736
+msgid "Invalid fontset"
+msgstr "²»ÕýÈ·µÄ×ÖÌ弯(Fontset)"
+
+#: option.c:4743
+msgid "can't select wide font"
+msgstr "²»ÄÜʹÓÃÉ趨µÄ¿í×ÖÌå(Widefont)"
+
+#: option.c:4745
+msgid "Invalid wide font"
+msgstr "²»ÕýÈ·µÄ¿í×ÖÌå(Widefont)"
+
+#: option.c:5014
+#, c-format
+msgid "Illegal character after <%c>"
+msgstr "<%c> ºóÓв»ÕýÈ·µÄ×Ö·û"
+
+#: option.c:5097
+msgid "comma required"
+msgstr "ÐèÒª¶ººÅ"
+
+#: option.c:5106
+#, c-format
+msgid "'commentstring' must be empty or contain %s"
+msgstr "'commentstring' ±ØÐèÊÇ¿Õ°×»ò°üº¬ %s"
+
+#: option.c:5153
+msgid "No mouse support"
+msgstr "²»Ö§³ÖÊó±ê"
+
+#: option.c:5399
+msgid "Unclosed expression sequence"
+msgstr "ûÓнáÊøµÄ±í´ïʽ: "
+
+#: option.c:5403
+msgid "too many items"
+msgstr "Ì«¶à¶ÔÏó"
+
+#: option.c:5405
+msgid "unbalanced groups"
+msgstr "²»¶Ô³ÆµÄ×é"
+
+#: option.c:5620
+msgid "A preview window already exists"
+msgstr "Ô¤ÀÀ´°¿ÚÒѾ­´æÔÚÁË"
+
+#: option.c:5881 option.c:5910
+msgid "'winheight' cannot be smaller than 'winminheight'"
+msgstr "'winheight' ²»ÄÜ±È 'winminheight' ¸üÉÙ"
+
+#: option.c:5926 option.c:5945
+msgid "'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "'winwidth' ²»ÄÜ±È 'winminwidth' ¸üÉÙ"
+
+#: option.c:6085
+#, c-format
+msgid "Need at least %d lines"
+msgstr "ÖÁÉÙÐèÒª %d ÐÐ"
+
+#: option.c:6094
+#, c-format
+msgid "Need at least %d columns"
+msgstr "ÖÁÉÙÐèÒª %d ÁÐ"
+
+#: option.c:6391
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ²»ÕýÈ·µÄÑ¡Ïî: %s"
+
+#: option.c:6500
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- Öն˱àÂë ---"
+
+#: option.c:6502
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- È«¾Ö Ñ¡ÏîÖµ ---"
+
+#: option.c:6504
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- ±¾µØ Ñ¡ÏîÖµ ---"
+
+#: option.c:6506
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- Ñ¡Ïî ---"
+
+#: option.c:7196
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ´íÎó"
+
+#: option.c:8112
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': ÕÒ²»µ½ %s ¶ÔÓ¦µÄ×Ö·û"
+
+#: option.c:8146
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ·ÖºÅºóÓжàÓàµÄ×Ö·û: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "²»ÄÜ´ò¿ª"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: ²»ÄÜ´ò¿ª´°¿Ú!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "ÐèÒª Amigados °æ±¾ 2.04 ÒÔÉÏ\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "ÐèÒª %s °æ±¾ %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "²»ÄÜ´ò¿ª NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "²»ÄÜ´´½¨ "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim ·µ»ØÖµ: %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "²»ÄÜÇл»Ö÷¿Ø̨(console)ģʽ !?\n"
+
+#: os_amiga.c:938 os_mac.c:1168 os_mswin.c:619 os_riscos.c:728 os_unix.c:2726
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ²»Ö§³ÖÉ趨ÆÁĻģʽ"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ²»ÊÇÖ÷¿Ø̨(console)??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1142
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: ²»ÄÜÓà -f Ñ¡ÏîÖ´ÐÐ shell"
+
+#: os_amiga.c:1183 os_amiga.c:1273
+msgid "Cannot execute "
+msgstr "²»ÄÜÖ´ÐÐ "
+
+#: os_amiga.c:1186 os_amiga.c:1283
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1206 os_amiga.c:1308
+msgid " returned\n"
+msgstr " ÒÑ·µ»Ø\n"
+
+#: os_amiga.c:1448
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ̫С"
+
+#: os_amiga.c:1452
+msgid "I/O ERROR"
+msgstr "I/O ´íÎó"
+
+#: os_mswin.c:503
+msgid "...(truncated)"
+msgstr ""
+
+#: os_mswin.c:594
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ²»ÊÇ 80, ²»ÄÜÖ´ÐÐÍⲿÃüÁî"
+
+#: os_mswin.c:706 os_unix.c:4945
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: µ÷Óú¯Êý¿â \"%s\"() ʧ°Ü"
+
+#: os_mswin.c:1340
+msgid "E237: Printer selection failed"
+msgstr "E237: ²»ÄÜÑ¡Ôñ´Ë´òÓ¡»ú"
+
+#: os_mswin.c:1388
+#, c-format
+msgid "to %s on %s"
+msgstr "´Ó %s µ½ %s"
+
+#: os_mswin.c:1449 os_mswin.c:1459
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ´òÓ¡´íÎó: %s"
+
+#: os_mswin.c:1459
+msgid "Unknown"
+msgstr "δ֪"
+
+#: os_mswin.c:1486
+#, c-format
+msgid "Printing '%s'"
+msgstr "ÒÑ´òÓ¡: '%s'"
+
+#: os_mswin.c:2550
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: ×Ö·û¼¯ \"%s\" ²»ÄܶÔÓ¦×ÖÌå\"%s\""
+
+#: os_mswin.c:2558
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ²»ÕýÈ·µÄ×Ö·û '%c' ³öÏÖÔÚ×ÖÌåÃû³Æ \"%s\" ÄÚ"
+
+#: os_riscos.c:1227
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ²»ÕýÈ·µÄ 'filetype' Ñ¡Ïî - ʹÓô¿ÎÄ×Öģʽ"
+
+#: os_unix.c:800
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Ë«ÖØÐźÅ, Í˳öÖÐ\n"
+
+#: os_unix.c:806
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: CVim: À¹½Øµ½ÐźÅ(signal) %s\n"
+
+#: os_unix.c:809
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: À¹½Øµ½ÖÂÃüµÄÐźÅ(deadly signale)\n"
+
+#: os_unix.c:1063
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "´ò¿ª X Window ÓÃʱ %ld Ãë"
+
+#: os_unix.c:1090
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X ´íÎó\n"
+
+#: os_unix.c:1157
+msgid "Testing the X display failed"
+msgstr "²âÊÔ X Window ʧ°Ü"
+
+#: os_unix.c:1301
+msgid "Opening the X display timed out"
+msgstr "´ò¿ª X Window ³¬Ê±"
+
+#: os_unix.c:2899 os_unix.c:3483
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"²»ÄÜÖ´ÐÐ shell"
+
+#: os_unix.c:2944
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"²»ÄÜÖ´ÐÐ shell sh\n"
+
+#: os_unix.c:2948 os_unix.c:3489
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell ÒÑ·µ»Ø"
+
+#: os_unix.c:3082
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"²»Äܽ¨Á¢¹ÜµÀ\n"
+
+#: os_unix.c:3097
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"²»ÄÜ fork\n"
+
+#: os_unix.c:3496
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"ÃüÁîÒѽáÊø\n"
+
+#: os_unix.c:4993
+msgid "Opening the X display failed"
+msgstr "´ò¿ª X Window ʧ°Ü"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "ÔÚÐкŠ"
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "²»ÄܼÓÔØ vim32.dll£¡"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM ´íÎó"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "²»ÄÜÐÞÕýº¯ÊýÖ¸Õëµ½ DLL!"
+
+#: os_win16.c:578 os_win32.c:3019
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell ·µ»ØÖµ %d"
+
+#: os_win32.c:2489
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: À¹½Øµ½ %s ʼþ\n"
+
+#: os_win32.c:2491
+msgid "close"
+msgstr "¹Ø±Õ"
+
+#: os_win32.c:2493
+msgid "logoff"
+msgstr "×¢Ïû"
+
+#: os_win32.c:2494
+msgid "shutdown"
+msgstr "¹Ø»ú"
+
+#: os_win32.c:2975
+msgid "E371: Command not found"
+msgstr "E371: ÕÒ²»µ½ÃüÁî"
+
+#: os_win32.c:2988
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"ÔÚÄãµÄ $PATH ÖÐÕÒ²»µ½ VIMRUN.EXE.\n"
+"ÍⲿÃüÁîÖ´ÐÐÍê±Ïºó½«²»»áÔÝÍ£.\n"
+"½øÒ»²½ËµÃ÷ÇëÖ´ÐÐ :help win32-vimrun "
+
+#: os_win32.c:2991
+msgid "Vim Warning"
+msgstr "Vim ¾¯¸æ"
+
+#: quickfix.c:281
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ¸ñʽ»¯×Ö·û´®ÀïÓÐÌ«¶à %%%c "
+
+#: quickfix.c:294
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: ¸ñʽ»¯×Ö·û´®²»Ó¦¸Ã³öÏÖ %%%c "
+
+#: quickfix.c:348
+msgid "E374: Missing ] in format string"
+msgstr "E374: ¸ñʽ»¯×Ö·û´®ÀïÉÙÁË ]"
+
+#: quickfix.c:362
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: ¸ñʽ»¯×Ö·û´®ÀïÓв»Ö§³ÖµÄ %%%c "
+
+#: quickfix.c:380
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ¸ñʽ»¯×Ö·û´®¿ªÍ·ÀïÓв»ÕýÈ·µÄ %%%c "
+
+#: quickfix.c:388
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: ¸ñʽ»¯×Ö·û´®ÀïÓв»ÕýÈ·µÄ %%%c "
+
+#: quickfix.c:414
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' δÉ趨"
+
+#: quickfix.c:520
+msgid "E379: Missing or empty directory name"
+msgstr "E379: ÕÒ²»µ½Ä¿Â¼Ãû³Æ»òÊÇ¿ÕµÄĿ¼Ãû³Æ"
+
+#: quickfix.c:931
+msgid "No more items"
+msgstr "ûÓÐÆäËü¶ÔÏó"
+
+#: quickfix.c:1152
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d / %d)%s%s: "
+
+#: quickfix.c:1154
+msgid " (line deleted)"
+msgstr " (ÐÐÒÑɾ³ý)"
+
+#: quickfix.c:1360
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Quickfix ¶ÑÕ»½áβ"
+
+#: quickfix.c:1369
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Quickfix ¶ÑÕ»¶¥¶Ë"
+
+#: quickfix.c:1381
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "´íÎóÁбí %d/%d; ¹²ÓÐ %d Ïî´íÎó"
+
+#: quickfix.c:1842
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: ²»ÄÜдÈ룬'buftype' Ñ¡ÏîÒÑÉ趨"
+
+#: regexp.c:801
+msgid "E339: Pattern too long"
+msgstr "E339: Ãû×ÖÌ«³¤"
+
+#: regexp.c:1315
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: ³²×´ %s*"
+
+#: regexp.c:1318
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: ³²×´ %s%c"
+
+#: regexp.c:1467
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c ûÓнӶ«Î÷"
+
+#: regexp.c:2469
+#, c-format
+msgid "Syntax error in %s{...}"
+msgstr "Óï·¨´íÎó: %s{...}"
+
+#: regexp.c:2716
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: ²»ÄÜÖ´ÐÐ; regular expression Ì«¸´ÔÓ?"
+
+#: regexp.c:2851
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: regular expression Ôì³É¶ÑÕ»ÓùâµÄ´íÎó"
+
+#: regexp.c:3087
+msgid "External submatches:\n"
+msgstr "Íⲿ·ûºÏ:\n"
+
+#: screen.c:2051
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--ÒÑ fold %3ld ÐÐ"
+
+#: screen.c:7411
+msgid " VREPLACE"
+msgstr " V-Ìæ»»"
+
+#: screen.c:7415
+msgid " REPLACE"
+msgstr " Ìæ»»"
+
+#: screen.c:7420
+msgid " REVERSE"
+msgstr " ·´×ª"
+
+#: screen.c:7422
+msgid " INSERT"
+msgstr " ²åÈë"
+
+#: screen.c:7425
+msgid " (insert)"
+msgstr " (²åÈë)"
+
+#: screen.c:7427
+msgid " (replace)"
+msgstr " (Ìæ»»)"
+
+#: screen.c:7429
+msgid " (vreplace)"
+msgstr " (v-Ìæ»»)"
+
+#: screen.c:7432
+msgid " Hebrew"
+msgstr " Ï£²®À³"
+
+#: screen.c:7440
+msgid " (lang)"
+msgstr " (ÓïÑÔ)"
+
+#: screen.c:7443
+msgid " (paste)"
+msgstr " (Õ³Ìû)"
+
+#: screen.c:7449
+msgid " SELECT"
+msgstr " Ñ¡È¡"
+
+#: screen.c:7451
+msgid " VISUAL"
+msgstr " ¿ÉÊÓ"
+
+#: screen.c:7453
+msgid " BLOCK"
+msgstr " ¿é"
+
+#: screen.c:7455
+msgid " LINE"
+msgstr " ÐÐ"
+
+#: screen.c:7468 screen.c:7522
+msgid "recording"
+msgstr "¼Ç¼ÖÐ"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "ÒѲéÕÒµ½Îļþ¿ªÍ·£»ÔÙ´Ó½áβ¼ÌÐø²éÕÒ"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "ÒѲéÕÒµ½Îļþ½áβ£»ÔÙ´Ó¿ªÍ·¼ÌÐø²éÕÒ"
+
+#: search.c:440
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: ´íÎóµÄ²éÕÒ×Ö·û´®: %s"
+
+#: search.c:747
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ÒѲéÕÒµ½Îļþ¿ªÍ·ÈÔÕÒ²»µ½ %s"
+
+#: search.c:749
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ÒѲéÕÒµ½Îļþ½áβÈÔÕÒ²»µ½ %s"
+
+#: search.c:1107
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ÔÚ ';' ºóÃæÓ¦¸ÃÓÐ '?' »ò '/'"
+
+#: search.c:3476
+msgid " (includes previously listed match)"
+msgstr " (°üÀ¨ÉÏ´ÎÁгö·ûºÏÏî)"
+
+#. cursor at status line
+#: search.c:3496
+msgid "--- Included files "
+msgstr "--- °üº¬Îļþ "
+
+#: search.c:3498
+msgid "not found "
+msgstr "ÕÒ²»µ½ "
+
+#: search.c:3499
+msgid "in path ---\n"
+msgstr "ÔÚ·¾¶ ---\n"
+
+#: search.c:3538
+msgid " (Already listed)"
+msgstr " (ÒÑÁгö)"
+
+#: search.c:3540
+msgid " NOT FOUND"
+msgstr " ÕÒ²»µ½"
+
+#: search.c:3592
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "²éÕÒ°üº¬Îļþ: %s"
+
+#: search.c:3810
+msgid "E387: Match is on current line"
+msgstr "E387: µ±Ç°ÐÐÆ¥Åä"
+
+#: search.c:3950
+msgid "All included files were found"
+msgstr "ËùÓаüº¬Îļþ¶¼ÒÑÕÒµ½"
+
+#: search.c:3952
+msgid "No included files"
+msgstr "ûÓаüº¬Îļþ"
+
+#: search.c:3968
+msgid "E388: Couldn't find definition"
+msgstr "E388: ÕÒ²»µ½¶¨Òå"
+
+#: search.c:3970
+msgid "E389: Couldn't find pattern"
+msgstr "E389: ÕÒ²»µ½ pattern"
+
+#: syntax.c:2990
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:3167
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ÎÞ´ËÓï·¨ cluster: \"%s\""
+
+#: syntax.c:3331
+msgid "No Syntax items defined for this buffer"
+msgstr "Õâ¸ö»º³åÇøûÓж¨ÒåÈκÎÓï·¨Ïî"
+
+#: syntax.c:3339
+msgid "syncing on C-style comments"
+msgstr "C·ç¸ñ×¢ÊÍͬ²½ÖÐ"
+
+#: syntax.c:3347
+msgid "no syncing"
+msgstr "ûÓÐͬ²½"
+
+#: syntax.c:3350
+msgid "syncing starts "
+msgstr "ͬ²½¿ªÊ¼"
+
+#: syntax.c:3352 syntax.c:3421
+msgid " lines before top line"
+msgstr "Ðкų¬³ö·¶Î§"
+
+#: syntax.c:3356
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- Ó﷨ͬ²½ÏîÄ¿ (Syntax sync items) ---"
+
+#: syntax.c:3359
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"ͬ²½ÖÐ:"
+
+#: syntax.c:3364
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- Óï·¨ÏîÄ¿ ---"
+
+#: syntax.c:3387
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ÎÞ´ËÓï·¨ cluster: \"%s\""
+
+#: syntax.c:3411
+msgid "minimal "
+msgstr "×îС"
+
+#: syntax.c:3418
+msgid "maximal "
+msgstr "×î´ó"
+
+#: syntax.c:4046
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4070
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: ÕÒ²»µ½ %s µÄ region item"
+
+#: syntax.c:4098
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4109
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ʹÓÃÁ˲»ÕýÈ·µÄ²ÎÊý"
+
+#: syntax.c:4187
+msgid "E397: Filename required"
+msgstr "E397: ÐèÒªÎļþÃû³Æ"
+
+#: syntax.c:4523
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: ȱÉÙ \"=\": %s"
+
+#: syntax.c:4679
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: syntax region %s µÄ²ÎÊýÌ«ÉÙ"
+
+#: syntax.c:5010
+msgid "E400: No cluster specified"
+msgstr "E400: ûÓÐÖ¸¶¨µÄÊôÐÔ"
+
+#: syntax.c:5047
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: ÕÒ²»µ½·Ö¸ô·ûºÅ: %s"
+
+#: syntax.c:5122
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: '%s' ºóÃæµÄ¶«Î÷²»ÄÜʶ±ð"
+
+#: syntax.c:5204
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: Ó﷨ͬ²½: Á¬½ÓÐзûºÅÖ¸¶¨ÁËÁ½´Î"
+
+#: syntax.c:5261
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:5311
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: ȱÉٵȺÅ: %s"
+
+#: syntax.c:5317
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ¿Õ²ÎÊý: %s"
+
+#: syntax.c:5344
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ²»ÄÜÔڴ˳öÏÖ"
+
+#: syntax.c:5351
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ±ØÐëÊÇÁбíÀïµÄµÚÒ»¸ö"
+
+#: syntax.c:5421
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ²»ÕýÈ·µÄ×éÃû: %s"
+
+#: syntax.c:5644
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ²»ÕýÈ·µÄ :syntax ×ÓÃüÁî: %s"
+
+#: syntax.c:6023
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: ÕÒ²»µ½ highlight group: %s"
+
+#: syntax.c:6047
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: ²ÎÊýÌ«ÉÙ: \":highlight link %s\""
+
+#: syntax.c:6054
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: ²ÎÊý¹ý¶à: \":highlight link %s\""
+
+#: syntax.c:6074
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ÒÑÉ趨×é, ºöÂÔ highlight link"
+
+#: syntax.c:6203
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ²»¸ÃÓеĵȺÅ: %s"
+
+#: syntax.c:6239
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ȱÉٵȺÅ: %s"
+
+#: syntax.c:6261
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ȱÉÙ²ÎÊý: %s"
+
+#: syntax.c:6298
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ²»ºÏ·¨µÄÖµ: %s"
+
+#: syntax.c:6417
+msgid "E419: FG color unknown"
+msgstr "E419: ´íÎóµÄÇ°¾°ÑÕÉ«"
+
+#: syntax.c:6428
+msgid "E420: BG color unknown"
+msgstr "E420: ´íÎóµÄ±³¾°ÑÕÉ«"
+
+#: syntax.c:6483
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: ´íÎóµÄÑÕÉ«Ãû³Æ»òÊýÖµ: %s"
+
+#: syntax.c:6687
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: Öն˱àÂëÌ«³¤: %s"
+
+#: syntax.c:6734
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: ²ÎÊý²»ÕýÈ·: %s"
+
+#: syntax.c:7263
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ʹÓÃÁËÌ«¶à²»Í¬µÄ¸ßÁÁ¶ÈÊôÐÔ"
+
+#: tag.c:90
+msgid "at bottom of tag stack"
+msgstr "±êÇ©(tag)¶ÑÕ»½áβ"
+
+#: tag.c:91
+msgid "at top of tag stack"
+msgstr "±êÇ©(tag)¶ÑÕ»¿ªÍ·"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ÒѾ­ÔÚ×îÇ°ÃæµÄ±êÇ©(tag)ÁË"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: ÕÒ²»µ½±êÇ©(tag): %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "Îļþ\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "ÊäÈë nr »òÑ¡Ôñ (<CR> Í˳ö): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: Ö»ÓдËÏî·ûºÏ"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ¼º¾­ÔÚ×îºóÒ»¸ö·ûºÏµÄ±êÇ©(tag)ÁË"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "Îļþ \"%s\" ²»´æÔÚ"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "ÕÒµ½ tag: %d/%d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " »ò¸ü¶à"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " ÒÔ²»Í¬´óСдÀ´Ê¹Óà tag!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: Îļþ \"%s\" ²»´æÔÚ"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # µ½ tag ´Ó ÐÐ ÔÚ Îļþ/Îı¾"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "ÏßÐÔ²éÕÒ±êÇ© (Tags)"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "¶þ½øÖƲéÕÒ(Binary search) ±êÇ©(Tags)"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "²éÕÒ tag Îļþ \"%s\""
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag Îļþ·¾¶±»½Ø¶ÏΪ %s\n"
+
+#: tag.c:1847
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Tag Îļþ \"%s\" ¸ñʽ´íÎó"
+
+#: tag.c:1851
+#, c-format
+msgid "Before byte %ld"
+msgstr "ÔÚ %ld ×Ö½Ú֮ǰ"
+
+#: tag.c:1872
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag ÎļþδÅÅÐò: %s"
+
+#. never opened any tags file
+#: tag.c:1911
+msgid "E433: No tags file"
+msgstr "E433: ûÓÐ tag Îļþ"
+
+#: tag.c:2583
+msgid "E434: Can't find tag pattern"
+msgstr "E434: ÕÒ²»µ½ tag"
+
+#: tag.c:2594
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: ÕÒ²»µ½ tag, ÊÔ×ŲÂ!"
+
+#: term.c:1723
+msgid "' not known. Available builtin terminals are:"
+msgstr "' ²»ÄܼÓÔØ¡£¿ÉÓõÄÄÚ½¨ÖÕ¶ËÐÎʽÓÐ:"
+
+#: term.c:1747
+msgid "defaulting to '"
+msgstr "Ô¤Éè: '"
+
+#: term.c:2100
+msgid "Cannot open termcap file"
+msgstr "²»ÄÜ´ò¿ª termcap Îļþ"
+
+#: term.c:2103
+msgid "Terminal entry not found in terminfo"
+msgstr "ÔÚterminfoÖÐδÕÒµ½ÖÕ¶ËÏî"
+
+#: term.c:2105
+msgid "Terminal entry not found in termcap"
+msgstr "ÔÚtermcapÖÐδÕÒµ½ÖÕ¶ËÏî"
+
+#: term.c:2264
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap ûÓÐ \"%s\" Ïî"
+
+#: term.c:2738
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ÖÕ¶ËÐèÒª \"cm\" µÄÄÜÁ¦"
+
+#. Highlight title
+#: term.c:4872
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- Öն˰´¼ü ---"
+
+#: ui.c:240
+msgid "new shell started\n"
+msgstr "Æô¶¯Ð shell\n"
+
+#: ui.c:1705
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: ¶Á´íÎó£¬Í˳öÖÐ...\n"
+
+#. must display the prompt
+#: undo.c:351
+msgid "No undo possible; continue anyway"
+msgstr "²»ÄÜ»¹Ô­£»Çë¼ÌÐø"
+
+#: undo.c:506
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ÐкŴíÎó"
+
+#: undo.c:675
+msgid "1 change"
+msgstr "Ò»Ïî¸Ä±ä"
+
+#: undo.c:677
+#, c-format
+msgid "%ld changes"
+msgstr "%ld Ïî¸Ä±ä"
+
+#: undo.c:721
+msgid "E439: undo list corrupt"
+msgstr "E439: ³·ÏúÁбíËð»µ"
+
+#: undo.c:751
+msgid "E440: undo line missing"
+msgstr "E440: ÕÒ²»µ½Òª³·Ïú²Ù×÷µÄÐÐ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:655
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32λ ͼÐͽçÃæ°æ±¾"
+
+#: version.c:657
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit ͼÐͽçÃæ°æ±¾"
+
+#: version.c:660
+msgid " in Win32s mode"
+msgstr "Win32s ģʽ"
+
+#: version.c:662
+msgid " with OLE support"
+msgstr "Ö§³Ö OLE"
+
+#: version.c:665
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32λ ×Ö·û½çÃæ°æ±¾"
+
+#: version.c:669
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 32λ ×Ö·û½çÃæ°æ±¾"
+
+#: version.c:673
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 λ MS-DOS °æ±¾"
+
+#: version.c:675
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 λ MS-DOS °æ±¾"
+
+#: version.c:681
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) °æ±¾"
+
+#: version.c:683
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X °æ±¾"
+
+#: version.c:686
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS °æ±¾"
+
+#: version.c:691
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS °æ±¾"
+
+#: version.c:701
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"¼ÓÈë²¹¶¡: "
+
+#: version.c:728
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"±àÒë"
+
+#: version.c:731
+msgid "by "
+msgstr "Õß:"
+
+#: version.c:743
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"³¬Ç¿°æ±¾ "
+
+#: version.c:746
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"´óÐÍ°æ±¾ "
+
+#: version.c:749
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"Ò»°ã°æ±¾ "
+
+#: version.c:752
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"¼òÒ×°æ±¾ "
+
+#: version.c:754
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"¾«¼ò°æ±¾ "
+
+#: version.c:760
+msgid "without GUI."
+msgstr "²»Ê¹ÓÃͼÐͽçÃæ¡£"
+
+#: version.c:764
+msgid "with GTK-GNOME GUI."
+msgstr "ʹÓà GTK-GNOME ͼÐͽçÃæ¡£"
+
+#: version.c:766
+msgid "with GTK GUI."
+msgstr "ʹÓà GTK ͼÐͽçÃæ¡£"
+
+#: version.c:770
+msgid "with X11-Motif GUI."
+msgstr "ʹÓà X11-Motif ͼÐͽçÃæ¡£"
+
+#: version.c:773
+msgid "with X11-Athena GUI."
+msgstr "ʹÓà X11-Athena ͼÐͽçÃæ¡£"
+
+#: version.c:776
+msgid "with BeOS GUI."
+msgstr "ʹÓà BeOS ͼÐͽçÃæ¡£"
+
+#: version.c:779
+msgid "with Photon GUI."
+msgstr "ʹÓÃPhotonͼÐͽçÃæ¡£"
+
+#: version.c:782
+msgid "with GUI."
+msgstr "ʹÓÃͼÐͽçÃæ¡£"
+
+#: version.c:785
+msgid "with Carbon GUI."
+msgstr "ʹÓà Carbon ͼÐͽçÃæ¡£"
+
+#: version.c:788
+msgid "with Cocoa GUI."
+msgstr "ʹÓà Cocoa ͼÐͽçÃæ¡£"
+
+#: version.c:791
+msgid "with (classic) GUI."
+msgstr "ʹÓà (´«Í³) ͼÐͽçÃæ¡£"
+
+#: version.c:802
+msgid " Features included (+) or not (-):\n"
+msgstr " Ä¿Ç°¿ÉʹÓÃ(+)Óë²»¿ÉʹÓÃ(-)µÄÄ£¿éÁбí:\n"
+
+#: version.c:814
+msgid " system vimrc file: \""
+msgstr " ϵͳ vimrc ÅäÖÃÎļþ: \""
+
+#: version.c:819
+msgid " user vimrc file: \""
+msgstr " Óû§µÄ vimrc ÅäÖÃÎļþ: \""
+
+#: version.c:824
+msgid " 2nd user vimrc file: \""
+msgstr " µÚ¶þ×éÓû§ vimrc Îļþ: \""
+
+#: version.c:829
+msgid " 3rd user vimrc file: \""
+msgstr " µÚÈý×éÓû§ vimrc Îļþ: \""
+
+#: version.c:834
+msgid " user exrc file: \""
+msgstr " Óû§µÄ exrc ÅäÖÃÎļþ: \""
+
+#: version.c:839
+msgid " 2nd user exrc file: \""
+msgstr " µÚ¶þ×éÓû§ exrc Îļþ: \""
+
+#: version.c:845
+msgid " system gvimrc file: \""
+msgstr " ϵͳ gvimrc Îļþ: \""
+
+#: version.c:849
+msgid " user gvimrc file: \""
+msgstr " Óû§µÄ gvimrc ÅäÖÃÎļþ: \""
+
+#: version.c:853
+msgid "2nd user gvimrc file: \""
+msgstr " µÚ¶þ×éÓû§ gvimrc Îļþ: \""
+
+#: version.c:858
+msgid "3rd user gvimrc file: \""
+msgstr " µÚÈý×éÓû§ gvimrc Îļþ: \""
+
+#: version.c:865
+msgid " system menu file: \""
+msgstr " ϵͳ²Ëµ¥ÅäÖÃÎļþ: \""
+
+#: version.c:873
+msgid " fall-back for $VIM: \""
+msgstr " $VIM Ô¤ÉèÖµ: \""
+
+#: version.c:879
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME Ô¤ÉèÖµ: \""
+
+#: version.c:883
+msgid "Compilation: "
+msgstr "±àÒ뷽ʽ: "
+
+#: version.c:889
+msgid "Compiler: "
+msgstr "±àÒëÆ÷: "
+
+#: version.c:894
+msgid "Linking: "
+msgstr "Á´½á·½Ê½: "
+
+#: version.c:899
+msgid " DEBUG BUILD"
+msgstr " µ÷ÊÔ°æ±¾"
+
+#: version.c:934
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:936
+msgid "version "
+msgstr "°æ±¾ "
+
+#: version.c:937
+msgid "by Bram Moolenaar et al."
+msgstr "ά»¤ÈË: Bram Moolenaar et al."
+
+#: version.c:938
+msgid "Vim is open source and freely distributable"
+msgstr "Vim Ϊ¿É×ÔÓÉ·¢ÐеĿª·ÅÔ´´úÂëÈí¼þ"
+
+#: version.c:940
+msgid "Help poor children in Uganda!"
+msgstr "°ïÖúÎڸɴïµÄ¿ÉÁ¯¶ùͯ!"
+
+#: version.c:941
+msgid "type :help iccf<Enter> for information "
+msgstr "½øÒ»²½ËµÃ÷ÇëÊäÈë :help iccf<Enter>"
+
+#: version.c:943
+msgid "type :q<Enter> to exit "
+msgstr "ÒªÍ˳öÇëÊäÈë :q<Enter> "
+
+#: version.c:944
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "ÔÚÏß°ïÖúÇëÊäÈë :help<Enter> "
+
+#: version.c:945
+msgid "type :help version6<Enter> for version info"
+msgstr "а汾ÐÅÏ¢ÇëÊäÈë :help version6<Enter>"
+
+#: version.c:948
+msgid "Running in Vi compatible mode"
+msgstr "Vi ¼æÈÝģʽ"
+
+#: version.c:949
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "Èç¹ûÒªÍêÈ«Ä£Ä⴫ͳ Vi ÇëÊäÈë :set nocp<Enter>"
+
+#: version.c:950
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "Èç¹ûÐèÒª¶Ô Vi ¼æÈÝģʽ½øÒ»²½ËµÃ÷ÇëÊäÈë :help cp-default<Enter>"
+
+#: version.c:990
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "×¢Òâ: ¼ì²âµ½ Windows 95/98/ME"
+
+#: version.c:993
+msgid "type :help windows95<Enter> for info on this"
+msgstr "Èç¹ûÐèÒª¶Ô Windows 95 Ö§³ÖµÄ¸ü¶àÐÅÏ¢ÇëÊäÈë :help windows95<Enter>"
+
+#: window.c:201
+msgid "E441: There is no preview window"
+msgstr "E441: ûÓÐÔ¤ÀÀ´°¿Ú"
+
+#: window.c:568
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ²»ÄÜͬʱ·Ö¸î´°¿ÚΪ×óÉϺÍÓÒϽÇ"
+
+#: window.c:1327
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ÓÐÆäËü·Ö¸î´°¿Úʱ²»ÄÜÐýת"
+
+#: window.c:1810
+msgid "E444: Cannot close last window"
+msgstr "E444: ²»ÄܹرÕ×îºóÒ»¸ö´°¿Ú"
+
+#: window.c:2474
+msgid "Already only one window"
+msgstr "ÒѾ­Ö»Ê£Ò»¸ö´°¿ÚÁË"
+
+#: window.c:2521
+msgid "E445: Other window contains changes"
+msgstr "E445: ÆäËü´°¿ÚÓиıäµÄÄÚÈÝ"
+
+#: window.c:4341
+msgid "E446: No file name under cursor"
+msgstr "E446: ¹â±ê´¦Ã»ÓÐÎļþÃû"
+
+#: window.c:4460
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: ÔÚ·¾¶ÖÐÕÒ²»µ½Îļþ \"%s\""
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "Óà &multiple Vims ±à¼­"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "Óà single &Vim ±à¼­"
+
+#: ../GvimExt/gvimext.cpp:604
+msgid "Edit with &Vim"
+msgstr "Óà &Vim ±à¼­"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:628
+msgid "Edit with existing Vim - &"
+msgstr "Óõ±Ç°µÄ Vim ±à¼­ - &"
+
+#: ../GvimExt/gvimext.cpp:752
+msgid "Edits the selected file(s) with Vim"
+msgstr "Óà Vim ±à¼­Ñ¡ÔñµÄÎļþ"
+
+#: ../GvimExt/gvimext.cpp:891 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "´´½¨½ø³Ìʧ°Ü: Çë¼ì²égvimÊÇ·ñÔÚ¿ÉÖ´Ðз¾¶ÖÐ!"
+
+#: ../GvimExt/gvimext.cpp:892 ../GvimExt/gvimext.cpp:906
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ³ö´í"
+
+#: ../GvimExt/gvimext.cpp:905
+msgid "Path length too long!"
+msgstr "·¾¶ÃûÌ«³¤"
+
+#: globals.h:878
+msgid "--No lines in buffer--"
+msgstr "--»º³åÇøÎÞ×ÊÁÏ--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1019
+msgid "Command aborted"
+msgstr "ÃüÁǿÖÆÖжÏ"
+
+#: globals.h:1020
+msgid "Argument required"
+msgstr "ÐèÒªÖ¸Áî²ÎÊý"
+
+#: globals.h:1021
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ ºóÃæÓ¦¸ÃÓÐ / ? »ò &"
+
+#: globals.h:1023
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ²»ÄÜÔÚÃüÁîÐд°¿ÚÖÐʹÓá£<CR>Ö´ÐУ¬CTRL-C Í˳ö"
+
+#: globals.h:1025
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: exrc/vimrc ÀïµÄÖ¸Áî²»ÄÜÖ´ÐÐ"
+
+#: globals.h:1026
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: ÎļþÒѾ­´æÔÚ (¿ÉÓà ! Ç¿ÖÆÌæ»»)"
+
+#: globals.h:1027
+msgid "Command failed"
+msgstr "ÃüÁîÖ´ÐÐʧ°Ü"
+
+#: globals.h:1028
+msgid "Internal error"
+msgstr "ÄÚ²¿´íÎó"
+
+#: globals.h:1029
+msgid "Interrupted"
+msgstr "ÒÑÖжÏ"
+
+#: globals.h:1030
+msgid "E14: Invalid address"
+msgstr "E14: ²»ÕýÈ·µÄµØÖ·"
+
+#: globals.h:1031
+msgid "Invalid argument"
+msgstr "²»ÕýÈ·µÄ²ÎÊý"
+
+#: globals.h:1032
+#, c-format
+msgid "Invalid argument: %s"
+msgstr "²»ÕýÈ·µÄ²ÎÊý: %s"
+
+#: globals.h:1034
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ²»ÕýÈ·µÄ±í´ïʽ: %s"
+
+#: globals.h:1036
+msgid "E16: Invalid range"
+msgstr "E16: ²»ÕýÈ·µÄ·¶Î§"
+
+#: globals.h:1037
+msgid "Invalid command"
+msgstr "²»ÕýÈ·µÄÃüÁî"
+
+#: globals.h:1039
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ÊÇĿ¼"
+
+#: globals.h:1042
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' Ç°Ãæ³öÏÖÁË´íÎóµÄ×Ö·û"
+
+#: globals.h:1044
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ±ê¼ÇµÄÐкŴíÎó"
+
+#: globals.h:1045
+msgid "E20: Mark not set"
+msgstr "E20: ûÓÐÉ趨±ê¼Ç"
+
+#: globals.h:1046
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: ÒòΪ 'modifiable' Ñ¡ÏîÊǹرյģ¬ËùÒÔ²»ÄÜÐÞ¸Ä"
+
+#: globals.h:1047
+msgid "E22: Scripts nested too deep"
+msgstr "E22: µÝ¹éµ÷ÓÃÌ«¶à²ã"
+
+#: globals.h:1048
+msgid "E23: No alternate file"
+msgstr "E23: ûÓÐÌæ´úµÄÎļþ"
+
+#: globals.h:1049
+msgid "E24: No such abbreviation"
+msgstr "E24: ûÓÐÕâ¸ö abbreviation ¶ÔÓ¦"
+
+#: globals.h:1050
+msgid "No ! allowed"
+msgstr "²»¿ÉʹÓà '!'"
+
+#: globals.h:1052
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: ÒòΪ±àÒëʱûÓмÓÈëͼÐͽçÃæµÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓÃͼÐͽçÃæ"
+
+#: globals.h:1055
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: ÒòΪ±àÒëʱûÓмÓÈëÏ£²®À³µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓà Hebrew\n"
+
+#: globals.h:1058
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: ÒòΪ±àÒëʱûÓмÓÈë Farsi µÄ³ÌÐò´úÂ룬ËùÒÔ²»ÄÜʹÓà Farsi\n"
+
+#: globals.h:1061
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ûÓÐÃûΪ '%s' µÄ highlight group"
+
+#: globals.h:1063
+msgid "E29: No inserted text yet"
+msgstr "E29: ûÓвåÈë¹ýÎÄ×Ö"
+
+#: globals.h:1064
+msgid "E30: No previous command line"
+msgstr "E30: ûÓÐÇ°Ò»ÏîÃüÁî"
+
+#: globals.h:1065
+msgid "E31: No such mapping"
+msgstr "E31: ûÓÐÕâ¸ö mapping ¶ÔÓ¦"
+
+#: globals.h:1066
+msgid "No match"
+msgstr "ÕÒ²»µ½"
+
+#: globals.h:1067
+#, c-format
+msgid "No match: %s"
+msgstr "ÕÒ²»µ½: %s"
+
+#: globals.h:1068
+msgid "E32: No file name"
+msgstr "E32: ûÓÐÎļþÃû"
+
+#: globals.h:1069
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ûÓÐÇ°Ò»¸ö²éÕÒ/Ìæ»»µÄÃüÁî"
+
+#: globals.h:1070
+msgid "E34: No previous command"
+msgstr "E34: ûÓÐÇ°Ò»¸öÃüÁî"
+
+#: globals.h:1071
+msgid "E35: No previous regular expression"
+msgstr "E35: ûÓÐÇ°Ò»¸ö²éÕÒÃüÁî"
+
+#: globals.h:1072
+msgid "No range allowed"
+msgstr "²»¿ÉʹÓ÷¶Î§ÃüÁî"
+
+#: globals.h:1074
+msgid "E36: Not enough room"
+msgstr "E36: ûÓÐ×ã¹»µÄ¿Õ¼ä"
+
+#: globals.h:1076
+#, c-format
+msgid "Can't create file %s"
+msgstr "²»ÄÜ´´½¨Îļþ %s"
+
+#: globals.h:1077
+msgid "Can't get temp file name"
+msgstr "²»Äܵõ½ÁÙʱÎļþÃû"
+
+#: globals.h:1078
+#, c-format
+msgid "Can't open file %s"
+msgstr "²»ÄÜ´ò¿ªÎļþ %s"
+
+#: globals.h:1079
+#, c-format
+msgid "Can't read file %s"
+msgstr "²»ÄܶÁÈ¡Îļþ %s"
+
+#: globals.h:1080
+msgid "E37: No write since last change (use ! to override)"
+msgstr "E37: ÎļþÄÚÈÝÒѸı䵫ÉÐδ±£´æ (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: globals.h:1081
+msgid "E38: Null argument"
+msgstr "E38: ¿ÕµÄ (Null) ²ÎÊý"
+
+#: globals.h:1083
+msgid "E39: Number expected"
+msgstr "E39: Ó¦¸ÃÒªÓÐÊý×Ö"
+
+#: globals.h:1086
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: ²»ÄÜ´ò¿ª´íÎóÎļþ %s"
+
+#: globals.h:1089
+msgid "E41: Out of memory!"
+msgstr "E41: ÄÚ´æ²»×ã!"
+
+#: globals.h:1092
+msgid "Pattern not found"
+msgstr "ÕÒ²»µ½Ä£Ê½"
+
+#: globals.h:1094
+#, c-format
+msgid "Pattern not found: %s"
+msgstr "ÕÒ²»µ½Ä£Ê½ %s"
+
+#: globals.h:1095
+msgid "Argument must be positive"
+msgstr "²ÎÊýÓ¦¸ÃÊÇÕýÊý"
+
+#: globals.h:1097
+msgid "E42: No Errors"
+msgstr "E42: ûÓдíÎó"
+
+#: globals.h:1099
+msgid "E43: Damaged match string"
+msgstr "E43: Æ¥Åä×Ö·û´®ÓÐÎÊÌâ"
+
+#: globals.h:1100
+msgid "E44: Corrupted regexp program"
+msgstr "E44: ÕýÔò±í´ïʽÓÐÎÊÌâ"
+
+#: globals.h:1101
+msgid "E45: 'readonly' option is set (use ! to override)"
+msgstr "E45: É趨 'readonly' Ñ¡Ïî(Ö»¶Á) (¿ÉÓà ! Ç¿ÖÆÖ´ÐÐ)"
+
+#: globals.h:1103
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: ²»ÄÜÉ趨ֻ¶Á±äÁ¿ \"%s\""
+
+#: globals.h:1106
+msgid "E47: Error while reading errorfile"
+msgstr "E47: ¶ÁÈ¡´íÎóÎļþʧ°Ü"
+
+#: globals.h:1109
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ²»ÄÜÔÚ sandbox Àï³öÏÖ"
+
+#: globals.h:1111
+msgid "E49: Invalid scroll size"
+msgstr "E49: ´íÎóµÄ¹ö¶¯´óС"
+
+#: globals.h:1112
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'E71: Ñ¡Ïî 'shell' δÉ趨"
+
+#: globals.h:1113
+msgid "E72: Close error on swap file"
+msgstr "E72: ½»»»Îļþ¹Ø±Õ´íÎó"
+
+#: globals.h:1114
+msgid "E73: tag stack empty"
+msgstr "E73: ±êÇ©¶ÑÕ»ÒÑ¿Õ"
+
+#: globals.h:1115
+msgid "E74: Command too complex"
+msgstr "E74: ÃüÁîÌ«¸´ÔÓ"
+
+#: globals.h:1116
+msgid "E75: Name too long"
+msgstr "E75: Ãû×ÖÌ«³¤"
+
+#: globals.h:1117
+msgid "E76: Too many ["
+msgstr "E76: Ì«¶à ["
+
+#: globals.h:1118
+msgid "E77: Too many file names"
+msgstr "E77: Ì«¶àÎļþÃû"
+
+#: globals.h:1119
+msgid "Trailing characters"
+msgstr "ÄãÊäÈëÁ˶àÓàµÄ×Ö·û"
+
+#: globals.h:1120
+msgid "E78: Unknown mark"
+msgstr "E78: ²»ÄÜ°ìʶµÄ±ê¼Ç"
+
+#: globals.h:1121
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: ²»ÄÜÀ©Õ¹Í¨Åä·û"
+
+#: globals.h:1122
+msgid "E80: Error while writing"
+msgstr "E80: дÈë´íÎó"
+
+#: globals.h:1123
+msgid "Zero count"
+msgstr "Êýµ½Áã (?)"
+
+#: globals.h:1125
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ²»ÄÜÔÚ script ±¾ÎÄÍâʹÓÃ."
diff --git a/src/po/zh_TW.UTF-8.po b/src/po/zh_TW.UTF-8.po
new file mode 100644
index 000000000..0af90e6b8
--- /dev/null
+++ b/src/po/zh_TW.UTF-8.po
@@ -0,0 +1,6389 @@
+# Traditional Chinese Translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Francis S.Lin <piaip@csie.ntu.edu.tw>, 2000
+# FIRST RELEASE Thu Jun 14 14:24:17 CST 2001
+#
+# Last update: Thu Apr 24 13:09:07 CST 2003 (6.2a)
+#
+# To update, search pattern: /fuzzy\|^msgstr ""\(\n"\)\@!
+#
+# DO NOT USE WORDS WITH BACKSLASH ('\') AS SECOND BYTE OF BIG5 CHARS
+# EG: '功', # 許功蓋
+# é¤æž¯é–±ç®ç©€è·šæ·šèº¡è±¹æ“ºç’žç¸·é«å­æ­¿ä¿ž
+# 墦娉崤黠孀廄çµæ„§ç¨žéˆ¾æšå…么å’æ²”å¼è‹’塿踊
+# you can replace these characters with alternative words.
+# THIS WILL CAUSE INCOMPATIBLE ON gettext 0.10.36+
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Traditional Chinese)\n"
+"POT-Creation-Date: 2003-04-24 13:06+0800\n"
+"PO-Revision-Date: Mon Feb 19 22:49:21 CST 2001\n"
+"Last-Translator: Francis S.Lin <piaip@csie.ntu.edu.tw>\n"
+"Language-Team: Francis S.Lin <piaip@csie.ntu.edu.tw>, Cecil Sheng "
+"<b7506022@csie.ntu.edu.tw>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: 無法é…置任何緩è¡å€ï¼Œé›¢é–‹ç¨‹å¼..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: 無法é…置緩è¡å€ï¼Œä½¿ç”¨å¦ä¸€å€‹ç·©è¡å€...."
+
+#: buffer.c:797
+msgid "E515: No buffers were unloaded"
+msgstr "E515: 沒有釋放任何緩è¡å€"
+
+#: buffer.c:799
+msgid "E516: No buffers were deleted"
+msgstr "E516: 沒有刪除任何緩è¡å€"
+
+#: buffer.c:801
+msgid "E517: No buffers were wiped out"
+msgstr "E517: 沒有清除任何緩è¡å€"
+
+#: buffer.c:809
+msgid "1 buffer unloaded"
+msgstr "已釋放一個緩è¡å€"
+
+#: buffer.c:811
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "已釋放 %d 個緩è¡å€"
+
+#: buffer.c:816
+msgid "1 buffer deleted"
+msgstr "已刪除一個緩è¡å€"
+
+#: buffer.c:818
+#, c-format
+msgid "%d buffers deleted"
+msgstr "已刪除 %d 個緩è¡å€"
+
+#: buffer.c:823
+msgid "1 buffer wiped out"
+msgstr "已刪除一個緩è¡å€"
+
+#: buffer.c:825
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "已刪除 %d 個緩è¡å€"
+
+#: buffer.c:886
+msgid "E84: No modified buffer found"
+msgstr "E84: 沒有修改éŽçš„ç·©è¡å€"
+
+#. back where we started, didn't find anything.
+#: buffer.c:925
+msgid "E85: There is no listed buffer"
+msgstr "E85: 沒有列出的緩è¡å€"
+
+#: buffer.c:937
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: 無法切æ›åˆ°ç¬¬ %ld 個緩è¡å€"
+
+#: buffer.c:940
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: 無法切æ›åˆ°æ›´å¾Œé¢çš„ç·©è¡å€"
+
+#: buffer.c:942
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: 無法切æ›åˆ°æ›´å‰é¢çš„ç·©è¡å€"
+
+#: buffer.c:966
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: 已更改éŽç·©è¡å€ %ld 但尚未存檔 (å¯ç”¨ ! 強制執行)"
+
+#: buffer.c:982
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: 無法釋放最後一個緩è¡å€"
+
+#: buffer.c:1494
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: 警告: 檔åéŽå¤š"
+
+#: buffer.c:1664
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: 找ä¸åˆ°ç¬¬ %ld 個緩è¡å€"
+
+#: buffer.c:1890
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: 找到一個以上的 %s"
+
+#: buffer.c:1892
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: 找ä¸åˆ° %s"
+
+#: buffer.c:2297 ex_docmd.c:6479
+#, c-format
+msgid "line %ld"
+msgstr "行 %ld"
+
+#: buffer.c:2380
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: 已有緩è¡å€ä½¿ç”¨é€™å€‹åå­—"
+
+#: buffer.c:2673
+msgid " [Modified]"
+msgstr " [已修改]"
+
+#: buffer.c:2678
+msgid "[Not edited]"
+msgstr "[未編輯]"
+
+#: buffer.c:2683
+msgid "[New file]"
+msgstr "[新檔案]"
+
+#: buffer.c:2684
+msgid "[Read errors]"
+msgstr "[讀å–錯誤]"
+
+#: buffer.c:2686 fileio.c:1914
+msgid "[readonly]"
+msgstr "[唯讀]"
+
+#: buffer.c:2701
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "行數 1 --%d%%--"
+
+#: buffer.c:2703
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "行數 %ld --%d%%--"
+
+#: buffer.c:2710
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "行 %ld/%ld --%d%%-- 欄 "
+
+#: buffer.c:2811
+msgid "[No file]"
+msgstr "[未命å]"
+
+#. must be a help buffer
+#: buffer.c:2851
+msgid "help"
+msgstr "[輔助說明]"
+
+#: buffer.c:3405 screen.c:4943
+msgid "[help]"
+msgstr "[輔助說明]"
+
+#: buffer.c:3437 screen.c:4949
+msgid "[Preview]"
+msgstr "[é è¦½]"
+
+#: buffer.c:3708
+msgid "All"
+msgstr "全部"
+
+#: buffer.c:3708
+msgid "Bot"
+msgstr "底端"
+
+#: buffer.c:3710
+msgid "Top"
+msgstr "頂端"
+
+#: buffer.c:4454
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# ç·©è¡å€åˆ—表:\n"
+
+#: buffer.c:4487
+msgid "[Error List]"
+msgstr "[錯誤列表]"
+
+#: buffer.c:4500 memline.c:1501
+msgid "[No File]"
+msgstr "[未命å]"
+
+#: buffer.c:4803
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- 符號 ---"
+
+#: buffer.c:4813
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s 的符號:"
+
+#: buffer.c:4819
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " è¡Œ=%ld id=%d å稱=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: 無法比較(diff) %ld個以上的緩è¡å€"
+
+#: diff.c:651
+msgid "E97: Cannot create diffs"
+msgstr "E97: ä¸èƒ½å»ºç«‹ "
+
+#: diff.c:750
+msgid "Patch file"
+msgstr "Patch 檔案"
+
+#: diff.c:1001
+msgid "E98: Cannot read diff output"
+msgstr "E98: ç„¡æ³•è®€å– diff 的輸出"
+
+#: diff.c:1742
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ç›®å‰çš„ç·©è¡å€ä¸æ˜¯åœ¨ diff 模å¼"
+
+#: diff.c:1754
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: 沒有緩è¡å€åœ¨ diff 模å¼"
+
+#: diff.c:1762
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: 有兩個以上的緩è¡å€åœ¨ diff 模å¼ï¼Œç„¡æ³•æ±ºå®šè¦ç”¨å“ªä¸€å€‹"
+
+#: diff.c:1785
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: 找ä¸åˆ°ç·©è¡å€: \"%s\""
+
+#: diff.c:1791
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: ç·©è¡å€ \"%s\" ä¸æ˜¯åœ¨ diff 模å¼"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: 複åˆå­—å…ƒ(digraph)中ä¸èƒ½ä½¿ç”¨ Escape"
+
+#: digraph.c:2344
+msgid "E544: Keymap file not found"
+msgstr "E544: 找ä¸åˆ° keymap 檔"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: 使用 :loadkeymap "
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " é—œéµå­—è‡ªå‹•å®Œæˆ (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X æ¨¡å¼ (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " å€åŸŸé—œéµå­—è‡ªå‹•å®Œæˆ (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " æ•´è¡Œè‡ªå‹•å®Œæˆ (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " 檔åè‡ªå‹•å®Œæˆ (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " æ¨™ç±¤è‡ªå‹•å®Œæˆ (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " è·¯å¾‘è‡ªå‹•å®Œæˆ (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " å®šç¾©è‡ªå‹•å®Œæˆ (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " å­—å…¸è‡ªå‹•å®Œæˆ (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus è‡ªå‹•å®Œæˆ (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " å‘½ä»¤åˆ—è‡ªå‹•å®Œæˆ (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "已到段è½çµå°¾"
+
+#: edit.c:941
+msgid "'thesaurus' option is empty"
+msgstr "é¸é … 'thesaurus' 未設定"
+
+#: edit.c:1145
+msgid "'dictionary' option is empty"
+msgstr "é¸é … 'dictionary' 未設定"
+
+#: edit.c:2130
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "掃瞄字典: %s"
+
+#: edit.c:2336
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (æ’å…¥) Scroll (^E/^Y)"
+
+#: edit.c:2338
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (å–代) Scroll (^E/^Y)"
+
+#: edit.c:2652
+#, c-format
+msgid "Scanning: %s"
+msgstr "掃瞄中: %s"
+
+#: edit.c:2687
+msgid "Scanning tags."
+msgstr "掃瞄標籤."
+
+#: edit.c:3349
+msgid " Adding"
+msgstr " 增加"
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3398
+msgid "-- Searching..."
+msgstr "-- æœå°‹ä¸­..."
+
+#: edit.c:3454
+msgid "Back at original"
+msgstr "回到起點"
+
+#: edit.c:3459
+msgid "Word from other line"
+msgstr "從別行開始的字 (?)"
+
+#: edit.c:3464
+msgid "The only match"
+msgstr "åªæœ‰æ­¤é …符åˆ"
+
+#: edit.c:3523
+#, c-format
+msgid "match %d of %d"
+msgstr "找到 %d / %d"
+
+#: edit.c:3526
+#, c-format
+msgid "match %d"
+msgstr "ç¬¦åˆ %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:889
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: 未定義的變數: \"%s\""
+
+#: eval.c:1185
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: 缺少å°æ‡‰çš„括號: %s"
+
+#: eval.c:1290 eval.c:1304
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: 無此變數: \"%s\""
+
+#: eval.c:1560
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' 後缺少 ':'"
+
+#: eval.c:2176
+msgid "E110: Missing ')'"
+msgstr "E110: 缺少å°æ‡‰çš„ \")\""
+
+#: eval.c:2233
+msgid "E111: Missing ']'"
+msgstr "E111: 缺少å°æ‡‰çš„ \"]\""
+
+#: eval.c:2309
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: 缺少é¸é …å稱: %s"
+
+#: eval.c:2327
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ä¸æ­£ç¢ºçš„é¸é …: %s"
+
+#: eval.c:2391
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: 缺少引號: %s"
+
+#: eval.c:2523
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: 缺少引號: %s"
+
+#: eval.c:2843
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: å‡½å¼ %s 的引數ä¸æ­£ç¢º"
+
+#: eval.c:2844
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: 未定義的函å¼: %s"
+
+#: eval.c:2845
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: å‡½å¼ %s 的引數éŽå¤š"
+
+#: eval.c:2846
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: å‡½å¼ %s 的引數太少"
+
+#: eval.c:2847
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ä¸èƒ½åœ¨ script 本文外使用: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3465 gui.c:4238 gui_gtk.c:1991
+msgid "&Ok"
+msgstr "確定(&O)"
+
+#: eval.c:4000
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld 行: "
+
+#: eval.c:5149
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"確定(&O)\n"
+"å–消(&C)"
+
+#: eval.c:5182
+msgid "called inputrestore() more often than inputsave()"
+msgstr "å‘¼å« inputrestore() 的次數比 inputsave() 還多"
+
+#: eval.c:6036
+msgid "E240: No connection to Vim server"
+msgstr "E240: 沒有與 Vim Server 建立連線"
+
+#: eval.c:6133
+msgid "E277: Unable to read a server reply"
+msgstr "E277: 無法讀å–伺æœå™¨çš„回應"
+
+#: eval.c:6161
+msgid "E258: Unable to send to client"
+msgstr "E258: 無法傳é€åˆ° client"
+
+#: eval.c:6209
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: 無法傳é€åˆ° %s"
+
+#: eval.c:6309
+msgid "(Invalid)"
+msgstr "(ä¸æ­£ç¢º)"
+
+#: eval.c:7402
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: 變數 %s 尚未定義"
+
+#: eval.c:7834
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: ä¸åˆæ³•çš„變數å稱: %s"
+
+#: eval.c:8121
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: å‡½å¼ %s 已經存在, 請使用 ! 強制å–代"
+
+#: eval.c:8188
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: å‡½å¼ %s 尚未定義"
+
+#: eval.c:8201
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: 缺少 \"(\": %s"
+
+#: eval.c:8234
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: åƒæ•¸ä¸æ­£ç¢º: %s"
+
+#: eval.c:8313
+msgid "E126: Missing :endfunction"
+msgstr "E126: 缺少 :endfunction"
+
+#: eval.c:8396
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: å‡½å¼ %s 正在使用中,無法é‡æ–°å®šç¾©"
+
+#: eval.c:8464
+msgid "E129: Function name required"
+msgstr "E129: 需è¦å‡½å¼å稱"
+
+#: eval.c:8515
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: 函å¼å稱第一個字æ¯å¿…須大寫: %s"
+
+#: eval.c:8707
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: å‡½å¼ %s 尚未定義"
+
+#: eval.c:8712
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: å‡½å¼ %s 正在使用中,無法刪除"
+
+#: eval.c:8760
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: 函å¼éžè¿´å‘¼å«å±¤æ•¸è¶…éŽ 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8813
+#, c-format
+msgid "calling %s"
+msgstr "å‘¼å« %s"
+
+#: eval.c:8867
+#, c-format
+msgid "%s aborted"
+msgstr "%s 被強制中斷執行"
+
+#: eval.c:8869
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s 傳回值 #%ld "
+
+#: eval.c:8872
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s 傳回值 \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:8888 ex_cmds2.c:2231
+#, c-format
+msgid "continuing in %s"
+msgstr "繼續: %s"
+
+#: eval.c:8935
+msgid "E133: :return not inside a function"
+msgstr "E133: :return 必須在函å¼è£¡ä½¿ç”¨"
+
+#: eval.c:9266
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# 全域變數:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, åå…­é€²ä½ %02x, å…«é€²ä½ %03o"
+
+#: ex_cmds.c:433
+msgid "E134: Move lines into themselves"
+msgstr "E134: 無法把行移到它自已內"
+
+#: ex_cmds.c:502
+msgid "1 line moved"
+msgstr "å·²æ¬ç§» 1 è¡Œ"
+
+#: ex_cmds.c:504
+#, c-format
+msgid "%ld lines moved"
+msgstr "å·²æ¬ç§» %ld è¡Œ"
+
+#: ex_cmds.c:909
+#, c-format
+msgid "%ld lines filtered"
+msgstr "å·²è™•ç† %ld è¡Œ"
+
+#: ex_cmds.c:937
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autocommand ä¸å¯ä»¥æ›´æ”¹ç·©è¡å€çš„內容"
+
+#: ex_cmds.c:1022
+msgid "[No write since last change]\n"
+msgstr "[更新後尚未儲存]\n"
+
+#: ex_cmds.c:1268
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s 在行中: "
+
+#: ex_cmds.c:1273
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: éŽå¤šéŒ¯èª¤, 忽略檔案其餘部分"
+
+#: ex_cmds.c:1302
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "è®€å– viminfo 檔案 \"%s\"%s%s%s"
+
+#: ex_cmds.c:1303
+msgid " info"
+msgstr " 訊æ¯"
+
+#: ex_cmds.c:1304
+msgid " marks"
+msgstr " 標記"
+
+#: ex_cmds.c:1305
+msgid " FAILED"
+msgstr " 失敗"
+
+#: ex_cmds.c:1396
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo 檔案無法寫入: %s"
+
+#: ex_cmds.c:1521
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: 無法寫入 viminfo 檔案 %s !"
+
+#: ex_cmds.c:1529
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "寫入 viminfo 檔案 \"%s\" 中"
+
+#. Write the info:
+#: ex_cmds.c:1627
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# 本 viminfo 檔案是由 Vim %s 所產生.\n"
+
+#: ex_cmds.c:1629
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# 如果想è¦è‡ªè¡Œä¿®æ”¹è«‹ç‰¹åˆ¥å°å¿ƒï¼\n"
+"\n"
+
+#: ex_cmds.c:1631
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' 在此檔建立時的值\n"
+
+#: ex_cmds.c:1730
+msgid "Illegal starting char"
+msgstr "無效的起始字元"
+
+#: ex_cmds.c:2075 ex_cmds.c:2340 ex_cmds2.c:744
+msgid "Save As"
+msgstr "å¦å­˜æ–°æª”"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2118
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: 您在å¦ä¸€å€‹ç·©è¡å€ä¹Ÿè¼‰å…¥äº†é€™å€‹æª”案"
+
+#: ex_cmds.c:2152
+msgid "Write partial file?"
+msgstr "è¦å¯«å…¥éƒ¨åˆ†æª”案嗎?"
+
+#: ex_cmds.c:2159
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: 請使用 ! 以寫入部分緩è¡å€"
+
+#: ex_cmds.c:2274
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "è¦è¦†å¯«å·²å­˜åœ¨çš„檔案 \"%.*s\"?"
+
+#: ex_cmds.c:2345
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ç·©è¡å€ %ld 沒有檔案å稱"
+
+#: ex_cmds.c:2383
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: 檔案未寫入,因為 'write' é¸é …被關閉"
+
+#: ex_cmds.c:2403
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" 已設定 'readonly' é¸é ….\n"
+"確定è¦è¦†å¯«å—Žï¼Ÿ"
+
+#: ex_cmds.c:2568
+msgid "Edit File"
+msgstr "編輯檔案"
+
+#: ex_cmds.c:3137
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommands æ„外地刪除新緩è¡å€ %s"
+
+#: ex_cmds.c:3269
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: :z ä¸æŽ¥å—éžæ•¸å­—çš„åƒæ•¸"
+
+#: ex_cmds.c:3354
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim 中ç¦æ­¢ä½¿ç”¨ shell 命令"
+
+#: ex_cmds.c:3461
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regular expression 無法用字æ¯åˆ†éš” (?)"
+
+#: ex_cmds.c:3807
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "å–代為 %s (y/n/a/q/^E/^Y)?"
+
+#: ex_cmds.c:4172
+msgid "(Interrupted) "
+msgstr "(已中斷) "
+
+#: ex_cmds.c:4176
+msgid "1 substitution"
+msgstr "å–代一組"
+
+#: ex_cmds.c:4178
+#, c-format
+msgid "%ld substitutions"
+msgstr "å–代 %ld 組"
+
+#: ex_cmds.c:4181
+msgid " on 1 line"
+msgstr " 一行中"
+
+#: ex_cmds.c:4183
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld 行中"
+
+#: ex_cmds.c:4234
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global 無法éžè¿´åŸ·è¡Œ"
+
+#: ex_cmds.c:4269
+msgid "E148: Regular expression missing from global"
+msgstr "E148: æ²’æœ‰ä½¿ç”¨éŽ Regular expression (?)"
+
+#: ex_cmds.c:4318
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "æ¯ä¸€è¡Œéƒ½æ‰¾ä¸åˆ°: %s"
+
+#: ex_cmds.c:4399
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# å‰ä¸€çµ„替代字串:\n"
+"$"
+
+#: ex_cmds.c:4503
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: 抱歉, 沒有 %s 的說明"
+
+#: ex_cmds.c:4537
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "抱歉, 找ä¸åˆ°èªªæ˜Žæª” \"%s\""
+
+#: ex_cmds.c:5012
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ä¸æ˜¯ç›®éŒ„"
+
+#: ex_cmds.c:5040
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: 無法以寫入模å¼é–‹å•Ÿ \"%s\""
+
+#: ex_cmds.c:5075
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: 無法讀å–檔案: %s"
+
+#: ex_cmds.c:5154
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: 標籤(tag) \"%s\" 在檔案 %s 裡é‡è¤‡å‡ºç¾å¤šæ¬¡"
+
+#: ex_cmds.c:5261
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: 未定義的 sign command: %s"
+
+#: ex_cmds.c:5281
+msgid "E156: Missing sign name"
+msgstr "E156: 缺少 sign å稱"
+
+#: ex_cmds.c:5327
+msgid "E612: Too many signs defined"
+msgstr "E612: 已定義太多 signs"
+
+#: ex_cmds.c:5394
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ä¸æ­£ç¢ºçš„ sign 文字: %s"
+
+#: ex_cmds.c:5425 ex_cmds.c:5611
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ä¸æ­£ç¢ºçš„ sign: %s"
+
+#: ex_cmds.c:5471
+msgid "E159: Missing sign number"
+msgstr "E159: 缺少 sign number"
+
+#: ex_cmds.c:5551
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: ç·©è¡å€å稱錯誤: %s"
+
+#: ex_cmds.c:5590
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Sign ID 錯誤: %ld"
+
+#: ex_cmds.c:5761
+msgid "[Deleted]"
+msgstr "[已刪除]"
+
+#: ex_cmds2.c:82
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "進入除錯模å¼. 輸入 \"cont\" 以回到正常模å¼."
+
+#: ex_cmds2.c:86 ex_docmd.c:850
+#, c-format
+msgid "line %ld: %s"
+msgstr "行 %ld: %s"
+
+#: ex_cmds2.c:88
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:271
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "\"%s%s\" 中斷點: 第 %ld 行"
+
+#: ex_cmds2.c:521
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: 找ä¸åˆ°ä¸­æ–·é»ž: %s"
+
+#: ex_cmds2.c:547
+msgid "No breakpoints defined"
+msgstr "沒有定義中斷點"
+
+#: ex_cmds2.c:552
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s 第 %ld 行"
+
+#: ex_cmds2.c:767
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "將變動存儲至 \"%.*s\"?"
+
+#: ex_cmds2.c:769 ex_docmd.c:8820
+msgid "Untitled"
+msgstr "未命å"
+
+#: ex_cmds2.c:905
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: 已更改éŽç·©è¡å€ \"%s\" 但尚未存檔 (å¯ç”¨ ! 強制執行)"
+
+#: ex_cmds2.c:974
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "注æ„: 已切æ›åˆ°å…¶å®ƒç·©è¡å€ (請檢查 Autocommands 有無錯誤)"
+
+#: ex_cmds2.c:1377
+msgid "E163: There is only one file to edit"
+msgstr "E163: åªæœ‰ä¸€å€‹æª”案å¯ç·¨è¼¯"
+
+#: ex_cmds2.c:1379
+msgid "E164: Cannot go before first file"
+msgstr "E164: 已經在第一個檔案了"
+
+#: ex_cmds2.c:1381
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: 已經在最後一個檔案了"
+
+#: ex_cmds2.c:1828
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "æœå°‹ä¸­: \"%s\" -- \"%s\""
+
+#: ex_cmds2.c:1850
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "æœå°‹ä¸­: \"%s\""
+
+#: ex_cmds2.c:1871
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "在 'runtimepath' 裡找ä¸åˆ° \"%s\""
+
+#: ex_cmds2.c:1905
+msgid "Source Vim script"
+msgstr "執行 Vim script"
+
+#: ex_cmds2.c:2056
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "無法執行目錄: \"%s\""
+
+#: ex_cmds2.c:2086
+#, c-format
+msgid "could not source \"%s\""
+msgstr "無法執行 \"%s\""
+
+#: ex_cmds2.c:2088
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "第 %ld 行: 無法執行 \"%s\""
+
+#: ex_cmds2.c:2102
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "執行 \"%s\" 中"
+
+#: ex_cmds2.c:2104
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "第 %ld è¡Œ: çµæŸåŸ·è¡Œ %s"
+
+#: ex_cmds2.c:2229
+#, c-format
+msgid "finished sourcing %s"
+msgstr "çµæŸåŸ·è¡Œ %s"
+
+#: ex_cmds2.c:2528
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: 注æ„: 錯誤的行分隔字元,å¯èƒ½æ˜¯å°‘了 ^M"
+
+#: ex_cmds2.c:2577
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: 在執行 script 檔案外ä¸å¯ä½¿ç”¨ :scriptencoding"
+
+#: ex_cmds2.c:2610
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: 在執行 script 檔案外ä¸å¯ä½¿ç”¨ :finish"
+
+#: ex_cmds2.c:3004
+#, c-format
+msgid "Page %d"
+msgstr "第 %d é "
+
+#: ex_cmds2.c:3116
+msgid "No text to be printed"
+msgstr "沒有è¦åˆ—å°çš„文字"
+
+#: ex_cmds2.c:3194
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "列å°ä¸­: 第 %d é  (%d%%)"
+
+#: ex_cmds2.c:3203
+#, c-format
+msgid " Copy %d of %d"
+msgstr "複製 %d / %d"
+
+#: ex_cmds2.c:3255
+#, c-format
+msgid "Printed: %s"
+msgstr "已列å°: %s"
+
+#: ex_cmds2.c:3262
+msgid "Printing aborted"
+msgstr "å·²å–消列å°"
+
+#: ex_cmds2.c:3645
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: 無法寫入 PostScript 輸出檔"
+
+#: ex_cmds2.c:4320
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: 無法開啟 PostScript 輸出檔"
+
+#: ex_cmds2.c:4362
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: 無法開啟檔案 \"%s\""
+
+#: ex_cmds2.c:4373
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: ç„¡æ³•è®€å– PostScript resource 檔 \"%s\""
+
+#: ex_cmds2.c:4576
+msgid "Sending to printer..."
+msgstr "傳é€è³‡æ–™åˆ°å°è¡¨æ©Ÿ..."
+
+#: ex_cmds2.c:4580
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: ç„¡æ³•åˆ—å° PostScript 檔案"
+
+#: ex_cmds2.c:4582
+msgid "Print job sent."
+msgstr "å·²é€å‡ºåˆ—å°å·¥ä½œã€‚"
+
+#: ex_cmds2.c:4978
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "ç›®å‰çš„ %s語言: \"%s\""
+
+#: ex_cmds2.c:4989
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ä¸èƒ½è¨­å®šèªžè¨€æˆ \"%s\""
+
+#: ex_docmd.c:486
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "進入 Ex 模å¼. 輸入 \"visua\" 以回到正常模å¼."
+
+#. must be at EOF
+#: ex_docmd.c:522
+msgid "E501: At end-of-file"
+msgstr "E501: 已到檔案çµå°¾"
+
+#: ex_docmd.c:624
+msgid "E169: Command too recursive"
+msgstr "E169: 命令éžè¿´å±¤æ•¸éŽå¤š"
+
+#: ex_docmd.c:1090
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: 未攔截的例外: %s"
+
+#: ex_docmd.c:1176
+msgid "End of sourced file"
+msgstr "命令檔çµæŸ"
+
+#: ex_docmd.c:1177
+msgid "End of function"
+msgstr "函å¼çµå°¾"
+
+#: ex_docmd.c:1628
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: 使用者定義的命令會混淆"
+
+#: ex_docmd.c:1642
+msgid "E492: Not an editor command"
+msgstr "E492: ä¸æ˜¯ç·¨è¼¯å™¨çš„命令"
+
+#: ex_docmd.c:1725
+msgid "E478: Don't panic!"
+msgstr "E478: ä¸è¦é©šæ…Œ!"
+
+#: ex_docmd.c:1744
+msgid "E493: Backwards range given"
+msgstr "E493: 指定了å‘å‰åƒè€ƒçš„範åœ"
+
+#: ex_docmd.c:1753
+msgid "Backwards range given, OK to swap"
+msgstr "指定了å‘å‰åƒè€ƒçš„範åœï¼ŒOK to swap"
+
+#: ex_docmd.c:1864
+msgid "E494: Use w or w>>"
+msgstr "E494: 請使用 w 或 w>>"
+
+#: ex_docmd.c:3446
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: 抱歉, 本命令在此版本中沒有實作"
+
+#: ex_docmd.c:3624
+msgid "E172: Only one file name allowed"
+msgstr "E172: åªèƒ½æœ‰ä¸€å€‹æª”"
+
+#: ex_docmd.c:4191
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "還有 %d 個檔案未編輯. 確定è¦é›¢é–‹ï¼Ÿ"
+
+#: ex_docmd.c:4198
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: 還有 %ld 個檔案未編輯"
+
+#: ex_docmd.c:4292
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: 命令已經存在, 請使用 ! 強制é‡æ–°å®šç¾©"
+
+#: ex_docmd.c:4397
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" å稱 åƒæ•¸ ç¯„åœ å®Œæ•´ 定義 "
+
+#: ex_docmd.c:4486
+msgid "No user-defined commands found"
+msgstr "找ä¸åˆ°ä½¿ç”¨è€…定義的命令"
+
+#: ex_docmd.c:4517
+msgid "E175: No attribute specified"
+msgstr "E175: 沒有指定的屬性"
+
+#: ex_docmd.c:4569
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ä¸æ­£ç¢ºçš„åƒæ•¸æ•¸ç›®"
+
+#: ex_docmd.c:4584
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ä¸èƒ½æŒ‡å®šå…©æ¬¡æ•¸ç›®"
+
+#: ex_docmd.c:4594
+msgid "E178: Invalid default value for count"
+msgstr "E178: 數目的é è¨­åƒæ•¸ä¸æ­£ç¢º"
+
+#: ex_docmd.c:4622
+msgid "E179: argument required for complete"
+msgstr "E179: 指令需è¦åƒæ•¸æ‰èƒ½å®Œæˆ"
+
+#: ex_docmd.c:4641
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ä¸å®Œæ•´çš„值: '%s'"
+
+#: ex_docmd.c:4649
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ä¸æ­£ç¢ºçš„屬性: %s"
+
+#: ex_docmd.c:4690
+msgid "E182: Invalid command name"
+msgstr "E182: 指令å稱ä¸æ­£ç¢º"
+
+#: ex_docmd.c:4705
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: 使用者自定指令必須以大寫字æ¯é–‹å§‹"
+
+#: ex_docmd.c:4774
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: 沒有使用者自定的命令: %s"
+
+#: ex_docmd.c:5230
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: 找ä¸åˆ°é¡è‰²æ¨£å¼ %s"
+
+#: ex_docmd.c:5238
+msgid "Greetings, Vim user!"
+msgstr "å—¨, Vim 使用者ï¼"
+
+#: ex_docmd.c:5946
+msgid "Edit File in new window"
+msgstr "在新視窗編輯檔案"
+
+#: ex_docmd.c:6219
+msgid "No swap file"
+msgstr "無暫存檔"
+
+#: ex_docmd.c:6323
+msgid "Append File"
+msgstr "附加檔案"
+
+#: ex_docmd.c:6387
+msgid "E186: No previous directory"
+msgstr "E186: 沒有å‰ä¸€å€‹ç›®éŒ„"
+
+#: ex_docmd.c:6469
+msgid "E187: Unknown"
+msgstr "E187: 無法辦識的標記"
+
+#: ex_docmd.c:6554
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize 需è¦å…©å€‹åƒæ•¸"
+
+#: ex_docmd.c:6605
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "視窗ä½ç½®: X %d, Y %d"
+
+#: ex_docmd.c:6610
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: 在您的平å°ä¸Šç„¡æ³•ç²å¾—視窗ä½ç½®"
+
+#: ex_docmd.c:6620
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos 需è¦å…©å€‹åƒæ•¸"
+
+#: ex_docmd.c:6899
+msgid "Save Redirection"
+msgstr "儲存 Redirection"
+
+#: ex_docmd.c:7046
+msgid "Save View"
+msgstr "儲存 View"
+
+#: ex_docmd.c:7047
+msgid "Save Session"
+msgstr "儲存 Session"
+
+#: ex_docmd.c:7049
+msgid "Save Setup"
+msgstr "儲存設定"
+
+#: ex_docmd.c:7200
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" 已存在 (請用 ! 強制執行)"
+
+#: ex_docmd.c:7205
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: 無法以寫入模å¼é–‹å•Ÿ \"%s\""
+
+#. set mark
+#: ex_docmd.c:7229
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: åƒæ•¸å¿…須是英文字æ¯æˆ–å‘å‰/後的引號"
+
+#: ex_docmd.c:7271
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal éžè¿´å±¤æ•¸éŽæ·±"
+
+#: ex_docmd.c:7772
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: 沒有 '#' å¯æ›¿ä»£çš„檔å"
+
+#: ex_docmd.c:7803
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: 沒有 Autocommand 檔å以å–代 \"<afile>\""
+
+#: ex_docmd.c:7811
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: 沒有 Autocommand ç·©è¡å€å稱以å–代 \"<abuf>\""
+
+#: ex_docmd.c:7822
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: 沒有 Autocommand 符åˆå稱以å–代 \"<amatch>\""
+
+#: ex_docmd.c:7832
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: 沒有 :source 檔å以å–代 \"<sfile>\""
+
+#: ex_docmd.c:7873
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: '%' 或 '#' 指å‘空檔å,åªèƒ½ç”¨æ–¼ \":p:h\""
+
+#: ex_docmd.c:7875
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: 輸入為空字串"
+
+#: ex_docmd.c:8802
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: ç„¡æ³•è®€å– viminfo"
+
+#: ex_docmd.c:8975
+msgid "E196: No digraphs in this version"
+msgstr "E196: 本版本無複åˆå­—å…ƒ(digraph)"
+
+#: ex_eval.c:407
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: ä¸èƒ½ :throw 用 'Vim' 開頭的例外"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:488
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "丟出例外: %s"
+
+#: ex_eval.c:530
+#, c-format
+msgid "Exception finished: %s"
+msgstr "例外çµæŸï¼š %s"
+
+#: ex_eval.c:531
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "已丟棄例外: %s"
+
+#: ex_eval.c:582 ex_eval.c:620
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, 行 %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:596
+#, c-format
+msgid "Exception caught: %s"
+msgstr "發生例外:%s"
+
+#: ex_eval.c:667
+#, c-format
+msgid "%s made pending"
+msgstr "%s é€ æˆ pending"
+
+#: ex_eval.c:670
+#, c-format
+msgid "%s resumed"
+msgstr "%s 已回復"
+
+#: ex_eval.c:674
+#, c-format
+msgid "%s discarded"
+msgstr "%s 已丟棄"
+
+#: ex_eval.c:700
+msgid "Exception"
+msgstr "例外"
+
+#: ex_eval.c:706
+msgid "Error and interrupt"
+msgstr "錯誤與中斷"
+
+#: ex_eval.c:708 gui.c:4237
+msgid "Error"
+msgstr "錯誤"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:710
+msgid "Interrupt"
+msgstr "中斷"
+
+#: ex_eval.c:779
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if 層數éŽæ·±"
+
+#: ex_eval.c:816
+msgid "E580: :endif without :if"
+msgstr "E580: :endif 缺少å°æ‡‰çš„ :if"
+
+#: ex_eval.c:860
+msgid "E581: :else without :if"
+msgstr "E581: :else 缺少å°æ‡‰çš„ :if"
+
+#: ex_eval.c:863
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif 缺少å°æ‡‰çš„ :if"
+
+#: ex_eval.c:870
+msgid "E583: multiple :else"
+msgstr "E583: å¤šé‡ :else"
+
+#: ex_eval.c:873
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif 在 :else 之後"
+
+#: ex_eval.c:940
+msgid "E585: :while nesting too deep"
+msgstr "E585: :while 層數éŽæ·±"
+
+#: ex_eval.c:996
+msgid "E586: :continue without :while"
+msgstr "E586: :continue 缺少å°æ‡‰çš„ :while"
+
+#: ex_eval.c:1036
+msgid "E587: :break without :while"
+msgstr "E587: :break 缺少å°æ‡‰çš„ :while"
+
+#: ex_eval.c:1235
+msgid "E601: :try nesting too deep"
+msgstr "E601: :if 層數éŽæ·±"
+
+#: ex_eval.c:1278
+msgid "E603: :catch without :try"
+msgstr "E603: :catch 沒有 :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1300
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch 在 :finally 之後"
+
+#: ex_eval.c:1418
+msgid "E606: :finally without :try"
+msgstr "E606: :finally 沒有 :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1442
+msgid "E607: multiple :finally"
+msgstr "E607: å¤šé‡ :finally"
+
+#: ex_eval.c:1551
+msgid "E602: :endtry without :try"
+msgstr "E602: :endif 缺少å°æ‡‰çš„ :if"
+
+#: ex_eval.c:1857
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction 必須在函å¼å…§éƒ¨ä½¿ç”¨"
+
+#: ex_getln.c:2967
+msgid "tagname"
+msgstr "標籤å稱"
+
+#: ex_getln.c:2970
+msgid " kind file\n"
+msgstr "類檔案\n"
+
+#: ex_getln.c:4176
+msgid "'history' option is zero"
+msgstr "é¸é … 'history' 是零"
+
+#: ex_getln.c:4416
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s æ­·å²è¨˜éŒ„ (新到舊):\n"
+
+#: ex_getln.c:4417
+msgid "Command Line"
+msgstr "命令列"
+
+#: ex_getln.c:4418
+msgid "Search String"
+msgstr "æœå°‹å­—串"
+
+#: ex_getln.c:4419
+msgid "Expression"
+msgstr "é‹ç®—å¼"
+
+#: ex_getln.c:4420
+msgid "Input Line"
+msgstr "輸入行"
+
+#: ex_getln.c:4450
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar 超éŽå‘½ä»¤é•·åº¦"
+
+#: ex_getln.c:4624
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: 已刪除掉作用中的視窗或暫存å€"
+
+#: fileio.c:373
+msgid "Illegal file name"
+msgstr "ä¸æ­£ç¢ºçš„檔å"
+
+#: fileio.c:397 fileio.c:522 fileio.c:2686 fileio.c:2727
+msgid "is a directory"
+msgstr "是目錄"
+
+#: fileio.c:399
+msgid "is not a file"
+msgstr "ä¸æ˜¯æª”案"
+
+#: fileio.c:544 fileio.c:3833
+msgid "[New File]"
+msgstr "[未命å]"
+
+#: fileio.c:566
+msgid "[Permission Denied]"
+msgstr "[權é™ä¸è¶³]"
+
+#: fileio.c:670
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Autocommand 使程å¼ç„¡æ³•è®€å–此檔"
+
+#: fileio.c:672
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *Filter* Autocommand ä¸å¯ä»¥æ›´æ”¹ç·©è¡å€çš„內容"
+
+#: fileio.c:693
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: 從標準輸入讀å–...\n"
+
+#: fileio.c:699
+msgid "Reading from stdin..."
+msgstr "從標準輸入讀å–..."
+
+#. Re-opening the original file failed!
+#: fileio.c:944
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: 轉æ›éŒ¯èª¤"
+
+#: fileio.c:1892
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1899
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1906
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1914
+msgid "[RO]"
+msgstr "[唯讀]"
+
+#: fileio.c:1924
+msgid "[CR missing]"
+msgstr "[缺少CR]'"
+
+#: fileio.c:1929
+msgid "[NL found]"
+msgstr "[找到NL]"
+
+#: fileio.c:1934
+msgid "[long lines split]"
+msgstr "[分割éŽé•·è¡Œ]"
+
+#: fileio.c:1940 fileio.c:3817
+msgid "[NOT converted]"
+msgstr "[未轉æ›]"
+
+#: fileio.c:1945 fileio.c:3822
+msgid "[converted]"
+msgstr "[已轉æ›]"
+
+#: fileio.c:1952 fileio.c:3847
+msgid "[crypted]"
+msgstr "[已加密]"
+
+#: fileio.c:1959
+msgid "[CONVERSION ERROR]"
+msgstr "轉æ›éŒ¯èª¤"
+
+#: fileio.c:1965
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[è¡Œ %ld 有ä¸æ­£ç¢ºçš„ä½å…ƒ]"
+
+#: fileio.c:1972
+msgid "[READ ERRORS]"
+msgstr "[讀å–錯誤]"
+
+#: fileio.c:2188
+msgid "Can't find temp file for conversion"
+msgstr "找ä¸åˆ°è½‰æ›ç”¨çš„暫存檔"
+
+#: fileio.c:2195
+msgid "Conversion with 'charconvert' failed"
+msgstr "字元集轉æ›éŒ¯èª¤"
+
+#: fileio.c:2198
+msgid "can't read output of 'charconvert'"
+msgstr "ç„¡æ³•è®€å– 'charconvert' 的輸出"
+
+#: fileio.c:2601
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autocommand 刪除或釋放了è¦å¯«å…¥çš„ç·©è¡å€"
+
+#: fileio.c:2624
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand æ„外地改變了行號"
+
+#: fileio.c:2692 fileio.c:2710
+msgid "is not a file or writable device"
+msgstr "ä¸æ˜¯æª”案或å¯å¯«å…¥çš„è£ç½®"
+
+#: fileio.c:2762
+msgid "is read-only (add ! to override)"
+msgstr "是唯讀檔 (請使用 ! 強制執行)"
+
+#: fileio.c:3065
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: 無法寫入備份檔 (請使用 ! 強制執行)"
+
+#: fileio.c:3077
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: 無法關閉備份檔 (請使用 ! 強制執行)"
+
+#: fileio.c:3079
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: 無法讀å–檔案以供備份 (請使用 ! 強制執行)"
+
+#: fileio.c:3095
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: 無法建立備份檔 (請使用 ! 強制執行)"
+
+#: fileio.c:3198
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: 無法製作備份檔 (請使用 ! 強制執行)"
+
+#: fileio.c:3260
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Resource fork 會消失 (請使用 ! 強制執行)"
+
+#: fileio.c:3361
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: 找ä¸åˆ°å¯«å…¥ç”¨çš„暫存檔"
+
+#: fileio.c:3379
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: ç„¡æ³•è½‰æ› (請使用 ! 強制ä¸è½‰æ›å¯«å…¥)"
+
+#: fileio.c:3414
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: 無法以寫入模å¼é–‹å•Ÿé€£çµæª”案"
+
+#: fileio.c:3418
+msgid "E212: Can't open file for writing"
+msgstr "E212: 無法以寫入模å¼é–‹å•Ÿ"
+
+#: fileio.c:3668
+msgid "E512: Close failed"
+msgstr "E512: 關閉失敗"
+
+#: fileio.c:3739
+msgid "E513: write error, conversion failed"
+msgstr "E513: 無法寫入 -- 轉æ›å¤±æ•—"
+
+#: fileio.c:3745
+msgid "E514: write error (file system full?)"
+msgstr "E514: 寫入錯誤 (檔案系統已滿?)"
+
+#: fileio.c:3812
+msgid " CONVERSION ERROR"
+msgstr "轉æ›éŒ¯èª¤"
+
+#: fileio.c:3828
+msgid "[Device]"
+msgstr "[è£ç½®]"
+
+#: fileio.c:3833
+msgid "[New]"
+msgstr "[æ–°]"
+
+#: fileio.c:3855
+msgid " [a]"
+msgstr "[a]"
+
+#: fileio.c:3855
+msgid " appended"
+msgstr " 已附加"
+
+#: fileio.c:3857
+msgid " [w]"
+msgstr "[w]"
+
+#: fileio.c:3857
+msgid " written"
+msgstr " 已寫入"
+
+#: fileio.c:3910
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patch 模å¼: 無法儲存原始檔案"
+
+#: fileio.c:3932
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Patch 模å¼: 無法變更空的原始檔案"
+
+#: fileio.c:3947
+msgid "E207: Can't delete backup file"
+msgstr "E207: 無法刪除備份檔"
+
+#: fileio.c:4008
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"警告: 原始檔案æµå¤±æˆ–æ壞\n"
+
+#: fileio.c:4010
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "在檔案正確寫入å‰è«‹å‹¿é›¢é–‹ç·¨è¼¯å™¨!"
+
+#: fileio.c:4099
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4099
+msgid "[dos format]"
+msgstr "[dos æ ¼å¼]"
+
+#: fileio.c:4106
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4106
+msgid "[mac format]"
+msgstr "[mac æ ¼å¼]"
+
+#: fileio.c:4113
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4113
+msgid "[unix format]"
+msgstr "[unix æ ¼å¼]"
+
+#: fileio.c:4140
+msgid "1 line, "
+msgstr "1 行, "
+
+#: fileio.c:4142
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld 行, "
+
+#: fileio.c:4145
+msgid "1 character"
+msgstr "一個字元"
+
+#: fileio.c:4147
+#, c-format
+msgid "%ld characters"
+msgstr "%ld個字元"
+
+#: fileio.c:4157
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4157
+msgid "[Incomplete last line]"
+msgstr "[çµå°¾è¡Œä¸å®Œæ•´]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4176
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "警告: 本檔案自上次讀入後已變動!!!"
+
+#: fileio.c:4178
+msgid "Do you really want to write to it"
+msgstr "確定è¦å¯«å…¥å—Ž"
+
+#: fileio.c:5219
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: 寫入檔案 \"%s\" 錯誤"
+
+#: fileio.c:5226
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: 關閉檔案 \"%s\" 錯誤"
+
+#: fileio.c:5229
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: 讀å–檔案 \"%s\" 錯誤"
+
+#: fileio.c:5448
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand 刪除緩è¡å€"
+
+#: fileio.c:5456
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: 警告: 檔案 \"%s\" 已經ä¸å­˜åœ¨"
+
+#: fileio.c:5469
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: 警告: 檔案 \"%s\" 自上次讀入後已變動, 而且編輯中的緩è¡å€ä¹Ÿæ›´å‹•äº†"
+
+#: fileio.c:5472
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: 警告: 檔案 \"%s\" 自上次讀入後已變動"
+
+#: fileio.c:5474
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: 警告: 檔案 \"%s\" 的權é™èˆ‡ä¸Šæ¬¡è®€å…¥æ™‚ä¸ä¸€æ¨£ (有變動éŽ)"
+
+# 'mode' seems better as translated to 'permission'?
+#: fileio.c:5484
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: 警告: 檔案 \"%s\" 在開始編輯後åˆè¢«å»ºç«‹äº†"
+
+#: fileio.c:5501
+msgid "Warning"
+msgstr "警告"
+
+#: fileio.c:5502
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"確定(&O)\n"
+"載入檔案(&L)"
+
+#: fileio.c:5600
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: 無法準備é‡æ–°è¼‰å…¥ \"%s\""
+
+#: fileio.c:5619
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: 無法é‡æ–°è¼‰å…¥ \"%s\""
+
+#: fileio.c:6201
+msgid "--Deleted--"
+msgstr "--已刪除--"
+
+#. the group doesn't exist
+#: fileio.c:6361
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: 無此群組: \"%s\""
+
+#: fileio.c:6486
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * 後é¢æœ‰ä¸æ­£ç¢ºçš„å­—å…ƒ: %s"
+
+#: fileio.c:6497
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: 無此事件: %s"
+
+#. Highlight title
+#: fileio.c:6646
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:6917
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: 無法å°æ‰€æœ‰äº‹ä»¶åŸ·è¡Œ autocommand"
+
+#: fileio.c:6940
+msgid "No matching autocommands"
+msgstr "找ä¸åˆ°å°æ‡‰çš„ autocommand"
+
+#: fileio.c:7260
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand 層數éŽæ·±"
+
+#: fileio.c:7528
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands: \"%s\""
+
+#: fileio.c:7536
+#, c-format
+msgid "Executing %s"
+msgstr "執行 %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7604
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:8171
+msgid "E219: Missing {."
+msgstr "E219: 缺少 {."
+
+#: fileio.c:8173
+msgid "E220: Missing }."
+msgstr "E220: 缺少 }."
+
+#: fold.c:66
+msgid "E490: No fold found"
+msgstr "E490: 找ä¸åˆ°ä»»ä½• fold"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: 無法在目å‰çš„ 'foldmethod' 下建立 fold"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: 無法在目å‰çš„ 'foldmethod' 下刪除 fold"
+
+#: getchar.c:246
+msgid "E222: Add to read buffer"
+msgstr "E222: 加入讀å–ç·©è¡å€ä¸­"
+
+#: getchar.c:2146
+msgid "E223: recursive mapping"
+msgstr "E223: éžè¿´ mapping"
+
+#: getchar.c:2994
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s 已經有全域 abbreviation 了"
+
+#: getchar.c:2997
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s 已經有全域 mapping 了"
+
+#: getchar.c:3124
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s 已經有 abbreviation 了"
+
+#: getchar.c:3127
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s 的 mapping 已經存在"
+
+#: getchar.c:3191
+msgid "No abbreviation found"
+msgstr "找ä¸åˆ° abbreviation"
+
+#: getchar.c:3193
+msgid "No mapping found"
+msgstr "沒有這個 mapping å°æ‡‰"
+
+#: getchar.c:4083
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ä¸æ­£ç¢ºçš„模å¼"
+
+#: gui.c:218
+msgid "E229: Cannot start the GUI"
+msgstr "E229: 無法啟動圖型界é¢"
+
+#: gui.c:347
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: 無法讀å–檔案 \"%s\""
+
+#: gui.c:472
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ä¸æ­£ç¢ºçš„ 'guifontwide'"
+
+#: gui.c:3925
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: ä¸èƒ½é…ç½®é¡è‰² %s"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<ä¸èƒ½é–‹å•Ÿ>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ä¸èƒ½ä½¿ç”¨ %s å­—åž‹"
+
+#: gui_at_fs.c:2538
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: 無法回到目å‰ç›®éŒ„"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "路徑:"
+
+#: gui_at_fs.c:2563
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: 無法å–å¾—ç›®å‰ç›®éŒ„"
+
+#: gui_at_fs.c:2571 gui_motif.c:1619
+msgid "OK"
+msgstr "確定"
+
+#: gui_at_fs.c:2571 gui_gtk.c:2625 gui_motif.c:1614 gui_motif.c:2844
+msgid "Cancel"
+msgstr "å–消"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "æ²å‹•è»¸: ä¸èƒ½è¨­å®š thumb pixmap çš„ä½ç½®"
+
+#: gui_athena.c:1956 gui_motif.c:1867
+msgid "Vim dialog"
+msgstr "Vim å°è©±ç›’"
+
+#: gui_beval.c:91
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ä¸èƒ½å°è¨Šæ¯èˆ‡ callback 建立 BallonEval"
+
+#: gui_gtk.c:1561
+msgid "Vim dialog..."
+msgstr "Vim å°è©±ç›’..."
+
+#: gui_gtk.c:1992 message.c:2525
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Y是\n"
+"&Nå¦\n"
+"&Cå–消"
+
+#: gui_gtk.c:2152
+msgid "Input _Methods"
+msgstr "輸入法"
+
+#: gui_gtk.c:2418 gui_motif.c:2763
+msgid "VIM - Search and Replace..."
+msgstr "VIM - 尋找與å–代..."
+
+#: gui_gtk.c:2426 gui_motif.c:2765
+msgid "VIM - Search..."
+msgstr "VIM - 尋找..."
+
+#: gui_gtk.c:2458 gui_motif.c:2883
+msgid "Find what:"
+msgstr "æœå°‹:"
+
+#: gui_gtk.c:2478 gui_motif.c:2915
+msgid "Replace with:"
+msgstr "å–代為:"
+
+#. whole word only button
+#: gui_gtk.c:2510 gui_motif.c:3031
+msgid "Match whole word only"
+msgstr "åªæœå°‹å®Œå…¨ç›¸åŒçš„å­—"
+
+#. match case button
+#: gui_gtk.c:2523 gui_motif.c:3043
+msgid "Match case"
+msgstr "符åˆå¤§å°å¯«"
+
+#: gui_gtk.c:2535 gui_motif.c:2985
+msgid "Direction"
+msgstr "æ–¹å‘"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2547 gui_motif.c:2997
+msgid "Up"
+msgstr "å‘上"
+
+#: gui_gtk.c:2551 gui_motif.c:3005
+msgid "Down"
+msgstr "å‘下"
+
+#: gui_gtk.c:2577 gui_gtk.c:2579 gui_motif.c:2787
+msgid "Find Next"
+msgstr "找下一個"
+
+#: gui_gtk.c:2596 gui_gtk.c:2598 gui_motif.c:2804
+msgid "Replace"
+msgstr "å–代"
+
+#: gui_gtk.c:2609 gui_gtk.c:2611 gui_motif.c:2817
+msgid "Replace All"
+msgstr "å–代全部"
+
+#: gui_gtk_x11.c:2285
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: ç”± Session 管ç†å“¡æ”¶åˆ° \"die\" è¦æ±‚\n"
+
+#: gui_gtk_x11.c:3424
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: 主視窗爛掉\n"
+
+#: gui_gtk_x11.c:4038
+msgid "Font Selection"
+msgstr "å­—åž‹é¸æ“‡"
+
+#: gui_gtk_x11.c:5890 ui.c:2009
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "使用 CUT_BUFFER0 來å–代空é¸æ“‡"
+
+#: gui_motif.c:1613 gui_motif.c:1616
+msgid "Filter"
+msgstr "éŽæ¿¾å™¨"
+
+#: gui_motif.c:1615
+msgid "Directories"
+msgstr "目錄"
+
+#: gui_motif.c:1617
+msgid "Help"
+msgstr "輔助說明"
+
+#: gui_motif.c:1618
+msgid "Files"
+msgstr "檔案"
+
+#: gui_motif.c:1620
+msgid "Selection"
+msgstr "é¸æ“‡"
+
+#: gui_motif.c:2830
+msgid "Undo"
+msgstr "復原"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: 無法開啟 Zap 字型 '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: 無法使用字型 %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"é€å‡ºä¸­æ–·å­ç¨‹å¼çš„訊æ¯ä¸­.\n"
+
+#: gui_w32.c:759
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ä¸æ”¯æ´åƒæ•¸ \"-%s\"。請用 OLE 版本。"
+
+#: gui_w48.c:2029
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "æœå°‹å­—串 (使用 '\\\\' 來表示 '\\')"
+
+#: gui_w48.c:2054
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "æœå°‹åŠå–代字串 (使用 '\\\\' 來表示 '\\')"
+
+#: gui_x11.c:1445
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: 無法é…ç½® color map 項目,有些é¡è‰²çœ‹èµ·ä¾†æœƒæ€ªæ€ªçš„"
+
+#: gui_x11.c:2019
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Fontset %s 沒有設定正確的字型以供顯示這些字元集:"
+
+#: gui_x11.c:2062
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: 字型集(Fontset)å稱: %s"
+
+#: gui_x11.c:2063
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "'%s' ä¸æ˜¯å›ºå®šå¯¬åº¦å­—åž‹"
+
+#: gui_x11.c:2082
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: 字型集(Fontset)å稱: %s\n"
+
+#: gui_x11.c:2083
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2084
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2085
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "å­—åž‹%d寬度ä¸æ˜¯å­—åž‹0çš„å…©å€\n"
+
+#: gui_x11.c:2086
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "字型0的寬度:%ld\n"
+
+#: gui_x11.c:2087
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"字型1寬度: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata 錯誤"
+
+#: if_cscope.c:26
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: 用法: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "新增資料庫"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "輸入 pattern"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "顯示此訊æ¯"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "çµæŸé€£ç·š"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "é‡è¨­æ‰€æœ‰é€£ç·š"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "顯示連線"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "這個 cscope 命令ä¸æ”¯æ´åˆ†å‰²èž¢å¹•\n"
+
+#: if_cscope.c:143
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: 用法: cstag <識別字ident>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: 找ä¸åˆ° tag"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) 錯誤: %d"
+
+#: if_cscope.c:461 if_cscope.c:468
+#, c-format
+msgid "Added cscope database %s"
+msgstr "新增 cscope 資料庫 %s"
+
+#: if_cscope.c:475
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s ä¸æ˜¯ç›®éŒ„或 cscope 資料庫"
+
+#: if_cscope.c:559
+#, c-format
+msgid "E565: error reading cscope connection %d"
+msgstr "E565: è®€å– cscope 連線 %d 錯誤"
+
+#: if_cscope.c:636
+msgid "E561: unknown cscope search type"
+msgstr "E561: 未知的 cscope æœå°‹å½¢æ…‹"
+
+#: if_cscope.c:683
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: 無法建立與 cscope 的 pipe 連線"
+
+#: if_cscope.c:748
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection 執行失敗"
+
+#: if_cscope.c:758
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen 失敗 (to_fp)"
+
+#: if_cscope.c:760
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen 失敗 (fr_fp)"
+
+#: if_cscope.c:788
+msgid "E567: no cscope connections"
+msgstr "E567: 沒有 cscope 連線"
+
+#: if_cscope.c:858
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: 找ä¸åˆ°ç¬¦åˆ cscope çš„æœå°‹ %s / %s"
+
+#: if_cscope.c:902
+msgid "cscope commands:\n"
+msgstr "cscope 命令:\n"
+
+#: if_cscope.c:905
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (用法: %s)\n"
+
+#: if_cscope.c:973
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: é‡è¤‡çš„ cscope 資料庫未被加入"
+
+#: if_cscope.c:984
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: å·²é”到 cscope 最大連線數目"
+
+#: if_cscope.c:1105
+msgid "E260: cscope connection not found"
+msgstr "E260: 找ä¸åˆ° cscope 連線"
+
+#: if_cscope.c:1108
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: 找ä¸åˆ° cscope 連線 %s"
+
+#: if_cscope.c:1144
+msgid "cscope connection closed"
+msgstr "cscope 連線已關閉"
+
+#: if_cscope.c:1152
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope 連線 %s 已關閉\n"
+
+#. should not reach here
+#: if_cscope.c:1293
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: cs_manage_matches åš´é‡éŒ¯èª¤"
+
+#: if_cscope.c:1344
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: è®€å– cscope 連線 %d 錯誤"
+
+#: if_cscope.c:1452
+msgid "couldn't malloc\n"
+msgstr "無法使用 malloc\n"
+
+#: if_cscope.c:1457
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope 標籤(tag): %s\n"
+
+#: if_cscope.c:1461
+msgid " # line"
+msgstr " # 行 "
+
+#: if_cscope.c:1463
+msgid "filename / context / line\n"
+msgstr "檔å / 內文 / 行號\n"
+
+#: if_cscope.c:1721
+msgid "All cscope databases reset"
+msgstr "é‡è¨­æ‰€æœ‰ cscope 資料庫"
+
+#: if_cscope.c:1788
+msgid "no cscope connections\n"
+msgstr "沒有 cscope 連線\n"
+
+#: if_cscope.c:1792
+msgid " # pid database name prepend path\n"
+msgstr " # pid 資料庫å稱 prepend path\n"
+
+#: if_cscope.c:1803
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <ç„¡>\n"
+
+#: if_python.c:394
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: 抱歉,這個命令無法使用,Python 程å¼åº«æ²’有載入。"
+
+#: if_python.c:596
+msgid "can't delete OutputObject attributes"
+msgstr "無法刪除 OutputObject 屬性"
+
+#: if_python.c:603
+msgid "softspace must be an integer"
+msgstr "softspace 必需是整數"
+
+#: if_python.c:611
+msgid "invalid attribute"
+msgstr "ä¸æ­£ç¢ºçš„屬性"
+
+#: if_python.c:650 if_python.c:664
+msgid "writelines() requires list of strings"
+msgstr "writelines() éœ€è¦ string list 當åƒæ•¸"
+
+#: if_python.c:790
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: 無法åˆå§‹ I/O 物件"
+
+#: if_python.c:975 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "ä¸æ­£ç¢ºçš„é‹ç®—å¼"
+
+#: if_python.c:989 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "因為編譯時沒有加入é‹ç®—å¼(expression)的程å¼ç¢¼ï¼Œæ‰€ä»¥ç„¡æ³•ä½¿ç”¨é‹ç®—å¼"
+
+#: if_python.c:1002
+msgid "attempt to refer to deleted buffer"
+msgstr "試圖使用已被刪除的 buffer"
+
+#: if_python.c:1017 if_python.c:1058 if_python.c:1122 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "行號超出範åœ"
+
+#: if_python.c:1257
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer 物件 (已刪除): %8lX>"
+
+#: if_python.c:1348 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "標記å稱ä¸æ­£ç¢º"
+
+#: if_python.c:1623
+msgid "no such buffer"
+msgstr "ç„¡æ­¤ buffer"
+
+#: if_python.c:1711
+msgid "attempt to refer to deleted window"
+msgstr "試圖使用已被刪除的視窗"
+
+#: if_python.c:1756
+msgid "readonly attribute"
+msgstr "唯讀屬性"
+
+#: if_python.c:1769
+msgid "cursor position outside buffer"
+msgstr "游標定ä½åœ¨ç·©è¡å€ä¹‹å¤–"
+
+#: if_python.c:1846
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<視窗物件(已刪除): %.8lX>"
+
+#: if_python.c:1858
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<視窗物件(未知): %.8lX>"
+
+#: if_python.c:1860
+#, c-format
+msgid "<window %d>"
+msgstr "<視窗 %d>"
+
+#: if_python.c:1936
+msgid "no such window"
+msgstr "無此視窗"
+
+#: if_python.c:2193 if_python.c:2228 if_python.c:2278 if_python.c:2346
+#: if_python.c:2466 if_python.c:2518 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1998
+msgid "cannot save undo information"
+msgstr "無法儲存復原資訊"
+
+#: if_python.c:2195 if_python.c:2285 if_python.c:2357
+msgid "cannot delete line"
+msgstr "ä¸èƒ½åˆªé™¤æ­¤è¡Œ"
+
+#: if_python.c:2230 if_python.c:2373 if_tcl.c:690 if_tcl.c:2020
+msgid "cannot replace line"
+msgstr "ä¸èƒ½æ›¿ä»£æ­¤è¡Œ"
+
+#: if_python.c:2389 if_python.c:2468 if_python.c:2526
+msgid "cannot insert line"
+msgstr "ä¸èƒ½æ›¿ä»£æ’入此行"
+
+#: if_python.c:2630
+msgid "string cannot contain newlines"
+msgstr "字串無法包å«æ–°è¡Œ"
+
+#: if_ruby.c:396
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: 此命令無法使用,無法載入 Ruby 程å¼åº«(Library)"
+
+#: if_ruby.c:459
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: 未知的 longjmp status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "切æ›å¯¦ä½œ/定義"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "顯示 base class of:"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "顯示被 override 的 member function"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "讀å–: 從檔案"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "讀å–: 從物件"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "讀å–: 從所有 project"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "讀å–"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "顯示原始碼: "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "æœå°‹ symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ç€è¦½ class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "顯示階層å¼çš„ class"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "顯示 restricted 階層å¼çš„ class"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref åƒè€ƒåˆ°"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref 被誰åƒè€ƒ:"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref 有"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref 被誰使用:"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "顯示文件: "
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "產生文件: "
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "無法連線到 SNiFF+。請檢查環境變數 ($PATH 裡必需å¯ä»¥æ‰¾åˆ° sniffemacs)\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: 讀å–錯誤. å–消連線"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ ç›®å‰"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "未"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "連線中"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ä¸æ­£ç¢ºçš„ SNiff+ 呼å«: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: 連線到 SNiFF+ 失敗"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: 未連線到 SNiFF+"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: ä¸æ˜¯ SNiFF+ çš„ç·©è¡å€"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: 寫入錯誤。çµæŸé€£ç·š"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "ç·©è¡å€è™Ÿç¢¼éŒ¯èª¤"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "尚未實作"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "ä¸æ­£ç¢ºçš„é¸é …"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "ä¸èƒ½è¨­å®šè¡Œ"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "沒有設定標記"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "列 %d 行 %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "ä¸èƒ½æ’入或附加此行"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "錯誤的旗標: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "ä¸æ­£ç¢ºçš„ VIM é¸é …"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "éµç›¤ä¸­æ–·"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim 錯誤"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "無法建立緩è¡å€/視窗命令: 物件將會被刪除"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "無法註冊 callback 命令: ç·©è¡å€/視窗已經被刪除了"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: TCL åš´é‡éŒ¯èª¤: reflist 爛掉了!? 請報告給 to vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "無法註冊 callback 命令: 找ä¸åˆ°ç·©è¡å€/視窗"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: 此命令無法使用, 因為無法載入 Tcl 程å¼åº«(Library)"
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: TCL 錯誤: çµæŸç¢¼ä¸æ˜¯æ•´æ•¸!? 請報告給 to vim-dev@vim.org"
+
+#: if_tcl.c:2006
+msgid "cannot get line"
+msgstr "ä¸èƒ½å–得此行"
+
+#: if_xcmdsrv.c:215
+msgid "Unable to register a command server name"
+msgstr "無法註冊命令伺æœå™¨å稱"
+
+#: if_xcmdsrv.c:465
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: 無法é€å‡ºå‘½ä»¤åˆ°ç›®çš„地程å¼"
+
+#: if_xcmdsrv.c:735
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: ä¸æ­£ç¢ºçš„伺æœå™¨ id : %s"
+
+#: if_xcmdsrv.c:1098
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM 的 registry 設定項有誤。已刪除。"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "ä¸æ­£ç¢ºçš„é¸é …"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "太多編輯åƒæ•¸"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "缺少必è¦çš„åƒæ•¸:"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "無法辨èªæ­¤é¸é …後的命令: "
+
+#: main.c:68
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "太多 \"+command\" 或 \"-c command\" åƒæ•¸"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "ä¸æ­£ç¢ºçš„åƒæ•¸: "
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "您的 Vim 編譯時沒有加入 diff 的能力"
+
+#: main.c:917
+msgid "Attempt to open script file again: \""
+msgstr "試圖å†æ¬¡é–‹å•Ÿ script 檔: \""
+
+#: main.c:921 main.c:928 main.c:972 memline.c:3682 memline.c:3686
+#: version.c:857 version.c:862 version.c:867 version.c:872 version.c:877
+#: version.c:882 version.c:888 version.c:892 version.c:896 version.c:901
+#: version.c:908 version.c:916 version.c:922
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:926
+msgid "Cannot open for reading: \""
+msgstr "無法開啟以讀å–: \""
+
+#: main.c:970
+msgid "Cannot open for script output: \""
+msgstr "無法開啟為 script 輸出: \""
+
+#: main.c:1104
+#, c-format
+msgid "%d files to edit\n"
+msgstr "還有 %d 個檔案等待編輯\n"
+
+#: main.c:1178
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: 注æ„: 輸出ä¸æ˜¯çµ‚端機(螢幕)\n"
+
+#: main.c:1180
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: 注æ„: 輸入ä¸æ˜¯çµ‚端機(éµç›¤)\n"
+
+#. just in case..
+#: main.c:1257
+msgid "pre-vimrc command line"
+msgstr "vimrc å‰å‘½ä»¤åˆ—"
+
+#: main.c:1292
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: 無法讀å–檔案 \"%s\""
+
+#: main.c:2313
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"查詢更多資訊請執行: \"vim -h\"\n"
+
+#: main.c:2346
+msgid "[file ..] edit specified file(s)"
+msgstr "[檔案 ..] 編輯指定的檔案"
+
+#: main.c:2347
+msgid "- read text from stdin"
+msgstr "- 從標準輸入(stdin)讀å–檔案"
+
+#: main.c:2348
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag 編輯時使用指定的 tag"
+
+#: main.c:2350
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] 編輯時載入第一個錯誤"
+
+#: main.c:2359
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" 用法:"
+
+#: main.c:2362
+msgid " vim [arguments] "
+msgstr "vim [åƒæ•¸] "
+
+#: main.c:2366
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" 或:"
+
+#: main.c:2369
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"åƒæ•¸:\n"
+
+#: main.c:2370
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\tåªæœ‰åœ¨é€™ä¹‹å¾Œçš„檔案"
+
+#: main.c:2372
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\tä¸å±•é–‹è¬ç”¨å­—å…ƒ"
+
+#: main.c:2375
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\t註冊 gvim 到 OLE"
+
+#: main.c:2376
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\tå–消 OLE 中的 gvim 註冊"
+
+#: main.c:2379
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\tä½¿ç”¨åœ–å½¢ç•Œé¢ (åŒ \"gvim\")"
+
+#: main.c:2380
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f 或 --nofork\tå‰æ™¯: 起始圖形界é¢æ™‚ä¸ fork"
+
+#: main.c:2382
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi æ¨¡å¼ (åŒ \"vi\")"
+
+#: main.c:2383
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx æ¨¡å¼ (åŒ \"ex\")"
+
+#: main.c:2384
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\tå®‰éœ (batch) æ¨¡å¼ (åªèƒ½èˆ‡ \"ex\" 一起使用)"
+
+#: main.c:2386
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff æ¨¡å¼ (åŒ \"vimdiff\", å¯è¿…速比較兩檔案ä¸åŒè™•)"
+
+#: main.c:2388
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\tç°¡æ˜“æ¨¡å¼ (åŒ \"evim\", modeless)"
+
+#: main.c:2389
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\tå”¯è®€æ¨¡å¼ (åŒ \"view\")"
+
+#: main.c:2390
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\té™åˆ¶æ¨¡å¼ (åŒ \"rvim\")"
+
+#: main.c:2391
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\tä¸å¯ä¿®æ”¹ (寫入檔案)"
+
+#: main.c:2392
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\tä¸å¯ä¿®æ”¹æ–‡å­—"
+
+#: main.c:2393
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t二進ä½æ¨¡å¼"
+
+#: main.c:2395
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp 模å¼"
+
+#: main.c:2397
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\t'compatible' 傳統 Vi 相容模å¼"
+
+#: main.c:2398
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\t'nocompatible' ä¸å®Œå…¨èˆ‡å‚³çµ± Vi 相容,å¯ä½¿ç”¨ Vim 加強能力"
+
+#: main.c:2399
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose 等級"
+
+#: main.c:2400
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\t除錯模å¼"
+
+#: main.c:2401
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\tä¸ä½¿ç”¨æš«å­˜æª”, åªä½¿ç”¨è¨˜æ†¶é«”"
+
+#: main.c:2402
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t列出暫存檔後離開"
+
+#: main.c:2403
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (加檔å) \t修復上次æ毀的資料(Recover crashed session)"
+
+#: main.c:2404
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\tåŒ -r"
+
+#: main.c:2406
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\tä¸ä½¿ç”¨ newcli 來開啟視窗"
+
+#: main.c:2407
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\t使用 <device> åšè¼¸å‡ºå…¥"
+
+#: main.c:2410
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\t啟動為 Hebrew 模å¼"
+
+#: main.c:2413
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\t啟動為 Farsi 模å¼"
+
+#: main.c:2415
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\t設定終端機為 <terminal>"
+
+#: main.c:2416
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t使用 <vimrc> å–代任何 .vimrc"
+
+#: main.c:2418
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t使用 <gvimrc> å–代任何 .gvimrc"
+
+#: main.c:2420
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\tä¸è¼‰å…¥ä»»ä½• plugin"
+
+#: main.c:2421
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\té–‹å•Ÿ N 個視窗 (é è¨­æ˜¯æ¯å€‹æª”案一個)"
+
+#: main.c:2422
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\tåŒ -o 但使用垂直分割"
+
+#: main.c:2423
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\t啟動後跳到檔案çµå°¾"
+
+#: main.c:2424
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\t啟動後跳到第 <lnum> 行"
+
+#: main.c:2426
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\t載入任何 vimrc å‰åŸ·è¡Œ <command>"
+
+#: main.c:2428
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\t載入第一個檔案後執行 <command>"
+
+#: main.c:2429
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\t載入第一個檔案後載入 Session 檔 <session>"
+
+#: main.c:2430
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t從 <scriptin> 讀入一般模å¼å‘½ä»¤"
+
+#: main.c:2431
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\tå°æª”案 <scriptout> 附加(append)所有輸入的命令"
+
+#: main.c:2432
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\tå°æª”案 <scriptout> 寫入所有輸入的命令"
+
+#: main.c:2434
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t編輯編碼éŽçš„檔案"
+
+#: main.c:2438
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\t將 vim 與指定的 X-server 連線"
+
+#: main.c:2440
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\tä¸è¦é€£ç·šåˆ° X Server"
+
+#: main.c:2443
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <files>\t編輯 Vim 伺æœå™¨ä¸Šçš„ <files> 後離開"
+
+#: main.c:2444
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <files> 相åŒï¼Œä½†æ²’有伺æœå™¨æ™‚ä¸è­¦å‘Š"
+
+#: main.c:2445
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> åŒ --remote, 但會等候檔案完æˆç·¨è¼¯"
+
+#: main.c:2446
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <files> 相åŒï¼Œä½†æ²’伺æœå™¨æ™‚ä¸è­¦å‘Š"
+
+#: main.c:2447
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\té€å‡º <keys> 到 Vim 伺æœå™¨ä¸¦é›¢é–‹"
+
+#: main.c:2448
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\t在伺æœå™¨ä¸ŠåŸ·è¡Œ <expr> 並å°å‡ºçµæžœ"
+
+#: main.c:2449
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\t列出å¯ç”¨çš„ Vim 伺æœå™¨å稱並離開"
+
+#: main.c:2450
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\té€è‡³/æˆç‚º Vim 伺æœå™¨ <name>"
+
+#: main.c:2453
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t使用 <viminfo> è€Œéž .viminfo"
+
+#: main.c:2455
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h 或 --help\tå°å‡ºèªªæ˜Ž(也就是本訊æ¯)後離開"
+
+#: main.c:2456
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\tå°å‡ºç‰ˆæœ¬è³‡è¨Šå¾Œé›¢é–‹"
+
+#: main.c:2460
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim èªå¾—çš„åƒæ•¸ (Motif 版):\n"
+
+#: main.c:2463
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim èªå¾—çš„åƒæ•¸ (Athena 版):\n"
+
+#: main.c:2466
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\t在視窗 <display> 執行 vim"
+
+#: main.c:2467
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\t啟動後圖示化(iconified)"
+
+#: main.c:2469
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tè®€å– Resource 時把 vim çš„å稱視為 <name>"
+
+#: main.c:2470
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (尚未實作)\n"
+
+#: main.c:2472
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\t設定 <color> 為背景色 (也å¯ç”¨ -bg)"
+
+#: main.c:2473
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\t設定 <color> 為一般文字é¡è‰² (也å¯ç”¨ -fg)"
+
+#: main.c:2474 main.c:2494
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t使用 <font> 為一般字型 (也å¯ç”¨ -fn)"
+
+#: main.c:2475
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\t使用 <font> 為粗體字型"
+
+#: main.c:2476
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\t使用 <font> 為斜體字型"
+
+#: main.c:2477 main.c:2495
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\t使用<geom>為起始ä½ç½® (也å¯ç”¨ -geom)"
+
+#: main.c:2478
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t使用寬度為 <width> 的邊框 (也å¯ç”¨ -bw)"
+
+#: main.c:2479
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> 設定æ²å‹•è»¸å¯¬åº¦ç‚º <width> (也å¯ç”¨ -sw)"
+
+#: main.c:2481
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\t設定é¸å–®åˆ—的高度為 <height> (也å¯ç”¨ -mh)"
+
+#: main.c:2483 main.c:2496
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\t使用å相顯示 (也å¯ç”¨ -rv)"
+
+#: main.c:2484
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\tä¸ä½¿ç”¨å相顯示 (也å¯ç”¨ +rv)"
+
+#: main.c:2485
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\t設定指定的 resource"
+
+#: main.c:2488
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim èªå¾—çš„åƒæ•¸ (RISC OS 版):\n"
+
+#: main.c:2489
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\t視窗åˆå§‹åŒ–寬度"
+
+#: main.c:2490
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\t視窗åˆå§‹åŒ–高度"
+
+#: main.c:2493
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim èªå¾—çš„åƒæ•¸ (GTK+ 版):\n"
+
+#: main.c:2497
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\t在 <display> 執行 vim (也å¯ç”¨ --display)"
+
+#: main.c:2499
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\t設定ç¨ç‰¹çš„角色(role)以å€åˆ†ä¸»è¦–窗"
+
+#: main.c:2501
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\t在å¦ä¸€å€‹ GTK widget 內開啟 Vim"
+
+#: main.c:2503
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\t顯示 Gnome 相關åƒæ•¸"
+
+#: main.c:2735
+msgid "No display"
+msgstr "無顯示"
+
+#. Failed to send, abort.
+#: main.c:2750
+msgid ": Send failed.\n"
+msgstr ": 傳é€å¤±æ•—。\n"
+
+#. Let vim start normally.
+#: main.c:2756
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": é€å‡ºå¤±æ•—。試圖在本地執行\n"
+
+#: main.c:2794 main.c:2815
+#, c-format
+msgid "%d of %d edited"
+msgstr "已編輯 %d/%d 個檔案"
+
+#: main.c:2837
+msgid "No display: Send expression failed.\n"
+msgstr "ç„¡ Display: 無法傳é€é‹ç®—å¼ã€‚\n"
+
+#: main.c:2849
+msgid ": Send expression failed.\n"
+msgstr ": 無法傳é€é‹ç®—å¼ã€‚\n"
+
+#: mark.c:656
+msgid "No marks set"
+msgstr "沒有設定標記 (mark)"
+
+#: mark.c:658
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: 找ä¸åˆ°ç¬¦åˆ \"%s\" 的標記(mark)"
+
+#. Highlight title
+#: mark.c:669
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"標記 行號 欄 檔案/文字"
+
+#. Highlight title
+#: mark.c:707
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" jump 行號 欄 檔案/文字"
+
+#: mark.c:1072
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# 檔案標記:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1107
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (由新到舊):\n"
+
+#: mark.c:1202
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# 檔案內 Mark 記錄 (由新到舊):\n"
+
+#: mark.c:1285
+msgid "Missing '>'"
+msgstr "缺少å°æ‡‰çš„ '>'"
+
+#: mbyte.c:403
+msgid "E543: Not a valid codepage"
+msgstr "E543: ä¸æ­£ç¢ºçš„ codepage"
+
+#: mbyte.c:3879
+msgid "E284: Cannot set IC values"
+msgstr "E284: ä¸èƒ½è¨­å®š IC 數值"
+
+#: mbyte.c:4031
+msgid "E285: Failed to create input context"
+msgstr "E285: 無法建立 input context"
+
+#: mbyte.c:4178
+msgid "E286: Failed to open input method"
+msgstr "E286: 無法開啟輸入法"
+
+#: mbyte.c:4189
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: 警告: 無法移除 IM 的 callback"
+
+#: mbyte.c:4195
+msgid "E288: input method doesn't support any style"
+msgstr "E288: 輸入法ä¸æ”¯æ´ä»»ä½• style"
+
+#: mbyte.c:4252
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: 輸入法ä¸æ”¯æ´ä»»ä½• style"
+
+#: mbyte.c:4326
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot 需è¦å­—型集(Fontset)"
+
+#: mbyte.c:4358
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: ä½ çš„ GTK+ 比 1.2.3 還舊。無法使用狀態å€ã€‚"
+
+#: mbyte.c:4637
+msgid "E292: Input Method Server is not running"
+msgstr "E292: 沒有執行中的輸入法管ç†ç¨‹å¼(Input Method Server)"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: å€å¡Šæœªè¢«éŽ–定"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: 暫存檔讀å–錯誤"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: 暫存檔讀å–錯誤"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: 暫存檔寫入錯誤"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: 暫存檔寫入錯誤"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: 暫存檔已經存在! (å°å¿ƒç¬¦è™Ÿé€£çµçš„安全æ¼æ´ž!?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: 找ä¸åˆ°å€å¡Š 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: 找ä¸åˆ°å€å¡Š 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: 找ä¸åˆ°å€å¡Š 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: 噢噢, 暫存檔ä¸è¦‹äº†!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: 無法改變暫存檔的å稱"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: 無法開啟暫存檔 \"%s\", ä¸å¯èƒ½ä¿®å¾©äº†"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: 找ä¸åˆ°å€å¡Š 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: 找ä¸åˆ° %s 的暫存檔"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "è«‹é¸æ“‡ä½ è¦ä½¿ç”¨çš„暫存檔 (按0 離開): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: 無法開啟 %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "無法讀å–å€å¡Š 0:"
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"å¯èƒ½æ˜¯ä½ æ²’åšéŽä»»ä½•ä¿®æ”¹æˆ–是 Vim 還來ä¸åŠæ›´æ–°æš«å­˜æª”."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " 無法在本版本的 Vim 中使用.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "使用 Vim 3.0。\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s 看起來ä¸åƒæ˜¯ Vim 暫存檔"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " 無法在這臺電腦上使用.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "本檔案建立於 "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"或是這檔案已經æ毀。"
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "使用暫存檔 \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "原始檔 \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: 警告: 原始檔案å¯èƒ½å·²ç¶“修改éŽäº†"
+
+#: memline.c:963
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: 無法從 %s 讀å–å€å¡Š 1"
+
+#: memline.c:967
+msgid "???MANY LINES MISSING"
+msgstr "???缺少太多行"
+
+#: memline.c:983
+msgid "???LINE COUNT WRONG"
+msgstr "???行號錯誤"
+
+#: memline.c:990
+msgid "???EMPTY BLOCK"
+msgstr "???空的 BLOCK"
+
+#: memline.c:1016
+msgid "???LINES MISSING"
+msgstr "???找ä¸åˆ°ä¸€äº›è¡Œ"
+
+#: memline.c:1048
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: å€å¡Š 1 ID 錯誤 (%s ä¸æ˜¯æš«å­˜æª”?)"
+
+#: memline.c:1053
+msgid "???BLOCK MISSING"
+msgstr "???找ä¸åˆ°BLOCK"
+
+#: memline.c:1069
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? 從這裡到 ???END 的內容å¯èƒ½æœ‰å•é¡Œ"
+
+#: memline.c:1085
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? 從這裡到 ???END 的內容å¯èƒ½è¢«åˆªé™¤/æ’å…¥éŽ"
+
+# do not translate
+#: memline.c:1105
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1131
+msgid "E311: Recovery Interrupted"
+msgstr "E311: 修復已中斷"
+
+#: memline.c:1133
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: 修復時發生錯誤; 請注æ„開頭為 ??? çš„è¡Œ"
+
+#: memline.c:1136
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "復原完æˆ. 請確定一切正常."
+
+#: memline.c:1137
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(ä½ å¯èƒ½æœƒæƒ³è¦æŠŠé€™å€‹æª”案å¦å­˜åˆ¥çš„檔å,\n"
+
+#: memline.c:1138
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "å†åŸ·è¡Œ diff 與原檔案比較以檢查是å¦æœ‰æ”¹è®Š)\n"
+
+#: memline.c:1139
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"(D)直接刪除 .swp 暫存檔\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1195
+msgid "Swap files found:"
+msgstr "找到以下的暫存檔:"
+
+#: memline.c:1373
+msgid " In current directory:\n"
+msgstr " 在目å‰çš„目錄:\n"
+
+#: memline.c:1375
+msgid " Using specified name:\n"
+msgstr " Using specified name:\n"
+
+#: memline.c:1379
+msgid " In directory "
+msgstr " 在目錄 "
+
+#: memline.c:1397
+msgid " -- none --\n"
+msgstr " -- ç„¡ --\n"
+
+#: memline.c:1469
+msgid " owned by: "
+msgstr " æ“有者: "
+
+#: memline.c:1471
+msgid " dated: "
+msgstr " 日期: "
+
+#: memline.c:1475 memline.c:3689
+msgid " dated: "
+msgstr " 日期: "
+
+#: memline.c:1491
+msgid " [from Vim version 3.0]"
+msgstr " [從 Vim 版本 3.0]"
+
+#: memline.c:1495
+msgid " [does not look like a Vim swap file]"
+msgstr " [ä¸åƒ Vim 的暫存檔]"
+
+#: memline.c:1499
+msgid " file name: "
+msgstr " 檔å: "
+
+#: memline.c:1505
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" 修改éŽ: "
+
+#: memline.c:1506
+msgid "YES"
+msgstr "是"
+
+#: memline.c:1506
+msgid "no"
+msgstr "å¦"
+
+#: memline.c:1510
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" 使用者: "
+
+#: memline.c:1517
+msgid " host name: "
+msgstr " 主機å稱: "
+
+#: memline.c:1519
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" 主機å稱: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" process ID: "
+
+#: memline.c:1531
+msgid " (still running)"
+msgstr " (執行中)"
+
+#: memline.c:1543
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [無法在本版本的 Vim 上使用]"
+
+#: memline.c:1546
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [無法在本電腦上使用]"
+
+#: memline.c:1551
+msgid " [cannot be read]"
+msgstr " [無法讀å–]"
+
+#: memline.c:1555
+msgid " [cannot be opened]"
+msgstr " [無法開啟]"
+
+#: memline.c:1745
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: 無法ä¿ç•™, ä¸ä½¿ç”¨æš«å­˜æª”"
+
+#: memline.c:1798
+msgid "File preserved"
+msgstr "檔案已ä¿ç•™"
+
+#: memline.c:1800
+msgid "E314: Preserve failed"
+msgstr "E314: ä¿ç•™å¤±æ•—"
+
+#: memline.c:1871
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: 錯誤的 lnum: %ld"
+
+#: memline.c:1897
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: 找ä¸åˆ°ç¬¬ %ld è¡Œ"
+
+#: memline.c:2287
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: 指標å€å¡Š id 錯誤 3"
+
+#: memline.c:2367
+msgid "stack_idx should be 0"
+msgstr "stack_idx 應該是 0"
+
+#: memline.c:2429
+msgid "E318: Updated too many blocks?"
+msgstr "E318: 更新太多å€å¡Š?"
+
+#: memline.c:2611
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: 指標å€å¡Š id 錯誤 4"
+
+#: memline.c:2638
+msgid "deleted block 1?"
+msgstr "刪除å€å¡Š 1?"
+
+#: memline.c:2838
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: 找ä¸åˆ°ç¬¬ %ld è¡Œ"
+
+#: memline.c:3081
+msgid "E317: pointer block id wrong"
+msgstr "E317: 指標å€å¡Š id 錯誤"
+
+#: memline.c:3097
+msgid "pe_line_count is zero"
+msgstr "pe_line_count 為零"
+
+#: memline.c:3126
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: 行號超出範åœ: %ld 超éŽçµå°¾"
+
+#: memline.c:3130
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: å€å¡Š %ld 行數錯誤"
+
+#: memline.c:3179
+msgid "Stack size increases"
+msgstr "堆疊大å°å¢žåŠ "
+
+#: memline.c:3225
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: 指標å€å¡Š id 錯 2"
+
+#: memline.c:3679
+msgid "E325: ATTENTION"
+msgstr "E325: 注æ„"
+
+#: memline.c:3680
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"找到暫存檔 \""
+
+#: memline.c:3684
+msgid "While opening file \""
+msgstr "在開啟檔案 \""
+
+#: memline.c:3693
+msgid " NEWER than swap file!\n"
+msgstr " 比暫存檔更新!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3697
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) å¯èƒ½æœ‰å¦ä¸€å€‹ç¨‹å¼ä¹Ÿåœ¨ç·¨è¼¯åŒä¸€å€‹æª”案.\n"
+" 如果是這樣,請å°å¿ƒä¸è¦å…©é‚Šä¸€èµ·å¯«å…¥ï¼Œä¸ç„¶ä½ çš„努力都會負諸æµæ°´ã€‚\n"
+
+#: memline.c:3698
+msgid " Quit, or continue with caution.\n"
+msgstr " 離開,或是繼續編輯。\n"
+
+#: memline.c:3699
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) å‰æ¬¡ç·¨è¼¯æ­¤æª”時當機\n"
+
+#: memline.c:3700
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " 如果是這樣, 請用 \":recover\" 或 \"vim -r"
+
+#: memline.c:3702
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" 來救回修改資料 (進一步說明請看 \":help recovery\").\n"
+
+#: memline.c:3703
+msgid " If you did this already, delete the swap file \""
+msgstr " 如果該救的都已經救了, 請直接刪除此暫存檔 \""
+
+#: memline.c:3705
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" 以é¿å…å†çœ‹åˆ°æ­¤è¨Šæ¯.\n"
+
+#: memline.c:3719 memline.c:3723
+msgid "Swap file \""
+msgstr "暫存檔 \""
+
+#: memline.c:3720 memline.c:3726
+msgid "\" already exists!"
+msgstr "\" 已經存在了!"
+
+#: memline.c:3729
+msgid "VIM - ATTENTION"
+msgstr "VIM - 注æ„"
+
+#: memline.c:3731
+msgid "Swap file already exists!"
+msgstr "暫存檔已經存在!"
+
+#: memline.c:3735
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"以唯讀方å¼é–‹å•Ÿ(&O)\n"
+"直接編輯(&E)\n"
+"修復(&R)\n"
+"離開(&Q)"
+
+#: memline.c:3737
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"以唯讀方å¼é–‹å•Ÿ(&O)\n"
+"直接編輯(&E)\n"
+"修復(&R)\n"
+"離開(&Q)\n"
+"刪除暫存檔(&D)"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: 找到太多暫存檔"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: 部份é¸é …路徑ä¸æ˜¯å­é¸å–®"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: é¸å–®åªèƒ½åœ¨å…¶å®ƒæ¨¡å¼ä¸­ä½¿ç”¨"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: 沒有那樣的é¸å–®"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: é¸å–®è·¯å¾‘ä¸èƒ½æŒ‡å‘å­é¸å–®"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ä¸èƒ½ç›´æŽ¥æŠŠé¸é …加到é¸å–®åˆ—中"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: 分隔線ä¸èƒ½æ˜¯é¸å–®è·¯å¾‘的一部份"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1079
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- é¸å–® ---"
+
+#: menu.c:1996
+msgid "Tear off this menu"
+msgstr "切下此é¸å–®"
+
+#: menu.c:2061
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: é¸å–®è·¯å¾‘必需指å‘一個é¸é …"
+
+#: menu.c:2081
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: [é¸å–®] 找ä¸åˆ° %s"
+
+#: menu.c:2150
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s 模å¼æœªå®šç¾©é¸å–®"
+
+#: menu.c:2188
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: é¸å–®è·¯å¾‘必需指å‘å­é¸å–®"
+
+#: menu.c:2209
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: 找ä¸åˆ°é¸å–® - 請檢查é¸å–®å稱"
+
+#: message.c:509
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "è™•ç† %s 時發生錯誤:"
+
+#: message.c:525
+#, c-format
+msgid "line %4ld:"
+msgstr "行 %4ld:"
+
+#: message.c:565
+msgid "[string too long]"
+msgstr "[此行éŽé•·]"
+
+#: message.c:711
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"正體中文訊æ¯ç¶­è­·è€…: Francis S.Lin <piaip@csie.ntu.edu."
+"tw>, Cecil Sheng <b7506022@csie.ntu.edu.tw>"
+
+#: message.c:935
+msgid "Interrupt: "
+msgstr "已中斷: "
+
+#: message.c:938
+msgid "Hit ENTER to continue"
+msgstr "請按 ENTER 繼續"
+
+#: message.c:940
+msgid "Hit ENTER or type command to continue"
+msgstr "請按 ENTER 或其它命令以繼續"
+
+#: message.c:2028
+msgid "-- More --"
+msgstr "-- 尚有 --"
+
+#: message.c:2031
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: å‘下/å‘上一行, 空白éµ/b: 一é , d/u: åŠé , q: 離開)"
+
+#: message.c:2032
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: å‘下一行, 空白éµ: 一é , d: åŠé , q: 離開)"
+
+#: message.c:2508 message.c:2523
+msgid "Question"
+msgstr "å•é¡Œ"
+
+#: message.c:2510
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Y是\n"
+"&Nå¦"
+
+#: message.c:2543
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Y是\n"
+"&Nå¦\n"
+"&A全部存檔\n"
+"&D全部ä¸å­˜\n"
+"&Cå–消"
+
+#: message.c:2584
+msgid "Save File dialog"
+msgstr "存檔"
+
+#: message.c:2586
+msgid "Open File dialog"
+msgstr "開檔"
+
+#. TODO: non-GUI file selector here
+#: message.c:2657
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: 主控å°(Console)模å¼æ™‚沒有檔案ç€è¦½å™¨(file browser)"
+
+#: misc1.c:2477
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: 注æ„: 你正在修改一個唯讀檔"
+
+#: misc1.c:2712
+msgid "1 more line"
+msgstr "還有一行"
+
+#: misc1.c:2714
+msgid "1 line less"
+msgstr "少於一行"
+
+#: misc1.c:2719
+#, c-format
+msgid "%ld more lines"
+msgstr " 還有 %ld 行"
+
+#: misc1.c:2721
+#, c-format
+msgid "%ld fewer lines"
+msgstr "åªå‰© %ld è¡Œ"
+
+#: misc1.c:2724
+msgid " (Interrupted)"
+msgstr " (已中斷)"
+
+#: misc1.c:6348
+msgid "Vim: preserving files...\n"
+msgstr "Vim: ä¿ç•™æª”案中...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6358
+msgid "Vim: Finished.\n"
+msgstr "Vim: çµæŸ.\n"
+
+#: misc2.c:670 misc2.c:686
+msgid "ERROR: "
+msgstr "錯誤: "
+
+#: misc2.c:690
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] 全部 alloc-freed %lu-%lu, 使用中 %lu, peak 使用 %lu\n"
+
+#: misc2.c:692
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[呼å«] 全部 re/malloc(): %lu, 全部 free()': %lu\n"
+"\n"
+
+#: misc2.c:747
+msgid "E340: Line is becoming too long"
+msgstr "E340: 此行éŽé•·"
+
+#: misc2.c:791
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: 內部錯誤: lalloc(%ld, )"
+
+#: misc2.c:899
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: 記憶體ä¸è¶³! (嘗試é…ç½® %lu ä½å…ƒçµ„)"
+
+#: misc2.c:2564
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "å‘¼å« shell 執行: \"%s\""
+
+#: misc2.c:2785
+msgid "E545: Missing colon"
+msgstr "E545: 缺少 colon"
+
+#: misc2.c:2787 misc2.c:2814
+msgid "E546: Illegal mode"
+msgstr "E546: ä¸æ­£ç¢ºçš„模å¼"
+
+#: misc2.c:2853
+msgid "E547: Illegal mouseshape"
+msgstr "E547: ä¸æ­£ç¢ºçš„滑鼠形狀"
+
+#: misc2.c:2893
+msgid "E548: digit expected"
+msgstr "E548: 應該è¦æœ‰æ•¸å­—"
+
+#: misc2.c:2898
+msgid "E549: Illegal percentage"
+msgstr "E549: ä¸æ­£ç¢ºçš„百分比"
+
+#: misc2.c:3208
+msgid "Enter encryption key: "
+msgstr "輸入密碼: "
+
+#: misc2.c:3209
+msgid "Enter same key again: "
+msgstr "è«‹å†è¼¸å…¥ä¸€æ¬¡: "
+
+#: misc2.c:3219
+msgid "Keys don't match!"
+msgstr "兩次輸入密碼ä¸ç›¸åŒ!"
+
+#: misc2.c:3768
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: ä¸æ­£ç¢ºçš„路徑: '**[number]' 必需è¦åœ¨è·¯å¾‘çµå°¾æˆ–è¦æŽ¥è‘— '%s'"
+
+#: misc2.c:5044
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath 中沒有目錄 \"%s\""
+
+#: misc2.c:5047
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: 在路徑中找ä¸åˆ°æª”案 \"%s\""
+
+#: misc2.c:5053
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: 在路徑中找ä¸åˆ°æ›´å¤šçš„檔案 \"%s\""
+
+#: misc2.c:5056
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: 在路徑中找ä¸åˆ°æ›´å¤šçš„檔案 \"%s\""
+
+#: misc2.c:5290
+msgid "E550: Missing colon"
+msgstr "E550: 缺少 colon"
+
+#: misc2.c:5302
+msgid "E551: Illegal component"
+msgstr "E551: ä¸æ­£ç¢ºçš„模å¼"
+
+#: misc2.c:5310
+msgid "E552: digit expected"
+msgstr "E552: 應該è¦æœ‰æ•¸å­—"
+
+#. Get here when the server can't be found.
+#: netbeans.c:283
+msgid "Cannot connect to Netbeans #2"
+msgstr "無法連接到 Netbeans #2"
+
+#: netbeans.c:291
+msgid "Cannot connect to Netbeans"
+msgstr "無法連接到 Netbeans"
+
+#: netbeans.c:565
+msgid "read from Netbeans socket"
+msgstr "ç”± Netbeans socket 讀å–"
+
+#: normal.c:2913
+msgid "Warning: terminal cannot highlight"
+msgstr "注æ„: 你的終端機無法顯示高亮度"
+
+#: normal.c:3128
+msgid "E348: No string under cursor"
+msgstr "E348: 游標處沒有字串"
+
+#: normal.c:3130
+msgid "E349: No identifier under cursor"
+msgstr "E349: 游標處沒有識別字"
+
+#: normal.c:4348
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: 無法在目å‰çš„ 'foldmethod' 下刪除 fold"
+
+#: ops.c:295
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "一行 %s éŽ ä¸€æ¬¡"
+
+#: ops.c:297
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "一行 %s éŽ %d 次"
+
+#: ops.c:302
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld è¡Œ %s éŽ ä¸€æ¬¡"
+
+#: ops.c:305
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld è¡Œ %s éŽ %d 次"
+
+#: ops.c:663
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "縮排 %ld 行..."
+
+#: ops.c:713
+msgid "1 line indented "
+msgstr "一行已縮排"
+
+#: ops.c:715
+#, c-format
+msgid "%ld lines indented "
+msgstr "已縮排 %ld 行"
+
+#. must display the prompt
+#: ops.c:1645
+msgid "cannot yank; delete anyway"
+msgstr "無法剪下; 直接刪除"
+
+#: ops.c:2152
+msgid "1 line changed"
+msgstr " 1 行 ~ed"
+
+#: ops.c:2154
+#, c-format
+msgid "%ld lines changed"
+msgstr " %ld 行 ~ed"
+
+#: ops.c:2538
+#, c-format
+msgid "freeing %ld lines"
+msgstr "釋放 %ld 行中"
+
+#: ops.c:2819
+msgid "1 line yanked"
+msgstr "已複製 1 行"
+
+#: ops.c:2821
+#, c-format
+msgid "%ld lines yanked"
+msgstr "已複製 %ld 行"
+
+#: ops.c:3106
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: 暫存器 %s 裡沒有æ±è¥¿"
+
+#. Highlight title
+#: ops.c:3664
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- 暫存器 ---"
+
+#: ops.c:4873
+msgid "Illegal register name"
+msgstr "ä¸æ­£ç¢ºçš„暫存器å稱"
+
+#: ops.c:4959
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# 暫存器:\n"
+
+#: ops.c:4992
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: 未知的註冊型態: %d"
+
+#: ops.c:5412
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: 暫存器å稱錯誤: '%s'"
+
+#: ops.c:5750
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld 欄; "
+
+#: ops.c:5757
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "é¸æ“‡äº† %s%ld/%ld è¡Œ; %ld/%ld å­—(Word); %ld/%ld å­—å…ƒ(Bytes)"
+
+#: ops.c:5773
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "欄 %s/%s; 行 %ld/%ld; 字(Word) %ld/%ld; 字元(Byte) %ld/%ld"
+
+#: ops.c:5784
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1579
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=第 %N é "
+
+# ? what's this for?
+#: option.c:2012
+msgid "Thanks for flying Vim"
+msgstr "æ„Ÿè¬æ‚¨æ„›ç”¨ Vim"
+
+#: option.c:3250 option.c:3357
+msgid "E518: Unknown option"
+msgstr "E518: ä¸æ­£ç¢ºçš„é¸é …"
+
+#: option.c:3263
+msgid "E519: Option not supported"
+msgstr "E519: ä¸æ”¯æ´è©²é¸é …"
+
+#: option.c:3288
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: ä¸èƒ½åœ¨ Modeline 裡出ç¾"
+
+#: option.c:3344
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t上次設定: "
+
+#: option.c:3483
+msgid "E521: Number required after ="
+msgstr "E521: = 後需è¦æœ‰æ•¸å­—"
+
+#: option.c:3797 option.c:4413
+msgid "E522: Not found in termcap"
+msgstr "E522: Termcap 裡é¢æ‰¾ä¸åˆ°"
+
+#: option.c:3863
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: ä¸æ­£ç¢ºçš„å­—å…ƒ <%s>"
+
+#: option.c:4405
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: 無法設定 'term' 為空字串"
+
+#: option.c:4408
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: 在圖型界é¢ä¸­ç„¡æ³•åˆ‡æ› term"
+
+#: option.c:4410
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: 輸入 \":gui\" 來啟動圖形界é¢"
+
+#: option.c:4431
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' 跟 'patchmode' 是一樣的"
+
+#: option.c:4616
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: 在圖型界é¢ä¸­ç„¡æ³•åˆ‡æ› term"
+
+#: option.c:4748
+msgid "E524: Missing colon"
+msgstr "E524: 缺少 colon"
+
+#: option.c:4750
+msgid "E525: Zero length string"
+msgstr "E525: 零長度字串"
+
+#: option.c:4818
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: <%s> 後缺少數字"
+
+#: option.c:4832
+msgid "E527: Missing comma"
+msgstr "E527: 缺少逗號"
+
+#: option.c:4839
+msgid "E528: Must specify a ' value"
+msgstr "E528: 必需指定一個 ' 值"
+
+#: option.c:4880
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: å…§å«ç„¡æ³•é¡¯ç¤ºçš„å­—å…ƒ"
+
+#: option.c:4929
+msgid "E596: Invalid font(s)"
+msgstr "E596: ä¸æ­£ç¢ºçš„å­—åž‹"
+
+#: option.c:4937
+msgid "E597: can't select fontset"
+msgstr "E597: 無法使用字型集(Fontset)"
+
+#: option.c:4939
+msgid "E598: Invalid fontset"
+msgstr "E598: ä¸æ­£ç¢ºçš„字型集(Fontset)"
+
+#: option.c:4946
+msgid "E533: can't select wide font"
+msgstr "E533: 無法使用設定的中文字型(Widefont)"
+
+#: option.c:4948
+msgid "E534: Invalid wide font"
+msgstr "E534: ä¸æ­£ç¢ºçš„å­—åž‹(Widefont)"
+
+#: option.c:5218
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: <%c> 後有ä¸æ­£ç¢ºçš„å­—å…ƒ"
+
+#: option.c:5322
+msgid "E536: comma required"
+msgstr "E536: 需è¦é€—號"
+
+#: option.c:5330
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' å¿…éœ€æ˜¯ç©ºç™½æˆ–åŒ…å« %s"
+
+#: option.c:5377
+msgid "E538: No mouse support"
+msgstr "E538: ä¸æ”¯æ´æ»‘é¼ "
+
+#: option.c:5645
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: 沒有çµæŸçš„é‹ç®—å¼: "
+
+#: option.c:5649
+msgid "E541: too many items"
+msgstr "E541: 太多項目"
+
+#: option.c:5651
+msgid "E542: unbalanced groups"
+msgstr "E542: ä¸å°ç¨±çš„ group"
+
+#: option.c:5872
+msgid "E590: A preview window already exists"
+msgstr "E590: é è¦–的視窗已經存在了"
+
+#: option.c:6346
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: è‡³å°‘éœ€è¦ %d è¡Œ"
+
+#: option.c:6355
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: è‡³å°‘éœ€è¦ %d 欄"
+
+#: option.c:6660
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ä¸æ­£ç¢ºçš„é¸é …: %s"
+
+#: option.c:6769
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- 終端機碼 ---"
+
+#: option.c:6771
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Global é¸é …值 ---"
+
+#: option.c:6773
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Local é¸é …值 ---"
+
+#: option.c:6775
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- é¸é … ---"
+
+#: option.c:7467
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp 錯誤"
+
+#: option.c:8425
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': 找ä¸åˆ° %s å°æ‡‰çš„å­—å…ƒ"
+
+#: option.c:8459
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': 分號後有多餘的字元: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "ä¸èƒ½é–‹å•Ÿ"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: 無法開啟視窗!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "éœ€è¦ Amigados 版本 2.04 以上\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "éœ€è¦ %s 版本 %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "無法開啟 NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "ä¸èƒ½å»ºç«‹ "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim çµæŸå‚³å›žå€¼: %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "無法切æ›ä¸»æŽ§å°(console)æ¨¡å¼ !?\n"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ä¸æ˜¯ä¸»æŽ§å°(console)??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1143
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: ä¸èƒ½ç”¨ -f é¸é …執行 shell"
+
+#: os_amiga.c:1184 os_amiga.c:1274
+msgid "Cannot execute "
+msgstr "ä¸èƒ½åŸ·è¡Œ "
+
+#: os_amiga.c:1187 os_amiga.c:1284
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1207 os_amiga.c:1309
+msgid " returned\n"
+msgstr " 已返回\n"
+
+#: os_amiga.c:1450
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE 太å°"
+
+#: os_amiga.c:1454
+msgid "I/O ERROR"
+msgstr "I/O 錯誤"
+
+#: os_mswin.c:515
+msgid "...(truncated)"
+msgstr "...(已切掉)"
+
+#: os_mswin.c:617
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ä¸æ˜¯ 80, 無法執行外部命令"
+
+#: os_mswin.c:1802
+msgid "E237: Printer selection failed"
+msgstr "E237: 無法é¸æ“‡æ­¤å°è¡¨æ©Ÿ"
+
+#: os_mswin.c:1842
+#, c-format
+msgid "to %s on %s"
+msgstr "到 %s on %s"
+
+#: os_mswin.c:1857
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: ä¸æ­£ç¢ºçš„å°è¡¨æ©Ÿå­—åž‹: %s"
+
+#: os_mswin.c:1907 os_mswin.c:1917
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: 列å°éŒ¯èª¤: %s"
+
+#: os_mswin.c:1918
+msgid "Unknown"
+msgstr "未知"
+
+#: os_mswin.c:1945
+#, c-format
+msgid "Printing '%s'"
+msgstr "列å°ä¸­: '%s'"
+
+#: os_mswin.c:3033
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: 字元集 \"%s\" 無法å°æ‡‰å­—åž‹\"%s\""
+
+#: os_mswin.c:3041
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ä¸æ­£ç¢ºçš„å­—å…ƒ '%c' 出ç¾åœ¨å­—åž‹å稱 \"%s\" å…§"
+
+#: os_riscos.c:1258
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ä¸æ­£ç¢ºçš„ 'filetype' é¸é … - 使用純文字模å¼"
+
+#: os_unix.c:871
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: é›™é‡signal, 離開中\n"
+
+#: os_unix.c:877
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: CVim: 攔截到信號(signal) %s\n"
+
+#: os_unix.c:880
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: 攔截到致命的信號(deadly signale)\n"
+
+#: os_unix.c:1143
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "開啟 X Window 耗時 %ld msec"
+
+#: os_unix.c:1170
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X 錯誤\n"
+
+#: os_unix.c:1276
+msgid "Testing the X display failed"
+msgstr "測試 X Window 失敗"
+
+#: os_unix.c:1415
+msgid "Opening the X display timed out"
+msgstr "開啟 X Window 逾時"
+
+#: os_unix.c:3145 os_unix.c:3825
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"ä¸èƒ½åŸ·è¡Œ shell"
+
+#: os_unix.c:3193
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"ä¸èƒ½åŸ·è¡Œ shell sh\n"
+
+#: os_unix.c:3197 os_unix.c:3831
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell 已返回"
+
+#: os_unix.c:3332
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"ä¸èƒ½å»ºç«‹ pipe 管線\n"
+
+#: os_unix.c:3347
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"ä¸èƒ½ fork\n"
+
+#: os_unix.c:3838
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"命令已終çµ\n"
+
+#: os_unix.c:5398
+msgid "Opening the X display failed"
+msgstr "開啟 X Window 失敗"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "在行號 "
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "無法載入 vim32.dllï¼"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM 錯誤"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "ä¸èƒ½ä¿®æ­£å‡½å¼æŒ‡æ¨™åˆ° DLL!"
+
+#: os_win16.c:583 os_win32.c:3047
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell 傳回值 %d"
+
+#: os_win32.c:2505
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: 攔截到 %s \n"
+
+#: os_win32.c:2507
+msgid "close"
+msgstr "關閉"
+
+#: os_win32.c:2509
+msgid "logoff"
+msgstr "登出"
+
+#: os_win32.c:2510
+msgid "shutdown"
+msgstr "關機"
+
+#: os_win32.c:3000
+msgid "E371: Command not found"
+msgstr "E371: 找ä¸åˆ°å‘½ä»¤"
+
+#: os_win32.c:3013
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"在你的 $PATH 中找ä¸åˆ° VIMRUN.EXE.\n"
+"外部命令執行完畢後將ä¸æœƒæš«åœ.\n"
+"進一步說明請執行 :help win32-vimrun "
+
+#: os_win32.c:3016
+msgid "Vim Warning"
+msgstr "Vim 警告"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: æ ¼å¼åŒ–字串裡有太多 %%%c "
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: æ ¼å¼åŒ–字串ä¸æ‡‰è©²å‡ºç¾ %%%c "
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: æ ¼å¼åŒ–字串裡少了 ]"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: æ ¼å¼åŒ–字串裡有ä¸æ”¯æ´çš„ %%%c "
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: æ ¼å¼åŒ–字串開頭裡有ä¸æ­£ç¢ºçš„ %%%c "
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: æ ¼å¼åŒ–字串裡有ä¸æ­£ç¢ºçš„ %%%c "
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' 未設定"
+
+#: quickfix.c:497
+msgid "E379: Missing or empty directory name"
+msgstr "E379: 找ä¸åˆ°ç›®éŒ„å稱或是空的目錄å稱"
+
+#: quickfix.c:979
+msgid "E553: No more items"
+msgstr "E553: 沒有其它項目"
+
+#: quickfix.c:1200
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d / %d)%s%s: "
+
+#: quickfix.c:1202
+msgid " (line deleted)"
+msgstr " (行已刪除)"
+
+#: quickfix.c:1412
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Quickfix 堆疊çµå°¾"
+
+#: quickfix.c:1421
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Quickfix 堆疊頂端"
+
+#: quickfix.c:1433
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "錯誤列表 %d/%d; 共有 %d 項錯誤"
+
+#: quickfix.c:1904
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: 無法寫入,'buftype' é¸é …已設定"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: ä¸æ­£ç¢ºçš„項目: %s%%[]"
+
+#: regexp.c:826
+msgid "E339: Pattern too long"
+msgstr "E339: å字太長"
+
+#: regexp.c:995
+msgid "E50: Too many \\z("
+msgstr "E50: 太多 \\z("
+
+#: regexp.c:1006
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: 太多 %s("
+
+#: regexp.c:1063
+msgid "E52: Unmatched \\z("
+msgstr "E52: ç„¡å°æ‡‰çš„ \\z("
+
+#: regexp.c:1067
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: ç„¡å°æ‡‰çš„ %s%%("
+
+#: regexp.c:1069
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: ç„¡å°æ‡‰çš„ %s("
+
+#: regexp.c:1074
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: ç„¡å°æ‡‰çš„ %s)"
+
+#: regexp.c:1237
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s* é‹ç®—å…ƒå¯ä»¥æ˜¯ç©ºçš„"
+
+#: regexp.c:1240
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E56: %s+ é‹ç®—å…ƒå¯ä»¥æ˜¯ç©ºçš„"
+
+#: regexp.c:1294
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: 後é¢æœ‰ä¸æ­£ç¢ºçš„å­—å…ƒ: %s@"
+
+#: regexp.c:1319
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{ é‹ç®—å…ƒå¯ä»¥æ˜¯ç©ºçš„"
+
+#: regexp.c:1329
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: 太多複雜的 %s{...}s"
+
+#: regexp.c:1345
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: 巢狀 %s*"
+
+#: regexp.c:1348
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: 巢狀 %s%c"
+
+#: regexp.c:1466
+msgid "E63: invalid use of \\_"
+msgstr "E63: ä¸æ­£ç¢ºçš„使用 \\_"
+
+#: regexp.c:1511
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c 沒有接æ±è¥¿"
+
+#: regexp.c:1567
+msgid "E65: Illegal back reference"
+msgstr "E65: ä¸æ­£ç¢ºçš„åå‘åƒè€ƒ"
+
+#: regexp.c:1580
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ä¸èƒ½åœ¨æ­¤å‡ºç¾"
+
+#: regexp.c:1599
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et al. ä¸èƒ½åœ¨æ­¤å‡ºç¾"
+
+#: regexp.c:1610
+msgid "E68: Invalid character after \\z"
+msgstr "E68: 後é¢æœ‰ä¸æ­£ç¢ºçš„å­—å…ƒ: \\z"
+
+#: regexp.c:1659
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: %s%%[ 後缺少 ]"
+
+#: regexp.c:1675
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: 空的 %s%%[]"
+
+#: regexp.c:1735
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: 後é¢æœ‰ä¸æ­£ç¢ºçš„å­—å…ƒ: %s%%"
+
+#: regexp.c:2530
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: 語法錯誤: %s{...}"
+
+#: regexp.c:2777
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: 無法執行; regular expression 太複雜?"
+
+#: regexp.c:2912
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: regular expression 造æˆå †ç–Šç”¨å…‰çš„錯誤"
+
+#: regexp.c:3148
+msgid "External submatches:\n"
+msgstr "外部符åˆ:\n"
+
+#: screen.c:2103
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--已 fold %3ld 行"
+
+#: screen.c:7785
+msgid " VREPLACE"
+msgstr " V-å–代"
+
+#: screen.c:7789
+msgid " REPLACE"
+msgstr " å–代"
+
+#: screen.c:7794
+msgid " REVERSE"
+msgstr " å轉"
+
+#: screen.c:7796
+msgid " INSERT"
+msgstr " æ’å…¥"
+
+#: screen.c:7799
+msgid " (insert)"
+msgstr " (æ’å…¥)"
+
+#: screen.c:7801
+msgid " (replace)"
+msgstr " (å–代)"
+
+#: screen.c:7803
+msgid " (vreplace)"
+msgstr " (v-å–代)"
+
+#: screen.c:7806
+msgid " Hebrew"
+msgstr " Hebrew"
+
+#: screen.c:7814
+msgid " (lang)"
+msgstr " (語言)"
+
+#: screen.c:7817
+msgid " (paste)"
+msgstr " (貼上)"
+
+#: screen.c:7823
+msgid " SELECT"
+msgstr " é¸å–"
+
+#: screen.c:7825
+msgid " VISUAL"
+msgstr " é¸å–"
+
+#: screen.c:7827
+msgid " BLOCK"
+msgstr " å€å¡Š"
+
+#: screen.c:7829
+msgid " LINE"
+msgstr " è¡Œé¸å–"
+
+#: screen.c:7842 screen.c:7902
+msgid "recording"
+msgstr "記錄中"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "å·²æœå°‹åˆ°æª”案開頭;å†å¾žçµå°¾ç¹¼çºŒæœå°‹"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "å·²æœå°‹åˆ°æª”案çµå°¾ï¼›å†å¾žé–‹é ­ç¹¼çºŒæœå°‹"
+
+#: search.c:455
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: 錯誤的æœå°‹å­—串: %s"
+
+#: search.c:782
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: å·²æœå°‹åˆ°æª”案開頭ä»æ‰¾ä¸åˆ° %s"
+
+#: search.c:784
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: å·²æœå°‹åˆ°æª”案çµå°¾ä»æ‰¾ä¸åˆ° %s"
+
+#: search.c:1157
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: 在 ';' 後é¢æ‡‰è©²æœ‰ '?' 或 '/'"
+
+#: search.c:3567
+msgid " (includes previously listed match)"
+msgstr " (包括å‰æ¬¡åˆ—出符åˆé …)"
+
+#. cursor at status line
+#: search.c:3587
+msgid "--- Included files "
+msgstr "--- 引入檔案 "
+
+#: search.c:3589
+msgid "not found "
+msgstr "找ä¸åˆ° "
+
+#: search.c:3590
+msgid "in path ---\n"
+msgstr "---\n"
+
+#: search.c:3629
+msgid " (Already listed)"
+msgstr " (已列出)"
+
+#: search.c:3631
+msgid " NOT FOUND"
+msgstr " 找ä¸åˆ°"
+
+#: search.c:3683
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "æœå°‹å¼•å…¥æª”案: %s"
+
+#: search.c:3901
+msgid "E387: Match is on current line"
+msgstr "E387: ç›®å‰æ‰€åœ¨è¡Œä¸­æœ‰ä¸€åŒ¹é…"
+
+#: search.c:4041
+msgid "All included files were found"
+msgstr "所有引入檔案都已找到"
+
+#: search.c:4043
+msgid "No included files"
+msgstr "沒有引入檔案"
+
+#: search.c:4059
+msgid "E388: Couldn't find definition"
+msgstr "E388: 找ä¸åˆ°å®šç¾©"
+
+#: search.c:4061
+msgid "E389: Couldn't find pattern"
+msgstr "E389: 找ä¸åˆ° pattern"
+
+#: syntax.c:3015
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: åƒæ•¸ä¸æ­£ç¢º: %s"
+
+#: syntax.c:3195
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: ç„¡æ­¤ syntax cluster: \"%s\""
+
+#: syntax.c:3359
+msgid "No Syntax items defined for this buffer"
+msgstr "這個緩è¡å€æ²’有定義任何語法"
+
+#: syntax.c:3367
+msgid "syncing on C-style comments"
+msgstr "C語言å¼è¨»è§£åŒæ­¥åŒ–中"
+
+#: syntax.c:3375
+msgid "no syncing"
+msgstr "沒有åŒæ­¥åŒ–"
+
+#: syntax.c:3378
+msgid "syncing starts "
+msgstr "åŒæ­¥åŒ–開始"
+
+#: syntax.c:3380 syntax.c:3455
+msgid " lines before top line"
+msgstr "行號超出範åœ"
+
+#: syntax.c:3385
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- 語法åŒæ­¥ç‰©ä»¶ (Syntax sync items) ---"
+
+#: syntax.c:3390
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"åŒæ­¥åŒ–中:"
+
+#: syntax.c:3396
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- 語法項目 ---"
+
+#: syntax.c:3419
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: ç„¡æ­¤ syntax cluster: \"%s\""
+
+#: syntax.c:3445
+msgid "minimal "
+msgstr "最å°"
+
+#: syntax.c:3452
+msgid "maximal "
+msgstr "最大"
+
+#: syntax.c:3464
+msgid "; match "
+msgstr "; ç¬¦åˆ "
+
+#: syntax.c:3466
+msgid " line breaks"
+msgstr "斷行"
+
+#: syntax.c:4100
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: 使用了ä¸æ­£ç¢ºçš„åƒæ•¸"
+
+#: syntax.c:4124
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: 找ä¸åˆ° %s çš„ region item"
+
+#: syntax.c:4152
+msgid "E395: contains argument not accepted here"
+msgstr "E395: 使用了ä¸æ­£ç¢ºçš„åƒæ•¸"
+
+#: syntax.c:4163
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: 使用了ä¸æ­£ç¢ºçš„åƒæ•¸"
+
+#: syntax.c:4241
+msgid "E397: Filename required"
+msgstr "E397: 需è¦æª”案å稱"
+
+#: syntax.c:4579
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: 缺少 \"=\": %s"
+
+#: syntax.c:4737
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: syntax region %s 的引數太少"
+
+#: syntax.c:5068
+msgid "E400: No cluster specified"
+msgstr "E400: 沒有指定的屬性"
+
+#: syntax.c:5105
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: 找ä¸åˆ°åˆ†éš”符號: %s"
+
+#: syntax.c:5180
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: '%s' 後é¢çš„æ±è¥¿ç„¡æ³•è¾¨è­˜"
+
+#: syntax.c:5270
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: 語法åŒæ­¥: 連接行符號被指定了兩次"
+
+#: syntax.c:5327
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: åƒæ•¸ä¸æ­£ç¢º: %s"
+
+#: syntax.c:5377
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: 缺少相等符號: %s"
+
+#: syntax.c:5383
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: 空白åƒæ•¸: %s"
+
+#: syntax.c:5410
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ä¸èƒ½åœ¨æ­¤å‡ºç¾"
+
+#: syntax.c:5417
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s 必須是列表裡的第一個"
+
+#: syntax.c:5487
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ä¸æ­£ç¢ºçš„群組å稱: %s"
+
+#: syntax.c:5720
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ä¸æ­£ç¢ºçš„ :syntax å­å‘½ä»¤: %s"
+
+#: syntax.c:6099
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: 找ä¸åˆ° highlight group: %s"
+
+#: syntax.c:6123
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: åƒæ•¸å¤ªå°‘: \":highlight link %s\""
+
+#: syntax.c:6130
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: åƒæ•¸éŽå¤š: \":highlight link %s\""
+
+#: syntax.c:6150
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: 已設定群組, 忽略 highlight link"
+
+#: syntax.c:6279
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ä¸è©²æœ‰çš„等號: %s"
+
+#: syntax.c:6315
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: 缺少相等符號: %s"
+
+#: syntax.c:6337
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: 缺少åƒæ•¸: %s"
+
+#: syntax.c:6374
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ä¸åˆæ³•çš„值: %s"
+
+#: syntax.c:6493
+msgid "E419: FG color unknown"
+msgstr "E419: 錯誤的å‰æ™¯é¡è‰²"
+
+#: syntax.c:6504
+msgid "E420: BG color unknown"
+msgstr "E420: 錯誤的背景é¡è‰²"
+
+#: syntax.c:6565
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: 錯誤的é¡è‰²å稱或數值: %s"
+
+#: syntax.c:6771
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: 終端機碼太長: %s"
+
+#: syntax.c:6818
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: åƒæ•¸ä¸æ­£ç¢º: %s"
+
+#: syntax.c:7347
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: 使用了éŽå¤šç›¸ç•°çš„高亮度屬性"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: 標籤(tag)堆疊çµå°¾"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: 標籤(tag)堆疊開頭"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: 已經在最å‰é¢çš„標籤(tag)了"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: 找ä¸åˆ°æ¨™ç±¤(tag): %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "檔案\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "輸入 nr 或é¸æ“‡ (<CR> 離開): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: åªæœ‰æ­¤é …符åˆ"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: 己經在最後一個符åˆçš„ tag 了"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "檔案 \"%s\" ä¸å­˜åœ¨"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "找到 tag: %d/%d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " 或更多"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " 以ä¸åŒå¤§å°å¯«ä¾†ä½¿ç”¨ tag!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: 檔案 \"%s\" ä¸å­˜åœ¨"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # 到 tag 從 行 在 檔案/文字"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "線性æœå°‹æ¨™ç±¤ (Tags)"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "二分æœå°‹(Binary search) 標籤(Tags)"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "æœå°‹ tag 檔案 \"%s\""
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag 檔案路徑被截斷為 %s\n"
+
+#: tag.c:1858
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Tag 檔 \"%s\" æ ¼å¼éŒ¯èª¤"
+
+#: tag.c:1862
+#, c-format
+msgid "Before byte %ld"
+msgstr "在 %ld ä½å…ƒä¹‹å‰"
+
+#: tag.c:1883
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag 檔案未排åº: %s"
+
+#. never opened any tags file
+#: tag.c:1922
+msgid "E433: No tags file"
+msgstr "E433: 沒有 tag 檔"
+
+#: tag.c:2600
+msgid "E434: Can't find tag pattern"
+msgstr "E434: 找ä¸åˆ° tag"
+
+#: tag.c:2611
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: 找ä¸åˆ° tag, 用猜的!"
+
+#: term.c:1745
+msgid "' not known. Available builtin terminals are:"
+msgstr "' 無法載入。å¯ç”¨çš„內建終端機形å¼æœ‰:"
+
+#: term.c:1769
+msgid "defaulting to '"
+msgstr "é è¨­: '"
+
+#: term.c:2127
+msgid "E557: Cannot open termcap file"
+msgstr "E557: 無法開啟 termcap 檔案"
+
+#: term.c:2131
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: terminfo 中沒有終端機資料項"
+
+#: term.c:2133
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: termcap 中沒有終端機資料項"
+
+#: term.c:2292
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap 沒有 \"%s\" entry"
+
+#: term.c:2766
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: çµ‚ç«¯æ©Ÿéœ€è¦ \"cm\" 的能力"
+
+#. Highlight title
+#: term.c:4927
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- çµ‚ç«¯æ©ŸæŒ‰éµ ---"
+
+#: ui.c:252
+msgid "new shell started\n"
+msgstr "èµ·å‹•æ–° shell\n"
+
+#: ui.c:1784
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: 讀å–輸入錯誤,離開中...\n"
+
+#. must display the prompt
+#: undo.c:394
+msgid "No undo possible; continue anyway"
+msgstr "無法還原;請繼續努力"
+
+#: undo.c:549
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: 行號錯誤"
+
+#: undo.c:718
+msgid "1 change"
+msgstr "一項改變"
+
+#: undo.c:720
+#, c-format
+msgid "%ld changes"
+msgstr "%ld 項改變"
+
+#: undo.c:764
+msgid "E439: undo list corrupt"
+msgstr "E439: 復原列表æ壞"
+
+#: undo.c:796
+msgid "E440: undo line missing"
+msgstr "E440: 找ä¸åˆ°è¦ undo çš„è¡Œ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:682
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 Bit 圖型界é¢ç‰ˆæœ¬"
+
+#: version.c:684
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit 圖型界é¢ç‰ˆæœ¬"
+
+#: version.c:687
+msgid " in Win32s mode"
+msgstr "Win32s 模å¼"
+
+#: version.c:689
+msgid " with OLE support"
+msgstr "æ”¯æ´ OLE"
+
+#: version.c:692
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit console 版本"
+
+#: version.c:696
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit console 版本"
+
+#: version.c:700
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 Bit MS-DOS 版本"
+
+#: version.c:702
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 Bit MS-DOS 版本"
+
+#: version.c:708
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) 版本"
+
+#: version.c:710
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X 版本"
+
+#: version.c:713
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS 版本"
+
+#: version.c:718
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS 版本"
+
+#: version.c:728
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"引入修正: "
+
+#: version.c:754 version.c:1097
+msgid "Modified by "
+msgstr "修改者為"
+
+#: version.c:761
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"編譯"
+
+#: version.c:764
+msgid "by "
+msgstr "者:"
+
+#: version.c:776
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"超強版本 "
+
+#: version.c:779
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"大型版本 "
+
+#: version.c:782
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"一般版本 "
+
+#: version.c:785
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"簡易版本 "
+
+#: version.c:787
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"精簡版本 "
+
+#: version.c:793
+msgid "without GUI."
+msgstr "ä¸ä½¿ç”¨åœ–åž‹ç•Œé¢ã€‚"
+
+#: version.c:798
+msgid "with GTK2-GNOME GUI."
+msgstr "使用 GTK2-GNOME 圖型界é¢ã€‚"
+
+#: version.c:800
+msgid "with GTK-GNOME GUI."
+msgstr "使用 GTK-GNOME 圖型界é¢ã€‚"
+
+#: version.c:804
+msgid "with GTK2 GUI."
+msgstr "使用 GTK2 圖型界é¢ã€‚"
+
+#: version.c:806
+msgid "with GTK GUI."
+msgstr "使用 GTK 圖型界é¢ã€‚"
+
+#: version.c:811
+msgid "with X11-Motif GUI."
+msgstr "使用 X11-Motif 圖型界é¢ã€‚"
+
+#: version.c:814
+msgid "with X11-Athena GUI."
+msgstr "使用 X11-Athena 圖型界é¢ã€‚"
+
+#: version.c:817
+msgid "with BeOS GUI."
+msgstr "使用 BeOS 圖型界é¢ã€‚"
+
+#: version.c:820
+msgid "with Photon GUI."
+msgstr "使用Photon圖型界é¢ã€‚"
+
+#: version.c:823
+msgid "with GUI."
+msgstr "使用圖型界é¢ã€‚"
+
+#: version.c:826
+msgid "with Carbon GUI."
+msgstr "使用 Carbon 圖型界é¢ã€‚"
+
+#: version.c:829
+msgid "with Cocoa GUI."
+msgstr "使用 Cocoa 圖型界é¢ã€‚"
+
+#: version.c:832
+msgid "with (classic) GUI."
+msgstr "使用 (傳統) 圖型界é¢ã€‚"
+
+#: version.c:843
+msgid " Features included (+) or not (-):\n"
+msgstr " ç›®å‰å¯ä½¿ç”¨(+)與ä¸å¯ä½¿ç”¨(-)的模組列表:\n"
+
+#: version.c:855
+msgid " system vimrc file: \""
+msgstr " 系統 vimrc 設定檔: \""
+
+#: version.c:860
+msgid " user vimrc file: \""
+msgstr " 使用者個人 vimrc 設定檔: \""
+
+#: version.c:865
+msgid " 2nd user vimrc file: \""
+msgstr " 第二組個人 vimrc 檔案: \""
+
+#: version.c:870
+msgid " 3rd user vimrc file: \""
+msgstr " 第三組個人 vimrc 檔案: \""
+
+#: version.c:875
+msgid " user exrc file: \""
+msgstr " 使用者個人 exrc 設定檔: \""
+
+#: version.c:880
+msgid " 2nd user exrc file: \""
+msgstr " 第二組使用者 exrc 檔案: \""
+
+#: version.c:886
+msgid " system gvimrc file: \""
+msgstr " 系統 gvimrc 檔案: \""
+
+#: version.c:890
+msgid " user gvimrc file: \""
+msgstr " 使用者個人 gvimrc 檔: \""
+
+#: version.c:894
+msgid "2nd user gvimrc file: \""
+msgstr " 第二組個人 gvimrc 檔案: \""
+
+#: version.c:899
+msgid "3rd user gvimrc file: \""
+msgstr " 第三組個人 gvimrc 檔案: \""
+
+#: version.c:906
+msgid " system menu file: \""
+msgstr " 系統é¸å–®è¨­å®šæª”: \""
+
+#: version.c:914
+msgid " fall-back for $VIM: \""
+msgstr " $VIM é è¨­å€¼: \""
+
+#: version.c:920
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME é è¨­å€¼: \""
+
+#: version.c:924
+msgid "Compilation: "
+msgstr "編譯方å¼: "
+
+#: version.c:930
+msgid "Compiler: "
+msgstr "編譯器: "
+
+#: version.c:935
+msgid "Linking: "
+msgstr "éˆçµæ–¹å¼: "
+
+#: version.c:940
+msgid " DEBUG BUILD"
+msgstr " 除錯版本"
+
+#: version.c:976
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:978
+msgid "version "
+msgstr "版本 "
+
+#: version.c:979
+msgid "by Bram Moolenaar et al."
+msgstr "維護者: Bram Moolenaar et al."
+
+#: version.c:983
+msgid "Vim is open source and freely distributable"
+msgstr "Vim 為å¯è‡ªç”±æ•£ä½ˆçš„開放原始碼軟體"
+
+#: version.c:985
+msgid "Help poor children in Uganda!"
+msgstr "請幫助çƒå¹²é”çš„å¯æ†å­©ç«¥!"
+
+#: version.c:986
+msgid "type :help iccf<Enter> for information "
+msgstr "進一步說明請輸入 :help iccf<Enter>"
+
+#: version.c:988
+msgid "type :q<Enter> to exit "
+msgstr "è¦é›¢é–‹è«‹è¼¸å…¥ :q<Enter> "
+
+#: version.c:989
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "線上說明請輸入 :help<Enter> "
+
+#: version.c:990
+msgid "type :help version6<Enter> for version info"
+msgstr "新版本資訊請輸入 :help version6<Enter>"
+
+#: version.c:993
+msgid "Running in Vi compatible mode"
+msgstr "Vi 相容模å¼"
+
+#: version.c:994
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "如果è¦å®Œå…¨æ¨¡æ“¬å‚³çµ± Vi 請輸入 :set nocp<Enter>"
+
+#: version.c:995
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "如果需è¦å° Vi 相容模å¼çš„進一步說明請輸入 :help cp-default<Enter>"
+
+#: version.c:1010
+msgid "menu Help->Orphans for information "
+msgstr "進一步說明請é¸å–é¸å–®çš„ 輔助說明->拯救孤兒"
+
+#: version.c:1012
+msgid "Running modeless, typed text is inserted"
+msgstr "執行 Modeless 模å¼ï¼Œè¼¸å…¥çš„文字會自動æ’å…¥"
+
+#: version.c:1013
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "é¸å–é¸å–®çš„「編輯ã€ã€Œå…¨åŸŸè¨­å®šã€ã€Œåˆ‡æ›æ’入模å¼ã€"
+
+#: version.c:1014
+msgid " for two modes "
+msgstr " å…©ç¨®æ¨¡å¼ "
+
+#: version.c:1018
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "é¸å–é¸å–®çš„「編輯ã€ã€Œå…¨åŸŸè¨­å®šã€ã€Œåˆ‡æ›å‚³çµ±Vi相容模å¼ã€"
+
+#: version.c:1019
+msgid " for Vim defaults "
+msgstr " 以得 Vim é è¨­å€¼ "
+
+#: version.c:1065
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "注æ„: åµæ¸¬åˆ° Windows 95/98/ME"
+
+#: version.c:1068
+msgid "type :help windows95<Enter> for info on this"
+msgstr "如果需è¦å° Windows 95 支æ´çš„更多資訊請輸入 :help windows95<Enter>"
+
+#: window.c:204
+msgid "E441: There is no preview window"
+msgstr "E441: 沒有é è¦½è¦–窗"
+
+#: window.c:577
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ä¸èƒ½åŒæ™‚分割視窗為左上和å³ä¸‹è§’"
+
+#: window.c:1336
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: 有其它分割視窗時無法旋轉"
+
+#: window.c:1827
+msgid "E444: Cannot close last window"
+msgstr "E444: ä¸èƒ½é—œé–‰æœ€å¾Œä¸€å€‹è¦–窗"
+
+#: window.c:2557
+msgid "Already only one window"
+msgstr "已經åªå‰©ä¸€å€‹è¦–窗了"
+
+#: window.c:2604
+msgid "E445: Other window contains changes"
+msgstr "E445: 其它視窗有更動資料"
+
+#: window.c:4449
+msgid "E446: No file name under cursor"
+msgstr "E446: 游標處沒有檔å"
+
+#: window.c:4568
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: 在路徑中找ä¸åˆ°æª”案 \"%s\""
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "使用多個 Vim session 編輯(&M)"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "åªä½¿ç”¨åŒä¸€å€‹ Vim session 編輯(&V)"
+
+#: ../GvimExt/gvimext.cpp:601
+msgid "&Diff with Vim"
+msgstr "使用 Vim 來比較(&Diff)"
+
+#: ../GvimExt/gvimext.cpp:614
+msgid "Edit with &Vim"
+msgstr "使用 Vim 編輯此檔(&V)"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:636
+msgid "Edit with existing Vim - &"
+msgstr "使用執行中的 Vim session 編輯 - &"
+
+#: ../GvimExt/gvimext.cpp:749
+msgid "Edits the selected file(s) with Vim"
+msgstr "使用 Vim 編輯已é¸å–的檔案"
+
+#: ../GvimExt/gvimext.cpp:888 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "無法執行程å¼: 請檢查 gvim 有沒有在你的 PATH 變數裡!"
+
+#: ../GvimExt/gvimext.cpp:889 ../GvimExt/gvimext.cpp:903
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll 錯誤"
+
+#: ../GvimExt/gvimext.cpp:902
+msgid "Path length too long!"
+msgstr "路徑長度太長!"
+
+#: globals.h:990
+msgid "--No lines in buffer--"
+msgstr "--ç·©è¡å€ç„¡è³‡æ–™--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1149
+msgid "E470: Command aborted"
+msgstr "E470: 命令被強制中斷執行"
+
+#: globals.h:1150
+msgid "E471: Argument required"
+msgstr "E471: 需è¦æŒ‡ä»¤åƒæ•¸"
+
+#: globals.h:1151
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ 後é¢æ‡‰è©²æœ‰ / ? 或 &"
+
+#: globals.h:1153
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ä¸èƒ½åœ¨å‘½ä»¤åˆ—視窗中使用。<CR>執行,CTRL-C 離開"
+
+#: globals.h:1155
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: exrc/vimrc 裡的指令無法執行"
+
+#: globals.h:1157
+msgid "E171: Missing :endif"
+msgstr "E171: 缺少 :endif"
+
+#: globals.h:1158
+msgid "E600: Missing :endtry"
+msgstr "E600: 缺少 :endtry"
+
+#: globals.h:1159
+msgid "E170: Missing :endwhile"
+msgstr "E170: 缺少 :endwhile"
+
+#: globals.h:1160
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile 缺少å°æ‡‰çš„ :while"
+
+#: globals.h:1162
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: 檔案已經存在 (å¯ç”¨ ! 強制å–代)"
+
+#: globals.h:1163
+msgid "E472: Command failed"
+msgstr "E472: 命令執行失敗"
+
+#: globals.h:1165
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ä¸æ­£ç¢ºçš„字元集 (Fontset): %s"
+
+#: globals.h:1169
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "ä¸æ­£ç¢ºçš„å­—åž‹å稱: %s"
+
+#: globals.h:1172
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: \"%s\" ä¸æ˜¯å›ºå®šå¯¬åº¦å­—åž‹"
+
+#: globals.h:1174
+msgid "E473: Internal error"
+msgstr "E473: 內部錯誤"
+
+#: globals.h:1175
+msgid "Interrupted"
+msgstr "已中斷"
+
+#: globals.h:1176
+msgid "E14: Invalid address"
+msgstr "E14: ä¸æ­£ç¢ºçš„ä½å€"
+
+#: globals.h:1177
+msgid "E474: Invalid argument"
+msgstr "E474: ä¸æ­£ç¢ºçš„åƒæ•¸"
+
+#: globals.h:1178
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: ä¸æ­£ç¢ºçš„åƒæ•¸: %s"
+
+#: globals.h:1180
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ä¸æ­£ç¢ºçš„é‹ç®—å¼: %s"
+
+#: globals.h:1182
+msgid "E16: Invalid range"
+msgstr "E16: ä¸æ­£ç¢ºçš„範åœ"
+
+#: globals.h:1183
+msgid "E476: Invalid command"
+msgstr "E476: ä¸æ­£ç¢ºçš„命令"
+
+#: globals.h:1185
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" 是目錄"
+
+#: globals.h:1188
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' å‰é¢å‡ºç¾äº†éŒ¯èª¤çš„å­—å…ƒ"
+
+#: globals.h:1191
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: 呼å«å‡½å¼åº« \"%s\"() 失敗"
+
+#: globals.h:1196
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: 無法é‡æ–°è¼‰å…¥ç¨‹å¼åº« %s"
+
+#: globals.h:1197
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: 無法載入程å¼åº«çš„å‡½å¼ %s"
+
+#: globals.h:1199
+msgid "E19: Mark has invalid line number"
+msgstr "E19: 標記的行號錯誤"
+
+#: globals.h:1200
+msgid "E20: Mark not set"
+msgstr "E20: 沒有設定標記"
+
+#: globals.h:1201
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: 因為 'modifiable' é¸é …是關閉的,所以ä¸èƒ½ä¿®æ”¹"
+
+#: globals.h:1202
+msgid "E22: Scripts nested too deep"
+msgstr "E22: 巢狀éžè¿´å‘¼å«å¤ªå¤šå±¤"
+
+#: globals.h:1203
+msgid "E23: No alternate file"
+msgstr "E23: 沒有替代的檔案"
+
+#: globals.h:1204
+msgid "E24: No such abbreviation"
+msgstr "E24: 沒有這個 abbreviation å°æ‡‰"
+
+#: globals.h:1205
+msgid "E477: No ! allowed"
+msgstr "E477: ä¸å¯ä½¿ç”¨ '!'"
+
+#: globals.h:1207
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: 因為編譯時沒有加入圖型界é¢çš„程å¼ç¢¼ï¼Œæ‰€ä»¥ç„¡æ³•ä½¿ç”¨åœ–åž‹ç•Œé¢"
+
+#: globals.h:1210
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: 因為編譯時沒有加入 Hebrew 的程å¼ç¢¼ï¼Œæ‰€ä»¥ç„¡æ³•ä½¿ç”¨ Hebrew\n"
+
+#: globals.h:1213
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: 因為編譯時沒有加入 Farsi 的程å¼ç¢¼ï¼Œæ‰€ä»¥ç„¡æ³•ä½¿ç”¨ Farsi\n"
+
+#: globals.h:1216
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: 沒有å為 '%s' çš„ highlight group"
+
+#: globals.h:1218
+msgid "E29: No inserted text yet"
+msgstr "E29: 還沒有æ’入文字éŽ"
+
+#: globals.h:1219
+msgid "E30: No previous command line"
+msgstr "E30: 沒有å‰ä¸€é …命令"
+
+#: globals.h:1220
+msgid "E31: No such mapping"
+msgstr "E31: 沒有這個 mapping å°æ‡‰"
+
+#: globals.h:1221
+msgid "E479: No match"
+msgstr "E479: 找ä¸åˆ°"
+
+#: globals.h:1222
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: 找ä¸åˆ°: %s"
+
+#: globals.h:1223
+msgid "E32: No file name"
+msgstr "E32: 沒有檔å"
+
+#: globals.h:1224
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: 沒有å‰ä¸€å€‹æœå°‹/å–代的命令"
+
+#: globals.h:1225
+msgid "E34: No previous command"
+msgstr "E34: 沒有å‰ä¸€å€‹å‘½ä»¤"
+
+#: globals.h:1226
+msgid "E35: No previous regular expression"
+msgstr "E35: 沒有å‰ä¸€å€‹æœå°‹æŒ‡ä»¤"
+
+#: globals.h:1227
+msgid "E481: No range allowed"
+msgstr "E481: ä¸å¯ä½¿ç”¨ç¯„åœæŒ‡ä»¤"
+
+#: globals.h:1229
+msgid "E36: Not enough room"
+msgstr "E36: 沒有足夠的空間"
+
+#: globals.h:1232
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: 沒有註冊為 \"%s\" 的伺æœå™¨"
+
+#: globals.h:1234
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: ä¸èƒ½å»ºç«‹æª”案 %s"
+
+#: globals.h:1235
+msgid "E483: Can't get temp file name"
+msgstr "E483: 無法得知暫存檔å"
+
+#: globals.h:1236
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: 無法開啟檔案 %s"
+
+#: globals.h:1237
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: 無法讀å–檔案 %s"
+
+#: globals.h:1238
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: 已更改éŽæª”案但尚未存檔 (å¯ç”¨ ! 強制執行)"
+
+#: globals.h:1239
+msgid "E38: Null argument"
+msgstr "E38: 空的 (Null) åƒæ•¸"
+
+#: globals.h:1241
+msgid "E39: Number expected"
+msgstr "E39: 應該è¦æœ‰æ•¸å­—"
+
+#: globals.h:1244
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: 無法開啟錯誤檔案 %s"
+
+#: globals.h:1247
+msgid "E233: cannot open display"
+msgstr "E233: <ä¸èƒ½é–‹å•Ÿ X Server DISPLAY>"
+
+#: globals.h:1249
+msgid "E41: Out of memory!"
+msgstr "E41: 記憶體ä¸è¶³!"
+
+#: globals.h:1251
+msgid "Pattern not found"
+msgstr "找ä¸åˆ°"
+
+#: globals.h:1253
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: 找ä¸åˆ° %s"
+
+#: globals.h:1254
+msgid "E487: Argument must be positive"
+msgstr "E487: åƒæ•¸æ‡‰è©²æ˜¯æ­£æ•¸"
+
+#: globals.h:1256
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: 無法回到å‰ä¸€å€‹ç›®éŒ„"
+
+#: globals.h:1260
+msgid "E42: No Errors"
+msgstr "E42: 沒有錯誤"
+
+#: globals.h:1262
+msgid "E43: Damaged match string"
+msgstr "E43: 符åˆå­—串有å•é¡Œ"
+
+#: globals.h:1263
+msgid "E44: Corrupted regexp program"
+msgstr "E44: regexp 有å•é¡Œ"
+
+#: globals.h:1264
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: 有設定 'readonly' é¸é …(唯讀) (å¯ç”¨ ! 強制執行)"
+
+#: globals.h:1266
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: 無法設定唯讀變數 \"%s\""
+
+#: globals.h:1269
+msgid "E47: Error while reading errorfile"
+msgstr "E47: 讀å–錯誤檔案失敗"
+
+#: globals.h:1272
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ä¸èƒ½åœ¨ sandbox 裡出ç¾"
+
+#: globals.h:1274
+msgid "E523: Not allowed here"
+msgstr "E523: 這裡ä¸å¯ä½¿ç”¨"
+
+#: globals.h:1277
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ä¸æ”¯æ´è¨­å®šèž¢å¹•æ¨¡å¼"
+
+#: globals.h:1279
+msgid "E49: Invalid scroll size"
+msgstr "E49: 錯誤的æ²å‹•å¤§å°"
+
+#: globals.h:1280
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'E71: é¸é … 'shell' 未設定"
+
+#: globals.h:1282
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: ç„¡æ³•è®€å– sign data!"
+
+#: globals.h:1284
+msgid "E72: Close error on swap file"
+msgstr "E72: 暫存檔關閉錯誤"
+
+#: globals.h:1285
+msgid "E73: tag stack empty"
+msgstr "E73: 標籤堆疊已空"
+
+#: globals.h:1286
+msgid "E74: Command too complex"
+msgstr "E74: 命令太複雜"
+
+#: globals.h:1287
+msgid "E75: Name too long"
+msgstr "E75: å字太長"
+
+#: globals.h:1288
+msgid "E76: Too many ["
+msgstr "E76: 太多 ["
+
+#: globals.h:1289
+msgid "E77: Too many file names"
+msgstr "E77: 太多檔å"
+
+#: globals.h:1290
+msgid "E488: Trailing characters"
+msgstr "E488: 你輸入了多餘的字元"
+
+#: globals.h:1291
+msgid "E78: Unknown mark"
+msgstr "E78: 無法辦識的標記"
+
+#: globals.h:1292
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: 無法展開è¬ç”¨å­—å…ƒ"
+
+#: globals.h:1294
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' ä¸èƒ½æ¯” 'winminheight' æ›´å°‘"
+
+#: globals.h:1296
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' ä¸èƒ½æ¯” 'winminwidth' æ›´å°‘"
+
+#: globals.h:1299
+msgid "E80: Error while writing"
+msgstr "E80: 寫入錯誤"
+
+#: globals.h:1300
+msgid "Zero count"
+msgstr "數到零 (?)"
+
+#: globals.h:1302
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ä¸èƒ½åœ¨ script 本文外使用."
+
+#: globals.h:1305
+msgid "E449: Invalid expression received"
+msgstr "E449: 收到ä¸æ­£ç¢ºçš„é‹ç®—å¼"
+
+#: globals.h:1308
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: å€åŸŸè¢«ä¿è­·ï¼Œç„¡æ³•ä¿®æ”¹"
+
+#~ msgid "function "
+#~ msgstr "å‡½å¼ "
+
+#~ msgid "Run Macro"
+#~ msgstr "執行巨集"
+
+#~ msgid "E221: 'commentstring' is empty"
+#~ msgstr "E221: é¸é … 'commentstring' 未設定"
+
+#~ msgid "E242: Color name not recognized: %s"
+#~ msgstr "E242: %s 為無法識別的é¡è‰²å稱"
+
+#~ msgid "E242: Missing color: %s"
+#~ msgstr "E242: 找ä¸åˆ°é¡è‰²: %s"
+
+#~ msgid "error reading cscope connection %d"
+#~ msgstr "è®€å– cscope 連線 %d 時錯誤"
+
+#~ msgid "E249: couldn't read VIM instance registry property"
+#~ msgstr "E249: ç„¡æ³•è®€å– VIM çš„ registry 設定項"
+
+#~ msgid "Can't open file %s"
+#~ msgstr "無法開啟檔案 %s"
+
+#~ msgid "Unable to send reply"
+#~ msgstr "無法傳é€å›žæ‡‰è¨Šæ¯"
+
+#~ msgid "E241: Unable to send to Vim server"
+#~ msgstr "E241: 無法傳é€åˆ° Vim 伺æœå™¨"
+
+#~ msgid ""
+#~ "\n"
+#~ "Send failed. No command server present ?\n"
+#~ msgstr ""
+#~ "\n"
+#~ "傳é€å¤±æ•—。沒有命令伺æœå™¨å­˜åœ¨ ?\n"
+
+#~ msgid "PC (32 bits Vim)"
+#~ msgstr "PC (32 ä½å…ƒ Vim)"
+
+#~ msgid "PC (16 bits Vim)"
+#~ msgstr "PC (16 ä½å…ƒ Vim)"
+
+#~ msgid "E362: Unsupported screen mode"
+#~ msgstr "E362: 螢幕模å¼ä¸æ”¯æ´"
+
+#~ msgid "No servers found for this display"
+#~ msgstr "æ­¤Display沒有伺æœå™¨(Servers)"
+
+#~ msgid "E258: no matches found in cscope connections"
+#~ msgstr "E258: cscope 連線找ä¸åˆ°ç¬¦åˆçš„"
+
+#~ msgid ""
+#~ "\n"
+#~ "MacOS Carbon"
+#~ msgstr ""
+#~ "\n"
+#~ "MacOS Carbon"
+
+#~ msgid ""
+#~ "\n"
+#~ "MacOS 8"
+#~ msgstr ""
+#~ "\n"
+#~ "MacOS 8"
+
+#~ msgid "Retrieve next symbol"
+#~ msgstr "讀å–: 從下個 symbol"
+
+#~ msgid "-- SNiFF+ commands --"
+#~ msgstr "-- SNiFF+ 命令 --"
+
+#~ msgid "E277: Unrecognized sniff request [%s]"
+#~ msgstr "E277: 無法辨識 sniff 命令 [%s]"
diff --git a/src/po/zh_TW.po b/src/po/zh_TW.po
new file mode 100644
index 000000000..c318e6341
--- /dev/null
+++ b/src/po/zh_TW.po
@@ -0,0 +1,6389 @@
+# Traditional Chinese Translation for Vim vim:set foldmethod=marker:
+#
+# Do ":help uganda" in Vim to read copying and usage conditions.
+# Do ":help credits" in Vim to see a list of people who contributed.
+#
+# FIRST AUTHOR Francis S.Lin <piaip@csie.ntu.edu.tw>, 2000
+# FIRST RELEASE Thu Jun 14 14:24:17 CST 2001
+#
+# Last update: Thu Apr 24 13:09:07 CST 2003 (6.2a)
+#
+# To update, search pattern: /fuzzy\|^msgstr ""\(\n"\)\@!
+#
+# DO NOT USE WORDS WITH BACKSLASH ('\') AS SECOND BYTE OF BIG5 CHARS
+# EG: '¥\', # ³\¥\»\
+# À\¬\¾\¯\½\¶\²\Æ\°\Â\¿\Á\Å\§\ª\«\
+# ¼\®\±\Ã\Ä\´\µ\·\¸\¹\º\¢\¤\¦\¨\©\­\á\ä\
+# you can replace these characters with alternative words.
+# THIS WILL CAUSE INCOMPATIBLE ON gettext 0.10.36+
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vim(Traditional Chinese)\n"
+"POT-Creation-Date: 2003-04-24 13:06+0800\n"
+"PO-Revision-Date: Mon Feb 19 22:49:21 CST 2001\n"
+"Last-Translator: Francis S.Lin <piaip@csie.ntu.edu.tw>\n"
+"Language-Team: Francis S.Lin <piaip@csie.ntu.edu.tw>, Cecil Sheng "
+"<b7506022@csie.ntu.edu.tw>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=big5\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buffer.c:97
+msgid "E82: Cannot allocate any buffer, exiting..."
+msgstr "E82: µLªk°t¸m¥ô¦ó½w½Ä°Ï¡AÂ÷¶}µ{¦¡..."
+
+#: buffer.c:100
+msgid "E83: Cannot allocate buffer, using other one..."
+msgstr "E83: µLªk°t¸m½w½Ä°Ï¡A¨Ï¥Î¥t¤@­Ó½w½Ä°Ï...."
+
+#: buffer.c:797
+msgid "E515: No buffers were unloaded"
+msgstr "E515: ¨S¦³ÄÀ©ñ¥ô¦ó½w½Ä°Ï"
+
+#: buffer.c:799
+msgid "E516: No buffers were deleted"
+msgstr "E516: ¨S¦³§R°£¥ô¦ó½w½Ä°Ï"
+
+#: buffer.c:801
+msgid "E517: No buffers were wiped out"
+msgstr "E517: ¨S¦³²M°£¥ô¦ó½w½Ä°Ï"
+
+#: buffer.c:809
+msgid "1 buffer unloaded"
+msgstr "¤wÄÀ©ñ¤@­Ó½w½Ä°Ï"
+
+#: buffer.c:811
+#, c-format
+msgid "%d buffers unloaded"
+msgstr "¤wÄÀ©ñ %d ­Ó½w½Ä°Ï"
+
+#: buffer.c:816
+msgid "1 buffer deleted"
+msgstr "¤w§R°£¤@­Ó½w½Ä°Ï"
+
+#: buffer.c:818
+#, c-format
+msgid "%d buffers deleted"
+msgstr "¤w§R°£ %d ­Ó½w½Ä°Ï"
+
+#: buffer.c:823
+msgid "1 buffer wiped out"
+msgstr "¤w§R°£¤@­Ó½w½Ä°Ï"
+
+#: buffer.c:825
+#, c-format
+msgid "%d buffers wiped out"
+msgstr "¤w§R°£ %d ­Ó½w½Ä°Ï"
+
+#: buffer.c:886
+msgid "E84: No modified buffer found"
+msgstr "E84: ¨S¦³­×§ï¹Lªº½w½Ä°Ï"
+
+#. back where we started, didn't find anything.
+#: buffer.c:925
+msgid "E85: There is no listed buffer"
+msgstr "E85: ¨S¦³¦C¥Xªº½w½Ä°Ï"
+
+#: buffer.c:937
+#, c-format
+msgid "E86: Cannot go to buffer %ld"
+msgstr "E86: µLªk¤Á´«¨ì²Ä %ld ­Ó½w½Ä°Ï"
+
+#: buffer.c:940
+msgid "E87: Cannot go beyond last buffer"
+msgstr "E87: µLªk¤Á´«¨ì§ó«á­±ªº½w½Ä°Ï"
+
+#: buffer.c:942
+msgid "E88: Cannot go before first buffer"
+msgstr "E88: µLªk¤Á´«¨ì§ó«e­±ªº½w½Ä°Ï"
+
+#: buffer.c:966
+msgid "E89: No write since last change for buffer %ld (add ! to override)"
+msgstr "E89: ¤w§ó§ï¹L½w½Ä°Ï %ld ¦ý©|¥¼¦sÀÉ (¥i¥Î ! ±j¨î°õ¦æ)"
+
+#: buffer.c:982
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: µLªkÄÀ©ñ³Ì«á¤@­Ó½w½Ä°Ï"
+
+#: buffer.c:1494
+msgid "W14: Warning: List of file names overflow"
+msgstr "W14: ĵ§i: ÀɦW¹L¦h"
+
+#: buffer.c:1664
+#, c-format
+msgid "E92: Buffer %ld not found"
+msgstr "E92: §ä¤£¨ì²Ä %ld ­Ó½w½Ä°Ï"
+
+#: buffer.c:1890
+#, c-format
+msgid "E93: More than one match for %s"
+msgstr "E93: §ä¨ì¤@­Ó¥H¤Wªº %s"
+
+#: buffer.c:1892
+#, c-format
+msgid "E94: No matching buffer for %s"
+msgstr "E94: §ä¤£¨ì %s"
+
+#: buffer.c:2297 ex_docmd.c:6479
+#, c-format
+msgid "line %ld"
+msgstr "¦æ %ld"
+
+#: buffer.c:2380
+msgid "E95: Buffer with this name already exists"
+msgstr "E95: ¤w¦³½w½Ä°Ï¨Ï¥Î³o­Ó¦W¦r"
+
+#: buffer.c:2673
+msgid " [Modified]"
+msgstr " [¤w­×§ï]"
+
+#: buffer.c:2678
+msgid "[Not edited]"
+msgstr "[¥¼½s¿è]"
+
+#: buffer.c:2683
+msgid "[New file]"
+msgstr "[·sÀÉ®×]"
+
+#: buffer.c:2684
+msgid "[Read errors]"
+msgstr "[Ū¨ú¿ù»~]"
+
+#: buffer.c:2686 fileio.c:1914
+msgid "[readonly]"
+msgstr "[°ßŪ]"
+
+#: buffer.c:2701
+#, c-format
+msgid "1 line --%d%%--"
+msgstr "¦æ¼Æ 1 --%d%%--"
+
+#: buffer.c:2703
+#, c-format
+msgid "%ld lines --%d%%--"
+msgstr "¦æ¼Æ %ld --%d%%--"
+
+#: buffer.c:2710
+#, c-format
+msgid "line %ld of %ld --%d%%-- col "
+msgstr "¦æ %ld/%ld --%d%%-- Äæ "
+
+#: buffer.c:2811
+msgid "[No file]"
+msgstr "[¥¼©R¦W]"
+
+#. must be a help buffer
+#: buffer.c:2851
+msgid "help"
+msgstr "[»²§U»¡©ú]"
+
+#: buffer.c:3405 screen.c:4943
+msgid "[help]"
+msgstr "[»²§U»¡©ú]"
+
+#: buffer.c:3437 screen.c:4949
+msgid "[Preview]"
+msgstr "[¹wÄý]"
+
+#: buffer.c:3708
+msgid "All"
+msgstr "¥þ³¡"
+
+#: buffer.c:3708
+msgid "Bot"
+msgstr "©³ºÝ"
+
+#: buffer.c:3710
+msgid "Top"
+msgstr "³»ºÝ"
+
+#: buffer.c:4454
+msgid ""
+"\n"
+"# Buffer list:\n"
+msgstr ""
+"\n"
+"# ½w½Ä°Ï¦Cªí:\n"
+
+#: buffer.c:4487
+msgid "[Error List]"
+msgstr "[¿ù»~¦Cªí]"
+
+#: buffer.c:4500 memline.c:1501
+msgid "[No File]"
+msgstr "[¥¼©R¦W]"
+
+#: buffer.c:4803
+msgid ""
+"\n"
+"--- Signs ---"
+msgstr ""
+"\n"
+"--- ²Å¸¹ ---"
+
+#: buffer.c:4813
+#, c-format
+msgid "Signs for %s:"
+msgstr "%s ªº²Å¸¹:"
+
+#: buffer.c:4819
+#, c-format
+msgid " line=%ld id=%d name=%s"
+msgstr " ¦æ=%ld id=%d ¦WºÙ=%s"
+
+#: diff.c:133
+#, c-format
+msgid "E96: Can not diff more than %ld buffers"
+msgstr "E96: µLªk¤ñ¸û(diff) %ld­Ó¥H¤Wªº½w½Ä°Ï"
+
+#: diff.c:651
+msgid "E97: Cannot create diffs"
+msgstr "E97: ¤£¯à«Ø¥ß "
+
+#: diff.c:750
+msgid "Patch file"
+msgstr "Patch ÀÉ®×"
+
+#: diff.c:1001
+msgid "E98: Cannot read diff output"
+msgstr "E98: µLªkŪ¨ú diff ªº¿é¥X"
+
+#: diff.c:1742
+msgid "E99: Current buffer is not in diff mode"
+msgstr "E99: ¥Ø«eªº½w½Ä°Ï¤£¬O¦b diff ¼Ò¦¡"
+
+#: diff.c:1754
+msgid "E100: No other buffer in diff mode"
+msgstr "E100: ¨S¦³½w½Ä°Ï¦b diff ¼Ò¦¡"
+
+#: diff.c:1762
+msgid "E101: More than two buffers in diff mode, don't know which one to use"
+msgstr "E101: ¦³¨â­Ó¥H¤Wªº½w½Ä°Ï¦b diff ¼Ò¦¡¡AµLªk¨M©w­n¥Î­þ¤@­Ó"
+
+#: diff.c:1785
+#, c-format
+msgid "E102: Can't find buffer \"%s\""
+msgstr "E102: §ä¤£¨ì½w½Ä°Ï: \"%s\""
+
+#: diff.c:1791
+#, c-format
+msgid "E103: Buffer \"%s\" is not in diff mode"
+msgstr "E103: ½w½Ä°Ï \"%s\" ¤£¬O¦b diff ¼Ò¦¡"
+
+#: digraph.c:2172
+msgid "E104: Escape not allowed in digraph"
+msgstr "E104: ½Æ¦X¦r¤¸(digraph)¤¤¤£¯à¨Ï¥Î Escape"
+
+#: digraph.c:2344
+msgid "E544: Keymap file not found"
+msgstr "E544: §ä¤£¨ì keymap ÀÉ"
+
+#: digraph.c:2371
+msgid "E105: Using :loadkeymap not in a sourced file"
+msgstr "E105: ¨Ï¥Î :loadkeymap "
+
+#: edit.c:40
+msgid " Keyword completion (^N/^P)"
+msgstr " ÃöÁä¦r¦Û°Ê§¹¦¨ (^N/^P)"
+
+#. ctrl_x_mode == 0, ^P/^N compl.
+#: edit.c:41
+msgid " ^X mode (^E/^Y/^L/^]/^F/^I/^K/^D/^V/^N/^P)"
+msgstr " ^X ¼Ò¦¡ (^E/^Y/^L/^]/^F/^I/^K/^D/^N/^P)"
+
+#. Scroll has it's own msgs, in it's place there is the msg for local
+#. * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo
+#: edit.c:44
+msgid " Keyword Local completion (^N/^P)"
+msgstr " °Ï°ìÃöÁä¦r¦Û°Ê§¹¦¨ (^N/^P)"
+
+#: edit.c:45
+msgid " Whole line completion (^L/^N/^P)"
+msgstr " ¾ã¦æ¦Û°Ê§¹¦¨ (^L/^N/^P)"
+
+#: edit.c:46
+msgid " File name completion (^F/^N/^P)"
+msgstr " ÀɦW¦Û°Ê§¹¦¨ (^F/^N/^P)"
+
+#: edit.c:47
+msgid " Tag completion (^]/^N/^P)"
+msgstr " ¼ÐÅҦ۰ʧ¹¦¨ (^]/^N/^P)"
+
+#: edit.c:48
+msgid " Path pattern completion (^N/^P)"
+msgstr " ¸ô®|¦Û°Ê§¹¦¨ (^N/^P)"
+
+#: edit.c:49
+msgid " Definition completion (^D/^N/^P)"
+msgstr " ©w¸q¦Û°Ê§¹¦¨ (^D/^N/^P)"
+
+#: edit.c:51
+msgid " Dictionary completion (^K/^N/^P)"
+msgstr " ¦r¨å¦Û°Ê§¹¦¨ (^K/^N/^P)"
+
+#: edit.c:52
+msgid " Thesaurus completion (^T/^N/^P)"
+msgstr " Thesaurus ¦Û°Ê§¹¦¨ (^T/^N/^P)"
+
+#: edit.c:53
+msgid " Command-line completion (^V/^N/^P)"
+msgstr " ©R¥O¦C¦Û°Ê§¹¦¨ (^V/^N/^P)"
+
+#: edit.c:56
+msgid "Hit end of paragraph"
+msgstr "¤w¨ì¬q¸¨µ²§À"
+
+#: edit.c:941
+msgid "'thesaurus' option is empty"
+msgstr "¿ï¶µ 'thesaurus' ¥¼³]©w"
+
+#: edit.c:1145
+msgid "'dictionary' option is empty"
+msgstr "¿ï¶µ 'dictionary' ¥¼³]©w"
+
+#: edit.c:2130
+#, c-format
+msgid "Scanning dictionary: %s"
+msgstr "±½ºË¦r¨å: %s"
+
+#: edit.c:2336
+msgid " (insert) Scroll (^E/^Y)"
+msgstr " (´¡¤J) Scroll (^E/^Y)"
+
+#: edit.c:2338
+msgid " (replace) Scroll (^E/^Y)"
+msgstr " (¨ú¥N) Scroll (^E/^Y)"
+
+#: edit.c:2652
+#, c-format
+msgid "Scanning: %s"
+msgstr "±½ºË¤¤: %s"
+
+#: edit.c:2687
+msgid "Scanning tags."
+msgstr "±½ºË¼ÐÅÒ."
+
+#: edit.c:3349
+msgid " Adding"
+msgstr " ¼W¥["
+
+#. showmode might reset the internal line pointers, so it must
+#. * be called before line = ml_get(), or when this address is no
+#. * longer needed. -- Acevedo.
+#.
+#: edit.c:3398
+msgid "-- Searching..."
+msgstr "-- ·j´M¤¤..."
+
+#: edit.c:3454
+msgid "Back at original"
+msgstr "¦^¨ì°_ÂI"
+
+#: edit.c:3459
+msgid "Word from other line"
+msgstr "±q§O¦æ¶}©lªº¦r (?)"
+
+#: edit.c:3464
+msgid "The only match"
+msgstr "¥u¦³¦¹¶µ²Å¦X"
+
+#: edit.c:3523
+#, c-format
+msgid "match %d of %d"
+msgstr "§ä¨ì %d / %d"
+
+#: edit.c:3526
+#, c-format
+msgid "match %d"
+msgstr "²Å¦X %d"
+
+#. Skip further arguments but do continue to
+#. * search for a trailing command.
+#: eval.c:889
+#, c-format
+msgid "E106: Unknown variable: \"%s\""
+msgstr "E106: ¥¼©w¸qªºÅܼÆ: \"%s\""
+
+#: eval.c:1185
+#, c-format
+msgid "E107: Missing braces: %s"
+msgstr "E107: ¯Ê¤Ö¹ïÀ³ªº¬A¸¹: %s"
+
+#: eval.c:1290 eval.c:1304
+#, c-format
+msgid "E108: No such variable: \"%s\""
+msgstr "E108: µL¦¹ÅܼÆ: \"%s\""
+
+#: eval.c:1560
+msgid "E109: Missing ':' after '?'"
+msgstr "E109: '?' «á¯Ê¤Ö ':'"
+
+#: eval.c:2176
+msgid "E110: Missing ')'"
+msgstr "E110: ¯Ê¤Ö¹ïÀ³ªº \")\""
+
+#: eval.c:2233
+msgid "E111: Missing ']'"
+msgstr "E111: ¯Ê¤Ö¹ïÀ³ªº \"]\""
+
+#: eval.c:2309
+#, c-format
+msgid "E112: Option name missing: %s"
+msgstr "E112: ¯Ê¤Ö¿ï¶µ¦WºÙ: %s"
+
+#: eval.c:2327
+#, c-format
+msgid "E113: Unknown option: %s"
+msgstr "E113: ¤£¥¿½Tªº¿ï¶µ: %s"
+
+#: eval.c:2391
+#, c-format
+msgid "E114: Missing quote: %s"
+msgstr "E114: ¯Ê¤Ö¤Þ¸¹: %s"
+
+#: eval.c:2523
+#, c-format
+msgid "E115: Missing quote: %s"
+msgstr "E115: ¯Ê¤Ö¤Þ¸¹: %s"
+
+#: eval.c:2843
+#, c-format
+msgid "E116: Invalid arguments for function %s"
+msgstr "E116: ¨ç¦¡ %s ªº¤Þ¼Æ¤£¥¿½T"
+
+#: eval.c:2844
+#, c-format
+msgid "E117: Unknown function: %s"
+msgstr "E117: ¥¼©w¸qªº¨ç¦¡: %s"
+
+#: eval.c:2845
+#, c-format
+msgid "E118: Too many arguments for function: %s"
+msgstr "E118: ¨ç¦¡ %s ªº¤Þ¼Æ¹L¦h"
+
+#: eval.c:2846
+#, c-format
+msgid "E119: Not enough arguments for function: %s"
+msgstr "E119: ¨ç¦¡ %s ªº¤Þ¼Æ¤Ó¤Ö"
+
+#: eval.c:2847
+#, c-format
+msgid "E120: Using <SID> not in a script context: %s"
+msgstr "E120: <SID> ¤£¯à¦b script ¥»¤å¥~¨Ï¥Î: %s"
+
+#.
+#. * Yes this is ugly, I don't particularly like it either. But doing it
+#. * this way has the compelling advantage that translations need not to
+#. * be touched at all. See below what 'ok' and 'ync' are used for.
+#.
+#: eval.c:3465 gui.c:4238 gui_gtk.c:1991
+msgid "&Ok"
+msgstr "½T©w(&O)"
+
+#: eval.c:4000
+#, c-format
+msgid "+-%s%3ld lines: "
+msgstr "+-%s%3ld ¦æ: "
+
+#: eval.c:5149
+msgid ""
+"&OK\n"
+"&Cancel"
+msgstr ""
+"½T©w(&O)\n"
+"¨ú®ø(&C)"
+
+#: eval.c:5182
+msgid "called inputrestore() more often than inputsave()"
+msgstr "©I¥s inputrestore() ªº¦¸¼Æ¤ñ inputsave() ÁÙ¦h"
+
+#: eval.c:6036
+msgid "E240: No connection to Vim server"
+msgstr "E240: ¨S¦³»P Vim Server «Ø¥ß³s½u"
+
+#: eval.c:6133
+msgid "E277: Unable to read a server reply"
+msgstr "E277: µLªkŪ¨ú¦øªA¾¹ªº¦^À³"
+
+#: eval.c:6161
+msgid "E258: Unable to send to client"
+msgstr "E258: µLªk¶Ç°e¨ì client"
+
+#: eval.c:6209
+#, c-format
+msgid "E241: Unable to send to %s"
+msgstr "E241: µLªk¶Ç°e¨ì %s"
+
+#: eval.c:6309
+msgid "(Invalid)"
+msgstr "(¤£¥¿½T)"
+
+#: eval.c:7402
+#, c-format
+msgid "E121: Undefined variable: %s"
+msgstr "E121: ÅÜ¼Æ %s ©|¥¼©w¸q"
+
+#: eval.c:7834
+#, c-format
+msgid "E461: Illegal variable name: %s"
+msgstr "E461: ¤£¦XªkªºÅܼƦWºÙ: %s"
+
+#: eval.c:8121
+#, c-format
+msgid "E122: Function %s already exists, add ! to replace it"
+msgstr "E122: ¨ç¦¡ %s ¤w¸g¦s¦b, ½Ð¨Ï¥Î ! ±j¨î¨ú¥N"
+
+#: eval.c:8188
+#, c-format
+msgid "E123: Undefined function: %s"
+msgstr "E123: ¨ç¦¡ %s ©|¥¼©w¸q"
+
+#: eval.c:8201
+#, c-format
+msgid "E124: Missing '(': %s"
+msgstr "E124: ¯Ê¤Ö \"(\": %s"
+
+#: eval.c:8234
+#, c-format
+msgid "E125: Illegal argument: %s"
+msgstr "E125: °Ñ¼Æ¤£¥¿½T: %s"
+
+#: eval.c:8313
+msgid "E126: Missing :endfunction"
+msgstr "E126: ¯Ê¤Ö :endfunction"
+
+#: eval.c:8396
+#, c-format
+msgid "E127: Cannot redefine function %s: It is in use"
+msgstr "E127: ¨ç¦¡ %s ¥¿¦b¨Ï¥Î¤¤¡AµLªk­«·s©w¸q"
+
+#: eval.c:8464
+msgid "E129: Function name required"
+msgstr "E129: »Ý­n¨ç¦¡¦WºÙ"
+
+#: eval.c:8515
+#, c-format
+msgid "E128: Function name must start with a capital: %s"
+msgstr "E128: ¨ç¦¡¦WºÙ²Ä¤@­Ó¦r¥À¥²¶·¤j¼g: %s"
+
+#: eval.c:8707
+#, c-format
+msgid "E130: Undefined function: %s"
+msgstr "E130: ¨ç¦¡ %s ©|¥¼©w¸q"
+
+#: eval.c:8712
+#, c-format
+msgid "E131: Cannot delete function %s: It is in use"
+msgstr "E131: ¨ç¦¡ %s ¥¿¦b¨Ï¥Î¤¤¡AµLªk§R°£"
+
+#: eval.c:8760
+msgid "E132: Function call depth is higher than 'maxfuncdepth'"
+msgstr "E132: ¨ç¦¡»¼°j©I¥s¼h¼Æ¶W¹L 'maxfuncdepth'"
+
+#. always scroll up, don't overwrite
+#: eval.c:8813
+#, c-format
+msgid "calling %s"
+msgstr "©I¥s %s"
+
+#: eval.c:8867
+#, c-format
+msgid "%s aborted"
+msgstr "%s ³Q±j¨î¤¤Â_°õ¦æ"
+
+#: eval.c:8869
+#, c-format
+msgid "%s returning #%ld"
+msgstr "%s ¶Ç¦^­È #%ld "
+
+#: eval.c:8872
+#, c-format
+msgid "%s returning \"%s\""
+msgstr "%s ¶Ç¦^­È \"%s\""
+
+#. always scroll up, don't overwrite
+#: eval.c:8888 ex_cmds2.c:2231
+#, c-format
+msgid "continuing in %s"
+msgstr "Ä~Äò: %s"
+
+#: eval.c:8935
+msgid "E133: :return not inside a function"
+msgstr "E133: :return ¥²¶·¦b¨ç¦¡¸Ì¨Ï¥Î"
+
+#: eval.c:9266
+msgid ""
+"\n"
+"# global variables:\n"
+msgstr ""
+"\n"
+"# ¥þ°ìÅܼÆ:\n"
+
+#: ex_cmds.c:92
+#, c-format
+msgid "<%s>%s%s %d, Hex %02x, Octal %03o"
+msgstr "<%s>%s%s %d, ¤Q¤»¶i¦ì %02x, ¤K¶i¦ì %03o"
+
+#: ex_cmds.c:433
+msgid "E134: Move lines into themselves"
+msgstr "E134: µLªk§â¦æ²¾¨ì¥¦¦Û¤w¤º"
+
+#: ex_cmds.c:502
+msgid "1 line moved"
+msgstr "¤w·h²¾ 1 ¦æ"
+
+#: ex_cmds.c:504
+#, c-format
+msgid "%ld lines moved"
+msgstr "¤w·h²¾ %ld ¦æ"
+
+#: ex_cmds.c:909
+#, c-format
+msgid "%ld lines filtered"
+msgstr "¤w³B²z %ld ¦æ"
+
+#: ex_cmds.c:937
+msgid "E135: *Filter* Autocommands must not change current buffer"
+msgstr "E135: *Filter* Autocommand ¤£¥i¥H§ó§ï½w½Ä°Ïªº¤º®e"
+
+#: ex_cmds.c:1022
+msgid "[No write since last change]\n"
+msgstr "[§ó·s«á©|¥¼Àx¦s]\n"
+
+#: ex_cmds.c:1268
+#, c-format
+msgid "%sviminfo: %s in line: "
+msgstr "%sviminfo: %s ¦b¦æ¤¤: "
+
+#: ex_cmds.c:1273
+msgid "E136: viminfo: Too many errors, skipping rest of file"
+msgstr "E136: viminfo: ¹L¦h¿ù»~, ©¿²¤Àɮרä¾l³¡¤À"
+
+#: ex_cmds.c:1302
+#, c-format
+msgid "Reading viminfo file \"%s\"%s%s%s"
+msgstr "Ū¨ú viminfo ÀÉ®× \"%s\"%s%s%s"
+
+#: ex_cmds.c:1303
+msgid " info"
+msgstr " °T®§"
+
+#: ex_cmds.c:1304
+msgid " marks"
+msgstr " ¼Ð°O"
+
+#: ex_cmds.c:1305
+msgid " FAILED"
+msgstr " ¥¢±Ñ"
+
+#: ex_cmds.c:1396
+#, c-format
+msgid "E137: Viminfo file is not writable: %s"
+msgstr "E137: Viminfo ÀÉ®×µLªk¼g¤J: %s"
+
+#: ex_cmds.c:1521
+#, c-format
+msgid "E138: Can't write viminfo file %s!"
+msgstr "E138: µLªk¼g¤J viminfo ÀÉ®× %s !"
+
+#: ex_cmds.c:1529
+#, c-format
+msgid "Writing viminfo file \"%s\""
+msgstr "¼g¤J viminfo ÀÉ®× \"%s\" ¤¤"
+
+#. Write the info:
+#: ex_cmds.c:1627
+#, c-format
+msgid "# This viminfo file was generated by Vim %s.\n"
+msgstr "# ¥» viminfo Àɮ׬O¥Ñ Vim %s ©Ò²£¥Í.\n"
+
+#: ex_cmds.c:1629
+msgid ""
+"# You may edit it if you're careful!\n"
+"\n"
+msgstr ""
+"# ¦pªG·Q­n¦Û¦æ­×§ï½Ð¯S§O¤p¤ß¡I\n"
+"\n"
+
+#: ex_cmds.c:1631
+msgid "# Value of 'encoding' when this file was written\n"
+msgstr "# 'encoding' ¦b¦¹Àɫإ߮ɪº­È\n"
+
+#: ex_cmds.c:1730
+msgid "Illegal starting char"
+msgstr "µL®Äªº°_©l¦r¤¸"
+
+#: ex_cmds.c:2075 ex_cmds.c:2340 ex_cmds2.c:744
+msgid "Save As"
+msgstr "¥t¦s·sÀÉ"
+
+#. Overwriting a file that is loaded in another buffer is not a
+#. * good idea.
+#: ex_cmds.c:2118
+msgid "E139: File is loaded in another buffer"
+msgstr "E139: ±z¦b¥t¤@­Ó½w½Ä°Ï¤]¸ü¤J¤F³o­ÓÀÉ®×"
+
+#: ex_cmds.c:2152
+msgid "Write partial file?"
+msgstr "­n¼g¤J³¡¤ÀÀɮ׶ܡH"
+
+#: ex_cmds.c:2159
+msgid "E140: Use ! to write partial buffer"
+msgstr "E140: ½Ð¨Ï¥Î ! ¥H¼g¤J³¡¤À½w½Ä°Ï"
+
+#: ex_cmds.c:2274
+#, c-format
+msgid "Overwrite existing file \"%.*s\"?"
+msgstr "­nÂмg¤w¦s¦bªºÀÉ®× \"%.*s\"¡H"
+
+#: ex_cmds.c:2345
+#, c-format
+msgid "E141: No file name for buffer %ld"
+msgstr "E141: ½w½Ä°Ï %ld ¨S¦³ÀɮצWºÙ"
+
+#: ex_cmds.c:2383
+msgid "E142: File not written: Writing is disabled by 'write' option"
+msgstr "E142: ÀÉ®×¥¼¼g¤J¡A¦]¬° 'write' ¿ï¶µ³QÃö³¬"
+
+#: ex_cmds.c:2403
+#, c-format
+msgid ""
+"'readonly' option is set for \"%.*s\".\n"
+"Do you wish to write anyway?"
+msgstr ""
+"\"%.*s\" ¤w³]©w 'readonly' ¿ï¶µ.\n"
+"½T©w­nÂмg¶Ü¡H"
+
+#: ex_cmds.c:2568
+msgid "Edit File"
+msgstr "½s¿èÀÉ®×"
+
+#: ex_cmds.c:3137
+#, c-format
+msgid "E143: Autocommands unexpectedly deleted new buffer %s"
+msgstr "E143: Autocommands ·N¥~¦a§R°£·s½w½Ä°Ï %s"
+
+#: ex_cmds.c:3269
+msgid "E144: non-numeric argument to :z"
+msgstr "E144: :z ¤£±µ¨ü«D¼Æ¦rªº°Ñ¼Æ"
+
+#: ex_cmds.c:3354
+msgid "E145: Shell commands not allowed in rvim"
+msgstr "E145: rvim ¤¤¸T¤î¨Ï¥Î shell ©R¥O"
+
+#: ex_cmds.c:3461
+msgid "E146: Regular expressions can't be delimited by letters"
+msgstr "E146: Regular expression µLªk¥Î¦r¥À¤À¹j (?)"
+
+#: ex_cmds.c:3807
+#, c-format
+msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
+msgstr "¨ú¥N¬° %s (y/n/a/q/^E/^Y)?"
+
+#: ex_cmds.c:4172
+msgid "(Interrupted) "
+msgstr "(¤w¤¤Â_) "
+
+#: ex_cmds.c:4176
+msgid "1 substitution"
+msgstr "¨ú¥N¤@²Õ"
+
+#: ex_cmds.c:4178
+#, c-format
+msgid "%ld substitutions"
+msgstr "¨ú¥N %ld ²Õ"
+
+#: ex_cmds.c:4181
+msgid " on 1 line"
+msgstr " ¤@¦æ¤¤"
+
+#: ex_cmds.c:4183
+#, c-format
+msgid " on %ld lines"
+msgstr " %ld ¦æ¤¤"
+
+#: ex_cmds.c:4234
+msgid "E147: Cannot do :global recursive"
+msgstr "E147: :global µLªk»¼°j°õ¦æ"
+
+#: ex_cmds.c:4269
+msgid "E148: Regular expression missing from global"
+msgstr "E148: ¨S¦³¨Ï¥Î¹L Regular expression (?)"
+
+#: ex_cmds.c:4318
+#, c-format
+msgid "Pattern found in every line: %s"
+msgstr "¨C¤@¦æ³£§ä¤£¨ì: %s"
+
+#: ex_cmds.c:4399
+msgid ""
+"\n"
+"# Last Substitute String:\n"
+"$"
+msgstr ""
+"\n"
+"# «e¤@²Õ´À¥N¦r¦ê:\n"
+"$"
+
+#: ex_cmds.c:4503
+#, c-format
+msgid "E149: Sorry, no help for %s"
+msgstr "E149: ©êºp, ¨S¦³ %s ªº»¡©ú"
+
+#: ex_cmds.c:4537
+#, c-format
+msgid "Sorry, help file \"%s\" not found"
+msgstr "©êºp, §ä¤£¨ì»¡©úÀÉ \"%s\""
+
+#: ex_cmds.c:5012
+#, c-format
+msgid "E150: Not a directory: %s"
+msgstr "E150: %s ¤£¬O¥Ø¿ý"
+
+#: ex_cmds.c:5040
+#, c-format
+msgid "E152: Cannot open %s for writing"
+msgstr "E152: µLªk¥H¼g¤J¼Ò¦¡¶}±Ò \"%s\""
+
+#: ex_cmds.c:5075
+#, c-format
+msgid "E153: Unable to open %s for reading"
+msgstr "E153: µLªkŪ¨úÀÉ®×: %s"
+
+#: ex_cmds.c:5154
+#, c-format
+msgid "E154: Duplicate tag \"%s\" in file %s"
+msgstr "E154: ¼ÐÅÒ(tag) \"%s\" ¦bÀÉ®× %s ¸Ì­«½Æ¥X²{¦h¦¸"
+
+#: ex_cmds.c:5261
+#, c-format
+msgid "E160: Unknown sign command: %s"
+msgstr "E160: ¥¼©w¸qªº sign command: %s"
+
+#: ex_cmds.c:5281
+msgid "E156: Missing sign name"
+msgstr "E156: ¯Ê¤Ö sign ¦WºÙ"
+
+#: ex_cmds.c:5327
+msgid "E612: Too many signs defined"
+msgstr "E612: ¤w©w¸q¤Ó¦h signs"
+
+#: ex_cmds.c:5394
+#, c-format
+msgid "E239: Invalid sign text: %s"
+msgstr "E239: ¤£¥¿½Tªº sign ¤å¦r: %s"
+
+#: ex_cmds.c:5425 ex_cmds.c:5611
+#, c-format
+msgid "E155: Unknown sign: %s"
+msgstr "E155: ¤£¥¿½Tªº sign: %s"
+
+#: ex_cmds.c:5471
+msgid "E159: Missing sign number"
+msgstr "E159: ¯Ê¤Ö sign number"
+
+#: ex_cmds.c:5551
+#, c-format
+msgid "E158: Invalid buffer name: %s"
+msgstr "E158: ½w½Ä°Ï¦WºÙ¿ù»~: %s"
+
+#: ex_cmds.c:5590
+#, c-format
+msgid "E157: Invalid sign ID: %ld"
+msgstr "E157: Sign ID ¿ù»~: %ld"
+
+#: ex_cmds.c:5761
+msgid "[Deleted]"
+msgstr "[¤w§R°£]"
+
+#: ex_cmds2.c:82
+msgid "Entering Debug mode. Type \"cont\" to continue."
+msgstr "¶i¤J°£¿ù¼Ò¦¡. ¿é¤J \"cont\" ¥H¦^¨ì¥¿±`¼Ò¦¡."
+
+#: ex_cmds2.c:86 ex_docmd.c:850
+#, c-format
+msgid "line %ld: %s"
+msgstr "¦æ %ld: %s"
+
+#: ex_cmds2.c:88
+#, c-format
+msgid "cmd: %s"
+msgstr "cmd: %s"
+
+#: ex_cmds2.c:271
+#, c-format
+msgid "Breakpoint in \"%s%s\" line %ld"
+msgstr "\"%s%s\" ¤¤Â_ÂI: ²Ä %ld ¦æ"
+
+#: ex_cmds2.c:521
+#, c-format
+msgid "E161: Breakpoint not found: %s"
+msgstr "E161: §ä¤£¨ì¤¤Â_ÂI: %s"
+
+#: ex_cmds2.c:547
+msgid "No breakpoints defined"
+msgstr "¨S¦³©w¸q¤¤Â_ÂI"
+
+#: ex_cmds2.c:552
+#, c-format
+msgid "%3d %s %s line %ld"
+msgstr "%3d %s %s ²Ä %ld ¦æ"
+
+#: ex_cmds2.c:767
+#, c-format
+msgid "Save changes to \"%.*s\"?"
+msgstr "±NÅܰʦsÀx¦Ü \"%.*s\"?"
+
+#: ex_cmds2.c:769 ex_docmd.c:8820
+msgid "Untitled"
+msgstr "¥¼©R¦W"
+
+#: ex_cmds2.c:905
+#, c-format
+msgid "E162: No write since last change for buffer \"%s\""
+msgstr "E162: ¤w§ó§ï¹L½w½Ä°Ï \"%s\" ¦ý©|¥¼¦sÀÉ (¥i¥Î ! ±j¨î°õ¦æ)"
+
+#: ex_cmds2.c:974
+msgid "Warning: Entered other buffer unexpectedly (check autocommands)"
+msgstr "ª`·N: ¤w¤Á´«¨ì¨ä¥¦½w½Ä°Ï (½ÐÀˬd Autocommands ¦³µL¿ù»~)"
+
+#: ex_cmds2.c:1377
+msgid "E163: There is only one file to edit"
+msgstr "E163: ¥u¦³¤@­ÓÀÉ®×¥i½s¿è"
+
+#: ex_cmds2.c:1379
+msgid "E164: Cannot go before first file"
+msgstr "E164: ¤w¸g¦b²Ä¤@­ÓÀɮפF"
+
+#: ex_cmds2.c:1381
+msgid "E165: Cannot go beyond last file"
+msgstr "E165: ¤w¸g¦b³Ì«á¤@­ÓÀɮפF"
+
+#: ex_cmds2.c:1828
+#, c-format
+msgid "Searching for \"%s\" in \"%s\""
+msgstr "·j´M¤¤: \"%s\" -- \"%s\""
+
+#: ex_cmds2.c:1850
+#, c-format
+msgid "Searching for \"%s\""
+msgstr "·j´M¤¤: \"%s\""
+
+#: ex_cmds2.c:1871
+#, c-format
+msgid "not found in 'runtimepath': \"%s\""
+msgstr "¦b 'runtimepath' ¸Ì§ä¤£¨ì \"%s\""
+
+#: ex_cmds2.c:1905
+msgid "Source Vim script"
+msgstr "°õ¦æ Vim script"
+
+#: ex_cmds2.c:2056
+#, c-format
+msgid "Cannot source a directory: \"%s\""
+msgstr "µLªk°õ¦æ¥Ø¿ý¡G \"%s\""
+
+#: ex_cmds2.c:2086
+#, c-format
+msgid "could not source \"%s\""
+msgstr "µLªk°õ¦æ \"%s\""
+
+#: ex_cmds2.c:2088
+#, c-format
+msgid "line %ld: could not source \"%s\""
+msgstr "²Ä %ld ¦æ: µLªk°õ¦æ \"%s\""
+
+#: ex_cmds2.c:2102
+#, c-format
+msgid "sourcing \"%s\""
+msgstr "°õ¦æ \"%s\" ¤¤"
+
+#: ex_cmds2.c:2104
+#, c-format
+msgid "line %ld: sourcing \"%s\""
+msgstr "²Ä %ld ¦æ: µ²§ô°õ¦æ %s"
+
+#: ex_cmds2.c:2229
+#, c-format
+msgid "finished sourcing %s"
+msgstr "µ²§ô°õ¦æ %s"
+
+#: ex_cmds2.c:2528
+msgid "W15: Warning: Wrong line separator, ^M may be missing"
+msgstr "W15: ª`·N: ¿ù»~ªº¦æ¤À¹j¦r¤¸¡A¥i¯à¬O¤Ö¤F ^M"
+
+#: ex_cmds2.c:2577
+msgid "E167: :scriptencoding used outside of a sourced file"
+msgstr "E167: ¦b°õ¦æ script ÀÉ®×¥~¤£¥i¨Ï¥Î :scriptencoding"
+
+#: ex_cmds2.c:2610
+msgid "E168: :finish used outside of a sourced file"
+msgstr "E168: ¦b°õ¦æ script ÀÉ®×¥~¤£¥i¨Ï¥Î :finish"
+
+#: ex_cmds2.c:3004
+#, c-format
+msgid "Page %d"
+msgstr "²Ä %d ­¶"
+
+#: ex_cmds2.c:3116
+msgid "No text to be printed"
+msgstr "¨S¦³­n¦C¦Lªº¤å¦r"
+
+#: ex_cmds2.c:3194
+#, c-format
+msgid "Printing page %d (%d%%)"
+msgstr "¦C¦L¤¤: ²Ä %d ­¶ (%d%%)"
+
+#: ex_cmds2.c:3203
+#, c-format
+msgid " Copy %d of %d"
+msgstr "½Æ»s %d / %d"
+
+#: ex_cmds2.c:3255
+#, c-format
+msgid "Printed: %s"
+msgstr "¤w¦C¦L: %s"
+
+#: ex_cmds2.c:3262
+msgid "Printing aborted"
+msgstr "¤w¨ú®ø¦C¦L"
+
+#: ex_cmds2.c:3645
+msgid "E455: Error writing to PostScript output file"
+msgstr "E455: µLªk¼g¤J PostScript ¿é¥XÀÉ"
+
+#: ex_cmds2.c:4320
+msgid "E324: Can't open PostScript output file"
+msgstr "E324: µLªk¶}±Ò PostScript ¿é¥XÀÉ"
+
+#: ex_cmds2.c:4362
+#, c-format
+msgid "E456: Can't open file \"%s\""
+msgstr "E456: µLªk¶}±ÒÀÉ®× \"%s\""
+
+#: ex_cmds2.c:4373
+#, c-format
+msgid "E457: Can't read PostScript resource file \"%s\""
+msgstr "E457: µLªkŪ¨ú PostScript resource ÀÉ \"%s\""
+
+#: ex_cmds2.c:4576
+msgid "Sending to printer..."
+msgstr "¶Ç°e¸ê®Æ¨ì¦Lªí¾÷..."
+
+#: ex_cmds2.c:4580
+msgid "E365: Failed to print PostScript file"
+msgstr "E365: µLªk¦C¦L PostScript ÀÉ®×"
+
+#: ex_cmds2.c:4582
+msgid "Print job sent."
+msgstr "¤w°e¥X¦C¦L¤u§@¡C"
+
+#: ex_cmds2.c:4978
+#, c-format
+msgid "Current %slanguage: \"%s\""
+msgstr "¥Ø«eªº %s»y¨¥: \"%s\""
+
+#: ex_cmds2.c:4989
+#, c-format
+msgid "E197: Cannot set language to \"%s\""
+msgstr "E197: ¤£¯à³]©w»y¨¥¦¨ \"%s\""
+
+#: ex_docmd.c:486
+msgid "Entering Ex mode. Type \"visual\" to go to Normal mode."
+msgstr "¶i¤J Ex ¼Ò¦¡. ¿é¤J \"visua\" ¥H¦^¨ì¥¿±`¼Ò¦¡."
+
+#. must be at EOF
+#: ex_docmd.c:522
+msgid "E501: At end-of-file"
+msgstr "E501: ¤w¨ìÀÉ®×µ²§À"
+
+#: ex_docmd.c:624
+msgid "E169: Command too recursive"
+msgstr "E169: ©R¥O»¼°j¼h¼Æ¹L¦h"
+
+#: ex_docmd.c:1090
+#, c-format
+msgid "E605: Exception not caught: %s"
+msgstr "E605: ¥¼ÄdºIªº¨Ò¥~¡G %s"
+
+#: ex_docmd.c:1176
+msgid "End of sourced file"
+msgstr "©R¥OÀɵ²§ô"
+
+#: ex_docmd.c:1177
+msgid "End of function"
+msgstr "¨ç¦¡µ²§À"
+
+#: ex_docmd.c:1628
+msgid "E464: Ambiguous use of user-defined command"
+msgstr "E464: ¨Ï¥ÎªÌ©w¸qªº©R¥O·|²V²c"
+
+#: ex_docmd.c:1642
+msgid "E492: Not an editor command"
+msgstr "E492: ¤£¬O½s¿è¾¹ªº©R¥O"
+
+#: ex_docmd.c:1725
+msgid "E478: Don't panic!"
+msgstr "E478: ¤£­nÅå·W!"
+
+#: ex_docmd.c:1744
+msgid "E493: Backwards range given"
+msgstr "E493: «ü©w¤F¦V«e°Ñ¦Òªº½d³ò"
+
+#: ex_docmd.c:1753
+msgid "Backwards range given, OK to swap"
+msgstr "«ü©w¤F¦V«e°Ñ¦Òªº½d³ò¡AOK to swap"
+
+#: ex_docmd.c:1864
+msgid "E494: Use w or w>>"
+msgstr "E494: ½Ð¨Ï¥Î w ©Î w>>"
+
+#: ex_docmd.c:3446
+msgid "E319: Sorry, the command is not available in this version"
+msgstr "E319: ©êºp, ¥»©R¥O¦b¦¹ª©¥»¤¤¨S¦³¹ê§@"
+
+#: ex_docmd.c:3624
+msgid "E172: Only one file name allowed"
+msgstr "E172: ¥u¯à¦³¤@­ÓÀÉ"
+
+#: ex_docmd.c:4191
+#, c-format
+msgid "%d more files to edit. Quit anyway?"
+msgstr "ÁÙ¦³ %d ­ÓÀÉ®×¥¼½s¿è. ½T©w­nÂ÷¶}¡H"
+
+#: ex_docmd.c:4198
+#, c-format
+msgid "E173: %ld more files to edit"
+msgstr "E173: ÁÙ¦³ %ld ­ÓÀÉ®×¥¼½s¿è"
+
+#: ex_docmd.c:4292
+msgid "E174: Command already exists: add ! to replace it"
+msgstr "E174: ©R¥O¤w¸g¦s¦b, ½Ð¨Ï¥Î ! ±j¨î­«·s©w¸q"
+
+#: ex_docmd.c:4397
+msgid ""
+"\n"
+" Name Args Range Complete Definition"
+msgstr ""
+"\n"
+" ¦WºÙ °Ñ¼Æ ½d³ò §¹¾ã ©w¸q "
+
+#: ex_docmd.c:4486
+msgid "No user-defined commands found"
+msgstr "§ä¤£¨ì¨Ï¥ÎªÌ©w¸qªº©R¥O"
+
+#: ex_docmd.c:4517
+msgid "E175: No attribute specified"
+msgstr "E175: ¨S¦³«ü©wªºÄÝ©Ê"
+
+#: ex_docmd.c:4569
+msgid "E176: Invalid number of arguments"
+msgstr "E176: ¤£¥¿½Tªº°Ñ¼Æ¼Æ¥Ø"
+
+#: ex_docmd.c:4584
+msgid "E177: Count cannot be specified twice"
+msgstr "E177: ¤£¯à«ü©w¨â¦¸¼Æ¥Ø"
+
+#: ex_docmd.c:4594
+msgid "E178: Invalid default value for count"
+msgstr "E178: ¼Æ¥Øªº¹w³]°Ñ¼Æ¤£¥¿½T"
+
+#: ex_docmd.c:4622
+msgid "E179: argument required for complete"
+msgstr "E179: «ü¥O»Ý­n°Ñ¼Æ¤~¯à§¹¦¨"
+
+#: ex_docmd.c:4641
+#, c-format
+msgid "E180: Invalid complete value: %s"
+msgstr "E180: ¤£§¹¾ãªº­È: '%s'"
+
+#: ex_docmd.c:4649
+#, c-format
+msgid "E181: Invalid attribute: %s"
+msgstr "E181: ¤£¥¿½TªºÄÝ©Ê: %s"
+
+#: ex_docmd.c:4690
+msgid "E182: Invalid command name"
+msgstr "E182: «ü¥O¦WºÙ¤£¥¿½T"
+
+#: ex_docmd.c:4705
+msgid "E183: User defined commands must start with an uppercase letter"
+msgstr "E183: ¨Ï¥ÎªÌ¦Û©w«ü¥O¥²¶·¥H¤j¼g¦r¥À¶}©l"
+
+#: ex_docmd.c:4774
+#, c-format
+msgid "E184: No such user-defined command: %s"
+msgstr "E184: ¨S¦³¨Ï¥ÎªÌ¦Û©wªº©R¥O¡G %s"
+
+#: ex_docmd.c:5230
+#, c-format
+msgid "E185: Cannot find color scheme %s"
+msgstr "E185: §ä¤£¨ìÃC¦â¼Ë¦¡ %s"
+
+#: ex_docmd.c:5238
+msgid "Greetings, Vim user!"
+msgstr "¶Ù, Vim ¨Ï¥ÎªÌ¡I"
+
+#: ex_docmd.c:5946
+msgid "Edit File in new window"
+msgstr "¦b·sµøµ¡½s¿èÀÉ®×"
+
+#: ex_docmd.c:6219
+msgid "No swap file"
+msgstr "µL¼È¦sÀÉ"
+
+#: ex_docmd.c:6323
+msgid "Append File"
+msgstr "ªþ¥[ÀÉ®×"
+
+#: ex_docmd.c:6387
+msgid "E186: No previous directory"
+msgstr "E186: ¨S¦³«e¤@­Ó¥Ø¿ý"
+
+#: ex_docmd.c:6469
+msgid "E187: Unknown"
+msgstr "E187: µLªk¿ìÃѪº¼Ð°O"
+
+#: ex_docmd.c:6554
+msgid "E465: :winsize requires two number arguments"
+msgstr "E465: :winsize »Ý­n¨â­Ó°Ñ¼Æ"
+
+#: ex_docmd.c:6605
+#, c-format
+msgid "Window position: X %d, Y %d"
+msgstr "µøµ¡¦ì¸m: X %d, Y %d"
+
+#: ex_docmd.c:6610
+msgid "E188: Obtaining window position not implemented for this platform"
+msgstr "E188: ¦b±zªº¥­¥x¤WµLªkÀò±oµøµ¡¦ì¸m"
+
+#: ex_docmd.c:6620
+msgid "E466: :winpos requires two number arguments"
+msgstr "E466: :winpos »Ý­n¨â­Ó°Ñ¼Æ"
+
+#: ex_docmd.c:6899
+msgid "Save Redirection"
+msgstr "Àx¦s Redirection"
+
+#: ex_docmd.c:7046
+msgid "Save View"
+msgstr "Àx¦s View"
+
+#: ex_docmd.c:7047
+msgid "Save Session"
+msgstr "Àx¦s Session"
+
+#: ex_docmd.c:7049
+msgid "Save Setup"
+msgstr "Àx¦s³]©w"
+
+#: ex_docmd.c:7200
+#, c-format
+msgid "E189: \"%s\" exists (add ! to override)"
+msgstr "E189: \"%s\" ¤w¦s¦b (½Ð¥Î ! ±j¨î°õ¦æ)"
+
+#: ex_docmd.c:7205
+#, c-format
+msgid "E190: Cannot open \"%s\" for writing"
+msgstr "E190: µLªk¥H¼g¤J¼Ò¦¡¶}±Ò \"%s\""
+
+#. set mark
+#: ex_docmd.c:7229
+msgid "E191: Argument must be a letter or forward/backward quote"
+msgstr "E191: °Ñ¼Æ¥²¶·¬O­^¤å¦r¥À©Î¦V«e/«áªº¤Þ¸¹"
+
+#: ex_docmd.c:7271
+msgid "E192: Recursive use of :normal too deep"
+msgstr "E192: :normal »¼°j¼h¼Æ¹L²`"
+
+#: ex_docmd.c:7772
+msgid "E194: No alternate file name to substitute for '#'"
+msgstr "E194: ¨S¦³ '#' ¥i´À¥NªºÀɦW"
+
+#: ex_docmd.c:7803
+msgid "E495: no autocommand file name to substitute for \"<afile>\""
+msgstr "E495: ¨S¦³ Autocommand ÀɦW¥H¨ú¥N \"<afile>\""
+
+#: ex_docmd.c:7811
+msgid "E496: no autocommand buffer number to substitute for \"<abuf>\""
+msgstr "E496: ¨S¦³ Autocommand ½w½Ä°Ï¦WºÙ¥H¨ú¥N \"<abuf>\""
+
+#: ex_docmd.c:7822
+msgid "E497: no autocommand match name to substitute for \"<amatch>\""
+msgstr "E497: ¨S¦³ Autocommand ²Å¦X¦WºÙ¥H¨ú¥N \"<amatch>\""
+
+#: ex_docmd.c:7832
+msgid "E498: no :source file name to substitute for \"<sfile>\""
+msgstr "E498: ¨S¦³ :source ÀɦW¥H¨ú¥N \"<sfile>\""
+
+#: ex_docmd.c:7873
+#, no-c-format
+msgid "E499: Empty file name for '%' or '#', only works with \":p:h\""
+msgstr "E499: '%' ©Î '#' «ü¦VªÅÀɦW¡A¥u¯à¥Î©ó \":p:h\""
+
+#: ex_docmd.c:7875
+msgid "E500: Evaluates to an empty string"
+msgstr "E500: ¿é¤J¬°ªÅ¦r¦ê"
+
+#: ex_docmd.c:8802
+msgid "E195: Cannot open viminfo file for reading"
+msgstr "E195: µLªkŪ¨ú viminfo"
+
+#: ex_docmd.c:8975
+msgid "E196: No digraphs in this version"
+msgstr "E196: ¥»ª©¥»µL½Æ¦X¦r¤¸(digraph)"
+
+#: ex_eval.c:407
+msgid "E608: Cannot :throw exceptions with 'Vim' prefix"
+msgstr "E608: ¤£¯à :throw ¥Î 'Vim' ¶}ÀYªº¨Ò¥~"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:488
+#, c-format
+msgid "Exception thrown: %s"
+msgstr "¥á¥X¨Ò¥~¡G %s"
+
+#: ex_eval.c:530
+#, c-format
+msgid "Exception finished: %s"
+msgstr "¨Ò¥~µ²§ô¡G %s"
+
+#: ex_eval.c:531
+#, c-format
+msgid "Exception discarded: %s"
+msgstr "¤w¥á±ó¨Ò¥~¡G %s"
+
+#: ex_eval.c:582 ex_eval.c:620
+#, c-format
+msgid "%s, line %ld"
+msgstr "%s, ¦æ %ld"
+
+#. always scroll up, don't overwrite
+#: ex_eval.c:596
+#, c-format
+msgid "Exception caught: %s"
+msgstr "µo¥Í¨Ò¥~¡G%s"
+
+#: ex_eval.c:667
+#, c-format
+msgid "%s made pending"
+msgstr "%s ³y¦¨ pending"
+
+#: ex_eval.c:670
+#, c-format
+msgid "%s resumed"
+msgstr "%s ¤w¦^´_"
+
+#: ex_eval.c:674
+#, c-format
+msgid "%s discarded"
+msgstr "%s ¤w¥á±ó"
+
+#: ex_eval.c:700
+msgid "Exception"
+msgstr "¨Ò¥~"
+
+#: ex_eval.c:706
+msgid "Error and interrupt"
+msgstr "¿ù»~»P¤¤Â_"
+
+#: ex_eval.c:708 gui.c:4237
+msgid "Error"
+msgstr "¿ù»~"
+
+#. if (pending & CSTP_INTERRUPT)
+#: ex_eval.c:710
+msgid "Interrupt"
+msgstr "¤¤Â_"
+
+#: ex_eval.c:779
+msgid "E579: :if nesting too deep"
+msgstr "E579: :if ¼h¼Æ¹L²`"
+
+#: ex_eval.c:816
+msgid "E580: :endif without :if"
+msgstr "E580: :endif ¯Ê¤Ö¹ïÀ³ªº :if"
+
+#: ex_eval.c:860
+msgid "E581: :else without :if"
+msgstr "E581: :else ¯Ê¤Ö¹ïÀ³ªº :if"
+
+#: ex_eval.c:863
+msgid "E582: :elseif without :if"
+msgstr "E582: :elseif ¯Ê¤Ö¹ïÀ³ªº :if"
+
+#: ex_eval.c:870
+msgid "E583: multiple :else"
+msgstr "E583: ¦h­« :else"
+
+#: ex_eval.c:873
+msgid "E584: :elseif after :else"
+msgstr "E584: :elseif ¦b :else ¤§«á"
+
+#: ex_eval.c:940
+msgid "E585: :while nesting too deep"
+msgstr "E585: :while ¼h¼Æ¹L²`"
+
+#: ex_eval.c:996
+msgid "E586: :continue without :while"
+msgstr "E586: :continue ¯Ê¤Ö¹ïÀ³ªº :while"
+
+#: ex_eval.c:1036
+msgid "E587: :break without :while"
+msgstr "E587: :break ¯Ê¤Ö¹ïÀ³ªº :while"
+
+#: ex_eval.c:1235
+msgid "E601: :try nesting too deep"
+msgstr "E601: :if ¼h¼Æ¹L²`"
+
+#: ex_eval.c:1278
+msgid "E603: :catch without :try"
+msgstr "E603: :catch ¨S¦³ :try"
+
+#. Give up for a ":catch" after ":finally" and ignore it.
+#. * Just parse.
+#: ex_eval.c:1300
+msgid "E604: :catch after :finally"
+msgstr "E604: :catch ¦b :finally ¤§«á"
+
+#: ex_eval.c:1418
+msgid "E606: :finally without :try"
+msgstr "E606: :finally ¨S¦³ :try"
+
+#. Give up for a multiple ":finally" and ignore it.
+#: ex_eval.c:1442
+msgid "E607: multiple :finally"
+msgstr "E607: ¦h­« :finally"
+
+#: ex_eval.c:1551
+msgid "E602: :endtry without :try"
+msgstr "E602: :endif ¯Ê¤Ö¹ïÀ³ªº :if"
+
+#: ex_eval.c:1857
+msgid "E193: :endfunction not inside a function"
+msgstr "E193: :endfunction ¥²¶·¦b¨ç¦¡¤º³¡¨Ï¥Î"
+
+#: ex_getln.c:2967
+msgid "tagname"
+msgstr "¼ÐÅÒ¦WºÙ"
+
+#: ex_getln.c:2970
+msgid " kind file\n"
+msgstr "ÃþÀÉ®×\n"
+
+#: ex_getln.c:4176
+msgid "'history' option is zero"
+msgstr "¿ï¶µ 'history' ¬O¹s"
+
+#: ex_getln.c:4416
+#, c-format
+msgid ""
+"\n"
+"# %s History (newest to oldest):\n"
+msgstr ""
+"\n"
+"# %s ¾ú¥v°O¿ý (·s¨ìÂÂ):\n"
+
+#: ex_getln.c:4417
+msgid "Command Line"
+msgstr "©R¥O¦C"
+
+#: ex_getln.c:4418
+msgid "Search String"
+msgstr "·j´M¦r¦ê"
+
+#: ex_getln.c:4419
+msgid "Expression"
+msgstr "¹Bºâ¦¡"
+
+#: ex_getln.c:4420
+msgid "Input Line"
+msgstr "¿é¤J¦æ"
+
+#: ex_getln.c:4450
+msgid "E198: cmd_pchar beyond the command length"
+msgstr "E198: cmd_pchar ¶W¹L©R¥Oªø«×"
+
+#: ex_getln.c:4624
+msgid "E199: Active window or buffer deleted"
+msgstr "E199: ¤w§R°£±¼§@¥Î¤¤ªºµøµ¡©Î¼È¦s°Ï"
+
+#: fileio.c:373
+msgid "Illegal file name"
+msgstr "¤£¥¿½TªºÀɦW"
+
+#: fileio.c:397 fileio.c:522 fileio.c:2686 fileio.c:2727
+msgid "is a directory"
+msgstr "¬O¥Ø¿ý"
+
+#: fileio.c:399
+msgid "is not a file"
+msgstr "¤£¬OÀÉ®×"
+
+#: fileio.c:544 fileio.c:3833
+msgid "[New File]"
+msgstr "[¥¼©R¦W]"
+
+#: fileio.c:566
+msgid "[Permission Denied]"
+msgstr "[Åv­­¤£¨¬]"
+
+#: fileio.c:670
+msgid "E200: *ReadPre autocommands made the file unreadable"
+msgstr "E200: *ReadPre Autocommand ¨Ïµ{¦¡µLªkŪ¨ú¦¹ÀÉ"
+
+#: fileio.c:672
+msgid "E201: *ReadPre autocommands must not change current buffer"
+msgstr "E201: *Filter* Autocommand ¤£¥i¥H§ó§ï½w½Ä°Ïªº¤º®e"
+
+#: fileio.c:693
+msgid "Vim: Reading from stdin...\n"
+msgstr "Vim: ±q¼Ð·Ç¿é¤JŪ¨ú...\n"
+
+#: fileio.c:699
+msgid "Reading from stdin..."
+msgstr "±q¼Ð·Ç¿é¤JŪ¨ú..."
+
+#. Re-opening the original file failed!
+#: fileio.c:944
+msgid "E202: Conversion made file unreadable!"
+msgstr "E202: Âà´«¿ù»~"
+
+#: fileio.c:1892
+msgid "[fifo/socket]"
+msgstr "[fifo/socket]"
+
+#: fileio.c:1899
+msgid "[fifo]"
+msgstr "[fifo]"
+
+#: fileio.c:1906
+msgid "[socket]"
+msgstr "[socket]"
+
+#: fileio.c:1914
+msgid "[RO]"
+msgstr "[°ßŪ]"
+
+#: fileio.c:1924
+msgid "[CR missing]"
+msgstr "[¯Ê¤ÖCR]'"
+
+#: fileio.c:1929
+msgid "[NL found]"
+msgstr "[§ä¨ìNL]"
+
+#: fileio.c:1934
+msgid "[long lines split]"
+msgstr "[¤À³Î¹Lªø¦æ]"
+
+#: fileio.c:1940 fileio.c:3817
+msgid "[NOT converted]"
+msgstr "[¥¼Âà´«]"
+
+#: fileio.c:1945 fileio.c:3822
+msgid "[converted]"
+msgstr "[¤wÂà´«]"
+
+#: fileio.c:1952 fileio.c:3847
+msgid "[crypted]"
+msgstr "[¤w¥[±K]"
+
+#: fileio.c:1959
+msgid "[CONVERSION ERROR]"
+msgstr "Âà´«¿ù»~"
+
+#: fileio.c:1965
+#, c-format
+msgid "[ILLEGAL BYTE in line %ld]"
+msgstr "[¦æ %ld ¦³¤£¥¿½Tªº¦ì¤¸]"
+
+#: fileio.c:1972
+msgid "[READ ERRORS]"
+msgstr "[Ū¨ú¿ù»~]"
+
+#: fileio.c:2188
+msgid "Can't find temp file for conversion"
+msgstr "§ä¤£¨ìÂà´«¥Îªº¼È¦sÀÉ"
+
+#: fileio.c:2195
+msgid "Conversion with 'charconvert' failed"
+msgstr "¦r¤¸¶°Âà´«¿ù»~"
+
+#: fileio.c:2198
+msgid "can't read output of 'charconvert'"
+msgstr "µLªkŪ¨ú 'charconvert' ªº¿é¥X"
+
+#: fileio.c:2601
+msgid "E203: Autocommands deleted or unloaded buffer to be written"
+msgstr "E203: Autocommand §R°£©ÎÄÀ©ñ¤F­n¼g¤Jªº½w½Ä°Ï"
+
+#: fileio.c:2624
+msgid "E204: Autocommand changed number of lines in unexpected way"
+msgstr "E204: Autocommand ·N¥~¦a§ïÅܤF¦æ¸¹"
+
+#: fileio.c:2692 fileio.c:2710
+msgid "is not a file or writable device"
+msgstr "¤£¬OÀɮשΥi¼g¤Jªº¸Ë¸m"
+
+#: fileio.c:2762
+msgid "is read-only (add ! to override)"
+msgstr "¬O°ßŪÀÉ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3065
+msgid "E506: Can't write to backup file (add ! to override)"
+msgstr "E506: µLªk¼g¤J³Æ¥÷ÀÉ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3077
+msgid "E507: Close error for backup file (add ! to override)"
+msgstr "E507: µLªkÃö³¬³Æ¥÷ÀÉ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3079
+msgid "E508: Can't read file for backup (add ! to override)"
+msgstr "E508: µLªkŪ¨úÀÉ®×¥H¨Ñ³Æ¥÷ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3095
+msgid "E509: Cannot create backup file (add ! to override)"
+msgstr "E509: µLªk«Ø¥ß³Æ¥÷ÀÉ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3198
+msgid "E510: Can't make backup file (add ! to override)"
+msgstr "E510: µLªk»s§@³Æ¥÷ÀÉ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3260
+msgid "E460: The resource fork would be lost (add ! to override)"
+msgstr "E460: Resource fork ·|®ø¥¢ (½Ð¨Ï¥Î ! ±j¨î°õ¦æ)"
+
+#: fileio.c:3361
+msgid "E214: Can't find temp file for writing"
+msgstr "E214: §ä¤£¨ì¼g¤J¥Îªº¼È¦sÀÉ"
+
+#: fileio.c:3379
+msgid "E213: Cannot convert (add ! to write without conversion)"
+msgstr "E213: µLªkÂà´« (½Ð¨Ï¥Î ! ±j¨î¤£Âà´«¼g¤J)"
+
+#: fileio.c:3414
+msgid "E166: Can't open linked file for writing"
+msgstr "E166: µLªk¥H¼g¤J¼Ò¦¡¶}±Ò³sµ²ÀÉ®×"
+
+#: fileio.c:3418
+msgid "E212: Can't open file for writing"
+msgstr "E212: µLªk¥H¼g¤J¼Ò¦¡¶}±Ò"
+
+#: fileio.c:3668
+msgid "E512: Close failed"
+msgstr "E512: Ãö³¬¥¢±Ñ"
+
+#: fileio.c:3739
+msgid "E513: write error, conversion failed"
+msgstr "E513: µLªk¼g¤J -- Âà´«¥¢±Ñ"
+
+#: fileio.c:3745
+msgid "E514: write error (file system full?)"
+msgstr "E514: ¼g¤J¿ù»~ (Àɮרt²Î¤wº¡¡H)"
+
+#: fileio.c:3812
+msgid " CONVERSION ERROR"
+msgstr "Âà´«¿ù»~"
+
+#: fileio.c:3828
+msgid "[Device]"
+msgstr "[¸Ë¸m]"
+
+#: fileio.c:3833
+msgid "[New]"
+msgstr "[·s]"
+
+#: fileio.c:3855
+msgid " [a]"
+msgstr "[a]"
+
+#: fileio.c:3855
+msgid " appended"
+msgstr " ¤wªþ¥["
+
+#: fileio.c:3857
+msgid " [w]"
+msgstr "[w]"
+
+#: fileio.c:3857
+msgid " written"
+msgstr " ¤w¼g¤J"
+
+#: fileio.c:3910
+msgid "E205: Patchmode: can't save original file"
+msgstr "E205: Patch ¼Ò¦¡: µLªkÀx¦s­ì©lÀÉ®×"
+
+#: fileio.c:3932
+msgid "E206: patchmode: can't touch empty original file"
+msgstr "E206: Patch ¼Ò¦¡: µLªkÅܧóªÅªº­ì©lÀÉ®×"
+
+#: fileio.c:3947
+msgid "E207: Can't delete backup file"
+msgstr "E207: µLªk§R°£³Æ¥÷ÀÉ"
+
+#: fileio.c:4008
+msgid ""
+"\n"
+"WARNING: Original file may be lost or damaged\n"
+msgstr ""
+"\n"
+"ĵ§i: ­ì©lÀɮ׬y¥¢©Î·lÃa\n"
+
+#: fileio.c:4010
+msgid "don't quit the editor until the file is successfully written!"
+msgstr "¦bÀÉ®×¥¿½T¼g¤J«e½Ð¤ÅÂ÷¶}½s¿è¾¹!"
+
+#: fileio.c:4099
+msgid "[dos]"
+msgstr "[dos]"
+
+#: fileio.c:4099
+msgid "[dos format]"
+msgstr "[dos ®æ¦¡]"
+
+#: fileio.c:4106
+msgid "[mac]"
+msgstr "[mac]"
+
+#: fileio.c:4106
+msgid "[mac format]"
+msgstr "[mac ®æ¦¡]"
+
+#: fileio.c:4113
+msgid "[unix]"
+msgstr "[unix]"
+
+#: fileio.c:4113
+msgid "[unix format]"
+msgstr "[unix ®æ¦¡]"
+
+#: fileio.c:4140
+msgid "1 line, "
+msgstr "1 ¦æ, "
+
+#: fileio.c:4142
+#, c-format
+msgid "%ld lines, "
+msgstr "%ld ¦æ, "
+
+#: fileio.c:4145
+msgid "1 character"
+msgstr "¤@­Ó¦r¤¸"
+
+#: fileio.c:4147
+#, c-format
+msgid "%ld characters"
+msgstr "%ld­Ó¦r¤¸"
+
+#: fileio.c:4157
+msgid "[noeol]"
+msgstr "[noeol]"
+
+#: fileio.c:4157
+msgid "[Incomplete last line]"
+msgstr "[µ²§À¦æ¤£§¹¾ã]"
+
+#. don't overwrite messages here
+#. must give this prompt
+#. don't use emsg() here, don't want to flush the buffers
+#: fileio.c:4176
+msgid "WARNING: The file has been changed since reading it!!!"
+msgstr "ĵ§i: ¥»ÀɮצۤW¦¸Åª¤J«á¤wÅÜ°Ê!!!"
+
+#: fileio.c:4178
+msgid "Do you really want to write to it"
+msgstr "½T©w­n¼g¤J¶Ü"
+
+#: fileio.c:5219
+#, c-format
+msgid "E208: Error writing to \"%s\""
+msgstr "E208: ¼g¤JÀÉ®× \"%s\" ¿ù»~"
+
+#: fileio.c:5226
+#, c-format
+msgid "E209: Error closing \"%s\""
+msgstr "E209: Ãö³¬ÀÉ®× \"%s\" ¿ù»~"
+
+#: fileio.c:5229
+#, c-format
+msgid "E210: Error reading \"%s\""
+msgstr "E210: Ū¨úÀÉ®× \"%s\" ¿ù»~"
+
+#: fileio.c:5448
+msgid "E246: FileChangedShell autocommand deleted buffer"
+msgstr "E246: FileChangedShell autocommand §R°£½w½Ä°Ï"
+
+#: fileio.c:5456
+#, c-format
+msgid "E211: Warning: File \"%s\" no longer available"
+msgstr "E211: ĵ§i: ÀÉ®× \"%s\" ¤w¸g¤£¦s¦b"
+
+#: fileio.c:5469
+#, c-format
+msgid ""
+"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as "
+"well"
+msgstr "W12: ĵ§i: ÀÉ®× \"%s\" ¦Û¤W¦¸Åª¤J«á¤wÅÜ°Ê, ¦Ó¥B½s¿è¤¤ªº½w½Ä°Ï¤]§ó°Ê¤F"
+
+#: fileio.c:5472
+#, c-format
+msgid "W11: Warning: File \"%s\" has changed since editing started"
+msgstr "W11: ĵ§i: ÀÉ®× \"%s\" ¦Û¤W¦¸Åª¤J«á¤wÅÜ°Ê"
+
+#: fileio.c:5474
+#, c-format
+msgid "W16: Warning: Mode of file \"%s\" has changed since editing started"
+msgstr "W16: ĵ§i: ÀÉ®× \"%s\" ªºÅv­­»P¤W¦¸Åª¤J®É¤£¤@¼Ë (¦³ÅܰʹL)"
+
+# 'mode' seems better as translated to 'permission'?
+#: fileio.c:5484
+#, c-format
+msgid "W13: Warning: File \"%s\" has been created after editing started"
+msgstr "W13: ĵ§i: ÀÉ®× \"%s\" ¦b¶}©l½s¿è«á¤S³Q«Ø¥ß¤F"
+
+#: fileio.c:5501
+msgid "Warning"
+msgstr "ĵ§i"
+
+#: fileio.c:5502
+msgid ""
+"&OK\n"
+"&Load File"
+msgstr ""
+"½T©w(&O)\n"
+"¸ü¤JÀÉ®×(&L)"
+
+#: fileio.c:5600
+#, c-format
+msgid "E462: Could not prepare for reloading \"%s\""
+msgstr "E462: µLªk·Ç³Æ­«·s¸ü¤J \"%s\""
+
+#: fileio.c:5619
+#, c-format
+msgid "E321: Could not reload \"%s\""
+msgstr "E321: µLªk­«·s¸ü¤J \"%s\""
+
+#: fileio.c:6201
+msgid "--Deleted--"
+msgstr "--¤w§R°£--"
+
+#. the group doesn't exist
+#: fileio.c:6361
+#, c-format
+msgid "E367: No such group: \"%s\""
+msgstr "E367: µL¦¹¸s²Õ: \"%s\""
+
+#: fileio.c:6486
+#, c-format
+msgid "E215: Illegal character after *: %s"
+msgstr "E215: * «á­±¦³¤£¥¿½Tªº¦r¤¸: %s"
+
+#: fileio.c:6497
+#, c-format
+msgid "E216: No such event: %s"
+msgstr "E216: µL¦¹¨Æ¥ó: %s"
+
+#. Highlight title
+#: fileio.c:6646
+msgid ""
+"\n"
+"--- Auto-Commands ---"
+msgstr ""
+"\n"
+"--- Auto-Commands ---"
+
+#: fileio.c:6917
+msgid "E217: Can't execute autocommands for ALL events"
+msgstr "E217: µLªk¹ï©Ò¦³¨Æ¥ó°õ¦æ autocommand"
+
+#: fileio.c:6940
+msgid "No matching autocommands"
+msgstr "§ä¤£¨ì¹ïÀ³ªº autocommand"
+
+#: fileio.c:7260
+msgid "E218: autocommand nesting too deep"
+msgstr "E218: autocommand ¼h¼Æ¹L²`"
+
+#: fileio.c:7528
+#, c-format
+msgid "%s Auto commands for \"%s\""
+msgstr "%s Auto commands: \"%s\""
+
+#: fileio.c:7536
+#, c-format
+msgid "Executing %s"
+msgstr "°õ¦æ %s"
+
+#. always scroll up, don't overwrite
+#: fileio.c:7604
+#, c-format
+msgid "autocommand %s"
+msgstr "autocommand %s"
+
+#: fileio.c:8171
+msgid "E219: Missing {."
+msgstr "E219: ¯Ê¤Ö {."
+
+#: fileio.c:8173
+msgid "E220: Missing }."
+msgstr "E220: ¯Ê¤Ö }."
+
+#: fold.c:66
+msgid "E490: No fold found"
+msgstr "E490: §ä¤£¨ì¥ô¦ó fold"
+
+#: fold.c:553
+msgid "E350: Cannot create fold with current 'foldmethod'"
+msgstr "E350: µLªk¦b¥Ø«eªº 'foldmethod' ¤U«Ø¥ß fold"
+
+#: fold.c:555
+msgid "E351: Cannot delete fold with current 'foldmethod'"
+msgstr "E351: µLªk¦b¥Ø«eªº 'foldmethod' ¤U§R°£ fold"
+
+#: getchar.c:246
+msgid "E222: Add to read buffer"
+msgstr "E222: ¥[¤JŪ¨ú½w½Ä°Ï¤¤"
+
+#: getchar.c:2146
+msgid "E223: recursive mapping"
+msgstr "E223: »¼°j mapping"
+
+#: getchar.c:2994
+#, c-format
+msgid "E224: global abbreviation already exists for %s"
+msgstr "E224: %s ¤w¸g¦³¥þ°ì abbreviation ¤F"
+
+#: getchar.c:2997
+#, c-format
+msgid "E225: global mapping already exists for %s"
+msgstr "E225: %s ¤w¸g¦³¥þ°ì mapping ¤F"
+
+#: getchar.c:3124
+#, c-format
+msgid "E226: abbreviation already exists for %s"
+msgstr "E226: %s ¤w¸g¦³ abbreviation ¤F"
+
+#: getchar.c:3127
+#, c-format
+msgid "E227: mapping already exists for %s"
+msgstr "E227: %s ªº mapping ¤w¸g¦s¦b"
+
+#: getchar.c:3191
+msgid "No abbreviation found"
+msgstr "§ä¤£¨ì abbreviation"
+
+#: getchar.c:3193
+msgid "No mapping found"
+msgstr "¨S¦³³o­Ó mapping ¹ïÀ³"
+
+#: getchar.c:4083
+msgid "E228: makemap: Illegal mode"
+msgstr "E228: makemap: ¤£¥¿½Tªº¼Ò¦¡"
+
+#: gui.c:218
+msgid "E229: Cannot start the GUI"
+msgstr "E229: µLªk±Ò°Ê¹Ï«¬¬É­±"
+
+#: gui.c:347
+#, c-format
+msgid "E230: Cannot read from \"%s\""
+msgstr "E230: µLªkŪ¨úÀÉ®× \"%s\""
+
+#: gui.c:472
+msgid "E231: 'guifontwide' invalid"
+msgstr "E231: ¤£¥¿½Tªº 'guifontwide'"
+
+#: gui.c:3925
+#, c-format
+msgid "E254: Cannot allocate color %s"
+msgstr "E254: ¤£¯à°t¸mÃC¦â %s"
+
+#: gui_at_fs.c:290
+msgid "<cannot open> "
+msgstr "<¤£¯à¶}±Ò>"
+
+#: gui_at_fs.c:1115
+#, c-format
+msgid "E616: vim_SelFile: can't get font %s"
+msgstr "E616: vim_SelFile: ¤£¯à¨Ï¥Î %s ¦r«¬"
+
+#: gui_at_fs.c:2538
+msgid "E614: vim_SelFile: can't return to current directory"
+msgstr "E614: vim_SelFile: µLªk¦^¨ì¥Ø«e¥Ø¿ý"
+
+#: gui_at_fs.c:2557
+msgid "Pathname:"
+msgstr "¸ô®|:"
+
+#: gui_at_fs.c:2563
+msgid "E615: vim_SelFile: can't get current directory"
+msgstr "E615: vim_SelFile: µLªk¨ú±o¥Ø«e¥Ø¿ý"
+
+#: gui_at_fs.c:2571 gui_motif.c:1619
+msgid "OK"
+msgstr "½T©w"
+
+#: gui_at_fs.c:2571 gui_gtk.c:2625 gui_motif.c:1614 gui_motif.c:2844
+msgid "Cancel"
+msgstr "¨ú®ø"
+
+#: gui_at_sb.c:486
+msgid "Scrollbar Widget: Could not get geometry of thumb pixmap."
+msgstr "±²°Ê¶b: ¤£¯à³]©w thumb pixmap ªº¦ì¸m"
+
+#: gui_athena.c:1956 gui_motif.c:1867
+msgid "Vim dialog"
+msgstr "Vim ¹ï¸Ü²°"
+
+#: gui_beval.c:91
+msgid "E232: Cannot create BalloonEval with both message and callback"
+msgstr "E232: ¤£¯à¹ï°T®§»P callback «Ø¥ß BallonEval"
+
+#: gui_gtk.c:1561
+msgid "Vim dialog..."
+msgstr "Vim ¹ï¸Ü²°..."
+
+#: gui_gtk.c:1992 message.c:2525
+msgid ""
+"&Yes\n"
+"&No\n"
+"&Cancel"
+msgstr ""
+"&Y¬O\n"
+"&N§_\n"
+"&C¨ú®ø"
+
+#: gui_gtk.c:2152
+msgid "Input _Methods"
+msgstr "¿é¤Jªk"
+
+#: gui_gtk.c:2418 gui_motif.c:2763
+msgid "VIM - Search and Replace..."
+msgstr "VIM - ´M§ä»P¨ú¥N..."
+
+#: gui_gtk.c:2426 gui_motif.c:2765
+msgid "VIM - Search..."
+msgstr "VIM - ´M§ä..."
+
+#: gui_gtk.c:2458 gui_motif.c:2883
+msgid "Find what:"
+msgstr "·j´M:"
+
+#: gui_gtk.c:2478 gui_motif.c:2915
+msgid "Replace with:"
+msgstr "¨ú¥N¬°:"
+
+#. whole word only button
+#: gui_gtk.c:2510 gui_motif.c:3031
+msgid "Match whole word only"
+msgstr "¥u·j´M§¹¥þ¬Û¦Pªº¦r"
+
+#. match case button
+#: gui_gtk.c:2523 gui_motif.c:3043
+msgid "Match case"
+msgstr "²Å¦X¤j¤p¼g"
+
+#: gui_gtk.c:2535 gui_motif.c:2985
+msgid "Direction"
+msgstr "¤è¦V"
+
+#. 'Up' and 'Down' buttons
+#: gui_gtk.c:2547 gui_motif.c:2997
+msgid "Up"
+msgstr "¦V¤W"
+
+#: gui_gtk.c:2551 gui_motif.c:3005
+msgid "Down"
+msgstr "¦V¤U"
+
+#: gui_gtk.c:2577 gui_gtk.c:2579 gui_motif.c:2787
+msgid "Find Next"
+msgstr "§ä¤U¤@­Ó"
+
+#: gui_gtk.c:2596 gui_gtk.c:2598 gui_motif.c:2804
+msgid "Replace"
+msgstr "¨ú¥N"
+
+#: gui_gtk.c:2609 gui_gtk.c:2611 gui_motif.c:2817
+msgid "Replace All"
+msgstr "¨ú¥N¥þ³¡"
+
+#: gui_gtk_x11.c:2285
+msgid "Vim: Received \"die\" request from session manager\n"
+msgstr "Vim: ¥Ñ Session ºÞ²z­û¦¬¨ì \"die\" ­n¨D\n"
+
+#: gui_gtk_x11.c:3424
+msgid "Vim: Main window unexpectedly destroyed\n"
+msgstr "Vim: ¥Dµøµ¡Äê±¼\n"
+
+#: gui_gtk_x11.c:4038
+msgid "Font Selection"
+msgstr "¦r«¬¿ï¾Ü"
+
+#: gui_gtk_x11.c:5890 ui.c:2009
+msgid "Used CUT_BUFFER0 instead of empty selection"
+msgstr "¨Ï¥Î CUT_BUFFER0 ¨Ó¨ú¥NªÅ¿ï¾Ü"
+
+#: gui_motif.c:1613 gui_motif.c:1616
+msgid "Filter"
+msgstr "¹LÂo¾¹"
+
+#: gui_motif.c:1615
+msgid "Directories"
+msgstr "¥Ø¿ý"
+
+#: gui_motif.c:1617
+msgid "Help"
+msgstr "»²§U»¡©ú"
+
+#: gui_motif.c:1618
+msgid "Files"
+msgstr "ÀÉ®×"
+
+#: gui_motif.c:1620
+msgid "Selection"
+msgstr "¿ï¾Ü"
+
+#: gui_motif.c:2830
+msgid "Undo"
+msgstr "´_­ì"
+
+#: gui_riscos.c:952
+#, c-format
+msgid "E610: Can't load Zap font '%s'"
+msgstr "E610: µLªk¶}±Ò Zap ¦r«¬ '%s'"
+
+#: gui_riscos.c:1048
+#, c-format
+msgid "E611: Can't use font %s"
+msgstr "E611: µLªk¨Ï¥Î¦r«¬ %s"
+
+#: gui_riscos.c:3269
+msgid ""
+"\n"
+"Sending message to terminate child process.\n"
+msgstr ""
+"\n"
+"°e¥X¤¤Â_¤lµ{¦¡ªº°T®§¤¤.\n"
+
+#: gui_w32.c:759
+#, c-format
+msgid "E243: Argument not supported: \"-%s\"; Use the OLE version."
+msgstr "E243: ¤£¤ä´©°Ñ¼Æ \"-%s\"¡C½Ð¥Î OLE ª©¥»¡C"
+
+#: gui_w48.c:2029
+msgid "Find string (use '\\\\' to find a '\\')"
+msgstr "·j´M¦r¦ê (¨Ï¥Î '\\\\' ¨Óªí¥Ü '\\')"
+
+#: gui_w48.c:2054
+msgid "Find & Replace (use '\\\\' to find a '\\')"
+msgstr "·j´M¤Î¨ú¥N¦r¦ê (¨Ï¥Î '\\\\' ¨Óªí¥Ü '\\')"
+
+#: gui_x11.c:1445
+msgid "Vim E458: Cannot allocate colormap entry, some colors may be incorrect"
+msgstr "Vim E458: µLªk°t¸m color map ¶µ¥Ø¡A¦³¨ÇÃC¦â¬Ý°_¨Ó·|©Ç©Çªº"
+
+#: gui_x11.c:2019
+#, c-format
+msgid "E250: Fonts for the following charsets are missing in fontset %s:"
+msgstr "E250: Fontset %s ¨S¦³³]©w¥¿½Tªº¦r«¬¥H¨ÑÅã¥Ü³o¨Ç¦r¤¸¶°:"
+
+#: gui_x11.c:2062
+#, c-format
+msgid "E252: Fontset name: %s"
+msgstr "E252: ¦r«¬¶°(Fontset)¦WºÙ: %s"
+
+#: gui_x11.c:2063
+#, c-format
+msgid "Font '%s' is not fixed-width"
+msgstr "'%s' ¤£¬O©T©w¼e«×¦r«¬"
+
+#: gui_x11.c:2082
+#, c-format
+msgid "E253: Fontset name: %s\n"
+msgstr "E253: ¦r«¬¶°(Fontset)¦WºÙ: %s\n"
+
+#: gui_x11.c:2083
+#, c-format
+msgid "Font0: %s\n"
+msgstr "Font0: %s\n"
+
+#: gui_x11.c:2084
+#, c-format
+msgid "Font1: %s\n"
+msgstr "Font1: %s\n"
+
+#: gui_x11.c:2085
+#, c-format
+msgid "Font%d width is not twice that of font0\n"
+msgstr "¦r«¬%d¼e«×¤£¬O¦r«¬0ªº¨â­¿\n"
+
+#: gui_x11.c:2086
+#, c-format
+msgid "Font0 width: %ld\n"
+msgstr "¦r«¬0ªº¼e«×¡G%ld\n"
+
+#: gui_x11.c:2087
+#, c-format
+msgid ""
+"Font1 width: %ld\n"
+"\n"
+msgstr ""
+"¦r«¬1¼e«×: %ld\n"
+"\n"
+
+#: hangulin.c:610
+msgid "E256: Hangul automata ERROR"
+msgstr "E256: Hangul automata ¿ù»~"
+
+#: if_cscope.c:26
+#, c-format
+msgid "E560: Usage: cs[cope] %s"
+msgstr "E560: ¥Îªk: cs[cope] %s"
+
+#: if_cscope.c:67
+msgid "Add a new database"
+msgstr "·s¼W¸ê®Æ®w"
+
+#: if_cscope.c:69
+msgid "Query for a pattern"
+msgstr "¿é¤J pattern"
+
+#: if_cscope.c:71
+msgid "Show this message"
+msgstr "Åã¥Ü¦¹°T®§"
+
+#: if_cscope.c:73
+msgid "Kill a connection"
+msgstr "µ²§ô³s½u"
+
+#: if_cscope.c:75
+msgid "Reinit all connections"
+msgstr "­«³]©Ò¦³³s½u"
+
+#: if_cscope.c:77
+msgid "Show connections"
+msgstr "Åã¥Ü³s½u"
+
+#: if_cscope.c:108
+msgid "This cscope command does not support splitting the window.\n"
+msgstr "³o­Ó cscope ©R¥O¤£¤ä´©¤À³Î¿Ã¹õ\n"
+
+#: if_cscope.c:143
+msgid "E562: Usage: cstag <ident>"
+msgstr "E562: ¥Îªk: cstag <ÃѧO¦rident>"
+
+#: if_cscope.c:199
+msgid "E257: cstag: tag not found"
+msgstr "E257: cstag: §ä¤£¨ì tag"
+
+#: if_cscope.c:407 if_cscope.c:451
+#, c-format
+msgid "E563: stat(%s) error: %d"
+msgstr "E563: stat(%s) ¿ù»~: %d"
+
+#: if_cscope.c:461 if_cscope.c:468
+#, c-format
+msgid "Added cscope database %s"
+msgstr "·s¼W cscope ¸ê®Æ®w %s"
+
+#: if_cscope.c:475
+#, c-format
+msgid "E564: %s is not a directory or a valid cscope database"
+msgstr "E564: %s ¤£¬O¥Ø¿ý©Î cscope ¸ê®Æ®w"
+
+#: if_cscope.c:559
+#, c-format
+msgid "E565: error reading cscope connection %d"
+msgstr "E565: Ū¨ú cscope ³s½u %d ¿ù»~"
+
+#: if_cscope.c:636
+msgid "E561: unknown cscope search type"
+msgstr "E561: ¥¼ª¾ªº cscope ·j´M§ÎºA"
+
+#: if_cscope.c:683
+msgid "E566: Could not create cscope pipes"
+msgstr "E566: µLªk«Ø¥ß»P cscope ªº pipe ³s½u"
+
+#: if_cscope.c:748
+msgid "cs_create_connection exec failed"
+msgstr "cs_create_connection °õ¦æ¥¢±Ñ"
+
+#: if_cscope.c:758
+msgid "cs_create_connection: fdopen for to_fp failed"
+msgstr "cs_create_connection: fdopen ¥¢±Ñ (to_fp)"
+
+#: if_cscope.c:760
+msgid "cs_create_connection: fdopen for fr_fp failed"
+msgstr "cs_create_connection: fdopen ¥¢±Ñ (fr_fp)"
+
+#: if_cscope.c:788
+msgid "E567: no cscope connections"
+msgstr "E567: ¨S¦³ cscope ³s½u"
+
+#: if_cscope.c:858
+#, c-format
+msgid "E259: no matches found for cscope query %s of %s"
+msgstr "E259: §ä¤£¨ì²Å¦X cscope ªº·j´M %s / %s"
+
+#: if_cscope.c:902
+msgid "cscope commands:\n"
+msgstr "cscope ©R¥O:\n"
+
+#: if_cscope.c:905
+#, c-format
+msgid "%-5s: %-30s (Usage: %s)\n"
+msgstr "%-5s: %-30s (¥Îªk: %s)\n"
+
+#: if_cscope.c:973
+msgid "E568: duplicate cscope database not added"
+msgstr "E568: ­«½Æªº cscope ¸ê®Æ®w¥¼³Q¥[¤J"
+
+#: if_cscope.c:984
+msgid "E569: maximum number of cscope connections reached"
+msgstr "E569: ¤w¹F¨ì cscope ³Ì¤j³s½u¼Æ¥Ø"
+
+#: if_cscope.c:1105
+msgid "E260: cscope connection not found"
+msgstr "E260: §ä¤£¨ì cscope ³s½u"
+
+#: if_cscope.c:1108
+#, c-format
+msgid "E261: cscope connection %s not found"
+msgstr "E261: §ä¤£¨ì cscope ³s½u %s"
+
+#: if_cscope.c:1144
+msgid "cscope connection closed"
+msgstr "cscope ³s½u¤wÃö³¬"
+
+#: if_cscope.c:1152
+#, c-format
+msgid "cscope connection %s closed\n"
+msgstr "cscope ³s½u %s ¤wÃö³¬\n"
+
+#. should not reach here
+#: if_cscope.c:1293
+msgid "E570: fatal error in cs_manage_matches"
+msgstr "E570: cs_manage_matches ÄY­«¿ù»~"
+
+#: if_cscope.c:1344
+#, c-format
+msgid "E262: error reading cscope connection %d"
+msgstr "E262: Ū¨ú cscope ³s½u %d ¿ù»~"
+
+#: if_cscope.c:1452
+msgid "couldn't malloc\n"
+msgstr "µLªk¨Ï¥Î malloc\n"
+
+#: if_cscope.c:1457
+#, c-format
+msgid "Cscope tag: %s\n"
+msgstr "Cscope ¼ÐÅÒ(tag): %s\n"
+
+#: if_cscope.c:1461
+msgid " # line"
+msgstr " # ¦æ "
+
+#: if_cscope.c:1463
+msgid "filename / context / line\n"
+msgstr "ÀɦW / ¤º¤å / ¦æ¸¹\n"
+
+#: if_cscope.c:1721
+msgid "All cscope databases reset"
+msgstr "­«³]©Ò¦³ cscope ¸ê®Æ®w"
+
+#: if_cscope.c:1788
+msgid "no cscope connections\n"
+msgstr "¨S¦³ cscope ³s½u\n"
+
+#: if_cscope.c:1792
+msgid " # pid database name prepend path\n"
+msgstr " # pid ¸ê®Æ®w¦WºÙ prepend path\n"
+
+#: if_cscope.c:1803
+#, c-format
+msgid "%2d %-5ld %-34s <none>\n"
+msgstr "%2d %-5ld %-34s <µL>\n"
+
+#: if_python.c:394
+msgid ""
+"E263: Sorry, this command is disabled, the Python library could not be "
+"loaded."
+msgstr "E263: ©êºp¡A³o­Ó©R¥OµLªk¨Ï¥Î¡APython µ{¦¡®w¨S¦³¸ü¤J¡C"
+
+#: if_python.c:596
+msgid "can't delete OutputObject attributes"
+msgstr "µLªk§R°£ OutputObject ÄÝ©Ê"
+
+#: if_python.c:603
+msgid "softspace must be an integer"
+msgstr "softspace ¥²»Ý¬O¾ã¼Æ"
+
+#: if_python.c:611
+msgid "invalid attribute"
+msgstr "¤£¥¿½TªºÄÝ©Ê"
+
+#: if_python.c:650 if_python.c:664
+msgid "writelines() requires list of strings"
+msgstr "writelines() »Ý­n string list ·í°Ñ¼Æ"
+
+#: if_python.c:790
+msgid "E264: Python: Error initialising I/O objects"
+msgstr "E264: Python: µLªkªì©l I/O ª«¥ó"
+
+#: if_python.c:975 if_tcl.c:1402
+msgid "invalid expression"
+msgstr "¤£¥¿½Tªº¹Bºâ¦¡"
+
+#: if_python.c:989 if_tcl.c:1407
+msgid "expressions disabled at compile time"
+msgstr "¦]¬°½sĶ®É¨S¦³¥[¤J¹Bºâ¦¡(expression)ªºµ{¦¡½X¡A©Ò¥HµLªk¨Ï¥Î¹Bºâ¦¡"
+
+#: if_python.c:1002
+msgid "attempt to refer to deleted buffer"
+msgstr "¸Õ¹Ï¨Ï¥Î¤w³Q§R°£ªº buffer"
+
+#: if_python.c:1017 if_python.c:1058 if_python.c:1122 if_tcl.c:1214
+msgid "line number out of range"
+msgstr "¦æ¸¹¶W¥X½d³ò"
+
+#: if_python.c:1257
+#, c-format
+msgid "<buffer object (deleted) at %8lX>"
+msgstr "<buffer ª«¥ó (¤w§R°£): %8lX>"
+
+#: if_python.c:1348 if_tcl.c:836
+msgid "invalid mark name"
+msgstr "¼Ð°O¦WºÙ¤£¥¿½T"
+
+#: if_python.c:1623
+msgid "no such buffer"
+msgstr "µL¦¹ buffer"
+
+#: if_python.c:1711
+msgid "attempt to refer to deleted window"
+msgstr "¸Õ¹Ï¨Ï¥Î¤w³Q§R°£ªºµøµ¡"
+
+#: if_python.c:1756
+msgid "readonly attribute"
+msgstr "°ßŪÄÝ©Ê"
+
+#: if_python.c:1769
+msgid "cursor position outside buffer"
+msgstr "´å¼Ð©w¦ì¦b½w½Ä°Ï¤§¥~"
+
+#: if_python.c:1846
+#, c-format
+msgid "<window object (deleted) at %.8lX>"
+msgstr "<µøµ¡ª«¥ó(¤w§R°£): %.8lX>"
+
+#: if_python.c:1858
+#, c-format
+msgid "<window object (unknown) at %.8lX>"
+msgstr "<µøµ¡ª«¥ó(¥¼ª¾): %.8lX>"
+
+#: if_python.c:1860
+#, c-format
+msgid "<window %d>"
+msgstr "<µøµ¡ %d>"
+
+#: if_python.c:1936
+msgid "no such window"
+msgstr "µL¦¹µøµ¡"
+
+#: if_python.c:2193 if_python.c:2228 if_python.c:2278 if_python.c:2346
+#: if_python.c:2466 if_python.c:2518 if_tcl.c:684 if_tcl.c:729 if_tcl.c:803
+#: if_tcl.c:873 if_tcl.c:1998
+msgid "cannot save undo information"
+msgstr "µLªkÀx¦s´_­ì¸ê°T"
+
+#: if_python.c:2195 if_python.c:2285 if_python.c:2357
+msgid "cannot delete line"
+msgstr "¤£¯à§R°£¦¹¦æ"
+
+#: if_python.c:2230 if_python.c:2373 if_tcl.c:690 if_tcl.c:2020
+msgid "cannot replace line"
+msgstr "¤£¯à´À¥N¦¹¦æ"
+
+#: if_python.c:2389 if_python.c:2468 if_python.c:2526
+msgid "cannot insert line"
+msgstr "¤£¯à´À¥N´¡¤J¦¹¦æ"
+
+#: if_python.c:2630
+msgid "string cannot contain newlines"
+msgstr "¦r¦êµLªk¥]§t·s¦æ"
+
+#: if_ruby.c:396
+msgid ""
+"E266: Sorry, this command is disabled, the Ruby library could not be loaded."
+msgstr "E266: ¦¹©R¥OµLªk¨Ï¥Î¡AµLªk¸ü¤J Ruby µ{¦¡®w(Library)"
+
+#: if_ruby.c:459
+#, c-format
+msgid "E273: unknown longjmp status %d"
+msgstr "E273: ¥¼ª¾ªº longjmp status %d"
+
+#: if_sniff.c:67
+msgid "Toggle implementation/definition"
+msgstr "¤Á´«¹ê§@/©w¸q"
+
+#: if_sniff.c:68
+msgid "Show base class of"
+msgstr "Åã¥Ü base class of:"
+
+#: if_sniff.c:69
+msgid "Show overridden member function"
+msgstr "Åã¥Ü³Q override ªº member function"
+
+#: if_sniff.c:70
+msgid "Retrieve from file"
+msgstr "Ū¨ú: ±qÀÉ®×"
+
+#: if_sniff.c:71
+msgid "Retrieve from project"
+msgstr "Ū¨ú: ±qª«¥ó"
+
+#: if_sniff.c:73
+msgid "Retrieve from all projects"
+msgstr "Ū¨ú: ±q©Ò¦³ project"
+
+#: if_sniff.c:74
+msgid "Retrieve"
+msgstr "Ū¨ú"
+
+#: if_sniff.c:75
+msgid "Show source of"
+msgstr "Åã¥Ü­ì©l½X: "
+
+#: if_sniff.c:76
+msgid "Find symbol"
+msgstr "·j´M symbol"
+
+#: if_sniff.c:77
+msgid "Browse class"
+msgstr "ÂsÄý class"
+
+#: if_sniff.c:78
+msgid "Show class in hierarchy"
+msgstr "Åã¥Ü¶¥¼h¦¡ªº class"
+
+#: if_sniff.c:79
+msgid "Show class in restricted hierarchy"
+msgstr "Åã¥Ü restricted ¶¥¼h¦¡ªº class"
+
+#: if_sniff.c:80
+msgid "Xref refers to"
+msgstr "Xref °Ñ¦Ò¨ì"
+
+#: if_sniff.c:81
+msgid "Xref referred by"
+msgstr "Xref ³Q½Ö°Ñ¦Ò:"
+
+#: if_sniff.c:82
+msgid "Xref has a"
+msgstr "Xref ¦³"
+
+#: if_sniff.c:83
+msgid "Xref used by"
+msgstr "Xref ³Q½Ö¨Ï¥Î:"
+
+#: if_sniff.c:84
+msgid "Show docu of"
+msgstr "Åã¥Ü¤å¥ó: "
+
+#: if_sniff.c:85
+msgid "Generate docu for"
+msgstr "²£¥Í¤å¥ó: "
+
+#: if_sniff.c:97
+msgid ""
+"Cannot connect to SNiFF+. Check environment (sniffemacs must be found in "
+"$PATH).\n"
+msgstr "µLªk³s½u¨ì SNiFF+¡C½ÐÀˬdÀô¹ÒÅÜ¼Æ ($PATH ¸Ì¥²»Ý¥i¥H§ä¨ì sniffemacs)\n"
+
+#: if_sniff.c:425
+msgid "E274: Sniff: Error during read. Disconnected"
+msgstr "E274: Sniff: Ū¨ú¿ù»~. ¨ú®ø³s½u"
+
+#: if_sniff.c:553
+msgid "SNiFF+ is currently "
+msgstr "SNiFF+ ¥Ø«e"
+
+#: if_sniff.c:555
+msgid "not "
+msgstr "¥¼"
+
+#: if_sniff.c:556
+msgid "connected"
+msgstr "³s½u¤¤"
+
+#: if_sniff.c:592
+#, c-format
+msgid "E275: Unknown SNiFF+ request: %s"
+msgstr "E275: ¤£¥¿½Tªº SNiff+ ©I¥s: %s"
+
+#: if_sniff.c:605
+msgid "E276: Error connecting to SNiFF+"
+msgstr "E276: ³s½u¨ì SNiFF+ ¥¢±Ñ"
+
+#: if_sniff.c:1009
+msgid "E278: SNiFF+ not connected"
+msgstr "E278: ¥¼³s½u¨ì SNiFF+"
+
+#: if_sniff.c:1018
+msgid "E279: Not a SNiFF+ buffer"
+msgstr "E279: ¤£¬O SNiFF+ ªº½w½Ä°Ï"
+
+#: if_sniff.c:1083
+msgid "Sniff: Error during write. Disconnected"
+msgstr "Sniff: ¼g¤J¿ù»~¡Cµ²§ô³s½u"
+
+#: if_tcl.c:418
+msgid "invalid buffer number"
+msgstr "½w½Ä°Ï¸¹½X¿ù»~"
+
+#: if_tcl.c:464 if_tcl.c:931 if_tcl.c:1110
+msgid "not implemented yet"
+msgstr "©|¥¼¹ê§@"
+
+#: if_tcl.c:501
+msgid "unknown option"
+msgstr "¤£¥¿½Tªº¿ï¶µ"
+
+#. ???
+#: if_tcl.c:774
+msgid "cannot set line(s)"
+msgstr "¤£¯à³]©w¦æ"
+
+#: if_tcl.c:845
+msgid "mark not set"
+msgstr "¨S¦³³]©w¼Ð°O"
+
+#: if_tcl.c:851 if_tcl.c:1066
+#, c-format
+msgid "row %d column %d"
+msgstr "¦C %d ¦æ %d"
+
+#: if_tcl.c:881
+msgid "cannot insert/append line"
+msgstr "¤£¯à´¡¤J©Îªþ¥[¦¹¦æ"
+
+#: if_tcl.c:1268
+msgid "unknown flag: "
+msgstr "¿ù»~ªººX¼Ð: "
+
+#: if_tcl.c:1338
+msgid "unknown vimOption"
+msgstr "¤£¥¿½Tªº VIM ¿ï¶µ"
+
+#: if_tcl.c:1423
+msgid "keyboard interrupt"
+msgstr "Áä½L¤¤Â_"
+
+#: if_tcl.c:1428
+msgid "vim error"
+msgstr "vim ¿ù»~"
+
+#: if_tcl.c:1471
+msgid "cannot create buffer/window command: object is being deleted"
+msgstr "µLªk«Ø¥ß½w½Ä°Ï/µøµ¡©R¥O: ª«¥ó±N·|³Q§R°£"
+
+#: if_tcl.c:1545
+msgid ""
+"cannot register callback command: buffer/window is already being deleted"
+msgstr "µLªkµù¥U callback ©R¥O: ½w½Ä°Ï/µøµ¡¤w¸g³Q§R°£¤F"
+
+#. This should never happen. Famous last word?
+#: if_tcl.c:1562
+msgid ""
+"E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim."
+"org"
+msgstr "E280: TCL ÄY­«¿ù»~: reflist Äê±¼¤F!? ½Ð³ø§iµ¹ to vim-dev@vim.org"
+
+#: if_tcl.c:1563
+msgid "cannot register callback command: buffer/window reference not found"
+msgstr "µLªkµù¥U callback ©R¥O: §ä¤£¨ì½w½Ä°Ï/µøµ¡"
+
+#: if_tcl.c:1724
+msgid ""
+"E571: Sorry, this command is disabled: the Tcl library could not be loaded."
+msgstr ""
+"E571: ¦¹©R¥OµLªk¨Ï¥Î, ¦]¬°µLªk¸ü¤J Tcl µ{¦¡®w(Library)"
+
+#: if_tcl.c:1886
+msgid ""
+"E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"
+msgstr "E281: TCL ¿ù»~: µ²§ô½X¤£¬O¾ã¼Æ!? ½Ð³ø§iµ¹ to vim-dev@vim.org"
+
+#: if_tcl.c:2006
+msgid "cannot get line"
+msgstr "¤£¯à¨ú±o¦¹¦æ"
+
+#: if_xcmdsrv.c:215
+msgid "Unable to register a command server name"
+msgstr "µLªkµù¥U©R¥O¦øªA¾¹¦WºÙ"
+
+#: if_xcmdsrv.c:465
+msgid "E248: Failed to send command to the destination program"
+msgstr "E248: µLªk°e¥X©R¥O¨ì¥Øªº¦aµ{¦¡"
+
+#: if_xcmdsrv.c:735
+#, c-format
+msgid "E573: Invalid server id used: %s"
+msgstr "E573: ¤£¥¿½Tªº¦øªA¾¹ id : %s"
+
+#: if_xcmdsrv.c:1098
+msgid "E251: VIM instance registry property is badly formed. Deleted!"
+msgstr "E251: VIM ªº registry ³]©w¶µ¦³»~¡C¤w§R°£¡C"
+
+#: main.c:60
+msgid "Unknown option"
+msgstr "¤£¥¿½Tªº¿ï¶µ"
+
+#: main.c:62
+msgid "Too many edit arguments"
+msgstr "¤Ó¦h½s¿è°Ñ¼Æ"
+
+#: main.c:64
+msgid "Argument missing after"
+msgstr "¯Ê¤Ö¥²­nªº°Ñ¼Æ:"
+
+#: main.c:66
+msgid "Garbage after option"
+msgstr "µLªk¿ë»{¦¹¿ï¶µ«áªº©R¥O: "
+
+#: main.c:68
+msgid "Too many \"+command\" or \"-c command\" arguments"
+msgstr "¤Ó¦h \"+command\" ©Î \"-c command\" °Ñ¼Æ"
+
+#: main.c:70
+msgid "Invalid argument for"
+msgstr "¤£¥¿½Tªº°Ñ¼Æ: "
+
+#: main.c:469
+msgid "This Vim was not compiled with the diff feature."
+msgstr "±zªº Vim ½sĶ®É¨S¦³¥[¤J diff ªº¯à¤O"
+
+#: main.c:917
+msgid "Attempt to open script file again: \""
+msgstr "¸Õ¹Ï¦A¦¸¶}±Ò script ÀÉ: \""
+
+#: main.c:921 main.c:928 main.c:972 memline.c:3682 memline.c:3686
+#: version.c:857 version.c:862 version.c:867 version.c:872 version.c:877
+#: version.c:882 version.c:888 version.c:892 version.c:896 version.c:901
+#: version.c:908 version.c:916 version.c:922
+msgid "\"\n"
+msgstr "\"\n"
+
+#: main.c:926
+msgid "Cannot open for reading: \""
+msgstr "µLªk¶}±Ò¥HŪ¨ú: \""
+
+#: main.c:970
+msgid "Cannot open for script output: \""
+msgstr "µLªk¶}±Ò¬° script ¿é¥X: \""
+
+#: main.c:1104
+#, c-format
+msgid "%d files to edit\n"
+msgstr "ÁÙ¦³ %d ­ÓÀÉ®×µ¥«Ý½s¿è\n"
+
+#: main.c:1178
+msgid "Vim: Warning: Output is not to a terminal\n"
+msgstr "Vim: ª`·N: ¿é¥X¤£¬O²×ºÝ¾÷(¿Ã¹õ)\n"
+
+#: main.c:1180
+msgid "Vim: Warning: Input is not from a terminal\n"
+msgstr "Vim: ª`·N: ¿é¤J¤£¬O²×ºÝ¾÷(Áä½L)\n"
+
+#. just in case..
+#: main.c:1257
+msgid "pre-vimrc command line"
+msgstr "vimrc «e©R¥O¦C"
+
+#: main.c:1292
+#, c-format
+msgid "E282: Cannot read from \"%s\""
+msgstr "E282: µLªkŪ¨úÀÉ®× \"%s\""
+
+#: main.c:2313
+msgid ""
+"\n"
+"More info with: \"vim -h\"\n"
+msgstr ""
+"\n"
+"¬d¸ß§ó¦h¸ê°T½Ð°õ¦æ: \"vim -h\"\n"
+
+#: main.c:2346
+msgid "[file ..] edit specified file(s)"
+msgstr "[ÀÉ®× ..] ½s¿è«ü©wªºÀÉ®×"
+
+#: main.c:2347
+msgid "- read text from stdin"
+msgstr "- ±q¼Ð·Ç¿é¤J(stdin)Ū¨úÀÉ®×"
+
+#: main.c:2348
+msgid "-t tag edit file where tag is defined"
+msgstr "-t tag ½s¿è®É¨Ï¥Î«ü©wªº tag"
+
+#: main.c:2350
+msgid "-q [errorfile] edit file with first error"
+msgstr "-q [errorfile] ½s¿è®É¸ü¤J²Ä¤@­Ó¿ù»~"
+
+#: main.c:2359
+msgid ""
+"\n"
+"\n"
+"usage:"
+msgstr ""
+"\n"
+"\n"
+" ¥Îªk:"
+
+#: main.c:2362
+msgid " vim [arguments] "
+msgstr "vim [°Ñ¼Æ] "
+
+#: main.c:2366
+msgid ""
+"\n"
+" or:"
+msgstr ""
+"\n"
+" ©Î:"
+
+#: main.c:2369
+msgid ""
+"\n"
+"\n"
+"Arguments:\n"
+msgstr ""
+"\n"
+"\n"
+"°Ñ¼Æ:\n"
+
+#: main.c:2370
+msgid "--\t\t\tOnly file names after this"
+msgstr "--\t\t\t¥u¦³¦b³o¤§«áªºÀÉ®×"
+
+#: main.c:2372
+msgid "--literal\t\tDon't expand wildcards"
+msgstr "--literal\t\t¤£®i¶}¸U¥Î¦r¤¸"
+
+#: main.c:2375
+msgid "-register\t\tRegister this gvim for OLE"
+msgstr "-register\t\tµù¥U gvim ¨ì OLE"
+
+#: main.c:2376
+msgid "-unregister\t\tUnregister gvim for OLE"
+msgstr "-unregister\t\t¨ú®ø OLE ¤¤ªº gvim µù¥U"
+
+#: main.c:2379
+msgid "-g\t\t\tRun using GUI (like \"gvim\")"
+msgstr "-g\t\t\t¨Ï¥Î¹Ï§Î¬É­± (¦P \"gvim\")"
+
+#: main.c:2380
+msgid "-f or --nofork\tForeground: Don't fork when starting GUI"
+msgstr "-f ©Î --nofork\t«e´º: °_©l¹Ï§Î¬É­±®É¤£ fork"
+
+#: main.c:2382
+msgid "-v\t\t\tVi mode (like \"vi\")"
+msgstr "-v\t\t\tVi ¼Ò¦¡ (¦P \"vi\")"
+
+#: main.c:2383
+msgid "-e\t\t\tEx mode (like \"ex\")"
+msgstr "-e\t\t\tEx ¼Ò¦¡ (¦P \"ex\")"
+
+#: main.c:2384
+msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")"
+msgstr "-s\t\t\t¦wÀR (batch) ¼Ò¦¡ (¥u¯à»P \"ex\" ¤@°_¨Ï¥Î)"
+
+#: main.c:2386
+msgid "-d\t\t\tDiff mode (like \"vimdiff\")"
+msgstr "-d\t\t\tDiff ¼Ò¦¡ (¦P \"vimdiff\", ¥i¨³³t¤ñ¸û¨âÀɮפ£¦P³B)"
+
+#: main.c:2388
+msgid "-y\t\t\tEasy mode (like \"evim\", modeless)"
+msgstr "-y\t\t\t²©ö¼Ò¦¡ (¦P \"evim\", modeless)"
+
+#: main.c:2389
+msgid "-R\t\t\tReadonly mode (like \"view\")"
+msgstr "-R\t\t\t°ßŪ¼Ò¦¡ (¦P \"view\")"
+
+#: main.c:2390
+msgid "-Z\t\t\tRestricted mode (like \"rvim\")"
+msgstr "-Z\t\t\t­­¨î¼Ò¦¡ (¦P \"rvim\")"
+
+#: main.c:2391
+msgid "-m\t\t\tModifications (writing files) not allowed"
+msgstr "-m\t\t\t¤£¥i­×§ï (¼g¤JÀÉ®×)"
+
+#: main.c:2392
+msgid "-M\t\t\tModifications in text not allowed"
+msgstr "-M\t\t\t¤£¥i­×§ï¤å¦r"
+
+#: main.c:2393
+msgid "-b\t\t\tBinary mode"
+msgstr "-b\t\t\t¤G¶i¦ì¼Ò¦¡"
+
+#: main.c:2395
+msgid "-l\t\t\tLisp mode"
+msgstr "-l\t\t\tLisp ¼Ò¦¡"
+
+#: main.c:2397
+msgid "-C\t\t\tCompatible with Vi: 'compatible'"
+msgstr "-C\t\t\t'compatible' ¶Ç²Î Vi ¬Û®e¼Ò¦¡"
+
+#: main.c:2398
+msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'"
+msgstr "-N\t\t\t'nocompatible' ¤£§¹¥þ»P¶Ç²Î Vi ¬Û®e¡A¥i¨Ï¥Î Vim ¥[±j¯à¤O"
+
+#: main.c:2399
+msgid "-V[N]\t\tVerbose level"
+msgstr "-V[N]\t\tVerbose µ¥¯Å"
+
+#: main.c:2400
+msgid "-D\t\t\tDebugging mode"
+msgstr "-D\t\t\t°£¿ù¼Ò¦¡"
+
+#: main.c:2401
+msgid "-n\t\t\tNo swap file, use memory only"
+msgstr "-n\t\t\t¤£¨Ï¥Î¼È¦sÀÉ, ¥u¨Ï¥Î°O¾ÐÅé"
+
+#: main.c:2402
+msgid "-r\t\t\tList swap files and exit"
+msgstr "-r\t\t\t¦C¥X¼È¦sÀÉ«áÂ÷¶}"
+
+#: main.c:2403
+msgid "-r (with file name)\tRecover crashed session"
+msgstr "-r (¥[ÀɦW) \t­×´_¤W¦¸·l·´ªº¸ê®Æ(Recover crashed session)"
+
+#: main.c:2404
+msgid "-L\t\t\tSame as -r"
+msgstr "-L\t\t\t¦P -r"
+
+#: main.c:2406
+msgid "-f\t\t\tDon't use newcli to open window"
+msgstr "-f\t\t\t¤£¨Ï¥Î newcli ¨Ó¶}±Òµøµ¡"
+
+#: main.c:2407
+msgid "-dev <device>\t\tUse <device> for I/O"
+msgstr "-dev <device>\t\t¨Ï¥Î <device> °µ¿é¥X¤J"
+
+#: main.c:2410
+msgid "-H\t\t\tStart in Hebrew mode"
+msgstr "-H\t\t\t±Ò°Ê¬° Hebrew ¼Ò¦¡"
+
+#: main.c:2413
+msgid "-F\t\t\tStart in Farsi mode"
+msgstr "-F\t\t\t±Ò°Ê¬° Farsi ¼Ò¦¡"
+
+#: main.c:2415
+msgid "-T <terminal>\tSet terminal type to <terminal>"
+msgstr "-T <terminal>\t³]©w²×ºÝ¾÷¬° <terminal>"
+
+#: main.c:2416
+msgid "-u <vimrc>\t\tUse <vimrc> instead of any .vimrc"
+msgstr "-u <vimrc>\t\t¨Ï¥Î <vimrc> ¨ú¥N¥ô¦ó .vimrc"
+
+#: main.c:2418
+msgid "-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"
+msgstr "-U <gvimrc>\t\t¨Ï¥Î <gvimrc> ¨ú¥N¥ô¦ó .gvimrc"
+
+#: main.c:2420
+msgid "--noplugin\t\tDon't load plugin scripts"
+msgstr "--noplugin\t\t¤£¸ü¤J¥ô¦ó plugin"
+
+#: main.c:2421
+msgid "-o[N]\t\tOpen N windows (default: one for each file)"
+msgstr "-o[N]\t\t¶}±Ò N ­Óµøµ¡ (¹w³]¬O¨C­ÓÀɮפ@­Ó)"
+
+#: main.c:2422
+msgid "-O[N]\t\tLike -o but split vertically"
+msgstr "-O[N]\t\t¦P -o ¦ý¨Ï¥Î««ª½¤À³Î"
+
+#: main.c:2423
+msgid "+\t\t\tStart at end of file"
+msgstr "+\t\t\t±Ò°Ê«á¸õ¨ìÀÉ®×µ²§À"
+
+#: main.c:2424
+msgid "+<lnum>\t\tStart at line <lnum>"
+msgstr "+<lnum>\t\t±Ò°Ê«á¸õ¨ì²Ä <lnum> ¦æ"
+
+#: main.c:2426
+msgid "--cmd <command>\tExecute <command> before loading any vimrc file"
+msgstr "--cmd <command>\t¸ü¤J¥ô¦ó vimrc «e°õ¦æ <command>"
+
+#: main.c:2428
+msgid "-c <command>\t\tExecute <command> after loading the first file"
+msgstr "-c <command>\t\t¸ü¤J²Ä¤@­ÓÀɮ׫á°õ¦æ <command>"
+
+#: main.c:2429
+msgid "-S <session>\t\tSource file <session> after loading the first file"
+msgstr "-S <session>\t\t¸ü¤J²Ä¤@­ÓÀɮ׫á¸ü¤J Session ÀÉ <session>"
+
+#: main.c:2430
+msgid "-s <scriptin>\tRead Normal mode commands from file <scriptin>"
+msgstr "-s <scriptin>\t±q <scriptin> Ū¤J¤@¯ë¼Ò¦¡©R¥O"
+
+#: main.c:2431
+msgid "-w <scriptout>\tAppend all typed commands to file <scriptout>"
+msgstr "-w <scriptout>\t¹ïÀÉ®× <scriptout> ªþ¥[(append)©Ò¦³¿é¤Jªº©R¥O"
+
+#: main.c:2432
+msgid "-W <scriptout>\tWrite all typed commands to file <scriptout>"
+msgstr "-W <scriptout>\t¹ïÀÉ®× <scriptout> ¼g¤J©Ò¦³¿é¤Jªº©R¥O"
+
+#: main.c:2434
+msgid "-x\t\t\tEdit encrypted files"
+msgstr "-x\t\t\t½s¿è½s½X¹LªºÀÉ®×"
+
+#: main.c:2438
+msgid "-display <display>\tConnect vim to this particular X-server"
+msgstr "-display <display>\t±N vim »P«ü©wªº X-server ³s½u"
+
+#: main.c:2440
+msgid "-X\t\t\tDo not connect to X server"
+msgstr "-X\t\t\t¤£­n³s½u¨ì X Server"
+
+#: main.c:2443
+msgid "--remote <files>\tEdit <files> in a Vim server if possible"
+msgstr "--remote <files>\t½s¿è Vim ¦øªA¾¹¤Wªº <files> «áÂ÷¶}"
+
+#: main.c:2444
+msgid "--remote-silent <files> Same, don't complain if there is no server"
+msgstr "--remote-silent <files> ¬Û¦P¡A¦ý¨S¦³¦øªA¾¹®É¤£Äµ§i"
+
+#: main.c:2445
+msgid ""
+"--remote-wait <files> As --remote but wait for files to have been edited"
+msgstr "--remote-wait <files> ¦P --remote, ¦ý·|µ¥­ÔÀɮק¹¦¨½s¿è"
+
+#: main.c:2446
+msgid ""
+"--remote-wait-silent <files> Same, don't complain if there is no server"
+msgstr ""
+"--remote-wait-silent <files> ¬Û¦P¡A¦ý¨S¦øªA¾¹®É¤£Äµ§i"
+
+#: main.c:2447
+msgid "--remote-send <keys>\tSend <keys> to a Vim server and exit"
+msgstr "--remote-send <keys>\t°e¥X <keys> ¨ì Vim ¦øªA¾¹¨ÃÂ÷¶}"
+
+#: main.c:2448
+msgid "--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"
+msgstr "--remote-expr <expr>\t¦b¦øªA¾¹¤W°õ¦æ <expr> ¨Ã¦L¥Xµ²ªG"
+
+#: main.c:2449
+msgid "--serverlist\t\tList available Vim server names and exit"
+msgstr "--serverlist\t\t¦C¥X¥i¥Îªº Vim ¦øªA¾¹¦WºÙ¨ÃÂ÷¶}"
+
+#: main.c:2450
+msgid "--servername <name>\tSend to/become the Vim server <name>"
+msgstr "--servername <name>\t°e¦Ü/¦¨¬° Vim ¦øªA¾¹ <name>"
+
+#: main.c:2453
+msgid "-i <viminfo>\t\tUse <viminfo> instead of .viminfo"
+msgstr "-i <viminfo>\t\t¨Ï¥Î <viminfo> ¦Ó«D .viminfo"
+
+#: main.c:2455
+msgid "-h or --help\tPrint Help (this message) and exit"
+msgstr "-h ©Î --help\t¦L¥X»¡©ú(¤]´N¬O¥»°T®§)«áÂ÷¶}"
+
+#: main.c:2456
+msgid "--version\t\tPrint version information and exit"
+msgstr "--version\t\t¦L¥Xª©¥»¸ê°T«áÂ÷¶}"
+
+#: main.c:2460
+msgid ""
+"\n"
+"Arguments recognised by gvim (Motif version):\n"
+msgstr ""
+"\n"
+"gvim »{±oªº°Ñ¼Æ (Motif ª©):\n"
+
+#: main.c:2463
+msgid ""
+"\n"
+"Arguments recognised by gvim (Athena version):\n"
+msgstr ""
+"\n"
+"gvim »{±oªº°Ñ¼Æ (Athena ª©):\n"
+
+#: main.c:2466
+msgid "-display <display>\tRun vim on <display>"
+msgstr "-display <display>\t¦bµøµ¡ <display> °õ¦æ vim"
+
+#: main.c:2467
+msgid "-iconic\t\tStart vim iconified"
+msgstr "-iconic\t\t±Ò°Ê«á¹Ï¥Ü¤Æ(iconified)"
+
+#: main.c:2469
+msgid "-name <name>\t\tUse resource as if vim was <name>"
+msgstr "-name <name>\t\tŪ¨ú Resource ®É§â vim ªº¦WºÙµø¬° <name>"
+
+#: main.c:2470
+msgid "\t\t\t (Unimplemented)\n"
+msgstr "\t\t\t (©|¥¼¹ê§@)\n"
+
+#: main.c:2472
+msgid "-background <color>\tUse <color> for the background (also: -bg)"
+msgstr "-background <color>\t³]©w <color> ¬°­I´º¦â (¤]¥i¥Î -bg)"
+
+#: main.c:2473
+msgid "-foreground <color>\tUse <color> for normal text (also: -fg)"
+msgstr "-foreground <color>\t³]©w <color> ¬°¤@¯ë¤å¦rÃC¦â (¤]¥i¥Î -fg)"
+
+#: main.c:2474 main.c:2494
+msgid "-font <font>\t\tUse <font> for normal text (also: -fn)"
+msgstr "-font <font>\t¨Ï¥Î <font> ¬°¤@¯ë¦r«¬ (¤]¥i¥Î -fn)"
+
+#: main.c:2475
+msgid "-boldfont <font>\tUse <font> for bold text"
+msgstr "-boldfont <font>\t¨Ï¥Î <font> ¬°²ÊÅé¦r«¬"
+
+#: main.c:2476
+msgid "-italicfont <font>\tUse <font> for italic text"
+msgstr "-italicfont <font>\t¨Ï¥Î <font> ¬°±×Åé¦r«¬"
+
+#: main.c:2477 main.c:2495
+msgid "-geometry <geom>\tUse <geom> for initial geometry (also: -geom)"
+msgstr "-geometry <geom>\t¨Ï¥Î<geom>¬°°_©l¦ì¸m (¤]¥i¥Î -geom)"
+
+#: main.c:2478
+msgid "-borderwidth <width>\tUse a border width of <width> (also: -bw)"
+msgstr "-borderwidth <width>\t¨Ï¥Î¼e«×¬° <width> ªºÃä®Ø (¤]¥i¥Î -bw)"
+
+#: main.c:2479
+msgid "-scrollbarwidth <width> Use a scrollbar width of <width> (also: -sw)"
+msgstr "-scrollbarwidth <width> ³]©w±²°Ê¶b¼e«×¬° <width> (¤]¥i¥Î -sw)"
+
+#: main.c:2481
+msgid "-menuheight <height>\tUse a menu bar height of <height> (also: -mh)"
+msgstr "-menuheight <height>\t³]©w¿ï³æ¦Cªº°ª«×¬° <height> (¤]¥i¥Î -mh)"
+
+#: main.c:2483 main.c:2496
+msgid "-reverse\t\tUse reverse video (also: -rv)"
+msgstr "-reverse\t\t¨Ï¥Î¤Ï¬ÛÅã¥Ü (¤]¥i¥Î -rv)"
+
+#: main.c:2484
+msgid "+reverse\t\tDon't use reverse video (also: +rv)"
+msgstr "+reverse\t\t¤£¨Ï¥Î¤Ï¬ÛÅã¥Ü (¤]¥i¥Î +rv)"
+
+#: main.c:2485
+msgid "-xrm <resource>\tSet the specified resource"
+msgstr "-xrm <resource>\t³]©w«ü©wªº resource"
+
+#: main.c:2488
+msgid ""
+"\n"
+"Arguments recognised by gvim (RISC OS version):\n"
+msgstr ""
+"\n"
+"gvim »{±oªº°Ñ¼Æ (RISC OS ª©):\n"
+
+#: main.c:2489
+msgid "--columns <number>\tInitial width of window in columns"
+msgstr "--columns <number>\tµøµ¡ªì©l¤Æ¼e«×"
+
+#: main.c:2490
+msgid "--rows <number>\tInitial height of window in rows"
+msgstr "--rows <number>\tµøµ¡ªì©l¤Æ°ª«×"
+
+#: main.c:2493
+msgid ""
+"\n"
+"Arguments recognised by gvim (GTK+ version):\n"
+msgstr ""
+"\n"
+"gvim »{±oªº°Ñ¼Æ (GTK+ ª©):\n"
+
+#: main.c:2497
+msgid "-display <display>\tRun vim on <display> (also: --display)"
+msgstr "-display <display>\t¦b <display> °õ¦æ vim (¤]¥i¥Î --display)"
+
+#: main.c:2499
+msgid "--role <role>\tSet a unique role to identify the main window"
+msgstr "--role <role>\t³]©w¿W¯Sªº¨¤¦â(role)¥H°Ï¤À¥Dµøµ¡"
+
+#: main.c:2501
+msgid "--socketid <xid>\tOpen Vim inside another GTK widget"
+msgstr "--socketid <xid>\t¦b¥t¤@­Ó GTK widget ¤º¶}±Ò Vim"
+
+#: main.c:2503
+msgid "--help\t\tShow Gnome arguments"
+msgstr "--help\t\tÅã¥Ü Gnome ¬ÛÃö°Ñ¼Æ"
+
+#: main.c:2735
+msgid "No display"
+msgstr "µLÅã¥Ü"
+
+#. Failed to send, abort.
+#: main.c:2750
+msgid ": Send failed.\n"
+msgstr ": ¶Ç°e¥¢±Ñ¡C\n"
+
+#. Let vim start normally.
+#: main.c:2756
+msgid ": Send failed. Trying to execute locally\n"
+msgstr ": °e¥X¥¢±Ñ¡C¸Õ¹Ï¦b¥»¦a°õ¦æ\n"
+
+#: main.c:2794 main.c:2815
+#, c-format
+msgid "%d of %d edited"
+msgstr "¤w½s¿è %d/%d ­ÓÀÉ®×"
+
+#: main.c:2837
+msgid "No display: Send expression failed.\n"
+msgstr "µL Display: µLªk¶Ç°e¹Bºâ¦¡¡C\n"
+
+#: main.c:2849
+msgid ": Send expression failed.\n"
+msgstr ": µLªk¶Ç°e¹Bºâ¦¡¡C\n"
+
+#: mark.c:656
+msgid "No marks set"
+msgstr "¨S¦³³]©w¼Ð°O (mark)"
+
+#: mark.c:658
+#, c-format
+msgid "E283: No marks matching \"%s\""
+msgstr "E283: §ä¤£¨ì²Å¦X \"%s\" ªº¼Ð°O(mark)"
+
+#. Highlight title
+#: mark.c:669
+msgid ""
+"\n"
+"mark line col file/text"
+msgstr ""
+"\n"
+"¼Ð°O ¦æ¸¹ Äæ ÀÉ®×/¤å¦r"
+
+#. Highlight title
+#: mark.c:707
+msgid ""
+"\n"
+" jump line col file/text"
+msgstr ""
+"\n"
+" jump ¦æ¸¹ Äæ ÀÉ®×/¤å¦r"
+
+#: mark.c:1072
+msgid ""
+"\n"
+"# File marks:\n"
+msgstr ""
+"\n"
+"# Àɮ׼аO:\n"
+
+#. Write the jumplist with -'
+#: mark.c:1107
+msgid ""
+"\n"
+"# Jumplist (newest first):\n"
+msgstr ""
+"\n"
+"# Jumplist (¥Ñ·s¨ìÂÂ):\n"
+
+#: mark.c:1202
+msgid ""
+"\n"
+"# History of marks within files (newest to oldest):\n"
+msgstr ""
+"\n"
+"# Àɮפº Mark °O¿ý (¥Ñ·s¨ìÂÂ):\n"
+
+#: mark.c:1285
+msgid "Missing '>'"
+msgstr "¯Ê¤Ö¹ïÀ³ªº '>'"
+
+#: mbyte.c:403
+msgid "E543: Not a valid codepage"
+msgstr "E543: ¤£¥¿½Tªº codepage"
+
+#: mbyte.c:3879
+msgid "E284: Cannot set IC values"
+msgstr "E284: ¤£¯à³]©w IC ¼Æ­È"
+
+#: mbyte.c:4031
+msgid "E285: Failed to create input context"
+msgstr "E285: µLªk«Ø¥ß input context"
+
+#: mbyte.c:4178
+msgid "E286: Failed to open input method"
+msgstr "E286: µLªk¶}±Ò¿é¤Jªk"
+
+#: mbyte.c:4189
+msgid "E287: Warning: Could not set destroy callback to IM"
+msgstr "E287: ĵ§i: µLªk²¾°£ IM ªº callback"
+
+#: mbyte.c:4195
+msgid "E288: input method doesn't support any style"
+msgstr "E288: ¿é¤Jªk¤£¤ä´©¥ô¦ó style"
+
+#: mbyte.c:4252
+msgid "E289: input method doesn't support my preedit type"
+msgstr "E289: ¿é¤Jªk¤£¤ä´©¥ô¦ó style"
+
+#: mbyte.c:4326
+msgid "E290: over-the-spot style requires fontset"
+msgstr "E290: over-the-spot »Ý­n¦r«¬¶°(Fontset)"
+
+#: mbyte.c:4358
+msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled"
+msgstr "E291: §Aªº GTK+ ¤ñ 1.2.3 ÁÙ¡CµLªk¨Ï¥Îª¬ºA°Ï¡C"
+
+#: mbyte.c:4637
+msgid "E292: Input Method Server is not running"
+msgstr "E292: ¨S¦³°õ¦æ¤¤ªº¿é¤JªkºÞ²zµ{¦¡(Input Method Server)"
+
+#: memfile.c:488
+msgid "E293: block was not locked"
+msgstr "E293: °Ï¶ô¥¼³QÂê©w"
+
+#: memfile.c:989
+msgid "E294: Seek error in swap file read"
+msgstr "E294: ¼È¦sÀÉŪ¨ú¿ù»~"
+
+#: memfile.c:994
+msgid "E295: Read error in swap file"
+msgstr "E295: ¼È¦sÀÉŪ¨ú¿ù»~"
+
+#: memfile.c:1046
+msgid "E296: Seek error in swap file write"
+msgstr "E296: ¼È¦sÀɼg¤J¿ù»~"
+
+#: memfile.c:1064
+msgid "E297: Write error in swap file"
+msgstr "E297: ¼È¦sÀɼg¤J¿ù»~"
+
+#: memfile.c:1261
+msgid "E300: Swap file already exists (symlink attack?)"
+msgstr "E300: ¼È¦sÀɤw¸g¦s¦b! (¤p¤ß²Å¸¹³sµ²ªº¦w¥þº|¬}!?)"
+
+#: memline.c:275
+msgid "E298: Didn't get block nr 0?"
+msgstr "E298: §ä¤£¨ì°Ï¶ô 0?"
+
+#: memline.c:315
+msgid "E298: Didn't get block nr 1?"
+msgstr "E298: §ä¤£¨ì°Ï¶ô 1?"
+
+#: memline.c:333
+msgid "E298: Didn't get block nr 2?"
+msgstr "E298: §ä¤£¨ì°Ï¶ô 2?"
+
+#. could not (re)open the swap file, what can we do????
+#: memline.c:443
+msgid "E301: Oops, lost the swap file!!!"
+msgstr "E301: ¾¾¾¾, ¼È¦sÀɤ£¨£¤F!!!"
+
+#: memline.c:448
+msgid "E302: Could not rename swap file"
+msgstr "E302: µLªk§ïÅܼȦsÀɪº¦WºÙ"
+
+#: memline.c:518
+#, c-format
+msgid "E303: Unable to open swap file for \"%s\", recovery impossible"
+msgstr "E303: µLªk¶}±Ò¼È¦sÀÉ \"%s\", ¤£¥i¯à­×´_¤F"
+
+#: memline.c:617
+msgid "E304: ml_timestamp: Didn't get block 0??"
+msgstr "E304: ml_timestamp: §ä¤£¨ì°Ï¶ô 0??"
+
+#: memline.c:757
+#, c-format
+msgid "E305: No swap file found for %s"
+msgstr "E305: §ä¤£¨ì %s ªº¼È¦sÀÉ"
+
+#: memline.c:767
+msgid "Enter number of swap file to use (0 to quit): "
+msgstr "½Ð¿ï¾Ü§A­n¨Ï¥Îªº¼È¦sÀÉ («ö0 Â÷¶}): "
+
+#: memline.c:812
+#, c-format
+msgid "E306: Cannot open %s"
+msgstr "E306: µLªk¶}±Ò %s"
+
+#: memline.c:834
+msgid "Unable to read block 0 from "
+msgstr "µLªkŪ¨ú°Ï¶ô 0:"
+
+#: memline.c:837
+msgid ""
+"\n"
+"Maybe no changes were made or Vim did not update the swap file."
+msgstr ""
+"\n"
+"¥i¯à¬O§A¨S°µ¹L¥ô¦ó­×§ï©Î¬O Vim ÁÙ¨Ó¤£¤Î§ó·s¼È¦sÀÉ."
+
+#: memline.c:847 memline.c:864
+msgid " cannot be used with this version of Vim.\n"
+msgstr " µLªk¦b¥»ª©¥»ªº Vim ¤¤¨Ï¥Î.\n"
+
+#: memline.c:849
+msgid "Use Vim version 3.0.\n"
+msgstr "¨Ï¥Î Vim 3.0¡C\n"
+
+#: memline.c:855
+#, c-format
+msgid "E307: %s does not look like a Vim swap file"
+msgstr "E307: %s ¬Ý°_¨Ó¤£¹³¬O Vim ¼È¦sÀÉ"
+
+#: memline.c:868
+msgid " cannot be used on this computer.\n"
+msgstr " µLªk¦b³o»O¹q¸£¤W¨Ï¥Î.\n"
+
+#: memline.c:870
+msgid "The file was created on "
+msgstr "¥»Àɮ׫إߩó "
+
+#: memline.c:874
+msgid ""
+",\n"
+"or the file has been damaged."
+msgstr ""
+",\n"
+"©Î¬O³oÀɮפw¸g·l·´¡C"
+
+#: memline.c:903
+#, c-format
+msgid "Using swap file \"%s\""
+msgstr "¨Ï¥Î¼È¦sÀÉ \"%s\""
+
+#: memline.c:909
+#, c-format
+msgid "Original file \"%s\""
+msgstr "­ì©lÀÉ \"%s\""
+
+#: memline.c:922
+msgid "E308: Warning: Original file may have been changed"
+msgstr "E308: ĵ§i: ­ì©lÀÉ®×¥i¯à¤w¸g­×§ï¹L¤F"
+
+#: memline.c:963
+#, c-format
+msgid "E309: Unable to read block 1 from %s"
+msgstr "E309: µLªk±q %s Ū¨ú°Ï¶ô 1"
+
+#: memline.c:967
+msgid "???MANY LINES MISSING"
+msgstr "???¯Ê¤Ö¤Ó¦h¦æ"
+
+#: memline.c:983
+msgid "???LINE COUNT WRONG"
+msgstr "???¦æ¸¹¿ù»~"
+
+#: memline.c:990
+msgid "???EMPTY BLOCK"
+msgstr "???ªÅªº BLOCK"
+
+#: memline.c:1016
+msgid "???LINES MISSING"
+msgstr "???§ä¤£¨ì¤@¨Ç¦æ"
+
+#: memline.c:1048
+#, c-format
+msgid "E310: Block 1 ID wrong (%s not a .swp file?)"
+msgstr "E310: °Ï¶ô 1 ID ¿ù»~ (%s ¤£¬O¼È¦sÀÉ?)"
+
+#: memline.c:1053
+msgid "???BLOCK MISSING"
+msgstr "???§ä¤£¨ìBLOCK"
+
+#: memline.c:1069
+msgid "??? from here until ???END lines may be messed up"
+msgstr "??? ±q³o¸Ì¨ì ???END ªº¤º®e¥i¯à¦³°ÝÃD"
+
+#: memline.c:1085
+msgid "??? from here until ???END lines may have been inserted/deleted"
+msgstr "??? ±q³o¸Ì¨ì ???END ªº¤º®e¥i¯à³Q§R°£/´¡¤J¹L"
+
+# do not translate
+#: memline.c:1105
+msgid "???END"
+msgstr "???END"
+
+#: memline.c:1131
+msgid "E311: Recovery Interrupted"
+msgstr "E311: ­×´_¤w¤¤Â_"
+
+#: memline.c:1133
+msgid ""
+"E312: Errors detected while recovering; look for lines starting with ???"
+msgstr "E312: ­×´_®Éµo¥Í¿ù»~; ½Ðª`·N¶}ÀY¬° ??? ªº¦æ"
+
+#: memline.c:1136
+msgid "Recovery completed. You should check if everything is OK."
+msgstr "´_­ì§¹¦¨. ½Ð½T©w¤@¤Á¥¿±`."
+
+#: memline.c:1137
+msgid ""
+"\n"
+"(You might want to write out this file under another name\n"
+msgstr ""
+"\n"
+"(§A¥i¯à·|·Q­n§â³o­ÓÀÉ®×¥t¦s§OªºÀɦW¡A\n"
+
+#: memline.c:1138
+msgid "and run diff with the original file to check for changes)\n"
+msgstr "¦A°õ¦æ diff »P­ìÀɮפñ¸û¥HÀˬd¬O§_¦³§ïÅÜ)\n"
+
+#: memline.c:1139
+msgid ""
+"Delete the .swp file afterwards.\n"
+"\n"
+msgstr ""
+"(D)ª½±µ§R°£ .swp ¼È¦sÀÉ\n"
+"\n"
+
+#. use msg() to start the scrolling properly
+#: memline.c:1195
+msgid "Swap files found:"
+msgstr "§ä¨ì¥H¤Uªº¼È¦sÀÉ:"
+
+#: memline.c:1373
+msgid " In current directory:\n"
+msgstr " ¦b¥Ø«eªº¥Ø¿ý:\n"
+
+#: memline.c:1375
+msgid " Using specified name:\n"
+msgstr " Using specified name:\n"
+
+#: memline.c:1379
+msgid " In directory "
+msgstr " ¦b¥Ø¿ý "
+
+#: memline.c:1397
+msgid " -- none --\n"
+msgstr " -- µL --\n"
+
+#: memline.c:1469
+msgid " owned by: "
+msgstr " ¾Ö¦³ªÌ: "
+
+#: memline.c:1471
+msgid " dated: "
+msgstr " ¤é´Á: "
+
+#: memline.c:1475 memline.c:3689
+msgid " dated: "
+msgstr " ¤é´Á: "
+
+#: memline.c:1491
+msgid " [from Vim version 3.0]"
+msgstr " [±q Vim ª©¥» 3.0]"
+
+#: memline.c:1495
+msgid " [does not look like a Vim swap file]"
+msgstr " [¤£¹³ Vim ªº¼È¦sÀÉ]"
+
+#: memline.c:1499
+msgid " file name: "
+msgstr " ÀɦW: "
+
+#: memline.c:1505
+msgid ""
+"\n"
+" modified: "
+msgstr ""
+"\n"
+" ­×§ï¹L: "
+
+#: memline.c:1506
+msgid "YES"
+msgstr "¬O"
+
+#: memline.c:1506
+msgid "no"
+msgstr "§_"
+
+#: memline.c:1510
+msgid ""
+"\n"
+" user name: "
+msgstr ""
+"\n"
+" ¨Ï¥ÎªÌ: "
+
+#: memline.c:1517
+msgid " host name: "
+msgstr " ¥D¾÷¦WºÙ: "
+
+#: memline.c:1519
+msgid ""
+"\n"
+" host name: "
+msgstr ""
+"\n"
+" ¥D¾÷¦WºÙ: "
+
+#: memline.c:1525
+msgid ""
+"\n"
+" process ID: "
+msgstr ""
+"\n"
+" process ID: "
+
+#: memline.c:1531
+msgid " (still running)"
+msgstr " (°õ¦æ¤¤)"
+
+#: memline.c:1543
+msgid ""
+"\n"
+" [not usable with this version of Vim]"
+msgstr ""
+"\n"
+" [µLªk¦b¥»ª©¥»ªº Vim ¤W¨Ï¥Î]"
+
+#: memline.c:1546
+msgid ""
+"\n"
+" [not usable on this computer]"
+msgstr ""
+"\n"
+" [µLªk¦b¥»¹q¸£¤W¨Ï¥Î]"
+
+#: memline.c:1551
+msgid " [cannot be read]"
+msgstr " [µLªkŪ¨ú]"
+
+#: memline.c:1555
+msgid " [cannot be opened]"
+msgstr " [µLªk¶}±Ò]"
+
+#: memline.c:1745
+msgid "E313: Cannot preserve, there is no swap file"
+msgstr "E313: µLªk«O¯d, ¤£¨Ï¥Î¼È¦sÀÉ"
+
+#: memline.c:1798
+msgid "File preserved"
+msgstr "Àɮפw«O¯d"
+
+#: memline.c:1800
+msgid "E314: Preserve failed"
+msgstr "E314: «O¯d¥¢±Ñ"
+
+#: memline.c:1871
+#, c-format
+msgid "E315: ml_get: invalid lnum: %ld"
+msgstr "E315: ml_get: ¿ù»~ªº lnum: %ld"
+
+#: memline.c:1897
+#, c-format
+msgid "E316: ml_get: cannot find line %ld"
+msgstr "E316: ml_get: §ä¤£¨ì²Ä %ld ¦æ"
+
+#: memline.c:2287
+msgid "E317: pointer block id wrong 3"
+msgstr "E317: «ü¼Ð°Ï¶ô id ¿ù»~ 3"
+
+#: memline.c:2367
+msgid "stack_idx should be 0"
+msgstr "stack_idx À³¸Ó¬O 0"
+
+#: memline.c:2429
+msgid "E318: Updated too many blocks?"
+msgstr "E318: §ó·s¤Ó¦h°Ï¶ô?"
+
+#: memline.c:2611
+msgid "E317: pointer block id wrong 4"
+msgstr "E317: «ü¼Ð°Ï¶ô id ¿ù»~ 4"
+
+#: memline.c:2638
+msgid "deleted block 1?"
+msgstr "§R°£°Ï¶ô 1?"
+
+#: memline.c:2838
+#, c-format
+msgid "E320: Cannot find line %ld"
+msgstr "E320: §ä¤£¨ì²Ä %ld ¦æ"
+
+#: memline.c:3081
+msgid "E317: pointer block id wrong"
+msgstr "E317: «ü¼Ð°Ï¶ô id ¿ù»~"
+
+#: memline.c:3097
+msgid "pe_line_count is zero"
+msgstr "pe_line_count ¬°¹s"
+
+#: memline.c:3126
+#, c-format
+msgid "E322: line number out of range: %ld past the end"
+msgstr "E322: ¦æ¸¹¶W¥X½d³ò: %ld ¶W¹Lµ²§À"
+
+#: memline.c:3130
+#, c-format
+msgid "E323: line count wrong in block %ld"
+msgstr "E323: °Ï¶ô %ld ¦æ¼Æ¿ù»~"
+
+#: memline.c:3179
+msgid "Stack size increases"
+msgstr "°ïÅ|¤j¤p¼W¥["
+
+#: memline.c:3225
+msgid "E317: pointer block id wrong 2"
+msgstr "E317: «ü¼Ð°Ï¶ô id ¿ù 2"
+
+#: memline.c:3679
+msgid "E325: ATTENTION"
+msgstr "E325: ª`·N"
+
+#: memline.c:3680
+msgid ""
+"\n"
+"Found a swap file by the name \""
+msgstr ""
+"\n"
+"§ä¨ì¼È¦sÀÉ \""
+
+#: memline.c:3684
+msgid "While opening file \""
+msgstr "¦b¶}±ÒÀÉ®× \""
+
+#: memline.c:3693
+msgid " NEWER than swap file!\n"
+msgstr " ¤ñ¼È¦sÀɧó·s!\n"
+
+#. Some of these messages are long to allow translation to
+#. * other languages.
+#: memline.c:3697
+msgid ""
+"\n"
+"(1) Another program may be editing the same file.\n"
+" If this is the case, be careful not to end up with two\n"
+" different instances of the same file when making changes.\n"
+msgstr ""
+"\n"
+"(1) ¥i¯à¦³¥t¤@­Óµ{¦¡¤]¦b½s¿è¦P¤@­ÓÀÉ®×.\n"
+" ¦pªG¬O³o¼Ë¡A½Ð¤p¤ß¤£­n¨âÃä¤@°_¼g¤J¡A¤£µM§Aªº§V¤O³£·|­t½Ñ¬y¤ô¡C\n"
+
+#: memline.c:3698
+msgid " Quit, or continue with caution.\n"
+msgstr " Â÷¶}¡A©Î¬OÄ~Äò½s¿è¡C\n"
+
+#: memline.c:3699
+msgid ""
+"\n"
+"(2) An edit session for this file crashed.\n"
+msgstr ""
+"\n"
+"(2) «e¦¸½s¿è¦¹Àɮɷí¾÷\n"
+
+#: memline.c:3700
+msgid " If this is the case, use \":recover\" or \"vim -r "
+msgstr " ¦pªG¬O³o¼Ë, ½Ð¥Î \":recover\" ©Î \"vim -r"
+
+#: memline.c:3702
+msgid ""
+"\"\n"
+" to recover the changes (see \":help recovery\").\n"
+msgstr ""
+"\"\n"
+" ¨Ó±Ï¦^­×§ï¸ê®Æ (¶i¤@¨B»¡©ú½Ð¬Ý \":help recovery\").\n"
+
+#: memline.c:3703
+msgid " If you did this already, delete the swap file \""
+msgstr " ¦pªG¸Ó±Ïªº³£¤w¸g±Ï¤F, ½Ðª½±µ§R°£¦¹¼È¦sÀÉ \""
+
+#: memline.c:3705
+msgid ""
+"\"\n"
+" to avoid this message.\n"
+msgstr ""
+"\"\n"
+" ¥HÁקK¦A¬Ý¨ì¦¹°T®§.\n"
+
+#: memline.c:3719 memline.c:3723
+msgid "Swap file \""
+msgstr "¼È¦sÀÉ \""
+
+#: memline.c:3720 memline.c:3726
+msgid "\" already exists!"
+msgstr "\" ¤w¸g¦s¦b¤F!"
+
+#: memline.c:3729
+msgid "VIM - ATTENTION"
+msgstr "VIM - ª`·N"
+
+#: memline.c:3731
+msgid "Swap file already exists!"
+msgstr "¼È¦sÀɤw¸g¦s¦b!"
+
+#: memline.c:3735
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit"
+msgstr ""
+"¥H°ßŪ¤è¦¡¶}±Ò(&O)\n"
+"ª½±µ½s¿è(&E)\n"
+"­×´_(&R)\n"
+"Â÷¶}(&Q)"
+
+#: memline.c:3737
+msgid ""
+"&Open Read-Only\n"
+"&Edit anyway\n"
+"&Recover\n"
+"&Quit\n"
+"&Delete it"
+msgstr ""
+"¥H°ßŪ¤è¦¡¶}±Ò(&O)\n"
+"ª½±µ½s¿è(&E)\n"
+"­×´_(&R)\n"
+"Â÷¶}(&Q)\n"
+"§R°£¼È¦sÀÉ(&D)"
+
+#: memline.c:3790
+msgid "E326: Too many swap files found"
+msgstr "E326: §ä¨ì¤Ó¦h¼È¦sÀÉ"
+
+#: menu.c:64
+msgid "E327: Part of menu-item path is not sub-menu"
+msgstr "E327: ³¡¥÷¿ï¶µ¸ô®|¤£¬O¤l¿ï³æ"
+
+#: menu.c:65
+msgid "E328: Menu only exists in another mode"
+msgstr "E328: ¿ï³æ¥u¯à¦b¨ä¥¦¼Ò¦¡¤¤¨Ï¥Î"
+
+#: menu.c:66
+msgid "E329: No menu of that name"
+msgstr "E329: ¨S¦³¨º¼Ëªº¿ï³æ"
+
+#: menu.c:509
+msgid "E330: Menu path must not lead to a sub-menu"
+msgstr "E330: ¿ï³æ¸ô®|¤£¯à«ü¦V¤l¿ï³æ"
+
+#: menu.c:548
+msgid "E331: Must not add menu items directly to menu bar"
+msgstr "E331: ¤£¯àª½±µ§â¿ï¶µ¥[¨ì¿ï³æ¦C¤¤"
+
+#: menu.c:554
+msgid "E332: Separator cannot be part of a menu path"
+msgstr "E332: ¤À¹j½u¤£¯à¬O¿ï³æ¸ô®|ªº¤@³¡¥÷"
+
+#. Now we have found the matching menu, and we list the mappings
+#. Highlight title
+#: menu.c:1079
+msgid ""
+"\n"
+"--- Menus ---"
+msgstr ""
+"\n"
+"--- ¿ï³æ ---"
+
+#: menu.c:1996
+msgid "Tear off this menu"
+msgstr "¤Á¤U¦¹¿ï³æ"
+
+#: menu.c:2061
+msgid "E333: Menu path must lead to a menu item"
+msgstr "E333: ¿ï³æ¸ô®|¥²»Ý«ü¦V¤@­Ó¿ï¶µ"
+
+#: menu.c:2081
+#, c-format
+msgid "E334: Menu not found: %s"
+msgstr "E334: [¿ï³æ] §ä¤£¨ì %s"
+
+#: menu.c:2150
+#, c-format
+msgid "E335: Menu not defined for %s mode"
+msgstr "E335: %s ¼Ò¦¡¥¼©w¸q¿ï³æ"
+
+#: menu.c:2188
+msgid "E336: Menu path must lead to a sub-menu"
+msgstr "E336: ¿ï³æ¸ô®|¥²»Ý«ü¦V¤l¿ï³æ"
+
+#: menu.c:2209
+msgid "E337: Menu not found - check menu names"
+msgstr "E337: §ä¤£¨ì¿ï³æ - ½ÐÀˬd¿ï³æ¦WºÙ"
+
+#: message.c:509
+#, c-format
+msgid "Error detected while processing %s:"
+msgstr "³B²z %s ®Éµo¥Í¿ù»~:"
+
+#: message.c:525
+#, c-format
+msgid "line %4ld:"
+msgstr "¦æ %4ld:"
+
+#: message.c:565
+msgid "[string too long]"
+msgstr "[¦¹¦æ¹Lªø]"
+
+#: message.c:711
+msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>"
+msgstr ""
+"¥¿Å餤¤å°T®§ºûÅ@ªÌ: Francis S.Lin <piaip@csie.ntu.edu."
+"tw>, Cecil Sheng <b7506022@csie.ntu.edu.tw>"
+
+#: message.c:935
+msgid "Interrupt: "
+msgstr "¤w¤¤Â_: "
+
+#: message.c:938
+msgid "Hit ENTER to continue"
+msgstr "½Ð«ö ENTER Ä~Äò"
+
+#: message.c:940
+msgid "Hit ENTER or type command to continue"
+msgstr "½Ð«ö ENTER ©Î¨ä¥¦©R¥O¥HÄ~Äò"
+
+#: message.c:2028
+msgid "-- More --"
+msgstr "-- ©|¦³ --"
+
+#: message.c:2031
+msgid " (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)"
+msgstr " (RET/BS: ¦V¤U/¦V¤W¤@¦æ, ªÅ¥ÕÁä/b: ¤@­¶, d/u: ¥b­¶, q: Â÷¶})"
+
+#: message.c:2032
+msgid " (RET: line, SPACE: page, d: half page, q: quit)"
+msgstr " (RET: ¦V¤U¤@¦æ, ªÅ¥ÕÁä: ¤@­¶, d: ¥b­¶, q: Â÷¶})"
+
+#: message.c:2508 message.c:2523
+msgid "Question"
+msgstr "°ÝÃD"
+
+#: message.c:2510
+msgid ""
+"&Yes\n"
+"&No"
+msgstr ""
+"&Y¬O\n"
+"&N§_"
+
+#: message.c:2543
+msgid ""
+"&Yes\n"
+"&No\n"
+"Save &All\n"
+"&Discard All\n"
+"&Cancel"
+msgstr ""
+"&Y¬O\n"
+"&N§_\n"
+"&A¥þ³¡¦sÀÉ\n"
+"&D¥þ³¡¤£¦s\n"
+"&C¨ú®ø"
+
+#: message.c:2584
+msgid "Save File dialog"
+msgstr "¦sÀÉ"
+
+#: message.c:2586
+msgid "Open File dialog"
+msgstr "¶}ÀÉ"
+
+#. TODO: non-GUI file selector here
+#: message.c:2657
+msgid "E338: Sorry, no file browser in console mode"
+msgstr "E338: ¥D±±¥x(Console)¼Ò¦¡®É¨S¦³ÀÉ®×ÂsÄý¾¹(file browser)"
+
+#: misc1.c:2477
+msgid "W10: Warning: Changing a readonly file"
+msgstr "W10: ª`·N: §A¥¿¦b­×§ï¤@­Ó°ßŪÀÉ"
+
+#: misc1.c:2712
+msgid "1 more line"
+msgstr "ÁÙ¦³¤@¦æ"
+
+#: misc1.c:2714
+msgid "1 line less"
+msgstr "¤Ö©ó¤@¦æ"
+
+#: misc1.c:2719
+#, c-format
+msgid "%ld more lines"
+msgstr " ÁÙ¦³ %ld ¦æ"
+
+#: misc1.c:2721
+#, c-format
+msgid "%ld fewer lines"
+msgstr "¥u³Ñ %ld ¦æ"
+
+#: misc1.c:2724
+msgid " (Interrupted)"
+msgstr " (¤w¤¤Â_)"
+
+#: misc1.c:6348
+msgid "Vim: preserving files...\n"
+msgstr "Vim: «O¯dÀɮפ¤...\n"
+
+#. close all memfiles, without deleting
+#: misc1.c:6358
+msgid "Vim: Finished.\n"
+msgstr "Vim: µ²§ô.\n"
+
+#: misc2.c:670 misc2.c:686
+msgid "ERROR: "
+msgstr "¿ù»~: "
+
+#: misc2.c:690
+#, c-format
+msgid ""
+"\n"
+"[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n"
+msgstr ""
+"\n"
+"[bytes] ¥þ³¡ alloc-freed %lu-%lu, ¨Ï¥Î¤¤ %lu, peak ¨Ï¥Î %lu\n"
+
+#: misc2.c:692
+#, c-format
+msgid ""
+"[calls] total re/malloc()'s %lu, total free()'s %lu\n"
+"\n"
+msgstr ""
+"[©I¥s] ¥þ³¡ re/malloc(): %lu, ¥þ³¡ free()': %lu\n"
+"\n"
+
+#: misc2.c:747
+msgid "E340: Line is becoming too long"
+msgstr "E340: ¦¹¦æ¹Lªø"
+
+#: misc2.c:791
+#, c-format
+msgid "E341: Internal error: lalloc(%ld, )"
+msgstr "E341: ¤º³¡¿ù»~: lalloc(%ld, )"
+
+#: misc2.c:899
+#, c-format
+msgid "E342: Out of memory! (allocating %lu bytes)"
+msgstr "E342: °O¾ÐÅ餣¨¬! (¹Á¸Õ°t¸m %lu ¦ì¤¸²Õ)"
+
+#: misc2.c:2564
+#, c-format
+msgid "Calling shell to execute: \"%s\""
+msgstr "©I¥s shell °õ¦æ: \"%s\""
+
+#: misc2.c:2785
+msgid "E545: Missing colon"
+msgstr "E545: ¯Ê¤Ö colon"
+
+#: misc2.c:2787 misc2.c:2814
+msgid "E546: Illegal mode"
+msgstr "E546: ¤£¥¿½Tªº¼Ò¦¡"
+
+#: misc2.c:2853
+msgid "E547: Illegal mouseshape"
+msgstr "E547: ¤£¥¿½Tªº·Æ¹«§Îª¬"
+
+#: misc2.c:2893
+msgid "E548: digit expected"
+msgstr "E548: À³¸Ó­n¦³¼Æ¦r"
+
+#: misc2.c:2898
+msgid "E549: Illegal percentage"
+msgstr "E549: ¤£¥¿½Tªº¦Ê¤À¤ñ"
+
+#: misc2.c:3208
+msgid "Enter encryption key: "
+msgstr "¿é¤J±K½X: "
+
+#: misc2.c:3209
+msgid "Enter same key again: "
+msgstr "½Ð¦A¿é¤J¤@¦¸: "
+
+#: misc2.c:3219
+msgid "Keys don't match!"
+msgstr "¨â¦¸¿é¤J±K½X¤£¬Û¦P!"
+
+#: misc2.c:3768
+#, c-format
+msgid ""
+"E343: Invalid path: '**[number]' must be at the end of the path or be "
+"followed by '%s'."
+msgstr "E343: ¤£¥¿½Tªº¸ô®|: '**[number]' ¥²»Ý­n¦b¸ô®|µ²§À©Î­n±µµÛ '%s'"
+
+#: misc2.c:5044
+#, c-format
+msgid "E344: Can't find directory \"%s\" in cdpath"
+msgstr "E344: cdpath ¤¤¨S¦³¥Ø¿ý \"%s\""
+
+#: misc2.c:5047
+#, c-format
+msgid "E345: Can't find file \"%s\" in path"
+msgstr "E345: ¦b¸ô®|¤¤§ä¤£¨ìÀÉ®× \"%s\""
+
+#: misc2.c:5053
+#, c-format
+msgid "E346: No more directory \"%s\" found in cdpath"
+msgstr "E346: ¦b¸ô®|¤¤§ä¤£¨ì§ó¦hªºÀÉ®× \"%s\""
+
+#: misc2.c:5056
+#, c-format
+msgid "E347: No more file \"%s\" found in path"
+msgstr "E347: ¦b¸ô®|¤¤§ä¤£¨ì§ó¦hªºÀÉ®× \"%s\""
+
+#: misc2.c:5290
+msgid "E550: Missing colon"
+msgstr "E550: ¯Ê¤Ö colon"
+
+#: misc2.c:5302
+msgid "E551: Illegal component"
+msgstr "E551: ¤£¥¿½Tªº¼Ò¦¡"
+
+#: misc2.c:5310
+msgid "E552: digit expected"
+msgstr "E552: À³¸Ó­n¦³¼Æ¦r"
+
+#. Get here when the server can't be found.
+#: netbeans.c:283
+msgid "Cannot connect to Netbeans #2"
+msgstr "µLªk³s±µ¨ì Netbeans #2"
+
+#: netbeans.c:291
+msgid "Cannot connect to Netbeans"
+msgstr "µLªk³s±µ¨ì Netbeans"
+
+#: netbeans.c:565
+msgid "read from Netbeans socket"
+msgstr "¥Ñ Netbeans socket Ū¨ú"
+
+#: normal.c:2913
+msgid "Warning: terminal cannot highlight"
+msgstr "ª`·N: §Aªº²×ºÝ¾÷µLªkÅã¥Ü°ª«G«×"
+
+#: normal.c:3128
+msgid "E348: No string under cursor"
+msgstr "E348: ´å¼Ð³B¨S¦³¦r¦ê"
+
+#: normal.c:3130
+msgid "E349: No identifier under cursor"
+msgstr "E349: ´å¼Ð³B¨S¦³ÃѧO¦r"
+
+#: normal.c:4348
+msgid "E352: Cannot erase folds with current 'foldmethod'"
+msgstr "E352: µLªk¦b¥Ø«eªº 'foldmethod' ¤U§R°£ fold"
+
+#: ops.c:295
+#, c-format
+msgid "1 line %sed 1 time"
+msgstr "¤@¦æ %s ¹L ¤@¦¸"
+
+#: ops.c:297
+#, c-format
+msgid "1 line %sed %d times"
+msgstr "¤@¦æ %s ¹L %d ¦¸"
+
+#: ops.c:302
+#, c-format
+msgid "%ld lines %sed 1 time"
+msgstr "%ld ¦æ %s ¹L ¤@¦¸"
+
+#: ops.c:305
+#, c-format
+msgid "%ld lines %sed %d times"
+msgstr "%ld ¦æ %s ¹L %d ¦¸"
+
+#: ops.c:663
+#, c-format
+msgid "%ld lines to indent... "
+msgstr "ÁY±Æ %ld ¦æ..."
+
+#: ops.c:713
+msgid "1 line indented "
+msgstr "¤@¦æ¤wÁY±Æ"
+
+#: ops.c:715
+#, c-format
+msgid "%ld lines indented "
+msgstr "¤wÁY±Æ %ld ¦æ"
+
+#. must display the prompt
+#: ops.c:1645
+msgid "cannot yank; delete anyway"
+msgstr "µLªk°Å¤U; ª½±µ§R°£"
+
+#: ops.c:2152
+msgid "1 line changed"
+msgstr " 1 ¦æ ~ed"
+
+#: ops.c:2154
+#, c-format
+msgid "%ld lines changed"
+msgstr " %ld ¦æ ~ed"
+
+#: ops.c:2538
+#, c-format
+msgid "freeing %ld lines"
+msgstr "ÄÀ©ñ %ld ¦æ¤¤"
+
+#: ops.c:2819
+msgid "1 line yanked"
+msgstr "¤w½Æ»s 1 ¦æ"
+
+#: ops.c:2821
+#, c-format
+msgid "%ld lines yanked"
+msgstr "¤w½Æ»s %ld ¦æ"
+
+#: ops.c:3106
+#, c-format
+msgid "E353: Nothing in register %s"
+msgstr "E353: ¼È¦s¾¹ %s ¸Ì¨S¦³ªF¦è"
+
+#. Highlight title
+#: ops.c:3664
+msgid ""
+"\n"
+"--- Registers ---"
+msgstr ""
+"\n"
+"--- ¼È¦s¾¹ ---"
+
+#: ops.c:4873
+msgid "Illegal register name"
+msgstr "¤£¥¿½Tªº¼È¦s¾¹¦WºÙ"
+
+#: ops.c:4959
+msgid ""
+"\n"
+"# Registers:\n"
+msgstr ""
+"\n"
+"# ¼È¦s¾¹:\n"
+
+#: ops.c:4992
+#, c-format
+msgid "E574: Unknown register type %d"
+msgstr "E574: ¥¼ª¾ªºµù¥U«¬ºA: %d"
+
+#: ops.c:5412
+#, c-format
+msgid "E354: Invalid register name: '%s'"
+msgstr "E354: ¼È¦s¾¹¦WºÙ¿ù»~: '%s'"
+
+#: ops.c:5750
+#, c-format
+msgid "%ld Cols; "
+msgstr "%ld Äæ; "
+
+#: ops.c:5757
+#, c-format
+msgid "Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"
+msgstr "¿ï¾Ü¤F %s%ld/%ld ¦æ; %ld/%ld ¦r(Word); %ld/%ld ¦r¤¸(Bytes)"
+
+#: ops.c:5773
+#, c-format
+msgid "Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"
+msgstr "Äæ %s/%s; ¦æ %ld/%ld; ¦r(Word) %ld/%ld; ¦r¤¸(Byte) %ld/%ld"
+
+#: ops.c:5784
+#, c-format
+msgid "(+%ld for BOM)"
+msgstr "(+%ld for BOM)"
+
+#: option.c:1579
+msgid "%<%f%h%m%=Page %N"
+msgstr "%<%f%h%m%=²Ä %N ­¶"
+
+# ? what's this for?
+#: option.c:2012
+msgid "Thanks for flying Vim"
+msgstr "·PÁ±z·R¥Î Vim"
+
+#: option.c:3250 option.c:3357
+msgid "E518: Unknown option"
+msgstr "E518: ¤£¥¿½Tªº¿ï¶µ"
+
+#: option.c:3263
+msgid "E519: Option not supported"
+msgstr "E519: ¤£¤ä´©¸Ó¿ï¶µ"
+
+#: option.c:3288
+msgid "E520: Not allowed in a modeline"
+msgstr "E520: ¤£¯à¦b Modeline ¸Ì¥X²{"
+
+#: option.c:3344
+msgid ""
+"\n"
+"\tLast set from "
+msgstr ""
+"\n"
+"\t¤W¦¸³]©w: "
+
+#: option.c:3483
+msgid "E521: Number required after ="
+msgstr "E521: = «á»Ý­n¦³¼Æ¦r"
+
+#: option.c:3797 option.c:4413
+msgid "E522: Not found in termcap"
+msgstr "E522: Termcap ¸Ì­±§ä¤£¨ì"
+
+#: option.c:3863
+#, c-format
+msgid "E539: Illegal character <%s>"
+msgstr "E539: ¤£¥¿½Tªº¦r¤¸ <%s>"
+
+#: option.c:4405
+msgid "E529: Cannot set 'term' to empty string"
+msgstr "E529: µLªk³]©w 'term' ¬°ªÅ¦r¦ê"
+
+#: option.c:4408
+msgid "E530: Cannot change term in GUI"
+msgstr "E530: ¦b¹Ï«¬¬É­±¤¤µLªk¤Á´« term"
+
+#: option.c:4410
+msgid "E531: Use \":gui\" to start the GUI"
+msgstr "E531: ¿é¤J \":gui\" ¨Ó±Ò°Ê¹Ï§Î¬É­±"
+
+#: option.c:4431
+msgid "E589: 'backupext' and 'patchmode' are equal"
+msgstr "E589: 'backupext' ¸ò 'patchmode' ¬O¤@¼Ëªº"
+
+#: option.c:4616
+msgid "E617: Cannot be changed in the GTK+ 2 GUI"
+msgstr "E617: ¦b¹Ï«¬¬É­±¤¤µLªk¤Á´« term"
+
+#: option.c:4748
+msgid "E524: Missing colon"
+msgstr "E524: ¯Ê¤Ö colon"
+
+#: option.c:4750
+msgid "E525: Zero length string"
+msgstr "E525: ¹sªø«×¦r¦ê"
+
+#: option.c:4818
+#, c-format
+msgid "E526: Missing number after <%s>"
+msgstr "E526: <%s> «á¯Ê¤Ö¼Æ¦r"
+
+#: option.c:4832
+msgid "E527: Missing comma"
+msgstr "E527: ¯Ê¤Ö³r¸¹"
+
+#: option.c:4839
+msgid "E528: Must specify a ' value"
+msgstr "E528: ¥²»Ý«ü©w¤@­Ó ' ­È"
+
+#: option.c:4880
+msgid "E595: contains unprintable or wide character"
+msgstr "E595: ¤º§tµLªkÅã¥Üªº¦r¤¸"
+
+#: option.c:4929
+msgid "E596: Invalid font(s)"
+msgstr "E596: ¤£¥¿½Tªº¦r«¬"
+
+#: option.c:4937
+msgid "E597: can't select fontset"
+msgstr "E597: µLªk¨Ï¥Î¦r«¬¶°(Fontset)"
+
+#: option.c:4939
+msgid "E598: Invalid fontset"
+msgstr "E598: ¤£¥¿½Tªº¦r«¬¶°(Fontset)"
+
+#: option.c:4946
+msgid "E533: can't select wide font"
+msgstr "E533: µLªk¨Ï¥Î³]©wªº¤¤¤å¦r«¬(Widefont)"
+
+#: option.c:4948
+msgid "E534: Invalid wide font"
+msgstr "E534: ¤£¥¿½Tªº¦r«¬(Widefont)"
+
+#: option.c:5218
+#, c-format
+msgid "E535: Illegal character after <%c>"
+msgstr "E535: <%c> «á¦³¤£¥¿½Tªº¦r¤¸"
+
+#: option.c:5322
+msgid "E536: comma required"
+msgstr "E536: »Ý­n³r¸¹"
+
+#: option.c:5330
+#, c-format
+msgid "E537: 'commentstring' must be empty or contain %s"
+msgstr "E537: 'commentstring' ¥²»Ý¬OªÅ¥Õ©Î¥]§t %s"
+
+#: option.c:5377
+msgid "E538: No mouse support"
+msgstr "E538: ¤£¤ä´©·Æ¹«"
+
+#: option.c:5645
+msgid "E540: Unclosed expression sequence"
+msgstr "E540: ¨S¦³µ²§ôªº¹Bºâ¦¡: "
+
+#: option.c:5649
+msgid "E541: too many items"
+msgstr "E541: ¤Ó¦h¶µ¥Ø"
+
+#: option.c:5651
+msgid "E542: unbalanced groups"
+msgstr "E542: ¤£¹ïºÙªº group"
+
+#: option.c:5872
+msgid "E590: A preview window already exists"
+msgstr "E590: ¹wµøªºµøµ¡¤w¸g¦s¦b¤F"
+
+#: option.c:6346
+#, c-format
+msgid "E593: Need at least %d lines"
+msgstr "E593: ¦Ü¤Ö»Ý­n %d ¦æ"
+
+#: option.c:6355
+#, c-format
+msgid "E594: Need at least %d columns"
+msgstr "E594: ¦Ü¤Ö»Ý­n %d Äæ"
+
+#: option.c:6660
+#, c-format
+msgid "E355: Unknown option: %s"
+msgstr "E355: ¤£¥¿½Tªº¿ï¶µ: %s"
+
+#: option.c:6769
+msgid ""
+"\n"
+"--- Terminal codes ---"
+msgstr ""
+"\n"
+"--- ²×ºÝ¾÷½X ---"
+
+#: option.c:6771
+msgid ""
+"\n"
+"--- Global option values ---"
+msgstr ""
+"\n"
+"--- Global ¿ï¶µ­È ---"
+
+#: option.c:6773
+msgid ""
+"\n"
+"--- Local option values ---"
+msgstr ""
+"\n"
+"--- Local ¿ï¶µ­È ---"
+
+#: option.c:6775
+msgid ""
+"\n"
+"--- Options ---"
+msgstr ""
+"\n"
+"--- ¿ï¶µ ---"
+
+#: option.c:7467
+msgid "E356: get_varp ERROR"
+msgstr "E356: get_varp ¿ù»~"
+
+#: option.c:8425
+#, c-format
+msgid "E357: 'langmap': Matching character missing for %s"
+msgstr "E357: 'langmap': §ä¤£¨ì %s ¹ïÀ³ªº¦r¤¸"
+
+#: option.c:8459
+#, c-format
+msgid "E358: 'langmap': Extra characters after semicolon: %s"
+msgstr "E358: 'langmap': ¤À¸¹«á¦³¦h¾lªº¦r¤¸: %s"
+
+#: os_amiga.c:273
+msgid "cannot open "
+msgstr "¤£¯à¶}±Ò"
+
+#: os_amiga.c:307
+msgid "VIM: Can't open window!\n"
+msgstr "VIM: µLªk¶}±Òµøµ¡!\n"
+
+#: os_amiga.c:329
+msgid "Need Amigados version 2.04 or later\n"
+msgstr "»Ý­n Amigados ª©¥» 2.04 ¥H¤W\n"
+
+#: os_amiga.c:335
+#, c-format
+msgid "Need %s version %ld\n"
+msgstr "»Ý­n %s ª©¥» %ld\n"
+
+#: os_amiga.c:407
+msgid "Cannot open NIL:\n"
+msgstr "µLªk¶}±Ò NIL:\n"
+
+#: os_amiga.c:418
+msgid "Cannot create "
+msgstr "¤£¯à«Ø¥ß "
+
+#: os_amiga.c:896
+#, c-format
+msgid "Vim exiting with %d\n"
+msgstr "Vim µ²§ô¶Ç¦^­È: %d\n"
+
+#: os_amiga.c:928
+msgid "cannot change console mode ?!\n"
+msgstr "µLªk¤Á´«¥D±±¥x(console)¼Ò¦¡ !?\n"
+
+#: os_amiga.c:994
+msgid "mch_get_shellsize: not a console??\n"
+msgstr "mch_get_shellsize: ¤£¬O¥D±±¥x(console)??\n"
+
+#. if Vim opened a window: Executing a shell may cause crashes
+#: os_amiga.c:1143
+msgid "E360: Cannot execute shell with -f option"
+msgstr "E360: ¤£¯à¥Î -f ¿ï¶µ°õ¦æ shell"
+
+#: os_amiga.c:1184 os_amiga.c:1274
+msgid "Cannot execute "
+msgstr "¤£¯à°õ¦æ "
+
+#: os_amiga.c:1187 os_amiga.c:1284
+msgid "shell "
+msgstr "shell "
+
+#: os_amiga.c:1207 os_amiga.c:1309
+msgid " returned\n"
+msgstr " ¤wªð¦^\n"
+
+#: os_amiga.c:1450
+msgid "ANCHOR_BUF_SIZE too small."
+msgstr "ANCHOR_BUF_SIZE ¤Ó¤p"
+
+#: os_amiga.c:1454
+msgid "I/O ERROR"
+msgstr "I/O ¿ù»~"
+
+#: os_mswin.c:515
+msgid "...(truncated)"
+msgstr "...(¤w¤Á±¼)"
+
+#: os_mswin.c:617
+msgid "'columns' is not 80, cannot execute external commands"
+msgstr "'columns' ¤£¬O 80, µLªk°õ¦æ¥~³¡©R¥O"
+
+#: os_mswin.c:1802
+msgid "E237: Printer selection failed"
+msgstr "E237: µLªk¿ï¾Ü¦¹¦Lªí¾÷"
+
+#: os_mswin.c:1842
+#, c-format
+msgid "to %s on %s"
+msgstr "¨ì %s on %s"
+
+#: os_mswin.c:1857
+#, c-format
+msgid "E613: Unknown printer font: %s"
+msgstr "E613: ¤£¥¿½Tªº¦Lªí¾÷¦r«¬: %s"
+
+#: os_mswin.c:1907 os_mswin.c:1917
+#, c-format
+msgid "E238: Print error: %s"
+msgstr "E238: ¦C¦L¿ù»~: %s"
+
+#: os_mswin.c:1918
+msgid "Unknown"
+msgstr "¥¼ª¾"
+
+#: os_mswin.c:1945
+#, c-format
+msgid "Printing '%s'"
+msgstr "¦C¦L¤¤: '%s'"
+
+#: os_mswin.c:3033
+#, c-format
+msgid "E244: Illegal charset name \"%s\" in font name \"%s\""
+msgstr "E244: ¦r¤¸¶° \"%s\" µLªk¹ïÀ³¦r«¬\"%s\""
+
+#: os_mswin.c:3041
+#, c-format
+msgid "E245: Illegal char '%c' in font name \"%s\""
+msgstr "E245: ¤£¥¿½Tªº¦r¤¸ '%c' ¥X²{¦b¦r«¬¦WºÙ \"%s\" ¤º"
+
+#: os_riscos.c:1258
+msgid "E366: Invalid 'osfiletype' option - using Text"
+msgstr "E366: ¤£¥¿½Tªº 'filetype' ¿ï¶µ - ¨Ï¥Î¯Â¤å¦r¼Ò¦¡"
+
+#: os_unix.c:871
+msgid "Vim: Double signal, exiting\n"
+msgstr "Vim: Âù­«signal, Â÷¶}¤¤\n"
+
+#: os_unix.c:877
+#, c-format
+msgid "Vim: Caught deadly signal %s\n"
+msgstr "Vim: CVim: ÄdºI¨ì«H¸¹(signal) %s\n"
+
+#: os_unix.c:880
+msgid "Vim: Caught deadly signal\n"
+msgstr "Vim: ÄdºI¨ì­P©Rªº«H¸¹(deadly signale)\n"
+
+#: os_unix.c:1143
+#, c-format
+msgid "Opening the X display took %ld msec"
+msgstr "¶}±Ò X Window ¯Ó®É %ld msec"
+
+#: os_unix.c:1170
+msgid ""
+"\n"
+"Vim: Got X error\n"
+msgstr ""
+"\n"
+"Vim: X ¿ù»~\n"
+
+#: os_unix.c:1276
+msgid "Testing the X display failed"
+msgstr "´ú¸Õ X Window ¥¢±Ñ"
+
+#: os_unix.c:1415
+msgid "Opening the X display timed out"
+msgstr "¶}±Ò X Window ¹O®É"
+
+#: os_unix.c:3145 os_unix.c:3825
+msgid ""
+"\n"
+"Cannot execute shell "
+msgstr ""
+"\n"
+"¤£¯à°õ¦æ shell"
+
+#: os_unix.c:3193
+msgid ""
+"\n"
+"Cannot execute shell sh\n"
+msgstr ""
+"\n"
+"¤£¯à°õ¦æ shell sh\n"
+
+#: os_unix.c:3197 os_unix.c:3831
+msgid ""
+"\n"
+"shell returned "
+msgstr ""
+"\n"
+"Shell ¤wªð¦^"
+
+#: os_unix.c:3332
+msgid ""
+"\n"
+"Cannot create pipes\n"
+msgstr ""
+"\n"
+"¤£¯à«Ø¥ß pipe ºÞ½u\n"
+
+#: os_unix.c:3347
+msgid ""
+"\n"
+"Cannot fork\n"
+msgstr ""
+"\n"
+"¤£¯à fork\n"
+
+#: os_unix.c:3838
+msgid ""
+"\n"
+"Command terminated\n"
+msgstr ""
+"\n"
+"©R¥O¤w²×µ²\n"
+
+#: os_unix.c:5398
+msgid "Opening the X display failed"
+msgstr "¶}±Ò X Window ¥¢±Ñ"
+
+#: os_vms_mms.c:59
+msgid "At line"
+msgstr "¦b¦æ¸¹ "
+
+#: os_w32exe.c:169
+msgid "Could not load vim32.dll!"
+msgstr "µLªk¸ü¤J vim32.dll¡I"
+
+#: os_w32exe.c:169 os_w32exe.c:179
+msgid "VIM Error"
+msgstr "VIM ¿ù»~"
+
+#: os_w32exe.c:179
+msgid "Could not fix up function pointers to the DLL!"
+msgstr "¤£¯à­×¥¿¨ç¦¡«ü¼Ð¨ì DLL!"
+
+#: os_win16.c:583 os_win32.c:3047
+#, c-format
+msgid "shell returned %d"
+msgstr "Shell ¶Ç¦^­È %d"
+
+#: os_win32.c:2505
+#, c-format
+msgid "Vim: Caught %s event\n"
+msgstr "Vim: ÄdºI¨ì %s \n"
+
+#: os_win32.c:2507
+msgid "close"
+msgstr "Ãö³¬"
+
+#: os_win32.c:2509
+msgid "logoff"
+msgstr "µn¥X"
+
+#: os_win32.c:2510
+msgid "shutdown"
+msgstr "Ãö¾÷"
+
+#: os_win32.c:3000
+msgid "E371: Command not found"
+msgstr "E371: §ä¤£¨ì©R¥O"
+
+#: os_win32.c:3013
+msgid ""
+"VIMRUN.EXE not found in your $PATH.\n"
+"External commands will not pause after completion.\n"
+"See :help win32-vimrun for more information."
+msgstr ""
+"¦b§Aªº $PATH ¤¤§ä¤£¨ì VIMRUN.EXE.\n"
+"¥~³¡©R¥O°õ¦æ§¹²¦«á±N¤£·|¼È°±.\n"
+"¶i¤@¨B»¡©ú½Ð°õ¦æ :help win32-vimrun "
+
+#: os_win32.c:3016
+msgid "Vim Warning"
+msgstr "Vim ĵ§i"
+
+#: quickfix.c:258
+#, c-format
+msgid "E372: Too many %%%c in format string"
+msgstr "E372: ®æ¦¡¤Æ¦r¦ê¸Ì¦³¤Ó¦h %%%c "
+
+#: quickfix.c:271
+#, c-format
+msgid "E373: Unexpected %%%c in format string"
+msgstr "E373: ®æ¦¡¤Æ¦r¦ê¤£À³¸Ó¥X²{ %%%c "
+
+#: quickfix.c:325
+msgid "E374: Missing ] in format string"
+msgstr "E374: ®æ¦¡¤Æ¦r¦ê¸Ì¤Ö¤F ]"
+
+#: quickfix.c:339
+#, c-format
+msgid "E375: Unsupported %%%c in format string"
+msgstr "E375: ®æ¦¡¤Æ¦r¦ê¸Ì¦³¤£¤ä´©ªº %%%c "
+
+#: quickfix.c:357
+#, c-format
+msgid "E376: Invalid %%%c in format string prefix"
+msgstr "E376: ®æ¦¡¤Æ¦r¦ê¶}ÀY¸Ì¦³¤£¥¿½Tªº %%%c "
+
+#: quickfix.c:365
+#, c-format
+msgid "E377: Invalid %%%c in format string"
+msgstr "E377: ®æ¦¡¤Æ¦r¦ê¸Ì¦³¤£¥¿½Tªº %%%c "
+
+#: quickfix.c:391
+msgid "E378: 'errorformat' contains no pattern"
+msgstr "E378: 'errorformat' ¥¼³]©w"
+
+#: quickfix.c:497
+msgid "E379: Missing or empty directory name"
+msgstr "E379: §ä¤£¨ì¥Ø¿ý¦WºÙ©Î¬OªÅªº¥Ø¿ý¦WºÙ"
+
+#: quickfix.c:979
+msgid "E553: No more items"
+msgstr "E553: ¨S¦³¨ä¥¦¶µ¥Ø"
+
+#: quickfix.c:1200
+#, c-format
+msgid "(%d of %d)%s%s: "
+msgstr "(%d / %d)%s%s: "
+
+#: quickfix.c:1202
+msgid " (line deleted)"
+msgstr " (¦æ¤w§R°£)"
+
+#: quickfix.c:1412
+msgid "E380: At bottom of quickfix stack"
+msgstr "E380: Quickfix °ïÅ|µ²§À"
+
+#: quickfix.c:1421
+msgid "E381: At top of quickfix stack"
+msgstr "E381: Quickfix °ïÅ|³»ºÝ"
+
+#: quickfix.c:1433
+#, c-format
+msgid "error list %d of %d; %d errors"
+msgstr "¿ù»~¦Cªí %d/%d; ¦@¦³ %d ¶µ¿ù»~"
+
+#: quickfix.c:1904
+msgid "E382: Cannot write, 'buftype' option is set"
+msgstr "E382: µLªk¼g¤J¡A'buftype' ¿ï¶µ¤w³]©w"
+
+#: regexp.c:319
+#, c-format
+msgid "E369: invalid item in %s%%[]"
+msgstr "E369: ¤£¥¿½Tªº¶µ¥Ø¡G %s%%[]"
+
+#: regexp.c:826
+msgid "E339: Pattern too long"
+msgstr "E339: ¦W¦r¤Óªø"
+
+#: regexp.c:995
+msgid "E50: Too many \\z("
+msgstr "E50: ¤Ó¦h \\z("
+
+#: regexp.c:1006
+#, c-format
+msgid "E51: Too many %s("
+msgstr "E51: ¤Ó¦h %s("
+
+#: regexp.c:1063
+msgid "E52: Unmatched \\z("
+msgstr "E52: µL¹ïÀ³ªº \\z("
+
+#: regexp.c:1067
+#, c-format
+msgid "E53: Unmatched %s%%("
+msgstr "E53: µL¹ïÀ³ªº %s%%("
+
+#: regexp.c:1069
+#, c-format
+msgid "E54: Unmatched %s("
+msgstr "E54: µL¹ïÀ³ªº %s("
+
+#: regexp.c:1074
+#, c-format
+msgid "E55: Unmatched %s)"
+msgstr "E55: µL¹ïÀ³ªº %s)"
+
+#: regexp.c:1237
+#, c-format
+msgid "E56: %s* operand could be empty"
+msgstr "E56: %s* ¹Bºâ¤¸¥i¥H¬OªÅªº"
+
+#: regexp.c:1240
+#, c-format
+msgid "E57: %s+ operand could be empty"
+msgstr "E56: %s+ ¹Bºâ¤¸¥i¥H¬OªÅªº"
+
+#: regexp.c:1294
+#, c-format
+msgid "E59: invalid character after %s@"
+msgstr "E59: «á­±¦³¤£¥¿½Tªº¦r¤¸: %s@"
+
+#: regexp.c:1319
+#, c-format
+msgid "E58: %s{ operand could be empty"
+msgstr "E58: %s{ ¹Bºâ¤¸¥i¥H¬OªÅªº"
+
+#: regexp.c:1329
+#, c-format
+msgid "E60: Too many complex %s{...}s"
+msgstr "E60: ¤Ó¦h½ÆÂøªº %s{...}s"
+
+#: regexp.c:1345
+#, c-format
+msgid "E61: Nested %s*"
+msgstr "E61: ±_ª¬ %s*"
+
+#: regexp.c:1348
+#, c-format
+msgid "E62: Nested %s%c"
+msgstr "E62: ±_ª¬ %s%c"
+
+#: regexp.c:1466
+msgid "E63: invalid use of \\_"
+msgstr "E63: ¤£¥¿½Tªº¨Ï¥Î \\_"
+
+#: regexp.c:1511
+#, c-format
+msgid "E64: %s%c follows nothing"
+msgstr "E64: %s%c ¨S¦³±µªF¦è"
+
+#: regexp.c:1567
+msgid "E65: Illegal back reference"
+msgstr "E65: ¤£¥¿½Tªº¤Ï¦V°Ñ¦Ò"
+
+#: regexp.c:1580
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( ¤£¯à¦b¦¹¥X²{"
+
+#: regexp.c:1599
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et al. ¤£¯à¦b¦¹¥X²{"
+
+#: regexp.c:1610
+msgid "E68: Invalid character after \\z"
+msgstr "E68: «á­±¦³¤£¥¿½Tªº¦r¤¸: \\z"
+
+#: regexp.c:1659
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: %s%%[ «á¯Ê¤Ö ]"
+
+#: regexp.c:1675
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: ªÅªº %s%%[]"
+
+#: regexp.c:1735
+#, c-format
+msgid "E71: Invalid character after %s%%"
+msgstr "E71: «á­±¦³¤£¥¿½Tªº¦r¤¸: %s%%"
+
+#: regexp.c:2530
+#, c-format
+msgid "E554: Syntax error in %s{...}"
+msgstr "E554: »yªk¿ù»~: %s{...}"
+
+#: regexp.c:2777
+msgid "E361: Crash intercepted; regexp too complex?"
+msgstr "E361: µLªk°õ¦æ; regular expression ¤Ó½ÆÂø?"
+
+#: regexp.c:2912
+msgid "E363: pattern caused out-of-stack error"
+msgstr "E363: regular expression ³y¦¨°ïÅ|¥Î¥úªº¿ù»~"
+
+#: regexp.c:3148
+msgid "External submatches:\n"
+msgstr "¥~³¡²Å¦X:\n"
+
+#: screen.c:2103
+#, c-format
+msgid "+--%3ld lines folded "
+msgstr "+--¤w fold %3ld ¦æ"
+
+#: screen.c:7785
+msgid " VREPLACE"
+msgstr " V-¨ú¥N"
+
+#: screen.c:7789
+msgid " REPLACE"
+msgstr " ¨ú¥N"
+
+#: screen.c:7794
+msgid " REVERSE"
+msgstr " ¤ÏÂà"
+
+#: screen.c:7796
+msgid " INSERT"
+msgstr " ´¡¤J"
+
+#: screen.c:7799
+msgid " (insert)"
+msgstr " (´¡¤J)"
+
+#: screen.c:7801
+msgid " (replace)"
+msgstr " (¨ú¥N)"
+
+#: screen.c:7803
+msgid " (vreplace)"
+msgstr " (v-¨ú¥N)"
+
+#: screen.c:7806
+msgid " Hebrew"
+msgstr " Hebrew"
+
+#: screen.c:7814
+msgid " (lang)"
+msgstr " (»y¨¥)"
+
+#: screen.c:7817
+msgid " (paste)"
+msgstr " (¶K¤W)"
+
+#: screen.c:7823
+msgid " SELECT"
+msgstr " ¿ï¨ú"
+
+#: screen.c:7825
+msgid " VISUAL"
+msgstr " ¿ï¨ú"
+
+#: screen.c:7827
+msgid " BLOCK"
+msgstr " °Ï¶ô"
+
+#: screen.c:7829
+msgid " LINE"
+msgstr " ¦æ¿ï¨ú"
+
+#: screen.c:7842 screen.c:7902
+msgid "recording"
+msgstr "°O¿ý¤¤"
+
+#: search.c:36
+msgid "search hit TOP, continuing at BOTTOM"
+msgstr "¤w·j´M¨ìÀɮ׶}ÀY¡F¦A±qµ²§ÀÄ~Äò·j´M"
+
+#: search.c:37
+msgid "search hit BOTTOM, continuing at TOP"
+msgstr "¤w·j´M¨ìÀÉ®×µ²§À¡F¦A±q¶}ÀYÄ~Äò·j´M"
+
+#: search.c:455
+#, c-format
+msgid "E383: Invalid search string: %s"
+msgstr "E383: ¿ù»~ªº·j´M¦r¦ê: %s"
+
+#: search.c:782
+#, c-format
+msgid "E384: search hit TOP without match for: %s"
+msgstr "E384: ¤w·j´M¨ìÀɮ׶}ÀY¤´§ä¤£¨ì %s"
+
+#: search.c:784
+#, c-format
+msgid "E385: search hit BOTTOM without match for: %s"
+msgstr "E385: ¤w·j´M¨ìÀÉ®×µ²§À¤´§ä¤£¨ì %s"
+
+#: search.c:1157
+msgid "E386: Expected '?' or '/' after ';'"
+msgstr "E386: ¦b ';' «á­±À³¸Ó¦³ '?' ©Î '/'"
+
+#: search.c:3567
+msgid " (includes previously listed match)"
+msgstr " (¥]¬A«e¦¸¦C¥X²Å¦X¶µ)"
+
+#. cursor at status line
+#: search.c:3587
+msgid "--- Included files "
+msgstr "--- ¤Þ¤JÀÉ®× "
+
+#: search.c:3589
+msgid "not found "
+msgstr "§ä¤£¨ì "
+
+#: search.c:3590
+msgid "in path ---\n"
+msgstr "---\n"
+
+#: search.c:3629
+msgid " (Already listed)"
+msgstr " (¤w¦C¥X)"
+
+#: search.c:3631
+msgid " NOT FOUND"
+msgstr " §ä¤£¨ì"
+
+#: search.c:3683
+#, c-format
+msgid "Scanning included file: %s"
+msgstr "·j´M¤Þ¤JÀÉ®×: %s"
+
+#: search.c:3901
+msgid "E387: Match is on current line"
+msgstr "E387: ¥Ø«e©Ò¦b¦æ¤¤¦³¤@¤Ç°t"
+
+#: search.c:4041
+msgid "All included files were found"
+msgstr "©Ò¦³¤Þ¤JÀɮ׳£¤w§ä¨ì"
+
+#: search.c:4043
+msgid "No included files"
+msgstr "¨S¦³¤Þ¤JÀÉ®×"
+
+#: search.c:4059
+msgid "E388: Couldn't find definition"
+msgstr "E388: §ä¤£¨ì©w¸q"
+
+#: search.c:4061
+msgid "E389: Couldn't find pattern"
+msgstr "E389: §ä¤£¨ì pattern"
+
+#: syntax.c:3015
+#, c-format
+msgid "E390: Illegal argument: %s"
+msgstr "E390: °Ñ¼Æ¤£¥¿½T: %s"
+
+#: syntax.c:3195
+#, c-format
+msgid "E391: No such syntax cluster: %s"
+msgstr "E391: µL¦¹ syntax cluster: \"%s\""
+
+#: syntax.c:3359
+msgid "No Syntax items defined for this buffer"
+msgstr "³o­Ó½w½Ä°Ï¨S¦³©w¸q¥ô¦ó»yªk"
+
+#: syntax.c:3367
+msgid "syncing on C-style comments"
+msgstr "C»y¨¥¦¡µù¸Ñ¦P¨B¤Æ¤¤"
+
+#: syntax.c:3375
+msgid "no syncing"
+msgstr "¨S¦³¦P¨B¤Æ"
+
+#: syntax.c:3378
+msgid "syncing starts "
+msgstr "¦P¨B¤Æ¶}©l"
+
+#: syntax.c:3380 syntax.c:3455
+msgid " lines before top line"
+msgstr "¦æ¸¹¶W¥X½d³ò"
+
+#: syntax.c:3385
+msgid ""
+"\n"
+"--- Syntax sync items ---"
+msgstr ""
+"\n"
+"--- »yªk¦P¨Bª«¥ó (Syntax sync items) ---"
+
+#: syntax.c:3390
+msgid ""
+"\n"
+"syncing on items"
+msgstr ""
+"\n"
+"¦P¨B¤Æ¤¤:"
+
+#: syntax.c:3396
+msgid ""
+"\n"
+"--- Syntax items ---"
+msgstr ""
+"\n"
+"--- »yªk¶µ¥Ø ---"
+
+#: syntax.c:3419
+#, c-format
+msgid "E392: No such syntax cluster: %s"
+msgstr "E392: µL¦¹ syntax cluster: \"%s\""
+
+#: syntax.c:3445
+msgid "minimal "
+msgstr "³Ì¤p"
+
+#: syntax.c:3452
+msgid "maximal "
+msgstr "³Ì¤j"
+
+#: syntax.c:3464
+msgid "; match "
+msgstr "; ²Å¦X "
+
+#: syntax.c:3466
+msgid " line breaks"
+msgstr "Â_¦æ"
+
+#: syntax.c:4100
+msgid "E393: group[t]here not accepted here"
+msgstr "E393: ¨Ï¥Î¤F¤£¥¿½Tªº°Ñ¼Æ"
+
+#: syntax.c:4124
+#, c-format
+msgid "E394: Didn't find region item for %s"
+msgstr "E394: §ä¤£¨ì %s ªº region item"
+
+#: syntax.c:4152
+msgid "E395: contains argument not accepted here"
+msgstr "E395: ¨Ï¥Î¤F¤£¥¿½Tªº°Ñ¼Æ"
+
+#: syntax.c:4163
+msgid "E396: containedin argument not accepted here"
+msgstr "E396: ¨Ï¥Î¤F¤£¥¿½Tªº°Ñ¼Æ"
+
+#: syntax.c:4241
+msgid "E397: Filename required"
+msgstr "E397: »Ý­nÀɮצWºÙ"
+
+#: syntax.c:4579
+#, c-format
+msgid "E398: Missing '=': %s"
+msgstr "E398: ¯Ê¤Ö \"=\": %s"
+
+#: syntax.c:4737
+#, c-format
+msgid "E399: Not enough arguments: syntax region %s"
+msgstr "E399: syntax region %s ªº¤Þ¼Æ¤Ó¤Ö"
+
+#: syntax.c:5068
+msgid "E400: No cluster specified"
+msgstr "E400: ¨S¦³«ü©wªºÄÝ©Ê"
+
+#: syntax.c:5105
+#, c-format
+msgid "E401: Pattern delimiter not found: %s"
+msgstr "E401: §ä¤£¨ì¤À¹j²Å¸¹: %s"
+
+#: syntax.c:5180
+#, c-format
+msgid "E402: Garbage after pattern: %s"
+msgstr "E402: '%s' «á­±ªºªF¦èµLªk¿ëÃÑ"
+
+#: syntax.c:5270
+msgid "E403: syntax sync: line continuations pattern specified twice"
+msgstr "E403: »yªk¦P¨B: ³s±µ¦æ²Å¸¹³Q«ü©w¤F¨â¦¸"
+
+#: syntax.c:5327
+#, c-format
+msgid "E404: Illegal arguments: %s"
+msgstr "E404: °Ñ¼Æ¤£¥¿½T: %s"
+
+#: syntax.c:5377
+#, c-format
+msgid "E405: Missing equal sign: %s"
+msgstr "E405: ¯Ê¤Ö¬Ûµ¥²Å¸¹: %s"
+
+#: syntax.c:5383
+#, c-format
+msgid "E406: Empty argument: %s"
+msgstr "E406: ªÅ¥Õ°Ñ¼Æ: %s"
+
+#: syntax.c:5410
+#, c-format
+msgid "E407: %s not allowed here"
+msgstr "E407: %s ¤£¯à¦b¦¹¥X²{"
+
+#: syntax.c:5417
+#, c-format
+msgid "E408: %s must be first in contains list"
+msgstr "E408: %s ¥²¶·¬O¦Cªí¸Ìªº²Ä¤@­Ó"
+
+#: syntax.c:5487
+#, c-format
+msgid "E409: Unknown group name: %s"
+msgstr "E409: ¤£¥¿½Tªº¸s²Õ¦WºÙ: %s"
+
+#: syntax.c:5720
+#, c-format
+msgid "E410: Invalid :syntax subcommand: %s"
+msgstr "E410: ¤£¥¿½Tªº :syntax ¤l©R¥O: %s"
+
+#: syntax.c:6099
+#, c-format
+msgid "E411: highlight group not found: %s"
+msgstr "E411: §ä¤£¨ì highlight group: %s"
+
+#: syntax.c:6123
+#, c-format
+msgid "E412: Not enough arguments: \":highlight link %s\""
+msgstr "E412: °Ñ¼Æ¤Ó¤Ö: \":highlight link %s\""
+
+#: syntax.c:6130
+#, c-format
+msgid "E413: Too many arguments: \":highlight link %s\""
+msgstr "E413: °Ñ¼Æ¹L¦h: \":highlight link %s\""
+
+#: syntax.c:6150
+msgid "E414: group has settings, highlight link ignored"
+msgstr "E414: ¤w³]©w¸s²Õ, ©¿²¤ highlight link"
+
+#: syntax.c:6279
+#, c-format
+msgid "E415: unexpected equal sign: %s"
+msgstr "E415: ¤£¸Ó¦³ªºµ¥¸¹: %s"
+
+#: syntax.c:6315
+#, c-format
+msgid "E416: missing equal sign: %s"
+msgstr "E416: ¯Ê¤Ö¬Ûµ¥²Å¸¹: %s"
+
+#: syntax.c:6337
+#, c-format
+msgid "E417: missing argument: %s"
+msgstr "E417: ¯Ê¤Ö°Ñ¼Æ: %s"
+
+#: syntax.c:6374
+#, c-format
+msgid "E418: Illegal value: %s"
+msgstr "E418: ¤£¦Xªkªº­È: %s"
+
+#: syntax.c:6493
+msgid "E419: FG color unknown"
+msgstr "E419: ¿ù»~ªº«e´ºÃC¦â"
+
+#: syntax.c:6504
+msgid "E420: BG color unknown"
+msgstr "E420: ¿ù»~ªº­I´ºÃC¦â"
+
+#: syntax.c:6565
+#, c-format
+msgid "E421: Color name or number not recognized: %s"
+msgstr "E421: ¿ù»~ªºÃC¦â¦WºÙ©Î¼Æ­È: %s"
+
+#: syntax.c:6771
+#, c-format
+msgid "E422: terminal code too long: %s"
+msgstr "E422: ²×ºÝ¾÷½X¤Óªø: %s"
+
+#: syntax.c:6818
+#, c-format
+msgid "E423: Illegal argument: %s"
+msgstr "E423: °Ñ¼Æ¤£¥¿½T: %s"
+
+#: syntax.c:7347
+msgid "E424: Too many different highlighting attributes in use"
+msgstr "E424: ¨Ï¥Î¤F¹L¦h¬Û²§ªº°ª«G«×ÄÝ©Ê"
+
+#: tag.c:90
+msgid "E555: at bottom of tag stack"
+msgstr "E555: ¼ÐÅÒ(tag)°ïÅ|µ²§À"
+
+#: tag.c:91
+msgid "E556: at top of tag stack"
+msgstr "E556: ¼ÐÅÒ(tag)°ïÅ|¶}ÀY"
+
+#: tag.c:392
+msgid "E425: Cannot go before first matching tag"
+msgstr "E425: ¤w¸g¦b³Ì«e­±ªº¼ÐÅÒ(tag)¤F"
+
+#: tag.c:512
+#, c-format
+msgid "E426: tag not found: %s"
+msgstr "E426: §ä¤£¨ì¼ÐÅÒ(tag): %s"
+
+#: tag.c:545
+msgid " # pri kind tag"
+msgstr " # pri kind tag"
+
+#: tag.c:548
+msgid "file\n"
+msgstr "ÀÉ®×\n"
+
+#.
+#. * Ask to select a tag from the list.
+#. * When using ":silent" assume that <CR> was entered.
+#.
+#: tag.c:706
+msgid "Enter nr of choice (<CR> to abort): "
+msgstr "¿é¤J nr ©Î¿ï¾Ü (<CR> Â÷¶}): "
+
+#: tag.c:746
+msgid "E427: There is only one matching tag"
+msgstr "E427: ¥u¦³¦¹¶µ²Å¦X"
+
+#: tag.c:748
+msgid "E428: Cannot go beyond last matching tag"
+msgstr "E428: ¤v¸g¦b³Ì«á¤@­Ó²Å¦Xªº tag ¤F"
+
+#: tag.c:768
+#, c-format
+msgid "File \"%s\" does not exist"
+msgstr "ÀÉ®× \"%s\" ¤£¦s¦b"
+
+#. Give an indication of the number of matching tags
+#: tag.c:780
+#, c-format
+msgid "tag %d of %d%s"
+msgstr "§ä¨ì tag: %d/%d%s"
+
+#: tag.c:783
+msgid " or more"
+msgstr " ©Î§ó¦h"
+
+#: tag.c:785
+msgid " Using tag with different case!"
+msgstr " ¥H¤£¦P¤j¤p¼g¨Ó¨Ï¥Î tag!"
+
+#: tag.c:828
+#, c-format
+msgid "E429: File \"%s\" does not exist"
+msgstr "E429: ÀÉ®× \"%s\" ¤£¦s¦b"
+
+#. Highlight title
+#: tag.c:897
+msgid ""
+"\n"
+" # TO tag FROM line in file/text"
+msgstr ""
+"\n"
+" # ¨ì tag ±q ¦æ ¦b ÀÉ®×/¤å¦r"
+
+#: tag.c:1144
+msgid "Linear tag search"
+msgstr "½u©Ê·j´M¼ÐÅÒ (Tags)"
+
+#: tag.c:1146
+msgid "Binary tag search"
+msgstr "¤G¤À·j´M(Binary search) ¼ÐÅÒ(Tags)"
+
+#: tag.c:1172
+#, c-format
+msgid "Searching tags file %s"
+msgstr "·j´M tag ÀÉ®× \"%s\""
+
+#: tag.c:1356
+#, c-format
+msgid "E430: Tag file path truncated for %s\n"
+msgstr "E430: Tag Àɮ׸ô®|³QºIÂ_¬° %s\n"
+
+#: tag.c:1858
+#, c-format
+msgid "E431: Format error in tags file \"%s\""
+msgstr "E431: Tag ÀÉ \"%s\" ®æ¦¡¿ù»~"
+
+#: tag.c:1862
+#, c-format
+msgid "Before byte %ld"
+msgstr "¦b %ld ¦ì¤¸¤§«e"
+
+#: tag.c:1883
+#, c-format
+msgid "E432: Tags file not sorted: %s"
+msgstr "E432: Tag ÀÉ®×¥¼±Æ§Ç: %s"
+
+#. never opened any tags file
+#: tag.c:1922
+msgid "E433: No tags file"
+msgstr "E433: ¨S¦³ tag ÀÉ"
+
+#: tag.c:2600
+msgid "E434: Can't find tag pattern"
+msgstr "E434: §ä¤£¨ì tag"
+
+#: tag.c:2611
+msgid "E435: Couldn't find tag, just guessing!"
+msgstr "E435: §ä¤£¨ì tag, ¥Î²qªº!"
+
+#: term.c:1745
+msgid "' not known. Available builtin terminals are:"
+msgstr "' µLªk¸ü¤J¡C¥i¥Îªº¤º«Ø²×ºÝ¾÷§Î¦¡¦³:"
+
+#: term.c:1769
+msgid "defaulting to '"
+msgstr "¹w³]: '"
+
+#: term.c:2127
+msgid "E557: Cannot open termcap file"
+msgstr "E557: µLªk¶}±Ò termcap ÀÉ®×"
+
+#: term.c:2131
+msgid "E558: Terminal entry not found in terminfo"
+msgstr "E558: terminfo ¤¤¨S¦³²×ºÝ¾÷¸ê®Æ¶µ"
+
+#: term.c:2133
+msgid "E559: Terminal entry not found in termcap"
+msgstr "E559: termcap ¤¤¨S¦³²×ºÝ¾÷¸ê®Æ¶µ"
+
+#: term.c:2292
+#, c-format
+msgid "E436: No \"%s\" entry in termcap"
+msgstr "E436: termcap ¨S¦³ \"%s\" entry"
+
+#: term.c:2766
+msgid "E437: terminal capability \"cm\" required"
+msgstr "E437: ²×ºÝ¾÷»Ý­n \"cm\" ªº¯à¤O"
+
+#. Highlight title
+#: term.c:4927
+msgid ""
+"\n"
+"--- Terminal keys ---"
+msgstr ""
+"\n"
+"--- ²×ºÝ¾÷«öÁä ---"
+
+#: ui.c:252
+msgid "new shell started\n"
+msgstr "°_°Ê·s shell\n"
+
+#: ui.c:1784
+msgid "Vim: Error reading input, exiting...\n"
+msgstr "Vim: Ū¨ú¿é¤J¿ù»~¡AÂ÷¶}¤¤...\n"
+
+#. must display the prompt
+#: undo.c:394
+msgid "No undo possible; continue anyway"
+msgstr "µLªkÁÙ­ì¡F½ÐÄ~Äò§V¤O"
+
+#: undo.c:549
+msgid "E438: u_undo: line numbers wrong"
+msgstr "E438: u_undo: ¦æ¸¹¿ù»~"
+
+#: undo.c:718
+msgid "1 change"
+msgstr "¤@¶µ§ïÅÜ"
+
+#: undo.c:720
+#, c-format
+msgid "%ld changes"
+msgstr "%ld ¶µ§ïÅÜ"
+
+#: undo.c:764
+msgid "E439: undo list corrupt"
+msgstr "E439: ´_­ì¦Cªí·lÃa"
+
+#: undo.c:796
+msgid "E440: undo line missing"
+msgstr "E440: §ä¤£¨ì­n undo ªº¦æ"
+
+#. Only MS VC 4.1 and earlier can do Win32s
+#: version.c:682
+msgid ""
+"\n"
+"MS-Windows 16/32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 16/32 Bit ¹Ï«¬¬É­±ª©¥»"
+
+#: version.c:684
+msgid ""
+"\n"
+"MS-Windows 32 bit GUI version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit ¹Ï«¬¬É­±ª©¥»"
+
+#: version.c:687
+msgid " in Win32s mode"
+msgstr "Win32s ¼Ò¦¡"
+
+#: version.c:689
+msgid " with OLE support"
+msgstr "¤ä´© OLE"
+
+#: version.c:692
+msgid ""
+"\n"
+"MS-Windows 32 bit console version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit console ª©¥»"
+
+#: version.c:696
+msgid ""
+"\n"
+"MS-Windows 16 bit version"
+msgstr ""
+"\n"
+"MS-Windows 32 Bit console ª©¥»"
+
+#: version.c:700
+msgid ""
+"\n"
+"32 bit MS-DOS version"
+msgstr ""
+"\n"
+"32 Bit MS-DOS ª©¥»"
+
+#: version.c:702
+msgid ""
+"\n"
+"16 bit MS-DOS version"
+msgstr ""
+"\n"
+"16 Bit MS-DOS ª©¥»"
+
+#: version.c:708
+msgid ""
+"\n"
+"MacOS X (unix) version"
+msgstr ""
+"\n"
+"MacOS X (unix) ª©¥»"
+
+#: version.c:710
+msgid ""
+"\n"
+"MacOS X version"
+msgstr ""
+"\n"
+"MacOS X ª©¥»"
+
+#: version.c:713
+msgid ""
+"\n"
+"MacOS version"
+msgstr ""
+"\n"
+"MacOS ª©¥»"
+
+#: version.c:718
+msgid ""
+"\n"
+"RISC OS version"
+msgstr ""
+"\n"
+"RISC OS ª©¥»"
+
+#: version.c:728
+msgid ""
+"\n"
+"Included patches: "
+msgstr ""
+"\n"
+"¤Þ¤J­×¥¿: "
+
+#: version.c:754 version.c:1097
+msgid "Modified by "
+msgstr "­×§ïªÌ¬°"
+
+#: version.c:761
+msgid ""
+"\n"
+"Compiled "
+msgstr ""
+"\n"
+"½sĶ"
+
+#: version.c:764
+msgid "by "
+msgstr "ªÌ:"
+
+#: version.c:776
+msgid ""
+"\n"
+"Huge version "
+msgstr ""
+"\n"
+"¶W±jª©¥» "
+
+#: version.c:779
+msgid ""
+"\n"
+"Big version "
+msgstr ""
+"\n"
+"¤j«¬ª©¥» "
+
+#: version.c:782
+msgid ""
+"\n"
+"Normal version "
+msgstr ""
+"\n"
+"¤@¯ëª©¥» "
+
+#: version.c:785
+msgid ""
+"\n"
+"Small version "
+msgstr ""
+"\n"
+"²©öª©¥» "
+
+#: version.c:787
+msgid ""
+"\n"
+"Tiny version "
+msgstr ""
+"\n"
+"ºë²ª©¥» "
+
+#: version.c:793
+msgid "without GUI."
+msgstr "¤£¨Ï¥Î¹Ï«¬¬É­±¡C"
+
+#: version.c:798
+msgid "with GTK2-GNOME GUI."
+msgstr "¨Ï¥Î GTK2-GNOME ¹Ï«¬¬É­±¡C"
+
+#: version.c:800
+msgid "with GTK-GNOME GUI."
+msgstr "¨Ï¥Î GTK-GNOME ¹Ï«¬¬É­±¡C"
+
+#: version.c:804
+msgid "with GTK2 GUI."
+msgstr "¨Ï¥Î GTK2 ¹Ï«¬¬É­±¡C"
+
+#: version.c:806
+msgid "with GTK GUI."
+msgstr "¨Ï¥Î GTK ¹Ï«¬¬É­±¡C"
+
+#: version.c:811
+msgid "with X11-Motif GUI."
+msgstr "¨Ï¥Î X11-Motif ¹Ï«¬¬É­±¡C"
+
+#: version.c:814
+msgid "with X11-Athena GUI."
+msgstr "¨Ï¥Î X11-Athena ¹Ï«¬¬É­±¡C"
+
+#: version.c:817
+msgid "with BeOS GUI."
+msgstr "¨Ï¥Î BeOS ¹Ï«¬¬É­±¡C"
+
+#: version.c:820
+msgid "with Photon GUI."
+msgstr "¨Ï¥ÎPhoton¹Ï«¬¬É­±¡C"
+
+#: version.c:823
+msgid "with GUI."
+msgstr "¨Ï¥Î¹Ï«¬¬É­±¡C"
+
+#: version.c:826
+msgid "with Carbon GUI."
+msgstr "¨Ï¥Î Carbon ¹Ï«¬¬É­±¡C"
+
+#: version.c:829
+msgid "with Cocoa GUI."
+msgstr "¨Ï¥Î Cocoa ¹Ï«¬¬É­±¡C"
+
+#: version.c:832
+msgid "with (classic) GUI."
+msgstr "¨Ï¥Î (¶Ç²Î) ¹Ï«¬¬É­±¡C"
+
+#: version.c:843
+msgid " Features included (+) or not (-):\n"
+msgstr " ¥Ø«e¥i¨Ï¥Î(+)»P¤£¥i¨Ï¥Î(-)ªº¼Ò²Õ¦Cªí:\n"
+
+#: version.c:855
+msgid " system vimrc file: \""
+msgstr " ¨t²Î vimrc ³]©wÀÉ: \""
+
+#: version.c:860
+msgid " user vimrc file: \""
+msgstr " ¨Ï¥ÎªÌ­Ó¤H vimrc ³]©wÀÉ: \""
+
+#: version.c:865
+msgid " 2nd user vimrc file: \""
+msgstr " ²Ä¤G²Õ­Ó¤H vimrc ÀÉ®×: \""
+
+#: version.c:870
+msgid " 3rd user vimrc file: \""
+msgstr " ²Ä¤T²Õ­Ó¤H vimrc ÀÉ®×: \""
+
+#: version.c:875
+msgid " user exrc file: \""
+msgstr " ¨Ï¥ÎªÌ­Ó¤H exrc ³]©wÀÉ: \""
+
+#: version.c:880
+msgid " 2nd user exrc file: \""
+msgstr " ²Ä¤G²Õ¨Ï¥ÎªÌ exrc ÀÉ®×: \""
+
+#: version.c:886
+msgid " system gvimrc file: \""
+msgstr " ¨t²Î gvimrc ÀÉ®×: \""
+
+#: version.c:890
+msgid " user gvimrc file: \""
+msgstr " ¨Ï¥ÎªÌ­Ó¤H gvimrc ÀÉ: \""
+
+#: version.c:894
+msgid "2nd user gvimrc file: \""
+msgstr " ²Ä¤G²Õ­Ó¤H gvimrc ÀÉ®×: \""
+
+#: version.c:899
+msgid "3rd user gvimrc file: \""
+msgstr " ²Ä¤T²Õ­Ó¤H gvimrc ÀÉ®×: \""
+
+#: version.c:906
+msgid " system menu file: \""
+msgstr " ¨t²Î¿ï³æ³]©wÀÉ: \""
+
+#: version.c:914
+msgid " fall-back for $VIM: \""
+msgstr " $VIM ¹w³]­È: \""
+
+#: version.c:920
+msgid " f-b for $VIMRUNTIME: \""
+msgstr " $VIMRUNTIME ¹w³]­È: \""
+
+#: version.c:924
+msgid "Compilation: "
+msgstr "½sĶ¤è¦¡: "
+
+#: version.c:930
+msgid "Compiler: "
+msgstr "½sĶ¾¹: "
+
+#: version.c:935
+msgid "Linking: "
+msgstr "Ãìµ²¤è¦¡: "
+
+#: version.c:940
+msgid " DEBUG BUILD"
+msgstr " °£¿ùª©¥»"
+
+#: version.c:976
+msgid "VIM - Vi IMproved"
+msgstr "VIM - Vi IMproved"
+
+#: version.c:978
+msgid "version "
+msgstr "ª©¥» "
+
+#: version.c:979
+msgid "by Bram Moolenaar et al."
+msgstr "ºûÅ@ªÌ: Bram Moolenaar et al."
+
+#: version.c:983
+msgid "Vim is open source and freely distributable"
+msgstr "Vim ¬°¥i¦Û¥Ñ´²§Gªº¶}©ñ­ì©l½X³nÅé"
+
+#: version.c:985
+msgid "Help poor children in Uganda!"
+msgstr "½ÐÀ°§U¯Q¤z¹Fªº¥i¼¦«Äµ£!"
+
+#: version.c:986
+msgid "type :help iccf<Enter> for information "
+msgstr "¶i¤@¨B»¡©ú½Ð¿é¤J :help iccf<Enter>"
+
+#: version.c:988
+msgid "type :q<Enter> to exit "
+msgstr "­nÂ÷¶}½Ð¿é¤J :q<Enter> "
+
+#: version.c:989
+msgid "type :help<Enter> or <F1> for on-line help"
+msgstr "½u¤W»¡©ú½Ð¿é¤J :help<Enter> "
+
+#: version.c:990
+msgid "type :help version6<Enter> for version info"
+msgstr "·sª©¥»¸ê°T½Ð¿é¤J :help version6<Enter>"
+
+#: version.c:993
+msgid "Running in Vi compatible mode"
+msgstr "Vi ¬Û®e¼Ò¦¡"
+
+#: version.c:994
+msgid "type :set nocp<Enter> for Vim defaults"
+msgstr "¦pªG­n§¹¥þ¼ÒÀÀ¶Ç²Î Vi ½Ð¿é¤J :set nocp<Enter>"
+
+#: version.c:995
+msgid "type :help cp-default<Enter> for info on this"
+msgstr "¦pªG»Ý­n¹ï Vi ¬Û®e¼Ò¦¡ªº¶i¤@¨B»¡©ú½Ð¿é¤J :help cp-default<Enter>"
+
+#: version.c:1010
+msgid "menu Help->Orphans for information "
+msgstr "¶i¤@¨B»¡©ú½Ð¿ï¨ú¿ï³æªº »²§U»¡©ú->¬@±Ï©t¨à"
+
+#: version.c:1012
+msgid "Running modeless, typed text is inserted"
+msgstr "°õ¦æ Modeless ¼Ò¦¡¡A¿é¤Jªº¤å¦r·|¦Û°Ê´¡¤J"
+
+#: version.c:1013
+msgid "menu Edit->Global Settings->Toggle Insert Mode "
+msgstr "¿ï¨ú¿ï³æªº¡u½s¿è¡v¡u¥þ°ì³]©w¡v¡u¤Á´«´¡¤J¼Ò¦¡¡v"
+
+#: version.c:1014
+msgid " for two modes "
+msgstr " ¨âºØ¼Ò¦¡ "
+
+#: version.c:1018
+msgid "menu Edit->Global Settings->Toggle Vi Compatible"
+msgstr "¿ï¨ú¿ï³æªº¡u½s¿è¡v¡u¥þ°ì³]©w¡v¡u¤Á´«¶Ç²ÎVi¬Û®e¼Ò¦¡¡v"
+
+#: version.c:1019
+msgid " for Vim defaults "
+msgstr " ¥H±o Vim ¹w³]­È "
+
+#: version.c:1065
+msgid "WARNING: Windows 95/98/ME detected"
+msgstr "ª`·N: °»´ú¨ì Windows 95/98/ME"
+
+#: version.c:1068
+msgid "type :help windows95<Enter> for info on this"
+msgstr "¦pªG»Ý­n¹ï Windows 95 ¤ä´©ªº§ó¦h¸ê°T½Ð¿é¤J :help windows95<Enter>"
+
+#: window.c:204
+msgid "E441: There is no preview window"
+msgstr "E441: ¨S¦³¹wÄýµøµ¡"
+
+#: window.c:577
+msgid "E442: Can't split topleft and botright at the same time"
+msgstr "E442: ¤£¯à¦P®É¤À³Îµøµ¡¬°¥ª¤W©M¥k¤U¨¤"
+
+#: window.c:1336
+msgid "E443: Cannot rotate when another window is split"
+msgstr "E443: ¦³¨ä¥¦¤À³Îµøµ¡®ÉµLªk±ÛÂà"
+
+#: window.c:1827
+msgid "E444: Cannot close last window"
+msgstr "E444: ¤£¯àÃö³¬³Ì«á¤@­Óµøµ¡"
+
+#: window.c:2557
+msgid "Already only one window"
+msgstr "¤w¸g¥u³Ñ¤@­Óµøµ¡¤F"
+
+#: window.c:2604
+msgid "E445: Other window contains changes"
+msgstr "E445: ¨ä¥¦µøµ¡¦³§ó°Ê¸ê®Æ"
+
+#: window.c:4449
+msgid "E446: No file name under cursor"
+msgstr "E446: ´å¼Ð³B¨S¦³ÀɦW"
+
+#: window.c:4568
+#, c-format
+msgid "E447: Can't find file \"%s\" in path"
+msgstr "E447: ¦b¸ô®|¤¤§ä¤£¨ìÀÉ®× \"%s\""
+
+#: ../GvimExt/gvimext.cpp:586
+msgid "Edit with &multiple Vims"
+msgstr "¨Ï¥Î¦h­Ó Vim session ½s¿è(&M)"
+
+#: ../GvimExt/gvimext.cpp:592
+msgid "Edit with single &Vim"
+msgstr "¥u¨Ï¥Î¦P¤@­Ó Vim session ½s¿è(&V)"
+
+#: ../GvimExt/gvimext.cpp:601
+msgid "&Diff with Vim"
+msgstr "¨Ï¥Î Vim ¨Ó¤ñ¸û(&Diff)"
+
+#: ../GvimExt/gvimext.cpp:614
+msgid "Edit with &Vim"
+msgstr "¨Ï¥Î Vim ½s¿è¦¹ÀÉ(&V)"
+
+#. Now concatenate
+#: ../GvimExt/gvimext.cpp:636
+msgid "Edit with existing Vim - &"
+msgstr "¨Ï¥Î°õ¦æ¤¤ªº Vim session ½s¿è - &"
+
+#: ../GvimExt/gvimext.cpp:749
+msgid "Edits the selected file(s) with Vim"
+msgstr "¨Ï¥Î Vim ½s¿è¤w¿ï¨úªºÀÉ®×"
+
+#: ../GvimExt/gvimext.cpp:888 ../GvimExt/gvimext.cpp:969
+msgid "Error creating process: Check if gvim is in your path!"
+msgstr "µLªk°õ¦æµ{¦¡: ½ÐÀˬd gvim ¦³¨S¦³¦b§Aªº PATH ÅܼƸÌ!"
+
+#: ../GvimExt/gvimext.cpp:889 ../GvimExt/gvimext.cpp:903
+#: ../GvimExt/gvimext.cpp:970
+msgid "gvimext.dll error"
+msgstr "gvimext.dll ¿ù»~"
+
+#: ../GvimExt/gvimext.cpp:902
+msgid "Path length too long!"
+msgstr "¸ô®|ªø«×¤Óªø!"
+
+#: globals.h:990
+msgid "--No lines in buffer--"
+msgstr "--½w½Ä°ÏµL¸ê®Æ--"
+
+#.
+#. * The error messages that can be shared are included here.
+#. * Excluded are errors that are only used once and debugging messages.
+#.
+#: globals.h:1149
+msgid "E470: Command aborted"
+msgstr "E470: ©R¥O³Q±j¨î¤¤Â_°õ¦æ"
+
+#: globals.h:1150
+msgid "E471: Argument required"
+msgstr "E471: »Ý­n«ü¥O°Ñ¼Æ"
+
+#: globals.h:1151
+msgid "E10: \\ should be followed by /, ? or &"
+msgstr "E10: \\ «á­±À³¸Ó¦³ / ? ©Î &"
+
+#: globals.h:1153
+msgid "E11: Invalid in command-line window; <CR> executes, CTRL-C quits"
+msgstr "E11: ¤£¯à¦b©R¥O¦Cµøµ¡¤¤¨Ï¥Î¡C<CR>°õ¦æ¡ACTRL-C Â÷¶}"
+
+#: globals.h:1155
+msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search"
+msgstr "E12: exrc/vimrc ¸Ìªº«ü¥OµLªk°õ¦æ"
+
+#: globals.h:1157
+msgid "E171: Missing :endif"
+msgstr "E171: ¯Ê¤Ö :endif"
+
+#: globals.h:1158
+msgid "E600: Missing :endtry"
+msgstr "E600: ¯Ê¤Ö :endtry"
+
+#: globals.h:1159
+msgid "E170: Missing :endwhile"
+msgstr "E170: ¯Ê¤Ö :endwhile"
+
+#: globals.h:1160
+msgid "E588: :endwhile without :while"
+msgstr "E588: :endwhile ¯Ê¤Ö¹ïÀ³ªº :while"
+
+#: globals.h:1162
+msgid "E13: File exists (add ! to override)"
+msgstr "E13: Àɮפw¸g¦s¦b (¥i¥Î ! ±j¨î¨ú¥N)"
+
+#: globals.h:1163
+msgid "E472: Command failed"
+msgstr "E472: ©R¥O°õ¦æ¥¢±Ñ"
+
+#: globals.h:1165
+#, c-format
+msgid "E234: Unknown fontset: %s"
+msgstr "E234: ¤£¥¿½Tªº¦r¤¸¶° (Fontset): %s"
+
+#: globals.h:1169
+#, c-format
+msgid "E235: Unknown font: %s"
+msgstr "¤£¥¿½Tªº¦r«¬¦WºÙ: %s"
+
+#: globals.h:1172
+#, c-format
+msgid "E236: Font \"%s\" is not fixed-width"
+msgstr "E236: \"%s\" ¤£¬O©T©w¼e«×¦r«¬"
+
+#: globals.h:1174
+msgid "E473: Internal error"
+msgstr "E473: ¤º³¡¿ù»~"
+
+#: globals.h:1175
+msgid "Interrupted"
+msgstr "¤w¤¤Â_"
+
+#: globals.h:1176
+msgid "E14: Invalid address"
+msgstr "E14: ¤£¥¿½Tªº¦ì§}"
+
+#: globals.h:1177
+msgid "E474: Invalid argument"
+msgstr "E474: ¤£¥¿½Tªº°Ñ¼Æ"
+
+#: globals.h:1178
+#, c-format
+msgid "E475: Invalid argument: %s"
+msgstr "E475: ¤£¥¿½Tªº°Ñ¼Æ: %s"
+
+#: globals.h:1180
+#, c-format
+msgid "E15: Invalid expression: %s"
+msgstr "E15: ¤£¥¿½Tªº¹Bºâ¦¡: %s"
+
+#: globals.h:1182
+msgid "E16: Invalid range"
+msgstr "E16: ¤£¥¿½Tªº½d³ò"
+
+#: globals.h:1183
+msgid "E476: Invalid command"
+msgstr "E476: ¤£¥¿½Tªº©R¥O"
+
+#: globals.h:1185
+#, c-format
+msgid "E17: \"%s\" is a directory"
+msgstr "E17: \"%s\" ¬O¥Ø¿ý"
+
+#: globals.h:1188
+msgid "E18: Unexpected characters before '='"
+msgstr "E18: '=' «e­±¥X²{¤F¿ù»~ªº¦r¤¸"
+
+#: globals.h:1191
+#, c-format
+msgid "E364: Library call failed for \"%s()\""
+msgstr "E364: ©I¥s¨ç¦¡®w \"%s\"() ¥¢±Ñ"
+
+#: globals.h:1196
+#, c-format
+msgid "E370: Could not load library %s"
+msgstr "E370: µLªk­«·s¸ü¤Jµ{¦¡®w %s"
+
+#: globals.h:1197
+#, c-format
+msgid "E448: Could not load library function %s"
+msgstr "E448: µLªk¸ü¤Jµ{¦¡®wªº¨ç¦¡ %s"
+
+#: globals.h:1199
+msgid "E19: Mark has invalid line number"
+msgstr "E19: ¼Ð°Oªº¦æ¸¹¿ù»~"
+
+#: globals.h:1200
+msgid "E20: Mark not set"
+msgstr "E20: ¨S¦³³]©w¼Ð°O"
+
+#: globals.h:1201
+msgid "E21: Cannot make changes, 'modifiable' is off"
+msgstr "E21: ¦]¬° 'modifiable' ¿ï¶µ¬OÃö³¬ªº¡A©Ò¥H¤£¯à­×§ï"
+
+#: globals.h:1202
+msgid "E22: Scripts nested too deep"
+msgstr "E22: ±_ª¬»¼°j©I¥s¤Ó¦h¼h"
+
+#: globals.h:1203
+msgid "E23: No alternate file"
+msgstr "E23: ¨S¦³´À¥NªºÀÉ®×"
+
+#: globals.h:1204
+msgid "E24: No such abbreviation"
+msgstr "E24: ¨S¦³³o­Ó abbreviation ¹ïÀ³"
+
+#: globals.h:1205
+msgid "E477: No ! allowed"
+msgstr "E477: ¤£¥i¨Ï¥Î '!'"
+
+#: globals.h:1207
+msgid "E25: GUI cannot be used: Not enabled at compile time"
+msgstr "E25: ¦]¬°½sĶ®É¨S¦³¥[¤J¹Ï«¬¬É­±ªºµ{¦¡½X¡A©Ò¥HµLªk¨Ï¥Î¹Ï«¬¬É­±"
+
+#: globals.h:1210
+msgid "E26: Hebrew cannot be used: Not enabled at compile time\n"
+msgstr "E26: ¦]¬°½sĶ®É¨S¦³¥[¤J Hebrew ªºµ{¦¡½X¡A©Ò¥HµLªk¨Ï¥Î Hebrew\n"
+
+#: globals.h:1213
+msgid "E27: Farsi cannot be used: Not enabled at compile time\n"
+msgstr "E27: ¦]¬°½sĶ®É¨S¦³¥[¤J Farsi ªºµ{¦¡½X¡A©Ò¥HµLªk¨Ï¥Î Farsi\n"
+
+#: globals.h:1216
+#, c-format
+msgid "E28: No such highlight group name: %s"
+msgstr "E28: ¨S¦³¦W¬° '%s' ªº highlight group"
+
+#: globals.h:1218
+msgid "E29: No inserted text yet"
+msgstr "E29: ÁÙ¨S¦³´¡¤J¤å¦r¹L"
+
+#: globals.h:1219
+msgid "E30: No previous command line"
+msgstr "E30: ¨S¦³«e¤@¶µ©R¥O"
+
+#: globals.h:1220
+msgid "E31: No such mapping"
+msgstr "E31: ¨S¦³³o­Ó mapping ¹ïÀ³"
+
+#: globals.h:1221
+msgid "E479: No match"
+msgstr "E479: §ä¤£¨ì"
+
+#: globals.h:1222
+#, c-format
+msgid "E480: No match: %s"
+msgstr "E480: §ä¤£¨ì: %s"
+
+#: globals.h:1223
+msgid "E32: No file name"
+msgstr "E32: ¨S¦³ÀɦW"
+
+#: globals.h:1224
+msgid "E33: No previous substitute regular expression"
+msgstr "E33: ¨S¦³«e¤@­Ó·j´M/¨ú¥Nªº©R¥O"
+
+#: globals.h:1225
+msgid "E34: No previous command"
+msgstr "E34: ¨S¦³«e¤@­Ó©R¥O"
+
+#: globals.h:1226
+msgid "E35: No previous regular expression"
+msgstr "E35: ¨S¦³«e¤@­Ó·j´M«ü¥O"
+
+#: globals.h:1227
+msgid "E481: No range allowed"
+msgstr "E481: ¤£¥i¨Ï¥Î½d³ò«ü¥O"
+
+#: globals.h:1229
+msgid "E36: Not enough room"
+msgstr "E36: ¨S¦³¨¬°÷ªºªÅ¶¡"
+
+#: globals.h:1232
+#, c-format
+msgid "E247: no registered server named \"%s\""
+msgstr "E247: ¨S¦³µù¥U¬° \"%s\" ªº¦øªA¾¹"
+
+#: globals.h:1234
+#, c-format
+msgid "E482: Can't create file %s"
+msgstr "E482: ¤£¯à«Ø¥ßÀÉ®× %s"
+
+#: globals.h:1235
+msgid "E483: Can't get temp file name"
+msgstr "E483: µLªk±oª¾¼È¦sÀɦW"
+
+#: globals.h:1236
+#, c-format
+msgid "E484: Can't open file %s"
+msgstr "E484: µLªk¶}±ÒÀÉ®× %s"
+
+#: globals.h:1237
+#, c-format
+msgid "E485: Can't read file %s"
+msgstr "E485: µLªkŪ¨úÀÉ®× %s"
+
+#: globals.h:1238
+msgid "E37: No write since last change (add ! to override)"
+msgstr "E37: ¤w§ó§ï¹LÀɮצý©|¥¼¦sÀÉ (¥i¥Î ! ±j¨î°õ¦æ)"
+
+#: globals.h:1239
+msgid "E38: Null argument"
+msgstr "E38: ªÅªº (Null) °Ñ¼Æ"
+
+#: globals.h:1241
+msgid "E39: Number expected"
+msgstr "E39: À³¸Ó­n¦³¼Æ¦r"
+
+#: globals.h:1244
+#, c-format
+msgid "E40: Can't open errorfile %s"
+msgstr "E40: µLªk¶}±Ò¿ù»~ÀÉ®× %s"
+
+#: globals.h:1247
+msgid "E233: cannot open display"
+msgstr "E233: <¤£¯à¶}±Ò X Server DISPLAY>"
+
+#: globals.h:1249
+msgid "E41: Out of memory!"
+msgstr "E41: °O¾ÐÅ餣¨¬!"
+
+#: globals.h:1251
+msgid "Pattern not found"
+msgstr "§ä¤£¨ì"
+
+#: globals.h:1253
+#, c-format
+msgid "E486: Pattern not found: %s"
+msgstr "E486: §ä¤£¨ì %s"
+
+#: globals.h:1254
+msgid "E487: Argument must be positive"
+msgstr "E487: °Ñ¼ÆÀ³¸Ó¬O¥¿¼Æ"
+
+#: globals.h:1256
+msgid "E459: Cannot go back to previous directory"
+msgstr "E459: µLªk¦^¨ì«e¤@­Ó¥Ø¿ý"
+
+#: globals.h:1260
+msgid "E42: No Errors"
+msgstr "E42: ¨S¦³¿ù»~"
+
+#: globals.h:1262
+msgid "E43: Damaged match string"
+msgstr "E43: ²Å¦X¦r¦ê¦³°ÝÃD"
+
+#: globals.h:1263
+msgid "E44: Corrupted regexp program"
+msgstr "E44: regexp ¦³°ÝÃD"
+
+#: globals.h:1264
+msgid "E45: 'readonly' option is set (add ! to override)"
+msgstr "E45: ¦³³]©w 'readonly' ¿ï¶µ(°ßŪ) (¥i¥Î ! ±j¨î°õ¦æ)"
+
+#: globals.h:1266
+#, c-format
+msgid "E46: Cannot set read-only variable \"%s\""
+msgstr "E46: µLªk³]©w°ßŪÅÜ¼Æ \"%s\""
+
+#: globals.h:1269
+msgid "E47: Error while reading errorfile"
+msgstr "E47: Ū¨ú¿ù»~ÀÉ®×¥¢±Ñ"
+
+#: globals.h:1272
+msgid "E48: Not allowed in sandbox"
+msgstr "E48: ¤£¯à¦b sandbox ¸Ì¥X²{"
+
+#: globals.h:1274
+msgid "E523: Not allowed here"
+msgstr "E523: ³o¸Ì¤£¥i¨Ï¥Î"
+
+#: globals.h:1277
+msgid "E359: Screen mode setting not supported"
+msgstr "E359: ¤£¤ä´©³]©w¿Ã¹õ¼Ò¦¡"
+
+#: globals.h:1279
+msgid "E49: Invalid scroll size"
+msgstr "E49: ¿ù»~ªº±²°Ê¤j¤p"
+
+#: globals.h:1280
+msgid "E91: 'shell' option is empty"
+msgstr "E91: 'E71: ¿ï¶µ 'shell' ¥¼³]©w"
+
+#: globals.h:1282
+msgid "E255: Couldn't read in sign data!"
+msgstr "E255: µLªkŪ¨ú sign data!"
+
+#: globals.h:1284
+msgid "E72: Close error on swap file"
+msgstr "E72: ¼È¦sÀÉÃö³¬¿ù»~"
+
+#: globals.h:1285
+msgid "E73: tag stack empty"
+msgstr "E73: ¼ÐÅÒ°ïÅ|¤wªÅ"
+
+#: globals.h:1286
+msgid "E74: Command too complex"
+msgstr "E74: ©R¥O¤Ó½ÆÂø"
+
+#: globals.h:1287
+msgid "E75: Name too long"
+msgstr "E75: ¦W¦r¤Óªø"
+
+#: globals.h:1288
+msgid "E76: Too many ["
+msgstr "E76: ¤Ó¦h ["
+
+#: globals.h:1289
+msgid "E77: Too many file names"
+msgstr "E77: ¤Ó¦hÀɦW"
+
+#: globals.h:1290
+msgid "E488: Trailing characters"
+msgstr "E488: §A¿é¤J¤F¦h¾lªº¦r¤¸"
+
+#: globals.h:1291
+msgid "E78: Unknown mark"
+msgstr "E78: µLªk¿ìÃѪº¼Ð°O"
+
+#: globals.h:1292
+msgid "E79: Cannot expand wildcards"
+msgstr "E79: µLªk®i¶}¸U¥Î¦r¤¸"
+
+#: globals.h:1294
+msgid "E591: 'winheight' cannot be smaller than 'winminheight'"
+msgstr "E591: 'winheight' ¤£¯à¤ñ 'winminheight' §ó¤Ö"
+
+#: globals.h:1296
+msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'"
+msgstr "E592: 'winwidth' ¤£¯à¤ñ 'winminwidth' §ó¤Ö"
+
+#: globals.h:1299
+msgid "E80: Error while writing"
+msgstr "E80: ¼g¤J¿ù»~"
+
+#: globals.h:1300
+msgid "Zero count"
+msgstr "¼Æ¨ì¹s (?)"
+
+#: globals.h:1302
+msgid "E81: Using <SID> not in a script context"
+msgstr "E81: <SID> ¤£¯à¦b script ¥»¤å¥~¨Ï¥Î."
+
+#: globals.h:1305
+msgid "E449: Invalid expression received"
+msgstr "E449: ¦¬¨ì¤£¥¿½Tªº¹Bºâ¦¡"
+
+#: globals.h:1308
+msgid "E463: Region is guarded, cannot modify"
+msgstr "E463: °Ï°ì³Q«OÅ@¡AµLªk­×§ï"
+
+#~ msgid "function "
+#~ msgstr "¨ç¦¡ "
+
+#~ msgid "Run Macro"
+#~ msgstr "°õ¦æ¥¨¶°"
+
+#~ msgid "E221: 'commentstring' is empty"
+#~ msgstr "E221: ¿ï¶µ 'commentstring' ¥¼³]©w"
+
+#~ msgid "E242: Color name not recognized: %s"
+#~ msgstr "E242: %s ¬°µLªkÃѧOªºÃC¦â¦WºÙ"
+
+#~ msgid "E242: Missing color: %s"
+#~ msgstr "E242: §ä¤£¨ìÃC¦â: %s"
+
+#~ msgid "error reading cscope connection %d"
+#~ msgstr "Ū¨ú cscope ³s½u %d ®É¿ù»~"
+
+#~ msgid "E249: couldn't read VIM instance registry property"
+#~ msgstr "E249: µLªkŪ¨ú VIM ªº registry ³]©w¶µ"
+
+#~ msgid "Can't open file %s"
+#~ msgstr "µLªk¶}±ÒÀÉ®× %s"
+
+#~ msgid "Unable to send reply"
+#~ msgstr "µLªk¶Ç°e¦^À³°T®§"
+
+#~ msgid "E241: Unable to send to Vim server"
+#~ msgstr "E241: µLªk¶Ç°e¨ì Vim ¦øªA¾¹"
+
+#~ msgid ""
+#~ "\n"
+#~ "Send failed. No command server present ?\n"
+#~ msgstr ""
+#~ "\n"
+#~ "¶Ç°e¥¢±Ñ¡C¨S¦³©R¥O¦øªA¾¹¦s¦b ?\n"
+
+#~ msgid "PC (32 bits Vim)"
+#~ msgstr "PC (32 ¦ì¤¸ Vim)"
+
+#~ msgid "PC (16 bits Vim)"
+#~ msgstr "PC (16 ¦ì¤¸ Vim)"
+
+#~ msgid "E362: Unsupported screen mode"
+#~ msgstr "E362: ¿Ã¹õ¼Ò¦¡¤£¤ä´©"
+
+#~ msgid "No servers found for this display"
+#~ msgstr "¦¹Display¨S¦³¦øªA¾¹(Servers)"
+
+#~ msgid "E258: no matches found in cscope connections"
+#~ msgstr "E258: cscope ³s½u§ä¤£¨ì²Å¦Xªº"
+
+#~ msgid ""
+#~ "\n"
+#~ "MacOS Carbon"
+#~ msgstr ""
+#~ "\n"
+#~ "MacOS Carbon"
+
+#~ msgid ""
+#~ "\n"
+#~ "MacOS 8"
+#~ msgstr ""
+#~ "\n"
+#~ "MacOS 8"
+
+#~ msgid "Retrieve next symbol"
+#~ msgstr "Ū¨ú: ±q¤U­Ó symbol"
+
+#~ msgid "-- SNiFF+ commands --"
+#~ msgstr "-- SNiFF+ ©R¥O --"
+
+#~ msgid "E277: Unrecognized sniff request [%s]"
+#~ msgstr "E277: µLªk¿ëÃÑ sniff ©R¥O [%s]"
diff --git a/src/proto.h b/src/proto.h
new file mode 100644
index 000000000..d89c84731
--- /dev/null
+++ b/src/proto.h
@@ -0,0 +1,251 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * proto.h: include the (automatically generated) function prototypes
+ */
+
+/*
+ * Don't include these while generating prototypes. Prevents problems when
+ * files are missing.
+ */
+#if !defined(PROTO) && !defined(NOPROTO)
+
+/*
+ * Machine-dependent routines.
+ */
+/* avoid errors in function prototypes */
+# if !defined(FEAT_X11) && !defined(FEAT_GUI_GTK)
+# define Display int
+# define Widget int
+# endif
+# ifndef FEAT_GUI_GTK
+# define GdkEvent int
+# define GdkEventKey int
+# endif
+# ifndef FEAT_X11
+# define XImage int
+# endif
+
+# ifdef AMIGA
+# include "os_amiga.pro"
+# endif
+# if defined(UNIX) || defined(__EMX__) || defined(VMS)
+# include "os_unix.pro"
+# endif
+# if defined(MSDOS) || defined(WIN16)
+# include "os_msdos.pro"
+# endif
+# ifdef WIN16
+ typedef LPSTR LPWSTR;
+ typedef LPCSTR LPCWSTR;
+ typedef int LPBOOL;
+# include "os_win16.pro"
+# include "os_mswin.pro"
+# endif
+# ifdef WIN3264
+# include "os_win32.pro"
+# include "os_mswin.pro"
+# if (defined(__GNUC__) && !defined(__MINGW32__)) \
+ || (defined(__BORLANDC__) && __BORLANDC__ < 0x502)
+extern int _stricoll __ARGS((char *a, char *b));
+# endif
+# endif
+# ifdef VMS
+# include "os_vms.pro"
+# endif
+# ifdef __BEOS__
+# include "os_beos.pro"
+# endif
+# ifdef MACOS
+# include "os_mac.pro"
+# endif
+# ifdef RISCOS
+# include "os_riscos.pro"
+# endif
+# ifdef __QNX__
+# include "os_qnx.pro"
+# endif
+
+# include "buffer.pro"
+# include "charset.pro"
+# ifdef FEAT_CSCOPE
+# include "if_cscope.pro"
+# endif
+# include "diff.pro"
+# include "digraph.pro"
+# include "edit.pro"
+# include "eval.pro"
+# include "ex_cmds.pro"
+# include "ex_cmds2.pro"
+# include "ex_docmd.pro"
+# include "ex_eval.pro"
+# include "ex_getln.pro"
+# include "fileio.pro"
+# include "fold.pro"
+# include "getchar.pro"
+# ifdef FEAT_HANGULIN
+# include "hangulin.pro"
+# endif
+# include "main.pro"
+# include "mark.pro"
+# if !defined MESSAGE_FILE || defined(HAVE_STDARG_H)
+ /* These prototypes cannot be produced automatically and conflict with
+ * the old-style prototypes in message.c. */
+int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg __ARGS((char_u *, ...));
+int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+smsg_attr __ARGS((int, char_u *, ...));
+# endif
+# include "memfile.pro"
+# include "memline.pro"
+# ifdef FEAT_MENU
+# include "menu.pro"
+# endif
+# include "message.pro"
+# include "misc1.pro"
+# include "misc2.pro"
+#ifndef HAVE_STRPBRK /* not generated automatically from misc2.c */
+char_u *vim_strpbrk __ARGS((char_u *s, char_u *charset));
+#endif
+#ifndef HAVE_QSORT
+/* Use our own qsort(), don't define the prototype when not used. */
+void qsort __ARGS((void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void *, const void *)));
+#endif
+# include "move.pro"
+# if defined(FEAT_MBYTE) || defined(FEAT_XIM) || defined(FEAT_KEYMAP) \
+ || defined(FEAT_POSTSCRIPT)
+# include "mbyte.pro"
+# endif
+# include "normal.pro"
+# include "ops.pro"
+# include "option.pro"
+# include "quickfix.pro"
+# include "regexp.pro"
+# include "screen.pro"
+# include "search.pro"
+# include "syntax.pro"
+# include "tag.pro"
+# include "term.pro"
+# if defined(HAVE_TGETENT) && (defined(AMIGA) || defined(VMS))
+# include "termlib.pro"
+# endif
+# include "ui.pro"
+# include "undo.pro"
+# include "version.pro"
+# include "window.pro"
+
+# ifdef FEAT_PYTHON
+# include "if_python.pro"
+# endif
+
+# ifdef FEAT_TCL
+# include "if_tcl.pro"
+# endif
+
+# ifdef FEAT_RUBY
+# include "if_ruby.pro"
+# endif
+
+# ifdef FEAT_GUI
+# include "gui.pro"
+# if defined(UNIX) || defined(MACOS)
+# include "pty.pro"
+# endif
+# if !defined(HAVE_SETENV) && !defined(HAVE_PUTENV) && !defined(VMS)
+extern int putenv __ARGS((const char *string)); /* from pty.c */
+# ifdef USE_VIMPTY_GETENV
+extern char_u *vimpty_getenv __ARGS((const char_u *string)); /* from pty.c */
+# endif
+# endif
+# ifdef FEAT_GUI_W16
+# include "gui_w16.pro"
+# endif
+ /* Ugly solution for "BalloonEval" not being defined while it's used in
+ * the prototypes. */
+# ifndef FEAT_BEVAL
+# define BalloonEval int
+# endif
+# ifdef FEAT_GUI_W32
+# include "gui_w32.pro"
+# endif
+# ifdef FEAT_GUI_GTK
+# include "gui_gtk.pro"
+# include "gui_gtk_x11.pro"
+# endif
+# ifdef FEAT_GUI_MOTIF
+# include "gui_motif.pro"
+# endif
+# ifdef FEAT_GUI_ATHENA
+# include "gui_athena.pro"
+# ifdef FEAT_BROWSE
+extern char *vim_SelFile __ARGS((Widget toplevel, char *prompt, char *init_path, int (*show_entry)(), int x, int y, guicolor_T fg, guicolor_T bg, guicolor_T scroll_fg, guicolor_T scroll_bg));
+# endif
+# endif
+# ifdef FEAT_GUI_BEOS
+# include "gui_beos.pro"
+# endif
+# ifdef FEAT_GUI_MAC
+# include "gui_mac.pro"
+# endif
+# ifdef FEAT_GUI_X11
+# include "gui_x11.pro"
+# endif
+# if defined(FEAT_GUI_AMIGA)
+# include "gui_amiga.pro"
+# endif
+# ifdef RISCOS
+# include "gui_riscos.pro"
+# endif
+# ifdef FEAT_GUI_PHOTON
+# include "gui_photon.pro"
+# endif
+# ifdef FEAT_SUN_WORKSHOP
+# include "workshop.pro"
+# endif
+# ifdef FEAT_NETBEANS_INTG
+# include "netbeans.pro"
+# endif
+# endif /* FEAT_GUI */
+
+# ifdef FEAT_OLE
+# include "if_ole.pro"
+# endif
+# if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11)
+# include "if_xcmdsrv.pro"
+# endif
+
+/*
+ * The perl include files pollute the namespace, therfore proto.h must be
+ * included before the perl include files. But then CV is not defined, which
+ * is used in if_perl.pro. To get around this, the perl prototype files are
+ * not included here for the perl files. Use a dummy define for CV for the
+ * other files.
+ */
+#if defined(FEAT_PERL) && !defined(IN_PERL_FILE)
+# define CV void
+# ifdef __BORLANDC__
+# pragma option -pc
+# endif
+# include "if_perl.pro"
+# ifdef __BORLANDC__
+# pragma option -p.
+# endif
+# include "if_perlsfio.pro"
+#endif
+
+#ifdef __BORLANDC__
+# define _PROTO_H
+#endif
+#endif /* !PROTO && !NOPROTO */
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
new file mode 100644
index 000000000..b2ade2b85
--- /dev/null
+++ b/src/proto/buffer.pro
@@ -0,0 +1,66 @@
+/* buffer.c */
+int open_buffer __ARGS((int read_stdin, exarg_T *eap));
+int buf_valid __ARGS((buf_T *buf));
+void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
+void buf_clear_file __ARGS((buf_T *buf));
+void buf_freeall __ARGS((buf_T *buf, int del_buf, int wipe_buf));
+void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
+void handle_swap_exists __ARGS((buf_T *old_curbuf));
+char_u *do_bufdel __ARGS((int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit));
+int do_buffer __ARGS((int action, int start, int dir, int count, int forceit));
+void set_curbuf __ARGS((buf_T *buf, int action));
+void enter_buffer __ARGS((buf_T *buf));
+buf_T *buflist_new __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum, int flags));
+void free_buf_options __ARGS((buf_T *buf, int free_p_ff));
+int buflist_getfile __ARGS((int n, linenr_T lnum, int options, int forceit));
+void buflist_getfpos __ARGS((void));
+buf_T *buflist_findname __ARGS((char_u *ffname));
+int buflist_findpat __ARGS((char_u *pattern, char_u *pattern_end, int unlisted, int diffmode));
+int ExpandBufnames __ARGS((char_u *pat, int *num_file, char_u ***file, int options));
+buf_T *buflist_findnr __ARGS((int nr));
+char_u *buflist_nr2name __ARGS((int n, int fullname, int helptail));
+void get_winopts __ARGS((buf_T *buf));
+pos_T *buflist_findfpos __ARGS((buf_T *buf));
+linenr_T buflist_findlnum __ARGS((buf_T *buf));
+void buflist_list __ARGS((exarg_T *eap));
+int buflist_name_nr __ARGS((int fnum, char_u **fname, linenr_T *lnum));
+int setfname __ARGS((buf_T *buf, char_u *ffname, char_u *sfname, int message));
+void buf_name_changed __ARGS((buf_T *buf));
+buf_T *setaltfname __ARGS((char_u *ffname, char_u *sfname, linenr_T lnum));
+char_u *getaltfname __ARGS((int errmsg));
+int buflist_add __ARGS((char_u *fname, int flags));
+void buflist_slash_adjust __ARGS((void));
+void buflist_altfpos __ARGS((void));
+int otherfile __ARGS((char_u *ffname));
+void buf_setino __ARGS((buf_T *buf));
+void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
+void col_print __ARGS((char_u *buf, int col, int vcol));
+void maketitle __ARGS((void));
+void resettitle __ARGS((void));
+int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int fillchar, int maxwidth, struct stl_hlrec *hl));
+void get_rel_pos __ARGS((win_T *wp, char_u *str));
+int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen));
+char_u *fix_fname __ARGS((char_u *fname));
+void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname));
+char_u *alist_name __ARGS((aentry_T *aep));
+void do_arg_all __ARGS((int count, int forceit));
+void ex_buffer_all __ARGS((exarg_T *eap));
+void do_modelines __ARGS((void));
+int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
+void write_viminfo_bufferlist __ARGS((FILE *fp));
+char *buf_spname __ARGS((buf_T *buf));
+void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
+int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
+int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
+linenr_T buf_delsign __ARGS((buf_T *buf, int id));
+int buf_findsign __ARGS((buf_T *buf, int id));
+int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
+int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
+int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
+void buf_delete_all_signs __ARGS((void));
+void sign_list_placed __ARGS((buf_T *rbuf));
+void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+void set_buflisted __ARGS((int on));
+int buf_contents_changed __ARGS((buf_T *buf));
+void wipe_buffer __ARGS((buf_T *buf, int aucmd));
+/* vim: set ft=c : */
diff --git a/src/proto/charset.pro b/src/proto/charset.pro
new file mode 100644
index 000000000..88e9754b3
--- /dev/null
+++ b/src/proto/charset.pro
@@ -0,0 +1,49 @@
+/* charset.c */
+int init_chartab __ARGS((void));
+int buf_init_chartab __ARGS((buf_T *buf, int global));
+void trans_characters __ARGS((char_u *buf, int bufsize));
+char_u *transstr __ARGS((char_u *s));
+char_u *str_foldcase __ARGS((char_u *str, int len));
+char_u *transchar __ARGS((int c));
+char_u *transchar_byte __ARGS((int c));
+void transchar_nonprint __ARGS((char_u *buf, int c));
+void transchar_hex __ARGS((char_u *buf, int c));
+int byte2cells __ARGS((int b));
+int char2cells __ARGS((int c));
+int ptr2cells __ARGS((char_u *p));
+int vim_strsize __ARGS((char_u *s));
+int vim_strnsize __ARGS((char_u *s, int len));
+int chartabsize __ARGS((char_u *p, colnr_T col));
+int linetabsize __ARGS((char_u *s));
+int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len));
+int vim_isIDc __ARGS((int c));
+int vim_iswordc __ARGS((int c));
+int vim_iswordp __ARGS((char_u *p));
+int vim_iswordc_buf __ARGS((char_u *p, buf_T *buf));
+int vim_isfilec __ARGS((int c));
+int vim_isprintc __ARGS((int c));
+int vim_isprintc_strict __ARGS((int c));
+int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col));
+int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col));
+int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
+int in_win_border __ARGS((win_T *wp, colnr_T vcol));
+void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+colnr_T getvcol_nolist __ARGS((pos_T *posp));
+void getvvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end));
+void getvcols __ARGS((win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T *right));
+char_u *skipwhite __ARGS((char_u *p));
+char_u *skipdigits __ARGS((char_u *p));
+int vim_isdigit __ARGS((int c));
+int vim_isxdigit __ARGS((int c));
+char_u *skiptowhite __ARGS((char_u *p));
+char_u *skiptowhite_esc __ARGS((char_u *p));
+long getdigits __ARGS((char_u **pp));
+int vim_isblankline __ARGS((char_u *lbuf));
+void vim_str2nr __ARGS((char_u *start, int *hexp, int *len, int dooct, int dohex, long *nptr, unsigned long *unptr));
+int hex2nr __ARGS((int c));
+int hexhex2nr __ARGS((char_u *p));
+int rem_backslash __ARGS((char_u *str));
+void backslash_halve __ARGS((char_u *p));
+char_u *backslash_halve_save __ARGS((char_u *p));
+void ebcdic2ascii __ARGS((char_u *buffer, int len));
+/* vim: set ft=c : */
diff --git a/src/proto/diff.pro b/src/proto/diff.pro
new file mode 100644
index 000000000..a9fe99e56
--- /dev/null
+++ b/src/proto/diff.pro
@@ -0,0 +1,23 @@
+/* diff.c */
+void diff_new_buffer __ARGS((void));
+void diff_buf_delete __ARGS((buf_T *buf));
+void diff_buf_add __ARGS((buf_T *buf));
+void diff_invalidate __ARGS((void));
+void diff_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+void ex_diffupdate __ARGS((exarg_T *eap));
+void ex_diffpatch __ARGS((exarg_T *eap));
+void ex_diffsplit __ARGS((exarg_T *eap));
+void ex_diffthis __ARGS((exarg_T *eap));
+void diff_win_options __ARGS((win_T *wp, int addbuf));
+int diff_check __ARGS((win_T *wp, linenr_T lnum));
+int diff_check_fill __ARGS((win_T *wp, linenr_T lnum));
+void diff_set_topline __ARGS((win_T *fromwin, win_T *towin));
+int diffopt_changed __ARGS((void));
+int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
+int diff_infold __ARGS((win_T *wp, linenr_T lnum));
+void nv_diffgetput __ARGS((int put));
+void ex_diffgetput __ARGS((exarg_T *eap));
+int diff_mode_buf __ARGS((buf_T *buf));
+int diff_move_to __ARGS((int dir, long count));
+linenr_T diff_lnum_win __ARGS((linenr_T lnum, win_T *wp));
+/* vim: set ft=c : */
diff --git a/src/proto/digraph.pro b/src/proto/digraph.pro
new file mode 100644
index 000000000..be5be71ed
--- /dev/null
+++ b/src/proto/digraph.pro
@@ -0,0 +1,9 @@
+/* digraph.c */
+int do_digraph __ARGS((int c));
+int get_digraph __ARGS((int cmdline));
+int getdigraph __ARGS((int char1, int char2, int meta));
+void putdigraph __ARGS((char_u *str));
+void listdigraphs __ARGS((void));
+char_u *keymap_init __ARGS((void));
+void ex_loadkeymap __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/edit.pro b/src/proto/edit.pro
new file mode 100644
index 000000000..59939593e
--- /dev/null
+++ b/src/proto/edit.pro
@@ -0,0 +1,36 @@
+/* edit.c */
+int edit __ARGS((int cmdchar, int startln, long count));
+void edit_putchar __ARGS((int c, int highlight));
+void edit_unputchar __ARGS((void));
+void display_dollar __ARGS((colnr_T col));
+void change_indent __ARGS((int type, int amount, int round, int replaced));
+void truncate_spaces __ARGS((char_u *line));
+void backspace_until_column __ARGS((int col));
+int vim_is_ctrl_x_key __ARGS((int c));
+int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int reuse));
+char_u *find_word_start __ARGS((char_u *ptr));
+char_u *find_word_end __ARGS((char_u *ptr));
+void ins_compl_check_keys __ARGS((void));
+int get_literal __ARGS((void));
+void insertchar __ARGS((int c, int flags, int second_indent));
+void auto_format __ARGS((int trailblank, int prev_line));
+int comp_textwidth __ARGS((int ff));
+int stop_arrow __ARGS((void));
+void set_last_insert __ARGS((int c));
+char_u *add_char2buf __ARGS((int c, char_u *s));
+void beginline __ARGS((int flags));
+int oneright __ARGS((void));
+int oneleft __ARGS((void));
+int cursor_up __ARGS((long n, int upd_topline));
+int cursor_down __ARGS((long n, int upd_topline));
+int stuff_inserted __ARGS((int c, long count, int no_esc));
+char_u *get_last_insert __ARGS((void));
+char_u *get_last_insert_save __ARGS((void));
+void replace_push __ARGS((int c));
+void fixthisline __ARGS((int (*get_the_indent)(void)));
+void fix_indent __ARGS((void));
+int in_cinkeys __ARGS((int keytyped, int when, int line_is_empty));
+int hkmap __ARGS((int c));
+void ins_scroll __ARGS((void));
+void ins_horscroll __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
new file mode 100644
index 000000000..c1dfbb8e9
--- /dev/null
+++ b/src/proto/eval.pro
@@ -0,0 +1,60 @@
+/* eval.c */
+char_u *func_name __ARGS((void *cookie));
+linenr_T *func_breakpoint __ARGS((void *cookie));
+int *func_dbg_tick __ARGS((void *cookie));
+int func_level __ARGS((void *cookie));
+int current_func_returned __ARGS((void));
+void set_internal_string_var __ARGS((char_u *name, char_u *value));
+int eval_charconvert __ARGS((char_u *enc_from, char_u *enc_to, char_u *fname_from, char_u *fname_to));
+int eval_printexpr __ARGS((char_u *fname, char_u *args));
+void eval_diff __ARGS((char_u *origfile, char_u *newfile, char_u *outfile));
+void eval_patch __ARGS((char_u *origfile, char_u *difffile, char_u *outfile));
+int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
+char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
+char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd));
+char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd));
+int eval_to_number __ARGS((char_u *expr));
+char_u *call_vim_function __ARGS((char_u *func, int argc, char_u **argv, int safe));
+void *save_funccal __ARGS((void));
+void restore_funccal __ARGS((void *fc));
+int eval_foldexpr __ARGS((char_u *arg, int *cp));
+void ex_let __ARGS((exarg_T *eap));
+void set_context_for_expression __ARGS((expand_T *xp, char_u *arg, cmdidx_T cmdidx));
+void ex_call __ARGS((exarg_T *eap));
+void ex_unlet __ARGS((exarg_T *eap));
+int do_unlet __ARGS((char_u *name));
+void del_menutrans_vars __ARGS((void));
+char_u *get_user_var_name __ARGS((expand_T *xp, int idx));
+char_u *get_function_name __ARGS((expand_T *xp, int idx));
+char_u *get_expr_name __ARGS((expand_T *xp, int idx));
+void set_vim_var_nr __ARGS((int idx, long val));
+long get_vim_var_nr __ARGS((int idx));
+void set_vcount __ARGS((long count, long count1));
+void set_vim_var_string __ARGS((int idx, char_u *val, int len));
+void set_reg_var __ARGS((int c));
+char_u *v_exception __ARGS((char_u *oldval));
+char_u *v_throwpoint __ARGS((char_u *oldval));
+char_u *set_cmdarg __ARGS((exarg_T *eap, char_u *oldarg));
+char_u *get_var_value __ARGS((char_u *name));
+void new_script_vars __ARGS((scid_T id));
+void var_init __ARGS((garray_T *gap));
+void var_clear __ARGS((garray_T *gap));
+void ex_echo __ARGS((exarg_T *eap));
+void ex_echohl __ARGS((exarg_T *eap));
+void ex_execute __ARGS((exarg_T *eap));
+void ex_function __ARGS((exarg_T *eap));
+char_u *get_user_func_name __ARGS((expand_T *xp, int idx));
+void ex_delfunction __ARGS((exarg_T *eap));
+void ex_return __ARGS((exarg_T *eap));
+int do_return __ARGS((exarg_T *eap, int reanimate, int is_cmd, void *value));
+void discard_pending_return __ARGS((void *retvar));
+char_u *get_return_cmd __ARGS((void *retvar));
+char_u *get_func_line __ARGS((int c, void *cookie, int indent));
+int func_has_ended __ARGS((void *cookie));
+int func_has_abort __ARGS((void *cookie));
+int read_viminfo_varlist __ARGS((vir_T *virp, int writing));
+void write_viminfo_varlist __ARGS((FILE *fp));
+int store_session_globals __ARGS((FILE *fd));
+int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
+char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
+/* vim: set ft=c : */
diff --git a/src/proto/ex_cmds.pro b/src/proto/ex_cmds.pro
new file mode 100644
index 000000000..33f105a09
--- /dev/null
+++ b/src/proto/ex_cmds.pro
@@ -0,0 +1,52 @@
+/* ex_cmds.c */
+void do_ascii __ARGS((exarg_T *eap));
+void ex_align __ARGS((exarg_T *eap));
+void ex_retab __ARGS((exarg_T *eap));
+int do_move __ARGS((linenr_T line1, linenr_T line2, linenr_T dest));
+void ex_copy __ARGS((linenr_T line1, linenr_T line2, linenr_T n));
+void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
+void do_shell __ARGS((char_u *cmd, int flags));
+char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
+void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
+int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
+int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit));
+void write_viminfo __ARGS((char_u *file, int forceit));
+int viminfo_readline __ARGS((vir_T *virp));
+char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
+void viminfo_writestring __ARGS((FILE *fd, char_u *p));
+void do_fixdel __ARGS((exarg_T *eap));
+void print_line_no_prefix __ARGS((linenr_T lnum, int use_number));
+void print_line __ARGS((linenr_T lnum, int use_number));
+void ex_file __ARGS((exarg_T *eap));
+void ex_update __ARGS((exarg_T *eap));
+void ex_write __ARGS((exarg_T *eap));
+int do_write __ARGS((exarg_T *eap));
+void ex_wnext __ARGS((exarg_T *eap));
+void do_wqall __ARGS((exarg_T *eap));
+int not_writing __ARGS((void));
+int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
+int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags));
+void ex_append __ARGS((exarg_T *eap));
+void ex_change __ARGS((exarg_T *eap));
+void ex_z __ARGS((exarg_T *eap));
+int check_restricted __ARGS((void));
+int check_secure __ARGS((void));
+void do_sub __ARGS((exarg_T *eap));
+void ex_global __ARGS((exarg_T *eap));
+void global_exe __ARGS((char_u *cmd));
+int read_viminfo_sub_string __ARGS((vir_T *virp, int force));
+void write_viminfo_sub_string __ARGS((FILE *fp));
+void prepare_tagpreview __ARGS((void));
+void ex_help __ARGS((exarg_T *eap));
+int help_heuristic __ARGS((char_u *matched_string, int offset, int wrong_case));
+int find_help_tags __ARGS((char_u *arg, int *num_matches, char_u ***matches, int keep_lang));
+void fix_help_buffer __ARGS((void));
+void ex_helptags __ARGS((exarg_T *eap));
+void ex_sign __ARGS((exarg_T *eap));
+void sign_gui_started __ARGS((void));
+int sign_get_attr __ARGS((int typenr, int line));
+char_u *sign_get_text __ARGS((int typenr));
+void *sign_get_image __ARGS((int typenr));
+char_u *sign_typenr2name __ARGS((int typenr));
+void ex_drop __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/ex_cmds2.pro b/src/proto/ex_cmds2.pro
new file mode 100644
index 000000000..adf2d8f36
--- /dev/null
+++ b/src/proto/ex_cmds2.pro
@@ -0,0 +1,76 @@
+/* ex_cmds2.c */
+void do_debug __ARGS((char_u *cmd));
+void ex_debug __ARGS((exarg_T *eap));
+void dbg_check_breakpoint __ARGS((exarg_T *eap));
+int dbg_check_skipped __ARGS((exarg_T *eap));
+void ex_breakadd __ARGS((exarg_T *eap));
+void ex_debuggreedy __ARGS((exarg_T *eap));
+void ex_breakdel __ARGS((exarg_T *eap));
+void ex_breaklist __ARGS((exarg_T *eap));
+linenr_T dbg_find_breakpoint __ARGS((int file, char_u *fname, linenr_T after));
+void dbg_breakpoint __ARGS((char_u *name, linenr_T lnum));
+int autowrite __ARGS((buf_T *buf, int forceit));
+void autowrite_all __ARGS((void));
+int check_changed __ARGS((buf_T *buf, int checkaw, int mult_win, int forceit, int allbuf));
+void browse_save_fname __ARGS((buf_T *buf));
+void dialog_changed __ARGS((buf_T *buf, int checkall));
+int can_abandon __ARGS((buf_T *buf, int forceit));
+int check_changed_any __ARGS((int hidden));
+int check_fname __ARGS((void));
+int buf_write_all __ARGS((buf_T *buf, int forceit));
+char_u *do_one_arg __ARGS((char_u *str));
+void set_arglist __ARGS((char_u *str));
+void check_arg_idx __ARGS((win_T *win));
+void ex_args __ARGS((exarg_T *eap));
+void ex_previous __ARGS((exarg_T *eap));
+void ex_rewind __ARGS((exarg_T *eap));
+void ex_last __ARGS((exarg_T *eap));
+void ex_argument __ARGS((exarg_T *eap));
+void do_argfile __ARGS((exarg_T *eap, int argn));
+void ex_next __ARGS((exarg_T *eap));
+void ex_argedit __ARGS((exarg_T *eap));
+void ex_argadd __ARGS((exarg_T *eap));
+void ex_argdelete __ARGS((exarg_T *eap));
+void ex_listdo __ARGS((exarg_T *eap));
+void ex_compiler __ARGS((exarg_T *eap));
+void ex_runtime __ARGS((exarg_T *eap));
+int cmd_runtime __ARGS((char_u *name, int all));
+int do_in_runtimepath __ARGS((char_u *name, int all, void (*callback)(char_u *fname)));
+void ex_options __ARGS((exarg_T *eap));
+void ex_source __ARGS((exarg_T *eap));
+linenr_T *source_breakpoint __ARGS((void *cookie));
+int *source_dbg_tick __ARGS((void *cookie));
+int source_level __ARGS((void *cookie));
+int do_source __ARGS((char_u *fname, int check_other, int is_vimrc));
+void ex_scriptnames __ARGS((exarg_T *eap));
+void scriptnames_slash_adjust __ARGS((void));
+char_u *get_scriptname __ARGS((scid_T id));
+char *fgets_cr __ARGS((char *s, int n, FILE *stream));
+char_u *getsourceline __ARGS((int c, void *cookie, int indent));
+void ex_scriptencoding __ARGS((exarg_T *eap));
+void ex_finish __ARGS((exarg_T *eap));
+void do_finish __ARGS((exarg_T *eap, int reanimate));
+int source_finished __ARGS((char_u *(*getline)(int, void *, int), void *cookie));
+void ex_checktime __ARGS((exarg_T *eap));
+int get_printer_page_num __ARGS((void));
+int prt_header_height __ARGS((void));
+int prt_use_number __ARGS((void));
+int prt_get_unit __ARGS((int idx));
+void ex_hardcopy __ARGS((exarg_T *eap));
+void mch_print_cleanup __ARGS((void));
+int mch_print_init __ARGS((prt_settings_T *psettings, char_u *jobname, int forceit));
+int mch_print_begin __ARGS((prt_settings_T *psettings));
+void mch_print_end __ARGS((prt_settings_T *psettings));
+int mch_print_end_page __ARGS((void));
+int mch_print_begin_page __ARGS((char_u *str));
+int mch_print_blank_page __ARGS((void));
+void mch_print_start_line __ARGS((int margin, int page_line));
+int mch_print_text_out __ARGS((char_u *p, int len));
+void mch_print_set_font __ARGS((int iBold, int iItalic, int iUnderline));
+void mch_print_set_bg __ARGS((long_u bgcol));
+void mch_print_set_fg __ARGS((long_u fgcol));
+char_u *get_mess_lang __ARGS((void));
+void set_lang_var __ARGS((void));
+void ex_language __ARGS((exarg_T *eap));
+char_u *get_lang_arg __ARGS((expand_T *xp, int idx));
+/* vim: set ft=c : */
diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro
new file mode 100644
index 000000000..6efec49f5
--- /dev/null
+++ b/src/proto/ex_docmd.pro
@@ -0,0 +1,41 @@
+/* ex_docmd.c */
+void do_exmode __ARGS((int improved));
+int do_cmdline_cmd __ARGS((char_u *cmd));
+int do_cmdline __ARGS((char_u *cmdline, char_u *(*getline)(int, void *, int), void *cookie, int flags));
+int getline_equal __ARGS((char_u *(*getline)(int, void *, int), void *cookie, char_u *(*func)(int, void *, int)));
+void *getline_cookie __ARGS((char_u *(*getline)(int, void *, int), void *cookie));
+int cmd_exists __ARGS((char_u *name));
+char_u *set_one_cmd_context __ARGS((expand_T *xp, char_u *buff));
+char_u *skip_range __ARGS((char_u *cmd, int *ctx));
+void ex_ni __ARGS((exarg_T *eap));
+int expand_filename __ARGS((exarg_T *eap, char_u **cmdlinep, char_u **errormsgp));
+void separate_nextcmd __ARGS((exarg_T *eap));
+int ends_excmd __ARGS((int c));
+char_u *find_nextcmd __ARGS((char_u *p));
+char_u *check_nextcmd __ARGS((char_u *p));
+char_u *get_command_name __ARGS((expand_T *xp, int idx));
+void uc_clear __ARGS((garray_T *gap));
+char_u *get_user_commands __ARGS((expand_T *xp, int idx));
+char_u *get_user_cmd_flags __ARGS((expand_T *xp, int idx));
+char_u *get_user_cmd_nargs __ARGS((expand_T *xp, int idx));
+char_u *get_user_cmd_complete __ARGS((expand_T *xp, int idx));
+void not_exiting __ARGS((void));
+void handle_drop __ARGS((int filec, char_u **filev, int split));
+void alist_init __ARGS((alist_T *al));
+void alist_unlink __ARGS((alist_T *al));
+void alist_new __ARGS((void));
+void alist_expand __ARGS((void));
+void alist_set __ARGS((alist_T *al, int count, char_u **files, int use_curbuf));
+void alist_add __ARGS((alist_T *al, char_u *fname, int set_fnum));
+void alist_slash_adjust __ARGS((void));
+void ex_splitview __ARGS((exarg_T *eap));
+void do_exedit __ARGS((exarg_T *eap, win_T *old_curwin));
+void do_sleep __ARGS((long msec));
+FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
+void update_topline_cursor __ARGS((void));
+char_u *eval_vars __ARGS((char_u *src, int *usedlen, linenr_T *lnump, char_u **errormsg, char_u *srcstart));
+char_u *expand_sfile __ARGS((char_u *arg));
+int put_eol __ARGS((FILE *fd));
+int put_line __ARGS((FILE *fd, char *s));
+void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
+/* vim: set ft=c : */
diff --git a/src/proto/ex_eval.pro b/src/proto/ex_eval.pro
new file mode 100644
index 000000000..80ecfcabd
--- /dev/null
+++ b/src/proto/ex_eval.pro
@@ -0,0 +1,29 @@
+/* ex_eval.c */
+int aborting __ARGS((void));
+void update_force_abort __ARGS((void));
+int should_abort __ARGS((int retcode));
+int aborted_in_try __ARGS((void));
+int cause_errthrow __ARGS((char_u *mesg, int severe, int *ignore));
+void do_errthrow __ARGS((struct condstack *cstack, char_u *cmdname));
+int do_intthrow __ARGS((struct condstack *cstack));
+void discard_current_exception __ARGS((void));
+void report_make_pending __ARGS((int pending, void *value));
+void report_resume_pending __ARGS((int pending, void *value));
+void report_discard_pending __ARGS((int pending, void *value));
+void ex_if __ARGS((exarg_T *eap));
+void ex_endif __ARGS((exarg_T *eap));
+void ex_else __ARGS((exarg_T *eap));
+void ex_while __ARGS((exarg_T *eap));
+void ex_continue __ARGS((exarg_T *eap));
+void ex_break __ARGS((exarg_T *eap));
+void ex_endwhile __ARGS((exarg_T *eap));
+void ex_throw __ARGS((exarg_T *eap));
+void do_throw __ARGS((struct condstack *cstack));
+void ex_try __ARGS((exarg_T *eap));
+void ex_catch __ARGS((exarg_T *eap));
+void ex_finally __ARGS((exarg_T *eap));
+void ex_endtry __ARGS((exarg_T *eap));
+int cleanup_conditionals __ARGS((struct condstack *cstack, int searched_cond, int inclusive));
+void ex_endfunction __ARGS((exarg_T *eap));
+int has_while_cmd __ARGS((char_u *p));
+/* vim: set ft=c : */
diff --git a/src/proto/ex_getln.pro b/src/proto/ex_getln.pro
new file mode 100644
index 000000000..aa791ac9c
--- /dev/null
+++ b/src/proto/ex_getln.pro
@@ -0,0 +1,47 @@
+/* ex_getln.c */
+char_u *getcmdline __ARGS((int firstc, long count, int indent));
+char_u *getcmdline_prompt __ARGS((int firstc, char_u *prompt, int attr));
+char_u *getexline __ARGS((int c, void *dummy, int indent));
+char_u *getexmodeline __ARGS((int c, void *dummy, int indent));
+int cmdline_overstrike __ARGS((void));
+int cmdline_at_end __ARGS((void));
+colnr_T cmdline_getvcol_cursor __ARGS((void));
+void putcmdline __ARGS((int c, int shift));
+void unputcmdline __ARGS((void));
+int put_on_cmdline __ARGS((char_u *str, int len, int redraw));
+void redrawcmdline __ARGS((void));
+void redrawcmd __ARGS((void));
+void compute_cmdrow __ARGS((void));
+void gotocmdline __ARGS((int clr));
+char_u *ExpandOne __ARGS((expand_T *xp, char_u *str, char_u *orig, int options, int mode));
+void ExpandInit __ARGS((expand_T *xp));
+void ExpandCleanup __ARGS((expand_T *xp));
+void ExpandEscape __ARGS((expand_T *xp, char_u *str, int numfiles, char_u **files, int options));
+void tilde_replace __ARGS((char_u *orig_pat, int num_files, char_u **files));
+char_u *sm_gettail __ARGS((char_u *s));
+char_u *addstar __ARGS((char_u *fname, int len, int context));
+void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
+int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
+int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int))));
+char_u *globpath __ARGS((char_u *path, char_u *file));
+int get_histtype __ARGS((char_u *name));
+void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
+int get_history_idx __ARGS((int histype));
+char_u *get_cmdline_str __ARGS((void));
+int get_cmdline_pos __ARGS((void));
+int set_cmdline_pos __ARGS((int pos));
+char_u *get_history_entry __ARGS((int histype, int idx));
+int clr_history __ARGS((int histype));
+int del_history_entry __ARGS((int histype, char_u *str));
+int del_history_idx __ARGS((int histype, int idx));
+void remove_key_from_history __ARGS((void));
+int get_list_range __ARGS((char_u **str, int *num1, int *num2));
+void ex_history __ARGS((exarg_T *eap));
+void prepare_viminfo_history __ARGS((int asklen));
+int read_viminfo_history __ARGS((vir_T *virp));
+void finish_viminfo_history __ARGS((void));
+void write_viminfo_history __ARGS((FILE *fp));
+void cmd_pchar __ARGS((int c, int offset));
+int cmd_gchar __ARGS((int offset));
+char_u *script_get __ARGS((exarg_T *eap, char_u *cmd));
+/* vim: set ft=c : */
diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro
new file mode 100644
index 000000000..fa275f463
--- /dev/null
+++ b/src/proto/fileio.pro
@@ -0,0 +1,39 @@
+/* fileio.c */
+void filemess __ARGS((buf_T *buf, char_u *name, char_u *s, int attr));
+int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags));
+int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
+int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
+char_u *shorten_fname __ARGS((char_u *full_path, char_u *dir_name));
+void shorten_fnames __ARGS((int force));
+void shorten_filenames __ARGS((char_u **fnames, int count));
+char_u *modname __ARGS((char_u *fname, char_u *ext, int prepend_dot));
+char_u *buf_modname __ARGS((int shortname, char_u *fname, char_u *ext, int prepend_dot));
+int vim_fgets __ARGS((char_u *buf, int size, FILE *fp));
+int tag_fgets __ARGS((char_u *buf, int size, FILE *fp));
+int vim_rename __ARGS((char_u *from, char_u *to));
+int check_timestamps __ARGS((int focus));
+int buf_check_timestamp __ARGS((buf_T *buf, int focus));
+void buf_store_time __ARGS((buf_T *buf, struct stat *st, char_u *fname));
+void write_lnum_adjust __ARGS((linenr_T offset));
+void vim_deltempdir __ARGS((void));
+char_u *vim_tempname __ARGS((int extra_char));
+void forward_slash __ARGS((char_u *fname));
+void do_augroup __ARGS((char_u *arg, int del_group));
+int check_ei __ARGS((void));
+void do_autocmd __ARGS((char_u *arg, int forceit));
+int do_doautocmd __ARGS((char_u *arg, int do_msg));
+void ex_doautoall __ARGS((exarg_T *eap));
+void aucmd_prepbuf __ARGS((aco_save_T *aco, buf_T *buf));
+void aucmd_restbuf __ARGS((aco_save_T *aco));
+int apply_autocmds __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf));
+int apply_autocmds_retval __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval));
+int has_cursorhold __ARGS((void));
+int has_autocmd __ARGS((EVENT_T event, char_u *sfname));
+char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
+char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
+char_u *get_event_name __ARGS((expand_T *xp, int idx));
+int au_exists __ARGS((char_u *name, char_u *name_end, char_u *pattern));
+int match_file_pat __ARGS((char_u *pattern, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
+int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
+char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, char *allow_dirs, int no_bslash));
+/* vim: set ft=c : */
diff --git a/src/proto/fold.pro b/src/proto/fold.pro
new file mode 100644
index 000000000..75af30563
--- /dev/null
+++ b/src/proto/fold.pro
@@ -0,0 +1,40 @@
+/* fold.c */
+void copyFoldingState __ARGS((win_T *wp_from, win_T *wp_to));
+int hasAnyFolding __ARGS((win_T *win));
+int hasFolding __ARGS((linenr_T lnum, linenr_T *firstp, linenr_T *lastp));
+int hasFoldingWin __ARGS((win_T *win, linenr_T lnum, linenr_T *firstp, linenr_T *lastp, int cache, foldinfo_T *infop));
+int foldLevel __ARGS((linenr_T lnum));
+int lineFolded __ARGS((win_T *win, linenr_T lnum));
+long foldedCount __ARGS((win_T *win, linenr_T lnum, foldinfo_T *infop));
+int foldmethodIsManual __ARGS((win_T *wp));
+int foldmethodIsIndent __ARGS((win_T *wp));
+int foldmethodIsExpr __ARGS((win_T *wp));
+int foldmethodIsMarker __ARGS((win_T *wp));
+int foldmethodIsSyntax __ARGS((win_T *wp));
+int foldmethodIsDiff __ARGS((win_T *wp));
+void closeFold __ARGS((linenr_T lnum, long count));
+void closeFoldRecurse __ARGS((linenr_T lnum));
+void opFoldRange __ARGS((linenr_T first, linenr_T last, int opening, int recurse, int had_visual));
+void openFold __ARGS((linenr_T lnum, long count));
+void openFoldRecurse __ARGS((linenr_T lnum));
+void foldOpenCursor __ARGS((void));
+void newFoldLevel __ARGS((void));
+void foldCheckClose __ARGS((void));
+int foldManualAllowed __ARGS((int create));
+void foldCreate __ARGS((linenr_T start, linenr_T end));
+void deleteFold __ARGS((linenr_T start, linenr_T end, int recursive, int had_visual));
+void clearFolding __ARGS((win_T *win));
+void foldUpdate __ARGS((win_T *wp, linenr_T top, linenr_T bot));
+void foldUpdateAll __ARGS((win_T *win));
+int foldMoveTo __ARGS((int updown, int dir, long count));
+void foldInitWin __ARGS((win_T *newwin));
+int find_wl_entry __ARGS((win_T *win, linenr_T lnum));
+void foldAdjustVisual __ARGS((void));
+void foldAdjustCursor __ARGS((void));
+void cloneFoldGrowArray __ARGS((garray_T *from, garray_T *to));
+void deleteFoldRecurse __ARGS((garray_T *gap));
+void foldMarkAdjust __ARGS((win_T *wp, linenr_T line1, linenr_T line2, long amount, long amount_after));
+int getDeepestNesting __ARGS((void));
+void foldtext_cleanup __ARGS((char_u *str));
+int put_folds __ARGS((FILE *fd, win_T *wp));
+/* vim: set ft=c : */
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
new file mode 100644
index 000000000..fc49b7972
--- /dev/null
+++ b/src/proto/getchar.pro
@@ -0,0 +1,61 @@
+/* getchar.c */
+void free_buff __ARGS((struct buffheader *buf));
+char_u *get_recorded __ARGS((void));
+char_u *get_inserted __ARGS((void));
+int stuff_empty __ARGS((void));
+void typeahead_noflush __ARGS((int c));
+void flush_buffers __ARGS((int typeahead));
+void ResetRedobuff __ARGS((void));
+void saveRedobuff __ARGS((void));
+void restoreRedobuff __ARGS((void));
+void AppendToRedobuff __ARGS((char_u *s));
+void AppendToRedobuffLit __ARGS((char_u *s));
+void AppendCharToRedobuff __ARGS((int c));
+void AppendNumberToRedobuff __ARGS((long n));
+void stuffReadbuff __ARGS((char_u *s));
+void stuffReadbuffLen __ARGS((char_u *s, long len));
+void stuffReadbuffSpec __ARGS((char_u *s));
+void stuffcharReadbuff __ARGS((int c));
+void stuffnumReadbuff __ARGS((long n));
+int start_redo __ARGS((long count, int old_redo));
+int start_redo_ins __ARGS((void));
+void stop_redo_ins __ARGS((void));
+int ins_typebuf __ARGS((char_u *str, int noremap, int offset, int nottyped, int silent));
+int typebuf_changed __ARGS((int tb_change_cnt));
+int typebuf_typed __ARGS((void));
+int typebuf_maplen __ARGS((void));
+void del_typebuf __ARGS((int len, int offset));
+int alloc_typebuf __ARGS((void));
+void free_typebuf __ARGS((void));
+int save_typebuf __ARGS((void));
+void save_typeahead __ARGS((tasave_T *tp));
+void restore_typeahead __ARGS((tasave_T *tp));
+void openscript __ARGS((char_u *name, int directly));
+int using_script __ARGS((void));
+void updatescript __ARGS((int c));
+int vgetc __ARGS((void));
+int safe_vgetc __ARGS((void));
+int vpeekc __ARGS((void));
+int vpeekc_nomap __ARGS((void));
+int vpeekc_any __ARGS((void));
+int char_avail __ARGS((void));
+void vungetc __ARGS((int c));
+int inchar __ARGS((char_u *buf, int maxlen, long wait_time, int tb_change_cnt));
+int fix_input_buffer __ARGS((char_u *buf, int len, int script));
+int input_available __ARGS((void));
+int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
+int get_map_mode __ARGS((char_u **cmdp, int forceit));
+void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
+void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
+int map_to_exists __ARGS((char_u *str, char_u *modechars));
+int map_to_exists_mode __ARGS((char_u *rhs, int mode));
+char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
+int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
+int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
+int makemap __ARGS((FILE *fd, buf_T *buf));
+int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
+void check_map_keycodes __ARGS((void));
+char_u *check_map __ARGS((char_u *keys, int mode, int exact));
+void init_mappings __ARGS((void));
+void add_map __ARGS((char_u *map, int mode));
+/* vim: set ft=c : */
diff --git a/src/proto/gui.pro b/src/proto/gui.pro
new file mode 100644
index 000000000..cb254d7d9
--- /dev/null
+++ b/src/proto/gui.pro
@@ -0,0 +1,61 @@
+/* gui.c */
+void gui_start __ARGS((void));
+void gui_prepare __ARGS((int *argc, char **argv));
+int gui_init_check __ARGS((void));
+void gui_init __ARGS((void));
+void gui_exit __ARGS((int rc));
+void gui_shell_closed __ARGS((void));
+int gui_init_font __ARGS((char_u *font_list, int fontset));
+int gui_get_wide_font __ARGS((void));
+void gui_set_cursor __ARGS((int row, int col));
+void gui_update_cursor __ARGS((int force, int clear_selection));
+void gui_position_menu __ARGS((void));
+int gui_get_base_width __ARGS((void));
+int gui_get_base_height __ARGS((void));
+void gui_resize_shell __ARGS((int pixel_width, int pixel_height));
+void gui_may_resize_shell __ARGS((void));
+int gui_get_shellsize __ARGS((void));
+void gui_set_shellsize __ARGS((int mustset, int fit_to_display));
+void gui_new_shellsize __ARGS((void));
+void gui_reset_scroll_region __ARGS((void));
+void gui_start_highlight __ARGS((int mask));
+void gui_stop_highlight __ARGS((int mask));
+void gui_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_update_cursor_later __ARGS((void));
+void gui_write __ARGS((char_u *s, int len));
+void gui_dont_update_cursor __ARGS((void));
+void gui_can_update_cursor __ARGS((void));
+int gui_outstr_nowrap __ARGS((char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back));
+void gui_undraw_cursor __ARGS((void));
+void gui_redraw __ARGS((int x, int y, int w, int h));
+int gui_redraw_block __ARGS((int row1, int col1, int row2, int col2, int flags));
+int gui_wait_for_chars __ARGS((long wtime));
+void gui_send_mouse_event __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
+int gui_xy2colrow __ARGS((int x, int y, int *colp));
+void gui_menu_cb __ARGS((vimmenu_T *menu));
+void gui_init_which_components __ARGS((char_u *oldval));
+void gui_create_scrollbar __ARGS((scrollbar_T *sb, int type, win_T *wp));
+scrollbar_T *gui_find_scrollbar __ARGS((long ident));
+void gui_drag_scrollbar __ARGS((scrollbar_T *sb, long value, int still_dragging));
+void gui_update_scrollbars __ARGS((int force));
+int gui_do_scroll __ARGS((void));
+int gui_do_horiz_scroll __ARGS((void));
+void gui_check_colors __ARGS((void));
+void gui_set_fg_color __ARGS((char_u *name));
+void gui_set_bg_color __ARGS((char_u *name));
+guicolor_T gui_get_color __ARGS((char_u *name));
+int gui_get_lightness __ARGS((guicolor_T pixel));
+void gui_new_scrollbar_colors __ARGS((void));
+void gui_focus_change __ARGS((int in_focus));
+void gui_mouse_moved __ARGS((int x, int y));
+void gui_mouse_correct __ARGS((void));
+void ex_gui __ARGS((exarg_T *eap));
+int gui_find_bitmap __ARGS((char_u *name, char_u *buffer, char *ext));
+void gui_find_iconfile __ARGS((char_u *name, char_u *buffer, char *ext));
+void display_errors __ARGS((void));
+int no_console_input __ARGS((void));
+void gui_update_screen __ARGS((void));
+char_u *get_find_dialog_text __ARGS((char_u *arg, int *wwordp, int *mcasep));
+int gui_do_findrepl __ARGS((int flags, char_u *find_text, char_u *repl_text, int down));
+void gui_handle_drop __ARGS((int x, int y, int_u modifiers, char_u **fnames, int count));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_amiga.pro b/src/proto/gui_amiga.pro
new file mode 100644
index 000000000..ec70bc102
--- /dev/null
+++ b/src/proto/gui_amiga.pro
@@ -0,0 +1,67 @@
+/* gui_amiga.c */
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+int gui_mch_set_blinking __ARGS((long wait, long on, long off));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+void atexitDoThis __ARGS((void));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_init __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_mch_exit __ARGS((int returnCode));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
+int gui_mch_adjust_charsize __ARGS((void));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_free_font __ARGS((GuiFont font));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+void gui_mch_set_colors __ARGS((guicolor_T fg, guicolor_T bg));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((int wtime));
+void gui_mch_flush __ARGS((void));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void mch_setmouse __ARGS((int on));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_athena.pro b/src/proto/gui_athena.pro
new file mode 100644
index 000000000..353c33b07
--- /dev/null
+++ b/src/proto/gui_athena.pro
@@ -0,0 +1,31 @@
+/* gui_athena.c */
+void gui_x11_create_widgets __ARGS((void));
+void gui_x11_destroy_widgets __ARGS((void));
+void gui_mch_set_toolbar_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_x11_set_back_color __ARGS((void));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_new_menu_font __ARGS((void));
+void gui_mch_new_tooltip_font __ARGS((void));
+void gui_mch_new_tooltip_colors __ARGS((void));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_show_toolbar __ARGS((int showit));
+int gui_mch_compute_toolbar_height __ARGS((void));
+void gui_mch_get_toolbar_colors __ARGS((Pixel *bgp, Pixel *fgp, Pixel *bsp, Pixel *tsp, Pixel *hsp));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+void gui_mch_new_menu_colors __ARGS((void));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_mch_def_colors __ARGS((void));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
+Window gui_x11_get_wid __ARGS((void));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_beos.pro b/src/proto/gui_beos.pro
new file mode 100644
index 000000000..af52885f8
--- /dev/null
+++ b/src/proto/gui_beos.pro
@@ -0,0 +1,14 @@
+/* gui_beos.cc - hand crafted */
+int vim_lock_screen __ARGS((void));
+void vim_unlock_screen __ARGS((void));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_mch_exit __ARGS((int vim_exitcode));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_flush __ARGS((void));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+void gui_mch_set_winpos __ARGS((int x, int y));
diff --git a/src/proto/gui_beval.pro b/src/proto/gui_beval.pro
new file mode 100644
index 000000000..160b0e1bd
--- /dev/null
+++ b/src/proto/gui_beval.pro
@@ -0,0 +1,10 @@
+/* gui_beval.c */
+BalloonEval *gui_mch_create_beval_area __ARGS((void *target, char_u *mesg, void (*mesgCB)(BalloonEval *, int), void *clientData));
+void gui_mch_destroy_beval_area __ARGS((BalloonEval *beval));
+void gui_mch_enable_beval_area __ARGS((BalloonEval *beval));
+void gui_mch_disable_beval_area __ARGS((BalloonEval *beval));
+BalloonEval *gui_mch_currently_showing_beval __ARGS((void));
+int gui_mch_get_beval_info __ARGS((BalloonEval *beval, char_u **filename, int *line, char_u **text, int *idx));
+void gui_mch_post_balloon __ARGS((BalloonEval *beval, char_u *mesg));
+void gui_mch_unpost_balloon __ARGS((BalloonEval *beval));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_gtk.pro b/src/proto/gui_gtk.pro
new file mode 100644
index 000000000..2ff220553
--- /dev/null
+++ b/src/proto/gui_gtk.pro
@@ -0,0 +1,24 @@
+/* gui_gtk.c */
+void gui_gtk_register_stock_icons __ARGS((void));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_gtk_set_mnemonics __ARGS((int enable));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+void gui_mch_menu_set_tip __ARGS((vimmenu_T *menu));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_make_popup __ARGS((char_u *path_name));
+void gui_mch_find_dialog __ARGS((exarg_T *eap));
+void gui_mch_replace_dialog __ARGS((exarg_T *eap));
+void gui_gtk_synch_fonts __ARGS((void));
+void ex_helpfind __ARGS((exarg_T *eap));
+void gui_gtk_position_in_parent __ARGS((GtkWidget *parent, GtkWidget *child, gui_win_pos_T where));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_gtk_x11.pro b/src/proto/gui_gtk_x11.pro
new file mode 100644
index 000000000..a3bfaa464
--- /dev/null
+++ b/src/proto/gui_gtk_x11.pro
@@ -0,0 +1,67 @@
+/* gui_gtk_x11.c */
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_init __ARGS((void));
+void gui_mch_forked __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_mch_exit __ARGS((int rc));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void gui_mch_enable_menu __ARGS((int showit));
+void gui_mch_show_toolbar __ARGS((int showit));
+int gui_mch_adjust_charsize __ARGS((void));
+GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int report_error, int fixed_width));
+char_u *gui_mch_font_dialog __ARGS((char_u *oldval));
+int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_set_fontset __ARGS((GuiFontset fontset));
+void gui_mch_free_font __ARGS((GuiFont font));
+void gui_mch_free_fontset __ARGS((GuiFontset fontset));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+int gui_gtk2_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+int gui_mch_haskey __ARGS((char_u *name));
+int gui_get_x11_windis __ARGS((Window *win, Display **dis));
+Display *gui_mch_get_display __ARGS((void));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((long wtime));
+void gui_mch_flush __ARGS((void));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_mousehide __ARGS((int hide));
+void mch_set_mouse_shape __ARGS((int shape));
+void gui_mch_drawsign __ARGS((int row, int col, int typenr));
+void *gui_mch_register_sign __ARGS((char_u *signfile));
+void gui_mch_destroy_sign __ARGS((void *sign));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_mac.pro b/src/proto/gui_mac.pro
new file mode 100644
index 000000000..6f595e2bd
--- /dev/null
+++ b/src/proto/gui_mac.pro
@@ -0,0 +1,142 @@
+/* gui_mac.c */
+
+/*
+ * Mac specific prototypes
+ */
+
+pascal Boolean WaitNextEventWrp __ARGS((EventMask eventMask, EventRecord *theEvent, UInt32 sleep, RgnHandle mouseRgn));
+pascal void gui_mac_scroll_action __ARGS((ControlHandle theControl, short partCode));
+pascal void gui_mac_drag_thumb (ControlHandle theControl, short partCode);
+void gui_mac_handle_event __ARGS((EventRecord *event));
+void gui_mac_doMouseDown __ARGS((EventRecord *theEvent));
+void gui_mac_do_key __ARGS((EventRecord *theEvent));
+void gui_mac_handle_menu __ARGS((long menuChoice));
+void gui_mac_focus_change __ARGS((EventRecord *event));
+void gui_mac_update __ARGS((EventRecord *event));
+short gui_mch_get_mac_menu_item_index __ARGS((vimmenu_T *menu, vimmenu_T *parent));
+void gui_mch_set_blinking __ARGS((long wait, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_init __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_mch_exit __ARGS((int));
+void gui_mch_set_winsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+int gui_mch_adjust_charsize __ARGS((void));
+int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+GuiFont gui_mac_find_font __ARGS((char_u *font_name));
+void gui_mch_set_font __ARGS((GuiFont font));
+int gui_mch_same_font __ARGS((GuiFont f1, GuiFont f2));
+void gui_mch_free_font __ARGS((GuiFont font));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((int wtime));
+void gui_mch_flush __ARGS((void));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+/*void gui_mch_add_menu __ARGS((vimmenu_T *menu, vimmenu_T *parent, int idx));*/
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int pos));
+/*void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, vimmenu_T *parent, int idx));*/
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+int gui_mch_get_lightness __ARGS((guicolor_T pixel));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+void gui_mch_set_foreground __ARGS((void));
+
+char_u *C2Pascal_save __ARGS((char_u *Cstring));
+char_u *C2Pascal_save_and_remove_backslash __ARGS((char_u *Cstring));
+int_u EventModifiers2VimMouseModifiers __ARGS((EventModifiers macModifiers));
+char_u **new_fnames_from_AEDesc __ARGS((AEDesc *theList, long *numFiles, OSErr *error));
+
+
+void gui_request_selection __ARGS((void));
+void gui_mch_lose_selection __ARGS((void));
+int gui_mch_own_selection __ARGS((void));
+void gui_mch_clear_selection __ARGS((void));
+
+void gui_win_new_height __ARGS((win_T *wp));
+void gui_win_comp_pos __ARGS((void));
+void gui_win_free __ARGS((win_T *wp));
+void gui_win_alloc __ARGS((win_T *wp));
+void mch_post_buffer_write (buf_T *buf);
+
+void mch_errmsg __ARGS((char *str));
+void mch_display_error __ARGS((void));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+
+pascal OSErr FindProcessBySignature( const OSType targetType,
+ const OSType targetCreator, ProcessSerialNumberPtr psnPtr );
+OSErr InstallAEHandlers (void);
+pascal OSErr HandleODocAE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_aevt_oapp_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_aevt_quit_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_aevt_pdoc_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_unknown_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+/* Shoulde we return MenuItemIndex? IMO yes, I did that for 5.7 ak*/
+short gui_mac_get_menu_item_index (vimmenu_T *pMenu);
+
+pascal OSErr Handle_KAHL_SRCH_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_KAHL_MOD_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+pascal OSErr Handle_KAHL_GTTX_AE (const AppleEvent *theAEvent, AppleEvent *theReply, long refCon);
+void Send_KAHL_MOD_AE (buf_T *buf);
+
+void gui_mac_doInContentClick __ARGS((EventRecord *theEvent, WindowPtr whichWindow));
+void gui_mac_doInDragClick __ARGS((Point where, WindowPtr whichWindow));
+void gui_mac_doInGrowClick __ARGS((Point where, WindowPtr whichWindow));
+void gui_mac_doUpdateEvent __ARGS((EventRecord *event));
+void gui_mac_doActivateEvent __ARGS((EventRecord *event));
+void gui_mac_doSuspendEvent __ARGS((EventRecord *event));
+void gui_mac_doKeyEvent __ARGS((EventRecord *theEvent));
+void gui_mac_doMouseDownEvent __ARGS((EventRecord *theEvent));
+void gui_mac_doMouseMovedEvent __ARGS((EventRecord *event));
+void gui_mac_doMouseUpEvent __ARGS((EventRecord *theEvent));
+
+int C2PascalString (char_u *CString, Str255 *PascalString);
+int GetFSSpecFromPath ( char_u *file, FSSpec *fileFSSpec);
+char_u *FullPathFromFSSpec_save (FSSpec file);
+
+/* vim: set ft=c : */
diff --git a/src/proto/gui_motif.pro b/src/proto/gui_motif.pro
new file mode 100644
index 000000000..cd5d8ab7a
--- /dev/null
+++ b/src/proto/gui_motif.pro
@@ -0,0 +1,39 @@
+/* gui_motif.c */
+void gui_x11_create_widgets __ARGS((void));
+void gui_x11_destroy_widgets __ARGS((void));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_x11_set_back_color __ARGS((void));
+XmFontList gui_motif_create_fontlist __ARGS((XFontStruct *font));
+XmFontList gui_motif_fontset2fontlist __ARGS((XFontSet *fontset));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_motif_set_mnemonics __ARGS((int enable));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+int gui_mch_text_area_extra_height __ARGS((void));
+void gui_mch_compute_menu_height __ARGS((Widget id));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_motif_update_mousemodel __ARGS((vimmenu_T *menu));
+void gui_mch_new_menu_colors __ARGS((void));
+void gui_mch_new_menu_font __ARGS((void));
+void gui_mch_new_tooltip_font __ARGS((void));
+void gui_mch_new_tooltip_colors __ARGS((void));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_mch_def_colors __ARGS((void));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
+Window gui_x11_get_wid __ARGS((void));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *button_names, int dfltbutton, char_u *textfield));
+void gui_mch_enable_footer __ARGS((int showit));
+void gui_mch_set_footer __ARGS((char_u *s));
+void gui_mch_show_toolbar __ARGS((int showit));
+int gui_mch_compute_toolbar_height __ARGS((void));
+void gui_mch_get_toolbar_colors __ARGS((Pixel *bgp, Pixel *fgp, Pixel *bsp, Pixel *tsp, Pixel *hsp));
+void gui_mch_find_dialog __ARGS((exarg_T *eap));
+void gui_mch_replace_dialog __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_photon.pro b/src/proto/gui_photon.pro
new file mode 100644
index 000000000..c7354a190
--- /dev/null
+++ b/src/proto/gui_photon.pro
@@ -0,0 +1,66 @@
+/* gui_photon.c */
+void gui_ph_encoding_changed __ARGS((int new_encoding));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init __ARGS((void));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_mch_exit __ARGS((int rc));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((int wtime));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *default_name, char_u *ext, char_u *initdir, char_u *filter));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int default_button, char_u *textfield));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, int val, int size, int max));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+void mch_set_mouse_shape __ARGS((int shape));
+void gui_mch_mousehide __ARGS((int hide));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+void gui_mch_new_colors __ARGS((void));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_invert_rectangle __ARGS((int row, int col, int nr, int nc));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_set_blinking __ARGS((long wait, long on, long off));
+void gui_mch_start_blink __ARGS((void));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_flush __ARGS((void));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int index));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int index));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+void gui_mch_show_toolbar __ARGS((int showit));
+int gui_mch_init_font __ARGS((char_u *vim_font_name, int fontset));
+int gui_mch_adjust_charsize __ARGS((void));
+GuiFont gui_mch_get_font __ARGS((char_u *vim_font_name, int report_error));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_free_font __ARGS((GuiFont font));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_riscos.pro b/src/proto/gui_riscos.pro
new file mode 100644
index 000000000..3c23fe004
--- /dev/null
+++ b/src/proto/gui_riscos.pro
@@ -0,0 +1,67 @@
+/* Prototypes for gui_riscos.c
+ * Based on gui_x11_pro.h (10 March 2002 version)
+ */
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_init __ARGS((void));
+void gui_mch_uninit __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_init_tooltip_font __ARGS((void));
+void gui_init_menu_font __ARGS((void));void gui_mch_exit __ARGS((int rc));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+int gui_mch_init_font __ARGS((char_u *font_name, int do_fontset));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+int gui_mch_adjust_charsize __ARGS((void));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_set_fontset __ARGS((GuiFontset fontset));
+void gui_mch_free_font __ARGS((GuiFont font));
+void gui_mch_free_fontset __ARGS((GuiFontset fontset));
+GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int giveErrorIfMissing, int fixed_width));
+guicolor_T gui_mch_get_color __ARGS((char_u *reqname));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((long wtime));
+void gui_mch_flush __ARGS((void));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+void process_event __ARGS((int event, int *block));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_drawsign __ARGS((int row, int col, int typenr));
+void gui_mch_destroy_sign __ARGS((XImage *sign));
+void gui_mch_mousehide __ARGS((int hide));
+void mch_set_mouse_shape __ARGS((int shape));
+void gui_mch_menu_set_tip __ARGS((vimmenu_T *menu));
+
+void ro_redraw_title __ARGS((int window));
+int ro_ok_to_quit __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_w16.pro b/src/proto/gui_w16.pro
new file mode 100644
index 000000000..b43c606ae
--- /dev/null
+++ b/src/proto/gui_w16.pro
@@ -0,0 +1,73 @@
+/* gui_w16.c */
+void gui_mch_set_blinking __ARGS((long wait, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+LRESULT WINAPI vim_WindowProc __ARGS((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
+void gui_mch_new_colors __ARGS((void));
+void gui_mch_def_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+int gui_mch_adjust_charsize __ARGS((void));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+void gui_mch_free_font __ARGS((GuiFont font));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_beep __ARGS((void));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((int wtime));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+void gui_mch_activate_window __ARGS((void));
+void gui_mch_show_toolbar __ARGS((int showit));
+void ex_simalt __ARGS((exarg_T *eap));
+void gui_mch_find_dialog __ARGS((exarg_T *eap));
+void gui_mch_replace_dialog __ARGS((exarg_T *eap));
+void gui_mch_mousehide __ARGS((int hide));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void gui_mch_exit __ARGS((int rc));
+int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
+int gui_mch_maximized __ARGS((void));
+void gui_mch_newfont __ARGS((void));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_set_mouse_shape __ARGS((int shape));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+int get_cmd_args __ARGS((char *prog, char *cmdline, char ***argvp, char **tofree));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init __ARGS((void));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *text, int len, int flags));
+void gui_mch_flush __ARGS((void));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int pos));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_make_popup __ARGS((char_u *path_name));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
+void gui_mch_set_foreground __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_w32.pro b/src/proto/gui_w32.pro
new file mode 100644
index 000000000..58ad4f4ee
--- /dev/null
+++ b/src/proto/gui_w32.pro
@@ -0,0 +1,89 @@
+/* gui_w32.c */
+void gui_mch_set_blinking __ARGS((long wait, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+LRESULT WINAPI vim_WindowProc __ARGS((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam));
+void gui_mch_new_colors __ARGS((void));
+void gui_mch_def_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_text_area_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_enable_scrollbar __ARGS((scrollbar_T *sb, int flag));
+void gui_mch_set_scrollbar_pos __ARGS((scrollbar_T *sb, int x, int y, int w, int h));
+void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
+int gui_mch_adjust_charsize __ARGS((void));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+void gui_mch_free_font __ARGS((GuiFont font));
+guicolor_T gui_mch_get_color __ARGS((char_u *name));
+int gui_mch_haskey __ARGS((char_u *name));
+void gui_mch_beep __ARGS((void));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((int wtime));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_enable_menu __ARGS((int flag));
+void gui_mch_set_menu_pos __ARGS((int x, int y, int w, int h));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+void gui_mch_activate_window __ARGS((void));
+void gui_mch_show_toolbar __ARGS((int showit));
+void ex_simalt __ARGS((exarg_T *eap));
+void gui_mch_find_dialog __ARGS((exarg_T *eap));
+void gui_mch_replace_dialog __ARGS((exarg_T *eap));
+void gui_mch_mousehide __ARGS((int hide));
+void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void gui_mch_exit __ARGS((int rc));
+int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
+int gui_mch_maximized __ARGS((void));
+void gui_mch_newfont __ARGS((void));
+void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_set_mouse_shape __ARGS((int shape));
+char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
+int get_cmd_args __ARGS((char *prog, char *cmdline, char ***argvp, char **tofree));
+int gui_is_win32s __ARGS((void));
+void gui_mch_set_parent __ARGS((char *title));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init __ARGS((void));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_set_scrollbar_thumb __ARGS((scrollbar_T *sb, long val, long size, long max));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void im_set_font __ARGS((LOGFONT *lf));
+void im_set_position __ARGS((int row, int col));
+void im_set_active __ARGS((int active));
+int im_get_status __ARGS((void));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *text, int len, int flags));
+void gui_mch_flush __ARGS((void));
+void gui_mch_add_menu __ARGS((vimmenu_T *menu, int pos));
+void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
+void gui_make_popup __ARGS((char_u *path_name));
+void gui_make_tearoff __ARGS((char_u *path_name));
+void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
+void gui_mch_destroy_menu __ARGS((vimmenu_T *menu));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_drawsign __ARGS((int row, int col, int typenr));
+void *gui_mch_register_sign __ARGS((char_u *signfile));
+void gui_mch_destroy_sign __ARGS((void *sign));
+void gui_mch_disable_beval_area __ARGS((BalloonEval *beval));
+void gui_mch_enable_beval_area __ARGS((BalloonEval *beval));
+void gui_mch_post_balloon __ARGS((BalloonEval *beval, char_u *mesg));
+BalloonEval *gui_mch_create_beval_area __ARGS((void *target, char_u *mesg, void (*mesgCB)(BalloonEval *, int), void *clientData));
+void gui_mch_destroy_beval_area __ARGS((BalloonEval *beval));
+void netbeans_draw_multisign_indicator __ARGS((int row));
+/* vim: set ft=c : */
diff --git a/src/proto/gui_x11.pro b/src/proto/gui_x11.pro
new file mode 100644
index 000000000..6524c265d
--- /dev/null
+++ b/src/proto/gui_x11.pro
@@ -0,0 +1,70 @@
+/* gui_x11.c */
+void gui_x11_key_hit_cb __ARGS((Widget w, XtPointer dud, XEvent *event, Boolean *dum));
+void gui_mch_prepare __ARGS((int *argc, char **argv));
+int gui_mch_init_check __ARGS((void));
+int gui_mch_init __ARGS((void));
+void gui_mch_uninit __ARGS((void));
+void gui_mch_new_colors __ARGS((void));
+int gui_mch_open __ARGS((void));
+void gui_init_tooltip_font __ARGS((void));
+void gui_init_menu_font __ARGS((void));
+void gui_mch_exit __ARGS((int rc));
+int gui_mch_get_winpos __ARGS((int *x, int *y));
+void gui_mch_set_winpos __ARGS((int x, int y));
+void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height));
+void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h));
+int gui_mch_init_font __ARGS((char_u *font_name, int do_fontset));
+GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+int gui_mch_adjust_charsize __ARGS((void));
+void gui_mch_set_font __ARGS((GuiFont font));
+void gui_mch_set_fontset __ARGS((GuiFontset fontset));
+void gui_mch_free_font __ARGS((GuiFont font));
+void gui_mch_free_fontset __ARGS((GuiFontset fontset));
+GuiFontset gui_mch_get_fontset __ARGS((char_u *name, int giveErrorIfMissing, int fixed_width));
+int fontset_height __ARGS((XFontSet fs));
+int fontset_height2 __ARGS((XFontSet fs));
+guicolor_T gui_mch_get_color __ARGS((char_u *reqname));
+void gui_mch_set_fg_color __ARGS((guicolor_T color));
+void gui_mch_set_bg_color __ARGS((guicolor_T color));
+void gui_mch_draw_string __ARGS((int row, int col, char_u *s, int len, int flags));
+int gui_mch_haskey __ARGS((char_u *name));
+int gui_get_x11_windis __ARGS((Window *win, Display **dis));
+void gui_mch_beep __ARGS((void));
+void gui_mch_flash __ARGS((int msec));
+void gui_mch_invert_rectangle __ARGS((int r, int c, int nr, int nc));
+void gui_mch_iconify __ARGS((void));
+void gui_mch_set_foreground __ARGS((void));
+void gui_mch_draw_hollow_cursor __ARGS((guicolor_T color));
+void gui_mch_draw_part_cursor __ARGS((int w, int h, guicolor_T color));
+void gui_mch_update __ARGS((void));
+int gui_mch_wait_for_chars __ARGS((long wtime));
+void gui_mch_flush __ARGS((void));
+void gui_mch_clear_block __ARGS((int row1, int col1, int row2, int col2));
+void gui_mch_clear_all __ARGS((void));
+void gui_mch_delete_lines __ARGS((int row, int num_lines));
+void gui_mch_insert_lines __ARGS((int row, int num_lines));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+void gui_mch_menu_grey __ARGS((vimmenu_T *menu, int grey));
+void gui_mch_menu_hidden __ARGS((vimmenu_T *menu, int hidden));
+void gui_mch_draw_menubar __ARGS((void));
+void gui_x11_menu_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
+void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
+void gui_mch_stop_blink __ARGS((void));
+void gui_mch_start_blink __ARGS((void));
+long_u gui_mch_get_rgb __ARGS((guicolor_T pixel));
+void gui_x11_callbacks __ARGS((Widget textArea, Widget vimForm));
+int gui_mch_get_mouse_x __ARGS((void));
+int gui_mch_get_mouse_y __ARGS((void));
+void gui_mch_setmouse __ARGS((int x, int y));
+XButtonPressedEvent *gui_x11_get_last_mouse_event __ARGS((void));
+void gui_mch_drawsign __ARGS((int row, int col, int typenr));
+void *gui_mch_register_sign __ARGS((char_u *signfile));
+void gui_mch_destroy_sign __ARGS((void *sign));
+void gui_mch_mousehide __ARGS((int hide));
+void mch_set_mouse_shape __ARGS((int shape));
+void get_toolbar_pixmap __ARGS((vimmenu_T *menu, Pixmap *sen, Pixmap *insen));
+void gui_mch_menu_set_tip __ARGS((vimmenu_T *menu));
+/* vim: set ft=c : */
diff --git a/src/proto/hangulin.pro b/src/proto/hangulin.pro
new file mode 100644
index 000000000..adfde142f
--- /dev/null
+++ b/src/proto/hangulin.pro
@@ -0,0 +1,9 @@
+/* hangulin.c */
+int hangul_input_state_get __ARGS((void));
+void hangul_input_state_set __ARGS((int state));
+int im_get_status __ARGS((void));
+void hangul_input_state_toggle __ARGS((void));
+void hangul_keyboard_set __ARGS((void));
+int hangul_input_process __ARGS((char_u *s, int len));
+void hangul_input_clear __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/if_cscope.pro b/src/proto/if_cscope.pro
new file mode 100644
index 000000000..0617d13a9
--- /dev/null
+++ b/src/proto/if_cscope.pro
@@ -0,0 +1,9 @@
+/* if_cscope.c */
+void do_cscope __ARGS((exarg_T *eap));
+void do_scscope __ARGS((exarg_T *eap));
+void do_cstag __ARGS((exarg_T *eap));
+int cs_fgets __ARGS((char_u *buf, int size));
+void cs_free_tags __ARGS((void));
+void cs_print_tags __ARGS((void));
+int cs_connection __ARGS((int num, char_u *dbpath, char_u *ppath));
+/* vim: set ft=c : */
diff --git a/src/proto/if_ole.pro b/src/proto/if_ole.pro
new file mode 100644
index 000000000..36edcb0d2
--- /dev/null
+++ b/src/proto/if_ole.pro
@@ -0,0 +1,5 @@
+/* if_ole.cpp */
+void InitOLE __ARGS((int* pbDoRestart));
+void UninitOLE __ARGS((void));
+void RegisterMe __ARGS((int silent));
+void UnregisterMe __ARGS((int bNotifyUser));
diff --git a/src/proto/if_perl.pro b/src/proto/if_perl.pro
new file mode 100644
index 000000000..fe0301b0b
--- /dev/null
+++ b/src/proto/if_perl.pro
@@ -0,0 +1,8 @@
+/* auto/if_perl.c */
+int perl_enabled __ARGS((int verbose));
+void perl_end __ARGS((void));
+void msg_split __ARGS((char_u *s, int attr));
+void perl_win_free __ARGS((win_T *wp));
+void perl_buf_free __ARGS((buf_T *bp));
+void ex_perl __ARGS((exarg_T *eap));
+void ex_perldo __ARGS((exarg_T *eap));
diff --git a/src/proto/if_perlsfio.pro b/src/proto/if_perlsfio.pro
new file mode 100644
index 000000000..bb9046809
--- /dev/null
+++ b/src/proto/if_perlsfio.pro
@@ -0,0 +1,3 @@
+/* if_perlsfio.c */
+int *sfdcnewvim __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/if_python.pro b/src/proto/if_python.pro
new file mode 100644
index 000000000..793b6eeb5
--- /dev/null
+++ b/src/proto/if_python.pro
@@ -0,0 +1,8 @@
+/* if_python.c */
+int python_enabled __ARGS((int verbose));
+void python_end __ARGS((void));
+void ex_python __ARGS((exarg_T *eap));
+void ex_pyfile __ARGS((exarg_T *eap));
+void python_buffer_free __ARGS((buf_T *buf));
+void python_window_free __ARGS((win_T *win));
+/* vim: set ft=c : */
diff --git a/src/proto/if_ruby.pro b/src/proto/if_ruby.pro
new file mode 100644
index 000000000..7dedb225c
--- /dev/null
+++ b/src/proto/if_ruby.pro
@@ -0,0 +1,9 @@
+/* if_ruby.c */
+int ruby_enabled __ARGS((int verbose));
+void ruby_end __ARGS((void));
+void ex_ruby __ARGS((exarg_T *eap));
+void ex_rubydo __ARGS((exarg_T *eap));
+void ex_rubyfile __ARGS((exarg_T *eap));
+void ruby_buffer_free __ARGS((buf_T *buf));
+void ruby_window_free __ARGS((win_T *win));
+/* vim: set ft=c : */
diff --git a/src/proto/if_tcl.pro b/src/proto/if_tcl.pro
new file mode 100644
index 000000000..0679ed41a
--- /dev/null
+++ b/src/proto/if_tcl.pro
@@ -0,0 +1,10 @@
+/* if_tcl.c */
+void vim_tcl_init __ARGS((char *arg));
+int tcl_enabled __ARGS((int verbose));
+void tcl_end __ARGS((void));
+void ex_tcl __ARGS((exarg_T *eap));
+void ex_tclfile __ARGS((exarg_T *eap));
+void ex_tcldo __ARGS((exarg_T *eap));
+void tcl_buffer_free __ARGS((buf_T *buf));
+void tcl_window_free __ARGS((win_T *win));
+/* vim: set ft=c : */
diff --git a/src/proto/if_xcmdsrv.pro b/src/proto/if_xcmdsrv.pro
new file mode 100644
index 000000000..dd6a12084
--- /dev/null
+++ b/src/proto/if_xcmdsrv.pro
@@ -0,0 +1,11 @@
+/* if_xcmdsrv.c */
+int serverRegisterName __ARGS((Display *dpy, char_u *name));
+void serverChangeRegisteredWindow __ARGS((Display *dpy, Window newwin));
+int serverSendToVim __ARGS((Display *dpy, char_u *name, char_u *cmd, char_u **result, Window *server, int asExpr, int localLoop, int silent));
+char_u *serverGetVimNames __ARGS((Display *dpy));
+Window serverStrToWin __ARGS((char_u *str));
+int serverSendReply __ARGS((char_u *name, char_u *str));
+int serverReadReply __ARGS((Display *dpy, Window win, char_u **str, int localLoop));
+int serverPeekReply __ARGS((Display *dpy, Window win, char_u **str));
+void serverEventProc __ARGS((Display *dpy, XEvent *eventPtr));
+/* vim: set ft=c : */
diff --git a/src/proto/main.pro b/src/proto/main.pro
new file mode 100644
index 000000000..7e965fb94
--- /dev/null
+++ b/src/proto/main.pro
@@ -0,0 +1,25 @@
+/* main.c */
+void main_loop __ARGS((int cmdwin));
+void getout_preserve_modified __ARGS((int exitval));
+void getout __ARGS((int exitval));
+int process_env __ARGS((char_u *env, int is_viminit));
+void mainerr_arg_missing __ARGS((char_u *str));
+void time_push __ARGS((void *tv_rel, void *tv_start));
+void time_pop __ARGS((void *tp));
+void time_msg __ARGS((char *msg, void *tv_start));
+void server_to_input_buf __ARGS((char_u *str));
+char_u *eval_client_expr_to_string __ARGS((char_u *expr));
+int toF_TyA __ARGS((int c));
+int fkmap __ARGS((int c));
+void conv_to_pvim __ARGS((void));
+void conv_to_pstd __ARGS((void));
+char_u *lrswap __ARGS((char_u *ibuf));
+char_u *lrFswap __ARGS((char_u *cmdbuf, int len));
+char_u *lrF_sub __ARGS((char_u *ibuf));
+int cmdl_fkmap __ARGS((int c));
+int F_isalpha __ARGS((int c));
+int F_isdigit __ARGS((int c));
+int F_ischar __ARGS((int c));
+void farsi_fkey __ARGS((cmdarg_T *cap));
+int arabic_shape __ARGS((int c, int *ccp, int *c1p, int prev_c, int prev_c1, int next_c));
+/* vim: set ft=c : */
diff --git a/src/proto/mark.pro b/src/proto/mark.pro
new file mode 100644
index 000000000..b90a1b07a
--- /dev/null
+++ b/src/proto/mark.pro
@@ -0,0 +1,26 @@
+/* mark.c */
+int setmark __ARGS((int c));
+void setpcmark __ARGS((void));
+void checkpcmark __ARGS((void));
+pos_T *movemark __ARGS((int count));
+pos_T *movechangelist __ARGS((int count));
+pos_T *getmark __ARGS((int c, int changefile));
+pos_T *getnextmark __ARGS((pos_T *startpos, int dir, int begin_line));
+void fmarks_check_names __ARGS((buf_T *buf));
+int check_mark __ARGS((pos_T *pos));
+void clrallmarks __ARGS((buf_T *buf));
+char_u *fm_getname __ARGS((fmark_T *fmark, int lead_len));
+void do_marks __ARGS((exarg_T *eap));
+void ex_jumps __ARGS((exarg_T *eap));
+void ex_changes __ARGS((exarg_T *eap));
+void mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+void mark_col_adjust __ARGS((linenr_T lnum, colnr_T mincol, long lnum_amount, long col_amount));
+void copy_jumplist __ARGS((win_T *from, win_T *to));
+void free_jumplist __ARGS((win_T *wp));
+void set_last_cursor __ARGS((win_T *win));
+int read_viminfo_filemark __ARGS((vir_T *virp, int force));
+void write_viminfo_filemarks __ARGS((FILE *fp));
+int removable __ARGS((char_u *name));
+int write_viminfo_marks __ARGS((FILE *fp_out));
+void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof));
+/* vim: set ft=c : */
diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro
new file mode 100644
index 000000000..9567a0acb
--- /dev/null
+++ b/src/proto/mbyte.pro
@@ -0,0 +1,86 @@
+/* mbyte.c */
+int enc_canon_props __ARGS((char_u *name));
+char_u *mb_init __ARGS((void));
+int bomb_size __ARGS((void));
+int mb_get_class __ARGS((char_u *p));
+int dbcs_class __ARGS((unsigned lead, unsigned trail));
+int latin_char2len __ARGS((int c));
+int latin_char2bytes __ARGS((int c, char_u *buf));
+int latin_ptr2len_check __ARGS((char_u *p));
+int utf_char2cells __ARGS((int c));
+int latin_ptr2cells __ARGS((char_u *p));
+int utf_ptr2cells __ARGS((char_u *p));
+int dbcs_ptr2cells __ARGS((char_u *p));
+int latin_char2cells __ARGS((int c));
+int latin_off2cells __ARGS((unsigned off));
+int dbcs_off2cells __ARGS((unsigned off));
+int utf_off2cells __ARGS((unsigned off));
+int latin_ptr2char __ARGS((char_u *p));
+int utf_ptr2char __ARGS((char_u *p));
+int mb_ptr2char_adv __ARGS((char_u **pp));
+int arabic_combine __ARGS((int one, int two));
+int arabic_maycombine __ARGS((int two));
+int utf_composinglike __ARGS((char_u *p1, char_u *p2));
+int utfc_ptr2char __ARGS((char_u *p, int *p1, int *p2));
+int utfc_ptr2char_len __ARGS((char_u *p, int *p1, int *p2, int maxlen));
+int utfc_char2bytes __ARGS((int off, char_u *buf));
+int utf_ptr2len_check __ARGS((char_u *p));
+int utf_byte2len __ARGS((int b));
+int utf_ptr2len_check_len __ARGS((char_u *p, int size));
+int utfc_ptr2len_check __ARGS((char_u *p));
+int utfc_ptr2len_check_len __ARGS((char_u *p, int size));
+int utf_char2len __ARGS((int c));
+int utf_char2bytes __ARGS((int c, char_u *buf));
+int utf_iscomposing __ARGS((int c));
+int utf_printable __ARGS((int c));
+int utf_class __ARGS((int c));
+int utf_fold __ARGS((int a));
+int utf_toupper __ARGS((int a));
+int utf_islower __ARGS((int a));
+int utf_tolower __ARGS((int a));
+int utf_isupper __ARGS((int a));
+int mb_strnicmp __ARGS((char_u *s1, char_u *s2, int n));
+void show_utf8 __ARGS((void));
+int latin_head_off __ARGS((char_u *base, char_u *p));
+int dbcs_head_off __ARGS((char_u *base, char_u *p));
+int dbcs_screen_head_off __ARGS((char_u *base, char_u *p));
+int utf_head_off __ARGS((char_u *base, char_u *p));
+int mb_off_next __ARGS((char_u *base, char_u *p));
+int mb_tail_off __ARGS((char_u *base, char_u *p));
+int dbcs_screen_tail_off __ARGS((char_u *base, char_u *p));
+void mb_adjust_cursor __ARGS((void));
+void mb_adjustpos __ARGS((pos_T *lp));
+char_u *mb_prevptr __ARGS((char_u *line, char_u *p));
+int mb_charlen __ARGS((char_u *str));
+char_u *mb_unescape __ARGS((char_u **pp));
+int mb_lefthalve __ARGS((int row, int col));
+int mb_fix_col __ARGS((int col, int row));
+char_u *enc_skip __ARGS((char_u *p));
+char_u *enc_canonize __ARGS((char_u *enc));
+char_u *enc_locale __ARGS((void));
+int encname2codepage __ARGS((char_u *name));
+void *my_iconv_open __ARGS((char_u *to, char_u *from));
+int iconv_enabled __ARGS((int verbose));
+void iconv_end __ARGS((void));
+int im_xim_isvalid_imactivate __ARGS((void));
+void im_set_active __ARGS((int active));
+void xim_set_focus __ARGS((int focus));
+void im_set_position __ARGS((int row, int col));
+void xim_set_preedit __ARGS((void));
+void xim_set_status_area __ARGS((void));
+void xim_init __ARGS((void));
+void xim_decide_input_style __ARGS((void));
+int im_get_feedback_attr __ARGS((int col));
+void xim_reset __ARGS((void));
+int xim_queue_key_press_event __ARGS((GdkEventKey *event, int down));
+void xim_init __ARGS((void));
+void im_shutdown __ARGS((void));
+int xim_get_status_area_height __ARGS((void));
+int im_get_status __ARGS((void));
+int im_is_preediting __ARGS((void));
+int convert_setup __ARGS((vimconv_T *vcp, char_u *from, char_u *to));
+int convert_input __ARGS((char_u *ptr, int len, int maxlen));
+int convert_input_safe __ARGS((char_u *ptr, int len, int maxlen, char_u **restp, int *restlenp));
+char_u *string_convert __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp));
+char_u *string_convert_ext __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp, int *unconvlenp));
+/* vim: set ft=c : */
diff --git a/src/proto/memfile.pro b/src/proto/memfile.pro
new file mode 100644
index 000000000..3feb67744
--- /dev/null
+++ b/src/proto/memfile.pro
@@ -0,0 +1,17 @@
+/* memfile.c */
+memfile_T *mf_open __ARGS((char_u *fname, int flags));
+int mf_open_file __ARGS((memfile_T *mfp, char_u *fname));
+void mf_close __ARGS((memfile_T *mfp, int del_file));
+void mf_close_file __ARGS((buf_T *buf, int getlines));
+void mf_new_page_size __ARGS((memfile_T *mfp, unsigned new_size));
+bhdr_T *mf_new __ARGS((memfile_T *mfp, int negative, int page_count));
+bhdr_T *mf_get __ARGS((memfile_T *mfp, blocknr_T nr, int page_count));
+void mf_put __ARGS((memfile_T *mfp, bhdr_T *hp, int dirty, int infile));
+void mf_free __ARGS((memfile_T *mfp, bhdr_T *hp));
+int mf_sync __ARGS((memfile_T *mfp, int flags));
+int mf_release_all __ARGS((void));
+blocknr_T mf_trans_del __ARGS((memfile_T *mfp, blocknr_T old_nr));
+void mf_set_ffname __ARGS((memfile_T *mfp));
+void mf_fullname __ARGS((memfile_T *mfp));
+int mf_need_trans __ARGS((memfile_T *mfp));
+/* vim: set ft=c : */
diff --git a/src/proto/memline.pro b/src/proto/memline.pro
new file mode 100644
index 000000000..36d1086c9
--- /dev/null
+++ b/src/proto/memline.pro
@@ -0,0 +1,31 @@
+/* memline.c */
+int ml_open __ARGS((void));
+void ml_setname __ARGS((buf_T *buf));
+void ml_open_files __ARGS((void));
+void ml_open_file __ARGS((buf_T *buf));
+void check_need_swap __ARGS((int newfile));
+void ml_close __ARGS((buf_T *buf, int del_file));
+void ml_close_all __ARGS((int del_file));
+void ml_close_notmod __ARGS((void));
+void ml_timestamp __ARGS((buf_T *buf));
+void ml_recover __ARGS((void));
+int recover_names __ARGS((char_u **fname, int list, int nr));
+void ml_sync_all __ARGS((int check_file, int check_char));
+void ml_preserve __ARGS((buf_T *buf, int message));
+char_u *ml_get __ARGS((linenr_T lnum));
+char_u *ml_get_pos __ARGS((pos_T *pos));
+char_u *ml_get_curline __ARGS((void));
+char_u *ml_get_cursor __ARGS((void));
+char_u *ml_get_buf __ARGS((buf_T *buf, linenr_T lnum, int will_change));
+int ml_line_alloced __ARGS((void));
+int ml_append __ARGS((linenr_T lnum, char_u *line, colnr_T len, int newfile));
+int ml_replace __ARGS((linenr_T lnum, char_u *line, int copy));
+int ml_delete __ARGS((linenr_T lnum, int message));
+void ml_setmarked __ARGS((linenr_T lnum));
+linenr_T ml_firstmarked __ARGS((void));
+void ml_clearmarked __ARGS((void));
+char_u *get_file_in_dir __ARGS((char_u *fname, char_u *dname));
+void ml_setdirty __ARGS((buf_T *buf, int flag));
+long ml_find_line_or_offset __ARGS((buf_T *buf, linenr_T line, long *offp));
+void goto_byte __ARGS((long cnt));
+/* vim: set ft=c : */
diff --git a/src/proto/menu.pro b/src/proto/menu.pro
new file mode 100644
index 000000000..506a963b2
--- /dev/null
+++ b/src/proto/menu.pro
@@ -0,0 +1,21 @@
+/* menu.c */
+void ex_menu __ARGS((exarg_T *eap));
+char_u *set_context_in_menu_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit));
+char_u *get_menu_name __ARGS((expand_T *xp, int idx));
+char_u *get_menu_names __ARGS((expand_T *xp, int idx));
+char_u *menu_name_skip __ARGS((char_u *name));
+int get_menu_index __ARGS((vimmenu_T *menu, int state));
+int menu_is_menubar __ARGS((char_u *name));
+int menu_is_popup __ARGS((char_u *name));
+int menu_is_child_of_popup __ARGS((vimmenu_T *menu));
+int menu_is_toolbar __ARGS((char_u *name));
+int menu_is_separator __ARGS((char_u *name));
+void gui_create_initial_menus __ARGS((vimmenu_T *menu));
+void gui_update_menus __ARGS((int modes));
+int gui_is_menu_shortcut __ARGS((int key));
+void gui_show_popupmenu __ARGS((void));
+void gui_mch_toggle_tearoffs __ARGS((int enable));
+void ex_emenu __ARGS((exarg_T *eap));
+vimmenu_T *gui_find_menu __ARGS((char_u *path_name));
+void ex_menutranslate __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/message.pro b/src/proto/message.pro
new file mode 100644
index 000000000..937765424
--- /dev/null
+++ b/src/proto/message.pro
@@ -0,0 +1,57 @@
+/* message.c */
+int msg __ARGS((char_u *s));
+int msg_attr __ARGS((char_u *s, int attr));
+int msg_attr_keep __ARGS((char_u *s, int attr, int keep));
+char_u *msg_strtrunc __ARGS((char_u *s));
+void trunc_string __ARGS((char_u *s, char_u *buf, int room));
+int emsg __ARGS((char_u *s));
+int emsg2 __ARGS((char_u *s, char_u *a1));
+int emsg3 __ARGS((char_u *s, char_u *a1, char_u *a2));
+int emsgn __ARGS((char_u *s, long n));
+char_u *msg_trunc_attr __ARGS((char_u *s, int force, int attr));
+char_u *msg_may_trunc __ARGS((int force, char_u *s));
+void ex_messages __ARGS((exarg_T *eap));
+void wait_return __ARGS((int redraw));
+void set_keep_msg __ARGS((char_u *s));
+void msg_start __ARGS((void));
+void msg_starthere __ARGS((void));
+void msg_putchar __ARGS((int c));
+void msg_putchar_attr __ARGS((int c, int attr));
+void msg_outnum __ARGS((long n));
+void msg_home_replace __ARGS((char_u *fname));
+void msg_home_replace_hl __ARGS((char_u *fname));
+int msg_outtrans __ARGS((char_u *str));
+int msg_outtrans_attr __ARGS((char_u *str, int attr));
+int msg_outtrans_len __ARGS((char_u *str, int len));
+char_u *msg_outtrans_one __ARGS((char_u *p, int attr));
+int msg_outtrans_len_attr __ARGS((char_u *msgstr, int len, int attr));
+void msg_make __ARGS((char_u *arg));
+int msg_outtrans_special __ARGS((char_u *strstart, int from));
+char_u *str2special __ARGS((char_u **sp, int from));
+void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len));
+void msg_prt_line __ARGS((char_u *s));
+void msg_puts __ARGS((char_u *s));
+void msg_puts_title __ARGS((char_u *s));
+void msg_puts_long __ARGS((char_u *longstr));
+void msg_puts_long_attr __ARGS((char_u *longstr, int attr));
+void msg_puts_long_len_attr __ARGS((char_u *longstr, int len, int attr));
+void msg_puts_attr __ARGS((char_u *s, int attr));
+int msg_use_printf __ARGS((void));
+void mch_errmsg __ARGS((char *str));
+void mch_msg __ARGS((char *str));
+void msg_moremsg __ARGS((int full));
+void repeat_message __ARGS((void));
+void msg_clr_eos __ARGS((void));
+void msg_clr_eos_force __ARGS((void));
+void msg_clr_cmdline __ARGS((void));
+int msg_end __ARGS((void));
+void msg_check __ARGS((void));
+void give_warning __ARGS((char_u *message, int hl));
+void msg_advance __ARGS((int col));
+int do_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
+void display_confirm_msg __ARGS((void));
+int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt));
+int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt));
+int vim_dialog_yesnoallcancel __ARGS((int type, char_u *title, char_u *message, int dflt));
+char_u *do_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf));
+/* vim: set ft=c : */
diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro
new file mode 100644
index 000000000..3fac334ab
--- /dev/null
+++ b/src/proto/misc1.pro
@@ -0,0 +1,87 @@
+/* misc1.c */
+int get_indent __ARGS((void));
+int get_indent_lnum __ARGS((linenr_T lnum));
+int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum));
+int set_indent __ARGS((int size, int flags));
+int get_number_indent __ARGS((linenr_T lnum));
+int open_line __ARGS((int dir, int flags, int old_indent));
+int get_leader_len __ARGS((char_u *line, char_u **flags, int backward));
+int plines __ARGS((linenr_T lnum));
+int plines_win __ARGS((win_T *wp, linenr_T lnum, int winheight));
+int plines_nofill __ARGS((linenr_T lnum));
+int plines_win_nofill __ARGS((win_T *wp, linenr_T lnum, int winheight));
+int plines_win_nofold __ARGS((win_T *wp, linenr_T lnum));
+int plines_win_col __ARGS((win_T *wp, linenr_T lnum, long column));
+int plines_m_win __ARGS((win_T *wp, linenr_T first, linenr_T last));
+void ins_bytes __ARGS((char_u *p));
+void ins_bytes_len __ARGS((char_u *p, int len));
+void ins_char __ARGS((int c));
+void ins_char_bytes __ARGS((char_u *buf, int charlen));
+void ins_str __ARGS((char_u *s));
+int del_char __ARGS((int fixpos));
+int del_chars __ARGS((long count, int fixpos));
+int del_bytes __ARGS((long count, int fixpos));
+int truncate_line __ARGS((int fixpos));
+void del_lines __ARGS((long nlines, int undo));
+int gchar_pos __ARGS((pos_T *pos));
+int gchar_cursor __ARGS((void));
+void pchar_cursor __ARGS((int c));
+int inindent __ARGS((int extra));
+char_u *skip_to_option_part __ARGS((char_u *p));
+void changed __ARGS((void));
+void changed_bytes __ARGS((linenr_T lnum, colnr_T col));
+void appended_lines __ARGS((linenr_T lnum, long count));
+void appended_lines_mark __ARGS((linenr_T lnum, long count));
+void deleted_lines __ARGS((linenr_T lnum, long count));
+void deleted_lines_mark __ARGS((linenr_T lnum, long count));
+void changed_lines __ARGS((linenr_T lnum, colnr_T col, linenr_T lnume, long xtra));
+void unchanged __ARGS((buf_T *buf, int ff));
+void check_status __ARGS((buf_T *buf));
+void change_warning __ARGS((int col));
+int ask_yesno __ARGS((char_u *str, int direct));
+int get_keystroke __ARGS((void));
+int get_number __ARGS((int colon));
+void msgmore __ARGS((long n));
+void beep_flush __ARGS((void));
+void vim_beep __ARGS((void));
+void init_homedir __ARGS((void));
+void expand_env __ARGS((char_u *src, char_u *dst, int dstlen));
+void expand_env_esc __ARGS((char_u *src, char_u *dst, int dstlen, int esc));
+char_u *vim_getenv __ARGS((char_u *name, int *mustfree));
+char_u *expand_env_save __ARGS((char_u *src));
+void vim_setenv __ARGS((char_u *name, char_u *val));
+char_u *get_env_name __ARGS((expand_T *xp, int idx));
+void home_replace __ARGS((buf_T *buf, char_u *src, char_u *dst, int dstlen, int one));
+char_u *home_replace_save __ARGS((buf_T *buf, char_u *src));
+int fullpathcmp __ARGS((char_u *s1, char_u *s2, int checkname));
+char_u *gettail __ARGS((char_u *fname));
+char_u *getnextcomp __ARGS((char_u *fname));
+char_u *get_past_head __ARGS((char_u *path));
+int vim_ispathsep __ARGS((int c));
+int vim_ispathlistsep __ARGS((int c));
+int vim_fnamecmp __ARGS((char_u *x, char_u *y));
+int vim_fnamencmp __ARGS((char_u *x, char_u *y, size_t len));
+char_u *concat_fnames __ARGS((char_u *fname1, char_u *fname2, int sep));
+void add_pathsep __ARGS((char_u *p));
+char_u *FullName_save __ARGS((char_u *fname, int force));
+pos_T *find_start_comment __ARGS((int ind_maxcomment));
+void do_c_expr_indent __ARGS((void));
+int cin_islabel __ARGS((int ind_maxcomment));
+int cin_iscase __ARGS((char_u *s));
+int cin_isscopedecl __ARGS((char_u *s));
+int get_c_indent __ARGS((void));
+int get_expr_indent __ARGS((void));
+int get_lisp_indent __ARGS((void));
+void prepare_to_exit __ARGS((void));
+void preserve_exit __ARGS((void));
+int vim_fexists __ARGS((char_u *fname));
+void line_breakcheck __ARGS((void));
+void fast_breakcheck __ARGS((void));
+int expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
+int match_suffix __ARGS((char_u *fname));
+int gen_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
+void addfile __ARGS((garray_T *gap, char_u *f, int flags));
+char_u *get_cmd_output __ARGS((char_u *cmd, int flags));
+void FreeWild __ARGS((int count, char_u **files));
+int goto_im __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro
new file mode 100644
index 000000000..cbe2af759
--- /dev/null
+++ b/src/proto/misc2.pro
@@ -0,0 +1,91 @@
+/* misc2.c */
+int virtual_active __ARGS((void));
+int getviscol __ARGS((void));
+int getviscol2 __ARGS((colnr_T col, colnr_T coladd));
+int coladvance_force __ARGS((colnr_T wcol));
+int coladvance __ARGS((colnr_T wcol));
+int getvpos __ARGS((pos_T *pos, colnr_T wcol));
+int inc_cursor __ARGS((void));
+int inc __ARGS((pos_T *lp));
+int incl __ARGS((pos_T *lp));
+int dec_cursor __ARGS((void));
+int dec __ARGS((pos_T *lp));
+int decl __ARGS((pos_T *lp));
+void check_cursor_lnum __ARGS((void));
+void check_cursor_col __ARGS((void));
+void check_cursor __ARGS((void));
+void adjust_cursor_col __ARGS((void));
+int leftcol_changed __ARGS((void));
+void vim_mem_profile_dump __ARGS((void));
+char_u *alloc __ARGS((unsigned size));
+char_u *alloc_clear __ARGS((unsigned size));
+char_u *alloc_check __ARGS((unsigned size));
+char_u *lalloc_clear __ARGS((long_u size, int message));
+char_u *lalloc __ARGS((long_u size, int message));
+void *mem_realloc __ARGS((void *ptr, size_t size));
+void do_outofmem_msg __ARGS((long_u size));
+char_u *vim_strsave __ARGS((char_u *string));
+char_u *vim_strnsave __ARGS((char_u *string, int len));
+char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
+char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int bsl));
+char_u *vim_strsave_up __ARGS((char_u *string));
+char_u *vim_strnsave_up __ARGS((char_u *string, int len));
+void vim_strup __ARGS((char_u *p));
+void copy_spaces __ARGS((char_u *ptr, size_t count));
+void copy_chars __ARGS((char_u *ptr, size_t count, int c));
+void del_trailing_spaces __ARGS((char_u *ptr));
+void vim_strncpy __ARGS((char_u *to, char_u *from, int len));
+int copy_option_part __ARGS((char_u **option, char_u *buf, int maxlen, char *sep_chars));
+void vim_free __ARGS((void *x));
+int vim_stricmp __ARGS((char *s1, char *s2));
+int vim_strnicmp __ARGS((char *s1, char *s2, size_t len));
+char_u *vim_strchr __ARGS((char_u *string, int c));
+char_u *vim_strrchr __ARGS((char_u *string, int c));
+int vim_isspace __ARGS((int x));
+void ga_clear __ARGS((garray_T *gap));
+void ga_clear_strings __ARGS((garray_T *gap));
+void ga_init __ARGS((garray_T *gap));
+void ga_init2 __ARGS((garray_T *gap, int itemsize, int growsize));
+int ga_grow __ARGS((garray_T *gap, int n));
+void ga_concat __ARGS((garray_T *gap, char_u *s));
+void ga_append __ARGS((garray_T *gap, int c));
+int name_to_mod_mask __ARGS((int c));
+int simplify_key __ARGS((int key, int *modifiers));
+char_u *get_special_key_name __ARGS((int c, int modifiers));
+int trans_special __ARGS((char_u **srcp, char_u *dst, int keycode));
+int find_special_key __ARGS((char_u **srcp, int *modp, int keycode));
+int extract_modifiers __ARGS((int key, int *modp));
+int find_special_key_in_table __ARGS((int c));
+int get_special_key_code __ARGS((char_u *name));
+char_u *get_key_name __ARGS((int i));
+int get_mouse_button __ARGS((int code, int *is_click, int *is_drag));
+int get_pseudo_mouse_code __ARGS((int button, int is_click, int is_drag));
+int get_fileformat __ARGS((buf_T *buf));
+int get_fileformat_force __ARGS((buf_T *buf, exarg_T *eap));
+void set_fileformat __ARGS((int t, int opt_flags));
+int default_fileformat __ARGS((void));
+int call_shell __ARGS((char_u *cmd, int opt));
+int get_real_state __ARGS((void));
+int vim_chdirfile __ARGS((char_u *fname));
+int illegal_slash __ARGS((char *name));
+char_u *parse_shape_opt __ARGS((int what));
+int get_shape_idx __ARGS((int mouse));
+void update_mouseshape __ARGS((int shape_idx));
+int decrypt_byte __ARGS((void));
+int update_keys __ARGS((int c));
+void crypt_init_keys __ARGS((char_u *passwd));
+char_u *get_crypt_key __ARGS((int store, int twice));
+void *vim_findfile_init __ARGS((char_u *path, char_u *filename, char_u *stopdirs, int level, int free_visited, int need_dir, void *search_ctx, int tagfile, char_u *rel_fname));
+char_u *vim_findfile_stopdir __ARGS((char_u *buf));
+void vim_findfile_cleanup __ARGS((void *ctx));
+char_u *vim_findfile __ARGS((void *search_ctx));
+void vim_findfile_free_visited __ARGS((void *search_ctx));
+char_u *find_file_in_path __ARGS((char_u *ptr, int len, int options, int first, char_u *rel_fname));
+char_u *find_directory_in_path __ARGS((char_u *ptr, int len, int options, char_u *rel_fname));
+int vim_chdir __ARGS((char_u *new_dir));
+int get_user_name __ARGS((char_u *buf, int len));
+void sort_strings __ARGS((char_u **files, int count));
+int pathcmp __ARGS((const char *p, const char *q));
+char_u *parse_list_options __ARGS((char_u *option_str, option_table_T *table, int table_size));
+void msg_str __ARGS((char_u *s, char_u *arg));
+/* vim: set ft=c : */
diff --git a/src/proto/move.pro b/src/proto/move.pro
new file mode 100644
index 000000000..de51aa240
--- /dev/null
+++ b/src/proto/move.pro
@@ -0,0 +1,40 @@
+/* move.c */
+void update_topline_redraw __ARGS((void));
+void update_topline __ARGS((void));
+void update_curswant __ARGS((void));
+void check_cursor_moved __ARGS((win_T *wp));
+void changed_window_setting __ARGS((void));
+void changed_window_setting_win __ARGS((win_T *wp));
+void set_topline __ARGS((win_T *wp, linenr_T lnum));
+void changed_cline_bef_curs __ARGS((void));
+void changed_cline_bef_curs_win __ARGS((win_T *wp));
+void changed_line_abv_curs __ARGS((void));
+void changed_line_abv_curs_win __ARGS((win_T *wp));
+void validate_botline __ARGS((void));
+void invalidate_botline __ARGS((void));
+void invalidate_botline_win __ARGS((win_T *wp));
+void approximate_botline_win __ARGS((win_T *wp));
+int cursor_valid __ARGS((void));
+void validate_cursor __ARGS((void));
+void validate_cline_row __ARGS((void));
+void validate_virtcol __ARGS((void));
+void validate_virtcol_win __ARGS((win_T *wp));
+void validate_cursor_col __ARGS((void));
+int win_col_off __ARGS((win_T *wp));
+int curwin_col_off __ARGS((void));
+int win_col_off2 __ARGS((win_T *wp));
+int curwin_col_off2 __ARGS((void));
+void curs_columns __ARGS((int scroll));
+void scrolldown __ARGS((long line_count, int byfold));
+void scrollup __ARGS((long line_count, int byfold));
+void check_topfill __ARGS((win_T *wp, int down));
+void scrolldown_clamp __ARGS((void));
+void scrollup_clamp __ARGS((void));
+void scroll_cursor_top __ARGS((int min_scroll, int always));
+void set_empty_rows __ARGS((win_T *wp, int used));
+void scroll_cursor_bot __ARGS((int min_scroll, int set_topbot));
+void scroll_cursor_halfway __ARGS((int atend));
+void cursor_correct __ARGS((void));
+int onepage __ARGS((int dir, long count));
+void halfpage __ARGS((int flag, linenr_T Prenum));
+/* vim: set ft=c : */
diff --git a/src/proto/netbeans.pro b/src/proto/netbeans.pro
new file mode 100644
index 000000000..e43ae733c
--- /dev/null
+++ b/src/proto/netbeans.pro
@@ -0,0 +1,24 @@
+/* netbeans.c */
+void netbeans_Xt_connect __ARGS((void *context));
+void netbeans_gtk_connect __ARGS((void));
+void netbeans_w32_connect __ARGS((void));
+void messageFromNetbeansW32 __ARGS((void));
+int isNetbeansBuffer __ARGS((buf_T *bufp));
+int isNetbeansModified __ARGS((buf_T *bufp));
+void netbeans_end __ARGS((void));
+void netbeans_startup_done __ARGS((void));
+void netbeans_frame_moved __ARGS((int new_x, int new_y));
+void netbeans_file_opened __ARGS((char *filename));
+void netbeans_file_closed __ARGS((buf_T *bufp));
+void netbeans_inserted __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, int oldlen, char_u *txt, int newlen));
+void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
+void netbeans_unmodified __ARGS((buf_T *bufp));
+void netbeans_button_release __ARGS((int button));
+void netbeans_keycommand __ARGS((int key));
+void netbeans_save_buffer __ARGS((buf_T *bufp));
+void netbeans_deleted_all_lines __ARGS((buf_T *bufp));
+int netbeans_is_guarded __ARGS((linenr_T top, linenr_T bot));
+void netbeans_draw_multisign_indicator __ARGS((int row));
+void netbeans_draw_multisign_indicator __ARGS((int row));
+void netbeans_gutter_click __ARGS((linenr_T lnum));
+/* vim: set ft=c : */
diff --git a/src/proto/normal.pro b/src/proto/normal.pro
new file mode 100644
index 000000000..f5e332b65
--- /dev/null
+++ b/src/proto/normal.pro
@@ -0,0 +1,23 @@
+/* normal.c */
+void init_normal_cmds __ARGS((void));
+void normal_cmd __ARGS((oparg_T *oap, int toplevel));
+void do_pending_operator __ARGS((cmdarg_T *cap, int old_col, int gui_yank));
+int do_mouse __ARGS((oparg_T *oap, int c, int dir, long count, int fixindent));
+void check_visual_highlight __ARGS((void));
+void end_visual_mode __ARGS((void));
+void reset_VIsual_and_resel __ARGS((void));
+void reset_VIsual __ARGS((void));
+int find_ident_under_cursor __ARGS((char_u **string, int find_type));
+int find_ident_at_pos __ARGS((win_T *wp, linenr_T lnum, colnr_T startcol, char_u **string, int find_type));
+void clear_showcmd __ARGS((void));
+int add_to_showcmd __ARGS((int c));
+void add_to_showcmd_c __ARGS((int c));
+void push_showcmd __ARGS((void));
+void pop_showcmd __ARGS((void));
+void do_check_scrollbind __ARGS((int check));
+void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
+void scroll_redraw __ARGS((int up, long count));
+void do_nv_ident __ARGS((int c1, int c2));
+void start_selection __ARGS((void));
+void may_start_select __ARGS((int c));
+/* vim: set ft=c : */
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
new file mode 100644
index 000000000..c64267309
--- /dev/null
+++ b/src/proto/ops.pro
@@ -0,0 +1,53 @@
+/* ops.c */
+int get_op_type __ARGS((int char1, int char2));
+int op_on_lines __ARGS((int op));
+int get_op_char __ARGS((int optype));
+int get_extra_op_char __ARGS((int optype));
+void op_shift __ARGS((oparg_T *oap, int curs_top, int amount));
+void shift_line __ARGS((int left, int round, int amount));
+void op_reindent __ARGS((oparg_T *oap, int (*how)(void)));
+int get_expr_register __ARGS((void));
+void set_expr_line __ARGS((char_u *new_line));
+char_u *get_expr_line __ARGS((void));
+int valid_yank_reg __ARGS((int regname, int writing));
+void *get_register __ARGS((int name, int copy));
+void put_register __ARGS((int name, void *reg));
+int yank_register_mline __ARGS((int regname));
+int do_record __ARGS((int c));
+int do_execreg __ARGS((int regname, int colon, int addcr));
+int insert_reg __ARGS((int regname, int literally));
+int cmdline_paste __ARGS((int regname, int literally));
+void adjust_clip_reg __ARGS((int *rp));
+int op_delete __ARGS((oparg_T *oap));
+int op_replace __ARGS((oparg_T *oap, int c));
+void op_tilde __ARGS((oparg_T *oap));
+int swapchar __ARGS((int op_type, pos_T *pos));
+void op_insert __ARGS((oparg_T *oap, long count1));
+int op_change __ARGS((oparg_T *oap));
+void init_yank __ARGS((void));
+int op_yank __ARGS((oparg_T *oap, int deleting, int mess));
+void do_put __ARGS((int regname, int dir, long count, int flags));
+int preprocs_left __ARGS((void));
+int get_register_name __ARGS((int num));
+void ex_display __ARGS((exarg_T *eap));
+void do_do_join __ARGS((long count, int insert_space));
+int do_join __ARGS((int insert_space));
+void op_format __ARGS((oparg_T *oap, int keep_cursor));
+void format_lines __ARGS((linenr_T line_count));
+int paragraph_start __ARGS((linenr_T lnum));
+int do_addsub __ARGS((int command, linenr_T Prenum1));
+int read_viminfo_register __ARGS((vir_T *virp, int force));
+void write_viminfo_registers __ARGS((FILE *fp));
+void x11_export_final_selection __ARGS((void));
+void clip_free_selection __ARGS((VimClipboard *cbd));
+void clip_get_selection __ARGS((VimClipboard *cbd));
+void clip_yank_selection __ARGS((int type, char_u *str, long len, VimClipboard *cbd));
+int clip_convert_selection __ARGS((char_u **str, long_u *len, VimClipboard *cbd));
+void dnd_yank_drag_data __ARGS((char_u *str, long len));
+char_u get_reg_type __ARGS((int regname, long *reglen));
+char_u *get_reg_contents __ARGS((int regname, int allowexpr));
+void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
+void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
+void clear_oparg __ARGS((oparg_T *oap));
+void cursor_pos_info __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/option.pro b/src/proto/option.pro
new file mode 100644
index 000000000..c0a567ba6
--- /dev/null
+++ b/src/proto/option.pro
@@ -0,0 +1,52 @@
+/* option.c */
+void set_init_1 __ARGS((void));
+void set_string_default __ARGS((char *name, char_u *val));
+void set_number_default __ARGS((char *name, long val));
+void set_init_2 __ARGS((void));
+void set_init_3 __ARGS((void));
+void set_helplang_default __ARGS((char_u *lang));
+void init_gui_options __ARGS((void));
+void set_title_defaults __ARGS((void));
+int do_set __ARGS((char_u *arg, int opt_flags));
+void set_options_bin __ARGS((int oldval, int newval, int opt_flags));
+int get_viminfo_parameter __ARGS((int type));
+char_u *find_viminfo_parameter __ARGS((int type));
+void check_options __ARGS((void));
+void check_buf_options __ARGS((buf_T *buf));
+void free_string_option __ARGS((char_u *p));
+void clear_string_option __ARGS((char_u **pp));
+void set_term_option_alloced __ARGS((char_u **p));
+void set_string_option_direct __ARGS((char_u *name, int opt_idx, char_u *val, int opt_flags));
+char_u *check_stl_option __ARGS((char_u *s));
+int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags));
+void set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags));
+char_u *get_term_code __ARGS((char_u *tname));
+char_u *get_highlight_default __ARGS((void));
+int makeset __ARGS((FILE *fd, int opt_flags, int local_only));
+int makefoldset __ARGS((FILE *fd));
+void clear_termoptions __ARGS((void));
+void set_term_defaults __ARGS((void));
+void comp_col __ARGS((void));
+char_u *get_equalprg __ARGS((void));
+void win_copy_options __ARGS((win_T *wp_from, win_T *wp_to));
+void copy_winopt __ARGS((winopt_T *from, winopt_T *to));
+void check_win_options __ARGS((win_T *win));
+void check_winopt __ARGS((winopt_T *wop));
+void clear_winopt __ARGS((winopt_T *wop));
+void buf_copy_options __ARGS((buf_T *buf, int flags));
+void reset_modifiable __ARGS((void));
+void set_iminsert_global __ARGS((void));
+void set_imsearch_global __ARGS((void));
+void set_context_in_set_cmd __ARGS((expand_T *xp, char_u *arg, int opt_flags));
+int ExpandSettings __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
+int ExpandOldSetting __ARGS((int *num_file, char_u ***file));
+int has_format_option __ARGS((int x));
+int shortmess __ARGS((int x));
+void vimrc_found __ARGS((void));
+void change_compatible __ARGS((int on));
+int option_was_set __ARGS((char_u *name));
+int can_bs __ARGS((int what));
+void save_file_ff __ARGS((buf_T *buf));
+int file_ff_differs __ARGS((buf_T *buf));
+int check_ff_value __ARGS((char_u *p));
+/* vim: set ft=c : */
diff --git a/src/proto/os_amiga.pro b/src/proto/os_amiga.pro
new file mode 100644
index 000000000..317e21100
--- /dev/null
+++ b/src/proto/os_amiga.pro
@@ -0,0 +1,46 @@
+/* os_amiga.c */
+void win_resize_on __ARGS((void));
+void win_resize_off __ARGS((void));
+void mch_write __ARGS((char_u *p, int len));
+int mch_inchar __ARGS((char_u *buf, int maxlen, long time, int tb_change_cnt));
+int mch_char_avail __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+void mch_delay __ARGS((long msec, int ignoreinput));
+void mch_suspend __ARGS((void));
+void mch_init __ARGS((void));
+int mch_check_win __ARGS((int argc, char **argv));
+int mch_input_isatty __ARGS((void));
+void fname_case __ARGS((char_u *name, int len));
+void mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_restore_title __ARGS((int which));
+int mch_can_restore_title __ARGS((void));
+int mch_can_restore_icon __ARGS((void));
+int mch_get_user_name __ARGS((char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+long mch_get_pid __ARGS((void));
+int mch_dirname __ARGS((char_u *buf, int len));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int mch_isFullName __ARGS((char_u *fname));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+void mch_mkdir __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+void mch_early_init __ARGS((void));
+void mch_exit __ARGS((int r));
+void mch_settmode __ARGS((int tmode));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_breakcheck __ARGS((void));
+long Chk_Abort __ARGS((void));
+int mch_expandpath __ARGS((garray_T *gap, char_u *pat, int flags));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+int mch_has_wildcard __ARGS((char_u *p));
+char_u *mch_getenv __ARGS((char_u *var));
+int mch_setenv __ARGS((char *var, char *value, int x));
+/* vim: set ft=c : */
diff --git a/src/proto/os_beos.pro b/src/proto/os_beos.pro
new file mode 100644
index 000000000..c53710126
--- /dev/null
+++ b/src/proto/os_beos.pro
@@ -0,0 +1,4 @@
+/* os_beos.c */
+void beos_cleanup_read_thread __ARGS((void));
+int beos_select __ARGS((int nbits, struct fd_set *rbits, struct fd_set *wbits, struct fd_set *ebits, struct timeval *timeout));
+/* vim: set ft=c : */
diff --git a/src/proto/os_mac.pro b/src/proto/os_mac.pro
new file mode 100644
index 000000000..ced47faf2
--- /dev/null
+++ b/src/proto/os_mac.pro
@@ -0,0 +1,64 @@
+/* os_mac.c */
+void mch_setmouse __ARGS((int on));
+
+void mch_windexit __ARGS((int r));
+int mch_check_win __ARGS((int argc, char **argv));
+int mch_input_isatty __ARGS((void));
+
+void fname_case __ARGS((char_u *name, int len));
+void mch_early_init __ARGS((void));
+void mch_exit __ARGS((int r));
+void mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_restore_title __ARGS((int which));
+
+int mch_get_user_name __ARGS((char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+long mch_get_pid __ARGS((void));
+
+int mch_dirname __ARGS((char_u *buf, int len));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int mch_isFullName __ARGS((char_u *fname));
+void slash_adjust __ARGS((char_u *p));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+void mch_init __ARGS((void));
+void mch_settmode __ARGS((int raw));
+
+int mch_chdir __ARGS((char *p_name));
+#if defined(__MRC__) || defined(__SC__)
+int stat __ARGS((char *p, struct stat *p_st));
+#endif
+
+int mch_call_shell __ARGS((char_u *cmd, int options));
+int mch_has_wildcard __ARGS((char_u *s));
+int mch_expandpath __ARGS((struct growarray *gap, char_u *path, int flags));
+int mac_expandpath __ARGS((struct growarray *gap, char_u *path, int flags, short start_at, short as_full));
+/*int vim_chdir __ARGS((char *path));*/
+void mch_delay __ARGS((long msec, int ignoreinput));
+void mch_breakcheck __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+
+void slash_n_colon_adjust __ARGS((char_u *buf));
+int mch_copy_file(char_u *from, char_u *to);
+
+int mch_has_resource_fork (char_u *file);
+int mch_copy_file_attribute(char_u *from, char_u *to);
+
+void mch_shellinit __ARGS((void));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+void mch_suspend __ARGS((void));
+int mch_can_restore_title __ARGS((void));
+int mch_can_restore_icon __ARGS((void));
+
+void slash_to_colon __ARGS((char_u *p));
+char_u *slash_to_colon_save __ARGS((char_u *p));
+
+/* vim: set ft=c : */
diff --git a/src/proto/os_msdos.pro b/src/proto/os_msdos.pro
new file mode 100644
index 000000000..a867f3d1c
--- /dev/null
+++ b/src/proto/os_msdos.pro
@@ -0,0 +1,48 @@
+/* os_msdos.c */
+void mch_set_normal_colors __ARGS((void));
+void mch_update_cursor __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+void mch_delay __ARGS((long msec, int ignoreinput));
+void mch_write __ARGS((char_u *s, int len));
+int mch_inchar __ARGS((char_u *buf, int maxlen, long time, int tb_change_cnt));
+int mch_char_avail __ARGS((void));
+void mch_suspend __ARGS((void));
+void mch_init __ARGS((void));
+int mch_check_win __ARGS((int argc, char **argv));
+int mch_input_isatty __ARGS((void));
+void fname_case __ARGS((char_u *name, int len));
+long mch_get_pid __ARGS((void));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+void slash_adjust __ARGS((char_u *p));
+int mch_isFullName __ARGS((char_u *fname));
+void mch_early_init __ARGS((void));
+void mch_exit __ARGS((int r));
+void mch_settmode __ARGS((int tmode));
+void mch_setmouse __ARGS((int on));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+void mch_check_columns __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_breakcheck __ARGS((void));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+int mch_has_wildcard __ARGS((char_u *p));
+int mch_chdir __ARGS((char *path));
+char *djgpp_setlocale __ARGS((void));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+int mch_dirname __ARGS((char_u *buf, int len));
+int mch_remove __ARGS((char_u *name));
+char_u *mch_getenv __ARGS((char_u *name));
+int mch_get_user_name __ARGS((char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+/* vim: set ft=c : */
diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro
new file mode 100644
index 000000000..b4612f0d0
--- /dev/null
+++ b/src/proto/os_mswin.pro
@@ -0,0 +1,60 @@
+/* os_mswin.c */
+void mch_exit __ARGS((int r));
+void mch_early_init __ARGS((void));
+int mch_input_isatty __ARGS((void));
+void mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_restore_title __ARGS((int which));
+int mch_can_restore_title __ARGS((void));
+int mch_can_restore_icon __ARGS((void));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int mch_isFullName __ARGS((char_u *fname));
+void slash_adjust __ARGS((char_u *p));
+int vim_stat __ARGS((const char *name, struct stat *stp));
+void mch_settmode __ARGS((int tmode));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+void mch_suspend __ARGS((void));
+void display_errors __ARGS((void));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+int mch_has_wildcard __ARGS((char_u *p));
+int mch_chdir __ARGS((char *path));
+int can_end_termcap_mode __ARGS((int give_msg));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_libcall __ARGS((char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result));
+int utf8_to_ucs2 __ARGS((char_u *instr, int inlen, short_u *outstr, int *unconvlenp));
+int ucs2_to_utf8 __ARGS((short_u *instr, int inlen, char_u *outstr));
+void MultiByteToWideChar_alloc __ARGS((UINT cp, DWORD flags, LPCSTR in, int inlen, LPWSTR *out, int *outlen));
+void WideCharToMultiByte_alloc __ARGS((UINT cp, DWORD flags, LPCWSTR in, int inlen, LPSTR *out, int *outlen, LPCSTR def, LPBOOL useddef));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+short_u *enc_to_ucs2 __ARGS((char_u *str, int *lenp));
+char_u *ucs2_to_enc __ARGS((short_u *str, int *lenp));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+void DumpPutS __ARGS((const char *psz));
+void mch_print_cleanup __ARGS((void));
+int mch_print_init __ARGS((prt_settings_T *psettings, char_u *jobname, int forceit));
+int mch_print_begin __ARGS((prt_settings_T *psettings));
+void mch_print_end __ARGS((prt_settings_T *psettings));
+int mch_print_end_page __ARGS((void));
+int mch_print_begin_page __ARGS((char_u *msg));
+int mch_print_blank_page __ARGS((void));
+void mch_print_start_line __ARGS((int margin, int page_line));
+int mch_print_text_out __ARGS((char_u *p, int len));
+void mch_print_set_font __ARGS((int iBold, int iItalic, int iUnderline));
+void mch_print_set_bg __ARGS((unsigned long bgcol));
+void mch_print_set_fg __ARGS((unsigned long fgcol));
+char_u *mch_resolve_shortcut __ARGS((char_u *fname));
+void win32_set_foreground __ARGS((void));
+void serverInitMessaging __ARGS((void));
+void serverSetName __ARGS((char_u *name));
+char_u *serverGetVimNames __ARGS((void));
+int serverSendReply __ARGS((char_u *name, char_u *reply));
+int serverSendToVim __ARGS((char_u *name, char_u *cmd, char_u **result, void *ptarget, int asExpr, int silent));
+void serverForeground __ARGS((char_u *name));
+char_u *serverGetReply __ARGS((HWND server, int *expr_res, int remove, int wait));
+void serverProcessPendingMessages __ARGS((void));
+char *charset_id2name __ARGS((int id));
+int get_logfont __ARGS((LOGFONT *lf, char_u *name, HDC printer_dc));
+/* vim: set ft=c : */
diff --git a/src/proto/os_qnx.pro b/src/proto/os_qnx.pro
new file mode 100644
index 000000000..54a63149a
--- /dev/null
+++ b/src/proto/os_qnx.pro
@@ -0,0 +1,8 @@
+/* os_qnx.c */
+void qnx_init __ARGS((void));
+void qnx_clip_init __ARGS((void));
+int clip_mch_own_selection __ARGS((VimClipboard *cbd));
+void clip_mch_lose_selection __ARGS((VimClipboard *cbd));
+void clip_mch_request_selection __ARGS((VimClipboard *cbd));
+void clip_mch_set_selection __ARGS((VimClipboard *cbd));
+/* vim: set ft=c : */
diff --git a/src/proto/os_riscos.pro b/src/proto/os_riscos.pro
new file mode 100644
index 000000000..9ea4cd55f
--- /dev/null
+++ b/src/proto/os_riscos.pro
@@ -0,0 +1,49 @@
+/* os_riscos.c */
+void mch_write __ARGS((char_u *s, int len));
+int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
+int mch_char_avail __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+void mch_delay __ARGS((long msec, int ignoreinput));
+void mch_suspend __ARGS((void));
+void mch_init __ARGS((void));
+int mch_check_win __ARGS((int argc, char **argv));
+int mch_input_isatty __ARGS((void));
+int mch_can_restore_title __ARGS((void));
+int mch_can_restore_icon __ARGS((void));
+void mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_restore_title __ARGS((int which));
+int mch_get_user_name __ARGS((char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+long mch_get_pid __ARGS((void));
+int mch_dirname __ARGS((char_u *buf, int len));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int mch_isFullName __ARGS((char_u *fname));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+void mch_early_init __ARGS((void));
+void mch_exit __ARGS((int r));
+void mch_settmode __ARGS((int tmode));
+void mch_setmouse __ARGS((int on));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_breakcheck __ARGS((void));
+int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
+int expand_section __ARGS((garray_T *gap, char_u *root, char_u *rest, int flags));
+int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+int mch_has_wildcard __ARGS((char_u *p));
+int mch_remove __ARGS((char_u *file));
+char_u *mch_munge_fname __ARGS((char_u *fname));
+int ro_buflist_add __ARGS((char_u *old_name));
+int mch_chdir __ARGS((char_u *dir));
+void mch_read_filetype __ARGS((char_u *file));
+void mch_set_filetype __ARGS((char_u *file, char_u *type));
+int mch_check_filetype __ARGS((char_u *fname, char_u *type));
+/* vim: set ft=c : */
diff --git a/src/proto/os_unix.pro b/src/proto/os_unix.pro
new file mode 100644
index 000000000..9a3908b49
--- /dev/null
+++ b/src/proto/os_unix.pro
@@ -0,0 +1,70 @@
+/* os_unix.c */
+void mch_write __ARGS((char_u *s, int len));
+int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
+int mch_char_avail __ARGS((void));
+long_u mch_total_mem __ARGS((int special));
+void mch_delay __ARGS((long msec, int ignoreinput));
+int mch_stackcheck __ARGS((char *p));
+void mch_startjmp __ARGS((void));
+void mch_endjmp __ARGS((void));
+void mch_didjmp __ARGS((void));
+void mch_suspend __ARGS((void));
+void mch_init __ARGS((void));
+void reset_signals __ARGS((void));
+int mch_check_win __ARGS((int argc, char **argv));
+int mch_input_isatty __ARGS((void));
+int mch_can_restore_title __ARGS((void));
+int mch_can_restore_icon __ARGS((void));
+void mch_settitle __ARGS((char_u *title, char_u *icon));
+void mch_restore_title __ARGS((int which));
+int vim_is_xterm __ARGS((char_u *name));
+int use_xterm_mouse __ARGS((void));
+int vim_is_iris __ARGS((char_u *name));
+int vim_is_vt300 __ARGS((char_u *name));
+int vim_is_fastterm __ARGS((char_u *name));
+int mch_get_user_name __ARGS((char_u *s, int len));
+int mch_get_uname __ARGS((uid_t uid, char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+long mch_get_pid __ARGS((void));
+int mch_dirname __ARGS((char_u *buf, int len));
+void slash_adjust __ARGS((char_u *p));
+int mch_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int mch_isFullName __ARGS((char_u *fname));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+vim_acl_T mch_get_acl __ARGS((char_u *fname));
+void mch_set_acl __ARGS((char_u *fname, vim_acl_T aclent));
+void mch_free_acl __ARGS((vim_acl_T aclent));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+void mch_early_init __ARGS((void));
+void mch_exit __ARGS((int r));
+void mch_settmode __ARGS((int tmode));
+void get_stty __ARGS((void));
+void mch_setmouse __ARGS((int on));
+void check_mouse_termcode __ARGS((void));
+int mch_screenmode __ARGS((char_u *arg));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_breakcheck __ARGS((void));
+int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
+int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
+int mch_has_exp_wildcard __ARGS((char_u *p));
+int mch_has_wildcard __ARGS((char_u *p));
+int mch_libcall __ARGS((char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result));
+void setup_term_clip __ARGS((void));
+void start_xterm_trace __ARGS((int button));
+void stop_xterm_trace __ARGS((void));
+void clear_xterm_clip __ARGS((void));
+int clip_xterm_own_selection __ARGS((VimClipboard *cbd));
+void clip_xterm_lose_selection __ARGS((VimClipboard *cbd));
+void clip_xterm_request_selection __ARGS((VimClipboard *cbd));
+void clip_xterm_set_selection __ARGS((VimClipboard *cbd));
+int xsmp_handle_requests __ARGS((void));
+void xsmp_init __ARGS((void));
+void xsmp_close __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/os_vms.pro b/src/proto/os_vms.pro
new file mode 100644
index 000000000..2ed6394eb
--- /dev/null
+++ b/src/proto/os_vms.pro
@@ -0,0 +1,14 @@
+/* os_vms.c */
+void mch_settmode __ARGS((int tmode));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+char_u *mch_getenv __ARGS((char_u *lognam));
+int mch_setenv __ARGS((char *var, char *value, int x));
+int vms_sys __ARGS((char *cmd, char *out, char *inp));
+int vms_sys_status __ARGS((int status));
+int vms_read __ARGS((char *inbuf, size_t nbytes));
+int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
+int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
+void *vms_fixfilename __ARGS((void *instring));
+void vms_remove_version __ARGS((void *fname));
+/* vim: set ft=c : */
diff --git a/src/proto/os_win16.pro b/src/proto/os_win16.pro
new file mode 100644
index 000000000..31fa72c05
--- /dev/null
+++ b/src/proto/os_win16.pro
@@ -0,0 +1,12 @@
+/* os_win16.c */
+void mch_setmouse __ARGS((int on));
+void mch_init __ARGS((void));
+int mch_check_win __ARGS((int argc, char **argv));
+long mch_get_pid __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_delay __ARGS((long msec, int ignoreinput));
+void mch_breakcheck __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+int mch_rename __ARGS((const char *pszOldFile, const char *pszNewFile));
+char *default_shell __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro
new file mode 100644
index 000000000..2daa1467b
--- /dev/null
+++ b/src/proto/os_win32.pro
@@ -0,0 +1,48 @@
+/* os_win32.c */
+int dyn_libintl_init __ARGS((char *libname));
+void dyn_libintl_end __ARGS((void));
+void PlatformId __ARGS((void));
+int mch_windows95 __ARGS((void));
+void mch_setmouse __ARGS((int on));
+void mch_update_cursor __ARGS((void));
+int mch_char_avail __ARGS((void));
+int mch_inchar __ARGS((char_u *buf, int maxlen, long time, int tb_change_cnt));
+void mch_init __ARGS((void));
+void mch_exit __ARGS((int r));
+int mch_check_win __ARGS((int argc, char **argv));
+void fname_case __ARGS((char_u *name, int len));
+int mch_get_user_name __ARGS((char_u *s, int len));
+void mch_get_host_name __ARGS((char_u *s, int len));
+long mch_get_pid __ARGS((void));
+int mch_dirname __ARGS((char_u *buf, int len));
+long mch_getperm __ARGS((char_u *name));
+int mch_setperm __ARGS((char_u *name, long perm));
+void mch_hide __ARGS((char_u *name));
+int mch_isdir __ARGS((char_u *name));
+int mch_writable __ARGS((char_u *name));
+int mch_can_exe __ARGS((char_u *name));
+int mch_nodetype __ARGS((char_u *name));
+vim_acl_T mch_get_acl __ARGS((char_u *fname));
+void mch_set_acl __ARGS((char_u *fname, vim_acl_T acl));
+void mch_free_acl __ARGS((vim_acl_T acl));
+void mch_settmode __ARGS((int tmode));
+int mch_get_shellsize __ARGS((void));
+void mch_set_shellsize __ARGS((void));
+void mch_new_shellsize __ARGS((void));
+void mch_set_winsize_now __ARGS((void));
+int mch_call_shell __ARGS((char_u *cmd, int options));
+void mch_set_normal_colors __ARGS((void));
+void mch_write __ARGS((char_u *s, int len));
+void mch_delay __ARGS((long msec, int ignoreinput));
+int mch_remove __ARGS((char_u *name));
+void mch_breakcheck __ARGS((void));
+long_u mch_avail_mem __ARGS((int special));
+int mch_wrename __ARGS((WCHAR *wold, WCHAR *wnew));
+int mch_rename __ARGS((const char *pszOldFile, const char *pszNewFile));
+char *default_shell __ARGS((void));
+int mch_access __ARGS((char *n, int p));
+int mch_open __ARGS((char *name, int flags, int mode));
+FILE *mch_fopen __ARGS((char *name, char *mode));
+int mch_copy_file_attribute __ARGS((char_u *from, char_u *to));
+int myresetstkoflw __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/pty.pro b/src/proto/pty.pro
new file mode 100644
index 000000000..f2424a509
--- /dev/null
+++ b/src/proto/pty.pro
@@ -0,0 +1,3 @@
+/* pty.c */
+int OpenPTY __ARGS((char **ttyn));
+int SetupSlavePTY __ARGS((int fd));
diff --git a/src/proto/quickfix.pro b/src/proto/quickfix.pro
new file mode 100644
index 000000000..c1d619dc0
--- /dev/null
+++ b/src/proto/quickfix.pro
@@ -0,0 +1,21 @@
+/* quickfix.c */
+int qf_init __ARGS((char_u *efile, char_u *errorformat, int newlist));
+void qf_jump __ARGS((int dir, int errornr, int forceit));
+void qf_list __ARGS((exarg_T *eap));
+void qf_age __ARGS((exarg_T *eap));
+void qf_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+void ex_cwindow __ARGS((exarg_T *eap));
+void ex_cclose __ARGS((exarg_T *eap));
+void ex_copen __ARGS((exarg_T *eap));
+linenr_T qf_current_entry __ARGS((void));
+int bt_quickfix __ARGS((buf_T *buf));
+int bt_nofile __ARGS((buf_T *buf));
+int bt_dontwrite __ARGS((buf_T *buf));
+int bt_dontwrite_msg __ARGS((buf_T *buf));
+int buf_hide __ARGS((buf_T *buf));
+void ex_make __ARGS((exarg_T *eap));
+void ex_cc __ARGS((exarg_T *eap));
+void ex_cnext __ARGS((exarg_T *eap));
+void ex_cfile __ARGS((exarg_T *eap));
+void ex_helpgrep __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/regexp.pro b/src/proto/regexp.pro
new file mode 100644
index 000000000..0ff1c24ea
--- /dev/null
+++ b/src/proto/regexp.pro
@@ -0,0 +1,16 @@
+/* regexp.c */
+int re_multiline __ARGS((regprog_T *prog));
+int re_lookbehind __ARGS((regprog_T *prog));
+char_u *skip_regexp __ARGS((char_u *startp, int dirc, int magic, char_u **newp));
+regprog_T *vim_regcomp __ARGS((char_u *expr, int re_flags));
+int vim_regcomp_had_eol __ARGS((void));
+int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
+int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
+long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col));
+reg_extmatch_T *ref_extmatch __ARGS((reg_extmatch_T *em));
+void unref_extmatch __ARGS((reg_extmatch_T *em));
+char_u *regtilde __ARGS((char_u *source, int magic));
+int vim_regsub __ARGS((regmatch_T *rmp, char_u *source, char_u *dest, int copy, int magic, int backslash));
+int vim_regsub_multi __ARGS((regmmatch_T *rmp, linenr_T lnum, char_u *source, char_u *dest, int copy, int magic, int backslash));
+char_u *reg_submatch __ARGS((int no));
+/* vim: set ft=c : */
diff --git a/src/proto/screen.pro b/src/proto/screen.pro
new file mode 100644
index 000000000..7a41fd431
--- /dev/null
+++ b/src/proto/screen.pro
@@ -0,0 +1,46 @@
+/* screen.c */
+void redraw_later __ARGS((int type));
+void redraw_win_later __ARGS((win_T *wp, int type));
+void redraw_later_clear __ARGS((void));
+void redraw_all_later __ARGS((int type));
+void redraw_curbuf_later __ARGS((int type));
+void redraw_buf_later __ARGS((buf_T *buf, int type));
+void redrawWinline __ARGS((linenr_T lnum, int invalid));
+void update_curbuf __ARGS((int type));
+void update_screen __ARGS((int type));
+void update_debug_sign __ARGS((buf_T *buf, linenr_T lnum));
+void updateWindow __ARGS((win_T *wp));
+void status_redraw_all __ARGS((void));
+void status_redraw_curbuf __ARGS((void));
+void redraw_statuslines __ARGS((void));
+void win_redraw_last_status __ARGS((frame_T *frp));
+void win_redr_status_matches __ARGS((expand_T *xp, int num_matches, char_u **matches, int match, int showtail));
+void win_redr_status __ARGS((win_T *wp));
+int stl_connected __ARGS((win_T *wp));
+int get_keymap_str __ARGS((win_T *wp, char_u *buf, int len));
+void screen_putchar __ARGS((int c, int row, int col, int attr));
+void screen_getbytes __ARGS((int row, int col, char_u *bytes, int *attrp));
+void screen_puts __ARGS((char_u *text, int row, int col, int attr));
+void screen_puts_len __ARGS((char_u *text, int len, int row, int col, int attr));
+void screen_stop_highlight __ARGS((void));
+void reset_cterm_colors __ARGS((void));
+void screen_draw_rectangle __ARGS((int row, int col, int height, int width, int invert));
+void screen_fill __ARGS((int start_row, int end_row, int start_col, int end_col, int c1, int c2, int attr));
+void check_for_delay __ARGS((int check_msg_scroll));
+int screen_valid __ARGS((int clear));
+void screenalloc __ARGS((int clear));
+void screenclear __ARGS((void));
+int can_clear __ARGS((char_u *p));
+void screen_start __ARGS((void));
+void screen_down __ARGS((void));
+void windgoto __ARGS((int row, int col));
+void setcursor __ARGS((void));
+int win_ins_lines __ARGS((win_T *wp, int row, int line_count, int invalid, int mayclear));
+int win_del_lines __ARGS((win_T *wp, int row, int line_count, int invalid, int mayclear));
+int screen_del_lines __ARGS((int off, int row, int line_count, int end, int force, win_T *wp));
+int showmode __ARGS((void));
+void unshowmode __ARGS((int force));
+int redrawing __ARGS((void));
+int messaging __ARGS((void));
+void showruler __ARGS((int always));
+/* vim: set ft=c : */
diff --git a/src/proto/search.pro b/src/proto/search.pro
new file mode 100644
index 000000000..194c39087
--- /dev/null
+++ b/src/proto/search.pro
@@ -0,0 +1,33 @@
+/* search.c */
+int search_regcomp __ARGS((char_u *pat, int pat_save, int pat_use, int options, regmmatch_T *regmatch));
+char_u *get_search_pat __ARGS((void));
+void save_search_patterns __ARGS((void));
+void restore_search_patterns __ARGS((void));
+int ignorecase __ARGS((char_u *pat));
+char_u *last_search_pat __ARGS((void));
+void reset_search_dir __ARGS((void));
+void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast));
+void last_pat_prog __ARGS((regmmatch_T *regmatch));
+int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use));
+int do_search __ARGS((oparg_T *oap, int dirc, char_u *pat, long count, int options));
+int search_for_exact_line __ARGS((buf_T *buf, pos_T *pos, int dir, char_u *pat));
+int searchc __ARGS((cmdarg_T *cap, int t_cmd));
+pos_T *findmatch __ARGS((oparg_T *oap, int initc));
+pos_T *findmatchlimit __ARGS((oparg_T *oap, int initc, int flags, int maxtravel));
+void showmatch __ARGS((int c));
+int findsent __ARGS((int dir, long count));
+int findpar __ARGS((oparg_T *oap, int dir, long count, int what, int both));
+int startPS __ARGS((linenr_T lnum, int para, int both));
+int fwd_word __ARGS((long count, int bigword, int eol));
+int bck_word __ARGS((long count, int bigword, int stop));
+int end_word __ARGS((long count, int bigword, int stop, int empty));
+int bckend_word __ARGS((long count, int bigword, int eol));
+int current_word __ARGS((oparg_T *oap, long count, int include, int bigword));
+int current_sent __ARGS((oparg_T *oap, long count, int include));
+int current_block __ARGS((oparg_T *oap, long count, int include, int what, int other));
+int current_par __ARGS((oparg_T *oap, long count, int include, int type));
+int linewhite __ARGS((linenr_T lnum));
+void find_pattern_in_path __ARGS((char_u *ptr, int dir, int len, int whole, int skip_comments, int type, long count, int action, linenr_T start_lnum, linenr_T end_lnum));
+int read_viminfo_search_pattern __ARGS((vir_T *virp, int force));
+void write_viminfo_search_pattern __ARGS((FILE *fp));
+/* vim: set ft=c : */
diff --git a/src/proto/syntax.pro b/src/proto/syntax.pro
new file mode 100644
index 000000000..b4dd3eae6
--- /dev/null
+++ b/src/proto/syntax.pro
@@ -0,0 +1,42 @@
+/* syntax.c */
+void syntax_start __ARGS((win_T *wp, linenr_T lnum));
+void syn_stack_free_all __ARGS((buf_T *buf));
+void syn_stack_apply_changes __ARGS((buf_T *buf));
+void syntax_end_parsing __ARGS((linenr_T lnum));
+int syntax_check_changed __ARGS((linenr_T lnum));
+int get_syntax_attr __ARGS((colnr_T col));
+void syntax_clear __ARGS((buf_T *buf));
+void ex_syntax __ARGS((exarg_T *eap));
+int syntax_present __ARGS((buf_T *buf));
+void set_context_in_syntax_cmd __ARGS((expand_T *xp, char_u *arg));
+char_u *get_syntax_name __ARGS((expand_T *xp, int idx));
+int syn_get_id __ARGS((long lnum, long col, int trans));
+int syn_get_foldlevel __ARGS((win_T *wp, long lnum));
+void init_highlight __ARGS((int both, int reset));
+int load_colors __ARGS((char_u *p));
+void do_highlight __ARGS((char_u *line, int forceit, int init));
+void restore_cterm_colors __ARGS((void));
+void set_normal_colors __ARGS((void));
+char_u *hl_get_font_name __ARGS((void));
+void hl_set_font_name __ARGS((char_u *font_name));
+void hl_set_bg_color_name __ARGS((char_u *name));
+void hl_set_fg_color_name __ARGS((char_u *name));
+attrentry_T *syn_gui_attr2entry __ARGS((int attr));
+attrentry_T *syn_term_attr2entry __ARGS((int attr));
+attrentry_T *syn_cterm_attr2entry __ARGS((int attr));
+char_u *highlight_has_attr __ARGS((int id, int flag, int modec));
+char_u *highlight_color __ARGS((int id, char_u *what, int modec));
+long_u highlight_gui_color_rgb __ARGS((int id, int fg));
+int syn_name2id __ARGS((char_u *name));
+int highlight_exists __ARGS((char_u *name));
+int syn_namen2id __ARGS((char_u *linep, int len));
+int syn_check_group __ARGS((char_u *pp, int len));
+int syn_id2attr __ARGS((int hl_id));
+int syn_id2colors __ARGS((int hl_id, guicolor_T *fgp, guicolor_T *bgp));
+int syn_get_final_id __ARGS((int hl_id));
+void highlight_gui_started __ARGS((void));
+int highlight_changed __ARGS((void));
+void set_context_in_highlight_cmd __ARGS((expand_T *xp, char_u *arg));
+char_u *get_highlight_name __ARGS((expand_T *xp, int idx));
+void free_highlight_fonts __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/tag.pro b/src/proto/tag.pro
new file mode 100644
index 000000000..f8c236f56
--- /dev/null
+++ b/src/proto/tag.pro
@@ -0,0 +1,8 @@
+/* tag.c */
+int do_tag __ARGS((char_u *tag, int type, int count, int forceit, int verbose));
+void tag_freematch __ARGS((void));
+void do_tags __ARGS((exarg_T *eap));
+int find_tags __ARGS((char_u *pat, int *num_matches, char_u ***matchesp, int flags, int mincount, char_u *buf_ffname));
+void simplify_filename __ARGS((char_u *filename));
+int expand_tags __ARGS((int tagnames, char_u *pat, int *num_file, char_u ***file));
+/* vim: set ft=c : */
diff --git a/src/proto/term.pro b/src/proto/term.pro
new file mode 100644
index 000000000..16924badc
--- /dev/null
+++ b/src/proto/term.pro
@@ -0,0 +1,58 @@
+/* term.c */
+int set_termname __ARGS((char_u *term));
+void set_mouse_termcode __ARGS((int n, char_u *s));
+void del_mouse_termcode __ARGS((int n));
+void getlinecol __ARGS((long *cp, long *rp));
+int add_termcap_entry __ARGS((char_u *name, int force));
+int term_is_8bit __ARGS((char_u *name));
+int term_is_gui __ARGS((char_u *name));
+char_u *tltoa __ARGS((unsigned long i));
+void termcapinit __ARGS((char_u *name));
+void out_flush __ARGS((void));
+void out_flush_check __ARGS((void));
+void out_trash __ARGS((void));
+void out_char __ARGS((unsigned c));
+void out_str_nf __ARGS((char_u *s));
+void out_str __ARGS((char_u *s));
+void term_windgoto __ARGS((int row, int col));
+void term_cursor_right __ARGS((int i));
+void term_append_lines __ARGS((int line_count));
+void term_delete_lines __ARGS((int line_count));
+void term_set_winpos __ARGS((int x, int y));
+void term_set_winsize __ARGS((int width, int height));
+void term_fg_color __ARGS((int n));
+void term_bg_color __ARGS((int n));
+void term_settitle __ARGS((char_u *title));
+void ttest __ARGS((int pairs));
+void add_long_to_buf __ARGS((long_u val, char_u *dst));
+void check_shellsize __ARGS((void));
+void win_new_shellsize __ARGS((void));
+void shell_resized __ARGS((void));
+void shell_resized_check __ARGS((void));
+void set_shellsize __ARGS((int width, int height, int mustset));
+void settmode __ARGS((int tmode));
+void starttermcap __ARGS((void));
+void stoptermcap __ARGS((void));
+int swapping_screen __ARGS((void));
+void setmouse __ARGS((void));
+int mouse_has __ARGS((int c));
+int mouse_model_popup __ARGS((void));
+void scroll_start __ARGS((void));
+void cursor_on __ARGS((void));
+void cursor_off __ARGS((void));
+void scroll_region_set __ARGS((win_T *wp, int off));
+void scroll_region_reset __ARGS((void));
+void clear_termcodes __ARGS((void));
+void add_termcode __ARGS((char_u *name, char_u *string, int use_8bit));
+char_u *find_termcode __ARGS((char_u *name));
+char_u *get_termcode __ARGS((int i));
+void del_termcode __ARGS((char_u *name));
+void set_mouse_topline __ARGS((win_T *wp));
+int check_termcode __ARGS((int max_offset, char_u *buf, int buflen));
+char_u *replace_termcodes __ARGS((char_u *from, char_u **bufp, int from_part, int do_lt));
+int find_term_bykeys __ARGS((char_u *src));
+void show_termcodes __ARGS((void));
+int show_one_termcode __ARGS((char_u *name, char_u *code, int printit));
+char_u *translate_mapping __ARGS((char_u *str, int expmap));
+void update_tcap __ARGS((int attr));
+/* vim: set ft=c : */
diff --git a/src/proto/termlib.pro b/src/proto/termlib.pro
new file mode 100644
index 000000000..4369ecfc6
--- /dev/null
+++ b/src/proto/termlib.pro
@@ -0,0 +1,8 @@
+/* termlib.c */
+int tgetent __ARGS((char *tbuf, char *term));
+int tgetflag __ARGS((char *id));
+int tgetnum __ARGS((char *id));
+char *tgetstr __ARGS((char *id, char **buf));
+char *tgoto __ARGS((char *cm, int col, int line));
+int tputs __ARGS((char *cp, int affcnt, void (*outc)(unsigned int)));
+/* vim: set ft=c : */
diff --git a/src/proto/ui.pro b/src/proto/ui.pro
new file mode 100644
index 000000000..8825b6a16
--- /dev/null
+++ b/src/proto/ui.pro
@@ -0,0 +1,61 @@
+/* ui.c */
+void ui_write __ARGS((char_u *s, int len));
+void ui_inchar_undo __ARGS((char_u *s, int len));
+int ui_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
+int ui_char_avail __ARGS((void));
+void ui_delay __ARGS((long msec, int ignoreinput));
+void ui_suspend __ARGS((void));
+void suspend_shell __ARGS((void));
+int ui_get_shellsize __ARGS((void));
+void ui_set_shellsize __ARGS((int mustset));
+void ui_new_shellsize __ARGS((void));
+void ui_breakcheck __ARGS((void));
+void clip_init __ARGS((int can_use));
+void clip_update_selection __ARGS((void));
+void clip_own_selection __ARGS((VimClipboard *cbd));
+void clip_lose_selection __ARGS((VimClipboard *cbd));
+void clip_copy_selection __ARGS((void));
+void clip_auto_select __ARGS((void));
+int clip_isautosel __ARGS((void));
+void clip_modeless __ARGS((int button, int is_click, int is_drag));
+void clip_start_selection __ARGS((int col, int row, int repeated_click));
+void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click));
+void clip_may_redraw_selection __ARGS((int row, int col, int len));
+void clip_clear_selection __ARGS((void));
+void clip_may_clear_selection __ARGS((int row1, int row2));
+void clip_scroll_selection __ARGS((int rows));
+void clip_copy_modeless_selection __ARGS((int both));
+int clip_gen_own_selection __ARGS((VimClipboard *cbd));
+void clip_gen_lose_selection __ARGS((VimClipboard *cbd));
+void clip_gen_set_selection __ARGS((VimClipboard *cbd));
+void clip_gen_request_selection __ARGS((VimClipboard *cbd));
+int vim_is_input_buf_full __ARGS((void));
+int vim_is_input_buf_empty __ARGS((void));
+int vim_free_in_input_buf __ARGS((void));
+int vim_used_in_input_buf __ARGS((void));
+char_u *get_input_buf __ARGS((void));
+void set_input_buf __ARGS((char_u *p));
+void add_to_input_buf __ARGS((char_u *s, int len));
+void add_to_input_buf_csi __ARGS((char_u *str, int len));
+void push_raw_key __ARGS((char_u *s, int len));
+void trash_input_buf __ARGS((void));
+int read_from_input_buf __ARGS((char_u *buf, long maxlen));
+void fill_input_buf __ARGS((int exit_on_error));
+void read_error_exit __ARGS((void));
+void ui_cursor_shape __ARGS((void));
+int check_col __ARGS((int col));
+int check_row __ARGS((int row));
+void open_app_context __ARGS((void));
+void x11_setup_atoms __ARGS((Display *dpy));
+void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd));
+void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd));
+int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd));
+void clip_x11_set_selection __ARGS((VimClipboard *cbd));
+int jump_to_mouse __ARGS((int flags, int *inclusive, int which_button));
+int mouse_comp_pos __ARGS((win_T *win, int *rowp, int *colp, linenr_T *lnump));
+win_T *mouse_find_win __ARGS((int *rowp, int *colp));
+int get_fpos_of_mouse __ARGS((pos_T *mpos));
+int vcol2col __ARGS((win_T *wp, linenr_T lnum, int vcol));
+void ui_focus_change __ARGS((int in_focus));
+void im_save_status __ARGS((long *psave));
+/* vim: set ft=c : */
diff --git a/src/proto/undo.pro b/src/proto/undo.pro
new file mode 100644
index 000000000..8ac23239e
--- /dev/null
+++ b/src/proto/undo.pro
@@ -0,0 +1,18 @@
+/* undo.c */
+int u_save_cursor __ARGS((void));
+int u_save __ARGS((linenr_T top, linenr_T bot));
+int u_savesub __ARGS((linenr_T lnum));
+int u_inssub __ARGS((linenr_T lnum));
+int u_savedel __ARGS((linenr_T lnum, long nlines));
+void u_undo __ARGS((int count));
+void u_redo __ARGS((int count));
+void u_sync __ARGS((void));
+void u_unchanged __ARGS((buf_T *buf));
+void u_clearall __ARGS((buf_T *buf));
+void u_saveline __ARGS((linenr_T lnum));
+void u_clearline __ARGS((void));
+void u_undoline __ARGS((void));
+void u_blockfree __ARGS((buf_T *buf));
+int bufIsChanged __ARGS((buf_T *buf));
+int curbufIsChanged __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/version.pro b/src/proto/version.pro
new file mode 100644
index 000000000..3f371f9b8
--- /dev/null
+++ b/src/proto/version.pro
@@ -0,0 +1,9 @@
+/* version.c */
+void make_version __ARGS((void));
+int highest_patch __ARGS((void));
+int has_patch __ARGS((int n));
+void ex_version __ARGS((exarg_T *eap));
+void list_version __ARGS((void));
+void intro_message __ARGS((int colon));
+void ex_intro __ARGS((exarg_T *eap));
+/* vim: set ft=c : */
diff --git a/src/proto/window.pro b/src/proto/window.pro
new file mode 100644
index 000000000..243bd7bf6
--- /dev/null
+++ b/src/proto/window.pro
@@ -0,0 +1,44 @@
+/* window.c */
+void do_window __ARGS((int nchar, long Prenum, int xchar));
+int win_split __ARGS((int size, int flags));
+int win_valid __ARGS((win_T *win));
+int win_count __ARGS((void));
+int make_windows __ARGS((int count, int vertical));
+void win_move_after __ARGS((win_T *win1, win_T *win2));
+void win_equal __ARGS((win_T *next_curwin, int current, int dir));
+void close_windows __ARGS((buf_T *buf));
+void win_close __ARGS((win_T *win, int free_buf));
+void close_others __ARGS((int message, int forceit));
+void win_init __ARGS((win_T *wp));
+void win_alloc_first __ARGS((void));
+void win_goto __ARGS((win_T *wp));
+win_T *win_find_nr __ARGS((int winnr));
+void win_enter __ARGS((win_T *wp, int undo_sync));
+win_T *buf_jump_open_win __ARGS((buf_T *buf));
+int win_alloc_lines __ARGS((win_T *wp));
+void win_free_lsize __ARGS((win_T *wp));
+void shell_new_rows __ARGS((void));
+void shell_new_columns __ARGS((void));
+void win_size_save __ARGS((garray_T *gap));
+void win_size_restore __ARGS((garray_T *gap));
+void win_setheight __ARGS((int height));
+void win_setheight_win __ARGS((int height, win_T *win));
+void win_setwidth __ARGS((int width));
+void win_setwidth_win __ARGS((int width, win_T *wp));
+void win_setminheight __ARGS((void));
+void win_drag_status_line __ARGS((win_T *dragwin, int offset));
+void win_drag_vsep_line __ARGS((win_T *dragwin, int offset));
+void win_comp_scroll __ARGS((win_T *wp));
+void command_height __ARGS((long old_p_ch));
+void last_status __ARGS((int morewin));
+char_u *file_name_at_cursor __ARGS((int options, long count));
+char_u *file_name_in_line __ARGS((char_u *line, int col, int options, long count, char_u *rel_fname));
+char_u *find_file_name_in_path __ARGS((char_u *ptr, int len, int options, long count, char_u *rel_fname));
+int path_with_url __ARGS((char_u *fname));
+int vim_isAbsName __ARGS((char_u *name));
+int vim_FullName __ARGS((char_u *fname, char_u *buf, int len, int force));
+int min_rows __ARGS((void));
+int only_one_window __ARGS((void));
+void check_lnums __ARGS((int do_curwin));
+int win_hasvertsplit __ARGS((void));
+/* vim: set ft=c : */
diff --git a/src/proto/workshop.pro b/src/proto/workshop.pro
new file mode 100644
index 000000000..13a105065
--- /dev/null
+++ b/src/proto/workshop.pro
@@ -0,0 +1,48 @@
+/* workshop.c */
+void workshop_init __ARGS((void));
+void workshop_postinit __ARGS((void));
+void ex_wsverb __ARGS((exarg_T *eap));
+char *workshop_get_editor_name __ARGS((void));
+char *workshop_get_editor_version __ARGS((void));
+void workshop_load_file __ARGS((char *filename, int line, char *frameid));
+void workshop_reload_file __ARGS((char *filename, int line));
+void workshop_show_file __ARGS((char *filename));
+void workshop_goto_line __ARGS((char *filename, int lineno));
+void workshop_front_file __ARGS((char *filename));
+void workshop_save_file __ARGS((char *filename));
+void workshop_save_files __ARGS((void));
+void workshop_quit __ARGS((void));
+void workshop_minimize __ARGS((void));
+void workshop_maximize __ARGS((void));
+void workshop_add_mark_type __ARGS((int idx, char *colorspec, char *sign));
+void workshop_set_mark __ARGS((char *filename, int lineno, int markId, int idx));
+void workshop_change_mark_type __ARGS((char *filename, int markId, int idx));
+void workshop_goto_mark __ARGS((char *filename, int markId, char *message));
+void workshop_delete_mark __ARGS((char *filename, int markId));
+int workshop_get_mark_lineno __ARGS((char *filename, int markId));
+void workshop_moved_marks __ARGS((char *filename));
+int workshop_get_font_height __ARGS((void));
+void workshop_footer_message __ARGS((char *message, int severity));
+void workshop_menu_begin __ARGS((char *label));
+void workshop_submenu_begin __ARGS((char *label));
+void workshop_submenu_end __ARGS((void));
+void workshop_menu_item __ARGS((char *label, char *verb, char *accelerator, char *acceleratorText, char *name, char *filepos, char *sensitive));
+void workshop_menu_end __ARGS((void));
+void workshop_toolbar_begin __ARGS((void));
+void workshop_toolbar_end __ARGS((void));
+void workshop_toolbar_button __ARGS((char *label, char *verb, char *senseVerb, char *filepos, char *help, char *sense, char *file, char *left));
+void workshop_frame_sensitivities __ARGS((VerbSense *vs));
+void workshop_set_option __ARGS((char *option, char *value));
+void workshop_balloon_mode __ARGS((Boolean on));
+void workshop_balloon_delay __ARGS((int delay));
+void workshop_show_balloon_tip __ARGS((char *tip));
+void workshop_hotkeys __ARGS((Boolean on));
+int workshop_get_positions __ARGS((void *clientData, char **filename, int *curLine, int *curCol, int *selStartLine, int *selStartCol, int *selEndLine, int *selEndCol, int *selLength, char **selection));
+char *workshop_test_getcurrentfile __ARGS((void));
+int workshop_test_getcursorrow __ARGS((void));
+int workshop_test_getcursorcol __ARGS((void));
+char *workshop_test_getcursorrowtext __ARGS((void));
+char *workshop_test_getselectedtext __ARGS((void));
+void workshop_save_sensitivity __ARGS((char *filename));
+void findYourself __ARGS((char *argv0));
+/* vim: set ft=c : */
diff --git a/src/pty.c b/src/pty.c
new file mode 100644
index 000000000..c28d78e43
--- /dev/null
+++ b/src/pty.c
@@ -0,0 +1,425 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * The stuff in this file mostly comes from the "screen" program.
+ * Included with permission from Juergen Weigert.
+ * Copied from "pty.c". "putenv.c" was used for putenv() in misc2.c.
+ *
+ * It has been modified to work better with Vim.
+ * The parts that are not used in Vim have been deleted.
+ * See the "screen" sources for the complete stuff.
+ */
+
+/* Copyright (c) 1993
+ * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
+ * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
+ * Copyright (c) 1987 Oliver Laumann
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING); if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* RCS_ID("$Id$ FAU") */
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include <signal.h>
+
+#ifdef __CYGWIN32__
+# include <sys/termios.h>
+#endif
+
+#if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
+#if HAVE_STROPTS_H
+#include <sys/types.h>
+#ifdef sinix
+#define buf_T __system_buf_t__
+#endif
+#include <stropts.h>
+#ifdef sinix
+#undef buf_T
+#endif
+# ifdef sun
+# include <sys/conf.h>
+# endif
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_TERMIO_H
+# include <termio.h>
+#else
+# if HAVE_TERMIOS_H
+# include <termios.h>
+# endif
+#endif
+
+#if HAVE_SYS_STREAM_H
+# include <sys/stream.h>
+#endif
+
+#if HAVE_SYS_PTEM_H
+# include <sys/ptem.h>
+#endif
+
+#if !defined(sun) && !defined(VMS) && !defined(MACOS)
+# include <sys/ioctl.h>
+#endif
+
+#if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
+# include <sys/ttold.h>
+#endif
+
+#ifdef ISC
+# include <sys/tty.h>
+# include <sys/sioctl.h>
+# include <sys/pty.h>
+#endif
+
+#ifdef sgi
+# include <sys/sysmacros.h>
+#endif
+
+#if defined(_INCLUDE_HPUX_SOURCE) && !defined(hpux)
+# define hpux
+#endif
+
+/*
+ * if no PTYRANGE[01] is in the config file, we pick a default
+ */
+#ifndef PTYRANGE0
+# define PTYRANGE0 "qprs"
+#endif
+#ifndef PTYRANGE1
+# define PTYRANGE1 "0123456789abcdef"
+#endif
+
+/* SVR4 pseudo ttys don't seem to work with SCO-5 */
+#ifdef M_UNIX
+# undef HAVE_SVR4_PTYS
+#endif
+
+static void initmaster __ARGS((int));
+
+/*
+ * Open all ptys with O_NOCTTY, just to be on the safe side
+ * (RISCos mips breaks otherwise)
+ */
+#ifndef O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
+ static void
+initmaster(f)
+ int f;
+{
+#ifndef VMS
+# ifdef POSIX
+ tcflush(f, TCIOFLUSH);
+# else
+# ifdef TIOCFLUSH
+ (void)ioctl(f, TIOCFLUSH, (char *) 0);
+# endif
+# endif
+# ifdef LOCKPTY
+ (void)ioctl(f, TIOCEXCL, (char *) 0);
+# endif
+#endif
+}
+
+/*
+ * This causes a hang on some systems, but is required for a properly working
+ * pty on others. Needs to be tuned...
+ */
+ int
+SetupSlavePTY(fd)
+ int fd;
+{
+ if (fd < 0)
+ return 0;
+#if defined(I_PUSH) && defined(HAVE_SVR4_PTYS) && !defined(sgi) && !defined(linux) && !defined(__osf__) && !defined(M_UNIX)
+# if defined(HAVE_SYS_PTEM_H) || defined(hpux)
+ if (ioctl(fd, I_PUSH, "ptem") != 0)
+ return -1;
+# endif
+ if (ioctl(fd, I_PUSH, "ldterm") != 0)
+ return -1;
+# ifdef sun
+ if (ioctl(fd, I_PUSH, "ttcompat") != 0)
+ return -1;
+# endif
+#endif
+ return 0;
+}
+
+
+#if defined(OSX) && !defined(PTY_DONE)
+#define PTY_DONE
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ int f;
+ static char TtyName[32];
+
+ if ((f = open_controlling_pty(TtyName)) < 0)
+ return -1;
+ initmaster(f);
+ *ttyn = TtyName;
+ return f;
+}
+#endif
+
+#if (defined(sequent) || defined(_SEQUENT_)) && defined(HAVE_GETPSEUDOTTY) \
+ && !defined(PTY_DONE)
+#define PTY_DONE
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ char *m, *s;
+ int f;
+ /* used for opening a new pty-pair: */
+ static char PtyName[32];
+ static char TtyName[32];
+
+ if ((f = getpseudotty(&s, &m)) < 0)
+ return -1;
+#ifdef _SEQUENT_
+ fvhangup(s);
+#endif
+ strncpy(PtyName, m, sizeof(PtyName));
+ strncpy(TtyName, s, sizeof(TtyName));
+ initmaster(f);
+ *ttyn = TtyName;
+ return f;
+}
+#endif
+
+#if defined(__sgi) && !defined(PTY_DONE)
+#define PTY_DONE
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ int f;
+ char *name;
+ RETSIGTYPE (*sigcld)__ARGS(SIGPROTOARG);
+
+ /*
+ * SIGCHLD set to SIG_DFL for _getpty() because it may fork() and
+ * exec() /usr/adm/mkpts
+ */
+ sigcld = signal(SIGCHLD, SIG_DFL);
+ name = _getpty(&f, O_RDWR | O_NONBLOCK | O_EXTRA, 0600, 0);
+ signal(SIGCHLD, sigcld);
+
+ if (name == 0)
+ return -1;
+ initmaster(f);
+ *ttyn = name;
+ return f;
+}
+#endif
+
+#if defined(MIPS) && defined(HAVE_DEV_PTC) && !defined(PTY_DONE)
+#define PTY_DONE
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ int f;
+ struct stat buf;
+ /* used for opening a new pty-pair: */
+ static char TtyName[32];
+
+ if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_NONBLOCK | O_EXTRA, 0)) < 0)
+ return -1;
+ if (mch_fstat(f, &buf) < 0)
+ {
+ close(f);
+ return -1;
+ }
+ sprintf(TtyName, "/dev/ttyq%d", minor(buf.st_rdev));
+ initmaster(f);
+ *ttyn = TtyName;
+ return f;
+}
+#endif
+
+#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux)
+
+/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! */
+#define PTY_DONE
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ int f;
+ char *m, *ptsname();
+ int unlockpt __ARGS((int)), grantpt __ARGS((int));
+ RETSIGTYPE (*sigcld)__ARGS(SIGPROTOARG);
+ /* used for opening a new pty-pair: */
+ static char TtyName[32];
+
+ if ((f = open("/dev/ptmx", O_RDWR | O_NOCTTY | O_EXTRA, 0)) == -1)
+ return -1;
+
+ /*
+ * SIGCHLD set to SIG_DFL for grantpt() because it fork()s and
+ * exec()s pt_chmod
+ */
+ sigcld = signal(SIGCHLD, SIG_DFL);
+ if ((m = ptsname(f)) == NULL || grantpt(f) || unlockpt(f))
+ {
+ signal(SIGCHLD, sigcld);
+ close(f);
+ return -1;
+ }
+ signal(SIGCHLD, sigcld);
+ strncpy(TtyName, m, sizeof(TtyName));
+ initmaster(f);
+ *ttyn = TtyName;
+ return f;
+}
+#endif
+
+#if defined(_AIX) && defined(HAVE_DEV_PTC) && !defined(PTY_DONE)
+#define PTY_DONE
+
+#ifdef _IBMR2
+int aixhack = -1;
+#endif
+
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ int f;
+ /* used for opening a new pty-pair: */
+ static char TtyName[32];
+
+ /* a dumb looking loop replaced by mycrofts code: */
+ if ((f = open("/dev/ptc", O_RDWR | O_NOCTTY | O_EXTRA)) < 0)
+ return -1;
+ strncpy(TtyName, ttyname(f), sizeof(TtyName));
+ if (geteuid() && mch_access(TtyName, R_OK | W_OK))
+ {
+ close(f);
+ return -1;
+ }
+ initmaster(f);
+# ifdef _IBMR2
+ if (aixhack >= 0)
+ close(aixhack);
+ if ((aixhack = open(TtyName, O_RDWR | O_NOCTTY | O_EXTRA, 0)) < 0)
+ {
+ close(f);
+ return -1;
+ }
+# endif
+ *ttyn = TtyName;
+ return f;
+}
+#endif
+
+#ifndef PTY_DONE
+
+# ifdef hpux
+static char PtyProto[] = "/dev/ptym/ptyXY";
+static char TtyProto[] = "/dev/pty/ttyXY";
+# else
+# ifdef __BEOS__
+static char PtyProto[] = "/dev/pt/XY";
+static char TtyProto[] = "/dev/tt/XY";
+# else
+static char PtyProto[] = "/dev/ptyXY";
+static char TtyProto[] = "/dev/ttyXY";
+# endif
+# endif
+
+ int
+OpenPTY(ttyn)
+ char **ttyn;
+{
+ char *p, *q, *l, *d;
+ int f;
+ /* used for opening a new pty-pair: */
+ static char PtyName[32];
+ static char TtyName[32];
+
+ strcpy(PtyName, PtyProto);
+ strcpy(TtyName, TtyProto);
+ for (p = PtyName; *p != 'X'; p++)
+ ;
+ for (q = TtyName; *q != 'X'; q++)
+ ;
+ for (l = PTYRANGE0; (*p = *l) != '\0'; l++)
+ {
+ for (d = PTYRANGE1; (p[1] = *d) != '\0'; d++)
+ {
+#if !defined(MACOS) || defined(USE_CARBONIZED)
+ if ((f = open(PtyName, O_RDWR | O_NOCTTY | O_EXTRA, 0)) == -1)
+#else
+ if ((f = open(PtyName, O_RDWR | O_NOCTTY | O_EXTRA)) == -1)
+#endif
+ continue;
+ q[0] = *l;
+ q[1] = *d;
+#ifndef MACOS
+ if (geteuid() && mch_access(TtyName, R_OK | W_OK))
+ {
+ close(f);
+ continue;
+ }
+#endif
+#if defined(sun) && defined(TIOCGPGRP) && !defined(SUNOS3)
+ /* Hack to ensure that the slave side of the pty is
+ * unused. May not work in anything other than SunOS4.1
+ */
+ {
+ int pgrp;
+
+ /* tcgetpgrp does not work (uses TIOCGETPGRP)! */
+ if (ioctl(f, TIOCGPGRP, (char *)&pgrp) != -1 || errno != EIO)
+ {
+ close(f);
+ continue;
+ }
+ }
+#endif
+ initmaster(f);
+ *ttyn = TtyName;
+ return f;
+ }
+ }
+ return -1;
+}
+#endif
diff --git a/src/quickfix.c b/src/quickfix.c
new file mode 100644
index 000000000..5dbbc1b53
--- /dev/null
+++ b/src/quickfix.c
@@ -0,0 +1,2232 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * quickfix.c: functions for quickfix mode, using a file with error messages
+ */
+
+#include "vim.h"
+
+#if defined(FEAT_QUICKFIX) || defined(PROTO)
+
+struct dir_stack_T
+{
+ struct dir_stack_T *next;
+ char_u *dirname;
+};
+
+static struct dir_stack_T *dir_stack = NULL;
+
+/*
+ * for each error the next struct is allocated and linked in a list
+ */
+struct qf_line
+{
+ struct qf_line *qf_next; /* pointer to next error in the list */
+ struct qf_line *qf_prev; /* pointer to previous error in the list */
+ linenr_T qf_lnum; /* line number where the error occurred */
+ int qf_fnum; /* file number for the line */
+ int qf_col; /* column where the error occurred */
+ int qf_nr; /* error number */
+ char_u *qf_text; /* description of the error */
+ char_u qf_virt_col; /* set to TRUE if qf_col is screen column */
+ char_u qf_cleared;/* set to TRUE if line has been deleted */
+ char_u qf_type; /* type of the error (mostly 'E'); 1 for
+ :helpgrep */
+ char_u qf_valid; /* valid error message detected */
+};
+
+/*
+ * There is a stack of error lists.
+ */
+#define LISTCOUNT 10
+
+struct qf_list
+{
+ struct qf_line *qf_start; /* pointer to the first error */
+ struct qf_line *qf_ptr; /* pointer to the current error */
+ int qf_count; /* number of errors (0 means no error list) */
+ int qf_index; /* current index in the error list */
+ int qf_nonevalid; /* TRUE if not a single valid entry found */
+} qf_lists[LISTCOUNT];
+
+static int qf_curlist = 0; /* current error list */
+static int qf_listcount = 0; /* current number of lists */
+
+#define FMT_PATTERNS 9 /* maximum number of % recognized */
+
+/*
+ * Structure used to hold the info of one part of 'errorformat'
+ */
+struct eformat
+{
+ regprog_T *prog; /* pre-formatted part of 'errorformat' */
+ struct eformat *next; /* pointer to next (NULL if last) */
+ char_u addr[FMT_PATTERNS]; /* indices of used % patterns */
+ char_u prefix; /* prefix of this format line: */
+ /* 'D' enter directory */
+ /* 'X' leave directory */
+ /* 'A' start of multi-line message */
+ /* 'E' error message */
+ /* 'W' warning message */
+ /* 'I' informational message */
+ /* 'C' continuation line */
+ /* 'Z' end of multi-line message */
+ /* 'G' general, unspecific message */
+ /* 'P' push file (partial) message */
+ /* 'Q' pop/quit file (partial) message */
+ /* 'O' overread (partial) message */
+ char_u flags; /* additional flags given in prefix */
+ /* '-' do not include this line */
+};
+
+static void qf_new_list __ARGS((void));
+static int qf_add_entry __ARGS((struct qf_line **prevp, char_u *dir, char_u *fname, char_u *mesg, long lnum, int col, int virt_col, int nr, int type, int valid));
+static void qf_msg __ARGS((void));
+static void qf_free __ARGS((int idx));
+static char_u *qf_types __ARGS((int, int));
+static int qf_get_fnum __ARGS((char_u *, char_u *));
+static char_u *qf_push_dir __ARGS((char_u *, struct dir_stack_T **));
+static char_u *qf_pop_dir __ARGS((struct dir_stack_T **));
+static char_u *qf_guess_filepath __ARGS((char_u *));
+static void qf_fmt_text __ARGS((char_u *text, char_u *buf, int bufsize));
+static void qf_clean_dir_stack __ARGS((struct dir_stack_T **));
+#ifdef FEAT_WINDOWS
+static int qf_win_pos_update __ARGS((int old_qf_index));
+static buf_T *qf_find_buf __ARGS((void));
+static void qf_update_buffer __ARGS((void));
+static void qf_fill_buffer __ARGS((void));
+#endif
+static char_u *get_mef_name __ARGS((void));
+
+/*
+ * Read the errorfile into memory, line by line, building the error list.
+ * Return -1 for error, number of errors for success.
+ */
+ int
+qf_init(efile, errorformat, newlist)
+ char_u *efile;
+ char_u *errorformat;
+ int newlist; /* TRUE: start a new error list */
+{
+ char_u *namebuf;
+ char_u *errmsg;
+ char_u *fmtstr = NULL;
+ int col = 0;
+ char_u use_virt_col = FALSE;
+ int type = 0;
+ int valid;
+ long lnum = 0L;
+ int enr = 0;
+ FILE *fd;
+ struct qf_line *qfprev = NULL; /* init to make SASC shut up */
+ char_u *efmp;
+ struct eformat *fmt_first = NULL;
+ struct eformat *fmt_last = NULL;
+ struct eformat *fmt_ptr;
+ char_u *efm;
+ char_u *ptr;
+ char_u *srcptr;
+ int len;
+ int i;
+ int round;
+ int idx = 0;
+ int multiline = FALSE;
+ int multiignore = FALSE;
+ int multiscan = FALSE;
+ int retval = -1; /* default: return error flag */
+ char_u *directory = NULL;
+ char_u *currfile = NULL;
+ char_u *tail = NULL;
+ struct dir_stack_T *file_stack = NULL;
+ regmatch_T regmatch;
+ static struct fmtpattern
+ {
+ char_u convchar;
+ char *pattern;
+ } fmt_pat[FMT_PATTERNS] =
+ {
+ {'f', "\\f\\+"},
+ {'n', "\\d\\+"},
+ {'l', "\\d\\+"},
+ {'c', "\\d\\+"},
+ {'t', "."},
+ {'m', ".\\+"},
+ {'r', ".*"},
+ {'p', "[- .]*"},
+ {'v', "\\d\\+"}
+ };
+
+ if (efile == NULL)
+ return FAIL;
+
+ namebuf = alloc(CMDBUFFSIZE + 1);
+ errmsg = alloc(CMDBUFFSIZE + 1);
+ if (namebuf == NULL || errmsg == NULL)
+ goto qf_init_end;
+
+ if ((fd = mch_fopen((char *)efile, "r")) == NULL)
+ {
+ EMSG2(_(e_openerrf), efile);
+ goto qf_init_end;
+ }
+
+ if (newlist || qf_curlist == qf_listcount)
+ /* make place for a new list */
+ qf_new_list();
+ else if (qf_lists[qf_curlist].qf_count > 0)
+ /* Adding to existing list, find last entry. */
+ for (qfprev = qf_lists[qf_curlist].qf_start;
+ qfprev->qf_next != qfprev; qfprev = qfprev->qf_next)
+ ;
+
+/*
+ * Each part of the format string is copied and modified from errorformat to
+ * regex prog. Only a few % characters are allowed.
+ */
+ /* Use the local value of 'errorformat' if it's set. */
+ if (errorformat == p_efm && *curbuf->b_p_efm != NUL)
+ efm = curbuf->b_p_efm;
+ else
+ efm = errorformat;
+ /*
+ * Get some space to modify the format string into.
+ */
+ i = (FMT_PATTERNS * 3) + ((int)STRLEN(efm) << 2);
+ for (round = FMT_PATTERNS; round > 0; )
+ i += (int)STRLEN(fmt_pat[--round].pattern);
+#ifdef COLON_IN_FILENAME
+ i += 12; /* "%f" can become twelve chars longer */
+#else
+ i += 2; /* "%f" can become two chars longer */
+#endif
+ if ((fmtstr = alloc(i)) == NULL)
+ goto error2;
+
+ while (efm[0])
+ {
+ /*
+ * Allocate a new eformat structure and put it at the end of the list
+ */
+ fmt_ptr = (struct eformat *)alloc((unsigned)sizeof(struct eformat));
+ if (fmt_ptr == NULL)
+ goto error2;
+ if (fmt_first == NULL) /* first one */
+ fmt_first = fmt_ptr;
+ else
+ fmt_last->next = fmt_ptr;
+ fmt_last = fmt_ptr;
+ fmt_ptr->prefix = NUL;
+ fmt_ptr->flags = NUL;
+ fmt_ptr->next = NULL;
+ fmt_ptr->prog = NULL;
+ for (round = FMT_PATTERNS; round > 0; )
+ fmt_ptr->addr[--round] = NUL;
+ /* round is 0 now */
+
+ /*
+ * Isolate one part in the 'errorformat' option
+ */
+ for (len = 0; efm[len] != NUL && efm[len] != ','; ++len)
+ if (efm[len] == '\\' && efm[len + 1] != NUL)
+ ++len;
+
+ /*
+ * Build regexp pattern from current 'errorformat' option
+ */
+ ptr = fmtstr;
+ *ptr++ = '^';
+ for (efmp = efm; efmp < efm + len; ++efmp)
+ {
+ if (*efmp == '%')
+ {
+ ++efmp;
+ for (idx = 0; idx < FMT_PATTERNS; ++idx)
+ if (fmt_pat[idx].convchar == *efmp)
+ break;
+ if (idx < FMT_PATTERNS)
+ {
+ if (fmt_ptr->addr[idx])
+ {
+ sprintf((char *)errmsg,
+ _("E372: Too many %%%c in format string"), *efmp);
+ EMSG(errmsg);
+ goto error2;
+ }
+ if ((idx
+ && idx < 6
+ && vim_strchr((char_u *)"DXOPQ",
+ fmt_ptr->prefix) != NULL)
+ || (idx == 6
+ && vim_strchr((char_u *)"OPQ",
+ fmt_ptr->prefix) == NULL))
+ {
+ sprintf((char *)errmsg,
+ _("E373: Unexpected %%%c in format string"), *efmp);
+ EMSG(errmsg);
+ goto error2;
+ }
+ fmt_ptr->addr[idx] = (char_u)++round;
+ *ptr++ = '\\';
+ *ptr++ = '(';
+#ifdef BACKSLASH_IN_FILENAME
+ if (*efmp == 'f')
+ {
+ /* Also match "c:" in the file name, even when
+ * checking for a colon next: "%f:".
+ * "\%(\a:\)\=" */
+ STRCPY(ptr, "\\%(\\a:\\)\\=");
+ ptr += 10;
+ }
+#endif
+ if (*efmp == 'f' && efmp[1] != NUL
+ && efmp[1] != '\\' && efmp[1] != '%')
+ {
+ /* A file name may contain spaces, but this isn't in
+ * "\f". use "[^x]\+" instead (x is next character) */
+ *ptr++ = '[';
+ *ptr++ = '^';
+ *ptr++ = efmp[1];
+ *ptr++ = ']';
+ *ptr++ = '\\';
+ *ptr++ = '+';
+ }
+ else
+ {
+ srcptr = (char_u *)fmt_pat[idx].pattern;
+ while ((*ptr = *srcptr++) != NUL)
+ ++ptr;
+ }
+ *ptr++ = '\\';
+ *ptr++ = ')';
+ }
+ else if (*efmp == '*')
+ {
+ if (*++efmp == '[' || *efmp == '\\')
+ {
+ if ((*ptr++ = *efmp) == '[') /* %*[^a-z0-9] etc. */
+ {
+ if (efmp[1] == '^')
+ *ptr++ = *++efmp;
+ if (efmp < efm + len)
+ {
+ *ptr++ = *++efmp; /* could be ']' */
+ while (efmp < efm + len
+ && (*ptr++ = *++efmp) != ']')
+ /* skip */;
+ if (efmp == efm + len)
+ {
+ EMSG(_("E374: Missing ] in format string"));
+ goto error2;
+ }
+ }
+ }
+ else if (efmp < efm + len) /* %*\D, %*\s etc. */
+ *ptr++ = *++efmp;
+ *ptr++ = '\\';
+ *ptr++ = '+';
+ }
+ else
+ {
+ /* TODO: scanf()-like: %*ud, %*3c, %*f, ... ? */
+ sprintf((char *)errmsg,
+ _("E375: Unsupported %%%c in format string"), *efmp);
+ EMSG(errmsg);
+ goto error2;
+ }
+ }
+ else if (vim_strchr((char_u *)"%\\.^$~[", *efmp) != NULL)
+ *ptr++ = *efmp; /* regexp magic characters */
+ else if (*efmp == '#')
+ *ptr++ = '*';
+ else if (efmp == efm + 1) /* analyse prefix */
+ {
+ if (vim_strchr((char_u *)"+-", *efmp) != NULL)
+ fmt_ptr->flags = *efmp++;
+ if (vim_strchr((char_u *)"DXAEWICZGOPQ", *efmp) != NULL)
+ fmt_ptr->prefix = *efmp;
+ else
+ {
+ sprintf((char *)errmsg,
+ _("E376: Invalid %%%c in format string prefix"), *efmp);
+ EMSG(errmsg);
+ goto error2;
+ }
+ }
+ else
+ {
+ sprintf((char *)errmsg,
+ _("E377: Invalid %%%c in format string"), *efmp);
+ EMSG(errmsg);
+ goto error2;
+ }
+ }
+ else /* copy normal character */
+ {
+ if (*efmp == '\\' && efmp + 1 < efm + len)
+ ++efmp;
+ else if (vim_strchr((char_u *)".*^$~[", *efmp) != NULL)
+ *ptr++ = '\\'; /* escape regexp atoms */
+ if (*efmp)
+ *ptr++ = *efmp;
+ }
+ }
+ *ptr++ = '$';
+ *ptr = NUL;
+ if ((fmt_ptr->prog = vim_regcomp(fmtstr, RE_MAGIC + RE_STRING)) == NULL)
+ goto error2;
+ /*
+ * Advance to next part
+ */
+ efm = skip_to_option_part(efm + len); /* skip comma and spaces */
+ }
+ if (fmt_first == NULL) /* nothing found */
+ {
+ EMSG(_("E378: 'errorformat' contains no pattern"));
+ goto error2;
+ }
+
+ /*
+ * got_int is reset here, because it was probably set when killing the
+ * ":make" command, but we still want to read the errorfile then.
+ */
+ got_int = FALSE;
+
+ /* Always ignore case when looking for a matching error. */
+ regmatch.rm_ic = TRUE;
+
+ /*
+ * Read the lines in the error file one by one.
+ * Try to recognize one of the error formats in each line.
+ */
+ while (fgets((char *)IObuff, CMDBUFFSIZE - 2, fd) != NULL && !got_int)
+ {
+ IObuff[CMDBUFFSIZE - 2] = NUL; /* for very long lines */
+ if ((efmp = vim_strrchr(IObuff, '\n')) != NULL)
+ *efmp = NUL;
+#ifdef USE_CRNL
+ if ((efmp = vim_strrchr(IObuff, '\r')) != NULL)
+ *efmp = NUL;
+#endif
+
+ /*
+ * Try to match each part of 'errorformat' until we find a complete
+ * match or no match.
+ */
+ valid = TRUE;
+restofline:
+ for (fmt_ptr = fmt_first; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next)
+ {
+ idx = fmt_ptr->prefix;
+ if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
+ continue;
+ namebuf[0] = NUL;
+ if (!multiscan)
+ errmsg[0] = NUL;
+ lnum = 0;
+ col = 0;
+ use_virt_col = FALSE;
+ enr = -1;
+ type = 0;
+ tail = NULL;
+
+ regmatch.regprog = fmt_ptr->prog;
+ if (vim_regexec(&regmatch, IObuff, (colnr_T)0))
+ {
+ if ((idx == 'C' || idx == 'Z') && !multiline)
+ continue;
+ if (vim_strchr((char_u *)"EWI", idx) != NULL)
+ type = idx;
+ else
+ type = 0;
+ /*
+ * Extract error message data from matched line
+ */
+ if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
+ {
+ len = (int)(regmatch.endp[i] - regmatch.startp[i]);
+ STRNCPY(namebuf, regmatch.startp[i], len);
+ namebuf[len] = NUL;
+ if (vim_strchr((char_u *)"OPQ", idx) != NULL
+ && mch_getperm(namebuf) == -1)
+ continue;
+ }
+ if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
+ enr = (int)atol((char *)regmatch.startp[i]);
+ if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
+ lnum = atol((char *)regmatch.startp[i]);
+ if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
+ col = (int)atol((char *)regmatch.startp[i]);
+ if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
+ type = *regmatch.startp[i];
+ if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
+ STRCPY(errmsg, IObuff);
+ else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
+ {
+ len = (int)(regmatch.endp[i] - regmatch.startp[i]);
+ STRNCPY(errmsg, regmatch.startp[i], len);
+ errmsg[len] = NUL;
+ }
+ if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
+ tail = regmatch.startp[i];
+ if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
+ {
+ col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
+ if (*((char_u *)regmatch.startp[i]) != TAB)
+ use_virt_col = TRUE;
+ }
+ if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
+ {
+ col = (int)atol((char *)regmatch.startp[i]);
+ use_virt_col = TRUE;
+ }
+ break;
+ }
+ }
+ multiscan = FALSE;
+ if (!fmt_ptr || idx == 'D' || idx == 'X')
+ {
+ if (fmt_ptr)
+ {
+ if (idx == 'D') /* enter directory */
+ {
+ if (*namebuf == NUL)
+ {
+ EMSG(_("E379: Missing or empty directory name"));
+ goto error2;
+ }
+ if ((directory = qf_push_dir(namebuf, &dir_stack)) == NULL)
+ goto error2;
+ }
+ else if (idx == 'X') /* leave directory */
+ directory = qf_pop_dir(&dir_stack);
+ }
+ namebuf[0] = NUL; /* no match found, remove file name */
+ lnum = 0; /* don't jump to this line */
+ valid = FALSE;
+ STRCPY(errmsg, IObuff); /* copy whole line to error message */
+ if (!fmt_ptr)
+ multiline = multiignore = FALSE;
+ }
+ else if (fmt_ptr)
+ {
+ if (vim_strchr((char_u *)"AEWI", idx) != NULL)
+ multiline = TRUE; /* start of a multi-line message */
+ else if (vim_strchr((char_u *)"CZ", idx) != NULL)
+ { /* continuation of multi-line msg */
+ if (qfprev == NULL)
+ goto error2;
+ if (*errmsg && !multiignore)
+ {
+ len = (int)STRLEN(qfprev->qf_text);
+ if ((ptr = alloc((unsigned)(len + STRLEN(errmsg) + 2)))
+ == NULL)
+ goto error2;
+ STRCPY(ptr, qfprev->qf_text);
+ vim_free(qfprev->qf_text);
+ qfprev->qf_text = ptr;
+ *(ptr += len) = '\n';
+ STRCPY(++ptr, errmsg);
+ }
+ if (qfprev->qf_nr == -1)
+ qfprev->qf_nr = enr;
+ if (vim_isprintc(type) && !qfprev->qf_type)
+ qfprev->qf_type = type; /* only printable chars allowed */
+ if (!qfprev->qf_lnum)
+ qfprev->qf_lnum = lnum;
+ if (!qfprev->qf_col)
+ qfprev->qf_col = col;
+ qfprev->qf_virt_col = use_virt_col;
+ if (!qfprev->qf_fnum)
+ qfprev->qf_fnum = qf_get_fnum(directory,
+ *namebuf || directory ? namebuf
+ : currfile && valid ? currfile : 0);
+ if (idx == 'Z')
+ multiline = multiignore = FALSE;
+ line_breakcheck();
+ continue;
+ }
+ else if (vim_strchr((char_u *)"OPQ", idx) != NULL)
+ {
+ /* global file names */
+ valid = FALSE;
+ if (*namebuf == NUL || mch_getperm(namebuf) >= 0)
+ {
+ if (*namebuf && idx == 'P')
+ currfile = qf_push_dir(namebuf, &file_stack);
+ else if (idx == 'Q')
+ currfile = qf_pop_dir(&file_stack);
+ *namebuf = NUL;
+ if (tail && *tail)
+ {
+ STRCPY(IObuff, skipwhite(tail));
+ multiscan = TRUE;
+ goto restofline;
+ }
+ }
+ }
+ if (fmt_ptr->flags == '-') /* generally exclude this line */
+ {
+ if (multiline)
+ multiignore = TRUE; /* also exclude continuation lines */
+ continue;
+ }
+ }
+
+ if (qf_add_entry(&qfprev,
+ directory,
+ *namebuf || directory
+ ? namebuf
+ : currfile && valid ? currfile : NULL,
+ errmsg,
+ lnum,
+ col,
+ use_virt_col,
+ enr,
+ type,
+ valid) == FAIL)
+ goto error2;
+ line_breakcheck();
+ }
+ if (!ferror(fd))
+ {
+ if (qf_lists[qf_curlist].qf_index == 0) /* no valid entry found */
+ {
+ qf_lists[qf_curlist].qf_ptr = qf_lists[qf_curlist].qf_start;
+ qf_lists[qf_curlist].qf_index = 1;
+ qf_lists[qf_curlist].qf_nonevalid = TRUE;
+ }
+ else
+ {
+ qf_lists[qf_curlist].qf_nonevalid = FALSE;
+ if (qf_lists[qf_curlist].qf_ptr == NULL)
+ qf_lists[qf_curlist].qf_ptr = qf_lists[qf_curlist].qf_start;
+ }
+ retval = qf_lists[qf_curlist].qf_count; /* return number of matches */
+ goto qf_init_ok;
+ }
+ EMSG(_(e_readerrf));
+error2:
+ qf_free(qf_curlist);
+ qf_listcount--;
+ if (qf_curlist > 0)
+ --qf_curlist;
+qf_init_ok:
+ fclose(fd);
+ for (fmt_ptr = fmt_first; fmt_ptr != NULL; fmt_ptr = fmt_first)
+ {
+ fmt_first = fmt_ptr->next;
+ vim_free(fmt_ptr->prog);
+ vim_free(fmt_ptr);
+ }
+ qf_clean_dir_stack(&dir_stack);
+ qf_clean_dir_stack(&file_stack);
+qf_init_end:
+ vim_free(namebuf);
+ vim_free(errmsg);
+ vim_free(fmtstr);
+
+#ifdef FEAT_WINDOWS
+ qf_update_buffer();
+#endif
+
+ return retval;
+}
+
+/*
+ * Prepare for adding a new quickfix list.
+ */
+ static void
+qf_new_list()
+{
+ int i;
+
+ /*
+ * If the current entry is not the last entry, delete entries below
+ * the current entry. This makes it possible to browse in a tree-like
+ * way with ":grep'.
+ */
+ while (qf_listcount > qf_curlist + 1)
+ qf_free(--qf_listcount);
+
+ /*
+ * When the stack is full, remove to oldest entry
+ * Otherwise, add a new entry.
+ */
+ if (qf_listcount == LISTCOUNT)
+ {
+ qf_free(0);
+ for (i = 1; i < LISTCOUNT; ++i)
+ qf_lists[i - 1] = qf_lists[i];
+ qf_curlist = LISTCOUNT - 1;
+ }
+ else
+ qf_curlist = qf_listcount++;
+ qf_lists[qf_curlist].qf_index = 0;
+ qf_lists[qf_curlist].qf_count = 0;
+}
+
+/*
+ * Add an entry to the end of the list of errors.
+ * Returns OK or FAIL.
+ */
+ static int
+qf_add_entry(prevp, dir, fname, mesg, lnum, col, virt_col, nr, type, valid)
+ struct qf_line **prevp; /* pointer to previously added entry or NULL */
+ char_u *dir; /* optional directory name */
+ char_u *fname; /* file name or NULL */
+ char_u *mesg; /* message */
+ long lnum; /* line number */
+ int col; /* column */
+ int virt_col; /* using virtual column */
+ int nr; /* error number */
+ int type; /* type character */
+ int valid; /* valid entry */
+{
+ struct qf_line *qfp;
+
+ if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line)))
+ == NULL)
+ return FAIL;
+ qfp->qf_fnum = qf_get_fnum(dir, fname);
+ if ((qfp->qf_text = vim_strsave(mesg)) == NULL)
+ {
+ vim_free(qfp);
+ return FAIL;
+ }
+ qfp->qf_lnum = lnum;
+ qfp->qf_col = col;
+ qfp->qf_virt_col = virt_col;
+ qfp->qf_nr = nr;
+ if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */
+ type = 0;
+ qfp->qf_type = type;
+ qfp->qf_valid = valid;
+
+ if (qf_lists[qf_curlist].qf_count == 0) /* first element in the list */
+ {
+ qf_lists[qf_curlist].qf_start = qfp;
+ qfp->qf_prev = qfp; /* first element points to itself */
+ }
+ else
+ {
+ qfp->qf_prev = *prevp;
+ (*prevp)->qf_next = qfp;
+ }
+ qfp->qf_next = qfp; /* last element points to itself */
+ qfp->qf_cleared = FALSE;
+ *prevp = qfp;
+ ++qf_lists[qf_curlist].qf_count;
+ if (qf_lists[qf_curlist].qf_index == 0 && qfp->qf_valid)
+ /* first valid entry */
+ {
+ qf_lists[qf_curlist].qf_index = qf_lists[qf_curlist].qf_count;
+ qf_lists[qf_curlist].qf_ptr = qfp;
+ }
+
+ return OK;
+}
+
+/*
+ * get buffer number for file "dir.name"
+ */
+ static int
+qf_get_fnum(directory, fname)
+ char_u *directory;
+ char_u *fname;
+{
+ if (fname == NULL || *fname == NUL) /* no file name */
+ return 0;
+ {
+#ifdef RISCOS
+ /* Name is reported as `main.c', but file is `c.main' */
+ return ro_buflist_add(fname);
+#else
+ char_u *ptr;
+ int fnum;
+
+# ifdef VMS
+ vms_remove_version(fname);
+# endif
+# ifdef BACKSLASH_IN_FILENAME
+ if (directory != NULL)
+ slash_adjust(directory);
+ slash_adjust(fname);
+# endif
+ if (directory != NULL && !vim_isAbsName(fname)
+ && (ptr = concat_fnames(directory, fname, TRUE)) != NULL)
+ {
+ /*
+ * Here we check if the file really exists.
+ * This should normally be true, but if make works without
+ * "leaving directory"-messages we might have missed a
+ * directory change.
+ */
+ if (mch_getperm(ptr) < 0)
+ {
+ vim_free(ptr);
+ directory = qf_guess_filepath(fname);
+ if (directory)
+ ptr = concat_fnames(directory, fname, TRUE);
+ else
+ ptr = vim_strsave(fname);
+ }
+ /* Use concatenated directory name and file name */
+ fnum = buflist_add(ptr, 0);
+ vim_free(ptr);
+ return fnum;
+ }
+ return buflist_add(fname, 0);
+#endif
+ }
+}
+
+/*
+ * push dirbuf onto the directory stack and return pointer to actual dir or
+ * NULL on error
+ */
+ static char_u *
+qf_push_dir(dirbuf, stackptr)
+ char_u *dirbuf;
+ struct dir_stack_T **stackptr;
+{
+ struct dir_stack_T *ds_new;
+ struct dir_stack_T *ds_ptr;
+
+ /* allocate new stack element and hook it in */
+ ds_new = (struct dir_stack_T *)alloc((unsigned)sizeof(struct dir_stack_T));
+ if (ds_new == NULL)
+ return NULL;
+
+ ds_new->next = *stackptr;
+ *stackptr = ds_new;
+
+ /* store directory on the stack */
+ if (vim_isAbsName(dirbuf)
+ || (*stackptr)->next == NULL
+ || (*stackptr && dir_stack != *stackptr))
+ (*stackptr)->dirname = vim_strsave(dirbuf);
+ else
+ {
+ /* Okay we don't have an absolute path.
+ * dirbuf must be a subdir of one of the directories on the stack.
+ * Let's search...
+ */
+ ds_new = (*stackptr)->next;
+ (*stackptr)->dirname = NULL;
+ while (ds_new)
+ {
+ vim_free((*stackptr)->dirname);
+ (*stackptr)->dirname = concat_fnames(ds_new->dirname, dirbuf,
+ TRUE);
+ if (mch_isdir((*stackptr)->dirname) == TRUE)
+ break;
+
+ ds_new = ds_new->next;
+ }
+
+ /* clean up all dirs we already left */
+ while ((*stackptr)->next != ds_new)
+ {
+ ds_ptr = (*stackptr)->next;
+ (*stackptr)->next = (*stackptr)->next->next;
+ vim_free(ds_ptr->dirname);
+ vim_free(ds_ptr);
+ }
+
+ /* Nothing found -> it must be on top level */
+ if (ds_new == NULL)
+ {
+ vim_free((*stackptr)->dirname);
+ (*stackptr)->dirname = vim_strsave(dirbuf);
+ }
+ }
+
+ if ((*stackptr)->dirname != NULL)
+ return (*stackptr)->dirname;
+ else
+ {
+ ds_ptr = *stackptr;
+ *stackptr = (*stackptr)->next;
+ vim_free(ds_ptr);
+ return NULL;
+ }
+}
+
+
+/*
+ * pop dirbuf from the directory stack and return previous directory or NULL if
+ * stack is empty
+ */
+ static char_u *
+qf_pop_dir(stackptr)
+ struct dir_stack_T **stackptr;
+{
+ struct dir_stack_T *ds_ptr;
+
+ /* TODO: Should we check if dirbuf is the directory on top of the stack?
+ * What to do if it isn't? */
+
+ /* pop top element and free it */
+ if (*stackptr != NULL)
+ {
+ ds_ptr = *stackptr;
+ *stackptr = (*stackptr)->next;
+ vim_free(ds_ptr->dirname);
+ vim_free(ds_ptr);
+ }
+
+ /* return NEW top element as current dir or NULL if stack is empty*/
+ return *stackptr ? (*stackptr)->dirname : NULL;
+}
+
+/*
+ * clean up directory stack
+ */
+ static void
+qf_clean_dir_stack(stackptr)
+ struct dir_stack_T **stackptr;
+{
+ struct dir_stack_T *ds_ptr;
+
+ while ((ds_ptr = *stackptr) != NULL)
+ {
+ *stackptr = (*stackptr)->next;
+ vim_free(ds_ptr->dirname);
+ vim_free(ds_ptr);
+ }
+}
+
+/*
+ * Check in which directory of the directory stack the given file can be
+ * found.
+ * Returns a pointer to the directory name or NULL if not found
+ * Cleans up intermediate directory entries.
+ *
+ * TODO: How to solve the following problem?
+ * If we have the this directory tree:
+ * ./
+ * ./aa
+ * ./aa/bb
+ * ./bb
+ * ./bb/x.c
+ * and make says:
+ * making all in aa
+ * making all in bb
+ * x.c:9: Error
+ * Then qf_push_dir thinks we are in ./aa/bb, but we are in ./bb.
+ * qf_guess_filepath will return NULL.
+ */
+ static char_u *
+qf_guess_filepath(filename)
+ char_u *filename;
+{
+ struct dir_stack_T *ds_ptr;
+ struct dir_stack_T *ds_tmp;
+ char_u *fullname;
+
+ /* no dirs on the stack - there's nothing we can do */
+ if (dir_stack == NULL)
+ return NULL;
+
+ ds_ptr = dir_stack->next;
+ fullname = NULL;
+ while (ds_ptr)
+ {
+ vim_free(fullname);
+ fullname = concat_fnames(ds_ptr->dirname, filename, TRUE);
+
+ /* If concat_fnames failed, just go on. The worst thing that can happen
+ * is that we delete the entire stack.
+ */
+ if ((fullname != NULL) && (mch_getperm(fullname) >= 0))
+ break;
+
+ ds_ptr = ds_ptr->next;
+ }
+
+ vim_free(fullname);
+
+ /* clean up all dirs we already left */
+ while (dir_stack->next != ds_ptr)
+ {
+ ds_tmp = dir_stack->next;
+ dir_stack->next = dir_stack->next->next;
+ vim_free(ds_tmp->dirname);
+ vim_free(ds_tmp);
+ }
+
+ return ds_ptr==NULL? NULL: ds_ptr->dirname;
+
+}
+
+/*
+ * jump to a quickfix line
+ * if dir == FORWARD go "errornr" valid entries forward
+ * if dir == BACKWARD go "errornr" valid entries backward
+ * if dir == FORWARD_FILE go "errornr" valid entries files backward
+ * if dir == BACKWARD_FILE go "errornr" valid entries files backward
+ * else if "errornr" is zero, redisplay the same line
+ * else go to entry "errornr"
+ */
+ void
+qf_jump(dir, errornr, forceit)
+ int dir;
+ int errornr;
+ int forceit;
+{
+ struct qf_line *qf_ptr;
+ struct qf_line *old_qf_ptr;
+ int qf_index;
+ int old_qf_fnum;
+ int old_qf_index;
+ int prev_index;
+ static char_u *e_no_more_items = (char_u *)N_("E553: No more items");
+ char_u *err = e_no_more_items;
+ linenr_T i;
+ buf_T *old_curbuf;
+ linenr_T old_lnum;
+ char_u *old_swb = p_swb;
+ colnr_T screen_col;
+ colnr_T char_col;
+ char_u *line;
+#ifdef FEAT_WINDOWS
+ int opened_window = FALSE;
+ win_T *win;
+ win_T *altwin;
+#endif
+ int print_message = TRUE;
+ int len;
+#ifdef FEAT_FOLDING
+ int old_KeyTyped = KeyTyped; /* getting file may reset it */
+#endif
+
+ if (qf_curlist >= qf_listcount || qf_lists[qf_curlist].qf_count == 0)
+ {
+ EMSG(_(e_quickfix));
+ return;
+ }
+
+ qf_ptr = qf_lists[qf_curlist].qf_ptr;
+ old_qf_ptr = qf_ptr;
+ qf_index = qf_lists[qf_curlist].qf_index;
+ old_qf_index = qf_index;
+ if (dir == FORWARD || dir == FORWARD_FILE) /* next valid entry */
+ {
+ while (errornr--)
+ {
+ old_qf_ptr = qf_ptr;
+ prev_index = qf_index;
+ old_qf_fnum = qf_ptr->qf_fnum;
+ do
+ {
+ if (qf_index == qf_lists[qf_curlist].qf_count
+ || qf_ptr->qf_next == NULL)
+ {
+ qf_ptr = old_qf_ptr;
+ qf_index = prev_index;
+ if (err != NULL)
+ {
+ EMSG(_(err));
+ goto theend;
+ }
+ errornr = 0;
+ break;
+ }
+ ++qf_index;
+ qf_ptr = qf_ptr->qf_next;
+ } while ((!qf_lists[qf_curlist].qf_nonevalid && !qf_ptr->qf_valid)
+ || (dir == FORWARD_FILE && qf_ptr->qf_fnum == old_qf_fnum));
+ err = NULL;
+ }
+ }
+ else if (dir == BACKWARD || dir == BACKWARD_FILE) /* prev. valid entry */
+ {
+ while (errornr--)
+ {
+ old_qf_ptr = qf_ptr;
+ prev_index = qf_index;
+ old_qf_fnum = qf_ptr->qf_fnum;
+ do
+ {
+ if (qf_index == 1 || qf_ptr->qf_prev == NULL)
+ {
+ qf_ptr = old_qf_ptr;
+ qf_index = prev_index;
+ if (err != NULL)
+ {
+ EMSG(_(err));
+ goto theend;
+ }
+ errornr = 0;
+ break;
+ }
+ --qf_index;
+ qf_ptr = qf_ptr->qf_prev;
+ } while ((!qf_lists[qf_curlist].qf_nonevalid && !qf_ptr->qf_valid)
+ || (dir == BACKWARD_FILE && qf_ptr->qf_fnum == old_qf_fnum));
+ err = NULL;
+ }
+ }
+ else if (errornr != 0) /* go to specified number */
+ {
+ while (errornr < qf_index && qf_index > 1 && qf_ptr->qf_prev != NULL)
+ {
+ --qf_index;
+ qf_ptr = qf_ptr->qf_prev;
+ }
+ while (errornr > qf_index && qf_index < qf_lists[qf_curlist].qf_count
+ && qf_ptr->qf_next != NULL)
+ {
+ ++qf_index;
+ qf_ptr = qf_ptr->qf_next;
+ }
+ }
+
+#ifdef FEAT_WINDOWS
+ qf_lists[qf_curlist].qf_index = qf_index;
+ if (qf_win_pos_update(old_qf_index))
+ /* No need to print the error message if it's visible in the error
+ * window */
+ print_message = FALSE;
+
+ /*
+ * If currently in the quickfix window, find another window to show the
+ * file in.
+ */
+ if (bt_quickfix(curbuf))
+ {
+ /*
+ * If there is no file specified, we don't know where to go.
+ * But do advance, otherwise ":cn" gets stuck.
+ */
+ if (qf_ptr->qf_fnum == 0)
+ goto theend;
+
+ /*
+ * If there is only one window, create a new one above the quickfix
+ * window.
+ */
+ if (firstwin == lastwin)
+ {
+ if (win_split(0, WSP_ABOVE) == FAIL)
+ goto failed; /* not enough room for window */
+ opened_window = TRUE; /* close it when fail */
+ p_swb = empty_option; /* don't split again */
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ }
+ else
+ {
+ /*
+ * Try to find a window that shows the right buffer.
+ * Default to the window just above the quickfix buffer.
+ */
+ win = curwin;
+ altwin = NULL;
+ for (;;)
+ {
+ if (win->w_buffer->b_fnum == qf_ptr->qf_fnum)
+ break;
+ if (win->w_prev == NULL)
+ win = lastwin; /* wrap around the top */
+ else
+ win = win->w_prev; /* go to previous window */
+
+ if (bt_quickfix(win->w_buffer))
+ {
+ /* Didn't find it, go to the window before the quickfix
+ * window. */
+ if (altwin != NULL)
+ win = altwin;
+ else if (curwin->w_prev != NULL)
+ win = curwin->w_prev;
+ else
+ win = curwin->w_next;
+ break;
+ }
+
+ /* Remember a usable window. */
+ if (altwin == NULL && !win->w_p_pvw
+ && win->w_buffer->b_p_bt[0] == NUL)
+ altwin = win;
+ }
+
+ win_goto(win);
+ }
+ }
+#endif
+
+ /*
+ * If there is a file name,
+ * read the wanted file if needed, and check autowrite etc.
+ */
+ old_curbuf = curbuf;
+ old_lnum = curwin->w_cursor.lnum;
+ if (qf_ptr->qf_fnum == 0 || buflist_getfile(qf_ptr->qf_fnum,
+ (linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit) == OK)
+ {
+ /* When not switched to another buffer, still need to set pc mark */
+ if (curbuf == old_curbuf)
+ setpcmark();
+
+ /*
+ * Go to line with error, unless qf_lnum is 0.
+ */
+ i = qf_ptr->qf_lnum;
+ if (i > 0)
+ {
+ if (i > curbuf->b_ml.ml_line_count)
+ i = curbuf->b_ml.ml_line_count;
+ curwin->w_cursor.lnum = i;
+ }
+ if (qf_ptr->qf_col > 0)
+ {
+ curwin->w_cursor.col = qf_ptr->qf_col - 1;
+ if (qf_ptr->qf_virt_col == TRUE)
+ {
+ /*
+ * Check each character from the beginning of the error
+ * line up to the error column. For each tab character
+ * found, reduce the error column value by the length of
+ * a tab character.
+ */
+ line = ml_get_curline();
+ screen_col = 0;
+ for (char_col = 0; char_col < curwin->w_cursor.col; ++char_col)
+ {
+ if (*line == NUL)
+ break;
+ if (*line++ == '\t')
+ {
+ curwin->w_cursor.col -= 7 - (screen_col % 8);
+ screen_col += 8 - (screen_col % 8);
+ }
+ else
+ ++screen_col;
+ }
+ }
+ check_cursor();
+ }
+ else
+ beginline(BL_WHITE | BL_FIX);
+
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_QUICKFIX) && old_KeyTyped)
+ foldOpenCursor();
+#endif
+ if (print_message)
+ {
+ /* Update the screen before showing the message */
+ update_topline_redraw();
+ sprintf((char *)IObuff, _("(%d of %d)%s%s: "), qf_index,
+ qf_lists[qf_curlist].qf_count,
+ qf_ptr->qf_cleared ? _(" (line deleted)") : "",
+ (char *)qf_types(qf_ptr->qf_type, qf_ptr->qf_nr));
+ /* Add the message, skipping leading whitespace and newlines. */
+ len = (int)STRLEN(IObuff);
+ qf_fmt_text(skipwhite(qf_ptr->qf_text), IObuff + len, IOSIZE - len);
+
+ /* Output the message. Overwrite to avoid scrolling when the 'O'
+ * flag is present in 'shortmess'; But when not jumping, print the
+ * whole message. */
+ i = msg_scroll;
+ if (curbuf == old_curbuf && curwin->w_cursor.lnum == old_lnum)
+ msg_scroll = TRUE;
+ else if (!msg_scrolled && shortmess(SHM_OVERALL))
+ msg_scroll = FALSE;
+ msg_attr_keep(IObuff, 0, TRUE);
+ msg_scroll = i;
+ }
+ }
+ else
+ {
+#ifdef FEAT_WINDOWS
+ if (opened_window)
+ win_close(curwin, TRUE); /* Close opened window */
+#endif
+ if (qf_ptr->qf_fnum != 0)
+ {
+ /*
+ * Couldn't open file, so put index back where it was. This could
+ * happen if the file was readonly and we changed something.
+ */
+#ifdef FEAT_WINDOWS
+failed:
+#endif
+ qf_ptr = old_qf_ptr;
+ qf_index = old_qf_index;
+ }
+ }
+theend:
+ qf_lists[qf_curlist].qf_ptr = qf_ptr;
+ qf_lists[qf_curlist].qf_index = qf_index;
+#ifdef FEAT_WINDOWS
+ if (p_swb != old_swb && opened_window)
+ {
+ /* Restore old 'switchbuf' value, but not when an autocommand or
+ * modeline has changed the value. */
+ if (p_swb == empty_option)
+ p_swb = old_swb;
+ else
+ free_string_option(old_swb);
+ }
+#endif
+}
+
+/*
+ * ":clist": list all errors
+ */
+ void
+qf_list(eap)
+ exarg_T *eap;
+{
+ buf_T *buf;
+ char_u *fname;
+ struct qf_line *qfp;
+ int i;
+ int idx1 = 1;
+ int idx2 = -1;
+ int need_return = TRUE;
+ int last_printed = 1;
+ char_u *arg = eap->arg;
+ int all = eap->forceit; /* if not :cl!, only show
+ recognised errors */
+
+ if (qf_curlist >= qf_listcount || qf_lists[qf_curlist].qf_count == 0)
+ {
+ EMSG(_(e_quickfix));
+ return;
+ }
+ if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL)
+ {
+ EMSG(_(e_trailing));
+ return;
+ }
+ i = qf_lists[qf_curlist].qf_count;
+ if (idx1 < 0)
+ idx1 = (-idx1 > i) ? 0 : idx1 + i + 1;
+ if (idx2 < 0)
+ idx2 = (-idx2 > i) ? 0 : idx2 + i + 1;
+
+ more_back_used = TRUE;
+ if (qf_lists[qf_curlist].qf_nonevalid)
+ all = TRUE;
+ qfp = qf_lists[qf_curlist].qf_start;
+ for (i = 1; !got_int && i <= qf_lists[qf_curlist].qf_count; )
+ {
+ if ((qfp->qf_valid || all) && idx1 <= i && i <= idx2)
+ {
+ if (need_return)
+ {
+ msg_putchar('\n');
+ need_return = FALSE;
+ }
+ if (more_back == 0)
+ {
+ fname = NULL;
+ if (qfp->qf_fnum != 0
+ && (buf = buflist_findnr(qfp->qf_fnum)) != NULL)
+ {
+ fname = buf->b_fname;
+ if (qfp->qf_type == 1) /* :helpgrep */
+ fname = gettail(fname);
+ }
+ if (fname == NULL)
+ sprintf((char *)IObuff, "%2d", i);
+ else
+ sprintf((char *)IObuff, "%2d %s", i, (char *)fname);
+ msg_outtrans_attr(IObuff, i == qf_lists[qf_curlist].qf_index
+ ? hl_attr(HLF_L) : hl_attr(HLF_D));
+ if (qfp->qf_lnum == 0)
+ IObuff[0] = NUL;
+ else if (qfp->qf_col == 0)
+ sprintf((char *)IObuff, ":%ld", qfp->qf_lnum);
+ else
+ sprintf((char *)IObuff, ":%ld col %d",
+ qfp->qf_lnum, qfp->qf_col);
+ sprintf((char *)IObuff + STRLEN(IObuff), "%s: ",
+ (char *)qf_types(qfp->qf_type, qfp->qf_nr));
+ msg_puts_attr(IObuff, hl_attr(HLF_N));
+ /* Remove newlines and leading whitespace from the text.
+ * For an unrecognized line keep the indent, the compiler may
+ * mark a word with ^^^^. */
+ qf_fmt_text((fname != NULL || qfp->qf_lnum != 0)
+ ? skipwhite(qfp->qf_text) : qfp->qf_text,
+ IObuff, IOSIZE);
+ msg_prt_line(IObuff);
+ out_flush(); /* show one line at a time */
+ need_return = TRUE;
+ last_printed = i;
+ }
+ }
+ if (more_back)
+ {
+ /* scrolling backwards from the more-prompt */
+ /* TODO: compute the number of items from the screen lines */
+ more_back = more_back * 2 - 1;
+ while (i > last_printed - more_back && i > idx1)
+ {
+ do
+ {
+ qfp = qfp->qf_prev;
+ --i;
+ }
+ while (i > idx1 && !qfp->qf_valid && !all);
+ }
+ more_back = 0;
+ }
+ else
+ {
+ qfp = qfp->qf_next;
+ ++i;
+ }
+ ui_breakcheck();
+ }
+ more_back_used = FALSE;
+}
+
+/*
+ * Remove newlines and leading whitespace from an error message.
+ * Put the result in "buf[bufsize]".
+ */
+ static void
+qf_fmt_text(text, buf, bufsize)
+ char_u *text;
+ char_u *buf;
+ int bufsize;
+{
+ int i;
+ char_u *p = text;
+
+ for (i = 0; *p != NUL && i < bufsize - 1; ++i)
+ {
+ if (*p == '\n')
+ {
+ buf[i] = ' ';
+ while (*++p != NUL)
+ if (!vim_iswhite(*p) && *p != '\n')
+ break;
+ }
+ else
+ buf[i] = *p++;
+ }
+ buf[i] = NUL;
+}
+
+/*
+ * ":colder [count]": Up in the quickfix stack.
+ * ":cnewer [count]": Down in the quickfix stack.
+ */
+ void
+qf_age(eap)
+ exarg_T *eap;
+{
+ int count;
+
+ if (eap->addr_count != 0)
+ count = eap->line2;
+ else
+ count = 1;
+ while (count--)
+ {
+ if (eap->cmdidx == CMD_colder)
+ {
+ if (qf_curlist == 0)
+ {
+ EMSG(_("E380: At bottom of quickfix stack"));
+ return;
+ }
+ --qf_curlist;
+ }
+ else
+ {
+ if (qf_curlist >= qf_listcount - 1)
+ {
+ EMSG(_("E381: At top of quickfix stack"));
+ return;
+ }
+ ++qf_curlist;
+ }
+ }
+ qf_msg();
+}
+
+ static void
+qf_msg()
+{
+ smsg((char_u *)_("error list %d of %d; %d errors"),
+ qf_curlist + 1, qf_listcount, qf_lists[qf_curlist].qf_count);
+#ifdef FEAT_WINDOWS
+ qf_update_buffer();
+#endif
+}
+
+/*
+ * free the error list
+ */
+ static void
+qf_free(idx)
+ int idx;
+{
+ struct qf_line *qfp;
+
+ while (qf_lists[idx].qf_count)
+ {
+ qfp = qf_lists[idx].qf_start->qf_next;
+ vim_free(qf_lists[idx].qf_start->qf_text);
+ vim_free(qf_lists[idx].qf_start);
+ qf_lists[idx].qf_start = qfp;
+ --qf_lists[idx].qf_count;
+ }
+}
+
+/*
+ * qf_mark_adjust: adjust marks
+ */
+ void
+qf_mark_adjust(line1, line2, amount, amount_after)
+ linenr_T line1;
+ linenr_T line2;
+ long amount;
+ long amount_after;
+{
+ int i;
+ struct qf_line *qfp;
+ int idx;
+
+ for (idx = 0; idx < qf_listcount; ++idx)
+ if (qf_lists[idx].qf_count)
+ for (i = 0, qfp = qf_lists[idx].qf_start;
+ i < qf_lists[idx].qf_count; ++i, qfp = qfp->qf_next)
+ if (qfp->qf_fnum == curbuf->b_fnum)
+ {
+ if (qfp->qf_lnum >= line1 && qfp->qf_lnum <= line2)
+ {
+ if (amount == MAXLNUM)
+ qfp->qf_cleared = TRUE;
+ else
+ qfp->qf_lnum += amount;
+ }
+ else if (amount_after && qfp->qf_lnum > line2)
+ qfp->qf_lnum += amount_after;
+ }
+}
+
+/*
+ * Make a nice message out of the error character and the error number:
+ * char number message
+ * e or E 0 " error"
+ * w or W 0 " warning"
+ * i or I 0 " info"
+ * 0 0 ""
+ * other 0 " c"
+ * e or E n " error n"
+ * w or W n " warning n"
+ * i or I n " info n"
+ * 0 n " error n"
+ * other n " c n"
+ * 1 x "" :helpgrep
+ */
+ static char_u *
+qf_types(c, nr)
+ int c, nr;
+{
+ static char_u buf[20];
+ static char_u cc[3];
+ char_u *p;
+
+ if (c == 'W' || c == 'w')
+ p = (char_u *)" warning";
+ else if (c == 'I' || c == 'i')
+ p = (char_u *)" info";
+ else if (c == 'E' || c == 'e' || (c == 0 && nr > 0))
+ p = (char_u *)" error";
+ else if (c == 0 || c == 1)
+ p = (char_u *)"";
+ else
+ {
+ cc[0] = ' ';
+ cc[1] = c;
+ cc[2] = NUL;
+ p = cc;
+ }
+
+ if (nr <= 0)
+ return p;
+
+ sprintf((char *)buf, "%s %3d", (char *)p, nr);
+ return buf;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * ":cwindow": open the quickfix window if we have errors to display,
+ * close it if not.
+ */
+ void
+ex_cwindow(eap)
+ exarg_T *eap;
+{
+ win_T *win;
+
+ /*
+ * Look for an existing quickfix window.
+ */
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (bt_quickfix(win->w_buffer))
+ break;
+
+ /*
+ * If a quickfix window is open but we have no errors to display,
+ * close the window. If a quickfix window is not open, then open
+ * it if we have errors; otherwise, leave it closed.
+ */
+ if (qf_lists[qf_curlist].qf_nonevalid || qf_curlist >= qf_listcount)
+ {
+ if (win != NULL)
+ ex_cclose(eap);
+ }
+ else if (win == NULL)
+ ex_copen(eap);
+}
+
+/*
+ * ":cclose": close the window showing the list of errors.
+ */
+/*ARGSUSED*/
+ void
+ex_cclose(eap)
+ exarg_T *eap;
+{
+ win_T *win;
+
+ /*
+ * Find existing quickfix window and close it.
+ */
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (bt_quickfix(win->w_buffer))
+ break;
+
+ if (win != NULL)
+ win_close(win, FALSE);
+}
+
+/*
+ * ":copen": open a window that shows the list of errors.
+ */
+ void
+ex_copen(eap)
+ exarg_T *eap;
+{
+ int height;
+ buf_T *buf;
+ win_T *win;
+
+ if (eap->addr_count != 0)
+ height = eap->line2;
+ else
+ height = QF_WINHEIGHT;
+
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /*
+ * Find existing quickfix window, or open a new one.
+ */
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (bt_quickfix(win->w_buffer))
+ break;
+ if (win != NULL)
+ win_goto(win);
+ else
+ {
+ /* The current window becomes the previous window afterwards. */
+ win = curwin;
+
+ /* Create the new window at the very bottom. */
+ win_goto(lastwin);
+ if (win_split(height, WSP_BELOW) == FAIL)
+ return; /* not enough room for window */
+#ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+#endif
+
+ /*
+ * Find existing quickfix buffer, or create a new one.
+ */
+ buf = qf_find_buf();
+ if (buf == NULL)
+ {
+ (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
+ /* switch off 'swapfile' */
+ set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
+ set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
+ OPT_LOCAL);
+ set_option_value((char_u *)"bh", 0L, (char_u *)"delete", OPT_LOCAL);
+ set_option_value((char_u *)"diff", 0L, (char_u *)"", OPT_LOCAL);
+ }
+ else if (buf != curbuf)
+ set_curbuf(buf, DOBUF_GOTO);
+
+ /* Only set the height when there is no window to the side. */
+ if (curwin->w_width == Columns)
+ win_setheight(height);
+ curwin->w_p_wfh = TRUE; /* set 'winfixheight' */
+ if (win_valid(win))
+ prevwin = win;
+ }
+
+ /*
+ * Fill the buffer with the quickfix list.
+ */
+ qf_fill_buffer();
+
+ curwin->w_cursor.lnum = qf_lists[qf_curlist].qf_index;
+ curwin->w_cursor.col = 0;
+ check_cursor();
+ update_topline(); /* scroll to show the line */
+}
+
+/*
+ * Return the number of the current entry (line number in the quickfix
+ * window).
+ */
+ linenr_T
+qf_current_entry()
+{
+ return qf_lists[qf_curlist].qf_index;
+}
+
+/*
+ * Update the cursor position in the quickfix window to the current error.
+ * Return TRUE if there is a quickfix window.
+ */
+ static int
+qf_win_pos_update(old_qf_index)
+ int old_qf_index; /* previous qf_index or zero */
+{
+ win_T *win;
+ int qf_index = qf_lists[qf_curlist].qf_index;
+
+ /*
+ * Put the cursor on the current error in the quickfix window, so that
+ * it's viewable.
+ */
+ for (win = firstwin; win != NULL; win = win->w_next)
+ if (bt_quickfix(win->w_buffer))
+ break;
+ if (win != NULL
+ && qf_index <= win->w_buffer->b_ml.ml_line_count
+ && old_qf_index != qf_index)
+ {
+ win_T *old_curwin = curwin;
+
+ curwin = win;
+ curbuf = win->w_buffer;
+ if (qf_index > old_qf_index)
+ {
+ curwin->w_redraw_top = old_qf_index;
+ curwin->w_redraw_bot = qf_index;
+ }
+ else
+ {
+ curwin->w_redraw_top = qf_index;
+ curwin->w_redraw_bot = old_qf_index;
+ }
+ curwin->w_cursor.lnum = qf_index;
+ curwin->w_cursor.col = 0;
+ update_topline(); /* scroll to show the line */
+ redraw_later(VALID);
+ curwin->w_redr_status = TRUE; /* update ruler */
+ curwin = old_curwin;
+ curbuf = curwin->w_buffer;
+ }
+ return win != NULL;
+}
+
+/*
+ * Find quickfix buffer.
+ */
+ static buf_T *
+qf_find_buf()
+{
+ buf_T *buf;
+
+ for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ if (bt_quickfix(buf))
+ break;
+ return buf;
+}
+
+/*
+ * Find the quickfix buffer. If it exists, update the contents.
+ */
+ static void
+qf_update_buffer()
+{
+ buf_T *buf;
+#ifdef FEAT_AUTOCMD
+ aco_save_T aco;
+#else
+ buf_T *save_curbuf;
+#endif
+
+ /* Check if a buffer for the quickfix list exists. Update it. */
+ buf = qf_find_buf();
+ if (buf != NULL)
+ {
+#ifdef FEAT_AUTOCMD
+ /* set curwin/curbuf to buf and save a few things */
+ aucmd_prepbuf(&aco, buf);
+#else
+ save_curbuf = curbuf;
+ curbuf = buf;
+#endif
+
+ qf_fill_buffer();
+
+#ifdef FEAT_AUTOCMD
+ /* restore curwin/curbuf and a few other things */
+ aucmd_restbuf(&aco);
+#else
+ curbuf = save_curbuf;
+#endif
+
+ (void)qf_win_pos_update(0);
+ }
+}
+
+/*
+ * Fill current buffer with quickfix errors, replacing any previous contents.
+ * curbuf must be the quickfix buffer!
+ */
+ static void
+qf_fill_buffer()
+{
+ linenr_T lnum;
+ struct qf_line *qfp;
+ buf_T *errbuf;
+ int len;
+ int old_KeyTyped = KeyTyped;
+
+ /* delete all existing lines */
+ while ((curbuf->b_ml.ml_flags & ML_EMPTY) == 0)
+ (void)ml_delete((linenr_T)1, FALSE);
+
+ /* Check if there is anything to display */
+ if (qf_curlist < qf_listcount)
+ {
+ /* Add one line for each error */
+ qfp = qf_lists[qf_curlist].qf_start;
+ for (lnum = 0; lnum < qf_lists[qf_curlist].qf_count; ++lnum)
+ {
+ if (qfp->qf_fnum != 0
+ && (errbuf = buflist_findnr(qfp->qf_fnum)) != NULL
+ && errbuf->b_fname != NULL)
+ {
+ if (qfp->qf_type == 1) /* :helpgrep */
+ STRCPY(IObuff, gettail(errbuf->b_fname));
+ else
+ STRCPY(IObuff, errbuf->b_fname);
+ len = (int)STRLEN(IObuff);
+ }
+ else
+ len = 0;
+ IObuff[len++] = '|';
+
+ if (qfp->qf_lnum > 0)
+ {
+ sprintf((char *)IObuff + len, "%ld", qfp->qf_lnum);
+ len += (int)STRLEN(IObuff + len);
+
+ if (qfp->qf_col > 0)
+ {
+ sprintf((char *)IObuff + len, " col %d", qfp->qf_col);
+ len += (int)STRLEN(IObuff + len);
+ }
+
+ sprintf((char *)IObuff + len, "%s",
+ (char *)qf_types(qfp->qf_type, qfp->qf_nr));
+ len += (int)STRLEN(IObuff + len);
+ }
+ IObuff[len++] = '|';
+ IObuff[len++] = ' ';
+
+ /* Remove newlines and leading whitespace from the text.
+ * For an unrecognized line keep the indent, the compiler may
+ * mark a word with ^^^^. */
+ qf_fmt_text(len > 3 ? skipwhite(qfp->qf_text) : qfp->qf_text,
+ IObuff + len, IOSIZE - len);
+
+ if (ml_append(lnum, IObuff, (colnr_T)STRLEN(IObuff) + 1, FALSE)
+ == FAIL)
+ break;
+ qfp = qfp->qf_next;
+ }
+ /* Delete the empty line which is now at the end */
+ (void)ml_delete(lnum + 1, FALSE);
+ }
+
+ /* correct cursor position */
+ check_lnums(TRUE);
+
+ /* Set the 'filetype' to "qf" each time after filling the buffer. This
+ * resembles reading a file into a buffer, it's more logical when using
+ * autocommands. */
+ set_option_value((char_u *)"ft", 0L, (char_u *)"qf", OPT_LOCAL);
+ curbuf->b_p_ma = FALSE;
+
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_BUFREADPOST, (char_u *)"quickfix", NULL,
+ FALSE, curbuf);
+ apply_autocmds(EVENT_BUFWINENTER, (char_u *)"quickfix", NULL,
+ FALSE, curbuf);
+#endif
+
+ /* make sure it will be redrawn */
+ redraw_curbuf_later(NOT_VALID);
+
+ /* Restore KeyTyped, setting 'filetype' may reset it. */
+ KeyTyped = old_KeyTyped;
+}
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * Return TRUE if "buf" is the quickfix buffer.
+ */
+ int
+bt_quickfix(buf)
+ buf_T *buf;
+{
+ return (buf->b_p_bt[0] == 'q');
+}
+
+/*
+ * Return TRUE if "buf" is a "nofile" buffer.
+ */
+ int
+bt_nofile(buf)
+ buf_T *buf;
+{
+ return (buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f');
+}
+
+/*
+ * Return TRUE if "buf" is a "nowrite" or "nofile" buffer.
+ */
+ int
+bt_dontwrite(buf)
+ buf_T *buf;
+{
+ return (buf->b_p_bt[0] == 'n');
+}
+
+ int
+bt_dontwrite_msg(buf)
+ buf_T *buf;
+{
+ if (bt_dontwrite(buf))
+ {
+ EMSG(_("E382: Cannot write, 'buftype' option is set"));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
+ * and 'bufhidden'.
+ */
+ int
+buf_hide(buf)
+ buf_T *buf;
+{
+ /* 'bufhidden' overrules 'hidden' and ":hide", check it first */
+ switch (buf->b_p_bh[0])
+ {
+ case 'u': /* "unload" */
+ case 'w': /* "wipe" */
+ case 'd': return FALSE; /* "delete" */
+ case 'h': return TRUE; /* "hide" */
+ }
+ return (p_hid || cmdmod.hide);
+}
+
+/*
+ * Used for ":make", ":grep" and ":grepadd".
+ */
+ void
+ex_make(eap)
+ exarg_T *eap;
+{
+ char_u *name;
+ char_u *cmd;
+ unsigned len;
+
+ autowrite_all();
+ name = get_mef_name();
+ if (name == NULL)
+ return;
+ mch_remove(name); /* in case it's not unique */
+
+ /*
+ * If 'shellpipe' empty: don't redirect to 'errorfile'.
+ */
+ len = (unsigned)STRLEN(p_shq) * 2 + (unsigned)STRLEN(eap->arg) + 1;
+ if (*p_sp != NUL)
+ len += (unsigned)STRLEN(p_sp) + (unsigned)STRLEN(name) + 3;
+ cmd = alloc(len);
+ if (cmd == NULL)
+ return;
+ sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
+ (char *)p_shq);
+ if (*p_sp != NUL)
+ append_redir(cmd, p_sp, name);
+ /*
+ * Output a newline if there's something else than the :make command that
+ * was typed (in which case the cursor is in column 0).
+ */
+ if (msg_col == 0)
+ msg_didout = FALSE;
+ msg_start();
+ MSG_PUTS(":!");
+ msg_outtrans(cmd); /* show what we are doing */
+
+ /* let the shell know if we are redirecting output or not */
+ do_shell(cmd, *p_sp != NUL ? SHELL_DOOUT : 0);
+
+#ifdef AMIGA
+ out_flush();
+ /* read window status report and redraw before message */
+ (void)char_avail();
+#endif
+
+ if (qf_init(name, eap->cmdidx != CMD_make ? p_gefm : p_efm,
+ eap->cmdidx != CMD_grepadd) > 0
+ && !eap->forceit)
+ qf_jump(0, 0, FALSE); /* display first error */
+
+ mch_remove(name);
+ vim_free(name);
+ vim_free(cmd);
+}
+
+/*
+ * Return the name for the errorfile, in allocated memory.
+ * Find a new unique name when 'makeef' contains "##".
+ * Returns NULL for error.
+ */
+ static char_u *
+get_mef_name()
+{
+ char_u *p;
+ char_u *name;
+ static int start = -1;
+ static int off = 0;
+#ifdef HAVE_LSTAT
+ struct stat sb;
+#endif
+
+ if (*p_mef == NUL)
+ {
+ name = vim_tempname('e');
+ if (name == NULL)
+ EMSG(_(e_notmp));
+ return name;
+ }
+
+ for (p = p_mef; *p; ++p)
+ if (p[0] == '#' && p[1] == '#')
+ break;
+
+ if (*p == NUL)
+ return vim_strsave(p_mef);
+
+ /* Keep trying until the name doesn't exist yet. */
+ for (;;)
+ {
+ if (start == -1)
+ start = mch_get_pid();
+ else
+ off += 19;
+
+ name = alloc((unsigned)STRLEN(p_mef) + 30);
+ if (name == NULL)
+ break;
+ STRCPY(name, p_mef);
+ sprintf((char *)name + (p - p_mef), "%d%d", start, off);
+ STRCAT(name, p + 2);
+ if (mch_getperm(name) < 0
+#ifdef HAVE_LSTAT
+ /* Don't accept a symbolic link, its a security risk. */
+ && mch_lstat((char *)name, &sb) < 0
+#endif
+ )
+ break;
+ vim_free(name);
+ }
+ return name;
+}
+
+/*
+ * ":cc", ":crewind", ":cfirst" and ":clast".
+ */
+ void
+ex_cc(eap)
+ exarg_T *eap;
+{
+ qf_jump(0,
+ eap->addr_count > 0
+ ? (int)eap->line2
+ : eap->cmdidx == CMD_cc
+ ? 0
+ : (eap->cmdidx == CMD_crewind || eap->cmdidx == CMD_cfirst)
+ ? 1
+ : 32767,
+ eap->forceit);
+}
+
+/*
+ * ":cnext", ":cnfile", ":cNext" and ":cprevious".
+ */
+ void
+ex_cnext(eap)
+ exarg_T *eap;
+{
+ qf_jump(eap->cmdidx == CMD_cnext
+ ? FORWARD
+ : eap->cmdidx == CMD_cnfile
+ ? FORWARD_FILE
+ : (eap->cmdidx == CMD_cpfile || eap->cmdidx == CMD_cNfile)
+ ? BACKWARD_FILE
+ : BACKWARD,
+ eap->addr_count > 0 ? (int)eap->line2 : 1, eap->forceit);
+}
+
+/*
+ * ":cfile" command.
+ */
+ void
+ex_cfile(eap)
+ exarg_T *eap;
+{
+ if (*eap->arg != NUL)
+ set_string_option_direct((char_u *)"ef", -1, eap->arg, OPT_FREE);
+ if (qf_init(p_ef, p_efm, TRUE) > 0 && eap->cmdidx == CMD_cfile)
+ qf_jump(0, 0, eap->forceit); /* display first error */
+}
+
+/*
+ * ":helpgrep {pattern}"
+ */
+ void
+ex_helpgrep(eap)
+ exarg_T *eap;
+{
+ regmatch_T regmatch;
+ char_u *save_cpo;
+ char_u *p;
+ int fcount;
+ char_u **fnames;
+ FILE *fd;
+ int fi;
+ struct qf_line *prevp = NULL;
+ long lnum;
+
+ /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"";
+
+ regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
+ regmatch.rm_ic = FALSE;
+ if (regmatch.regprog != NULL)
+ {
+ /* create a new quickfix list */
+ qf_new_list();
+
+ /* Go through all directories in 'runtimepath' */
+ p = p_rtp;
+ while (*p != NUL && !got_int)
+ {
+ copy_option_part(&p, NameBuff, MAXPATHL, ",");
+
+ /* Find all "*.txt" and "*.??x" files in the "doc" directory. */
+ add_pathsep(NameBuff);
+ STRCAT(NameBuff, "doc/*.\\(txt\\|??x\\)");
+ if (gen_expand_wildcards(1, &NameBuff, &fcount,
+ &fnames, EW_FILE|EW_SILENT) == OK
+ && fcount > 0)
+ {
+ for (fi = 0; fi < fcount && !got_int; ++fi)
+ {
+ fd = fopen((char *)fnames[fi], "r");
+ if (fd != NULL)
+ {
+ lnum = 1;
+ while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int)
+ {
+ if (vim_regexec(&regmatch, IObuff, (colnr_T)0))
+ {
+ int l = STRLEN(IObuff);
+
+ /* remove trailing CR, LF, spaces, etc. */
+ while (l > 0 && IObuff[l - 1] <= ' ')
+ IObuff[--l] = NUL;
+
+ if (qf_add_entry(&prevp,
+ NULL, /* dir */
+ fnames[fi],
+ IObuff,
+ lnum,
+ 0, /* col */
+ FALSE, /* virt_col */
+ 0, /* nr */
+ 1, /* type */
+ TRUE /* valid */
+ ) == FAIL)
+ {
+ got_int = TRUE;
+ break;
+ }
+ }
+ ++lnum;
+ line_breakcheck();
+ }
+ fclose(fd);
+ }
+ }
+ FreeWild(fcount, fnames);
+ }
+ }
+ vim_free(regmatch.regprog);
+
+ qf_lists[qf_curlist].qf_nonevalid = FALSE;
+ qf_lists[qf_curlist].qf_ptr = qf_lists[qf_curlist].qf_start;
+ qf_lists[qf_curlist].qf_index = 1;
+ }
+
+ p_cpo = save_cpo;
+
+#ifdef FEAT_WINDOWS
+ qf_update_buffer();
+#endif
+
+ /* Jump to first match. */
+ if (qf_lists[qf_curlist].qf_count > 0)
+ qf_jump(0, 0, FALSE);
+}
+
+#endif /* FEAT_QUICKFIX */
diff --git a/src/regexp.c b/src/regexp.c
new file mode 100644
index 000000000..9715a1ea5
--- /dev/null
+++ b/src/regexp.c
@@ -0,0 +1,6115 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * Handling of regular expressions: vim_regcomp(), vim_regexec(), vim_regsub()
+ *
+ * NOTICE:
+ *
+ * This is NOT the original regular expression code as written by Henry
+ * Spencer. This code has been modified specifically for use with the VIM
+ * editor, and should not be used separately from Vim. If you want a good
+ * regular expression library, get the original code. The copyright notice
+ * that follows is from the original.
+ *
+ * END NOTICE
+ *
+ * Copyright (c) 1986 by University of Toronto.
+ * Written by Henry Spencer. Not derived from licensed software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose on any computer system, and to redistribute it freely,
+ * subject to the following restrictions:
+ *
+ * 1. The author is not responsible for the consequences of use of
+ * this software, no matter how awful, even if they arise
+ * from defects in it.
+ *
+ * 2. The origin of this software must not be misrepresented, either
+ * by explicit claim or by omission.
+ *
+ * 3. Altered versions must be plainly marked as such, and must not
+ * be misrepresented as being the original software.
+ *
+ * Beware that some of this code is subtly aware of the way operator
+ * precedence is structured in regular expressions. Serious changes in
+ * regular-expression syntax might require a total rethink.
+ *
+ * Changes have been made by Tony Andrews, Olaf 'Rhialto' Seibert, Robert Webb
+ * and Bram Moolenaar.
+ * Named character class support added by Walter Briscoe (1998 Jul 01)
+ */
+
+#include "vim.h"
+
+#undef DEBUG
+
+/*
+ * The "internal use only" fields in regexp.h are present to pass info from
+ * compile to execute that permits the execute phase to run lots faster on
+ * simple cases. They are:
+ *
+ * regstart char that must begin a match; NUL if none obvious; Can be a
+ * multi-byte character.
+ * reganch is the match anchored (at beginning-of-line only)?
+ * regmust string (pointer into program) that match must include, or NULL
+ * regmlen length of regmust string
+ * regflags RF_ values or'ed together
+ *
+ * Regstart and reganch permit very fast decisions on suitable starting points
+ * for a match, cutting down the work a lot. Regmust permits fast rejection
+ * of lines that cannot possibly match. The regmust tests are costly enough
+ * that vim_regcomp() supplies a regmust only if the r.e. contains something
+ * potentially expensive (at present, the only such thing detected is * or +
+ * at the start of the r.e., which can involve a lot of backup). Regmlen is
+ * supplied because the test in vim_regexec() needs it and vim_regcomp() is
+ * computing it anyway.
+ */
+
+/*
+ * Structure for regexp "program". This is essentially a linear encoding
+ * of a nondeterministic finite-state machine (aka syntax charts or
+ * "railroad normal form" in parsing technology). Each node is an opcode
+ * plus a "next" pointer, possibly plus an operand. "Next" pointers of
+ * all nodes except BRANCH and BRACES_COMPLEX implement concatenation; a "next"
+ * pointer with a BRANCH on both ends of it is connecting two alternatives.
+ * (Here we have one of the subtle syntax dependencies: an individual BRANCH
+ * (as opposed to a collection of them) is never concatenated with anything
+ * because of operator precedence). The "next" pointer of a BRACES_COMPLEX
+ * node points to the node after the stuff to be repeated. The operand of some
+ * types of node is a literal string; for others, it is a node leading into a
+ * sub-FSM. In particular, the operand of a BRANCH node is the first node of
+ * the branch. (NB this is *not* a tree structure: the tail of the branch
+ * connects to the thing following the set of BRANCHes.)
+ *
+ * pattern is coded like:
+ *
+ * +-----------------+
+ * | V
+ * <aa>\|<bb> BRANCH <aa> BRANCH <bb> --> END
+ * | ^ | ^
+ * +------+ +----------+
+ *
+ *
+ * +------------------+
+ * V |
+ * <aa>* BRANCH BRANCH <aa> --> BACK BRANCH --> NOTHING --> END
+ * | | ^ ^
+ * | +---------------+ |
+ * +---------------------------------------------+
+ *
+ *
+ * +-------------------------+
+ * V |
+ * <aa>\{} BRANCH BRACE_LIMITS --> BRACE_COMPLEX <aa> --> BACK END
+ * | | ^
+ * | +----------------+
+ * +-----------------------------------------------+
+ *
+ *
+ * <aa>\@!<bb> BRANCH NOMATCH <aa> --> END <bb> --> END
+ * | | ^ ^
+ * | +----------------+ |
+ * +--------------------------------+
+ *
+ * +---------+
+ * | V
+ * \z[abc] BRANCH BRANCH a BRANCH b BRANCH c BRANCH NOTHING --> END
+ * | | | | ^ ^
+ * | | | +-----+ |
+ * | | +----------------+ |
+ * | +---------------------------+ |
+ * +------------------------------------------------------+
+ *
+ * They all start with a BRANCH for "\|" alternaties, even when there is only
+ * one alternative.
+ */
+
+/*
+ * The opcodes are:
+ */
+
+/* definition number opnd? meaning */
+#define END 0 /* End of program or NOMATCH operand. */
+#define BOL 1 /* Match "" at beginning of line. */
+#define EOL 2 /* Match "" at end of line. */
+#define BRANCH 3 /* node Match this alternative, or the
+ * next... */
+#define BACK 4 /* Match "", "next" ptr points backward. */
+#define EXACTLY 5 /* str Match this string. */
+#define NOTHING 6 /* Match empty string. */
+#define STAR 7 /* node Match this (simple) thing 0 or more
+ * times. */
+#define PLUS 8 /* node Match this (simple) thing 1 or more
+ * times. */
+#define MATCH 9 /* node match the operand zero-width */
+#define NOMATCH 10 /* node check for no match with operand */
+#define BEHIND 11 /* node look behind for a match with operand */
+#define NOBEHIND 12 /* node look behind for no match with operand */
+#define SUBPAT 13 /* node match the operand here */
+#define BRACE_SIMPLE 14 /* node Match this (simple) thing between m and
+ * n times (\{m,n\}). */
+#define BOW 15 /* Match "" after [^a-zA-Z0-9_] */
+#define EOW 16 /* Match "" at [^a-zA-Z0-9_] */
+#define BRACE_LIMITS 17 /* nr nr define the min & max for BRACE_SIMPLE
+ * and BRACE_COMPLEX. */
+#define NEWL 18 /* Match line-break */
+#define BHPOS 19 /* End position for BEHIND or NOBEHIND */
+
+
+/* character classes: 20-48 normal, 50-78 include a line-break */
+#define ADD_NL 30
+#define FIRST_NL ANY + ADD_NL
+#define ANY 20 /* Match any one character. */
+#define ANYOF 21 /* str Match any character in this string. */
+#define ANYBUT 22 /* str Match any character not in this
+ * string. */
+#define IDENT 23 /* Match identifier char */
+#define SIDENT 24 /* Match identifier char but no digit */
+#define KWORD 25 /* Match keyword char */
+#define SKWORD 26 /* Match word char but no digit */
+#define FNAME 27 /* Match file name char */
+#define SFNAME 28 /* Match file name char but no digit */
+#define PRINT 29 /* Match printable char */
+#define SPRINT 30 /* Match printable char but no digit */
+#define WHITE 31 /* Match whitespace char */
+#define NWHITE 32 /* Match non-whitespace char */
+#define DIGIT 33 /* Match digit char */
+#define NDIGIT 34 /* Match non-digit char */
+#define HEX 35 /* Match hex char */
+#define NHEX 36 /* Match non-hex char */
+#define OCTAL 37 /* Match octal char */
+#define NOCTAL 38 /* Match non-octal char */
+#define WORD 39 /* Match word char */
+#define NWORD 40 /* Match non-word char */
+#define HEAD 41 /* Match head char */
+#define NHEAD 42 /* Match non-head char */
+#define ALPHA 43 /* Match alpha char */
+#define NALPHA 44 /* Match non-alpha char */
+#define LOWER 45 /* Match lowercase char */
+#define NLOWER 46 /* Match non-lowercase char */
+#define UPPER 47 /* Match uppercase char */
+#define NUPPER 48 /* Match non-uppercase char */
+#define LAST_NL NUPPER + ADD_NL
+#define WITH_NL(op) ((op) >= FIRST_NL && (op) <= LAST_NL)
+
+#define MOPEN 80 /* -89 Mark this point in input as start of
+ * \( subexpr. MOPEN + 0 marks start of
+ * match. */
+#define MCLOSE 90 /* -99 Analogous to MOPEN. MCLOSE + 0 marks
+ * end of match. */
+#define BACKREF 100 /* -109 node Match same string again \1-\9 */
+
+#ifdef FEAT_SYN_HL
+# define ZOPEN 110 /* -119 Mark this point in input as start of
+ * \z( subexpr. */
+# define ZCLOSE 120 /* -129 Analogous to ZOPEN. */
+# define ZREF 130 /* -139 node Match external submatch \z1-\z9 */
+#endif
+
+#define BRACE_COMPLEX 140 /* -149 node Match nodes between m & n times */
+
+#define NOPEN 150 /* Mark this point in input as start of
+ \%( subexpr. */
+#define NCLOSE 151 /* Analogous to NOPEN. */
+
+#define MULTIBYTECODE 200 /* mbc Match one multi-byte character */
+#define RE_BOF 201 /* Match "" at beginning of file. */
+#define RE_EOF 202 /* Match "" at end of file. */
+#define CURSOR 203 /* Match location of cursor. */
+
+#define RE_LNUM 204 /* nr cmp Match line number */
+#define RE_COL 205 /* nr cmp Match column number */
+#define RE_VCOL 206 /* nr cmp Match virtual column number */
+
+/*
+ * Magic characters have a special meaning, they don't match literally.
+ * Magic characters are negative. This separates them from literal characters
+ * (possibly multi-byte). Only ASCII characters can be Magic.
+ */
+#define Magic(x) ((int)(x) - 256)
+#define un_Magic(x) ((x) + 256)
+#define is_Magic(x) ((x) < 0)
+
+static int no_Magic __ARGS((int x));
+static int toggle_Magic __ARGS((int x));
+
+ static int
+no_Magic(x)
+ int x;
+{
+ if (is_Magic(x))
+ return un_Magic(x);
+ return x;
+}
+
+ static int
+toggle_Magic(x)
+ int x;
+{
+ if (is_Magic(x))
+ return un_Magic(x);
+ return Magic(x);
+}
+
+/*
+ * The first byte of the regexp internal "program" is actually this magic
+ * number; the start node begins in the second byte. It's used to catch the
+ * most severe mutilation of the program by the caller.
+ */
+
+#define REGMAGIC 0234
+
+/*
+ * Opcode notes:
+ *
+ * BRANCH The set of branches constituting a single choice are hooked
+ * together with their "next" pointers, since precedence prevents
+ * anything being concatenated to any individual branch. The
+ * "next" pointer of the last BRANCH in a choice points to the
+ * thing following the whole choice. This is also where the
+ * final "next" pointer of each individual branch points; each
+ * branch starts with the operand node of a BRANCH node.
+ *
+ * BACK Normal "next" pointers all implicitly point forward; BACK
+ * exists to make loop structures possible.
+ *
+ * STAR,PLUS '=', and complex '*' and '+', are implemented as circular
+ * BRANCH structures using BACK. Simple cases (one character
+ * per match) are implemented with STAR and PLUS for speed
+ * and to minimize recursive plunges.
+ *
+ * BRACE_LIMITS This is always followed by a BRACE_SIMPLE or BRACE_COMPLEX
+ * node, and defines the min and max limits to be used for that
+ * node.
+ *
+ * MOPEN,MCLOSE ...are numbered at compile time.
+ * ZOPEN,ZCLOSE ...ditto
+ */
+
+/*
+ * A node is one char of opcode followed by two chars of "next" pointer.
+ * "Next" pointers are stored as two 8-bit bytes, high order first. The
+ * value is a positive offset from the opcode of the node containing it.
+ * An operand, if any, simply follows the node. (Note that much of the
+ * code generation knows about this implicit relationship.)
+ *
+ * Using two bytes for the "next" pointer is vast overkill for most things,
+ * but allows patterns to get big without disasters.
+ */
+#define OP(p) ((int)*(p))
+#define NEXT(p) (((*((p) + 1) & 0377) << 8) + (*((p) + 2) & 0377))
+#define OPERAND(p) ((p) + 3)
+/* Obtain an operand that was stored as four bytes, MSB first. */
+#define OPERAND_MIN(p) (((long)(p)[3] << 24) + ((long)(p)[4] << 16) \
+ + ((long)(p)[5] << 8) + (long)(p)[6])
+/* Obtain a second operand stored as four bytes. */
+#define OPERAND_MAX(p) OPERAND_MIN((p) + 4)
+/* Obtain a second single-byte operand stored after a four bytes operand. */
+#define OPERAND_CMP(p) (p)[7]
+
+/*
+ * Utility definitions.
+ */
+#define UCHARAT(p) ((int)*(char_u *)(p))
+
+/* Used for an error (down from) vim_regcomp(): give the error message, set
+ * rc_did_emsg and return NULL */
+#define EMSG_RET_NULL(m) { EMSG(m); rc_did_emsg = TRUE; return NULL; }
+#define EMSG_M_RET_NULL(m, c) { EMSG2(m, c ? "" : "\\"); rc_did_emsg = TRUE; return NULL; }
+#define EMSG_RET_FAIL(m) { EMSG(m); rc_did_emsg = TRUE; return FAIL; }
+#define EMSG_ONE_RET_NULL EMSG_M_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
+
+#define MAX_LIMIT (32767L << 16L)
+
+static int re_multi_type __ARGS((int));
+static int cstrncmp __ARGS((char_u *s1, char_u *s2, int *n));
+static char_u *cstrchr __ARGS((char_u *, int));
+
+#ifdef DEBUG
+static void regdump __ARGS((char_u *, regprog_T *));
+static char_u *regprop __ARGS((char_u *));
+#endif
+
+#define NOT_MULTI 0
+#define MULTI_ONE 1
+#define MULTI_MULT 2
+/*
+ * Return NOT_MULTI if c is not a "multi" operator.
+ * Return MULTI_ONE if c is a single "multi" operator.
+ * Return MULTI_MULT if c is a multi "multi" operator.
+ */
+ static int
+re_multi_type(c)
+ int c;
+{
+ if (c == Magic('@') || c == Magic('=') || c == Magic('?'))
+ return MULTI_ONE;
+ if (c == Magic('*') || c == Magic('+') || c == Magic('{'))
+ return MULTI_MULT;
+ return NOT_MULTI;
+}
+
+/*
+ * Flags to be passed up and down.
+ */
+#define HASWIDTH 0x1 /* Known never to match null string. */
+#define SIMPLE 0x2 /* Simple enough to be STAR/PLUS operand. */
+#define SPSTART 0x4 /* Starts with * or +. */
+#define HASNL 0x8 /* Contains some \n. */
+#define HASLOOKBH 0x10 /* Contains "\@<=" or "\@<!". */
+#define WORST 0 /* Worst case. */
+
+/*
+ * When regcode is set to this value, code is not emitted and size is computed
+ * instead.
+ */
+#define JUST_CALC_SIZE ((char_u *) -1)
+
+static char_u *reg_prev_sub;
+
+/*
+ * REGEXP_INRANGE contains all characters which are always special in a []
+ * range after '\'.
+ * REGEXP_ABBR contains all characters which act as abbreviations after '\'.
+ * These are:
+ * \n - New line (NL).
+ * \r - Carriage Return (CR).
+ * \t - Tab (TAB).
+ * \e - Escape (ESC).
+ * \b - Backspace (Ctrl_H).
+ */
+static char_u REGEXP_INRANGE[] = "]^-n\\";
+static char_u REGEXP_ABBR[] = "nrteb";
+
+static int backslash_trans __ARGS((int c));
+static int skip_class_name __ARGS((char_u **pp));
+static char_u *skip_anyof __ARGS((char_u *p));
+static void init_class_tab __ARGS((void));
+
+/*
+ * Translate '\x' to its control character, except "\n", which is Magic.
+ */
+ static int
+backslash_trans(c)
+ int c;
+{
+ switch (c)
+ {
+ case 'r': return CAR;
+ case 't': return TAB;
+ case 'e': return ESC;
+ case 'b': return BS;
+ }
+ return c;
+}
+
+/*
+ * Check for a character class name. "pp" points to the '['.
+ * Returns one of the CLASS_ items. CLASS_NONE means that no item was
+ * recognized. Otherwise "pp" is advanced to after the item.
+ */
+ static int
+skip_class_name(pp)
+ char_u **pp;
+{
+ static const char *(class_names[]) =
+ {
+ "alnum:]",
+#define CLASS_ALNUM 0
+ "alpha:]",
+#define CLASS_ALPHA 1
+ "blank:]",
+#define CLASS_BLANK 2
+ "cntrl:]",
+#define CLASS_CNTRL 3
+ "digit:]",
+#define CLASS_DIGIT 4
+ "graph:]",
+#define CLASS_GRAPH 5
+ "lower:]",
+#define CLASS_LOWER 6
+ "print:]",
+#define CLASS_PRINT 7
+ "punct:]",
+#define CLASS_PUNCT 8
+ "space:]",
+#define CLASS_SPACE 9
+ "upper:]",
+#define CLASS_UPPER 10
+ "xdigit:]",
+#define CLASS_XDIGIT 11
+ "tab:]",
+#define CLASS_TAB 12
+ "return:]",
+#define CLASS_RETURN 13
+ "backspace:]",
+#define CLASS_BACKSPACE 14
+ "escape:]",
+#define CLASS_ESCAPE 15
+ };
+#define CLASS_NONE 99
+ int i;
+
+ if ((*pp)[1] == ':')
+ {
+ for (i = 0; i < sizeof(class_names) / sizeof(*class_names); ++i)
+ if (STRNCMP(*pp + 2, class_names[i], STRLEN(class_names[i])) == 0)
+ {
+ *pp += STRLEN(class_names[i]) + 2;
+ return i;
+ }
+ }
+ return CLASS_NONE;
+}
+
+/*
+ * Skip over a "[]" range.
+ * "p" must point to the character after the '['.
+ * The returned pointer is on the matching ']', or the terminating NUL.
+ */
+ static char_u *
+skip_anyof(p)
+ char_u *p;
+{
+ int cpo_lit; /* 'cpoptions' contains 'l' flag */
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+ cpo_lit = (!reg_syn && vim_strchr(p_cpo, CPO_LITERAL) != NULL);
+
+ if (*p == '^') /* Complement of range. */
+ ++p;
+ if (*p == ']' || *p == '-')
+ ++p;
+ while (*p != NUL && *p != ']')
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ p += l;
+ else
+#endif
+ if (*p == '-')
+ {
+ ++p;
+ if (*p != ']' && *p != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p);
+ else
+#endif
+ ++p;
+ }
+ }
+ else if (*p == '\\'
+ && (vim_strchr(REGEXP_INRANGE, p[1]) != NULL
+ || (!cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL)))
+ p += 2;
+ else if (*p == '[')
+ {
+ if (skip_class_name(&p) == CLASS_NONE)
+ ++p; /* It was not a class name */
+ }
+ else
+ ++p;
+ }
+
+ return p;
+}
+
+/*
+ * Specific version of character class functions.
+ * Using a table to keep this fast.
+ */
+static short class_tab[256];
+
+#define RI_DIGIT 0x01
+#define RI_HEX 0x02
+#define RI_OCTAL 0x04
+#define RI_WORD 0x08
+#define RI_HEAD 0x10
+#define RI_ALPHA 0x20
+#define RI_LOWER 0x40
+#define RI_UPPER 0x80
+#define RI_WHITE 0x100
+
+ static void
+init_class_tab()
+{
+ int i;
+ static int done = FALSE;
+
+ if (done)
+ return;
+
+ for (i = 0; i < 256; ++i)
+ {
+ if (i >= '0' && i <= '7')
+ class_tab[i] = RI_DIGIT + RI_HEX + RI_OCTAL + RI_WORD;
+ else if (i >= '8' && i <= '9')
+ class_tab[i] = RI_DIGIT + RI_HEX + RI_WORD;
+ else if (i >= 'a' && i <= 'f')
+ class_tab[i] = RI_HEX + RI_WORD + RI_HEAD + RI_ALPHA + RI_LOWER;
+#ifdef EBCDIC
+ else if ((i >= 'g' && i <= 'i') || (i >= 'j' && i <= 'r')
+ || (i >= 's' && i <= 'z'))
+#else
+ else if (i >= 'g' && i <= 'z')
+#endif
+ class_tab[i] = RI_WORD + RI_HEAD + RI_ALPHA + RI_LOWER;
+ else if (i >= 'A' && i <= 'F')
+ class_tab[i] = RI_HEX + RI_WORD + RI_HEAD + RI_ALPHA + RI_UPPER;
+#ifdef EBCDIC
+ else if ((i >= 'G' && i <= 'I') || ( i >= 'J' && i <= 'R')
+ || (i >= 'S' && i <= 'Z'))
+#else
+ else if (i >= 'G' && i <= 'Z')
+#endif
+ class_tab[i] = RI_WORD + RI_HEAD + RI_ALPHA + RI_UPPER;
+ else if (i == '_')
+ class_tab[i] = RI_WORD + RI_HEAD;
+ else
+ class_tab[i] = 0;
+ }
+ class_tab[' '] |= RI_WHITE;
+ class_tab['\t'] |= RI_WHITE;
+ done = TRUE;
+}
+
+#ifdef FEAT_MBYTE
+# define ri_digit(c) (c < 0x100 && (class_tab[c] & RI_DIGIT))
+# define ri_hex(c) (c < 0x100 && (class_tab[c] & RI_HEX))
+# define ri_octal(c) (c < 0x100 && (class_tab[c] & RI_OCTAL))
+# define ri_word(c) (c < 0x100 && (class_tab[c] & RI_WORD))
+# define ri_head(c) (c < 0x100 && (class_tab[c] & RI_HEAD))
+# define ri_alpha(c) (c < 0x100 && (class_tab[c] & RI_ALPHA))
+# define ri_lower(c) (c < 0x100 && (class_tab[c] & RI_LOWER))
+# define ri_upper(c) (c < 0x100 && (class_tab[c] & RI_UPPER))
+# define ri_white(c) (c < 0x100 && (class_tab[c] & RI_WHITE))
+#else
+# define ri_digit(c) (class_tab[c] & RI_DIGIT)
+# define ri_hex(c) (class_tab[c] & RI_HEX)
+# define ri_octal(c) (class_tab[c] & RI_OCTAL)
+# define ri_word(c) (class_tab[c] & RI_WORD)
+# define ri_head(c) (class_tab[c] & RI_HEAD)
+# define ri_alpha(c) (class_tab[c] & RI_ALPHA)
+# define ri_lower(c) (class_tab[c] & RI_LOWER)
+# define ri_upper(c) (class_tab[c] & RI_UPPER)
+# define ri_white(c) (class_tab[c] & RI_WHITE)
+#endif
+
+/* flags for regflags */
+#define RF_ICASE 1 /* ignore case */
+#define RF_NOICASE 2 /* don't ignore case */
+#define RF_HASNL 4 /* can match a NL */
+#define RF_ICOMBINE 8 /* ignore combining characters */
+#define RF_LOOKBH 16 /* uses "\@<=" or "\@<!" */
+
+/*
+ * Global work variables for vim_regcomp().
+ */
+
+static char_u *regparse; /* Input-scan pointer. */
+static int prevchr_len; /* byte length of previous char */
+static int num_complex_braces; /* Complex \{...} count */
+static int regnpar; /* () count. */
+#ifdef FEAT_SYN_HL
+static int regnzpar; /* \z() count. */
+static int re_has_z; /* \z item detected */
+#endif
+static char_u *regcode; /* Code-emit pointer, or JUST_CALC_SIZE */
+static long regsize; /* Code size. */
+static char_u had_endbrace[NSUBEXP]; /* flags, TRUE if end of () found */
+static unsigned regflags; /* RF_ flags for prog */
+static long brace_min[10]; /* Minimums for complex brace repeats */
+static long brace_max[10]; /* Maximums for complex brace repeats */
+static int brace_count[10]; /* Current counts for complex brace repeats */
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+static int had_eol; /* TRUE when EOL found by vim_regcomp() */
+#endif
+static int one_exactly = FALSE; /* only do one char for EXACTLY */
+
+static int reg_magic; /* magicness of the pattern: */
+#define MAGIC_NONE 1 /* "\V" very unmagic */
+#define MAGIC_OFF 2 /* "\M" or 'magic' off */
+#define MAGIC_ON 3 /* "\m" or 'magic' */
+#define MAGIC_ALL 4 /* "\v" very magic */
+
+static int reg_string; /* matching with a string instead of a buffer
+ line */
+
+/*
+ * META contains all characters that may be magic, except '^' and '$'.
+ */
+
+#ifdef EBCDIC
+static char_u META[] = "%&()*+.123456789<=>?@ACDFHIKLMOPSUVWX[_acdfhiklmnopsuvwxz{|~";
+#else
+/* META[] is used often enough to justify turning it into a table. */
+static char_u META_flags[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* % & ( ) * + . */
+ 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0,
+/* 1 2 3 4 5 6 7 8 9 < = > ? */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1,
+/* @ A C D F H I K L M O */
+ 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1,
+/* P S U V W X Z [ _ */
+ 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1,
+/* a c d f h i k l m n o */
+ 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
+/* p s u v w x z { | ~ */
+ 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1
+};
+#endif
+
+static int curchr;
+
+/* arguments for reg() */
+#define REG_NOPAREN 0 /* toplevel reg() */
+#define REG_PAREN 1 /* \(\) */
+#define REG_ZPAREN 2 /* \z(\) */
+#define REG_NPAREN 3 /* \%(\) */
+
+/*
+ * Forward declarations for vim_regcomp()'s friends.
+ */
+static void initchr __ARGS((char_u *));
+static int getchr __ARGS((void));
+static void skipchr_keepstart __ARGS((void));
+static int peekchr __ARGS((void));
+static void skipchr __ARGS((void));
+static void ungetchr __ARGS((void));
+static void regcomp_start __ARGS((char_u *expr, int flags));
+static char_u *reg __ARGS((int, int *));
+static char_u *regbranch __ARGS((int *flagp));
+static char_u *regconcat __ARGS((int *flagp));
+static char_u *regpiece __ARGS((int *));
+static char_u *regatom __ARGS((int *));
+static char_u *regnode __ARGS((int));
+static int prog_magic_wrong __ARGS((void));
+static char_u *regnext __ARGS((char_u *));
+static void regc __ARGS((int b));
+#ifdef FEAT_MBYTE
+static void regmbc __ARGS((int c));
+#endif
+static void reginsert __ARGS((int, char_u *));
+static void reginsert_limits __ARGS((int, long, long, char_u *));
+static char_u *re_put_long __ARGS((char_u *pr, long_u val));
+static int read_limits __ARGS((long *, long *));
+static void regtail __ARGS((char_u *, char_u *));
+static void regoptail __ARGS((char_u *, char_u *));
+
+/*
+ * Return TRUE if compiled regular expression "prog" can match a line break.
+ */
+ int
+re_multiline(prog)
+ regprog_T *prog;
+{
+ return (prog->regflags & RF_HASNL);
+}
+
+/*
+ * Return TRUE if compiled regular expression "prog" looks before the start
+ * position (pattern contains "\@<=" or "\@<!").
+ */
+ int
+re_lookbehind(prog)
+ regprog_T *prog;
+{
+ return (prog->regflags & RF_LOOKBH);
+}
+
+/*
+ * Skip past regular expression.
+ * Stop at end of 'p' of where 'dirc' is found ('/', '?', etc).
+ * Take care of characters with a backslash in front of it.
+ * Skip strings inside [ and ].
+ * When "newp" is not NULL and "dirc" is '?', make an allocated copy of the
+ * expression and change "\?" to "?". If "*newp" is not NULL the expression
+ * is changed in-place.
+ */
+ char_u *
+skip_regexp(startp, dirc, magic, newp)
+ char_u *startp;
+ int dirc;
+ int magic;
+ char_u **newp;
+{
+ int mymagic;
+ char_u *p = startp;
+
+ if (magic)
+ mymagic = MAGIC_ON;
+ else
+ mymagic = MAGIC_OFF;
+
+ for (; p[0] != NUL; ++p)
+ {
+ if (p[0] == dirc) /* found end of regexp */
+ break;
+ if ((p[0] == '[' && mymagic >= MAGIC_ON)
+ || (p[0] == '\\' && p[1] == '[' && mymagic <= MAGIC_OFF))
+ {
+ p = skip_anyof(p + 1);
+ if (p[0] == NUL)
+ break;
+ }
+ else if (p[0] == '\\' && p[1] != NUL)
+ {
+ if (dirc == '?' && newp != NULL && p[1] == '?')
+ {
+ /* change "\?" to "?", make a copy first. */
+ if (*newp == NULL)
+ {
+ *newp = vim_strsave(startp);
+ if (*newp != NULL)
+ p = *newp + (p - startp);
+ }
+ if (*newp != NULL)
+ mch_memmove(p, p + 1, STRLEN(p));
+ else
+ ++p;
+ }
+ else
+ ++p; /* skip next character */
+ if (*p == 'v')
+ mymagic = MAGIC_ALL;
+ else if (*p == 'V')
+ mymagic = MAGIC_NONE;
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ return p;
+}
+
+/*
+ * vim_regcomp - compile a regular expression into internal code
+ *
+ * We can't allocate space until we know how big the compiled form will be,
+ * but we can't compile it (and thus know how big it is) until we've got a
+ * place to put the code. So we cheat: we compile it twice, once with code
+ * generation turned off and size counting turned on, and once "for real".
+ * This also means that we don't allocate space until we are sure that the
+ * thing really will compile successfully, and we never have to move the
+ * code and thus invalidate pointers into it. (Note that it has to be in
+ * one piece because vim_free() must be able to free it all.)
+ *
+ * Whether upper/lower case is to be ignored is decided when executing the
+ * program, it does not matter here.
+ *
+ * Beware that the optimization-preparation code in here knows about some
+ * of the structure of the compiled regexp.
+ * "re_flags": RE_MAGIC and/or RE_STRING.
+ */
+ regprog_T *
+vim_regcomp(expr, re_flags)
+ char_u *expr;
+ int re_flags;
+{
+ regprog_T *r;
+ char_u *scan;
+ char_u *longest;
+ int len;
+ int flags;
+
+ if (expr == NULL)
+ EMSG_RET_NULL(_(e_null));
+
+ init_class_tab();
+
+ /*
+ * First pass: determine size, legality.
+ */
+ regcomp_start(expr, re_flags);
+ regcode = JUST_CALC_SIZE;
+ regc(REGMAGIC);
+ if (reg(REG_NOPAREN, &flags) == NULL)
+ return NULL;
+
+ /* Small enough for pointer-storage convention? */
+#ifdef SMALL_MALLOC /* 16 bit storage allocation */
+ if (regsize >= 65536L - 256L)
+ EMSG_RET_NULL(_("E339: Pattern too long"));
+#endif
+
+ /* Allocate space. */
+ r = (regprog_T *)lalloc(sizeof(regprog_T) + regsize, TRUE);
+ if (r == NULL)
+ return NULL;
+
+ /*
+ * Second pass: emit code.
+ */
+ regcomp_start(expr, re_flags);
+ regcode = r->program;
+ regc(REGMAGIC);
+ if (reg(REG_NOPAREN, &flags) == NULL)
+ {
+ vim_free(r);
+ return NULL;
+ }
+
+ /* Dig out information for optimizations. */
+ r->regstart = NUL; /* Worst-case defaults. */
+ r->reganch = 0;
+ r->regmust = NULL;
+ r->regmlen = 0;
+ r->regflags = regflags;
+ if (flags & HASNL)
+ r->regflags |= RF_HASNL;
+ if (flags & HASLOOKBH)
+ r->regflags |= RF_LOOKBH;
+#ifdef FEAT_SYN_HL
+ /* Remember whether this pattern has any \z specials in it. */
+ r->reghasz = re_has_z;
+#endif
+ scan = r->program + 1; /* First BRANCH. */
+ if (OP(regnext(scan)) == END) /* Only one top-level choice. */
+ {
+ scan = OPERAND(scan);
+
+ /* Starting-point info. */
+ if (OP(scan) == BOL || OP(scan) == RE_BOF)
+ {
+ r->reganch++;
+ scan = regnext(scan);
+ }
+
+ if (OP(scan) == EXACTLY)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ r->regstart = (*mb_ptr2char)(OPERAND(scan));
+ else
+#endif
+ r->regstart = *OPERAND(scan);
+ }
+ else if ((OP(scan) == BOW
+ || OP(scan) == EOW
+ || OP(scan) == NOTHING
+ || OP(scan) == MOPEN + 0 || OP(scan) == NOPEN
+ || OP(scan) == MCLOSE + 0 || OP(scan) == NCLOSE)
+ && OP(regnext(scan)) == EXACTLY)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ r->regstart = (*mb_ptr2char)(OPERAND(regnext(scan)));
+ else
+#endif
+ r->regstart = *OPERAND(regnext(scan));
+ }
+
+ /*
+ * If there's something expensive in the r.e., find the longest
+ * literal string that must appear and make it the regmust. Resolve
+ * ties in favor of later strings, since the regstart check works
+ * with the beginning of the r.e. and avoiding duplication
+ * strengthens checking. Not a strong reason, but sufficient in the
+ * absence of others.
+ */
+ /*
+ * When the r.e. starts with BOW, it is faster to look for a regmust
+ * first. Used a lot for "#" and "*" commands. (Added by mool).
+ */
+ if ((flags & SPSTART || OP(scan) == BOW || OP(scan) == EOW)
+ && !(flags & HASNL))
+ {
+ longest = NULL;
+ len = 0;
+ for (; scan != NULL; scan = regnext(scan))
+ if (OP(scan) == EXACTLY && STRLEN(OPERAND(scan)) >= (size_t)len)
+ {
+ longest = OPERAND(scan);
+ len = (int)STRLEN(OPERAND(scan));
+ }
+ r->regmust = longest;
+ r->regmlen = len;
+ }
+ }
+#ifdef DEBUG
+ regdump(expr, r);
+#endif
+ return r;
+}
+
+/*
+ * Setup to parse the regexp. Used once to get the length and once to do it.
+ */
+ static void
+regcomp_start(expr, re_flags)
+ char_u *expr;
+ int re_flags; /* see vim_regcomp() */
+{
+ initchr(expr);
+ if (re_flags & RE_MAGIC)
+ reg_magic = MAGIC_ON;
+ else
+ reg_magic = MAGIC_OFF;
+ reg_string = (re_flags & RE_STRING);
+
+ num_complex_braces = 0;
+ regnpar = 1;
+ vim_memset(had_endbrace, 0, sizeof(had_endbrace));
+#ifdef FEAT_SYN_HL
+ regnzpar = 1;
+ re_has_z = 0;
+#endif
+ regsize = 0L;
+ regflags = 0;
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+ had_eol = FALSE;
+#endif
+}
+
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+/*
+ * Check if during the previous call to vim_regcomp the EOL item "$" has been
+ * found. This is messy, but it works fine.
+ */
+ int
+vim_regcomp_had_eol()
+{
+ return had_eol;
+}
+#endif
+
+/*
+ * reg - regular expression, i.e. main body or parenthesized thing
+ *
+ * Caller must absorb opening parenthesis.
+ *
+ * Combining parenthesis handling with the base level of regular expression
+ * is a trifle forced, but the need to tie the tails of the branches to what
+ * follows makes it hard to avoid.
+ */
+ static char_u *
+reg(paren, flagp)
+ int paren; /* REG_NOPAREN, REG_PAREN, REG_NPAREN or REG_ZPAREN */
+ int *flagp;
+{
+ char_u *ret;
+ char_u *br;
+ char_u *ender;
+ int parno = 0;
+ int flags;
+
+ *flagp = HASWIDTH; /* Tentatively. */
+
+#ifdef FEAT_SYN_HL
+ if (paren == REG_ZPAREN)
+ {
+ /* Make a ZOPEN node. */
+ if (regnzpar >= NSUBEXP)
+ EMSG_RET_NULL(_("E50: Too many \\z("));
+ parno = regnzpar;
+ regnzpar++;
+ ret = regnode(ZOPEN + parno);
+ }
+ else
+#endif
+ if (paren == REG_PAREN)
+ {
+ /* Make a MOPEN node. */
+ if (regnpar >= NSUBEXP)
+ EMSG_M_RET_NULL(_("E51: Too many %s("), reg_magic == MAGIC_ALL);
+ parno = regnpar;
+ ++regnpar;
+ ret = regnode(MOPEN + parno);
+ }
+ else if (paren == REG_NPAREN)
+ {
+ /* Make a NOPEN node. */
+ ret = regnode(NOPEN);
+ }
+ else
+ ret = NULL;
+
+ /* Pick up the branches, linking them together. */
+ br = regbranch(&flags);
+ if (br == NULL)
+ return NULL;
+ if (ret != NULL)
+ regtail(ret, br); /* [MZ]OPEN -> first. */
+ else
+ ret = br;
+ /* If one of the branches can be zero-width, the whole thing can.
+ * If one of the branches has * at start or matches a line-break, the
+ * whole thing can. */
+ if (!(flags & HASWIDTH))
+ *flagp &= ~HASWIDTH;
+ *flagp |= flags & (SPSTART | HASNL | HASLOOKBH);
+ while (peekchr() == Magic('|'))
+ {
+ skipchr();
+ br = regbranch(&flags);
+ if (br == NULL)
+ return NULL;
+ regtail(ret, br); /* BRANCH -> BRANCH. */
+ if (!(flags & HASWIDTH))
+ *flagp &= ~HASWIDTH;
+ *flagp |= flags & (SPSTART | HASNL | HASLOOKBH);
+ }
+
+ /* Make a closing node, and hook it on the end. */
+ ender = regnode(
+#ifdef FEAT_SYN_HL
+ paren == REG_ZPAREN ? ZCLOSE + parno :
+#endif
+ paren == REG_PAREN ? MCLOSE + parno :
+ paren == REG_NPAREN ? NCLOSE : END);
+ regtail(ret, ender);
+
+ /* Hook the tails of the branches to the closing node. */
+ for (br = ret; br != NULL; br = regnext(br))
+ regoptail(br, ender);
+
+ /* Check for proper termination. */
+ if (paren != REG_NOPAREN && getchr() != Magic(')'))
+ {
+#ifdef FEAT_SYN_HL
+ if (paren == REG_ZPAREN)
+ EMSG_RET_NULL(_("E52: Unmatched \\z("))
+ else
+#endif
+ if (paren == REG_NPAREN)
+ EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL)
+ else
+ EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL)
+ }
+ else if (paren == REG_NOPAREN && peekchr() != NUL)
+ {
+ if (curchr == Magic(')'))
+ EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL)
+ else
+ EMSG_RET_NULL(_(e_trailing)) /* "Can't happen". */
+ /* NOTREACHED */
+ }
+ /*
+ * Here we set the flag allowing back references to this set of
+ * parentheses.
+ */
+ if (paren == REG_PAREN)
+ had_endbrace[parno] = TRUE; /* have seen the close paren */
+ return ret;
+}
+
+/*
+ * regbranch - one alternative of an | operator
+ *
+ * Implements the & operator.
+ */
+ static char_u *
+regbranch(flagp)
+ int *flagp;
+{
+ char_u *ret;
+ char_u *chain = NULL;
+ char_u *latest;
+ int flags;
+
+ *flagp = WORST | HASNL; /* Tentatively. */
+
+ ret = regnode(BRANCH);
+ for (;;)
+ {
+ latest = regconcat(&flags);
+ if (latest == NULL)
+ return NULL;
+ /* If one of the branches has width, the whole thing has. If one of
+ * the branches anchors at start-of-line, the whole thing does.
+ * If one of the branches uses look-behind, the whole thing does. */
+ *flagp |= flags & (HASWIDTH | SPSTART | HASLOOKBH);
+ /* If one of the branches doesn't match a line-break, the whole thing
+ * doesn't. */
+ *flagp &= ~HASNL | (flags & HASNL);
+ if (chain != NULL)
+ regtail(chain, latest);
+ if (peekchr() != Magic('&'))
+ break;
+ skipchr();
+ regtail(latest, regnode(END)); /* operand ends */
+ reginsert(MATCH, latest);
+ chain = latest;
+ }
+
+ return ret;
+}
+
+/*
+ * regbranch - one alternative of an | or & operator
+ *
+ * Implements the concatenation operator.
+ */
+ static char_u *
+regconcat(flagp)
+ int *flagp;
+{
+ char_u *first = NULL;
+ char_u *chain = NULL;
+ char_u *latest;
+ int flags;
+ int cont = TRUE;
+
+ *flagp = WORST; /* Tentatively. */
+
+ while (cont)
+ {
+ switch (peekchr())
+ {
+ case NUL:
+ case Magic('|'):
+ case Magic('&'):
+ case Magic(')'):
+ cont = FALSE;
+ break;
+ case Magic('Z'):
+#ifdef FEAT_MBYTE
+ regflags |= RF_ICOMBINE;
+#endif
+ skipchr_keepstart();
+ break;
+ case Magic('c'):
+ regflags |= RF_ICASE;
+ skipchr_keepstart();
+ break;
+ case Magic('C'):
+ regflags |= RF_NOICASE;
+ skipchr_keepstart();
+ break;
+ case Magic('v'):
+ reg_magic = MAGIC_ALL;
+ skipchr_keepstart();
+ curchr = -1;
+ break;
+ case Magic('m'):
+ reg_magic = MAGIC_ON;
+ skipchr_keepstart();
+ curchr = -1;
+ break;
+ case Magic('M'):
+ reg_magic = MAGIC_OFF;
+ skipchr_keepstart();
+ curchr = -1;
+ break;
+ case Magic('V'):
+ reg_magic = MAGIC_NONE;
+ skipchr_keepstart();
+ curchr = -1;
+ break;
+ default:
+ latest = regpiece(&flags);
+ if (latest == NULL)
+ return NULL;
+ *flagp |= flags & (HASWIDTH | HASNL | HASLOOKBH);
+ if (chain == NULL) /* First piece. */
+ *flagp |= flags & SPSTART;
+ else
+ regtail(chain, latest);
+ chain = latest;
+ if (first == NULL)
+ first = latest;
+ break;
+ }
+ }
+ if (first == NULL) /* Loop ran zero times. */
+ first = regnode(NOTHING);
+ return first;
+}
+
+/*
+ * regpiece - something followed by possible [*+=]
+ *
+ * Note that the branching code sequences used for = and the general cases
+ * of * and + are somewhat optimized: they use the same NOTHING node as
+ * both the endmarker for their branch list and the body of the last branch.
+ * It might seem that this node could be dispensed with entirely, but the
+ * endmarker role is not redundant.
+ */
+ static char_u *
+regpiece(flagp)
+ int *flagp;
+{
+ char_u *ret;
+ int op;
+ char_u *next;
+ int flags;
+ long minval;
+ long maxval;
+
+ ret = regatom(&flags);
+ if (ret == NULL)
+ return NULL;
+
+ op = peekchr();
+ if (re_multi_type(op) == NOT_MULTI)
+ {
+ *flagp = flags;
+ return ret;
+ }
+ if (!(flags & HASWIDTH) && re_multi_type(op) == MULTI_MULT)
+ {
+ if (op == Magic('*'))
+ EMSG_M_RET_NULL(_("E56: %s* operand could be empty"),
+ reg_magic >= MAGIC_ON);
+ if (op == Magic('+'))
+ EMSG_M_RET_NULL(_("E57: %s+ operand could be empty"),
+ reg_magic == MAGIC_ALL);
+ /* "\{}" is checked below, it's allowed when there is an upper limit */
+ }
+ /* default flags */
+ *flagp = (WORST | SPSTART | (flags & (HASNL | HASLOOKBH)));
+
+ skipchr();
+ switch (op)
+ {
+ case Magic('*'):
+ if (flags & SIMPLE)
+ reginsert(STAR, ret);
+ else
+ {
+ /* Emit x* as (x&|), where & means "self". */
+ reginsert(BRANCH, ret); /* Either x */
+ regoptail(ret, regnode(BACK)); /* and loop */
+ regoptail(ret, ret); /* back */
+ regtail(ret, regnode(BRANCH)); /* or */
+ regtail(ret, regnode(NOTHING)); /* null. */
+ }
+ break;
+
+ case Magic('+'):
+ if (flags & SIMPLE)
+ reginsert(PLUS, ret);
+ else
+ {
+ /* Emit x+ as x(&|), where & means "self". */
+ next = regnode(BRANCH); /* Either */
+ regtail(ret, next);
+ regtail(regnode(BACK), ret); /* loop back */
+ regtail(next, regnode(BRANCH)); /* or */
+ regtail(ret, regnode(NOTHING)); /* null. */
+ }
+ *flagp = (WORST | HASWIDTH | (flags & (HASNL | HASLOOKBH)));
+ break;
+
+ case Magic('@'):
+ {
+ int lop = END;
+
+ switch (no_Magic(getchr()))
+ {
+ case '=': lop = MATCH; break; /* \@= */
+ case '!': lop = NOMATCH; break; /* \@! */
+ case '>': lop = SUBPAT; break; /* \@> */
+ case '<': switch (no_Magic(getchr()))
+ {
+ case '=': lop = BEHIND; break; /* \@<= */
+ case '!': lop = NOBEHIND; break; /* \@<! */
+ }
+ }
+ if (lop == END)
+ EMSG_M_RET_NULL(_("E59: invalid character after %s@"),
+ reg_magic == MAGIC_ALL);
+ /* Look behind must match with behind_pos. */
+ if (lop == BEHIND || lop == NOBEHIND)
+ {
+ regtail(ret, regnode(BHPOS));
+ *flagp |= HASLOOKBH;
+ }
+ regtail(ret, regnode(END)); /* operand ends */
+ reginsert(lop, ret);
+ break;
+ }
+
+ case Magic('?'):
+ case Magic('='):
+ /* Emit x= as (x|) */
+ reginsert(BRANCH, ret); /* Either x */
+ regtail(ret, regnode(BRANCH)); /* or */
+ next = regnode(NOTHING); /* null. */
+ regtail(ret, next);
+ regoptail(ret, next);
+ break;
+
+ case Magic('{'):
+ if (!read_limits(&minval, &maxval))
+ return NULL;
+ if (!(flags & HASWIDTH) && (maxval > minval
+ ? maxval >= MAX_LIMIT : minval >= MAX_LIMIT))
+ EMSG_M_RET_NULL(_("E58: %s{ operand could be empty"),
+ reg_magic == MAGIC_ALL);
+ if (flags & SIMPLE)
+ {
+ reginsert(BRACE_SIMPLE, ret);
+ reginsert_limits(BRACE_LIMITS, minval, maxval, ret);
+ }
+ else
+ {
+ if (num_complex_braces >= 10)
+ EMSG_M_RET_NULL(_("E60: Too many complex %s{...}s"),
+ reg_magic == MAGIC_ALL);
+ reginsert(BRACE_COMPLEX + num_complex_braces, ret);
+ regoptail(ret, regnode(BACK));
+ regoptail(ret, ret);
+ reginsert_limits(BRACE_LIMITS, minval, maxval, ret);
+ ++num_complex_braces;
+ }
+ if (minval > 0 && maxval > 0)
+ *flagp = (HASWIDTH | (flags & (HASNL | HASLOOKBH)));
+ break;
+ }
+ if (re_multi_type(peekchr()) != NOT_MULTI)
+ {
+ /* Can't have a multi follow a multi. */
+ if (peekchr() == Magic('*'))
+ sprintf((char *)IObuff, _("E61: Nested %s*"),
+ reg_magic >= MAGIC_ON ? "" : "\\");
+ else
+ sprintf((char *)IObuff, _("E62: Nested %s%c"),
+ reg_magic == MAGIC_ALL ? "" : "\\", no_Magic(peekchr()));
+ EMSG_RET_NULL(IObuff);
+ }
+
+ return ret;
+}
+
+/*
+ * regatom - the lowest level
+ *
+ * Optimization: gobbles an entire sequence of ordinary characters so that
+ * it can turn them into a single node, which is smaller to store and
+ * faster to run. Don't do this when one_exactly is set.
+ */
+ static char_u *
+regatom(flagp)
+ int *flagp;
+{
+ char_u *ret;
+ int flags;
+ int cpo_lit; /* 'cpoptions' contains 'l' flag */
+ int c;
+ static char_u *classchars = (char_u *)".iIkKfFpPsSdDxXoOwWhHaAlLuU";
+ static int classcodes[] = {ANY, IDENT, SIDENT, KWORD, SKWORD,
+ FNAME, SFNAME, PRINT, SPRINT,
+ WHITE, NWHITE, DIGIT, NDIGIT,
+ HEX, NHEX, OCTAL, NOCTAL,
+ WORD, NWORD, HEAD, NHEAD,
+ ALPHA, NALPHA, LOWER, NLOWER,
+ UPPER, NUPPER
+ };
+ char_u *p;
+ int extra = 0;
+
+ *flagp = WORST; /* Tentatively. */
+ cpo_lit = (!reg_syn && vim_strchr(p_cpo, CPO_LITERAL) != NULL);
+
+ c = getchr();
+ switch (c)
+ {
+ case Magic('^'):
+ ret = regnode(BOL);
+ break;
+
+ case Magic('$'):
+ ret = regnode(EOL);
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+ had_eol = TRUE;
+#endif
+ break;
+
+ case Magic('<'):
+ ret = regnode(BOW);
+ break;
+
+ case Magic('>'):
+ ret = regnode(EOW);
+ break;
+
+ case Magic('_'):
+ c = no_Magic(getchr());
+ if (c == '^') /* "\_^" is start-of-line */
+ {
+ ret = regnode(BOL);
+ break;
+ }
+ if (c == '$') /* "\_$" is end-of-line */
+ {
+ ret = regnode(EOL);
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+ had_eol = TRUE;
+#endif
+ break;
+ }
+
+ extra = ADD_NL;
+ *flagp |= HASNL;
+
+ /* "\_[" is character range plus newline */
+ if (c == '[')
+ goto collection;
+
+ /* "\_x" is character class plus newline */
+ /*FALLTHROUGH*/
+
+ /*
+ * Character classes.
+ */
+ case Magic('.'):
+ case Magic('i'):
+ case Magic('I'):
+ case Magic('k'):
+ case Magic('K'):
+ case Magic('f'):
+ case Magic('F'):
+ case Magic('p'):
+ case Magic('P'):
+ case Magic('s'):
+ case Magic('S'):
+ case Magic('d'):
+ case Magic('D'):
+ case Magic('x'):
+ case Magic('X'):
+ case Magic('o'):
+ case Magic('O'):
+ case Magic('w'):
+ case Magic('W'):
+ case Magic('h'):
+ case Magic('H'):
+ case Magic('a'):
+ case Magic('A'):
+ case Magic('l'):
+ case Magic('L'):
+ case Magic('u'):
+ case Magic('U'):
+ p = vim_strchr(classchars, no_Magic(c));
+ if (p == NULL)
+ EMSG_RET_NULL(_("E63: invalid use of \\_"));
+ ret = regnode(classcodes[p - classchars] + extra);
+ *flagp |= HASWIDTH | SIMPLE;
+ break;
+
+ case Magic('n'):
+ if (reg_string)
+ {
+ /* In a string "\n" matches a newline character. */
+ ret = regnode(EXACTLY);
+ regc(NL);
+ regc(NUL);
+ *flagp |= HASWIDTH | SIMPLE;
+ }
+ else
+ {
+ /* In buffer text "\n" matches the end of a line. */
+ ret = regnode(NEWL);
+ *flagp |= HASWIDTH | HASNL;
+ }
+ break;
+
+ case Magic('('):
+ if (one_exactly)
+ EMSG_ONE_RET_NULL;
+ ret = reg(REG_PAREN, &flags);
+ if (ret == NULL)
+ return NULL;
+ *flagp |= flags & (HASWIDTH | SPSTART | HASNL | HASLOOKBH);
+ break;
+
+ case NUL:
+ case Magic('|'):
+ case Magic('&'):
+ case Magic(')'):
+ EMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
+ /* NOTREACHED */
+
+ case Magic('='):
+ case Magic('?'):
+ case Magic('+'):
+ case Magic('@'):
+ case Magic('{'):
+ case Magic('*'):
+ c = no_Magic(c);
+ sprintf((char *)IObuff, _("E64: %s%c follows nothing"),
+ (c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL)
+ ? "" : "\\", c);
+ EMSG_RET_NULL(IObuff);
+ /* NOTREACHED */
+
+ case Magic('~'): /* previous substitute pattern */
+ if (reg_prev_sub)
+ {
+ char_u *lp;
+
+ ret = regnode(EXACTLY);
+ lp = reg_prev_sub;
+ while (*lp != NUL)
+ regc(*lp++);
+ regc(NUL);
+ if (*reg_prev_sub != NUL)
+ {
+ *flagp |= HASWIDTH;
+ if ((lp - reg_prev_sub) == 1)
+ *flagp |= SIMPLE;
+ }
+ }
+ else
+ EMSG_RET_NULL(_(e_nopresub));
+ break;
+
+ case Magic('1'):
+ case Magic('2'):
+ case Magic('3'):
+ case Magic('4'):
+ case Magic('5'):
+ case Magic('6'):
+ case Magic('7'):
+ case Magic('8'):
+ case Magic('9'):
+ {
+ int refnum;
+
+ refnum = c - Magic('0');
+ /*
+ * Check if the back reference is legal. We must have seen the
+ * close brace.
+ * TODO: Should also check that we don't refer to something
+ * that is repeated (+*=): what instance of the repetition
+ * should we match?
+ */
+ if (!had_endbrace[refnum])
+ {
+ /* Trick: check if "@<=" or "@<!" follows, in which case
+ * the \1 can appear before the referenced match. */
+ for (p = regparse; *p != NUL; ++p)
+ if (p[0] == '@' && p[1] == '<'
+ && (p[2] == '!' || p[2] == '='))
+ break;
+ if (*p == NUL)
+ EMSG_RET_NULL(_("E65: Illegal back reference"));
+ }
+ ret = regnode(BACKREF + refnum);
+ }
+ break;
+
+#ifdef FEAT_SYN_HL
+ case Magic('z'):
+ {
+ c = no_Magic(getchr());
+ switch (c)
+ {
+ case '(': if (reg_do_extmatch != REX_SET)
+ EMSG_RET_NULL(_("E66: \\z( not allowed here"));
+ if (one_exactly)
+ EMSG_ONE_RET_NULL;
+ ret = reg(REG_ZPAREN, &flags);
+ if (ret == NULL)
+ return NULL;
+ *flagp |= flags & (HASWIDTH|SPSTART|HASNL|HASLOOKBH);
+ re_has_z = REX_SET;
+ break;
+
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': if (reg_do_extmatch != REX_USE)
+ EMSG_RET_NULL(_("E67: \\z1 et al. not allowed here"));
+ ret = regnode(ZREF + c - '0');
+ re_has_z = REX_USE;
+ break;
+
+ case 's': ret = regnode(MOPEN + 0);
+ break;
+
+ case 'e': ret = regnode(MCLOSE + 0);
+ break;
+
+ default: EMSG_RET_NULL(_("E68: Invalid character after \\z"));
+ }
+ }
+ break;
+#endif
+
+ case Magic('%'):
+ {
+ c = no_Magic(getchr());
+ switch (c)
+ {
+ /* () without a back reference */
+ case '(':
+ if (one_exactly)
+ EMSG_ONE_RET_NULL;
+ ret = reg(REG_NPAREN, &flags);
+ if (ret == NULL)
+ return NULL;
+ *flagp |= flags & (HASWIDTH | SPSTART | HASNL | HASLOOKBH);
+ break;
+
+ /* Catch \%^ and \%$ regardless of where they appear in the
+ * pattern -- regardless of whether or not it makes sense. */
+ case '^':
+ ret = regnode(RE_BOF);
+ break;
+
+ case '$':
+ ret = regnode(RE_EOF);
+ break;
+
+ case '#':
+ ret = regnode(CURSOR);
+ break;
+
+ /* \%[abc]: Emit as a list of branches, all ending at the last
+ * branch which matches nothing. */
+ case '[':
+ if (one_exactly) /* doesn't nest */
+ EMSG_ONE_RET_NULL;
+ {
+ char_u *lastbranch;
+ char_u *lastnode = NULL;
+ char_u *br;
+
+ ret = NULL;
+ while ((c = getchr()) != ']')
+ {
+ if (c == NUL)
+ EMSG_M_RET_NULL(_("E69: Missing ] after %s%%["),
+ reg_magic == MAGIC_ALL);
+ br = regnode(BRANCH);
+ if (ret == NULL)
+ ret = br;
+ else
+ regtail(lastnode, br);
+
+ ungetchr();
+ one_exactly = TRUE;
+ lastnode = regatom(flagp);
+ one_exactly = FALSE;
+ if (lastnode == NULL)
+ return NULL;
+ }
+ if (ret == NULL)
+ EMSG_M_RET_NULL(_("E70: Empty %s%%[]"),
+ reg_magic == MAGIC_ALL);
+ lastbranch = regnode(BRANCH);
+ br = regnode(NOTHING);
+ if (ret != JUST_CALC_SIZE)
+ {
+ regtail(lastnode, br);
+ regtail(lastbranch, br);
+ /* connect all branches to the NOTHING
+ * branch at the end */
+ for (br = ret; br != lastnode; )
+ {
+ if (OP(br) == BRANCH)
+ {
+ regtail(br, lastbranch);
+ br = OPERAND(br);
+ }
+ else
+ br = regnext(br);
+ }
+ }
+ *flagp &= ~HASWIDTH;
+ break;
+ }
+
+ default:
+ if (VIM_ISDIGIT(c) || c == '<' || c == '>')
+ {
+ long_u n = 0;
+ int cmp;
+
+ cmp = c;
+ if (cmp == '<' || cmp == '>')
+ c = getchr();
+ while (VIM_ISDIGIT(c))
+ {
+ n = n * 10 + (c - '0');
+ c = getchr();
+ }
+ if (c == 'l' || c == 'c' || c == 'v')
+ {
+ if (c == 'l')
+ ret = regnode(RE_LNUM);
+ else if (c == 'c')
+ ret = regnode(RE_COL);
+ else
+ ret = regnode(RE_VCOL);
+ if (ret == JUST_CALC_SIZE)
+ regsize += 5;
+ else
+ {
+ /* put the number and the optional
+ * comparator after the opcode */
+ regcode = re_put_long(regcode, n);
+ *regcode++ = cmp;
+ }
+ break;
+ }
+ }
+
+ EMSG_M_RET_NULL(_("E71: Invalid character after %s%%"),
+ reg_magic == MAGIC_ALL);
+ }
+ }
+ break;
+
+ case Magic('['):
+collection:
+ {
+ char_u *lp;
+
+ /*
+ * If there is no matching ']', we assume the '[' is a normal
+ * character. This makes 'incsearch' and ":help [" work.
+ */
+ lp = skip_anyof(regparse);
+ if (*lp == ']') /* there is a matching ']' */
+ {
+ int startc = -1; /* > 0 when next '-' is a range */
+ int endc;
+
+ /*
+ * In a character class, different parsing rules apply.
+ * Not even \ is special anymore, nothing is.
+ */
+ if (*regparse == '^') /* Complement of range. */
+ {
+ ret = regnode(ANYBUT + extra);
+ regparse++;
+ }
+ else
+ ret = regnode(ANYOF + extra);
+
+ /* At the start ']' and '-' mean the literal character. */
+ if (*regparse == ']' || *regparse == '-')
+ regc(*regparse++);
+
+ while (*regparse != NUL && *regparse != ']')
+ {
+ if (*regparse == '-')
+ {
+ ++regparse;
+ /* The '-' is not used for a range at the end and
+ * after or before a '\n'. */
+ if (*regparse == ']' || *regparse == NUL
+ || startc == -1
+ || (regparse[0] == '\\' && regparse[1] == 'n'))
+ {
+ regc('-');
+ startc = '-'; /* [--x] is a range */
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ endc = mb_ptr2char_adv(&regparse);
+ else
+#endif
+ endc = *regparse++;
+ if (startc > endc)
+ EMSG_RET_NULL(_(e_invrange));
+#ifdef FEAT_MBYTE
+ if (has_mbyte && ((*mb_char2len)(startc) > 1
+ || (*mb_char2len)(endc) > 1))
+ {
+ /* Limit to a range of 256 chars */
+ if (endc > startc + 256)
+ EMSG_RET_NULL(_(e_invrange));
+ while (++startc <= endc)
+ regmbc(startc);
+ }
+ else
+#endif
+ {
+#ifdef EBCDIC
+ int alpha_only = FALSE;
+
+ /* for alphabetical range skip the gaps
+ * 'i'-'j', 'r'-'s', 'I'-'J' and 'R'-'S'. */
+ if (isalpha(startc) && isalpha(endc))
+ alpha_only = TRUE;
+#endif
+ while (++startc <= endc)
+#ifdef EBCDIC
+ if (!alpha_only || isalpha(startc))
+#endif
+ regc(startc);
+ }
+ startc = -1;
+ }
+ }
+ /*
+ * Only "\]", "\^", "\]" and "\\" are special in Vi. Vim
+ * accepts "\t", "\e", etc., but only when the 'l' flag in
+ * 'cpoptions' is not included.
+ */
+ else if (*regparse == '\\'
+ && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL
+ || (!cpo_lit
+ && vim_strchr(REGEXP_ABBR,
+ regparse[1]) != NULL)))
+ {
+ regparse++;
+ if (*regparse == 'n')
+ {
+ /* '\n' in range: also match NL */
+ if (ret != JUST_CALC_SIZE)
+ {
+ if (*ret == ANYBUT)
+ *ret = ANYBUT + ADD_NL;
+ else if (*ret == ANYOF)
+ *ret = ANYOF + ADD_NL;
+ /* else: must have had a \n already */
+ }
+ *flagp |= HASNL;
+ regparse++;
+ startc = -1;
+ }
+ else
+ {
+ startc = backslash_trans(*regparse++);
+ regc(startc);
+ }
+ }
+ else if (*regparse == '[')
+ {
+ int c_class;
+ int cu;
+
+ c_class = skip_class_name(&regparse);
+ startc = -1;
+ /* Characters assumed to be 8 bits! */
+ switch (c_class)
+ {
+ case CLASS_NONE:
+ /* literal '[', allow [[-x] as a range */
+ startc = *regparse++;
+ regc(startc);
+ break;
+ case CLASS_ALNUM:
+ for (cu = 1; cu <= 255; cu++)
+ if (isalnum(cu))
+ regc(cu);
+ break;
+ case CLASS_ALPHA:
+ for (cu = 1; cu <= 255; cu++)
+ if (isalpha(cu))
+ regc(cu);
+ break;
+ case CLASS_BLANK:
+ regc(' ');
+ regc('\t');
+ break;
+ case CLASS_CNTRL:
+ for (cu = 1; cu <= 255; cu++)
+ if (iscntrl(cu))
+ regc(cu);
+ break;
+ case CLASS_DIGIT:
+ for (cu = 1; cu <= 255; cu++)
+ if (VIM_ISDIGIT(cu))
+ regc(cu);
+ break;
+ case CLASS_GRAPH:
+ for (cu = 1; cu <= 255; cu++)
+ if (isgraph(cu))
+ regc(cu);
+ break;
+ case CLASS_LOWER:
+ for (cu = 1; cu <= 255; cu++)
+ if (islower(cu))
+ regc(cu);
+ break;
+ case CLASS_PRINT:
+ for (cu = 1; cu <= 255; cu++)
+ if (vim_isprintc(cu))
+ regc(cu);
+ break;
+ case CLASS_PUNCT:
+ for (cu = 1; cu <= 255; cu++)
+ if (ispunct(cu))
+ regc(cu);
+ break;
+ case CLASS_SPACE:
+ for (cu = 9; cu <= 13; cu++)
+ regc(cu);
+ regc(' ');
+ break;
+ case CLASS_UPPER:
+ for (cu = 1; cu <= 255; cu++)
+ if (isupper(cu))
+ regc(cu);
+ break;
+ case CLASS_XDIGIT:
+ for (cu = 1; cu <= 255; cu++)
+ if (vim_isxdigit(cu))
+ regc(cu);
+ break;
+ case CLASS_TAB:
+ regc('\t');
+ break;
+ case CLASS_RETURN:
+ regc('\r');
+ break;
+ case CLASS_BACKSPACE:
+ regc('\b');
+ break;
+ case CLASS_ESCAPE:
+ regc('\033');
+ break;
+ }
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int len;
+
+ /* produce a multibyte character, including any
+ * following composing characters */
+ startc = mb_ptr2char(regparse);
+ len = (*mb_ptr2len_check)(regparse);
+ if (enc_utf8 && utf_char2len(startc) != len)
+ startc = -1; /* composing chars */
+ while (--len >= 0)
+ regc(*regparse++);
+ }
+ else
+#endif
+ {
+ startc = *regparse++;
+ regc(startc);
+ }
+ }
+ }
+ regc(NUL);
+ prevchr_len = 1; /* last char was the ']' */
+ if (*regparse != ']')
+ EMSG_RET_NULL(_(e_toomsbra)); /* Cannot happen? */
+ skipchr(); /* let's be friends with the lexer again */
+ *flagp |= HASWIDTH | SIMPLE;
+ break;
+ }
+ }
+ /* FALLTHROUGH */
+
+ default:
+ {
+ int len;
+
+#ifdef FEAT_MBYTE
+ /* A multi-byte character is handled as a separate atom if it's
+ * before a multi. */
+ if (has_mbyte && (*mb_char2len)(c) > 1
+ && re_multi_type(peekchr()) != NOT_MULTI)
+ {
+ ret = regnode(MULTIBYTECODE);
+ regmbc(c);
+ *flagp |= HASWIDTH | SIMPLE;
+ break;
+ }
+#endif
+
+ ret = regnode(EXACTLY);
+
+ /*
+ * Append characters as long as:
+ * - there is no following multi, we then need the character in
+ * front of it as a single character operand
+ * - not running into a Magic character
+ * - "one_exactly" is not set
+ * But always emit at least one character. Might be a Multi,
+ * e.g., a "[" without matching "]".
+ */
+ for (len = 0; c != NUL && (len == 0
+ || (re_multi_type(peekchr()) == NOT_MULTI
+ && !one_exactly
+ && !is_Magic(c))); ++len)
+ {
+ c = no_Magic(c);
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ regmbc(c);
+ if (enc_utf8)
+ {
+ int off;
+ int l;
+
+ /* Need to get composing character too, directly
+ * access regparse for that, because skipchr() skips
+ * over composing chars. */
+ ungetchr();
+ if (*regparse == '\\' && regparse[1] != NUL)
+ off = 1;
+ else
+ off = 0;
+ for (;;)
+ {
+ l = utf_ptr2len_check(regparse + off);
+ if (!UTF_COMPOSINGLIKE(regparse + off,
+ regparse + off + l))
+ break;
+ off += l;
+ regmbc(utf_ptr2char(regparse + off));
+ }
+ skipchr();
+ }
+ }
+ else
+#endif
+ regc(c);
+ c = getchr();
+ }
+ ungetchr();
+
+ regc(NUL);
+ *flagp |= HASWIDTH;
+ if (len == 1)
+ *flagp |= SIMPLE;
+ }
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * emit a node
+ * Return pointer to generated code.
+ */
+ static char_u *
+regnode(op)
+ int op;
+{
+ char_u *ret;
+
+ ret = regcode;
+ if (ret == JUST_CALC_SIZE)
+ regsize += 3;
+ else
+ {
+ *regcode++ = op;
+ *regcode++ = NUL; /* Null "next" pointer. */
+ *regcode++ = NUL;
+ }
+ return ret;
+}
+
+/*
+ * Emit (if appropriate) a byte of code
+ */
+ static void
+regc(b)
+ int b;
+{
+ if (regcode == JUST_CALC_SIZE)
+ regsize++;
+ else
+ *regcode++ = b;
+}
+
+#ifdef FEAT_MBYTE
+/*
+ * Emit (if appropriate) a multi-byte character of code
+ */
+ static void
+regmbc(c)
+ int c;
+{
+ if (regcode == JUST_CALC_SIZE)
+ regsize += (*mb_char2len)(c);
+ else
+ regcode += (*mb_char2bytes)(c, regcode);
+}
+#endif
+
+/*
+ * reginsert - insert an operator in front of already-emitted operand
+ *
+ * Means relocating the operand.
+ */
+ static void
+reginsert(op, opnd)
+ int op;
+ char_u *opnd;
+{
+ char_u *src;
+ char_u *dst;
+ char_u *place;
+
+ if (regcode == JUST_CALC_SIZE)
+ {
+ regsize += 3;
+ return;
+ }
+ src = regcode;
+ regcode += 3;
+ dst = regcode;
+ while (src > opnd)
+ *--dst = *--src;
+
+ place = opnd; /* Op node, where operand used to be. */
+ *place++ = op;
+ *place++ = NUL;
+ *place = NUL;
+}
+
+/*
+ * reginsert_limits - insert an operator in front of already-emitted operand.
+ * The operator has the given limit values as operands. Also set next pointer.
+ *
+ * Means relocating the operand.
+ */
+ static void
+reginsert_limits(op, minval, maxval, opnd)
+ int op;
+ long minval;
+ long maxval;
+ char_u *opnd;
+{
+ char_u *src;
+ char_u *dst;
+ char_u *place;
+
+ if (regcode == JUST_CALC_SIZE)
+ {
+ regsize += 11;
+ return;
+ }
+ src = regcode;
+ regcode += 11;
+ dst = regcode;
+ while (src > opnd)
+ *--dst = *--src;
+
+ place = opnd; /* Op node, where operand used to be. */
+ *place++ = op;
+ *place++ = NUL;
+ *place++ = NUL;
+ place = re_put_long(place, (long_u)minval);
+ place = re_put_long(place, (long_u)maxval);
+ regtail(opnd, place);
+}
+
+/*
+ * Write a long as four bytes at "p" and return pointer to the next char.
+ */
+ static char_u *
+re_put_long(p, val)
+ char_u *p;
+ long_u val;
+{
+ *p++ = (char_u) ((val >> 24) & 0377);
+ *p++ = (char_u) ((val >> 16) & 0377);
+ *p++ = (char_u) ((val >> 8) & 0377);
+ *p++ = (char_u) (val & 0377);
+ return p;
+}
+
+/*
+ * regtail - set the next-pointer at the end of a node chain
+ */
+ static void
+regtail(p, val)
+ char_u *p;
+ char_u *val;
+{
+ char_u *scan;
+ char_u *temp;
+ int offset;
+
+ if (p == JUST_CALC_SIZE)
+ return;
+
+ /* Find last node. */
+ scan = p;
+ for (;;)
+ {
+ temp = regnext(scan);
+ if (temp == NULL)
+ break;
+ scan = temp;
+ }
+
+ if (OP(scan) == BACK)
+ offset = (int)(scan - val);
+ else
+ offset = (int)(val - scan);
+ *(scan + 1) = (char_u) (((unsigned)offset >> 8) & 0377);
+ *(scan + 2) = (char_u) (offset & 0377);
+}
+
+/*
+ * regoptail - regtail on item after a BRANCH; nop if none
+ */
+ static void
+regoptail(p, val)
+ char_u *p;
+ char_u *val;
+{
+ /* When op is neither BRANCH nor BRACE_COMPLEX0-9, it is "operandless" */
+ if (p == NULL || p == JUST_CALC_SIZE
+ || (OP(p) != BRANCH
+ && (OP(p) < BRACE_COMPLEX || OP(p) > BRACE_COMPLEX + 9)))
+ return;
+ regtail(OPERAND(p), val);
+}
+
+/*
+ * getchr() - get the next character from the pattern. We know about
+ * magic and such, so therefore we need a lexical analyzer.
+ */
+
+/* static int curchr; */
+static int prevprevchr;
+static int prevchr;
+static int nextchr; /* used for ungetchr() */
+/*
+ * Note: prevchr is sometimes -1 when we are not at the start,
+ * eg in /[ ^I]^ the pattern was never found even if it existed, because ^ was
+ * taken to be magic -- webb
+ */
+static int at_start; /* True when on the first character */
+static int prev_at_start; /* True when on the second character */
+
+ static void
+initchr(str)
+ char_u *str;
+{
+ regparse = str;
+ prevchr_len = 0;
+ curchr = prevprevchr = prevchr = nextchr = -1;
+ at_start = TRUE;
+ prev_at_start = FALSE;
+}
+
+ static int
+peekchr()
+{
+ if (curchr == -1)
+ {
+ switch (curchr = regparse[0])
+ {
+ case '.':
+ case '[':
+ case '~':
+ /* magic when 'magic' is on */
+ if (reg_magic >= MAGIC_ON)
+ curchr = Magic(curchr);
+ break;
+ case '(':
+ case ')':
+ case '{':
+ case '%':
+ case '+':
+ case '=':
+ case '?':
+ case '@':
+ case '!':
+ case '&':
+ case '|':
+ case '<':
+ case '>':
+ case '#': /* future ext. */
+ case '"': /* future ext. */
+ case '\'': /* future ext. */
+ case ',': /* future ext. */
+ case '-': /* future ext. */
+ case ':': /* future ext. */
+ case ';': /* future ext. */
+ case '`': /* future ext. */
+ case '/': /* Can't be used in / command */
+ /* magic only after "\v" */
+ if (reg_magic == MAGIC_ALL)
+ curchr = Magic(curchr);
+ break;
+ case '*':
+ /* * is not magic as the very first character, eg "?*ptr" and when
+ * after '^', eg "/^*ptr" */
+ if (reg_magic >= MAGIC_ON && !at_start
+ && !(prev_at_start && prevchr == Magic('^')))
+ curchr = Magic('*');
+ break;
+ case '^':
+ /* '^' is only magic as the very first character and if it's after
+ * "\(", "\|", "\&' or "\n" */
+ if (reg_magic >= MAGIC_OFF
+ && (at_start
+ || reg_magic == MAGIC_ALL
+ || prevchr == Magic('(')
+ || prevchr == Magic('|')
+ || prevchr == Magic('&')
+ || prevchr == Magic('n')
+ || (no_Magic(prevchr) == '('
+ && prevprevchr == Magic('%'))))
+ {
+ curchr = Magic('^');
+ at_start = TRUE;
+ prev_at_start = FALSE;
+ }
+ break;
+ case '$':
+ /* '$' is only magic as the very last char and if it's in front of
+ * either "\|", "\)", "\&", or "\n" */
+ if (reg_magic >= MAGIC_OFF)
+ {
+ char_u *p = regparse + 1;
+
+ /* ignore \c \C \m and \M after '$' */
+ while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
+ || p[1] == 'm' || p[1] == 'M' || p[1] == 'Z'))
+ p += 2;
+ if (p[0] == NUL
+ || (p[0] == '\\'
+ && (p[1] == '|' || p[1] == '&' || p[1] == ')'
+ || p[1] == 'n'))
+ || reg_magic == MAGIC_ALL)
+ curchr = Magic('$');
+ }
+ break;
+ case '\\':
+ {
+ int c = regparse[1];
+
+ if (c == NUL)
+ curchr = '\\'; /* trailing '\' */
+ else if (
+#ifdef EBCDIC
+ vim_strchr(META, c)
+#else
+ c <= '~' && META_flags[c]
+#endif
+ )
+ {
+ /*
+ * META contains everything that may be magic sometimes,
+ * except ^ and $ ("\^" and "\$" are only magic after
+ * "\v"). We now fetch the next character and toggle its
+ * magicness. Therefore, \ is so meta-magic that it is
+ * not in META.
+ */
+ curchr = -1;
+ prev_at_start = at_start;
+ at_start = FALSE; /* be able to say "/\*ptr" */
+ ++regparse;
+ peekchr();
+ --regparse;
+ curchr = toggle_Magic(curchr);
+ }
+ else if (vim_strchr(REGEXP_ABBR, c))
+ {
+ /*
+ * Handle abbreviations, like "\t" for TAB -- webb
+ */
+ curchr = backslash_trans(c);
+ }
+ else if (reg_magic == MAGIC_NONE && (c == '$' || c == '^'))
+ curchr = toggle_Magic(c);
+ else
+ {
+ /*
+ * Next character can never be (made) magic?
+ * Then backslashing it won't do anything.
+ */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ curchr = (*mb_ptr2char)(regparse + 1);
+ else
+#endif
+ curchr = c;
+ }
+ break;
+ }
+
+#ifdef FEAT_MBYTE
+ default:
+ if (has_mbyte)
+ curchr = (*mb_ptr2char)(regparse);
+#endif
+ }
+ }
+
+ return curchr;
+}
+
+/*
+ * Eat one lexed character. Do this in a way that we can undo it.
+ */
+ static void
+skipchr()
+{
+ /* peekchr() eats a backslash, do the same here */
+ if (*regparse == '\\')
+ prevchr_len = 1;
+ else
+ prevchr_len = 0;
+ if (regparse[prevchr_len] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ prevchr_len += (*mb_ptr2len_check)(regparse + prevchr_len);
+ else
+#endif
+ ++prevchr_len;
+ }
+ regparse += prevchr_len;
+ prev_at_start = at_start;
+ at_start = FALSE;
+ prevprevchr = prevchr;
+ prevchr = curchr;
+ curchr = nextchr; /* use previously unget char, or -1 */
+ nextchr = -1;
+}
+
+/*
+ * Skip a character while keeping the value of prev_at_start for at_start.
+ * prevchr and prevprevchr are also kept.
+ */
+ static void
+skipchr_keepstart()
+{
+ int as = prev_at_start;
+ int pr = prevchr;
+ int prpr = prevprevchr;
+
+ skipchr();
+ at_start = as;
+ prevchr = pr;
+ prevprevchr = prpr;
+}
+
+ static int
+getchr()
+{
+ int chr = peekchr();
+
+ skipchr();
+ return chr;
+}
+
+/*
+ * put character back. Works only once!
+ */
+ static void
+ungetchr()
+{
+ nextchr = curchr;
+ curchr = prevchr;
+ prevchr = prevprevchr;
+ at_start = prev_at_start;
+ prev_at_start = FALSE;
+
+ /* Backup regparse, so that it's at the same position as before the
+ * getchr(). */
+ regparse -= prevchr_len;
+}
+
+/*
+ * read_limits - Read two integers to be taken as a minimum and maximum.
+ * If the first character is '-', then the range is reversed.
+ * Should end with 'end'. If minval is missing, zero is default, if maxval is
+ * missing, a very big number is the default.
+ */
+ static int
+read_limits(minval, maxval)
+ long *minval;
+ long *maxval;
+{
+ int reverse = FALSE;
+ char_u *first_char;
+ long tmp;
+
+ if (*regparse == '-')
+ {
+ /* Starts with '-', so reverse the range later */
+ regparse++;
+ reverse = TRUE;
+ }
+ first_char = regparse;
+ *minval = getdigits(&regparse);
+ if (*regparse == ',') /* There is a comma */
+ {
+ if (vim_isdigit(*++regparse))
+ *maxval = getdigits(&regparse);
+ else
+ *maxval = MAX_LIMIT;
+ }
+ else if (VIM_ISDIGIT(*first_char))
+ *maxval = *minval; /* It was \{n} or \{-n} */
+ else
+ *maxval = MAX_LIMIT; /* It was \{} or \{-} */
+ if (*regparse == '\\')
+ regparse++; /* Allow either \{...} or \{...\} */
+ if (*regparse != '}' || (*maxval == 0 && *minval == 0))
+ {
+ sprintf((char *)IObuff, _("E554: Syntax error in %s{...}"),
+ reg_magic == MAGIC_ALL ? "" : "\\");
+ EMSG_RET_FAIL(IObuff);
+ }
+
+ /*
+ * Reverse the range if there was a '-', or make sure it is in the right
+ * order otherwise.
+ */
+ if ((!reverse && *minval > *maxval) || (reverse && *minval < *maxval))
+ {
+ tmp = *minval;
+ *minval = *maxval;
+ *maxval = tmp;
+ }
+ skipchr(); /* let's be friends with the lexer again */
+ return OK;
+}
+
+/*
+ * vim_regexec and friends
+ */
+
+/*
+ * Global work variables for vim_regexec().
+ */
+
+/* The current match-position is remembered with these variables: */
+static linenr_T reglnum; /* line number, relative to first line */
+static char_u *regline; /* start of current line */
+static char_u *reginput; /* current input, points into "regline" */
+
+static int need_clear_subexpr; /* subexpressions still need to be
+ * cleared */
+#ifdef FEAT_SYN_HL
+static int need_clear_zsubexpr = FALSE; /* extmatch subexpressions
+ * still need to be cleared */
+#endif
+
+static int out_of_stack; /* TRUE when ran out of stack space */
+
+/*
+ * Structure used to save the current input state, when it needs to be
+ * restored after trying a match. Used by reg_save() and reg_restore().
+ */
+typedef struct
+{
+ union
+ {
+ char_u *ptr; /* reginput pointer, for single-line regexp */
+ lpos_T pos; /* reginput pos, for multi-line regexp */
+ } rs_u;
+} regsave_T;
+
+/* struct to save start/end pointer/position in for \(\) */
+typedef struct
+{
+ union
+ {
+ char_u *ptr;
+ lpos_T pos;
+ } se_u;
+} save_se_T;
+
+static char_u *reg_getline __ARGS((linenr_T lnum));
+static long vim_regexec_both __ARGS((char_u *line, colnr_T col));
+static long regtry __ARGS((regprog_T *prog, colnr_T col));
+static void cleanup_subexpr __ARGS((void));
+#ifdef FEAT_SYN_HL
+static void cleanup_zsubexpr __ARGS((void));
+#endif
+static void reg_nextline __ARGS((void));
+static void reg_save __ARGS((regsave_T *save));
+static void reg_restore __ARGS((regsave_T *save));
+static int reg_save_equal __ARGS((regsave_T *save));
+static void save_se_multi __ARGS((save_se_T *savep, lpos_T *posp));
+static void save_se_one __ARGS((save_se_T *savep, char_u **pp));
+
+/* Save the sub-expressions before attempting a match. */
+#define save_se(savep, posp, pp) \
+ REG_MULTI ? save_se_multi((savep), (posp)) : save_se_one((savep), (pp))
+
+/* After a failed match restore the sub-expressions. */
+#define restore_se(savep, posp, pp) { \
+ if (REG_MULTI) \
+ *(posp) = (savep)->se_u.pos; \
+ else \
+ *(pp) = (savep)->se_u.ptr; }
+
+static int re_num_cmp __ARGS((long_u val, char_u *scan));
+static int regmatch __ARGS((char_u *prog));
+static int regrepeat __ARGS((char_u *p, long maxcount));
+
+#ifdef DEBUG
+int regnarrate = 0;
+#endif
+
+/*
+ * Internal copy of 'ignorecase'. It is set at each call to vim_regexec().
+ * Normally it gets the value of "rm_ic" or "rmm_ic", but when the pattern
+ * contains '\c' or '\C' the value is overruled.
+ */
+static int ireg_ic;
+
+#ifdef FEAT_MBYTE
+/*
+ * Similar to ireg_ic, but only for 'combining' characters. Set with \Z flag
+ * in the regexp. Defaults to false, always.
+ */
+static int ireg_icombine;
+#endif
+
+/*
+ * Sometimes need to save a copy of a line. Since alloc()/free() is very
+ * slow, we keep one allocated piece of memory and only re-allocate it when
+ * it's too small. It's freed in vim_regexec_both() when finished.
+ */
+static char_u *reg_tofree;
+static unsigned reg_tofreelen;
+
+/*
+ * These variables are set when executing a regexp to speed up the execution.
+ * Which ones are set depends on whethere a single-line or multi-line match is
+ * done:
+ * single-line multi-line
+ * reg_match &regmatch_T NULL
+ * reg_mmatch NULL &regmmatch_T
+ * reg_startp reg_match->startp <invalid>
+ * reg_endp reg_match->endp <invalid>
+ * reg_startpos <invalid> reg_mmatch->startpos
+ * reg_endpos <invalid> reg_mmatch->endpos
+ * reg_win NULL window in which to search
+ * reg_buf <invalid> buffer in which to search
+ * reg_firstlnum <invalid> first line in which to search
+ * reg_maxline 0 last line nr
+ * reg_line_lbr FALSE or TRUE FALSE
+ */
+static regmatch_T *reg_match;
+static regmmatch_T *reg_mmatch;
+static char_u **reg_startp = NULL;
+static char_u **reg_endp = NULL;
+static lpos_T *reg_startpos = NULL;
+static lpos_T *reg_endpos = NULL;
+static win_T *reg_win;
+static buf_T *reg_buf;
+static linenr_T reg_firstlnum;
+static linenr_T reg_maxline;
+static int reg_line_lbr; /* "\n" in string is line break */
+
+/*
+ * Get pointer to the line "lnum", which is relative to "reg_firstlnum".
+ */
+ static char_u *
+reg_getline(lnum)
+ linenr_T lnum;
+{
+ /* when looking behind for a match/no-match lnum is negative. But we
+ * can't go before line 1 */
+ if (reg_firstlnum + lnum < 1)
+ return NULL;
+ return ml_get_buf(reg_buf, reg_firstlnum + lnum, FALSE);
+}
+
+static regsave_T behind_pos;
+
+#ifdef FEAT_SYN_HL
+static char_u *reg_startzp[NSUBEXP]; /* Workspace to mark beginning */
+static char_u *reg_endzp[NSUBEXP]; /* and end of \z(...\) matches */
+static lpos_T reg_startzpos[NSUBEXP]; /* idem, beginning pos */
+static lpos_T reg_endzpos[NSUBEXP]; /* idem, end pos */
+#endif
+
+/* TRUE if using multi-line regexp. */
+#define REG_MULTI (reg_match == NULL)
+
+/*
+ * Match a regexp against a string.
+ * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Uses curbuf for line count and 'iskeyword'.
+ *
+ * Return TRUE if there is a match, FALSE if not.
+ */
+ int
+vim_regexec(rmp, line, col)
+ regmatch_T *rmp;
+ char_u *line; /* string to match against */
+ colnr_T col; /* column to start looking for match */
+{
+ reg_match = rmp;
+ reg_mmatch = NULL;
+ reg_maxline = 0;
+ reg_line_lbr = FALSE;
+ reg_win = NULL;
+ ireg_ic = rmp->rm_ic;
+#ifdef FEAT_MBYTE
+ ireg_icombine = FALSE;
+#endif
+ return (vim_regexec_both(line, col) != 0);
+}
+
+#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Like vim_regexec(), but consider a "\n" in "line" to be a line break.
+ */
+ int
+vim_regexec_nl(rmp, line, col)
+ regmatch_T *rmp;
+ char_u *line; /* string to match against */
+ colnr_T col; /* column to start looking for match */
+{
+ reg_match = rmp;
+ reg_mmatch = NULL;
+ reg_maxline = 0;
+ reg_line_lbr = TRUE;
+ reg_win = NULL;
+ ireg_ic = rmp->rm_ic;
+#ifdef FEAT_MBYTE
+ ireg_icombine = FALSE;
+#endif
+ return (vim_regexec_both(line, col) != 0);
+}
+#endif
+
+/*
+ * Match a regexp against multiple lines.
+ * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Uses curbuf for line count and 'iskeyword'.
+ *
+ * Return zero if there is no match. Return number of lines contained in the
+ * match otherwise.
+ */
+ long
+vim_regexec_multi(rmp, win, buf, lnum, col)
+ regmmatch_T *rmp;
+ win_T *win; /* window in which to search or NULL */
+ buf_T *buf; /* buffer in which to search */
+ linenr_T lnum; /* nr of line to start looking for match */
+ colnr_T col; /* column to start looking for match */
+{
+ long r;
+ buf_T *save_curbuf = curbuf;
+
+ reg_match = NULL;
+ reg_mmatch = rmp;
+ reg_buf = buf;
+ reg_win = win;
+ reg_firstlnum = lnum;
+ reg_maxline = reg_buf->b_ml.ml_line_count - lnum;
+ reg_line_lbr = FALSE;
+ ireg_ic = rmp->rmm_ic;
+#ifdef FEAT_MBYTE
+ ireg_icombine = FALSE;
+#endif
+
+ /* Need to switch to buffer "buf" to make vim_iswordc() work. */
+ curbuf = buf;
+ r = vim_regexec_both(NULL, col);
+ curbuf = save_curbuf;
+
+ return r;
+}
+
+/*
+ * Match a regexp against a string ("line" points to the string) or multiple
+ * lines ("line" is NULL, use reg_getline()).
+ */
+#ifdef HAVE_SETJMP_H
+ static long
+vim_regexec_both(line_arg, col_arg)
+ char_u *line_arg;
+ colnr_T col_arg; /* column to start looking for match */
+#else
+ static long
+vim_regexec_both(line, col)
+ char_u *line;
+ colnr_T col; /* column to start looking for match */
+#endif
+{
+ regprog_T *prog;
+ char_u *s;
+ long retval;
+#ifdef HAVE_SETJMP_H
+ char_u *line;
+ colnr_T col;
+#endif
+
+ reg_tofree = NULL;
+
+#ifdef HAVE_TRY_EXCEPT
+ __try
+ {
+#endif
+
+#ifdef HAVE_SETJMP_H
+ /*
+ * Matching with a regexp may cause a very deep recursive call of
+ * regmatch(). Vim will crash when running out of stack space. Catch
+ * this here if the system supports it.
+ */
+ mch_startjmp();
+ if (SETJMP(lc_jump_env) != 0)
+ {
+ mch_didjmp();
+# ifdef SIGHASARG
+ if (lc_signal != SIGINT)
+# endif
+ EMSG(_("E361: Crash intercepted; regexp too complex?"));
+ retval = 0L;
+ goto theend;
+ }
+
+ /* Trick to avoid "might be clobbered by `longjmp'" warning from gcc. */
+ line = line_arg;
+ col = col_arg;
+#endif
+ retval = 0L;
+
+ if (REG_MULTI)
+ {
+ prog = reg_mmatch->regprog;
+ line = reg_getline((linenr_T)0);
+ reg_startpos = reg_mmatch->startpos;
+ reg_endpos = reg_mmatch->endpos;
+ }
+ else
+ {
+ prog = reg_match->regprog;
+ reg_startp = reg_match->startp;
+ reg_endp = reg_match->endp;
+ }
+
+ /* Be paranoid... */
+ if (prog == NULL || line == NULL)
+ {
+ EMSG(_(e_null));
+ goto theend;
+ }
+
+ /* Check validity of program. */
+ if (prog_magic_wrong())
+ goto theend;
+
+ /* If pattern contains "\c" or "\C": overrule value of ireg_ic */
+ if (prog->regflags & RF_ICASE)
+ ireg_ic = TRUE;
+ else if (prog->regflags & RF_NOICASE)
+ ireg_ic = FALSE;
+
+#ifdef FEAT_MBYTE
+ /* If pattern contains "\Z" overrule value of ireg_icombine */
+ if (prog->regflags & RF_ICOMBINE)
+ ireg_icombine = TRUE;
+#endif
+
+ /* If there is a "must appear" string, look for it. */
+ if (prog->regmust != NULL)
+ {
+ int c;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ c = (*mb_ptr2char)(prog->regmust);
+ else
+#endif
+ c = *prog->regmust;
+ s = line + col;
+ while ((s = cstrchr(s, c)) != NULL)
+ {
+ if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0)
+ break; /* Found it. */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s);
+ else
+#endif
+ ++s;
+ }
+ if (s == NULL) /* Not present. */
+ goto theend;
+ }
+
+ regline = line;
+ reglnum = 0;
+ out_of_stack = FALSE;
+
+ /* Simplest case: Anchored match need be tried only once. */
+ if (prog->reganch)
+ {
+ int c;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ c = (*mb_ptr2char)(regline + col);
+ else
+#endif
+ c = regline[col];
+ if (prog->regstart == NUL
+ || prog->regstart == c
+ || (ireg_ic && ((
+#ifdef FEAT_MBYTE
+ (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
+ || (c < 255 && prog->regstart < 255 &&
+#endif
+ TOLOWER_LOC(prog->regstart) == TOLOWER_LOC(c)))))
+ retval = regtry(prog, col);
+ else
+ retval = 0;
+ }
+ else
+ {
+ /* Messy cases: unanchored match. */
+ while (!got_int && !out_of_stack)
+ {
+ if (prog->regstart != NUL)
+ {
+ /* Skip until the char we know it must start with. */
+ s = cstrchr(regline + col, prog->regstart);
+ if (s == NULL)
+ {
+ retval = 0;
+ break;
+ }
+ col = (int)(s - regline);
+ }
+
+ retval = regtry(prog, col);
+ if (retval > 0)
+ break;
+
+ /* if not currently on the first line, get it again */
+ if (reglnum != 0)
+ {
+ regline = reg_getline((linenr_T)0);
+ reglnum = 0;
+ }
+ if (regline[col] == NUL)
+ break;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ col += (*mb_ptr2len_check)(regline + col);
+ else
+#endif
+ ++col;
+ }
+ }
+
+ if (out_of_stack)
+ EMSG(_("E363: pattern caused out-of-stack error"));
+
+#ifdef HAVE_TRY_EXCEPT
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER)
+ {
+ if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW)
+ {
+ RESETSTKOFLW();
+ EMSG(_("E363: pattern caused out-of-stack error"));
+ }
+ else
+ EMSG(_("E361: Crash intercepted; regexp too complex?"));
+ retval = 0L;
+ }
+#endif
+
+theend:
+ /* Didn't find a match. */
+ vim_free(reg_tofree);
+#ifdef HAVE_SETJMP_H
+ mch_endjmp();
+#endif
+ return retval;
+}
+
+#ifdef FEAT_SYN_HL
+static reg_extmatch_T *make_extmatch __ARGS((void));
+
+/*
+ * Create a new extmatch and mark it as referenced once.
+ */
+ static reg_extmatch_T *
+make_extmatch()
+{
+ reg_extmatch_T *em;
+
+ em = (reg_extmatch_T *)alloc_clear((unsigned)sizeof(reg_extmatch_T));
+ if (em != NULL)
+ em->refcnt = 1;
+ return em;
+}
+
+/*
+ * Add a reference to an extmatch.
+ */
+ reg_extmatch_T *
+ref_extmatch(em)
+ reg_extmatch_T *em;
+{
+ if (em != NULL)
+ em->refcnt++;
+ return em;
+}
+
+/*
+ * Remove a reference to an extmatch. If there are no references left, free
+ * the info.
+ */
+ void
+unref_extmatch(em)
+ reg_extmatch_T *em;
+{
+ int i;
+
+ if (em != NULL && --em->refcnt <= 0)
+ {
+ for (i = 0; i < NSUBEXP; ++i)
+ vim_free(em->matches[i]);
+ vim_free(em);
+ }
+}
+#endif
+
+/*
+ * regtry - try match of "prog" with at regline["col"].
+ * Returns 0 for failure, number of lines contained in the match otherwise.
+ */
+ static long
+regtry(prog, col)
+ regprog_T *prog;
+ colnr_T col;
+{
+ reginput = regline + col;
+ need_clear_subexpr = TRUE;
+#ifdef FEAT_SYN_HL
+ /* Clear the external match subpointers if necessary. */
+ if (prog->reghasz == REX_SET)
+ need_clear_zsubexpr = TRUE;
+#endif
+
+ if (regmatch(prog->program + 1))
+ {
+ cleanup_subexpr();
+ if (REG_MULTI)
+ {
+ if (reg_startpos[0].lnum < 0)
+ {
+ reg_startpos[0].lnum = 0;
+ reg_startpos[0].col = col;
+ }
+ if (reg_endpos[0].lnum < 0)
+ {
+ reg_endpos[0].lnum = reglnum;
+ reg_endpos[0].col = (int)(reginput - regline);
+ }
+ else
+ /* Use line number of "\ze". */
+ reglnum = reg_endpos[0].lnum;
+ }
+ else
+ {
+ if (reg_startp[0] == NULL)
+ reg_startp[0] = regline + col;
+ if (reg_endp[0] == NULL)
+ reg_endp[0] = reginput;
+ }
+#ifdef FEAT_SYN_HL
+ /* Package any found \z(...\) matches for export. Default is none. */
+ unref_extmatch(re_extmatch_out);
+ re_extmatch_out = NULL;
+
+ if (prog->reghasz == REX_SET)
+ {
+ int i;
+
+ cleanup_zsubexpr();
+ re_extmatch_out = make_extmatch();
+ for (i = 0; i < NSUBEXP; i++)
+ {
+ if (REG_MULTI)
+ {
+ /* Only accept single line matches. */
+ if (reg_startzpos[i].lnum >= 0
+ && reg_endzpos[i].lnum == reg_startzpos[i].lnum)
+ re_extmatch_out->matches[i] =
+ vim_strnsave(reg_getline(reg_startzpos[i].lnum)
+ + reg_startzpos[i].col,
+ reg_endzpos[i].col - reg_startzpos[i].col);
+ }
+ else
+ {
+ if (reg_startzp[i] != NULL && reg_endzp[i] != NULL)
+ re_extmatch_out->matches[i] =
+ vim_strnsave(reg_startzp[i],
+ (int)(reg_endzp[i] - reg_startzp[i]));
+ }
+ }
+ }
+#endif
+ return 1 + reglnum;
+ }
+ return 0;
+}
+
+#ifdef FEAT_MBYTE
+/* multi-byte: advance reginput with a function */
+# define ADVANCE_REGINPUT() advance_reginput()
+
+static void advance_reginput __ARGS((void));
+static int reg_prev_class __ARGS((void));
+
+ static void
+advance_reginput()
+{
+ if (has_mbyte)
+ reginput += (*mb_ptr2len_check)(reginput);
+ else
+ ++reginput;
+}
+
+/*
+ * Get class of previous character.
+ */
+ static int
+reg_prev_class()
+{
+ if (reginput > regline)
+ return mb_get_class(reginput - 1
+ - (*mb_head_off)(regline, reginput - 1));
+ return -1;
+}
+
+#else
+/* No multi-byte: It's too simple to make a function for. */
+# define ADVANCE_REGINPUT() ++reginput
+#endif
+
+/*
+ * The arguments from BRACE_LIMITS are stored here. They are actually local
+ * to regmatch(), but they are here to reduce the amount of stack space used
+ * (it can be called recursively many times).
+ */
+static long bl_minval;
+static long bl_maxval;
+
+/*
+ * regmatch - main matching routine
+ *
+ * Conceptually the strategy is simple: Check to see whether the current
+ * node matches, call self recursively to see whether the rest matches,
+ * and then act accordingly. In practice we make some effort to avoid
+ * recursion, in particular by going through "ordinary" nodes (that don't
+ * need to know whether the rest of the match failed) by a loop instead of
+ * by recursion.
+ *
+ * Returns TRUE when there is a match. Leaves reginput and reglnum just after
+ * the last matched character.
+ * Returns FALSE when there is no match. Leaves reginput and reglnum in an
+ * undefined state!
+ */
+ static int
+regmatch(scan)
+ char_u *scan; /* Current node. */
+{
+ char_u *next; /* Next node. */
+ int op;
+ int c;
+
+#ifdef HAVE_GETRLIMIT
+ /* Check if we are running out of stack space. Could be caused by
+ * recursively calling ourselves. */
+ if (out_of_stack || mch_stackcheck((char *)&op) == FAIL)
+ {
+ out_of_stack = TRUE;
+ return FALSE;
+ }
+#endif
+
+ /* Some patterns my cause a long time to match, even though they are not
+ * illegal. E.g., "\([a-z]\+\)\+Q". Allow breaking them with CTRL-C. */
+ fast_breakcheck();
+
+#ifdef DEBUG
+ if (scan != NULL && regnarrate)
+ {
+ mch_errmsg(regprop(scan));
+ mch_errmsg("(\n");
+ }
+#endif
+ while (scan != NULL)
+ {
+ if (got_int || out_of_stack)
+ return FALSE;
+#ifdef DEBUG
+ if (regnarrate)
+ {
+ mch_errmsg(regprop(scan));
+ mch_errmsg("...\n");
+# ifdef FEAT_SYN_HL
+ if (re_extmatch_in != NULL)
+ {
+ int i;
+
+ mch_errmsg(_("External submatches:\n"));
+ for (i = 0; i < NSUBEXP; i++)
+ {
+ mch_errmsg(" \"");
+ if (re_extmatch_in->matches[i] != NULL)
+ mch_errmsg(re_extmatch_in->matches[i]);
+ mch_errmsg("\"\n");
+ }
+ }
+# endif
+ }
+#endif
+ next = regnext(scan);
+
+ op = OP(scan);
+ /* Check for character class with NL added. */
+ if (WITH_NL(op) && *reginput == NUL && reglnum < reg_maxline)
+ {
+ reg_nextline();
+ }
+ else if (reg_line_lbr && WITH_NL(op) && *reginput == '\n')
+ {
+ ADVANCE_REGINPUT();
+ }
+ else
+ {
+ if (WITH_NL(op))
+ op -= ADD_NL;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ c = (*mb_ptr2char)(reginput);
+ else
+#endif
+ c = *reginput;
+ switch (op)
+ {
+ case BOL:
+ if (reginput != regline)
+ return FALSE;
+ break;
+
+ case EOL:
+ if (c != NUL)
+ return FALSE;
+ break;
+
+ case RE_BOF:
+ /* Passing -1 to the getline() function provided for the search
+ * should always return NULL if the current line is the first
+ * line of the file. */
+ if (reglnum != 0 || reginput != regline
+ || (REG_MULTI && reg_getline((linenr_T)-1) != NULL))
+ return FALSE;
+ break;
+
+ case RE_EOF:
+ if (reglnum != reg_maxline || c != NUL)
+ return FALSE;
+ break;
+
+ case CURSOR:
+ /* Check if the buffer is in a window and compare the
+ * reg_win->w_cursor position to the match position. */
+ if (reg_win == NULL
+ || (reglnum + reg_firstlnum != reg_win->w_cursor.lnum)
+ || ((colnr_T)(reginput - regline) != reg_win->w_cursor.col))
+ return FALSE;
+ break;
+
+ case RE_LNUM:
+ if (!REG_MULTI || !re_num_cmp((long_u)(reglnum + reg_firstlnum),
+ scan))
+ return FALSE;
+ break;
+
+ case RE_COL:
+ if (!re_num_cmp((long_u)(reginput - regline) + 1, scan))
+ return FALSE;
+ break;
+
+ case RE_VCOL:
+ if (!re_num_cmp((long_u)win_linetabsize(
+ reg_win == NULL ? curwin : reg_win,
+ regline, (colnr_T)(reginput - regline)) + 1, scan))
+ return FALSE;
+ break;
+
+ case BOW: /* \<word; reginput points to w */
+ if (c == NUL) /* Can't match at end of line */
+ return FALSE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int this_class;
+
+ /* Get class of current and previous char (if it exists). */
+ this_class = mb_get_class(reginput);
+ if (this_class <= 1)
+ return FALSE; /* not on a word at all */
+ if (reg_prev_class() == this_class)
+ return FALSE; /* previous char is in same word */
+ }
+#endif
+ else
+ {
+ if (!vim_iswordc(c)
+ || (reginput > regline && vim_iswordc(reginput[-1])))
+ return FALSE;
+ }
+ break;
+
+ case EOW: /* word\>; reginput points after d */
+ if (reginput == regline) /* Can't match at start of line */
+ return FALSE;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int this_class, prev_class;
+
+ /* Get class of current and previous char (if it exists). */
+ this_class = mb_get_class(reginput);
+ prev_class = reg_prev_class();
+ if (this_class == prev_class)
+ return FALSE;
+ if (prev_class == 0 || prev_class == 1)
+ return FALSE;
+ }
+ else
+#endif
+ {
+ if (!vim_iswordc(reginput[-1]))
+ return FALSE;
+ if (reginput[0] != NUL && vim_iswordc(c))
+ return FALSE;
+ }
+ break; /* Matched with EOW */
+
+ case ANY:
+ if (c == NUL)
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case IDENT:
+ if (!vim_isIDc(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case SIDENT:
+ if (VIM_ISDIGIT(*reginput) || !vim_isIDc(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case KWORD:
+ if (!vim_iswordp(reginput))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case SKWORD:
+ if (VIM_ISDIGIT(*reginput) || !vim_iswordp(reginput))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case FNAME:
+ if (!vim_isfilec(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case SFNAME:
+ if (VIM_ISDIGIT(*reginput) || !vim_isfilec(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case PRINT:
+ if (ptr2cells(reginput) != 1)
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case SPRINT:
+ if (VIM_ISDIGIT(*reginput) || ptr2cells(reginput) != 1)
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case WHITE:
+ if (!vim_iswhite(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NWHITE:
+ if (c == NUL || vim_iswhite(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case DIGIT:
+ if (!ri_digit(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NDIGIT:
+ if (c == NUL || ri_digit(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case HEX:
+ if (!ri_hex(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NHEX:
+ if (c == NUL || ri_hex(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case OCTAL:
+ if (!ri_octal(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NOCTAL:
+ if (c == NUL || ri_octal(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case WORD:
+ if (!ri_word(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NWORD:
+ if (c == NUL || ri_word(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case HEAD:
+ if (!ri_head(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NHEAD:
+ if (c == NUL || ri_head(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case ALPHA:
+ if (!ri_alpha(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NALPHA:
+ if (c == NUL || ri_alpha(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case LOWER:
+ if (!ri_lower(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NLOWER:
+ if (c == NUL || ri_lower(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case UPPER:
+ if (!ri_upper(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case NUPPER:
+ if (c == NUL || ri_upper(c))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+ case EXACTLY:
+ {
+ int len;
+ char_u *opnd;
+
+ opnd = OPERAND(scan);
+ /* Inline the first byte, for speed. */
+ if (*opnd != *reginput
+ && (!ireg_ic || (
+#ifdef FEAT_MBYTE
+ !enc_utf8 &&
+#endif
+ TOLOWER_LOC(*opnd) != TOLOWER_LOC(*reginput))))
+ return FALSE;
+ if (*opnd == NUL)
+ {
+ /* match empty string always works; happens when "~" is
+ * empty. */
+ }
+ else if (opnd[1] == NUL
+#ifdef FEAT_MBYTE
+ && !(enc_utf8 && ireg_ic)
+#endif
+ )
+ ++reginput; /* matched a single char */
+ else
+ {
+ len = (int)STRLEN(opnd);
+ /* Need to match first byte again for multi-byte. */
+ if (cstrncmp(opnd, reginput, &len) != 0)
+ return FALSE;
+#ifdef FEAT_MBYTE
+ /* Check for following composing character. */
+ if (enc_utf8 && UTF_COMPOSINGLIKE(reginput, reginput + len))
+ {
+ /* raaron: This code makes a composing character get
+ * ignored, which is the correct behavior (sometimes)
+ * for voweled Hebrew texts. */
+ if (!ireg_icombine)
+ return FALSE;
+ }
+ else
+#endif
+ reginput += len;
+ }
+ }
+ break;
+
+ case ANYOF:
+ case ANYBUT:
+ if (c == NUL)
+ return FALSE;
+ if ((cstrchr(OPERAND(scan), c) == NULL) == (op == ANYOF))
+ return FALSE;
+ ADVANCE_REGINPUT();
+ break;
+
+#ifdef FEAT_MBYTE
+ case MULTIBYTECODE:
+ if (has_mbyte)
+ {
+ int i, len;
+ char_u *opnd;
+
+ opnd = OPERAND(scan);
+ /* Safety check (just in case 'encoding' was changed since
+ * compiling the program). */
+ if ((len = (*mb_ptr2len_check)(opnd)) < 2)
+ return FALSE;
+ for (i = 0; i < len; ++i)
+ if (opnd[i] != reginput[i])
+ return FALSE;
+ reginput += len;
+ }
+ else
+ return FALSE;
+ break;
+#endif
+
+ case NOTHING:
+ break;
+
+ case BACK:
+ break;
+
+ case MOPEN + 0: /* Match start: \zs */
+ case MOPEN + 1: /* \( */
+ case MOPEN + 2:
+ case MOPEN + 3:
+ case MOPEN + 4:
+ case MOPEN + 5:
+ case MOPEN + 6:
+ case MOPEN + 7:
+ case MOPEN + 8:
+ case MOPEN + 9:
+ {
+ int no;
+ save_se_T save;
+
+ no = op - MOPEN;
+ cleanup_subexpr();
+ save_se(&save, &reg_startpos[no], &reg_startp[no]);
+
+ if (regmatch(next))
+ return TRUE;
+
+ restore_se(&save, &reg_startpos[no], &reg_startp[no]);
+ return FALSE;
+ }
+ /* break; Not Reached */
+
+ case NOPEN: /* \%( */
+ case NCLOSE: /* \) after \%( */
+ if (regmatch(next))
+ return TRUE;
+ return FALSE;
+ /* break; Not Reached */
+
+#ifdef FEAT_SYN_HL
+ case ZOPEN + 1:
+ case ZOPEN + 2:
+ case ZOPEN + 3:
+ case ZOPEN + 4:
+ case ZOPEN + 5:
+ case ZOPEN + 6:
+ case ZOPEN + 7:
+ case ZOPEN + 8:
+ case ZOPEN + 9:
+ {
+ int no;
+ save_se_T save;
+
+ no = op - ZOPEN;
+ cleanup_zsubexpr();
+ save_se(&save, &reg_startzpos[no], &reg_startzp[no]);
+
+ if (regmatch(next))
+ return TRUE;
+
+ restore_se(&save, &reg_startzpos[no], &reg_startzp[no]);
+ return FALSE;
+ }
+ /* break; Not Reached */
+#endif
+
+ case MCLOSE + 0: /* Match end: \ze */
+ case MCLOSE + 1: /* \) */
+ case MCLOSE + 2:
+ case MCLOSE + 3:
+ case MCLOSE + 4:
+ case MCLOSE + 5:
+ case MCLOSE + 6:
+ case MCLOSE + 7:
+ case MCLOSE + 8:
+ case MCLOSE + 9:
+ {
+ int no;
+ save_se_T save;
+
+ no = op - MCLOSE;
+ cleanup_subexpr();
+ save_se(&save, &reg_endpos[no], &reg_endp[no]);
+
+ if (regmatch(next))
+ return TRUE;
+
+ restore_se(&save, &reg_endpos[no], &reg_endp[no]);
+ return FALSE;
+ }
+ /* break; Not Reached */
+
+#ifdef FEAT_SYN_HL
+ case ZCLOSE + 1: /* \) after \z( */
+ case ZCLOSE + 2:
+ case ZCLOSE + 3:
+ case ZCLOSE + 4:
+ case ZCLOSE + 5:
+ case ZCLOSE + 6:
+ case ZCLOSE + 7:
+ case ZCLOSE + 8:
+ case ZCLOSE + 9:
+ {
+ int no;
+ save_se_T save;
+
+ no = op - ZCLOSE;
+ cleanup_zsubexpr();
+ save_se(&save, &reg_endzpos[no], &reg_endzp[no]);
+
+ if (regmatch(next))
+ return TRUE;
+
+ restore_se(&save, &reg_endzpos[no], &reg_endzp[no]);
+ return FALSE;
+ }
+ /* break; Not Reached */
+#endif
+
+ case BACKREF + 1:
+ case BACKREF + 2:
+ case BACKREF + 3:
+ case BACKREF + 4:
+ case BACKREF + 5:
+ case BACKREF + 6:
+ case BACKREF + 7:
+ case BACKREF + 8:
+ case BACKREF + 9:
+ {
+ int no;
+ int len;
+ linenr_T clnum;
+ colnr_T ccol;
+ char_u *p;
+
+ no = op - BACKREF;
+ cleanup_subexpr();
+ if (!REG_MULTI) /* Single-line regexp */
+ {
+ if (reg_endp[no] == NULL)
+ {
+ /* Backref was not set: Match an empty string. */
+ len = 0;
+ }
+ else
+ {
+ /* Compare current input with back-ref in the same
+ * line. */
+ len = (int)(reg_endp[no] - reg_startp[no]);
+ if (cstrncmp(reg_startp[no], reginput, &len) != 0)
+ return FALSE;
+ }
+ }
+ else /* Multi-line regexp */
+ {
+ if (reg_endpos[no].lnum < 0)
+ {
+ /* Backref was not set: Match an empty string. */
+ len = 0;
+ }
+ else
+ {
+ if (reg_startpos[no].lnum == reglnum
+ && reg_endpos[no].lnum == reglnum)
+ {
+ /* Compare back-ref within the current line. */
+ len = reg_endpos[no].col - reg_startpos[no].col;
+ if (cstrncmp(regline + reg_startpos[no].col,
+ reginput, &len) != 0)
+ return FALSE;
+ }
+ else
+ {
+ /* Messy situation: Need to compare between two
+ * lines. */
+ ccol = reg_startpos[no].col;
+ clnum = reg_startpos[no].lnum;
+ for (;;)
+ {
+ /* Since getting one line may invalidate
+ * the other, need to make copy. Slow! */
+ if (regline != reg_tofree)
+ {
+ len = (int)STRLEN(regline);
+ if (reg_tofree == NULL
+ || len >= (int)reg_tofreelen)
+ {
+ len += 50; /* get some extra */
+ vim_free(reg_tofree);
+ reg_tofree = alloc(len);
+ if (reg_tofree == NULL)
+ return FALSE; /* out of memory! */
+ reg_tofreelen = len;
+ }
+ STRCPY(reg_tofree, regline);
+ reginput = reg_tofree
+ + (reginput - regline);
+ regline = reg_tofree;
+ }
+
+ /* Get the line to compare with. */
+ p = reg_getline(clnum);
+ if (clnum == reg_endpos[no].lnum)
+ len = reg_endpos[no].col - ccol;
+ else
+ len = (int)STRLEN(p + ccol);
+
+ if (cstrncmp(p + ccol, reginput, &len) != 0)
+ return FALSE; /* doesn't match */
+ if (clnum == reg_endpos[no].lnum)
+ break; /* match and at end! */
+ if (reglnum == reg_maxline)
+ return FALSE; /* text too short */
+
+ /* Advance to next line. */
+ reg_nextline();
+ ++clnum;
+ ccol = 0;
+ if (got_int || out_of_stack)
+ return FALSE;
+ }
+
+ /* found a match! Note that regline may now point
+ * to a copy of the line, that should not matter. */
+ }
+ }
+ }
+
+ /* Matched the backref, skip over it. */
+ reginput += len;
+ }
+ break;
+
+#ifdef FEAT_SYN_HL
+ case ZREF + 1:
+ case ZREF + 2:
+ case ZREF + 3:
+ case ZREF + 4:
+ case ZREF + 5:
+ case ZREF + 6:
+ case ZREF + 7:
+ case ZREF + 8:
+ case ZREF + 9:
+ {
+ int no;
+ int len;
+
+ cleanup_zsubexpr();
+ no = op - ZREF;
+ if (re_extmatch_in != NULL
+ && re_extmatch_in->matches[no] != NULL)
+ {
+ len = (int)STRLEN(re_extmatch_in->matches[no]);
+ if (cstrncmp(re_extmatch_in->matches[no],
+ reginput, &len) != 0)
+ return FALSE;
+ reginput += len;
+ }
+ else
+ {
+ /* Backref was not set: Match an empty string. */
+ }
+ }
+ break;
+#endif
+
+ case BRANCH:
+ {
+ if (OP(next) != BRANCH) /* No choice. */
+ next = OPERAND(scan); /* Avoid recursion. */
+ else
+ {
+ regsave_T save;
+
+ do
+ {
+ reg_save(&save);
+ if (regmatch(OPERAND(scan)))
+ return TRUE;
+ reg_restore(&save);
+ scan = regnext(scan);
+ } while (scan != NULL && OP(scan) == BRANCH);
+ return FALSE;
+ /* NOTREACHED */
+ }
+ }
+ break;
+
+ case BRACE_LIMITS:
+ {
+ int no;
+
+ if (OP(next) == BRACE_SIMPLE)
+ {
+ bl_minval = OPERAND_MIN(scan);
+ bl_maxval = OPERAND_MAX(scan);
+ }
+ else if (OP(next) >= BRACE_COMPLEX
+ && OP(next) < BRACE_COMPLEX + 10)
+ {
+ no = OP(next) - BRACE_COMPLEX;
+ brace_min[no] = OPERAND_MIN(scan);
+ brace_max[no] = OPERAND_MAX(scan);
+ brace_count[no] = 0;
+ }
+ else
+ {
+ EMSG(_(e_internal)); /* Shouldn't happen */
+ return FALSE;
+ }
+ }
+ break;
+
+ case BRACE_COMPLEX + 0:
+ case BRACE_COMPLEX + 1:
+ case BRACE_COMPLEX + 2:
+ case BRACE_COMPLEX + 3:
+ case BRACE_COMPLEX + 4:
+ case BRACE_COMPLEX + 5:
+ case BRACE_COMPLEX + 6:
+ case BRACE_COMPLEX + 7:
+ case BRACE_COMPLEX + 8:
+ case BRACE_COMPLEX + 9:
+ {
+ int no;
+ regsave_T save;
+
+ no = op - BRACE_COMPLEX;
+ ++brace_count[no];
+
+ /* If not matched enough times yet, try one more */
+ if (brace_count[no] <= (brace_min[no] <= brace_max[no]
+ ? brace_min[no] : brace_max[no]))
+ {
+ reg_save(&save);
+ if (regmatch(OPERAND(scan)))
+ return TRUE;
+ reg_restore(&save);
+ --brace_count[no]; /* failed, decrement match count */
+ return FALSE;
+ }
+
+ /* If matched enough times, may try matching some more */
+ if (brace_min[no] <= brace_max[no])
+ {
+ /* Range is the normal way around, use longest match */
+ if (brace_count[no] <= brace_max[no])
+ {
+ reg_save(&save);
+ if (regmatch(OPERAND(scan)))
+ return TRUE; /* matched some more times */
+ reg_restore(&save);
+ --brace_count[no]; /* matched just enough times */
+ /* continue with the items after \{} */
+ }
+ }
+ else
+ {
+ /* Range is backwards, use shortest match first */
+ if (brace_count[no] <= brace_min[no])
+ {
+ reg_save(&save);
+ if (regmatch(next))
+ return TRUE;
+ reg_restore(&save);
+ next = OPERAND(scan);
+ /* must try to match one more item */
+ }
+ }
+ }
+ break;
+
+ case BRACE_SIMPLE:
+ case STAR:
+ case PLUS:
+ {
+ int nextb; /* next byte */
+ int nextb_ic; /* next byte reverse case */
+ long count;
+ regsave_T save;
+ long minval;
+ long maxval;
+
+ /*
+ * Lookahead to avoid useless match attempts when we know
+ * what character comes next.
+ */
+ if (OP(next) == EXACTLY)
+ {
+ nextb = *OPERAND(next);
+ if (ireg_ic)
+ {
+ if (isupper(nextb))
+ nextb_ic = TOLOWER_LOC(nextb);
+ else
+ nextb_ic = TOUPPER_LOC(nextb);
+ }
+ else
+ nextb_ic = nextb;
+ }
+ else
+ {
+ nextb = NUL;
+ nextb_ic = NUL;
+ }
+ if (op != BRACE_SIMPLE)
+ {
+ minval = (op == STAR) ? 0 : 1;
+ maxval = MAX_LIMIT;
+ }
+ else
+ {
+ minval = bl_minval;
+ maxval = bl_maxval;
+ }
+
+ /*
+ * When maxval > minval, try matching as much as possible, up
+ * to maxval. When maxval < minval, try matching at least the
+ * minimal number (since the range is backwards, that's also
+ * maxval!).
+ */
+ count = regrepeat(OPERAND(scan), maxval);
+ if (got_int)
+ return FALSE;
+ if (minval <= maxval)
+ {
+ /* Range is the normal way around, use longest match */
+ while (count >= minval)
+ {
+ /* If it could match, try it. */
+ if (nextb == NUL || *reginput == nextb
+ || *reginput == nextb_ic)
+ {
+ reg_save(&save);
+ if (regmatch(next))
+ return TRUE;
+ reg_restore(&save);
+ }
+ /* Couldn't or didn't match -- back up one char. */
+ if (--count < minval)
+ break;
+ if (reginput == regline)
+ {
+ /* backup to last char of previous line */
+ --reglnum;
+ regline = reg_getline(reglnum);
+ /* Just in case regrepeat() didn't count right. */
+ if (regline == NULL)
+ return FALSE;
+ reginput = regline + STRLEN(regline);
+ fast_breakcheck();
+ if (got_int || out_of_stack)
+ return FALSE;
+ }
+ else
+ {
+ --reginput;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ reginput -= (*mb_head_off)(regline, reginput);
+#endif
+ }
+ }
+ }
+ else
+ {
+ /* Range is backwards, use shortest match first.
+ * Careful: maxval and minval are exchanged! */
+ if (count < maxval)
+ return FALSE;
+ for (;;)
+ {
+ /* If it could work, try it. */
+ if (nextb == NUL || *reginput == nextb
+ || *reginput == nextb_ic)
+ {
+ reg_save(&save);
+ if (regmatch(next))
+ return TRUE;
+ reg_restore(&save);
+ }
+ /* Couldn't or didn't match: try advancing one char. */
+ if (count == minval
+ || regrepeat(OPERAND(scan), 1L) == 0)
+ break;
+ ++count;
+ if (got_int || out_of_stack)
+ return FALSE;
+ }
+ }
+ return FALSE;
+ }
+ /* break; Not Reached */
+
+ case NOMATCH:
+ {
+ regsave_T save;
+
+ /* If the operand matches, we fail. Otherwise backup and
+ * continue with the next item. */
+ reg_save(&save);
+ if (regmatch(OPERAND(scan)))
+ return FALSE;
+ reg_restore(&save);
+ }
+ break;
+
+ case MATCH:
+ case SUBPAT:
+ {
+ regsave_T save;
+
+ /* If the operand doesn't match, we fail. Otherwise backup
+ * and continue with the next item. */
+ reg_save(&save);
+ if (!regmatch(OPERAND(scan)))
+ return FALSE;
+ if (op == MATCH) /* zero-width */
+ reg_restore(&save);
+ }
+ break;
+
+ case BEHIND:
+ case NOBEHIND:
+ {
+ regsave_T save_after, save_start;
+ regsave_T save_behind_pos;
+ int needmatch = (op == BEHIND);
+
+ /*
+ * Look back in the input of the operand matches or not. This
+ * must be done at every position in the input and checking if
+ * the match ends at the current position.
+ * First check if the next item matches, that's probably
+ * faster.
+ */
+ reg_save(&save_start);
+ if (regmatch(next))
+ {
+ /* save the position after the found match for next */
+ reg_save(&save_after);
+
+ /* start looking for a match with operand at the current
+ * postion. Go back one character until we find the
+ * result, hitting the start of the line or the previous
+ * line (for multi-line matching).
+ * Set behind_pos to where the match should end, BHPOS
+ * will match it. */
+ save_behind_pos = behind_pos;
+ behind_pos = save_start;
+ for (;;)
+ {
+ reg_restore(&save_start);
+ if (regmatch(OPERAND(scan))
+ && reg_save_equal(&behind_pos))
+ {
+ behind_pos = save_behind_pos;
+ /* found a match that ends where "next" started */
+ if (needmatch)
+ {
+ reg_restore(&save_after);
+ return TRUE;
+ }
+ return FALSE;
+ }
+ /*
+ * No match: Go back one character. May go to
+ * previous line once.
+ */
+ if (REG_MULTI)
+ {
+ if (save_start.rs_u.pos.col == 0)
+ {
+ if (save_start.rs_u.pos.lnum
+ < behind_pos.rs_u.pos.lnum
+ || reg_getline(
+ --save_start.rs_u.pos.lnum) == NULL)
+ break;
+ reg_restore(&save_start);
+ save_start.rs_u.pos.col =
+ (colnr_T)STRLEN(regline);
+ }
+ else
+ --save_start.rs_u.pos.col;
+ }
+ else
+ {
+ if (save_start.rs_u.ptr == regline)
+ break;
+ --save_start.rs_u.ptr;
+ }
+ }
+
+ /* NOBEHIND succeeds when no match was found */
+ behind_pos = save_behind_pos;
+ if (!needmatch)
+ {
+ reg_restore(&save_after);
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+
+ case BHPOS:
+ if (REG_MULTI)
+ {
+ if (behind_pos.rs_u.pos.col != (colnr_T)(reginput - regline)
+ || behind_pos.rs_u.pos.lnum != reglnum)
+ return FALSE;
+ }
+ else if (behind_pos.rs_u.ptr != reginput)
+ return FALSE;
+ break;
+
+ case NEWL:
+ if ((c != NUL || reglnum == reg_maxline)
+ && (c != '\n' || !reg_line_lbr))
+ return FALSE;
+ if (reg_line_lbr)
+ ADVANCE_REGINPUT();
+ else
+ reg_nextline();
+ break;
+
+ case END:
+ return TRUE; /* Success! */
+
+ default:
+ EMSG(_(e_re_corr));
+#ifdef DEBUG
+ printf("Illegal op code %d\n", op);
+#endif
+ return FALSE;
+ }
+ }
+
+ scan = next;
+ }
+
+ /*
+ * We get here only if there's trouble -- normally "case END" is the
+ * terminating point.
+ */
+ EMSG(_(e_re_corr));
+#ifdef DEBUG
+ printf("Premature EOL\n");
+#endif
+ return FALSE;
+}
+
+#ifdef FEAT_MBYTE
+# define ADVANCE_P(x) if (has_mbyte) x += (*mb_ptr2len_check)(x); else ++x
+#else
+# define ADVANCE_P(x) ++x
+#endif
+
+/*
+ * regrepeat - repeatedly match something simple, return how many.
+ * Advances reginput (and reglnum) to just after the matched chars.
+ */
+ static int
+regrepeat(p, maxcount)
+ char_u *p;
+ long maxcount; /* maximum number of matches allowed */
+{
+ long count = 0;
+ char_u *scan;
+ char_u *opnd;
+ int mask;
+ int testval = 0;
+
+ scan = reginput; /* Make local copy of reginput for speed. */
+ opnd = OPERAND(p);
+ switch (OP(p))
+ {
+ case ANY:
+ case ANY + ADD_NL:
+ while (count < maxcount)
+ {
+ /* Matching anything means we continue until end-of-line (or
+ * end-of-file for ANY + ADD_NL), only limited by maxcount. */
+ while (*scan != NUL && count < maxcount)
+ {
+ ++count;
+ ADVANCE_P(scan);
+ }
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline || count == maxcount)
+ break;
+ ++count; /* count the line-break */
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ break;
+
+ case IDENT:
+ case IDENT + ADD_NL:
+ testval = TRUE;
+ /*FALLTHROUGH*/
+ case SIDENT:
+ case SIDENT + ADD_NL:
+ while (count < maxcount)
+ {
+ if (vim_isIDc(*scan) && (testval || !VIM_ISDIGIT(*scan)))
+ {
+ ADVANCE_P(scan);
+ }
+ else if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+ else
+ break;
+ ++count;
+ }
+ break;
+
+ case KWORD:
+ case KWORD + ADD_NL:
+ testval = TRUE;
+ /*FALLTHROUGH*/
+ case SKWORD:
+ case SKWORD + ADD_NL:
+ while (count < maxcount)
+ {
+ if (vim_iswordp(scan) && (testval || !VIM_ISDIGIT(*scan)))
+ {
+ ADVANCE_P(scan);
+ }
+ else if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+ else
+ break;
+ ++count;
+ }
+ break;
+
+ case FNAME:
+ case FNAME + ADD_NL:
+ testval = TRUE;
+ /*FALLTHROUGH*/
+ case SFNAME:
+ case SFNAME + ADD_NL:
+ while (count < maxcount)
+ {
+ if (vim_isfilec(*scan) && (testval || !VIM_ISDIGIT(*scan)))
+ {
+ ADVANCE_P(scan);
+ }
+ else if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+ else
+ break;
+ ++count;
+ }
+ break;
+
+ case PRINT:
+ case PRINT + ADD_NL:
+ testval = TRUE;
+ /*FALLTHROUGH*/
+ case SPRINT:
+ case SPRINT + ADD_NL:
+ while (count < maxcount)
+ {
+ if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ else if (ptr2cells(scan) == 1 && (testval || !VIM_ISDIGIT(*scan)))
+ {
+ ADVANCE_P(scan);
+ }
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+ else
+ break;
+ ++count;
+ }
+ break;
+
+ case WHITE:
+ case WHITE + ADD_NL:
+ testval = mask = RI_WHITE;
+do_class:
+ while (count < maxcount)
+ {
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+ if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte && (l = (*mb_ptr2len_check)(scan)) > 1)
+ {
+ if (testval != 0)
+ break;
+ scan += l;
+ }
+#endif
+ else if ((class_tab[*scan] & mask) == testval)
+ ++scan;
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+ else
+ break;
+ ++count;
+ }
+ break;
+
+ case NWHITE:
+ case NWHITE + ADD_NL:
+ mask = RI_WHITE;
+ goto do_class;
+ case DIGIT:
+ case DIGIT + ADD_NL:
+ testval = mask = RI_DIGIT;
+ goto do_class;
+ case NDIGIT:
+ case NDIGIT + ADD_NL:
+ mask = RI_DIGIT;
+ goto do_class;
+ case HEX:
+ case HEX + ADD_NL:
+ testval = mask = RI_HEX;
+ goto do_class;
+ case NHEX:
+ case NHEX + ADD_NL:
+ mask = RI_HEX;
+ goto do_class;
+ case OCTAL:
+ case OCTAL + ADD_NL:
+ testval = mask = RI_OCTAL;
+ goto do_class;
+ case NOCTAL:
+ case NOCTAL + ADD_NL:
+ mask = RI_OCTAL;
+ goto do_class;
+ case WORD:
+ case WORD + ADD_NL:
+ testval = mask = RI_WORD;
+ goto do_class;
+ case NWORD:
+ case NWORD + ADD_NL:
+ mask = RI_WORD;
+ goto do_class;
+ case HEAD:
+ case HEAD + ADD_NL:
+ testval = mask = RI_HEAD;
+ goto do_class;
+ case NHEAD:
+ case NHEAD + ADD_NL:
+ mask = RI_HEAD;
+ goto do_class;
+ case ALPHA:
+ case ALPHA + ADD_NL:
+ testval = mask = RI_ALPHA;
+ goto do_class;
+ case NALPHA:
+ case NALPHA + ADD_NL:
+ mask = RI_ALPHA;
+ goto do_class;
+ case LOWER:
+ case LOWER + ADD_NL:
+ testval = mask = RI_LOWER;
+ goto do_class;
+ case NLOWER:
+ case NLOWER + ADD_NL:
+ mask = RI_LOWER;
+ goto do_class;
+ case UPPER:
+ case UPPER + ADD_NL:
+ testval = mask = RI_UPPER;
+ goto do_class;
+ case NUPPER:
+ case NUPPER + ADD_NL:
+ mask = RI_UPPER;
+ goto do_class;
+
+ case EXACTLY:
+ {
+ int cu, cl;
+
+ /* This doesn't do a multi-byte character, because a MULTIBYTECODE
+ * would have been used for it. */
+ if (ireg_ic)
+ {
+ cu = TOUPPER_LOC(*opnd);
+ cl = TOLOWER_LOC(*opnd);
+ while (count < maxcount && (*scan == cu || *scan == cl))
+ {
+ count++;
+ scan++;
+ }
+ }
+ else
+ {
+ cu = *opnd;
+ while (count < maxcount && *scan == cu)
+ {
+ count++;
+ scan++;
+ }
+ }
+ break;
+ }
+
+#ifdef FEAT_MBYTE
+ case MULTIBYTECODE:
+ {
+ int i, len, cf = 0;
+
+ /* Safety check (just in case 'encoding' was changed since
+ * compiling the program). */
+ if ((len = (*mb_ptr2len_check)(opnd)) > 1)
+ {
+ if (ireg_ic && enc_utf8)
+ cf = utf_fold(utf_ptr2char(opnd));
+ while (count < maxcount)
+ {
+ for (i = 0; i < len; ++i)
+ if (opnd[i] != scan[i])
+ break;
+ if (i < len && (!ireg_ic || !enc_utf8
+ || utf_fold(utf_ptr2char(scan)) != cf))
+ break;
+ scan += len;
+ ++count;
+ }
+ }
+ }
+ break;
+#endif
+
+ case ANYOF:
+ case ANYOF + ADD_NL:
+ testval = TRUE;
+ /*FALLTHROUGH*/
+
+ case ANYBUT:
+ case ANYBUT + ADD_NL:
+ while (count < maxcount)
+ {
+#ifdef FEAT_MBYTE
+ int len;
+#endif
+ if (*scan == NUL)
+ {
+ if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
+ break;
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ else if (reg_line_lbr && *scan == '\n' && WITH_NL(OP(p)))
+ ++scan;
+#ifdef FEAT_MBYTE
+ else if (has_mbyte && (len = (*mb_ptr2len_check)(scan)) > 1)
+ {
+ if ((cstrchr(opnd, (*mb_ptr2char)(scan)) == NULL) == testval)
+ break;
+ scan += len;
+ }
+#endif
+ else
+ {
+ if ((cstrchr(opnd, *scan) == NULL) == testval)
+ break;
+ ++scan;
+ }
+ ++count;
+ }
+ break;
+
+ case NEWL:
+ while (count < maxcount
+ && ((*scan == NUL && reglnum < reg_maxline)
+ || (*scan == '\n' && reg_line_lbr)))
+ {
+ count++;
+ if (reg_line_lbr)
+ ADVANCE_REGINPUT();
+ else
+ reg_nextline();
+ scan = reginput;
+ if (got_int)
+ break;
+ }
+ break;
+
+ default: /* Oh dear. Called inappropriately. */
+ EMSG(_(e_re_corr));
+#ifdef DEBUG
+ printf("Called regrepeat with op code %d\n", OP(p));
+#endif
+ break;
+ }
+
+ reginput = scan;
+
+ return (int)count;
+}
+
+/*
+ * regnext - dig the "next" pointer out of a node
+ */
+ static char_u *
+regnext(p)
+ char_u *p;
+{
+ int offset;
+
+ if (p == JUST_CALC_SIZE)
+ return NULL;
+
+ offset = NEXT(p);
+ if (offset == 0)
+ return NULL;
+
+ if (OP(p) == BACK)
+ return p - offset;
+ else
+ return p + offset;
+}
+
+/*
+ * Check the regexp program for its magic number.
+ * Return TRUE if it's wrong.
+ */
+ static int
+prog_magic_wrong()
+{
+ if (UCHARAT(REG_MULTI
+ ? reg_mmatch->regprog->program
+ : reg_match->regprog->program) != REGMAGIC)
+ {
+ EMSG(_(e_re_corr));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Cleanup the subexpressions, if this wasn't done yet.
+ * This construction is used to clear the subexpressions only when they are
+ * used (to increase speed).
+ */
+ static void
+cleanup_subexpr()
+{
+ if (need_clear_subexpr)
+ {
+ if (REG_MULTI)
+ {
+ /* Use 0xff to set lnum to -1 */
+ vim_memset(reg_startpos, 0xff, sizeof(lpos_T) * NSUBEXP);
+ vim_memset(reg_endpos, 0xff, sizeof(lpos_T) * NSUBEXP);
+ }
+ else
+ {
+ vim_memset(reg_startp, 0, sizeof(char_u *) * NSUBEXP);
+ vim_memset(reg_endp, 0, sizeof(char_u *) * NSUBEXP);
+ }
+ need_clear_subexpr = FALSE;
+ }
+}
+
+#ifdef FEAT_SYN_HL
+ static void
+cleanup_zsubexpr()
+{
+ if (need_clear_zsubexpr)
+ {
+ if (REG_MULTI)
+ {
+ /* Use 0xff to set lnum to -1 */
+ vim_memset(reg_startzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
+ vim_memset(reg_endzpos, 0xff, sizeof(lpos_T) * NSUBEXP);
+ }
+ else
+ {
+ vim_memset(reg_startzp, 0, sizeof(char_u *) * NSUBEXP);
+ vim_memset(reg_endzp, 0, sizeof(char_u *) * NSUBEXP);
+ }
+ need_clear_zsubexpr = FALSE;
+ }
+}
+#endif
+
+/*
+ * Advance reglnum, regline and reginput to the next line.
+ */
+ static void
+reg_nextline()
+{
+ regline = reg_getline(++reglnum);
+ reginput = regline;
+ fast_breakcheck();
+}
+
+/*
+ * Save the input line and position in a regsave_T.
+ */
+ static void
+reg_save(save)
+ regsave_T *save;
+{
+ if (REG_MULTI)
+ {
+ save->rs_u.pos.col = (colnr_T)(reginput - regline);
+ save->rs_u.pos.lnum = reglnum;
+ }
+ else
+ save->rs_u.ptr = reginput;
+}
+
+/*
+ * Restore the input line and position from a regsave_T.
+ */
+ static void
+reg_restore(save)
+ regsave_T *save;
+{
+ if (REG_MULTI)
+ {
+ if (reglnum != save->rs_u.pos.lnum)
+ {
+ /* only call reg_getline() when the line number changed to save
+ * a bit of time */
+ reglnum = save->rs_u.pos.lnum;
+ regline = reg_getline(reglnum);
+ }
+ reginput = regline + save->rs_u.pos.col;
+ }
+ else
+ reginput = save->rs_u.ptr;
+}
+
+/*
+ * Return TRUE if current position is equal to saved position.
+ */
+ static int
+reg_save_equal(save)
+ regsave_T *save;
+{
+ if (REG_MULTI)
+ return reglnum == save->rs_u.pos.lnum
+ && reginput == regline + save->rs_u.pos.col;
+ return reginput == save->rs_u.ptr;
+}
+
+/*
+ * Tentatively set the sub-expression start to the current position (after
+ * calling regmatch() they will have changed). Need to save the existing
+ * values for when there is no match.
+ * Use se_save() to use pointer (save_se_multi()) or position (save_se_one()),
+ * depending on REG_MULTI.
+ */
+ static void
+save_se_multi(savep, posp)
+ save_se_T *savep;
+ lpos_T *posp;
+{
+ savep->se_u.pos = *posp;
+ posp->lnum = reglnum;
+ posp->col = (colnr_T)(reginput - regline);
+}
+
+ static void
+save_se_one(savep, pp)
+ save_se_T *savep;
+ char_u **pp;
+{
+ savep->se_u.ptr = *pp;
+ *pp = reginput;
+}
+
+/*
+ * Compare a number with the operand of RE_LNUM, RE_COL or RE_VCOL.
+ */
+ static int
+re_num_cmp(val, scan)
+ long_u val;
+ char_u *scan;
+{
+ long_u n = OPERAND_MIN(scan);
+
+ if (OPERAND_CMP(scan) == '>')
+ return val > n;
+ if (OPERAND_CMP(scan) == '<')
+ return val < n;
+ return val == n;
+}
+
+
+#ifdef DEBUG
+
+/*
+ * regdump - dump a regexp onto stdout in vaguely comprehensible form
+ */
+ static void
+regdump(pattern, r)
+ char_u *pattern;
+ regprog_T *r;
+{
+ char_u *s;
+ int op = EXACTLY; /* Arbitrary non-END op. */
+ char_u *next;
+ char_u *end = NULL;
+
+ printf("\r\nregcomp(%s):\r\n", pattern);
+
+ s = r->program + 1;
+ /*
+ * Loop until we find the END that isn't before a referred next (an END
+ * can also appear in a NOMATCH operand).
+ */
+ while (op != END || s <= end)
+ {
+ op = OP(s);
+ printf("%2d%s", (int)(s - r->program), regprop(s)); /* Where, what. */
+ next = regnext(s);
+ if (next == NULL) /* Next ptr. */
+ printf("(0)");
+ else
+ printf("(%d)", (int)((s - r->program) + (next - s)));
+ if (end < next)
+ end = next;
+ if (op == BRACE_LIMITS)
+ {
+ /* Two short ints */
+ printf(" minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s));
+ s += 8;
+ }
+ s += 3;
+ if (op == ANYOF || op == ANYOF + ADD_NL
+ || op == ANYBUT || op == ANYBUT + ADD_NL
+ || op == EXACTLY)
+ {
+ /* Literal string, where present. */
+ while (*s != NUL)
+ printf("%c", *s++);
+ s++;
+ }
+ printf("\r\n");
+ }
+
+ /* Header fields of interest. */
+ if (r->regstart != NUL)
+ printf("start `%s' 0x%x; ", r->regstart < 256
+ ? (char *)transchar(r->regstart)
+ : "multibyte", r->regstart);
+ if (r->reganch)
+ printf("anchored; ");
+ if (r->regmust != NULL)
+ printf("must have \"%s\"", r->regmust);
+ printf("\r\n");
+}
+
+/*
+ * regprop - printable representation of opcode
+ */
+ static char_u *
+regprop(op)
+ char_u *op;
+{
+ char_u *p;
+ static char_u buf[50];
+
+ (void) strcpy(buf, ":");
+
+ switch (OP(op))
+ {
+ case BOL:
+ p = "BOL";
+ break;
+ case EOL:
+ p = "EOL";
+ break;
+ case RE_BOF:
+ p = "BOF";
+ break;
+ case RE_EOF:
+ p = "EOF";
+ break;
+ case CURSOR:
+ p = "CURSOR";
+ break;
+ case RE_LNUM:
+ p = "RE_LNUM";
+ break;
+ case RE_COL:
+ p = "RE_COL";
+ break;
+ case RE_VCOL:
+ p = "RE_VCOL";
+ break;
+ case BOW:
+ p = "BOW";
+ break;
+ case EOW:
+ p = "EOW";
+ break;
+ case ANY:
+ p = "ANY";
+ break;
+ case ANY + ADD_NL:
+ p = "ANY+NL";
+ break;
+ case ANYOF:
+ p = "ANYOF";
+ break;
+ case ANYOF + ADD_NL:
+ p = "ANYOF+NL";
+ break;
+ case ANYBUT:
+ p = "ANYBUT";
+ break;
+ case ANYBUT + ADD_NL:
+ p = "ANYBUT+NL";
+ break;
+ case IDENT:
+ p = "IDENT";
+ break;
+ case IDENT + ADD_NL:
+ p = "IDENT+NL";
+ break;
+ case SIDENT:
+ p = "SIDENT";
+ break;
+ case SIDENT + ADD_NL:
+ p = "SIDENT+NL";
+ break;
+ case KWORD:
+ p = "KWORD";
+ break;
+ case KWORD + ADD_NL:
+ p = "KWORD+NL";
+ break;
+ case SKWORD:
+ p = "SKWORD";
+ break;
+ case SKWORD + ADD_NL:
+ p = "SKWORD+NL";
+ break;
+ case FNAME:
+ p = "FNAME";
+ break;
+ case FNAME + ADD_NL:
+ p = "FNAME+NL";
+ break;
+ case SFNAME:
+ p = "SFNAME";
+ break;
+ case SFNAME + ADD_NL:
+ p = "SFNAME+NL";
+ break;
+ case PRINT:
+ p = "PRINT";
+ break;
+ case PRINT + ADD_NL:
+ p = "PRINT+NL";
+ break;
+ case SPRINT:
+ p = "SPRINT";
+ break;
+ case SPRINT + ADD_NL:
+ p = "SPRINT+NL";
+ break;
+ case WHITE:
+ p = "WHITE";
+ break;
+ case WHITE + ADD_NL:
+ p = "WHITE+NL";
+ break;
+ case NWHITE:
+ p = "NWHITE";
+ break;
+ case NWHITE + ADD_NL:
+ p = "NWHITE+NL";
+ break;
+ case DIGIT:
+ p = "DIGIT";
+ break;
+ case DIGIT + ADD_NL:
+ p = "DIGIT+NL";
+ break;
+ case NDIGIT:
+ p = "NDIGIT";
+ break;
+ case NDIGIT + ADD_NL:
+ p = "NDIGIT+NL";
+ break;
+ case HEX:
+ p = "HEX";
+ break;
+ case HEX + ADD_NL:
+ p = "HEX+NL";
+ break;
+ case NHEX:
+ p = "NHEX";
+ break;
+ case NHEX + ADD_NL:
+ p = "NHEX+NL";
+ break;
+ case OCTAL:
+ p = "OCTAL";
+ break;
+ case OCTAL + ADD_NL:
+ p = "OCTAL+NL";
+ break;
+ case NOCTAL:
+ p = "NOCTAL";
+ break;
+ case NOCTAL + ADD_NL:
+ p = "NOCTAL+NL";
+ break;
+ case WORD:
+ p = "WORD";
+ break;
+ case WORD + ADD_NL:
+ p = "WORD+NL";
+ break;
+ case NWORD:
+ p = "NWORD";
+ break;
+ case NWORD + ADD_NL:
+ p = "NWORD+NL";
+ break;
+ case HEAD:
+ p = "HEAD";
+ break;
+ case HEAD + ADD_NL:
+ p = "HEAD+NL";
+ break;
+ case NHEAD:
+ p = "NHEAD";
+ break;
+ case NHEAD + ADD_NL:
+ p = "NHEAD+NL";
+ break;
+ case ALPHA:
+ p = "ALPHA";
+ break;
+ case ALPHA + ADD_NL:
+ p = "ALPHA+NL";
+ break;
+ case NALPHA:
+ p = "NALPHA";
+ break;
+ case NALPHA + ADD_NL:
+ p = "NALPHA+NL";
+ break;
+ case LOWER:
+ p = "LOWER";
+ break;
+ case LOWER + ADD_NL:
+ p = "LOWER+NL";
+ break;
+ case NLOWER:
+ p = "NLOWER";
+ break;
+ case NLOWER + ADD_NL:
+ p = "NLOWER+NL";
+ break;
+ case UPPER:
+ p = "UPPER";
+ break;
+ case UPPER + ADD_NL:
+ p = "UPPER+NL";
+ break;
+ case NUPPER:
+ p = "NUPPER";
+ break;
+ case NUPPER + ADD_NL:
+ p = "NUPPER+NL";
+ break;
+ case BRANCH:
+ p = "BRANCH";
+ break;
+ case EXACTLY:
+ p = "EXACTLY";
+ break;
+ case NOTHING:
+ p = "NOTHING";
+ break;
+ case BACK:
+ p = "BACK";
+ break;
+ case END:
+ p = "END";
+ break;
+ case MOPEN + 0:
+ p = "MATCH START";
+ break;
+ case MOPEN + 1:
+ case MOPEN + 2:
+ case MOPEN + 3:
+ case MOPEN + 4:
+ case MOPEN + 5:
+ case MOPEN + 6:
+ case MOPEN + 7:
+ case MOPEN + 8:
+ case MOPEN + 9:
+ sprintf(buf + STRLEN(buf), "MOPEN%d", OP(op) - MOPEN);
+ p = NULL;
+ break;
+ case MCLOSE + 0:
+ p = "MATCH END";
+ break;
+ case MCLOSE + 1:
+ case MCLOSE + 2:
+ case MCLOSE + 3:
+ case MCLOSE + 4:
+ case MCLOSE + 5:
+ case MCLOSE + 6:
+ case MCLOSE + 7:
+ case MCLOSE + 8:
+ case MCLOSE + 9:
+ sprintf(buf + STRLEN(buf), "MCLOSE%d", OP(op) - MCLOSE);
+ p = NULL;
+ break;
+ case BACKREF + 1:
+ case BACKREF + 2:
+ case BACKREF + 3:
+ case BACKREF + 4:
+ case BACKREF + 5:
+ case BACKREF + 6:
+ case BACKREF + 7:
+ case BACKREF + 8:
+ case BACKREF + 9:
+ sprintf(buf + STRLEN(buf), "BACKREF%d", OP(op) - BACKREF);
+ p = NULL;
+ break;
+ case NOPEN:
+ p = "NOPEN";
+ break;
+ case NCLOSE:
+ p = "NCLOSE";
+ break;
+#ifdef FEAT_SYN_HL
+ case ZOPEN + 1:
+ case ZOPEN + 2:
+ case ZOPEN + 3:
+ case ZOPEN + 4:
+ case ZOPEN + 5:
+ case ZOPEN + 6:
+ case ZOPEN + 7:
+ case ZOPEN + 8:
+ case ZOPEN + 9:
+ sprintf(buf + STRLEN(buf), "ZOPEN%d", OP(op) - ZOPEN);
+ p = NULL;
+ break;
+ case ZCLOSE + 1:
+ case ZCLOSE + 2:
+ case ZCLOSE + 3:
+ case ZCLOSE + 4:
+ case ZCLOSE + 5:
+ case ZCLOSE + 6:
+ case ZCLOSE + 7:
+ case ZCLOSE + 8:
+ case ZCLOSE + 9:
+ sprintf(buf + STRLEN(buf), "ZCLOSE%d", OP(op) - ZCLOSE);
+ p = NULL;
+ break;
+ case ZREF + 1:
+ case ZREF + 2:
+ case ZREF + 3:
+ case ZREF + 4:
+ case ZREF + 5:
+ case ZREF + 6:
+ case ZREF + 7:
+ case ZREF + 8:
+ case ZREF + 9:
+ sprintf(buf + STRLEN(buf), "ZREF%d", OP(op) - ZREF);
+ p = NULL;
+ break;
+#endif
+ case STAR:
+ p = "STAR";
+ break;
+ case PLUS:
+ p = "PLUS";
+ break;
+ case NOMATCH:
+ p = "NOMATCH";
+ break;
+ case MATCH:
+ p = "MATCH";
+ break;
+ case BEHIND:
+ p = "BEHIND";
+ break;
+ case NOBEHIND:
+ p = "NOBEHIND";
+ break;
+ case SUBPAT:
+ p = "SUBPAT";
+ break;
+ case BRACE_LIMITS:
+ p = "BRACE_LIMITS";
+ break;
+ case BRACE_SIMPLE:
+ p = "BRACE_SIMPLE";
+ break;
+ case BRACE_COMPLEX + 0:
+ case BRACE_COMPLEX + 1:
+ case BRACE_COMPLEX + 2:
+ case BRACE_COMPLEX + 3:
+ case BRACE_COMPLEX + 4:
+ case BRACE_COMPLEX + 5:
+ case BRACE_COMPLEX + 6:
+ case BRACE_COMPLEX + 7:
+ case BRACE_COMPLEX + 8:
+ case BRACE_COMPLEX + 9:
+ sprintf(buf + STRLEN(buf), "BRACE_COMPLEX%d", OP(op) - BRACE_COMPLEX);
+ p = NULL;
+ break;
+#ifdef FEAT_MBYTE
+ case MULTIBYTECODE:
+ p = "MULTIBYTECODE";
+ break;
+#endif
+ case NEWL:
+ p = "NEWL";
+ break;
+ default:
+ sprintf(buf + STRLEN(buf), "corrupt %d", OP(op));
+ p = NULL;
+ break;
+ }
+ if (p != NULL)
+ (void) strcat(buf, p);
+ return buf;
+}
+#endif
+
+#ifdef FEAT_MBYTE
+static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));
+
+typedef struct
+{
+ int a, b, c;
+} decomp_T;
+
+
+/* 0xfb20 - 0xfb4f */
+decomp_T decomp_table[0xfb4f-0xfb20+1] =
+{
+ {0x5e2,0,0}, /* 0xfb20 alt ayin */
+ {0x5d0,0,0}, /* 0xfb21 alt alef */
+ {0x5d3,0,0}, /* 0xfb22 alt dalet */
+ {0x5d4,0,0}, /* 0xfb23 alt he */
+ {0x5db,0,0}, /* 0xfb24 alt kaf */
+ {0x5dc,0,0}, /* 0xfb25 alt lamed */
+ {0x5dd,0,0}, /* 0xfb26 alt mem-sofit */
+ {0x5e8,0,0}, /* 0xfb27 alt resh */
+ {0x5ea,0,0}, /* 0xfb28 alt tav */
+ {'+', 0, 0}, /* 0xfb29 alt plus */
+ {0x5e9, 0x5c1, 0}, /* 0xfb2a shin+shin-dot */
+ {0x5e9, 0x5c2, 0}, /* 0xfb2b shin+sin-dot */
+ {0x5e9, 0x5c1, 0x5bc}, /* 0xfb2c shin+shin-dot+dagesh */
+ {0x5e9, 0x5c2, 0x5bc}, /* 0xfb2d shin+sin-dot+dagesh */
+ {0x5d0, 0x5b7, 0}, /* 0xfb2e alef+patah */
+ {0x5d0, 0x5b8, 0}, /* 0xfb2f alef+qamats */
+ {0x5d0, 0x5b4, 0}, /* 0xfb30 alef+hiriq */
+ {0x5d1, 0x5bc, 0}, /* 0xfb31 bet+dagesh */
+ {0x5d2, 0x5bc, 0}, /* 0xfb32 gimel+dagesh */
+ {0x5d3, 0x5bc, 0}, /* 0xfb33 dalet+dagesh */
+ {0x5d4, 0x5bc, 0}, /* 0xfb34 he+dagesh */
+ {0x5d5, 0x5bc, 0}, /* 0xfb35 vav+dagesh */
+ {0x5d6, 0x5bc, 0}, /* 0xfb36 zayin+dagesh */
+ {0xfb37, 0, 0}, /* 0xfb37 -- UNUSED */
+ {0x5d8, 0x5bc, 0}, /* 0xfb38 tet+dagesh */
+ {0x5d9, 0x5bc, 0}, /* 0xfb39 yud+dagesh */
+ {0x5da, 0x5bc, 0}, /* 0xfb3a kaf sofit+dagesh */
+ {0x5db, 0x5bc, 0}, /* 0xfb3b kaf+dagesh */
+ {0x5dc, 0x5bc, 0}, /* 0xfb3c lamed+dagesh */
+ {0xfb3d, 0, 0}, /* 0xfb3d -- UNUSED */
+ {0x5de, 0x5bc, 0}, /* 0xfb3e mem+dagesh */
+ {0xfb3f, 0, 0}, /* 0xfb3f -- UNUSED */
+ {0x5e0, 0x5bc, 0}, /* 0xfb40 nun+dagesh */
+ {0x5e1, 0x5bc, 0}, /* 0xfb41 samech+dagesh */
+ {0xfb42, 0, 0}, /* 0xfb42 -- UNUSED */
+ {0x5e3, 0x5bc, 0}, /* 0xfb43 pe sofit+dagesh */
+ {0x5e4, 0x5bc,0}, /* 0xfb44 pe+dagesh */
+ {0xfb45, 0, 0}, /* 0xfb45 -- UNUSED */
+ {0x5e6, 0x5bc, 0}, /* 0xfb46 tsadi+dagesh */
+ {0x5e7, 0x5bc, 0}, /* 0xfb47 qof+dagesh */
+ {0x5e8, 0x5bc, 0}, /* 0xfb48 resh+dagesh */
+ {0x5e9, 0x5bc, 0}, /* 0xfb49 shin+dagesh */
+ {0x5ea, 0x5bc, 0}, /* 0xfb4a tav+dagesh */
+ {0x5d5, 0x5b9, 0}, /* 0xfb4b vav+holam */
+ {0x5d1, 0x5bf, 0}, /* 0xfb4c bet+rafe */
+ {0x5db, 0x5bf, 0}, /* 0xfb4d kaf+rafe */
+ {0x5e4, 0x5bf, 0}, /* 0xfb4e pe+rafe */
+ {0x5d0, 0x5dc, 0} /* 0xfb4f alef-lamed */
+};
+
+ static void
+mb_decompose(c, c1, c2, c3)
+ int c, *c1, *c2, *c3;
+{
+ decomp_T d;
+
+ if (c >= 0x4b20 && c <= 0xfb4f)
+ {
+ d = decomp_table[c - 0xfb20];
+ *c1 = d.a;
+ *c2 = d.b;
+ *c3 = d.c;
+ }
+ else
+ {
+ *c1 = c;
+ *c2 = *c3 = 0;
+ }
+}
+#endif
+
+/*
+ * Compare two strings, ignore case if ireg_ic set.
+ * Return 0 if strings match, non-zero otherwise.
+ * Correct the length "*n" when composing characters are ignored.
+ */
+ static int
+cstrncmp(s1, s2, n)
+ char_u *s1, *s2;
+ int *n;
+{
+ int result;
+
+ if (!ireg_ic)
+ result = STRNCMP(s1, s2, *n);
+ else
+ result = MB_STRNICMP(s1, s2, *n);
+
+#ifdef FEAT_MBYTE
+ /* if it failed and it's utf8 and we want to combineignore: */
+ if (result != 0 && enc_utf8 && ireg_icombine)
+ {
+ char_u *str1, *str2;
+ int c1, c2, c11, c12;
+ int ix;
+ int junk;
+
+ /* we have to handle the strcmp ourselves, since it is necessary to
+ * deal with the composing characters by ignoring them: */
+ str1 = s1;
+ str2 = s2;
+ c1 = c2 = 0;
+ for (ix = 0; ix < *n; )
+ {
+ c1 = mb_ptr2char_adv(&str1);
+ c2 = mb_ptr2char_adv(&str2);
+ ix += utf_char2len(c1);
+
+ /* decompose the character if necessary, into 'base' characters
+ * because I don't care about Arabic, I will hard-code the Hebrew
+ * which I *do* care about! So sue me... */
+ if (c1 != c2 && (!ireg_ic || utf_fold(c1) != utf_fold(c2)))
+ {
+ /* decomposition necessary? */
+ mb_decompose(c1, &c11, &junk, &junk);
+ mb_decompose(c2, &c12, &junk, &junk);
+ c1 = c11;
+ c2 = c12;
+ if (c11 != c12 && (!ireg_ic || utf_fold(c11) != utf_fold(c12)))
+ break;
+ }
+ }
+ result = c2 - c1;
+ if (result == 0)
+ *n = (int)(str2 - s2);
+ }
+#endif
+
+ return result;
+}
+
+/*
+ * cstrchr: This function is used a lot for simple searches, keep it fast!
+ */
+ static char_u *
+cstrchr(s, c)
+ char_u *s;
+ int c;
+{
+ char_u *p;
+ int cc;
+
+ if (!ireg_ic
+#ifdef FEAT_MBYTE
+ || (!enc_utf8 && mb_char2len(c) > 1)
+#endif
+ )
+ return vim_strchr(s, c);
+
+ /* tolower() and toupper() can be slow, comparing twice should be a lot
+ * faster (esp. when using MS Visual C++!).
+ * For UTF-8 need to use folded case. */
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && c > 0x80)
+ cc = utf_fold(c);
+ else
+#endif
+ if (isupper(c))
+ cc = TOLOWER_LOC(c);
+ else if (islower(c))
+ cc = TOUPPER_LOC(c);
+ else
+ return vim_strchr(s, c);
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ for (p = s; *p != NUL; p += (*mb_ptr2len_check)(p))
+ {
+ if (enc_utf8 && c > 0x80)
+ {
+ if (utf_fold(utf_ptr2char(p)) == cc)
+ return p;
+ }
+ else if (*p == c || *p == cc)
+ return p;
+ }
+ }
+ else
+#endif
+ /* Faster version for when there are no multi-byte characters. */
+ for (p = s; *p != NUL; ++p)
+ if (*p == c || *p == cc)
+ return p;
+
+ return NULL;
+}
+
+/***************************************************************
+ * regsub stuff *
+ ***************************************************************/
+
+/* This stuff below really confuses cc on an SGI -- webb */
+#ifdef __sgi
+# undef __ARGS
+# define __ARGS(x) ()
+#endif
+
+/*
+ * We should define ftpr as a pointer to a function returning a pointer to
+ * a function returning a pointer to a function ...
+ * This is impossible, so we declare a pointer to a function returning a
+ * pointer to a function returning void. This should work for all compilers.
+ */
+typedef void (*(*fptr) __ARGS((char_u *, int)))();
+
+static fptr do_upper __ARGS((char_u *, int));
+static fptr do_Upper __ARGS((char_u *, int));
+static fptr do_lower __ARGS((char_u *, int));
+static fptr do_Lower __ARGS((char_u *, int));
+
+static int vim_regsub_both __ARGS((char_u *source, char_u *dest, int copy, int magic, int backslash));
+
+ static fptr
+do_upper(d, c)
+ char_u *d;
+ int c;
+{
+ *d = TOUPPER_LOC(c);
+
+ return (fptr)NULL;
+}
+
+ static fptr
+do_Upper(d, c)
+ char_u *d;
+ int c;
+{
+ *d = TOUPPER_LOC(c);
+
+ return (fptr)do_Upper;
+}
+
+ static fptr
+do_lower(d, c)
+ char_u *d;
+ int c;
+{
+ *d = TOLOWER_LOC(c);
+
+ return (fptr)NULL;
+}
+
+ static fptr
+do_Lower(d, c)
+ char_u *d;
+ int c;
+{
+ *d = TOLOWER_LOC(c);
+
+ return (fptr)do_Lower;
+}
+
+/*
+ * regtilde(): Replace tildes in the pattern by the old pattern.
+ *
+ * Short explanation of the tilde: It stands for the previous replacement
+ * pattern. If that previous pattern also contains a ~ we should go back a
+ * step further... But we insert the previous pattern into the current one
+ * and remember that.
+ * This still does not handle the case where "magic" changes. TODO?
+ *
+ * The tildes are parsed once before the first call to vim_regsub().
+ */
+ char_u *
+regtilde(source, magic)
+ char_u *source;
+ int magic;
+{
+ char_u *newsub = source;
+ char_u *tmpsub;
+ char_u *p;
+ int len;
+ int prevlen;
+
+ for (p = newsub; *p; ++p)
+ {
+ if ((*p == '~' && magic) || (*p == '\\' && *(p + 1) == '~' && !magic))
+ {
+ if (reg_prev_sub != NULL)
+ {
+ /* length = len(newsub) - 1 + len(prev_sub) + 1 */
+ prevlen = (int)STRLEN(reg_prev_sub);
+ tmpsub = alloc((unsigned)(STRLEN(newsub) + prevlen));
+ if (tmpsub != NULL)
+ {
+ /* copy prefix */
+ len = (int)(p - newsub); /* not including ~ */
+ mch_memmove(tmpsub, newsub, (size_t)len);
+ /* interpretate tilde */
+ mch_memmove(tmpsub + len, reg_prev_sub, (size_t)prevlen);
+ /* copy postfix */
+ if (!magic)
+ ++p; /* back off \ */
+ STRCPY(tmpsub + len + prevlen, p + 1);
+
+ if (newsub != source) /* already allocated newsub */
+ vim_free(newsub);
+ newsub = tmpsub;
+ p = newsub + len + prevlen;
+ }
+ }
+ else if (magic)
+ STRCPY(p, p + 1); /* remove '~' */
+ else
+ STRCPY(p, p + 2); /* remove '\~' */
+ --p;
+ }
+ else
+ {
+ if (*p == '\\' && p[1]) /* skip escaped characters */
+ ++p;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ p += (*mb_ptr2len_check)(p) - 1;
+#endif
+ }
+ }
+
+ vim_free(reg_prev_sub);
+ if (newsub != source) /* newsub was allocated, just keep it */
+ reg_prev_sub = newsub;
+ else /* no ~ found, need to save newsub */
+ reg_prev_sub = vim_strsave(newsub);
+ return newsub;
+}
+
+#ifdef FEAT_EVAL
+static int can_f_submatch = FALSE; /* TRUE when submatch() can be used */
+
+/* These pointers are used instead of reg_match and reg_mmatch for
+ * reg_submatch(). Needed for when the substitution string is an expression
+ * that contains a call to substitute() and submatch(). */
+static regmatch_T *submatch_match;
+static regmmatch_T *submatch_mmatch;
+#endif
+
+#if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * vim_regsub() - perform substitutions after a vim_regexec() or
+ * vim_regexec_multi() match.
+ *
+ * If "copy" is TRUE really copy into "dest".
+ * If "copy" is FALSE nothing is copied, this is just to find out the length
+ * of the result.
+ *
+ * If "backslash" is TRUE, a backslash will be removed later, need to double
+ * them to keep them, and insert a backslash before a CR to avoid it being
+ * replaced with a line break later.
+ *
+ * Note: The matched text must not change between the call of
+ * vim_regexec()/vim_regexec_multi() and vim_regsub()! It would make the back
+ * references invalid!
+ *
+ * Returns the size of the replacement, including terminating NUL.
+ */
+ int
+vim_regsub(rmp, source, dest, copy, magic, backslash)
+ regmatch_T *rmp;
+ char_u *source;
+ char_u *dest;
+ int copy;
+ int magic;
+ int backslash;
+{
+ reg_match = rmp;
+ reg_mmatch = NULL;
+ reg_maxline = 0;
+ return vim_regsub_both(source, dest, copy, magic, backslash);
+}
+#endif
+
+ int
+vim_regsub_multi(rmp, lnum, source, dest, copy, magic, backslash)
+ regmmatch_T *rmp;
+ linenr_T lnum;
+ char_u *source;
+ char_u *dest;
+ int copy;
+ int magic;
+ int backslash;
+{
+ reg_match = NULL;
+ reg_mmatch = rmp;
+ reg_buf = curbuf; /* always works on the current buffer! */
+ reg_firstlnum = lnum;
+ reg_maxline = curbuf->b_ml.ml_line_count - lnum;
+ return vim_regsub_both(source, dest, copy, magic, backslash);
+}
+
+ static int
+vim_regsub_both(source, dest, copy, magic, backslash)
+ char_u *source;
+ char_u *dest;
+ int copy;
+ int magic;
+ int backslash;
+{
+ char_u *src;
+ char_u *dst;
+ char_u *s;
+ int c;
+ int no = -1;
+ fptr func = (fptr)NULL;
+ linenr_T clnum = 0; /* init for GCC */
+ int len = 0; /* init for GCC */
+#ifdef FEAT_EVAL
+ static char_u *eval_result = NULL;
+#endif
+#ifdef FEAT_MBYTE
+ int l;
+#endif
+
+
+ /* Be paranoid... */
+ if (source == NULL || dest == NULL)
+ {
+ EMSG(_(e_null));
+ return 0;
+ }
+ if (prog_magic_wrong())
+ return 0;
+ src = source;
+ dst = dest;
+
+ /*
+ * When the substitute part starts with "\=" evaluate it as an expression.
+ */
+ if (source[0] == '\\' && source[1] == '='
+#ifdef FEAT_EVAL
+ && !can_f_submatch /* can't do this recursively */
+#endif
+ )
+ {
+#ifdef FEAT_EVAL
+ /* To make sure that the length doesn't change between checking the
+ * length and copying the string, and to speed up things, the
+ * resulting string is saved from the call with "copy" == FALSE to the
+ * call with "copy" == TRUE. */
+ if (copy)
+ {
+ if (eval_result != NULL)
+ {
+ STRCPY(dest, eval_result);
+ dst += STRLEN(eval_result);
+ vim_free(eval_result);
+ eval_result = NULL;
+ }
+ }
+ else
+ {
+ linenr_T save_reg_maxline;
+ win_T *save_reg_win;
+ int save_ireg_ic;
+
+ vim_free(eval_result);
+
+ /* The expression may contain substitute(), which calls us
+ * recursively. Make sure submatch() gets the text from the first
+ * level. Don't need to save "reg_buf", because
+ * vim_regexec_multi() can't be called recursively. */
+ submatch_match = reg_match;
+ submatch_mmatch = reg_mmatch;
+ save_reg_maxline = reg_maxline;
+ save_reg_win = reg_win;
+ save_ireg_ic = ireg_ic;
+ can_f_submatch = TRUE;
+
+ eval_result = eval_to_string(source + 2, NULL);
+ if (eval_result != NULL)
+ {
+ for (s = eval_result; *s != NUL; ++s)
+ {
+ /* Change NL to CR, so that it becomes a line break.
+ * Skip over a backslashed character. */
+ if (*s == NL)
+ *s = CAR;
+ else if (*s == '\\' && s[1] != NUL)
+ ++s;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ s += (*mb_ptr2len_check)(s) - 1;
+#endif
+ }
+
+ dst += STRLEN(eval_result);
+ }
+
+ reg_match = submatch_match;
+ reg_mmatch = submatch_mmatch;
+ reg_maxline = save_reg_maxline;
+ reg_win = save_reg_win;
+ ireg_ic = save_ireg_ic;
+ can_f_submatch = FALSE;
+ }
+#endif
+ }
+ else
+ while ((c = *src++) != NUL)
+ {
+ if (c == '&' && magic)
+ no = 0;
+ else if (c == '\\' && *src != NUL)
+ {
+ if (*src == '&' && !magic)
+ {
+ ++src;
+ no = 0;
+ }
+ else if ('0' <= *src && *src <= '9')
+ {
+ no = *src++ - '0';
+ }
+ else if (vim_strchr((char_u *)"uUlLeE", *src))
+ {
+ switch (*src++)
+ {
+ case 'u': func = (fptr)do_upper;
+ continue;
+ case 'U': func = (fptr)do_Upper;
+ continue;
+ case 'l': func = (fptr)do_lower;
+ continue;
+ case 'L': func = (fptr)do_Lower;
+ continue;
+ case 'e':
+ case 'E': func = (fptr)NULL;
+ continue;
+ }
+ }
+ }
+ if (no < 0) /* Ordinary character. */
+ {
+ if (c == '\\' && *src != NUL)
+ {
+ /* Check for abbreviations -- webb */
+ switch (*src)
+ {
+ case 'r': c = CAR; ++src; break;
+ case 'n': c = NL; ++src; break;
+ case 't': c = TAB; ++src; break;
+ /* Oh no! \e already has meaning in subst pat :-( */
+ /* case 'e': c = ESC; ++src; break; */
+ case 'b': c = Ctrl_H; ++src; break;
+
+ /* If "backslash" is TRUE the backslash will be removed
+ * later. Used to insert a literal CR. */
+ default: if (backslash)
+ {
+ if (copy)
+ *dst = '\\';
+ ++dst;
+ }
+ c = *src++;
+ }
+ }
+
+ /* Write to buffer, if copy is set. */
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(src - 1)) > 1)
+ {
+ /* TODO: should use "func" here. */
+ if (copy)
+ mch_memmove(dst, src - 1, l);
+ dst += l - 1;
+ src += l - 1;
+ }
+ else
+ {
+#endif
+ if (copy)
+ {
+ if (func == (fptr)NULL) /* just copy */
+ *dst = c;
+ else /* change case */
+ func = (fptr)(func(dst, c));
+ /* Turbo C complains without the typecast */
+ }
+#ifdef FEAT_MBYTE
+ }
+#endif
+ dst++;
+ }
+ else
+ {
+ if (REG_MULTI)
+ {
+ clnum = reg_mmatch->startpos[no].lnum;
+ if (clnum < 0 || reg_mmatch->endpos[no].lnum < 0)
+ s = NULL;
+ else
+ {
+ s = reg_getline(clnum) + reg_mmatch->startpos[no].col;
+ if (reg_mmatch->endpos[no].lnum == clnum)
+ len = reg_mmatch->endpos[no].col
+ - reg_mmatch->startpos[no].col;
+ else
+ len = (int)STRLEN(s);
+ }
+ }
+ else
+ {
+ s = reg_match->startp[no];
+ if (reg_match->endp[no] == NULL)
+ s = NULL;
+ else
+ len = (int)(reg_match->endp[no] - s);
+ }
+ if (s != NULL)
+ {
+ for (;;)
+ {
+ if (len == 0)
+ {
+ if (REG_MULTI)
+ {
+ if (reg_mmatch->endpos[no].lnum == clnum)
+ break;
+ if (copy)
+ *dst = CAR;
+ ++dst;
+ s = reg_getline(++clnum);
+ if (reg_mmatch->endpos[no].lnum == clnum)
+ len = reg_mmatch->endpos[no].col;
+ else
+ len = (int)STRLEN(s);
+ }
+ else
+ break;
+ }
+ else if (*s == NUL) /* we hit NUL. */
+ {
+ if (copy)
+ EMSG(_(e_re_damg));
+ goto exit;
+ }
+ else
+ {
+ if (backslash && (*s == CAR || *s == '\\'))
+ {
+ /*
+ * Insert a backslash in front of a CR, otherwise
+ * it will be replaced by a line break.
+ * Number of backslashes will be halved later,
+ * double them here.
+ */
+ if (copy)
+ {
+ dst[0] = '\\';
+ dst[1] = *s;
+ }
+ dst += 2;
+ }
+#ifdef FEAT_MBYTE
+ else if (has_mbyte && (l = (*mb_ptr2len_check)(s)) > 1)
+ {
+ /* TODO: should use "func" here. */
+ if (copy)
+ mch_memmove(dst, s, l);
+ dst += l;
+ s += l - 1;
+ len -= l - 1;
+ }
+#endif
+ else
+ {
+ if (copy)
+ {
+ if (func == (fptr)NULL) /* just copy */
+ *dst = *s;
+ else /* change case */
+ func = (fptr)(func(dst, *s));
+ /* Turbo C complains without the typecast */
+ }
+ ++dst;
+ }
+ ++s;
+ --len;
+ }
+ }
+ }
+ no = -1;
+ }
+ }
+ if (copy)
+ *dst = NUL;
+
+exit:
+ return (int)((dst - dest) + 1);
+}
+
+#ifdef FEAT_EVAL
+/*
+ * Used for the submatch() function: get the string from tne n'th submatch in
+ * allocated memory.
+ * Returns NULL when not in a ":s" command and for a non-existing submatch.
+ */
+ char_u *
+reg_submatch(no)
+ int no;
+{
+ char_u *retval = NULL;
+ char_u *s;
+ int len;
+ int round;
+ linenr_T lnum;
+
+ if (!can_f_submatch)
+ return NULL;
+
+ if (submatch_match == NULL)
+ {
+ /*
+ * First round: compute the length and allocate memory.
+ * Second round: copy the text.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ lnum = submatch_mmatch->startpos[no].lnum;
+ if (lnum < 0 || submatch_mmatch->endpos[no].lnum < 0)
+ return NULL;
+
+ s = reg_getline(lnum) + submatch_mmatch->startpos[no].col;
+ if (s == NULL) /* anti-crash check, cannot happen? */
+ break;
+ if (submatch_mmatch->endpos[no].lnum == lnum)
+ {
+ /* Within one line: take form start to end col. */
+ len = submatch_mmatch->endpos[no].col
+ - submatch_mmatch->startpos[no].col;
+ if (round == 2)
+ {
+ STRNCPY(retval, s, len);
+ retval[len] = NUL;
+ }
+ ++len;
+ }
+ else
+ {
+ /* Multiple lines: take start line from start col, middle
+ * lines completely and end line up to end col. */
+ len = (int)STRLEN(s);
+ if (round == 2)
+ {
+ STRCPY(retval, s);
+ retval[len] = '\n';
+ }
+ ++len;
+ ++lnum;
+ while (lnum < submatch_mmatch->endpos[no].lnum)
+ {
+ s = reg_getline(lnum++);
+ if (round == 2)
+ STRCPY(retval + len, s);
+ len += (int)STRLEN(s);
+ if (round == 2)
+ retval[len] = '\n';
+ ++len;
+ }
+ if (round == 2)
+ STRNCPY(retval + len, reg_getline(lnum),
+ submatch_mmatch->endpos[no].col);
+ len += submatch_mmatch->endpos[no].col;
+ if (round == 2)
+ retval[len] = NUL;
+ ++len;
+ }
+
+ if (round == 1)
+ {
+ retval = lalloc((long_u)len, TRUE);
+ if (s == NULL)
+ return NULL;
+ }
+ }
+ }
+ else
+ {
+ if (submatch_match->endp[no] == NULL)
+ retval = NULL;
+ else
+ {
+ s = submatch_match->startp[no];
+ retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s));
+ }
+ }
+
+ return retval;
+}
+#endif
diff --git a/src/regexp.h b/src/regexp.h
new file mode 100644
index 000000000..15611ed81
--- /dev/null
+++ b/src/regexp.h
@@ -0,0 +1,80 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
+ *
+ * This is NOT the original regular expression code as written by Henry
+ * Spencer. This code has been modified specifically for use with Vim, and
+ * should not be used apart from compiling Vim. If you want a good regular
+ * expression library, get the original code.
+ *
+ * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
+ */
+
+#ifndef _REGEXP_H
+#define _REGEXP_H
+
+/*
+ * The number of sub-matches is limited to 10.
+ * The first one (index 0) is the whole match, referenced with "\0".
+ * The second one (index 1) is the first sub-match, referenced with "\1".
+ * This goes up to the tenth (index 9), referenced with "\9".
+ */
+#define NSUBEXP 10
+
+/*
+ * Structure returned by vim_regcomp() to pass on to vim_regexec().
+ * These fields are only to be used in regexp.c!
+ * See regep.c for an explanation.
+ */
+typedef struct
+{
+ int regstart;
+ char_u reganch;
+ char_u *regmust;
+ int regmlen;
+ unsigned regflags;
+ char_u reghasz;
+ char_u program[1]; /* actually longer.. */
+} regprog_T;
+
+/*
+ * Structure to be used for single-line matching.
+ * Sub-match "no" starts at "startp[no]" and ends just before "endp[no]".
+ * When there is no match, the pointer is NULL.
+ */
+typedef struct
+{
+ regprog_T *regprog;
+ char_u *startp[NSUBEXP];
+ char_u *endp[NSUBEXP];
+ int rm_ic;
+} regmatch_T;
+
+/*
+ * Structure to be used for multi-line matching.
+ * Sub-match "no" starts in line "startpos[no].lnum" column "startpos[no].col"
+ * and ends in line "endpos[no].lnum" just before column "endpos[no].col".
+ * The line numbers are relative to the first line, thus startpos[0].lnum is
+ * always 0.
+ * When there is no match, the line number is -1.
+ */
+typedef struct
+{
+ regprog_T *regprog;
+ lpos_T startpos[NSUBEXP];
+ lpos_T endpos[NSUBEXP];
+ int rmm_ic;
+} regmmatch_T;
+
+/*
+ * Structure used to store external references: "\z\(\)" to "\z\1".
+ * Use a reference count to avoid the need to copy this around. When it goes
+ * from 1 to zero the matches need to be freed.
+ */
+typedef struct
+{
+ short refcnt;
+ char_u *matches[NSUBEXP];
+} reg_extmatch_T;
+
+#endif /* _REGEXP_H */
diff --git a/src/screen.c b/src/screen.c
new file mode 100644
index 000000000..594c42479
--- /dev/null
+++ b/src/screen.c
@@ -0,0 +1,8437 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * screen.c: code for displaying on the screen
+ *
+ * Output to the screen (console, terminal emulator or GUI window) is minimized
+ * by remembering what is already on the screen, and only updating the parts
+ * that changed.
+ *
+ * ScreenLines[off] Contains a copy of the whole screen, as it is currently
+ * displayed (excluding text written by external commands).
+ * ScreenAttrs[off] Contains the associated attributes.
+ * LineOffset[row] Contains the offset into ScreenLines*[] and ScreenAttrs[]
+ * for each line.
+ * LineWraps[row] Flag for each line whether it wraps to the next line.
+ *
+ * For double-byte characters, two consecutive bytes in ScreenLines[] can form
+ * one character which occupies two display cells.
+ * For UTF-8 a multi-byte character is converted to Unicode and stored in
+ * ScreenLinesUC[]. ScreenLines[] contains the first byte only. For an ASCII
+ * character without composing chars ScreenLinesUC[] will be 0. When the
+ * character occupies two display cells the next byte in ScreenLines[] is 0.
+ * ScreenLinesC1[] and ScreenLinesC2[] contain up to two composing characters
+ * (drawn on top of the first character). They are 0 when not used.
+ * ScreenLines2[] is only used for euc-jp to store the second byte if the
+ * first byte is 0x8e (single-width character).
+ *
+ * The screen_*() functions write to the screen and handle updating
+ * ScreenLines[].
+ *
+ * update_screen() is the function that updates all windows and status lines.
+ * It is called form the main loop when must_redraw is non-zero. It may be
+ * called from other places when an immediated screen update is needed.
+ *
+ * The part of the buffer that is displayed in a window is set with:
+ * - w_topline (first buffer line in window)
+ * - w_topfill (filler line above the first line)
+ * - w_leftcol (leftmost window cell in window),
+ * - w_skipcol (skipped window cells of first line)
+ *
+ * Commands that only move the cursor around in a window, do not need to take
+ * action to update the display. The main loop will check if w_topline is
+ * valid and update it (scroll the window) when needed.
+ *
+ * Commands that scroll a window change w_topline and must call
+ * check_cursor() to move the cursor into the visible part of the window, and
+ * call redraw_later(VALID) to have the window displayed by update_screen()
+ * later.
+ *
+ * Commands that change text in the buffer must call changed_bytes() or
+ * changed_lines() to mark the area that changed and will require updating
+ * later. The main loop will call update_screen(), which will update each
+ * window that shows the changed buffer. This assumes text above the change
+ * can remain displayed as it is. Text after the change may need updating for
+ * scrolling, folding and syntax highlighting.
+ *
+ * Commands that change how a window is displayed (e.g., setting 'list') or
+ * invalidate the contents of a window in another way (e.g., change fold
+ * settings), must call redraw_later(NOT_VALID) to have the whole window
+ * redisplayed by update_screen() later.
+ *
+ * Commands that change how a buffer is displayed (e.g., setting 'tabstop')
+ * must call redraw_curbuf_later(NOT_VALID) to have all the windows for the
+ * buffer redisplayed by update_screen() later.
+ *
+ * Commands that move the window position must call redraw_later(NOT_VALID).
+ * TODO: should minimize redrawing by scrolling when possible.
+ *
+ * Commands that change everything (e.g., resizing the screen) must call
+ * redraw_all_later(NOT_VALID) or redraw_all_later(CLEAR).
+ *
+ * Things that are handled indirectly:
+ * - When messages scroll the screen up, msg_scrolled will be set and
+ * update_screen() called to redraw.
+ */
+
+#include "vim.h"
+
+/*
+ * The attributes that are actually active for writing to the screen.
+ */
+static int screen_attr = 0;
+
+/*
+ * Positioning the cursor is reduced by remembering the last position.
+ * Mostly used by windgoto() and screen_char().
+ */
+static int screen_cur_row, screen_cur_col; /* last known cursor position */
+
+#ifdef FEAT_SEARCH_EXTRA
+/*
+ * Struct used for highlighting 'hlsearch' matches for the last use search
+ * pattern or a ":match" item.
+ * For 'hlsearch' there is one pattern for all windows. For ":match" there is
+ * a different pattern for each window.
+ */
+typedef struct
+{
+ regmmatch_T rm; /* points to the regexp program; contains last found
+ match (may continue in next line) */
+ buf_T *buf; /* the buffer to search for a match */
+ linenr_T lnum; /* the line to search for a match */
+ int attr; /* attributes to be used for a match */
+ int attr_cur; /* attributes currently active in win_line() */
+ linenr_T first_lnum; /* first lnum to search for multi-line pat */
+ char_u *startp; /* in win_line() points to char where HL starts */
+ char_u *endp; /* in win_line() points to char where HL ends */
+} match_T;
+
+static match_T search_hl; /* used for 'hlsearch' highlight matching */
+static match_T match_hl; /* used for ":match" highlight matching */
+#endif
+
+#ifdef FEAT_FOLDING
+static foldinfo_T win_foldinfo; /* info for 'foldcolumn' */
+#endif
+
+/*
+ * Buffer for one screen line (characters and attributes).
+ */
+static schar_T *current_ScreenLine;
+
+static void win_update __ARGS((win_T *wp));
+static void win_draw_end __ARGS((win_T *wp, int c1, int c2, int row, int endrow, enum hlf_value hl));
+#ifdef FEAT_FOLDING
+static void fold_line __ARGS((win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T lnum, int row));
+static void fill_foldcolumn __ARGS((char_u *p, win_T *wp, int closed, linenr_T lnum));
+static void copy_text_attr __ARGS((int off, char_u *buf, int len, int attr));
+#endif
+static int win_line __ARGS((win_T *, linenr_T, int, int));
+static int char_needs_redraw __ARGS((int off_from, int off_to, int cols));
+#ifdef FEAT_RIGHTLEFT
+static void screen_line __ARGS((int row, int coloff, int endcol, int clear_width, int rlflag));
+# define SCREEN_LINE(r, o, e, c, rl) screen_line((r), (o), (e), (c), (rl))
+#else
+static void screen_line __ARGS((int row, int coloff, int endcol, int clear_width));
+# define SCREEN_LINE(r, o, e, c, rl) screen_line((r), (o), (e), (c))
+#endif
+#ifdef FEAT_RIGHTLEFT
+static void rl_mirror __ARGS((char_u *str));
+#endif
+#ifdef FEAT_VERTSPLIT
+static void draw_vsep_win __ARGS((win_T *wp, int row));
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+static void start_search_hl __ARGS((void));
+static void end_search_hl __ARGS((void));
+static void prepare_search_hl __ARGS((win_T *wp, linenr_T lnum));
+static void next_search_hl __ARGS((win_T *win, match_T *shl, linenr_T lnum, colnr_T mincol));
+#endif
+static void screen_start_highlight __ARGS((int attr));
+static void screen_char __ARGS((unsigned off, int row, int col));
+#ifdef FEAT_MBYTE
+static void screen_char_2 __ARGS((unsigned off, int row, int col));
+#endif
+static void screenclear2 __ARGS((void));
+static void lineclear __ARGS((unsigned off, int width));
+static void lineinvalid __ARGS((unsigned off, int width));
+#ifdef FEAT_VERTSPLIT
+static void linecopy __ARGS((int to, int from, win_T *wp));
+static void redraw_block __ARGS((int row, int end, win_T *wp));
+#endif
+static int win_do_lines __ARGS((win_T *wp, int row, int line_count, int mayclear, int del));
+static void win_rest_invalid __ARGS((win_T *wp));
+static int screen_ins_lines __ARGS((int, int, int, int, win_T *wp));
+static void msg_pos_mode __ARGS((void));
+#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
+static int fillchar_status __ARGS((int *attr, int is_curwin));
+#endif
+#ifdef FEAT_VERTSPLIT
+static int fillchar_vsep __ARGS((int *attr));
+#endif
+#ifdef FEAT_STL_OPT
+static void win_redr_custom __ARGS((win_T *wp, int Ruler));
+#endif
+#ifdef FEAT_CMDL_INFO
+static void win_redr_ruler __ARGS((win_T *wp, int always));
+#endif
+
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_VERTSPLIT)
+/* Ugly global: overrule attribute used by screen_char() */
+static int screen_char_attr = 0;
+#endif
+
+/*
+ * Redraw the current window later, with update_screen(type).
+ * Set must_redraw only if not already set to a higher value.
+ * e.g. if must_redraw is CLEAR, type NOT_VALID will do nothing.
+ */
+ void
+redraw_later(type)
+ int type;
+{
+ redraw_win_later(curwin, type);
+}
+
+ void
+redraw_win_later(wp, type)
+ win_T *wp;
+ int type;
+{
+ if (wp->w_redr_type < type)
+ {
+ wp->w_redr_type = type;
+ if (type >= NOT_VALID)
+ wp->w_lines_valid = 0;
+ if (must_redraw < type) /* must_redraw is the maximum of all windows */
+ must_redraw = type;
+ }
+}
+
+/*
+ * Force a complete redraw later. Also resets the highlighting. To be used
+ * after executing a shell command that messes up the screen.
+ */
+ void
+redraw_later_clear()
+{
+ redraw_all_later(CLEAR);
+ screen_attr = HL_BOLD | HL_UNDERLINE;
+}
+
+/*
+ * Mark all windows to be redrawn later.
+ */
+ void
+redraw_all_later(type)
+ int type;
+{
+ win_T *wp;
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ redraw_win_later(wp, type);
+ }
+}
+
+/*
+ * Mark all windows that are editing the current buffer to be udpated later.
+ */
+ void
+redraw_curbuf_later(type)
+ int type;
+{
+ redraw_buf_later(curbuf, type);
+}
+
+ void
+redraw_buf_later(buf, type)
+ buf_T *buf;
+ int type;
+{
+ win_T *wp;
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer == buf)
+ redraw_win_later(wp, type);
+ }
+}
+
+/*
+ * Changed something in the current window, at buffer line "lnum", that
+ * requires that line and possibly other lines to be redrawn.
+ * Used when entering/leaving Insert mode with the cursor on a folded line.
+ * Used to remove the "$" from a change command.
+ * Note that when also inserting/deleting lines w_redraw_top and w_redraw_bot
+ * may become invalid and the whole window will have to be redrawn.
+ */
+/*ARGSUSED*/
+ void
+redrawWinline(lnum, invalid)
+ linenr_T lnum;
+ int invalid; /* window line height is invalid now */
+{
+#ifdef FEAT_FOLDING
+ int i;
+#endif
+
+ if (curwin->w_redraw_top == 0 || curwin->w_redraw_top > lnum)
+ curwin->w_redraw_top = lnum;
+ if (curwin->w_redraw_bot == 0 || curwin->w_redraw_bot < lnum)
+ curwin->w_redraw_bot = lnum;
+ redraw_later(VALID);
+
+#ifdef FEAT_FOLDING
+ if (invalid)
+ {
+ /* A w_lines[] entry for this lnum has become invalid. */
+ i = find_wl_entry(curwin, lnum);
+ if (i >= 0)
+ curwin->w_lines[i].wl_valid = FALSE;
+ }
+#endif
+}
+
+/*
+ * update all windows that are editing the current buffer
+ */
+ void
+update_curbuf(type)
+ int type;
+{
+ redraw_curbuf_later(type);
+ update_screen(type);
+}
+
+/*
+ * update_screen()
+ *
+ * Based on the current value of curwin->w_topline, transfer a screenfull
+ * of stuff from Filemem to ScreenLines[], and update curwin->w_botline.
+ */
+ void
+update_screen(type)
+ int type;
+{
+ win_T *wp;
+ static int did_intro = FALSE;
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+ int did_one;
+#endif
+
+ if (!screen_valid(TRUE))
+ return;
+
+ if (must_redraw)
+ {
+ if (type < must_redraw) /* use maximal type */
+ type = must_redraw;
+ must_redraw = 0;
+ }
+
+ /* Need to update w_lines[]. */
+ if (curwin->w_lines_valid == 0 && type < NOT_VALID)
+ type = NOT_VALID;
+
+ if (!redrawing())
+ {
+ redraw_later(type); /* remember type for next time */
+ must_redraw = type;
+ if (type > INVERTED_ALL)
+ curwin->w_lines_valid = 0; /* don't use w_lines[].wl_size now */
+ return;
+ }
+
+ updating_screen = TRUE;
+#ifdef FEAT_SYN_HL
+ ++display_tick; /* let syntax code know we're in a next round of
+ * display updating */
+#endif
+
+ /*
+ * if the screen was scrolled up when displaying a message, scroll it down
+ */
+ if (msg_scrolled)
+ {
+ clear_cmdline = TRUE;
+ if (msg_scrolled > Rows - 5) /* clearing is faster */
+ type = CLEAR;
+ else if (type != CLEAR)
+ {
+ check_for_delay(FALSE);
+ if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, NULL) == FAIL)
+ type = CLEAR;
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (W_WINROW(wp) < msg_scrolled)
+ {
+ if (W_WINROW(wp) + wp->w_height > msg_scrolled
+ && wp->w_redr_type < REDRAW_TOP
+ && wp->w_lines_valid > 0
+ && wp->w_topline == wp->w_lines[0].wl_lnum)
+ {
+ wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
+ wp->w_redr_type = REDRAW_TOP;
+ }
+ else
+ {
+ wp->w_redr_type = NOT_VALID;
+#ifdef FEAT_WINDOWS
+ if (W_WINROW(wp) + wp->w_height + W_STATUS_HEIGHT(wp)
+ <= msg_scrolled)
+ wp->w_redr_status = TRUE;
+#endif
+ }
+ }
+ }
+ redraw_cmdline = TRUE;
+ }
+ msg_scrolled = 0;
+ need_wait_return = FALSE;
+ }
+
+ /* reset cmdline_row now (may have been changed temporarily) */
+ compute_cmdrow();
+
+ /* Check for changed highlighting */
+ if (need_highlight_changed)
+ highlight_changed();
+
+ if (type == CLEAR) /* first clear screen */
+ {
+ screenclear(); /* will reset clear_cmdline */
+ type = NOT_VALID;
+ }
+
+ if (clear_cmdline) /* going to clear cmdline (done below) */
+ check_for_delay(FALSE);
+
+ /*
+ * Only start redrawing if there is really something to do.
+ */
+ if (type == INVERTED)
+ update_curswant();
+ if (curwin->w_redr_type < type
+ && !((type == VALID
+ && curwin->w_lines[0].wl_valid
+#ifdef FEAT_DIFF
+ && curwin->w_topfill == curwin->w_old_topfill
+ && curwin->w_botfill == curwin->w_old_botfill
+#endif
+ && curwin->w_topline == curwin->w_lines[0].wl_lnum)
+#ifdef FEAT_VISUAL
+ || (type == INVERTED
+ && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum
+ && curwin->w_old_visual_mode == VIsual_mode
+ && (curwin->w_valid & VALID_VIRTCOL)
+ && curwin->w_old_curswant == curwin->w_curswant)
+#endif
+ ))
+ curwin->w_redr_type = type;
+
+#ifdef FEAT_SYN_HL
+ /*
+ * Correct stored syntax highlighting info for changes in each displayed
+ * buffer. Each buffer must only be done once.
+ */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer->b_mod_set)
+ {
+# ifdef FEAT_WINDOWS
+ win_T *wwp;
+
+ /* Check if we already did this buffer. */
+ for (wwp = firstwin; wwp != wp; wwp = wwp->w_next)
+ if (wwp->w_buffer == wp->w_buffer)
+ break;
+# endif
+ if (
+# ifdef FEAT_WINDOWS
+ wwp == wp &&
+# endif
+ syntax_present(wp->w_buffer))
+ syn_stack_apply_changes(wp->w_buffer);
+ }
+ }
+#endif
+
+ /*
+ * Go from top to bottom through the windows, redrawing the ones that need
+ * it.
+ */
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+ did_one = FALSE;
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ search_hl.rm.regprog = NULL;
+#endif
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_redr_type != 0)
+ {
+ cursor_off();
+#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
+ if (!did_one)
+ {
+ did_one = TRUE;
+# ifdef FEAT_SEARCH_EXTRA
+ start_search_hl();
+# endif
+# ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+ if (clip_star.available && clip_isautosel())
+ clip_update_selection();
+# endif
+#ifdef FEAT_GUI
+ /* Remove the cursor before starting to do anything, because
+ * scrolling may make it difficult to redraw the text under
+ * it. */
+ if (gui.in_use)
+ gui_undraw_cursor();
+#endif
+ }
+#endif
+ win_update(wp);
+ }
+
+#ifdef FEAT_WINDOWS
+ /* redraw status line after the window to minimize cursor movement */
+ if (wp->w_redr_status)
+ {
+ cursor_off();
+ win_redr_status(wp);
+ }
+#endif
+ }
+#if defined(FEAT_SEARCH_EXTRA)
+ end_search_hl();
+#endif
+
+#ifdef FEAT_WINDOWS
+ /* Reset b_mod_set flags. Going through all windows is probably faster
+ * than going through all buffers (there could be many buffers). */
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ wp->w_buffer->b_mod_set = FALSE;
+#else
+ curbuf->b_mod_set = FALSE;
+#endif
+
+ updating_screen = FALSE;
+#ifdef FEAT_GUI
+ gui_may_resize_shell();
+#endif
+
+ /* Clear or redraw the command line. Done last, because scrolling may
+ * mess up the command line. */
+ if (clear_cmdline || redraw_cmdline)
+ showmode();
+
+ /* May put up an introductory message when not editing a file */
+ if (!did_intro && bufempty()
+ && curbuf->b_fname == NULL
+#ifdef FEAT_WINDOWS
+ && firstwin->w_next == NULL
+#endif
+ && vim_strchr(p_shm, SHM_INTRO) == NULL)
+ intro_message(FALSE);
+ did_intro = TRUE;
+
+#ifdef FEAT_GUI
+ /* Redraw the cursor and update the scrollbars when all screen updating is
+ * done. */
+ if (gui.in_use)
+ {
+ out_flush(); /* required before updating the cursor */
+ if (did_one)
+ gui_update_cursor(FALSE, FALSE);
+ gui_update_scrollbars(FALSE);
+ }
+#endif
+}
+
+#if defined(FEAT_SIGNS) || defined(FEAT_GUI)
+static void update_prepare __ARGS((void));
+static void update_finish __ARGS((void));
+
+/*
+ * Prepare for updating one or more windows.
+ */
+ static void
+update_prepare()
+{
+ cursor_off();
+ updating_screen = TRUE;
+#ifdef FEAT_GUI
+ /* Remove the cursor before starting to do anything, because scrolling may
+ * make it difficult to redraw the text under it. */
+ if (gui.in_use)
+ gui_undraw_cursor();
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ start_search_hl();
+#endif
+}
+
+/*
+ * Finish updating one or more windows.
+ */
+ static void
+update_finish()
+{
+ if (redraw_cmdline)
+ showmode();
+
+# ifdef FEAT_SEARCH_EXTRA
+ end_search_hl();
+# endif
+
+ updating_screen = FALSE;
+
+# ifdef FEAT_GUI
+ gui_may_resize_shell();
+
+ /* Redraw the cursor and update the scrollbars when all screen updating is
+ * done. */
+ if (gui.in_use)
+ {
+ out_flush(); /* required before updating the cursor */
+ gui_update_cursor(FALSE, FALSE);
+ gui_update_scrollbars(FALSE);
+ }
+# endif
+}
+#endif
+
+#if defined(FEAT_SIGNS) || defined(PROTO)
+ void
+update_debug_sign(buf, lnum)
+ buf_T *buf;
+ linenr_T lnum;
+{
+ win_T *wp;
+ int doit = FALSE;
+
+# ifdef FEAT_FOLDING
+ win_foldinfo.fi_level = 0;
+# endif
+
+ /* update/delete a specific mark */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (buf != NULL && lnum > 0)
+ {
+ if (wp->w_buffer == buf && lnum >= wp->w_topline
+ && lnum < wp->w_botline)
+ {
+ if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum)
+ wp->w_redraw_top = lnum;
+ if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
+ wp->w_redraw_bot = lnum;
+ redraw_win_later(wp, VALID);
+ }
+ }
+ else
+ redraw_win_later(wp, VALID);
+ if (wp->w_redr_type != 0)
+ doit = TRUE;
+ }
+
+ if (!doit)
+ return;
+
+ /* update all windows that need updating */
+ update_prepare();
+
+# ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp; wp = wp->w_next)
+ {
+ if (wp->w_redr_type != 0)
+ win_update(wp);
+ if (wp->w_redr_status)
+ win_redr_status(wp);
+ }
+# else
+ if (curwin->w_redr_type != 0)
+ win_update(curwin);
+# endif
+
+ update_finish();
+}
+#endif
+
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Update a single window, its status line and maybe the command line msg.
+ * Used for the GUI scrollbar.
+ */
+ void
+updateWindow(wp)
+ win_T *wp;
+{
+ update_prepare();
+
+#ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+ if (clip_star.available && clip_isautosel())
+ clip_update_selection();
+#endif
+ win_update(wp);
+#ifdef FEAT_WINDOWS
+ if (wp->w_redr_status
+# ifdef FEAT_CMDL_INFO
+ || p_ru
+# endif
+# ifdef FEAT_STL_OPT
+ || *p_stl
+# endif
+ )
+ win_redr_status(wp);
+#endif
+
+ update_finish();
+}
+#endif
+
+/*
+ * Update a single window.
+ *
+ * This may cause the windows below it also to be redrawn (when clearing the
+ * screen or scrolling lines).
+ *
+ * How the window is redrawn depends on wp->w_redr_type. Each type also
+ * implies the one below it.
+ * NOT_VALID redraw the whole window
+ * REDRAW_TOP redraw the top w_upd_rows window lines, otherwise like VALID
+ * INVERTED redraw the changed part of the Visual area
+ * INVERTED_ALL redraw the whole Visual area
+ * VALID 1. scroll up/down to adjust for a changed w_topline
+ * 2. update lines at the top when scrolled down
+ * 3. redraw changed text:
+ * - if wp->w_buffer->b_mod_set set, udpate lines between
+ * b_mod_top and b_mod_bot.
+ * - if wp->w_redraw_top non-zero, redraw lines between
+ * wp->w_redraw_top and wp->w_redr_bot.
+ * - continue redrawing when syntax status is invalid.
+ * 4. if scrolled up, update lines at the bottom.
+ * This results in three areas that may need updating:
+ * top: from first row to top_end (when scrolled down)
+ * mid: from mid_start to mid_end (update inversion or changed text)
+ * bot: from bot_start to last row (when scrolled up)
+ */
+ static void
+win_update(wp)
+ win_T *wp;
+{
+ buf_T *buf = wp->w_buffer;
+ int type;
+ int top_end = 0; /* Below last row of the top area that needs
+ updating. 0 when no top area updating. */
+ int mid_start = 999;/* first row of the mid area that needs
+ updating. 999 when no mid area updating. */
+ int mid_end = 0; /* Below last row of the mid area that needs
+ updating. 0 when no mid area updating. */
+ int bot_start = 999;/* first row of the bot area that needs
+ updating. 999 when no bot area updating */
+#ifdef FEAT_VISUAL
+ int scrolled_down = FALSE; /* TRUE when scrolled down when
+ w_topline got smaller a bit */
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ int top_to_mod = FALSE; /* redraw above mod_top */
+#endif
+
+ int row; /* current window row to display */
+ linenr_T lnum; /* current buffer lnum to display */
+ int idx; /* current index in w_lines[] */
+ int srow; /* starting row of the current line */
+
+ int eof = FALSE; /* if TRUE, we hit the end of the file */
+ int didline = FALSE; /* if TRUE, we finished the last line */
+ int i;
+ long j;
+ static int recursive = FALSE; /* being called recursively */
+ int old_botline = wp->w_botline;
+#ifdef FEAT_FOLDING
+ long fold_count;
+#endif
+#ifdef FEAT_SYN_HL
+ /* remember what happened to the previous line, to know if
+ * check_visual_highlight() can be used */
+#define DID_NONE 1 /* didn't update a line */
+#define DID_LINE 2 /* updated a normal line */
+#define DID_FOLD 3 /* updated a folded line */
+ int did_update = DID_NONE;
+ linenr_T syntax_last_parsed = 0; /* last parsed text line */
+#endif
+ linenr_T mod_top = 0;
+ linenr_T mod_bot = 0;
+#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
+ int save_got_int;
+#endif
+
+ type = wp->w_redr_type;
+
+ if (type == NOT_VALID)
+ {
+#ifdef FEAT_WINDOWS
+ wp->w_redr_status = TRUE;
+#endif
+ wp->w_lines_valid = 0;
+ }
+
+ /* Window is zero-height: nothing to draw. */
+ if (wp->w_height == 0)
+ {
+ wp->w_redr_type = 0;
+ return;
+ }
+
+#ifdef FEAT_VERTSPLIT
+ /* Window is zero-width: Only need to draw the separator. */
+ if (wp->w_width == 0)
+ {
+ /* draw the vertical separator right of this window */
+ draw_vsep_win(wp, 0);
+ wp->w_redr_type = 0;
+ return;
+ }
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+ /* Setup for ":match" highlighting. Disable any previous match */
+ match_hl.rm = wp->w_match;
+ if (wp->w_match_id == 0)
+ match_hl.attr = 0;
+ else
+ match_hl.attr = syn_id2attr(wp->w_match_id);
+ match_hl.buf = buf;
+ match_hl.lnum = 0;
+ search_hl.buf = buf;
+ search_hl.lnum = 0;
+ search_hl.first_lnum = 0;
+#endif
+
+ if (buf->b_mod_set && buf->b_mod_xlines != 0 && wp->w_redraw_top != 0)
+ {
+ /*
+ * When there are both inserted/deleted lines and specific lines to be
+ * redrawn, w_redraw_top and w_redraw_bot may be invalid, just redraw
+ * everything (only happens when redrawing is off for while).
+ */
+ type = NOT_VALID;
+ }
+ else
+ {
+ /*
+ * Set mod_top to the first line that needs displaying because of
+ * changes. Set mod_bot to the first line after the changes.
+ */
+ mod_top = wp->w_redraw_top;
+ if (wp->w_redraw_bot != 0)
+ mod_bot = wp->w_redraw_bot + 1;
+ else
+ mod_bot = 0;
+ wp->w_redraw_top = 0; /* reset for next time */
+ wp->w_redraw_bot = 0;
+ if (buf->b_mod_set)
+ {
+ if (mod_top == 0 || mod_top > buf->b_mod_top)
+ {
+ mod_top = buf->b_mod_top;
+#ifdef FEAT_SYN_HL
+ /* Need to redraw lines above the change that may be included
+ * in a pattern match. */
+ if (syntax_present(buf))
+ {
+ mod_top -= buf->b_syn_sync_linebreaks;
+ if (mod_top < 1)
+ mod_top = 1;
+ }
+#endif
+ }
+ if (mod_bot == 0 || mod_bot < buf->b_mod_bot)
+ mod_bot = buf->b_mod_bot;
+
+#ifdef FEAT_SEARCH_EXTRA
+ /* When 'hlsearch' is on and using a multi-line search pattern, a
+ * change in one line may make the Search highlighting in a
+ * previous line invalid. Simple solution: redraw all visible
+ * lines above the change.
+ * Same for a ":match" pattern.
+ */
+ if ((search_hl.rm.regprog != NULL
+ && re_multiline(search_hl.rm.regprog))
+ || (match_hl.rm.regprog != NULL
+ && re_multiline(match_hl.rm.regprog)))
+ top_to_mod = TRUE;
+#endif
+ }
+#ifdef FEAT_FOLDING
+ if (mod_top != 0 && hasAnyFolding(wp))
+ {
+ linenr_T lnumt, lnumb;
+
+ /*
+ * A change in a line can cause lines above it to become folded or
+ * unfolded. Find the top most buffer line that may be affected.
+ * If the line was previously folded and displayed, get the first
+ * line of that fold. If the line is folded now, get the first
+ * folded line. Use the minimum of these two.
+ */
+
+ /* Find last valid w_lines[] entry above mod_top. Set lnumt to
+ * the line below it. If there is no valid entry, use w_topline.
+ * Find the first valid w_lines[] entry below mod_bot. Set lnumb
+ * to this line. If there is no valid entry, use MAXLNUM. */
+ lnumt = wp->w_topline;
+ lnumb = MAXLNUM;
+ for (i = 0; i < wp->w_lines_valid; ++i)
+ if (wp->w_lines[i].wl_valid)
+ {
+ if (wp->w_lines[i].wl_lastlnum < mod_top)
+ lnumt = wp->w_lines[i].wl_lastlnum + 1;
+ if (lnumb == MAXLNUM && wp->w_lines[i].wl_lnum >= mod_bot)
+ {
+ lnumb = wp->w_lines[i].wl_lnum;
+ /* When there is a fold column it might need updating
+ * in the next line ("J" just above an open fold). */
+ if (wp->w_p_fdc > 0)
+ ++lnumb;
+ }
+ }
+
+ (void)hasFoldingWin(wp, mod_top, &mod_top, NULL, TRUE, NULL);
+ if (mod_top > lnumt)
+ mod_top = lnumt;
+
+ /* Now do the same for the bottom line (one above mod_bot). */
+ --mod_bot;
+ (void)hasFoldingWin(wp, mod_bot, NULL, &mod_bot, TRUE, NULL);
+ ++mod_bot;
+ if (mod_bot < lnumb)
+ mod_bot = lnumb;
+ }
+#endif
+
+ /* When a change starts above w_topline and the end is below
+ * w_topline, start redrawing at w_topline.
+ * If the end of the change is above w_topline: do like no changes was
+ * maded, but redraw the first line to find changes in syntax. */
+ if (mod_top != 0 && mod_top < wp->w_topline)
+ {
+ if (mod_bot > wp->w_topline)
+ mod_top = wp->w_topline;
+#ifdef FEAT_SYN_HL
+ else if (syntax_present(buf))
+ top_end = 1;
+#endif
+ }
+ }
+
+ /*
+ * When only displaying the lines at the top, set top_end. Used when
+ * window has scrolled down for msg_scrolled.
+ */
+ if (type == REDRAW_TOP)
+ {
+ j = 0;
+ for (i = 0; i < wp->w_lines_valid; ++i)
+ {
+ j += wp->w_lines[i].wl_size;
+ if (j >= wp->w_upd_rows)
+ {
+ top_end = j;
+ break;
+ }
+ }
+ if (top_end == 0)
+ /* not found (cannot happen?): redraw everything */
+ type = NOT_VALID;
+ else
+ /* top area defined, the rest is VALID */
+ type = VALID;
+ }
+
+ /*
+ * If there are no changes on the screen that require a complete redraw,
+ * handle three cases:
+ * 1: we are off the top of the screen by a few lines: scroll down
+ * 2: wp->w_topline is below wp->w_lines[0].wl_lnum: may scroll up
+ * 3: wp->w_topline is wp->w_lines[0].wl_lnum: find first entry in
+ * w_lines[] that needs updating.
+ */
+ if ((type == VALID || type == INVERTED || type == INVERTED_ALL)
+#ifdef FEAT_DIFF
+ && !wp->w_botfill && !wp->w_old_botfill
+#endif
+ )
+ {
+ if (mod_top != 0 && wp->w_topline == mod_top)
+ {
+ /*
+ * w_topline is the first changed line, the scrolling will be done
+ * further down.
+ */
+ }
+ else if (wp->w_lines[0].wl_valid
+ && (wp->w_topline < wp->w_lines[0].wl_lnum
+#ifdef FEAT_DIFF
+ || (wp->w_topline == wp->w_lines[0].wl_lnum
+ && wp->w_topfill > wp->w_old_topfill)
+#endif
+ ))
+ {
+ /*
+ * New topline is above old topline: May scroll down.
+ */
+#ifdef FEAT_FOLDING
+ if (hasAnyFolding(wp))
+ {
+ linenr_T ln;
+
+ /* count the number of lines we are off, counting a sequence
+ * of folded lines as one */
+ j = 0;
+ for (ln = wp->w_topline; ln < wp->w_lines[0].wl_lnum; ++ln)
+ {
+ ++j;
+ if (j >= wp->w_height - 2)
+ break;
+ (void)hasFoldingWin(wp, ln, NULL, &ln, TRUE, NULL);
+ }
+ }
+ else
+#endif
+ j = wp->w_lines[0].wl_lnum - wp->w_topline;
+ if (j < wp->w_height - 2) /* not too far off */
+ {
+ i = plines_m_win(wp, wp->w_topline, wp->w_lines[0].wl_lnum - 1);
+#ifdef FEAT_DIFF
+ /* insert extra lines for previously invisible filler lines */
+ if (wp->w_lines[0].wl_lnum != wp->w_topline)
+ i += diff_check_fill(wp, wp->w_lines[0].wl_lnum)
+ - wp->w_old_topfill;
+#endif
+ if (i < wp->w_height - 2) /* less than a screen off */
+ {
+ /*
+ * Try to insert the correct number of lines.
+ * If not the last window, delete the lines at the bottom.
+ * win_ins_lines may fail when the terminal can't do it.
+ */
+ if (i > 0)
+ check_for_delay(FALSE);
+ if (win_ins_lines(wp, 0, i, FALSE, wp == firstwin) == OK)
+ {
+ if (wp->w_lines_valid != 0)
+ {
+ /* Need to update rows that are new, stop at the
+ * first one that scrolled down. */
+ top_end = i;
+#ifdef FEAT_VISUAL
+ scrolled_down = TRUE;
+#endif
+
+ /* Move the entries that were scrolled, disable
+ * the entries for the lines to be redrawn. */
+ if ((wp->w_lines_valid += j) > wp->w_height)
+ wp->w_lines_valid = wp->w_height;
+ for (idx = wp->w_lines_valid; idx - j >= 0; idx--)
+ wp->w_lines[idx] = wp->w_lines[idx - j];
+ while (idx >= 0)
+ wp->w_lines[idx--].wl_valid = FALSE;
+ }
+ }
+ else
+ mid_start = 0; /* redraw all lines */
+ }
+ else
+ mid_start = 0; /* redraw all lines */
+ }
+ else
+ mid_start = 0; /* redraw all lines */
+ }
+ else
+ {
+ /*
+ * New topline is at or below old topline: May scroll up.
+ * When topline didn't change, find first entry in w_lines[] that
+ * needs updating.
+ */
+
+ /* try to find wp->w_topline in wp->w_lines[].wl_lnum */
+ j = -1;
+ row = 0;
+ for (i = 0; i < wp->w_lines_valid; i++)
+ {
+ if (wp->w_lines[i].wl_valid
+ && wp->w_lines[i].wl_lnum == wp->w_topline)
+ {
+ j = i;
+ break;
+ }
+ row += wp->w_lines[i].wl_size;
+ }
+ if (j == -1)
+ {
+ /* if wp->w_topline is not in wp->w_lines[].wl_lnum redraw all
+ * lines */
+ mid_start = 0;
+ }
+ else
+ {
+ /*
+ * Try to delete the correct number of lines.
+ * wp->w_topline is at wp->w_lines[i].wl_lnum.
+ */
+#ifdef FEAT_DIFF
+ /* If the topline didn't change, delete old filler lines,
+ * otherwise delete filler lines of the new topline... */
+ if (wp->w_lines[0].wl_lnum == wp->w_topline)
+ row += wp->w_old_topfill;
+ else
+ row += diff_check_fill(wp, wp->w_topline);
+ /* ... but don't delete new filler lines. */
+ row -= wp->w_topfill;
+#endif
+ if (row > 0)
+ {
+ check_for_delay(FALSE);
+ if (win_del_lines(wp, 0, row, FALSE, wp == firstwin) == OK)
+ bot_start = wp->w_height - row;
+ else
+ mid_start = 0; /* redraw all lines */
+ }
+ if ((row == 0 || bot_start < 999) && wp->w_lines_valid != 0)
+ {
+ /*
+ * Skip the lines (below the deleted lines) that are still
+ * valid and don't need redrawing. Copy their info
+ * upwards, to compensate for the deleted lines. Set
+ * bot_start to the first row that needs redrawing.
+ */
+ bot_start = 0;
+ idx = 0;
+ for (;;)
+ {
+ wp->w_lines[idx] = wp->w_lines[j];
+ /* stop at line that didn't fit, unless it is still
+ * valid (no lines deleted) */
+ if (row > 0 && bot_start + row
+ + (int)wp->w_lines[j].wl_size > wp->w_height)
+ {
+ wp->w_lines_valid = idx + 1;
+ break;
+ }
+ bot_start += wp->w_lines[idx++].wl_size;
+
+ /* stop at the last valid entry in w_lines[].wl_size */
+ if (++j >= wp->w_lines_valid)
+ {
+ wp->w_lines_valid = idx;
+ break;
+ }
+ }
+#ifdef FEAT_DIFF
+ /* Correct the first entry for filler lines at the top
+ * when it won't get updated below. */
+ if (wp->w_p_diff && bot_start > 0)
+ wp->w_lines[0].wl_size =
+ plines_win_nofill(wp, wp->w_topline, TRUE)
+ + wp->w_topfill;
+#endif
+ }
+ }
+ }
+
+ /* When starting redraw in the first line, redraw all lines. When
+ * there is only one window it's probably faster to clear the screen
+ * first. */
+ if (mid_start == 0)
+ {
+ mid_end = wp->w_height;
+ if (lastwin == firstwin)
+ screenclear();
+ }
+ }
+ else
+ {
+ /* Not VALID or INVERTED: redraw all lines. */
+ mid_start = 0;
+ mid_end = wp->w_height;
+ }
+
+#ifdef FEAT_VISUAL
+ /* check if we are updating or removing the inverted part */
+ if ((VIsual_active && buf == curwin->w_buffer)
+ || (wp->w_old_cursor_lnum != 0 && type != NOT_VALID))
+ {
+ linenr_T from, to;
+
+ if (VIsual_active)
+ {
+ if (VIsual_active
+ && (VIsual_mode != wp->w_old_visual_mode
+ || type == INVERTED_ALL))
+ {
+ /*
+ * If the type of Visual selection changed, redraw the whole
+ * selection. Also when the ownership of the X selection is
+ * gained or lost.
+ */
+ if (curwin->w_cursor.lnum < VIsual.lnum)
+ {
+ from = curwin->w_cursor.lnum;
+ to = VIsual.lnum;
+ }
+ else
+ {
+ from = VIsual.lnum;
+ to = curwin->w_cursor.lnum;
+ }
+ /* redraw more when the cursor moved as well */
+ if (wp->w_old_cursor_lnum < from)
+ from = wp->w_old_cursor_lnum;
+ if (wp->w_old_cursor_lnum > to)
+ to = wp->w_old_cursor_lnum;
+ if (wp->w_old_visual_lnum < from)
+ from = wp->w_old_visual_lnum;
+ if (wp->w_old_visual_lnum > to)
+ to = wp->w_old_visual_lnum;
+ }
+ else
+ {
+ /*
+ * Find the line numbers that need to be updated: The lines
+ * between the old cursor position and the current cursor
+ * position. Also check if the Visual position changed.
+ */
+ if (curwin->w_cursor.lnum < wp->w_old_cursor_lnum)
+ {
+ from = curwin->w_cursor.lnum;
+ to = wp->w_old_cursor_lnum;
+ }
+ else
+ {
+ from = wp->w_old_cursor_lnum;
+ to = curwin->w_cursor.lnum;
+ if (from == 0) /* Visual mode just started */
+ from = to;
+ }
+
+ if (VIsual.lnum != wp->w_old_visual_lnum)
+ {
+ if (wp->w_old_visual_lnum < from
+ && wp->w_old_visual_lnum != 0)
+ from = wp->w_old_visual_lnum;
+ if (wp->w_old_visual_lnum > to)
+ to = wp->w_old_visual_lnum;
+ if (VIsual.lnum < from)
+ from = VIsual.lnum;
+ if (VIsual.lnum > to)
+ to = VIsual.lnum;
+ }
+ }
+
+ /*
+ * If in block mode and changed column or curwin->w_curswant:
+ * update all lines.
+ * First compute the actual start and end column.
+ */
+ if (VIsual_mode == Ctrl_V)
+ {
+ colnr_T fromc, toc;
+
+ getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
+ ++toc;
+ if (curwin->w_curswant == MAXCOL)
+ toc = MAXCOL;
+
+ if (fromc != wp->w_old_cursor_fcol
+ || toc != wp->w_old_cursor_lcol)
+ {
+ if (from > VIsual.lnum)
+ from = VIsual.lnum;
+ if (to < VIsual.lnum)
+ to = VIsual.lnum;
+ }
+ wp->w_old_cursor_fcol = fromc;
+ wp->w_old_cursor_lcol = toc;
+ }
+ }
+ else
+ {
+ /* Use the line numbers of the old Visual area. */
+ if (wp->w_old_cursor_lnum < wp->w_old_visual_lnum)
+ {
+ from = wp->w_old_cursor_lnum;
+ to = wp->w_old_visual_lnum;
+ }
+ else
+ {
+ from = wp->w_old_visual_lnum;
+ to = wp->w_old_cursor_lnum;
+ }
+ }
+
+ /*
+ * There is no need to update lines above the top of the window.
+ */
+ if (from < wp->w_topline)
+ from = wp->w_topline;
+
+ /*
+ * If we know the value of w_botline, use it to restrict the update to
+ * the lines that are visible in the window.
+ */
+ if (wp->w_valid & VALID_BOTLINE)
+ {
+ if (from >= wp->w_botline)
+ from = wp->w_botline - 1;
+ if (to >= wp->w_botline)
+ to = wp->w_botline - 1;
+ }
+
+ /*
+ * Find the minimal part to be updated.
+ * Watch out for scrolling that made entries in w_lines[] invalid.
+ * E.g., CTRL-U makes the first half of w_lines[] invalid and sets
+ * top_end; need to redraw from top_end to the "to" line.
+ * A middle mouse click with a Visual selection may change the text
+ * above the Visual area and reset wl_valid, do count these for
+ * mid_end (in srow).
+ */
+ if (mid_start > 0)
+ {
+ lnum = wp->w_topline;
+ idx = 0;
+ srow = 0;
+ if (scrolled_down)
+ mid_start = top_end;
+ else
+ mid_start = 0;
+ while (lnum < from && idx < wp->w_lines_valid) /* find start */
+ {
+ if (wp->w_lines[idx].wl_valid)
+ mid_start += wp->w_lines[idx].wl_size;
+ else if (!scrolled_down)
+ srow += wp->w_lines[idx].wl_size;
+ ++idx;
+# ifdef FEAT_FOLDING
+ if (idx < wp->w_lines_valid && wp->w_lines[idx].wl_valid)
+ lnum = wp->w_lines[idx].wl_lnum;
+ else
+# endif
+ ++lnum;
+ }
+ srow += mid_start;
+ mid_end = wp->w_height;
+ for ( ; idx < wp->w_lines_valid; ++idx) /* find end */
+ {
+ if (wp->w_lines[idx].wl_valid
+ && wp->w_lines[idx].wl_lnum >= to + 1)
+ {
+ /* Only update until first row of this line */
+ mid_end = srow;
+ break;
+ }
+ srow += wp->w_lines[idx].wl_size;
+ }
+ }
+ }
+
+ if (VIsual_active && buf == curwin->w_buffer)
+ {
+ wp->w_old_visual_mode = VIsual_mode;
+ wp->w_old_cursor_lnum = curwin->w_cursor.lnum;
+ wp->w_old_visual_lnum = VIsual.lnum;
+ wp->w_old_curswant = curwin->w_curswant;
+ }
+ else
+ {
+ wp->w_old_visual_mode = 0;
+ wp->w_old_cursor_lnum = 0;
+ wp->w_old_visual_lnum = 0;
+ }
+#endif /* FEAT_VISUAL */
+
+#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
+ /* reset got_int, otherwise regexp won't work */
+ save_got_int = got_int;
+ got_int = 0;
+#endif
+#ifdef FEAT_FOLDING
+ win_foldinfo.fi_level = 0;
+#endif
+
+ /*
+ * Update all the window rows.
+ */
+ idx = 0; /* first entry in w_lines[].wl_size */
+ row = 0;
+ srow = 0;
+ lnum = wp->w_topline; /* first line shown in window */
+ for (;;)
+ {
+ /* stop updating when reached the end of the window (check for _past_
+ * the end of the window is at the end of the loop) */
+ if (row == wp->w_height)
+ {
+ didline = TRUE;
+ break;
+ }
+
+ /* stop updating when hit the end of the file */
+ if (lnum > buf->b_ml.ml_line_count)
+ {
+ eof = TRUE;
+ break;
+ }
+
+ /* Remember the starting row of the line that is going to be dealt
+ * with. It is used further down when the line doesn't fit. */
+ srow = row;
+
+ /*
+ * Update a line when it is in an area that needs updating, when it
+ * has changes or w_lines[idx] is invalid.
+ * bot_start may be halfway a wrapped line after using
+ * win_del_lines(), check if the current line includes it.
+ * When syntax folding is being used, the saved syntax states will
+ * already have been updated, we can't see where the syntax state is
+ * the same again, just update until the end of the window.
+ */
+ if (row < top_end
+ || (row >= mid_start && row < mid_end)
+#ifdef FEAT_SEARCH_EXTRA
+ || top_to_mod
+#endif
+ || idx >= wp->w_lines_valid
+ || (row + wp->w_lines[idx].wl_size > bot_start)
+ || (mod_top != 0
+ && (lnum == mod_top
+ || (lnum >= mod_top
+ && (lnum < mod_bot
+#ifdef FEAT_SYN_HL
+ || did_update == DID_FOLD
+ || (did_update == DID_LINE
+ && syntax_present(buf)
+ && (
+# ifdef FEAT_FOLDING
+ (foldmethodIsSyntax(wp)
+ && hasAnyFolding(wp)) ||
+# endif
+ syntax_check_changed(lnum)))
+#endif
+ )))))
+ {
+#ifdef FEAT_SEARCH_EXTRA
+ if (lnum == mod_top)
+ top_to_mod = FALSE;
+#endif
+
+ /*
+ * When at start of changed lines: May scroll following lines
+ * up or down to minimize redrawing.
+ * Don't do this when the change continues until the end.
+ * Don't scroll when dollar_vcol is non-zero, keep the "$".
+ */
+ if (lnum == mod_top
+ && mod_bot != MAXLNUM
+ && !(dollar_vcol != 0 && mod_bot == mod_top + 1))
+ {
+ int old_rows = 0;
+ int new_rows = 0;
+ int xtra_rows;
+ linenr_T l;
+
+ /* Count the old number of window rows, using w_lines[], which
+ * should still contain the sizes for the lines as they are
+ * currently displayed. */
+ for (i = idx; i < wp->w_lines_valid; ++i)
+ {
+ /* Only valid lines have a meaningful wl_lnum. Invalid
+ * lines are part of the changed area. */
+ if (wp->w_lines[i].wl_valid
+ && wp->w_lines[i].wl_lnum == mod_bot)
+ break;
+ old_rows += wp->w_lines[i].wl_size;
+#ifdef FEAT_FOLDING
+ if (wp->w_lines[i].wl_valid
+ && wp->w_lines[i].wl_lastlnum + 1 == mod_bot)
+ {
+ /* Must have found the last valid entry above mod_bot.
+ * Add following invalid entries. */
+ ++i;
+ while (i < wp->w_lines_valid
+ && !wp->w_lines[i].wl_valid)
+ old_rows += wp->w_lines[i++].wl_size;
+ break;
+ }
+#endif
+ }
+
+ if (i >= wp->w_lines_valid)
+ {
+ /* We can't find a valid line below the changed lines,
+ * need to redraw until the end of the window.
+ * Inserting/deleting lines has no use. */
+ bot_start = 0;
+ }
+ else
+ {
+ /* Able to count old number of rows: Count new window
+ * rows, and may insert/delete lines */
+ j = idx;
+ for (l = lnum; l < mod_bot; ++l)
+ {
+#ifdef FEAT_FOLDING
+ if (hasFoldingWin(wp, l, NULL, &l, TRUE, NULL))
+ ++new_rows;
+ else
+#endif
+#ifdef FEAT_DIFF
+ if (l == wp->w_topline)
+ new_rows += plines_win_nofill(wp, l, TRUE)
+ + wp->w_topfill;
+ else
+#endif
+ new_rows += plines_win(wp, l, TRUE);
+ ++j;
+ if (new_rows > wp->w_height - row - 2)
+ {
+ /* it's getting too much, must redraw the rest */
+ new_rows = 9999;
+ break;
+ }
+ }
+ xtra_rows = new_rows - old_rows;
+ if (xtra_rows < 0)
+ {
+ /* May scroll text up. If there is not enough
+ * remaining text or scrolling fails, must redraw the
+ * rest. If scrolling works, must redraw the text
+ * below the scrolled text. */
+ if (row - xtra_rows >= wp->w_height - 2)
+ mod_bot = MAXLNUM;
+ else
+ {
+ check_for_delay(FALSE);
+ if (win_del_lines(wp, row,
+ -xtra_rows, FALSE, FALSE) == FAIL)
+ mod_bot = MAXLNUM;
+ else
+ bot_start = wp->w_height + xtra_rows;
+ }
+ }
+ else if (xtra_rows > 0)
+ {
+ /* May scroll text down. If there is not enough
+ * remaining text of scrolling fails, must redraw the
+ * rest. */
+ if (row + xtra_rows >= wp->w_height - 2)
+ mod_bot = MAXLNUM;
+ else
+ {
+ check_for_delay(FALSE);
+ if (win_ins_lines(wp, row + old_rows,
+ xtra_rows, FALSE, FALSE) == FAIL)
+ mod_bot = MAXLNUM;
+ else if (top_end > row + old_rows)
+ /* Scrolled the part at the top that requires
+ * updating down. */
+ top_end += xtra_rows;
+ }
+ }
+
+ /* When not updating the rest, may need to move w_lines[]
+ * entries. */
+ if (mod_bot != MAXLNUM && i != j)
+ {
+ if (j < i)
+ {
+ int x = row + new_rows;
+
+ /* move entries in w_lines[] upwards */
+ for (;;)
+ {
+ /* stop at last valid entry in w_lines[] */
+ if (i >= wp->w_lines_valid)
+ {
+ wp->w_lines_valid = j;
+ break;
+ }
+ wp->w_lines[j] = wp->w_lines[i];
+ /* stop at a line that won't fit */
+ if (x + (int)wp->w_lines[j].wl_size
+ > wp->w_height)
+ {
+ wp->w_lines_valid = j + 1;
+ break;
+ }
+ x += wp->w_lines[j++].wl_size;
+ ++i;
+ }
+ if (bot_start > x)
+ bot_start = x;
+ }
+ else /* j > i */
+ {
+ /* move entries in w_lines[] downwards */
+ j -= i;
+ wp->w_lines_valid += j;
+ if (wp->w_lines_valid > wp->w_height)
+ wp->w_lines_valid = wp->w_height;
+ for (i = wp->w_lines_valid; i - j >= idx; --i)
+ wp->w_lines[i] = wp->w_lines[i - j];
+
+ /* The w_lines[] entries for inserted lines are
+ * now invalid, but wl_size may be used above.
+ * Reset to zero. */
+ while (i >= idx)
+ {
+ wp->w_lines[i].wl_size = 0;
+ wp->w_lines[i--].wl_valid = FALSE;
+ }
+ }
+ }
+ }
+
+ /* When inserting or deleting lines and 'number' is set:
+ * Redraw all lines below the change to update the line
+ * numbers. */
+ if (buf->b_mod_xlines != 0 && wp->w_p_nu)
+ bot_start = 0;
+ }
+
+#ifdef FEAT_FOLDING
+ /*
+ * When lines are folded, display one line for all of them.
+ * Otherwise, display normally (can be several display lines when
+ * 'wrap' is on).
+ */
+ fold_count = foldedCount(wp, lnum, &win_foldinfo);
+ if (fold_count != 0)
+ {
+ fold_line(wp, fold_count, &win_foldinfo, lnum, row);
+ ++row;
+ --fold_count;
+ wp->w_lines[idx].wl_folded = TRUE;
+ wp->w_lines[idx].wl_lastlnum = lnum + fold_count;
+# ifdef FEAT_SYN_HL
+ did_update = DID_FOLD;
+# endif
+ }
+ else
+#endif
+ if (idx < wp->w_lines_valid
+ && wp->w_lines[idx].wl_valid
+ && wp->w_lines[idx].wl_lnum == lnum
+ && lnum > wp->w_topline
+ && !(dy_flags & DY_LASTLINE)
+ && srow + wp->w_lines[idx].wl_size > wp->w_height
+#ifdef FEAT_DIFF
+ && diff_check_fill(wp, lnum) == 0
+#endif
+ )
+ {
+ /* This line is not going to fit. Don't draw anything here,
+ * will draw "@ " lines below. */
+ row = wp->w_height + 1;
+ }
+ else
+ {
+#ifdef FEAT_SEARCH_EXTRA
+ prepare_search_hl(wp, lnum);
+#endif
+#ifdef FEAT_SYN_HL
+ /* Let the syntax stuff know we skipped a few lines. */
+ if (syntax_last_parsed != 0 && syntax_last_parsed + 1 < lnum
+ && syntax_present(buf))
+ syntax_end_parsing(syntax_last_parsed + 1);
+#endif
+
+ /*
+ * Display one line.
+ */
+ row = win_line(wp, lnum, srow, wp->w_height);
+
+#ifdef FEAT_FOLDING
+ wp->w_lines[idx].wl_folded = FALSE;
+ wp->w_lines[idx].wl_lastlnum = lnum;
+#endif
+#ifdef FEAT_SYN_HL
+ did_update = DID_LINE;
+ syntax_last_parsed = lnum;
+#endif
+ }
+
+ wp->w_lines[idx].wl_lnum = lnum;
+ wp->w_lines[idx].wl_valid = TRUE;
+ if (row > wp->w_height) /* past end of screen */
+ {
+ /* we may need the size of that too long line later on */
+ if (dollar_vcol == 0)
+ wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
+ ++idx;
+ break;
+ }
+ if (dollar_vcol == 0)
+ wp->w_lines[idx].wl_size = row - srow;
+ ++idx;
+#ifdef FEAT_FOLDING
+ lnum += fold_count + 1;
+#else
+ ++lnum;
+#endif
+ }
+ else
+ {
+ /* This line does not need updating, advance to the next one */
+ row += wp->w_lines[idx++].wl_size;
+ if (row > wp->w_height) /* past end of screen */
+ break;
+#ifdef FEAT_FOLDING
+ lnum = wp->w_lines[idx - 1].wl_lastlnum + 1;
+#else
+ ++lnum;
+#endif
+#ifdef FEAT_SYN_HL
+ did_update = DID_NONE;
+#endif
+ }
+
+ if (lnum > buf->b_ml.ml_line_count)
+ {
+ eof = TRUE;
+ break;
+ }
+ }
+ /*
+ * End of loop over all window lines.
+ */
+
+
+ if (idx > wp->w_lines_valid)
+ wp->w_lines_valid = idx;
+
+#ifdef FEAT_SYN_HL
+ /*
+ * Let the syntax stuff know we stop parsing here.
+ */
+ if (syntax_last_parsed != 0 && syntax_present(buf))
+ syntax_end_parsing(syntax_last_parsed + 1);
+#endif
+
+ /*
+ * If we didn't hit the end of the file, and we didn't finish the last
+ * line we were working on, then the line didn't fit.
+ */
+ wp->w_empty_rows = 0;
+#ifdef FEAT_DIFF
+ wp->w_filler_rows = 0;
+#endif
+ if (!eof && !didline)
+ {
+ if (lnum == wp->w_topline)
+ {
+ /*
+ * Single line that does not fit!
+ * Don't overwrite it, it can be edited.
+ */
+ wp->w_botline = lnum + 1;
+ }
+#ifdef FEAT_DIFF
+ else if (diff_check_fill(wp, lnum) >= wp->w_height - srow)
+ {
+ /* Window ends in filler lines. */
+ wp->w_botline = lnum;
+ wp->w_filler_rows = wp->w_height - srow;
+ }
+#endif
+ else if (dy_flags & DY_LASTLINE) /* 'display' has "lastline" */
+ {
+ /*
+ * Last line isn't finished: Display "@@@" at the end.
+ */
+ screen_fill(W_WINROW(wp) + wp->w_height - 1,
+ W_WINROW(wp) + wp->w_height,
+ (int)W_ENDCOL(wp) - 3, (int)W_ENDCOL(wp),
+ '@', '@', hl_attr(HLF_AT));
+ set_empty_rows(wp, srow);
+ wp->w_botline = lnum;
+ }
+ else
+ {
+ win_draw_end(wp, '@', ' ', srow, wp->w_height, HLF_AT);
+ wp->w_botline = lnum;
+ }
+ }
+ else
+ {
+#ifdef FEAT_VERTSPLIT
+ draw_vsep_win(wp, row);
+#endif
+ if (eof) /* we hit the end of the file */
+ {
+ wp->w_botline = buf->b_ml.ml_line_count + 1;
+#ifdef FEAT_DIFF
+ j = diff_check_fill(wp, wp->w_botline);
+ if (j > 0 && !wp->w_botfill)
+ {
+ /*
+ * Display filler lines at the end of the file
+ */
+ if (char2cells(fill_diff) > 1)
+ i = '-';
+ else
+ i = fill_diff;
+ if (row + j > wp->w_height)
+ j = wp->w_height - row;
+ win_draw_end(wp, i, i, row, row + (int)j, HLF_DED);
+ row += j;
+ }
+#endif
+ }
+ else if (dollar_vcol == 0)
+ wp->w_botline = lnum;
+
+ /* make sure the rest of the screen is blank */
+ /* put '~'s on rows that aren't part of the file. */
+ win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_AT);
+ }
+
+ /* Reset the type of redrawing required, the window has been updated. */
+ wp->w_redr_type = 0;
+#ifdef FEAT_DIFF
+ wp->w_old_topfill = wp->w_topfill;
+ wp->w_old_botfill = wp->w_botfill;
+#endif
+
+ if (dollar_vcol == 0)
+ {
+ /*
+ * There is a trick with w_botline. If we invalidate it on each
+ * change that might modify it, this will cause a lot of expensive
+ * calls to plines() in update_topline() each time. Therefore the
+ * value of w_botline is often approximated, and this value is used to
+ * compute the value of w_topline. If the value of w_botline was
+ * wrong, check that the value of w_topline is correct (cursor is on
+ * the visible part of the text). If it's not, we need to redraw
+ * again. Mostly this just means scrolling up a few lines, so it
+ * doesn't look too bad. Only do this for the current window (where
+ * changes are relevant).
+ */
+ wp->w_valid |= VALID_BOTLINE;
+ if (wp == curwin && wp->w_botline != old_botline && !recursive)
+ {
+ recursive = TRUE;
+ curwin->w_valid &= ~VALID_TOPLINE;
+ update_topline(); /* may invalidate w_botline again */
+ if (must_redraw != 0)
+ {
+ /* Don't update for changes in buffer again. */
+ i = curbuf->b_mod_set;
+ curbuf->b_mod_set = FALSE;
+ win_update(curwin);
+ must_redraw = 0;
+ curbuf->b_mod_set = i;
+ }
+ recursive = FALSE;
+ }
+ }
+
+#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
+ /* restore got_int, unless CTRL-C was hit while redrawing */
+ if (!got_int)
+ got_int = save_got_int;
+#endif
+}
+
+#ifdef FEAT_SIGNS
+static int draw_signcolumn __ARGS((win_T *wp));
+
+/*
+ * Return TRUE when window "wp" has a column to draw signs in.
+ */
+ static int
+draw_signcolumn(wp)
+ win_T *wp;
+{
+ return (wp->w_buffer->b_signlist != NULL
+# ifdef FEAT_NETBEANS_INTG
+ || usingNetbeans
+# endif
+ );
+}
+#endif
+
+/*
+ * Clear the rest of the window and mark the unused lines with "c1". use "c2"
+ * as the filler character.
+ */
+ static void
+win_draw_end(wp, c1, c2, row, endrow, hl)
+ win_T *wp;
+ int c1;
+ int c2;
+ int row;
+ int endrow;
+ enum hlf_value hl;
+{
+#if defined(FEAT_FOLDING) || defined(FEAT_SIGNS) || defined(FEAT_CMDWIN)
+ int n = 0;
+# define FDC_OFF n
+#else
+# define FDC_OFF 0
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ /* No check for cmdline window: should never be right-left. */
+# ifdef FEAT_FOLDING
+ n = wp->w_p_fdc;
+
+ if (n > 0)
+ {
+ /* draw the fold column at the right */
+ if (n > wp->w_width)
+ n = wp->w_width;
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_ENDCOL(wp) - n, (int)W_ENDCOL(wp),
+ ' ', ' ', hl_attr(HLF_FC));
+ }
+# endif
+# ifdef FEAT_SIGNS
+ if (draw_signcolumn(wp))
+ {
+ int nn = n + 2;
+
+ /* draw the sign column left of the fold column */
+ if (nn > wp->w_width)
+ nn = wp->w_width;
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n,
+ ' ', ' ', hl_attr(HLF_SC));
+ n = nn;
+ }
+# endif
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_WINCOL(wp), W_ENDCOL(wp) - 1 - FDC_OFF,
+ c2, c2, hl_attr(hl));
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_ENDCOL(wp) - 1 - FDC_OFF, W_ENDCOL(wp) - FDC_OFF,
+ c1, c2, hl_attr(hl));
+ }
+ else
+#endif
+ {
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && wp == curwin)
+ {
+ /* draw the cmdline character in the leftmost column */
+ n = 1;
+ if (n > wp->w_width)
+ n = wp->w_width;
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_WINCOL(wp), (int)W_WINCOL(wp) + n,
+ cmdwin_type, ' ', hl_attr(HLF_AT));
+ }
+#endif
+#ifdef FEAT_FOLDING
+ if (wp->w_p_fdc > 0)
+ {
+ int nn = n + wp->w_p_fdc;
+
+ /* draw the fold column at the left */
+ if (nn > W_WIDTH(wp))
+ nn = W_WIDTH(wp);
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_WINCOL(wp) + n, (int)W_WINCOL(wp) + nn,
+ ' ', ' ', hl_attr(HLF_FC));
+ n = nn;
+ }
+#endif
+#ifdef FEAT_SIGNS
+ if (draw_signcolumn(wp))
+ {
+ int nn = n + 2;
+
+ /* draw the sign column after the fold column */
+ if (nn > W_WIDTH(wp))
+ nn = W_WIDTH(wp);
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_WINCOL(wp) + n, (int)W_WINCOL(wp) + nn,
+ ' ', ' ', hl_attr(HLF_SC));
+ n = nn;
+ }
+#endif
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow,
+ W_WINCOL(wp) + FDC_OFF, (int)W_ENDCOL(wp),
+ c1, c2, hl_attr(hl));
+ }
+ set_empty_rows(wp, row);
+}
+
+#ifdef FEAT_FOLDING
+/*
+ * Display one folded line.
+ */
+ static void
+fold_line(wp, fold_count, foldinfo, lnum, row)
+ win_T *wp;
+ long fold_count;
+ foldinfo_T *foldinfo;
+ linenr_T lnum;
+ int row;
+{
+ char_u buf[51];
+ pos_T *top, *bot;
+ linenr_T lnume = lnum + fold_count - 1;
+ int len;
+ char_u *p;
+ char_u *text = NULL;
+ int fdc;
+ int level;
+ int col;
+ int txtcol;
+ int off = (int)(current_ScreenLine - ScreenLines);
+
+ /* Build the fold line:
+ * 1. Add the cmdwin_type for the command-line window
+ * 2. Add the 'foldcolumn'
+ * 3. Add the 'number' column
+ * 4. Compose the text
+ * 5. Add the text
+ * 6. set highlighting for the Visual area an other text
+ */
+ col = 0;
+
+ /*
+ * 1. Add the cmdwin_type for the command-line window
+ * Ignores 'rightleft', this window is never right-left.
+ */
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && wp == curwin)
+ {
+ ScreenLines[off] = cmdwin_type;
+ ScreenAttrs[off] = hl_attr(HLF_AT);
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ ScreenLinesUC[off] = 0;
+#endif
+ ++col;
+ }
+#endif
+
+ /*
+ * 2. Add the 'foldcolumn'
+ */
+ fdc = wp->w_p_fdc;
+ if (fdc > W_WIDTH(wp) - col)
+ fdc = W_WIDTH(wp) - col;
+ if (fdc > 0)
+ {
+ fill_foldcolumn(buf, wp, TRUE, lnum);
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ int i;
+
+ copy_text_attr(off + W_WIDTH(wp) - fdc - col, buf, fdc,
+ hl_attr(HLF_FC));
+ /* reverse the fold column */
+ for (i = 0; i < fdc; ++i)
+ ScreenLines[off + W_WIDTH(wp) - i - 1 - col] = buf[i];
+ }
+ else
+#endif
+ copy_text_attr(off + col, buf, fdc, hl_attr(HLF_FC));
+ col += fdc;
+ }
+
+#ifdef FEAT_RIGHTLEFT
+# define RL_MEMSET(p, v, l) vim_memset(ScreenAttrs + off + (wp->w_p_rl ? (W_WIDTH(wp) - (p) - (l)) : (p)), v, l)
+#else
+# define RL_MEMSET(p, v, l) vim_memset(ScreenAttrs + off + p, v, l)
+#endif
+
+ /* Set all attributes of the 'number' column and the text */
+ RL_MEMSET(col, hl_attr(HLF_FL), (size_t)(W_WIDTH(wp) - col));
+
+#ifdef FEAT_SIGNS
+ /* If signs are being displayed, add two spaces. */
+ if (draw_signcolumn(wp))
+ {
+ len = W_WIDTH(wp) - col;
+ if (len > 0)
+ {
+ if (len > 2)
+ len = 2;
+# ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ /* the line number isn't reversed */
+ copy_text_attr(off + W_WIDTH(wp) - len - col,
+ (char_u *)" ", len, hl_attr(HLF_FL));
+ else
+# endif
+ copy_text_attr(off + col, (char_u *)" ", len, hl_attr(HLF_FL));
+ col += len;
+ }
+ }
+#endif
+
+ /*
+ * 3. Add the 'number' column
+ */
+ if (wp->w_p_nu)
+ {
+ len = W_WIDTH(wp) - col;
+ if (len > 0)
+ {
+ if (len > 8)
+ len = 8;
+ sprintf((char *)buf, "%7ld ", (long)lnum);
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ /* the line number isn't reversed */
+ copy_text_attr(off + W_WIDTH(wp) - len - col, buf, len,
+ hl_attr(HLF_FL));
+ else
+#endif
+ copy_text_attr(off + col, buf, len, hl_attr(HLF_FL));
+ col += len;
+ }
+ }
+
+ /*
+ * 4. Compose the folded-line string with 'foldtext', if set.
+ */
+#ifdef FEAT_EVAL
+ if (*wp->w_p_fdt != NUL)
+ {
+ char_u dashes[51];
+ win_T *save_curwin;
+
+ /* Set "v:foldstart" and "v:foldend". */
+ set_vim_var_nr(VV_FOLDSTART, lnum);
+ set_vim_var_nr(VV_FOLDEND, lnume);
+
+ /* Set "v:folddashes" to a string of "level" dashes. */
+ /* Set "v:foldlevel" to "level". */
+ level = foldinfo->fi_level;
+ if (level > 50)
+ level = 50;
+ vim_memset(dashes, '-', (size_t)level);
+ dashes[level] = NUL;
+ set_vim_var_string(VV_FOLDDASHES, dashes, -1);
+ set_vim_var_nr(VV_FOLDLEVEL, (long)level);
+ save_curwin = curwin;
+ curwin = wp;
+ curbuf = wp->w_buffer;
+
+ ++emsg_off;
+ text = eval_to_string_safe(wp->w_p_fdt, NULL);
+ --emsg_off;
+
+ curwin = save_curwin;
+ curbuf = curwin->w_buffer;
+ set_vim_var_string(VV_FOLDDASHES, NULL, -1);
+
+ if (text != NULL)
+ {
+ /* Replace unprintable characters, if there are any. But
+ * replace a TAB with a space. */
+ for (p = text; *p != NUL; ++p)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (len = (*mb_ptr2len_check)(p)) > 1)
+ {
+ if (!vim_isprintc((*mb_ptr2char)(p)))
+ break;
+ p += len - 1;
+ }
+ else
+#endif
+ if (*p == TAB)
+ *p = ' ';
+ else if (ptr2cells(p) > 1)
+ break;
+ }
+ if (*p != NUL)
+ {
+ p = transstr(text);
+ vim_free(text);
+ text = p;
+ }
+ }
+ }
+ if (text == NULL)
+#endif
+ {
+ sprintf((char *)buf, _("+--%3ld lines folded "), fold_count);
+ text = buf;
+ }
+
+ txtcol = col; /* remember where text starts */
+
+ /*
+ * 5. move the text to current_ScreenLine. Fill up with "fill_fold".
+ * Right-left text is put in columns 0 - number-col, normal text is put
+ * in columns number-col - window-width.
+ */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int cells;
+ int u8c, u8c_c1, u8c_c2;
+ int idx;
+ int c_len;
+# ifdef FEAT_ARABIC
+ int prev_c = 0; /* previous Arabic character */
+ int prev_c1 = 0; /* first composing char for prev_c */
+# endif
+
+# ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ idx = off;
+ else
+# endif
+ idx = off + col;
+
+ /* Store multibyte characters in ScreenLines[] et al. correctly. */
+ for (p = text; *p != NUL; )
+ {
+ cells = (*mb_ptr2cells)(p);
+ c_len = (*mb_ptr2len_check)(p);
+ if (col + cells > W_WIDTH(wp)
+# ifdef FEAT_RIGHTLEFT
+ - (wp->w_p_rl ? col : 0)
+# endif
+ )
+ break;
+ ScreenLines[idx] = *p;
+ if (enc_utf8)
+ {
+ u8c = utfc_ptr2char(p, &u8c_c1, &u8c_c2);
+ if (*p < 0x80 && u8c_c1 == 0 && u8c_c2 == 0)
+ {
+ ScreenLinesUC[idx] = 0;
+#ifdef FEAT_ARABIC
+ prev_c = u8c;
+#endif
+ }
+ else
+ {
+#ifdef FEAT_ARABIC
+ if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
+ {
+ /* Do Arabic shaping. */
+ int pc, pc1, nc, dummy;
+ int firstbyte = *p;
+
+ /* The idea of what is the previous and next
+ * character depends on 'rightleft'. */
+ if (wp->w_p_rl)
+ {
+ pc = prev_c;
+ pc1 = prev_c1;
+ nc = utf_ptr2char(p + c_len);
+ prev_c1 = u8c_c1;
+ }
+ else
+ {
+ pc = utfc_ptr2char(p + c_len, &pc1, &dummy);
+ nc = prev_c;
+ }
+ prev_c = u8c;
+
+ u8c = arabic_shape(u8c, &firstbyte, &u8c_c1,
+ pc, pc1, nc);
+ ScreenLines[idx] = firstbyte;
+ }
+ else
+ prev_c = u8c;
+#endif
+ /* Non-BMP character: display as ? or fullwidth ?. */
+ if (u8c >= 0x10000)
+ ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
+ else
+ ScreenLinesUC[idx] = u8c;
+ ScreenLinesC1[idx] = u8c_c1;
+ ScreenLinesC2[idx] = u8c_c2;
+ }
+ if (cells > 1)
+ ScreenLines[idx + 1] = 0;
+ }
+ else if (cells > 1) /* double-byte character */
+ {
+ if (enc_dbcs == DBCS_JPNU && *p == 0x8e)
+ ScreenLines2[idx] = p[1];
+ else
+ ScreenLines[idx + 1] = p[1];
+ }
+ col += cells;
+ idx += cells;
+ p += c_len;
+ }
+ }
+ else
+#endif
+ {
+ len = (int)STRLEN(text);
+ if (len > W_WIDTH(wp) - col)
+ len = W_WIDTH(wp) - col;
+ if (len > 0)
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ STRNCPY(current_ScreenLine, text, len);
+ else
+#endif
+ STRNCPY(current_ScreenLine + col, text, len);
+ col += len;
+ }
+ }
+
+ /* Fill the rest of the line with the fold filler */
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ col -= txtcol;
+#endif
+ while (col < W_WIDTH(wp)
+#ifdef FEAT_RIGHTLEFT
+ - (wp->w_p_rl ? txtcol : 0)
+#endif
+ )
+ {
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ if (fill_fold >= 0x80)
+ {
+ ScreenLinesUC[off + col] = fill_fold;
+ ScreenLinesC1[off + col] = 0;
+ ScreenLinesC2[off + col] = 0;
+ }
+ else
+ ScreenLinesUC[off + col] = 0;
+ }
+#endif
+ ScreenLines[off + col++] = fill_fold;
+ }
+
+ if (text != buf)
+ vim_free(text);
+
+ /*
+ * 6. set highlighting for the Visual area an other text.
+ * If all folded lines are in the Visual area, highlight the line.
+ */
+#ifdef FEAT_VISUAL
+ if (VIsual_active && wp->w_buffer == curwin->w_buffer)
+ {
+ if (ltoreq(curwin->w_cursor, VIsual))
+ {
+ /* Visual is after curwin->w_cursor */
+ top = &curwin->w_cursor;
+ bot = &VIsual;
+ }
+ else
+ {
+ /* Visual is before curwin->w_cursor */
+ top = &VIsual;
+ bot = &curwin->w_cursor;
+ }
+ if (lnum >= top->lnum
+ && lnume <= bot->lnum
+ && (VIsual_mode != 'v'
+ || ((lnum > top->lnum
+ || (lnum == top->lnum
+ && top->col == 0))
+ && (lnume < bot->lnum
+ || (lnume == bot->lnum
+ && (bot->col - (*p_sel == 'e'))
+ >= STRLEN(ml_get_buf(wp->w_buffer, lnume, FALSE)))))))
+ {
+ if (VIsual_mode == Ctrl_V)
+ {
+ /* Visual block mode: highlight the chars part of the block */
+ if (wp->w_old_cursor_fcol + txtcol < (colnr_T)W_WIDTH(wp))
+ {
+ if (wp->w_old_cursor_lcol + txtcol < (colnr_T)W_WIDTH(wp))
+ len = wp->w_old_cursor_lcol;
+ else
+ len = W_WIDTH(wp) - txtcol;
+ RL_MEMSET(wp->w_old_cursor_fcol + txtcol, hl_attr(HLF_V),
+ (size_t)(len - wp->w_old_cursor_fcol));
+ }
+ }
+ else
+ /* Set all attributes of the text */
+ RL_MEMSET(txtcol, hl_attr(HLF_V),
+ (size_t)(W_WIDTH(wp) - txtcol));
+ }
+ }
+#endif
+
+
+ SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
+ (int)W_WIDTH(wp), FALSE);
+
+ /*
+ * Update w_cline_height and w_cline_folded if the cursor line was
+ * updated (saves a call to plines() later).
+ */
+ if (wp == curwin
+ && lnum <= curwin->w_cursor.lnum
+ && lnume >= curwin->w_cursor.lnum)
+ {
+ curwin->w_cline_row = row;
+ curwin->w_cline_height = 1;
+ curwin->w_cline_folded = TRUE;
+ curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
+ }
+}
+
+/*
+ * Copy "buf[len]" to ScreenLines["off"] and set attributes to "attr".
+ */
+ static void
+copy_text_attr(off, buf, len, attr)
+ int off;
+ char_u *buf;
+ int len;
+ int attr;
+{
+ mch_memmove(ScreenLines + off, buf, (size_t)len);
+# ifdef FEAT_MBYTE
+ if (enc_utf8)
+ vim_memset(ScreenLinesUC + off, 0, sizeof(u8char_T) * (size_t)len);
+# endif
+ vim_memset(ScreenAttrs + off, attr, (size_t)len);
+}
+
+/*
+ * Fill the foldcolumn at "p" for window "wp".
+ */
+ static void
+fill_foldcolumn(p, wp, closed, lnum)
+ char_u *p;
+ win_T *wp;
+ int closed; /* TRUE of FALSE */
+ linenr_T lnum; /* current line number */
+{
+ int i = 0;
+ int level;
+ int first_level;
+
+ /* Init to all spaces. */
+ copy_spaces(p, (size_t)wp->w_p_fdc);
+
+ level = win_foldinfo.fi_level;
+ if (level > 0)
+ {
+ /* If the column is too narrow, we start at the lowest level that
+ * fits and use numbers to indicated the depth. */
+ first_level = level - wp->w_p_fdc - closed + 2;
+ if (first_level < 1)
+ first_level = 1;
+
+ for (i = 0; i + 1 < wp->w_p_fdc; ++i)
+ {
+ if (win_foldinfo.fi_lnum == lnum
+ && first_level + i >= win_foldinfo.fi_low_level)
+ p[i] = '-';
+ else if (first_level == 1)
+ p[i] = '|';
+ else if (first_level + i <= 9)
+ p[i] = '0' + first_level + i;
+ else
+ p[i] = '>';
+ if (first_level + i == level)
+ break;
+ }
+ }
+ if (closed)
+ p[i] = '+';
+}
+#endif /* FEAT_FOLDING */
+
+/*
+ * Display line "lnum" of window 'wp' on the screen.
+ * Start at row "startrow", stop when "endrow" is reached.
+ * wp->w_virtcol needs to be valid.
+ *
+ * Return the number of last row the line occupies.
+ */
+ static int
+win_line(wp, lnum, startrow, endrow)
+ win_T *wp;
+ linenr_T lnum;
+ int startrow;
+ int endrow;
+{
+ int col; /* visual column on screen */
+ unsigned off; /* offset in ScreenLines/ScreenAttrs */
+ int c = 0; /* init for GCC */
+ long vcol = 0; /* virtual column (for tabs) */
+ long vcol_prev = -1; /* "vcol" of previous character */
+ char_u *line; /* current line */
+ char_u *ptr; /* current position in "line" */
+ int row; /* row in the window, excl w_winrow */
+ int screen_row; /* row on the screen, incl w_winrow */
+
+ char_u extra[18]; /* "%ld" and 'fdc' must fit in here */
+ int n_extra = 0; /* number of extra chars */
+ char_u *p_extra = NULL; /* string of extra chars */
+ int c_extra = NUL; /* extra chars, all the same */
+ int extra_attr = 0; /* attributes when n_extra != 0 */
+ static char_u *at_end_str = (char_u *)""; /* used for p_extra when
+ displaying lcs_eol at end-of-line */
+ int lcs_eol_one = lcs_eol; /* lcs_eol until it's been used */
+ int lcs_prec_todo = lcs_prec; /* lcs_prec until it's been used */
+
+ /* saved "extra" items for when draw_state becomes WL_LINE (again) */
+ int saved_n_extra = 0;
+ char_u *saved_p_extra = NULL;
+ int saved_c_extra = 0;
+ int saved_char_attr = 0;
+
+ int n_attr = 0; /* chars with special attr */
+ int saved_attr2 = 0; /* char_attr saved for n_attr */
+ int n_attr3 = 0; /* chars with overruling special attr */
+ int saved_attr3 = 0; /* char_attr saved for n_attr3 */
+
+ int n_skip = 0; /* nr of chars to skip for 'nowrap' */
+
+ int fromcol, tocol; /* start/end of inverting */
+ int fromcol_prev = -2; /* start of inverting after cursor */
+ int noinvcur = FALSE; /* don't invert the cursor */
+#ifdef FEAT_VISUAL
+ pos_T *top, *bot;
+#endif
+ pos_T pos;
+ long v;
+
+ int char_attr = 0; /* attributes for next character */
+ int area_highlighting = FALSE; /* Visual or incsearch highlighting
+ in this line */
+ int attr = 0; /* attributes for area highlighting */
+ int area_attr = 0; /* attributes desired by highlighting */
+ int search_attr = 0; /* attributes desired by 'hlsearch' */
+#ifdef FEAT_SYN_HL
+ int syntax_attr = 0; /* attributes desired by syntax */
+ int has_syntax = FALSE; /* this buffer has syntax highl. */
+ int save_did_emsg;
+#endif
+ int extra_check; /* has syntax or linebreak */
+#ifdef FEAT_MBYTE
+ int multi_attr = 0; /* attributes desired by multibyte */
+ int mb_l = 1; /* multi-byte byte length */
+ int mb_c = 0; /* decoded multi-byte character */
+ int mb_utf8 = FALSE; /* screen char is UTF-8 char */
+ int u8c_c1 = 0; /* first composing UTF-8 char */
+ int u8c_c2 = 0; /* second composing UTF-8 char */
+#endif
+#ifdef FEAT_DIFF
+ int filler_lines; /* nr of filler lines to be drawn */
+ int filler_todo; /* nr of filler lines still to do + 1 */
+ enum hlf_value diff_hlf = (enum hlf_value)0; /* type of diff highlighting */
+ int change_start = MAXCOL; /* first col of changed area */
+ int change_end = -1; /* last col of changed area */
+#endif
+ colnr_T trailcol = MAXCOL; /* start of trailing spaces */
+#ifdef FEAT_LINEBREAK
+ int need_showbreak = FALSE;
+#endif
+#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS))
+# define LINE_ATTR
+ int line_attr = 0; /* atrribute for the whole line */
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ match_T *shl; /* points to search_hl or match_hl */
+#endif
+#ifdef FEAT_ARABIC
+ int prev_c = 0; /* previous Arabic character */
+ int prev_c1 = 0; /* first composing char for prev_c */
+#endif
+
+ /* draw_state: items that are drawn in sequence: */
+#define WL_START 0 /* nothing done yet */
+#ifdef FEAT_CMDWIN
+# define WL_CMDLINE WL_START + 1 /* cmdline window column */
+#else
+# define WL_CMDLINE WL_START
+#endif
+#ifdef FEAT_FOLDING
+# define WL_FOLD WL_CMDLINE + 1 /* 'foldcolumn' */
+#else
+# define WL_FOLD WL_CMDLINE
+#endif
+#ifdef FEAT_SIGNS
+# define WL_SIGN WL_FOLD + 1 /* column for signs */
+#else
+# define WL_SIGN WL_FOLD /* column for signs */
+#endif
+#define WL_NR WL_SIGN + 1 /* line number */
+#if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF)
+# define WL_SBR WL_NR + 1 /* 'showbreak' or 'diff' */
+#else
+# define WL_SBR WL_NR
+#endif
+#define WL_LINE WL_SBR + 1 /* text in the line */
+ int draw_state = WL_START; /* what to draw next */
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ int feedback_col = 0;
+ int feedback_old_attr = -1;
+#endif
+
+
+ if (startrow > endrow) /* past the end already! */
+ return startrow;
+
+ row = startrow;
+ screen_row = row + W_WINROW(wp);
+
+ /*
+ * To speed up the loop below, set extra_check when there is linebreak,
+ * trailing white space and/or syntax processing to be done.
+ */
+#ifdef FEAT_LINEBREAK
+ extra_check = wp->w_p_lbr;
+#else
+ extra_check = 0;
+#endif
+#ifdef FEAT_SYN_HL
+ if (syntax_present(wp->w_buffer))
+ {
+ /* Prepare for syntax highlighting in this line. When there is an
+ * error, stop syntax highlighting. */
+ save_did_emsg = did_emsg;
+ did_emsg = FALSE;
+ syntax_start(wp, lnum);
+ if (did_emsg)
+ syntax_clear(wp->w_buffer);
+ else
+ {
+ did_emsg = save_did_emsg;
+ has_syntax = TRUE;
+ extra_check = TRUE;
+ }
+ }
+#endif
+
+ /*
+ * handle visual active in this window
+ */
+ fromcol = -10;
+ tocol = MAXCOL;
+#ifdef FEAT_VISUAL
+ if (VIsual_active && wp->w_buffer == curwin->w_buffer)
+ {
+ /* Visual is after curwin->w_cursor */
+ if (ltoreq(curwin->w_cursor, VIsual))
+ {
+ top = &curwin->w_cursor;
+ bot = &VIsual;
+ }
+ else /* Visual is before curwin->w_cursor */
+ {
+ top = &VIsual;
+ bot = &curwin->w_cursor;
+ }
+ if (VIsual_mode == Ctrl_V) /* block mode */
+ {
+ if (lnum >= top->lnum && lnum <= bot->lnum)
+ {
+ fromcol = wp->w_old_cursor_fcol;
+ tocol = wp->w_old_cursor_lcol;
+ }
+ }
+ else /* non-block mode */
+ {
+ if (lnum > top->lnum && lnum <= bot->lnum)
+ fromcol = 0;
+ else if (lnum == top->lnum)
+ {
+ if (VIsual_mode == 'V') /* linewise */
+ fromcol = 0;
+ else
+ {
+ getvvcol(wp, top, (colnr_T *)&fromcol, NULL, NULL);
+ if (gchar_pos(top) == NUL)
+ tocol = fromcol + 1;
+ }
+ }
+ if (VIsual_mode != 'V' && lnum == bot->lnum)
+ {
+ if (*p_sel == 'e' && bot->col == 0
+#ifdef FEAT_VIRTUALEDIT
+ && bot->coladd == 0
+#endif
+ )
+ {
+ fromcol = -10;
+ tocol = MAXCOL;
+ }
+ else
+ {
+ pos = *bot;
+ if (*p_sel == 'e')
+ getvvcol(wp, &pos, (colnr_T *)&tocol, NULL, NULL);
+ else
+ {
+ getvvcol(wp, &pos, NULL, NULL, (colnr_T *)&tocol);
+ ++tocol;
+ }
+ }
+ }
+ }
+
+#ifndef MSDOS
+ /* Check if the character under the cursor should not be inverted */
+ if (!highlight_match && lnum == curwin->w_cursor.lnum && wp == curwin
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ )
+ noinvcur = TRUE;
+#endif
+
+ /* if inverting in this line set area_highlighting */
+ if (fromcol >= 0)
+ {
+ area_highlighting = TRUE;
+ attr = hl_attr(HLF_V);
+#if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
+ if (clip_star.available && !clip_star.owned && clip_isautosel())
+ attr = hl_attr(HLF_VNC);
+#endif
+ }
+ }
+
+ /*
+ * handle 'insearch' and ":s///c" highlighting
+ */
+ else
+#endif /* FEAT_VISUAL */
+ if (highlight_match
+ && wp == curwin
+ && lnum >= curwin->w_cursor.lnum
+ && lnum <= curwin->w_cursor.lnum + search_match_lines)
+ {
+ if (lnum == curwin->w_cursor.lnum)
+ getvcol(curwin, &(curwin->w_cursor),
+ (colnr_T *)&fromcol, NULL, NULL);
+ else
+ fromcol = 0;
+ if (lnum == curwin->w_cursor.lnum + search_match_lines)
+ {
+ pos.lnum = lnum;
+ pos.col = search_match_endcol;
+ getvcol(curwin, &pos, (colnr_T *)&tocol, NULL, NULL);
+ }
+ else
+ tocol = MAXCOL;
+ if (fromcol == tocol) /* do at least one character */
+ tocol = fromcol + 1; /* happens when past end of line */
+ area_highlighting = TRUE;
+ attr = hl_attr(HLF_I);
+ }
+
+#ifdef FEAT_DIFF
+ filler_lines = diff_check(wp, lnum);
+ if (filler_lines < 0)
+ {
+ if (filler_lines == -1)
+ {
+ if (diff_find_change(wp, lnum, &change_start, &change_end))
+ diff_hlf = HLF_ADD; /* added line */
+ else if (change_start == 0)
+ diff_hlf = HLF_TXD; /* changed text */
+ else
+ diff_hlf = HLF_CHD; /* changed line */
+ }
+ else
+ diff_hlf = HLF_ADD; /* added line */
+ filler_lines = 0;
+ area_highlighting = TRUE;
+ }
+ if (lnum == wp->w_topline)
+ filler_lines = wp->w_topfill;
+ filler_todo = filler_lines;
+#endif
+
+#ifdef LINE_ATTR
+# ifdef FEAT_SIGNS
+ /* If this line has a sign with line highlighting set line_attr. */
+ v = buf_getsigntype(wp->w_buffer, lnum, SIGN_LINEHL);
+ if (v != 0)
+ line_attr = sign_get_attr((int)v, TRUE);
+# endif
+# if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ /* Highlight the current line in the quickfix window. */
+ if (bt_quickfix(wp->w_buffer) && qf_current_entry() == lnum)
+ line_attr = hl_attr(HLF_L);
+# endif
+ if (line_attr != 0)
+ area_highlighting = TRUE;
+#endif
+
+ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ ptr = line;
+
+ /* find start of trailing whitespace */
+ if (wp->w_p_list && lcs_trail)
+ {
+ trailcol = (colnr_T)STRLEN(ptr);
+ while (trailcol > (colnr_T)0 && vim_iswhite(ptr[trailcol - 1]))
+ --trailcol;
+ trailcol += (colnr_T) (ptr - line);
+ extra_check = TRUE;
+ }
+
+ /*
+ * 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the
+ * first character to be displayed.
+ */
+ if (wp->w_p_wrap)
+ v = wp->w_skipcol;
+ else
+ v = wp->w_leftcol;
+ if (v > 0)
+ {
+#ifdef FEAT_MBYTE
+ char_u *prev_ptr = ptr;
+#endif
+ while (vcol < v && *ptr != NUL)
+ {
+ c = win_lbr_chartabsize(wp, ptr, (colnr_T)vcol, NULL);
+ vcol += c;
+#ifdef FEAT_MBYTE
+ prev_ptr = ptr;
+ if (has_mbyte)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+#endif
+ ++ptr;
+ }
+
+#ifdef FEAT_VIRTUALEDIT
+ /* When 'virtualedit' is set the end of the line may be before the
+ * start of the displayed part. */
+ if (vcol < v && *ptr == NUL && virtual_active())
+ vcol = v;
+#endif
+
+ /* Handle a character that's not completely on the screen: Put ptr at
+ * that character but skip the first few screen characters. */
+ if (vcol > v)
+ {
+ vcol -= c;
+#ifdef FEAT_MBYTE
+ ptr = prev_ptr;
+#else
+ --ptr;
+#endif
+ n_skip = v - vcol;
+ }
+
+ /*
+ * Adjust for when the inverted text is before the screen,
+ * and when the start of the inverted text is before the screen.
+ */
+ if (tocol <= vcol)
+ fromcol = 0;
+ else if (fromcol >= 0 && fromcol < vcol)
+ fromcol = vcol;
+
+#ifdef FEAT_LINEBREAK
+ /* When w_skipcol is non-zero, first line needs 'showbreak' */
+ if (wp->w_p_wrap)
+ need_showbreak = TRUE;
+#endif
+ }
+
+ /*
+ * Correct highlighting for cursor that can't be disabled.
+ * Avoids having to check this for each character.
+ */
+ if (fromcol >= 0)
+ {
+ if (noinvcur)
+ {
+ if ((colnr_T)fromcol == wp->w_virtcol)
+ {
+ /* highlighting starts at cursor, let it start just after the
+ * cursor */
+ fromcol_prev = fromcol;
+ fromcol = -1;
+ }
+ else if ((colnr_T)fromcol < wp->w_virtcol)
+ /* restart highlighting after the cursor */
+ fromcol_prev = wp->w_virtcol;
+ }
+ if (fromcol >= tocol)
+ fromcol = -1;
+ }
+
+#ifdef FEAT_SEARCH_EXTRA
+ /*
+ * Handle highlighting the last used search pattern.
+ * Do this for both search_hl and match_hl.
+ */
+ shl = &search_hl;
+ for (;;)
+ {
+ shl->startp = NULL;
+ shl->endp = NULL;
+ shl->attr_cur = 0;
+ if (shl->rm.regprog != NULL)
+ {
+ v = (long)(ptr - line);
+ next_search_hl(wp, shl, lnum, (colnr_T)v);
+
+ /* Need to get the line again, a multi-line regexp may have made it
+ * invalid. */
+ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ ptr = line + v;
+
+ if (shl->lnum != 0 && shl->lnum <= lnum)
+ {
+ if (shl->lnum == lnum)
+ shl->startp = line + shl->rm.startpos[0].col;
+ else
+ shl->startp = line;
+ if (lnum == shl->lnum + shl->rm.endpos[0].lnum
+ - shl->rm.startpos[0].lnum)
+ shl->endp = line + shl->rm.endpos[0].col;
+ else
+ shl->endp = line + MAXCOL;
+ /* Highlight one character for an empty match. */
+ if (shl->startp == shl->endp)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && *shl->endp != NUL)
+ shl->endp += (*mb_ptr2len_check)(shl->endp);
+ else
+#endif
+ ++shl->endp;
+ }
+ if (shl->startp < ptr) /* match at leftcol */
+ {
+ shl->attr_cur = shl->attr;
+ search_attr = shl->attr;
+ }
+ area_highlighting = TRUE;
+ }
+ }
+ if (shl == &match_hl)
+ break;
+ shl = &match_hl;
+ }
+#endif
+
+ off = (unsigned) (current_ScreenLine - ScreenLines);
+ col = 0;
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ /* Rightleft window: process the text in the normal direction, but put
+ * it in current_ScreenLine[] from right to left. Start at the
+ * rightmost column of the window. */
+ col = W_WIDTH(wp) - 1;
+ off += col;
+ }
+#endif
+
+ /*
+ * Repeat for the whole displayed line.
+ */
+ for (;;)
+ {
+ /* Skip this quickly when working on the text. */
+ if (draw_state != WL_LINE)
+ {
+#ifdef FEAT_CMDWIN
+ if (draw_state == WL_CMDLINE - 1 && n_extra == 0)
+ {
+ draw_state = WL_CMDLINE;
+ if (cmdwin_type != 0 && wp == curwin)
+ {
+ /* Draw the cmdline character. */
+ *extra = cmdwin_type;
+ n_extra = 1;
+ p_extra = extra;
+ c_extra = NUL;
+ char_attr = hl_attr(HLF_AT);
+ }
+ }
+#endif
+
+#ifdef FEAT_FOLDING
+ if (draw_state == WL_FOLD - 1 && n_extra == 0)
+ {
+ draw_state = WL_FOLD;
+ if (wp->w_p_fdc > 0)
+ {
+ /* Draw the 'foldcolumn'. */
+ fill_foldcolumn(extra, wp, FALSE, lnum);
+ n_extra = wp->w_p_fdc;
+ p_extra = extra;
+ c_extra = NUL;
+ char_attr = hl_attr(HLF_FC);
+ }
+ }
+#endif
+
+#ifdef FEAT_SIGNS
+ if (draw_state == WL_SIGN - 1 && n_extra == 0)
+ {
+ draw_state = WL_SIGN;
+ /* Show the sign column when there are any signs in this
+ * buffer or when using Netbeans. */
+ if (draw_signcolumn(wp)
+# ifdef FEAT_DIFF
+ && filler_todo <= 0
+# endif
+ )
+ {
+ int_u text_sign;
+# ifdef FEAT_SIGN_ICONS
+ int_u icon_sign;
+# endif
+
+ /* Draw two cells with the sign value or blank. */
+ c_extra = ' ';
+ char_attr = hl_attr(HLF_SC);
+ n_extra = 2;
+
+ if (row == startrow)
+ {
+ text_sign = buf_getsigntype(wp->w_buffer, lnum,
+ SIGN_TEXT);
+# ifdef FEAT_SIGN_ICONS
+ icon_sign = buf_getsigntype(wp->w_buffer, lnum,
+ SIGN_ICON);
+ if (gui.in_use && icon_sign != 0)
+ {
+ /* Use the image in this position. */
+ c_extra = SIGN_BYTE;
+# ifdef FEAT_NETBEANS_INTG
+ if (buf_signcount(wp->w_buffer, lnum) > 1)
+ c_extra = MULTISIGN_BYTE;
+# endif
+ char_attr = icon_sign;
+ }
+ else
+# endif
+ if (text_sign != 0)
+ {
+ p_extra = sign_get_text(text_sign);
+ if (p_extra != NULL)
+ {
+ c_extra = NUL;
+ n_extra = STRLEN(p_extra);
+ }
+ char_attr = sign_get_attr(text_sign, FALSE);
+ }
+ }
+ }
+ }
+#endif
+
+ if (draw_state == WL_NR - 1 && n_extra == 0)
+ {
+ draw_state = WL_NR;
+ /* Display the line number. After the first fill with blanks
+ * when the 'n' flag isn't in 'cpo' */
+ if (wp->w_p_nu
+ && (row == startrow
+#ifdef FEAT_DIFF
+ + filler_lines
+#endif
+ || vim_strchr(p_cpo, CPO_NUMCOL) == NULL))
+ {
+ /* Draw the line number (empty space after wrapping). */
+ if (row == startrow
+#ifdef FEAT_DIFF
+ + filler_lines
+#endif
+ )
+ {
+ sprintf((char *)extra, "%7ld ", (long)lnum);
+ if (wp->w_skipcol > 0)
+ for (p_extra = extra; *p_extra == ' '; ++p_extra)
+ *p_extra = '-';
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl) /* reverse line numbers */
+ rl_mirror(extra);
+#endif
+ p_extra = extra;
+ c_extra = NUL;
+ }
+ else
+ c_extra = ' ';
+ n_extra = 8;
+ char_attr = hl_attr(HLF_N);
+ }
+ }
+
+#if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF)
+ if (draw_state == WL_SBR - 1 && n_extra == 0)
+ {
+ draw_state = WL_SBR;
+# ifdef FEAT_DIFF
+ if (filler_todo > 0)
+ {
+ /* Draw "deleted" diff line(s). */
+ if (char2cells(fill_diff) > 1)
+ c_extra = '-';
+ else
+ c_extra = fill_diff;
+# ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ n_extra = col + 1;
+ else
+# endif
+ n_extra = W_WIDTH(wp) - col;
+ char_attr = hl_attr(HLF_DED);
+ }
+# endif
+# ifdef FEAT_LINEBREAK
+ if (*p_sbr != NUL && need_showbreak)
+ {
+ /* Draw 'showbreak' at the start of each broken line. */
+ p_extra = p_sbr;
+ c_extra = NUL;
+ n_extra = (int)STRLEN(p_sbr);
+ char_attr = hl_attr(HLF_AT);
+ need_showbreak = FALSE;
+ /* Correct end of highlighted area for 'showbreak',
+ * required when 'linebreak' is also set. */
+ if (tocol == vcol)
+ tocol += n_extra;
+ }
+# endif
+ }
+#endif
+
+ if (draw_state == WL_LINE - 1 && n_extra == 0)
+ {
+ draw_state = WL_LINE;
+ if (saved_n_extra)
+ {
+ /* Continue item from end of wrapped line. */
+ n_extra = saved_n_extra;
+ c_extra = saved_c_extra;
+ p_extra = saved_p_extra;
+ char_attr = saved_char_attr;
+ }
+ else
+ char_attr = 0;
+ }
+ }
+
+ /* When still displaying '$' of change command, stop at cursor */
+ if (dollar_vcol != 0 && wp == curwin && vcol >= (long)wp->w_virtcol
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ )
+ {
+ SCREEN_LINE(screen_row, W_WINCOL(wp), col, -(int)W_WIDTH(wp),
+ wp->w_p_rl);
+ /* Pretend we have finished updating the window. */
+ row = wp->w_height;
+ break;
+ }
+
+ if (draw_state == WL_LINE && area_highlighting)
+ {
+ /* handle Visual or match highlighting in this line */
+ if (vcol == fromcol
+#ifdef FEAT_MBYTE
+ || (has_mbyte && vcol + 1 == fromcol && n_extra == 0
+ && (*mb_ptr2cells)(ptr) > 1)
+#endif
+ || ((int)vcol_prev == fromcol_prev
+ && vcol < tocol))
+ area_attr = attr; /* start highlighting */
+ else if (area_attr != 0
+ && (vcol == tocol
+ || (noinvcur && (colnr_T)vcol == wp->w_virtcol)))
+#ifdef LINE_ATTR
+ area_attr = line_attr; /* stop highlighting */
+ else if (line_attr && ((fromcol == -10 && tocol == MAXCOL)
+ || (vcol < fromcol || vcol > tocol)))
+ area_attr = line_attr;
+#else
+ area_attr = 0; /* stop highlighting */
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+ if (!n_extra)
+ {
+ /*
+ * Check for start/end of search pattern match.
+ * After end, check for start/end of next match.
+ * When another match, have to check for start again.
+ * Watch out for matching an empty string!
+ * Do this first for search_hl, then for match_hl, so that
+ * ":match" overrules 'hlsearch'.
+ */
+ shl = &search_hl;
+ for (;;)
+ {
+ while (shl->rm.regprog != NULL)
+ {
+ if (shl->startp != NULL
+ && ptr >= shl->startp
+ && ptr < shl->endp)
+ {
+ shl->attr_cur = shl->attr;
+ }
+ else if (ptr == shl->endp)
+ {
+ shl->attr_cur = 0;
+
+ v = (long)(ptr - line);
+ next_search_hl(wp, shl, lnum, (colnr_T)v);
+
+ /* Need to get the line again, a multi-line regexp
+ * may have made it invalid. */
+ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ ptr = line + v;
+
+ if (shl->lnum == lnum)
+ {
+ shl->startp = line + shl->rm.startpos[0].col;
+ if (shl->rm.endpos[0].lnum == 0)
+ shl->endp = line + shl->rm.endpos[0].col;
+ else
+ shl->endp = line + MAXCOL;
+
+ if (shl->startp == shl->endp)
+ {
+ /* highlight empty match, try again after
+ * it */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ shl->endp +=
+ (*mb_ptr2len_check)(shl->endp);
+ else
+#endif
+ ++shl->endp;
+ }
+
+ /* Loop to check if the match starts at the
+ * current position */
+ continue;
+ }
+ }
+ break;
+ }
+ if (shl == &match_hl)
+ break;
+ shl = &match_hl;
+ }
+ /* ":match" highlighting overrules 'hlsearch' */
+ if (match_hl.attr_cur != 0)
+ search_attr = match_hl.attr_cur;
+ else
+ search_attr = search_hl.attr_cur;
+ }
+#endif
+
+ if (area_attr != 0)
+ char_attr = area_attr;
+#ifdef FEAT_SYN_HL
+ else if (search_attr == 0 && has_syntax)
+ char_attr = syntax_attr;
+#endif
+ else
+ char_attr = search_attr;
+
+#ifdef FEAT_DIFF
+ if (diff_hlf != (enum hlf_value)0 && n_extra == 0)
+ {
+ if (diff_hlf == HLF_CHD && ptr - line >= change_start)
+ diff_hlf = HLF_TXD; /* changed text */
+ if (diff_hlf == HLF_TXD && ptr - line > change_end)
+ diff_hlf = HLF_CHD; /* changed line */
+ if (attr == 0 || area_attr != attr)
+ area_attr = hl_attr(diff_hlf);
+ if (attr == 0 || char_attr != attr)
+ {
+ if (search_attr != 0)
+ char_attr = search_attr;
+ else
+ char_attr = hl_attr(diff_hlf);
+ }
+ }
+#endif
+ }
+
+ /*
+ * Get the next character to put on the screen.
+ */
+ /*
+ * The 'extra' array contains the extra stuff that is inserted to
+ * represent special characters (non-printable stuff). When all
+ * characters are the same, c_extra is used.
+ * For the '$' of the 'list' option, n_extra == 1, p_extra == "".
+ */
+ if (n_extra > 0)
+ {
+ if (c_extra != NUL)
+ {
+ c = c_extra;
+#ifdef FEAT_MBYTE
+ mb_c = c; /* doesn't handle non-utf-8 multi-byte! */
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+ else
+ mb_utf8 = FALSE;
+#endif
+ }
+ else
+ {
+ c = *p_extra;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ mb_c = c;
+ if (enc_utf8)
+ {
+ /* If the UTF-8 character is more than one byte:
+ * Decode it into "mb_c". */
+ mb_l = (*mb_ptr2len_check)(p_extra);
+ mb_utf8 = FALSE;
+ if (mb_l > n_extra)
+ mb_l = 1;
+ else if (mb_l > 1)
+ {
+ mb_c = utfc_ptr2char(p_extra, &u8c_c1, &u8c_c2);
+ mb_utf8 = TRUE;
+ }
+ }
+ else
+ {
+ /* if this is a DBCS character, put it in "mb_c" */
+ mb_l = MB_BYTE2LEN(c);
+ if (mb_l >= n_extra)
+ mb_l = 1;
+ else if (mb_l > 1)
+ mb_c = (c << 8) + p_extra[1];
+ }
+ /* If a double-width char doesn't fit display a '>' in the
+ * last column. */
+ if (
+# ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? (col <= 0) :
+# endif
+ (col >= W_WIDTH(wp) - 1)
+ && (*mb_char2cells)(mb_c) == 2)
+ {
+ c = '>';
+ mb_c = c;
+ mb_l = 1;
+ mb_utf8 = FALSE;
+ multi_attr = hl_attr(HLF_AT);
+ /* put the pointer back to output the double-width
+ * character at the start of the next line. */
+ ++n_extra;
+ --p_extra;
+ }
+ else
+ {
+ n_extra -= mb_l - 1;
+ p_extra += mb_l - 1;
+ }
+ }
+#endif
+ ++p_extra;
+ }
+ --n_extra;
+ }
+ else
+ {
+ /*
+ * Get a character from the line itself.
+ */
+ c = *ptr;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ mb_c = c;
+ if (enc_utf8)
+ {
+ /* If the UTF-8 character is more than one byte: Decode it
+ * into "mb_c". */
+ mb_l = (*mb_ptr2len_check)(ptr);
+ mb_utf8 = FALSE;
+ if (mb_l > 1)
+ {
+ mb_c = utfc_ptr2char(ptr, &u8c_c1, &u8c_c2);
+ /* Overlong encoded ASCII or ASCII with composing char
+ * is displayed normally, except a NUL. */
+ if (mb_c < 0x80)
+ c = mb_c;
+ mb_utf8 = TRUE;
+ }
+
+ if ((mb_l == 1 && c >= 0x80)
+ || (mb_l >= 1 && mb_c == 0)
+ || (mb_l > 1 && (!vim_isprintc(mb_c)
+ || mb_c >= 0x10000)))
+ {
+ /*
+ * Illegal UTF-8 byte: display as <xx>.
+ * Non-BMP character : display as ? or fullwidth ?.
+ */
+ if (mb_c < 0x10000)
+ {
+ transchar_hex(extra, mb_c);
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl) /* reverse */
+ rl_mirror(extra);
+#endif
+ }
+ else if (utf_char2cells(mb_c) != 2)
+ STRCPY(extra, "?");
+ else
+ /* 0xff1f in UTF-8: full-width '?' */
+ STRCPY(extra, "\357\274\237");
+
+ p_extra = extra;
+ c = *p_extra;
+ mb_c = mb_ptr2char_adv(&p_extra);
+ mb_utf8 = (c >= 0x80);
+ n_extra = (int)STRLEN(p_extra);
+ c_extra = NUL;
+ if (area_attr == 0 && search_attr == 0)
+ {
+ n_attr = n_extra + 1;
+ extra_attr = hl_attr(HLF_8);
+ saved_attr2 = char_attr; /* save current attr */
+ }
+ }
+ else if (mb_l == 0) /* at the NUL at end-of-line */
+ mb_l = 1;
+#ifdef FEAT_ARABIC
+ else if (p_arshape && !p_tbidi && ARABIC_CHAR(mb_c))
+ {
+ /* Do Arabic shaping. */
+ int pc, pc1, nc, dummy;
+
+ /* The idea of what is the previous and next
+ * character depends on 'rightleft'. */
+ if (wp->w_p_rl)
+ {
+ pc = prev_c;
+ pc1 = prev_c1;
+ nc = utf_ptr2char(ptr + mb_l);
+ prev_c1 = u8c_c1;
+ }
+ else
+ {
+ pc = utfc_ptr2char(ptr + mb_l, &pc1, &dummy);
+ nc = prev_c;
+ }
+ prev_c = mb_c;
+
+ mb_c = arabic_shape(mb_c, &c, &u8c_c1, pc, pc1, nc);
+ }
+ else
+ prev_c = mb_c;
+#endif
+ }
+ else /* enc_dbcs */
+ {
+ mb_l = MB_BYTE2LEN(c);
+ if (mb_l == 0) /* at the NUL at end-of-line */
+ mb_l = 1;
+ else if (mb_l > 1)
+ {
+ /* We assume a second byte below 32 is illegal.
+ * Hopefully this is OK for all double-byte encodings!
+ */
+ if (ptr[1] >= 32)
+ mb_c = (c << 8) + ptr[1];
+ else
+ {
+ if (ptr[1] == NUL)
+ {
+ /* head byte at end of line */
+ mb_l = 1;
+ transchar_nonprint(extra, c);
+ }
+ else
+ {
+ /* illegal tail byte */
+ mb_l = 2;
+ STRCPY(extra, "XX");
+ }
+ p_extra = extra;
+ n_extra = (int)STRLEN(extra) - 1;
+ c_extra = NUL;
+ c = *p_extra++;
+ if (area_attr == 0 && search_attr == 0)
+ {
+ n_attr = n_extra + 1;
+ extra_attr = hl_attr(HLF_8);
+ saved_attr2 = char_attr; /* save current attr */
+ }
+ mb_c = c;
+ }
+ }
+ }
+ /* If a double-width char doesn't fit display a '>' in the
+ * last column; the character is displayed at the start of the
+ * next line. */
+ if ((
+# ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? (col <= 0) :
+# endif
+ (col >= W_WIDTH(wp) - 1))
+ && (*mb_char2cells)(mb_c) == 2)
+ {
+ c = '>';
+ mb_c = c;
+ mb_utf8 = FALSE;
+ mb_l = 1;
+ multi_attr = hl_attr(HLF_AT);
+ /* Put pointer back so that the character will be
+ * displayed at the start of the next line. */
+ --ptr;
+ }
+ else if (*ptr != NUL)
+ ptr += mb_l - 1;
+
+ /* If a double-width char doesn't fit at the left side display
+ * a '<' in the first column. */
+ if (n_skip > 0 && mb_l > 1)
+ {
+ extra[0] = '<';
+ p_extra = extra;
+ n_extra = 1;
+ c_extra = NUL;
+ c = ' ';
+ if (area_attr == 0 && search_attr == 0)
+ {
+ n_attr = n_extra + 1;
+ extra_attr = hl_attr(HLF_AT);
+ saved_attr2 = char_attr; /* save current attr */
+ }
+ mb_c = c;
+ mb_utf8 = FALSE;
+ mb_l = 1;
+ }
+
+ }
+#endif
+ ++ptr;
+
+ if (extra_check)
+ {
+#ifdef FEAT_SYN_HL
+ /* Get syntax attribute, unless still at the start of the line
+ * (double-wide char that doesn't fit). */
+ if (has_syntax && (v = (long)(ptr - line)) > 0)
+ {
+ /* Get the syntax attribute for the character. If there
+ * is an error, disable syntax highlighting. */
+ save_did_emsg = did_emsg;
+ did_emsg = FALSE;
+
+ syntax_attr = get_syntax_attr((colnr_T)v - 1);
+
+ if (did_emsg)
+ syntax_clear(wp->w_buffer);
+ else
+ did_emsg = save_did_emsg;
+
+ /* Need to get the line again, a multi-line regexp may
+ * have made it invalid. */
+ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ ptr = line + v;
+
+ if (area_attr == 0 && search_attr == 0)
+ char_attr = syntax_attr;
+ }
+#endif
+#ifdef FEAT_LINEBREAK
+ /*
+ * Found last space before word: check for line break
+ */
+ if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr)
+ && !wp->w_p_list)
+ {
+ n_extra = win_lbr_chartabsize(wp, ptr - (
+# ifdef FEAT_MBYTE
+ has_mbyte ? mb_l :
+# endif
+ 1), (colnr_T)vcol, NULL) - 1;
+ c_extra = ' ';
+ if (vim_iswhite(c))
+ c = ' ';
+ }
+#endif
+
+ if (trailcol != MAXCOL && ptr > line + trailcol && c == ' ')
+ {
+ c = lcs_trail;
+ if (area_attr == 0 && search_attr == 0)
+ {
+ n_attr = 1;
+ extra_attr = hl_attr(HLF_8);
+ saved_attr2 = char_attr; /* save current attr */
+ }
+#ifdef FEAT_MBYTE
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+ else
+ mb_utf8 = FALSE;
+#endif
+ }
+ }
+
+ /*
+ * Handling of non-printable characters.
+ */
+ if (!(chartab[c] & CT_PRINT_CHAR))
+ {
+ /*
+ * when getting a character from the file, we may have to
+ * turn it into something else on the way to putting it
+ * into "ScreenLines".
+ */
+ if (c == TAB && (!wp->w_p_list || lcs_tab1))
+ {
+ /* tab amount depends on current column */
+ n_extra = (int)wp->w_buffer->b_p_ts
+ - vcol % (int)wp->w_buffer->b_p_ts - 1;
+#ifdef FEAT_MBYTE
+ mb_utf8 = FALSE; /* don't draw as UTF-8 */
+#endif
+ if (wp->w_p_list)
+ {
+ c = lcs_tab1;
+ c_extra = lcs_tab2;
+ n_attr = n_extra + 1;
+ extra_attr = hl_attr(HLF_8);
+ saved_attr2 = char_attr; /* save current attr */
+#ifdef FEAT_MBYTE
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+#endif
+ }
+ else
+ {
+ c_extra = ' ';
+ c = ' ';
+ }
+ }
+ else if (c == NUL && wp->w_p_list && lcs_eol_one > 0)
+ {
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+ /* For a diff line the highlighting continues after the
+ * "$". */
+ if (
+# ifdef FEAT_DIFF
+ diff_hlf == (enum hlf_value)0
+# ifdef LINE_ATTR
+ &&
+# endif
+# endif
+# ifdef LINE_ATTR
+ line_attr == 0
+# endif
+ )
+#endif
+ {
+#ifdef FEAT_VIRTUALEDIT
+ /* In virtualedit, visual selections may extend
+ * beyond end of line. */
+ if (area_highlighting && virtual_active()
+ && tocol != MAXCOL && vcol < tocol)
+ n_extra = 0;
+ else
+#endif
+ {
+ p_extra = at_end_str;
+ n_extra = 1;
+ c_extra = NUL;
+ }
+ }
+ c = lcs_eol;
+ lcs_eol_one = -1;
+ --ptr; /* put it back at the NUL */
+ if (area_attr == 0 && search_attr == 0)
+ {
+ extra_attr = hl_attr(HLF_AT);
+ n_attr = 1;
+ }
+#ifdef FEAT_MBYTE
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+ else
+ mb_utf8 = FALSE; /* don't draw as UTF-8 */
+#endif
+ }
+ else if (c != NUL)
+ {
+ p_extra = transchar(c);
+#ifdef FEAT_RIGHTLEFT
+ if ((dy_flags & DY_UHEX) && wp->w_p_rl)
+ rl_mirror(p_extra); /* reverse "<12>" */
+#endif
+ n_extra = byte2cells(c) - 1;
+ c_extra = NUL;
+ c = *p_extra++;
+ if (area_attr == 0 && search_attr == 0)
+ {
+ n_attr = n_extra + 1;
+ extra_attr = hl_attr(HLF_8);
+ saved_attr2 = char_attr; /* save current attr */
+ }
+#ifdef FEAT_MBYTE
+ mb_utf8 = FALSE; /* don't draw as UTF-8 */
+#endif
+ }
+#ifdef FEAT_VIRTUALEDIT
+ else if (VIsual_active
+ && (VIsual_mode == Ctrl_V
+ || VIsual_mode == 'v')
+ && virtual_active()
+ && tocol != MAXCOL
+ && vcol < tocol
+ && (
+# ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? (col >= 0) :
+# endif
+ (col < W_WIDTH(wp))))
+ {
+ c = ' ';
+ --ptr; /* put it back at the NUL */
+ }
+#endif
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+ else if ((
+# ifdef FEAT_DIFF
+ diff_hlf != (enum hlf_value)0
+# ifdef LINE_ATTR
+ ||
+# endif
+# endif
+# ifdef LINE_ATTR
+ line_attr != 0
+# endif
+ ) && (
+# ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? (col >= 0) :
+# endif
+ (col < W_WIDTH(wp))))
+ {
+ /* Highlight until the right side of the window */
+ c = ' ';
+ --ptr; /* put it back at the NUL */
+# ifdef FEAT_DIFF
+ if (diff_hlf == HLF_TXD)
+ {
+ diff_hlf = HLF_CHD;
+ if (attr == 0 || char_attr != attr)
+ char_attr = hl_attr(diff_hlf);
+ }
+# endif
+ }
+#endif
+ }
+ }
+
+ /* Don't override visual selection highlighting. */
+ if (n_attr > 0
+ && draw_state == WL_LINE
+ && (area_attr == 0 || char_attr != area_attr)
+ && (search_attr == 0 || char_attr != search_attr))
+ char_attr = extra_attr;
+
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ /* XIM don't send preedit_start and preedit_end, but they send
+ * preedit_changed and commit. Thus Vim can't set "im_is_active", use
+ * im_is_preediting() here. */
+ if (xic != NULL
+ && lnum == curwin->w_cursor.lnum
+ && (State & INSERT)
+ && !p_imdisable
+ && im_is_preediting()
+ && draw_state == WL_LINE)
+ {
+ colnr_T tcol;
+
+ if (preedit_end_col == MAXCOL)
+ getvcol(curwin, &(curwin->w_cursor), &tcol, NULL, NULL);
+ else
+ tcol = preedit_end_col;
+ if ((long)preedit_start_col <= vcol && vcol < (long)tcol)
+ {
+ if (feedback_old_attr < 0)
+ {
+ feedback_col = 0;
+ feedback_old_attr = char_attr;
+ }
+ char_attr = im_get_feedback_attr(feedback_col);
+ if (char_attr < 0)
+ char_attr = feedback_old_attr;
+ feedback_col++;
+ }
+ else if (feedback_old_attr >= 0)
+ {
+ char_attr = feedback_old_attr;
+ feedback_old_attr = -1;
+ feedback_col = 0;
+ }
+ }
+#endif
+ /*
+ * Handle the case where we are in column 0 but not on the first
+ * character of the line and the user wants us to show us a
+ * special character (via 'listchars' option "precedes:<char>".
+ */
+ if (lcs_prec_todo != NUL
+ && (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ && draw_state > WL_NR
+ && c != NUL)
+ {
+ c = lcs_prec;
+ lcs_prec_todo = NUL;
+#ifdef FEAT_MBYTE
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+ else
+ mb_utf8 = FALSE; /* don't draw as UTF-8 */
+#endif
+ if ((area_attr == 0 || char_attr != area_attr)
+ && (search_attr == 0 || char_attr != search_attr))
+ {
+ saved_attr3 = char_attr; /* save current attr */
+ char_attr = hl_attr(HLF_AT); /* later copied to char_attr */
+ n_attr3 = 1;
+ }
+ }
+
+ /*
+ * At end of the text line.
+ */
+ if (c == NUL)
+ {
+ /* invert at least one char, used for Visual and empty line or
+ * highlight match at end of line. If it's beyond the last
+ * char on the screen, just overwrite that one (tricky!) Not
+ * needed when a '$' was displayed for 'list'. */
+ if (lcs_eol == lcs_eol_one
+ && ((area_attr != 0 && vcol == fromcol)
+#ifdef FEAT_SEARCH_EXTRA
+ /* highlight 'hlsearch' match at end of line */
+ || ptr - 1 == search_hl.startp
+ || ptr - 1 == match_hl.startp
+#endif
+ ))
+ {
+ int n = 0;
+
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ if (col < 0)
+ n = 1;
+ }
+ else
+#endif
+ {
+ if (col >= W_WIDTH(wp))
+ n = -1;
+ }
+ if (n != 0)
+ {
+ /* At the window boundary, highlight the last character
+ * instead (better than nothing). */
+ off += n;
+ col += n;
+ }
+ else
+ {
+ /* Add a blank character to highlight. */
+ ScreenLines[off] = ' ';
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ ScreenLinesUC[off] = 0;
+#endif
+ }
+#ifdef FEAT_SEARCH_EXTRA
+ if (area_attr == 0)
+ {
+ if (ptr - 1 == match_hl.startp)
+ char_attr = match_hl.attr;
+ else
+ char_attr = search_hl.attr;
+ }
+#endif
+ ScreenAttrs[off] = char_attr;
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ --col;
+ else
+#endif
+ ++col;
+ }
+
+ SCREEN_LINE(screen_row, W_WINCOL(wp), col, (int)W_WIDTH(wp),
+ wp->w_p_rl);
+ row++;
+
+ /*
+ * Update w_cline_height and w_cline_folded if the cursor line was
+ * updated (saves a call to plines() later).
+ */
+ if (wp == curwin && lnum == curwin->w_cursor.lnum)
+ {
+ curwin->w_cline_row = startrow;
+ curwin->w_cline_height = row - startrow;
+#ifdef FEAT_FOLDING
+ curwin->w_cline_folded = FALSE;
+#endif
+ curwin->w_valid |= (VALID_CHEIGHT|VALID_CROW);
+ }
+
+ break;
+ }
+
+ /* line continues beyond line end */
+ if (lcs_ext
+ && !wp->w_p_wrap
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ && (
+#ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? col == 0 :
+#endif
+ col == W_WIDTH(wp) - 1)
+ && (*ptr != NUL
+ || (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str)
+ || (n_extra && (c_extra != NUL || *p_extra != NUL))))
+ {
+ c = lcs_ext;
+ char_attr = hl_attr(HLF_AT);
+#ifdef FEAT_MBYTE
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+ mb_utf8 = TRUE;
+ u8c_c1 = u8c_c2 = 0;
+ }
+ else
+ mb_utf8 = FALSE;
+#endif
+ }
+
+ /*
+ * Store character to be displayed.
+ * Skip characters that are left of the screen for 'nowrap'.
+ */
+ vcol_prev = vcol;
+ if (draw_state < WL_LINE || n_skip <= 0)
+ {
+ /*
+ * Store the character.
+ */
+#if defined(FEAT_RIGHTLEFT) && defined(FEAT_MBYTE)
+ if (has_mbyte && wp->w_p_rl && (*mb_char2cells)(mb_c) > 1)
+ {
+ /* A double-wide character is: put first halve in left cell. */
+ --off;
+ --col;
+ }
+#endif
+ ScreenLines[off] = c;
+#ifdef FEAT_MBYTE
+ if (enc_dbcs == DBCS_JPNU)
+ ScreenLines2[off] = mb_c & 0xff;
+ else if (enc_utf8)
+ {
+ if (mb_utf8)
+ {
+ ScreenLinesUC[off] = mb_c;
+ ScreenLinesC1[off] = u8c_c1;
+ ScreenLinesC2[off] = u8c_c2;
+ }
+ else
+ ScreenLinesUC[off] = 0;
+ }
+ if (multi_attr)
+ {
+ ScreenAttrs[off] = multi_attr;
+ multi_attr = 0;
+ }
+ else
+#endif
+ ScreenAttrs[off] = char_attr;
+
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (*mb_char2cells)(mb_c) > 1)
+ {
+ /* Need to fill two screen columns. */
+ ++off;
+ ++col;
+ if (enc_utf8)
+ /* UTF-8: Put a 0 in the second screen char. */
+ ScreenLines[off] = 0;
+ else
+ /* DBCS: Put second byte in the second screen char. */
+ ScreenLines[off] = mb_c & 0xff;
+ ++vcol;
+ /* When "tocol" is halfway a character, set it to the end of
+ * the character, otherwise highlighting won't stop. */
+ if (tocol == vcol)
+ ++tocol;
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ /* now it's time to backup one cell */
+ --off;
+ --col;
+ }
+#endif
+ }
+#endif
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ --off;
+ --col;
+ }
+ else
+#endif
+ {
+ ++off;
+ ++col;
+ }
+ }
+ else
+ --n_skip;
+
+ /* Only advance the "vcol" when after the 'number' column. */
+ if (draw_state >= WL_SBR
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ )
+ ++vcol;
+
+ /* restore attributes after "predeces" in 'listchars' */
+ if (draw_state > WL_NR && n_attr3 > 0 && --n_attr3 == 0)
+ char_attr = saved_attr3;
+
+ /* restore attributes after last 'listchars' or 'number' char */
+ if (n_attr > 0 && draw_state == WL_LINE && --n_attr == 0)
+ char_attr = saved_attr2;
+
+ /*
+ * At end of screen line and there is more to come: Display the line
+ * so far. If there is no more to display it is catched above.
+ */
+ if ((
+#ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? (col < 0) :
+#endif
+ (col >= W_WIDTH(wp)))
+ && (*ptr != NUL
+#ifdef FEAT_DIFF
+ || filler_todo > 0
+#endif
+ || (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str)
+ || (n_extra != 0 && (c_extra != NUL || *p_extra != NUL)))
+ )
+ {
+ SCREEN_LINE(screen_row, W_WINCOL(wp), col, (int)W_WIDTH(wp),
+ wp->w_p_rl);
+ ++row;
+ ++screen_row;
+
+ /* When not wrapping and finished diff lines, or when displayed
+ * '$' and highlighting until last column, break here. */
+ if ((!wp->w_p_wrap
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ ) || lcs_eol_one == -1)
+ break;
+
+ /* When the window is too narrow draw all "@" lines. */
+ if (draw_state != WL_LINE
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ )
+ {
+ win_draw_end(wp, '@', ' ', row, wp->w_height, HLF_AT);
+#ifdef FEAT_VERTSPLIT
+ draw_vsep_win(wp, row);
+#endif
+ row = endrow;
+ }
+
+ /* When line got too long for screen break here. */
+ if (row == endrow)
+ {
+ ++row;
+ break;
+ }
+
+ if (screen_cur_row == screen_row - 1
+#ifdef FEAT_DIFF
+ && filler_todo <= 0
+#endif
+ && W_WIDTH(wp) == Columns)
+ {
+ /* Remember that the line wraps, used for modeless copy. */
+ LineWraps[screen_row - 1] = TRUE;
+
+ /*
+ * Special trick to make copy/paste of wrapped lines work with
+ * xterm/screen: write an extra character beyond the end of
+ * the line. This will work with all terminal types
+ * (regardless of the xn,am settings).
+ * Only do this on a fast tty.
+ * Only do this if the cursor is on the current line
+ * (something has been written in it).
+ * Don't do this for the GUI.
+ * Don't do this for double-width characters.
+ * Don't do this for a window not at the right screen border.
+ */
+ if (p_tf
+#ifdef FEAT_GUI
+ && !gui.in_use
+#endif
+#ifdef FEAT_MBYTE
+ && !(has_mbyte
+ && ((*mb_off2cells)(LineOffset[screen_row]) == 2
+ || (*mb_off2cells)(LineOffset[screen_row - 1]
+ + (int)Columns - 2) == 2))
+#endif
+ )
+ {
+ /* First make sure we are at the end of the screen line,
+ * then output the same character again to let the
+ * terminal know about the wrap. If the terminal doesn't
+ * auto-wrap, we overwrite the character. */
+ if (screen_cur_col != W_WIDTH(wp))
+ screen_char(LineOffset[screen_row - 1]
+ + (unsigned)Columns - 1,
+ screen_row - 1, (int)(Columns - 1));
+
+#ifdef FEAT_MBYTE
+ /* When there is a multi-byte character, just output a
+ * space to keep it simple. */
+ if (has_mbyte && mb_off2cells(LineOffset[screen_row - 1]
+ + (unsigned)Columns - 1) != 1)
+ out_char(' ');
+ else
+#endif
+ out_char(ScreenLines[LineOffset[screen_row - 1]
+ + (Columns - 1)]);
+ /* force a redraw of the first char on the next line */
+ ScreenAttrs[LineOffset[screen_row]] = (sattr_T)-1;
+ screen_start(); /* don't know where cursor is now */
+ }
+ }
+
+ col = 0;
+ off = (unsigned)(current_ScreenLine - ScreenLines);
+#ifdef FEAT_RIGHTLEFT
+ if (wp->w_p_rl)
+ {
+ col = W_WIDTH(wp) - 1; /* col is not used if breaking! */
+ off += col;
+ }
+#endif
+
+ /* reset the drawing state for the start of a wrapped line */
+ draw_state = WL_START;
+ saved_n_extra = n_extra;
+ saved_p_extra = p_extra;
+ saved_c_extra = c_extra;
+ saved_char_attr = char_attr;
+ n_extra = 0;
+ lcs_prec_todo = lcs_prec;
+#ifdef FEAT_LINEBREAK
+# ifdef FEAT_DIFF
+ if (filler_todo <= 0)
+# endif
+ need_showbreak = TRUE;
+#endif
+#ifdef FEAT_DIFF
+ --filler_todo;
+ /* When the filler lines are actually below the last line of the
+ * file, don't draw the line itself, break here. */
+ if (filler_todo == 0 && wp->w_botfill)
+ break;
+#endif
+ }
+
+ } /* for every character in the line */
+
+ return row;
+}
+
+/*
+ * Check whether the given character needs redrawing:
+ * - the (first byte of the) character is different
+ * - the attributes are different
+ * - the character is multi-byte and the next byte is different
+ */
+ static int
+char_needs_redraw(off_from, off_to, cols)
+ int off_from;
+ int off_to;
+ int cols;
+{
+ if (cols > 0
+ && ((ScreenLines[off_from] != ScreenLines[off_to]
+ || ScreenAttrs[off_from] != ScreenAttrs[off_to])
+
+#ifdef FEAT_MBYTE
+ || (enc_dbcs != 0
+ && MB_BYTE2LEN(ScreenLines[off_from]) > 1
+ && (enc_dbcs == DBCS_JPNU && ScreenLines[off_from] == 0x8e
+ ? ScreenLines2[off_from] != ScreenLines2[off_to]
+ : (cols > 1 && ScreenLines[off_from + 1]
+ != ScreenLines[off_to + 1])))
+ || (enc_utf8
+ && (ScreenLinesUC[off_from] != ScreenLinesUC[off_to]
+ || (ScreenLinesUC[off_from] != 0
+ && (ScreenLinesC1[off_from]
+ != ScreenLinesC1[off_to]
+ || ScreenLinesC2[off_from]
+ != ScreenLinesC2[off_to]))))
+#endif
+ ))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Move one "cooked" screen line to the screen, but only the characters that
+ * have actually changed. Handle insert/delete character.
+ * "coloff" gives the first column on the screen for this line.
+ * "endcol" gives the columns where valid characters are.
+ * "clear_width" is the width of the window. It's > 0 if the rest of the line
+ * needs to be cleared, negative otherwise.
+ * "rlflag" is TRUE in a rightleft window:
+ * When TRUE and "clear_width" > 0, clear columns 0 to "endcol"
+ * When FALSE and "clear_width" > 0, clear columns "endcol" to "clear_width"
+ */
+ static void
+screen_line(row, coloff, endcol, clear_width
+#ifdef FEAT_RIGHTLEFT
+ , rlflag
+#endif
+ )
+ int row;
+ int coloff;
+ int endcol;
+ int clear_width;
+#ifdef FEAT_RIGHTLEFT
+ int rlflag;
+#endif
+{
+ unsigned off_from;
+ unsigned off_to;
+ int col = 0;
+#if defined(FEAT_GUI) || defined(UNIX) || defined(FEAT_VERTSPLIT)
+ int hl;
+#endif
+ int force = FALSE; /* force update rest of the line */
+ int redraw_this /* bool: does character need redraw? */
+#ifdef FEAT_GUI
+ = TRUE /* For GUI when while-loop empty */
+#endif
+ ;
+ int redraw_next; /* redraw_this for next character */
+#ifdef FEAT_MBYTE
+ int clear_next = FALSE;
+ int char_cells; /* 1: normal char */
+ /* 2: occupies two display cells */
+# define CHAR_CELLS char_cells
+#else
+# define CHAR_CELLS 1
+#endif
+
+# ifdef FEAT_CLIPBOARD
+ clip_may_clear_selection(row, row);
+# endif
+
+ off_from = (unsigned)(current_ScreenLine - ScreenLines);
+ off_to = LineOffset[row] + coloff;
+
+#ifdef FEAT_RIGHTLEFT
+ if (rlflag)
+ {
+ /* Clear rest first, because it's left of the text. */
+ if (clear_width > 0)
+ {
+ while (col <= endcol && ScreenLines[off_to] == ' '
+ && ScreenAttrs[off_to] == 0
+# ifdef FEAT_MBYTE
+ && (!enc_utf8 || ScreenLinesUC[off_to] == 0)
+# endif
+ )
+ {
+ ++off_to;
+ ++col;
+ }
+ if (col <= endcol)
+ screen_fill(row, row + 1, col + coloff,
+ endcol + coloff + 1, ' ', ' ', 0);
+ }
+ col = endcol + 1;
+ off_to = LineOffset[row] + col + coloff;
+ off_from += col;
+ endcol = (clear_width > 0 ? clear_width : -clear_width);
+ }
+#endif /* FEAT_RIGHTLEFT */
+
+ redraw_next = char_needs_redraw(off_from, off_to, endcol - col);
+
+ while (col < endcol)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (col + 1 < endcol))
+ char_cells = (*mb_off2cells)(off_from);
+ else
+ char_cells = 1;
+#endif
+
+ redraw_this = redraw_next;
+ redraw_next = force || char_needs_redraw(off_from + CHAR_CELLS,
+ off_to + CHAR_CELLS, endcol - col - CHAR_CELLS);
+
+#ifdef FEAT_GUI
+ /* If the next character was bold, then redraw the current character to
+ * remove any pixels that might have spilt over into us. This only
+ * happens in the GUI.
+ */
+ if (redraw_next && gui.in_use)
+ {
+ hl = ScreenAttrs[off_to + CHAR_CELLS];
+ if (hl > HL_ALL || (hl & HL_BOLD))
+ redraw_this = TRUE;
+ }
+#endif
+
+ if (redraw_this)
+ {
+ /*
+ * Special handling when 'xs' termcap flag set (hpterm):
+ * Attributes for characters are stored at the position where the
+ * cursor is when writing the highlighting code. The
+ * start-highlighting code must be written with the cursor on the
+ * first highlighted character. The stop-highlighting code must
+ * be written with the cursor just after the last highlighted
+ * character.
+ * Overwriting a character doesn't remove it's highlighting. Need
+ * to clear the rest of the line, and force redrawing it
+ * completely.
+ */
+ if ( p_wiv
+ && !force
+#ifdef FEAT_GUI
+ && !gui.in_use
+#endif
+ && ScreenAttrs[off_to] != 0
+ && ScreenAttrs[off_from] != ScreenAttrs[off_to])
+ {
+ /*
+ * Need to remove highlighting attributes here.
+ */
+ windgoto(row, col + coloff);
+ out_str(T_CE); /* clear rest of this screen line */
+ screen_start(); /* don't know where cursor is now */
+ force = TRUE; /* force redraw of rest of the line */
+ redraw_next = TRUE; /* or else next char would miss out */
+
+ /*
+ * If the previous character was highlighted, need to stop
+ * highlighting at this character.
+ */
+ if (col + coloff > 0 && ScreenAttrs[off_to - 1] != 0)
+ {
+ screen_attr = ScreenAttrs[off_to - 1];
+ term_windgoto(row, col + coloff);
+ screen_stop_highlight();
+ }
+ else
+ screen_attr = 0; /* highlighting has stopped */
+ }
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0)
+ {
+ /* Check if overwriting a double-byte with a single-byte or
+ * the other way around requires another character to be
+ * redrawn. For UTF-8 this isn't needed, because comparing
+ * ScreenLinesUC[] is sufficient. */
+ if (char_cells == 1
+ && col + 1 < endcol
+ && (*mb_off2cells)(off_to) > 1)
+ {
+ /* Writing a single-cell character over a double-cell
+ * character: need to redraw the next cell. */
+ ScreenLines[off_to + 1] = 0;
+ redraw_next = TRUE;
+ }
+ else if (char_cells == 2
+ && col + 2 < endcol
+ && (*mb_off2cells)(off_to) == 1
+ && (*mb_off2cells)(off_to + 1) > 1)
+ {
+ /* Writing the second half of a double-cell character over
+ * a double-cell character: need to redraw the second
+ * cell. */
+ ScreenLines[off_to + 2] = 0;
+ redraw_next = TRUE;
+ }
+
+ if (enc_dbcs == DBCS_JPNU)
+ ScreenLines2[off_to] = ScreenLines2[off_from];
+ }
+ /* When writing a single-width character over a double-width
+ * character and at the end of the redrawn text, need to clear out
+ * the right halve of the old character.
+ * Also required when writing the right halve of a double-width
+ * char over the left halve of an existing one. */
+ if (has_mbyte && col + char_cells == endcol
+ && ((char_cells == 1
+ && (*mb_off2cells)(off_to) > 1)
+ || (char_cells == 2
+ && (*mb_off2cells)(off_to) == 1
+ && (*mb_off2cells)(off_to + 1) > 1)))
+ clear_next = TRUE;
+#endif
+
+ ScreenLines[off_to] = ScreenLines[off_from];
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ ScreenLinesUC[off_to] = ScreenLinesUC[off_from];
+ if (ScreenLinesUC[off_from] != 0)
+ {
+ ScreenLinesC1[off_to] = ScreenLinesC1[off_from];
+ ScreenLinesC2[off_to] = ScreenLinesC2[off_from];
+ }
+ }
+ if (char_cells == 2)
+ ScreenLines[off_to + 1] = ScreenLines[off_from + 1];
+#endif
+
+#if defined(FEAT_GUI) || defined(UNIX)
+ /* The bold trick makes a single row of pixels appear in the next
+ * character. When a bold character is removed, the next
+ * character should be redrawn too. This happens for our own GUI
+ * and for some xterms. */
+ if (
+# ifdef FEAT_GUI
+ gui.in_use
+# endif
+# if defined(FEAT_GUI) && defined(UNIX)
+ ||
+# endif
+# ifdef UNIX
+ term_is_xterm
+# endif
+ )
+ {
+ hl = ScreenAttrs[off_to];
+ if (hl > HL_ALL || (hl & HL_BOLD))
+ redraw_next = TRUE;
+ }
+#endif
+ ScreenAttrs[off_to] = ScreenAttrs[off_from];
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && char_cells == 2)
+ {
+ /* just a hack: It makes two bytes of DBCS have same attr */
+ ScreenAttrs[off_to + 1] = ScreenAttrs[off_from];
+ screen_char_2(off_to, row, col + coloff);
+ }
+ else
+#endif
+ screen_char(off_to, row, col + coloff);
+ }
+ else if ( p_wiv
+#ifdef FEAT_GUI
+ && !gui.in_use
+#endif
+ && col + coloff > 0)
+ {
+ if (ScreenAttrs[off_to] == ScreenAttrs[off_to - 1])
+ {
+ /*
+ * Don't output stop-highlight when moving the cursor, it will
+ * stop the highlighting when it should continue.
+ */
+ screen_attr = 0;
+ }
+ else if (screen_attr != 0)
+ screen_stop_highlight();
+ }
+
+ off_to += CHAR_CELLS;
+ off_from += CHAR_CELLS;
+ col += CHAR_CELLS;
+ }
+
+#ifdef FEAT_MBYTE
+ if (clear_next)
+ {
+ /* Clear the second half of a double-wide character of which the left
+ * half was overwritten with a single-wide character. */
+ ScreenLines[off_to] = ' ';
+ if (enc_utf8)
+ ScreenLinesUC[off_to] = 0;
+ screen_char(off_to, row, col + coloff);
+ }
+#endif
+
+ if (clear_width > 0
+#ifdef FEAT_RIGHTLEFT
+ && !rlflag
+#endif
+ )
+ {
+#ifdef FEAT_GUI
+ int startCol = col;
+#endif
+
+ /* blank out the rest of the line */
+ while (col < clear_width && ScreenLines[off_to] == ' '
+ && ScreenAttrs[off_to] == 0
+#ifdef FEAT_MBYTE
+ && (!enc_utf8 || ScreenLinesUC[off_to] == 0)
+#endif
+ )
+ {
+ ++off_to;
+ ++col;
+ }
+ if (col < clear_width)
+ {
+#ifdef FEAT_GUI
+ /*
+ * In the GUI, clearing the rest of the line may leave pixels
+ * behind if the first character cleared was bold. Some bold
+ * fonts spill over the left. In this case we redraw the previous
+ * character too. If we didn't skip any blanks above, then we
+ * only redraw if the character wasn't already redrawn anyway.
+ */
+ if (gui.in_use && (col > startCol || !redraw_this)
+# ifdef FEAT_MBYTE
+ && enc_dbcs == 0
+# endif
+ )
+ {
+ hl = ScreenAttrs[off_to];
+ if (hl > HL_ALL || (hl & HL_BOLD))
+ screen_char(off_to - 1, row, col + coloff - 1);
+ }
+#endif
+ screen_fill(row, row + 1, col + coloff, clear_width + coloff,
+ ' ', ' ', 0);
+#ifdef FEAT_VERTSPLIT
+ off_to += clear_width - col;
+ col = clear_width;
+#endif
+ }
+ }
+
+ if (clear_width > 0)
+ {
+#ifdef FEAT_VERTSPLIT
+ /* For a window that's left of another, draw the separator char. */
+ if (col + coloff < Columns)
+ {
+ int c;
+
+ c = fillchar_vsep(&hl);
+ if (ScreenLines[off_to] != c
+# ifdef FEAT_MBYTE
+ || (enc_utf8
+ && ScreenLinesUC[off_to] != (c >= 0x80 ? c : 0))
+# endif
+ || ScreenAttrs[off_to] != hl)
+ {
+ ScreenLines[off_to] = c;
+ ScreenAttrs[off_to] = hl;
+# ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ if (c >= 0x80)
+ {
+ ScreenLinesUC[off_to] = c;
+ ScreenLinesC1[off_to] = 0;
+ ScreenLinesC2[off_to] = 0;
+ }
+ else
+ ScreenLinesUC[off_to] = 0;
+ }
+# endif
+ screen_char(off_to, row, col + coloff);
+ }
+ }
+ else
+#endif
+ LineWraps[row] = FALSE;
+ }
+}
+
+#ifdef FEAT_RIGHTLEFT
+/*
+ * Mirror text "str" for right-lieft displaying.
+ */
+ static void
+rl_mirror(str)
+ char_u *str;
+{
+ char_u *p1, *p2;
+ int t;
+
+ for (p1 = str, p2 = str + STRLEN(str) - 1; p1 < p2; ++p1, --p2)
+ {
+ t = *p1;
+ *p1 = *p2;
+ *p2 = t;
+ }
+}
+#endif
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * mark all status lines for redraw; used after first :cd
+ */
+ void
+status_redraw_all()
+{
+ win_T *wp;
+
+ for (wp = firstwin; wp; wp = wp->w_next)
+ if (wp->w_status_height)
+ {
+ wp->w_redr_status = TRUE;
+ redraw_later(VALID);
+ }
+}
+
+/*
+ * mark all status lines of the current buffer for redraw
+ */
+ void
+status_redraw_curbuf()
+{
+ win_T *wp;
+
+ for (wp = firstwin; wp; wp = wp->w_next)
+ if (wp->w_status_height != 0 && wp->w_buffer == curbuf)
+ {
+ wp->w_redr_status = TRUE;
+ redraw_later(VALID);
+ }
+}
+
+/*
+ * Redraw all status lines that need to be redrawn.
+ */
+ void
+redraw_statuslines()
+{
+ win_T *wp;
+
+ for (wp = firstwin; wp; wp = wp->w_next)
+ if (wp->w_redr_status)
+ win_redr_status(wp);
+}
+#endif
+
+#if (defined(FEAT_WILDMENU) && defined(FEAT_VERTSPLIT)) || defined(PROTO)
+/*
+ * Redraw all status lines at the bottom of frame "frp".
+ */
+ void
+win_redraw_last_status(frp)
+ frame_T *frp;
+{
+ if (frp->fr_layout == FR_LEAF)
+ frp->fr_win->w_redr_status = TRUE;
+ else if (frp->fr_layout == FR_ROW)
+ {
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ win_redraw_last_status(frp);
+ }
+ else /* frp->fr_layout == FR_COL */
+ {
+ frp = frp->fr_child;
+ while (frp->fr_next != NULL)
+ frp = frp->fr_next;
+ win_redraw_last_status(frp);
+ }
+}
+#endif
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Draw the verticap separator right of window "wp" starting with line "row".
+ */
+ static void
+draw_vsep_win(wp, row)
+ win_T *wp;
+ int row;
+{
+ int hl;
+ int c;
+
+ if (wp->w_vsep_width)
+ {
+ /* draw the vertical separator right of this window */
+ c = fillchar_vsep(&hl);
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + wp->w_height,
+ W_ENDCOL(wp), W_ENDCOL(wp) + 1,
+ c, ' ', hl);
+ }
+}
+#endif
+
+#ifdef FEAT_WILDMENU
+static int status_match_len __ARGS((expand_T *xp, char_u *s));
+
+/*
+ * Get the lenght of an item as it will be shown in the status line.
+ */
+ static int
+status_match_len(xp, s)
+ expand_T *xp;
+ char_u *s;
+{
+ int len = 0;
+
+#ifdef FEAT_MENU
+ int emenu = (xp->xp_context == EXPAND_MENUS
+ || xp->xp_context == EXPAND_MENUNAMES);
+
+ /* Check for menu separators - replace with '|'. */
+ if (emenu && menu_is_separator(s))
+ return 1;
+#endif
+
+ while (*s != NUL)
+ {
+ /* Don't display backslashes used for escaping, they look ugly. */
+ if (rem_backslash(s)
+#ifdef FEAT_MENU
+ || (emenu && (s[0] == '\\' && s[1] != NUL))
+#endif
+ )
+ ++s;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ len += ptr2cells(s);
+ s += (*mb_ptr2len_check)(s);
+ }
+ else
+#endif
+ len += ptr2cells(s++);
+
+ }
+
+ return len;
+}
+
+/*
+ * Show wildchar matches in the status line.
+ * Show at least the "match" item.
+ * We start at item 'first_match' in the list and show all matches that fit.
+ *
+ * If inversion is possible we use it. Else '=' characters are used.
+ */
+ void
+win_redr_status_matches(xp, num_matches, matches, match, showtail)
+ expand_T *xp;
+ int num_matches;
+ char_u **matches; /* list of matches */
+ int match;
+ int showtail;
+{
+#define L_MATCH(m) (showtail ? sm_gettail(matches[m]) : matches[m])
+ int row;
+ char_u *buf;
+ int len;
+ int clen; /* lenght in screen cells */
+ int fillchar;
+ int attr;
+ int i;
+ int highlight = TRUE;
+ char_u *selstart = NULL;
+ int selstart_col = 0;
+ char_u *selend = NULL;
+ static int first_match = 0;
+ int add_left = FALSE;
+ char_u *s;
+#ifdef FEAT_MENU
+ int emenu;
+#endif
+#if defined(FEAT_MBYTE) || defined(FEAT_MENU)
+ int l;
+#endif
+
+ if (matches == NULL) /* interrupted completion? */
+ return;
+
+ buf = alloc((unsigned)Columns + 1);
+ if (buf == NULL)
+ return;
+
+ if (match == -1) /* don't show match but original text */
+ {
+ match = 0;
+ highlight = FALSE;
+ }
+ /* count 1 for the ending ">" */
+ clen = status_match_len(xp, L_MATCH(match)) + 3;
+ if (match == 0)
+ first_match = 0;
+ else if (match < first_match)
+ {
+ /* jumping left, as far as we can go */
+ first_match = match;
+ add_left = TRUE;
+ }
+ else
+ {
+ /* check if match fits on the screen */
+ for (i = first_match; i < match; ++i)
+ clen += status_match_len(xp, L_MATCH(i)) + 2;
+ if (first_match > 0)
+ clen += 2;
+ /* jumping right, put match at the left */
+ if ((long)clen > Columns)
+ {
+ first_match = match;
+ /* if showing the last match, we can add some on the left */
+ clen = 2;
+ for (i = match; i < num_matches; ++i)
+ {
+ clen += status_match_len(xp, L_MATCH(i)) + 2;
+ if ((long)clen >= Columns)
+ break;
+ }
+ if (i == num_matches)
+ add_left = TRUE;
+ }
+ }
+ if (add_left)
+ while (first_match > 0)
+ {
+ clen += status_match_len(xp, L_MATCH(first_match - 1)) + 2;
+ if ((long)clen >= Columns)
+ break;
+ --first_match;
+ }
+
+ fillchar = fillchar_status(&attr, TRUE);
+
+ if (first_match == 0)
+ {
+ *buf = NUL;
+ len = 0;
+ }
+ else
+ {
+ STRCPY(buf, "< ");
+ len = 2;
+ }
+ clen = len;
+
+ i = first_match;
+ while ((long)(clen + status_match_len(xp, L_MATCH(i)) + 2) < Columns)
+ {
+ if (i == match)
+ {
+ selstart = buf + len;
+ selstart_col = clen;
+ }
+
+ s = L_MATCH(i);
+ /* Check for menu separators - replace with '|' */
+#ifdef FEAT_MENU
+ emenu = (xp->xp_context == EXPAND_MENUS
+ || xp->xp_context == EXPAND_MENUNAMES);
+ if (emenu && menu_is_separator(s))
+ {
+ STRCPY(buf + len, transchar('|'));
+ l = (int)STRLEN(buf + len);
+ len += l;
+ clen += l;
+ }
+ else
+#endif
+ for ( ; *s != NUL; ++s)
+ {
+ /* Don't display backslashes used for escaping, they look ugly. */
+ if (rem_backslash(s)
+#ifdef FEAT_MENU
+ || (emenu
+ && (s[0] == '\t' || (s[0] == '\\' && s[1] != NUL)))
+#endif
+ )
+ ++s;
+ clen += ptr2cells(s);
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (l = (*mb_ptr2len_check)(s)) > 1)
+ {
+ STRNCPY(buf + len, s, l);
+ s += l - 1;
+ len += l;
+ }
+ else
+#endif
+ {
+ STRCPY(buf + len, transchar_byte(*s));
+ len += (int)STRLEN(buf + len);
+ }
+ }
+ if (i == match)
+ selend = buf + len;
+
+ *(buf + len++) = ' ';
+ *(buf + len++) = ' ';
+ clen += 2;
+ if (++i == num_matches)
+ break;
+ }
+
+ if (i != num_matches)
+ {
+ *(buf + len++) = '>';
+ ++clen;
+ }
+
+ buf[len] = NUL;
+
+ row = cmdline_row - 1;
+ if (row >= 0)
+ {
+ if (wild_menu_showing == 0)
+ {
+ if (msg_scrolled > 0)
+ {
+ /* Put the wildmenu just above the command line. If there is
+ * no room, scroll the screen one line up. */
+ if (cmdline_row == Rows - 1)
+ {
+ screen_del_lines(0, 0, 1, (int)Rows, TRUE, NULL);
+ ++msg_scrolled;
+ }
+ else
+ {
+ ++cmdline_row;
+ ++row;
+ }
+ wild_menu_showing = WM_SCROLLED;
+ }
+ else
+ {
+ /* Create status line if needed by setting 'laststatus' to 2.
+ * Set 'winminheight' to zero to avoid that the window is
+ * resized. */
+ if (lastwin->w_status_height == 0)
+ {
+ save_p_ls = p_ls;
+ save_p_wmh = p_wmh;
+ p_ls = 2;
+ p_wmh = 0;
+ last_status(FALSE);
+ }
+ wild_menu_showing = WM_SHOWN;
+ }
+ }
+
+ screen_puts(buf, row, 0, attr);
+ if (selstart != NULL && highlight)
+ {
+ *selend = NUL;
+ screen_puts(selstart, row, selstart_col, hl_attr(HLF_WM));
+ }
+
+ screen_fill(row, row + 1, clen, (int)Columns, fillchar, fillchar, attr);
+ }
+
+#ifdef FEAT_VERTSPLIT
+ win_redraw_last_status(topframe);
+#else
+ lastwin->w_redr_status = TRUE;
+#endif
+ vim_free(buf);
+}
+#endif
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Redraw the status line of window wp.
+ *
+ * If inversion is possible we use it. Else '=' characters are used.
+ */
+ void
+win_redr_status(wp)
+ win_T *wp;
+{
+ int row;
+ char_u *p;
+ int len;
+ int fillchar;
+ int attr;
+ int this_ru_col;
+
+ wp->w_redr_status = FALSE;
+ if (wp->w_status_height == 0)
+ {
+ /* no status line, can only be last window */
+ redraw_cmdline = TRUE;
+ }
+ else if (!redrawing())
+ {
+ /* Don't redraw right now, do it later. */
+ wp->w_redr_status = TRUE;
+ }
+#ifdef FEAT_STL_OPT
+ else if (*p_stl)
+ {
+ /* redraw custom status line */
+ win_redr_custom(wp, FALSE);
+ }
+#endif
+ else
+ {
+ fillchar = fillchar_status(&attr, wp == curwin);
+
+ if (buf_spname(wp->w_buffer) != NULL)
+ STRCPY(NameBuff, buf_spname(wp->w_buffer));
+ else
+ home_replace(wp->w_buffer, wp->w_buffer->b_fname, NameBuff,
+ MAXPATHL, TRUE);
+ trans_characters(NameBuff, MAXPATHL);
+ p = NameBuff;
+ len = (int)STRLEN(p);
+
+ if (wp->w_buffer->b_help
+#ifdef FEAT_QUICKFIX
+ || wp->w_p_pvw
+#endif
+ || bufIsChanged(wp->w_buffer)
+ || wp->w_buffer->b_p_ro)
+ *(p + len++) = ' ';
+ if (wp->w_buffer->b_help)
+ {
+ STRCPY(p + len, _("[help]"));
+ len += (int)STRLEN(p + len);
+ }
+#ifdef FEAT_QUICKFIX
+ if (wp->w_p_pvw)
+ {
+ STRCPY(p + len, _("[Preview]"));
+ len += (int)STRLEN(p + len);
+ }
+#endif
+ if (bufIsChanged(wp->w_buffer))
+ {
+ STRCPY(p + len, "[+]");
+ len += 3;
+ }
+ if (wp->w_buffer->b_p_ro)
+ {
+ STRCPY(p + len, "[RO]");
+ len += 4;
+ }
+
+#ifndef FEAT_VERTSPLIT
+ this_ru_col = ru_col;
+ if (this_ru_col < (Columns + 1) / 2)
+ this_ru_col = (Columns + 1) / 2;
+#else
+ this_ru_col = ru_col - (Columns - W_WIDTH(wp));
+ if (this_ru_col < (W_WIDTH(wp) + 1) / 2)
+ this_ru_col = (W_WIDTH(wp) + 1) / 2;
+ if (this_ru_col <= 1)
+ {
+ p = (char_u *)"<"; /* No room for file name! */
+ len = 1;
+ }
+ else
+#endif
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int clen = 0, i;
+
+ /* Count total number of display cells. */
+ for (i = 0; p[i] != NUL; i += (*mb_ptr2len_check)(p + i))
+ clen += (*mb_ptr2cells)(p + i);
+ /* Find first character that will fit.
+ * Going from start to end is much faster for DBCS. */
+ for (i = 0; p[i] != NUL && clen >= this_ru_col - 1;
+ i += (*mb_ptr2len_check)(p + i))
+ clen -= (*mb_ptr2cells)(p + i);
+ len = clen;
+ if (i > 0)
+ {
+ p = p + i - 1;
+ *p = '<';
+ ++len;
+ }
+
+ }
+ else
+#endif
+ if (len > this_ru_col - 1)
+ {
+ p += len - (this_ru_col - 1);
+ *p = '<';
+ len = this_ru_col - 1;
+ }
+
+ row = W_WINROW(wp) + wp->w_height;
+ screen_puts(p, row, W_WINCOL(wp), attr);
+ screen_fill(row, row + 1, len + W_WINCOL(wp),
+ this_ru_col + W_WINCOL(wp), fillchar, fillchar, attr);
+
+ if (get_keymap_str(wp, NameBuff, MAXPATHL)
+ && (int)(this_ru_col - len) > (int)(STRLEN(NameBuff) + 1))
+ screen_puts(NameBuff, row, (int)(this_ru_col - STRLEN(NameBuff)
+ - 1 + W_WINCOL(wp)), attr);
+
+#ifdef FEAT_CMDL_INFO
+ win_redr_ruler(wp, TRUE);
+#endif
+ }
+
+#ifdef FEAT_VERTSPLIT
+ /*
+ * May need to draw the character below the vertical separator.
+ */
+ if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing())
+ {
+ if (stl_connected(wp))
+ fillchar = fillchar_status(&attr, wp == curwin);
+ else
+ fillchar = fillchar_vsep(&attr);
+ screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
+ attr);
+ }
+#endif
+}
+
+# ifdef FEAT_VERTSPLIT
+/*
+ * Return TRUE if the status line of window "wp" is connected to the status
+ * line of the window right of it. If not, then it's a vertical separator.
+ * Only call if (wp->w_vsep_width != 0).
+ */
+ int
+stl_connected(wp)
+ win_T *wp;
+{
+ frame_T *fr;
+
+ fr = wp->w_frame;
+ while (fr->fr_parent != NULL)
+ {
+ if (fr->fr_parent->fr_layout == FR_COL)
+ {
+ if (fr->fr_next != NULL)
+ break;
+ }
+ else
+ {
+ if (fr->fr_next != NULL)
+ return TRUE;
+ }
+ fr = fr->fr_parent;
+ }
+ return FALSE;
+}
+# endif
+
+#endif /* FEAT_WINDOWS */
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_STL_OPT) || defined(PROTO)
+/*
+ * Get the value to show for the language mappings, active 'keymap'.
+ */
+ int
+get_keymap_str(wp, buf, len)
+ win_T *wp;
+ char_u *buf; /* buffer for the result */
+ int len; /* length of buffer */
+{
+ char_u *p;
+
+ if (wp->w_buffer->b_p_iminsert != B_IMODE_LMAP)
+ return FALSE;
+
+ {
+#ifdef FEAT_EVAL
+ buf_T *old_curbuf = curbuf;
+ win_T *old_curwin = curwin;
+ char_u *s;
+
+ curbuf = wp->w_buffer;
+ curwin = wp;
+ STRCPY(buf, "b:keymap_name"); /* must be writable */
+ ++emsg_skip;
+ s = p = eval_to_string(buf, NULL);
+ --emsg_skip;
+ curbuf = old_curbuf;
+ curwin = old_curwin;
+ if (p == NULL || *p == NUL)
+#endif
+ {
+#ifdef FEAT_KEYMAP
+ if (wp->w_buffer->b_kmap_state & KEYMAP_LOADED)
+ p = wp->w_buffer->b_p_keymap;
+ else
+#endif
+ p = (char_u *)"lang";
+ }
+ if ((int)(STRLEN(p) + 3) < len)
+ sprintf((char *)buf, "<%s>", p);
+ else
+ buf[0] = NUL;
+#ifdef FEAT_EVAL
+ vim_free(s);
+#endif
+ }
+ return buf[0] != NUL;
+}
+#endif
+
+#if defined(FEAT_STL_OPT) || defined(PROTO)
+/*
+ * Redraw the status line or ruler of window wp.
+ */
+ static void
+win_redr_custom(wp, Ruler)
+ win_T *wp;
+ int Ruler;
+{
+ int attr;
+ int curattr;
+ int row;
+ int col = 0;
+ int maxwidth;
+ int width;
+ int n;
+ int len;
+ int fillchar;
+ char_u buf[MAXPATHL];
+ char_u *p;
+ struct stl_hlrec hl[STL_MAX_ITEM];
+
+ /* setup environment for the task at hand */
+ row = W_WINROW(wp) + wp->w_height;
+ fillchar = fillchar_status(&attr, wp == curwin);
+ maxwidth = W_WIDTH(wp);
+ p = p_stl;
+ if (Ruler)
+ {
+ p = p_ruf;
+ /* advance past any leading group spec - implicit in ru_col */
+ if (*p == '%')
+ {
+ if (*++p == '-')
+ p++;
+ if (atoi((char *) p))
+ while (VIM_ISDIGIT(*p))
+ p++;
+ if (*p++ != '(')
+ p = p_ruf;
+ }
+#ifdef FEAT_VERTSPLIT
+ col = ru_col - (Columns - W_WIDTH(wp));
+ if (col < (W_WIDTH(wp) + 1) / 2)
+ col = (W_WIDTH(wp) + 1) / 2;
+#else
+ col = ru_col;
+ if (col > (Columns + 1) / 2)
+ col = (Columns + 1) / 2;
+#endif
+ maxwidth = W_WIDTH(wp) - col;
+#ifdef FEAT_WINDOWS
+ if (!wp->w_status_height)
+#endif
+ {
+ row = Rows - 1;
+ --maxwidth; /* writing in last column may cause scrolling */
+ fillchar = ' ';
+ attr = 0;
+ }
+ }
+ if (maxwidth <= 0)
+ return;
+#ifdef FEAT_VERTSPLIT
+ col += W_WINCOL(wp);
+#endif
+
+ width = build_stl_str_hl(wp, buf, sizeof(buf), p, fillchar, maxwidth, hl);
+ len = STRLEN(buf);
+
+ while (width < maxwidth && len < sizeof(buf) - 1)
+ {
+#ifdef FEAT_MBYTE
+ len += (*mb_char2bytes)(fillchar, buf + len);
+#else
+ buf[len++] = fillchar;
+#endif
+ ++width;
+ }
+ buf[len] = NUL;
+
+ curattr = attr;
+ p = buf;
+ for (n = 0; hl[n].start != NULL; n++)
+ {
+ len = (int)(hl[n].start - p);
+ screen_puts_len(p, len, row, col, curattr);
+ col += vim_strnsize(p, len);
+ p = hl[n].start;
+
+ if (hl[n].userhl == 0)
+ curattr = attr;
+#ifdef FEAT_WINDOWS
+ else if (wp != curwin && wp->w_status_height != 0)
+ curattr = highlight_stlnc[hl[n].userhl - 1];
+#endif
+ else
+ curattr = highlight_user[hl[n].userhl - 1];
+ }
+ screen_puts(p, row, col, curattr);
+}
+
+#endif /* FEAT_STL_OPT */
+
+/*
+ * Output a single character directly to the screen and update ScreenLines.
+ */
+ void
+screen_putchar(c, row, col, attr)
+ int c;
+ int row, col;
+ int attr;
+{
+#ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+
+ buf[(*mb_char2bytes)(c, buf)] = NUL;
+#else
+ char_u buf[2];
+
+ buf[0] = c;
+ buf[1] = NUL;
+#endif
+ screen_puts(buf, row, col, attr);
+}
+
+/*
+ * Get a single character directly from ScreenLines into "bytes[]".
+ * Also return its attribute in *attrp;
+ */
+ void
+screen_getbytes(row, col, bytes, attrp)
+ int row, col;
+ char_u *bytes;
+ int *attrp;
+{
+ unsigned off;
+
+ /* safety check */
+ if (ScreenLines != NULL && row < screen_Rows && col < screen_Columns)
+ {
+ off = LineOffset[row] + col;
+ *attrp = ScreenAttrs[off];
+ bytes[0] = ScreenLines[off];
+ bytes[1] = NUL;
+
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && ScreenLinesUC[off] != 0)
+ bytes[utfc_char2bytes(off, bytes)] = NUL;
+ else if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
+ {
+ bytes[0] = ScreenLines[off];
+ bytes[1] = ScreenLines2[off];
+ bytes[2] = NUL;
+ }
+ else if (enc_dbcs && MB_BYTE2LEN(bytes[0]) > 1)
+ {
+ bytes[1] = ScreenLines[off + 1];
+ bytes[2] = NUL;
+ }
+#endif
+ }
+}
+
+/*
+ * Put string '*text' on the screen at position 'row' and 'col', with
+ * attributes 'attr', and update ScreenLines[] and ScreenAttrs[].
+ * Note: only outputs within one row, message is truncated at screen boundary!
+ * Note: if ScreenLines[], row and/or col is invalid, nothing is done.
+ */
+ void
+screen_puts(text, row, col, attr)
+ char_u *text;
+ int row;
+ int col;
+ int attr;
+{
+ screen_puts_len(text, -1, row, col, attr);
+}
+
+/*
+ * Like screen_puts(), but output "text[len]". When "len" is -1 output up to
+ * a NUL.
+ */
+ void
+screen_puts_len(text, len, row, col, attr)
+ char_u *text;
+ int len;
+ int row;
+ int col;
+ int attr;
+{
+ unsigned off;
+ char_u *ptr = text;
+ int c;
+#ifdef FEAT_MBYTE
+ int mbyte_blen = 1;
+ int mbyte_cells = 1;
+ int u8c = 0;
+ int u8c_c1 = 0;
+ int u8c_c2 = 0;
+ int clear_next_cell = FALSE;
+# ifdef FEAT_ARABIC
+ int prev_c = 0; /* previous Arabic character */
+ int pc, nc, nc1, dummy;
+# endif
+#endif
+
+ if (ScreenLines == NULL || row >= screen_Rows) /* safety check */
+ return;
+
+ off = LineOffset[row] + col;
+ while (*ptr != NUL && col < screen_Columns
+ && (len < 0 || (int)(ptr - text) < len))
+ {
+ c = *ptr;
+#ifdef FEAT_MBYTE
+ /* check if this is the first byte of a multibyte */
+ if (has_mbyte)
+ {
+ if (enc_utf8 && len > 0)
+ mbyte_blen = utfc_ptr2len_check_len(ptr,
+ (int)((text + len) - ptr));
+ else
+ mbyte_blen = (*mb_ptr2len_check)(ptr);
+ if (enc_dbcs == DBCS_JPNU && c == 0x8e)
+ mbyte_cells = 1;
+ else if (enc_dbcs != 0)
+ mbyte_cells = mbyte_blen;
+ else /* enc_utf8 */
+ {
+ if (len >= 0)
+ u8c = utfc_ptr2char_len(ptr, &u8c_c1, &u8c_c2,
+ (int)((text + len) - ptr));
+ else
+ u8c = utfc_ptr2char(ptr, &u8c_c1, &u8c_c2);
+ mbyte_cells = utf_char2cells(u8c);
+ /* Non-BMP character: display as ? or fullwidth ?. */
+ if (u8c >= 0x10000)
+ {
+ u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
+ if (attr == 0)
+ attr = hl_attr(HLF_8);
+ }
+# ifdef FEAT_ARABIC
+ if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
+ {
+ /* Do Arabic shaping. */
+ if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len)
+ {
+ /* Past end of string to be displayed. */
+ nc = NUL;
+ nc1 = NUL;
+ }
+ else
+ nc = utfc_ptr2char(ptr + mbyte_blen, &nc1, &dummy);
+ pc = prev_c;
+ prev_c = u8c;
+ u8c = arabic_shape(u8c, &c, &u8c_c1, nc, nc1, pc);
+ }
+ else
+ prev_c = u8c;
+# endif
+ }
+ }
+#endif
+
+ if (ScreenLines[off] != c
+#ifdef FEAT_MBYTE
+ || (mbyte_cells == 2
+ && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
+ || (enc_dbcs == DBCS_JPNU
+ && c == 0x8e
+ && ScreenLines2[off] != ptr[1])
+ || (enc_utf8
+ && mbyte_blen > 1
+ && (ScreenLinesUC[off] != u8c
+ || ScreenLinesC1[off] != u8c_c1
+ || ScreenLinesC2[off] != u8c_c2))
+#endif
+ || ScreenAttrs[off] != attr
+ || exmode_active
+ )
+ {
+#if defined(FEAT_GUI) || defined(UNIX)
+ /* The bold trick makes a single row of pixels appear in the next
+ * character. When a bold character is removed, the next
+ * character should be redrawn too. This happens for our own GUI
+ * and for some xterms.
+ * Force the redraw by setting the attribute to a different value
+ * than "attr", the contents of ScreenLines[] may be needed by
+ * mb_off2cells() further on.
+ * Don't do this for the last drawn character, because the next
+ * character may not be redrawn. */
+ if (
+# ifdef FEAT_GUI
+ gui.in_use
+# endif
+# if defined(FEAT_GUI) && defined(UNIX)
+ ||
+# endif
+# ifdef UNIX
+ term_is_xterm
+# endif
+ )
+ {
+ int n;
+
+ n = ScreenAttrs[off];
+# ifdef FEAT_MBYTE
+ if (col + mbyte_cells < screen_Columns
+ && (n > HL_ALL || (n & HL_BOLD))
+ && (len < 0 ? ptr[mbyte_blen] != NUL
+ : ptr + mbyte_blen < text + len))
+ ScreenAttrs[off + mbyte_cells] = attr + 1;
+# else
+ if (col + 1 < screen_Columns
+ && (n > HL_ALL || (n & HL_BOLD))
+ && (len < 0 ? ptr[1] != NUL : ptr + 1 < text + len))
+ ScreenLines[off + 1] = 0;
+# endif
+ }
+#endif
+#ifdef FEAT_MBYTE
+ /* When at the end of the text and overwriting a two-cell
+ * character with a one-cell character, need to clear the next
+ * cell. Also when overwriting the left halve of a two-cell char
+ * with the right halve of a two-cell char. Do this only once
+ * (mb_off2cells() may return 2 on the right halve). */
+ if (clear_next_cell)
+ clear_next_cell = FALSE;
+ else if (has_mbyte
+ && (len < 0 ? ptr[mbyte_blen] == NUL
+ : ptr + mbyte_blen >= text + len)
+ && ((mbyte_cells == 1 && (*mb_off2cells)(off) > 1)
+ || (mbyte_cells == 2
+ && (*mb_off2cells)(off) == 1
+ && (*mb_off2cells)(off + 1) > 1)))
+ clear_next_cell = TRUE;
+
+ /* Make sure we never leave a second byte of a double-byte behind,
+ * it confuses mb_off2cells(). */
+ if (enc_dbcs
+ && ((mbyte_cells == 1 && (*mb_off2cells)(off) > 1)
+ || (mbyte_cells == 2
+ && (*mb_off2cells)(off) == 1
+ && (*mb_off2cells)(off + 1) > 1)))
+ ScreenLines[off + mbyte_blen] = 0;
+#endif
+ ScreenLines[off] = c;
+ ScreenAttrs[off] = attr;
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ if (c < 0x80 && u8c_c1 == 0 && u8c_c2 == 0)
+ ScreenLinesUC[off] = 0;
+ else
+ {
+ ScreenLinesUC[off] = u8c;
+ ScreenLinesC1[off] = u8c_c1;
+ ScreenLinesC2[off] = u8c_c2;
+ }
+ if (mbyte_cells == 2)
+ {
+ ScreenLines[off + 1] = 0;
+ ScreenAttrs[off + 1] = attr;
+ }
+ screen_char(off, row, col);
+ }
+ else if (mbyte_cells == 2)
+ {
+ ScreenLines[off + 1] = ptr[1];
+ ScreenAttrs[off + 1] = attr;
+ screen_char_2(off, row, col);
+ }
+ else if (enc_dbcs == DBCS_JPNU && c == 0x8e)
+ {
+ ScreenLines2[off] = ptr[1];
+ screen_char(off, row, col);
+ }
+ else
+#endif
+ screen_char(off, row, col);
+ }
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ off += mbyte_cells;
+ col += mbyte_cells;
+ ptr += mbyte_blen;
+ if (clear_next_cell)
+ ptr = (char_u *)" ";
+ }
+ else
+#endif
+ {
+ ++off;
+ ++col;
+ ++ptr;
+ }
+ }
+}
+
+#ifdef FEAT_SEARCH_EXTRA
+/*
+ * Prepare for 'searchhl' highlighting.
+ */
+ static void
+start_search_hl()
+{
+ if (p_hls && !no_hlsearch)
+ {
+ last_pat_prog(&search_hl.rm);
+ search_hl.attr = hl_attr(HLF_L);
+ }
+}
+
+/*
+ * Clean up for 'searchhl' highlighting.
+ */
+ static void
+end_search_hl()
+{
+ if (search_hl.rm.regprog != NULL)
+ {
+ vim_free(search_hl.rm.regprog);
+ search_hl.rm.regprog = NULL;
+ }
+}
+
+/*
+ * Advance to the match in window "wp" line "lnum" or past it.
+ */
+ static void
+prepare_search_hl(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ match_T *shl; /* points to search_hl or match_hl */
+ int n;
+
+ /*
+ * When using a multi-line pattern, start searching at the top
+ * of the window or just after a closed fold.
+ * Do this both for search_hl and match_hl.
+ */
+ shl = &search_hl;
+ for (;;)
+ {
+ if (shl->rm.regprog != NULL
+ && shl->lnum == 0
+ && re_multiline(shl->rm.regprog))
+ {
+ if (shl->first_lnum == 0)
+ {
+# ifdef FEAT_FOLDING
+ for (shl->first_lnum = lnum;
+ shl->first_lnum > wp->w_topline; --shl->first_lnum)
+ if (hasFoldingWin(wp, shl->first_lnum - 1,
+ NULL, NULL, TRUE, NULL))
+ break;
+# else
+ shl->first_lnum = wp->w_topline;
+# endif
+ }
+ n = 0;
+ while (shl->first_lnum < lnum && shl->rm.regprog != NULL)
+ {
+ next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n);
+ if (shl->lnum != 0)
+ {
+ shl->first_lnum = shl->lnum
+ + shl->rm.endpos[0].lnum
+ - shl->rm.startpos[0].lnum;
+ n = shl->rm.endpos[0].col;
+ }
+ else
+ {
+ ++shl->first_lnum;
+ n = 0;
+ }
+ }
+ }
+ if (shl == &match_hl)
+ break;
+ shl = &match_hl;
+ }
+}
+
+/*
+ * Search for a next 'searchl' or ":match" match.
+ * Uses shl->buf.
+ * Sets shl->lnum and shl->rm contents.
+ * Note: Assumes a previous match is always before "lnum", unless
+ * shl->lnum is zero.
+ * Careful: Any pointers for buffer lines will become invalid.
+ */
+ static void
+next_search_hl(win, shl, lnum, mincol)
+ win_T *win;
+ match_T *shl; /* points to search_hl or match_hl */
+ linenr_T lnum;
+ colnr_T mincol; /* minimal column for a match */
+{
+ linenr_T l;
+ colnr_T matchcol;
+ long nmatched;
+
+ if (shl->lnum != 0)
+ {
+ /* Check for three situations:
+ * 1. If the "lnum" is below a previous match, start a new search.
+ * 2. If the previous match includes "mincol", use it.
+ * 3. Continue after the previous match.
+ */
+ l = shl->lnum + shl->rm.endpos[0].lnum - shl->rm.startpos[0].lnum;
+ if (lnum > l)
+ shl->lnum = 0;
+ else if (lnum < l || shl->rm.endpos[0].col > mincol)
+ return;
+ }
+
+ /*
+ * Repeat searching for a match until one is found that includes "mincol"
+ * or none is found in this line.
+ */
+ called_emsg = FALSE;
+ for (;;)
+ {
+ /* Three situations:
+ * 1. No useful previous match: search from start of line.
+ * 2. Not Vi compatible or empty match: continue at next character.
+ * Break the loop if this is beyond the end of the line.
+ * 3. Vi compatible searching: continue at end of previous match.
+ */
+ if (shl->lnum == 0)
+ matchcol = 0;
+ else if (vim_strchr(p_cpo, CPO_SEARCH) == NULL
+ || (shl->rm.endpos[0].lnum == 0
+ && shl->rm.endpos[0].col == shl->rm.startpos[0].col))
+ {
+ matchcol = shl->rm.startpos[0].col + 1;
+ if (ml_get_buf(shl->buf, lnum, FALSE)[matchcol - 1] == NUL)
+ {
+ shl->lnum = 0;
+ break;
+ }
+ }
+ else
+ matchcol = shl->rm.endpos[0].col;
+
+ shl->lnum = lnum;
+ nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, matchcol);
+ if (called_emsg)
+ {
+ /* Error while handling regexp: stop using this regexp. */
+ vim_free(shl->rm.regprog);
+ shl->rm.regprog = NULL;
+ no_hlsearch = TRUE;
+ break;
+ }
+ if (nmatched == 0)
+ {
+ shl->lnum = 0; /* no match found */
+ break;
+ }
+ if (shl->rm.startpos[0].lnum > 0
+ || shl->rm.startpos[0].col >= mincol
+ || nmatched > 1
+ || shl->rm.endpos[0].col > mincol)
+ {
+ shl->lnum += shl->rm.startpos[0].lnum;
+ break; /* useful match found */
+ }
+ }
+}
+#endif
+
+ static void
+screen_start_highlight(attr)
+ int attr;
+{
+ attrentry_T *aep = NULL;
+
+ screen_attr = attr;
+ if (full_screen
+#ifdef WIN3264
+ && termcap_active
+#endif
+ )
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ char buf[20];
+
+ sprintf(buf, IF_EB("\033|%dh", ESC_STR "|%dh"), attr); /* internal GUI code */
+ OUT_STR(buf);
+ }
+ else
+#endif
+ {
+ if (attr > HL_ALL) /* special HL attr. */
+ {
+ if (t_colors > 1)
+ aep = syn_cterm_attr2entry(attr);
+ else
+ aep = syn_term_attr2entry(attr);
+ if (aep == NULL) /* did ":syntax clear" */
+ attr = 0;
+ else
+ attr = aep->ae_attr;
+ }
+ if ((attr & HL_BOLD) && T_MD != NULL) /* bold */
+ out_str(T_MD);
+ if ((attr & HL_STANDOUT) && T_SO != NULL) /* standout */
+ out_str(T_SO);
+ if ((attr & HL_UNDERLINE) && T_US != NULL) /* underline */
+ out_str(T_US);
+ if ((attr & HL_ITALIC) && T_CZH != NULL) /* italic */
+ out_str(T_CZH);
+ if ((attr & HL_INVERSE) && T_MR != NULL) /* inverse (reverse) */
+ out_str(T_MR);
+
+ /*
+ * Output the color or start string after bold etc., in case the
+ * bold etc. override the color setting.
+ */
+ if (aep != NULL)
+ {
+ if (t_colors > 1)
+ {
+ if (aep->ae_u.cterm.fg_color)
+ term_fg_color(aep->ae_u.cterm.fg_color - 1);
+ if (aep->ae_u.cterm.bg_color)
+ term_bg_color(aep->ae_u.cterm.bg_color - 1);
+ }
+ else
+ {
+ if (aep->ae_u.term.start != NULL)
+ out_str(aep->ae_u.term.start);
+ }
+ }
+ }
+ }
+}
+
+ void
+screen_stop_highlight()
+{
+ int do_ME = FALSE; /* output T_ME code */
+
+ if (screen_attr != 0
+#ifdef WIN3264
+ && termcap_active
+#endif
+ )
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ char buf[20];
+
+ /* use internal GUI code */
+ sprintf(buf, IF_EB("\033|%dH", ESC_STR "|%dH"), screen_attr);
+ OUT_STR(buf);
+ }
+ else
+#endif
+ {
+ if (screen_attr > HL_ALL) /* special HL attr. */
+ {
+ attrentry_T *aep;
+
+ if (t_colors > 1)
+ {
+ /*
+ * Assume that t_me restores the original colors!
+ */
+ aep = syn_cterm_attr2entry(screen_attr);
+ if (aep != NULL && (aep->ae_u.cterm.fg_color
+ || aep->ae_u.cterm.bg_color))
+ do_ME = TRUE;
+ }
+ else
+ {
+ aep = syn_term_attr2entry(screen_attr);
+ if (aep != NULL && aep->ae_u.term.stop != NULL)
+ {
+ if (STRCMP(aep->ae_u.term.stop, T_ME) == 0)
+ do_ME = TRUE;
+ else
+ out_str(aep->ae_u.term.stop);
+ }
+ }
+ if (aep == NULL) /* did ":syntax clear" */
+ screen_attr = 0;
+ else
+ screen_attr = aep->ae_attr;
+ }
+
+ /*
+ * Often all ending-codes are equal to T_ME. Avoid outputting the
+ * same sequence several times.
+ */
+ if (screen_attr & HL_STANDOUT)
+ {
+ if (STRCMP(T_SE, T_ME) == 0)
+ do_ME = TRUE;
+ else
+ out_str(T_SE);
+ }
+ if (screen_attr & HL_UNDERLINE)
+ {
+ if (STRCMP(T_UE, T_ME) == 0)
+ do_ME = TRUE;
+ else
+ out_str(T_UE);
+ }
+ if (screen_attr & HL_ITALIC)
+ {
+ if (STRCMP(T_CZR, T_ME) == 0)
+ do_ME = TRUE;
+ else
+ out_str(T_CZR);
+ }
+ if (do_ME || (screen_attr & (HL_BOLD | HL_INVERSE)))
+ out_str(T_ME);
+
+ if (t_colors > 1)
+ {
+ /* set Normal cterm colors */
+ if (cterm_normal_fg_color != 0)
+ term_fg_color(cterm_normal_fg_color - 1);
+ if (cterm_normal_bg_color != 0)
+ term_bg_color(cterm_normal_bg_color - 1);
+ if (cterm_normal_fg_bold)
+ out_str(T_MD);
+ }
+ }
+ }
+ screen_attr = 0;
+}
+
+/*
+ * Reset the colors for a cterm. Used when leaving Vim.
+ * The machine specific code may override this again.
+ */
+ void
+reset_cterm_colors()
+{
+ if (t_colors > 1)
+ {
+ /* set Normal cterm colors */
+ if (cterm_normal_fg_color > 0 || cterm_normal_bg_color > 0)
+ {
+ out_str(T_OP);
+ screen_attr = -1;
+ }
+ if (cterm_normal_fg_bold)
+ {
+ out_str(T_ME);
+ screen_attr = -1;
+ }
+ }
+}
+
+/*
+ * Put character ScreenLines["off"] on the screen at position "row" and "col",
+ * using the attributes from ScreenAttrs["off"].
+ */
+ static void
+screen_char(off, row, col)
+ unsigned off;
+ int row;
+ int col;
+{
+ int attr;
+
+ /* Check for illegal values, just in case (could happen just after
+ * resizing). */
+ if (row >= screen_Rows || col >= screen_Columns)
+ return;
+
+ /* Outputting the last character on the screen may scrollup the screen.
+ * Don't to it! Mark the character invalid (update it when scrolled up) */
+ if (row == screen_Rows - 1 && col == screen_Columns - 1
+#ifdef FEAT_RIGHTLEFT
+ /* account for first command-line character in rightleft mode */
+ && !cmdmsg_rl
+#endif
+ )
+ {
+ ScreenAttrs[off] = (sattr_T)-1;
+ return;
+ }
+
+ /*
+ * Stop highlighting first, so it's easier to move the cursor.
+ */
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_VERTSPLIT)
+ if (screen_char_attr != 0)
+ attr = screen_char_attr;
+ else
+#endif
+ attr = ScreenAttrs[off];
+ if (screen_attr != attr)
+ screen_stop_highlight();
+
+ windgoto(row, col);
+
+ if (screen_attr != attr)
+ screen_start_highlight(attr);
+
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && ScreenLinesUC[off] != 0)
+ {
+ char_u buf[MB_MAXBYTES + 1];
+
+ /* Convert UTF-8 character to bytes and write it. */
+
+ buf[utfc_char2bytes(off, buf)] = NUL;
+
+ out_str(buf);
+ if (utf_char2cells(ScreenLinesUC[off]) > 1)
+ ++screen_cur_col;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_MBYTE
+ out_flush_check();
+#endif
+ out_char(ScreenLines[off]);
+#ifdef FEAT_MBYTE
+ /* double-byte character in single-width cell */
+ if (enc_dbcs == DBCS_JPNU && ScreenLines[off] == 0x8e)
+ out_char(ScreenLines2[off]);
+#endif
+ }
+
+ screen_cur_col++;
+}
+
+#ifdef FEAT_MBYTE
+
+/*
+ * Used for enc_dbcs only: Put one double-wide character at ScreenLines["off"]
+ * on the screen at position 'row' and 'col'.
+ * The attributes of the first byte is used for all. This is required to
+ * output the two bytes of a double-byte character with nothing in between.
+ */
+ static void
+screen_char_2(off, row, col)
+ unsigned off;
+ int row;
+ int col;
+{
+ /* Check for illegal values (could be wrong when screen was resized). */
+ if (off + 1 >= (unsigned)(screen_Rows * screen_Columns))
+ return;
+
+ /* Outputting the last character on the screen may scrollup the screen.
+ * Don't to it! Mark the character invalid (update it when scrolled up) */
+ if (row == screen_Rows - 1 && col >= screen_Columns - 2)
+ {
+ ScreenAttrs[off] = (sattr_T)-1;
+ return;
+ }
+
+ /* Output the first byte normally (positions the cursor), then write the
+ * second byte directly. */
+ screen_char(off, row, col);
+ out_char(ScreenLines[off + 1]);
+ ++screen_cur_col;
+}
+#endif
+
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_VERTSPLIT) || defined(PROTO)
+/*
+ * Draw a rectangle of the screen, inverted when "invert" is TRUE.
+ * This uses the contents of ScreenLines[] and doesn't change it.
+ */
+ void
+screen_draw_rectangle(row, col, height, width, invert)
+ int row;
+ int col;
+ int height;
+ int width;
+ int invert;
+{
+ int r, c;
+ int off;
+
+ if (invert)
+ screen_char_attr = HL_INVERSE;
+ for (r = row; r < row + height; ++r)
+ {
+ off = LineOffset[r];
+ for (c = col; c < col + width; ++c)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && dbcs_off2cells(off + c) > 1)
+ {
+ screen_char_2(off + c, r, c);
+ ++c;
+ }
+ else
+#endif
+ {
+ screen_char(off + c, r, c);
+#ifdef FEAT_MBYTE
+ if (utf_off2cells(off + c) > 1)
+ ++c;
+#endif
+ }
+ }
+ }
+ screen_char_attr = 0;
+}
+#endif
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Redraw the characters for a vertically split window.
+ */
+ static void
+redraw_block(row, end, wp)
+ int row;
+ int end;
+ win_T *wp;
+{
+ int col;
+ int width;
+
+# ifdef FEAT_CLIPBOARD
+ clip_may_clear_selection(row, end - 1);
+# endif
+
+ if (wp == NULL)
+ {
+ col = 0;
+ width = Columns;
+ }
+ else
+ {
+ col = wp->w_wincol;
+ width = wp->w_width;
+ }
+ screen_draw_rectangle(row, col, end - row, width, FALSE);
+}
+#endif
+
+/*
+ * Fill the screen from 'start_row' to 'end_row', from 'start_col' to 'end_col'
+ * with character 'c1' in first column followed by 'c2' in the other columns.
+ * Use attributes 'attr'.
+ */
+ void
+screen_fill(start_row, end_row, start_col, end_col, c1, c2, attr)
+ int start_row, end_row;
+ int start_col, end_col;
+ int c1, c2;
+ int attr;
+{
+ int row;
+ int col;
+ int off;
+ int end_off;
+ int did_delete;
+ int c;
+ int norm_term;
+#if defined(FEAT_GUI) || defined(UNIX)
+ int force_next = FALSE;
+#endif
+
+ if (end_row > screen_Rows) /* safety check */
+ end_row = screen_Rows;
+ if (end_col > screen_Columns) /* safety check */
+ end_col = screen_Columns;
+ if (ScreenLines == NULL
+ || start_row >= end_row
+ || start_col >= end_col) /* nothing to do */
+ return;
+
+ /* it's a "normal" terminal when not in a GUI or cterm */
+ norm_term = (
+#ifdef FEAT_GUI
+ !gui.in_use &&
+#endif
+ t_colors <= 1);
+ for (row = start_row; row < end_row; ++row)
+ {
+ /*
+ * Try to use delete-line termcap code, when no attributes or in a
+ * "normal" terminal, where a bold/italic space is just a
+ * space.
+ */
+ did_delete = FALSE;
+ if (c2 == ' '
+ && end_col == Columns
+ && can_clear(T_CE)
+ && (attr == 0
+ || (norm_term
+ && attr <= HL_ALL
+ && ((attr & ~(HL_BOLD | HL_ITALIC)) == 0))))
+ {
+ /*
+ * check if we really need to clear something
+ */
+ col = start_col;
+ if (c1 != ' ') /* don't clear first char */
+ ++col;
+
+ off = LineOffset[row] + col;
+ end_off = LineOffset[row] + end_col;
+
+ /* skip blanks (used often, keep it fast!) */
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ while (off < end_off && ScreenLines[off] == ' '
+ && ScreenAttrs[off] == 0 && ScreenLinesUC[off] == 0)
+ ++off;
+ else
+#endif
+ while (off < end_off && ScreenLines[off] == ' '
+ && ScreenAttrs[off] == 0)
+ ++off;
+ if (off < end_off) /* something to be cleared */
+ {
+ col = off - LineOffset[row];
+ screen_stop_highlight();
+ term_windgoto(row, col);/* clear rest of this screen line */
+ out_str(T_CE);
+ screen_start(); /* don't know where cursor is now */
+ col = end_col - col;
+ while (col--) /* clear chars in ScreenLines */
+ {
+ ScreenLines[off] = ' ';
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ ScreenLinesUC[off] = 0;
+#endif
+ ScreenAttrs[off] = 0;
+ ++off;
+ }
+ }
+ did_delete = TRUE; /* the chars are cleared now */
+ }
+
+ off = LineOffset[row] + start_col;
+ c = c1;
+ for (col = start_col; col < end_col; ++col)
+ {
+ if (ScreenLines[off] != c
+#ifdef FEAT_MBYTE
+ || (enc_utf8 && ScreenLinesUC[off] != (c >= 0x80 ? c : 0))
+#endif
+ || ScreenAttrs[off] != attr
+#if defined(FEAT_GUI) || defined(UNIX)
+ || force_next
+#endif
+ )
+ {
+#if defined(FEAT_GUI) || defined(UNIX)
+ /* The bold trick may make a single row of pixels appear in
+ * the next character. When a bold character is removed, the
+ * next character should be redrawn too. This happens for our
+ * own GUI and for some xterms. */
+ if (
+# ifdef FEAT_GUI
+ gui.in_use
+# endif
+# if defined(FEAT_GUI) && defined(UNIX)
+ ||
+# endif
+# ifdef UNIX
+ term_is_xterm
+# endif
+ )
+ {
+ if (ScreenLines[off] != ' '
+ && (ScreenAttrs[off] > HL_ALL
+ || ScreenAttrs[off] & HL_BOLD))
+ force_next = TRUE;
+ else
+ force_next = FALSE;
+ }
+#endif
+ ScreenLines[off] = c;
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ if (c >= 0x80)
+ {
+ ScreenLinesUC[off] = c;
+ ScreenLinesC1[off] = 0;
+ ScreenLinesC2[off] = 0;
+ }
+ else
+ ScreenLinesUC[off] = 0;
+ }
+#endif
+ ScreenAttrs[off] = attr;
+ if (!did_delete || c != ' ')
+ screen_char(off, row, col);
+ }
+ ++off;
+ if (col == start_col)
+ {
+ if (did_delete)
+ break;
+ c = c2;
+ }
+ }
+ if (end_col == Columns)
+ LineWraps[row] = FALSE;
+ if (row == Rows - 1) /* overwritten the command line */
+ {
+ redraw_cmdline = TRUE;
+ if (c1 == ' ' && c2 == ' ')
+ clear_cmdline = FALSE; /* command line has been cleared */
+ }
+ }
+}
+
+/*
+ * Check if there should be a delay. Used before clearing or redrawing the
+ * screen or the command line.
+ */
+ void
+check_for_delay(check_msg_scroll)
+ int check_msg_scroll;
+{
+ if ((emsg_on_display || (check_msg_scroll && msg_scroll))
+ && !did_wait_return
+ && emsg_silent == 0)
+ {
+ out_flush();
+ ui_delay(1000L, TRUE);
+ emsg_on_display = FALSE;
+ if (check_msg_scroll)
+ msg_scroll = FALSE;
+ }
+}
+
+/*
+ * screen_valid - allocate screen buffers if size changed
+ * If "clear" is TRUE: clear screen if it has been resized.
+ * Returns TRUE if there is a valid screen to write to.
+ * Returns FALSE when starting up and screen not initialized yet.
+ */
+ int
+screen_valid(clear)
+ int clear;
+{
+ screenalloc(clear); /* allocate screen buffers if size changed */
+ return (ScreenLines != NULL);
+}
+
+/*
+ * Resize the shell to Rows and Columns.
+ * Allocate ScreenLines[] and associated items.
+ *
+ * There may be some time between setting Rows and Columns and (re)allocating
+ * ScreenLines[]. This happens when starting up and when (manually) changing
+ * the shell size. Always use screen_Rows and screen_Columns to access items
+ * in ScreenLines[]. Use Rows and Columns for positioning text etc. where the
+ * final size of the shell is needed.
+ */
+ void
+screenalloc(clear)
+ int clear;
+{
+ int new_row, old_row;
+#ifdef FEAT_GUI
+ int old_Rows;
+#endif
+ win_T *wp;
+ int outofmem = FALSE;
+ int len;
+ schar_T *new_ScreenLines;
+#ifdef FEAT_MBYTE
+ u8char_T *new_ScreenLinesUC = NULL;
+ u8char_T *new_ScreenLinesC1 = NULL;
+ u8char_T *new_ScreenLinesC2 = NULL;
+ schar_T *new_ScreenLines2 = NULL;
+#endif
+ sattr_T *new_ScreenAttrs;
+ unsigned *new_LineOffset;
+ char_u *new_LineWraps;
+ static int entered = FALSE; /* avoid recursiveness */
+
+ /*
+ * Allocation of the screen buffers is done only when the size changes and
+ * when Rows and Columns have been set and we have started doing full
+ * screen stuff.
+ */
+ if ((ScreenLines != NULL
+ && Rows == screen_Rows
+ && Columns == screen_Columns
+#ifdef FEAT_MBYTE
+ && enc_utf8 == (ScreenLinesUC != NULL)
+ && (enc_dbcs == DBCS_JPNU) == (ScreenLines2 != NULL)
+#endif
+ )
+ || Rows == 0
+ || Columns == 0
+ || (!full_screen && ScreenLines == NULL))
+ return;
+
+ /*
+ * It's possible that we produce an out-of-memory message below, which
+ * will cause this function to be called again. To break the loop, just
+ * return here.
+ */
+ if (entered)
+ return;
+ entered = TRUE;
+
+ win_new_shellsize(); /* fit the windows in the new sized shell */
+
+#ifdef FEAT_GUI_BEOS
+ vim_lock_screen(); /* be safe, put it here */
+#endif
+
+ comp_col(); /* recompute columns for shown command and ruler */
+
+ /*
+ * We're changing the size of the screen.
+ * - Allocate new arrays for ScreenLines and ScreenAttrs.
+ * - Move lines from the old arrays into the new arrays, clear extra
+ * lines (unless the screen is going to be cleared).
+ * - Free the old arrays.
+ *
+ * If anything fails, make ScreenLines NULL, so we don't do anything!
+ * Continuing with the old ScreenLines may result in a crash, because the
+ * size is wrong.
+ */
+#ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp; wp = wp->w_next)
+ win_free_lsize(wp);
+#else
+ win_free_lsize(curwin);
+#endif
+
+ new_ScreenLines = (schar_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(schar_T)), FALSE);
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ new_ScreenLinesUC = (u8char_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
+ new_ScreenLinesC1 = (u8char_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
+ new_ScreenLinesC2 = (u8char_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(u8char_T)), FALSE);
+ }
+ if (enc_dbcs == DBCS_JPNU)
+ new_ScreenLines2 = (schar_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(schar_T)), FALSE);
+#endif
+ new_ScreenAttrs = (sattr_T *)lalloc((long_u)(
+ (Rows + 1) * Columns * sizeof(sattr_T)), FALSE);
+ new_LineOffset = (unsigned *)lalloc((long_u)(
+ Rows * sizeof(unsigned)), FALSE);
+ new_LineWraps = (char_u *)lalloc((long_u)(Rows * sizeof(char_u)), FALSE);
+
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (win_alloc_lines(wp) == FAIL)
+ {
+ outofmem = TRUE;
+#ifdef FEAT_WINDOWS
+ break;
+#endif
+ }
+ }
+
+ if (new_ScreenLines == NULL
+#ifdef FEAT_MBYTE
+ || (enc_utf8 && (new_ScreenLinesUC == NULL
+ || new_ScreenLinesC1 == NULL || new_ScreenLinesC2 == NULL))
+ || (enc_dbcs == DBCS_JPNU && new_ScreenLines2 == NULL)
+#endif
+ || new_ScreenAttrs == NULL
+ || new_LineOffset == NULL
+ || new_LineWraps == NULL
+ || outofmem)
+ {
+ do_outofmem_msg((long_u)((Rows + 1) * Columns)); /* guess the size */
+ vim_free(new_ScreenLines);
+ new_ScreenLines = NULL;
+#ifdef FEAT_MBYTE
+ vim_free(new_ScreenLinesUC);
+ new_ScreenLinesUC = NULL;
+ vim_free(new_ScreenLinesC1);
+ new_ScreenLinesC1 = NULL;
+ vim_free(new_ScreenLinesC2);
+ new_ScreenLinesC2 = NULL;
+ vim_free(new_ScreenLines2);
+ new_ScreenLines2 = NULL;
+#endif
+ vim_free(new_ScreenAttrs);
+ new_ScreenAttrs = NULL;
+ vim_free(new_LineOffset);
+ new_LineOffset = NULL;
+ vim_free(new_LineWraps);
+ new_LineWraps = NULL;
+ }
+ else
+ {
+ for (new_row = 0; new_row < Rows; ++new_row)
+ {
+ new_LineOffset[new_row] = new_row * Columns;
+ new_LineWraps[new_row] = FALSE;
+
+ /*
+ * If the screen is not going to be cleared, copy as much as
+ * possible from the old screen to the new one and clear the rest
+ * (used when resizing the window at the "--more--" prompt or when
+ * executing an external command, for the GUI).
+ */
+ if (!clear)
+ {
+ (void)vim_memset(new_ScreenLines + new_row * Columns,
+ ' ', (size_t)Columns * sizeof(schar_T));
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ (void)vim_memset(new_ScreenLinesUC + new_row * Columns,
+ 0, (size_t)Columns * sizeof(u8char_T));
+ (void)vim_memset(new_ScreenLinesC1 + new_row * Columns,
+ 0, (size_t)Columns * sizeof(u8char_T));
+ (void)vim_memset(new_ScreenLinesC2 + new_row * Columns,
+ 0, (size_t)Columns * sizeof(u8char_T));
+ }
+ if (enc_dbcs == DBCS_JPNU)
+ (void)vim_memset(new_ScreenLines2 + new_row * Columns,
+ 0, (size_t)Columns * sizeof(schar_T));
+#endif
+ (void)vim_memset(new_ScreenAttrs + new_row * Columns,
+ 0, (size_t)Columns * sizeof(sattr_T));
+ old_row = new_row + (screen_Rows - Rows);
+ if (old_row >= 0)
+ {
+ if (screen_Columns < Columns)
+ len = screen_Columns;
+ else
+ len = Columns;
+ mch_memmove(new_ScreenLines + new_LineOffset[new_row],
+ ScreenLines + LineOffset[old_row],
+ (size_t)len * sizeof(schar_T));
+#ifdef FEAT_MBYTE
+ if (enc_utf8 && ScreenLinesUC != NULL)
+ {
+ mch_memmove(new_ScreenLinesUC + new_LineOffset[new_row],
+ ScreenLinesUC + LineOffset[old_row],
+ (size_t)len * sizeof(u8char_T));
+ mch_memmove(new_ScreenLinesC1 + new_LineOffset[new_row],
+ ScreenLinesC1 + LineOffset[old_row],
+ (size_t)len * sizeof(u8char_T));
+ mch_memmove(new_ScreenLinesC2 + new_LineOffset[new_row],
+ ScreenLinesC2 + LineOffset[old_row],
+ (size_t)len * sizeof(u8char_T));
+ }
+ if (enc_dbcs == DBCS_JPNU && ScreenLines2 != NULL)
+ mch_memmove(new_ScreenLines2 + new_LineOffset[new_row],
+ ScreenLines2 + LineOffset[old_row],
+ (size_t)len * sizeof(schar_T));
+#endif
+ mch_memmove(new_ScreenAttrs + new_LineOffset[new_row],
+ ScreenAttrs + LineOffset[old_row],
+ (size_t)len * sizeof(sattr_T));
+ }
+ }
+ }
+ /* Use the last line of the screen for the current line. */
+ current_ScreenLine = new_ScreenLines + Rows * Columns;
+ }
+
+ vim_free(ScreenLines);
+#ifdef FEAT_MBYTE
+ vim_free(ScreenLinesUC);
+ vim_free(ScreenLinesC1);
+ vim_free(ScreenLinesC2);
+ vim_free(ScreenLines2);
+#endif
+ vim_free(ScreenAttrs);
+ vim_free(LineOffset);
+ vim_free(LineWraps);
+ ScreenLines = new_ScreenLines;
+#ifdef FEAT_MBYTE
+ ScreenLinesUC = new_ScreenLinesUC;
+ ScreenLinesC1 = new_ScreenLinesC1;
+ ScreenLinesC2 = new_ScreenLinesC2;
+ ScreenLines2 = new_ScreenLines2;
+#endif
+ ScreenAttrs = new_ScreenAttrs;
+ LineOffset = new_LineOffset;
+ LineWraps = new_LineWraps;
+
+ /* It's important that screen_Rows and screen_Columns reflect the actual
+ * size of ScreenLines[]. Set them before calling anything. */
+#ifdef FEAT_GUI
+ old_Rows = screen_Rows;
+#endif
+ screen_Rows = Rows;
+ screen_Columns = Columns;
+
+ must_redraw = CLEAR; /* need to clear the screen later */
+ if (clear)
+ screenclear2();
+
+#ifdef FEAT_GUI
+ else if (gui.in_use
+ && !gui.starting
+ && ScreenLines != NULL
+ && old_Rows != Rows)
+ {
+ (void)gui_redraw_block(0, 0, (int)Rows - 1, (int)Columns - 1, 0);
+ /*
+ * Adjust the position of the cursor, for when executing an external
+ * command.
+ */
+ if (msg_row >= Rows) /* Rows got smaller */
+ msg_row = Rows - 1; /* put cursor at last row */
+ else if (Rows > old_Rows) /* Rows got bigger */
+ msg_row += Rows - old_Rows; /* put cursor in same place */
+ if (msg_col >= Columns) /* Columns got smaller */
+ msg_col = Columns - 1; /* put cursor at last column */
+ }
+#endif
+
+#ifdef FEAT_GUI_BEOS
+ vim_unlock_screen();
+#endif
+ entered = FALSE;
+}
+
+ void
+screenclear()
+{
+ check_for_delay(FALSE);
+ screenalloc(FALSE); /* allocate screen buffers if size changed */
+ screenclear2(); /* clear the screen */
+}
+
+ static void
+screenclear2()
+{
+ int i;
+
+ if (starting == NO_SCREEN || ScreenLines == NULL
+#ifdef FEAT_GUI
+ || (gui.in_use && gui.starting)
+#endif
+ )
+ return;
+
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+#endif
+ screen_attr = -1; /* force setting the Normal colors */
+ screen_stop_highlight(); /* don't want highlighting here */
+
+#ifdef FEAT_CLIPBOARD
+ /* disable selection without redrawing it */
+ clip_scroll_selection(9999);
+#endif
+
+ /* blank out ScreenLines */
+ for (i = 0; i < Rows; ++i)
+ {
+ lineclear(LineOffset[i], (int)Columns);
+ LineWraps[i] = FALSE;
+ }
+
+ if (can_clear(T_CL))
+ {
+ out_str(T_CL); /* clear the display */
+ clear_cmdline = FALSE;
+ }
+ else
+ {
+ /* can't clear the screen, mark all chars with invalid attributes */
+ for (i = 0; i < Rows; ++i)
+ lineinvalid(LineOffset[i], (int)Columns);
+ clear_cmdline = TRUE;
+ }
+
+ screen_cleared = TRUE; /* can use contents of ScreenLines now */
+
+ win_rest_invalid(firstwin);
+ redraw_cmdline = TRUE;
+ if (must_redraw == CLEAR) /* no need to clear again */
+ must_redraw = NOT_VALID;
+ compute_cmdrow();
+ msg_row = cmdline_row; /* put cursor on last line for messages */
+ msg_col = 0;
+ screen_start(); /* don't know where cursor is now */
+ msg_scrolled = 0; /* can't scroll back */
+ msg_didany = FALSE;
+ msg_didout = FALSE;
+}
+
+/*
+ * Clear one line in ScreenLines.
+ */
+ static void
+lineclear(off, width)
+ unsigned off;
+ int width;
+{
+ (void)vim_memset(ScreenLines + off, ' ', (size_t)width * sizeof(schar_T));
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ (void)vim_memset(ScreenLinesUC + off, 0,
+ (size_t)width * sizeof(u8char_T));
+#endif
+ (void)vim_memset(ScreenAttrs + off, 0, (size_t)width * sizeof(sattr_T));
+}
+
+/*
+ * Mark one line in ScreenLines invalid by setting the attributes to an
+ * invalid value.
+ */
+ static void
+lineinvalid(off, width)
+ unsigned off;
+ int width;
+{
+ (void)vim_memset(ScreenAttrs + off, -1, (size_t)width * sizeof(sattr_T));
+}
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Copy part of a Screenline for vertically split window "wp".
+ */
+ static void
+linecopy(to, from, wp)
+ int to;
+ int from;
+ win_T *wp;
+{
+ unsigned off_to = LineOffset[to] + wp->w_wincol;
+ unsigned off_from = LineOffset[from] + wp->w_wincol;
+
+ mch_memmove(ScreenLines + off_to, ScreenLines + off_from,
+ wp->w_width * sizeof(schar_T));
+# ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ mch_memmove(ScreenLinesUC + off_to, ScreenLinesUC + off_from,
+ wp->w_width * sizeof(u8char_T));
+ mch_memmove(ScreenLinesC1 + off_to, ScreenLinesC1 + off_from,
+ wp->w_width * sizeof(u8char_T));
+ mch_memmove(ScreenLinesC2 + off_to, ScreenLinesC2 + off_from,
+ wp->w_width * sizeof(u8char_T));
+ }
+ if (enc_dbcs == DBCS_JPNU)
+ mch_memmove(ScreenLines2 + off_to, ScreenLines2 + off_from,
+ wp->w_width * sizeof(schar_T));
+# endif
+ mch_memmove(ScreenAttrs + off_to, ScreenAttrs + off_from,
+ wp->w_width * sizeof(sattr_T));
+}
+#endif
+
+/*
+ * Return TRUE if clearing with term string "p" would work.
+ * It can't work when the string is empty or it won't set the right background.
+ */
+ int
+can_clear(p)
+ char_u *p;
+{
+ return (*p != NUL && (t_colors <= 1
+#ifdef FEAT_GUI
+ || gui.in_use
+#endif
+ || cterm_normal_bg_color == 0 || *T_UT != NUL));
+}
+
+/*
+ * Reset cursor position. Use whenever cursor was moved because of outputting
+ * something directly to the screen (shell commands) or a terminal control
+ * code.
+ */
+ void
+screen_start()
+{
+ screen_cur_row = screen_cur_col = 9999;
+}
+
+/*
+ * Note that the cursor has gone down to the next line, column 0.
+ * Used for Ex mode.
+ */
+ void
+screen_down()
+{
+ screen_cur_col = 0;
+ if (screen_cur_row < Rows - 1)
+ ++screen_cur_row;
+}
+
+/*
+ * Move the cursor to position "row","col" in the screen.
+ * This tries to find the most efficient way to move, minimizing the number of
+ * characters sent to the terminal.
+ */
+ void
+windgoto(row, col)
+ int row;
+ int col;
+{
+ char_u *p;
+ int i;
+ int plan;
+ int cost;
+ int wouldbe_col;
+ int noinvcurs;
+ char_u *bs;
+ int goto_cost;
+ int attr;
+
+#define GOTO_COST 7 /* asssume a term_windgoto() takes about 7 chars */
+#define HIGHL_COST 5 /* assume unhighlight takes 5 chars */
+
+#define PLAN_LE 1
+#define PLAN_CR 2
+#define PLAN_NL 3
+#define PLAN_WRITE 4
+ /* Can't use ScreenLines unless initialized */
+ if (ScreenLines == NULL)
+ return;
+
+ if (col != screen_cur_col || row != screen_cur_row)
+ {
+ /* Check for valid position. */
+ if (row < 0) /* window without text lines? */
+ row = 0;
+ if (row >= screen_Rows)
+ row = screen_Rows - 1;
+ if (col >= screen_Columns)
+ col = screen_Columns - 1;
+
+ /* check if no cursor movement is allowed in highlight mode */
+ if (screen_attr && *T_MS == NUL)
+ noinvcurs = HIGHL_COST;
+ else
+ noinvcurs = 0;
+ goto_cost = GOTO_COST + noinvcurs;
+
+ /*
+ * Plan how to do the positioning:
+ * 1. Use CR to move it to column 0, same row.
+ * 2. Use T_LE to move it a few columns to the left.
+ * 3. Use NL to move a few lines down, column 0.
+ * 4. Move a few columns to the right with T_ND or by writing chars.
+ *
+ * Don't do this if the cursor went beyond the last column, the cursor
+ * position is unknown then (some terminals wrap, some don't )
+ *
+ * First check if the highlighting attibutes allow us to write
+ * characters to move the cursor to the right.
+ */
+ if (row >= screen_cur_row && screen_cur_col < Columns)
+ {
+ /*
+ * If the cursor is in the same row, bigger col, we can use CR
+ * or T_LE.
+ */
+ bs = NULL; /* init for GCC */
+ attr = screen_attr;
+ if (row == screen_cur_row && col < screen_cur_col)
+ {
+ /* "le" is preferred over "bc", because "bc" is obsolete */
+ if (*T_LE)
+ bs = T_LE; /* "cursor left" */
+ else
+ bs = T_BC; /* "backspace character (old) */
+ if (*bs)
+ cost = (screen_cur_col - col) * (int)STRLEN(bs);
+ else
+ cost = 999;
+ if (col + 1 < cost) /* using CR is less characters */
+ {
+ plan = PLAN_CR;
+ wouldbe_col = 0;
+ cost = 1; /* CR is just one character */
+ }
+ else
+ {
+ plan = PLAN_LE;
+ wouldbe_col = col;
+ }
+ if (noinvcurs) /* will stop highlighting */
+ {
+ cost += noinvcurs;
+ attr = 0;
+ }
+ }
+
+ /*
+ * If the cursor is above where we want to be, we can use CR LF.
+ */
+ else if (row > screen_cur_row)
+ {
+ plan = PLAN_NL;
+ wouldbe_col = 0;
+ cost = (row - screen_cur_row) * 2; /* CR LF */
+ if (noinvcurs) /* will stop highlighting */
+ {
+ cost += noinvcurs;
+ attr = 0;
+ }
+ }
+
+ /*
+ * If the cursor is in the same row, smaller col, just use write.
+ */
+ else
+ {
+ plan = PLAN_WRITE;
+ wouldbe_col = screen_cur_col;
+ cost = 0;
+ }
+
+ /*
+ * Check if any characters that need to be written have the
+ * correct attributes. Also avoid UTF-8 characters.
+ */
+ i = col - wouldbe_col;
+ if (i > 0)
+ cost += i;
+ if (cost < goto_cost && i > 0)
+ {
+ /*
+ * Check if the attributes are correct without additionally
+ * stopping highlighting.
+ */
+ p = ScreenAttrs + LineOffset[row] + wouldbe_col;
+ while (i && *p++ == attr)
+ --i;
+ if (i != 0)
+ {
+ /*
+ * Try if it works when highlighting is stopped here.
+ */
+ if (*--p == 0)
+ {
+ cost += noinvcurs;
+ while (i && *p++ == 0)
+ --i;
+ }
+ if (i != 0)
+ cost = 999; /* different attributes, don't do it */
+ }
+#ifdef FEAT_MBYTE
+ if (enc_utf8)
+ {
+ /* Don't use an UTF-8 char for positioning, it's slow. */
+ for (i = wouldbe_col; i < col; ++i)
+ if (ScreenLinesUC[LineOffset[row] + i] != 0)
+ {
+ cost = 999;
+ break;
+ }
+ }
+#endif
+ }
+
+ /*
+ * We can do it without term_windgoto()!
+ */
+ if (cost < goto_cost)
+ {
+ if (plan == PLAN_LE)
+ {
+ if (noinvcurs)
+ screen_stop_highlight();
+ while (screen_cur_col > col)
+ {
+ out_str(bs);
+ --screen_cur_col;
+ }
+ }
+ else if (plan == PLAN_CR)
+ {
+ if (noinvcurs)
+ screen_stop_highlight();
+ out_char('\r');
+ screen_cur_col = 0;
+ }
+ else if (plan == PLAN_NL)
+ {
+ if (noinvcurs)
+ screen_stop_highlight();
+ while (screen_cur_row < row)
+ {
+ out_char('\n');
+ ++screen_cur_row;
+ }
+ screen_cur_col = 0;
+ }
+
+ i = col - screen_cur_col;
+ if (i > 0)
+ {
+ /*
+ * Use cursor-right if it's one character only. Avoids
+ * removing a line of pixels from the last bold char, when
+ * using the bold trick in the GUI.
+ */
+ if (T_ND[0] != NUL && T_ND[1] == NUL)
+ {
+ while (i-- > 0)
+ out_char(*T_ND);
+ }
+ else
+ {
+ int off;
+
+ off = LineOffset[row] + screen_cur_col;
+ while (i-- > 0)
+ {
+ if (ScreenAttrs[off] != screen_attr)
+ screen_stop_highlight();
+#ifdef FEAT_MBYTE
+ out_flush_check();
+#endif
+ out_char(ScreenLines[off]);
+#ifdef FEAT_MBYTE
+ if (enc_dbcs == DBCS_JPNU
+ && ScreenLines[off] == 0x8e)
+ out_char(ScreenLines2[off]);
+#endif
+ ++off;
+ }
+ }
+ }
+ }
+ }
+ else
+ cost = 999;
+
+ if (cost >= goto_cost)
+ {
+ if (noinvcurs)
+ screen_stop_highlight();
+ if (row == screen_cur_row && (col > screen_cur_col) &&
+ *T_CRI != NUL)
+ term_cursor_right(col - screen_cur_col);
+ else
+ term_windgoto(row, col);
+ }
+ screen_cur_row = row;
+ screen_cur_col = col;
+ }
+}
+
+/*
+ * Set cursor to its position in the current window.
+ */
+ void
+setcursor()
+{
+ if (redrawing())
+ {
+ validate_cursor();
+ windgoto(W_WINROW(curwin) + curwin->w_wrow,
+ W_WINCOL(curwin) + (
+#ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
+# ifdef FEAT_MBYTE
+ has_mbyte ? (*mb_ptr2cells)(ml_get_cursor()) :
+# endif
+ 1)) :
+#endif
+ curwin->w_wcol));
+ }
+}
+
+
+/*
+ * insert 'line_count' lines at 'row' in window 'wp'
+ * if 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated.
+ * if 'mayclear' is TRUE the screen will be cleared if it is faster than
+ * scrolling.
+ * Returns FAIL if the lines are not inserted, OK for success.
+ */
+ int
+win_ins_lines(wp, row, line_count, invalid, mayclear)
+ win_T *wp;
+ int row;
+ int line_count;
+ int invalid;
+ int mayclear;
+{
+ int did_delete;
+ int nextrow;
+ int lastrow;
+ int retval;
+
+ if (invalid)
+ wp->w_lines_valid = 0;
+
+ if (wp->w_height < 5)
+ return FAIL;
+
+ if (line_count > wp->w_height - row)
+ line_count = wp->w_height - row;
+
+ retval = win_do_lines(wp, row, line_count, mayclear, FALSE);
+ if (retval != MAYBE)
+ return retval;
+
+ /*
+ * If there is a next window or a status line, we first try to delete the
+ * lines at the bottom to avoid messing what is after the window.
+ * If this fails and there are following windows, don't do anything to avoid
+ * messing up those windows, better just redraw.
+ */
+ did_delete = FALSE;
+#ifdef FEAT_WINDOWS
+ if (wp->w_next != NULL || wp->w_status_height)
+ {
+ if (screen_del_lines(0, W_WINROW(wp) + wp->w_height - line_count,
+ line_count, (int)Rows, FALSE, NULL) == OK)
+ did_delete = TRUE;
+ else if (wp->w_next)
+ return FAIL;
+ }
+#endif
+ /*
+ * if no lines deleted, blank the lines that will end up below the window
+ */
+ if (!did_delete)
+ {
+#ifdef FEAT_WINDOWS
+ wp->w_redr_status = TRUE;
+#endif
+ redraw_cmdline = TRUE;
+ nextrow = W_WINROW(wp) + wp->w_height + W_STATUS_HEIGHT(wp);
+ lastrow = nextrow + line_count;
+ if (lastrow > Rows)
+ lastrow = Rows;
+ screen_fill(nextrow - line_count, lastrow - line_count,
+ W_WINCOL(wp), (int)W_ENDCOL(wp),
+ ' ', ' ', 0);
+ }
+
+ if (screen_ins_lines(0, W_WINROW(wp) + row, line_count, (int)Rows, NULL)
+ == FAIL)
+ {
+ /* deletion will have messed up other windows */
+ if (did_delete)
+ {
+#ifdef FEAT_WINDOWS
+ wp->w_redr_status = TRUE;
+#endif
+ win_rest_invalid(W_NEXT(wp));
+ }
+ return FAIL;
+ }
+
+ return OK;
+}
+
+/*
+ * delete "line_count" window lines at "row" in window "wp"
+ * If "invalid" is TRUE curwin->w_lines[] is invalidated.
+ * If "mayclear" is TRUE the screen will be cleared if it is faster than
+ * scrolling
+ * Return OK for success, FAIL if the lines are not deleted.
+ */
+ int
+win_del_lines(wp, row, line_count, invalid, mayclear)
+ win_T *wp;
+ int row;
+ int line_count;
+ int invalid;
+ int mayclear;
+{
+ int retval;
+
+ if (invalid)
+ wp->w_lines_valid = 0;
+
+ if (line_count > wp->w_height - row)
+ line_count = wp->w_height - row;
+
+ retval = win_do_lines(wp, row, line_count, mayclear, TRUE);
+ if (retval != MAYBE)
+ return retval;
+
+ if (screen_del_lines(0, W_WINROW(wp) + row, line_count,
+ (int)Rows, FALSE, NULL) == FAIL)
+ return FAIL;
+
+#ifdef FEAT_WINDOWS
+ /*
+ * If there are windows or status lines below, try to put them at the
+ * correct place. If we can't do that, they have to be redrawn.
+ */
+ if (wp->w_next || wp->w_status_height || cmdline_row < Rows - 1)
+ {
+ if (screen_ins_lines(0, W_WINROW(wp) + wp->w_height - line_count,
+ line_count, (int)Rows, NULL) == FAIL)
+ {
+ wp->w_redr_status = TRUE;
+ win_rest_invalid(wp->w_next);
+ }
+ }
+ /*
+ * If this is the last window and there is no status line, redraw the
+ * command line later.
+ */
+ else
+#endif
+ redraw_cmdline = TRUE;
+ return OK;
+}
+
+/*
+ * Common code for win_ins_lines() and win_del_lines().
+ * Returns OK or FAIL when the work has been done.
+ * Returns MAYBE when not finished yet.
+ */
+ static int
+win_do_lines(wp, row, line_count, mayclear, del)
+ win_T *wp;
+ int row;
+ int line_count;
+ int mayclear;
+ int del;
+{
+ int retval;
+
+ if (!redrawing() || line_count <= 0)
+ return FAIL;
+
+ /* only a few lines left: redraw is faster */
+ if (mayclear && Rows - line_count < 5
+#ifdef FEAT_VERTSPLIT
+ && wp->w_width == Columns
+#endif
+ )
+ {
+ screenclear(); /* will set wp->w_lines_valid to 0 */
+ return FAIL;
+ }
+
+ /*
+ * Delete all remaining lines
+ */
+ if (row + line_count >= wp->w_height)
+ {
+ screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + wp->w_height,
+ W_WINCOL(wp), (int)W_ENDCOL(wp),
+ ' ', ' ', 0);
+ return OK;
+ }
+
+ /*
+ * when scrolling, the message on the command line should be cleared,
+ * otherwise it will stay there forever.
+ */
+ clear_cmdline = TRUE;
+
+ /*
+ * If the terminal can set a scroll region, use that.
+ * Always do this in a vertically split window. This will redraw from
+ * ScreenLines[] when t_CV isn't defined. That's faster than using
+ * win_line().
+ * Don't use a scroll region when we are going to redraw the text, writing
+ * a character in the lower right corner of the scroll region causes a
+ * scroll-up in the DJGPP version.
+ */
+ if (scroll_region
+#ifdef FEAT_VERTSPLIT
+ || W_WIDTH(wp) != Columns
+#endif
+ )
+ {
+#ifdef FEAT_VERTSPLIT
+ if (scroll_region && (wp->w_width == Columns || *T_CSV != NUL))
+#endif
+ scroll_region_set(wp, row);
+ if (del)
+ retval = screen_del_lines(W_WINROW(wp) + row, 0, line_count,
+ wp->w_height - row, FALSE, wp);
+ else
+ retval = screen_ins_lines(W_WINROW(wp) + row, 0, line_count,
+ wp->w_height - row, wp);
+#ifdef FEAT_VERTSPLIT
+ if (scroll_region && (wp->w_width == Columns || *T_CSV != NUL))
+#endif
+ scroll_region_reset();
+ return retval;
+ }
+
+#ifdef FEAT_WINDOWS
+ if (wp->w_next != NULL && p_tf) /* don't delete/insert on fast terminal */
+ return FAIL;
+#endif
+
+ return MAYBE;
+}
+
+/*
+ * window 'wp' and everything after it is messed up, mark it for redraw
+ */
+ static void
+win_rest_invalid(wp)
+ win_T *wp;
+{
+#ifdef FEAT_WINDOWS
+ while (wp != NULL)
+#else
+ if (wp != NULL)
+#endif
+ {
+ redraw_win_later(wp, NOT_VALID);
+#ifdef FEAT_WINDOWS
+ wp->w_redr_status = TRUE;
+ wp = wp->w_next;
+#endif
+ }
+ redraw_cmdline = TRUE;
+}
+
+/*
+ * The rest of the routines in this file perform screen manipulations. The
+ * given operation is performed physically on the screen. The corresponding
+ * change is also made to the internal screen image. In this way, the editor
+ * anticipates the effect of editing changes on the appearance of the screen.
+ * That way, when we call screenupdate a complete redraw isn't usually
+ * necessary. Another advantage is that we can keep adding code to anticipate
+ * screen changes, and in the meantime, everything still works.
+ */
+
+/*
+ * types for inserting or deleting lines
+ */
+#define USE_T_CAL 1
+#define USE_T_CDL 2
+#define USE_T_AL 3
+#define USE_T_CE 4
+#define USE_T_DL 5
+#define USE_T_SR 6
+#define USE_NL 7
+#define USE_T_CD 8
+#define USE_REDRAW 9
+
+/*
+ * insert lines on the screen and update ScreenLines[]
+ * 'end' is the line after the scrolled part. Normally it is Rows.
+ * When scrolling region used 'off' is the offset from the top for the region.
+ * 'row' and 'end' are relative to the start of the region.
+ *
+ * return FAIL for failure, OK for success.
+ */
+ static int
+screen_ins_lines(off, row, line_count, end, wp)
+ int off;
+ int row;
+ int line_count;
+ int end;
+ win_T *wp; /* NULL or window to use width from */
+{
+ int i;
+ int j;
+ unsigned temp;
+ int cursor_row;
+ int type;
+ int result_empty;
+ int can_ce = can_clear(T_CE);
+
+ /*
+ * FAIL if
+ * - there is no valid screen
+ * - the screen has to be redrawn completely
+ * - the line count is less than one
+ * - the line count is more than 'ttyscroll'
+ */
+ if (!screen_valid(TRUE) || line_count <= 0 || line_count > p_ttyscroll)
+ return FAIL;
+
+ /*
+ * There are seven ways to insert lines:
+ * 0. When in a vertically split window and t_CV isn't set, redraw the
+ * characters from ScreenLines[].
+ * 1. Use T_CD (clear to end of display) if it exists and the result of
+ * the insert is just empty lines
+ * 2. Use T_CAL (insert multiple lines) if it exists and T_AL is not
+ * present or line_count > 1. It looks better if we do all the inserts
+ * at once.
+ * 3. Use T_CDL (delete multiple lines) if it exists and the result of the
+ * insert is just empty lines and T_CE is not present or line_count >
+ * 1.
+ * 4. Use T_AL (insert line) if it exists.
+ * 5. Use T_CE (erase line) if it exists and the result of the insert is
+ * just empty lines.
+ * 6. Use T_DL (delete line) if it exists and the result of the insert is
+ * just empty lines.
+ * 7. Use T_SR (scroll reverse) if it exists and inserting at row 0 and
+ * the 'da' flag is not set or we have clear line capability.
+ * 8. redraw the characters from ScreenLines[].
+ *
+ * Careful: In a hpterm scroll reverse doesn't work as expected, it moves
+ * the scrollbar for the window. It does have insert line, use that if it
+ * exists.
+ */
+ result_empty = (row + line_count >= end);
+#ifdef FEAT_VERTSPLIT
+ if (wp != NULL && wp->w_width != Columns && *T_CSV == NUL)
+ type = USE_REDRAW;
+ else
+#endif
+ if (can_clear(T_CD) && result_empty)
+ type = USE_T_CD;
+ else if (*T_CAL != NUL && (line_count > 1 || *T_AL == NUL))
+ type = USE_T_CAL;
+ else if (*T_CDL != NUL && result_empty && (line_count > 1 || !can_ce))
+ type = USE_T_CDL;
+ else if (*T_AL != NUL)
+ type = USE_T_AL;
+ else if (can_ce && result_empty)
+ type = USE_T_CE;
+ else if (*T_DL != NUL && result_empty)
+ type = USE_T_DL;
+ else if (*T_SR != NUL && row == 0 && (*T_DA == NUL || can_ce))
+ type = USE_T_SR;
+ else
+ return FAIL;
+
+ /*
+ * For clearing the lines screen_del_lines() is used. This will also take
+ * care of t_db if necessary.
+ */
+ if (type == USE_T_CD || type == USE_T_CDL ||
+ type == USE_T_CE || type == USE_T_DL)
+ return screen_del_lines(off, row, line_count, end, FALSE, wp);
+
+ /*
+ * If text is retained below the screen, first clear or delete as many
+ * lines at the bottom of the window as are about to be inserted so that
+ * the deleted lines won't later surface during a screen_del_lines.
+ */
+ if (*T_DB)
+ screen_del_lines(off, end - line_count, line_count, end, FALSE, wp);
+
+#ifdef FEAT_CLIPBOARD
+ /* Remove a modeless selection when inserting lines halfway the screen
+ * or not the full width of the screen. */
+ if (off + row > 0
+# ifdef FEAT_VERTSPLIT
+ || (wp != NULL && wp->w_width != Columns)
+# endif
+ )
+ clip_clear_selection();
+ else
+ clip_scroll_selection(-line_count);
+#endif
+
+#ifdef FEAT_GUI_BEOS
+ vim_lock_screen();
+#endif
+#ifdef FEAT_GUI
+ /* Don't update the GUI cursor here, ScreenLines[] is invalid until the
+ * scrolling is actually carried out. */
+ gui_dont_update_cursor();
+#endif
+
+ if (*T_CCS != NUL) /* cursor relative to region */
+ cursor_row = row;
+ else
+ cursor_row = row + off;
+
+ /*
+ * Shift LineOffset[] line_count down to reflect the inserted lines.
+ * Clear the inserted lines in ScreenLines[].
+ */
+ row += off;
+ end += off;
+ for (i = 0; i < line_count; ++i)
+ {
+#ifdef FEAT_VERTSPLIT
+ if (wp != NULL && wp->w_width != Columns)
+ {
+ /* need to copy part of a line */
+ j = end - 1 - i;
+ while ((j -= line_count) >= row)
+ linecopy(j + line_count, j, wp);
+ j += line_count;
+ if (can_clear((char_u *)" "))
+ lineclear(LineOffset[j] + wp->w_wincol, wp->w_width);
+ else
+ lineinvalid(LineOffset[j] + wp->w_wincol, wp->w_width);
+ LineWraps[j] = FALSE;
+ }
+ else
+#endif
+ {
+ j = end - 1 - i;
+ temp = LineOffset[j];
+ while ((j -= line_count) >= row)
+ {
+ LineOffset[j + line_count] = LineOffset[j];
+ LineWraps[j + line_count] = LineWraps[j];
+ }
+ LineOffset[j + line_count] = temp;
+ LineWraps[j + line_count] = FALSE;
+ if (can_clear((char_u *)" "))
+ lineclear(temp, (int)Columns);
+ else
+ lineinvalid(temp, (int)Columns);
+ }
+ }
+#ifdef FEAT_GUI_BEOS
+ vim_unlock_screen();
+#endif
+
+ screen_stop_highlight();
+ windgoto(cursor_row, 0);
+
+#ifdef FEAT_VERTSPLIT
+ /* redraw the characters */
+ if (type == USE_REDRAW)
+ redraw_block(row, end, wp);
+ else
+#endif
+ if (type == USE_T_CAL)
+ {
+ term_append_lines(line_count);
+ screen_start(); /* don't know where cursor is now */
+ }
+ else
+ {
+ for (i = 0; i < line_count; i++)
+ {
+ if (type == USE_T_AL)
+ {
+ if (i && cursor_row != 0)
+ windgoto(cursor_row, 0);
+ out_str(T_AL);
+ }
+ else /* type == USE_T_SR */
+ out_str(T_SR);
+ screen_start(); /* don't know where cursor is now */
+ }
+ }
+
+ /*
+ * With scroll-reverse and 'da' flag set we need to clear the lines that
+ * have been scrolled down into the region.
+ */
+ if (type == USE_T_SR && *T_DA)
+ {
+ for (i = 0; i < line_count; ++i)
+ {
+ windgoto(off + i, 0);
+ out_str(T_CE);
+ screen_start(); /* don't know where cursor is now */
+ }
+ }
+
+#ifdef FEAT_GUI
+ gui_can_update_cursor();
+ if (gui.in_use)
+ out_flush(); /* always flush after a scroll */
+#endif
+ return OK;
+}
+
+/*
+ * delete lines on the screen and update ScreenLines[]
+ * 'end' is the line after the scrolled part. Normally it is Rows.
+ * When scrolling region used 'off' is the offset from the top for the region.
+ * 'row' and 'end' are relative to the start of the region.
+ *
+ * Return OK for success, FAIL if the lines are not deleted.
+ */
+/*ARGSUSED*/
+ int
+screen_del_lines(off, row, line_count, end, force, wp)
+ int off;
+ int row;
+ int line_count;
+ int end;
+ int force; /* even when line_count > p_ttyscroll */
+ win_T *wp; /* NULL or window to use width from */
+{
+ int j;
+ int i;
+ unsigned temp;
+ int cursor_row;
+ int cursor_end;
+ int result_empty; /* result is empty until end of region */
+ int can_delete; /* deleting line codes can be used */
+ int type;
+
+ /*
+ * FAIL if
+ * - there is no valid screen
+ * - the screen has to be redrawn completely
+ * - the line count is less than one
+ * - the line count is more than 'ttyscroll'
+ */
+ if (!screen_valid(TRUE) || line_count <= 0 ||
+ (!force && line_count > p_ttyscroll))
+ return FAIL;
+
+ /*
+ * Check if the rest of the current region will become empty.
+ */
+ result_empty = row + line_count >= end;
+
+ /*
+ * We can delete lines only when 'db' flag not set or when 'ce' option
+ * available.
+ */
+ can_delete = (*T_DB == NUL || can_clear(T_CE));
+
+ /*
+ * There are six ways to delete lines:
+ * 0. When in a vertically split window and t_CV isn't set, redraw the
+ * characters from ScreenLines[].
+ * 1. Use T_CD if it exists and the result is empty.
+ * 2. Use newlines if row == 0 and count == 1 or T_CDL does not exist.
+ * 3. Use T_CDL (delete multiple lines) if it exists and line_count > 1 or
+ * none of the other ways work.
+ * 4. Use T_CE (erase line) if the result is empty.
+ * 5. Use T_DL (delete line) if it exists.
+ * 6. redraw the characters from ScreenLines[].
+ */
+#ifdef FEAT_VERTSPLIT
+ if (wp != NULL && wp->w_width != Columns && *T_CSV == NUL)
+ type = USE_REDRAW;
+ else
+#endif
+ if (can_clear(T_CD) && result_empty)
+ type = USE_T_CD;
+#if defined(__BEOS__) && defined(BEOS_DR8)
+ /*
+ * USE_NL does not seem to work in Terminal of DR8 so we set T_DB="" in
+ * its internal termcap... this works okay for tests which test *T_DB !=
+ * NUL. It has the disadvantage that the user cannot use any :set t_*
+ * command to get T_DB (back) to empty_option, only :set term=... will do
+ * the trick...
+ * Anyway, this hack will hopefully go away with the next OS release.
+ * (Olaf Seibert)
+ */
+ else if (row == 0 && T_DB == empty_option
+ && (line_count == 1 || *T_CDL == NUL))
+#else
+ else if (row == 0 && (
+#ifndef AMIGA
+ /* On the Amiga, somehow '\n' on the last line doesn't always scroll
+ * up, so use delete-line command */
+ line_count == 1 ||
+#endif
+ *T_CDL == NUL))
+#endif
+ type = USE_NL;
+ else if (*T_CDL != NUL && line_count > 1 && can_delete)
+ type = USE_T_CDL;
+ else if (can_clear(T_CE) && result_empty
+#ifdef FEAT_VERTSPLIT
+ && (wp == NULL || wp->w_width == Columns)
+#endif
+ )
+ type = USE_T_CE;
+ else if (*T_DL != NUL && can_delete)
+ type = USE_T_DL;
+ else if (*T_CDL != NUL && can_delete)
+ type = USE_T_CDL;
+ else
+ return FAIL;
+
+#ifdef FEAT_CLIPBOARD
+ /* Remove a modeless selection when deleting lines halfway the screen or
+ * not the full width of the screen. */
+ if (off + row > 0
+# ifdef FEAT_VERTSPLIT
+ || (wp != NULL && wp->w_width != Columns)
+# endif
+ )
+ clip_clear_selection();
+ else
+ clip_scroll_selection(line_count);
+#endif
+
+#ifdef FEAT_GUI_BEOS
+ vim_lock_screen();
+#endif
+#ifdef FEAT_GUI
+ /* Don't update the GUI cursor here, ScreenLines[] is invalid until the
+ * scrolling is actually carried out. */
+ gui_dont_update_cursor();
+#endif
+
+ if (*T_CCS != NUL) /* cursor relative to region */
+ {
+ cursor_row = row;
+ cursor_end = end;
+ }
+ else
+ {
+ cursor_row = row + off;
+ cursor_end = end + off;
+ }
+
+ /*
+ * Now shift LineOffset[] line_count up to reflect the deleted lines.
+ * Clear the inserted lines in ScreenLines[].
+ */
+ row += off;
+ end += off;
+ for (i = 0; i < line_count; ++i)
+ {
+#ifdef FEAT_VERTSPLIT
+ if (wp != NULL && wp->w_width != Columns)
+ {
+ /* need to copy part of a line */
+ j = row + i;
+ while ((j += line_count) <= end - 1)
+ linecopy(j - line_count, j, wp);
+ j -= line_count;
+ if (can_clear((char_u *)" "))
+ lineclear(LineOffset[j] + wp->w_wincol, wp->w_width);
+ else
+ lineinvalid(LineOffset[j] + wp->w_wincol, wp->w_width);
+ LineWraps[j] = FALSE;
+ }
+ else
+#endif
+ {
+ /* whole width, moving the line pointers is faster */
+ j = row + i;
+ temp = LineOffset[j];
+ while ((j += line_count) <= end - 1)
+ {
+ LineOffset[j - line_count] = LineOffset[j];
+ LineWraps[j - line_count] = LineWraps[j];
+ }
+ LineOffset[j - line_count] = temp;
+ LineWraps[j - line_count] = FALSE;
+ if (can_clear((char_u *)" "))
+ lineclear(temp, (int)Columns);
+ else
+ lineinvalid(temp, (int)Columns);
+ }
+ }
+#ifdef FEAT_GUI_BEOS
+ vim_unlock_screen();
+#endif
+
+ screen_stop_highlight();
+
+#ifdef FEAT_VERTSPLIT
+ /* redraw the characters */
+ if (type == USE_REDRAW)
+ redraw_block(row, end, wp);
+ else
+#endif
+ if (type == USE_T_CD) /* delete the lines */
+ {
+ windgoto(cursor_row, 0);
+ out_str(T_CD);
+ screen_start(); /* don't know where cursor is now */
+ }
+ else if (type == USE_T_CDL)
+ {
+ windgoto(cursor_row, 0);
+ term_delete_lines(line_count);
+ screen_start(); /* don't know where cursor is now */
+ }
+ /*
+ * Deleting lines at top of the screen or scroll region: Just scroll
+ * the whole screen (scroll region) up by outputting newlines on the
+ * last line.
+ */
+ else if (type == USE_NL)
+ {
+ windgoto(cursor_end - 1, 0);
+ for (i = line_count; --i >= 0; )
+ out_char('\n'); /* cursor will remain on same line */
+ }
+ else
+ {
+ for (i = line_count; --i >= 0; )
+ {
+ if (type == USE_T_DL)
+ {
+ windgoto(cursor_row, 0);
+ out_str(T_DL); /* delete a line */
+ }
+ else /* type == USE_T_CE */
+ {
+ windgoto(cursor_row + i, 0);
+ out_str(T_CE); /* erase a line */
+ }
+ screen_start(); /* don't know where cursor is now */
+ }
+ }
+
+ /*
+ * If the 'db' flag is set, we need to clear the lines that have been
+ * scrolled up at the bottom of the region.
+ */
+ if (*T_DB && (type == USE_T_DL || type == USE_T_CDL))
+ {
+ for (i = line_count; i > 0; --i)
+ {
+ windgoto(cursor_end - i, 0);
+ out_str(T_CE); /* erase a line */
+ screen_start(); /* don't know where cursor is now */
+ }
+ }
+
+#ifdef FEAT_GUI
+ gui_can_update_cursor();
+ if (gui.in_use)
+ out_flush(); /* always flush after a scroll */
+#endif
+
+ return OK;
+}
+
+/*
+ * show the current mode and ruler
+ *
+ * If clear_cmdline is TRUE, clear the rest of the cmdline.
+ * If clear_cmdline is FALSE there may be a message there that needs to be
+ * cleared only if a mode is shown.
+ * Return the length of the message (0 if no message).
+ */
+ int
+showmode()
+{
+ int need_clear;
+ int length = 0;
+ int do_mode;
+ int attr;
+ int nwr_save;
+#ifdef FEAT_INS_EXPAND
+ int sub_attr;
+#endif
+
+ do_mode = (p_smd && ((State & INSERT) || restart_edit
+#ifdef FEAT_VISUAL
+ || VIsual_active
+#endif
+ ));
+ if (do_mode || Recording)
+ {
+ /*
+ * Don't show mode right now, when not redrawing or inside a mapping.
+ * Call char_avail() only when we are going to show something, because
+ * it takes a bit of time.
+ */
+ if (!redrawing() || (char_avail() && !KeyTyped) || msg_silent != 0)
+ {
+ redraw_cmdline = TRUE; /* show mode later */
+ return 0;
+ }
+
+ nwr_save = need_wait_return;
+
+ /* wait a bit before overwriting an important message */
+ check_for_delay(FALSE);
+
+ /* if the cmdline is more than one line high, erase top lines */
+ need_clear = clear_cmdline;
+ if (clear_cmdline && cmdline_row < Rows - 1)
+ msg_clr_cmdline(); /* will reset clear_cmdline */
+
+ /* Position on the last line in the window, column 0 */
+ msg_pos_mode();
+ cursor_off();
+ attr = hl_attr(HLF_CM); /* Highlight mode */
+ if (do_mode)
+ {
+ MSG_PUTS_ATTR("--", attr);
+#if defined(FEAT_XIM)
+ if (xic != NULL && im_get_status() && !p_imdisable
+ && curbuf->b_p_iminsert == B_IMODE_IM)
+# ifdef HAVE_GTK2 /* most of the time, it's not XIM being used */
+ MSG_PUTS_ATTR(" IM", attr);
+# else
+ MSG_PUTS_ATTR(" XIM", attr);
+# endif
+#endif
+#if defined(FEAT_HANGULIN) && defined(FEAT_GUI)
+ if (gui.in_use)
+ {
+ if (hangul_input_state_get())
+ MSG_PUTS_ATTR(" ÇѱÛ", attr); /* HANGUL */
+ }
+#endif
+#ifdef FEAT_INS_EXPAND
+ if (edit_submode != NULL) /* CTRL-X in Insert mode */
+ {
+ /* These messages can get long, avoid a wrap in a narrow
+ * window. Prefer showing edit_submode_extra. */
+ length = (Rows - msg_row) * Columns - 3;
+ if (edit_submode_extra != NULL)
+ length -= vim_strsize(edit_submode_extra);
+ if (length > 0)
+ {
+ if (edit_submode_pre != NULL)
+ length -= vim_strsize(edit_submode_pre);
+ if (length - vim_strsize(edit_submode) > 0)
+ {
+ if (edit_submode_pre != NULL)
+ msg_puts_attr(edit_submode_pre, attr);
+ msg_puts_attr(edit_submode, attr);
+ }
+ if (edit_submode_extra != NULL)
+ {
+ MSG_PUTS_ATTR(" ", attr); /* add a space in between */
+ if ((int)edit_submode_highl < (int)HLF_COUNT)
+ sub_attr = hl_attr(edit_submode_highl);
+ else
+ sub_attr = attr;
+ msg_puts_attr(edit_submode_extra, sub_attr);
+ }
+ }
+ length = 0;
+ }
+ else
+#endif
+ {
+#ifdef FEAT_VREPLACE
+ if (State & VREPLACE_FLAG)
+ MSG_PUTS_ATTR(_(" VREPLACE"), attr);
+ else
+#endif
+ if (State & REPLACE_FLAG)
+ MSG_PUTS_ATTR(_(" REPLACE"), attr);
+ else if (State & INSERT)
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (p_ri)
+ MSG_PUTS_ATTR(_(" REVERSE"), attr);
+#endif
+ MSG_PUTS_ATTR(_(" INSERT"), attr);
+ }
+ else if (restart_edit == 'I')
+ MSG_PUTS_ATTR(_(" (insert)"), attr);
+ else if (restart_edit == 'R')
+ MSG_PUTS_ATTR(_(" (replace)"), attr);
+ else if (restart_edit == 'V')
+ MSG_PUTS_ATTR(_(" (vreplace)"), attr);
+#ifdef FEAT_RIGHTLEFT
+ if (p_hkmap)
+ MSG_PUTS_ATTR(_(" Hebrew"), attr);
+# ifdef FEAT_FKMAP
+ if (p_fkmap)
+ MSG_PUTS_ATTR(farsi_text_5, attr);
+# endif
+#endif
+#ifdef FEAT_KEYMAP
+ if (State & LANGMAP)
+ {
+# ifdef FEAT_ARABIC
+ if (curwin->w_p_arab)
+ MSG_PUTS_ATTR(_(" Arabic"), attr);
+ else
+# endif
+ MSG_PUTS_ATTR(_(" (lang)"), attr);
+ }
+#endif
+ if ((State & INSERT) && p_paste)
+ MSG_PUTS_ATTR(_(" (paste)"), attr);
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ char *p;
+
+ /* Don't concatenate separate words to avoid translation
+ * problems. */
+ switch ((VIsual_select ? 4 : 0)
+ + (VIsual_mode == Ctrl_V) * 2
+ + (VIsual_mode == 'V'))
+ {
+ case 0: p = N_(" VISUAL"); break;
+ case 1: p = N_(" VISUAL LINE"); break;
+ case 2: p = N_(" VISUAL BLOCK"); break;
+ case 4: p = N_(" SELECT"); break;
+ case 5: p = N_(" SELECT LINE"); break;
+ default: p = N_(" SELECT BLOCK"); break;
+ }
+ MSG_PUTS_ATTR(_(p), attr);
+ }
+#endif
+ MSG_PUTS_ATTR(" --", attr);
+ }
+ need_clear = TRUE;
+ }
+ if (Recording
+#ifdef FEAT_INS_EXPAND
+ && edit_submode == NULL /* otherwise it gets too long */
+#endif
+ )
+ {
+ MSG_PUTS_ATTR(_("recording"), attr);
+ need_clear = TRUE;
+ }
+ if (need_clear || clear_cmdline)
+ msg_clr_eos();
+ msg_didout = FALSE; /* overwrite this message */
+ length = msg_col;
+ msg_col = 0;
+ need_wait_return = nwr_save; /* never ask for hit-return for this */
+ }
+ else if (clear_cmdline && msg_silent == 0)
+ /* Clear the whole command line. Will reset "clear_cmdline". */
+ msg_clr_cmdline();
+
+#ifdef FEAT_CMDL_INFO
+# ifdef FEAT_VISUAL
+ /* In Visual mode the size of the selected area must be redrawn. */
+ if (VIsual_active)
+ clear_showcmd();
+# endif
+
+ /* If the last window has no status line, the ruler is after the mode
+ * message and must be redrawn */
+ if (redrawing()
+# ifdef FEAT_WINDOWS
+ && lastwin->w_status_height == 0
+# endif
+ )
+ win_redr_ruler(lastwin, TRUE);
+#endif
+ redraw_cmdline = FALSE;
+ clear_cmdline = FALSE;
+
+ return length;
+}
+
+/*
+ * Position for a mode message.
+ */
+ static void
+msg_pos_mode()
+{
+ msg_col = 0;
+ msg_row = Rows - 1;
+}
+
+/*
+ * Delete mode message. Used when ESC is typed which is expected to end
+ * Insert mode (but Insert mode didn't end yet!).
+ */
+ void
+unshowmode(force)
+ int force;
+{
+ /*
+ * Don't delete it right now, when not redrawing or insided a mapping.
+ */
+ if (!redrawing() || (!force && char_avail() && !KeyTyped))
+ redraw_cmdline = TRUE; /* delete mode later */
+ else
+ {
+ msg_pos_mode();
+ if (Recording)
+ MSG_PUTS_ATTR(_("recording"), hl_attr(HLF_CM));
+ msg_clr_eos();
+ }
+}
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
+/*
+ * Get the character to use in a status line. Get its attributes in "*attr".
+ */
+ static int
+fillchar_status(attr, is_curwin)
+ int *attr;
+ int is_curwin;
+{
+ int fill;
+ if (is_curwin)
+ {
+ *attr = hl_attr(HLF_S);
+ fill = fill_stl;
+ }
+ else
+ {
+ *attr = hl_attr(HLF_SNC);
+ fill = fill_stlnc;
+ }
+ /* Use fill when there is highlighting, and highlighting of current
+ * window differs, or the fillchars differ, or this is not the
+ * current window */
+ if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC)
+ || !is_curwin || firstwin == lastwin)
+ || (fill_stl != fill_stlnc)))
+ return fill;
+ if (is_curwin)
+ return '^';
+ return '=';
+}
+#endif
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Get the character to use in a separator between vertically split windows.
+ * Get its attributes in "*attr".
+ */
+ static int
+fillchar_vsep(attr)
+ int *attr;
+{
+ *attr = hl_attr(HLF_C);
+ if (*attr == 0 && fill_vert == ' ')
+ return '|';
+ else
+ return fill_vert;
+}
+#endif
+
+/*
+ * Return TRUE if redrawing should currently be done.
+ */
+ int
+redrawing()
+{
+ return (!RedrawingDisabled
+ && !(p_lz && char_avail() && !KeyTyped && !do_redraw));
+}
+
+/*
+ * Return TRUE if printing messages should currently be done.
+ */
+ int
+messaging()
+{
+ return (!(p_lz && char_avail() && !KeyTyped));
+}
+
+/*
+ * Show current status info in ruler and various other places
+ * If always is FALSE, only show ruler if position has changed.
+ */
+ void
+showruler(always)
+ int always;
+{
+ if (!always && !redrawing())
+ return;
+#if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
+ if (*p_stl && curwin->w_status_height)
+ win_redr_custom(curwin, FALSE);
+ else
+#endif
+#ifdef FEAT_CMDL_INFO
+ win_redr_ruler(curwin, always);
+#endif
+
+#ifdef FEAT_TITLE
+ if (need_maketitle
+# ifdef FEAT_STL_OPT
+ || (p_icon && (stl_syntax & STL_IN_ICON))
+ || (p_title && (stl_syntax & STL_IN_TITLE))
+# endif
+ )
+ maketitle();
+#endif
+}
+
+#ifdef FEAT_CMDL_INFO
+ static void
+win_redr_ruler(wp, always)
+ win_T *wp;
+ int always;
+{
+ char_u buffer[70];
+ int row;
+ int fillchar;
+ int attr;
+ int empty_line = FALSE;
+ colnr_T virtcol;
+ int i;
+ int o;
+#ifdef FEAT_VERTSPLIT
+ int this_ru_col;
+ int off = 0;
+ int width = Columns;
+# define WITH_OFF(x) x
+# define WITH_WIDTH(x) x
+#else
+# define WITH_OFF(x) 0
+# define WITH_WIDTH(x) Columns
+# define this_ru_col ru_col
+#endif
+
+ /* If 'ruler' off or redrawing disabled, don't do anything */
+ if (!p_ru)
+ return;
+
+ /*
+ * Check if cursor.lnum is valid, since win_redr_ruler() may be called
+ * after deleting lines, before cursor.lnum is corrected.
+ */
+ if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
+ return;
+
+#ifdef FEAT_INS_EXPAND
+ /* Don't draw the ruler while doing insert-completion, it might overwrite
+ * the (long) mode message. */
+# ifdef FEAT_WINDOWS
+ if (wp == lastwin && lastwin->w_status_height == 0)
+# endif
+ if (edit_submode != NULL)
+ return;
+#endif
+
+#ifdef FEAT_STL_OPT
+ if (*p_ruf)
+ {
+ win_redr_custom(wp, TRUE);
+ return;
+ }
+#endif
+
+ /*
+ * Check if not in Insert mode and the line is empty (will show "0-1").
+ */
+ if (!(State & INSERT)
+ && *ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE) == NUL)
+ empty_line = TRUE;
+
+ /*
+ * Only draw the ruler when something changed.
+ */
+ validate_virtcol_win(wp);
+ if ( redraw_cmdline
+ || always
+ || wp->w_cursor.lnum != wp->w_ru_cursor.lnum
+ || wp->w_cursor.col != wp->w_ru_cursor.col
+ || wp->w_virtcol != wp->w_ru_virtcol
+#ifdef FEAT_VIRTUALEDIT
+ || wp->w_cursor.coladd != wp->w_ru_cursor.coladd
+#endif
+ || wp->w_topline != wp->w_ru_topline
+ || wp->w_buffer->b_ml.ml_line_count != wp->w_ru_line_count
+#ifdef FEAT_DIFF
+ || wp->w_topfill != wp->w_ru_topfill
+#endif
+ || empty_line != wp->w_ru_empty)
+ {
+ cursor_off();
+#ifdef FEAT_WINDOWS
+ if (wp->w_status_height)
+ {
+ row = W_WINROW(wp) + wp->w_height;
+ fillchar = fillchar_status(&attr, wp == curwin);
+# ifdef FEAT_VERTSPLIT
+ off = W_WINCOL(wp);
+ width = W_WIDTH(wp);
+# endif
+ }
+ else
+#endif
+ {
+ row = Rows - 1;
+ fillchar = ' ';
+ attr = 0;
+#ifdef FEAT_VERTSPLIT
+ width = Columns;
+ off = 0;
+#endif
+ }
+
+ /* In list mode virtcol needs to be recomputed */
+ virtcol = wp->w_virtcol;
+ if (wp->w_p_list && lcs_tab1 == NUL)
+ {
+ wp->w_p_list = FALSE;
+ getvvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL);
+ wp->w_p_list = TRUE;
+ }
+
+ /*
+ * Some sprintfs return the length, some return a pointer.
+ * To avoid portability problems we use strlen() here.
+ */
+ sprintf((char *)buffer, "%ld,",
+ (wp->w_buffer->b_ml.ml_flags & ML_EMPTY)
+ ? 0L
+ : (long)(wp->w_cursor.lnum));
+ col_print(buffer + STRLEN(buffer),
+ empty_line ? 0 : (int)wp->w_cursor.col + 1,
+ (int)virtcol + 1);
+
+ /*
+ * Add a "50%" if there is room for it.
+ * On the last line, don't print in the last column (scrolls the
+ * screen up on some terminals).
+ */
+ i = (int)STRLEN(buffer);
+ get_rel_pos(wp, buffer + i + 1);
+ o = i + vim_strsize(buffer + i + 1);
+#ifdef FEAT_WINDOWS
+ if (wp->w_status_height == 0) /* can't use last char of screen */
+#endif
+ ++o;
+#ifdef FEAT_VERTSPLIT
+ this_ru_col = ru_col - (Columns - width);
+ if (this_ru_col < 0)
+ this_ru_col = 0;
+#endif
+ /* Never use more than half the window/screen width, leave the other
+ * half for the filename. */
+ if (this_ru_col < (WITH_WIDTH(width) + 1) / 2)
+ this_ru_col = (WITH_WIDTH(width) + 1) / 2;
+ if (this_ru_col + o < WITH_WIDTH(width))
+ {
+ while (this_ru_col + o < WITH_WIDTH(width))
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ i += (*mb_char2bytes)(fillchar, buffer + i);
+ else
+#endif
+ buffer[i++] = fillchar;
+ ++o;
+ }
+ get_rel_pos(wp, buffer + i);
+ }
+ /* Truncate at window boundary. */
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ o = 0;
+ for (i = 0; buffer[i] != NUL; i += (*mb_ptr2len_check)(buffer + i))
+ {
+ o += (*mb_ptr2cells)(buffer + i);
+ if (this_ru_col + o > WITH_WIDTH(width))
+ {
+ buffer[i] = NUL;
+ break;
+ }
+ }
+ }
+ else
+#endif
+ if (this_ru_col + (int)STRLEN(buffer) > WITH_WIDTH(width))
+ buffer[WITH_WIDTH(width) - this_ru_col] = NUL;
+
+ screen_puts(buffer, row, this_ru_col + WITH_OFF(off), attr);
+ i = redraw_cmdline;
+ screen_fill(row, row + 1,
+ this_ru_col + WITH_OFF(off) + (int)STRLEN(buffer),
+ (int)(WITH_OFF(off) + WITH_WIDTH(width)),
+ fillchar, fillchar, attr);
+ /* don't redraw the cmdline because of showing the ruler */
+ redraw_cmdline = i;
+ wp->w_ru_cursor = wp->w_cursor;
+ wp->w_ru_virtcol = wp->w_virtcol;
+ wp->w_ru_empty = empty_line;
+ wp->w_ru_topline = wp->w_topline;
+ wp->w_ru_line_count = wp->w_buffer->b_ml.ml_line_count;
+#ifdef FEAT_DIFF
+ wp->w_ru_topfill = wp->w_topfill;
+#endif
+ }
+}
+#endif
diff --git a/src/search.c b/src/search.c
new file mode 100644
index 000000000..924f9e4fa
--- /dev/null
+++ b/src/search.c
@@ -0,0 +1,4487 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ * search.c: code for normal mode searching commands
+ */
+
+#include "vim.h"
+
+static void save_re_pat __ARGS((int idx, char_u *pat, int magic));
+#ifdef FEAT_EVAL
+static int first_submatch __ARGS((regmmatch_T *rp));
+#endif
+static int check_prevcol __ARGS((char_u *linep, int col, int ch, int *prevcol));
+static int inmacro __ARGS((char_u *, char_u *));
+static int check_linecomment __ARGS((char_u *line));
+static int cls __ARGS((void));
+static int skip_chars __ARGS((int, int));
+#ifdef FEAT_TEXTOBJ
+static void back_in_line __ARGS((void));
+static void find_first_blank __ARGS((pos_T *));
+static void findsent_forward __ARGS((long count, int at_start_sent));
+#endif
+#ifdef FEAT_FIND_ID
+static void show_pat_in_path __ARGS((char_u *, int,
+ int, int, FILE *, linenr_T *, long));
+#endif
+#ifdef FEAT_VIMINFO
+static void wvsp_one __ARGS((FILE *fp, int idx, char *s, int sc));
+#endif
+
+static char_u *top_bot_msg = (char_u *)N_("search hit TOP, continuing at BOTTOM");
+static char_u *bot_top_msg = (char_u *)N_("search hit BOTTOM, continuing at TOP");
+
+/*
+ * This file contains various searching-related routines. These fall into
+ * three groups:
+ * 1. string searches (for /, ?, n, and N)
+ * 2. character searches within a single line (for f, F, t, T, etc)
+ * 3. "other" kinds of searches like the '%' command, and 'word' searches.
+ */
+
+/*
+ * String searches
+ *
+ * The string search functions are divided into two levels:
+ * lowest: searchit(); uses an pos_T for starting position and found match.
+ * Highest: do_search(); uses curwin->w_cursor; calls searchit().
+ *
+ * The last search pattern is remembered for repeating the same search.
+ * This pattern is shared between the :g, :s, ? and / commands.
+ * This is in search_regcomp().
+ *
+ * The actual string matching is done using a heavily modified version of
+ * Henry Spencer's regular expression library. See regexp.c.
+ */
+
+/* The offset for a search command is store in a soff struct */
+/* Note: only spats[0].off is really used */
+struct soffset
+{
+ int dir; /* search direction */
+ int line; /* search has line offset */
+ int end; /* search set cursor at end */
+ long off; /* line or char offset */
+};
+
+/* A search pattern and its attributes are stored in a spat struct */
+struct spat
+{
+ char_u *pat; /* the pattern (in allocated memory) or NULL */
+ int magic; /* magicness of the pattern */
+ int no_scs; /* no smarcase for this pattern */
+ struct soffset off;
+};
+
+/*
+ * Two search patterns are remembered: One for the :substitute command and
+ * one for other searches. last_idx points to the one that was used the last
+ * time.
+ */
+static struct spat spats[2] =
+{
+ {NULL, TRUE, FALSE, {'/', 0, 0, 0L}}, /* last used search pat */
+ {NULL, TRUE, FALSE, {'/', 0, 0, 0L}} /* last used substitute pat */
+};
+
+static int last_idx = 0; /* index in spats[] for RE_LAST */
+
+#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
+/* copy of spats[], for keeping the search patterns while executing autocmds */
+static struct spat saved_spats[2];
+static int saved_last_idx = 0;
+# ifdef FEAT_SEARCH_EXTRA
+static int saved_no_hlsearch = 0;
+# endif
+#endif
+
+static char_u *mr_pattern = NULL; /* pattern used by search_regcomp() */
+#ifdef FEAT_RIGHTLEFT
+static int mr_pattern_alloced = FALSE; /* mr_pattern was allocated */
+static char_u *reverse_text __ARGS((char_u *s));
+#endif
+
+#ifdef FEAT_FIND_ID
+/*
+ * Type used by find_pattern_in_path() to remember which included files have
+ * been searched already.
+ */
+typedef struct SearchedFile
+{
+ FILE *fp; /* File pointer */
+ char_u *name; /* Full name of file */
+ linenr_T lnum; /* Line we were up to in file */
+ int matched; /* Found a match in this file */
+} SearchedFile;
+#endif
+
+/*
+ * translate search pattern for vim_regcomp()
+ *
+ * pat_save == RE_SEARCH: save pat in spats[RE_SEARCH].pat (normal search cmd)
+ * pat_save == RE_SUBST: save pat in spats[RE_SUBST].pat (:substitute command)
+ * pat_save == RE_BOTH: save pat in both patterns (:global command)
+ * pat_use == RE_SEARCH: use previous search pattern if "pat" is NULL
+ * pat_use == RE_SUBST: use previous sustitute pattern if "pat" is NULL
+ * pat_use == RE_LAST: use last used pattern if "pat" is NULL
+ * options & SEARCH_HIS: put search string in history
+ * options & SEARCH_KEEP: keep previous search pattern
+ *
+ * returns FAIL if failed, OK otherwise.
+ */
+ int
+search_regcomp(pat, pat_save, pat_use, options, regmatch)
+ char_u *pat;
+ int pat_save;
+ int pat_use;
+ int options;
+ regmmatch_T *regmatch; /* return: pattern and ignore-case flag */
+{
+ int magic;
+ int i;
+
+ rc_did_emsg = FALSE;
+ magic = p_magic;
+
+ /*
+ * If no pattern given, use a previously defined pattern.
+ */
+ if (pat == NULL || *pat == NUL)
+ {
+ if (pat_use == RE_LAST)
+ i = last_idx;
+ else
+ i = pat_use;
+ if (spats[i].pat == NULL) /* pattern was never defined */
+ {
+ if (pat_use == RE_SUBST)
+ EMSG(_(e_nopresub));
+ else
+ EMSG(_(e_noprevre));
+ rc_did_emsg = TRUE;
+ return FAIL;
+ }
+ pat = spats[i].pat;
+ magic = spats[i].magic;
+ no_smartcase = spats[i].no_scs;
+ }
+#ifdef FEAT_CMDHIST
+ else if (options & SEARCH_HIS) /* put new pattern in history */
+ add_to_history(HIST_SEARCH, pat, TRUE, NUL);
+#endif
+
+#ifdef FEAT_RIGHTLEFT
+ if (mr_pattern_alloced)
+ {
+ vim_free(mr_pattern);
+ mr_pattern_alloced = FALSE;
+ }
+
+ if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
+ {
+ char_u *rev_pattern;
+
+ rev_pattern = reverse_text(pat);
+ if (rev_pattern == NULL)
+ mr_pattern = pat; /* out of memory, keep normal pattern. */
+ else
+ {
+ mr_pattern = rev_pattern;
+ mr_pattern_alloced = TRUE;
+ }
+ }
+ else
+#endif
+ mr_pattern = pat;
+
+ /*
+ * Save the currently used pattern in the appropriate place,
+ * unless the pattern should not be remembered.
+ */
+ if (!(options & SEARCH_KEEP))
+ {
+ /* search or global command */
+ if (pat_save == RE_SEARCH || pat_save == RE_BOTH)
+ save_re_pat(RE_SEARCH, pat, magic);
+ /* substitute or global command */
+ if (pat_save == RE_SUBST || pat_save == RE_BOTH)
+ save_re_pat(RE_SUBST, pat, magic);
+ }
+
+ regmatch->rmm_ic = ignorecase(pat);
+ regmatch->regprog = vim_regcomp(pat, magic ? RE_MAGIC : 0);
+ if (regmatch->regprog == NULL)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Get search pattern used by search_regcomp().
+ */
+ char_u *
+get_search_pat()
+{
+ return mr_pattern;
+}
+
+#ifdef FEAT_RIGHTLEFT
+/*
+ * Reverse text into allocated memory.
+ * Returns the allocated string, NULL when out of memory.
+ */
+ static char_u *
+reverse_text(s)
+ char_u *s;
+{
+ unsigned len;
+ unsigned s_i, rev_i;
+ char_u *rev;
+
+ /*
+ * Reverse the pattern.
+ */
+ len = (unsigned)STRLEN(s);
+ rev = alloc(len + 1);
+ if (rev != NULL)
+ {
+ rev_i = len;
+ for (s_i = 0; s_i < len; ++s_i)
+ {
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int mb_len;
+
+ mb_len = (*mb_ptr2len_check)(s + s_i);
+ rev_i -= mb_len;
+ mch_memmove(rev + rev_i, s + s_i, mb_len);
+ s_i += mb_len - 1;
+ }
+ else
+# endif
+ rev[--rev_i] = s[s_i];
+
+ }
+ rev[len] = NUL;
+ }
+ return rev;
+}
+#endif
+
+ static void
+save_re_pat(idx, pat, magic)
+ int idx;
+ char_u *pat;
+ int magic;
+{
+ if (spats[idx].pat != pat)
+ {
+ vim_free(spats[idx].pat);
+ spats[idx].pat = vim_strsave(pat);
+ spats[idx].magic = magic;
+ spats[idx].no_scs = no_smartcase;
+ last_idx = idx;
+#ifdef FEAT_SEARCH_EXTRA
+ /* If 'hlsearch' set and search pat changed: need redraw. */
+ if (p_hls)
+ redraw_all_later(NOT_VALID);
+ no_hlsearch = FALSE;
+#endif
+ }
+}
+
+#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Save the search patterns, so they can be restored later.
+ * Used before/after executing autocommands and user functions.
+ */
+static int save_level = 0;
+
+ void
+save_search_patterns()
+{
+ if (save_level++ == 0)
+ {
+ saved_spats[0] = spats[0];
+ if (spats[0].pat != NULL)
+ saved_spats[0].pat = vim_strsave(spats[0].pat);
+ saved_spats[1] = spats[1];
+ if (spats[1].pat != NULL)
+ saved_spats[1].pat = vim_strsave(spats[1].pat);
+ saved_last_idx = last_idx;
+# ifdef FEAT_SEARCH_EXTRA
+ saved_no_hlsearch = no_hlsearch;
+# endif
+ }
+}
+
+ void
+restore_search_patterns()
+{
+ if (--save_level == 0)
+ {
+ vim_free(spats[0].pat);
+ spats[0] = saved_spats[0];
+ vim_free(spats[1].pat);
+ spats[1] = saved_spats[1];
+ last_idx = saved_last_idx;
+# ifdef FEAT_SEARCH_EXTRA
+ no_hlsearch = saved_no_hlsearch;
+# endif
+ }
+}
+#endif
+
+/*
+ * Return TRUE when case should be ignored for search pattern "pat".
+ * Uses the 'ignorecase' and 'smartcase' options.
+ */
+ int
+ignorecase(pat)
+ char_u *pat;
+{
+ char_u *p;
+ int ic;
+
+ ic = p_ic;
+ if (ic && !no_smartcase && p_scs
+#ifdef FEAT_INS_EXPAND
+ && !(ctrl_x_mode && curbuf->b_p_inf)
+#endif
+ )
+ {
+ /* don't ignore case if pattern has uppercase */
+ for (p = pat; *p; )
+ {
+#ifdef FEAT_MBYTE
+ int l;
+
+ if (has_mbyte && (l = (*mb_ptr2len_check)(p)) > 1)
+ {
+ if (enc_utf8 && utf_isupper(utf_ptr2char(p)))
+ {
+ ic = FALSE;
+ break;
+ }
+ p += l;
+ }
+ else
+#endif
+ if (*p == '\\' && p[1] != NUL) /* skip "\S" et al. */
+ p += 2;
+ else if (isupper(*p++))
+ {
+ ic = FALSE;
+ break;
+ }
+ }
+ }
+ no_smartcase = FALSE;
+
+ return ic;
+}
+
+ char_u *
+last_search_pat()
+{
+ return spats[last_idx].pat;
+}
+
+/*
+ * Reset search direction to forward. For "gd" and "gD" commands.
+ */
+ void
+reset_search_dir()
+{
+ spats[0].off.dir = '/';
+}
+
+#if defined(FEAT_EVAL) || defined(FEAT_VIMINFO)
+/*
+ * Set the last search pattern. For ":let @/ =" and viminfo.
+ * Also set the saved search pattern, so that this works in an autocommand.
+ */
+ void
+set_last_search_pat(s, idx, magic, setlast)
+ char_u *s;
+ int idx;
+ int magic;
+ int setlast;
+{
+ vim_free(spats[idx].pat);
+ /* An empty string means that nothing should be matched. */
+ if (*s == NUL)
+ spats[idx].pat = NULL;
+ else
+ spats[idx].pat = vim_strsave(s);
+ spats[idx].magic = magic;
+ spats[idx].no_scs = FALSE;
+ spats[idx].off.dir = '/';
+ spats[idx].off.line = FALSE;
+ spats[idx].off.end = FALSE;
+ spats[idx].off.off = 0;
+ if (setlast)
+ last_idx = idx;
+ if (save_level)
+ {
+ vim_free(saved_spats[idx].pat);
+ saved_spats[idx] = spats[0];
+ if (spats[idx].pat == NULL)
+ saved_spats[idx].pat = NULL;
+ else
+ saved_spats[idx].pat = vim_strsave(spats[idx].pat);
+ saved_last_idx = last_idx;
+ }
+# ifdef FEAT_SEARCH_EXTRA
+ /* If 'hlsearch' set and search pat changed: need redraw. */
+ if (p_hls && idx == last_idx && !no_hlsearch)
+ redraw_all_later(NOT_VALID);
+# endif
+}
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+/*
+ * Get a regexp program for the last used search pattern.
+ * This is used for highlighting all matches in a window.
+ * Values returned in regmatch->regprog and regmatch->rmm_ic.
+ */
+ void
+last_pat_prog(regmatch)
+ regmmatch_T *regmatch;
+{
+ if (spats[last_idx].pat == NULL)
+ {
+ regmatch->regprog = NULL;
+ return;
+ }
+ ++emsg_off; /* So it doesn't beep if bad expr */
+ (void)search_regcomp((char_u *)"", 0, last_idx, SEARCH_KEEP, regmatch);
+ --emsg_off;
+}
+#endif
+
+/*
+ * lowest level search function.
+ * Search for 'count'th occurrence of pattern 'pat' in direction 'dir'.
+ * Start at position 'pos' and return the found position in 'pos'.
+ *
+ * if (options & SEARCH_MSG) == 0 don't give any messages
+ * if (options & SEARCH_MSG) == SEARCH_NFMSG don't give 'notfound' messages
+ * if (options & SEARCH_MSG) == SEARCH_MSG give all messages
+ * if (options & SEARCH_HIS) put search pattern in history
+ * if (options & SEARCH_END) return position at end of match
+ * if (options & SEARCH_START) accept match at pos itself
+ * if (options & SEARCH_KEEP) keep previous search pattern
+ * if (options & SEARCH_FOLD) match only once in a closed fold
+ * if (options & SEARCH_PEEK) check for typed char, cancel search
+ *
+ * Return FAIL (zero) for failure, non-zero for success.
+ * When FEAT_EVAL is defined, returns the index of the first matching
+ * subpattern plus one; one if there was none.
+ */
+ int
+searchit(win, buf, pos, dir, pat, count, options, pat_use)
+ win_T *win; /* window to search in; can be NULL for a
+ buffer without a window! */
+ buf_T *buf;
+ pos_T *pos;
+ int dir;
+ char_u *pat;
+ long count;
+ int options;
+ int pat_use;
+{
+ int found;
+ linenr_T lnum; /* no init to shut up Apollo cc */
+ regmmatch_T regmatch;
+ char_u *ptr;
+ colnr_T matchcol;
+ colnr_T startcol;
+ lpos_T endpos;
+ int loop;
+ pos_T start_pos;
+ int at_first_line;
+ int extra_col;
+ int match_ok;
+ long nmatched;
+ int submatch = 0;
+ linenr_T first_lnum;
+#ifdef FEAT_SEARCH_EXTRA
+ int break_loop = FALSE;
+#else
+# define break_loop FALSE
+#endif
+
+ if (search_regcomp(pat, RE_SEARCH, pat_use,
+ (options & (SEARCH_HIS + SEARCH_KEEP)), &regmatch) == FAIL)
+ {
+ if ((options & SEARCH_MSG) && !rc_did_emsg)
+ EMSG2(_("E383: Invalid search string: %s"), mr_pattern);
+ return FAIL;
+ }
+
+ if (options & SEARCH_START)
+ extra_col = 0;
+#ifdef FEAT_MBYTE
+ /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
+ else if (has_mbyte && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
+ && pos->col < MAXCOL - 2)
+ extra_col = (*mb_ptr2len_check)(ml_get_buf(buf, pos->lnum, FALSE)
+ + pos->col);
+#endif
+ else
+ extra_col = 1;
+
+/*
+ * find the string
+ */
+ called_emsg = FALSE;
+ do /* loop for count */
+ {
+ start_pos = *pos; /* remember start pos for detecting no match */
+ found = 0; /* default: not found */
+ at_first_line = TRUE; /* default: start in first line */
+ if (pos->lnum == 0) /* correct lnum for when starting in line 0 */
+ {
+ pos->lnum = 1;
+ pos->col = 0;
+ at_first_line = FALSE; /* not in first line now */
+ }
+
+ /*
+ * Start searching in current line, unless searching backwards and
+ * we're in column 0.
+ */
+ if (dir == BACKWARD && start_pos.col == 0)
+ {
+ lnum = pos->lnum - 1;
+ at_first_line = FALSE;
+ }
+ else
+ lnum = pos->lnum;
+
+ for (loop = 0; loop <= 1; ++loop) /* loop twice if 'wrapscan' set */
+ {
+ for ( ; lnum > 0 && lnum <= buf->b_ml.ml_line_count;
+ lnum += dir, at_first_line = FALSE)
+ {
+ /*
+ * Look for a match somewhere in the line.
+ */
+ first_lnum = lnum;
+ nmatched = vim_regexec_multi(&regmatch, win, buf,
+ lnum, (colnr_T)0);
+ /* Abort searching on an error (e.g., out of stack). */
+ if (called_emsg)
+ break;
+ if (nmatched > 0)
+ {
+ /* match may actually be in another line when using \zs */
+ lnum += regmatch.startpos[0].lnum;
+ ptr = ml_get_buf(buf, lnum, FALSE);
+ startcol = regmatch.startpos[0].col;
+ endpos = regmatch.endpos[0];
+# ifdef FEAT_EVAL
+ submatch = first_submatch(&regmatch);
+# endif
+
+ /*
+ * Forward search in the first line: match should be after
+ * the start position. If not, continue at the end of the
+ * match (this is vi compatible) or on the next char.
+ */
+ if (dir == FORWARD && at_first_line)
+ {
+ match_ok = TRUE;
+ /*
+ * When match lands on a NUL the cursor will be put
+ * one back afterwards, compare with that position,
+ * otherwise "/$" will get stuck on end of line.
+ */
+ while ((options & SEARCH_END)
+ ? (nmatched == 1
+ && (int)endpos.col - 1
+ < (int)start_pos.col + extra_col)
+ : ((int)startcol - (ptr[startcol] == NUL)
+ < (int)start_pos.col + extra_col))
+ {
+ /*
+ * If vi-compatible searching, continue at the end
+ * of the match, otherwise continue one position
+ * forward.
+ */
+ if (vim_strchr(p_cpo, CPO_SEARCH) != NULL)
+ {
+ if (nmatched > 1)
+ {
+ /* end is in next line, thus no match in
+ * this line */
+ match_ok = FALSE;
+ break;
+ }
+ matchcol = endpos.col;
+ /* for empty match: advance one char */
+ if (matchcol == startcol
+ && ptr[matchcol] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ matchcol +=
+ (*mb_ptr2len_check)(ptr + matchcol);
+ else
+#endif
+ ++matchcol;
+ }
+ }
+ else
+ {
+ matchcol = startcol;
+ if (ptr[matchcol] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ matchcol += (*mb_ptr2len_check)(ptr
+ + matchcol);
+ else
+#endif
+ ++matchcol;
+ }
+ }
+ if (ptr[matchcol] == NUL
+ || (nmatched = vim_regexec_multi(&regmatch,
+ win, buf, lnum, matchcol)) == 0)
+ {
+ match_ok = FALSE;
+ break;
+ }
+ startcol = regmatch.startpos[0].col;
+ endpos = regmatch.endpos[0];
+# ifdef FEAT_EVAL
+ submatch = first_submatch(&regmatch);
+# endif
+
+ /* Need to get the line pointer again, a
+ * multi-line search may have made it invalid. */
+ ptr = ml_get_buf(buf, lnum, FALSE);
+ }
+ if (!match_ok)
+ continue;
+ }
+ if (dir == BACKWARD)
+ {
+ /*
+ * Now, if there are multiple matches on this line,
+ * we have to get the last one. Or the last one before
+ * the cursor, if we're on that line.
+ * When putting the new cursor at the end, compare
+ * relative to the end of the match.
+ */
+ match_ok = FALSE;
+ for (;;)
+ {
+ if (!at_first_line
+ || ((options & SEARCH_END)
+ ? (nmatched == 1
+ && (int)regmatch.endpos[0].col - 1
+ + extra_col
+ <= (int)start_pos.col)
+ : ((int)regmatch.startpos[0].col
+ + extra_col
+ <= (int)start_pos.col)))
+ {
+ /* Remember this position, we use it if it's
+ * the last match in the line. */
+ match_ok = TRUE;
+ startcol = regmatch.startpos[0].col;
+ endpos = regmatch.endpos[0];
+# ifdef FEAT_EVAL
+ submatch = first_submatch(&regmatch);
+# endif
+ }
+ else
+ break;
+
+ /*
+ * We found a valid match, now check if there is
+ * another one after it.
+ * If vi-compatible searching, continue at the end
+ * of the match, otherwise continue one position
+ * forward.
+ */
+ if (vim_strchr(p_cpo, CPO_SEARCH) != NULL)
+ {
+ if (nmatched > 1)
+ break;
+ matchcol = endpos.col;
+ /* for empty match: advance one char */
+ if (matchcol == startcol
+ && ptr[matchcol] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ matchcol +=
+ (*mb_ptr2len_check)(ptr + matchcol);
+ else
+#endif
+ ++matchcol;
+ }
+ }
+ else
+ {
+ matchcol = startcol;
+ if (ptr[matchcol] != NUL)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ matchcol +=
+ (*mb_ptr2len_check)(ptr + matchcol);
+ else
+#endif
+ ++matchcol;
+ }
+ }
+ if (ptr[matchcol] == NUL
+ || (nmatched = vim_regexec_multi(&regmatch,
+ win, buf, lnum, matchcol)) == 0)
+ break;
+
+ /* Need to get the line pointer again, a
+ * multi-line search may have made it invalid. */
+ ptr = ml_get_buf(buf, lnum, FALSE);
+ }
+
+ /*
+ * If there is only a match after the cursor, skip
+ * this match.
+ */
+ if (!match_ok)
+ continue;
+ }
+
+ if (options & SEARCH_END && !(options & SEARCH_NOOF))
+ {
+ pos->lnum = endpos.lnum + first_lnum;
+ pos->col = endpos.col - 1;
+ }
+ else
+ {
+ pos->lnum = lnum;
+ pos->col = startcol;
+ }
+#ifdef FEAT_VIRTUALEDIT
+ pos->coladd = 0;
+#endif
+ found = 1;
+
+ /* Set variables used for 'incsearch' highlighting. */
+ search_match_lines = endpos.lnum - (lnum - first_lnum);
+ search_match_endcol = endpos.col;
+ break;
+ }
+ line_breakcheck(); /* stop if ctrl-C typed */
+ if (got_int)
+ break;
+
+#ifdef FEAT_SEARCH_EXTRA
+ /* Cancel searching if a character was typed. Used for
+ * 'incsearch'. Don't check too often, that would slowdown
+ * searching too much. */
+ if ((options & SEARCH_PEEK)
+ && ((lnum - pos->lnum) & 0x3f) == 0
+ && char_avail())
+ {
+ break_loop = TRUE;
+ break;
+ }
+#endif
+
+ if (loop && lnum == start_pos.lnum)
+ break; /* if second loop, stop where started */
+ }
+ at_first_line = FALSE;
+
+ /*
+ * Stop the search if wrapscan isn't set, after an interrupt,
+ * after a match and after looping twice.
+ */
+ if (!p_ws || got_int || called_emsg || break_loop || found || loop)
+ break;
+
+ /*
+ * If 'wrapscan' is set we continue at the other end of the file.
+ * If 'shortmess' does not contain 's', we give a message.
+ * This message is also remembered in keep_msg for when the screen
+ * is redrawn. The keep_msg is cleared whenever another message is
+ * written.
+ */
+ if (dir == BACKWARD) /* start second loop at the other end */
+ {
+ lnum = buf->b_ml.ml_line_count;
+ if (!shortmess(SHM_SEARCH) && (options & SEARCH_MSG))
+ give_warning((char_u *)_(top_bot_msg), TRUE);
+ }
+ else
+ {
+ lnum = 1;
+ if (!shortmess(SHM_SEARCH) && (options & SEARCH_MSG))
+ give_warning((char_u *)_(bot_top_msg), TRUE);
+ }
+ }
+ if (got_int || called_emsg || break_loop)
+ break;
+ }
+ while (--count > 0 && found); /* stop after count matches or no match */
+
+ vim_free(regmatch.regprog);
+
+ if (!found) /* did not find it */
+ {
+ if (got_int)
+ EMSG(_(e_interr));
+ else if ((options & SEARCH_MSG) == SEARCH_MSG)
+ {
+ if (p_ws)
+ EMSG2(_(e_patnotf2), mr_pattern);
+ else if (lnum == 0)
+ EMSG2(_("E384: search hit TOP without match for: %s"),
+ mr_pattern);
+ else
+ EMSG2(_("E385: search hit BOTTOM without match for: %s"),
+ mr_pattern);
+ }
+ return FAIL;
+ }
+
+ return submatch + 1;
+}
+
+#ifdef FEAT_EVAL
+/*
+ * Return the number of the first subpat that matched.
+ */
+ static int
+first_submatch(rp)
+ regmmatch_T *rp;
+{
+ int submatch;
+
+ for (submatch = 1; ; ++submatch)
+ {
+ if (rp->startpos[submatch].lnum >= 0)
+ break;
+ if (submatch == 9)
+ {
+ submatch = 0;
+ break;
+ }
+ }
+ return submatch;
+}
+#endif
+
+/*
+ * Highest level string search function.
+ * Search for the 'count'th occurence of pattern 'pat' in direction 'dirc'
+ * If 'dirc' is 0: use previous dir.
+ * If 'pat' is NULL or empty : use previous string.
+ * If 'options & SEARCH_REV' : go in reverse of previous dir.
+ * If 'options & SEARCH_ECHO': echo the search command and handle options
+ * If 'options & SEARCH_MSG' : may give error message
+ * If 'options & SEARCH_OPT' : interpret optional flags
+ * If 'options & SEARCH_HIS' : put search pattern in history
+ * If 'options & SEARCH_NOOF': don't add offset to position
+ * If 'options & SEARCH_MARK': set previous context mark
+ * If 'options & SEARCH_KEEP': keep previous search pattern
+ * If 'options & SEARCH_START': accept match at curpos itself
+ * If 'options & SEARCH_PEEK': check for typed char, cancel search
+ *
+ * Careful: If spats[0].off.line == TRUE and spats[0].off.off == 0 this
+ * makes the movement linewise without moving the match position.
+ *
+ * return 0 for failure, 1 for found, 2 for found and line offset added
+ */
+ int
+do_search(oap, dirc, pat, count, options)
+ oparg_T *oap; /* can be NULL */
+ int dirc; /* '/' or '?' */
+ char_u *pat;
+ long count;
+ int options;
+{
+ pos_T pos; /* position of the last match */
+ char_u *searchstr;
+ struct soffset old_off;
+ int retval; /* Return value */
+ char_u *p;
+ long c;
+ char_u *dircp;
+ char_u *strcopy = NULL;
+ char_u *ps;
+
+ /*
+ * A line offset is not remembered, this is vi compatible.
+ */
+ if (spats[0].off.line && vim_strchr(p_cpo, CPO_LINEOFF) != NULL)
+ {
+ spats[0].off.line = FALSE;
+ spats[0].off.off = 0;
+ }
+
+ /*
+ * Save the values for when (options & SEARCH_KEEP) is used.
+ * (there is no "if ()" around this because gcc wants them initialized)
+ */
+ old_off = spats[0].off;
+
+ pos = curwin->w_cursor; /* start searching at the cursor position */
+
+ /*
+ * Find out the direction of the search.
+ */
+ if (dirc == 0)
+ dirc = spats[0].off.dir;
+ else
+ spats[0].off.dir = dirc;
+ if (options & SEARCH_REV)
+ {
+#ifdef WIN32
+ /* There is a bug in the Visual C++ 2.2 compiler which means that
+ * dirc always ends up being '/' */
+ dirc = (dirc == '/') ? '?' : '/';
+#else
+ if (dirc == '/')
+ dirc = '?';
+ else
+ dirc = '/';
+#endif
+ }
+
+#ifdef FEAT_FOLDING
+ /* If the cursor is in a closed fold, don't find another match in the same
+ * fold. */
+ if (dirc == '/')
+ {
+ if (hasFolding(pos.lnum, NULL, &pos.lnum))
+ pos.col = MAXCOL - 2; /* avoid overflow when adding 1 */
+ }
+ else
+ {
+ if (hasFolding(pos.lnum, &pos.lnum, NULL))
+ pos.col = 0;
+ }
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+ /*
+ * Turn 'hlsearch' highlighting back on.
+ */
+ if (no_hlsearch && !(options & SEARCH_KEEP))
+ {
+ redraw_all_later(NOT_VALID);
+ no_hlsearch = FALSE;
+ }
+#endif
+
+ /*
+ * Repeat the search when pattern followed by ';', e.g. "/foo/;?bar".
+ */
+ for (;;)
+ {
+ searchstr = pat;
+ dircp = NULL;
+ /* use previous pattern */
+ if (pat == NULL || *pat == NUL || *pat == dirc)
+ {
+ if (spats[RE_SEARCH].pat == NULL) /* no previous pattern */
+ {
+ EMSG(_(e_noprevre));
+ retval = 0;
+ goto end_do_search;
+ }
+ /* make search_regcomp() use spats[RE_SEARCH].pat */
+ searchstr = (char_u *)"";
+ }
+
+ if (pat != NULL && *pat != NUL) /* look for (new) offset */
+ {
+ /*
+ * Find end of regular expression.
+ * If there is a matching '/' or '?', toss it.
+ */
+ ps = strcopy;
+ p = skip_regexp(pat, dirc, (int)p_magic, &strcopy);
+ if (strcopy != ps)
+ {
+ /* made a copy of "pat" to change "\?" to "?" */
+ searchcmdlen += STRLEN(pat) - STRLEN(strcopy);
+ pat = strcopy;
+ searchstr = strcopy;
+ }
+ if (*p == dirc)
+ {
+ dircp = p; /* remember where we put the NUL */
+ *p++ = NUL;
+ }
+ spats[0].off.line = FALSE;
+ spats[0].off.end = FALSE;
+ spats[0].off.off = 0;
+ /*
+ * Check for a line offset or a character offset.
+ * For get_address (echo off) we don't check for a character
+ * offset, because it is meaningless and the 's' could be a
+ * substitute command.
+ */
+ if (*p == '+' || *p == '-' || VIM_ISDIGIT(*p))
+ spats[0].off.line = TRUE;
+ else if ((options & SEARCH_OPT) &&
+ (*p == 'e' || *p == 's' || *p == 'b'))
+ {
+ if (*p == 'e') /* end */
+ spats[0].off.end = SEARCH_END;
+ ++p;
+ }
+ if (VIM_ISDIGIT(*p) || *p == '+' || *p == '-') /* got an offset */
+ {
+ /* 'nr' or '+nr' or '-nr' */
+ if (VIM_ISDIGIT(*p) || VIM_ISDIGIT(*(p + 1)))
+ spats[0].off.off = atol((char *)p);
+ else if (*p == '-') /* single '-' */
+ spats[0].off.off = -1;
+ else /* single '+' */
+ spats[0].off.off = 1;
+ ++p;
+ while (VIM_ISDIGIT(*p)) /* skip number */
+ ++p;
+ }
+
+ /* compute length of search command for get_address() */
+ searchcmdlen += (int)(p - pat);
+
+ pat = p; /* put pat after search command */
+ }
+
+ if ((options & SEARCH_ECHO) && messaging()
+ && !cmd_silent && msg_silent == 0)
+ {
+ char_u *msgbuf;
+ char_u *trunc;
+
+ if (*searchstr == NUL)
+ p = spats[last_idx].pat;
+ else
+ p = searchstr;
+ msgbuf = alloc((unsigned)(STRLEN(p) + 40));
+ if (msgbuf != NULL)
+ {
+ msgbuf[0] = dirc;
+ STRCPY(msgbuf + 1, p);
+ if (spats[0].off.line || spats[0].off.end || spats[0].off.off)
+ {
+ p = msgbuf + STRLEN(msgbuf);
+ *p++ = dirc;
+ if (spats[0].off.end)
+ *p++ = 'e';
+ else if (!spats[0].off.line)
+ *p++ = 's';
+ if (spats[0].off.off > 0 || spats[0].off.line)
+ *p++ = '+';
+ if (spats[0].off.off != 0 || spats[0].off.line)
+ sprintf((char *)p, "%ld", spats[0].off.off);
+ else
+ *p = NUL;
+ }
+
+ msg_start();
+ trunc = msg_strtrunc(msgbuf);
+
+#ifdef FEAT_RIGHTLEFT
+ /* The search pattern could be shown on the right in rightleft
+ * mode, but the 'ruler' and 'showcmd' area use it too, thus
+ * it would be blanked out again very soon. Show it on the
+ * left, but do reverse the text. */
+ if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
+ {
+ char_u *r;
+
+ r = reverse_text(trunc != NULL ? trunc : msgbuf);
+ if (r != NULL)
+ {
+ vim_free(trunc);
+ trunc = r;
+ }
+ }
+#endif
+ if (trunc != NULL)
+ {
+ msg_outtrans(trunc);
+ vim_free(trunc);
+ }
+ else
+ msg_outtrans(msgbuf);
+ msg_clr_eos();
+ msg_check();
+ vim_free(msgbuf);
+
+ gotocmdline(FALSE);
+ out_flush();
+ msg_nowait = TRUE; /* don't wait for this message */
+ }
+ }
+
+ /*
+ * If there is a character offset, subtract it from the current
+ * position, so we don't get stuck at "?pat?e+2" or "/pat/s-2".
+ * This is not done for a line offset, because then we would not be vi
+ * compatible.
+ */
+ if (!spats[0].off.line && spats[0].off.off)
+ {
+ if (spats[0].off.off > 0)
+ {
+ for (c = spats[0].off.off; c; --c)
+ if (decl(&pos) == -1)
+ break;
+ if (c) /* at start of buffer */
+ {
+ pos.lnum = 0; /* allow lnum == 0 here */
+ pos.col = MAXCOL;
+ }
+ }
+ else
+ {
+ for (c = spats[0].off.off; c; ++c)
+ if (incl(&pos) == -1)
+ break;
+ if (c) /* at end of buffer */
+ {
+ pos.lnum = curbuf->b_ml.ml_line_count + 1;
+ pos.col = 0;
+ }
+ }
+ }
+
+#ifdef FEAT_FKMAP /* when in Farsi mode, reverse the character flow */
+ if (p_altkeymap && curwin->w_p_rl)
+ lrFswap(searchstr,0);
+#endif
+
+ c = searchit(curwin, curbuf, &pos, dirc == '/' ? FORWARD : BACKWARD,
+ searchstr, count, spats[0].off.end + (options &
+ (SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS
+ + SEARCH_MSG + SEARCH_START
+ + ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF))),
+ RE_LAST);
+
+ if (dircp != NULL)
+ *dircp = dirc; /* restore second '/' or '?' for normal_cmd() */
+ if (c == FAIL)
+ {
+ retval = 0;
+ goto end_do_search;
+ }
+ if (spats[0].off.end && oap != NULL)
+ oap->inclusive = TRUE; /* 'e' includes last character */
+
+ retval = 1; /* pattern found */
+
+ /*
+ * Add character and/or line offset
+ */
+ if (!(options & SEARCH_NOOF) || *pat == ';')
+ {
+ if (spats[0].off.line) /* Add the offset to the line number. */
+ {
+ c = pos.lnum + spats[0].off.off;
+ if (c < 1)
+ pos.lnum = 1;
+ else if (c > curbuf->b_ml.ml_line_count)
+ pos.lnum = curbuf->b_ml.ml_line_count;
+ else
+ pos.lnum = c;
+ pos.col = 0;
+
+ retval = 2; /* pattern found, line offset added */
+ }
+ else
+ {
+ /* to the right, check for end of file */
+ if (spats[0].off.off > 0)
+ {
+ for (c = spats[0].off.off; c; --c)
+ if (incl(&pos) == -1)
+ break;
+ }
+ /* to the left, check for start of file */
+ else
+ {
+ if ((c = pos.col + spats[0].off.off) >= 0)
+ pos.col = c;
+ else
+ for (c = spats[0].off.off; c; ++c)
+ if (decl(&pos) == -1)
+ break;
+ }
+ }
+ }
+
+ /*
+ * The search command can be followed by a ';' to do another search.
+ * For example: "/pat/;/foo/+3;?bar"
+ * This is like doing another search command, except:
+ * - The remembered direction '/' or '?' is from the first search.
+ * - When an error happens the cursor isn't moved at all.
+ * Don't do this when called by get_address() (it handles ';' itself).
+ */
+ if (!(options & SEARCH_OPT) || pat == NULL || *pat != ';')
+ break;
+
+ dirc = *++pat;
+ if (dirc != '?' && dirc != '/')
+ {
+ retval = 0;
+ EMSG(_("E386: Expected '?' or '/' after ';'"));
+ goto end_do_search;
+ }
+ ++pat;
+ }
+
+ if (options & SEARCH_MARK)
+ setpcmark();
+ curwin->w_cursor = pos;
+ curwin->w_set_curswant = TRUE;
+
+end_do_search:
+ if (options & SEARCH_KEEP)
+ spats[0].off = old_off;
+ vim_free(strcopy);
+
+ return retval;
+}
+
+#if defined(FEAT_INS_EXPAND) || defined(PROTO)
+/*
+ * search_for_exact_line(buf, pos, dir, pat)
+ *
+ * Search for a line starting with the given pattern (ignoring leading
+ * white-space), starting from pos and going in direction dir. pos will
+ * contain the position of the match found. Blank lines match only if
+ * ADDING is set. if p_ic is set then the pattern must be in lowercase.
+ * Return OK for success, or FAIL if no line found.
+ */
+ int
+search_for_exact_line(buf, pos, dir, pat)
+ buf_T *buf;
+ pos_T *pos;
+ int dir;
+ char_u *pat;
+{
+ linenr_T start = 0;
+ char_u *ptr;
+ char_u *p;
+
+ if (buf->b_ml.ml_line_count == 0)
+ return FAIL;
+ for (;;)
+ {
+ pos->lnum += dir;
+ if (pos->lnum < 1)
+ {
+ if (p_ws)
+ {
+ pos->lnum = buf->b_ml.ml_line_count;
+ if (!shortmess(SHM_SEARCH))
+ give_warning((char_u *)_(top_bot_msg), TRUE);
+ }
+ else
+ {
+ pos->lnum = 1;
+ break;
+ }
+ }
+ else if (pos->lnum > buf->b_ml.ml_line_count)
+ {
+ if (p_ws)
+ {
+ pos->lnum = 1;
+ if (!shortmess(SHM_SEARCH))
+ give_warning((char_u *)_(bot_top_msg), TRUE);
+ }
+ else
+ {
+ pos->lnum = 1;
+ break;
+ }
+ }
+ if (pos->lnum == start)
+ break;
+ if (start == 0)
+ start = pos->lnum;
+ ptr = ml_get_buf(buf, pos->lnum, FALSE);
+ p = skipwhite(ptr);
+ pos->col = (colnr_T) (p - ptr);
+
+ /* when adding lines the matching line may be empty but it is not
+ * ignored because we are interested in the next line -- Acevedo */
+ if ((continue_status & CONT_ADDING) && !(continue_status & CONT_SOL))
+ {
+ if ((p_ic ? MB_STRICMP(p, pat) : STRCMP(p, pat)) == 0)
+ return OK;
+ }
+ else if (*p != NUL) /* ignore empty lines */
+ { /* expanding lines or words */
+ if ((p_ic ? MB_STRNICMP(p, pat, completion_length)
+ : STRNCMP(p, pat, completion_length)) == 0)
+ return OK;
+ }
+ }
+ return FAIL;
+}
+#endif /* FEAT_INS_EXPAND */
+
+/*
+ * Character Searches
+ */
+
+/*
+ * Search for a character in a line. If "t_cmd" is FALSE, move to the
+ * position of the character, otherwise move to just before the char.
+ * Do this "cap->count1" times.
+ * Return FAIL or OK.
+ */
+ int
+searchc(cap, t_cmd)
+ cmdarg_T *cap;
+ int t_cmd;
+{
+ int c = cap->nchar; /* char to search for */
+ int dir = cap->arg; /* TRUE for searching forward */
+ long count = cap->count1; /* repeat count */
+ static int lastc = NUL; /* last character searched for */
+ static int lastcdir; /* last direction of character search */
+ static int last_t_cmd; /* last search t_cmd */
+ int col;
+ char_u *p;
+ int len;
+#ifdef FEAT_MBYTE
+ static char_u bytes[MB_MAXBYTES];
+ static int bytelen = 1; /* >1 for multi-byte char */
+#endif
+
+ if (c != NUL) /* normal search: remember args for repeat */
+ {
+ if (!KeyStuffed) /* don't remember when redoing */
+ {
+ lastc = c;
+ lastcdir = dir;
+ last_t_cmd = t_cmd;
+#ifdef FEAT_MBYTE
+ bytelen = (*mb_char2bytes)(c, bytes);
+ if (cap->ncharC1 != 0)
+ {
+ bytelen += (*mb_char2bytes)(cap->ncharC1, bytes + bytelen);
+ if (cap->ncharC2 != 0)
+ bytelen += (*mb_char2bytes)(cap->ncharC2, bytes + bytelen);
+ }
+#endif
+ }
+ }
+ else /* repeat previous search */
+ {
+ if (lastc == NUL)
+ return FAIL;
+ if (dir) /* repeat in opposite direction */
+ dir = -lastcdir;
+ else
+ dir = lastcdir;
+ t_cmd = last_t_cmd;
+ c = lastc;
+ /* For multi-byte re-use last bytes[] and bytelen. */
+ }
+
+ p = ml_get_curline();
+ col = curwin->w_cursor.col;
+ len = (int)STRLEN(p);
+
+ while (count--)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ for (;;)
+ {
+ if (dir > 0)
+ {
+ col += (*mb_ptr2len_check)(p + col);
+ if (col >= len)
+ return FAIL;
+ }
+ else
+ {
+ if (col == 0)
+ return FAIL;
+ col -= (*mb_head_off)(p, p + col - 1) + 1;
+ }
+ if (bytelen == 1)
+ {
+ if (p[col] == c)
+ break;
+ }
+ else
+ {
+ if (vim_memcmp(p + col, bytes, bytelen) == 0)
+ break;
+ }
+ }
+ }
+ else
+#endif
+ {
+ for (;;)
+ {
+ if ((col += dir) < 0 || col >= len)
+ return FAIL;
+ if (p[col] == c)
+ break;
+ }
+ }
+ }
+
+ if (t_cmd)
+ {
+ /* backup to before the character (possibly double-byte) */
+ col -= dir;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ if (dir < 0)
+ /* Landed on the search char which is bytelen long */
+ col += bytelen - 1;
+ else
+ /* To previous char, which may be multi-byte. */
+ col -= (*mb_head_off)(p, p + col);
+ }
+#endif
+ }
+ curwin->w_cursor.col = col;
+
+ return OK;
+}
+
+/*
+ * "Other" Searches
+ */
+
+/*
+ * findmatch - find the matching paren or brace
+ *
+ * Improvement over vi: Braces inside quotes are ignored.
+ */
+ pos_T *
+findmatch(oap, initc)
+ oparg_T *oap;
+ int initc;
+{
+ return findmatchlimit(oap, initc, 0, 0);
+}
+
+/*
+ * Return TRUE if the character before "linep[col]" equals "ch".
+ * Return FALSE if "col" is zero.
+ * Update "*prevcol" to the column of the previous character, unless "prevcol"
+ * is NULL.
+ * Handles multibyte string correctly.
+ */
+ static int
+check_prevcol(linep, col, ch, prevcol)
+ char_u *linep;
+ int col;
+ int ch;
+ int *prevcol;
+{
+ --col;
+#ifdef FEAT_MBYTE
+ if (col > 0 && has_mbyte)
+ col -= (*mb_head_off)(linep, linep + col);
+#endif
+ if (prevcol)
+ *prevcol = col;
+ return (col >= 0 && linep[col] == ch) ? TRUE : FALSE;
+}
+
+/*
+ * findmatchlimit -- find the matching paren or brace, if it exists within
+ * maxtravel lines of here. A maxtravel of 0 means search until falling off
+ * the edge of the file.
+ *
+ * "initc" is the character to find a match for. NUL means to find the
+ * character at or after the cursor.
+ *
+ * flags: FM_BACKWARD search backwards (when initc is '/', '*' or '#')
+ * FM_FORWARD search forwards (when initc is '/', '*' or '#')
+ * FM_BLOCKSTOP stop at start/end of block ({ or } in column 0)
+ * FM_SKIPCOMM skip comments (not implemented yet!)
+ */
+
+ pos_T *
+findmatchlimit(oap, initc, flags, maxtravel)
+ oparg_T *oap;
+ int initc;
+ int flags;
+ int maxtravel;
+{
+ static pos_T pos; /* current search position */
+ int findc = 0; /* matching brace */
+ int c;
+ int count = 0; /* cumulative number of braces */
+ int backwards = FALSE; /* init for gcc */
+ int inquote = FALSE; /* TRUE when inside quotes */
+ char_u *linep; /* pointer to current line */
+ char_u *ptr;
+ int do_quotes; /* check for quotes in current line */
+ int at_start; /* do_quotes value at start position */
+ int hash_dir = 0; /* Direction searched for # things */
+ int comment_dir = 0; /* Direction searched for comments */
+ pos_T match_pos; /* Where last slash-star was found */
+ int start_in_quotes; /* start position is in quotes */
+ int traveled = 0; /* how far we've searched so far */
+ int ignore_cend = FALSE; /* ignore comment end */
+ int cpo_match; /* vi compatible matching */
+ int cpo_bsl; /* don't recognize backslashes */
+ int match_escaped = 0; /* search for escaped match */
+ int dir; /* Direction to search */
+ int comment_col = MAXCOL; /* start of / / comment */
+
+ pos = curwin->w_cursor;
+ linep = ml_get(pos.lnum);
+
+ cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL);
+ cpo_bsl = (vim_strchr(p_cpo, CPO_MATCHBSL) != NULL);
+
+ /* Direction to search when initc is '/', '*' or '#' */
+ if (flags & FM_BACKWARD)
+ dir = BACKWARD;
+ else if (flags & FM_FORWARD)
+ dir = FORWARD;
+ else
+ dir = 0;
+
+ /*
+ * if initc given, look in the table for the matching character
+ * '/' and '*' are special cases: look for start or end of comment.
+ * When '/' is used, we ignore running backwards into an star-slash, for
+ * "[*" command, we just want to find any comment.
+ */
+ if (initc == '/' || initc == '*')
+ {
+ comment_dir = dir;
+ if (initc == '/')
+ ignore_cend = TRUE;
+ backwards = (dir == FORWARD) ? FALSE : TRUE;
+ initc = NUL;
+ }
+ else if (initc != '#' && initc != NUL)
+ {
+ /* 'matchpairs' is "x:y,x:y" */
+ for (ptr = curbuf->b_p_mps; *ptr; ptr += 2)
+ {
+ if (*ptr == initc)
+ {
+ findc = initc;
+ initc = ptr[2];
+ backwards = TRUE;
+ break;
+ }
+ ptr += 2;
+ if (*ptr == initc)
+ {
+ findc = initc;
+ initc = ptr[-2];
+ backwards = FALSE;
+ break;
+ }
+ if (ptr[1] != ',')
+ break;
+ }
+ if (!findc) /* invalid initc! */
+ return NULL;
+ }
+ /*
+ * Either initc is '#', or no initc was given and we need to look under the
+ * cursor.
+ */
+ else
+ {
+ if (initc == '#')
+ {
+ hash_dir = dir;
+ }
+ else
+ {
+ /*
+ * initc was not given, must look for something to match under
+ * or near the cursor.
+ * Only check for special things when 'cpo' doesn't have '%'.
+ */
+ if (!cpo_match)
+ {
+ /* Are we before or at #if, #else etc.? */
+ ptr = skipwhite(linep);
+ if (*ptr == '#' && pos.col <= (colnr_T)(ptr - linep))
+ {
+ ptr = skipwhite(ptr + 1);
+ if ( STRNCMP(ptr, "if", 2) == 0
+ || STRNCMP(ptr, "endif", 5) == 0
+ || STRNCMP(ptr, "el", 2) == 0)
+ hash_dir = 1;
+ }
+
+ /* Are we on a comment? */
+ else if (linep[pos.col] == '/')
+ {
+ if (linep[pos.col + 1] == '*')
+ {
+ comment_dir = FORWARD;
+ backwards = FALSE;
+ pos.col++;
+ }
+ else if (pos.col > 0 && linep[pos.col - 1] == '*')
+ {
+ comment_dir = BACKWARD;
+ backwards = TRUE;
+ pos.col--;
+ }
+ }
+ else if (linep[pos.col] == '*')
+ {
+ if (linep[pos.col + 1] == '/')
+ {
+ comment_dir = BACKWARD;
+ backwards = TRUE;
+ }
+ else if (pos.col > 0 && linep[pos.col - 1] == '/')
+ {
+ comment_dir = FORWARD;
+ backwards = FALSE;
+ }
+ }
+ }
+
+ /*
+ * If we are not on a comment or the # at the start of a line, then
+ * look for brace anywhere on this line after the cursor.
+ */
+ if (!hash_dir && !comment_dir)
+ {
+ /*
+ * Find the brace under or after the cursor.
+ * If beyond the end of the line, use the last character in
+ * the line.
+ */
+ if (linep[pos.col] == NUL && pos.col)
+ --pos.col;
+ for (;;)
+ {
+ initc = linep[pos.col];
+ if (initc == NUL)
+ break;
+
+ for (ptr = curbuf->b_p_mps; *ptr; ++ptr)
+ {
+ if (*ptr == initc)
+ {
+ findc = ptr[2];
+ backwards = FALSE;
+ break;
+ }
+ ptr += 2;
+ if (*ptr == initc)
+ {
+ findc = ptr[-2];
+ backwards = TRUE;
+ break;
+ }
+ if (!*++ptr)
+ break;
+ }
+ if (findc)
+ break;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ pos.col += (*mb_ptr2len_check)(linep + pos.col);
+ else
+#endif
+ ++pos.col;
+ }
+ if (!findc)
+ {
+ /* no brace in the line, maybe use " #if" then */
+ if (!cpo_match && *skipwhite(linep) == '#')
+ hash_dir = 1;
+ else
+ return NULL;
+ }
+ else if (!cpo_bsl)
+ {
+ int col, bslcnt = 0;
+
+ /* Set "match_escaped" if there are an odd number of
+ * backslashes. */
+ for (col = pos.col; check_prevcol(linep, col, '\\', &col);)
+ bslcnt++;
+ match_escaped = (bslcnt & 1);
+ }
+ }
+ }
+ if (hash_dir)
+ {
+ /*
+ * Look for matching #if, #else, #elif, or #endif
+ */
+ if (oap != NULL)
+ oap->motion_type = MLINE; /* Linewise for this case only */
+ if (initc != '#')
+ {
+ ptr = skipwhite(skipwhite(linep) + 1);
+ if (STRNCMP(ptr, "if", 2) == 0 || STRNCMP(ptr, "el", 2) == 0)
+ hash_dir = 1;
+ else if (STRNCMP(ptr, "endif", 5) == 0)
+ hash_dir = -1;
+ else
+ return NULL;
+ }
+ pos.col = 0;
+ while (!got_int)
+ {
+ if (hash_dir > 0)
+ {
+ if (pos.lnum == curbuf->b_ml.ml_line_count)
+ break;
+ }
+ else if (pos.lnum == 1)
+ break;
+ pos.lnum += hash_dir;
+ linep = ml_get(pos.lnum);
+ line_breakcheck(); /* check for CTRL-C typed */
+ ptr = skipwhite(linep);
+ if (*ptr != '#')
+ continue;
+ pos.col = (colnr_T) (ptr - linep);
+ ptr = skipwhite(ptr + 1);
+ if (hash_dir > 0)
+ {
+ if (STRNCMP(ptr, "if", 2) == 0)
+ count++;
+ else if (STRNCMP(ptr, "el", 2) == 0)
+ {
+ if (count == 0)
+ return &pos;
+ }
+ else if (STRNCMP(ptr, "endif", 5) == 0)
+ {
+ if (count == 0)
+ return &pos;
+ count--;
+ }
+ }
+ else
+ {
+ if (STRNCMP(ptr, "if", 2) == 0)
+ {
+ if (count == 0)
+ return &pos;
+ count--;
+ }
+ else if (initc == '#' && STRNCMP(ptr, "el", 2) == 0)
+ {
+ if (count == 0)
+ return &pos;
+ }
+ else if (STRNCMP(ptr, "endif", 5) == 0)
+ count++;
+ }
+ }
+ return NULL;
+ }
+ }
+
+#ifdef FEAT_RIGHTLEFT
+ /* This is just guessing: when 'rightleft' is set, search for a maching
+ * paren/brace in the other direction. */
+ if (curwin->w_p_rl && vim_strchr((char_u *)"()[]{}<>", initc) != NULL)
+ backwards = !backwards;
+#endif
+
+ do_quotes = -1;
+ start_in_quotes = MAYBE;
+ /* backward search: Check if this line contains a single-line comment */
+ if (backwards && comment_dir)
+ comment_col = check_linecomment(linep);
+ while (!got_int)
+ {
+ /*
+ * Go to the next position, forward or backward. We could use
+ * inc() and dec() here, but that is much slower
+ */
+ if (backwards)
+ {
+ if (pos.col == 0) /* at start of line, go to prev. one */
+ {
+ if (pos.lnum == 1) /* start of file */
+ break;
+ --pos.lnum;
+
+ if (maxtravel && traveled++ > maxtravel)
+ break;
+
+ linep = ml_get(pos.lnum);
+ pos.col = (colnr_T)STRLEN(linep); /* pos.col on trailing NUL */
+ do_quotes = -1;
+ line_breakcheck();
+
+ /* Check if this line contains a single-line comment */
+ if (comment_dir)
+ comment_col = check_linecomment(linep);
+ }
+ else
+ {
+ --pos.col;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ pos.col -= (*mb_head_off)(linep, linep + pos.col);
+#endif
+ }
+ }
+ else /* forward search */
+ {
+ if (linep[pos.col] == NUL) /* at end of line, go to next one */
+ {
+ if (pos.lnum == curbuf->b_ml.ml_line_count) /* end of file */
+ break;
+ ++pos.lnum;
+
+ if (maxtravel && traveled++ > maxtravel)
+ break;
+
+ linep = ml_get(pos.lnum);
+ pos.col = 0;
+ do_quotes = -1;
+ line_breakcheck();
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ pos.col += (*mb_ptr2len_check)(linep + pos.col);
+ else
+#endif
+ ++pos.col;
+ }
+ }
+
+ /*
+ * If FM_BLOCKSTOP given, stop at a '{' or '}' in column 0.
+ */
+ if (pos.col == 0 && (flags & FM_BLOCKSTOP) &&
+ (linep[0] == '{' || linep[0] == '}'))
+ {
+ if (linep[0] == findc && count == 0) /* match! */
+ return &pos;
+ break; /* out of scope */
+ }
+
+ if (comment_dir)
+ {
+ /* Note: comments do not nest, and we ignore quotes in them */
+ /* TODO: ignore comment brackets inside strings */
+ if (comment_dir == FORWARD)
+ {
+ if (linep[pos.col] == '*' && linep[pos.col + 1] == '/')
+ {
+ pos.col++;
+ return &pos;
+ }
+ }
+ else /* Searching backwards */
+ {
+ /*
+ * A comment may contain / * or / /, it may also start or end
+ * with / * /. Ignore a / * after / /.
+ */
+ if (pos.col == 0)
+ continue;
+ else if ( linep[pos.col - 1] == '/'
+ && linep[pos.col] == '*'
+ && (int)pos.col < comment_col)
+ {
+ count++;
+ match_pos = pos;
+ match_pos.col--;
+ }
+ else if (linep[pos.col - 1] == '*' && linep[pos.col] == '/')
+ {
+ if (count > 0)
+ pos = match_pos;
+ else if (pos.col > 1 && linep[pos.col - 2] == '/'
+ && (int)pos.col <= comment_col)
+ pos.col -= 2;
+ else if (ignore_cend)
+ continue;
+ else
+ return NULL;
+ return &pos;
+ }
+ }
+ continue;
+ }
+
+ /*
+ * If smart matching ('cpoptions' does not contain '%'), braces inside
+ * of quotes are ignored, but only if there is an even number of
+ * quotes in the line.
+ */
+ if (cpo_match)
+ do_quotes = 0;
+ else if (do_quotes == -1)
+ {
+ /*
+ * Count the number of quotes in the line, skipping \" and '"'.
+ * Watch out for "\\".
+ */
+ at_start = do_quotes;
+ for (ptr = linep; *ptr; ++ptr)
+ {
+ if (ptr == linep + pos.col + backwards)
+ at_start = (do_quotes & 1);
+ if (*ptr == '"'
+ && (ptr == linep || ptr[-1] != '\'' || ptr[1] != '\''))
+ ++do_quotes;
+ if (*ptr == '\\' && ptr[1] != NUL)
+ ++ptr;
+ }
+ do_quotes &= 1; /* result is 1 with even number of quotes */
+
+ /*
+ * If we find an uneven count, check current line and previous
+ * one for a '\' at the end.
+ */
+ if (!do_quotes)
+ {
+ inquote = FALSE;
+ if (ptr[-1] == '\\')
+ {
+ do_quotes = 1;
+ if (start_in_quotes == MAYBE)
+ {
+ /* Do we need to use at_start here? */
+ inquote = TRUE;
+ start_in_quotes = TRUE;
+ }
+ else if (backwards)
+ inquote = TRUE;
+ }
+ if (pos.lnum > 1)
+ {
+ ptr = ml_get(pos.lnum - 1);
+ if (*ptr && *(ptr + STRLEN(ptr) - 1) == '\\')
+ {
+ do_quotes = 1;
+ if (start_in_quotes == MAYBE)
+ {
+ inquote = at_start;
+ if (inquote)
+ start_in_quotes = TRUE;
+ }
+ else if (!backwards)
+ inquote = TRUE;
+ }
+ }
+ }
+ }
+ if (start_in_quotes == MAYBE)
+ start_in_quotes = FALSE;
+
+ /*
+ * If 'smartmatch' is set:
+ * Things inside quotes are ignored by setting 'inquote'. If we
+ * find a quote without a preceding '\' invert 'inquote'. At the
+ * end of a line not ending in '\' we reset 'inquote'.
+ *
+ * In lines with an uneven number of quotes (without preceding '\')
+ * we do not know which part to ignore. Therefore we only set
+ * inquote if the number of quotes in a line is even, unless this
+ * line or the previous one ends in a '\'. Complicated, isn't it?
+ */
+ switch (c = linep[pos.col])
+ {
+ case NUL:
+ /* at end of line without trailing backslash, reset inquote */
+ if (pos.col == 0 || linep[pos.col - 1] != '\\')
+ {
+ inquote = FALSE;
+ start_in_quotes = FALSE;
+ }
+ break;
+
+ case '"':
+ /* a quote that is preceded with an odd number of backslashes is
+ * ignored */
+ if (do_quotes)
+ {
+ int col;
+
+ for (col = pos.col - 1; col >= 0; --col)
+ if (linep[col] != '\\')
+ break;
+ if ((((int)pos.col - 1 - col) & 1) == 0)
+ {
+ inquote = !inquote;
+ start_in_quotes = FALSE;
+ }
+ }
+ break;
+
+ /*
+ * If smart matching ('cpoptions' does not contain '%'):
+ * Skip things in single quotes: 'x' or '\x'. Be careful for single
+ * single quotes, eg jon's. Things like '\233' or '\x3f' are not
+ * skipped, there is never a brace in them.
+ * Ignore this when finding matches for `'.
+ */
+ case '\'':
+ if (!cpo_match && initc != '\'' && findc != '\'')
+ {
+ if (backwards)
+ {
+ if (pos.col > 1)
+ {
+ if (linep[pos.col - 2] == '\'')
+ {
+ pos.col -= 2;
+ break;
+ }
+ else if (linep[pos.col - 2] == '\\' &&
+ pos.col > 2 && linep[pos.col - 3] == '\'')
+ {
+ pos.col -= 3;
+ break;
+ }
+ }
+ }
+ else if (linep[pos.col + 1]) /* forward search */
+ {
+ if (linep[pos.col + 1] == '\\' &&
+ linep[pos.col + 2] && linep[pos.col + 3] == '\'')
+ {
+ pos.col += 3;
+ break;
+ }
+ else if (linep[pos.col + 2] == '\'')
+ {
+ pos.col += 2;
+ break;
+ }
+ }
+ }
+ /* FALLTHROUGH */
+
+ default:
+#ifdef FEAT_LISP
+ /* For Lisp skip over backslashed (), {} and []. */
+ if (curbuf->b_p_lisp
+ && vim_strchr((char_u *)"(){}[]", c) != NULL
+ && pos.col > 0
+ && check_prevcol(linep, pos.col, '\\', NULL))
+ break;
+#endif
+
+ /* Check for match outside of quotes, and inside of
+ * quotes when the start is also inside of quotes. */
+ if ((!inquote || start_in_quotes == TRUE)
+ && (c == initc || c == findc))
+ {
+ int col, bslcnt = 0;
+
+ if (!cpo_bsl)
+ {
+ for (col = pos.col; check_prevcol(linep, col, '\\', &col);)
+ bslcnt++;
+ }
+ /* Only accept a match when 'M' is in 'cpo' or when ecaping is
+ * what we expect. */
+ if (cpo_bsl || (bslcnt & 1) == match_escaped)
+ {
+ if (c == initc)
+ count++;
+ else
+ {
+ if (count == 0)
+ return &pos;
+ count--;
+ }
+ }
+ }
+ }
+ }
+
+ if (comment_dir == BACKWARD && count > 0)
+ {
+ pos = match_pos;
+ return &pos;
+ }
+ return (pos_T *)NULL; /* never found it */
+}
+
+/*
+ * Check if line[] contains a / / comment.
+ * Return MAXCOL if not, otherwise return the column.
+ * TODO: skip strings.
+ */
+ static int
+check_linecomment(line)
+ char_u *line;
+{
+ char_u *p;
+
+ p = line;
+ while ((p = vim_strchr(p, '/')) != NULL)
+ {
+ if (p[1] == '/')
+ break;
+ ++p;
+ }
+
+ if (p == NULL)
+ return MAXCOL;
+ return (int)(p - line);
+}
+
+/*
+ * Move cursor briefly to character matching the one under the cursor.
+ * Used for Insert mode and "r" command.
+ * Show the match only if it is visible on the screen.
+ * If there isn't a match, then beep.
+ */
+ void
+showmatch(c)
+ int c; /* char to show match for */
+{
+ pos_T *lpos, save_cursor;
+ pos_T mpos;
+ colnr_T vcol;
+ long save_so;
+ long save_siso;
+#ifdef CURSOR_SHAPE
+ int save_state;
+#endif
+ colnr_T save_dollar_vcol;
+ char_u *p;
+
+ /*
+ * Only show match for chars in the 'matchpairs' option.
+ */
+ /* 'matchpairs' is "x:y,x:y" */
+ for (p = curbuf->b_p_mps; *p != NUL; p += 2)
+ {
+#ifdef FEAT_RIGHTLEFT
+ if (*p == c && (curwin->w_p_rl ^ p_ri))
+ break;
+#endif
+ p += 2;
+ if (*p == c
+#ifdef FEAT_RIGHTLEFT
+ && !(curwin->w_p_rl ^ p_ri)
+#endif
+ )
+ break;
+ if (p[1] != ',')
+ return;
+ }
+
+ if ((lpos = findmatch(NULL, NUL)) == NULL) /* no match, so beep */
+ vim_beep();
+ else if (lpos->lnum >= curwin->w_topline)
+ {
+ if (!curwin->w_p_wrap)
+ getvcol(curwin, lpos, NULL, &vcol, NULL);
+ if (curwin->w_p_wrap || (vcol >= curwin->w_leftcol
+ && vcol < curwin->w_leftcol + W_WIDTH(curwin)))
+ {
+ mpos = *lpos; /* save the pos, update_screen() may change it */
+ save_cursor = curwin->w_cursor;
+ save_so = p_so;
+ save_siso = p_siso;
+ /* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
+ * stop displaying the "$". */
+ if (dollar_vcol > 0 && dollar_vcol == curwin->w_virtcol)
+ dollar_vcol = 0;
+ ++curwin->w_virtcol; /* do display ')' just before "$" */
+ update_screen(VALID); /* show the new char first */
+
+ save_dollar_vcol = dollar_vcol;
+#ifdef CURSOR_SHAPE
+ save_state = State;
+ State = SHOWMATCH;
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+ curwin->w_cursor = mpos; /* move to matching char */
+ p_so = 0; /* don't use 'scrolloff' here */
+ p_siso = 0; /* don't use 'sidescrolloff' here */
+ showruler(FALSE);
+ setcursor();
+ cursor_on(); /* make sure that the cursor is shown */
+ out_flush();
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_update_cursor(TRUE, FALSE);
+ gui_mch_flush();
+ }
+#endif
+ /* Restore dollar_vcol(), because setcursor() may call curs_rows()
+ * which resets it if the matching position is in a previous line
+ * and has a higher column number. */
+ dollar_vcol = save_dollar_vcol;
+
+ /*
+ * brief pause, unless 'm' is present in 'cpo' and a character is
+ * available.
+ */
+ if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL)
+ ui_delay(p_mat * 100L, TRUE);
+ else if (!char_avail())
+ ui_delay(p_mat * 100L, FALSE);
+ curwin->w_cursor = save_cursor; /* restore cursor position */
+ p_so = save_so;
+ p_siso = save_siso;
+#ifdef CURSOR_SHAPE
+ State = save_state;
+ ui_cursor_shape(); /* may show different cursor shape */
+#endif
+ }
+ }
+}
+
+/*
+ * findsent(dir, count) - Find the start of the next sentence in direction
+ * 'dir' Sentences are supposed to end in ".", "!" or "?" followed by white
+ * space or a line break. Also stop at an empty line.
+ * Return OK if the next sentence was found.
+ */
+ int
+findsent(dir, count)
+ int dir;
+ long count;
+{
+ pos_T pos, tpos;
+ int c;
+ int (*func) __ARGS((pos_T *));
+ int startlnum;
+ int noskip = FALSE; /* do not skip blanks */
+ int cpo_J;
+
+ pos = curwin->w_cursor;
+ if (dir == FORWARD)
+ func = incl;
+ else
+ func = decl;
+
+ while (count--)
+ {
+ /*
+ * if on an empty line, skip upto a non-empty line
+ */
+ if (gchar_pos(&pos) == NUL)
+ {
+ do
+ if ((*func)(&pos) == -1)
+ break;
+ while (gchar_pos(&pos) == NUL);
+ if (dir == FORWARD)
+ goto found;
+ }
+ /*
+ * if on the start of a paragraph or a section and searching forward,
+ * go to the next line
+ */
+ else if (dir == FORWARD && pos.col == 0 &&
+ startPS(pos.lnum, NUL, FALSE))
+ {
+ if (pos.lnum == curbuf->b_ml.ml_line_count)
+ return FAIL;
+ ++pos.lnum;
+ goto found;
+ }
+ else if (dir == BACKWARD)
+ decl(&pos);
+
+ /* go back to the previous non-blank char */
+ while ((c = gchar_pos(&pos)) == ' ' || c == '\t' ||
+ (dir == BACKWARD && vim_strchr((char_u *)".!?)]\"'", c) != NULL))
+ {
+ if (decl(&pos) == -1)
+ break;
+ /* when going forward: Stop in front of empty line */
+ if (lineempty(pos.lnum) && dir == FORWARD)
+ {
+ incl(&pos);
+ goto found;
+ }
+ }
+
+ /* remember the line where the search started */
+ startlnum = pos.lnum;
+ cpo_J = vim_strchr(p_cpo, CPO_ENDOFSENT) != NULL;
+
+ for (;;) /* find end of sentence */
+ {
+ c = gchar_pos(&pos);
+ if (c == NUL || (pos.col == 0 && startPS(pos.lnum, NUL, FALSE)))
+ {
+ if (dir == BACKWARD && pos.lnum != startlnum)
+ ++pos.lnum;
+ break;
+ }
+ if (c == '.' || c == '!' || c == '?')
+ {
+ tpos = pos;
+ do
+ if ((c = inc(&tpos)) == -1)
+ break;
+ while (vim_strchr((char_u *)")]\"'", c = gchar_pos(&tpos))
+ != NULL);
+ if (c == -1 || (!cpo_J && (c == ' ' || c == '\t')) || c == NUL
+ || (cpo_J && (c == ' ' && inc(&tpos) >= 0
+ && gchar_pos(&tpos) == ' ')))
+ {
+ pos = tpos;
+ if (gchar_pos(&pos) == NUL) /* skip NUL at EOL */
+ inc(&pos);
+ break;
+ }
+ }
+ if ((*func)(&pos) == -1)
+ {
+ if (count)
+ return FAIL;
+ noskip = TRUE;
+ break;
+ }
+ }
+found:
+ /* skip white space */
+ while (!noskip && ((c = gchar_pos(&pos)) == ' ' || c == '\t'))
+ if (incl(&pos) == -1)
+ break;
+ }
+
+ setpcmark();
+ curwin->w_cursor = pos;
+ return OK;
+}
+
+/*
+ * findpar(dir, count, what) - Find the next paragraph in direction 'dir'
+ * Paragraphs are currently supposed to be separated by empty lines.
+ * Return TRUE if the next paragraph was found.
+ * If 'what' is '{' or '}' we go to the next section.
+ * If 'both' is TRUE also stop at '}'.
+ */
+ int
+findpar(oap, dir, count, what, both)
+ oparg_T *oap;
+ int dir;
+ long count;
+ int what;
+ int both;
+{
+ linenr_T curr;
+ int did_skip; /* TRUE after separating lines have been skipped */
+ int first; /* TRUE on first line */
+#ifdef FEAT_FOLDING
+ linenr_T fold_first; /* first line of a closed fold */
+ linenr_T fold_last; /* last line of a closed fold */
+ int fold_skipped; /* TRUE if a closed fold was skipped this
+ iteration */
+#endif
+
+ curr = curwin->w_cursor.lnum;
+
+ while (count--)
+ {
+ did_skip = FALSE;
+ for (first = TRUE; ; first = FALSE)
+ {
+ if (*ml_get(curr) != NUL)
+ did_skip = TRUE;
+
+#ifdef FEAT_FOLDING
+ /* skip folded lines */
+ fold_skipped = FALSE;
+ if (first && hasFolding(curr, &fold_first, &fold_last))
+ {
+ curr = ((dir > 0) ? fold_last : fold_first) + dir;
+ fold_skipped = TRUE;
+ }
+#endif
+
+ if (!first && did_skip && startPS(curr, what, both))
+ break;
+
+#ifdef FEAT_FOLDING
+ if (fold_skipped)
+ curr -= dir;
+#endif
+ if ((curr += dir) < 1 || curr > curbuf->b_ml.ml_line_count)
+ {
+ if (count)
+ return FALSE;
+ curr -= dir;
+ break;
+ }
+ }
+ }
+ setpcmark();
+ if (both && *ml_get(curr) == '}') /* include line with '}' */
+ ++curr;
+ curwin->w_cursor.lnum = curr;
+ if (curr == curbuf->b_ml.ml_line_count && what != '}')
+ {
+ if ((curwin->w_cursor.col = (colnr_T)STRLEN(ml_get(curr))) != 0)
+ {
+ --curwin->w_cursor.col;
+ oap->inclusive = TRUE;
+ }
+ }
+ else
+ curwin->w_cursor.col = 0;
+ return TRUE;
+}
+
+/*
+ * check if the string 's' is a nroff macro that is in option 'opt'
+ */
+ static int
+inmacro(opt, s)
+ char_u *opt;
+ char_u *s;
+{
+ char_u *macro;
+
+ for (macro = opt; macro[0]; ++macro)
+ {
+ /* Accept two characters in the option being equal to two characters
+ * in the line. A space in the option matches with a space in the
+ * line or the line having ended. */
+ if ( (macro[0] == s[0]
+ || (macro[0] == ' '
+ && (s[0] == NUL || s[0] == ' ')))
+ && (macro[1] == s[1]
+ || ((macro[1] == NUL || macro[1] == ' ')
+ && (s[0] == NUL || s[1] == NUL || s[1] == ' '))))
+ break;
+ ++macro;
+ if (macro[0] == NUL)
+ break;
+ }
+ return (macro[0] != NUL);
+}
+
+/*
+ * startPS: return TRUE if line 'lnum' is the start of a section or paragraph.
+ * If 'para' is '{' or '}' only check for sections.
+ * If 'both' is TRUE also stop at '}'
+ */
+ int
+startPS(lnum, para, both)
+ linenr_T lnum;
+ int para;
+ int both;
+{
+ char_u *s;
+
+ s = ml_get(lnum);
+ if (*s == para || *s == '\f' || (both && *s == '}'))
+ return TRUE;
+ if (*s == '.' && (inmacro(p_sections, s + 1) ||
+ (!para && inmacro(p_para, s + 1))))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * The following routines do the word searches performed by the 'w', 'W',
+ * 'b', 'B', 'e', and 'E' commands.
+ */
+
+/*
+ * To perform these searches, characters are placed into one of three
+ * classes, and transitions between classes determine word boundaries.
+ *
+ * The classes are:
+ *
+ * 0 - white space
+ * 1 - punctuation
+ * 2 or higher - keyword characters (letters, digits and underscore)
+ */
+
+static int cls_bigword; /* TRUE for "W", "B" or "E" */
+
+/*
+ * cls() - returns the class of character at curwin->w_cursor
+ *
+ * If a 'W', 'B', or 'E' motion is being done (cls_bigword == TRUE), chars
+ * from class 2 and higher are reported as class 1 since only white space
+ * boundaries are of interest.
+ */
+ static int
+cls()
+{
+ int c;
+
+ c = gchar_cursor();
+#ifdef FEAT_FKMAP /* when 'akm' (Farsi mode), take care of Farsi blank */
+ if (p_altkeymap && c == F_BLANK)
+ return 0;
+#endif
+ if (c == ' ' || c == '\t' || c == NUL)
+ return 0;
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && c > 0xFF)
+ {
+ /* If cls_bigword, report multi-byte chars as class 1. */
+ if (enc_dbcs == DBCS_KOR && cls_bigword)
+ return 1;
+
+ /* process code leading/trailing bytes */
+ return dbcs_class(((unsigned)c >> 8), (c & 0xFF));
+ }
+ if (enc_utf8)
+ {
+ c = utf_class(c);
+ if (c != 0 && cls_bigword)
+ return 1;
+ return c;
+ }
+#endif
+
+ /* If cls_bigword is TRUE, report all non-blanks as class 1. */
+ if (cls_bigword)
+ return 1;
+
+ if (vim_iswordc(c))
+ return 2;
+ return 1;
+}
+
+
+/*
+ * fwd_word(count, type, eol) - move forward one word
+ *
+ * Returns FAIL if the cursor was already at the end of the file.
+ * If eol is TRUE, last word stops at end of line (for operators).
+ */
+ int
+fwd_word(count, bigword, eol)
+ long count;
+ int bigword; /* "W", "E" or "B" */
+ int eol;
+{
+ int sclass; /* starting class */
+ int i;
+ int last_line;
+
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ cls_bigword = bigword;
+ while (--count >= 0)
+ {
+#ifdef FEAT_FOLDING
+ /* When inside a range of folded lines, move to the last char of the
+ * last line. */
+ if (hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum))
+ coladvance((colnr_T)MAXCOL);
+#endif
+ sclass = cls();
+
+ /*
+ * We always move at least one character, unless on the last
+ * character in the buffer.
+ */
+ last_line = (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count);
+ i = inc_cursor();
+ if (i == -1 || (i >= 1 && last_line)) /* started at last char in file */
+ return FAIL;
+ if (i == 1 && eol && count == 0) /* started at last char in line */
+ return OK;
+
+ /*
+ * Go one char past end of current word (if any)
+ */
+ if (sclass != 0)
+ while (cls() == sclass)
+ {
+ i = inc_cursor();
+ if (i == -1 || (i >= 1 && eol && count == 0))
+ return OK;
+ }
+
+ /*
+ * go to next non-white
+ */
+ while (cls() == 0)
+ {
+ /*
+ * We'll stop if we land on a blank line
+ */
+ if (curwin->w_cursor.col == 0 && *ml_get_curline() == NUL)
+ break;
+
+ i = inc_cursor();
+ if (i == -1 || (i >= 1 && eol && count == 0))
+ return OK;
+ }
+ }
+ return OK;
+}
+
+/*
+ * bck_word() - move backward 'count' words
+ *
+ * If stop is TRUE and we are already on the start of a word, move one less.
+ *
+ * Returns FAIL if top of the file was reached.
+ */
+ int
+bck_word(count, bigword, stop)
+ long count;
+ int bigword;
+ int stop;
+{
+ int sclass; /* starting class */
+
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ cls_bigword = bigword;
+ while (--count >= 0)
+ {
+#ifdef FEAT_FOLDING
+ /* When inside a range of folded lines, move to the first char of the
+ * first line. */
+ if (hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL))
+ curwin->w_cursor.col = 0;
+#endif
+ sclass = cls();
+ if (dec_cursor() == -1) /* started at start of file */
+ return FAIL;
+
+ if (!stop || sclass == cls() || sclass == 0)
+ {
+ /*
+ * Skip white space before the word.
+ * Stop on an empty line.
+ */
+ while (cls() == 0)
+ {
+ if (curwin->w_cursor.col == 0
+ && lineempty(curwin->w_cursor.lnum))
+ goto finished;
+ if (dec_cursor() == -1) /* hit start of file, stop here */
+ return OK;
+ }
+
+ /*
+ * Move backward to start of this word.
+ */
+ if (skip_chars(cls(), BACKWARD))
+ return OK;
+ }
+
+ inc_cursor(); /* overshot - forward one */
+finished:
+ stop = FALSE;
+ }
+ return OK;
+}
+
+/*
+ * end_word() - move to the end of the word
+ *
+ * There is an apparent bug in the 'e' motion of the real vi. At least on the
+ * System V Release 3 version for the 80386. Unlike 'b' and 'w', the 'e'
+ * motion crosses blank lines. When the real vi crosses a blank line in an
+ * 'e' motion, the cursor is placed on the FIRST character of the next
+ * non-blank line. The 'E' command, however, works correctly. Since this
+ * appears to be a bug, I have not duplicated it here.
+ *
+ * Returns FAIL if end of the file was reached.
+ *
+ * If stop is TRUE and we are already on the end of a word, move one less.
+ * If empty is TRUE stop on an empty line.
+ */
+ int
+end_word(count, bigword, stop, empty)
+ long count;
+ int bigword;
+ int stop;
+ int empty;
+{
+ int sclass; /* starting class */
+
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ cls_bigword = bigword;
+ while (--count >= 0)
+ {
+#ifdef FEAT_FOLDING
+ /* When inside a range of folded lines, move to the last char of the
+ * last line. */
+ if (hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum))
+ coladvance((colnr_T)MAXCOL);
+#endif
+ sclass = cls();
+ if (inc_cursor() == -1)
+ return FAIL;
+
+ /*
+ * If we're in the middle of a word, we just have to move to the end
+ * of it.
+ */
+ if (cls() == sclass && sclass != 0)
+ {
+ /*
+ * Move forward to end of the current word
+ */
+ if (skip_chars(sclass, FORWARD))
+ return FAIL;
+ }
+ else if (!stop || sclass == 0)
+ {
+ /*
+ * We were at the end of a word. Go to the end of the next word.
+ * First skip white space, if 'empty' is TRUE, stop at empty line.
+ */
+ while (cls() == 0)
+ {
+ if (empty && curwin->w_cursor.col == 0
+ && lineempty(curwin->w_cursor.lnum))
+ goto finished;
+ if (inc_cursor() == -1) /* hit end of file, stop here */
+ return FAIL;
+ }
+
+ /*
+ * Move forward to the end of this word.
+ */
+ if (skip_chars(cls(), FORWARD))
+ return FAIL;
+ }
+ dec_cursor(); /* overshot - one char backward */
+finished:
+ stop = FALSE; /* we move only one word less */
+ }
+ return OK;
+}
+
+/*
+ * Move back to the end of the word.
+ *
+ * Returns FAIL if start of the file was reached.
+ */
+ int
+bckend_word(count, bigword, eol)
+ long count;
+ int bigword; /* TRUE for "B" */
+ int eol; /* TRUE: stop at end of line. */
+{
+ int sclass; /* starting class */
+ int i;
+
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ cls_bigword = bigword;
+ while (--count >= 0)
+ {
+ sclass = cls();
+ if ((i = dec_cursor()) == -1)
+ return FAIL;
+ if (eol && i == 1)
+ return OK;
+
+ /*
+ * Move backward to before the start of this word.
+ */
+ if (sclass != 0)
+ {
+ while (cls() == sclass)
+ if ((i = dec_cursor()) == -1 || (eol && i == 1))
+ return OK;
+ }
+
+ /*
+ * Move backward to end of the previous word
+ */
+ while (cls() == 0)
+ {
+ if (curwin->w_cursor.col == 0 && lineempty(curwin->w_cursor.lnum))
+ break;
+ if ((i = dec_cursor()) == -1 || (eol && i == 1))
+ return OK;
+ }
+ }
+ return OK;
+}
+
+/*
+ * Skip a row of characters of the same class.
+ * Return TRUE when end-of-file reached, FALSE otherwise.
+ */
+ static int
+skip_chars(cclass, dir)
+ int cclass;
+ int dir;
+{
+ while (cls() == cclass)
+ if ((dir == FORWARD ? inc_cursor() : dec_cursor()) == -1)
+ return TRUE;
+ return FALSE;
+}
+
+#ifdef FEAT_TEXTOBJ
+/*
+ * Go back to the start of the word or the start of white space
+ */
+ static void
+back_in_line()
+{
+ int sclass; /* starting class */
+
+ sclass = cls();
+ for (;;)
+ {
+ if (curwin->w_cursor.col == 0) /* stop at start of line */
+ break;
+ dec_cursor();
+ if (cls() != sclass) /* stop at start of word */
+ {
+ inc_cursor();
+ break;
+ }
+ }
+}
+
+ static void
+find_first_blank(posp)
+ pos_T *posp;
+{
+ int c;
+
+ while (decl(posp) != -1)
+ {
+ c = gchar_pos(posp);
+ if (!vim_iswhite(c))
+ {
+ incl(posp);
+ break;
+ }
+ }
+}
+
+/*
+ * Skip count/2 sentences and count/2 separating white spaces.
+ */
+ static void
+findsent_forward(count, at_start_sent)
+ long count;
+ int at_start_sent; /* cursor is at start of sentence */
+{
+ while (count--)
+ {
+ findsent(FORWARD, 1L);
+ if (at_start_sent)
+ find_first_blank(&curwin->w_cursor);
+ if (count == 0 || at_start_sent)
+ decl(&curwin->w_cursor);
+ at_start_sent = !at_start_sent;
+ }
+}
+
+/*
+ * Find word under cursor, cursor at end.
+ * Used while an operator is pending, and in Visual mode.
+ */
+ int
+current_word(oap, count, include, bigword)
+ oparg_T *oap;
+ long count;
+ int include; /* TRUE: include word and white space */
+ int bigword; /* FALSE == word, TRUE == WORD */
+{
+ pos_T start_pos;
+ pos_T pos;
+ int inclusive = TRUE;
+ int include_white = FALSE;
+
+ cls_bigword = bigword;
+
+#ifdef FEAT_VISUAL
+ /* Correct cursor when 'selection' is exclusive */
+ if (VIsual_active && *p_sel == 'e' && lt(VIsual, curwin->w_cursor))
+ dec_cursor();
+
+ /*
+ * When Visual mode is not active, or when the VIsual area is only one
+ * character, select the word and/or white space under the cursor.
+ */
+ if (!VIsual_active || equalpos(curwin->w_cursor, VIsual))
+#endif
+ {
+ /*
+ * Go to start of current word or white space.
+ */
+ back_in_line();
+ start_pos = curwin->w_cursor;
+
+ /*
+ * If the start is on white space, and white space should be included
+ * (" word"), or start is not on white space, and white space should
+ * not be included ("word"), find end of word.
+ */
+ if ((cls() == 0) == include)
+ {
+ if (end_word(1L, bigword, TRUE, TRUE) == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ /*
+ * If the start is not on white space, and white space should be
+ * included ("word "), or start is on white space and white
+ * space should not be included (" "), find start of word.
+ * If we end up in the first column of the next line (single char
+ * word) back up to end of the line.
+ */
+ fwd_word(1L, bigword, TRUE);
+ if (curwin->w_cursor.col == 0)
+ decl(&curwin->w_cursor);
+ else
+ oneleft();
+
+ if (include)
+ include_white = TRUE;
+ }
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ /* should do something when inclusive == FALSE ! */
+ VIsual = start_pos;
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ }
+ else
+#endif
+ {
+ oap->start = start_pos;
+ oap->motion_type = MCHAR;
+ }
+ --count;
+ }
+
+ /*
+ * When count is still > 0, extend with more objects.
+ */
+ while (count > 0)
+ {
+ inclusive = TRUE;
+#ifdef FEAT_VISUAL
+ if (VIsual_active && lt(curwin->w_cursor, VIsual))
+ {
+ /*
+ * In Visual mode, with cursor at start: move cursor back.
+ */
+ if (decl(&curwin->w_cursor) == -1)
+ return FAIL;
+ if (include != (cls() != 0))
+ {
+ if (bck_word(1L, bigword, TRUE) == FAIL)
+ return FAIL;
+ }
+ else
+ {
+ if (bckend_word(1L, bigword, TRUE) == FAIL)
+ return FAIL;
+ (void)incl(&curwin->w_cursor);
+ }
+ }
+ else
+#endif
+ {
+ /*
+ * Move cursor forward one word and/or white area.
+ */
+ if (incl(&curwin->w_cursor) == -1)
+ return FAIL;
+ if (include != (cls() == 0))
+ {
+ if (fwd_word(1L, bigword, TRUE) == FAIL)
+ return FAIL;
+ /*
+ * If end is just past a new-line, we don't want to include
+ * the first character on the line
+ */
+ if (oneleft() == FAIL) /* put cursor on last char of white */
+ inclusive = FALSE;
+ }
+ else
+ {
+ if (end_word(1L, bigword, TRUE, TRUE) == FAIL)
+ return FAIL;
+ }
+ }
+ --count;
+ }
+
+ if (include_white && cls() != 0)
+ {
+ /*
+ * If we don't include white space at the end, move the start
+ * to include some white space there. This makes "daw" work
+ * better on the last word in a sentence (and "2daw" on last-but-one
+ * word). But don't delete white space at start of line (indent).
+ */
+ pos = curwin->w_cursor; /* save cursor position */
+ curwin->w_cursor = start_pos;
+ if (oneleft() == OK)
+ {
+ back_in_line();
+ if (cls() == 0 && curwin->w_cursor.col > 0)
+ {
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ VIsual = curwin->w_cursor;
+ else
+#endif
+ oap->start = curwin->w_cursor;
+ }
+ }
+ curwin->w_cursor = pos; /* put cursor back at end */
+ }
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (*p_sel == 'e' && inclusive && ltoreq(VIsual, curwin->w_cursor))
+ inc_cursor();
+ if (VIsual_mode == 'V')
+ {
+ VIsual_mode = 'v';
+ redraw_cmdline = TRUE; /* show mode later */
+ }
+ }
+ else
+#endif
+ oap->inclusive = inclusive;
+
+ return OK;
+}
+
+/*
+ * Find sentence(s) under the cursor, cursor at end.
+ * When Visual active, extend it by one or more sentences.
+ */
+ int
+current_sent(oap, count, include)
+ oparg_T *oap;
+ long count;
+ int include;
+{
+ pos_T start_pos;
+ pos_T pos;
+ int start_blank;
+ int c;
+ int at_start_sent;
+ long ncount;
+
+ start_pos = curwin->w_cursor;
+ pos = start_pos;
+ findsent(FORWARD, 1L); /* Find start of next sentence. */
+
+#ifdef FEAT_VISUAL
+ /*
+ * When visual area is bigger than one character: Extend it.
+ */
+ if (VIsual_active && !equalpos(start_pos, VIsual))
+ {
+extend:
+ if (lt(start_pos, VIsual))
+ {
+ /*
+ * Cursor at start of Visual area.
+ * Find out where we are:
+ * - in the white space before a sentence
+ * - in a sentence or just after it
+ * - at the start of a sentence
+ */
+ at_start_sent = TRUE;
+ decl(&pos);
+ while (lt(pos, curwin->w_cursor))
+ {
+ c = gchar_pos(&pos);
+ if (!vim_iswhite(c))
+ {
+ at_start_sent = FALSE;
+ break;
+ }
+ incl(&pos);
+ }
+ if (!at_start_sent)
+ {
+ findsent(BACKWARD, 1L);
+ if (equalpos(curwin->w_cursor, start_pos))
+ at_start_sent = TRUE; /* exactly at start of sentence */
+ else
+ /* inside a sentence, go to its end (start of next) */
+ findsent(FORWARD, 1L);
+ }
+ if (include) /* "as" gets twice as much as "is" */
+ count *= 2;
+ while (count--)
+ {
+ if (at_start_sent)
+ find_first_blank(&curwin->w_cursor);
+ c = gchar_cursor();
+ if (!at_start_sent || (!include && !vim_iswhite(c)))
+ findsent(BACKWARD, 1L);
+ at_start_sent = !at_start_sent;
+ }
+ }
+ else
+ {
+ /*
+ * Cursor at end of Visual area.
+ * Find out where we are:
+ * - just before a sentence
+ * - just before or in the white space before a sentence
+ * - in a sentence
+ */
+ incl(&pos);
+ at_start_sent = TRUE;
+ if (!equalpos(pos, curwin->w_cursor)) /* not just before a sentence */
+ {
+ at_start_sent = FALSE;
+ while (lt(pos, curwin->w_cursor))
+ {
+ c = gchar_pos(&pos);
+ if (!vim_iswhite(c))
+ {
+ at_start_sent = TRUE;
+ break;
+ }
+ incl(&pos);
+ }
+ if (at_start_sent) /* in the sentence */
+ findsent(BACKWARD, 1L);
+ else /* in/before white before a sentence */
+ curwin->w_cursor = start_pos;
+ }
+
+ if (include) /* "as" gets twice as much as "is" */
+ count *= 2;
+ findsent_forward(count, at_start_sent);
+ if (*p_sel == 'e')
+ ++curwin->w_cursor.col;
+ }
+ return OK;
+ }
+#endif
+
+ /*
+ * If cursor started on blank, check if it is just before the start of the
+ * next sentence.
+ */
+ while (c = gchar_pos(&pos), vim_iswhite(c)) /* vim_iswhite() is a macro */
+ incl(&pos);
+ if (equalpos(pos, curwin->w_cursor))
+ {
+ start_blank = TRUE;
+ find_first_blank(&start_pos); /* go back to first blank */
+ }
+ else
+ {
+ start_blank = FALSE;
+ findsent(BACKWARD, 1L);
+ start_pos = curwin->w_cursor;
+ }
+ if (include)
+ ncount = count * 2;
+ else
+ {
+ ncount = count;
+ if (start_blank)
+ --ncount;
+ }
+ if (ncount)
+ findsent_forward(ncount, TRUE);
+ else
+ decl(&curwin->w_cursor);
+
+ if (include)
+ {
+ /*
+ * If the blank in front of the sentence is included, exclude the
+ * blanks at the end of the sentence, go back to the first blank.
+ * If there are no trailing blanks, try to include leading blanks.
+ */
+ if (start_blank)
+ {
+ find_first_blank(&curwin->w_cursor);
+ c = gchar_pos(&curwin->w_cursor); /* vim_iswhite() is a macro */
+ if (vim_iswhite(c))
+ decl(&curwin->w_cursor);
+ }
+ else if (c = gchar_cursor(), !vim_iswhite(c))
+ find_first_blank(&start_pos);
+ }
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ /* avoid getting stuck with "is" on a single space before a sent. */
+ if (equalpos(start_pos, curwin->w_cursor))
+ goto extend;
+ if (*p_sel == 'e')
+ ++curwin->w_cursor.col;
+ VIsual = start_pos;
+ VIsual_mode = 'v';
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ }
+ else
+#endif
+ {
+ /* include a newline after the sentence, if there is one */
+ if (incl(&curwin->w_cursor) == -1)
+ oap->inclusive = TRUE;
+ else
+ oap->inclusive = FALSE;
+ oap->start = start_pos;
+ oap->motion_type = MCHAR;
+ }
+ return OK;
+}
+
+ int
+current_block(oap, count, include, what, other)
+ oparg_T *oap;
+ long count;
+ int include; /* TRUE == include white space */
+ int what; /* '(', '{', etc. */
+ int other; /* ')', '}', etc. */
+{
+ pos_T old_pos;
+ pos_T *pos = NULL;
+ pos_T start_pos;
+ pos_T *end_pos;
+ pos_T old_start, old_end;
+ char_u *save_cpo;
+ int sol = FALSE; /* { at start of line */
+
+ old_pos = curwin->w_cursor;
+ old_end = curwin->w_cursor; /* remember where we started */
+ old_start = old_end;
+
+ /*
+ * If we start on '(', '{', ')', '}', etc., use the whole block inclusive.
+ */
+#ifdef FEAT_VISUAL
+ if (!VIsual_active || equalpos(VIsual, curwin->w_cursor))
+#endif
+ {
+ setpcmark();
+ if (what == '{') /* ignore indent */
+ while (inindent(1))
+ if (inc_cursor() != 0)
+ break;
+ if (gchar_cursor() == what) /* cursor on '(' or '{' */
+ ++curwin->w_cursor.col;
+ }
+#ifdef FEAT_VISUAL
+ else if (lt(VIsual, curwin->w_cursor))
+ {
+ old_start = VIsual;
+ curwin->w_cursor = VIsual; /* cursor at low end of Visual */
+ }
+ else
+ old_end = VIsual;
+#endif
+
+ /*
+ * Search backwards for unclosed '(', '{', etc..
+ * Put this position in start_pos.
+ * Ignory quotes here.
+ */
+ save_cpo = p_cpo;
+ p_cpo = (char_u *)"%";
+ while (count-- > 0)
+ {
+ if ((pos = findmatch(NULL, what)) == NULL)
+ break;
+ curwin->w_cursor = *pos;
+ start_pos = *pos; /* the findmatch for end_pos will overwrite *pos */
+ }
+ p_cpo = save_cpo;
+
+ /*
+ * Search for matching ')', '}', etc.
+ * Put this position in curwin->w_cursor.
+ */
+ if (pos == NULL || (end_pos = findmatch(NULL, other)) == NULL)
+ {
+ curwin->w_cursor = old_pos;
+ return FAIL;
+ }
+ curwin->w_cursor = *end_pos;
+
+ /*
+ * Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE.
+ * If the ending '}' is only preceded by indent, skip that indent.
+ * But only if the resulting area is not smaller than what we started with.
+ */
+ while (!include)
+ {
+ incl(&start_pos);
+ sol = (curwin->w_cursor.col == 0);
+ decl(&curwin->w_cursor);
+ if (what == '{')
+ while (inindent(1))
+ {
+ sol = TRUE;
+ if (decl(&curwin->w_cursor) != 0)
+ break;
+ }
+#ifdef FEAT_VISUAL
+ /*
+ * In Visual mode, when the resulting area is not bigger than what we
+ * started with, extend it to the next block, and then exclude again.
+ */
+ if (!lt(start_pos, old_start) && !lt(old_end, curwin->w_cursor)
+ && VIsual_active)
+ {
+ curwin->w_cursor = old_start;
+ decl(&curwin->w_cursor);
+ if ((pos = findmatch(NULL, what)) == NULL)
+ {
+ curwin->w_cursor = old_pos;
+ return FAIL;
+ }
+ start_pos = *pos;
+ curwin->w_cursor = *pos;
+ if ((end_pos = findmatch(NULL, other)) == NULL)
+ {
+ curwin->w_cursor = old_pos;
+ return FAIL;
+ }
+ curwin->w_cursor = *end_pos;
+ }
+ else
+#endif
+ break;
+ }
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ if (*p_sel == 'e')
+ ++curwin->w_cursor.col;
+ if (sol)
+ inc(&curwin->w_cursor); /* include the line break */
+ VIsual = start_pos;
+ VIsual_mode = 'v';
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ showmode();
+ }
+ else
+#endif
+ {
+ oap->start = start_pos;
+ oap->motion_type = MCHAR;
+ if (sol)
+ {
+ incl(&curwin->w_cursor);
+ oap->inclusive = FALSE;
+ }
+ else
+ oap->inclusive = TRUE;
+ }
+
+ return OK;
+}
+
+ int
+current_par(oap, count, include, type)
+ oparg_T *oap;
+ long count;
+ int include; /* TRUE == include white space */
+ int type; /* 'p' for paragraph, 'S' for section */
+{
+ linenr_T start_lnum;
+ linenr_T end_lnum;
+ int white_in_front;
+ int dir;
+ int start_is_white;
+ int prev_start_is_white;
+ int retval = OK;
+ int do_white = FALSE;
+ int t;
+ int i;
+
+ if (type == 'S') /* not implemented yet */
+ return FAIL;
+
+ start_lnum = curwin->w_cursor.lnum;
+
+#ifdef FEAT_VISUAL
+ /*
+ * When visual area is more than one line: extend it.
+ */
+ if (VIsual_active && start_lnum != VIsual.lnum)
+ {
+extend:
+ if (start_lnum < VIsual.lnum)
+ dir = BACKWARD;
+ else
+ dir = FORWARD;
+ for (i = count; --i >= 0; )
+ {
+ if (start_lnum ==
+ (dir == BACKWARD ? 1 : curbuf->b_ml.ml_line_count))
+ {
+ retval = FAIL;
+ break;
+ }
+
+ prev_start_is_white = -1;
+ for (t = 0; t < 2; ++t)
+ {
+ start_lnum += dir;
+ start_is_white = linewhite(start_lnum);
+ if (prev_start_is_white == start_is_white)
+ {
+ start_lnum -= dir;
+ break;
+ }
+ for (;;)
+ {
+ if (start_lnum == (dir == BACKWARD
+ ? 1 : curbuf->b_ml.ml_line_count))
+ break;
+ if (start_is_white != linewhite(start_lnum + dir)
+ || (!start_is_white
+ && startPS(start_lnum + (dir > 0
+ ? 1 : 0), 0, 0)))
+ break;
+ start_lnum += dir;
+ }
+ if (!include)
+ break;
+ if (start_lnum == (dir == BACKWARD
+ ? 1 : curbuf->b_ml.ml_line_count))
+ break;
+ prev_start_is_white = start_is_white;
+ }
+ }
+ curwin->w_cursor.lnum = start_lnum;
+ curwin->w_cursor.col = 0;
+ return retval;
+ }
+#endif
+
+ /*
+ * First move back to the start_lnum of the paragraph or white lines
+ */
+ white_in_front = linewhite(start_lnum);
+ while (start_lnum > 1)
+ {
+ if (white_in_front) /* stop at first white line */
+ {
+ if (!linewhite(start_lnum - 1))
+ break;
+ }
+ else /* stop at first non-white line of start of paragraph */
+ {
+ if (linewhite(start_lnum - 1) || startPS(start_lnum, 0, 0))
+ break;
+ }
+ --start_lnum;
+ }
+
+ /*
+ * Move past the end of any white lines.
+ */
+ end_lnum = start_lnum;
+ while (linewhite(end_lnum) && end_lnum < curbuf->b_ml.ml_line_count)
+ ++end_lnum;
+
+ --end_lnum;
+ i = count;
+ if (!include && white_in_front)
+ --i;
+ while (i--)
+ {
+ if (end_lnum == curbuf->b_ml.ml_line_count)
+ return FAIL;
+
+ if (!include)
+ do_white = linewhite(end_lnum + 1);
+
+ if (include || !do_white)
+ {
+ ++end_lnum;
+ /*
+ * skip to end of paragraph
+ */
+ while (end_lnum < curbuf->b_ml.ml_line_count
+ && !linewhite(end_lnum + 1)
+ && !startPS(end_lnum + 1, 0, 0))
+ ++end_lnum;
+ }
+
+ if (i == 0 && white_in_front && include)
+ break;
+
+ /*
+ * skip to end of white lines after paragraph
+ */
+ if (include || do_white)
+ while (end_lnum < curbuf->b_ml.ml_line_count
+ && linewhite(end_lnum + 1))
+ ++end_lnum;
+ }
+
+ /*
+ * If there are no empty lines at the end, try to find some empty lines at
+ * the start (unless that has been done already).
+ */
+ if (!white_in_front && !linewhite(end_lnum) && include)
+ while (start_lnum > 1 && linewhite(start_lnum - 1))
+ --start_lnum;
+
+#ifdef FEAT_VISUAL
+ if (VIsual_active)
+ {
+ /* Problem: when doing "Vipipip" nothing happens in a single white
+ * line, we get stuck there. Trap this here. */
+ if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum)
+ goto extend;
+ VIsual.lnum = start_lnum;
+ VIsual_mode = 'V';
+ redraw_curbuf_later(INVERTED); /* update the inversion */
+ showmode();
+ }
+ else
+#endif
+ {
+ oap->start.lnum = start_lnum;
+ oap->start.col = 0;
+ oap->motion_type = MLINE;
+ }
+ curwin->w_cursor.lnum = end_lnum;
+ curwin->w_cursor.col = 0;
+
+ return OK;
+}
+#endif
+
+#if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \
+ || defined(PROTO)
+/*
+ * return TRUE if line 'lnum' is empty or has white chars only.
+ */
+ int
+linewhite(lnum)
+ linenr_T lnum;
+{
+ char_u *p;
+
+ p = skipwhite(ml_get(lnum));
+ return (*p == NUL);
+}
+#endif
+
+#if defined(FEAT_FIND_ID) || defined(PROTO)
+/*
+ * Find identifiers or defines in included files.
+ * if p_ic && (continue_status & CONT_SOL) then ptr must be in lowercase.
+ */
+/*ARGSUSED*/
+ void
+find_pattern_in_path(ptr, dir, len, whole, skip_comments,
+ type, count, action, start_lnum, end_lnum)
+ char_u *ptr; /* pointer to search pattern */
+ int dir; /* direction of expansion */
+ int len; /* length of search pattern */
+ int whole; /* match whole words only */
+ int skip_comments; /* don't match inside comments */
+ int type; /* Type of search; are we looking for a type?
+ a macro? */
+ long count;
+ int action; /* What to do when we find it */
+ linenr_T start_lnum; /* first line to start searching */
+ linenr_T end_lnum; /* last line for searching */
+{
+ SearchedFile *files; /* Stack of included files */
+ SearchedFile *bigger; /* When we need more space */
+ int max_path_depth = 50;
+ long match_count = 1;
+
+ char_u *pat;
+ char_u *new_fname;
+ char_u *curr_fname = curbuf->b_fname;
+ char_u *prev_fname = NULL;
+ linenr_T lnum;
+ int depth;
+ int depth_displayed; /* For type==CHECK_PATH */
+ int old_files;
+ int already_searched;
+ char_u *file_line;
+ char_u *line;
+ char_u *p;
+ char_u save_char;
+ int define_matched;
+ regmatch_T regmatch;
+ regmatch_T incl_regmatch;
+ regmatch_T def_regmatch;
+ int matched = FALSE;
+ int did_show = FALSE;
+ int found = FALSE;
+ int i;
+ char_u *already = NULL;
+ char_u *startp = NULL;
+#ifdef RISCOS
+ int previous_munging = __riscosify_control;
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ win_T *curwin_save = NULL;
+#endif
+
+ regmatch.regprog = NULL;
+ incl_regmatch.regprog = NULL;
+ def_regmatch.regprog = NULL;
+
+ file_line = alloc(LSIZE);
+ if (file_line == NULL)
+ return;
+
+#ifdef RISCOS
+ /* UnixLib knows best how to munge c file names - turn munging back on. */
+ __riscosify_control = __RISCOSIFY_LONG_TRUNCATE;
+#endif
+
+ if (type != CHECK_PATH && type != FIND_DEFINE
+#ifdef FEAT_INS_EXPAND
+ /* when CONT_SOL is set compare "ptr" with the beginning of the line
+ * is faster than quote_meta/regcomp/regexec "ptr" -- Acevedo */
+ && !(continue_status & CONT_SOL)
+#endif
+ )
+ {
+ pat = alloc(len + 5);
+ if (pat == NULL)
+ goto fpip_end;
+ sprintf((char *)pat, whole ? "\\<%.*s\\>" : "%.*s", len, ptr);
+ /* ignore case according to p_ic, p_scs and pat */
+ regmatch.rm_ic = ignorecase(pat);
+ regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0);
+ vim_free(pat);
+ if (regmatch.regprog == NULL)
+ goto fpip_end;
+ }
+ if (*curbuf->b_p_inc != NUL || *p_inc != NUL)
+ {
+ incl_regmatch.regprog = vim_regcomp(*curbuf->b_p_inc == NUL
+ ? p_inc : curbuf->b_p_inc, p_magic ? RE_MAGIC : 0);
+ if (incl_regmatch.regprog == NULL)
+ goto fpip_end;
+ incl_regmatch.rm_ic = FALSE; /* don't ignore case in incl. pat. */
+ }
+ if (type == FIND_DEFINE && (*curbuf->b_p_def != NUL || *p_def != NUL))
+ {
+ def_regmatch.regprog = vim_regcomp(*curbuf->b_p_def == NUL
+ ? p_def : curbuf->b_p_def, p_magic ? RE_MAGIC : 0);
+ if (def_regmatch.regprog == NULL)
+ goto fpip_end;
+ def_regmatch.rm_ic = FALSE; /* don't ignore case in define pat. */
+ }
+ files = (SearchedFile *)lalloc_clear((long_u)
+ (max_path_depth * sizeof(SearchedFile)), TRUE);
+ if (files == NULL)
+ goto fpip_end;
+ old_files = max_path_depth;
+ depth = depth_displayed = -1;
+
+ lnum = start_lnum;
+ if (end_lnum > curbuf->b_ml.ml_line_count)
+ end_lnum = curbuf->b_ml.ml_line_count;
+ if (lnum > end_lnum) /* do at least one line */
+ lnum = end_lnum;
+ line = ml_get(lnum);
+
+ for (;;)
+ {
+ if (incl_regmatch.regprog != NULL
+ && vim_regexec(&incl_regmatch, line, (colnr_T)0))
+ {
+ new_fname = file_name_in_line(incl_regmatch.endp[0],
+ 0, FNAME_EXP|FNAME_INCL|FNAME_REL, 1L,
+ curr_fname == curbuf->b_fname
+ ? curbuf->b_ffname : curr_fname);
+ already_searched = FALSE;
+ if (new_fname != NULL)
+ {
+ /* Check whether we have already searched in this file */
+ for (i = 0;; i++)
+ {
+ if (i == depth + 1)
+ i = old_files;
+ if (i == max_path_depth)
+ break;
+ if (fullpathcmp(new_fname, files[i].name, TRUE) & FPC_SAME)
+ {
+ if (type != CHECK_PATH &&
+ action == ACTION_SHOW_ALL && files[i].matched)
+ {
+ msg_putchar('\n'); /* cursor below last one */
+ if (!got_int) /* don't display if 'q'
+ typed at "--more--"
+ mesage */
+ {
+ msg_home_replace_hl(new_fname);
+ MSG_PUTS(_(" (includes previously listed match)"));
+ prev_fname = NULL;
+ }
+ }
+ vim_free(new_fname);
+ new_fname = NULL;
+ already_searched = TRUE;
+ break;
+ }
+ }
+ }
+
+ if (type == CHECK_PATH && (action == ACTION_SHOW_ALL
+ || (new_fname == NULL && !already_searched)))
+ {
+ if (did_show)
+ msg_putchar('\n'); /* cursor below last one */
+ else
+ {
+ gotocmdline(TRUE); /* cursor at status line */
+ MSG_PUTS_TITLE(_("--- Included files "));
+ if (action != ACTION_SHOW_ALL)
+ MSG_PUTS_TITLE(_("not found "));
+ MSG_PUTS_TITLE(_("in path ---\n"));
+ }
+ did_show = TRUE;
+ while (depth_displayed < depth && !got_int)
+ {
+ ++depth_displayed;
+ for (i = 0; i < depth_displayed; i++)
+ MSG_PUTS(" ");
+ msg_home_replace(files[depth_displayed].name);
+ MSG_PUTS(" -->\n");
+ }
+ if (!got_int) /* don't display if 'q' typed
+ for "--more--" message */
+ {
+ for (i = 0; i <= depth_displayed; i++)
+ MSG_PUTS(" ");
+ if (new_fname != NULL)
+ {
+ /* using "new_fname" is more reliable, e.g., when
+ * 'includeexpr' is set. */
+ msg_outtrans_attr(new_fname, hl_attr(HLF_D));
+ }
+ else
+ {
+ /*
+ * Isolate the file name.
+ * Include the surrounding "" or <> if present.
+ */
+ for (p = incl_regmatch.endp[0]; !vim_isfilec(*p); p++)
+ ;
+ for (i = 0; vim_isfilec(p[i]); i++)
+ ;
+ if (i == 0)
+ {
+ /* Nothing found, use the rest of the line. */
+ p = incl_regmatch.endp[0];
+ i = STRLEN(p);
+ }
+ else
+ {
+ if (p[-1] == '"' || p[-1] == '<')
+ {
+ --p;
+ ++i;
+ }
+ if (p[i] == '"' || p[i] == '>')
+ ++i;
+ }
+ save_char = p[i];
+ p[i] = NUL;
+ msg_outtrans_attr(p, hl_attr(HLF_D));
+ p[i] = save_char;
+ }
+
+ if (new_fname == NULL && action == ACTION_SHOW_ALL)
+ {
+ if (already_searched)
+ MSG_PUTS(_(" (Already listed)"));
+ else
+ MSG_PUTS(_(" NOT FOUND"));
+ }
+ }
+ out_flush(); /* output each line directly */
+ }
+
+ if (new_fname != NULL)
+ {
+ /* Push the new file onto the file stack */
+ if (depth + 1 == old_files)
+ {
+ bigger = (SearchedFile *)lalloc((long_u)(
+ max_path_depth * 2 * sizeof(SearchedFile)), TRUE);
+ if (bigger != NULL)
+ {
+ for (i = 0; i <= depth; i++)
+ bigger[i] = files[i];
+ for (i = depth + 1; i < old_files + max_path_depth; i++)
+ {
+ bigger[i].fp = NULL;
+ bigger[i].name = NULL;
+ bigger[i].lnum = 0;
+ bigger[i].matched = FALSE;
+ }
+ for (i = old_files; i < max_path_depth; i++)
+ bigger[i + max_path_depth] = files[i];
+ old_files += max_path_depth;
+ max_path_depth *= 2;
+ vim_free(files);
+ files = bigger;
+ }
+ }
+ if ((files[depth + 1].fp = mch_fopen((char *)new_fname, "r"))
+ == NULL)
+ vim_free(new_fname);
+ else
+ {
+ if (++depth == old_files)
+ {
+ /*
+ * lalloc() for 'bigger' must have failed above. We
+ * will forget one of our already visited files now.
+ */
+ vim_free(files[old_files].name);
+ ++old_files;
+ }
+ files[depth].name = curr_fname = new_fname;
+ files[depth].lnum = 0;
+ files[depth].matched = FALSE;
+#ifdef FEAT_INS_EXPAND
+ if (action == ACTION_EXPAND)
+ {
+ sprintf((char*)IObuff, _("Scanning included file: %s"),
+ (char *)new_fname);
+ msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
+ }
+#endif
+ }
+ }
+ }
+ else
+ {
+ /*
+ * Check if the line is a define (type == FIND_DEFINE)
+ */
+ p = line;
+search_line:
+ define_matched = FALSE;
+ if (def_regmatch.regprog != NULL
+ && vim_regexec(&def_regmatch, line, (colnr_T)0))
+ {
+ /*
+ * Pattern must be first identifier after 'define', so skip
+ * to that position before checking for match of pattern. Also
+ * don't let it match beyond the end of this identifier.
+ */
+ p = def_regmatch.endp[0];
+ while (*p && !vim_iswordc(*p))
+ p++;
+ define_matched = TRUE;
+ }
+
+ /*
+ * Look for a match. Don't do this if we are looking for a
+ * define and this line didn't match define_prog above.
+ */
+ if (def_regmatch.regprog == NULL || define_matched)
+ {
+ if (define_matched
+#ifdef FEAT_INS_EXPAND
+ || (continue_status & CONT_SOL)
+#endif
+ )
+ {
+ /* compare the first "len" chars from "ptr" */
+ startp = skipwhite(p);
+ if (p_ic)
+ matched = !MB_STRNICMP(startp, ptr, len);
+ else
+ matched = !STRNCMP(startp, ptr, len);
+ if (matched && define_matched && whole
+ && vim_iswordc(startp[len]))
+ matched = FALSE;
+ }
+ else if (regmatch.regprog != NULL
+ && vim_regexec(&regmatch, line, (colnr_T)(p - line)))
+ {
+ matched = TRUE;
+ startp = regmatch.startp[0];
+ /*
+ * Check if the line is not a comment line (unless we are
+ * looking for a define). A line starting with "# define"
+ * is not considered to be a comment line.
+ */
+ if (!define_matched && skip_comments)
+ {
+#ifdef FEAT_COMMENTS
+ if ((*line != '#' ||
+ STRNCMP(skipwhite(line + 1), "define", 6) != 0)
+ && get_leader_len(line, NULL, FALSE))
+ matched = FALSE;
+
+ /*
+ * Also check for a "/ *" or "/ /" before the match.
+ * Skips lines like "int backwards; / * normal index
+ * * /" when looking for "normal".
+ * Note: Doesn't skip "/ *" in comments.
+ */
+ p = skipwhite(line);
+ if (matched
+ || (p[0] == '/' && p[1] == '*') || p[0] == '*')
+#endif
+ for (p = line; *p && p < startp; ++p)
+ {
+ if (matched
+ && p[0] == '/'
+ && (p[1] == '*' || p[1] == '/'))
+ {
+ matched = FALSE;
+ /* After "//" all text is comment */
+ if (p[1] == '/')
+ break;
+ ++p;
+ }
+ else if (!matched && p[0] == '*' && p[1] == '/')
+ {
+ /* Can find match after "* /". */
+ matched = TRUE;
+ ++p;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (matched)
+ {
+#ifdef FEAT_INS_EXPAND
+ if (action == ACTION_EXPAND)
+ {
+ int reuse = 0;
+ int add_r;
+ char_u *aux;
+
+ if (depth == -1 && lnum == curwin->w_cursor.lnum)
+ break;
+ found = TRUE;
+ aux = p = startp;
+ if (continue_status & CONT_ADDING)
+ {
+ p += completion_length;
+ if (vim_iswordp(p))
+ goto exit_matched;
+ p = find_word_start(p);
+ }
+ p = find_word_end(p);
+ i = (int)(p - aux);
+
+ if ((continue_status & CONT_ADDING) && i == completion_length)
+ {
+ /* get the next line */
+ /* IOSIZE > completion_length, so the STRNCPY works */
+ STRNCPY(IObuff, aux, i);
+ if (!( depth < 0
+ && lnum < end_lnum
+ && (line = ml_get(++lnum)) != NULL)
+ && !( depth >= 0
+ && !vim_fgets(line = file_line,
+ LSIZE, files[depth].fp)))
+ goto exit_matched;
+
+ /* we read a line, set "already" to check this "line" later
+ * if depth >= 0 we'll increase files[depth].lnum far
+ * bellow -- Acevedo */
+ already = aux = p = skipwhite(line);
+ p = find_word_start(p);
+ p = find_word_end(p);
+ if (p > aux)
+ {
+ if (*aux != ')' && IObuff[i-1] != TAB)
+ {
+ if (IObuff[i-1] != ' ')
+ IObuff[i++] = ' ';
+ /* IObuf =~ "\(\k\|\i\).* ", thus i >= 2*/
+ if (p_js
+ && (IObuff[i-2] == '.'
+ || (vim_strchr(p_cpo, CPO_JOINSP) == NULL
+ && (IObuff[i-2] == '?'
+ || IObuff[i-2] == '!'))))
+ IObuff[i++] = ' ';
+ }
+ /* copy as much as posible of the new word */
+ if (p - aux >= IOSIZE - i)
+ p = aux + IOSIZE - i - 1;
+ STRNCPY(IObuff + i, aux, p - aux);
+ i += (int)(p - aux);
+ reuse |= CONT_S_IPOS;
+ }
+ IObuff[i] = NUL;
+ aux = IObuff;
+
+ if (i == completion_length)
+ goto exit_matched;
+ }
+
+ add_r = ins_compl_add_infercase(aux, i,
+ curr_fname == curbuf->b_fname ? NULL : curr_fname,
+ dir, reuse);
+ if (add_r == OK)
+ /* if dir was BACKWARD then honor it just once */
+ dir = FORWARD;
+ else if (add_r == RET_ERROR)
+ break;
+ }
+ else
+#endif
+ if (action == ACTION_SHOW_ALL)
+ {
+ found = TRUE;
+ if (!did_show)
+ gotocmdline(TRUE); /* cursor at status line */
+ if (curr_fname != prev_fname)
+ {
+ if (did_show)
+ msg_putchar('\n'); /* cursor below last one */
+ if (!got_int) /* don't display if 'q' typed
+ at "--more--" mesage */
+ msg_home_replace_hl(curr_fname);
+ prev_fname = curr_fname;
+ }
+ did_show = TRUE;
+ if (!got_int)
+ show_pat_in_path(line, type, TRUE, action,
+ (depth == -1) ? NULL : files[depth].fp,
+ (depth == -1) ? &lnum : &files[depth].lnum,
+ match_count++);
+
+ /* Set matched flag for this file and all the ones that
+ * include it */
+ for (i = 0; i <= depth; ++i)
+ files[i].matched = TRUE;
+ }
+ else if (--count <= 0)
+ {
+ found = TRUE;
+ if (depth == -1 && lnum == curwin->w_cursor.lnum
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ && g_do_tagpreview == 0
+#endif
+ )
+ EMSG(_("E387: Match is on current line"));
+ else if (action == ACTION_SHOW)
+ {
+ show_pat_in_path(line, type, did_show, action,
+ (depth == -1) ? NULL : files[depth].fp,
+ (depth == -1) ? &lnum : &files[depth].lnum, 1L);
+ did_show = TRUE;
+ }
+ else
+ {
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ /* ":psearch" uses the preview window */
+ if (g_do_tagpreview != 0)
+ {
+ curwin_save = curwin;
+ prepare_tagpreview();
+ }
+#endif
+ if (action == ACTION_SPLIT)
+ {
+#ifdef FEAT_WINDOWS
+ if (win_split(0, 0) == FAIL)
+#endif
+ break;
+#ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+#endif
+ }
+ if (depth == -1)
+ {
+ /* match in current file */
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview != 0)
+ {
+ if (getfile(0, curwin_save->w_buffer->b_fname,
+ NULL, TRUE, lnum, FALSE) > 0)
+ break; /* failed to jump to file */
+ }
+ else
+#endif
+ setpcmark();
+ curwin->w_cursor.lnum = lnum;
+ }
+ else
+ {
+ if (getfile(0, files[depth].name, NULL, TRUE,
+ files[depth].lnum, FALSE) > 0)
+ break; /* failed to jump to file */
+ /* autocommands may have changed the lnum, we don't
+ * want that here */
+ curwin->w_cursor.lnum = files[depth].lnum;
+ }
+ }
+ if (action != ACTION_SHOW)
+ {
+ curwin->w_cursor.col = (colnr_T) (startp - line);
+ curwin->w_set_curswant = TRUE;
+ }
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview != 0
+ && curwin != curwin_save && win_valid(curwin_save))
+ {
+ /* Return cursor to where we were */
+ validate_cursor();
+ redraw_later(VALID);
+ win_enter(curwin_save, TRUE);
+ }
+#endif
+ break;
+ }
+#ifdef FEAT_INS_EXPAND
+exit_matched:
+#endif
+ matched = FALSE;
+ /* look for other matches in the rest of the line if we
+ * are not at the end of it already */
+ if (def_regmatch.regprog == NULL
+#ifdef FEAT_INS_EXPAND
+ && action == ACTION_EXPAND
+ && !(continue_status & CONT_SOL)
+#endif
+ && *(p = startp + 1))
+ goto search_line;
+ }
+ line_breakcheck();
+#ifdef FEAT_INS_EXPAND
+ if (action == ACTION_EXPAND)
+ ins_compl_check_keys();
+ if (got_int || completion_interrupted)
+#else
+ if (got_int)
+#endif
+ break;
+
+ /*
+ * Read the next line. When reading an included file and encountering
+ * end-of-file, close the file and continue in the file that included
+ * it.
+ */
+ while (depth >= 0 && !already
+ && vim_fgets(line = file_line, LSIZE, files[depth].fp))
+ {
+ fclose(files[depth].fp);
+ --old_files;
+ files[old_files].name = files[depth].name;
+ files[old_files].matched = files[depth].matched;
+ --depth;
+ curr_fname = (depth == -1) ? curbuf->b_fname
+ : files[depth].name;
+ if (depth < depth_displayed)
+ depth_displayed = depth;
+ }
+ if (depth >= 0) /* we could read the line */
+ files[depth].lnum++;
+ else if (!already)
+ {
+ if (++lnum > end_lnum)
+ break;
+ line = ml_get(lnum);
+ }
+ already = NULL;
+ }
+ /* End of big for (;;) loop. */
+
+ /* Close any files that are still open. */
+ for (i = 0; i <= depth; i++)
+ {
+ fclose(files[i].fp);
+ vim_free(files[i].name);
+ }
+ for (i = old_files; i < max_path_depth; i++)
+ vim_free(files[i].name);
+ vim_free(files);
+
+ if (type == CHECK_PATH)
+ {
+ if (!did_show)
+ {
+ if (action != ACTION_SHOW_ALL)
+ MSG(_("All included files were found"));
+ else
+ MSG(_("No included files"));
+ }
+ }
+ else if (!found
+#ifdef FEAT_INS_EXPAND
+ && action != ACTION_EXPAND
+#endif
+ )
+ {
+#ifdef FEAT_INS_EXPAND
+ if (got_int || completion_interrupted)
+#else
+ if (got_int)
+#endif
+ EMSG(_(e_interr));
+ else if (type == FIND_DEFINE)
+ EMSG(_("E388: Couldn't find definition"));
+ else
+ EMSG(_("E389: Couldn't find pattern"));
+ }
+ if (action == ACTION_SHOW || action == ACTION_SHOW_ALL)
+ msg_end();
+
+fpip_end:
+ vim_free(file_line);
+ vim_free(regmatch.regprog);
+ vim_free(incl_regmatch.regprog);
+ vim_free(def_regmatch.regprog);
+
+#ifdef RISCOS
+ /* Restore previous file munging state. */
+ __riscosify_control = previous_munging;
+#endif
+}
+
+ static void
+show_pat_in_path(line, type, did_show, action, fp, lnum, count)
+ char_u *line;
+ int type;
+ int did_show;
+ int action;
+ FILE *fp;
+ linenr_T *lnum;
+ long count;
+{
+ char_u *p;
+
+ if (did_show)
+ msg_putchar('\n'); /* cursor below last one */
+ else
+ gotocmdline(TRUE); /* cursor at status line */
+ if (got_int) /* 'q' typed at "--more--" message */
+ return;
+ for (;;)
+ {
+ p = line + STRLEN(line) - 1;
+ if (fp != NULL)
+ {
+ /* We used fgets(), so get rid of newline at end */
+ if (p >= line && *p == '\n')
+ --p;
+ if (p >= line && *p == '\r')
+ --p;
+ *(p + 1) = NUL;
+ }
+ if (action == ACTION_SHOW_ALL)
+ {
+ sprintf((char *)IObuff, "%3ld: ", count); /* show match nr */
+ msg_puts(IObuff);
+ sprintf((char *)IObuff, "%4ld", *lnum); /* show line nr */
+ /* Highlight line numbers */
+ msg_puts_attr(IObuff, hl_attr(HLF_N));
+ MSG_PUTS(" ");
+ }
+ msg_prt_line(line);
+ out_flush(); /* show one line at a time */
+
+ /* Definition continues until line that doesn't end with '\' */
+ if (got_int || type != FIND_DEFINE || p < line || *p != '\\')
+ break;
+
+ if (fp != NULL)
+ {
+ if (vim_fgets(line, LSIZE, fp)) /* end of file */
+ break;
+ ++*lnum;
+ }
+ else
+ {
+ if (++*lnum > curbuf->b_ml.ml_line_count)
+ break;
+ line = ml_get(*lnum);
+ }
+ msg_putchar('\n');
+ }
+}
+#endif
+
+#ifdef FEAT_VIMINFO
+ int
+read_viminfo_search_pattern(virp, force)
+ vir_T *virp;
+ int force;
+{
+ char_u *lp;
+ int idx = -1;
+ int magic = FALSE;
+ int no_scs = FALSE;
+ int off_line = FALSE;
+ int off_end = FALSE;
+ long off = 0;
+ int setlast = FALSE;
+#ifdef FEAT_SEARCH_EXTRA
+ static int hlsearch_on = FALSE;
+#endif
+ char_u *val;
+
+ /*
+ * Old line types:
+ * "/pat", "&pat": search/subst. pat
+ * "~/pat", "~&pat": last used search/subst. pat
+ * New line types:
+ * "~h", "~H": hlsearch highlighting off/on
+ * "~<magic><smartcase><line><end><off><last><which>pat"
+ * <magic>: 'm' off, 'M' on
+ * <smartcase>: 's' off, 'S' on
+ * <line>: 'L' line offset, 'l' char offset
+ * <end>: 'E' from end, 'e' from start
+ * <off>: decimal, offset
+ * <last>: '~' last used pattern
+ * <which>: '/' search pat, '&' subst. pat
+ */
+ lp = virp->vir_line;
+ if (lp[0] == '~' && (lp[1] == 'm' || lp[1] == 'M')) /* new line type */
+ {
+ if (lp[1] == 'M') /* magic on */
+ magic = TRUE;
+ if (lp[2] == 's')
+ no_scs = TRUE;
+ if (lp[3] == 'L')
+ off_line = TRUE;
+ if (lp[4] == 'E')
+ off_end = TRUE;
+ lp += 5;
+ off = getdigits(&lp);
+ }
+ if (lp[0] == '~') /* use this pattern for last-used pattern */
+ {
+ setlast = TRUE;
+ lp++;
+ }
+ if (lp[0] == '/')
+ idx = RE_SEARCH;
+ else if (lp[0] == '&')
+ idx = RE_SUBST;
+#ifdef FEAT_SEARCH_EXTRA
+ else if (lp[0] == 'h') /* ~h: 'hlsearch' highlighting off */
+ hlsearch_on = FALSE;
+ else if (lp[0] == 'H') /* ~H: 'hlsearch' highlighting on */
+ hlsearch_on = TRUE;
+#endif
+ if (idx >= 0)
+ {
+ if (force || spats[idx].pat == NULL)
+ {
+ val = viminfo_readstring(virp, (int)(lp - virp->vir_line + 1),
+ TRUE);
+ if (val != NULL)
+ {
+ set_last_search_pat(val, idx, magic, setlast);
+ vim_free(val);
+ spats[idx].no_scs = no_scs;
+ spats[idx].off.line = off_line;
+ spats[idx].off.end = off_end;
+ spats[idx].off.off = off;
+#ifdef FEAT_SEARCH_EXTRA
+ if (setlast)
+ no_hlsearch = !hlsearch_on;
+#endif
+ }
+ }
+ }
+ return viminfo_readline(virp);
+}
+
+ void
+write_viminfo_search_pattern(fp)
+ FILE *fp;
+{
+ if (get_viminfo_parameter('/') != 0)
+ {
+#ifdef FEAT_SEARCH_EXTRA
+ fprintf(fp, "\n# hlsearch on (H) or off (h):\n~%c",
+ (no_hlsearch || find_viminfo_parameter('h') != NULL) ? 'h' : 'H');
+#endif
+ wvsp_one(fp, RE_SEARCH, "", '/');
+ wvsp_one(fp, RE_SUBST, "Substitute ", '&');
+ }
+}
+
+ static void
+wvsp_one(fp, idx, s, sc)
+ FILE *fp; /* file to write to */
+ int idx; /* spats[] index */
+ char *s; /* search pat */
+ int sc; /* dir char */
+{
+ if (spats[idx].pat != NULL)
+ {
+ fprintf(fp, "\n# Last %sSearch Pattern:\n~", s);
+ /* off.dir is not stored, it's reset to forward */
+ fprintf(fp, "%c%c%c%c%ld%s%c",
+ spats[idx].magic ? 'M' : 'm', /* magic */
+ spats[idx].no_scs ? 's' : 'S', /* smartcase */
+ spats[idx].off.line ? 'L' : 'l', /* line offset */
+ spats[idx].off.end ? 'E' : 'e', /* offset from end */
+ spats[idx].off.off, /* offset */
+ last_idx == idx ? "~" : "", /* last used pat */
+ sc);
+ viminfo_writestring(fp, spats[idx].pat);
+ }
+}
+#endif /* FEAT_VIMINFO */
diff --git a/src/structs.h b/src/structs.h
new file mode 100644
index 000000000..ac0a795cb
--- /dev/null
+++ b/src/structs.h
@@ -0,0 +1,1887 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * This file contains various definitions of structures that are used by Vim
+ */
+
+/*
+ * There is something wrong in the SAS compiler that makes typedefs not
+ * valid in include files. Has been fixed in version 6.58.
+ */
+#if defined(SASC) && SASC < 658
+typedef long linenr_T;
+typedef unsigned colnr_T;
+typedef unsigned short short_u;
+#endif
+
+/*
+ * position in file or buffer
+ */
+typedef struct
+{
+ linenr_T lnum; /* line number */
+ colnr_T col; /* column number */
+#ifdef FEAT_VIRTUALEDIT
+ colnr_T coladd;
+#endif
+} pos_T;
+
+#ifdef FEAT_VIRTUALEDIT
+# define INIT_POS_T {0, 0, 0}
+#else
+# define INIT_POS_T {0, 0}
+#endif
+
+/*
+ * Same, but without coladd.
+ */
+typedef struct
+{
+ linenr_T lnum; /* line number */
+ colnr_T col; /* column number */
+} lpos_T;
+
+/*
+ * Structure used for growing arrays.
+ * This is used to store information that only grows, is deleted all at
+ * once, and needs to be accessed by index. See ga_clear() and ga_grow().
+ */
+typedef struct growarray
+{
+ int ga_len; /* current number of items used */
+ int ga_room; /* number of unused items at the end */
+ int ga_itemsize; /* sizeof one item */
+ int ga_growsize; /* number of items to grow each time */
+ void *ga_data; /* pointer to the first item */
+} garray_T;
+
+#define GA_EMPTY {0, 0, 0, 0, NULL}
+
+/*
+ * This is here because regexp.h needs pos_T and below regprog_T is used.
+ */
+#include "regexp.h"
+
+typedef struct window win_T;
+typedef struct wininfo wininfo_T;
+typedef struct frame frame_T;
+typedef int scid_T; /* script ID */
+
+/*
+ * This is here because gui.h needs the pos_T and win_T, and win_T needs gui.h
+ * for scrollbar_T.
+ */
+#ifdef FEAT_GUI
+# include "gui.h"
+#else
+# ifdef FEAT_XCLIPBOARD
+# include <X11/Intrinsic.h>
+# endif
+# define guicolor_T int /* avoid error in prototypes */
+#endif
+
+/*
+ * marks: positions in a file
+ * (a normal mark is a lnum/col pair, the same as a file position)
+ */
+
+/* (Note: for EBCDIC there are more than 26, because there are gaps in the
+ * alphabet coding. To minimize changes to the code, I decided to just
+ * increase the number of possible marks. */
+#define NMARKS ('z' - 'a' + 1) /* max. # of named marks */
+#define JUMPLISTSIZE 100 /* max. # of marks in jump list */
+#define TAGSTACKSIZE 20 /* max. # of tags in tag stack */
+
+typedef struct filemark
+{
+ pos_T mark; /* cursor position */
+ int fnum; /* file number */
+} fmark_T;
+
+/* Xtended file mark: also has a file name */
+typedef struct xfilemark
+{
+ fmark_T fmark;
+ char_u *fname; /* file name, used when fnum == 0 */
+} xfmark_T;
+
+/*
+ * The taggy struct is used to store the information about a :tag command.
+ */
+typedef struct taggy
+{
+ char_u *tagname; /* tag name */
+ fmark_T fmark; /* cursor position BEFORE ":tag" */
+ int cur_match; /* match number */
+ int cur_fnum; /* buffer number used for cur_match */
+} taggy_T;
+
+/*
+ * Structure that contains all options that are local to a window.
+ * Used twice in a window: for the current buffer and for all buffers.
+ * Also used in wininfo_T.
+ */
+typedef struct
+{
+#ifdef FEAT_ARABIC
+ int wo_arab;
+# define w_p_arab w_onebuf_opt.wo_arab /* 'arabic' */
+#endif
+#ifdef FEAT_DIFF
+ int wo_diff;
+# define w_p_diff w_onebuf_opt.wo_diff /* 'diff' */
+#endif
+#ifdef FEAT_FOLDING
+ long wo_fdc;
+# define w_p_fdc w_onebuf_opt.wo_fdc /* 'foldcolumn' */
+ int wo_fen;
+# define w_p_fen w_onebuf_opt.wo_fen /* 'foldenable' */
+ char_u *wo_fdi;
+# define w_p_fdi w_onebuf_opt.wo_fdi /* 'foldignore' */
+ long wo_fdl;
+# define w_p_fdl w_onebuf_opt.wo_fdl /* 'foldlevel' */
+ char_u *wo_fdm;
+# define w_p_fdm w_onebuf_opt.wo_fdm /* 'foldmethod' */
+ long wo_fml;
+# define w_p_fml w_onebuf_opt.wo_fml /* 'foldminlines' */
+ long wo_fdn;
+# define w_p_fdn w_onebuf_opt.wo_fdn /* 'foldnextmax' */
+# ifdef FEAT_EVAL
+ char_u *wo_fde;
+# define w_p_fde w_onebuf_opt.wo_fde /* 'foldexpr' */
+ char_u *wo_fdt;
+# define w_p_fdt w_onebuf_opt.wo_fdt /* 'foldtext' */
+# endif
+ char_u *wo_fmr;
+# define w_p_fmr w_onebuf_opt.wo_fmr /* 'foldmarker' */
+#endif
+#ifdef FEAT_LINEBREAK
+ int wo_lbr;
+# define w_p_lbr w_onebuf_opt.wo_lbr /* 'linebreak' */
+#endif
+ int wo_list;
+#define w_p_list w_onebuf_opt.wo_list /* 'list' */
+ int wo_nu;
+#define w_p_nu w_onebuf_opt.wo_nu /* 'number' */
+#if defined(FEAT_WINDOWS)
+ int wo_wfh;
+# define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ int wo_pvw;
+# define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */
+#endif
+#ifdef FEAT_RIGHTLEFT
+ int wo_rl;
+# define w_p_rl w_onebuf_opt.wo_rl /* 'rightleft' */
+ char_u *wo_rlc;
+# define w_p_rlc w_onebuf_opt.wo_rlc /* 'rightleftcmd' */
+#endif
+ long wo_scr;
+#define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */
+#ifdef FEAT_SCROLLBIND
+ int wo_scb;
+# define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */
+#endif
+ int wo_wrap;
+#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */
+} winopt_T;
+
+/*
+ * Window info stored with a buffer.
+ *
+ * Two types of info are kept for a buffer which are associated with a
+ * specific window:
+ * 1. Each window can have a different line number associated with a buffer.
+ * 2. The window-local options for a buffer work in a similar way.
+ * The window-info is kept in a list at b_wininfo. It is kept in
+ * most-recently-used order.
+ */
+struct wininfo
+{
+ wininfo_T *wi_next; /* next entry or NULL for last entry */
+ wininfo_T *wi_prev; /* previous entry or NULL for first entry */
+ win_T *wi_win; /* pointer to window that did set wi_lnum */
+ pos_T wi_fpos; /* last cursor position in the file */
+ int wi_optset; /* TRUE when wi_opt has useful values */
+ winopt_T wi_opt; /* local window options */
+#ifdef FEAT_FOLDING
+ int wi_fold_manual; /* copy of w_fold_manual */
+ garray_T wi_folds; /* clone of w_folds */
+#endif
+};
+
+/*
+ * Info used to pass info about a fold from the fold-detection code to the
+ * code that displays the foldcolumn.
+ */
+typedef struct foldinfo
+{
+ int fi_level; /* level of the fold; when this is zero the
+ other fields are invalid */
+ int fi_lnum; /* line number where fold starts */
+ int fi_low_level; /* lowest fold level that starts in the same
+ line */
+} foldinfo_T;
+
+/*
+ * stuctures used for undo
+ */
+
+typedef struct u_entry u_entry_T;
+typedef struct u_header u_header_T;
+struct u_entry
+{
+ u_entry_T *ue_next; /* pointer to next entry in list */
+ linenr_T ue_top; /* number of line above undo block */
+ linenr_T ue_bot; /* number of line below undo block */
+ linenr_T ue_lcount; /* linecount when u_save called */
+ char_u **ue_array; /* array of lines in undo block */
+ long ue_size; /* number of lines in ue_array */
+};
+
+struct u_header
+{
+ u_header_T *uh_next; /* pointer to next header in list */
+ u_header_T *uh_prev; /* pointer to previous header in list */
+ u_entry_T *uh_entry; /* pointer to first entry */
+ u_entry_T *uh_getbot_entry; /* pointer to where ue_bot must be set */
+ pos_T uh_cursor; /* cursor position before saving */
+#ifdef FEAT_VIRTUALEDIT
+ long uh_cursor_vcol;
+#endif
+ int uh_flags; /* see below */
+ pos_T uh_namedm[NMARKS]; /* marks before undo/after redo */
+};
+
+/* values for uh_flags */
+#define UH_CHANGED 0x01 /* b_changed flag before undo/after redo */
+#define UH_EMPTYBUF 0x02 /* buffer was empty */
+
+/*
+ * stuctures used in undo.c
+ */
+#if SIZEOF_INT > 2
+# define ALIGN_LONG /* longword alignment and use filler byte */
+# define ALIGN_SIZE (sizeof(long))
+#else
+# define ALIGN_SIZE (sizeof(short))
+#endif
+
+#define ALIGN_MASK (ALIGN_SIZE - 1)
+
+typedef struct m_info minfo_T;
+
+/*
+ * stucture used to link chunks in one of the free chunk lists.
+ */
+struct m_info
+{
+#ifdef ALIGN_LONG
+ long_u m_size; /* size of the chunk (including m_info) */
+#else
+ short_u m_size; /* size of the chunk (including m_info) */
+#endif
+ minfo_T *m_next; /* pointer to next free chunk in the list */
+};
+
+/*
+ * structure used to link blocks in the list of allocated blocks.
+ */
+typedef struct m_block mblock_T;
+struct m_block
+{
+ mblock_T *mb_next; /* pointer to next allocated block */
+ size_t mb_size; /* total size of all chunks in this block */
+ minfo_T mb_info; /* head of free chuck list for this block */
+};
+
+/*
+ * things used in memfile.c
+ */
+
+typedef struct block_hdr bhdr_T;
+typedef struct memfile memfile_T;
+typedef long blocknr_T;
+
+/*
+ * for each (previously) used block in the memfile there is one block header.
+ *
+ * The block may be linked in the used list OR in the free list.
+ * The used blocks are also kept in hash lists.
+ *
+ * The used list is a doubly linked list, most recently used block first.
+ * The blocks in the used list have a block of memory allocated.
+ * mf_used_count is the number of pages in the used list.
+ * The hash lists are used to quickly find a block in the used list.
+ * The free list is a single linked list, not sorted.
+ * The blocks in the free list have no block of memory allocated and
+ * the contents of the block in the file (if any) is irrelevant.
+ */
+
+struct block_hdr
+{
+ bhdr_T *bh_next; /* next block_hdr in free or used list */
+ bhdr_T *bh_prev; /* previous block_hdr in used list */
+ bhdr_T *bh_hash_next; /* next block_hdr in hash list */
+ bhdr_T *bh_hash_prev; /* previous block_hdr in hash list */
+ blocknr_T bh_bnum; /* block number */
+ char_u *bh_data; /* pointer to memory (for used block) */
+ int bh_page_count; /* number of pages in this block */
+
+#define BH_DIRTY 1
+#define BH_LOCKED 2
+ char bh_flags; /* BH_DIRTY or BH_LOCKED */
+};
+
+/*
+ * when a block with a negative number is flushed to the file, it gets
+ * a positive number. Because the reference to the block is still the negative
+ * number, we remember the translation to the new positive number in the
+ * double linked trans lists. The structure is the same as the hash lists.
+ */
+typedef struct nr_trans NR_TRANS;
+
+struct nr_trans
+{
+ NR_TRANS *nt_next; /* next nr_trans in hash list */
+ NR_TRANS *nt_prev; /* previous nr_trans in hash list */
+ blocknr_T nt_old_bnum; /* old, negative, number */
+ blocknr_T nt_new_bnum; /* new, positive, number */
+};
+
+/*
+ * structure used to store one block of the stuff/redo/recording buffers
+ */
+struct buffblock
+{
+ struct buffblock *b_next; /* pointer to next buffblock */
+ char_u b_str[1]; /* contents (actually longer) */
+};
+
+/*
+ * header used for the stuff buffer and the redo buffer
+ */
+struct buffheader
+{
+ struct buffblock bh_first; /* first (dummy) block of list */
+ struct buffblock *bh_curr; /* buffblock for appending */
+ int bh_index; /* index for reading */
+ int bh_space; /* space in bh_curr for appending */
+};
+
+/*
+ * used for completion on the command line
+ */
+typedef struct expand
+{
+ int xp_context; /* type of expansion */
+ char_u *xp_pattern; /* start of item to expand */
+#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+ char_u *xp_arg; /* completion function */
+ int xp_scriptID; /* SID for completion function */
+#endif
+ int xp_backslash; /* one of the XP_BS_ values */
+ int xp_numfiles; /* number of files found by
+ file name completion */
+ char_u **xp_files; /* list of files */
+} expand_T;
+
+/* values for xp_backslash */
+#define XP_BS_NONE 0 /* nothing special for backslashes */
+#define XP_BS_ONE 1 /* uses one backslash before a space */
+#define XP_BS_THREE 2 /* uses three backslashes before a space */
+
+/*
+ * Command modifiers ":vertical", ":browse", ":confirm" and ":hide" set a flag.
+ * This needs to be saved for recursive commands, put them in a structure for
+ * easy manipulation.
+ */
+typedef struct
+{
+ int hide; /* TRUE when ":hide" was used */
+# ifdef FEAT_BROWSE
+ int browse; /* TRUE to invoke file dialog */
+# endif
+# ifdef FEAT_WINDOWS
+ int split; /* flags for win_split() */
+# endif
+# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ int confirm; /* TRUE to invoke yes/no dialog */
+# endif
+ int keepmarks; /* TRUE when ":keepmarks" was used */
+ int keepjumps; /* TRUE when ":keepjumps" was used */
+ int lockmarks; /* TRUE when ":lockmarks" was used */
+} cmdmod_T;
+
+/*
+ * Simplistic hashing scheme to quickly locate the blocks in the used list.
+ * 64 blocks are found directly (64 * 4K = 256K, most files are smaller).
+ */
+#define MEMHASHSIZE 64
+#define MEMHASH(nr) ((nr) & (MEMHASHSIZE - 1))
+
+struct memfile
+{
+ char_u *mf_fname; /* name of the file */
+ char_u *mf_ffname; /* idem, full path */
+ int mf_fd; /* file descriptor */
+ bhdr_T *mf_free_first; /* first block_hdr in free list */
+ bhdr_T *mf_used_first; /* mru block_hdr in used list */
+ bhdr_T *mf_used_last; /* lru block_hdr in used list */
+ unsigned mf_used_count; /* number of pages in used list */
+ unsigned mf_used_count_max; /* maximum number of pages in memory */
+ bhdr_T *mf_hash[MEMHASHSIZE]; /* array of hash lists */
+ NR_TRANS *mf_trans[MEMHASHSIZE]; /* array of trans lists */
+ blocknr_T mf_blocknr_max; /* highest positive block number + 1*/
+ blocknr_T mf_blocknr_min; /* lowest negative block number - 1 */
+ blocknr_T mf_neg_count; /* number of negative blocks numbers */
+ blocknr_T mf_infile_count; /* number of pages in the file */
+ unsigned mf_page_size; /* number of bytes in a page */
+ int mf_dirty; /* TRUE if there are dirty blocks */
+};
+
+/*
+ * things used in memline.c
+ */
+/*
+ * When searching for a specific line, we remember what blocks in the tree
+ * are the branches leading to that block. This is stored in ml_stack. Each
+ * entry is a pointer to info in a block (may be data block or pointer block)
+ */
+typedef struct info_pointer
+{
+ blocknr_T ip_bnum; /* block number */
+ linenr_T ip_low; /* lowest lnum in this block */
+ linenr_T ip_high; /* highest lnum in this block */
+ int ip_index; /* index for block with current lnum */
+} infoptr_T; /* block/index pair */
+
+#ifdef FEAT_BYTEOFF
+typedef struct ml_chunksize
+{
+ int mlcs_numlines;
+ long mlcs_totalsize;
+} chunksize_T;
+
+ /* Flags when calling ml_updatechunk() */
+
+#define ML_CHNK_ADDLINE 1
+#define ML_CHNK_DELLINE 2
+#define ML_CHNK_UPDLINE 3
+#endif
+
+/*
+ * the memline structure holds all the information about a memline
+ */
+typedef struct memline
+{
+ linenr_T ml_line_count; /* number of lines in the buffer */
+
+ memfile_T *ml_mfp; /* pointer to associated memfile */
+
+#define ML_EMPTY 1 /* empty buffer */
+#define ML_LINE_DIRTY 2 /* cached line was changed and allocated */
+#define ML_LOCKED_DIRTY 4 /* ml_locked was changed */
+#define ML_LOCKED_POS 8 /* ml_locked needs positive block number */
+ int ml_flags;
+
+ infoptr_T *ml_stack; /* stack of pointer blocks (array of IPTRs) */
+ int ml_stack_top; /* current top if ml_stack */
+ int ml_stack_size; /* total number of entries in ml_stack */
+
+ linenr_T ml_line_lnum; /* line number of cached line, 0 if not valid */
+ char_u *ml_line_ptr; /* pointer to cached line */
+
+ bhdr_T *ml_locked; /* block used by last ml_get */
+ linenr_T ml_locked_low; /* first line in ml_locked */
+ linenr_T ml_locked_high; /* last line in ml_locked */
+ int ml_locked_lineadd; /* number of lines inserted in ml_locked */
+#ifdef FEAT_BYTEOFF
+ chunksize_T *ml_chunksize;
+ int ml_numchunks;
+ int ml_usedchunks;
+#endif
+} memline_T;
+
+#if defined(FEAT_SIGNS) || defined(PROTO)
+typedef struct signlist signlist_T;
+
+struct signlist
+{
+ int id; /* unique identifier for each placed sign */
+ linenr_T lnum; /* line number which has this sign */
+ int typenr; /* typenr of sign */
+ signlist_T *next; /* next signlist entry */
+# ifdef FEAT_NETBEANS_INTG
+ signlist_T *prev; /* previous entry -- for easy reordering */
+# endif
+};
+
+/* type argument for buf_getsigntype() */
+#define SIGN_ANY 0
+#define SIGN_LINEHL 1
+#define SIGN_ICON 2
+#define SIGN_TEXT 3
+#endif
+
+/*
+ * Argument list: Array of file names.
+ * Used for the global argument list and the argument lists local to a window.
+ */
+typedef struct arglist
+{
+ garray_T al_ga; /* growarray with the array of file names */
+ int al_refcount; /* number of windows using this arglist */
+} alist_T;
+
+/*
+ * For each argument remember the file name as it was given, and the buffer
+ * number that contains the expanded file name (required for when ":cd" is
+ * used.
+ */
+typedef struct argentry
+{
+ char_u *ae_fname; /* file name as specified */
+ int ae_fnum; /* buffer number with expanded file name */
+} aentry_T;
+
+#ifdef FEAT_WINDOWS
+# define ALIST(win) (win)->w_alist
+#else
+# define ALIST(win) (&global_alist)
+#endif
+#define GARGLIST ((aentry_T *)global_alist.al_ga.ga_data)
+#define ARGLIST ((aentry_T *)ALIST(curwin)->al_ga.ga_data)
+#define WARGLIST(wp) ((aentry_T *)ALIST(wp)->al_ga.ga_data)
+#define AARGLIST(al) ((aentry_T *)((al)->al_ga.ga_data))
+#define GARGCOUNT (global_alist.al_ga.ga_len)
+#define ARGCOUNT (ALIST(curwin)->al_ga.ga_len)
+#define WARGCOUNT(wp) (ALIST(wp)->al_ga.ga_len)
+
+/*
+ * A list used for saving values of "emsg_silent". Used by ex_try() to save the
+ * value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT
+ * flag below is set.
+ */
+
+typedef struct eslist_elem eslist_T;
+struct eslist_elem
+{
+ int saved_emsg_silent; /* saved value of "emsg_silent" */
+ eslist_T *next; /* next element on the list */
+};
+
+/*
+ * For conditional commands a stack is kept of nested conditionals.
+ * When cs_idx < 0, there is no conditional command.
+ */
+#define CSTACK_LEN 50
+
+struct condstack
+{
+ char cs_flags[CSTACK_LEN]; /* CSF_ flags */
+ char cs_pending[CSTACK_LEN]; /* CSTP_: what's pending in ":finally"*/
+ union {
+ void *cs_pend_rv[CSTACK_LEN]; /* returnval for pending return */
+ void *cs_pend_ex[CSTACK_LEN]; /* exception for pending throw */
+ } cs_pend;
+ int cs_line[CSTACK_LEN]; /* line number of ":while" line */
+ int cs_idx; /* current entry, or -1 if none */
+ int cs_whilelevel; /* number of nested ":while"s */
+ int cs_trylevel; /* number of nested ":try"s */
+ eslist_T *cs_emsg_silent_list; /* saved values of "emsg_silent" */
+ char cs_had_while; /* just found ":while" */
+ char cs_had_continue; /* just found ":continue" */
+ char cs_had_endwhile; /* just found ":endwhile" */
+ char cs_had_finally; /* just found ":finally" */
+};
+# define cs_retvar cs_pend.cs_pend_rv
+# define cs_exception cs_pend.cs_pend_ex
+
+# define CSF_TRUE 1 /* condition was TRUE */
+# define CSF_ACTIVE 2 /* current state is active */
+# define CSF_ELSE 4 /* ":else" has been passed */
+# define CSF_WHILE 8 /* is a ":while" */
+# define CSF_TRY 16 /* is a ":try" */
+# define CSF_FINALLY 32 /* ":finally" has been passed */
+# define CSF_THROWN 64 /* exception thrown to this try conditional */
+# define CSF_CAUGHT 128 /* exception caught by this try conditional */
+# define CSF_SILENT 4 /* "emsg_silent" reset by ":try" */
+/* Note that CSF_ELSE is only used when CSF_TRY and CSF_WHILE are unset
+ * (an ":if"), and CSF_SILENT is only used when CSF_TRY is set. */
+
+/*
+ * What's pending for being reactivated at the ":endtry" of this try
+ * conditional:
+ */
+# define CSTP_NONE 0 /* nothing pending in ":finally" clause */
+# define CSTP_ERROR 1 /* an error is pending */
+# define CSTP_INTERRUPT 2 /* an interrupt is pending */
+# define CSTP_THROW 4 /* a throw is pending */
+# define CSTP_BREAK 8 /* ":break" is pending */
+# define CSTP_CONTINUE 16 /* ":continue" is pending */
+# define CSTP_RETURN 24 /* ":return" is pending */
+# define CSTP_FINISH 32 /* ":finish" is pending */
+
+/*
+ * A list of error messages that can be converted to an exception. "throw_msg"
+ * is only set in the first element of the list. Usually, it points to the
+ * original message stored in that element, but sometimes it points to a later
+ * message in the list. See cause_errthrow() below.
+ */
+struct msglist
+{
+ char_u *msg; /* original message */
+ char_u *throw_msg; /* msg to throw: usually original one */
+ struct msglist *next; /* next of several messages in a row */
+};
+
+/*
+ * Structure describing an exception.
+ * (don't use "struct exception", it's used by the math library).
+ */
+typedef struct vim_exception except_T;
+struct vim_exception
+{
+ int type; /* exception type */
+ char_u *value; /* exception value */
+ struct msglist *messages; /* message(s) causing error exception */
+ char_u *throw_name; /* name of the throw point */
+ linenr_T throw_lnum; /* line number of the throw point */
+ except_T *caught; /* next exception on the caught stack */
+};
+
+/*
+ * The exception types.
+ */
+#define ET_USER 0 /* exception caused by ":throw" command */
+#define ET_ERROR 1 /* error exception */
+#define ET_INTERRUPT 2 /* interrupt exception triggered by Ctrl-C */
+
+
+#ifdef FEAT_SYN_HL
+/* struct passed to in_id_list() */
+struct sp_syn
+{
+ int inc_tag; /* ":syn include" unique tag */
+ short id; /* highlight group ID of item */
+ short *cont_in_list; /* cont.in group IDs, if non-zero */
+};
+
+/*
+ * Each keyword has one keyentry, which is linked in a hash list.
+ */
+typedef struct keyentry keyentry_T;
+
+struct keyentry
+{
+ keyentry_T *next; /* next keyword in the hash list */
+ struct sp_syn k_syn; /* struct passed to in_id_list() */
+ short *next_list; /* ID list for next match (if non-zero) */
+ short flags; /* see syntax.c */
+ char_u keyword[1]; /* actually longer */
+};
+
+/*
+ * Struct used to store one state of the state stack.
+ */
+typedef struct buf_state
+{
+ int bs_idx; /* index of pattern */
+ long bs_flags; /* flags for pattern */
+ reg_extmatch_T *bs_extmatch; /* external matches from start pattern */
+} bufstate_T;
+
+/*
+ * syn_state contains the syntax state stack for the start of one line.
+ * Used by b_sst_array[].
+ */
+typedef struct syn_state synstate_T;
+
+struct syn_state
+{
+ synstate_T *sst_next; /* next entry in used or free list */
+ linenr_T sst_lnum; /* line number for this state */
+ union
+ {
+ bufstate_T sst_stack[SST_FIX_STATES]; /* short state stack */
+ garray_T sst_ga; /* growarray for long state stack */
+ } sst_union;
+ int sst_next_flags; /* flags for sst_next_list */
+ short *sst_next_list; /* "nextgroup" list in this state
+ * (this is a copy, don't free it! */
+ short sst_stacksize; /* number of states on the stack */
+ disptick_T sst_tick; /* tick when last displayed */
+ linenr_T sst_change_lnum;/* when non-zero, change in this line
+ * may have made the state invalid */
+};
+#endif /* FEAT_SYN_HL */
+
+/*
+ * Structure shared between syntax.c, screen.c and gui_x11.c.
+ */
+typedef struct attr_entry
+{
+ short ae_attr; /* HL_BOLD, etc. */
+ union
+ {
+ struct
+ {
+ char_u *start; /* start escape sequence */
+ char_u *stop; /* stop escape sequence */
+ } term;
+ struct
+ {
+ char_u fg_color; /* foreground color number */
+ char_u bg_color; /* background color number */
+ } cterm;
+# ifdef FEAT_GUI
+ struct
+ {
+ guicolor_T fg_color; /* foreground color handle */
+ guicolor_T bg_color; /* background color handle */
+ GuiFont font; /* font handle */
+# ifdef FEAT_XFONTSET
+ GuiFontset fontset; /* fontset handle */
+# endif
+ } gui;
+# endif
+ } ae_u;
+} attrentry_T;
+
+#ifdef USE_ICONV
+# ifdef HAVE_ICONV_H
+# include <iconv.h>
+# else
+# if defined(MACOS_X)
+# include <sys/errno.h>
+# define EILSEQ ENOENT /* MacOS X does not have EILSEQ */
+typedef struct _iconv_t *iconv_t;
+# else
+# if defined(MACOS_CLASSIC)
+typedef struct _iconv_t *iconv_t;
+# define EINVAL 22
+# define E2BIG 7
+# define ENOENT 2
+# define EFAULT 14
+# define EILSEQ 123
+# else
+# include <errno.h>
+# endif
+# endif
+typedef void *iconv_t;
+# endif
+#endif
+
+/*
+ * Used for the typeahead buffer: typebuf.
+ */
+typedef struct
+{
+ char_u *tb_buf; /* buffer for typed characters */
+ char_u *tb_noremap; /* mapping flags for characters in tb_buf[] */
+ int tb_buflen; /* size of tb_buf[] */
+ int tb_off; /* current position in tb_buf[] */
+ int tb_len; /* number of valid bytes in tb_buf[] */
+ int tb_maplen; /* nr of mapped bytes in tb_buf[] */
+ int tb_silent; /* nr of silently mapped bytes in tb_buf[] */
+ int tb_no_abbr_cnt; /* nr of bytes without abbrev. in tb_buf[] */
+ int tb_change_cnt; /* nr of time tb_buf was changed; never zero */
+} typebuf_T;
+
+/* Struct to hold the saved typeahead for save_typeahead(). */
+typedef struct
+{
+ typebuf_T save_typebuf;
+ int typebuf_valid; /* TRUE when save_typebuf valid */
+ struct buffheader save_stuffbuff;
+#ifdef USE_INPUT_BUF
+ char_u *save_inputbuf;
+#endif
+} tasave_T;
+
+/*
+ * Used for conversion of terminal I/O and script files.
+ */
+typedef struct
+{
+ int vc_type; /* zero or one of the CONV_ values */
+ int vc_factor; /* max. expansion factor */
+# ifdef WIN3264
+ int vc_cpfrom; /* codepage to convert from (CONV_CODEPAGE) */
+ int vc_cpto; /* codepage to convert to (CONV_CODEPAGE) */
+# endif
+# ifdef USE_ICONV
+ iconv_t vc_fd; /* for CONV_ICONV */
+# endif
+ int vc_fail; /* fail for invalid char, don't use '?' */
+} vimconv_T;
+
+/*
+ * Structure used for reading from the viminfo file.
+ */
+typedef struct
+{
+ char_u *vir_line; /* text of the current line */
+ FILE *vir_fd; /* file descriptor */
+#ifdef FEAT_MBYTE
+ vimconv_T vir_conv; /* encoding conversion */
+#endif
+} vir_T;
+
+#define CONV_NONE 0
+#define CONV_TO_UTF8 1
+#define CONV_TO_LATIN1 2
+#define CONV_ICONV 3
+#ifdef WIN3264
+# define CONV_CODEPAGE 4 /* codepage -> codepage */
+#endif
+#ifdef MACOS_X
+# define CONV_MAC_LATIN1 5
+# define CONV_LATIN1_MAC 6
+# define CONV_MAC_UTF8 7
+# define CONV_UTF8_MAC 8
+#endif
+
+/*
+ * Structure used for mappings and abbreviations.
+ */
+typedef struct mapblock mapblock_T;
+struct mapblock
+{
+ mapblock_T *m_next; /* next mapblock in list */
+ char_u *m_keys; /* mapped from */
+ int m_keylen; /* strlen(m_keys) */
+ char_u *m_str; /* mapped to */
+ int m_mode; /* valid mode */
+ int m_noremap; /* if non-zero no re-mapping for m_str */
+ char m_silent; /* <silent> used, don't echo commands */
+#if 0 /* Not used yet */
+ scid_T m_script_ID; /* ID of script where map was defined,
+ used for s: variables and functions */
+#endif
+};
+
+/*
+ * Used for highlighting in the status line.
+ */
+struct stl_hlrec
+{
+ char_u *start;
+ int userhl;
+};
+
+/*
+ * buffer: structure that holds information about one file
+ *
+ * Several windows can share a single Buffer
+ * A buffer is unallocated if there is no memfile for it.
+ * A buffer is new if the associated file has never been loaded yet.
+ */
+
+typedef struct file_buffer buf_T;
+
+struct file_buffer
+{
+ memline_T b_ml; /* associated memline (also contains line
+ count) */
+
+ buf_T *b_next; /* links in list of buffers */
+ buf_T *b_prev;
+
+ int b_nwindows; /* nr of windows open on this buffer */
+
+ int b_flags; /* various BF_ flags */
+
+ /*
+ * b_ffname has the full path of the file (NULL for no name).
+ * b_sfname is the name as the user typed it (or NULL).
+ * b_fname is the same as b_sfname, unless ":cd" has been done,
+ * then it is the same as b_ffname (NULL for no name).
+ */
+ char_u *b_ffname; /* full path file name */
+ char_u *b_sfname; /* short file name */
+ char_u *b_fname; /* current file name */
+
+#ifdef UNIX
+ int b_dev; /* device number (-1 if not set) */
+ ino_t b_ino; /* inode number */
+#endif
+#ifdef FEAT_CW_EDITOR
+ FSSpec b_FSSpec; /* MacOS File Identification */
+#endif
+#ifdef VMS
+ char b_fab_rfm; /* Record format */
+#endif
+#ifdef FEAT_SNIFF
+ int b_sniff; /* file was loaded through Sniff */
+#endif
+
+ int b_fnum; /* buffer number for this file. */
+
+ int b_changed; /* 'modified': Set to TRUE if something in the
+ file has been changed and not written out. */
+ int b_changedtick; /* incremented for each change, also for undo */
+
+ int b_saving; /* Set to TRUE if we are in the middle of
+ saving the buffer. */
+
+ /*
+ * Changes to a buffer require updating of the display. To minimize the
+ * work, remember changes made and update everything at once.
+ */
+ int b_mod_set; /* TRUE when there are changes since the last
+ time the display was updated */
+ linenr_T b_mod_top; /* topmost lnum that was changed */
+ linenr_T b_mod_bot; /* lnum below last changed line, AFTER the
+ change */
+ long b_mod_xlines; /* number of extra buffer lines inserted;
+ negative when lines were deleted */
+
+ wininfo_T *b_wininfo; /* list of last used info for each window */
+
+ long b_mtime; /* last change time of original file */
+ long b_mtime_read; /* last change time when reading */
+ size_t b_orig_size; /* size of original file in bytes */
+ int b_orig_mode; /* mode of original file */
+
+ pos_T b_namedm[NMARKS]; /* current named marks (mark.c) */
+
+#ifdef FEAT_VISUAL
+ /* These variables are set when VIsual_active becomes FALSE */
+ pos_T b_visual_start; /* start pos of last VIsual */
+ pos_T b_visual_end; /* end position of last VIsual */
+ int b_visual_mode; /* VIsual_mode of last VIsual */
+# ifdef FEAT_EVAL
+ int b_visual_mode_eval; /* b_visual_mode for visualmode() */
+# endif
+ colnr_T b_visual_curswant; /* MAXCOL from w_curswant */
+#endif
+
+ pos_T b_last_cursor; /* cursor position when last unloading this
+ buffer */
+ pos_T b_last_insert; /* where Insert mode was left */
+ pos_T b_last_change; /* position of last change: '. mark */
+
+#ifdef FEAT_JUMPLIST
+ /*
+ * the changelist contains old change positions
+ */
+ pos_T b_changelist[JUMPLISTSIZE];
+ int b_changelistlen; /* number of active entries */
+ int b_new_change; /* set by u_savecommon() */
+#endif
+
+ /*
+ * Character table, only used in charset.c for 'iskeyword'
+ * 32 bytes of 8 bits: 1 bit per character 0-255.
+ */
+ char_u b_chartab[32];
+
+#ifdef FEAT_LOCALMAP
+ /* Table used for mappings local to a buffer. */
+ mapblock_T *(b_maphash[256]);
+
+ /* First abbreviation local to a buffer. */
+ mapblock_T *b_first_abbr;
+#endif
+#ifdef FEAT_USR_CMDS
+ /* User commands local to the buffer. */
+ garray_T b_ucmds;
+#endif
+ /*
+ * start and end of an operator, also used for '[ and ']
+ */
+ pos_T b_op_start;
+ pos_T b_op_end;
+
+#ifdef FEAT_VIMINFO
+ int b_marks_read; /* Have we read viminfo marks yet? */
+#endif
+
+ /*
+ * The following only used in undo.c.
+ */
+ u_header_T *b_u_oldhead; /* pointer to oldest header */
+ u_header_T *b_u_newhead; /* pointer to newest header */
+ u_header_T *b_u_curhead; /* pointer to current header */
+ int b_u_numhead; /* current number of headers */
+ int b_u_synced; /* entry lists are synced */
+
+ /*
+ * variables for "U" command in undo.c
+ */
+ char_u *b_u_line_ptr; /* saved line for "U" command */
+ linenr_T b_u_line_lnum; /* line number of line in u_line */
+ colnr_T b_u_line_colnr; /* optional column number */
+
+ /*
+ * The following only used in undo.c
+ */
+ mblock_T b_block_head; /* head of allocated memory block list */
+ minfo_T *b_m_search; /* pointer to chunk before previously
+ allocated/freed chunk */
+ mblock_T *b_mb_current; /* block where m_search points in */
+#ifdef FEAT_INS_EXPAND
+ int b_scanned; /* ^N/^P have scanned this buffer */
+#endif
+
+ /* flags for use of ":lmap" and IM control */
+ long b_p_iminsert; /* input mode for insert */
+ long b_p_imsearch; /* input mode for search */
+#define B_IMODE_USE_INSERT -1 /* Use b_p_iminsert value for search */
+#define B_IMODE_NONE 0 /* Input via none */
+#define B_IMODE_LMAP 1 /* Input via langmap */
+#ifndef USE_IM_CONTROL
+# define B_IMODE_LAST 1
+#else
+# define B_IMODE_IM 2 /* Input via input method */
+# define B_IMODE_LAST 2
+#endif
+
+#ifdef FEAT_KEYMAP
+ short b_kmap_state; /* using "lmap" mappings */
+# define KEYMAP_INIT 1 /* 'keymap' was set, call keymap_init() */
+# define KEYMAP_LOADED 2 /* 'keymap' mappings have been loaded */
+ garray_T b_kmap_ga; /* the keymap table */
+#endif
+
+ /*
+ * Options local to a buffer.
+ * They are here because their value depends on the type of file
+ * or contents of the file being edited.
+ */
+ int b_p_initialized; /* set when options initialized */
+
+ int b_p_ai; /* 'autoindent' */
+ int b_p_ai_nopaste; /* b_p_ai saved for paste mode */
+ int b_p_ci; /* 'copyindent' */
+ int b_p_bin; /* 'binary' */
+#ifdef FEAT_MBYTE
+ int b_p_bomb; /* 'bomb' */
+#endif
+#if defined(FEAT_QUICKFIX)
+ char_u *b_p_bh; /* 'bufhidden' */
+ char_u *b_p_bt; /* 'buftype' */
+#endif
+ int b_p_bl; /* 'buflisted' */
+#ifdef FEAT_CINDENT
+ int b_p_cin; /* 'cindent' */
+ char_u *b_p_cino; /* 'cinoptions' */
+ char_u *b_p_cink; /* 'cinkeys' */
+#endif
+#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
+ char_u *b_p_cinw; /* 'cinwords' */
+#endif
+#ifdef FEAT_COMMENTS
+ char_u *b_p_com; /* 'comments' */
+#endif
+#ifdef FEAT_FOLDING
+ char_u *b_p_cms; /* 'commentstring' */
+#endif
+#ifdef FEAT_INS_EXPAND
+ char_u *b_p_cpt; /* 'complete' */
+#endif
+ int b_p_eol; /* 'endofline' */
+ int b_p_et; /* 'expandtab' */
+ int b_p_et_nobin; /* b_p_et saved for binary mode */
+#ifdef FEAT_MBYTE
+ char_u *b_p_fenc; /* 'fileencoding' */
+#endif
+ char_u *b_p_ff; /* 'fileformat' */
+#ifdef FEAT_AUTOCMD
+ char_u *b_p_ft; /* 'filetype' */
+#endif
+ char_u *b_p_fo; /* 'formatoptions' */
+ int b_p_inf; /* 'infercase' */
+ char_u *b_p_isk; /* 'iskeyword' */
+#ifdef FEAT_FIND_ID
+ char_u *b_p_def; /* 'define' local value */
+ char_u *b_p_inc; /* 'include' */
+# ifdef FEAT_EVAL
+ char_u *b_p_inex; /* 'includeexpr' */
+# endif
+#endif
+#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
+ char_u *b_p_inde; /* 'indentexpr' */
+ char_u *b_p_indk; /* 'indentkeys' */
+#endif
+#ifdef FEAT_CRYPT
+ char_u *b_p_key; /* 'key' */
+#endif
+ char_u *b_p_kp; /* 'keywordprg' */
+#ifdef FEAT_LISP
+ int b_p_lisp; /* 'lisp' */
+#endif
+ char_u *b_p_mps; /* 'matchpairs' */
+ int b_p_ml; /* 'modeline' */
+ int b_p_ml_nobin; /* b_p_ml saved for binary mode */
+ int b_p_ma; /* 'modifiable' */
+ char_u *b_p_nf; /* 'nrformats' */
+#ifdef FEAT_OSFILETYPE
+ char_u *b_p_oft; /* 'osfiletype' */
+#endif
+ int b_p_pi; /* 'preserveindent' */
+ int b_p_ro; /* 'readonly' */
+ long b_p_sw; /* 'shiftwidth' */
+#ifndef SHORT_FNAME
+ int b_p_sn; /* 'shortname' */
+#endif
+#ifdef FEAT_SMARTINDENT
+ int b_p_si; /* 'smartindent' */
+#endif
+ long b_p_sts; /* 'softtabstop' */
+ long b_p_sts_nopaste; /* b_p_sts saved for paste mode */
+#ifdef FEAT_SEARCHPATH
+ char_u *b_p_sua; /* 'suffixesadd' */
+#endif
+ int b_p_swf; /* 'swapfile' */
+#ifdef FEAT_SYN_HL
+ char_u *b_p_syn; /* 'syntax' */
+#endif
+ long b_p_ts; /* 'tabstop' */
+ int b_p_tx; /* 'textmode' */
+ long b_p_tw; /* 'textwidth' */
+ long b_p_tw_nobin; /* b_p_tw saved for binary mode */
+ long b_p_tw_nopaste; /* b_p_tw saved for paste mode */
+ long b_p_wm; /* 'wrapmargin' */
+ long b_p_wm_nobin; /* b_p_wm saved for binary mode */
+ long b_p_wm_nopaste; /* b_p_wm saved for paste mode */
+#ifdef FEAT_KEYMAP
+ char_u *b_p_keymap; /* 'keymap' */
+#endif
+
+ /* local values for options which are normally global */
+#ifdef FEAT_QUICKFIX
+ char_u *b_p_gp; /* 'grepprg' local value */
+ char_u *b_p_mp; /* 'makeprg' local value */
+ char_u *b_p_efm; /* 'errorformat' local value */
+#endif
+ char_u *b_p_ep; /* 'equalprg' local value */
+ char_u *b_p_path; /* 'path' local value */
+ int b_p_ar; /* 'autoread' local value */
+ char_u *b_p_tags; /* 'tags' local value */
+#ifdef FEAT_INS_EXPAND
+ char_u *b_p_dict; /* 'dictionary' local value */
+ char_u *b_p_tsr; /* 'thesaurus' local value */
+#endif
+
+ /* end of buffer options */
+
+ int b_start_eol; /* last line had eol when it was read */
+ int b_start_ffc; /* first char of 'ff' when edit started */
+#ifdef FEAT_MBYTE
+ char_u *b_start_fenc; /* 'fileencoding' when edit started or NULL */
+#endif
+
+#ifdef FEAT_EVAL
+ garray_T b_vars; /* internal variables, local to buffer */
+#endif
+
+ /* When a buffer is created, it starts without a swap file. b_may_swap is
+ * then set to indicate that a swap file may be opened later. It is reset
+ * if a swap file could not be opened.
+ */
+ int b_may_swap;
+ int b_did_warn; /* Set to 1 if user has been warned on first
+ change of a read-only file */
+ int b_help; /* buffer for help file (when set b_p_bt is
+ "help") */
+
+#ifndef SHORT_FNAME
+ int b_shortname; /* this file has an 8.3 file name */
+#endif
+
+#ifdef FEAT_PERL
+ void *perl_private;
+#endif
+
+#ifdef FEAT_PYTHON
+ void *python_ref; /* The Python value referring to this buffer */
+#endif
+
+#ifdef FEAT_TCL
+ void *tcl_ref;
+#endif
+
+#ifdef FEAT_RUBY
+ void *ruby_ref;
+#endif
+
+#ifdef FEAT_SYN_HL
+ keyentry_T **b_keywtab; /* syntax keywords hash table */
+ keyentry_T **b_keywtab_ic; /* idem, ignore case */
+ int b_syn_ic; /* ignore case for :syn cmds */
+ garray_T b_syn_patterns; /* table for syntax patterns */
+ garray_T b_syn_clusters; /* table for syntax clusters */
+ int b_syn_containedin; /* TRUE when there is an item with a
+ "containedin" argument */
+ int b_syn_sync_flags; /* flags about how to sync */
+ short b_syn_sync_id; /* group to sync on */
+ long b_syn_sync_minlines; /* minimal sync lines offset */
+ long b_syn_sync_maxlines; /* maximal sync lines offset */
+ long b_syn_sync_linebreaks; /* offset for multi-line pattern */
+ char_u *b_syn_linecont_pat; /* line continuation pattern */
+ regprog_T *b_syn_linecont_prog; /* line continuation program */
+ int b_syn_linecont_ic; /* ignore-case flag for above */
+ int b_syn_topgrp; /* for ":syntax include" */
+# ifdef FEAT_FOLDING
+ int b_syn_folditems; /* number of patterns with the HL_FOLD
+ flag set */
+# endif
+/*
+ * b_sst_array[] contains the state stack for a number of lines, for the start
+ * of that line (col == 0). This avoids having to recompute the syntax state
+ * too often.
+ * b_sst_array[] is allocated to hold the state for all displayed lines, and
+ * states for 1 out of about 20 other lines.
+ * b_sst_array pointer to an array of synstate_T
+ * b_sst_len number of entries in b_sst_array[]
+ * b_sst_first pointer to first used entry in b_sst_array[] or NULL
+ * b_sst_firstfree pointer to first free entry in b_sst_array[] or NULL
+ * b_sst_freecount number of free entries in b_sst_array[]
+ * b_sst_check_lnum entries after this lnum need to be checked for
+ * validity (MAXLNUM means no check needed)
+ */
+ synstate_T *b_sst_array;
+ int b_sst_len;
+ synstate_T *b_sst_first;
+ synstate_T *b_sst_firstfree;
+ int b_sst_freecount;
+ linenr_T b_sst_check_lnum;
+ short_u b_sst_lasttick; /* last display tick */
+#endif /* FEAT_SYN_HL */
+
+#ifdef FEAT_SIGNS
+ signlist_T *b_signlist; /* list of signs to draw */
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ int b_netbeans_file; /* TRUE when buffer is owned by NetBeans */
+ int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */
+#endif
+
+};
+
+/*
+ * Structure to cache info for displayed lines in w_lines[].
+ * Each logical line has one entry.
+ * The entry tells how the logical line is currently displayed in the window.
+ * This is updated when displaying the window.
+ * When the display is changed (e.g., when clearing the screen) w_lines_valid
+ * is changed to exclude invalid entries.
+ * When making changes to the buffer, wl_valid is reset to indicate wl_size
+ * may not reflect what is actually in the buffer. When wl_valid is FALSE,
+ * the entries can only be used to count the number of displayed lines used.
+ * wl_lnum and wl_lastlnum are invalid too.
+ */
+typedef struct w_line
+{
+ linenr_T wl_lnum; /* buffer line number for logical line */
+ short_u wl_size; /* height in screen lines */
+ char wl_valid; /* TRUE values are valid for text in buffer */
+#ifdef FEAT_FOLDING
+ char wl_folded; /* TRUE when this is a range of folded lines */
+ linenr_T wl_lastlnum; /* last buffer line number for logical line */
+#endif
+} wline_T;
+
+/*
+ * Windows are kept in a tree of frames. Each frame has a column (FR_COL)
+ * or row (FR_ROW) layout or is a leaf, which has a window.
+ */
+struct frame
+{
+ char fr_layout; /* FR_LEAF, FR_COL or FR_ROW */
+#ifdef FEAT_VERTSPLIT
+ int fr_width;
+#endif
+ int fr_height;
+ int fr_newheight; /* new height used in win_equal_rec() */
+ frame_T *fr_parent; /* containing frame or NULL */
+ frame_T *fr_next; /* frame right or below in same parent, NULL
+ for first */
+ frame_T *fr_prev; /* frame left or above in same parent, NULL
+ for last */
+ /* fr_child and fr_win are mutually exclusive */
+ frame_T *fr_child; /* first contained frame */
+ win_T *fr_win; /* window that fills this frame */
+};
+
+#define FR_LEAF 0 /* frame is a leaf */
+#define FR_ROW 1 /* frame with a row of windows */
+#define FR_COL 2 /* frame with a column of windows */
+
+/*
+ * Structure which contains all information that belongs to a window
+ *
+ * All row numbers are relative to the start of the window, except w_winrow.
+ */
+struct window
+{
+ buf_T *w_buffer; /* buffer we are a window into (used
+ often, keep it the first item!) */
+
+#ifdef FEAT_WINDOWS
+ win_T *w_prev; /* link to previous window */
+ win_T *w_next; /* link to next window */
+#endif
+
+ frame_T *w_frame; /* frame containing this window */
+
+ pos_T w_cursor; /* cursor position in buffer */
+
+ colnr_T w_curswant; /* The column we'd like to be at. This is
+ used to try to stay in the same column
+ for up/down cursor motions. */
+
+ int w_set_curswant; /* If set, then update w_curswant the next
+ time through cursupdate() to the
+ current virtual column */
+
+#ifdef FEAT_VISUAL
+ /*
+ * the next six are used to update the visual part
+ */
+ char w_old_visual_mode; /* last known VIsual_mode */
+ linenr_T w_old_cursor_lnum; /* last known end of visual part */
+ colnr_T w_old_cursor_fcol; /* first column for block visual part */
+ colnr_T w_old_cursor_lcol; /* last column for block visual part */
+ linenr_T w_old_visual_lnum; /* last known start of visual part */
+ colnr_T w_old_curswant; /* last known value of Curswant */
+#endif
+
+ /*
+ * The next three specify the offsets for displaying the buffer:
+ */
+ linenr_T w_topline; /* buffer line number of the line at the
+ top of the window */
+#ifdef FEAT_DIFF
+ int w_topfill; /* number of filler lines above w_topline */
+ int w_old_topfill; /* w_topfill at last redraw */
+ int w_botfill; /* TRUE when filler lines are actually
+ below w_topline (at end of file) */
+ int w_old_botfill; /* w_botfill at last redraw */
+#endif
+ colnr_T w_leftcol; /* window column number of the left most
+ character in the window; used when
+ 'wrap' is off */
+ colnr_T w_skipcol; /* starting column when a single line
+ doesn't fit in the window */
+
+ /*
+ * Layout of the window in the screen.
+ * May need to add "msg_scrolled" to "w_winrow" in rare situations.
+ */
+#ifdef FEAT_WINDOWS
+ int w_winrow; /* first row of window in screen */
+#endif
+ int w_height; /* number of rows in window, excluding
+ status/command line(s) */
+#ifdef FEAT_WINDOWS
+ int w_status_height; /* number of status lines (0 or 1) */
+#endif
+#ifdef FEAT_VERTSPLIT
+ int w_wincol; /* Leftmost column of window in screen.
+ use W_WINCOL() */
+ int w_width; /* Width of window, excluding separation.
+ use W_WIDTH() */
+ int w_vsep_width; /* Number of separator columns (0 or 1).
+ use W_VSEP_WIDTH() */
+#endif
+
+ /*
+ * === start of cached values ====
+ */
+ /*
+ * Recomputing is minimized by storing the result of computations.
+ * Use functions in screen.c to check if they are valid and to update.
+ * w_valid is a bitfield of flags, which indicate if specific values are
+ * valid or need to be recomputed. See screen.c for values.
+ */
+ int w_valid;
+ pos_T w_valid_cursor; /* last known position of w_cursor, used
+ to adjust w_valid */
+ colnr_T w_valid_leftcol; /* last known w_leftcol */
+
+ /*
+ * w_cline_height is the number of physical lines taken by the buffer line
+ * that the cursor is on. We use this to avoid extra calls to plines().
+ */
+ int w_cline_height; /* current size of cursor line */
+#ifdef FEAT_FOLDING
+ int w_cline_folded; /* cursor line is folded */
+#endif
+
+ int w_cline_row; /* starting row of the cursor line */
+
+ colnr_T w_virtcol; /* column number of the cursor in the
+ buffer line, as opposed to the column
+ number we're at on the screen. This
+ makes a difference on lines which span
+ more than one screen line or when
+ w_leftcol is non-zero */
+
+ /*
+ * w_wrow and w_wcol specify the cursor position in the window.
+ * This is related to positions in the window, not in the display or
+ * buffer, thus w_wrow is relative to w_winrow.
+ */
+ int w_wrow, w_wcol; /* cursor position in window */
+
+ linenr_T w_botline; /* number of the line below the bottom of
+ the screen */
+ int w_empty_rows; /* number of ~ rows in window */
+#ifdef FEAT_DIFF
+ int w_filler_rows; /* number of filler rows at the end of the
+ window */
+#endif
+
+ /*
+ * Info about the lines currently in the window is remembered to avoid
+ * recomputing it every time. The allocated size of w_lines[] is Rows.
+ * Only the w_lines_valid entries are actually valid.
+ * When the display is up-to-date w_lines[0].wl_lnum is equal to w_topline
+ * and w_lines[w_lines_valid - 1].wl_lnum is equal to w_botline.
+ * Between changing text and updating the display w_lines[] represents
+ * what is currently displayed. wl_valid is reset to indicated this.
+ * This is used for efficient redrawing.
+ */
+ int w_lines_valid; /* number of valid entries */
+ wline_T *w_lines;
+
+#ifdef FEAT_FOLDING
+ garray_T w_folds; /* array of nested folds */
+ char w_fold_manual; /* when TRUE: some folds are opened/closed
+ manually */
+ char w_foldinvalid; /* when TRUE: folding needs to be
+ recomputed */
+#endif
+
+ /*
+ * === end of cached values ===
+ */
+
+ int w_redr_type; /* type of redraw to be performed on win */
+ int w_upd_rows; /* number of window lines to update when
+ w_redr_type is REDRAW_TOP */
+ linenr_T w_redraw_top; /* when != 0: first line needing redraw */
+ linenr_T w_redraw_bot; /* when != 0: last line needing redraw */
+#ifdef FEAT_WINDOWS
+ int w_redr_status; /* if TRUE status line must be redrawn */
+#endif
+
+#ifdef FEAT_CMDL_INFO
+ /* remember what is shown in the ruler for this window (if 'ruler' set) */
+ pos_T w_ru_cursor; /* cursor position shown in ruler */
+ colnr_T w_ru_virtcol; /* virtcol shown in ruler */
+ linenr_T w_ru_topline; /* topline shown in ruler */
+ linenr_T w_ru_line_count; /* line count used for ruler */
+# ifdef FEAT_DIFF
+ int w_ru_topfill; /* topfill shown in ruler */
+# endif
+ char w_ru_empty; /* TRUE if ruler shows 0-1 (empty line) */
+#endif
+
+ int w_alt_fnum; /* alternate file (for # and CTRL-^) */
+
+#ifdef FEAT_WINDOWS
+ alist_T *w_alist; /* pointer to arglist for this window */
+#endif
+ int w_arg_idx; /* current index in argument list (can be
+ out of range!) */
+ int w_arg_idx_invalid; /* editing another file than w_arg_idx */
+
+ char_u *w_localdir; /* absolute path of local directory or
+ NULL */
+ /*
+ * Options local to a window.
+ * They are local because they influence the layout of the window or
+ * depend on the window layout.
+ * There are two values: w_onebuf_opt is local to the buffer currently in
+ * this window, w_allbuf_opt is for all buffers in this window.
+ */
+ winopt_T w_onebuf_opt;
+ winopt_T w_allbuf_opt;
+
+ /* transform a pointer to a "onebuf" option into a "allbuf" option */
+#define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T))
+
+#ifdef FEAT_SCROLLBIND
+ long w_scbind_pos;
+#endif
+
+#ifdef FEAT_EVAL
+ garray_T w_vars; /* internal variables, local to window */
+#endif
+
+#if defined(FEAT_RIGHTLEFT) && defined(FEAT_FKMAP)
+ int w_farsi; /* for the window dependent Farsi functions */
+#endif
+
+ /*
+ * The w_prev_pcmark field is used to check whether we really did jump to
+ * a new line after setting the w_pcmark. If not, then we revert to
+ * using the previous w_pcmark.
+ */
+ pos_T w_pcmark; /* previous context mark */
+ pos_T w_prev_pcmark; /* previous w_pcmark */
+
+#ifdef FEAT_JUMPLIST
+ /*
+ * the jumplist contains old cursor positions
+ */
+ xfmark_T w_jumplist[JUMPLISTSIZE];
+ int w_jumplistlen; /* number of active entries */
+ int w_jumplistidx; /* current position */
+
+ int w_changelistidx; /* current position in b_changelist */
+#endif
+
+#ifdef FEAT_SEARCH_EXTRA
+ regmmatch_T w_match; /* regexp program for ":match" */
+ int w_match_id; /* highlight ID for ":match" */
+#endif
+
+ /*
+ * the tagstack grows from 0 upwards:
+ * entry 0: older
+ * entry 1: newer
+ * entry 2: newest
+ */
+ taggy_T w_tagstack[TAGSTACKSIZE]; /* the tag stack */
+ int w_tagstackidx; /* idx just below activ entry */
+ int w_tagstacklen; /* number of tags on stack */
+
+ /*
+ * w_fraction is the fractional row of the cursor within the window, from
+ * 0 at the top row to FRACTION_MULT at the last row.
+ * w_prev_fraction_row was the actual cursor row when w_fraction was last
+ * calculated.
+ */
+ int w_fraction;
+ int w_prev_fraction_row;
+
+#ifdef FEAT_GUI
+ scrollbar_T w_scrollbars[2]; /* vert. Scrollbars for this window */
+#endif
+
+#ifdef FEAT_PERL
+ void *perl_private;
+#endif
+
+#ifdef FEAT_PYTHON
+ void *python_ref; /* The Python value referring to this
+ window */
+#endif
+
+#ifdef FEAT_TCL
+ void *tcl_ref;
+#endif
+
+#ifdef FEAT_RUBY
+ void *ruby_ref;
+#endif
+};
+
+/*
+ * Arguments for operators.
+ */
+typedef struct oparg
+{
+ int op_type; /* current pending operator type */
+ int regname; /* register to use for the operator */
+ int motion_type; /* type of the current cursor motion */
+ int motion_force; /* force motion type: 'v', 'V' or CTRL-V */
+ int use_reg_one; /* TRUE if delete uses reg 1 even when not
+ linewise */
+ int inclusive; /* TRUE if char motion is inclusive (only
+ valid when motion_type is MCHAR */
+ int end_adjusted; /* backuped b_op_end one char (only used by
+ do_format()) */
+ pos_T start; /* start of the operator */
+ pos_T end; /* end of the operator */
+ pos_T cursor_start; /* cursor position before motion for "gw" */
+
+ long line_count; /* number of lines from op_start to op_end
+ (inclusive) */
+ int empty; /* op_start and op_end the same (only used by
+ do_change()) */
+#ifdef FEAT_VISUAL
+ int is_VIsual; /* operator on Visual area */
+ int block_mode; /* current operator is Visual block mode */
+#endif
+ colnr_T start_vcol; /* start col for block mode operator */
+ colnr_T end_vcol; /* end col for block mode operator */
+} oparg_T;
+
+/*
+ * Arguments for Normal mode commands.
+ */
+typedef struct cmdarg
+{
+ oparg_T *oap; /* Operator arguments */
+ int prechar; /* prefix character (optional, always 'g') */
+ int cmdchar; /* command character */
+ int nchar; /* next command character (optional) */
+#ifdef FEAT_MBYTE
+ int ncharC1; /* first composing character (optional) */
+ int ncharC2; /* second composing character (optional) */
+#endif
+ int extra_char; /* yet another character (optional) */
+ long opcount; /* count before an operator */
+ long count0; /* count before command, default 0 */
+ long count1; /* count before command, default 1 */
+ int arg; /* extra argument from nv_cmds[] */
+ int retval; /* return: CA_* values */
+ char_u *searchbuf; /* return: pointer to search pattern or NULL */
+} cmdarg_T;
+
+/* values for retval: */
+#define CA_COMMAND_BUSY 1 /* skip restarting edit() once */
+#define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */
+
+#ifdef CURSOR_SHAPE
+/*
+ * struct to store values from 'guicursor' and 'mouseshape'
+ */
+/* Indexes in shape_table[] */
+#define SHAPE_IDX_N 0 /* Normal mode */
+#define SHAPE_IDX_V 1 /* Visual mode */
+#define SHAPE_IDX_I 2 /* Insert mode */
+#define SHAPE_IDX_R 3 /* Replace mode */
+#define SHAPE_IDX_C 4 /* Command line Normal mode */
+#define SHAPE_IDX_CI 5 /* Command line Insert mode */
+#define SHAPE_IDX_CR 6 /* Command line Replace mode */
+#define SHAPE_IDX_O 7 /* Operator-pending mode */
+#define SHAPE_IDX_VE 8 /* Visual mode with 'seleciton' exclusive */
+#define SHAPE_IDX_CLINE 9 /* On command line */
+#define SHAPE_IDX_STATUS 10 /* A status line */
+#define SHAPE_IDX_SDRAG 11 /* dragging a status line */
+#define SHAPE_IDX_VSEP 12 /* A vertical separator line */
+#define SHAPE_IDX_VDRAG 13 /* dragging a vertical separator line */
+#define SHAPE_IDX_MORE 14 /* Hit-return or More */
+#define SHAPE_IDX_MOREL 15 /* Hit-return or More in last line */
+#define SHAPE_IDX_SM 16 /* showing matching paren */
+#define SHAPE_IDX_COUNT 17
+
+#define SHAPE_BLOCK 0 /* block cursor */
+#define SHAPE_HOR 1 /* horizontal bar cursor */
+#define SHAPE_VER 2 /* vertical bar cursor */
+
+#define MSHAPE_NUMBERED 1000 /* offset for shapes identified by number */
+#define MSHAPE_HIDE 1 /* hide mouse pointer */
+
+#define SHAPE_MOUSE 1 /* used for mouse pointer shape */
+#define SHAPE_CURSOR 2 /* used for text cursor shape */
+
+typedef struct cursor_entry
+{
+ int shape; /* one of the SHAPE_ defines */
+ int mshape; /* one of the MSHAPE defines */
+ int percentage; /* percentage of cell for bar */
+ long blinkwait; /* blinking, wait time before blinking starts */
+ long blinkon; /* blinking, on time */
+ long blinkoff; /* blinking, off time */
+ int id; /* highlight group ID */
+ int id_lm; /* highlight group ID for :lmap mode */
+ char *name; /* mode name (fixed) */
+ char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */
+} cursorentry_T;
+#endif /* CURSOR_SHAPE */
+
+#ifdef FEAT_MENU
+
+/* Indices into vimmenu_T->strings[] and vimmenu_T->noremap[] for each mode */
+#define MENU_INDEX_INVALID -1
+#define MENU_INDEX_NORMAL 0
+#define MENU_INDEX_VISUAL 1
+#define MENU_INDEX_OP_PENDING 2
+#define MENU_INDEX_INSERT 3
+#define MENU_INDEX_CMDLINE 4
+#define MENU_INDEX_TIP 5
+#define MENU_MODES 6
+
+/* Menu modes */
+#define MENU_NORMAL_MODE (1 << MENU_INDEX_NORMAL)
+#define MENU_VISUAL_MODE (1 << MENU_INDEX_VISUAL)
+#define MENU_OP_PENDING_MODE (1 << MENU_INDEX_OP_PENDING)
+#define MENU_INSERT_MODE (1 << MENU_INDEX_INSERT)
+#define MENU_CMDLINE_MODE (1 << MENU_INDEX_CMDLINE)
+#define MENU_TIP_MODE (1 << MENU_INDEX_TIP)
+#define MENU_ALL_MODES ((1 << MENU_INDEX_TIP) - 1)
+/*note MENU_INDEX_TIP is not a 'real' mode*/
+
+/* Start a menu name with this to not include it on the main menu bar */
+#define MNU_HIDDEN_CHAR ']'
+
+typedef struct VimMenu vimmenu_T;
+
+struct VimMenu
+{
+ int modes; /* Which modes is this menu visible for? */
+ int enabled; /* for which modes the menu is enabled */
+ char_u *name; /* Name of menu */
+ char_u *dname; /* Displayed Name (without '&') */
+ int mnemonic; /* mnemonic key (after '&') */
+ char_u *actext; /* accelerator text (after TAB) */
+ int priority; /* Menu order priority */
+#ifdef FEAT_GUI
+ void (*cb)(); /* Call-back routine */
+#endif
+#ifdef FEAT_TOOLBAR
+ char_u *iconfile; /* name of file for icon or NULL */
+ int iconidx; /* icon index (-1 if not set) */
+ int icon_builtin; /* icon names is BuiltIn{nr} */
+#endif
+ char_u *strings[MENU_MODES]; /* Mapped string for each mode */
+ int noremap[MENU_MODES]; /* A REMAP_ flag for each mode */
+ char silent[MENU_MODES]; /* A silent flag for each mode */
+ vimmenu_T *children; /* Children of sub-menu */
+ vimmenu_T *parent; /* Parent of menu */
+ vimmenu_T *next; /* Next item in menu */
+#ifdef FEAT_GUI_X11
+ Widget id; /* Manage this to enable item */
+ Widget submenu_id; /* If this is submenu, add children here */
+#endif
+#ifdef FEAT_GUI_GTK
+ GtkWidget *id; /* Manage this to enable item */
+ GtkWidget *submenu_id; /* If this is submenu, add children here */
+ GtkWidget *tearoff_handle;
+ GtkWidget *label; /* Used by "set wak=" code. */
+#endif
+#ifdef FEAT_GUI_MOTIF
+ int sensitive; /* turn button on/off */
+#endif
+#if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)
+ Pixmap image; /* Toolbar image */
+#endif
+#ifdef FEAT_GUI_MOTIF
+ Pixmap image_ins; /* Toolbar image insensitive */
+#endif
+#ifdef FEAT_BEVAL_TIP
+ BalloonEval *tip; /* tooltip for this menu item */
+#endif
+#ifdef FEAT_GUI_W16
+ UINT id; /* Id of menu item */
+ HMENU submenu_id; /* If this is submenu, add children here */
+#endif
+#ifdef FEAT_GUI_W32
+ UINT id; /* Id of menu item */
+ HMENU submenu_id; /* If this is submenu, add children here */
+ HWND tearoff_handle; /* hWnd of tearoff if created */
+#endif
+#if FEAT_GUI_BEOS
+ BMenuItem *id; /* Id of menu item */
+ BMenu *submenu_id; /* If this is submenu, add children here */
+#endif
+#ifdef FEAT_GUI_MAC
+/* MenuHandle id; */
+/* short index; */ /* the item index within the father menu */
+ short menu_id; /* the menu id to which this item belong */
+ short submenu_id; /* the menu id of the children (could be
+ get throught some tricks) */
+ MenuHandle menu_handle;
+ MenuHandle submenu_handle;
+#endif
+#if defined(FEAT_GUI_AMIGA)
+ /* only one of these will ever be set, but
+ * they are used to allow the menu routine
+ * to easily get a hold of the parent menu
+ * pointer which is needed by all items to
+ * form the chain correctly */
+ int id; /* unused by the amiga, but used in the
+ * code kept for compatibility */
+ struct Menu *menuPtr;
+ struct MenuItem *menuItemPtr;
+#endif
+#ifdef RISCOS
+ int *id; /* Not used, but gui.c needs it */
+ int greyed_out; /* Flag */
+ int hidden;
+#endif
+#ifdef FEAT_GUI_PHOTON
+ PtWidget_t *id;
+ PtWidget_t *submenu_id;
+#endif
+};
+#else
+/* For generating prototypes when FEAT_MENU isn't defined. */
+typedef int vimmenu_T;
+
+#endif /* FEAT_MENU */
+
+/*
+ * Struct to save values in before executing autocommands for a buffer that is
+ * not the current buffer.
+ */
+typedef struct
+{
+ buf_T *save_buf; /* saved curbuf */
+ buf_T *new_curbuf; /* buffer to be used */
+ win_T *save_curwin; /* saved curwin, NULL if it didn't change */
+ win_T *new_curwin; /* new curwin if save_curwin != NULL */
+ pos_T save_cursor; /* saved cursor pos of save_curwin */
+ linenr_T save_topline; /* saved topline of save_curwin */
+#ifdef FEAT_DIFF
+ int save_topfill; /* saved topfill of save_curwin */
+#endif
+} aco_save_T;
+
+/*
+ * Generic option table item, only used for printer at the moment.
+ */
+typedef struct
+{
+ const char *name;
+ int hasnum;
+ long number;
+ char_u *string; /* points into option string */
+ int strlen;
+ int present;
+} option_table_T;
+
+/*
+ * Structure to hold printing color and font attributes.
+ */
+typedef struct
+{
+ long_u fg_color;
+ long_u bg_color;
+ int bold;
+ int italic;
+ int underline;
+} prt_text_attr_T;
+
+/*
+ * Structure passed back to the generic printer code.
+ */
+typedef struct
+{
+ int n_collated_copies;
+ int n_uncollated_copies;
+ int duplex;
+ int chars_per_line;
+ int lines_per_page;
+ int has_color;
+ prt_text_attr_T number;
+#ifdef FEAT_SYN_HL
+ int modec;
+ int do_syntax;
+#endif
+ int user_abort;
+ char_u *jobname;
+#ifdef FEAT_POSTSCRIPT
+ char_u *outfile;
+ char_u *arguments;
+#endif
+} prt_settings_T;
+
+#define PRINT_NUMBER_WIDTH 8
diff --git a/src/swis.s b/src/swis.s
new file mode 100644
index 000000000..562747adb
--- /dev/null
+++ b/src/swis.s
@@ -0,0 +1,143 @@
+; Thomas Leonard
+; 24/5/98
+
+ar0 rn 0
+ar1 rn 1
+ar2 rn 2
+ar3 rn 3
+ar4 rn 4
+ar5 rn 5
+ar6 rn 6
+ar7 rn 7
+ar10 rn 10
+ar11 rn 11
+lk rn 14
+ar15 rn 15
+
+ AREA DATA
+ align 4
+
+ export |r0|
+r0: dcd 0
+
+ export |r1|
+r1: dcd 0
+
+ export |r2|
+r2: dcd 0
+
+ export |r3|
+r3: dcd 0
+
+ export |r4|
+r4: dcd 0
+
+ export |r5|
+r5: dcd 0
+
+ export |r6|
+r6: dcd 0
+
+ export |r7|
+r7: dcd 0
+
+ export |time_of_last_poll|
+time_of_last_poll: dcd 0
+
+ AREA CODE, READONLY
+ align 4
+ import |r0|
+ export |swi|
+ = "swi"
+ align 4
+swi:
+ ; r0 = swi number
+ stmfd sp!,{ar4-ar10,lk}
+ orr ar10,ar0,#1<<17 ;always use the X form
+ mov ar0,ar1
+ mov ar1,ar2
+ mov ar2,ar3
+ add ar3,sp,#4*8
+ ldmia ar3,{ar3-ar7}
+ swi 0x6f ; OS_CallASWI
+ ldr ar10,regs_addr
+ stmia ar10,{ar0-ar7}
+ ldmvcfd sp!,{ar4-ar10,pc}^
+ ; report the error and quit on Cancel
+ mov r1,#0x17
+ adr r2,s_title
+ swi 0x400df ; Wimp_ReportError
+ cmp r1,#1 ;OK selected?
+ ldmeqfd sp!,{ar4-ar10,pc}^ ;yes - try to continue
+ swi 0x11 ;no - die (OS_Exit)
+s_title:
+ = "Nasty error - Cancel to quit"
+ = 0
+
+ align 4
+ export |xswi|
+ = "xswi"
+ align 4
+xswi:
+ ; r0 = swi number
+ stmfd sp!,{ar4-ar10,lk}
+ orr ar10,ar0,#1<<17 ;always use the X form
+ mov ar0,ar1
+ mov ar1,ar2
+ mov ar2,ar3
+ add ar3,sp,#4*8
+ ldmia ar3,{ar3-ar7}
+ swi 0x6f ; OS_CallASWI
+ ldr ar10,regs_addr
+ stmia ar10,{ar0-ar7}
+ mov ar0,#0
+ orr ar0,ar0,ar15
+ ldmfd sp!,{ar4-ar10,pc}^
+
+regs_addr:
+ dcd r0
+
+ ; The Wimp_Poll swis have to be done specially because,
+ ; for some reason, r13 sometimes gets corrupted by Wimp_Poll
+ ; (eg when running FileFind)
+ AREA CODE, READONLY
+ align 4
+ import |time_of_last_poll|
+ export |wimp_poll|
+ = "wimp_poll"
+ align 4
+wimp_poll:
+ mov ar3,sp
+ swi 0x400c7 ; Wimp_Poll
+ mov sp,ar3
+
+ mov ar3,ar0
+ swi 0x42 ; OS_ReadMonotonicTime
+ ldr ar2,addr_time
+ str ar0,[ar2]
+ mov ar0,ar3
+
+ mov ar2,#0
+ wfs ar2 ; Write floating point status. Needed?
+ movs pc,lk
+
+ align 4
+ export |wimp_pollidle|
+ = "wimp_pollidle"
+ align 4
+wimp_pollidle:
+ mov ar3,sp
+ swi 0x400e1 ; Wimp_PollIdle
+ mov sp,ar3
+
+ mov ar3,ar0
+ swi 0x42 ; OS_ReadMonotonicTime
+ ldr ar2,addr_time
+ str ar0,[ar2]
+ mov ar0,ar3
+
+ mov ar2,#0
+ wfs ar2 ; Write floating point status. Needed?
+ movs pc,lk
+
+addr_time: dcd time_of_last_poll
diff --git a/src/syntax.c b/src/syntax.c
new file mode 100644
index 000000000..31ff7617b
--- /dev/null
+++ b/src/syntax.c
@@ -0,0 +1,8456 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * syntax.c: code for syntax highlighting
+ */
+
+#include "vim.h"
+
+/*
+ * Structure that stores information about a highlight group.
+ * The ID of a highlight group is also called group ID. It is the index in
+ * the highlight_ga array PLUS ONE.
+ */
+struct hl_group
+{
+ char_u *sg_name; /* highlight group name */
+ char_u *sg_name_u; /* uppercase of sg_name */
+/* for normal terminals */
+ int sg_term; /* "term=" highlighting attributes */
+ char_u *sg_start; /* terminal string for start highl */
+ char_u *sg_stop; /* terminal string for stop highl */
+ int sg_term_attr; /* Screen attr for term mode */
+/* for color terminals */
+ int sg_cterm; /* "cterm=" highlighting attr */
+ int sg_cterm_bold; /* bold attr was set for light color */
+ int sg_cterm_fg; /* terminal fg color number + 1 */
+ int sg_cterm_bg; /* terminal bg color number + 1 */
+ int sg_cterm_attr; /* Screen attr for color term mode */
+#ifdef FEAT_GUI
+/* for when using the GUI */
+ int sg_gui; /* "gui=" highlighting attributes */
+ guicolor_T sg_gui_fg; /* GUI foreground color handle */
+ char_u *sg_gui_fg_name;/* GUI foreground color name */
+ guicolor_T sg_gui_bg; /* GUI background color handle */
+ char_u *sg_gui_bg_name;/* GUI background color name */
+ GuiFont sg_font; /* GUI font handle */
+#ifdef FEAT_XFONTSET
+ GuiFontset sg_fontset; /* GUI fontset handle */
+#endif
+ char_u *sg_font_name; /* GUI font or fontset name */
+ int sg_gui_attr; /* Screen attr for GUI mode */
+#endif
+ int sg_link; /* link to this highlight group ID */
+ int sg_set; /* combination of SG_* flags */
+};
+
+#define SG_TERM 1 /* term has been set */
+#define SG_CTERM 2 /* cterm has been set */
+#define SG_GUI 4 /* gui has been set */
+#define SG_LINK 8 /* link has been set */
+
+static garray_T highlight_ga; /* highlight groups for 'highlight' option */
+
+#define HL_TABLE() ((struct hl_group *)((highlight_ga.ga_data)))
+
+#ifdef FEAT_CMDL_COMPL
+static int include_default = FALSE; /* include "default" for expansion */
+static int include_link = FALSE; /* include "link" for expansion */
+#endif
+
+/*
+ * The "term", "cterm" and "gui" arguments can be any combination of the
+ * following names, separated by commas (but no spaces!).
+ */
+static char *(hl_name_table[]) =
+ {"bold", "standout", "underline", "italic", "reverse", "inverse", "NONE"};
+static int hl_attr_table[] =
+ {HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_ITALIC, HL_INVERSE, HL_INVERSE, 0};
+
+static int get_attr_entry __ARGS((garray_T *table, attrentry_T *aep));
+static void syn_unadd_group __ARGS((void));
+static void set_hl_attr __ARGS((int idx));
+static void highlight_list_one __ARGS((int id));
+static int highlight_list_arg __ARGS((int id, int didh, int type, int iarg, char_u *sarg, char *name));
+static int syn_add_group __ARGS((char_u *name));
+static int syn_list_header __ARGS((int did_header, int outlen, int id));
+static int hl_has_settings __ARGS((int idx, int check_link));
+static void highlight_clear __ARGS((int idx));
+
+#ifdef FEAT_GUI
+static void gui_do_one_color __ARGS((int idx, int do_menu, int do_tooltip));
+static int set_group_colors __ARGS((char_u *name, guicolor_T *fgp, guicolor_T *bgp, int do_menu, int use_norm, int do_tooltip));
+static guicolor_T color_name2handle __ARGS((char_u *name));
+static GuiFont font_name2handle __ARGS((char_u *name));
+# ifdef FEAT_XFONTSET
+static GuiFontset fontset_name2handle __ARGS((char_u *name, int fixed_width));
+# endif
+static void hl_do_font __ARGS((int idx, char_u *arg, int do_normal, int do_menu, int do_tooltip));
+#endif
+
+/*
+ * An attribute number is the index in attr_table plus ATTR_OFF.
+ */
+#define ATTR_OFF (HL_ALL + 1)
+
+#if defined(FEAT_SYN_HL) || defined(PROTO)
+
+#define SYN_NAMELEN 50 /* maximum length of a syntax name */
+
+/* different types of offsets that are possible */
+#define SPO_MS_OFF 0 /* match start offset */
+#define SPO_ME_OFF 1 /* match end offset */
+#define SPO_HS_OFF 2 /* highl. start offset */
+#define SPO_HE_OFF 3 /* highl. end offset */
+#define SPO_RS_OFF 4 /* region start offset */
+#define SPO_RE_OFF 5 /* region end offset */
+#define SPO_LC_OFF 6 /* leading context offset */
+#define SPO_COUNT 7
+
+static char *(spo_name_tab[SPO_COUNT]) =
+ {"ms=", "me=", "hs=", "he=", "rs=", "re=", "lc="};
+
+/*
+ * The patterns that are being searched for are stored in a syn_pattern.
+ * A match item consists of one pattern.
+ * A start/end item consists of n start patterns and m end patterns.
+ * A start/skip/end item consists of n start patterns, one skip pattern and m
+ * end patterns.
+ * For the latter two, the patterns are always consecutive: start-skip-end.
+ *
+ * A character offset can be given for the matched text (_m_start and _m_end)
+ * and for the actually highlighted text (_h_start and _h_end).
+ */
+typedef struct syn_pattern
+{
+ char sp_type; /* see SPTYPE_ defines below */
+ char sp_syncing; /* this item used for syncing */
+ short sp_flags; /* see HL_ defines below */
+ struct sp_syn sp_syn; /* struct passed to in_id_list() */
+ short sp_syn_match_id; /* highlight group ID of pattern */
+ char_u *sp_pattern; /* regexp to match, pattern */
+ regprog_T *sp_prog; /* regexp to match, program */
+ int sp_ic; /* ignore-case flag for sp_prog */
+ short sp_off_flags; /* see below */
+ int sp_offsets[SPO_COUNT]; /* offsets */
+ short *sp_cont_list; /* cont. group IDs, if non-zero */
+ short *sp_next_list; /* next group IDs, if non-zero */
+ int sp_sync_idx; /* sync item index (syncing only) */
+ int sp_line_id; /* ID of last line where tried */
+ int sp_startcol; /* next match in sp_line_id line */
+} synpat_T;
+
+/* The sp_off_flags are computed like this:
+ * offset from the start of the matched text: (1 << SPO_XX_OFF)
+ * offset from the end of the matched text: (1 << (SPO_XX_OFF + SPO_COUNT))
+ * When both are present, only one is used.
+ */
+
+#define SPTYPE_MATCH 1 /* match keyword with this group ID */
+#define SPTYPE_START 2 /* match a regexp, start of item */
+#define SPTYPE_END 3 /* match a regexp, end of item */
+#define SPTYPE_SKIP 4 /* match a regexp, skip within item */
+
+#define HL_CONTAINED 0x01 /* not used on toplevel */
+#define HL_TRANSP 0x02 /* has no highlighting */
+#define HL_ONELINE 0x04 /* match within one line only */
+#define HL_HAS_EOL 0x08 /* end pattern that matches with $ */
+#define HL_SYNC_HERE 0x10 /* sync point after this item (syncing only) */
+#define HL_SYNC_THERE 0x20 /* sync point at current line (syncing only) */
+#define HL_MATCH 0x40 /* use match ID instead of item ID */
+#define HL_SKIPNL 0x80 /* nextgroup can skip newlines */
+#define HL_SKIPWHITE 0x100 /* nextgroup can skip white space */
+#define HL_SKIPEMPTY 0x200 /* nextgroup can skip empty lines */
+#define HL_KEEPEND 0x400 /* end match always kept */
+#define HL_EXCLUDENL 0x800 /* exclude NL from match */
+#define HL_DISPLAY 0x1000 /* only used for displaying, not syncing */
+#define HL_FOLD 0x2000 /* define fold */
+#define HL_EXTEND 0x4000 /* ignore a keepend */
+/* These don't fit in a short, thus can't be used for syntax items, only for
+ * si_flags and bs_flags. */
+#define HL_MATCHCONT 0x8000 /* match continued from previous line */
+#define HL_TRANS_CONT 0x10000L /* transparent item without contains arg */
+
+#define SYN_ITEMS(buf) ((synpat_T *)((buf)->b_syn_patterns.ga_data))
+
+#define NONE_IDX -2 /* value of sp_sync_idx for "NONE" */
+
+/*
+ * Flags for b_syn_sync_flags:
+ */
+#define SF_CCOMMENT 0x01 /* sync on a C-style comment */
+#define SF_MATCH 0x02 /* sync by matching a pattern */
+
+#define SYN_STATE_P(ssp) ((bufstate_T *)((ssp)->ga_data))
+
+/*
+ * Settings for keyword hash table. It uses a simplistic hash function: add
+ * all characters together, modulo KHASH_SIZE.
+ */
+#define KHASH_SIZE 512
+#define KHASH_MASK (KHASH_SIZE - 1)
+#define MAXKEYWLEN 80 /* maximum length of a keyword */
+
+/*
+ * The attributes of the syntax item that has been recognized.
+ */
+static int current_attr = 0; /* attr of current syntax word */
+#ifdef FEAT_EVAL
+static int current_id = 0; /* ID of current char for syn_get_id() */
+static int current_trans_id = 0; /* idem, transparancy removed */
+#endif
+
+struct syn_cluster
+{
+ char_u *scl_name; /* syntax cluster name */
+ char_u *scl_name_u; /* uppercase of scl_name */
+ short *scl_list; /* IDs in this syntax cluster */
+};
+
+/*
+ * Methods of combining two clusters
+ */
+#define CLUSTER_REPLACE 1 /* replace first list with second */
+#define CLUSTER_ADD 2 /* add second list to first */
+#define CLUSTER_SUBTRACT 3 /* subtract second list from first */
+
+#define SYN_CLSTR(buf) ((struct syn_cluster *)((buf)->b_syn_clusters.ga_data))
+
+/*
+ * Syntax group IDs have different types:
+ * 0 - 9999 normal syntax groups
+ * 10000 - 14999 ALLBUT indicator (current_syn_inc_tag added)
+ * 15000 - 19999 TOP indicator (current_syn_inc_tag added)
+ * 20000 - 24999 CONTAINED indicator (current_syn_inc_tag added)
+ * >= 25000 cluster IDs (subtract SYNID_CLUSTER for the cluster ID)
+ */
+#define SYNID_ALLBUT 10000 /* syntax group ID for contains=ALLBUT */
+#define SYNID_TOP 15000 /* syntax group ID for contains=TOP */
+#define SYNID_CONTAINED 20000 /* syntax group ID for contains=CONTAINED */
+#define SYNID_CLUSTER 25000 /* first syntax group ID for clusters */
+
+/*
+ * Annoying Hack(TM): ":syn include" needs this pointer to pass to
+ * expand_filename(). Most of the other syntax commands don't need it, so
+ * instead of passing it to them, we stow it here.
+ */
+static char_u **syn_cmdlinep;
+
+/*
+ * Another Annoying Hack(TM): To prevent rules from other ":syn include"'d
+ * files from from leaking into ALLBUT lists, we assign a unique ID to the
+ * rules in each ":syn include"'d file.
+ */
+static int current_syn_inc_tag = 0;
+static int running_syn_inc_tag = 0;
+
+/*
+ * To reduce the time spent in keepend(), remember at which level in the state
+ * stack the first item with "keepend" is present. When "-1", there is no
+ * "keepend" on the stack.
+ */
+static int keepend_level = -1;
+
+/*
+ * For the current state we need to remember more than just the idx.
+ * When si_m_endpos.lnum is 0, the items other than si_idx are unknown.
+ * (The end positions have the column number of the next char)
+ */
+typedef struct state_item
+{
+ int si_idx; /* index of syntax pattern */
+ int si_id; /* highlight group ID for keywords */
+ int si_trans_id; /* idem, transparancy removed */
+ int si_m_lnum; /* lnum of the match */
+ int si_m_startcol; /* starting column of the match */
+ lpos_T si_m_endpos; /* just after end posn of the match */
+ lpos_T si_h_startpos; /* start position of the highlighting */
+ lpos_T si_h_endpos; /* end position of the highlighting */
+ lpos_T si_eoe_pos; /* end position of end pattern */
+ int si_end_idx; /* group ID for end pattern or zero */
+ int si_ends; /* if match ends before si_m_endpos */
+ int si_attr; /* attributes in this state */
+ long si_flags; /* HL_HAS_EOL flag in this state, and
+ * HL_SKIP* for si_next_list */
+ short *si_cont_list; /* list of contained groups */
+ short *si_next_list; /* nextgroup IDs after this item ends */
+ reg_extmatch_T *si_extmatch; /* \z(...\) matches from start
+ * pattern */
+} stateitem_T;
+
+#define KEYWORD_IDX -1 /* value of si_idx for keywords */
+#define ID_LIST_ALL (short *)-1 /* valid of si_cont_list for containing all
+ but contained groups */
+
+/*
+ * The next possible match in the current line for any pattern is remembered,
+ * to avoid having to try for a match in each column.
+ * If next_match_idx == -1, not tried (in this line) yet.
+ * If next_match_col == MAXCOL, no match found in this line.
+ * (All end positions have the column of the char after the end)
+ */
+static int next_match_col; /* column for start of next match */
+static lpos_T next_match_m_endpos; /* position for end of next match */
+static lpos_T next_match_h_startpos; /* pos. for highl. start of next match */
+static lpos_T next_match_h_endpos; /* pos. for highl. end of next match */
+static int next_match_idx; /* index of matched item */
+static long next_match_flags; /* flags for next match */
+static lpos_T next_match_eos_pos; /* end of start pattn (start region) */
+static lpos_T next_match_eoe_pos; /* pos. for end of end pattern */
+static int next_match_end_idx; /* ID of group for end pattn or zero */
+static reg_extmatch_T *next_match_extmatch = NULL;
+
+/*
+ * A state stack is an array of integers or stateitem_T, stored in a
+ * garray_T. A state stack is invalid if it's itemsize entry is zero.
+ */
+#define INVALID_STATE(ssp) ((ssp)->ga_itemsize == 0)
+#define VALID_STATE(ssp) ((ssp)->ga_itemsize != 0)
+
+/*
+ * The current state (within the line) of the recognition engine.
+ * When current_state.ga_itemsize is 0 the current state is invalid.
+ */
+static win_T *syn_win; /* current window for highlighting */
+static buf_T *syn_buf; /* current buffer for highlighting */
+static linenr_T current_lnum = 0; /* lnum of current state */
+static colnr_T current_col = 0; /* column of current state */
+static int current_state_stored = 0; /* TRUE if stored current state
+ * after setting current_finished */
+static int current_finished = 0; /* current line has been finished */
+static garray_T current_state /* current stack of state_items */
+ = {0, 0, 0, 0, NULL};
+static short *current_next_list = NULL; /* when non-zero, nextgroup list */
+static int current_next_flags = 0; /* flags for current_next_list */
+static int current_line_id = 0; /* unique number for current line */
+
+#define CUR_STATE(idx) ((stateitem_T *)(current_state.ga_data))[idx]
+
+static void syn_sync __ARGS((win_T *wp, linenr_T lnum, synstate_T *last_valid));
+static int syn_match_linecont __ARGS((linenr_T lnum));
+static void syn_start_line __ARGS((void));
+static void syn_update_ends __ARGS((int startofline));
+static void syn_stack_alloc __ARGS((void));
+static int syn_stack_cleanup __ARGS((void));
+static void syn_stack_free_entry __ARGS((buf_T *buf, synstate_T *p));
+static synstate_T *syn_stack_find_entry __ARGS((linenr_T lnum));
+static synstate_T *store_current_state __ARGS((synstate_T *sp));
+static void load_current_state __ARGS((synstate_T *from));
+static void invalidate_current_state __ARGS((void));
+static int syn_stack_equal __ARGS((synstate_T *sp));
+static void validate_current_state __ARGS((void));
+static int syn_finish_line __ARGS((int syncing));
+static int syn_current_attr __ARGS((int syncing, int displaying));
+static int did_match_already __ARGS((int idx, garray_T *gap));
+static stateitem_T *push_next_match __ARGS((stateitem_T *cur_si));
+static void check_state_ends __ARGS((void));
+static void update_si_attr __ARGS((int idx));
+static void check_keepend __ARGS((void));
+static void update_si_end __ARGS((stateitem_T *sip, int startcol, int force));
+static short *copy_id_list __ARGS((short *list));
+static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained));
+static int push_current_state __ARGS((int idx));
+static void pop_current_state __ARGS((void));
+
+static void find_endpos __ARGS((int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_endpos, long *flagsp, lpos_T *end_endpos, int *end_idx, reg_extmatch_T *start_ext));
+static void clear_syn_state __ARGS((synstate_T *p));
+static void clear_current_state __ARGS((void));
+
+static void limit_pos __ARGS((lpos_T *pos, lpos_T *limit));
+static void limit_pos_zero __ARGS((lpos_T *pos, lpos_T *limit));
+static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
+static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
+static char_u *syn_getcurline __ARGS((void));
+static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col));
+static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si));
+static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
+static void syntax_sync_clear __ARGS((void));
+static void syn_remove_pattern __ARGS((buf_T *buf, int idx));
+static void syn_clear_pattern __ARGS((buf_T *buf, int i));
+static void syn_clear_cluster __ARGS((buf_T *buf, int i));
+static void syn_cmd_clear __ARGS((exarg_T *eap, int syncing));
+static void syn_clear_one __ARGS((int id, int syncing));
+static void syn_cmd_on __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_enable __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_reset __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_manual __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_off __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_onoff __ARGS((exarg_T *eap, char *name));
+static void syn_cmd_list __ARGS((exarg_T *eap, int syncing));
+static void syn_lines_msg __ARGS((void));
+static void syn_match_msg __ARGS((void));
+static void syn_list_one __ARGS((int id, int syncing, int link_only));
+static void syn_list_cluster __ARGS((int id));
+static void put_id_list __ARGS((char_u *name, short *list, int attr));
+static void put_pattern __ARGS((char *s, int c, synpat_T *spp, int attr));
+static int syn_list_keywords __ARGS((int id, keyentry_T **ktabp, int did_header, int attr));
+static void syn_clear_keyword __ARGS((int id, keyentry_T **ktabp));
+static void free_keywtab __ARGS((keyentry_T **ktabp));
+static void add_keyword __ARGS((char_u *name, int id, int flags, short *cont_in_list, short *next_list));
+static int syn_khash __ARGS((char_u *p));
+static char_u *get_group_name __ARGS((char_u *arg, char_u **name_end));
+static char_u *get_syn_options __ARGS((char_u *arg, int *flagsp, int keyword, int *sync_idx, short **cont_list, short **cont_in_list, short **next_list));
+static void syn_cmd_include __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_keyword __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_match __ARGS((exarg_T *eap, int syncing));
+static void syn_cmd_region __ARGS((exarg_T *eap, int syncing));
+#ifdef __BORLANDC__
+static int _RTLENTRYF syn_compare_stub __ARGS((const void *v1, const void *v2));
+#else
+static int syn_compare_stub __ARGS((const void *v1, const void *v2));
+#endif
+static void syn_cmd_cluster __ARGS((exarg_T *eap, int syncing));
+static int syn_scl_name2id __ARGS((char_u *name));
+static int syn_scl_namen2id __ARGS((char_u *linep, int len));
+static int syn_check_cluster __ARGS((char_u *pp, int len));
+static int syn_add_cluster __ARGS((char_u *name));
+static void init_syn_patterns __ARGS((void));
+static char_u *get_syn_pattern __ARGS((char_u *arg, synpat_T *ci));
+static void syn_cmd_sync __ARGS((exarg_T *eap, int syncing));
+static int get_id_list __ARGS((char_u **arg, int keylen, short **list));
+static void syn_combine_list __ARGS((short **clstr1, short **clstr2, int list_op));
+static void syn_incl_toplevel __ARGS((int id, int *flagsp));
+
+/*
+ * Start the syntax recognition for a line. This function is normally called
+ * from the screen updating, once for each displayed line.
+ * The buffer is remembered in syn_buf, because get_syntax_attr() doesn't get
+ * it. Careful: curbuf and curwin are likely to point to another buffer and
+ * window.
+ */
+ void
+syntax_start(wp, lnum)
+ win_T *wp;
+ linenr_T lnum;
+{
+ synstate_T *p;
+ synstate_T *last_valid = NULL;
+ synstate_T *last_min_valid = NULL;
+ synstate_T *sp, *prev;
+ linenr_T parsed_lnum;
+ linenr_T first_stored;
+ int dist;
+
+ reg_syn = TRUE; /* let vim_regexec() know we're using syntax */
+
+ /*
+ * After switching buffers, invalidate current_state.
+ */
+ if (syn_buf != wp->w_buffer)
+ {
+ invalidate_current_state();
+ syn_buf = wp->w_buffer;
+ }
+ syn_win = wp;
+
+ /*
+ * Allocate syntax stack when needed.
+ */
+ syn_stack_alloc();
+ if (syn_buf->b_sst_array == NULL)
+ goto theend; /* out of memory */
+ syn_buf->b_sst_lasttick = display_tick;
+
+ /*
+ * If the state of the end of the previous line is useful, store it.
+ */
+ if (VALID_STATE(&current_state)
+ && current_lnum < lnum
+ && current_lnum < syn_buf->b_ml.ml_line_count)
+ {
+ (void)syn_finish_line(FALSE);
+ if (!current_state_stored)
+ {
+ ++current_lnum;
+ (void)store_current_state(NULL);
+ }
+
+ /*
+ * If the current_lnum is now the same as "lnum", keep the current
+ * state (this happens very often!). Otherwise invalidate
+ * current_state and figure it out below.
+ */
+ if (current_lnum != lnum)
+ invalidate_current_state();
+ }
+ else
+ invalidate_current_state();
+
+ /*
+ * Try to synchronize from a saved state in b_sst_array[].
+ * Only do this if lnum is not before and not to far beyond a saved state.
+ */
+ if (INVALID_STATE(&current_state) && syn_buf->b_sst_array != NULL)
+ {
+ /* Find last valid saved state before start_lnum. */
+ for (p = syn_buf->b_sst_first; p != NULL; p = p->sst_next)
+ {
+ if (p->sst_lnum > lnum)
+ break;
+ if (p->sst_lnum <= lnum && p->sst_change_lnum == 0)
+ {
+ last_valid = p;
+ if (p->sst_lnum >= lnum - syn_buf->b_syn_sync_minlines)
+ last_min_valid = p;
+ }
+ }
+ if (last_min_valid != NULL)
+ load_current_state(last_min_valid);
+ }
+
+ /*
+ * If "lnum" is before or far beyond a line with a saved state, need to
+ * re-synchronize.
+ */
+ if (INVALID_STATE(&current_state))
+ {
+ syn_sync(wp, lnum, last_valid);
+ first_stored = current_lnum + syn_buf->b_syn_sync_minlines;
+ }
+ else
+ first_stored = current_lnum;
+
+ /*
+ * Advance from the sync point or saved state until the current line.
+ * Save some entries for syncing with later on.
+ */
+ dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
+ prev = syn_stack_find_entry(current_lnum);
+ while (current_lnum < lnum)
+ {
+ syn_start_line();
+ (void)syn_finish_line(FALSE);
+ ++current_lnum;
+
+ /* If we parsed at least "minlines" lines or started at a valid
+ * state, the current state is considered valid. */
+ if (current_lnum >= first_stored)
+ {
+ /* Check if the saved state entry is for the current line and is
+ * equal to the current state. If so, then validate all saved
+ * states that depended on a change before the parsed line. */
+ if (prev == NULL)
+ sp = syn_buf->b_sst_first;
+ else
+ sp = prev->sst_next;
+ if (sp != NULL
+ && sp->sst_lnum == current_lnum
+ && syn_stack_equal(sp))
+ {
+ parsed_lnum = current_lnum;
+ prev = sp;
+ while (sp != NULL && sp->sst_change_lnum <= parsed_lnum)
+ {
+ if (sp->sst_lnum <= lnum)
+ /* valid state before desired line, use this one */
+ prev = sp;
+ else if (sp->sst_change_lnum == 0)
+ /* past saved states depending on change, break here. */
+ break;
+ sp->sst_change_lnum = 0;
+ sp = sp->sst_next;
+ }
+ load_current_state(prev);
+ }
+ /* Store the state at this line when it's the first one, the line
+ * where we start parsing, or some distance from the previously
+ * saved state. But only when parsed at least 'minlines'. */
+ else if (prev == NULL
+ || current_lnum == lnum
+ || current_lnum >= prev->sst_lnum + dist)
+ prev = store_current_state(prev);
+ }
+
+ /* This can take a long time: break when CTRL-C pressed. The current
+ * state will be wrong then. */
+ line_breakcheck();
+ if (got_int)
+ {
+ current_lnum = lnum;
+ break;
+ }
+ }
+
+ syn_start_line();
+
+theend:
+ reg_syn = FALSE;
+}
+
+/*
+ * We cannot simply discard growarrays full of state_items or buf_states; we
+ * have to manually release their extmatch pointers first.
+ */
+ static void
+clear_syn_state(p)
+ synstate_T *p;
+{
+ int i;
+ garray_T *gap;
+
+ if (p->sst_stacksize > SST_FIX_STATES)
+ {
+ gap = &(p->sst_union.sst_ga);
+ for (i = 0; i < gap->ga_len; i++)
+ unref_extmatch(SYN_STATE_P(gap)[i].bs_extmatch);
+ ga_clear(gap);
+ }
+ else
+ {
+ for (i = 0; i < p->sst_stacksize; i++)
+ unref_extmatch(p->sst_union.sst_stack[i].bs_extmatch);
+ }
+}
+
+/*
+ * Cleanup the current_state stack.
+ */
+ static void
+clear_current_state()
+{
+ int i;
+ stateitem_T *sip;
+
+ sip = (stateitem_T *)(current_state.ga_data);
+ for (i = 0; i < current_state.ga_len; i++)
+ unref_extmatch(sip[i].si_extmatch);
+ ga_clear(&current_state);
+}
+
+/*
+ * Try to find a synchronisation point for line "lnum".
+ *
+ * This sets current_lnum and the current state. One of three methods is
+ * used:
+ * 1. Search backwards for the end of a C-comment.
+ * 2. Search backwards for given sync patterns.
+ * 3. Simply start on a given number of lines above "lnum".
+ */
+ static void
+syn_sync(wp, start_lnum, last_valid)
+ win_T *wp;
+ linenr_T start_lnum;
+ synstate_T *last_valid;
+{
+ buf_T *curbuf_save;
+ win_T *curwin_save;
+ pos_T cursor_save;
+ int idx;
+ linenr_T lnum;
+ linenr_T end_lnum;
+ linenr_T break_lnum;
+ int had_sync_point;
+ stateitem_T *cur_si;
+ synpat_T *spp;
+ char_u *line;
+ int found_flags = 0;
+ int found_match_idx = 0;
+ linenr_T found_current_lnum = 0;
+ int found_current_col= 0;
+ lpos_T found_m_endpos;
+
+ /*
+ * Clear any current state that might be hanging around.
+ */
+ invalidate_current_state();
+
+ /*
+ * Start at least "minlines" back. Default starting point for parsing is
+ * there.
+ * Start further back, to avoid that scrolling backwards will result in
+ * resyncing for every line. Now it resyncs only one out of N lines,
+ * where N is minlines * 1.5, or minlines * 2 if minlines is small.
+ * Watch out for overflow when minlines is MAXLNUM.
+ */
+ if (syn_buf->b_syn_sync_minlines > start_lnum)
+ start_lnum = 1;
+ else
+ {
+ if (syn_buf->b_syn_sync_minlines == 1)
+ lnum = 1;
+ else if (syn_buf->b_syn_sync_minlines < 10)
+ lnum = syn_buf->b_syn_sync_minlines * 2;
+ else
+ lnum = syn_buf->b_syn_sync_minlines * 3 / 2;
+ if (syn_buf->b_syn_sync_maxlines != 0
+ && lnum > syn_buf->b_syn_sync_maxlines)
+ lnum = syn_buf->b_syn_sync_maxlines;
+ if (lnum >= start_lnum)
+ start_lnum = 1;
+ else
+ start_lnum -= lnum;
+ }
+ current_lnum = start_lnum;
+
+ /*
+ * 1. Search backwards for the end of a C-style comment.
+ */
+ if (syn_buf->b_syn_sync_flags & SF_CCOMMENT)
+ {
+ /* Need to make syn_buf the current buffer for a moment, to be able to
+ * use find_start_comment(). */
+ curwin_save = curwin;
+ curwin = wp;
+ curbuf_save = curbuf;
+ curbuf = syn_buf;
+
+ /*
+ * Skip lines that end in a backslash.
+ */
+ for ( ; start_lnum > 1; --start_lnum)
+ {
+ line = ml_get(start_lnum - 1);
+ if (*line == NUL || *(line + STRLEN(line) - 1) != '\\')
+ break;
+ }
+ current_lnum = start_lnum;
+
+ /* set cursor to start of search */
+ cursor_save = wp->w_cursor;
+ wp->w_cursor.lnum = start_lnum;
+ wp->w_cursor.col = 0;
+
+ /*
+ * If the line is inside a comment, need to find the syntax item that
+ * defines the comment.
+ * Restrict the search for the end of a comment to b_syn_sync_maxlines.
+ */
+ if (find_start_comment((int)syn_buf->b_syn_sync_maxlines) != NULL)
+ {
+ for (idx = syn_buf->b_syn_patterns.ga_len; --idx >= 0; )
+ if (SYN_ITEMS(syn_buf)[idx].sp_syn.id == syn_buf->b_syn_sync_id
+ && SYN_ITEMS(syn_buf)[idx].sp_type == SPTYPE_START)
+ {
+ validate_current_state();
+ if (push_current_state(idx) == OK)
+ update_si_attr(current_state.ga_len - 1);
+ break;
+ }
+ }
+
+ /* restore cursor and buffer */
+ wp->w_cursor = cursor_save;
+ curwin = curwin_save;
+ curbuf = curbuf_save;
+ }
+
+ /*
+ * 2. Search backwards for given sync patterns.
+ */
+ else if (syn_buf->b_syn_sync_flags & SF_MATCH)
+ {
+ if (syn_buf->b_syn_sync_maxlines != 0
+ && start_lnum > syn_buf->b_syn_sync_maxlines)
+ break_lnum = start_lnum - syn_buf->b_syn_sync_maxlines;
+ else
+ break_lnum = 0;
+
+ end_lnum = start_lnum;
+ lnum = start_lnum;
+ while (--lnum > break_lnum)
+ {
+ /* This can take a long time: break when CTRL-C pressed. */
+ line_breakcheck();
+ if (got_int)
+ {
+ invalidate_current_state();
+ current_lnum = start_lnum;
+ break;
+ }
+
+ /* Check if we have run into a valid saved state stack now. */
+ if (last_valid != NULL && lnum == last_valid->sst_lnum)
+ {
+ load_current_state(last_valid);
+ break;
+ }
+
+ /*
+ * Check if the previous line has the line-continuation pattern.
+ */
+ if (lnum > 1 && syn_match_linecont(lnum - 1))
+ continue;
+
+ /*
+ * Start with nothing on the state stack
+ */
+ validate_current_state();
+
+ for (current_lnum = lnum; current_lnum < end_lnum; ++current_lnum)
+ {
+ syn_start_line();
+ for (;;)
+ {
+ had_sync_point = syn_finish_line(TRUE);
+ /*
+ * When a sync point has been found, remember where, and
+ * continue to look for another one, further on in the line.
+ */
+ if (had_sync_point && current_state.ga_len)
+ {
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ if (cur_si->si_m_endpos.lnum > start_lnum)
+ {
+ /* ignore match that goes to after where started */
+ current_lnum = end_lnum;
+ break;
+ }
+ spp = &(SYN_ITEMS(syn_buf)[cur_si->si_idx]);
+ found_flags = spp->sp_flags;
+ found_match_idx = spp->sp_sync_idx;
+ found_current_lnum = current_lnum;
+ found_current_col = current_col;
+ found_m_endpos = cur_si->si_m_endpos;
+ /*
+ * Continue after the match (be aware of a zero-length
+ * match).
+ */
+ if (found_m_endpos.lnum > current_lnum)
+ {
+ current_lnum = found_m_endpos.lnum;
+ current_col = found_m_endpos.col;
+ if (current_lnum >= end_lnum)
+ break;
+ }
+ else if (found_m_endpos.col > current_col)
+ current_col = found_m_endpos.col;
+ else
+ ++current_col;
+
+ /* syn_current_attr() will have skipped the check for
+ * an item that ends here, need to do that now. */
+ ++current_col;
+ check_state_ends();
+ --current_col;
+ }
+ else
+ break;
+ }
+ }
+
+ /*
+ * If a sync point was encountered, break here.
+ */
+ if (found_flags)
+ {
+ /*
+ * Put the item that was specified by the sync point on the
+ * state stack. If there was no item specified, make the
+ * state stack empty.
+ */
+ clear_current_state();
+ if (found_match_idx >= 0
+ && push_current_state(found_match_idx) == OK)
+ update_si_attr(current_state.ga_len - 1);
+
+ /*
+ * When using "grouphere", continue from the sync point
+ * match, until the end of the line. Parsing starts at
+ * the next line.
+ * For "groupthere" the parsing starts at start_lnum.
+ */
+ if (found_flags & HL_SYNC_HERE)
+ {
+ if (current_state.ga_len)
+ {
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ cur_si->si_h_startpos.lnum = found_current_lnum;
+ cur_si->si_h_startpos.col = found_current_col;
+ update_si_end(cur_si, (int)current_col, TRUE);
+ check_keepend();
+ }
+ current_col = found_m_endpos.col;
+ current_lnum = found_m_endpos.lnum;
+ (void)syn_finish_line(FALSE);
+ ++current_lnum;
+ }
+ else
+ current_lnum = start_lnum;
+
+ break;
+ }
+
+ end_lnum = lnum;
+ invalidate_current_state();
+ }
+
+ /* Ran into start of the file or exceeded maximum number of lines */
+ if (lnum <= break_lnum)
+ {
+ invalidate_current_state();
+ current_lnum = break_lnum + 1;
+ }
+ }
+
+ validate_current_state();
+}
+
+/*
+ * Return TRUE if the line-continuation pattern matches in line "lnum".
+ */
+ static int
+syn_match_linecont(lnum)
+ linenr_T lnum;
+{
+ regmmatch_T regmatch;
+
+ if (syn_buf->b_syn_linecont_prog != NULL)
+ {
+ regmatch.rmm_ic = syn_buf->b_syn_linecont_ic;
+ regmatch.regprog = syn_buf->b_syn_linecont_prog;
+ return syn_regexec(&regmatch, lnum, (colnr_T)0);
+ }
+ return FALSE;
+}
+
+/*
+ * Prepare the current state for the start of a line.
+ */
+ static void
+syn_start_line()
+{
+ current_finished = FALSE;
+ current_col = 0;
+
+ /*
+ * Need to update the end of a start/skip/end that continues from the
+ * previous line and regions that have "keepend".
+ */
+ if (current_state.ga_len > 0)
+ syn_update_ends(TRUE);
+
+ next_match_idx = -1;
+ ++current_line_id;
+}
+
+/*
+ * Check for items in the stack that need their end updated.
+ * When "startofline" is TRUE the last item is always updated.
+ * When "startofline" is FALSE the item with "keepend" is forcefully updated.
+ */
+ static void
+syn_update_ends(startofline)
+ int startofline;
+{
+ stateitem_T *cur_si;
+ int i;
+
+ if (startofline)
+ {
+ /* Check for a match carried over from a previous line with a
+ * contained region. The match ends as soon as the region ends. */
+ for (i = 0; i < current_state.ga_len; ++i)
+ {
+ cur_si = &CUR_STATE(i);
+ if (cur_si->si_idx >= 0
+ && (SYN_ITEMS(syn_buf)[cur_si->si_idx]).sp_type
+ == SPTYPE_MATCH
+ && cur_si->si_m_endpos.lnum < current_lnum)
+ {
+ cur_si->si_flags |= HL_MATCHCONT;
+ cur_si->si_m_endpos.lnum = 0;
+ cur_si->si_m_endpos.col = 0;
+ cur_si->si_h_endpos = cur_si->si_m_endpos;
+ cur_si->si_ends = TRUE;
+ }
+ }
+ }
+
+ /*
+ * Need to update the end of a start/skip/end that continues from the
+ * previous line. And regions that have "keepend", because they may
+ * influence contained items.
+ * Then check for items ending in column 0.
+ */
+ i = current_state.ga_len - 1;
+ if (keepend_level >= 0)
+ for ( ; i > keepend_level; --i)
+ if (CUR_STATE(i).si_flags & HL_EXTEND)
+ break;
+ for ( ; i < current_state.ga_len; ++i)
+ {
+ cur_si = &CUR_STATE(i);
+ if ((cur_si->si_flags & HL_KEEPEND)
+ || (i == current_state.ga_len - 1 && startofline))
+ {
+ cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */
+ cur_si->si_h_startpos.lnum = current_lnum;
+
+ if (!(cur_si->si_flags & HL_MATCHCONT))
+ update_si_end(cur_si, (int)current_col, !startofline);
+ }
+ }
+ check_keepend();
+ check_state_ends();
+}
+
+/****************************************
+ * Handling of the state stack cache.
+ */
+
+/*
+ * EXPLANATION OF THE SYNTAX STATE STACK CACHE
+ *
+ * To speed up syntax highlighting, the state stack for the start of some
+ * lines is cached. These entries can be used to start parsing at that point.
+ *
+ * The stack is kept in b_sst_array[] for each buffer. There is a list of
+ * valid entries. b_sst_first points to the first one, then follow sst_next.
+ * The entries are sorted on line number. The first entry is often for line 2
+ * (line 1 always starts with an empty stack).
+ * There is also a list for free entries. This construction is used to avoid
+ * having to allocate and free memory blocks too often.
+ *
+ * When making changes to the buffer, this is logged in b_mod_*. When calling
+ * update_screen() to update the display, it will call
+ * syn_stack_apply_changes() for each displayed buffer to adjust the cached
+ * entries. The entries which are inside the changed area are removed,
+ * because they must be recomputed. Entries below the changed have their line
+ * number adjusted for deleted/inserted lines, and have their sst_change_lnum
+ * set to indicate that a check must be made if the changed lines would change
+ * the cached entry.
+ *
+ * When later displaying lines, an entry is stored for each line. Displayed
+ * lines are likely to be displayed again, in which case the state at the
+ * start of the line is needed.
+ * For not displayed lines, an entry is stored for every so many lines. These
+ * entries will be used e.g., when scrolling backwards. The distance between
+ * entries depends on the number of lines in the buffer. For small buffers
+ * the distance is fixed at SST_DIST, for large buffers there is a fixed
+ * number of entries SST_MAX_ENTRIES, and the distance is computed.
+ */
+
+/*
+ * Free b_sst_array[] for buffer "buf".
+ * Used when syntax items changed to force resyncing everywhere.
+ */
+ void
+syn_stack_free_all(buf)
+ buf_T *buf;
+{
+ synstate_T *p;
+ win_T *wp;
+
+ if (buf->b_sst_array != NULL)
+ {
+ for (p = buf->b_sst_first; p != NULL; p = p->sst_next)
+ clear_syn_state(p);
+ vim_free(buf->b_sst_array);
+ buf->b_sst_array = NULL;
+ buf->b_sst_len = 0;
+ }
+#ifdef FEAT_FOLDING
+ /* When using "syntax" fold method, must update all folds. */
+ FOR_ALL_WINDOWS(wp)
+ {
+ if (wp->w_buffer == buf && foldmethodIsSyntax(wp))
+ foldUpdateAll(wp);
+ }
+#endif
+}
+
+/*
+ * Allocate the syntax state stack for syn_buf when needed.
+ * If the number of entries in b_sst_array[] is much too big or a bit too
+ * small, reallocate it.
+ * Also used to allocate b_sst_array[] for the first time.
+ */
+ static void
+syn_stack_alloc()
+{
+ long len;
+ synstate_T *to, *from;
+ synstate_T *sstp;
+
+ len = syn_buf->b_ml.ml_line_count / SST_DIST + Rows * 2;
+ if (len < SST_MIN_ENTRIES)
+ len = SST_MIN_ENTRIES;
+ else if (len > SST_MAX_ENTRIES)
+ len = SST_MAX_ENTRIES;
+ if (syn_buf->b_sst_len > len * 2 || syn_buf->b_sst_len < len)
+ {
+ /* Allocate 50% too much, to avoid reallocating too often. */
+ len = syn_buf->b_ml.ml_line_count;
+ len = (len + len / 2) / SST_DIST + Rows * 2;
+ if (len < SST_MIN_ENTRIES)
+ len = SST_MIN_ENTRIES;
+ else if (len > SST_MAX_ENTRIES)
+ len = SST_MAX_ENTRIES;
+
+ if (syn_buf->b_sst_array != NULL)
+ {
+ /* When shrinking the array, cleanup the existing stack.
+ * Make sure that all valid entries fit in the new array. */
+ while (syn_buf->b_sst_len - syn_buf->b_sst_freecount + 2 > len
+ && syn_stack_cleanup())
+ ;
+ if (len < syn_buf->b_sst_len - syn_buf->b_sst_freecount + 2)
+ len = syn_buf->b_sst_len - syn_buf->b_sst_freecount + 2;
+ }
+
+ sstp = (synstate_T *)alloc_clear((unsigned)(len * sizeof(synstate_T)));
+ if (sstp == NULL) /* out of memory! */
+ return;
+
+ to = sstp - 1;
+ if (syn_buf->b_sst_array != NULL)
+ {
+ /* Move the states from the old array to the new one. */
+ for (from = syn_buf->b_sst_first; from != NULL;
+ from = from->sst_next)
+ {
+ ++to;
+ *to = *from;
+ to->sst_next = to + 1;
+ }
+ }
+ if (to != sstp - 1)
+ {
+ to->sst_next = NULL;
+ syn_buf->b_sst_first = sstp;
+ syn_buf->b_sst_freecount = len - (int)(to - sstp) - 1;
+ }
+ else
+ {
+ syn_buf->b_sst_first = NULL;
+ syn_buf->b_sst_freecount = len;
+ }
+
+ /* Create the list of free entries. */
+ syn_buf->b_sst_firstfree = to + 1;
+ while (++to < sstp + len)
+ to->sst_next = to + 1;
+ (sstp + len - 1)->sst_next = NULL;
+
+ vim_free(syn_buf->b_sst_array);
+ syn_buf->b_sst_array = sstp;
+ syn_buf->b_sst_len = len;
+ }
+}
+
+/*
+ * Check for changes in a buffer to affect stored syntax states. Uses the
+ * b_mod_* fields.
+ * Called from update_screen(), before screen is being updated, once for each
+ * displayed buffer.
+ */
+ void
+syn_stack_apply_changes(buf)
+ buf_T *buf;
+{
+ synstate_T *p, *prev, *np;
+ linenr_T n;
+
+ if (buf->b_sst_array == NULL) /* nothing to do */
+ return;
+
+ prev = NULL;
+ for (p = buf->b_sst_first; p != NULL; )
+ {
+ if (p->sst_lnum + syn_buf->b_syn_sync_linebreaks > buf->b_mod_top)
+ {
+ n = p->sst_lnum + buf->b_mod_xlines;
+ if (n <= buf->b_mod_bot)
+ {
+ /* this state is inside the changed area, remove it */
+ np = p->sst_next;
+ if (prev == NULL)
+ buf->b_sst_first = np;
+ else
+ prev->sst_next = np;
+ syn_stack_free_entry(buf, p);
+ p = np;
+ continue;
+ }
+ /* This state is below the changed area. Remember the line
+ * that needs to be parsed before this entry can be made valid
+ * again. */
+ if (p->sst_change_lnum != 0 && p->sst_change_lnum > buf->b_mod_top)
+ {
+ if (p->sst_change_lnum + buf->b_mod_xlines > buf->b_mod_top)
+ p->sst_change_lnum += buf->b_mod_xlines;
+ else
+ p->sst_change_lnum = buf->b_mod_top;
+ }
+ if (p->sst_change_lnum == 0
+ || p->sst_change_lnum < buf->b_mod_bot)
+ p->sst_change_lnum = buf->b_mod_bot;
+
+ p->sst_lnum = n;
+ }
+ prev = p;
+ p = p->sst_next;
+ }
+}
+
+/*
+ * Reduce the number of entries in the state stack for syn_buf.
+ * Returns TRUE if at least one entry was freed.
+ */
+ static int
+syn_stack_cleanup()
+{
+ synstate_T *p, *prev;
+ disptick_T tick;
+ int above;
+ int dist;
+ int retval = FALSE;
+
+ if (syn_buf->b_sst_array == NULL || syn_buf->b_sst_first == NULL)
+ return retval;
+
+ /* Compute normal distance between non-displayed entries. */
+ dist = syn_buf->b_ml.ml_line_count / (syn_buf->b_sst_len - Rows) + 1;
+
+ /*
+ * Go throught the list to find the "tick" for the oldest entry that can
+ * be removed. Set "above" when the "tick" for the oldest entry is above
+ * "b_sst_lasttick" (the display tick wraps around).
+ */
+ tick = syn_buf->b_sst_lasttick;
+ above = FALSE;
+ prev = syn_buf->b_sst_first;
+ for (p = prev->sst_next; p != NULL; prev = p, p = p->sst_next)
+ {
+ if (prev->sst_lnum + dist > p->sst_lnum)
+ {
+ if (p->sst_tick > syn_buf->b_sst_lasttick)
+ {
+ if (!above || p->sst_tick < tick)
+ tick = p->sst_tick;
+ above = TRUE;
+ }
+ else if (!above && p->sst_tick < tick)
+ tick = p->sst_tick;
+ }
+ }
+
+ /*
+ * Go through the list to make the entries for the oldest tick at an
+ * interval of several lines.
+ */
+ prev = syn_buf->b_sst_first;
+ for (p = prev->sst_next; p != NULL; prev = p, p = p->sst_next)
+ {
+ if (p->sst_tick == tick && prev->sst_lnum + dist > p->sst_lnum)
+ {
+ /* Move this entry from used list to free list */
+ prev->sst_next = p->sst_next;
+ syn_stack_free_entry(syn_buf, p);
+ p = prev;
+ retval = TRUE;
+ }
+ }
+ return retval;
+}
+
+/*
+ * Free the allocated memory for a syn_state item.
+ * Move the entry into the free list.
+ */
+ static void
+syn_stack_free_entry(buf, p)
+ buf_T *buf;
+ synstate_T *p;
+{
+ clear_syn_state(p);
+ p->sst_next = buf->b_sst_firstfree;
+ buf->b_sst_firstfree = p;
+ ++buf->b_sst_freecount;
+}
+
+/*
+ * Find an entry in the list of state stacks at or before "lnum".
+ * Returns NULL when there is no entry or the first entry is after "lnum".
+ */
+ static synstate_T *
+syn_stack_find_entry(lnum)
+ linenr_T lnum;
+{
+ synstate_T *p, *prev;
+
+ prev = NULL;
+ for (p = syn_buf->b_sst_first; p != NULL; prev = p, p = p->sst_next)
+ {
+ if (p->sst_lnum == lnum)
+ return p;
+ if (p->sst_lnum > lnum)
+ break;
+ }
+ return prev;
+}
+
+/*
+ * Try saving the current state in b_sst_array[].
+ * The current state must be valid for the start of the current_lnum line!
+ */
+ static synstate_T *
+store_current_state(sp)
+ synstate_T *sp; /* at or before where state is to be saved or
+ NULL */
+{
+ int i;
+ synstate_T *p;
+ bufstate_T *bp;
+ stateitem_T *cur_si;
+
+ if (sp == NULL)
+ sp = syn_stack_find_entry(current_lnum);
+
+ /*
+ * If the current state contains a start or end pattern that continues
+ * from the previous line, we can't use it. Don't store it then.
+ */
+ for (i = current_state.ga_len - 1; i >= 0; --i)
+ {
+ cur_si = &CUR_STATE(i);
+ if (cur_si->si_h_startpos.lnum >= current_lnum
+ || cur_si->si_m_endpos.lnum >= current_lnum
+ || cur_si->si_h_endpos.lnum >= current_lnum
+ || (cur_si->si_end_idx
+ && cur_si->si_eoe_pos.lnum >= current_lnum))
+ break;
+ }
+ if (i >= 0)
+ {
+ if (sp != NULL)
+ {
+ /* find "sp" in the list and remove it */
+ if (syn_buf->b_sst_first == sp)
+ /* it's the first entry */
+ syn_buf->b_sst_first = sp->sst_next;
+ else
+ {
+ /* find the entry just before this one to adjust sst_next */
+ for (p = syn_buf->b_sst_first; p != NULL; p = p->sst_next)
+ if (p->sst_next == sp)
+ break;
+ p->sst_next = sp->sst_next;
+ }
+ syn_stack_free_entry(syn_buf, sp);
+ sp = NULL;
+ }
+ }
+ else if (sp == NULL || sp->sst_lnum != current_lnum)
+ {
+ /*
+ * Add a new entry
+ */
+ /* If no free items, cleanup the array first. */
+ if (syn_buf->b_sst_freecount == 0)
+ {
+ (void)syn_stack_cleanup();
+ /* "sp" may have been moved to the freelist now */
+ sp = syn_stack_find_entry(current_lnum);
+ }
+ /* Still no free items? Must be a strange problem... */
+ if (syn_buf->b_sst_freecount == 0)
+ sp = NULL;
+ else
+ {
+ /* Take the first item from the free list and put it in the used
+ * list, after *sp */
+ p = syn_buf->b_sst_firstfree;
+ syn_buf->b_sst_firstfree = p->sst_next;
+ --syn_buf->b_sst_freecount;
+ if (sp == NULL)
+ {
+ /* Insert in front of the list */
+ p->sst_next = syn_buf->b_sst_first;
+ syn_buf->b_sst_first = p;
+ }
+ else
+ {
+ /* insert in list after *sp */
+ p->sst_next = sp->sst_next;
+ sp->sst_next = p;
+ }
+ sp = p;
+ sp->sst_stacksize = 0;
+ sp->sst_lnum = current_lnum;
+ }
+ }
+ if (sp != NULL)
+ {
+ /* When overwriting an existing state stack, clear it first */
+ clear_syn_state(sp);
+ sp->sst_stacksize = current_state.ga_len;
+ if (current_state.ga_len > SST_FIX_STATES)
+ {
+ /* Need to clear it, might be something remaining from when the
+ * length was less than SST_FIX_STATES. */
+ ga_init2(&sp->sst_union.sst_ga, (int)sizeof(bufstate_T), 1);
+ if (ga_grow(&sp->sst_union.sst_ga, current_state.ga_len) == FAIL)
+ sp->sst_stacksize = 0;
+ else
+ {
+ sp->sst_union.sst_ga.ga_len = current_state.ga_len;
+ sp->sst_union.sst_ga.ga_room -= current_state.ga_len;
+ }
+ bp = SYN_STATE_P(&(sp->sst_union.sst_ga));
+ }
+ else
+ bp = sp->sst_union.sst_stack;
+ for (i = 0; i < sp->sst_stacksize; ++i)
+ {
+ bp[i].bs_idx = CUR_STATE(i).si_idx;
+ bp[i].bs_flags = CUR_STATE(i).si_flags;
+ bp[i].bs_extmatch = ref_extmatch(CUR_STATE(i).si_extmatch);
+ }
+ sp->sst_next_flags = current_next_flags;
+ sp->sst_next_list = current_next_list;
+ sp->sst_tick = display_tick;
+ sp->sst_change_lnum = 0;
+ }
+ current_state_stored = TRUE;
+ return sp;
+}
+
+/*
+ * Copy a state stack from "from" in b_sst_array[] to current_state;
+ */
+ static void
+load_current_state(from)
+ synstate_T *from;
+{
+ int i;
+ bufstate_T *bp;
+
+ clear_current_state();
+ validate_current_state();
+ keepend_level = -1;
+ if (from->sst_stacksize
+ && ga_grow(&current_state, from->sst_stacksize) != FAIL)
+ {
+ if (from->sst_stacksize > SST_FIX_STATES)
+ bp = SYN_STATE_P(&(from->sst_union.sst_ga));
+ else
+ bp = from->sst_union.sst_stack;
+ for (i = 0; i < from->sst_stacksize; ++i)
+ {
+ CUR_STATE(i).si_idx = bp[i].bs_idx;
+ CUR_STATE(i).si_flags = bp[i].bs_flags;
+ CUR_STATE(i).si_extmatch = ref_extmatch(bp[i].bs_extmatch);
+ if (keepend_level < 0 && (CUR_STATE(i).si_flags & HL_KEEPEND))
+ keepend_level = i;
+ CUR_STATE(i).si_ends = FALSE;
+ CUR_STATE(i).si_m_lnum = 0;
+ if (CUR_STATE(i).si_idx >= 0)
+ CUR_STATE(i).si_next_list =
+ (SYN_ITEMS(syn_buf)[CUR_STATE(i).si_idx]).sp_next_list;
+ else
+ CUR_STATE(i).si_next_list = NULL;
+ update_si_attr(i);
+ }
+ current_state.ga_len = from->sst_stacksize;
+ current_state.ga_room -= current_state.ga_len;
+ }
+ current_next_list = from->sst_next_list;
+ current_next_flags = from->sst_next_flags;
+ current_lnum = from->sst_lnum;
+}
+
+/*
+ * Compare saved state stack "*sp" with the current state.
+ * Return TRUE when they are equal.
+ */
+ static int
+syn_stack_equal(sp)
+ synstate_T *sp;
+{
+ int i, j;
+ bufstate_T *bp;
+ reg_extmatch_T *six, *bsx;
+
+ /* First a quick check if the stacks have the same size end nextlist. */
+ if (sp->sst_stacksize == current_state.ga_len
+ && sp->sst_next_list == current_next_list)
+ {
+ /* Need to compare all states on both stacks. */
+ if (sp->sst_stacksize > SST_FIX_STATES)
+ bp = SYN_STATE_P(&(sp->sst_union.sst_ga));
+ else
+ bp = sp->sst_union.sst_stack;
+
+ for (i = current_state.ga_len; --i >= 0; )
+ {
+ /* If the item has another index the state is different. */
+ if (bp[i].bs_idx != CUR_STATE(i).si_idx)
+ break;
+ if (bp[i].bs_extmatch != CUR_STATE(i).si_extmatch)
+ {
+ /* When the extmatch pointers are different, the strings in
+ * them can still be the same. Check if the extmatch
+ * references are equal. */
+ bsx = bp[i].bs_extmatch;
+ six = CUR_STATE(i).si_extmatch;
+ /* If one of the extmatch pointers is NULL the states are
+ * different. */
+ if (bsx == NULL || six == NULL)
+ break;
+ for (j = 0; j < NSUBEXP; ++j)
+ {
+ /* Check each referenced match string. They must all be
+ * equal. */
+ if (bsx->matches[j] != six->matches[j])
+ {
+ /* If the pointer is different it can still be the
+ * same text. Compare the strings, ignore case when
+ * the start item has the sp_ic flag set. */
+ if (bsx->matches[j] == NULL
+ || six->matches[j] == NULL)
+ break;
+ if ((SYN_ITEMS(syn_buf)[CUR_STATE(i).si_idx]).sp_ic
+ ? MB_STRICMP(bsx->matches[j],
+ six->matches[j]) != 0
+ : STRCMP(bsx->matches[j], six->matches[j]) != 0)
+ break;
+ }
+ }
+ if (j != NSUBEXP)
+ break;
+ }
+ }
+ if (i < 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * We stop parsing syntax above line "lnum". If the stored state at or below
+ * this line depended on a change before it, it now depends on the line below
+ * the last parsed line.
+ * The window looks like this:
+ * line which changed
+ * displayed line
+ * displayed line
+ * lnum -> line below window
+ */
+ void
+syntax_end_parsing(lnum)
+ linenr_T lnum;
+{
+ synstate_T *sp;
+
+ sp = syn_stack_find_entry(lnum);
+ if (sp != NULL && sp->sst_lnum < lnum)
+ sp = sp->sst_next;
+
+ if (sp != NULL && sp->sst_change_lnum != 0)
+ sp->sst_change_lnum = lnum;
+}
+
+/*
+ * End of handling of the state stack.
+ ****************************************/
+
+ static void
+invalidate_current_state()
+{
+ clear_current_state();
+ current_state.ga_itemsize = 0; /* mark current_state invalid */
+ current_next_list = NULL;
+ keepend_level = -1;
+}
+
+ static void
+validate_current_state()
+{
+ current_state.ga_itemsize = sizeof(stateitem_T);
+ current_state.ga_growsize = 3;
+}
+
+/*
+ * Return TRUE if the syntax at start of lnum changed since last time.
+ * This will only be called just after get_syntax_attr() for the previous
+ * line, to check if the next line needs to be redrawn too.
+ */
+ int
+syntax_check_changed(lnum)
+ linenr_T lnum;
+{
+ int retval = TRUE;
+ synstate_T *sp;
+
+ reg_syn = TRUE; /* let vim_regexec() know we're using syntax */
+
+ /*
+ * Check the state stack when:
+ * - lnum is just below the previously syntaxed line.
+ * - lnum is not before the lines with saved states.
+ * - lnum is not past the lines with saved states.
+ * - lnum is at or before the last changed line.
+ */
+ if (VALID_STATE(&current_state) && lnum == current_lnum + 1)
+ {
+ sp = syn_stack_find_entry(lnum);
+ if (sp != NULL && sp->sst_lnum == lnum)
+ {
+ /*
+ * finish the previous line (needed when not all of the line was
+ * drawn)
+ */
+ (void)syn_finish_line(FALSE);
+
+ /*
+ * Compare the current state with the previously saved state of
+ * the line.
+ */
+ if (syn_stack_equal(sp))
+ retval = FALSE;
+
+ /*
+ * Store the current state in b_sst_array[] for later use.
+ */
+ ++current_lnum;
+ (void)store_current_state(NULL);
+ }
+ }
+
+ reg_syn = FALSE;
+
+ return retval;
+}
+
+/*
+ * Finish the current line.
+ * This doesn't return any attributes, it only gets the state at the end of
+ * the line. It can start anywhere in the line, as long as the current state
+ * is valid.
+ */
+ static int
+syn_finish_line(syncing)
+ int syncing; /* called for syncing */
+{
+ stateitem_T *cur_si;
+
+ if (!current_finished)
+ {
+ while (!current_finished)
+ {
+ (void)syn_current_attr(syncing, FALSE);
+ /*
+ * When syncing, and found some item, need to check the item.
+ */
+ if (syncing && current_state.ga_len)
+ {
+ /*
+ * Check for match with sync item.
+ */
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ if (cur_si->si_idx >= 0
+ && (SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_flags
+ & (HL_SYNC_HERE|HL_SYNC_THERE)))
+ return TRUE;
+
+ /* syn_current_attr() will have skipped the check for an item
+ * that ends here, need to do that now. */
+ ++current_col;
+ check_state_ends();
+ --current_col;
+ }
+ ++current_col;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Return highlight attributes for next character.
+ * Must first call syntax_start() once for the line.
+ * "col" is normally 0 for the first use in a line, and increments by one each
+ * time. It's allowed to skip characters and to stop before the end of the
+ * line. But only a "col" after a previously used column is allowed.
+ */
+ int
+get_syntax_attr(col)
+ colnr_T col;
+{
+ int attr = 0;
+
+ /* check for out of memory situation */
+ if (syn_buf->b_sst_array == NULL)
+ return 0;
+
+ reg_syn = TRUE; /* let vim_regexec() know we're using syntax */
+
+ /* Make sure current_state is valid */
+ if (INVALID_STATE(&current_state))
+ validate_current_state();
+
+ /*
+ * Skip from the current column to "col", get the attributes for "col".
+ */
+ while (current_col <= col)
+ {
+ attr = syn_current_attr(FALSE, TRUE);
+ ++current_col;
+ }
+
+ reg_syn = FALSE;
+ return attr;
+}
+
+/*
+ * Get syntax attributes for current_lnum, current_col.
+ */
+ static int
+syn_current_attr(syncing, displaying)
+ int syncing; /* When 1: called for syncing */
+ int displaying; /* result will be displayed */
+{
+ int syn_id;
+ lpos_T endpos; /* was: char_u *endp; */
+ lpos_T hl_startpos; /* was: int hl_startcol; */
+ lpos_T hl_endpos;
+ lpos_T eos_pos; /* end-of-start match (start region) */
+ lpos_T eoe_pos; /* end-of-end pattern */
+ int end_idx; /* group ID for end pattern */
+ int idx;
+ synpat_T *spp;
+ stateitem_T *cur_si, *sip;
+ int startcol;
+ int endcol;
+ long flags;
+ short *next_list;
+ int found_match; /* found usable match */
+ static int try_next_column = FALSE; /* must try in next col */
+ int do_keywords;
+ regmmatch_T regmatch;
+ lpos_T pos;
+ int lc_col;
+ reg_extmatch_T *cur_extmatch = NULL;
+ char_u *line; /* current line. NOTE: becomes invalid after
+ looking for a pattern match! */
+
+ /* variables for zero-width matches that have a "nextgroup" argument */
+ int keep_next_list;
+ int zero_width_next_list = FALSE;
+ garray_T zero_width_next_ga;
+
+ /*
+ * No character, no attributes! Past end of line?
+ * Do try matching with an empty line (could be the start of a region).
+ */
+ line = syn_getcurline();
+ if (line[current_col] == NUL && current_col != 0)
+ {
+ /*
+ * If we found a match after the last column, use it.
+ */
+ if (next_match_idx >= 0 && next_match_col >= (int)current_col
+ && next_match_col != MAXCOL)
+ (void)push_next_match(NULL);
+
+ current_finished = TRUE;
+ current_state_stored = FALSE;
+ return 0;
+ }
+
+ /* if the current or next character is NUL, we will finish the line now */
+ if (line[current_col] == NUL || line[current_col + 1] == NUL)
+ {
+ current_finished = TRUE;
+ current_state_stored = FALSE;
+ }
+
+ /*
+ * When in the previous column there was a match but it could not be used
+ * (empty match or already matched in this column) need to try again in
+ * the next column.
+ */
+ if (try_next_column)
+ {
+ next_match_idx = -1;
+ try_next_column = FALSE;
+ }
+
+ /* Only check for keywords when not syncing and there are some. */
+ do_keywords = !syncing
+ && (syn_buf->b_keywtab != NULL
+ || syn_buf->b_keywtab_ic != NULL);
+
+ /* Init the list of zero-width matches with a nextlist. This is used to
+ * avoid matching the same item in the same position twice. */
+ ga_init2(&zero_width_next_ga, (int)sizeof(int), 10);
+
+ /*
+ * Repeat matching keywords and patterns, to find contained items at the
+ * same column. This stops when there are no extra matches at the current
+ * column.
+ */
+ do
+ {
+ found_match = FALSE;
+ keep_next_list = FALSE;
+ syn_id = 0;
+
+ /*
+ * 1. Check for a current state.
+ * Only when there is no current state, or if the current state may
+ * contain other things, we need to check for keywords and patterns.
+ * Always need to check for contained items if some item has the
+ * "containedin" argument (takes extra time!).
+ */
+ if (current_state.ga_len)
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ else
+ cur_si = NULL;
+
+ if (syn_buf->b_syn_containedin || cur_si == NULL
+ || cur_si->si_cont_list != NULL)
+ {
+ /*
+ * 2. Check for keywords, if on a keyword char after a non-keyword
+ * char. Don't do this when syncing.
+ */
+ if (do_keywords)
+ {
+ line = syn_getcurline();
+ if (vim_iswordc_buf(line + current_col, syn_buf)
+ && (current_col == 0
+ || !vim_iswordc_buf(line + current_col - 1
+#ifdef FEAT_MBYTE
+ - (has_mbyte
+ ? (*mb_head_off)(line, line + current_col - 1)
+ : 0)
+#endif
+ , syn_buf)))
+ {
+ syn_id = check_keyword_id(line, (int)current_col,
+ &endcol, &flags, &next_list, cur_si);
+ if (syn_id)
+ {
+ if (push_current_state(KEYWORD_IDX) == OK)
+ {
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ cur_si->si_m_startcol = current_col;
+ cur_si->si_h_startpos.lnum = current_lnum;
+ cur_si->si_h_startpos.col = 0; /* starts right away */
+ cur_si->si_m_endpos.lnum = current_lnum;
+ cur_si->si_m_endpos.col = endcol;
+ cur_si->si_h_endpos.lnum = current_lnum;
+ cur_si->si_h_endpos.col = endcol;
+ cur_si->si_ends = TRUE;
+ cur_si->si_end_idx = 0;
+ cur_si->si_flags = flags;
+ cur_si->si_id = syn_id;
+ cur_si->si_trans_id = syn_id;
+ if (flags & HL_TRANSP)
+ {
+ if (current_state.ga_len < 2)
+ {
+ cur_si->si_attr = 0;
+ cur_si->si_trans_id = 0;
+ }
+ else
+ {
+ cur_si->si_attr = CUR_STATE(
+ current_state.ga_len - 2).si_attr;
+ cur_si->si_trans_id = CUR_STATE(
+ current_state.ga_len - 2).si_trans_id;
+ }
+ }
+ else
+ cur_si->si_attr = syn_id2attr(syn_id);
+ cur_si->si_cont_list = NULL;
+ cur_si->si_next_list = next_list;
+ check_keepend();
+ }
+ else
+ vim_free(next_list);
+ }
+ }
+ }
+
+ /*
+ * 3. Check for patterns (only if not found a keyword).
+ */
+ if (syn_id == 0 && syn_buf->b_syn_patterns.ga_len)
+ {
+ /*
+ * If we didn't check for a match yet, or we are past it, check
+ * for any match with a pattern.
+ */
+ if (next_match_idx < 0 || next_match_col < (int)current_col)
+ {
+ /*
+ * Check all relevant patterns for a match at this
+ * position. This is complicated, because matching with a
+ * pattern takes quite a bit of time, thus we want to
+ * avoid doing it when it's not needed.
+ */
+ next_match_idx = 0; /* no match in this line yet */
+ next_match_col = MAXCOL;
+ for (idx = syn_buf->b_syn_patterns.ga_len; --idx >= 0; )
+ {
+ spp = &(SYN_ITEMS(syn_buf)[idx]);
+ if ( spp->sp_syncing == syncing
+ && (displaying || !(spp->sp_flags & HL_DISPLAY))
+ && (spp->sp_type == SPTYPE_MATCH
+ || spp->sp_type == SPTYPE_START)
+ && (current_next_list != NULL
+ ? in_id_list(NULL, current_next_list,
+ &spp->sp_syn, 0)
+ : (cur_si == NULL
+ ? !(spp->sp_flags & HL_CONTAINED)
+ : in_id_list(cur_si,
+ cur_si->si_cont_list, &spp->sp_syn,
+ spp->sp_flags & HL_CONTAINED))))
+ {
+ /* If we already tried matching in this line, and
+ * there isn't a match before next_match_col, skip
+ * this item. */
+ if (spp->sp_line_id == current_line_id
+ && spp->sp_startcol >= next_match_col)
+ continue;
+ spp->sp_line_id = current_line_id;
+
+ lc_col = current_col - spp->sp_offsets[SPO_LC_OFF];
+ if (lc_col < 0)
+ lc_col = 0;
+
+ regmatch.rmm_ic = spp->sp_ic;
+ regmatch.regprog = spp->sp_prog;
+ if (!syn_regexec(&regmatch, current_lnum,
+ (colnr_T)lc_col))
+ {
+ /* no match in this line, try another one */
+ spp->sp_startcol = MAXCOL;
+ continue;
+ }
+
+ /*
+ * Compute the first column of the match.
+ */
+ syn_add_start_off(&pos, &regmatch,
+ spp, SPO_MS_OFF, -1);
+ if (pos.lnum > current_lnum)
+ {
+ /* must have used end of match in a next line,
+ * we can't handle that */
+ spp->sp_startcol = MAXCOL;
+ continue;
+ }
+ startcol = pos.col;
+
+ /* remember the next column where this pattern
+ * matches in the current line */
+ spp->sp_startcol = startcol;
+
+ /*
+ * If a previously found match starts at a lower
+ * column number, don't use this one.
+ */
+ if (startcol >= next_match_col)
+ continue;
+
+ /*
+ * If we matched this pattern at this position
+ * before, skip it. Must retry in the next
+ * column, because it may match from there.
+ */
+ if (did_match_already(idx, &zero_width_next_ga))
+ {
+ try_next_column = TRUE;
+ continue;
+ }
+
+ endpos.lnum = regmatch.endpos[0].lnum;
+ endpos.col = regmatch.endpos[0].col;
+
+ /* Compute the highlight start. */
+ syn_add_start_off(&hl_startpos, &regmatch,
+ spp, SPO_HS_OFF, -1);
+
+ /* Compute the region start. */
+ /* Default is to use the end of the match. */
+ syn_add_end_off(&eos_pos, &regmatch,
+ spp, SPO_RS_OFF, 0);
+
+ /*
+ * Grab the external submatches before they get
+ * overwritten. Reference count doesn't change.
+ */
+ unref_extmatch(cur_extmatch);
+ cur_extmatch = re_extmatch_out;
+ re_extmatch_out = NULL;
+
+ flags = 0;
+ eoe_pos.lnum = 0; /* avoid warning */
+ eoe_pos.col = 0;
+ end_idx = 0;
+ hl_endpos.lnum = 0;
+
+ /*
+ * For a "oneline" the end must be found in the
+ * same line too. Search for it after the end of
+ * the match with the start pattern. Set the
+ * resulting end positions at the same time.
+ */
+ if (spp->sp_type == SPTYPE_START
+ && (spp->sp_flags & HL_ONELINE))
+ {
+ lpos_T startpos;
+
+ startpos = endpos;
+ find_endpos(idx, &startpos, &endpos, &hl_endpos,
+ &flags, &eoe_pos, &end_idx, cur_extmatch);
+ if (endpos.lnum == 0)
+ continue; /* not found */
+ }
+
+ /*
+ * For a "match" the size must be > 0 after the
+ * end offset needs has been added. Except when
+ * syncing.
+ */
+ else if (spp->sp_type == SPTYPE_MATCH)
+ {
+ syn_add_end_off(&hl_endpos, &regmatch, spp,
+ SPO_HE_OFF, 0);
+ syn_add_end_off(&endpos, &regmatch, spp,
+ SPO_ME_OFF, 0);
+ if (endpos.lnum == current_lnum
+ && (int)endpos.col + syncing < startcol)
+ {
+ /*
+ * If an empty string is matched, may need
+ * to try matching again at next column.
+ */
+ if (regmatch.startpos[0].col
+ == regmatch.endpos[0].col)
+ try_next_column = TRUE;
+ continue;
+ }
+ }
+
+ /*
+ * keep the best match so far in next_match_*
+ */
+ /* Highlighting must start after startpos and end
+ * before endpos. */
+ if (hl_startpos.lnum == current_lnum
+ && (int)hl_startpos.col < startcol)
+ hl_startpos.col = startcol;
+ limit_pos_zero(&hl_endpos, &endpos);
+
+ next_match_idx = idx;
+ next_match_col = startcol;
+ next_match_m_endpos = endpos;
+ next_match_h_endpos = hl_endpos;
+ next_match_h_startpos = hl_startpos;
+ next_match_flags = flags;
+ next_match_eos_pos = eos_pos;
+ next_match_eoe_pos = eoe_pos;
+ next_match_end_idx = end_idx;
+ unref_extmatch(next_match_extmatch);
+ next_match_extmatch = cur_extmatch;
+ cur_extmatch = NULL;
+ }
+ }
+ }
+
+ /*
+ * If we found a match at the current column, use it.
+ */
+ if (next_match_idx >= 0 && next_match_col == (int)current_col)
+ {
+ synpat_T *lspp;
+
+ /* When a zero-width item matched which has a nextgroup,
+ * don't push the item but set nextgroup. */
+ lspp = &(SYN_ITEMS(syn_buf)[next_match_idx]);
+ if (next_match_m_endpos.lnum == current_lnum
+ && next_match_m_endpos.col == current_col
+ && lspp->sp_next_list != NULL)
+ {
+ current_next_list = lspp->sp_next_list;
+ current_next_flags = lspp->sp_flags;
+ keep_next_list = TRUE;
+ zero_width_next_list = TRUE;
+
+ /* Add the index to a list, so that we can check
+ * later that we don't match it again (and cause an
+ * endless loop). */
+ if (ga_grow(&zero_width_next_ga, 1) == OK)
+ {
+ ((int *)(zero_width_next_ga.ga_data))
+ [zero_width_next_ga.ga_len++] = next_match_idx;
+ --zero_width_next_ga.ga_room;
+ }
+ next_match_idx = -1;
+ }
+ else
+ cur_si = push_next_match(cur_si);
+ found_match = TRUE;
+ }
+ }
+ }
+
+ /*
+ * Handle searching for nextgroup match.
+ */
+ if (current_next_list != NULL && !keep_next_list)
+ {
+ /*
+ * If a nextgroup was not found, continue looking for one if:
+ * - this is an empty line and the "skipempty" option was given
+ * - we are on white space and the "skipwhite" option was given
+ */
+ if (!found_match)
+ {
+ line = syn_getcurline();
+ if (((current_next_flags & HL_SKIPWHITE)
+ && vim_iswhite(line[current_col]))
+ || ((current_next_flags & HL_SKIPEMPTY)
+ && *line == NUL))
+ break;
+ }
+
+ /*
+ * If a nextgroup was found: Use it, and continue looking for
+ * contained matches.
+ * If a nextgroup was not found: Continue looking for a normal
+ * match.
+ * When did set current_next_list for a zero-width item and no
+ * match was found don't loop (would get stuck).
+ */
+ current_next_list = NULL;
+ next_match_idx = -1;
+ if (!zero_width_next_list)
+ found_match = TRUE;
+ }
+
+ } while (found_match);
+
+ /*
+ * Use attributes from the current state, if within its highlighting.
+ * If not, use attributes from the current-but-one state, etc.
+ */
+ current_attr = 0;
+#ifdef FEAT_EVAL
+ current_id = 0;
+ current_trans_id = 0;
+#endif
+ if (cur_si != NULL)
+ {
+ for (idx = current_state.ga_len - 1; idx >= 0; --idx)
+ {
+ sip = &CUR_STATE(idx);
+ if ((current_lnum > sip->si_h_startpos.lnum
+ || (current_lnum == sip->si_h_startpos.lnum
+ && current_col >= sip->si_h_startpos.col))
+ && (sip->si_h_endpos.lnum == 0
+ || current_lnum < sip->si_h_endpos.lnum
+ || (current_lnum == sip->si_h_endpos.lnum
+ && current_col < sip->si_h_endpos.col)))
+ {
+ current_attr = sip->si_attr;
+#ifdef FEAT_EVAL
+ current_id = sip->si_id;
+ current_trans_id = sip->si_trans_id;
+#endif
+ break;
+ }
+ }
+
+ /*
+ * Check for end of current state (and the states before it) at the
+ * next column. Don't do this for syncing, because we would miss a
+ * single character match.
+ * First check if the current state ends at the current column. It
+ * may be for an empty match and a containing item might end in the
+ * current column.
+ */
+ if (!syncing)
+ {
+ check_state_ends();
+ if (current_state.ga_len > 0)
+ {
+ ++current_col;
+ check_state_ends();
+ --current_col;
+ }
+ }
+ }
+
+ /* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */
+ if (current_next_list != NULL
+ && syn_getcurline()[current_col + 1] == NUL
+ && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY)))
+ current_next_list = NULL;
+
+ if (zero_width_next_ga.ga_len > 0)
+ ga_clear(&zero_width_next_ga);
+
+ /* No longer need external matches. But keep next_match_extmatch. */
+ unref_extmatch(re_extmatch_out);
+ re_extmatch_out = NULL;
+ unref_extmatch(cur_extmatch);
+
+ return current_attr;
+}
+
+
+/*
+ * Check if we already matched pattern "idx" at the current column.
+ */
+ static int
+did_match_already(idx, gap)
+ int idx;
+ garray_T *gap;
+{
+ int i;
+
+ for (i = current_state.ga_len; --i >= 0; )
+ if (CUR_STATE(i).si_m_startcol == (int)current_col
+ && CUR_STATE(i).si_m_lnum == (int)current_lnum
+ && CUR_STATE(i).si_idx == idx)
+ return TRUE;
+
+ /* Zero-width matches with a nextgroup argument are not put on the syntax
+ * stack, and can only be matched once anyway. */
+ for (i = gap->ga_len; --i >= 0; )
+ if (((int *)(gap->ga_data))[i] == idx)
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+ * Push the next match onto the stack.
+ */
+ static stateitem_T *
+push_next_match(cur_si)
+ stateitem_T *cur_si;
+{
+ synpat_T *spp;
+
+ spp = &(SYN_ITEMS(syn_buf)[next_match_idx]);
+
+ /*
+ * Push the item in current_state stack;
+ */
+ if (push_current_state(next_match_idx) == OK)
+ {
+ /*
+ * If it's a start-skip-end type that crosses lines, figure out how
+ * much it continues in this line. Otherwise just fill in the length.
+ */
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ cur_si->si_h_startpos = next_match_h_startpos;
+ cur_si->si_m_startcol = current_col;
+ cur_si->si_m_lnum = current_lnum;
+ cur_si->si_flags = spp->sp_flags;
+ cur_si->si_next_list = spp->sp_next_list;
+ cur_si->si_extmatch = ref_extmatch(next_match_extmatch);
+ if (spp->sp_type == SPTYPE_START && !(spp->sp_flags & HL_ONELINE))
+ {
+ /* Try to find the end pattern in the current line */
+ update_si_end(cur_si, (int)(next_match_m_endpos.col), TRUE);
+ check_keepend();
+ }
+ else
+ {
+ cur_si->si_m_endpos = next_match_m_endpos;
+ cur_si->si_h_endpos = next_match_h_endpos;
+ cur_si->si_ends = TRUE;
+ cur_si->si_flags |= next_match_flags;
+ cur_si->si_eoe_pos = next_match_eoe_pos;
+ cur_si->si_end_idx = next_match_end_idx;
+ }
+ if (keepend_level < 0 && (cur_si->si_flags & HL_KEEPEND))
+ keepend_level = current_state.ga_len - 1;
+ check_keepend();
+ update_si_attr(current_state.ga_len - 1);
+
+ /*
+ * If the start pattern has another highlight group, push another item
+ * on the stack for the start pattern.
+ */
+ if ( spp->sp_type == SPTYPE_START
+ && spp->sp_syn_match_id != 0
+ && push_current_state(next_match_idx) == OK)
+ {
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ cur_si->si_h_startpos = next_match_h_startpos;
+ cur_si->si_m_startcol = current_col;
+ cur_si->si_m_lnum = current_lnum;
+ cur_si->si_m_endpos = next_match_eos_pos;
+ cur_si->si_h_endpos = next_match_eos_pos;
+ cur_si->si_ends = TRUE;
+ cur_si->si_end_idx = 0;
+ cur_si->si_flags = HL_MATCH;
+ cur_si->si_next_list = NULL;
+ check_keepend();
+ update_si_attr(current_state.ga_len - 1);
+ }
+ }
+
+ next_match_idx = -1; /* try other match next time */
+
+ return cur_si;
+}
+
+/*
+ * Check for end of current state (and the states before it).
+ */
+ static void
+check_state_ends()
+{
+ stateitem_T *cur_si;
+ int had_extend = FALSE;
+
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+ for (;;)
+ {
+ if (cur_si->si_ends
+ && (cur_si->si_m_endpos.lnum < current_lnum
+ || (cur_si->si_m_endpos.lnum == current_lnum
+ && cur_si->si_m_endpos.col <= current_col)))
+ {
+ /*
+ * If there is an end pattern group ID, highlight the end pattern
+ * now. No need to pop the current item from the stack.
+ * Only do this if the end pattern continues beyond the current
+ * position.
+ */
+ if (cur_si->si_end_idx
+ && (cur_si->si_eoe_pos.lnum > current_lnum
+ || (cur_si->si_eoe_pos.lnum == current_lnum
+ && cur_si->si_eoe_pos.col > current_col)))
+ {
+ cur_si->si_idx = cur_si->si_end_idx;
+ cur_si->si_end_idx = 0;
+ cur_si->si_m_endpos = cur_si->si_eoe_pos;
+ cur_si->si_h_endpos = cur_si->si_eoe_pos;
+ cur_si->si_flags |= HL_MATCH;
+ update_si_attr(current_state.ga_len - 1);
+ break;
+ }
+ else
+ {
+ /* handle next_list, unless at end of line and no "skipnl" or
+ * "skipempty" */
+ current_next_list = cur_si->si_next_list;
+ current_next_flags = cur_si->si_flags;
+ if (!(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))
+ && syn_getcurline()[current_col] == NUL)
+ current_next_list = NULL;
+
+ /* When the ended item has "extend", another item with
+ * "keepend" now needs to check for its end. */
+ if (cur_si->si_flags & HL_EXTEND)
+ had_extend = TRUE;
+
+ pop_current_state();
+
+ if (current_state.ga_len == 0)
+ break;
+
+ if (had_extend)
+ {
+ syn_update_ends(FALSE);
+ if (current_state.ga_len == 0)
+ break;
+ }
+
+ cur_si = &CUR_STATE(current_state.ga_len - 1);
+
+ /*
+ * Only for a region the search for the end continues after
+ * the end of the contained item. If the contained match
+ * included the end-of-line, break here, the region continues.
+ * Don't do this when:
+ * - "keepend" is used for the contained item
+ * - not at the end of the line (could be end="x$"me=e-1).
+ * - "excludenl" is used (HL_HAS_EOL won't be set)
+ */
+ if (cur_si->si_idx >= 0
+ && SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_type
+ == SPTYPE_START
+ && !(cur_si->si_flags & (HL_MATCH | HL_KEEPEND)))
+ {
+ update_si_end(cur_si, (int)current_col, TRUE);
+ check_keepend();
+ if ((current_next_flags & HL_HAS_EOL)
+ && keepend_level < 0
+ && syn_getcurline()[current_col] == NUL)
+ break;
+ }
+ }
+ }
+ else
+ break;
+ }
+}
+
+/*
+ * Update an entry in the current_state stack for a match or region. This
+ * fills in si_attr, si_next_list and si_cont_list.
+ */
+ static void
+update_si_attr(idx)
+ int idx;
+{
+ stateitem_T *sip = &CUR_STATE(idx);
+ synpat_T *spp;
+
+ spp = &(SYN_ITEMS(syn_buf)[sip->si_idx]);
+ if (sip->si_flags & HL_MATCH)
+ sip->si_id = spp->sp_syn_match_id;
+ else
+ sip->si_id = spp->sp_syn.id;
+ sip->si_attr = syn_id2attr(sip->si_id);
+ sip->si_trans_id = sip->si_id;
+ if (sip->si_flags & HL_MATCH)
+ sip->si_cont_list = NULL;
+ else
+ sip->si_cont_list = spp->sp_cont_list;
+
+ /*
+ * For transparent items, take attr from outer item.
+ * Also take cont_list, if there is none.
+ * Don't do this for the matchgroup of a start or end pattern.
+ */
+ if ((spp->sp_flags & HL_TRANSP) && !(sip->si_flags & HL_MATCH))
+ {
+ if (idx == 0)
+ {
+ sip->si_attr = 0;
+ sip->si_trans_id = 0;
+ if (sip->si_cont_list == NULL)
+ sip->si_cont_list = ID_LIST_ALL;
+ }
+ else
+ {
+ sip->si_attr = CUR_STATE(idx - 1).si_attr;
+ sip->si_trans_id = CUR_STATE(idx - 1).si_trans_id;
+ if (sip->si_cont_list == NULL)
+ {
+ sip->si_flags |= HL_TRANS_CONT;
+ sip->si_cont_list = CUR_STATE(idx - 1).si_cont_list;
+ }
+ }
+ }
+}
+
+/*
+ * Check the current stack for patterns with "keepend" flag.
+ * Propagate the match-end to contained items, until a "skipend" item is found.
+ */
+ static void
+check_keepend()
+{
+ int i;
+ lpos_T maxpos;
+ stateitem_T *sip;
+
+ /*
+ * This check can consume a lot of time; only do it from the level where
+ * there really is a keepend.
+ */
+ if (keepend_level < 0)
+ return;
+
+ /*
+ * Find the last index of an "extend" item. "keepend" items before that
+ * won't do anything. If there is no "extend" item "i" will be
+ * "keepend_level" and all "keepend" items will work normally.
+ */
+ for (i = current_state.ga_len - 1; i > keepend_level; --i)
+ if (CUR_STATE(i).si_flags & HL_EXTEND)
+ break;
+
+ maxpos.lnum = 0;
+ for ( ; i < current_state.ga_len; ++i)
+ {
+ sip = &CUR_STATE(i);
+ if (maxpos.lnum != 0)
+ {
+ limit_pos_zero(&sip->si_m_endpos, &maxpos);
+ limit_pos_zero(&sip->si_h_endpos, &maxpos);
+ limit_pos_zero(&sip->si_eoe_pos, &maxpos);
+ sip->si_ends = TRUE;
+ }
+ if (sip->si_ends
+ && (sip->si_flags & HL_KEEPEND)
+ && (maxpos.lnum == 0
+ || maxpos.lnum > sip->si_m_endpos.lnum
+ || (maxpos.lnum == sip->si_m_endpos.lnum
+ && maxpos.col > sip->si_m_endpos.col)))
+ maxpos = sip->si_m_endpos;
+ }
+}
+
+/*
+ * Update an entry in the current_state stack for a start-skip-end pattern.
+ * This finds the end of the current item, if it's in the current line.
+ *
+ * Return the flags for the matched END.
+ */
+ static void
+update_si_end(sip, startcol, force)
+ stateitem_T *sip;
+ int startcol; /* where to start searching for the end */
+ int force; /* when TRUE overrule a previous end */
+{
+ lpos_T startpos;
+ lpos_T endpos;
+ lpos_T hl_endpos;
+ lpos_T end_endpos;
+ int end_idx;
+
+ /* Don't update when it's already done. Can be a match of an end pattern
+ * that started in a previous line. Watch out: can also be a "keepend"
+ * from a containing item. */
+ if (!force && sip->si_m_endpos.lnum >= current_lnum)
+ return;
+
+ /*
+ * We need to find the end of the region. It may continue in the next
+ * line.
+ */
+ end_idx = 0;
+ startpos.lnum = current_lnum;
+ startpos.col = startcol;
+ find_endpos(sip->si_idx, &startpos, &endpos, &hl_endpos,
+ &(sip->si_flags), &end_endpos, &end_idx, sip->si_extmatch);
+
+ if (endpos.lnum == 0)
+ {
+ /* No end pattern matched. */
+ if (SYN_ITEMS(syn_buf)[sip->si_idx].sp_flags & HL_ONELINE)
+ {
+ /* a "oneline" never continues in the next line */
+ sip->si_ends = TRUE;
+ sip->si_m_endpos.lnum = current_lnum;
+ sip->si_m_endpos.col = (colnr_T)STRLEN(syn_getcurline());
+ }
+ else
+ {
+ /* continues in the next line */
+ sip->si_ends = FALSE;
+ sip->si_m_endpos.lnum = 0;
+ }
+ sip->si_h_endpos = sip->si_m_endpos;
+ }
+ else
+ {
+ /* match within this line */
+ sip->si_m_endpos = endpos;
+ sip->si_h_endpos = hl_endpos;
+ sip->si_eoe_pos = end_endpos;
+ sip->si_ends = TRUE;
+ sip->si_end_idx = end_idx;
+ }
+}
+
+/*
+ * Add a new state to the current state stack.
+ * It is cleared and the index set to "idx".
+ * Return FAIL if it's not possible (out of memory).
+ */
+ static int
+push_current_state(idx)
+ int idx;
+{
+ if (ga_grow(&current_state, 1) == FAIL)
+ return FAIL;
+ vim_memset(&CUR_STATE(current_state.ga_len), 0, sizeof(stateitem_T));
+ CUR_STATE(current_state.ga_len).si_idx = idx;
+ ++current_state.ga_len;
+ --current_state.ga_room;
+ return OK;
+}
+
+/*
+ * Remove a state from the current_state stack.
+ */
+ static void
+pop_current_state()
+{
+ if (current_state.ga_len)
+ {
+ unref_extmatch(CUR_STATE(current_state.ga_len - 1).si_extmatch);
+ --current_state.ga_len;
+ ++current_state.ga_room;
+ }
+ /* after the end of a pattern, try matching a keyword or pattern */
+ next_match_idx = -1;
+
+ /* if first state with "keepend" is popped, reset keepend_level */
+ if (keepend_level >= current_state.ga_len)
+ keepend_level = -1;
+}
+
+/*
+ * Find the end of a start/skip/end syntax region after "startpos".
+ * Only checks one line.
+ * Also handles a match item that continued from a previous line.
+ * If not found, the syntax item continues in the next line. m_endpos->lnum
+ * will be 0.
+ * If found, the end of the region and the end of the highlighting is
+ * computed.
+ */
+ static void
+find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
+ end_idx, start_ext)
+ int idx; /* index of the pattern */
+ lpos_T *startpos; /* where to start looking for an END match */
+ lpos_T *m_endpos; /* return: end of match */
+ lpos_T *hl_endpos; /* return: end of highlighting */
+ long *flagsp; /* return: flags of matching END */
+ lpos_T *end_endpos; /* return: end of end pattern match */
+ int *end_idx; /* return: group ID for end pat. match, or 0 */
+ reg_extmatch_T *start_ext; /* submatches from the start pattern */
+{
+ colnr_T matchcol;
+ synpat_T *spp, *spp_skip;
+ int start_idx;
+ int best_idx;
+ regmmatch_T regmatch;
+ regmmatch_T best_regmatch; /* startpos/endpos of best match */
+ lpos_T pos;
+ char_u *line;
+ int had_match = FALSE;
+
+ /*
+ * Check for being called with a START pattern.
+ * Can happen with a match that continues to the next line, because it
+ * contained a region.
+ */
+ spp = &(SYN_ITEMS(syn_buf)[idx]);
+ if (spp->sp_type != SPTYPE_START)
+ {
+ *hl_endpos = *startpos;
+ return;
+ }
+
+ /*
+ * Find the SKIP or first END pattern after the last START pattern.
+ */
+ for (;;)
+ {
+ spp = &(SYN_ITEMS(syn_buf)[idx]);
+ if (spp->sp_type != SPTYPE_START)
+ break;
+ ++idx;
+ }
+
+ /*
+ * Lookup the SKIP pattern (if present)
+ */
+ if (spp->sp_type == SPTYPE_SKIP)
+ {
+ spp_skip = spp;
+ ++idx;
+ }
+ else
+ spp_skip = NULL;
+
+ /* Setup external matches for syn_regexec(). */
+ unref_extmatch(re_extmatch_in);
+ re_extmatch_in = ref_extmatch(start_ext);
+
+ matchcol = startpos->col; /* start looking for a match at sstart */
+ start_idx = idx; /* remember the first END pattern. */
+ best_regmatch.startpos[0].col = 0; /* avoid compiler warning */
+ for (;;)
+ {
+ /*
+ * Find end pattern that matches first after "matchcol".
+ */
+ best_idx = -1;
+ for (idx = start_idx; idx < syn_buf->b_syn_patterns.ga_len; ++idx)
+ {
+ int lc_col = matchcol;
+
+ spp = &(SYN_ITEMS(syn_buf)[idx]);
+ if (spp->sp_type != SPTYPE_END) /* past last END pattern */
+ break;
+ lc_col -= spp->sp_offsets[SPO_LC_OFF];
+ if (lc_col < 0)
+ lc_col = 0;
+
+ regmatch.rmm_ic = spp->sp_ic;
+ regmatch.regprog = spp->sp_prog;
+ if (syn_regexec(&regmatch, startpos->lnum, lc_col))
+ {
+ if (best_idx == -1 || regmatch.startpos[0].col
+ < best_regmatch.startpos[0].col)
+ {
+ best_idx = idx;
+ best_regmatch.startpos[0] = regmatch.startpos[0];
+ best_regmatch.endpos[0] = regmatch.endpos[0];
+ }
+ }
+ }
+
+ /*
+ * If all end patterns have been tried, and there is no match, the
+ * item continues until end-of-line.
+ */
+ if (best_idx == -1)
+ break;
+
+ /*
+ * If the skip pattern matches before the end pattern,
+ * continue searching after the skip pattern.
+ */
+ if (spp_skip != NULL)
+ {
+ int lc_col = matchcol - spp_skip->sp_offsets[SPO_LC_OFF];
+
+ if (lc_col < 0)
+ lc_col = 0;
+ regmatch.rmm_ic = spp_skip->sp_ic;
+ regmatch.regprog = spp_skip->sp_prog;
+ if (syn_regexec(&regmatch, startpos->lnum, lc_col)
+ && regmatch.startpos[0].col
+ <= best_regmatch.startpos[0].col)
+ {
+ /* Add offset to skip pattern match */
+ syn_add_end_off(&pos, &regmatch, spp_skip, SPO_ME_OFF, 1);
+
+ /* If the skip pattern goes on to the next line, there is no
+ * match with an end pattern in this line. */
+ if (pos.lnum > startpos->lnum)
+ break;
+
+ line = ml_get_buf(syn_buf, startpos->lnum, FALSE);
+
+ /* take care of an empty match or negative offset */
+ if (pos.col <= matchcol)
+ ++matchcol;
+ else if (pos.col <= regmatch.endpos[0].col)
+ matchcol = pos.col;
+ else
+ /* Be careful not to jump over the NUL at the end-of-line */
+ for (matchcol = regmatch.endpos[0].col;
+ line[matchcol] != NUL && matchcol < pos.col;
+ ++matchcol)
+ ;
+
+ /* if the skip pattern includes end-of-line, break here */
+ if (line[matchcol] == NUL)
+ break;
+
+ continue; /* start with first end pattern again */
+ }
+ }
+
+ /*
+ * Match from start pattern to end pattern.
+ * Correct for match and highlight offset of end pattern.
+ */
+ spp = &(SYN_ITEMS(syn_buf)[best_idx]);
+ syn_add_end_off(m_endpos, &best_regmatch, spp, SPO_ME_OFF, 1);
+ /* can't end before the start */
+ if (m_endpos->lnum == startpos->lnum && m_endpos->col < startpos->col)
+ m_endpos->col = startpos->col;
+
+ syn_add_end_off(end_endpos, &best_regmatch, spp, SPO_HE_OFF, 1);
+ /* can't end before the start */
+ if (end_endpos->lnum == startpos->lnum
+ && end_endpos->col < startpos->col)
+ end_endpos->col = startpos->col;
+ /* can't end after the match */
+ limit_pos(end_endpos, m_endpos);
+
+ /*
+ * If the end group is highlighted differently, adjust the pointers.
+ */
+ if (spp->sp_syn_match_id != spp->sp_syn.id && spp->sp_syn_match_id != 0)
+ {
+ *end_idx = best_idx;
+ if (spp->sp_off_flags & (1 << (SPO_RE_OFF + SPO_COUNT)))
+ {
+ hl_endpos->lnum = best_regmatch.endpos[0].lnum;
+ hl_endpos->col = best_regmatch.endpos[0].col;
+ }
+ else
+ {
+ hl_endpos->lnum = best_regmatch.startpos[0].lnum;
+ hl_endpos->col = best_regmatch.startpos[0].col;
+ }
+ hl_endpos->col += spp->sp_offsets[SPO_RE_OFF];
+
+ /* can't end before the start */
+ if (hl_endpos->lnum == startpos->lnum
+ && hl_endpos->col < startpos->col)
+ hl_endpos->col = startpos->col;
+ limit_pos(hl_endpos, m_endpos);
+
+ /* now the match ends where the highlighting ends, it is turned
+ * into the matchgroup for the end */
+ *m_endpos = *hl_endpos;
+ }
+ else
+ {
+ *end_idx = 0;
+ *hl_endpos = *end_endpos;
+ }
+
+ *flagsp = spp->sp_flags;
+
+ had_match = TRUE;
+ break;
+ }
+
+ /* no match for an END pattern in this line */
+ if (!had_match)
+ m_endpos->lnum = 0;
+
+ /* Remove external matches. */
+ unref_extmatch(re_extmatch_in);
+ re_extmatch_in = NULL;
+}
+
+/*
+ * Limit "pos" not to be after "limit".
+ */
+ static void
+limit_pos(pos, limit)
+ lpos_T *pos;
+ lpos_T *limit;
+{
+ if (pos->lnum > limit->lnum)
+ *pos = *limit;
+ else if (pos->lnum == limit->lnum && pos->col > limit->col)
+ pos->col = limit->col;
+}
+
+/*
+ * Limit "pos" not to be after "limit", unless pos->lnum is zero.
+ */
+ static void
+limit_pos_zero(pos, limit)
+ lpos_T *pos;
+ lpos_T *limit;
+{
+ if (pos->lnum == 0)
+ *pos = *limit;
+ else
+ limit_pos(pos, limit);
+}
+
+/*
+ * Add offset to matched text for end of match or highlight.
+ */
+ static void
+syn_add_end_off(result, regmatch, spp, idx, extra)
+ lpos_T *result; /* returned position */
+ regmmatch_T *regmatch; /* start/end of match */
+ synpat_T *spp; /* matched pattern */
+ int idx; /* index of offset */
+ int extra; /* extra chars for offset to start */
+{
+ int col;
+
+ if (spp->sp_off_flags & (1 << idx))
+ {
+ result->lnum = regmatch->startpos[0].lnum;
+ col = regmatch->startpos[0].col + extra;
+ }
+ else
+ {
+ result->lnum = regmatch->endpos[0].lnum;
+ col = regmatch->endpos[0].col;
+ }
+ col += spp->sp_offsets[idx];
+ if (col < 0)
+ result->col = 0;
+ else
+ result->col = col;
+}
+
+/*
+ * Add offset to matched text for start of match or highlight.
+ * Avoid resulting column to become negative.
+ */
+ static void
+syn_add_start_off(result, regmatch, spp, idx, extra)
+ lpos_T *result; /* returned position */
+ regmmatch_T *regmatch; /* start/end of match */
+ synpat_T *spp;
+ int idx;
+ int extra; /* extra chars for offset to end */
+{
+ int col;
+
+ if (spp->sp_off_flags & (1 << (idx + SPO_COUNT)))
+ {
+ result->lnum = regmatch->endpos[0].lnum;
+ col = regmatch->endpos[0].col + extra;
+ }
+ else
+ {
+ result->lnum = regmatch->startpos[0].lnum;
+ col = regmatch->startpos[0].col;
+ }
+ col += spp->sp_offsets[idx];
+ if (col < 0)
+ result->col = 0;
+ else
+ result->col = col;
+}
+
+/*
+ * Get current line in syntax buffer.
+ */
+ static char_u *
+syn_getcurline()
+{
+ return ml_get_buf(syn_buf, current_lnum, FALSE);
+}
+
+/*
+ * Call vim_regexec() to match in syn_buf.
+ * Returns TRUE when there is a match.
+ */
+ static int
+syn_regexec(rmp, lnum, col)
+ regmmatch_T *rmp;
+ linenr_T lnum;
+ colnr_T col;
+{
+ if (vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col) > 0)
+ {
+ rmp->startpos[0].lnum += lnum;
+ rmp->endpos[0].lnum += lnum;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Check one position in a line for a matching keyword.
+ * The caller must check if a keyword can start at startcol.
+ * Return it's ID if found, 0 otherwise.
+ */
+ static int
+check_keyword_id(line, startcol, endcolp, flagsp, next_listp, cur_si)
+ char_u *line;
+ int startcol; /* position in line to check for keyword */
+ int *endcolp; /* return: character after found keyword */
+ long *flagsp; /* return: flags of matching keyword */
+ short **next_listp; /* return: next_list of matching keyword */
+ stateitem_T *cur_si; /* item at the top of the stack */
+{
+ keyentry_T *ktab;
+ char_u *p;
+ int round;
+ int len;
+ char_u keyword[MAXKEYWLEN + 1]; /* assume max. keyword len is 80 */
+
+ /* Find first character after the keyword. First character was already
+ * checked. */
+ p = line + startcol;
+ len = 0;
+ do
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ len += (*mb_ptr2len_check)(p + len);
+ else
+#endif
+ ++len;
+ }
+ while (vim_iswordc_buf(p + len, syn_buf));
+
+ if (len > MAXKEYWLEN)
+ return 0;
+
+ /*
+ * Must make a copy of the keyword, so we can add a NUL and make it
+ * lowercase.
+ */
+ STRNCPY(keyword, p, len);
+ keyword[len] = NUL;
+
+ /*
+ * Try twice:
+ * 1. matching case
+ * 2. ignoring case
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ if ((round == 1 ? syn_buf->b_keywtab : syn_buf->b_keywtab_ic) == NULL)
+ continue;
+ if (round == 1) /* match case */
+ ktab = syn_buf->b_keywtab[syn_khash(keyword)];
+ else /* round == 2, ignore case */
+ {
+ p = str_foldcase(keyword, (int)STRLEN(keyword));
+ if (p != NULL)
+ {
+ STRNCPY(keyword, p, MAXKEYWLEN);
+ keyword[MAXKEYWLEN] = NUL;
+ vim_free(p);
+ }
+ ktab = syn_buf->b_keywtab_ic[syn_khash(keyword)];
+ }
+
+ /*
+ * Find keywords that match.
+ * When current_next_list is non-zero accept only that group, otherwise:
+ * Accept a not-contained keyword at toplevel.
+ * Accept a keyword at other levels only if it is in the contains list.
+ */
+ for ( ; ktab != NULL; ktab = ktab->next)
+ if ( STRCMP(keyword, ktab->keyword) == 0
+ && (current_next_list != 0
+ ? in_id_list(NULL, current_next_list, &ktab->k_syn, 0)
+ : (cur_si == NULL
+ ? !(ktab->flags & HL_CONTAINED)
+ : in_id_list(cur_si, cur_si->si_cont_list,
+ &ktab->k_syn, ktab->flags & HL_CONTAINED))))
+ {
+ *endcolp = startcol + len;
+ *flagsp = ktab->flags;
+ *next_listp = ktab->next_list;
+ return ktab->k_syn.id;
+ }
+ }
+ return 0;
+}
+
+/*
+ * Handle ":syntax case" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_case(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ char_u *arg = eap->arg;
+ char_u *next;
+
+ eap->nextcmd = find_nextcmd(arg);
+ if (eap->skip)
+ return;
+
+ next = skiptowhite(arg);
+ if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5)
+ curbuf->b_syn_ic = FALSE;
+ else if (STRNICMP(arg, "ignore", 6) == 0 && next - arg == 6)
+ curbuf->b_syn_ic = TRUE;
+ else
+ EMSG2(_("E390: Illegal argument: %s"), arg);
+}
+
+/*
+ * Clear all syntax info for one buffer.
+ */
+ void
+syntax_clear(buf)
+ buf_T *buf;
+{
+ int i;
+
+ curbuf->b_syn_ic = FALSE; /* Use case, by default */
+ curbuf->b_syn_containedin = FALSE;
+
+ /* free the keywords */
+ free_keywtab(buf->b_keywtab);
+ buf->b_keywtab = NULL;
+ free_keywtab(buf->b_keywtab_ic);
+ buf->b_keywtab_ic = NULL;
+
+ /* free the syntax patterns */
+ for (i = buf->b_syn_patterns.ga_len; --i >= 0; )
+ syn_clear_pattern(buf, i);
+ ga_clear(&buf->b_syn_patterns);
+
+ /* free the syntax clusters */
+ for (i = buf->b_syn_clusters.ga_len; --i >= 0; )
+ syn_clear_cluster(buf, i);
+ ga_clear(&buf->b_syn_clusters);
+
+ buf->b_syn_sync_flags = 0;
+ buf->b_syn_sync_minlines = 0;
+ buf->b_syn_sync_maxlines = 0;
+ buf->b_syn_sync_linebreaks = 0;
+
+ vim_free(buf->b_syn_linecont_prog);
+ buf->b_syn_linecont_prog = NULL;
+ vim_free(buf->b_syn_linecont_pat);
+ buf->b_syn_linecont_pat = NULL;
+#ifdef FEAT_FOLDING
+ buf->b_syn_folditems = 0;
+#endif
+
+ /* free the stored states */
+ syn_stack_free_all(buf);
+ invalidate_current_state();
+}
+
+/*
+ * Clear syncing info for one buffer.
+ */
+ static void
+syntax_sync_clear()
+{
+ int i;
+
+ /* free the syntax patterns */
+ for (i = curbuf->b_syn_patterns.ga_len; --i >= 0; )
+ if (SYN_ITEMS(curbuf)[i].sp_syncing)
+ syn_remove_pattern(curbuf, i);
+
+ curbuf->b_syn_sync_flags = 0;
+ curbuf->b_syn_sync_minlines = 0;
+ curbuf->b_syn_sync_maxlines = 0;
+ curbuf->b_syn_sync_linebreaks = 0;
+
+ vim_free(curbuf->b_syn_linecont_prog);
+ curbuf->b_syn_linecont_prog = NULL;
+ vim_free(curbuf->b_syn_linecont_pat);
+ curbuf->b_syn_linecont_pat = NULL;
+
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+}
+
+/*
+ * Remove one pattern from the buffer's pattern list.
+ */
+ static void
+syn_remove_pattern(buf, idx)
+ buf_T *buf;
+ int idx;
+{
+ synpat_T *spp;
+
+ spp = &(SYN_ITEMS(buf)[idx]);
+#ifdef FEAT_FOLDING
+ if (spp->sp_flags & HL_FOLD)
+ --buf->b_syn_folditems;
+#endif
+ syn_clear_pattern(buf, idx);
+ mch_memmove(spp, spp + 1,
+ sizeof(synpat_T) * (buf->b_syn_patterns.ga_len - idx - 1));
+ --buf->b_syn_patterns.ga_len;
+ --buf->b_syn_patterns.ga_room;
+}
+
+/*
+ * Clear and free one syntax pattern. When clearing all, must be called from
+ * last to first!
+ */
+ static void
+syn_clear_pattern(buf, i)
+ buf_T *buf;
+ int i;
+{
+ vim_free(SYN_ITEMS(buf)[i].sp_pattern);
+ vim_free(SYN_ITEMS(buf)[i].sp_prog);
+ /* Only free sp_cont_list and sp_next_list of first start pattern */
+ if (i == 0 || SYN_ITEMS(buf)[i - 1].sp_type != SPTYPE_START)
+ {
+ vim_free(SYN_ITEMS(buf)[i].sp_cont_list);
+ vim_free(SYN_ITEMS(buf)[i].sp_next_list);
+ }
+}
+
+/*
+ * Clear and free one syntax cluster.
+ */
+ static void
+syn_clear_cluster(buf, i)
+ buf_T *buf;
+ int i;
+{
+ vim_free(SYN_CLSTR(buf)[i].scl_name);
+ vim_free(SYN_CLSTR(buf)[i].scl_name_u);
+ vim_free(SYN_CLSTR(buf)[i].scl_list);
+}
+
+/*
+ * Handle ":syntax clear" command.
+ */
+ static void
+syn_cmd_clear(eap, syncing)
+ exarg_T *eap;
+ int syncing;
+{
+ char_u *arg = eap->arg;
+ char_u *arg_end;
+ int id;
+
+ eap->nextcmd = find_nextcmd(arg);
+ if (eap->skip)
+ return;
+
+ /*
+ * We have to disable this within ":syn include @group filename",
+ * because otherwise @group would get deleted.
+ * Only required for Vim 5.x syntax files, 6.0 ones don't contain ":syn
+ * clear".
+ */
+ if (curbuf->b_syn_topgrp != 0)
+ return;
+
+ if (ends_excmd(*arg))
+ {
+ /*
+ * No argument: Clear all syntax items.
+ */
+ if (syncing)
+ syntax_sync_clear();
+ else
+ {
+ syntax_clear(curbuf);
+ do_unlet((char_u *)"b:current_syntax");
+ }
+ }
+ else
+ {
+ /*
+ * Clear the group IDs that are in the argument.
+ */
+ while (!ends_excmd(*arg))
+ {
+ arg_end = skiptowhite(arg);
+ if (*arg == '@')
+ {
+ id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
+ if (id == 0)
+ {
+ EMSG2(_("E391: No such syntax cluster: %s"), arg);
+ break;
+ }
+ else
+ {
+ /*
+ * We can't physically delete a cluster without changing
+ * the IDs of other clusters, so we do the next best thing
+ * and make it empty.
+ */
+ short scl_id = id - SYNID_CLUSTER;
+
+ vim_free(SYN_CLSTR(curbuf)[scl_id].scl_list);
+ SYN_CLSTR(curbuf)[scl_id].scl_list = NULL;
+ }
+ }
+ else
+ {
+ id = syn_namen2id(arg, (int)(arg_end - arg));
+ if (id == 0)
+ {
+ EMSG2(_(e_nogroup), arg);
+ break;
+ }
+ else
+ syn_clear_one(id, syncing);
+ }
+ arg = skipwhite(arg_end);
+ }
+ }
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+}
+
+/*
+ * Clear one syntax group for the current buffer.
+ */
+ static void
+syn_clear_one(id, syncing)
+ int id;
+ int syncing;
+{
+ synpat_T *spp;
+ int idx;
+
+ /* Clear keywords only when not ":syn sync clear group-name" */
+ if (!syncing)
+ {
+ (void)syn_clear_keyword(id, curbuf->b_keywtab);
+ (void)syn_clear_keyword(id, curbuf->b_keywtab_ic);
+ }
+
+ /* clear the patterns for "id" */
+ for (idx = curbuf->b_syn_patterns.ga_len; --idx >= 0; )
+ {
+ spp = &(SYN_ITEMS(curbuf)[idx]);
+ if (spp->sp_syn.id != id || spp->sp_syncing != syncing)
+ continue;
+ syn_remove_pattern(curbuf, idx);
+ }
+}
+
+/*
+ * Handle ":syntax on" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_on(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ syn_cmd_onoff(eap, "syntax");
+}
+
+/*
+ * Handle ":syntax enable" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_enable(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"enable");
+ syn_cmd_onoff(eap, "syntax");
+ do_unlet((char_u *)"g:syntax_cmd");
+}
+
+/*
+ * Handle ":syntax reset" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_reset(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ eap->nextcmd = check_nextcmd(eap->arg);
+ if (!eap->skip)
+ {
+ set_internal_string_var((char_u *)"syntax_cmd", (char_u *)"reset");
+ do_cmdline_cmd((char_u *)"runtime! syntax/syncolor.vim");
+ do_unlet((char_u *)"g:syntax_cmd");
+ }
+}
+
+/*
+ * Handle ":syntax manual" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_manual(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ syn_cmd_onoff(eap, "manual");
+}
+
+/*
+ * Handle ":syntax off" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_off(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ syn_cmd_onoff(eap, "nosyntax");
+}
+
+ static void
+syn_cmd_onoff(eap, name)
+ exarg_T *eap;
+ char *name;
+{
+ char_u buf[100];
+
+ eap->nextcmd = check_nextcmd(eap->arg);
+ if (!eap->skip)
+ {
+ STRCPY(buf, "so ");
+ sprintf((char *)buf + 3, SYNTAX_FNAME, name);
+ do_cmdline_cmd(buf);
+ }
+}
+
+/*
+ * Handle ":syntax [list]" command: list current syntax words.
+ */
+ static void
+syn_cmd_list(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* when TRUE: list syncing items */
+{
+ char_u *arg = eap->arg;
+ int id;
+ char_u *arg_end;
+
+ eap->nextcmd = find_nextcmd(arg);
+ if (eap->skip)
+ return;
+
+ if (!syntax_present(curbuf))
+ {
+ MSG(_("No Syntax items defined for this buffer"));
+ return;
+ }
+
+ if (syncing)
+ {
+ if (curbuf->b_syn_sync_flags & SF_CCOMMENT)
+ {
+ MSG_PUTS(_("syncing on C-style comments"));
+ syn_lines_msg();
+ syn_match_msg();
+ return;
+ }
+ else if (!(curbuf->b_syn_sync_flags & SF_MATCH))
+ {
+ if (curbuf->b_syn_sync_minlines == 0)
+ MSG_PUTS(_("no syncing"));
+ else
+ {
+ MSG_PUTS(_("syncing starts "));
+ msg_outnum(curbuf->b_syn_sync_minlines);
+ MSG_PUTS(_(" lines before top line"));
+ syn_match_msg();
+ }
+ return;
+ }
+ MSG_PUTS_TITLE(_("\n--- Syntax sync items ---"));
+ if (curbuf->b_syn_sync_minlines > 0
+ || curbuf->b_syn_sync_maxlines > 0
+ || curbuf->b_syn_sync_linebreaks > 0)
+ {
+ MSG_PUTS(_("\nsyncing on items"));
+ syn_lines_msg();
+ syn_match_msg();
+ }
+ }
+ else
+ MSG_PUTS_TITLE(_("\n--- Syntax items ---"));
+ if (ends_excmd(*arg))
+ {
+ /*
+ * No argument: List all group IDs and all syntax clusters.
+ */
+ for (id = 1; id <= highlight_ga.ga_len && !got_int; ++id)
+ syn_list_one(id, syncing, FALSE);
+ for (id = 0; id < curbuf->b_syn_clusters.ga_len && !got_int; ++id)
+ syn_list_cluster(id);
+ }
+ else
+ {
+ /*
+ * List the group IDs and syntax clusters that are in the argument.
+ */
+ while (!ends_excmd(*arg) && !got_int)
+ {
+ arg_end = skiptowhite(arg);
+ if (*arg == '@')
+ {
+ id = syn_scl_namen2id(arg + 1, (int)(arg_end - arg - 1));
+ if (id == 0)
+ EMSG2(_("E392: No such syntax cluster: %s"), arg);
+ else
+ syn_list_cluster(id - SYNID_CLUSTER);
+ }
+ else
+ {
+ id = syn_namen2id(arg, (int)(arg_end - arg));
+ if (id == 0)
+ EMSG2(_(e_nogroup), arg);
+ else
+ syn_list_one(id, syncing, TRUE);
+ }
+ arg = skipwhite(arg_end);
+ }
+ }
+ eap->nextcmd = check_nextcmd(arg);
+}
+
+ static void
+syn_lines_msg()
+{
+ if (curbuf->b_syn_sync_maxlines > 0 || curbuf->b_syn_sync_minlines > 0)
+ {
+ MSG_PUTS("; ");
+ if (curbuf->b_syn_sync_minlines > 0)
+ {
+ MSG_PUTS(_("minimal "));
+ msg_outnum(curbuf->b_syn_sync_minlines);
+ if (curbuf->b_syn_sync_maxlines)
+ MSG_PUTS(", ");
+ }
+ if (curbuf->b_syn_sync_maxlines > 0)
+ {
+ MSG_PUTS(_("maximal "));
+ msg_outnum(curbuf->b_syn_sync_maxlines);
+ }
+ MSG_PUTS(_(" lines before top line"));
+ }
+}
+
+ static void
+syn_match_msg()
+{
+ if (curbuf->b_syn_sync_linebreaks > 0)
+ {
+ MSG_PUTS(_("; match "));
+ msg_outnum(curbuf->b_syn_sync_linebreaks);
+ MSG_PUTS(_(" line breaks"));
+ }
+}
+
+static int last_matchgroup;
+
+struct name_list
+{
+ int flag;
+ char *name;
+};
+
+static void syn_list_flags __ARGS((struct name_list *nl, int flags, int attr));
+
+/*
+ * List one syntax item, for ":syntax" or "syntax list syntax_name".
+ */
+ static void
+syn_list_one(id, syncing, link_only)
+ int id;
+ int syncing; /* when TRUE: list syncing items */
+ int link_only; /* when TRUE; list link-only too */
+{
+ int attr;
+ int idx;
+ int did_header = FALSE;
+ synpat_T *spp;
+ static struct name_list namelist1[] =
+ {
+ {HL_DISPLAY, "display"},
+ {HL_CONTAINED, "contained"},
+ {HL_ONELINE, "oneline"},
+ {HL_KEEPEND, "keepend"},
+ {HL_EXTEND, "extend"},
+ {HL_EXCLUDENL, "excludenl"},
+ {HL_TRANSP, "transparent"},
+ {HL_FOLD, "fold"},
+ {0, NULL}
+ };
+ static struct name_list namelist2[] =
+ {
+ {HL_SKIPWHITE, "skipwhite"},
+ {HL_SKIPNL, "skipnl"},
+ {HL_SKIPEMPTY, "skipempty"},
+ {0, NULL}
+ };
+
+ attr = hl_attr(HLF_D); /* highlight like directories */
+
+ /* list the keywords for "id" */
+ if (!syncing)
+ {
+ did_header = syn_list_keywords(id, curbuf->b_keywtab, FALSE, attr);
+ did_header = syn_list_keywords(id, curbuf->b_keywtab_ic,
+ did_header, attr);
+ }
+
+ /* list the patterns for "id" */
+ for (idx = 0; idx < curbuf->b_syn_patterns.ga_len && !got_int; ++idx)
+ {
+ spp = &(SYN_ITEMS(curbuf)[idx]);
+ if (spp->sp_syn.id != id || spp->sp_syncing != syncing)
+ continue;
+
+ (void)syn_list_header(did_header, 999, id);
+ did_header = TRUE;
+ last_matchgroup = 0;
+ if (spp->sp_type == SPTYPE_MATCH)
+ {
+ put_pattern("match", ' ', spp, attr);
+ msg_putchar(' ');
+ }
+ else if (spp->sp_type == SPTYPE_START)
+ {
+ while (SYN_ITEMS(curbuf)[idx].sp_type == SPTYPE_START)
+ put_pattern("start", '=', &SYN_ITEMS(curbuf)[idx++], attr);
+ if (SYN_ITEMS(curbuf)[idx].sp_type == SPTYPE_SKIP)
+ put_pattern("skip", '=', &SYN_ITEMS(curbuf)[idx++], attr);
+ while (idx < curbuf->b_syn_patterns.ga_len
+ && SYN_ITEMS(curbuf)[idx].sp_type == SPTYPE_END)
+ put_pattern("end", '=', &SYN_ITEMS(curbuf)[idx++], attr);
+ --idx;
+ msg_putchar(' ');
+ }
+ syn_list_flags(namelist1, spp->sp_flags, attr);
+
+ if (spp->sp_cont_list != NULL)
+ put_id_list((char_u *)"contains", spp->sp_cont_list, attr);
+
+ if (spp->sp_syn.cont_in_list != NULL)
+ put_id_list((char_u *)"containedin",
+ spp->sp_syn.cont_in_list, attr);
+
+ if (spp->sp_next_list != NULL)
+ {
+ put_id_list((char_u *)"nextgroup", spp->sp_next_list, attr);
+ syn_list_flags(namelist2, spp->sp_flags, attr);
+ }
+ if (spp->sp_flags & (HL_SYNC_HERE|HL_SYNC_THERE))
+ {
+ if (spp->sp_flags & HL_SYNC_HERE)
+ msg_puts_attr((char_u *)"grouphere", attr);
+ else
+ msg_puts_attr((char_u *)"groupthere", attr);
+ msg_putchar(' ');
+ if (spp->sp_sync_idx >= 0)
+ msg_outtrans(HL_TABLE()[SYN_ITEMS(curbuf)
+ [spp->sp_sync_idx].sp_syn.id - 1].sg_name);
+ else
+ MSG_PUTS("NONE");
+ msg_putchar(' ');
+ }
+ }
+
+ /* list the link, if there is one */
+ if (HL_TABLE()[id - 1].sg_link && (did_header || link_only) && !got_int)
+ {
+ (void)syn_list_header(did_header, 999, id);
+ msg_puts_attr((char_u *)"links to", attr);
+ msg_putchar(' ');
+ msg_outtrans(HL_TABLE()[HL_TABLE()[id - 1].sg_link - 1].sg_name);
+ }
+}
+
+ static void
+syn_list_flags(nl, flags, attr)
+ struct name_list *nl;
+ int flags;
+ int attr;
+{
+ int i;
+
+ for (i = 0; nl[i].flag != 0; ++i)
+ if (flags & nl[i].flag)
+ {
+ msg_puts_attr((char_u *)nl[i].name, attr);
+ msg_putchar(' ');
+ }
+}
+
+/*
+ * List one syntax cluster, for ":syntax" or "syntax list syntax_name".
+ */
+ static void
+syn_list_cluster(id)
+ int id;
+{
+ int endcol = 15;
+
+ /* slight hack: roughly duplicate the guts of syn_list_header() */
+ msg_putchar('\n');
+ msg_outtrans(SYN_CLSTR(curbuf)[id].scl_name);
+
+ if (msg_col >= endcol) /* output at least one space */
+ endcol = msg_col + 1;
+ if (Columns <= endcol) /* avoid hang for tiny window */
+ endcol = Columns - 1;
+
+ msg_advance(endcol);
+ if (SYN_CLSTR(curbuf)[id].scl_list != NULL)
+ {
+ put_id_list((char_u *)"cluster", SYN_CLSTR(curbuf)[id].scl_list,
+ hl_attr(HLF_D));
+ }
+ else
+ {
+ msg_puts_attr((char_u *)"cluster", hl_attr(HLF_D));
+ msg_puts((char_u *)"=NONE");
+ }
+}
+
+ static void
+put_id_list(name, list, attr)
+ char_u *name;
+ short *list;
+ int attr;
+{
+ short *p;
+
+ msg_puts_attr(name, attr);
+ msg_putchar('=');
+ for (p = list; *p; ++p)
+ {
+ if (*p >= SYNID_ALLBUT && *p < SYNID_TOP)
+ {
+ if (p[1])
+ MSG_PUTS("ALLBUT");
+ else
+ MSG_PUTS("ALL");
+ }
+ else if (*p >= SYNID_TOP && *p < SYNID_CONTAINED)
+ {
+ MSG_PUTS("TOP");
+ }
+ else if (*p >= SYNID_CONTAINED && *p < SYNID_CLUSTER)
+ {
+ MSG_PUTS("CONTAINED");
+ }
+ else if (*p >= SYNID_CLUSTER)
+ {
+ short scl_id = *p - SYNID_CLUSTER;
+
+ msg_putchar('@');
+ msg_outtrans(SYN_CLSTR(curbuf)[scl_id].scl_name);
+ }
+ else
+ msg_outtrans(HL_TABLE()[*p - 1].sg_name);
+ if (p[1])
+ msg_putchar(',');
+ }
+ msg_putchar(' ');
+}
+
+ static void
+put_pattern(s, c, spp, attr)
+ char *s;
+ int c;
+ synpat_T *spp;
+ int attr;
+{
+ long n;
+ int mask;
+ int first;
+ static char *sepchars = "/+=-#@\"|'^&";
+ int i;
+
+ /* May have to write "matchgroup=group" */
+ if (last_matchgroup != spp->sp_syn_match_id)
+ {
+ last_matchgroup = spp->sp_syn_match_id;
+ msg_puts_attr((char_u *)"matchgroup", attr);
+ msg_putchar('=');
+ if (last_matchgroup == 0)
+ msg_outtrans((char_u *)"NONE");
+ else
+ msg_outtrans(HL_TABLE()[last_matchgroup - 1].sg_name);
+ msg_putchar(' ');
+ }
+
+ /* output the name of the pattern and an '=' or ' ' */
+ msg_puts_attr((char_u *)s, attr);
+ msg_putchar(c);
+
+ /* output the pattern, in between a char that is not in the pattern */
+ for (i = 0; vim_strchr(spp->sp_pattern, sepchars[i]) != NULL; )
+ if (sepchars[++i] == NUL)
+ {
+ i = 0; /* no good char found, just use the first one */
+ break;
+ }
+ msg_putchar(sepchars[i]);
+ msg_outtrans(spp->sp_pattern);
+ msg_putchar(sepchars[i]);
+
+ /* output any pattern options */
+ first = TRUE;
+ for (i = 0; i < SPO_COUNT; ++i)
+ {
+ mask = (1 << i);
+ if (spp->sp_off_flags & (mask + (mask << SPO_COUNT)))
+ {
+ if (!first)
+ msg_putchar(','); /* separate with commas */
+ msg_puts((char_u *)spo_name_tab[i]);
+ n = spp->sp_offsets[i];
+ if (i != SPO_LC_OFF)
+ {
+ if (spp->sp_off_flags & mask)
+ msg_putchar('s');
+ else
+ msg_putchar('e');
+ if (n > 0)
+ msg_putchar('+');
+ }
+ if (n || i == SPO_LC_OFF)
+ msg_outnum(n);
+ first = FALSE;
+ }
+ }
+ msg_putchar(' ');
+}
+
+/*
+ * List or clear the keywords for one syntax group.
+ * Return TRUE if the header has been printed.
+ */
+ static int
+syn_list_keywords(id, ktabp, did_header, attr)
+ int id;
+ keyentry_T **ktabp;
+ int did_header; /* header has already been printed */
+ int attr;
+{
+ int i;
+ int outlen;
+ keyentry_T *ktab;
+ int prev_contained = 0;
+ short *prev_next_list = NULL;
+ short *prev_cont_in_list = NULL;
+ int prev_skipnl = 0;
+ int prev_skipwhite = 0;
+ int prev_skipempty = 0;
+
+ if (ktabp == NULL)
+ return did_header;
+
+ /*
+ * Unfortunately, this list of keywords is not sorted on alphabet but on
+ * hash value...
+ */
+ for (i = 0; i < KHASH_SIZE; ++i)
+ {
+ for (ktab = ktabp[i]; ktab != NULL && !got_int; ktab = ktab->next)
+ {
+ if (ktab->k_syn.id == id)
+ {
+ if (prev_contained != (ktab->flags & HL_CONTAINED)
+ || prev_skipnl != (ktab->flags & HL_SKIPNL)
+ || prev_skipwhite != (ktab->flags & HL_SKIPWHITE)
+ || prev_skipempty != (ktab->flags & HL_SKIPEMPTY)
+ || prev_cont_in_list != ktab->k_syn.cont_in_list
+ || prev_next_list != ktab->next_list)
+ outlen = 9999;
+ else
+ outlen = (int)STRLEN(ktab->keyword);
+ /* output "contained" and "nextgroup" on each line */
+ if (syn_list_header(did_header, outlen, id))
+ {
+ prev_contained = 0;
+ prev_next_list = NULL;
+ prev_cont_in_list = NULL;
+ prev_skipnl = 0;
+ prev_skipwhite = 0;
+ prev_skipempty = 0;
+ }
+ did_header = TRUE;
+ if (prev_contained != (ktab->flags & HL_CONTAINED))
+ {
+ msg_puts_attr((char_u *)"contained", attr);
+ msg_putchar(' ');
+ prev_contained = (ktab->flags & HL_CONTAINED);
+ }
+ if (ktab->k_syn.cont_in_list != prev_cont_in_list)
+ {
+ put_id_list((char_u *)"containedin",
+ ktab->k_syn.cont_in_list, attr);
+ msg_putchar(' ');
+ prev_cont_in_list = ktab->k_syn.cont_in_list;
+ }
+ if (ktab->next_list != prev_next_list)
+ {
+ put_id_list((char_u *)"nextgroup", ktab->next_list, attr);
+ msg_putchar(' ');
+ prev_next_list = ktab->next_list;
+ if (ktab->flags & HL_SKIPNL)
+ {
+ msg_puts_attr((char_u *)"skipnl", attr);
+ msg_putchar(' ');
+ prev_skipnl = (ktab->flags & HL_SKIPNL);
+ }
+ if (ktab->flags & HL_SKIPWHITE)
+ {
+ msg_puts_attr((char_u *)"skipwhite", attr);
+ msg_putchar(' ');
+ prev_skipwhite = (ktab->flags & HL_SKIPWHITE);
+ }
+ if (ktab->flags & HL_SKIPEMPTY)
+ {
+ msg_puts_attr((char_u *)"skipempty", attr);
+ msg_putchar(' ');
+ prev_skipempty = (ktab->flags & HL_SKIPEMPTY);
+ }
+ }
+ msg_outtrans(ktab->keyword);
+ }
+ }
+ }
+
+ return did_header;
+}
+
+ static void
+syn_clear_keyword(id, ktabp)
+ int id;
+ keyentry_T **ktabp;
+{
+ int i;
+ keyentry_T *ktab;
+ keyentry_T *ktab_prev;
+ keyentry_T *ktab_next;
+
+ if (ktabp == NULL) /* no keywords present */
+ return;
+
+ for (i = 0; i < KHASH_SIZE; ++i)
+ {
+ ktab_prev = NULL;
+ for (ktab = ktabp[i]; ktab != NULL; )
+ {
+ if (ktab->k_syn.id == id)
+ {
+ ktab_next = ktab->next;
+ if (ktab_prev == NULL)
+ ktabp[i] = ktab_next;
+ else
+ ktab_prev->next = ktab_next;
+ vim_free(ktab);
+ ktab = ktab_next;
+ }
+ else
+ {
+ ktab_prev = ktab;
+ ktab = ktab->next;
+ }
+ }
+ }
+}
+
+/*
+ * Recursive function to free() a branch of a kwordtab.
+ */
+ static void
+free_keywtab(ktabp)
+ keyentry_T **ktabp;
+{
+ int i;
+ keyentry_T *ktab;
+ keyentry_T *ktab_next;
+
+ if (ktabp != NULL)
+ {
+ for (i = 0; i < KHASH_SIZE; ++i)
+ for (ktab = ktabp[i]; ktab != NULL; ktab = ktab_next)
+ {
+ ktab_next = ktab->next;
+ vim_free(ktab->next_list);
+ vim_free(ktab->k_syn.cont_in_list);
+ vim_free(ktab);
+ }
+ vim_free(ktabp);
+ }
+}
+
+/*
+ * Add a keyword to the list of keywords.
+ */
+ static void
+add_keyword(name, id, flags, cont_in_list, next_list)
+ char_u *name; /* name of keyword */
+ int id; /* group ID for this keyword */
+ int flags; /* flags for this keyword */
+ short *cont_in_list; /* containedin for this keyword */
+ short *next_list; /* nextgroup for this keyword */
+{
+ keyentry_T *ktab;
+ keyentry_T ***ktabpp;
+ int hash;
+ char_u *name_ic = name;
+
+ if (curbuf->b_syn_ic)
+ {
+ name_ic = str_foldcase(name, (int)STRLEN(name));
+ if (name_ic == NULL)
+ name_ic = name;
+ }
+ ktab = (keyentry_T *)alloc((int)(sizeof(keyentry_T) + STRLEN(name_ic)));
+ if (ktab == NULL)
+ return;
+ STRCPY(ktab->keyword, name_ic);
+ if (name_ic != name)
+ vim_free(name_ic);
+ ktab->k_syn.id = id;
+ ktab->k_syn.inc_tag = current_syn_inc_tag;
+ ktab->flags = flags;
+ ktab->k_syn.cont_in_list = copy_id_list(cont_in_list);
+ if (cont_in_list != NULL)
+ curbuf->b_syn_containedin = TRUE;
+ ktab->next_list = copy_id_list(next_list);
+
+ if (curbuf->b_syn_ic)
+ ktabpp = &curbuf->b_keywtab_ic;
+ else
+ ktabpp = &curbuf->b_keywtab;
+
+ if (*ktabpp == NULL)
+ {
+ *ktabpp = (keyentry_T **)alloc_clear(
+ (int)(sizeof(keyentry_T *) * KHASH_SIZE));
+ if (*ktabpp == NULL)
+ return;
+ }
+
+ hash = syn_khash(ktab->keyword);
+ ktab->next = (*ktabpp)[hash];
+ (*ktabpp)[hash] = ktab;
+}
+
+/*
+ * Compute a hash value for a keyword. Uses the ElfHash algorithm, which is
+ * supposed to have an even distribution (suggested by Charles Campbell).
+ */
+ static int
+syn_khash(p)
+ char_u *p;
+{
+ long_u hash = 0;
+ long_u g;
+
+ while (*p != NUL)
+ {
+ hash = (hash << 4) + *p++; /* clear low 4 bits of hash, add char */
+ g = hash & 0xf0000000L; /* g has high 4 bits of hash only */
+ if (g != 0)
+ hash ^= g >> 24; /* xor g's high 4 bits into hash */
+ }
+
+ return (int)(hash & KHASH_MASK);
+}
+
+/*
+ * Get the start and end of the group name argument.
+ * Return a pointer to the first argument.
+ * Return NULL if the end of the command was found instead of further args.
+ */
+ static char_u *
+get_group_name(arg, name_end)
+ char_u *arg; /* start of the argument */
+ char_u **name_end; /* pointer to end of the name */
+{
+ char_u *rest;
+
+ *name_end = skiptowhite(arg);
+ rest = skipwhite(*name_end);
+
+ /*
+ * Check if there are enough arguments. The first argument may be a
+ * pattern, where '|' is allowed, so only check for NUL.
+ */
+ if (ends_excmd(*arg) || *rest == NUL)
+ return NULL;
+ return rest;
+}
+
+/*
+ * Check for syntax command option arguments.
+ * This can be called at any place in the list of arguments, and just picks
+ * out the arguments that are known. Can be called several times in a row to
+ * collect all options in between other arguments.
+ * Return a pointer to the next argument (which isn't an option).
+ * Return NULL for any error;
+ */
+ static char_u *
+get_syn_options(arg, flagsp, keyword, sync_idx, cont_list,
+ cont_in_list, next_list)
+ char_u *arg; /* next argument */
+ int *flagsp; /* flags for contained and transpartent */
+ int keyword; /* TRUE for ":syn keyword" */
+ int *sync_idx; /* syntax item for "grouphere" argument, NULL
+ if not allowed */
+ short **cont_list; /* group IDs for "contains" argument, NULL if
+ not allowed */
+ short **cont_in_list; /* group IDs for "containedin" argument, NULL
+ if not allowed */
+ short **next_list; /* group IDs for "nextgroup" argument */
+{
+ int flags;
+ char_u *gname_start, *gname;
+ int syn_id;
+ int len;
+ int i;
+ int fidx;
+ static struct flag
+ {
+ char *name;
+ int len;
+ int val;
+ } flagtab[] = { {"contained", 9, HL_CONTAINED},
+ {"oneline", 7, HL_ONELINE},
+ {"keepend", 7, HL_KEEPEND},
+ {"extend", 6, HL_EXTEND},
+ {"excludenl", 9, HL_EXCLUDENL},
+ {"transparent", 11, HL_TRANSP},
+ {"skipnl", 6, HL_SKIPNL},
+ {"skipwhite", 9, HL_SKIPWHITE},
+ {"skipempty", 9, HL_SKIPEMPTY},
+ {"grouphere", 9, HL_SYNC_HERE},
+ {"groupthere", 10, HL_SYNC_THERE},
+ {"display", 7, HL_DISPLAY},
+ {"fold", 4, HL_FOLD},
+ };
+#define MLEN 12
+ char lowname[MLEN];
+ int llen;
+
+ if (arg == NULL) /* already detected error */
+ return NULL;
+
+ flags = *flagsp;
+ for (;;)
+ {
+ /* STRNICMP() is a bit slow, change arg to lowercase first and use
+ * STRNCMP() */
+ for (llen = 0; llen < MLEN; ++llen)
+ {
+ if (!isalpha(arg[llen]))
+ break;
+ lowname[llen] = TOLOWER_ASC(arg[llen]);
+ }
+
+ for (fidx = sizeof(flagtab) / sizeof(struct flag); --fidx >= 0; )
+ {
+ len = flagtab[fidx].len;
+ if (len == llen
+ && STRNCMP(lowname, flagtab[fidx].name, len) == 0
+ && (ends_excmd(arg[len]) || vim_iswhite(arg[len])))
+ {
+ if (keyword
+ && (flagtab[fidx].val == HL_DISPLAY
+ || flagtab[fidx].val == HL_FOLD
+ || flagtab[fidx].val == HL_EXTEND))
+ {
+ /* treat "display", "fold" and "extend" as a keyword */
+ fidx = -1;
+ break;
+ }
+
+ flags |= flagtab[fidx].val;
+ arg = skipwhite(arg + len);
+
+ if (flagtab[fidx].val == HL_SYNC_HERE
+ || flagtab[fidx].val == HL_SYNC_THERE)
+ {
+ if (sync_idx == NULL)
+ {
+ EMSG(_("E393: group[t]here not accepted here"));
+ return NULL;
+ }
+ gname_start = arg;
+ arg = skiptowhite(arg);
+ if (gname_start == arg)
+ return NULL;
+ gname = vim_strnsave(gname_start, (int)(arg - gname_start));
+ if (gname == NULL)
+ return NULL;
+ if (STRCMP(gname, "NONE") == 0)
+ *sync_idx = NONE_IDX;
+ else
+ {
+ syn_id = syn_name2id(gname);
+ for (i = curbuf->b_syn_patterns.ga_len; --i >= 0; )
+ if (SYN_ITEMS(curbuf)[i].sp_syn.id == syn_id
+ && SYN_ITEMS(curbuf)[i].sp_type == SPTYPE_START)
+ {
+ *sync_idx = i;
+ break;
+ }
+ if (i < 0)
+ {
+ EMSG2(_("E394: Didn't find region item for %s"), gname);
+ vim_free(gname);
+ return NULL;
+ }
+ }
+
+ vim_free(gname);
+ arg = skipwhite(arg);
+ }
+#ifdef FEAT_FOLDING
+ else if (flagtab[fidx].val == HL_FOLD
+ && foldmethodIsSyntax(curwin))
+ {
+ /* Need to update folds later. */
+ foldUpdateAll(curwin);
+ }
+#endif
+ break;
+ }
+ }
+ if (fidx >= 0)
+ continue;
+
+ if (llen == 8 && STRNCMP(lowname, "contains", 8) == 0
+ && (vim_iswhite(arg[8]) || arg[8] == '='))
+ {
+ if (cont_list == NULL)
+ {
+ EMSG(_("E395: contains argument not accepted here"));
+ return NULL;
+ }
+ if (get_id_list(&arg, 8, cont_list) == FAIL)
+ return NULL;
+ }
+ else if (llen == 11 && STRNCMP(lowname, "containedin", 11) == 0
+ && (vim_iswhite(arg[11]) || arg[11] == '='))
+ {
+ if (cont_in_list == NULL)
+ {
+ EMSG(_("E396: containedin argument not accepted here"));
+ return NULL;
+ }
+ if (get_id_list(&arg, 11, cont_in_list) == FAIL)
+ return NULL;
+ }
+ else if (llen == 9 && STRNCMP(lowname, "nextgroup", 9) == 0
+ && (vim_iswhite(arg[9]) || arg[9] == '='))
+ {
+ if (get_id_list(&arg, 9, next_list) == FAIL)
+ return NULL;
+ }
+ else
+ break;
+ }
+
+ *flagsp = flags;
+
+ return arg;
+}
+
+/*
+ * Adjustments to syntax item when declared in a ":syn include"'d file.
+ * Set the contained flag, and if the item is not already contained, add it
+ * to the specified top-level group, if any.
+ */
+ static void
+syn_incl_toplevel(id, flagsp)
+ int id;
+ int *flagsp;
+{
+ if ((*flagsp & HL_CONTAINED) || curbuf->b_syn_topgrp == 0)
+ return;
+ *flagsp |= HL_CONTAINED;
+ if (curbuf->b_syn_topgrp >= SYNID_CLUSTER)
+ {
+ /* We have to alloc this, because syn_combine_list() will free it. */
+ short *grp_list = (short *)alloc((unsigned)(2 * sizeof(short)));
+ int tlg_id = curbuf->b_syn_topgrp - SYNID_CLUSTER;
+
+ if (grp_list != NULL)
+ {
+ grp_list[0] = id;
+ grp_list[1] = 0;
+ syn_combine_list(&SYN_CLSTR(curbuf)[tlg_id].scl_list, &grp_list,
+ CLUSTER_ADD);
+ }
+ }
+}
+
+/*
+ * Handle ":syntax include [@{group-name}] filename" command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_include(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ char_u *arg = eap->arg;
+ int sgl_id = 1;
+ char_u *group_name_end;
+ char_u *rest;
+ char_u *errormsg = NULL;
+ int prev_toplvl_grp;
+ int prev_syn_inc_tag;
+ int source = FALSE;
+
+ eap->nextcmd = find_nextcmd(arg);
+ if (eap->skip)
+ return;
+
+ if (arg[0] == '@')
+ {
+ ++arg;
+ rest = get_group_name(arg, &group_name_end);
+ if (rest == NULL)
+ {
+ EMSG((char_u *)_("E397: Filename required"));
+ return;
+ }
+ sgl_id = syn_check_cluster(arg, (int)(group_name_end - arg));
+ /* separate_nextcmd() and expand_filename() depend on this */
+ eap->arg = rest;
+ }
+
+ /*
+ * Everything that's left, up to the next command, should be the
+ * filename to include.
+ */
+ eap->argt |= (XFILE | NOSPC);
+ separate_nextcmd(eap);
+ if (*eap->arg == '<' || *eap->arg == '$' || mch_isFullName(eap->arg))
+ {
+ /* For an absolute path, "$VIM/..." or "<sfile>.." we ":source" the
+ * file. Need to expand the file name first. In other cases
+ * ":runtime!" is used. */
+ source = TRUE;
+ if (expand_filename(eap, syn_cmdlinep, &errormsg) == FAIL)
+ {
+ if (errormsg != NULL)
+ EMSG(errormsg);
+ return;
+ }
+ }
+
+ /*
+ * Save and restore the existing top-level grouplist id and ":syn
+ * include" tag around the actual inclusion.
+ */
+ prev_syn_inc_tag = current_syn_inc_tag;
+ current_syn_inc_tag = ++running_syn_inc_tag;
+ prev_toplvl_grp = curbuf->b_syn_topgrp;
+ curbuf->b_syn_topgrp = sgl_id;
+ if (source ? do_source(eap->arg, FALSE, FALSE) == FAIL
+ : cmd_runtime(eap->arg, TRUE) == FAIL)
+ EMSG2(_(e_notopen), eap->arg);
+ curbuf->b_syn_topgrp = prev_toplvl_grp;
+ current_syn_inc_tag = prev_syn_inc_tag;
+}
+
+/*
+ * Handle ":syntax keyword {group-name} [{option}] keyword .." command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_keyword(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ char_u *arg = eap->arg;
+ char_u *group_name_end;
+ int syn_id;
+ char_u *rest;
+ char_u *keyword_copy;
+ char_u *p;
+ char_u *first_arg;
+ int round;
+ int flags = 0;
+ short *next_list = NULL;
+ short *cont_in_list = NULL;
+
+ rest = get_group_name(arg, &group_name_end);
+
+ if (rest != NULL)
+ {
+ syn_id = syn_check_group(arg, (int)(group_name_end - arg));
+
+ /* allocate a buffer, for removing the backslashes in the keyword */
+ keyword_copy = alloc((unsigned)STRLEN(rest) + 1);
+ if (keyword_copy != NULL)
+ {
+ /*
+ * The options given apply to ALL keywords, so all options must be
+ * found before keywords can be created.
+ * round 1: collect the options.
+ * round 2: create the keywords.
+ */
+ first_arg = rest;
+ for (round = 1; round <= 2; ++round)
+ {
+ /*
+ * Isolate each keyword and add an entry for it.
+ */
+ for (rest = first_arg; rest != NULL && !ends_excmd(*rest);
+ rest = skipwhite(rest))
+ {
+ rest = get_syn_options(rest, &flags, TRUE, NULL,
+ NULL, &cont_in_list, &next_list);
+ if (rest == NULL || ends_excmd(*rest))
+ break;
+ p = keyword_copy;
+ while (*rest != 0 && !vim_iswhite(*rest))
+ {
+ if (*rest == '\\' && rest[1] != NUL)
+ ++rest;
+ *p++ = *rest++;
+ }
+ *p = NUL;
+ if (round == 2 && !eap->skip)
+ {
+ for (p = vim_strchr(keyword_copy, '['); ; )
+ {
+ if (p != NULL)
+ *p = NUL;
+ add_keyword(keyword_copy, syn_id, flags,
+ cont_in_list, next_list);
+ if (p == NULL || p[1] == NUL || p[1] == ']')
+ break;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ int l = (*mb_ptr2len_check)(p + 1);
+
+ mch_memmove(p, p + 1, l);
+ p += l;
+ }
+ else
+#endif
+ {
+ p[0] = p[1];
+ ++p;
+ }
+ }
+ }
+ }
+ if (round == 1)
+ syn_incl_toplevel(syn_id, &flags);
+ }
+ vim_free(keyword_copy);
+ }
+ }
+
+ if (rest != NULL)
+ eap->nextcmd = check_nextcmd(rest);
+ else
+ EMSG2(_(e_invarg2), arg);
+
+ vim_free(cont_in_list);
+ vim_free(next_list);
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+}
+
+/*
+ * Handle ":syntax match {name} [{options}] {pattern} [{options}]".
+ *
+ * Also ":syntax sync match {name} [[grouphere | groupthere] {group-name}] .."
+ */
+ static void
+syn_cmd_match(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* TRUE for ":syntax sync match .. " */
+{
+ char_u *arg = eap->arg;
+ char_u *group_name_end;
+ char_u *rest;
+ synpat_T item; /* the item found in the line */
+ int syn_id;
+ int idx;
+ int flags = 0;
+ int sync_idx = 0;
+ short *cont_list = NULL;
+ short *cont_in_list = NULL;
+ short *next_list = NULL;
+
+ /* Isolate the group name, check for validity */
+ rest = get_group_name(arg, &group_name_end);
+
+ /* Get options before the pattern */
+ rest = get_syn_options(rest, &flags, FALSE,
+ syncing ? &sync_idx : NULL, &cont_list, &cont_in_list, &next_list);
+
+ /* get the pattern. */
+ init_syn_patterns();
+ vim_memset(&item, 0, sizeof(item));
+ rest = get_syn_pattern(rest, &item);
+ if (vim_regcomp_had_eol() && !(flags & HL_EXCLUDENL))
+ flags |= HL_HAS_EOL;
+
+ /* Get options after the pattern */
+ rest = get_syn_options(rest, &flags, FALSE,
+ syncing ? &sync_idx : NULL, &cont_list, &cont_in_list, &next_list);
+
+ if (rest != NULL) /* all arguments are valid */
+ {
+ /*
+ * Check for trailing command and illegal trailing arguments.
+ */
+ eap->nextcmd = check_nextcmd(rest);
+ if (!ends_excmd(*rest) || eap->skip)
+ rest = NULL;
+ else if (ga_grow(&curbuf->b_syn_patterns, 1) != FAIL
+ && (syn_id = syn_check_group(arg,
+ (int)(group_name_end - arg))) != 0)
+ {
+ syn_incl_toplevel(syn_id, &flags);
+ /*
+ * Store the pattern in the syn_items list
+ */
+ idx = curbuf->b_syn_patterns.ga_len;
+ SYN_ITEMS(curbuf)[idx] = item;
+ SYN_ITEMS(curbuf)[idx].sp_syncing = syncing;
+ SYN_ITEMS(curbuf)[idx].sp_type = SPTYPE_MATCH;
+ SYN_ITEMS(curbuf)[idx].sp_syn.id = syn_id;
+ SYN_ITEMS(curbuf)[idx].sp_syn.inc_tag = current_syn_inc_tag;
+ SYN_ITEMS(curbuf)[idx].sp_flags = flags;
+ SYN_ITEMS(curbuf)[idx].sp_sync_idx = sync_idx;
+ SYN_ITEMS(curbuf)[idx].sp_cont_list = cont_list;
+ SYN_ITEMS(curbuf)[idx].sp_syn.cont_in_list = cont_in_list;
+ if (cont_in_list != NULL)
+ curbuf->b_syn_containedin = TRUE;
+ SYN_ITEMS(curbuf)[idx].sp_next_list = next_list;
+ ++curbuf->b_syn_patterns.ga_len;
+ --curbuf->b_syn_patterns.ga_room;
+
+ /* remember that we found a match for syncing on */
+ if (flags & (HL_SYNC_HERE|HL_SYNC_THERE))
+ curbuf->b_syn_sync_flags |= SF_MATCH;
+#ifdef FEAT_FOLDING
+ if (flags & HL_FOLD)
+ ++curbuf->b_syn_folditems;
+#endif
+
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+ return; /* don't free the progs and patterns now */
+ }
+ }
+
+ /*
+ * Something failed, free the allocated memory.
+ */
+ vim_free(item.sp_prog);
+ vim_free(item.sp_pattern);
+ vim_free(cont_list);
+ vim_free(cont_in_list);
+ vim_free(next_list);
+
+ if (rest == NULL)
+ EMSG2(_(e_invarg2), arg);
+}
+
+/*
+ * Handle ":syntax region {group-name} [matchgroup={group-name}]
+ * start {start} .. [skip {skip}] end {end} .. [{options}]".
+ */
+ static void
+syn_cmd_region(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* TRUE for ":syntax sync region .." */
+{
+ char_u *arg = eap->arg;
+ char_u *group_name_end;
+ char_u *rest; /* next arg, NULL on error */
+ char_u *key_end;
+ char_u *key = NULL;
+ char_u *p;
+ int item;
+#define ITEM_START 0
+#define ITEM_SKIP 1
+#define ITEM_END 2
+#define ITEM_MATCHGROUP 3
+ struct pat_ptr
+ {
+ synpat_T *pp_synp; /* pointer to syn_pattern */
+ int pp_matchgroup_id; /* matchgroup ID */
+ struct pat_ptr *pp_next; /* pointer to next pat_ptr */
+ } *(pat_ptrs[3]);
+ /* patterns found in the line */
+ struct pat_ptr *ppp;
+ struct pat_ptr *ppp_next;
+ int pat_count = 0; /* nr of syn_patterns found */
+ int syn_id;
+ int matchgroup_id = 0;
+ int not_enough = FALSE; /* not enough arguments */
+ int illegal = FALSE; /* illegal arguments */
+ int success = FALSE;
+ int idx;
+ int flags = 0;
+ short *cont_list = NULL;
+ short *cont_in_list = NULL;
+ short *next_list = NULL;
+
+ /* Isolate the group name, check for validity */
+ rest = get_group_name(arg, &group_name_end);
+
+ pat_ptrs[0] = NULL;
+ pat_ptrs[1] = NULL;
+ pat_ptrs[2] = NULL;
+
+ init_syn_patterns();
+
+ /*
+ * get the options, patterns and matchgroup.
+ */
+ while (rest != NULL && !ends_excmd(*rest))
+ {
+ /* Check for option arguments */
+ rest = get_syn_options(rest, &flags, FALSE, NULL,
+ &cont_list, &cont_in_list, &next_list);
+ if (rest == NULL || ends_excmd(*rest))
+ break;
+
+ /* must be a pattern or matchgroup then */
+ key_end = rest;
+ while (*key_end && !vim_iswhite(*key_end) && *key_end != '=')
+ ++key_end;
+ vim_free(key);
+ key = vim_strnsave_up(rest, (int)(key_end - rest));
+ if (key == NULL) /* out of memory */
+ {
+ rest = NULL;
+ break;
+ }
+ if (STRCMP(key, "MATCHGROUP") == 0)
+ item = ITEM_MATCHGROUP;
+ else if (STRCMP(key, "START") == 0)
+ item = ITEM_START;
+ else if (STRCMP(key, "END") == 0)
+ item = ITEM_END;
+ else if (STRCMP(key, "SKIP") == 0)
+ {
+ if (pat_ptrs[ITEM_SKIP] != NULL) /* one skip pattern allowed */
+ {
+ illegal = TRUE;
+ break;
+ }
+ item = ITEM_SKIP;
+ }
+ else
+ break;
+ rest = skipwhite(key_end);
+ if (*rest != '=')
+ {
+ rest = NULL;
+ EMSG2(_("E398: Missing '=': %s"), arg);
+ break;
+ }
+ rest = skipwhite(rest + 1);
+ if (*rest == NUL)
+ {
+ not_enough = TRUE;
+ break;
+ }
+
+ if (item == ITEM_MATCHGROUP)
+ {
+ p = skiptowhite(rest);
+ if ((p - rest == 4 && STRNCMP(rest, "NONE", 4) == 0) || eap->skip)
+ matchgroup_id = 0;
+ else
+ {
+ matchgroup_id = syn_check_group(rest, (int)(p - rest));
+ if (matchgroup_id == 0)
+ {
+ illegal = TRUE;
+ break;
+ }
+ }
+ rest = skipwhite(p);
+ }
+ else
+ {
+ /*
+ * Allocate room for a syn_pattern, and link it in the list of
+ * syn_patterns for this item, at the start (because the list is
+ * used from end to start).
+ */
+ ppp = (struct pat_ptr *)alloc((unsigned)sizeof(struct pat_ptr));
+ if (ppp == NULL)
+ {
+ rest = NULL;
+ break;
+ }
+ ppp->pp_next = pat_ptrs[item];
+ pat_ptrs[item] = ppp;
+ ppp->pp_synp = (synpat_T *)alloc_clear((unsigned)sizeof(synpat_T));
+ if (ppp->pp_synp == NULL)
+ {
+ rest = NULL;
+ break;
+ }
+
+ /*
+ * Get the syntax pattern and the following offset(s).
+ */
+ /* Enable the appropriate \z specials. */
+ if (item == ITEM_START)
+ reg_do_extmatch = REX_SET;
+ else if (item == ITEM_SKIP || item == ITEM_END)
+ reg_do_extmatch = REX_USE;
+ rest = get_syn_pattern(rest, ppp->pp_synp);
+ reg_do_extmatch = 0;
+ if (item == ITEM_END && vim_regcomp_had_eol()
+ && !(flags & HL_EXCLUDENL))
+ ppp->pp_synp->sp_flags |= HL_HAS_EOL;
+ ppp->pp_matchgroup_id = matchgroup_id;
+ ++pat_count;
+ }
+ }
+ vim_free(key);
+ if (illegal || not_enough)
+ rest = NULL;
+
+ /*
+ * Must have a "start" and "end" pattern.
+ */
+ if (rest != NULL && (pat_ptrs[ITEM_START] == NULL ||
+ pat_ptrs[ITEM_END] == NULL))
+ {
+ not_enough = TRUE;
+ rest = NULL;
+ }
+
+ if (rest != NULL)
+ {
+ /*
+ * Check for trailing garbage or command.
+ * If OK, add the item.
+ */
+ eap->nextcmd = check_nextcmd(rest);
+ if (!ends_excmd(*rest) || eap->skip)
+ rest = NULL;
+ else if (ga_grow(&(curbuf->b_syn_patterns), pat_count) != FAIL
+ && (syn_id = syn_check_group(arg,
+ (int)(group_name_end - arg))) != 0)
+ {
+ syn_incl_toplevel(syn_id, &flags);
+ /*
+ * Store the start/skip/end in the syn_items list
+ */
+ idx = curbuf->b_syn_patterns.ga_len;
+ for (item = ITEM_START; item <= ITEM_END; ++item)
+ {
+ for (ppp = pat_ptrs[item]; ppp != NULL; ppp = ppp->pp_next)
+ {
+ SYN_ITEMS(curbuf)[idx] = *(ppp->pp_synp);
+ SYN_ITEMS(curbuf)[idx].sp_syncing = syncing;
+ SYN_ITEMS(curbuf)[idx].sp_type =
+ (item == ITEM_START) ? SPTYPE_START :
+ (item == ITEM_SKIP) ? SPTYPE_SKIP : SPTYPE_END;
+ SYN_ITEMS(curbuf)[idx].sp_flags |= flags;
+ SYN_ITEMS(curbuf)[idx].sp_syn.id = syn_id;
+ SYN_ITEMS(curbuf)[idx].sp_syn.inc_tag = current_syn_inc_tag;
+ SYN_ITEMS(curbuf)[idx].sp_syn_match_id =
+ ppp->pp_matchgroup_id;
+ if (item == ITEM_START)
+ {
+ SYN_ITEMS(curbuf)[idx].sp_cont_list = cont_list;
+ SYN_ITEMS(curbuf)[idx].sp_syn.cont_in_list =
+ cont_in_list;
+ if (cont_in_list != NULL)
+ curbuf->b_syn_containedin = TRUE;
+ SYN_ITEMS(curbuf)[idx].sp_next_list = next_list;
+ }
+ ++curbuf->b_syn_patterns.ga_len;
+ --curbuf->b_syn_patterns.ga_room;
+ ++idx;
+#ifdef FEAT_FOLDING
+ if (flags & HL_FOLD)
+ ++curbuf->b_syn_folditems;
+#endif
+ }
+ }
+
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+ success = TRUE; /* don't free the progs and patterns now */
+ }
+ }
+
+ /*
+ * Free the allocated memory.
+ */
+ for (item = ITEM_START; item <= ITEM_END; ++item)
+ for (ppp = pat_ptrs[item]; ppp != NULL; ppp = ppp_next)
+ {
+ if (!success)
+ {
+ vim_free(ppp->pp_synp->sp_prog);
+ vim_free(ppp->pp_synp->sp_pattern);
+ }
+ vim_free(ppp->pp_synp);
+ ppp_next = ppp->pp_next;
+ vim_free(ppp);
+ }
+
+ if (!success)
+ {
+ vim_free(cont_list);
+ vim_free(cont_in_list);
+ vim_free(next_list);
+ if (not_enough)
+ EMSG2(_("E399: Not enough arguments: syntax region %s"), arg);
+ else if (illegal || rest == NULL)
+ EMSG2(_(e_invarg2), arg);
+ }
+}
+
+/*
+ * A simple syntax group ID comparison function suitable for use in qsort()
+ */
+ static int
+#ifdef __BORLANDC__
+_RTLENTRYF
+#endif
+syn_compare_stub(v1, v2)
+ const void *v1;
+ const void *v2;
+{
+ const short *s1 = v1;
+ const short *s2 = v2;
+
+ return (*s1 > *s2 ? 1 : *s1 < *s2 ? -1 : 0);
+}
+
+/*
+ * Combines lists of syntax clusters.
+ * *clstr1 and *clstr2 must both be allocated memory; they will be consumed.
+ */
+ static void
+syn_combine_list(clstr1, clstr2, list_op)
+ short **clstr1;
+ short **clstr2;
+ int list_op;
+{
+ int count1 = 0;
+ int count2 = 0;
+ short *g1;
+ short *g2;
+ short *clstr = NULL;
+ int count;
+ int round;
+
+ /*
+ * Handle degenerate cases.
+ */
+ if (*clstr2 == NULL)
+ return;
+ if (*clstr1 == NULL || list_op == CLUSTER_REPLACE)
+ {
+ if (list_op == CLUSTER_REPLACE)
+ vim_free(*clstr1);
+ if (list_op == CLUSTER_REPLACE || list_op == CLUSTER_ADD)
+ *clstr1 = *clstr2;
+ else
+ vim_free(*clstr2);
+ return;
+ }
+
+ for (g1 = *clstr1; *g1; g1++)
+ ++count1;
+ for (g2 = *clstr2; *g2; g2++)
+ ++count2;
+
+ /*
+ * For speed purposes, sort both lists.
+ */
+ qsort(*clstr1, (size_t)count1, sizeof(short), syn_compare_stub);
+ qsort(*clstr2, (size_t)count2, sizeof(short), syn_compare_stub);
+
+ /*
+ * We proceed in two passes; in round 1, we count the elements to place
+ * in the new list, and in round 2, we allocate and populate the new
+ * list. For speed, we use a mergesort-like method, adding the smaller
+ * of the current elements in each list to the new list.
+ */
+ for (round = 1; round <= 2; round++)
+ {
+ g1 = *clstr1;
+ g2 = *clstr2;
+ count = 0;
+
+ /*
+ * First, loop through the lists until one of them is empty.
+ */
+ while (*g1 && *g2)
+ {
+ /*
+ * We always want to add from the first list.
+ */
+ if (*g1 < *g2)
+ {
+ if (round == 2)
+ clstr[count] = *g1;
+ count++;
+ g1++;
+ continue;
+ }
+ /*
+ * We only want to add from the second list if we're adding the
+ * lists.
+ */
+ if (list_op == CLUSTER_ADD)
+ {
+ if (round == 2)
+ clstr[count] = *g2;
+ count++;
+ }
+ if (*g1 == *g2)
+ g1++;
+ g2++;
+ }
+
+ /*
+ * Now add the leftovers from whichever list didn't get finished
+ * first. As before, we only want to add from the second list if
+ * we're adding the lists.
+ */
+ for (; *g1; g1++, count++)
+ if (round == 2)
+ clstr[count] = *g1;
+ if (list_op == CLUSTER_ADD)
+ for (; *g2; g2++, count++)
+ if (round == 2)
+ clstr[count] = *g2;
+
+ if (round == 1)
+ {
+ /*
+ * If the group ended up empty, we don't need to allocate any
+ * space for it.
+ */
+ if (count == 0)
+ {
+ clstr = NULL;
+ break;
+ }
+ clstr = (short *)alloc((unsigned)((count + 1) * sizeof(short)));
+ if (clstr == NULL)
+ break;
+ clstr[count] = 0;
+ }
+ }
+
+ /*
+ * Finally, put the new list in place.
+ */
+ vim_free(*clstr1);
+ vim_free(*clstr2);
+ *clstr1 = clstr;
+}
+
+/*
+ * Lookup a syntax cluster name and return it's ID.
+ * If it is not found, 0 is returned.
+ */
+ static int
+syn_scl_name2id(name)
+ char_u *name;
+{
+ int i;
+ char_u *name_u;
+
+ /* Avoid using stricmp() too much, it's slow on some systems */
+ name_u = vim_strsave_up(name);
+ if (name_u == NULL)
+ return 0;
+ for (i = curbuf->b_syn_clusters.ga_len; --i >= 0; )
+ if (SYN_CLSTR(curbuf)[i].scl_name_u != NULL
+ && STRCMP(name_u, SYN_CLSTR(curbuf)[i].scl_name_u) == 0)
+ break;
+ vim_free(name_u);
+ return (i < 0 ? 0 : i + SYNID_CLUSTER);
+}
+
+/*
+ * Like syn_scl_name2id(), but take a pointer + length argument.
+ */
+ static int
+syn_scl_namen2id(linep, len)
+ char_u *linep;
+ int len;
+{
+ char_u *name;
+ int id = 0;
+
+ name = vim_strnsave(linep, len);
+ if (name != NULL)
+ {
+ id = syn_scl_name2id(name);
+ vim_free(name);
+ }
+ return id;
+}
+
+/*
+ * Find syntax cluster name in the table and return it's ID.
+ * The argument is a pointer to the name and the length of the name.
+ * If it doesn't exist yet, a new entry is created.
+ * Return 0 for failure.
+ */
+ static int
+syn_check_cluster(pp, len)
+ char_u *pp;
+ int len;
+{
+ int id;
+ char_u *name;
+
+ name = vim_strnsave(pp, len);
+ if (name == NULL)
+ return 0;
+
+ id = syn_scl_name2id(name);
+ if (id == 0) /* doesn't exist yet */
+ id = syn_add_cluster(name);
+ else
+ vim_free(name);
+ return id;
+}
+
+/*
+ * Add new syntax cluster and return it's ID.
+ * "name" must be an allocated string, it will be consumed.
+ * Return 0 for failure.
+ */
+ static int
+syn_add_cluster(name)
+ char_u *name;
+{
+ int len;
+
+ /*
+ * First call for this growarray: init growing array.
+ */
+ if (curbuf->b_syn_clusters.ga_data == NULL)
+ {
+ curbuf->b_syn_clusters.ga_itemsize = sizeof(struct syn_cluster);
+ curbuf->b_syn_clusters.ga_growsize = 10;
+ }
+
+ /*
+ * Make room for at least one other cluster entry.
+ */
+ if (ga_grow(&curbuf->b_syn_clusters, 1) == FAIL)
+ {
+ vim_free(name);
+ return 0;
+ }
+ len = curbuf->b_syn_clusters.ga_len;
+
+ vim_memset(&(SYN_CLSTR(curbuf)[len]), 0, sizeof(struct syn_cluster));
+ SYN_CLSTR(curbuf)[len].scl_name = name;
+ SYN_CLSTR(curbuf)[len].scl_name_u = vim_strsave_up(name);
+ SYN_CLSTR(curbuf)[len].scl_list = NULL;
+ ++curbuf->b_syn_clusters.ga_len;
+ --curbuf->b_syn_clusters.ga_room;
+
+ return len + SYNID_CLUSTER;
+}
+
+/*
+ * Handle ":syntax cluster {cluster-name} [contains={groupname},..]
+ * [add={groupname},..] [remove={groupname},..]".
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_cluster(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ char_u *arg = eap->arg;
+ char_u *group_name_end;
+ char_u *rest;
+ int scl_id;
+ short *clstr_list;
+ int got_clstr = FALSE;
+ int opt_len;
+ int list_op;
+
+ eap->nextcmd = find_nextcmd(arg);
+ if (eap->skip)
+ return;
+
+ rest = get_group_name(arg, &group_name_end);
+
+ if (rest != NULL)
+ {
+ scl_id = syn_check_cluster(arg, (int)(group_name_end - arg))
+ - SYNID_CLUSTER;
+
+ for (;;)
+ {
+ if (STRNICMP(rest, "add", 3) == 0
+ && (vim_iswhite(rest[3]) || rest[3] == '='))
+ {
+ opt_len = 3;
+ list_op = CLUSTER_ADD;
+ }
+ else if (STRNICMP(rest, "remove", 6) == 0
+ && (vim_iswhite(rest[6]) || rest[6] == '='))
+ {
+ opt_len = 6;
+ list_op = CLUSTER_SUBTRACT;
+ }
+ else if (STRNICMP(rest, "contains", 8) == 0
+ && (vim_iswhite(rest[8]) || rest[8] == '='))
+ {
+ opt_len = 8;
+ list_op = CLUSTER_REPLACE;
+ }
+ else
+ break;
+
+ clstr_list = NULL;
+ if (get_id_list(&rest, opt_len, &clstr_list) == FAIL)
+ {
+ EMSG2(_(e_invarg2), rest);
+ break;
+ }
+ syn_combine_list(&SYN_CLSTR(curbuf)[scl_id].scl_list,
+ &clstr_list, list_op);
+ got_clstr = TRUE;
+ }
+
+ if (got_clstr)
+ {
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+ }
+ }
+
+ if (!got_clstr)
+ EMSG(_("E400: No cluster specified"));
+ if (rest == NULL || !ends_excmd(*rest))
+ EMSG2(_(e_invarg2), arg);
+}
+
+/*
+ * On first call for current buffer: Init growing array.
+ */
+ static void
+init_syn_patterns()
+{
+ curbuf->b_syn_patterns.ga_itemsize = sizeof(synpat_T);
+ curbuf->b_syn_patterns.ga_growsize = 10;
+}
+
+/*
+ * Get one pattern for a ":syntax match" or ":syntax region" command.
+ * Stores the pattern and program in a synpat_T.
+ * Returns a pointer to the next argument, or NULL in case of an error.
+ */
+ static char_u *
+get_syn_pattern(arg, ci)
+ char_u *arg;
+ synpat_T *ci;
+{
+ char_u *end;
+ int *p;
+ int idx;
+ char_u *cpo_save;
+
+ /* need at least three chars */
+ if (arg == NULL || arg[1] == NUL || arg[2] == NUL)
+ return NULL;
+
+ end = skip_regexp(arg + 1, *arg, TRUE, NULL);
+ if (*end != *arg) /* end delimiter not found */
+ {
+ EMSG2(_("E401: Pattern delimiter not found: %s"), arg);
+ return NULL;
+ }
+ /* store the pattern and compiled regexp program */
+ if ((ci->sp_pattern = vim_strnsave(arg + 1, (int)(end - arg - 1))) == NULL)
+ return NULL;
+
+ /* Make 'cpoptions' empty, to avoid the 'l' flag */
+ cpo_save = p_cpo;
+ p_cpo = (char_u *)"";
+ ci->sp_prog = vim_regcomp(ci->sp_pattern, RE_MAGIC);
+ p_cpo = cpo_save;
+
+ if (ci->sp_prog == NULL)
+ return NULL;
+ ci->sp_ic = curbuf->b_syn_ic;
+
+ /*
+ * Check for a match, highlight or region offset.
+ */
+ ++end;
+ do
+ {
+ for (idx = SPO_COUNT; --idx >= 0; )
+ if (STRNCMP(end, spo_name_tab[idx], 3) == 0)
+ break;
+ if (idx >= 0)
+ {
+ p = &(ci->sp_offsets[idx]);
+ if (idx != SPO_LC_OFF)
+ switch (end[3])
+ {
+ case 's': break;
+ case 'b': break;
+ case 'e': idx += SPO_COUNT; break;
+ default: idx = -1; break;
+ }
+ if (idx >= 0)
+ {
+ ci->sp_off_flags |= (1 << idx);
+ if (idx == SPO_LC_OFF) /* lc=99 */
+ {
+ end += 3;
+ *p = getdigits(&end);
+
+ /* "lc=" offset automatically sets "ms=" offset */
+ if (!(ci->sp_off_flags & (1 << SPO_MS_OFF)))
+ {
+ ci->sp_off_flags |= (1 << SPO_MS_OFF);
+ ci->sp_offsets[SPO_MS_OFF] = *p;
+ }
+ }
+ else /* yy=x+99 */
+ {
+ end += 4;
+ if (*end == '+')
+ {
+ ++end;
+ *p = getdigits(&end); /* positive offset */
+ }
+ else if (*end == '-')
+ {
+ ++end;
+ *p = -getdigits(&end); /* negative offset */
+ }
+ }
+ if (*end != ',')
+ break;
+ ++end;
+ }
+ }
+ } while (idx >= 0);
+
+ if (!ends_excmd(*end) && !vim_iswhite(*end))
+ {
+ EMSG2(_("E402: Garbage after pattern: %s"), arg);
+ return NULL;
+ }
+ return skipwhite(end);
+}
+
+/*
+ * Handle ":syntax sync .." command.
+ */
+/* ARGSUSED */
+ static void
+syn_cmd_sync(eap, syncing)
+ exarg_T *eap;
+ int syncing; /* not used */
+{
+ char_u *arg_start = eap->arg;
+ char_u *arg_end;
+ char_u *key = NULL;
+ char_u *next_arg;
+ int illegal = FALSE;
+ int finished = FALSE;
+ long n;
+ char_u *cpo_save;
+
+ if (ends_excmd(*arg_start))
+ {
+ syn_cmd_list(eap, TRUE);
+ return;
+ }
+
+ while (!ends_excmd(*arg_start))
+ {
+ arg_end = skiptowhite(arg_start);
+ next_arg = skipwhite(arg_end);
+ vim_free(key);
+ key = vim_strnsave_up(arg_start, (int)(arg_end - arg_start));
+ if (STRCMP(key, "CCOMMENT") == 0)
+ {
+ if (!eap->skip)
+ curbuf->b_syn_sync_flags |= SF_CCOMMENT;
+ if (!ends_excmd(*next_arg))
+ {
+ arg_end = skiptowhite(next_arg);
+ if (!eap->skip)
+ curbuf->b_syn_sync_id = syn_check_group(next_arg,
+ (int)(arg_end - next_arg));
+ next_arg = skipwhite(arg_end);
+ }
+ else if (!eap->skip)
+ curbuf->b_syn_sync_id = syn_name2id((char_u *)"Comment");
+ }
+ else if ( STRNCMP(key, "LINES", 5) == 0
+ || STRNCMP(key, "MINLINES", 8) == 0
+ || STRNCMP(key, "MAXLINES", 8) == 0
+ || STRNCMP(key, "LINEBREAKS", 10) == 0)
+ {
+ if (key[4] == 'S')
+ arg_end = key + 6;
+ else if (key[0] == 'L')
+ arg_end = key + 11;
+ else
+ arg_end = key + 9;
+ if (arg_end[-1] != '=' || !VIM_ISDIGIT(*arg_end))
+ {
+ illegal = TRUE;
+ break;
+ }
+ n = getdigits(&arg_end);
+ if (!eap->skip)
+ {
+ if (key[4] == 'B')
+ curbuf->b_syn_sync_linebreaks = n;
+ else if (key[1] == 'A')
+ curbuf->b_syn_sync_maxlines = n;
+ else
+ curbuf->b_syn_sync_minlines = n;
+ }
+ }
+ else if (STRCMP(key, "FROMSTART") == 0)
+ {
+ if (!eap->skip)
+ {
+ curbuf->b_syn_sync_minlines = MAXLNUM;
+ curbuf->b_syn_sync_maxlines = 0;
+ }
+ }
+ else if (STRCMP(key, "LINECONT") == 0)
+ {
+ if (curbuf->b_syn_linecont_pat != NULL)
+ {
+ EMSG(_("E403: syntax sync: line continuations pattern specified twice"));
+ finished = TRUE;
+ break;
+ }
+ arg_end = skip_regexp(next_arg + 1, *next_arg, TRUE, NULL);
+ if (*arg_end != *next_arg) /* end delimiter not found */
+ {
+ illegal = TRUE;
+ break;
+ }
+
+ if (!eap->skip)
+ {
+ /* store the pattern and compiled regexp program */
+ if ((curbuf->b_syn_linecont_pat = vim_strnsave(next_arg + 1,
+ (int)(arg_end - next_arg - 1))) == NULL)
+ {
+ finished = TRUE;
+ break;
+ }
+ curbuf->b_syn_linecont_ic = curbuf->b_syn_ic;
+
+ /* Make 'cpoptions' empty, to avoid the 'l' flag */
+ cpo_save = p_cpo;
+ p_cpo = (char_u *)"";
+ curbuf->b_syn_linecont_prog =
+ vim_regcomp(curbuf->b_syn_linecont_pat, RE_MAGIC);
+ p_cpo = cpo_save;
+
+ if (curbuf->b_syn_linecont_prog == NULL)
+ {
+ vim_free(curbuf->b_syn_linecont_pat);
+ curbuf->b_syn_linecont_pat = NULL;
+ finished = TRUE;
+ break;
+ }
+ }
+ next_arg = skipwhite(arg_end + 1);
+ }
+ else
+ {
+ eap->arg = next_arg;
+ if (STRCMP(key, "MATCH") == 0)
+ syn_cmd_match(eap, TRUE);
+ else if (STRCMP(key, "REGION") == 0)
+ syn_cmd_region(eap, TRUE);
+ else if (STRCMP(key, "CLEAR") == 0)
+ syn_cmd_clear(eap, TRUE);
+ else
+ illegal = TRUE;
+ finished = TRUE;
+ break;
+ }
+ arg_start = next_arg;
+ }
+ vim_free(key);
+ if (illegal)
+ EMSG2(_("E404: Illegal arguments: %s"), arg_start);
+ else if (!finished)
+ {
+ eap->nextcmd = check_nextcmd(arg_start);
+ redraw_curbuf_later(NOT_VALID);
+ syn_stack_free_all(curbuf); /* Need to recompute all syntax. */
+ }
+}
+
+/*
+ * Convert a line of highlight group names into a list of group ID numbers.
+ * "arg" should point to the "contains" or "nextgroup" keyword.
+ * "arg" is advanced to after the last group name.
+ * Careful: the argument is modified (NULs added).
+ * returns FAIL for some error, OK for success.
+ */
+ static int
+get_id_list(arg, keylen, list)
+ char_u **arg;
+ int keylen; /* length of keyword */
+ short **list; /* where to store the resulting list, if not
+ NULL, the list is silently skipped! */
+{
+ char_u *p = NULL;
+ char_u *end;
+ int round;
+ int count;
+ int total_count = 0;
+ short *retval = NULL;
+ char_u *name;
+ regmatch_T regmatch;
+ int id;
+ int i;
+ int failed = FALSE;
+
+ /*
+ * We parse the list twice:
+ * round == 1: count the number of items, allocate the array.
+ * round == 2: fill the array with the items.
+ * In round 1 new groups may be added, causing the number of items to
+ * grow when a regexp is used. In that case round 1 is done once again.
+ */
+ for (round = 1; round <= 2; ++round)
+ {
+ /*
+ * skip "contains"
+ */
+ p = skipwhite(*arg + keylen);
+ if (*p != '=')
+ {
+ EMSG2(_("E405: Missing equal sign: %s"), *arg);
+ break;
+ }
+ p = skipwhite(p + 1);
+ if (ends_excmd(*p))
+ {
+ EMSG2(_("E406: Empty argument: %s"), *arg);
+ break;
+ }
+
+ /*
+ * parse the arguments after "contains"
+ */
+ count = 0;
+ while (!ends_excmd(*p))
+ {
+ for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end)
+ ;
+ name = alloc((int)(end - p + 3)); /* leave room for "^$" */
+ if (name == NULL)
+ {
+ failed = TRUE;
+ break;
+ }
+ STRNCPY(name + 1, p, end - p);
+ name[end - p + 1] = NUL;
+ if ( STRCMP(name + 1, "ALLBUT") == 0
+ || STRCMP(name + 1, "ALL") == 0
+ || STRCMP(name + 1, "TOP") == 0
+ || STRCMP(name + 1, "CONTAINED") == 0)
+ {
+ if (TOUPPER_ASC(**arg) != 'C')
+ {
+ EMSG2(_("E407: %s not allowed here"), name + 1);
+ failed = TRUE;
+ vim_free(name);
+ break;
+ }
+ if (count != 0)
+ {
+ EMSG2(_("E408: %s must be first in contains list"), name + 1);
+ failed = TRUE;
+ vim_free(name);
+ break;
+ }
+ if (name[1] == 'A')
+ id = SYNID_ALLBUT;
+ else if (name[1] == 'T')
+ id = SYNID_TOP;
+ else
+ id = SYNID_CONTAINED;
+ id += current_syn_inc_tag;
+ }
+ else if (name[1] == '@')
+ {
+ id = syn_check_cluster(name + 2, (int)(end - p - 1));
+ }
+ else
+ {
+ /*
+ * Handle full group name.
+ */
+ if (vim_strpbrk(name + 1, (char_u *)"\\.*^$~[") == NULL)
+ id = syn_check_group(name + 1, (int)(end - p));
+ else
+ {
+ /*
+ * Handle match of regexp with group names.
+ */
+ *name = '^';
+ STRCAT(name, "$");
+ regmatch.regprog = vim_regcomp(name, RE_MAGIC);
+ if (regmatch.regprog == NULL)
+ {
+ failed = TRUE;
+ vim_free(name);
+ break;
+ }
+
+ regmatch.rm_ic = TRUE;
+ id = 0;
+ for (i = highlight_ga.ga_len; --i >= 0; )
+ {
+ if (vim_regexec(&regmatch, HL_TABLE()[i].sg_name,
+ (colnr_T)0))
+ {
+ if (round == 2)
+ {
+ /* Got more items than expected; can happen
+ * when adding items that match:
+ * "contains=a.*b,axb".
+ * Go back to first round */
+ if (count >= total_count)
+ {
+ vim_free(retval);
+ round = 1;
+ }
+ else
+ retval[count] = i + 1;
+ }
+ ++count;
+ id = -1; /* remember that we found one */
+ }
+ }
+ vim_free(regmatch.regprog);
+ }
+ }
+ vim_free(name);
+ if (id == 0)
+ {
+ EMSG2(_("E409: Unknown group name: %s"), p);
+ failed = TRUE;
+ break;
+ }
+ if (id > 0)
+ {
+ if (round == 2)
+ {
+ /* Got more items than expected, go back to first round */
+ if (count >= total_count)
+ {
+ vim_free(retval);
+ round = 1;
+ }
+ else
+ retval[count] = id;
+ }
+ ++count;
+ }
+ p = skipwhite(end);
+ if (*p != ',')
+ break;
+ p = skipwhite(p + 1); /* skip comma in between arguments */
+ }
+ if (failed)
+ break;
+ if (round == 1)
+ {
+ retval = (short *)alloc((unsigned)((count + 1) * sizeof(short)));
+ if (retval == NULL)
+ break;
+ retval[count] = 0; /* zero means end of the list */
+ total_count = count;
+ }
+ }
+
+ *arg = p;
+ if (failed || retval == NULL)
+ {
+ vim_free(retval);
+ return FAIL;
+ }
+
+ if (*list == NULL)
+ *list = retval;
+ else
+ vim_free(retval); /* list already found, don't overwrite it */
+
+ return OK;
+}
+
+/*
+ * Make a copy of an ID list.
+ */
+ static short *
+copy_id_list(list)
+ short *list;
+{
+ int len;
+ int count;
+ short *retval;
+
+ if (list == NULL)
+ return NULL;
+
+ for (count = 0; list[count]; ++count)
+ ;
+ len = (count + 1) * sizeof(short);
+ retval = (short *)alloc((unsigned)len);
+ if (retval != NULL)
+ mch_memmove(retval, list, (size_t)len);
+
+ return retval;
+}
+
+/*
+ * Check if syntax group "ssp" is in the ID list "list" of "cur_si".
+ * "cur_si" can be NULL if not checking the "containedin" list.
+ * Used to check if a syntax item is in the "contains" or "nextgroup" list of
+ * the current item.
+ * This function is called very often, keep it fast!!
+ */
+ static int
+in_id_list(cur_si, list, ssp, contained)
+ stateitem_T *cur_si; /* current item or NULL */
+ short *list; /* id list */
+ struct sp_syn *ssp; /* group id and ":syn include" tag of group */
+ int contained; /* group id is contained */
+{
+ int retval;
+ short *scl_list;
+ short item;
+ short id = ssp->id;
+ static int depth = 0;
+ int r;
+
+ /* If spp has a "containedin" list and "cur_si" is in it, return TRUE. */
+ if (cur_si != NULL && ssp->cont_in_list != NULL)
+ {
+ /* Ignore transparent items without a contains argument. Double check
+ * that we don't go back past the first one. */
+ while ((cur_si->si_flags & HL_TRANS_CONT)
+ && cur_si > (stateitem_T *)(current_state.ga_data))
+ --cur_si;
+ /* cur_si->si_idx is -1 for keywords, these never contain anything. */
+ if (cur_si->si_idx >= 0 && in_id_list(NULL, ssp->cont_in_list,
+ &(SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_syn),
+ SYN_ITEMS(syn_buf)[cur_si->si_idx].sp_flags & HL_CONTAINED))
+ return TRUE;
+ }
+
+ if (list == NULL)
+ return FALSE;
+
+ /*
+ * If list is ID_LIST_ALL, we are in a transparent item that isn't
+ * inside anything. Only allow not-contained groups.
+ */
+ if (list == ID_LIST_ALL)
+ return !contained;
+
+ /*
+ * If the first item is "ALLBUT", return TRUE if "id" is NOT in the
+ * contains list. We also require that "id" is at the same ":syn include"
+ * level as the list.
+ */
+ item = *list;
+ if (item >= SYNID_ALLBUT && item < SYNID_CLUSTER)
+ {
+ if (item < SYNID_TOP)
+ {
+ /* ALL or ALLBUT: accept all groups in the same file */
+ if (item - SYNID_ALLBUT != ssp->inc_tag)
+ return FALSE;
+ }
+ else if (item < SYNID_CONTAINED)
+ {
+ /* TOP: accept all not-contained groups in the same file */
+ if (item - SYNID_TOP != ssp->inc_tag || contained)
+ return FALSE;
+ }
+ else
+ {
+ /* CONTAINED: accept all contained groups in the same file */
+ if (item - SYNID_CONTAINED != ssp->inc_tag || !contained)
+ return FALSE;
+ }
+ item = *++list;
+ retval = FALSE;
+ }
+ else
+ retval = TRUE;
+
+ /*
+ * Return "retval" if id is in the contains list.
+ */
+ while (item != 0)
+ {
+ if (item == id)
+ return retval;
+ if (item >= SYNID_CLUSTER)
+ {
+ scl_list = SYN_CLSTR(syn_buf)[item - SYNID_CLUSTER].scl_list;
+ /* restrict recursiveness to 30 to avoid an endless loop for a
+ * cluster that includes itself (indirectly) */
+ if (scl_list != NULL && depth < 30)
+ {
+ ++depth;
+ r = in_id_list(NULL, scl_list, ssp, contained);
+ --depth;
+ if (r)
+ return retval;
+ }
+ }
+ item = *++list;
+ }
+ return !retval;
+}
+
+struct subcommand
+{
+ char *name; /* subcommand name */
+ void (*func)__ARGS((exarg_T *, int)); /* function to call */
+};
+
+static struct subcommand subcommands[] =
+{
+ {"case", syn_cmd_case},
+ {"clear", syn_cmd_clear},
+ {"cluster", syn_cmd_cluster},
+ {"enable", syn_cmd_enable},
+ {"include", syn_cmd_include},
+ {"keyword", syn_cmd_keyword},
+ {"list", syn_cmd_list},
+ {"manual", syn_cmd_manual},
+ {"match", syn_cmd_match},
+ {"on", syn_cmd_on},
+ {"off", syn_cmd_off},
+ {"region", syn_cmd_region},
+ {"reset", syn_cmd_reset},
+ {"sync", syn_cmd_sync},
+ {"", syn_cmd_list},
+ {NULL, NULL}
+};
+
+/*
+ * ":syntax".
+ * This searches the subcommands[] table for the subcommand name, and calls a
+ * syntax_subcommand() function to do the rest.
+ */
+ void
+ex_syntax(eap)
+ exarg_T *eap;
+{
+ char_u *arg = eap->arg;
+ char_u *subcmd_end;
+ char_u *subcmd_name;
+ int i;
+
+ syn_cmdlinep = eap->cmdlinep;
+
+ /* isolate subcommand name */
+ for (subcmd_end = arg; ASCII_ISALPHA(*subcmd_end); ++subcmd_end)
+ ;
+ subcmd_name = vim_strnsave(arg, (int)(subcmd_end - arg));
+ if (subcmd_name != NULL)
+ {
+ if (eap->skip) /* skip error messages for all subcommands */
+ ++emsg_skip;
+ for (i = 0; ; ++i)
+ {
+ if (subcommands[i].name == NULL)
+ {
+ EMSG2(_("E410: Invalid :syntax subcommand: %s"), subcmd_name);
+ break;
+ }
+ if (STRCMP(subcmd_name, (char_u *)subcommands[i].name) == 0)
+ {
+ eap->arg = skipwhite(subcmd_end);
+ (subcommands[i].func)(eap, FALSE);
+ break;
+ }
+ }
+ vim_free(subcmd_name);
+ if (eap->skip)
+ --emsg_skip;
+ }
+}
+
+ int
+syntax_present(buf)
+ buf_T *buf;
+{
+ return (buf->b_syn_patterns.ga_len != 0
+ || buf->b_syn_clusters.ga_len != 0
+ || curbuf->b_keywtab != NULL
+ || curbuf->b_keywtab_ic != NULL);
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+
+static enum
+{
+ EXP_SUBCMD, /* expand ":syn" sub-commands */
+ EXP_CASE /* expand ":syn case" arguments */
+} expand_what;
+
+
+/*
+ * Handle command line completion for :syntax command.
+ */
+ void
+set_context_in_syntax_cmd(xp, arg)
+ expand_T *xp;
+ char_u *arg;
+{
+ char_u *p;
+
+ /* Default: expand subcommands */
+ xp->xp_context = EXPAND_SYNTAX;
+ expand_what = EXP_SUBCMD;
+ xp->xp_pattern = arg;
+ include_link = FALSE;
+ include_default = FALSE;
+
+ /* (part of) subcommand already typed */
+ if (*arg != NUL)
+ {
+ p = skiptowhite(arg);
+ if (*p != NUL) /* past first word */
+ {
+ xp->xp_pattern = skipwhite(p);
+ if (*skiptowhite(xp->xp_pattern) != NUL)
+ xp->xp_context = EXPAND_NOTHING;
+ else if (STRNICMP(arg, "case", p - arg) == 0)
+ expand_what = EXP_CASE;
+ else if ( STRNICMP(arg, "keyword", p - arg) == 0
+ || STRNICMP(arg, "region", p - arg) == 0
+ || STRNICMP(arg, "match", p - arg) == 0
+ || STRNICMP(arg, "list", p - arg) == 0)
+ xp->xp_context = EXPAND_HIGHLIGHT;
+ else
+ xp->xp_context = EXPAND_NOTHING;
+ }
+ }
+}
+
+static char *(case_args[]) = {"match", "ignore", NULL};
+
+/*
+ * Function given to ExpandGeneric() to obtain the list syntax names for
+ * expansion.
+ */
+/*ARGSUSED*/
+ char_u *
+get_syntax_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (expand_what == EXP_SUBCMD)
+ return (char_u *)subcommands[idx].name;
+ return (char_u *)case_args[idx];
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+#if defined(FEAT_EVAL) || defined(FEAT_PRINTER) || defined(PROTO)
+/*
+ * Function called for expression evaluation: get syntax ID at file position.
+ */
+ int
+syn_get_id(lnum, col, trans)
+ long lnum;
+ long col;
+ int trans; /* remove transparancy */
+{
+ /* When the position is not after the current position and in the same
+ * line of the same buffer, need to restart parsing. */
+ if (curwin->w_buffer != syn_buf
+ || lnum != current_lnum
+ || col < (long)current_col)
+ syntax_start(curwin, lnum);
+
+ (void)get_syntax_attr((colnr_T)col);
+
+ return (trans ? current_trans_id : current_id);
+}
+#endif
+
+#if defined(FEAT_FOLDING) || defined(PROTO)
+/*
+ * Function called to get folding level for line "lnum" in window "wp".
+ */
+ int
+syn_get_foldlevel(wp, lnum)
+ win_T *wp;
+ long lnum;
+{
+ int level = 0;
+ int i;
+
+ /* Return quickly when there are no fold items at all. */
+ if (wp->w_buffer->b_syn_folditems != 0)
+ {
+ syntax_start(wp, lnum);
+
+ for (i = 0; i < current_state.ga_len; ++i)
+ if (CUR_STATE(i).si_flags & HL_FOLD)
+ ++level;
+ }
+ if (level > wp->w_p_fdn)
+ level = wp->w_p_fdn;
+ return level;
+}
+#endif
+
+#endif /* FEAT_SYN_HL */
+
+
+/**************************************
+ * Highlighting stuff *
+ **************************************/
+
+/*
+ * The default highlight groups. These are compiled-in for fast startup and
+ * they still work when the runtime files can't be found.
+ * When making changes here, also change runtime/colors/default.vim!
+ */
+static char *(highlight_init_both[]) =
+ {
+#ifdef FEAT_GUI
+ "Cursor guibg=fg guifg=bg",
+ "lCursor guibg=fg guifg=bg", /* should be different, but what? */
+#endif
+ "ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White",
+ "IncSearch term=reverse cterm=reverse gui=reverse",
+ "ModeMsg term=bold cterm=bold gui=bold",
+ "NonText term=bold ctermfg=Blue gui=bold guifg=Blue",
+ "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold",
+ "StatusLineNC term=reverse cterm=reverse gui=reverse",
+ "VertSplit term=reverse cterm=reverse gui=reverse",
+ "Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg",
+ "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold",
+ "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
+ NULL
+ };
+
+static char *(highlight_init_light[]) =
+ {
+ "Directory term=bold ctermfg=DarkBlue guifg=Blue",
+ "LineNr term=underline ctermfg=Brown guifg=Brown",
+ "MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen",
+ "Normal gui=NONE",
+ "Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen",
+ "Search term=reverse ctermbg=Yellow ctermfg=NONE guibg=Yellow guifg=NONE",
+ "SpecialKey term=bold ctermfg=DarkBlue guifg=Blue",
+ "Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta",
+ "WarningMsg term=standout ctermfg=DarkRed guifg=Red",
+ "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
+ "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue",
+ "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
+ "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
+ "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
+ "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
+ "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
+ NULL
+ };
+
+static char *(highlight_init_dark[]) =
+ {
+ "Directory term=bold ctermfg=LightCyan guifg=Cyan",
+ "LineNr term=underline ctermfg=Yellow guifg=Yellow",
+ "MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen",
+ "Normal gui=NONE",
+ "Question term=standout ctermfg=LightGreen gui=bold guifg=Green",
+ "Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
+ "SpecialKey term=bold ctermfg=LightBlue guifg=Cyan",
+ "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta",
+ "WarningMsg term=standout ctermfg=LightRed guifg=Red",
+ "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
+ "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan",
+ "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
+ "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
+ "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
+ "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
+ "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
+ NULL
+ };
+
+ void
+init_highlight(both, reset)
+ int both; /* include groups where 'bg' doesn't matter */
+ int reset; /* clear group first */
+{
+ int i;
+ char **pp;
+ static int had_both = FALSE;
+#ifdef FEAT_EVAL
+ char_u *p;
+
+ /*
+ * Try finding the color scheme file. Used when a color file was loaded
+ * and 'background' or 't_Co' is changed.
+ */
+ p = get_var_value((char_u *)"g:colors_name");
+ if (p != NULL && load_colors(p) == OK)
+ return;
+#endif
+
+ /*
+ * Didn't use a color file, use the compiled-in colors.
+ */
+ if (both)
+ {
+ had_both = TRUE;
+ pp = highlight_init_both;
+ for (i = 0; pp[i] != NULL; ++i)
+ do_highlight((char_u *)pp[i], reset, TRUE);
+ }
+ else if (!had_both)
+ /* Don't do anything before the call with both == TRUE from main().
+ * Not everything has been setup then, and that call will overrule
+ * everything anyway. */
+ return;
+
+ if (*p_bg == 'l')
+ pp = highlight_init_light;
+ else
+ pp = highlight_init_dark;
+ for (i = 0; pp[i] != NULL; ++i)
+ do_highlight((char_u *)pp[i], reset, TRUE);
+
+#ifdef FEAT_SYN_HL
+ /*
+ * If syntax highlighting is enabled load the highlighting for it.
+ */
+ if (get_var_value((char_u *)"g:syntax_on") != NULL)
+ (void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
+#endif
+}
+
+/*
+ * Load color file "p".
+ * Return OK for success, FAIL for failure.
+ */
+ int
+load_colors(p)
+ char_u *p;
+{
+ char_u *buf;
+ int retval = FAIL;
+ static int recursive = FALSE;
+
+ /* When being called recursively, this is probably because setting
+ * 'background' caused the highlighting to be reloaded. This means it is
+ * working, thus we should return OK. */
+ if (recursive)
+ return OK;
+
+ recursive = TRUE;
+ buf = alloc((unsigned)(STRLEN(p) + 12));
+ if (buf != NULL)
+ {
+ sprintf((char *)buf, "colors/%s.vim", p);
+ retval = cmd_runtime(buf, FALSE);
+ vim_free(buf);
+ }
+ recursive = FALSE;
+
+ return retval;
+}
+
+/*
+ * Handle the ":highlight .." command.
+ * When using ":hi clear" this is called recursively for each group with
+ * "forceit" and "init" both TRUE.
+ */
+ void
+do_highlight(line, forceit, init)
+ char_u *line;
+ int forceit;
+ int init; /* TRUE when called for initializing */
+{
+ char_u *name_end;
+ char_u *p;
+ char_u *linep;
+ char_u *key_start;
+ char_u *arg_start;
+ char_u *key = NULL, *arg = NULL;
+ long i;
+ int off;
+ int len;
+ int attr;
+ int id;
+ int idx;
+ int dodefault = FALSE;
+ int doclear = FALSE;
+ int dolink = FALSE;
+ int error = FALSE;
+ int color;
+ int is_normal_group = FALSE; /* "Normal" group */
+#ifdef FEAT_GUI_X11
+ int is_menu_group = FALSE; /* "Menu" group */
+ int is_scrollbar_group = FALSE; /* "Scrollbar" group */
+ int is_tooltip_group = FALSE; /* "Tooltip" group */
+ int do_colors = FALSE; /* need to update colors? */
+#else
+# define is_menu_group 0
+# define is_tooltip_group 0
+#endif
+
+ /*
+ * If no argument, list current highlighting.
+ */
+ if (ends_excmd(*line))
+ {
+ for (i = 1; i <= highlight_ga.ga_len && !got_int; ++i)
+ /* TODO: only call when the group has attributes set */
+ highlight_list_one((int)i);
+ return;
+ }
+
+ /*
+ * Isolate the name.
+ */
+ name_end = skiptowhite(line);
+ linep = skipwhite(name_end);
+
+ /*
+ * Check for "default" argument.
+ */
+ if (STRNCMP(line, "default", name_end - line) == 0)
+ {
+ dodefault = TRUE;
+ line = linep;
+ name_end = skiptowhite(line);
+ linep = skipwhite(name_end);
+ }
+
+ /*
+ * Check for "clear" or "link" argument.
+ */
+ if (STRNCMP(line, "clear", name_end - line) == 0)
+ doclear = TRUE;
+ if (STRNCMP(line, "link", name_end - line) == 0)
+ dolink = TRUE;
+
+ /*
+ * ":highlight {group-name}": list highlighting for one group.
+ */
+ if (!doclear && !dolink && ends_excmd(*linep))
+ {
+ id = syn_namen2id(line, (int)(name_end - line));
+ if (id == 0)
+ EMSG2(_("E411: highlight group not found: %s"), line);
+ else
+ highlight_list_one(id);
+ return;
+ }
+
+ /*
+ * Handle ":highlight link {from} {to}" command.
+ */
+ if (dolink)
+ {
+ char_u *from_start = linep;
+ char_u *from_end;
+ char_u *to_start;
+ char_u *to_end;
+ int from_id;
+ int to_id;
+
+ from_end = skiptowhite(from_start);
+ to_start = skipwhite(from_end);
+ to_end = skiptowhite(to_start);
+
+ if (ends_excmd(*from_start) || ends_excmd(*to_start))
+ {
+ EMSG2(_("E412: Not enough arguments: \":highlight link %s\""),
+ from_start);
+ return;
+ }
+
+ if (!ends_excmd(*skipwhite(to_end)))
+ {
+ EMSG2(_("E413: Too many arguments: \":highlight link %s\""), from_start);
+ return;
+ }
+
+ from_id = syn_check_group(from_start, (int)(from_end - from_start));
+ if (STRNCMP(to_start, "NONE", 4) == 0)
+ to_id = 0;
+ else
+ to_id = syn_check_group(to_start, (int)(to_end - to_start));
+
+ if (from_id > 0 && (!init || HL_TABLE()[from_id - 1].sg_set == 0))
+ {
+ /*
+ * Don't allow a link when there already is some highlighting
+ * for the group, unless '!' is used
+ */
+ if (to_id > 0 && !forceit && !init
+ && hl_has_settings(from_id - 1, dodefault))
+ {
+ if (sourcing_name == NULL && !dodefault)
+ EMSG(_("E414: group has settings, highlight link ignored"));
+ }
+ else
+ {
+ if (!init)
+ HL_TABLE()[from_id - 1].sg_set |= SG_LINK;
+ HL_TABLE()[from_id - 1].sg_link = to_id;
+ redraw_all_later(NOT_VALID);
+ }
+ }
+
+ /* Only call highlight_changed() once, after sourcing a syntax file */
+ need_highlight_changed = TRUE;
+
+ return;
+ }
+
+ if (doclear)
+ {
+ /*
+ * ":highlight clear [group]" command.
+ */
+ line = linep;
+ if (ends_excmd(*line))
+ {
+#ifdef FEAT_GUI
+ /* First, we do not destroy the old values, but allocate the new
+ * ones and update the display. THEN we destroy the old values.
+ * If we destroy the old values first, then the old values
+ * (such as GuiFont's or GuiFontset's) will still be displayed but
+ * invalid because they were free'd.
+ */
+ if (gui.in_use)
+ {
+# ifdef FEAT_BEVAL_TIP
+ gui_init_tooltip_font();
+# endif
+# if defined(FEAT_MENU) && (defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF))
+ gui_init_menu_font();
+# endif
+ }
+# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_X11)
+ gui_mch_def_colors();
+# endif
+# ifdef FEAT_GUI_X11
+# ifdef FEAT_MENU
+
+ /* This only needs to be done when there is no Menu highlight
+ * group defined by default, which IS currently the case.
+ */
+ gui_mch_new_menu_colors();
+# endif
+ if (gui.in_use)
+ {
+ gui_new_scrollbar_colors();
+# ifdef FEAT_BEVAL
+ gui_mch_new_tooltip_colors();
+# endif
+# ifdef FEAT_MENU
+ gui_mch_new_menu_font();
+# endif
+ }
+# endif
+
+ /* Ok, we're done allocating the new default graphics items.
+ * The screen should already be refreshed at this point.
+ * It is now Ok to clear out the old data.
+ */
+#endif
+#ifdef FEAT_EVAL
+ do_unlet((char_u *)"colors_name");
+#endif
+ restore_cterm_colors();
+
+ /*
+ * Clear all default highlight groups and load the defaults.
+ */
+ for (idx = 0; idx < highlight_ga.ga_len; ++idx)
+ highlight_clear(idx);
+ init_highlight(TRUE, TRUE);
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ highlight_gui_started();
+#endif
+ highlight_changed();
+ redraw_later_clear();
+ return;
+ }
+ name_end = skiptowhite(line);
+ linep = skipwhite(name_end);
+ }
+
+ /*
+ * Find the group name in the table. If it does not exist yet, add it.
+ */
+ id = syn_check_group(line, (int)(name_end - line));
+ if (id == 0) /* failed (out of memory) */
+ return;
+ idx = id - 1; /* index is ID minus one */
+
+ /* Return if "default" was used and the group already has settings. */
+ if (dodefault && hl_has_settings(idx, TRUE))
+ return;
+
+ if (STRCMP(HL_TABLE()[idx].sg_name_u, "NORMAL") == 0)
+ is_normal_group = TRUE;
+#ifdef FEAT_GUI_X11
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "MENU") == 0)
+ is_menu_group = TRUE;
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "SCROLLBAR") == 0)
+ is_scrollbar_group = TRUE;
+ else if (STRCMP(HL_TABLE()[idx].sg_name_u, "TOOLTIP") == 0)
+ is_tooltip_group = TRUE;
+#endif
+
+ /* Clear the highlighting for ":hi clear {group}" and ":hi clear". */
+ if (doclear || (forceit && init))
+ {
+ highlight_clear(idx);
+ if (!doclear)
+ HL_TABLE()[idx].sg_set = 0;
+ }
+
+ if (!doclear)
+ while (!ends_excmd(*linep))
+ {
+ key_start = linep;
+ if (*linep == '=')
+ {
+ EMSG2(_("E415: unexpected equal sign: %s"), key_start);
+ error = TRUE;
+ break;
+ }
+
+ /*
+ * Isolate the key ("term", "ctermfg", "ctermbg", "font", "guifg" or
+ * "guibg").
+ */
+ while (*linep && !vim_iswhite(*linep) && *linep != '=')
+ ++linep;
+ vim_free(key);
+ key = vim_strnsave_up(key_start, (int)(linep - key_start));
+ if (key == NULL)
+ {
+ error = TRUE;
+ break;
+ }
+ linep = skipwhite(linep);
+
+ if (STRCMP(key, "NONE") == 0)
+ {
+ if (!init || HL_TABLE()[idx].sg_set == 0)
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_TERM+SG_CTERM+SG_GUI;
+ highlight_clear(idx);
+ }
+ continue;
+ }
+
+ /*
+ * Check for the equal sign.
+ */
+ if (*linep != '=')
+ {
+ EMSG2(_("E416: missing equal sign: %s"), key_start);
+ error = TRUE;
+ break;
+ }
+ ++linep;
+
+ /*
+ * Isolate the argument.
+ */
+ linep = skipwhite(linep);
+ if (*linep == '\'') /* guifg='color name' */
+ {
+ arg_start = ++linep;
+ linep = vim_strchr(linep, '\'');
+ if (linep == NULL)
+ {
+ EMSG2(_(e_invarg2), key_start);
+ error = TRUE;
+ break;
+ }
+ }
+ else
+ {
+ arg_start = linep;
+ linep = skiptowhite(linep);
+ }
+ if (linep == arg_start)
+ {
+ EMSG2(_("E417: missing argument: %s"), key_start);
+ error = TRUE;
+ break;
+ }
+ vim_free(arg);
+ arg = vim_strnsave(arg_start, (int)(linep - arg_start));
+ if (arg == NULL)
+ {
+ error = TRUE;
+ break;
+ }
+ if (*linep == '\'')
+ ++linep;
+
+ /*
+ * Store the argument.
+ */
+ if ( STRCMP(key, "TERM") == 0
+ || STRCMP(key, "CTERM") == 0
+ || STRCMP(key, "GUI") == 0)
+ {
+ attr = 0;
+ off = 0;
+ while (arg[off] != NUL)
+ {
+ for (i = sizeof(hl_attr_table) / sizeof(int); --i >= 0; )
+ {
+ len = (int)STRLEN(hl_name_table[i]);
+ if (STRNICMP(arg + off, hl_name_table[i], len) == 0)
+ {
+ attr |= hl_attr_table[i];
+ off += len;
+ break;
+ }
+ }
+ if (i < 0)
+ {
+ EMSG2(_("E418: Illegal value: %s"), arg);
+ error = TRUE;
+ break;
+ }
+ if (arg[off] == ',') /* another one follows */
+ ++off;
+ }
+ if (error)
+ break;
+ if (*key == 'T')
+ {
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_TERM))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_TERM;
+ HL_TABLE()[idx].sg_term = attr;
+ }
+ }
+ else if (*key == 'C')
+ {
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_CTERM))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_CTERM;
+ HL_TABLE()[idx].sg_cterm = attr;
+ HL_TABLE()[idx].sg_cterm_bold = FALSE;
+ }
+ }
+#ifdef FEAT_GUI
+ else
+ {
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_GUI;
+ HL_TABLE()[idx].sg_gui = attr;
+ }
+ }
+#endif
+ }
+ else if (STRCMP(key, "FONT") == 0)
+ {
+ /* in non-GUI fonts are simply ignored */
+#ifdef FEAT_GUI
+ if (!gui.shell_created)
+ {
+ /* GUI not started yet, always accept the name. */
+ vim_free(HL_TABLE()[idx].sg_font_name);
+ HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ }
+ else
+ {
+ GuiFont temp_sg_font = HL_TABLE()[idx].sg_font;
+# ifdef FEAT_XFONTSET
+ GuiFontset temp_sg_fontset = HL_TABLE()[idx].sg_fontset;
+# endif
+ /* First, save the current font/fontset.
+ * Then try to allocate the font/fontset.
+ * If the allocation fails, HL_TABLE()[idx].sg_font OR
+ * sg_fontset will be set to NOFONT or NOFONTSET respectively.
+ */
+
+ HL_TABLE()[idx].sg_font = NOFONT;
+# ifdef FEAT_XFONTSET
+ HL_TABLE()[idx].sg_fontset = NOFONTSET;
+# endif
+ hl_do_font(idx, arg, is_normal_group, is_menu_group,
+ is_tooltip_group);
+
+# ifdef FEAT_XFONTSET
+ if (HL_TABLE()[idx].sg_fontset != NOFONTSET)
+ {
+ /* New fontset was accepted. Free the old one, if there was
+ * one.
+ */
+ gui_mch_free_fontset(temp_sg_fontset);
+ vim_free(HL_TABLE()[idx].sg_font_name);
+ HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ }
+ else
+ HL_TABLE()[idx].sg_fontset = temp_sg_fontset;
+# endif
+ if (HL_TABLE()[idx].sg_font != NOFONT)
+ {
+ /* New font was accepted. Free the old one, if there was
+ * one.
+ */
+ gui_mch_free_font(temp_sg_font);
+ vim_free(HL_TABLE()[idx].sg_font_name);
+ HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ }
+ else
+ HL_TABLE()[idx].sg_font = temp_sg_font;
+ }
+#endif
+ }
+ else if (STRCMP(key, "CTERMFG") == 0 || STRCMP(key, "CTERMBG") == 0)
+ {
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_CTERM))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_CTERM;
+
+ /* When setting the foreground color, and previously the "bold"
+ * flag was set for a light color, reset it now */
+ if (key[5] == 'F' && HL_TABLE()[idx].sg_cterm_bold)
+ {
+ HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
+ HL_TABLE()[idx].sg_cterm_bold = FALSE;
+ }
+
+ if (VIM_ISDIGIT(*arg))
+ color = atoi((char *)arg);
+ else if (STRICMP(arg, "fg") == 0)
+ {
+ if (cterm_normal_fg_color)
+ color = cterm_normal_fg_color - 1;
+ else
+ {
+ EMSG(_("E419: FG color unknown"));
+ error = TRUE;
+ break;
+ }
+ }
+ else if (STRICMP(arg, "bg") == 0)
+ {
+ if (cterm_normal_bg_color > 0)
+ color = cterm_normal_bg_color - 1;
+ else
+ {
+ EMSG(_("E420: BG color unknown"));
+ error = TRUE;
+ break;
+ }
+ }
+ else
+ {
+ static char *(color_names[28]) = {
+ "Black", "DarkBlue", "DarkGreen", "DarkCyan",
+ "DarkRed", "DarkMagenta", "Brown", "DarkYellow",
+ "Gray", "Grey",
+ "LightGray", "LightGrey", "DarkGray", "DarkGrey",
+ "Blue", "LightBlue", "Green", "LightGreen",
+ "Cyan", "LightCyan", "Red", "LightRed", "Magenta",
+ "LightMagenta", "Yellow", "LightYellow", "White", "NONE"};
+ static int color_numbers_16[28] = {0, 1, 2, 3,
+ 4, 5, 6, 6,
+ 7, 7,
+ 7, 7, 8, 8,
+ 9, 9, 10, 10,
+ 11, 11, 12, 12, 13,
+ 13, 14, 14, 15, -1};
+ /* for xterm with 88 colors... */
+ static int color_numbers_88[28] = {0, 4, 2, 6,
+ 1, 5, 32, 72,
+ 84, 84,
+ 7, 7, 82, 82,
+ 12, 43, 10, 61,
+ 14, 63, 9, 74, 13,
+ 75, 11, 78, 15, -1};
+ /* for xterm with 256 colors... */
+ static int color_numbers_256[28] = {0, 4, 2, 6,
+ 1, 5, 130, 130,
+ 248, 248,
+ 7, 7, 242, 242,
+ 12, 81, 10, 121,
+ 14, 159, 9, 224, 13,
+ 225, 11, 229, 15, -1};
+ /* for terminals with less than 16 colors... */
+ static int color_numbers_8[28] = {0, 4, 2, 6,
+ 1, 5, 3, 3,
+ 7, 7,
+ 7, 7, 0+8, 0+8,
+ 4+8, 4+8, 2+8, 2+8,
+ 6+8, 6+8, 1+8, 1+8, 5+8,
+ 5+8, 3+8, 3+8, 7+8, -1};
+#if defined(__QNXNTO__)
+ static int *color_numbers_8_qansi = color_numbers_8;
+ /* On qnx, the 8 & 16 color arrays are the same */
+ if (STRNCMP(T_NAME, "qansi", 5) == 0)
+ color_numbers_8_qansi = color_numbers_16;
+#endif
+
+ /* reduce calls to STRICMP a bit, it can be slow */
+ off = TOUPPER_ASC(*arg);
+ for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; )
+ if (off == color_names[i][0]
+ && STRICMP(arg + 1, color_names[i] + 1) == 0)
+ break;
+ if (i < 0)
+ {
+ EMSG2(_("E421: Color name or number not recognized: %s"), key_start);
+ error = TRUE;
+ break;
+ }
+
+ /* Use the _16 table to check if its a valid color name. */
+ color = color_numbers_16[i];
+ if (color >= 0)
+ {
+ if (t_colors == 8)
+ {
+ /* t_Co is 8: use the 8 colors table */
+#if defined(__QNXNTO__)
+ color = color_numbers_8_qansi[i];
+#else
+ color = color_numbers_8[i];
+#endif
+ if (key[5] == 'F')
+ {
+ /* set/reset bold attribute to get light foreground
+ * colors (on some terminals, e.g. "linux") */
+ if (color & 8)
+ {
+ HL_TABLE()[idx].sg_cterm |= HL_BOLD;
+ HL_TABLE()[idx].sg_cterm_bold = TRUE;
+ }
+ else
+ HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
+ }
+ color &= 7; /* truncate to 8 colors */
+ }
+ else if (t_colors == 16 || t_colors == 88
+ || t_colors == 256)
+ {
+ /*
+ * Guess: if the termcap entry ends in 'm', it is
+ * probably an xterm-like terminal. Use the changed
+ * order for colors.
+ */
+ if (*T_CAF != NUL)
+ p = T_CAF;
+ else
+ p = T_CSF;
+ if (*p != NUL && *(p + STRLEN(p) - 1) == 'm')
+ switch (t_colors)
+ {
+ case 16:
+ color = color_numbers_8[i];
+ break;
+ case 88:
+ color = color_numbers_88[i];
+ break;
+ case 256:
+ color = color_numbers_256[i];
+ break;
+ }
+ }
+ }
+ }
+ /* Add one to the argument, to avoid zero */
+ if (key[5] == 'F')
+ {
+ HL_TABLE()[idx].sg_cterm_fg = color + 1;
+ if (is_normal_group)
+ {
+ cterm_normal_fg_color = color + 1;
+ cterm_normal_fg_bold = (HL_TABLE()[idx].sg_cterm & HL_BOLD);
+#ifdef FEAT_GUI
+ /* Don't do this if the GUI is used. */
+ if (!gui.in_use && !gui.starting)
+#endif
+ {
+ must_redraw = CLEAR;
+ if (termcap_active)
+ term_fg_color(color);
+ }
+ }
+ }
+ else
+ {
+ HL_TABLE()[idx].sg_cterm_bg = color + 1;
+ if (is_normal_group)
+ {
+ cterm_normal_bg_color = color + 1;
+#ifdef FEAT_GUI
+ /* Don't mess with 'background' if the GUI is used. */
+ if (!gui.in_use && !gui.starting)
+#endif
+ {
+ must_redraw = CLEAR;
+ if (termcap_active)
+ term_bg_color(color);
+ if (t_colors < 16)
+ i = (color == 0 || color == 4);
+ else
+ i = (color < 7 || color == 8);
+ /* Set the 'background' option if the value is wrong. */
+ if (i != (*p_bg == 'd'))
+ set_option_value((char_u *)"bg", 0L,
+ i ? (char_u *)"dark" : (char_u *)"light", 0);
+ }
+ }
+ }
+ }
+ }
+ else if (STRCMP(key, "GUIFG") == 0)
+ {
+#ifdef FEAT_GUI /* in non-GUI guifg colors are simply ignored */
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_GUI;
+
+ i = color_name2handle(arg);
+ if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !gui.in_use)
+ {
+ HL_TABLE()[idx].sg_gui_fg = i;
+ vim_free(HL_TABLE()[idx].sg_gui_fg_name);
+ if (STRCMP(arg, "NONE"))
+ HL_TABLE()[idx].sg_gui_fg_name = vim_strsave(arg);
+ else
+ HL_TABLE()[idx].sg_gui_fg_name = NULL;
+# ifdef FEAT_GUI_X11
+ if (is_menu_group)
+ gui.menu_fg_pixel = i;
+ if (is_scrollbar_group)
+ gui.scroll_fg_pixel = i;
+# ifdef FEAT_BEVAL
+ if (is_tooltip_group)
+ gui.tooltip_fg_pixel = i;
+# endif
+ do_colors = TRUE;
+# endif
+ }
+ }
+#endif
+ }
+ else if (STRCMP(key, "GUIBG") == 0)
+ {
+#ifdef FEAT_GUI /* in non-GUI guibg colors are simply ignored */
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_GUI))
+ {
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_GUI;
+
+ i = color_name2handle(arg);
+ if (i != INVALCOLOR || STRCMP(arg, "NONE") == 0 || !gui.in_use)
+ {
+ HL_TABLE()[idx].sg_gui_bg = i;
+ vim_free(HL_TABLE()[idx].sg_gui_bg_name);
+ if (STRCMP(arg, "NONE"))
+ HL_TABLE()[idx].sg_gui_bg_name = vim_strsave(arg);
+ else
+ HL_TABLE()[idx].sg_gui_bg_name = NULL;
+# ifdef FEAT_GUI_X11
+ if (is_menu_group)
+ gui.menu_bg_pixel = i;
+ if (is_scrollbar_group)
+ gui.scroll_bg_pixel = i;
+# ifdef FEAT_BEVAL
+ if (is_tooltip_group)
+ gui.tooltip_bg_pixel = i;
+# endif
+ do_colors = TRUE;
+# endif
+ }
+ }
+#endif
+ }
+ else if (STRCMP(key, "START") == 0 || STRCMP(key, "STOP") == 0)
+ {
+ char_u buf[100];
+ char_u *tname;
+
+ if (!init)
+ HL_TABLE()[idx].sg_set |= SG_TERM;
+
+ /*
+ * The "start" and "stop" arguments can be a literal escape
+ * sequence, or a comma seperated list of terminal codes.
+ */
+ if (STRNCMP(arg, "t_", 2) == 0)
+ {
+ off = 0;
+ buf[0] = 0;
+ while (arg[off] != NUL)
+ {
+ /* Isolate one termcap name */
+ for (len = 0; arg[off + len] &&
+ arg[off + len] != ','; ++len)
+ ;
+ tname = vim_strnsave(arg + off, len);
+ if (tname == NULL) /* out of memory */
+ {
+ error = TRUE;
+ break;
+ }
+ /* lookup the escape sequence for the item */
+ p = get_term_code(tname);
+ vim_free(tname);
+ if (p == NULL) /* ignore non-existing things */
+ p = (char_u *)"";
+
+ /* Append it to the already found stuff */
+ if ((int)(STRLEN(buf) + STRLEN(p)) >= 99)
+ {
+ EMSG2(_("E422: terminal code too long: %s"), arg);
+ error = TRUE;
+ break;
+ }
+ STRCAT(buf, p);
+
+ /* Advance to the next item */
+ off += len;
+ if (arg[off] == ',') /* another one follows */
+ ++off;
+ }
+ }
+ else
+ {
+ /*
+ * Copy characters from arg[] to buf[], translating <> codes.
+ */
+ for (p = arg, off = 0; off < 100 && *p; )
+ {
+ len = trans_special(&p, buf + off, FALSE);
+ if (len) /* recognized special char */
+ off += len;
+ else /* copy as normal char */
+ buf[off++] = *p++;
+ }
+ buf[off] = NUL;
+ }
+ if (error)
+ break;
+
+ if (STRCMP(buf, "NONE") == 0) /* resetting the value */
+ p = NULL;
+ else
+ p = vim_strsave(buf);
+ if (key[2] == 'A')
+ {
+ vim_free(HL_TABLE()[idx].sg_start);
+ HL_TABLE()[idx].sg_start = p;
+ }
+ else
+ {
+ vim_free(HL_TABLE()[idx].sg_stop);
+ HL_TABLE()[idx].sg_stop = p;
+ }
+ }
+ else
+ {
+ EMSG2(_("E423: Illegal argument: %s"), key_start);
+ error = TRUE;
+ break;
+ }
+
+ /*
+ * When highlighting has been given for a group, don't link it.
+ */
+ if (!init || !(HL_TABLE()[idx].sg_set & SG_LINK))
+ HL_TABLE()[idx].sg_link = 0;
+
+ /*
+ * Continue with next argument.
+ */
+ linep = skipwhite(linep);
+ }
+
+ /*
+ * If there is an error, and it's a new entry, remove it from the table.
+ */
+ if (error && idx == highlight_ga.ga_len)
+ syn_unadd_group();
+ else
+ {
+ if (is_normal_group)
+ {
+ HL_TABLE()[idx].sg_term_attr = 0;
+ HL_TABLE()[idx].sg_cterm_attr = 0;
+#ifdef FEAT_GUI
+ HL_TABLE()[idx].sg_gui_attr = 0;
+ /*
+ * Need to update all groups, because they might be using "bg"
+ * and/or "fg", which have been changed now.
+ */
+ if (gui.in_use)
+ highlight_gui_started();
+#endif
+ }
+#ifdef FEAT_GUI_X11
+# ifdef FEAT_MENU
+ else if (is_menu_group)
+ {
+ if (gui.in_use && do_colors)
+ gui_mch_new_menu_colors();
+ }
+# endif
+ else if (is_scrollbar_group)
+ {
+ if (gui.in_use && do_colors)
+ gui_new_scrollbar_colors();
+ }
+# ifdef FEAT_BEVAL
+ else if (is_tooltip_group)
+ {
+ if (gui.in_use && do_colors)
+ gui_mch_new_tooltip_colors();
+ }
+# endif
+#endif
+ else
+ set_hl_attr(idx);
+ redraw_all_later(NOT_VALID);
+ }
+ vim_free(key);
+ vim_free(arg);
+
+ /* Only call highlight_changed() once, after sourcing a syntax file */
+ need_highlight_changed = TRUE;
+}
+
+/*
+ * Reset the cterm colors to what they were before Vim was started, if
+ * possible. Otherwise reset them to zero.
+ */
+ void
+restore_cterm_colors()
+{
+#if defined(MSDOS) || (defined(WIN3264) && !defined(FEAT_GUI_W32))
+ /* Since t_me has been set, this probably means that the user
+ * wants to use this as default colors. Need to reset default
+ * background/foreground colors. */
+ mch_set_normal_colors();
+#else
+ cterm_normal_fg_color = 0;
+ cterm_normal_fg_bold = 0;
+ cterm_normal_bg_color = 0;
+#endif
+}
+
+/*
+ * Return TRUE if highlight group "idx" has any settings.
+ * When "check_link" is TRUE also check for an existing link.
+ */
+ static int
+hl_has_settings(idx, check_link)
+ int idx;
+ int check_link;
+{
+ return ( HL_TABLE()[idx].sg_term_attr != 0
+ || HL_TABLE()[idx].sg_cterm_attr != 0
+#ifdef FEAT_GUI
+ || HL_TABLE()[idx].sg_gui_attr != 0
+#endif
+ || (check_link && (HL_TABLE()[idx].sg_set & SG_LINK)));
+}
+
+/*
+ * Clear highlighting for one group.
+ */
+ static void
+highlight_clear(idx)
+ int idx;
+{
+ HL_TABLE()[idx].sg_term = 0;
+ vim_free(HL_TABLE()[idx].sg_start);
+ HL_TABLE()[idx].sg_start = NULL;
+ vim_free(HL_TABLE()[idx].sg_stop);
+ HL_TABLE()[idx].sg_stop = NULL;
+ HL_TABLE()[idx].sg_term_attr = 0;
+ HL_TABLE()[idx].sg_cterm = 0;
+ HL_TABLE()[idx].sg_cterm_bold = FALSE;
+ HL_TABLE()[idx].sg_cterm_fg = 0;
+ HL_TABLE()[idx].sg_cterm_bg = 0;
+ HL_TABLE()[idx].sg_cterm_attr = 0;
+#ifdef FEAT_GUI /* in non-GUI fonts are simply ignored */
+ HL_TABLE()[idx].sg_gui = 0;
+ HL_TABLE()[idx].sg_gui_fg = INVALCOLOR;
+ vim_free(HL_TABLE()[idx].sg_gui_fg_name);
+ HL_TABLE()[idx].sg_gui_fg_name = NULL;
+ HL_TABLE()[idx].sg_gui_bg = INVALCOLOR;
+ vim_free(HL_TABLE()[idx].sg_gui_bg_name);
+ HL_TABLE()[idx].sg_gui_bg_name = NULL;
+ gui_mch_free_font(HL_TABLE()[idx].sg_font);
+ HL_TABLE()[idx].sg_font = NOFONT;
+# ifdef FEAT_XFONTSET
+ gui_mch_free_fontset(HL_TABLE()[idx].sg_fontset);
+ HL_TABLE()[idx].sg_fontset = NOFONTSET;
+# endif
+ vim_free(HL_TABLE()[idx].sg_font_name);
+ HL_TABLE()[idx].sg_font_name = NULL;
+ HL_TABLE()[idx].sg_gui_attr = 0;
+#endif
+}
+
+#if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Set the normal foreground and background colors according to the "Normal"
+ * highlighighting group. For X11 also set "Menu", "Scrollbar", and
+ * "Tooltip" colors.
+ */
+ void
+set_normal_colors()
+{
+ if (set_group_colors((char_u *)"Normal",
+ &gui.norm_pixel, &gui.back_pixel, FALSE, TRUE,
+ FALSE))
+ {
+ gui_mch_new_colors();
+ must_redraw = CLEAR;
+ }
+#ifdef FEAT_GUI_X11
+ if (set_group_colors((char_u *)"Menu",
+ &gui.menu_fg_pixel, &gui.menu_bg_pixel, TRUE, FALSE,
+ FALSE))
+ {
+# ifdef FEAT_MENU
+ gui_mch_new_menu_colors();
+# endif
+ must_redraw = CLEAR;
+ }
+# ifdef FEAT_BEVAL
+ if (set_group_colors((char_u *)"Tooltip",
+ &gui.tooltip_fg_pixel, &gui.tooltip_bg_pixel,
+ FALSE, FALSE, TRUE))
+ {
+# ifdef FEAT_TOOLBAR
+ gui_mch_new_tooltip_colors();
+# endif
+ must_redraw = CLEAR;
+ }
+#endif
+ if (set_group_colors((char_u *)"Scrollbar",
+ &gui.scroll_fg_pixel, &gui.scroll_bg_pixel, FALSE, FALSE,
+ FALSE))
+ {
+ gui_new_scrollbar_colors();
+ must_redraw = CLEAR;
+ }
+#endif
+}
+
+/*
+ * Set the colors for "Normal", "Menu", "Tooltip" or "Scrollbar".
+ */
+ static int
+set_group_colors(name, fgp, bgp, do_menu, use_norm, do_tooltip)
+ char_u *name;
+ guicolor_T *fgp;
+ guicolor_T *bgp;
+ int do_menu;
+ int use_norm;
+ int do_tooltip;
+{
+ int idx;
+
+ idx = syn_name2id(name) - 1;
+ if (idx >= 0)
+ {
+ gui_do_one_color(idx, do_menu, do_tooltip);
+
+ if (HL_TABLE()[idx].sg_gui_fg != INVALCOLOR)
+ *fgp = HL_TABLE()[idx].sg_gui_fg;
+ else if (use_norm)
+ *fgp = gui.def_norm_pixel;
+ if (HL_TABLE()[idx].sg_gui_bg != INVALCOLOR)
+ *bgp = HL_TABLE()[idx].sg_gui_bg;
+ else if (use_norm)
+ *bgp = gui.def_back_pixel;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Get the font of the "Normal" group.
+ * Returns "" when it's not found or not set.
+ */
+ char_u *
+hl_get_font_name()
+{
+ int id;
+ char_u *s;
+
+ id = syn_name2id((char_u *)"Normal");
+ if (id > 0)
+ {
+ s = HL_TABLE()[id - 1].sg_font_name;
+ if (s != NULL)
+ return s;
+ }
+ return (char_u *)"";
+}
+
+/*
+ * Set font for "Normal" group. Called by gui_mch_init_font() when a font has
+ * actually chosen to be used.
+ */
+ void
+hl_set_font_name(font_name)
+ char_u *font_name;
+{
+ int id;
+
+ id = syn_name2id((char_u *)"Normal");
+ if (id > 0)
+ {
+ vim_free(HL_TABLE()[id - 1].sg_font_name);
+ HL_TABLE()[id - 1].sg_font_name = vim_strsave(font_name);
+ }
+}
+
+/*
+ * Set background color for "Normal" group. Called by gui_set_bg_color()
+ * when the color is known.
+ */
+ void
+hl_set_bg_color_name(name)
+ char_u *name; /* must have been allocated */
+{
+ int id;
+
+ if (name != NULL)
+ {
+ id = syn_name2id((char_u *)"Normal");
+ if (id > 0)
+ {
+ vim_free(HL_TABLE()[id - 1].sg_gui_bg_name);
+ HL_TABLE()[id - 1].sg_gui_bg_name = name;
+ }
+ }
+}
+
+/*
+ * Set foreground color for "Normal" group. Called by gui_set_fg_color()
+ * when the color is known.
+ */
+ void
+hl_set_fg_color_name(name)
+ char_u *name; /* must have been allocated */
+{
+ int id;
+
+ if (name != NULL)
+ {
+ id = syn_name2id((char_u *)"Normal");
+ if (id > 0)
+ {
+ vim_free(HL_TABLE()[id - 1].sg_gui_fg_name);
+ HL_TABLE()[id - 1].sg_gui_fg_name = name;
+ }
+ }
+}
+
+/*
+ * Return the handle for a color name.
+ * Returns INVALCOLOR when failed.
+ */
+ static guicolor_T
+color_name2handle(name)
+ char_u *name;
+{
+ if (STRCMP(name, "NONE") == 0)
+ return INVALCOLOR;
+
+ if (STRICMP(name, "fg") == 0 || STRICMP(name, "foreground") == 0)
+ return gui.norm_pixel;
+ if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0)
+ return gui.back_pixel;
+
+ return gui_get_color(name);
+}
+
+/*
+ * Return the handle for a font name.
+ * Returns NOFONT when failed.
+ */
+ static GuiFont
+font_name2handle(name)
+ char_u *name;
+{
+ if (STRCMP(name, "NONE") == 0)
+ return NOFONT;
+
+ return gui_mch_get_font(name, TRUE);
+}
+
+# ifdef FEAT_XFONTSET
+/*
+ * Return the handle for a fontset name.
+ * Returns NOFONTSET when failed.
+ */
+ static GuiFontset
+fontset_name2handle(name, fixed_width)
+ char_u *name;
+ int fixed_width;
+{
+ if (STRCMP(name, "NONE") == 0)
+ return NOFONTSET;
+
+ return gui_mch_get_fontset(name, TRUE, fixed_width);
+}
+# endif
+
+/*
+ * Get the font or fontset for one highlight group.
+ */
+/*ARGSUSED*/
+ static void
+hl_do_font(idx, arg, do_normal, do_menu, do_tooltip)
+ int idx;
+ char_u *arg;
+ int do_normal; /* set normal font */
+ int do_menu; /* set menu font */
+ int do_tooltip; /* set tooltip font */
+{
+# ifdef FEAT_XFONTSET
+ /* If 'guifontset' is not empty, first try using the name as a
+ * fontset. If that doesn't work, use it as a font name. */
+ if (*p_guifontset != NUL
+# ifdef FONTSET_ALWAYS
+ || do_menu
+# endif
+# ifdef FEAT_BEVAL_TIP
+ /* In Athena & Motif, the Tooltip highlight group is always a fontset */
+ || do_tooltip
+# endif
+ )
+ HL_TABLE()[idx].sg_fontset = fontset_name2handle(arg, 0
+# ifdef FONTSET_ALWAYS
+ || do_menu
+# endif
+# ifdef FEAT_BEVAL_TIP
+ || do_tooltip
+# endif
+ );
+ if (HL_TABLE()[idx].sg_fontset != NOFONTSET)
+ {
+ /* If it worked and it's the Normal group, use it as the
+ * normal fontset. Same for the Menu group. */
+ if (do_normal)
+ gui_init_font(arg, TRUE);
+# if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
+ if (do_menu)
+ {
+# ifdef FONTSET_ALWAYS
+ gui.menu_fontset = HL_TABLE()[idx].sg_fontset;
+# else
+ /* YIKES! This is a bug waiting to crash the program */
+ gui.menu_font = HL_TABLE()[idx].sg_fontset;
+# endif
+ gui_mch_new_menu_font();
+ }
+# ifdef FEAT_BEVAL
+ if (do_tooltip)
+ {
+ /* The Athena widget set cannot currently handle switching between
+ * displaying a single font and a fontset.
+ * If the XtNinternational resource is set to True at widget
+ * creation, then a fontset is always used, othwise an
+ * XFontStruct is used.
+ */
+ gui.tooltip_fontset = (XFontSet)HL_TABLE()[idx].sg_fontset;
+ gui_mch_new_tooltip_font();
+ }
+# endif
+# endif
+ }
+ else
+# endif
+ {
+ HL_TABLE()[idx].sg_font = font_name2handle(arg);
+ /* If it worked and it's the Normal group, use it as the
+ * normal font. Same for the Menu group. */
+ if (HL_TABLE()[idx].sg_font != NOFONT)
+ {
+ if (do_normal)
+ gui_init_font(arg, FALSE);
+#ifndef FONTSET_ALWAYS
+# if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
+ if (do_menu)
+ {
+ gui.menu_font = HL_TABLE()[idx].sg_font;
+ gui_mch_new_menu_font();
+ }
+# endif
+#endif
+ }
+ }
+}
+
+#endif /* FEAT_GUI */
+
+/*
+ * Table with the specifications for an attribute number.
+ * Note that this table is used by ALL buffers. This is required because the
+ * GUI can redraw at any time for any buffer.
+ */
+garray_T term_attr_table = {0, 0, 0, 0, NULL};
+
+#define TERM_ATTR_ENTRY(idx) ((attrentry_T *)term_attr_table.ga_data)[idx]
+
+garray_T cterm_attr_table = {0, 0, 0, 0, NULL};
+
+#define CTERM_ATTR_ENTRY(idx) ((attrentry_T *)cterm_attr_table.ga_data)[idx]
+
+#ifdef FEAT_GUI
+garray_T gui_attr_table = {0, 0, 0, 0, NULL};
+
+#define GUI_ATTR_ENTRY(idx) ((attrentry_T *)gui_attr_table.ga_data)[idx]
+#endif
+
+/*
+ * Return the attr number for a set of colors and font.
+ * Add a new entry to the term_attr_table, cterm_attr_table or gui_attr_table
+ * if the combination is new.
+ * Return 0 for error (no more room).
+ */
+ static int
+get_attr_entry(table, aep)
+ garray_T *table;
+ attrentry_T *aep;
+{
+ int i;
+ attrentry_T *gap;
+ static int recursive = FALSE;
+
+ /*
+ * Init the table, in case it wasn't done yet.
+ */
+ table->ga_itemsize = sizeof(attrentry_T);
+ table->ga_growsize = 7;
+
+ /*
+ * Try to find an entry with the same specifications.
+ */
+ for (i = 0; i < table->ga_len; ++i)
+ {
+ gap = &(((attrentry_T *)table->ga_data)[i]);
+ if ( aep->ae_attr == gap->ae_attr
+ && (
+#ifdef FEAT_GUI
+ (table == &gui_attr_table
+ && (aep->ae_u.gui.fg_color == gap->ae_u.gui.fg_color
+ && aep->ae_u.gui.bg_color == gap->ae_u.gui.bg_color
+ && aep->ae_u.gui.font == gap->ae_u.gui.font
+# ifdef FEAT_XFONTSET
+ && aep->ae_u.gui.fontset == gap->ae_u.gui.fontset
+# endif
+ ))
+ ||
+#endif
+ (table == &term_attr_table
+ && (aep->ae_u.term.start == NULL) ==
+ (gap->ae_u.term.start == NULL)
+ && (aep->ae_u.term.start == NULL
+ || STRCMP(aep->ae_u.term.start,
+ gap->ae_u.term.start) == 0)
+ && (aep->ae_u.term.stop == NULL) ==
+ (gap->ae_u.term.stop == NULL)
+ && (aep->ae_u.term.stop == NULL
+ || STRCMP(aep->ae_u.term.stop,
+ gap->ae_u.term.stop) == 0))
+ || (table == &cterm_attr_table
+ && aep->ae_u.cterm.fg_color == gap->ae_u.cterm.fg_color
+ && aep->ae_u.cterm.bg_color == gap->ae_u.cterm.bg_color)
+ ))
+
+ return i + ATTR_OFF;
+ }
+
+ if (table->ga_len + ATTR_OFF == 256)
+ {
+ /*
+ * Running out of attribute entries! remove all attributes, and
+ * compute new ones for all groups.
+ * When called recursively, we are really out of numbers.
+ */
+ if (recursive)
+ {
+ EMSG(_("E424: Too many different highlighting attributes in use"));
+ return 0;
+ }
+ recursive = TRUE;
+
+#ifdef FEAT_GUI
+ ga_clear(&gui_attr_table);
+#endif
+ ga_clear(&term_attr_table);
+ ga_clear(&cterm_attr_table);
+ must_redraw = CLEAR;
+
+ for (i = 0; i < highlight_ga.ga_len; ++i)
+ set_hl_attr(i);
+
+ recursive = FALSE;
+ }
+
+ /*
+ * This is a new combination of colors and font, add an entry.
+ */
+ if (ga_grow(table, 1) == FAIL)
+ return 0;
+
+ gap = &(((attrentry_T *)table->ga_data)[table->ga_len]);
+ vim_memset(gap, 0, sizeof(attrentry_T));
+ gap->ae_attr = aep->ae_attr;
+#ifdef FEAT_GUI
+ if (table == &gui_attr_table)
+ {
+ gap->ae_u.gui.fg_color = aep->ae_u.gui.fg_color;
+ gap->ae_u.gui.bg_color = aep->ae_u.gui.bg_color;
+ gap->ae_u.gui.font = aep->ae_u.gui.font;
+# ifdef FEAT_XFONTSET
+ gap->ae_u.gui.fontset = aep->ae_u.gui.fontset;
+# endif
+ }
+#endif
+ if (table == &term_attr_table)
+ {
+ if (aep->ae_u.term.start == NULL)
+ gap->ae_u.term.start = NULL;
+ else
+ gap->ae_u.term.start = vim_strsave(aep->ae_u.term.start);
+ if (aep->ae_u.term.stop == NULL)
+ gap->ae_u.term.stop = NULL;
+ else
+ gap->ae_u.term.stop = vim_strsave(aep->ae_u.term.stop);
+ }
+ else if (table == &cterm_attr_table)
+ {
+ gap->ae_u.cterm.fg_color = aep->ae_u.cterm.fg_color;
+ gap->ae_u.cterm.bg_color = aep->ae_u.cterm.bg_color;
+ }
+ ++table->ga_len;
+ --table->ga_room;
+ return (table->ga_len - 1 + ATTR_OFF);
+}
+
+#ifdef FEAT_GUI
+
+ attrentry_T *
+syn_gui_attr2entry(attr)
+ int attr;
+{
+ attr -= ATTR_OFF;
+ if (attr >= gui_attr_table.ga_len) /* did ":syntax clear" */
+ return NULL;
+ return &(GUI_ATTR_ENTRY(attr));
+}
+
+#endif /* FEAT_GUI */
+
+ attrentry_T *
+syn_term_attr2entry(attr)
+ int attr;
+{
+ attr -= ATTR_OFF;
+ if (attr >= term_attr_table.ga_len) /* did ":syntax clear" */
+ return NULL;
+ return &(TERM_ATTR_ENTRY(attr));
+}
+
+ attrentry_T *
+syn_cterm_attr2entry(attr)
+ int attr;
+{
+ attr -= ATTR_OFF;
+ if (attr >= cterm_attr_table.ga_len) /* did ":syntax clear" */
+ return NULL;
+ return &(CTERM_ATTR_ENTRY(attr));
+}
+
+#define LIST_ATTR 1
+#define LIST_STRING 2
+#define LIST_INT 3
+
+ static void
+highlight_list_one(id)
+ int id;
+{
+ struct hl_group *sgp;
+ int didh = FALSE;
+
+ sgp = &HL_TABLE()[id - 1]; /* index is ID minus one */
+
+ didh = highlight_list_arg(id, didh, LIST_ATTR,
+ sgp->sg_term, NULL, "term");
+ didh = highlight_list_arg(id, didh, LIST_STRING,
+ 0, sgp->sg_start, "start");
+ didh = highlight_list_arg(id, didh, LIST_STRING,
+ 0, sgp->sg_stop, "stop");
+
+ didh = highlight_list_arg(id, didh, LIST_ATTR,
+ sgp->sg_cterm, NULL, "cterm");
+ didh = highlight_list_arg(id, didh, LIST_INT,
+ sgp->sg_cterm_fg, NULL, "ctermfg");
+ didh = highlight_list_arg(id, didh, LIST_INT,
+ sgp->sg_cterm_bg, NULL, "ctermbg");
+
+#ifdef FEAT_GUI
+ didh = highlight_list_arg(id, didh, LIST_ATTR,
+ sgp->sg_gui, NULL, "gui");
+ didh = highlight_list_arg(id, didh, LIST_STRING,
+ 0, sgp->sg_gui_fg_name, "guifg");
+ didh = highlight_list_arg(id, didh, LIST_STRING,
+ 0, sgp->sg_gui_bg_name, "guibg");
+ didh = highlight_list_arg(id, didh, LIST_STRING,
+ 0, sgp->sg_font_name, "font");
+#endif
+
+ if (sgp->sg_link)
+ {
+ (void)syn_list_header(didh, 9999, id);
+ msg_puts_attr((char_u *)"links to", hl_attr(HLF_D));
+ msg_putchar(' ');
+ msg_outtrans(HL_TABLE()[HL_TABLE()[id - 1].sg_link - 1].sg_name);
+ }
+}
+
+ static int
+highlight_list_arg(id, didh, type, iarg, sarg, name)
+ int id;
+ int didh;
+ int type;
+ int iarg;
+ char_u *sarg;
+ char *name;
+{
+ char_u buf[100];
+ char_u *ts;
+ int i;
+
+ if (type == LIST_STRING ? (sarg != NULL) : (iarg != 0))
+ {
+ ts = buf;
+ if (type == LIST_INT)
+ sprintf((char *)buf, "%d", iarg - 1);
+ else if (type == LIST_STRING)
+ ts = sarg;
+ else /* type == LIST_ATTR */
+ {
+ buf[0] = NUL;
+ for (i = 0; hl_attr_table[i] != 0; ++i)
+ {
+ if (iarg & hl_attr_table[i])
+ {
+ if (buf[0] != NUL)
+ STRCAT(buf, ",");
+ STRCAT(buf, hl_name_table[i]);
+ iarg &= ~hl_attr_table[i]; /* don't want "inverse" */
+ }
+ }
+ }
+
+ (void)syn_list_header(didh,
+ (int)(vim_strsize(ts) + STRLEN(name) + 1), id);
+ didh = TRUE;
+
+ MSG_PUTS_ATTR(name, hl_attr(HLF_D));
+ MSG_PUTS_ATTR("=", hl_attr(HLF_D));
+ msg_outtrans(ts);
+ }
+ return didh;
+}
+
+#if (((defined(FEAT_EVAL) || defined(FEAT_PRINTER))) && defined(FEAT_SYN_HL)) || defined(PROTO)
+/*
+ * Return "1" if highlight group "id" has attribute "flag".
+ * Return NULL otherwise.
+ */
+ char_u *
+highlight_has_attr(id, flag, modec)
+ int id;
+ int flag;
+ int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */
+{
+ int attr;
+
+ if (id <= 0 || id > highlight_ga.ga_len)
+ return NULL;
+
+#ifdef FEAT_GUI
+ if (modec == 'g')
+ attr = HL_TABLE()[id - 1].sg_gui;
+ else
+#endif
+ if (modec == 'c')
+ attr = HL_TABLE()[id - 1].sg_cterm;
+ else
+ attr = HL_TABLE()[id - 1].sg_term;
+
+ if (attr & flag)
+ return (char_u *)"1";
+ return NULL;
+}
+#endif
+
+#if (defined(FEAT_SYN_HL) && defined(FEAT_EVAL)) || defined(PROTO)
+/*
+ * Return color name of highlight group "id".
+ */
+ char_u *
+highlight_color(id, what, modec)
+ int id;
+ char_u *what; /* "fg", "bg", "fg#" or "bg#" */
+ int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */
+{
+ static char_u name[20];
+ int n;
+ int fg;
+
+ if (id <= 0 || id > highlight_ga.ga_len)
+ return NULL;
+
+ if (TOLOWER_ASC(what[0]) == 'f')
+ fg = TRUE;
+ else
+ fg = FALSE;
+#ifdef FEAT_GUI
+ if (modec == 'g')
+ {
+ /* return #RRGGBB form (only possible when GUI is running) */
+ if (gui.in_use && what[1] && what[2] == '#')
+ {
+ guicolor_T color;
+ long_u rgb;
+ static char_u buf[10];
+
+ if (fg)
+ color = HL_TABLE()[id - 1].sg_gui_fg;
+ else
+ color = HL_TABLE()[id - 1].sg_gui_bg;
+ if (color == INVALCOLOR)
+ return NULL;
+ rgb = gui_mch_get_rgb(color);
+ sprintf((char *)buf, "#%02x%02x%02x",
+ (unsigned)(rgb >> 16),
+ (unsigned)(rgb >> 8) & 255,
+ (unsigned)rgb & 255);
+ return buf;
+ }
+ if (fg)
+ return (HL_TABLE()[id - 1].sg_gui_fg_name);
+ return (HL_TABLE()[id - 1].sg_gui_bg_name);
+ }
+#endif
+ if (modec == 'c')
+ {
+ if (fg)
+ n = HL_TABLE()[id - 1].sg_cterm_fg - 1;
+ else
+ n = HL_TABLE()[id - 1].sg_cterm_bg - 1;
+ sprintf((char *)name, "%d", n);
+ return name;
+ }
+ /* term doesn't have color */
+ return NULL;
+}
+#endif
+
+#if (defined(FEAT_SYN_HL) && defined(FEAT_GUI) && defined(FEAT_PRINTER)) \
+ || defined(PROTO)
+/*
+ * Return color name of highlight group "id" as RGB value.
+ */
+ long_u
+highlight_gui_color_rgb(id, fg)
+ int id;
+ int fg; /* TRUE = fg, FALSE = bg */
+{
+ guicolor_T color;
+
+ if (id <= 0 || id > highlight_ga.ga_len)
+ return 0L;
+
+ if (fg)
+ color = HL_TABLE()[id - 1].sg_gui_fg;
+ else
+ color = HL_TABLE()[id - 1].sg_gui_bg;
+
+ if (color == INVALCOLOR)
+ return 0L;
+
+ return gui_mch_get_rgb(color);
+}
+#endif
+
+/*
+ * Output the syntax list header.
+ * Return TRUE when started a new line.
+ */
+ static int
+syn_list_header(did_header, outlen, id)
+ int did_header; /* did header already */
+ int outlen; /* length of string that comes */
+ int id; /* highlight group id */
+{
+ int endcol = 19;
+ int newline = TRUE;
+
+ if (!did_header)
+ {
+ msg_putchar('\n');
+ msg_outtrans(HL_TABLE()[id - 1].sg_name);
+ endcol = 15;
+ }
+ else if (msg_col + outlen + 1 >= Columns)
+ msg_putchar('\n');
+ else
+ {
+ if (msg_col >= endcol) /* wrap around is like starting a new line */
+ newline = FALSE;
+ }
+
+ if (msg_col >= endcol) /* output at least one space */
+ endcol = msg_col + 1;
+ if (Columns <= endcol) /* avoid hang for tiny window */
+ endcol = Columns - 1;
+
+ msg_advance(endcol);
+
+ /* Show "xxx" with the attributes. */
+ if (!did_header)
+ {
+ msg_puts_attr((char_u *)"xxx", syn_id2attr(id));
+ msg_putchar(' ');
+ }
+
+ return newline;
+}
+
+/*
+ * Set the attribute numbers for a highlight group.
+ * Called after one of the attributes has changed.
+ */
+ static void
+set_hl_attr(idx)
+ int idx; /* index in array */
+{
+ attrentry_T at_en;
+ struct hl_group *sgp = HL_TABLE() + idx;
+
+ /* The "Normal" group doesn't need an attribute number */
+ if (sgp->sg_name_u != NULL && STRCMP(sgp->sg_name_u, "NORMAL") == 0)
+ return;
+
+#ifdef FEAT_GUI
+ /*
+ * For the GUI mode: If there are other than "normal" highlighting
+ * attributes, need to allocate an attr number.
+ */
+ if (sgp->sg_gui_fg == INVALCOLOR
+ && sgp->sg_gui_bg == INVALCOLOR
+ && sgp->sg_font == NOFONT
+# ifdef FEAT_XFONTSET
+ && sgp->sg_fontset == NOFONTSET
+# endif
+ )
+ {
+ sgp->sg_gui_attr = sgp->sg_gui;
+ }
+ else
+ {
+ at_en.ae_attr = sgp->sg_gui;
+ at_en.ae_u.gui.fg_color = sgp->sg_gui_fg;
+ at_en.ae_u.gui.bg_color = sgp->sg_gui_bg;
+ at_en.ae_u.gui.font = sgp->sg_font;
+# ifdef FEAT_XFONTSET
+ at_en.ae_u.gui.fontset = sgp->sg_fontset;
+# endif
+ sgp->sg_gui_attr = get_attr_entry(&gui_attr_table, &at_en);
+ }
+#endif
+ /*
+ * For the term mode: If there are other than "normal" highlighting
+ * attributes, need to allocate an attr number.
+ */
+ if (sgp->sg_start == NULL && sgp->sg_stop == NULL)
+ sgp->sg_term_attr = sgp->sg_term;
+ else
+ {
+ at_en.ae_attr = sgp->sg_term;
+ at_en.ae_u.term.start = sgp->sg_start;
+ at_en.ae_u.term.stop = sgp->sg_stop;
+ sgp->sg_term_attr = get_attr_entry(&term_attr_table, &at_en);
+ }
+
+ /*
+ * For the color term mode: If there are other than "normal"
+ * highlighting attributes, need to allocate an attr number.
+ */
+ if (sgp->sg_cterm_fg == 0 && sgp->sg_cterm_bg == 0)
+ sgp->sg_cterm_attr = sgp->sg_cterm;
+ else
+ {
+ at_en.ae_attr = sgp->sg_cterm;
+ at_en.ae_u.cterm.fg_color = sgp->sg_cterm_fg;
+ at_en.ae_u.cterm.bg_color = sgp->sg_cterm_bg;
+ sgp->sg_cterm_attr = get_attr_entry(&cterm_attr_table, &at_en);
+ }
+}
+
+/*
+ * Lookup a highlight group name and return it's ID.
+ * If it is not found, 0 is returned.
+ */
+ int
+syn_name2id(name)
+ char_u *name;
+{
+ int i;
+ char_u name_u[200];
+
+ /* Avoid using stricmp() too much, it's slow on some systems */
+ /* Avoid alloc()/free(), these are slow too. ID names over 200 chars
+ * don't deserve to be found! */
+ STRNCPY(name_u, name, 199);
+ name_u[199] = NUL;
+ vim_strup(name_u);
+ for (i = highlight_ga.ga_len; --i >= 0; )
+ if (HL_TABLE()[i].sg_name_u != NULL
+ && STRCMP(name_u, HL_TABLE()[i].sg_name_u) == 0)
+ break;
+ return i + 1;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return TRUE if highlight group "name" exists.
+ */
+ int
+highlight_exists(name)
+ char_u *name;
+{
+ return (syn_name2id(name) > 0);
+}
+#endif
+
+/*
+ * Like syn_name2id(), but take a pointer + length argument.
+ */
+ int
+syn_namen2id(linep, len)
+ char_u *linep;
+ int len;
+{
+ char_u *name;
+ int id = 0;
+
+ name = vim_strnsave(linep, len);
+ if (name != NULL)
+ {
+ id = syn_name2id(name);
+ vim_free(name);
+ }
+ return id;
+}
+
+/*
+ * Find highlight group name in the table and return it's ID.
+ * The argument is a pointer to the name and the length of the name.
+ * If it doesn't exist yet, a new entry is created.
+ * Return 0 for failure.
+ */
+ int
+syn_check_group(pp, len)
+ char_u *pp;
+ int len;
+{
+ int id;
+ char_u *name;
+
+ name = vim_strnsave(pp, len);
+ if (name == NULL)
+ return 0;
+
+ id = syn_name2id(name);
+ if (id == 0) /* doesn't exist yet */
+ id = syn_add_group(name);
+ else
+ vim_free(name);
+ return id;
+}
+
+/*
+ * Add new highlight group and return it's ID.
+ * "name" must be an allocated string, it will be consumed.
+ * Return 0 for failure.
+ */
+ static int
+syn_add_group(name)
+ char_u *name;
+{
+ char_u *p;
+
+ /* Check that the name is ASCII letters, digits and underscore. */
+ for (p = name; *p != NUL; ++p)
+ {
+ if (!vim_isprintc(*p))
+ {
+ EMSG(_("E669: Unprintable character in group name"));
+ return 0;
+ }
+ else if (!ASCII_ISALNUM(*p) && *p != '_')
+ {
+ /* This is an error, but since there previously was no check only
+ * give a warning. */
+ MSG(_("W18: Invalid character in group name"));
+ break;
+ }
+ }
+
+ /*
+ * First call for this growarray: init growing array.
+ */
+ if (highlight_ga.ga_data == NULL)
+ {
+ highlight_ga.ga_itemsize = sizeof(struct hl_group);
+ highlight_ga.ga_growsize = 10;
+ }
+
+ /*
+ * Make room for at least one other syntax_highlight entry.
+ */
+ if (ga_grow(&highlight_ga, 1) == FAIL)
+ {
+ vim_free(name);
+ return 0;
+ }
+
+ vim_memset(&(HL_TABLE()[highlight_ga.ga_len]), 0, sizeof(struct hl_group));
+ HL_TABLE()[highlight_ga.ga_len].sg_name = name;
+ HL_TABLE()[highlight_ga.ga_len].sg_name_u = vim_strsave_up(name);
+#ifdef FEAT_GUI
+ HL_TABLE()[highlight_ga.ga_len].sg_gui_bg = INVALCOLOR;
+ HL_TABLE()[highlight_ga.ga_len].sg_gui_fg = INVALCOLOR;
+#endif
+ ++highlight_ga.ga_len;
+ --highlight_ga.ga_room;
+
+ return highlight_ga.ga_len; /* ID is index plus one */
+}
+
+/*
+ * When, just after calling syn_add_group(), an error is discovered, this
+ * function deletes the new name.
+ */
+ static void
+syn_unadd_group()
+{
+ --highlight_ga.ga_len;
+ ++highlight_ga.ga_room;
+ vim_free(HL_TABLE()[highlight_ga.ga_len].sg_name);
+ vim_free(HL_TABLE()[highlight_ga.ga_len].sg_name_u);
+}
+
+/*
+ * Translate a group ID to highlight attributes.
+ */
+ int
+syn_id2attr(hl_id)
+ int hl_id;
+{
+ int attr;
+ struct hl_group *sgp;
+
+ hl_id = syn_get_final_id(hl_id);
+ sgp = &HL_TABLE()[hl_id - 1]; /* index is ID minus one */
+
+#ifdef FEAT_GUI
+ /*
+ * Only use GUI attr when the GUI is being used.
+ */
+ if (gui.in_use)
+ attr = sgp->sg_gui_attr;
+ else
+#endif
+ if (t_colors > 1)
+ attr = sgp->sg_cterm_attr;
+ else
+ attr = sgp->sg_term_attr;
+
+ return attr;
+}
+
+#ifdef FEAT_GUI
+/*
+ * Get the GUI colors and attributes for a group ID.
+ * NOTE: the colors will be INVALCOLOR when not set, the color otherwise.
+ */
+ int
+syn_id2colors(hl_id, fgp, bgp)
+ int hl_id;
+ guicolor_T *fgp;
+ guicolor_T *bgp;
+{
+ struct hl_group *sgp;
+
+ hl_id = syn_get_final_id(hl_id);
+ sgp = &HL_TABLE()[hl_id - 1]; /* index is ID minus one */
+
+ *fgp = sgp->sg_gui_fg;
+ *bgp = sgp->sg_gui_bg;
+ return sgp->sg_gui;
+}
+#endif
+
+/*
+ * Translate a group ID to the final group ID (following links).
+ */
+ int
+syn_get_final_id(hl_id)
+ int hl_id;
+{
+ int count;
+ struct hl_group *sgp;
+
+ if (hl_id > highlight_ga.ga_len || hl_id < 1)
+ return 0; /* Can be called from eval!! */
+
+ /*
+ * Follow links until there is no more.
+ * Look out for loops! Break after 100 links.
+ */
+ for (count = 100; --count >= 0; )
+ {
+ sgp = &HL_TABLE()[hl_id - 1]; /* index is ID minus one */
+ if (sgp->sg_link == 0 || sgp->sg_link > highlight_ga.ga_len)
+ break;
+ hl_id = sgp->sg_link;
+ }
+
+ return hl_id;
+}
+
+#ifdef FEAT_GUI
+/*
+ * Call this function just after the GUI has started.
+ * It finds the font and color handles for the highlighting groups.
+ */
+ void
+highlight_gui_started()
+{
+ int idx;
+
+ /* First get the colors from the "Normal" and "Menu" group, if set */
+ set_normal_colors();
+
+ for (idx = 0; idx < highlight_ga.ga_len; ++idx)
+ gui_do_one_color(idx, FALSE, FALSE);
+
+ highlight_changed();
+}
+
+ static void
+gui_do_one_color(idx, do_menu, do_tooltip)
+ int idx;
+ int do_menu; /* TRUE: might set the menu font */
+ int do_tooltip; /* TRUE: might set the tooltip font */
+{
+ int didit = FALSE;
+
+ if (HL_TABLE()[idx].sg_font_name != NULL)
+ {
+ hl_do_font(idx, HL_TABLE()[idx].sg_font_name, FALSE, do_menu,
+ do_tooltip);
+ didit = TRUE;
+ }
+ if (HL_TABLE()[idx].sg_gui_fg_name != NULL)
+ {
+ HL_TABLE()[idx].sg_gui_fg =
+ color_name2handle(HL_TABLE()[idx].sg_gui_fg_name);
+ didit = TRUE;
+ }
+ if (HL_TABLE()[idx].sg_gui_bg_name != NULL)
+ {
+ HL_TABLE()[idx].sg_gui_bg =
+ color_name2handle(HL_TABLE()[idx].sg_gui_bg_name);
+ didit = TRUE;
+ }
+ if (didit) /* need to get a new attr number */
+ set_hl_attr(idx);
+}
+
+#endif
+
+/*
+ * Translate the 'highlight' option into attributes in highlight_attr[] and
+ * set up the user highlights User1..9. If FEAT_STL_OPT is in use, a set of
+ * corresponding highlights to use on top of HLF_SNC is computed.
+ * Called only when the 'highlight' option has been changed and upon first
+ * screen redraw after any :highlight command.
+ * Return FAIL when an invalid flag is found in 'highlight'. OK otherwise.
+ */
+ int
+highlight_changed()
+{
+ int hlf;
+ int i;
+ char_u *p;
+ int attr;
+ char_u *end;
+ int id;
+#ifdef USER_HIGHLIGHT
+ char_u userhl[10];
+# ifdef FEAT_STL_OPT
+ int id_SNC = -1;
+ int id_S = -1;
+ int hlcnt;
+# endif
+#endif
+ static int hl_flags[HLF_COUNT] = HL_FLAGS;
+
+ need_highlight_changed = FALSE;
+
+ /*
+ * Clear all attributes.
+ */
+ for (hlf = 0; hlf < (int)HLF_COUNT; ++hlf)
+ highlight_attr[hlf] = 0;
+
+ /*
+ * First set all attributes to their default value.
+ * Then use the attributes from the 'highlight' option.
+ */
+ for (i = 0; i < 2; ++i)
+ {
+ if (i)
+ p = p_hl;
+ else
+ p = get_highlight_default();
+ if (p == NULL) /* just in case */
+ continue;
+
+ while (*p)
+ {
+ for (hlf = 0; hlf < (int)HLF_COUNT; ++hlf)
+ if (hl_flags[hlf] == *p)
+ break;
+ ++p;
+ if (hlf == (int)HLF_COUNT || *p == NUL)
+ return FAIL;
+
+ /*
+ * Allow several hl_flags to be combined, like "bu" for
+ * bold-underlined.
+ */
+ attr = 0;
+ for ( ; *p && *p != ','; ++p) /* parse upto comma */
+ {
+ if (vim_iswhite(*p)) /* ignore white space */
+ continue;
+
+ if (attr > HL_ALL) /* Combination with ':' is not allowed. */
+ return FAIL;
+
+ switch (*p)
+ {
+ case 'b': attr |= HL_BOLD;
+ break;
+ case 'i': attr |= HL_ITALIC;
+ break;
+ case '-':
+ case 'n': /* no highlighting */
+ break;
+ case 'r': attr |= HL_INVERSE;
+ break;
+ case 's': attr |= HL_STANDOUT;
+ break;
+ case 'u': attr |= HL_UNDERLINE;
+ break;
+ case ':': ++p; /* highlight group name */
+ if (attr || *p == NUL) /* no combinations */
+ return FAIL;
+ end = vim_strchr(p, ',');
+ if (end == NULL)
+ end = p + STRLEN(p);
+ id = syn_check_group(p, (int)(end - p));
+ if (id == 0)
+ return FAIL;
+ attr = syn_id2attr(id);
+ p = end - 1;
+#if defined(FEAT_STL_OPT) && defined(USER_HIGHLIGHT)
+ if (hlf == (int)HLF_SNC)
+ id_SNC = syn_get_final_id(id);
+ else if (hlf == (int)HLF_S)
+ id_S = syn_get_final_id(id);
+#endif
+ break;
+ default: return FAIL;
+ }
+ }
+ highlight_attr[hlf] = attr;
+
+ p = skip_to_option_part(p); /* skip comma and spaces */
+ }
+ }
+
+#ifdef USER_HIGHLIGHT
+ /* Setup the user highlights
+ *
+ * Temporarily utilize 10 more hl entries. Have to be in there
+ * simultaneously in case of table overflows in get_attr_entry()
+ */
+# ifdef FEAT_STL_OPT
+ if (ga_grow(&highlight_ga, 10) == FAIL)
+ return FAIL;
+ hlcnt = highlight_ga.ga_len;
+ if (id_S == 0)
+ { /* Make sure id_S is always valid to simplify code below */
+ memset(&HL_TABLE()[hlcnt + 9], 0, sizeof(struct hl_group));
+ HL_TABLE()[hlcnt + 9].sg_term = highlight_attr[HLF_S];
+ id_S = hlcnt + 10;
+ }
+# endif
+ for (i = 0; i < 9; i++)
+ {
+ sprintf((char *)userhl, "User%d", i + 1);
+ id = syn_name2id(userhl);
+ if (id == 0)
+ {
+ highlight_user[i] = 0;
+# ifdef FEAT_STL_OPT
+ highlight_stlnc[i] = 0;
+# endif
+ }
+ else
+ {
+# ifdef FEAT_STL_OPT
+ struct hl_group *hlt = HL_TABLE();
+# endif
+
+ highlight_user[i] = syn_id2attr(id);
+# ifdef FEAT_STL_OPT
+ if (id_SNC == 0)
+ {
+ memset(&hlt[hlcnt + i], 0, sizeof(struct hl_group));
+ hlt[hlcnt + i].sg_term = highlight_attr[HLF_SNC];
+ hlt[hlcnt + i].sg_cterm = highlight_attr[HLF_SNC];
+# ifdef FEAT_GUI
+ hlt[hlcnt + i].sg_gui = highlight_attr[HLF_SNC];
+# endif
+ }
+ else
+ mch_memmove(&hlt[hlcnt + i],
+ &hlt[id_SNC - 1],
+ sizeof(struct hl_group));
+ hlt[hlcnt + i].sg_link = 0;
+
+ /* Apply difference between UserX and HLF_S to HLF_SNC */
+ hlt[hlcnt + i].sg_term ^=
+ hlt[id - 1].sg_term ^ hlt[id_S - 1].sg_term;
+ if (hlt[id - 1].sg_start != hlt[id_S - 1].sg_start)
+ hlt[hlcnt + i].sg_start = hlt[id - 1].sg_start;
+ if (hlt[id - 1].sg_stop != hlt[id_S - 1].sg_stop)
+ hlt[hlcnt + i].sg_stop = hlt[id - 1].sg_stop;
+ hlt[hlcnt + i].sg_cterm ^=
+ hlt[id - 1].sg_cterm ^ hlt[id_S - 1].sg_cterm;
+ if (hlt[id - 1].sg_cterm_fg != hlt[id_S - 1].sg_cterm_fg)
+ hlt[hlcnt + i].sg_cterm_fg = hlt[id - 1].sg_cterm_fg;
+ if (hlt[id - 1].sg_cterm_bg != hlt[id_S - 1].sg_cterm_bg)
+ hlt[hlcnt + i].sg_cterm_bg = hlt[id - 1].sg_cterm_bg;
+# ifdef FEAT_GUI
+ hlt[hlcnt + i].sg_gui ^=
+ hlt[id - 1].sg_gui ^ hlt[id_S - 1].sg_gui;
+ if (hlt[id - 1].sg_gui_fg != hlt[id_S - 1].sg_gui_fg)
+ hlt[hlcnt + i].sg_gui_fg = hlt[id - 1].sg_gui_fg;
+ if (hlt[id - 1].sg_gui_bg != hlt[id_S - 1].sg_gui_bg)
+ hlt[hlcnt + i].sg_gui_bg = hlt[id - 1].sg_gui_bg;
+ if (hlt[id - 1].sg_font != hlt[id_S - 1].sg_font)
+ hlt[hlcnt + i].sg_font = hlt[id - 1].sg_font;
+# ifdef FEAT_XFONTSET
+ if (hlt[id - 1].sg_fontset != hlt[id_S - 1].sg_fontset)
+ hlt[hlcnt + i].sg_fontset = hlt[id - 1].sg_fontset;
+# endif
+# endif
+ highlight_ga.ga_len = hlcnt + i + 1;
+ set_hl_attr(hlcnt + i); /* At long last we can apply */
+ highlight_stlnc[i] = syn_id2attr(hlcnt + i + 1);
+# endif
+ }
+ }
+# ifdef FEAT_STL_OPT
+ highlight_ga.ga_len = hlcnt;
+# endif
+
+#endif /* USER_HIGHLIGHT */
+
+ return OK;
+}
+
+#ifdef FEAT_CMDL_COMPL
+
+static void highlight_list __ARGS((void));
+static void highlight_list_two __ARGS((int cnt, int attr));
+
+/*
+ * Handle command line completion for :highlight command.
+ */
+ void
+set_context_in_highlight_cmd(xp, arg)
+ expand_T *xp;
+ char_u *arg;
+{
+ char_u *p;
+
+ /* Default: expand group names */
+ xp->xp_context = EXPAND_HIGHLIGHT;
+ xp->xp_pattern = arg;
+ include_link = TRUE;
+ include_default = TRUE;
+
+ /* (part of) subcommand already typed */
+ if (*arg != NUL)
+ {
+ p = skiptowhite(arg);
+ if (*p != NUL) /* past "default" or group name */
+ {
+ include_default = FALSE;
+ if (STRNCMP("default", arg, p - arg) == 0)
+ {
+ arg = skipwhite(p);
+ xp->xp_pattern = arg;
+ p = skiptowhite(arg);
+ }
+ if (*p != NUL) /* past group name */
+ {
+ include_link = FALSE;
+ if (arg[1] == 'i' && arg[0] == 'N')
+ highlight_list();
+ if (STRNCMP("link", arg, p - arg) == 0
+ || STRNCMP("clear", arg, p - arg) == 0)
+ {
+ xp->xp_pattern = skipwhite(p);
+ p = skiptowhite(xp->xp_pattern);
+ if (*p != NUL) /* past first group name */
+ {
+ xp->xp_pattern = skipwhite(p);
+ p = skiptowhite(xp->xp_pattern);
+ }
+ }
+ if (*p != NUL) /* past group name(s) */
+ xp->xp_context = EXPAND_NOTHING;
+ }
+ }
+ }
+}
+
+/*
+ * List highlighting matches in a nice way.
+ */
+ static void
+highlight_list()
+{
+ int i;
+
+ for (i = 10; --i >= 0; )
+ highlight_list_two(i, hl_attr(HLF_D));
+ for (i = 40; --i >= 0; )
+ highlight_list_two(99, 0);
+}
+
+ static void
+highlight_list_two(cnt, attr)
+ int cnt;
+ int attr;
+{
+ msg_puts_attr((char_u *)("N \bI \b! \b" + cnt / 11), attr);
+ msg_clr_eos();
+ out_flush();
+ ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
+}
+
+#endif /* FEAT_CMDL_COMPL */
+
+#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_SYN_HL) && defined(FEAT_EVAL)) \
+ || defined(FEAT_SIGNS) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain the list of group names.
+ * Also used for synIDattr() function.
+ */
+/*ARGSUSED*/
+ char_u *
+get_highlight_name(xp, idx)
+ expand_T *xp;
+ int idx;
+{
+ if (idx == highlight_ga.ga_len
+#ifdef FEAT_CMDL_COMPL
+ && include_link
+#endif
+ )
+ return (char_u *)"link";
+ if (idx == highlight_ga.ga_len + 1
+#ifdef FEAT_CMDL_COMPL
+ && include_link
+#endif
+ )
+ return (char_u *)"clear";
+ if (idx == highlight_ga.ga_len + 2
+#ifdef FEAT_CMDL_COMPL
+ && include_default
+#endif
+ )
+ return (char_u *)"default";
+ if (idx < 0 || idx >= highlight_ga.ga_len)
+ return NULL;
+ return HL_TABLE()[idx].sg_name;
+}
+#endif
+
+#ifdef FEAT_GUI
+/*
+ * Free all the highlight group fonts.
+ * Used when quitting for systems which need it.
+ */
+ void
+free_highlight_fonts()
+{
+ int idx;
+
+ for (idx = 0; idx < highlight_ga.ga_len; ++idx)
+ {
+ gui_mch_free_font(HL_TABLE()[idx].sg_font);
+ HL_TABLE()[idx].sg_font = NOFONT;
+# ifdef FEAT_XFONTSET
+ gui_mch_free_fontset(HL_TABLE()[idx].sg_fontset);
+ HL_TABLE()[idx].sg_fontset = NOFONTSET;
+# endif
+ }
+
+ gui_mch_free_font(gui.norm_font);
+# ifdef FEAT_XFONTSET
+ gui_mch_free_fontset(gui.fontset);
+# endif
+# ifndef HAVE_GTK2
+ gui_mch_free_font(gui.bold_font);
+ gui_mch_free_font(gui.ital_font);
+ gui_mch_free_font(gui.boldital_font);
+# endif
+}
+#endif
+
+/**************************************
+ * End of Highlighting stuff *
+ **************************************/
diff --git a/src/tag.c b/src/tag.c
new file mode 100644
index 000000000..1e6d5ac5d
--- /dev/null
+++ b/src/tag.c
@@ -0,0 +1,3534 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * Code to handle tags and the tag stack
+ */
+
+#if defined MSDOS || defined WIN32 || defined(_WIN64)
+# include <io.h> /* for lseek(), must be before vim.h */
+#endif
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* for lseek() */
+#endif
+
+/*
+ * Structure to hold pointers to various items in a tag line.
+ */
+typedef struct tag_pointers
+{
+ /* filled in by parse_tag_line(): */
+ char_u *tagname; /* start of tag name (skip "file:") */
+ char_u *tagname_end; /* char after tag name */
+ char_u *fname; /* first char of file name */
+ char_u *fname_end; /* char after file name */
+ char_u *command; /* first char of command */
+ /* filled in by parse_match(): */
+ char_u *command_end; /* first char after command */
+ char_u *tag_fname; /* file name of the tags file */
+#ifdef FEAT_EMACS_TAGS
+ int is_etag; /* TRUE for emacs tag */
+#endif
+ char_u *tagkind; /* "kind:" value */
+ char_u *tagkind_end; /* end of tagkind */
+} tagptrs_T;
+
+/*
+ * The matching tags are first stored in ga_match[]. In which one depends on
+ * the priority of the match.
+ * At the end, the matches from ga_match[] are concatenated, to make a list
+ * sorted on priority.
+ */
+#define MT_ST_CUR 0 /* static match in current file */
+#define MT_GL_CUR 1 /* global match in current file */
+#define MT_GL_OTH 2 /* global match in other file */
+#define MT_ST_OTH 3 /* static match in other file */
+#define MT_IC_ST_CUR 4 /* icase static match in current file */
+#define MT_IC_GL_CUR 5 /* icase global match in current file */
+#define MT_IC_GL_OTH 6 /* icase global match in other file */
+#define MT_IC_ST_OTH 7 /* icase static match in other file */
+#define MT_IC_OFF 4 /* add for icase match */
+#define MT_RE_OFF 8 /* add for regexp match */
+#define MT_MASK 7 /* mask for printing priority */
+#define MT_COUNT 16
+
+static char *mt_names[MT_COUNT/2] =
+ {"FSC", "F C", "F ", "FS ", " SC", " C", " ", " S "};
+
+#define NOTAGFILE 99 /* return value for jumpto_tag */
+static char_u *nofile_fname = NULL; /* fname for NOTAGFILE error */
+
+static void taglen_advance __ARGS((int l));
+static int get_tagfname __ARGS((int first, char_u *buf));
+
+static int jumpto_tag __ARGS((char_u *lbuf, int forceit, int keep_help));
+#ifdef FEAT_EMACS_TAGS
+static int parse_tag_line __ARGS((char_u *lbuf, int is_etag, tagptrs_T *tagp));
+#else
+static int parse_tag_line __ARGS((char_u *lbuf, tagptrs_T *tagp));
+#endif
+static int test_for_static __ARGS((tagptrs_T *));
+static int parse_match __ARGS((char_u *lbuf, tagptrs_T *tagp));
+static char_u *tag_full_fname __ARGS((tagptrs_T *tagp));
+static char_u *expand_tag_fname __ARGS((char_u *fname, char_u *tag_fname, int expand));
+#ifdef FEAT_EMACS_TAGS
+static int test_for_current __ARGS((int, char_u *, char_u *, char_u *, char_u *));
+#else
+static int test_for_current __ARGS((char_u *, char_u *, char_u *, char_u *));
+#endif
+static int find_extra __ARGS((char_u **pp));
+
+static char_u *bottommsg = (char_u *)N_("E555: at bottom of tag stack");
+static char_u *topmsg = (char_u *)N_("E556: at top of tag stack");
+
+static char_u *tagmatchname = NULL; /* name of last used tag */
+
+/*
+ * We use ftello() here, if available. It returns off_t instead of long,
+ * which helps if long is 32 bit and off_t is 64 bit.
+ */
+#ifdef HAVE_FTELLO
+# define ftell ftello
+#endif
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+/*
+ * Tag for preview window is remembered separately, to avoid messing up the
+ * normal tagstack.
+ */
+static taggy_T ptag_entry = {NULL};
+#endif
+
+/*
+ * Jump to tag; handling of tag commands and tag stack
+ *
+ * *tag != NUL: ":tag {tag}", jump to new tag, add to tag stack
+ *
+ * type == DT_TAG: ":tag [tag]", jump to newer position or same tag again
+ * type == DT_HELP: like DT_TAG, but don't use regexp.
+ * type == DT_POP: ":pop" or CTRL-T, jump to old position
+ * type == DT_NEXT: jump to next match of same tag
+ * type == DT_PREV: jump to previous match of same tag
+ * type == DT_FIRST: jump to first match of same tag
+ * type == DT_LAST: jump to last match of same tag
+ * type == DT_SELECT: ":tselect [tag]", select tag from a list of all matches
+ * type == DT_JUMP: ":tjump [tag]", jump to tag or select tag from a list
+ * type == DT_CSCOPE: use cscope to find the tag.
+ *
+ * for cscope, returns TRUE if we jumped to tag or aborted, FALSE otherwise
+ */
+ int
+do_tag(tag, type, count, forceit, verbose)
+ char_u *tag; /* tag (pattern) to jump to */
+ int type;
+ int count;
+ int forceit; /* :ta with ! */
+ int verbose; /* print "tag not found" message */
+{
+ taggy_T *tagstack = curwin->w_tagstack;
+ int tagstackidx = curwin->w_tagstackidx;
+ int tagstacklen = curwin->w_tagstacklen;
+ int cur_match = 0;
+ int cur_fnum = curbuf->b_fnum;
+ int oldtagstackidx = tagstackidx;
+ int prevtagstackidx = tagstackidx;
+ int prev_num_matches;
+ int new_tag = FALSE;
+ int other_name;
+ int i, j, k;
+ int idx;
+ int ic;
+ char_u *p;
+ char_u *name;
+ int no_regexp = FALSE;
+ int error_cur_match = 0;
+ char_u *command_end;
+ int save_pos = FALSE;
+ fmark_T saved_fmark;
+ int taglen;
+#ifdef FEAT_CSCOPE
+ int jumped_to_tag = FALSE;
+#endif
+ tagptrs_T tagp, tagp2;
+ int new_num_matches;
+ char_u **new_matches;
+ int attr;
+ int use_tagstack;
+ int skip_msg = FALSE;
+ char_u *buf_ffname = curbuf->b_ffname; /* name to use for
+ priority computation */
+
+ /* remember the matches for the last used tag */
+ static int num_matches = 0;
+ static int max_num_matches = 0; /* limit used for match search */
+ static char_u **matches = NULL;
+ static int flags;
+
+ if (type == DT_HELP)
+ {
+ type = DT_TAG;
+ no_regexp = TRUE;
+ }
+
+ prev_num_matches = num_matches;
+ free_string_option(nofile_fname);
+ nofile_fname = NULL;
+
+ /*
+ * Don't add a tag to the tagstack if 'tagstack' has been reset.
+ */
+ if ((!p_tgst && *tag != NUL))
+ {
+ use_tagstack = FALSE;
+ new_tag = TRUE;
+ }
+ else
+ {
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ use_tagstack = FALSE;
+ else
+#endif
+ use_tagstack = TRUE;
+
+ /* new pattern, add to the tag stack */
+ if (*tag && (type == DT_TAG || type == DT_SELECT || type == DT_JUMP
+#ifdef FEAT_CSCOPE
+ || type == DT_CSCOPE
+#endif
+ ))
+ {
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ {
+ if (ptag_entry.tagname != NULL
+ && STRCMP(ptag_entry.tagname, tag) == 0)
+ {
+ /* Jumping to same tag: keep the current match, so that
+ * the CursorHold autocommand example works. */
+ cur_match = ptag_entry.cur_match;
+ cur_fnum = ptag_entry.cur_fnum;
+ }
+ else
+ {
+ vim_free(ptag_entry.tagname);
+ if ((ptag_entry.tagname = vim_strsave(tag)) == NULL)
+ goto end_do_tag;
+ }
+ }
+ else
+#endif
+ {
+ /*
+ * If the last used entry is not at the top, delete all tag
+ * stack entries above it.
+ */
+ while (tagstackidx < tagstacklen)
+ vim_free(tagstack[--tagstacklen].tagname);
+
+ /* if the tagstack is full: remove oldest entry */
+ if (++tagstacklen > TAGSTACKSIZE)
+ {
+ tagstacklen = TAGSTACKSIZE;
+ vim_free(tagstack[0].tagname);
+ for (i = 1; i < tagstacklen; ++i)
+ tagstack[i - 1] = tagstack[i];
+ --tagstackidx;
+ }
+
+ /*
+ * put the tag name in the tag stack
+ */
+ if ((tagstack[tagstackidx].tagname = vim_strsave(tag)) == NULL)
+ {
+ curwin->w_tagstacklen = tagstacklen - 1;
+ goto end_do_tag;
+ }
+ curwin->w_tagstacklen = tagstacklen;
+
+ save_pos = TRUE; /* save the cursor position below */
+ }
+
+ new_tag = TRUE;
+ }
+ else
+ {
+ if (
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ g_do_tagpreview ? ptag_entry.tagname == NULL :
+#endif
+ tagstacklen == 0)
+ {
+ /* empty stack */
+ EMSG(_(e_tagstack));
+ goto end_do_tag;
+ }
+
+ if (type == DT_POP) /* go to older position */
+ {
+#ifdef FEAT_FOLDING
+ int old_KeyTyped = KeyTyped;
+#endif
+ if ((tagstackidx -= count) < 0)
+ {
+ EMSG(_(bottommsg));
+ if (tagstackidx + count == 0)
+ {
+ /* We did [num]^T from the bottom of the stack */
+ tagstackidx = 0;
+ goto end_do_tag;
+ }
+ /* We weren't at the bottom of the stack, so jump all the
+ * way to the bottom now.
+ */
+ tagstackidx = 0;
+ }
+ else if (tagstackidx >= tagstacklen) /* count == 0? */
+ {
+ EMSG(_(topmsg));
+ goto end_do_tag;
+ }
+
+ /* Make a copy of the fmark, autocommands may invalidate the
+ * tagstack before it's used. */
+ saved_fmark = tagstack[tagstackidx].fmark;
+ if (saved_fmark.fnum != curbuf->b_fnum)
+ {
+ /*
+ * Jump to other file. If this fails (e.g. because the
+ * file was changed) keep original position in tag stack.
+ */
+ if (buflist_getfile(saved_fmark.fnum, saved_fmark.mark.lnum,
+ GETF_SETMARK, forceit) == FAIL)
+ {
+ tagstackidx = oldtagstackidx; /* back to old posn */
+ goto end_do_tag;
+ }
+ /* An BufReadPost autocommand may jump to the '" mark, but
+ * we don't what that here. */
+ curwin->w_cursor.lnum = saved_fmark.mark.lnum;
+ }
+ else
+ {
+ setpcmark();
+ curwin->w_cursor.lnum = saved_fmark.mark.lnum;
+ }
+ curwin->w_cursor.col = saved_fmark.mark.col;
+ curwin->w_set_curswant = TRUE;
+ check_cursor();
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_TAG) && old_KeyTyped)
+ foldOpenCursor();
+#endif
+
+ /* remove the old list of matches */
+ FreeWild(num_matches, matches);
+#ifdef FEAT_CSCOPE
+ cs_free_tags();
+#endif
+ num_matches = 0;
+ goto end_do_tag;
+ }
+
+ if (type == DT_TAG)
+ {
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ {
+ cur_match = ptag_entry.cur_match;
+ cur_fnum = ptag_entry.cur_fnum;
+ }
+ else
+#endif
+ {
+ /* ":tag" (no argument): go to newer pattern */
+ save_pos = TRUE; /* save the cursor position below */
+ if ((tagstackidx += count - 1) >= tagstacklen)
+ {
+ /*
+ * Beyond the last one, just give an error message and
+ * go to the last one. Don't store the cursor
+ * postition.
+ */
+ tagstackidx = tagstacklen - 1;
+ EMSG(_(topmsg));
+ save_pos = FALSE;
+ }
+ else if (tagstackidx < 0) /* must have been count == 0 */
+ {
+ EMSG(_(bottommsg));
+ tagstackidx = 0;
+ goto end_do_tag;
+ }
+ cur_match = tagstack[tagstackidx].cur_match;
+ cur_fnum = tagstack[tagstackidx].cur_fnum;
+ }
+ new_tag = TRUE;
+ }
+ else /* go to other matching tag */
+ {
+ /* Save index for when selection is cancelled. */
+ prevtagstackidx = tagstackidx;
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ {
+ cur_match = ptag_entry.cur_match;
+ cur_fnum = ptag_entry.cur_fnum;
+ }
+ else
+#endif
+ {
+ if (--tagstackidx < 0)
+ tagstackidx = 0;
+ cur_match = tagstack[tagstackidx].cur_match;
+ cur_fnum = tagstack[tagstackidx].cur_fnum;
+ }
+ switch (type)
+ {
+ case DT_FIRST: cur_match = count - 1; break;
+ case DT_SELECT:
+ case DT_JUMP:
+#ifdef FEAT_CSCOPE
+ case DT_CSCOPE:
+#endif
+ case DT_LAST: cur_match = MAXCOL - 1; break;
+ case DT_NEXT: cur_match += count; break;
+ case DT_PREV: cur_match -= count; break;
+ }
+ if (cur_match >= MAXCOL)
+ cur_match = MAXCOL - 1;
+ else if (cur_match < 0)
+ {
+ EMSG(_("E425: Cannot go before first matching tag"));
+ skip_msg = TRUE;
+ cur_match = 0;
+ cur_fnum = curbuf->b_fnum;
+ }
+ }
+ }
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ {
+ if (type != DT_SELECT && type != DT_JUMP)
+ {
+ ptag_entry.cur_match = cur_match;
+ ptag_entry.cur_fnum = cur_fnum;
+ }
+ }
+ else
+#endif
+ {
+ /*
+ * For ":tag [arg]" or ":tselect" remember position before the jump.
+ */
+ saved_fmark = tagstack[tagstackidx].fmark;
+ if (save_pos)
+ {
+ tagstack[tagstackidx].fmark.mark = curwin->w_cursor;
+ tagstack[tagstackidx].fmark.fnum = curbuf->b_fnum;
+ }
+
+ /* Curwin will change in the call to jumpto_tag() if ":stag" was
+ * used or an autocommand jumps to another window; store value of
+ * tagstackidx now. */
+ curwin->w_tagstackidx = tagstackidx;
+ if (type != DT_SELECT && type != DT_JUMP)
+ {
+ curwin->w_tagstack[tagstackidx].cur_match = cur_match;
+ curwin->w_tagstack[tagstackidx].cur_fnum = cur_fnum;
+ }
+ }
+ }
+
+ /* When not using the current buffer get the name of buffer "cur_fnum".
+ * Makes sure that the tag order doesn't change when using a remembered
+ * position for "cur_match". */
+ if (cur_fnum != curbuf->b_fnum)
+ {
+ buf_T *buf = buflist_findnr(cur_fnum);
+
+ if (buf != NULL)
+ buf_ffname = buf->b_ffname;
+ }
+
+ /*
+ * Repeat searching for tags, when a file has not been found.
+ */
+ for (;;)
+ {
+ /*
+ * When desired match not found yet, try to find it (and others).
+ */
+ if (use_tagstack)
+ name = tagstack[tagstackidx].tagname;
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ else if (g_do_tagpreview)
+ name = ptag_entry.tagname;
+#endif
+ else
+ name = tag;
+ other_name = (tagmatchname == NULL || STRCMP(tagmatchname, name) != 0);
+ if (new_tag
+ || (cur_match >= num_matches && max_num_matches != MAXCOL)
+ || other_name)
+ {
+ if (other_name)
+ {
+ vim_free(tagmatchname);
+ tagmatchname = vim_strsave(name);
+ }
+
+ if (type == DT_SELECT || type == DT_JUMP)
+ cur_match = MAXCOL - 1;
+ max_num_matches = cur_match + 1;
+
+ /* when the argument starts with '/', use it as a regexp */
+ if (!no_regexp && *name == '/')
+ {
+ flags = TAG_REGEXP;
+ ++name;
+ }
+ else
+ flags = TAG_NOIC;
+
+#ifdef FEAT_CSCOPE
+ if (type == DT_CSCOPE)
+ flags = TAG_CSCOPE;
+#endif
+ if (verbose)
+ flags |= TAG_VERBOSE;
+ if (find_tags(name, &new_num_matches, &new_matches, flags,
+ max_num_matches, buf_ffname) == OK
+ && new_num_matches < max_num_matches)
+ max_num_matches = MAXCOL; /* If less than max_num_matches
+ found: all matches found. */
+
+ /* If there already were some matches for the same name, move them
+ * to the start. Avoids that the order changes when using
+ * ":tnext" and jumping to another file. */
+ if (!new_tag && !other_name)
+ {
+ /* Find the position of each old match in the new list. Need
+ * to use parse_match() to find the tag line. */
+ idx = 0;
+ for (j = 0; j < num_matches; ++j)
+ {
+ parse_match(matches[j], &tagp);
+ for (i = idx; i < new_num_matches; ++i)
+ {
+ parse_match(new_matches[i], &tagp2);
+ if (STRCMP(tagp.tagname, tagp2.tagname) == 0)
+ {
+ p = new_matches[i];
+ for (k = i; k > idx; --k)
+ new_matches[k] = new_matches[k - 1];
+ new_matches[idx++] = p;
+ break;
+ }
+ }
+ }
+ }
+ FreeWild(num_matches, matches);
+ num_matches = new_num_matches;
+ matches = new_matches;
+ }
+
+ if (num_matches <= 0)
+ {
+ if (verbose)
+ EMSG2(_("E426: tag not found: %s"), name);
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ g_do_tagpreview = 0;
+#endif
+ }
+ else
+ {
+ int ask_for_selection = FALSE;
+
+#ifdef FEAT_CSCOPE
+ if (type == DT_CSCOPE && num_matches > 1)
+ {
+ cs_print_tags();
+ ask_for_selection = TRUE;
+ }
+ else
+#endif
+ if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
+ {
+ /*
+ * List all the matching tags.
+ * Assume that the first match indicates how long the tags can
+ * be, and align the file names to that.
+ */
+ parse_match(matches[0], &tagp);
+ taglen = (int)(tagp.tagname_end - tagp.tagname + 2);
+ if (taglen < 18)
+ taglen = 18;
+ if (taglen > Columns - 25)
+ taglen = MAXCOL;
+ if (msg_col == 0)
+ msg_didout = FALSE; /* overwrite previous message */
+ msg_start();
+ MSG_PUTS_ATTR(_(" # pri kind tag"), hl_attr(HLF_T));
+ msg_clr_eos();
+ taglen_advance(taglen);
+ MSG_PUTS_ATTR(_("file\n"), hl_attr(HLF_T));
+
+ for (i = 0; i < num_matches; ++i)
+ {
+ parse_match(matches[i], &tagp);
+ if (!new_tag && (
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ (g_do_tagpreview
+ && i == ptag_entry.cur_match) ||
+#endif
+ (use_tagstack
+ && i == tagstack[tagstackidx].cur_match)))
+ *IObuff = '>';
+ else
+ *IObuff = ' ';
+ sprintf((char *)IObuff + 1, "%2d %s ", i + 1,
+ mt_names[matches[i][0] & MT_MASK]);
+ msg_puts(IObuff);
+ if (tagp.tagkind != NULL)
+ msg_outtrans_len(tagp.tagkind,
+ (int)(tagp.tagkind_end - tagp.tagkind));
+ msg_advance(13);
+ msg_outtrans_len_attr(tagp.tagname,
+ (int)(tagp.tagname_end - tagp.tagname),
+ hl_attr(HLF_T));
+ msg_putchar(' ');
+ taglen_advance(taglen);
+
+ /* Find out the actual file name. If it is long, truncate
+ * it and put "..." in the middle */
+ p = tag_full_fname(&tagp);
+ if (p != NULL)
+ {
+ msg_puts_long_attr(p, hl_attr(HLF_D));
+ vim_free(p);
+ }
+ if (msg_col > 0)
+ msg_putchar('\n');
+ msg_advance(15);
+
+ /* print any extra fields */
+ command_end = tagp.command_end;
+ if (command_end != NULL)
+ {
+ p = command_end + 3;
+ while (*p && *p != '\r' && *p != '\n')
+ {
+ while (*p == TAB)
+ ++p;
+
+ /* skip "file:" without a value (static tag) */
+ if (STRNCMP(p, "file:", 5) == 0
+ && vim_isspace(p[5]))
+ {
+ p += 5;
+ continue;
+ }
+ /* skip "kind:<kind>" and "<kind>" */
+ if (p == tagp.tagkind
+ || (p + 5 == tagp.tagkind
+ && STRNCMP(p, "kind:", 5) == 0))
+ {
+ p = tagp.tagkind_end;
+ continue;
+ }
+ /* print all other extra fields */
+ attr = hl_attr(HLF_CM);
+ while (*p && *p != '\r' && *p != '\n')
+ {
+ if (msg_col + ptr2cells(p) >= Columns)
+ {
+ msg_putchar('\n');
+ msg_advance(15);
+ }
+ p = msg_outtrans_one(p, attr);
+ if (*p == TAB)
+ {
+ msg_puts_attr((char_u *)" ", attr);
+ break;
+ }
+ if (*p == ':')
+ attr = 0;
+ }
+ }
+ if (msg_col > 15)
+ {
+ msg_putchar('\n');
+ msg_advance(15);
+ }
+ }
+ else
+ {
+ for (p = tagp.command;
+ *p && *p != '\r' && *p != '\n'; ++p)
+ ;
+ command_end = p;
+ }
+
+ /*
+ * Put the info (in several lines) at column 15.
+ * Don't display "/^" and "?^".
+ */
+ p = tagp.command;
+ if (*p == '/' || *p == '?')
+ {
+ ++p;
+ if (*p == '^')
+ ++p;
+ }
+ /* Remove leading whitespace from pattern */
+ while (p != command_end && vim_isspace(*p))
+ ++p;
+
+ while (p != command_end)
+ {
+ if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns)
+ msg_putchar('\n');
+ msg_advance(15);
+
+ /* skip backslash used for escaping command char */
+ if (*p == '\\' && *(p + 1) == *tagp.command)
+ ++p;
+
+ if (*p == TAB)
+ {
+ msg_putchar(' ');
+ ++p;
+ }
+ else
+ p = msg_outtrans_one(p, 0);
+
+ /* don't display the "$/;\"" and "$?;\"" */
+ if (p == command_end - 2 && *p == '$'
+ && *(p + 1) == *tagp.command)
+ break;
+ /* don't display matching '/' or '?' */
+ if (p == command_end - 1 && *p == *tagp.command
+ && (*p == '/' || *p == '?'))
+ break;
+ }
+ if (msg_col)
+ msg_putchar('\n');
+ ui_breakcheck();
+ if (got_int)
+ {
+ got_int = FALSE; /* only stop the listing */
+ break;
+ }
+ }
+ ask_for_selection = TRUE;
+ }
+
+ if (ask_for_selection == TRUE)
+ {
+ /*
+ * Ask to select a tag from the list.
+ * When using ":silent" assume that <CR> was entered.
+ */
+ MSG_PUTS(_("Enter nr of choice (<CR> to abort): "));
+ i = get_number(TRUE);
+ if (KeyTyped) /* don't call wait_return() now */
+ {
+ msg_putchar('\n');
+ cmdline_row = msg_row - 1;
+ need_wait_return = FALSE;
+ msg_didany = FALSE;
+ }
+ if (i <= 0 || i > num_matches || got_int)
+ {
+ /* no valid choice: don't change anything */
+ if (use_tagstack)
+ {
+ tagstack[tagstackidx].fmark = saved_fmark;
+ tagstackidx = prevtagstackidx;
+ }
+#ifdef FEAT_CSCOPE
+ cs_free_tags();
+ jumped_to_tag = TRUE;
+#endif
+ break;
+ }
+#if 0
+ /* avoid the need to hit <CR> when jumping to another file */
+ msg_scrolled = 0;
+ redraw_all_later(NOT_VALID);
+#endif
+ cur_match = i - 1;
+ }
+
+ if (cur_match >= num_matches)
+ {
+ /* Avoid giving this error when a file wasn't found and we're
+ * looking for a match in another file, which wasn't found.
+ * There will be an EMSG("file doesn't exist") below then. */
+ if ((type == DT_NEXT || type == DT_FIRST)
+ && nofile_fname == NULL)
+ {
+ if (num_matches == 1)
+ EMSG(_("E427: There is only one matching tag"));
+ else
+ EMSG(_("E428: Cannot go beyond last matching tag"));
+ skip_msg = TRUE;
+ }
+ cur_match = num_matches - 1;
+ }
+ if (use_tagstack)
+ {
+ tagstack[tagstackidx].cur_match = cur_match;
+ tagstack[tagstackidx].cur_fnum = cur_fnum;
+ ++tagstackidx;
+ }
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ else if (g_do_tagpreview)
+ {
+ ptag_entry.cur_match = cur_match;
+ ptag_entry.cur_fnum = cur_fnum;
+ }
+#endif
+
+ /*
+ * Only when going to try the next match, report that the previous
+ * file didn't exist. Otherwise an EMSG() is given below.
+ */
+ if (nofile_fname != NULL && error_cur_match != cur_match)
+ msg_str((char_u *)_("File \"%s\" does not exist"),
+ nofile_fname);
+
+
+ ic = (matches[cur_match][0] & MT_IC_OFF);
+ if (type != DT_SELECT && type != DT_JUMP
+#ifdef FEAT_CSCOPE
+ && type != DT_CSCOPE
+#endif
+ && (num_matches > 1 || ic)
+ && !skip_msg)
+ {
+ /* Give an indication of the number of matching tags */
+ sprintf((char *)IObuff, _("tag %d of %d%s"),
+ cur_match + 1,
+ num_matches,
+ max_num_matches != MAXCOL ? _(" or more") : "");
+ if (ic)
+ STRCAT(IObuff, _(" Using tag with different case!"));
+ if ((num_matches > prev_num_matches || new_tag)
+ && num_matches > 1)
+ {
+ if (ic)
+ msg_attr(IObuff, hl_attr(HLF_W));
+ else
+ msg(IObuff);
+ msg_scroll = TRUE; /* don't overwrite this message */
+ }
+ else
+ give_warning(IObuff, ic);
+ if (ic && !msg_scrolled && msg_silent == 0)
+ {
+ out_flush();
+ ui_delay(1000L, TRUE);
+ }
+ }
+
+ /*
+ * Jump to the desired match.
+ */
+ if (jumpto_tag(matches[cur_match], forceit, type != DT_CSCOPE)
+ == NOTAGFILE)
+ {
+ /* File not found: try again with another matching tag */
+ if ((type == DT_PREV && cur_match > 0)
+ || ((type == DT_TAG || type == DT_NEXT
+ || type == DT_FIRST)
+ && (max_num_matches != MAXCOL
+ || cur_match < num_matches - 1)))
+ {
+ error_cur_match = cur_match;
+ if (use_tagstack)
+ --tagstackidx;
+ if (type == DT_PREV)
+ --cur_match;
+ else
+ {
+ type = DT_NEXT;
+ ++cur_match;
+ }
+ continue;
+ }
+ EMSG2(_("E429: File \"%s\" does not exist"), nofile_fname);
+ }
+ else
+ {
+ /* We may have jumped to another window, check that
+ * tagstackidx is still valid. */
+ if (use_tagstack && tagstackidx > curwin->w_tagstacklen)
+ tagstackidx = curwin->w_tagstackidx;
+#ifdef FEAT_CSCOPE
+ jumped_to_tag = TRUE;
+#endif
+ }
+ }
+ break;
+ }
+
+end_do_tag:
+ /* Only store the new index when using the tagstack and it's valid. */
+ if (use_tagstack && tagstackidx <= curwin->w_tagstacklen)
+ curwin->w_tagstackidx = tagstackidx;
+#ifdef FEAT_WINDOWS
+ postponed_split = 0; /* don't split next time */
+#endif
+
+#ifdef FEAT_CSCOPE
+ return jumped_to_tag;
+#else
+ return FALSE;
+#endif
+}
+
+/*
+ * Free cached tags.
+ */
+ void
+tag_freematch()
+{
+ vim_free(tagmatchname);
+ tagmatchname = NULL;
+}
+
+ static void
+taglen_advance(l)
+ int l;
+{
+ if (l == MAXCOL)
+ {
+ msg_putchar('\n');
+ msg_advance(24);
+ }
+ else
+ msg_advance(13 + l);
+}
+
+/*
+ * Print the tag stack
+ */
+/*ARGSUSED*/
+ void
+do_tags(eap)
+ exarg_T *eap;
+{
+ int i;
+ char_u *name;
+ taggy_T *tagstack = curwin->w_tagstack;
+ int tagstackidx = curwin->w_tagstackidx;
+ int tagstacklen = curwin->w_tagstacklen;
+
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n # TO tag FROM line in file/text"));
+ for (i = 0; i < tagstacklen; ++i)
+ {
+ if (tagstack[i].tagname != NULL)
+ {
+ name = fm_getname(&(tagstack[i].fmark), 30);
+ if (name == NULL) /* file name not available */
+ continue;
+
+ msg_putchar('\n');
+ sprintf((char *)IObuff, "%c%2d %2d %-15s %5ld ",
+ i == tagstackidx ? '>' : ' ',
+ i + 1,
+ tagstack[i].cur_match + 1,
+ tagstack[i].tagname,
+ tagstack[i].fmark.mark.lnum);
+ msg_outtrans(IObuff);
+ msg_outtrans_attr(name, tagstack[i].fmark.fnum == curbuf->b_fnum
+ ? hl_attr(HLF_D) : 0);
+ vim_free(name);
+ }
+ out_flush(); /* show one line at a time */
+ }
+ if (tagstackidx == tagstacklen) /* idx at top of stack */
+ MSG_PUTS("\n>");
+}
+
+/* When not using a CR for line separator, use vim_fgets() to read tag lines.
+ * For the Mac use tag_fgets(). It can handle any line separator, but is much
+ * slower than vim_fgets().
+ */
+#ifndef USE_CR
+# define tag_fgets vim_fgets
+#endif
+
+#ifdef FEAT_TAG_BINS
+static int tag_strnicmp __ARGS((char_u *s1, char_u *s2, size_t len));
+
+/*
+ * Compare two strings, for length "len", ignoring case the ASCII way.
+ * return 0 for match, < 0 for smaller, > 0 for bigger
+ * Make sure case is folded to uppercase in comparison (like for 'sort -f')
+ */
+ static int
+tag_strnicmp(s1, s2, len)
+ char_u *s1;
+ char_u *s2;
+ size_t len;
+{
+ int i;
+
+ while (len > 0)
+ {
+ i = (int)TOUPPER_ASC(*s1) - (int)TOUPPER_ASC(*s2);
+ if (i != 0)
+ return i; /* this character different */
+ if (*s1 == NUL)
+ break; /* strings match until NUL */
+ ++s1;
+ ++s2;
+ --len;
+ }
+ return 0; /* strings match */
+}
+#endif
+
+/*
+ * Structure to hold info about the tag pattern being used.
+ */
+typedef struct
+{
+ char_u *pat; /* the pattern */
+ int len; /* length of pat[] */
+ char_u *head; /* start of pattern head */
+ int headlen; /* length of head[] */
+ regmatch_T regmatch; /* regexp program, may be NULL */
+} pat_T;
+
+static void prepare_pats __ARGS((pat_T *pats, int has_re));
+
+/*
+ * Extract info from the tag search pattern "pats->pat".
+ */
+ static void
+prepare_pats(pats, has_re)
+ pat_T *pats;
+ int has_re;
+{
+ pats->head = pats->pat;
+ pats->headlen = pats->len;
+ if (has_re)
+ {
+ /* When the pattern starts with '^' or "\\<", binary searching can be
+ * used (much faster). */
+ if (pats->pat[0] == '^')
+ pats->head = pats->pat + 1;
+ else if (pats->pat[0] == '\\' && pats->pat[1] == '<')
+ pats->head = pats->pat + 2;
+ if (pats->head == pats->pat)
+ pats->headlen = 0;
+ else
+ for (pats->headlen = 0; pats->head[pats->headlen] != NUL;
+ ++pats->headlen)
+ if (vim_strchr((char_u *)(p_magic ? ".[~*\\$" : "\\$"),
+ pats->head[pats->headlen]) != NULL)
+ break;
+ if (p_tl != 0 && pats->headlen > p_tl) /* adjust for 'taglength' */
+ pats->headlen = p_tl;
+ }
+
+ if (has_re)
+ pats->regmatch.regprog = vim_regcomp(pats->pat, p_magic ? RE_MAGIC : 0);
+ else
+ pats->regmatch.regprog = NULL;
+}
+
+/*
+ * find_tags() - search for tags in tags files
+ *
+ * Return FAIL if search completely failed (*num_matches will be 0, *matchesp
+ * will be NULL), OK otherwise.
+ *
+ * There is a priority in which type of tag is recognized.
+ *
+ * 6. A static or global tag with a full matching tag for the current file.
+ * 5. A global tag with a full matching tag for another file.
+ * 4. A static tag with a full matching tag for another file.
+ * 3. A static or global tag with an ignore-case matching tag for the
+ * current file.
+ * 2. A global tag with an ignore-case matching tag for another file.
+ * 1. A static tag with an ignore-case matching tag for another file.
+ *
+ * Tags in an emacs-style tags file are always global.
+ *
+ * flags:
+ * TAG_HELP only search for help tags
+ * TAG_NAMES only return name of tag
+ * TAG_REGEXP use "pat" as a regexp
+ * TAG_NOIC don't always ignore case
+ * TAG_KEEP_LANG keep language
+ */
+ int
+find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
+ char_u *pat; /* pattern to search for */
+ int *num_matches; /* return: number of matches found */
+ char_u ***matchesp; /* return: array of matches found */
+ int flags;
+ int mincount; /* MAXCOL: find all matches
+ other: minimal number of matches */
+ char_u *buf_ffname; /* name of buffer for priority */
+{
+ FILE *fp;
+ char_u *lbuf; /* line buffer */
+ char_u *tag_fname; /* name of tag file */
+ int first_file; /* trying first tag file */
+ tagptrs_T tagp;
+ int did_open = FALSE; /* did open a tag file */
+ int stop_searching = FALSE; /* stop when match found or error */
+ int retval = FAIL; /* return value */
+ int is_static; /* current tag line is static */
+ int is_current; /* file name matches */
+ int eof = FALSE; /* found end-of-file */
+ char_u *p;
+ char_u *s;
+ int i;
+#ifdef FEAT_TAG_BINS
+ struct tag_search_info /* Binary search file offsets */
+ {
+ off_t low_offset; /* offset for first char of first line that
+ could match */
+ off_t high_offset; /* offset of char after last line that could
+ match */
+ off_t curr_offset; /* Current file offset in search range */
+ off_t curr_offset_used; /* curr_offset used when skipping back */
+ off_t match_offset; /* Where the binary search found a tag */
+ int low_char; /* first char at low_offset */
+ int high_char; /* first char at high_offset */
+ } search_info;
+ off_t filesize;
+ int tagcmp;
+ off_t offset;
+ int round;
+#endif
+ enum
+ {
+ TS_START, /* at start of file */
+ TS_LINEAR /* linear searching forward, till EOF */
+#ifdef FEAT_TAG_BINS
+ , TS_BINARY, /* binary searching */
+ TS_SKIP_BACK, /* skipping backwards */
+ TS_STEP_FORWARD /* stepping forwards */
+#endif
+ } state; /* Current search state */
+
+ int cmplen;
+ int match; /* matches */
+ int match_no_ic = 0;/* matches with rm_ic == FALSE */
+ int match_re; /* match with regexp */
+ int matchoff = 0;
+
+#ifdef FEAT_EMACS_TAGS
+ /*
+ * Stack for included emacs-tags file.
+ * It has a fixed size, to truncate cyclic includes. jw
+ */
+# define INCSTACK_SIZE 42
+ struct
+ {
+ FILE *fp;
+ char_u *etag_fname;
+ } incstack[INCSTACK_SIZE];
+
+ int incstack_idx = 0; /* index in incstack */
+ char_u *ebuf; /* aditional buffer for etag fname */
+ int is_etag; /* current file is emaces style */
+#endif
+
+ struct match_found
+ {
+ int len; /* nr of chars of match[] to be compared */
+ char_u match[1]; /* actually longer */
+ } *mfp, *mfp2;
+ garray_T ga_match[MT_COUNT];
+ int match_count = 0; /* number of matches found */
+ char_u **matches;
+ int mtt;
+ int len;
+ int help_save;
+#ifdef FEAT_MULTI_LANG
+ int help_pri = 0;
+ char_u *help_lang_find = NULL; /* lang to be found */
+ char_u help_lang[3]; /* lang of current tags file */
+ char_u *saved_pat = NULL; /* copy of pat[] */
+#endif
+
+ /* Use two sets of variables for the pattern: "orgpat" holds the values
+ * for the original pattern and "convpat" converted from 'encoding' to
+ * encoding of the tags file. "pats" point to either one of these. */
+ pat_T *pats;
+ pat_T orgpat; /* holds unconverted pattern info */
+#ifdef FEAT_MBYTE
+ pat_T convpat; /* holds converted pattern info */
+ vimconv_T vimconv;
+#endif
+
+#ifdef FEAT_TAG_BINS
+ int findall = (mincount == MAXCOL || mincount == TAG_MANY);
+ /* find all matching tags */
+ int sort_error = FALSE; /* tags file not sorted */
+ int linear; /* do a linear search */
+ int sortic = FALSE; /* tag file sorted in nocase */
+#endif
+ int line_error = FALSE; /* syntax error */
+ int has_re = (flags & TAG_REGEXP); /* regexp used */
+ int help_only = (flags & TAG_HELP);
+ int name_only = (flags & TAG_NAMES);
+ int noic = (flags & TAG_NOIC);
+ int get_it_again = FALSE;
+#ifdef FEAT_CSCOPE
+ int use_cscope = (flags & TAG_CSCOPE);
+#endif
+ int verbose = (flags & TAG_VERBOSE);
+
+ help_save = curbuf->b_help;
+ orgpat.pat = pat;
+ pats = &orgpat;
+#ifdef FEAT_MBYTE
+ vimconv.vc_type = CONV_NONE;
+#endif
+
+/*
+ * Allocate memory for the buffers that are used
+ */
+ lbuf = alloc(LSIZE);
+ tag_fname = alloc(MAXPATHL + 1);
+#ifdef FEAT_EMACS_TAGS
+ ebuf = alloc(LSIZE);
+#endif
+ for (mtt = 0; mtt < MT_COUNT; ++mtt)
+ ga_init2(&ga_match[mtt], (int)sizeof(struct match_found *), 100);
+
+ /* check for out of memory situation */
+ if (lbuf == NULL || tag_fname == NULL
+#ifdef FEAT_EMACS_TAGS
+ || ebuf == NULL
+#endif
+ )
+ goto findtag_end;
+
+#ifdef FEAT_CSCOPE
+ STRCPY(tag_fname, "from cscope"); /* for error messages */
+#endif
+
+ /*
+ * Initialize a few variables
+ */
+ if (help_only) /* want tags from help file */
+ curbuf->b_help = TRUE; /* will be restored later */
+
+ pats->len = (int)STRLEN(pat);
+#ifdef FEAT_MULTI_LANG
+ if (curbuf->b_help)
+ {
+ /* When "@ab" is specified use only the "ab" language, otherwise
+ * search all languages. */
+ if (pats->len > 3 && pat[pats->len - 3] == '@'
+ && ASCII_ISALPHA(pat[pats->len - 2])
+ && ASCII_ISALPHA(pat[pats->len - 1]))
+ {
+ saved_pat = vim_strnsave(pat, pats->len - 3);
+ if (saved_pat != NULL)
+ {
+ help_lang_find = &pat[pats->len - 2];
+ pats->pat = saved_pat;
+ pats->len -= 3;
+ }
+ }
+ }
+#endif
+ if (p_tl != 0 && pats->len > p_tl) /* adjust for 'taglength' */
+ pats->len = p_tl;
+
+ prepare_pats(pats, has_re);
+
+#ifdef FEAT_TAG_BINS
+ /* This is only to avoid a compiler warning for using search_info
+ * uninitialised. */
+ vim_memset(&search_info, 0, (size_t)1);
+#endif
+
+/*
+ * When finding a specified number of matches, first try with matching case,
+ * so binary search can be used, and try ignore-case matches in a second loop.
+ * When finding all matches, 'tagbsearch' is off, or there is no fixed string
+ * to look for, ignore case right away to avoid going though the tags files
+ * twice.
+ * When the tag file is case-fold sorted, it is either one or the other.
+ * Only ignore case when TAG_NOIC not used or 'ignorecase' set.
+ */
+#ifdef FEAT_TAG_BINS
+ pats->regmatch.rm_ic = ((p_ic || !noic)
+ && (findall || pats->headlen == 0 || !p_tbs));
+ for (round = 1; round <= 2; ++round)
+ {
+ linear = (pats->headlen == 0 || !p_tbs || round == 2);
+#else
+ pats->regmatch.rm_ic = (p_ic || !noic);
+#endif
+
+ /*
+ * Try tag file names from tags option one by one.
+ */
+ for (first_file = TRUE;
+#ifdef FEAT_CSCOPE
+ use_cscope ||
+#endif
+ get_tagfname(first_file, tag_fname) == OK; first_file = FALSE)
+ {
+ /*
+ * A file that doesn't exist is silently ignored. Only when not a
+ * single file is found, an error message is given (further on).
+ */
+#ifdef FEAT_CSCOPE
+ if (use_cscope)
+ fp = NULL; /* avoid GCC warning */
+ else
+#endif
+ {
+#ifdef FEAT_MULTI_LANG
+ if (curbuf->b_help)
+ {
+ /* Prefer help tags according to 'helplang'. Put the
+ * two-letter language name in help_lang[]. */
+ i = STRLEN(tag_fname);
+ if (i > 3 && tag_fname[i - 3] == '-')
+ STRCPY(help_lang, tag_fname + i - 2);
+ else
+ STRCPY(help_lang, "en");
+
+ /* When searching for a specific language skip tags files
+ * for other languages. */
+ if (help_lang_find != NULL
+ && STRICMP(help_lang, help_lang_find) != 0)
+ continue;
+
+ /* For CTRL-] in a help file prefer a match with the same
+ * language. */
+ if ((flags & TAG_KEEP_LANG)
+ && help_lang_find == NULL
+ && curbuf->b_fname != NULL
+ && (i = STRLEN(curbuf->b_fname)) > 4
+ && curbuf->b_fname[i - 1] == 'x'
+ && curbuf->b_fname[i - 4] == '.'
+ && STRNICMP(curbuf->b_fname + i - 3, help_lang, 2) == 0)
+ help_pri = 0;
+ else
+ {
+ help_pri = 1;
+ for (s = p_hlg; *s != NUL; ++s)
+ {
+ if (STRNICMP(s, help_lang, 2) == 0)
+ break;
+ ++help_pri;
+ if ((s = vim_strchr(s, ',')) == NULL)
+ break;
+ }
+ if (s == NULL || *s == NUL)
+ {
+ /* Language not in 'helplang': use last, prefer English,
+ * unless found already. */
+ ++help_pri;
+ if (STRICMP(help_lang, "en") != 0)
+ ++help_pri;
+ }
+ }
+ }
+#endif
+
+ if ((fp = mch_fopen((char *)tag_fname, "r")) == NULL)
+ continue;
+
+ if (p_verbose >= 5)
+ msg_str((char_u *)_("Searching tags file %s"), tag_fname);
+ }
+ did_open = TRUE; /* remember that we found at least one file */
+
+ state = TS_START; /* we're at the start of the file */
+#ifdef FEAT_EMACS_TAGS
+ is_etag = 0; /* default is: not emacs style */
+#endif
+
+ /*
+ * Read and parse the lines in the file one by one
+ */
+ for (;;)
+ {
+ line_breakcheck(); /* check for CTRL-C typed */
+#ifdef FEAT_INS_EXPAND
+ if ((flags & TAG_INS_COMP)) /* Double brackets for gcc */
+ ins_compl_check_keys();
+ if (got_int || completion_interrupted)
+#else
+ if (got_int)
+#endif
+ {
+ stop_searching = TRUE;
+ break;
+ }
+ /* When mincount is TAG_MANY, stop when enough matches have been
+ * found (for completion). */
+ if (mincount == TAG_MANY && match_count >= TAG_MANY)
+ {
+ stop_searching = TRUE;
+ retval = OK;
+ break;
+ }
+ if (get_it_again)
+ goto line_read_in;
+#ifdef FEAT_TAG_BINS
+ /*
+ * For binary search: compute the next offset to use.
+ */
+ if (state == TS_BINARY)
+ {
+ offset = search_info.low_offset + ((search_info.high_offset
+ - search_info.low_offset) / 2);
+ if (offset == search_info.curr_offset)
+ break; /* End the binary search without a match. */
+ else
+ search_info.curr_offset = offset;
+ }
+
+ /*
+ * Skipping back (after a match during binary search).
+ */
+ else if (state == TS_SKIP_BACK)
+ {
+ search_info.curr_offset -= LSIZE * 2;
+ if (search_info.curr_offset < 0)
+ {
+ search_info.curr_offset = 0;
+ rewind(fp);
+ state = TS_STEP_FORWARD;
+ }
+ }
+
+ /*
+ * When jumping around in the file, first read a line to find the
+ * start of the next line.
+ */
+ if (state == TS_BINARY || state == TS_SKIP_BACK)
+ {
+ /* Adjust the search file offset to the correct position */
+ search_info.curr_offset_used = search_info.curr_offset;
+#ifdef HAVE_FSEEKO
+ fseeko(fp, search_info.curr_offset, SEEK_SET);
+#else
+ fseek(fp, (long)search_info.curr_offset, SEEK_SET);
+#endif
+ eof = tag_fgets(lbuf, LSIZE, fp);
+ if (!eof && search_info.curr_offset != 0)
+ {
+ search_info.curr_offset = ftell(fp);
+ if (search_info.curr_offset == search_info.high_offset)
+ {
+ /* oops, gone a bit too far; try from low offset */
+#ifdef HAVE_FSEEKO
+ fseeko(fp, search_info.low_offset, SEEK_SET);
+#else
+ fseek(fp, (long)search_info.low_offset, SEEK_SET);
+#endif
+ search_info.curr_offset = search_info.low_offset;
+ }
+ eof = tag_fgets(lbuf, LSIZE, fp);
+ }
+ /* skip empty and blank lines */
+ while (!eof && vim_isblankline(lbuf))
+ {
+ search_info.curr_offset = ftell(fp);
+ eof = tag_fgets(lbuf, LSIZE, fp);
+ }
+ if (eof)
+ {
+ /* Hit end of file. Skip backwards. */
+ state = TS_SKIP_BACK;
+ search_info.match_offset = ftell(fp);
+ search_info.curr_offset = search_info.curr_offset_used;
+ continue;
+ }
+ }
+
+ /*
+ * Not jumping around in the file: Read the next line.
+ */
+ else
+#endif
+ {
+ /* skip empty and blank lines */
+ do
+ {
+#ifdef FEAT_CSCOPE
+ if (use_cscope)
+ eof = cs_fgets(lbuf, LSIZE);
+ else
+#endif
+ eof = tag_fgets(lbuf, LSIZE, fp);
+ } while (!eof && vim_isblankline(lbuf));
+
+ if (eof)
+ {
+#ifdef FEAT_EMACS_TAGS
+ if (incstack_idx) /* this was an included file */
+ {
+ --incstack_idx;
+ fclose(fp); /* end of this file ... */
+ fp = incstack[incstack_idx].fp;
+ STRCPY(tag_fname, incstack[incstack_idx].etag_fname);
+ vim_free(incstack[incstack_idx].etag_fname);
+ is_etag = 1; /* (only etags can include) */
+ continue; /* ... continue with parent file */
+ }
+ else
+#endif
+ break; /* end of file */
+ }
+ }
+line_read_in:
+
+#ifdef FEAT_EMACS_TAGS
+ /*
+ * Emacs tags line with CTRL-L: New file name on next line.
+ * The file name is followed by a ','.
+ */
+ if (*lbuf == Ctrl_L) /* remember etag file name in ebuf */
+ {
+ is_etag = 1; /* in case at the start */
+ state = TS_LINEAR;
+ if (!tag_fgets(ebuf, LSIZE, fp))
+ {
+ for (p = ebuf; *p && *p != ','; p++)
+ ;
+ *p = NUL;
+
+ /*
+ * atoi(p+1) is the number of bytes before the next ^L
+ * unless it is an include statement.
+ */
+ if (STRNCMP(p + 1, "include", 7) == 0
+ && incstack_idx < INCSTACK_SIZE)
+ {
+ /* Save current "fp" and "tag_fname" in the stack. */
+ if ((incstack[incstack_idx].etag_fname =
+ vim_strsave(tag_fname)) != NULL)
+ {
+ char_u *fullpath_ebuf;
+
+ incstack[incstack_idx].fp = fp;
+ fp = NULL;
+
+ /* Figure out "tag_fname" and "fp" to use for
+ * included file. */
+ fullpath_ebuf = expand_tag_fname(ebuf,
+ tag_fname, FALSE);
+ if (fullpath_ebuf != NULL)
+ {
+ fp = mch_fopen((char *)fullpath_ebuf, "r");
+ if (fp != NULL)
+ {
+ if (STRLEN(fullpath_ebuf) > LSIZE)
+ EMSG2(_("E430: Tag file path truncated for %s\n"), ebuf);
+ STRNCPY(tag_fname, fullpath_ebuf, LSIZE);
+ tag_fname[LSIZE] = NUL;
+ ++incstack_idx;
+ is_etag = 0; /* we can include anything */
+ }
+ vim_free(fullpath_ebuf);
+ }
+ if (fp == NULL)
+ {
+ /* Can't open the included file, skip it and
+ * restore old value of "fp". */
+ fp = incstack[incstack_idx].fp;
+ vim_free(incstack[incstack_idx].etag_fname);
+ }
+ }
+ }
+ }
+ continue;
+ }
+#endif
+
+ /*
+ * When still at the start of the file, check for Emacs tags file
+ * format, and for "not sorted" flag.
+ */
+ if (state == TS_START)
+ {
+#ifdef FEAT_TAG_BINS
+ /*
+ * When there is no tag head, or ignoring case, need to do a
+ * linear search.
+ * When no "!_TAG_" is found, default to binary search. If
+ * the tag file isn't sorted, the second loop will find it.
+ * When "!_TAG_FILE_SORTED" found: start binary search if
+ * flag set.
+ * For cscope, it's always linear.
+ */
+# ifdef FEAT_CSCOPE
+ if (linear || use_cscope)
+# else
+ if (linear)
+# endif
+ state = TS_LINEAR;
+ else if (STRNCMP(lbuf, "!_TAG_", 6) > 0)
+ state = TS_BINARY;
+ else if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
+ {
+ /* Check sorted flag */
+ if (lbuf[18] == '1')
+ state = TS_BINARY;
+ else if (lbuf[18] == '2')
+ {
+ state = TS_BINARY;
+ sortic = TRUE;
+ pats->regmatch.rm_ic = (p_ic || !noic);
+ }
+ else
+ state = TS_LINEAR;
+ }
+
+ if (state == TS_BINARY && pats->regmatch.rm_ic && !sortic)
+ {
+ /* binary search won't work for ignoring case, use linear
+ * search. */
+ linear = TRUE;
+ state = TS_LINEAR;
+ }
+#else
+ state = TS_LINEAR;
+#endif
+
+#ifdef FEAT_TAG_BINS
+ /*
+ * When starting a binary search, get the size of the file and
+ * compute the first offset.
+ */
+ if (state == TS_BINARY)
+ {
+ /* Get the tag file size (don't use mch_fstat(), it's not
+ * portable). */
+ if ((filesize = lseek(fileno(fp),
+ (off_t)0L, SEEK_END)) <= 0)
+ state = TS_LINEAR;
+ else
+ {
+ lseek(fileno(fp), (off_t)0L, SEEK_SET);
+
+ /* Calculate the first read offset in the file. Start
+ * the search in the middle of the file. */
+ search_info.low_offset = 0;
+ search_info.low_char = 0;
+ search_info.high_offset = filesize;
+ search_info.curr_offset = 0;
+ search_info.high_char = 0xff;
+ }
+ continue;
+ }
+#endif
+ }
+
+#ifdef FEAT_MBYTE
+ if (lbuf[0] == '!' && pats == &orgpat
+ && STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
+ {
+ /* Convert the search pattern from 'encoding' to the
+ * specified encoding. */
+ for (p = lbuf + 20; *p > ' ' && *p < 127; ++p)
+ ;
+ *p = NUL;
+ convert_setup(&vimconv, p_enc, lbuf + 20);
+ if (vimconv.vc_type != CONV_NONE)
+ {
+ convpat.pat = string_convert(&vimconv, pats->pat, NULL);
+ if (convpat.pat != NULL)
+ {
+ pats = &convpat;
+ pats->len = (int)STRLEN(pats->pat);
+ prepare_pats(pats, has_re);
+ pats->regmatch.rm_ic = orgpat.regmatch.rm_ic;
+ }
+ }
+
+ /* Prepare for converting a match the other way around. */
+ convert_setup(&vimconv, lbuf + 20, p_enc);
+ continue;
+ }
+#endif
+
+ /*
+ * Figure out where the different strings are in this line.
+ * For "normal" tags: Do a quick check if the tag matches.
+ * This speeds up tag searching a lot!
+ */
+ if (pats->headlen
+#ifdef FEAT_EMACS_TAGS
+ && !is_etag
+#endif
+ )
+ {
+ tagp.tagname = lbuf;
+#ifdef FEAT_TAG_ANYWHITE
+ tagp.tagname_end = skiptowhite(lbuf);
+ if (*tagp.tagname_end == NUL) /* corrupted tag line */
+#else
+ tagp.tagname_end = vim_strchr(lbuf, TAB);
+ if (tagp.tagname_end == NULL) /* corrupted tag line */
+#endif
+ {
+ line_error = TRUE;
+ break;
+ }
+
+#ifdef FEAT_TAG_OLDSTATIC
+ /*
+ * Check for old style static tag: "file:tag file .."
+ */
+ tagp.fname = NULL;
+ for (p = lbuf; p < tagp.tagname_end; ++p)
+ {
+ if (*p == ':')
+ {
+ if (tagp.fname == NULL)
+#ifdef FEAT_TAG_ANYWHITE
+ tagp.fname = skipwhite(tagp.tagname_end);
+#else
+ tagp.fname = tagp.tagname_end + 1;
+#endif
+ if ( fnamencmp(lbuf, tagp.fname, p - lbuf) == 0
+#ifdef FEAT_TAG_ANYWHITE
+ && vim_iswhite(tagp.fname[p - lbuf])
+#else
+ && tagp.fname[p - lbuf] == TAB
+#endif
+ )
+ {
+ /* found one */
+ tagp.tagname = p + 1;
+ break;
+ }
+ }
+ }
+#endif
+
+ /*
+ * Skip this line if the length of the tag is different and
+ * there is no regexp, or the tag is too short.
+ */
+ cmplen = (int)(tagp.tagname_end - tagp.tagname);
+ if (p_tl != 0 && cmplen > p_tl) /* adjust for 'taglength' */
+ cmplen = p_tl;
+ if (has_re && pats->headlen < cmplen)
+ cmplen = pats->headlen;
+ else if (state == TS_LINEAR && pats->headlen != cmplen)
+ continue;
+
+#ifdef FEAT_TAG_BINS
+ if (state == TS_BINARY)
+ {
+ /*
+ * Simplistic check for unsorted tags file.
+ */
+ i = (int)tagp.tagname[0];
+ if (sortic)
+ i = (int)TOUPPER_ASC(tagp.tagname[0]);
+ if (i < search_info.low_char || i > search_info.high_char)
+ sort_error = TRUE;
+
+ /*
+ * Compare the current tag with the searched tag.
+ */
+ if (sortic)
+ tagcmp = tag_strnicmp(tagp.tagname, pats->head,
+ (size_t)cmplen);
+ else
+ tagcmp = STRNCMP(tagp.tagname, pats->head, cmplen);
+
+ /*
+ * A match with a shorter tag means to search forward.
+ * A match with a longer tag means to search backward.
+ */
+ if (tagcmp == 0)
+ {
+ if (cmplen < pats->headlen)
+ tagcmp = -1;
+ else if (cmplen > pats->headlen)
+ tagcmp = 1;
+ }
+
+ if (tagcmp == 0)
+ {
+ /* We've located the tag, now skip back and search
+ * forward until the first matching tag is found.
+ */
+ state = TS_SKIP_BACK;
+ search_info.match_offset = search_info.curr_offset;
+ continue;
+ }
+ if (tagcmp < 0)
+ {
+ search_info.curr_offset = ftell(fp);
+ if (search_info.curr_offset < search_info.high_offset)
+ {
+ search_info.low_offset = search_info.curr_offset;
+ if (sortic)
+ search_info.low_char =
+ TOUPPER_ASC(tagp.tagname[0]);
+ else
+ search_info.low_char = tagp.tagname[0];
+ continue;
+ }
+ }
+ if (tagcmp > 0
+ && search_info.curr_offset != search_info.high_offset)
+ {
+ search_info.high_offset = search_info.curr_offset;
+ if (sortic)
+ search_info.high_char =
+ TOUPPER_ASC(tagp.tagname[0]);
+ else
+ search_info.high_char = tagp.tagname[0];
+ continue;
+ }
+
+ /* No match yet and are at the end of the binary search. */
+ break;
+ }
+ else if (state == TS_SKIP_BACK)
+ {
+ if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
+ state = TS_STEP_FORWARD;
+ else
+ /* Have to skip back more. Restore the curr_offset
+ * used, otherwise we get stuck at a long line. */
+ search_info.curr_offset = search_info.curr_offset_used;
+ continue;
+ }
+ else if (state == TS_STEP_FORWARD)
+ {
+ if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
+ {
+ if ((off_t)ftell(fp) > search_info.match_offset)
+ break; /* past last match */
+ else
+ continue; /* before first match */
+ }
+ }
+ else
+#endif
+ /* skip this match if it can't match */
+ if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
+ continue;
+
+ /*
+ * Can be a matching tag, isolate the file name and command.
+ */
+#ifdef FEAT_TAG_OLDSTATIC
+ if (tagp.fname == NULL)
+#endif
+#ifdef FEAT_TAG_ANYWHITE
+ tagp.fname = skipwhite(tagp.tagname_end);
+#else
+ tagp.fname = tagp.tagname_end + 1;
+#endif
+#ifdef FEAT_TAG_ANYWHITE
+ tagp.fname_end = skiptowhite(tagp.fname);
+ tagp.command = skipwhite(tagp.fname_end);
+ if (*tagp.command == NUL)
+#else
+ tagp.fname_end = vim_strchr(tagp.fname, TAB);
+ tagp.command = tagp.fname_end + 1;
+ if (tagp.fname_end == NULL)
+#endif
+ i = FAIL;
+ else
+ i = OK;
+ }
+ else
+ i = parse_tag_line(lbuf,
+#ifdef FEAT_EMACS_TAGS
+ is_etag,
+#endif
+ &tagp);
+ if (i == FAIL)
+ {
+ line_error = TRUE;
+ break;
+ }
+
+#ifdef FEAT_EMACS_TAGS
+ if (is_etag)
+ tagp.fname = ebuf;
+#endif
+ /*
+ * First try matching with the pattern literally (also when it is
+ * a regexp).
+ */
+ cmplen = (int)(tagp.tagname_end - tagp.tagname);
+ if (p_tl != 0 && cmplen > p_tl) /* adjust for 'taglength' */
+ cmplen = p_tl;
+ /* if tag length does not match, don't try comparing */
+ if (pats->len != cmplen)
+ match = FALSE;
+ else
+ {
+ if (pats->regmatch.rm_ic)
+ {
+ match = (MB_STRNICMP(tagp.tagname, pats->pat, cmplen) == 0);
+ if (match)
+ match_no_ic = (STRNCMP(tagp.tagname, pats->pat,
+ cmplen) == 0);
+ }
+ else
+ match = (STRNCMP(tagp.tagname, pats->pat, cmplen) == 0);
+ }
+
+ /*
+ * Has a regexp: Also find tags matching regexp.
+ */
+ match_re = FALSE;
+ if (!match && pats->regmatch.regprog != NULL)
+ {
+ int cc;
+
+ cc = *tagp.tagname_end;
+ *tagp.tagname_end = NUL;
+ match = vim_regexec(&pats->regmatch, tagp.tagname, (colnr_T)0);
+ if (match)
+ {
+ matchoff = (int)(pats->regmatch.startp[0] - tagp.tagname);
+ if (pats->regmatch.rm_ic)
+ {
+ pats->regmatch.rm_ic = FALSE;
+ match_no_ic = vim_regexec(&pats->regmatch, tagp.tagname,
+ (colnr_T)0);
+ pats->regmatch.rm_ic = TRUE;
+ }
+ }
+ *tagp.tagname_end = cc;
+ match_re = TRUE;
+ }
+
+ /*
+ * If a match is found, add it to ga_match[].
+ */
+ if (match)
+ {
+#ifdef FEAT_CSCOPE
+ if (use_cscope)
+ {
+ /* Don't change the ordering, always use the same table. */
+ mtt = MT_GL_OTH;
+ }
+ else
+#endif
+ {
+ /* Decide in which array to store this match. */
+ is_current = test_for_current(
+#ifdef FEAT_EMACS_TAGS
+ is_etag,
+#endif
+ tagp.fname, tagp.fname_end, tag_fname,
+ buf_ffname);
+#ifdef FEAT_EMACS_TAGS
+ is_static = FALSE;
+ if (!is_etag) /* emacs tags are never static */
+#endif
+ {
+#ifdef FEAT_TAG_OLDSTATIC
+ if (tagp.tagname != lbuf)
+ is_static = TRUE; /* detected static tag before */
+ else
+#endif
+ is_static = test_for_static(&tagp);
+ }
+
+ /* decide in which of the sixteen tables to store this
+ * match */
+ if (is_static)
+ {
+ if (is_current)
+ mtt = MT_ST_CUR;
+ else
+ mtt = MT_ST_OTH;
+ }
+ else
+ {
+ if (is_current)
+ mtt = MT_GL_CUR;
+ else
+ mtt = MT_GL_OTH;
+ }
+ if (pats->regmatch.rm_ic && !match_no_ic)
+ mtt += MT_IC_OFF;
+ if (match_re)
+ mtt += MT_RE_OFF;
+ }
+
+ /*
+ * Add the found match in ga_match[mtt], avoiding duplicates.
+ * Store the info we need later, which depends on the kind of
+ * tags we are dealing with.
+ */
+ if (ga_grow(&ga_match[mtt], 1) == OK)
+ {
+#ifdef FEAT_MBYTE
+ char_u *conv_line = NULL;
+ char_u *lbuf_line = lbuf;
+
+ if (vimconv.vc_type != CONV_NONE)
+ {
+ /* Convert the tag line from the encoding of the tags
+ * file to 'encoding'. Then parse the line again. */
+ conv_line = string_convert(&vimconv, lbuf, NULL);
+ if (conv_line != NULL)
+ {
+ if (parse_tag_line(conv_line,
+#ifdef FEAT_EMACS_TAGS
+ is_etag,
+#endif
+ &tagp) == OK)
+ lbuf_line = conv_line;
+ else
+ /* doesn't work, go back to unconverted line. */
+ (void)parse_tag_line(lbuf,
+#ifdef FEAT_EMACS_TAGS
+ is_etag,
+#endif
+ &tagp);
+ }
+ }
+#else
+# define lbuf_line lbuf
+#endif
+ if (help_only)
+ {
+#ifdef FEAT_MULTI_LANG
+# define ML_EXTRA 3
+#else
+# define ML_EXTRA 0
+#endif
+ /*
+ * Append the help-heuristic number after the
+ * tagname, for sorting it later.
+ */
+ *tagp.tagname_end = NUL;
+ len = (int)(tagp.tagname_end - tagp.tagname);
+ mfp = (struct match_found *)
+ alloc((int)sizeof(struct match_found) + len
+ + 10 + ML_EXTRA);
+ if (mfp != NULL)
+ {
+ /* "len" includes the language and the NUL, but
+ * not the priority. */
+ mfp->len = len + ML_EXTRA + 1;
+#define ML_HELP_LEN 6
+ p = mfp->match;
+ STRCPY(p, tagp.tagname);
+#ifdef FEAT_MULTI_LANG
+ p[len] = '@';
+ STRCPY(p + len + 1, help_lang);
+#endif
+ sprintf((char *)p + len + 1 + ML_EXTRA, "%06d",
+ help_heuristic(tagp.tagname,
+ match_re ? matchoff : 0, !match_no_ic)
+#ifdef FEAT_MULTI_LANG
+ + help_pri
+#endif
+ );
+ }
+ *tagp.tagname_end = TAB;
+ }
+ else if (name_only)
+ {
+ if (get_it_again)
+ {
+ char_u *temp_end = tagp.command;
+
+ if (*temp_end == '/')
+ while (*temp_end && *temp_end != '\r'
+ && *temp_end != '\n'
+ && *temp_end != '$')
+ temp_end++;
+
+ if (tagp.command + 2 < temp_end)
+ {
+ len = (int)(temp_end - tagp.command - 2);
+ mfp = (struct match_found *)alloc(
+ (int)sizeof(struct match_found) + len);
+ if (mfp != NULL)
+ {
+ mfp->len = len + 1; /* include the NUL */
+ p = mfp->match;
+ STRNCPY(p, tagp.command + 2, len);
+ p[len] = NUL;
+ }
+ }
+ else
+ mfp = NULL;
+ get_it_again = FALSE;
+ }
+ else
+ {
+ len = (int)(tagp.tagname_end - tagp.tagname);
+ mfp = (struct match_found *)alloc(
+ (int)sizeof(struct match_found) + len);
+ if (mfp != NULL)
+ {
+ mfp->len = len + 1; /* include the NUL */
+ p = mfp->match;
+ STRNCPY(p, tagp.tagname, len);
+ p[len] = NUL;
+ }
+
+ /* if wanted, re-read line to get long form too */
+ if (State & INSERT)
+ get_it_again = p_sft;
+ }
+ }
+ else
+ {
+ /* Save the tag in a buffer.
+ * Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf>
+ * other tag: <mtt><tag_fname><NUL><NUL><lbuf>
+ * without Emacs tags: <mtt><tag_fname><NUL><lbuf>
+ */
+ len = (int)STRLEN(tag_fname) + (int)STRLEN(lbuf_line) + 3;
+#ifdef FEAT_EMACS_TAGS
+ if (is_etag)
+ len += (int)STRLEN(ebuf) + 1;
+ else
+ ++len;
+#endif
+ mfp = (struct match_found *)alloc(
+ (int)sizeof(struct match_found) + len);
+ if (mfp != NULL)
+ {
+ mfp->len = len;
+ p = mfp->match;
+ p[0] = mtt;
+ STRCPY(p + 1, tag_fname);
+#ifdef BACKSLASH_IN_FILENAME
+ /* Ignore differences in slashes, avoid adding
+ * both path/file and path\file. */
+ slash_adjust(p + 1);
+#endif
+ s = p + 1 + STRLEN(tag_fname) + 1;
+#ifdef FEAT_EMACS_TAGS
+ if (is_etag)
+ {
+ STRCPY(s, ebuf);
+ s += STRLEN(ebuf) + 1;
+ }
+ else
+ *s++ = NUL;
+#endif
+ STRCPY(s, lbuf_line);
+ }
+ }
+
+ if (mfp != NULL)
+ {
+ /*
+ * Don't add identical matches.
+ * This can take a lot of time when finding many
+ * matches, check for CTRL-C now and then.
+ * Add all cscope tags, because they are all listed.
+ */
+#ifdef FEAT_CSCOPE
+ if (use_cscope)
+ i = -1;
+ else
+#endif
+ for (i = ga_match[mtt].ga_len; --i >= 0 && !got_int; )
+ {
+ mfp2 = ((struct match_found **)
+ (ga_match[mtt].ga_data))[i];
+ if (mfp2->len == mfp->len
+ && vim_memcmp(mfp2->match, mfp->match,
+ (size_t)mfp->len) == 0)
+ break;
+ line_breakcheck();
+ }
+ if (i < 0)
+ {
+ ((struct match_found **)(ga_match[mtt].ga_data))
+ [ga_match[mtt].ga_len++] = mfp;
+ ga_match[mtt].ga_room--;
+ ++match_count;
+ }
+ else
+ vim_free(mfp);
+ }
+#ifdef FEAT_MBYTE
+ /* Note: this makes the values in "tagp" invalid! */
+ vim_free(conv_line);
+#endif
+ }
+ else /* Out of memory! Just forget about the rest. */
+ {
+ retval = OK;
+ stop_searching = TRUE;
+ break;
+ }
+ }
+#ifdef FEAT_CSCOPE
+ if (use_cscope && eof)
+ break;
+#endif
+ } /* forever */
+
+ if (line_error)
+ {
+ EMSG2(_("E431: Format error in tags file \"%s\""), tag_fname);
+#ifdef FEAT_CSCOPE
+ if (!use_cscope)
+#endif
+ EMSGN(_("Before byte %ld"), (long)ftell(fp));
+ stop_searching = TRUE;
+ line_error = FALSE;
+ }
+
+#ifdef FEAT_CSCOPE
+ if (!use_cscope)
+#endif
+ fclose(fp);
+#ifdef FEAT_EMACS_TAGS
+ while (incstack_idx)
+ {
+ --incstack_idx;
+ fclose(incstack[incstack_idx].fp);
+ vim_free(incstack[incstack_idx].etag_fname);
+ }
+#endif
+#ifdef FEAT_MBYTE
+ if (pats == &convpat)
+ {
+ /* Go back from converted pattern to original pattern. */
+ vim_free(pats->pat);
+ vim_free(pats->regmatch.regprog);
+ orgpat.regmatch.rm_ic = pats->regmatch.rm_ic;
+ pats = &orgpat;
+ }
+ if (vimconv.vc_type != CONV_NONE)
+ convert_setup(&vimconv, NULL, NULL);
+#endif
+
+#ifdef FEAT_TAG_BINS
+ if (sort_error)
+ {
+ EMSG2(_("E432: Tags file not sorted: %s"), tag_fname);
+ sort_error = FALSE;
+ }
+#endif
+
+ /*
+ * Stop searching if sufficient tags have been found.
+ */
+ if (match_count >= mincount)
+ {
+ retval = OK;
+ stop_searching = TRUE;
+ }
+
+#ifdef FEAT_CSCOPE
+ if (stop_searching || use_cscope)
+#else
+ if (stop_searching)
+#endif
+ break;
+
+ } /* end of for-each-file loop */
+
+#ifdef FEAT_TAG_BINS
+ /* stop searching when already did a linear search, or when
+ * TAG_NOIC used, and 'ignorecase' not set
+ * or already did case-ignore search */
+ if (stop_searching || linear || (!p_ic && noic) || pats->regmatch.rm_ic)
+ break;
+# ifdef FEAT_CSCOPE
+ if (use_cscope)
+ break;
+# endif
+ pats->regmatch.rm_ic = TRUE; /* try another time while ignoring case */
+ }
+#endif
+
+ if (!stop_searching)
+ {
+ if (!did_open && verbose) /* never opened any tags file */
+ EMSG(_("E433: No tags file"));
+ retval = OK; /* It's OK even when no tag found */
+ }
+
+findtag_end:
+ vim_free(lbuf);
+ vim_free(pats->regmatch.regprog);
+ vim_free(tag_fname);
+#ifdef FEAT_EMACS_TAGS
+ vim_free(ebuf);
+#endif
+
+ /*
+ * Move the matches from the ga_match[] arrays into one list of
+ * matches. When retval == FAIL, free the matches.
+ */
+ if (retval == FAIL)
+ match_count = 0;
+
+ if (match_count > 0)
+ matches = (char_u **)lalloc((long_u)(match_count * sizeof(char_u *)),
+ TRUE);
+ else
+ matches = NULL;
+ match_count = 0;
+ for (mtt = 0; mtt < MT_COUNT; ++mtt)
+ {
+ for (i = 0; i < ga_match[mtt].ga_len; ++i)
+ {
+ mfp = ((struct match_found **)(ga_match[mtt].ga_data))[i];
+ if (matches == NULL)
+ vim_free(mfp);
+ else
+ {
+ /* To avoid allocating memory again we turn the struct
+ * match_found into a string. For help the priority was not
+ * included in the length. */
+ mch_memmove(mfp, mfp->match,
+ (size_t)(mfp->len + (help_only ? ML_HELP_LEN : 0)));
+ matches[match_count++] = (char_u *)mfp;
+ }
+ }
+ ga_clear(&ga_match[mtt]);
+ }
+
+ *matchesp = matches;
+ *num_matches = match_count;
+
+ curbuf->b_help = help_save;
+#ifdef FEAT_MULTI_LANG
+ vim_free(saved_pat);
+#endif
+
+ return retval;
+}
+
+static garray_T tag_fnames = GA_EMPTY;
+static void found_tagfile_cb __ARGS((char_u *fname));
+
+/*
+ * Callback function for finding all "tags" and "tags-??" files in
+ * 'runtimepath' doc directories.
+ */
+ static void
+found_tagfile_cb(fname)
+ char_u *fname;
+{
+ if (ga_grow(&tag_fnames, 1) == OK)
+ {
+ ((char_u **)(tag_fnames.ga_data))[tag_fnames.ga_len++] =
+ vim_strsave(fname);
+ --tag_fnames.ga_room;
+ }
+}
+
+/*
+ * Get the next name of a tag file from the tag file list.
+ * For help files, use "tags" file only.
+ *
+ * Return FAIL if no more tag file names, OK otherwise.
+ */
+ static int
+get_tagfname(first, buf)
+ int first; /* TRUE when first file name is wanted */
+ char_u *buf; /* pointer to buffer of MAXPATHL chars */
+{
+ static void *search_ctx = NULL;
+ static char_u *np = NULL;
+ static int did_filefind_init;
+ static int hf_idx = 0;
+ char_u *fname = NULL;
+ char_u *r_ptr;
+
+ if (first)
+ {
+ if (curbuf->b_help)
+ {
+ /*
+ * For a help window find "doc/tags" and "doc/tags-??" in all
+ * directories in 'runtimepath'.
+ */
+ ga_clear_strings(&tag_fnames);
+ ga_init2(&tag_fnames, (int)sizeof(char_u *), 10);
+ do_in_runtimepath((char_u *)
+#ifdef FEAT_MULTI_LANG
+ "doc/tags doc/tags-??"
+#else
+ "doc/tags"
+#endif
+ , TRUE, found_tagfile_cb);
+ hf_idx = 0;
+ }
+ else if (*curbuf->b_p_tags != NUL)
+ np = curbuf->b_p_tags;
+ else
+ np = p_tags;
+ vim_findfile_free_visited(search_ctx);
+ did_filefind_init = FALSE;
+ }
+
+ if (curbuf->b_help)
+ {
+ if (hf_idx >= tag_fnames.ga_len)
+ {
+ /* Not found in 'runtimepath', use 'helpfile', if it exists and
+ * wasn't used yet, replacing "help.txt" with "tags". */
+ if (hf_idx > tag_fnames.ga_len || *p_hf == NUL)
+ return FAIL;
+ ++hf_idx;
+ STRCPY(buf, p_hf);
+ STRCPY(gettail(buf), "tags");
+ }
+ else
+ {
+ STRNCPY(buf, ((char_u **)(tag_fnames.ga_data))[hf_idx++], MAXPATHL);
+ buf[MAXPATHL - 1] = NUL;
+ }
+ }
+ else
+ {
+ /* tried already (or bogus call) */
+ if (np == NULL)
+ return FAIL;
+
+ /*
+ * Loop until we have found a file name that can be used.
+ * There are two states:
+ * did_filefind_init == FALSE: setup for next part in 'tags'.
+ * did_filefind_init == TRUE: find next file in this part.
+ */
+ for (;;)
+ {
+ if (did_filefind_init)
+ {
+ fname = vim_findfile(search_ctx);
+ if (fname != NULL)
+ break;
+
+ did_filefind_init = FALSE;
+ }
+ else
+ {
+ char_u *filename = NULL;
+
+ /* Stop when used all parts of 'tags'. */
+ if (*np == NUL)
+ {
+ vim_findfile_cleanup(search_ctx);
+ search_ctx = NULL;
+ return FAIL;
+ }
+
+ /*
+ * Copy next file name into buf.
+ */
+ buf[0] = NUL;
+ (void)copy_option_part(&np, buf, MAXPATHL - 1, " ,");
+
+#ifdef FEAT_PATH_EXTRA
+ r_ptr = vim_findfile_stopdir(buf);
+#else
+ r_ptr = NULL;
+#endif
+ /* move the filename one char forward and truncate the
+ * filepath with a NUL */
+ filename = gettail(buf);
+ mch_memmove(filename + 1, filename, STRLEN(filename) + 1);
+ *filename++ = NUL;
+
+ search_ctx = vim_findfile_init(buf, filename, r_ptr, 100,
+ FALSE, /* don't free visited list */
+ FALSE, /* we search for a file */
+ search_ctx, TRUE, curbuf->b_ffname);
+ if (search_ctx != NULL)
+ did_filefind_init = TRUE;
+ }
+ }
+ STRCPY(buf, fname);
+ vim_free(fname);
+ }
+
+ return OK;
+}
+
+/*
+ * Parse one line from the tags file. Find start/end of tag name, start/end of
+ * file name and start of search pattern.
+ *
+ * If is_etag is TRUE, tagp->fname and tagp->fname_end are not set.
+ *
+ * Return FAIL if there is a format error in this line, OK otherwise.
+ */
+ static int
+parse_tag_line(lbuf,
+#ifdef FEAT_EMACS_TAGS
+ is_etag,
+#endif
+ tagp)
+ char_u *lbuf; /* line to be parsed */
+#ifdef FEAT_EMACS_TAGS
+ int is_etag;
+#endif
+ tagptrs_T *tagp;
+{
+ char_u *p;
+
+#ifdef FEAT_EMACS_TAGS
+ char_u *p_7f;
+
+ if (is_etag)
+ {
+ /*
+ * There are two formats for an emacs tag line:
+ * 1: struct EnvBase ^?EnvBase^A139,4627
+ * 2: #define ARPB_WILD_WORLD ^?153,5194
+ */
+ p_7f = vim_strchr(lbuf, 0x7f);
+ if (p_7f == NULL)
+ return FAIL;
+
+ /* Find ^A. If not found the line number is after the 0x7f */
+ p = vim_strchr(p_7f, Ctrl_A);
+ if (p == NULL)
+ p = p_7f + 1;
+ else
+ ++p;
+
+ if (!VIM_ISDIGIT(*p)) /* check for start of line number */
+ return FAIL;
+ tagp->command = p;
+
+
+ if (p[-1] == Ctrl_A) /* first format: explicit tagname given */
+ {
+ tagp->tagname = p_7f + 1;
+ tagp->tagname_end = p - 1;
+ }
+ else /* second format: isolate tagname */
+ {
+ /* find end of tagname */
+ for (p = p_7f - 1; !vim_iswordc(*p); --p)
+ if (p == lbuf)
+ return FAIL;
+ tagp->tagname_end = p + 1;
+ while (p >= lbuf && vim_iswordc(*p))
+ --p;
+ tagp->tagname = p + 1;
+ }
+ }
+ else /* not an Emacs tag */
+ {
+#endif
+ /* Isolate the tagname, from lbuf up to the first white */
+ tagp->tagname = lbuf;
+#ifdef FEAT_TAG_ANYWHITE
+ p = skiptowhite(lbuf);
+#else
+ p = vim_strchr(lbuf, TAB);
+ if (p == NULL)
+ return FAIL;
+#endif
+ tagp->tagname_end = p;
+
+ /* Isolate file name, from first to second white space */
+#ifdef FEAT_TAG_ANYWHITE
+ p = skipwhite(p);
+#else
+ if (*p != NUL)
+ ++p;
+#endif
+ tagp->fname = p;
+#ifdef FEAT_TAG_ANYWHITE
+ p = skiptowhite(p);
+#else
+ p = vim_strchr(p, TAB);
+ if (p == NULL)
+ return FAIL;
+#endif
+ tagp->fname_end = p;
+
+ /* find start of search command, after second white space */
+#ifdef FEAT_TAG_ANYWHITE
+ p = skipwhite(p);
+#else
+ if (*p != NUL)
+ ++p;
+#endif
+ if (*p == NUL)
+ return FAIL;
+ tagp->command = p;
+#ifdef FEAT_EMACS_TAGS
+ }
+#endif
+
+ return OK;
+}
+
+/*
+ * Check if tagname is a static tag
+ *
+ * Static tags produced by the older ctags program have the format:
+ * 'file:tag file /pattern'.
+ * This is only recognized when both occurences of 'file' are the same, to
+ * avoid recognizing "string::string" or ":exit".
+ *
+ * Static tags produced by the new ctags program have the format:
+ * 'tag file /pattern/;"<Tab>file:' "
+ *
+ * Return TRUE if it is a static tag and adjust *tagname to the real tag.
+ * Return FALSE if it is not a static tag.
+ */
+ static int
+test_for_static(tagp)
+ tagptrs_T *tagp;
+{
+ char_u *p;
+
+#ifdef FEAT_TAG_OLDSTATIC
+ int len;
+
+ /*
+ * Check for old style static tag: "file:tag file .."
+ */
+ len = (int)(tagp->fname_end - tagp->fname);
+ p = tagp->tagname + len;
+ if ( p < tagp->tagname_end
+ && *p == ':'
+ && fnamencmp(tagp->tagname, tagp->fname, len) == 0)
+ {
+ tagp->tagname = p + 1;
+ return TRUE;
+ }
+#endif
+
+ /*
+ * Check for new style static tag ":...<Tab>file:[<Tab>...]"
+ */
+ p = tagp->command;
+ while ((p = vim_strchr(p, '\t')) != NULL)
+ {
+ ++p;
+ if (STRNCMP(p, "file:", 5) == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*
+ * Parse a line from a matching tag. Does not change the line itself.
+ *
+ * The line that we get looks like this:
+ * Emacs tag: <mtt><tag_fname><NUL><ebuf><NUL><lbuf>
+ * other tag: <mtt><tag_fname><NUL><NUL><lbuf>
+ * without Emacs tags: <mtt><tag_fname><NUL><lbuf>
+ *
+ * Return OK or FAIL.
+ */
+ static int
+parse_match(lbuf, tagp)
+ char_u *lbuf; /* input: matching line */
+ tagptrs_T *tagp; /* output: pointers into the line */
+{
+ int retval;
+ char_u *p;
+ char_u *pc, *pt;
+
+ tagp->tag_fname = lbuf + 1;
+ lbuf += STRLEN(tagp->tag_fname) + 2;
+#ifdef FEAT_EMACS_TAGS
+ if (*lbuf)
+ {
+ tagp->is_etag = TRUE;
+ tagp->fname = lbuf;
+ lbuf += STRLEN(lbuf);
+ tagp->fname_end = lbuf++;
+ }
+ else
+ {
+ tagp->is_etag = FALSE;
+ ++lbuf;
+ }
+#endif
+
+ /* Find search pattern and the file name for non-etags. */
+ retval = parse_tag_line(lbuf,
+#ifdef FEAT_EMACS_TAGS
+ tagp->is_etag,
+#endif
+ tagp);
+
+ tagp->tagkind = NULL;
+ tagp->command_end = NULL;
+
+ if (retval == OK)
+ {
+ /* Try to find a kind field: "kind:<kind>" or just "<kind>"*/
+ p = tagp->command;
+ if (find_extra(&p) == OK)
+ {
+ tagp->command_end = p;
+ p += 2; /* skip ";\"" */
+ if (*p++ == TAB)
+ while (ASCII_ISALPHA(*p))
+ {
+ if (STRNCMP(p, "kind:", 5) == 0)
+ {
+ tagp->tagkind = p + 5;
+ break;
+ }
+ pc = vim_strchr(p, ':');
+ pt = vim_strchr(p, '\t');
+ if (pc == NULL || (pt != NULL && pc > pt))
+ {
+ tagp->tagkind = p;
+ break;
+ }
+ if (pt == NULL)
+ break;
+ p = pt + 1;
+ }
+ }
+ if (tagp->tagkind != NULL)
+ {
+ for (p = tagp->tagkind;
+ *p && *p != '\t' && *p != '\r' && *p != '\n'; ++p)
+ ;
+ tagp->tagkind_end = p;
+ }
+ }
+ return retval;
+}
+
+/*
+ * Find out the actual file name of a tag. Concatenate the tags file name
+ * with the matching tag file name.
+ * Returns an allocated string or NULL (out of memory).
+ */
+ static char_u *
+tag_full_fname(tagp)
+ tagptrs_T *tagp;
+{
+ char_u *fullname;
+ int c;
+
+#ifdef FEAT_EMACS_TAGS
+ if (tagp->is_etag)
+ c = 0; /* to shut up GCC */
+ else
+#endif
+ {
+ c = *tagp->fname_end;
+ *tagp->fname_end = NUL;
+ }
+ fullname = expand_tag_fname(tagp->fname, tagp->tag_fname, FALSE);
+
+#ifdef FEAT_EMACS_TAGS
+ if (!tagp->is_etag)
+#endif
+ *tagp->fname_end = c;
+
+ return fullname;
+}
+
+/*
+ * Jump to a tag that has been found in one of the tag files
+ *
+ * returns OK for success, NOTAGFILE when file not found, FAIL otherwise.
+ */
+ static int
+jumpto_tag(lbuf, forceit, keep_help)
+ char_u *lbuf; /* line from the tags file for this tag */
+ int forceit; /* :ta with ! */
+ int keep_help; /* keep help flag (FALSE for cscope) */
+{
+ int save_secure;
+ int save_magic;
+ int save_p_ws, save_p_scs, save_p_ic;
+ linenr_T save_lnum;
+ int csave = 0;
+ char_u *str;
+ char_u *pbuf; /* search pattern buffer */
+ char_u *pbuf_end;
+ char_u *tofree_fname = NULL;
+ char_u *fname;
+ tagptrs_T tagp;
+ int retval = FAIL;
+ int getfile_result;
+ int search_options;
+#ifdef FEAT_SEARCH_EXTRA
+ int save_no_hlsearch;
+#endif
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ win_T *curwin_save = NULL;
+#endif
+ char_u *full_fname = NULL;
+#ifdef FEAT_FOLDING
+ int old_KeyTyped = KeyTyped; /* getting the file may reset it */
+#endif
+
+ pbuf = alloc(LSIZE);
+
+ /* parse the match line into the tagp structure */
+ if (pbuf == NULL || parse_match(lbuf, &tagp) == FAIL)
+ {
+ tagp.fname_end = NULL;
+ goto erret;
+ }
+
+ /* truncate the file name, so it can be used as a string */
+ csave = *tagp.fname_end;
+ *tagp.fname_end = NUL;
+ fname = tagp.fname;
+
+ /* copy the command to pbuf[], remove trailing CR/NL */
+ str = tagp.command;
+ for (pbuf_end = pbuf; *str && *str != '\n' && *str != '\r'; )
+ {
+#ifdef FEAT_EMACS_TAGS
+ if (tagp.is_etag && *str == ',')/* stop at ',' after line number */
+ break;
+#endif
+ *pbuf_end++ = *str++;
+ }
+ *pbuf_end = NUL;
+
+#ifdef FEAT_EMACS_TAGS
+ if (!tagp.is_etag)
+#endif
+ {
+ /*
+ * Remove the "<Tab>fieldname:value" stuff; we don't need it here.
+ */
+ str = pbuf;
+ if (find_extra(&str) == OK)
+ {
+ pbuf_end = str;
+ *pbuf_end = NUL;
+ }
+ }
+
+ /*
+ * Expand file name, when needed (for environment variables).
+ * If 'tagrelative' option set, may change file name.
+ */
+ fname = expand_tag_fname(fname, tagp.tag_fname, TRUE);
+ if (fname == NULL)
+ goto erret;
+ tofree_fname = fname; /* free() it later */
+
+ /*
+ * Check if the file with the tag exists before abandoning the current
+ * file. Also accept a file name for which there is a matching BufReadCmd
+ * autocommand event (e.g., http://sys/file).
+ */
+ if (mch_getperm(fname) < 0
+#ifdef FEAT_AUTOCMD
+ && !has_autocmd(EVENT_BUFREADCMD, fname)
+#endif
+ )
+ {
+ retval = NOTAGFILE;
+ vim_free(nofile_fname);
+ nofile_fname = vim_strsave(fname);
+ if (nofile_fname == NULL)
+ nofile_fname = empty_option;
+ goto erret;
+ }
+
+ ++RedrawingDisabled;
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ {
+ /* don't split again below */
+ postponed_split = 0;
+ /* Save current window */
+ curwin_save = curwin;
+ /*
+ * If we are reusing a window, we may change dir when
+ * entering it (autocommands) so turn the tag filename
+ * into a fullpath
+ */
+ if (!curwin->w_p_pvw)
+ {
+ full_fname = FullName_save(fname, FALSE);
+ fname = full_fname;
+
+ /*
+ * Make the preview window the current window.
+ * Open a preview window when needed.
+ */
+ prepare_tagpreview();
+ }
+ }
+
+ /* if it was a CTRL-W CTRL-] command split window now */
+ if (postponed_split)
+ {
+ win_split(postponed_split > 0 ? postponed_split : 0,
+ postponed_split_flags);
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ }
+#endif
+
+ if (keep_help)
+ {
+ /* A :ta from a help file will keep the b_help flag set. For ":ptag"
+ * we need to use the flag from the window where we came from. */
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview)
+ keep_help_flag = curwin_save->w_buffer->b_help;
+ else
+#endif
+ keep_help_flag = curbuf->b_help;
+ }
+ getfile_result = getfile(0, fname, NULL, TRUE, (linenr_T)0, forceit);
+ keep_help_flag = FALSE;
+
+ if (getfile_result <= 0) /* got to the right file */
+ {
+ curwin->w_set_curswant = TRUE;
+#ifdef FEAT_WINDOWS
+ postponed_split = 0;
+#endif
+
+ save_secure = secure;
+ secure = 1;
+#ifdef HAVE_SANDBOX
+ ++sandbox;
+#endif
+ save_magic = p_magic;
+ p_magic = FALSE; /* always execute with 'nomagic' */
+#ifdef FEAT_SEARCH_EXTRA
+ /* Save value of no_hlsearch, jumping to a tag is not a real search */
+ save_no_hlsearch = no_hlsearch;
+#endif
+
+ /*
+ * If 'cpoptions' contains 't', store the search pattern for the "n"
+ * command. If 'cpoptions' does not contain 't', the search pattern
+ * is not stored.
+ */
+ if (vim_strchr(p_cpo, CPO_TAGPAT) != NULL)
+ search_options = 0;
+ else
+ search_options = SEARCH_KEEP;
+
+ /*
+ * If the command is a search, try here.
+ *
+ * Reset 'smartcase' for the search, since the search pattern was not
+ * typed by the user.
+ * Only use do_search() when there is a full search command, without
+ * anything following.
+ */
+ str = pbuf;
+ if (pbuf[0] == '/' || pbuf[0] == '?')
+ str = skip_regexp(pbuf + 1, pbuf[0], FALSE, NULL) + 1;
+ if (str > pbuf_end - 1) /* search command with nothing following */
+ {
+ save_p_ws = p_ws;
+ save_p_ic = p_ic;
+ save_p_scs = p_scs;
+ p_ws = TRUE; /* need 'wrapscan' for backward searches */
+ p_ic = FALSE; /* don't ignore case now */
+ p_scs = FALSE;
+#if 0 /* disabled for now */
+#ifdef FEAT_CMDHIST
+ /* put pattern in search history */
+ add_to_history(HIST_SEARCH, pbuf + 1, TRUE, pbuf[0]);
+#endif
+#endif
+ save_lnum = curwin->w_cursor.lnum;
+ curwin->w_cursor.lnum = 0; /* start search before first line */
+ if (do_search(NULL, pbuf[0], pbuf + 1, (long)1, search_options))
+ retval = OK;
+ else
+ {
+ int found = 1;
+ int cc;
+
+ /*
+ * try again, ignore case now
+ */
+ p_ic = TRUE;
+ if (!do_search(NULL, pbuf[0], pbuf + 1, (long)1,
+ search_options))
+ {
+ /*
+ * Failed to find pattern, take a guess: "^func ("
+ */
+ found = 2;
+ (void)test_for_static(&tagp);
+ cc = *tagp.tagname_end;
+ *tagp.tagname_end = NUL;
+ sprintf((char *)pbuf, "^%s\\s\\*(", tagp.tagname);
+ if (!do_search(NULL, '/', pbuf, (long)1, search_options))
+ {
+ /* Guess again: "^char * \<func (" */
+ sprintf((char *)pbuf, "^\\[#a-zA-Z_]\\.\\*\\<%s\\s\\*(",
+ tagp.tagname);
+ if (!do_search(NULL, '/', pbuf, (long)1,
+ search_options))
+ found = 0;
+ }
+ *tagp.tagname_end = cc;
+ }
+ if (found == 0)
+ {
+ EMSG(_("E434: Can't find tag pattern"));
+ curwin->w_cursor.lnum = save_lnum;
+ }
+ else
+ {
+ /*
+ * Only give a message when really guessed, not when 'ic'
+ * is set and match found while ignoring case.
+ */
+ if (found == 2 || !save_p_ic)
+ {
+ MSG(_("E435: Couldn't find tag, just guessing!"));
+ if (!msg_scrolled && msg_silent == 0)
+ {
+ out_flush();
+ ui_delay(1000L, TRUE);
+ }
+ }
+ retval = OK;
+ }
+ }
+ p_ws = save_p_ws;
+ p_ic = save_p_ic;
+ p_scs = save_p_scs;
+
+ /* A search command may have positioned the cursor beyond the end
+ * of the line. May need to correct that here. */
+ check_cursor();
+ }
+ else
+ {
+ curwin->w_cursor.lnum = 1; /* start command in line 1 */
+ do_cmdline_cmd(pbuf);
+ retval = OK;
+ }
+
+ /*
+ * When the command has done something that is not allowed make sure
+ * the error message can be seen.
+ */
+ if (secure == 2)
+ wait_return(TRUE);
+ secure = save_secure;
+ p_magic = save_magic;
+#ifdef HAVE_SANDBOX
+ --sandbox;
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ /* restore no_hlsearch when keeping the old search pattern */
+ if (search_options)
+ no_hlsearch = save_no_hlsearch;
+#endif
+
+ /* Return OK if jumped to another file (at least we found the file!). */
+ if (getfile_result == -1)
+ retval = OK;
+
+ if (retval == OK)
+ {
+ /*
+ * For a help buffer: Put the cursor line at the top of the window,
+ * the help subject will be below it.
+ */
+ if (curbuf->b_help)
+ set_topline(curwin, curwin->w_cursor.lnum);
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_TAG) && old_KeyTyped)
+ foldOpenCursor();
+#endif
+ }
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ if (g_do_tagpreview && curwin != curwin_save && win_valid(curwin_save))
+ {
+ /* Return cursor to where we were */
+ validate_cursor();
+ redraw_later(VALID);
+ win_enter(curwin_save, TRUE);
+ }
+#endif
+
+ --RedrawingDisabled;
+ }
+ else
+ {
+ --RedrawingDisabled;
+#ifdef FEAT_WINDOWS
+ if (postponed_split) /* close the window */
+ {
+ win_close(curwin, FALSE);
+ postponed_split = 0;
+ }
+#endif
+ }
+
+erret:
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+ g_do_tagpreview = 0; /* For next time */
+#endif
+ if (tagp.fname_end != NULL)
+ *tagp.fname_end = csave;
+ vim_free(pbuf);
+ vim_free(tofree_fname);
+ vim_free(full_fname);
+
+ return retval;
+}
+
+/*
+ * If "expand" is TRUE, expand wildcards in fname.
+ * If 'tagrelative' option set, change fname (name of file containing tag)
+ * according to tag_fname (name of tag file containing fname).
+ * Returns a pointer to allocated memory (or NULL when out of memory).
+ */
+ static char_u *
+expand_tag_fname(fname, tag_fname, expand)
+ char_u *fname;
+ char_u *tag_fname;
+ int expand;
+{
+ char_u *p;
+ char_u *retval;
+ char_u *expanded_fname = NULL;
+ expand_T xpc;
+
+ /*
+ * Expand file name (for environment variables) when needed.
+ */
+ if (expand && mch_has_wildcard(fname))
+ {
+ ExpandInit(&xpc);
+ xpc.xp_context = EXPAND_FILES;
+ expanded_fname = ExpandOne(&xpc, (char_u *)fname, NULL,
+ WILD_LIST_NOTFOUND|WILD_SILENT, WILD_EXPAND_FREE);
+ ExpandCleanup(&xpc);
+ if (expanded_fname != NULL)
+ fname = expanded_fname;
+ }
+
+ if ((p_tr || curbuf->b_help)
+ && !vim_isAbsName(fname)
+ && (p = gettail(tag_fname)) != tag_fname)
+ {
+ retval = alloc(MAXPATHL);
+ if (retval != NULL)
+ {
+ STRCPY(retval, tag_fname);
+ STRNCPY(retval + (p - tag_fname), fname,
+ MAXPATHL - (p - tag_fname));
+ /*
+ * Translate names like "src/a/../b/file.c" into "src/b/file.c".
+ */
+ simplify_filename(retval);
+ }
+ }
+ else
+ retval = vim_strsave(fname);
+
+ vim_free(expanded_fname);
+
+ return retval;
+}
+
+/*
+ * Moves the tail part of the path (including the terminating NUL) pointed to
+ * by "tail" to the new location pointed to by "here". This should accomodate
+ * an overlapping move.
+ */
+#define movetail(here, tail) mch_memmove(here, tail, STRLEN(tail) + (size_t)1)
+
+/*
+ * Converts a file name into a canonical form. It simplifies a file name into
+ * its simplest form by stripping out unneeded components, if any. The
+ * resulting file name is simplified in place and will either be the same
+ * length as that supplied, or shorter.
+ */
+ void
+simplify_filename(filename)
+ char_u *filename;
+{
+#ifndef AMIGA /* Amiga doesn't have "..", it uses "/" */
+ int components = 0;
+ char_u *p, *tail, *start;
+ int stripping_disabled = FALSE;
+ int relative = TRUE;
+
+ p = filename;
+#ifdef BACKSLASH_IN_FILENAME
+ if (p[1] == ':') /* skip "x:" */
+ p += 2;
+#endif
+
+ if (vim_ispathsep(*p))
+ {
+ relative = FALSE;
+ do
+ ++p;
+ while (vim_ispathsep(*p));
+ }
+ start = p; /* remember start after "c:/" or "/" or "///" */
+
+ do
+ {
+ /* At this point "p" is pointing to the char following a single "/"
+ * or "p" is at the "start" of the (absolute or relative) path name. */
+#ifdef VMS
+ /* VMS allows device:[path] - don't strip the [ in directory */
+ if ((*p == '[' || *p == '<') && p > filename && p[-1] == ':')
+ {
+ /* :[ or :< composition: vms directory component */
+ ++components;
+ p = getnextcomp(p + 1);
+ }
+ /* allow remote calls as host"user passwd"::device:[path] */
+ else if (p[0] == ':' && p[1] == ':' && p > filename && p[-1] == '"' )
+ {
+ /* ":: composition: vms host/passwd component */
+ ++components;
+ p = getnextcomp(p + 2);
+ }
+ else
+#endif
+ if (vim_ispathsep(*p))
+ movetail(p, p + 1); /* remove duplicate "/" */
+ else if (p[0] == '.' && (vim_ispathsep(p[1]) || p[1] == NUL))
+ {
+ if (p == start && relative)
+ p += 1 + (p[1] != NUL); /* keep single "." or leading "./" */
+ else
+ {
+ /* Strip "./" or ".///". If we are at the end of the file name
+ * and there is no trailing path separator, either strip "/." if
+ * we are after "start", or strip "." if we are at the beginning
+ * of an absolute path name . */
+ tail = p + 1;
+ if (p[1] != NUL)
+ while (vim_ispathsep(*tail))
+ ++tail;
+ else if (p > start)
+ --p; /* strip preceding path separator */
+ movetail(p, tail);
+ }
+ }
+ else if (p[0] == '.' && p[1] == '.' &&
+ (vim_ispathsep(p[2]) || p[2] == NUL))
+ {
+ /* Skip to after ".." or "../" or "..///". */
+ tail = p + 2;
+ while (vim_ispathsep(*tail))
+ ++tail;
+
+ if (components > 0) /* strip one preceding component */
+ {
+ int do_strip = FALSE;
+ char_u saved_char;
+ struct stat st;
+
+ /* Don't strip for an erroneous file name. */
+ if (!stripping_disabled)
+ {
+ /* If the preceding component does not exist in the file
+ * system, we strip it. On Unix, we don't accept a symbolic
+ * link that refers to a non-existent file. */
+ saved_char = p[-1];
+ p[-1] = NUL;
+#ifdef UNIX
+ if (mch_lstat((char *)filename, &st) < 0)
+#else
+ if (mch_stat((char *)filename, &st) < 0)
+#endif
+ do_strip = TRUE;
+ p[-1] = saved_char;
+
+ --p;
+ /* Skip back to after previous '/'. */
+ while (p > start && !vim_ispathsep(p[-1]))
+ --p;
+
+ if (!do_strip)
+ {
+ /* If the component exists in the file system, check
+ * that stripping it won't change the meaning of the
+ * file name. First get information about the
+ * unstripped file name. This may fail if the component
+ * to strip is not a searchable directory (but a regular
+ * file, for instance), since the trailing "/.." cannot
+ * be applied then. We don't strip it then since we
+ * don't want to replace an erroneous file name by
+ * a valid one, and we disable stripping of later
+ * components. */
+ saved_char = *tail;
+ *tail = NUL;
+ if (mch_stat((char *)filename, &st) >= 0)
+ do_strip = TRUE;
+ else
+ stripping_disabled = TRUE;
+ *tail = saved_char;
+#ifdef UNIX
+ if (do_strip)
+ {
+ struct stat new_st;
+
+ /* On Unix, the check for the unstripped file name
+ * above works also for a symbolic link pointing to
+ * a searchable directory. But then the parent of
+ * the directory pointed to by the link must be the
+ * same as the stripped file name. (The latter
+ * exists in the file system since it is the
+ * component's parent directory.) */
+ if (p == start && relative)
+ (void)mch_stat(".", &new_st);
+ else
+ {
+ saved_char = *p;
+ *p = NUL;
+ (void)mch_stat((char *)filename, &new_st);
+ *p = saved_char;
+ }
+
+ if (new_st.st_ino != st.st_ino ||
+ new_st.st_dev != st.st_dev)
+ {
+ do_strip = FALSE;
+ /* We don't disable stripping of later
+ * components since the unstripped path name is
+ * still valid. */
+ }
+ }
+#endif
+ }
+ }
+
+ if (!do_strip)
+ {
+ /* Skip the ".." or "../" and reset the counter for the
+ * components that might be stripped later on. */
+ p = tail;
+ components = 0;
+ }
+ else
+ {
+ /* Strip previous component. If the result would get empty
+ * and there is no trailing path separator, leave a single
+ * "." instead. If we are at the end of the file name and
+ * there is no trailing path separator and a preceding
+ * component is left after stripping, strip its trailing
+ * path separator as well. */
+ if (p == start && relative && tail[-1] == '.')
+ {
+ *p++ = '.';
+ *p = NUL;
+ }
+ else
+ {
+ if (p > start && tail[-1] == '.')
+ --p;
+ movetail(p, tail); /* strip previous component */
+ }
+
+ --components;
+ }
+ }
+ else if (p == start && !relative) /* leading "/.." or "/../" */
+ movetail(p, tail); /* strip ".." or "../" */
+ else
+ {
+ if (p == start + 2 && p[-2] == '.') /* leading "./../" */
+ {
+ movetail(p - 2, p); /* strip leading "./" */
+ tail -= 2;
+ }
+ p = tail; /* skip to char after ".." or "../" */
+ }
+ }
+ else
+ {
+ ++components; /* simple path component */
+ p = getnextcomp(p);
+ }
+ } while (*p != NUL);
+#endif /* !AMIGA */
+}
+
+/*
+ * Check if we have a tag for the buffer with name "buf_ffname".
+ * This is a bit slow, because of the full path compare in fullpathcmp().
+ * Return TRUE if tag for file "fname" if tag file "tag_fname" is for current
+ * file.
+ */
+ static int
+#ifdef FEAT_EMACS_TAGS
+test_for_current(is_etag, fname, fname_end, tag_fname, buf_ffname)
+ int is_etag;
+#else
+test_for_current(fname, fname_end, tag_fname, buf_ffname)
+#endif
+ char_u *fname;
+ char_u *fname_end;
+ char_u *tag_fname;
+ char_u *buf_ffname;
+{
+ int c;
+ int retval = FALSE;
+ char_u *fullname;
+
+ if (buf_ffname != NULL) /* if the buffer has a name */
+ {
+#ifdef FEAT_EMACS_TAGS
+ if (is_etag)
+ c = 0; /* to shut up GCC */
+ else
+#endif
+ {
+ c = *fname_end;
+ *fname_end = NUL;
+ }
+ fullname = expand_tag_fname(fname, tag_fname, TRUE);
+ if (fullname != NULL)
+ {
+ retval = (fullpathcmp(fullname, buf_ffname, TRUE) & FPC_SAME);
+ vim_free(fullname);
+ }
+#ifdef FEAT_EMACS_TAGS
+ if (!is_etag)
+#endif
+ *fname_end = c;
+ }
+
+ return retval;
+}
+
+/*
+ * Find the end of the tagaddress.
+ * Return OK if ";\"" is following, FAIL otherwise.
+ */
+ static int
+find_extra(pp)
+ char_u **pp;
+{
+ char_u *str = *pp;
+
+ /* Repeat for addresses separated with ';' */
+ for (;;)
+ {
+ if (VIM_ISDIGIT(*str))
+ str = skipdigits(str);
+ else if (*str == '/' || *str == '?')
+ {
+ str = skip_regexp(str + 1, *str, FALSE, NULL);
+ if (*str != **pp)
+ str = NULL;
+ else
+ ++str;
+ }
+ else
+ str = NULL;
+ if (str == NULL || *str != ';'
+ || !(VIM_ISDIGIT(str[1]) || str[1] == '/' || str[1] == '?'))
+ break;
+ ++str; /* skip ';' */
+ }
+
+ if (str != NULL && STRNCMP(str, ";\"", 2) == 0)
+ {
+ *pp = str;
+ return OK;
+ }
+ return FAIL;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+ int
+expand_tags(tagnames, pat, num_file, file)
+ int tagnames; /* expand tag names */
+ char_u *pat;
+ int *num_file;
+ char_u ***file;
+{
+ int i;
+ int c;
+ int tagnmflag;
+ char_u tagnm[100];
+ tagptrs_T t_p;
+ int ret;
+
+ if (tagnames)
+ tagnmflag = TAG_NAMES;
+ else
+ tagnmflag = 0;
+ if (pat[0] == '/')
+ ret = find_tags(pat + 1, num_file, file,
+ TAG_REGEXP | tagnmflag | TAG_VERBOSE,
+ TAG_MANY, curbuf->b_ffname);
+ else
+ ret = find_tags(pat, num_file, file,
+ TAG_REGEXP | tagnmflag | TAG_VERBOSE | TAG_NOIC,
+ TAG_MANY, curbuf->b_ffname);
+ if (ret == OK && !tagnames)
+ {
+ /* Reorganize the tags for display and matching as strings of:
+ * "<tagname>\0<kind>\0<filename>\0"
+ */
+ for (i = 0; i < *num_file; i++)
+ {
+ parse_match((*file)[i], &t_p);
+ c = (int)(t_p.tagname_end - t_p.tagname);
+ mch_memmove(tagnm, t_p.tagname, (size_t)c);
+ tagnm[c++] = 0;
+ tagnm[c++] = (t_p.tagkind != NULL && *t_p.tagkind)
+ ? *t_p.tagkind : 'f';
+ tagnm[c++] = 0;
+ mch_memmove((*file)[i] + c, t_p.fname, t_p.fname_end - t_p.fname);
+ (*file)[i][c + (t_p.fname_end - t_p.fname)] = 0;
+ mch_memmove((*file)[i], tagnm, (size_t)c);
+ }
+ }
+ return ret;
+}
+#endif
diff --git a/src/tearoff.bmp b/src/tearoff.bmp
new file mode 100644
index 000000000..8a4313b1f
--- /dev/null
+++ b/src/tearoff.bmp
Binary files differ
diff --git a/src/tee/Makefile b/src/tee/Makefile
new file mode 100644
index 000000000..951a1cc36
--- /dev/null
+++ b/src/tee/Makefile
@@ -0,0 +1,15 @@
+# A very (if not the most) simplistic Makefile for OS/2
+
+CC=gcc
+CFLAGS=-O2 -fno-strength-reduce
+
+tee.exe: tee.o
+ $(CC) $(CFLAGS) -s -o $@ $<
+
+tee.o: tee.c
+ $(CC) $(CFLAGS) -c $<
+
+clean:
+ - del tee.o
+ - del tee.exe
+
diff --git a/src/tee/tee.c b/src/tee/tee.c
new file mode 100644
index 000000000..6c85766bb
--- /dev/null
+++ b/src/tee/tee.c
@@ -0,0 +1,153 @@
+/* vim:set ts=4 sw=4:
+ *
+ * Copyright (c) 1996, Paul Slootman
+ *
+ * Author: Paul Slootman
+ * (paul@wurtel.hobby.nl, paul@murphy.nl, paulS@toecompst.nl)
+ *
+ * This source code is released into the public domain. It is provided on an
+ * as-is basis and no responsibility is accepted for its failure to perform
+ * as expected. It is worth at least as much as you paid for it!
+ *
+ * tee.c - pipe fitting
+ *
+ * tee reads stdin, and writes what it reads to each of the specified
+ * files. The primary reason of existence for this version is a quick
+ * and dirty implementation to distribute with Vim, to make one of the
+ * most useful features of Vim possible on OS/2: quickfix.
+ *
+ * Of course, not using tee but instead redirecting make's output directly
+ * into a temp file and then processing that is possible, but if we have a
+ * system capable of correctly piping (unlike DOS, for example), why not
+ * use it as well as possible? This tee should also work on other systems,
+ * but it's not been tested there, only on OS/2.
+ *
+ * tee is also available in the GNU shellutils package, which is available
+ * precompiled for OS/2. That one probably works better.
+ */
+
+#include <unistd.h>
+#include <malloc.h>
+#include <stdio.h>
+
+void usage(void)
+{
+ fprintf(stderr,
+"tee usage:\n\
+\ttee [-a] file ... file_n\n\
+\n\
+\t-a\tappend to files instead of truncating\n\
+\nTee reads its input, and writes to each of the specified files,\n\
+as well as to the standard output.\n\
+\n\
+This version supplied with Vim 4.2 to make ':make' possible.\n\
+For a more complete and stable version, consider getting\n\
+[a port of] the GNU shellutils package.\n\
+");
+}
+
+/*
+ * fread only returns when count is read or at EOF.
+ * We could use fgets, but I want to be able to handle binary blubber.
+ */
+
+int
+myfread(char *buf, int elsize /*ignored*/, int max, FILE *fp)
+{
+ int c;
+ int n = 0;
+
+ while ((n < max) && ((c = getchar()) != EOF))
+ {
+ *(buf++) = c;
+ n++;
+ if (c == '\n' || c == '\r')
+ break;
+ }
+ return n;
+}
+
+
+void
+main(int argc, char *argv[])
+{
+ int append = 0;
+ int numfiles;
+ int opt;
+ int maxfiles;
+ FILE **filepointers;
+ int i;
+ char buf[BUFSIZ];
+ int n;
+ extern int optind;
+
+ while ((opt = getopt(argc, argv, "a")) != EOF)
+ {
+ switch (opt)
+ {
+ case 'a': append++;
+ break;
+ default: usage();
+ exit(2);
+ }
+ }
+
+ numfiles = argc - optind;
+
+ if (numfiles == 0)
+ {
+ fprintf(stderr, "doesn't make much sense using tee without any file name arguments...\n");
+ usage();
+ exit(2);
+ }
+
+ maxfiles = sysconf(_SC_OPEN_MAX); /* or fill in 10 or so */
+ if (maxfiles < 0)
+ maxfiles = 10;
+ if (numfiles + 3 > maxfiles) /* +3 accounts for stdin, out, err */
+ {
+ fprintf(stderr, "Sorry, there is a limit of max %d files.\n", maxfiles - 3);
+ exit(1);
+ }
+ filepointers = calloc(numfiles, sizeof(FILE *));
+ if (filepointers == NULL)
+ {
+ fprintf(stderr, "Error allocating memory for %d files\n", numfiles);
+ exit(1);
+ }
+ for (i = 0; i < numfiles; i++)
+ {
+ filepointers[i] = fopen(argv[i+optind], append ? "ab" : "wb");
+ if (filepointers[i] == NULL)
+ {
+ fprintf(stderr, "Can't open \"%s\"\n", argv[i+optind]);
+ exit(1);
+ }
+ }
+ _fsetmode(stdin, "b");
+ fflush(stdout); /* needed for _fsetmode(stdout) */
+ _fsetmode(stdout, "b");
+
+ while ((n = myfread(buf, sizeof(char), sizeof(buf), stdin)) > 0)
+ {
+ fwrite(buf, sizeof(char), n, stdout);
+ fflush(stdout);
+ for (i = 0; i < numfiles; i++)
+ {
+ if (filepointers[i] &&
+ fwrite(buf, sizeof(char), n, filepointers[i]) != n)
+ {
+ fprintf(stderr, "Error writing to file \"%s\"\n", argv[i+optind]);
+ fclose(filepointers[i]);
+ filepointers[i] = NULL;
+ }
+ }
+ }
+ for (i = 0; i < numfiles; i++)
+ {
+ if (filepointers[i])
+ fclose(filepointers[i]);
+ }
+
+ exit(0);
+}
diff --git a/src/term.c b/src/term.c
new file mode 100644
index 000000000..656a40ef4
--- /dev/null
+++ b/src/term.c
@@ -0,0 +1,5381 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+/*
+ *
+ * term.c: functions for controlling the terminal
+ *
+ * primitive termcap support for Amiga, MSDOS, and Win32 included
+ *
+ * NOTE: padding and variable substitution is not performed,
+ * when compiling without HAVE_TGETENT, we use tputs() and tgoto() dummies.
+ */
+
+/*
+ * Some systems have a prototype for tgetstr() with (char *) instead of
+ * (char **). This define removes that prototype. We include our own prototype
+ * below.
+ */
+
+#define tgetstr tgetstr_defined_wrong
+#include "vim.h"
+
+#ifdef HAVE_TGETENT
+# ifdef HAVE_TERMIOS_H
+# include <termios.h> /* seems to be required for some Linux */
+# endif
+# ifdef HAVE_TERMCAP_H
+# include <termcap.h>
+# endif
+
+/*
+ * A few linux systems define outfuntype in termcap.h to be used as the third
+ * argument for tputs().
+ */
+# ifdef VMS
+# define TPUTSFUNCAST
+# else
+# ifdef HAVE_OUTFUNTYPE
+# define TPUTSFUNCAST (outfuntype)
+# else
+# define TPUTSFUNCAST (int (*)())
+# endif
+# endif
+#endif
+
+#undef tgetstr
+
+/*
+ * Here are the builtin termcap entries. They are not stored as complete
+ * Tcarr structures, as such a structure is too big.
+ *
+ * The entries are compact, therefore they normally are included even when
+ * HAVE_TGETENT is defined. When HAVE_TGETENT is defined, the builtin entries
+ * can be accessed with "builtin_amiga", "builtin_ansi", "builtin_debug", etc.
+ *
+ * Each termcap is a list of builtin_term structures. It always starts with
+ * KS_NAME, which separates the entries. See parse_builtin_tcap() for all
+ * details.
+ * bt_entry is either a KS_xxx code (>= 0), or a K_xxx code.
+ *
+ * Entries marked with "guessed" may be wrong.
+ */
+struct builtin_term
+{
+ int bt_entry;
+ char *bt_string;
+};
+
+/* start of keys that are not directly used by Vim but can be mapped */
+#define BT_EXTRA_KEYS 0x101
+
+static struct builtin_term *find_builtin_term __ARGS((char_u *name));
+static void parse_builtin_tcap __ARGS((char_u *s));
+static void term_color __ARGS((char_u *s, int n));
+static void gather_termleader __ARGS((void));
+#ifdef FEAT_TERMRESPONSE
+static void req_codes_from_term __ARGS((void));
+static void req_more_codes_from_term __ARGS((void));
+static void got_code_from_term __ARGS((char_u *code, int len));
+static void check_for_codes_from_term __ARGS((void));
+#endif
+#if defined(FEAT_GUI) \
+ || (defined(FEAT_MOUSE) && (!defined(UNIX) || defined(FEAT_MOUSE_XTERM)))
+static int get_bytes_from_buf __ARGS((char_u *, char_u *, int));
+#endif
+#ifdef FEAT_TERMRESPONSE
+static void may_req_termresponse __ARGS((void));
+#endif
+static void del_termcode_idx __ARGS((int idx));
+static int term_is_builtin __ARGS((char_u *name));
+static int term_7to8bit __ARGS((char_u *p));
+#ifdef FEAT_TERMRESPONSE
+static void switch_to_8bit __ARGS((void));
+#endif
+
+#ifdef HAVE_TGETENT
+static char_u *tgetent_error __ARGS((char_u *, char_u *));
+
+/*
+ * Here is our own prototype for tgetstr(), any prototypes from the include
+ * files have been disabled by the define at the start of this file.
+ */
+char *tgetstr __ARGS((char *, char **));
+
+# ifdef FEAT_TERMRESPONSE
+/* Request Terminal Version status: */
+# define CRV_GET 1 /* send T_CRV when switched to RAW mode */
+# define CRV_SENT 2 /* did send T_CRV, waiting for answer */
+# define CRV_GOT 3 /* received T_CRV response */
+static int crv_status = CRV_GET;
+# endif
+
+/*
+ * Don't declare these variables if termcap.h contains them.
+ * Autoconf checks if these variables should be declared extern (not all
+ * systems have them).
+ * Some versions define ospeed to be speed_t, but that is incompatible with
+ * BSD, where ospeed is short and speed_t is long.
+ */
+# ifndef HAVE_OSPEED
+# ifdef OSPEED_EXTERN
+extern short ospeed;
+# else
+short ospeed;
+# endif
+# endif
+# ifndef HAVE_UP_BC_PC
+# ifdef UP_BC_PC_EXTERN
+extern char *UP, *BC, PC;
+# else
+char *UP, *BC, PC;
+# endif
+# endif
+
+# define TGETSTR(s, p) vim_tgetstr((s), (p))
+# define TGETENT(b, t) tgetent((char *)(b), (char *)(t))
+static char_u *vim_tgetstr __ARGS((char *s, char_u **pp));
+#endif /* HAVE_TGETENT */
+
+static int detected_8bit = FALSE; /* detected 8-bit terminal */
+
+struct builtin_term builtin_termcaps[] =
+{
+
+#if defined(FEAT_GUI)
+/*
+ * GUI pseudo term-cap.
+ */
+ {(int)KS_NAME, "gui"},
+ {(int)KS_CE, IF_EB("\033|$", ESC_STR "|$")},
+ {(int)KS_AL, IF_EB("\033|i", ESC_STR "|i")},
+# ifdef TERMINFO
+ {(int)KS_CAL, IF_EB("\033|%p1%dI", ESC_STR "|%p1%dI")},
+# else
+ {(int)KS_CAL, IF_EB("\033|%dI", ESC_STR "|%dI")},
+# endif
+ {(int)KS_DL, IF_EB("\033|d", ESC_STR "|d")},
+# ifdef TERMINFO
+ {(int)KS_CDL, IF_EB("\033|%p1%dD", ESC_STR "|%p1%dD")},
+ {(int)KS_CS, IF_EB("\033|%p1%d;%p2%dR", ESC_STR "|%p1%d;%p2%dR")},
+# ifdef FEAT_VERTSPLIT
+ {(int)KS_CSV, IF_EB("\033|%p1%d;%p2%dV", ESC_STR "|%p1%d;%p2%dV")},
+# endif
+# else
+ {(int)KS_CDL, IF_EB("\033|%dD", ESC_STR "|%dD")},
+ {(int)KS_CS, IF_EB("\033|%d;%dR", ESC_STR "|%d;%dR")},
+# ifdef FEAT_VERTSPLIT
+ {(int)KS_CSV, IF_EB("\033|%d;%dV", ESC_STR "|%d;%dV")},
+# endif
+# endif
+ {(int)KS_CL, IF_EB("\033|C", ESC_STR "|C")},
+ /* attributes switched on with 'h', off with * 'H' */
+ {(int)KS_ME, IF_EB("\033|31H", ESC_STR "|31H")}, /* HL_ALL */
+ {(int)KS_MR, IF_EB("\033|1h", ESC_STR "|1h")}, /* HL_INVERSE */
+ {(int)KS_MD, IF_EB("\033|2h", ESC_STR "|2h")}, /* HL_BOLD */
+ {(int)KS_SE, IF_EB("\033|16H", ESC_STR "|16H")}, /* HL_STANDOUT */
+ {(int)KS_SO, IF_EB("\033|16h", ESC_STR "|16h")}, /* HL_STANDOUT */
+ {(int)KS_UE, IF_EB("\033|8H", ESC_STR "|8H")}, /* HL_UNDERLINE */
+ {(int)KS_US, IF_EB("\033|8h", ESC_STR "|8h")}, /* HL_UNDERLINE */
+ {(int)KS_CZR, IF_EB("\033|4H", ESC_STR "|4H")}, /* HL_ITALIC */
+ {(int)KS_CZH, IF_EB("\033|4h", ESC_STR "|4h")}, /* HL_ITALIC */
+ {(int)KS_VB, IF_EB("\033|f", ESC_STR "|f")},
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"},
+ {(int)KS_LE, "\b"}, /* cursor-left = BS */
+ {(int)KS_ND, "\014"}, /* cursor-right = CTRL-L */
+# ifdef TERMINFO
+ {(int)KS_CM, IF_EB("\033|%p1%d;%p2%dM", ESC_STR "|%p1%d;%p2%dM")},
+# else
+ {(int)KS_CM, IF_EB("\033|%d;%dM", ESC_STR "|%d;%dM")},
+# endif
+ /* there are no key sequences here, the GUI sequences are recognized
+ * in check_termcodes() */
+#endif
+
+#ifndef NO_BUILTIN_TCAPS
+# if defined(RISCOS) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * Default for the Acorn.
+ */
+ {(int)KS_NAME, "riscos"},
+ {(int)KS_CL, "\014"}, /* Cls and Home Cursor */
+ {(int)KS_CM, "\001%d\001%d\002"}, /* Position cursor */
+
+ {(int)KS_CCO, "16"}, /* Allow 16 colors */
+
+ {(int)KS_CAF, "\001%d\021"}, /* Set foreground colour */
+ {(int)KS_CAB, "\001%d\022"}, /* Set background colour */
+
+
+ {(int)KS_ME, "\004"}, /* Normal mode */
+ {(int)KS_MR, "\005"}, /* Reverse */
+
+ {(int)KS_VI, "\016"}, /* Cursor invisible */
+ {(int)KS_VE, "\017"}, /* Cursor visible */
+ {(int)KS_VS, "\020"}, /* Cursor very visible */
+
+ {(int)KS_CS, "\001%d\001%d\003"}, /* Set scroll region */
+ {(int)KS_SR, "\023"}, /* Scroll text down */
+ {K_UP, "\217"},
+ {K_DOWN, "\216"},
+ {K_LEFT, "\214"},
+ {K_RIGHT, "\215"},
+ {K_S_UP, "\237"},
+ {K_S_DOWN, "\236"},
+ {K_S_LEFT, "\234"},
+ {K_S_RIGHT, "\235"},
+
+ {K_F1, "\201"},
+ {K_F2, "\202"},
+ {K_F3, "\203"},
+ {K_F4, "\204"},
+ {K_F5, "\205"},
+ {K_F6, "\206"},
+ {K_F7, "\207"},
+ {K_F8, "\210"},
+ {K_F9, "\211"},
+ {K_F10, "\312"},
+ {K_F11, "\313"},
+ {K_F12, "\314"},
+ {K_S_F1, "\221"},
+ {K_S_F2, "\222"},
+ {K_S_F3, "\223"},
+ {K_S_F4, "\224"},
+ {K_S_F5, "\225"},
+ {K_S_F6, "\226"},
+ {K_S_F7, "\227"},
+ {K_S_F8, "\230"},
+ {K_S_F9, "\231"},
+ {K_S_F10, "\332"},
+ {K_S_F11, "\333"},
+ {K_S_F12, "\334"},
+ {K_BS, "\010"},
+ {K_INS, "\315"},
+ {K_DEL, "\177"},
+ {K_HOME, "\036"},
+ {K_END, "\213"},
+ {K_PAGEUP, "\237"},
+ {K_PAGEDOWN, "\236"},
+# endif /* Acorn terminal */
+
+
+# if defined(AMIGA) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * Amiga console window, default for Amiga
+ */
+ {(int)KS_NAME, "amiga"},
+ {(int)KS_CE, "\033[K"},
+ {(int)KS_CD, "\033[J"},
+ {(int)KS_AL, "\033[L"},
+# ifdef TERMINFO
+ {(int)KS_CAL, "\033[%p1%dL"},
+# else
+ {(int)KS_CAL, "\033[%dL"},
+# endif
+ {(int)KS_DL, "\033[M"},
+# ifdef TERMINFO
+ {(int)KS_CDL, "\033[%p1%dM"},
+# else
+ {(int)KS_CDL, "\033[%dM"},
+# endif
+ {(int)KS_CL, "\014"},
+ {(int)KS_VI, "\033[0 p"},
+ {(int)KS_VE, "\033[1 p"},
+ {(int)KS_ME, "\033[0m"},
+ {(int)KS_MR, "\033[7m"},
+ {(int)KS_MD, "\033[1m"},
+ {(int)KS_SE, "\033[0m"},
+ {(int)KS_SO, "\033[33m"},
+ {(int)KS_US, "\033[4m"},
+ {(int)KS_UE, "\033[0m"},
+ {(int)KS_CZH, "\033[3m"},
+ {(int)KS_CZR, "\033[0m"},
+#if defined(__MORPHOS__) || defined(__AROS__)
+ {(int)KS_CCO, "8"}, /* allow 8 colors */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033[4%p1%dm"},/* set background color */
+ {(int)KS_CAF, "\033[3%p1%dm"},/* set foreground color */
+# else
+ {(int)KS_CAB, "\033[4%dm"}, /* set background color */
+ {(int)KS_CAF, "\033[3%dm"}, /* set foreground color */
+# endif
+ {(int)KS_OP, "\033[m"}, /* reset colors */
+#endif
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"}, /* guessed */
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033[%i%p1%d;%p2%dH"},
+# else
+ {(int)KS_CM, "\033[%i%d;%dH"},
+# endif
+#if defined(__MORPHOS__)
+ {(int)KS_SR, "\033M"},
+#endif
+# ifdef TERMINFO
+ {(int)KS_CRI, "\033[%p1%dC"},
+# else
+ {(int)KS_CRI, "\033[%dC"},
+# endif
+ {K_UP, "\233A"},
+ {K_DOWN, "\233B"},
+ {K_LEFT, "\233D"},
+ {K_RIGHT, "\233C"},
+ {K_S_UP, "\233T"},
+ {K_S_DOWN, "\233S"},
+ {K_S_LEFT, "\233 A"},
+ {K_S_RIGHT, "\233 @"},
+ {K_S_TAB, "\233Z"},
+ {K_F1, "\233\060~"},/* some compilers don't dig "\2330" */
+ {K_F2, "\233\061~"},
+ {K_F3, "\233\062~"},
+ {K_F4, "\233\063~"},
+ {K_F5, "\233\064~"},
+ {K_F6, "\233\065~"},
+ {K_F7, "\233\066~"},
+ {K_F8, "\233\067~"},
+ {K_F9, "\233\070~"},
+ {K_F10, "\233\071~"},
+ {K_S_F1, "\233\061\060~"},
+ {K_S_F2, "\233\061\061~"},
+ {K_S_F3, "\233\061\062~"},
+ {K_S_F4, "\233\061\063~"},
+ {K_S_F5, "\233\061\064~"},
+ {K_S_F6, "\233\061\065~"},
+ {K_S_F7, "\233\061\066~"},
+ {K_S_F8, "\233\061\067~"},
+ {K_S_F9, "\233\061\070~"},
+ {K_S_F10, "\233\061\071~"},
+ {K_HELP, "\233?~"},
+ {K_INS, "\233\064\060~"}, /* 101 key keyboard */
+ {K_PAGEUP, "\233\064\061~"}, /* 101 key keyboard */
+ {K_PAGEDOWN, "\233\064\062~"}, /* 101 key keyboard */
+ {K_HOME, "\233\064\064~"}, /* 101 key keyboard */
+ {K_END, "\233\064\065~"}, /* 101 key keyboard */
+
+ {BT_EXTRA_KEYS, ""},
+ {TERMCAP2KEY('#', '2'), "\233\065\064~"}, /* shifted home key */
+ {TERMCAP2KEY('#', '3'), "\233\065\060~"}, /* shifted insert key */
+ {TERMCAP2KEY('*', '7'), "\233\065\065~"}, /* shifted end key */
+# endif
+
+# if defined(__BEOS__) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * almost standard ANSI terminal, default for bebox
+ */
+ {(int)KS_NAME, "beos-ansi"},
+ {(int)KS_CE, "\033[K"},
+ {(int)KS_CD, "\033[J"},
+ {(int)KS_AL, "\033[L"},
+# ifdef TERMINFO
+ {(int)KS_CAL, "\033[%p1%dL"},
+# else
+ {(int)KS_CAL, "\033[%dL"},
+# endif
+ {(int)KS_DL, "\033[M"},
+# ifdef TERMINFO
+ {(int)KS_CDL, "\033[%p1%dM"},
+# else
+ {(int)KS_CDL, "\033[%dM"},
+# endif
+#ifdef BEOS_PR_OR_BETTER
+# ifdef TERMINFO
+ {(int)KS_CS, "\033[%i%p1%d;%p2%dr"},
+# else
+ {(int)KS_CS, "\033[%i%d;%dr"}, /* scroll region */
+# endif
+#endif
+ {(int)KS_CL, "\033[H\033[2J"},
+#ifdef notyet
+ {(int)KS_VI, "[VI]"}, /* cursor invisible, VT320: CSI ? 25 l */
+ {(int)KS_VE, "[VE]"}, /* cursor visible, VT320: CSI ? 25 h */
+#endif
+ {(int)KS_ME, "\033[m"}, /* normal mode */
+ {(int)KS_MR, "\033[7m"}, /* reverse */
+ {(int)KS_MD, "\033[1m"}, /* bold */
+ {(int)KS_SO, "\033[31m"}, /* standout mode: red */
+ {(int)KS_SE, "\033[m"}, /* standout end */
+ {(int)KS_CZH, "\033[35m"}, /* italic: purple */
+ {(int)KS_CZR, "\033[m"}, /* italic end */
+ {(int)KS_US, "\033[4m"}, /* underscore mode */
+ {(int)KS_UE, "\033[m"}, /* underscore end */
+ {(int)KS_CCO, "8"}, /* allow 8 colors */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033[4%p1%dm"},/* set background color */
+ {(int)KS_CAF, "\033[3%p1%dm"},/* set foreground color */
+# else
+ {(int)KS_CAB, "\033[4%dm"}, /* set background color */
+ {(int)KS_CAF, "\033[3%dm"}, /* set foreground color */
+# endif
+ {(int)KS_OP, "\033[m"}, /* reset colors */
+ {(int)KS_MS, "y"}, /* safe to move cur in reverse mode */
+ {(int)KS_UT, "y"}, /* guessed */
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033[%i%p1%d;%p2%dH"},
+# else
+ {(int)KS_CM, "\033[%i%d;%dH"},
+# endif
+ {(int)KS_SR, "\033M"},
+# ifdef TERMINFO
+ {(int)KS_CRI, "\033[%p1%dC"},
+# else
+ {(int)KS_CRI, "\033[%dC"},
+# endif
+#if defined(BEOS_DR8)
+ {(int)KS_DB, ""}, /* hack! see screen.c */
+#endif
+
+ {K_UP, "\033[A"},
+ {K_DOWN, "\033[B"},
+ {K_LEFT, "\033[D"},
+ {K_RIGHT, "\033[C"},
+# endif
+
+# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS) || defined(__EMX__)
+/*
+ * standard ANSI terminal, default for unix
+ */
+ {(int)KS_NAME, "ansi"},
+ {(int)KS_CE, IF_EB("\033[K", ESC_STR "[K")},
+ {(int)KS_AL, IF_EB("\033[L", ESC_STR "[L")},
+# ifdef TERMINFO
+ {(int)KS_CAL, IF_EB("\033[%p1%dL", ESC_STR "[%p1%dL")},
+# else
+ {(int)KS_CAL, IF_EB("\033[%dL", ESC_STR "[%dL")},
+# endif
+ {(int)KS_DL, IF_EB("\033[M", ESC_STR "[M")},
+# ifdef TERMINFO
+ {(int)KS_CDL, IF_EB("\033[%p1%dM", ESC_STR "[%p1%dM")},
+# else
+ {(int)KS_CDL, IF_EB("\033[%dM", ESC_STR "[%dM")},
+# endif
+ {(int)KS_CL, IF_EB("\033[H\033[2J", ESC_STR "[H" ESC_STR_nc "[2J")},
+ {(int)KS_ME, IF_EB("\033[0m", ESC_STR "[0m")},
+ {(int)KS_MR, IF_EB("\033[7m", ESC_STR "[7m")},
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"}, /* guessed */
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, IF_EB("\033[%i%p1%d;%p2%dH", ESC_STR "[%i%p1%d;%p2%dH")},
+# else
+ {(int)KS_CM, IF_EB("\033[%i%d;%dH", ESC_STR "[%i%d;%dH")},
+# endif
+# ifdef TERMINFO
+ {(int)KS_CRI, IF_EB("\033[%p1%dC", ESC_STR "[%p1%dC")},
+# else
+ {(int)KS_CRI, IF_EB("\033[%dC", ESC_STR "[%dC")},
+# endif
+# endif
+
+# if defined(MSDOS) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
+/*
+ * These codes are valid when nansi.sys or equivalent has been installed.
+ * Function keys on a PC are preceded with a NUL. These are converted into
+ * K_NUL '\316' in mch_inchar(), because we cannot handle NULs in key codes.
+ * CTRL-arrow is used instead of SHIFT-arrow.
+ */
+#ifdef __EMX__
+ {(int)KS_NAME, "os2ansi"},
+#else
+ {(int)KS_NAME, "pcansi"},
+ {(int)KS_DL, "\033[M"},
+ {(int)KS_AL, "\033[L"},
+#endif
+ {(int)KS_CE, "\033[K"},
+ {(int)KS_CL, "\033[2J"},
+ {(int)KS_ME, "\033[0m"},
+ {(int)KS_MR, "\033[5m"}, /* reverse: black on lightgrey */
+ {(int)KS_MD, "\033[1m"}, /* bold: white text */
+ {(int)KS_SE, "\033[0m"}, /* standout end */
+ {(int)KS_SO, "\033[31m"}, /* standout: white on blue */
+ {(int)KS_CZH, "\033[34;43m"}, /* italic mode: blue text on yellow */
+ {(int)KS_CZR, "\033[0m"}, /* italic mode end */
+ {(int)KS_US, "\033[36;41m"}, /* underscore mode: cyan text on red */
+ {(int)KS_UE, "\033[0m"}, /* underscore mode end */
+ {(int)KS_CCO, "8"}, /* allow 8 colors */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033[4%p1%dm"},/* set background color */
+ {(int)KS_CAF, "\033[3%p1%dm"},/* set foreground color */
+# else
+ {(int)KS_CAB, "\033[4%dm"}, /* set background color */
+ {(int)KS_CAF, "\033[3%dm"}, /* set foreground color */
+# endif
+ {(int)KS_OP, "\033[0m"}, /* reset colors */
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"}, /* guessed */
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033[%i%p1%d;%p2%dH"},
+# else
+ {(int)KS_CM, "\033[%i%d;%dH"},
+# endif
+# ifdef TERMINFO
+ {(int)KS_CRI, "\033[%p1%dC"},
+# else
+ {(int)KS_CRI, "\033[%dC"},
+# endif
+ {K_UP, "\316H"},
+ {K_DOWN, "\316P"},
+ {K_LEFT, "\316K"},
+ {K_RIGHT, "\316M"},
+ {K_S_LEFT, "\316s"},
+ {K_S_RIGHT, "\316t"},
+ {K_F1, "\316;"},
+ {K_F2, "\316<"},
+ {K_F3, "\316="},
+ {K_F4, "\316>"},
+ {K_F5, "\316?"},
+ {K_F6, "\316@"},
+ {K_F7, "\316A"},
+ {K_F8, "\316B"},
+ {K_F9, "\316C"},
+ {K_F10, "\316D"},
+ {K_F11, "\316\205"}, /* guessed */
+ {K_F12, "\316\206"}, /* guessed */
+ {K_S_F1, "\316T"},
+ {K_S_F2, "\316U"},
+ {K_S_F3, "\316V"},
+ {K_S_F4, "\316W"},
+ {K_S_F5, "\316X"},
+ {K_S_F6, "\316Y"},
+ {K_S_F7, "\316Z"},
+ {K_S_F8, "\316["},
+ {K_S_F9, "\316\\"},
+ {K_S_F10, "\316]"},
+ {K_S_F11, "\316\207"}, /* guessed */
+ {K_S_F12, "\316\210"}, /* guessed */
+ {K_INS, "\316R"},
+ {K_DEL, "\316S"},
+ {K_HOME, "\316G"},
+ {K_END, "\316O"},
+ {K_PAGEDOWN, "\316Q"},
+ {K_PAGEUP, "\316I"},
+# endif
+
+# if defined(MSDOS)
+/*
+ * These codes are valid for the pc video. The entries that start with ESC |
+ * are translated into conio calls in os_msdos.c. Default for MSDOS.
+ */
+ {(int)KS_NAME, "pcterm"},
+ {(int)KS_CE, "\033|K"},
+ {(int)KS_AL, "\033|L"},
+ {(int)KS_DL, "\033|M"},
+# ifdef TERMINFO
+ {(int)KS_CS, "\033|%i%p1%d;%p2%dr"},
+# ifdef FEAT_VERTSPLIT
+ {(int)KS_CSV, "\033|%i%p1%d;%p2%dV"},
+# endif
+# else
+ {(int)KS_CS, "\033|%i%d;%dr"},
+# ifdef FEAT_VERTSPLIT
+ {(int)KS_CSV, "\033|%i%d;%dV"},
+# endif
+# endif
+ {(int)KS_CL, "\033|J"},
+ {(int)KS_ME, "\033|0m"}, /* normal */
+ {(int)KS_MR, "\033|112m"}, /* reverse: black on lightgrey */
+ {(int)KS_MD, "\033|15m"}, /* bold: white text */
+ {(int)KS_SE, "\033|0m"}, /* standout end */
+ {(int)KS_SO, "\033|31m"}, /* standout: white on blue */
+ {(int)KS_CZH, "\033|225m"}, /* italic mode: blue text on yellow */
+ {(int)KS_CZR, "\033|0m"}, /* italic mode end */
+ {(int)KS_US, "\033|67m"}, /* underscore mode: cyan text on red */
+ {(int)KS_UE, "\033|0m"}, /* underscore mode end */
+ {(int)KS_CCO, "16"}, /* allow 16 colors */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033|%p1%db"}, /* set background color */
+ {(int)KS_CAF, "\033|%p1%df"}, /* set foreground color */
+# else
+ {(int)KS_CAB, "\033|%db"}, /* set background color */
+ {(int)KS_CAF, "\033|%df"}, /* set foreground color */
+# endif
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"},
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033|%i%p1%d;%p2%dH"},
+# else
+ {(int)KS_CM, "\033|%i%d;%dH"},
+# endif
+#ifdef DJGPP
+ {(int)KS_VB, "\033|B"}, /* visual bell */
+#endif
+ {K_UP, "\316H"},
+ {K_DOWN, "\316P"},
+ {K_LEFT, "\316K"},
+ {K_RIGHT, "\316M"},
+ {K_S_LEFT, "\316s"},
+ {K_S_RIGHT, "\316t"},
+ {K_S_TAB, "\316\017"},
+ {K_F1, "\316;"},
+ {K_F2, "\316<"},
+ {K_F3, "\316="},
+ {K_F4, "\316>"},
+ {K_F5, "\316?"},
+ {K_F6, "\316@"},
+ {K_F7, "\316A"},
+ {K_F8, "\316B"},
+ {K_F9, "\316C"},
+ {K_F10, "\316D"},
+ {K_F11, "\316\205"},
+ {K_F12, "\316\206"},
+ {K_S_F1, "\316T"},
+ {K_S_F2, "\316U"},
+ {K_S_F3, "\316V"},
+ {K_S_F4, "\316W"},
+ {K_S_F5, "\316X"},
+ {K_S_F6, "\316Y"},
+ {K_S_F7, "\316Z"},
+ {K_S_F8, "\316["},
+ {K_S_F9, "\316\\"},
+ {K_S_F10, "\316]"},
+ {K_S_F11, "\316\207"},
+ {K_S_F12, "\316\210"},
+ {K_INS, "\316R"},
+ {K_DEL, "\316S"},
+ {K_HOME, "\316G"},
+ {K_END, "\316O"},
+ {K_PAGEDOWN, "\316Q"},
+ {K_PAGEUP, "\316I"},
+ {K_KPLUS, "\316N"},
+ {K_KMINUS, "\316J"},
+ {K_KMULTIPLY, "\3167"},
+ {K_K0, "\316\332"},
+ {K_K1, "\316\336"},
+ {K_K2, "\316\342"},
+ {K_K3, "\316\346"},
+ {K_K4, "\316\352"},
+ {K_K5, "\316\356"},
+ {K_K6, "\316\362"},
+ {K_K7, "\316\366"},
+ {K_K8, "\316\372"},
+ {K_K9, "\316\376"},
+# endif
+
+# if defined(WIN3264) || defined(ALL_BUILTIN_TCAPS) || defined(__EMX__)
+/*
+ * These codes are valid for the Win32 Console . The entries that start with
+ * ESC | are translated into console calls in os_win32.c. The function keys
+ * are also translated in os_win32.c.
+ */
+ {(int)KS_NAME, "win32"},
+ {(int)KS_CE, "\033|K"}, /* clear to end of line */
+ {(int)KS_AL, "\033|L"}, /* add new blank line */
+# ifdef TERMINFO
+ {(int)KS_CAL, "\033|%p1%dL"}, /* add number of new blank lines */
+# else
+ {(int)KS_CAL, "\033|%dL"}, /* add number of new blank lines */
+# endif
+ {(int)KS_DL, "\033|M"}, /* delete line */
+# ifdef TERMINFO
+ {(int)KS_CDL, "\033|%p1%dM"}, /* delete number of lines */
+# else
+ {(int)KS_CDL, "\033|%dM"}, /* delete number of lines */
+# endif
+ {(int)KS_CL, "\033|J"}, /* clear screen */
+ {(int)KS_CD, "\033|j"}, /* clear to end of display */
+ {(int)KS_VI, "\033|v"}, /* cursor invisible */
+ {(int)KS_VE, "\033|V"}, /* cursor visible */
+
+ {(int)KS_ME, "\033|0m"}, /* normal */
+ {(int)KS_MR, "\033|112m"}, /* reverse: black on lightgray */
+ {(int)KS_MD, "\033|15m"}, /* bold: white on black */
+#if 1
+ {(int)KS_SO, "\033|31m"}, /* standout: white on blue */
+ {(int)KS_SE, "\033|0m"}, /* standout end */
+#else
+ {(int)KS_SO, "\033|F"}, /* standout: high intensity */
+ {(int)KS_SE, "\033|f"}, /* standout end */
+#endif
+ {(int)KS_CZH, "\033|225m"}, /* italic: blue text on yellow */
+ {(int)KS_CZR, "\033|0m"}, /* italic end */
+ {(int)KS_US, "\033|67m"}, /* underscore: cyan text on red */
+ {(int)KS_UE, "\033|0m"}, /* underscore end */
+ {(int)KS_CCO, "16"}, /* allow 16 colors */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033|%p1%db"}, /* set background color */
+ {(int)KS_CAF, "\033|%p1%df"}, /* set foreground color */
+# else
+ {(int)KS_CAB, "\033|%db"}, /* set background color */
+ {(int)KS_CAF, "\033|%df"}, /* set foreground color */
+# endif
+
+ {(int)KS_MS, "y"}, /* save to move cur in reverse mode */
+ {(int)KS_UT, "y"},
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033|%i%p1%d;%p2%dH"},/* cursor motion */
+# else
+ {(int)KS_CM, "\033|%i%d;%dH"},/* cursor motion */
+# endif
+ {(int)KS_VB, "\033|B"}, /* visual bell */
+ {(int)KS_TI, "\033|S"}, /* put terminal in termcap mode */
+ {(int)KS_TE, "\033|E"}, /* out of termcap mode */
+# ifdef TERMINFO
+ {(int)KS_CS, "\033|%i%p1%d;%p2%dr"},/* scroll region */
+# else
+ {(int)KS_CS, "\033|%i%d;%dr"},/* scroll region */
+# endif
+
+ {K_UP, "\316H"},
+ {K_DOWN, "\316P"},
+ {K_LEFT, "\316K"},
+ {K_RIGHT, "\316M"},
+ {K_S_UP, "\316\304"},
+ {K_S_DOWN, "\316\317"},
+ {K_S_LEFT, "\316\311"},
+ {K_C_LEFT, "\316s"},
+ {K_S_RIGHT, "\316\313"},
+ {K_C_RIGHT, "\316t"},
+ {K_S_TAB, "\316\017"},
+ {K_F1, "\316;"},
+ {K_F2, "\316<"},
+ {K_F3, "\316="},
+ {K_F4, "\316>"},
+ {K_F5, "\316?"},
+ {K_F6, "\316@"},
+ {K_F7, "\316A"},
+ {K_F8, "\316B"},
+ {K_F9, "\316C"},
+ {K_F10, "\316D"},
+ {K_F11, "\316\205"},
+ {K_F12, "\316\206"},
+ {K_S_F1, "\316T"},
+ {K_S_F2, "\316U"},
+ {K_S_F3, "\316V"},
+ {K_S_F4, "\316W"},
+ {K_S_F5, "\316X"},
+ {K_S_F6, "\316Y"},
+ {K_S_F7, "\316Z"},
+ {K_S_F8, "\316["},
+ {K_S_F9, "\316\\"},
+ {K_S_F10, "\316]"},
+ {K_S_F11, "\316\207"},
+ {K_S_F12, "\316\210"},
+ {K_INS, "\316R"},
+ {K_DEL, "\316S"},
+ {K_HOME, "\316G"},
+ {K_S_HOME, "\316\302"},
+ {K_C_HOME, "\316w"},
+ {K_END, "\316O"},
+ {K_S_END, "\316\315"},
+ {K_C_END, "\316u"},
+ {K_PAGEDOWN, "\316Q"},
+ {K_PAGEUP, "\316I"},
+ {K_KPLUS, "\316N"},
+ {K_KMINUS, "\316J"},
+ {K_KMULTIPLY, "\316\067"},
+ {K_K0, "\316\332"},
+ {K_K1, "\316\336"},
+ {K_K2, "\316\342"},
+ {K_K3, "\316\346"},
+ {K_K4, "\316\352"},
+ {K_K5, "\316\356"},
+ {K_K6, "\316\362"},
+ {K_K7, "\316\366"},
+ {K_K8, "\316\372"},
+ {K_K9, "\316\376"},
+# endif
+
+# if defined(VMS) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * VT320 is working as an ANSI terminal compatible DEC terminal.
+ * (it covers VT1x0, VT2x0 and VT3x0 up to VT320 on VMS as well)
+ * Note: K_F1...K_F5 are for internal use, should not be defined.
+ * TODO:- rewrite ESC[ codes to CSI
+ * - keyboard languages (CSI ? 26 n)
+ */
+ {(int)KS_NAME, "vt320"},
+ {(int)KS_CE, IF_EB("\033[K", ESC_STR "[K")},
+ {(int)KS_AL, IF_EB("\033[L", ESC_STR "[L")},
+# ifdef TERMINFO
+ {(int)KS_CAL, IF_EB("\033[%p1%dL", ESC_STR "[%p1%dL")},
+# else
+ {(int)KS_CAL, IF_EB("\033[%dL", ESC_STR "[%dL")},
+# endif
+ {(int)KS_DL, IF_EB("\033[M", ESC_STR "[M")},
+# ifdef TERMINFO
+ {(int)KS_CDL, IF_EB("\033[%p1%dM", ESC_STR "[%p1%dM")},
+# else
+ {(int)KS_CDL, IF_EB("\033[%dM", ESC_STR "[%dM")},
+# endif
+ {(int)KS_CL, IF_EB("\033[H\033[2J", ESC_STR "[H" ESC_STR_nc "[2J")},
+ {(int)KS_ME, IF_EB("\033[0m", ESC_STR "[0m")},
+ {(int)KS_MR, IF_EB("\033[7m", ESC_STR "[7m")},
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"},
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, IF_EB("\033[%i%p1%d;%p2%dH",
+ ESC_STR "[%i%p1%d;%p2%dH")},
+# else
+ {(int)KS_CM, IF_EB("\033[%i%d;%dH", ESC_STR "[%i%d;%dH")},
+# endif
+# ifdef TERMINFO
+ {(int)KS_CRI, IF_EB("\033[%p1%dC", ESC_STR "[%p1%dC")},
+# else
+ {(int)KS_CRI, IF_EB("\033[%dC", ESC_STR "[%dC")},
+# endif
+ {K_UP, IF_EB("\033[A", ESC_STR "[A")},
+ {K_DOWN, IF_EB("\033[B", ESC_STR "[B")},
+ {K_RIGHT, IF_EB("\033[C", ESC_STR "[C")},
+ {K_LEFT, IF_EB("\033[D", ESC_STR "[D")},
+ {K_F6, IF_EB("\033[17~", ESC_STR "[17~")},
+ {K_F7, IF_EB("\033[18~", ESC_STR "[18~")},
+ {K_F8, IF_EB("\033[19~", ESC_STR "[19~")},
+ {K_F9, IF_EB("\033[20~", ESC_STR "[20~")},
+ {K_F10, IF_EB("\033[21~", ESC_STR "[21~")},
+/* {K_F11, IF_EB("\033[23~", ESC_STR "[23~")},
+ * (ESC) should not define, sometimes does not work */
+ {K_F12, IF_EB("\033[24~", ESC_STR "[24~")},
+ {K_F13, IF_EB("\033[25~", ESC_STR "[25~")},
+ {K_F14, IF_EB("\033[26~", ESC_STR "[26~")},
+ {K_F15, IF_EB("\033[28~", ESC_STR "[28~")}, /* Help */
+ {K_F16, IF_EB("\033[29~", ESC_STR "[29~")}, /* Select */
+ {K_F17, IF_EB("\033[31~", ESC_STR "[31~")},
+ {K_F18, IF_EB("\033[32~", ESC_STR "[32~")},
+ {K_F19, IF_EB("\033[33~", ESC_STR "[33~")},
+ {K_F20, IF_EB("\033[34~", ESC_STR "[34~")},
+ {K_INS, IF_EB("\033[2~", ESC_STR "[2~")},
+ {K_DEL, IF_EB("\033[3~", ESC_STR "[3~")},
+ {K_HOME, IF_EB("\033[1~", ESC_STR "[1~")},
+ {K_END, IF_EB("\033[4~", ESC_STR "[4~")},
+ {K_PAGEUP, IF_EB("\033[5~", ESC_STR "[5~")},
+ {K_PAGEDOWN, IF_EB("\033[6~", ESC_STR "[6~")},
+ {K_KPLUS, IF_EB("\033Ok", ESC_STR "Ok")}, /* keypad plus */
+ {K_KMINUS, IF_EB("\033Om", ESC_STR "Om")}, /* keypad minus */
+ {K_KDIVIDE, IF_EB("\033Oo", ESC_STR "Oo")}, /* keypad / */
+ {K_KMULTIPLY, IF_EB("\033Oj", ESC_STR "Oj")}, /* keypad * */
+ {K_KENTER, IF_EB("\033OM", ESC_STR "OM")}, /* keypad Enter */
+ {K_BS, "\x7f"}, /* for some reason 0177 doesn't work */
+# endif
+
+# if defined(ALL_BUILTIN_TCAPS) || defined(__MINT__)
+/*
+ * Ordinary vt52
+ */
+ {(int)KS_NAME, "vt52"},
+ {(int)KS_CE, IF_EB("\033K", ESC_STR "K")},
+ {(int)KS_CD, IF_EB("\033J", ESC_STR "J")},
+ {(int)KS_CM, IF_EB("\033Y%+ %+ ", ESC_STR "Y%+ %+ ")},
+ {(int)KS_LE, "\b"},
+# ifdef __MINT__
+ {(int)KS_AL, IF_EB("\033L", ESC_STR "L")},
+ {(int)KS_DL, IF_EB("\033M", ESC_STR "M")},
+ {(int)KS_CL, IF_EB("\033E", ESC_STR "E")},
+ {(int)KS_SR, IF_EB("\033I", ESC_STR "I")},
+ {(int)KS_VE, IF_EB("\033e", ESC_STR "e")},
+ {(int)KS_VI, IF_EB("\033f", ESC_STR "f")},
+ {(int)KS_SO, IF_EB("\033p", ESC_STR "p")},
+ {(int)KS_SE, IF_EB("\033q", ESC_STR "q")},
+ {K_UP, IF_EB("\033A", ESC_STR "A")},
+ {K_DOWN, IF_EB("\033B", ESC_STR "B")},
+ {K_LEFT, IF_EB("\033D", ESC_STR "D")},
+ {K_RIGHT, IF_EB("\033C", ESC_STR "C")},
+ {K_S_UP, IF_EB("\033a", ESC_STR "a")},
+ {K_S_DOWN, IF_EB("\033b", ESC_STR "b")},
+ {K_S_LEFT, IF_EB("\033d", ESC_STR "d")},
+ {K_S_RIGHT, IF_EB("\033c", ESC_STR "c")},
+ {K_F1, IF_EB("\033P", ESC_STR "P")},
+ {K_F2, IF_EB("\033Q", ESC_STR "Q")},
+ {K_F3, IF_EB("\033R", ESC_STR "R")},
+ {K_F4, IF_EB("\033S", ESC_STR "S")},
+ {K_F5, IF_EB("\033T", ESC_STR "T")},
+ {K_F6, IF_EB("\033U", ESC_STR "U")},
+ {K_F7, IF_EB("\033V", ESC_STR "V")},
+ {K_F8, IF_EB("\033W", ESC_STR "W")},
+ {K_F9, IF_EB("\033X", ESC_STR "X")},
+ {K_F10, IF_EB("\033Y", ESC_STR "Y")},
+ {K_S_F1, IF_EB("\033p", ESC_STR "p")},
+ {K_S_F2, IF_EB("\033q", ESC_STR "q")},
+ {K_S_F3, IF_EB("\033r", ESC_STR "r")},
+ {K_S_F4, IF_EB("\033s", ESC_STR "s")},
+ {K_S_F5, IF_EB("\033t", ESC_STR "t")},
+ {K_S_F6, IF_EB("\033u", ESC_STR "u")},
+ {K_S_F7, IF_EB("\033v", ESC_STR "v")},
+ {K_S_F8, IF_EB("\033w", ESC_STR "w")},
+ {K_S_F9, IF_EB("\033x", ESC_STR "x")},
+ {K_S_F10, IF_EB("\033y", ESC_STR "y")},
+ {K_INS, IF_EB("\033I", ESC_STR "I")},
+ {K_HOME, IF_EB("\033E", ESC_STR "E")},
+ {K_PAGEDOWN, IF_EB("\033b", ESC_STR "b")},
+ {K_PAGEUP, IF_EB("\033a", ESC_STR "a")},
+# else
+ {(int)KS_AL, IF_EB("\033T", ESC_STR "T")},
+ {(int)KS_DL, IF_EB("\033U", ESC_STR "U")},
+ {(int)KS_CL, IF_EB("\033H\033J", ESC_STR "H" ESC_STR_nc "J")},
+ {(int)KS_ME, IF_EB("\033SO", ESC_STR "SO")},
+ {(int)KS_MR, IF_EB("\033S2", ESC_STR "S2")},
+ {(int)KS_MS, "y"},
+# endif
+# endif
+
+# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS) || defined(SOME_BUILTIN_TCAPS) || defined(__EMX__)
+/*
+ * The xterm termcap is missing F14 and F15, because they send the same
+ * codes as the undo and help key, although they don't work on all keyboards.
+ */
+ {(int)KS_NAME, "xterm"},
+ {(int)KS_CE, IF_EB("\033[K", ESC_STR "[K")},
+ {(int)KS_AL, IF_EB("\033[L", ESC_STR "[L")},
+# ifdef TERMINFO
+ {(int)KS_CAL, IF_EB("\033[%p1%dL", ESC_STR "[%p1%dL")},
+# else
+ {(int)KS_CAL, IF_EB("\033[%dL", ESC_STR "[%dL")},
+# endif
+ {(int)KS_DL, IF_EB("\033[M", ESC_STR "[M")},
+# ifdef TERMINFO
+ {(int)KS_CDL, IF_EB("\033[%p1%dM", ESC_STR "[%p1%dM")},
+# else
+ {(int)KS_CDL, IF_EB("\033[%dM", ESC_STR "[%dM")},
+# endif
+# ifdef TERMINFO
+ {(int)KS_CS, IF_EB("\033[%i%p1%d;%p2%dr",
+ ESC_STR "[%i%p1%d;%p2%dr")},
+# else
+ {(int)KS_CS, IF_EB("\033[%i%d;%dr", ESC_STR "[%i%d;%dr")},
+# endif
+ {(int)KS_CL, IF_EB("\033[H\033[2J", ESC_STR "[H" ESC_STR_nc "[2J")},
+ {(int)KS_CD, IF_EB("\033[J", ESC_STR "[J")},
+ {(int)KS_ME, IF_EB("\033[m", ESC_STR "[m")},
+ {(int)KS_MR, IF_EB("\033[7m", ESC_STR "[7m")},
+ {(int)KS_MD, IF_EB("\033[1m", ESC_STR "[1m")},
+ {(int)KS_UE, IF_EB("\033[m", ESC_STR "[m")},
+ {(int)KS_US, IF_EB("\033[4m", ESC_STR "[4m")},
+ {(int)KS_MS, "y"},
+ {(int)KS_UT, "y"},
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, IF_EB("\033[%i%p1%d;%p2%dH",
+ ESC_STR "[%i%p1%d;%p2%dH")},
+# else
+ {(int)KS_CM, IF_EB("\033[%i%d;%dH", ESC_STR "[%i%d;%dH")},
+# endif
+ {(int)KS_SR, IF_EB("\033M", ESC_STR "M")},
+# ifdef TERMINFO
+ {(int)KS_CRI, IF_EB("\033[%p1%dC", ESC_STR "[%p1%dC")},
+# else
+ {(int)KS_CRI, IF_EB("\033[%dC", ESC_STR "[%dC")},
+# endif
+ {(int)KS_KS, IF_EB("\033[?1h\033=", ESC_STR "[?1h" ESC_STR_nc "=")},
+ {(int)KS_KE, IF_EB("\033[?1l\033>", ESC_STR "[?1l" ESC_STR_nc ">")},
+# ifdef FEAT_XTERM_SAVE
+ {(int)KS_TI, IF_EB("\0337\033[?47h", ESC_STR "7" ESC_STR_nc "[?47h")},
+ {(int)KS_TE, IF_EB("\033[2J\033[?47l\0338",
+ ESC_STR "[2J" ESC_STR_nc "[?47l" ESC_STR_nc "8")},
+# endif
+ {(int)KS_CIS, IF_EB("\033]1;", ESC_STR "]1;")},
+ {(int)KS_CIE, "\007"},
+ {(int)KS_TS, IF_EB("\033]2;", ESC_STR "]2;")},
+ {(int)KS_FS, "\007"},
+# ifdef TERMINFO
+ {(int)KS_CWS, IF_EB("\033[8;%p1%d;%p2%dt",
+ ESC_STR "[8;%p1%d;%p2%dt")},
+ {(int)KS_CWP, IF_EB("\033[3;%p1%d;%p2%dt",
+ ESC_STR "[3;%p1%d;%p2%dt")},
+# else
+ {(int)KS_CWS, IF_EB("\033[8;%d;%dt", ESC_STR "[8;%d;%dt")},
+ {(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
+# endif
+ {(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
+ {K_UP, IF_EB("\033OA", ESC_STR "OA")},
+ {K_DOWN, IF_EB("\033OB", ESC_STR "OB")},
+ {K_RIGHT, IF_EB("\033OC", ESC_STR "OC")},
+ {K_LEFT, IF_EB("\033OD", ESC_STR "OD")},
+ {K_S_UP, IF_EB("\033O2A", ESC_STR "O2A")},
+ {K_S_DOWN, IF_EB("\033O2B", ESC_STR "O2B")},
+ {K_S_RIGHT, IF_EB("\033O2C", ESC_STR "O2C")},
+ {K_C_RIGHT, IF_EB("\033O5C", ESC_STR "O5C")},
+ {K_S_LEFT, IF_EB("\033O2D", ESC_STR "O2D")},
+ {K_C_LEFT, IF_EB("\033O5D", ESC_STR "O5D")},
+ /* An extra set of function keys for vt100 mode */
+ {K_XF1, IF_EB("\033OP", ESC_STR "OP")},
+ {K_XF2, IF_EB("\033OQ", ESC_STR "OQ")},
+ {K_XF3, IF_EB("\033OR", ESC_STR "OR")},
+ {K_XF4, IF_EB("\033OS", ESC_STR "OS")},
+ {K_F1, IF_EB("\033[11~", ESC_STR "[11~")},
+ {K_F2, IF_EB("\033[12~", ESC_STR "[12~")},
+ {K_F3, IF_EB("\033[13~", ESC_STR "[13~")},
+ {K_F4, IF_EB("\033[14~", ESC_STR "[14~")},
+ {K_F5, IF_EB("\033[15~", ESC_STR "[15~")},
+ {K_F6, IF_EB("\033[17~", ESC_STR "[17~")},
+ {K_F7, IF_EB("\033[18~", ESC_STR "[18~")},
+ {K_F8, IF_EB("\033[19~", ESC_STR "[19~")},
+ {K_F9, IF_EB("\033[20~", ESC_STR "[20~")},
+ {K_F10, IF_EB("\033[21~", ESC_STR "[21~")},
+ {K_F11, IF_EB("\033[23~", ESC_STR "[23~")},
+ {K_F12, IF_EB("\033[24~", ESC_STR "[24~")},
+ {K_S_XF1, IF_EB("\033O2P", ESC_STR "O2P")},
+ {K_S_XF2, IF_EB("\033O2Q", ESC_STR "O2Q")},
+ {K_S_XF3, IF_EB("\033O2R", ESC_STR "O2R")},
+ {K_S_XF4, IF_EB("\033O2S", ESC_STR "O2S")},
+ {K_S_F1, IF_EB("\033[11;2~", ESC_STR "[11;2~")},
+ {K_S_F2, IF_EB("\033[12;2~", ESC_STR "[12;2~")},
+ {K_S_F3, IF_EB("\033[13;2~", ESC_STR "[13;2~")},
+ {K_S_F4, IF_EB("\033[14;2~", ESC_STR "[14;2~")},
+ {K_S_F5, IF_EB("\033[15;2~", ESC_STR "[15;2~")},
+ {K_S_F6, IF_EB("\033[17;2~", ESC_STR "[17;2~")},
+ {K_S_F7, IF_EB("\033[18;2~", ESC_STR "[18;2~")},
+ {K_S_F8, IF_EB("\033[19;2~", ESC_STR "[19;2~")},
+ {K_S_F9, IF_EB("\033[20;2~", ESC_STR "[20;2~")},
+ {K_S_F10, IF_EB("\033[21;2~", ESC_STR "[21;2~")},
+ {K_S_F11, IF_EB("\033[23;2~", ESC_STR "[23;2~")},
+ {K_S_F12, IF_EB("\033[24;2~", ESC_STR "[24;2~")},
+ {K_S_TAB, IF_EB("\033[Z", ESC_STR "[Z")},
+ {K_HELP, IF_EB("\033[28~", ESC_STR "[28~")},
+ {K_UNDO, IF_EB("\033[26~", ESC_STR "[26~")},
+ {K_INS, IF_EB("\033[2~", ESC_STR "[2~")},
+ {K_HOME, IF_EB("\033[7~", ESC_STR "[7~")},
+ {K_S_HOME, IF_EB("\033O2H", ESC_STR "O2H")},
+ {K_C_HOME, IF_EB("\033O5H", ESC_STR "O5H")},
+ {K_KHOME, IF_EB("\033[1~", ESC_STR "[1~")},
+ {K_XHOME, IF_EB("\033OH", ESC_STR "OH")}, /* alternate Home */
+ {K_END, IF_EB("\033[8~", ESC_STR "[8~")},
+ {K_S_END, IF_EB("\033O2F", ESC_STR "O2F")},
+ {K_C_END, IF_EB("\033O5F", ESC_STR "O5F")},
+ {K_KEND, IF_EB("\033[4~", ESC_STR "[4~")},
+ {K_XEND, IF_EB("\033OF", ESC_STR "OF")}, /* alternate End */
+ {K_PAGEUP, IF_EB("\033[5~", ESC_STR "[5~")},
+ {K_PAGEDOWN, IF_EB("\033[6~", ESC_STR "[6~")},
+ {K_KPLUS, IF_EB("\033Ok", ESC_STR "Ok")}, /* keypad plus */
+ {K_KMINUS, IF_EB("\033Om", ESC_STR "Om")}, /* keypad minus */
+ {K_KDIVIDE, IF_EB("\033Oo", ESC_STR "Oo")}, /* keypad / */
+ {K_KMULTIPLY, IF_EB("\033Oj", ESC_STR "Oj")}, /* keypad * */
+ {K_KENTER, IF_EB("\033OM", ESC_STR "OM")}, /* keypad Enter */
+ {K_KDEL, IF_EB("\033[3~", ESC_STR "[3~")}, /* keypad Del */
+
+ {BT_EXTRA_KEYS, ""},
+ {TERMCAP2KEY('k', '0'), IF_EB("\033[10~", ESC_STR "[10~")}, /* F0 */
+ {TERMCAP2KEY('F', '3'), IF_EB("\033[25~", ESC_STR "[25~")}, /* F13 */
+ {TERMCAP2KEY('F', '6'), IF_EB("\033[29~", ESC_STR "[29~")}, /* F16 */
+ {TERMCAP2KEY('F', '7'), IF_EB("\033[31~", ESC_STR "[31~")}, /* F17 */
+ {TERMCAP2KEY('F', '8'), IF_EB("\033[32~", ESC_STR "[32~")}, /* F18 */
+ {TERMCAP2KEY('F', '9'), IF_EB("\033[33~", ESC_STR "[33~")}, /* F19 */
+ {TERMCAP2KEY('F', 'A'), IF_EB("\033[34~", ESC_STR "[34~")}, /* F20 */
+# endif
+
+# if defined(UNIX) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * iris-ansi for Silicon Graphics machines.
+ */
+ {(int)KS_NAME, "iris-ansi"},
+ {(int)KS_CE, "\033[K"},
+ {(int)KS_CD, "\033[J"},
+ {(int)KS_AL, "\033[L"},
+# ifdef TERMINFO
+ {(int)KS_CAL, "\033[%p1%dL"},
+# else
+ {(int)KS_CAL, "\033[%dL"},
+# endif
+ {(int)KS_DL, "\033[M"},
+# ifdef TERMINFO
+ {(int)KS_CDL, "\033[%p1%dM"},
+# else
+ {(int)KS_CDL, "\033[%dM"},
+# endif
+#if 0 /* The scroll region is not working as Vim expects. */
+# ifdef TERMINFO
+ {(int)KS_CS, "\033[%i%p1%d;%p2%dr"},
+# else
+ {(int)KS_CS, "\033[%i%d;%dr"},
+# endif
+#endif
+ {(int)KS_CL, "\033[H\033[2J"},
+ {(int)KS_VE, "\033[9/y\033[12/y"}, /* These aren't documented */
+ {(int)KS_VS, "\033[10/y\033[=1h\033[=2l"}, /* These aren't documented */
+ {(int)KS_TI, "\033[=6h"},
+ {(int)KS_TE, "\033[=6l"},
+ {(int)KS_SE, "\033[21;27m"},
+ {(int)KS_SO, "\033[1;7m"},
+ {(int)KS_ME, "\033[m"},
+ {(int)KS_MR, "\033[7m"},
+ {(int)KS_MD, "\033[1m"},
+ {(int)KS_CCO, "8"}, /* allow 8 colors */
+ {(int)KS_CZH, "\033[3m"}, /* italic mode on */
+ {(int)KS_CZR, "\033[23m"}, /* italic mode off */
+ {(int)KS_US, "\033[4m"}, /* underline on */
+ {(int)KS_UE, "\033[24m"}, /* underline off */
+# ifdef TERMINFO
+ {(int)KS_CAB, "\033[4%p1%dm"}, /* set background color (ANSI) */
+ {(int)KS_CAF, "\033[3%p1%dm"}, /* set foreground color (ANSI) */
+ {(int)KS_CSB, "\033[102;%p1%dm"}, /* set screen background color */
+ {(int)KS_CSF, "\033[101;%p1%dm"}, /* set screen foreground color */
+# else
+ {(int)KS_CAB, "\033[4%dm"}, /* set background color (ANSI) */
+ {(int)KS_CAF, "\033[3%dm"}, /* set foreground color (ANSI) */
+ {(int)KS_CSB, "\033[102;%dm"}, /* set screen background color */
+ {(int)KS_CSF, "\033[101;%dm"}, /* set screen foreground color */
+# endif
+ {(int)KS_MS, "y"}, /* guessed */
+ {(int)KS_UT, "y"}, /* guessed */
+ {(int)KS_LE, "\b"},
+# ifdef TERMINFO
+ {(int)KS_CM, "\033[%i%p1%d;%p2%dH"},
+# else
+ {(int)KS_CM, "\033[%i%d;%dH"},
+# endif
+ {(int)KS_SR, "\033M"},
+# ifdef TERMINFO
+ {(int)KS_CRI, "\033[%p1%dC"},
+# else
+ {(int)KS_CRI, "\033[%dC"},
+# endif
+ {(int)KS_CIS, "\033P3.y"},
+ {(int)KS_CIE, "\234"}, /* ST "String Terminator" */
+ {(int)KS_TS, "\033P1.y"},
+ {(int)KS_FS, "\234"}, /* ST "String Terminator" */
+# ifdef TERMINFO
+ {(int)KS_CWS, "\033[203;%p1%d;%p2%d/y"},
+ {(int)KS_CWP, "\033[205;%p1%d;%p2%d/y"},
+# else
+ {(int)KS_CWS, "\033[203;%d;%d/y"},
+ {(int)KS_CWP, "\033[205;%d;%d/y"},
+# endif
+ {K_UP, "\033[A"},
+ {K_DOWN, "\033[B"},
+ {K_LEFT, "\033[D"},
+ {K_RIGHT, "\033[C"},
+ {K_S_UP, "\033[161q"},
+ {K_S_DOWN, "\033[164q"},
+ {K_S_LEFT, "\033[158q"},
+ {K_S_RIGHT, "\033[167q"},
+ {K_F1, "\033[001q"},
+ {K_F2, "\033[002q"},
+ {K_F3, "\033[003q"},
+ {K_F4, "\033[004q"},
+ {K_F5, "\033[005q"},
+ {K_F6, "\033[006q"},
+ {K_F7, "\033[007q"},
+ {K_F8, "\033[008q"},
+ {K_F9, "\033[009q"},
+ {K_F10, "\033[010q"},
+ {K_F11, "\033[011q"},
+ {K_F12, "\033[012q"},
+ {K_S_F1, "\033[013q"},
+ {K_S_F2, "\033[014q"},
+ {K_S_F3, "\033[015q"},
+ {K_S_F4, "\033[016q"},
+ {K_S_F5, "\033[017q"},
+ {K_S_F6, "\033[018q"},
+ {K_S_F7, "\033[019q"},
+ {K_S_F8, "\033[020q"},
+ {K_S_F9, "\033[021q"},
+ {K_S_F10, "\033[022q"},
+ {K_S_F11, "\033[023q"},
+ {K_S_F12, "\033[024q"},
+ {K_INS, "\033[139q"},
+ {K_HOME, "\033[H"},
+ {K_END, "\033[146q"},
+ {K_PAGEUP, "\033[150q"},
+ {K_PAGEDOWN, "\033[154q"},
+# endif
+
+# if defined(DEBUG) || defined(ALL_BUILTIN_TCAPS)
+/*
+ * for debugging
+ */
+ {(int)KS_NAME, "debug"},
+ {(int)KS_CE, "[CE]"},
+ {(int)KS_CD, "[CD]"},
+ {(int)KS_AL, "[AL]"},
+# ifdef TERMINFO
+ {(int)KS_CAL, "[CAL%p1%d]"},
+# else
+ {(int)KS_CAL, "[CAL%d]"},
+# endif
+ {(int)KS_DL, "[DL]"},
+# ifdef TERMINFO
+ {(int)KS_CDL, "[CDL%p1%d]"},
+# else
+ {(int)KS_CDL, "[CDL%d]"},
+# endif
+# ifdef TERMINFO
+ {(int)KS_CS, "[%p1%dCS%p2%d]"},
+# else
+ {(int)KS_CS, "[%dCS%d]"},
+# endif
+# ifdef FEAT_VERTSPLIT
+# ifdef TERMINFO
+ {(int)KS_CSV, "[%p1%dCSV%p2%d]"},
+# else
+ {(int)KS_CSV, "[%dCSV%d]"},
+# endif
+# endif
+# ifdef TERMINFO
+ {(int)KS_CAB, "[CAB%p1%d]"},
+ {(int)KS_CAF, "[CAF%p1%d]"},
+ {(int)KS_CSB, "[CSB%p1%d]"},
+ {(int)KS_CSF, "[CSF%p1%d]"},
+# else
+ {(int)KS_CAB, "[CAB%d]"},
+ {(int)KS_CAF, "[CAF%d]"},
+ {(int)KS_CSB, "[CSB%d]"},
+ {(int)KS_CSF, "[CSF%d]"},
+# endif
+ {(int)KS_OP, "[OP]"},
+ {(int)KS_LE, "[LE]"},
+ {(int)KS_CL, "[CL]"},
+ {(int)KS_VI, "[VI]"},
+ {(int)KS_VE, "[VE]"},
+ {(int)KS_VS, "[VS]"},
+ {(int)KS_ME, "[ME]"},
+ {(int)KS_MR, "[MR]"},
+ {(int)KS_MB, "[MB]"},
+ {(int)KS_MD, "[MD]"},
+ {(int)KS_SE, "[SE]"},
+ {(int)KS_SO, "[SO]"},
+ {(int)KS_UE, "[UE]"},
+ {(int)KS_US, "[US]"},
+ {(int)KS_MS, "[MS]"},
+ {(int)KS_UT, "[UT]"},
+# ifdef TERMINFO
+ {(int)KS_CM, "[%p1%dCM%p2%d]"},
+# else
+ {(int)KS_CM, "[%dCM%d]"},
+# endif
+ {(int)KS_SR, "[SR]"},
+# ifdef TERMINFO
+ {(int)KS_CRI, "[CRI%p1%d]"},
+# else
+ {(int)KS_CRI, "[CRI%d]"},
+# endif
+ {(int)KS_VB, "[VB]"},
+ {(int)KS_KS, "[KS]"},
+ {(int)KS_KE, "[KE]"},
+ {(int)KS_TI, "[TI]"},
+ {(int)KS_TE, "[TE]"},
+ {(int)KS_CIS, "[CIS]"},
+ {(int)KS_CIE, "[CIE]"},
+ {(int)KS_TS, "[TS]"},
+ {(int)KS_FS, "[FS]"},
+# ifdef TERMINFO
+ {(int)KS_CWS, "[%p1%dCWS%p2%d]"},
+ {(int)KS_CWP, "[%p1%dCWP%p2%d]"},
+# else
+ {(int)KS_CWS, "[%dCWS%d]"},
+ {(int)KS_CWP, "[%dCWP%d]"},
+# endif
+ {(int)KS_CRV, "[CRV]"},
+ {K_UP, "[KU]"},
+ {K_DOWN, "[KD]"},
+ {K_LEFT, "[KL]"},
+ {K_RIGHT, "[KR]"},
+ {K_S_UP, "[S-KU]"},
+ {K_S_DOWN, "[S-KD]"},
+ {K_S_LEFT, "[S-KL]"},
+ {K_C_LEFT, "[C-KL]"},
+ {K_S_RIGHT, "[S-KR]"},
+ {K_C_RIGHT, "[C-KR]"},
+ {K_F1, "[F1]"},
+ {K_XF1, "[xF1]"},
+ {K_F2, "[F2]"},
+ {K_XF2, "[xF2]"},
+ {K_F3, "[F3]"},
+ {K_XF3, "[xF3]"},
+ {K_F4, "[F4]"},
+ {K_XF4, "[xF4]"},
+ {K_F5, "[F5]"},
+ {K_F6, "[F6]"},
+ {K_F7, "[F7]"},
+ {K_F8, "[F8]"},
+ {K_F9, "[F9]"},
+ {K_F10, "[F10]"},
+ {K_F11, "[F11]"},
+ {K_F12, "[F12]"},
+ {K_S_F1, "[S-F1]"},
+ {K_S_XF1, "[S-xF1]"},
+ {K_S_F2, "[S-F2]"},
+ {K_S_XF2, "[S-xF2]"},
+ {K_S_F3, "[S-F3]"},
+ {K_S_XF3, "[S-xF3]"},
+ {K_S_F4, "[S-F4]"},
+ {K_S_XF4, "[S-xF4]"},
+ {K_S_F5, "[S-F5]"},
+ {K_S_F6, "[S-F6]"},
+ {K_S_F7, "[S-F7]"},
+ {K_S_F8, "[S-F8]"},
+ {K_S_F9, "[S-F9]"},
+ {K_S_F10, "[S-F10]"},
+ {K_S_F11, "[S-F11]"},
+ {K_S_F12, "[S-F12]"},
+ {K_HELP, "[HELP]"},
+ {K_UNDO, "[UNDO]"},
+ {K_BS, "[BS]"},
+ {K_INS, "[INS]"},
+ {K_KINS, "[KINS]"},
+ {K_DEL, "[DEL]"},
+ {K_KDEL, "[KDEL]"},
+ {K_HOME, "[HOME]"},
+ {K_S_HOME, "[C-HOME]"},
+ {K_C_HOME, "[C-HOME]"},
+ {K_KHOME, "[KHOME]"},
+ {K_XHOME, "[XHOME]"},
+ {K_END, "[END]"},
+ {K_S_END, "[C-END]"},
+ {K_C_END, "[C-END]"},
+ {K_KEND, "[KEND]"},
+ {K_XEND, "[XEND]"},
+ {K_PAGEUP, "[PAGEUP]"},
+ {K_PAGEDOWN, "[PAGEDOWN]"},
+ {K_KPAGEUP, "[KPAGEUP]"},
+ {K_KPAGEDOWN, "[KPAGEDOWN]"},
+ {K_MOUSE, "[MOUSE]"},
+ {K_KPLUS, "[KPLUS]"},
+ {K_KMINUS, "[KMINUS]"},
+ {K_KDIVIDE, "[KDIVIDE]"},
+ {K_KMULTIPLY, "[KMULTIPLY]"},
+ {K_KENTER, "[KENTER]"},
+ {K_KPOINT, "[KPOINT]"},
+ {K_K0, "[K0]"},
+ {K_K1, "[K1]"},
+ {K_K2, "[K2]"},
+ {K_K3, "[K3]"},
+ {K_K4, "[K4]"},
+ {K_K5, "[K5]"},
+ {K_K6, "[K6]"},
+ {K_K7, "[K7]"},
+ {K_K8, "[K8]"},
+ {K_K9, "[K9]"},
+# endif
+
+#endif /* NO_BUILTIN_TCAPS */
+
+/*
+ * The most minimal terminal: only clear screen and cursor positioning
+ * Always included.
+ */
+ {(int)KS_NAME, "dumb"},
+ {(int)KS_CL, "\014"},
+#ifdef TERMINFO
+ {(int)KS_CM, IF_EB("\033[%i%p1%d;%p2%dH",
+ ESC_STR "[%i%p1%d;%p2%dH")},
+#else
+ {(int)KS_CM, IF_EB("\033[%i%d;%dH", ESC_STR "[%i%d;%dH")},
+#endif
+
+/*
+ * end marker
+ */
+ {(int)KS_NAME, NULL}
+
+}; /* end of builtin_termcaps */
+
+/*
+ * DEFAULT_TERM is used, when no terminal is specified with -T option or $TERM.
+ */
+#ifdef RISCOS
+# define DEFAULT_TERM (char_u *)"riscos"
+#endif
+
+#ifdef AMIGA
+# define DEFAULT_TERM (char_u *)"amiga"
+#endif
+
+#ifdef MSWIN
+# define DEFAULT_TERM (char_u *)"win32"
+#endif
+
+#ifdef MSDOS
+# define DEFAULT_TERM (char_u *)"pcterm"
+#endif
+
+#if defined(UNIX) && !defined(__MINT__)
+# define DEFAULT_TERM (char_u *)"ansi"
+#endif
+
+#ifdef __MINT__
+# define DEFAULT_TERM (char_u *)"vt52"
+#endif
+
+#ifdef __EMX__
+# define DEFAULT_TERM (char_u *)"os2ansi"
+#endif
+
+#ifdef VMS
+# define DEFAULT_TERM (char_u *)"vt320"
+#endif
+
+#ifdef __BEOS__
+# undef DEFAULT_TERM
+# define DEFAULT_TERM (char_u *)"beos-ansi"
+#endif
+
+#ifndef DEFAULT_TERM
+# define DEFAULT_TERM (char_u *)"dumb"
+#endif
+
+/*
+ * Term_strings contains currently used terminal output strings.
+ * It is initialized with the default values by parse_builtin_tcap().
+ * The values can be changed by setting the option with the same name.
+ */
+char_u *(term_strings[(int)KS_LAST + 1]);
+
+static int need_gather = FALSE; /* need to fill termleader[] */
+static char_u termleader[256 + 1]; /* for check_termcode() */
+#ifdef FEAT_TERMRESPONSE
+static int check_for_codes = FALSE; /* check for key code reponse */
+#endif
+
+ static struct builtin_term *
+find_builtin_term(term)
+ char_u *term;
+{
+ struct builtin_term *p;
+
+ p = builtin_termcaps;
+ while (p->bt_string != NULL)
+ {
+ if (p->bt_entry == (int)KS_NAME)
+ {
+#ifdef UNIX
+ if (STRCMP(p->bt_string, "iris-ansi") == 0 && vim_is_iris(term))
+ return p;
+ else if (STRCMP(p->bt_string, "xterm") == 0 && vim_is_xterm(term))
+ return p;
+ else
+#endif
+#ifdef VMS
+ if (STRCMP(p->bt_string, "vt320") == 0 && vim_is_vt300(term))
+ return p;
+ else
+#endif
+ if (STRCMP(term, p->bt_string) == 0)
+ return p;
+ }
+ ++p;
+ }
+ return p;
+}
+
+/*
+ * Parsing of the builtin termcap entries.
+ * Caller should check if 'name' is a valid builtin term.
+ * The terminal's name is not set, as this is already done in termcapinit().
+ */
+ static void
+parse_builtin_tcap(term)
+ char_u *term;
+{
+ struct builtin_term *p;
+ char_u name[2];
+ int term_8bit;
+
+ p = find_builtin_term(term);
+ term_8bit = term_is_8bit(term);
+
+ /* Do not parse if builtin term not found */
+ if (p->bt_string == NULL)
+ return;
+
+ for (++p; p->bt_entry != (int)KS_NAME && p->bt_entry != BT_EXTRA_KEYS; ++p)
+ {
+ if ((int)p->bt_entry >= 0) /* KS_xx entry */
+ {
+ /* Only set the value if it wasn't set yet. */
+ if (term_strings[p->bt_entry] == NULL
+ || term_strings[p->bt_entry] == empty_option)
+ {
+ /* 8bit terminal: use CSI instead of <Esc>[ */
+ if (term_8bit && term_7to8bit((char_u *)p->bt_string) != 0)
+ {
+ char_u *s, *t;
+
+ s = vim_strsave((char_u *)p->bt_string);
+ if (s != NULL)
+ {
+ for (t = s; *t; ++t)
+ if (term_7to8bit(t))
+ {
+ *t = term_7to8bit(t);
+ STRCPY(t + 1, t + 2);
+ }
+ term_strings[p->bt_entry] = s;
+ set_term_option_alloced(&term_strings[p->bt_entry]);
+ }
+ }
+ else
+ term_strings[p->bt_entry] = (char_u *)p->bt_string;
+ }
+ }
+ else
+ {
+ name[0] = KEY2TERMCAP0((int)p->bt_entry);
+ name[1] = KEY2TERMCAP1((int)p->bt_entry);
+ if (find_termcode(name) == NULL)
+ add_termcode(name, (char_u *)p->bt_string, term_8bit);
+ }
+ }
+}
+#if defined(HAVE_TGETENT) || defined(FEAT_TERMRESPONSE)
+static void set_color_count __ARGS((int nr));
+
+/*
+ * Set number of colors.
+ * Store it as a number in t_colors.
+ * Store it as a string in T_CCO (using nr_colors[]).
+ */
+ static void
+set_color_count(nr)
+ int nr;
+{
+ char_u nr_colors[20]; /* string for number of colors */
+
+ t_colors = nr;
+ if (t_colors > 1)
+ sprintf((char *)nr_colors, "%d", t_colors);
+ else
+ *nr_colors = NUL;
+ set_string_option_direct((char_u *)"t_Co", -1, nr_colors, OPT_FREE);
+}
+#endif
+
+#ifdef HAVE_TGETENT
+static char *(key_names[]) =
+{
+#ifdef FEAT_TERMRESPONSE
+ /* Do this one first, it may cause a screen redraw. */
+ "Co",
+#endif
+ "ku", "kd", "kr", "kl",
+# ifdef ARCHIE
+ "su", "sd", /* Termcap code made up! */
+# endif
+ "#2", "#4", "%i", "*7",
+ "k1", "k2", "k3", "k4", "k5", "k6",
+ "k7", "k8", "k9", "k;", "F1", "F2",
+ "%1", "&8", "kb", "kI", "kD", "kh",
+ "@7", "kP", "kN", "K1", "K3", "K4", "K5", "kB",
+ NULL
+};
+#endif
+
+/*
+ * Set terminal options for terminal "term".
+ * Return OK if terminal 'term' was found in a termcap, FAIL otherwise.
+ *
+ * While doing this, until ttest(), some options may be NULL, be careful.
+ */
+ int
+set_termname(term)
+ char_u *term;
+{
+ struct builtin_term *termp;
+#ifdef HAVE_TGETENT
+ int builtin_first = p_tbi;
+ int try;
+ int termcap_cleared = FALSE;
+#endif
+ int width = 0, height = 0;
+ char_u *error_msg = NULL;
+ char_u *bs_p, *del_p;
+
+ detected_8bit = FALSE; /* reset 8-bit detection */
+
+ if (term_is_builtin(term))
+ {
+ term += 8;
+#ifdef HAVE_TGETENT
+ builtin_first = 1;
+#endif
+ }
+
+/*
+ * If HAVE_TGETENT is not defined, only the builtin termcap is used, otherwise:
+ * If builtin_first is TRUE:
+ * 0. try builtin termcap
+ * 1. try external termcap
+ * 2. if both fail default to a builtin terminal
+ * If builtin_first is FALSE:
+ * 1. try external termcap
+ * 2. try builtin termcap, if both fail default to a builtin terminal
+ */
+#ifdef HAVE_TGETENT
+ for (try = builtin_first ? 0 : 1; try < 3; ++try)
+ {
+ /*
+ * Use external termcap
+ */
+ if (try == 1)
+ {
+ char_u *p;
+ static char_u tstrbuf[TBUFSZ];
+ int i;
+ char_u tbuf[TBUFSZ];
+ char_u *tp;
+ static struct {
+ enum SpecialKey dest; /* index in term_strings[] */
+ char *name; /* termcap name for string */
+ } string_names[] =
+ { {KS_CE, "ce"}, {KS_AL, "al"}, {KS_CAL,"AL"},
+ {KS_DL, "dl"}, {KS_CDL,"DL"}, {KS_CS, "cs"},
+ {KS_CL, "cl"}, {KS_CD, "cd"},
+ {KS_VI, "vi"}, {KS_VE, "ve"}, {KS_MB, "mb"},
+ {KS_VS, "vs"}, {KS_ME, "me"}, {KS_MR, "mr"},
+ {KS_MD, "md"}, {KS_SE, "se"}, {KS_SO, "so"},
+ {KS_CZH,"ZH"}, {KS_CZR,"ZR"}, {KS_UE, "ue"},
+ {KS_US, "us"}, {KS_CM, "cm"}, {KS_SR, "sr"},
+ {KS_CRI,"RI"}, {KS_VB, "vb"}, {KS_KS, "ks"},
+ {KS_KE, "ke"}, {KS_TI, "ti"}, {KS_TE, "te"},
+ {KS_BC, "bc"}, {KS_CSB,"Sb"}, {KS_CSF,"Sf"},
+ {KS_CAB,"AB"}, {KS_CAF,"AF"}, {KS_LE, "le"},
+ {KS_ND, "nd"}, {KS_OP, "op"}, {KS_CRV, "RV"},
+ {KS_CIS, "IS"}, {KS_CIE, "IE"},
+ {KS_TS, "ts"}, {KS_FS, "fs"},
+ {KS_CWP, "WP"}, {KS_CWS, "WS"},
+ {(enum SpecialKey)0, NULL}
+ };
+
+ /*
+ * If the external termcap does not have a matching entry, try the
+ * builtin ones.
+ */
+ if ((error_msg = tgetent_error(tbuf, term)) == NULL)
+ {
+ tp = tstrbuf;
+ if (!termcap_cleared)
+ {
+ clear_termoptions(); /* clear old options */
+ termcap_cleared = TRUE;
+ }
+
+ /* get output strings */
+ for (i = 0; string_names[i].name != NULL; ++i)
+ {
+ if (term_str(string_names[i].dest) == NULL
+ || term_str(string_names[i].dest) == empty_option)
+ term_str(string_names[i].dest) =
+ TGETSTR(string_names[i].name, &tp);
+ }
+
+ /* tgetflag() returns 1 if the flag is present, 0 if not and
+ * possibly -1 if the flag doesn't exist. */
+ if ((T_MS == NULL || T_MS == empty_option)
+ && tgetflag("ms") > 0)
+ T_MS = (char_u *)"y";
+ if ((T_XS == NULL || T_XS == empty_option)
+ && tgetflag("xs") > 0)
+ T_XS = (char_u *)"y";
+ if ((T_DB == NULL || T_DB == empty_option)
+ && tgetflag("db") > 0)
+ T_DB = (char_u *)"y";
+ if ((T_DA == NULL || T_DA == empty_option)
+ && tgetflag("da") > 0)
+ T_DA = (char_u *)"y";
+ if ((T_UT == NULL || T_UT == empty_option)
+ && tgetflag("ut") > 0)
+ T_UT = (char_u *)"y";
+
+
+ /*
+ * get key codes
+ */
+ for (i = 0; key_names[i] != NULL; ++i)
+ {
+ if (find_termcode((char_u *)key_names[i]) == NULL)
+ {
+ p = TGETSTR(key_names[i], &tp);
+ /* if cursor-left == backspace, ignore it (televideo
+ * 925) */
+ if (p != NULL
+ && (*p != Ctrl_H
+ || key_names[i][0] != 'k'
+ || key_names[i][1] != 'l'))
+ add_termcode((char_u *)key_names[i], p, FALSE);
+ }
+ }
+
+ if (height == 0)
+ height = tgetnum("li");
+ if (width == 0)
+ width = tgetnum("co");
+
+ /*
+ * Get number of colors (if not done already).
+ */
+ if (term_str(KS_CCO) == NULL
+ || term_str(KS_CCO) == empty_option)
+ set_color_count(tgetnum("Co"));
+
+# ifndef hpux
+ BC = (char *)TGETSTR("bc", &tp);
+ UP = (char *)TGETSTR("up", &tp);
+ p = TGETSTR("pc", &tp);
+ if (p)
+ PC = *p;
+# endif /* hpux */
+ }
+ }
+ else /* try == 0 || try == 2 */
+#endif /* HAVE_TGETENT */
+ /*
+ * Use builtin termcap
+ */
+ {
+#ifdef HAVE_TGETENT
+ /*
+ * If builtin termcap was already used, there is no need to search
+ * for the builtin termcap again, quit now.
+ */
+ if (try == 2 && builtin_first && termcap_cleared)
+ break;
+#endif
+ /*
+ * search for 'term' in builtin_termcaps[]
+ */
+ termp = find_builtin_term(term);
+ if (termp->bt_string == NULL) /* did not find it */
+ {
+#ifdef HAVE_TGETENT
+ /*
+ * If try == 0, first try the external termcap. If that is not
+ * found we'll get back here with try == 2.
+ * If termcap_cleared is set we used the external termcap,
+ * don't complain about not finding the term in the builtin
+ * termcap.
+ */
+ if (try == 0) /* try external one */
+ continue;
+ if (termcap_cleared) /* found in external termcap */
+ break;
+#endif
+
+ mch_errmsg("\r\n");
+ if (error_msg != NULL)
+ {
+ mch_errmsg((char *)error_msg);
+ mch_errmsg("\r\n");
+ }
+ mch_errmsg("'");
+ mch_errmsg((char *)term);
+ mch_errmsg(_("' not known. Available builtin terminals are:"));
+ mch_errmsg("\r\n");
+ for (termp = &(builtin_termcaps[0]); termp->bt_string != NULL;
+ ++termp)
+ {
+ if (termp->bt_entry == (int)KS_NAME)
+ {
+#ifdef HAVE_TGETENT
+ mch_errmsg(" builtin_");
+#else
+ mch_errmsg(" ");
+#endif
+ mch_errmsg(termp->bt_string);
+ mch_errmsg("\r\n");
+ }
+ }
+ /* when user typed :set term=xxx, quit here */
+ if (starting != NO_SCREEN)
+ {
+ screen_start(); /* don't know where cursor is now */
+ wait_return(TRUE);
+ return FAIL;
+ }
+ term = DEFAULT_TERM;
+ mch_errmsg(_("defaulting to '"));
+ mch_errmsg((char *)term);
+ mch_errmsg("'\r\n");
+ if (emsg_silent == 0)
+ {
+ screen_start(); /* don't know where cursor is now */
+ out_flush();
+ ui_delay(2000L, TRUE);
+ }
+ set_string_option_direct((char_u *)"term", -1, term, OPT_FREE);
+ display_errors();
+ }
+ out_flush();
+#ifdef HAVE_TGETENT
+ if (!termcap_cleared)
+ {
+#endif
+ clear_termoptions(); /* clear old options */
+#ifdef HAVE_TGETENT
+ termcap_cleared = TRUE;
+ }
+#endif
+ parse_builtin_tcap(term);
+#ifdef FEAT_GUI
+ if (term_is_gui(term))
+ {
+ out_flush();
+ gui_init();
+ /* If starting the GUI failed, don't do any of the other
+ * things for this terminal */
+ if (!gui.in_use)
+ return FAIL;
+#ifdef HAVE_TGETENT
+ break; /* don't try using external termcap */
+#endif
+ }
+#endif /* FEAT_GUI */
+ }
+#ifdef HAVE_TGETENT
+ }
+#endif
+
+/*
+ * special: There is no info in the termcap about whether the cursor
+ * positioning is relative to the start of the screen or to the start of the
+ * scrolling region. We just guess here. Only msdos pcterm is known to do it
+ * relative.
+ */
+ if (STRCMP(term, "pcterm") == 0)
+ T_CCS = (char_u *)"yes";
+ else
+ T_CCS = empty_option;
+
+#ifdef UNIX
+/*
+ * Any "stty" settings override the default for t_kb from the termcap.
+ * This is in os_unix.c, because it depends a lot on the version of unix that
+ * is being used.
+ * Don't do this when the GUI is active, it uses "t_kb" and "t_kD" directly.
+ */
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+#endif
+ get_stty();
+#endif
+
+/*
+ * If the termcap has no entry for 'bs' and/or 'del' and the ioctl() also
+ * didn't work, use the default CTRL-H
+ * The default for t_kD is DEL, unless t_kb is DEL.
+ * The vim_strsave'd strings are probably lost forever, well it's only two
+ * bytes. Don't do this when the GUI is active, it uses "t_kb" and "t_kD"
+ * directly.
+ */
+#ifdef FEAT_GUI
+ if (!gui.in_use)
+#endif
+ {
+ bs_p = find_termcode((char_u *)"kb");
+ del_p = find_termcode((char_u *)"kD");
+ if (bs_p == NULL || *bs_p == NUL)
+ add_termcode((char_u *)"kb", (bs_p = (char_u *)CTRL_H_STR), FALSE);
+ if ((del_p == NULL || *del_p == NUL) &&
+ (bs_p == NULL || *bs_p != DEL))
+ add_termcode((char_u *)"kD", (char_u *)DEL_STR, FALSE);
+ }
+
+#if defined(UNIX) || defined(VMS)
+ term_is_xterm = vim_is_xterm(term);
+#endif
+
+#ifdef FEAT_MOUSE
+# if defined(UNIX) || defined(VMS)
+# ifdef FEAT_MOUSE_TTY
+ /*
+ * For Unix, set the 'ttymouse' option to the type of mouse to be used.
+ * The termcode for the mouse is added as a side effect in option.c.
+ */
+ {
+ char_u *p;
+
+ p = (char_u *)"";
+# ifdef FEAT_MOUSE_XTERM
+# ifdef FEAT_CLIPBOARD
+# ifdef FEAT_GUI
+ if (!gui.in_use)
+# endif
+ clip_init(FALSE);
+# endif
+ if (term_is_xterm)
+ {
+ if (use_xterm_mouse())
+ p = NULL; /* keep existing value, might be "xterm2" */
+ else
+ p = (char_u *)"xterm";
+ }
+# endif
+ if (p != NULL)
+ set_option_value((char_u *)"ttym", 0L, p, 0);
+ if (p == NULL
+# ifdef FEAT_GUI
+ || gui.in_use
+# endif
+ )
+ check_mouse_termcode(); /* set mouse termcode anyway */
+ }
+# endif
+# else
+ set_mouse_termcode(KS_MOUSE, (char_u *)"\233M");
+# endif
+#endif /* FEAT_MOUSE */
+
+#ifdef FEAT_SNIFF
+ {
+ char_u name[2];
+
+ name[0] = (int)KS_EXTRA;
+ name[1] = (int)KE_SNIFF;
+ add_termcode(name, (char_u *)"\233sniff", FALSE);
+ }
+#endif
+
+#ifdef USE_TERM_CONSOLE
+ /* DEFAULT_TERM indicates that it is the machine console. */
+ if (STRCMP(term, DEFAULT_TERM) != 0)
+ term_console = FALSE;
+ else
+ {
+ term_console = TRUE;
+# ifdef AMIGA
+ win_resize_on(); /* enable window resizing reports */
+# endif
+ }
+#endif
+
+#if defined(UNIX) || defined(VMS)
+ /*
+ * 'ttyfast' is default on for xterm, iris-ansi and a few others.
+ */
+ if (vim_is_fastterm(term))
+ p_tf = TRUE;
+#endif
+#ifdef USE_TERM_CONSOLE
+ /*
+ * 'ttyfast' is default on consoles
+ */
+ if (term_console)
+ p_tf = TRUE;
+#endif
+
+ ttest(TRUE); /* make sure we have a valid set of terminal codes */
+
+ full_screen = TRUE; /* we can use termcap codes from now on */
+ set_term_defaults(); /* use current values as defaults */
+#ifdef FEAT_TERMRESPONSE
+ crv_status = CRV_GET; /* Get terminal version later */
+#endif
+
+ /*
+ * Initialize the terminal with the appropriate termcap codes.
+ * Set the mouse and window title if possible.
+ * Don't do this when starting, need to parse the .vimrc first, because it
+ * may redefine t_TI etc.
+ */
+ if (starting != NO_SCREEN)
+ {
+ starttermcap(); /* may change terminal mode */
+#ifdef FEAT_MOUSE
+ setmouse(); /* may start using the mouse */
+#endif
+#ifdef FEAT_TITLE
+ maketitle(); /* may display window title */
+#endif
+ }
+
+ /* display initial screen after ttest() checking. jw. */
+ if (width <= 0 || height <= 0)
+ {
+ /* termcap failed to report size */
+ /* set defaults, in case ui_get_shellsize() also fails */
+ width = 80;
+#if defined(MSDOS) || defined(WIN3264)
+ height = 25; /* console is often 25 lines */
+#else
+ height = 24; /* most terminals are 24 lines */
+#endif
+ }
+ set_shellsize(width, height, FALSE); /* may change Rows */
+ if (starting != NO_SCREEN)
+ {
+ if (scroll_region)
+ scroll_region_reset(); /* In case Rows changed */
+ check_map_keycodes(); /* check mappings for terminal codes used */
+
+#ifdef FEAT_AUTOCMD
+ {
+ buf_T *old_curbuf;
+
+ /*
+ * Execute the TermChanged autocommands for each buffer that is
+ * loaded.
+ */
+ old_curbuf = curbuf;
+ for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
+ {
+ if (curbuf->b_ml.ml_mfp != NULL)
+ apply_autocmds(EVENT_TERMCHANGED, NULL, NULL, FALSE,
+ curbuf);
+ }
+ if (buf_valid(old_curbuf))
+ curbuf = old_curbuf;
+ }
+#endif
+ }
+
+#ifdef FEAT_TERMRESPONSE
+ may_req_termresponse();
+#endif
+
+ return OK;
+}
+
+#if defined(FEAT_MOUSE) || defined(PROTO)
+
+# ifdef FEAT_MOUSE_TTY
+# define HMT_NORMAL 1
+# define HMT_NETTERM 2
+# define HMT_DEC 4
+# define HMT_JSBTERM 8
+# define HMT_PTERM 16
+static int has_mouse_termcode = 0;
+# endif
+
+# if (!defined(UNIX) || defined(FEAT_MOUSE_XTERM) || defined(FEAT_MOUSE_NET) \
+ || defined(FEAT_MOUSE_DEC)) || defined(FEAT_MOUSE_JSB) \
+ || defined(FEAT_MOUSE_PTERM) || defined(PROTO)
+ void
+set_mouse_termcode(n, s)
+ int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */
+ char_u *s;
+{
+ char_u name[2];
+
+ name[0] = n;
+ name[1] = KE_FILLER;
+ add_termcode(name, s, FALSE);
+# ifdef FEAT_MOUSE_TTY
+# ifdef FEAT_MOUSE_JSB
+ if (n == KS_JSBTERM_MOUSE)
+ has_mouse_termcode |= HMT_JSBTERM;
+ else
+# endif
+# ifdef FEAT_MOUSE_NET
+ if (n == KS_NETTERM_MOUSE)
+ has_mouse_termcode |= HMT_NETTERM;
+ else
+# endif
+# ifdef FEAT_MOUSE_DEC
+ if (n == KS_DEC_MOUSE)
+ has_mouse_termcode |= HMT_DEC;
+ else
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ if (n == KS_PTERM_MOUSE)
+ has_mouse_termcode |= HMT_PTERM;
+ else
+# endif
+ has_mouse_termcode |= HMT_NORMAL;
+# endif
+}
+# endif
+
+# if ((defined(UNIX) || defined(VMS) || defined(OS2)) \
+ && (defined(FEAT_MOUSE_XTERM) || defined(FEAT_MOUSE_DEC) \
+ || defined(FEAT_MOUSE_GPM) || defined(FEAT_MOUSE_PTERM))) \
+ || defined(PROTO)
+ void
+del_mouse_termcode(n)
+ int n; /* KS_MOUSE, KS_NETTERM_MOUSE or KS_DEC_MOUSE */
+{
+ char_u name[2];
+
+ name[0] = n;
+ name[1] = KE_FILLER;
+ del_termcode(name);
+# ifdef FEAT_MOUSE_TTY
+# ifdef FEAT_MOUSE_JSB
+ if (n == KS_JSBTERM_MOUSE)
+ has_mouse_termcode &= ~HMT_JSBTERM;
+ else
+# endif
+# ifdef FEAT_MOUSE_NET
+ if (n == KS_NETTERM_MOUSE)
+ has_mouse_termcode &= ~HMT_NETTERM;
+ else
+# endif
+# ifdef FEAT_MOUSE_DEC
+ if (n == KS_DEC_MOUSE)
+ has_mouse_termcode &= ~HMT_DEC;
+ else
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ if (n == KS_PTERM_MOUSE)
+ has_mouse_termcode &= ~HMT_PTERM;
+ else
+# endif
+ has_mouse_termcode &= ~HMT_NORMAL;
+# endif
+}
+# endif
+#endif
+
+#ifdef HAVE_TGETENT
+/*
+ * Call tgetent()
+ * Return error message if it fails, NULL if it's OK.
+ */
+ static char_u *
+tgetent_error(tbuf, term)
+ char_u *tbuf;
+ char_u *term;
+{
+ int i;
+
+ i = TGETENT(tbuf, term);
+ if (i < 0 /* -1 is always an error */
+# ifdef TGETENT_ZERO_ERR
+ || i == 0 /* sometimes zero is also an error */
+# endif
+ )
+ {
+ /* On FreeBSD tputs() gets a SEGV after a tgetent() which fails. Call
+ * tgetent() with the always existing "dumb" entry to avoid a crash or
+ * hang. */
+ (void)TGETENT(tbuf, "dumb");
+
+ if (i < 0)
+# ifdef TGETENT_ZERO_ERR
+ return (char_u *)_("E557: Cannot open termcap file");
+ if (i == 0)
+# endif
+#ifdef TERMINFO
+ return (char_u *)_("E558: Terminal entry not found in terminfo");
+#else
+ return (char_u *)_("E559: Terminal entry not found in termcap");
+#endif
+ }
+ return NULL;
+}
+
+/*
+ * Some versions of tgetstr() have been reported to return -1 instead of NULL.
+ * Fix that here.
+ */
+ static char_u *
+vim_tgetstr(s, pp)
+ char *s;
+ char_u **pp;
+{
+ char *p;
+
+ p = tgetstr(s, (char **)pp);
+ if (p == (char *)-1)
+ p = NULL;
+ return (char_u *)p;
+}
+#endif /* HAVE_TGETENT */
+
+#if defined(HAVE_TGETENT) && (defined(UNIX) || defined(__EMX__) || defined(VMS) || defined(MACOS_X))
+/*
+ * Get Columns and Rows from the termcap. Used after a window signal if the
+ * ioctl() fails. It doesn't make sense to call tgetent each time if the "co"
+ * and "li" entries never change. But on some systems this works.
+ * Errors while getting the entries are ignored.
+ */
+ void
+getlinecol(cp, rp)
+ long *cp; /* pointer to columns */
+ long *rp; /* pointer to rows */
+{
+ char_u tbuf[TBUFSZ];
+
+ if (T_NAME != NULL && *T_NAME != NUL && tgetent_error(tbuf, T_NAME) == NULL)
+ {
+ if (*cp == 0)
+ *cp = tgetnum("co");
+ if (*rp == 0)
+ *rp = tgetnum("li");
+ }
+}
+#endif /* defined(HAVE_TGETENT) && defined(UNIX) */
+
+/*
+ * Get a string entry from the termcap and add it to the list of termcodes.
+ * Used for <t_xx> special keys.
+ * Give an error message for failure when not sourcing.
+ * If force given, replace an existing entry.
+ * Return FAIL if the entry was not found, OK if the entry was added.
+ */
+ int
+add_termcap_entry(name, force)
+ char_u *name;
+ int force;
+{
+ char_u *term;
+ int key;
+ struct builtin_term *termp;
+#ifdef HAVE_TGETENT
+ char_u *string;
+ int i;
+ int builtin_first;
+ char_u tbuf[TBUFSZ];
+ char_u tstrbuf[TBUFSZ];
+ char_u *tp = tstrbuf;
+ char_u *error_msg = NULL;
+#endif
+
+/*
+ * If the GUI is running or will start in a moment, we only support the keys
+ * that the GUI can produce.
+ */
+#ifdef FEAT_GUI
+ if (gui.in_use || gui.starting)
+ return gui_mch_haskey(name);
+#endif
+
+ if (!force && find_termcode(name) != NULL) /* it's already there */
+ return OK;
+
+ term = T_NAME;
+ if (term == NULL || *term == NUL) /* 'term' not defined yet */
+ return FAIL;
+
+ if (term_is_builtin(term)) /* name starts with "builtin_" */
+ {
+ term += 8;
+#ifdef HAVE_TGETENT
+ builtin_first = TRUE;
+#endif
+ }
+#ifdef HAVE_TGETENT
+ else
+ builtin_first = p_tbi;
+#endif
+
+#ifdef HAVE_TGETENT
+/*
+ * We can get the entry from the builtin termcap and from the external one.
+ * If 'ttybuiltin' is on or the terminal name starts with "builtin_", try
+ * builtin termcap first.
+ * If 'ttybuiltin' is off, try external termcap first.
+ */
+ for (i = 0; i < 2; ++i)
+ {
+ if (!builtin_first == i)
+#endif
+ /*
+ * Search in builtin termcap
+ */
+ {
+ termp = find_builtin_term(term);
+ if (termp->bt_string != NULL) /* found it */
+ {
+ key = TERMCAP2KEY(name[0], name[1]);
+ while (termp->bt_entry != (int)KS_NAME)
+ {
+ if ((int)termp->bt_entry == key)
+ {
+ add_termcode(name, (char_u *)termp->bt_string,
+ term_is_8bit(term));
+ return OK;
+ }
+ ++termp;
+ }
+ }
+ }
+#ifdef HAVE_TGETENT
+ else
+ /*
+ * Search in external termcap
+ */
+ {
+ error_msg = tgetent_error(tbuf, term);
+ if (error_msg == NULL)
+ {
+ string = TGETSTR((char *)name, &tp);
+ if (string != NULL && *string != NUL)
+ {
+ add_termcode(name, string, FALSE);
+ return OK;
+ }
+ }
+ }
+ }
+#endif
+
+ if (sourcing_name == NULL)
+ {
+#ifdef HAVE_TGETENT
+ if (error_msg != NULL)
+ EMSG(error_msg);
+ else
+#endif
+ EMSG2(_("E436: No \"%s\" entry in termcap"), name);
+ }
+ return FAIL;
+}
+
+ static int
+term_is_builtin(name)
+ char_u *name;
+{
+ return (STRNCMP(name, "builtin_", (size_t)8) == 0);
+}
+
+/*
+ * Return TRUE if terminal "name" uses CSI instead of <Esc>[.
+ * Assume that the terminal is using 8-bit controls when the name contains
+ * "8bit", like in "xterm-8bit".
+ */
+ int
+term_is_8bit(name)
+ char_u *name;
+{
+ return (detected_8bit || strstr((char *)name, "8bit") != NULL);
+}
+
+/*
+ * Translate terminal control chars from 7-bit to 8-bit:
+ * <Esc>[ -> CSI
+ * <Esc>] -> <M-C-]>
+ * <Esc>O -> <M-C-O>
+ */
+ static int
+term_7to8bit(p)
+ char_u *p;
+{
+ if (*p == ESC)
+ {
+ if (p[1] == '[')
+ return CSI;
+ if (p[1] == ']')
+ return 0x9d;
+ if (p[1] == 'O')
+ return 0x8f;
+ }
+ return 0;
+}
+
+#ifdef FEAT_GUI
+ int
+term_is_gui(name)
+ char_u *name;
+{
+ return (STRCMP(name, "builtin_gui") == 0 || STRCMP(name, "gui") == 0);
+}
+#endif
+
+#if !defined(HAVE_TGETENT) || defined(AMIGA) || defined(PROTO)
+
+ char_u *
+tltoa(i)
+ unsigned long i;
+{
+ static char_u buf[16];
+ char_u *p;
+
+ p = buf + 15;
+ *p = '\0';
+ do
+ {
+ --p;
+ *p = (char_u) (i % 10 + '0');
+ i /= 10;
+ }
+ while (i > 0 && p > buf);
+ return p;
+}
+#endif
+
+#ifndef HAVE_TGETENT
+
+/*
+ * minimal tgoto() implementation.
+ * no padding and we only parse for %i %d and %+char
+ */
+char *tgoto __ARGS((char *, int, int));
+
+ char *
+tgoto(cm, x, y)
+ char *cm;
+ int x, y;
+{
+ static char buf[30];
+ char *p, *s, *e;
+
+ if (!cm)
+ return "OOPS";
+ e = buf + 29;
+ for (s = buf; s < e && *cm; cm++)
+ {
+ if (*cm != '%')
+ {
+ *s++ = *cm;
+ continue;
+ }
+ switch (*++cm)
+ {
+ case 'd':
+ p = (char *)tltoa((unsigned long)y);
+ y = x;
+ while (*p)
+ *s++ = *p++;
+ break;
+ case 'i':
+ x++;
+ y++;
+ break;
+ case '+':
+ *s++ = (char)(*++cm + y);
+ y = x;
+ break;
+ case '%':
+ *s++ = *cm;
+ break;
+ default:
+ return "OOPS";
+ }
+ }
+ *s = '\0';
+ return buf;
+}
+
+#endif /* HAVE_TGETENT */
+
+/*
+ * Set the terminal name and initialize the terminal options.
+ * If "name" is NULL or empty, get the terminal name from the environment.
+ * If that fails, use the default terminal name.
+ */
+ void
+termcapinit(name)
+ char_u *name;
+{
+ char_u *term;
+
+ if (name != NULL && *name == NUL)
+ name = NULL; /* empty name is equal to no name */
+ term = name;
+
+#ifdef __BEOS__
+ /*
+ * TERM environment variable is normally set to 'ansi' on the Bebox;
+ * Since the BeBox doesn't quite support full ANSI yet, we use our
+ * own custom 'ansi-beos' termcap instead, unless the -T option has
+ * been given on the command line.
+ */
+ if (term == NULL
+ && strcmp((char *)mch_getenv((char_u *)"TERM"), "ansi") == 0)
+ term = DEFAULT_TERM;
+#endif
+#ifndef MSWIN
+ if (term == NULL)
+ term = mch_getenv((char_u *)"TERM");
+#endif
+ if (term == NULL || *term == NUL)
+ term = DEFAULT_TERM;
+ set_string_option_direct((char_u *)"term", -1, term, OPT_FREE);
+
+ /* Set the default terminal name. */
+ set_string_default("term", term);
+ set_string_default("ttytype", term);
+
+ /*
+ * Avoid using "term" here, because the next mch_getenv() may overwrite it.
+ */
+ set_termname(T_NAME != NULL ? T_NAME : term);
+}
+
+/*
+ * the number of calls to ui_write is reduced by using the buffer "out_buf"
+ */
+#ifdef DOS16
+# define OUT_SIZE 255 /* only have 640K total... */
+#else
+# ifdef FEAT_GUI_W16
+# define OUT_SIZE 1023 /* Save precious 1K near data */
+# else
+# define OUT_SIZE 2047
+# endif
+#endif
+ /* Add one to allow mch_write() in os_win32.c to append a NUL */
+static char_u out_buf[OUT_SIZE + 1];
+static int out_pos = 0; /* number of chars in out_buf */
+
+/*
+ * out_flush(): flush the output buffer
+ */
+ void
+out_flush()
+{
+ int len;
+
+ if (out_pos != 0)
+ {
+ /* set out_pos to 0 before ui_write, to avoid recursiveness */
+ len = out_pos;
+ out_pos = 0;
+ ui_write(out_buf, len);
+ }
+}
+
+#if defined(FEAT_MBYTE) || defined(PROTO)
+/*
+ * Sometimes a byte out of a multi-byte character is written with out_char().
+ * To avoid flushing half of the character, call this function first.
+ */
+ void
+out_flush_check()
+{
+ if (enc_dbcs != 0 && out_pos >= OUT_SIZE - MB_MAXBYTES)
+ out_flush();
+}
+#endif
+
+#ifdef FEAT_GUI
+/*
+ * out_trash(): Throw away the contents of the output buffer
+ */
+ void
+out_trash()
+{
+ out_pos = 0;
+}
+#endif
+
+/*
+ * out_char(c): put a byte into the output buffer.
+ * Flush it if it becomes full.
+ * This should not be used for outputting text on the screen (use functions
+ * like msg_puts() and screen_putchar() for that).
+ */
+ void
+out_char(c)
+ unsigned c;
+{
+#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX)
+ if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */
+ out_char('\r');
+#endif
+
+ out_buf[out_pos++] = c;
+
+ /* For testing we flush each time. */
+ if (out_pos >= OUT_SIZE || p_wd)
+ out_flush();
+}
+
+static void out_char_nf __ARGS((unsigned));
+
+/*
+ * out_char_nf(c): like out_char(), but don't flush when p_wd is set
+ */
+ static void
+out_char_nf(c)
+ unsigned c;
+{
+#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(MACOS_X_UNIX)
+ if (c == '\n') /* turn LF into CR-LF (CRMOD doesn't seem to do this) */
+ out_char_nf('\r');
+#endif
+
+ out_buf[out_pos++] = c;
+
+ if (out_pos >= OUT_SIZE)
+ out_flush();
+}
+
+/*
+ * A never-padding out_str.
+ * use this whenever you don't want to run the string through tputs.
+ * tputs above is harmless, but tputs from the termcap library
+ * is likely to strip off leading digits, that it mistakes for padding
+ * information, and "%i", "%d", etc.
+ * This should only be used for writing terminal codes, not for outputting
+ * normal text (use functions like msg_puts() and screen_putchar() for that).
+ */
+ void
+out_str_nf(s)
+ char_u *s;
+{
+ if (out_pos > OUT_SIZE - 20) /* avoid terminal strings being split up */
+ out_flush();
+ while (*s)
+ out_char_nf(*s++);
+
+ /* For testing we write one string at a time. */
+ if (p_wd)
+ out_flush();
+}
+
+/*
+ * out_str(s): Put a character string a byte at a time into the output buffer.
+ * If HAVE_TGETENT is defined use the termcap parser. (jw)
+ * This should only be used for writing terminal codes, not for outputting
+ * normal text (use functions like msg_puts() and screen_putchar() for that).
+ */
+ void
+out_str(s)
+ char_u *s;
+{
+ if (s != NULL && *s)
+ {
+#ifdef FEAT_GUI
+ /* Don't use tputs() when GUI is used, ncurses crashes. */
+ if (gui.in_use)
+ {
+ out_str_nf(s);
+ return;
+ }
+#endif
+ /* avoid terminal strings being split up */
+ if (out_pos > OUT_SIZE - 20)
+ out_flush();
+#ifdef HAVE_TGETENT
+ tputs((char *)s, 1, TPUTSFUNCAST out_char_nf);
+#else
+ while (*s)
+ out_char_nf(*s++);
+#endif
+
+ /* For testing we write one string at a time. */
+ if (p_wd)
+ out_flush();
+ }
+}
+
+/*
+ * cursor positioning using termcap parser. (jw)
+ */
+ void
+term_windgoto(row, col)
+ int row;
+ int col;
+{
+ OUT_STR(tgoto((char *)T_CM, col, row));
+}
+
+ void
+term_cursor_right(i)
+ int i;
+{
+ OUT_STR(tgoto((char *)T_CRI, 0, i));
+}
+
+ void
+term_append_lines(line_count)
+ int line_count;
+{
+ OUT_STR(tgoto((char *)T_CAL, 0, line_count));
+}
+
+ void
+term_delete_lines(line_count)
+ int line_count;
+{
+ OUT_STR(tgoto((char *)T_CDL, 0, line_count));
+}
+
+#if defined(HAVE_TGETENT) || defined(PROTO)
+ void
+term_set_winpos(x, y)
+ int x;
+ int y;
+{
+ /* Can't handle a negative value here */
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+ OUT_STR(tgoto((char *)T_CWP, y, x));
+}
+
+ void
+term_set_winsize(width, height)
+ int width;
+ int height;
+{
+ OUT_STR(tgoto((char *)T_CWS, height, width));
+}
+#endif
+
+ void
+term_fg_color(n)
+ int n;
+{
+ /* Use "AF" termcap entry if present, "Sf" entry otherwise */
+ if (*T_CAF)
+ term_color(T_CAF, n);
+ else if (*T_CSF)
+ term_color(T_CSF, n);
+}
+
+ void
+term_bg_color(n)
+ int n;
+{
+ /* Use "AB" termcap entry if present, "Sb" entry otherwise */
+ if (*T_CAB)
+ term_color(T_CAB, n);
+ else if (*T_CSB)
+ term_color(T_CSB, n);
+}
+
+ static void
+term_color(s, n)
+ char_u *s;
+ int n;
+{
+ char buf[20];
+ int i = 2; /* index in s[] just after <Esc>[ or CSI */
+
+ /* Special handling of 16 colors, because termcap can't handle it */
+ /* Also accept "\e[3%dm" for TERMINFO, it is sometimes used */
+ /* Also accept CSI instead of <Esc>[ */
+ if (n >= 8 && t_colors >= 16
+ && ((s[0] == ESC && s[1] == '[') || (s[0] == CSI && (i = 1) == 1))
+ && s[i] != NUL
+ && (STRCMP(s + i + 1, "%p1%dm") == 0
+ || STRCMP(s + i + 1, "%dm") == 0)
+ && (s[i] == '3' || s[i] == '4'))
+ {
+ sprintf(buf,
+#ifdef TERMINFO
+ "%s%s%%p1%%dm",
+#else
+ "%s%s%%dm",
+#endif
+ i == 2 ? IF_EB("\033[", ESC_STR "[") : "\233",
+ s[i] == '3' ? (n >= 16 ? "38;5;" : "9")
+ : (n >= 16 ? "48;5;" : "10"));
+ OUT_STR(tgoto(buf, 0, n >= 16 ? n : n - 8));
+ }
+ else
+ OUT_STR(tgoto((char *)s, 0, n));
+}
+
+#if (defined(FEAT_TITLE) && (defined(UNIX) || defined(OS2) || defined(VMS) || defined(MACOS_X))) || defined(PROTO)
+/*
+ * Generic function to set window title, using t_ts and t_fs.
+ */
+ void
+term_settitle(title)
+ char_u *title;
+{
+ /* t_ts takes one argument: column in status line */
+ OUT_STR(tgoto((char *)T_TS, 0, 0)); /* set title start */
+ out_str_nf(title);
+ out_str(T_FS); /* set title end */
+ out_flush();
+}
+#endif
+
+/*
+ * Make sure we have a valid set or terminal options.
+ * Replace all entries that are NULL by empty_option
+ */
+ void
+ttest(pairs)
+ int pairs;
+{
+ check_options(); /* make sure no options are NULL */
+
+ /*
+ * MUST have "cm": cursor motion.
+ */
+ if (*T_CM == NUL)
+ EMSG(_("E437: terminal capability \"cm\" required"));
+
+ /*
+ * if "cs" defined, use a scroll region, it's faster.
+ */
+ if (*T_CS != NUL)
+ scroll_region = TRUE;
+ else
+ scroll_region = FALSE;
+
+ if (pairs)
+ {
+ /*
+ * optional pairs
+ */
+ /* TP goes to normal mode for TI (invert) and TB (bold) */
+ if (*T_ME == NUL)
+ T_ME = T_MR = T_MD = T_MB = empty_option;
+ if (*T_SO == NUL || *T_SE == NUL)
+ T_SO = T_SE = empty_option;
+ if (*T_US == NUL || *T_UE == NUL)
+ T_US = T_UE = empty_option;
+ if (*T_CZH == NUL || *T_CZR == NUL)
+ T_CZH = T_CZR = empty_option;
+
+ /* T_VE is needed even though T_VI is not defined */
+ if (*T_VE == NUL)
+ T_VI = empty_option;
+
+ /* if 'mr' or 'me' is not defined use 'so' and 'se' */
+ if (*T_ME == NUL)
+ {
+ T_ME = T_SE;
+ T_MR = T_SO;
+ T_MD = T_SO;
+ }
+
+ /* if 'so' or 'se' is not defined use 'mr' and 'me' */
+ if (*T_SO == NUL)
+ {
+ T_SE = T_ME;
+ if (*T_MR == NUL)
+ T_SO = T_MD;
+ else
+ T_SO = T_MR;
+ }
+
+ /* if 'ZH' or 'ZR' is not defined use 'mr' and 'me' */
+ if (*T_CZH == NUL)
+ {
+ T_CZR = T_ME;
+ if (*T_MR == NUL)
+ T_CZH = T_MD;
+ else
+ T_CZH = T_MR;
+ }
+
+ /* "Sb" and "Sf" come in pairs */
+ if (*T_CSB == NUL || *T_CSF == NUL)
+ {
+ T_CSB = empty_option;
+ T_CSF = empty_option;
+ }
+
+ /* "AB" and "AF" come in pairs */
+ if (*T_CAB == NUL || *T_CAF == NUL)
+ {
+ T_CAB = empty_option;
+ T_CAF = empty_option;
+ }
+
+ /* if 'Sb' and 'AB' are not defined, reset "Co" */
+ if (*T_CSB == NUL && *T_CAB == NUL)
+ T_CCO = empty_option;
+
+ /* Set 'weirdinvert' according to value of 't_xs' */
+ p_wiv = (*T_XS != NUL);
+ }
+ need_gather = TRUE;
+
+ /* Set t_colors to the value of t_Co. */
+ t_colors = atoi((char *)T_CCO);
+}
+
+#if (defined(FEAT_GUI) && (defined(FEAT_MENU) || !defined(USE_ON_FLY_SCROLL))) \
+ || defined(PROTO)
+/*
+ * Represent the given long_u as individual bytes, with the most significant
+ * byte first, and store them in dst.
+ */
+ void
+add_long_to_buf(val, dst)
+ long_u val;
+ char_u *dst;
+{
+ int i;
+ int shift;
+
+ for (i = 1; i <= sizeof(long_u); i++)
+ {
+ shift = 8 * (sizeof(long_u) - i);
+ dst[i - 1] = (char_u) ((val >> shift) & 0xff);
+ }
+}
+
+static int get_long_from_buf __ARGS((char_u *buf, long_u *val));
+
+/*
+ * Interpret the next string of bytes in buf as a long integer, with the most
+ * significant byte first. Note that it is assumed that buf has been through
+ * inchar(), so that NUL and K_SPECIAL will be represented as three bytes each.
+ * Puts result in val, and returns the number of bytes read from buf
+ * (between sizeof(long_u) and 2 * sizeof(long_u)), or -1 if not enough bytes
+ * were present.
+ */
+ static int
+get_long_from_buf(buf, val)
+ char_u *buf;
+ long_u *val;
+{
+ int len;
+ char_u bytes[sizeof(long_u)];
+ int i;
+ int shift;
+
+ *val = 0;
+ len = get_bytes_from_buf(buf, bytes, (int)sizeof(long_u));
+ if (len != -1)
+ {
+ for (i = 0; i < sizeof(long_u); i++)
+ {
+ shift = 8 * (sizeof(long_u) - 1 - i);
+ *val += (long_u)bytes[i] << shift;
+ }
+ }
+ return len;
+}
+#endif
+
+#if defined(FEAT_GUI) \
+ || (defined(FEAT_MOUSE) && (!defined(UNIX) || defined(FEAT_MOUSE_XTERM)))
+/*
+ * Read the next num_bytes bytes from buf, and store them in bytes. Assume
+ * that buf has been through inchar(). Returns the actual number of bytes used
+ * from buf (between num_bytes and num_bytes*2), or -1 if not enough bytes were
+ * available.
+ */
+ static int
+get_bytes_from_buf(buf, bytes, num_bytes)
+ char_u *buf;
+ char_u *bytes;
+ int num_bytes;
+{
+ int len = 0;
+ int i;
+ char_u c;
+
+ for (i = 0; i < num_bytes; i++)
+ {
+ if ((c = buf[len++]) == NUL)
+ return -1;
+ if (c == K_SPECIAL)
+ {
+ if (buf[len] == NUL || buf[len + 1] == NUL) /* cannot happen? */
+ return -1;
+ if (buf[len++] == (int)KS_ZERO)
+ c = NUL;
+ ++len; /* skip KE_FILLER */
+ /* else it should be KS_SPECIAL, and c already equals K_SPECIAL */
+ }
+ bytes[i] = c;
+ }
+ return len;
+}
+#endif
+
+/*
+ * Check if the new shell size is valid, correct it if it's too small.
+ */
+ void
+check_shellsize()
+{
+ if (Columns < MIN_COLUMNS)
+ Columns = MIN_COLUMNS;
+ if (Rows < min_rows()) /* need room for one window and command line */
+ Rows = min_rows();
+}
+
+ void
+win_new_shellsize()
+{
+ static int old_Rows = 0;
+ static int old_Columns = 0;
+
+ if (old_Rows != Rows || old_Columns != Columns)
+ ui_new_shellsize();
+ if (old_Rows != Rows)
+ {
+ old_Rows = Rows;
+ shell_new_rows(); /* update window sizes */
+ }
+ if (old_Columns != Columns)
+ {
+ old_Columns = Columns;
+#ifdef FEAT_VERTSPLIT
+ shell_new_columns(); /* update window sizes */
+#endif
+ }
+}
+
+/*
+ * Call this function when the Vim shell has been resized in any way.
+ * Will obtain the current size and redraw (also when size didn't change).
+ */
+ void
+shell_resized()
+{
+ set_shellsize(0, 0, FALSE);
+}
+
+/*
+ * Check if the shell size changed. Handle a resize.
+ * When the size didn't change, nothing happens.
+ */
+ void
+shell_resized_check()
+{
+ int old_Rows = Rows;
+ int old_Columns = Columns;
+
+ (void)ui_get_shellsize();
+ check_shellsize();
+ if (old_Rows != Rows || old_Columns != Columns)
+ shell_resized();
+}
+
+/*
+ * Set size of the Vim shell.
+ * If 'mustset' is TRUE, we must set Rows and Columns, do not get the real
+ * window size (this is used for the :win command).
+ * If 'mustset' is FALSE, we may try to get the real window size and if
+ * it fails use 'width' and 'height'.
+ */
+ void
+set_shellsize(width, height, mustset)
+ int width, height;
+ int mustset;
+{
+ static int busy = FALSE;
+
+ /*
+ * Avoid recursiveness, can happen when setting the window size causes
+ * another window-changed signal.
+ */
+ if (busy)
+ return;
+
+ if (width < 0 || height < 0) /* just checking... */
+ return;
+
+ if (State == HITRETURN || State == SETWSIZE) /* postpone the resizing */
+ {
+ State = SETWSIZE;
+ return;
+ }
+
+ ++busy;
+
+#ifdef AMIGA
+ out_flush(); /* must do this before mch_get_shellsize() for
+ some obscure reason */
+#endif
+
+ if (mustset || (ui_get_shellsize() == FAIL && height != 0))
+ {
+ Rows = height;
+ Columns = width;
+ check_shellsize();
+ ui_set_shellsize(mustset);
+ }
+ else
+ check_shellsize();
+
+ /* The window layout used to be adjusted here, but it now happens in
+ * screenalloc() (also invoked from screenclear()). That is because the
+ * "busy" check above may skip this, but not screenalloc(). */
+
+ if (State != ASKMORE && State != EXTERNCMD && State != CONFIRM)
+ screenclear();
+ else
+ screen_start(); /* don't know where cursor is now */
+
+ if (starting != NO_SCREEN)
+ {
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+ changed_line_abv_curs();
+ invalidate_botline();
+
+ /*
+ * We only redraw when it's needed:
+ * - While at the more prompt or executing an external command, don't
+ * redraw, but position the cursor.
+ * - While editing the command line, only redraw that.
+ * - in Ex mode, don't redraw anything.
+ * - Otherwise, redraw right now, and position the cursor.
+ * Always need to call update_screen() or screenalloc(), to make
+ * sure Rows/Columns and the size of ScreenLines[] is correct!
+ */
+ if (State == ASKMORE || State == EXTERNCMD || State == CONFIRM
+ || exmode_active)
+ {
+ screenalloc(FALSE);
+ repeat_message();
+ }
+ else if (State & CMDLINE)
+ {
+ update_screen(NOT_VALID);
+ redrawcmdline();
+ }
+ else
+ {
+ update_topline();
+ update_screen(NOT_VALID);
+ if (redrawing())
+ setcursor();
+ }
+ cursor_on(); /* redrawing may have switched it off */
+ }
+ out_flush();
+ --busy;
+}
+
+/*
+ * Set the terminal to TMODE_RAW (for Normal mode) or TMODE_COOK (for external
+ * commands and Ex mode).
+ */
+ void
+settmode(tmode)
+ int tmode;
+{
+#ifdef FEAT_GUI
+ /* don't set the term where gvim was started to any mode */
+ if (gui.in_use)
+ return;
+#endif
+
+ if (full_screen)
+ {
+ /* In Ex mode, never set to RAW */
+ if (exmode_active == EXMODE_NORMAL)
+ tmode = TMODE_COOK;
+
+ /*
+ * When returning after calling a shell we want to really set the
+ * terminal to raw mode, even though we think it already is, because
+ * the shell program may have reset the terminal mode.
+ * When we think the terminal is normal, don't try to set it to
+ * normal again, because that causes problems (logout!) on some
+ * machines.
+ */
+ if (tmode != TMODE_COOK || cur_tmode != TMODE_COOK)
+ {
+#ifdef FEAT_TERMRESPONSE
+ /* May need to check for T_CRV response and termcodes, it doesn't
+ * work in Cooked mode, an external program may get them. */
+ if (tmode != TMODE_RAW && crv_status == CRV_SENT)
+ (void)vpeekc_nomap();
+ check_for_codes_from_term();
+#endif
+#ifdef FEAT_MOUSE_TTY
+ if (tmode != TMODE_RAW)
+ mch_setmouse(FALSE); /* switch mouse off */
+#endif
+ out_flush();
+ mch_settmode(tmode); /* machine specific function */
+ cur_tmode = tmode;
+#ifdef FEAT_MOUSE
+ if (tmode == TMODE_RAW)
+ setmouse(); /* may switch mouse on */
+#endif
+ out_flush();
+ }
+#ifdef FEAT_TERMRESPONSE
+ may_req_termresponse();
+#endif
+ }
+}
+
+ void
+starttermcap()
+{
+ if (full_screen && !termcap_active)
+ {
+ out_str(T_TI); /* start termcap mode */
+ out_str(T_KS); /* start "keypad transmit" mode */
+ out_flush();
+ termcap_active = TRUE;
+ screen_start(); /* don't know where cursor is now */
+#ifdef FEAT_TERMRESPONSE
+ may_req_termresponse();
+ /* Immediately check for a response. If t_Co changes, we don't want
+ * to redraw with wrong colors first. */
+ check_for_codes_from_term();
+#endif
+ }
+}
+
+ void
+stoptermcap()
+{
+ screen_stop_highlight();
+ reset_cterm_colors();
+ if (termcap_active)
+ {
+#ifdef FEAT_TERMRESPONSE
+ /* May need to check for T_CRV response. */
+ if (crv_status == CRV_SENT)
+ (void)vpeekc_nomap();
+ /* Check for termcodes first, otherwise an external program may get
+ * them. */
+ check_for_codes_from_term();
+#endif
+ out_str(T_KE); /* stop "keypad transmit" mode */
+ out_flush();
+ termcap_active = FALSE;
+ cursor_on(); /* just in case it is still off */
+ out_str(T_TE); /* stop termcap mode */
+ screen_start(); /* don't know where cursor is now */
+ out_flush();
+ }
+}
+
+#ifdef FEAT_TERMRESPONSE
+/*
+ * Request version string (for xterm) when needed.
+ * Only do this after switching to raw mode, otherwise the result will be
+ * echoed.
+ * Only do this after termcap mode has been started, otherwise the codes for
+ * the cursor keys may be wrong.
+ * The result is caught in check_termcode().
+ */
+ static void
+may_req_termresponse()
+{
+ if (crv_status == CRV_GET
+ && cur_tmode == TMODE_RAW
+ && termcap_active
+#ifdef UNIX
+ && isatty(1)
+#endif
+ && *T_CRV != NUL)
+ {
+ out_str(T_CRV);
+ crv_status = CRV_SENT;
+ /* check for the characters now, otherwise they might be eaten by
+ * get_keystroke() */
+ out_flush();
+ (void)vpeekc_nomap();
+ }
+}
+#endif
+
+/*
+ * Return TRUE when saving and restoring the screen.
+ */
+ int
+swapping_screen()
+{
+ return (full_screen && *T_TI != NUL);
+}
+
+#ifdef FEAT_MOUSE
+/*
+ * setmouse() - switch mouse on/off depending on current mode and 'mouse'
+ */
+ void
+setmouse()
+{
+# ifdef FEAT_MOUSE_TTY
+ int checkfor;
+# endif
+
+# ifdef FEAT_MOUSESHAPE
+ update_mouseshape(-1);
+# endif
+
+# ifdef FEAT_MOUSE_TTY /* Should be outside proc, but may break MOUSESHAPE */
+# ifdef FEAT_GUI
+ /* In the GUI the mouse is always enabled. */
+ if (gui.in_use)
+ return;
+# endif
+ /* be quick when mouse is off */
+ if (*p_mouse == NUL || has_mouse_termcode == 0)
+ return;
+
+ /* don't switch mouse on when not in raw mode (Ex mode) */
+ if (cur_tmode != TMODE_RAW)
+ {
+ mch_setmouse(FALSE);
+ return;
+ }
+
+# ifdef FEAT_VISUAL
+ if (VIsual_active)
+ checkfor = MOUSE_VISUAL;
+ else
+# endif
+ if (State == HITRETURN || State == ASKMORE || State == SETWSIZE)
+ checkfor = MOUSE_RETURN;
+ else if (State & INSERT)
+ checkfor = MOUSE_INSERT;
+ else if (State & CMDLINE)
+ checkfor = MOUSE_COMMAND;
+ else if (State == CONFIRM || State == EXTERNCMD)
+ checkfor = ' '; /* don't use mouse for ":confirm" or ":!cmd" */
+ else
+ checkfor = MOUSE_NORMAL; /* assume normal mode */
+
+ if (mouse_has(checkfor))
+ mch_setmouse(TRUE);
+ else
+ mch_setmouse(FALSE);
+# endif
+}
+
+/*
+ * Return TRUE if
+ * - "c" is in 'mouse', or
+ * - 'a' is in 'mouse' and "c" is in MOUSE_A, or
+ * - the current buffer is a help file and 'h' is in 'mouse' and we are in a
+ * normal editing mode (not at hit-return message).
+ */
+ int
+mouse_has(c)
+ int c;
+{
+ char_u *p;
+
+ for (p = p_mouse; *p; ++p)
+ switch (*p)
+ {
+ case 'a': if (vim_strchr((char_u *)MOUSE_A, c) != NULL)
+ return TRUE;
+ break;
+ case MOUSE_HELP: if (c != MOUSE_RETURN && curbuf->b_help)
+ return TRUE;
+ break;
+ default: if (c == *p) return TRUE; break;
+ }
+ return FALSE;
+}
+
+/*
+ * Return TRUE when 'mousemodel' is set to "popup" or "popup_setpos".
+ */
+ int
+mouse_model_popup()
+{
+ return (p_mousem[0] == 'p');
+}
+#endif
+
+/*
+ * By outputting the 'cursor very visible' termcap code, for some windowed
+ * terminals this makes the screen scrolled to the correct position.
+ * Used when starting Vim or returning from a shell.
+ */
+ void
+scroll_start()
+{
+ if (*T_VS != NUL)
+ {
+ out_str(T_VS);
+ out_str(T_VE);
+ screen_start(); /* don't know where cursor is now */
+ }
+}
+
+static int cursor_is_off = FALSE;
+
+/*
+ * Enable the cursor.
+ */
+ void
+cursor_on()
+{
+ if (cursor_is_off)
+ {
+ out_str(T_VE);
+ cursor_is_off = FALSE;
+ }
+}
+
+/*
+ * Disable the cursor.
+ */
+ void
+cursor_off()
+{
+ if (full_screen)
+ {
+ if (!cursor_is_off)
+ out_str(T_VI); /* disable cursor */
+ cursor_is_off = TRUE;
+ }
+}
+
+/*
+ * Set scrolling region for window 'wp'.
+ * The region starts 'off' lines from the start of the window.
+ * Also set the vertical scroll region for a vertically split window. Always
+ * the full width of the window, excluding the vertical separator.
+ */
+ void
+scroll_region_set(wp, off)
+ win_T *wp;
+ int off;
+{
+ OUT_STR(tgoto((char *)T_CS, W_WINROW(wp) + wp->w_height - 1,
+ W_WINROW(wp) + off));
+#ifdef FEAT_VERTSPLIT
+ if (*T_CSV != NUL && wp->w_width != Columns)
+ OUT_STR(tgoto((char *)T_CSV, W_WINCOL(wp) + wp->w_width - 1,
+ W_WINCOL(wp)));
+#endif
+ screen_start(); /* don't know where cursor is now */
+}
+
+/*
+ * Reset scrolling region to the whole screen.
+ */
+ void
+scroll_region_reset()
+{
+ OUT_STR(tgoto((char *)T_CS, (int)Rows - 1, 0));
+#ifdef FEAT_VERTSPLIT
+ if (*T_CSV != NUL)
+ OUT_STR(tgoto((char *)T_CSV, (int)Columns - 1, 0));
+#endif
+ screen_start(); /* don't know where cursor is now */
+}
+
+
+/*
+ * List of terminal codes that are currently recognized.
+ */
+
+struct termcode
+{
+ char_u name[2]; /* termcap name of entry */
+ char_u *code; /* terminal code (in allocated memory) */
+ int len; /* STRLEN(code) */
+} *termcodes = NULL;
+
+static int tc_max_len = 0; /* number of entries that termcodes[] can hold */
+static int tc_len = 0; /* current number of entries in termcodes[] */
+
+ void
+clear_termcodes()
+{
+ while (tc_len > 0)
+ vim_free(termcodes[--tc_len].code);
+ vim_free(termcodes);
+ termcodes = NULL;
+ tc_max_len = 0;
+
+#ifdef HAVE_TGETENT
+ BC = (char *)empty_option;
+ UP = (char *)empty_option;
+ PC = NUL; /* set pad character to NUL */
+ ospeed = 0;
+#endif
+
+ need_gather = TRUE; /* need to fill termleader[] */
+}
+
+/*
+ * Add a new entry to the list of terminal codes.
+ * The list is kept alphabetical for ":set termcap"
+ */
+ void
+add_termcode(name, string, use_8bit)
+ char_u *name;
+ char_u *string;
+ int use_8bit; /* replace 7-bit control by 8-bit one */
+{
+ struct termcode *new_tc;
+ int i, j;
+ char_u *s;
+
+ if (string == NULL || *string == NUL)
+ {
+ del_termcode(name);
+ return;
+ }
+
+ s = vim_strsave(string);
+ if (s == NULL)
+ return;
+
+ /* Change leading <Esc>[ to CSI, change <Esc>O to <M-O>. */
+ if (use_8bit && term_7to8bit(string) != 0)
+ {
+ mch_memmove(s, s + 1, STRLEN(s));
+ s[0] = term_7to8bit(string);
+ }
+
+ need_gather = TRUE; /* need to fill termleader[] */
+
+ /*
+ * need to make space for more entries
+ */
+ if (tc_len == tc_max_len)
+ {
+ tc_max_len += 20;
+ new_tc = (struct termcode *)alloc(
+ (unsigned)(tc_max_len * sizeof(struct termcode)));
+ if (new_tc == NULL)
+ {
+ tc_max_len -= 20;
+ return;
+ }
+ for (i = 0; i < tc_len; ++i)
+ new_tc[i] = termcodes[i];
+ vim_free(termcodes);
+ termcodes = new_tc;
+ }
+
+ /*
+ * Look for existing entry with the same name, it is replaced.
+ * Look for an existing entry that is alphabetical higher, the new entry
+ * is inserted in front of it.
+ */
+ for (i = 0; i < tc_len; ++i)
+ {
+ if (termcodes[i].name[0] < name[0])
+ continue;
+ if (termcodes[i].name[0] == name[0])
+ {
+ if (termcodes[i].name[1] < name[1])
+ continue;
+ /*
+ * Exact match: Replace old code.
+ */
+ if (termcodes[i].name[1] == name[1])
+ {
+ vim_free(termcodes[i].code);
+ --tc_len;
+ break;
+ }
+ }
+ /*
+ * Found alphabetical larger entry, move rest to insert new entry
+ */
+ for (j = tc_len; j > i; --j)
+ termcodes[j] = termcodes[j - 1];
+ break;
+ }
+
+ termcodes[i].name[0] = name[0];
+ termcodes[i].name[1] = name[1];
+ termcodes[i].code = s;
+ termcodes[i].len = (int)STRLEN(s);
+ ++tc_len;
+}
+
+ char_u *
+find_termcode(name)
+ char_u *name;
+{
+ int i;
+
+ for (i = 0; i < tc_len; ++i)
+ if (termcodes[i].name[0] == name[0] && termcodes[i].name[1] == name[1])
+ return termcodes[i].code;
+ return NULL;
+}
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+ char_u *
+get_termcode(i)
+ int i;
+{
+ if (i >= tc_len)
+ return NULL;
+ return &termcodes[i].name[0];
+}
+#endif
+
+ void
+del_termcode(name)
+ char_u *name;
+{
+ int i;
+
+ if (termcodes == NULL) /* nothing there yet */
+ return;
+
+ need_gather = TRUE; /* need to fill termleader[] */
+
+ for (i = 0; i < tc_len; ++i)
+ if (termcodes[i].name[0] == name[0] && termcodes[i].name[1] == name[1])
+ {
+ del_termcode_idx(i);
+ return;
+ }
+ /* not found. Give error message? */
+}
+
+ static void
+del_termcode_idx(idx)
+ int idx;
+{
+ int i;
+
+ vim_free(termcodes[idx].code);
+ --tc_len;
+ for (i = idx; i < tc_len; ++i)
+ termcodes[i] = termcodes[i + 1];
+}
+
+#ifdef FEAT_TERMRESPONSE
+/*
+ * Called when detected that the terminal sends 8-bit codes.
+ * Convert all 7-bit codes to their 8-bit equivalent.
+ */
+ static void
+switch_to_8bit()
+{
+ int i;
+ int c;
+
+ /* Only need to do something when not already using 8-bit codes. */
+ if (!term_is_8bit(T_NAME))
+ {
+ for (i = 0; i < tc_len; ++i)
+ {
+ c = term_7to8bit(termcodes[i].code);
+ if (c != 0)
+ {
+ mch_memmove(termcodes[i].code + 1, termcodes[i].code + 2,
+ STRLEN(termcodes[i].code + 1));
+ termcodes[i].code[0] = c;
+ }
+ }
+ need_gather = TRUE; /* need to fill termleader[] */
+ }
+ detected_8bit = TRUE;
+}
+#endif
+
+#ifdef CHECK_DOUBLE_CLICK
+static linenr_T orig_topline = 0;
+# ifdef FEAT_DIFF
+static int orig_topfill = 0;
+# endif
+#endif
+#if (defined(FEAT_WINDOWS) && defined(CHECK_DOUBLE_CLICK)) || defined(PROTO)
+/*
+ * Checking for double clicks ourselves.
+ * "orig_topline" is used to avoid detecting a double-click when the window
+ * contents scrolled (e.g., when 'scrolloff' is non-zero).
+ */
+/*
+ * Set orig_topline. Used when jumping to another window, so that a double
+ * click still works.
+ */
+ void
+set_mouse_topline(wp)
+ win_T *wp;
+{
+ orig_topline = wp->w_topline;
+# ifdef FEAT_DIFF
+ orig_topfill = wp->w_topfill;
+# endif
+}
+#endif
+
+/*
+ * Check if typebuf.tb_buf[] contains a terminal key code.
+ * Check from typebuf.tb_buf[typebuf.tb_off] to typebuf.tb_buf[typebuf.tb_off
+ * + max_offset].
+ * Return 0 for no match, -1 for partial match, > 0 for full match.
+ * With a match, the match is removed, the replacement code is inserted in
+ * typebuf.tb_buf[] and the number of characters in typebuf.tb_buf[] is
+ * returned.
+ * When "buf" is not NULL, it is used instead of typebuf.tb_buf[]. "buflen" is
+ * then the length of the string in buf[].
+ */
+ int
+check_termcode(max_offset, buf, buflen)
+ int max_offset;
+ char_u *buf;
+ int buflen;
+{
+ char_u *tp;
+ char_u *p;
+ int slen = 0; /* init for GCC */
+ int len;
+ int offset;
+ char_u key_name[2];
+ int new_slen;
+ int extra;
+ char_u string[MAX_KEY_CODE_LEN + 1];
+ int i, j;
+ int idx = 0;
+#ifdef FEAT_MOUSE
+# if !defined(UNIX) || defined(FEAT_MOUSE_XTERM) || defined(FEAT_GUI)
+ char_u bytes[6];
+ int num_bytes;
+# endif
+ int mouse_code = 0; /* init for GCC */
+ int modifiers;
+ int is_click, is_drag;
+ int wheel_code = 0;
+ int current_button;
+ static int held_button = MOUSE_RELEASE;
+ static int orig_num_clicks = 1;
+ static int orig_mouse_code = 0x0;
+# ifdef CHECK_DOUBLE_CLICK
+ static int orig_mouse_col = 0;
+ static int orig_mouse_row = 0;
+ static struct timeval orig_mouse_time = {0, 0};
+ /* time of previous mouse click */
+ struct timeval mouse_time; /* time of current mouse click */
+ long timediff; /* elapsed time in msec */
+# endif
+#endif
+ int cpo_koffset;
+#ifdef FEAT_MOUSE_GPM
+ extern int gpm_flag; /* gpm library variable */
+#endif
+
+ cpo_koffset = (vim_strchr(p_cpo, CPO_KOFFSET) != NULL);
+
+ /*
+ * Speed up the checks for terminal codes by gathering all first bytes
+ * used in termleader[]. Often this is just a single <Esc>.
+ */
+ if (need_gather)
+ gather_termleader();
+
+ /*
+ * Check at several positions in typebuf.tb_buf[], to catch something like
+ * "x<Up>" that can be mapped. Stop at max_offset, because characters
+ * after that cannot be used for mapping, and with @r commands
+ * typebuf.tb_buf[]
+ * can become very long.
+ * This is used often, KEEP IT FAST!
+ */
+ for (offset = 0; offset < max_offset; ++offset)
+ {
+ if (buf == NULL)
+ {
+ if (offset >= typebuf.tb_len)
+ break;
+ tp = typebuf.tb_buf + typebuf.tb_off + offset;
+ len = typebuf.tb_len - offset; /* length of the input */
+ }
+ else
+ {
+ if (offset >= buflen)
+ break;
+ tp = buf + offset;
+ len = buflen - offset;
+ }
+
+ /*
+ * Don't check characters after K_SPECIAL, those are already
+ * translated terminal chars (avoid translating ~@^Hx).
+ */
+ if (*tp == K_SPECIAL)
+ {
+ offset += 2; /* there are always 2 extra characters */
+ continue;
+ }
+
+ /*
+ * Skip this position if the character does not appear as the first
+ * character in term_strings. This speeds up a lot, since most
+ * termcodes start with the same character (ESC or CSI).
+ */
+ i = *tp;
+ for (p = termleader; *p && *p != i; ++p)
+ ;
+ if (*p == NUL)
+ continue;
+
+ /*
+ * Skip this position if p_ek is not set and tp[0] is an ESC and we
+ * are in Insert mode.
+ */
+ if (*tp == ESC && !p_ek && (State & INSERT))
+ continue;
+
+ new_slen = 0; /* Length of what will replace the termcode */
+ key_name[0] = NUL; /* no key name found yet */
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ /*
+ * GUI special key codes are all of the form [CSI xx].
+ */
+ if (*tp == CSI) /* Special key from GUI */
+ {
+ if (len < 3)
+ return -1; /* Shouldn't happen */
+ slen = 3;
+ key_name[0] = tp[1];
+ key_name[1] = tp[2];
+ }
+ }
+ else
+#endif /* FEAT_GUI */
+ {
+ for (idx = 0; idx < tc_len; ++idx)
+ {
+ /*
+ * Ignore the entry if we are not at the start of
+ * typebuf.tb_buf[]
+ * and there are not enough characters to make a match.
+ * But only when the 'K' flag is in 'cpoptions'.
+ */
+ slen = termcodes[idx].len;
+ if (cpo_koffset && offset && len < slen)
+ continue;
+ if (STRNCMP(termcodes[idx].code, tp,
+ (size_t)(slen > len ? len : slen)) == 0)
+ {
+ if (len < slen) /* got a partial sequence */
+ return -1; /* need to get more chars */
+
+ /*
+ * When found a keypad key, check if there is another key
+ * that matches and use that one. This makes <Home> to be
+ * found instead of <kHome> when they produce the same
+ * key code.
+ */
+ if (termcodes[idx].name[0] == 'K'
+ && VIM_ISDIGIT(termcodes[idx].name[1]))
+ {
+ for (j = idx + 1; j < tc_len; ++j)
+ if (termcodes[j].len == slen &&
+ STRNCMP(termcodes[idx].code,
+ termcodes[j].code, slen) == 0)
+ {
+ idx = j;
+ break;
+ }
+ }
+
+ key_name[0] = termcodes[idx].name[0];
+ key_name[1] = termcodes[idx].name[1];
+
+ break;
+ }
+ }
+ }
+
+#ifdef FEAT_TERMRESPONSE
+ if (key_name[0] == NUL)
+ {
+ /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also
+ * eat other possible responses to t_RV, rxvt returns
+ * "<Esc>[?1;2c". Also accept CSI instead of <Esc>[. */
+ if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3)
+ || (tp[0] == CSI && len >= 2)))
+ {
+ j = 0;
+ extra = 0;
+ for (i = 2 + (tp[0] != CSI);
+ i < len && (VIM_ISDIGIT(tp[i])
+ || tp[i] == ';' || tp[i] == '.'); ++i)
+ if (tp[i] == ';' && ++j == 1)
+ extra = atoi((char *)tp + i + 1);
+ if (i == len)
+ return -1; /* not enough characters */
+
+ /* eat it when at least one digit and ending in 'c' */
+ if (i > 2 + (tp[0] != CSI) && tp[i] == 'c')
+ {
+ crv_status = CRV_GOT;
+
+ /* If this code starts with CSI, you can bet that the
+ * terminal uses 8-bit codes. */
+ if (tp[0] == CSI)
+ switch_to_8bit();
+
+ /* rxvt sends its version number: "20703" is 2.7.3.
+ * Ignore it for when the user has set 'term' to xterm,
+ * even though it's an rxvt. */
+ if (extra > 20000)
+ extra = 0;
+
+ if (tp[1 + (tp[0] != CSI)] == '>' && j == 2)
+ {
+ /* if xterm version >= 95 use mouse dragging */
+ if (extra >= 95)
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"xterm2", 0);
+ /* if xterm version >= 141 try to get termcap codes */
+ if (extra >= 141)
+ {
+ check_for_codes = TRUE;
+ need_gather = TRUE;
+ req_codes_from_term();
+ }
+ }
+# ifdef FEAT_EVAL
+ set_vim_var_string(VV_TERMRESPONSE, tp, i + 1);
+# endif
+# ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_TERMRESPONSE,
+ NULL, NULL, FALSE, curbuf);
+# endif
+ key_name[0] = (int)KS_EXTRA;
+ key_name[1] = (int)KE_IGNORE;
+ slen = i + 1;
+ }
+ }
+
+ /* Check for '<Esc>P1+r<hex bytes><Esc>\'. A "0" instead of the
+ * "1" means an invalid request. */
+ else if (check_for_codes
+ && ((tp[0] == ESC && tp[1] == 'P' && len >= 2)
+ || tp[0] == DCS))
+ {
+ j = 1 + (tp[0] != DCS);
+ for (i = j; i < len; ++i)
+ if ((tp[i] == ESC && tp[i + 1] == '\\' && i + 1 < len)
+ || tp[i] == STERM)
+ {
+ if (i - j >= 3 && tp[j + 1] == '+' && tp[j + 2] == 'r')
+ got_code_from_term(tp + j, i);
+ key_name[0] = (int)KS_EXTRA;
+ key_name[1] = (int)KE_IGNORE;
+ slen = i + 1 + (tp[i] == ESC);
+ break;
+ }
+
+ if (i == len)
+ return -1; /* not enough characters */
+ }
+ }
+#endif
+
+ if (key_name[0] == NUL)
+ continue; /* No match at this position, try next one */
+
+ /* We only get here when we have a complete termcode match */
+
+#ifdef FEAT_MOUSE
+# ifdef FEAT_GUI
+ /*
+ * Only in the GUI: Fetch the pointer coordinates of the scroll event
+ * so that we know which window to scroll later.
+ */
+ if (gui.in_use
+ && key_name[0] == (int)KS_EXTRA
+ && (key_name[1] == (int)KE_X1MOUSE
+ || key_name[1] == (int)KE_X2MOUSE
+ || key_name[1] == (int)KE_MOUSEDOWN
+ || key_name[1] == (int)KE_MOUSEUP))
+ {
+ num_bytes = get_bytes_from_buf(tp + slen, bytes, 4);
+ if (num_bytes == -1) /* not enough coordinates */
+ return -1;
+ mouse_col = 128 * (bytes[0] - ' ' - 1) + bytes[1] - ' ' - 1;
+ mouse_row = 128 * (bytes[2] - ' ' - 1) + bytes[3] - ' ' - 1;
+ slen += num_bytes;
+ }
+ else
+# endif
+ /*
+ * If it is a mouse click, get the coordinates.
+ */
+ if (key_name[0] == (int)KS_MOUSE
+# ifdef FEAT_MOUSE_JSB
+ || key_name[0] == (int)KS_JSBTERM_MOUSE
+# endif
+# ifdef FEAT_MOUSE_NET
+ || key_name[0] == (int)KS_NETTERM_MOUSE
+# endif
+# ifdef FEAT_MOUSE_DEC
+ || key_name[0] == (int)KS_DEC_MOUSE
+# endif
+# ifdef FEAT_MOUSE_PTERM
+ || key_name[0] == (int)KS_PTERM_MOUSE
+# endif
+ )
+ {
+ is_click = is_drag = FALSE;
+
+# if !defined(UNIX) || defined(FEAT_MOUSE_XTERM) || defined(FEAT_GUI)
+ if (key_name[0] == (int)KS_MOUSE)
+ {
+ /*
+ * For xterm and MSDOS we get "<t_mouse>scr", where
+ * s == encoded button state:
+ * 0x20 = left button down
+ * 0x21 = middle button down
+ * 0x22 = right button down
+ * 0x23 = any button release
+ * 0x60 = button 4 down (scroll wheel down)
+ * 0x61 = button 5 down (scroll wheel up)
+ * add 0x04 for SHIFT
+ * add 0x08 for ALT
+ * add 0x10 for CTRL
+ * add 0x20 for mouse drag (0x40 is drag with left button)
+ * c == column + ' ' + 1 == column + 33
+ * r == row + ' ' + 1 == row + 33
+ *
+ * The coordinates are passed on through global variables.
+ * Ugly, but this avoids trouble with mouse clicks at an
+ * unexpected moment and allows for mapping them.
+ */
+ for (;;)
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ /* GUI uses more bits for columns > 223 */
+ num_bytes = get_bytes_from_buf(tp + slen, bytes, 5);
+ if (num_bytes == -1) /* not enough coordinates */
+ return -1;
+ mouse_code = bytes[0];
+ mouse_col = 128 * (bytes[1] - ' ' - 1)
+ + bytes[2] - ' ' - 1;
+ mouse_row = 128 * (bytes[3] - ' ' - 1)
+ + bytes[4] - ' ' - 1;
+ }
+ else
+#endif
+ {
+ num_bytes = get_bytes_from_buf(tp + slen, bytes, 3);
+ if (num_bytes == -1) /* not enough coordinates */
+ return -1;
+ mouse_code = bytes[0];
+ mouse_col = bytes[1] - ' ' - 1;
+ mouse_row = bytes[2] - ' ' - 1;
+ }
+ slen += num_bytes;
+
+ /* If the following bytes is also a mouse code and it has
+ * the same code, dump this one and get the next. This
+ * makes dragging a whole lot faster. */
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ j = 3;
+ else
+#endif
+ j = termcodes[idx].len;
+ if (STRNCMP(tp, tp + slen, (size_t)j) == 0
+ && tp[slen + j] == mouse_code
+ && tp[slen + j + 1] != NUL
+ && tp[slen + j + 2] != NUL
+#ifdef FEAT_GUI
+ && (!gui.in_use
+ || (tp[slen + j + 3] != NUL
+ && tp[slen + j + 4] != NUL))
+#endif
+ )
+ slen += j;
+ else
+ break;
+ }
+
+# if !defined(MSWIN) && !defined(MSDOS)
+ /*
+ * Handle mouse events.
+ * Recognize the xterm mouse wheel, but not in the GUI, the
+ * Linux console with GPM and the MS-DOS or Win32 console
+ * (multi-clicks use >= 0x60).
+ */
+ if (mouse_code >= MOUSEWHEEL_LOW
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+# ifdef FEAT_MOUSE_GPM
+ && gpm_flag == 0
+# endif
+ )
+ {
+ /* Keep the mouse_code before it's changed, so that we
+ * remember that it was a mouse wheel click. */
+ wheel_code = mouse_code;
+ }
+# ifdef FEAT_MOUSE_XTERM
+ else if (held_button == MOUSE_RELEASE
+# ifdef FEAT_GUI
+ && !gui.in_use
+# endif
+ && (mouse_code == 0x23 || mouse_code == 0x24))
+ {
+ /* Apparently used by rxvt scroll wheel. */
+ wheel_code = mouse_code - 0x23 + MOUSEWHEEL_LOW;
+ }
+# endif
+
+# if defined(UNIX) && defined(FEAT_MOUSE_TTY)
+ else if (use_xterm_mouse() > 1)
+ {
+ if (mouse_code & MOUSE_DRAG_XTERM)
+ mouse_code |= MOUSE_DRAG;
+ }
+# endif
+# ifdef FEAT_XCLIPBOARD
+ else if (!(mouse_code & MOUSE_DRAG & ~MOUSE_CLICK_MASK))
+ {
+ if ((mouse_code & MOUSE_RELEASE) == MOUSE_RELEASE)
+ stop_xterm_trace();
+ else
+ start_xterm_trace(mouse_code);
+ }
+# endif
+# endif
+ }
+# endif /* !UNIX || FEAT_MOUSE_XTERM */
+# ifdef FEAT_MOUSE_NET
+ if (key_name[0] == (int)KS_NETTERM_MOUSE)
+ {
+ int mc, mr;
+
+ /* expect a rather limited sequence like: balancing {
+ * \033}6,45\r
+ * '6' is the row, 45 is the column
+ */
+ p = tp + slen;
+ mr = getdigits(&p);
+ if (*p++ != ',')
+ return -1;
+ mc = getdigits(&p);
+ if (*p++ != '\r')
+ return -1;
+
+ mouse_col = mc - 1;
+ mouse_row = mr - 1;
+ mouse_code = MOUSE_LEFT;
+ slen += (int)(p - (tp + slen));
+ }
+# endif /* FEAT_MOUSE_NET */
+# ifdef FEAT_MOUSE_JSB
+ if (key_name[0] == (int)KS_JSBTERM_MOUSE)
+ {
+ int mult, val, iter, button, status;
+
+ /* JSBTERM Input Model
+ * \033[0~zw uniq escape sequence
+ * (L-x) Left button pressed - not pressed x not reporting
+ * (M-x) Middle button pressed - not pressed x not reporting
+ * (R-x) Right button pressed - not pressed x not reporting
+ * (SDmdu) Single , Double click, m mouse move d button down
+ * u button up
+ * ### X cursor position padded to 3 digits
+ * ### Y cursor position padded to 3 digits
+ * (s-x) SHIFT key pressed - not pressed x not reporting
+ * (c-x) CTRL key pressed - not pressed x not reporting
+ * \033\\ terminateing sequence
+ */
+
+ p = tp + slen;
+ button = mouse_code = 0;
+ switch (*p++)
+ {
+ case 'L': button = 1; break;
+ case '-': break;
+ case 'x': break; /* ignore sequence */
+ default: return -1; /* Unknown Result */
+ }
+ switch (*p++)
+ {
+ case 'M': button |= 2; break;
+ case '-': break;
+ case 'x': break; /* ignore sequence */
+ default: return -1; /* Unknown Result */
+ }
+ switch (*p++)
+ {
+ case 'R': button |= 4; break;
+ case '-': break;
+ case 'x': break; /* ignore sequence */
+ default: return -1; /* Unknown Result */
+ }
+ status = *p++;
+ for (val = 0, mult = 100, iter = 0; iter < 3; iter++,
+ mult /= 10, p++)
+ if (*p >= '0' && *p <= '9')
+ val += (*p - '0') * mult;
+ else
+ return -1;
+ mouse_col = val;
+ for (val = 0, mult = 100, iter = 0; iter < 3; iter++,
+ mult /= 10, p++)
+ if (*p >= '0' && *p <= '9')
+ val += (*p - '0') * mult;
+ else
+ return -1;
+ mouse_row = val;
+ switch (*p++)
+ {
+ case 's': button |= 8; break; /* SHIFT key Pressed */
+ case '-': break; /* Not Pressed */
+ case 'x': break; /* Not Reporting */
+ default: return -1; /* Unknown Result */
+ }
+ switch (*p++)
+ {
+ case 'c': button |= 16; break; /* CTRL key Pressed */
+ case '-': break; /* Not Pressed */
+ case 'x': break; /* Not Reporting */
+ default: return -1; /* Unknown Result */
+ }
+ if (*p++ != '\033')
+ return -1;
+ if (*p++ != '\\')
+ return -1;
+ switch (status)
+ {
+ case 'D': /* Double Click */
+ case 'S': /* Single Click */
+ if (button & 1) mouse_code |= MOUSE_LEFT;
+ if (button & 2) mouse_code |= MOUSE_MIDDLE;
+ if (button & 4) mouse_code |= MOUSE_RIGHT;
+ if (button & 8) mouse_code |= MOUSE_SHIFT;
+ if (button & 16) mouse_code |= MOUSE_CTRL;
+ break;
+ case 'm': /* Mouse move */
+ if (button & 1) mouse_code |= MOUSE_LEFT;
+ if (button & 2) mouse_code |= MOUSE_MIDDLE;
+ if (button & 4) mouse_code |= MOUSE_RIGHT;
+ if (button & 8) mouse_code |= MOUSE_SHIFT;
+ if (button & 16) mouse_code |= MOUSE_CTRL;
+ if ((button & 7) != 0)
+ {
+ held_button = mouse_code;
+ mouse_code |= MOUSE_DRAG;
+ }
+ is_drag = TRUE;
+ showmode();
+ break;
+ case 'd': /* Button Down */
+ if (button & 1) mouse_code |= MOUSE_LEFT;
+ if (button & 2) mouse_code |= MOUSE_MIDDLE;
+ if (button & 4) mouse_code |= MOUSE_RIGHT;
+ if (button & 8) mouse_code |= MOUSE_SHIFT;
+ if (button & 16) mouse_code |= MOUSE_CTRL;
+ break;
+ case 'u': /* Button Up */
+ if (button & 1)
+ mouse_code |= MOUSE_LEFT | MOUSE_RELEASE;
+ if (button & 2)
+ mouse_code |= MOUSE_MIDDLE | MOUSE_RELEASE;
+ if (button & 4)
+ mouse_code |= MOUSE_RIGHT | MOUSE_RELEASE;
+ if (button & 8)
+ mouse_code |= MOUSE_SHIFT;
+ if (button & 16)
+ mouse_code |= MOUSE_CTRL;
+ break;
+ default: return -1; /* Unknown Result */
+ }
+
+ slen += (p - (tp + slen));
+ }
+# endif /* FEAT_MOUSE_JSB */
+# ifdef FEAT_MOUSE_DEC
+ if (key_name[0] == (int)KS_DEC_MOUSE)
+ {
+ /* The DEC Locator Input Model
+ * Netterm delivers the code sequence:
+ * \033[2;4;24;80&w (left button down)
+ * \033[3;0;24;80&w (left button up)
+ * \033[6;1;24;80&w (right button down)
+ * \033[7;0;24;80&w (right button up)
+ * CSI Pe ; Pb ; Pr ; Pc ; Pp & w
+ * Pe is the event code
+ * Pb is the button code
+ * Pr is the row coordinate
+ * Pc is the column coordinate
+ * Pp is the third coordinate (page number)
+ * Pe, the event code indicates what event caused this report
+ * The following event codes are defined:
+ * 0 - request, the terminal received an explicit request
+ * for a locator report, but the locator is unavailable
+ * 1 - request, the terminal received an explicit request
+ * for a locator report
+ * 2 - left button down
+ * 3 - left button up
+ * 4 - middle button down
+ * 5 - middle button up
+ * 6 - right button down
+ * 7 - right button up
+ * 8 - fourth button down
+ * 9 - fourth button up
+ * 10 - locator outside filter rectangle
+ * Pb, the button code, ASCII decimal 0-15 indicating which
+ * buttons are down if any. The state of the four buttons
+ * on the locator correspond to the low four bits of the
+ * decimal value,
+ * "1" means button depressed
+ * 0 - no buttons down,
+ * 1 - right,
+ * 2 - middle,
+ * 4 - left,
+ * 8 - fourth
+ * Pr is the row coordinate of the locator position in the page,
+ * encoded as an ASCII decimal value.
+ * If Pr is omitted, the locator position is undefined
+ * (outside the terminal window for example).
+ * Pc is the column coordinate of the locator position in the
+ * page, encoded as an ASCII decimal value.
+ * If Pc is omitted, the locator position is undefined
+ * (outside the terminal window for example).
+ * Pp is the page coordinate of the locator position
+ * encoded as an ASCII decimal value.
+ * The page coordinate may be omitted if the locator is on
+ * page one (the default). We ignore it anyway.
+ */
+ int Pe, Pb, Pr, Pc;
+
+ p = tp + slen;
+
+ /* get event status */
+ Pe = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+
+ /* get button status */
+ Pb = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+
+ /* get row status */
+ Pr = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+
+ /* get column status */
+ Pc = getdigits(&p);
+
+ /* the page parameter is optional */
+ if (*p == ';')
+ {
+ p++;
+ (void)getdigits(&p);
+ }
+ if (*p++ != '&')
+ return -1;
+ if (*p++ != 'w')
+ return -1;
+
+ mouse_code = 0;
+ switch (Pe)
+ {
+ case 0: return -1; /* position request while unavailable */
+ case 1: /* a response to a locator position request includes
+ the status of all buttons */
+ Pb &= 7; /* mask off and ignore fourth button */
+ if (Pb & 4)
+ mouse_code = MOUSE_LEFT;
+ if (Pb & 2)
+ mouse_code = MOUSE_MIDDLE;
+ if (Pb & 1)
+ mouse_code = MOUSE_RIGHT;
+ if (Pb)
+ {
+ held_button = mouse_code;
+ mouse_code |= MOUSE_DRAG;
+ WantQueryMouse = 1;
+ }
+ is_drag = TRUE;
+ showmode();
+ break;
+ case 2: mouse_code = MOUSE_LEFT;
+ WantQueryMouse = 1;
+ break;
+ case 3: mouse_code = MOUSE_RELEASE | MOUSE_LEFT;
+ break;
+ case 4: mouse_code = MOUSE_MIDDLE;
+ WantQueryMouse = 1;
+ break;
+ case 5: mouse_code = MOUSE_RELEASE | MOUSE_MIDDLE;
+ break;
+ case 6: mouse_code = MOUSE_RIGHT;
+ WantQueryMouse = 1;
+ break;
+ case 7: mouse_code = MOUSE_RELEASE | MOUSE_RIGHT;
+ break;
+ case 8: return -1; /* fourth button down */
+ case 9: return -1; /* fourth button up */
+ case 10: return -1; /* mouse outside of filter rectangle */
+ default: return -1; /* should never occur */
+ }
+
+ mouse_col = Pc - 1;
+ mouse_row = Pr - 1;
+
+ slen += (int)(p - (tp + slen));
+ }
+# endif /* FEAT_MOUSE_DEC */
+# ifdef FEAT_MOUSE_PTERM
+ if (key_name[0] == (int)KS_PTERM_MOUSE)
+ {
+ int button, num_clicks, action, mc, mr;
+
+ p = tp + slen;
+
+ action = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+
+ mouse_row = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+ mouse_col = getdigits(&p);
+ if (*p++ != ';')
+ return -1;
+
+ button = getdigits(&p);
+ mouse_code = 0;
+
+ switch( button )
+ {
+ case 4: mouse_code = MOUSE_LEFT; break;
+ case 1: mouse_code = MOUSE_RIGHT; break;
+ case 2: mouse_code = MOUSE_MIDDLE; break;
+ default: return -1;
+ }
+
+ switch( action )
+ {
+ case 31: /* Initial press */
+ if (*p++ != ';')
+ return -1;
+
+ num_clicks = getdigits(&p); /* Not used */
+ break;
+
+ case 32: /* Release */
+ mouse_code |= MOUSE_RELEASE;
+ break;
+
+ case 33: /* Drag */
+ held_button = mouse_code;
+ mouse_code |= MOUSE_DRAG;
+ break;
+
+ default:
+ return -1;
+ }
+
+ if (*p++ != 't')
+ return -1;
+
+ slen += (p - (tp + slen));
+ }
+# endif /* FEAT_MOUSE_PTERM */
+
+ /* Interpret the mouse code */
+ current_button = (mouse_code & MOUSE_CLICK_MASK);
+ if (current_button == MOUSE_RELEASE
+# ifdef FEAT_MOUSE_XTERM
+ && wheel_code == 0
+# endif
+ )
+ {
+ /*
+ * If we get a mouse drag or release event when
+ * there is no mouse button held down (held_button ==
+ * MOUSE_RELEASE), produce a K_IGNORE below.
+ * (can happen when you hold down two buttons
+ * and then let them go, or click in the menu bar, but not
+ * on a menu, and drag into the text).
+ */
+ if ((mouse_code & MOUSE_DRAG) == MOUSE_DRAG)
+ is_drag = TRUE;
+ current_button = held_button;
+ }
+ else if (wheel_code == 0)
+ {
+# ifdef CHECK_DOUBLE_CLICK
+# ifdef FEAT_MOUSE_GPM
+# ifdef FEAT_GUI
+ /*
+ * Only for Unix, when GUI or gpm is not active, we handle
+ * multi-clicks here.
+ */
+ if (gpm_flag == 0 && !gui.in_use)
+# else
+ if (gpm_flag == 0)
+# endif
+# else
+# ifdef FEAT_GUI
+ if (!gui.in_use)
+# endif
+# endif
+ {
+ /*
+ * Compute the time elapsed since the previous mouse click.
+ */
+ gettimeofday(&mouse_time, NULL);
+ timediff = (mouse_time.tv_usec
+ - orig_mouse_time.tv_usec) / 1000;
+ if (timediff < 0)
+ --orig_mouse_time.tv_sec;
+ timediff += (mouse_time.tv_sec
+ - orig_mouse_time.tv_sec) * 1000;
+ orig_mouse_time = mouse_time;
+ if (mouse_code == orig_mouse_code
+ && timediff < p_mouset
+ && orig_num_clicks != 4
+ && orig_mouse_col == mouse_col
+ && orig_mouse_row == mouse_row
+#ifdef FEAT_DIFF
+ && orig_topfill == curwin->w_topfill
+#endif
+ && orig_topline == curwin->w_topline)
+ ++orig_num_clicks;
+ else
+ orig_num_clicks = 1;
+ orig_mouse_col = mouse_col;
+ orig_mouse_row = mouse_row;
+ orig_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ orig_topfill = curwin->w_topfill;
+#endif
+ }
+# if defined(FEAT_GUI) || defined(FEAT_MOUSE_GPM)
+ else
+ orig_num_clicks = NUM_MOUSE_CLICKS(mouse_code);
+# endif
+# else
+ orig_num_clicks = NUM_MOUSE_CLICKS(mouse_code);
+# endif
+ is_click = TRUE;
+ orig_mouse_code = mouse_code;
+ }
+ if (!is_drag)
+ held_button = mouse_code & MOUSE_CLICK_MASK;
+
+ /*
+ * Translate the actual mouse event into a pseudo mouse event.
+ * First work out what modifiers are to be used.
+ */
+ modifiers = 0x0;
+ if (orig_mouse_code & MOUSE_SHIFT)
+ modifiers |= MOD_MASK_SHIFT;
+ if (orig_mouse_code & MOUSE_CTRL)
+ modifiers |= MOD_MASK_CTRL;
+ if (orig_mouse_code & MOUSE_ALT)
+ modifiers |= MOD_MASK_ALT;
+ if (orig_num_clicks == 2)
+ modifiers |= MOD_MASK_2CLICK;
+ else if (orig_num_clicks == 3)
+ modifiers |= MOD_MASK_3CLICK;
+ else if (orig_num_clicks == 4)
+ modifiers |= MOD_MASK_4CLICK;
+
+ /* Add the modifier codes to our string */
+ if (modifiers != 0)
+ {
+ string[new_slen++] = K_SPECIAL;
+ string[new_slen++] = (int)KS_MODIFIER;
+ string[new_slen++] = modifiers;
+ }
+
+ /* Work out our pseudo mouse event */
+ key_name[0] = (int)KS_EXTRA;
+ if (wheel_code != 0)
+ key_name[1] = (wheel_code & 1)
+ ? (int)KE_MOUSEUP : (int)KE_MOUSEDOWN;
+ else
+ key_name[1] = get_pseudo_mouse_code(current_button,
+ is_click, is_drag);
+ }
+#endif /* FEAT_MOUSE */
+
+#ifdef FEAT_GUI
+ /*
+ * If using the GUI, then we get menu and scrollbar events.
+ *
+ * A menu event is encoded as K_SPECIAL, KS_MENU, KE_FILLER followed by
+ * four bytes which are to be taken as a pointer to the vimmenu_T
+ * structure.
+ *
+ * A scrollbar event is K_SPECIAL, KS_VER_SCROLLBAR, KE_FILLER followed
+ * by one byte representing the scrollbar number, and then four bytes
+ * representing a long_u which is the new value of the scrollbar.
+ *
+ * A horizontal scrollbar event is K_SPECIAL, KS_HOR_SCROLLBAR,
+ * KE_FILLER followed by four bytes representing a long_u which is the
+ * new value of the scrollbar.
+ */
+# ifdef FEAT_MENU
+ else if (key_name[0] == (int)KS_MENU)
+ {
+ long_u val;
+
+ num_bytes = get_long_from_buf(tp + slen, &val);
+ if (num_bytes == -1)
+ return -1;
+ current_menu = (vimmenu_T *)val;
+ slen += num_bytes;
+ }
+# endif
+# ifndef USE_ON_FLY_SCROLL
+ else if (key_name[0] == (int)KS_VER_SCROLLBAR)
+ {
+ long_u val;
+
+ /* Get the last scrollbar event in the queue of the same type */
+ j = 0;
+ for (i = 0; tp[j] == CSI && tp[j + 1] == KS_VER_SCROLLBAR
+ && tp[j + 2] != NUL; ++i)
+ {
+ j += 3;
+ num_bytes = get_bytes_from_buf(tp + j, bytes, 1);
+ if (num_bytes == -1)
+ break;
+ if (i == 0)
+ current_scrollbar = (int)bytes[0];
+ else if (current_scrollbar != (int)bytes[0])
+ break;
+ j += num_bytes;
+ num_bytes = get_long_from_buf(tp + j, &val);
+ if (num_bytes == -1)
+ break;
+ scrollbar_value = val;
+ j += num_bytes;
+ slen = j;
+ }
+ if (i == 0) /* not enough characters to make one */
+ return -1;
+ }
+ else if (key_name[0] == (int)KS_HOR_SCROLLBAR)
+ {
+ long_u val;
+
+ /* Get the last horiz. scrollbar event in the queue */
+ j = 0;
+ for (i = 0; tp[j] == CSI && tp[j + 1] == KS_HOR_SCROLLBAR
+ && tp[j + 2] != NUL; ++i)
+ {
+ j += 3;
+ num_bytes = get_long_from_buf(tp + j, &val);
+ if (num_bytes == -1)
+ break;
+ scrollbar_value = val;
+ j += num_bytes;
+ slen = j;
+ }
+ if (i == 0) /* not enough characters to make one */
+ return -1;
+ }
+# endif /* !USE_ON_FLY_SCROLL */
+#endif /* FEAT_GUI */
+
+ /* Finally, add the special key code to our string */
+ if (key_name[0] == KS_KEY)
+ string[new_slen++] = key_name[1]; /* from ":set <M-b>=xx" */
+ else
+ {
+ string[new_slen++] = K_SPECIAL;
+ string[new_slen++] = key_name[0];
+ string[new_slen++] = key_name[1];
+ }
+ string[new_slen] = NUL;
+ extra = new_slen - slen;
+ if (buf == NULL)
+ {
+ if (extra < 0)
+ /* remove matched chars, taking care of noremap */
+ del_typebuf(-extra, offset);
+ else if (extra > 0)
+ /* insert the extra space we need */
+ ins_typebuf(string + slen, REMAP_YES, offset, FALSE, FALSE);
+
+ /*
+ * Careful: del_typebuf() and ins_typebuf() may have reallocated
+ * typebuf.tb_buf[]!
+ */
+ mch_memmove(typebuf.tb_buf + typebuf.tb_off + offset, string,
+ (size_t)new_slen);
+ }
+ else
+ {
+ if (extra < 0)
+ /* remove matched characters */
+ mch_memmove(buf + offset, buf + offset - extra,
+ (size_t)(buflen + offset + extra));
+ else if (extra > 0)
+ /* insert the extra space we need */
+ mch_memmove(buf + offset + extra, buf + offset,
+ (size_t)(buflen - offset));
+ mch_memmove(buf + offset, string, (size_t)new_slen);
+ }
+ return (len + extra + offset);
+ }
+
+ return 0; /* no match found */
+}
+
+/*
+ * Replace any terminal code strings in from[] with the equivalent internal
+ * vim representation. This is used for the "from" and "to" part of a
+ * mapping, and the "to" part of a menu command.
+ * Any strings like "<C-UP>" are also replaced, unless 'cpoptions' contains
+ * '<'.
+ * K_SPECIAL by itself is replaced by K_SPECIAL KS_SPECIAL KE_FILLER.
+ *
+ * The replacement is done in result[] and finally copied into allocated
+ * memory. If this all works well *bufp is set to the allocated memory and a
+ * pointer to it is returned. If something fails *bufp is set to NULL and from
+ * is returned.
+ *
+ * CTRL-V characters are removed. When "from_part" is TRUE, a trailing CTRL-V
+ * is included, otherwise it is removed (for ":map xx ^V", maps xx to
+ * nothing). When 'cpoptions' does not contain 'B', a backslash can be used
+ * instead of a CTRL-V.
+ */
+ char_u *
+replace_termcodes(from, bufp, from_part, do_lt)
+ char_u *from;
+ char_u **bufp;
+ int from_part;
+ int do_lt; /* also translate <lt> */
+{
+ int i;
+ int slen;
+ int key;
+ int dlen = 0;
+ char_u *src;
+ int do_backslash; /* backslash is a special character */
+ int do_special; /* recognize <> key codes */
+ int do_key_code; /* recognize raw key codes */
+ char_u *result; /* buffer for resulting string */
+
+ do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL);
+ do_special = (vim_strchr(p_cpo, CPO_SPECI) == NULL);
+ do_key_code = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL);
+
+ /*
+ * Allocate space for the translation. Worst case a single character is
+ * replaced by 6 bytes (shifted special key), plus a NUL at the end.
+ */
+ result = alloc((unsigned)STRLEN(from) * 6 + 1);
+ if (result == NULL) /* out of memory */
+ {
+ *bufp = NULL;
+ return from;
+ }
+
+ src = from;
+
+ /*
+ * Check for #n at start only: function key n
+ */
+ if (from_part && src[0] == '#' && VIM_ISDIGIT(src[1])) /* function key */
+ {
+ result[dlen++] = K_SPECIAL;
+ result[dlen++] = 'k';
+ if (src[1] == '0')
+ result[dlen++] = ';'; /* #0 is F10 is "k;" */
+ else
+ result[dlen++] = src[1]; /* #3 is F3 is "k3" */
+ src += 2;
+ }
+
+ /*
+ * Copy each byte from *from to result[dlen]
+ */
+ while (*src != NUL)
+ {
+ /*
+ * If 'cpoptions' does not contain '<', check for special key codes,
+ * like "<C-S-MouseLeft>"
+ */
+ if (do_special && (do_lt || STRNCMP(src, "<lt>", 4) != 0))
+ {
+#ifdef FEAT_EVAL
+ /*
+ * Replace <SID> by K_SNR <script-nr> _.
+ * (room: 5 * 6 = 30 bytes; needed: 3 + <nr> + 1 <= 14)
+ */
+ if (STRNICMP(src, "<SID>", 5) == 0)
+ {
+ if (current_SID <= 0)
+ EMSG(_(e_usingsid));
+ else
+ {
+ src += 5;
+ result[dlen++] = K_SPECIAL;
+ result[dlen++] = (int)KS_EXTRA;
+ result[dlen++] = (int)KE_SNR;
+ sprintf((char *)result + dlen, "%ld", (long)current_SID);
+ dlen += (int)STRLEN(result + dlen);
+ result[dlen++] = '_';
+ continue;
+ }
+ }
+#endif
+
+ slen = trans_special(&src, result + dlen, TRUE);
+ if (slen)
+ {
+ dlen += slen;
+ continue;
+ }
+ }
+
+ /*
+ * If 'cpoptions' does not contain 'k', see if it's an actual key-code.
+ * Note that this is also checked after replacing the <> form.
+ * Single character codes are NOT replaced (e.g. ^H or DEL), because
+ * it could be a character in the file.
+ */
+ if (do_key_code)
+ {
+ i = find_term_bykeys(src);
+ if (i >= 0)
+ {
+ result[dlen++] = K_SPECIAL;
+ result[dlen++] = termcodes[i].name[0];
+ result[dlen++] = termcodes[i].name[1];
+ src += termcodes[i].len;
+ /* If terminal code matched, continue after it. */
+ continue;
+ }
+ }
+
+#ifdef FEAT_EVAL
+ if (do_special)
+ {
+ char_u *p, *s, len;
+
+ /*
+ * Replace <Leader> by the value of "mapleader".
+ * Replace <LocalLeader> by the value of "maplocalleader".
+ * If "mapleader" or "maplocalleader" isn't set use a backslash.
+ */
+ if (STRNICMP(src, "<Leader>", 8) == 0)
+ {
+ len = 8;
+ p = get_var_value((char_u *)"g:mapleader");
+ }
+ else if (STRNICMP(src, "<LocalLeader>", 13) == 0)
+ {
+ len = 13;
+ p = get_var_value((char_u *)"g:maplocalleader");
+ }
+ else
+ {
+ len = 0;
+ p = NULL;
+ }
+ if (len != 0)
+ {
+ /* Allow up to 8 * 6 characters for "mapleader". */
+ if (p == NULL || *p == NUL || STRLEN(p) > 8 * 6)
+ s = (char_u *)"\\";
+ else
+ s = p;
+ while (*s != NUL)
+ result[dlen++] = *s++;
+ src += len;
+ continue;
+ }
+ }
+#endif
+
+ /*
+ * Remove CTRL-V and ignore the next character.
+ * For "from" side the CTRL-V at the end is included, for the "to"
+ * part it is removed.
+ * If 'cpoptions' does not contain 'B', also accept a backslash.
+ */
+ key = *src;
+ if (key == Ctrl_V || (do_backslash && key == '\\'))
+ {
+ ++src; /* skip CTRL-V or backslash */
+ if (*src == NUL)
+ {
+ if (from_part)
+ result[dlen++] = key;
+ break;
+ }
+ }
+
+#ifdef FEAT_MBYTE
+ /* skip multibyte char correctly */
+ for (i = (*mb_ptr2len_check)(src); i > 0; --i)
+#endif
+ {
+ /*
+ * If the character is K_SPECIAL, replace it with K_SPECIAL
+ * KS_SPECIAL KE_FILLER.
+ * If compiled with the GUI replace CSI with K_CSI.
+ */
+ if (*src == K_SPECIAL)
+ {
+ result[dlen++] = K_SPECIAL;
+ result[dlen++] = KS_SPECIAL;
+ result[dlen++] = KE_FILLER;
+ }
+# ifdef FEAT_GUI
+ else if (*src == CSI)
+ {
+ result[dlen++] = K_SPECIAL;
+ result[dlen++] = KS_EXTRA;
+ result[dlen++] = (int)KE_CSI;
+ }
+# endif
+ else
+ result[dlen++] = *src;
+ ++src;
+ }
+ }
+ result[dlen] = NUL;
+
+ /*
+ * Copy the new string to allocated memory.
+ * If this fails, just return from.
+ */
+ if ((*bufp = vim_strsave(result)) != NULL)
+ from = *bufp;
+ vim_free(result);
+ return from;
+}
+
+/*
+ * Find a termcode with keys 'src' (must be NUL terminated).
+ * Return the index in termcodes[], or -1 if not found.
+ */
+ int
+find_term_bykeys(src)
+ char_u *src;
+{
+ int i;
+ int slen;
+
+ for (i = 0; i < tc_len; ++i)
+ {
+ slen = termcodes[i].len;
+ if (slen > 1 && STRNCMP(termcodes[i].code, src, (size_t)slen) == 0)
+ return i;
+ }
+ return -1;
+}
+
+/*
+ * Gather the first characters in the terminal key codes into a string.
+ * Used to speed up check_termcode().
+ */
+ static void
+gather_termleader()
+{
+ int i;
+ int len = 0;
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ termleader[len++] = CSI; /* the GUI codes are not in termcodes[] */
+#endif
+#ifdef FEAT_TERMRESPONSE
+ if (check_for_codes)
+ termleader[len++] = DCS; /* the termcode response starts with DCS
+ in 8-bit mode */
+#endif
+ termleader[len] = NUL;
+
+ for (i = 0; i < tc_len; ++i)
+ if (vim_strchr(termleader, termcodes[i].code[0]) == NULL)
+ {
+ termleader[len++] = termcodes[i].code[0];
+ termleader[len] = NUL;
+ }
+
+ need_gather = FALSE;
+}
+
+/*
+ * Show all termcodes (for ":set termcap")
+ * This code looks a lot like showoptions(), but is different.
+ */
+ void
+show_termcodes()
+{
+ int col;
+ int *items;
+ int item_count;
+ int run;
+ int row, rows;
+ int cols;
+ int i;
+ int len;
+
+#define INC 27 /* try to make three columns */
+#define GAP 2 /* spaces between columns */
+
+ if (tc_len == 0) /* no terminal codes (must be GUI) */
+ return;
+ items = (int *)alloc((unsigned)(sizeof(int) * tc_len));
+ if (items == NULL)
+ return;
+
+ /* Highlight title */
+ MSG_PUTS_TITLE(_("\n--- Terminal keys ---"));
+
+ /*
+ * do the loop two times:
+ * 1. display the short items (non-strings and short strings)
+ * 2. display the long items (strings)
+ */
+ for (run = 1; run <= 2 && !got_int; ++run)
+ {
+ /*
+ * collect the items in items[]
+ */
+ item_count = 0;
+ for (i = 0; i < tc_len; i++)
+ {
+ len = show_one_termcode(termcodes[i].name,
+ termcodes[i].code, FALSE);
+ if ((len <= INC - GAP && run == 1) || (len > INC - GAP && run == 2))
+ items[item_count++] = i;
+ }
+
+ /*
+ * display the items
+ */
+ if (run == 1)
+ {
+ cols = (Columns + GAP) / INC;
+ if (cols == 0)
+ cols = 1;
+ rows = (item_count + cols - 1) / cols;
+ }
+ else /* run == 2 */
+ rows = item_count;
+ for (row = 0; row < rows && !got_int; ++row)
+ {
+ msg_putchar('\n'); /* go to next line */
+ if (got_int) /* 'q' typed in more */
+ break;
+ col = 0;
+ for (i = row; i < item_count; i += rows)
+ {
+ msg_col = col; /* make columns */
+ show_one_termcode(termcodes[items[i]].name,
+ termcodes[items[i]].code, TRUE);
+ col += INC;
+ }
+ out_flush();
+ ui_breakcheck();
+ }
+ }
+ vim_free(items);
+}
+
+/*
+ * Show one termcode entry.
+ * Output goes into IObuff[]
+ */
+ int
+show_one_termcode(name, code, printit)
+ char_u *name;
+ char_u *code;
+ int printit;
+{
+ char_u *p;
+ int len;
+
+ if (name[0] > '~')
+ {
+ IObuff[0] = ' ';
+ IObuff[1] = ' ';
+ IObuff[2] = ' ';
+ IObuff[3] = ' ';
+ }
+ else
+ {
+ IObuff[0] = 't';
+ IObuff[1] = '_';
+ IObuff[2] = name[0];
+ IObuff[3] = name[1];
+ }
+ IObuff[4] = ' ';
+
+ p = get_special_key_name(TERMCAP2KEY(name[0], name[1]), 0);
+ if (p[1] != 't')
+ STRCPY(IObuff + 5, p);
+ else
+ IObuff[5] = NUL;
+ len = (int)STRLEN(IObuff);
+ do
+ IObuff[len++] = ' ';
+ while (len < 17);
+ IObuff[len] = NUL;
+ if (code == NULL)
+ len += 4;
+ else
+ len += vim_strsize(code);
+
+ if (printit)
+ {
+ msg_puts(IObuff);
+ if (code == NULL)
+ msg_puts((char_u *)"NULL");
+ else
+ msg_outtrans(code);
+ }
+ return len;
+}
+
+#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
+/*
+ * For Xterm >= 140 compiled with OPT_TCAP_QUERY: Obtain the actually used
+ * termcap codes from the terminal itself.
+ * We get them one by one to avoid a very long response string.
+ */
+static int xt_index_in = 0;
+static int xt_index_out = 0;
+
+ static void
+req_codes_from_term()
+{
+ xt_index_out = 0;
+ xt_index_in = 0;
+ req_more_codes_from_term();
+}
+
+ static void
+req_more_codes_from_term()
+{
+ char buf[11];
+ int old_idx = xt_index_out;
+
+ /* Don't do anything when going to exit. */
+ if (exiting)
+ return;
+
+ /* Send up to 10 more requests out than we received. Avoid sending too
+ * many, there can be a buffer overflow somewhere. */
+ while (xt_index_out < xt_index_in + 10 && key_names[xt_index_out] != NULL)
+ {
+ sprintf(buf, "\033P+q%02x%02x\033\\",
+ key_names[xt_index_out][0], key_names[xt_index_out][1]);
+ out_str_nf((char_u *)buf);
+ ++xt_index_out;
+ }
+
+ /* Send the codes out right away. */
+ if (xt_index_out != old_idx)
+ out_flush();
+}
+
+/*
+ * Decode key code response from xterm: '<Esc>P1+r<name>=<string><Esc>\'.
+ * A "0" instead of the "1" indicates a code that isn't supported.
+ * Both <name> and <string> are encoded in hex.
+ * "code" points to the "0" or "1".
+ */
+ static void
+got_code_from_term(code, len)
+ char_u *code;
+ int len;
+{
+#define XT_LEN 100
+ char_u name[3];
+ char_u str[XT_LEN];
+ int i;
+ int j = 0;
+ int c;
+
+ /* A '1' means the code is supported, a '0' means it isn't.
+ * When half the length is > XT_LEN we can't use it.
+ * Our names are currently all 2 characters. */
+ if (code[0] == '1' && code[7] == '=' && len / 2 < XT_LEN)
+ {
+ /* Get the name from the response and find it in the table. */
+ name[0] = hexhex2nr(code + 3);
+ name[1] = hexhex2nr(code + 5);
+ name[2] = NUL;
+ for (i = 0; key_names[i] != NULL; ++i)
+ {
+ if (STRCMP(key_names[i], name) == 0)
+ {
+ xt_index_in = i;
+ break;
+ }
+ }
+ if (key_names[i] != NULL)
+ {
+ for (i = 8; (c = hexhex2nr(code + i)) >= 0; i += 2)
+ str[j++] = c;
+ str[j] = NUL;
+ if (name[0] == 'C' && name[1] == 'o')
+ {
+ /* Color count is not a key code. */
+ i = atoi((char *)str);
+ if (i != t_colors)
+ {
+ /* Nr of colors changed, initialize highlighting and
+ * redraw everything. */
+ set_color_count(i);
+ init_highlight(TRUE, FALSE);
+ redraw_later(CLEAR);
+ }
+ }
+ else
+ {
+ /* First delete any existing entry with the same code. */
+ i = find_term_bykeys(str);
+ if (i >= 0)
+ del_termcode_idx(i);
+ add_termcode(name, str, FALSE);
+ }
+ }
+ }
+
+ /* May request more codes now that we received one. */
+ ++xt_index_in;
+ req_more_codes_from_term();
+}
+
+/*
+ * Check if there are any unanswered requests and deal with them.
+ * This is called before starting an external program or getting direct
+ * keyboard input. We don't want responses to be send to that program or
+ * handled as typed text.
+ */
+ static void
+check_for_codes_from_term()
+{
+ int c;
+
+ /* If no codes requested or all are answered, no need to wait. */
+ if (xt_index_out == 0 || xt_index_out == xt_index_in)
+ return;
+
+ /* Vgetc() will check for and handle any response.
+ * Keep calling vpeekc() until we don't get any responses. */
+ ++no_mapping;
+ ++allow_keys;
+ for (;;)
+ {
+ c = vpeekc();
+ if (c == NUL) /* nothing available */
+ break;
+
+ /* If a response is recognized it's replaced with K_IGNORE, must read
+ * it from the input stream. If there is no K_IGNORE we can't do
+ * anything, break here (there might be some responses further on, but
+ * we don't want to throw away any typed chars). */
+ if (c != K_SPECIAL && c != K_IGNORE)
+ break;
+ c = vgetc();
+ if (c != K_IGNORE)
+ {
+ vungetc(c);
+ break;
+ }
+ }
+ --no_mapping;
+ --allow_keys;
+}
+#endif
+
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Translate an internal mapping/abbreviation representation into the
+ * corresponding external one recognized by :map/:abbrev commands;
+ * respects the current B/k/< settings of 'cpoption'.
+ *
+ * This function is called when expanding mappings/abbreviations on the
+ * command-line, and for building the "Ambiguous mapping..." error messæge.
+ *
+ * It uses a growarray to build the translation string since the
+ * latter can be wider than the original description. The caller has to
+ * free the string afterwards.
+ *
+ * Returns NULL when there is a problem.
+ */
+ char_u *
+translate_mapping(str, expmap)
+ char_u *str;
+ int expmap; /* TRUE when expanding mappings on command-line */
+{
+ garray_T ga;
+ int c;
+ int modifiers;
+ int cpo_bslash;
+ int cpo_special;
+ int cpo_keycode;
+
+ ga_init(&ga);
+ ga.ga_itemsize = 1;
+ ga.ga_growsize = 40;
+
+ cpo_bslash = (vim_strchr(p_cpo, CPO_BSLASH) != NULL);
+ cpo_special = (vim_strchr(p_cpo, CPO_SPECI) != NULL);
+ cpo_keycode = (vim_strchr(p_cpo, CPO_KEYCODE) == NULL);
+
+ for (; *str; ++str)
+ {
+ c = *str;
+ if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL)
+ {
+ modifiers = 0;
+ if (str[1] == KS_MODIFIER)
+ {
+ str++;
+ modifiers = *++str;
+ c = *++str;
+ }
+ if (cpo_special && cpo_keycode && c == K_SPECIAL && !modifiers)
+ {
+ int i;
+
+ /* try to find special key in termcodes */
+ for (i = 0; i < tc_len; ++i)
+ if (termcodes[i].name[0] == str[1]
+ && termcodes[i].name[1] == str[2])
+ break;
+ if (i < tc_len)
+ {
+ ga_concat(&ga, termcodes[i].code);
+ str += 2;
+ continue; /* for (str) */
+ }
+ }
+ if (c == K_SPECIAL && str[1] != NUL && str[2] != NUL)
+ {
+ if (expmap && cpo_special)
+ {
+ ga_clear(&ga);
+ return NULL;
+ }
+ c = TO_SPECIAL(str[1], str[2]);
+ if (c == K_ZERO) /* display <Nul> as ^@ */
+ c = NUL;
+ str += 2;
+ }
+ if (IS_SPECIAL(c) || modifiers) /* special key */
+ {
+ if (expmap && cpo_special)
+ {
+ ga_clear(&ga);
+ return NULL;
+ }
+ ga_concat(&ga, get_special_key_name(c, modifiers));
+ continue; /* for (str) */
+ }
+ }
+ if (c == ' ' || c == '\t' || c == Ctrl_J || c == Ctrl_V
+ || (c == '<' && !cpo_special) || (c == '\\' && !cpo_bslash))
+ ga_append(&ga, cpo_bslash ? Ctrl_V : '\\');
+ if (c)
+ ga_append(&ga, c);
+ }
+ ga_append(&ga, NUL);
+ return (char_u *)(ga.ga_data);
+}
+#endif
+
+#if (defined(WIN3264) && !defined(FEAT_GUI)) || defined(PROTO)
+static char ksme_str[20];
+static char ksmr_str[20];
+static char ksmd_str[20];
+
+/*
+ * For Win32 console: update termcap codes for existing console attributes.
+ */
+ void
+update_tcap(attr)
+ int attr;
+{
+ struct builtin_term *p;
+
+ p = find_builtin_term(DEFAULT_TERM);
+ sprintf(ksme_str, IF_EB("\033|%dm", ESC_STR "|%dm"), attr);
+ sprintf(ksmd_str, IF_EB("\033|%dm", ESC_STR "|%dm"),
+ attr | 0x08); /* FOREGROUND_INTENSITY */
+ sprintf(ksmr_str, IF_EB("\033|%dm", ESC_STR "|%dm"),
+ ((attr & 0x0F) << 4) | ((attr & 0xF0) >> 4));
+
+ while (p->bt_string != NULL)
+ {
+ if (p->bt_entry == (int)KS_ME)
+ p->bt_string = &ksme_str[0];
+ else if (p->bt_entry == (int)KS_MR)
+ p->bt_string = &ksmr_str[0];
+ else if (p->bt_entry == (int)KS_MD)
+ p->bt_string = &ksmd_str[0];
+ ++p;
+ }
+}
+#endif
diff --git a/src/term.h b/src/term.h
new file mode 100644
index 000000000..17b1065ca
--- /dev/null
+++ b/src/term.h
@@ -0,0 +1,156 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * This file contains the defines for the machine dependent escape sequences
+ * that the editor needs to perform various operations. All of the sequences
+ * here are optional, except "cm" (cursor motion).
+ */
+
+#if defined(SASC) && SASC < 658
+/*
+ * The SAS C compiler has a bug that makes typedefs being forgot in include
+ * files. Has been fixed in version 6.58.
+ */
+typedef unsigned char char_u;
+#endif
+
+/*
+ * Index of the termcap codes in the term_strings array.
+ */
+enum SpecialKey
+{
+ KS_NAME = 0,/* name of this terminal entry */
+ KS_CE, /* clear to end of line */
+ KS_AL, /* add new blank line */
+ KS_CAL, /* add number of blank lines */
+ KS_DL, /* delete line */
+ KS_CDL, /* delete number of lines */
+ KS_CS, /* scroll region */
+ KS_CL, /* clear screen */
+ KS_CD, /* clear to end of display */
+ KS_UT, /* clearing uses current background color */
+ KS_DA, /* text may be scrolled down from up */
+ KS_DB, /* text may be scrolled up from down */
+ KS_VI, /* cursor invisible */
+ KS_VE, /* cursor visible */
+ KS_VS, /* cursor very visible */
+ KS_ME, /* normal mode */
+ KS_MR, /* reverse mode */
+ KS_MD, /* bold mode */
+ KS_SE, /* normal mode */
+ KS_SO, /* standout mode */
+ KS_CZH, /* italic mode start */
+ KS_CZR, /* italic mode end */
+ KS_UE, /* exit underscore mode */
+ KS_US, /* underscore mode */
+ KS_MS, /* save to move cur in reverse mode */
+ KS_CM, /* cursor motion */
+ KS_SR, /* scroll reverse (backward) */
+ KS_CRI, /* cursor number of chars right */
+ KS_VB, /* visual bell */
+ KS_KS, /* put term in "keypad transmit" mode */
+ KS_KE, /* out of "keypad transmit" mode */
+ KS_TI, /* put terminal in termcap mode */
+ KS_TE, /* out of termcap mode */
+ KS_BC, /* backspace character (cursor left) */
+ KS_CCS, /* cur is relative to scroll region */
+ KS_CCO, /* number of colors */
+ KS_CSF, /* set foreground color */
+ KS_CSB, /* set background color */
+ KS_XS, /* standout not erased by overwriting (hpterm) */
+ KS_MB, /* blink mode */
+ KS_CAF, /* set foreground color (ANSI) */
+ KS_CAB, /* set background color (ANSI) */
+ KS_LE, /* cursor left (mostly backspace) */
+ KS_ND, /* cursor right */
+ KS_CIS, /* set icon text start */
+ KS_CIE, /* set icon text end */
+ KS_TS, /* set window title start (to status line)*/
+ KS_FS, /* set window title end (from status line) */
+ KS_CWP, /* set window position in pixels */
+ KS_CWS, /* set window size in characters */
+ KS_CRV, /* request version string */
+#ifdef FEAT_VERTSPLIT
+ KS_CSV, /* scroll region vertical */
+#endif
+ KS_OP /* original color pair */
+};
+
+#define KS_LAST KS_OP
+
+/*
+ * the terminal capabilities are stored in this array
+ * IMPORTANT: When making changes, note the following:
+ * - there should be an entry for each code in the builtin termcaps
+ * - there should be an option for each code in option.c
+ * - there should be code in term.c to obtain the value from the termcap
+ */
+
+extern char_u *(term_strings[]); /* current terminal strings */
+
+/*
+ * strings used for terminal
+ */
+#define T_NAME (term_str(KS_NAME)) /* terminal name */
+#define T_CE (term_str(KS_CE)) /* clear to end of line */
+#define T_AL (term_str(KS_AL)) /* add new blank line */
+#define T_CAL (term_str(KS_CAL)) /* add number of blank lines */
+#define T_DL (term_str(KS_DL)) /* delete line */
+#define T_CDL (term_str(KS_CDL)) /* delete number of lines */
+#define T_CS (term_str(KS_CS)) /* scroll region */
+#define T_CSV (term_str(KS_CSV)) /* scroll region vertical */
+#define T_CL (term_str(KS_CL)) /* clear screen */
+#define T_CD (term_str(KS_CD)) /* clear to end of display */
+#define T_UT (term_str(KS_UT)) /* clearing uses background color */
+#define T_DA (term_str(KS_DA)) /* text may be scrolled down from up */
+#define T_DB (term_str(KS_DB)) /* text may be scrolled up from down */
+#define T_VI (term_str(KS_VI)) /* cursor invisible */
+#define T_VE (term_str(KS_VE)) /* cursor visible */
+#define T_VS (term_str(KS_VS)) /* cursor very visible */
+#define T_ME (term_str(KS_ME)) /* normal mode */
+#define T_MR (term_str(KS_MR)) /* reverse mode */
+#define T_MD (term_str(KS_MD)) /* bold mode */
+#define T_SE (term_str(KS_SE)) /* normal mode */
+#define T_SO (term_str(KS_SO)) /* standout mode */
+#define T_CZH (term_str(KS_CZH)) /* italic mode start */
+#define T_CZR (term_str(KS_CZR)) /* italic mode end */
+#define T_UE (term_str(KS_UE)) /* exit underscore mode */
+#define T_US (term_str(KS_US)) /* underscore mode */
+#define T_MS (term_str(KS_MS)) /* save to move cur in reverse mode */
+#define T_CM (term_str(KS_CM)) /* cursor motion */
+#define T_SR (term_str(KS_SR)) /* scroll reverse (backward) */
+#define T_CRI (term_str(KS_CRI)) /* cursor number of chars right */
+#define T_VB (term_str(KS_VB)) /* visual bell */
+#define T_KS (term_str(KS_KS)) /* put term in "keypad transmit" mode */
+#define T_KE (term_str(KS_KE)) /* out of "keypad transmit" mode */
+#define T_TI (term_str(KS_TI)) /* put terminal in termcap mode */
+#define T_TE (term_str(KS_TE)) /* out of termcap mode */
+#define T_BC (term_str(KS_BC)) /* backspace character */
+#define T_CCS (term_str(KS_CCS)) /* cur is relative to scroll region */
+#define T_CCO (term_str(KS_CCO)) /* number of colors */
+#define T_CSF (term_str(KS_CSF)) /* set foreground color */
+#define T_CSB (term_str(KS_CSB)) /* set background color */
+#define T_XS (term_str(KS_XS)) /* standout not erased by overwriting */
+#define T_MB (term_str(KS_MB)) /* blink mode */
+#define T_CAF (term_str(KS_CAF)) /* set foreground color (ANSI) */
+#define T_CAB (term_str(KS_CAB)) /* set background color (ANSI) */
+#define T_LE (term_str(KS_LE)) /* cursor left */
+#define T_ND (term_str(KS_ND)) /* cursor right */
+#define T_CIS (term_str(KS_CIS)) /* set icon text start */
+#define T_CIE (term_str(KS_CIE)) /* set icon text end */
+#define T_TS (term_str(KS_TS)) /* set window title start */
+#define T_FS (term_str(KS_FS)) /* set window title end */
+#define T_CWP (term_str(KS_CWP)) /* window position */
+#define T_CWS (term_str(KS_CWS)) /* window size */
+#define T_CRV (term_str(KS_CRV)) /* request version string */
+#define T_OP (term_str(KS_OP)) /* original color pair */
+
+#define TMODE_COOK 0 /* terminal mode for external cmds and Ex mode */
+#define TMODE_SLEEP 1 /* terminal mode for sleeping (cooked but no echo) */
+#define TMODE_RAW 2 /* terminal mode for Normal and Insert mode */
diff --git a/src/termlib.c b/src/termlib.c
new file mode 100644
index 000000000..a0036c64b
--- /dev/null
+++ b/src/termlib.c
@@ -0,0 +1,628 @@
+/* vi:set ts=8 sts=4 sw=4: */
+/*
+ * The following software is (C) 1984 Peter da Silva, the Mad Australian, in
+ * the public domain. It may be re-distributed for any purpose with the
+ * inclusion of this notice.
+ */
+
+/* Modified by Bram Moolenaar for use with VIM - Vi Improved. */
+/* A few bugs removed by Olaf 'Rhialto' Seibert. */
+
+/* TERMLIB: Terminal independant database. */
+
+#include "vim.h"
+#include "termlib.pro"
+
+#if !defined(AMIGA) && !defined(VMS) && !defined(MACOS) && !defined(RISCOS)
+# include <sgtty.h>
+#endif
+
+static int getent __ARGS((char *, char *, FILE *, int));
+static int nextent __ARGS((char *, FILE *, int));
+static int _match __ARGS((char *, char *));
+static char *_addfmt __ARGS((char *, char *, int));
+static char *_find __ARGS((char *, char *));
+
+/*
+ * Global variables for termlib
+ */
+
+char *tent; /* Pointer to terminal entry, set by tgetent */
+char PC = 0; /* Pad character, default NULL */
+char *UP = 0, *BC = 0; /* Pointers to UP and BC strings from database */
+short ospeed; /* Baud rate (1-16, 1=300, 16=19200), as in stty */
+
+/*
+ * Module: tgetent
+ *
+ * Purpose: Get termcap entry for <term> into buffer at <tbuf>.
+ *
+ * Calling conventions: char tbuf[TBUFSZ+], term=canonical name for terminal.
+ *
+ * Returned values: 1 = success, -1 = can't open file,
+ * 0 = can't find terminal.
+ *
+ * Notes:
+ * - Should probably supply static buffer.
+ * - Uses environment variables "TERM" and "TERMCAP". If TERM = term (that is,
+ * if the argument matches the environment) then it looks at TERMCAP.
+ * - If TERMCAP begins with a slash, then it assumes this is the file to
+ * search rather than /etc/termcap.
+ * - If TERMCAP does not begin with a slash, and it matches TERM, then this is
+ * used as the entry.
+ * - This could be simplified considerably for non-UNIX systems.
+ */
+
+#ifndef TERMCAPFILE
+# ifdef AMIGA
+# define TERMCAPFILE "s:termcap"
+# else
+# ifdef VMS
+# define TERMCAPFILE "VIMRUNTIME:termcap"
+# else
+# define TERMCAPFILE "/etc/termcap"
+# endif
+# endif
+#endif
+
+ int
+tgetent(tbuf, term)
+ char *tbuf; /* Buffer to hold termcap entry, TBUFSZ bytes max */
+ char *term; /* Name of terminal */
+{
+ char tcbuf[32]; /* Temp buffer to handle */
+ char *tcptr = tcbuf; /* extended entries */
+ char *tcap = TERMCAPFILE; /* Default termcap file */
+ char *tmp;
+ FILE *termcap;
+ int retval = 0;
+ int len;
+
+ if ((tmp = (char *)mch_getenv((char_u *)"TERMCAP")) != NULL)
+ {
+ if (*tmp == '/') /* TERMCAP = name of termcap file */
+ {
+ tcap = tmp ;
+#if defined(AMIGA)
+ /* Convert /usr/share/lib/termcap to usr:share/lib/termcap */
+ tcap++;
+ tmp = strchr(tcap, '/');
+ if (tmp)
+ *tmp = ':';
+#endif
+ }
+ else /* TERMCAP = termcap entry itself */
+ {
+ int tlen = strlen(term);
+
+ while (*tmp && *tmp != ':') /* Check if TERM matches */
+ {
+ char *nexttmp;
+
+ while (*tmp == '|')
+ tmp++;
+ nexttmp = _find(tmp, ":|"); /* Rhialto */
+ if (tmp+tlen == nexttmp && _match(tmp, term) == tlen)
+ {
+ strcpy(tbuf, tmp);
+ tent = tbuf;
+ return 1;
+ }
+ else
+ tmp = nexttmp;
+ }
+ }
+ }
+ if (!(termcap = mch_fopen(tcap, "r")))
+ {
+ strcpy(tbuf, tcap);
+ return -1;
+ }
+
+ len = 0;
+ while (getent(tbuf + len, term, termcap, TBUFSZ - len))
+ {
+ tcptr = tcbuf; /* Rhialto */
+ if ((term = tgetstr("tc", &tcptr))) /* extended entry */
+ {
+ rewind(termcap);
+ len = strlen(tbuf);
+ }
+ else
+ {
+ retval = 1;
+ tent = tbuf; /* reset it back to the beginning */
+ break;
+ }
+ }
+ fclose(termcap);
+ return retval;
+}
+
+ static int
+getent(tbuf, term, termcap, buflen)
+ char *tbuf, *term;
+ FILE *termcap;
+ int buflen;
+{
+ char *tptr;
+ int tlen = strlen(term);
+
+ while (nextent(tbuf, termcap, buflen)) /* For each possible entry */
+ {
+ tptr = tbuf;
+ while (*tptr && *tptr != ':') /* : terminates name field */
+ {
+ char *nexttptr;
+
+ while (*tptr == '|') /* | seperates names */
+ tptr++;
+ nexttptr = _find(tptr, ":|"); /* Rhialto */
+ if (tptr + tlen == nexttptr &&
+ _match(tptr, term) == tlen) /* FOUND! */
+ {
+ tent = tbuf;
+ return 1;
+ }
+ else /* Look for next name */
+ tptr = nexttptr;
+ }
+ }
+ return 0;
+}
+
+ static int
+nextent(tbuf, termcap, buflen) /* Read 1 entry from TERMCAP file */
+ char *tbuf;
+ FILE *termcap;
+ int buflen;
+{
+ char *lbuf = tbuf; /* lbuf=line buffer */
+ /* read lines straight into buffer */
+
+ while (lbuf < tbuf+buflen && /* There's room and */
+ fgets(lbuf, (int)(tbuf+buflen-lbuf), termcap)) /* another line */
+ {
+ int llen = strlen(lbuf);
+
+ if (*lbuf == '#') /* eat comments */
+ continue;
+ if (lbuf[-1] == ':' && /* and whitespace */
+ lbuf[0] == '\t' &&
+ lbuf[1] == ':')
+ {
+ strcpy(lbuf, lbuf+2);
+ llen -= 2;
+ }
+ if (lbuf[llen-2] == '\\') /* and continuations */
+ lbuf += llen-2;
+ else
+ {
+ lbuf[llen-1]=0; /* no continuation, return */
+ return 1;
+ }
+ }
+
+ return 0; /* ran into end of file */
+}
+
+/*
+ * Module: tgetflag
+ *
+ * Purpose: returns flag true or false as to the existence of a given entry.
+ * used with 'bs', 'am', etc...
+ *
+ * Calling conventions: id is the 2 character capability id.
+ *
+ * Returned values: 1 for success, 0 for failure.
+ */
+
+ int
+tgetflag(id)
+ char *id;
+{
+ char buf[256], *ptr = buf;
+
+ return tgetstr(id, &ptr) ? 1 : 0;
+}
+
+/*
+ * Module: tgetnum
+ *
+ * Purpose: get numeric value such as 'li' or 'co' from termcap.
+ *
+ * Calling conventions: id = 2 character id.
+ *
+ * Returned values: -1 for failure, else numerical value.
+ */
+
+ int
+tgetnum(id)
+ char *id;
+{
+ char *ptr, buf[256];
+ ptr = buf;
+
+ if (tgetstr(id, &ptr))
+ return atoi(buf);
+ else
+ return 0;
+}
+
+/*
+ * Module: tgetstr
+ *
+ * Purpose: get terminal capability string from database.
+ *
+ * Calling conventions: id is the two character capability id.
+ * (*buf) points into a hold buffer for the
+ * id. the capability is copied into the buffer
+ * and (*buf) is advanced to point to the next
+ * free byte in the buffer.
+ *
+ * Returned values: 0 = no such entry, otherwise returns original
+ * (*buf) (now a pointer to the string).
+ *
+ * Notes
+ * It also decodes certain escape sequences in the buffer.
+ * they should be obvious from the code:
+ * \E = escape.
+ * \n, \r, \t, \f, \b match the 'c' escapes.
+ * ^x matches control-x (^@...^_).
+ * \nnn matches nnn octal.
+ * \x, where x is anything else, matches x. I differ
+ * from the standard library here, in that I allow ^: to match
+ * :.
+ *
+ */
+
+ char *
+tgetstr(id, buf)
+ char *id, **buf;
+{
+ int len = strlen(id);
+ char *tmp=tent;
+ char *hold;
+ int i;
+
+ do {
+ tmp = _find(tmp, ":"); /* For each field */
+ while (*tmp == ':') /* skip empty fields */
+ tmp++;
+ if (!*tmp)
+ break;
+
+ if (_match(id, tmp) == len) {
+ tmp += len; /* find '=' '@' or '#' */
+ if (*tmp == '@') /* :xx@: entry for tc */
+ return 0; /* deleted entry */
+ hold= *buf;
+ while (*++tmp && *tmp != ':') { /* not at end of field */
+ switch(*tmp) {
+ case '\\': /* Expand escapes here */
+ switch(*++tmp) {
+ case 0: /* ignore backslashes */
+ tmp--; /* at end of entry */
+ break; /* shouldn't happen */
+ case 'e':
+ case 'E': /* ESC */
+ *(*buf)++ = ESC;
+ break;
+ case 'n': /* \n */
+ *(*buf)++ = '\n';
+ break;
+ case 'r': /* \r */
+ *(*buf)++ = '\r';
+ break;
+ case 't': /* \t */
+ *(*buf)++ = '\t';
+ break;
+ case 'b': /* \b */
+ *(*buf)++ = '\b';
+ break;
+ case 'f': /* \f */
+ *(*buf)++ = '\f';
+ break;
+ case '0': /* \nnn */
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ **buf = 0;
+ /* get up to three digits */
+ for (i = 0; i < 3 && VIM_ISDIGIT(*tmp); ++i)
+ **buf = **buf * 8 + *tmp++ - '0';
+ (*buf)++;
+ tmp--;
+ break;
+ default: /* \x, for all other x */
+ *(*buf)++= *tmp;
+ }
+ break;
+ case '^': /* control characters */
+ ++tmp;
+ *(*buf)++ = Ctrl_chr(*tmp);
+ break;
+ default:
+ *(*buf)++ = *tmp;
+ }
+ }
+ *(*buf)++ = 0;
+ return hold;
+ }
+ } while (*tmp);
+
+ return 0;
+}
+
+/*
+ * Module: tgoto
+ *
+ * Purpose: decode cm cursor motion string.
+ *
+ * Calling conventions: cm is cursor motion string. line, col, are the
+ * desired destination.
+ *
+ * Returned values: a string pointing to the decoded string, or "OOPS" if it
+ * cannot be decoded.
+ *
+ * Notes
+ * The accepted escapes are:
+ * %d as in printf, 0 origin.
+ * %2, %3 like %02d, %03d in printf.
+ * %. like %c
+ * %+x adds <x> to value, then %.
+ * %>xy if value>x, adds y. No output.
+ * %i increments line& col, no output.
+ * %r reverses order of line&col. No output.
+ * %% prints as a single %.
+ * %n exclusive or row & col with 0140.
+ * %B BCD, no output.
+ * %D reverse coding (x-2*(x%16)), no output.
+ */
+
+ char *
+tgoto(cm, col, line)
+ char *cm; /* cm string, from termcap */
+ int col, /* column, x position */
+ line; /* line, y position */
+{
+ char gx, gy, /* x, y */
+ *ptr, /* pointer in 'cm' */
+ reverse = 0, /* reverse flag */
+ *bufp, /* pointer in returned string */
+ addup = 0, /* add upline */
+ addbak = 0, /* add backup */
+ c;
+ static char buffer[32];
+
+ if (!cm)
+ return "OOPS"; /* Kludge, but standard */
+
+ bufp = buffer;
+ ptr = cm;
+
+ while (*ptr) {
+ if ((c = *ptr++) != '%') { /* normal char */
+ *bufp++ = c;
+ } else { /* % escape */
+ switch(c = *ptr++) {
+ case 'd': /* decimal */
+ bufp = _addfmt(bufp, "%d", line);
+ line = col;
+ break;
+ case '2': /* 2 digit decimal */
+ bufp = _addfmt(bufp, "%02d", line);
+ line = col;
+ break;
+ case '3': /* 3 digit decimal */
+ bufp = _addfmt(bufp, "%03d", line);
+ line = col;
+ break;
+ case '>': /* %>xy: if >x, add y */
+ gx = *ptr++;
+ gy = *ptr++;
+ if (col>gx) col += gy;
+ if (line>gx) line += gy;
+ break;
+ case '+': /* %+c: add c */
+ line += *ptr++;
+ case '.': /* print x/y */
+ if (line == '\t' || /* these are */
+ line == '\n' || /* chars that */
+ line == '\004' || /* UNIX hates */
+ line == '\0') {
+ line++; /* so go to next pos */
+ if (reverse == (line == col))
+ addup=1; /* and mark UP */
+ else
+ addbak=1; /* or BC */
+ }
+ *bufp++=line;
+ line = col;
+ break;
+ case 'r': /* r: reverse */
+ gx = line;
+ line = col;
+ col = gx;
+ reverse = 1;
+ break;
+ case 'i': /* increment (1-origin screen) */
+ col++;
+ line++;
+ break;
+ case '%': /* %%=% literally */
+ *bufp++='%';
+ break;
+ case 'n': /* magic DM2500 code */
+ line ^= 0140;
+ col ^= 0140;
+ break;
+ case 'B': /* bcd encoding */
+ line = line/10<<4+line%10;
+ col = col/10<<4+col%10;
+ break;
+ case 'D': /* magic Delta Data code */
+ line = line-2*(line&15);
+ col = col-2*(col&15);
+ break;
+ default: /* Unknown escape */
+ return "OOPS";
+ }
+ }
+ }
+
+ if (addup) /* add upline */
+ if (UP) {
+ ptr=UP;
+ while (VIM_ISDIGIT(*ptr) || *ptr == '.')
+ ptr++;
+ if (*ptr == '*')
+ ptr++;
+ while (*ptr)
+ *bufp++ = *ptr++;
+ }
+
+ if (addbak) /* add backspace */
+ if (BC) {
+ ptr=BC;
+ while (VIM_ISDIGIT(*ptr) || *ptr == '.')
+ ptr++;
+ if (*ptr == '*')
+ ptr++;
+ while (*ptr)
+ *bufp++ = *ptr++;
+ }
+ else
+ *bufp++='\b';
+
+ *bufp = 0;
+
+ return(buffer);
+}
+
+/*
+ * Module: tputs
+ *
+ * Purpose: decode padding information
+ *
+ * Calling conventions: cp = string to be padded, affcnt = # of items affected
+ * (lines, characters, whatever), outc = routine to output 1 character.
+ *
+ * Returned values: none
+ *
+ * Notes
+ * cp has padding information ahead of it, in the form
+ * nnnTEXT or nnn*TEXT. nnn is the number of milliseconds to delay,
+ * and may be a decimal (nnn.mmm). If the asterisk is given, then
+ * the delay is multiplied by afcnt. The delay is produced by outputting
+ * a number of nulls (or other padding char) after printing the
+ * TEXT.
+ *
+ */
+
+long _bauds[16]={
+ 0, 50, 75, 110,
+ 134, 150, 200, 300,
+ 600, 1200, 1800, 2400,
+ 4800, 9600, 19200, 19200 };
+
+ int
+tputs(cp, affcnt, outc)
+ char *cp; /* string to print */
+ int affcnt; /* Number of lines affected */
+ void (*outc) __ARGS((unsigned int));/* routine to output 1 character */
+{
+ long frac, /* 10^(#digits after decimal point) */
+ counter, /* digits */
+ atol __ARGS((const char *));
+
+ if (VIM_ISDIGIT(*cp)) {
+ counter = 0;
+ frac = 1000;
+ while (VIM_ISDIGIT(*cp))
+ counter = counter * 10L + (long)(*cp++ - '0');
+ if (*cp == '.')
+ while (VIM_ISDIGIT(*++cp)) {
+ counter = counter * 10L + (long)(*cp++ - '0');
+ frac = frac * 10;
+ }
+ if (*cp!='*') { /* multiply by affected lines */
+ if (affcnt>1) affcnt = 1;
+ }
+ else
+ cp++;
+
+ /* Calculate number of characters for padding counter/frac ms delay */
+ if (ospeed)
+ counter = (counter * _bauds[ospeed] * (long)affcnt) / frac;
+
+ while (*cp) /* output string */
+ (*outc)(*cp++);
+ if (ospeed)
+ while (counter--) /* followed by pad characters */
+ (*outc)(PC);
+ }
+ else
+ while (*cp)
+ (*outc)(*cp++);
+ return 0;
+}
+
+/*
+ * Module: tutil.c
+ *
+ * Purpose: Utility routines for TERMLIB functions.
+ *
+ */
+ static int
+_match(s1, s2) /* returns length of text common to s1 and s2 */
+ char *s1, *s2;
+{
+ int i = 0;
+
+ while (s1[i] && s1[i] == s2[i])
+ i++;
+
+ return i;
+}
+
+/*
+ * finds next c in s that's a member of set, returns pointer
+ */
+ static char *
+_find(s, set)
+ char *s, *set;
+{
+ for(; *s; s++)
+ {
+ char *ptr = set;
+
+ while (*ptr && *s != *ptr)
+ ptr++;
+
+ if (*ptr)
+ return s;
+ }
+
+ return s;
+}
+
+/*
+ * add val to buf according to format fmt
+ */
+ static char *
+_addfmt(buf, fmt, val)
+ char *buf, *fmt;
+ int val;
+{
+ sprintf(buf, fmt, val);
+ while (*buf)
+ buf++;
+ return buf;
+}
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
new file mode 100644
index 000000000..0970b729f
--- /dev/null
+++ b/src/testdir/Make_amiga.mak
@@ -0,0 +1,97 @@
+#
+# Makefile to run al tests for Vim, on Amiga
+#
+# Requires "rm", "csh" and "diff"!
+
+VIMPROG = /vim
+
+# These tests don't work (yet):
+# test2 "\\tmp" doesn't work
+# test10 'errorformat' is different
+# test11 "cat" doesn't work properly
+# test12 can't unlink a swap file
+# test25 uses symbolic link
+# test27 can't edit file with "*"
+# test52 only for Win32
+
+SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out \
+ test13.out test14.out test15.out test17.out \
+ test18.out test19.out test20.out test21.out test22.out \
+ test23.out test24.out test26.out \
+ test28.out test29.out test30.out test31.out test32.out \
+ test33.out test34.out test35.out test36.out test37.out \
+ test38.out test39.out test40.out test41.out test42.out \
+ test43.out test44.out test45.out test46.out test47.out \
+ test48.out test51.out
+
+.SUFFIXES: .in .out
+
+nongui: /tmp $(SCRIPTS)
+ csh -c echo ALL DONE
+
+clean:
+ csh -c \rm -rf *.out /tmp/* Xdotest small.vim tiny.vim mbyte.vim test.ok viminfo
+
+.in.out:
+ copy $*.ok test.ok
+ $(VIMPROG) -u amiga.vim -U NONE --noplugin -s dotest.in $*.in
+ diff test.out $*.ok
+ rename test.out $*.out
+ -delete X#? ALL QUIET
+ -delete test.ok
+
+# Create a directory for temp files
+/tmp:
+ makedir /tmp
+
+# Manx requires all dependencies...
+test1.out: test1.in
+test2.out: test2.in
+test3.out: test3.in
+test4.out: test4.in
+test5.out: test5.in
+test6.out: test6.in
+test7.out: test7.in
+test8.out: test8.in
+test9.out: test9.in
+test10.out: test10.in
+test11.out: test11.in
+test12.out: test12.in
+test13.out: test13.in
+test14.out: test14.in
+test15.out: test15.in
+test16.out: test16.in
+test17.out: test17.in
+test18.out: test18.in
+test19.out: test19.in
+test20.out: test20.in
+test21.out: test21.in
+test22.out: test22.in
+test23.out: test23.in
+test24.out: test24.in
+test25.out: test25.in
+test26.out: test26.in
+test27.out: test27.in
+test28.out: test28.in
+test29.out: test29.in
+test30.out: test30.in
+test31.out: test31.in
+test32.out: test32.in
+test33.out: test33.in
+test34.out: test34.in
+test35.out: test35.in
+test36.out: test36.in
+test37.out: test37.in
+test38.out: test38.in
+test39.out: test39.in
+test40.out: test40.in
+test41.out: test41.in
+test42.out: test42.in
+test43.out: test43.in
+test44.out: test44.in
+test45.out: test45.in
+test46.out: test46.in
+test47.out: test47.in
+test48.out: test48.in
+test51.out: test51.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
new file mode 100644
index 000000000..b15951e6d
--- /dev/null
+++ b/src/testdir/Make_dos.mak
@@ -0,0 +1,64 @@
+#
+# Makefile to run al tests for Vim, on Dos-like machines.
+#
+# Requires a set of Unix tools: echo, diff, etc.
+
+VIMPROG = ..\\vim
+
+# Omitted:
+# test2 "\\tmp" doesn't work.
+# test10 'errorformat' is different
+# test12 can't unlink a swap file
+# test25 uses symbolic link
+# test27 can't edit file with "*" in file name
+# test31 16 bit version runs out of memory...
+
+SCRIPTS16 = test1.out test19.out test20.out test22.out \
+ test23.out test24.out test28.out test29.out \
+ test35.out test36.out test43.out \
+ test44.out test45.out test46.out test47.out \
+ test48.out test51.out
+
+SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
+ test8.out test9.out test11.out test13.out test14.out \
+ test15.out test17.out test18.out test21.out test26.out \
+ test30.out test31.out test32.out test33.out test34.out \
+ test37.out test38.out test39.out test40.out test41.out \
+ test42.out test52.out
+
+SCRIPTS32 = test50.out
+
+SCRIPTS_GUI = test16.out
+
+.SUFFIXES: .in .out
+
+nongui: $(SCRIPTS16) $(SCRIPTS)
+ echo ALL DONE
+
+small: $(SCRIPTS16)
+ echo ALL DONE
+
+gui: $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI)
+ echo ALL DONE
+
+win32: $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32)
+ echo ALL DONE
+
+clean:
+ -del *.out
+ -del test.ok
+ -del small.vim
+ -del tiny.vim
+ -del mbyte.vim
+ -del X*
+ -del viminfo
+
+.in.out:
+ copy $*.ok test.ok
+ $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
+ diff test.out $*.ok
+ -del $*.out
+ rename test.out $*.out
+ -del X*
+ -del test.ok
+ -del viminfo
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
new file mode 100644
index 000000000..af582023a
--- /dev/null
+++ b/src/testdir/Make_os2.mak
@@ -0,0 +1,52 @@
+#
+# Makefile to run al tests for Vim, on OS/2
+#
+# Requires a set of Unix tools: echo, diff, etc.
+
+VIMPROG = ../vim.exe
+
+# Omitted:
+# test2 "\\tmp" doesn't work.
+# test10 'errorformat' is different
+# test11 requires sed
+# test12 can't unlink a swap file
+# test25 uses symbolic link
+# test27 can't edit file with "*" in file name
+# test52 only for Win32
+
+SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out \
+ test13.out test14.out test15.out test17.out \
+ test18.out test19.out test20.out test21.out test22.out \
+ test23.out test24.out test26.out \
+ test28.out test29.out test30.out test31.out test32.out \
+ test33.out test34.out test35.out test36.out test37.out \
+ test38.out test39.out test40.out test41.out test42.out \
+ test43.out test44.out test45.out test46.out test47.out \
+ test48.out test51.out
+
+.SUFFIXES: .in .out
+
+all: /tmp $(SCRIPTS)
+ @echo ALL DONE
+
+$(SCRIPTS): $(VIMPROG)
+
+clean:
+ -rm -rf *.out Xdotest test.ok tiny.vim small.vim mbyte.vim viminfo
+
+# Make sure all .in and .out files are in DOS fileformat.
+.in.out:
+ $(VIMPROG) -u NONE -s todos.vim $*.in
+ $(VIMPROG) -u NONE -s todos.vim $*.ok
+ copy $*.ok test.ok
+ $(VIMPROG) -u os2.vim --noplugin -s dotest.in $*.in
+ $(VIMPROG) -u NONE -s todos.vim test.out
+ diff test.out $*.ok
+ rename test.out $*.out
+ -rm -rf X* viminfo
+ -del test.ok
+
+# Create a directory for temp files
+/tmp:
+ -mkdir /tmp
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
new file mode 100644
index 000000000..23b0b26fc
--- /dev/null
+++ b/src/testdir/Make_vms.mms
@@ -0,0 +1,124 @@
+#
+# Makefile to run all tests for Vim on VMS
+#
+# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
+# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
+#
+# Last change: 2004 May 03
+#
+# This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX.
+# Edit the lines in the Configuration section below to select.
+#
+# Execute with:
+# mms/descrip=Make_vms.mms
+# Cleanup with:
+# mms/descrip=Make_vms.mms clean
+#
+# Make files are MMK compatible.
+#
+# NOTE: You can run this script just in X/Window environment. It will
+# create a new terminals, therefore you have to set up your DISPLAY
+# logical. More info in VMS documentation or with: help set disp.
+#
+#######################################################################
+# Configuration section.
+#######################################################################
+
+# Uncomment if you want tests in GUI mode. Terminal mode is default.
+# WANT_GUI = YES
+
+# Comment out if you want to run Unix specific tests as well, but please
+# be aware, that on OpenVMS will fail, because of cat, rm, etc commands
+# and directory handling.
+# WANT_UNIX = YES
+
+# Comment out if you have gzip on your system
+# HAVE_GZIP = YES
+
+# Comment out if you have GNU compatible diff on your system
+# HAVE_GDIFF = YES
+
+#######################################################################
+# End of configuration section.
+#
+# Please, do not change anything below without programming experience.
+#######################################################################
+
+VIMPROG = <->vim.exe
+
+.SUFFIXES : .out .in
+
+SCRIPT = test1.out test2.out test3.out test4.out test5.out \
+ test6.out test7.out test8.out test9.out test10a.out\
+ test13.out test14.out test15.out test17.out \
+ test18.out test19.out test20.out test21.out test22.out \
+ test23.out test24.out test26.out \
+ test28.out test29.out test31.out test32.out \
+ test33.out test34.out test35.out test36.out test37.out \
+ test38.out test39.out test40.out test41.out test42.out \
+ test43.out test44.out test45.out test46.out \
+ test48.out test51.out
+
+.IFDEF WANT_GUI
+SCRIPT_GUI = test16.out
+GUI_OPTION = -g
+.ENDIF
+
+.IFDEF WANT_UNIX
+SCRIPT_UNIX = test10.out test12.out test25.out test27.out test30.out test49.out
+.ENDIF
+
+.IFDEF HAVE_GZIP
+SCRIPT_GZIP = test11.out
+.ENDIF
+
+.IFDEF HAVE_GDIFF
+SCRIPT_GDIFF = test47.out
+.ENDIF
+
+.in.out :
+ -@ write sys$output " "
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output " "$*" "
+ -@ write sys$output "-----------------------------------------------"
+ -@ create/term/wait mcr $(VIMPROG) $(GUI_OPTION) -u vms.vim --noplugin -s dotest.in $*.in
+ -@ if "''F$SEARCH("test.out.*")'" .NES. "" then differences test.out $*.ok;
+ -@ if "''F$SEARCH("test.out.*")'" .NES. "" then rename test.out $*.out
+ -@ if "''F$SEARCH("Xdotest.*")'" .NES. "" then delete/noconfirm/nolog Xdotest.*.*
+
+all : clean nolog $(SCRIPT) $(SCRIPT_GUI) $(SCRIPT_UNIX) $(SCRIPT_GZIP) $(SCRIPT_GDIFF)
+ -@ write sys$output " "
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output " All done"
+ -@ write sys$output "-----------------------------------------------"
+ -@ deassign sys$output
+ -@ delete/noconfirm/nolog x*.*.*
+ -@ type test.log
+
+nolog :
+ -@ define sys$output test.log
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output " Standard VIM test cases"
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output " OpenVMS version: ''F$GETSYI("VERSION")'"
+ -@ write sys$output " Vim version:"
+ -@ mcr $(VIMPROG) --version
+ -@ write sys$output " Test date:"
+ -@ show time
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output " Test results:"
+ -@ write sys$output "-----------------------------------------------"
+ -@ write sys$output "MAKE_VMS.MMS options:"
+ -@ write sys$output " WANT_GUI = ""$(WANT_GUI)"" "
+ -@ write sys$output " WANT_UNIX = ""$(WANT_UNIX)"" "
+ -@ write sys$output " HAVE_GZIP = ""$(HAVE_GZIP)"" "
+ -@ write sys$output " HAVE_GDIFF= ""$(HAVE_GDIFF)"" "
+ -@ write sys$output "Default vimrc file is VMS.VIM:
+ -@ write sys$output "-----------------------------------------------"
+ -@ type VMS.VIM
+
+clean :
+ -@ if "''F$SEARCH("*.out")'" .NES. "" then delete/noconfirm/nolog *.out.*
+ -@ if "''F$SEARCH("test.log")'" .NES. "" then delete/noconfirm/nolog test.log.*
+ -@ if "''F$SEARCH("Xdotest.*")'" .NES. "" then delete/noconfirm/nolog Xdotest.*.*
+ -@ if "''F$SEARCH("*.*_sw*")'" .NES. "" then delete/noconfirm/nolog *.*_sw*.*
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
new file mode 100644
index 000000000..7ed97fe21
--- /dev/null
+++ b/src/testdir/Makefile
@@ -0,0 +1,58 @@
+#
+# Makefile to run al tests for Vim
+#
+
+VIMPROG = ../vim
+
+SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out test10.out test11.out \
+ test12.out test13.out test14.out test15.out test17.out \
+ test18.out test19.out test20.out test21.out test22.out \
+ test23.out test24.out test25.out test26.out test27.out \
+ test28.out test29.out test30.out test31.out test32.out \
+ test33.out test34.out test35.out test36.out test37.out \
+ test38.out test39.out test40.out test41.out test42.out \
+ test43.out test44.out test45.out test46.out test47.out \
+ test48.out test49.out test51.out test52.out
+
+SCRIPTS_GUI = test16.out
+
+.SUFFIXES: .in .out
+
+nongui: nolog $(SCRIPTS)
+ @echo
+ @cat test.log
+ @echo ALL DONE
+
+gui: nolog $(SCRIPTS) $(SCRIPTS_GUI)
+ @echo
+ @cat test.log
+ @echo ALL DONE
+
+$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
+
+clean:
+ -rm -rf *.out *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* viminfo
+
+test1.out: test1.in
+ -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
+ $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
+ @/bin/sh -c "if diff test.out $*.ok; \
+ then mv -f test.out $*.out; \
+ else echo; \
+ echo test1 FAILED - Something basic is wrong; \
+ echo; exit 1; fi"
+ -rm -rf X* viminfo
+
+.in.out:
+ -rm -f $*.failed test.ok X*
+ cp $*.ok test.ok
+ $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
+ @/bin/sh -c "if diff test.out $*.ok; \
+ then mv -f test.out $*.out; \
+ else echo $* FAILED >>test.log; mv -f test.out $*.failed; \
+ fi"
+ -rm -rf X* test.ok viminfo
+
+nolog:
+ -echo Test results: >test.log
diff --git a/src/testdir/amiga.vim b/src/testdir/amiga.vim
new file mode 100644
index 000000000..e0ca47a8e
--- /dev/null
+++ b/src/testdir/amiga.vim
@@ -0,0 +1,4 @@
+" Settings for test script execution
+set shell=csh
+map! /tmp t:
+cmap !rm !Delete all
diff --git a/src/testdir/dos.vim b/src/testdir/dos.vim
new file mode 100644
index 000000000..27764db9d
--- /dev/null
+++ b/src/testdir/dos.vim
@@ -0,0 +1,7 @@
+" Settings for test script execution
+" Always use "COMMAND.COM", don't use the value of "$SHELL".
+set shell=c:\COMMAND.COM shellquote= shellxquote= shellcmdflag=/c shellredir=>
+" This is used only when the +eval feature is available.
+if executable("cmd.exe")
+ set shell=cmd.exe
+endif
diff --git a/src/testdir/dotest.in b/src/testdir/dotest.in
new file mode 100644
index 000000000..b2a0e1a68
--- /dev/null
+++ b/src/testdir/dotest.in
@@ -0,0 +1,3 @@
+:set cp
+:map dotest /^STARTTEST j:set ff=unix cpo-=A :.,/ENDTEST/-1w! Xdotest :set ff& cpo+=A nj0:so! Xdotest dotest
+dotest
diff --git a/src/testdir/main.aap b/src/testdir/main.aap
new file mode 100644
index 000000000..0293b92f8
--- /dev/null
+++ b/src/testdir/main.aap
@@ -0,0 +1,58 @@
+#
+# Makefile to run al tests for Vim
+#
+
+VimProg ?= ../vim
+
+Scripts = test1.out test2.out test3.out test4.out test5.out test6.out
+ test7.out test8.out test9.out test10.out test11.out
+ test12.out test13.out test14.out test15.out test17.out
+ test18.out test19.out test20.out test21.out test22.out
+ test23.out test24.out test25.out test26.out test27.out
+ test28.out test29.out test30.out test31.out test32.out
+ test33.out test34.out test35.out test36.out test37.out
+ test38.out test39.out test40.out test41.out test42.out
+ test43.out test44.out test45.out test46.out test47.out
+ test48.out test49.out
+
+ScriptsGUI = test16.out
+
+# Build "nongui" when no target was specified.
+nongui: newlog $Scripts
+ :print
+ :cat test.log
+ :print ALL DONE
+
+# Build "ngui" when specified.
+gui: newlog $Scripts $ScriptsGUI
+ :print
+ :cat test.log
+ :print ALL DONE
+
+$Scripts $ScriptsGUI: $VimProg
+
+clean:
+ :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X*
+
+# test1 is special, it checks for features
+test1.out: test1.in
+ :del {force} test1.failed tiny.vim small.vim mbyte.vim
+ :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
+ @if os.system("diff test.out test1.ok") != 0:
+ :error test1 FAILED - Something basic is wrong
+ :move {force} test.out test1.out
+ :del {r}{force} X*
+
+:rule %.out : %.in
+ :del {force} $(match).failed test.ok
+ :copy $(match).ok test.ok
+ :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in $(match).in
+ @if os.system("diff test.out " + match + ".ok") != 0:
+ :print $match FAILED >>test.log
+ :move {force} test.out $(match).failed
+ @else:
+ :move {force} test.out $(match).out
+ :del {r}{force} X* test.ok
+
+newlog:
+ :print Test results: >! test.log
diff --git a/src/testdir/os2.vim b/src/testdir/os2.vim
new file mode 100644
index 000000000..c97ba5d00
--- /dev/null
+++ b/src/testdir/os2.vim
@@ -0,0 +1,3 @@
+" Settings for test script execution
+" Always use "CMD.EXE", don't use the value of "$SHELL".
+set shell=CMD.EXE shellquote= shellxquote= shellcmdflag=/c shellredir=>
diff --git a/src/testdir/test1.in b/src/testdir/test1.in
new file mode 100644
index 000000000..6d1bddee9
--- /dev/null
+++ b/src/testdir/test1.in
@@ -0,0 +1,40 @@
+
+First a simple test to check if the test script works.
+
+If Vim was not compiled with the +eval feature, the small.vim script will be
+set to copy the test.ok file to test.out, so that it looks like the test
+succeeded. Otherwise an empty small.vim is written. small.vim is sourced by
+tests that require the +eval feature or other features that are missing in the
+small version.
+
+If Vim was not compiled with the +windows feature, the tiny.vim script will be
+set like small.vim above. tiny.vim is sourced by tests that require the
++windows feature or other features that are missing in the tiny version.
+
+If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will be set like small.vim above. mbyte.vim is sourced by tests that require the
++multi_byte feature.
+
+STARTTEST
+:" Write a single line to test.out to check if testing works at all.
+:%d
+athis is a test:w! test.out
+:" Create small.vim and tiny.vim empty, create mbyte.vim to skip the test.
+0D:w! small.vim
+:w! tiny.vim
+ae! test.ok
+w! test.out
+qa!
+:w! mbyte.vim
+:" If +multi_byte feature supported, make mbyte.vim empty.
+:if has("multi_byte") | sp another | w! mbyte.vim | q | endif
+:" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
+:" Otherwise write small.vim to skip the test.
+:if 1 | q! | endif
+:w! small.vim
+:" If +windows feature not supported :sp will fail and tiny.vim will be
+:" written to skip the test.
+:sp another
+:wq! tiny.vim
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test1.ok b/src/testdir/test1.ok
new file mode 100644
index 000000000..90bfcb510
--- /dev/null
+++ b/src/testdir/test1.ok
@@ -0,0 +1 @@
+this is a test
diff --git a/src/testdir/test10.in b/src/testdir/test10.in
new file mode 100644
index 000000000..f15c4f5d2
--- /dev/null
+++ b/src/testdir/test10.in
@@ -0,0 +1,57 @@
+Test for 'errorformat'.
+
+STARTTEST
+:so small.vim
+:/start of errorfile/,/end of errorfile/w! Xerrorfile
+:/start of testfile/,/end of testfile/w! Xtestfile
+:cf Xerrorfile
+rA
+:cn
+rB
+:cn
+rC
+:cn
+rD
+:cn
+rE
+:w! test.out " Write contents of this file
+:qa!
+ENDTEST
+
+start of errorfile
+"Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
+"Xtestfile", line 7 col 19; this is an error
+gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
+Xtestfile:13: parse error before `asd'
+make: *** [vim] Error 1
+in file "Xtestfile" linenr 16: there is an error
+
+2 returned
+"Xtestfile", linenr 19: yet another problem
+
+Does anyone know what is the problem and how to correction it?
+end of errorfile
+
+start of testfile
+line 2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+end of testfile
diff --git a/src/testdir/test10.ok b/src/testdir/test10.ok
new file mode 100644
index 000000000..2c86889c1
--- /dev/null
+++ b/src/testdir/test10.ok
@@ -0,0 +1,23 @@
+start of testfile
+line 2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 xxxAxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 7 xxxxxxxxxxBxxxxxxxxxxxxxxxxxxx
+line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Cine 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Dine 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+end of testfile
diff --git a/src/testdir/test10a.in b/src/testdir/test10a.in
new file mode 100644
index 000000000..19e8652fe
--- /dev/null
+++ b/src/testdir/test10a.in
@@ -0,0 +1,73 @@
+Test for 'errorformat'.
+
+STARTTEST
+:so small.vim
+:/start of errorfile/,/end of errorfile/w! Xerrorfile
+:/start of testfile/,/end of testfile/w! Xtestfile
+:cf Xerrorfile
+rA
+:cn
+rB
+:cn
+rC
+:cn
+rD
+:cn
+rE
+:w! test.out " Write contents of this file
+:qa!
+ENDTEST
+
+start of errorfile
+
+ printf(" %d \n", (number/other)%10 );
+..................^
+%CC-E-NOSEMI, Missing ";".
+at line number 4 in file SYS$DISK:XTESTFILE
+
+ other=10000000;
+.............^
+%CC-E-UNDECLARED, In this statement, "oszt" is not declared.
+at line number 7 in file SYS$DISK:XTESTFILE
+
+ for (i = 0; i<7 ; i++ ){
+..................^
+%CC-E-UNDECLARED, In this statement, "i" is not declared.
+at line number 16 in file SYS$DISK:XTESTFILE
+
+some other error somewhere here.
+...........................^
+%CC-W-WARRING, Sorry, but no expalnation for such an warring.
+at line number 19 in file SYS$DISK:XTESTFILE
+
+and finally some other error exactly here.
+.....................................^
+%CC-I-INFORMATIONAL, It should be some informational message.
+at line number 20 in file SYS$DISK:XTESTFILE
+
+Does anyone know what is the problem and how to correct ?? :)
+end of errorfile
+
+start of testfile
+01234567890123456789012345678901234567
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+end of testfile
diff --git a/src/testdir/test10a.ok b/src/testdir/test10a.ok
new file mode 100644
index 000000000..10e78c923
--- /dev/null
+++ b/src/testdir/test10a.ok
@@ -0,0 +1,23 @@
+start of testfile
+01234567890123456789012345678901234567
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 xxxxxxxxxxAxxxxxxxxxxxxxxxxxxx
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 7 xxxxxBxxxxxxxxxxxxxxxxxxxxxxxx
+line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 16 xxxxxxxxxxCxxxxxxxxxxxxxxxxxxx
+line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 19 xxxxxxxxxxxxxxxxxxxDxxxxxxxxxx
+line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxE
+line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+end of testfile
diff --git a/src/testdir/test11.in b/src/testdir/test11.in
new file mode 100644
index 000000000..6b296fd4e
--- /dev/null
+++ b/src/testdir/test11.in
@@ -0,0 +1,77 @@
+Tests for autocommands:
+- FileWritePre writing a compressed file
+- FileReadPost reading a compressed file
+- BufNewFile reading a file template
+- BufReadPre decompressing the file to be read
+- FilterReadPre substituting characters in the temp file
+- FilterReadPost substituting characters after filtering
+- FileReadPre set options for decompression
+- FileReadPost decompress the file
+
+Note: This test will fail if "gzip" is not available.
+$GZIP is made empty, "-v" would cause trouble.
+Use a FileChangedShell autocommand to avoid a prompt for "Xtestfile.gz" being
+modified outside of Vim (noticed on Solaris).
+
+STARTTEST
+:so small.vim
+:let $GZIP = ""
+:au FileChangedShell * echo "caught FileChangedShell"
+:set bin
+:au FileWritePre *.gz '[,']!gzip
+:au FileWritePost *.gz undo
+:/start of testfile/,/end of testfile/w! Xtestfile.gz
+:au FileReadPost *.gz '[,']!gzip -d
+:$r Xtestfile.gz " Read and decompress the testfile
+:?startstart?,$w! test.out " Write contents of this file
+:au BufNewFile *.c read Xtest.c
+gg/^end of testfile
+:/start of test.c/+1,/end of test.c/-1w! Xtest.c
+:e! foo.c " Will load Xtest.c
+:au FileAppendPre *.out '[,']s/new/NEW/
+:au FileAppendPost *.out !cat Xtest.c >>test.out
+:w>>test.out " Append it to the output file
+:au! FileAppendPre
+:" setup autocommands to decompress before reading and re-compress afterwards
+:au BufReadPre *.gz !gzip -d <afile>
+:au BufReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
+:au BufReadPost *.gz call rename(expand("<afile>"), expand("<afile>:r"))
+:au BufReadPost *.gz !gzip <afile>:r
+:e! Xtestfile.gz " Edit compressed file
+:w>>test.out " Append it to the output file
+:au FilterReadPre *.out call rename(expand("<afile>"), expand("<afile>").".t")
+:au FilterReadPre *.out !sed s/e/E/ <afile>.t ><afile>
+:au FilterReadPre *.out !rm <afile>.t
+:au FilterReadPost *.out '[,']s/x/X/g
+:e! test.out " Edit the output file
+:23,$!cat
+:au! FileReadPre *.gz !gzip -d <afile>
+:au FileReadPre *.gz call rename(expand("<afile>:r"), expand("<afile>"))
+:au! FileReadPost *.gz '[,']s/l/L/
+:$r Xtestfile.gz " Read compressed file
+:w " write it, after filtering
+:au! " remove all autocommands
+:e " Edit test.out again
+:set nobin ff& " use the default fileformat for writing
+:w
+:qa!
+ENDTEST
+
+startstart
+start of testfile
+line 2 Abcdefghijklmnopqrstuvwxyz
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 Abcdefghijklmnopqrstuvwxyz
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 Abcdefghijklmnopqrstuvwxyz
+line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 8 Abcdefghijklmnopqrstuvwxyz
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 Abcdefghijklmnopqrstuvwxyz
+end of testfile
+
+start of test.c
+/*
+ * Here is a new .c file
+ */
+end of test.c
diff --git a/src/testdir/test11.ok b/src/testdir/test11.ok
new file mode 100644
index 000000000..af8c5ce26
--- /dev/null
+++ b/src/testdir/test11.ok
@@ -0,0 +1,61 @@
+startstart
+start of testfile
+line 2 Abcdefghijklmnopqrstuvwxyz
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 Abcdefghijklmnopqrstuvwxyz
+line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 6 Abcdefghijklmnopqrstuvwxyz
+line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 8 Abcdefghijklmnopqrstuvwxyz
+line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 10 Abcdefghijklmnopqrstuvwxyz
+end of testfile
+
+start of test.c
+/*
+ * Here is a new .c file
+ */
+end of test.c
+start of testfile
+line 2 Abcdefghijklmnopqrstuvwxyz
+line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+line 4 Abcdefghijklmnopqrstuvwxyz
+linE 5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 6 AbcdefghijklmnopqrstuvwXyz
+linE 7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 8 AbcdefghijklmnopqrstuvwXyz
+linE 9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 10 AbcdefghijklmnopqrstuvwXyz
+End of testfile
+
+/*
+ * HEre is a NEW .c file
+ */
+/*
+ * HEre is a new .c file
+ */
+start of tEstfile
+linE 2 AbcdefghijklmnopqrstuvwXyz
+linE 3 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 4 AbcdefghijklmnopqrstuvwXyz
+linE 5 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 6 AbcdefghijklmnopqrstuvwXyz
+linE 7 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 8 AbcdefghijklmnopqrstuvwXyz
+linE 9 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+linE 10 AbcdefghijklmnopqrstuvwXyz
+End of testfile
+/*
+ * HEre is a new .c file
+ */
+start of testfiLe
+Line 2 Abcdefghijklmnopqrstuvwxyz
+Line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Line 4 Abcdefghijklmnopqrstuvwxyz
+Line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Line 6 Abcdefghijklmnopqrstuvwxyz
+Line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Line 8 Abcdefghijklmnopqrstuvwxyz
+Line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+Line 10 Abcdefghijklmnopqrstuvwxyz
+end of testfiLe
diff --git a/src/testdir/test12.in b/src/testdir/test12.in
new file mode 100644
index 000000000..46e9c45b8
--- /dev/null
+++ b/src/testdir/test12.in
@@ -0,0 +1,52 @@
+Tests for 'directory' option.
+- ".", in same dir as file
+- "./dir", in directory relative to file
+- "dir", in directory relative to current dir
+
+STARTTEST
+:so small.vim
+:set nocompatible viminfo+=nviminfo
+:set dir=.,~
+:/start of testfile/,/end of testfile/w! Xtest1
+:" do an ls of the current dir to find the swap file (should not be there)
+:if has("unix")
+: !ls .X*.swp >test.out
+:else
+: r !ls X*.swp >test.out
+:endif
+:!echo first line >>test.out
+:e Xtest1
+:if has("unix")
+:" Do an ls of the current dir to find the swap file, remove the leading dot
+:" to make the result the same for all systems.
+: r!ls .X*.swp
+: s/\.*X/X/
+: .w >>test.out
+: undo
+:else
+: !ls X*.swp >>test.out
+:endif
+:!echo under Xtest1.swp >>test.out
+:!mkdir Xtest2
+:set dir=./Xtest2,.,~
+:e Xtest1
+:!ls X*.swp >>test.out
+:!echo under under >>test.out
+:!ls Xtest2 >>test.out
+:!echo under Xtest1.swp >>test.out
+:!mkdir Xtest.je
+:/start of testfile/,/end of testfile/w! Xtest2/Xtest3
+:set dir=Xtest.je,~
+:e Xtest2/Xtest3
+:swap
+:!ls Xtest2 >>test.out
+:!echo under Xtest3 >>test.out
+:!ls Xtest.je >>test.out
+:!echo under Xtest3.swp >>test.out
+:qa!
+ENDTEST
+
+start of testfile
+line 2 Abcdefghij
+line 3 Abcdefghij
+end of testfile
diff --git a/src/testdir/test12.ok b/src/testdir/test12.ok
new file mode 100644
index 000000000..605623b11
--- /dev/null
+++ b/src/testdir/test12.ok
@@ -0,0 +1,10 @@
+first line
+Xtest1.swp
+under Xtest1.swp
+under under
+Xtest1.swp
+under Xtest1.swp
+Xtest3
+under Xtest3
+Xtest3.swp
+under Xtest3.swp
diff --git a/src/testdir/test13.in b/src/testdir/test13.in
new file mode 100644
index 000000000..cb8a6fff8
--- /dev/null
+++ b/src/testdir/test13.in
@@ -0,0 +1,58 @@
+Tests for autocommands on :close command
+
+Write three files and open them, each in a window.
+Then go to next window, with autocommand that deletes the previous one.
+Do this twice, writing the file.
+
+Also test deleting the buffer on a Unload event. If this goes wrong there
+will be the ATTENTION prompt.
+
+Also test changing buffers in a BufDel autocommand. If this goes wrong there
+are ml_line errors and/or a Crash.
+
+STARTTEST
+:so small.vim
+:/^start of testfile/,/^end of testfile/w! Xtestje1
+:/^start of testfile/,/^end of testfile/w! Xtestje2
+:/^start of testfile/,/^end of testfile/w! Xtestje3
+:e Xtestje1
+otestje1
+:w
+:sp Xtestje2
+otestje2
+:w
+:sp Xtestje3
+otestje3
+:w
+
+:au WinLeave Xtestje2 bwipe
+
+:w! test.out
+:au WinLeave Xtestje1 bwipe Xtestje3
+:close
+:w >>test.out
+:e Xtestje1
+:bwipe Xtestje2 Xtestje3 test.out
+:au!
+:au! BufUnload Xtestje1 bwipe
+:e Xtestje3
+:w >>test.out
+:e Xtestje2
+:sp Xtestje1
+:e
+:w >>test.out
+:au!
+:only
+:e Xtestje1
+:bwipe Xtestje2 Xtestje3 test.out test13.in
+:au BufWipeout Xtestje1 buf Xtestje1
+:bwipe
+:w >>test.out
+:qa!
+ENDTEST
+
+start of testfile
+ contents
+ contents
+ contents
+end of testfile
diff --git a/src/testdir/test13.ok b/src/testdir/test13.ok
new file mode 100644
index 000000000..0f1fc347a
--- /dev/null
+++ b/src/testdir/test13.ok
@@ -0,0 +1,30 @@
+start of testfile
+testje1
+ contents
+ contents
+ contents
+end of testfile
+start of testfile
+testje1
+ contents
+ contents
+ contents
+end of testfile
+start of testfile
+testje3
+ contents
+ contents
+ contents
+end of testfile
+start of testfile
+testje2
+ contents
+ contents
+ contents
+end of testfile
+start of testfile
+testje1
+ contents
+ contents
+ contents
+end of testfile
diff --git a/src/testdir/test14.in b/src/testdir/test14.in
new file mode 100644
index 000000000..57fb9573f
--- /dev/null
+++ b/src/testdir/test14.in
@@ -0,0 +1,65 @@
+Tests for "vaBiB", end could be wrong.
+Also test ":s/pat/sub/" with different ~s in sub.
+Also test for ^Vxff and ^Vo123 in Insert mode.
+Also test "[m", "]m", "[M" and "]M"
+
+STARTTEST
+:so small.vim
+/Start cursor here
+vaBiBD:?Bug?,/Piece/-2w! test.out
+/^- Bug
+:s/u/~u~/
+:s/i/~u~/
+:s/o/~~~/
+:.w >>test.out
+:if has("ebcdic")
+: let tt = "o\<C-V>193\<C-V>xc2\<C-V>o303 \<C-V>90a\<C-V>xfg\<C-V>o578\<Esc>"
+:else
+: let tt = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
+:endif
+:exe "normal " . tt
+:.w >>test.out
+:set vb
+/^Piece
+2]maA:.w >>test.out
+j]maB:.w >>test.out
+]maC:.w >>test.out
+[maD:.w >>test.out
+k2[maE:.w >>test.out
+3[maF:.w >>test.out
+]MaG:.w >>test.out
+j2]MaH:.w >>test.out
+]M]MaI:.w >>test.out
+2[MaJ:.w >>test.out
+k[MaK:.w >>test.out
+3[MaL:.w >>test.out
+:qa!
+ENDTEST
+
+- Bug in "vPPPP" on this text (Webb):
+ {
+ cmd;
+ {
+ cmd; /* <-- Start cursor here */
+ {
+ }
+ }
+ }
+
+Piece of Java
+{
+ tt m1 {
+ t1;
+ } e1
+
+ tt m2 {
+ t2;
+ } e2
+
+ tt m3 {
+ if (x)
+ {
+ t3;
+ }
+ } e3
+}
diff --git a/src/testdir/test14.ok b/src/testdir/test14.ok
new file mode 100644
index 000000000..e893ba803
--- /dev/null
+++ b/src/testdir/test14.ok
@@ -0,0 +1,17 @@
+- Bug in "vPPPP" on this text (Webb):
+ {
+ }
+- Bug uuun "vPPPP" uuuuuuuuun this text (Webb):
+ABC !ag8
+ tt m1 {A
+ tt m2 {B
+ tt m3 {C
+ tt m3 {DC
+ tt m1 {EA
+{F
+ }G e1
+ }H e3
+}I
+ }JH e3
+ }K e2
+{LF
diff --git a/src/testdir/test15.in b/src/testdir/test15.in
new file mode 100644
index 000000000..366529a55
--- /dev/null
+++ b/src/testdir/test15.in
@@ -0,0 +1,136 @@
+Tests for :right on text with embedded TAB.
+Also test formatting a paragraph.
+Also test undo after ":%s" and formatting.
+
+STARTTEST
+:so small.vim
+:set tw=65
+
+:/^\s*test for :left/,/^\s*test for :center/ left
+:/^\s*test for :center/,/^\s*test for :right/ center
+:/^\s*test for :right/,/^xxx/-1 right
+:set fo+=tcroql tw=72
+/xxxxxxxx$
+0gq6kk
+:set nocp viminfo+=nviminfo
+:" undo/redo here to make the next undo only work on the following changes
+u
+:map gg :.,.+2s/^/x/<CR>kk:set tw=3<CR>gqq
+/^aa
+ggu
+:?test for :left?,$w! test.out
+:qa!
+ENDTEST
+
+ test for :left
+ a a
+ fa a
+ dfa a
+ sdfa a
+ asdfa a
+ xasdfa a
+asxxdfa a
+
+ test for :center
+ a a
+ fa afd asdf
+ dfa a
+ sdfa afd asdf
+ asdfa a
+ xasdfa asdfasdfasdfasdfasdf
+asxxdfa a
+
+ test for :right
+ a a
+ fa a
+ dfa a
+ sdfa a
+ asdfa a
+ xasdfa a
+ asxxdfa a
+ asxa;ofa a
+ asdfaqwer a
+ a ax
+ fa ax
+ dfa ax
+ sdfa ax
+ asdfa ax
+ xasdfa ax
+ asxxdfa ax
+ asxa;ofa ax
+ asdfaqwer ax
+ a axx
+ fa axx
+ dfa axx
+ sdfa axx
+ asdfa axx
+ xasdfa axx
+ asxxdfa axx
+ asxa;ofa axx
+ asdfaqwer axx
+ a axxx
+ fa axxx
+ dfa axxx
+ sdfa axxx
+ asdfa axxx
+ xasdfa axxx
+ asxxdfa axxx
+ asxa;ofa axxx
+ asdfaqwer axxx
+ a axxxo
+ fa axxxo
+ dfa axxxo
+ sdfa axxxo
+ asdfa axxxo
+ xasdfa axxxo
+ asxxdfa axxxo
+ asxa;ofa axxxo
+ asdfaqwer axxxo
+ a axxxoi
+ fa axxxoi
+ dfa axxxoi
+ sdfa axxxoi
+ asdfa axxxoi
+ xasdfa axxxoi
+ asxxdfa axxxoi
+ asxa;ofa axxxoi
+ asdfaqwer axxxoi
+ a axxxoik
+ fa axxxoik
+ dfa axxxoik
+ sdfa axxxoik
+ asdfa axxxoik
+ xasdfa axxxoik
+ asxxdfa axxxoik
+ asxa;ofa axxxoik
+ asdfaqwer axxxoik
+ a axxxoike
+ fa axxxoike
+ dfa axxxoike
+ sdfa axxxoike
+ asdfa axxxoike
+ xasdfa axxxoike
+ asxxdfa axxxoike
+ asxa;ofa axxxoike
+ asdfaqwer axxxoike
+ a axxxoikey
+ fa axxxoikey
+ dfa axxxoikey
+ sdfa axxxoikey
+ asdfa axxxoikey
+ xasdfa axxxoikey
+ asxxdfa axxxoikey
+ asxa;ofa axxxoikey
+ asdfaqwer axxxoikey
+
+xxxxx xx xxxxxx
+xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx
+xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx
+xx xxxxxxx. xxxx xxxx.
+
+> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx
+> xxxxxx xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx
+
+aa aa aa aa
+bb bb bb bb
+cc cc cc cc
diff --git a/src/testdir/test15.ok b/src/testdir/test15.ok
new file mode 100644
index 000000000..bc09f5e7d
--- /dev/null
+++ b/src/testdir/test15.ok
@@ -0,0 +1,111 @@
+test for :left
+a a
+fa a
+dfa a
+sdfa a
+asdfa a
+xasdfa a
+asxxdfa a
+
+ test for :center
+ a a
+ fa afd asdf
+ dfa a
+ sdfa afd asdf
+ asdfa a
+ xasdfa asdfasdfasdfasdfasdf
+ asxxdfa a
+
+ test for :right
+ a a
+ fa a
+ dfa a
+ sdfa a
+ asdfa a
+ xasdfa a
+ asxxdfa a
+ asxa;ofa a
+ asdfaqwer a
+ a ax
+ fa ax
+ dfa ax
+ sdfa ax
+ asdfa ax
+ xasdfa ax
+ asxxdfa ax
+ asxa;ofa ax
+ asdfaqwer ax
+ a axx
+ fa axx
+ dfa axx
+ sdfa axx
+ asdfa axx
+ xasdfa axx
+ asxxdfa axx
+ asxa;ofa axx
+ asdfaqwer axx
+ a axxx
+ fa axxx
+ dfa axxx
+ sdfa axxx
+ asdfa axxx
+ xasdfa axxx
+ asxxdfa axxx
+ asxa;ofa axxx
+ asdfaqwer axxx
+ a axxxo
+ fa axxxo
+ dfa axxxo
+ sdfa axxxo
+ asdfa axxxo
+ xasdfa axxxo
+ asxxdfa axxxo
+ asxa;ofa axxxo
+ asdfaqwer axxxo
+ a axxxoi
+ fa axxxoi
+ dfa axxxoi
+ sdfa axxxoi
+ asdfa axxxoi
+ xasdfa axxxoi
+ asxxdfa axxxoi
+ asxa;ofa axxxoi
+ asdfaqwer axxxoi
+ a axxxoik
+ fa axxxoik
+ dfa axxxoik
+ sdfa axxxoik
+ asdfa axxxoik
+ xasdfa axxxoik
+ asxxdfa axxxoik
+ asxa;ofa axxxoik
+ asdfaqwer axxxoik
+ a axxxoike
+ fa axxxoike
+ dfa axxxoike
+ sdfa axxxoike
+ asdfa axxxoike
+ xasdfa axxxoike
+ asxxdfa axxxoike
+ asxa;ofa axxxoike
+ asdfaqwer axxxoike
+ a axxxoikey
+ fa axxxoikey
+ dfa axxxoikey
+ sdfa axxxoikey
+ asdfa axxxoikey
+ xasdfa axxxoikey
+ asxxdfa axxxoikey
+ asxa;ofa axxxoikey
+ asdfaqwer axxxoikey
+
+xxxxx xx xxxxxx xxxxxxx xxxxxxxxx xxx xxxx xxxxx xxxxx xxx xx
+xxxxxxxxxxxxxxxxxx xxxxx xxxx, xxxx xxxx xxxx xxxx xxx xx xx xx xxxxxxx.
+xxxx xxxx.
+
+> xx xx, xxxx xxxx xxx xxxx xxx xxxxx xxx xxx xxxxxxx xxx xxxxx xxxxxx
+> xxxxxxx: xxxx xxxxxxx, xx xxxxxx xxxx xxxxxxxxxx
+
+aa aa aa aa
+bb bb bb bb
+cc cc cc cc
diff --git a/src/testdir/test16.in b/src/testdir/test16.in
new file mode 100644
index 000000000..7fc0d50cf
--- /dev/null
+++ b/src/testdir/test16.in
@@ -0,0 +1,10 @@
+Tests for resetting "secure" flag after GUI has started.
+
+STARTTEST
+:set exrc secure
+:gui -f
+:.,$w! test.out
+:qa!
+ENDTEST
+
+ just some text
diff --git a/src/testdir/test16.ok b/src/testdir/test16.ok
new file mode 100644
index 000000000..25e2eea5c
--- /dev/null
+++ b/src/testdir/test16.ok
@@ -0,0 +1,2 @@
+
+ just some text
diff --git a/src/testdir/test17.in b/src/testdir/test17.in
new file mode 100644
index 000000000..e59144ffb
--- /dev/null
+++ b/src/testdir/test17.in
@@ -0,0 +1,27 @@
+Tests for "gf" on ${VAR}
+
+STARTTEST
+:so small.vim
+:if has("ebcdic")
+: set isfname=@,240-249,/,.,-,_,+,,,$,:,~,{,}
+:else
+: set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,}
+:endif
+:if has("unix")
+:let $CDIR = "."
+/CDIR
+:else
+:if has("amiga")
+:let $TDIR = "/testdir"
+:else
+:let $TDIR = "."
+:endif
+/TDIR
+:endif
+gf
+:w! test.out
+:qa!
+ENDTEST
+
+ ${CDIR}/test17a.in
+ $TDIR/test17a.in
diff --git a/src/testdir/test17.ok b/src/testdir/test17.ok
new file mode 100644
index 000000000..58c3504ad
--- /dev/null
+++ b/src/testdir/test17.ok
@@ -0,0 +1,3 @@
+This file is just to test "gf" in test 17.
+The contents is not importent.
+Just testing!
diff --git a/src/testdir/test17a.in b/src/testdir/test17a.in
new file mode 100644
index 000000000..58c3504ad
--- /dev/null
+++ b/src/testdir/test17a.in
@@ -0,0 +1,3 @@
+This file is just to test "gf" in test 17.
+The contents is not importent.
+Just testing!
diff --git a/src/testdir/test18.in b/src/testdir/test18.in
new file mode 100644
index 000000000..9bfd92234
--- /dev/null
+++ b/src/testdir/test18.in
@@ -0,0 +1,16 @@
+Tests for not doing smart indenting when it isn't set.
+
+STARTTEST
+:so small.vim
+:set nocin nosi ai
+/some
+2cc#test
+:?start?,$w! test.out
+:qa!
+ENDTEST
+
+start text
+ some test text
+ test text
+test text
+ test text
diff --git a/src/testdir/test18.ok b/src/testdir/test18.ok
new file mode 100644
index 000000000..e71971378
--- /dev/null
+++ b/src/testdir/test18.ok
@@ -0,0 +1,4 @@
+start text
+ #test
+test text
+ test text
diff --git a/src/testdir/test19.in b/src/testdir/test19.in
new file mode 100644
index 000000000..0d9b421a2
--- /dev/null
+++ b/src/testdir/test19.in
@@ -0,0 +1,23 @@
+Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
+
+STARTTEST
+:set smarttab expandtab ts=8 sw=4
+/some
+r :set noexpandtab
+/other
+r
+:" Test replacing with Tabs and then backspacing to undo it
+0wR 
+:" Test replacing with Tabs
+0wR 
+:?^start?,$w! test.out
+:qa!
+ENDTEST
+
+start text
+ some test text
+test text
+ other test text
+ a cde
+ f ghi
+test text
diff --git a/src/testdir/test19.ok b/src/testdir/test19.ok
new file mode 100644
index 000000000..ba4eb63be
--- /dev/null
+++ b/src/testdir/test19.ok
@@ -0,0 +1,7 @@
+start text
+ ome test text
+test text
+ ther test text
+ a cde
+ hi
+test text
diff --git a/src/testdir/test2.in b/src/testdir/test2.in
new file mode 100644
index 000000000..b7b5a5106
--- /dev/null
+++ b/src/testdir/test2.in
@@ -0,0 +1,29 @@
+
+This is a test if a URL is recognized by "gf", with the cursor before and
+after the "://". Also test ":\\".
+
+STARTTEST
+:so small.vim
+/^first
+/tmp
+:call append(0, expand("<cfile>"))
+/^second
+/URL
+:call append(1, expand("<cfile>"))
+:if has("ebcdic")
+: set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
+:else
+: set isf=@,48-57,/,.,-,_,+,,,$,:,~,\
+:endif
+/^third
+/name
+:call append(2, expand("<cfile>"))
+/^fourth
+/URL
+:call append(3, expand("<cfile>"))
+5GdG:wq! test.out
+ENDTEST
+first test for URL://machine.name/tmp/vimtest2a and other text
+second test for URL://machine.name/tmp/vimtest2b. And other text
+third test for URL:\\machine.name\vimtest2c and other text
+fourth test for URL:\\machine.name\tmp\vimtest2d, and other text
diff --git a/src/testdir/test2.ok b/src/testdir/test2.ok
new file mode 100644
index 000000000..32978825f
--- /dev/null
+++ b/src/testdir/test2.ok
@@ -0,0 +1,4 @@
+URL://machine.name/tmp/vimtest2a
+URL://machine.name/tmp/vimtest2b
+URL:\\machine.name\vimtest2c
+URL:\\machine.name\tmp\vimtest2d
diff --git a/src/testdir/test20.in b/src/testdir/test20.in
new file mode 100644
index 000000000..7201c75c2
--- /dev/null
+++ b/src/testdir/test20.in
@@ -0,0 +1,22 @@
+Tests Blockwise Visual when there are TABs before the text.
+First test for undo working properly when executing commands from a register.
+Also test this in an empty buffer.
+
+STARTTEST
+:so tiny.vim
+G0"ay$k@au
+:new
+@auY:quit!
+GP
+/start here$
+jjlld
+:/here$/,$-1w! test.out
+:qa!
+ENDTEST
+
+test text test tex start here
+ some text
+ test text
+test text
+
+OxjAykdd
diff --git a/src/testdir/test20.ok b/src/testdir/test20.ok
new file mode 100644
index 000000000..2604e7cc8
--- /dev/null
+++ b/src/testdir/test20.ok
@@ -0,0 +1,6 @@
+test text test tex rt here
+ somext
+ tesext
+test text
+
+
diff --git a/src/testdir/test21.in b/src/testdir/test21.in
new file mode 100644
index 000000000..491b9f740
--- /dev/null
+++ b/src/testdir/test21.in
@@ -0,0 +1,19 @@
+Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
+
+STARTTEST
+:so small.vim
+/start
+6[ :.w! test.out
+?start here
+6 :.w >>test.out
+:qa!
+ENDTEST
+
+#include test21.in
+
+/* test text test tex start here
+ some text
+ test text
+ start OK if found this line
+ start found wrong line
+test text
diff --git a/src/testdir/test21.ok b/src/testdir/test21.ok
new file mode 100644
index 000000000..d9f1b759c
--- /dev/null
+++ b/src/testdir/test21.ok
@@ -0,0 +1,2 @@
+ start OK if found this line
+ start OK if found this line
diff --git a/src/testdir/test22.in b/src/testdir/test22.in
new file mode 100644
index 000000000..f5cc046c6
--- /dev/null
+++ b/src/testdir/test22.in
@@ -0,0 +1,13 @@
+Tests for file with some lines ending in CTRL-M, some not
+
+STARTTEST
+:set ta tx
+:e!
+:$-3,$w! test.out
+:qa!
+ENDTEST
+
+this lines ends in a
+this one doesn't
+this one does
+and the last one doesn't
diff --git a/src/testdir/test22.ok b/src/testdir/test22.ok
new file mode 100644
index 000000000..38ff89eaf
--- /dev/null
+++ b/src/testdir/test22.ok
@@ -0,0 +1,4 @@
+this lines ends in a
+this one doesn't
+this one does
+and the last one doesn't
diff --git a/src/testdir/test23.in b/src/testdir/test23.in
new file mode 100644
index 000000000..0e0e60553
--- /dev/null
+++ b/src/testdir/test23.in
@@ -0,0 +1,15 @@
+Tests for complicated + argument to :edit command
+
+STARTTEST
+:$-1w! Xfile1
+:$w! Xfile2
+:edit +1|s/|/PIPE/|w Xfile1| e Xfile2|1 | s/\//SLASH/|w
+:w! test.out
+:e Xfile1
+:w >> test.out
+:qa!
+ENDTEST
+
+The result should be in Xfile1: "fooPIPEbar", in Xfile2: "fooSLASHbar"
+foo|bar
+foo/bar
diff --git a/src/testdir/test23.ok b/src/testdir/test23.ok
new file mode 100644
index 000000000..f1930abad
--- /dev/null
+++ b/src/testdir/test23.ok
@@ -0,0 +1,2 @@
+fooSLASHbar
+fooPIPEbar
diff --git a/src/testdir/test24.in b/src/testdir/test24.in
new file mode 100644
index 000000000..84721d992
--- /dev/null
+++ b/src/testdir/test24.in
@@ -0,0 +1,21 @@
+Tests for regexp with backslash and other special characters inside []
+
+STARTTEST
+:set nocompatible viminfo+=nviminfo
+/[\x]
+x/[\t\]]
+x/[]y]
+x/[\]]
+x/[y^]
+x/[$y]
+x:?start?,$w! test.out
+:qa!
+ENDTEST
+
+start
+test \text test text
+test text test text
+test text ]test text
+test ]text test text
+test text te^st text
+test te$xt test text
diff --git a/src/testdir/test24.ok b/src/testdir/test24.ok
new file mode 100644
index 000000000..896b50ae5
--- /dev/null
+++ b/src/testdir/test24.ok
@@ -0,0 +1,7 @@
+start
+test text test text
+test text test text
+test text test text
+test text test text
+test text test text
+test text test text
diff --git a/src/testdir/test25.in b/src/testdir/test25.in
new file mode 100644
index 000000000..4139865da
--- /dev/null
+++ b/src/testdir/test25.in
@@ -0,0 +1,31 @@
+Test for jumping to a tag with 'hidden' set, with symbolic link in path of tag.
+This only works for Unix, because of the symbolic link.
+
+STARTTEST
+:so small.vim
+:set hidden
+:" Create a link from test25.dir to the current directory.
+:!rm -f test25.dir
+:!ln -s . test25.dir
+:" Create tags.text, with the current directory name inserted.
+/tags line
+:r !pwd
+d$/test
+hP:.w! tags.test
+:" Try jumping to a tag in the current file, but with a path that contains a
+:" symbolic link. When wrong, this will give the ATTENTION message. The next
+:" space will then be eaten by hit-return, instead of moving the cursor to 'd'.
+:set tags=tags.test
+G x:.w! test.out
+:!rm -f test25.dir tags.test
+:qa!
+ENDTEST
+
+tags line:
+SECTION_OFF /test25.dir/test25.in /^#define SECTION_OFF 3$/
+
+/*tx.c*/
+#define SECTION_OFF 3
+#define NUM_SECTIONS 3
+
+SECTION_OFF
diff --git a/src/testdir/test25.ok b/src/testdir/test25.ok
new file mode 100644
index 000000000..08fc070b7
--- /dev/null
+++ b/src/testdir/test25.ok
@@ -0,0 +1 @@
+#efine SECTION_OFF 3
diff --git a/src/testdir/test26.in b/src/testdir/test26.in
new file mode 100644
index 000000000..df572c897
--- /dev/null
+++ b/src/testdir/test26.in
@@ -0,0 +1,43 @@
+Test for :execute, :while and :if
+
+STARTTEST
+:so small.vim
+mt:let i = 0
+:while i < 12
+: let i = i + 1
+: if has("ebcdic")
+: execute "normal o" . i . "\047"
+: else
+: execute "normal o" . i . "\033"
+: endif
+: if i % 2
+: normal Ax
+: if i == 9
+: break
+: endif
+: if i == 5
+: continue
+: else
+: let j = 9
+: while j > 0
+: if has("ebcdic")
+: execute "normal" j . "a" . j . "\x27"
+: else
+: execute "normal" j . "a" . j . "\x1b"
+: endif
+: let j = j - 1
+: endwhile
+: endif
+: endif
+: if i == 9
+: if has("ebcdic")
+: execute "normal Az\047"
+: else
+: execute "normal Az\033"
+: endif
+: endif
+:endwhile
+:'t,$w! test.out
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test26.ok b/src/testdir/test26.ok
new file mode 100644
index 000000000..bc4476118
--- /dev/null
+++ b/src/testdir/test26.ok
@@ -0,0 +1,10 @@
+
+1x999999999888888887777777666666555554444333221
+2
+3x999999999888888887777777666666555554444333221
+4
+5x
+6
+7x999999999888888887777777666666555554444333221
+8
+9x
diff --git a/src/testdir/test27.in b/src/testdir/test27.in
new file mode 100644
index 000000000..2df16d9ef
--- /dev/null
+++ b/src/testdir/test27.in
@@ -0,0 +1,20 @@
+Test for expanding file names
+
+STARTTEST
+:!mkdir Xdir1
+:!mkdir Xdir2
+:!mkdir Xdir3
+:cd Xdir3
+:!mkdir Xdir4
+:cd ..
+:w Xdir1/file
+:w Xdir3/Xdir4/file
+:n Xdir?/*/file
+Go%:.w! test.out
+:n! Xdir?/*/nofile
+Go%:.w >>test.out
+:e! xx
+:!rm -rf Xdir1 Xdir2 Xdir3
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test27.ok b/src/testdir/test27.ok
new file mode 100644
index 000000000..c35f2438a
--- /dev/null
+++ b/src/testdir/test27.ok
@@ -0,0 +1,2 @@
+Xdir3/Xdir4/file
+Xdir?/*/nofile
diff --git a/src/testdir/test28.in b/src/testdir/test28.in
new file mode 100644
index 000000000..5542c9266
--- /dev/null
+++ b/src/testdir/test28.in
Binary files differ
diff --git a/src/testdir/test28.ok b/src/testdir/test28.ok
new file mode 100644
index 000000000..911d85465
--- /dev/null
+++ b/src/testdir/test28.ok
@@ -0,0 +1,2 @@
+sd
+map __2 asdsecondsdsd0map __5 asd0fifth
diff --git a/src/testdir/test29.in b/src/testdir/test29.in
new file mode 100644
index 000000000..de93ccc22
--- /dev/null
+++ b/src/testdir/test29.in
@@ -0,0 +1,67 @@
+Test for joining lines with 'joinspaces' set or not
+
+STARTTEST
+:set nojoinspaces
+/firstline/
+jJjJjJjJjJjJjJjJjJjJjJjJjJjJ:set joinspaces
+jJjJjJjJjJjJjJjJjJjJjJjJjJjJ:?firstline?+1,$w! test.out
+:qa!
+ENDTEST
+
+firstline
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf.
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
+asdfasdf
+asdf
diff --git a/src/testdir/test29.ok b/src/testdir/test29.ok
new file mode 100644
index 000000000..076f77c98
--- /dev/null
+++ b/src/testdir/test29.ok
@@ -0,0 +1,28 @@
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf. asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
+asdfasdf asdf
diff --git a/src/testdir/test3.in b/src/testdir/test3.in
new file mode 100644
index 000000000..cd725bffb
--- /dev/null
+++ b/src/testdir/test3.in
@@ -0,0 +1,1217 @@
+/* vim: set cin ts=4 sw=4 : */
+
+Test for 'cindent'
+
+STARTTEST
+:so small.vim
+:set nocompatible viminfo+=nviminfo
+:edit " read modeline
+/start of AUTO
+=/end of AUTO
+ENDTEST
+
+/* start of AUTO matically checked */
+{
+ if (test)
+ cmd1;
+ cmd2;
+}
+
+{
+ if (test)
+ cmd1;
+ else
+ cmd2;
+}
+
+{
+ if (test)
+ {
+ cmd1;
+ cmd2;
+ }
+}
+
+{
+ if (test)
+ {
+ cmd1;
+ else
+ }
+}
+
+{
+ while (this)
+ if (test)
+ cmd1;
+ cmd2;
+}
+
+{
+ while (this)
+ if (test)
+ cmd1;
+ else
+ cmd2;
+}
+
+{
+ if (test)
+ {
+ cmd;
+ }
+
+ if (test)
+ cmd;
+}
+
+{
+ if (test) {
+ cmd;
+ }
+
+ if (test) cmd;
+}
+
+{
+ cmd1;
+ for (blah)
+ while (this)
+ if (test)
+ cmd2;
+ cmd3;
+}
+
+{
+ cmd1;
+ for (blah)
+ while (this)
+ if (test)
+ cmd2;
+ cmd3;
+
+ if (test)
+ {
+ cmd1;
+ cmd2;
+ cmd3;
+ }
+}
+
+
+/* Test for 'cindent' do/while mixed with if/else: */
+
+{
+ do
+ if (asdf)
+ asdfasd;
+ while (cond);
+
+ do
+ if (asdf)
+ while (asdf)
+ asdf;
+ while (asdf);
+}
+
+/* Test for 'cindent' with two ) on a continuation line */
+{
+ if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
+ aal;sdkjf ( ;asldfkja;sldfk
+ al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
+ line up here;
+}
+
+
+/* C++ tests: */
+
+// foo() these three lines should remain in column 0
+// {
+// }
+
+/* Test for continuation and unterminated lines: */
+{
+ i = 99 + 14325 +
+ 21345 +
+ 21345 +
+ 21345 + ( 21345 +
+ 21345) +
+ 2345 +
+ 1234;
+ c = 1;
+}
+
+/*
+ testje for indent with empty line
+
+ here */
+
+{
+ if (testing &&
+ not a joke ||
+ line up here)
+ hay;
+ if (testing &&
+ (not a joke || testing
+ )line up here)
+ hay;
+ if (testing &&
+ (not a joke || testing
+ line up here))
+ hay;
+}
+
+
+{
+ switch (c)
+ {
+ case xx:
+ do
+ if (asdf)
+ do
+ asdfasdf;
+ while (asdf);
+ else
+ asdfasdf;
+ while (cond);
+ case yy:
+ case xx:
+ case zz:
+ testing;
+ }
+}
+
+{
+ if (cond) {
+ foo;
+ }
+ else
+ {
+ bar;
+ }
+}
+
+{
+ if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
+ alsdkfj (asldk;fj
+ awith cino=(0 ;lf this one goes to below the paren with ==
+ ;laksjfd ;lsakdjf ;alskdf asd)
+ asdfasdf;)))
+ asdfasdf;
+}
+
+ int
+func(a, b)
+ int a;
+ int c;
+{
+ if (c1 && (c2 ||
+ c3))
+ foo;
+ if (c1 &&
+ (c2 || c3)
+ )
+}
+
+{
+ while (asd)
+ {
+ if (asdf)
+ if (test)
+ if (that)
+ {
+ if (asdf)
+ do
+ cdasd;
+ while (as
+ df);
+ }
+ else
+ if (asdf)
+ asdf;
+ else
+ asdf;
+ asdf;
+ }
+}
+
+{
+ s = "/*"; b = ';'
+ s = "/*"; b = ';';
+ a = b;
+}
+
+{
+ switch (a)
+ {
+ case a:
+ switch (t)
+ {
+ case 1:
+ cmd;
+ break;
+ case 2:
+ cmd;
+ break;
+ }
+ cmd;
+ break;
+ case b:
+ {
+ int i;
+ cmd;
+ }
+ break;
+ case c: {
+ int i;
+ cmd;
+ }
+ case d: if (cond &&
+ test) { /* this line doesn't work right */
+ int i;
+ cmd;
+ }
+ break;
+ }
+}
+
+{
+ if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
+ (bp_to->b_p_initialized ||
+ (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
+ return;
+label :
+ asdf = asdf ?
+ asdf : asdf;
+ asdf = asdf ?
+ asdf: asdf;
+}
+
+/* Special Comments : This function has the added complexity (compared */
+/* : to addtolist) of having to check for a detail */
+/* : texture and add that to the list first. */
+
+char *(array[100]) = {
+ "testje",
+ "foo",
+ "bar",
+}
+
+enum soppie
+{
+ yes = 0,
+ no,
+ maybe
+};
+
+typedef enum soppie
+{
+ yes = 0,
+ no,
+ maybe
+};
+
+{
+ int a,
+ b;
+}
+
+{
+ struct Type
+ {
+ int i;
+ char *str;
+ } var[] =
+ {
+ 0, "zero",
+ 1, "one",
+ 2, "two",
+ 3, "three"
+ };
+
+ float matrix[3][3] =
+ {
+ {
+ 0,
+ 1,
+ 2
+ },
+ {
+ 3,
+ 4,
+ 5
+ },
+ {
+ 6,
+ 7,
+ 8
+ }
+ };
+}
+
+{
+ /* blah ( blah */
+ /* where does this go? */
+
+ /* blah ( blah */
+ cmd;
+
+ func(arg1,
+ /* comment */
+ arg2);
+ a;
+ {
+ b;
+ {
+ c; /* Hey, NOW it indents?! */
+ }
+ }
+
+ {
+ func(arg1,
+ arg2,
+ arg3);
+ /* Hey, what am I doing here? Is this coz of the ","? */
+ }
+}
+
+main ()
+{
+ if (cond)
+ {
+ a = b;
+ }
+ if (cond) {
+ a = c;
+ }
+ if (cond)
+ a = d;
+ return;
+}
+
+{
+ case 2: if (asdf &&
+ asdfasdf)
+ aasdf;
+ a = 9;
+ case 3: if (asdf)
+ aasdf;
+ a = 9;
+ case 4: x = 1;
+ y = 2;
+
+label: if (asdf)
+ here;
+
+label: if (asdf &&
+ asdfasdf)
+ {
+ }
+
+label: if (asdf &&
+ asdfasdf) {
+ there;
+ }
+
+label: if (asdf &&
+ asdfasdf)
+ there;
+}
+
+{
+ /*
+ hello with ":set comments= cino=c5"
+ */
+
+ /*
+ hello with ":set comments= cino="
+ */
+}
+
+
+{
+ if (a < b) {
+ a = a + 1;
+ } else
+ a = a + 2;
+
+ if (a)
+ do {
+ testing;
+ } while (asdfasdf);
+ a = b + 1;
+ asdfasdf
+}
+
+class bob
+{
+ int foo() {return 1;}
+ int bar;
+}
+
+main()
+{
+while(1)
+if (foo)
+{
+bar;
+}
+else {
+asdf;
+}
+misplacedline;
+}
+
+{
+ if (clipboard.state == SELECT_DONE
+ && ((row == clipboard.start.lnum
+ && col >= clipboard.start.col)
+ || row > clipboard.start.lnum))
+}
+
+{
+if (1) {i += 4;}
+where_am_i;
+return 0;
+}
+
+{
+{
+} // sdf(asdf
+if (asdf)
+asd;
+}
+
+{
+label1:
+label2:
+}
+
+{
+int fooRet = foo(pBar1, false /*fKB*/,
+ true /*fPTB*/, 3 /*nT*/, false /*fDF*/);
+f() {
+for ( i = 0;
+ i < m;
+ /* c */ i++ ) {
+a = b;
+}
+}
+}
+
+{
+ f1(/*comment*/);
+ f2();
+}
+
+{
+do {
+if (foo) {
+} else
+;
+} while (foo);
+foo(); // was wrong
+}
+
+int x; // no extra indent because of the ;
+void func()
+{
+}
+
+char *tab[] = {"aaa",
+ "};", /* }; */ NULL}
+ int indented;
+{}
+
+char *a[] = {"aaa", "bbb",
+ "ccc", NULL};
+// here
+
+char *tab[] = {"aaa",
+ "xx", /* xx */}; /* asdf */
+int not_indented;
+
+{
+ do {
+ switch (bla)
+ {
+ case 1: if (foo)
+ bar;
+ }
+ } while (boo);
+ wrong;
+}
+
+int foo,
+ bar;
+int foo;
+
+#if defined(foo) \
+ && defined(bar)
+char * xx = "asdf\
+ foo\
+ bor";
+int x;
+
+char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+
+void f()
+{
+#if defined(foo) \
+ && defined(bar)
+char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+ {
+ int i;
+char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+ }
+#endif
+}
+#endif
+
+int y; // comment
+ // comment
+
+ // comment
+
+{
+ Constructor(int a,
+ int b ) : BaseClass(a)
+ {
+ }
+}
+
+void foo()
+{
+ char one,
+ two;
+ struct bla piet,
+ jan;
+ enum foo kees,
+ jannie;
+ static unsigned sdf,
+ krap;
+ unsigned int piet,
+ jan;
+ int
+ kees,
+ jan;
+}
+
+{
+ t(int f,
+ int d); // )
+ d();
+}
+
+Constructor::Constructor(int a,
+ int b
+ ) :
+ BaseClass(a,
+ b,
+ c),
+ mMember(b),
+{
+}
+
+Constructor::Constructor(int a,
+ int b ) :
+ BaseClass(a)
+{
+}
+
+Constructor::Constructor(int a,
+ int b ) /*x*/ : /*x*/ BaseClass(a),
+ member(b)
+{
+}
+
+class CAbc :
+ public BaseClass1,
+ protected BaseClass2
+{
+ int Test() { return FALSE; }
+ int Test1() { return TRUE; }
+
+ CAbc(int a, int b ) :
+ BaseClass(a)
+ {
+ switch(xxx)
+ {
+ case abc:
+ asdf();
+ break;
+
+ case 999:
+ baer();
+ break;
+ }
+ }
+
+public: // <-- this was incoreectly indented before!!
+ void testfall();
+protected:
+ void testfall();
+};
+
+class CAbc : public BaseClass1,
+ protected BaseClass2
+{
+};
+
+static struct
+{
+ int a;
+ int b;
+} variable[COUNT] =
+{
+ {
+ 123,
+ 456
+ },
+ {
+ 123,
+ 456
+ }
+};
+
+static struct
+{
+ int a;
+ int b;
+} variable[COUNT] =
+{
+ { 123, 456 },
+ { 123, 456 }
+};
+
+void asdf() /* ind_maxparen may cause trouble here */
+{
+ if ((0
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1)) break;
+}
+
+/* end of AUTO */
+
+STARTTEST
+:set tw=0 wm=60 columns=80 noai fo=croq
+/serious/e
+a about life, the universe, and the rest
+ENDTEST
+
+{
+
+/* this is
+ * a real serious important big
+ * comment
+ */
+ /* insert " about life, the universe, and the rest" after "serious" */
+}
+
+STARTTEST
+:set nocin
+/comments
+joabout life/happens
+jothere/below
+oline/this
+Ohello
+ENDTEST
+
+{
+ /*
+ * Testing for comments, without 'cin' set
+ */
+
+/*
+* what happens here?
+*/
+
+ /*
+ the end of the comment, try inserting a line below */
+
+ /* how about
+ this one */
+}
+
+STARTTEST
+:set cin
+/vec2
+==
+ENDTEST
+
+{
+ var = this + that + vec[0] * vec[0]
+ + vec[1] * vec[1]
+ + vec2[2] * vec[2];
+}
+
+STARTTEST
+:set cin
+:set cino=}4
+/testing1
+k2==/testing2
+k2==
+ENDTEST
+
+{
+ asdf asdflkajds f;
+ if (tes & ting) {
+ asdf asdf asdf ;
+ asdfa sdf asdf;
+ }
+ testing1;
+ if (tes & ting)
+ {
+ asdf asdf asdf ;
+ asdfa sdf asdf;
+ }
+ testing2;
+}
+
+STARTTEST
+:set cin
+:set cino=(0,)20
+/main
+=][
+ENDTEST
+
+main ( int first_par, /*
+ * Comment for
+ * first par
+ */
+ int second_par /*
+ * Comment for
+ * second par
+ */
+ )
+{
+ func( first_par, /*
+ * Comment for
+ * first par
+ */
+ second_par /*
+ * Comment for
+ * second par
+ */
+ );
+
+}
+
+STARTTEST
+:set cin
+:set cino=
+]]=][
+ENDTEST
+
+{
+ do
+ {
+ if ()
+ {
+ if ()
+ asdf;
+ else
+ asdf;
+ }
+ } while ();
+ cmd; /* this should go under the } */
+}
+
+STARTTEST
+]]=][
+ENDTEST
+
+void f()
+{
+ if ( k() ) {
+ l();
+
+ } else { /* Start (two words) end */
+ m();
+ }
+
+ n();
+}
+
+STARTTEST
+:set cino={s,e-s
+]]=][
+ENDTEST
+
+void f()
+{
+ if ( k() )
+ {
+ l();
+ } else { /* Start (two words) end */
+ m();
+ }
+ n(); /* should be under the if () */
+}
+
+STARTTEST
+:set cino={s,fs
+]]=/ foo
+ENDTEST
+
+void bar(void)
+{
+ static array[2][2] =
+ {
+ { 1, 2 },
+ { 3, 4 },
+ }
+
+ while (a)
+ {
+ foo(&a);
+ }
+
+ {
+ int a;
+ {
+ a = a + 1;
+ }
+ }
+ b = a;
+ }
+
+void func(void)
+ {
+ a = 1;
+ {
+ b = 2;
+ }
+ c = 3;
+ d = 4;
+ }
+/* foo */
+
+STARTTEST
+:set cino=
+/while
+ohere
+ENDTEST
+
+a()
+{
+ do {
+ a = a +
+ a;
+ } while ( a ); /* add text under this line */
+ if ( a )
+ a;
+}
+
+STARTTEST
+:set cino= com=
+/comment
+olabel2: b(); label3 /* post */: /* pre */ label4: f(/*com*/); if (/*com*/) cmd();
+ENDTEST
+
+a()
+{
+label1:
+ /* hmm */
+ // comment
+}
+
+STARTTEST
+:set comments& comments^=s:/*,m:**,ex:*/
+/simple
+=5j
+ENDTEST
+
+/*
+ * A simple comment
+ */
+
+/*
+ ** A different comment
+ */
+
+STARTTEST
+:set cino=c0
+:set comments& comments-=s1:/* comments^=s0:/*
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+
+ /*********
+ A comment.
+*********/
+}
+
+STARTTEST
+:set cino=c0,C1
+:set comments& comments-=s1:/* comments^=s0:/*
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+
+ /*********
+ A comment.
+*********/
+}
+
+STARTTEST
+:set cino=
+]]=][
+ENDTEST
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+STARTTEST
+:set cino=(s
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+STARTTEST
+:set cino=(s,U1
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+STARTTEST
+:set cino=(0
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ if ( c1
+ && ( c2
+ || c3))
+ foo;
+}
+
+STARTTEST
+:set cino=(0,w1
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ if ( c1
+ && ( c2
+ || c3))
+ foo;
+}
+
+STARTTEST
+:set cino=(s
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ c = c1 && (
+ c2 ||
+ c3
+ ) && c4;
+ if (
+ c1 && c2
+ )
+ foo;
+}
+
+STARTTEST
+:set cino=(s,m1
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ c = c1 && (
+ c2 ||
+ c3
+ ) && c4;
+ if (
+ c1 && c2
+ )
+ foo;
+}
+
+STARTTEST
+:set cino=b1
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ switch (x)
+ {
+ case 1:
+ a = b;
+ break;
+ default:
+ a = 0;
+ break;
+ }
+}
+
+STARTTEST
+:set cino=(0,W5
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ invokeme(
+ argu,
+ ment);
+ invokeme(
+ argu,
+ ment
+ );
+ invokeme(argu,
+ ment
+ );
+}
+
+STARTTEST
+:set cino=/6
+2kdd]]=][
+ENDTEST
+
+void f()
+{
+ statement;
+ // comment 1
+ // comment 2
+}
+
+STARTTEST
+:set cino=
+2kdd]]/comment 1/+1
+==
+ENDTEST
+
+void f()
+{
+ statement;
+ // comment 1
+ // comment 2
+}
+
+STARTTEST
+:set cino=g0
+2kdd]]=][
+ENDTEST
+
+class CAbc
+{
+ int Test() { return FALSE; }
+
+public: // comment
+ void testfall();
+protected:
+ void testfall();
+};
+
+STARTTEST
+:set cino=(0,W2s
+2kdd]]=][
+ENDTEST
+
+{
+ averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
+ asdasdf,
+ func(asdf,
+ asdfadsf),
+ asdfasdf
+ );
+
+ /* those are ugly, but consequent */
+
+ func()->asd(asdasdf,
+ averylongfunctionname(
+ abc,
+ dec)->averylongfunctionname(
+ asdfadsf,
+ asdfasdf,
+ asdfasdf,
+ ),
+ func(asdfadf,
+ asdfasdf
+ ),
+ asdasdf
+ );
+
+ averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
+ abc,
+ dec)->asdfasdfasdf(
+ asdfadsf,
+ asdfasdf,
+ asdfasdf,
+ ),
+ func(asdfadf,
+ asdfasdf),
+ asdasdf
+ );
+}
+
+STARTTEST
+:g/^STARTTEST/.,/^ENDTEST/d
+:1;/start of AUTO/,$wq! test.out
+ENDTEST
diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok
new file mode 100644
index 000000000..570f8f63d
--- /dev/null
+++ b/src/testdir/test3.ok
@@ -0,0 +1,1090 @@
+/* start of AUTO matically checked */
+{
+ if (test)
+ cmd1;
+ cmd2;
+}
+
+{
+ if (test)
+ cmd1;
+ else
+ cmd2;
+}
+
+{
+ if (test)
+ {
+ cmd1;
+ cmd2;
+ }
+}
+
+{
+ if (test)
+ {
+ cmd1;
+ else
+ }
+}
+
+{
+ while (this)
+ if (test)
+ cmd1;
+ cmd2;
+}
+
+{
+ while (this)
+ if (test)
+ cmd1;
+ else
+ cmd2;
+}
+
+{
+ if (test)
+ {
+ cmd;
+ }
+
+ if (test)
+ cmd;
+}
+
+{
+ if (test) {
+ cmd;
+ }
+
+ if (test) cmd;
+}
+
+{
+ cmd1;
+ for (blah)
+ while (this)
+ if (test)
+ cmd2;
+ cmd3;
+}
+
+{
+ cmd1;
+ for (blah)
+ while (this)
+ if (test)
+ cmd2;
+ cmd3;
+
+ if (test)
+ {
+ cmd1;
+ cmd2;
+ cmd3;
+ }
+}
+
+
+/* Test for 'cindent' do/while mixed with if/else: */
+
+{
+ do
+ if (asdf)
+ asdfasd;
+ while (cond);
+
+ do
+ if (asdf)
+ while (asdf)
+ asdf;
+ while (asdf);
+}
+
+/* Test for 'cindent' with two ) on a continuation line */
+{
+ if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
+ aal;sdkjf ( ;asldfkja;sldfk
+ al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
+ line up here;
+}
+
+
+/* C++ tests: */
+
+// foo() these three lines should remain in column 0
+// {
+// }
+
+/* Test for continuation and unterminated lines: */
+{
+ i = 99 + 14325 +
+ 21345 +
+ 21345 +
+ 21345 + ( 21345 +
+ 21345) +
+ 2345 +
+ 1234;
+ c = 1;
+}
+
+/*
+ testje for indent with empty line
+
+ here */
+
+{
+ if (testing &&
+ not a joke ||
+ line up here)
+ hay;
+ if (testing &&
+ (not a joke || testing
+ )line up here)
+ hay;
+ if (testing &&
+ (not a joke || testing
+ line up here))
+ hay;
+}
+
+
+{
+ switch (c)
+ {
+ case xx:
+ do
+ if (asdf)
+ do
+ asdfasdf;
+ while (asdf);
+ else
+ asdfasdf;
+ while (cond);
+ case yy:
+ case xx:
+ case zz:
+ testing;
+ }
+}
+
+{
+ if (cond) {
+ foo;
+ }
+ else
+ {
+ bar;
+ }
+}
+
+{
+ if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
+ alsdkfj (asldk;fj
+ awith cino=(0 ;lf this one goes to below the paren with ==
+ ;laksjfd ;lsakdjf ;alskdf asd)
+ asdfasdf;)))
+ asdfasdf;
+}
+
+ int
+func(a, b)
+ int a;
+ int c;
+{
+ if (c1 && (c2 ||
+ c3))
+ foo;
+ if (c1 &&
+ (c2 || c3)
+ )
+}
+
+{
+ while (asd)
+ {
+ if (asdf)
+ if (test)
+ if (that)
+ {
+ if (asdf)
+ do
+ cdasd;
+ while (as
+ df);
+ }
+ else
+ if (asdf)
+ asdf;
+ else
+ asdf;
+ asdf;
+ }
+}
+
+{
+ s = "/*"; b = ';'
+ s = "/*"; b = ';';
+ a = b;
+}
+
+{
+ switch (a)
+ {
+ case a:
+ switch (t)
+ {
+ case 1:
+ cmd;
+ break;
+ case 2:
+ cmd;
+ break;
+ }
+ cmd;
+ break;
+ case b:
+ {
+ int i;
+ cmd;
+ }
+ break;
+ case c: {
+ int i;
+ cmd;
+ }
+ case d: if (cond &&
+ test) { /* this line doesn't work right */
+ int i;
+ cmd;
+ }
+ break;
+ }
+}
+
+{
+ if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
+ (bp_to->b_p_initialized ||
+ (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
+ return;
+label :
+ asdf = asdf ?
+ asdf : asdf;
+ asdf = asdf ?
+ asdf: asdf;
+}
+
+/* Special Comments : This function has the added complexity (compared */
+/* : to addtolist) of having to check for a detail */
+/* : texture and add that to the list first. */
+
+char *(array[100]) = {
+ "testje",
+ "foo",
+ "bar",
+}
+
+enum soppie
+{
+ yes = 0,
+ no,
+ maybe
+};
+
+typedef enum soppie
+{
+ yes = 0,
+ no,
+ maybe
+};
+
+{
+ int a,
+ b;
+}
+
+{
+ struct Type
+ {
+ int i;
+ char *str;
+ } var[] =
+ {
+ 0, "zero",
+ 1, "one",
+ 2, "two",
+ 3, "three"
+ };
+
+ float matrix[3][3] =
+ {
+ {
+ 0,
+ 1,
+ 2
+ },
+ {
+ 3,
+ 4,
+ 5
+ },
+ {
+ 6,
+ 7,
+ 8
+ }
+ };
+}
+
+{
+ /* blah ( blah */
+ /* where does this go? */
+
+ /* blah ( blah */
+ cmd;
+
+ func(arg1,
+ /* comment */
+ arg2);
+ a;
+ {
+ b;
+ {
+ c; /* Hey, NOW it indents?! */
+ }
+ }
+
+ {
+ func(arg1,
+ arg2,
+ arg3);
+ /* Hey, what am I doing here? Is this coz of the ","? */
+ }
+}
+
+main ()
+{
+ if (cond)
+ {
+ a = b;
+ }
+ if (cond) {
+ a = c;
+ }
+ if (cond)
+ a = d;
+ return;
+}
+
+{
+ case 2: if (asdf &&
+ asdfasdf)
+ aasdf;
+ a = 9;
+ case 3: if (asdf)
+ aasdf;
+ a = 9;
+ case 4: x = 1;
+ y = 2;
+
+label: if (asdf)
+ here;
+
+label: if (asdf &&
+ asdfasdf)
+ {
+ }
+
+label: if (asdf &&
+ asdfasdf) {
+ there;
+ }
+
+label: if (asdf &&
+ asdfasdf)
+ there;
+}
+
+{
+ /*
+ hello with ":set comments= cino=c5"
+ */
+
+ /*
+ hello with ":set comments= cino="
+ */
+}
+
+
+{
+ if (a < b) {
+ a = a + 1;
+ } else
+ a = a + 2;
+
+ if (a)
+ do {
+ testing;
+ } while (asdfasdf);
+ a = b + 1;
+ asdfasdf
+}
+
+class bob
+{
+ int foo() {return 1;}
+ int bar;
+}
+
+main()
+{
+ while(1)
+ if (foo)
+ {
+ bar;
+ }
+ else {
+ asdf;
+ }
+ misplacedline;
+}
+
+{
+ if (clipboard.state == SELECT_DONE
+ && ((row == clipboard.start.lnum
+ && col >= clipboard.start.col)
+ || row > clipboard.start.lnum))
+}
+
+{
+ if (1) {i += 4;}
+ where_am_i;
+ return 0;
+}
+
+{
+ {
+ } // sdf(asdf
+ if (asdf)
+ asd;
+}
+
+{
+label1:
+label2:
+}
+
+{
+ int fooRet = foo(pBar1, false /*fKB*/,
+ true /*fPTB*/, 3 /*nT*/, false /*fDF*/);
+ f() {
+ for ( i = 0;
+ i < m;
+ /* c */ i++ ) {
+ a = b;
+ }
+ }
+}
+
+{
+ f1(/*comment*/);
+ f2();
+}
+
+{
+ do {
+ if (foo) {
+ } else
+ ;
+ } while (foo);
+ foo(); // was wrong
+}
+
+int x; // no extra indent because of the ;
+void func()
+{
+}
+
+char *tab[] = {"aaa",
+ "};", /* }; */ NULL}
+ int indented;
+{}
+
+char *a[] = {"aaa", "bbb",
+ "ccc", NULL};
+// here
+
+char *tab[] = {"aaa",
+ "xx", /* xx */}; /* asdf */
+int not_indented;
+
+{
+ do {
+ switch (bla)
+ {
+ case 1: if (foo)
+ bar;
+ }
+ } while (boo);
+ wrong;
+}
+
+int foo,
+ bar;
+int foo;
+
+#if defined(foo) \
+ && defined(bar)
+char * xx = "asdf\
+ foo\
+ bor";
+int x;
+
+char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+
+void f()
+{
+#if defined(foo) \
+ && defined(bar)
+ char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+ {
+ int i;
+ char *foo = "asdf\
+ asdf\
+ asdf",
+ *bar;
+ }
+#endif
+}
+#endif
+
+int y; // comment
+// comment
+
+// comment
+
+{
+ Constructor(int a,
+ int b ) : BaseClass(a)
+ {
+ }
+}
+
+void foo()
+{
+ char one,
+ two;
+ struct bla piet,
+ jan;
+ enum foo kees,
+ jannie;
+ static unsigned sdf,
+ krap;
+ unsigned int piet,
+ jan;
+ int
+ kees,
+ jan;
+}
+
+{
+ t(int f,
+ int d); // )
+ d();
+}
+
+Constructor::Constructor(int a,
+ int b
+ ) :
+ BaseClass(a,
+ b,
+ c),
+ mMember(b),
+{
+}
+
+Constructor::Constructor(int a,
+ int b ) :
+ BaseClass(a)
+{
+}
+
+Constructor::Constructor(int a,
+ int b ) /*x*/ : /*x*/ BaseClass(a),
+ member(b)
+{
+}
+
+class CAbc :
+ public BaseClass1,
+ protected BaseClass2
+{
+ int Test() { return FALSE; }
+ int Test1() { return TRUE; }
+
+ CAbc(int a, int b ) :
+ BaseClass(a)
+ {
+ switch(xxx)
+ {
+ case abc:
+ asdf();
+ break;
+
+ case 999:
+ baer();
+ break;
+ }
+ }
+
+ public: // <-- this was incoreectly indented before!!
+ void testfall();
+ protected:
+ void testfall();
+};
+
+class CAbc : public BaseClass1,
+ protected BaseClass2
+{
+};
+
+static struct
+{
+ int a;
+ int b;
+} variable[COUNT] =
+{
+ {
+ 123,
+ 456
+ },
+ {
+ 123,
+ 456
+ }
+};
+
+static struct
+{
+ int a;
+ int b;
+} variable[COUNT] =
+{
+ { 123, 456 },
+ { 123, 456 }
+};
+
+void asdf() /* ind_maxparen may cause trouble here */
+{
+ if ((0
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1
+ && 1)) break;
+}
+
+/* end of AUTO */
+
+
+{
+
+/* this is
+ * a real serious
+ * about life, the
+ * universe, and the
+ * rest important big
+ * comment
+ */
+ /* insert " about life, the universe, and the rest" after "serious" */
+}
+
+
+{
+ /*
+ * Testing for comments, without 'cin' set
+ */
+about life
+
+/*
+* what happens here?
+*/
+there
+
+ /*
+ the end of the comment, try inserting a line below */
+line
+
+ /* how about
+hello
+ this one */
+}
+
+
+{
+ var = this + that + vec[0] * vec[0]
+ + vec[1] * vec[1]
+ + vec2[2] * vec[2];
+}
+
+
+{
+ asdf asdflkajds f;
+ if (tes & ting) {
+ asdf asdf asdf ;
+ asdfa sdf asdf;
+ }
+ testing1;
+ if (tes & ting)
+ {
+ asdf asdf asdf ;
+ asdfa sdf asdf;
+ }
+ testing2;
+}
+
+
+main ( int first_par, /*
+ * Comment for
+ * first par
+ */
+ int second_par /*
+ * Comment for
+ * second par
+ */
+ )
+{
+ func( first_par, /*
+ * Comment for
+ * first par
+ */
+ second_par /*
+ * Comment for
+ * second par
+ */
+ );
+
+}
+
+
+{
+ do
+ {
+ if ()
+ {
+ if ()
+ asdf;
+ else
+ asdf;
+ }
+ } while ();
+ cmd; /* this should go under the } */
+}
+
+
+void f()
+{
+ if ( k() ) {
+ l();
+
+ } else { /* Start (two words) end */
+ m();
+ }
+
+ n();
+}
+
+
+void f()
+ {
+ if ( k() )
+ {
+ l();
+ } else { /* Start (two words) end */
+ m();
+ }
+ n(); /* should be under the if () */
+}
+
+
+void bar(void)
+ {
+ static array[2][2] =
+ {
+ { 1, 2 },
+ { 3, 4 },
+ }
+
+ while (a)
+ {
+ foo(&a);
+ }
+
+ {
+ int a;
+ {
+ a = a + 1;
+ }
+ }
+ b = a;
+ }
+
+void func(void)
+ {
+ a = 1;
+ {
+ b = 2;
+ }
+ c = 3;
+ d = 4;
+ }
+/* foo */
+
+
+a()
+{
+ do {
+ a = a +
+ a;
+ } while ( a ); /* add text under this line */
+ here
+ if ( a )
+ a;
+}
+
+
+a()
+{
+label1:
+ /* hmm */
+ // comment
+label2: b();
+label3 /* post */:
+/* pre */ label4:
+ f(/*com*/);
+ if (/*com*/)
+ cmd();
+}
+
+
+/*
+ * A simple comment
+ */
+
+/*
+** A different comment
+*/
+
+
+void f()
+{
+
+ /*********
+ A comment.
+ *********/
+}
+
+
+void f()
+{
+
+ /*********
+ A comment.
+ *********/
+}
+
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+
+void f()
+{
+ c = c1 &&
+ (
+ c2 ||
+ c3
+ ) && c4;
+}
+
+
+void f()
+{
+ if ( c1
+ && ( c2
+ || c3))
+ foo;
+}
+
+
+void f()
+{
+ if ( c1
+ && ( c2
+ || c3))
+ foo;
+}
+
+
+void f()
+{
+ c = c1 && (
+ c2 ||
+ c3
+ ) && c4;
+ if (
+ c1 && c2
+ )
+ foo;
+}
+
+
+void f()
+{
+ c = c1 && (
+ c2 ||
+ c3
+ ) && c4;
+ if (
+ c1 && c2
+ )
+ foo;
+}
+
+
+void f()
+{
+ switch (x)
+ {
+ case 1:
+ a = b;
+ break;
+ default:
+ a = 0;
+ break;
+ }
+}
+
+
+void f()
+{
+ invokeme(
+ argu,
+ ment);
+ invokeme(
+ argu,
+ ment
+ );
+ invokeme(argu,
+ ment
+ );
+}
+
+
+void f()
+{
+ statement;
+ // comment 1
+ // comment 2
+}
+
+
+void f()
+{
+ statement;
+ // comment 1
+ // comment 2
+}
+
+
+class CAbc
+{
+ int Test() { return FALSE; }
+
+public: // comment
+ void testfall();
+protected:
+ void testfall();
+};
+
+
+{
+ averylongfunctionnamelongfunctionnameaverylongfunctionname()->asd(
+ asdasdf,
+ func(asdf,
+ asdfadsf),
+ asdfasdf
+ );
+
+ /* those are ugly, but consequent */
+
+ func()->asd(asdasdf,
+ averylongfunctionname(
+ abc,
+ dec)->averylongfunctionname(
+ asdfadsf,
+ asdfasdf,
+ asdfasdf,
+ ),
+ func(asdfadf,
+ asdfasdf
+ ),
+ asdasdf
+ );
+
+ averylongfunctionnameaverylongfunctionnameavery()->asd(fasdf(
+ abc,
+ dec)->asdfasdfasdf(
+ asdfadsf,
+ asdfasdf,
+ asdfasdf,
+ ),
+ func(asdfadf,
+ asdfasdf),
+ asdasdf
+ );
+}
+
diff --git a/src/testdir/test30.in b/src/testdir/test30.in
new file mode 100644
index 000000000..4e92741c8
--- /dev/null
+++ b/src/testdir/test30.in
@@ -0,0 +1,183 @@
+Test for a lot of variations of the 'fileformats' option
+
+STARTTEST
+:so small.vim
+:" first write three test files, one in each format
+:set fileformat=unix
+:set fileformats=
+:/^1/w! XX1
+:/^2/w! XX2
+:/^3/w! XX3
+:/^4/w! XX4
+:/^5/w! XX5
+:/^6/w! XX6
+:/^7/w! XX7
+:/^8/w! XX8
+:/^9/w! XX9
+:/^10/w! XX10
+:/^unix/;/eof/-1w! XXUnix
+:/^dos/;/eof/-1w! XXDos
+:set bin noeol
+:$w! XXMac
+:set nobin eol
+:bwipe XXUnix XXDos XXMac
+:" create mixed format files
+:!cat XXUnix XXDos >XXUxDs
+:!cat XXUnix XXMac >XXUxMac
+:!cat XXDos XXMac >XXDosMac
+:!cat XXUnix XXDos XXMac >XXUxDsMc
+:"
+:" try reading and writing with 'fileformats' empty
+:set fileformat=unix
+:e! XXUnix
+:w! test.out
+:e! XXDos
+:w! XXtt
+:!cat XXtt >>test.out
+:e! XXMac
+:w! XXtt
+:!cat XXtt >>test.out
+:!cat XX1 >>test.out
+:bwipe XXUnix XXDos XXMac
+:set fileformat=dos
+:e! XXUnix
+:w! XXtt
+:!cat XXtt >>test.out
+:e! XXDos
+:w! XXtt
+:!cat XXtt >>test.out
+:e! XXMac
+:w! XXtt
+:!cat XXtt >>test.out
+:!cat XX2 >>test.out
+:bwipe XXUnix XXDos XXMac
+:set fileformat=mac
+:e! XXUnix
+:w! XXtt
+:!cat XXtt >>test.out
+:e! XXDos
+:w! XXtt
+:!cat XXtt >>test.out
+:e! XXMac
+:w! XXtt
+:!cat XXtt >>test.out
+:!cat XX3 >>test.out
+:bwipe XXUnix XXDos XXMac
+:"
+:" try reading and writing with 'fileformats' set to one format
+:set fileformats=unix
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:set fileformats=dos
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:set fileformats=mac
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:!cat XX4 >>test.out
+:"
+:" try reading and writing with 'fileformats' set to two formats
+:set fileformats=unix,dos
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:e! XXUxMac
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxMac
+:e! XXDosMac
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXDosMac
+:!cat XX5 >>test.out
+:set fileformats=unix,mac
+:e! XXUxDs
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDs
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:e! XXDosMac
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXDosMac
+:!cat XX6 >>test.out
+:set fileformats=dos,mac
+:e! XXUxDs
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDs
+:e! XXUxMac
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxMac
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:!cat XX7 >>test.out
+:"
+:" try reading and writing with 'fileformats' set to three formats
+:set fileformats=unix,dos,mac
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:!cat XX8 >>test.out
+:set fileformats=mac,dos,unix
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:!cat XX9 >>test.out
+:" try with 'binary' set
+:set fileformats=mac,unix,dos
+:set binary
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:set fileformats=mac
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:bwipe XXUxDsMc
+:set fileformats=dos
+:e! XXUxDsMc
+:w! XXtt
+:!cat XXtt >>test.out
+:!cat XX10 >>test.out
+:" add a newline at the end
+:!cat XXUnix >>test.out
+:qa!
+ENDTEST
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
+unix
+unix
+eof
+
+dos
+dos
+eof
+
+mac mac
diff --git a/src/testdir/test30.ok b/src/testdir/test30.ok
new file mode 100644
index 000000000..c294483bd
--- /dev/null
+++ b/src/testdir/test30.ok
@@ -0,0 +1,96 @@
+unix
+unix
+dos
+dos
+mac mac
+1
+unix
+unix
+dos
+dos
+mac mac
+2
+unix
+unix
+ dos
+dos
+ mac mac 3
+unix
+unix
+dos
+dos
+mac mac
+unix
+unix
+dos
+dos
+mac mac
+unix
+unix
+dos
+dos
+mac mac 4
+unix
+unix
+dos
+dos
+mac mac
+unix
+unix
+mac mac
+dos
+dos
+mac mac
+5
+unix
+unix
+dos
+dos
+unix
+unix
+dos
+dos
+mac mac
+dos
+dos
+mac mac 6
+unix
+unix
+dos
+dos
+unix
+unix
+mac mac
+unix
+unix
+dos
+dos
+mac mac
+7
+unix
+unix
+dos
+dos
+mac mac
+8
+unix
+unix
+dos
+dos
+mac mac
+9
+unix
+unix
+dos
+dos
+mac mac unix
+unix
+dos
+dos
+mac mac unix
+unix
+dos
+dos
+mac mac 10
+unix
+unix
diff --git a/src/testdir/test31.in b/src/testdir/test31.in
new file mode 100644
index 000000000..cd4d08e81
--- /dev/null
+++ b/src/testdir/test31.in
@@ -0,0 +1,68 @@
+Test for commands that close windows and/or buffers:
+:quit
+:close
+:hide
+:only
+:sall
+:all
+:ball
+:buf
+:edit
+
+STARTTEST
+:so tiny.vim
+GA 1:$w! Xtest1
+$r2:$w! Xtest2
+$r3:$w! Xtest3
+:n! Xtest1 Xtest2
+A 1:set hidden
+:" test for working :n when hidden set; write "testtext 2"
+:n
+:w! test.out
+:" test for failing :rew when hidden not set; write "testtext 2 2"
+:set nohidden
+A 2:rew
+:w >>test.out
+:" test for working :rew when hidden set; write "testtext 1 1"
+:set hidden
+:rew
+:w >>test.out
+:" test for :all keeping a buffer when it's modified; write "testtext 1 1 1"
+:set nohidden
+A 1:sp
+:n Xtest2 Xtest3
+:all
+:w >>test.out
+:" test abandoning changed buffer, should be unloaded even when 'hidden' set
+:" write "testtext 2 2" twice
+:set hidden
+A 1:q!
+:w >>test.out
+:unhide
+:w >>test.out
+:" test ":hide" hides anyway when 'hidden' not set; write "testtext 3"
+:set nohidden
+A 2:hide
+:w >>test.out
+:" test ":edit" failing in modified buffer when 'hidden' not set
+:" write "testtext 3 3"
+A 3:e Xtest1
+:w >>test.out
+:" test ":edit" working in modified buffer when 'hidden' set; write "testtext 1"
+:set hidden
+:e Xtest1
+:w >>test.out
+:" test ":close" not hiding when 'hidden' not set in modified buffer;
+:" write "testtext 3 3 3"
+:sp Xtest3
+:set nohidden
+A 3:close
+:w >>test.out
+:" test ":close!" does hide when 'hidden' not set in modified buffer;
+:" write "testtext 1"
+A 3:close!
+:w >>test.out
+:qa!
+ENDTEST
+
+testtext
diff --git a/src/testdir/test31.ok b/src/testdir/test31.ok
new file mode 100644
index 000000000..3311ad5df
--- /dev/null
+++ b/src/testdir/test31.ok
@@ -0,0 +1,11 @@
+testtext 2
+testtext 2 2
+testtext 1 1
+testtext 1 1 1
+testtext 2 2
+testtext 2 2
+testtext 3
+testtext 3 3
+testtext 1
+testtext 3 3 3
+testtext 1
diff --git a/src/testdir/test32.in b/src/testdir/test32.in
new file mode 100644
index 000000000..0d5405184
--- /dev/null
+++ b/src/testdir/test32.in
@@ -0,0 +1,56 @@
+Test for insert expansion
+
+:se cpt=.,w
+* add-expands (word from next line) from other window
+* add-expands (current buffer first)
+* Local expansion, ends in an empty line (unless it becomes a global expansion)
+* starts Local and switches to global add-expansion
+:se cpt=.,w,i
+* i-add-expands and switches to local
+* add-expands lines (it would end in an empty line if it didn't ignored it self)
+:se cpt=kXtestfile
+* checks k-expansion, and file expansion (use Xtest11 instead of test11,
+* because TEST11.OUT may match first on DOS)
+:se cpt=w
+* checks make_cyclic in other window
+:se cpt=u nohid
+* checks unloaded buffer expansion
+* checks adding mode abortion
+:se cpt=t,d
+* tag expansion, define add-expansion interrupted
+* t-expansion
+
+STARTTEST
+:so small.vim
+:se nocp viminfo+=nviminfo cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
+nO#include "Xtestfile"
+ru
+O
+
+
+:se cpt=.,w,i
+kOM
+  
+:se cpt=kXtestfile
+:w Xtest11.one
+:w Xtest11.two
+OIXA
+:se cpt=w
+OST
+:se cpt=u nohid
+oOEN
+unl
+:se cpt=t,d def=^\\k* tags=Xtestfile notagbsearch
+O
+a
+:wq! test.out
+ENDTEST
+
+start of testfile
+run1
+run2
+end of testfile
+
+test11 36Gepeto /Tag/
+asd test11file 36G
+Makefile to run
diff --git a/src/testdir/test32.ok b/src/testdir/test32.ok
new file mode 100644
index 000000000..afc4463fa
--- /dev/null
+++ b/src/testdir/test32.ok
@@ -0,0 +1,15 @@
+#include "Xtestfile"
+run1 run3
+run3 run3
+
+Makefile to run3
+Makefile to run3
+Makefile to run3
+Xtest11.two
+STARTTEST
+ENDTEST
+unless
+test11file 36Gepeto /Tag/ asd
+asd
+run1 run2
+
diff --git a/src/testdir/test33.in b/src/testdir/test33.in
new file mode 100644
index 000000000..564476040
--- /dev/null
+++ b/src/testdir/test33.in
@@ -0,0 +1,34 @@
+Test for 'lisp'
+If the lisp feature is not enabled, this will fail!
+
+STARTTEST
+:so small.vim
+:set lisp
+/^(defun
+=G:/^(defun/,$w! test.out
+:q!
+ENDTEST
+
+(defun html-file (base)
+(format nil "~(~A~).html" base))
+
+(defmacro page (name title &rest body)
+(let ((ti (gensym)))
+`(with-open-file (*standard-output*
+(html-file ,name)
+:direction :output
+:if-exists :supersede)
+(let ((,ti ,title))
+(as title ,ti)
+(with center
+(as h2 (string-upcase ,ti)))
+(brs 3)
+,@body))))
+
+;;; Utilities for generating links
+
+(defmacro with-link (dest &rest body)
+`(progn
+(format t "<a href=\"~A\">" (html-file ,dest))
+,@body
+(princ "</a>")))
diff --git a/src/testdir/test33.ok b/src/testdir/test33.ok
new file mode 100644
index 000000000..cd1d87a14
--- /dev/null
+++ b/src/testdir/test33.ok
@@ -0,0 +1,23 @@
+(defun html-file (base)
+ (format nil "~(~A~).html" base))
+
+(defmacro page (name title &rest body)
+ (let ((ti (gensym)))
+ `(with-open-file (*standard-output*
+ (html-file ,name)
+ :direction :output
+ :if-exists :supersede)
+ (let ((,ti ,title))
+ (as title ,ti)
+ (with center
+ (as h2 (string-upcase ,ti)))
+ (brs 3)
+ ,@body))))
+
+;;; Utilities for generating links
+
+(defmacro with-link (dest &rest body)
+ `(progn
+ (format t "<a href=\"~A\">" (html-file ,dest))
+ ,@body
+ (princ "</a>")))
diff --git a/src/testdir/test34.in b/src/testdir/test34.in
new file mode 100644
index 000000000..676070075
--- /dev/null
+++ b/src/testdir/test34.in
@@ -0,0 +1,31 @@
+Test for user functions
+
+STARTTEST
+:so small.vim
+:function Table(title, ...)
+: let ret = a:title
+: let idx = 1
+: while idx <= a:0
+: exe "let ret = ret . a:" . idx
+: let idx = idx + 1
+: endwhile
+: return ret
+:endfunction
+:function Compute(n1, n2, divname)
+: if a:n2 == 0
+: return "fail"
+: endif
+: exe "let g:" . a:divname . " = ". a:n1 / a:n2
+: return "ok"
+:endfunction
+:let retval = "nop"
+/^here
+C=Table("xxx", 4, "asdf")
+ =Compute(45, 0, "retval")
+ =retval
+ =Compute(45, 5, "retval")
+ =retval
+:.wq! test.out
+ENDTEST
+
+here
diff --git a/src/testdir/test34.ok b/src/testdir/test34.ok
new file mode 100644
index 000000000..6dab52f1d
--- /dev/null
+++ b/src/testdir/test34.ok
@@ -0,0 +1 @@
+xxx4asdf fail nop ok 9
diff --git a/src/testdir/test35.in b/src/testdir/test35.in
new file mode 100644
index 000000000..ba97911a1
--- /dev/null
+++ b/src/testdir/test35.in
@@ -0,0 +1,21 @@
+Test Ctrl-A and Ctrl-X, which increment and decrement decimal, hexadecimal,
+and octal numbers.
+
+STARTTEST
+/^start-here
+:set nrformats=octal,hex
+j102ll64128$
+:set nrformats=octal
+0102l2w65129blx6lD
+:set nrformats=hex
+0101l257Txldt   
+:set nrformats=
+0200l100w78k
+:$-3,$wq! test.out
+ENDTEST
+
+start-here
+100 0x100 077 0
+100 0x100 077
+100 0x100 077 0xfF 0xFf
+100 0x100 077
diff --git a/src/testdir/test35.ok b/src/testdir/test35.ok
new file mode 100644
index 000000000..093ad958a
--- /dev/null
+++ b/src/testdir/test35.ok
@@ -0,0 +1,4 @@
+0 0x0ff 0000 -1
+0 1x100 0777777
+-1 0x0 078 0xFE 0xfe
+-100 -100x100 000
diff --git a/src/testdir/test36.in b/src/testdir/test36.in
new file mode 100644
index 000000000..4c3b6b42f
--- /dev/null
+++ b/src/testdir/test36.in
@@ -0,0 +1,40 @@
+Test character classes in regexp
+
+STARTTEST
+/^start-here
+j:s/\d//g
+j:s/\D//g
+j:s/\o//g
+j:s/\O//g
+j:s/\x//g
+j:s/\X//g
+j:s/\w//g
+j:s/\W//g
+j:s/\h//g
+j:s/\H//g
+j:s/\a//g
+j:s/\A//g
+j:s/\l//g
+j:s/\L//g
+j:s/\u//g
+j:s/\U//g
+:/^start-here/+1,$wq! test.out
+ENDTEST
+
+start-here
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
diff --git a/src/testdir/test36.ok b/src/testdir/test36.ok
new file mode 100644
index 000000000..5f70fc205
--- /dev/null
+++ b/src/testdir/test36.ok
@@ -0,0 +1,16 @@
+ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+0123456789
+ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+01234567
+ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~€‚›¦±¼ÇÓé
+0123456789ABCDEFabcdef
+ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~€‚›¦±¼ÇÓé
+0123456789ABCDEFGHIXYZ_abcdefghiwxyz
+ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~€‚›¦±¼ÇÓé
+ABCDEFGHIXYZ_abcdefghiwxyz
+ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~€‚›¦±¼ÇÓé
+ABCDEFGHIXYZabcdefghiwxyz
+ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~€‚›¦±¼ÇÓé
+abcdefghiwxyz
+ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~€‚›¦±¼ÇÓé
+ABCDEFGHIXYZ
diff --git a/src/testdir/test37.in b/src/testdir/test37.in
new file mode 100644
index 000000000..daaea32d0
--- /dev/null
+++ b/src/testdir/test37.in
@@ -0,0 +1,116 @@
+Test for 'scrollbind'. <eralston@computer.org>
+STARTTEST
+:so small.vim
+:set noscrollbind
+:set scrollopt=ver,jump
+:set scrolloff=2
+:set nowrap
+:set noequalalways
+:set splitbelow
+:" TEST using two windows open to one buffer, one extra empty window
+:split
+:new
+t:
+:resize 8
+/^start of window 1$/
+zt:
+:set scrollbind
+j:
+:resize 7
+/^start of window 2$/
+zt:
+:set scrollbind
+:" -- start of tests --
+:" TEST scrolling down
+L5jHyybpr0tHyybpr1tL6jHyybpr2kHyybpr3:
+:" TEST scrolling up
+tH4kjHtHyybpr4kHyybpr5k3ktHjHyybpr6tHyybpr7:
+:" TEST horizontal scrolling
+:set scrollopt+=hor
+gg"zyyG"zpGt015zly$bp"zpGky$bp"zpG:
+k10jH7zhg0y$bp"zpGtHg0y$bp"zpG:
+:set scrollopt-=hor
+:" ****** tests using two different buffers *****
+tj:
+:close
+t:
+:set noscrollbind
+:/^start of window 2$/,/^end of window 2$/y
+:new
+tj4"zpGp:
+t/^start of window 1$/
+zt:
+:set scrollbind
+j:
+/^start of window 2$/
+zt:
+:set scrollbind
+:" -- start of tests --
+:" TEST scrolling down
+L5jHyybpr0tHyybpr1tL6jHyybpr2kHyybpr3:
+:" TEST scrolling up
+tH4kjHtHyybpr4kHyybpr5k3ktHjHyybpr6tHyybpr7:
+:" TEST horizontal scrolling
+:set scrollopt+=hor
+gg"zyyG"zpGt015zly$bp"zpGky$bp"zpG:
+k10jH7zhg0y$bp"zpGtHg0y$bp"zpG:
+:set scrollopt-=hor
+:" TEST syncbind
+t:set noscb
+ggLj:set noscb
+ggL:set scb
+t:set scb
+GjG:syncbind
+HktHjHyybptyybp:
+t:set noscb
+ggLj:set noscb
+ggL:set scb
+t:set scb
+tGjGt:syncbind
+HkjHtHyybptjyybp:
+tH3kjHtHyybptjyybp:
+:" ***** done with tests *****
+:w! test.out " Write contents of this file
+:qa!
+ENDTEST
+
+
+start of window 1
+. line 01 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 01
+. line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
+. line 03 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 03
+. line 04 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 04
+. line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
+. line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
+. line 07 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 07
+. line 08 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 08
+. line 09 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 09
+. line 10 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 10
+. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
+. line 12 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 12
+. line 13 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 13
+. line 14 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 14
+. line 15 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 15
+end of window 1
+
+
+start of window 2
+. line 01 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 01
+. line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
+. line 03 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 03
+. line 04 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 04
+. line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
+. line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
+. line 07 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 07
+. line 08 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 08
+. line 09 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 09
+. line 10 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 10
+. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+. line 12 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 12
+. line 13 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 13
+. line 14 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 14
+. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
+. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
+end of window 2
+
+end of test37.in (please don't delete this line)
diff --git a/src/testdir/test37.ok b/src/testdir/test37.ok
new file mode 100644
index 000000000..a9092a402
--- /dev/null
+++ b/src/testdir/test37.ok
@@ -0,0 +1,33 @@
+
+0 line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
+1 line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
+2 line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
+3 line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+4 line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
+5 line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
+6 line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
+7 line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
+56789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
+UTSRQPONMLKJIHGREDCBA9876543210 02
+. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
+
+0 line 05 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 05
+1 line 05 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 05
+2 line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
+3 line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+4 line 06 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 06
+5 line 06 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 06
+6 line 02 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 02
+7 line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
+56789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02
+UTSRQPONMLKJIHGREDCBA9876543210 02
+. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
+. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11
+
+. line 16 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 16
+:set scrollbind
+zt:
+. line 15 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 15
+:set scrollbind
+. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11
diff --git a/src/testdir/test38.in b/src/testdir/test38.in
new file mode 100644
index 000000000..885bd0967
--- /dev/null
+++ b/src/testdir/test38.in
@@ -0,0 +1,33 @@
+
+Test Virtual replace mode.
+
+STARTTEST
+:so small.vim
+ggdGa
+abcdefghi
+jk lmn
+ opq rst
+uvwxyz
+gg:set ai
+:set bs=2
+gR0 1
+A
+BCDEFGHIJ
+ KL
+MNO
+PQRG:ka
+o0
+abcdefghi
+jk lmn
+ opq rst
+uvwxyz
+'ajgR0 1
+A
+BCDEFGHIJ
+ KL
+MNO
+PQR:$
+iab cdefghi jkl0gRAB......CDEFGHI.Jo:
+iabcdefghijklmnopqrst0gRAB IJKLMNO QR:wq! test.out
+ENDTEST
+
diff --git a/src/testdir/test38.ok b/src/testdir/test38.ok
new file mode 100644
index 000000000..e10209667
--- /dev/null
+++ b/src/testdir/test38.ok
@@ -0,0 +1,13 @@
+ 1
+ A
+ BCDEFGHIJ
+ KL
+ MNO
+ PQR
+ 1
+abcdefghi
+jk lmn
+ opq rst
+uvwxyz
+AB......CDEFGHI.Jkl
+AB IJKLMNO QRst
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
new file mode 100644
index 000000000..d7f294b3c
--- /dev/null
+++ b/src/testdir/test39.in
@@ -0,0 +1,24 @@
+
+Test Visual block mode commands
+
+STARTTEST
+:so small.vim
+/^abcde
+:" Test shift-right of a block
+jlllljj>wlljlll>
+:" Test shift-left of a block
+G$hhhhkk<
+:" Test block-insert
+GklkkkIxyz
+:" Test block-replace
+Gllllkkklllrq
+:" Test block-change
+G$khhhhhkkcmno
+:$-4,$wq! test.out
+ENDTEST
+
+abcdefghijklm
+abcdefghijklm
+abcdefghijklm
+abcdefghijklm
+abcdefghijklm
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
new file mode 100644
index 000000000..6fa2867eb
--- /dev/null
+++ b/src/testdir/test39.ok
@@ -0,0 +1,5 @@
+axyzbcdefghijklm
+axyzqqqq mno ghijklm
+axyzqqqqef mno ghijklm
+axyzqqqqefgmnoklm
+abcdqqqqijklm
diff --git a/src/testdir/test4.in b/src/testdir/test4.in
new file mode 100644
index 000000000..4aa2fe5a8
--- /dev/null
+++ b/src/testdir/test4.in
@@ -0,0 +1,31 @@
+Test for autocommand that changes current buffer on BufEnter event.
+Check if modelines are interpreted for the correct buffer.
+
+STARTTEST
+:so small.vim
+:set nocompatible viminfo+=nviminfo
+:au BufEnter Xxx brew
+/start of
+:.,/end of/w! Xxx " write test file Xxx
+:set ai modeline modelines=3
+:sp Xxx " split to Xxx, autocmd will do :brew
+G?this is a
+othis should be auto-indented
+: " Append text with autoindent to this file
+:au! BufEnter Xxx
+:buf Xxx " go to Xxx, no autocmd anymore
+G?this is a
+othis should be in column 1:wq " append text without autoindent to Xxx
+G:r Xxx " include Xxx in the current file
+:?startstart?,$w! test.out
+:qa!
+ENDTEST
+
+startstart
+start of test file Xxx
+vim: set noai :
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test4.ok b/src/testdir/test4.ok
new file mode 100644
index 000000000..dffecda4d
--- /dev/null
+++ b/src/testdir/test4.ok
@@ -0,0 +1,17 @@
+startstart
+start of test file Xxx
+vim: set noai :
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+ this should be auto-indented
+end of test file Xxx
+start of test file Xxx
+vim: set noai :
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+this should be in column 1
+end of test file Xxx
diff --git a/src/testdir/test40.in b/src/testdir/test40.in
new file mode 100644
index 000000000..f6fb61245
--- /dev/null
+++ b/src/testdir/test40.in
@@ -0,0 +1,63 @@
+Test for "*Cmd" autocommands
+
+STARTTEST
+:so small.vim
+:/^start/,$w! Xxx " write lines below to Xxx
+:au BufReadCmd testA 0r Xxx|$del
+:e testA " will read text of Xxd instead
+:au BufWriteCmd testA call append(line("$"), "write")
+:w " will append a line to the file
+:r testA " should not read anything
+: " now we have:
+: " 1 start of Xxx
+: " 2 test40
+: " 3 end of Xxx
+: " 4 write
+:au FileReadCmd testB '[r Xxx
+:2r testB " will read Xxx below line 2 instead
+: " 1 start of Xxx
+: " 2 test40
+: " 3 start of Xxx
+: " 4 test40
+: " 5 end of Xxx
+: " 6 end of Xxx
+: " 7 write
+:au FileWriteCmd testC '[,']copy $
+4GA1
+:4,5w testC " will copy lines 4 and 5 to the end
+:r testC " should not read anything
+: " 1 start of Xxx
+: " 2 test40
+: " 3 start of Xxx
+: " 4 test401
+: " 5 end of Xxx
+: " 6 end of Xxx
+: " 7 write
+: " 8 test401
+: " 9 end of Xxx
+:au FILEAppendCmd testD '[,']w! test.out
+:w >>testD " will write all lines to test.out
+:$r testD " should not read anything
+:$w >>test.out " append "end of Xxx" to test.out
+:au BufReadCmd testE 0r test.out|$del
+:sp testE " split window with test.out
+5Goasdf:"
+:au BufWriteCmd testE w! test.out
+:wall " will write other window to test.out
+: " 1 start of Xxx
+: " 2 test40
+: " 3 start of Xxx
+: " 4 test401
+: " 5 end of Xxx
+: " 6 asdf
+: " 7 end of Xxx
+: " 8 write
+: " 9 test401
+: " 10 end of Xxx
+: " 11 end of Xxx
+:qa!
+ENDTEST
+
+start of Xxx
+ test40
+end of Xxx
diff --git a/src/testdir/test40.ok b/src/testdir/test40.ok
new file mode 100644
index 000000000..b6501394f
--- /dev/null
+++ b/src/testdir/test40.ok
@@ -0,0 +1,11 @@
+start of Xxx
+ test40
+start of Xxx
+ test401
+end of Xxx
+asdf
+end of Xxx
+write
+ test401
+end of Xxx
+end of Xxx
diff --git a/src/testdir/test41.in b/src/testdir/test41.in
new file mode 100644
index 000000000..2d294cae0
--- /dev/null
+++ b/src/testdir/test41.in
@@ -0,0 +1,24 @@
+Test for writing and reading a file of over 100 Kbyte
+
+1 line: "This is the start"
+3001 lines: "This is the leader"
+1 line: "This is the middle"
+3001 lines: "This is the trailer"
+1 line: "This is the end"
+
+STARTTEST
+:%d
+aThis is the start
+This is the leader
+This is the middle
+This is the trailer
+This is the endkY3000p2GY3000p
+:w! Xtest
+:%d
+:e! Xtest
+:.w! test.out
+3003G:.w >>test.out
+6005G:.w >>test.out
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test41.ok b/src/testdir/test41.ok
new file mode 100644
index 000000000..988e5f24b
--- /dev/null
+++ b/src/testdir/test41.ok
@@ -0,0 +1,3 @@
+This is the start
+This is the middle
+This is the end
diff --git a/src/testdir/test42.in b/src/testdir/test42.in
new file mode 100644
index 000000000..c35569a76
--- /dev/null
+++ b/src/testdir/test42.in
Binary files differ
diff --git a/src/testdir/test42.ok b/src/testdir/test42.ok
new file mode 100644
index 000000000..16f41e46e
--- /dev/null
+++ b/src/testdir/test42.ok
Binary files differ
diff --git a/src/testdir/test43.in b/src/testdir/test43.in
new file mode 100644
index 000000000..26f0e0c9a
--- /dev/null
+++ b/src/testdir/test43.in
@@ -0,0 +1,27 @@
+Tests for regexp with various magic settings.
+
+STARTTEST
+:set nocompatible viminfo+=nviminfo
+/^1
+/a*b\{2}c\+/e
+x/\Md\*e\{2}f\+/e
+x:set nomagic
+/g\*h\{2}i\+/e
+x/\mj*k\{2}l\+/e
+x/\vm*n{2}o+/e
+x/\V^aa$
+x:set magic
+/\v(a)(b)\2\1\1/e
+x/\V[ab]\(\[xy]\)\1
+x:?^1?,$w! test.out
+:qa!
+ENDTEST
+
+1 a aa abb abbccc
+2 d dd dee deefff
+3 g gg ghh ghhiii
+4 j jj jkk jkklll
+5 m mm mnn mnnooo
+6 x ^aa$ x
+7 (a)(b) abbaa
+8 axx [ab]xx
diff --git a/src/testdir/test43.ok b/src/testdir/test43.ok
new file mode 100644
index 000000000..425316b68
--- /dev/null
+++ b/src/testdir/test43.ok
@@ -0,0 +1,8 @@
+1 a aa abb abbcc
+2 d dd dee deeff
+3 g gg ghh ghhii
+4 j jj jkk jkkll
+5 m mm mnn mnnoo
+6 x aa$ x
+7 (a)(b) abba
+8 axx ab]xx
diff --git a/src/testdir/test44.in b/src/testdir/test44.in
new file mode 100644
index 000000000..d90a962d3
--- /dev/null
+++ b/src/testdir/test44.in
@@ -0,0 +1,37 @@
+Tests for regexp with multi-byte encoding and various magic settings.
+
+STARTTEST
+:so mbyte.vim
+:set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo
+/^1
+/a*b\{2}c\+/e
+x/\Md\*e\{2}f\+/e
+x:set nomagic
+/g\*h\{2}i\+/e
+x/\mj*k\{2}l\+/e
+x/\vm*n{2}o+/e
+x/\V^aa$
+x:set magic
+/\v(a)(b)\2\1\1/e
+x/\V[ab]\(\[xy]\)\1
+x:" Now search for multi-byte without composing char
+/ม
+x:" Now search for multi-byte with composing char
+/ม่
+x:" find word by change of word class
+/ã¡\<カヨ\>ã¯
+x:?^1?,$w! test.out
+:qa!
+ENDTEST
+
+1 a aa abb abbccc
+2 d dd dee deefff
+3 g gg ghh ghhiii
+4 j jj jkk jkklll
+5 m mm mnn mnnooo
+6 x ^aa$ x
+7 (a)(b) abbaa
+8 axx [ab]xx
+9 หม่x อมx
+a อมx หม่x
+b ã¡ã‚«ãƒ¨ã¯
diff --git a/src/testdir/test44.ok b/src/testdir/test44.ok
new file mode 100644
index 000000000..af8507606
--- /dev/null
+++ b/src/testdir/test44.ok
@@ -0,0 +1,11 @@
+1 a aa abb abbcc
+2 d dd dee deeff
+3 g gg ghh ghhii
+4 j jj jkk jkkll
+5 m mm mnn mnnoo
+6 x aa$ x
+7 (a)(b) abba
+8 axx ab]xx
+9 หม่x อx
+a อมx หx
+b カヨã¯
diff --git a/src/testdir/test45.in b/src/testdir/test45.in
new file mode 100644
index 000000000..58537f33d
--- /dev/null
+++ b/src/testdir/test45.in
@@ -0,0 +1,72 @@
+Tests for folding. vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:" We also need the +syntax feature here.
+:if !has("syntax")
+ e! test.ok
+ w! test.out
+ qa!
+:endif
+:" basic test if a fold can be created, opened, moving to the end and closed
+/^1
+zf2j:call append("$", "manual " . getline(foldclosed(".")))
+zo:call append("$", foldclosed("."))
+]z:call append("$", getline("."))
+zc:call append("$", getline(foldclosed(".")))
+:" test folding with markers.
+:set fdm=marker fdl=1 fdc=3
+/^5
+:call append("$", "marker " . foldlevel("."))
+[z:call append("$", foldlevel("."))
+jo{{ r{jj:call append("$", foldlevel("."))
+kYpj:call append("$", foldlevel("."))
+:" test folding with indent
+:set fdm=indent sw=2
+/^2 b
+i jI :call append("$", "indent " . foldlevel("."))
+k:call append("$", foldlevel("."))
+:" test syntax folding
+:set fdm=syntax fdl=0
+:syn region Hup start="dd" end="hh" fold
+Gzk:call append("$", "folding " . getline("."))
+k:call append("$", getline("."))
+:" test expression folding
+:fun Flvl()
+ let l = getline(v:lnum)
+ if l =~ "bb$"
+ return 2
+ elseif l =~ "gg$"
+ return "s1"
+ elseif l =~ "ii$"
+ return ">2"
+ elseif l =~ "kk$"
+ return "0"
+ endif
+ return "="
+endfun
+:set fdm=expr fde=Flvl()
+/bb$
+:call append("$", "expr " . foldlevel("."))
+/hh$
+:call append("$", foldlevel("."))
+/ii$
+:call append("$", foldlevel("."))
+/kk$
+:call append("$", foldlevel("."))
+:/^last/+1,$w! test.out
+:qa!
+ENDTEST
+
+1 aa
+2 bb
+3 cc
+4 dd {{{
+5 ee {{{ }}}
+6 ff }}}
+7 gg
+8 hh
+9 ii
+a jj
+b kk
+last
diff --git a/src/testdir/test45.ok b/src/testdir/test45.ok
new file mode 100644
index 000000000..f5a1380e5
--- /dev/null
+++ b/src/testdir/test45.ok
@@ -0,0 +1,16 @@
+manual 1 aa
+-1
+3 cc
+1 aa
+marker 2
+1
+1
+0
+indent 2
+1
+folding 8 hh
+ 3 cc
+expr 2
+1
+2
+0
diff --git a/src/testdir/test46.in b/src/testdir/test46.in
new file mode 100644
index 000000000..9a9db74d6
--- /dev/null
+++ b/src/testdir/test46.in
@@ -0,0 +1,27 @@
+Tests for multi-line regexps with ":s". vim: set ft=vim :
+
+STARTTEST
+:" test if replacing a line break works with a back reference
+:/^1/,/^2/s/\n\(.\)/ \1/
+:" test if inserting a line break works with a back reference
+:/^3/,/^4/s/\(.\)$/\r\1/
+:" test if replacing a line break with another line break works
+:/^5/,/^6/s/\(\_d\{3}\)/x\1x/
+:/^1/,$w! test.out
+:qa!
+ENDTEST
+
+1 aa
+bb
+cc
+2 dd
+ee
+3 ef
+gh
+4 ij
+5 a8
+8b c9
+9d
+6 e7
+77f
+xxxxx
diff --git a/src/testdir/test46.ok b/src/testdir/test46.ok
new file mode 100644
index 000000000..71b353df1
--- /dev/null
+++ b/src/testdir/test46.ok
@@ -0,0 +1,13 @@
+1 aa bb cc 2 dd ee
+3 e
+f
+g
+h
+4 i
+j
+5 ax8
+8xb cx9
+9xd
+6 ex7
+7x7f
+xxxxx
diff --git a/src/testdir/test47.in b/src/testdir/test47.in
new file mode 100644
index 000000000..35bb9f260
--- /dev/null
+++ b/src/testdir/test47.in
@@ -0,0 +1,44 @@
+Tests for vertical splits and filler lines in diff mode
+
+STARTTEST
+:so small.vim
+/^1
+yG:new
+pkdd:w! Xtest
+ddGpkkrXoxxx:w! Xtest2
+:file Nop
+ggoyyyjjjozzzz
+:vert diffsplit Xtest
+:vert diffsplit Xtest2
+:" jump to second window for a moment to have filler line appear at start of
+:" first window
+ggpgg:let one = winline()
+j:let one = one . "-" . winline()
+j:let one = one . "-" . winline()
+j:let one = one . "-" . winline()
+j:let one = one . "-" . winline()
+j:let one = one . "-" . winline()
+gg:let two = winline()
+j:let two = two . "-" . winline()
+j:let two = two . "-" . winline()
+j:let two = two . "-" . winline()
+j:let two = two . "-" . winline()
+gg:let three = winline()
+j:let three = three . "-" . winline()
+j:let three = three . "-" . winline()
+j:let three = three . "-" . winline()
+j:let three = three . "-" . winline()
+j:let three = three . "-" . winline()
+j:let three = three . "-" . winline()
+:call append("$", one)
+:call append("$", two)
+:call append("$", three)
+:$-2,$w! test.out
+:qa!
+ENDTEST
+
+1 aa
+2 bb
+3 cc
+4 dd
+5 ee
diff --git a/src/testdir/test47.ok b/src/testdir/test47.ok
new file mode 100644
index 000000000..3307b934e
--- /dev/null
+++ b/src/testdir/test47.ok
@@ -0,0 +1,3 @@
+2-4-5-6-8-9
+1-2-4-5-8
+2-3-4-5-6-7-8
diff --git a/src/testdir/test48.in b/src/testdir/test48.in
new file mode 100644
index 000000000..2179fe664
--- /dev/null
+++ b/src/testdir/test48.in
@@ -0,0 +1,74 @@
+This is a test of 'virtualedit'.
+
+STARTTEST
+:so small.vim
+:set noswf
+:set ve=all
+-dgg
+:"
+:" Insert "keyword keyw", ESC, C CTRL-N, shows "keyword ykeyword".
+:" Repeating CTRL-N fixes it. (Mary Ellen Foster)
+2/w
+C
+:"
+:" Using "C" then then <CR> moves the last remaining character to the next
+:" line. (Mary Ellen Foster)
+j^/are
+C are belong to vim
+:"
+:" When past the end of a line that ends in a single character "b" skips
+:" that word.
+^$15lbC7
+:"
+:" Make sure 'i' works
+$4li<-- should be 3 ' '
+:"
+:" Make sure 'C' works
+$4lC<-- should be 3 ' '
+:"
+:" Make sure 'a' works
+$4la<-- should be 4 ' '
+:"
+:" Make sure 'A' works
+$4lA<-- should be 0 ' '
+:"
+:" Make sure 'D' works
+$4lDi<-- 'D' should be intact
+:"
+:" Test for yank bug reported by Mark Waggoner.
+:set ve=block
+^2w3jyGp
+:"
+:" Test "r" beyond the end of the line
+:set ve=all
+/^"r"
+$5lrxa<-- should be 'x'
+:"
+:" Test to make sure 'x' can delete control characters
+:set display=uhex
+^xxxxxxi[This line should contain only the text between the brackets.]
+:set display=
+:"
+:" Test for ^Y/^E due to bad w_virtcol value, reported by
+:" Roy <royl@netropolis.net>.
+^O3li4li4li <-- should show the name of a noted text editor
+^o4li4li4li <-- and its version number-dd
+:"
+:wq! test.out
+ENDTEST
+keyword keyw
+all your base are belong to us
+1 2 3 4 5 6
+'i'
+'C'
+'a'
+'A'
+'D'
+this is a test
+this is a test
+this is a test
+"r"
+ab sd
+abcv6efi.him0kl
+
+
diff --git a/src/testdir/test48.ok b/src/testdir/test48.ok
new file mode 100644
index 000000000..4fcbe5086
--- /dev/null
+++ b/src/testdir/test48.ok
@@ -0,0 +1,21 @@
+keyword keyword
+all your base
+are belong to vim
+1 2 3 4 5 7
+'i' <-- should be 3 ' '
+'C' <-- should be 3 ' '
+'a' <-- should be 4 ' '
+'A'<-- should be 0 ' '
+'D' <-- 'D' should be intact
+this is a test
+this is a test
+this is a test
+"r" x<-- should be 'x'
+[This line should contain only the text between the brackets.]
+ v i m <-- should show the name of a noted text editor
+ 6 . 0 <-- and its version number
+
+a
+a
+a
+
diff --git a/src/testdir/test49.in b/src/testdir/test49.in
new file mode 100644
index 000000000..ec17d2134
--- /dev/null
+++ b/src/testdir/test49.in
@@ -0,0 +1,13 @@
+This is a test of the script language.
+
+If after adding a new test, the test output doesn't appear properly in
+test49.failed, try to add one ore more "G"s at the line before ENDTEST.
+
+STARTTEST
+:so small.vim
+:se nocp nomore viminfo+=nviminfo
+:so test49.vim
+GGGGGGGGGG"rp:.-,$wq! test.out
+ENDTEST
+
+Results of test49.vim:
diff --git a/src/testdir/test49.ok b/src/testdir/test49.ok
new file mode 100644
index 000000000..1842af259
--- /dev/null
+++ b/src/testdir/test49.ok
@@ -0,0 +1,92 @@
+Results of test49.vim:
+*** Test 1: OK (34695)
+*** Test 2: OK (34695)
+*** Test 3: OK (1384648195)
+*** Test 4: OK (32883)
+*** Test 5: OK (32883)
+*** Test 6: OK (603978947)
+*** Test 7: OK (90563)
+*** Test 8: OK (562493431)
+*** Test 9: OK (363)
+*** Test 10: OK (559615)
+*** Test 11: OK (2049)
+*** Test 12: OK (352256)
+*** Test 13: OK (145)
+*** Test 14: OK (42413)
+*** Test 15: OK (42413)
+*** Test 16: OK (8722)
+*** Test 17: OK (285127993)
+*** Test 18: OK (67224583)
+*** Test 19: OK (69275973)
+*** Test 20: OK (1874575085)
+*** Test 21: OK (147932225)
+*** Test 22: OK (4161)
+*** Test 23: OK (49)
+*** Test 24: OK (41)
+*** Test 25: OK (260177811)
+*** Test 26: OK (1681500476)
+*** Test 27: OK (1996459)
+*** Test 28: OK (1996459)
+*** Test 29: OK (170428555)
+*** Test 30: OK (190905173)
+*** Test 31: OK (190905173)
+*** Test 32: OK (354833067)
+--- Test 33: sum = 178275600 (ok)
+*** Test 33: OK (1216907538)
+*** Test 34: OK (2146584868)
+*** Test 35: OK (2146584868)
+*** Test 36: OK (1071644672)
+*** Test 37: OK (1071644672)
+*** Test 38: OK (357908480)
+*** Test 39: OK (357908480)
+*** Test 40: OK (357908480)
+*** Test 41: OK (3076095)
+*** Test 42: OK (1505155949)
+*** Test 43: OK (1157763329)
+*** Test 44: OK (1031761407)
+*** Test 45: OK (1157763329)
+*** Test 46: OK (739407)
+*** Test 47: OK (371213935)
+*** Test 48: OK (756255461)
+*** Test 49: OK (179000669)
+*** Test 50: OK (363550045)
+*** Test 51: OK (40744667)
+*** Test 52: OK (1247112011)
+*** Test 53: OK (131071)
+*** Test 54: OK (2047)
+*** Test 55: OK (1023)
+*** Test 56: OK (511)
+*** Test 57: OK (2147450880)
+*** Test 58: OK (624945)
+*** Test 59: OK (2038431743)
+*** Test 60: OK (311511339)
+*** Test 61: OK (374889517)
+*** Test 62: OK (286331153)
+*** Test 63: OK (236978127)
+*** Test 64: OK (1499645335)
+*** Test 65: OK (70187)
+*** Test 66: OK (5464)
+*** Test 67: OK (212514423)
+*** Test 68: OK (212514423)
+*** Test 69: OK (8995471)
+*** Test 70: OK (69544277)
+*** Test 71: OK (34886997)
+*** Test 72: OK (1789569365)
+*** Test 73: OK (9032615)
+*** Test 74: OK (224907669)
+*** Test 75: OK (2000403408)
+*** Test 76: OK (1610087935)
+*** Test 77: OK (1388671)
+*** Test 78: OK (134217728)
+*** Test 79: OK (70288929)
+*** Test 80: OK (17895765)
+*** Test 81: OK (387)
+*** Test 82: OK (8454401)
+*** Test 83: OK (2835)
+*** Test 84: OK (934782101)
+*** Test 85: OK (198689)
+--- Test 86: All tests were run with throwing exceptions on error.
+ The $VIMNOERRTHROW control is not configured.
+--- Test 86: All tests were run with throwing exceptions on interrupt.
+ The $VIMNOINTTHROW control is not configured.
+*** Test 86: OK (50443995)
diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim
new file mode 100644
index 000000000..e742a9622
--- /dev/null
+++ b/src/testdir/test49.vim
@@ -0,0 +1,9666 @@
+" Vim script language tests
+" Author: Servatius Brandt <Servatius.Brandt@fujitsu-siemens.com>
+" Last Change: 2004 Apr 03
+
+"-------------------------------------------------------------------------------
+" Test environment {{{1
+"-------------------------------------------------------------------------------
+
+
+" Adding new tests easily. {{{2
+"
+" Writing new tests is eased considerably with the following functions and
+" abbreviations (see "Commands for recording the execution path", "Automatic
+" argument generation").
+"
+" To get the abbreviations, execute the command
+"
+" :let test49_set_env = 1 | source test49.vim
+"
+" To get them always (from src/testdir), put a line
+"
+" au! BufRead test49.vim let test49_set_env = 1 | source test49.vim
+"
+" into the local .vimrc file in the src/testdir directory.
+"
+if exists("test49_set_env") && test49_set_env
+
+ " Automatic argument generation for the test environment commands.
+
+ function! Xsum()
+ let addend = substitute(getline("."), '^.*"\s*X:\s*\|^.*', '', "")
+ " Evaluate arithmetic expression.
+ if addend != ""
+ exec "let g:Xsum = g:Xsum + " . addend
+ endif
+ endfunction
+
+ function! Xcheck()
+ let g:Xsum=0
+ ?XpathINIT?,.call Xsum()
+ exec "norm A "
+ return g:Xsum
+ endfunction
+
+ iab Xcheck Xcheck<Space><C-R>=Xcheck()<CR><C-O>x
+
+ function! Xcomment(num)
+ let str = ""
+ let tabwidth = &sts ? &sts : &ts
+ let tabs = (48+tabwidth - a:num - virtcol(".")) / tabwidth
+ while tabs > 0
+ let str = str . "\t"
+ let tabs = tabs - 1
+ endwhile
+ let str = str . '" X:'
+ return str
+ endfunction
+
+ function! Xloop()
+ let back = line(".") . "|norm" . virtcol(".") . "|"
+ norm 0
+ let last = search('X\(loop\|path\)INIT\|Xloop\>', "bW")
+ exec back
+ let theline = getline(last)
+ if theline =~ 'X\(loop\|path\)INIT'
+ let num = 1
+ else
+ let num = 2 * substitute(theline, '.*Xloop\s*\(\d\+\).*', '\1', "")
+ endif
+ ?X\(loop\|path\)INIT?
+ \s/\(XloopINIT!\=\s*\d\+\s\+\)\@<=\(\d\+\)/\=2*submatch(2)/
+ exec back
+ exec "norm a "
+ return num . Xcomment(strlen(num))
+ endfunction
+
+ iab Xloop Xloop<Space><C-R>=Xloop()<CR><C-O>x
+
+ function! Xpath(loopinit)
+ let back = line(".") . "|norm" . virtcol(".") . "|"
+ norm 0
+ let last = search('XpathINIT\|Xpath\>\|XloopINIT', "bW")
+ exec back
+ let theline = getline(last)
+ if theline =~ 'XpathINIT'
+ let num = 1
+ elseif theline =~ 'Xpath\>'
+ let num = 2 * substitute(theline, '.*Xpath\s*\(\d\+\).*', '\1', "")
+ else
+ let pattern = '.*XloopINIT!\=\s*\(\d\+\)\s*\(\d\+\).*'
+ let num = substitute(theline, pattern, '\1', "")
+ let factor = substitute(theline, pattern, '\2', "")
+ " The "<C-O>x" from the "Xpath" iab and the character triggering its
+ " expansion are in the input buffer. Save and clear typeahead so
+ " that it is not read away by the call to "input()" below. Restore
+ " afterwards.
+ call inputsave()
+ let loops = input("Number of iterations in previous loop? ")
+ call inputrestore()
+ while (loops > 0)
+ let num = num * factor
+ let loops = loops - 1
+ endwhile
+ endif
+ exec "norm a "
+ if a:loopinit
+ return num . " 1"
+ endif
+ return num . Xcomment(strlen(num))
+ endfunction
+
+ iab Xpath Xpath<Space><C-R>=Xpath(0)<CR><C-O>x
+ iab XloopINIT XloopINIT<Space><C-R>=Xpath(1)<CR><C-O>x
+
+ " Also useful (see ExtraVim below):
+ aug ExtraVim
+ au!
+ au BufEnter <sfile> syn region ExtraVim
+ \ start=+^if\s\+ExtraVim(.*)+ end=+^endif+
+ \ transparent keepend
+ au BufEnter <sfile> syn match ExtraComment /^"/
+ \ contained containedin=ExtraVim
+ au BufEnter <sfile> hi link ExtraComment vimComment
+ aug END
+
+ aug Xpath
+ au BufEnter <sfile> syn keyword Xpath
+ \ XpathINIT Xpath XloopINIT Xloop XloopNEXT Xcheck Xout
+ au BufEnter <sfile> hi link Xpath Special
+ aug END
+
+ do BufEnter <sfile>
+
+ " Do not execute the tests when sourcing this file for getting the functions
+ " and abbreviations above, which are intended for easily adding new test
+ " cases; they are not needed for test execution. Unlet the variable
+ " controlling this so that an explicit ":source" command for this file will
+ " execute the tests.
+ unlet test49_set_env
+ finish
+
+endif
+
+
+" Commands for recording the execution path. {{{2
+"
+" The Xpath/Xloop commands can be used for computing the eXecution path by
+" adding (different) powers of 2 from those script lines, for which the
+" execution should be checked. Xloop provides different addends for each
+" execution of a loop. Permittable values are 2^0 to 2^30, so that 31 execution
+" points (multiply counted inside loops) can be tested.
+"
+" Note that the arguments of the following commands can be generated
+" automatically, see below.
+"
+" Usage: {{{3
+"
+" - Use XpathINIT at the beginning of the test.
+"
+" - Use Xpath to check if a line is executed.
+" Argument: power of 2 (decimal).
+"
+" - To check multiple execution of loops use Xloop for automatically
+" computing Xpath values:
+"
+" - Use XloopINIT before the loop.
+" Two arguments:
+" - the first Xpath value (power of 2) to be used (Xnext),
+" - factor for computing a new Xnext value when reexecuting a loop
+" (by a ":continue" or ":endwhile"); this should be 2^n where
+" n is the number of Xloop commands inside the loop.
+" If XloopINIT! is used, the first execution of XloopNEXT is
+" a no-operation.
+"
+" - Use Xloop inside the loop:
+" One argument:
+" The argument and the Xnext value are multiplied to build the
+" next Xpath value. No new Xnext value is prepared. The argument
+" should be 2^(n-1) for the nth Xloop command inside the loop.
+" If the loop has only one Xloop command, the argument can be
+" ommitted (default: 1).
+"
+" - Use XloopNEXT before ":continue" and ":endwhile". This computes a new
+" Xnext value for the next execution of the loop by multiplying the old
+" one with the factor specified in the XloopINIT command. No Argument.
+" Alternatively, when XloopINIT! is used, a single XloopNEXT at the
+" beginning of the loop can be used.
+"
+" Nested loops are not supported.
+"
+" - Use Xcheck at end of each test. It prints the test number, the expected
+" execution path value, the test result ("OK" or "FAIL"), and, if the tests
+" fails, the actual execution path.
+" One argument:
+" Expected Xpath/Xloop sum for the correct execution path.
+" In order that this value can be computed automatically, do the
+" following: For each line in the test with an Xpath and Xloop
+" command, add a comment starting with "X:" and specifying an
+" expression that evaluates to the value contributed by this line to
+" the correct execution path. (For copying an Xpath argument of at
+" least two digits into the comment, press <C-P>.) At the end of the
+" test, just type "Xcheck" and press <Esc>.
+"
+" - In order to add additional information to the test output file, use the
+" Xout command. Argument(s) like ":echo".
+"
+" Automatic argument generation: {{{3
+"
+" The arguments of the Xpath, XloopINIT, Xloop, and Xcheck commands can be
+" generated automatically, so that new tests can easily be written without
+" mental arithmetic. The Xcheck argument is computed from the "X:" comments
+" of the preceding Xpath and Xloop commands. See the commands and
+" abbreviations at the beginning of this file.
+"
+" Implementation: {{{3
+" XpathINIT, Xpath, XloopINIT, Xloop, XloopNEXT, Xcheck, Xout.
+"
+" The variants for existing g:ExtraVimResult are needed when executing a script
+" in an extra Vim process, see ExtraVim below.
+
+" EXTRA_VIM_START - do not change or remove this line.
+
+com! XpathINIT let g:Xpath = 0
+
+if exists("g:ExtraVimResult")
+ com! -count -bar Xpath exec "!echo <count> >>" . g:ExtraVimResult
+else
+ com! -count -bar Xpath let g:Xpath = g:Xpath + <count>
+endif
+
+com! -count -nargs=1 -bang
+ \ XloopINIT let g:Xnext = <count> |
+ \ let g:Xfactor = <args> |
+ \ let g:Xskip = strlen("<bang>")
+
+if exists("g:ExtraVimResult")
+ com! -count=1 -bar Xloop exec "!echo " . (g:Xnext * <count>) . " >>" .
+ \ g:ExtraVimResult
+else
+ com! -count=1 -bar Xloop let g:Xpath = g:Xpath + g:Xnext * <count>
+endif
+
+com! XloopNEXT let g:Xnext = g:Xnext *
+ \ (g:Xskip ? 1 : g:Xfactor) |
+ \ let g:Xskip = 0
+
+let @r = ""
+let Xtest = 1
+com! -count Xcheck let Xresult = "*** Test " .
+ \ (Xtest<10?" ":Xtest<100?" ":"") .
+ \ Xtest . ": " . (
+ \ (Xpath==<count>) ? "OK (".Xpath.")" :
+ \ "FAIL (".Xpath." instead of <count>)"
+ \ ) |
+ \ let @R = Xresult . "\n" |
+ \ echo Xresult |
+ \ let Xtest = Xtest + 1
+
+if exists("g:ExtraVimResult")
+ com! -nargs=+ Xout exec "exec \"!echo @R:'\" ."
+ \ 'substitute(substitute("' . <args> .
+ \ '", "' . "'" . '", ' . "'" . '&\\&&' . "'"
+ \ . ', "g"), "\n", "@NL@", "g")'
+ \ ". \"' >>\" . g:ExtraVimResult"
+else
+ com! -nargs=+ Xout exec 'let @R = "--- Test ' .
+ \ (g:Xtest<10?" ":g:Xtest<100?" ":"") .
+ \ g:Xtest . ": " .
+ \ '" . substitute("' . <args> .
+ \ '", "\n", "&\t ", "g") . "\n"'
+endif
+
+" Switch off storing of lines for undoing changes. Speeds things up a little.
+set undolevels=-1
+
+" EXTRA_VIM_STOP - do not change or remove this line.
+
+
+" ExtraVim() - Run a script file in an extra Vim process. {{{2
+"
+" This is useful for testing immediate abortion of the script processing due to
+" an error in a command dynamically enclosed by a :try/:tryend region or when an
+" exception is thrown but not caught or when an interrupt occurs. It can also
+" be used for testing :finish.
+"
+" An interrupt location can be specified by an "INTERRUPT" comment. A number
+" telling how often this location is reached (in a loop or in several function
+" calls) should be specified as argument. When missing, once per script
+" invocation or function call is assumed. INTERRUPT locations are tested by
+" setting a breakpoint in that line and using the ">quit" debug command when
+" the breakpoint is reached. A function for which an INTERRUPT location is
+" specified must be defined before calling it (or executing it as a script by
+" using ExecAsScript below).
+"
+" This function is only called in normal modus ("g:ExtraVimResult" undefined).
+"
+" Tests to be executed as an extra script should be written as follows:
+"
+" column 1 column 1
+" | |
+" v v
+"
+" XpathINIT XpathINIT
+" if ExtraVim() if ExtraVim()
+" ... " ...
+" ... " ...
+" endif endif
+" Xcheck <number> Xcheck <number>
+"
+" Double quotes in column 1 are removed before the script is executed.
+" They should be used if the test has unbalanced conditionals (:if/:endif,
+" :while:/endwhile, :try/:endtry) or for a line with a syntax error. The
+" extra script may use Xpath, XloopINIT, Xloop, XloopNEXT, and Xout as usual.
+"
+" A file name may be specified as argument. All messages of the extra Vim
+" process are then redirected to the file. An existing file is overwritten.
+"
+let ExtraVimCount = 0
+let ExtraVimBase = expand("<sfile>")
+let ExtraVimTestEnv = ""
+"
+function! ExtraVim(...)
+ " Count how often this function is called.
+ let g:ExtraVimCount = g:ExtraVimCount + 1
+
+ " Disable folds to prevent that the ranges in the ":write" commands below
+ " are extended up to the end of a closed fold. This also speeds things up
+ " considerably.
+ set nofoldenable
+
+ " Open a buffer for this test script and copy the test environment to
+ " a temporary file. Take account of parts relevant for the extra script
+ " execution only.
+ let current_buffnr = bufnr("%")
+ execute "view +1" g:ExtraVimBase
+ if g:ExtraVimCount == 1
+ let g:ExtraVimTestEnv = tempname()
+ execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w"
+ \ g:ExtraVimTestEnv "|']+"
+ execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
+ \ g:ExtraVimTestEnv "|']+"
+ execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
+ \ g:ExtraVimTestEnv "|']+"
+ execute "/E" . "XTRA_VIM_START/+,/E" . "XTRA_VIM_STOP/-w >>"
+ \ g:ExtraVimTestEnv "|']+"
+ endif
+
+ " Start the extra Vim script with a ":source" command for the test
+ " environment. The source line number where the extra script will be
+ " appended, needs to be passed as variable "ExtraVimBegin" to the script.
+ let extra_script = tempname()
+ exec "!echo 'source " . g:ExtraVimTestEnv . "' >" . extra_script
+ let extra_begin = 1
+
+ " Starting behind the test environment, skip over the first g:ExtraVimCount
+ " occurrences of "if ExtraVim()" and copy the following lines up to the
+ " matching "endif" to the extra Vim script.
+ execute "/E" . "ND_OF_TEST_ENVIRONMENT/"
+ exec 'norm ' . g:ExtraVimCount . '/^\s*if\s\+ExtraVim(.*)/+' . "\n"
+ execute ".,/^endif/-write >>" . extra_script
+
+ " Open a buffer for the extra Vim script, delete all ^", and write the
+ " script if was actually modified.
+ execute "edit +" . (extra_begin + 1) extra_script
+ ,$s/^"//e
+ update
+
+ " Count the INTERRUPTs and build the breakpoint and quit commands.
+ let breakpoints = ""
+ let debug_quits = ""
+ let in_func = 0
+ exec extra_begin
+ while search(
+ \ '"\s*INTERRUPT\h\@!\|^\s*fu\%[nction]\>!\=\s*\%(\u\|s:\)\w*\s*(\|'
+ \ . '^\s*\\\|^\s*endf\%[unction]\>\|'
+ \ . '\%(^\s*fu\%[nction]!\=\s*\)\@<!\%(\u\|s:\)\w*\s*(\|'
+ \ . 'ExecAsScript\s\+\%(\u\|s:\)\w*',
+ \ "W") > 0
+ let theline = getline(".")
+ if theline =~ '^\s*fu'
+ " Function definition.
+ let in_func = 1
+ let func_start = line(".")
+ let func_name = substitute(theline,
+ \ '^\s*fu\%[nction]!\=\s*\(\%(\u\|s:\)\w*\).*', '\1', "")
+ let func_conts = 0
+ elseif theline =~ '^\s*\\'
+ if in_func
+ let func_conts = func_conts + 1
+ endif
+ elseif theline =~ '^\s*endf'
+ " End of function definition.
+ let in_func = 0
+ else
+ let finding = substitute(theline, '.*\(\%' . col(".") . 'c.*\)',
+ \ '\1', "")
+ if finding =~ '^"\s*INTERRUPT\h\@!'
+ " Interrupt comment. Compose as many quit commands as
+ " specified.
+ let cnt = substitute(finding,
+ \ '^"\s*INTERRUPT\s*\(\d*\).*$', '\1', "")
+ let quits = ""
+ while cnt > 0
+ " Use "\r" rather than "\n" to separate the quit commands.
+ " "\r" is not interpreted as command separator by the ":!"
+ " command below but works to separate commands in the
+ " external vim.
+ let quits = quits . "q\r"
+ let cnt = cnt - 1
+ endwhile
+ if in_func
+ " Add the function breakpoint and note the number of quits
+ " to be used, if specified, or one for every call else.
+ let breakpoints = breakpoints . " -c 'breakadd func " .
+ \ (line(".") - func_start - func_conts) . " " .
+ \ func_name . "'"
+ if quits != ""
+ let debug_quits = debug_quits . quits
+ elseif !exists("quits{func_name}")
+ let quits{func_name} = "q\r"
+ else
+ let quits{func_name} = quits{func_name} . "q\r"
+ endif
+ else
+ " Add the file breakpoint and the quits to be used for it.
+ let breakpoints = breakpoints . " -c 'breakadd file " .
+ \ line(".") . " " . extra_script . "'"
+ if quits == ""
+ let quits = "q\r"
+ endif
+ let debug_quits = debug_quits . quits
+ endif
+ else
+ " Add the quits to be used for calling the function or executing
+ " it as script file.
+ if finding =~ '^ExecAsScript'
+ " Sourcing function as script.
+ let finding = substitute(finding,
+ \ '^ExecAsScript\s\+\(\%(\u\|s:\)\w*\).*', '\1', "")
+ else
+ " Function call.
+ let finding = substitute(finding,
+ \ '^\(\%(\u\|s:\)\w*\).*', '\1', "")
+ endif
+ if exists("quits{finding}")
+ let debug_quits = debug_quits . quits{finding}
+ endif
+ endif
+ endif
+ endwhile
+
+ " Close the buffer for the script and create an (empty) resultfile.
+ bwipeout
+ let resultfile = tempname()
+ exec "!>" . resultfile
+
+ " Run the script in an extra vim. Switch to extra modus by passing the
+ " resultfile in ExtraVimResult. Redirect messages to the file specified as
+ " argument if any. Use ":debuggreedy" so that the commands provided on the
+ " pipe are consumed at the debug prompt. Use "-N" to enable command-line
+ " contiunation ("C" in 'cpo'). Add "nviminfo" to 'viminfo' to avoid
+ " messing up the user's viminfo file.
+ let redirect = a:0 ?
+ \ " -c 'au VimLeave * redir END' -c 'redir\\! >" . a:1 . "'" : ""
+ exec "!echo '" . debug_quits . "q' | ../vim -u NONE -N -Xes" . redirect .
+ \ " -c 'debuggreedy|set viminfo+=nviminfo'" .
+ \ " -c 'let ExtraVimBegin = " . extra_begin . "'" .
+ \ " -c 'let ExtraVimResult = \"" . resultfile . "\"'" . breakpoints .
+ \ " -S " . extra_script
+
+ " Build the resulting sum for resultfile and add it to g:Xpath. Add Xout
+ " information provided by the extra Vim process to the test output.
+ let sum = 0
+ exec "edit" resultfile
+ let line = 1
+ while line <= line("$")
+ let theline = getline(line)
+ if theline =~ '^@R:'
+ exec 'Xout "' . substitute(substitute(
+ \ escape(escape(theline, '"'), '\"'),
+ \ '^@R:', '', ""), '@NL@', "\n", "g") . '"'
+ else
+ let sum = sum + getline(line)
+ endif
+ let line = line + 1
+ endwhile
+ bwipeout
+ let g:Xpath = g:Xpath + sum
+
+ " Delete the extra script and the resultfile.
+ call delete(extra_script)
+ call delete(resultfile)
+
+ " Switch back to the buffer that was active when this function was entered.
+ exec "buffer" current_buffnr
+
+ " Return 0. This protects extra scripts from being run in the main Vim
+ " process.
+ return 0
+endfunction
+
+
+" ExtraVimThrowpoint() - Relative throwpoint in ExtraVim script {{{2
+"
+" Evaluates v:throwpoint and returns the throwpoint relativ to the beginning of
+" an ExtraVim script as passed by ExtraVim() in ExtraVimBegin.
+"
+" EXTRA_VIM_START - do not change or remove this line.
+function! ExtraVimThrowpoint()
+ if !exists("g:ExtraVimBegin")
+ Xout "ExtraVimThrowpoint() used outside ExtraVim() script."
+ return v:throwpoint
+ endif
+
+ if v:throwpoint =~ '^function\>'
+ return v:throwpoint
+ endif
+
+ return "line " .
+ \ (substitute(v:throwpoint, '.*, line ', '', "") - g:ExtraVimBegin) .
+ \ " of ExtraVim() script"
+endfunction
+" EXTRA_VIM_STOP - do not change or remove this line.
+
+
+" MakeScript() - Make a script file from a function. {{{2
+"
+" Create a script that consists of the body of the function a:funcname.
+" Replace any ":return" by a ":finish", any argument variable by a global
+" variable, and and every ":call" by a ":source" for the next following argument
+" in the variable argument list. This function is useful if similar tests are
+" to be made for a ":return" from a function call or a ":finish" in a script
+" file.
+"
+" In order to execute a function specifying an INTERRUPT location (see ExtraVim)
+" as a script file, use ExecAsScript below.
+"
+" EXTRA_VIM_START - do not change or remove this line.
+function! MakeScript(funcname, ...)
+ let script = tempname()
+ execute "redir! >" . script
+ execute "function" a:funcname
+ redir END
+ execute "edit" script
+ " Delete the "function" and the "endfunction" lines. Do not include the
+ " word "function" in the pattern since it might be translated if LANG is
+ " set. When MakeScript() is being debugged, this deletes also the debugging
+ " output of its line 3 and 4.
+ exec '1,/.*' . a:funcname . '(.*)/d'
+ /^\d*\s*endfunction\>/,$d
+ %s/^\d*//e
+ %s/return/finish/e
+ %s/\<a:\(\h\w*\)/g:\1/ge
+ normal gg0
+ let cnt = 0
+ while search('\<call\s*\%(\u\|s:\)\w*\s*(.*)', 'W') > 0
+ let cnt = cnt + 1
+ s/\<call\s*\%(\u\|s:\)\w*\s*(.*)/\='source ' . a:{cnt}/
+ endwhile
+ g/^\s*$/d
+ write
+ bwipeout
+ return script
+endfunction
+" EXTRA_VIM_STOP - do not change or remove this line.
+
+
+" ExecAsScript - Source a temporary script made from a function. {{{2
+"
+" Make a temporary script file from the function a:funcname, ":source" it, and
+" delete it afterwards.
+"
+" When inside ":if ExtraVim()", add a file breakpoint for each INTERRUPT
+" location specified in the function.
+"
+" EXTRA_VIM_START - do not change or remove this line.
+function! ExecAsScript(funcname)
+ " Make a script from the function passed as argument.
+ let script = MakeScript(a:funcname)
+
+ " When running in an extra Vim process, add a file breakpoint for each
+ " function breakpoint set when the extra Vim process was invoked by
+ " ExtraVim().
+ if exists("g:ExtraVimResult")
+ let bplist = tempname()
+ execute "redir! >" . bplist
+ breaklist
+ redir END
+ execute "edit" bplist
+ " Get the line number from the function breakpoint. Works also when
+ " LANG is set.
+ execute 'v/^\s*\d\+\s\+func\s\+' . a:funcname . '\s.*/d'
+ %s/^\s*\d\+\s\+func\s\+\%(\u\|s:\)\w*\s\D*\(\d*\).*/\1/e
+ let cnt = 0
+ while cnt < line("$")
+ let cnt = cnt + 1
+ if getline(cnt) != ""
+ execute "breakadd file" getline(cnt) script
+ endif
+ endwhile
+ bwipeout!
+ call delete(bplist)
+ endif
+
+ " Source and delete the script.
+ exec "source" script
+ call delete(script)
+endfunction
+
+com! -nargs=1 -bar ExecAsScript call ExecAsScript(<f-args>)
+" EXTRA_VIM_STOP - do not change or remove this line.
+
+
+" END_OF_TEST_ENVIRONMENT - do not change or remove this line.
+
+
+"-------------------------------------------------------------------------------
+" Test 1: :endwhile in function {{{1
+"
+" Detect if a broken loop is (incorrectly) reactivated by the
+" :endwhile. Use a :return to prevent an endless loop, and make
+" this test first to get a meaningful result on an error before other
+" tests will hang.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ Xpath 1 " X: 1
+ let first = 1
+ XloopINIT 2 8
+ while 1
+ Xloop 1 " X: 2 + 0 * 16
+ if first
+ Xloop 2 " X: 4 + 0 * 32
+ let first = 0
+ XloopNEXT
+ break
+ else
+ Xloop 4 " X: 0 + 0 * 64
+ return
+ endif
+ endwhile
+endfunction
+
+call F()
+Xpath 128 " X: 128
+
+function! G()
+ Xpath 256 " X: 256 + 0 * 2048
+ let first = 1
+ XloopINIT 512 8
+ while 1
+ Xloop 1 " X: 512 + 0 * 4096
+ if first
+ Xloop 2 " X: 1024 + 0 * 8192
+ let first = 0
+ XloopNEXT
+ break
+ else
+ Xloop 4 " X: 0 + 0 * 16384
+ return
+ endif
+ if 1 " unmatched :if
+ endwhile
+endfunction
+
+call G()
+Xpath 32768 " X: 32768
+
+Xcheck 34695
+
+" Leave F and G for execution as scripts in the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 2: :endwhile in script {{{1
+"
+" Detect if a broken loop is (incorrectly) reactivated by the
+" :endwhile. Use a :finish to prevent an endless loop, and place
+" this test before others that might hang to get a meaningful result
+" on an error.
+"
+" This test executes the bodies of the functions F and G from the
+" previous test as script files (:return replaced by :finish).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+ExecAsScript F " X: 1 + 2 + 4
+Xpath 128 " X: 128
+
+ExecAsScript G " X: 256 + 512 + 1024
+Xpath 32768 " X: 32768
+
+unlet first
+delfunction F
+delfunction G
+
+Xcheck 34695
+
+
+"-------------------------------------------------------------------------------
+" Test 3: :if, :elseif, :while, :continue, :break {{{1
+"-------------------------------------------------------------------------------
+
+XpathINIT
+if 1
+ Xpath 1 " X: 1
+ let loops = 3
+ XloopINIT 2 512
+ while loops > -1 " main loop: loops == 3, 2, 1 (which breaks)
+ if loops <= 0
+ let break_err = 1
+ let loops = -1
+ else " 3: 2: 1:
+ Xloop 1 " X: 2 + 2*512 + 2*512*512
+ endif
+ if (loops == 2)
+ while loops == 2 " dummy loop
+ Xloop 2 " X: 4*512
+ let loops = loops - 1
+ continue " stop dummy loop
+ Xloop 4 " X: 0
+ endwhile
+ XloopNEXT
+ continue " continue main loop
+ Xloop 8 " X: 0
+ elseif (loops == 1)
+ let p = 1
+ while p " dummy loop
+ Xloop 16 " X: 32*512*512
+ let p = 0
+ break " break dummy loop
+ Xloop 32 " X: 0
+ endwhile
+ Xloop 64 " X: 128*512*512
+ unlet p
+ break " break main loop
+ Xloop 128 " X: 0
+ endif
+ if (loops > 0)
+ Xloop 256 " X: 512
+ endif
+ while loops == 3 " dummy loop
+ let loops = loops - 1
+ endwhile " end dummy loop
+ XloopNEXT
+ endwhile " end main loop
+ Xpath 268435456 " X: 1024*512*512
+else
+ Xpath 536870912 " X: 0
+endif
+Xpath 1073741824 " X: 4096*512*512
+if exists("break_err")
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ unlet break_err
+endif
+
+unlet loops
+
+Xcheck 1384648195
+
+
+"-------------------------------------------------------------------------------
+" Test 4: :return {{{1
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ if 1
+ Xpath 1 " X: 1
+ let loops = 3
+ XloopINIT 2 16
+ while loops > 0 " 3: 2: 1:
+ Xloop 1 " X: 2 + 2*16 + 0*16*16
+ if (loops == 2)
+ Xloop 2 " X: 4*16
+ return
+ Xloop 4 " X: 0
+ endif
+ Xloop 8 " X: 16
+ let loops = loops - 1
+ XloopNEXT
+ endwhile
+ Xpath 8192 " X: 0
+ else
+ Xpath 16384 " X: 0
+ endif
+endfunction
+
+call F()
+Xpath 32768 " X: 8*16*16*16
+
+Xcheck 32883
+
+" Leave F for execution as a script in the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 5: :finish {{{1
+"
+" This test executes the body of the function F from the previous test
+" as a script file (:return replaced by :finish).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+ExecAsScript F " X: 1 + 2 + 2*16 + 4*16 + 16
+Xpath 32768 " X: 32768
+
+unlet loops
+delfunction F
+
+Xcheck 32883
+
+
+"-------------------------------------------------------------------------------
+" Test 6: Defining functions in :while loops {{{1
+"
+" Functions can be defined inside other functions. An inner function
+" gets defined when the outer function is executed. Functions may
+" also be defined inside while loops. Expressions in braces for
+" defining the function name are allowed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ " The command CALL collects the argument of all its invocations in "calls"
+ " when used from a function (that is, when the global variable "calls" needs
+ " the "g:" prefix). This is to check that the function code is skipped when
+ " the function is defined. For inner functions, do so only if the outer
+ " function is not being executed.
+ "
+ let calls = ""
+ com! -nargs=1 CALL
+ \ if !exists("calls") && !exists("outer") |
+ \ let g:calls = g:calls . <args> |
+ \ endif
+
+
+ XloopINIT! 1 16
+
+ let i = 0
+ while i < 3
+
+ XloopNEXT
+ let i = i + 1
+
+ if i == 1
+ Xloop 1 " X: 1
+ function! F1(arg)
+ CALL a:arg
+ let outer = 1
+
+ XloopINIT! 4096 4
+ let j = 0
+ while j < 1
+ XloopNEXT
+ Xloop 1 " X: 4096
+ let j = j + 1
+ function! G1(arg)
+ CALL a:arg
+ endfunction
+ Xloop 2 " X: 8192
+ endwhile
+ endfunction
+ Xloop 2 " X: 2
+
+ continue
+ endif
+
+ Xloop 4 " X: 4 * (16 + 256)
+ function! F{i}(i, arg)
+ CALL a:arg
+ let outer = 1
+
+ XloopINIT! 16384 4
+ if a:i == 3
+ XloopNEXT
+ XloopNEXT
+ XloopNEXT
+ endif
+ let k = 0
+ while k < 3
+ XloopNEXT
+ Xloop 1 " X: 16384*(1+4+16+64+256+1024)
+ let k = k + 1
+ function! G{a:i}{k}(arg)
+ CALL a:arg
+ endfunction
+ Xloop 2 " X: 32768*(1+4+16+64+256+1024)
+ endwhile
+ endfunction
+ Xloop 8 " X: 8 * (16 + 256)
+
+ endwhile
+
+ if exists("*G1")
+ Xpath 67108864 " X: 0
+ endif
+ if exists("*F1")
+ call F1("F1")
+ if exists("*G1")
+ call G1("G1")
+ endif
+ endif
+
+ if exists("G21") || exists("G21") || exists("G21")
+ Xpath 134217728 " X: 0
+ endif
+ if exists("*F2")
+ call F2(2, "F2")
+ if exists("*G21")
+ call G21("G21")
+ endif
+ if exists("*G22")
+ call G22("G22")
+ endif
+ if exists("*G23")
+ call G23("G23")
+ endif
+ endif
+
+ if exists("G31") || exists("G31") || exists("G31")
+ Xpath 268435456 " X: 0
+ endif
+ if exists("*F3")
+ call F3(3, "F3")
+ if exists("*G31")
+ call G31("G31")
+ endif
+ if exists("*G32")
+ call G32("G32")
+ endif
+ if exists("*G33")
+ call G33("G33")
+ endif
+ endif
+
+ Xpath 536870912 " X: 536870912
+
+ if calls != "F1G1F2G21G22G23F3G31G32G33"
+ Xpath 1073741824 " X: 0
+ Xout "calls is" calls
+ endif
+
+ delfunction F1
+ delfunction G1
+ delfunction F2
+ delfunction G21
+ delfunction G22
+ delfunction G23
+ delfunction G31
+ delfunction G32
+ delfunction G33
+
+endif
+
+Xcheck 603978947
+
+
+"-------------------------------------------------------------------------------
+" Test 7: Continuing on errors outside functions {{{1
+"
+" On an error outside a function, the script processing continues
+" at the line following the outermost :endif or :endwhile. When not
+" inside an :if or :while, the script processing continues at the next
+" line.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if 1
+ Xpath 1 " X: 1
+ while 1
+ Xpath 2 " X: 2
+ asdf
+ Xpath 4 " X: 0
+ break
+ endwhile | Xpath 8 " X: 0
+ Xpath 16 " X: 0
+endif | Xpath 32 " X: 0
+Xpath 64 " X: 64
+
+while 1
+ Xpath 128 " X: 128
+ if 1
+ Xpath 256 " X: 256
+ asdf
+ Xpath 512 " X: 0
+ endif | Xpath 1024 " X: 0
+ Xpath 2048 " X: 0
+ break
+endwhile | Xpath 4096 " X: 0
+Xpath 8192 " X: 8192
+
+asdf
+Xpath 16384 " X: 16384
+
+asdf | Xpath 32768 " X: 0
+Xpath 65536 " X: 65536
+
+Xcheck 90563
+
+
+"-------------------------------------------------------------------------------
+" Test 8: Aborting and continuing on errors inside functions {{{1
+"
+" On an error inside a function without the "abort" attribute, the
+" script processing continues at the next line (unless the error was
+" in a :return command). On an error inside a function with the
+" "abort" attribute, the function is aborted and the script processing
+" continues after the function call; the value -1 is returned then.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ if 1
+ Xpath 1 " X: 1
+ while 1
+ Xpath 2 " X: 2
+ asdf
+ Xpath 4 " X: 4
+ asdf | Xpath 8 " X: 0
+ Xpath 16 " X: 16
+ break
+ endwhile
+ Xpath 32 " X: 32
+ endif | Xpath 64 " X: 64
+ Xpath 128 " X: 128
+
+ while 1
+ Xpath 256 " X: 256
+ if 1
+ Xpath 512 " X: 512
+ asdf
+ Xpath 1024 " X: 1024
+ asdf | Xpath 2048 " X: 0
+ Xpath 4096 " X: 4096
+ endif
+ Xpath 8192 " X: 8192
+ break
+ endwhile | Xpath 16384 " X: 16384
+ Xpath 32768 " X: 32768
+
+ return novar " returns (default return value 0)
+ Xpath 65536 " X: 0
+ return 1 " not reached
+endfunction
+
+function! G() abort
+ if 1
+ Xpath 131072 " X: 131072
+ while 1
+ Xpath 262144 " X: 262144
+ asdf " returns -1
+ Xpath 524288 " X: 0
+ break
+ endwhile
+ Xpath 1048576 " X: 0
+ endif | Xpath 2097152 " X: 0
+ Xpath Xpath 4194304 " X: 0
+
+ return -4 " not reached
+endfunction
+
+function! H() abort
+ while 1
+ Xpath 8388608 " X: 8388608
+ if 1
+ Xpath 16777216 " X: 16777216
+ asdf " returns -1
+ Xpath 33554432 " X: 0
+ endif
+ Xpath 67108864 " X: 0
+ break
+ endwhile | Xpath 134217728 " X: 0
+ Xpath 268435456 " X: 0
+
+ return -4 " not reached
+endfunction
+
+" Aborted functions (G and H) return -1.
+let sum = (F() + 1) - 4*G() - 8*H()
+Xpath 536870912 " X: 536870912
+if sum != 13
+ Xpath 1073741824 " X: 0
+ Xout "sum is" sum
+endif
+
+unlet sum
+delfunction F
+delfunction G
+delfunction H
+
+Xcheck 562493431
+
+
+"-------------------------------------------------------------------------------
+" Test 9: Continuing after aborted functions {{{1
+"
+" When a function with the "abort" attribute is aborted due to an
+" error, the next function back in the call hierarchy without an
+" "abort" attribute continues; the value -1 is returned then.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F() abort
+ Xpath 1 " X: 1
+ let result = G() " not aborted
+ Xpath 2 " X: 2
+ if result != 2
+ Xpath 4 " X: 0
+ endif
+ return 1
+endfunction
+
+function! G() " no abort attribute
+ Xpath 8 " X: 8
+ if H() != -1 " aborted
+ Xpath 16 " X: 0
+ endif
+ Xpath 32 " X: 32
+ return 2
+endfunction
+
+function! H() abort
+ Xpath 64 " X: 64
+ call I() " aborted
+ Xpath 128 " X: 0
+ return 4
+endfunction
+
+function! I() abort
+ Xpath 256 " X: 256
+ asdf " error
+ Xpath 512 " X: 0
+ return 8
+endfunction
+
+if F() != 1
+ Xpath 1024 " X: 0
+endif
+
+delfunction F
+delfunction G
+delfunction H
+delfunction I
+
+Xcheck 363
+
+
+"-------------------------------------------------------------------------------
+" Test 10: :if, :elseif, :while argument parsing {{{1
+"
+" A '"' or '|' in an argument expression must not be mixed up with
+" a comment or a next command after a bar. Parsing errors should
+" be recognized.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+if 1 || strlen("\"") | Xpath 1 " X: 1
+ Xpath 2 " X: 2
+endif
+Xpath 4 " X: 4
+
+if 0
+elseif 1 || strlen("\"") | Xpath 8 " X: 8
+ Xpath 16 " X: 16
+endif
+Xpath 32 " X: 32
+
+while 1 || strlen("\"") | Xpath 64 " X: 64
+ Xpath 128 " X: 128
+ break
+endwhile
+Xpath 256 " X: 256
+
+let v:errmsg = ""
+if 1 ||| strlen("\"") | Xpath 512 " X: 0
+ Xpath 1024 " X: 0
+endif
+Xpath 2048 " X: 2048
+if !MSG('E15', "Invalid expression")
+ Xpath 4096 " X: 0
+endif
+
+let v:errmsg = ""
+if 0
+elseif 1 ||| strlen("\"") | Xpath 8192 " X: 0
+ Xpath 16384 " X: 0
+endif
+Xpath 32768 " X: 32768
+if !MSG('E15', "Invalid expression")
+ Xpath 65536 " X: 0
+endif
+
+let v:errmsg = ""
+while 1 ||| strlen("\"") | Xpath 131072 " X: 0
+ Xpath 262144 " X: 0
+ break
+endwhile
+Xpath 524288 " X: 524288
+if !MSG('E15', "Invalid expression")
+ Xpath 1048576 " X: 0
+endif
+
+delfunction MSG
+
+Xcheck 559615
+
+
+"-------------------------------------------------------------------------------
+" Test 11: :if, :elseif, :while argument evaluation after abort {{{1
+"
+" When code is skipped over due to an error, the boolean argument to
+" an :if, :elseif, or :while must not be evaluated.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let calls = 0
+
+function! P(num)
+ let g:calls = g:calls + a:num " side effect on call
+ return 0
+endfunction
+
+if 1
+ Xpath 1 " X: 1
+ asdf " error
+ Xpath 2 " X: 0
+ if P(1) " should not be called
+ Xpath 4 " X: 0
+ elseif !P(2) " should not be called
+ Xpath 8 " X: 0
+ else
+ Xpath 16 " X: 0
+ endif
+ Xpath 32 " X: 0
+ while P(4) " should not be called
+ Xpath 64 " X: 0
+ endwhile
+ Xpath 128 " X: 0
+endif
+
+if calls % 2
+ Xpath 256 " X: 0
+endif
+if (calls/2) % 2
+ Xpath 512 " X: 0
+endif
+if (calls/4) % 2
+ Xpath 1024 " X: 0
+endif
+Xpath 2048 " X: 2048
+
+unlet calls
+delfunction P
+
+Xcheck 2049
+
+
+"-------------------------------------------------------------------------------
+" Test 12: Expressions in braces in skipped code {{{1
+"
+" In code skipped over due to an error or inactive conditional,
+" an expression in braces as part of a variable or function name
+" should not be evaluated.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT 1 8
+
+function! NULL()
+ Xloop 1 " X: 0
+ return 0
+endfunction
+
+function! ZERO()
+ Xloop 2 " X: 0
+ return 0
+endfunction
+
+function! F0()
+ Xloop 4 " X: 0
+endfunction
+
+function! F1(arg)
+ Xpath 4096 " X: 0
+endfunction
+
+let V0 = 1
+
+Xpath 8192 " X: 8192
+echo 0 ? F{NULL() + V{ZERO()}}() : 1
+XloopNEXT
+
+Xpath 16384 " X: 16384
+if 0
+ Xpath 32768 " X: 0
+ call F{NULL() + V{ZERO()}}()
+endif
+XloopNEXT
+
+Xpath 65536 " X: 65536
+if 1
+ asdf " error
+ Xpath 131072 " X: 0
+ call F1(F{NULL() + V{ZERO()}}())
+endif
+XloopNEXT
+
+Xpath 262144 " X: 262144
+if 1
+ asdf " error
+ Xpath 524288 " X: 0
+ call F{NULL() + V{ZERO()}}()
+endif
+
+Xcheck 352256
+
+
+"-------------------------------------------------------------------------------
+" Test 13: Failure in argument evaluation for :while {{{1
+"
+" A failure in the expression evaluation for the condition of a :while
+" causes the whole :while loop until the matching :endwhile being
+" ignored. Continuation is at the next following line.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+Xpath 1 " X: 1
+while asdf
+ Xpath 2 " X: 0
+ while 1
+ Xpath 4 " X: 0
+ break
+ endwhile
+ Xpath 8 " X: 0
+ break
+endwhile
+Xpath 16 " X: 16
+
+while asdf | Xpath 32 | endwhile | Xpath 64 " X: 0
+Xpath 128 " X: 128
+
+Xcheck 145
+
+
+"-------------------------------------------------------------------------------
+" Test 14: Failure in argument evaluation for :if {{{1
+"
+" A failure in the expression evaluation for the condition of an :if
+" does not cause the corresponding :else or :endif being matched to
+" a previous :if/:elseif. Neither of both branches of the failed :if
+" are executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+XloopINIT 1 256
+
+function! F()
+ Xloop 1 " X: 1 + 256 * 1
+ let x = 0
+ if x " false
+ Xloop 2 " X: 0 + 256 * 0
+ elseif !x " always true
+ Xloop 4 " X: 4 + 256 * 4
+ let x = 1
+ if g:boolvar " possibly undefined
+ Xloop 8 " X: 8 + 256 * 0
+ else
+ Xloop 16 " X: 0 + 256 * 0
+ endif
+ Xloop 32 " X: 32 + 256 * 32
+ elseif x " never executed
+ Xloop 64 " X: 0 + 256 * 0
+ endif
+ Xloop 128 " X: 128 + 256 * 128
+endfunction
+
+let boolvar = 1
+call F()
+
+XloopNEXT
+unlet boolvar
+call F()
+
+delfunction F
+
+Xcheck 42413
+
+
+"-------------------------------------------------------------------------------
+" Test 15: Failure in argument evaluation for :if (bar) {{{1
+"
+" Like previous test, except that the failing :if ... | ... | :endif
+" is in a single line.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+XloopINIT 1 256
+
+function! F()
+ Xloop 1 " X: 1 + 256 * 1
+ let x = 0
+ if x " false
+ Xloop 2 " X: 0 + 256 * 0
+ elseif !x " always true
+ Xloop 4 " X: 4 + 256 * 4
+ let x = 1
+ if g:boolvar | Xloop 8 | else | Xloop 16 | endif " X: 8
+ Xloop 32 " X: 32 + 256 * 32
+ elseif x " never executed
+ Xloop 64 " X: 0 + 256 * 0
+ endif
+ Xloop 128 " X: 128 + 256 * 128
+endfunction
+
+let boolvar = 1
+call F()
+
+XloopNEXT
+unlet boolvar
+call F()
+
+delfunction F
+
+Xcheck 42413
+
+
+"-------------------------------------------------------------------------------
+" Test 16: Double :else or :elseif after :else {{{1
+"
+" Multiple :elses or an :elseif after an :else are forbidden.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F() abort
+ if 0
+ Xpath 1 " X: 0
+ else
+ Xpath 2 " X: 2
+ else " aborts function
+ Xpath 4 " X: 0
+ endif
+endfunction
+
+function! G() abort
+ if 0
+ Xpath 8 " X: 0
+ else
+ Xpath 16 " X: 16
+ elseif 1 " aborts function
+ Xpath 32 " X: 0
+ else
+ Xpath 64 " X: 0
+ endif
+endfunction
+
+function! H() abort
+ if 0
+ Xpath 128 " X: 0
+ elseif 0
+ Xpath 256 " X: 0
+ else
+ Xpath 512 " X: 512
+ else " aborts function
+ Xpath 1024 " X: 0
+ endif
+endfunction
+
+function! I() abort
+ if 0
+ Xpath 2048 " X: 0
+ elseif 0
+ Xpath 4096 " X: 0
+ else
+ Xpath 8192 " X: 8192
+ elseif 1 " aborts function
+ Xpath 16384 " X: 0
+ else
+ Xpath 32768 " X: 0
+ endif
+endfunction
+
+call F()
+call G()
+call H()
+call I()
+
+delfunction F
+delfunction G
+delfunction H
+delfunction I
+
+Xcheck 8722
+
+
+"-------------------------------------------------------------------------------
+" Test 17: Nesting of unmatched :if or :endif inside a :while {{{1
+"
+" The :while/:endwhile takes precedence in nesting over an unclosed
+" :if or an unopened :endif.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+let messages = ""
+
+" While loops inside a function are continued on error.
+function! F()
+ let v:errmsg = ""
+ XloopINIT 1 16
+ let loops = 3
+ while loops > 0
+ let loops = loops - 1 " 2: 1: 0:
+ Xloop 1 " X: 1 + 1*16 + 1*16*16
+ if (loops == 1)
+ Xloop 2 " X: 2*16
+ XloopNEXT
+ continue
+ elseif (loops == 0)
+ Xloop 4 " X: 4*16*16
+ break
+ elseif 1
+ Xloop 8 " X: 8
+ XloopNEXT
+ " endif missing!
+ endwhile " :endwhile after :if 1
+ Xpath 4096 " X: 16*16*16
+ if MSG('E171', "Missing :endif")
+ let g:messages = g:messages . "A"
+ endif
+
+ let v:errmsg = ""
+ XloopINIT! 8192 4
+ let loops = 2
+ while loops > 0 " 2: 1:
+ XloopNEXT
+ let loops = loops - 1
+ Xloop 1 " X: 8192 + 8192*4
+ if 0
+ Xloop 2 " X: 0
+ " endif missing
+ endwhile " :endwhile after :if 0
+ Xpath 131072 " X: 8192*4*4
+ if MSG('E171', "Missing :endif")
+ let g:messages = g:messages . "B"
+ endif
+
+ let v:errmsg = ""
+ XloopINIT 262144 4
+ let loops = 2
+ while loops > 0 " 2: 1:
+ let loops = loops - 1
+ Xloop 1 " X: 262144 + 262144 * 4
+ " if missing!
+ endif " :endif without :if in while
+ Xloop 2 " X: 524288 + 524288 * 4
+ XloopNEXT
+ endwhile
+ Xpath 4194304 " X: 262144*4*4
+ if MSG('E580', ":endif without :if")
+ let g:messages = g:messages . "C"
+ endif
+endfunction
+
+call F()
+
+" Error continuation outside a function is at the outermost :endwhile or :endif.
+let v:errmsg = ""
+XloopINIT! 8388608 4
+let loops = 2
+while loops > 0 " 2: 1:
+ XloopNEXT
+ let loops = loops - 1
+ Xloop 1 " X: 8388608 + 0 * 4
+ if 0
+ Xloop 2 " X: 0
+ " endif missing! Following :endwhile fails.
+endwhile | Xpath 134217728 " X: 0
+Xpath 268435456 " X: 2*8388608*4*4
+if MSG('E171', "Missing :endif")
+ let messages = g:messages . "D"
+endif
+
+if messages != "ABCD"
+ Xpath 536870912 " X: 0
+ Xout "messages is" messages "instead of ABCD"
+endif
+
+unlet loops messages
+delfunction F
+delfunction MSG
+
+Xcheck 285127993
+
+
+"-------------------------------------------------------------------------------
+" Test 18: Interrupt (Ctrl-C pressed) {{{1
+"
+" On an interrupt, the script processing is terminated immediately.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ if 1
+ Xpath 1 " X: 1
+ while 1
+ Xpath 2 " X: 2
+ if 1
+ Xpath 4 " X: 4
+ "INTERRUPT
+ Xpath 8 " X: 0
+ break
+ finish
+ endif | Xpath 16 " X: 0
+ Xpath 32 " X: 0
+ endwhile | Xpath 64 " X: 0
+ Xpath 128 " X: 0
+ endif | Xpath 256 " X: 0
+ Xpath 512 " X: 0
+endif
+
+if ExtraVim()
+ try
+ Xpath 1024 " X: 1024
+ "INTERRUPT
+ Xpath 2048 " X: 0
+ endtry | Xpath 4096 " X: 0
+ Xpath 8192 " X: 0
+endif
+
+if ExtraVim()
+ function! F()
+ if 1
+ Xpath 16384 " X: 16384
+ while 1
+ Xpath 32768 " X: 32768
+ if 1
+ Xpath 65536 " X: 65536
+ "INTERRUPT
+ Xpath 131072 " X: 0
+ break
+ return
+ endif | Xpath 262144 " X: 0
+ Xpath Xpath 524288 " X: 0
+ endwhile | Xpath 1048576 " X: 0
+ Xpath Xpath 2097152 " X: 0
+ endif | Xpath Xpath 4194304 " X: 0
+ Xpath Xpath 8388608 " X: 0
+ endfunction
+
+ call F() | Xpath 16777216 " X: 0
+ Xpath 33554432 " X: 0
+endif
+
+if ExtraVim()
+ function! G()
+ try
+ Xpath 67108864 " X: 67108864
+ "INTERRUPT
+ Xpath 134217728 " X: 0
+ endtry | Xpath 268435456 " X: 0
+ Xpath 536870912 " X: 0
+ endfunction
+
+ call G() | Xpath 1073741824 " X: 0
+ " The Xpath command does not accept 2^31 (negative); display explicitly:
+ exec "!echo 2147483648 >>" . g:ExtraVimResult
+ " X: 0
+endif
+
+Xcheck 67224583
+
+
+"-------------------------------------------------------------------------------
+" Test 19: Aborting on errors inside :try/:endtry {{{1
+"
+" An error in a command dynamically enclosed in a :try/:endtry region
+" aborts script processing immediately. It does not matter whether
+" the failing command is outside or inside a function and whether a
+" function has an "abort" attribute.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ function! F() abort
+ Xpath 1 " X: 1
+ asdf
+ Xpath 2 " X: 0
+ endfunction
+
+ try
+ Xpath 4 " X: 4
+ call F()
+ Xpath 8 " X: 0
+ endtry | Xpath 16 " X: 0
+ Xpath 32 " X: 0
+endif
+
+if ExtraVim()
+ function! G()
+ Xpath 64 " X: 64
+ asdf
+ Xpath 128 " X: 0
+ endfunction
+
+ try
+ Xpath 256 " X: 256
+ call G()
+ Xpath 512 " X: 0
+ endtry | Xpath 1024 " X: 0
+ Xpath 2048 " X: 0
+endif
+
+if ExtraVim()
+ try
+ Xpath 4096 " X: 4096
+ asdf
+ Xpath 8192 " X: 0
+ endtry | Xpath 16384 " X: 0
+ Xpath 32768 " X: 0
+endif
+
+if ExtraVim()
+ if 1
+ try
+ Xpath 65536 " X: 65536
+ asdf
+ Xpath 131072 " X: 0
+ endtry | Xpath 262144 " X: 0
+ endif | Xpath 524288 " X: 0
+ Xpath 1048576 " X: 0
+endif
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+ try
+ Xpath 2097152 " X: 2097152
+ asdf
+ Xpath 4194304 " X: 0
+ endtry | Xpath 8388608 " X: 0
+ endwhile | Xpath 16777216 " X: 0
+ Xpath 33554432 " X: 0
+endif
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+" try
+ Xpath 67108864 " X: 67108864
+ endwhile | Xpath 134217728 " X: 0
+ Xpath 268435456 " X: 0
+endif
+
+Xcheck 69275973
+"-------------------------------------------------------------------------------
+" Test 20: Aborting on errors after :try/:endtry {{{1
+"
+" When an error occurs after the last active :try/:endtry region has
+" been left, termination behavior is as if no :try/:endtry has been
+" seen.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+ try
+ Xpath 1 " X: 1
+ endtry
+ asdf
+ endwhile | Xpath 2 " X: 0
+ Xpath 4 " X: 4
+endif
+
+if ExtraVim()
+ while 1
+ try
+ Xpath 8 " X: 8
+ break
+ Xpath 16 " X: 0
+ endtry
+ endwhile
+ Xpath 32 " X: 32
+ asdf
+ Xpath 64 " X: 64
+endif
+
+if ExtraVim()
+ while 1
+ try
+ Xpath 128 " X: 128
+ break
+ Xpath 256 " X: 0
+ finally
+ Xpath 512 " X: 512
+ endtry
+ endwhile
+ Xpath 1024 " X: 1024
+ asdf
+ Xpath 2048 " X: 2048
+endif
+
+if ExtraVim()
+ while 1
+ try
+ Xpath 4096 " X: 4096
+ finally
+ Xpath 8192 " X: 8192
+ break
+ Xpath 16384 " X: 0
+ endtry
+ endwhile
+ Xpath 32768 " X: 32768
+ asdf
+ Xpath 65536 " X: 65536
+endif
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+ try
+ Xpath 131072 " X: 131072
+ continue
+ Xpath 262144 " X: 0
+ endtry
+ endwhile
+ Xpath 524288 " X: 524288
+ asdf
+ Xpath 1048576 " X: 1048576
+endif
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+ try
+ Xpath 2097152 " X: 2097152
+ continue
+ Xpath 4194304 " X: 0
+ finally
+ Xpath 8388608 " X: 8388608
+ endtry
+ endwhile
+ Xpath 16777216 " X: 16777216
+ asdf
+ Xpath 33554432 " X: 33554432
+endif
+
+if ExtraVim()
+ let p = 1
+ while p
+ let p = 0
+ try
+ Xpath 67108864 " X: 67108864
+ finally
+ Xpath 134217728 " X: 134217728
+ continue
+ Xpath 268435456 " X: 0
+ endtry
+ endwhile
+ Xpath 536870912 " X: 536870912
+ asdf
+ Xpath 1073741824 " X: 1073741824
+endif
+
+Xcheck 1874575085
+
+
+"-------------------------------------------------------------------------------
+" Test 21: :finally for :try after :continue/:break/:return/:finish {{{1
+"
+" If a :try conditional stays inactive due to a preceding :continue,
+" :break, :return, or :finish, its :finally clause should not be
+" executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ function F()
+ let loops = 2
+ XloopINIT! 1 256
+ while loops > 0
+ XloopNEXT
+ let loops = loops - 1
+ try
+ if loops == 1
+ Xloop 1 " X: 1
+ continue
+ Xloop 2 " X: 0
+ elseif loops == 0
+ Xloop 4 " X: 4*256
+ break
+ Xloop 8 " X: 0
+ endif
+
+ try " inactive
+ Xloop 16 " X: 0
+ finally
+ Xloop 32 " X: 0
+ endtry
+ finally
+ Xloop 64 " X: 64 + 64*256
+ endtry
+ Xloop 128 " X: 0
+ endwhile
+
+ try
+ Xpath 65536 " X: 65536
+ return
+ Xpath 131072 " X: 0
+ try " inactive
+ Xpath 262144 " X: 0
+ finally
+ Xpath 524288 " X: 0
+ endtry
+ finally
+ Xpath 1048576 " X: 1048576
+ endtry
+ Xpath 2097152 " X: 0
+ endfunction
+
+ try
+ Xpath 4194304 " X: 4194304
+ call F()
+ Xpath 8388608 " X: 8388608
+ finish
+ Xpath 16777216 " X: 0
+ try " inactive
+ Xpath 33554432 " X: 0
+ finally
+ Xpath 67108864 " X: 0
+ endtry
+ finally
+ Xpath 134217728 " X: 134217728
+ endtry
+ Xpath 268435456 " X: 0
+endif
+
+Xcheck 147932225
+
+
+"-------------------------------------------------------------------------------
+" Test 22: :finally for a :try after an error/interrupt/:throw {{{1
+"
+" If a :try conditional stays inactive due to a preceding error or
+" interrupt or :throw, its :finally clause should not be executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ function! Error()
+ try
+ asdf " aborting error, triggering error exception
+ endtry
+ endfunction
+
+ Xpath 1 " X: 1
+ call Error()
+ Xpath 2 " X: 0
+
+ if 1 " not active due to error
+ try " not active since :if inactive
+ Xpath 4 " X: 0
+ finally
+ Xpath 8 " X: 0
+ endtry
+ endif
+
+ try " not active due to error
+ Xpath 16 " X: 0
+ finally
+ Xpath 32 " X: 0
+ endtry
+endif
+
+if ExtraVim()
+ function! Interrupt()
+ try
+ "INTERRUPT " triggering interrupt exception
+ endtry
+ endfunction
+
+ Xpath 64 " X: 64
+ call Interrupt()
+ Xpath 128 " X: 0
+
+ if 1 " not active due to interrupt
+ try " not active since :if inactive
+ Xpath 256 " X: 0
+ finally
+ Xpath 512 " X: 0
+ endtry
+ endif
+
+ try " not active due to interrupt
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 0
+ endtry
+endif
+
+if ExtraVim()
+ function! Throw()
+ throw "xyz"
+ endfunction
+
+ Xpath 4096 " X: 4096
+ call Throw()
+ Xpath 8192 " X: 0
+
+ if 1 " not active due to :throw
+ try " not active since :if inactive
+ Xpath 16384 " X: 0
+ finally
+ Xpath 32768 " X: 0
+ endtry
+ endif
+
+ try " not active due to :throw
+ Xpath 65536 " X: 0
+ finally
+ Xpath 131072 " X: 0
+ endtry
+endif
+
+Xcheck 4161
+
+
+"-------------------------------------------------------------------------------
+" Test 23: :catch clauses for a :try after a :throw {{{1
+"
+" If a :try conditional stays inactive due to a preceding :throw,
+" none of its :catch clauses should be executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ try
+ Xpath 1 " X: 1
+ throw "xyz"
+ Xpath 2 " X: 0
+
+ if 1 " not active due to :throw
+ try " not active since :if inactive
+ Xpath 4 " X: 0
+ catch /xyz/
+ Xpath 8 " X: 0
+ endtry
+ endif
+ catch /xyz/
+ Xpath 16 " X: 16
+ endtry
+
+ Xpath 32 " X: 32
+ throw "abc"
+ Xpath 64 " X: 0
+
+ try " not active due to :throw
+ Xpath 128 " X: 0
+ catch /abc/
+ Xpath 256 " X: 0
+ endtry
+endif
+
+Xcheck 49
+
+
+"-------------------------------------------------------------------------------
+" Test 24: :endtry for a :try after a :throw {{{1
+"
+" If a :try conditional stays inactive due to a preceding :throw,
+" its :endtry should not rethrow the exception to the next surrounding
+" active :try conditional.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ try " try 1
+ try " try 2
+ Xpath 1 " X: 1
+ throw "xyz" " makes try 2 inactive
+ Xpath 2 " X: 0
+
+ try " try 3
+ Xpath 4 " X: 0
+ endtry " no rethrow to try 1
+ catch /xyz/ " should catch although try 2 inactive
+ Xpath 8 " X: 8
+ endtry
+ catch /xyz/ " try 1 active, but exception already caught
+ Xpath 16 " X: 0
+ endtry
+ Xpath 32 " X: 32
+endif
+
+Xcheck 41
+
+
+"-------------------------------------------------------------------------------
+" Test 25: Executing :finally clauses on normal control flow {{{1
+"
+" Control flow in a :try conditional should always fall through to its
+" :finally clause. A :finally clause of a :try conditional inside an
+" inactive conditional should never be executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ let loops = 3
+ XloopINIT 1 256
+ while loops > 0 " 3: 2: 1:
+ Xloop 1 " X: 1 + 1*256 + 1*256*256
+ if loops >= 2
+ try
+ Xloop 2 " X: 2 + 2*256
+ if loops == 2
+ try
+ Xloop 4 " X: 4*256
+ finally
+ Xloop 8 " X: 8*256
+ endtry
+ endif
+ finally
+ Xloop 16 " X: 16 + 16*256
+ if loops == 2
+ try
+ Xloop 32 " X: 32*256
+ finally
+ Xloop 64 " X: 64*256
+ endtry
+ endif
+ endtry
+ endif
+ Xloop 128 " X: 128 + 128*256 + 128*256*256
+ let loops = loops - 1
+ XloopNEXT
+ endwhile
+ Xpath 16777216 " X: 16777216
+endfunction
+
+if 1
+ try
+ Xpath 33554432 " X: 33554432
+ call F()
+ Xpath 67108864 " X: 67108864
+ finally
+ Xpath 134217728 " X: 134217728
+ endtry
+else
+ try
+ Xpath 268435456 " X: 0
+ finally
+ Xpath 536870912 " X: 0
+ endtry
+endif
+
+delfunction F
+
+Xcheck 260177811
+
+
+"-------------------------------------------------------------------------------
+" Test 26: Executing :finally clauses after :continue or :break {{{1
+"
+" For a :continue or :break dynamically enclosed in a :try/:endtry
+" region inside the next surrounding :while/:endwhile, if the
+" :continue/:break is before the :finally, the :finally clause is
+" executed first. If the :continue/:break is after the :finally, the
+" :finally clause is broken (like an :if/:endif region).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+try
+ let loops = 3
+ XloopINIT! 1 32
+ while loops > 0
+ XloopNEXT
+ try
+ try
+ if loops == 2 " 3: 2: 1:
+ Xloop 1 " X: 1*32
+ let loops = loops - 1
+ continue
+ elseif loops == 1
+ Xloop 2 " X: 2*32*32
+ break
+ finish
+ endif
+ Xloop 4 " X: 4
+ endtry
+ finally
+ Xloop 8 " X: 8 + 8*32 + 8*32*32
+ endtry
+ Xloop 16 " X: 16
+ let loops = loops - 1
+ endwhile
+ Xpath 32768 " X: 32768
+finally
+ Xpath 65536 " X: 65536
+ let loops = 3
+ XloopINIT 131072 16
+ while loops > 0
+ try
+ finally
+ try
+ if loops == 2
+ Xloop 1 " X: 131072*16
+ let loops = loops - 1
+ XloopNEXT
+ continue
+ elseif loops == 1
+ Xloop 2 " X: 131072*2*16*16
+ break
+ finish
+ endif
+ endtry
+ Xloop 4 " X: 131072*4
+ endtry
+ Xloop 8 " X: 131072*8
+ let loops = loops - 1
+ XloopNEXT
+ endwhile
+ Xpath 536870912 " X: 536870912
+endtry
+Xpath 1073741824 " X: 1073741824
+
+unlet loops
+
+Xcheck 1681500476
+
+
+"-------------------------------------------------------------------------------
+" Test 27: Executing :finally clauses after :return {{{1
+"
+" For a :return command dynamically enclosed in a :try/:endtry region,
+" :finally clauses are executed and the called function is ended.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ try
+ Xpath 1 " X: 1
+ try
+ Xpath 2 " X: 2
+ return
+ Xpath 4 " X: 0
+ finally
+ Xpath 8 " X: 8
+ endtry
+ Xpath 16 " X: 0
+ finally
+ Xpath 32 " X: 32
+ endtry
+ Xpath 64 " X: 0
+endfunction
+
+function! G()
+ try
+ Xpath 128 " X: 128
+ return
+ Xpath 256 " X: 0
+ finally
+ Xpath 512 " X: 512
+ call F()
+ Xpath 1024 " X: 1024
+ endtry
+ Xpath 2048 " X: 0
+endfunction
+
+function! H()
+ try
+ Xpath 4096 " X: 4096
+ call G()
+ Xpath 8192 " X: 8192
+ finally
+ Xpath 16384 " X: 16384
+ return
+ Xpath 32768 " X: 0
+ endtry
+ Xpath 65536 " X: 0
+endfunction
+
+try
+ Xpath 131072 " X: 131072
+ call H()
+ Xpath 262144 " X: 262144
+finally
+ Xpath 524288 " X: 524288
+endtry
+Xpath 1048576 " X: 1048576
+
+Xcheck 1996459
+
+" Leave F, G, and H for execution as scripts in the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 28: Executing :finally clauses after :finish {{{1
+"
+" For a :finish command dynamically enclosed in a :try/:endtry region,
+" :finally clauses are executed and the sourced file is finished.
+"
+" This test executes the bodies of the functions F, G, and H from the
+" previous test as script files (:return replaced by :finish).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let scriptF = MakeScript("F") " X: 1 + 2 + 8 + 32
+let scriptG = MakeScript("G", scriptF) " X: 128 + 512 + 1024
+let scriptH = MakeScript("H", scriptG) " X: 4096 + 8192 + 16384
+
+try
+ Xpath 131072 " X: 131072
+ exec "source" scriptH
+ Xpath 262144 " X: 262144
+finally
+ Xpath 524288 " X: 524288
+endtry
+Xpath 1048576 " X: 1048576
+
+call delete(scriptF)
+call delete(scriptG)
+call delete(scriptH)
+unlet scriptF scriptG scriptH
+delfunction F
+delfunction G
+delfunction H
+
+Xcheck 1996459
+
+
+"-------------------------------------------------------------------------------
+" Test 29: Executing :finally clauses on errors {{{1
+"
+" After an error in a command dynamically enclosed in a :try/:endtry
+" region, :finally clauses are executed and the script processing is
+" terminated.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ function! F()
+ while 1
+ try
+ Xpath 1 " X: 1
+ while 1
+ try
+ Xpath 2 " X: 2
+ asdf " error
+ Xpath 4 " X: 0
+ finally
+ Xpath 8 " X: 8
+ endtry | Xpath 16 " X: 0
+ Xpath 32 " X: 0
+ break
+ endwhile
+ Xpath 64 " X: 0
+ finally
+ Xpath 128 " X: 128
+ endtry | Xpath 256 " X: 0
+ Xpath 512 " X: 0
+ break
+ endwhile
+ Xpath 1024 " X: 0
+ endfunction
+
+ while 1
+ try
+ Xpath 2048 " X: 2048
+ while 1
+ call F()
+ Xpath 4096 " X: 0
+ break
+ endwhile | Xpath 8192 " X: 0
+ Xpath 16384 " X: 0
+ finally
+ Xpath 32768 " X: 32768
+ endtry | Xpath 65536 " X: 0
+ endwhile | Xpath 131072 " X: 0
+ Xpath 262144 " X: 0
+endif
+
+if ExtraVim()
+ function! G() abort
+ if 1
+ try
+ Xpath 524288 " X: 524288
+ asdf " error
+ Xpath 1048576 " X: 0
+ finally
+ Xpath 2097152 " X: 2097152
+ endtry | Xpath 4194304 " X: 0
+ endif | Xpath 8388608 " X: 0
+ Xpath 16777216 " X: 0
+ endfunction
+
+ if 1
+ try
+ Xpath 33554432 " X: 33554432
+ call G()
+ Xpath 67108864 " X: 0
+ finally
+ Xpath 134217728 " X: 134217728
+ endtry | Xpath 268435456 " X: 0
+ endif | Xpath 536870912 " X: 0
+ Xpath 1073741824 " X: 0
+endif
+
+Xcheck 170428555
+
+
+"-------------------------------------------------------------------------------
+" Test 30: Executing :finally clauses on interrupt {{{1
+"
+" After an interrupt in a command dynamically enclosed in
+" a :try/:endtry region, :finally clauses are executed and the
+" script processing is terminated.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ XloopINIT 1 16
+
+ function! F()
+ try
+ Xloop 1 " X: 1 + 1*16
+ "INTERRUPT
+ Xloop 2 " X: 0
+ finally
+ Xloop 4 " X: 4 + 4*16
+ endtry
+ Xloop 8 " X: 0
+ endfunction
+
+ try
+ Xpath 256 " X: 256
+ try
+ Xpath 512 " X: 512
+ "INTERRUPT
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ try
+ Xpath 4096 " X: 4096
+ try
+ Xpath 8192 " X: 8192
+ finally
+ Xpath 16384 " X: 16384
+ try
+ Xpath 32768 " X: 32768
+ "INTERRUPT
+ Xpath 65536 " X: 0
+ endtry
+ Xpath 131072 " X: 0
+ endtry
+ Xpath 262144 " X: 0
+ endtry
+ Xpath 524288 " X: 0
+ endtry
+ Xpath 1048576 " X: 0
+ finally
+ Xpath 2097152 " X: 2097152
+ try
+ Xpath 4194304 " X: 4194304
+ call F()
+ Xpath 8388608 " X: 0
+ finally
+ Xpath 16777216 " X: 16777216
+ try
+ Xpath 33554432 " X: 33554432
+ XloopNEXT
+ ExecAsScript F
+ Xpath 67108864 " X: 0
+ finally
+ Xpath 134217728 " X: 134217728
+ endtry
+ Xpath 268435456 " X: 0
+ endtry
+ Xpath 536870912 " X: 0
+ endtry
+ Xpath 1073741824 " X: 0
+endif
+
+Xcheck 190905173
+
+
+"-------------------------------------------------------------------------------
+" Test 31: Executing :finally clauses after :throw {{{1
+"
+" After a :throw dynamically enclosed in a :try/:endtry region,
+" :finally clauses are executed and the script processing is
+" terminated.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ XloopINIT 1 16
+
+ function! F()
+ try
+ Xloop 1 " X: 1 + 1*16
+ throw "exception"
+ Xloop 2 " X: 0
+ finally
+ Xloop 4 " X: 4 + 4*16
+ endtry
+ Xloop 8 " X: 0
+ endfunction
+
+ try
+ Xpath 256 " X: 256
+ try
+ Xpath 512 " X: 512
+ throw "exception"
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ try
+ Xpath 4096 " X: 4096
+ try
+ Xpath 8192 " X: 8192
+ finally
+ Xpath 16384 " X: 16384
+ try
+ Xpath 32768 " X: 32768
+ throw "exception"
+ Xpath 65536 " X: 0
+ endtry
+ Xpath 131072 " X: 0
+ endtry
+ Xpath 262144 " X: 0
+ endtry
+ Xpath 524288 " X: 0
+ endtry
+ Xpath 1048576 " X: 0
+ finally
+ Xpath 2097152 " X: 2097152
+ try
+ Xpath 4194304 " X: 4194304
+ call F()
+ Xpath 8388608 " X: 0
+ finally
+ Xpath 16777216 " X: 16777216
+ try
+ Xpath 33554432 " X: 33554432
+ XloopNEXT
+ ExecAsScript F
+ Xpath 67108864 " X: 0
+ finally
+ Xpath 134217728 " X: 134217728
+ endtry
+ Xpath 268435456 " X: 0
+ endtry
+ Xpath 536870912 " X: 0
+ endtry
+ Xpath 1073741824 " X: 0
+endif
+
+Xcheck 190905173
+
+
+"-------------------------------------------------------------------------------
+" Test 32: Remembering the :return value on :finally {{{1
+"
+" If a :finally clause is executed due to a :return specifying
+" a value, this is the value visible to the caller if not overwritten
+" by a new :return in the :finally clause. A :return without a value
+" in the :finally clause overwrites with value 0.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ try
+ Xpath 1 " X: 1
+ try
+ Xpath 2 " X: 2
+ return "ABCD"
+ Xpath 4 " X: 0
+ finally
+ Xpath 8 " X: 8
+ endtry
+ Xpath 16 " X: 0
+ finally
+ Xpath 32 " X: 32
+ endtry
+ Xpath 64 " X: 0
+endfunction
+
+function! G()
+ try
+ Xpath 128 " X: 128
+ return 8
+ Xpath 256 " X: 0
+ finally
+ Xpath 512 " X: 512
+ return 16 + strlen(F())
+ Xpath 1024 " X: 0
+ endtry
+ Xpath 2048 " X: 0
+endfunction
+
+function! H()
+ try
+ Xpath 4096 " X: 4096
+ return 32
+ Xpath 8192 " X: 0
+ finally
+ Xpath 16384 " X: 16384
+ return
+ Xpath 32768 " X: 0
+ endtry
+ Xpath 65536 " X: 0
+endfunction
+
+function! I()
+ try
+ Xpath 131072 " X: 131072
+ finally
+ Xpath 262144 " X: 262144
+ return G() + H() + 64
+ Xpath 524288 " X: 0
+ endtry
+ Xpath 1048576 " X: 0
+endfunction
+
+let retcode = I()
+Xpath 2097152 " X: 2097152
+
+if retcode < 0
+ Xpath 4194304 " X: 0
+endif
+if retcode % 4
+ Xpath 8388608 " X: 0
+endif
+if (retcode/4) % 2
+ Xpath 16777216 " X: 16777216
+endif
+if (retcode/8) % 2
+ Xpath 33554432 " X: 0
+endif
+if (retcode/16) % 2
+ Xpath 67108864 " X: 67108864
+endif
+if (retcode/32) % 2
+ Xpath 134217728 " X: 0
+endif
+if (retcode/64) % 2
+ Xpath 268435456 " X: 268435456
+endif
+if retcode/128
+ Xpath 536870912 " X: 0
+endif
+
+unlet retcode
+delfunction F
+delfunction G
+delfunction H
+delfunction I
+
+Xcheck 354833067
+
+
+"-------------------------------------------------------------------------------
+" Test 33: :return under :execute or user command and :finally {{{1
+"
+" A :return command may be executed under an ":execute" or from
+" a user command. Executing of :finally clauses and passing through
+" the return code works also then.
+"-------------------------------------------------------------------------------
+XpathINIT
+
+command! -nargs=? RETURN
+ \ try | return <args> | finally | return <args> * 2 | endtry
+
+function! F()
+ try
+ RETURN 8
+ Xpath 1 " X: 0
+ finally
+ Xpath 2 " X: 2
+ endtry
+ Xpath 4 " X: 0
+endfunction
+
+function! G()
+ try
+ RETURN 32
+ Xpath 8 " X: 0
+ finally
+ Xpath 16 " X: 16
+ RETURN 128
+ Xpath 32 " X: 0
+ endtry
+ Xpath 64 " X: 0
+endfunction
+
+function! H()
+ try
+ execute "try | return 512 | finally | return 1024 | endtry"
+ Xpath 128 " X: 0
+ finally
+ Xpath 256 " X: 256
+ endtry
+ Xpath 512 " X: 0
+endfunction
+
+function! I()
+ try
+ execute "try | return 2048 | finally | return 4096 | endtry"
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ execute "try | return 8192 | finally | return 16384 | endtry"
+ Xpath 4096 " X: 0
+ endtry
+ Xpath 8192 " X: 0
+endfunction
+
+function! J()
+ try
+ RETURN 32768
+ Xpath 16384 " X: 0
+ finally
+ Xpath 32768 " X: 32768
+ return
+ Xpath 65536 " X: 0
+ endtry
+ Xpath 131072 " X: 0
+endfunction
+
+function! K()
+ try
+ execute "try | return 131072 | finally | return 262144 | endtry"
+ Xpath 262144 " X: 0
+ finally
+ Xpath 524288 " X: 524288
+ execute "try | return 524288 | finally | return | endtry"
+ Xpath 1048576 " X: 0
+ endtry
+ Xpath 2097152 " X: 0
+endfunction
+
+function! L()
+ try
+ return
+ Xpath 4194304 " X: 0
+ finally
+ Xpath 8388608 " X: 8388608
+ RETURN 1048576
+ Xpath 16777216 " X: 0
+ endtry
+ Xpath 33554432 " X: 0
+endfunction
+
+function! M()
+ try
+ return
+ Xpath 67108864 " X: 0
+ finally
+ Xpath 134217728 " X: 134217728
+ execute "try | return 4194304 | finally | return 8388608 | endtry"
+ Xpath 268435456 " X: 0
+ endtry
+ Xpath 536870912 " X: 0
+endfunction
+
+function! N()
+ RETURN 16777216
+endfunction
+
+function! O()
+ execute "try | return 67108864 | finally | return 134217728 | endtry"
+endfunction
+
+let sum = F() + G() + H() + I() + J() + K() + L() + M()
+let expected = 16 + 256 + 1024 + 16384 + 0 + 0 + 2097152 + 8388608
+let sum = sum + N() + O()
+let expected = expected + 33554432 + 134217728
+
+if sum == expected
+ Xout "sum = " . sum . " (ok)"
+else
+ Xout "sum = " . sum . ", expected: " . expected
+endif
+
+Xpath 1073741824 " X: 1073741824
+
+if sum != expected
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+endif
+
+unlet sum expected
+delfunction F
+delfunction G
+delfunction H
+delfunction I
+delfunction J
+delfunction K
+delfunction L
+delfunction M
+delfunction N
+delfunction O
+
+Xcheck 1216907538
+
+
+"-------------------------------------------------------------------------------
+" Test 34: :finally reason discarded by :continue {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by a :continue in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 8
+
+ function! C(jump)
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return" || a:jump == "finish"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ continue " discards jump that caused the :finally
+ Xloop 1 " X: 0
+ endtry
+ Xloop 2 " X: 0
+ elseif loop == 2
+ Xloop 4 " X: 4*(1+8+64+512+4096+32768+262144)
+ endif
+ endwhile
+ endfunction
+
+ call C("continue")
+ Xpath 2097152 " X: 2097152
+ call C("break")
+ Xpath 4194304 " X: 4194304
+ call C("return")
+ Xpath 8388608 " X: 8388608
+ let g:jump = "finish"
+ ExecAsScript C
+ unlet g:jump
+ Xpath 16777216 " X: 16777216
+ try
+ call C("error")
+ Xpath 33554432 " X: 33554432
+ finally
+ Xpath 67108864 " X: 67108864
+ try
+ call C("interrupt")
+ Xpath 134217728 " X: 134217728
+ finally
+ Xpath 268435456 " X: 268435456
+ call C("throw")
+ Xpath 536870912 " X: 536870912
+ endtry
+ endtry
+ Xpath 1073741824 " X: 1073741824
+
+ delfunction C
+
+endif
+
+Xcheck 2146584868
+
+
+"-------------------------------------------------------------------------------
+" Test 35: :finally reason discarded by :break {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by a :break in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 8
+
+ function! B(jump)
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return" || a:jump == "finish"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ break " discards jump that caused the :finally
+ Xloop 1 " X: 0
+ endtry
+ elseif loop == 2
+ Xloop 2 " X: 0
+ endif
+ endwhile
+ Xloop 4 " X: 4*(1+8+64+512+4096+32768+262144)
+ endfunction
+
+ call B("continue")
+ Xpath 2097152 " X: 2097152
+ call B("break")
+ Xpath 4194304 " X: 4194304
+ call B("return")
+ Xpath 8388608 " X: 8388608
+ let g:jump = "finish"
+ ExecAsScript B
+ unlet g:jump
+ Xpath 16777216 " X: 16777216
+ try
+ call B("error")
+ Xpath 33554432 " X: 33554432
+ finally
+ Xpath 67108864 " X: 67108864
+ try
+ call B("interrupt")
+ Xpath 134217728 " X: 134217728
+ finally
+ Xpath 268435456 " X: 268435456
+ call B("throw")
+ Xpath 536870912 " X: 536870912
+ endtry
+ endtry
+ Xpath 1073741824 " X: 1073741824
+
+ delfunction B
+
+endif
+
+Xcheck 2146584868
+
+
+"-------------------------------------------------------------------------------
+" Test 36: :finally reason discarded by :return {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by a :return in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 8
+
+ function! R(jump, retval) abort
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ return a:retval " discards jump that caused the :finally
+ Xloop 1 " X: 0
+ endtry
+ elseif loop == 2
+ Xloop 2 " X: 0
+ endif
+ endwhile
+ Xloop 4 " X: 0
+ endfunction
+
+ let sum = -R("continue", -8)
+ Xpath 2097152 " X: 2097152
+ let sum = sum - R("break", -16)
+ Xpath 4194304 " X: 4194304
+ let sum = sum - R("return", -32)
+ Xpath 8388608 " X: 8388608
+ try
+ let sum = sum - R("error", -64)
+ Xpath 16777216 " X: 16777216
+ finally
+ Xpath 33554432 " X: 33554432
+ try
+ let sum = sum - R("interrupt", -128)
+ Xpath 67108864 " X: 67108864
+ finally
+ Xpath 134217728 " X: 134217728
+ let sum = sum - R("throw", -256)
+ Xpath 268435456 " X: 268435456
+ endtry
+ endtry
+ Xpath 536870912 " X: 536870912
+
+ let expected = 8 + 16 + 32 + 64 + 128 + 256
+ if sum != expected
+ Xpath 1073741824 " X: 0
+ Xout "sum =" . sum . ", expected: " . expected
+ endif
+
+ unlet sum expected
+ delfunction R
+
+endif
+
+Xcheck 1071644672
+
+
+"-------------------------------------------------------------------------------
+" Test 37: :finally reason discarded by :finish {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by a :finish in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 8
+
+ function! F(jump) " not executed as function, transformed to a script
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "finish"
+ finish
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ finish " discards jump that caused the :finally
+ Xloop 1 " X: 0
+ endtry
+ elseif loop == 2
+ Xloop 2 " X: 0
+ endif
+ endwhile
+ Xloop 4 " X: 0
+ endfunction
+
+ let scriptF = MakeScript("F")
+ delfunction F
+
+ let g:jump = "continue"
+ exec "source" scriptF
+ Xpath 2097152 " X: 2097152
+ let g:jump = "break"
+ exec "source" scriptF
+ Xpath 4194304 " X: 4194304
+ let g:jump = "finish"
+ exec "source" scriptF
+ Xpath 8388608 " X: 8388608
+ try
+ let g:jump = "error"
+ exec "source" scriptF
+ Xpath 16777216 " X: 16777216
+ finally
+ Xpath 33554432 " X: 33554432
+ try
+ let g:jump = "interrupt"
+ exec "source" scriptF
+ Xpath 67108864 " X: 67108864
+ finally
+ Xpath 134217728 " X: 134217728
+ try
+ let g:jump = "throw"
+ exec "source" scriptF
+ Xpath 268435456 " X: 268435456
+ finally
+ Xpath 536870912 " X: 536870912
+ endtry
+ endtry
+ endtry
+ unlet g:jump
+
+ call delete(scriptF)
+ unlet scriptF
+
+endif
+
+Xcheck 1071644672
+
+
+"-------------------------------------------------------------------------------
+" Test 38: :finally reason discarded by an error {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by an error in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 4
+
+ function! E(jump)
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return" || a:jump == "finish"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ asdf " error; discards jump that caused the :finally
+ endtry
+ elseif loop == 2
+ Xloop 1 " X: 0
+ endif
+ endwhile
+ Xloop 2 " X: 0
+ endfunction
+
+ try
+ Xpath 16384 " X: 16384
+ call E("continue")
+ Xpath 32768 " X: 0
+ finally
+ try
+ Xpath 65536 " X: 65536
+ call E("break")
+ Xpath 131072 " X: 0
+ finally
+ try
+ Xpath 262144 " X: 262144
+ call E("return")
+ Xpath 524288 " X: 0
+ finally
+ try
+ Xpath 1048576 " X: 1048576
+ let g:jump = "finish"
+ ExecAsScript E
+ Xpath 2097152 " X: 0
+ finally
+ unlet g:jump
+ try
+ Xpath 4194304 " X: 4194304
+ call E("error")
+ Xpath 8388608 " X: 0
+ finally
+ try
+ Xpath 16777216 " X: 16777216
+ call E("interrupt")
+ Xpath 33554432 " X: 0
+ finally
+ try
+ Xpath 67108864 " X: 67108864
+ call E("throw")
+ Xpath 134217728 " X: 0
+ finally
+ Xpath 268435456 " X: 268435456
+ delfunction E
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ Xpath 536870912 " X: 0
+
+endif
+
+Xcheck 357908480
+
+
+"-------------------------------------------------------------------------------
+" Test 39: :finally reason discarded by an interrupt {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by an interrupt in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 4
+
+ function! I(jump)
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return" || a:jump == "finish"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ "INTERRUPT - discards jump that caused the :finally
+ let dummy = 0
+ endtry
+ elseif loop == 2
+ Xloop 1 " X: 0
+ endif
+ endwhile
+ Xloop 2 " X: 0
+ endfunction
+
+ try
+ Xpath 16384 " X: 16384
+ call I("continue")
+ Xpath 32768 " X: 0
+ finally
+ try
+ Xpath 65536 " X: 65536
+ call I("break")
+ Xpath 131072 " X: 0
+ finally
+ try
+ Xpath 262144 " X: 262144
+ call I("return")
+ Xpath 524288 " X: 0
+ finally
+ try
+ Xpath 1048576 " X: 1048576
+ let g:jump = "finish"
+ ExecAsScript I
+ Xpath 2097152 " X: 0
+ finally
+ unlet g:jump
+ try
+ Xpath 4194304 " X: 4194304
+ call I("error")
+ Xpath 8388608 " X: 0
+ finally
+ try
+ Xpath 16777216 " X: 16777216
+ call I("interrupt")
+ Xpath 33554432 " X: 0
+ finally
+ try
+ Xpath 67108864 " X: 67108864
+ call I("throw")
+ Xpath 134217728 " X: 0
+ finally
+ Xpath 268435456 " X: 268435456
+ delfunction I
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ Xpath 536870912 " X: 0
+
+endif
+
+Xcheck 357908480
+
+
+"-------------------------------------------------------------------------------
+" Test 40: :finally reason discarded by :throw {{{1
+"
+" When a :finally clause is executed due to a :continue, :break,
+" :return, :finish, error, interrupt or :throw, the jump reason is
+" discarded by a :throw in the finally clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 4
+
+ function! T(jump)
+ XloopNEXT
+ let loop = 0
+ while loop < 2
+ let loop = loop + 1
+ if loop == 1
+ try
+ if a:jump == "continue"
+ continue
+ elseif a:jump == "break"
+ break
+ elseif a:jump == "return" || a:jump == "finish"
+ return
+ elseif a:jump == "error"
+ asdf
+ elseif a:jump == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:jump == "throw"
+ throw "abc"
+ endif
+ finally
+ throw "xyz" " discards jump that caused the :finally
+ endtry
+ elseif loop == 2
+ Xloop 1 " X: 0
+ endif
+ endwhile
+ Xloop 2 " X: 0
+ endfunction
+
+ try
+ Xpath 16384 " X: 16384
+ call T("continue")
+ Xpath 32768 " X: 0
+ finally
+ try
+ Xpath 65536 " X: 65536
+ call T("break")
+ Xpath 131072 " X: 0
+ finally
+ try
+ Xpath 262144 " X: 262144
+ call T("return")
+ Xpath 524288 " X: 0
+ finally
+ try
+ Xpath 1048576 " X: 1048576
+ let g:jump = "finish"
+ ExecAsScript T
+ Xpath 2097152 " X: 0
+ finally
+ unlet g:jump
+ try
+ Xpath 4194304 " X: 4194304
+ call T("error")
+ Xpath 8388608 " X: 0
+ finally
+ try
+ Xpath 16777216 " X: 16777216
+ call T("interrupt")
+ Xpath 33554432 " X: 0
+ finally
+ try
+ Xpath 67108864 " X: 67108864
+ call T("throw")
+ Xpath 134217728 " X: 0
+ finally
+ Xpath 268435456 " X: 268435456
+ delfunction T
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ endtry
+ Xpath 536870912 " X: 0
+
+endif
+
+Xcheck 357908480
+
+
+"-------------------------------------------------------------------------------
+" Test 41: Skipped :throw finding next command {{{1
+"
+" A :throw in an inactive conditional must not hide a following
+" command.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F()
+ Xpath 1 " X: 1
+ if 0 | throw "never" | endif | Xpath 2 " X: 2
+ Xpath 4 " X: 4
+endfunction
+
+function! G()
+ Xpath 8 " X: 8
+ while 0 | throw "never" | endwhile | Xpath 16 " X: 16
+ Xpath 32 " X: 32
+endfunction
+
+function H()
+ Xpath 64 " X: 64
+ if 0 | try | throw "never" | endtry | endif | Xpath 128 " X: 128
+ Xpath 256 " X: 256
+endfunction
+
+Xpath 512 " X: 512
+
+try
+ Xpath 1024 " X: 1024
+ call F()
+ Xpath 2048 " X: 2048
+catch /.*/
+ Xpath 4096 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 8192 " X: 8192
+
+try
+ Xpath 16384 " X: 16384
+ call G()
+ Xpath 32768 " X: 32768
+catch /.*/
+ Xpath 65536 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 131072 " X: 131072
+
+try
+ Xpath 262144 " X: 262144
+ call H()
+ Xpath 524288 " X: 524288
+catch /.*/
+ Xpath 1048576 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 2097152 " X: 2097152
+
+delfunction F
+delfunction G
+delfunction H
+
+Xcheck 3076095
+
+
+"-------------------------------------------------------------------------------
+" Test 42: Catching number and string exceptions {{{1
+"
+" When a number is thrown, it is converted to a string exception.
+" Numbers and strings may be caught by specifying a regular exception
+" as argument to the :catch command.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+try
+
+ try
+ Xpath 1 " X: 1
+ throw 4711
+ Xpath 2 " X: 0
+ catch /4711/
+ Xpath 4 " X: 4
+ endtry
+
+ try
+ Xpath 8 " X: 8
+ throw 4711
+ Xpath 16 " X: 0
+ catch /^4711$/
+ Xpath 32 " X: 32
+ endtry
+
+ try
+ Xpath 64 " X: 64
+ throw 4711
+ Xpath 128 " X: 0
+ catch /\d/
+ Xpath 256 " X: 256
+ endtry
+
+ try
+ Xpath 512 " X: 512
+ throw 4711
+ Xpath 1024 " X: 0
+ catch /^\d\+$/
+ Xpath 2048 " X: 2048
+ endtry
+
+ try
+ Xpath 4096 " X: 4096
+ throw "arrgh"
+ Xpath 8192 " X: 0
+ catch /arrgh/
+ Xpath 16384 " X: 16384
+ endtry
+
+ try
+ Xpath 32768 " X: 32768
+ throw "arrgh"
+ Xpath 65536 " X: 0
+ catch /^arrgh$/
+ Xpath 131072 " X: 131072
+ endtry
+
+ try
+ Xpath 262144 " X: 262144
+ throw "arrgh"
+ Xpath 524288 " X: 0
+ catch /\l/
+ Xpath 1048576 " X: 1048576
+ endtry
+
+ try
+ Xpath 2097152 " X: 2097152
+ throw "arrgh"
+ Xpath 4194304 " X: 0
+ catch /^\l\+$/
+ Xpath 8388608 " X: 8388608
+ endtry
+
+ try
+ try
+ Xpath 16777216 " X: 16777216
+ throw "ARRGH"
+ Xpath 33554432 " X: 0
+ catch /^arrgh$/
+ Xpath 67108864 " X: 0
+ endtry
+ catch /^\carrgh$/
+ Xpath 134217728 " X: 134217728
+ endtry
+
+ try
+ Xpath 268435456 " X: 268435456
+ throw ""
+ Xpath 536870912 " X: 0
+ catch /^$/
+ Xpath 1073741824 " X: 1073741824
+ endtry
+
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xcheck 1505155949
+
+
+"-------------------------------------------------------------------------------
+" Test 43: Selecting the correct :catch clause {{{1
+"
+" When an exception is thrown and there are multiple :catch clauses,
+" the first matching one is taken.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT 1 1024
+let loops = 3
+while loops > 0
+ try
+ if loops == 3
+ Xloop 1 " X: 1
+ throw "a"
+ Xloop 2 " X: 0
+ elseif loops == 2
+ Xloop 4 " X: 4*1024
+ throw "ab"
+ Xloop 8 " X: 0
+ elseif loops == 1
+ Xloop 16 " X: 16*1024*1024
+ throw "abc"
+ Xloop 32 " X: 0
+ endif
+ catch /abc/
+ Xloop 64 " X: 64*1024*1024
+ catch /ab/
+ Xloop 128 " X: 128*1024
+ catch /.*/
+ Xloop 256 " X: 256
+ catch /a/
+ Xloop 512 " X: 0
+ endtry
+
+ let loops = loops - 1
+ XloopNEXT
+endwhile
+Xpath 1073741824 " X: 1073741824
+
+unlet loops
+
+Xcheck 1157763329
+
+
+"-------------------------------------------------------------------------------
+" Test 44: Missing or empty :catch patterns {{{1
+"
+" A missing or empty :catch pattern means the same as /.*/, that is,
+" catches everything. To catch only empty exceptions, /^$/ must be
+" used. A :catch with missing, empty, or /.*/ argument also works
+" when followed by another command separated by a bar on the same
+" line. :catch patterns cannot be specified between ||. But other
+" pattern separators can be used instead of //.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+try
+ try
+ Xpath 1 " X: 1
+ throw ""
+ catch /^$/
+ Xpath 2 " X: 2
+ endtry
+
+ try
+ Xpath 4 " X: 4
+ throw ""
+ catch /.*/
+ Xpath 8 " X: 8
+ endtry
+
+ try
+ Xpath 16 " X: 16
+ throw ""
+ catch //
+ Xpath 32 " X: 32
+ endtry
+
+ try
+ Xpath 64 " X: 64
+ throw ""
+ catch
+ Xpath 128 " X: 128
+ endtry
+
+ try
+ Xpath 256 " X: 256
+ throw "oops"
+ catch /^$/
+ Xpath 512 " X: 0
+ catch /.*/
+ Xpath 1024 " X: 1024
+ endtry
+
+ try
+ Xpath 2048 " X: 2048
+ throw "arrgh"
+ catch /^$/
+ Xpath 4096 " X: 0
+ catch //
+ Xpath 8192 " X: 8192
+ endtry
+
+ try
+ Xpath 16384 " X: 16384
+ throw "brrr"
+ catch /^$/
+ Xpath 32768 " X: 0
+ catch
+ Xpath 65536 " X: 65536
+ endtry
+
+ try | Xpath 131072 | throw "x" | catch /.*/ | Xpath 262144 | endtry
+ " X: 131072 + 262144
+
+ try | Xpath 524288 | throw "y" | catch // | Xpath 1048576 | endtry
+ " X: 524288 + 1048576
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ " Extra try level: if ":catch" without arguments below raises
+ " a syntax error because it misinterprets the "Xpath" as a pattern,
+ " let it be caught by the ":catch /.*/" below.
+ try
+ try | Xpath 2097152 | throw "z" | catch | Xpath 4194304 | :
+ endtry " X: 2097152 + 4194304
+ endtry
+ catch /.*/
+ let caught = 1
+ Xout v:exception "in" v:throwpoint
+ finally
+ if $VIMNOERRTHROW && v:errmsg != ""
+ Xout v:errmsg
+ endif
+ if caught || $VIMNOERRTHROW && v:errmsg != ""
+ Xpath 8388608 " X: 0
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ let cologne = 4711
+ try
+ try
+ Xpath 16777216 " X: 16777216
+ throw "throw cologne"
+ " Next lines catches all and throws 4711:
+ catch |throw cologne|
+ Xpath 33554432 " X: 0
+ endtry
+ catch /4711/
+ Xpath 67108864 " X: 67108864
+ endtry
+
+ try
+ Xpath 134217728 " X: 134217728
+ throw "plus"
+ catch +plus+
+ Xpath 268435456 " X: 268435456
+ endtry
+
+ Xpath 536870912 " X: 536870912
+catch /.*/
+ Xpath 1073741824 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+unlet! caught cologne
+
+Xcheck 1031761407
+
+
+"-------------------------------------------------------------------------------
+" Test 45: Catching exceptions from nested :try blocks {{{1
+"
+" When :try blocks are nested, an exception is caught by the innermost
+" try conditional that has a matching :catch clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT 1 1024
+let loops = 3
+while loops > 0
+ try
+ try
+ try
+ try
+ if loops == 3
+ Xloop 1 " X: 1
+ throw "a"
+ Xloop 2 " X: 0
+ elseif loops == 2
+ Xloop 4 " X: 4*1024
+ throw "ab"
+ Xloop 8 " X: 0
+ elseif loops == 1
+ Xloop 16 " X: 16*1024*1024
+ throw "abc"
+ Xloop 32 " X: 0
+ endif
+ catch /abc/
+ Xloop 64 " X: 64*1024*1024
+ endtry
+ catch /ab/
+ Xloop 128 " X: 128*1024
+ endtry
+ catch /.*/
+ Xloop 256 " X: 256
+ endtry
+ catch /a/
+ Xloop 512 " X: 0
+ endtry
+
+ let loops = loops - 1
+ XloopNEXT
+endwhile
+Xpath 1073741824 " X: 1073741824
+
+unlet loops
+
+Xcheck 1157763329
+
+
+"-------------------------------------------------------------------------------
+" Test 46: Executing :finally after a :throw in nested :try {{{1
+"
+" When an exception is thrown from within nested :try blocks, the
+" :finally clauses of the non-catching try conditionals should be
+" executed before the matching :catch of the next surrounding :try
+" gets the control. If this also has a :finally clause, it is
+" executed afterwards.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let sum = 0
+
+try
+ Xpath 1 " X: 1
+ try
+ Xpath 2 " X: 2
+ try
+ Xpath 4 " X: 4
+ try
+ Xpath 8 " X: 8
+ throw "ABC"
+ Xpath 16 " X: 0
+ catch /xyz/
+ Xpath 32 " X: 0
+ finally
+ Xpath 64 " X: 64
+ if sum != 0
+ Xpath 128 " X: 0
+ endif
+ let sum = sum + 1
+ endtry
+ Xpath 256 " X: 0
+ catch /123/
+ Xpath 512 " X: 0
+ catch /321/
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ if sum != 1
+ Xpath 4096 " X: 0
+ endif
+ let sum = sum + 2
+ endtry
+ Xpath 8192 " X: 0
+ finally
+ Xpath 16384 " X: 16384
+ if sum != 3
+ Xpath 32768 " X: 0
+ endif
+ let sum = sum + 4
+ endtry
+ Xpath 65536 " X: 0
+catch /ABC/
+ Xpath 131072 " X: 131072
+ if sum != 7
+ Xpath 262144 " X: 0
+ endif
+ let sum = sum + 8
+finally
+ Xpath 524288 " X: 524288
+ if sum != 15
+ Xpath 1048576 " X: 0
+ endif
+ let sum = sum + 16
+endtry
+Xpath 65536 " X: 65536
+if sum != 31
+ Xpath 131072 " X: 0
+endif
+
+unlet sum
+
+Xcheck 739407
+
+
+"-------------------------------------------------------------------------------
+" Test 47: Throwing exceptions from a :catch clause {{{1
+"
+" When an exception is thrown from a :catch clause, it should not be
+" caught by a :catch of the same :try conditional. After executing
+" the :finally clause (if present), surrounding try conditionals
+" should be checked for a matching :catch.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+Xpath 1 " X: 1
+try
+ Xpath 2 " X: 2
+ try
+ Xpath 4 " X: 4
+ try
+ Xpath 8 " X: 8
+ throw "x1"
+ Xpath 16 " X: 0
+ catch /x1/
+ Xpath 32 " X: 32
+ try
+ Xpath 64 " X: 64
+ throw "x2"
+ Xpath 128 " X: 0
+ catch /x1/
+ Xpath 256 " X: 0
+ catch /x2/
+ Xpath 512 " X: 512
+ try
+ Xpath 1024 " X: 1024
+ throw "x3"
+ Xpath 2048 " X: 0
+ catch /x1/
+ Xpath 4096 " X: 0
+ catch /x2/
+ Xpath 8192 " X: 0
+ finally
+ Xpath 16384 " X: 16384
+ endtry
+ Xpath 32768 " X: 0
+ catch /x3/
+ Xpath 65536 " X: 0
+ endtry
+ Xpath 131072 " X: 0
+ catch /x1/
+ Xpath 262144 " X: 0
+ catch /x2/
+ Xpath 524288 " X: 0
+ catch /x3/
+ Xpath 1048576 " X: 0
+ finally
+ Xpath 2097152 " X: 2097152
+ endtry
+ Xpath 4194304 " X: 0
+ catch /x1/
+ Xpath 8388608 " X: 0
+ catch /x2/
+ Xpath 16777216 " X: 0
+ catch /x3/
+ Xpath 33554432 " X: 33554432
+ endtry
+ Xpath 67108864 " X: 67108864
+catch /.*/
+ Xpath 134217728 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+Xpath 268435456 " X: 268435456
+
+Xcheck 371213935
+
+
+"-------------------------------------------------------------------------------
+" Test 48: Throwing exceptions from a :finally clause {{{1
+"
+" When an exception is thrown from a :finally clause, it should not be
+" caught by a :catch of the same :try conditional. Surrounding try
+" conditionals should be checked for a matching :catch. A previously
+" thrown exception is discarded.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+try
+
+ try
+ try
+ Xpath 1 " X: 1
+ catch /x1/
+ Xpath 2 " X: 0
+ finally
+ Xpath 4 " X: 4
+ throw "x1"
+ Xpath 8 " X: 0
+ endtry
+ Xpath 16 " X: 0
+ catch /x1/
+ Xpath 32 " X: 32
+ endtry
+ Xpath 64 " X: 64
+
+ try
+ try
+ Xpath 128 " X: 128
+ throw "x2"
+ Xpath 256 " X: 0
+ catch /x2/
+ Xpath 512 " X: 512
+ catch /x3/
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ throw "x3"
+ Xpath 4096 " X: 0
+ endtry
+ Xpath 8192 " X: 0
+ catch /x2/
+ Xpath 16384 " X: 0
+ catch /x3/
+ Xpath 32768 " X: 32768
+ endtry
+ Xpath 65536 " X: 65536
+
+ try
+ try
+ try
+ Xpath 131072 " X: 131072
+ throw "x4"
+ Xpath 262144 " X: 0
+ catch /x5/
+ Xpath 524288 " X: 0
+ finally
+ Xpath 1048576 " X: 1048576
+ throw "x5" " discards "x4"
+ Xpath 2097152 " X: 0
+ endtry
+ Xpath 4194304 " X: 0
+ catch /x4/
+ Xpath 8388608 " X: 0
+ finally
+ Xpath 16777216 " X: 16777216
+ endtry
+ Xpath 33554432 " X: 0
+ catch /x5/
+ Xpath 67108864 " X: 67108864
+ endtry
+ Xpath 134217728 " X: 134217728
+
+catch /.*/
+ Xpath 268435456 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+Xpath 536870912 " X: 536870912
+
+Xcheck 756255461
+
+
+"-------------------------------------------------------------------------------
+" Test 49: Throwing exceptions accross functions {{{1
+"
+" When an exception is thrown but not caught inside a function, the
+" caller is checked for a matching :catch clause.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! C()
+ try
+ Xpath 1 " X: 1
+ throw "arrgh"
+ Xpath 2 " X: 0
+ catch /arrgh/
+ Xpath 4 " X: 4
+ endtry
+ Xpath 8 " X: 8
+endfunction
+
+XloopINIT! 16 16
+
+function! T1()
+ XloopNEXT
+ try
+ Xloop 1 " X: 16 + 16*16
+ throw "arrgh"
+ Xloop 2 " X: 0
+ finally
+ Xloop 4 " X: 64 + 64*16
+ endtry
+ Xloop 8 " X: 0
+endfunction
+
+function! T2()
+ try
+ Xpath 4096 " X: 4096
+ call T1()
+ Xpath 8192 " X: 0
+ finally
+ Xpath 16384 " X: 16384
+ endtry
+ Xpath 32768 " X: 0
+endfunction
+
+try
+ Xpath 65536 " X: 65536
+ call C() " throw and catch
+ Xpath 131072 " X: 131072
+catch /.*/
+ Xpath 262144 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+try
+ Xpath 524288 " X: 524288
+ call T1() " throw, one level
+ Xpath 1048576 " X: 0
+catch /arrgh/
+ Xpath 2097152 " X: 2097152
+catch /.*/
+ Xpath 4194304 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+try
+ Xpath 8388608 " X: 8388608
+ call T2() " throw, two levels
+ Xpath 16777216 " X: 0
+catch /arrgh/
+ Xpath 33554432 " X: 33554432
+catch /.*/
+ Xpath 67108864 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+Xpath 134217728 " X: 134217728
+
+Xcheck 179000669
+
+" Leave C, T1, and T2 for execution as scripts in the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 50: Throwing exceptions accross script files {{{1
+"
+" When an exception is thrown but not caught inside a script file,
+" the sourcing script or function is checked for a matching :catch
+" clause.
+"
+" This test executes the bodies of the functions C, T1, and T2 from
+" the previous test as script files (:return replaced by :finish).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let scriptC = MakeScript("C") " X: 1 + 4 + 8
+delfunction C
+
+XloopINIT! 16 16
+
+let scriptT1 = MakeScript("T1") " X: 16 + 64 + 16*16 + 64*16
+delfunction T1
+
+let scriptT2 = MakeScript("T2", scriptT1) " X: 4096 + 16384
+delfunction T2
+
+function! F()
+ try
+ Xpath 65536 " X: 65536
+ exec "source" g:scriptC
+ Xpath 131072 " X: 131072
+ catch /.*/
+ Xpath 262144 " X: 0
+ Xout v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 524288 " X: 524288
+ exec "source" g:scriptT1
+ Xpath 1048576 " X: 0
+ catch /arrgh/
+ Xpath 2097152 " X: 2097152
+ catch /.*/
+ Xpath 4194304 " X: 0
+ Xout v:exception "in" v:throwpoint
+ endtry
+endfunction
+
+try
+ Xpath 8388608 " X: 8388608
+ call F()
+ Xpath 16777216 " X: 16777216
+ exec "source" scriptT2
+ Xpath 33554432 " X: 0
+catch /arrgh/
+ Xpath 67108864 " X: 67108864
+catch /.*/
+ Xpath 134217728 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+Xpath 268435456 " X: 268435456
+
+call delete(scriptC)
+call delete(scriptT1)
+call delete(scriptT2)
+unlet scriptC scriptT1 scriptT2
+delfunction F
+
+Xcheck 363550045
+
+
+"-------------------------------------------------------------------------------
+" Test 51: Throwing exceptions accross :execute and user commands {{{1
+"
+" A :throw command may be executed under an ":execute" or from
+" a user command.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+command! -nargs=? THROW1 throw <args> | throw 1
+command! -nargs=? THROW2 try | throw <args> | endtry | throw 2
+command! -nargs=? THROW3 try | throw 3 | catch /3/ | throw <args> | endtry
+command! -nargs=? THROW4 try | throw 4 | finally | throw <args> | endtry
+
+try
+
+ try
+ try
+ Xpath 1 " X: 1
+ THROW1 "A"
+ catch /A/
+ Xpath 2 " X: 2
+ endtry
+ catch /1/
+ Xpath 4 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 8 " X: 8
+ THROW2 "B"
+ catch /B/
+ Xpath 16 " X: 16
+ endtry
+ catch /2/
+ Xpath 32 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 64 " X: 64
+ THROW3 "C"
+ catch /C/
+ Xpath 128 " X: 128
+ endtry
+ catch /3/
+ Xpath 256 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 512 " X: 512
+ THROW4 "D"
+ catch /D/
+ Xpath 1024 " X: 1024
+ endtry
+ catch /4/
+ Xpath 2048 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 4096 " X: 4096
+ execute 'throw "E" | throw 5'
+ catch /E/
+ Xpath 8192 " X: 8192
+ endtry
+ catch /5/
+ Xpath 16384 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 32768 " X: 32768
+ execute 'try | throw "F" | endtry | throw 6'
+ catch /F/
+ Xpath 65536 " X: 65536
+ endtry
+ catch /6/
+ Xpath 131072 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 262144 " X: 262144
+ execute'try | throw 7 | catch /7/ | throw "G" | endtry'
+ catch /G/
+ Xpath 524288 " X: 524288
+ endtry
+ catch /7/
+ Xpath 1048576 " X: 0
+ endtry
+
+ try
+ try
+ Xpath 2097152 " X: 2097152
+ execute 'try | throw 8 | finally | throw "H" | endtry'
+ catch /H/
+ Xpath 4194304 " X: 4194304
+ endtry
+ catch /8/
+ Xpath 8388608 " X: 0
+ endtry
+
+catch /.*/
+ Xpath 16777216 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 33554432 " X: 33554432
+
+delcommand THROW1
+delcommand THROW2
+delcommand THROW3
+delcommand THROW4
+
+Xcheck 40744667
+
+
+"-------------------------------------------------------------------------------
+" Test 52: Uncaught exceptions {{{1
+"
+" When an exception is thrown but not caught, an error message is
+" displayed when the script is terminated. In case of an interrupt
+" or error exception, the normal interrupt or error message(s) are
+" displayed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let msgfile = tempname()
+
+function! MESSAGES(...)
+ try
+ exec "edit" g:msgfile
+ catch /^Vim(edit):/
+ return 0
+ endtry
+
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ let match = 1
+ norm gg
+
+ let num = a:0 / 2
+ let cnt = 1
+ while cnt <= num
+ let enr = a:{2*cnt - 1}
+ let emsg= a:{2*cnt}
+ let cnt = cnt + 1
+
+ if enr == ""
+ Xout "TODO: Add message number for:" emsg
+ elseif enr == "INT"
+ let enr = ""
+ endif
+ if enr == "" && !english
+ continue
+ endif
+ let pattern = (enr != "") ? enr . ':.*' : ''
+ if english
+ let pattern = pattern . emsg
+ endif
+ if !search(pattern, "W")
+ let match = 0
+ Xout "No match for:" pattern
+ endif
+ norm $
+ endwhile
+
+ bwipeout!
+ return match
+endfunction
+
+if ExtraVim(msgfile)
+ Xpath 1 " X: 1
+ throw "arrgh"
+endif
+
+Xpath 2 " X: 2
+if !MESSAGES('E605', "Exception not caught")
+ Xpath 4 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ try
+ Xpath 8 " X: 8
+ throw "oops"
+ catch /arrgh/
+ Xpath 16 " X: 0
+ endtry
+ Xpath 32 " X: 0
+endif
+
+Xpath 64 " X: 64
+if !MESSAGES('E605', "Exception not caught")
+ Xpath 128 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ function! T()
+ throw "brrr"
+ endfunction
+
+ try
+ Xpath 256 " X: 256
+ throw "arrgh"
+ catch /.*/
+ Xpath 512 " X: 512
+ call T()
+ endtry
+ Xpath 1024 " X: 0
+endif
+
+Xpath 2048 " X: 2048
+if !MESSAGES('E605', "Exception not caught")
+ Xpath 4096 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ try
+ Xpath 8192 " X: 8192
+ throw "arrgh"
+ finally
+ Xpath 16384 " X: 16384
+ throw "brrr"
+ endtry
+ Xpath 32768 " X: 0
+endif
+
+Xpath 65536 " X: 65536
+if !MESSAGES('E605', "Exception not caught")
+ Xpath 131072 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ try
+ Xpath 262144 " X: 262144
+ "INTERRUPT
+ endtry
+ Xpath 524288 " X: 0
+endif
+
+Xpath 1048576 " X: 1048576
+if !MESSAGES('INT', "Interrupted")
+ Xpath 2097152 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ try
+ Xpath 4194304 " X: 4194304
+ let x = novar " error E121/E15; exception: E121
+ catch /E15:/ " should not catch
+ Xpath 8388608 " X: 0
+ endtry
+ Xpath 16777216 " X: 0
+endif
+
+Xpath 33554432 " X: 33554432
+if !MESSAGES('E121', "Undefined variable", 'E15', "Invalid expression")
+ Xpath 67108864 " X: 0
+endif
+
+if ExtraVim(msgfile)
+ try
+ Xpath 134217728 " X: 134217728
+" unlet novar # " error E108/E488; exception: E488
+ catch /E108:/ " should not catch
+ Xpath 268435456 " X: 0
+ endtry
+ Xpath 536870912 " X: 0
+endif
+
+Xpath 1073741824 " X: 1073741824
+if !MESSAGES('E108', "No such variable", 'E488', "Trailing characters")
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+endif
+
+call delete(msgfile)
+unlet msgfile
+
+Xcheck 1247112011
+
+" Leave MESSAGES() for the next tests.
+
+
+"-------------------------------------------------------------------------------
+" Test 53: Nesting errors: :endif/:else/:elseif {{{1
+"
+" For nesting errors of :if conditionals the correct error messages
+" should be given.
+"
+" This test reuses the function MESSAGES() from the previous test.
+" This functions checks the messages in g:msgfile.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let msgfile = tempname()
+
+if ExtraVim(msgfile)
+" endif
+endif
+if MESSAGES('E580', ":endif without :if")
+ Xpath 1 " X: 1
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" endif
+" endwhile
+endif
+if MESSAGES('E580', ":endif without :if")
+ Xpath 2 " X: 2
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" endif
+" endtry
+endif
+if MESSAGES('E580', ":endif without :if")
+ Xpath 4 " X: 4
+endif
+
+if ExtraVim(msgfile)
+" try
+" endif
+" endtry
+endif
+if MESSAGES('E580', ":endif without :if")
+ Xpath 8 " X: 8
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" endif
+" endtry
+endif
+if MESSAGES('E580', ":endif without :if")
+ Xpath 16 " X: 16
+endif
+
+if ExtraVim(msgfile)
+" else
+endif
+if MESSAGES('E581', ":else without :if")
+ Xpath 32 " X: 32
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" else
+" endwhile
+endif
+if MESSAGES('E581', ":else without :if")
+ Xpath 64 " X: 64
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" else
+" endtry
+endif
+if MESSAGES('E581', ":else without :if")
+ Xpath 128 " X: 128
+endif
+
+if ExtraVim(msgfile)
+" try
+" else
+" endtry
+endif
+if MESSAGES('E581', ":else without :if")
+ Xpath 256 " X: 256
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" else
+" endtry
+endif
+if MESSAGES('E581', ":else without :if")
+ Xpath 512 " X: 512
+endif
+
+if ExtraVim(msgfile)
+" elseif
+endif
+if MESSAGES('E582', ":elseif without :if")
+ Xpath 1024 " X: 1024
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" elseif
+" endwhile
+endif
+if MESSAGES('E582', ":elseif without :if")
+ Xpath 2048 " X: 2048
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" elseif
+" endtry
+endif
+if MESSAGES('E582', ":elseif without :if")
+ Xpath 4096 " X: 4096
+endif
+
+if ExtraVim(msgfile)
+" try
+" elseif
+" endtry
+endif
+if MESSAGES('E582', ":elseif without :if")
+ Xpath 8192 " X: 8192
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" elseif
+" endtry
+endif
+if MESSAGES('E582', ":elseif without :if")
+ Xpath 16384 " X: 16384
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" else
+" else
+" endif
+endif
+if MESSAGES('E583', "multiple :else")
+ Xpath 32768 " X: 32768
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" else
+" elseif 1
+" endif
+endif
+if MESSAGES('E584', ":elseif after :else")
+ Xpath 65536 " X: 65536
+endif
+
+call delete(msgfile)
+unlet msgfile
+
+Xcheck 131071
+
+" Leave MESSAGES() for the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 54: Nesting errors: :while/:endwhile {{{1
+"
+" For nesting errors of :while conditionals the correct error messages
+" should be given.
+"
+" This test reuses the function MESSAGES() from the previous test.
+" This functions checks the messages in g:msgfile.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let msgfile = tempname()
+
+if ExtraVim(msgfile)
+" endwhile
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 1 " X: 1
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" endwhile
+" endif
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 2 " X: 2
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" if 1
+" endwhile
+endif
+if MESSAGES('E171', "Missing :endif")
+ Xpath 4 " X: 4
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" endwhile
+" endtry
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 8 " X: 8
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" try
+" finally
+" endwhile
+endif
+if MESSAGES('E600', "Missing :endtry")
+ Xpath 16 " X: 16
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" if 1
+" try
+" finally
+" endwhile
+endif
+if MESSAGES('E600', "Missing :endtry")
+ Xpath 32 " X: 32
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" try
+" finally
+" if 1
+" endwhile
+endif
+if MESSAGES('E171', "Missing :endif")
+ Xpath 64 " X: 64
+endif
+
+if ExtraVim(msgfile)
+" try
+" endwhile
+" endtry
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 128 " X: 128
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" try
+" endwhile
+" endtry
+" endwhile
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 256 " X: 256
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" endwhile
+" endtry
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 512 " X: 512
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" try
+" throw "a"
+" catch /a/
+" endwhile
+" endtry
+" endwhile
+endif
+if MESSAGES('E588', ":endwhile without :while")
+ Xpath 1024 " X: 1024
+endif
+
+
+call delete(msgfile)
+unlet msgfile
+
+Xcheck 2047
+
+" Leave MESSAGES() for the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 55: Nesting errors: :continue/:break {{{1
+"
+" For nesting errors of :continue and :break commands the correct
+" error messages should be given.
+"
+" This test reuses the function MESSAGES() from the previous test.
+" This functions checks the messages in g:msgfile.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let msgfile = tempname()
+
+if ExtraVim(msgfile)
+" continue
+endif
+if MESSAGES('E586', ":continue without :while")
+ Xpath 1 " X: 1
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" continue
+" endif
+endif
+if MESSAGES('E586', ":continue without :while")
+ Xpath 2 " X: 2
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" continue
+" endtry
+endif
+if MESSAGES('E586', ":continue without :while")
+ Xpath 4 " X: 4
+endif
+
+if ExtraVim(msgfile)
+" try
+" continue
+" endtry
+endif
+if MESSAGES('E586', ":continue without :while")
+ Xpath 8 " X: 8
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" continue
+" endtry
+endif
+if MESSAGES('E586', ":continue without :while")
+ Xpath 16 " X: 16
+endif
+
+if ExtraVim(msgfile)
+" break
+endif
+if MESSAGES('E587', ":break without :while")
+ Xpath 32 " X: 32
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" break
+" endif
+endif
+if MESSAGES('E587', ":break without :while")
+ Xpath 64 " X: 64
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" break
+" endtry
+endif
+if MESSAGES('E587', ":break without :while")
+ Xpath 128 " X: 128
+endif
+
+if ExtraVim(msgfile)
+" try
+" break
+" endtry
+endif
+if MESSAGES('E587', ":break without :while")
+ Xpath 256 " X: 256
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" break
+" endtry
+endif
+if MESSAGES('E587', ":break without :while")
+ Xpath 512 " X: 512
+endif
+
+call delete(msgfile)
+unlet msgfile
+
+Xcheck 1023
+
+" Leave MESSAGES() for the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 56: Nesting errors: :endtry {{{1
+"
+" For nesting errors of :try conditionals the correct error messages
+" should be given.
+"
+" This test reuses the function MESSAGES() from the previous test.
+" This functions checks the messages in g:msgfile.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let msgfile = tempname()
+
+if ExtraVim(msgfile)
+" endtry
+endif
+if MESSAGES('E602', ":endtry without :try")
+ Xpath 1 " X: 1
+endif
+
+if ExtraVim(msgfile)
+" if 1
+" endtry
+" endif
+endif
+if MESSAGES('E602', ":endtry without :try")
+ Xpath 2 " X: 2
+endif
+
+if ExtraVim(msgfile)
+" while 1
+" endtry
+" endwhile
+endif
+if MESSAGES('E602', ":endtry without :try")
+ Xpath 4 " X: 4
+endif
+
+if ExtraVim(msgfile)
+" try
+" if 1
+" endtry
+endif
+if MESSAGES('E171', "Missing :endif")
+ Xpath 8 " X: 8
+endif
+
+if ExtraVim(msgfile)
+" try
+" while 1
+" endtry
+endif
+if MESSAGES('E170', "Missing :endwhile")
+ Xpath 16 " X: 16
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" if 1
+" endtry
+endif
+if MESSAGES('E171', "Missing :endif")
+ Xpath 32 " X: 32
+endif
+
+if ExtraVim(msgfile)
+" try
+" finally
+" while 1
+" endtry
+endif
+if MESSAGES('E170', "Missing :endwhile")
+ Xpath 64 " X: 64
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" if 1
+" endtry
+endif
+if MESSAGES('E171', "Missing :endif")
+ Xpath 128 " X: 128
+endif
+
+if ExtraVim(msgfile)
+" try
+" throw "a"
+" catch /a/
+" while 1
+" endtry
+endif
+if MESSAGES('E170', "Missing :endwhile")
+ Xpath 256 " X: 256
+endif
+
+call delete(msgfile)
+unlet msgfile
+
+delfunction MESSAGES
+
+Xcheck 511
+
+
+"-------------------------------------------------------------------------------
+" Test 57: v:exception and v:throwpoint for user exceptions {{{1
+"
+" v:exception evaluates to the value of the exception that was caught
+" most recently and is not finished. (A caught exception is finished
+" when the next ":catch", ":finally", or ":endtry" is reached.)
+" v:throwpoint evaluates to the script/function name and line number
+" where that exception has been thrown.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! FuncException()
+ let g:exception = v:exception
+endfunction
+
+function! FuncThrowpoint()
+ let g:throwpoint = v:throwpoint
+endfunction
+
+let scriptException = MakeScript("FuncException")
+let scriptThrowPoint = MakeScript("FuncThrowpoint")
+
+command! CmdException let g:exception = v:exception
+command! CmdThrowpoint let g:throwpoint = v:throwpoint
+
+XloopINIT! 1 2
+
+function! CHECK(n, exception, throwname, throwline)
+ XloopNEXT
+ let error = 0
+ if v:exception != a:exception
+ Xout a:n.": v:exception is" v:exception "instead of" a:exception
+ let error = 1
+ endif
+ if v:throwpoint !~ a:throwname
+ let name = escape(a:throwname, '\')
+ Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" name
+ let error = 1
+ endif
+ if v:throwpoint !~ a:throwline
+ let line = escape(a:throwline, '\')
+ Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" line
+ let error = 1
+ endif
+ if error
+ Xloop 1 " X: 0
+ endif
+endfunction
+
+function! T(arg, line)
+ if a:line == 2
+ throw a:arg " in line 2
+ elseif a:line == 4
+ throw a:arg " in line 4
+ elseif a:line == 6
+ throw a:arg " in line 6
+ elseif a:line == 8
+ throw a:arg " in line 8
+ endif
+endfunction
+
+function! G(arg, line)
+ call T(a:arg, a:line)
+endfunction
+
+function! F(arg, line)
+ call G(a:arg, a:line)
+endfunction
+
+let scriptT = MakeScript("T")
+let scriptG = MakeScript("G", scriptT)
+let scriptF = MakeScript("F", scriptG)
+
+try
+ Xpath 32768 " X: 32768
+ call F("oops", 2)
+catch /.*/
+ Xpath 65536 " X: 65536
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(1, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ exec "let exception = v:exception"
+ exec "let throwpoint = v:throwpoint"
+ call CHECK(2, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ CmdException
+ CmdThrowpoint
+ call CHECK(3, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ call FuncException()
+ call FuncThrowpoint()
+ call CHECK(4, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ exec "source" scriptException
+ exec "source" scriptThrowPoint
+ call CHECK(5, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ try
+ Xpath 131072 " X: 131072
+ call G("arrgh", 4)
+ catch /.*/
+ Xpath 262144 " X: 262144
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(6, "arrgh", '\<G\.\.T\>', '\<4\>')
+ try
+ Xpath 524288 " X: 524288
+ let g:arg = "autsch"
+ let g:line = 6
+ exec "source" scriptF
+ catch /.*/
+ Xpath 1048576 " X: 1048576
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ " Symbolic links in tempname()s are not resolved, whereas resolving
+ " is done for v:throwpoint. Resolve the temporary file name for
+ " scriptT, so that it can be matched against v:throwpoint.
+ call CHECK(7, "autsch", resolve(scriptT), '\<6\>')
+ finally
+ Xpath 2097152 " X: 2097152
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(8, "arrgh", '\<G\.\.T\>', '\<4\>')
+ try
+ Xpath 4194304 " X: 4194304
+ let g:arg = "brrrr"
+ let g:line = 8
+ exec "source" scriptG
+ catch /.*/
+ Xpath 8388608 " X: 8388608
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ " Resolve scriptT for matching it against v:throwpoint.
+ call CHECK(9, "brrrr", resolve(scriptT), '\<8\>')
+ finally
+ Xpath 16777216 " X: 16777216
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(10, "arrgh", '\<G\.\.T\>', '\<4\>')
+ endtry
+ Xpath 33554432 " X: 33554432
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(11, "arrgh", '\<G\.\.T\>', '\<4\>')
+ endtry
+ Xpath 67108864 " X: 67108864
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(12, "arrgh", '\<G\.\.T\>', '\<4\>')
+ finally
+ Xpath 134217728 " X: 134217728
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(13, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+ endtry
+ Xpath 268435456 " X: 268435456
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(14, "oops", '\<F\.\.G\.\.T\>', '\<2\>')
+finally
+ Xpath 536870912 " X: 536870912
+ let exception = v:exception
+ let throwpoint = v:throwpoint
+ call CHECK(15, "", '^$', '^$')
+endtry
+
+Xpath 1073741824 " X: 1073741824
+
+unlet exception throwpoint
+delfunction FuncException
+delfunction FuncThrowpoint
+call delete(scriptException)
+call delete(scriptThrowPoint)
+unlet scriptException scriptThrowPoint
+delcommand CmdException
+delcommand CmdThrowpoint
+delfunction T
+delfunction G
+delfunction F
+call delete(scriptT)
+call delete(scriptG)
+call delete(scriptF)
+unlet scriptT scriptG scriptF
+
+Xcheck 2147450880
+
+
+"-------------------------------------------------------------------------------
+"
+" Test 58: v:exception and v:throwpoint for error/interrupt exceptions {{{1
+"
+" v:exception and v:throwpoint work also for error and interrupt
+" exceptions.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ function! T(line)
+ if a:line == 2
+ delfunction T " error (function in use) in line 2
+ elseif a:line == 4
+ let dummy = 0 " INTERRUPT1 - interrupt in line 4
+ endif
+ endfunction
+
+ while 1
+ try
+ Xpath 1 " X: 1
+ let caught = 0
+ call T(2)
+ catch /.*/
+ let caught = 1
+ if v:exception !~ 'Vim(delfunction):'
+ Xpath 2 " X: 0
+ endif
+ if v:throwpoint !~ '\<T\>'
+ Xpath 4 " X: 0
+ endif
+ if v:throwpoint !~ '\<2\>'
+ Xpath 8 " X: 0
+ endif
+ finally
+ Xpath 16 " X: 16
+ if caught || $VIMNOERRTHROW
+ Xpath 32 " X: 32
+ endif
+ if v:exception != ""
+ Xpath 64 " X: 0
+ endif
+ if v:throwpoint != ""
+ Xpath 128 " X: 0
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ Xpath 256 " X: 256
+ if v:exception != ""
+ Xpath 512 " X: 0
+ endif
+ if v:throwpoint != ""
+ Xpath 1024 " X: 0
+ endif
+
+ while 1
+ try
+ Xpath 2048 " X: 2048
+ let caught = 0
+ call T(4)
+ catch /.*/
+ let caught = 1
+ if v:exception != 'Vim:Interrupt'
+ Xpath 4096 " X: 0
+ endif
+ if v:throwpoint !~ '\<T\>'
+ Xpath 8192 " X: 0
+ endif
+ if v:throwpoint !~ '\<4\>'
+ Xpath 16384 " X: 0
+ endif
+ finally
+ Xpath 32768 " X: 32768
+ if caught || $VIMNOINTTHROW
+ Xpath 65536 " X: 65536
+ endif
+ if v:exception != ""
+ Xpath 131072 " X: 0
+ endif
+ if v:throwpoint != ""
+ Xpath 262144 " X: 0
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ Xpath 524288 " X: 524288
+ if v:exception != ""
+ Xpath 1048576 " X: 0
+ endif
+ if v:throwpoint != ""
+ Xpath 2097152 " X: 0
+ endif
+
+endif
+
+Xcheck 624945
+
+
+"-------------------------------------------------------------------------------
+"
+" Test 59: v:exception and v:throwpoint when discarding exceptions {{{1
+"
+" When a :catch clause is left by a ":break" etc or an error or
+" interrupt exception, v:exception and v:throwpoint are reset. They
+" are not affected by an exception that is discarded before being
+" caught.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ XloopINIT! 1 2
+
+ let sfile = expand("<sfile>")
+
+ function! LineNumber()
+ return substitute(substitute(v:throwpoint, g:sfile, '', ""),
+ \ '\D*\(\d*\).*', '\1', "")
+ endfunction
+
+ command! -nargs=1 SetLineNumber
+ \ try | throw "line" | catch /.*/ | let <args> = LineNumber() | endtry
+
+ " Check v:exception/v:throwpoint against second/fourth parameter if
+ " specified, check for being empty else.
+ function! CHECK(n, ...)
+ XloopNEXT
+ let exception = a:0 != 0 ? a:1 : "" " second parameter (optional)
+ let emsg = a:0 != 0 ? a:2 : "" " third parameter (optional)
+ let line = a:0 != 0 ? a:3 : 0 " fourth parameter (optional)
+ let error = 0
+ if emsg != ""
+ " exception is the error number, emsg the english error message text
+ if exception !~ '^E\d\+$'
+ Xout "TODO: Add message number for:" emsg
+ elseif v:lang == "C" || v:lang =~ '^[Ee]n'
+ if exception == "E492" && emsg == "Not an editor command"
+ let exception = '^Vim:' . exception . ': ' . emsg
+ else
+ let exception = '^Vim(\a\+):' . exception . ': ' . emsg
+ endif
+ else
+ if exception == "E492"
+ let exception = '^Vim:' . exception
+ else
+ let exception = '^Vim(\a\+):' . exception
+ endif
+ endif
+ endif
+ if exception == "" && v:exception != ""
+ Xout a:n.": v:exception is set:" v:exception
+ let error = 1
+ elseif exception != "" && v:exception !~ exception
+ Xout a:n.": v:exception (".v:exception.") does not match" exception
+ let error = 1
+ endif
+ if line == 0 && v:throwpoint != ""
+ Xout a:n.": v:throwpoint is set:" v:throwpoint
+ let error = 1
+ elseif line != 0 && v:throwpoint !~ '\<' . line . '\>'
+ Xout a:n.": v:throwpoint (".v:throwpoint.") does not match" line
+ let error = 1
+ endif
+ if !error
+ Xloop 1 " X: 2097151
+ endif
+ endfunction
+
+ while 1
+ try
+ throw "x1"
+ catch /.*/
+ break
+ endtry
+ endwhile
+ call CHECK(1)
+
+ while 1
+ try
+ throw "x2"
+ catch /.*/
+ break
+ finally
+ call CHECK(2)
+ endtry
+ break
+ endwhile
+ call CHECK(3)
+
+ while 1
+ try
+ let errcaught = 0
+ try
+ try
+ throw "x3"
+ catch /.*/
+ SetLineNumber line_before_error
+ asdf
+ endtry
+ catch /.*/
+ let errcaught = 1
+ call CHECK(4, 'E492', "Not an editor command",
+ \ line_before_error + 1)
+ endtry
+ finally
+ if !errcaught && $VIMNOERRTHROW
+ call CHECK(4)
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ call CHECK(5)
+
+ Xpath 2097152 " X: 2097152
+
+ while 1
+ try
+ let intcaught = 0
+ try
+ try
+ throw "x4"
+ catch /.*/
+ SetLineNumber two_lines_before_interrupt
+ "INTERRUPT
+ let dummy = 0
+ endtry
+ catch /.*/
+ let intcaught = 1
+ call CHECK(6, "Vim:Interrupt", '',
+ \ two_lines_before_interrupt + 2)
+ endtry
+ finally
+ if !intcaught && $VIMNOINTTHROW
+ call CHECK(6)
+ endif
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+ call CHECK(7)
+
+ Xpath 4194304 " X: 4194304
+
+ while 1
+ try
+ let errcaught = 0
+ try
+ try
+" if 1
+ SetLineNumber line_before_throw
+ throw "x5"
+ " missing endif
+ catch /.*/
+ Xpath 8388608 " X: 0
+ endtry
+ catch /.*/
+ let errcaught = 1
+ call CHECK(8, 'E171', "Missing :endif", line_before_throw + 3)
+ endtry
+ finally
+ if !errcaught && $VIMNOERRTHROW
+ call CHECK(8)
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ call CHECK(9)
+
+ Xpath 16777216 " X: 16777216
+
+ try
+ while 1
+ try
+ throw "x6"
+ finally
+ break
+ endtry
+ break
+ endwhile
+ catch /.*/
+ Xpath 33554432 " X: 0
+ endtry
+ call CHECK(10)
+
+ try
+ while 1
+ try
+ throw "x7"
+ finally
+ break
+ endtry
+ break
+ endwhile
+ catch /.*/
+ Xpath 67108864 " X: 0
+ finally
+ call CHECK(11)
+ endtry
+ call CHECK(12)
+
+ while 1
+ try
+ let errcaught = 0
+ try
+ try
+ throw "x8"
+ finally
+ SetLineNumber line_before_error
+ asdf
+ endtry
+ catch /.*/
+ let errcaught = 1
+ call CHECK(13, 'E492', "Not an editor command",
+ \ line_before_error + 1)
+ endtry
+ finally
+ if !errcaught && $VIMNOERRTHROW
+ call CHECK(13)
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ call CHECK(14)
+
+ Xpath 134217728 " X: 134217728
+
+ while 1
+ try
+ let intcaught = 0
+ try
+ try
+ throw "x9"
+ finally
+ SetLineNumber two_lines_before_interrupt
+ "INTERRUPT
+ endtry
+ catch /.*/
+ let intcaught = 1
+ call CHECK(15, "Vim:Interrupt", '',
+ \ two_lines_before_interrupt + 2)
+ endtry
+ finally
+ if !intcaught && $VIMNOINTTHROW
+ call CHECK(15)
+ endif
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+ call CHECK(16)
+
+ Xpath 268435456 " X: 268435456
+
+ while 1
+ try
+ let errcaught = 0
+ try
+ try
+" if 1
+ SetLineNumber line_before_throw
+ throw "x10"
+ " missing endif
+ finally
+ call CHECK(17)
+ endtry
+ catch /.*/
+ let errcaught = 1
+ call CHECK(18, 'E171', "Missing :endif", line_before_throw + 3)
+ endtry
+ finally
+ if !errcaught && $VIMNOERRTHROW
+ call CHECK(18)
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ call CHECK(19)
+
+ Xpath 536870912 " X: 536870912
+
+ while 1
+ try
+ let errcaught = 0
+ try
+ try
+" if 1
+ SetLineNumber line_before_throw
+ throw "x11"
+ " missing endif
+ endtry
+ catch /.*/
+ let errcaught = 1
+ call CHECK(20, 'E171', "Missing :endif", line_before_throw + 3)
+ endtry
+ finally
+ if !errcaught && $VIMNOERRTHROW
+ call CHECK(20)
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ call CHECK(21)
+
+ Xpath 1073741824 " X: 1073741824
+
+endif
+
+Xcheck 2038431743
+
+
+"-------------------------------------------------------------------------------
+"
+" Test 60: (Re)throwing v:exception; :echoerr. {{{1
+"
+" A user exception can be rethrown after catching by throwing
+" v:exception. An error or interrupt exception cannot be rethrown
+" because Vim exceptions cannot be faked. A Vim exception using the
+" value of v:exception can, however, be triggered by the :echoerr
+" command.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+try
+ try
+ Xpath 1 " X: 1
+ throw "oops"
+ catch /oops/
+ Xpath 2 " X: 2
+ throw v:exception " rethrow user exception
+ catch /.*/
+ Xpath 4 " X: 0
+ endtry
+catch /^oops$/ " catches rethrown user exception
+ Xpath 8 " X: 8
+catch /.*/
+ Xpath 16 " X: 0
+endtry
+
+function! F()
+ try
+ let caught = 0
+ try
+ Xpath 32 " X: 32
+ write /n/o/n/w/r/i/t/a/b/l/e/_/f/i/l/e
+ Xpath 64 " X: 0
+ Xout "did_emsg was reset before executing " .
+ \ "BufWritePost autocommands."
+ catch /^Vim(write):/
+ let caught = 1
+ throw v:exception " throw error: cannot fake Vim exception
+ catch /.*/
+ Xpath 128 " X: 0
+ finally
+ Xpath 256 " X: 256
+ if !caught && !$VIMNOERRTHROW
+ Xpath 512 " X: 0
+ endif
+ endtry
+ catch /^Vim(throw):/ " catches throw error
+ let caught = caught + 1
+ catch /.*/
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ if caught != 2
+ if !caught && !$VIMNOERRTHROW
+ Xpath 4096 " X: 0
+ elseif caught
+ Xpath 8192 " X: 0
+ endif
+ return | " discard error for $VIMNOERRTHROW
+ endif
+ endtry
+endfunction
+
+call F()
+delfunction F
+
+function! G()
+ try
+ let caught = 0
+ try
+ Xpath 16384 " X: 16384
+ asdf
+ catch /^Vim/ " catch error exception
+ let caught = 1
+ " Trigger Vim error exception with value specified after :echoerr
+ let value = substitute(v:exception, '^Vim\((.*)\)\=:', '', "")
+ echoerr value
+ catch /.*/
+ Xpath 32768 " X: 0
+ finally
+ Xpath 65536 " X: 65536
+ if !caught
+ if !$VIMNOERRTHROW
+ Xpath 131072 " X: 0
+ else
+ let value = "Error"
+ echoerr value
+ endif
+ endif
+ endtry
+ catch /^Vim(echoerr):/
+ let caught = caught + 1
+ if v:exception !~ value
+ Xpath 262144 " X: 0
+ endif
+ catch /.*/
+ Xpath 524288 " X: 0
+ finally
+ Xpath 1048576 " X: 1048576
+ if caught != 2
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2097152 " X: 0
+ elseif caught
+ Xpath 4194304 " X: 0
+ endif
+ return | " discard error for $VIMNOERRTHROW
+ endif
+ endtry
+endfunction
+
+call G()
+delfunction G
+
+unlet! value caught
+
+if ExtraVim()
+ try
+ let errcaught = 0
+ try
+ Xpath 8388608 " X: 8388608
+ let intcaught = 0
+ "INTERRUPT
+ catch /^Vim:/ " catch interrupt exception
+ let intcaught = 1
+ " Trigger Vim error exception with value specified after :echoerr
+ echoerr substitute(v:exception, '^Vim\((.*)\)\=:', '', "")
+ catch /.*/
+ Xpath 16777216 " X: 0
+ finally
+ Xpath 33554432 " X: 33554432
+ if !intcaught
+ if !$VIMNOINTTHROW
+ Xpath 67108864 " X: 0
+ else
+ echoerr "Interrupt"
+ endif
+ endif
+ endtry
+ catch /^Vim(echoerr):/
+ let errcaught = 1
+ if v:exception !~ "Interrupt"
+ Xpath 134217728 " X: 0
+ endif
+ finally
+ Xpath 268435456 " X: 268435456
+ if !errcaught && !$VIMNOERRTHROW
+ Xpath 536870912 " X: 0
+ endif
+ endtry
+endif
+
+Xcheck 311511339
+
+
+"-------------------------------------------------------------------------------
+" Test 61: Catching interrupt exceptions {{{1
+"
+" When an interrupt occurs inside a :try/:endtry region, an
+" interrupt exception is thrown and can be caught. Its value is
+" "Vim:Interrupt". If the interrupt occurs after an error or a :throw
+" but before a matching :catch is reached, all following :catches of
+" that try block are ignored, but the interrupt exception can be
+" caught by the next surrounding try conditional. An interrupt is
+" ignored when there is a previous interrupt that has not been caught
+" or causes a :finally clause to be executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ while 1
+ try
+ try
+ Xpath 1 " X: 1
+ let caught = 0
+ "INTERRUPT
+ Xpath 2 " X: 0
+ catch /^Vim:Interrupt$/
+ let caught = 1
+ finally
+ Xpath 4 " X: 4
+ if caught || $VIMNOINTTHROW
+ Xpath 8 " X: 8
+ endif
+ endtry
+ catch /.*/
+ Xpath 16 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ let caught = 0
+ try
+ Xpath 32 " X: 32
+ asdf
+ Xpath 64 " X: 0
+ catch /do_not_catch/
+ Xpath 128 " X: 0
+ catch /.*/ "INTERRUPT - throw interrupt if !$VIMNOERRTHROW
+ Xpath 256 " X: 0
+ catch /.*/
+ Xpath 512 " X: 0
+ finally "INTERRUPT - throw interrupt if $VIMNOERRTHROW
+ Xpath 1024 " X: 1024
+ endtry
+ catch /^Vim:Interrupt$/
+ let caught = 1
+ finally
+ Xpath 2048 " X: 2048
+ if caught || $VIMNOINTTHROW
+ Xpath 4096 " X: 4096
+ endif
+ endtry
+ catch /.*/
+ Xpath 8192 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ let caught = 0
+ try
+ Xpath 16384 " X: 16384
+ throw "x"
+ Xpath 32768 " X: 0
+ catch /do_not_catch/
+ Xpath 65536 " X: 0
+ catch /x/ "INTERRUPT
+ Xpath 131072 " X: 0
+ catch /.*/
+ Xpath 262144 " X: 0
+ endtry
+ catch /^Vim:Interrupt$/
+ let caught = 1
+ finally
+ Xpath 524288 " X: 524288
+ if caught || $VIMNOINTTHROW
+ Xpath 1048576 " X: 1048576
+ endif
+ endtry
+ catch /.*/
+ Xpath 2097152 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ let caught = 0
+ try
+ Xpath 4194304 " X: 4194304
+ "INTERRUPT
+ Xpath 8388608 " X: 0
+ catch /do_not_catch/ "INTERRUPT
+ Xpath 16777216 " X: 0
+ catch /^Vim:Interrupt$/
+ let caught = 1
+ finally
+ Xpath 33554432 " X: 33554432
+ if caught || $VIMNOINTTHROW
+ Xpath 67108864 " X: 67108864
+ endif
+ endtry
+ catch /.*/
+ Xpath 134217728 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard interrupt for $VIMNOINTTHROW
+ endtry
+ endwhile
+
+ Xpath 268435456 " X: 268435456
+
+endif
+
+Xcheck 374889517
+
+
+"-------------------------------------------------------------------------------
+" Test 62: Catching error exceptions {{{1
+"
+" An error inside a :try/:endtry region is converted to an exception
+" and can be caught. The error exception has a "Vim(cmdname):" prefix
+" where cmdname is the name of the failing command, or a "Vim:" prefix
+" if no command name is known. The "Vim" prefixes cannot be faked.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+while 1
+ try
+ try
+ let caught = 0
+ unlet novar
+ catch /^Vim(unlet):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(unlet):', '', "")
+ finally
+ Xpath 1 " X: 1
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2 " X: 0
+ endif
+ if !MSG('E108', "No such variable")
+ Xpath 4 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 8 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let caught = 0
+ throw novar " error in :throw
+ catch /^Vim(throw):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(throw):', '', "")
+ finally
+ Xpath 16 " X: 16
+ if !caught && !$VIMNOERRTHROW
+ Xpath 32 " X: 0
+ endif
+ if caught ? !MSG('E121', "Undefined variable")
+ \ : !MSG('E15', "Invalid expression")
+ Xpath 64 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 128 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let caught = 0
+ throw "Vim:faked" " error: cannot fake Vim exception
+ catch /^Vim(throw):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(throw):', '', "")
+ finally
+ Xpath 256 " X: 256
+ if !caught && !$VIMNOERRTHROW
+ Xpath 512 " X: 0
+ endif
+ if !MSG('E608', "Cannot :throw exceptions with 'Vim' prefix")
+ Xpath 1024 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 2048 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+function! F()
+ while 1
+ " Missing :endwhile
+endfunction
+
+while 1
+ try
+ try
+ let caught = 0
+ call F()
+ catch /^Vim(endfunction):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(endfunction):', '', "")
+ finally
+ Xpath 4096 " X: 4096
+ if !caught && !$VIMNOERRTHROW
+ Xpath 8192 " X: 0
+ endif
+ if !MSG('E170', "Missing :endwhile")
+ Xpath 16384 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 32768 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let caught = 0
+ ExecAsScript F
+ catch /^Vim:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim:', '', "")
+ finally
+ Xpath 65536 " X: 65536
+ if !caught && !$VIMNOERRTHROW
+ Xpath 131072 " X: 0
+ endif
+ if !MSG('E170', "Missing :endwhile")
+ Xpath 262144 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 524288 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+function! G()
+ call G()
+endfunction
+
+while 1
+ try
+ let mfd_save = &mfd
+ set mfd=3
+ try
+ let caught = 0
+ call G()
+ catch /^Vim(call):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(call):', '', "")
+ finally
+ Xpath 1048576 " X: 1048576
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2097152 " X: 0
+ endif
+ if !MSG('E132', "Function call depth is higher than 'maxfuncdepth'")
+ Xpath 4194304 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 8388608 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ let &mfd = mfd_save
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+function! H()
+ return H()
+endfunction
+
+while 1
+ try
+ let mfd_save = &mfd
+ set mfd=3
+ try
+ let caught = 0
+ call H()
+ catch /^Vim(return):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(return):', '', "")
+ finally
+ Xpath 16777216 " X: 16777216
+ if !caught && !$VIMNOERRTHROW
+ Xpath 33554432 " X: 0
+ endif
+ if !MSG('E132', "Function call depth is higher than 'maxfuncdepth'")
+ Xpath 67108864 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 134217728 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ let &mfd = mfd_save
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+unlet! caught mfd_save
+delfunction F
+delfunction G
+delfunction H
+Xpath 268435456 " X: 268435456
+
+Xcheck 286331153
+
+" Leave MSG() for the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 63: Suppressing error exceptions by :silent!. {{{1
+"
+" A :silent! command inside a :try/:endtry region suppresses the
+" conversion of errors to an exception and the immediate abortion on
+" error. When the commands executed by the :silent! themselves open
+" a new :try/:endtry region, conversion of errors to exception and
+" immediate abortion is switched on again - until the next :silent!
+" etc. The :silent! has the effect of setting v:errmsg to the error
+" message text (without displaying it) and continuing with the next
+" script line.
+"
+" When a command triggering autocommands is executed by :silent!
+" inside a :try/:endtry, the autocommand execution is not suppressed
+" on error.
+"
+" This test reuses the function MSG() from the previous test.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT! 1 4
+
+let taken = ""
+
+function! S(n) abort
+ XloopNEXT
+ let g:taken = g:taken . "E" . a:n
+ let v:errmsg = ""
+ exec "asdf" . a:n
+
+ " Check that ":silent!" continues:
+ Xloop 1
+
+ " Check that ":silent!" sets "v:errmsg":
+ if MSG('E492', "Not an editor command")
+ Xloop 2
+ endif
+endfunction
+
+function! Foo()
+ while 1
+ try
+ try
+ let caught = 0
+ " This is not silent:
+ call S(3) " X: 0 * 16
+ catch /^Vim:/
+ let caught = 1
+ let errmsg3 = substitute(v:exception, '^Vim:', '', "")
+ silent! call S(4) " X: 3 * 64
+ finally
+ if !caught
+ let errmsg3 = v:errmsg
+ " Do call S(4) here if not executed in :catch.
+ silent! call S(4)
+ endif
+ Xpath 1048576 " X: 1048576
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2097152 " X: 0
+ endif
+ let v:errmsg = errmsg3
+ if !MSG('E492', "Not an editor command")
+ Xpath 4194304 " X: 0
+ endif
+ silent! call S(5) " X: 3 * 256
+ " Break out of try conds that cover ":silent!". This also
+ " discards the aborting error when $VIMNOERRTHROW is non-zero.
+ break
+ endtry
+ catch /.*/
+ Xpath 8388608 " X: 0
+ Xout v:exception "in" v:throwpoint
+ endtry
+ endwhile
+ " This is a double ":silent!" (see caller).
+ silent! call S(6) " X: 3 * 1024
+endfunction
+
+function! Bar()
+ try
+ silent! call S(2) " X: 3 * 4
+ " X: 3 * 4096
+ silent! execute "call Foo() | call S(7)"
+ silent! call S(8) " X: 3 * 16384
+ endtry " normal end of try cond that covers ":silent!"
+ " This has a ":silent!" from the caller:
+ call S(9) " X: 3 * 65536
+endfunction
+
+silent! call S(1) " X: 3 * 1
+silent! call Bar()
+silent! call S(10) " X: 3 * 262144
+
+let expected = "E1E2E3E4E5E6E7E8E9E10"
+if taken != expected
+ Xpath 16777216 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+endif
+
+augroup TMP
+ autocmd BufWritePost * Xpath 33554432 " X: 33554432
+augroup END
+
+Xpath 67108864 " X: 67108864
+write /i/m/p/o/s/s/i/b/l/e
+Xpath 134217728 " X: 134217728
+
+autocmd! TMP
+unlet! caught errmsg3 taken expected
+delfunction S
+delfunction Foo
+delfunction Bar
+delfunction MSG
+
+Xcheck 236978127
+
+
+"-------------------------------------------------------------------------------
+" Test 64: Error exceptions after error, interrupt or :throw {{{1
+"
+" When an error occurs after an interrupt or a :throw but before
+" a matching :catch is reached, all following :catches of that try
+" block are ignored, but the error exception can be caught by the next
+" surrounding try conditional. Any previous error exception is
+" discarded. An error is ignored when there is a previous error that
+" has not been caught.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ while 1
+ try
+ try
+ Xpath 1 " X: 1
+ let caught = 0
+ while 1
+" if 1
+ " Missing :endif
+ endwhile " throw error exception
+ catch /^Vim(/
+ let caught = 1
+ finally
+ Xpath 2 " X: 2
+ if caught || $VIMNOERRTHROW
+ Xpath 4 " X: 4
+ endif
+ endtry
+ catch /.*/
+ Xpath 8 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ Xpath 16 " X: 16
+ let caught = 0
+ try
+" if 1
+ " Missing :endif
+ catch /.*/ " throw error exception
+ Xpath 32 " X: 0
+ catch /.*/
+ Xpath 64 " X: 0
+ endtry
+ catch /^Vim(/
+ let caught = 1
+ finally
+ Xpath 128 " X: 128
+ if caught || $VIMNOERRTHROW
+ Xpath 256 " X: 256
+ endif
+ endtry
+ catch /.*/
+ Xpath 512 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ let caught = 0
+ try
+ Xpath 1024 " X: 1024
+ "INTERRUPT
+ catch /do_not_catch/
+ Xpath 2048 " X: 0
+" if 1
+ " Missing :endif
+ catch /.*/ " throw error exception
+ Xpath 4096 " X: 0
+ catch /.*/
+ Xpath 8192 " X: 0
+ endtry
+ catch /^Vim(/
+ let caught = 1
+ finally
+ Xpath 16384 " X: 16384
+ if caught || $VIMNOERRTHROW
+ Xpath 32768 " X: 32768
+ endif
+ endtry
+ catch /.*/
+ Xpath 65536 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ let caught = 0
+ try
+ Xpath 131072 " X: 131072
+ throw "x"
+ catch /do_not_catch/
+ Xpath 262144 " X: 0
+" if 1
+ " Missing :endif
+ catch /x/ " throw error exception
+ Xpath 524288 " X: 0
+ catch /.*/
+ Xpath 1048576 " X: 0
+ endtry
+ catch /^Vim(/
+ let caught = 1
+ finally
+ Xpath 2097152 " X: 2097152
+ if caught || $VIMNOERRTHROW
+ Xpath 4194304 " X: 4194304
+ endif
+ endtry
+ catch /.*/
+ Xpath 8388608 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ try
+ let caught = 0
+ Xpath 16777216 " X: 16777216
+" endif " :endif without :if; throw error exception
+" if 1
+ " Missing :endif
+ catch /do_not_catch/ " ignore new error
+ Xpath 33554432 " X: 0
+ catch /^Vim(endif):/
+ let caught = 1
+ catch /^Vim(/
+ Xpath 67108864 " X: 0
+ finally
+ Xpath 134217728 " X: 134217728
+ if caught || $VIMNOERRTHROW
+ Xpath 268435456 " X: 268435456
+ endif
+ endtry
+ catch /.*/
+ Xpath 536870912 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ Xpath 1073741824 " X: 1073741824
+
+endif
+
+Xcheck 1499645335
+
+
+"-------------------------------------------------------------------------------
+" Test 65: Errors in the /pattern/ argument of a :catch {{{1
+"
+" On an error in the /pattern/ argument of a :catch, the :catch does
+" not match. Any following :catches of the same :try/:endtry don't
+" match either. Finally clauses are executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+try
+ try
+ Xpath 1 " X: 1
+ throw "oops"
+ catch /^oops$/
+ Xpath 2 " X: 2
+ catch /\)/ " not checked; exception has already been caught
+ Xpath 4 " X: 0
+ endtry
+ Xpath 8 " X: 8
+catch /.*/
+ Xpath 16 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+function! F()
+ try
+ let caught = 0
+ try
+ try
+ Xpath 32 " X: 32
+ throw "ab"
+ catch /abc/ " does not catch
+ Xpath 64 " X: 0
+ catch /\)/ " error; discards exception
+ Xpath 128 " X: 0
+ catch /.*/ " not checked
+ Xpath 256 " X: 0
+ finally
+ Xpath 512 " X: 512
+ endtry
+ Xpath 1024 " X: 0
+ catch /^ab$/ " checked, but original exception is discarded
+ Xpath 2048 " X: 0
+ catch /^Vim(catch):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(catch):', '', "")
+ finally
+ Xpath 4096 " X: 4096
+ if !caught && !$VIMNOERRTHROW
+ Xpath 8192 " X: 0
+ endif
+ if caught ? !MSG('E55', 'Unmatched \\)')
+ \ : !MSG('E475', "Invalid argument")
+ Xpath 16384 " X: 0
+ endif
+ if !caught
+ return | " discard error
+ endif
+ endtry
+ catch /.*/
+ Xpath 32768 " X: 0
+ Xout v:exception "in" v:throwpoint
+ endtry
+endfunction
+
+call F()
+Xpath 65536 " X: 65536
+
+delfunction MSG
+delfunction F
+unlet! caught
+
+Xcheck 70187
+
+
+"-------------------------------------------------------------------------------
+" Test 66: Stop range :call on error, interrupt, or :throw {{{1
+"
+" When a function which is multiply called for a range since it
+" doesn't handle the range itself has an error in a command
+" dynamically enclosed by :try/:endtry or gets an interrupt or
+" executes a :throw, no more calls for the remaining lines in the
+" range are made. On an error in a command not dynamically enclosed
+" by :try/:endtry, the function is executed again for the remaining
+" lines in the range.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ let file = tempname()
+ exec "edit" file
+
+ insert
+line 1
+line 2
+line 3
+.
+
+ XloopINIT! 1 2
+
+ let taken = ""
+ let expected = "G1EF1E(1)F1E(2)F1E(3)G2EF2E(1)G3IF3I(1)G4TF4T(1)G5AF5A(1)"
+
+ function! F(reason, n) abort
+ let g:taken = g:taken . "F" . a:n .
+ \ substitute(a:reason, '\(\l\).*', '\u\1', "") .
+ \ "(" . line(".") . ")"
+
+ if a:reason == "error"
+ asdf
+ elseif a:reason == "interrupt"
+ "INTERRUPT
+ let dummy = 0
+ elseif a:reason == "throw"
+ throw "xyz"
+ elseif a:reason == "aborting error"
+ XloopNEXT
+ if g:taken != g:expected
+ Xloop 1 " X: 0
+ Xout "'taken' is" g:taken "instead of" g:expected
+ endif
+ try
+ bwipeout!
+ call delete(file)
+ asdf
+ endtry
+ endif
+ endfunction
+
+ function! G(reason, n)
+ let g:taken = g:taken . "G" . a:n .
+ \ substitute(a:reason, '\(\l\).*', '\u\1', "")
+ 1,3call F(a:reason, a:n)
+ endfunction
+
+ Xpath 8 " X: 8
+ call G("error", 1)
+ try
+ Xpath 16 " X: 16
+ try
+ call G("error", 2)
+ Xpath 32 " X: 0
+ finally
+ Xpath 64 " X: 64
+ try
+ call G("interrupt", 3)
+ Xpath 128 " X: 0
+ finally
+ Xpath 256 " X: 256
+ try
+ call G("throw", 4)
+ Xpath 512 " X: 0
+ endtry
+ endtry
+ endtry
+ catch /xyz/
+ Xpath 1024 " X: 1024
+ catch /.*/
+ Xpath 2048 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+ Xpath 4096 " X: 4096
+ call G("aborting error", 5)
+ Xpath 8192 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+
+endif
+
+Xcheck 5464
+
+
+"-------------------------------------------------------------------------------
+" Test 67: :throw accross :call command {{{1
+"
+" On a call command, an exception might be thrown when evaluating the
+" function name, during evaluation of the arguments, or when the
+" function is being executed. The exception can be caught by the
+" caller.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! THROW(x, n)
+ if a:n == 1
+ Xpath 1 " X: 1
+ elseif a:n == 2
+ Xpath 2 " X: 2
+ elseif a:n == 3
+ Xpath 4 " X: 4
+ endif
+ throw a:x
+endfunction
+
+function! NAME(x, n)
+ if a:n == 1
+ Xpath 8 " X: 0
+ elseif a:n == 2
+ Xpath 16 " X: 16
+ elseif a:n == 3
+ Xpath 32 " X: 32
+ elseif a:n == 4
+ Xpath 64 " X: 64
+ endif
+ return a:x
+endfunction
+
+function! ARG(x, n)
+ if a:n == 1
+ Xpath 128 " X: 0
+ elseif a:n == 2
+ Xpath 256 " X: 0
+ elseif a:n == 3
+ Xpath 512 " X: 512
+ elseif a:n == 4
+ Xpath 1024 " X: 1024
+ endif
+ return a:x
+endfunction
+
+function! F(x, n)
+ if a:n == 2
+ Xpath 2048 " X: 0
+ elseif a:n == 4
+ Xpath 4096 " X: 4096
+ endif
+endfunction
+
+try
+
+ try
+ Xpath 8192 " X: 8192
+ call {NAME(THROW("name", 1), 1)}(ARG(4711, 1), 1)
+ Xpath 16384 " X: 0
+ catch /^name$/
+ Xpath 32768 " X: 32768
+ catch /.*/
+ Xpath 65536 " X: 0
+ Xout "1:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 131072 " X: 131072
+ call {NAME("F", 2)}(ARG(THROW("arg", 2), 2), 2)
+ Xpath 262144 " X: 0
+ catch /^arg$/
+ Xpath 524288 " X: 524288
+ catch /.*/
+ Xpath 1048576 " X: 0
+ Xout "2:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 2097152 " X: 2097152
+ call {NAME("THROW", 3)}(ARG("call", 3), 3)
+ Xpath 4194304 " X: 0
+ catch /^call$/
+ Xpath 8388608 " X: 8388608
+ catch /^0$/ " default return value
+ Xpath 16777216 " X: 0
+ Xout "3:" v:throwpoint
+ catch /.*/
+ Xpath 33554432 " X: 0
+ Xout "3:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 67108864 " X: 67108864
+ call {NAME("F", 4)}(ARG(4711, 4), 4)
+ Xpath 134217728 " X: 134217728
+ catch /.*/
+ Xpath 268435456 " X: 0
+ Xout "4:" v:exception "in" v:throwpoint
+ endtry
+
+catch /^0$/ " default return value
+ Xpath 536870912 " X: 0
+ Xout v:throwpoint
+catch /.*/
+ Xpath 1073741824 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+delfunction F
+
+Xcheck 212514423
+
+" Leave THROW(), NAME(), and ARG() for the next test.
+
+
+"-------------------------------------------------------------------------------
+" Test 68: :throw accross function calls in expressions {{{1
+"
+" On a function call within an expression, an exception might be
+" thrown when evaluating the function name, during evaluation of the
+" arguments, or when the function is being executed. The exception
+" can be caught by the caller.
+"
+" This test reuses the functions THROW(), NAME(), and ARG() from the
+" previous test.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F(x, n)
+ if a:n == 2
+ Xpath 2048 " X: 0
+ elseif a:n == 4
+ Xpath 4096 " X: 4096
+ endif
+ return a:x
+endfunction
+
+unlet! var1 var2 var3 var4
+
+try
+
+ try
+ Xpath 8192 " X: 8192
+ let var1 = {NAME(THROW("name", 1), 1)}(ARG(4711, 1), 1)
+ Xpath 16384 " X: 0
+ catch /^name$/
+ Xpath 32768 " X: 32768
+ catch /.*/
+ Xpath 65536 " X: 0
+ Xout "1:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 131072 " X: 131072
+ let var2 = {NAME("F", 2)}(ARG(THROW("arg", 2), 2), 2)
+ Xpath 262144 " X: 0
+ catch /^arg$/
+ Xpath 524288 " X: 524288
+ catch /.*/
+ Xpath 1048576 " X: 0
+ Xout "2:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 2097152 " X: 2097152
+ let var3 = {NAME("THROW", 3)}(ARG("call", 3), 3)
+ Xpath 4194304 " X: 0
+ catch /^call$/
+ Xpath 8388608 " X: 8388608
+ catch /^0$/ " default return value
+ Xpath 16777216 " X: 0
+ Xout "3:" v:throwpoint
+ catch /.*/
+ Xpath 33554432 " X: 0
+ Xout "3:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 67108864 " X: 67108864
+ let var4 = {NAME("F", 4)}(ARG(4711, 4), 4)
+ Xpath 134217728 " X: 134217728
+ catch /.*/
+ Xpath 268435456 " X: 0
+ Xout "4:" v:exception "in" v:throwpoint
+ endtry
+
+catch /^0$/ " default return value
+ Xpath 536870912 " X: 0
+ Xout v:throwpoint
+catch /.*/
+ Xpath 1073741824 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+if exists("var1") || exists("var2") || exists("var3") ||
+ \ !exists("var4") || var4 != 4711
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ if exists("var1")
+ Xout "var1 =" var1
+ endif
+ if exists("var2")
+ Xout "var2 =" var2
+ endif
+ if exists("var3")
+ Xout "var3 =" var3
+ endif
+ if !exists("var4")
+ Xout "var4 unset"
+ elseif var4 != 4711
+ Xout "var4 =" var4
+ endif
+endif
+
+unlet! var1 var2 var3 var4
+delfunction THROW
+delfunction NAME
+delfunction ARG
+delfunction F
+
+Xcheck 212514423
+
+
+"-------------------------------------------------------------------------------
+" Test 69: :throw accross :if, :elseif, :while {{{1
+"
+" On an :if, :elseif, or :while command, an exception might be thrown
+" during evaluation of the expression to test. The exception can be
+" caught by the script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT! 1 2
+
+function! THROW(x)
+ XloopNEXT
+ Xloop 1 " X: 1 + 2 + 4
+ throw a:x
+endfunction
+
+try
+
+ try
+ Xpath 8 " X: 8
+ if 4711 == THROW("if") + 111
+ Xpath 16 " X: 0
+ else
+ Xpath 32 " X: 0
+ endif
+ Xpath 64 " X: 0
+ catch /^if$/
+ Xpath 128 " X: 128
+ catch /.*/
+ Xpath 256 " X: 0
+ Xout "if:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 512 " X: 512
+ if 4711 == 4 + 7 + 1 + 1
+ Xpath 1024 " X: 0
+ elseif 4711 == THROW("elseif") + 222
+ Xpath 2048 " X: 0
+ else
+ Xpath 4096 " X: 0
+ endif
+ Xpath 8192 " X: 0
+ catch /^elseif$/
+ Xpath 16384 " X: 16384
+ catch /.*/
+ Xpath 32768 " X: 0
+ Xout "elseif:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 65536 " X: 65536
+ while 4711 == THROW("while") + 4711
+ Xpath 131072 " X: 0
+ break
+ endwhile
+ Xpath 262144 " X: 0
+ catch /^while$/
+ Xpath 524288 " X: 524288
+ catch /.*/
+ Xpath 1048576 " X: 0
+ Xout "while:" v:exception "in" v:throwpoint
+ endtry
+
+catch /^0$/ " default return value
+ Xpath 2097152 " X: 0
+ Xout v:throwpoint
+catch /.*/
+ Xout v:exception "in" v:throwpoint
+ Xpath 4194304 " X: 0
+endtry
+
+Xpath 8388608 " X: 8388608
+
+delfunction THROW
+
+Xcheck 8995471
+
+
+"-------------------------------------------------------------------------------
+" Test 70: :throw accross :return or :throw {{{1
+"
+" On a :return or :throw command, an exception might be thrown during
+" evaluation of the expression to return or throw, respectively. The
+" exception can be caught by the script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let taken = ""
+
+function! THROW(x, n)
+ let g:taken = g:taken . "T" . a:n
+ throw a:x
+endfunction
+
+function! F(x, y, n)
+ let g:taken = g:taken . "F" . a:n
+ return a:x + THROW(a:y, a:n)
+endfunction
+
+function! G(x, y, n)
+ let g:taken = g:taken . "G" . a:n
+ throw a:x . THROW(a:y, a:n)
+ return a:x
+endfunction
+
+try
+ try
+ Xpath 1 " X: 1
+ call F(4711, "return", 1)
+ Xpath 2 " X: 0
+ catch /^return$/
+ Xpath 4 " X: 4
+ catch /.*/
+ Xpath 8 " X: 0
+ Xout "return:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 16 " X: 16
+ let var = F(4712, "return-var", 2)
+ Xpath 32 " X: 0
+ catch /^return-var$/
+ Xpath 64 " X: 64
+ catch /.*/
+ Xpath 128 " X: 0
+ Xout "return-var:" v:exception "in" v:throwpoint
+ finally
+ unlet! var
+ endtry
+
+ try
+ Xpath 256 " X: 256
+ throw "except1" . THROW("throw1", 3)
+ Xpath 512 " X: 0
+ catch /^except1/
+ Xpath 1024 " X: 0
+ catch /^throw1$/
+ Xpath 2048 " X: 2048
+ catch /.*/
+ Xpath 4096 " X: 0
+ Xout "throw1:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 8192 " X: 8192
+ call G("except2", "throw2", 4)
+ Xpath 16384 " X: 0
+ catch /^except2/
+ Xpath 32768 " X: 0
+ catch /^throw2$/
+ Xpath 65536 " X: 65536
+ catch /.*/
+ Xpath 131072 " X: 0
+ Xout "throw2:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 262144 " X: 262144
+ let var = G("except3", "throw3", 5)
+ Xpath 524288 " X: 0
+ catch /^except3/
+ Xpath 1048576 " X: 0
+ catch /^throw3$/
+ Xpath 2097152 " X: 2097152
+ catch /.*/
+ Xpath 4194304 " X: 0
+ Xout "throw3:" v:exception "in" v:throwpoint
+ finally
+ unlet! var
+ endtry
+
+ let expected = "F1T1F2T2T3G4T4G5T5"
+ if taken != expected
+ Xpath 8388608 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ endif
+
+catch /^0$/ " default return value
+ Xpath 16777216 " X: 0
+ Xout v:throwpoint
+catch /.*/
+ Xpath 33554432 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 67108864 " X: 67108864
+
+unlet taken expected
+delfunction THROW
+delfunction F
+delfunction G
+
+Xcheck 69544277
+
+
+"-------------------------------------------------------------------------------
+" Test 71: :throw accross :echo variants and :execute {{{1
+"
+" On an :echo, :echon, :echomsg, :echoerr, or :execute command, an
+" exception might be thrown during evaluation of the arguments to
+" be displayed or executed as a command, respectively. Any following
+" arguments are not evaluated, then. The exception can be caught by
+" the script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let taken = ""
+
+function! THROW(x, n)
+ let g:taken = g:taken . "T" . a:n
+ throw a:x
+endfunction
+
+function! F(n)
+ let g:taken = g:taken . "F" . a:n
+ return "F" . a:n
+endfunction
+
+try
+ try
+ Xpath 1 " X: 1
+ echo "echo" . THROW("echo-except", 1) F(1)
+ Xpath 2 " X: 0
+ catch /^echo-except$/
+ Xpath 4 " X: 4
+ catch /.*/
+ Xpath 8 " X: 0
+ Xout "echo:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 16 " X: 16
+ echon "echon" . THROW("echon-except", 2) F(2)
+ Xpath 32 " X: 0
+ catch /^echon-except$/
+ Xpath 64 " X: 64
+ catch /.*/
+ Xpath 128 " X: 0
+ Xout "echon:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 256 " X: 256
+ echomsg "echomsg" . THROW("echomsg-except", 3) F(3)
+ Xpath 512 " X: 0
+ catch /^echomsg-except$/
+ Xpath 1024 " X: 1024
+ catch /.*/
+ Xpath 2048 " X: 0
+ Xout "echomsg:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 4096 " X: 4096
+ echoerr "echoerr" . THROW("echoerr-except", 4) F(4)
+ Xpath 8192 " X: 0
+ catch /^echoerr-except$/
+ Xpath 16384 " X: 16384
+ catch /Vim/
+ Xpath 32768 " X: 0
+ catch /echoerr/
+ Xpath 65536 " X: 0
+ catch /.*/
+ Xpath 131072 " X: 0
+ Xout "echoerr:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 262144 " X: 262144
+ execute "echo 'execute" . THROW("execute-except", 5) F(5) "'"
+ Xpath 524288 " X: 0
+ catch /^execute-except$/
+ Xpath 1048576 " X: 1048576
+ catch /.*/
+ Xpath 2097152 " X: 0
+ Xout "execute:" v:exception "in" v:throwpoint
+ endtry
+
+ let expected = "T1T2T3T4T5"
+ if taken != expected
+ Xpath 4194304 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ endif
+
+catch /^0$/ " default return value
+ Xpath 8388608 " X: 0
+ Xout v:throwpoint
+catch /.*/
+ Xpath 16777216 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 33554432 " X: 33554432
+
+unlet taken expected
+delfunction THROW
+delfunction F
+
+Xcheck 34886997
+
+
+"-------------------------------------------------------------------------------
+" Test 72: :throw accross :let or :unlet {{{1
+"
+" On a :let command, an exception might be thrown during evaluation
+" of the expression to assign. On an :let or :unlet command, the
+" evaluation of the name of the variable to be assigned or list or
+" deleted, respectively, may throw an exception. Any following
+" arguments are not evaluated, then. The exception can be caught by
+" the script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let throwcount = 0
+
+function! THROW(x)
+ let g:throwcount = g:throwcount + 1
+ throw a:x
+endfunction
+
+try
+ try
+ let $VAR = "old_value"
+ Xpath 1 " X: 1
+ let $VAR = "let(" . THROW("var") . ")"
+ Xpath 2 " X: 0
+ catch /^var$/
+ Xpath 4 " X: 4
+ finally
+ if $VAR != "old_value"
+ Xpath 8 " X: 0
+ endif
+ endtry
+
+ try
+ let @a = "old_value"
+ Xpath 16 " X: 16
+ let @a = "let(" . THROW("reg") . ")"
+ Xpath 32 " X: 0
+ catch /^reg$/
+ try
+ Xpath 64 " X: 64
+ let @A = "let(" . THROW("REG") . ")"
+ Xpath 128 " X: 0
+ catch /^REG$/
+ Xpath 256 " X: 256
+ endtry
+ finally
+ if @a != "old_value"
+ Xpath 512 " X: 0
+ endif
+ if @A != "old_value"
+ Xpath 1024 " X: 0
+ endif
+ endtry
+
+ try
+ let saved_gpath = &g:path
+ let saved_lpath = &l:path
+ Xpath 2048 " X: 2048
+ let &path = "let(" . THROW("opt") . ")"
+ Xpath 4096 " X: 0
+ catch /^opt$/
+ try
+ Xpath 8192 " X: 8192
+ let &g:path = "let(" . THROW("gopt") . ")"
+ Xpath 16384 " X: 0
+ catch /^gopt$/
+ try
+ Xpath 32768 " X: 32768
+ let &l:path = "let(" . THROW("lopt") . ")"
+ Xpath 65536 " X: 0
+ catch /^lopt$/
+ Xpath 131072 " X: 131072
+ endtry
+ endtry
+ finally
+ if &g:path != saved_gpath || &l:path != saved_lpath
+ Xpath 262144 " X: 0
+ endif
+ let &g:path = saved_gpath
+ let &l:path = saved_lpath
+ endtry
+
+ unlet! var1 var2 var3
+
+ try
+ Xpath 524288 " X: 524288
+ let var1 = "let(" . THROW("var1") . ")"
+ Xpath 1048576 " X: 0
+ catch /^var1$/
+ Xpath 2097152 " X: 2097152
+ finally
+ if exists("var1")
+ Xpath 4194304 " X: 0
+ endif
+ endtry
+
+ try
+ let var2 = "old_value"
+ Xpath 8388608 " X: 8388608
+ let var2 = "let(" . THROW("var2"). ")"
+ Xpath 16777216 " X: 0
+ catch /^var2$/
+ Xpath 33554432 " X: 33554432
+ finally
+ if var2 != "old_value"
+ Xpath 67108864 " X: 0
+ endif
+ endtry
+
+ try
+ Xpath 134217728 " X: 134217728
+ let var{THROW("var3")} = 4711
+ Xpath 268435456 " X: 0
+ catch /^var3$/
+ Xpath 536870912 " X: 536870912
+ endtry
+
+ let addpath = ""
+
+ function ADDPATH(p)
+ let g:addpath = g:addpath . a:p
+ endfunction
+
+ try
+ call ADDPATH("T1")
+ let var{THROW("var4")} var{ADDPATH("T2")} | call ADDPATH("T3")
+ call ADDPATH("T4")
+ catch /^var4$/
+ call ADDPATH("T5")
+ endtry
+
+ try
+ call ADDPATH("T6")
+ unlet var{THROW("var5")} var{ADDPATH("T7")} | call ADDPATH("T8")
+ call ADDPATH("T9")
+ catch /^var5$/
+ call ADDPATH("T10")
+ endtry
+
+ if addpath != "T1T5T6T10" || throwcount != 11
+ throw "addpath: " . addpath . ", throwcount: " . throwcount
+ endif
+
+ Xpath 1073741824 " X: 1073741824
+
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+unlet! var1 var2 var3 addpath throwcount
+delfunction THROW
+
+Xcheck 1789569365
+
+
+"-------------------------------------------------------------------------------
+" Test 73: :throw accross :function, :delfunction {{{1
+"
+" The :function and :delfunction commands may cause an expression
+" specified in braces to be evaluated. During evaluation, an
+" exception might be thrown. The exception can be caught by the
+" script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let taken = ""
+
+function! THROW(x, n)
+ let g:taken = g:taken . "T" . a:n
+ throw a:x
+endfunction
+
+function! EXPR(x, n)
+ let g:taken = g:taken . "E" . a:n
+ if a:n % 2 == 0
+ call THROW(a:x, a:n)
+ endif
+ return 2 - a:n % 2
+endfunction
+
+try
+ try
+ " Define function.
+ Xpath 1 " X: 1
+ function! F0()
+ endfunction
+ Xpath 2 " X: 2
+ function! F{EXPR("function-def-ok", 1)}()
+ endfunction
+ Xpath 4 " X: 4
+ function! F{EXPR("function-def", 2)}()
+ endfunction
+ Xpath 8 " X: 0
+ catch /^function-def-ok$/
+ Xpath 16 " X: 0
+ catch /^function-def$/
+ Xpath 32 " X: 32
+ catch /.*/
+ Xpath 64 " X: 0
+ Xout "def:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ " List function.
+ Xpath 128 " X: 128
+ function F0
+ Xpath 256 " X: 256
+ function F{EXPR("function-lst-ok", 3)}
+ Xpath 512 " X: 512
+ function F{EXPR("function-lst", 4)}
+ Xpath 1024 " X: 0
+ catch /^function-lst-ok$/
+ Xpath 2048 " X: 0
+ catch /^function-lst$/
+ Xpath 4096 " X: 4096
+ catch /.*/
+ Xpath 8192 " X: 0
+ Xout "lst:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ " Delete function
+ Xpath 16384 " X: 16384
+ delfunction F0
+ Xpath 32768 " X: 32768
+ delfunction F{EXPR("function-del-ok", 5)}
+ Xpath 65536 " X: 65536
+ delfunction F{EXPR("function-del", 6)}
+ Xpath 131072 " X: 0
+ catch /^function-del-ok$/
+ Xpath 262144 " X: 0
+ catch /^function-del$/
+ Xpath 524288 " X: 524288
+ catch /.*/
+ Xpath 1048576 " X: 0
+ Xout "del:" v:exception "in" v:throwpoint
+ endtry
+
+ let expected = "E1E2T2E3E4T4E5E6T6"
+ if taken != expected
+ Xpath 2097152 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ endif
+
+catch /.*/
+ Xpath 4194304 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xpath 8388608 " X: 8388608
+
+unlet taken expected
+delfunction THROW
+delfunction EXPR
+
+Xcheck 9032615
+
+
+"-------------------------------------------------------------------------------
+" Test 74: :throw accross builtin functions and commands {{{1
+"
+" Some functions like exists(), searchpair() take expression
+" arguments, other functions or commands like substitute() or
+" :substitute cause an expression (specified in the regular
+" expression) to be evaluated. During evaluation an exception
+" might be thrown. The exception can be caught by the script.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+let taken = ""
+
+function! THROW(x, n)
+ let g:taken = g:taken . "T" . a:n
+ throw a:x
+endfunction
+
+function! EXPR(x, n)
+ let g:taken = g:taken . "E" . a:n
+ call THROW(a:x . a:n, a:n)
+ return "EXPR"
+endfunction
+
+function! SKIP(x, n)
+ let g:taken = g:taken . "S" . a:n . "(" . line(".")
+ let theline = getline(".")
+ if theline =~ "skip"
+ let g:taken = g:taken . "s)"
+ return 1
+ elseif theline =~ "throw"
+ let g:taken = g:taken . "t)"
+ call THROW(a:x . a:n, a:n)
+ else
+ let g:taken = g:taken . ")"
+ return 0
+ endif
+endfunction
+
+function! SUBST(x, n)
+ let g:taken = g:taken . "U" . a:n . "(" . line(".")
+ let theline = getline(".")
+ if theline =~ "not" " SUBST() should not be called for this line
+ let g:taken = g:taken . "n)"
+ call THROW(a:x . a:n, a:n)
+ elseif theline =~ "throw"
+ let g:taken = g:taken . "t)"
+ call THROW(a:x . a:n, a:n)
+ else
+ let g:taken = g:taken . ")"
+ return "replaced"
+ endif
+endfunction
+
+try
+ try
+ Xpath 1 " X: 1
+ let result = exists('*{EXPR("exists", 1)}')
+ Xpath 2 " X: 0
+ catch /^exists1$/
+ Xpath 4 " X: 4
+ try
+ let result = exists('{EXPR("exists", 2)}')
+ Xpath 8 " X: 0
+ catch /^exists2$/
+ Xpath 16 " X: 16
+ catch /.*/
+ Xpath 32 " X: 0
+ Xout "exists2:" v:exception "in" v:throwpoint
+ endtry
+ catch /.*/
+ Xpath 64 " X: 0
+ Xout "exists1:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ let file = tempname()
+ exec "edit" file
+ insert
+begin
+ xx
+middle 3
+ xx
+middle 5 skip
+ xx
+middle 7 throw
+ xx
+end
+.
+ normal! gg
+ Xpath 128 " X: 128
+ let result =
+ \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 3)')
+ Xpath 256 " X: 256
+ let result =
+ \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 4)')
+ Xpath 512 " X: 0
+ let result =
+ \ searchpair("begin", "middle", "end", '', 'SKIP("searchpair", 5)')
+ Xpath 1024 " X: 0
+ catch /^searchpair[35]$/
+ Xpath 2048 " X: 0
+ catch /^searchpair4$/
+ Xpath 4096 " X: 4096
+ catch /.*/
+ Xpath 8192 " X: 0
+ Xout "searchpair:" v:exception "in" v:throwpoint
+ finally
+ bwipeout!
+ call delete(file)
+ endtry
+
+ try
+ let file = tempname()
+ exec "edit" file
+ insert
+subst 1
+subst 2
+not
+subst 4
+subst throw
+subst 6
+.
+ normal! gg
+ Xpath 16384 " X: 16384
+ 1,2substitute/subst/\=SUBST("substitute", 6)/
+ try
+ Xpath 32768 " X: 32768
+ try
+ let v:errmsg = ""
+ 3substitute/subst/\=SUBST("substitute", 7)/
+ finally
+ if v:errmsg != ""
+ " If exceptions are not thrown on errors, fake the error
+ " exception in order to get the same execution path.
+ throw "faked Vim(substitute)"
+ endif
+ endtry
+ catch /Vim(substitute)/ " Pattern not found ('e' flag missing)
+ Xpath 65536 " X: 65536
+ 3substitute/subst/\=SUBST("substitute", 8)/e
+ Xpath 131072 " X: 131072
+ endtry
+ Xpath 262144 " X: 262144
+ 4,6substitute/subst/\=SUBST("substitute", 9)/
+ Xpath 524288 " X: 0
+ catch /^substitute[678]/
+ Xpath 1048576 " X: 0
+ catch /^substitute9/
+ Xpath 2097152 " X: 2097152
+ finally
+ bwipeout!
+ call delete(file)
+ endtry
+
+ try
+ Xpath 4194304 " X: 4194304
+ let var = substitute("sub", "sub", '\=THROW("substitute()y", 10)', '')
+ Xpath 8388608 " X: 0
+ catch /substitute()y/
+ Xpath 16777216 " X: 16777216
+ catch /.*/
+ Xpath 33554432 " X: 0
+ Xout "substitute()y:" v:exception "in" v:throwpoint
+ endtry
+
+ try
+ Xpath 67108864 " X: 67108864
+ let var = substitute("not", "sub", '\=THROW("substitute()n", 11)', '')
+ Xpath 134217728 " X: 134217728
+ catch /substitute()n/
+ Xpath 268435456 " X: 0
+ catch /.*/
+ Xpath 536870912 " X: 0
+ Xout "substitute()n:" v:exception "in" v:throwpoint
+ endtry
+
+ let expected = "E1T1E2T2S3(3)S4(5s)S4(7t)T4U6(1)U6(2)U9(4)U9(5t)T9T10"
+ if taken != expected
+ Xpath 1073741824 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ endif
+
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+unlet result var taken expected
+delfunction THROW
+delfunction EXPR
+delfunction SKIP
+delfunction SUBST
+
+Xcheck 224907669
+
+
+"-------------------------------------------------------------------------------
+" Test 75: Errors in builtin functions. {{{1
+"
+" On an error in a builtin function called inside a :try/:endtry
+" region, the evaluation of the expression calling that function and
+" the command containing that expression are abandoned. The error can
+" be caught as an exception.
+"
+" A simple :call of the builtin function is a trivial case. If the
+" builtin function is called in the argument list of another function,
+" no further arguments are evaluated, and the other function is not
+" executed. If the builtin function is called from the argument of
+" a :return command, the :return command is not executed. If the
+" builtin function is called from the argument of a :throw command,
+" the :throw command is not executed. The evaluation of the
+" expression calling the builtin function is abandoned.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! F1(arg1)
+ Xpath 1 " X: 0
+endfunction
+
+function! F2(arg1, arg2)
+ Xpath 2 " X: 0
+endfunction
+
+function! G()
+ Xpath 4 " X: 0
+endfunction
+
+function! H()
+ Xpath 8 " X: 0
+endfunction
+
+function! R()
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 16 " X: 16
+ return append(1, "s")
+ catch /E21/
+ let caught = 1
+ catch /.*/
+ Xpath 32 " X: 0
+ finally
+ Xpath 64 " X: 64
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 128 " X: 128
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+ Xpath 256 " X: 256
+endfunction
+
+try
+ set noma " let append() fail with "E21"
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 512 " X: 512
+ call append(1, "s")
+ catch /E21/
+ let caught = 1
+ catch /.*/
+ Xpath 1024 " X: 0
+ finally
+ Xpath 2048 " X: 2048
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 4096 " X: 4096
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 8192 " X: 8192
+ call F1('x' . append(1, "s"))
+ catch /E21/
+ let caught = 1
+ catch /.*/
+ Xpath 16384 " X: 0
+ finally
+ Xpath 32768 " X: 32768
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 65536 " X: 65536
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 131072 " X: 131072
+ call F2('x' . append(1, "s"), G())
+ catch /E21/
+ let caught = 1
+ catch /.*/
+ Xpath 262144 " X: 0
+ finally
+ Xpath 524288 " X: 524288
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 1048576 " X: 1048576
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ call R()
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 2097152 " X: 2097152
+ throw "T" . append(1, "s")
+ catch /E21/
+ let caught = 1
+ catch /^T.*/
+ Xpath 4194304 " X: 0
+ catch /.*/
+ Xpath 8388608 " X: 0
+ finally
+ Xpath 16777216 " X: 16777216
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 33554432 " X: 33554432
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+
+ while 1
+ try
+ let caught = 0
+ let v:errmsg = ""
+ Xpath 67108864 " X: 67108864
+ let x = "a"
+ let x = x . "b" . append(1, "s") . H()
+ catch /E21/
+ let caught = 1
+ catch /.*/
+ Xpath 134217728 " X: 0
+ finally
+ Xpath 268435456 " X: 268435456
+ if caught || $VIMNOERRTHROW && v:errmsg =~ 'E21'
+ Xpath 536870912 " X: 536870912
+ endif
+ if x == "a"
+ Xpath 1073741824 " X: 1073741824
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry
+ endwhile
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout v:exception "in" v:throwpoint
+finally
+ set ma&
+endtry
+
+unlet! caught x
+delfunction F1
+delfunction F2
+delfunction G
+delfunction H
+delfunction R
+
+Xcheck 2000403408
+
+
+"-------------------------------------------------------------------------------
+" Test 76: Errors, interupts, :throw during expression evaluation {{{1
+"
+" When a function call made during expression evaluation is aborted
+" due to an error inside a :try/:endtry region or due to an interrupt
+" or a :throw, the expression evaluation is aborted as well. No
+" message is displayed for the cancelled expression evaluation. On an
+" error not inside :try/:endtry, the expression evaluation continues.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ let taken = ""
+
+ function! ERR(n)
+ let g:taken = g:taken . "E" . a:n
+ asdf
+ endfunction
+
+ function! ERRabort(n) abort
+ let g:taken = g:taken . "A" . a:n
+ asdf
+ endfunction " returns -1
+
+ function! INT(n)
+ let g:taken = g:taken . "I" . a:n
+ "INTERRUPT9
+ let dummy = 0
+ endfunction
+
+ function! THR(n)
+ let g:taken = g:taken . "T" . a:n
+ throw "should not be caught"
+ endfunction
+
+ function! CONT(n)
+ let g:taken = g:taken . "C" . a:n
+ endfunction
+
+ function! MSG(n)
+ let g:taken = g:taken . "M" . a:n
+ if (a:n >= 10 && a:n <= 27) ? v:errmsg != "" : v:errmsg !~ "asdf"
+ let g:taken = g:taken . "x"
+ endif
+ let v:errmsg = ""
+ endfunction
+
+ let v:errmsg = ""
+
+ try
+ let t = 1
+ XloopINIT 1 2
+ while t <= 9
+ Xloop 1 " X: 511
+ try
+ if t == 1
+ let v{ERR(t) + CONT(t)} = 0
+ elseif t == 2
+ let v{ERR(t) + CONT(t)}
+ elseif t == 3
+ let var = exists('v{ERR(t) + CONT(t)}')
+ elseif t == 4
+ unlet v{ERR(t) + CONT(t)}
+ elseif t == 5
+ function F{ERR(t) + CONT(t)}()
+ endfunction
+ elseif t == 6
+ function F{ERR(t) + CONT(t)}
+ elseif t == 7
+ let var = exists('*F{ERR(t) + CONT(t)}')
+ elseif t == 8
+ delfunction F{ERR(t) + CONT(t)}
+ elseif t == 9
+ let var = ERR(t) + CONT(t)
+ endif
+ catch /asdf/
+ " v:errmsg is not set when the error message is converted to an
+ " exception. Set it to the original error message.
+ let v:errmsg = substitute(v:exception, '^Vim:', '', "")
+ catch /^Vim\((\a\+)\)\=:/
+ " An error exception has been thrown after the original error.
+ let v:errmsg = ""
+ finally
+ call MSG(t)
+ let t = t + 1
+ XloopNEXT
+ continue " discard an aborting error
+ endtry
+ endwhile
+ catch /.*/
+ Xpath 512 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+
+ try
+ let t = 10
+ XloopINIT 1024 2
+ while t <= 18
+ Xloop 1 " X: 1024 * 511
+ try
+ if t == 10
+ let v{INT(t) + CONT(t)} = 0
+ elseif t == 11
+ let v{INT(t) + CONT(t)}
+ elseif t == 12
+ let var = exists('v{INT(t) + CONT(t)}')
+ elseif t == 13
+ unlet v{INT(t) + CONT(t)}
+ elseif t == 14
+ function F{INT(t) + CONT(t)}()
+ endfunction
+ elseif t == 15
+ function F{INT(t) + CONT(t)}
+ elseif t == 16
+ let var = exists('*F{INT(t) + CONT(t)}')
+ elseif t == 17
+ delfunction F{INT(t) + CONT(t)}
+ elseif t == 18
+ let var = INT(t) + CONT(t)
+ endif
+ catch /^Vim\((\a\+)\)\=:\(Interrupt\)\@!/
+ " An error exception has been triggered after the interrupt.
+ let v:errmsg = substitute(v:exception,
+ \ '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ call MSG(t)
+ let t = t + 1
+ XloopNEXT
+ continue " discard interrupt
+ endtry
+ endwhile
+ catch /.*/
+ Xpath 524288 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+
+ try
+ let t = 19
+ XloopINIT 1048576 2
+ while t <= 27
+ Xloop 1 " X: 1048576 * 511
+ try
+ if t == 19
+ let v{THR(t) + CONT(t)} = 0
+ elseif t == 20
+ let v{THR(t) + CONT(t)}
+ elseif t == 21
+ let var = exists('v{THR(t) + CONT(t)}')
+ elseif t == 22
+ unlet v{THR(t) + CONT(t)}
+ elseif t == 23
+ function F{THR(t) + CONT(t)}()
+ endfunction
+ elseif t == 24
+ function F{THR(t) + CONT(t)}
+ elseif t == 25
+ let var = exists('*F{THR(t) + CONT(t)}')
+ elseif t == 26
+ delfunction F{THR(t) + CONT(t)}
+ elseif t == 27
+ let var = THR(t) + CONT(t)
+ endif
+ catch /^Vim\((\a\+)\)\=:/
+ " An error exception has been triggered after the :throw.
+ let v:errmsg = substitute(v:exception,
+ \ '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ call MSG(t)
+ let t = t + 1
+ XloopNEXT
+ continue " discard exception
+ endtry
+ endwhile
+ catch /.*/
+ Xpath 536870912 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+
+ let v{ERR(28) + CONT(28)} = 0
+ call MSG(28)
+ let v{ERR(29) + CONT(29)}
+ call MSG(29)
+ let var = exists('v{ERR(30) + CONT(30)}')
+ call MSG(30)
+ unlet v{ERR(31) + CONT(31)}
+ call MSG(31)
+ function F{ERR(32) + CONT(32)}()
+ endfunction
+ call MSG(32)
+ function F{ERR(33) + CONT(33)}
+ call MSG(33)
+ let var = exists('*F{ERR(34) + CONT(34)}')
+ call MSG(34)
+ delfunction F{ERR(35) + CONT(35)}
+ call MSG(35)
+ let var = ERR(36) + CONT(36)
+ call MSG(36)
+
+ let v{ERRabort(37) + CONT(37)} = 0
+ call MSG(37)
+ let v{ERRabort(38) + CONT(38)}
+ call MSG(38)
+ let var = exists('v{ERRabort(39) + CONT(39)}')
+ call MSG(39)
+ unlet v{ERRabort(40) + CONT(40)}
+ call MSG(40)
+ function F{ERRabort(41) + CONT(41)}()
+ endfunction
+ call MSG(41)
+ function F{ERRabort(42) + CONT(42)}
+ call MSG(42)
+ let var = exists('*F{ERRabort(43) + CONT(43)}')
+ call MSG(43)
+ delfunction F{ERRabort(44) + CONT(44)}
+ call MSG(44)
+ let var = ERRabort(45) + CONT(45)
+ call MSG(45)
+
+ Xpath 1073741824 " X: 1073741824
+
+ let expected = ""
+ \ . "E1M1E2M2E3M3E4M4E5M5E6M6E7M7E8M8E9M9"
+ \ . "I10M10I11M11I12M12I13M13I14M14I15M15I16M16I17M17I18M18"
+ \ . "T19M19T20M20T21M21T22M22T23M23T24M24T25M25T26M26T27M27"
+ \ . "E28C28M28E29C29M29E30C30M30E31C31M31E32C32M32E33C33M33"
+ \ . "E34C34M34E35C35M35E36C36M36"
+ \ . "A37C37M37A38C38M38A39C39M39A40C40M40A41C41M41A42C42M42"
+ \ . "A43C43M43A44C44M44A45C45M45"
+
+ if taken != expected
+ " The Xpath command does not accept 2^31 (negative); display explicitly:
+ exec "!echo 2147483648 >>" . g:ExtraVimResult
+ " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ if substitute(taken,
+ \ '\(.*\)E3C3M3x\(.*\)E30C30M30x\(.*\)A39C39M39x\(.*\)',
+ \ '\1E3M3\2E30C30M30\3A39C39M39\4',
+ \ "") == expected
+ Xout "Is ++emsg_skip for var with expr_start non-NULL"
+ \ "in f_exists ok?"
+ endif
+ endif
+
+ unlet! var taken expected
+ call delete(WA_t5)
+ call delete(WA_t14)
+ call delete(WA_t23)
+ unlet! WA_t5 WA_t14 WA_t23
+ delfunction WA_t5
+ delfunction WA_t14
+ delfunction WA_t23
+
+endif
+
+Xcheck 1610087935
+
+
+"-------------------------------------------------------------------------------
+" Test 77: Errors, interupts, :throw in name{brace-expression} {{{1
+"
+" When a function call made during evaluation of an expression in
+" braces as part of a function name after ":function" is aborted due
+" to an error inside a :try/:endtry region or due to an interrupt or
+" a :throw, the expression evaluation is aborted as well, and the
+" function definition is ignored, skipping all commands to the
+" ":endfunction". On an error not inside :try/:endtry, the expression
+" evaluation continues and the function gets defined, and can be
+" called and deleted.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT 1 4
+
+function! ERR() abort
+ Xloop 1 " X: 1 + 4 + 16 + 64
+ asdf
+endfunction " returns -1
+
+function! OK()
+ Xloop 2 " X: 2 * (1 + 4 + 16)
+ let v:errmsg = ""
+ return 0
+endfunction
+
+let v:errmsg = ""
+
+Xpath 4096 " X: 4096
+function! F{1 + ERR() + OK()}(arg)
+ " F0 should be defined.
+ if exists("a:arg") && a:arg == "calling"
+ Xpath 8192 " X: 8192
+ else
+ Xpath 16384 " X: 0
+ endif
+endfunction
+if v:errmsg != ""
+ Xpath 32768 " X: 0
+endif
+XloopNEXT
+
+Xpath 65536 " X: 65536
+call F{1 + ERR() + OK()}("calling")
+if v:errmsg != ""
+ Xpath 131072 " X: 0
+endif
+XloopNEXT
+
+Xpath 262144 " X: 262144
+delfunction F{1 + ERR() + OK()}
+if v:errmsg != ""
+ Xpath 524288 " X: 0
+endif
+XloopNEXT
+
+try
+ while 1
+ let caught = 0
+ try
+ Xpath 1048576 " X: 1048576
+ function! G{1 + ERR() + OK()}(arg)
+ " G0 should not be defined, and the function body should be
+ " skipped.
+ if exists("a:arg") && a:arg == "calling"
+ Xpath 2097152 " X: 0
+ else
+ Xpath 4194304 " X: 0
+ endif
+ " Use an unmatched ":finally" to check whether the body is
+ " skipped when an error occurs in ERR(). This works whether or
+ " not the exception is converted to an exception.
+ finally
+ Xpath 8388608 " X: 0
+ Xout "Body of G{1 + ERR() + OK()}() not skipped"
+ " Discard the aborting error or exception, and break the
+ " while loop.
+ break
+ " End the try conditional and start a new one to avoid
+ " ":catch after :finally" errors.
+ endtry
+ try
+ Xpath 16777216 " X: 0
+ endfunction
+
+ " When the function was not defined, this won't be reached - whether
+ " the body was skipped or not. When the function was defined, it
+ " can be called and deleted here.
+ Xpath 33554432 " X: 0
+ Xout "G0() has been defined"
+ XloopNEXT
+ try
+ call G{1 + ERR() + OK()}("calling")
+ catch /.*/
+ Xpath 67108864 " X: 0
+ endtry
+ Xpath 134217728 " X: 0
+ XloopNEXT
+ try
+ delfunction G{1 + ERR() + OK()}
+ catch /.*/
+ Xpath 268435456 " X: 0
+ endtry
+ catch /asdf/
+ " Jumped to when the function is not defined and the body is
+ " skipped.
+ let caught = 1
+ catch /.*/
+ Xpath 536870912 " X: 0
+ finally
+ if !caught && !$VIMNOERRTHROW
+ Xpath 1073741824 " X: 0
+ endif
+ break " discard error for $VIMNOERRTHROW
+ endtry " jumped to when the body is not skipped
+ endwhile
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout "Body of G{1 + ERR() + OK()}() not skipped, exception caught"
+ Xout v:exception "in" v:throwpoint
+endtry
+
+Xcheck 1388671
+
+
+"-------------------------------------------------------------------------------
+" Test 78: Messages on parsing errors in expression evaluation {{{1
+"
+" When an expression evaluation detects a parsing error, an error
+" message is given and converted to an exception, and the expression
+" evaluation is aborted.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ let taken = ""
+
+ function! F(n)
+ let g:taken = g:taken . "F" . a:n
+ endfunction
+
+ function! MSG(n, enr, emsg)
+ let g:taken = g:taken . "M" . a:n
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ if v:errmsg == ""
+ Xout "Expr" a:n.": Message missing."
+ let g:taken = g:taken . "x"
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Expr" a:n.": Unexpected message:" v:errmsg
+ let g:taken = g:taken . "X"
+ endif
+ endif
+ endfunction
+
+ function! CONT(n)
+ let g:taken = g:taken . "C" . a:n
+ endfunction
+
+ let v:errmsg = ""
+ XloopINIT 1 2
+
+ try
+ let t = 1
+ while t <= 14
+ let g:taken = g:taken . "T" . t
+ let v:errmsg = ""
+ try
+ let caught = 0
+ if t == 1
+ let v{novar + CONT(t)} = 0
+ elseif t == 2
+ let v{novar + CONT(t)}
+ elseif t == 3
+ let var = exists('v{novar + CONT(t)}')
+ elseif t == 4
+ unlet v{novar + CONT(t)}
+ elseif t == 5
+ function F{novar + CONT(t)}()
+ endfunction
+ elseif t == 6
+ function F{novar + CONT(t)}
+ elseif t == 7
+ let var = exists('*F{novar + CONT(t)}')
+ elseif t == 8
+ delfunction F{novar + CONT(t)}
+ elseif t == 9
+ echo novar + CONT(t)
+ elseif t == 10
+ echo v{novar + CONT(t)}
+ elseif t == 11
+ echo F{novar + CONT(t)}
+ elseif t == 12
+ let var = novar + CONT(t)
+ elseif t == 13
+ let var = v{novar + CONT(t)}
+ elseif t == 14
+ let var = F{novar + CONT(t)}()
+ endif
+ catch /^Vim\((\a\+)\)\=:/
+ " v:errmsg is not set when the error message is converted to an
+ " exception. Set it to the original error message.
+ let v:errmsg = substitute(v:exception,
+ \ '^Vim\((\a\+)\)\=:', '', "")
+ let caught = 1
+ finally
+ if !caught " no error exceptions ($VIMNOERRTHROW set)
+ if t <= 8 && t != 3
+ call MSG(t, 'E475', 'Invalid argument\>')
+ else
+ call MSG(t, 'E15', "Invalid expression")
+ endif
+ else
+ if t == 2 || t == 4
+ call MSG(t, 'E475', 'Invalid argument\>')
+ else
+ call MSG(t, 'E121', "Undefined variable")
+ endif
+ endif
+ let t = t + 1
+ XloopNEXT
+ continue " discard an aborting error
+ endtry
+ endwhile
+ catch /.*/
+ Xloop 1 " X: 0
+ Xout t.":" v:exception "in" ExtraVimThrowpoint()
+ endtry
+
+ function! T(n, expr, enr, emsg)
+ try
+ let g:taken = g:taken . "T" . a:n
+ let v:errmsg = ""
+ try
+ let caught = 0
+ execute "let var = " . a:expr
+ catch /^Vim\((\a\+)\)\=:/
+ " v:errmsg is not set when the error message is converted to an
+ " exception. Set it to the original error message.
+ let v:errmsg = substitute(v:exception,
+ \ '^Vim\((\a\+)\)\=:', '', "")
+ let caught = 1
+ finally
+ if !caught " no error exceptions ($VIMNOERRTHROW set)
+ call MSG(a:n, 'E15', "Invalid expression")
+ else
+ call MSG(a:n, a:enr, a:emsg)
+ endif
+ XloopNEXT
+ " Discard an aborting error:
+ return
+ endtry
+ catch /.*/
+ Xloop 1 " X: 0
+ Xout a:n.":" v:exception "in" ExtraVimThrowpoint()
+ endtry
+ endfunction
+
+ call T(15, 'Nofunc() + CONT(15)', 'E117', "Unknown function")
+ call T(16, 'F(1 2 + CONT(16))', 'E116', "Invalid arguments")
+ call T(17, 'F(1, 2) + CONT(17)', 'E118', "Too many arguments")
+ call T(18, 'F() + CONT(18)', 'E119', "Not enough arguments")
+ call T(19, '{(1} + CONT(19)', 'E110', "Missing ')'")
+ call T(20, '("abc"[1) + CONT(20)', 'E111', "Missing ']'")
+ call T(21, '(1 +) + CONT(21)', 'E15', "Invalid expression")
+ call T(22, '1 2 + CONT(22)', 'E15', "Invalid expression")
+ call T(23, '(1 ? 2) + CONT(23)', 'E109', "Missing ':' after '?'")
+ call T(24, '("abc) + CONT(24)', 'E114', "Missing quote")
+ call T(25, "('abc) + CONT(25)", 'E115', "Missing quote")
+ call T(26, '& + CONT(26)', 'E112', "Option name missing")
+ call T(27, '&asdf + CONT(27)', 'E113', "Unknown option")
+
+ Xpath 134217728 " X: 134217728
+
+ let expected = ""
+ \ . "T1M1T2M2T3M3T4M4T5M5T6M6T7M7T8M8T9M9T10M10T11M11T12M12T13M13T14M14"
+ \ . "T15M15T16M16T17M17T18M18T19M19T20M20T21M21T22M22T23M23T24M24T25M25"
+ \ . "T26M26T27M27"
+
+ if taken != expected
+ Xpath 268435456 " X: 0
+ Xout "'taken' is" taken "instead of" expected
+ if substitute(taken, '\(.*\)T3M3x\(.*\)', '\1T3M3\2', "") == expected
+ Xout "Is ++emsg_skip for var with expr_start non-NULL"
+ \ "in f_exists ok?"
+ endif
+ endif
+
+ unlet! var caught taken expected
+ call delete(WA_t5)
+ unlet! WA_t5
+ delfunction WA_t5
+
+endif
+
+Xcheck 134217728
+
+
+"-------------------------------------------------------------------------------
+" Test 79: Throwing one of several errors for the same command {{{1
+"
+" When several errors appear in a row (for instance during expression
+" evaluation), the first as the most specific one is used when
+" throwing an error exception. If, however, a syntax error is
+" detected afterwards, this one is used for the error exception.
+" On a syntax error, the next command is not executed, on a normal
+" error, however, it is (relevant only in a function without the
+" "abort" flag). v:errmsg is not set.
+"
+" If throwing error exceptions is configured off, v:errmsg is always
+" set to the latest error message, that is, to the more general
+" message or the syntax error, respectively.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+XloopINIT 1 2
+
+function! NEXT(cmd)
+ exec a:cmd . " | Xloop 1"
+endfunction
+
+call NEXT('echo novar') " X: 1 * 1 (checks nextcmd)
+XloopNEXT
+call NEXT('let novar #') " X: 0 * 2 (skips nextcmd)
+XloopNEXT
+call NEXT('unlet novar #') " X: 0 * 4 (skips nextcmd)
+XloopNEXT
+call NEXT('let {novar}') " X: 0 * 8 (skips nextcmd)
+XloopNEXT
+call NEXT('unlet{ novar}') " X: 0 * 16 (skips nextcmd)
+
+function! EXEC(cmd)
+ exec a:cmd
+endfunction
+
+function! MATCH(expected, msg, enr, emsg)
+ let msg = a:msg
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let msg = ":" . msg
+ endif
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if msg !~ '^'.a:enr.':' || (english && msg !~ a:emsg)
+ let match = 0
+ if a:expected " no match although expected
+ if a:msg == ""
+ Xout "Message missing."
+ else
+ let msg = escape(msg, '"')
+ Xout "Unexpected message:" msg
+ endif
+ endif
+ else
+ let match = 1
+ if !a:expected " match although not expected
+ let msg = escape(msg, '"')
+ Xout "Unexpected message:" msg
+ endif
+ endif
+ return match
+endfunction
+
+try
+
+ while 1 " dummy loop
+ try
+ let v:errmsg = ""
+ let caught = 0
+ let thrmsg = ""
+ call EXEC('echo novar') " normal error
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xpath 32 " X: 32
+ if !caught
+ if !$VIMNOERRTHROW
+ Xpath 64 " X: 0
+ endif
+ elseif !MATCH(1, thrmsg, 'E121', "Undefined variable")
+ \ || v:errmsg != ""
+ Xpath 128 " X: 0
+ endif
+ if !caught && !MATCH(1, v:errmsg, 'E15', "Invalid expression")
+ Xpath 256 " X: 0
+ endif
+ break " discard error if $VIMNOERRTHROW == 1
+ endtry
+ endwhile
+
+ Xpath 512 " X: 512
+ let cmd = "let"
+ XloopINIT 1024 32
+ while cmd != ""
+ try
+ let v:errmsg = ""
+ let caught = 0
+ let thrmsg = ""
+ call EXEC(cmd . ' novar #') " normal plus syntax error
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xloop 1 " X: 1024 * (1 + 32)
+ if !caught
+ if !$VIMNOERRTHROW
+ Xloop 2 " X: 0
+ endif
+ else
+ if cmd == "let"
+ let match = MATCH(0, thrmsg, 'E106', "Unknown variable")
+ elseif cmd == "unlet"
+ let match = MATCH(0, thrmsg, 'E108', "No such variable")
+ endif
+ if match " normal error
+ Xloop 4 " X: 0
+ endif
+ if !MATCH(1, thrmsg, 'E488', "Trailing characters")
+ \|| v:errmsg != ""
+ " syntax error
+ Xloop 8 " X: 0
+ endif
+ endif
+ if !caught && !MATCH(1, v:errmsg, 'E488', "Trailing characters")
+ " last error
+ Xloop 16 " X: 0
+ endif
+ if cmd == "let"
+ let cmd = "unlet"
+ else
+ let cmd = ""
+ endif
+ XloopNEXT
+ continue " discard error if $VIMNOERRTHROW == 1
+ endtry
+ endwhile
+
+ Xpath 1048576 " X: 1048576
+ let cmd = "let"
+ XloopINIT 2097152 32
+ while cmd != ""
+ try
+ let v:errmsg = ""
+ let caught = 0
+ let thrmsg = ""
+ call EXEC(cmd . ' {novar}') " normal plus syntax error
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let thrmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xloop 1 " X: 2097152 * (1 + 32)
+ if !caught
+ if !$VIMNOERRTHROW
+ Xloop 2 " X: 0
+ endif
+ else
+ if MATCH(0, thrmsg, 'E121', "Undefined variable") " normal error
+ Xloop 4 " X: 0
+ endif
+ if !MATCH(1, thrmsg, 'E475', 'Invalid argument\>')
+ \ || v:errmsg != "" " syntax error
+ Xloop 8 " X: 0
+ endif
+ endif
+ if !caught && !MATCH(1, v:errmsg, 'E475', 'Invalid argument\>')
+ " last error
+ Xloop 16 " X: 0
+ endif
+ if cmd == "let"
+ let cmd = "unlet"
+ else
+ let cmd = ""
+ endif
+ XloopNEXT
+ continue " discard error if $VIMNOERRTHROW == 1
+ endtry
+ endwhile
+
+catch /.*/
+ " The Xpath command does not accept 2^31 (negative); add explicitly:
+ let Xpath = Xpath + 2147483648 " X: 0
+ Xout v:exception "in" v:throwpoint
+endtry
+
+unlet! next_command thrmsg match
+delfunction NEXT
+delfunction EXEC
+delfunction MATCH
+
+Xcheck 70288929
+
+
+"-------------------------------------------------------------------------------
+" Test 80: Syntax error in expression for illegal :elseif {{{1
+"
+" If there is a syntax error in the expression after an illegal
+" :elseif, an error message is given (or an error exception thrown)
+" for the illegal :elseif rather than the expression error.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+let v:errmsg = ""
+if 0
+else
+elseif 1 ||| 2
+endif
+Xpath 1 " X: 1
+if !MSG('E584', ":elseif after :else")
+ Xpath 2 " X: 0
+endif
+
+let v:errmsg = ""
+if 1
+else
+elseif 1 ||| 2
+endif
+Xpath 4 " X: 4
+if !MSG('E584', ":elseif after :else")
+ Xpath 8 " X: 0
+endif
+
+let v:errmsg = ""
+elseif 1 ||| 2
+Xpath 16 " X: 16
+if !MSG('E582', ":elseif without :if")
+ Xpath 32 " X: 0
+endif
+
+let v:errmsg = ""
+while 1
+ elseif 1 ||| 2
+endwhile
+Xpath 64 " X: 64
+if !MSG('E582', ":elseif without :if")
+ Xpath 128 " X: 0
+endif
+
+while 1
+ try
+ try
+ let v:errmsg = ""
+ let caught = 0
+ if 0
+ else
+ elseif 1 ||| 2
+ endif
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xpath 256 " X: 256
+ if !caught && !$VIMNOERRTHROW
+ Xpath 512 " X: 0
+ endif
+ if !MSG('E584', ":elseif after :else")
+ Xpath 1024 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 2048 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let v:errmsg = ""
+ let caught = 0
+ if 1
+ else
+ elseif 1 ||| 2
+ endif
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xpath 4096 " X: 4096
+ if !caught && !$VIMNOERRTHROW
+ Xpath 8192 " X: 0
+ endif
+ if !MSG('E584', ":elseif after :else")
+ Xpath 16384 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 32768 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let v:errmsg = ""
+ let caught = 0
+ elseif 1 ||| 2
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xpath 65536 " X: 65536
+ if !caught && !$VIMNOERRTHROW
+ Xpath 131072 " X: 0
+ endif
+ if !MSG('E582', ":elseif without :if")
+ Xpath 262144 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 524288 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let v:errmsg = ""
+ let caught = 0
+ while 1
+ elseif 1 ||| 2
+ endwhile
+ catch /^Vim\((\a\+)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((\a\+)\)\=:', '', "")
+ finally
+ Xpath 1048576 " X: 1048576
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2097152 " X: 0
+ endif
+ if !MSG('E582', ":elseif without :if")
+ Xpath 4194304 " X: 0
+ endif
+ endtry
+ catch /.*/
+ Xpath 8388608 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+Xpath 16777216 " X: 16777216
+
+unlet! caught
+delfunction MSG
+
+Xcheck 17895765
+
+
+"-------------------------------------------------------------------------------
+" Test 81: Discarding exceptions after an error or interrupt {{{1
+"
+" When an exception is thrown from inside a :try conditional without
+" :catch and :finally clauses and an error or interrupt occurs before
+" the :endtry is reached, the exception is discarded.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ try
+ Xpath 1 " X: 1
+ try
+ Xpath 2 " X: 2
+ throw "arrgh"
+ Xpath 4 " X: 0
+" if 1
+ Xpath 8 " X: 0
+ " error after :throw: missing :endif
+ endtry
+ Xpath 16 " X: 0
+ catch /arrgh/
+ Xpath 32 " X: 0
+ endtry
+ Xpath 64 " X: 0
+endif
+
+if ExtraVim()
+ try
+ Xpath 128 " X: 128
+ try
+ Xpath 256 " X: 256
+ throw "arrgh"
+ Xpath 512 " X: 0
+ endtry " INTERRUPT
+ Xpath 1024 " X: 0
+ catch /arrgh/
+ Xpath 2048 " X: 0
+ endtry
+ Xpath 4096 " X: 0
+endif
+
+Xcheck 387
+
+
+"-------------------------------------------------------------------------------
+" Test 82: Ignoring :catch clauses after an error or interrupt {{{1
+"
+" When an exception is thrown and an error or interrupt occurs before
+" the matching :catch clause is reached, the exception is discarded
+" and the :catch clause is ignored (also for the error or interrupt
+" exception being thrown then).
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ try
+ try
+ Xpath 1 " X: 1
+ throw "arrgh"
+ Xpath 2 " X: 0
+" if 1
+ Xpath 4 " X: 0
+ " error after :throw: missing :endif
+ catch /.*/
+ Xpath 8 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ catch /.*/
+ Xpath 16 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+ Xpath 32 " X: 0
+ catch /arrgh/
+ Xpath 64 " X: 0
+ endtry
+ Xpath 128 " X: 0
+endif
+
+if ExtraVim()
+ function! E()
+ try
+ try
+ Xpath 256 " X: 256
+ throw "arrgh"
+ Xpath 512 " X: 0
+" if 1
+ Xpath 1024 " X: 0
+ " error after :throw: missing :endif
+ catch /.*/
+ Xpath 2048 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ catch /.*/
+ Xpath 4096 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+ Xpath 8192 " X: 0
+ catch /arrgh/
+ Xpath 16384 " X: 0
+ endtry
+ endfunction
+
+ call E()
+ Xpath 32768 " X: 0
+endif
+
+if ExtraVim()
+ try
+ try
+ Xpath 65536 " X: 65536
+ throw "arrgh"
+ Xpath 131072 " X: 0
+ catch /.*/ "INTERRUPT
+ Xpath 262144 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ catch /.*/
+ Xpath 524288 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+ Xpath 1048576 " X: 0
+ catch /arrgh/
+ Xpath 2097152 " X: 0
+ endtry
+ Xpath 4194304 " X: 0
+endif
+
+if ExtraVim()
+ function I()
+ try
+ try
+ Xpath 8388608 " X: 8388608
+ throw "arrgh"
+ Xpath 16777216 " X: 0
+ catch /.*/ "INTERRUPT
+ Xpath 33554432 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ catch /.*/
+ Xpath 67108864 " X: 0
+ Xout v:exception "in" ExtraVimThrowpoint()
+ endtry
+ Xpath 134217728 " X: 0
+ catch /arrgh/
+ Xpath 268435456 " X: 0
+ endtry
+ endfunction
+
+ call I()
+ Xpath 536870912 " X: 0
+endif
+
+Xcheck 8454401
+
+
+"-------------------------------------------------------------------------------
+" Test 83: Executing :finally clauses after an error or interrupt {{{1
+"
+" When an exception is thrown and an error or interrupt occurs before
+" the :finally of the innermost :try is reached, the exception is
+" discarded and the :finally clause is executed.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+ try
+ Xpath 1 " X: 1
+ try
+ Xpath 2 " X: 2
+ throw "arrgh"
+ Xpath 4 " X: 0
+" if 1
+ Xpath 8 " X: 0
+ " error after :throw: missing :endif
+ finally
+ Xpath 16 " X: 16
+ endtry
+ Xpath 32 " X: 0
+ catch /arrgh/
+ Xpath 64 " X: 0
+ endtry
+ Xpath 128 " X: 0
+endif
+
+if ExtraVim()
+ try
+ Xpath 256 " X: 256
+ try
+ Xpath 512 " X: 512
+ throw "arrgh"
+ Xpath 1024 " X: 0
+ finally "INTERRUPT
+ Xpath 2048 " X: 2048
+ endtry
+ Xpath 4096 " X: 0
+ catch /arrgh/
+ Xpath 8192 " X: 0
+ endtry
+ Xpath 16384 " X: 0
+endif
+
+Xcheck 2835
+
+
+"-------------------------------------------------------------------------------
+" Test 84: Exceptions in autocommand sequences. {{{1
+"
+" When an exception occurs in a sequence of autocommands for
+" a specific event, the rest of the sequence is not executed. The
+" command that triggered the autocommand execution aborts, and the
+" exception is propagated to the caller.
+"
+" For the FuncUndefined event under a function call expression or
+" :call command, the function is not exexecuted, even when it has
+" been defined by the autocommands before the exception occurred.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ function! INT()
+ "INTERRUPT
+ let dummy = 0
+ endfunction
+
+ aug TMP
+ autocmd!
+
+ autocmd User x1 Xpath 1 " X: 1
+ autocmd User x1 throw "x1"
+ autocmd User x1 Xpath 2 " X: 0
+
+ autocmd User x2 Xpath 4 " X: 4
+ autocmd User x2 asdf
+ autocmd User x2 Xpath 8 " X: 0
+
+ autocmd User x3 Xpath 16 " X: 16
+ autocmd User x3 call INT()
+ autocmd User x3 Xpath 32 " X: 0
+
+ autocmd FuncUndefined U1 function! U1()
+ autocmd FuncUndefined U1 Xpath 64 " X: 0
+ autocmd FuncUndefined U1 endfunction
+ autocmd FuncUndefined U1 Xpath 128 " X: 128
+ autocmd FuncUndefined U1 throw "U1"
+ autocmd FuncUndefined U1 Xpath 256 " X: 0
+
+ autocmd FuncUndefined U2 function! U2()
+ autocmd FuncUndefined U2 Xpath 512 " X: 0
+ autocmd FuncUndefined U2 endfunction
+ autocmd FuncUndefined U2 Xpath 1024 " X: 1024
+ autocmd FuncUndefined U2 ASDF
+ autocmd FuncUndefined U2 Xpath 2048 " X: 0
+
+ autocmd FuncUndefined U3 function! U3()
+ autocmd FuncUndefined U3 Xpath 4096 " X: 0
+ autocmd FuncUndefined U3 endfunction
+ autocmd FuncUndefined U3 Xpath 8192 " X: 8192
+ autocmd FuncUndefined U3 call INT()
+ autocmd FuncUndefined U3 Xpath 16384 " X: 0
+ aug END
+
+ try
+ try
+ Xpath 32768 " X: 32768
+ doautocmd User x1
+ catch /x1/
+ Xpath 65536 " X: 65536
+ endtry
+
+ while 1
+ try
+ Xpath 131072 " X: 131072
+ let caught = 0
+ doautocmd User x2
+ catch /asdf/
+ let caught = 1
+ finally
+ Xpath 262144 " X: 262144
+ if !caught && !$VIMNOERRTHROW
+ Xpath 524288 " X: 0
+ " Propagate uncaught error exception,
+ else
+ " ... but break loop for caught error exception,
+ " or discard error and break loop if $VIMNOERRTHROW
+ break
+ endif
+ endtry
+ endwhile
+
+ while 1
+ try
+ Xpath 1048576 " X: 1048576
+ let caught = 0
+ doautocmd User x3
+ catch /Vim:Interrupt/
+ let caught = 1
+ finally
+ Xpath 2097152 " X: 2097152
+ if !caught && !$VIMNOINTTHROW
+ Xpath 4194304 " X: 0
+ " Propagate uncaught interrupt exception,
+ else
+ " ... but break loop for caught interrupt exception,
+ " or discard interrupt and break loop if $VIMNOINTTHROW
+ break
+ endif
+ endtry
+ endwhile
+
+ if exists("*U1") | delfunction U1 | endif
+ if exists("*U2") | delfunction U2 | endif
+ if exists("*U3") | delfunction U3 | endif
+
+ try
+ Xpath 8388608 " X: 8388608
+ call U1()
+ catch /U1/
+ Xpath 16777216 " X: 16777216
+ endtry
+
+ while 1
+ try
+ Xpath 33554432 " X: 33554432
+ let caught = 0
+ call U2()
+ catch /ASDF/
+ let caught = 1
+ finally
+ Xpath 67108864 " X: 67108864
+ if !caught && !$VIMNOERRTHROW
+ Xpath 134217728 " X: 0
+ " Propagate uncaught error exception,
+ else
+ " ... but break loop for caught error exception,
+ " or discard error and break loop if $VIMNOERRTHROW
+ break
+ endif
+ endtry
+ endwhile
+
+ while 1
+ try
+ Xpath 268435456 " X: 268435456
+ let caught = 0
+ call U3()
+ catch /Vim:Interrupt/
+ let caught = 1
+ finally
+ Xpath 536870912 " X: 536870912
+ if !caught && !$VIMNOINTTHROW
+ Xpath 1073741824 " X: 0
+ " Propagate uncaught interrupt exception,
+ else
+ " ... but break loop for caught interrupt exception,
+ " or discard interrupt and break loop if $VIMNOINTTHROW
+ break
+ endif
+ endtry
+ endwhile
+ catch /.*/
+ " The Xpath command does not accept 2^31 (negative); display explicitly:
+ exec "!echo 2147483648 >>" . g:ExtraVimResult
+ Xout "Caught" v:exception "in" v:throwpoint
+ endtry
+
+ unlet caught
+ delfunction INT
+ delfunction U1
+ delfunction U2
+ delfunction U3
+ au! TMP
+ aug! TMP
+endif
+
+Xcheck 934782101
+
+
+"-------------------------------------------------------------------------------
+" Test 85: Error exceptions in autocommands for I/O command events {{{1
+"
+" When an I/O command is inside :try/:endtry, autocommands to be
+" executed after it should be skipped on an error (exception) in the
+" command itself or in autocommands to be executed before the command.
+" In the latter case, the I/O command should not be executed either.
+" Example 1: BufWritePre, :write, BufWritePost
+" Example 2: FileReadPre, :read, FileReadPost.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+function! MSG(enr, emsg)
+ let english = v:lang == "C" || v:lang =~ '^[Ee]n'
+ if a:enr == ""
+ Xout "TODO: Add message number for:" a:emsg
+ let v:errmsg = ":" . v:errmsg
+ endif
+ let match = 1
+ if v:errmsg !~ '^'.a:enr.':' || (english && v:errmsg !~ a:emsg)
+ let match = 0
+ if v:errmsg == ""
+ Xout "Message missing."
+ else
+ let v:errmsg = escape(v:errmsg, '"')
+ Xout "Unexpected message:" v:errmsg
+ endif
+ endif
+ return match
+endfunction
+
+" Remove the autocommands for the events specified as arguments in all used
+" autogroups.
+function! Delete_autocommands(...)
+ let augfile = tempname()
+ while 1
+ try
+ exec "redir >" . augfile
+ aug
+ redir END
+ exec "edit" augfile
+ g/^$/d
+ norm G$
+ let wrap = "w"
+ while search('\%( \|^\)\@<=.\{-}\%( \)\@=', wrap) > 0
+ let wrap = "W"
+ exec "norm y/ \n"
+ let argno = 1
+ while argno <= a:0
+ exec "au!" escape(@", " ") a:{argno}
+ let argno = argno + 1
+ endwhile
+ endwhile
+ catch /.*/
+ finally
+ bwipeout!
+ call delete(augfile)
+ break " discard errors for $VIMNOERRTHROW
+ endtry
+ endwhile
+endfunction
+
+call Delete_autocommands("BufWritePre", "BufWritePost")
+
+while 1
+ try
+ try
+ let post = 0
+ aug TMP
+ au! BufWritePost * let post = 1
+ aug END
+ let caught = 0
+ write /n/o/n/e/x/i/s/t/e/n/t
+ catch /^Vim(write):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(write):', '', "")
+ finally
+ Xpath 1 " X: 1
+ if !caught && !$VIMNOERRTHROW
+ Xpath 2 " X: 0
+ endif
+ let v:errmsg = substitute(v:errmsg, '^"/n/o/n/e/x/i/s/t/e/n/t" ',
+ \ '', "")
+ if !MSG('E212', "Can't open file for writing")
+ Xpath 4 " X: 0
+ endif
+ if post
+ Xpath 8 " X: 0
+ Xout "BufWritePost commands executed after write error"
+ endif
+ au! TMP
+ aug! TMP
+ endtry
+ catch /.*/
+ Xpath 16 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ try
+ let post = 0
+ aug TMP
+ au! BufWritePre * asdf
+ au! BufWritePost * let post = 1
+ aug END
+ let tmpfile = tempname()
+ let caught = 0
+ exec "write" tmpfile
+ catch /^Vim\((write)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((write)\)\=:', '', "")
+ finally
+ Xpath 32 " X: 32
+ if !caught && !$VIMNOERRTHROW
+ Xpath 64 " X: 0
+ endif
+ let v:errmsg = substitute(v:errmsg, '^"'.tmpfile.'" ', '', "")
+ if !MSG('E492', "Not an editor command")
+ Xpath 128 " X: 0
+ endif
+ if filereadable(tmpfile)
+ Xpath 256 " X: 0
+ Xout ":write command not suppressed after BufWritePre error"
+ endif
+ if post
+ Xpath 512 " X: 0
+ Xout "BufWritePost commands executed after BufWritePre error"
+ endif
+ au! TMP
+ aug! TMP
+ endtry
+ catch /.*/
+ Xpath 1024 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+call delete(tmpfile)
+
+call Delete_autocommands("BufWritePre", "BufWritePost",
+ \ "BufReadPre", "BufReadPost", "FileReadPre", "FileReadPost")
+
+while 1
+ try
+ try
+ let post = 0
+ aug TMP
+ au! FileReadPost * let post = 1
+ aug END
+ let caught = 0
+ read /n/o/n/e/x/i/s/t/e/n/t
+ catch /^Vim(read):/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim(read):', '', "")
+ finally
+ Xpath 2048 " X: 2048
+ if !caught && !$VIMNOERRTHROW
+ Xpath 4096 " X: 0
+ endif
+ let v:errmsg = substitute(v:errmsg, ' /n/o/n/e/x/i/s/t/e/n/t$',
+ \ '', "")
+ if !MSG('E484', "Can't open file")
+ Xpath 8192 " X: 0
+ endif
+ if post
+ Xpath 16384 " X: 0
+ Xout "FileReadPost commands executed after write error"
+ endif
+ au! TMP
+ aug! TMP
+ endtry
+ catch /.*/
+ Xpath 32768 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+while 1
+ try
+ let infile = tempname()
+ let tmpfile = tempname()
+ exec "!echo XYZ >" . infile
+ exec "edit" tmpfile
+ try
+ Xpath 65536 " X: 65536
+ try
+ let post = 0
+ aug TMP
+ au! FileReadPre * asdf
+ au! FileReadPost * let post = 1
+ aug END
+ let caught = 0
+ exec "0read" infile
+ catch /^Vim\((read)\)\=:/
+ let caught = 1
+ let v:errmsg = substitute(v:exception, '^Vim\((read)\)\=:', '',
+ \ "")
+ finally
+ Xpath 131072 " X: 131072
+ if !caught && !$VIMNOERRTHROW
+ Xpath 262144 " X: 0
+ endif
+ let v:errmsg = substitute(v:errmsg, ' '.infile.'$', '', "")
+ if !MSG('E492', "Not an editor command")
+ Xpath 524288 " X: 0
+ endif
+ if getline("1") == "XYZ"
+ Xpath 1048576 " X: 0
+ Xout ":read command not suppressed after FileReadPre error"
+ endif
+ if post
+ Xpath 2097152 " X: 0
+ Xout "FileReadPost commands executed after " .
+ \ "FileReadPre error"
+ endif
+ au! TMP
+ aug! TMP
+ endtry
+ finally
+ bwipeout!
+ endtry
+ catch /.*/
+ Xpath 4194304 " X: 0
+ Xout v:exception "in" v:throwpoint
+ finally
+ break " discard error for $VIMNOERRTHROW
+ endtry
+endwhile
+
+call delete(infile)
+call delete(tmpfile)
+unlet! caught post infile tmpfile
+delfunction MSG
+delfunction Delete_autocommands
+
+Xcheck 198689
+
+
+"-------------------------------------------------------------------------------
+" Test 86: $VIMNOERRTHROW and $VIMNOINTTHROW support {{{1
+"
+" It is possible to configure Vim for throwing exceptions on error
+" or interrupt, controlled by variables $VIMNOERRTHROW and
+" $VIMNOINTTHROW. This is just for increasing the number of tests.
+" All tests here should run for all four combinations of setting
+" these variables to 0 or 1. The variables are intended for the
+" development phase only. In the final release, Vim should be
+" configured to always use error and interrupt exceptions.
+"
+" The test result is "OK",
+"
+" - if the $VIMNOERRTHROW and the $VIMNOINTTHROW control are not
+" configured and exceptions are thrown on error and on
+" interrupt.
+"
+" - if the $VIMNOERRTHROW or the $VIMNOINTTHROW control is
+" configured and works as intended.
+"
+" What actually happens, is shown in the test output.
+"
+" Otherwise, the test result is "FAIL", and the test output describes
+" the problem.
+"
+" IMPORTANT: This must be the last test because it sets $VIMNOERRTHROW and
+" $VIMNOINTTHROW.
+"-------------------------------------------------------------------------------
+
+XpathINIT
+
+if ExtraVim()
+
+ function! ThrowOnError()
+ XloopNEXT
+ let caught = 0
+ try
+ Xloop 1 " X: 1 + 8 + 64
+ asdf
+ catch /.*/
+ let caught = 1 " error exception caught
+ finally
+ Xloop 2 " X: 2 + 16 + 128
+ return caught " discard aborting error
+ endtry
+ Xloop 4 " X: 0
+ endfunction
+
+ let quits_skipped = 0
+
+ function! ThrowOnInterrupt()
+ XloopNEXT
+ let caught = 0
+ try
+ Xloop 1 " X: (1 + 8 + 64) * 512
+ "INTERRUPT3
+ let dummy = 0
+ let g:quits_skipped = g:quits_skipped + 1
+ catch /.*/
+ let caught = 1 " interrupt exception caught
+ finally
+ Xloop 2 " X: (2 + 16 + 128) * 512
+ return caught " discard interrupt
+ endtry
+ Xloop 4 " X: 0
+ endfunction
+
+ function! CheckThrow(Type)
+ execute 'return ThrowOn' . a:Type . '()'
+ endfunction
+
+ function! CheckConfiguration(type) " type is "error" or "interrupt"
+
+ let type = a:type
+ let Type = substitute(type, '.*', '\u&', "")
+ let VAR = '$VIMNO' . substitute(type, '\(...\).*', '\U\1', "") . 'THROW'
+
+ if type == "error"
+ XloopINIT! 1 8
+ elseif type == "interrupt"
+ XloopINIT! 512 8
+ endif
+
+ exec 'let requested_for_tests = exists(VAR) && ' . VAR . ' == 0'
+ exec 'let suppressed_for_tests = ' . VAR . ' != 0'
+ let used_in_tests = CheckThrow(Type)
+
+ exec 'let ' . VAR . ' = 0'
+ let request_works = CheckThrow(Type)
+
+ exec 'let ' . VAR . ' = 1'
+ let suppress_works = !CheckThrow(Type)
+
+ if type == "error"
+ XloopINIT! 262144 8
+ elseif type == "interrupt"
+ XloopINIT! 2097152 8
+
+ if g:quits_skipped != 0
+ Xloop 1 " X: 0*2097152
+ Xout "Test environment error. Interrupt breakpoints skipped: "
+ \ . g:quits_skipped . ".\n"
+ \ . "Cannot check whether interrupt exceptions are thrown."
+ return
+ endif
+ endif
+
+ let failure =
+ \ !suppressed_for_tests && !used_in_tests
+ \ || !request_works
+
+ let contradiction =
+ \ used_in_tests
+ \ ? suppressed_for_tests && !request_works
+ \ : !suppressed_for_tests
+
+ if failure
+ " Failure in configuration.
+ Xloop 2 " X: 0 * 2* (262144 + 2097152)
+ elseif contradiction
+ " Failure in test logic. Should not happen.
+ Xloop 4 " X: 0 * 4 * (262144 + 2097152)
+ endif
+
+ let var_control_configured =
+ \ request_works != used_in_tests
+ \ || suppress_works == used_in_tests
+
+ let var_control_not_configured =
+ \ requested_for_tests || suppressed_for_tests
+ \ ? request_works && !suppress_works
+ \ : request_works == used_in_tests
+ \ && suppress_works != used_in_tests
+
+ let with = used_in_tests ? "with" : "without"
+
+ let set = suppressed_for_tests ? "non-zero" :
+ \ requested_for_tests ? "0" : "unset"
+
+ let although = contradiction && !var_control_not_configured
+ \ ? ",\nalthough "
+ \ : ".\n"
+
+ let output = "All tests were run " . with . " throwing exceptions on "
+ \ . type . although
+
+ if !var_control_not_configured
+ let output = output . VAR . " was " . set . "."
+
+ if !request_works && !requested_for_tests
+ let output = output .
+ \ "\n" . Type . " exceptions are not thrown when " . VAR .
+ \ " is\nset to 0."
+ endif
+
+ if !suppress_works && (!used_in_tests ||
+ \ !request_works &&
+ \ !requested_for_tests && !suppressed_for_tests)
+ let output = output .
+ \ "\n" . Type . " exceptions are thrown when " . VAR .
+ \ " is set to 1."
+ endif
+
+ if !failure && var_control_configured
+ let output = output .
+ \ "\nRun tests also with " . substitute(VAR, '^\$', '', "")
+ \ . "=" . used_in_tests . "."
+ \ . "\nThis is for testing in the development phase only."
+ \ . " Remove the \n"
+ \ . VAR . " control in the final release."
+ endif
+ else
+ let output = output .
+ \ "The " . VAR . " control is not configured."
+ endif
+
+ Xout output
+ endfunction
+
+ call CheckConfiguration("error")
+ Xpath 16777216 " X: 16777216
+ call CheckConfiguration("interrupt")
+ Xpath 33554432 " X: 33554432
+endif
+
+Xcheck 50443995
+
+" IMPORTANT: No test should be added after this test because it changes
+" $VIMNOERRTHROW and $VIMNOINTTHROW.
+
+
+"-------------------------------------------------------------------------------
+" Modelines {{{1
+" vim: ts=8 sw=4 tw=80 fdm=marker
+" vim: fdt=substitute(substitute(foldtext(),\ '\\%(^+--\\)\\@<=\\(\\s*\\)\\(.\\{-}\\)\:\ \\%(\"\ \\)\\=\\(Test\ \\d*\\)\:\\s*',\ '\\3\ (\\2)\:\ \\1',\ \"\"),\ '\\(Test\\s*\\)\\(\\d\\)\\D\\@=',\ '\\1\ \\2',\ "")
+"-------------------------------------------------------------------------------
diff --git a/src/testdir/test5.in b/src/testdir/test5.in
new file mode 100644
index 000000000..e19e20d59
--- /dev/null
+++ b/src/testdir/test5.in
@@ -0,0 +1,29 @@
+Test for autocommand that deletes the current buffer on BufLeave event.
+Also test deleting the last buffer, should give a new, empty buffer.
+
+STARTTEST
+:so small.vim
+:au BufLeave Xxx bwipe
+/start of
+:.,/end of/w! Xxx " write test file Xxx
+:sp Xxx " split to Xxx
+:bwipe " delete buffer Xxx, now we're back here
+G?this is a
+othis is some more text
+: " Append some text to this file
+:?start?,$w! test.out " Write current file contents
+:bwipe test.out " delete alternate buffer
+:au bufleave test5.in bwipe
+:bwipe! " delete current buffer, get an empty one
+ithis is another test line:w >>test.out
+: " append an extra line to the output file
+:qa!
+ENDTEST
+
+start of test file Xxx
+vim: set noai :
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test5.ok b/src/testdir/test5.ok
new file mode 100644
index 000000000..674306079
--- /dev/null
+++ b/src/testdir/test5.ok
@@ -0,0 +1,9 @@
+start of test file Xxx
+vim: set noai :
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+this is some more text
+end of test file Xxx
+this is another test line
diff --git a/src/testdir/test50.in b/src/testdir/test50.in
new file mode 100644
index 000000000..d78ac8e8f
--- /dev/null
+++ b/src/testdir/test50.in
@@ -0,0 +1,85 @@
+Test for shortpathname ':8' extension.
+Only for use on Win32 systems!
+
+STARTTEST
+:so small.vim
+:fun! TestIt(file, bits, expected)
+ let res=fnamemodify(a:file,a:bits)
+ if a:expected == ''
+ echo "'".a:file."'->(".a:bits.")->'".res."'"
+ else
+ if substitute(res,'/','\\', 'g') != substitute( a:expected, '/','\\', 'g')
+ echo "FAILED: '".a:file."'->(".a:bits.")->'".res."'"
+ echo "Expected: '".a:expected."'"
+ else
+ echo "OK"
+ endif
+ endif
+endfun
+:fun! MakeDir( dirname )
+ "exe '!mkdir '.substitute(a:dirname,'/','\\','g')
+ call system('mkdir '.substitute(a:dirname,'/','\\','g'))
+endfun
+:fun! RMDir( dirname)
+ "exe '!rmdir '.substitute(a:dirname,'/','\\','g')
+ call system('rmdir '.substitute(a:dirname,'/','\\','g'))
+endfun
+:fun! MakeFile( filename)
+ "exe '!copy nul '.substitute(a:filename,'/','\\','g')
+ call system('copy nul '.substitute(a:filename,'/','\\','g'))
+endfun
+:fun! TestColonEight()
+ redir! >test.out
+ " This could change for CygWin to //cygdrive/c
+ let dir1='c:/x.x.y'
+ if filereadable(dir1) || isdirectory(dir1)
+ call confirm( "'".dir1."' exists, cannot run test" )
+ return
+ endif
+ let file1=dir1.'/zz.y.txt'
+ let nofile1=dir1.'/z.y.txt'
+ let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread'
+ let file2=dir2.'/z.txt'
+ let nofile2=dir2.'/zz.txt'
+ let resdir1='c:/XX2235~1.Y'
+ let resfile1=resdir1.'/ZZY~1.TXT'
+ let resnofile1=resdir1.'/z.y.txt'
+ let resdir2=resdir1.'/VIMIST~1'
+ let resfile2=resdir2.'/z.txt'
+ let resnofile2=resdir2.'/zz.txt'
+ call MakeDir( dir1 )
+ call MakeDir( dir2 )
+ call MakeFile( file1 )
+ call MakeFile( file2 )
+ call TestIt(file1, ':p:8', resfile1)
+ call TestIt(nofile1, ':p:8', resnofile1)
+ call TestIt(file2, ':p:8', resfile2)
+ call TestIt(nofile2, ':p:8', resnofile2)
+ call TestIt(nofile2, ':p:8:h', fnamemodify(resnofile2,':h'))
+ exe 'cd '.dir1
+ call TestIt(file1, ':.:8', strpart(resfile1,strlen(resdir1)+1))
+ call TestIt(nofile1, ':.:8', strpart(resnofile1,strlen(resdir1)+1))
+ call TestIt(file2, ':.:8', strpart(resfile2,strlen(resdir1)+1))
+ call TestIt(nofile2, ':.:8', strpart(resnofile2,strlen(resdir1)+1))
+ let $HOME=dir1
+ call TestIt(file1, ':~:8', '~'.strpart(resfile1,strlen(resdir1)))
+ call TestIt(nofile1, ':~:8', '~'.strpart(resnofile1,strlen(resdir1)))
+ call TestIt(file2, ':~:8', '~'.strpart(resfile2,strlen(resdir1)))
+ call TestIt(nofile2, ':~:8', '~'.strpart(resnofile2,strlen(resdir1)))
+ cd c:/
+ call delete( file2 )
+ call delete( file1 )
+ call RMDir( dir2 )
+ call RMDir( dir1 )
+ echo
+ redir END
+endfun
+:let dir = getcwd()
+:call TestColonEight()
+:exe "cd " . dir
+:edit! test.out
+:set ff=dos
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test50.ok b/src/testdir/test50.ok
new file mode 100644
index 000000000..91ef1d660
--- /dev/null
+++ b/src/testdir/test50.ok
@@ -0,0 +1,14 @@
+
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
diff --git a/src/testdir/test51.in b/src/testdir/test51.in
new file mode 100644
index 000000000..a158c8691
--- /dev/null
+++ b/src/testdir/test51.in
@@ -0,0 +1,34 @@
+Tests for ":highlight". vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:" basic test if ":highlight" doesn't crash
+:highlight
+:hi Search
+:" test setting colors.
+:" test clearing one color and all doesn't generate error or warning
+:hi NewGroup term=bold cterm=italic ctermfg=DarkBlue ctermbg=Grey gui= guifg=#00ff00 guibg=Cyan
+:hi Group2 term= cterm=
+:hi Group3 term=underline cterm=bold
+:redir >test.out
+:hi NewGroup
+:hi Group2
+:hi Group3
+:hi clear NewGroup
+:hi NewGroup
+:hi Group2
+:hi Group2 NONE
+:hi Group2
+:hi clear
+:hi Group3
+:hi Crash term='asdf
+:redir END
+:" filter ctermfg and ctermbg, the numbers depend on the terminal
+:e test.out
+:%s/ctermfg=\d*/ctermfg=2/
+:%s/ctermbg=\d*/ctermbg=3/
+:" filter out possibly translated error message
+:%s/E475: [^:]*:/E475:/
+:wq!
+ENDTEST
+
diff --git a/src/testdir/test51.ok b/src/testdir/test51.ok
new file mode 100644
index 000000000..fae83936c
--- /dev/null
+++ b/src/testdir/test51.ok
@@ -0,0 +1,15 @@
+
+
+NewGroup xxx term=bold cterm=italic ctermfg=2 ctermbg=3
+
+
+Group3 xxx term=underline cterm=bold
+
+
+
+
+
+
+
+
+E475: term='asdf
diff --git a/src/testdir/test52.in b/src/testdir/test52.in
new file mode 100644
index 000000000..206b65a1f
--- /dev/null
+++ b/src/testdir/test52.in
@@ -0,0 +1,65 @@
+Tests for reading and writing files with conversion for Win32.
+
+STARTTEST
+:so mbyte.vim
+:" make this a dummy test for non-Win32 systems
+:if !has("win32") | e! test.ok | wq! test.out | endif
+:"
+:" write tests:
+:" combine three values for 'encoding' with three values for 'fileencoding'
+:" also write files for read tests
+/^1
+:set encoding=utf-8
+:.w! ++enc=utf-8 test.out
+:.w ++enc=cp1251 >>test.out
+:.w ++enc=cp866 >>test.out
+:.w! ++enc=utf-8 Xutf8
+/^2
+:set encoding=cp1251
+:.w ++enc=utf-8 >>test.out
+:.w ++enc=cp1251 >>test.out
+:.w ++enc=cp866 >>test.out
+:.w! ++enc=cp1251 Xcp1251
+/^3
+:set encoding=cp866
+:.w ++enc=utf-8 >>test.out
+:.w ++enc=cp1251 >>test.out
+:.w ++enc=cp866 >>test.out
+:.w! ++enc=cp866 Xcp866
+:"
+:" read three 'fileencoding's with utf-8 'encoding'
+:set encoding=utf-8 fencs=utf-8,cp1251
+:e Xutf8
+:.w ++enc=utf-8 >>test.out
+:e Xcp1251
+:.w ++enc=utf-8 >>test.out
+:set fencs=utf-8,cp866
+:e Xcp866
+:.w ++enc=utf-8 >>test.out
+:"
+:" read three 'fileencoding's with cp1251 'encoding'
+:set encoding=utf-8 fencs=utf-8,cp1251
+:e Xutf8
+:.w ++enc=cp1251 >>test.out
+:e Xcp1251
+:.w ++enc=cp1251 >>test.out
+:set fencs=utf-8,cp866
+:e Xcp866
+:.w ++enc=cp1251 >>test.out
+:"
+:" read three 'fileencoding's with cp866 'encoding'
+:set encoding=cp866 fencs=utf-8,cp1251
+:e Xutf8
+:.w ++enc=cp866 >>test.out
+:e Xcp1251
+:.w ++enc=cp866 >>test.out
+:set fencs=utf-8,cp866
+:e Xcp866
+:.w ++enc=cp866 >>test.out
+:"
+:qa!
+ENDTEST
+
+1 utf-8 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
diff --git a/src/testdir/test52.ok b/src/testdir/test52.ok
new file mode 100644
index 000000000..90b516508
--- /dev/null
+++ b/src/testdir/test52.ok
@@ -0,0 +1,18 @@
+1 utf-8 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
+2 cp1251 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
+3 cp866 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
+1 utf-8 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+2 cp1251 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+3 cp866 text: Ð”Ð»Ñ Vim version 6.2. ПоÑледнее изменение: 1970 Jan 01
+1 utf-8 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+2 cp1251 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+3 cp866 text: Äëÿ Vim version 6.2. Ïîñëåäíåå èçìåíåíèå: 1970 Jan 01
+1 utf-8 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
+2 cp1251 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
+3 cp866 text: „«ï Vim version 6.2. ®á«¥¤­¥¥ ¨§¬¥­¥­¨¥: 1970 Jan 01
diff --git a/src/testdir/test6.in b/src/testdir/test6.in
new file mode 100644
index 000000000..1ebbe2fa5
--- /dev/null
+++ b/src/testdir/test6.in
@@ -0,0 +1,24 @@
+Test for autocommand that redefines the argument list, when doing ":all".
+
+STARTTEST
+:so small.vim
+:au BufReadPost Xxx2 next Xxx2 Xxx1
+/^start of
+A1:.,/end of/w! Xxx1 " write test file Xxx1
+$r2:.,/end of/w! Xxx2 " write test file Xxx2
+$r3:.,/end of/w! Xxx3 " write test file Xxx3
+:next! Xxx1 Xxx2 Xxx3 " redefine arglist; go to Xxx1
+:all " open window for all args
+:w! test.out " Write contents of Xxx1
+:w >>test.out " Append contents of last window (Xxx1)
+:rew " should now be in Xxx2
+:w >>test.out " Append contents of Xxx2
+:qa!
+ENDTEST
+
+start of test file Xxx
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test6.ok b/src/testdir/test6.ok
new file mode 100644
index 000000000..b6b0c93e4
--- /dev/null
+++ b/src/testdir/test6.ok
@@ -0,0 +1,18 @@
+start of test file Xxx1
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
+start of test file Xxx1
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
+start of test file Xxx2
+ this is a test
+ this is a test
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test7.in b/src/testdir/test7.in
new file mode 100644
index 000000000..b9cc0585f
--- /dev/null
+++ b/src/testdir/test7.in
@@ -0,0 +1,26 @@
+Test for autocommand that changes the buffer list, when doing ":ball".
+
+STARTTEST
+:so small.vim
+/^start of
+A1:.,/end of/w! Xxx1 " write test file Xxx1
+:sp Xxx1
+:close
+$r2:.,/end of/w! Xxx2 " write test file Xxx2
+:sp Xxx2
+:close
+$r3:.,/end of/w! Xxx3 " write test file Xxx3
+:sp Xxx3
+:close
+:au BufReadPost Xxx2 bwipe
+$r4:ball " open window for all args, close Xxx2
+:.,$w! test.out " Write contents of this file
+:w >>test.out " Append contents of second window (Xxx1)
+:/^start of/,$w >>test.out " Append contents of last window (this file)
+:qa!
+ENDTEST
+
+start of test file Xxx
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test7.ok b/src/testdir/test7.ok
new file mode 100644
index 000000000..a0d1ff94a
--- /dev/null
+++ b/src/testdir/test7.ok
@@ -0,0 +1,12 @@
+start of test file Xxx4
+ this is a test
+ this is a test
+end of test file Xxx
+start of test file Xxx1
+ this is a test
+ this is a test
+end of test file Xxx
+start of test file Xxx4
+ this is a test
+ this is a test
+end of test file Xxx
diff --git a/src/testdir/test8.in b/src/testdir/test8.in
new file mode 100644
index 000000000..6fe171546
--- /dev/null
+++ b/src/testdir/test8.in
@@ -0,0 +1,24 @@
+Test for BufWritePre autocommand that deletes or unloads the buffer.
+
+STARTTEST
+:so small.vim
+:au BufWritePre Xxx1 bunload
+:au BufWritePre Xxx2 bwipe
+/^start of
+A1:.,/end of/w! Xxx1 " write test file Xxx1
+$r2:.,/end of/w! Xxx2 " write test file Xxx2
+:e! Xxx2 " edit Xxx2
+:bdel test8.in " delete this file from the buffer list
+:e Xxx1 " edit Xxx1
+:w " write it, will unload it and give an error msg
+:w! test.out " Write contents of this file
+:e! Xxx2 " start editing Xxx2
+:bwipe test.out " remove test.out from the buffer list
+:w " write it, will delete the buffer and give an error msg
+:w >>test.out " Append contents of this file
+:qa!
+ENDTEST
+
+start of Xxx
+ test
+end of Xxx
diff --git a/src/testdir/test8.ok b/src/testdir/test8.ok
new file mode 100644
index 000000000..29b066a13
--- /dev/null
+++ b/src/testdir/test8.ok
@@ -0,0 +1,6 @@
+start of Xxx2
+ test
+end of Xxx
+start of Xxx1
+ test
+end of Xxx
diff --git a/src/testdir/test9.in b/src/testdir/test9.in
new file mode 100644
index 000000000..84e17943c
--- /dev/null
+++ b/src/testdir/test9.in
@@ -0,0 +1,12 @@
+Test for Bufleave autocommand that deletes the buffer we are about to edit.
+
+STARTTEST
+:so small.vim
+:au BufLeave test9.in bwipe yy
+:e yy
+:/^start of/,$w! test.out " Write contents of this file
+:qa!
+ENDTEST
+
+start of test file xx
+end of test file xx
diff --git a/src/testdir/test9.ok b/src/testdir/test9.ok
new file mode 100644
index 000000000..cccb5f3ef
--- /dev/null
+++ b/src/testdir/test9.ok
@@ -0,0 +1,2 @@
+start of test file xx
+end of test file xx
diff --git a/src/testdir/todos.vim b/src/testdir/todos.vim
new file mode 100644
index 000000000..0256a51c8
--- /dev/null
+++ b/src/testdir/todos.vim
@@ -0,0 +1,3 @@
+:" Script to make sure a file is in "dos" file format.
+:set ff=dos
+:wq
diff --git a/src/testdir/unix.vim b/src/testdir/unix.vim
new file mode 100644
index 000000000..f766e74c3
--- /dev/null
+++ b/src/testdir/unix.vim
@@ -0,0 +1,3 @@
+" Settings for test script execution
+" Always use "sh", don't use the value of "$SHELL".
+set shell=sh
diff --git a/src/testdir/vms.vim b/src/testdir/vms.vim
new file mode 100644
index 000000000..3305a77c2
--- /dev/null
+++ b/src/testdir/vms.vim
@@ -0,0 +1,4 @@
+" Settings for test script execution under OpenVMS
+
+" Do not make any swap files
+set noswapfile
diff --git a/src/toolbar.phi b/src/toolbar.phi
new file mode 100644
index 000000000..cf9043ce2
--- /dev/null
+++ b/src/toolbar.phi
@@ -0,0 +1,1283 @@
+/* Builtin icons for the toolbar in photon */
+
+static PgColor_t tb_palette[] = {
+ PgRGB(0,0,0),
+ PgRGB(128,0,0),
+ PgRGB(128,128,0),
+ PgRGB(128,128,128),
+ PgRGB(192,192,192),
+ PgRGB(255,0,0),
+ PgRGB(255,255,0),
+ PgRGB(255,255,255),
+};
+
+static uint8_t tb_close_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x14,0x44,0x44,0x44,0x14,0x44,0x44,
+ 0x44,0x41,0x51,0x00,0x00,0x01,0x51,0x04,0x44,
+ 0x44,0x15,0x55,0x14,0x44,0x15,0x55,0x13,0x44,
+ 0x44,0x41,0x55,0x51,0x41,0x55,0x51,0x03,0x44,
+ 0x44,0x40,0x15,0x55,0x15,0x55,0x17,0x03,0x44,
+ 0x44,0x40,0x41,0x55,0x55,0x51,0x47,0x03,0x44,
+ 0x44,0x40,0x44,0x15,0x55,0x14,0x47,0x03,0x44,
+ 0x44,0x40,0x41,0x55,0x55,0x51,0x47,0x03,0x44,
+ 0x44,0x40,0x15,0x55,0x15,0x55,0x17,0x03,0x44,
+ 0x44,0x41,0x55,0x51,0x41,0x55,0x51,0x03,0x44,
+ 0x44,0x15,0x55,0x14,0x44,0x15,0x55,0x13,0x44,
+ 0x44,0x41,0x51,0x44,0x44,0x41,0x55,0x51,0x44,
+ 0x44,0x40,0x14,0x44,0x44,0x44,0x15,0x13,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x41,0x03,0x44,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_close_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_close_data
+};
+
+static uint8_t tb_copy_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x40,0x00,0x00,0x00,0x00,0x04,0x44,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x77,0x03,0x44,0x44,0x44,
+ 0x40,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x40,0x77,0x77,0x07,0x77,0x77,0x77,0x70,0x44,
+ 0x40,0x70,0x00,0x07,0x00,0x00,0x00,0x70,0x34,
+ 0x40,0x77,0x77,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x40,0x70,0x00,0x07,0x00,0x00,0x00,0x70,0x34,
+ 0x40,0x77,0x77,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x40,0x70,0x07,0x07,0x00,0x00,0x00,0x70,0x34,
+ 0x40,0x77,0x77,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x40,0x00,0x00,0x07,0x00,0x77,0x77,0x70,0x34,
+ 0x44,0x33,0x33,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x44,0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x34,
+ 0x44,0x44,0x44,0x44,0x33,0x33,0x33,0x33,0x34,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_copy_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_copy_data
+};
+
+static uint8_t tb_ctags_data[] = {
+ 0x44,0x44,0x40,0x04,0x00,0x00,0x04,0x44,0x44,
+ 0x44,0x44,0x07,0x70,0x77,0x77,0x70,0x44,0x44,
+ 0x44,0x44,0x07,0x77,0x77,0x77,0x77,0x04,0x44,
+ 0x44,0x44,0x07,0x70,0x77,0x77,0x00,0x70,0x44,
+ 0x44,0x44,0x40,0x04,0x00,0x00,0x34,0x00,0x44,
+ 0x44,0x42,0x24,0x42,0x40,0x00,0x42,0x40,0x44,
+ 0x44,0x23,0x66,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x42,0x36,0x66,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x23,0x64,0x34,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x26,0x63,0x03,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x36,0x64,0x34,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x30,0x66,0x66,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x43,0x06,0x66,0x66,0x60,0x00,0x36,0x66,0x03,
+ 0x44,0x30,0x00,0x00,0x00,0x00,0x30,0x00,0x03,
+ 0x44,0x43,0x33,0x33,0x30,0x00,0x33,0x33,0x33,
+ 0x44,0x44,0x44,0x44,0x40,0x00,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x40,0x00,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x33,0x34,0x44,0x44,
+};
+
+static PhImage_t tb_ctags_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_ctags_data
+};
+
+static uint8_t tb_cut_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x44,0x44,0x40,0x34,0x44,0x44,
+ 0x44,0x44,0x40,0x34,0x44,0x40,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x04,0x44,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x03,0x44,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x40,0x34,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x30,0x34,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x00,0x34,0x44,0x44,0x44,
+ 0x44,0x44,0x43,0x03,0x44,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x00,0x03,0x44,0x00,0x04,0x44,0x44,
+ 0x44,0x40,0x33,0x03,0x44,0x03,0x40,0x44,0x44,
+ 0x44,0x40,0x44,0x03,0x44,0x03,0x40,0x34,0x44,
+ 0x44,0x40,0x44,0x03,0x44,0x03,0x40,0x34,0x44,
+ 0x44,0x44,0x00,0x33,0x44,0x40,0x03,0x44,0x44,
+ 0x44,0x44,0x33,0x44,0x44,0x43,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_cut_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_cut_data
+};
+
+static uint8_t tb_find_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x40,0x00,0x00,0x00,0x00,0x44,0x44,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x70,0x04,0x44,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x70,0x40,0x44,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x70,0x00,0x04,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x04,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x70,0x00,0x04,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x04,0x44,0x40,0x44,0x44,
+ 0x40,0x77,0x77,0x70,0x47,0x74,0x44,0x04,0x44,
+ 0x40,0x77,0x77,0x70,0x47,0x44,0x44,0x04,0x44,
+ 0x40,0x77,0x77,0x70,0x44,0x44,0x44,0x04,0x44,
+ 0x40,0x77,0x77,0x70,0x44,0x47,0x44,0x04,0x44,
+ 0x40,0x77,0x77,0x77,0x04,0x44,0x40,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x70,0x00,0x04,0x00,0x44,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x04,0x00,0x04,
+ 0x40,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x04,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_find_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_find_data
+};
+
+static uint8_t tb_find_help_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x00,0x00,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x40,0x04,0x43,0x00,0x34,0x44,0x44,0x44,
+ 0x44,0x00,0x34,0x44,0x00,0x04,0x44,0x44,0x44,
+ 0x44,0x00,0x34,0x44,0x00,0x00,0x44,0x44,0x44,
+ 0x44,0x30,0x04,0x40,0x47,0x74,0x04,0x44,0x44,
+ 0x44,0x44,0x44,0x04,0x44,0x74,0x40,0x44,0x44,
+ 0x44,0x44,0x44,0x07,0x77,0x74,0x70,0x44,0x44,
+ 0x44,0x44,0x40,0x04,0x77,0x44,0x40,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x47,0x74,0x03,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x00,0x30,0x04,0x44,
+ 0x44,0x44,0x40,0x03,0x44,0x44,0x40,0x00,0x44,
+ 0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x00,0x44,
+ 0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x33,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_find_help_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_find_help_data
+};
+
+static uint8_t tb_find_next_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x00,0x00,0x00,0x04,0x44,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x00,0x44,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x04,0x04,0x44,0x44,
+ 0x44,0x07,0x17,0x77,0x77,0x00,0x00,0x44,0x44,
+ 0x44,0x77,0x11,0x77,0x77,0x77,0x70,0x44,0x44,
+ 0x11,0x11,0x15,0x17,0x77,0x00,0x00,0x44,0x44,
+ 0x15,0x55,0x55,0x51,0x70,0x44,0x44,0x04,0x44,
+ 0x15,0x55,0x55,0x55,0x14,0x77,0x44,0x40,0x44,
+ 0x15,0x55,0x55,0x51,0x04,0x74,0x44,0x40,0x44,
+ 0x11,0x11,0x15,0x17,0x04,0x44,0x44,0x40,0x44,
+ 0x44,0x77,0x11,0x77,0x04,0x44,0x74,0x40,0x44,
+ 0x44,0x07,0x17,0x77,0x70,0x44,0x44,0x04,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x00,0x00,0x40,0x04,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x70,0x40,0x00,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x00,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_find_next_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_find_next_data
+};
+
+static uint8_t tb_find_prev_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x00,0x00,0x00,0x04,0x44,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x00,0x44,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x04,0x04,0x44,0x44,
+ 0x44,0x47,0x17,0x77,0x77,0x00,0x00,0x44,0x44,
+ 0x44,0x71,0x17,0x77,0x77,0x77,0x70,0x44,0x44,
+ 0x44,0x15,0x11,0x11,0x17,0x00,0x00,0x44,0x44,
+ 0x41,0x55,0x55,0x55,0x10,0x44,0x44,0x04,0x44,
+ 0x15,0x55,0x55,0x55,0x04,0x77,0x44,0x40,0x44,
+ 0x41,0x55,0x55,0x55,0x04,0x74,0x44,0x40,0x44,
+ 0x44,0x15,0x11,0x11,0x04,0x44,0x44,0x40,0x44,
+ 0x44,0x71,0x17,0x77,0x04,0x44,0x74,0x40,0x44,
+ 0x44,0x47,0x17,0x77,0x70,0x44,0x44,0x04,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x00,0x00,0x40,0x04,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x70,0x40,0x00,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x00,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_find_prev_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_find_prev_data
+};
+
+static uint8_t tb_help_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x00,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x04,0x43,0x00,0x34,0x44,0x44,
+ 0x44,0x44,0x00,0x34,0x44,0x00,0x04,0x44,0x44,
+ 0x44,0x44,0x00,0x34,0x44,0x00,0x04,0x44,0x44,
+ 0x44,0x44,0x30,0x04,0x43,0x00,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x33,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_help_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_help_data
+};
+
+static uint8_t tb_jump_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x42,0x22,0x22,0x22,0x22,0x22,0x22,0x24,
+ 0x44,0x23,0x66,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x42,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x23,0x64,0x34,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x26,0x63,0x03,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x36,0x64,0x34,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x30,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x43,0x06,0x66,0x66,0x66,0x66,0x66,0x66,0x03,
+ 0x44,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0x44,0x43,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_jump_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_jump_data
+};
+
+static uint8_t tb_load_session_data[] = {
+ 0x44,0x44,0x44,0x44,0x11,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x15,0x55,0x51,0x44,0x44,0x44,
+ 0x44,0x44,0x41,0x11,0x55,0x11,0x14,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x11,0x14,0x44,0x44,0x44,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x74,0x43,0x04,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x77,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x55,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x44,0x33,0x04,
+ 0x40,0x70,0x00,0x00,0x00,0x00,0x04,0x33,0x03,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x74,0x33,0x03,
+ 0x40,0x43,0x33,0x33,0x33,0x33,0x33,0x30,0x34,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x34,0x44,
+};
+
+static PhImage_t tb_load_session_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_load_session_data
+};
+
+static uint8_t tb_macro_data[] = {
+ 0x44,0x44,0x43,0x00,0x34,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x30,0x77,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x07,0x77,0x70,0x34,0x44,0x44,0x44,
+ 0x44,0x43,0x07,0x77,0x70,0x34,0x44,0x44,0x44,
+ 0x44,0x44,0x30,0x77,0x03,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x00,0x34,0x44,0x44,0x44,
+ 0x44,0x40,0x00,0x00,0x70,0x34,0x44,0x44,0x44,
+ 0x44,0x30,0x77,0x77,0x77,0x04,0x44,0x44,0x44,
+ 0x44,0x00,0x77,0x77,0x77,0x00,0x44,0x44,0x44,
+ 0x44,0x43,0x00,0x00,0x77,0x30,0x44,0x44,0x44,
+ 0x44,0x44,0x30,0x00,0x77,0x70,0x34,0x44,0x44,
+ 0x44,0x44,0x00,0x77,0x77,0x70,0x04,0x44,0x44,
+ 0x44,0x43,0x07,0x77,0x77,0x77,0x00,0x44,0x44,
+ 0x44,0x40,0x77,0x70,0x00,0x77,0x70,0x04,0x44,
+ 0x44,0x07,0x77,0x03,0x40,0x07,0x77,0x70,0x44,
+ 0x44,0x07,0x70,0x34,0x44,0x30,0x77,0x70,0x44,
+ 0x44,0x30,0x00,0x44,0x44,0x43,0x00,0x03,0x44,
+ 0x44,0x43,0x34,0x44,0x44,0x44,0x43,0x04,0x44,
+};
+
+static PhImage_t tb_macro_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_macro_data
+};
+
+static uint8_t tb_make_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x00,0x40,0x00,0x00,0x44,0x44,0x44,
+ 0x44,0x40,0x77,0x07,0x77,0x77,0x04,0x44,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x70,0x44,0x44,
+ 0x44,0x40,0x73,0x07,0x77,0x70,0x07,0x04,0x44,
+ 0x44,0x44,0x00,0x40,0x00,0x03,0x40,0x04,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x04,0x44,0x04,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x00,0x03,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x43,0x33,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_make_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_make_data
+};
+
+static uint8_t tb_maximize_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x70,0x00,0x00,0x00,0x00,0x00,0x44,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x44,0x44,
+ 0x44,0x70,0x44,0x74,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x47,0x74,0x04,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x40,0x00,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x00,0x00,0x04,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x00,0x00,0x04,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x40,0x00,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x04,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x77,0x77,0x77,0x77,0x70,0x34,0x44,
+ 0x44,0x70,0x00,0x00,0x00,0x00,0x00,0x34,0x44,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_maximize_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_maximize_data
+};
+
+static uint8_t tb_maxwidth_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
+ 0x70,0x44,0x44,0x44,0x44,0x44,0x44,0x47,0x04,
+ 0x70,0x44,0x74,0x40,0x44,0x04,0x44,0x47,0x03,
+ 0x70,0x47,0x74,0x00,0x44,0x00,0x44,0x47,0x03,
+ 0x70,0x44,0x40,0x00,0x44,0x00,0x04,0x47,0x03,
+ 0x70,0x44,0x44,0x00,0x44,0x00,0x44,0x47,0x03,
+ 0x70,0x44,0x44,0x40,0x44,0x04,0x44,0x47,0x03,
+ 0x70,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x03,
+ 0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0x44,0x43,0x33,0x33,0x33,0x33,0x33,0x33,0x33,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_maxwidth_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_maxwidth_data
+};
+
+static uint8_t tb_minimize_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x00,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x00,0x04,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x44,
+ 0x47,0x04,0x44,0x44,0x44,0x44,0x47,0x04,0x44,
+ 0x47,0x04,0x47,0x44,0x44,0x44,0x47,0x03,0x44,
+ 0x47,0x04,0x44,0x44,0x44,0x44,0x47,0x03,0x44,
+ 0x47,0x04,0x44,0x44,0x44,0x44,0x77,0x03,0x44,
+ 0x47,0x07,0x77,0x77,0x77,0x77,0x77,0x03,0x44,
+ 0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x33,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x40,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x00,0x04,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x00,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_minimize_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_minimize_data
+};
+
+static uint8_t tb_minwidth_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x47,0x00,0x00,0x00,0x44,0x44,0x44,
+ 0x44,0x44,0x47,0x04,0x44,0x70,0x44,0x44,0x44,
+ 0x40,0x44,0x47,0x04,0x74,0x70,0x34,0x44,0x04,
+ 0x40,0x04,0x47,0x04,0x44,0x70,0x34,0x40,0x04,
+ 0x40,0x00,0x47,0x04,0x44,0x70,0x34,0x00,0x04,
+ 0x40,0x04,0x47,0x04,0x44,0x70,0x34,0x40,0x04,
+ 0x40,0x44,0x47,0x04,0x44,0x70,0x34,0x44,0x04,
+ 0x44,0x44,0x47,0x07,0x77,0x70,0x34,0x44,0x44,
+ 0x44,0x44,0x47,0x00,0x00,0x00,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x33,0x33,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_minwidth_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_minwidth_data
+};
+
+static uint8_t tb_new_data[] = {
+ 0x44,0x44,0x44,0x44,0x43,0x44,0x37,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x47,0x34,0x37,0x34,0x73,
+ 0x44,0x44,0x44,0x44,0x44,0x73,0x07,0x07,0x37,
+ 0x40,0x00,0x00,0x00,0x00,0x07,0x77,0x70,0x33,
+ 0x40,0x44,0x44,0x44,0x44,0x77,0x77,0x77,0x77,
+ 0x40,0x44,0x74,0x44,0x44,0x07,0x07,0x70,0x33,
+ 0x40,0x47,0x74,0x44,0x43,0x47,0x07,0x07,0x44,
+ 0x40,0x44,0x44,0x44,0x34,0x47,0x07,0x33,0x74,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x07,0x34,0x37,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x43,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x44,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x44,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x44,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x44,
+ 0x40,0x44,0x44,0x44,0x44,0x47,0x03,0x44,0x44,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x03,0x44,0x44,
+ 0x40,0x00,0x00,0x00,0x00,0x00,0x03,0x44,0x44,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x44,0x44,
+};
+
+static PhImage_t tb_new_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_new_data
+};
+
+static uint8_t tb_new_session_data[] = {
+ 0x44,0x44,0x34,0x43,0x73,0x44,0x34,0x44,0x44,
+ 0x44,0x44,0x43,0x40,0x70,0x43,0x44,0x44,0x44,
+ 0x44,0x44,0x33,0x07,0x77,0x03,0x34,0x44,0x44,
+ 0x44,0x44,0x77,0x77,0x77,0x77,0x74,0x44,0x44,
+ 0x44,0x44,0x33,0x07,0x77,0x03,0x34,0x44,0x44,
+ 0x44,0x44,0x43,0x40,0x70,0x43,0x44,0x44,0x44,
+ 0x44,0x44,0x34,0x43,0x73,0x44,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x34,0x44,0x44,0x44,0x44,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x74,0x43,0x04,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x77,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x55,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x44,0x33,0x04,
+ 0x40,0x70,0x00,0x00,0x00,0x00,0x04,0x33,0x03,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x74,0x33,0x03,
+ 0x40,0x43,0x33,0x33,0x33,0x33,0x33,0x30,0x34,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x34,0x44,
+};
+
+static PhImage_t tb_new_session_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_new_session_data
+};
+
+static uint8_t tb_open_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x00,0x00,0x00,0x00,0x03,0x44,0x44,
+ 0x44,0x44,0x07,0x77,0x77,0x70,0x70,0x34,0x44,
+ 0x44,0x44,0x07,0x77,0x77,0x70,0x77,0x03,0x44,
+ 0x44,0x44,0x07,0x77,0x77,0x70,0x00,0x03,0x44,
+ 0x44,0x00,0x07,0x77,0x77,0x77,0x77,0x00,0x04,
+ 0x44,0x04,0x04,0x44,0x44,0x44,0x47,0x04,0x04,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x03,0x03,
+ 0x07,0x77,0x77,0x77,0x77,0x77,0x70,0x03,0x03,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x43,0x03,0x03,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x44,0x03,0x03,
+ 0x44,0x07,0x44,0x44,0x44,0x44,0x44,0x30,0x03,
+ 0x44,0x07,0x44,0x44,0x44,0x44,0x44,0x40,0x03,
+ 0x44,0x40,0x73,0x33,0x33,0x33,0x33,0x33,0x03,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x33,0x33,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_open_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_open_data
+};
+
+static uint8_t tb_paste_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x04,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x04,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x04,0x44,0x40,0x00,0x34,0x44,0x44,
+ 0x40,0x43,0x00,0x00,0x00,0x33,0x03,0x44,0x44,
+ 0x40,0x43,0x33,0x33,0x33,0x33,0x03,0x44,0x44,
+ 0x40,0x43,0x34,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x40,0x43,0x34,0x07,0x77,0x77,0x77,0x70,0x44,
+ 0x40,0x43,0x34,0x07,0x00,0x00,0x00,0x70,0x34,
+ 0x40,0x43,0x34,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x40,0x43,0x34,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x40,0x43,0x34,0x07,0x00,0x00,0x00,0x70,0x34,
+ 0x40,0x43,0x34,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x44,0x00,0x00,0x07,0x00,0x77,0x77,0x70,0x34,
+ 0x44,0x43,0x33,0x07,0x77,0x77,0x77,0x70,0x34,
+ 0x44,0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x34,
+ 0x44,0x44,0x44,0x44,0x33,0x33,0x33,0x33,0x34,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_paste_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_paste_data
+};
+
+static uint8_t tb_print_data[] = {
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x04,0x44,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x04,0x44,0x44,
+ 0x44,0x40,0x70,0x00,0x77,0x77,0x03,0x44,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x03,0x44,0x44,
+ 0x44,0x40,0x70,0x00,0x77,0x77,0x03,0x44,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x03,0x44,0x44,
+ 0x44,0x40,0x70,0x00,0x00,0x77,0x03,0x44,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x03,0x44,0x44,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x07,0x77,0x77,0x77,0x77,0x77,0x77,0x30,0x44,
+ 0x07,0x55,0x44,0x44,0x44,0x44,0x44,0x30,0x34,
+ 0x07,0x44,0x44,0x44,0x44,0x44,0x44,0x30,0x34,
+ 0x07,0x44,0x44,0x44,0x44,0x44,0x44,0x30,0x34,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
+ 0x40,0x44,0x44,0x44,0x44,0x44,0x44,0x03,0x34,
+ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x43,0x33,0x33,0x33,0x33,0x33,0x33,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_print_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_print_data
+};
+
+static uint8_t tb_redo_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x00,0x00,0x04,0x40,0x04,0x44,
+ 0x44,0x44,0x00,0x77,0x77,0x70,0x07,0x03,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x77,0x03,0x44,
+ 0x44,0x40,0x77,0x00,0x00,0x77,0x77,0x03,0x44,
+ 0x44,0x07,0x70,0x33,0x30,0x77,0x77,0x03,0x44,
+ 0x44,0x07,0x70,0x34,0x07,0x77,0x77,0x03,0x44,
+ 0x44,0x07,0x70,0x34,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x07,0x70,0x34,0x43,0x33,0x03,0x33,0x44,
+ 0x44,0x07,0x70,0x34,0x44,0x40,0x70,0x44,0x44,
+ 0x44,0x40,0x77,0x00,0x00,0x07,0x70,0x34,0x44,
+ 0x44,0x40,0x77,0x77,0x77,0x77,0x03,0x34,0x44,
+ 0x44,0x44,0x00,0x77,0x77,0x70,0x33,0x44,0x44,
+ 0x44,0x44,0x44,0x00,0x00,0x03,0x34,0x44,0x44,
+ 0x44,0x44,0x44,0x43,0x33,0x33,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_redo_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_redo_data
+};
+
+static uint8_t tb_replace_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x00,0x00,0x00,0x04,0x44,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x00,0x44,0x44,0x44,
+ 0x44,0x07,0x00,0x77,0x77,0x07,0x04,0x44,0x44,
+ 0x44,0x34,0x00,0x37,0x77,0x00,0x00,0x44,0x44,
+ 0x44,0x40,0x70,0x07,0x77,0x77,0x70,0x44,0x44,
+ 0x44,0x30,0x00,0x03,0x77,0x77,0x70,0x34,0x44,
+ 0x44,0x07,0x77,0x00,0x77,0x77,0x70,0x34,0x44,
+ 0x40,0x03,0x73,0x00,0x07,0x77,0x40,0x34,0x44,
+ 0x44,0x47,0x77,0x77,0x77,0x77,0x74,0x34,0x44,
+ 0x44,0x07,0x55,0x44,0x57,0x77,0x00,0x00,0x44,
+ 0x44,0x07,0x35,0x44,0x55,0x77,0x03,0x70,0x04,
+ 0x44,0x07,0x73,0x55,0x55,0x57,0x00,0x00,0x44,
+ 0x44,0x07,0x77,0x77,0x55,0x77,0x03,0x70,0x04,
+ 0x44,0x07,0x77,0x77,0x57,0x77,0x03,0x70,0x04,
+ 0x44,0x00,0x00,0x00,0x40,0x04,0x00,0x00,0x44,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_replace_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_replace_data
+};
+
+static uint8_t tb_save_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x40,0x44,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x00,0x34,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x40,0x34,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x40,0x34,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x40,0x34,
+ 0x44,0x04,0x07,0x77,0x77,0x77,0x70,0x40,0x34,
+ 0x44,0x04,0x40,0x00,0x00,0x00,0x04,0x40,0x34,
+ 0x44,0x04,0x44,0x44,0x44,0x44,0x44,0x40,0x34,
+ 0x44,0x04,0x40,0x00,0x00,0x00,0x00,0x40,0x34,
+ 0x44,0x04,0x40,0x00,0x00,0x04,0x40,0x40,0x34,
+ 0x44,0x04,0x40,0x00,0x00,0x04,0x40,0x40,0x34,
+ 0x44,0x04,0x40,0x00,0x00,0x04,0x40,0x40,0x34,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x33,0x34,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_save_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_save_data
+};
+
+static uint8_t tb_save_all_data[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x44,
+ 0x04,0x07,0x77,0x77,0x77,0x70,0x70,0x44,0x44,
+ 0x04,0x07,0x77,0x77,0x77,0x70,0x00,0x34,0x44,
+ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
+ 0x04,0x00,0x40,0x77,0x77,0x77,0x77,0x07,0x04,
+ 0x04,0x00,0x40,0x77,0x77,0x77,0x77,0x00,0x03,
+ 0x04,0x00,0x40,0x77,0x77,0x77,0x77,0x04,0x03,
+ 0x04,0x40,0x40,0x77,0x77,0x77,0x77,0x04,0x03,
+ 0x04,0x40,0x40,0x77,0x77,0x77,0x77,0x04,0x03,
+ 0x04,0x40,0x40,0x77,0x77,0x77,0x77,0x04,0x03,
+ 0x04,0x40,0x44,0x00,0x00,0x00,0x00,0x44,0x03,
+ 0x04,0x40,0x44,0x44,0x44,0x44,0x44,0x44,0x03,
+ 0x04,0x40,0x44,0x00,0x00,0x00,0x00,0x04,0x03,
+ 0x40,0x00,0x44,0x00,0x00,0x00,0x77,0x04,0x03,
+ 0x44,0x30,0x44,0x00,0x00,0x00,0x77,0x04,0x03,
+ 0x44,0x40,0x44,0x00,0x00,0x00,0x77,0x04,0x03,
+ 0x44,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x33,0x34,
+};
+
+static PhImage_t tb_save_all_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_save_all_data
+};
+
+static uint8_t tb_save_session_data[] = {
+ 0x44,0x44,0x44,0x41,0x11,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x41,0x11,0x55,0x11,0x14,0x44,0x44,
+ 0x44,0x44,0x44,0x15,0x55,0x51,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x41,0x55,0x14,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x11,0x44,0x44,0x44,0x44,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x74,0x43,0x04,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x77,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x55,0x33,0x04,
+ 0x40,0x74,0x44,0x44,0x44,0x44,0x44,0x33,0x04,
+ 0x40,0x70,0x00,0x00,0x00,0x00,0x04,0x33,0x03,
+ 0x40,0x77,0x77,0x77,0x77,0x77,0x74,0x33,0x03,
+ 0x40,0x43,0x33,0x33,0x33,0x33,0x33,0x30,0x34,
+ 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x44,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x34,0x44,
+};
+
+static PhImage_t tb_save_session_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_save_session_data
+};
+
+static uint8_t tb_shell_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x40,0x00,0x40,0x00,0x44,0x44,0x44,
+ 0x44,0x44,0x03,0x43,0x33,0x43,0x04,0x44,0x44,
+ 0x44,0x40,0x47,0x43,0x03,0x47,0x40,0x44,0x44,
+ 0x44,0x40,0x34,0x74,0x34,0x74,0x30,0x44,0x44,
+ 0x44,0x03,0x44,0x44,0x04,0x44,0x43,0x04,0x44,
+ 0x40,0x34,0x03,0x74,0x34,0x73,0x04,0x30,0x44,
+ 0x40,0x44,0x43,0x74,0x04,0x73,0x44,0x40,0x44,
+ 0x40,0x47,0x40,0x37,0x37,0x30,0x47,0x40,0x34,
+ 0x40,0x34,0x74,0x04,0x04,0x04,0x74,0x30,0x34,
+ 0x44,0x03,0x74,0x34,0x44,0x34,0x73,0x03,0x44,
+ 0x44,0x40,0x34,0x44,0x74,0x44,0x30,0x34,0x44,
+ 0x44,0x44,0x04,0x47,0x77,0x44,0x03,0x44,0x44,
+ 0x44,0x44,0x00,0x34,0x44,0x30,0x03,0x44,0x44,
+ 0x44,0x40,0x34,0x44,0x44,0x44,0x30,0x34,0x44,
+ 0x44,0x40,0x00,0x00,0x00,0x00,0x00,0x34,0x44,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_shell_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_shell_data
+};
+
+static uint8_t tb_split_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x70,0x00,0x00,0x00,0x00,0x00,0x44,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x44,0x44,
+ 0x44,0x70,0x44,0x74,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x47,0x74,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x77,0x77,0x77,0x77,0x70,0x34,0x44,
+ 0x44,0x70,0x00,0x00,0x00,0x00,0x00,0x34,0x44,
+ 0x44,0x70,0x33,0x33,0x33,0x33,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x74,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x47,0x74,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x44,0x44,0x44,0x44,0x70,0x34,0x44,
+ 0x44,0x70,0x77,0x77,0x77,0x77,0x70,0x34,0x44,
+ 0x44,0x70,0x00,0x00,0x00,0x00,0x00,0x34,0x44,
+ 0x44,0x44,0x43,0x33,0x33,0x33,0x33,0x34,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_split_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_split_data
+};
+
+static uint8_t tb_undo_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x00,0x44,0x00,0x00,0x04,0x44,0x44,0x44,
+ 0x44,0x07,0x00,0x77,0x77,0x70,0x04,0x44,0x44,
+ 0x44,0x07,0x77,0x77,0x77,0x77,0x70,0x44,0x44,
+ 0x44,0x07,0x77,0x70,0x00,0x07,0x70,0x34,0x44,
+ 0x44,0x07,0x77,0x70,0x33,0x30,0x77,0x04,0x44,
+ 0x44,0x07,0x77,0x77,0x04,0x40,0x77,0x03,0x44,
+ 0x44,0x00,0x00,0x00,0x03,0x40,0x77,0x03,0x44,
+ 0x44,0x43,0x03,0x33,0x33,0x40,0x77,0x03,0x44,
+ 0x44,0x40,0x70,0x44,0x44,0x40,0x77,0x03,0x44,
+ 0x44,0x40,0x77,0x00,0x00,0x07,0x70,0x33,0x44,
+ 0x44,0x44,0x07,0x77,0x77,0x77,0x70,0x34,0x44,
+ 0x44,0x44,0x40,0x77,0x77,0x70,0x03,0x34,0x44,
+ 0x44,0x44,0x44,0x00,0x00,0x03,0x33,0x44,0x44,
+ 0x44,0x44,0x44,0x43,0x33,0x33,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_undo_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_undo_data
+};
+
+static uint8_t tb_vsplit_data[] = {
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+ 0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x44,
+ 0x47,0x04,0x47,0x47,0x03,0x44,0x74,0x70,0x34,
+ 0x47,0x04,0x77,0x47,0x03,0x47,0x74,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x04,0x44,0x47,0x03,0x44,0x44,0x70,0x34,
+ 0x47,0x07,0x77,0x77,0x07,0x77,0x77,0x70,0x34,
+ 0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,
+ 0x44,0x44,0x33,0x33,0x33,0x33,0x33,0x33,0x34,
+ 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
+};
+
+static PhImage_t tb_vsplit_phi = {
+ Pg_IMAGE_PALETTE_NIBBLE,
+ 0,
+ 9,
+ { 18,18 },
+ 420393992,
+ 8,
+ NULL,
+ PgGrey(0xc0),
+ 0,
+ Ph_USE_TRANSPARENCY,
+ 0,
+ 0,
+ NULL,
+ 0,
+ NULL,
+ tb_palette,
+ tb_vsplit_data
+};
diff --git a/src/toolcheck b/src/toolcheck
new file mode 100755
index 000000000..b05118a56
--- /dev/null
+++ b/src/toolcheck
@@ -0,0 +1,36 @@
+#!/bin/sh
+# toolcheck -- check for tools that have severe bugs. Good that all the buggy
+# tools identify by version numbers. This is the spirit of GNU :-)
+#
+# 24.7.95 jw.
+
+retval=0
+reply="`sh -version -c exit 2>&1 < /dev/null`"
+case "$reply" in
+ GNU*1.14.3*)
+ echo "- sh is '$reply'";
+ echo " CAUTION: This shell has a buggy 'trap' command.";
+ echo " The configure script may fail silently.";
+ retval=1;
+ ;;
+ GNU*)
+ echo "- sh is '$reply' - probably OK.";
+ ;;
+ *) ;;
+esac
+
+reply="`sed --version 2>&1 < /dev/null`"
+case "$reply" in
+ GNU\ sed\ version\ 2.0[34])
+ echo "- sed is '$reply'";
+ echo " CAUTION: This sed cannot configure screen properly."
+ retval=1;
+ ;;
+ GNU\ sed\ version\ 2.05|GNU\ sed\ version\ 2.03\ kevin)
+ echo "- sed is '$reply' - good.";
+ ;;
+ GNU*) echo "- sed is '$reply'.";
+ ;;
+ *) ;;
+esac
+exit $retval
diff --git a/src/tools.bmp b/src/tools.bmp
new file mode 100644
index 000000000..9a520cdce
--- /dev/null
+++ b/src/tools.bmp
Binary files differ
diff --git a/src/tools16.bmp b/src/tools16.bmp
new file mode 100644
index 000000000..d4fbc511e
--- /dev/null
+++ b/src/tools16.bmp
Binary files differ
diff --git a/src/typemap b/src/typemap
new file mode 100644
index 000000000..40049237b
--- /dev/null
+++ b/src/typemap
@@ -0,0 +1,14 @@
+TYPEMAP
+VIWIN T_VIOBJNOMUNGE
+VIBUF T_VIOBJNOMUNGE
+
+INPUT
+T_VIOBJNOMUNGE
+ if (sv_isa($arg, \"${ntype}\")) {
+ IV tmp = SvIV((SV*)SvRV($arg));
+ $var = ($type) tmp;
+ if (!tmp)
+ croak(\"$ntype no longer exists\");
+ }
+ else
+ croak(\"$var is not of type ${ntype}\")
diff --git a/src/ui.c b/src/ui.c
new file mode 100644
index 000000000..ebbf85dbb
--- /dev/null
+++ b/src/ui.c
@@ -0,0 +1,3060 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * ui.c: functions that handle the user interface.
+ * 1. Keyboard input stuff, and a bit of windowing stuff. These are called
+ * before the machine specific stuff (mch_*) so that we can call the GUI
+ * stuff instead if the GUI is running.
+ * 2. Clipboard stuff.
+ * 3. Input buffer stuff.
+ */
+
+#include "vim.h"
+
+ void
+ui_write(s, len)
+ char_u *s;
+ int len;
+{
+#ifdef FEAT_GUI
+ if (gui.in_use && !gui.dying && !gui.starting)
+ {
+ gui_write(s, len);
+ if (p_wd)
+ gui_wait_for_chars(p_wd);
+ return;
+ }
+#endif
+#ifndef NO_CONSOLE
+ /* Don't output anything in silent mode ("ex -s") unless 'verbose' set */
+ if (!(silent_mode && p_verbose == 0))
+ {
+#ifdef FEAT_MBYTE
+ char_u *tofree = NULL;
+
+ if (output_conv.vc_type != CONV_NONE)
+ {
+ /* Convert characters from 'encoding' to 'termencoding'. */
+ tofree = string_convert(&output_conv, s, &len);
+ if (tofree != NULL)
+ s = tofree;
+ }
+#endif
+
+ mch_write(s, len);
+
+#ifdef FEAT_MBYTE
+ if (output_conv.vc_type != CONV_NONE)
+ vim_free(tofree);
+#endif
+ }
+#endif
+}
+
+#if (defined(FEAT_GUI) && (defined(UNIX) || defined(VMS))) \
+ || defined(MACOS_X_UNIX) || defined(PROTO)
+/*
+ * When executing an external program, there may be some typed characters that
+ * are not consumed by it. Give them back to ui_inchar() and they are stored
+ * here for the next call.
+ */
+static char_u *ta_str = NULL;
+static int ta_off; /* offset for next char to use when ta_str != NULL */
+static int ta_len; /* length of ta_str when it's not NULL*/
+
+ void
+ui_inchar_undo(s, len)
+ char_u *s;
+ int len;
+{
+ char_u *new;
+ int newlen;
+
+ newlen = len;
+ if (ta_str != NULL)
+ newlen += ta_len - ta_off;
+ new = alloc(newlen);
+ if (new != NULL)
+ {
+ if (ta_str != NULL)
+ {
+ mch_memmove(new, ta_str + ta_off, (size_t)(ta_len - ta_off));
+ mch_memmove(new + ta_len - ta_off, s, (size_t)len);
+ vim_free(ta_str);
+ }
+ else
+ mch_memmove(new, s, (size_t)len);
+ ta_str = new;
+ ta_len = newlen;
+ ta_off = 0;
+ }
+}
+#endif
+
+/*
+ * ui_inchar(): low level input funcion.
+ * Get characters from the keyboard.
+ * Return the number of characters that are available.
+ * If "wtime" == 0 do not wait for characters.
+ * If "wtime" == -1 wait forever for characters.
+ * If "wtime" > 0 wait "wtime" milliseconds for a character.
+ *
+ * "tb_change_cnt" is the value of typebuf.tb_change_cnt if "buf" points into
+ * it. When typebuf.tb_change_cnt changes (e.g., when a message is received
+ * from a remote client) "buf" can no longer be used. "tb_change_cnt" is NULL
+ * otherwise.
+ */
+ int
+ui_inchar(buf, maxlen, wtime, tb_change_cnt)
+ char_u *buf;
+ int maxlen;
+ long wtime; /* don't use "time", MIPS cannot handle it */
+ int tb_change_cnt;
+{
+ int retval = 0;
+
+#if defined(FEAT_GUI) && (defined(UNIX) || defined(VMS))
+ /*
+ * Use the typeahead if there is any.
+ */
+ if (ta_str != NULL)
+ {
+ if (maxlen >= ta_len - ta_off)
+ {
+ mch_memmove(buf, ta_str + ta_off, (size_t)ta_len);
+ vim_free(ta_str);
+ ta_str = NULL;
+ return ta_len;
+ }
+ mch_memmove(buf, ta_str + ta_off, (size_t)maxlen);
+ ta_off += maxlen;
+ return maxlen;
+ }
+#endif
+
+#ifdef NO_CONSOLE_INPUT
+ /* Don't wait for character input when the window hasn't been opened yet.
+ * Do try reading, this works when redirecting stdin from a file.
+ * Must return something, otherwise we'll loop forever. If we run into
+ * this very often we probably got stuck, exit Vim. */
+ if (no_console_input())
+ {
+ static int count = 0;
+
+# ifndef NO_CONSOLE
+ retval = mch_inchar(buf, maxlen, 10L, tb_change_cnt);
+ if (retval > 0 || typebuf_changed(tb_change_cnt))
+ return retval;
+# endif
+ if (wtime == -1 && ++count == 1000)
+ read_error_exit();
+ buf[0] = CAR;
+ return 1;
+ }
+#endif
+
+ /* When doing a blocking wait there is no need for CTRL-C to interrupt
+ * something, don't let it set got_int when it was mapped. */
+ if (mapped_ctrl_c && (wtime == -1 || wtime > 100L))
+ ctrl_c_interrupts = FALSE;
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ if (gui_wait_for_chars(wtime) && !typebuf_changed(tb_change_cnt))
+ retval = read_from_input_buf(buf, (long)maxlen);
+ }
+#endif
+#ifndef NO_CONSOLE
+# ifdef FEAT_GUI
+ else
+# endif
+ retval = mch_inchar(buf, maxlen, wtime, tb_change_cnt);
+#endif
+
+ ctrl_c_interrupts = TRUE;
+
+ return retval;
+}
+
+/*
+ * return non-zero if a character is available
+ */
+ int
+ui_char_avail()
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_mch_update();
+ return input_available();
+ }
+#endif
+#ifndef NO_CONSOLE
+# ifdef NO_CONSOLE_INPUT
+ if (no_console_input())
+ return 0;
+# endif
+ return mch_char_avail();
+#else
+ return 0;
+#endif
+}
+
+/*
+ * Delay for the given number of milliseconds. If ignoreinput is FALSE then we
+ * cancel the delay if a key is hit.
+ */
+ void
+ui_delay(msec, ignoreinput)
+ long msec;
+ int ignoreinput;
+{
+#ifdef FEAT_GUI
+ if (gui.in_use && !ignoreinput)
+ gui_wait_for_chars(msec);
+ else
+#endif
+ mch_delay(msec, ignoreinput);
+}
+
+/*
+ * If the machine has job control, use it to suspend the program,
+ * otherwise fake it by starting a new shell.
+ * When running the GUI iconify the window.
+ */
+ void
+ui_suspend()
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_mch_iconify();
+ return;
+ }
+#endif
+ mch_suspend();
+}
+
+#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__)
+/*
+ * When the OS can't really suspend, call this function to start a shell.
+ * This is never called in the GUI.
+ */
+ void
+suspend_shell()
+{
+ if (*p_sh == NUL)
+ EMSG(_(e_shellempty));
+ else
+ {
+ MSG_PUTS(_("new shell started\n"));
+ do_shell(NULL, 0);
+ }
+}
+#endif
+
+/*
+ * Try to get the current Vim shell size. Put the result in Rows and Columns.
+ * Use the new sizes as defaults for 'columns' and 'lines'.
+ * Return OK when size could be determined, FAIL otherwise.
+ */
+ int
+ui_get_shellsize()
+{
+ int retval;
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ retval = gui_get_shellsize();
+ else
+#endif
+ retval = mch_get_shellsize();
+
+ check_shellsize();
+
+ /* adjust the default for 'lines' and 'columns' */
+ if (retval == OK)
+ {
+ set_number_default("lines", Rows);
+ set_number_default("columns", Columns);
+ }
+ return retval;
+}
+
+/*
+ * Set the size of the Vim shell according to Rows and Columns, if possible.
+ * The gui_set_shellsize() or mch_set_shellsize() function will try to set the
+ * new size. If this is not possible, it will adjust Rows and Columns.
+ */
+/*ARGSUSED*/
+ void
+ui_set_shellsize(mustset)
+ int mustset; /* set by the user */
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_set_shellsize(mustset,
+# ifdef WIN3264
+ TRUE
+# else
+ FALSE
+# endif
+ );
+ else
+#endif
+ mch_set_shellsize();
+}
+
+/*
+ * Called when Rows and/or Columns changed. Adjust scroll region and mouse
+ * region.
+ */
+ void
+ui_new_shellsize()
+{
+ if (full_screen && !exiting)
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_new_shellsize();
+ else
+#endif
+ mch_new_shellsize();
+ }
+}
+
+ void
+ui_breakcheck()
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_mch_update();
+ else
+#endif
+ mch_breakcheck();
+}
+
+/*****************************************************************************
+ * Functions for copying and pasting text between applications.
+ * This is always included in a GUI version, but may also be included when the
+ * clipboard and mouse is available to a terminal version such as xterm.
+ * Note: there are some more functions in ops.c that handle selection stuff.
+ *
+ * Also note that the majority of functions here deal with the X 'primary'
+ * (visible - for Visual mode use) selection, and only that. There are no
+ * versions of these for the 'clipboard' selection, as Visual mode has no use
+ * for them.
+ */
+
+#if defined(FEAT_CLIPBOARD) || defined(PROTO)
+
+/*
+ * Selection stuff using Visual mode, for cutting and pasting text to other
+ * windows.
+ */
+
+/*
+ * Call this to initialise the clipboard. Pass it FALSE if the clipboard code
+ * is included, but the clipboard can not be used, or TRUE if the clipboard can
+ * be used. Eg unix may call this with FALSE, then call it again with TRUE if
+ * the GUI starts.
+ */
+ void
+clip_init(can_use)
+ int can_use;
+{
+ VimClipboard *cb;
+
+ cb = &clip_star;
+ for (;;)
+ {
+ cb->available = can_use;
+ cb->owned = FALSE;
+ cb->start.lnum = 0;
+ cb->start.col = 0;
+ cb->end.lnum = 0;
+ cb->end.col = 0;
+ cb->state = SELECT_CLEARED;
+
+ if (cb == &clip_plus)
+ break;
+ cb = &clip_plus;
+ }
+}
+
+/*
+ * Check whether the VIsual area has changed, and if so try to become the owner
+ * of the selection, and free any old converted selection we may still have
+ * lying around. If the VIsual mode has ended, make a copy of what was
+ * selected so we can still give it to others. Will probably have to make sure
+ * this is called whenever VIsual mode is ended.
+ */
+ void
+clip_update_selection()
+{
+ pos_T start, end;
+
+ /* If visual mode is only due to a redo command ("."), then ignore it */
+ if (!redo_VIsual_busy && VIsual_active && (State & NORMAL))
+ {
+ if (lt(VIsual, curwin->w_cursor))
+ {
+ start = VIsual;
+ end = curwin->w_cursor;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ end.col += (*mb_ptr2len_check)(ml_get_cursor()) - 1;
+#endif
+ }
+ else
+ {
+ start = curwin->w_cursor;
+ end = VIsual;
+ }
+ if (!equalpos(clip_star.start, start)
+ || !equalpos(clip_star.end, end)
+ || clip_star.vmode != VIsual_mode)
+ {
+ clip_clear_selection();
+ clip_star.start = start;
+ clip_star.end = end;
+ clip_star.vmode = VIsual_mode;
+ clip_free_selection(&clip_star);
+ clip_own_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+ }
+}
+
+ void
+clip_own_selection(cbd)
+ VimClipboard *cbd;
+{
+ /*
+ * Also want to check somehow that we are reading from the keyboard rather
+ * than a mapping etc.
+ */
+ if (!cbd->owned && cbd->available)
+ {
+ cbd->owned = (clip_gen_own_selection(cbd) == OK);
+#ifdef FEAT_X11
+ if (cbd == &clip_star)
+ {
+ /* May have to show a different kind of highlighting for the selected
+ * area. There is no specific redraw command for this, just redraw
+ * all windows on the current buffer. */
+ if (cbd->owned
+ && get_real_state() == VISUAL
+ && clip_isautosel()
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ redraw_curbuf_later(INVERTED_ALL);
+ }
+#endif
+ }
+}
+
+ void
+clip_lose_selection(cbd)
+ VimClipboard *cbd;
+{
+#ifdef FEAT_X11
+ int was_owned = cbd->owned;
+#endif
+ int visual_selection = (cbd == &clip_star);
+
+ clip_free_selection(cbd);
+ cbd->owned = FALSE;
+ if (visual_selection)
+ clip_clear_selection();
+ clip_gen_lose_selection(cbd);
+#ifdef FEAT_X11
+ if (visual_selection)
+ {
+ /* May have to show a different kind of highlighting for the selected
+ * area. There is no specific redraw command for this, just redraw all
+ * windows on the current buffer. */
+ if (was_owned
+ && get_real_state() == VISUAL
+ && clip_isautosel()
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ {
+ update_curbuf(INVERTED_ALL);
+ setcursor();
+ cursor_on();
+ out_flush();
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_update_cursor(TRUE, FALSE);
+# endif
+ }
+ }
+#endif
+}
+
+ void
+clip_copy_selection()
+{
+ if (VIsual_active && (State & NORMAL) && clip_star.available)
+ {
+ if (clip_isautosel())
+ clip_update_selection();
+ clip_free_selection(&clip_star);
+ clip_own_selection(&clip_star);
+ if (clip_star.owned)
+ clip_get_selection(&clip_star);
+ clip_gen_set_selection(&clip_star);
+ }
+}
+
+/*
+ * Called when Visual mode is ended: update the selection.
+ */
+ void
+clip_auto_select()
+{
+ if (clip_isautosel())
+ clip_copy_selection();
+}
+
+/*
+ * Return TRUE if automatic selection of Visual area is desired.
+ */
+ int
+clip_isautosel()
+{
+ return (
+#ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) :
+#endif
+ clip_autoselect);
+}
+
+
+/*
+ * Stuff for general mouse selection, without using Visual mode.
+ */
+
+static int clip_compare_pos __ARGS((int row1, int col1, int row2, int col2));
+static void clip_invert_area __ARGS((int, int, int, int, int how));
+static void clip_invert_rectangle __ARGS((int row, int col, int height, int width, int invert));
+static void clip_get_word_boundaries __ARGS((VimClipboard *, int, int));
+static int clip_get_line_end __ARGS((int));
+static void clip_update_modeless_selection __ARGS((VimClipboard *, int, int,
+ int, int));
+
+/* flags for clip_invert_area() */
+#define CLIP_CLEAR 1
+#define CLIP_SET 2
+#define CLIP_TOGGLE 3
+
+/*
+ * Start, continue or end a modeless selection. Used when editing the
+ * command-line and in the cmdline window.
+ */
+ void
+clip_modeless(button, is_click, is_drag)
+ int button;
+ int is_click;
+ int is_drag;
+{
+ int repeat;
+
+ repeat = ((clip_star.mode == SELECT_MODE_CHAR
+ || clip_star.mode == SELECT_MODE_LINE)
+ && (mod_mask & MOD_MASK_2CLICK))
+ || (clip_star.mode == SELECT_MODE_WORD
+ && (mod_mask & MOD_MASK_3CLICK));
+ if (is_click && button == MOUSE_RIGHT)
+ {
+ /* Right mouse button: If there was no selection, start one.
+ * Otherwise extend the existing selection. */
+ if (clip_star.state == SELECT_CLEARED)
+ clip_start_selection(mouse_col, mouse_row, FALSE);
+ clip_process_selection(button, mouse_col, mouse_row, repeat);
+ }
+ else if (is_click)
+ clip_start_selection(mouse_col, mouse_row, repeat);
+ else if (is_drag)
+ {
+ /* Don't try extending a selection if there isn't one. Happens when
+ * button-down is in the cmdline and them moving mouse upwards. */
+ if (clip_star.state != SELECT_CLEARED)
+ clip_process_selection(button, mouse_col, mouse_row, repeat);
+ }
+ else /* release */
+ clip_process_selection(MOUSE_RELEASE, mouse_col, mouse_row, FALSE);
+}
+
+/*
+ * Compare two screen positions ala strcmp()
+ */
+ static int
+clip_compare_pos(row1, col1, row2, col2)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+{
+ if (row1 > row2) return(1);
+ if (row1 < row2) return(-1);
+ if (col1 > col2) return(1);
+ if (col1 < col2) return(-1);
+ return(0);
+}
+
+/*
+ * Start the selection
+ */
+ void
+clip_start_selection(col, row, repeated_click)
+ int col;
+ int row;
+ int repeated_click;
+{
+ VimClipboard *cb = &clip_star;
+
+ if (cb->state == SELECT_DONE)
+ clip_clear_selection();
+
+ row = check_row(row);
+ col = check_col(col);
+#ifdef FEAT_MBYTE
+ col = mb_fix_col(col, row);
+#endif
+
+ cb->start.lnum = row;
+ cb->start.col = col;
+ cb->end = cb->start;
+ cb->origin_row = (short_u)cb->start.lnum;
+ cb->state = SELECT_IN_PROGRESS;
+
+ if (repeated_click)
+ {
+ if (++cb->mode > SELECT_MODE_LINE)
+ cb->mode = SELECT_MODE_CHAR;
+ }
+ else
+ cb->mode = SELECT_MODE_CHAR;
+
+#ifdef FEAT_GUI
+ /* clear the cursor until the selection is made */
+ if (gui.in_use)
+ gui_undraw_cursor();
+#endif
+
+ switch (cb->mode)
+ {
+ case SELECT_MODE_CHAR:
+ cb->origin_start_col = cb->start.col;
+ cb->word_end_col = clip_get_line_end((int)cb->start.lnum);
+ break;
+
+ case SELECT_MODE_WORD:
+ clip_get_word_boundaries(cb, (int)cb->start.lnum, cb->start.col);
+ cb->origin_start_col = cb->word_start_col;
+ cb->origin_end_col = cb->word_end_col;
+
+ clip_invert_area((int)cb->start.lnum, cb->word_start_col,
+ (int)cb->end.lnum, cb->word_end_col, CLIP_SET);
+ cb->start.col = cb->word_start_col;
+ cb->end.col = cb->word_end_col;
+ break;
+
+ case SELECT_MODE_LINE:
+ clip_invert_area((int)cb->start.lnum, 0, (int)cb->start.lnum,
+ (int)Columns, CLIP_SET);
+ cb->start.col = 0;
+ cb->end.col = Columns;
+ break;
+ }
+
+ cb->prev = cb->start;
+
+#ifdef DEBUG_SELECTION
+ printf("Selection started at (%u,%u)\n", cb->start.lnum, cb->start.col);
+#endif
+}
+
+/*
+ * Continue processing the selection
+ */
+ void
+clip_process_selection(button, col, row, repeated_click)
+ int button;
+ int col;
+ int row;
+ int_u repeated_click;
+{
+ VimClipboard *cb = &clip_star;
+ int diff;
+ int slen = 1; /* cursor shape width */
+
+ if (button == MOUSE_RELEASE)
+ {
+ /* Check to make sure we have something selected */
+ if (cb->start.lnum == cb->end.lnum && cb->start.col == cb->end.col)
+ {
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_update_cursor(FALSE, FALSE);
+#endif
+ cb->state = SELECT_CLEARED;
+ return;
+ }
+
+#ifdef DEBUG_SELECTION
+ printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+ cb->start.col, cb->end.lnum, cb->end.col);
+#endif
+ if (clip_isautosel()
+ || (
+#ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) :
+#endif
+ clip_autoselectml))
+ clip_copy_modeless_selection(FALSE);
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_update_cursor(FALSE, FALSE);
+#endif
+
+ cb->state = SELECT_DONE;
+ return;
+ }
+
+ row = check_row(row);
+ col = check_col(col);
+#ifdef FEAT_MBYTE
+ col = mb_fix_col(col, row);
+#endif
+
+ if (col == (int)cb->prev.col && row == cb->prev.lnum && !repeated_click)
+ return;
+
+ /*
+ * When extending the selection with the right mouse button, swap the
+ * start and end if the position is before half the selection
+ */
+ if (cb->state == SELECT_DONE && button == MOUSE_RIGHT)
+ {
+ /*
+ * If the click is before the start, or the click is inside the
+ * selection and the start is the closest side, set the origin to the
+ * end of the selection.
+ */
+ if (clip_compare_pos(row, col, (int)cb->start.lnum, cb->start.col) < 0
+ || (clip_compare_pos(row, col,
+ (int)cb->end.lnum, cb->end.col) < 0
+ && (((cb->start.lnum == cb->end.lnum
+ && cb->end.col - col > col - cb->start.col))
+ || ((diff = (cb->end.lnum - row) -
+ (row - cb->start.lnum)) > 0
+ || (diff == 0 && col < (int)(cb->start.col +
+ cb->end.col) / 2)))))
+ {
+ cb->origin_row = (short_u)cb->end.lnum;
+ cb->origin_start_col = cb->end.col - 1;
+ cb->origin_end_col = cb->end.col;
+ }
+ else
+ {
+ cb->origin_row = (short_u)cb->start.lnum;
+ cb->origin_start_col = cb->start.col;
+ cb->origin_end_col = cb->start.col;
+ }
+ if (cb->mode == SELECT_MODE_WORD && !repeated_click)
+ cb->mode = SELECT_MODE_CHAR;
+ }
+
+ /* set state, for when using the right mouse button */
+ cb->state = SELECT_IN_PROGRESS;
+
+#ifdef DEBUG_SELECTION
+ printf("Selection extending to (%d,%d)\n", row, col);
+#endif
+
+ if (repeated_click && ++cb->mode > SELECT_MODE_LINE)
+ cb->mode = SELECT_MODE_CHAR;
+
+ switch (cb->mode)
+ {
+ case SELECT_MODE_CHAR:
+ /* If we're on a different line, find where the line ends */
+ if (row != cb->prev.lnum)
+ cb->word_end_col = clip_get_line_end(row);
+
+ /* See if we are before or after the origin of the selection */
+ if (clip_compare_pos(row, col, cb->origin_row,
+ cb->origin_start_col) >= 0)
+ {
+ if (col >= (int)cb->word_end_col)
+ clip_update_modeless_selection(cb, cb->origin_row,
+ cb->origin_start_col, row, (int)Columns);
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && mb_lefthalve(row, col))
+ slen = 2;
+#endif
+ clip_update_modeless_selection(cb, cb->origin_row,
+ cb->origin_start_col, row, col + slen);
+ }
+ }
+ else
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte
+ && mb_lefthalve(cb->origin_row, cb->origin_start_col))
+ slen = 2;
+#endif
+ if (col >= (int)cb->word_end_col)
+ clip_update_modeless_selection(cb, row, cb->word_end_col,
+ cb->origin_row, cb->origin_start_col + slen);
+ else
+ clip_update_modeless_selection(cb, row, col,
+ cb->origin_row, cb->origin_start_col + slen);
+ }
+ break;
+
+ case SELECT_MODE_WORD:
+ /* If we are still within the same word, do nothing */
+ if (row == cb->prev.lnum && col >= (int)cb->word_start_col
+ && col < (int)cb->word_end_col && !repeated_click)
+ return;
+
+ /* Get new word boundaries */
+ clip_get_word_boundaries(cb, row, col);
+
+ /* Handle being after the origin point of selection */
+ if (clip_compare_pos(row, col, cb->origin_row,
+ cb->origin_start_col) >= 0)
+ clip_update_modeless_selection(cb, cb->origin_row,
+ cb->origin_start_col, row, cb->word_end_col);
+ else
+ clip_update_modeless_selection(cb, row, cb->word_start_col,
+ cb->origin_row, cb->origin_end_col);
+ break;
+
+ case SELECT_MODE_LINE:
+ if (row == cb->prev.lnum && !repeated_click)
+ return;
+
+ if (clip_compare_pos(row, col, cb->origin_row,
+ cb->origin_start_col) >= 0)
+ clip_update_modeless_selection(cb, cb->origin_row, 0, row,
+ (int)Columns);
+ else
+ clip_update_modeless_selection(cb, row, 0, cb->origin_row,
+ (int)Columns);
+ break;
+ }
+
+ cb->prev.lnum = row;
+ cb->prev.col = col;
+
+#ifdef DEBUG_SELECTION
+ printf("Selection is: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+ cb->start.col, cb->end.lnum, cb->end.col);
+#endif
+}
+
+#if 0 /* not used */
+/*
+ * Called after an Expose event to redraw the selection
+ */
+ void
+clip_redraw_selection(x, y, w, h)
+ int x;
+ int y;
+ int w;
+ int h;
+{
+ VimClipboard *cb = &clip_star;
+ int row1, col1, row2, col2;
+ int row;
+ int start;
+ int end;
+
+ if (cb->state == SELECT_CLEARED)
+ return;
+
+ row1 = check_row(Y_2_ROW(y));
+ col1 = check_col(X_2_COL(x));
+ row2 = check_row(Y_2_ROW(y + h - 1));
+ col2 = check_col(X_2_COL(x + w - 1));
+
+ /* Limit the rows that need to be re-drawn */
+ if (cb->start.lnum > row1)
+ row1 = cb->start.lnum;
+ if (cb->end.lnum < row2)
+ row2 = cb->end.lnum;
+
+ /* Look at each row that might need to be re-drawn */
+ for (row = row1; row <= row2; row++)
+ {
+ /* For the first selection row, use the starting selection column */
+ if (row == cb->start.lnum)
+ start = cb->start.col;
+ else
+ start = 0;
+
+ /* For the last selection row, use the ending selection column */
+ if (row == cb->end.lnum)
+ end = cb->end.col;
+ else
+ end = Columns;
+
+ if (col1 > start)
+ start = col1;
+
+ if (col2 < end)
+ end = col2 + 1;
+
+ if (end > start)
+ gui_mch_invert_rectangle(row, start, 1, end - start);
+ }
+}
+#endif
+
+# if defined(FEAT_GUI) || defined(PROTO)
+/*
+ * Redraw part of the selection if character at "row,col" is inside of it.
+ * Only used for the GUI.
+ */
+ void
+clip_may_redraw_selection(row, col, len)
+ int row, col;
+ int len;
+{
+ int start = col;
+ int end = col + len;
+
+ if (clip_star.state != SELECT_CLEARED
+ && row >= clip_star.start.lnum
+ && row <= clip_star.end.lnum)
+ {
+ if (row == clip_star.start.lnum && start < (int)clip_star.start.col)
+ start = clip_star.start.col;
+ if (row == clip_star.end.lnum && end > (int)clip_star.end.col)
+ end = clip_star.end.col;
+ if (end > start)
+ clip_invert_area(row, start, row, end, 0);
+ }
+}
+# endif
+
+/*
+ * Called from outside to clear selected region from the display
+ */
+ void
+clip_clear_selection()
+{
+ VimClipboard *cb = &clip_star;
+
+ if (cb->state == SELECT_CLEARED)
+ return;
+
+ clip_invert_area((int)cb->start.lnum, cb->start.col, (int)cb->end.lnum,
+ cb->end.col, CLIP_CLEAR);
+ cb->state = SELECT_CLEARED;
+}
+
+/*
+ * Clear the selection if any lines from "row1" to "row2" are inside of it.
+ */
+ void
+clip_may_clear_selection(row1, row2)
+ int row1, row2;
+{
+ if (clip_star.state == SELECT_DONE
+ && row2 >= clip_star.start.lnum
+ && row1 <= clip_star.end.lnum)
+ clip_clear_selection();
+}
+
+/*
+ * Called before the screen is scrolled up or down. Adjusts the line numbers
+ * of the selection. Call with big number when clearing the screen.
+ */
+ void
+clip_scroll_selection(rows)
+ int rows; /* negative for scroll down */
+{
+ int lnum;
+
+ if (clip_star.state == SELECT_CLEARED)
+ return;
+
+ lnum = clip_star.start.lnum - rows;
+ if (lnum <= 0)
+ clip_star.start.lnum = 0;
+ else if (lnum >= screen_Rows) /* scrolled off of the screen */
+ clip_star.state = SELECT_CLEARED;
+ else
+ clip_star.start.lnum = lnum;
+
+ lnum = clip_star.end.lnum - rows;
+ if (lnum < 0) /* scrolled off of the screen */
+ clip_star.state = SELECT_CLEARED;
+ else if (lnum >= screen_Rows)
+ clip_star.end.lnum = screen_Rows - 1;
+ else
+ clip_star.end.lnum = lnum;
+}
+
+/*
+ * Invert a region of the display between a starting and ending row and column
+ * Values for "how":
+ * CLIP_CLEAR: undo inversion
+ * CLIP_SET: set inversion
+ * CLIP_TOGGLE: set inversion if pos1 < pos2, undo inversion otherwise.
+ * 0: invert (GUI only).
+ */
+ static void
+clip_invert_area(row1, col1, row2, col2, how)
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+ int how;
+{
+ int invert = FALSE;
+
+ if (how == CLIP_SET)
+ invert = TRUE;
+
+ /* Swap the from and to positions so the from is always before */
+ if (clip_compare_pos(row1, col1, row2, col2) > 0)
+ {
+ int tmp_row, tmp_col;
+
+ tmp_row = row1;
+ tmp_col = col1;
+ row1 = row2;
+ col1 = col2;
+ row2 = tmp_row;
+ col2 = tmp_col;
+ }
+ else if (how == CLIP_TOGGLE)
+ invert = TRUE;
+
+ /* If all on the same line, do it the easy way */
+ if (row1 == row2)
+ {
+ clip_invert_rectangle(row1, col1, 1, col2 - col1, invert);
+ }
+ else
+ {
+ /* Handle a piece of the first line */
+ if (col1 > 0)
+ {
+ clip_invert_rectangle(row1, col1, 1, (int)Columns - col1, invert);
+ row1++;
+ }
+
+ /* Handle a piece of the last line */
+ if (col2 < Columns - 1)
+ {
+ clip_invert_rectangle(row2, 0, 1, col2, invert);
+ row2--;
+ }
+
+ /* Handle the rectangle thats left */
+ if (row2 >= row1)
+ clip_invert_rectangle(row1, 0, row2 - row1 + 1, (int)Columns,
+ invert);
+ }
+}
+
+/*
+ * Invert or un-invert a rectangle of the screen.
+ * "invert" is true if the result is inverted.
+ */
+ static void
+clip_invert_rectangle(row, col, height, width, invert)
+ int row;
+ int col;
+ int height;
+ int width;
+ int invert;
+{
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_mch_invert_rectangle(row, col, height, width);
+ else
+#endif
+ screen_draw_rectangle(row, col, height, width, invert);
+}
+
+/*
+ * Copy the currently selected area into the '*' register so it will be
+ * available for pasting.
+ * When "both" is TRUE also copy to the '+' register.
+ */
+/*ARGSUSED*/
+ void
+clip_copy_modeless_selection(both)
+ int both;
+{
+ char_u *buffer;
+ char_u *bufp;
+ int row;
+ int start_col;
+ int end_col;
+ int line_end_col;
+ int add_newline_flag = FALSE;
+ int len;
+#ifdef FEAT_MBYTE
+ char_u *p;
+ int i;
+#endif
+ int row1 = clip_star.start.lnum;
+ int col1 = clip_star.start.col;
+ int row2 = clip_star.end.lnum;
+ int col2 = clip_star.end.col;
+
+ /*
+ * Make sure row1 <= row2, and if row1 == row2 that col1 <= col2.
+ */
+ if (row1 > row2)
+ {
+ row = row1; row1 = row2; row2 = row;
+ row = col1; col1 = col2; col2 = row;
+ }
+ else if (row1 == row2 && col1 > col2)
+ {
+ row = col1; col1 = col2; col2 = row;
+ }
+#ifdef FEAT_MBYTE
+ /* correct starting point for being on right halve of double-wide char */
+ p = ScreenLines + LineOffset[row1];
+ if (enc_dbcs != 0)
+ col1 -= (*mb_head_off)(p, p + col1);
+ else if (enc_utf8 && p[col1] == 0)
+ --col1;
+#endif
+
+ /* Create a temporary buffer for storing the text */
+ len = (row2 - row1 + 1) * Columns + 1;
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0)
+ len *= 2; /* max. 2 bytes per display cell */
+ else if (enc_utf8)
+ len *= 9; /* max. 3 bytes per display cell + 2 composing chars */
+#endif
+ buffer = lalloc((long_u)len, TRUE);
+ if (buffer == NULL) /* out of memory */
+ return;
+
+ /* Process each row in the selection */
+ for (bufp = buffer, row = row1; row <= row2; row++)
+ {
+ if (row == row1)
+ start_col = col1;
+ else
+ start_col = 0;
+
+ if (row == row2)
+ end_col = col2;
+ else
+ end_col = Columns;
+
+ line_end_col = clip_get_line_end(row);
+
+ /* See if we need to nuke some trailing whitespace */
+ if (end_col >= Columns && (row < row2 || end_col > line_end_col))
+ {
+ /* Get rid of trailing whitespace */
+ end_col = line_end_col;
+ if (end_col < start_col)
+ end_col = start_col;
+
+ /* If the last line extended to the end, add an extra newline */
+ if (row == row2)
+ add_newline_flag = TRUE;
+ }
+
+ /* If after the first row, we need to always add a newline */
+ if (row > row1 && !LineWraps[row - 1])
+ *bufp++ = NL;
+
+ if (row < screen_Rows && end_col <= screen_Columns)
+ {
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0)
+ {
+ p = ScreenLines + LineOffset[row];
+ for (i = start_col; i < end_col; ++i)
+ if (enc_dbcs == DBCS_JPNU && p[i] == 0x8e)
+ {
+ /* single-width double-byte char */
+ *bufp++ = 0x8e;
+ *bufp++ = ScreenLines2[LineOffset[row] + i];
+ }
+ else
+ {
+ *bufp++ = p[i];
+ if (MB_BYTE2LEN(p[i]) == 2)
+ *bufp++ = p[++i];
+ }
+ }
+ else if (enc_utf8)
+ {
+ int off;
+
+ off = LineOffset[row];
+ for (i = start_col; i < end_col; ++i)
+ {
+ /* The base character is either in ScreenLinesUC[] or
+ * ScreenLines[]. */
+ if (ScreenLinesUC[off + i] == 0)
+ *bufp++ = ScreenLines[off + i];
+ else
+ {
+ bufp += utf_char2bytes(ScreenLinesUC[off + i], bufp);
+ if (ScreenLinesC1[off + i] != 0)
+ {
+ /* Add one or two composing characters. */
+ bufp += utf_char2bytes(ScreenLinesC1[off + i],
+ bufp);
+ if (ScreenLinesC2[off + i] != 0)
+ bufp += utf_char2bytes(ScreenLinesC2[off + i],
+ bufp);
+ }
+ }
+ /* Skip right halve of double-wide character. */
+ if (ScreenLines[off + i + 1] == 0)
+ ++i;
+ }
+ }
+ else
+#endif
+ {
+ STRNCPY(bufp, ScreenLines + LineOffset[row] + start_col,
+ end_col - start_col);
+ bufp += end_col - start_col;
+ }
+ }
+ }
+
+ /* Add a newline at the end if the selection ended there */
+ if (add_newline_flag)
+ *bufp++ = NL;
+
+ /* First cleanup any old selection and become the owner. */
+ clip_free_selection(&clip_star);
+ clip_own_selection(&clip_star);
+
+ /* Yank the text into the '*' register. */
+ clip_yank_selection(MCHAR, buffer, (long)(bufp - buffer), &clip_star);
+
+ /* Make the register contents available to the outside world. */
+ clip_gen_set_selection(&clip_star);
+
+#ifdef FEAT_X11
+ if (both)
+ {
+ /* Do the same for the '+' register. */
+ clip_free_selection(&clip_plus);
+ clip_own_selection(&clip_plus);
+ clip_yank_selection(MCHAR, buffer, (long)(bufp - buffer), &clip_plus);
+ clip_gen_set_selection(&clip_plus);
+ }
+#endif
+ vim_free(buffer);
+}
+
+/*
+ * Find the starting and ending positions of the word at the given row and
+ * column. Only white-separated words are recognized here.
+ */
+#define CHAR_CLASS(c) (c <= ' ' ? ' ' : vim_iswordc(c))
+
+ static void
+clip_get_word_boundaries(cb, row, col)
+ VimClipboard *cb;
+ int row;
+ int col;
+{
+ int start_class;
+ int temp_col;
+ char_u *p;
+#ifdef FEAT_MBYTE
+ int mboff;
+#endif
+
+ if (row >= screen_Rows || col >= screen_Columns)
+ return;
+
+ p = ScreenLines + LineOffset[row];
+#ifdef FEAT_MBYTE
+ /* Correct for starting in the right halve of a double-wide char */
+ if (enc_dbcs != 0)
+ col -= dbcs_screen_head_off(p, p + col);
+ else if (enc_utf8 && p[col] == 0)
+ --col;
+#endif
+ start_class = CHAR_CLASS(p[col]);
+
+ temp_col = col;
+ for ( ; temp_col > 0; temp_col--)
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0
+ && (mboff = dbcs_screen_head_off(p, p + temp_col - 1)) > 0)
+ temp_col -= mboff;
+ else
+#endif
+ if (CHAR_CLASS(p[temp_col - 1]) != start_class
+#ifdef FEAT_MBYTE
+ && !(enc_utf8 && p[temp_col - 1] == 0)
+#endif
+ )
+ break;
+ cb->word_start_col = temp_col;
+
+ temp_col = col;
+ for ( ; temp_col < screen_Columns; temp_col++)
+#ifdef FEAT_MBYTE
+ if (enc_dbcs != 0 && dbcs_ptr2cells(p + temp_col) == 2)
+ ++temp_col;
+ else
+#endif
+ if (CHAR_CLASS(p[temp_col]) != start_class
+#ifdef FEAT_MBYTE
+ && !(enc_utf8 && p[temp_col] == 0)
+#endif
+ )
+ break;
+ cb->word_end_col = temp_col;
+}
+
+/*
+ * Find the column position for the last non-whitespace character on the given
+ * line.
+ */
+ static int
+clip_get_line_end(row)
+ int row;
+{
+ int i;
+
+ if (row >= screen_Rows)
+ return 0;
+ for (i = screen_Columns; i > 0; i--)
+ if (ScreenLines[LineOffset[row] + i - 1] != ' ')
+ break;
+ return i;
+}
+
+/*
+ * Update the currently selected region by adding and/or subtracting from the
+ * beginning or end and inverting the changed area(s).
+ */
+ static void
+clip_update_modeless_selection(cb, row1, col1, row2, col2)
+ VimClipboard *cb;
+ int row1;
+ int col1;
+ int row2;
+ int col2;
+{
+ /* See if we changed at the beginning of the selection */
+ if (row1 != cb->start.lnum || col1 != (int)cb->start.col)
+ {
+ clip_invert_area(row1, col1, (int)cb->start.lnum, cb->start.col,
+ CLIP_TOGGLE);
+ cb->start.lnum = row1;
+ cb->start.col = col1;
+ }
+
+ /* See if we changed at the end of the selection */
+ if (row2 != cb->end.lnum || col2 != (int)cb->end.col)
+ {
+ clip_invert_area((int)cb->end.lnum, cb->end.col, row2, col2,
+ CLIP_TOGGLE);
+ cb->end.lnum = row2;
+ cb->end.col = col2;
+ }
+}
+
+ int
+clip_gen_own_selection(cbd)
+ VimClipboard *cbd;
+{
+#ifdef FEAT_XCLIPBOARD
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ return clip_mch_own_selection(cbd);
+ else
+# endif
+ return clip_xterm_own_selection(cbd);
+#else
+ return clip_mch_own_selection(cbd);
+#endif
+}
+
+ void
+clip_gen_lose_selection(cbd)
+ VimClipboard *cbd;
+{
+#ifdef FEAT_XCLIPBOARD
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ clip_mch_lose_selection(cbd);
+ else
+# endif
+ clip_xterm_lose_selection(cbd);
+#else
+ clip_mch_lose_selection(cbd);
+#endif
+}
+
+ void
+clip_gen_set_selection(cbd)
+ VimClipboard *cbd;
+{
+#ifdef FEAT_XCLIPBOARD
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ clip_mch_set_selection(cbd);
+ else
+# endif
+ clip_xterm_set_selection(cbd);
+#else
+ clip_mch_set_selection(cbd);
+#endif
+}
+
+ void
+clip_gen_request_selection(cbd)
+ VimClipboard *cbd;
+{
+#ifdef FEAT_XCLIPBOARD
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ clip_mch_request_selection(cbd);
+ else
+# endif
+ clip_xterm_request_selection(cbd);
+#else
+ clip_mch_request_selection(cbd);
+#endif
+}
+
+#endif /* FEAT_CLIPBOARD */
+
+/*****************************************************************************
+ * Functions that handle the input buffer.
+ * This is used for any GUI version, and the unix terminal version.
+ *
+ * For Unix, the input characters are buffered to be able to check for a
+ * CTRL-C. This should be done with signals, but I don't know how to do that
+ * in a portable way for a tty in RAW mode.
+ *
+ * For the client-server code in the console the received keys are put in the
+ * input buffer.
+ */
+
+#if defined(USE_INPUT_BUF) || defined(PROTO)
+
+/*
+ * Internal typeahead buffer. Includes extra space for long key code
+ * descriptions which would otherwise overflow. The buffer is considered full
+ * when only this extra space (or part of it) remains.
+ */
+#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \
+ || defined(FEAT_CLIENTSERVER)
+ /*
+ * Sun WorkShop and NetBeans stuff debugger commands into the input buffer.
+ * This requires a larger buffer...
+ * (Madsen) Go with this for remote input as well ...
+ */
+# define INBUFLEN 4096
+#else
+# define INBUFLEN 250
+#endif
+
+static char_u inbuf[INBUFLEN + MAX_KEY_CODE_LEN];
+static int inbufcount = 0; /* number of chars in inbuf[] */
+
+/*
+ * vim_is_input_buf_full(), vim_is_input_buf_empty(), add_to_input_buf(), and
+ * trash_input_buf() are functions for manipulating the input buffer. These
+ * are used by the gui_* calls when a GUI is used to handle keyboard input.
+ */
+
+ int
+vim_is_input_buf_full()
+{
+ return (inbufcount >= INBUFLEN);
+}
+
+ int
+vim_is_input_buf_empty()
+{
+ return (inbufcount == 0);
+}
+
+#if defined(FEAT_OLE) || defined(PROTO)
+ int
+vim_free_in_input_buf()
+{
+ return (INBUFLEN - inbufcount);
+}
+#endif
+
+#if defined(FEAT_GUI_GTK) || defined(PROTO)
+ int
+vim_used_in_input_buf()
+{
+ return inbufcount;
+}
+#endif
+
+#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
+/*
+ * Return the current contents of the input buffer and make it empty.
+ * The returned pointer must be passed to set_input_buf() later.
+ */
+ char_u *
+get_input_buf()
+{
+ garray_T *gap;
+
+ /* We use a growarray to store the data pointer and the length. */
+ gap = (garray_T *)alloc((unsigned)sizeof(garray_T));
+ if (gap != NULL)
+ {
+ /* Add one to avoid a zero size. */
+ gap->ga_data = alloc((unsigned)inbufcount + 1);
+ if (gap->ga_data != NULL)
+ mch_memmove(gap->ga_data, inbuf, (size_t)inbufcount);
+ gap->ga_len = inbufcount;
+ }
+ trash_input_buf();
+ return (char_u *)gap;
+}
+
+/*
+ * Restore the input buffer with a pointer returned from get_input_buf().
+ * The allocated memory is freed, this only works once!
+ */
+ void
+set_input_buf(p)
+ char_u *p;
+{
+ garray_T *gap = (garray_T *)p;
+
+ if (gap != NULL)
+ {
+ if (gap->ga_data != NULL)
+ {
+ mch_memmove(inbuf, gap->ga_data, gap->ga_len);
+ inbufcount = gap->ga_len;
+ vim_free(gap->ga_data);
+ }
+ vim_free(gap);
+ }
+}
+#endif
+
+#if defined(FEAT_GUI) || defined(FEAT_MOUSE_GPM) \
+ || defined(FEAT_XCLIPBOARD) || defined(VMS) \
+ || defined(FEAT_SNIFF) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
+/*
+ * Add the given bytes to the input buffer
+ * Special keys start with CSI. A real CSI must have been translated to
+ * CSI KS_EXTRA KE_CSI. K_SPECIAL doesn't require translation.
+ */
+ void
+add_to_input_buf(s, len)
+ char_u *s;
+ int len;
+{
+ if (inbufcount + len > INBUFLEN + MAX_KEY_CODE_LEN)
+ return; /* Shouldn't ever happen! */
+
+#ifdef FEAT_HANGULIN
+ if ((State & (INSERT|CMDLINE)) && hangul_input_state_get())
+ if ((len = hangul_input_process(s, len)) == 0)
+ return;
+#endif
+
+ while (len--)
+ inbuf[inbufcount++] = *s++;
+}
+#endif
+
+#if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) \
+ || (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) \
+ || defined(PROTO)
+/*
+ * Add "str[len]" to the input buffer while escaping CSI bytes.
+ */
+ void
+add_to_input_buf_csi(char_u *str, int len)
+{
+ int i;
+ char_u buf[2];
+
+ for (i = 0; i < len; ++i)
+ {
+ add_to_input_buf(str + i, 1);
+ if (str[i] == CSI)
+ {
+ /* Turn CSI into K_CSI. */
+ buf[0] = KS_EXTRA;
+ buf[1] = (int)KE_CSI;
+ add_to_input_buf(buf, 2);
+ }
+ }
+}
+#endif
+
+#if defined(FEAT_HANGULIN) || defined(PROTO)
+ void
+push_raw_key (s, len)
+ char_u *s;
+ int len;
+{
+ while (len--)
+ inbuf[inbufcount++] = *s++;
+}
+#endif
+
+#if defined(FEAT_GUI) || defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) \
+ || defined(PROTO)
+/* Remove everything from the input buffer. Called when ^C is found */
+ void
+trash_input_buf()
+{
+ inbufcount = 0;
+}
+#endif
+
+/*
+ * Read as much data from the input buffer as possible up to maxlen, and store
+ * it in buf.
+ * Note: this function used to be Read() in unix.c
+ */
+ int
+read_from_input_buf(buf, maxlen)
+ char_u *buf;
+ long maxlen;
+{
+ if (inbufcount == 0) /* if the buffer is empty, fill it */
+ fill_input_buf(TRUE);
+ if (maxlen > inbufcount)
+ maxlen = inbufcount;
+ mch_memmove(buf, inbuf, (size_t)maxlen);
+ inbufcount -= maxlen;
+ if (inbufcount)
+ mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount);
+ return (int)maxlen;
+}
+
+ void
+fill_input_buf(exit_on_error)
+ int exit_on_error;
+{
+#if defined(UNIX) || defined(OS2) || defined(VMS) || defined(MACOS_X_UNIX)
+ int len;
+ int try;
+ static int did_read_something = FALSE;
+# ifdef FEAT_MBYTE
+ static char_u *rest = NULL; /* unconverted rest of previous read */
+ static int restlen = 0;
+ int unconverted;
+# endif
+#endif
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_mch_update();
+ return;
+ }
+#endif
+#if defined(UNIX) || defined(OS2) || defined(VMS) || defined(MACOS_X_UNIX)
+ if (vim_is_input_buf_full())
+ return;
+ /*
+ * Fill_input_buf() is only called when we really need a character.
+ * If we can't get any, but there is some in the buffer, just return.
+ * If we can't get any, and there isn't any in the buffer, we give up and
+ * exit Vim.
+ */
+# ifdef __BEOS__
+ /*
+ * On the BeBox version (for now), all input is secretly performed within
+ * beos_select() which is called from RealWaitForChar().
+ */
+ while (!vim_is_input_buf_full() && RealWaitForChar(read_cmd_fd, 0, NULL))
+ ;
+ len = inbufcount;
+ inbufcount = 0;
+# else
+
+# ifdef FEAT_SNIFF
+ if (sniff_request_waiting)
+ {
+ add_to_input_buf((char_u *)"\233sniff",6); /* results in K_SNIFF */
+ sniff_request_waiting = 0;
+ want_sniff_request = 0;
+ return;
+ }
+# endif
+
+# ifdef FEAT_MBYTE
+ if (rest != NULL)
+ {
+ /* Use remainder of previous call, starts with an invalid character
+ * that may become valid when reading more. */
+ if (restlen > INBUFLEN - inbufcount)
+ unconverted = INBUFLEN - inbufcount;
+ else
+ unconverted = restlen;
+ mch_memmove(inbuf + inbufcount, rest, unconverted);
+ if (unconverted == restlen)
+ {
+ vim_free(rest);
+ rest = NULL;
+ }
+ else
+ {
+ restlen -= unconverted;
+ mch_memmove(rest, rest + unconverted, restlen);
+ }
+ inbufcount += unconverted;
+ }
+ else
+ unconverted = 0;
+#endif
+
+ len = 0; /* to avoid gcc warning */
+ for (try = 0; try < 100; ++try)
+ {
+# ifdef VMS
+ len = vms_read(
+# else
+ len = read(read_cmd_fd,
+# endif
+ (char *)inbuf + inbufcount, (size_t)((INBUFLEN - inbufcount)
+# ifdef FEAT_MBYTE
+ / input_conv.vc_factor
+# endif
+ ));
+# if 0
+ ) /* avoid syntax highlight error */
+# endif
+ if (len > 0 || got_int)
+ break;
+ /*
+ * If reading stdin results in an error, continue reading stderr.
+ * This helps when using "foo | xargs vim".
+ */
+ if (!did_read_something && !isatty(read_cmd_fd) && read_cmd_fd == 0)
+ {
+ int m = cur_tmode;
+
+ /* We probably set the wrong file descriptor to raw mode. Switch
+ * back to cooked mode, use another descriptor and set the mode to
+ * what it was. */
+ settmode(TMODE_COOK);
+#ifdef HAVE_DUP
+ /* Use stderr for stdin, also works for shell commands. */
+ close(0);
+ dup(2);
+#else
+ read_cmd_fd = 2; /* read from stderr instead of stdin */
+#endif
+ settmode(m);
+ }
+ if (!exit_on_error)
+ return;
+ }
+# endif
+ if (len <= 0 && !got_int)
+ read_error_exit();
+ if (len > 0)
+ did_read_something = TRUE;
+ if (got_int)
+ {
+ /* Interrupted, pretend a CTRL-C was typed. */
+ inbuf[0] = 3;
+ inbufcount = 1;
+ }
+ else
+ {
+# ifdef FEAT_MBYTE
+ /*
+ * May perform conversion on the input characters.
+ * Include the unconverted rest of the previous call.
+ * If there is an incomplete char at the end it is kept for the next
+ * time, reading more bytes should make conversion possible.
+ * Don't do this in the unlikely event that the input buffer is too
+ * small ("rest" still contains more bytes).
+ */
+ if (input_conv.vc_type != CONV_NONE)
+ {
+ inbufcount -= unconverted;
+ len = convert_input_safe(inbuf + inbufcount,
+ len + unconverted, INBUFLEN - inbufcount,
+ rest == NULL ? &rest : NULL, &restlen);
+ }
+# endif
+ while (len-- > 0)
+ {
+ /*
+ * if a CTRL-C was typed, remove it from the buffer and set got_int
+ */
+ if (inbuf[inbufcount] == 3 && ctrl_c_interrupts)
+ {
+ /* remove everything typed before the CTRL-C */
+ mch_memmove(inbuf, inbuf + inbufcount, (size_t)(len + 1));
+ inbufcount = 0;
+ got_int = TRUE;
+ }
+ ++inbufcount;
+ }
+ }
+#endif /* UNIX or OS2 or VMS*/
+}
+#endif /* defined(UNIX) || defined(FEAT_GUI) || defined(OS2) || defined(VMS) */
+
+/*
+ * Exit because of an input read error.
+ */
+ void
+read_error_exit()
+{
+ if (silent_mode) /* Normal way to exit for "ex -s" */
+ getout(0);
+ STRCPY(IObuff, _("Vim: Error reading input, exiting...\n"));
+ preserve_exit();
+}
+
+#if defined(CURSOR_SHAPE) || defined(PROTO)
+/*
+ * May update the shape of the cursor.
+ */
+ void
+ui_cursor_shape()
+{
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ gui_update_cursor_later();
+# endif
+# ifdef MCH_CURSOR_SHAPE
+ mch_update_cursor();
+# endif
+}
+#endif
+
+#if defined(FEAT_CLIPBOARD) || defined(FEAT_GUI) || defined(FEAT_RIGHTLEFT) \
+ || defined(PROTO)
+/*
+ * Check bounds for column number
+ */
+ int
+check_col(col)
+ int col;
+{
+ if (col < 0)
+ return 0;
+ if (col >= (int)screen_Columns)
+ return (int)screen_Columns - 1;
+ return col;
+}
+
+/*
+ * Check bounds for row number
+ */
+ int
+check_row(row)
+ int row;
+{
+ if (row < 0)
+ return 0;
+ if (row >= (int)screen_Rows)
+ return (int)screen_Rows - 1;
+ return row;
+}
+#endif
+
+/*
+ * Stuff for the X clipboard. Shared between VMS and Unix.
+ */
+
+#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) || defined(PROTO)
+# include <X11/Xatom.h>
+# include <X11/Intrinsic.h>
+
+/*
+ * Open the application context (if it hasn't been opened yet).
+ * Used for Motif and Athena GUI and the xterm clipboard.
+ */
+ void
+open_app_context()
+{
+ if (app_context == NULL)
+ {
+ XtToolkitInitialize();
+ app_context = XtCreateApplicationContext();
+ }
+}
+
+static Atom vim_atom; /* Vim's own special selection format */
+#ifdef FEAT_MBYTE
+static Atom vimenc_atom; /* Vim's extended selection format */
+#endif
+static Atom compound_text_atom;
+static Atom text_atom;
+static Atom targets_atom;
+
+ void
+x11_setup_atoms(dpy)
+ Display *dpy;
+{
+ vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False);
+#ifdef FEAT_MBYTE
+ vimenc_atom = XInternAtom(dpy, VIMENC_ATOM_NAME,False);
+#endif
+ compound_text_atom = XInternAtom(dpy, "COMPOUND_TEXT", False);
+ text_atom = XInternAtom(dpy, "TEXT", False);
+ targets_atom = XInternAtom(dpy, "TARGETS", False);
+ clip_star.sel_atom = XA_PRIMARY;
+ clip_plus.sel_atom = XInternAtom(dpy, "CLIPBOARD", False);
+}
+
+/*
+ * X Selection stuff, for cutting and pasting text to other windows.
+ */
+
+static void clip_x11_request_selection_cb __ARGS((Widget, XtPointer, Atom *, Atom *, XtPointer, long_u *, int *));
+
+/* ARGSUSED */
+ static void
+clip_x11_request_selection_cb(w, success, sel_atom, type, value, length,
+ format)
+ Widget w;
+ XtPointer success;
+ Atom *sel_atom;
+ Atom *type;
+ XtPointer value;
+ long_u *length;
+ int *format;
+{
+ int motion_type;
+ long_u len;
+ char_u *p;
+ char **text_list = NULL;
+ VimClipboard *cbd;
+#ifdef FEAT_MBYTE
+ char_u *tmpbuf = NULL;
+#endif
+
+ if (*sel_atom == clip_plus.sel_atom)
+ cbd = &clip_plus;
+ else
+ cbd = &clip_star;
+
+ if (value == NULL || *length == 0)
+ {
+ clip_free_selection(cbd); /* ??? [what's the query?] */
+ *(int *)success = FALSE;
+ return;
+ }
+ motion_type = MCHAR;
+ p = (char_u *)value;
+ len = *length;
+ if (*type == vim_atom)
+ {
+ motion_type = *p++;
+ len--;
+ }
+
+#ifdef FEAT_MBYTE
+ else if (*type == vimenc_atom)
+ {
+ char_u *enc;
+ vimconv_T conv;
+ int convlen;
+
+ motion_type = *p++;
+ --len;
+
+ enc = p;
+ p += STRLEN(p) + 1;
+ len -= p - enc;
+
+ /* If the encoding of the text is different from 'encoding', attempt
+ * converting it. */
+ conv.vc_type = CONV_NONE;
+ convert_setup(&conv, enc, p_enc);
+ if (conv.vc_type != CONV_NONE)
+ {
+ convlen = len; /* Need to use an int here. */
+ tmpbuf = string_convert(&conv, p, &convlen);
+ len = convlen;
+ if (tmpbuf != NULL)
+ p = tmpbuf;
+ convert_setup(&conv, NULL, NULL);
+ }
+ }
+#endif
+
+ else if (*type == compound_text_atom || (
+#ifdef FEAT_MBYTE
+ enc_dbcs != 0 &&
+#endif
+ *type == text_atom))
+ {
+ XTextProperty text_prop;
+ int n_text = 0;
+ int status;
+
+ text_prop.value = (unsigned char *)value;
+ text_prop.encoding = *type;
+ text_prop.format = *format;
+ text_prop.nitems = STRLEN(value);
+ status = XmbTextPropertyToTextList(X_DISPLAY, &text_prop,
+ &text_list, &n_text);
+ if (status != Success || n_text < 1)
+ {
+ *(int *)success = FALSE;
+ return;
+ }
+ p = (char_u *)text_list[0];
+ len = STRLEN(p);
+ }
+ clip_yank_selection(motion_type, p, (long)len, cbd);
+
+ if (text_list != NULL)
+ XFreeStringList(text_list);
+#ifdef FEAT_MBYTE
+ vim_free(tmpbuf);
+#endif
+ XtFree((char *)value);
+ *(int *)success = TRUE;
+}
+
+ void
+clip_x11_request_selection(myShell, dpy, cbd)
+ Widget myShell;
+ Display *dpy;
+ VimClipboard *cbd;
+{
+ XEvent event;
+ Atom type;
+ static int success;
+ int i;
+ int nbytes = 0;
+ char_u *buffer;
+
+ for (i =
+#ifdef FEAT_MBYTE
+ 0
+#else
+ 1
+#endif
+ ; i < 5; i++)
+ {
+ switch (i)
+ {
+#ifdef FEAT_MBYTE
+ case 0: type = vimenc_atom; break;
+#endif
+ case 1: type = vim_atom; break;
+ case 2: type = compound_text_atom; break;
+ case 3: type = text_atom; break;
+ default: type = XA_STRING;
+ }
+ XtGetSelectionValue(myShell, cbd->sel_atom, type,
+ clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime);
+
+ /* Make sure the request for the selection goes out before waiting for
+ * a response. */
+ XFlush(dpy);
+
+ /*
+ * Wait for result of selection request, otherwise if we type more
+ * characters, then they will appear before the one that requested the
+ * paste! Don't worry, we will catch up with any other events later.
+ */
+ for (;;)
+ {
+ if (XCheckTypedEvent(dpy, SelectionNotify, &event))
+ break;
+
+ /* Do we need this? Probably not. */
+ XSync(dpy, False);
+
+ /* Bernhard Walle solved a slow paste response in an X terminal by
+ * adding: usleep(10000); here. */
+ }
+
+ /* this is where clip_x11_request_selection_cb() is actually called */
+ XtDispatchEvent(&event);
+
+ if (success)
+ return;
+ }
+
+ /* Final fallback position - use the X CUT_BUFFER0 store */
+ buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
+ if (nbytes > 0)
+ {
+ /* Got something */
+ clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
+ XFree((void *)buffer);
+ if (p_verbose > 0)
+ smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection") );
+ }
+}
+
+static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *));
+
+/* ARGSUSED */
+ static Boolean
+clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format)
+ Widget w;
+ Atom *sel_atom;
+ Atom *target;
+ Atom *type;
+ XtPointer *value;
+ long_u *length;
+ int *format;
+{
+ char_u *string;
+ char_u *result;
+ int motion_type;
+ VimClipboard *cbd;
+ int i;
+
+ if (*sel_atom == clip_plus.sel_atom)
+ cbd = &clip_plus;
+ else
+ cbd = &clip_star;
+
+ if (!cbd->owned)
+ return False; /* Shouldn't ever happen */
+
+ /* requestor wants to know what target types we support */
+ if (*target == targets_atom)
+ {
+ Atom *array;
+
+ if ((array = (Atom *)XtMalloc((unsigned)(sizeof(Atom) * 6))) == NULL)
+ return False;
+ *value = (XtPointer)array;
+ i = 0;
+ array[i++] = XA_STRING;
+ array[i++] = targets_atom;
+#ifdef FEAT_MBYTE
+ array[i++] = vimenc_atom;
+#endif
+ array[i++] = vim_atom;
+ array[i++] = text_atom;
+ array[i++] = compound_text_atom;
+ *type = XA_ATOM;
+ /* This used to be: *format = sizeof(Atom) * 8; but that caused
+ * crashes on 64 bit machines. (Peter Derr) */
+ *format = 32;
+ *length = i;
+ return True;
+ }
+
+ if ( *target != XA_STRING
+#ifdef FEAT_MBYTE
+ && *target != vimenc_atom
+#endif
+ && *target != vim_atom
+ && *target != text_atom
+ && *target != compound_text_atom)
+ return False;
+
+ clip_get_selection(cbd);
+ motion_type = clip_convert_selection(&string, length, cbd);
+ if (motion_type < 0)
+ return False;
+
+ /* For our own format, the first byte contains the motion type */
+ if (*target == vim_atom)
+ (*length)++;
+
+#ifdef FEAT_MBYTE
+ /* Our own format with encoding: motion 'encoding' NUL text */
+ if (*target == vimenc_atom)
+ *length += STRLEN(p_enc) + 2;
+#endif
+
+ *value = XtMalloc((Cardinal)*length);
+ result = (char_u *)*value;
+ if (result == NULL)
+ {
+ vim_free(string);
+ return False;
+ }
+
+ if (*target == XA_STRING)
+ {
+ mch_memmove(result, string, (size_t)(*length));
+ *type = XA_STRING;
+ }
+ else if (*target == compound_text_atom
+ || *target == text_atom)
+ {
+ XTextProperty text_prop;
+ char *string_nt = (char *)alloc((unsigned)*length + 1);
+
+ /* create NUL terminated string which XmbTextListToTextProperty wants */
+ mch_memmove(string_nt, string, (size_t)*length);
+ string_nt[*length] = NUL;
+ XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt, 1,
+ XCompoundTextStyle, &text_prop);
+ vim_free(string_nt);
+ XtFree(*value); /* replace with COMPOUND text */
+ *value = (XtPointer)(text_prop.value); /* from plain text */
+ *length = text_prop.nitems;
+ *type = compound_text_atom;
+ }
+
+#ifdef FEAT_MBYTE
+ else if (*target == vimenc_atom)
+ {
+ int l = STRLEN(p_enc);
+
+ result[0] = motion_type;
+ STRCPY(result + 1, p_enc);
+ mch_memmove(result + l + 2, string, (size_t)(*length - l - 2));
+ *type = vimenc_atom;
+ }
+#endif
+
+ else
+ {
+ result[0] = motion_type;
+ mch_memmove(result + 1, string, (size_t)(*length - 1));
+ *type = vim_atom;
+ }
+ *format = 8; /* 8 bits per char */
+ vim_free(string);
+ return True;
+}
+
+static void clip_x11_lose_ownership_cb __ARGS((Widget, Atom *));
+
+/* ARGSUSED */
+ static void
+clip_x11_lose_ownership_cb(w, sel_atom)
+ Widget w;
+ Atom *sel_atom;
+{
+ if (*sel_atom == clip_plus.sel_atom)
+ clip_lose_selection(&clip_plus);
+ else
+ clip_lose_selection(&clip_star);
+}
+
+ void
+clip_x11_lose_selection(myShell, cbd)
+ Widget myShell;
+ VimClipboard *cbd;
+{
+ XtDisownSelection(myShell, cbd->sel_atom, CurrentTime);
+}
+
+ int
+clip_x11_own_selection(myShell, cbd)
+ Widget myShell;
+ VimClipboard *cbd;
+{
+ if (XtOwnSelection(myShell, cbd->sel_atom, CurrentTime,
+ clip_x11_convert_selection_cb, clip_x11_lose_ownership_cb,
+ NULL) == False)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Send the current selection to the clipboard. Do nothing for X because we
+ * will fill in the selection only when requested by another app.
+ */
+/*ARGSUSED*/
+ void
+clip_x11_set_selection(cbd)
+ VimClipboard *cbd;
+{
+}
+#endif
+
+#if defined(FEAT_MOUSE) || defined(PROTO)
+
+/*
+ * Move the cursor to the specified row and column on the screen.
+ * Change current window if neccesary. Returns an integer with the
+ * CURSOR_MOVED bit set if the cursor has moved or unset otherwise.
+ *
+ * The MOUSE_FOLD_CLOSE bit is set when clicked on the '-' in a fold column.
+ * The MOUSE_FOLD_OPEN bit is set when clicked on the '+' in a fold column.
+ *
+ * If flags has MOUSE_FOCUS, then the current window will not be changed, and
+ * if the mouse is outside the window then the text will scroll, or if the
+ * mouse was previously on a status line, then the status line may be dragged.
+ *
+ * If flags has MOUSE_MAY_VIS, then VIsual mode will be started before the
+ * cursor is moved unless the cursor was on a status line.
+ * This function returns one of IN_UNKNOWN, IN_BUFFER, IN_STATUS_LINE or
+ * IN_SEP_LINE depending on where the cursor was clicked.
+ *
+ * If flags has MOUSE_MAY_STOP_VIS, then Visual mode will be stopped, unless
+ * the mouse is on the status line of the same window.
+ *
+ * If flags has MOUSE_DID_MOVE, nothing is done if the mouse didn't move since
+ * the last call.
+ *
+ * If flags has MOUSE_SETPOS, nothing is done, only the current position is
+ * remembered.
+ */
+ int
+jump_to_mouse(flags, inclusive, which_button)
+ int flags;
+ int *inclusive; /* used for inclusive operator, can be NULL */
+ int which_button; /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */
+{
+ static int on_status_line = 0; /* #lines below bottom of window */
+#ifdef FEAT_VERTSPLIT
+ static int on_sep_line = 0; /* on separator right of window */
+#endif
+ static int prev_row = -1;
+ static int prev_col = -1;
+ static win_T *dragwin = NULL; /* window being dragged */
+ static int did_drag = FALSE; /* drag was noticed */
+
+ win_T *wp, *old_curwin;
+ pos_T old_cursor;
+ int count;
+ int first;
+ int row = mouse_row;
+ int col = mouse_col;
+#ifdef FEAT_FOLDING
+ int mouse_char;
+#endif
+
+ mouse_past_bottom = FALSE;
+ mouse_past_eol = FALSE;
+
+ if (flags & MOUSE_RELEASED)
+ {
+ /* On button release we may change window focus if positioned on a
+ * status line and no dragging happened. */
+ if (dragwin != NULL && !did_drag)
+ flags &= ~(MOUSE_FOCUS | MOUSE_DID_MOVE);
+ dragwin = NULL;
+ did_drag = FALSE;
+ }
+
+ if ((flags & MOUSE_DID_MOVE)
+ && prev_row == mouse_row
+ && prev_col == mouse_col)
+ {
+retnomove:
+ /* before moving the cursor for a left click wich is NOT in a status
+ * line, stop Visual mode */
+ if (on_status_line)
+ return IN_STATUS_LINE;
+#ifdef FEAT_VERTSPLIT
+ if (on_sep_line)
+ return IN_SEP_LINE;
+#endif
+#ifdef FEAT_VISUAL
+ if (flags & MOUSE_MAY_STOP_VIS)
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED); /* delete the inversion */
+ }
+#endif
+#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
+ /* Continue a modeless selection in another window. */
+ if (cmdwin_type != 0 && row < W_WINROW(curwin))
+ return IN_OTHER_WIN;
+#endif
+ return IN_BUFFER;
+ }
+
+ prev_row = mouse_row;
+ prev_col = mouse_col;
+
+ if (flags & MOUSE_SETPOS)
+ goto retnomove; /* ugly goto... */
+
+#ifdef FEAT_FOLDING
+ /* Remember the character under the mouse, it might be a '-' or '+' in the
+ * fold column. */
+ if (row >= 0 && row < Rows && col >= 0 && col <= Columns)
+ mouse_char = ScreenLines[LineOffset[row] + col];
+ else
+ mouse_char = ' ';
+#endif
+
+ old_curwin = curwin;
+ old_cursor = curwin->w_cursor;
+
+ if (!(flags & MOUSE_FOCUS))
+ {
+ if (row < 0 || col < 0) /* check if it makes sense */
+ return IN_UNKNOWN;
+
+#ifdef FEAT_WINDOWS
+ /* find the window where the row is in */
+ wp = mouse_find_win(&row, &col);
+#else
+ wp = firstwin;
+#endif
+ dragwin = NULL;
+ /*
+ * winpos and height may change in win_enter()!
+ */
+ if (row >= wp->w_height) /* In (or below) status line */
+ {
+ on_status_line = row - wp->w_height + 1;
+ dragwin = wp;
+ }
+ else
+ on_status_line = 0;
+#ifdef FEAT_VERTSPLIT
+ if (col >= wp->w_width) /* In separator line */
+ {
+ on_sep_line = col - wp->w_width + 1;
+ dragwin = wp;
+ }
+ else
+ on_sep_line = 0;
+
+ /* The rightmost character of the status line might be a vertical
+ * separator character if there is no connecting window to the right. */
+ if (on_status_line && on_sep_line)
+ {
+ if (stl_connected(wp))
+ on_sep_line = 0;
+ else
+ on_status_line = 0;
+ }
+#endif
+
+#ifdef FEAT_VISUAL
+ /* Before jumping to another buffer, or moving the cursor for a left
+ * click, stop Visual mode. */
+ if (VIsual_active
+ && (wp->w_buffer != curwin->w_buffer
+ || (!on_status_line
+# ifdef FEAT_VERTSPLIT
+ && !on_sep_line
+# endif
+# ifdef FEAT_FOLDING
+ && (
+# ifdef FEAT_RIGHTLEFT
+ wp->w_p_rl ? col < W_WIDTH(wp) - wp->w_p_fdc :
+# endif
+ col >= wp->w_p_fdc
+# ifdef FEAT_CMDWIN
+ + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
+# endif
+ )
+# endif
+ && (flags & MOUSE_MAY_STOP_VIS))))
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED); /* delete the inversion */
+ }
+#endif
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0 && wp != curwin)
+ {
+ /* A click outside the command-line window: Use modeless
+ * selection if possible. Allow dragging the status line of
+ * windows just above the command-line window. */
+ if (wp->w_winrow + wp->w_height
+ != curwin->w_prev->w_winrow + curwin->w_prev->w_height)
+ {
+ on_status_line = 0;
+ dragwin = NULL;
+ }
+# ifdef FEAT_VERTSPLIT
+ on_sep_line = 0;
+# endif
+# ifdef FEAT_CLIPBOARD
+ if (on_status_line)
+ return IN_STATUS_LINE;
+ return IN_OTHER_WIN;
+# else
+ row = 0;
+ col += wp->w_wincol;
+ wp = curwin;
+# endif
+ }
+#endif
+#ifdef FEAT_WINDOWS
+ /* Only change window focus when not clicking on or dragging the
+ * status line. Do change focus when releasing the mouse button
+ * (MOUSE_FOCUS was set above if we dragged first). */
+ if (dragwin == NULL || (flags & MOUSE_RELEASED))
+ win_enter(wp, TRUE); /* can make wp invalid! */
+# ifdef CHECK_DOUBLE_CLICK
+ /* set topline, to be able to check for double click ourselves */
+ if (curwin != old_curwin)
+ set_mouse_topline(curwin);
+# endif
+#endif
+ if (on_status_line) /* In (or below) status line */
+ {
+ /* Don't use start_arrow() if we're in the same window */
+ if (curwin == old_curwin)
+ return IN_STATUS_LINE;
+ else
+ return IN_STATUS_LINE | CURSOR_MOVED;
+ }
+#ifdef FEAT_VERTSPLIT
+ if (on_sep_line) /* In (or below) status line */
+ {
+ /* Don't use start_arrow() if we're in the same window */
+ if (curwin == old_curwin)
+ return IN_SEP_LINE;
+ else
+ return IN_SEP_LINE | CURSOR_MOVED;
+ }
+#endif
+
+ curwin->w_cursor.lnum = curwin->w_topline;
+#ifdef FEAT_GUI
+ /* remember topline, needed for double click */
+ gui_prev_topline = curwin->w_topline;
+# ifdef FEAT_DIFF
+ gui_prev_topfill = curwin->w_topfill;
+# endif
+#endif
+ }
+ else if (on_status_line && which_button == MOUSE_LEFT)
+ {
+#ifdef FEAT_WINDOWS
+ if (dragwin != NULL)
+ {
+ /* Drag the status line */
+ count = row - dragwin->w_winrow - dragwin->w_height + 1
+ - on_status_line;
+ win_drag_status_line(dragwin, count);
+ did_drag |= count;
+ }
+#endif
+ return IN_STATUS_LINE; /* Cursor didn't move */
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (on_sep_line && which_button == MOUSE_LEFT)
+ {
+ if (dragwin != NULL)
+ {
+ /* Drag the separator column */
+ count = col - dragwin->w_wincol - dragwin->w_width + 1
+ - on_sep_line;
+ win_drag_vsep_line(dragwin, count);
+ did_drag |= count;
+ }
+ return IN_SEP_LINE; /* Cursor didn't move */
+ }
+#endif
+ else /* keep_window_focus must be TRUE */
+ {
+#ifdef FEAT_VISUAL
+ /* before moving the cursor for a left click, stop Visual mode */
+ if (flags & MOUSE_MAY_STOP_VIS)
+ {
+ end_visual_mode();
+ redraw_curbuf_later(INVERTED); /* delete the inversion */
+ }
+#endif
+
+#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
+ /* Continue a modeless selection in another window. */
+ if (cmdwin_type != 0 && row < W_WINROW(curwin))
+ return IN_OTHER_WIN;
+#endif
+
+ row -= W_WINROW(curwin);
+#ifdef FEAT_VERTSPLIT
+ col -= W_WINCOL(curwin);
+#endif
+
+ /*
+ * When clicking beyond the end of the window, scroll the screen.
+ * Scroll by however many rows outside the window we are.
+ */
+ if (row < 0)
+ {
+ count = 0;
+ for (first = TRUE; curwin->w_topline > 1; )
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
+ ++count;
+ else
+#endif
+ count += plines(curwin->w_topline - 1);
+ if (!first && count > -row)
+ break;
+ first = FALSE;
+#ifdef FEAT_FOLDING
+ hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
+#endif
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
+ ++curwin->w_topfill;
+ else
+#endif
+ {
+ --curwin->w_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill = 0;
+#endif
+ }
+ }
+#ifdef FEAT_DIFF
+ check_topfill(curwin, FALSE);
+#endif
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
+ redraw_later(VALID);
+ row = 0;
+ }
+ else if (row >= curwin->w_height)
+ {
+ count = 0;
+ for (first = TRUE; curwin->w_topline < curbuf->b_ml.ml_line_count; )
+ {
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ ++count;
+ else
+#endif
+ count += plines(curwin->w_topline);
+ if (!first && count > row - curwin->w_height + 1)
+ break;
+ first = FALSE;
+#ifdef FEAT_FOLDING
+ if (hasFolding(curwin->w_topline, NULL, &curwin->w_topline)
+ && curwin->w_topline == curbuf->b_ml.ml_line_count)
+ break;
+#endif
+#ifdef FEAT_DIFF
+ if (curwin->w_topfill > 0)
+ --curwin->w_topfill;
+ else
+#endif
+ {
+ ++curwin->w_topline;
+#ifdef FEAT_DIFF
+ curwin->w_topfill =
+ diff_check_fill(curwin, curwin->w_topline);
+#endif
+ }
+ }
+#ifdef FEAT_DIFF
+ check_topfill(curwin, FALSE);
+#endif
+ redraw_later(VALID);
+ curwin->w_valid &=
+ ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
+ row = curwin->w_height - 1;
+ }
+ else if (row == 0)
+ {
+ /* When dragging the mouse, while the text has been scrolled up as
+ * far as it goes, moving the mouse in the top line should scroll
+ * the text down (done later when recomputing w_topline). */
+ if (mouse_dragging
+ && curwin->w_cursor.lnum
+ == curwin->w_buffer->b_ml.ml_line_count
+ && curwin->w_cursor.lnum == curwin->w_topline)
+ curwin->w_valid &= ~(VALID_TOPLINE);
+ }
+ }
+
+#ifdef FEAT_FOLDING
+ /* Check for position outside of the fold column. */
+ if (
+# ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl ? col < W_WIDTH(curwin) - curwin->w_p_fdc :
+# endif
+ col >= curwin->w_p_fdc
+# ifdef FEAT_CMDWIN
+ + (cmdwin_type == 0 ? 0 : 1)
+# endif
+ )
+ mouse_char = ' ';
+#endif
+
+ /* compute the position in the buffer line from the posn on the screen */
+ if (mouse_comp_pos(curwin, &row, &col, &curwin->w_cursor.lnum))
+ mouse_past_bottom = TRUE;
+
+#ifdef FEAT_VISUAL
+ /* Start Visual mode before coladvance(), for when 'sel' != "old" */
+ if ((flags & MOUSE_MAY_VIS) && !VIsual_active)
+ {
+ check_visual_highlight();
+ VIsual = old_cursor;
+ VIsual_active = TRUE;
+ VIsual_reselect = TRUE;
+ /* if 'selectmode' contains "mouse", start Select mode */
+ may_start_select('o');
+ setmouse();
+ if (p_smd)
+ redraw_cmdline = TRUE; /* show visual mode later */
+ }
+#endif
+
+ curwin->w_curswant = col;
+ curwin->w_set_curswant = FALSE; /* May still have been TRUE */
+ if (coladvance(col) == FAIL) /* Mouse click beyond end of line */
+ {
+ if (inclusive != NULL)
+ *inclusive = TRUE;
+ mouse_past_eol = TRUE;
+ }
+ else if (inclusive != NULL)
+ *inclusive = FALSE;
+
+ count = IN_BUFFER;
+ if (curwin != old_curwin || curwin->w_cursor.lnum != old_cursor.lnum
+ || curwin->w_cursor.col != old_cursor.col)
+ count |= CURSOR_MOVED; /* Cursor has moved */
+
+#ifdef FEAT_FOLDING
+ if (mouse_char == '+')
+ count |= MOUSE_FOLD_OPEN;
+ else if (mouse_char != ' ')
+ count |= MOUSE_FOLD_CLOSE;
+#endif
+
+ return count;
+}
+
+/*
+ * Compute the position in the buffer line from the posn on the screen in
+ * window "win".
+ * Returns TRUE if the position is below the last line.
+ */
+ int
+mouse_comp_pos(win, rowp, colp, lnump)
+ win_T *win;
+ int *rowp;
+ int *colp;
+ linenr_T *lnump;
+{
+ int col = *colp;
+ int row = *rowp;
+ linenr_T lnum;
+ int retval = FALSE;
+ int off;
+ int count;
+
+#ifdef FEAT_RIGHTLEFT
+ if (win->w_p_rl)
+ col = W_WIDTH(win) - 1 - col;
+#endif
+
+ lnum = win->w_topline;
+
+ while (row > 0)
+ {
+#ifdef FEAT_DIFF
+ /* Don't include filler lines in "count" */
+ if (win->w_p_diff && !hasFoldingWin(win, lnum, NULL, NULL, TRUE, NULL))
+ {
+ if (lnum == win->w_topline)
+ row -= win->w_topfill;
+ else
+ row -= diff_check_fill(win, lnum);
+ count = plines_win_nofill(win, lnum, TRUE);
+ }
+ else
+#endif
+ count = plines_win(win, lnum, TRUE);
+ if (count > row)
+ break; /* Position is in this buffer line. */
+#ifdef FEAT_FOLDING
+ (void)hasFoldingWin(win, lnum, NULL, &lnum, TRUE, NULL);
+#endif
+ if (lnum == win->w_buffer->b_ml.ml_line_count)
+ {
+ retval = TRUE;
+ break; /* past end of file */
+ }
+ row -= count;
+ ++lnum;
+ }
+
+ if (!retval)
+ {
+ /* Compute the column without wrapping. */
+ off = win_col_off(win) - win_col_off2(win);
+ if (col < off)
+ col = off;
+ col += row * (W_WIDTH(win) - off);
+ /* add skip column (for long wrapping line) */
+ col += win->w_skipcol;
+ }
+
+ if (!win->w_p_wrap)
+ col += win->w_leftcol;
+
+ /* skip line number and fold column in front of the line */
+ col -= win_col_off(win);
+ if (col < 0)
+ {
+#ifdef FEAT_NETBEANS_INTG
+ if (usingNetbeans)
+ netbeans_gutter_click(lnum);
+#endif
+ col = 0;
+ }
+
+ *colp = col;
+ *rowp = row;
+ *lnump = lnum;
+ return retval;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Find the window at screen position "*rowp" and "*colp". The positions are
+ * updated to become relative to the top-left of the window.
+ */
+/*ARGSUSED*/
+ win_T *
+mouse_find_win(rowp, colp)
+ int *rowp;
+ int *colp;
+{
+ frame_T *fp;
+
+ fp = topframe;
+ for (;;)
+ {
+ if (fp->fr_layout == FR_LEAF)
+ break;
+#ifdef FEAT_VERTSPLIT
+ if (fp->fr_layout == FR_ROW)
+ {
+ for (fp = fp->fr_child; fp->fr_next != NULL; fp = fp->fr_next)
+ {
+ if (*colp < fp->fr_width)
+ break;
+ *colp -= fp->fr_width;
+ }
+ }
+#endif
+ else /* fr_layout == FR_COL */
+ {
+ for (fp = fp->fr_child; fp->fr_next != NULL; fp = fp->fr_next)
+ {
+ if (*rowp < fp->fr_height)
+ break;
+ *rowp -= fp->fr_height;
+ }
+ }
+ }
+ return fp->fr_win;
+}
+#endif
+
+#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined (FEAT_GUI_MAC) \
+ || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MSWIN) \
+ || defined(FEAT_GUI_PHOTON) || defined(PROTO)
+/*
+ * Translate window coordinates to buffer position without any side effects
+ */
+ int
+get_fpos_of_mouse(mpos)
+ pos_T *mpos;
+{
+ win_T *wp;
+ int row = mouse_row;
+ int col = mouse_col;
+
+ if (row < 0 || col < 0) /* check if it makes sense */
+ return IN_UNKNOWN;
+
+#ifdef FEAT_WINDOWS
+ /* find the window where the row is in */
+ wp = mouse_find_win(&row, &col);
+#else
+ wp = firstwin;
+#endif
+ /*
+ * winpos and height may change in win_enter()!
+ */
+ if (row >= wp->w_height) /* In (or below) status line */
+ return IN_STATUS_LINE;
+#ifdef FEAT_VERTSPLIT
+ if (col >= wp->w_width) /* In vertical separator line */
+ return IN_SEP_LINE;
+#endif
+
+ if (wp != curwin)
+ return IN_UNKNOWN;
+
+ /* compute the position in the buffer line from the posn on the screen */
+ if (mouse_comp_pos(curwin, &row, &col, &mpos->lnum))
+ return IN_STATUS_LINE; /* past bottom */
+
+ mpos->col = vcol2col(wp, mpos->lnum, col);
+
+ if (mpos->col > 0)
+ --mpos->col;
+ return IN_BUFFER;
+}
+
+/*
+ * Convert a virtual (screen) column to a character column.
+ * The first column is one.
+ */
+ int
+vcol2col(wp, lnum, vcol)
+ win_T *wp;
+ linenr_T lnum;
+ int vcol;
+{
+ /* try to advance to the specified column */
+ int col = 0;
+ int count = 0;
+ char_u *ptr;
+
+ ptr = ml_get_buf(wp->w_buffer, lnum, FALSE);
+ while (count <= vcol && *ptr != NUL)
+ {
+ ++col;
+ count += win_lbr_chartabsize(wp, ptr, count, NULL);
+# ifdef FEAT_MBYTE
+ if (has_mbyte)
+ ptr += (*mb_ptr2len_check)(ptr);
+ else
+# endif
+ ++ptr;
+ }
+ return col;
+}
+#endif
+
+#endif /* FEAT_MOUSE */
+
+#if defined(FEAT_GUI) || defined(WIN3264) || defined(PROTO)
+/*
+ * Called when focus changed. Used for the GUI or for systems where this can
+ * be done in the console (Win32).
+ */
+ void
+ui_focus_change(in_focus)
+ int in_focus; /* TRUE if focus gained. */
+{
+ static time_t last_time = (time_t)0;
+ int need_redraw = FALSE;
+
+ /* When activated: Check if any file was modified outside of Vim.
+ * Only do this when not done within the last two seconds (could get
+ * several events in a row). */
+ if (in_focus && last_time + 2 < time(NULL))
+ {
+ need_redraw = check_timestamps(
+# ifdef FEAT_GUI
+ gui.in_use
+# else
+ FALSE
+# endif
+ );
+ last_time = time(NULL);
+ }
+
+#ifdef FEAT_AUTOCMD
+ /*
+ * Fire the focus gained/lost autocommand.
+ */
+ need_redraw |= apply_autocmds(in_focus ? EVENT_FOCUSGAINED
+ : EVENT_FOCUSLOST, NULL, NULL, FALSE, curbuf);
+#endif
+
+ if (need_redraw)
+ {
+ /* Something was executed, make sure the cursor is put back where it
+ * belongs. */
+ need_wait_return = FALSE;
+
+ if (State & CMDLINE)
+ redrawcmdline();
+ else if (State == HITRETURN || State == SETWSIZE || State == ASKMORE
+ || State == EXTERNCMD || State == CONFIRM || exmode_active)
+ repeat_message();
+ else if ((State & NORMAL) || (State & INSERT))
+ {
+ if (must_redraw != 0)
+ update_screen(0);
+ setcursor();
+ }
+ cursor_on(); /* redrawing may have switched it off */
+ out_flush();
+# ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ gui_update_cursor(FALSE, TRUE);
+ gui_update_scrollbars(FALSE);
+ }
+# endif
+ }
+#ifdef FEAT_TITLE
+ /* File may have been changed from 'readonly' to 'noreadonly' */
+ if (need_maketitle)
+ maketitle();
+#endif
+}
+#endif
+
+#if defined(USE_IM_CONTROL) || defined(PROTO)
+/*
+ * Save current Input Method status to specified place.
+ */
+ void
+im_save_status(psave)
+ long *psave;
+{
+ /* Don't save when 'imdisable' is set or "xic" is NULL, IM is always
+ * disabled then (but might start later).
+ * Also don't save when inside a mapping, vgetc_im_active has not been set
+ * then.
+ * And don't save when the keys were stuffed (e.g., for a "." command).
+ * And don't save when the GUI is running but our window doesn't have
+ * input focus (e.g., when a find dialog is open). */
+ if (!p_imdisable && KeyTyped && !KeyStuffed
+# ifdef FEAT_XIM
+ && xic != NULL
+# endif
+# ifdef FEAT_GUI
+ && (!gui.in_use || gui.in_focus)
+# endif
+ )
+ {
+ /* Do save when IM is on, or IM is off and saved status is on. */
+ if (vgetc_im_active)
+ *psave = B_IMODE_IM;
+ else if (*psave == B_IMODE_IM)
+ *psave = B_IMODE_NONE;
+ }
+}
+#endif
diff --git a/src/undo.c b/src/undo.c
new file mode 100644
index 000000000..6efcffab4
--- /dev/null
+++ b/src/undo.c
@@ -0,0 +1,1380 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * undo.c: multi level undo facility
+ *
+ * The saved lines are stored in a list of lists (one for each buffer):
+ *
+ * b_u_oldhead------------------------------------------------+
+ * |
+ * V
+ * +--------------+ +--------------+ +--------------+
+ * b_u_newhead--->| u_header | | u_header | | u_header |
+ * | uh_next------>| uh_next------>| uh_next---->NULL
+ * NULL<--------uh_prev |<---------uh_prev |<---------uh_prev |
+ * | uh_entry | | uh_entry | | uh_entry |
+ * +--------|-----+ +--------|-----+ +--------|-----+
+ * | | |
+ * V V V
+ * +--------------+ +--------------+ +--------------+
+ * | u_entry | | u_entry | | u_entry |
+ * | ue_next | | ue_next | | ue_next |
+ * +--------|-----+ +--------|-----+ +--------|-----+
+ * | | |
+ * V V V
+ * +--------------+ NULL NULL
+ * | u_entry |
+ * | ue_next |
+ * +--------|-----+
+ * |
+ * V
+ * etc.
+ *
+ * Each u_entry list contains the information for one undo or redo.
+ * curbuf->b_u_curhead points to the header of the last undo (the next redo),
+ * or is NULL if nothing has been undone.
+ *
+ * All data is allocated with u_alloc_line(), thus it will be freed as soon as
+ * we switch files!
+ */
+
+#include "vim.h"
+
+static u_entry_T *u_get_headentry __ARGS((void));
+static void u_getbot __ARGS((void));
+static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
+static void u_doit __ARGS((int count));
+static void u_undoredo __ARGS((void));
+static void u_undo_end __ARGS((void));
+static void u_freelist __ARGS((struct u_header *));
+static void u_freeentry __ARGS((u_entry_T *, long));
+
+static char_u *u_blockalloc __ARGS((long_u));
+static void u_free_line __ARGS((char_u *, int keep));
+static char_u *u_alloc_line __ARGS((unsigned));
+static char_u *u_save_line __ARGS((linenr_T));
+
+static long u_newcount, u_oldcount;
+
+/*
+ * When 'u' flag included in 'cpoptions', we behave like vi. Need to remember
+ * the action that "u" should do.
+ */
+static int undo_undoes = FALSE;
+
+/*
+ * save the current line for both the "u" and "U" command
+ */
+ int
+u_save_cursor()
+{
+ return (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
+ (linenr_T)(curwin->w_cursor.lnum + 1)));
+}
+
+/*
+ * Save the lines between "top" and "bot" for both the "u" and "U" command.
+ * "top" may be 0 and bot may be curbuf->b_ml.ml_line_count + 1.
+ * Returns FAIL when lines could not be saved, OK otherwise.
+ */
+ int
+u_save(top, bot)
+ linenr_T top, bot;
+{
+ if (undo_off)
+ return OK;
+
+ if (top > curbuf->b_ml.ml_line_count ||
+ top >= bot || bot > curbuf->b_ml.ml_line_count + 1)
+ return FALSE; /* rely on caller to do error messages */
+
+ if (top + 2 == bot)
+ u_saveline((linenr_T)(top + 1));
+
+ return (u_savecommon(top, bot, (linenr_T)0));
+}
+
+/*
+ * save the line "lnum" (used by ":s" and "~" command)
+ * The line is replaced, so the new bottom line is lnum + 1.
+ */
+ int
+u_savesub(lnum)
+ linenr_T lnum;
+{
+ if (undo_off)
+ return OK;
+
+ return (u_savecommon(lnum - 1, lnum + 1, lnum + 1));
+}
+
+/*
+ * a new line is inserted before line "lnum" (used by :s command)
+ * The line is inserted, so the new bottom line is lnum + 1.
+ */
+ int
+u_inssub(lnum)
+ linenr_T lnum;
+{
+ if (undo_off)
+ return OK;
+
+ return (u_savecommon(lnum - 1, lnum, lnum + 1));
+}
+
+/*
+ * save the lines "lnum" - "lnum" + nlines (used by delete command)
+ * The lines are deleted, so the new bottom line is lnum, unless the buffer
+ * becomes empty.
+ */
+ int
+u_savedel(lnum, nlines)
+ linenr_T lnum;
+ long nlines;
+{
+ if (undo_off)
+ return OK;
+
+ return (u_savecommon(lnum - 1, lnum + nlines,
+ nlines == curbuf->b_ml.ml_line_count ? 2 : lnum));
+}
+
+ static int
+u_savecommon(top, bot, newbot)
+ linenr_T top, bot;
+ linenr_T newbot;
+{
+ linenr_T lnum;
+ long i;
+ struct u_header *uhp;
+ u_entry_T *uep;
+ u_entry_T *prev_uep;
+ long size;
+
+ /*
+ * Don't allow changes when 'modifiable' is off. Letting the
+ * undo fail is a crude way to make all change commands fail.
+ */
+ if (!curbuf->b_p_ma)
+ {
+ EMSG(_(e_modifiable));
+ return FAIL;
+ }
+
+#ifdef HAVE_SANDBOX
+ /*
+ * In the sandbox it's not allowed to change the text. Letting the
+ * undo fail is a crude way to make all change commands fail.
+ */
+ if (sandbox != 0)
+ {
+ EMSG(_(e_sandbox));
+ return FAIL;
+ }
+#endif
+
+#ifdef FEAT_NETBEANS_INTG
+ /*
+ * Netbeans defines areas that cannot be modified. Bail out here when
+ * trying to change text in a guarded area.
+ */
+ if (usingNetbeans && netbeans_is_guarded(top, bot))
+ {
+ EMSG(_(e_guarded));
+ return FAIL;
+ }
+#endif
+
+#ifdef FEAT_AUTOCMD
+ /*
+ * Saving text for undo means we are going to make a change. Give a
+ * warning for a read-only file before making the change, so that the
+ * FileChangedRO event can replace the buffer with a read-write version
+ * (e.g., obtained from a source control system).
+ */
+ change_warning(0);
+#endif
+
+ size = bot - top - 1;
+
+ /*
+ * if curbuf->b_u_synced == TRUE make a new header
+ */
+ if (curbuf->b_u_synced)
+ {
+#ifdef FEAT_JUMPLIST
+ /* Need to create new entry in b_changelist. */
+ curbuf->b_new_change = TRUE;
+#endif
+
+ /*
+ * if we undid more than we redid, free the entry lists before and
+ * including curbuf->b_u_curhead
+ */
+ while (curbuf->b_u_curhead != NULL)
+ u_freelist(curbuf->b_u_newhead);
+
+ /*
+ * free headers to keep the size right
+ */
+ while (curbuf->b_u_numhead > p_ul && curbuf->b_u_oldhead != NULL)
+ u_freelist(curbuf->b_u_oldhead);
+
+ if (p_ul < 0) /* no undo at all */
+ {
+ curbuf->b_u_synced = FALSE;
+ return OK;
+ }
+
+ /*
+ * make a new header entry
+ */
+ uhp = (struct u_header *)u_alloc_line((unsigned)
+ sizeof(struct u_header));
+ if (uhp == NULL)
+ goto nomem;
+ uhp->uh_prev = NULL;
+ uhp->uh_next = curbuf->b_u_newhead;
+ if (curbuf->b_u_newhead != NULL)
+ curbuf->b_u_newhead->uh_prev = uhp;
+ uhp->uh_entry = NULL;
+ uhp->uh_getbot_entry = NULL;
+ uhp->uh_cursor = curwin->w_cursor; /* save cursor pos. for undo */
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active() && curwin->w_cursor.coladd > 0)
+ uhp->uh_cursor_vcol = getviscol();
+ else
+ uhp->uh_cursor_vcol = -1;
+#endif
+
+ /* save changed and buffer empty flag for undo */
+ uhp->uh_flags = (curbuf->b_changed ? UH_CHANGED : 0) +
+ ((curbuf->b_ml.ml_flags & ML_EMPTY) ? UH_EMPTYBUF : 0);
+
+ /* save named marks for undo */
+ mch_memmove(uhp->uh_namedm, curbuf->b_namedm, sizeof(pos_T) * NMARKS);
+ curbuf->b_u_newhead = uhp;
+ if (curbuf->b_u_oldhead == NULL)
+ curbuf->b_u_oldhead = uhp;
+ ++curbuf->b_u_numhead;
+ }
+ else
+ {
+ if (p_ul < 0) /* no undo at all */
+ return OK;
+
+ /*
+ * When saving a single line, and it has been saved just before, it
+ * doesn't make sense saving it again. Saves a lot of memory when
+ * making lots of changes inside the same line.
+ * This is only possible if the previous change didn't increase or
+ * decrease the number of lines.
+ * Check the ten last changes. More doesn't make sense and takes too
+ * long.
+ */
+ if (size == 1)
+ {
+ uep = u_get_headentry();
+ prev_uep = NULL;
+ for (i = 0; i < 10; ++i)
+ {
+ if (uep == NULL)
+ break;
+
+ /* If lines have been inserted/deleted we give up.
+ * Also when the line was included in a multi-line save. */
+ if ((curbuf->b_u_newhead->uh_getbot_entry != uep
+ ? (uep->ue_top + uep->ue_size + 1
+ != (uep->ue_bot == 0
+ ? curbuf->b_ml.ml_line_count + 1
+ : uep->ue_bot))
+ : uep->ue_lcount != curbuf->b_ml.ml_line_count)
+ || (uep->ue_size > 1
+ && top >= uep->ue_top
+ && top + 2 <= uep->ue_top + uep->ue_size + 1))
+ break;
+
+ /* If it's the same line we can skip saving it again. */
+ if (uep->ue_size == 1 && uep->ue_top == top)
+ {
+ if (i > 0)
+ {
+ /* It's not the last entry: get ue_bot for the last
+ * entry now. Following deleted/inserted lines go to
+ * the re-used entry. */
+ u_getbot();
+ curbuf->b_u_synced = FALSE;
+
+ /* Move the found entry to become the last entry. The
+ * order of undo/redo doesn't matter for the entries
+ * we move it over, since they don't change the line
+ * count and don't include this line. It does matter
+ * for the found entry if the line count is changed by
+ * the executed command. */
+ prev_uep->ue_next = uep->ue_next;
+ uep->ue_next = curbuf->b_u_newhead->uh_entry;
+ curbuf->b_u_newhead->uh_entry = uep;
+ }
+
+ /* The executed command may change the line count. */
+ if (newbot != 0)
+ uep->ue_bot = newbot;
+ else if (bot > curbuf->b_ml.ml_line_count)
+ uep->ue_bot = 0;
+ else
+ {
+ uep->ue_lcount = curbuf->b_ml.ml_line_count;
+ curbuf->b_u_newhead->uh_getbot_entry = uep;
+ }
+ return OK;
+ }
+ prev_uep = uep;
+ uep = uep->ue_next;
+ }
+ }
+
+ /* find line number for ue_bot for previous u_save() */
+ u_getbot();
+ }
+
+#if !defined(UNIX) && !defined(DJGPP) && !defined(WIN32) && !defined(__EMX__)
+ /*
+ * With Amiga and MSDOS 16 bit we can't handle big undo's, because
+ * then u_alloc_line would have to allocate a block larger than 32K
+ */
+ if (size >= 8000)
+ goto nomem;
+#endif
+
+ /*
+ * add lines in front of entry list
+ */
+ uep = (u_entry_T *)u_alloc_line((unsigned)sizeof(u_entry_T));
+ if (uep == NULL)
+ goto nomem;
+
+ uep->ue_size = size;
+ uep->ue_top = top;
+ if (newbot != 0)
+ uep->ue_bot = newbot;
+ /*
+ * Use 0 for ue_bot if bot is below last line.
+ * Otherwise we have to compute ue_bot later.
+ */
+ else if (bot > curbuf->b_ml.ml_line_count)
+ uep->ue_bot = 0;
+ else
+ {
+ uep->ue_lcount = curbuf->b_ml.ml_line_count;
+ curbuf->b_u_newhead->uh_getbot_entry = uep;
+ }
+
+ if (size)
+ {
+ if ((uep->ue_array = (char_u **)u_alloc_line(
+ (unsigned)(sizeof(char_u *) * size))) == NULL)
+ {
+ u_freeentry(uep, 0L);
+ goto nomem;
+ }
+ for (i = 0, lnum = top + 1; i < size; ++i)
+ {
+ if ((uep->ue_array[i] = u_save_line(lnum++)) == NULL)
+ {
+ u_freeentry(uep, i);
+ goto nomem;
+ }
+ }
+ }
+ uep->ue_next = curbuf->b_u_newhead->uh_entry;
+ curbuf->b_u_newhead->uh_entry = uep;
+ curbuf->b_u_synced = FALSE;
+ undo_undoes = FALSE;
+
+ return OK;
+
+nomem:
+ msg_silent = 0; /* must display the prompt */
+ if (ask_yesno((char_u *)_("No undo possible; continue anyway"), TRUE)
+ == 'y')
+ {
+ undo_off = TRUE; /* will be reset when character typed */
+ return OK;
+ }
+ do_outofmem_msg((long_u)0);
+ return FAIL;
+}
+
+/*
+ * If 'cpoptions' contains 'u': Undo the previous undo or redo (vi compatible).
+ * If 'cpoptions' does not contain 'u': Always undo.
+ */
+ void
+u_undo(count)
+ int count;
+{
+ /*
+ * If we get an undo command while executing a macro, we behave like the
+ * original vi. If this happens twice in one macro the result will not
+ * be compatible.
+ */
+ if (curbuf->b_u_synced == FALSE)
+ {
+ u_sync();
+ count = 1;
+ }
+
+ if (vim_strchr(p_cpo, CPO_UNDO) == NULL)
+ undo_undoes = TRUE;
+ else
+ undo_undoes = !undo_undoes;
+ u_doit(count);
+}
+
+/*
+ * If 'cpoptions' contains 'u': Repeat the previous undo or redo.
+ * If 'cpoptions' does not contain 'u': Always redo.
+ */
+ void
+u_redo(count)
+ int count;
+{
+ if (vim_strchr(p_cpo, CPO_UNDO) == NULL)
+ undo_undoes = FALSE;
+ u_doit(count);
+}
+
+/*
+ * Undo or redo, depending on 'undo_undoes', 'count' times.
+ */
+ static void
+u_doit(count)
+ int count;
+{
+ /* Don't allow changes when 'modifiable' is off. */
+ if (!curbuf->b_p_ma)
+ {
+ EMSG(_(e_modifiable));
+ return;
+ }
+#ifdef HAVE_SANDBOX
+ /* In the sandbox it's not allowed to change the text. */
+ if (sandbox != 0)
+ {
+ EMSG(_(e_sandbox));
+ return;
+ }
+#endif
+
+ u_newcount = 0;
+ u_oldcount = 0;
+ while (count--)
+ {
+ if (undo_undoes)
+ {
+ if (curbuf->b_u_curhead == NULL) /* first undo */
+ curbuf->b_u_curhead = curbuf->b_u_newhead;
+ else if (p_ul > 0) /* multi level undo */
+ /* get next undo */
+ curbuf->b_u_curhead = curbuf->b_u_curhead->uh_next;
+ /* nothing to undo */
+ if (curbuf->b_u_numhead == 0 || curbuf->b_u_curhead == NULL)
+ {
+ /* stick curbuf->b_u_curhead at end */
+ curbuf->b_u_curhead = curbuf->b_u_oldhead;
+ beep_flush();
+ break;
+ }
+
+ u_undoredo();
+ }
+ else
+ {
+ if (curbuf->b_u_curhead == NULL || p_ul <= 0)
+ {
+ beep_flush(); /* nothing to redo */
+ break;
+ }
+
+ u_undoredo();
+ /* advance for next redo */
+ curbuf->b_u_curhead = curbuf->b_u_curhead->uh_prev;
+ }
+ }
+ u_undo_end();
+}
+
+/*
+ * u_undoredo: common code for undo and redo
+ *
+ * The lines in the file are replaced by the lines in the entry list at
+ * curbuf->b_u_curhead. The replaced lines in the file are saved in the entry
+ * list for the next undo/redo.
+ */
+ static void
+u_undoredo()
+{
+ char_u **newarray = NULL;
+ linenr_T oldsize;
+ linenr_T newsize;
+ linenr_T top, bot;
+ linenr_T lnum;
+ linenr_T newlnum = MAXLNUM;
+ long i;
+ u_entry_T *uep, *nuep;
+ u_entry_T *newlist = NULL;
+ int old_flags;
+ int new_flags;
+ pos_T namedm[NMARKS];
+ int empty_buffer; /* buffer became empty */
+
+ old_flags = curbuf->b_u_curhead->uh_flags;
+ new_flags = (curbuf->b_changed ? UH_CHANGED : 0) +
+ ((curbuf->b_ml.ml_flags & ML_EMPTY) ? UH_EMPTYBUF : 0);
+ setpcmark();
+
+ /*
+ * save marks before undo/redo
+ */
+ mch_memmove(namedm, curbuf->b_namedm, sizeof(pos_T) * NMARKS);
+ curbuf->b_op_start.lnum = curbuf->b_ml.ml_line_count;
+ curbuf->b_op_start.col = 0;
+ curbuf->b_op_end.lnum = 0;
+ curbuf->b_op_end.col = 0;
+
+ for (uep = curbuf->b_u_curhead->uh_entry; uep != NULL; uep = nuep)
+ {
+ top = uep->ue_top;
+ bot = uep->ue_bot;
+ if (bot == 0)
+ bot = curbuf->b_ml.ml_line_count + 1;
+ if (top > curbuf->b_ml.ml_line_count || top >= bot
+ || bot > curbuf->b_ml.ml_line_count + 1)
+ {
+ EMSG(_("E438: u_undo: line numbers wrong"));
+ changed(); /* don't want UNCHANGED now */
+ return;
+ }
+
+ oldsize = bot - top - 1; /* number of lines before undo */
+ newsize = uep->ue_size; /* number of lines after undo */
+
+ if (top < newlnum)
+ {
+ /* If the saved cursor is somewhere in this undo block, move it to
+ * the remembered position. Makes "gwap" put the cursor back
+ * where it was. */
+ lnum = curbuf->b_u_curhead->uh_cursor.lnum;
+ if (lnum >= top && lnum <= top + newsize + 1)
+ {
+ curwin->w_cursor = curbuf->b_u_curhead->uh_cursor;
+ newlnum = curwin->w_cursor.lnum - 1;
+ }
+ else
+ {
+ /* Use the first line that actually changed. Avoids that
+ * undoing auto-formatting puts the cursor in the previous
+ * line. */
+ for (i = 0; i < newsize && i < oldsize; ++i)
+ if (STRCMP(uep->ue_array[i], ml_get(top + 1 + i)) != 0)
+ break;
+ if (i == newsize && newlnum == MAXLNUM && uep->ue_next == NULL)
+ {
+ newlnum = top;
+ curwin->w_cursor.lnum = newlnum + 1;
+ }
+ else if (i < newsize)
+ {
+ newlnum = top + i;
+ curwin->w_cursor.lnum = newlnum + 1;
+ }
+ }
+ }
+
+ empty_buffer = FALSE;
+
+ /* delete the lines between top and bot and save them in newarray */
+ if (oldsize)
+ {
+ if ((newarray = (char_u **)u_alloc_line(
+ (unsigned)(sizeof(char_u *) * oldsize))) == NULL)
+ {
+ do_outofmem_msg((long_u)(sizeof(char_u *) * oldsize));
+ /*
+ * We have messed up the entry list, repair is impossible.
+ * we have to free the rest of the list.
+ */
+ while (uep != NULL)
+ {
+ nuep = uep->ue_next;
+ u_freeentry(uep, uep->ue_size);
+ uep = nuep;
+ }
+ break;
+ }
+ /* delete backwards, it goes faster in most cases */
+ for (lnum = bot - 1, i = oldsize; --i >= 0; --lnum)
+ {
+ /* what can we do when we run out of memory? */
+ if ((newarray[i] = u_save_line(lnum)) == NULL)
+ do_outofmem_msg((long_u)0);
+ /* remember we deleted the last line in the buffer, and a
+ * dummy empty line will be inserted */
+ if (curbuf->b_ml.ml_line_count == 1)
+ empty_buffer = TRUE;
+ ml_delete(lnum, FALSE);
+ }
+ }
+
+ /* insert the lines in u_array between top and bot */
+ if (newsize)
+ {
+ for (lnum = top, i = 0; i < newsize; ++i, ++lnum)
+ {
+ /*
+ * If the file is empty, there is an empty line 1 that we
+ * should get rid of, by replacing it with the new line
+ */
+ if (empty_buffer && lnum == 0)
+ ml_replace((linenr_T)1, uep->ue_array[i], TRUE);
+ else
+ ml_append(lnum, uep->ue_array[i], (colnr_T)0, FALSE);
+ u_free_line(uep->ue_array[i], FALSE);
+ }
+ u_free_line((char_u *)uep->ue_array, FALSE);
+ }
+
+ /* adjust marks */
+ if (oldsize != newsize)
+ {
+ mark_adjust(top + 1, top + oldsize, (long)MAXLNUM,
+ (long)newsize - (long)oldsize);
+ if (curbuf->b_op_start.lnum > top + oldsize)
+ curbuf->b_op_start.lnum += newsize - oldsize;
+ if (curbuf->b_op_end.lnum > top + oldsize)
+ curbuf->b_op_end.lnum += newsize - oldsize;
+ }
+
+ changed_lines(top + 1, 0, bot, newsize - oldsize);
+
+ /* set '[ and '] mark */
+ if (top + 1 < curbuf->b_op_start.lnum)
+ curbuf->b_op_start.lnum = top + 1;
+ if (newsize == 0 && top + 1 > curbuf->b_op_end.lnum)
+ curbuf->b_op_end.lnum = top + 1;
+ else if (top + newsize > curbuf->b_op_end.lnum)
+ curbuf->b_op_end.lnum = top + newsize;
+
+ u_newcount += newsize;
+ u_oldcount += oldsize;
+ uep->ue_size = oldsize;
+ uep->ue_array = newarray;
+ uep->ue_bot = top + newsize + 1;
+
+ /*
+ * insert this entry in front of the new entry list
+ */
+ nuep = uep->ue_next;
+ uep->ue_next = newlist;
+ newlist = uep;
+ }
+
+ curbuf->b_u_curhead->uh_entry = newlist;
+ curbuf->b_u_curhead->uh_flags = new_flags;
+ if ((old_flags & UH_EMPTYBUF) && bufempty())
+ curbuf->b_ml.ml_flags |= ML_EMPTY;
+ if (old_flags & UH_CHANGED)
+ changed();
+ else
+ unchanged(curbuf, FALSE);
+
+ /*
+ * restore marks from before undo/redo
+ */
+ for (i = 0; i < NMARKS; ++i)
+ if (curbuf->b_u_curhead->uh_namedm[i].lnum)
+ {
+ curbuf->b_namedm[i] = curbuf->b_u_curhead->uh_namedm[i];
+ curbuf->b_u_curhead->uh_namedm[i] = namedm[i];
+ }
+
+ /*
+ * If the cursor is only off by one line, put it at the same position as
+ * before starting the change (for the "o" command).
+ * Otherwise the cursor should go to the first undone line.
+ */
+ if (curbuf->b_u_curhead->uh_cursor.lnum + 1 == curwin->w_cursor.lnum
+ && curwin->w_cursor.lnum > 1)
+ --curwin->w_cursor.lnum;
+ if (curbuf->b_u_curhead->uh_cursor.lnum == curwin->w_cursor.lnum)
+ {
+ curwin->w_cursor.col = curbuf->b_u_curhead->uh_cursor.col;
+#ifdef FEAT_VIRTUALEDIT
+ if (virtual_active() && curbuf->b_u_curhead->uh_cursor_vcol >= 0)
+ coladvance((colnr_T)curbuf->b_u_curhead->uh_cursor_vcol);
+ else
+ curwin->w_cursor.coladd = 0;
+#endif
+ }
+ else if (curwin->w_cursor.lnum <= curbuf->b_ml.ml_line_count)
+ beginline(BL_SOL | BL_FIX);
+ else
+ {
+ /* We get here with the current cursor line being past the end (eg
+ * after adding lines at the end of the file, and then undoing it).
+ * check_cursor() will move the cursor to the last line. Move it to
+ * the first column here. */
+ curwin->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ curwin->w_cursor.coladd = 0;
+#endif
+ }
+
+ /* Make sure the cursor is on an existing line and column. */
+ check_cursor();
+}
+
+/*
+ * If we deleted or added lines, report the number of less/more lines.
+ * Otherwise, report the number of changes (this may be incorrect
+ * in some cases, but it's better than nothing).
+ */
+ static void
+u_undo_end()
+{
+ if ((u_oldcount -= u_newcount) != 0)
+ msgmore(-u_oldcount);
+ else if (u_newcount > p_report)
+ {
+ if (u_newcount == 1)
+ MSG(_("1 change"));
+ else
+ smsg((char_u *)_("%ld changes"), u_newcount);
+ }
+#ifdef FEAT_FOLDING
+ if ((fdo_flags & FDO_UNDO) && KeyTyped)
+ foldOpenCursor();
+#endif
+}
+
+/*
+ * u_sync: stop adding to the current entry list
+ */
+ void
+u_sync()
+{
+ if (curbuf->b_u_synced)
+ return; /* already synced */
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+ if (im_is_preediting())
+ return; /* XIM is busy, don't break an undo sequence */
+#endif
+ if (p_ul < 0)
+ curbuf->b_u_synced = TRUE; /* no entries, nothing to do */
+ else
+ {
+ u_getbot(); /* compute ue_bot of previous u_save */
+ curbuf->b_u_curhead = NULL;
+ }
+}
+
+/*
+ * Called after writing the file and setting b_changed to FALSE.
+ * Now an undo means that the buffer is modified.
+ */
+ void
+u_unchanged(buf)
+ buf_T *buf;
+{
+ struct u_header *uh;
+
+ for (uh = buf->b_u_newhead; uh; uh = uh->uh_next)
+ uh->uh_flags |= UH_CHANGED;
+ buf->b_did_warn = FALSE;
+}
+
+/*
+ * Get pointer to last added entry.
+ * If it's not valid, give an error message and return NULL.
+ */
+ static u_entry_T *
+u_get_headentry()
+{
+ if (curbuf->b_u_newhead == NULL || curbuf->b_u_newhead->uh_entry == NULL)
+ {
+ EMSG(_("E439: undo list corrupt"));
+ return NULL;
+ }
+ return curbuf->b_u_newhead->uh_entry;
+}
+
+/*
+ * u_getbot(): compute the line number of the previous u_save
+ * It is called only when b_u_synced is FALSE.
+ */
+ static void
+u_getbot()
+{
+ u_entry_T *uep;
+ linenr_T extra;
+
+ uep = u_get_headentry(); /* check for corrupt undo list */
+ if (uep == NULL)
+ return;
+
+ uep = curbuf->b_u_newhead->uh_getbot_entry;
+ if (uep != NULL)
+ {
+ /*
+ * the new ue_bot is computed from the number of lines that has been
+ * inserted (0 - deleted) since calling u_save. This is equal to the
+ * old line count subtracted from the current line count.
+ */
+ extra = curbuf->b_ml.ml_line_count - uep->ue_lcount;
+ uep->ue_bot = uep->ue_top + uep->ue_size + 1 + extra;
+ if (uep->ue_bot < 1 || uep->ue_bot > curbuf->b_ml.ml_line_count)
+ {
+ EMSG(_("E440: undo line missing"));
+ uep->ue_bot = uep->ue_top + 1; /* assume all lines deleted, will
+ * get all the old lines back
+ * without deleting the current
+ * ones */
+ }
+
+ curbuf->b_u_newhead->uh_getbot_entry = NULL;
+ }
+
+ curbuf->b_u_synced = TRUE;
+}
+
+/*
+ * u_freelist: free one entry list and adjust the pointers
+ */
+ static void
+u_freelist(uhp)
+ struct u_header *uhp;
+{
+ u_entry_T *uep, *nuep;
+
+ for (uep = uhp->uh_entry; uep != NULL; uep = nuep)
+ {
+ nuep = uep->ue_next;
+ u_freeentry(uep, uep->ue_size);
+ }
+
+ if (curbuf->b_u_curhead == uhp)
+ curbuf->b_u_curhead = NULL;
+
+ if (uhp->uh_next == NULL)
+ curbuf->b_u_oldhead = uhp->uh_prev;
+ else
+ uhp->uh_next->uh_prev = uhp->uh_prev;
+
+ if (uhp->uh_prev == NULL)
+ curbuf->b_u_newhead = uhp->uh_next;
+ else
+ uhp->uh_prev->uh_next = uhp->uh_next;
+
+ u_free_line((char_u *)uhp, FALSE);
+ --curbuf->b_u_numhead;
+}
+
+/*
+ * free entry 'uep' and 'n' lines in uep->ue_array[]
+ */
+ static void
+u_freeentry(uep, n)
+ u_entry_T *uep;
+ long n;
+{
+ while (n)
+ u_free_line(uep->ue_array[--n], FALSE);
+ u_free_line((char_u *)uep, FALSE);
+}
+
+/*
+ * invalidate the undo buffer; called when storage has already been released
+ */
+ void
+u_clearall(buf)
+ buf_T *buf;
+{
+ buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL;
+ buf->b_u_synced = TRUE;
+ buf->b_u_numhead = 0;
+ buf->b_u_line_ptr = NULL;
+ buf->b_u_line_lnum = 0;
+}
+
+/*
+ * save the line "lnum" for the "U" command
+ */
+ void
+u_saveline(lnum)
+ linenr_T lnum;
+{
+ if (lnum == curbuf->b_u_line_lnum) /* line is already saved */
+ return;
+ if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) /* should never happen */
+ return;
+ u_clearline();
+ curbuf->b_u_line_lnum = lnum;
+ if (curwin->w_cursor.lnum == lnum)
+ curbuf->b_u_line_colnr = curwin->w_cursor.col;
+ else
+ curbuf->b_u_line_colnr = 0;
+ if ((curbuf->b_u_line_ptr = u_save_line(lnum)) == NULL)
+ do_outofmem_msg((long_u)0);
+}
+
+/*
+ * clear the line saved for the "U" command
+ * (this is used externally for crossing a line while in insert mode)
+ */
+ void
+u_clearline()
+{
+ if (curbuf->b_u_line_ptr != NULL)
+ {
+ u_free_line(curbuf->b_u_line_ptr, FALSE);
+ curbuf->b_u_line_ptr = NULL;
+ curbuf->b_u_line_lnum = 0;
+ }
+}
+
+/*
+ * Implementation of the "U" command.
+ * Differentiation from vi: "U" can be undone with the next "U".
+ * We also allow the cursor to be in another line.
+ */
+ void
+u_undoline()
+{
+ colnr_T t;
+ char_u *oldp;
+
+ if (undo_off)
+ return;
+
+ if (curbuf->b_u_line_ptr == NULL ||
+ curbuf->b_u_line_lnum > curbuf->b_ml.ml_line_count)
+ {
+ beep_flush();
+ return;
+ }
+ /* first save the line for the 'u' command */
+ if (u_savecommon(curbuf->b_u_line_lnum - 1,
+ curbuf->b_u_line_lnum + 1, (linenr_T)0) == FAIL)
+ return;
+ oldp = u_save_line(curbuf->b_u_line_lnum);
+ if (oldp == NULL)
+ {
+ do_outofmem_msg((long_u)0);
+ return;
+ }
+ ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, TRUE);
+ changed_bytes(curbuf->b_u_line_lnum, 0);
+ u_free_line(curbuf->b_u_line_ptr, FALSE);
+ curbuf->b_u_line_ptr = oldp;
+
+ t = curbuf->b_u_line_colnr;
+ if (curwin->w_cursor.lnum == curbuf->b_u_line_lnum)
+ curbuf->b_u_line_colnr = curwin->w_cursor.col;
+ curwin->w_cursor.col = t;
+ curwin->w_cursor.lnum = curbuf->b_u_line_lnum;
+}
+
+/*
+ * storage allocation for the undo lines and blocks of the current file
+ */
+
+/*
+ * Memory is allocated in relatively large blocks. These blocks are linked
+ * in the allocated block list, headed by curbuf->b_block_head. They are all
+ * freed when abandoning a file, so we don't have to free every single line.
+ * The list is kept sorted on memory address.
+ * block_alloc() allocates a block.
+ * m_blockfree() frees all blocks.
+ *
+ * The available chunks of memory are kept in free chunk lists. There is
+ * one free list for each block of allocated memory. The list is kept sorted
+ * on memory address.
+ * u_alloc_line() gets a chunk from the free lists.
+ * u_free_line() returns a chunk to the free lists.
+ * curbuf->b_m_search points to the chunk before the chunk that was
+ * freed/allocated the last time.
+ * curbuf->b_mb_current points to the b_head where curbuf->b_m_search
+ * points into the free list.
+ *
+ *
+ * b_block_head /---> block #1 /---> block #2
+ * mb_next ---/ mb_next ---/ mb_next ---> NULL
+ * mb_info mb_info mb_info
+ * | | |
+ * V V V
+ * NULL free chunk #1.1 free chunk #2.1
+ * | |
+ * V V
+ * free chunk #1.2 NULL
+ * |
+ * V
+ * NULL
+ *
+ * When a single free chunk list would have been used, it could take a lot
+ * of time in u_free_line() to find the correct place to insert a chunk in the
+ * free list. The single free list would become very long when many lines are
+ * changed (e.g. with :%s/^M$//).
+ */
+
+ /*
+ * this blocksize is used when allocating new lines
+ */
+#define MEMBLOCKSIZE 2044
+
+/*
+ * The size field contains the size of the chunk, including the size field
+ * itself.
+ *
+ * When the chunk is not in-use it is preceded with the m_info structure.
+ * The m_next field links it in one of the free chunk lists.
+ *
+ * On most unix systems structures have to be longword (32 or 64 bit) aligned.
+ * On most other systems they are short (16 bit) aligned.
+ */
+
+/* the structure definitions are now in structs.h */
+
+#ifdef ALIGN_LONG
+ /* size of m_size */
+# define M_OFFSET (sizeof(long_u))
+#else
+ /* size of m_size */
+# define M_OFFSET (sizeof(short_u))
+#endif
+
+/*
+ * Allocate a block of memory and link it in the allocated block list.
+ */
+ static char_u *
+u_blockalloc(size)
+ long_u size;
+{
+ mblock_T *p;
+ mblock_T *mp, *next;
+
+ p = (mblock_T *)lalloc(size + sizeof(mblock_T), FALSE);
+ if (p != NULL)
+ {
+ /* Insert the block into the allocated block list, keeping it
+ sorted on address. */
+ for (mp = &curbuf->b_block_head;
+ (next = mp->mb_next) != NULL && next < p;
+ mp = next)
+ ;
+ p->mb_next = next; /* link in block list */
+ p->mb_size = size;
+ mp->mb_next = p;
+ p->mb_info.m_next = NULL; /* clear free list */
+ p->mb_info.m_size = 0;
+ curbuf->b_mb_current = p; /* remember current block */
+ curbuf->b_m_search = NULL;
+ p++; /* return usable memory */
+ }
+ return (char_u *)p;
+}
+
+/*
+ * free all allocated memory blocks for the buffer 'buf'
+ */
+ void
+u_blockfree(buf)
+ buf_T *buf;
+{
+ mblock_T *p, *np;
+
+ for (p = buf->b_block_head.mb_next; p != NULL; p = np)
+ {
+ np = p->mb_next;
+ vim_free(p);
+ }
+ buf->b_block_head.mb_next = NULL;
+ buf->b_m_search = NULL;
+ buf->b_mb_current = NULL;
+}
+
+/*
+ * Free a chunk of memory for the current buffer.
+ * Insert the chunk into the correct free list, keeping it sorted on address.
+ */
+ static void
+u_free_line(ptr, keep)
+ char_u *ptr;
+ int keep; /* don't free the block when it's empty */
+{
+ minfo_T *next;
+ minfo_T *prev, *curr;
+ minfo_T *mp;
+ mblock_T *nextb;
+ mblock_T *prevb;
+
+ if (ptr == NULL || ptr == IObuff)
+ return; /* illegal address can happen in out-of-memory situations */
+
+ mp = (minfo_T *)(ptr - M_OFFSET);
+
+ /* find block where chunk could be a part off */
+ /* if we change curbuf->b_mb_current, curbuf->b_m_search is set to NULL */
+ if (curbuf->b_mb_current == NULL || mp < (minfo_T *)curbuf->b_mb_current)
+ {
+ curbuf->b_mb_current = curbuf->b_block_head.mb_next;
+ curbuf->b_m_search = NULL;
+ }
+ if ((nextb = curbuf->b_mb_current->mb_next) != NULL
+ && (minfo_T *)nextb < mp)
+ {
+ curbuf->b_mb_current = nextb;
+ curbuf->b_m_search = NULL;
+ }
+ while ((nextb = curbuf->b_mb_current->mb_next) != NULL
+ && (minfo_T *)nextb < mp)
+ curbuf->b_mb_current = nextb;
+
+ curr = NULL;
+ /*
+ * If mp is smaller than curbuf->b_m_search->m_next go to the start of
+ * the free list
+ */
+ if (curbuf->b_m_search == NULL || mp < (curbuf->b_m_search->m_next))
+ next = &(curbuf->b_mb_current->mb_info);
+ else
+ next = curbuf->b_m_search;
+ /*
+ * The following loop is executed very often.
+ * Therefore it has been optimized at the cost of readability.
+ * Keep it fast!
+ */
+#ifdef SLOW_BUT_EASY_TO_READ
+ do
+ {
+ prev = curr;
+ curr = next;
+ next = next->m_next;
+ }
+ while (mp > next && next != NULL);
+#else
+ do /* first, middle, last */
+ {
+ prev = next->m_next; /* curr, next, prev */
+ if (prev == NULL || mp <= prev)
+ {
+ prev = curr;
+ curr = next;
+ next = next->m_next;
+ break;
+ }
+ curr = prev->m_next; /* next, prev, curr */
+ if (curr == NULL || mp <= curr)
+ {
+ prev = next;
+ curr = prev->m_next;
+ next = curr->m_next;
+ break;
+ }
+ next = curr->m_next; /* prev, curr, next */
+ }
+ while (mp > next && next != NULL);
+#endif
+
+ /* if *mp and *next are concatenated, join them into one chunk */
+ if ((char_u *)mp + mp->m_size == (char_u *)next)
+ {
+ mp->m_size += next->m_size;
+ mp->m_next = next->m_next;
+ }
+ else
+ mp->m_next = next;
+
+ /* if *curr and *mp are concatenated, join them */
+ if (prev != NULL && (char_u *)curr + curr->m_size == (char_u *)mp)
+ {
+ curr->m_size += mp->m_size;
+ curr->m_next = mp->m_next;
+ curbuf->b_m_search = prev;
+ }
+ else
+ {
+ curr->m_next = mp;
+ curbuf->b_m_search = curr; /* put curbuf->b_m_search before freed
+ chunk */
+ }
+
+ /*
+ * If the block only containes free memory now, release it.
+ */
+ if (!keep && curbuf->b_mb_current->mb_size
+ == curbuf->b_mb_current->mb_info.m_next->m_size)
+ {
+ /* Find the block before the current one to be able to unlink it from
+ * the list of blocks. */
+ prevb = &curbuf->b_block_head;
+ for (nextb = prevb->mb_next; nextb != curbuf->b_mb_current;
+ nextb = nextb->mb_next)
+ prevb = nextb;
+ prevb->mb_next = nextb->mb_next;
+ vim_free(nextb);
+ curbuf->b_mb_current = NULL;
+ curbuf->b_m_search = NULL;
+ }
+}
+
+/*
+ * Allocate and initialize a new line structure with room for at least
+ * 'size' characters plus a terminating NUL.
+ */
+ static char_u *
+u_alloc_line(size)
+ unsigned size;
+{
+ minfo_T *mp, *mprev, *mp2;
+ mblock_T *mbp;
+ int size_align;
+
+ /*
+ * Add room for size field and trailing NUL byte.
+ * Adjust for minimal size (must be able to store minfo_T
+ * plus a trailing NUL, so the chunk can be released again)
+ */
+ size += M_OFFSET + 1;
+ if (size < sizeof(minfo_T) + 1)
+ size = sizeof(minfo_T) + 1;
+
+ /*
+ * round size up for alignment
+ */
+ size_align = (size + ALIGN_MASK) & ~ALIGN_MASK;
+
+ /*
+ * If curbuf->b_m_search is NULL (uninitialized free list) start at
+ * curbuf->b_block_head
+ */
+ if (curbuf->b_mb_current == NULL || curbuf->b_m_search == NULL)
+ {
+ curbuf->b_mb_current = &curbuf->b_block_head;
+ curbuf->b_m_search = &(curbuf->b_block_head.mb_info);
+ }
+
+ /* search for space in free list */
+ mprev = curbuf->b_m_search;
+ mbp = curbuf->b_mb_current;
+ mp = curbuf->b_m_search->m_next;
+ if (mp == NULL)
+ {
+ if (mbp->mb_next)
+ mbp = mbp->mb_next;
+ else
+ mbp = &curbuf->b_block_head;
+ mp = curbuf->b_m_search = &(mbp->mb_info);
+ }
+ while (mp->m_size < size)
+ {
+ if (mp == curbuf->b_m_search) /* back where we started in free
+ chunk list */
+ {
+ if (mbp->mb_next)
+ mbp = mbp->mb_next;
+ else
+ mbp = &curbuf->b_block_head;
+ mp = curbuf->b_m_search = &(mbp->mb_info);
+ if (mbp == curbuf->b_mb_current) /* back where we started in
+ block list */
+ {
+ int n = (size_align > (MEMBLOCKSIZE / 4)
+ ? size_align : MEMBLOCKSIZE);
+
+ mp = (minfo_T *)u_blockalloc((long_u)n);
+ if (mp == NULL)
+ return (NULL);
+ mp->m_size = n;
+ u_free_line((char_u *)mp + M_OFFSET, TRUE);
+ mp = curbuf->b_m_search;
+ mbp = curbuf->b_mb_current;
+ }
+ }
+ mprev = mp;
+ if ((mp = mp->m_next) == NULL) /* at end of the list */
+ mp = &(mbp->mb_info); /* wrap around to begin */
+ }
+
+ /* if the chunk we found is large enough, split it up in two */
+ if ((long)mp->m_size - size_align >= (long)(sizeof(minfo_T) + 1))
+ {
+ mp2 = (minfo_T *)((char_u *)mp + size_align);
+ mp2->m_size = mp->m_size - size_align;
+ mp2->m_next = mp->m_next;
+ mprev->m_next = mp2;
+ mp->m_size = size_align;
+ }
+ else /* remove *mp from the free list */
+ {
+ mprev->m_next = mp->m_next;
+ }
+ curbuf->b_m_search = mprev;
+ curbuf->b_mb_current = mbp;
+
+ mp = (minfo_T *)((char_u *)mp + M_OFFSET);
+ *(char_u *)mp = NUL; /* set the first byte to NUL */
+
+ return ((char_u *)mp);
+}
+
+/*
+ * u_save_line(): allocate memory with u_alloc_line() and copy line 'lnum'
+ * into it.
+ */
+ static char_u *
+u_save_line(lnum)
+ linenr_T lnum;
+{
+ char_u *src;
+ char_u *dst;
+ unsigned len;
+
+ src = ml_get(lnum);
+ len = (unsigned)STRLEN(src);
+ if ((dst = u_alloc_line(len)) != NULL)
+ mch_memmove(dst, src, (size_t)(len + 1));
+ return (dst);
+}
+
+/*
+ * Check if the 'modified' flag is set, or 'ff' has changed (only need to
+ * check the first character, because it can only be "dos", "unix" or "mac").
+ * "nofile" and "scratch" type buffers are considered to always be unchanged.
+ */
+ int
+bufIsChanged(buf)
+ buf_T *buf;
+{
+ return
+#ifdef FEAT_QUICKFIX
+ !bt_dontwrite(buf) &&
+#endif
+ (buf->b_changed || file_ff_differs(buf));
+}
+
+ int
+curbufIsChanged()
+{
+ return
+#ifdef FEAT_QUICKFIX
+ !bt_dontwrite(curbuf) &&
+#endif
+ (curbuf->b_changed || file_ff_differs(curbuf));
+}
diff --git a/src/uninstal.c b/src/uninstal.c
new file mode 100644
index 000000000..23c246b30
--- /dev/null
+++ b/src/uninstal.c
@@ -0,0 +1,438 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * uninstal.c: Minimalistic uninstall program for Vim on MS-Windows
+ * Removes:
+ * - the "Edit with Vim" popup menu entry
+ * - the Vim "Open With..." popup menu entry
+ * - any Vim Batch files in the path
+ * - icons for Vim on the Desktop
+ * - the Vim entry in the Start Menu
+ */
+
+/* Include common code for dosinst.c and uninstal.c. */
+#include "dosinst.h"
+
+/*
+ * Return TRUE if the user types a 'y' or 'Y', FALSE otherwise.
+ */
+ static int
+confirm(void)
+{
+ char answer[10];
+
+ fflush(stdout);
+ return (scanf(" %c", answer) == 1 && toupper(answer[0]) == 'Y');
+}
+
+#ifdef WIN3264
+/*
+ * Check if the popup menu entry exists and what gvim it refers to.
+ * Returns non-zero when it's found.
+ */
+ static int
+popup_gvim_path(char *buf)
+{
+ HKEY key_handle;
+ DWORD value_type;
+ DWORD bufsize = BUFSIZE;
+ int r;
+
+ /* Open the key where the path to gvim.exe is stored. */
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0, KEY_READ,
+ &key_handle) != ERROR_SUCCESS)
+ return 0;
+
+ /* get the DisplayName out of it to show the user */
+ r = RegQueryValueEx(key_handle, "path", 0,
+ &value_type, (LPBYTE)buf, &bufsize);
+ RegCloseKey(key_handle);
+
+ return (r == ERROR_SUCCESS);
+}
+
+/*
+ * Check if the "Open With..." menu entry exists and what gvim it refers to.
+ * Returns non-zero when it's found.
+ */
+ static int
+openwith_gvim_path(char *buf)
+{
+ HKEY key_handle;
+ DWORD value_type;
+ DWORD bufsize = BUFSIZE;
+ int r;
+
+ /* Open the key where the path to gvim.exe is stored. */
+ if (RegOpenKeyEx(HKEY_CLASSES_ROOT,
+ "Applications\\gvim.exe\\shell\\edit\\command", 0, KEY_READ,
+ &key_handle) != ERROR_SUCCESS)
+ return 0;
+
+ /* get the DisplayName out of it to show the user */
+ r = RegQueryValueEx(key_handle, "", 0, &value_type, (LPBYTE)buf, &bufsize);
+ RegCloseKey(key_handle);
+
+ return (r == ERROR_SUCCESS);
+}
+
+ static void
+remove_popup(void)
+{
+ int fail = 0;
+ HKEY kh;
+
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "CLSID\\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\\InProcServer32") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "CLSID\\{51EEE242-AD87-11d3-9C1E-0090278BBD99}") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\gvim") != ERROR_SUCCESS)
+ ++fail;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", 0, KEY_ALL_ACCESS, &kh) != ERROR_SUCCESS)
+ ++fail;
+ else
+ {
+ if (RegDeleteValue(kh, "{51EEE242-AD87-11d3-9C1E-0090278BBD99}") != ERROR_SUCCESS)
+ ++fail;
+ RegCloseKey(kh);
+ }
+ if (RegDeleteKey(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_LOCAL_MACHINE, "Software\\Vim") != ERROR_SUCCESS)
+ ++fail;
+
+ if (fail == 6)
+ printf("No Vim popup registry entries could be removed\n");
+ else if (fail > 0)
+ printf("Some Vim popup registry entries could not be removed\n");
+ else
+ printf("The Vim popup registry entries have been removed\n");
+}
+
+ static void
+remove_openwith(void)
+{
+ int fail = 0;
+
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "Applications\\gvim.exe\\shell\\edit\\command") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "Applications\\gvim.exe\\shell\\edit") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "Applications\\gvim.exe\\shell") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "Applications\\gvim.exe") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, ".htm\\OpenWithList\\gvim.exe") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, ".vim\\OpenWithList\\gvim.exe") != ERROR_SUCCESS)
+ ++fail;
+ if (RegDeleteKey(HKEY_CLASSES_ROOT, "*\\OpenWithList\\gvim.exe") != ERROR_SUCCESS)
+ ++fail;
+
+ if (fail == 7)
+ printf("No Vim open-with registry entries could be removed\n");
+ else if (fail > 0)
+ printf("Some Vim open-with registry entries could not be removed\n");
+ else
+ printf("The Vim open-with registry entries have been removed\n");
+}
+#endif
+
+/*
+ * Check if a batch file is really for the current version. Don't delete a
+ * batch file that was written for another (possibly newer) version.
+ */
+ static int
+batfile_thisversion(char *path)
+{
+ FILE *fd;
+ char line[BUFSIZE];
+ char *p;
+ int ver_len = strlen(VIM_VERSION_NODOT);
+ int found = FALSE;
+
+ fd = fopen(path, "r");
+ if (fd != NULL)
+ {
+ while (fgets(line, BUFSIZE, fd) != NULL)
+ {
+ for (p = line; *p != 0; ++p)
+ /* don't accept "vim60an" when looking for "vim60". */
+ if (strnicmp(p, VIM_VERSION_NODOT, ver_len) == 0
+ && !isdigit(p[ver_len])
+ && !isalpha(p[ver_len]))
+ {
+ found = TRUE;
+ break;
+ }
+ if (found)
+ break;
+ }
+ fclose(fd);
+ }
+ return found;
+}
+
+ static int
+remove_batfiles(int doit)
+{
+ char *batfile_path;
+ int i;
+ int found = 0;
+
+ for (i = 1; i < TARGET_COUNT; ++i)
+ {
+ batfile_path = searchpath_save(targets[i].batname);
+ if (batfile_path != NULL && batfile_thisversion(batfile_path))
+ {
+ ++found;
+ if (doit)
+ {
+ printf("removing %s\n", batfile_path);
+ remove(batfile_path);
+ }
+ else
+ printf(" - the batch file %s\n", batfile_path);
+ free(batfile_path);
+ }
+ }
+ return found;
+}
+
+#ifdef WIN3264
+ static void
+remove_if_exists(char *path, char *filename)
+{
+ char buf[BUFSIZE];
+ FILE *fd;
+
+ sprintf(buf, "%s\\%s", path, filename);
+
+ fd = fopen(buf, "r");
+ if (fd != NULL)
+ {
+ fclose(fd);
+ printf("removing %s\n", buf);
+ remove(buf);
+ }
+}
+
+ static void
+remove_icons(void)
+{
+ char path[BUFSIZE];
+ int i;
+
+ if (get_shell_folder_path(path, "desktop"))
+ for (i = 0; i < ICON_COUNT; ++i)
+ remove_if_exists(path, icon_link_names[i]);
+}
+
+ static void
+remove_start_menu(void)
+{
+ char path[BUFSIZE];
+ int i;
+ struct stat st;
+
+ if (get_shell_folder_path(path, VIM_STARTMENU))
+ {
+ for (i = 1; i < TARGET_COUNT; ++i)
+ remove_if_exists(path, targets[i].lnkname);
+ remove_if_exists(path, "uninstall.lnk");
+ remove_if_exists(path, "Help.lnk");
+ /* Win95 uses .pif, WinNT uses .lnk */
+ remove_if_exists(path, "Vim tutor.pif");
+ remove_if_exists(path, "Vim tutor.lnk");
+ remove_if_exists(path, "Vim online.url");
+ if (stat(path, &st) == 0)
+ {
+ printf("removing %s\n", path);
+ rmdir(path);
+ }
+ }
+}
+#endif
+
+#if 0 /* currently not used */
+/*
+ * Return TRUE when we're on Windows 95/98/ME.
+ */
+ static int
+win95(void)
+{
+ static int done = FALSE;
+ static DWORD PlatformId;
+
+ if (!done)
+ {
+ OSVERSIONINFO ovi;
+
+ ovi.dwOSVersionInfoSize = sizeof(ovi);
+ GetVersionEx(&ovi);
+ PlatformId = ovi.dwPlatformId;
+ done = TRUE;
+ }
+ /* Win NT/2000/XP is VER_PLATFORM_WIN32_NT */
+ return PlatformId == VER_PLATFORM_WIN32_WINDOWS;
+}
+#endif
+
+ static void
+delete_uninstall_key(void)
+{
+#ifdef WIN3264
+ RegDeleteKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT);
+#else
+ FILE *fd;
+ char buf[BUFSIZE];
+
+ /*
+ * On DJGPP we delete registry entries by creating a .inf file and
+ * installing it.
+ */
+ fd = fopen("vim.inf", "w");
+ if (fd != NULL)
+ {
+ fprintf(fd, "[version]\n");
+ fprintf(fd, "signature=\"$CHICAGO$\"\n\n");
+ fprintf(fd, "[DefaultInstall]\n");
+ fprintf(fd, "DelReg=DeleteMe\n\n");
+ fprintf(fd, "[DeleteMe]\n");
+ fprintf(fd, "HKLM,\"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vim " VIM_VERSION_SHORT "\"\n");
+ fclose(fd);
+
+ /* Don't know how to detect Win NT with DJGPP. Hack: Just try the Win
+ * 95/98/ME method, since the DJGPP version can't use long filenames
+ * on Win NT anyway. */
+ sprintf(buf, "rundll setupx.dll,InstallHinfSection DefaultInstall 132 %s\\vim.inf", installdir);
+ run_command(buf);
+#if 0
+ /* Windows NT method (untested). */
+ sprintf(buf, "rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 %s\\vim.inf", installdir);
+ run_command(buf);
+#endif
+
+ remove("vim.inf");
+ }
+#endif
+}
+
+ int
+main(int argc, char *argv[])
+{
+ int found = 0;
+ FILE *fd;
+#ifdef WIN3264
+ int i;
+ struct stat st;
+ char icon[BUFSIZE];
+ char path[BUFSIZE];
+ char popup_path[BUFSIZE];
+
+ /* The nsis uninstaller calls us with a "-nsis" argument. */
+ if (argc == 2 && stricmp(argv[1], "-nsis") == 0)
+ interactive = FALSE;
+ else
+#endif
+ interactive = TRUE;
+
+ /* Initialize this program. */
+ do_inits(argv);
+
+ printf("This program will remove the following items:\n");
+
+#ifdef WIN3264
+ if (popup_gvim_path(popup_path))
+ {
+ printf(" - the \"Edit with Vim\" entry in the popup menu\n");
+ printf(" which uses \"%s\"\n", popup_path);
+ printf("\nRemove it (y/n)? ");
+ if (confirm())
+ {
+ remove_popup();
+ /* Assume the "Open With" entry can be removed as well, don't
+ * bother the user with asking him again. */
+ remove_openwith();
+ }
+ }
+ else if (openwith_gvim_path(popup_path))
+ {
+ printf(" - the Vim \"Open With...\" entry in the popup menu\n");
+ printf(" which uses \"%s\"\n", popup_path);
+ printf("\nRemove it (y/n)? ");
+ if (confirm())
+ remove_openwith();
+ }
+
+ if (get_shell_folder_path(path, "desktop"))
+ {
+ printf("\n");
+ for (i = 0; i < ICON_COUNT; ++i)
+ {
+ sprintf(icon, "%s\\%s", path, icon_link_names[i]);
+ if (stat(icon, &st) == 0)
+ {
+ printf(" - the \"%s\" icon on the desktop\n", icon_names[i]);
+ ++found;
+ }
+ }
+ if (found > 0)
+ {
+ if (interactive)
+ printf("\nRemove %s (y/n)? ", found > 1 ? "them" : "it");
+ if (!interactive || confirm())
+ remove_icons();
+ }
+ }
+
+ if (get_shell_folder_path(path, VIM_STARTMENU)
+ && stat(path, &st) == 0)
+ {
+ printf("\n - the \"%s\" entry in the Start Menu\n", VIM_STARTMENU);
+ if (interactive)
+ printf("\nRemove it (y/n)? ");
+ if (!interactive || confirm())
+ remove_start_menu();
+ }
+#endif
+
+ printf("\n");
+ found = remove_batfiles(0);
+ if (found > 0)
+ {
+ if (interactive)
+ printf("\nRemove %s (y/n)? ", found > 1 ? "them" : "it");
+ if (!interactive || confirm())
+ remove_batfiles(1);
+ }
+
+ fd = fopen("gvim.exe", "r");
+ if (fd != NULL)
+ {
+ fclose(fd);
+ printf("gvim.exe detected. Attempting to unregister gvim with OLE\n");
+ system("gvim.exe -silent -unregister");
+ }
+
+ delete_uninstall_key();
+
+ if (interactive)
+ {
+ printf("\nYou may now want to delete the Vim executables and runtime files.\n");
+ printf("(They are still where you unpacked them.)\n");
+ }
+
+ rewind(stdin);
+ printf("\nPress Enter to exit...");
+ (void)getchar();
+
+ return 0;
+}
diff --git a/src/version.c b/src/version.c
new file mode 100644
index 000000000..01293435e
--- /dev/null
+++ b/src/version.c
@@ -0,0 +1,1219 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#ifdef AMIGA
+# include <time.h> /* for time() */
+#endif
+
+/*
+ * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
+ * It has been changed beyond recognition since then.
+ *
+ * Differences between version 5.x and 6.x can be found with ":help version6".
+ * Differences between version 4.x and 5.x can be found with ":help version5".
+ * Differences between version 3.0 and 4.x can be found with ":help version4".
+ * All the remarks about older versions have been removed, they are not very
+ * interesting.
+ */
+
+#include "version.h"
+
+char *Version = VIM_VERSION_SHORT;
+char *mediumVersion = VIM_VERSION_MEDIUM;
+
+#if defined(HAVE_DATE_TIME) || defined(PROTO)
+# if (defined(VMS) && defined(VAXC)) || defined(PROTO)
+char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
+ + sizeof(__TIME__) + 3];
+ void
+make_version()
+{
+ /*
+ * Construct the long version string. Necessary because
+ * VAX C can't catenate strings in the preprocessor.
+ */
+ strcpy(longVersion, VIM_VERSION_LONG_DATE);
+ strcat(longVersion, __DATE__);
+ strcat(longVersion, " ");
+ strcat(longVersion, __TIME__);
+ strcat(longVersion, ")");
+}
+# else
+char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
+# endif
+#else
+char *longVersion = VIM_VERSION_LONG;
+#endif
+
+static void version_msg __ARGS((char *s));
+
+static char *(features[]) =
+{
+#ifdef AMIGA /* only for Amiga systems */
+# ifdef FEAT_ARP
+ "+ARP",
+# else
+ "-ARP",
+# endif
+#endif
+#ifdef FEAT_ARABIC
+ "+arabic",
+#else
+ "-arabic",
+#endif
+#ifdef FEAT_AUTOCMD
+ "+autocmd",
+#else
+ "-autocmd",
+#endif
+#ifdef FEAT_BEVAL
+ "+balloon_eval",
+#else
+ "-balloon_eval",
+#endif
+#ifdef FEAT_BROWSE
+ "+browse",
+#else
+ "-browse",
+#endif
+#ifdef NO_BUILTIN_TCAPS
+ "-builtin_terms",
+#endif
+#ifdef SOME_BUILTIN_TCAPS
+ "+builtin_terms",
+#endif
+#ifdef ALL_BUILTIN_TCAPS
+ "++builtin_terms",
+#endif
+#ifdef FEAT_BYTEOFF
+ "+byte_offset",
+#else
+ "-byte_offset",
+#endif
+#ifdef FEAT_CINDENT
+ "+cindent",
+#else
+ "-cindent",
+#endif
+#ifdef FEAT_CLIENTSERVER
+ "+clientserver",
+#else
+ "-clientserver",
+#endif
+#ifdef FEAT_CLIPBOARD
+ "+clipboard",
+#else
+ "-clipboard",
+#endif
+#ifdef FEAT_CMDL_COMPL
+ "+cmdline_compl",
+#else
+ "-cmdline_compl",
+#endif
+#ifdef FEAT_CMDHIST
+ "+cmdline_hist",
+#else
+ "-cmdline_hist",
+#endif
+#ifdef FEAT_CMDL_INFO
+ "+cmdline_info",
+#else
+ "-cmdline_info",
+#endif
+#ifdef FEAT_COMMENTS
+ "+comments",
+#else
+ "-comments",
+#endif
+#ifdef FEAT_CRYPT
+ "+cryptv",
+#else
+ "-cryptv",
+#endif
+#ifdef FEAT_CSCOPE
+ "+cscope",
+#else
+ "-cscope",
+#endif
+#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
+ "+dialog_con_gui",
+#else
+# if defined(FEAT_CON_DIALOG)
+ "+dialog_con",
+# else
+# if defined(FEAT_GUI_DIALOG)
+ "+dialog_gui",
+# else
+ "-dialog",
+# endif
+# endif
+#endif
+#ifdef FEAT_DIFF
+ "+diff",
+#else
+ "-diff",
+#endif
+#ifdef FEAT_DIGRAPHS
+ "+digraphs",
+#else
+ "-digraphs",
+#endif
+#ifdef FEAT_DND
+ "+dnd",
+#else
+ "-dnd",
+#endif
+#ifdef EBCDIC
+ "+ebcdic",
+#else
+ "-ebcdic",
+#endif
+#ifdef FEAT_EMACS_TAGS
+ "+emacs_tags",
+#else
+ "-emacs_tags",
+#endif
+#ifdef FEAT_EVAL
+ "+eval",
+#else
+ "-eval",
+#endif
+#ifdef FEAT_EX_EXTRA
+ "+ex_extra",
+#else
+ "-ex_extra",
+#endif
+#ifdef FEAT_SEARCH_EXTRA
+ "+extra_search",
+#else
+ "-extra_search",
+#endif
+#ifdef FEAT_FKMAP
+ "+farsi",
+#else
+ "-farsi",
+#endif
+#ifdef FEAT_SEARCHPATH
+ "+file_in_path",
+#else
+ "-file_in_path",
+#endif
+#ifdef FEAT_FIND_ID
+ "+find_in_path",
+#else
+ "-find_in_path",
+#endif
+#ifdef FEAT_FOLDING
+ "+folding",
+#else
+ "-folding",
+#endif
+#ifdef FEAT_FOOTER
+ "+footer",
+#else
+ "-footer",
+#endif
+ /* only interesting on Unix systems */
+#if !defined(USE_SYSTEM) && defined(UNIX)
+ "+fork()",
+#endif
+#ifdef FEAT_GETTEXT
+# ifdef DYNAMIC_GETTEXT
+ "+gettext/dyn",
+# else
+ "+gettext",
+# endif
+#else
+ "-gettext",
+#endif
+#ifdef FEAT_HANGULIN
+ "+hangul_input",
+#else
+ "-hangul_input",
+#endif
+#if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
+# ifdef DYNAMIC_ICONV
+ "+iconv/dyn",
+# else
+ "+iconv",
+# endif
+#else
+ "-iconv",
+#endif
+#ifdef FEAT_INS_EXPAND
+ "+insert_expand",
+#else
+ "-insert_expand",
+#endif
+#ifdef FEAT_JUMPLIST
+ "+jumplist",
+#else
+ "-jumplist",
+#endif
+#ifdef FEAT_KEYMAP
+ "+keymap",
+#else
+ "-keymap",
+#endif
+#ifdef FEAT_LANGMAP
+ "+langmap",
+#else
+ "-langmap",
+#endif
+#ifdef FEAT_LIBCALL
+ "+libcall",
+#else
+ "-libcall",
+#endif
+#ifdef FEAT_LINEBREAK
+ "+linebreak",
+#else
+ "-linebreak",
+#endif
+#ifdef FEAT_LISP
+ "+lispindent",
+#else
+ "-lispindent",
+#endif
+#ifdef FEAT_LISTCMDS
+ "+listcmds",
+#else
+ "-listcmds",
+#endif
+#ifdef FEAT_LOCALMAP
+ "+localmap",
+#else
+ "-localmap",
+#endif
+#ifdef FEAT_MENU
+ "+menu",
+#else
+ "-menu",
+#endif
+#ifdef FEAT_SESSION
+ "+mksession",
+#else
+ "-mksession",
+#endif
+#ifdef FEAT_MODIFY_FNAME
+ "+modify_fname",
+#else
+ "-modify_fname",
+#endif
+#ifdef FEAT_MOUSE
+ "+mouse",
+# ifdef FEAT_MOUSESHAPE
+ "+mouseshape",
+# else
+ "-mouseshape",
+# endif
+# else
+ "-mouse",
+#endif
+#if defined(UNIX) || defined(VMS)
+# ifdef FEAT_MOUSE_DEC
+ "+mouse_dec",
+# else
+ "-mouse_dec",
+# endif
+# ifdef FEAT_MOUSE_GPM
+ "+mouse_gpm",
+# else
+ "-mouse_gpm",
+# endif
+# ifdef FEAT_MOUSE_JSB
+ "+mouse_jsbterm",
+# else
+ "-mouse_jsbterm",
+# endif
+# ifdef FEAT_MOUSE_NET
+ "+mouse_netterm",
+# else
+ "-mouse_netterm",
+# endif
+# ifdef FEAT_MOUSE_XTERM
+ "+mouse_xterm",
+# else
+ "-mouse_xterm",
+# endif
+#endif
+#ifdef __QNX__
+# ifdef FEAT_MOUSE_PTERM
+ "+mouse_pterm",
+# else
+ "-mouse_pterm",
+# endif
+#endif
+#ifdef FEAT_MBYTE_IME
+# ifdef DYNAMIC_IME
+ "+multi_byte_ime/dyn",
+# else
+ "+multi_byte_ime",
+# endif
+#else
+# ifdef FEAT_MBYTE
+ "+multi_byte",
+# else
+ "-multi_byte",
+# endif
+#endif
+#ifdef FEAT_MULTI_LANG
+ "+multi_lang",
+#else
+ "-multi_lang",
+#endif
+#ifdef FEAT_NETBEANS_INTG
+ "+netbeans_intg",
+#else
+ "-netbeans_intg",
+#endif
+#ifdef FEAT_GUI_W32
+# ifdef FEAT_OLE
+ "+ole",
+# else
+ "-ole",
+# endif
+#endif
+#ifdef FEAT_OSFILETYPE
+ "+osfiletype",
+#else
+ "-osfiletype",
+#endif
+#ifdef FEAT_PATH_EXTRA
+ "+path_extra",
+#else
+ "-path_extra",
+#endif
+#ifdef FEAT_PERL
+# ifdef DYNAMIC_PERL
+ "+perl/dyn",
+# else
+ "+perl",
+# endif
+#else
+ "-perl",
+#endif
+#ifdef FEAT_PRINTER
+# ifdef FEAT_POSTSCRIPT
+ "+postscript",
+# else
+ "-postscript",
+# endif
+ "+printer",
+#else
+ "-printer",
+#endif
+#ifdef FEAT_PYTHON
+# ifdef DYNAMIC_PYTHON
+ "+python/dyn",
+# else
+ "+python",
+# endif
+#else
+ "-python",
+#endif
+#ifdef FEAT_QUICKFIX
+ "+quickfix",
+#else
+ "-quickfix",
+#endif
+#ifdef FEAT_RIGHTLEFT
+ "+rightleft",
+#else
+ "-rightleft",
+#endif
+#ifdef FEAT_RUBY
+# ifdef DYNAMIC_RUBY
+ "+ruby/dyn",
+# else
+ "+ruby",
+# endif
+#else
+ "-ruby",
+#endif
+#ifdef FEAT_SCROLLBIND
+ "+scrollbind",
+#else
+ "-scrollbind",
+#endif
+#ifdef FEAT_SIGNS
+ "+signs",
+#else
+ "-signs",
+#endif
+#ifdef FEAT_SMARTINDENT
+ "+smartindent",
+#else
+ "-smartindent",
+#endif
+#ifdef FEAT_SNIFF
+ "+sniff",
+#else
+ "-sniff",
+#endif
+#ifdef FEAT_STL_OPT
+ "+statusline",
+#else
+ "-statusline",
+#endif
+#ifdef FEAT_SUN_WORKSHOP
+ "+sun_workshop",
+#else
+ "-sun_workshop",
+#endif
+#ifdef FEAT_SYN_HL
+ "+syntax",
+#else
+ "-syntax",
+#endif
+ /* only interesting on Unix systems */
+#if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
+ "+system()",
+#endif
+#ifdef FEAT_TAG_BINS
+ "+tag_binary",
+#else
+ "-tag_binary",
+#endif
+#ifdef FEAT_TAG_OLDSTATIC
+ "+tag_old_static",
+#else
+ "-tag_old_static",
+#endif
+#ifdef FEAT_TAG_ANYWHITE
+ "+tag_any_white",
+#else
+ "-tag_any_white",
+#endif
+#ifdef FEAT_TCL
+# ifdef DYNAMIC_TCL
+ "+tcl/dyn",
+# else
+ "+tcl",
+# endif
+#else
+ "-tcl",
+#endif
+#if defined(UNIX) || defined(__EMX__)
+/* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
+# ifdef TERMINFO
+ "+terminfo",
+# else
+ "-terminfo",
+# endif
+#else /* unix always includes termcap support */
+# ifdef HAVE_TGETENT
+ "+tgetent",
+# else
+ "-tgetent",
+# endif
+#endif
+#ifdef FEAT_TERMRESPONSE
+ "+termresponse",
+#else
+ "-termresponse",
+#endif
+#ifdef FEAT_TEXTOBJ
+ "+textobjects",
+#else
+ "-textobjects",
+#endif
+#ifdef FEAT_TITLE
+ "+title",
+#else
+ "-title",
+#endif
+#ifdef FEAT_TOOLBAR
+ "+toolbar",
+#else
+ "-toolbar",
+#endif
+#ifdef FEAT_USR_CMDS
+ "+user_commands",
+#else
+ "-user_commands",
+#endif
+#ifdef FEAT_VERTSPLIT
+ "+vertsplit",
+#else
+ "-vertsplit",
+#endif
+#ifdef FEAT_VIRTUALEDIT
+ "+virtualedit",
+#else
+ "-virtualedit",
+#endif
+#ifdef FEAT_VISUAL
+ "+visual",
+# ifdef FEAT_VISUALEXTRA
+ "+visualextra",
+# else
+ "-visualextra",
+# endif
+#else
+ "-visual",
+#endif
+#ifdef FEAT_VIMINFO
+ "+viminfo",
+#else
+ "-viminfo",
+#endif
+#ifdef FEAT_VREPLACE
+ "+vreplace",
+#else
+ "-vreplace",
+#endif
+#ifdef FEAT_WILDIGN
+ "+wildignore",
+#else
+ "-wildignore",
+#endif
+#ifdef FEAT_WILDMENU
+ "+wildmenu",
+#else
+ "-wildmenu",
+#endif
+#ifdef FEAT_WINDOWS
+ "+windows",
+#else
+ "-windows",
+#endif
+#ifdef FEAT_WRITEBACKUP
+ "+writebackup",
+#else
+ "-writebackup",
+#endif
+#if defined(UNIX) || defined(VMS)
+# ifdef FEAT_X11
+ "+X11",
+# else
+ "-X11",
+# endif
+#endif
+#ifdef FEAT_XFONTSET
+ "+xfontset",
+#else
+ "-xfontset",
+#endif
+#ifdef FEAT_XIM
+ "+xim",
+#else
+ "-xim",
+#endif
+#if defined(UNIX) || defined(VMS)
+# ifdef USE_XSMP_INTERACT
+ "+xsmp_interact",
+# else
+# ifdef USE_XSMP
+ "+xsmp",
+# else
+ "-xsmp",
+# endif
+# endif
+# ifdef FEAT_XCLIPBOARD
+ "+xterm_clipboard",
+# else
+ "-xterm_clipboard",
+# endif
+#endif
+#ifdef FEAT_XTERM_SAVE
+ "+xterm_save",
+#else
+ "-xterm_save",
+#endif
+#ifdef WIN3264
+# ifdef FEAT_XPM_W32
+ "+xpm_w32",
+# else
+ "-xpm_w32",
+# endif
+#endif
+ NULL
+};
+
+static int included_patches[] =
+{ /* Add new patch number below this line */
+/**/
+ 0
+};
+
+ int
+highest_patch()
+{
+ int i;
+ int h = 0;
+
+ for (i = 0; included_patches[i] != 0; ++i)
+ if (included_patches[i] > h)
+ h = included_patches[i];
+ return h;
+}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * Return TRUE if patch "n" has been included.
+ */
+ int
+has_patch(n)
+ int n;
+{
+ int i;
+
+ for (i = 0; included_patches[i] != 0; ++i)
+ if (included_patches[i] == n)
+ return TRUE;
+ return FALSE;
+}
+#endif
+
+ void
+ex_version(eap)
+ exarg_T *eap;
+{
+ /*
+ * Ignore a ":version 9.99" command.
+ */
+ if (*eap->arg == NUL)
+ {
+ msg_putchar('\n');
+ list_version();
+ }
+}
+
+ void
+list_version()
+{
+ int i;
+ int first;
+ char *s = "";
+
+ /*
+ * When adding features here, don't forget to update the list of
+ * internal variables in eval.c!
+ */
+ MSG(longVersion);
+#ifdef WIN3264
+# ifdef FEAT_GUI_W32
+# if defined(_MSC_VER) && (_MSC_VER <= 1010)
+ /* Only MS VC 4.1 and earlier can do Win32s */
+ MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
+# else
+ MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
+# endif
+ if (gui_is_win32s())
+ MSG_PUTS(_(" in Win32s mode"));
+# ifdef FEAT_OLE
+ MSG_PUTS(_(" with OLE support"));
+# endif
+# else
+ MSG_PUTS(_("\nMS-Windows 32 bit console version"));
+# endif
+#endif
+#ifdef WIN16
+ MSG_PUTS(_("\nMS-Windows 16 bit version"));
+#endif
+#ifdef MSDOS
+# ifdef DJGPP
+ MSG_PUTS(_("\n32 bit MS-DOS version"));
+# else
+ MSG_PUTS(_("\n16 bit MS-DOS version"));
+# endif
+#endif
+#ifdef MACOS
+# ifdef MACOS_X
+# ifdef MACOS_X_UNIX
+ MSG_PUTS(_("\nMacOS X (unix) version"));
+# else
+ MSG_PUTS(_("\nMacOS X version"));
+# endif
+#else
+ MSG_PUTS(_("\nMacOS version"));
+# endif
+#endif
+
+#ifdef RISCOS
+ MSG_PUTS(_("\nRISC OS version"));
+#endif
+#ifdef VMS
+ MSG_PUTS("\nOpenVMS version");
+#endif
+
+ /* Print the list of patch numbers if there is at least one. */
+ /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
+ if (included_patches[0] != 0)
+ {
+ MSG_PUTS(_("\nIncluded patches: "));
+ first = -1;
+ /* find last one */
+ for (i = 0; included_patches[i] != 0; ++i)
+ ;
+ while (--i >= 0)
+ {
+ if (first < 0)
+ first = included_patches[i];
+ if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
+ {
+ MSG_PUTS(s);
+ s = ", ";
+ msg_outnum((long)first);
+ if (first != included_patches[i])
+ {
+ MSG_PUTS("-");
+ msg_outnum((long)included_patches[i]);
+ }
+ first = -1;
+ }
+ }
+ }
+
+#ifdef MODIFIED_BY
+ MSG_PUTS("\n");
+ MSG_PUTS(_("Modified by "));
+ MSG_PUTS(MODIFIED_BY);
+#endif
+
+#ifdef HAVE_PATHDEF
+ if (*compiled_user != NUL || *compiled_sys != NUL)
+ {
+ MSG_PUTS(_("\nCompiled "));
+ if (*compiled_user != NUL)
+ {
+ MSG_PUTS(_("by "));
+ MSG_PUTS(compiled_user);
+ }
+ if (*compiled_sys != NUL)
+ {
+ MSG_PUTS("@");
+ MSG_PUTS(compiled_sys);
+ }
+ }
+#endif
+
+#ifdef FEAT_HUGE
+ MSG_PUTS(_("\nHuge version "));
+#else
+# ifdef FEAT_BIG
+ MSG_PUTS(_("\nBig version "));
+# else
+# ifdef FEAT_NORMAL
+ MSG_PUTS(_("\nNormal version "));
+# else
+# ifdef FEAT_SMALL
+ MSG_PUTS(_("\nSmall version "));
+# else
+ MSG_PUTS(_("\nTiny version "));
+# endif
+# endif
+# endif
+#endif
+#ifndef FEAT_GUI
+ MSG_PUTS(_("without GUI."));
+#else
+# ifdef FEAT_GUI_GTK
+# ifdef FEAT_GUI_GNOME
+# ifdef HAVE_GTK2
+ MSG_PUTS(_("with GTK2-GNOME GUI."));
+# else
+ MSG_PUTS(_("with GTK-GNOME GUI."));
+# endif
+# else
+# ifdef HAVE_GTK2
+ MSG_PUTS(_("with GTK2 GUI."));
+# else
+ MSG_PUTS(_("with GTK GUI."));
+# endif
+# endif
+# else
+# ifdef FEAT_GUI_MOTIF
+ MSG_PUTS(_("with X11-Motif GUI."));
+# else
+# ifdef FEAT_GUI_ATHENA
+# ifdef FEAT_GUI_NEXTAW
+ MSG_PUTS(_("with X11-neXtaw GUI."));
+# else
+ MSG_PUTS(_("with X11-Athena GUI."));
+# endif
+# else
+# ifdef FEAT_GUI_BEOS
+ MSG_PUTS(_("with BeOS GUI."));
+# else
+# ifdef FEAT_GUI_PHOTON
+ MSG_PUTS(_("with Photon GUI."));
+# else
+# if defined(MSWIN)
+ MSG_PUTS(_("with GUI."));
+# else
+# if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
+ MSG_PUTS(_("with Carbon GUI."));
+# else
+# if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
+ MSG_PUTS(_("with Cocoa GUI."));
+# else
+# if defined (MACOS)
+ MSG_PUTS(_("with (classic) GUI."));
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+ version_msg(_(" Features included (+) or not (-):\n"));
+
+ /* print all the features */
+ for (i = 0; features[i] != NULL; ++i)
+ {
+ version_msg(features[i]);
+ if (msg_col > 0)
+ version_msg(" ");
+ }
+
+ version_msg("\n");
+#ifdef SYS_VIMRC_FILE
+ version_msg(_(" system vimrc file: \""));
+ version_msg(SYS_VIMRC_FILE);
+ version_msg("\"\n");
+#endif
+#ifdef USR_VIMRC_FILE
+ version_msg(_(" user vimrc file: \""));
+ version_msg(USR_VIMRC_FILE);
+ version_msg("\"\n");
+#endif
+#ifdef USR_VIMRC_FILE2
+ version_msg(_(" 2nd user vimrc file: \""));
+ version_msg(USR_VIMRC_FILE2);
+ version_msg("\"\n");
+#endif
+#ifdef USR_VIMRC_FILE3
+ version_msg(_(" 3rd user vimrc file: \""));
+ version_msg(USR_VIMRC_FILE3);
+ version_msg("\"\n");
+#endif
+#ifdef USR_EXRC_FILE
+ version_msg(_(" user exrc file: \""));
+ version_msg(USR_EXRC_FILE);
+ version_msg("\"\n");
+#endif
+#ifdef USR_EXRC_FILE2
+ version_msg(_(" 2nd user exrc file: \""));
+ version_msg(USR_EXRC_FILE2);
+ version_msg("\"\n");
+#endif
+#ifdef FEAT_GUI
+# ifdef SYS_GVIMRC_FILE
+ version_msg(_(" system gvimrc file: \""));
+ version_msg(SYS_GVIMRC_FILE);
+ version_msg("\"\n");
+# endif
+ version_msg(_(" user gvimrc file: \""));
+ version_msg(USR_GVIMRC_FILE);
+ version_msg("\"\n");
+# ifdef USR_GVIMRC_FILE2
+ version_msg(_("2nd user gvimrc file: \""));
+ version_msg(USR_GVIMRC_FILE2);
+ version_msg("\"\n");
+# endif
+# ifdef USR_GVIMRC_FILE3
+ version_msg(_("3rd user gvimrc file: \""));
+ version_msg(USR_GVIMRC_FILE3);
+ version_msg("\"\n");
+# endif
+#endif
+#ifdef FEAT_GUI
+# ifdef SYS_MENU_FILE
+ version_msg(_(" system menu file: \""));
+ version_msg(SYS_MENU_FILE);
+ version_msg("\"\n");
+# endif
+#endif
+#ifdef HAVE_PATHDEF
+ if (*default_vim_dir != NUL)
+ {
+ version_msg(_(" fall-back for $VIM: \""));
+ version_msg((char *)default_vim_dir);
+ version_msg("\"\n");
+ }
+ if (*default_vimruntime_dir != NUL)
+ {
+ version_msg(_(" f-b for $VIMRUNTIME: \""));
+ version_msg((char *)default_vimruntime_dir);
+ version_msg("\"\n");
+ }
+ version_msg(_("Compilation: "));
+ version_msg((char *)all_cflags);
+ version_msg("\n");
+#ifdef VMS
+ if (*compiler_version != NUL)
+ {
+ version_msg(_("Compiler: "));
+ version_msg((char *)compiler_version);
+ version_msg("\n");
+ }
+#endif
+ version_msg(_("Linking: "));
+ version_msg((char *)all_lflags);
+#endif
+#ifdef DEBUG
+ version_msg("\n");
+ version_msg(_(" DEBUG BUILD"));
+#endif
+}
+
+/*
+ * Output a string for the version message. If it's going to wrap, output a
+ * newline, unless the message is too long to fit on the screen anyway.
+ */
+ static void
+version_msg(s)
+ char *s;
+{
+ int len = (int)STRLEN(s);
+
+ if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
+ && *s != '\n')
+ msg_putchar('\n');
+ if (!got_int)
+ MSG_PUTS(s);
+}
+
+static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
+
+/*
+ * Give an introductory message about Vim.
+ * Only used when starting Vim on an empty file, without a file name.
+ * Or with the ":intro" command (for Sven :-).
+ */
+ void
+intro_message(colon)
+ int colon; /* TRUE for ":intro" */
+{
+ int i;
+ int row;
+ int blanklines;
+ int sponsor;
+ char *p;
+ static char *(lines[]) =
+ {
+ N_("VIM - Vi IMproved"),
+ "",
+ N_("version "),
+ N_("by Bram Moolenaar et al."),
+#ifdef MODIFIED_BY
+ " ",
+#endif
+ N_("Vim is open source and freely distributable"),
+ "",
+ N_("Help poor children in Uganda!"),
+ N_("type :help iccf<Enter> for information "),
+ "",
+ N_("type :q<Enter> to exit "),
+ N_("type :help<Enter> or <F1> for on-line help"),
+ N_("type :help version6<Enter> for version info"),
+ NULL,
+ "",
+ N_("Running in Vi compatible mode"),
+ N_("type :set nocp<Enter> for Vim defaults"),
+ N_("type :help cp-default<Enter> for info on this"),
+ };
+#ifdef FEAT_GUI
+ static char *(gui_lines[]) =
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+#ifdef MODIFIED_BY
+ NULL,
+#endif
+ NULL,
+ NULL,
+ NULL,
+ N_("menu Help->Orphans for information "),
+ NULL,
+ N_("Running modeless, typed text is inserted"),
+ N_("menu Edit->Global Settings->Toggle Insert Mode "),
+ N_(" for two modes "),
+ NULL,
+ NULL,
+ NULL,
+ N_("menu Edit->Global Settings->Toggle Vi Compatible"),
+ N_(" for Vim defaults "),
+ };
+#endif
+
+ /* blanklines = screen height - # message lines */
+ blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
+ if (!p_cp)
+ blanklines += 4; /* add 4 for not showing "Vi compatible" message */
+#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+ if (mch_windows95())
+ blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
+#endif
+
+#ifdef FEAT_WINDOWS
+ /* Don't overwrite a statusline. Depends on 'cmdheight'. */
+ if (p_ls > 1)
+ blanklines -= Rows - topframe->fr_height;
+#endif
+ if (blanklines < 0)
+ blanklines = 0;
+
+ /* Show the sponsor and register message one out of four times, the Uganda
+ * message two out of four times. */
+ sponsor = time(NULL);
+ sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
+
+ /* start displaying the message lines after half of the blank lines */
+ row = blanklines / 2;
+ if ((row >= 2 && Columns >= 50) || colon)
+ {
+ for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
+ {
+ p = lines[i];
+#ifdef FEAT_GUI
+ if (p_im && gui.in_use && gui_lines[i] != NULL)
+ p = gui_lines[i];
+#endif
+ if (p == NULL)
+ {
+ if (!p_cp)
+ break;
+ continue;
+ }
+ if (sponsor != 0)
+ {
+ if (strstr(p, "children") != NULL)
+ p = sponsor < 0
+ ? N_("Sponsor Vim development!")
+ : N_("Become a registered Vim user!");
+ else if (strstr(p, "iccf") != NULL)
+ p = sponsor < 0
+ ? N_("type :help sponsor<Enter> for information ")
+ : N_("type :help register<Enter> for information ");
+ else if (strstr(p, "Orphans") != NULL)
+ p = N_("menu Help->Sponsor/Register for information ");
+ }
+ if (*p != NUL)
+ do_intro_line(row, (char_u *)_(p), i == 2, 0);
+ ++row;
+ }
+#if defined(WIN3264) && !defined(FEAT_GUI_W32)
+ if (mch_windows95())
+ {
+ do_intro_line(++row,
+ (char_u *)_("WARNING: Windows 95/98/ME detected"),
+ FALSE, hl_attr(HLF_E));
+ do_intro_line(++row,
+ (char_u *)_("type :help windows95<Enter> for info on this"),
+ FALSE, 0);
+ }
+#endif
+ }
+
+ /* Make the wait-return message appear just below the text. */
+ if (colon)
+ msg_row = row;
+}
+
+ static void
+do_intro_line(row, mesg, add_version, attr)
+ int row;
+ char_u *mesg;
+ int add_version;
+ int attr;
+{
+ char_u vers[20];
+ int col;
+ char_u *p;
+ int l;
+ int clen;
+#ifdef MODIFIED_BY
+# define MODBY_LEN 150
+ char_u modby[MODBY_LEN];
+
+ if (*mesg == ' ')
+ {
+ STRNCPY(modby, _("Modified by "), MODBY_LEN);
+ modby[MODBY_LEN - 1] = NUL;
+ l = STRLEN(modby);
+ STRNCPY(modby + l, MODIFIED_BY, MODBY_LEN - l);
+ modby[MODBY_LEN - 1] = NUL;
+ mesg = modby;
+ }
+#endif
+
+ /* Center the message horizontally. */
+ col = vim_strsize(mesg);
+ if (add_version)
+ {
+ STRCPY(vers, mediumVersion);
+ if (highest_patch())
+ {
+ /* Check for 9.9x or 9.9xx, alpha/beta version */
+ if (isalpha((int)mediumVersion[3]))
+ {
+ if (isalpha((int)mediumVersion[4]))
+ sprintf((char *)vers + 5, ".%d%s", highest_patch(),
+ mediumVersion + 5);
+ else
+ sprintf((char *)vers + 4, ".%d%s", highest_patch(),
+ mediumVersion + 4);
+ }
+ else
+ sprintf((char *)vers + 3, ".%d", highest_patch());
+ }
+ col += (int)STRLEN(vers);
+ }
+ col = (Columns - col) / 2;
+ if (col < 0)
+ col = 0;
+
+ /* Split up in parts to highlight <> items differently. */
+ for (p = mesg; *p != NUL; p += l)
+ {
+ clen = 0;
+ for (l = 0; p[l] != NUL
+ && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ {
+ clen += ptr2cells(p + l);
+ l += (*mb_ptr2len_check)(p + l) - 1;
+ }
+ else
+#endif
+ clen += byte2cells(p[l]);
+ }
+ screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
+ col += clen;
+ }
+
+ /* Add the version number to the version line. */
+ if (add_version)
+ screen_puts(vers, row, col, 0);
+}
+
+/*
+ * ":intro": clear screen, display intro screen and wait for return.
+ */
+/*ARGSUSED*/
+ void
+ex_intro(eap)
+ exarg_T *eap;
+{
+ screenclear();
+ intro_message(TRUE);
+ wait_return(TRUE);
+}
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 000000000..2d98d2874
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1,40 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+/*
+ * Define the version number, name, etc.
+ * The patchlevel is in included_patches[], in version.c.
+ *
+ * This doesn't use string contatenation, some compilers don't support it.
+ */
+
+#define VIM_VERSION_MAJOR 7
+#define VIM_VERSION_MAJOR_STR "7"
+#define VIM_VERSION_MINOR 0
+#define VIM_VERSION_MINOR_STR "0"
+#define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
+
+#define VIM_VERSION_BUILD 256
+#define VIM_VERSION_BUILD_BCD 0x100
+#define VIM_VERSION_BUILD_STR "256"
+#define VIM_VERSION_PATCHLEVEL 0
+#define VIM_VERSION_PATCHLEVEL_STR "0"
+/* Used by MacOS port should be one of: development, alpha, beta, final */
+#define VIM_VERSION_RELEASE alpha
+
+/*
+ * VIM_VERSION_NODOT is used for the runtime directory name.
+ * VIM_VERSION_SHORT is copied into the swap file (max. length is 6 chars).
+ * VIM_VERSION_MEDIUM is used for the startup-screen.
+ * VIM_VERSION_LONG is used for the ":version" command and "Vim -h".
+ */
+#define VIM_VERSION_NODOT "vim70aa"
+#define VIM_VERSION_SHORT "7.0aa"
+#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2004 June 7)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2004 June 7, compiled "
diff --git a/src/vim.def b/src/vim.def
new file mode 100644
index 000000000..fec09c719
--- /dev/null
+++ b/src/vim.def
@@ -0,0 +1,4 @@
+CODE PRELOAD EXECUTEONLY
+DATA MULTIPLE SHARED
+DESCRIPTION 'Vim 6.0'
+HEAPSIZE 0,0
diff --git a/src/vim.h b/src/vim.h
new file mode 100644
index 000000000..d85aa0719
--- /dev/null
+++ b/src/vim.h
@@ -0,0 +1,1788 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#ifndef VIM__H
+# define VIM__H
+
+/* use fastcall for Borland, when compiling for Win32 (not for DOS16) */
+#if defined(__BORLANDC__) && defined(WIN32) && !defined(DEBUG)
+#if defined(FEAT_PERL) || \
+ defined(FEAT_PYTHON) || \
+ defined(FEAT_RUBY) || \
+ defined(FEAT_TCL) || \
+ defined(DYNAMIC_GETTEXT) || \
+ defined(DYNAMIC_ICONV) || \
+ defined(DYNAMIC_IME) || \
+ defined(XPM)
+# pragma option -pc
+# else
+# pragma option -pr
+# endif
+#endif
+
+/* ============ the header file puzzle (ca. 50-100 pieces) ========= */
+
+#ifdef HAVE_CONFIG_H /* GNU autoconf (or something else) was here */
+# include "auto/config.h"
+# define HAVE_PATHDEF
+
+/*
+ * Check if configure correcly managed to find sizeof(int). If this failed,
+ * it becomes zero. This is likely a problem of not being able to run the
+ * test program. Other items from configure may also be wrong then!
+ */
+# if (SIZEOF_INT == 0)
+ Error: configure did not run properly. Check auto/config.log.
+# endif
+
+/*
+ * Cygwin may have fchdir() in a newer rleease, but in most versions it
+ * doesn't work well and avoiding it keeps the binary backward compatible.
+ */
+# if defined(__CYGWIN32__) && defined(HAVE_FCHDIR)
+# undef HAVE_FCHDIR
+# endif
+#endif
+
+#ifdef __EMX__ /* hand-edited config.h for OS/2 with EMX */
+# include "os_os2_cfg.h"
+#endif
+
+/*
+ * MACOS_CLASSIC compiling for MacOS prior to MacOS X
+ * MACOS_X_UNIX compiling for MacOS X (using os_unix.c)
+ * MACOS_X compiling for MacOS X (using os_unix.c or os_mac.c)
+ * MACOS compiling for either one
+ */
+#if defined(macintosh) && !defined(MACOS_CLASSIC)
+# define MACOS_CLASSIC
+#endif
+#if defined(MACOS_X_UNIX)
+# define MACOS_X
+# ifndef HAVE_CONFIG_H
+# define UNIX
+# endif
+#endif
+#if defined(MACOS_X) || defined(MACOS_CLASSIC)
+# define MACOS
+#endif
+#if defined(MACOS_X) && defined(MACOS_CLASSIC)
+ Error: To compile for both MACOS X and Classic use a Classic Carbon
+#endif
+/* Unless made through the Makefile enforce GUI on Mac */
+#if defined(MACOS) && !defined(HAVE_CONFIG_H)
+# define FEAT_GUI_MAC
+#endif
+
+
+#if defined(FEAT_GUI_MOTIF) \
+ || defined(FEAT_GUI_GTK) \
+ || defined(FEAT_GUI_ATHENA) \
+ || defined(FEAT_GUI_MAC) \
+ || defined(FEAT_GUI_W32) \
+ || defined(FEAT_GUI_W16) \
+ || defined(FEAT_GUI_BEOS) \
+ || defined(FEAT_GUI_AMIGA) \
+ || defined(FEAT_GUI_PHOTON)
+# ifndef FEAT_GUI
+# define FEAT_GUI
+# endif
+#endif
+
+#if defined(FEAT_GUI_W32) || defined(FEAT_GUI_W16)
+# define FEAT_GUI_MSWIN
+#endif
+#if defined(WIN16) || defined(WIN32) || defined(_WIN64)
+# define MSWIN
+#endif
+/* Practically everything is common to both Win32 and Win64 */
+#if defined(WIN32) || defined(_WIN64)
+# define WIN3264
+#endif
+
+/*
+ * SIZEOF_INT is used in feature.h, and the system-specific included files
+ * need items from feature.h. Therefore define SIZEOF_INT here.
+ */
+#ifdef WIN3264
+# define SIZEOF_INT 4
+#endif
+#ifdef MSDOS
+# ifdef DJGPP
+# ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
+# define SIZEOF_INT 4 /* 32 bit ints */
+# endif
+# define DOS32
+# define FEAT_CLIPBOARD
+# else
+# ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
+# define SIZEOF_INT 2 /* 16 bit ints */
+# endif
+# define SMALL_MALLOC /* 16 bit storage allocation */
+# define DOS16
+# endif
+#endif
+
+#ifdef AMIGA
+ /* Be conservative about sizeof(int). It could be 4 too. */
+# ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
+# ifdef __GNUC__
+# define SIZEOF_INT 4
+# else
+# define SIZEOF_INT 2
+# endif
+# endif
+#endif
+#ifdef MACOS
+# if defined(__POWERPC__) || defined(__fourbyteints__) \
+ || defined(__MRC__) || defined(__SC__) || defined(__APPLE_CC__)/* MPW Compilers */
+# define SIZEOF_INT 4
+# else
+# define SIZEOF_INT 2
+# endif
+#endif
+#ifdef RISCOS
+# define SIZEOF_INT 4
+#endif
+
+
+#include "feature.h" /* #defines for optionals and features */
+
+/* +x11 is only enabled when it's both available and wanted. */
+#if defined(HAVE_X11) && defined(WANT_X11)
+# define FEAT_X11
+#endif
+
+/* Can't use "PACKAGE" here, conflicts with a Perl include file. */
+#ifndef VIMPACKAGE
+# define VIMPACKAGE "vim"
+#endif
+
+/*
+ * Find out if function definitions should include argument types
+ */
+#ifdef AZTEC_C
+# include <functions.h>
+# define __ARGS(x) x
+#endif
+
+#ifdef SASC
+# include <clib/exec_protos.h>
+# define __ARGS(x) x
+#endif
+
+#ifdef _DCC
+# include <clib/exec_protos.h>
+# define __ARGS(x) x
+#endif
+
+#ifdef __TURBOC__
+# define __ARGS(x) x
+#endif
+
+#ifdef __BEOS__
+# include "os_beos.h"
+# define __ARGS(x) x
+#endif
+
+#if (defined(UNIX) || defined(__EMX__) || defined(VMS)) \
+ && (!defined(MACOS_X) || defined(HAVE_CONFIG_H))
+# include "os_unix.h" /* bring lots of system header files */
+#endif
+
+#if defined(MACOS) && (defined(__MRC__) || defined(__SC__))
+ /* Apple's Compilers support prototypes */
+# define __ARGS(x) x
+#endif
+#ifndef __ARGS
+# if defined(__STDC__) || defined(__GNUC__) || defined(WIN3264)
+# define __ARGS(x) x
+# else
+# define __ARGS(x) ()
+# endif
+#endif
+
+/* __ARGS and __PARMS are the same thing. */
+#ifndef __PARMS
+# define __PARMS(x) __ARGS(x)
+#endif
+
+#if defined(UNIX) && !defined(MACOS_X) /* MACOS_X doesn't yet support osdef.h */
+# include "auto/osdef.h" /* bring missing declarations in */
+#endif
+
+#ifdef __EMX__
+# define getcwd _getcwd2
+# define chdir _chdir2
+# undef CHECK_INODE
+#endif
+
+#ifdef AMIGA
+# include "os_amiga.h"
+#endif
+
+#ifdef MSDOS
+# include "os_msdos.h"
+#endif
+
+#ifdef WIN16
+# include "os_win16.h"
+#endif
+
+#ifdef WIN3264
+# include "os_win32.h"
+#endif
+
+#ifdef __MINT__
+# include "os_mint.h"
+#endif
+
+#if defined(MACOS)
+# if defined(__MRC__) || defined(__SC__) /* MPW Compilers */
+# define HAVE_SETENV
+# endif
+# include "os_mac.h"
+#endif
+
+#ifdef RISCOS
+# include "os_riscos.h"
+#endif
+
+#ifdef __QNX__
+# include "os_qnx.h"
+#endif
+
+#ifdef FEAT_SUN_WORKSHOP
+# include "workshop.h"
+#endif
+
+#ifdef X_LOCALE
+# include <X11/Xlocale.h>
+#else
+# ifdef HAVE_LOCALE_H
+# include <locale.h>
+# endif
+#endif
+
+/*
+ * Maximum length of a path (for non-unix systems) Make it a bit long, to stay
+ * on the safe side. But not too long to put on the stack.
+ */
+#ifndef MAXPATHL
+# ifdef MAXPATHLEN
+# define MAXPATHL MAXPATHLEN
+# else
+# define MAXPATHL 256
+# endif
+#endif
+#ifdef BACKSLASH_IN_FILENAME
+# define PATH_ESC_CHARS ((char_u *)" *?[{`%#")
+#else
+# ifdef COLON_AS_PATHSEP
+# define PATH_ESC_CHARS ((char_u *)" *?[{`$%#/")
+# else
+# define PATH_ESC_CHARS ((char_u *)" *?[{`$\\%#'\"|")
+# endif
+#endif
+
+#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
+
+/*
+ * Shorthand for unsigned variables. Many systems, but not all, have u_char
+ * already defined, so we use char_u to avoid trouble.
+ */
+typedef unsigned char char_u;
+typedef unsigned short short_u;
+typedef unsigned int int_u;
+/* Make sure long_u is big enough to hold a pointer. On Win64 longs are 32
+ * bit and pointers 64 bit. */
+#ifdef _WIN64
+typedef unsigned __int64 long_u;
+#else
+typedef unsigned long long_u;
+#endif
+
+/*
+ * The characters and attributes cached for the screen.
+ * Currently a single byte. The attributes may become larger some day.
+ */
+#define schar_T char_u
+#define sattr_T char_u
+
+/*
+ * The u8char_T can hold one decoded UTF-8 character.
+ * Vim always use an int (32 bits) for characters most places, so that we can
+ * handle 32 bit characters in the file. u8char_T is only used for
+ * displaying. That should be enough, because there is no font for > 16 bits.
+ */
+#ifdef FEAT_MBYTE
+typedef unsigned short u8char_T;
+#endif
+
+#ifndef UNIX /* For Unix this is included in os_unix.h */
+# include <stdio.h>
+# include <ctype.h>
+#endif
+
+#include "ascii.h"
+#include "keymap.h"
+#include "term.h"
+#include "macros.h"
+
+#ifdef LATTICE
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
+#ifdef _DCC
+# include <sys/stat.h>
+#endif
+#if defined(MSDOS) || defined(MSWIN)
+# include <sys/stat.h>
+#endif
+
+/*
+ * Allow other (non-unix) systems to configure themselves now
+ * These are also in os_unix.h, because osdef.sh needs them there.
+ */
+#ifndef UNIX
+/* Note: Some systems need both string.h and strings.h (Savage). If the
+ * system can't handle this, define NO_STRINGS_WITH_STRING_H. */
+# ifdef HAVE_STRING_H
+# include <string.h>
+# endif
+# if defined(HAVE_STRINGS_H) && !defined(NO_STRINGS_WITH_STRING_H)
+# include <strings.h>
+# endif
+# ifdef HAVE_STAT_H
+# include <stat.h>
+# endif
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif /* NON-UNIX */
+
+#include <assert.h>
+
+/* ================ end of the header file puzzle =============== */
+
+/*
+ * For dynamically loaded imm library. Currently, only for Win32.
+ */
+#ifdef DYNAMIC_IME
+# ifndef FEAT_MBYTE_IME
+# define FEAT_MBYTE_IME
+# endif
+#endif
+
+/*
+ * Check input method control.
+ */
+#if defined(FEAT_XIM) || \
+ (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)))
+# define USE_IM_CONTROL
+#endif
+
+/*
+ * For dynamically loaded gettext library. Currently, only for Win32.
+ */
+#ifdef DYNAMIC_GETTEXT
+# ifndef FEAT_GETTEXT
+# define FEAT_GETTEXT
+# endif
+/* These are in os_win32.c */
+extern char* (*dyn_libintl_gettext)(const char* msgid);
+extern char* (*dyn_libintl_bindtextdomain)(const char* domainname, const char* dirname);
+extern char* (*dyn_libintl_textdomain)(const char* domainname);
+#endif
+
+
+/*
+ * The _() stuff is for using gettext(). It is a no-op when libintl.h is not
+ * found or the +multilang feature is disabled.
+ */
+#ifdef FEAT_GETTEXT
+# ifdef DYNAMIC_GETTEXT
+# define _(x) (*dyn_libintl_gettext)((char *)(x))
+# define N_(x) x
+# define bindtextdomain(domain,dir) (*dyn_libintl_bindtextdomain)(domain,dir)
+# define textdomain(domain) (*dyn_libintl_textdomain)(domain)
+# else
+# include <libintl.h>
+# define _(x) gettext((char *)(x))
+# ifdef gettext_noop
+# define N_(x) gettext_noop(x)
+# else
+# define N_(x) x
+# endif
+# endif
+#else
+# define _(x) ((char *)(x))
+# define N_(x) x
+# ifdef bindtextdomain
+# undef bindtextdomain
+# endif
+# define bindtextdomain(x, y) /* empty */
+# ifdef textdomain
+# undef textdomain
+# endif
+# define textdomain(x) /* empty */
+#endif
+
+/*
+ * flags for update_screen()
+ * The higher the value, the higher the priority
+ */
+#define VALID 10 /* buffer not changed, or changes marked
+ with b_mod_* */
+#define INVERTED 20 /* redisplay inverted part that changed */
+#define INVERTED_ALL 25 /* redisplay whole inverted part */
+#define REDRAW_TOP 30 /* display first w_upd_rows screen lines */
+#define NOT_VALID 40 /* buffer needs complete redraw */
+#define CLEAR 50 /* screen messed up, clear it */
+
+/*
+ * Hints used to optimize screen updating.
+ */
+#define HINT_NONE 0 /* no current hint */
+#define HINT_DEL_CHAR 1 /* delete character */
+#define HINT_INS_CHAR 2 /* insert character */
+
+/*
+ * Flags for w_valid.
+ * These are set when something in a window structure becomes invalid, except
+ * when the cursor is moved. Call check_cursor_moved() before testing one of
+ * the flags.
+ * These are reset when that thing has been updated and is valid again.
+ *
+ * Every function that invalidates one of these must call one of the
+ * invalidate_* functions.
+ *
+ * w_valid is supposed to be used only in screen.c. From other files, use the
+ * functions that set or reset the flags.
+ *
+ * VALID_BOTLINE VALID_BOTLINE_AP
+ * on on w_botline valid
+ * off on w_botline approximated
+ * off off w_botline not valid
+ * on off not possible
+ */
+#define VALID_WROW 0x01 /* w_wrow (window row) is valid */
+#define VALID_WCOL 0x02 /* w_wcol (window col) is valid */
+#define VALID_VIRTCOL 0x04 /* w_virtcol (file col) is valid */
+#define VALID_CHEIGHT 0x08 /* w_cline_height and w_cline_folded valid */
+#define VALID_CROW 0x10 /* w_cline_row is valid */
+#define VALID_BOTLINE 0x20 /* w_botine and w_empty_rows are valid */
+#define VALID_BOTLINE_AP 0x40 /* w_botine is approximated */
+#define VALID_TOPLINE 0x80 /* w_topline is valid (for cursor position) */
+
+/*
+ * Terminal highlighting attribute bits.
+ * Attibutes above HL_ALL are used for syntax highlighting.
+ */
+#define HL_NORMAL 0x00
+#define HL_INVERSE 0x01
+#define HL_BOLD 0x02
+#define HL_ITALIC 0x04
+#define HL_UNDERLINE 0x08
+#define HL_STANDOUT 0x10
+#define HL_ALL 0x1f
+
+/* special attribute addition: Put message in history */
+#define MSG_HIST 0x1000
+
+/*
+ * values for State
+ *
+ * The lower bits up to 0x20 are used to distinguish normal/visual/op_pending
+ * and cmdline/insert+replace mode. This is used for mapping. If none of
+ * these bits are set, no mapping is done.
+ * The upper bits are used to distinguish between other states.
+ */
+#define NORMAL 0x01 /* Normal mode, command expected */
+#define VISUAL 0x02 /* Visual mode - use get_real_state() */
+#define OP_PENDING 0x04 /* Normal mode, operator is pending - use
+ get_real_state() */
+#define CMDLINE 0x08 /* Editing command line */
+#define INSERT 0x10 /* Insert mode */
+#define LANGMAP 0x20 /* Language mapping, can be combined with
+ INSERT and CMDLINE */
+#define MAP_ALL_MODES 0x3f /* all mode bits used for mapping */
+
+#define REPLACE_FLAG 0x40 /* Replace mode flag */
+#define REPLACE (REPLACE_FLAG + INSERT)
+#ifdef FEAT_VREPLACE
+# define VREPLACE_FLAG 0x80 /* Virtual-replace mode flag */
+# define VREPLACE (REPLACE_FLAG + VREPLACE_FLAG + INSERT)
+#endif
+#define LREPLACE (REPLACE_FLAG + LANGMAP)
+
+#define NORMAL_BUSY (0x100 + NORMAL) /* Normal mode, busy with a command */
+#define HITRETURN (0x200 + NORMAL) /* waiting for return or command */
+#define ASKMORE 0x300 /* Asking if you want --more-- */
+#define SETWSIZE 0x400 /* window size has changed */
+#define ABBREV 0x500 /* abbreviation instead of mapping */
+#define EXTERNCMD 0x600 /* executing an external command */
+#define SHOWMATCH (0x700 + INSERT) /* show matching paren */
+#define CONFIRM 0x800 /* ":confirm" prompt */
+
+/* directions */
+#define FORWARD 1
+#define BACKWARD (-1)
+#define FORWARD_FILE 3
+#define BACKWARD_FILE (-3)
+
+/* return values for functions */
+#if !(defined(OK) && (OK == 1))
+/* OK already defined to 1 in MacOS X curses, skip this */
+# define OK 1
+#endif
+#define FAIL 0
+
+/* flags for b_flags */
+#define BF_RECOVERED 0x01 /* buffer has been recovered */
+#define BF_CHECK_RO 0x02 /* need to check readonly when loading file
+ into buffer (set by ":e", may be reset by
+ ":buf" */
+#define BF_NEVERLOADED 0x04 /* file has never been loaded into buffer,
+ many variables still need to be set */
+#define BF_NOTEDITED 0x08 /* Set when file name is changed after
+ starting to edit, reset when file is
+ written out. */
+#define BF_NEW 0x10 /* file didn't exist when editing started */
+#define BF_NEW_W 0x20 /* Warned for BF_NEW and file created */
+#define BF_READERR 0x40 /* got errors while reading the file */
+
+/* Mask to check for flags that prevent normal writing */
+#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
+
+/*
+ * values for xp_context when doing command line completion
+ */
+#define CONTEXT_UNKNOWN (-3)
+#define EXPAND_UNSUCCESSFUL (-2)
+#define EXPAND_OK (-1)
+#define EXPAND_NOTHING 0
+#define EXPAND_COMMANDS 1
+#define EXPAND_FILES 2
+#define EXPAND_DIRECTORIES 3
+#define EXPAND_SETTINGS 4
+#define EXPAND_BOOL_SETTINGS 5
+#define EXPAND_TAGS 6
+#define EXPAND_OLD_SETTING 7
+#define EXPAND_HELP 8
+#define EXPAND_BUFFERS 9
+#define EXPAND_EVENTS 10
+#define EXPAND_MENUS 11
+#define EXPAND_SYNTAX 12
+#define EXPAND_HIGHLIGHT 13
+#define EXPAND_AUGROUP 14
+#define EXPAND_USER_VARS 15
+#define EXPAND_MAPPINGS 16
+#define EXPAND_TAGS_LISTFILES 17
+#define EXPAND_FUNCTIONS 18
+#define EXPAND_USER_FUNC 19
+#define EXPAND_EXPRESSION 20
+#define EXPAND_MENUNAMES 21
+#define EXPAND_USER_COMMANDS 22
+#define EXPAND_USER_CMD_FLAGS 23
+#define EXPAND_USER_NARGS 24
+#define EXPAND_USER_COMPLETE 25
+#define EXPAND_ENV_VARS 26
+#define EXPAND_LANGUAGE 27
+#define EXPAND_COLORS 28
+#define EXPAND_COMPILER 29
+#define EXPAND_USER_DEFINED 30
+
+/* Values for exmode_active (0 is no exmode) */
+#define EXMODE_NORMAL 1
+#define EXMODE_VIM 2
+
+/* Values for nextwild() and ExpandOne(). See ExpandOne() for meaning. */
+#define WILD_FREE 1
+#define WILD_EXPAND_FREE 2
+#define WILD_EXPAND_KEEP 3
+#define WILD_NEXT 4
+#define WILD_PREV 5
+#define WILD_ALL 6
+#define WILD_LONGEST 7
+
+#define WILD_LIST_NOTFOUND 1
+#define WILD_HOME_REPLACE 2
+#define WILD_USE_NL 4
+#define WILD_NO_BEEP 8
+#define WILD_ADD_SLASH 16
+#define WILD_KEEP_ALL 32
+#define WILD_SILENT 64
+#define WILD_ESCAPE 128
+
+/* Flags for expand_wildcards() */
+#define EW_DIR 1 /* include directory names */
+#define EW_FILE 2 /* include file names */
+#define EW_NOTFOUND 4 /* include not found names */
+#define EW_ADDSLASH 8 /* append slash to directory name */
+#define EW_KEEPALL 16 /* keep all matches */
+#define EW_SILENT 32 /* don't print "1 returned" from shell */
+/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
+ * is used when executing commands and EW_SILENT for interactive expanding. */
+
+#ifdef FEAT_VERTSPLIT
+# define W_WINCOL(wp) (wp->w_wincol)
+# define W_WIDTH(wp) (wp->w_width)
+# define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
+# define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
+#else
+# define W_WINCOL(wp) 0
+# define W_WIDTH(wp) Columns
+# define W_ENDCOL(wp) Columns
+# define W_VSEP_WIDTH(wp) 0
+#endif
+#ifdef FEAT_WINDOWS
+# define W_STATUS_HEIGHT(wp) (wp->w_status_height)
+# define W_WINROW(wp) (wp->w_winrow)
+#else
+# define W_STATUS_HEIGHT(wp) 0
+# define W_WINROW(wp) 0
+#endif
+
+#ifdef NO_EXPANDPATH
+# define gen_expand_wildcards mch_expand_wildcards
+#endif
+
+/* Values for the find_pattern_in_path() function args 'type' and 'action': */
+#define FIND_ANY 1
+#define FIND_DEFINE 2
+#define CHECK_PATH 3
+
+#define ACTION_SHOW 1
+#define ACTION_GOTO 2
+#define ACTION_SPLIT 3
+#define ACTION_SHOW_ALL 4
+#ifdef FEAT_INS_EXPAND
+# define ACTION_EXPAND 5
+#endif
+
+#ifdef FEAT_SYN_HL
+# define SST_MIN_ENTRIES 150 /* minimal size for state stack array */
+# ifdef FEAT_GUI_W16
+# define SST_MAX_ENTRIES 500 /* (only up to 64K blocks) */
+# else
+# define SST_MAX_ENTRIES 1000 /* maximal size for state stack array */
+# endif
+# define SST_FIX_STATES 7 /* size of sst_stack[]. */
+# define SST_DIST 16 /* normal distance between entries */
+# define SST_INVALID (synstate_T *)-1 /* invalid syn_state pointer */
+#endif
+
+/* Values for 'options' argument in do_search() and searchit() */
+#define SEARCH_REV 0x01 /* go in reverse of previous dir. */
+#define SEARCH_ECHO 0x02 /* echo the search command and handle options */
+#define SEARCH_MSG 0x0c /* give messages (yes, it's not 0x04) */
+#define SEARCH_NFMSG 0x08 /* give all messages except not found */
+#define SEARCH_OPT 0x10 /* interpret optional flags */
+#define SEARCH_HIS 0x20 /* put search pattern in history */
+#define SEARCH_END 0x40 /* put cursor at end of match */
+#define SEARCH_NOOF 0x80 /* don't add offset to position */
+#define SEARCH_START 0x100 /* start search without col offset */
+#define SEARCH_MARK 0x200 /* set previous context mark */
+#define SEARCH_KEEP 0x400 /* keep previous search pattern */
+#define SEARCH_PEEK 0x800 /* peek for typed char, cancel search */
+
+/* Values for find_ident_under_cursor() */
+#define FIND_IDENT 1 /* find identifier (word) */
+#define FIND_STRING 2 /* find any string (WORD) */
+#define FIND_EVAL 4 /* include "->", "[]" and "." */
+
+/* Values for file_name_in_line() */
+#define FNAME_MESS 1 /* give error message */
+#define FNAME_EXP 2 /* expand to path */
+#define FNAME_HYP 4 /* check for hypertext link */
+#define FNAME_INCL 8 /* apply 'includeexpr' */
+#define FNAME_REL 16 /* ".." and "./" are relative to the (current)
+ file instead of the current directory */
+
+/* Values for buflist_getfile() */
+#define GETF_SETMARK 0x01 /* set pcmark before jumping */
+#define GETF_ALT 0x02 /* jumping to alternate file (not buf num) */
+#define GETF_SWITCH 0x04 /* respect 'switchbuf' settings when jumping */
+
+/* Values for buflist_new() flags */
+#define BLN_CURBUF 1 /* May re-use curbuf for new buffer */
+#define BLN_LISTED 2 /* Put new buffer in buffer list */
+#define BLN_DUMMY 4 /* Allocating dummy buffer */
+#define BLN_FORCE 8 /* Don't abort on error */
+
+/* Values for in_cinkeys() */
+#define KEY_OPEN_FORW 0x101
+#define KEY_OPEN_BACK 0x102
+#define KEY_COMPLETE 0x103 /* end of completion */
+
+/* Values for "noremap" argument of ins_typebuf(). Also used for
+ * map->m_noremap and menu->noremap[]. */
+#define REMAP_YES 0 /* allow remapping */
+#define REMAP_NONE -1 /* no remapping */
+#define REMAP_SCRIPT -2 /* remap script-local mappings only */
+
+/* Values for mch_call_shell() second argument */
+#define SHELL_FILTER 1 /* filtering text */
+#define SHELL_EXPAND 2 /* expanding wildcards */
+#define SHELL_COOKED 4 /* set term to cooked mode */
+#define SHELL_DOOUT 8 /* redirecting output */
+#define SHELL_SILENT 16 /* don't print error returned by command */
+
+/* Values returned by mch_nodetype() */
+#define NODE_NORMAL 0 /* file or directory, check with mch_isdir()*/
+#define NODE_WRITABLE 1 /* something we can write to (character
+ device, fifo, socket, ..) */
+#define NODE_OTHER 2 /* non-writable thing (e.g., block device) */
+
+/* Values for readfile() flags */
+#define READ_NEW 0x01 /* read a file into a new buffer */
+#define READ_FILTER 0x02 /* read filter output */
+#define READ_STDIN 0x04 /* read from stdin */
+#define READ_BUFFER 0x08 /* read from curbuf (converting stdin) */
+#define READ_DUMMY 0x10 /* reading into a dummy buffer */
+
+/* Values for change_indent() */
+#define INDENT_SET 1 /* set indent */
+#define INDENT_INC 2 /* increase indent */
+#define INDENT_DEC 3 /* decrease indent */
+
+/* Values for flags argument for findmatchlimit() */
+#define FM_BACKWARD 0x01 /* search backwards */
+#define FM_FORWARD 0x02 /* search forwards */
+#define FM_BLOCKSTOP 0x04 /* stop at start/end of block */
+#define FM_SKIPCOMM 0x08 /* skip comments */
+
+/* Values for action argument for do_buffer() */
+#define DOBUF_GOTO 0 /* go to specified buffer */
+#define DOBUF_SPLIT 1 /* split window and go to specified buffer */
+#define DOBUF_UNLOAD 2 /* unload specified buffer(s) */
+#define DOBUF_DEL 3 /* delete specified buffer(s) from buflist */
+#define DOBUF_WIPE 4 /* delete specified buffer(s) really */
+
+/* Values for start argument for do_buffer() */
+#define DOBUF_CURRENT 0 /* "count" buffer from current buffer */
+#define DOBUF_FIRST 1 /* "count" buffer from first buffer */
+#define DOBUF_LAST 2 /* "count" buffer from last buffer */
+#define DOBUF_MOD 3 /* "count" mod. buffer from current buffer */
+
+/* Values for sub_cmd and which_pat argument for search_regcomp() */
+/* Also used for which_pat argument for searchit() */
+#define RE_SEARCH 0 /* save/use pat in/from search_pattern */
+#define RE_SUBST 1 /* save/use pat in/from subst_pattern */
+#define RE_BOTH 2 /* save pat in both patterns */
+#define RE_LAST 2 /* use last used pattern if "pat" is NULL */
+
+/* Second argument for vim_regcomp(). */
+#define RE_MAGIC 1 /* 'magic' option */
+#define RE_STRING 2 /* match in string instead of buffer text */
+
+#ifdef FEAT_SYN_HL
+/* values for reg_do_extmatch */
+# define REX_SET 1 /* to allow \z\(...\), */
+# define REX_USE 2 /* to allow \z\1 et al. */
+#endif
+
+/* Return values for fullpathcmp() */
+/* Note: can use (fullpathcmp() & FPC_SAME) to check for equal files */
+#define FPC_SAME 1 /* both exist and are the same file. */
+#define FPC_DIFF 2 /* both exist and are different files. */
+#define FPC_NOTX 4 /* both don't exist. */
+#define FPC_DIFFX 6 /* one of them doesn't exist. */
+#define FPC_SAMEX 7 /* both don't exist and file names are same. */
+
+/* flags for do_ecmd() */
+#define ECMD_HIDE 0x01 /* don't free the current buffer */
+#define ECMD_SET_HELP 0x02 /* set b_help flag of (new) buffer before
+ opening file */
+#define ECMD_OLDBUF 0x04 /* use existing buffer if it exists */
+#define ECMD_FORCEIT 0x08 /* ! used in Ex command */
+#define ECMD_ADDBUF 0x10 /* don't edit, just add to buffer list */
+
+/* for lnum argument in do_ecmd() */
+#define ECMD_LASTL (linenr_T)0 /* use last position in loaded file */
+#define ECMD_LAST (linenr_T)-1 /* use last position in all files */
+#define ECMD_ONE (linenr_T)1 /* use first line */
+
+/* flags for do_cmdline() */
+#define DOCMD_VERBOSE 0x01 /* included command in error message */
+#define DOCMD_NOWAIT 0x02 /* don't call wait_return() and friends */
+#define DOCMD_REPEAT 0x04 /* repeat exec. until getline() returns NULL */
+#define DOCMD_KEYTYPED 0x08 /* don't reset KeyTyped */
+#define DOCMD_EXCRESET 0x10 /* reset exception environment (for debugging)*/
+#define DOCMD_KEEPLINE 0x20 /* keep typed line for repeating with "." */
+
+/* flags for beginline() */
+#define BL_WHITE 1 /* cursor on first non-white in the line */
+#define BL_SOL 2 /* use 'sol' option */
+#define BL_FIX 4 /* don't leave cursor on a NUL */
+
+/* flags for mf_sync() */
+#define MFS_ALL 1 /* also sync blocks with negative numbers */
+#define MFS_STOP 2 /* stop syncing when a character is available */
+#define MFS_FLUSH 4 /* flushed file to disk */
+#define MFS_ZERO 8 /* only write block 0 */
+
+/* flags for buf_copy_options() */
+#define BCO_ENTER 1 /* going to enter the buffer */
+#define BCO_ALWAYS 2 /* always copy the options */
+#define BCO_NOHELP 4 /* don't touch the help related options */
+
+/* flags for do_put() */
+#define PUT_FIXINDENT 1 /* make indent look nice */
+#define PUT_CURSEND 2 /* leave cursor after end of new text */
+#define PUT_LINE 4 /* put register as lines */
+#define PUT_LINE_SPLIT 8 /* split line for linewise register */
+#define PUT_LINE_FORWARD 16 /* put linewise register below Visual sel. */
+
+/* flags for set_indent() */
+#define SIN_CHANGED 1 /* call changed_bytes() when line changed */
+#define SIN_INSERT 2 /* insert indent before existing text */
+#define SIN_UNDO 4 /* save line for undo before changing it */
+
+/* flags for insertchar() */
+#define INSCHAR_FORMAT 1 /* force formatting */
+#define INSCHAR_DO_COM 2 /* format comments */
+#define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
+
+/* flags for open_line() */
+#define OPENLINE_DELSPACES 1 /* delete spaces after cursor */
+#define OPENLINE_DO_COM 2 /* format comments */
+#define OPENLINE_KEEPTRAIL 4 /* keep trailing spaces */
+#define OPENLINE_MARKFIX 8 /* fix mark positions */
+
+/*
+ * There are four history tables:
+ */
+#define HIST_CMD 0 /* colon commands */
+#define HIST_SEARCH 1 /* search commands */
+#define HIST_EXPR 2 /* expressions (from entering = register) */
+#define HIST_INPUT 3 /* input() lines */
+#define HIST_DEBUG 4 /* debug commands */
+#define HIST_COUNT 5 /* number of history tables */
+
+/*
+ * Flags for chartab[].
+ */
+#define CT_CELL_MASK 0x07 /* mask: nr of display cells (1, 2 or 4) */
+#define CT_PRINT_CHAR 0x10 /* flag: set for printable chars */
+#define CT_ID_CHAR 0x20 /* flag: set for ID chars */
+#define CT_FNAME_CHAR 0x40 /* flag: set for file name chars */
+
+/*
+ * Values for do_tag().
+ */
+#define DT_TAG 1 /* jump to newer position or same tag again */
+#define DT_POP 2 /* jump to older position */
+#define DT_NEXT 3 /* jump to next match of same tag */
+#define DT_PREV 4 /* jump to previous match of same tag */
+#define DT_FIRST 5 /* jump to first match of same tag */
+#define DT_LAST 6 /* jump to first match of same tag */
+#define DT_SELECT 7 /* jump to selection from list */
+#define DT_HELP 8 /* like DT_TAG, but no wildcards */
+#define DT_JUMP 9 /* jump to new tag or selection from list */
+#define DT_CSCOPE 10 /* cscope find command (like tjump) */
+
+/*
+ * flags for find_tags().
+ */
+#define TAG_HELP 1 /* only search for help tags */
+#define TAG_NAMES 2 /* only return name of tag */
+#define TAG_REGEXP 4 /* use tag pattern as regexp */
+#define TAG_NOIC 8 /* don't always ignore case */
+#ifdef FEAT_CSCOPE
+# define TAG_CSCOPE 16 /* cscope tag */
+#endif
+#define TAG_VERBOSE 32 /* message verbosity */
+#define TAG_INS_COMP 64 /* Currently doing insert completion */
+#define TAG_KEEP_LANG 128 /* keep current language */
+
+#define TAG_MANY 200 /* When finding many tags (for completion),
+ find up to this many tags */
+
+/*
+ * Types of dialogs passed to do_vim_dialog().
+ */
+#define VIM_GENERIC 0
+#define VIM_ERROR 1
+#define VIM_WARNING 2
+#define VIM_INFO 3
+#define VIM_QUESTION 4
+#define VIM_LAST_TYPE 4 /* sentinel value */
+
+/*
+ * Return values for functions like gui_yesnocancel()
+ */
+#define VIM_OK 1
+#define VIM_YES 2
+#define VIM_NO 3
+#define VIM_CANCEL 4
+#define VIM_ALL 5
+#define VIM_DISCARDALL 6
+
+/*
+ * arguments for win_split()
+ */
+#define WSP_ROOM 1 /* require enough room */
+#define WSP_VERT 2 /* split vertically */
+#define WSP_TOP 4 /* window at top-left of shell */
+#define WSP_BOT 8 /* window at bottom-right of shell */
+#define WSP_HELP 16 /* creating the help window */
+#define WSP_BELOW 32 /* put new window below/right */
+#define WSP_ABOVE 64 /* put new window above/left */
+
+/*
+ * "flags" values for option-setting functions.
+ * When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global
+ * values, get local value.
+ */
+#define OPT_FREE 1 /* free old value if it was allocated */
+#define OPT_GLOBAL 2 /* use global value */
+#define OPT_LOCAL 4 /* use local value */
+#define OPT_MODELINE 8 /* option in modeline */
+
+/* Magic chars used in confirm dialog strings */
+#define DLG_BUTTON_SEP '\n'
+#define DLG_HOTKEY_CHAR '&'
+
+/* Values for "starting" */
+#define NO_SCREEN 2 /* no screen updating yet */
+#define NO_BUFFERS 1 /* not all buffers loaded yet */
+/* 0 not starting anymore */
+
+/* Values for swap_exists_action: what to do when swap file already exists */
+#define SEA_NONE 0 /* don't use dialog */
+#define SEA_DIALOG 1 /* use dialog when */
+#define SEA_QUIT 2 /* quit editing the file */
+#define SEA_RECOVER 3 /* recover the file */
+
+/*
+ * Minimal size for block 0 of a swap file.
+ * NOTE: This depends on size of struct block0! It's not done with a sizeof(),
+ * because struct block0 is defined in memline.c (Sorry).
+ * The maximal block size is arbitrary.
+ */
+#define MIN_SWAP_PAGE_SIZE 1048
+#define MAX_SWAP_PAGE_SIZE 50000
+
+/* Special values for current_SID. */
+#define SID_MODELINE -1 /* when using a modeline */
+#define SID_CMDARG -2 /* for "--cmd" argument */
+#define SID_CARG -3 /* for "-c" argument */
+#define SID_ENV -4 /* for sourcing environment variable */
+
+/*
+ * Events for autocommands.
+ */
+enum auto_event
+{
+ EVENT_BUFADD = 0, /* after adding a buffer to the buffer list */
+ EVENT_BUFNEW, /* after creating any buffer */
+ EVENT_BUFDELETE, /* deleting a buffer from the buffer list */
+ EVENT_BUFWIPEOUT, /* just before really deleting a buffer */
+ EVENT_BUFENTER, /* after entering a buffer */
+ EVENT_BUFFILEPOST, /* after renaming a buffer */
+ EVENT_BUFFILEPRE, /* before renaming a buffer */
+ EVENT_BUFLEAVE, /* before leaving a buffer */
+ EVENT_BUFNEWFILE, /* when creating a buffer for a new file */
+ EVENT_BUFREADPOST, /* after reading a buffer */
+ EVENT_BUFREADPRE, /* before reading a buffer */
+ EVENT_BUFREADCMD, /* read buffer using command */
+ EVENT_BUFUNLOAD, /* just before unloading a buffer */
+ EVENT_BUFHIDDEN, /* just after buffer becomes hidden */
+ EVENT_BUFWINENTER, /* after showing a buffer in a window */
+ EVENT_BUFWINLEAVE, /* just after buffer removed from window */
+ EVENT_BUFWRITEPOST, /* after writing a buffer */
+ EVENT_BUFWRITEPRE, /* before writing a buffer */
+ EVENT_BUFWRITECMD, /* write buffer using command */
+ EVENT_CMDWINENTER, /* after entering the cmdline window */
+ EVENT_CMDWINLEAVE, /* before leaving the cmdline window */
+ EVENT_FILEAPPENDPOST, /* after appending to a file */
+ EVENT_FILEAPPENDPRE, /* before appending to a file */
+ EVENT_FILEAPPENDCMD, /* appende to a file using command */
+ EVENT_FILECHANGEDSHELL, /* after shell command that changed file */
+ EVENT_FILECHANGEDRO, /* before first change to read-only file */
+ EVENT_FILEREADPOST, /* after reading a file */
+ EVENT_FILEREADPRE, /* before reading a file */
+ EVENT_FILEREADCMD, /* read from a file using command */
+ EVENT_FILETYPE, /* new file type detected (user defined) */
+ EVENT_FILEWRITEPOST, /* after writing a file */
+ EVENT_FILEWRITEPRE, /* before writing a file */
+ EVENT_FILEWRITECMD, /* write to a file using command */
+ EVENT_FILTERREADPOST, /* after reading from a filter */
+ EVENT_FILTERREADPRE, /* before reading from a filter */
+ EVENT_FILTERWRITEPOST, /* after writing to a filter */
+ EVENT_FILTERWRITEPRE, /* before writing to a filter */
+ EVENT_FOCUSGAINED, /* got the focus */
+ EVENT_FOCUSLOST, /* lost the focus to another app */
+ EVENT_GUIENTER, /* after starting the GUI */
+ EVENT_STDINREADPOST, /* after reading from stdin */
+ EVENT_STDINREADPRE, /* before reading from stdin */
+ EVENT_SYNTAX, /* syntax selected */
+ EVENT_TERMCHANGED, /* after changing 'term' */
+ EVENT_TERMRESPONSE, /* after setting "v:termresponse" */
+ EVENT_USER, /* user defined autocommand */
+ EVENT_VIMENTER, /* after starting Vim */
+ EVENT_VIMLEAVE, /* before exiting Vim */
+ EVENT_VIMLEAVEPRE, /* before exiting Vim and writing .viminfo */
+ EVENT_WINENTER, /* after entering a window */
+ EVENT_WINLEAVE, /* before leaving a window */
+ EVENT_ENCODINGCHANGED, /* after changing the 'encoding' option */
+ EVENT_CURSORHOLD, /* cursor in same position for a while */
+ EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
+ EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
+ NUM_EVENTS /* MUST be the last one */
+};
+
+typedef enum auto_event EVENT_T;
+
+/*
+ * Values for index in highlight_attr[].
+ * When making changes, also update HL_FLAGS below! And update the default
+ * value of 'highlight' in option.c.
+ */
+enum hlf_value
+{
+ HLF_8 = 0 /* Meta & special keys listed with ":map", text that is
+ displayed different from what it is */
+ , HLF_AT /* @ and ~ characters at end of screen, characters that
+ don't really exist in the text */
+ , HLF_D /* directories in CTRL-D listing */
+ , HLF_E /* error messages */
+ , HLF_H /* obsolete, ignored */
+ , HLF_I /* incremental search */
+ , HLF_L /* last search string */
+ , HLF_M /* "--More--" message */
+ , HLF_CM /* Mode (e.g., "-- INSERT --") */
+ , HLF_N /* line number for ":number" and ":#" commands */
+ , HLF_R /* return to continue message and yes/no questions */
+ , HLF_S /* status lines */
+ , HLF_SNC /* status lines of not-current windows */
+ , HLF_C /* column to separate vertically split windows */
+ , HLF_T /* Titles for output from ":set all", ":autocmd" etc. */
+ , HLF_V /* Visual mode */
+ , HLF_VNC /* Visual mode, autoselecting and not clipboard owner */
+ , HLF_W /* warning messages */
+ , HLF_WM /* Wildmenu highlight */
+ , HLF_FL /* Folded line */
+ , HLF_FC /* Fold column */
+ , HLF_ADD /* Added diff line */
+ , HLF_CHD /* Changed diff line */
+ , HLF_DED /* Deleted diff line */
+ , HLF_TXD /* Text Changed in diff line */
+ , HLF_SC /* Sign column */
+ , HLF_COUNT /* MUST be the last one */
+};
+
+/* the HL_FLAGS must be in the same order as the HLF_ enums! */
+#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
+ 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
+ 'f', 'F', 'A', 'C', 'D', 'T', '>'}
+
+/*
+ * Boolean constants
+ */
+#ifndef TRUE
+# define FALSE 0 /* note: this is an int, not a long! */
+# define TRUE 1
+#endif
+
+#define MAYBE 2 /* sometimes used for a variant on TRUE */
+
+/* May be returned by add_new_completion(): */
+#define RET_ERROR (-1)
+
+/*
+ * Operator IDs; The order must correspond to opchars[] in ops.c!
+ */
+#define OP_NOP 0 /* no pending operation */
+#define OP_DELETE 1 /* "d" delete operator */
+#define OP_YANK 2 /* "y" yank operator */
+#define OP_CHANGE 3 /* "c" change operator */
+#define OP_LSHIFT 4 /* "<" left shift operator */
+#define OP_RSHIFT 5 /* ">" right shift operator */
+#define OP_FILTER 6 /* "!" filter operator */
+#define OP_TILDE 7 /* "g~" switch case operator */
+#define OP_INDENT 8 /* "=" indent operator */
+#define OP_FORMAT 9 /* "gq" format operator */
+#define OP_COLON 10 /* ":" colon operator */
+#define OP_UPPER 11 /* "gU" make upper case operator */
+#define OP_LOWER 12 /* "gu" make lower case operator */
+#define OP_JOIN 13 /* "J" join operator, only for Visual mode */
+#define OP_JOIN_NS 14 /* "gJ" join operator, only for Visual mode */
+#define OP_ROT13 15 /* "g?" rot-13 encoding */
+#define OP_REPLACE 16 /* "r" replace chars, only for Visual mode */
+#define OP_INSERT 17 /* "I" Insert column, only for Visual mode */
+#define OP_APPEND 18 /* "A" Append column, only for Visual mode */
+#define OP_FOLD 19 /* "zf" define a fold */
+#define OP_FOLDOPEN 20 /* "zo" open folds */
+#define OP_FOLDOPENREC 21 /* "zO" open folds recursively */
+#define OP_FOLDCLOSE 22 /* "zc" close folds */
+#define OP_FOLDCLOSEREC 23 /* "zC" close folds recursively */
+#define OP_FOLDDEL 24 /* "zd" delete folds */
+#define OP_FOLDDELREC 25 /* "zD" delete folds recursively */
+#define OP_FORMAT2 26 /* "gw" format operator, keeps cursor pos */
+
+/*
+ * Motion types, used for operators and for yank/delete registers.
+ */
+#define MCHAR 0 /* character-wise movement/register */
+#define MLINE 1 /* line-wise movement/register */
+#define MBLOCK 2 /* block-wise register */
+
+#define MAUTO 0xff /* Decide between MLINE/MCHAR */
+
+/*
+ * Minimum screen size
+ */
+#define MIN_COLUMNS 12 /* minimal columns for screen */
+#define MIN_LINES 2 /* minimal lines for screen */
+#define STATUS_HEIGHT 1 /* height of a status line under a window */
+#define QF_WINHEIGHT 10 /* default height for quickfix window */
+
+/*
+ * Buffer sizes
+ */
+#ifndef CMDBUFFSIZE
+# define CMDBUFFSIZE 256 /* size of the command processing buffer */
+#endif
+
+#define LSIZE 512 /* max. size of a line in the tags file */
+
+#define IOSIZE (1024+1) /* file i/o and sprintf buffer size */
+#define MSG_BUF_LEN 80 /* length of buffer for small messages */
+
+#if defined(AMIGA) || defined(__linux__) || defined(__QNX__) || defined(__CYGWIN32__) || defined(_AIX)
+# define TBUFSZ 2048 /* buffer size for termcap entry */
+#else
+# define TBUFSZ 1024 /* buffer size for termcap entry */
+#endif
+
+/*
+ * Maximum length of key sequence to be mapped.
+ * Must be able to hold an Amiga resize report.
+ */
+#define MAXMAPLEN 50
+
+#ifdef BINARY_FILE_IO
+# define WRITEBIN "wb" /* no CR-LF translation */
+# define READBIN "rb"
+# define APPENDBIN "ab"
+#else
+# define WRITEBIN "w"
+# define READBIN "r"
+# define APPENDBIN "a"
+#endif
+
+/*
+ * EMX doesn't have a global way of making open() use binary I/O.
+ * Use O_BINARY for all open() calls.
+ */
+#if defined(__EMX__) || defined(__CYGWIN32__)
+# define O_EXTRA O_BINARY
+#else
+# define O_EXTRA 0
+#endif
+
+#ifndef W_OK
+# define W_OK 2 /* for systems that don't have W_OK in unistd.h */
+#endif
+#ifndef R_OK
+# define R_OK 4 /* for systems that don't have R_OK in unistd.h */
+#endif
+
+/*
+ * defines to avoid typecasts from (char_u *) to (char *) and back
+ * (vim_strchr() and vim_strrchr() are now in alloc.c)
+ */
+#define STRLEN(s) strlen((char *)(s))
+#define STRCPY(d, s) strcpy((char *)(d), (char *)(s))
+#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n))
+#define STRCMP(d, s) strcmp((char *)(d), (char *)(s))
+#define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n))
+#ifdef HAVE_STRCASECMP
+# define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s))
+#else
+# ifdef HAVE_STRICMP
+# define STRICMP(d, s) stricmp((char *)(d), (char *)(s))
+# else
+# define STRICMP(d, s) vim_stricmp((char *)(d), (char *)(s))
+# endif
+#endif
+
+#ifdef HAVE_STRNCASECMP
+# define STRNICMP(d, s, n) strncasecmp((char *)(d), (char *)(s), (size_t)(n))
+#else
+# ifdef HAVE_STRNICMP
+# define STRNICMP(d, s, n) strnicmp((char *)(d), (char *)(s), (size_t)(n))
+# else
+# define STRNICMP(d, s, n) vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))
+# endif
+#endif
+
+#ifdef FEAT_MBYTE
+# define MB_STRICMP(d, s) (has_mbyte ? mb_strnicmp((char_u *)(d), (char_u *)(s), (int)MAXCOL) : STRICMP((d), (s)))
+# define MB_STRNICMP(d, s, n) (has_mbyte ? mb_strnicmp((char_u *)(d), (char_u *)(s), (int)(n)) : STRNICMP((d), (s), (n)))
+#else
+# define MB_STRICMP(d, s) STRICMP((d), (s))
+# define MB_STRNICMP(d, s, n) STRNICMP((d), (s), (n))
+# define transchar_byte(c) transchar(c)
+#endif
+
+#define STRCAT(d, s) strcat((char *)(d), (char *)(s))
+#define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n))
+
+#ifdef HAVE_STRPBRK
+# define vim_strpbrk(s, cs) (char_u *)strpbrk((char *)(s), (char *)(cs))
+#endif
+
+#define MSG(s) msg((char_u *)(s))
+#define MSG_ATTR(s, attr) msg_attr((char_u *)(s), (attr))
+#define EMSG(s) emsg((char_u *)(s))
+#define EMSG2(s, p) emsg2((char_u *)(s), (char_u *)(p))
+#define EMSG3(s, p, q) emsg3((char_u *)(s), (char_u *)(p), (char_u *)(q))
+#define EMSGN(s, n) emsgn((char_u *)(s), (long)(n))
+#define OUT_STR(s) out_str((char_u *)(s))
+#define OUT_STR_NF(s) out_str_nf((char_u *)(s))
+#define MSG_PUTS(s) msg_puts((char_u *)(s))
+#define MSG_PUTS_ATTR(s, a) msg_puts_attr((char_u *)(s), (a))
+#define MSG_PUTS_TITLE(s) msg_puts_title((char_u *)(s))
+#define MSG_PUTS_LONG(s) msg_puts_long((char_u *)(s))
+#define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a))
+
+/* Prefer using emsg3(), because perror() may send the output to the wrong
+ * destination and mess up the screen. */
+#ifdef HAVE_STRERROR
+# define PERROR(msg) (void)emsg3((char_u *)"%s: %s", (char_u *)msg, (char_u *)strerror(errno))
+#else
+# define PERROR(msg) perror(msg)
+#endif
+
+typedef long linenr_T; /* line number type */
+typedef unsigned colnr_T; /* column number type */
+typedef unsigned short disptick_T; /* display tick type */
+
+#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
+
+/*
+ * Well, you won't believe it, but some S/390 machines ("host", now also known
+ * as zServer) us 31 bit pointers. There are also some newer machines, that
+ * use 64 bit pointers. I don't know how to distinguish between 31 and 64 bit
+ * machines, so the best way is to assume 31 bits whenever we detect OS/390
+ * Unix.
+ * With this we restrict the maximum line length to 1073741823. I guess this is
+ * not a real problem. BTW: Longer lines are split.
+ */
+#if SIZEOF_INT >= 4
+# ifdef __MVS__
+# define MAXCOL (0x3fffffffL) /* maximum column number, 30 bits */
+# else
+# define MAXCOL (0x7fffffffL) /* maximum column number, 31 bits */
+# endif
+#else
+# define MAXCOL (0x7fff) /* maximum column number, 15 bits */
+#endif
+
+#define SHOWCMD_COLS 10 /* columns needed by shown command */
+#define STL_MAX_ITEM 80 /* max nr of %<flag> in statusline */
+
+typedef void *vim_acl_T; /* dummy to pass an ACL to a function */
+
+/*
+ * Include a prototype for mch_memmove(), it may not be in alloc.pro.
+ */
+#ifdef VIM_MEMMOVE
+void mch_memmove __ARGS((void *, void *, size_t));
+#else
+# ifndef mch_memmove
+# define mch_memmove(to, from, len) memmove(to, from, len)
+# endif
+#endif
+
+/*
+ * fnamecmp() is used to compare file names.
+ * On some systems case in a file name does not matter, on others it does.
+ * (this does not account for maximum name lengths and things like "../dir",
+ * thus it is not 100% accurate!)
+ */
+#ifdef CASE_INSENSITIVE_FILENAME
+# ifdef BACKSLASH_IN_FILENAME
+# define fnamecmp(x, y) vim_fnamecmp((x), (y))
+# define fnamencmp(x, y, n) vim_fnamencmp((x), (y), (size_t)(n))
+# else
+# define fnamecmp(x, y) MB_STRICMP((x), (y))
+# define fnamencmp(x, y, n) MB_STRNICMP((x), (y), (n))
+# endif
+#else
+# define fnamecmp(x, y) strcmp((char *)(x), (char *)(y))
+# define fnamencmp(x, y, n) strncmp((char *)(x), (char *)(y), (size_t)(n))
+#endif
+
+#ifdef HAVE_MEMSET
+# define vim_memset(ptr, c, size) memset((ptr), (c), (size))
+#else
+void *vim_memset __ARGS((void *, int, size_t));
+#endif
+
+#ifdef HAVE_MEMCMP
+# define vim_memcmp(p1, p2, len) memcmp((p1), (p2), (len))
+#else
+# ifdef HAVE_BCMP
+# define vim_memcmp(p1, p2, len) bcmp((p1), (p2), (len))
+# else
+int vim_memcmp __ARGS((void *, void *, size_t));
+# define VIM_MEMCMP
+# endif
+#endif
+
+#if defined(UNIX) || defined(FEAT_GUI) || defined(OS2) || defined(VMS) \
+ || defined(FEAT_CLIENTSERVER)
+# define USE_INPUT_BUF
+#endif
+
+#ifdef MSWIN
+/* On MS-Windows the third argument isn't size_t. This matters for Win64,
+ * where sizeof(size_t)==8, not 4 */
+# define vim_read(fd, buf, count) read((fd), (char *)(buf), (unsigned int)(count))
+# define vim_write(fd, buf, count) write((fd), (char *)(buf), (unsigned int)(count))
+#else
+# define vim_read(fd, buf, count) read((fd), (char *)(buf), (size_t) (count))
+# define vim_write(fd, buf, count) write((fd), (char *)(buf), (size_t) (count))
+#endif
+
+/*
+ * Enums need a typecast to be used as array index (for Ultrix).
+ */
+#define hl_attr(n) highlight_attr[(int)(n)]
+#define term_str(n) term_strings[(int)(n)]
+
+/*
+ * vim_iswhite() is used for "^" and the like. It differs from isspace()
+ * because it doesn't include <CR> and <LF> and the like.
+ */
+#define vim_iswhite(x) ((x) == ' ' || (x) == '\t')
+
+/* Note that gui.h is included by structs.h */
+
+#include "structs.h" /* file that defines many structures */
+
+#ifdef FEAT_MOUSE
+
+/* Codes for mouse button events in lower three bits: */
+# define MOUSE_LEFT 0x00
+# define MOUSE_MIDDLE 0x01
+# define MOUSE_RIGHT 0x02
+# define MOUSE_RELEASE 0x03
+
+/* bit masks for modifiers: */
+# define MOUSE_SHIFT 0x04
+# define MOUSE_ALT 0x08
+# define MOUSE_CTRL 0x10
+
+/* mouse buttons that are handled like a key press (GUI only) */
+# define MOUSE_4 0x100 /* scroll wheel down */
+# define MOUSE_5 0x200 /* scroll wheel up */
+
+# define MOUSE_X1 0x300 /* Mouse-button X1 (6th) */
+# define MOUSE_X2 0x400 /* Mouse-button X2 */
+
+/* 0x20 is reserved by xterm */
+# define MOUSE_DRAG_XTERM 0x40
+
+# define MOUSE_DRAG (0x40 | MOUSE_RELEASE)
+
+/* Lowest button code for using the mouse wheel (xterm only) */
+# define MOUSEWHEEL_LOW 0x60
+
+# define MOUSE_CLICK_MASK 0x03
+
+# define NUM_MOUSE_CLICKS(code) \
+ (((unsigned)((code) & 0xC0) >> 6) + 1)
+
+# define SET_NUM_MOUSE_CLICKS(code, num) \
+ (code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6)
+
+/*
+ * jump_to_mouse() returns one of first four these values, possibly with
+ * some of the other three added.
+ */
+# define IN_UNKNOWN 0
+# define IN_BUFFER 1
+# define IN_STATUS_LINE 2 /* on status or command line */
+# define IN_SEP_LINE 4 /* on vertical separator line */
+# define IN_OTHER_WIN 8 /* in other window but can't go there */
+# define CURSOR_MOVED 0x100
+# define MOUSE_FOLD_CLOSE 0x200 /* clicked on '-' in fold column */
+# define MOUSE_FOLD_OPEN 0x400 /* clicked on '+' in fold column */
+
+/* flags for jump_to_mouse() */
+# define MOUSE_FOCUS 0x01 /* need to stay in this window */
+# define MOUSE_MAY_VIS 0x02 /* may start Visual mode */
+# define MOUSE_DID_MOVE 0x04 /* only act when mouse has moved */
+# define MOUSE_SETPOS 0x08 /* only set current mouse position */
+# define MOUSE_MAY_STOP_VIS 0x10 /* may stop Visual mode */
+# define MOUSE_RELEASED 0x20 /* button was released */
+
+# if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
+# define CHECK_DOUBLE_CLICK 1 /* Checking for double clicks ourselves. */
+# endif
+
+#endif /* FEAT_MOUSE */
+
+/* defines for eval_vars() */
+#define VALID_PATH 1
+#define VALID_HEAD 2
+
+/* Defines for Vim variables. These must match vimvars[] in eval.c! */
+#define VV_COUNT 0
+#define VV_COUNT1 1
+#define VV_PREVCOUNT 2
+#define VV_ERRMSG 3
+#define VV_WARNINGMSG 4
+#define VV_STATUSMSG 5
+#define VV_SHELL_ERROR 6
+#define VV_THIS_SESSION 7
+#define VV_VERSION 8
+#define VV_LNUM 9
+#define VV_TERMRESPONSE 10
+#define VV_FNAME 11
+#define VV_LANG 12
+#define VV_LC_TIME 13
+#define VV_CTYPE 14
+#define VV_CC_FROM 15
+#define VV_CC_TO 16
+#define VV_FNAME_IN 17
+#define VV_FNAME_OUT 18
+#define VV_FNAME_NEW 19
+#define VV_FNAME_DIFF 20
+#define VV_CMDARG 21
+#define VV_FOLDSTART 22
+#define VV_FOLDEND 23
+#define VV_FOLDDASHES 24
+#define VV_FOLDLEVEL 25
+#define VV_PROGNAME 26
+#define VV_SEND_SERVER 27
+#define VV_DYING 28
+#define VV_EXCEPTION 29
+#define VV_THROWPOINT 30
+#define VV_REG 31
+#define VV_CMDBANG 32
+#define VV_LEN 33 /* number of v: vars */
+
+#ifdef FEAT_CLIPBOARD
+
+/* VIM_ATOM_NAME is the older Vim-specific selection type for X11. Still
+ * supported for when a mix of Vim versions is used. VIMENC_ATOM_NAME includes
+ * the encoding to support Vims using different 'encoding' values. */
+#define VIM_ATOM_NAME "_VIM_TEXT"
+#define VIMENC_ATOM_NAME "_VIMENC_TEXT"
+
+/* Selection states for modeless selection */
+# define SELECT_CLEARED 0
+# define SELECT_IN_PROGRESS 1
+# define SELECT_DONE 2
+
+# define SELECT_MODE_CHAR 0
+# define SELECT_MODE_WORD 1
+# define SELECT_MODE_LINE 2
+
+# ifdef FEAT_GUI_W32
+# ifdef FEAT_OLE
+# define WM_OLE (WM_APP+0)
+# endif
+# ifdef FEAT_NETBEANS_INTG
+ /* message for Netbeans socket event */
+# define WM_NETBEANS (WM_APP+1)
+# endif
+# endif
+
+/* Info about selected text */
+typedef struct VimClipboard
+{
+ int available; /* Is clipboard available? */
+ int owned; /* Flag: do we own the selection? */
+ pos_T start; /* Start of selected area */
+ pos_T end; /* End of selected area */
+ int vmode; /* Visual mode character */
+
+ /* Fields for selection that doesn't use Visual mode */
+ short_u origin_row;
+ short_u origin_start_col;
+ short_u origin_end_col;
+ short_u word_start_col;
+ short_u word_end_col;
+
+ pos_T prev; /* Previous position */
+ short_u state; /* Current selection state */
+ short_u mode; /* Select by char, word, or line. */
+
+# if defined(FEAT_GUI_X11) || defined(FEAT_XCLIPBOARD)
+ Atom sel_atom; /* PRIMARY/CLIPBOARD selection ID */
+# endif
+
+# ifdef FEAT_GUI_GTK
+ GdkAtom gtk_sel_atom; /* PRIMARY/CLIPBOARD selection ID */
+# endif
+
+# ifdef MSWIN
+ int_u format; /* Vim's own special clipboard format */
+ int_u format_raw; /* Vim's raw text clipboard format */
+# endif
+# ifdef FEAT_GUI_BEOS
+ /* no clipboard at the moment */
+# endif
+} VimClipboard;
+#else
+typedef int VimClipboard; /* This is required for the prototypes. */
+#endif
+
+#ifdef __BORLANDC__
+/* work around a bug in the Borland 'stat' function: */
+# include <io.h> /* for access() */
+
+# define stat(a,b) (access(a,0) ? -1 : stat(a,b))
+#endif
+
+/*
+ * EXTERN is only defined in main.c. That's where global variables are
+ * actually defined and initialized.
+ */
+#ifndef EXTERN
+# define EXTERN extern
+# define INIT(x)
+#else
+# ifndef INIT
+# define INIT(x) x
+# define DO_INIT
+# endif
+#endif
+
+#include "option.h" /* option variables and defines */
+#include "ex_cmds.h" /* Ex command defines */
+#include "proto.h" /* function prototypes */
+
+/* This has to go after the include of proto.h, as proto/gui.pro declares
+ * functions of these names. The declarations would break if the defines had
+ * been seen at that stage. But it must be before globals.h, where error_ga
+ * is declared. */
+#if !defined(FEAT_GUI_W32) && !defined(FEAT_GUI_X11) \
+ && !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MAC)
+# define mch_errmsg(str) fprintf(stderr, "%s", (str))
+# define display_errors() fflush(stderr)
+# define mch_msg(str) printf("%s", (str))
+#else
+# define USE_MCH_ERRMSG
+#endif
+
+#include "globals.h" /* global variables and messages */
+
+#ifdef FEAT_SNIFF
+# include "if_sniff.h"
+#endif
+
+#ifndef FEAT_VIRTUALEDIT
+# define getvvcol(w, p, s, c, e) getvcol(w, p, s, c, e)
+# define virtual_active() 0
+# define virtual_op FALSE
+#endif
+
+/*
+ * If console dialog not supported, but GUI dialog is, use the GUI one.
+ */
+#if defined(FEAT_GUI_DIALOG) && !defined(FEAT_CON_DIALOG)
+# define do_dialog gui_mch_dialog
+#endif
+
+/*
+ * Default filters for gui_mch_browse().
+ * The filters are almost system independent. Except for the difference
+ * between "*" and "*.*" for MSDOS-like systems.
+ * NOTE: Motif only uses the very first pattern. Therefore
+ * BROWSE_FILTER_DEFAULT should start with a "*" pattern.
+ */
+#ifdef FEAT_BROWSE
+# ifdef BACKSLASH_IN_FILENAME
+# define BROWSE_FILTER_MACROS \
+ (char_u *)"Vim macro files (*.vim)\t*.vim\nAll Files (*.*)\t*.*\n"
+# define BROWSE_FILTER_ALL_FILES (char_u *)"All Files (*.*)\t*.*\n"
+# define BROWSE_FILTER_DEFAULT \
+ (char_u *)"All Files (*.*)\t*.*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVB code (*.bas, *.frm)\t*.bas;*.frm\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n"
+# else
+# define BROWSE_FILTER_MACROS \
+ (char_u *)"Vim macro files (*.vim)\t*.vim\nAll Files (*)\t*\n"
+# define BROWSE_FILTER_ALL_FILES (char_u *)"All Files (*)\t*\n"
+# define BROWSE_FILTER_DEFAULT \
+ (char_u *)"All Files (*)\t*\nC source (*.c, *.h)\t*.c;*.h\nC++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\nVim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n"
+# endif
+#endif
+
+/* stop using fastcall for Borland */
+#if defined(__BORLANDC__) && defined(WIN32) && !defined(DEBUG)
+# pragma option -p.
+#endif
+
+#if defined(MEM_PROFILE)
+# define vim_realloc(ptr, size) mem_realloc((ptr), (size))
+#else
+# define vim_realloc(ptr, size) realloc((ptr), (size))
+#endif
+
+/*
+ * The following macros stop displat/event loop nesting at the wrong time.
+ */
+#ifdef ALT_X_INPUT
+# define ALT_INPUT_LOCK_OFF suppress_alternate_input = FALSE
+# define ALT_INPUT_LOCK_ON suppress_alternate_input = TRUE
+#endif
+
+#ifdef FEAT_MBYTE
+/* Maximum number of bytes in a multi-byte character. It can be one 32-bit
+ * character of up to 6 bytes, or one 16-bit character of up to three bytes
+ * plus two following composing characters of three bytes each. */
+# define MB_MAXBYTES 9
+
+/*
+ * Return byte length of character that starts with byte "b".
+ * Returns 1 for a single-byte character.
+ * MB_BYTE2LEN_CHECK() can be used to count a special key as one byte.
+ * Don't call MB_BYTE2LEN(b) with b < 0 or b > 255!
+ */
+# define MB_BYTE2LEN(b) mb_bytelen_tab[b]
+# define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : mb_bytelen_tab[b])
+#endif
+
+#if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
+/* properties used in enc_canon_table[] (first three mutually exclusive) */
+# define ENC_8BIT 0x01
+# define ENC_DBCS 0x02
+# define ENC_UNICODE 0x04
+
+# define ENC_ENDIAN_B 0x10 /* Unicode: Big endian */
+# define ENC_ENDIAN_L 0x20 /* Unicode: Little endian */
+
+# define ENC_2BYTE 0x40 /* Unicode: UCS-2 */
+# define ENC_4BYTE 0x80 /* Unicode: UCS-4 */
+# define ENC_2WORD 0x100 /* Unicode: UTF-16 */
+
+# define ENC_LATIN1 0x200 /* Latin1 */
+# define ENC_MACROMAN 0x400 /* Mac Roman (not Macro Man! :-) */
+#endif
+
+#ifdef FEAT_MBYTE
+# ifdef USE_ICONV
+# ifndef EILSEQ
+# define EILSEQ 123
+# endif
+# ifdef DYNAMIC_ICONV
+/* On Win32 iconv.dll is dynamically loaded. */
+# define ICONV_ERRNO (*iconv_errno())
+# define ICONV_E2BIG 7
+# define ICONV_EINVAL 22
+# define ICONV_EILSEQ 42
+# else
+# define ICONV_ERRNO errno
+# define ICONV_E2BIG E2BIG
+# define ICONV_EINVAL EINVAL
+# define ICONV_EILSEQ EILSEQ
+# endif
+# endif
+
+#endif
+
+/* ISSYMLINK(mode) tests if a file is a symbolic link. */
+#if (defined(S_IFMT) && defined(S_IFLNK)) || defined(S_ISLNK)
+# define HAVE_ISSYMLINK
+# if defined(S_IFMT) && defined(S_IFLNK)
+# define ISSYMLINK(mode) (((mode) & S_IFMT) == S_IFLNK)
+# else
+# define ISSYMLINK(mode) S_ISLNK(mode)
+# endif
+#endif
+
+#define SIGN_BYTE 1 /* byte value used where sign is displayed;
+ attribute value is sign type */
+
+#ifdef FEAT_NETBEANS_INTG
+# define MULTISIGN_BYTE 2 /* byte value used where sign is displayed if
+ multiple signs exist on the line */
+#endif
+
+#if defined(FEAT_GUI) && defined(FEAT_XCLIPBOARD)
+# ifdef FEAT_GUI_GTK
+ /* Avoid using a global variable for the X display. It's ugly
+ * and is likely to cause trouble in multihead environments. */
+# define X_DISPLAY ((gui.in_use) ? gui_mch_get_display() : xterm_dpy)
+# else
+# define X_DISPLAY (gui.in_use ? gui.dpy : xterm_dpy)
+# endif
+#else
+# ifdef FEAT_GUI
+# ifdef FEAT_GUI_GTK
+# define X_DISPLAY ((gui.in_use) ? gui_mch_get_display() : (Display *)NULL)
+# else
+# define X_DISPLAY gui.dpy
+# endif
+# else
+# define X_DISPLAY xterm_dpy
+# endif
+#endif
+
+#ifdef NBDEBUG /* Netbeans debugging. */
+# include "nbdebug.h"
+#else
+# define nbdebug(a)
+#endif
+
+#ifdef IN_PERL_FILE
+ /*
+ * Avoid clashes between Perl and Vim namespace.
+ */
+# undef NORMAL
+# undef STRLEN
+# undef FF
+# undef OP_DELETE
+# undef OP_JOIN
+# ifdef __BORLANDC__
+# define NOPROTO 1
+# endif
+ /* remove MAX and MIN, included by glib.h, redefined by sys/param.h */
+# ifdef MAX
+# undef MAX
+# endif
+# ifdef MIN
+# undef MIN
+# endif
+ /* We use _() for gettext(), Perl uses it for function prototypes... */
+# ifdef _
+# undef _
+# endif
+# ifdef DEBUG
+# undef DEBUG
+# endif
+# ifdef _DEBUG
+# undef _DEBUG
+# endif
+# ifdef instr
+# undef instr
+# endif
+ /* bool causes trouble on MACOS but is required on a few other systems */
+# if defined(bool) && defined(MACOS)
+# undef bool
+# endif
+
+# ifdef __BORLANDC__
+ /* Borland has the structure stati64 but not _stati64 */
+# define _stati64 stati64
+# endif
+
+# include <EXTERN.h>
+# include <perl.h>
+# include <XSUB.h>
+#endif
+
+#endif /* VIM__H */
diff --git a/src/vim.ico b/src/vim.ico
new file mode 100644
index 000000000..5e94092ac
--- /dev/null
+++ b/src/vim.ico
Binary files differ
diff --git a/src/vim.rc b/src/vim.rc
new file mode 100644
index 000000000..27d35a96b
--- /dev/null
+++ b/src/vim.rc
@@ -0,0 +1,135 @@
+// vim:ts=8:sw=4:sts=4:
+//
+// VIM - Vi IMproved by Bram Moolenaar
+//
+// Do ":help uganda" in Vim to read copying and usage conditions.
+// Do ":help credits" in Vim to see a list of people who contributed.
+
+// vim.rc
+// Icon and version information for the Win32 version of Vim
+// Must be in DOS format <CR><NL>!
+
+#ifdef __MINGW32__
+# include <windows.h>
+# ifndef VS_FFI_FILEFLAGSMASK
+# define VS_FFI_FILEFLAGSMASK 0x0000003FL
+# endif
+# ifndef VOS__WINDOWS32
+# define VOS__WINDOWS32 0x00000004L
+# endif
+#else
+# include <winver.h>
+#endif
+#include "version.h"
+#include "gui_w32_rc.h"
+#if defined(__BORLANDC__) || defined(__CYGWIN32__)
+# include <winresrc.h>
+#else
+# ifndef __MINGW32__
+# include <winres.h>
+# endif
+#endif
+
+//
+// Icons
+//
+IDR_VIM ICON "vim.ico"
+
+#ifdef FEAT_GUI_W32
+IDR_VIM_ERROR ICON "vim_error.ico"
+IDR_VIM_ALERT ICON "vim_alert.ico"
+IDR_VIM_INFO ICON "vim_info.ico"
+IDR_VIM_QUESTION ICON "vim_quest.ico"
+
+//
+// Bitmaps
+//
+IDB_TEAROFF BITMAP DISCARDABLE "tearoff.bmp"
+IDR_TOOLBAR1 BITMAP DISCARDABLE "tools.bmp"
+
+//
+// WinXP theme support
+//
+#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
+# define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#endif
+#ifndef RT_MANIFEST
+# define RT_MANIFEST 24
+#endif
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gvim.exe.mnf"
+#endif // FEAT_GUI_W32
+
+//
+// Type Library
+//
+#ifdef FEAT_OLE
+ 1 TYPELIB "VIM.TLB"
+#endif
+
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VIM_VERSION_MAJOR,VIM_VERSION_MINOR,VIM_VERSION_BUILD,VIM_VERSION_PATCHLEVEL
+ PRODUCTVERSION VIM_VERSION_MAJOR,VIM_VERSION_MINOR,VIM_VERSION_BUILD,VIM_VERSION_PATCHLEVEL
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+
+#if VIM_VERSION_PATCHLEVEL > 0
+ #ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_DEBUG | VS_FF_PATCHED
+ #else
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_PATCHED
+ #endif
+#else
+ #ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_DEBUG
+ #else
+ FILEFLAGS VS_FF_PRERELEASE
+ #endif
+#endif
+
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ // 0x0409 == U.S. English; 0x04E4 => Windows Multilingual
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "Vim Developers\0"
+ VALUE "FileDescription", "Vi Improved - A Text Editor\0"
+ VALUE "FileVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0"
+ VALUE "InternalName", "VIM\0"
+ VALUE "LegalCopyright", "Copyright \251 1996-2003\0"
+ VALUE "LegalTrademarks", "Vim\0"
+ VALUE "OriginalFilename", "VIM.EXE\0"
+ VALUE "ProductName", "Vim\0"
+ VALUE "ProductVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 0x4E4
+ END
+END
+
+/*
+ * Printing Status Dialog (should only be used when FEAT_PRINTER is defined)
+ */
+#define IDC_BOX1 400
+#define IDC_PRINTTEXT1 401
+#define IDC_PRINTTEXT2 402
+#define IDC_PROGRESS 403
+PRINTDLGBOX DIALOG 115, 63, 210, 80
+STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+FONT 8, "Helv"
+BEGIN
+ DEFPUSHBUTTON "Cancel", IDCANCEL, 85, 60, 40, 14
+ CTEXT "Printing",IDC_PRINTTEXT1,23,15,157,8
+ CTEXT " ",IDC_PRINTTEXT2,23,25,157,8
+ CTEXT "Initializing...",IDC_PROGRESS,24,38,157,8
+ GROUPBOX "",IDC_BOX1,19,9,170,47
+END
diff --git a/src/vim.tlb b/src/vim.tlb
new file mode 100644
index 000000000..cb2606ce9
--- /dev/null
+++ b/src/vim.tlb
Binary files differ
diff --git a/src/vim16.def b/src/vim16.def
new file mode 100644
index 000000000..13b8c044e
--- /dev/null
+++ b/src/vim16.def
@@ -0,0 +1,5 @@
+CODE PRELOAD EXECUTEONLY
+DATA MULTIPLE SHARED
+DESCRIPTION 'Vim 7.0aa'
+STACKSIZE 16000
+HEAPSIZE 10000
diff --git a/src/vim16.rc b/src/vim16.rc
new file mode 100644
index 000000000..8529e09ea
--- /dev/null
+++ b/src/vim16.rc
@@ -0,0 +1,81 @@
+// vim:ts=8:sw=4:sts=4:
+//
+// VIM - Vi IMproved by Bram Moolenaar
+//
+// Do ":help uganda" in Vim to read copying and usage conditions.
+// Do ":help credits" in Vim to see a list of people who contributed.
+
+// vim.rc
+// Icon and version information for the Win32 version of Vim
+// Must be in DOS format <CR><NL>!
+
+#include "version.h"
+#include "gui_w3~1.h"
+#include "guiw16rc.h"
+
+//
+// Icons
+//
+IDR_VIM ICON "VIM.ICO"
+
+#ifndef FEAT_TINY
+IDR_VIM_ERROR ICON "VIM_ER~1.ICO"
+IDR_VIM_ALERT ICON "VIM_AL~1.ICO"
+IDR_VIM_INFO ICON "VIM_INFO.ICO"
+IDR_VIM_QUESTION ICON "VIM_QU~1.ICO"
+#endif
+
+//
+// Bitmaps
+//
+#ifdef FEAT_TOOLBAR
+IDR_TOOLBAR1 BITMAP DISCARDABLE "tools16.bmp"
+#endif
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VIM_VERSION_MAJOR,VIM_VERSION_MINOR,VIM_VERSION_BUILD,VIM_VERSION_PATCHLEVEL
+ PRODUCTVERSION VIM_VERSION_MAJOR,VIM_VERSION_MINOR,VIM_VERSION_BUILD,VIM_VERSION_PATCHLEVEL
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+
+#if VIM_VERSION_PATCHLEVEL > 0
+ #ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_DEBUG | VS_FF_PATCHED
+ #else
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_PATCHED
+ #endif
+#else
+ #ifdef _DEBUG
+ FILEFLAGS VS_FF_PRERELEASE | VS_FF_DEBUG
+ #else
+ FILEFLAGS VS_FF_PRERELEASE
+ #endif
+#endif
+
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ // 0x0409 == U.S. English; 0x04E4 => Windows Multilingual
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "Vim Developers\0"
+ VALUE "FileDescription", "Vi Improved - A Text Editor\0"
+ VALUE "FileVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0"
+ VALUE "InternalName", "VIM\0"
+ VALUE "LegalCopyright", "Copyright \251 1996-1999\0"
+ VALUE "LegalTrademarks", "Vim\0"
+ VALUE "OriginalFilename", "VIM.EXE\0"
+ VALUE "ProductName", "Vim\0"
+ VALUE "ProductVersion", VIM_VERSION_MAJOR_STR ", " VIM_VERSION_MINOR_STR ", " VIM_VERSION_BUILD_STR ", " VIM_VERSION_PATCHLEVEL_STR "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 0x4E4
+ END
+END
diff --git a/src/vim_alert.ico b/src/vim_alert.ico
new file mode 100644
index 000000000..93d982bff
--- /dev/null
+++ b/src/vim_alert.ico
Binary files differ
diff --git a/src/vim_error.ico b/src/vim_error.ico
new file mode 100644
index 000000000..b3fbacff8
--- /dev/null
+++ b/src/vim_error.ico
Binary files differ
diff --git a/src/vim_icon.xbm b/src/vim_icon.xbm
new file mode 100644
index 000000000..62a24bb45
--- /dev/null
+++ b/src/vim_icon.xbm
@@ -0,0 +1,14 @@
+#define vim_icon_width 32
+#define vim_icon_height 32
+static unsigned char vim_icon_bits[] = {
+ 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0xfc, 0xff, 0xff, 0x3f,
+ 0x04, 0x80, 0x03, 0x20, 0x04, 0x80, 0x0f, 0x40, 0x08, 0xc0, 0x1f, 0x60,
+ 0x10, 0xe0, 0x3f, 0x60, 0x10, 0xe0, 0x1f, 0x30, 0x10, 0xe0, 0x0f, 0x18,
+ 0x10, 0xe0, 0x07, 0x0e, 0x10, 0xe0, 0x03, 0x07, 0x10, 0xe0, 0x81, 0x0f,
+ 0x18, 0xe0, 0x80, 0x1f, 0x1c, 0x60, 0xe0, 0x3f, 0x1e, 0x20, 0xf0, 0x7f,
+ 0x1f, 0x00, 0xf8, 0xff, 0x1f, 0x00, 0xfc, 0xff, 0x1e, 0x00, 0xfc, 0x7f,
+ 0x1c, 0x00, 0xff, 0x3f, 0x18, 0x80, 0xfc, 0x1f, 0x10, 0x80, 0xfc, 0x0f,
+ 0x10, 0xc0, 0xff, 0x5f, 0x10, 0x60, 0x44, 0x24, 0x10, 0x50, 0x0c, 0x40,
+ 0x10, 0x70, 0xce, 0x24, 0x10, 0x7c, 0x6e, 0x26, 0x10, 0x7a, 0x66, 0x26,
+ 0x10, 0x3d, 0x22, 0x13, 0xa0, 0x32, 0x32, 0x67, 0xd0, 0xe1, 0xdf, 0x1c,
+ 0x00, 0xc0, 0x43, 0x00, 0x00, 0x80, 0x01, 0x00};
diff --git a/src/vim_info.ico b/src/vim_info.ico
new file mode 100644
index 000000000..df043a56f
--- /dev/null
+++ b/src/vim_info.ico
Binary files differ
diff --git a/src/vim_mask.xbm b/src/vim_mask.xbm
new file mode 100644
index 000000000..96dd929e8
--- /dev/null
+++ b/src/vim_mask.xbm
@@ -0,0 +1,14 @@
+#define vim_mask_icon_width 32
+#define vim_mask_icon_height 32
+static unsigned char vim_mask_icon_bits[] = {
+ 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0xfc, 0xff, 0xff, 0x3f,
+ 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x7f,
+ 0xf0, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x1f,
+ 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f,
+ 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f,
+ 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f,
+ 0xf0, 0xff, 0xff, 0x5f, 0xf0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x7f,
+ 0xf0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f,
+ 0xf0, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x7f, 0xd0, 0xe1, 0xdf, 0x1c,
+ 0x00, 0xc0, 0x43, 0x00, 0x00, 0x80, 0x01, 0x00};
diff --git a/src/vim_quest.ico b/src/vim_quest.ico
new file mode 100644
index 000000000..d6c22395b
--- /dev/null
+++ b/src/vim_quest.ico
Binary files differ
diff --git a/src/vimrun.c b/src/vimrun.c
new file mode 100644
index 000000000..fed5076a5
--- /dev/null
+++ b/src/vimrun.c
@@ -0,0 +1,117 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * this file by Vince Negri
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * vimrun.c - Tiny Win32 program to safely run an external command in a
+ * DOS console.
+ * This program is required to avoid that typing CTRL-C in the DOS
+ * console kills Vim. Now it only kills vimrun.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef __CYGWIN__
+# include <conio.h>
+#endif
+
+#ifdef __BORLANDC__
+extern char *
+#ifdef _RTLDLL
+__import
+#endif
+_oscmd;
+# define _kbhit kbhit
+# define _getch getch
+#else
+# ifdef __MINGW32__
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# else
+# ifdef __CYGWIN__
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# define _getch getchar
+# else
+extern char *_acmdln;
+# endif
+# endif
+#endif
+
+ int
+main(void)
+{
+ const char *p;
+ int retval;
+ int inquote = 0;
+ int silent = 0;
+
+#ifdef __BORLANDC__
+ p = _oscmd;
+#else
+# if defined(__MINGW32__) || defined(__CYGWIN__)
+ p = (const char *)GetCommandLine();
+# else
+ p = _acmdln;
+# endif
+#endif
+ /*
+ * Skip the executable name, which might be in "".
+ */
+ while (*p)
+ {
+ if (*p == '"')
+ inquote = !inquote;
+ else if (!inquote && *p == ' ')
+ {
+ ++p;
+ break;
+ }
+ ++p;
+ }
+
+ /*
+ * "-s" argument: don't wait for a key hit.
+ */
+ if (p[0] == '-' && p[1] == 's' && p[2] == ' ')
+ {
+ silent = 1;
+ p += 3;
+ while (*p == ' ')
+ ++p;
+ }
+
+ /* Print the command, including quotes and redirection. */
+ puts(p);
+
+ /*
+ * Do it!
+ */
+ retval = system(p);
+
+ if (retval != 0)
+ printf("shell returned %d\n", retval);
+
+ if (!silent)
+ {
+ puts("Hit any key to close this window...");
+
+#ifndef __CYGWIN__
+ while (_kbhit())
+ (void)_getch();
+#endif
+ (void)_getch();
+ }
+
+ return retval;
+}
diff --git a/src/vimtbar.dll b/src/vimtbar.dll
new file mode 100755
index 000000000..6a8dfc95a
--- /dev/null
+++ b/src/vimtbar.dll
Binary files differ
diff --git a/src/vimtbar.h b/src/vimtbar.h
new file mode 100644
index 000000000..7427f6477
--- /dev/null
+++ b/src/vimtbar.h
@@ -0,0 +1,185 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Win16 Toolbar by Vince Negri - External Header
+ * (Based on MS Sample Code)
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+//
+// Button Structure
+//
+typedef struct tagTBBUTTON
+{
+ int iBitmap; // index into bitmap of this button's picture
+ int idCommand; // WM_COMMAND menu ID that this button sends
+ BYTE fsState; // button's state
+ BYTE fsStyle; // button's style
+} TBBUTTON;
+
+typedef TBBUTTON NEAR* PTBBUTTON;
+typedef TBBUTTON FAR* LPTBBUTTON;
+typedef const TBBUTTON FAR* LPCTBBUTTON;
+
+
+//
+// Styles
+//
+#define TBSTYLE_BUTTON 0x00 // this entry is button
+#define TBSTYLE_SEP 0x01 // this entry is a separator
+#define TBSTYLE_CHECK 0x02 // this is a check button (it stays down)
+#define TBSTYLE_GROUP 0x04 // this is a check button (it stays down)
+#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) // this group is a member of a group radio group
+
+//
+// States
+//
+#define TBSTATE_CHECKED 0x01 // radio button is checked
+#define TBSTATE_PRESSED 0x02 // button is being depressed (any style)
+#define TBSTATE_ENABLED 0x04 // button is enabled
+#define TBSTATE_HIDDEN 0x08 // button is hidden
+#define TBSTATE_INDETERMINATE 0x10 // button is indeterminate
+#define TBSTATE_SELECTED 0x20 // mouse hovering over button (for coolbar look)
+
+
+
+typedef struct tagADJUSTINFO
+{
+ TBBUTTON tbButton;
+ char szDescription[1];
+} ADJUSTINFO;
+
+typedef ADJUSTINFO NEAR* PADJUSTINFO;
+typedef ADJUSTINFO FAR* LPADJUSTINFO;
+
+
+HWND WINAPI CreateToolbar(HWND hwnd, DWORD ws, WORD wID, int nBitmaps,
+ HINSTANCE hBMInst, WORD wBMID,
+ LPCTBBUTTON lpButtons, int iNumButtons);
+
+#define CMB_DISCARDABLE 0x01 // create bitmap as discardable
+#define CMB_MASKED 0x02 // create image/mask pair in bitmap
+
+
+#define TB_ENABLEBUTTON (WM_USER + 1)
+// wParam: UINT, button ID
+// lParam: BOOL LOWORD, enable if nonzero; HIWORD not used, 0
+// return: not used
+//
+
+#define TB_CHECKBUTTON (WM_USER + 2)
+// wParam: UINT, button ID
+// lParam: BOOL LOWORD, check if nonzero; HIWORD not used, 0
+// return: not used
+//
+
+#define TB_PRESSBUTTON (WM_USER + 3)
+// wParam: UINT, button ID
+// lParam: BOOL LOWORD, press if nonzero; HIWORD not used, 0
+// return: not used
+//
+
+#define TB_HIDEBUTTON (WM_USER + 4)
+// wParam: UINT, button ID
+// lParam: BOOL LOWORD, hide if nonzero; HIWORD not used, 0
+// return: not used
+//
+#define TB_INDETERMINATE (WM_USER + 5)
+// wParam: UINT, button ID
+// lParam: BOOL LOWORD, make indeterminate if nonzero; HIWORD not used, 0
+// return: not used
+//
+
+#define TB_ISBUTTONENABLED (WM_USER + 9)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: BOOL LOWORD, enabled if nonzero; HIWORD not used
+//
+
+#define TB_ISBUTTONCHECKED (WM_USER + 10)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: BOOL LOWORD, checked if nonzero; HIWORD not used
+//
+
+#define TB_ISBUTTONPRESSED (WM_USER + 11)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: BOOL LOWORD, pressed if nonzero; HIWORD not used
+//
+
+#define TB_ISBUTTONHIDDEN (WM_USER + 12)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: BOOL LOWORD, hidden if nonzero; HIWORD not used
+//
+
+#define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: BOOL LOWORD, indeterminate if nonzero; HIWORD not used
+//
+
+#define TB_SETSTATE (WM_USER + 17)
+// wParam: UINT, button ID
+// lParam: UINT LOWORD, state bits; HIWORD not used, 0
+// return: not used
+//
+
+#define TB_GETSTATE (WM_USER + 18)
+// wParam: UINT, button ID
+// lParam: not used, 0
+// return: UINT LOWORD, state bits; HIWORD not used
+//
+
+#define TB_ADDBITMAP (WM_USER + 19)
+// wParam: UINT, number of button graphics in bitmap
+// lParam: one of:
+// HINSTANCE LOWORD, module handle; UINT HIWORD, resource id
+// HINSTANCE LOWORD, NULL; HBITMAP HIWORD, bitmap handle
+// return: one of:
+// int LOWORD, index for first new button; HIWORD not used
+// int LOWORD, -1 indicating error; HIWORD not used
+//
+
+#define TB_ADDBUTTONS (WM_USER + 20)
+// wParam: UINT, number of buttons to add
+// lParam: LPTBBUTTON, pointer to array of TBBUTTON structures
+// return: not used
+//
+
+#define TB_INSERTBUTTON (WM_USER + 21)
+// wParam: UINT, index for insertion (appended if index doesn't exist)
+// lParam: LPTBBUTTON, pointer to one TBBUTTON structure
+// return: not used
+//
+
+#define TB_DELETEBUTTON (WM_USER + 22)
+// wParam: UINT, index of button to delete
+// lParam: not used, 0
+// return: not used
+//
+
+#define TB_GETBUTTON (WM_USER + 23)
+// wParam: UINT, index of button to get
+// lParam: LPTBBUTTON, pointer to TBBUTTON buffer to receive button
+// return: not used
+//
+
+#define TB_BUTTONCOUNT (WM_USER + 24)
+// wParam: not used, 0
+// lParam: not used, 0
+// return: UINT LOWORD, number of buttons; HIWORD not used
+//
+
+#define TB_COMMANDTOINDEX (WM_USER + 25)
+// wParam: UINT, command id
+// lParam: not used, 0
+// return: UINT LOWORD, index of button (-1 if command not found);
+// HIWORD not used
+//
+
+
+#define TBN_BEGINDRAG 0x0201
+#define TBN_ENDDRAG 0x0203
diff --git a/src/vimtbar.lib b/src/vimtbar.lib
new file mode 100644
index 000000000..413b7dac9
--- /dev/null
+++ b/src/vimtbar.lib
Binary files differ
diff --git a/src/vimtutor b/src/vimtutor
new file mode 100755
index 000000000..2fbb1371f
--- /dev/null
+++ b/src/vimtutor
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+# Start Vim on a copy of the tutor file.
+
+# Usage: vimtutor [xx], where xx is a language code like "es" or "nl".
+# When an argument is given, it tries loading that tutor.
+# When this fails or no argument was given, it tries using 'v:lang'
+# When that also fails, it uses the English version.
+
+xx=$1
+export xx
+
+# We need a temp file for the copy. First try using a standard command.
+tmp="${TMPDIR-/tmp}"
+TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo none`
+
+# If the standard commands failed then create a directory to put the copy in.
+# That is a secure way to make a temp file.
+if test "$TUTORCOPY" = none; then
+ tmpdir=$tmp/vimtutor$$
+ OLD_UMASK=`umask`
+ umask 077
+ getout=no
+ mkdir $tmpdir || getout=yes
+ umask $OLD_UMASK
+ if test $getout = yes; then
+ echo "Could not create directory for tutor copy, exiting."
+ exit 1
+ fi
+ TUTORCOPY=$tmpdir/tutorcopy
+ touch $TUTORCOPY
+ TODELETE=$tmpdir
+else
+ TODELETE=$TUTORCOPY
+fi
+
+export TUTORCOPY
+
+# remove the copy of the tutor on exit
+trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
+
+# Vim could be called "vim" or "vi". Also check for "vim6", for people who
+# have Vim 5.x installed as "vim" and Vim 6.0 as "vim6".
+testvim=`which vim6 2>/dev/null`
+if test -f "$testvim"; then
+ VIM=vim6
+else
+ testvim=`which vim`
+ if test -f "$testvim"; then
+ VIM=vim
+ else
+ VIM=vi
+ fi
+fi
+
+# Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
+# The script tutor.vim tells Vim which file to copy
+$VIM -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
+
+# Start vim without any .vimrc, set 'nocompatible'
+$VIM -u NONE -c "set nocp" $TUTORCOPY
diff --git a/src/which.sh b/src/which.sh
new file mode 100755
index 000000000..8c2c6982c
--- /dev/null
+++ b/src/which.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+#
+# which.sh -- find where an executable is located. It's here because the
+# "which" command is not supported everywhere. Used by Makefile.
+
+IFS=":"
+for ac_dir in $PATH; do
+ if test -f "$ac_dir/$1"; then
+ echo "$ac_dir/$1"
+ break
+ fi
+done
diff --git a/src/window.c b/src/window.c
new file mode 100644
index 000000000..dc63e09d4
--- /dev/null
+++ b/src/window.c
@@ -0,0 +1,4946 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+ * Do ":help uganda" in Vim to read a list of people who contributed.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#include "vim.h"
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h> /* for chdir() */
+#endif
+
+static int path_is_url __ARGS((char_u *p));
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
+static int win_comp_pos __ARGS((void));
+static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
+static void frame_setheight __ARGS((frame_T *curfrp, int height));
+#ifdef FEAT_VERTSPLIT
+static void frame_setwidth __ARGS((frame_T *curfrp, int width));
+#endif
+static void win_exchange __ARGS((long));
+static void win_rotate __ARGS((int, int));
+static void win_totop __ARGS((int size, int flags));
+static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
+static win_T *winframe_remove __ARGS((win_T *win, int *dirp));
+static frame_T *win_altframe __ARGS((win_T *win));
+static win_T *frame2win __ARGS((frame_T *frp));
+static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
+static void frame_new_height __ARGS((frame_T *topfrp, int height, int topfirst, int wfh));
+static int frame_fixed_height __ARGS((frame_T *frp));
+#ifdef FEAT_VERTSPLIT
+static void frame_add_statusline __ARGS((frame_T *frp));
+static void frame_new_width __ARGS((frame_T *topfrp, int width, int leftfirst));
+static void frame_add_vsep __ARGS((frame_T *frp));
+static int frame_minwidth __ARGS((frame_T *topfrp, win_T *next_curwin));
+static void frame_fix_width __ARGS((win_T *wp));
+#endif
+static void frame_fix_height __ARGS((win_T *wp));
+static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin));
+static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin));
+static void win_free __ARGS((win_T *wp));
+static void win_append __ARGS((win_T *, win_T *));
+static void win_remove __ARGS((win_T *));
+static void frame_append __ARGS((frame_T *after, frame_T *frp));
+static void frame_insert __ARGS((frame_T *before, frame_T *frp));
+static void frame_remove __ARGS((frame_T *frp));
+#ifdef FEAT_VERTSPLIT
+static void win_new_width __ARGS((win_T *wp, int width));
+static int win_minheight __ARGS((win_T *wp));
+static void win_goto_ver __ARGS((int up, long count));
+static void win_goto_hor __ARGS((int left, long count));
+#endif
+static void frame_add_height __ARGS((frame_T *frp, int n));
+static void last_status_rec __ARGS((frame_T *fr, int statusline));
+
+static void make_snapshot __ARGS((void));
+static void make_snapshot_rec __ARGS((frame_T *fr, frame_T **frp));
+static void clear_snapshot __ARGS((void));
+static void clear_snapshot_rec __ARGS((frame_T *fr));
+static void restore_snapshot __ARGS((int close_curwin));
+static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
+static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
+
+#endif /* FEAT_WINDOWS */
+static win_T *win_alloc __ARGS((win_T *after));
+static void win_new_height __ARGS((win_T *, int));
+
+#define URL_SLASH 1 /* path_is_url() has found "://" */
+#define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */
+
+#define NOWIN (win_T *)-1 /* non-exisiting window */
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * all CTRL-W window commands are handled here, called from normal_cmd().
+ */
+ void
+do_window(nchar, Prenum, xchar)
+ int nchar;
+ long Prenum;
+ int xchar; /* extra char from ":wincmd gx" or NUL */
+{
+ long Prenum1;
+ win_T *wp;
+#if defined(FEAT_SEARCHPATH) || defined(FEAT_FIND_ID)
+ char_u *ptr;
+#endif
+#ifdef FEAT_FIND_ID
+ int type = FIND_DEFINE;
+ int len;
+#endif
+ char_u cbuf[40];
+
+ if (Prenum == 0)
+ Prenum1 = 1;
+ else
+ Prenum1 = Prenum;
+
+#ifdef FEAT_CMDWIN
+# define CHECK_CMDWIN if (cmdwin_type != 0) { EMSG(_(e_cmdwin)); break; }
+#else
+# define CHECK_CMDWIN
+#endif
+
+ switch (nchar)
+ {
+/* split current window in two parts, horizontally */
+ case 'S':
+ case Ctrl_S:
+ case 's':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_split((int)Prenum, 0);
+ break;
+
+#ifdef FEAT_VERTSPLIT
+/* split current window in two parts, vertically */
+ case Ctrl_V:
+ case 'v':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_split((int)Prenum, WSP_VERT);
+ break;
+#endif
+
+/* split current window and edit alternate file */
+ case Ctrl_HAT:
+ case '^':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ STRCPY(cbuf, "split #");
+ if (Prenum)
+ sprintf((char *)cbuf + 7, "%ld", Prenum);
+ do_cmdline_cmd(cbuf);
+ break;
+
+/* open new window */
+ case Ctrl_N:
+ case 'n':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ if (Prenum)
+ sprintf((char *)cbuf, "%ld", Prenum); /* window height */
+ else
+ cbuf[0] = NUL;
+ STRCAT(cbuf, "new");
+ do_cmdline_cmd(cbuf);
+ break;
+
+/* quit current window */
+ case Ctrl_Q:
+ case 'q':
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ do_cmdline_cmd((char_u *)"quit");
+ break;
+
+/* close current window */
+ case Ctrl_C:
+ case 'c':
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ do_cmdline_cmd((char_u *)"close");
+ break;
+
+#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+/* close preview window */
+ case Ctrl_Z:
+ case 'z':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ do_cmdline_cmd((char_u *)"pclose");
+ break;
+
+/* cursor to preview window */
+ case 'P':
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp->w_p_pvw)
+ break;
+ if (wp == NULL)
+ EMSG(_("E441: There is no preview window"));
+ else
+ win_goto(wp);
+ break;
+#endif
+
+/* close all but current window */
+ case Ctrl_O:
+ case 'o':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ do_cmdline_cmd((char_u *)"only");
+ break;
+
+/* cursor to next window with wrap around */
+ case Ctrl_W:
+ case 'w':
+/* cursor to previous window with wrap around */
+ case 'W':
+ CHECK_CMDWIN
+ if (lastwin == firstwin && Prenum != 1) /* just one window */
+ beep_flush();
+ else
+ {
+ if (Prenum) /* go to specified window */
+ {
+ for (wp = firstwin; --Prenum > 0; )
+ {
+ if (wp->w_next == NULL)
+ break;
+ else
+ wp = wp->w_next;
+ }
+ }
+ else
+ {
+ if (nchar == 'W') /* go to previous window */
+ {
+ wp = curwin->w_prev;
+ if (wp == NULL)
+ wp = lastwin; /* wrap around */
+ }
+ else /* go to next window */
+ {
+ wp = curwin->w_next;
+ if (wp == NULL)
+ wp = firstwin; /* wrap around */
+ }
+ }
+ win_goto(wp);
+ }
+ break;
+
+/* cursor to window below */
+ case 'j':
+ case K_DOWN:
+ case Ctrl_J:
+ CHECK_CMDWIN
+#ifdef FEAT_VERTSPLIT
+ win_goto_ver(FALSE, Prenum1);
+#else
+ for (wp = curwin; wp->w_next != NULL && Prenum1-- > 0;
+ wp = wp->w_next)
+ ;
+ win_goto(wp);
+#endif
+ break;
+
+/* cursor to window above */
+ case 'k':
+ case K_UP:
+ case Ctrl_K:
+ CHECK_CMDWIN
+#ifdef FEAT_VERTSPLIT
+ win_goto_ver(TRUE, Prenum1);
+#else
+ for (wp = curwin; wp->w_prev != NULL && Prenum1-- > 0;
+ wp = wp->w_prev)
+ ;
+ win_goto(wp);
+#endif
+ break;
+
+#ifdef FEAT_VERTSPLIT
+/* cursor to left window */
+ case 'h':
+ case K_LEFT:
+ case Ctrl_H:
+ case K_BS:
+ CHECK_CMDWIN
+ win_goto_hor(TRUE, Prenum1);
+ break;
+
+/* cursor to right window */
+ case 'l':
+ case K_RIGHT:
+ case Ctrl_L:
+ CHECK_CMDWIN
+ win_goto_hor(FALSE, Prenum1);
+ break;
+#endif
+
+/* cursor to top-left window */
+ case 't':
+ case Ctrl_T:
+ win_goto(firstwin);
+ break;
+
+/* cursor to bottom-right window */
+ case 'b':
+ case Ctrl_B:
+ win_goto(lastwin);
+ break;
+
+/* cursor to last accessed (previous) window */
+ case 'p':
+ case Ctrl_P:
+ if (prevwin == NULL)
+ beep_flush();
+ else
+ win_goto(prevwin);
+ break;
+
+/* exchange current and next window */
+ case 'x':
+ case Ctrl_X:
+ CHECK_CMDWIN
+ win_exchange(Prenum);
+ break;
+
+/* rotate windows downwards */
+ case Ctrl_R:
+ case 'r':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ win_rotate(FALSE, (int)Prenum1); /* downwards */
+ break;
+
+/* rotate windows upwards */
+ case 'R':
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ win_rotate(TRUE, (int)Prenum1); /* upwards */
+ break;
+
+/* move window to the very top/bottom/left/right */
+ case 'K':
+ case 'J':
+#ifdef FEAT_VERTSPLIT
+ case 'H':
+ case 'L':
+#endif
+ CHECK_CMDWIN
+ win_totop((int)Prenum,
+ ((nchar == 'H' || nchar == 'L') ? WSP_VERT : 0)
+ | ((nchar == 'H' || nchar == 'K') ? WSP_TOP : WSP_BOT));
+ break;
+
+/* make all windows the same height */
+ case '=':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_equal(NULL, FALSE, 'b');
+ break;
+
+/* increase current window height */
+ case '+':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setheight(curwin->w_height + (int)Prenum1);
+ break;
+
+/* decrease current window height */
+ case '-':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setheight(curwin->w_height - (int)Prenum1);
+ break;
+
+/* set current window height */
+ case Ctrl__:
+ case '_':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setheight(Prenum ? (int)Prenum : 9999);
+ break;
+
+#ifdef FEAT_VERTSPLIT
+/* increase current window width */
+ case '>':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setwidth(curwin->w_width + (int)Prenum1);
+ break;
+
+/* decrease current window width */
+ case '<':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setwidth(curwin->w_width - (int)Prenum1);
+ break;
+
+/* set current window width */
+ case '|':
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_setwidth(Prenum != 0 ? (int)Prenum : 9999);
+ break;
+#endif
+
+/* jump to tag and split window if tag exists (in preview window) */
+#if defined(FEAT_QUICKFIX)
+ case '}':
+ CHECK_CMDWIN
+ if (Prenum)
+ g_do_tagpreview = Prenum;
+ else
+ g_do_tagpreview = p_pvh;
+ /*FALLTHROUGH*/
+#endif
+ case ']':
+ case Ctrl_RSB:
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ if (Prenum)
+ postponed_split = Prenum;
+ else
+ postponed_split = -1;
+
+ /* Execute the command right here, required when
+ * "wincmd ]" was used in a function. */
+ do_nv_ident(Ctrl_RSB, NUL);
+ break;
+
+#ifdef FEAT_SEARCHPATH
+/* edit file name under cursor in a new window */
+ case 'f':
+ case Ctrl_F:
+ CHECK_CMDWIN
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ ptr = file_name_at_cursor(FNAME_MESS|FNAME_HYP|FNAME_EXP,
+ Prenum1);
+ if (ptr != NULL)
+ {
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ setpcmark();
+ if (win_split(0, 0) == OK)
+ {
+# ifdef FEAT_SCROLLBIND
+ curwin->w_p_scb = FALSE;
+# endif
+ (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
+ ECMD_HIDE);
+ }
+ vim_free(ptr);
+ }
+ break;
+#endif
+
+#ifdef FEAT_FIND_ID
+/* Go to the first occurence of the identifier under cursor along path in a
+ * new window -- webb
+ */
+ case 'i': /* Go to any match */
+ case Ctrl_I:
+ type = FIND_ANY;
+ /* FALLTHROUGH */
+ case 'd': /* Go to definition, using 'define' */
+ case Ctrl_D:
+ CHECK_CMDWIN
+ if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0)
+ break;
+ find_pattern_in_path(ptr, 0, len, TRUE,
+ Prenum == 0 ? TRUE : FALSE, type,
+ Prenum1, ACTION_SPLIT, (linenr_T)1, (linenr_T)MAXLNUM);
+ curwin->w_set_curswant = TRUE;
+ break;
+#endif
+
+/* CTRL-W g extended commands */
+ case 'g':
+ case Ctrl_G:
+ CHECK_CMDWIN
+#ifdef USE_ON_FLY_SCROLL
+ dont_scroll = TRUE; /* disallow scrolling here */
+#endif
+ ++no_mapping;
+ ++allow_keys; /* no mapping for xchar, but allow key codes */
+ if (xchar == NUL)
+ xchar = safe_vgetc();
+#ifdef FEAT_LANGMAP
+ LANGMAP_ADJUST(xchar, TRUE);
+#endif
+ --no_mapping;
+ --allow_keys;
+#ifdef FEAT_CMDL_INFO
+ (void)add_to_showcmd(xchar);
+#endif
+ switch (xchar)
+ {
+#if defined(FEAT_QUICKFIX)
+ case '}':
+ xchar = Ctrl_RSB;
+ if (Prenum)
+ g_do_tagpreview = Prenum;
+ else
+ g_do_tagpreview = p_pvh;
+ /*FALLTHROUGH*/
+#endif
+ case ']':
+ case Ctrl_RSB:
+#ifdef FEAT_VISUAL
+ reset_VIsual_and_resel(); /* stop Visual mode */
+#endif
+ if (Prenum)
+ postponed_split = Prenum;
+ else
+ postponed_split = -1;
+
+ /* Execute the command right here, required when
+ * "wincmd g}" was used in a function. */
+ do_nv_ident('g', xchar);
+ break;
+
+ default:
+ beep_flush();
+ break;
+ }
+ break;
+
+ default: beep_flush();
+ break;
+ }
+}
+
+/*
+ * split the current window, implements CTRL-W s and :split
+ *
+ * "size" is the height or width for the new window, 0 to use half of current
+ * height or width.
+ *
+ * "flags":
+ * WSP_ROOM: require enough room for new window
+ * WSP_VERT: vertical split.
+ * WSP_TOP: open window at the top-left of the shell (help window).
+ * WSP_BOT: open window at the bottom-right of the shell (quickfix window).
+ * WSP_HELP: creating the help window, keep layout snapshot
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+win_split(size, flags)
+ int size;
+ int flags;
+{
+ /* Add flags from ":vertical", ":topleft" and ":botright". */
+ flags |= cmdmod.split;
+ if ((flags & WSP_TOP) && (flags & WSP_BOT))
+ {
+ EMSG(_("E442: Can't split topleft and botright at the same time"));
+ return FAIL;
+ }
+
+ /* When creating the help window make a snapshot of the window layout.
+ * Otherwise clear the snapshot, it's now invalid. */
+ if (flags & WSP_HELP)
+ make_snapshot();
+ else
+ clear_snapshot();
+
+ return win_split_ins(size, flags, NULL, 0);
+}
+
+/*
+ * When "newwin" is NULL: split a window in two.
+ * When "newwin" is not NULL: insert this window at the far
+ * top/left/right/bottom.
+ * return FAIL for failure, OK otherwise
+ */
+ static int
+win_split_ins(size, flags, newwin, dir)
+ int size;
+ int flags;
+ win_T *newwin;
+ int dir;
+{
+ win_T *wp = newwin;
+ win_T *oldwin;
+ int new_size = size;
+ int i;
+ int need_status = 0;
+ int do_equal = FALSE;
+ int needed;
+ int available;
+ int oldwin_height = 0;
+ int layout;
+ frame_T *frp, *curfrp;
+ int before;
+
+ if (flags & WSP_TOP)
+ oldwin = firstwin;
+ else if (flags & WSP_BOT)
+ oldwin = lastwin;
+ else
+ oldwin = curwin;
+
+ /* add a status line when p_ls == 1 and splitting the first window */
+ if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0)
+ {
+ if (oldwin->w_height <= p_wmh && newwin == NULL)
+ {
+ EMSG(_(e_noroom));
+ return FAIL;
+ }
+ need_status = STATUS_HEIGHT;
+ }
+
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_VERT)
+ {
+ layout = FR_ROW;
+ do_equal = (p_ea && new_size == 0 && *p_ead != 'v');
+
+ /*
+ * Check if we are able to split the current window and compute its
+ * width.
+ */
+ needed = p_wmw + 1;
+ if (flags & WSP_ROOM)
+ needed += p_wiw - p_wmw;
+ if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+ {
+ available = topframe->fr_width;
+ needed += frame_minwidth(topframe, NULL);
+ }
+ else
+ available = oldwin->w_width;
+ if (available < needed && newwin == NULL)
+ {
+ EMSG(_(e_noroom));
+ return FAIL;
+ }
+ if (new_size == 0)
+ new_size = oldwin->w_width / 2;
+ if (new_size > oldwin->w_width - p_wmw - 1)
+ new_size = oldwin->w_width - p_wmw - 1;
+ if (new_size < p_wmw)
+ new_size = p_wmw;
+
+ /* if it doesn't fit in the current window, need win_equal() */
+ if (oldwin->w_width - new_size - 1 < p_wmw)
+ do_equal = TRUE;
+ }
+ else
+#endif
+ {
+ layout = FR_COL;
+ do_equal = (p_ea && new_size == 0
+#ifdef FEAT_VERTSPLIT
+ && *p_ead != 'h'
+#endif
+ );
+
+ /*
+ * Check if we are able to split the current window and compute its
+ * height.
+ */
+ needed = p_wmh + STATUS_HEIGHT + need_status;
+ if (flags & WSP_ROOM)
+ needed += p_wh - p_wmh;
+ if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+ {
+ available = topframe->fr_height;
+ needed += frame_minheight(topframe, NULL);
+ }
+ else
+ {
+ available = oldwin->w_height;
+ needed += p_wmh;
+ }
+ if (available < needed && newwin == NULL)
+ {
+ EMSG(_(e_noroom));
+ return FAIL;
+ }
+ oldwin_height = oldwin->w_height;
+ if (need_status)
+ {
+ oldwin->w_status_height = STATUS_HEIGHT;
+ oldwin_height -= STATUS_HEIGHT;
+ }
+ if (new_size == 0)
+ new_size = oldwin_height / 2;
+
+ if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT)
+ new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
+ if (new_size < p_wmh)
+ new_size = p_wmh;
+
+ /* if it doesn't fit in the current window, need win_equal() */
+ if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
+ do_equal = TRUE;
+
+ /* We don't like to take lines for the new window from a
+ * 'winfixheight' window. Take them from a window above or below
+ * instead, if possible. */
+ if (oldwin->w_p_wfh)
+ {
+ win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
+ oldwin);
+ oldwin_height = oldwin->w_height;
+ if (need_status)
+ oldwin_height -= STATUS_HEIGHT;
+ }
+ }
+
+ /*
+ * allocate new window structure and link it in the window list
+ */
+ if ((flags & WSP_TOP) == 0
+ && ((flags & WSP_BOT)
+ || (flags & WSP_BELOW)
+ || (!(flags & WSP_ABOVE)
+ && (
+#ifdef FEAT_VERTSPLIT
+ (flags & WSP_VERT) ? p_spr :
+#endif
+ p_sb))))
+ {
+ /* new window below/right of current one */
+ if (newwin == NULL)
+ wp = win_alloc(oldwin);
+ else
+ win_append(oldwin, wp);
+ }
+ else
+ {
+ if (newwin == NULL)
+ wp = win_alloc(oldwin->w_prev);
+ else
+ win_append(oldwin->w_prev, wp);
+ }
+
+ if (newwin == NULL)
+ {
+ if (wp == NULL)
+ return FAIL;
+
+ /*
+ * make the contents of the new window the same as the current one
+ */
+ wp->w_buffer = curbuf;
+ curbuf->b_nwindows++;
+ wp->w_cursor = curwin->w_cursor;
+ wp->w_valid = 0;
+ wp->w_curswant = curwin->w_curswant;
+ wp->w_set_curswant = curwin->w_set_curswant;
+ wp->w_topline = curwin->w_topline;
+#ifdef FEAT_DIFF
+ wp->w_topfill = curwin->w_topfill;
+#endif
+ wp->w_leftcol = curwin->w_leftcol;
+ wp->w_pcmark = curwin->w_pcmark;
+ wp->w_prev_pcmark = curwin->w_prev_pcmark;
+ wp->w_alt_fnum = curwin->w_alt_fnum;
+ wp->w_fraction = curwin->w_fraction;
+ wp->w_prev_fraction_row = curwin->w_prev_fraction_row;
+#ifdef FEAT_JUMPLIST
+ copy_jumplist(curwin, wp);
+#endif
+ if (curwin->w_localdir != NULL)
+ wp->w_localdir = vim_strsave(curwin->w_localdir);
+
+ /* Use the same argument list. */
+ wp->w_alist = curwin->w_alist;
+ ++wp->w_alist->al_refcount;
+ wp->w_arg_idx = curwin->w_arg_idx;
+
+ /*
+ * copy tagstack and options from existing window
+ */
+ for (i = 0; i < curwin->w_tagstacklen; i++)
+ {
+ wp->w_tagstack[i] = curwin->w_tagstack[i];
+ if (wp->w_tagstack[i].tagname != NULL)
+ wp->w_tagstack[i].tagname =
+ vim_strsave(wp->w_tagstack[i].tagname);
+ }
+ wp->w_tagstackidx = curwin->w_tagstackidx;
+ wp->w_tagstacklen = curwin->w_tagstacklen;
+ win_copy_options(curwin, wp);
+#ifdef FEAT_FOLDING
+ copyFoldingState(curwin, wp);
+#endif
+ }
+
+ /*
+ * Reorganise the tree of frames to insert the new window.
+ */
+ if (flags & (WSP_TOP | WSP_BOT))
+ {
+#ifdef FEAT_VERTSPLIT
+ if ((topframe->fr_layout == FR_COL && (flags & WSP_VERT) == 0)
+ || (topframe->fr_layout == FR_ROW && (flags & WSP_VERT) != 0))
+#else
+ if (topframe->fr_layout == FR_COL)
+#endif
+ {
+ curfrp = topframe->fr_child;
+ if (flags & WSP_BOT)
+ while (curfrp->fr_next != NULL)
+ curfrp = curfrp->fr_next;
+ }
+ else
+ curfrp = topframe;
+ before = (flags & WSP_TOP);
+ }
+ else
+ {
+ curfrp = oldwin->w_frame;
+ if (flags & WSP_BELOW)
+ before = FALSE;
+ else if (flags & WSP_ABOVE)
+ before = TRUE;
+ else
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_VERT)
+ before = !p_spr;
+ else
+#endif
+ before = !p_sb;
+ }
+ if (curfrp->fr_parent == NULL || curfrp->fr_parent->fr_layout != layout)
+ {
+ /* Need to create a new frame in the tree to make a branch. */
+ frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ *frp = *curfrp;
+ curfrp->fr_layout = layout;
+ frp->fr_parent = curfrp;
+ frp->fr_next = NULL;
+ frp->fr_prev = NULL;
+ curfrp->fr_child = frp;
+ curfrp->fr_win = NULL;
+ curfrp = frp;
+ if (frp->fr_win != NULL)
+ oldwin->w_frame = frp;
+ else
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ frp->fr_parent = curfrp;
+ }
+
+ if (newwin == NULL)
+ {
+ /* Create a frame for the new window. */
+ frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ frp->fr_layout = FR_LEAF;
+ frp->fr_win = wp;
+ wp->w_frame = frp;
+ }
+ else
+ frp = newwin->w_frame;
+ frp->fr_parent = curfrp->fr_parent;
+
+ /* Insert the new frame at the right place in the frame list. */
+ if (before)
+ frame_insert(curfrp, frp);
+ else
+ frame_append(curfrp, frp);
+
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_VERT)
+ {
+ wp->w_p_scr = curwin->w_p_scr;
+ if (need_status)
+ {
+ --oldwin->w_height;
+ oldwin->w_status_height = need_status;
+ }
+ if (flags & (WSP_TOP | WSP_BOT))
+ {
+ /* set height and row of new window to full height */
+ wp->w_winrow = 0;
+ wp->w_height = curfrp->fr_height - (p_ls > 0);
+ wp->w_status_height = (p_ls > 0);
+ }
+ else
+ {
+ /* height and row of new window is same as current window */
+ wp->w_winrow = oldwin->w_winrow;
+ wp->w_height = oldwin->w_height;
+ wp->w_status_height = oldwin->w_status_height;
+ }
+ frp->fr_height = curfrp->fr_height;
+
+ /* "new_size" of the current window goes to the new window, use
+ * one column for the vertical separator */
+ wp->w_width = new_size;
+ if (before)
+ wp->w_vsep_width = 1;
+ else
+ {
+ wp->w_vsep_width = oldwin->w_vsep_width;
+ oldwin->w_vsep_width = 1;
+ }
+ if (flags & (WSP_TOP | WSP_BOT))
+ {
+ if (flags & WSP_BOT)
+ frame_add_vsep(curfrp);
+ /* Set width of neighbor frame */
+ frame_new_width(curfrp, curfrp->fr_width
+ - (new_size + ((flags & WSP_TOP) != 0)), flags & WSP_TOP);
+ }
+ else
+ oldwin->w_width -= new_size + 1;
+ if (before) /* new window left of current one */
+ {
+ wp->w_wincol = oldwin->w_wincol;
+ oldwin->w_wincol += new_size + 1;
+ }
+ else /* new window right of current one */
+ wp->w_wincol = oldwin->w_wincol + oldwin->w_width + 1;
+ frame_fix_width(oldwin);
+ frame_fix_width(wp);
+ }
+ else
+#endif
+ {
+ /* width and column of new window is same as current window */
+#ifdef FEAT_VERTSPLIT
+ if (flags & (WSP_TOP | WSP_BOT))
+ {
+ wp->w_wincol = 0;
+ wp->w_width = Columns;
+ wp->w_vsep_width = 0;
+ }
+ else
+ {
+ wp->w_wincol = oldwin->w_wincol;
+ wp->w_width = oldwin->w_width;
+ wp->w_vsep_width = oldwin->w_vsep_width;
+ }
+ frp->fr_width = curfrp->fr_width;
+#endif
+
+ /* "new_size" of the current window goes to the new window, use
+ * one row for the status line */
+ win_new_height(wp, new_size);
+ if (flags & (WSP_TOP | WSP_BOT))
+ frame_new_height(curfrp, curfrp->fr_height
+ - (new_size + STATUS_HEIGHT), flags & WSP_TOP, FALSE);
+ else
+ win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
+ if (before) /* new window above current one */
+ {
+ wp->w_winrow = oldwin->w_winrow;
+ wp->w_status_height = STATUS_HEIGHT;
+ oldwin->w_winrow += wp->w_height + STATUS_HEIGHT;
+ }
+ else /* new window below current one */
+ {
+ wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT;
+ wp->w_status_height = oldwin->w_status_height;
+ oldwin->w_status_height = STATUS_HEIGHT;
+ }
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_BOT)
+ frame_add_statusline(curfrp);
+#endif
+ frame_fix_height(wp);
+ frame_fix_height(oldwin);
+ }
+
+ if (flags & (WSP_TOP | WSP_BOT))
+ (void)win_comp_pos();
+
+ /*
+ * Both windows need redrawing
+ */
+ redraw_win_later(wp, NOT_VALID);
+ wp->w_redr_status = TRUE;
+ redraw_win_later(oldwin, NOT_VALID);
+ oldwin->w_redr_status = TRUE;
+
+ if (need_status)
+ {
+ msg_row = Rows - 1;
+ msg_col = sc_col;
+ msg_clr_eos_force(); /* Old command/ruler may still be there */
+ comp_col();
+ msg_row = Rows - 1;
+ msg_col = 0; /* put position back at start of line */
+ }
+
+ /*
+ * make the new window the current window and redraw
+ */
+ if (do_equal || dir != 0)
+ win_equal(wp, TRUE,
+#ifdef FEAT_VERTSPLIT
+ (flags & WSP_VERT) ? (dir == 'v' ? 'b' : 'h')
+ : dir == 'h' ? 'b' :
+#endif
+ 'v');
+
+ /* Don't change the window height/width to 'winheight' / 'winwidth' if a
+ * size was given. */
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_VERT)
+ {
+ i = p_wiw;
+ if (size != 0)
+ p_wiw = size;
+
+# ifdef FEAT_GUI
+ /* When 'guioptions' includes 'L' or 'R' may have to add scrollbars. */
+ if (gui.in_use)
+ gui_init_which_components(NULL);
+# endif
+ }
+ else
+#endif
+ {
+ i = p_wh;
+ if (size != 0)
+ p_wh = size;
+ }
+ win_enter(wp, FALSE);
+#ifdef FEAT_VERTSPLIT
+ if (flags & WSP_VERT)
+ p_wiw = i;
+ else
+#endif
+ p_wh = i;
+
+ return OK;
+}
+
+#endif /* FEAT_WINDOWS */
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Return minimal height for window "wp" and windows east of it.
+ * Takes into account the eastbound windws can be split, each of them
+ * requireing p_wmh lines. Doesn't count status lines.
+ */
+ static int
+win_minheight(wp)
+ win_T *wp;
+{
+ int minheight = p_wmh;
+ int n;
+ win_T *wp1, *wp2;
+
+ wp1 = wp;
+ for (;;)
+ {
+ wp1 = wp1->w_next;
+ if (wp1 == NULL)
+ break;
+ n = p_wmh;
+ wp2 = wp1;
+ for (;;)
+ {
+ wp2 = wp2->w_next;
+ if (wp2 == NULL)
+ break;
+ n += win_minheight(wp2);
+ }
+ if (n > minheight)
+ minheight = n;
+ }
+ return minheight;
+}
+
+#endif
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Check if "win" is a pointer to an existing window.
+ */
+ int
+win_valid(win)
+ win_T *win;
+{
+ win_T *wp;
+
+ if (win == NULL)
+ return FALSE;
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (wp == win)
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Return the number of windows.
+ */
+ int
+win_count()
+{
+ win_T *wp;
+ int count = 0;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ ++count;
+ return count;
+}
+
+/*
+ * Make "count" windows on the screen.
+ * Return actual number of windows on the screen.
+ * Must be called when there is just one window, filling the whole screen
+ * (excluding the command line).
+ */
+/*ARGSUSED*/
+ int
+make_windows(count, vertical)
+ int count;
+ int vertical; /* split windows vertically if TRUE */
+{
+ int maxcount;
+ int todo;
+
+#ifdef FEAT_VERTSPLIT
+ if (vertical)
+ {
+ /* Each windows needs at least 'winminwidth' lines and a separator
+ * column. */
+ maxcount = (curwin->w_width + curwin->w_vsep_width
+ - (p_wiw - p_wmw)) / (p_wmw + 1);
+ }
+ else
+#endif
+ {
+ /* Each window needs at least 'winminheight' lines and a status line. */
+ maxcount = (curwin->w_height + curwin->w_status_height
+ - (p_wh - p_wmh)) / (p_wmh + STATUS_HEIGHT);
+ }
+
+ if (maxcount < 2)
+ maxcount = 2;
+ if (count > maxcount)
+ count = maxcount;
+
+ /*
+ * add status line now, otherwise first window will be too big
+ */
+ if (count > 1)
+ last_status(TRUE);
+
+#ifdef FEAT_AUTOCMD
+ /*
+ * Don't execute autocommands while creating the windows. Must do that
+ * when putting the buffers in the windows.
+ */
+ ++autocmd_block;
+#endif
+
+ /* todo is number of windows left to create */
+ for (todo = count - 1; todo > 0; --todo)
+#ifdef FEAT_VERTSPLIT
+ if (vertical)
+ {
+ if (win_split(curwin->w_width - (curwin->w_width - todo)
+ / (todo + 1) - 1, WSP_VERT | WSP_ABOVE) == FAIL)
+ break;
+ }
+ else
+#endif
+ {
+ if (win_split(curwin->w_height - (curwin->w_height - todo
+ * STATUS_HEIGHT) / (todo + 1)
+ - STATUS_HEIGHT, WSP_ABOVE) == FAIL)
+ break;
+ }
+
+#ifdef FEAT_AUTOCMD
+ --autocmd_block;
+#endif
+
+ /* return actual number of windows */
+ return (count - todo);
+}
+
+/*
+ * Exchange current and next window
+ */
+ static void
+win_exchange(Prenum)
+ long Prenum;
+{
+ frame_T *frp;
+ frame_T *frp2;
+ win_T *wp;
+ win_T *wp2;
+ int temp;
+
+ if (lastwin == firstwin) /* just one window */
+ {
+ beep_flush();
+ return;
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+ /*
+ * find window to exchange with
+ */
+ if (Prenum)
+ {
+ frp = curwin->w_frame->fr_parent->fr_child;
+ while (frp != NULL && --Prenum > 0)
+ frp = frp->fr_next;
+ }
+ else if (curwin->w_frame->fr_next != NULL) /* Swap with next */
+ frp = curwin->w_frame->fr_next;
+ else /* Swap last window in row/col with previous */
+ frp = curwin->w_frame->fr_prev;
+
+ /* We can only exchange a window with another window, not with a frame
+ * containing windows. */
+ if (frp == NULL || frp->fr_win == NULL || frp->fr_win == curwin)
+ return;
+ wp = frp->fr_win;
+
+/*
+ * 1. remove curwin from the list. Remember after which window it was in wp2
+ * 2. insert curwin before wp in the list
+ * if wp != wp2
+ * 3. remove wp from the list
+ * 4. insert wp after wp2
+ * 5. exchange the status line height and vsep width.
+ */
+ wp2 = curwin->w_prev;
+ frp2 = curwin->w_frame->fr_prev;
+ if (wp->w_prev != curwin)
+ {
+ win_remove(curwin);
+ frame_remove(curwin->w_frame);
+ win_append(wp->w_prev, curwin);
+ frame_insert(frp, curwin->w_frame);
+ }
+ if (wp != wp2)
+ {
+ win_remove(wp);
+ frame_remove(wp->w_frame);
+ win_append(wp2, wp);
+ if (frp2 == NULL)
+ frame_insert(wp->w_frame->fr_parent->fr_child, wp->w_frame);
+ else
+ frame_append(frp2, wp->w_frame);
+ }
+ temp = curwin->w_status_height;
+ curwin->w_status_height = wp->w_status_height;
+ wp->w_status_height = temp;
+#ifdef FEAT_VERTSPLIT
+ temp = curwin->w_vsep_width;
+ curwin->w_vsep_width = wp->w_vsep_width;
+ wp->w_vsep_width = temp;
+
+ /* If the windows are not in the same frame, exchange the sizes to avoid
+ * messing up the window layout. Otherwise fix the frame sizes. */
+ if (curwin->w_frame->fr_parent != wp->w_frame->fr_parent)
+ {
+ temp = curwin->w_height;
+ curwin->w_height = wp->w_height;
+ wp->w_height = temp;
+ temp = curwin->w_width;
+ curwin->w_width = wp->w_width;
+ wp->w_width = temp;
+ }
+ else
+ {
+ frame_fix_height(curwin);
+ frame_fix_height(wp);
+ frame_fix_width(curwin);
+ frame_fix_width(wp);
+ }
+#endif
+
+ (void)win_comp_pos(); /* recompute window positions */
+
+ win_enter(wp, TRUE);
+ redraw_later(CLEAR);
+}
+
+/*
+ * rotate windows: if upwards TRUE the second window becomes the first one
+ * if upwards FALSE the first window becomes the second one
+ */
+ static void
+win_rotate(upwards, count)
+ int upwards;
+ int count;
+{
+ win_T *wp1;
+ win_T *wp2;
+ frame_T *frp;
+ int n;
+
+ if (firstwin == lastwin) /* nothing to do */
+ {
+ beep_flush();
+ return;
+ }
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+
+#ifdef FEAT_VERTSPLIT
+ /* Check if all frames in this row/col have one window. */
+ for (frp = curwin->w_frame->fr_parent->fr_child; frp != NULL;
+ frp = frp->fr_next)
+ if (frp->fr_win == NULL)
+ {
+ EMSG(_("E443: Cannot rotate when another window is split"));
+ return;
+ }
+#endif
+
+ while (count--)
+ {
+ if (upwards) /* first window becomes last window */
+ {
+ /* remove first window/frame from the list */
+ frp = curwin->w_frame->fr_parent->fr_child;
+ wp1 = frp->fr_win;
+ win_remove(wp1);
+ frame_remove(frp);
+
+ /* find last frame and append removed window/frame after it */
+ for ( ; frp->fr_next != NULL; frp = frp->fr_next)
+ ;
+ win_append(frp->fr_win, wp1);
+ frame_append(frp, wp1->w_frame);
+
+ wp2 = frp->fr_win; /* previously last window */
+ }
+ else /* last window becomes first window */
+ {
+ /* find last window/frame in the list and remove it */
+ for (frp = curwin->w_frame; frp->fr_next != NULL;
+ frp = frp->fr_next)
+ ;
+ wp1 = frp->fr_win;
+ wp2 = wp1->w_prev; /* will become last window */
+ win_remove(wp1);
+ frame_remove(frp);
+
+ /* append the removed window/frame before the first in the list */
+ win_append(frp->fr_parent->fr_child->fr_win->w_prev, wp1);
+ frame_insert(frp->fr_parent->fr_child, frp);
+ }
+
+ /* exchange status height and vsep width of old and new last window */
+ n = wp2->w_status_height;
+ wp2->w_status_height = wp1->w_status_height;
+ wp1->w_status_height = n;
+ frame_fix_height(wp1);
+ frame_fix_height(wp2);
+#ifdef FEAT_VERTSPLIT
+ n = wp2->w_vsep_width;
+ wp2->w_vsep_width = wp1->w_vsep_width;
+ wp1->w_vsep_width = n;
+ frame_fix_width(wp1);
+ frame_fix_width(wp2);
+#endif
+
+ /* recompute w_winrow and w_wincol for all windows */
+ (void)win_comp_pos();
+ }
+
+ redraw_later(CLEAR);
+}
+
+/*
+ * Move the current window to the very top/bottom/left/right of the screen.
+ */
+ static void
+win_totop(size, flags)
+ int size;
+ int flags;
+{
+ int dir;
+ int height = curwin->w_height;
+
+ if (lastwin == firstwin)
+ {
+ beep_flush();
+ return;
+ }
+
+ /* Remove the window and frame from the tree of frames. */
+ (void)winframe_remove(curwin, &dir);
+ win_remove(curwin);
+ last_status(FALSE); /* may need to remove last status line */
+ (void)win_comp_pos(); /* recompute window positions */
+
+ /* Split a window on the desired side and put the window there. */
+ (void)win_split_ins(size, flags, curwin, dir);
+ if (!(flags & WSP_VERT))
+ {
+ win_setheight(height);
+ if (p_ea)
+ win_equal(curwin, TRUE, 'v');
+ }
+
+#if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
+ /* When 'guioptions' includes 'L' or 'R' may have to remove or add
+ * scrollbars. Have to update them anyway. */
+ if (gui.in_use)
+ {
+ out_flush();
+ gui_init_which_components(NULL);
+ gui_update_scrollbars(TRUE);
+ }
+ need_mouse_correct = TRUE;
+#endif
+
+}
+
+/*
+ * Move window "win1" to below/right of "win2" and make "win1" the current
+ * window. Only works within the same frame!
+ */
+ void
+win_move_after(win1, win2)
+ win_T *win1, *win2;
+{
+ int height;
+
+ /* check if the arguments are reasonable */
+ if (win1 == win2)
+ return;
+
+ /* check if there is something to do */
+ if (win2->w_next != win1)
+ {
+ /* may need move the status line/vertical separator of the last window
+ * */
+ if (win1 == lastwin)
+ {
+ height = win1->w_prev->w_status_height;
+ win1->w_prev->w_status_height = win1->w_status_height;
+ win1->w_status_height = height;
+#ifdef FEAT_VERTSPLIT
+ win1->w_prev->w_vsep_width = 0;
+ win1->w_vsep_width = 1;
+#endif
+ }
+ else if (win2 == lastwin)
+ {
+ height = win1->w_status_height;
+ win1->w_status_height = win2->w_status_height;
+ win2->w_status_height = height;
+#ifdef FEAT_VERTSPLIT
+ win2->w_vsep_width = 1;
+ win1->w_vsep_width = 0;
+#endif
+ }
+ win_remove(win1);
+ frame_remove(win1->w_frame);
+ win_append(win2, win1);
+ frame_append(win2->w_frame, win1->w_frame);
+
+ (void)win_comp_pos(); /* recompute w_winrow for all windows */
+ redraw_later(NOT_VALID);
+ }
+ win_enter(win1, FALSE);
+}
+
+/*
+ * Make all windows the same height.
+ * 'next_curwin' will soon be the current window, make sure it has enough
+ * rows.
+ */
+ void
+win_equal(next_curwin, current, dir)
+ win_T *next_curwin; /* pointer to current window to be or NULL */
+ int current; /* do only frame with current window */
+ int dir; /* 'v' for vertically, 'h' for horizontally,
+ 'b' for both, 0 for using p_ead */
+{
+ if (dir == 0)
+#ifdef FEAT_VERTSPLIT
+ dir = *p_ead;
+#else
+ dir = 'b';
+#endif
+ win_equal_rec(next_curwin == NULL ? curwin : next_curwin, current,
+ topframe, dir, 0, 0, (int)Columns, topframe->fr_height);
+}
+
+/*
+ * Set a frame to a new position and height, spreading the available room
+ * equally over contained frames.
+ * The window "next_curwin" (if not NULL) should at least get the size from
+ * 'winheight' and 'winwidth' if possible.
+ */
+ static void
+win_equal_rec(next_curwin, current, topfr, dir, col, row, width, height)
+ win_T *next_curwin; /* pointer to current window to be or NULL */
+ int current; /* do only frame with current window */
+ frame_T *topfr; /* frame to set size off */
+ int dir; /* 'v', 'h' or 'b', see win_equal() */
+ int col; /* horizontal position for frame */
+ int row; /* vertical position for frame */
+ int width; /* new width of frame */
+ int height; /* new height of frame */
+{
+ int n, m;
+ int extra_sep = 0;
+ int wincount, totwincount = 0;
+ frame_T *fr;
+ int next_curwin_size = 0;
+ int room = 0;
+ int new_size;
+ int has_next_curwin = 0;
+ int hnc;
+
+ if (topfr->fr_layout == FR_LEAF)
+ {
+ /* Set the width/height of this frame.
+ * Redraw when size or position changes */
+ if (topfr->fr_height != height || topfr->fr_win->w_winrow != row
+#ifdef FEAT_VERTSPLIT
+ || topfr->fr_width != width || topfr->fr_win->w_wincol != col
+#endif
+ )
+ {
+ topfr->fr_win->w_winrow = row;
+ frame_new_height(topfr, height, FALSE, FALSE);
+#ifdef FEAT_VERTSPLIT
+ topfr->fr_win->w_wincol = col;
+ frame_new_width(topfr, width, FALSE);
+#endif
+ redraw_all_later(CLEAR);
+ }
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (topfr->fr_layout == FR_ROW)
+ {
+ topfr->fr_width = width;
+ topfr->fr_height = height;
+
+ if (dir != 'v') /* equalize frame widths */
+ {
+ /* Compute the maximum number of windows horizontally in this
+ * frame. */
+ n = frame_minwidth(topfr, NOWIN);
+ /* add one for the rightmost window, it doesn't have a separator */
+ if (col + width == Columns)
+ extra_sep = 1;
+ else
+ extra_sep = 0;
+ totwincount = (n + extra_sep) / (p_wmw + 1);
+
+ /* Compute room available for windows other than "next_curwin" */
+ m = frame_minwidth(topfr, next_curwin);
+ room = width - m;
+ if (room < 0)
+ {
+ next_curwin_size = p_wiw + room;
+ room = 0;
+ }
+ else if (n == m) /* doesn't contain curwin */
+ next_curwin_size = 0;
+ else
+ {
+ next_curwin_size = (room + p_wiw + (totwincount - 1) * p_wmw
+ + (totwincount - 1)) / totwincount;
+ if (next_curwin_size > p_wiw)
+ room -= next_curwin_size - p_wiw;
+ else
+ next_curwin_size = p_wiw;
+ }
+ if (n != m)
+ --totwincount; /* don't count curwin */
+ }
+
+ for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
+ {
+ n = m = 0;
+ wincount = 1;
+ if (fr->fr_next == NULL)
+ /* last frame gets all that remains (avoid roundoff error) */
+ new_size = width;
+ else if (dir == 'v')
+ new_size = fr->fr_width;
+ else
+ {
+ /* Compute the maximum number of windows horiz. in "fr". */
+ n = frame_minwidth(fr, NOWIN);
+ wincount = (n + (fr->fr_next == NULL ? extra_sep : 0))
+ / (p_wmw + 1);
+ m = frame_minwidth(fr, next_curwin);
+ if (n != m) /* don't count next_curwin */
+ --wincount;
+ new_size = (wincount * room + ((unsigned)totwincount >> 1))
+ / totwincount;
+ if (n != m) /* add next_curwin size */
+ {
+ next_curwin_size -= p_wiw - (m - n);
+ new_size += next_curwin_size;
+ }
+ }
+
+ /* Skip frame that is full height when splitting or closing a
+ * window, unless equalizing all frames. */
+ if (!current || dir != 'v' || topfr->fr_parent != NULL
+ || (new_size != fr->fr_width)
+ || frame_has_win(fr, next_curwin))
+ win_equal_rec(next_curwin, current, fr, dir, col, row,
+ new_size + n, height);
+ col += new_size + n;
+ width -= new_size + n;
+ if (n != m) /* contains curwin */
+ room -= new_size - next_curwin_size;
+ else
+ room -= new_size;
+ totwincount -= wincount;
+ }
+ }
+#endif
+ else /* topfr->fr_layout == FR_COL */
+ {
+#ifdef FEAT_VERTSPLIT
+ topfr->fr_width = width;
+#endif
+ topfr->fr_height = height;
+
+ if (dir != 'h') /* equalize frame heights */
+ {
+ /* Compute maximum number of windows vertically in this frame. */
+ n = frame_minheight(topfr, NOWIN);
+ /* add one for the bottom window if it doesn't have a statusline */
+ if (row + height == cmdline_row && p_ls == 0)
+ extra_sep = 1;
+ else
+ extra_sep = 0;
+ totwincount = (n + extra_sep) / (p_wmh + 1);
+ has_next_curwin = frame_has_win(topfr, next_curwin);
+
+ /*
+ * Compute height for "next_curwin" window and room available for
+ * other windows.
+ * "m" is the minimal height when counting p_wh for "next_curwin".
+ */
+ m = frame_minheight(topfr, next_curwin);
+ room = height - m;
+ if (room < 0)
+ {
+ /* The room is less then 'winheight', use all space for the
+ * current window. */
+ next_curwin_size = p_wh + room;
+ room = 0;
+ }
+ else
+ {
+ next_curwin_size = -1;
+ for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
+ {
+ /* If 'winfixheight' set keep the window height if
+ * possible.
+ * Watch out for this window being the next_curwin. */
+ if (frame_fixed_height(fr))
+ {
+ n = frame_minheight(fr, NOWIN);
+ new_size = fr->fr_height;
+ if (frame_has_win(fr, next_curwin))
+ {
+ room += p_wh - p_wmh;
+ next_curwin_size = 0;
+ if (new_size < p_wh)
+ new_size = p_wh;
+ }
+ else
+ /* These windows don't use up room. */
+ totwincount -= (n + (fr->fr_next == NULL
+ ? extra_sep : 0)) / (p_wmh + 1);
+ room -= new_size - n;
+ if (room < 0)
+ {
+ new_size += room;
+ room = 0;
+ }
+ fr->fr_newheight = new_size;
+ }
+ }
+ if (next_curwin_size == -1)
+ {
+ if (!has_next_curwin)
+ next_curwin_size = 0;
+ else if (totwincount > 1
+ && (room + (totwincount - 2))
+ / (totwincount - 1) > p_wh)
+ {
+ next_curwin_size = (room + p_wh + totwincount * p_wmh
+ + (totwincount - 1)) / totwincount;
+ room -= next_curwin_size - p_wh;
+ }
+ else
+ next_curwin_size = p_wh;
+ }
+ }
+
+ if (has_next_curwin)
+ --totwincount; /* don't count curwin */
+ }
+
+ for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
+ {
+ n = m = 0;
+ wincount = 1;
+ if (fr->fr_next == NULL)
+ /* last frame gets all that remains (avoid roundoff error) */
+ new_size = height;
+ else if (dir == 'h')
+ new_size = fr->fr_height;
+ else if (frame_fixed_height(fr))
+ {
+ new_size = fr->fr_newheight;
+ wincount = 0; /* doesn't count as a sizeable window */
+ }
+ else
+ {
+ /* Compute the maximum number of windows vert. in "fr". */
+ n = frame_minheight(fr, NOWIN);
+ wincount = (n + (fr->fr_next == NULL ? extra_sep : 0))
+ / (p_wmh + 1);
+ m = frame_minheight(fr, next_curwin);
+ if (has_next_curwin)
+ hnc = frame_has_win(fr, next_curwin);
+ else
+ hnc = FALSE;
+ if (hnc) /* don't count next_curwin */
+ --wincount;
+ if (totwincount == 0)
+ new_size = room;
+ else
+ new_size = (wincount * room + ((unsigned)totwincount >> 1))
+ / totwincount;
+ if (hnc) /* add next_curwin size */
+ {
+ next_curwin_size -= p_wh - (m - n);
+ new_size += next_curwin_size;
+ room -= new_size - next_curwin_size;
+ }
+ else
+ room -= new_size;
+ new_size += n;
+ }
+ /* Skip frame that is full width when splitting or closing a
+ * window, unless equalizing all frames. */
+ if (!current || dir != 'h' || topfr->fr_parent != NULL
+ || (new_size != fr->fr_height)
+ || frame_has_win(fr, next_curwin))
+ win_equal_rec(next_curwin, current, fr, dir, col, row,
+ width, new_size);
+ row += new_size;
+ height -= new_size;
+ totwincount -= wincount;
+ }
+ }
+}
+
+/*
+ * close all windows for buffer 'buf'
+ */
+ void
+close_windows(buf)
+ buf_T *buf;
+{
+ win_T *win;
+
+ ++RedrawingDisabled;
+ for (win = firstwin; win != NULL && lastwin != firstwin; )
+ {
+ if (win->w_buffer == buf)
+ {
+ win_close(win, FALSE);
+ win = firstwin; /* go back to the start */
+ }
+ else
+ win = win->w_next;
+ }
+ --RedrawingDisabled;
+}
+
+/*
+ * close window "win"
+ * If "free_buf" is TRUE related buffer may be unloaded.
+ *
+ * called by :quit, :close, :xit, :wq and findtag()
+ */
+ void
+win_close(win, free_buf)
+ win_T *win;
+ int free_buf;
+{
+ win_T *wp;
+#ifdef FEAT_AUTOCMD
+ int other_buffer = FALSE;
+#endif
+ int close_curwin = FALSE;
+ frame_T *frp;
+ int dir;
+ int help_window = FALSE;
+
+ if (lastwin == firstwin)
+ {
+ EMSG(_("E444: Cannot close last window"));
+ return;
+ }
+
+ /* When closing the help window, try restoring a snapshot after closing
+ * the window. Otherwise clear the snapshot, it's now invalid. */
+ if (win->w_buffer->b_help)
+ help_window = TRUE;
+ else
+ clear_snapshot();
+
+#ifdef FEAT_AUTOCMD
+ if (win == curwin)
+ {
+ /*
+ * Guess which window is going to be the new current window.
+ * This may change because of the autocommands (sigh).
+ */
+ wp = frame2win(win_altframe(win));
+
+ /*
+ * Be careful: If autocommands delete the window, return now.
+ */
+ if (wp->w_buffer != curbuf)
+ {
+ other_buffer = TRUE;
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+ if (!win_valid(win) || firstwin == lastwin)
+ return;
+ }
+ apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+ if (!win_valid(win) || firstwin == lastwin)
+ return;
+# ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+ if (aborting())
+ return;
+# endif
+ }
+#endif
+
+ /*
+ * Close the link to the buffer.
+ */
+ close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
+ /* Autocommands may have closed the window already, or closed the only
+ * other window. */
+ if (!win_valid(win) || firstwin == lastwin)
+ return;
+
+ /* reduce the reference count to the argument list. */
+ alist_unlink(win->w_alist);
+
+ /* remove the window and its frame from the tree of frames. */
+ frp = win->w_frame;
+ wp = winframe_remove(win, &dir);
+ vim_free(frp);
+ win_free(win);
+
+ /* Make sure curwin isn't invalid. It can cause severe trouble when
+ * printing an error message. For win_equal() curbuf needs to be valid
+ * too. */
+ if (win == curwin)
+ {
+ curwin = wp;
+#ifdef FEAT_QUICKFIX
+ if (wp->w_p_pvw || bt_quickfix(wp->w_buffer))
+ {
+ /*
+ * The cursor goes to the preview or the quickfix window, try
+ * finding another window to go to.
+ */
+ for (;;)
+ {
+ if (wp->w_next == NULL)
+ wp = firstwin;
+ else
+ wp = wp->w_next;
+ if (wp == curwin)
+ break;
+ if (!wp->w_p_pvw && !bt_quickfix(wp->w_buffer))
+ {
+ curwin = wp;
+ break;
+ }
+ }
+ }
+#endif
+ curbuf = curwin->w_buffer;
+ close_curwin = TRUE;
+ }
+ if (p_ea)
+ win_equal(curwin, TRUE,
+#ifdef FEAT_VERTSPLIT
+ dir
+#else
+ 0
+#endif
+ );
+ else
+ win_comp_pos();
+ if (close_curwin)
+ {
+ win_enter_ext(wp, FALSE, TRUE);
+#ifdef FEAT_AUTOCMD
+ if (other_buffer)
+ /* careful: after this wp and win may be invalid! */
+ apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+#endif
+ }
+
+ /*
+ * if last window has a status line now and we don't want one,
+ * remove the status line
+ */
+ last_status(FALSE);
+
+ /* After closing the help window, try restoring the window layout from
+ * before it was opened. */
+ if (help_window)
+ restore_snapshot(close_curwin);
+
+#if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
+ /* When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. */
+ if (gui.in_use && !win_hasvertsplit())
+ gui_init_which_components(NULL);
+#endif
+
+ redraw_all_later(NOT_VALID);
+}
+
+/*
+ * Remove a window and its frame from the tree of frames.
+ * Returns a pointer to the window that got the freed up space.
+ */
+/*ARGSUSED*/
+ static win_T *
+winframe_remove(win, dirp)
+ win_T *win;
+ int *dirp; /* set to 'v' or 'h' for direction if 'ea' */
+{
+ frame_T *frp, *frp2, *frp3;
+ frame_T *frp_close = win->w_frame;
+ win_T *wp;
+ int old_height = 0;
+
+ /*
+ * Remove the window from its frame.
+ */
+ frp2 = win_altframe(win);
+ wp = frame2win(frp2);
+
+ /* Remove this frame from the list of frames. */
+ frame_remove(frp_close);
+
+#ifdef FEAT_VERTSPLIT
+ if (frp_close->fr_parent->fr_layout == FR_COL)
+ {
+#endif
+ /* When 'winfixheight' is set, remember its old size and restore
+ * it later (it's a simplistic solution...). Don't do this if the
+ * window will occupy the full height of the screen. */
+ if (frp2->fr_win != NULL
+ && (frp2->fr_next != NULL || frp2->fr_prev != NULL)
+ && frp2->fr_win->w_p_wfh)
+ old_height = frp2->fr_win->w_height;
+ frame_new_height(frp2, frp2->fr_height + frp_close->fr_height,
+ frp2 == frp_close->fr_next ? TRUE : FALSE, FALSE);
+ if (old_height != 0)
+ win_setheight_win(old_height, frp2->fr_win);
+#ifdef FEAT_VERTSPLIT
+ *dirp = 'v';
+ }
+ else
+ {
+ frame_new_width(frp2, frp2->fr_width + frp_close->fr_width,
+ frp2 == frp_close->fr_next ? TRUE : FALSE);
+ *dirp = 'h';
+ }
+#endif
+
+ /* If rows/columns go to a window below/right its positions need to be
+ * updated. Can only be done after the sizes have been updated. */
+ if (frp2 == frp_close->fr_next)
+ {
+ int row = win->w_winrow;
+ int col = W_WINCOL(win);
+
+ frame_comp_pos(frp2, &row, &col);
+ }
+
+ if (frp2->fr_next == NULL && frp2->fr_prev == NULL)
+ {
+ /* There is no other frame in this list, move its info to the parent
+ * and remove it. */
+ frp2->fr_parent->fr_layout = frp2->fr_layout;
+ frp2->fr_parent->fr_child = frp2->fr_child;
+ for (frp = frp2->fr_child; frp != NULL; frp = frp->fr_next)
+ frp->fr_parent = frp2->fr_parent;
+ frp2->fr_parent->fr_win = frp2->fr_win;
+ if (frp2->fr_win != NULL)
+ frp2->fr_win->w_frame = frp2->fr_parent;
+ frp = frp2->fr_parent;
+ vim_free(frp2);
+
+ frp2 = frp->fr_parent;
+ if (frp2 != NULL && frp2->fr_layout == frp->fr_layout)
+ {
+ /* The frame above the parent has the same layout, have to merge
+ * the frames into this list. */
+ if (frp2->fr_child == frp)
+ frp2->fr_child = frp->fr_child;
+ frp->fr_child->fr_prev = frp->fr_prev;
+ if (frp->fr_prev != NULL)
+ frp->fr_prev->fr_next = frp->fr_child;
+ for (frp3 = frp->fr_child; ; frp3 = frp3->fr_next)
+ {
+ frp3->fr_parent = frp2;
+ if (frp3->fr_next == NULL)
+ {
+ frp3->fr_next = frp->fr_next;
+ if (frp->fr_next != NULL)
+ frp->fr_next->fr_prev = frp3;
+ break;
+ }
+ }
+ vim_free(frp);
+ }
+ }
+
+ return wp;
+}
+
+/*
+ * Find out which frame is going to get the freed up space when "win" is
+ * closed.
+ * if 'splitbelow'/'splitleft' the space goes to the window above/left.
+ * if 'nosplitbelow'/'nosplitleft' the space goes to the window below/right.
+ * This makes opening a window and closing it immediately keep the same window
+ * layout.
+ */
+ static frame_T *
+win_altframe(win)
+ win_T *win;
+{
+ frame_T *frp;
+ int b;
+
+ frp = win->w_frame;
+#ifdef FEAT_VERTSPLIT
+ if (frp->fr_parent->fr_layout == FR_ROW)
+ b = p_spr;
+ else
+#endif
+ b = p_sb;
+ if ((!b && frp->fr_next != NULL) || frp->fr_prev == NULL)
+ return frp->fr_next;
+ return frp->fr_prev;
+}
+
+/*
+ * Find the left-upper window in frame "frp".
+ */
+ static win_T *
+frame2win(frp)
+ frame_T *frp;
+{
+ while (frp->fr_win == NULL)
+ frp = frp->fr_child;
+ return frp->fr_win;
+}
+
+/*
+ * Return TRUE if frame "frp" contains window "wp".
+ */
+ static int
+frame_has_win(frp, wp)
+ frame_T *frp;
+ win_T *wp;
+{
+ frame_T *p;
+
+ if (frp->fr_layout == FR_LEAF)
+ return frp->fr_win == wp;
+
+ for (p = frp->fr_child; p != NULL; p = p->fr_next)
+ if (frame_has_win(p, wp))
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Set a new height for a frame. Recursively sets the height for contained
+ * frames and windows. Caller must take care of positions.
+ */
+ static void
+frame_new_height(topfrp, height, topfirst, wfh)
+ frame_T *topfrp;
+ int height;
+ int topfirst; /* resize topmost contained frame first */
+ int wfh; /* obey 'winfixheight' when there is a choice;
+ may cause the height not to be set */
+{
+ frame_T *frp;
+ int extra_lines;
+ int h;
+
+ if (topfrp->fr_win != NULL)
+ {
+ /* Simple case: just one window. */
+ win_new_height(topfrp->fr_win,
+ height - topfrp->fr_win->w_status_height);
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (topfrp->fr_layout == FR_ROW)
+ {
+ do
+ {
+ /* All frames in this row get the same new height. */
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ {
+ frame_new_height(frp, height, topfirst, wfh);
+ if (frp->fr_height > height)
+ {
+ /* Could not fit the windows, make the whole row higher. */
+ height = frp->fr_height;
+ break;
+ }
+ }
+ }
+ while (frp != NULL);
+ }
+#endif
+ else
+ {
+ /* Complicated case: Resize a column of frames. Resize the bottom
+ * frame first, frames above that when needed. */
+
+ frp = topfrp->fr_child;
+ if (wfh)
+ /* Advance past frames with one window with 'wfh' set. */
+ while (frame_fixed_height(frp))
+ {
+ frp = frp->fr_next;
+ if (frp == NULL)
+ return; /* no frame without 'wfh', give up */
+ }
+ if (!topfirst)
+ {
+ /* Find the bottom frame of this column */
+ while (frp->fr_next != NULL)
+ frp = frp->fr_next;
+ if (wfh)
+ /* Advance back for frames with one window with 'wfh' set. */
+ while (frame_fixed_height(frp))
+ frp = frp->fr_prev;
+ }
+
+ extra_lines = height - topfrp->fr_height;
+ if (extra_lines < 0)
+ {
+ /* reduce height of contained frames, bottom or top frame first */
+ while (frp != NULL)
+ {
+ h = frame_minheight(frp, NULL);
+ if (frp->fr_height + extra_lines < h)
+ {
+ extra_lines += frp->fr_height - h;
+ frame_new_height(frp, h, topfirst, wfh);
+ }
+ else
+ {
+ frame_new_height(frp, frp->fr_height + extra_lines,
+ topfirst, wfh);
+ break;
+ }
+ if (topfirst)
+ {
+ do
+ frp = frp->fr_next;
+ while (wfh && frp != NULL && frame_fixed_height(frp));
+ }
+ else
+ {
+ do
+ frp = frp->fr_prev;
+ while (wfh && frp != NULL && frame_fixed_height(frp));
+ }
+ /* Increase "height" if we could not reduce enough frames. */
+ if (frp == NULL)
+ height -= extra_lines;
+ }
+ }
+ else if (extra_lines > 0)
+ {
+ /* increase height of bottom or top frame */
+ frame_new_height(frp, frp->fr_height + extra_lines, topfirst, wfh);
+ }
+ }
+ topfrp->fr_height = height;
+}
+
+/*
+ * Return TRUE if height of frame "frp" should not be changed because of
+ * the 'winfixheight' option.
+ */
+ static int
+frame_fixed_height(frp)
+ frame_T *frp;
+{
+ /* frame with one window: fixed height if 'winfixheight' set. */
+ if (frp->fr_win != NULL)
+ return frp->fr_win->w_p_wfh;
+
+ if (frp->fr_layout == FR_ROW)
+ {
+ /* The frame is fixed height if one of the frames in the row is fixed
+ * height. */
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ if (frame_fixed_height(frp))
+ return TRUE;
+ return FALSE;
+ }
+
+ /* frp->fr_layout == FR_COL: The frame is fixed height if all of the
+ * frames in the row are fixed height. */
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ if (!frame_fixed_height(frp))
+ return FALSE;
+ return TRUE;
+}
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Add a status line to windows at the bottom of "frp".
+ * Note: Does not check if there is room!
+ */
+ static void
+frame_add_statusline(frp)
+ frame_T *frp;
+{
+ win_T *wp;
+
+ if (frp->fr_layout == FR_LEAF)
+ {
+ wp = frp->fr_win;
+ if (wp->w_status_height == 0)
+ {
+ if (wp->w_height > 0) /* don't make it negative */
+ --wp->w_height;
+ wp->w_status_height = STATUS_HEIGHT;
+ }
+ }
+ else if (frp->fr_layout == FR_ROW)
+ {
+ /* Handle all the frames in the row. */
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ frame_add_statusline(frp);
+ }
+ else /* frp->fr_layout == FR_COL */
+ {
+ /* Only need to handle the last frame in the column. */
+ for (frp = frp->fr_child; frp->fr_next != NULL; frp = frp->fr_next)
+ ;
+ frame_add_statusline(frp);
+ }
+}
+
+/*
+ * Set width of a frame. Handles recursively going through contained frames.
+ * May remove separator line for windows at the right side (for win_close()).
+ */
+ static void
+frame_new_width(topfrp, width, leftfirst)
+ frame_T *topfrp;
+ int width;
+ int leftfirst; /* resize leftmost contained frame first */
+{
+ frame_T *frp;
+ int extra_cols;
+ int w;
+ win_T *wp;
+
+ if (topfrp->fr_layout == FR_LEAF)
+ {
+ /* Simple case: just one window. */
+ wp = topfrp->fr_win;
+ /* Find out if there are any windows right of this one. */
+ for (frp = topfrp; frp->fr_parent != NULL; frp = frp->fr_parent)
+ if (frp->fr_parent->fr_layout == FR_ROW && frp->fr_next != NULL)
+ break;
+ if (frp->fr_parent == NULL)
+ wp->w_vsep_width = 0;
+ win_new_width(wp, width - wp->w_vsep_width);
+ }
+ else if (topfrp->fr_layout == FR_COL)
+ {
+ /* All frames in this column get the same new width. */
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ frame_new_width(frp, width, leftfirst);
+ }
+ else /* fr_layout == FR_ROW */
+ {
+ /* Complicated case: Resize a row of frames. Resize the rightmost
+ * frame first, frames left of it when needed. */
+
+ /* Find the rightmost frame of this row */
+ frp = topfrp->fr_child;
+ if (!leftfirst)
+ while (frp->fr_next != NULL)
+ frp = frp->fr_next;
+
+ extra_cols = width - topfrp->fr_width;
+ if (extra_cols < 0)
+ {
+ /* reduce frame width, rightmost frame first */
+ while (frp != NULL)
+ {
+ w = frame_minwidth(frp, NULL);
+ if (frp->fr_width + extra_cols < w)
+ {
+ extra_cols += frp->fr_width - w;
+ frame_new_width(frp, w, leftfirst);
+ }
+ else
+ {
+ frame_new_width(frp, frp->fr_width + extra_cols, leftfirst);
+ break;
+ }
+ if (leftfirst)
+ frp = frp->fr_next;
+ else
+ frp = frp->fr_prev;
+ }
+ }
+ else if (extra_cols > 0)
+ {
+ /* increase width of rightmost frame */
+ frame_new_width(frp, frp->fr_width + extra_cols, leftfirst);
+ }
+ }
+ topfrp->fr_width = width;
+}
+
+/*
+ * Add the vertical separator to windows at the right side of "frp".
+ * Note: Does not check if there is room!
+ */
+ static void
+frame_add_vsep(frp)
+ frame_T *frp;
+{
+ win_T *wp;
+
+ if (frp->fr_layout == FR_LEAF)
+ {
+ wp = frp->fr_win;
+ if (wp->w_vsep_width == 0)
+ {
+ if (wp->w_width > 0) /* don't make it negative */
+ --wp->w_width;
+ wp->w_vsep_width = 1;
+ }
+ }
+ else if (frp->fr_layout == FR_COL)
+ {
+ /* Handle all the frames in the column. */
+ for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
+ frame_add_vsep(frp);
+ }
+ else /* frp->fr_layout == FR_ROW */
+ {
+ /* Only need to handle the last frame in the row. */
+ frp = frp->fr_child;
+ while (frp->fr_next != NULL)
+ frp = frp->fr_next;
+ frame_add_vsep(frp);
+ }
+}
+
+/*
+ * Set frame width from the window it contains.
+ */
+ static void
+frame_fix_width(wp)
+ win_T *wp;
+{
+ wp->w_frame->fr_width = wp->w_width + wp->w_vsep_width;
+}
+#endif
+
+/*
+ * Set frame height from the window it contains.
+ */
+ static void
+frame_fix_height(wp)
+ win_T *wp;
+{
+ wp->w_frame->fr_height = wp->w_height + wp->w_status_height;
+}
+
+/*
+ * Compute the minimal height for frame "topfrp".
+ * Uses the 'winminheight' option.
+ * When "next_curwin" isn't NULL, use p_wh for this window.
+ * When "next_curwin" is NOWIN, don't use at least one line for the current
+ * window.
+ */
+ static int
+frame_minheight(topfrp, next_curwin)
+ frame_T *topfrp;
+ win_T *next_curwin;
+{
+ frame_T *frp;
+ int m;
+#ifdef FEAT_VERTSPLIT
+ int n;
+#endif
+
+ if (topfrp->fr_win != NULL)
+ {
+ if (topfrp->fr_win == next_curwin)
+ m = p_wh + topfrp->fr_win->w_status_height;
+ else
+ {
+ /* window: minimal height of the window plus status line */
+ m = p_wmh + topfrp->fr_win->w_status_height;
+ /* Current window is minimal one line high */
+ if (p_wmh == 0 && topfrp->fr_win == curwin && next_curwin == NULL)
+ ++m;
+ }
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (topfrp->fr_layout == FR_ROW)
+ {
+ /* get the minimal height from each frame in this row */
+ m = 0;
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ {
+ n = frame_minheight(frp, next_curwin);
+ if (n > m)
+ m = n;
+ }
+ }
+#endif
+ else
+ {
+ /* Add up the minimal heights for all frames in this column. */
+ m = 0;
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ m += frame_minheight(frp, next_curwin);
+ }
+
+ return m;
+}
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Compute the minimal width for frame "topfrp".
+ * When "next_curwin" isn't NULL, use p_wiw for this window.
+ * When "next_curwin" is NOWIN, don't use at least one column for the current
+ * window.
+ */
+ static int
+frame_minwidth(topfrp, next_curwin)
+ frame_T *topfrp;
+ win_T *next_curwin; /* use p_wh and p_wiw for next_curwin */
+{
+ frame_T *frp;
+ int m, n;
+
+ if (topfrp->fr_win != NULL)
+ {
+ if (topfrp->fr_win == next_curwin)
+ m = p_wiw + topfrp->fr_win->w_vsep_width;
+ else
+ {
+ /* window: minimal width of the window plus separator column */
+ m = p_wmw + topfrp->fr_win->w_vsep_width;
+ /* Current window is minimal one column wide */
+ if (p_wmw == 0 && topfrp->fr_win == curwin && next_curwin == NULL)
+ ++m;
+ }
+ }
+ else if (topfrp->fr_layout == FR_COL)
+ {
+ /* get the minimal width from each frame in this column */
+ m = 0;
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ {
+ n = frame_minwidth(frp, next_curwin);
+ if (n > m)
+ m = n;
+ }
+ }
+ else
+ {
+ /* Add up the minimal widths for all frames in this row. */
+ m = 0;
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ m += frame_minwidth(frp, next_curwin);
+ }
+
+ return m;
+}
+#endif
+
+
+/*
+ * Try to close all windows except current one.
+ * Buffers in the other windows become hidden if 'hidden' is set, or '!' is
+ * used and the buffer was modified.
+ *
+ * Used by ":bdel" and ":only".
+ */
+ void
+close_others(message, forceit)
+ int message;
+ int forceit; /* always hide all other windows */
+{
+ win_T *wp;
+ win_T *nextwp;
+ int r;
+
+ if (lastwin == firstwin)
+ {
+ if (message
+#ifdef FEAT_AUTOCMD
+ && !autocmd_busy
+#endif
+ )
+ MSG(_("Already only one window"));
+ return;
+ }
+
+ /* Be very careful here: autocommands may change the window layout. */
+ for (wp = firstwin; win_valid(wp); wp = nextwp)
+ {
+ nextwp = wp->w_next;
+ if (wp != curwin) /* don't close current window */
+ {
+
+ /* Check if it's allowed to abandon this window */
+ r = can_abandon(wp->w_buffer, forceit);
+#ifdef FEAT_AUTOCMD
+ if (!win_valid(wp)) /* autocommands messed wp up */
+ {
+ nextwp = firstwin;
+ continue;
+ }
+#endif
+ if (!r)
+ {
+#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
+ if (message && (p_confirm || cmdmod.confirm) && p_write)
+ {
+ dialog_changed(wp->w_buffer, FALSE);
+# ifdef FEAT_AUTOCMD
+ if (!win_valid(wp)) /* autocommands messed wp up */
+ {
+ nextwp = firstwin;
+ continue;
+ }
+# endif
+ }
+ if (bufIsChanged(wp->w_buffer))
+#endif
+ continue;
+ }
+ win_close(wp, !P_HID(wp->w_buffer) && !bufIsChanged(wp->w_buffer));
+ }
+ }
+
+ /*
+ * If current window has a status line and we don't want one,
+ * remove the status line.
+ */
+ if (lastwin != firstwin)
+ EMSG(_("E445: Other window contains changes"));
+}
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * init the cursor in the window
+ *
+ * called when a new file is being edited
+ */
+ void
+win_init(wp)
+ win_T *wp;
+{
+ redraw_win_later(wp, NOT_VALID);
+ wp->w_lines_valid = 0;
+ wp->w_cursor.lnum = 1;
+ wp->w_curswant = wp->w_cursor.col = 0;
+#ifdef FEAT_VIRTUALEDIT
+ wp->w_cursor.coladd = 0;
+#endif
+ wp->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */
+ wp->w_pcmark.col = 0;
+ wp->w_prev_pcmark.lnum = 0;
+ wp->w_prev_pcmark.col = 0;
+ wp->w_topline = 1;
+#ifdef FEAT_DIFF
+ wp->w_topfill = 0;
+#endif
+ wp->w_botline = 2;
+#ifdef FEAT_FKMAP
+ if (curwin->w_p_rl)
+ wp->w_farsi = W_CONV + W_R_L;
+ else
+ wp->w_farsi = W_CONV;
+#endif
+}
+
+/*
+ * Allocate the first window and put an empty buffer in it.
+ * Called from main().
+ * When this fails we can't do anything: exit.
+ */
+ void
+win_alloc_first()
+{
+ curwin = win_alloc(NULL);
+ curbuf = buflist_new(NULL, NULL, 1L, BLN_LISTED);
+ if (curwin == NULL || curbuf == NULL)
+ mch_exit(0);
+ curwin->w_buffer = curbuf;
+ curbuf->b_nwindows = 1; /* there is one window */
+#ifdef FEAT_WINDOWS
+ curwin->w_alist = &global_alist;
+#endif
+ win_init(curwin); /* init current window */
+
+ topframe = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ if (topframe == NULL)
+ mch_exit(0);
+ topframe->fr_layout = FR_LEAF;
+#ifdef FEAT_VERTSPLIT
+ topframe->fr_width = Columns;
+#endif
+ topframe->fr_height = Rows - p_ch;
+ topframe->fr_win = curwin;
+ curwin->w_frame = topframe;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+
+/*
+ * Go to another window.
+ * When jumping to another buffer, stop Visual mode. Do this before
+ * changing windows so we can yank the selection into the '*' register.
+ * When jumping to another window on the same buffer, adjust its cursor
+ * position to keep the same Visual area.
+ */
+ void
+win_goto(wp)
+ win_T *wp;
+{
+#ifdef FEAT_CMDWIN
+ if (cmdwin_type != 0)
+ {
+ beep_flush();
+ return;
+ }
+#endif
+#ifdef FEAT_VISUAL
+ if (wp->w_buffer != curbuf)
+ reset_VIsual_and_resel();
+ else if (VIsual_active)
+ wp->w_cursor = curwin->w_cursor;
+#endif
+
+#ifdef FEAT_GUI
+ need_mouse_correct = TRUE;
+#endif
+ win_enter(wp, TRUE);
+}
+
+#if defined(FEAT_PERL) || defined(PROTO)
+/*
+ * Find window number "winnr" (counting top to bottom).
+ */
+ win_T *
+win_find_nr(winnr)
+ int winnr;
+{
+ win_T *wp;
+
+# ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (--winnr == 0)
+ break;
+ return wp;
+# else
+ return curwin;
+# endif
+}
+#endif
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Move to window above or below "count" times.
+ */
+ static void
+win_goto_ver(up, count)
+ int up; /* TRUE to go to win above */
+ long count;
+{
+ frame_T *fr;
+ frame_T *nfr;
+ frame_T *foundfr;
+
+ foundfr = curwin->w_frame;
+ while (count--)
+ {
+ /*
+ * First go upwards in the tree of frames until we find a upwards or
+ * downwards neighbor.
+ */
+ fr = foundfr;
+ for (;;)
+ {
+ if (fr == topframe)
+ goto end;
+ if (up)
+ nfr = fr->fr_prev;
+ else
+ nfr = fr->fr_next;
+ if (fr->fr_parent->fr_layout == FR_COL && nfr != NULL)
+ break;
+ fr = fr->fr_parent;
+ }
+
+ /*
+ * Now go downwards to find the bottom or top frame in it.
+ */
+ for (;;)
+ {
+ if (nfr->fr_layout == FR_LEAF)
+ {
+ foundfr = nfr;
+ break;
+ }
+ fr = nfr->fr_child;
+ if (nfr->fr_layout == FR_ROW)
+ {
+ /* Find the frame at the cursor row. */
+ while (fr->fr_next != NULL
+ && frame2win(fr)->w_wincol + fr->fr_width
+ <= curwin->w_wincol + curwin->w_wcol)
+ fr = fr->fr_next;
+ }
+ if (nfr->fr_layout == FR_COL && up)
+ while (fr->fr_next != NULL)
+ fr = fr->fr_next;
+ nfr = fr;
+ }
+ }
+end:
+ if (foundfr != NULL)
+ win_goto(foundfr->fr_win);
+}
+
+/*
+ * Move to left or right window.
+ */
+ static void
+win_goto_hor(left, count)
+ int left; /* TRUE to go to left win */
+ long count;
+{
+ frame_T *fr;
+ frame_T *nfr;
+ frame_T *foundfr;
+
+ foundfr = curwin->w_frame;
+ while (count--)
+ {
+ /*
+ * First go upwards in the tree of frames until we find a left or
+ * right neighbor.
+ */
+ fr = foundfr;
+ for (;;)
+ {
+ if (fr == topframe)
+ goto end;
+ if (left)
+ nfr = fr->fr_prev;
+ else
+ nfr = fr->fr_next;
+ if (fr->fr_parent->fr_layout == FR_ROW && nfr != NULL)
+ break;
+ fr = fr->fr_parent;
+ }
+
+ /*
+ * Now go downwards to find the leftmost or rightmost frame in it.
+ */
+ for (;;)
+ {
+ if (nfr->fr_layout == FR_LEAF)
+ {
+ foundfr = nfr;
+ break;
+ }
+ fr = nfr->fr_child;
+ if (nfr->fr_layout == FR_COL)
+ {
+ /* Find the frame at the cursor row. */
+ while (fr->fr_next != NULL
+ && frame2win(fr)->w_winrow + fr->fr_height
+ <= curwin->w_winrow + curwin->w_wrow)
+ fr = fr->fr_next;
+ }
+ if (nfr->fr_layout == FR_ROW && left)
+ while (fr->fr_next != NULL)
+ fr = fr->fr_next;
+ nfr = fr;
+ }
+ }
+end:
+ if (foundfr != NULL)
+ win_goto(foundfr->fr_win);
+}
+#endif
+
+/*
+ * Make window "wp" the current window.
+ */
+ void
+win_enter(wp, undo_sync)
+ win_T *wp;
+ int undo_sync;
+{
+ win_enter_ext(wp, undo_sync, FALSE);
+}
+
+/*
+ * Make window wp the current window.
+ * Can be called with "curwin_invalid" TRUE, which means that curwin has just
+ * been closed and isn't valid.
+ */
+ static void
+win_enter_ext(wp, undo_sync, curwin_invalid)
+ win_T *wp;
+ int undo_sync;
+ int curwin_invalid;
+{
+#ifdef FEAT_AUTOCMD
+ int other_buffer = FALSE;
+#endif
+
+ if (wp == curwin && !curwin_invalid) /* nothing to do */
+ return;
+
+#ifdef FEAT_AUTOCMD
+ if (!curwin_invalid)
+ {
+ /*
+ * Be careful: If autocommands delete the window, return now.
+ */
+ if (wp->w_buffer != curbuf)
+ {
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+ other_buffer = TRUE;
+ if (!win_valid(wp))
+ return;
+ }
+ apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+ if (!win_valid(wp))
+ return;
+# ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+ if (aborting())
+ return;
+# endif
+ }
+#endif
+
+ /* sync undo before leaving the current buffer */
+ if (undo_sync && curbuf != wp->w_buffer)
+ u_sync();
+ /* may have to copy the buffer options when 'cpo' contains 'S' */
+ if (wp->w_buffer != curbuf)
+ buf_copy_options(wp->w_buffer, BCO_ENTER | BCO_NOHELP);
+ if (!curwin_invalid)
+ {
+ prevwin = curwin; /* remember for CTRL-W p */
+ curwin->w_redr_status = TRUE;
+ }
+ curwin = wp;
+ curbuf = wp->w_buffer;
+ check_cursor();
+#ifdef FEAT_VIRTUALEDIT
+ if (!virtual_active())
+ curwin->w_cursor.coladd = 0;
+#endif
+ changed_line_abv_curs(); /* assume cursor position needs updating */
+
+ if (curwin->w_localdir != NULL)
+ {
+ /* Window has a local directory: Save current directory as global
+ * directory (unless that was done already) and change to the local
+ * directory. */
+ if (globaldir == NULL)
+ {
+ char_u cwd[MAXPATHL];
+
+ if (mch_dirname(cwd, MAXPATHL) == OK)
+ globaldir = vim_strsave(cwd);
+ }
+ mch_chdir((char *)curwin->w_localdir);
+ shorten_fnames(TRUE);
+ }
+ else if (globaldir != NULL)
+ {
+ /* Window doesn't have a local directory and we are not in the global
+ * directory: Change to the global directory. */
+ mch_chdir((char *)globaldir);
+ vim_free(globaldir);
+ globaldir = NULL;
+ shorten_fnames(TRUE);
+ }
+
+#ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf);
+ if (other_buffer)
+ apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+#endif
+
+#ifdef FEAT_TITLE
+ maketitle();
+#endif
+ curwin->w_redr_status = TRUE;
+ if (restart_edit)
+ redraw_later(VALID); /* causes status line redraw */
+
+ /* set window height to desired minimal value */
+ if (curwin->w_height < p_wh && !curwin->w_p_wfh)
+ win_setheight((int)p_wh);
+ else if (curwin->w_height == 0)
+ win_setheight(1);
+
+#ifdef FEAT_VERTSPLIT
+ /* set window width to desired minimal value */
+ if (curwin->w_width < p_wiw)
+ win_setwidth((int)p_wiw);
+#endif
+
+#ifdef FEAT_MOUSE
+ setmouse(); /* in case jumped to/from help buffer */
+#endif
+
+#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
+ /* Change directories when the acd option is set on and after
+ * switching windows. */
+ if (p_acd && curbuf->b_ffname != NULL
+ && vim_chdirfile(curbuf->b_ffname) == OK)
+ shorten_fnames(TRUE);
+#endif
+}
+
+#endif /* FEAT_WINDOWS */
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_SIGNS) || defined(PROTO)
+/*
+ * Jump to the first open window that contains buffer buf if one exists
+ * TODO: Alternatively jump to last open window? Dependent from 'splitbelow'?
+ * Returns pointer to window if it exists, otherwise NULL.
+ */
+ win_T *
+buf_jump_open_win(buf)
+ buf_T *buf;
+{
+# ifdef FEAT_WINDOWS
+ win_T *wp;
+
+ for (wp = firstwin; wp; wp = wp->w_next)
+ if (wp->w_buffer == buf)
+ break;
+ if (wp != NULL)
+ win_enter(wp, FALSE);
+ return wp;
+# else
+ if (curwin->w_buffer == buf)
+ return curwin;
+ return NULL;
+# endif
+}
+#endif
+
+/*
+ * allocate a window structure and link it in the window list
+ */
+/*ARGSUSED*/
+ static win_T *
+win_alloc(after)
+ win_T *after;
+{
+ win_T *newwin;
+
+ /*
+ * allocate window structure and linesizes arrays
+ */
+ newwin = (win_T *)alloc_clear((unsigned)sizeof(win_T));
+ if (newwin != NULL && win_alloc_lines(newwin) == FAIL)
+ {
+ vim_free(newwin);
+ newwin = NULL;
+ }
+
+ if (newwin != NULL)
+ {
+ /*
+ * link the window in the window list
+ */
+#ifdef FEAT_WINDOWS
+ win_append(after, newwin);
+#endif
+#ifdef FEAT_VERTSPLIT
+ newwin->w_wincol = 0;
+ newwin->w_width = Columns;
+#endif
+
+ /* position the display and the cursor at the top of the file. */
+ newwin->w_topline = 1;
+#ifdef FEAT_DIFF
+ newwin->w_topfill = 0;
+#endif
+ newwin->w_botline = 2;
+ newwin->w_cursor.lnum = 1;
+#ifdef FEAT_SCROLLBIND
+ newwin->w_scbind_pos = 1;
+#endif
+
+ /* We won't calculate w_fraction until resizing the window */
+ newwin->w_fraction = 0;
+ newwin->w_prev_fraction_row = -1;
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ out_flush();
+ gui_create_scrollbar(&newwin->w_scrollbars[SBAR_LEFT],
+ SBAR_LEFT, newwin);
+ gui_create_scrollbar(&newwin->w_scrollbars[SBAR_RIGHT],
+ SBAR_RIGHT, newwin);
+ }
+#endif
+#ifdef FEAT_EVAL
+ var_init(&newwin->w_vars); /* init internal variables */
+#endif
+#ifdef FEAT_FOLDING
+ foldInitWin(newwin);
+#endif
+ }
+ return newwin;
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+
+/*
+ * remove window 'wp' from the window list and free the structure
+ */
+ static void
+win_free(wp)
+ win_T *wp;
+{
+ int i;
+
+#ifdef FEAT_PERL
+ perl_win_free(wp);
+#endif
+
+#ifdef FEAT_PYTHON
+ python_window_free(wp);
+#endif
+
+#ifdef FEAT_TCL
+ tcl_window_free(wp);
+#endif
+
+#ifdef FEAT_RUBY
+ ruby_window_free(wp);
+#endif
+
+ clear_winopt(&wp->w_onebuf_opt);
+ clear_winopt(&wp->w_allbuf_opt);
+
+#ifdef FEAT_EVAL
+ var_clear(&wp->w_vars); /* free all internal variables */
+#endif
+
+ if (prevwin == wp)
+ prevwin = NULL;
+ win_free_lsize(wp);
+
+ for (i = 0; i < wp->w_tagstacklen; ++i)
+ vim_free(wp->w_tagstack[i].tagname);
+
+ vim_free(wp->w_localdir);
+#ifdef FEAT_SEARCH_EXTRA
+ vim_free(wp->w_match.regprog);
+#endif
+#ifdef FEAT_JUMPLIST
+ free_jumplist(wp);
+#endif
+
+#ifdef FEAT_GUI
+ if (gui.in_use)
+ {
+ out_flush();
+ gui_mch_destroy_scrollbar(&wp->w_scrollbars[SBAR_LEFT]);
+ gui_mch_destroy_scrollbar(&wp->w_scrollbars[SBAR_RIGHT]);
+ }
+#endif /* FEAT_GUI */
+
+ win_remove(wp);
+ vim_free(wp);
+}
+
+/*
+ * Append window "wp" in the window list after window "after".
+ */
+ static void
+win_append(after, wp)
+ win_T *after, *wp;
+{
+ win_T *before;
+
+ if (after == NULL) /* after NULL is in front of the first */
+ before = firstwin;
+ else
+ before = after->w_next;
+
+ wp->w_next = before;
+ wp->w_prev = after;
+ if (after == NULL)
+ firstwin = wp;
+ else
+ after->w_next = wp;
+ if (before == NULL)
+ lastwin = wp;
+ else
+ before->w_prev = wp;
+}
+
+/*
+ * Remove a window from the window list.
+ */
+ static void
+win_remove(wp)
+ win_T *wp;
+{
+ if (wp->w_prev != NULL)
+ wp->w_prev->w_next = wp->w_next;
+ else
+ firstwin = wp->w_next;
+ if (wp->w_next != NULL)
+ wp->w_next->w_prev = wp->w_prev;
+ else
+ lastwin = wp->w_prev;
+}
+
+/*
+ * Append frame "frp" in a frame list after frame "after".
+ */
+ static void
+frame_append(after, frp)
+ frame_T *after, *frp;
+{
+ frp->fr_next = after->fr_next;
+ after->fr_next = frp;
+ if (frp->fr_next != NULL)
+ frp->fr_next->fr_prev = frp;
+ frp->fr_prev = after;
+}
+
+/*
+ * Insert frame "frp" in a frame list before frame "before".
+ */
+ static void
+frame_insert(before, frp)
+ frame_T *before, *frp;
+{
+ frp->fr_next = before;
+ frp->fr_prev = before->fr_prev;
+ before->fr_prev = frp;
+ if (frp->fr_prev != NULL)
+ frp->fr_prev->fr_next = frp;
+ else
+ frp->fr_parent->fr_child = frp;
+}
+
+/*
+ * Remove a frame from a frame list.
+ */
+ static void
+frame_remove(frp)
+ frame_T *frp;
+{
+ if (frp->fr_prev != NULL)
+ frp->fr_prev->fr_next = frp->fr_next;
+ else
+ frp->fr_parent->fr_child = frp->fr_next;
+ if (frp->fr_next != NULL)
+ frp->fr_next->fr_prev = frp->fr_prev;
+}
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * Allocate w_lines[] for window "wp".
+ * Return FAIL for failure, OK for success.
+ */
+ int
+win_alloc_lines(wp)
+ win_T *wp;
+{
+ wp->w_lines_valid = 0;
+ wp->w_lines = (wline_T *)alloc((unsigned)(Rows * sizeof(wline_T)));
+ if (wp->w_lines == NULL)
+ return FAIL;
+ return OK;
+}
+
+/*
+ * free lsize arrays for a window
+ */
+ void
+win_free_lsize(wp)
+ win_T *wp;
+{
+ vim_free(wp->w_lines);
+ wp->w_lines = NULL;
+}
+
+/*
+ * Called from win_new_shellsize() after Rows changed.
+ */
+ void
+shell_new_rows()
+{
+ int h = (int)(Rows - p_ch);
+
+ if (firstwin == NULL) /* not initialized yet */
+ return;
+#ifdef FEAT_WINDOWS
+ if (h < frame_minheight(topframe, NULL))
+ h = frame_minheight(topframe, NULL);
+ /* First try setting the heights of windows without 'winfixheight'. If
+ * that doesn't result in the right height, forget about that option. */
+ frame_new_height(topframe, h, FALSE, TRUE);
+ if (topframe->fr_height != h)
+ frame_new_height(topframe, h, FALSE, FALSE);
+
+ (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
+#else
+ if (h < 1)
+ h = 1;
+ win_new_height(firstwin, h);
+#endif
+ compute_cmdrow();
+#if 0
+ /* Disabled: don't want making the screen smaller make a window larger. */
+ if (p_ea)
+ win_equal(curwin, FALSE, 'v');
+#endif
+}
+
+#if defined(FEAT_VERTSPLIT) || defined(PROTO)
+/*
+ * Called from win_new_shellsize() after Columns changed.
+ */
+ void
+shell_new_columns()
+{
+ if (firstwin == NULL) /* not initialized yet */
+ return;
+ frame_new_width(topframe, (int)Columns, FALSE);
+ (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
+#if 0
+ /* Disabled: don't want making the screen smaller make a window larger. */
+ if (p_ea)
+ win_equal(curwin, FALSE, 'h');
+#endif
+}
+#endif
+
+#if defined(FEAT_CMDWIN) || defined(PROTO)
+/*
+ * Save the size of all windows in "gap".
+ */
+ void
+win_size_save(gap)
+ garray_T *gap;
+
+{
+ win_T *wp;
+
+ ga_init2(gap, (int)sizeof(int), 1);
+ if (ga_grow(gap, win_count() * 2) == OK)
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ ((int *)gap->ga_data)[gap->ga_len++] =
+ wp->w_width + wp->w_vsep_width;
+ ((int *)gap->ga_data)[gap->ga_len++] = wp->w_height;
+ }
+}
+
+/*
+ * Restore window sizes, but only if the number of windows is still the same.
+ * Does not free the growarray.
+ */
+ void
+win_size_restore(gap)
+ garray_T *gap;
+{
+ win_T *wp;
+ int i;
+
+ if (win_count() * 2 == gap->ga_len)
+ {
+ i = 0;
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ {
+ frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]);
+ win_setheight_win(((int *)gap->ga_data)[i++], wp);
+ }
+ /* recompute the window positions */
+ (void)win_comp_pos();
+ }
+}
+#endif /* FEAT_CMDWIN */
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Update the position for all windows, using the width and height of the
+ * frames.
+ * Returns the row just after the last window.
+ */
+ static int
+win_comp_pos()
+{
+ int row = 0;
+ int col = 0;
+
+ frame_comp_pos(topframe, &row, &col);
+ return row;
+}
+
+/*
+ * Update the position of the windows in frame "topfrp", using the width and
+ * height of the frames.
+ * "*row" and "*col" are the top-left position of the frame. They are updated
+ * to the bottom-right position plus one.
+ */
+ static void
+frame_comp_pos(topfrp, row, col)
+ frame_T *topfrp;
+ int *row;
+ int *col;
+{
+ win_T *wp;
+ frame_T *frp;
+#ifdef FEAT_VERTSPLIT
+ int startcol;
+ int startrow;
+#endif
+
+ wp = topfrp->fr_win;
+ if (wp != NULL)
+ {
+ if (wp->w_winrow != *row
+#ifdef FEAT_VERTSPLIT
+ || wp->w_wincol != *col
+#endif
+ )
+ {
+ /* position changed, redraw */
+ wp->w_winrow = *row;
+#ifdef FEAT_VERTSPLIT
+ wp->w_wincol = *col;
+#endif
+ redraw_win_later(wp, NOT_VALID);
+ wp->w_redr_status = TRUE;
+ }
+ *row += wp->w_height + wp->w_status_height;
+#ifdef FEAT_VERTSPLIT
+ *col += wp->w_width + wp->w_vsep_width;
+#endif
+ }
+ else
+ {
+#ifdef FEAT_VERTSPLIT
+ startrow = *row;
+ startcol = *col;
+#endif
+ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
+ {
+#ifdef FEAT_VERTSPLIT
+ if (topfrp->fr_layout == FR_ROW)
+ *row = startrow; /* all frames are at the same row */
+ else
+ *col = startcol; /* all frames are at the same col */
+#endif
+ frame_comp_pos(frp, row, col);
+ }
+ }
+}
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * Set current window height and take care of repositioning other windows to
+ * fit around it.
+ */
+ void
+win_setheight(height)
+ int height;
+{
+ win_setheight_win(height, curwin);
+}
+
+/*
+ * Set the window height of window "win" and take care of repositioning other
+ * windows to fit around it.
+ */
+ void
+win_setheight_win(height, win)
+ int height;
+ win_T *win;
+{
+ int row;
+
+ if (win == curwin)
+ {
+ /* Always keep current window at least one line high, even when
+ * 'winminheight' is zero. */
+#ifdef FEAT_WINDOWS
+ if (height < p_wmh)
+ height = p_wmh;
+#endif
+ if (height == 0)
+ height = 1;
+ }
+
+#ifdef FEAT_WINDOWS
+ frame_setheight(win->w_frame, height + win->w_status_height);
+
+ /* recompute the window positions */
+ row = win_comp_pos();
+#else
+ if (height > topframe->fr_height)
+ height = topframe->fr_height;
+ win->w_height = height;
+ row = height;
+#endif
+
+ /*
+ * If there is extra space created between the last window and the command
+ * line, clear it.
+ */
+ if (full_screen && msg_scrolled == 0 && row < cmdline_row)
+ screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0);
+ cmdline_row = row;
+ msg_row = row;
+ msg_col = 0;
+
+ redraw_all_later(NOT_VALID);
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+
+/*
+ * Set the height of a frame to "height" and take care that all frames and
+ * windows inside it are resized. Also resize frames on the left and right if
+ * the are in the same FR_ROW frame.
+ *
+ * Strategy:
+ * If the frame is part of a FR_COL frame, try fitting the frame in that
+ * frame. If that doesn't work (the FR_COL frame is too small), recursively
+ * go to containing frames to resize them and make room.
+ * If the frame is part of a FR_ROW frame, all frames must be resized as well.
+ * Check for the minimal height of the FR_ROW frame.
+ * At the top level we can also use change the command line height.
+ */
+ static void
+frame_setheight(curfrp, height)
+ frame_T *curfrp;
+ int height;
+{
+ int room; /* total number of lines available */
+ int take; /* number of lines taken from other windows */
+ int room_cmdline; /* lines available from cmdline */
+ int run;
+ frame_T *frp;
+ int h;
+ int room_reserved;
+
+ /* If the height already is the desired value, nothing to do. */
+ if (curfrp->fr_height == height)
+ return;
+
+ if (curfrp->fr_parent == NULL)
+ {
+ /* topframe: can only change the command line */
+ if (height > Rows - p_ch)
+ height = Rows - p_ch;
+ if (height > 0)
+ frame_new_height(curfrp, height, FALSE, FALSE);
+ }
+ else if (curfrp->fr_parent->fr_layout == FR_ROW)
+ {
+ /* Row of frames: Also need to resize frames left and right of this
+ * one. First check for the minimal height of these. */
+ h = frame_minheight(curfrp->fr_parent, NULL);
+ if (height < h)
+ height = h;
+ frame_setheight(curfrp->fr_parent, height);
+ }
+ else
+ {
+ /*
+ * Column of frames: try to change only frames in this column.
+ */
+#ifdef FEAT_VERTSPLIT
+ /*
+ * Do this twice:
+ * 1: compute room available, if it's not enough try resizing the
+ * containing frame.
+ * 2: compute the room available and adjust the height to it.
+ * Try not to reduce the height of a window with 'winfixheight' set.
+ */
+ for (run = 1; run <= 2; ++run)
+#else
+ for (;;)
+#endif
+ {
+ room = 0;
+ room_reserved = 0;
+ for (frp = curfrp->fr_parent->fr_child; frp != NULL;
+ frp = frp->fr_next)
+ {
+ if (frp != curfrp
+ && frp->fr_win != NULL
+ && frp->fr_win->w_p_wfh)
+ room_reserved += frp->fr_height;
+ room += frp->fr_height;
+ if (frp != curfrp)
+ room -= frame_minheight(frp, NULL);
+ }
+#ifdef FEAT_VERTSPLIT
+ if (curfrp->fr_width != Columns)
+ room_cmdline = 0;
+ else
+#endif
+ {
+ room_cmdline = Rows - p_ch - (lastwin->w_winrow
+ + lastwin->w_height + lastwin->w_status_height);
+ if (room_cmdline < 0)
+ room_cmdline = 0;
+ }
+
+ if (height <= room + room_cmdline)
+ break;
+#ifdef FEAT_VERTSPLIT
+ if (run == 2 || curfrp->fr_width == Columns)
+#endif
+ {
+ if (height > room + room_cmdline)
+ height = room + room_cmdline;
+ break;
+ }
+#ifdef FEAT_VERTSPLIT
+ frame_setheight(curfrp->fr_parent, height
+ + frame_minheight(curfrp->fr_parent, NOWIN) - (int)p_wmh - 1);
+#endif
+ /*NOTREACHED*/
+ }
+
+ /*
+ * Compute the number of lines we will take from others frames (can be
+ * negative!).
+ */
+ take = height - curfrp->fr_height;
+
+ /* If there is not enough room, also reduce the height of a window
+ * with 'winfixheight' set. */
+ if (height > room + room_cmdline - room_reserved)
+ room_reserved = room + room_cmdline - height;
+ /* If there is only a 'winfixheight' window and making the
+ * window smaller, need to make the other window taller. */
+ if (take < 0 && room - curfrp->fr_height < room_reserved)
+ room_reserved = 0;
+
+ if (take > 0 && room_cmdline > 0)
+ {
+ /* use lines from cmdline first */
+ if (take < room_cmdline)
+ room_cmdline = take;
+ take -= room_cmdline;
+ topframe->fr_height += room_cmdline;
+ }
+
+ /*
+ * set the current frame to the new height
+ */
+ frame_new_height(curfrp, height, FALSE, FALSE);
+
+ /*
+ * First take lines from the frames after the current frame. If
+ * that is not enough, takes lines from frames above the current
+ * frame.
+ */
+ for (run = 0; run < 2; ++run)
+ {
+ if (run == 0)
+ frp = curfrp->fr_next; /* 1st run: start with next window */
+ else
+ frp = curfrp->fr_prev; /* 2nd run: start with prev window */
+ while (frp != NULL && take != 0)
+ {
+ h = frame_minheight(frp, NULL);
+ if (room_reserved > 0
+ && frp->fr_win != NULL
+ && frp->fr_win->w_p_wfh)
+ {
+ if (room_reserved >= frp->fr_height)
+ room_reserved -= frp->fr_height;
+ else
+ {
+ if (frp->fr_height - room_reserved > take)
+ room_reserved = frp->fr_height - take;
+ take -= frp->fr_height - room_reserved;
+ frame_new_height(frp, room_reserved, FALSE, FALSE);
+ room_reserved = 0;
+ }
+ }
+ else
+ {
+ if (frp->fr_height - take < h)
+ {
+ take -= frp->fr_height - h;
+ frame_new_height(frp, h, FALSE, FALSE);
+ }
+ else
+ {
+ frame_new_height(frp, frp->fr_height - take,
+ FALSE, FALSE);
+ take = 0;
+ }
+ }
+ if (run == 0)
+ frp = frp->fr_next;
+ else
+ frp = frp->fr_prev;
+ }
+ }
+ }
+}
+
+#if defined(FEAT_VERTSPLIT) || defined(PROTO)
+/*
+ * Set current window width and take care of repositioning other windows to
+ * fit around it.
+ */
+ void
+win_setwidth(width)
+ int width;
+{
+ win_setwidth_win(width, curwin);
+}
+
+ void
+win_setwidth_win(width, wp)
+ int width;
+ win_T *wp;
+{
+ /* Always keep current window at least one column wide, even when
+ * 'winminwidth' is zero. */
+ if (wp == curwin)
+ {
+ if (width < p_wmw)
+ width = p_wmw;
+ if (width == 0)
+ width = 1;
+ }
+
+ frame_setwidth(wp->w_frame, width + wp->w_vsep_width);
+
+ /* recompute the window positions */
+ (void)win_comp_pos();
+
+ redraw_all_later(NOT_VALID);
+}
+
+/*
+ * Set the width of a frame to "width" and take care that all frames and
+ * windows inside it are resized. Also resize frames above and below if the
+ * are in the same FR_ROW frame.
+ *
+ * Strategy is similar to frame_setheight().
+ */
+ static void
+frame_setwidth(curfrp, width)
+ frame_T *curfrp;
+ int width;
+{
+ int room; /* total number of lines available */
+ int take; /* number of lines taken from other windows */
+ int run;
+ frame_T *frp;
+ int w;
+
+ /* If the width already is the desired value, nothing to do. */
+ if (curfrp->fr_width == width)
+ return;
+
+ if (curfrp->fr_parent == NULL)
+ /* topframe: can't change width */
+ return;
+
+ if (curfrp->fr_parent->fr_layout == FR_COL)
+ {
+ /* Column of frames: Also need to resize frames above and below of
+ * this one. First check for the minimal width of these. */
+ w = frame_minwidth(curfrp->fr_parent, NULL);
+ if (width < w)
+ width = w;
+ frame_setwidth(curfrp->fr_parent, width);
+ }
+ else
+ {
+ /*
+ * Row of frames: try to change only frames in this row.
+ *
+ * Do this twice:
+ * 1: compute room available, if it's not enough try resizing the
+ * containing frame.
+ * 2: compute the room available and adjust the width to it.
+ */
+ for (run = 1; run <= 2; ++run)
+ {
+ room = 0;
+ for (frp = curfrp->fr_parent->fr_child; frp != NULL;
+ frp = frp->fr_next)
+ {
+ room += frp->fr_width;
+ if (frp != curfrp)
+ room -= frame_minwidth(frp, NULL);
+ }
+
+ if (width <= room)
+ break;
+ if (run == 2 || curfrp->fr_height >= Rows - p_ch)
+ {
+ if (width > room)
+ width = room;
+ break;
+ }
+ frame_setwidth(curfrp->fr_parent, width
+ + frame_minwidth(curfrp->fr_parent, NOWIN) - (int)p_wmw - 1);
+ }
+
+
+ /*
+ * Compute the number of lines we will take from others frames (can be
+ * negative!).
+ */
+ take = width - curfrp->fr_width;
+
+ /*
+ * set the current frame to the new width
+ */
+ frame_new_width(curfrp, width, FALSE);
+
+ /*
+ * First take lines from the frames right of the current frame. If
+ * that is not enough, takes lines from frames left of the current
+ * frame.
+ */
+ for (run = 0; run < 2; ++run)
+ {
+ if (run == 0)
+ frp = curfrp->fr_next; /* 1st run: start with next window */
+ else
+ frp = curfrp->fr_prev; /* 2nd run: start with prev window */
+ while (frp != NULL && take != 0)
+ {
+ w = frame_minwidth(frp, NULL);
+ if (frp->fr_width - take < w)
+ {
+ take -= frp->fr_width - w;
+ frame_new_width(frp, w, FALSE);
+ }
+ else
+ {
+ frame_new_width(frp, frp->fr_width - take, FALSE);
+ take = 0;
+ }
+ if (run == 0)
+ frp = frp->fr_next;
+ else
+ frp = frp->fr_prev;
+ }
+ }
+ }
+}
+#endif /* FEAT_VERTSPLIT */
+
+/*
+ * Check 'winminheight' for a valid value.
+ */
+ void
+win_setminheight()
+{
+ int room;
+ int first = TRUE;
+ win_T *wp;
+
+ /* loop until there is a 'winminheight' that is possible */
+ while (p_wmh > 0)
+ {
+ /* TODO: handle vertical splits */
+ room = -p_wh;
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ room += wp->w_height - p_wmh;
+ if (room >= 0)
+ break;
+ --p_wmh;
+ if (first)
+ {
+ EMSG(_(e_noroom));
+ first = FALSE;
+ }
+ }
+}
+
+#ifdef FEAT_MOUSE
+
+/*
+ * Status line of dragwin is dragged "offset" lines down (negative is up).
+ */
+ void
+win_drag_status_line(dragwin, offset)
+ win_T *dragwin;
+ int offset;
+{
+ frame_T *curfr;
+ frame_T *fr;
+ int room;
+ int row;
+ int up; /* if TRUE, drag status line up, otherwise down */
+ int n;
+
+ fr = dragwin->w_frame;
+ curfr = fr;
+ if (fr != topframe) /* more than one window */
+ {
+ fr = fr->fr_parent;
+ /* When the parent frame is not a column of frames, its parent should
+ * be. */
+ if (fr->fr_layout != FR_COL)
+ {
+ curfr = fr;
+ if (fr != topframe) /* only a row of windows, may drag statusline */
+ fr = fr->fr_parent;
+ }
+ }
+
+ /* If this is the last frame in a column, may want to resize the parent
+ * frame instead (go two up to skip a row of frames). */
+ while (curfr != topframe && curfr->fr_next == NULL)
+ {
+ if (fr != topframe)
+ fr = fr->fr_parent;
+ curfr = fr;
+ if (fr != topframe)
+ fr = fr->fr_parent;
+ }
+
+ if (offset < 0) /* drag up */
+ {
+ up = TRUE;
+ offset = -offset;
+ /* sum up the room of the current frame and above it */
+ if (fr == curfr)
+ {
+ /* only one window */
+ room = fr->fr_height - frame_minheight(fr, NULL);
+ }
+ else
+ {
+ room = 0;
+ for (fr = fr->fr_child; ; fr = fr->fr_next)
+ {
+ room += fr->fr_height - frame_minheight(fr, NULL);
+ if (fr == curfr)
+ break;
+ }
+ }
+ fr = curfr->fr_next; /* put fr at frame that grows */
+ }
+ else /* drag down */
+ {
+ up = FALSE;
+ /*
+ * Only dragging the last status line can reduce p_ch.
+ */
+ room = Rows - cmdline_row;
+ if (curfr->fr_next == NULL)
+ room -= 1;
+ else
+ room -= p_ch;
+ if (room < 0)
+ room = 0;
+ /* sum up the room of frames below of the current one */
+ for (fr = curfr->fr_next; fr != NULL; fr = fr->fr_next)
+ room += fr->fr_height - frame_minheight(fr, NULL);
+ fr = curfr; /* put fr at window that grows */
+ }
+
+ if (room < offset) /* Not enough room */
+ offset = room; /* Move as far as we can */
+ if (offset <= 0)
+ return;
+
+ /*
+ * Grow frame fr by "offset" lines.
+ * Doesn't happen when dragging the last status line up.
+ */
+ if (fr != NULL)
+ frame_new_height(fr, fr->fr_height + offset, up, FALSE);
+
+ if (up)
+ fr = curfr; /* current frame gets smaller */
+ else
+ fr = curfr->fr_next; /* next frame gets smaller */
+
+ /*
+ * Now make the other frames smaller.
+ */
+ while (fr != NULL && offset > 0)
+ {
+ n = frame_minheight(fr, NULL);
+ if (fr->fr_height - offset <= n)
+ {
+ offset -= fr->fr_height - n;
+ frame_new_height(fr, n, !up, FALSE);
+ }
+ else
+ {
+ frame_new_height(fr, fr->fr_height - offset, !up, FALSE);
+ break;
+ }
+ if (up)
+ fr = fr->fr_prev;
+ else
+ fr = fr->fr_next;
+ }
+ row = win_comp_pos();
+ screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0);
+ cmdline_row = row;
+ p_ch = Rows - cmdline_row;
+ if (p_ch < 1)
+ p_ch = 1;
+ redraw_all_later(NOT_VALID);
+ showmode();
+}
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Separator line of dragwin is dragged "offset" lines right (negative is left).
+ */
+ void
+win_drag_vsep_line(dragwin, offset)
+ win_T *dragwin;
+ int offset;
+{
+ frame_T *curfr;
+ frame_T *fr;
+ int room;
+ int left; /* if TRUE, drag separator line left, otherwise right */
+ int n;
+
+ fr = dragwin->w_frame;
+ if (fr == topframe) /* only one window (cannot happe?) */
+ return;
+ curfr = fr;
+ fr = fr->fr_parent;
+ /* When the parent frame is not a row of frames, its parent should be. */
+ if (fr->fr_layout != FR_ROW)
+ {
+ if (fr == topframe) /* only a column of windows (cannot happen?) */
+ return;
+ curfr = fr;
+ fr = fr->fr_parent;
+ }
+
+ /* If this is the last frame in a row, may want to resize a parent
+ * frame instead. */
+ while (curfr->fr_next == NULL)
+ {
+ if (fr == topframe)
+ break;
+ curfr = fr;
+ fr = fr->fr_parent;
+ if (fr != topframe)
+ {
+ curfr = fr;
+ fr = fr->fr_parent;
+ }
+ }
+
+ if (offset < 0) /* drag left */
+ {
+ left = TRUE;
+ offset = -offset;
+ /* sum up the room of the current frame and left of it */
+ room = 0;
+ for (fr = fr->fr_child; ; fr = fr->fr_next)
+ {
+ room += fr->fr_width - frame_minwidth(fr, NULL);
+ if (fr == curfr)
+ break;
+ }
+ fr = curfr->fr_next; /* put fr at frame that grows */
+ }
+ else /* drag right */
+ {
+ left = FALSE;
+ /* sum up the room of frames right of the current one */
+ room = 0;
+ for (fr = curfr->fr_next; fr != NULL; fr = fr->fr_next)
+ room += fr->fr_width - frame_minwidth(fr, NULL);
+ fr = curfr; /* put fr at window that grows */
+ }
+
+ if (room < offset) /* Not enough room */
+ offset = room; /* Move as far as we can */
+ if (offset <= 0) /* No room at all, quit. */
+ return;
+
+ /* grow frame fr by offset lines */
+ frame_new_width(fr, fr->fr_width + offset, left);
+
+ /* shrink other frames: current and at the left or at the right */
+ if (left)
+ fr = curfr; /* current frame gets smaller */
+ else
+ fr = curfr->fr_next; /* next frame gets smaller */
+
+ while (fr != NULL && offset > 0)
+ {
+ n = frame_minwidth(fr, NULL);
+ if (fr->fr_width - offset <= n)
+ {
+ offset -= fr->fr_width - n;
+ frame_new_width(fr, n, !left);
+ }
+ else
+ {
+ frame_new_width(fr, fr->fr_width - offset, !left);
+ break;
+ }
+ if (left)
+ fr = fr->fr_prev;
+ else
+ fr = fr->fr_next;
+ }
+ (void)win_comp_pos();
+ redraw_all_later(NOT_VALID);
+}
+#endif /* FEAT_VERTSPLIT */
+#endif /* FEAT_MOUSE */
+
+#endif /* FEAT_WINDOWS */
+
+/*
+ * Set the height of a window.
+ * This takes care of the things inside the window, not what happens to the
+ * window position, the frame or to other windows.
+ */
+ static void
+win_new_height(wp, height)
+ win_T *wp;
+ int height;
+{
+ linenr_T lnum;
+ int sline, line_size;
+#define FRACTION_MULT 16384L
+
+ /* Don't want a negative height. Happens when splitting a tiny window.
+ * Will equalize heights soon to fix it. */
+ if (height < 0)
+ height = 0;
+
+ if (wp->w_wrow != wp->w_prev_fraction_row && wp->w_height > 0)
+ wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
+ + FRACTION_MULT / 2) / (long)wp->w_height;
+
+ wp->w_height = height;
+ wp->w_skipcol = 0;
+
+ /* Don't change w_topline when height is zero. Don't set w_topline when
+ * 'scrollbind' is set and this isn't the current window. */
+ if (height > 0
+#ifdef FEAT_SCROLLBIND
+ && (!wp->w_p_scb || wp == curwin)
+#endif
+ )
+ {
+ lnum = wp->w_cursor.lnum;
+ if (lnum < 1) /* can happen when starting up */
+ lnum = 1;
+ wp->w_wrow = ((long)wp->w_fraction * (long)height - 1L) / FRACTION_MULT;
+ line_size = plines_win_col(wp, lnum, (long)(wp->w_cursor.col)) - 1;
+ sline = wp->w_wrow - line_size;
+ if (sline < 0)
+ {
+ /*
+ * Cursor line would go off top of screen if w_wrow was this high.
+ */
+ wp->w_wrow = line_size;
+ }
+ else
+ {
+ while (sline > 0 && lnum > 1)
+ {
+#ifdef FEAT_FOLDING
+ hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
+ if (lnum == 1)
+ {
+ /* first line in buffer is folded */
+ line_size = 1;
+ --sline;
+ break;
+ }
+#endif
+ --lnum;
+#ifdef FEAT_DIFF
+ if (lnum == wp->w_topline)
+ line_size = plines_win_nofill(wp, lnum, TRUE)
+ + wp->w_topfill;
+ else
+#endif
+ line_size = plines_win(wp, lnum, TRUE);
+ sline -= line_size;
+ }
+ if (sline < 0)
+ {
+ /*
+ * Line we want at top would go off top of screen. Use next
+ * line instead.
+ */
+#ifdef FEAT_FOLDING
+ hasFoldingWin(wp, lnum, NULL, &lnum, TRUE, NULL);
+#endif
+ lnum++;
+ wp->w_wrow -= line_size + sline;
+ }
+ else if (sline > 0)
+ {
+ /* First line of file reached, use that as topline. */
+ lnum = 1;
+ wp->w_wrow -= sline;
+ }
+ }
+ set_topline(wp, lnum);
+ }
+
+ if (wp == curwin)
+ {
+ if (p_so)
+ update_topline();
+ curs_columns(FALSE); /* validate w_wrow */
+ }
+ wp->w_prev_fraction_row = wp->w_wrow;
+
+ win_comp_scroll(wp);
+ redraw_win_later(wp, NOT_VALID);
+#ifdef FEAT_WINDOWS
+ wp->w_redr_status = TRUE;
+#endif
+ invalidate_botline_win(wp);
+}
+
+#ifdef FEAT_VERTSPLIT
+/*
+ * Set the width of a window.
+ */
+ static void
+win_new_width(wp, width)
+ win_T *wp;
+ int width;
+{
+ wp->w_width = width;
+ wp->w_lines_valid = 0;
+ changed_line_abv_curs_win(wp);
+ invalidate_botline_win(wp);
+ if (wp == curwin)
+ {
+ update_topline();
+ curs_columns(TRUE); /* validate w_wrow */
+ }
+ redraw_win_later(wp, NOT_VALID);
+ wp->w_redr_status = TRUE;
+}
+#endif
+
+ void
+win_comp_scroll(wp)
+ win_T *wp;
+{
+ wp->w_p_scr = ((unsigned)wp->w_height >> 1);
+ if (wp->w_p_scr == 0)
+ wp->w_p_scr = 1;
+}
+
+/*
+ * command_height: called whenever p_ch has been changed
+ */
+ void
+command_height(old_p_ch)
+ long old_p_ch;
+{
+#ifdef FEAT_WINDOWS
+ int h;
+ frame_T *frp;
+
+ /* Find bottom frame with width of screen. */
+ frp = lastwin->w_frame;
+# ifdef FEAT_VERTSPLIT
+ while (frp->fr_width != Columns && frp->fr_parent != NULL)
+ frp = frp->fr_parent;
+# endif
+
+ /* Avoid changing the height of a window with 'winfixheight' set. */
+ while (frp->fr_prev != NULL && frp->fr_layout == FR_LEAF
+ && frp->fr_win->w_p_wfh)
+ frp = frp->fr_prev;
+
+ if (starting != NO_SCREEN)
+ {
+ cmdline_row = Rows - p_ch;
+
+ if (p_ch > old_p_ch) /* p_ch got bigger */
+ {
+ while (p_ch > old_p_ch)
+ {
+ if (frp == NULL)
+ {
+ EMSG(_(e_noroom));
+ p_ch = old_p_ch;
+ cmdline_row = Rows - p_ch;
+ break;
+ }
+ h = frp->fr_height - frame_minheight(frp, NULL);
+ if (h > p_ch - old_p_ch)
+ h = p_ch - old_p_ch;
+ old_p_ch += h;
+ frame_add_height(frp, -h);
+ frp = frp->fr_prev;
+ }
+
+ /* Recompute window positions. */
+ (void)win_comp_pos();
+
+ /* clear the lines added to cmdline */
+ if (full_screen)
+ screen_fill((int)(cmdline_row), (int)Rows, 0,
+ (int)Columns, ' ', ' ', 0);
+ msg_row = cmdline_row;
+ redraw_cmdline = TRUE;
+ return;
+ }
+
+ if (msg_row < cmdline_row)
+ msg_row = cmdline_row;
+ redraw_cmdline = TRUE;
+ }
+ frame_add_height(frp, (int)(old_p_ch - p_ch));
+
+ /* Recompute window positions. */
+ if (frp != lastwin->w_frame)
+ (void)win_comp_pos();
+#else
+ win_setheight((int)(firstwin->w_height + old_p_ch - p_ch));
+ cmdline_row = Rows - p_ch;
+#endif
+}
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+/*
+ * Resize frame "frp" to be "n" lines higher (negative for less high).
+ * Also resize the frames it is contained in.
+ */
+ static void
+frame_add_height(frp, n)
+ frame_T *frp;
+ int n;
+{
+ frame_new_height(frp, frp->fr_height + n, FALSE, FALSE);
+ for (;;)
+ {
+ frp = frp->fr_parent;
+ if (frp == NULL)
+ break;
+ frp->fr_height += n;
+ }
+}
+
+/*
+ * Add or remove a status line for the bottom window(s), according to the
+ * value of 'laststatus'.
+ */
+ void
+last_status(morewin)
+ int morewin; /* pretend there are two or more windows */
+{
+ /* Don't make a difference between horizontal or vertical split. */
+ last_status_rec(topframe, (p_ls == 2
+ || (p_ls == 1 && (morewin || lastwin != firstwin))));
+}
+
+ static void
+last_status_rec(fr, statusline)
+ frame_T *fr;
+ int statusline;
+{
+ frame_T *fp;
+ win_T *wp;
+
+ if (fr->fr_layout == FR_LEAF)
+ {
+ wp = fr->fr_win;
+ if (wp->w_status_height != 0 && !statusline)
+ {
+ /* remove status line */
+ win_new_height(wp, wp->w_height + 1);
+ wp->w_status_height = 0;
+ comp_col();
+ }
+ else if (wp->w_status_height == 0 && statusline)
+ {
+ /* Find a frame to take a line from. */
+ fp = fr;
+ while (fp->fr_height <= frame_minheight(fp, NULL))
+ {
+ if (fp == topframe)
+ {
+ EMSG(_(e_noroom));
+ return;
+ }
+ /* In a column of frames: go to frame above. If already at
+ * the top or in a row of frames: go to parent. */
+ if (fp->fr_parent->fr_layout == FR_COL && fp->fr_prev != NULL)
+ fp = fp->fr_prev;
+ else
+ fp = fp->fr_parent;
+ }
+ wp->w_status_height = 1;
+ if (fp != fr)
+ {
+ frame_new_height(fp, fp->fr_height - 1, FALSE, FALSE);
+ frame_fix_height(wp);
+ (void)win_comp_pos();
+ }
+ else
+ win_new_height(wp, wp->w_height - 1);
+ comp_col();
+ redraw_all_later(NOT_VALID);
+ }
+ }
+#ifdef FEAT_VERTSPLIT
+ else if (fr->fr_layout == FR_ROW)
+ {
+ /* vertically split windows, set status line for each one */
+ for (fp = fr->fr_child; fp != NULL; fp = fp->fr_next)
+ last_status_rec(fp, statusline);
+ }
+#endif
+ else
+ {
+ /* horizontally split window, set status line for last one */
+ for (fp = fr->fr_child; fp->fr_next != NULL; fp = fp->fr_next)
+ ;
+ last_status_rec(fp, statusline);
+ }
+}
+
+#endif /* FEAT_WINDOWS */
+
+#if defined(FEAT_SEARCHPATH) || defined(PROTO)
+/*
+ * Return the file name under or after the cursor.
+ *
+ * The 'path' option is searched if the file name is not absolute.
+ * The string returned has been alloc'ed and should be freed by the caller.
+ * NULL is returned if the file name or file is not found.
+ *
+ * options:
+ * FNAME_MESS give error messages
+ * FNAME_EXP expand to path
+ * FNAME_HYP check for hypertext link
+ * FNAME_INCL apply "includeexpr"
+ */
+ char_u *
+file_name_at_cursor(options, count)
+ int options;
+ long count;
+{
+ return file_name_in_line(ml_get_curline(),
+ curwin->w_cursor.col, options, count, curbuf->b_ffname);
+}
+
+/*
+ * Return the name of the file under or after ptr[col].
+ * Otherwise like file_name_at_cursor().
+ */
+ char_u *
+file_name_in_line(line, col, options, count, rel_fname)
+ char_u *line;
+ int col;
+ int options;
+ long count;
+ char_u *rel_fname; /* file we are searching relative to */
+{
+ char_u *ptr;
+ int len;
+
+ /*
+ * search forward for what could be the start of a file name
+ */
+ ptr = line + col;
+ while (*ptr != NUL && !vim_isfilec(*ptr))
+ ++ptr;
+ if (*ptr == NUL) /* nothing found */
+ {
+ if (options & FNAME_MESS)
+ EMSG(_("E446: No file name under cursor"));
+ return NULL;
+ }
+
+ /*
+ * Search backward for first char of the file name.
+ * Go one char back to ":" before "//" even when ':' is not in 'isfname'.
+ */
+ while (ptr > line)
+ {
+#ifdef FEAT_MBYTE
+ if (has_mbyte && (len = (*mb_head_off)(line, ptr - 1)) > 0)
+ ptr -= len + 1;
+ else
+#endif
+ if (vim_isfilec(ptr[-1])
+ || ((options & FNAME_HYP) && path_is_url(ptr - 1)))
+ --ptr;
+ else
+ break;
+ }
+
+ /*
+ * Search forward for the last char of the file name.
+ * Also allow "://" when ':' is not in 'isfname'.
+ */
+ len = 0;
+ while (vim_isfilec(ptr[len])
+ || ((options & FNAME_HYP) && path_is_url(ptr + len)))
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ len += (*mb_ptr2len_check)(ptr + len);
+ else
+#endif
+ ++len;
+
+ /*
+ * If there is trailing punctuation, remove it.
+ * But don't remove "..", could be a directory name.
+ */
+ if (len > 2 && vim_strchr((char_u *)".,:;!", ptr[len - 1]) != NULL
+ && ptr[len - 2] != '.')
+ --len;
+
+ return find_file_name_in_path(ptr, len, options, count, rel_fname);
+}
+
+# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+static char_u *eval_includeexpr __ARGS((char_u *ptr, int len));
+
+ static char_u *
+eval_includeexpr(ptr, len)
+ char_u *ptr;
+ int len;
+{
+ char_u *res;
+
+ set_vim_var_string(VV_FNAME, ptr, len);
+ res = eval_to_string_safe(curbuf->b_p_inex, NULL);
+ set_vim_var_string(VV_FNAME, NULL, 0);
+ return res;
+}
+#endif
+
+/*
+ * Return the name of the file ptr[len] in 'path'.
+ * Otherwise like file_name_at_cursor().
+ */
+ char_u *
+find_file_name_in_path(ptr, len, options, count, rel_fname)
+ char_u *ptr;
+ int len;
+ int options;
+ long count;
+ char_u *rel_fname; /* file we are searching relative to */
+{
+ char_u *file_name;
+ int c;
+# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+ char_u *tofree = NULL;
+
+ if ((options & FNAME_INCL) && *curbuf->b_p_inex != NUL)
+ {
+ tofree = eval_includeexpr(ptr, len);
+ if (tofree != NULL)
+ {
+ ptr = tofree;
+ len = (int)STRLEN(ptr);
+ }
+ }
+# endif
+
+ if (options & FNAME_EXP)
+ {
+ file_name = find_file_in_path(ptr, len, options & ~FNAME_MESS,
+ TRUE, rel_fname);
+
+# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+ /*
+ * If the file could not be found in a normal way, try applying
+ * 'includeexpr' (unless done already).
+ */
+ if (file_name == NULL
+ && !(options & FNAME_INCL) && *curbuf->b_p_inex != NUL)
+ {
+ tofree = eval_includeexpr(ptr, len);
+ if (tofree != NULL)
+ {
+ ptr = tofree;
+ len = (int)STRLEN(ptr);
+ file_name = find_file_in_path(ptr, len, options & ~FNAME_MESS,
+ TRUE, rel_fname);
+ }
+ }
+# endif
+ if (file_name == NULL && (options & FNAME_MESS))
+ {
+ c = ptr[len];
+ ptr[len] = NUL;
+ EMSG2(_("E447: Can't find file \"%s\" in path"), ptr);
+ ptr[len] = c;
+ }
+
+ /* Repeat finding the file "count" times. This matters when it
+ * appears several times in the path. */
+ while (file_name != NULL && --count > 0)
+ {
+ vim_free(file_name);
+ file_name = find_file_in_path(ptr, len, options, FALSE, rel_fname);
+ }
+ }
+ else
+ file_name = vim_strnsave(ptr, len);
+
+# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
+ vim_free(tofree);
+# endif
+
+ return file_name;
+}
+#endif /* FEAT_SEARCHPATH */
+
+/*
+ * Check if the "://" of a URL is at the pointer, return URL_SLASH.
+ * Also check for ":\\", which MS Internet Explorer accepts, return
+ * URL_BACKSLASH.
+ */
+ static int
+path_is_url(p)
+ char_u *p;
+{
+ if (STRNCMP(p, "://", (size_t)3) == 0)
+ return URL_SLASH;
+ else if (STRNCMP(p, ":\\\\", (size_t)3) == 0)
+ return URL_BACKSLASH;
+ return 0;
+}
+
+/*
+ * Check if "fname" starts with "name://". Return URL_SLASH if it does.
+ * Return URL_BACKSLASH for "name:\\".
+ * Return zero otherwise.
+ */
+ int
+path_with_url(fname)
+ char_u *fname;
+{
+ char_u *p;
+
+ for (p = fname; isalpha(*p); ++p)
+ ;
+ return path_is_url(p);
+}
+
+/*
+ * Return TRUE if "name" is a full (absolute) path name or URL.
+ */
+ int
+vim_isAbsName(name)
+ char_u *name;
+{
+ return (path_with_url(name) != 0 || mch_isFullName(name));
+}
+
+/*
+ * Get absolute file name into buffer 'buf' of length 'len' bytes.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+vim_FullName(fname, buf, len, force)
+ char_u *fname, *buf;
+ int len;
+ int force;
+{
+ int retval = OK;
+ int url;
+
+ *buf = NUL;
+ if (fname == NULL)
+ return FAIL;
+
+ url = path_with_url(fname);
+ if (!url)
+ retval = mch_FullName(fname, buf, len, force);
+ if (url || retval == FAIL)
+ {
+ /* something failed; use the file name (truncate when too long) */
+ STRNCPY(buf, fname, len);
+ buf[len - 1] = NUL;
+ }
+#if defined(MACOS_CLASSIC) || defined(OS2) || defined(MSDOS) || defined(MSWIN)
+ slash_adjust(buf);
+#endif
+ return retval;
+}
+
+/*
+ * Return the minimal number of rows that is needed on the screen to display
+ * the current number of windows.
+ */
+ int
+min_rows()
+{
+ int total;
+
+ if (firstwin == NULL) /* not initialized yet */
+ return MIN_LINES;
+
+ total = 1; /* count the room for the command line */
+#ifdef FEAT_WINDOWS
+ total += frame_minheight(topframe, NULL);
+#else
+ total += 1; /* at least one window should have a line! */
+#endif
+ return total;
+}
+
+/*
+ * Return TRUE if there is only one window, not counting a help or preview
+ * window, unless it is the current window.
+ */
+ int
+only_one_window()
+{
+#ifdef FEAT_WINDOWS
+ int count = 0;
+ win_T *wp;
+
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if (!(wp->w_buffer->b_help
+# ifdef FEAT_QUICKFIX
+ || wp->w_p_pvw
+# endif
+ ) || wp == curwin)
+ ++count;
+ return (count <= 1);
+#else
+ return TRUE;
+#endif
+}
+
+#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD) || defined(PROTO)
+/*
+ * Correct the cursor line number in other windows. Used after changing the
+ * current buffer, and before applying autocommands.
+ * When "do_curwin" is TRUE, also check current window.
+ */
+ void
+check_lnums(do_curwin)
+ int do_curwin;
+{
+ win_T *wp;
+
+#ifdef FEAT_WINDOWS
+ for (wp = firstwin; wp != NULL; wp = wp->w_next)
+ if ((do_curwin || wp != curwin) && wp->w_buffer == curbuf)
+#else
+ wp = curwin;
+ if (do_curwin)
+#endif
+ {
+ if (wp->w_cursor.lnum > curbuf->b_ml.ml_line_count)
+ wp->w_cursor.lnum = curbuf->b_ml.ml_line_count;
+ if (wp->w_topline > curbuf->b_ml.ml_line_count)
+ wp->w_topline = curbuf->b_ml.ml_line_count;
+ }
+}
+#endif
+
+#if defined(FEAT_WINDOWS) || defined(PROTO)
+
+/*
+ * A snapshot of the window sizes, to restore them after closing the help
+ * window.
+ * Only these fields are used:
+ * fr_layout
+ * fr_width
+ * fr_height
+ * fr_next
+ * fr_child
+ * fr_win (only valid for the old curwin, NULL otherwise)
+ */
+static frame_T *snapshot = NULL;
+
+/*
+ * Create a snapshot of the current frame sizes.
+ */
+ static void
+make_snapshot()
+{
+ clear_snapshot();
+ make_snapshot_rec(topframe, &snapshot);
+}
+
+ static void
+make_snapshot_rec(fr, frp)
+ frame_T *fr;
+ frame_T **frp;
+{
+ *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
+ if (*frp == NULL)
+ return;
+ (*frp)->fr_layout = fr->fr_layout;
+# ifdef FEAT_VERTSPLIT
+ (*frp)->fr_width = fr->fr_width;
+# endif
+ (*frp)->fr_height = fr->fr_height;
+ if (fr->fr_next != NULL)
+ make_snapshot_rec(fr->fr_next, &((*frp)->fr_next));
+ if (fr->fr_child != NULL)
+ make_snapshot_rec(fr->fr_child, &((*frp)->fr_child));
+ if (fr->fr_layout == FR_LEAF && fr->fr_win == curwin)
+ (*frp)->fr_win = curwin;
+}
+
+/*
+ * Remove any existing snapshot.
+ */
+ static void
+clear_snapshot()
+{
+ clear_snapshot_rec(snapshot);
+ snapshot = NULL;
+}
+
+ static void
+clear_snapshot_rec(fr)
+ frame_T *fr;
+{
+ if (fr != NULL)
+ {
+ clear_snapshot_rec(fr->fr_next);
+ clear_snapshot_rec(fr->fr_child);
+ vim_free(fr);
+ }
+}
+
+/*
+ * Restore a previously created snapshot, if there is any.
+ * This is only done if the screen size didn't change and the window layout is
+ * still the same.
+ */
+ static void
+restore_snapshot(close_curwin)
+ int close_curwin; /* closing current window */
+{
+ win_T *wp;
+
+ if (snapshot != NULL
+# ifdef FEAT_VERTSPLIT
+ && snapshot->fr_width == topframe->fr_width
+# endif
+ && snapshot->fr_height == topframe->fr_height
+ && check_snapshot_rec(snapshot, topframe) == OK)
+ {
+ wp = restore_snapshot_rec(snapshot, topframe);
+ win_comp_pos();
+ if (wp != NULL && close_curwin)
+ win_goto(wp);
+ redraw_all_later(CLEAR);
+ }
+ clear_snapshot();
+}
+
+/*
+ * Check if frames "sn" and "fr" have the same layout, same following frames
+ * and same children.
+ */
+ static int
+check_snapshot_rec(sn, fr)
+ frame_T *sn;
+ frame_T *fr;
+{
+ if (sn->fr_layout != fr->fr_layout
+ || (sn->fr_next == NULL) != (fr->fr_next == NULL)
+ || (sn->fr_child == NULL) != (fr->fr_child == NULL)
+ || (sn->fr_next != NULL
+ && check_snapshot_rec(sn->fr_next, fr->fr_next) == FAIL)
+ || (sn->fr_child != NULL
+ && check_snapshot_rec(sn->fr_child, fr->fr_child) == FAIL))
+ return FAIL;
+ return OK;
+}
+
+/*
+ * Copy the size of snapshot frame "sn" to frame "fr". Do the same for all
+ * following frames and children.
+ * Returns a pointer to the old current window, or NULL.
+ */
+ static win_T *
+restore_snapshot_rec(sn, fr)
+ frame_T *sn;
+ frame_T *fr;
+{
+ win_T *wp = NULL;
+ win_T *wp2;
+
+ fr->fr_height = sn->fr_height;
+# ifdef FEAT_VERTSPLIT
+ fr->fr_width = sn->fr_width;
+# endif
+ if (fr->fr_layout == FR_LEAF)
+ {
+ frame_new_height(fr, fr->fr_height, FALSE, FALSE);
+# ifdef FEAT_VERTSPLIT
+ frame_new_width(fr, fr->fr_width, FALSE);
+# endif
+ wp = sn->fr_win;
+ }
+ if (sn->fr_next != NULL)
+ {
+ wp2 = restore_snapshot_rec(sn->fr_next, fr->fr_next);
+ if (wp2 != NULL)
+ wp = wp2;
+ }
+ if (sn->fr_child != NULL)
+ {
+ wp2 = restore_snapshot_rec(sn->fr_child, fr->fr_child);
+ if (wp2 != NULL)
+ wp = wp2;
+ }
+ return wp;
+}
+
+#endif
+
+#if (defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)) || defined(PROTO)
+/*
+ * Return TRUE if there is any vertically split window.
+ */
+ int
+win_hasvertsplit()
+{
+ frame_T *fr;
+
+ if (topframe->fr_layout == FR_ROW)
+ return TRUE;
+
+ if (topframe->fr_layout == FR_COL)
+ for (fr = topframe->fr_child; fr != NULL; fr = fr->fr_next)
+ if (fr->fr_layout == FR_ROW)
+ return TRUE;
+
+ return FALSE;
+}
+#endif
diff --git a/src/workshop.c b/src/workshop.c
new file mode 100644
index 000000000..10f4ea796
--- /dev/null
+++ b/src/workshop.c
@@ -0,0 +1,1885 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "auto/config.h"
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef HAVE_LIBGEN_H
+# include <libgen.h>
+#endif
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include <X11/Intrinsic.h>
+#include <Xm/Xm.h>
+#include <Xm/PushB.h>
+
+#include "integration.h" /* <EditPlugin/integration.h> */
+
+#include "vim.h"
+#include "version.h"
+#include "gui_beval.h"
+#include "workshop.h"
+
+void workshop_hotkeys(Boolean);
+
+static Boolean isShowing(int);
+static win_T *get_window(buf_T *);
+#if 0
+static int get_buffer_number(buf_T *);
+#endif
+static void updatePriority(Boolean);
+static char *addUniqueMnemonic(char *, char *);
+static char *fixup(char *);
+static char *get_selection(buf_T *);
+static char *append_selection(int, char *, int *, int *);
+static void load_buffer_by_name(char *, int);
+#if 0
+static void load_buffer_by_number(int, int);
+#endif
+static void load_window(char *, int lnum);
+static void warp_to_pc(int);
+#ifdef FEAT_BEVAL
+static void bevalCB(BalloonEval *, int);
+#endif
+static char *fixAccelText(char *);
+static void addMenu(char *, char *, char *);
+static char *lookupVerb(char *, int);
+static int computeIndex(int, char_u *, int);
+static void coloncmd(char *, Boolean);
+
+extern Widget vimShell;
+extern Widget textArea;
+extern XtAppContext app_context;
+
+static int tbpri; /* ToolBar priority */
+int usingSunWorkShop = 0; /* set if -ws flag is used */
+char curMenuName[BUFSIZ];
+char curMenuPriority[BUFSIZ];
+BalloonEval *balloonEval;
+
+static Boolean workshopInitDone = False;
+static Boolean workshopHotKeysEnabled = False;
+
+/*
+ * The following enum is from <gp_dbx/gp_dbx_common.h>. We can't include it
+ * here because its C++.
+ */
+enum
+{
+ GPLineEval_EVALUATE, /* evaluate expression */
+ GPLineEval_INDIRECT, /* evaluate *<expression> */
+ GPLineEval_TYPE /* type of expression */
+};
+
+/*
+ * Store each verb in the MenuMap. This lets us map from a verb to a menu.
+ * There may be multiple matches for a single verb in this table.
+ */
+#define MENU_INC 50 /* menuMap incremental size increases */
+typedef struct
+{
+ char *name; /* name of the menu */
+ char *accel; /* optional accelerator key */
+ char *verb; /* menu verb */
+} MenuMap;
+static MenuMap *menuMap; /* list of verb/menu mappings */
+static int menuMapSize; /* current size of menuMap */
+static int menuMapMax; /* allocated size of menuMap */
+static char *initialFileCmd; /* save command but defer doing it */
+
+
+ void
+workshop_init()
+{
+ char_u buf[64];
+ int is_dirty = FALSE;
+ int width, height;
+ XtInputMask mask;
+
+ /*
+ * Turn on MenuBar, ToolBar, and Footer.
+ */
+ STRCPY(buf, p_go);
+ if (vim_strchr(p_go, GO_MENUS) == NULL)
+ {
+ STRCAT(buf, "m");
+ is_dirty = TRUE;
+ }
+ if (vim_strchr(p_go, GO_TOOLBAR) == NULL)
+ {
+ STRCAT(buf, "T");
+ is_dirty = TRUE;
+ }
+ if (vim_strchr(p_go, GO_FOOTER) == NULL)
+ {
+ STRCAT(buf, "F");
+ is_dirty = TRUE;
+ }
+ if (is_dirty)
+ set_option_value((char_u *)"go", 0L, buf, 0);
+
+ /*
+ * Set size from workshop_get_width_height().
+ */
+ width = height = 0;
+ if (workshop_get_width_height(&width, &height))
+ {
+ XtVaSetValues(vimShell,
+ XmNwidth, width,
+ XmNheight, height,
+ NULL);
+ }
+
+ /*
+ * Now read in the initial messages from eserve.
+ */
+ while ((mask = XtAppPending(app_context))
+ && (mask & XtIMAlternateInput) && !workshopInitDone)
+ XtAppProcessEvent(app_context, (XtInputMask)XtIMAlternateInput);
+}
+
+ void
+workshop_postinit()
+{
+ do_cmdline_cmd((char_u *)initialFileCmd);
+ ALT_INPUT_LOCK_OFF;
+ free(initialFileCmd);
+ initialFileCmd = NULL;
+}
+
+ void
+ex_wsverb(exarg_T *eap)
+{
+ msg_clr_cmdline();
+ workshop_perform_verb((char *) eap->arg, NULL);
+}
+
+/*
+ * Editor name
+ * This string is recognized by eserve and should be all lower case.
+ * This is how the editor detects that it is talking to gvim instead
+ * of NEdit, for example, when the connection is initiated from the editor.
+ */
+ char *
+workshop_get_editor_name()
+{
+ return "gvim";
+}
+
+/*
+ * Version number of the editor.
+ * This number is communicated along with the protocol
+ * version to the application.
+ */
+ char *
+workshop_get_editor_version()
+{
+ return Version;
+}
+
+/*
+ * Answer functions: called by eserve
+ */
+
+/*
+ * Name:
+ * workshop_load_file
+ *
+ * Function:
+ * Load a given file into the WorkShop buffer.
+ */
+/*ARGSUSED*/
+ void
+workshop_load_file(
+ char *filename, /* the file to load */
+ int line, /* an optional line number (or 0) */
+ char *frameid) /* used for multi-frame support */
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_load_file(%s, %d)\n", filename, line);
+#endif
+
+#ifdef FEAT_BEVAL
+ if (balloonEval == NULL)
+ {
+ /*
+ * Set up the Balloon Expression Evaluation area.
+ * It's enabled by default. Disable it when 'ballooneval' is off.
+ */
+# ifdef FEAT_GUI_GTK
+ balloonEval = gui_mch_create_beval_area(gui.drawarea, NULL,
+ &bevalCB, NULL);
+# else
+ balloonEval = gui_mch_create_beval_area(textArea, NULL, bevalCB, NULL);
+# endif
+ if (!p_beval)
+ gui_mch_disable_beval_area(balloonEval);
+ }
+#endif
+
+ load_window(filename, line);
+}
+
+/*
+ * Reload the WorkShop buffer
+ */
+ void
+workshop_reload_file(
+ char *filename,
+ int line)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_reload_file(%s, %d)\n", filename, line);
+#endif
+ load_window(filename, line);
+}
+
+ void
+workshop_show_file(
+ char *filename)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_show_file(%s)\n", filename);
+#endif
+
+ load_window(filename, 0);
+}
+
+ void
+workshop_goto_line(
+ char *filename,
+ int lineno)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_goto_line(%s, %d)\n", filename, lineno);
+#endif
+
+ load_window(filename, lineno);
+}
+
+/*ARGSUSED*/
+ void
+workshop_front_file(
+ char *filename)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_front_file()\n");
+#endif
+ /*
+ * Assumption: This function will always be called after a call to
+ * workshop_show_file(), so the file is always showing.
+ */
+ if (vimShell != NULL)
+ XRaiseWindow(gui.dpy, XtWindow(vimShell));
+}
+
+ void
+workshop_save_file(
+ char *filename)
+{
+ char cbuf[BUFSIZ]; /* build vim command here */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_save_file(%s)\n", filename);
+#endif
+
+ /* Save the given file */
+ sprintf(cbuf, "w %s", filename);
+ coloncmd(cbuf, TRUE);
+}
+
+ void
+workshop_save_files()
+{
+ /* Save the given file */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_save_files()\n");
+#endif
+
+ add_to_input_buf((char_u *) ":wall\n", 6);
+}
+
+ void
+workshop_quit()
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_quit()\n");
+#endif
+
+ add_to_input_buf((char_u *) ":qall\n", 6);
+}
+
+ void
+workshop_minimize()
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_minimize()\n");
+#endif
+ workshop_minimize_shell(vimShell);
+}
+ void
+workshop_maximize()
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_maximize()\n");
+#endif
+
+ workshop_maximize_shell(vimShell);
+}
+
+ void
+workshop_add_mark_type(
+ int idx,
+ char *colorspec,
+ char *sign)
+{
+ char gbuf[BUFSIZ]; /* buffer for sign name */
+ char cibuf[BUFSIZ]; /* color information */
+ char cbuf[BUFSIZ]; /* command buffer */
+ char *bp;
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ {
+ char *cp;
+
+ cp = strrchr(sign, '/');
+ if (cp == NULL)
+ cp = sign;
+ else
+ cp++; /* skip '/' character */
+ wstrace("workshop_add_mark_type(%d, \"%s\", \"%s\")\n", idx,
+ colorspec && *colorspec ? colorspec : "<None>", cp);
+ }
+#endif
+
+ /*
+ * Isolate the basename of sign in gbuf. We will use this for the
+ * GroupName in the highlight command sent to vim.
+ */
+ STRCPY(gbuf, gettail((char_u *)sign));
+ bp = strrchr(gbuf, '.');
+ if (bp != NULL)
+ *bp = NUL;
+
+ if (gbuf[0] != '-' && gbuf[1] != NUL)
+ {
+ if (colorspec != NULL && *colorspec)
+ {
+ sprintf(cbuf, "highlight WS%s guibg=%s", gbuf, colorspec);
+ coloncmd(cbuf, FALSE);
+ sprintf(cibuf, "linehl=WS%s", gbuf);
+ }
+ else
+ cibuf[0] = NUL;
+
+ sprintf(cbuf, "sign define %d %s icon=%s", idx, cibuf, sign);
+ coloncmd(cbuf, TRUE);
+ }
+}
+
+ void
+workshop_set_mark(
+ char *filename, /* filename which gets the mark */
+ int lineno, /* line number which gets the mark */
+ int markId, /* unique mark identifier */
+ int idx) /* which mark to use */
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+ /* Set mark in a given file */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_set_mark(%s, %d (ln), %d (id), %d (idx))\n",
+ filename, lineno, markId, idx);
+#endif
+
+ sprintf(cbuf, "sign place %d line=%d name=%d file=%s",
+ markId, lineno, idx, filename);
+ coloncmd(cbuf, TRUE);
+}
+
+ void
+workshop_change_mark_type(
+ char *filename, /* filename which gets the mark */
+ int markId, /* unique mark identifier */
+ int idx) /* which mark to use */
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+ /* Change mark type */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_change_mark_type(%s, %d, %d)\n",
+ filename, markId, idx);
+#endif
+
+ sprintf(cbuf, "sign place %d name=%d file=%s", markId, idx, filename);
+ coloncmd(cbuf, TRUE);
+}
+
+/*
+ * Goto the given mark in a file (e.g. show it).
+ * If message is not null, display it in the footer.
+ */
+ void
+workshop_goto_mark(
+ char *filename,
+ int markId,
+ char *message)
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+ /* Goto mark */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_goto_mark(%s, %d (id), %s)\n",
+ filename, markId, message && *message &&
+ !(*message == ' ' && message[1] == NULL) ?
+ message : "<None>");
+#endif
+
+ sprintf(cbuf, "sign jump %d file=%s", markId, filename);
+ coloncmd(cbuf, TRUE);
+ if (message != NULL && *message != NUL)
+ gui_mch_set_footer((char_u *)message);
+}
+
+ void
+workshop_delete_mark(
+ char *filename,
+ int markId)
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+ /* Delete mark */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_delete_mark(%s, %d (id))\n",
+ filename, markId);
+#endif
+
+ sprintf(cbuf, "sign unplace %d file=%s", markId, filename);
+ coloncmd(cbuf, TRUE);
+}
+
+#if 0 /* not used */
+ void
+workshop_delete_all_marks(
+ void *window,
+ Boolean doRefresh)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_delete_all_marks(%#x, %s)\n",
+ window, doRefresh ? "True" : "False");
+#endif
+
+ coloncmd("sign unplace *", TRUE);
+}
+#endif
+
+ int
+workshop_get_mark_lineno(
+ char *filename,
+ int markId)
+{
+ buf_T *buf; /* buffer containing filename */
+ int lineno; /* line number of filename in buf */
+
+ /* Get mark line number */
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_get_mark_lineno(%s, %d)\n",
+ filename, markId);
+#endif
+
+ lineno = 0;
+ buf = buflist_findname((char_u *)filename);
+ if (buf != NULL)
+ lineno = buf_findsign(buf, markId);
+
+ return lineno;
+}
+
+
+#if 0 /* not used */
+ void
+workshop_adjust_marks(Widget *window, int pos,
+ int inserted, int deleted)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("XXXworkshop_adjust_marks(%s, %d, %d, %d)\n",
+ window ? XtName(window) : "<None>", pos, inserted, deleted);
+#endif
+}
+#endif
+
+/*
+ * Are there any moved marks? If so, call workshop_move_mark on
+ * each of them now. This is how eserve can find out if for example
+ * breakpoints have moved when a program has been recompiled and
+ * reloaded into dbx.
+ */
+/*ARGSUSED*/
+ void
+workshop_moved_marks(char *filename)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("XXXworkshop_moved_marks(%s)\n", filename);
+#endif
+}
+
+ int
+workshop_get_font_height()
+{
+ XmFontList fontList; /* fontList made from gui.norm_font */
+ XmString str;
+ Dimension w;
+ Dimension h;
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_get_font_height()\n");
+#endif
+
+ /* Pick the proper signs for this font size */
+ fontList = gui_motif_create_fontlist((XFontStruct *)gui.norm_font);
+ h = 0;
+ if (fontList != NULL)
+ {
+ str = XmStringCreateLocalized("A");
+ XmStringExtent(fontList, str, &w, &h);
+ XmStringFree(str);
+ XmFontListFree(fontList);
+ }
+
+ return (int)h;
+}
+
+/*ARGSUSED*/
+ void
+workshop_footer_message(
+ char *message,
+ int severity) /* severity is currently unused */
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_footer_message(%s, %d)\n", message, severity);
+#endif
+
+ gui_mch_set_footer((char_u *) message);
+}
+
+/*
+ * workshop_menu_begin() is passed the menu name. We determine its mnemonic
+ * here and store its name and priority.
+ */
+ void
+workshop_menu_begin(
+ char *label)
+{
+ vimmenu_T *menu; /* pointer to last menu */
+ int menuPriority = 0; /* priority of new menu */
+ char mnembuf[64]; /* store menubar mnemonics here */
+ char *name; /* label with a mnemonic */
+ char *p; /* used to find mnemonics */
+ int idx; /* index into mnembuf */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_menu_begin()\n");
+#endif
+
+ /*
+ * Look through all existing (non-PopUp and non-Toolbar) menus
+ * and gather their mnemonics. Use this list to decide what
+ * mnemonic should be used for label.
+ */
+
+ idx = 0;
+ mnembuf[idx++] = 'H'; /* H is mnemonic for Help */
+ for (menu = root_menu; menu != NULL; menu = menu->next)
+ {
+ if (menu_is_menubar(menu->name))
+ {
+ p = strchr((char *)menu->name, '&');
+ if (p != NULL)
+ mnembuf[idx++] = *++p;
+ }
+ if (menu->next != NULL
+ && strcmp((char *) menu->next->dname, "Help") == 0)
+ {
+ menuPriority = menu->priority + 10;
+ break;
+ }
+ }
+ mnembuf[idx++] = NUL;
+ name = addUniqueMnemonic(mnembuf, label);
+
+ sprintf(curMenuName, "%s", name);
+ sprintf(curMenuPriority, "%d.0", menuPriority);
+}
+
+/*
+ * Append the name and priority to strings to be used in vim menu commands.
+ */
+ void
+workshop_submenu_begin(
+ char *label)
+{
+#ifdef WSDEBUG_TRACE
+ if (ws_debug && ws_dlevel & WS_TRACE
+ && strncmp(curMenuName, "ToolBar", 7) != 0)
+ wstrace("workshop_submenu_begin(%s)\n", label);
+#endif
+
+ strcat(curMenuName, ".");
+ strcat(curMenuName, fixup(label));
+
+ updatePriority(True);
+}
+
+/*
+ * Remove the submenu name and priority from curMenu*.
+ */
+
+ void
+workshop_submenu_end()
+{
+ char *p;
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE)
+ && strncmp(curMenuName, "ToolBar", 7) != 0)
+ wstrace("workshop_submenu_end()\n");
+#endif
+
+ p = strrchr(curMenuPriority, '.');
+ ASSERT(p != NULL);
+ *p = NUL;
+
+ p = strrchr(curMenuName, '.');
+ ASSERT(p != NULL);
+ *p = NUL;
+}
+
+/*
+ * This is where menus are really made. Each item will generate an amenu vim
+ * command. The globals curMenuName and curMenuPriority contain the name and
+ * priority of the parent menu tree.
+ */
+/*ARGSUSED*/
+ void
+workshop_menu_item(
+ char *label,
+ char *verb,
+ char *accelerator,
+ char *acceleratorText,
+ char *name,
+ char *filepos,
+ char *sensitive)
+{
+ char cbuf[BUFSIZ];
+ char namebuf[BUFSIZ];
+ char accText[BUFSIZ];
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE)
+ && strncmp(curMenuName, "ToolBar", 7) != 0)
+ {
+ if (ws_dlevel & WS_TRACE_VERBOSE)
+ wsdebug("workshop_menu_item(\n"
+ "\tlabel = \"%s\",\n"
+ "\tverb = %s,\n"
+ "\taccelerator = %s,\n"
+ "\tacceleratorText = \"%s\",\n"
+ "\tname = %s,\n"
+ "\tfilepos = %s,\n"
+ "\tsensitive = %s)\n",
+ label && *label ? label : "<None>",
+ verb && *verb ? verb : "<None>",
+ accelerator && *accelerator ?
+ accelerator : "<None>",
+ acceleratorText && *acceleratorText ?
+ acceleratorText : "<None>",
+ name && *name ? name : "<None>",
+ filepos && *filepos ? filepos : "<None>",
+ sensitive);
+ else if (ws_dlevel & WS_TRACE)
+ wstrace("workshop_menu_item(\"%s\", %s)\n",
+ label && *label ? label : "<None>",
+ verb && *verb ? verb : "<None>", sensitive);
+ }
+#endif
+#ifdef WSDEBUG_SENSE
+ if (ws_debug)
+ wstrace("menu: %-21.20s%-21.20s(%s)\n", label, verb,
+ *sensitive == '1' ? "Sensitive" : "Insensitive");
+#endif
+
+ if (acceleratorText != NULL)
+ sprintf(accText, "<Tab>%s", acceleratorText);
+ else
+ accText[0] = NUL;
+ updatePriority(False);
+ sprintf(namebuf, "%s.%s", curMenuName, fixup(label));
+ sprintf(cbuf, "amenu %s %s%s\t:wsverb %s<CR>",
+ curMenuPriority, namebuf, accText, verb);
+
+ coloncmd(cbuf, TRUE);
+ addMenu(namebuf, fixAccelText(acceleratorText), verb);
+
+ if (*sensitive == '0')
+ {
+ sprintf(cbuf, "amenu disable %s", namebuf);
+ coloncmd(cbuf, TRUE);
+ }
+}
+
+/*
+ * This function is called when a complete WorkShop menu description has been
+ * sent over from eserve. We do some menu cleanup.
+ */
+
+ void
+workshop_menu_end()
+{
+ Boolean using_tearoff; /* set per current option setting */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_menu_end()\n");
+#endif
+
+ using_tearoff = vim_strchr(p_go, GO_TEAROFF) != NULL;
+ gui_mch_toggle_tearoffs(using_tearoff);
+}
+
+ void
+workshop_toolbar_begin()
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_toolbar_begin()\n");
+#endif
+
+ coloncmd("aunmenu ToolBar", True);
+ tbpri = 10;
+}
+
+ void
+workshop_toolbar_end()
+{
+ char_u buf[64];
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ {
+ wstrace("workshop_toolbar_end()\n");
+ }
+#endif
+
+ /*
+ * Turn on ToolBar.
+ */
+ STRCPY(buf, p_go);
+ if (vim_strchr(p_go, 'T') == NULL)
+ {
+ STRCAT(buf, "T");
+ set_option_value((char_u *)"go", 0L, buf, 0);
+ }
+ workshopInitDone = True;
+}
+
+/*ARGSUSED*/
+ void
+workshop_toolbar_button(
+ char *label,
+ char *verb,
+ char *senseVerb,
+ char *filepos,
+ char *help,
+ char *sense,
+ char *file,
+ char *left)
+{
+ char cbuf[BUFSIZ + MAXPATHLEN];
+ char namebuf[BUFSIZ];
+ static int tbid = 1;
+ char_u *p;
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE))
+ wsdebug("workshop_toolbar_button(\"%s\", %s, %s,\n"
+ "\t%s, \"%s\", %s,\n\t\"%s\",\n\t<%s>)\n",
+ label && *label ? label : "<None>",
+ verb && *verb ? verb : "<None>",
+ senseVerb && *senseVerb ? senseVerb : "<None>",
+ filepos && *filepos ? filepos : "<None>",
+ help && *help ? help : "<None>",
+ sense && *sense ? sense : "<None>",
+ file && *file ? file : "<None>",
+ left && *left ? left : "<None>");
+ else if (WSDLEVEL(WS_TRACE))
+ wstrace("workshop_toolbar_button(\"%s\", %s)\n",
+ label && *label ? label : "<None>",
+ verb && *verb ? verb : "<None>");
+#endif
+#ifdef WSDEBUG_SENSE
+ if (ws_debug)
+ wsdebug("button: %-21.20s%-21.20s(%s)\n", label, verb,
+ *sense == '1' ? "Sensitive" : "Insensitive");
+#endif
+
+ if (left && *left && atoi(left) > 0)
+ {
+ /* Add a separator (but pass the width passed after the ':') */
+ sprintf(cbuf, "amenu 1.%d ToolBar.-sep%d:%s- <nul>",
+ tbpri - 5, tbid++, left);
+
+ coloncmd(cbuf, True);
+ }
+
+ p = vim_strsave_escaped((char_u *)label, (char_u *)"\\. ");
+ sprintf(namebuf, "ToolBar.%s", p);
+ vim_free(p);
+ STRCPY(cbuf, "amenu <silent> ");
+ if (file != NULL && *file != NUL)
+ {
+ p = vim_strsave_escaped((char_u *)file, (char_u *)" ");
+ sprintf(cbuf + STRLEN(cbuf), "icon=%s ", p);
+ vim_free(p);
+ }
+ sprintf(cbuf + STRLEN(cbuf), "1.%d %s :wsverb %s<CR>",
+ tbpri, namebuf, verb);
+
+ /* Define the menu item */
+ coloncmd(cbuf, True);
+
+ if (*sense == '0')
+ {
+ /* If menu isn't sensitive at startup... */
+ sprintf(cbuf, "amenu disable %s", namebuf);
+ coloncmd(cbuf, True);
+ }
+
+ if (help && *help)
+ {
+ /* Do the tooltip */
+ sprintf(cbuf, "tmenu %s %s", namebuf, help);
+ coloncmd(cbuf, True);
+ }
+
+ addMenu(namebuf, NULL, verb);
+ tbpri += 10;
+}
+
+ void
+workshop_frame_sensitivities(
+ VerbSense *vs) /* list of verbs to (de)sensitize */
+{
+ VerbSense *vp; /* iterate through vs */
+ char *menu_name; /* used in menu lookup */
+ int cnt; /* count of verbs to skip */
+ int len; /* length of nonvariant part of command */
+ char cbuf[4096];
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE) || WSDLEVEL(4))
+ {
+ wsdebug("workshop_frame_sensitivities(\n");
+ for (vp = vs; vp->verb != NULL; vp++)
+ wsdebug("\t%-25s%d\n", vp->verb, vp->sense);
+ wsdebug(")\n");
+ }
+ else if (WSDLEVEL(WS_TRACE))
+ wstrace("workshop_frame_sensitivities()\n");
+#endif
+#ifdef WSDEBUG_SENSE
+ if (ws_debug)
+ for (vp = vs; vp->verb != NULL; vp++)
+ wsdebug("change: %-21.20s%-21.20s(%s)\n",
+ "", vp->verb, vp->sense == 1 ?
+ "Sensitive" : "Insensitive");
+#endif
+
+ /*
+ * Look for all matching menu entries for the verb. There may be more
+ * than one if the verb has both a menu and toolbar entry.
+ */
+ for (vp = vs; vp->verb != NULL; vp++)
+ {
+ cnt = 0;
+ strcpy(cbuf, "amenu");
+ strcat(cbuf, " ");
+ strcat(cbuf, vp->sense ? "enable" : "disable");
+ strcat(cbuf, " ");
+ len = strlen(cbuf);
+ while ((menu_name = lookupVerb(vp->verb, cnt++)) != NULL)
+ {
+ strcpy(&cbuf[len], menu_name);
+ coloncmd(cbuf, FALSE);
+ }
+ }
+ gui_update_menus(0);
+ gui_mch_flush();
+}
+
+ void
+workshop_set_option(
+ char *option, /* name of a supported option */
+ char *value) /* value to set option to */
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ {
+ wstrace("workshop_set_option(%s, %s)\n", option, value);
+ }
+#endif
+
+ cbuf[0] = NUL;
+ switch (*option) /* switch on 1st letter */
+ {
+ case 's':
+ if (strcmp(option, "syntax") == 0)
+ sprintf(cbuf, "syntax %s", value);
+ else if (strcmp(option, "savefiles") == 0)
+ ; /* XXX - Not yet implemented */
+ break;
+
+ case 'l':
+ if (strcmp(option, "lineno") == 0)
+ sprintf(cbuf, "set %snu",
+ (strcmp(value, "on") == 0) ? "" : "no");
+ break;
+
+ case 'p':
+ if (strcmp(option, "parentheses") == 0)
+ sprintf(cbuf, "set %ssm",
+ (strcmp(value, "on") == 0) ? "" : "no");
+ break;
+
+ case 'w':
+ /* this option is set by a direct call */
+#ifdef WSDEBUG
+ wsdebug("workshop_set_option: "
+ "Got unexpected workshopkeys option");
+#endif
+ break;
+
+ case 'b': /* these options are set from direct calls */
+ if (option[7] == NUL && strcmp(option, "balloon") == 0)
+ {
+#ifdef WSDEBUG
+ /* set by direct call to workshop_balloon_mode */
+ wsdebug("workshop_set_option: "
+ "Got unexpected ballooneval option");
+#endif
+ }
+ else if (strcmp(option, "balloondelay") == 0)
+ {
+#ifdef WSDEBUG
+ /* set by direct call to workshop_balloon_delay */
+ wsdebug("workshop_set_option: "
+ "Got unexpected balloondelay option");
+#endif
+ }
+ break;
+ }
+ if (cbuf[0] != NUL)
+ coloncmd(cbuf, TRUE);
+}
+
+
+ void
+workshop_balloon_mode(
+ Boolean on)
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_balloon_mode(%s)\n", on ? "True" : "False");
+#endif
+
+ sprintf(cbuf, "set %sbeval", on ? "" : "no");
+ coloncmd(cbuf, TRUE);
+}
+
+
+ void
+workshop_balloon_delay(
+ int delay)
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_balloon_delay(%d)\n", delay);
+#endif
+
+ sprintf(cbuf, "set bdlay=%d", delay);
+ coloncmd(cbuf, TRUE);
+}
+
+
+ void
+workshop_show_balloon_tip(
+ char *tip)
+{
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_show_balloon_tip(%s)\n", tip);
+#endif
+
+ if (balloonEval != NULL)
+ gui_mch_post_balloon(balloonEval, (char_u *)tip);
+}
+
+
+ void
+workshop_hotkeys(
+ Boolean on)
+{
+ char cbuf[BUFSIZ]; /* command buffer */
+ MenuMap *mp; /* iterate over menuMap entries */
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_hotkeys(%s)\n", on ? "True" : "False");
+#endif
+
+ workshopHotKeysEnabled = on;
+ if (workshopHotKeysEnabled)
+ for (mp = menuMap; mp < &menuMap[menuMapSize]; mp++)
+ {
+ if (mp->accel != NULL)
+ {
+ sprintf(cbuf, "map %s :wsverb %s<CR>", mp->accel, mp->verb);
+ coloncmd(cbuf, TRUE);
+ }
+ }
+ else
+ for (mp = menuMap; mp < &menuMap[menuMapSize]; mp++)
+ {
+ if (mp->accel != NULL)
+ {
+ sprintf(cbuf, "unmap %s", mp->accel);
+ coloncmd(cbuf, TRUE);
+ }
+ }
+}
+
+/*
+ * A button in the toolbar has been pushed.
+ */
+/*ARGSUSED*/
+ int
+workshop_get_positions(
+ void *clientData, /* unused */
+ char **filename, /* output data */
+ int *curLine, /* output data */
+ int *curCol, /* output data */
+ int *selStartLine, /* output data */
+ int *selStartCol, /* output data */
+ int *selEndLine, /* output data */
+ int *selEndCol, /* output data */
+ int *selLength, /* output data */
+ char **selection) /* output data */
+{
+ static char ffname[MAXPATHLEN];
+
+#ifdef WSDEBUG_TRACE
+ if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
+ wstrace("workshop_get_positions(%#x, \"%s\", ...)\n",
+ clientData, (curbuf && curbuf->b_sfname != NULL)
+ ? (char *)curbuf->b_sfname : "<None>");
+#endif
+
+ strcpy(ffname, (char *) curbuf->b_ffname);
+ *filename = ffname; /* copy so nobody can change b_ffname */
+ *curLine = curwin->w_cursor.lnum;
+ *curCol = curwin->w_cursor.col;
+
+ if (curbuf->b_visual_mode == 'v' &&
+ equalpos(curwin->w_cursor, curbuf->b_visual_end))
+ {
+ *selStartLine = curbuf->b_visual_start.lnum;
+ *selStartCol = curbuf->b_visual_start.col;
+ *selEndLine = curbuf->b_visual_end.lnum;
+ *selEndCol = curbuf->b_visual_end.col;
+ *selection = get_selection(curbuf);
+ if (*selection)
+ *selLength = strlen(*selection);
+ else
+ *selLength = 0;
+ }
+ else
+ {
+ *selStartLine = *selEndLine = -1;
+ *selStartCol = *selEndCol = -1;
+ *selLength = 0;
+ *selection = "";
+ }
+
+ return True;
+}
+
+
+
+/************************************************************************
+ * Utility functions
+ ************************************************************************/
+
+ static char *
+get_selection(
+ buf_T *buf) /* buffer whose selection we want */
+{
+ pos_T *start; /* start of the selection */
+ pos_T *end; /* end of the selection */
+ char *lp; /* pointer to actual line data */
+ int llen; /* length of actual line data */
+ char *sp; /* pointer to selection buffer */
+ int slen; /* string length in selection buffer */
+ int size; /* size of selection buffer */
+ char *new_sp; /* temp pointer to new sp */
+ int lnum; /* line number we are appending */
+
+ if (buf->b_visual_mode == 'v')
+ {
+ start = &buf->b_visual_start;
+ end = &buf->b_visual_end;
+ if (start->lnum == end->lnum)
+ {
+ /* selection is all on one line */
+ lp = (char *) ml_get_pos(start);
+ llen = end->col - start->col + 1;
+ sp = (char *) malloc(llen + 1);
+ if (sp != NULL)
+ {
+ strncpy(sp, lp, llen);
+ sp[llen] = NUL;
+ }
+ }
+ else
+ {
+ /* multi-line selection */
+ lp = (char *) ml_get_pos(start);
+ llen = strlen(lp);
+ sp = (char *) malloc(BUFSIZ + llen);
+ if (sp != NULL)
+ {
+ size = BUFSIZ + llen;
+ strcpy(sp, lp);
+ sp[llen] = '\n';
+ slen = llen + 1;
+
+ lnum = start->lnum + 1;
+ while (lnum < end->lnum)
+ sp = append_selection(lnum++, sp, &size, &slen);
+
+ lp = (char *) ml_get(end->lnum);
+ llen = end->col + 1;
+ if ((slen + llen) >= size)
+ {
+ new_sp = (char *)
+ realloc(sp, slen + llen + 1);
+ if (new_sp != NULL)
+ {
+ size += llen + 1;
+ sp = new_sp;
+ }
+ }
+ if ((slen + llen) < size)
+ {
+ strncpy(&sp[slen], lp, llen);
+ sp[slen + llen] = NUL;
+ }
+
+ }
+ }
+ }
+ else
+ sp = NULL;
+
+ return sp;
+}
+
+ static char *
+append_selection(
+ int lnum, /* line number to append */
+ char *sp, /* pointer to selection buffer */
+ int *size, /* ptr to size of sp */
+ int *slen) /* ptr to length of selection string */
+{
+ char *lp; /* line of data from buffer */
+ int llen; /* strlen of lp */
+ char *new_sp; /* temp pointer to new sp */
+
+ lp = (char *)ml_get((linenr_T)lnum);
+ llen = strlen(lp);
+
+ if ((*slen + llen) <= *size)
+ {
+ new_sp = (char *) realloc((void *) sp, BUFSIZ + *slen + llen);
+ if (*new_sp != NUL)
+ {
+ *size = BUFSIZ + *slen + llen;
+ sp = new_sp;
+ }
+ }
+ if ((*slen + llen) > *size)
+ {
+ strcat(&sp[*slen], lp);
+ *slen += llen;
+ sp[*slen++] = '\n';
+ }
+
+ return sp;
+}
+
+
+
+ static void
+load_buffer_by_name(
+ char *filename, /* the file to load */
+ int lnum) /* an optional line number (or 0) */
+{
+ char lnumbuf[16]; /* make line number option for :e */
+ char cbuf[BUFSIZ]; /* command buffer */
+
+ if (lnum > 0)
+ sprintf(lnumbuf, "+%d", lnum);
+ else
+ lnumbuf[0] = NUL;
+
+ sprintf(cbuf, "e %s %s", lnumbuf, filename);
+ coloncmd(cbuf, False);
+}
+
+
+ static void
+load_window(
+ char *filename, /* filename to load */
+ int lnum) /* linenumber to go to */
+{
+ buf_T *buf; /* buffer filename is stored in */
+ win_T *win; /* window filenme is displayed in */
+
+ /*
+ * Make sure filename is displayed and is the current window.
+ */
+
+ buf = buflist_findname((char_u *)filename);
+ if (buf == NULL || (win = get_window(buf)) == NULL)
+ {
+ /* No buffer or buffer is not in current window */
+ /* wsdebug("load_window: load_buffer_by_name(\"%s\", %d)\n",
+ filename, lnum); */
+ load_buffer_by_name(filename, lnum);
+ }
+ else
+ {
+ /* buf is in a window */
+ if (win != curwin)
+ {
+ win_enter(win, False);
+ /* wsdebug("load_window: window endter %s\n",
+ win->w_buffer->b_sfname); */
+ }
+ if (lnum > 0 && win->w_cursor.lnum != lnum)
+ {
+ warp_to_pc(lnum);
+ /* wsdebug("load_window: warp to %s[%d]\n",
+ win->w_buffer->b_sfname, lnum); */
+ }
+ }
+ out_flush();
+}
+
+
+
+ static void
+warp_to_pc(
+ int lnum) /* line number to warp to */
+{
+ char lbuf[256]; /* build line comand here */
+
+ if (lnum > 0)
+ {
+ if (State & INSERT)
+ add_to_input_buf((char_u *) "\033", 1);
+ if (isShowing(lnum))
+ sprintf(lbuf, "%dG", lnum);
+ else
+ sprintf(lbuf, "%dz.", lnum);
+ add_to_input_buf((char_u *) lbuf, strlen(lbuf));
+ }
+}
+
+ static Boolean
+isShowing(
+ int lnum) /* tell if line number is showing */
+{
+ return lnum >= curwin->w_topline && lnum < curwin->w_botline;
+}
+
+
+
+ static win_T *
+get_window(
+ buf_T *buf) /* buffer to find window for */
+{
+ win_T *wp = NULL; /* window filename is in */
+
+ for (wp = firstwin; wp != NULL; wp = W_NEXT(wp))
+ if (buf == wp->w_buffer)
+ break;
+ return wp;
+}
+
+
+#if 0 /* not used */
+ static int
+get_buffer_number(
+ buf_T *buf) /* buffer to get position of */
+{
+ buf_T *bp; /* iterate over buffer list */
+ int pos; /* the position in the buffer list */
+
+ pos = 1;
+ for (bp = firstbuf; bp != NULL; bp = bp->b_next)
+ {
+ if (bp == buf)
+ return pos;
+ pos++;
+ }
+
+ return 1;
+}
+#endif
+
+ static void
+updatePriority(
+ Boolean subMenu) /* if True then start new submenu pri */
+{
+ int pri; /* priority of this menu/item */
+ char *p;
+
+ p = strrchr(curMenuPriority, '.');
+ ASSERT(p != NULL);
+ *p++ = NUL;
+
+ pri = atoi(p) + 10; /* our new priority */
+
+ if (subMenu)
+ sprintf(curMenuPriority, "%s.%d.0", curMenuPriority, pri);
+ else
+ sprintf(curMenuPriority, "%s.%d", curMenuPriority, pri);
+}
+
+ static char *
+addUniqueMnemonic(
+ char *mnemonics, /* currently used mnemonics */
+ char *label) /* label of menu needing mnemonic */
+{
+ static char name[BUFSIZ]; /* buffer for the updated name */
+ char *p; /* pointer into label */
+ char *found; /* pointer to possible mnemonic */
+
+ found = NULL;
+ for (p = label; *p != NUL; p++)
+ if (strchr(mnemonics, *p) == 0)
+ if (found == NULL || (isupper((int)*p) && islower((int)*found)))
+ found = p;
+
+ if (found != NULL)
+ {
+ strncpy(name, label, (found - label));
+ strcat(name, "&");
+ strcat(name, found);
+ }
+ else
+ strcpy(name, label);
+
+ return name;
+}
+
+/*
+ * Some characters in a menu name must be escaped in vim. Since this is vim
+ * specific, it must be done on this side.
+ */
+ static char *
+fixup(
+ char *label)
+{
+ static char buf[BUFSIZ];
+ char *bp; /* pointer into buf */
+ char *lp; /* pointer into label */
+
+ lp = label;
+ bp = buf;
+ while (*lp != NUL)
+ {
+ if (*lp == ' ' || *lp == '.')
+ *bp++ = '\\';
+ *bp++ = *lp++;
+ }
+ *bp = NUL;
+
+ return buf;
+}
+
+
+#ifdef NOHANDS_SUPPORT_FUNCTIONS
+
+/* For the NoHands test suite */
+
+ char *
+workshop_test_getcurrentfile()
+{
+ char *filename, *selection;
+ int curLine, curCol, selStartLine, selStartCol, selEndLine;
+ int selEndCol, selLength;
+
+ if (workshop_get_positions(
+ NULL, &filename, &curLine, &curCol, &selStartLine,
+ &selStartCol, &selEndLine, &selEndCol, &selLength,
+ &selection))
+ return filename;
+ else
+ return NULL;
+}
+
+ int
+workshop_test_getcursorrow()
+{
+ return 0;
+}
+
+ int
+workshop_test_getcursorcol()
+{
+ char *filename, *selection;
+ int curLine, curCol, selStartLine, selStartCol, selEndLine;
+ int selEndCol, selLength;
+
+ if (workshop_get_positions(
+ NULL, &filename, &curLine, &curCol, &selStartLine,
+ &selStartCol, &selEndLine, &selEndCol, &selLength,
+ &selection))
+ return curCol;
+ else
+ return -1;
+}
+
+ char *
+workshop_test_getcursorrowtext()
+{
+ return NULL;
+}
+
+ char *
+workshop_test_getselectedtext()
+{
+ char *filename, *selection;
+ int curLine, curCol, selStartLine, selStartCol, selEndLine;
+ int selEndCol, selLength;
+
+ if (workshop_get_positions(
+ NULL, &filename, &curLine, &curCol, &selStartLine,
+ &selStartCol, &selEndLine, &selEndCol, &selLength,
+ &selection))
+ return selection;
+ else
+ return NULL;
+}
+
+/*ARGSUSED*/
+ void
+workshop_save_sensitivity(char *filename)
+{
+}
+
+#endif
+
+ static char *
+fixAccelText(
+ char *ap) /* original acceleratorText */
+{
+ char buf[256]; /* build in temp buffer */
+ char *shift; /* shift string of "" */
+
+ if (ap == NULL)
+ return NULL;
+
+ /* If the accelerator is shifted use the vim form */
+ if (strncmp("Shift+", ap, 6) == 0)
+ {
+ shift = "S-";
+ ap += 6;
+ }
+ else
+ shift = "";
+
+ if (*ap == 'F' && atoi(&ap[1]) > 0)
+ {
+ sprintf(buf, "<%s%s>", shift, ap);
+ return strdup(buf);
+ }
+ else
+ return NULL;
+}
+
+#ifdef FEAT_BEVAL
+ static void
+bevalCB(
+ BalloonEval *beval,
+ int state)
+{
+ char_u *filename;
+ char_u *text;
+ int type;
+ int line;
+ int col;
+ int idx;
+ char buf[MAXPATHLEN * 2];
+ static int serialNo = -1;
+
+ if (!p_beval)
+ return;
+
+ if (gui_mch_get_beval_info(beval, &filename, &line, &text, &col) == OK)
+ {
+ if (text && text[0])
+ {
+ /* Send debugger request */
+ if (strlen((char *) text) > (MAXPATHLEN/2))
+ {
+ /*
+ * The user has probably selected the entire
+ * buffer or something like that - don't attempt
+ * to evaluate it
+ */
+ return;
+ }
+
+ /*
+ * WorkShop expects the col to be a character index, not
+ * a column number. Compute the index from col. Also set
+ * line to 0 because thats what dbx expects.
+ */
+ idx = computeIndex(col, text, beval->ts);
+ if (idx > 0)
+ {
+ line = 0;
+
+ /*
+ * If successful, it will respond with a balloon cmd.
+ */
+ if (state & ControlMask)
+ /* Evaluate *(expression) */
+ type = (int)GPLineEval_INDIRECT;
+ else if (state & ShiftMask)
+ /* Evaluate type(expression) */
+ type = (int)GPLineEval_TYPE;
+ else
+ /* Evaluate value(expression) */
+ type = (int)GPLineEval_EVALUATE;
+
+ /* Send request to dbx */
+ sprintf(buf, "toolVerb debug.balloonEval "
+ "%s %d,0 %d,0 %d,%d %d %s\n", (char *) filename,
+ line, idx, type, serialNo++,
+ strlen((char *) text), (char *) text);
+ balloonEval = beval;
+ workshop_send_message(buf);
+ }
+ }
+ }
+}
+#endif
+
+
+ static int
+computeIndex(
+ int wantedCol,
+ char_u *line,
+ int ts)
+{
+ int col = 0;
+ int idx = 0;
+
+ while (line[idx])
+ {
+ if (line[idx] == '\t')
+ col += ts - (col % ts);
+ else
+ col++;
+ idx++;
+ if (col >= wantedCol)
+ return idx;
+ }
+
+ return -1;
+}
+
+ static void
+addMenu(
+ char *menu, /* menu name */
+ char *accel, /* accelerator text (optional) */
+ char *verb) /* WorkShop action-verb */
+{
+ MenuMap *newMap;
+ char cbuf[BUFSIZ];
+
+ if (menuMapSize >= menuMapMax)
+ {
+ newMap = realloc(menuMap,
+ sizeof(MenuMap) * (menuMapMax + MENU_INC));
+ if (newMap != NULL)
+ {
+ menuMap = newMap;
+ menuMapMax += MENU_INC;
+ }
+ }
+ if (menuMapSize < menuMapMax)
+ {
+ menuMap[menuMapSize].name = strdup(menu);
+ menuMap[menuMapSize].accel = accel && *accel ? strdup(accel) : NULL;
+ menuMap[menuMapSize++].verb = strdup(verb);
+ if (accel && workshopHotKeysEnabled)
+ {
+ sprintf(cbuf, "map %s :wsverb %s<CR>", accel, verb);
+ coloncmd(cbuf, TRUE);
+ }
+ }
+}
+
+ static char *
+nameStrip(
+ char *raw) /* menu name, possibly with & chars */
+{
+ static char buf[BUFSIZ]; /* build stripped name here */
+ char *bp = buf;
+
+ while (*raw)
+ {
+ if (*raw != '&')
+ *bp++ = *raw;
+ raw++;
+ }
+ *bp = NUL;
+ return buf;
+}
+
+
+ static char *
+lookupVerb(
+ char *verb,
+ int skip) /* number of matches to skip */
+{
+ int i; /* loop iterator */
+
+ for (i = 0; i < menuMapSize; i++)
+ if (strcmp(menuMap[i].verb, verb) == 0 && skip-- == 0)
+ return nameStrip(menuMap[i].name);
+
+ return NULL;
+}
+
+
+ static void
+coloncmd(
+ char *cmd, /* the command to print */
+ Boolean force) /* force cursor update */
+{
+ char_u *cpo_save = p_cpo;
+
+#ifdef WSDEBUG
+ if (WSDLEVEL(WS_TRACE_COLONCMD))
+ wsdebug("Cmd: %s\n", cmd);
+#endif
+
+ p_cpo = empty_option;
+
+ ALT_INPUT_LOCK_ON;
+ do_cmdline_cmd((char_u *)cmd);
+ ALT_INPUT_LOCK_OFF;
+
+ p_cpo = cpo_save;
+
+ if (force)
+ gui_update_screen();
+}
+
+/*
+ * setDollarVim - Given the run directory, search for the vim install
+ * directory and set $VIM.
+ *
+ * We can be running out of SUNWspro/bin or out of
+ * SUNWspro/contrib/contrib6/vim5.6/bin so we check
+ * relative to both of these directories.
+ */
+ static void
+setDollarVim(
+ char *rundir)
+{
+ char buf[MAXPATHLEN];
+ char *cp;
+
+ /*
+ * First case: Running from <install-dir>/SUNWspro/bin
+ */
+ strcpy(buf, rundir);
+ strcat(buf, "/../contrib/contrib6/vim" VIM_VERSION_SHORT "/share/vim/"
+ VIM_VERSION_NODOT "/syntax/syntax.vim");
+ if (access(buf, R_OK) == 0)
+ {
+ strcpy(buf, "SPRO_WSDIR=");
+ strcat(buf, rundir);
+ cp = strrchr(buf, '/');
+ if (cp != NULL)
+ strcpy(cp, "/WS6U2");
+ putenv(strdup(buf));
+
+ strcpy(buf, "VIM=");
+ strcat(buf, rundir);
+ strcat(buf, "/../contrib/contrib6/vim" VIM_VERSION_SHORT "/share/vim/"
+ VIM_VERSION_NODOT);
+ putenv(strdup(buf));
+ return;
+ }
+
+ /*
+ * Second case: Probably running from
+ * <install-dir>/SUNWspro/contrib/contrib6/vim5.6/bin
+ */
+ strcpy(buf, rundir);
+ strcat(buf, "/../../../contrib/contrib6/vim" VIM_VERSION_SHORT
+ "/share/vim/" VIM_VERSION_NODOT "/syntax/syntax.vim");
+ if (access(buf, R_OK) == 0)
+ {
+ strcpy(buf, "SPRO_WSDIR=");
+ strcat(buf, rundir);
+ cp = strrchr(buf, '/');
+ if (cp != NULL)
+ strcpy(cp, "../../../../WS6U2");
+ putenv(strdup(buf));
+
+ strcpy(buf, "VIM=");
+ strcat(buf, rundir);
+ strcat(buf, "/../../../contrib/contrib6/vim" VIM_VERSION_SHORT
+ "/share/vim/" VIM_VERSION_NODOT);
+ putenv(strdup(buf));
+ return;
+ }
+}
+
+/*
+ * findYourself - Find the directory we are running from. This is used to
+ * set $VIM. We need to set this because users can install
+ * the package in a different directory than the compiled
+ * directory. This is a Sun Visual WorkShop requirement!
+ *
+ * Note: We override a user's $VIM because it won't have the
+ * WorkShop specific files. S/he may not like this but its
+ * better than getting the wrong files (especially as the
+ * user is likely to have $VIM set to 5.4 or later).
+ */
+ void
+findYourself(
+ char *argv0)
+{
+ char *runpath = NULL;
+ char *path;
+ char *pathbuf;
+
+ if (*argv0 == '/')
+ runpath = strdup(argv0);
+ else if (*argv0 == '.' || strchr(argv0, '/'))
+ {
+ runpath = (char *) malloc(MAXPATHLEN);
+ getcwd(runpath, MAXPATHLEN);
+ strcat(runpath, "/");
+ strcat(runpath, argv0);
+ }
+ else
+ {
+ path = getenv("PATH");
+ if (path != NULL)
+ {
+ runpath = (char *) malloc(MAXPATHLEN);
+ pathbuf = strdup(path);
+ path = strtok(pathbuf, ":");
+ do
+ {
+ strcpy(runpath, path);
+ strcat(runpath, "/");
+ strcat(runpath, argv0);
+ if (access(runpath, X_OK) == 0)
+ break;
+ } while ((path = strtok(NULL, ":")) != NULL);
+ free(pathbuf);
+ }
+ }
+
+ if (runpath != NULL)
+ {
+ char runbuf[MAXPATHLEN];
+
+ /*
+ * We found the run directory. Now find the install dir.
+ */
+ (void)vim_FullName((char_u *)runpath, (char_u *)runbuf, MAXPATHLEN, 1);
+ path = strrchr(runbuf, '/');
+ if (path != NULL)
+ *path = NUL; /* remove the vim/gvim name */
+ path = strrchr(runbuf, '/');
+ if (path != NULL)
+ {
+ if (strncmp(path, "/bin", 4) == 0)
+ setDollarVim(runbuf);
+ else if (strncmp(path, "/src", 4) == 0)
+ {
+ *path = NUL; /* development tree */
+ setDollarVim(runbuf);
+ }
+ }
+ free(runpath);
+ }
+}
diff --git a/src/workshop.h b/src/workshop.h
new file mode 100644
index 000000000..06b125720
--- /dev/null
+++ b/src/workshop.h
@@ -0,0 +1,28 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+#if !defined(WORKSHOP_H) && defined(FEAT_SUN_WORKSHOP)
+#define WORKSHOP_H
+
+#include <X11/Intrinsic.h>
+#include <Xm/Xm.h>
+
+#include "integration.h"
+
+#ifdef WSDEBUG
+# include "wsdebug.h"
+#else
+# ifndef ASSERT
+# define ASSERT(c)
+# endif
+#endif
+
+extern int usingSunWorkShop; /* set if -ws flag is used */
+
+#endif
diff --git a/src/wsdebug.c b/src/wsdebug.c
new file mode 100644
index 000000000..c3dba9931
--- /dev/null
+++ b/src/wsdebug.c
@@ -0,0 +1,179 @@
+/* vi:set ts=8 sts=8 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * WorkShop Debugging Tools. What are these tools and why are they important?
+ * There are two main tools here. The first tool is a tool for delaying or
+ * stopping gvim during startup. The second tool is a protocol log tool.
+ *
+ * The startup delay tool is called wsdebug_wait(). This is very important for
+ * debugging startup problems because gvim will be started automatically from
+ * workshop and cannot be run directly from a debugger. The only way to debug
+ * a gvim started by workshop is by attaching a debugger to it. Without this
+ * tool all starup code will have completed before you can get the pid and
+ * attach.
+ *
+ * The second tool is a protocol log tool. The workshop editor server and gvim
+ * pass information back and forth during a workshop session. Sometimes it is
+ * very important to peruse this conversation in order to understand what is
+ * happening. The wsdebug_log_init() call sets up this protocol log tool and
+ * wsdebug() and wstrace() calls output the information to the log.
+ *
+ * This code must have WSDEBUG defined for it to be compiled into vim/gvim.
+ */
+
+#ifdef WSDEBUG
+
+#include <stdarg.h>
+
+#include "vim.h"
+
+FILE *ws_debug = NULL;
+u_int ws_dlevel = 0; /* ws_debug verbosity level */
+
+void wsdebug(char *, ...);
+void wstrace(char *, ...);
+
+static int lookup(char *);
+static int errorHandler(Display *, XErrorEvent *);
+
+
+/*
+ * wsdebug_wait - This function can be used to delay or stop execution of vim.
+ * Its normally used to delay startup while attaching a
+ * debugger to a running process. Since workshop starts gvim
+ * from a background process this is the only way to debug
+ * startup problems.
+ */
+
+void wsdebug_wait(
+ u_int wait_flags, /* tells what to do */
+ char *wait_var, /* wait environment variable */
+ u_int wait_secs) /* how many seconds to wait */
+{
+
+ init_homedir(); /* not inited yet */
+#ifdef USE_WDDUMP
+ WDDump(0, 0, 0);
+#endif
+
+ /* for debugging purposes only */
+ if (wait_flags & WT_ENV && wait_var && getenv(wait_var) != NULL) {
+ sleep(atoi(getenv(wait_var)));
+ } else if (wait_flags & WT_WAIT && lookup("~/.gvimwait")) {
+ sleep(wait_secs > 0 && wait_secs < 120 ? wait_secs : 20);
+ } else if (wait_flags & WT_STOP && lookup("~/.gvimstop")) {
+ int w = 1;
+ while (w) {
+ ;
+ }
+ }
+} /* end wsdebug_wait */
+
+
+void
+wsdebug_log_init(
+ char *log_var, /* env var with log file */
+ char *level_var) /* env var with ws_debug level */
+{
+ char *file; /* possible ws_debug output file */
+ char *cp; /* ws_dlevel pointer */
+
+ if (log_var && (file = getenv(log_var)) != NULL) {
+ char buf[BUFSIZ];
+
+ sprintf(buf, "date > %s", file);
+ system(buf);
+ ws_debug = fopen(file, "a");
+ if (level_var && (cp = getenv(level_var)) != NULL) {
+ ws_dlevel = strtoul(cp, NULL, 0);
+ } else {
+ ws_dlevel = WS_TRACE; /* default level */
+ }
+ /* XSetErrorHandler(errorHandler); */
+ }
+
+} /* end wsdebug_log_init */
+
+
+
+
+void
+wstrace(
+ char *fmt,
+ ...)
+{
+ va_list ap;
+
+ if (ws_debug!= NULL && (ws_dlevel & (WS_TRACE | WS_TRACE_VERBOSE))) {
+ va_start(ap, fmt);
+ vfprintf(ws_debug, fmt, ap);
+ va_end(ap);
+ fflush(ws_debug);
+ }
+
+} /* end wstrace */
+
+
+void
+wsdebug(
+ char *fmt,
+ ...)
+{
+ va_list ap;
+
+ if (ws_debug != NULL) {
+ va_start(ap, fmt);
+ vfprintf(ws_debug, fmt, ap);
+ va_end(ap);
+ fflush(ws_debug);
+ }
+
+} /* end wsdebug */
+
+
+static int
+lookup(
+ char *file)
+{
+ char buf[BUFSIZ];
+
+ expand_env((char_u *) file, (char_u *) buf, BUFSIZ);
+ return (access(buf, F_OK) == 0);
+
+} /* end lookup */
+
+static int
+errorHandler(
+ Display *dpy,
+ XErrorEvent *err)
+{
+ char msg[256];
+ char buf[256];
+
+ XGetErrorText(dpy, err->error_code, msg, sizeof(msg));
+ wsdebug("\n\nWSDEBUG Vim: X Error of failed request: %s\n", msg);
+
+ sprintf(buf, "%d", err->request_code);
+ XGetErrorDatabaseText(dpy,
+ "XRequest", buf, "Unknown", msg, sizeof(msg));
+ wsdebug("\tMajor opcode of failed request: %d (%s)\n",
+ err->request_code, msg);
+ if (err->request_code > 128) {
+ wsdebug("\tMinor opcode of failed request: %d\n",
+ err->minor_code);
+ }
+
+ return 0;
+}
+
+
+
+#endif /* WSDEBUG */
diff --git a/src/wsdebug.h b/src/wsdebug.h
new file mode 100644
index 000000000..03da5697c
--- /dev/null
+++ b/src/wsdebug.h
@@ -0,0 +1,81 @@
+/* vi:set ts=8 sts=8 sw=8:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ * Visual Workshop integration by Gordon Prieur
+ *
+ * Do ":help uganda" in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ */
+
+
+#ifndef WSDEBUG_H
+#define WSDEBUG_H
+
+#ifdef WSDEBUG
+
+#ifndef ASSERT
+#define ASSERT(c) \
+ if (!(c)) { \
+ fprintf(stderr, "Assertion failed: line %d, file %s\n", \
+ __LINE__, __FILE__); \
+ fflush(stderr); \
+ abort(); \
+ }
+#endif
+
+#define WS_TRACE 0x00000001
+#define WS_TRACE_VERBOSE 0x00000002
+#define WS_TRACE_COLONCMD 0x00000004
+#define WS_DEBUG_ALL 0xffffffff
+
+#define WSDLEVEL(flags) (ws_debug != NULL && (ws_dlevel & (flags)))
+
+#ifdef USE_WDDUMP
+#include "wdump.h"
+#endif
+
+#define WSDEBUG_TRACE 1
+//#define WSDEBUG_SENSE 2
+
+typedef enum {
+ WT_ENV = 1, /* look for env var if set */
+ WT_WAIT, /* look for ~/.gvimwait if set */
+ WT_STOP /* look for ~/.gvimstop if set */
+} WtWait;
+
+
+void wsdebug(char *, ...);
+void wstrace(char *, ...);
+
+
+extern FILE *ws_debug;
+extern u_int ws_dlevel; /* ws_debug verbosity level */
+
+# else /* not WSDEBUG */
+
+#ifndef ASSERT
+# define ASSERT(c)
+#endif
+
+/*
+ * The following 2 stubs are needed because a macro cannot be used because of
+ * the variable number of arguments.
+ */
+
+void
+wsdebug(
+ char *fmt,
+ ...)
+{
+}
+
+
+void
+wstrace(
+ char *fmt,
+ ...)
+{
+}
+
+#endif /* WSDEBUG */
+#endif /* WSDEBUG_H */
diff --git a/src/xpm_w32.c b/src/xpm_w32.c
new file mode 100644
index 000000000..45765e1f1
--- /dev/null
+++ b/src/xpm_w32.c
@@ -0,0 +1,60 @@
+/*
+ * Load XPM image.
+ *
+ * This function is placed in separate file because Xpm headers conflict with
+ * Vim ones :(
+ *
+ * Written by Sergey Khorev.
+ * http://iamphet.nm.ru/vim/index.html
+ */
+
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+
+/* reduced def from Vim.h */
+#ifndef __ARGS
+# if defined(__STDC__) || defined(__GNUC__) || defined(WIN3264)
+# define __ARGS(x) x
+# else
+# define __ARGS(x) ()
+# endif
+#endif
+
+#include "xpm_w32.h"
+
+/* Engage Windows support in libXpm */
+#define FOR_MSW
+
+#include "xpm.h"
+
+/*
+ * Tries to load Xpm image from file 'filename'.
+ * If fails return -1.
+ * success - 0 and image and mask BITMAPS
+ */
+ int
+LoadXpmImage(filename, hImage, hShape)
+ char *filename;
+ HBITMAP *hImage;
+ HBITMAP *hShape;
+{
+ XImage *img; /* loaded image */
+ XImage *shp; /* shapeimage */
+ XpmAttributes attr;
+ int res;
+ HDC hdc = CreateCompatibleDC(NULL);
+
+ attr.valuemask = 0;
+ res = XpmReadFileToImage(&hdc, filename, &img, &shp, &attr);
+ DeleteDC(hdc);
+ if (res < 0)
+ return -1;
+ else
+ {
+ *hImage = img->bitmap;
+ *hShape = shp->bitmap;
+ return 0;
+ }
+}
diff --git a/src/xpm_w32.h b/src/xpm_w32.h
new file mode 100644
index 000000000..3fe447586
--- /dev/null
+++ b/src/xpm_w32.h
@@ -0,0 +1,7 @@
+/*
+ * Header file for xpm_w32.c
+ */
+
+#ifndef XPM_W32__H
+int LoadXpmImage __ARGS((char *filename, HBITMAP *hImage, HBITMAP *hShape));
+#endif
diff --git a/src/xxd/Make_amiga.mak b/src/xxd/Make_amiga.mak
new file mode 100644
index 000000000..be382027b
--- /dev/null
+++ b/src/xxd/Make_amiga.mak
@@ -0,0 +1,18 @@
+# Makefile for xxd on the Amiga, using Aztec/Manx C 5.0 or later
+#
+
+#>>>>> choose between debugging (-bs) or optimizing (-so)
+OPTIONS = -so
+#OPTIONS = -bs
+
+#>>>>>> choose -g for debugging
+LN_DEBUG =
+#LN_DEBUG = -g
+
+CFLAGS = $(OPTIONS) -wapruq -ps -qf -DAMIGA -Dconst=
+
+Xxd: xxd.o
+ ln +q -m $(LN_DEBUG) -o Xxd xxd.o -lc16
+
+xxd.o: xxd.c
+ cc $(CFLAGS) xxd.c -o xxd.o
diff --git a/src/xxd/Make_bc3.mak b/src/xxd/Make_bc3.mak
new file mode 100644
index 000000000..dee252171
--- /dev/null
+++ b/src/xxd/Make_bc3.mak
@@ -0,0 +1,31 @@
+# Simple makefile for Borland C++ 4.0
+# 3.1 can NOT be used, it has problems with the fileno() define.
+
+# Command line variables:
+# BOR path to root of Borland C (E:\BORLANDC)
+# DEBUG set to "yes" for debugging (no)
+
+!ifndef BOR
+BOR = e:\bc4
+!endif
+
+!if ("$(DEBUG)" == "yes")
+DEBUG_FLAG = -v -DDEBUG
+!else
+DEBUG_FLAG =
+!endif
+
+CC = $(BOR)\bin\bcc
+INC = -I$(BOR)\include
+LIB = -L$(BOR)\lib
+
+# The following compile options can be changed for better machines.
+# replace -1- with -2 to produce code for a 80286 or higher
+# replace -1- with -3 to produce code for a 80386 or higher
+# add -v for source debugging
+OPTIMIZE= -1- -Ox
+
+CFLAGS = -A -mc -DMSDOS $(DEBUG_FLAG) $(OPTIMIZE) $(INC) $(LIB)
+
+xxd.exe: xxd.c
+ $(CC) $(CFLAGS) xxd.c
diff --git a/src/xxd/Make_bc5.mak b/src/xxd/Make_bc5.mak
new file mode 100644
index 000000000..4f446223e
--- /dev/null
+++ b/src/xxd/Make_bc5.mak
@@ -0,0 +1,18 @@
+# The most simplistic Makefile for Win32 (NT and Windows 95).
+# Used for Borland C++.
+
+!if ("$(BOR)"=="")
+BOR = c:\bc5
+!endif
+!if ("$(BCC)"=="")
+BCC = bcc32
+!endif
+
+xxd: xxd.exe
+
+xxd.exe: xxd.c
+ $(BCC) -I$(BOR)\include -L$(BOR)\lib -DWIN32 xxd.c $(BOR)\lib\wildargs.obj
+
+clean:
+ - del xxd.obj
+ - del xxd.exe
diff --git a/src/xxd/Make_cyg.mak b/src/xxd/Make_cyg.mak
new file mode 100644
index 000000000..f04b7bfde
--- /dev/null
+++ b/src/xxd/Make_cyg.mak
@@ -0,0 +1,27 @@
+# The most simplistic Makefile, for Cygnus gcc on MS-DOS
+
+ifndef USEDLL
+USEDLL = no
+endif
+
+ifeq (yes, $(USEDLL))
+DEFINES =
+LIBS = -lc
+else
+DEFINES = -mno-cygwin
+LIBS =
+endif
+
+CFLAGS = -O2 -Wall -DWIN32 $(DEFINES)
+
+ifneq (sh.exe, $(SHELL))
+DEL = rm
+else
+DEL = del
+endif
+
+xxd.exe: xxd.c
+ gcc $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
+
+clean:
+ -$(DEL) xxd.exe
diff --git a/src/xxd/Make_djg.mak b/src/xxd/Make_djg.mak
new file mode 100644
index 000000000..f6eed3130
--- /dev/null
+++ b/src/xxd/Make_djg.mak
@@ -0,0 +1,9 @@
+# The most simplistic Makefile, for DJGPP on MS-DOS
+
+CFLAGS = -O2 -Wall
+
+xxd.exe: xxd.c
+ gcc $(CFLAGS) -s -o xxd.exe xxd.c -lpc
+
+clean:
+ del xxd.exe
diff --git a/src/xxd/Make_mvc.mak b/src/xxd/Make_mvc.mak
new file mode 100644
index 000000000..0c9438aa1
--- /dev/null
+++ b/src/xxd/Make_mvc.mak
@@ -0,0 +1,11 @@
+# The most simplistic Makefile for Win32 using Microsoft Visual C++
+# (NT and Windows 95)
+
+xxd: xxd.exe
+
+xxd.exe: xxd.c
+ cl /nologo -DWIN32 xxd.c /link setargv.obj
+
+clean:
+ - if exist xxd.obj del xxd.obj
+ - if exist xxd.exe del xxd.exe
diff --git a/src/xxd/Make_os2.mak b/src/xxd/Make_os2.mak
new file mode 100644
index 000000000..cb6694e1c
--- /dev/null
+++ b/src/xxd/Make_os2.mak
@@ -0,0 +1,11 @@
+# A very (if most the most) simplistic Makefile for OS/2
+
+CC=gcc
+CFLAGS=-O2 -fno-strength-reduce -DOS2
+
+xxd.exe: xxd.c
+ $(CC) $(CFLAGS) -s -o $@ $<
+
+clean:
+ - del xxd.o
+ - del xxd.exe
diff --git a/src/xxd/Make_vms.mms b/src/xxd/Make_vms.mms
new file mode 100644
index 000000000..872cd75f7
--- /dev/null
+++ b/src/xxd/Make_vms.mms
@@ -0,0 +1,69 @@
+# VMS MM[KS] makefile for XXD
+# tested with MMK and MMS as well.
+#
+# Maintained by Zoltan Arpadffy <arpadffy@polarhome.com>
+#
+# Edit the lines in the Configuration section below to select.
+#
+# To build: use the following command line:
+#
+# mms/descrip=Make_vms.mms
+# or if you use mmk
+# mmk/descrip=Make_vms.mms
+#
+
+######################################################################
+# Configuration section.
+######################################################################
+# Compiler selection.
+# Comment out if you use the VAXC compiler
+######################################################################
+# DECC = YES
+
+#####################################################################
+# Uncomment if want a debug version. Resulting executable is DVIM.EXE
+######################################################################
+# DEBUG = YES
+
+######################################################################
+# End of configuration section.
+#
+# Please, do not change anything below without programming experience.
+######################################################################
+
+CC = cc
+
+.IFDEF DECC
+CC_DEF = $(CC)/decc
+PREFIX = /prefix=all
+.ELSE
+CC_DEF = $(CC)
+PREFIX =
+.ENDIF
+
+LD_DEF = link
+
+.IFDEF DEBUG
+TARGET = dxxd.exe
+CFLAGS = /debug/noopt$(PREFIX)/cross_reference/include=[]
+LDFLAGS = /debug
+.ELSE
+TARGET = xxd.exe
+CFLAGS = /opt$(PREFIX)/include=[]
+LDFLAGS =
+.ENDIF
+
+.SUFFIXES : .obj .c
+
+SOURCES = xxd.c
+OBJ = xxd.obj
+
+.obj.c :
+ $(CC_DEF) $(CFLAGS) $<
+
+$(TARGET) : $(OBJ)
+ $(LD_DEF) $(LDFLAGS) /exe=$(TARGET) $+
+
+clean :
+ -@ if "''F$SEARCH("*.obj")'" .NES. "" then delete/noconfirm/nolog *.obj;*
+ -@ if "''F$SEARCH("*.exe")'" .NES. "" then delete/noconfirm/nolog *.exe;*
diff --git a/src/xxd/Makefile b/src/xxd/Makefile
new file mode 100644
index 000000000..97bbcc77b
--- /dev/null
+++ b/src/xxd/Makefile
@@ -0,0 +1,7 @@
+# The most simplistic Makefile
+
+xxd: xxd.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -DUNIX -o xxd xxd.c
+
+clean:
+ rm -f xxd xxd.o
diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c
new file mode 100644
index 000000000..499f76244
--- /dev/null
+++ b/src/xxd/xxd.c
@@ -0,0 +1,767 @@
+/* xxd: my hexdump facility. jw
+ *
+ * 2.10.90 changed to word output
+ * 3.03.93 new indent style, dumb bug inserted and fixed.
+ * -c option, mls
+ * 26.04.94 better option parser, -ps, -l, -s added.
+ * 1.07.94 -r badly needs - as input file. Per default autoskip over
+ * consequtive lines of zeroes, as unix od does.
+ * -a shows them too.
+ * -i dump as c-style #include "file.h"
+ * 1.11.95 if "xxd -i" knows the filename, an 'unsigned char filename_bits[]'
+ * array is written in correct c-syntax.
+ * -s improved, now defaults to absolute seek, relative requires a '+'.
+ * -r improved, now -r -s -0x... is supported.
+ * change/suppress leading '\0' bytes.
+ * -l n improved: stops exactly after n bytes.
+ * -r improved, better handling of partial lines with trailing garbage.
+ * -r improved, now -r -p works again!
+ * -r improved, less flushing, much faster now! (that was silly)
+ * 3.04.96 Per repeated request of a single person: autoskip defaults to off.
+ * 15.05.96 -v added. They want to know the version.
+ * -a fixed, to show last line inf file ends in all zeros.
+ * -u added: Print upper case hex-letters, as preferred by unix bc.
+ * -h added to usage message. Usage message extended.
+ * Now using outfile if specified even in normal mode, aehem.
+ * No longer mixing of ints and longs. May help doze people.
+ * Added binify ioctl for same reason. (Enough Doze stress for 1996!)
+ * 16.05.96 -p improved, removed occasional superfluous linefeed.
+ * 20.05.96 -l 0 fixed. tried to read anyway.
+ * 21.05.96 -i fixed. now honours -u, and prepends __ to numeric filenames.
+ * compile -DWIN32 for NT or W95. George V. Reilly, * -v improved :-)
+ * support --gnuish-longhorn-options
+ * 25.05.96 MAC support added: CodeWarrior already uses ``outline'' in Types.h
+ * which is included by MacHeaders (Axel Kielhorn). Renamed to
+ * xxdline().
+ * 7.06.96 -i printed 'int' instead of 'char'. *blush*
+ * added Bram's OS2 ifdefs...
+ * 18.07.96 gcc -Wall @ SunOS4 is now slient.
+ * Added osver for MSDOS/DJGPP/WIN32.
+ * 29.08.96 Added size_t to strncmp() for Amiga.
+ * 24.03.97 Windows NT support (Phil Hanna). Clean exit for Amiga WB (Bram)
+ * 02.04.97 Added -E option, to have EBCDIC translation instead of ASCII
+ * (antonio.colombo@jrc.it)
+ * 22.05.97 added -g (group octets) option (jcook@namerica.kla.com).
+ * 23.09.98 nasty -p -r misfeature fixed: slightly wrong output, when -c was
+ * missing or wrong.
+ * 26.09.98 Fixed: 'xxd -i infile outfile' did not truncate outfile.
+ * 27.10.98 Fixed: -g option parser required blank.
+ * option -b added: 01000101 binary output in normal format.
+ * 16.05.00 Added VAXC changes by Stephen P. Wall
+ * 16.05.00 Improved MMS file and merege for VMS by Zoltan Arpadffy
+ *
+ * (c) 1990-1998 by Juergen Weigert (jnweiger@informatik.uni-erlangen.de)
+ *
+ * Small changes made afterwards by Bram Moolenaar et al.
+ *
+ * Distribute freely and credit me,
+ * make money and share with me,
+ * lose money and don't ask me.
+ */
+#include <stdio.h>
+#ifdef VAXC
+# include <file.h>
+#else
+# include <fcntl.h>
+#endif
+#ifdef __TSC__
+# define MSDOS
+#endif
+#if !defined(OS2) && defined(__EMX__)
+# define OS2
+#endif
+#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(__BORLANDC__)
+# include <io.h> /* for setmode() */
+#else
+# ifdef UNIX
+# include <unistd.h>
+# endif
+#endif
+#include <stdlib.h>
+#include <string.h> /* for strncmp() */
+#include <ctype.h> /* for isalnum() */
+#if __MWERKS__ && !defined(BEBOX)
+# include <unix.h> /* for fdopen() on MAC */
+#endif
+
+#if defined(__BORLANDC__) && __BORLANDC__ <= 0x0410 && !defined(fileno)
+/* Missing define and prototype grabbed from the BC 4.0 <stdio.h> */
+# define fileno(f) ((f)->fd)
+FILE _FAR *_Cdecl _FARFUNC fdopen(int __handle, char _FAR *__type);
+#endif
+
+
+/* This corrects the problem of missing prototypes for certain functions
+ * in some GNU installations (e.g. SunOS 4.1.x).
+ * Darren Hiebert <darren@hmi.com> (sparc-sun-sunos4.1.3_U1/2.7.2.2)
+ */
+#if defined(__GNUC__) && defined(__STDC__)
+# ifndef __USE_FIXED_PROTOTYPES__
+# define __USE_FIXED_PROTOTYPES__
+# endif
+#endif
+
+#ifndef __USE_FIXED_PROTOTYPES__
+/*
+ * This is historic and works only if the compiler really has no prototypes:
+ *
+ * Include prototypes for Sun OS 4.x, when using an ANSI compiler.
+ * FILE is defined on OS 4.x, not on 5.x (Solaris).
+ * if __SVR4 is defined (some Solaris versions), don't include this.
+ */
+#if defined(sun) && defined(FILE) && !defined(__SVR4) && defined(__STDC__)
+# define __P(a) a
+/* excerpt from my sun_stdlib.h */
+extern int fprintf __P((FILE *, char *, ...));
+extern int fputs __P((char *, FILE *));
+extern int _flsbuf __P((unsigned char, FILE *));
+extern int _filbuf __P((FILE *));
+extern int fflush __P((FILE *));
+extern int fclose __P((FILE *));
+extern int fseek __P((FILE *, long, int));
+extern int rewind __P((FILE *));
+
+extern void perror __P((char *));
+# endif
+#endif
+
+extern long int strtol();
+extern long int ftell();
+
+char version[] = "xxd V1.10 27oct98 by Juergen Weigert";
+#ifdef WIN32
+char osver[] = " (Win32)";
+#else
+# ifdef DJGPP
+char osver[] = " (dos 32 bit)";
+# else
+# ifdef MSDOS
+char osver[] = " (dos 16 bit)";
+# else
+char osver[] = "";
+# endif
+# endif
+#endif
+
+#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__))
+# define CYGWIN
+#endif
+#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(CYGWIN)
+# define BIN_READ(yes) ((yes) ? "rb" : "rt")
+# define BIN_WRITE(yes) ((yes) ? "wb" : "wt")
+# define BIN_CREAT(yes) ((yes) ? (O_CREAT|O_BINARY) : O_CREAT)
+# define BIN_ASSIGN(fp, yes) setmode(fileno(fp), (yes) ? O_BINARY : O_TEXT)
+# if defined(CYGWIN)
+# define PATH_SEP '/'
+# else
+# define PATH_SEP '\\'
+# endif
+#else
+# ifdef VMS
+# define BIN_READ(dummy) "r"
+# define BIN_WRITE(dummy) "w"
+# define BIN_CREAT(dummy) O_CREAT
+# define BIN_ASSIGN(fp, dummy) fp
+# define PATH_SEP ']'
+# define FILE_SEP '.'
+# else
+# define BIN_READ(dummy) "r"
+# define BIN_WRITE(dummy) "w"
+# define BIN_CREAT(dummy) O_CREAT
+# define BIN_ASSIGN(fp, dummy) fp
+# define PATH_SEP '/'
+# endif
+#endif
+
+/* open has only to arguments on the Mac */
+#if __MWERKS__
+# define OPEN(name, mode, umask) open(name, mode)
+#else
+# define OPEN(name, mode, umask) open(name, mode, umask)
+#endif
+
+#ifdef AMIGA
+# define STRNCMP(s1, s2, l) strncmp(s1, s2, (size_t)l)
+#else
+# define STRNCMP(s1, s2, l) strncmp(s1, s2, l)
+#endif
+
+#ifndef __P
+# if defined(__STDC__) || defined(MSDOS) || defined(WIN32) || defined(OS2) \
+ || defined(__BORLANDC__)
+# define __P(a) a
+# else
+# define __P(a) ()
+# endif
+#endif
+
+/* Let's collect some prototypes */
+/* CodeWarrior is really picky about missing prototypes */
+static void exit_with_usage __P((char *));
+static int huntype __P((FILE *, FILE *, FILE *, char *, int, int, long));
+static void xxdline __P((FILE *, char *, int));
+
+#define TRY_SEEK /* attempt to use lseek, or skip forward by reading */
+#define COLS 256 /* change here, if you ever need more columns */
+#define LLEN (9 + (5*COLS-1)/2 + 2 + COLS)
+
+char hexxa[] = "0123456789abcdef0123456789ABCDEF", *hexx = hexxa;
+
+/* the different hextypes known by this program: */
+#define HEX_NORMAL 0
+#define HEX_POSTSCRIPT 1
+#define HEX_CINCLUDE 2
+#define HEX_BITS 3 /* not hex a dump, but bits: 01111001 */
+
+static void
+exit_with_usage(pname)
+char *pname;
+{
+ fprintf(stderr, "Usage:\n %s [options] [infile [outfile]]\n", pname);
+ fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
+ fprintf(stderr, "Options:\n");
+ fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
+ fprintf(stderr, " -b binary digit dump (incompatible with -p,-i,-r). Default hex.\n");
+ fprintf(stderr, " -c cols format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
+ fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n");
+ fprintf(stderr, " -g number of octets per group in normal output. Default 2.\n");
+ fprintf(stderr, " -h print this summary.\n");
+ fprintf(stderr, " -i output in C include file style.\n");
+ fprintf(stderr, " -l len stop after <len> octets.\n");
+ fprintf(stderr, " -ps output in postscript plain hexdump style.\n");
+ fprintf(stderr, " -r reverse operation: convert (or patch) hexdump into binary.\n");
+ fprintf(stderr, " -r -s off revert with <off> added to file positions found in hexdump.\n");
+ fprintf(stderr, " -s %sseek start at <seek> bytes abs. %sinfile offset.\n",
+#ifdef TRY_SEEK
+ "[+][-]", "(or +: rel.) ");
+#else
+ "", "");
+#endif
+ fprintf(stderr, " -u use upper case hex letters.\n");
+ fprintf(stderr, " -v show version: \"%s%s\".\n", version, osver);
+ exit(1);
+}
+
+/*
+ * Max. cols binary characters are decoded from the input stream per line.
+ * Two adjacent garbage characters after evaluated data delimit valid data.
+ * Everything up to the next newline is discarded.
+ *
+ * The name is historic and came from 'undo type opt h'.
+ */
+static int
+huntype(fpi, fpo, fperr, pname, cols, hextype, base_off)
+FILE *fpi, *fpo, *fperr;
+char *pname;
+int cols, hextype;
+long base_off;
+{
+ int c, ign_garb = 1, n1 = -1, n2 = 0, n3, p = cols;
+ long have_off = 0, want_off = 0;
+
+ rewind(fpi);
+
+ while ((c = getc(fpi)) != EOF)
+ {
+ if (c == '\r') /* Doze style input file? */
+ continue;
+
+ n3 = n2;
+ n2 = n1;
+
+ if (c >= '0' && c <= '9')
+ n1 = c - '0';
+ else if (c >= 'a' && c <= 'f')
+ n1 = c - 'a' + 10;
+ else if (c >= 'A' && c <= 'F')
+ n1 = c - 'A' + 10;
+ else
+ {
+ n1 = -1;
+ if (ign_garb)
+ continue;
+ }
+
+ ign_garb = 0;
+
+ if (p >= cols)
+ {
+ if (!hextype)
+ {
+ if (n1 < 0)
+ {
+ p = 0;
+ continue;
+ }
+ want_off = (want_off << 4) | n1;
+ continue;
+ }
+ else
+ p = 0;
+ }
+
+ if (base_off + want_off != have_off)
+ {
+ fflush(fpo);
+#ifdef TRY_SEEK
+ c = fseek(fpo, base_off + want_off - have_off, 1);
+ if (c >= 0)
+ have_off = base_off + want_off;
+#endif
+ if (base_off + want_off < have_off)
+ {
+ fprintf(fperr, "%s: sorry, cannot seek backwards.\n", pname);
+ return 5;
+ }
+ for (; have_off < base_off + want_off; have_off++)
+ putc(0, fpo);
+ }
+
+ if (n2 >= 0 && n1 >= 0)
+ {
+ putc((n2 << 4) | n1, fpo);
+ have_off++;
+ want_off++;
+ n1 = -1;
+ if ((++p >= cols) && !hextype)
+ {
+ /* skip rest of line as garbaga */
+ want_off = 0;
+ while ((c = getc(fpi)) != '\n' && c != EOF)
+ ;
+ ign_garb = 1;
+ }
+ }
+ else if (n1 < 0 && n2 < 0 && n3 < 0)
+ {
+ /* already stumbled into garbage, skip line, wait and see */
+ if (!hextype)
+ want_off = 0;
+ while ((c = getc(fpi)) != '\n' && c != EOF)
+ ;
+ ign_garb = 1;
+ }
+ }
+ fflush(fpo);
+#ifdef TRY_SEEK
+ fseek(fpo, 0L, 2);
+#endif
+ fclose(fpo);
+ fclose(fpi);
+ return 0;
+}
+
+/*
+ * Print line l. If nz is false, xxdline regards the line a line of
+ * zeroes. If there are three or more consecutive lines of zeroes,
+ * they are replaced by a single '*' character.
+ *
+ * If the output ends with more than two lines of zeroes, you
+ * should call xxdline again with l being the last line and nz
+ * negative. This ensures that the last line is shown even when
+ * it is all zeroes.
+ *
+ * If nz is always positive, lines are never suppressed.
+ */
+static void
+xxdline(fp, l, nz)
+FILE *fp;
+char *l;
+int nz;
+{
+ static char z[LLEN+1];
+ static int zero_seen = 0;
+
+ if (!nz && zero_seen == 1)
+ strcpy(z, l);
+
+ if (nz || !zero_seen++)
+ {
+ if (nz)
+ {
+ if (nz < 0)
+ zero_seen--;
+ if (zero_seen == 2)
+ fputs(z, fp);
+ if (zero_seen > 2)
+ fputs("*\n", fp);
+ }
+ if (nz >= 0 || zero_seen > 0)
+ fputs(l, fp);
+ if (nz)
+ zero_seen = 0;
+ }
+}
+
+/* This is an EBCDIC to ASCII conversion table */
+/* from a proposed BTL standard April 16, 1979 */
+static unsigned char etoa64[] =
+{
+ 0040,0240,0241,0242,0243,0244,0245,0246,
+ 0247,0250,0325,0056,0074,0050,0053,0174,
+ 0046,0251,0252,0253,0254,0255,0256,0257,
+ 0260,0261,0041,0044,0052,0051,0073,0176,
+ 0055,0057,0262,0263,0264,0265,0266,0267,
+ 0270,0271,0313,0054,0045,0137,0076,0077,
+ 0272,0273,0274,0275,0276,0277,0300,0301,
+ 0302,0140,0072,0043,0100,0047,0075,0042,
+ 0303,0141,0142,0143,0144,0145,0146,0147,
+ 0150,0151,0304,0305,0306,0307,0310,0311,
+ 0312,0152,0153,0154,0155,0156,0157,0160,
+ 0161,0162,0136,0314,0315,0316,0317,0320,
+ 0321,0345,0163,0164,0165,0166,0167,0170,
+ 0171,0172,0322,0323,0324,0133,0326,0327,
+ 0330,0331,0332,0333,0334,0335,0336,0337,
+ 0340,0341,0342,0343,0344,0135,0346,0347,
+ 0173,0101,0102,0103,0104,0105,0106,0107,
+ 0110,0111,0350,0351,0352,0353,0354,0355,
+ 0175,0112,0113,0114,0115,0116,0117,0120,
+ 0121,0122,0356,0357,0360,0361,0362,0363,
+ 0134,0237,0123,0124,0125,0126,0127,0130,
+ 0131,0132,0364,0365,0366,0367,0370,0371,
+ 0060,0061,0062,0063,0064,0065,0066,0067,
+ 0070,0071,0372,0373,0374,0375,0376,0377
+};
+
+int
+main(argc, argv)
+int argc;
+char *argv[];
+{
+ FILE *fp, *fpo;
+ int c, e, p = 0, relseek = 1, negseek = 0, revert = 0;
+ int cols = 0, nonzero = 0, autoskip = 0, hextype = HEX_NORMAL;
+ int ebcdic = 0;
+ int octspergrp = -1; /* number of octets grouped in output */
+ int grplen; /* total chars per octet group */
+ long length = -1, n = 0, seekoff = 0;
+ char l[LLEN+1];
+ char *pname, *pp;
+
+#ifdef AMIGA
+ /* This program doesn't work when started from the Workbench */
+ if (argc == 0)
+ exit(1);
+#endif
+
+ pname = argv[0];
+ for (pp = pname; *pp; )
+ if (*pp++ == PATH_SEP)
+ pname = pp;
+#ifdef FILE_SEP
+ for (pp = pname; *pp; pp++)
+ if (*pp == FILE_SEP)
+ {
+ *pp = '\0';
+ break;
+ }
+#endif
+
+ while (argc >= 2)
+ {
+ pp = argv[1] + (!STRNCMP(argv[1], "--", 2) && argv[1][2]);
+ if (!STRNCMP(pp, "-a", 2)) autoskip = 1 - autoskip;
+ else if (!STRNCMP(pp, "-b", 2)) hextype = HEX_BITS;
+ else if (!STRNCMP(pp, "-u", 2)) hexx = hexxa + 16;
+ else if (!STRNCMP(pp, "-p", 2)) hextype = HEX_POSTSCRIPT;
+ else if (!STRNCMP(pp, "-i", 2)) hextype = HEX_CINCLUDE;
+ else if (!STRNCMP(pp, "-r", 2)) revert++;
+ else if (!STRNCMP(pp, "-E", 2)) ebcdic++;
+ else if (!STRNCMP(pp, "-v", 2))
+ {
+ fprintf(stderr, "%s%s\n", version, osver);
+ exit(0);
+ }
+ else if (!STRNCMP(pp, "-c", 2))
+ {
+ if (pp[2] && STRNCMP("ols", pp + 2, 3))
+ cols = (int)strtol(pp + 2, NULL, 0);
+ else
+ {
+ if (!argv[2])
+ exit_with_usage(pname);
+ cols = (int)strtol(argv[2], NULL, 0);
+ argv++;
+ argc--;
+ }
+ }
+ else if (!STRNCMP(pp, "-g", 2))
+ {
+ if (pp[2] && STRNCMP("group", pp + 2, 5))
+ octspergrp = (int)strtol(pp + 2, NULL, 0);
+ else
+ {
+ if (!argv[2])
+ exit_with_usage(pname);
+ octspergrp = (int)strtol(argv[2], NULL, 0);
+ argv++;
+ argc--;
+ }
+ }
+ else if (!STRNCMP(pp, "-s", 2))
+ {
+ relseek = 0;
+ negseek = 0;
+ if (pp[2] && STRNCMP("kip", pp+2, 3) && STRNCMP("eek", pp+2, 3))
+ {
+#ifdef TRY_SEEK
+ if (pp[2] == '+')
+ relseek++;
+ if (pp[2+relseek] == '-')
+ negseek++;
+#endif
+ seekoff = strtol(pp + 2+relseek+negseek, (char **)NULL, 0);
+ }
+ else
+ {
+ if (!argv[2])
+ exit_with_usage(pname);
+#ifdef TRY_SEEK
+ if (argv[2][0] == '+')
+ relseek++;
+ if (argv[2][relseek] == '-')
+ negseek++;
+#endif
+ seekoff = strtol(argv[2] + relseek+negseek, (char **)NULL, 0);
+ argv++;
+ argc--;
+ }
+ }
+ else if (!STRNCMP(pp, "-l", 2))
+ {
+ if (pp[2] && STRNCMP("en", pp + 2, 2))
+ length = strtol(pp + 2, (char **)NULL, 0);
+ else
+ {
+ if (!argv[2])
+ exit_with_usage(pname);
+ length = strtol(argv[2], (char **)NULL, 0);
+ argv++;
+ argc--;
+ }
+ }
+ else if (!strcmp(pp, "--")) /* end of options */
+ {
+ argv++;
+ argc--;
+ break;
+ }
+ else if (pp[0] == '-' && pp[1]) /* unknown option */
+ exit_with_usage(pname);
+ else
+ break; /* not an option */
+
+ argv++; /* advance to next argument */
+ argc--;
+ }
+
+ if (!cols)
+ switch (hextype)
+ {
+ case HEX_POSTSCRIPT: cols = 30; break;
+ case HEX_CINCLUDE: cols = 12; break;
+ case HEX_BITS: cols = 6; break;
+ case HEX_NORMAL:
+ default: cols = 16; break;
+ }
+
+ if (octspergrp < 0)
+ switch (hextype)
+ {
+ case HEX_BITS: octspergrp = 1; break;
+ case HEX_NORMAL: octspergrp = 2; break;
+ case HEX_POSTSCRIPT:
+ case HEX_CINCLUDE:
+ default: octspergrp = 0; break;
+ }
+
+ if (cols < 1 || (!hextype && (cols > COLS)))
+ {
+ fprintf(stderr, "%s: invalid number of columns (max. %d).\n", pname, COLS);
+ exit(1);
+ }
+
+ if (octspergrp < 1)
+ octspergrp = cols;
+
+ if (argc > 3)
+ exit_with_usage(pname);
+
+ if (argc == 1 || (argv[1][0] == '-' && !argv[1][1]))
+ BIN_ASSIGN(fp = stdin, !revert);
+ else
+ {
+ if ((fp = fopen(argv[1], BIN_READ(!revert))) == NULL)
+ {
+ fprintf(stderr,"%s: ", pname);
+ perror(argv[1]);
+ return 2;
+ }
+ }
+
+ if (argc < 3 || (argv[2][0] == '-' && !argv[2][1]))
+ BIN_ASSIGN(fpo = stdout, revert);
+ else
+ {
+ int fd;
+ int mode = revert ? O_WRONLY : (O_TRUNC|O_WRONLY);
+
+ if (((fd = OPEN(argv[2], mode | BIN_CREAT(revert), 0666)) < 0) ||
+ (fpo = fdopen(fd, BIN_WRITE(revert))) == NULL)
+ {
+ fprintf(stderr, "%s: ", pname);
+ perror(argv[2]);
+ return 3;
+ }
+ rewind(fpo);
+ }
+
+ if (revert)
+ {
+ if (hextype && (hextype != HEX_POSTSCRIPT))
+ {
+ fprintf(stderr, "%s: sorry, cannot revert this type of hexdump\n", pname);
+ return -1;
+ }
+ return huntype(fp, fpo, stderr, pname, cols, hextype,
+ negseek ? -seekoff : seekoff);
+ }
+
+ if (seekoff || negseek || !relseek)
+ {
+#ifdef TRY_SEEK
+ if (relseek)
+ e = fseek(fp, negseek ? -seekoff : seekoff, 1);
+ else
+ e = fseek(fp, negseek ? -seekoff : seekoff, negseek ? 2 : 0);
+ if (e < 0 && negseek)
+ {
+ fprintf(stderr, "%s: sorry cannot seek.\n", pname);
+ return 4;
+ }
+ if (e >= 0)
+ seekoff = ftell(fp);
+ else
+#endif
+ {
+ long s = seekoff;
+
+ while (s--)
+ (void)getc(fp);
+ }
+ }
+
+ if (hextype == HEX_CINCLUDE)
+ {
+ if (fp != stdin)
+ {
+ fprintf(fpo, "unsigned char %s", isdigit((int)argv[1][0]) ? "__" : "");
+ for (e = 0; (c = argv[1][e]) != 0; e++)
+ putc(isalnum(c) ? c : '_', fpo);
+ fputs("[] = {\n", fpo);
+ }
+
+ p = 0;
+ while ((length < 0 || p < length) && (c = getc(fp)) != EOF)
+ {
+ fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X",
+ (p % cols) ? ", " : ",\n "+2*!p, c);
+ p++;
+ }
+
+ if (p)
+ fputs("\n};\n"+3*(fp == stdin), fpo);
+
+ if (fp != stdin)
+ {
+ fprintf(fpo, "unsigned int %s", isdigit((int)argv[1][0]) ? "__" : "");
+ for (e = 0; (c = argv[1][e]) != 0; e++)
+ putc(isalnum(c) ? c : '_', fpo);
+ fprintf(fpo, "_len = %d;\n", p);
+ }
+
+ fclose(fp);
+ fclose(fpo);
+ return 0;
+ }
+
+ if (hextype == HEX_POSTSCRIPT)
+ {
+ p = cols;
+ while ((length < 0 || n < length) && (e = getc(fp)) != EOF)
+ {
+ putchar(hexx[(e >> 4) & 0xf]);
+ putchar(hexx[(e ) & 0xf]);
+ n++;
+ if (!--p)
+ {
+ putchar('\n');
+ p = cols;
+ }
+ }
+ if (p < cols)
+ putchar('\n');
+ fclose(fp);
+ fclose(fpo);
+ return 0;
+ }
+
+ /* hextype: HEX_NORMAL or HEX_BITS */
+
+ if (hextype == HEX_NORMAL)
+ grplen = octspergrp + octspergrp + 1; /* chars per octet group */
+ else /* hextype == HEX_BITS */
+ grplen = 8 * octspergrp + 1;
+
+ while ((length < 0 || n < length) && (e = getc(fp)) != EOF)
+ {
+ if (p == 0)
+ {
+ sprintf(l, "%07lx: ", n + seekoff);
+ for (c = 9; c < LLEN; l[c++] = ' ');
+ }
+ if (hextype == HEX_NORMAL)
+ {
+ l[c = (9 + (grplen * p) / octspergrp)] = hexx[(e >> 4) & 0xf];
+ l[++c] = hexx[ e & 0xf];
+ }
+ else /* hextype == HEX_BITS */
+ {
+ int i;
+
+ c = (9 + (grplen * p) / octspergrp) - 1;
+ for (i = 7; i >= 0; i--)
+ l[++c] = (e & (1 << i)) ? '1' : '0';
+ }
+ if (ebcdic)
+ e = (e < 64) ? '.' : etoa64[e-64];
+ l[11 + (grplen * cols - 1)/octspergrp + p] =
+#ifdef __MVS__
+ (e >= 64)
+#else
+ (e > 31 && e < 127)
+#endif
+ ? e : '.';
+ if (e)
+ nonzero++;
+ n++;
+ if (++p == cols)
+ {
+ l[c = (11 + (grplen * cols - 1)/octspergrp + p)] = '\n'; l[++c] = '\0';
+ xxdline(fpo, l, autoskip ? nonzero : 1);
+ nonzero = 0;
+ p = 0;
+ }
+ }
+ if (p)
+ {
+ l[c = (11 + (grplen * cols - 1)/octspergrp + p)] = '\n'; l[++c] = '\0';
+ xxdline(fpo, l, 1);
+ }
+ else if (autoskip)
+ xxdline(fpo, l, -1); /* last chance to flush out supressed lines */
+
+ fclose(fp);
+ fclose(fpo);
+ return 0;
+}
diff --git a/uninstal.txt b/uninstal.txt
new file mode 100644
index 000000000..bb06c9935
--- /dev/null
+++ b/uninstal.txt
@@ -0,0 +1,80 @@
+Uninstalling Vim on Dos and MS-Windows.
+
+There are three ways to remove Vim:
+
+1. With the GUI uninstaller.
+ This is only available when Vim was installed with the self-installing
+ executable. This has a minimal number of questions. It can delete
+ everything that was installed. This also unregisters the VisVim.dll
+
+2. With uninstal.exe.
+ This removes most installed items, but does not delete the files you
+ unpacked.
+
+3. By hand.
+ This is a bit more work, but you can decide exactly what you want to
+ remove. For uninstalling the "Edit with Vim" popup menu entry you still
+ have to use uninstal.exe.
+
+It's recommended to use the method that matches with how you installed Vim.
+Thus if you installed Vim by hand, deleted it by hand.
+
+The first two methods should be available from the Add/Remove software window
+and the Vim entry in the Start menu. If these have been removed already, find
+"uninstall-gui.exe" or "uninstal.exe" in the Vim directory.
+ Running these programs should be self-explanatory. Carefully read the
+messages to avoid deleting something you want to keep.
+
+Here are guidelines for removing Vim by hand:
+
+1. Remove the "Edit with Vim" popup menu entry, if it exists. This will only
+ be on MS-Windows 95/98/NT. This is done by running the uninstal.exe
+ program. It removes the registry entries for the "Edit with Vim" popup
+ menu entry. You only need to run uninstal.exe when you have installed the
+ menu entry. You can also run uninstal.exe from the Control panel with the
+ Add/Remove programs application.
+ Note that uninstal.exe offers you to uninstal other items. You can skip
+ this.
+
+2. Only if you have used the OLE version of gvim: Remove the registration of
+ this program by running "gvim -unregister" in a console window.
+
+3. Delete the executables. If you copied the executables to another location,
+ you will have to delete them from where you copied them to. If you don't
+ remember where they are, look in the directories from the $PATH environment
+ variable.
+ If you created .bat files when installing Vim, also search for vim.bat,
+ gvim.bat, etc.
+
+4. If you completely want to delete vim, and are not going to install another
+ version, you can delete the vimrc files that you created. These are
+ normally located in a directory like "C:\vim". If the $VIM environment
+ variable is set, it will tell the name of the directory. Normally you can
+ delete everything in this directory. Warning: You might have put some
+ files there that you would like to save. If you did remove it all, you can
+ skip the next step.
+
+5. Delete the distributed files. If you followed the directions, these will
+ be located in a directory like "C:\vim\vim54". If the $VIM environment
+ variable is set, the directory will be $VIM\vim54. Delete the "vim54"
+ directory and all that is in it. Warning: If you changed any of the
+ distributed files, or added some of your own files, you might want to save
+ these first. But normally you would not have changed or added files here.
+
+6. Remove setting the $VIM and $VIMRUNTIME environment variable and adjust
+ $PATH. $VIM only needs to be removed if you are not going to install
+ another version of Vim. $VIMRUNTIME is mostly not set. Check if $PATH
+ contains the path of the vim directory. Note that $PATH may be set in
+ several places, you will have to find the right one, and only delete the
+ Vim path from it. You can most likely find the lines that set $PATH, $VIM
+ and/or $VIMRUNTIME in C:\autoexec.bat. Under Windows NT you might need to
+ use the "System Properties" editor to change the environment variables, if
+ they are not in the C:\autoexec.bat file. You can start it by selecting
+ Start/Settings/Control Panel and then "System".
+
+7. If you added a Vim entry in the start menu, delete it.
+
+8. If you created icons for Vim on the desktop, delete them.
+
+Vim does not use .ini files. The above should remove all Vim files, except
+the ones that you moved elsewhere yourself.
diff --git a/vimdir.info b/vimdir.info
new file mode 100755
index 000000000..ddb2a1462
--- /dev/null
+++ b/vimdir.info
Binary files differ
diff --git a/vimtutor.bat b/vimtutor.bat
new file mode 100644
index 000000000..b147a8c44
--- /dev/null
+++ b/vimtutor.bat
@@ -0,0 +1,67 @@
+:: Start Vim on a copy of the tutor file.
+@echo off
+
+:: Usage: vimtutor [-console] [xx]
+::
+:: -console means gvim will not be used
+:: xx is a language code like "es" or "nl".
+:: When an xx argument is given, it tries loading that tutor.
+:: When this fails or no xx argument was given, it tries using 'v:lang'
+:: When that also fails, it uses the English version.
+
+:: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
+FOR %%d in (. %TMP% %TEMP%) DO IF EXIST %%d\nul SET TUTORCOPY=%%d\$tutor$
+
+SET xx=%1
+
+IF NOT .%1==.-console GOTO use_gui
+SHIFT
+SET xx=%1
+GOTO use_vim
+:use_gui
+
+:: Try making a copy of tutor with gvim. If gvim cannot be found, try using
+:: vim instead. If vim cannot be found, alert user to check environment and
+:: installation.
+
+:: The script tutor.vim tells Vim which file to copy.
+:: For Windows NT "start" works a bit differently.
+IF .%OS%==.Windows_NT GOTO ntaction
+
+start /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
+IF ERRORLEVEL 1 GOTO use_vim
+
+:: Start gvim without any .vimrc, set 'nocompatible'
+start /w gvim -u NONE -c "set nocp" %TUTORCOPY%
+
+GOTO end
+
+:ntaction
+start "dummy" /b /w gvim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
+IF ERRORLEVEL 1 GOTO use_vim
+
+:: Start gvim without any .vimrc, set 'nocompatible'
+start "dummy" /b /w gvim -u NONE -c "set nocp" %TUTORCOPY%
+
+GOTO end
+
+:use_vim
+:: The script tutor.vim tells Vim which file to copy
+vim -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
+IF ERRORLEVEL 1 GOTO no_executable
+
+:: Start vim without any .vimrc, set 'nocompatible'
+vim -u NONE -c "set nocp" %TUTORCOPY%
+
+GOTO end
+
+:no_executable
+ECHO.
+ECHO.
+ECHO No vim or gvim found in current directory or PATH.
+ECHO Check your installation or re-run install.exe
+
+:end
+:: remove the copy of the tutor
+IF EXIST %TUTORCOPY% DEL %TUTORCOPY%
+SET xx=
diff --git a/vimtutor.com b/vimtutor.com
new file mode 100755
index 000000000..0e6854be6
--- /dev/null
+++ b/vimtutor.com
@@ -0,0 +1,104 @@
+$ !
+$ !=====================================================================
+$ !
+$ ! VimTutor.com version 29-Aug-2002
+$ !
+$ ! Author: Tom Wyant <Thomas.R.Wyant-III@usa.dupont.com>
+$ !
+$ ! This DCL command procedure executes the vimtutor command
+$ ! (suprise, suprise!) which gives you a brief tutorial on the VIM
+$ ! editor. Languages other than the default are supported in the
+$ ! usual way, as are at least some of the command qualifiers,
+$ ! though you'll need to play some fairly serious games with DCL
+$ ! to specify ones that need quoting.
+$ !
+$ ! Copyright (c) 2002 E. I. DuPont de Nemours and Company, Inc
+$ !
+$ ! This program is free software; you can redistribute it and/or
+$ ! modify it under the terms of the VIM license as available from
+$ ! the vim 6.1 ":help license" command or (at your option) the
+$ ! license from any later version of vim.
+$ !
+$ ! This program is distributed in the hope that it will be useful,
+$ ! but WITHOUT ANY WARRANTY; without even the implied warranty of
+$ ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+$ !
+$ !=====================================================================
+$ !
+$ !
+$ ! Check for the existence of VIM, and die if it isn't there.
+$ !
+$ if f$search ("vim:vim.exe") .eqs. ""
+$ then
+$ write sys$error "Error - Can't run tutoral. VIM not found."
+$ exit
+$ endif
+$ !
+$ !
+$ ! Pick up the argument, if any.
+$ !
+$ inx = 0
+$ arg_loop:
+$ inx = inx + 1
+$ if f$type (p'inx') .nes. ""
+$ then
+$ if p'inx' .nes. "" .and. f$locate ("-", p'inx') .ne. 0
+$ then
+$ xx = p'inx'
+$ assign/nolog "''xx'" xx
+$ p'inx' = ""
+$ endif
+$ goto arg_loop
+$ endif
+$ !
+$ !
+$ ! Make sure we clean up our toys when we're through playing.
+$ !
+$ on error then goto exit
+$ !
+$ !
+$ ! Create the VIM foreign command if needed
+$ !
+$ if f$type (vim) .eqs. "" then vim := $vim:vim
+$ !
+$ !
+$ ! Build the name for our temp file.
+$ !
+$ tutfil = "sys$login:vimtutor_" + -
+ f$edit (f$getjpi (0, "pid"), "trim") + "."
+$ assign/nolog 'tutfil' TUTORCOPY
+$ !
+$ !
+$ ! Copy the selected file to the temp file
+$ !
+$ assign/nolog/user nla0: sys$error
+$ assign/nolog/user nla0: sys$output
+$ vim -u "NONE" -c "so $VIMRUNTIME/tutor/tutor.vim"
+$ !
+$ !
+$ ! Run the tutorial
+$ !
+$ assign/nolog/user sys$command sys$input
+$ vim -u "NONE" -c "set nocp" 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' 'tutfil'
+$ !
+$ !
+$ ! Ditch the copy.
+$ !
+$ exit:
+$ if f$type (tutfil) .nes. "" .and. f$search (tutfil) .nes. "" then -
+$ delete 'tutfil';*
+$ if f$type (xx) .nes. "" then deassign xx
+$ deassign TUTORCOPY
+$ exit
+$ !
+$ !=====================================================================
+$ !
+$ ! Modification history
+$ !
+$ ! 29-Aug-2002 T. R. Wyant
+$ ! Changed license to vim.
+$ ! Fix error "input is not from a terminal"
+$ ! Juggle documentation (copyright and contact to front,
+$ ! modification history to end).
+$ ! 25-Jul-2002 T. R. Wyant
+$ ! Initial version